From 03866009975cbaf821d07bed2330a96f74758b06 Mon Sep 17 00:00:00 2001 From: ninabreznik Date: Sun, 28 Oct 2018 11:52:54 +0100 Subject: [PATCH 1/9] Play --- JudgingCriteria.md | 47 - LICENSE | 373 - PiratesCode.md | 39 - README.md | 31 - bundle.js | 1080 + index.html | 8 + json_s/1.json | 15 + json_s/10.json | 17 + json_s/2.json | 18 + json_s/3.json | 17 + json_s/4.json | 19 + json_s/5.json | 17 + json_s/6.json | 21 + json_s/7.json | 17 + json_s/8.json | 17 + json_s/9.json | 19 + node_modules/.bin/JSONStream | 1 + node_modules/.bin/acorn | 1 + node_modules/.bin/atob | 1 + node_modules/.bin/browser-pack | 1 + node_modules/.bin/browserify | 1 + node_modules/.bin/budo | 1 + node_modules/.bin/deps-sort | 1 + node_modules/.bin/detective | 1 + node_modules/.bin/garnish | 1 + node_modules/.bin/has-ansi | 1 + node_modules/.bin/insert-module-globals | 1 + node_modules/.bin/miller-rabin | 1 + node_modules/.bin/mime | 1 + node_modules/.bin/mkdirp | 1 + node_modules/.bin/module-deps | 1 + node_modules/.bin/semver | 1 + node_modules/.bin/sha.js | 1 + node_modules/.bin/supports-color | 1 + node_modules/.bin/umd | 1 + node_modules/.bin/undeclared-identifiers | 1 + node_modules/.bin/watchify | 1 + node_modules/.bin/which | 1 + node_modules/@babel/polyfill/LICENSE | 22 + node_modules/@babel/polyfill/README.md | 19 + node_modules/@babel/polyfill/browser.js | 3 + node_modules/@babel/polyfill/dist/polyfill.js | 6568 ++++ .../@babel/polyfill/dist/polyfill.min.js | 3 + node_modules/@babel/polyfill/lib/index.js | 29 + .../@babel/polyfill/lib/noConflict.js | 23 + node_modules/@babel/polyfill/noConflict.js | 1 + node_modules/@babel/polyfill/package.json | 47 + .../@babel/polyfill/scripts/build-dist.sh | 17 + .../@babel/polyfill/scripts/postpublish.js | 8 + .../@babel/polyfill/scripts/prepublish.js | 13 + node_modules/JSONStream/.travis.yml | 8 + node_modules/JSONStream/LICENSE.APACHE2 | 15 + node_modules/JSONStream/LICENSE.MIT | 24 + node_modules/JSONStream/bin.js | 12 + node_modules/JSONStream/examples/all_docs.js | 13 + node_modules/JSONStream/index.js | 247 + node_modules/JSONStream/package.json | 78 + node_modules/JSONStream/readme.markdown | 207 + node_modules/JSONStream/test/bool.js | 41 + node_modules/JSONStream/test/browser.js | 18 + .../JSONStream/test/destroy_missing.js | 27 + node_modules/JSONStream/test/doubledot1.js | 29 + node_modules/JSONStream/test/doubledot2.js | 30 + node_modules/JSONStream/test/empty.js | 44 + .../JSONStream/test/error_contents.js | 45 + .../JSONStream/test/fixtures/all_npm.json | 4030 +++ .../test/fixtures/couch_sample.json | 18 + .../JSONStream/test/fixtures/depth.json | 15 + .../JSONStream/test/fixtures/error.json | 1 + .../test/fixtures/header_footer.json | 19 + node_modules/JSONStream/test/fn.js | 39 + node_modules/JSONStream/test/gen.js | 135 + node_modules/JSONStream/test/header_footer.js | 55 + node_modules/JSONStream/test/issues.js | 34 + node_modules/JSONStream/test/keys.js | 105 + node_modules/JSONStream/test/map.js | 40 + .../JSONStream/test/multiple_objects.js | 36 + .../JSONStream/test/multiple_objects_error.js | 29 + node_modules/JSONStream/test/null.js | 28 + node_modules/JSONStream/test/parsejson.js | 29 + node_modules/JSONStream/test/run.js | 13 + node_modules/JSONStream/test/stringify.js | 41 + .../JSONStream/test/stringify_object.js | 47 + node_modules/JSONStream/test/test.js | 35 + node_modules/JSONStream/test/test2.js | 29 + node_modules/JSONStream/test/two-ways.js | 41 + .../acorn-dynamic-import/CHANGELOG.md | 28 + node_modules/acorn-dynamic-import/LICENSE | 21 + node_modules/acorn-dynamic-import/README.md | 29 + .../acorn-dynamic-import/lib/index.js | 84 + node_modules/acorn-dynamic-import/lib/walk.js | 16 + .../acorn-dynamic-import/package.json | 78 + .../acorn-dynamic-import/src/index.js | 38 + node_modules/acorn-dynamic-import/src/walk.js | 9 + node_modules/acorn-node/.travis.yml | 21 + node_modules/acorn-node/CHANGELOG.md | 59 + node_modules/acorn-node/LICENSE.md | 95 + node_modules/acorn-node/README.md | 51 + node_modules/acorn-node/build.js | 21 + node_modules/acorn-node/index.js | 34 + node_modules/acorn-node/lib/bigint/index.js | 65 + .../acorn-node/lib/import-meta/index.js | 58 + node_modules/acorn-node/package.json | 77 + node_modules/acorn-node/test/index.js | 112 + node_modules/acorn-node/walk.js | 58 + node_modules/acorn-walk/CHANGELOG.md | 97 + node_modules/acorn-walk/LICENSE | 19 + node_modules/acorn-walk/README.md | 126 + node_modules/acorn-walk/dist/walk.es.js | 436 + node_modules/acorn-walk/dist/walk.es.js.map | 1 + node_modules/acorn-walk/dist/walk.js | 456 + node_modules/acorn-walk/dist/walk.js.map | 1 + node_modules/acorn-walk/package.json | 63 + node_modules/acorn/CHANGELOG.md | 438 + node_modules/acorn/LICENSE | 19 + node_modules/acorn/README.md | 269 + node_modules/acorn/bin/acorn | 4 + node_modules/acorn/dist/acorn.d.ts | 208 + node_modules/acorn/dist/acorn.js | 5314 +++ node_modules/acorn/dist/acorn.js.map | 1 + node_modules/acorn/dist/acorn.mjs | 5283 +++ node_modules/acorn/dist/acorn.mjs.map | 1 + node_modules/acorn/dist/bin.js | 68 + node_modules/acorn/package.json | 66 + node_modules/ansi-regex/index.js | 4 + node_modules/ansi-regex/package.json | 84 + node_modules/ansi-regex/readme.md | 33 + node_modules/ansi-styles/index.js | 40 + node_modules/ansi-styles/package.json | 78 + node_modules/ansi-styles/readme.md | 70 + node_modules/anymatch/LICENSE | 15 + node_modules/anymatch/README.md | 98 + node_modules/anymatch/index.js | 67 + node_modules/anymatch/package.json | 73 + node_modules/arr-diff/LICENSE | 21 + node_modules/arr-diff/README.md | 74 + node_modules/arr-diff/index.js | 58 + node_modules/arr-diff/package.json | 80 + node_modules/arr-flatten/LICENSE | 21 + node_modules/arr-flatten/README.md | 86 + node_modules/arr-flatten/index.js | 22 + node_modules/arr-flatten/package.json | 114 + node_modules/arr-union/LICENSE | 21 + node_modules/arr-union/README.md | 99 + node_modules/arr-union/index.js | 29 + node_modules/arr-union/package.json | 108 + node_modules/array-filter/.npmignore | 1 + node_modules/array-filter/.travis.yml | 4 + node_modules/array-filter/README.md | 54 + node_modules/array-filter/index.js | 19 + node_modules/array-filter/package.json | 75 + node_modules/array-filter/test/filter.js | 12 + node_modules/array-filter/test/holes.js | 12 + node_modules/array-map/.travis.yml | 4 + node_modules/array-map/LICENSE | 18 + node_modules/array-map/example/map.js | 5 + node_modules/array-map/index.js | 11 + node_modules/array-map/package.json | 77 + node_modules/array-map/readme.markdown | 46 + node_modules/array-map/test/map.js | 77 + node_modules/array-reduce/.travis.yml | 4 + node_modules/array-reduce/LICENSE | 18 + node_modules/array-reduce/example/sum.js | 4 + node_modules/array-reduce/index.js | 18 + node_modules/array-reduce/package.json | 76 + node_modules/array-reduce/readme.markdown | 46 + node_modules/array-reduce/test/reduce.js | 85 + node_modules/array-unique/LICENSE | 21 + node_modules/array-unique/README.md | 51 + node_modules/array-unique/index.js | 28 + node_modules/array-unique/package.json | 62 + node_modules/asn1.js/README.md | 100 + node_modules/asn1.js/lib/asn1.js | 9 + node_modules/asn1.js/lib/asn1/api.js | 61 + node_modules/asn1.js/lib/asn1/base/buffer.js | 116 + node_modules/asn1.js/lib/asn1/base/index.js | 6 + node_modules/asn1.js/lib/asn1/base/node.js | 634 + .../asn1.js/lib/asn1/base/reporter.js | 121 + .../asn1.js/lib/asn1/constants/der.js | 42 + .../asn1.js/lib/asn1/constants/index.js | 19 + node_modules/asn1.js/lib/asn1/decoders/der.js | 324 + .../asn1.js/lib/asn1/decoders/index.js | 4 + node_modules/asn1.js/lib/asn1/decoders/pem.js | 49 + node_modules/asn1.js/lib/asn1/encoders/der.js | 295 + .../asn1.js/lib/asn1/encoders/index.js | 4 + node_modules/asn1.js/lib/asn1/encoders/pem.js | 21 + node_modules/asn1.js/package.json | 58 + node_modules/assert/.npmignore | 1 + node_modules/assert/.travis.yml | 31 + node_modules/assert/.zuul.yml | 13 + node_modules/assert/LICENSE | 18 + node_modules/assert/README.md | 64 + node_modules/assert/assert.js | 490 + .../assert/node_modules/inherits/LICENSE | 16 + .../assert/node_modules/inherits/README.md | 42 + .../assert/node_modules/inherits/inherits.js | 1 + .../node_modules/inherits/inherits_browser.js | 23 + .../assert/node_modules/inherits/package.json | 54 + .../assert/node_modules/inherits/test.js | 25 + .../assert/node_modules/util/.npmignore | 1 + .../assert/node_modules/util/.travis.yml | 8 + .../assert/node_modules/util/.zuul.yml | 10 + node_modules/assert/node_modules/util/LICENSE | 18 + .../assert/node_modules/util/README.md | 15 + .../assert/node_modules/util/package.json | 59 + .../node_modules/util/support/isBuffer.js | 3 + .../util/support/isBufferBrowser.js | 6 + .../node_modules/util/test/browser/inspect.js | 41 + .../node_modules/util/test/browser/is.js | 91 + .../node_modules/util/test/node/debug.js | 86 + .../node_modules/util/test/node/format.js | 77 + .../node_modules/util/test/node/inspect.js | 195 + .../assert/node_modules/util/test/node/log.js | 58 + .../node_modules/util/test/node/util.js | 83 + node_modules/assert/node_modules/util/util.js | 586 + node_modules/assert/package.json | 58 + node_modules/assert/test.js | 345 + node_modules/assign-symbols/LICENSE | 21 + node_modules/assign-symbols/README.md | 73 + node_modules/assign-symbols/index.js | 40 + node_modules/assign-symbols/package.json | 71 + node_modules/async-each/.npmignore | 3 + node_modules/async-each/CHANGELOG.md | 23 + node_modules/async-each/README.md | 38 + node_modules/async-each/index.js | 38 + node_modules/async-each/package.json | 60 + node_modules/atob/LICENSE | 230 + node_modules/atob/LICENSE.DOCS | 319 + node_modules/atob/README.md | 49 + node_modules/atob/bin/atob.js | 6 + node_modules/atob/bower.json | 24 + node_modules/atob/browser-atob.js | 44 + node_modules/atob/node-atob.js | 7 + node_modules/atob/package.json | 53 + node_modules/atob/test.js | 18 + node_modules/balanced-match/.npmignore | 5 + node_modules/balanced-match/LICENSE.md | 21 + node_modules/balanced-match/README.md | 91 + node_modules/balanced-match/index.js | 59 + node_modules/balanced-match/package.json | 77 + node_modules/base/LICENSE | 21 + node_modules/base/README.md | 491 + node_modules/base/index.js | 435 + .../base/node_modules/define-property/LICENSE | 21 + .../node_modules/define-property/README.md | 95 + .../node_modules/define-property/index.js | 31 + .../node_modules/define-property/package.json | 93 + .../is-accessor-descriptor/LICENSE | 21 + .../is-accessor-descriptor/README.md | 144 + .../is-accessor-descriptor/index.js | 69 + .../is-accessor-descriptor/package.json | 110 + .../node_modules/is-data-descriptor/LICENSE | 21 + .../node_modules/is-data-descriptor/README.md | 161 + .../node_modules/is-data-descriptor/index.js | 49 + .../is-data-descriptor/package.json | 109 + .../base/node_modules/is-descriptor/LICENSE | 21 + .../base/node_modules/is-descriptor/README.md | 193 + .../base/node_modules/is-descriptor/index.js | 22 + .../node_modules/is-descriptor/package.json | 114 + .../base/node_modules/isobject/LICENSE | 21 + .../base/node_modules/isobject/README.md | 122 + .../base/node_modules/isobject/index.d.ts | 5 + .../base/node_modules/isobject/index.js | 12 + .../base/node_modules/isobject/package.json | 119 + .../base/node_modules/kind-of/CHANGELOG.md | 157 + .../base/node_modules/kind-of/LICENSE | 21 + .../base/node_modules/kind-of/README.md | 365 + .../base/node_modules/kind-of/index.js | 129 + .../base/node_modules/kind-of/package.json | 145 + node_modules/base/package.json | 162 + node_modules/base64-js/LICENSE | 21 + node_modules/base64-js/README.md | 34 + node_modules/base64-js/base64js.min.js | 1 + node_modules/base64-js/index.js | 151 + node_modules/base64-js/package.json | 65 + node_modules/base64-js/test/big-data.js | 25 + node_modules/base64-js/test/convert.js | 88 + node_modules/base64-js/test/corrupt.js | 10 + node_modules/base64-js/test/url-safe.js | 24 + node_modules/bel/.travis.yml | 5 + node_modules/bel/README.md | 186 + node_modules/bel/appendChild.js | 131 + node_modules/bel/bel.d.ts | 4 + node_modules/bel/bench/bench.js | 11 + node_modules/bel/bench/create-trees.js | 53 + node_modules/bel/bench/index.js | 1 + node_modules/bel/browser.js | 99 + node_modules/bel/index.js | 5 + node_modules/bel/package.json | 73 + node_modules/bel/raw.js | 25 + node_modules/bel/test/api.js | 36 + node_modules/bel/test/elements.js | 182 + node_modules/bel/test/events.js | 551 + node_modules/bel/test/index.js | 4 + node_modules/bel/test/raw.js | 13 + node_modules/bel/test/server.js | 54 + .../binary-extensions/binary-extensions.json | 250 + node_modules/binary-extensions/license | 9 + node_modules/binary-extensions/package.json | 68 + node_modules/binary-extensions/readme.md | 33 + node_modules/bn.js/.npmignore | 8 + node_modules/bn.js/README.md | 221 + node_modules/bn.js/lib/bn.js | 3427 ++ node_modules/bn.js/package.json | 71 + node_modules/bn.js/util/genCombMulTo.js | 65 + node_modules/bn.js/util/genCombMulTo10.js | 65 + node_modules/bole/.jshintrc | 59 + node_modules/bole/.npmignore | 1 + node_modules/bole/LICENSE.md | 11 + node_modules/bole/README.md | 126 + node_modules/bole/bole.js | 126 + node_modules/bole/package.json | 63 + node_modules/bole/test.js | 451 + node_modules/brace-expansion/LICENSE | 21 + node_modules/brace-expansion/README.md | 129 + node_modules/brace-expansion/index.js | 201 + node_modules/brace-expansion/package.json | 75 + node_modules/braces/LICENSE | 21 + node_modules/braces/README.md | 248 + node_modules/braces/index.js | 399 + node_modules/braces/package.json | 114 + node_modules/brorand/.npmignore | 2 + node_modules/brorand/README.md | 26 + node_modules/brorand/index.js | 65 + node_modules/brorand/package.json | 60 + node_modules/brorand/test/api-test.js | 8 + node_modules/browser-pack/.travis.yml | 9 + node_modules/browser-pack/CHANGELOG.md | 10 + node_modules/browser-pack/LICENSE | 18 + node_modules/browser-pack/_prelude.js | 1 + node_modules/browser-pack/bin/cmd.js | 4 + node_modules/browser-pack/bin/prepublish.js | 21 + node_modules/browser-pack/example/input.json | 13 + node_modules/browser-pack/example/output.js | 1 + .../browser-pack/example/sourcemap/input.json | 15 + .../browser-pack/example/sourcemap/output.js | 6 + node_modules/browser-pack/index.js | 127 + node_modules/browser-pack/package.json | 91 + node_modules/browser-pack/prelude.js | 50 + node_modules/browser-pack/readme.markdown | 97 + node_modules/browser-pack/test/comment.js | 33 + node_modules/browser-pack/test/empty.js | 33 + node_modules/browser-pack/test/not_found.js | 34 + .../browser-pack/test/only_execute_entries.js | 26 + node_modules/browser-pack/test/order.js | 38 + node_modules/browser-pack/test/pack.js | 28 + node_modules/browser-pack/test/raw.js | 32 + .../browser-pack/test/source-maps-existing.js | 59 + node_modules/browser-pack/test/source-maps.js | 221 + node_modules/browser-pack/test/this.js | 24 + node_modules/browser-pack/test/unicode.js | 32 + node_modules/browser-resolve/LICENSE | 21 + node_modules/browser-resolve/README.md | 146 + node_modules/browser-resolve/empty.js | 0 node_modules/browser-resolve/index.js | 345 + .../node_modules/resolve/.travis.yml | 4 + .../node_modules/resolve/LICENSE | 18 + .../node_modules/resolve/example/async.js | 5 + .../node_modules/resolve/example/sync.js | 3 + .../node_modules/resolve/index.js | 5 + .../node_modules/resolve/lib/async.js | 192 + .../node_modules/resolve/lib/caller.js | 8 + .../node_modules/resolve/lib/core.js | 4 + .../node_modules/resolve/lib/core.json | 38 + .../resolve/lib/node-modules-paths.js | 38 + .../node_modules/resolve/lib/sync.js | 81 + .../node_modules/resolve/package.json | 58 + .../node_modules/resolve/readme.markdown | 148 + .../node_modules/resolve/test/core.js | 12 + .../node_modules/resolve/test/dotdot.js | 29 + .../resolve/test/dotdot/abc/index.js | 2 + .../node_modules/resolve/test/dotdot/index.js | 1 + .../resolve/test/faulty_basedir.js | 17 + .../node_modules/resolve/test/filter.js | 18 + .../node_modules/resolve/test/filter_sync.js | 15 + .../node_modules/resolve/test/mock.js | 142 + .../node_modules/resolve/test/mock_sync.js | 68 + .../node_modules/resolve/test/module_dir.js | 56 + .../test/module_dir/xmodules/aaa/index.js | 1 + .../test/module_dir/ymodules/aaa/index.js | 1 + .../test/module_dir/zmodules/bbb/main.js | 1 + .../test/module_dir/zmodules/bbb/package.json | 3 + .../node_modules/resolve/test/node_path.js | 48 + .../resolve/test/node_path/x/aaa/index.js | 1 + .../resolve/test/node_path/x/ccc/index.js | 1 + .../resolve/test/node_path/y/bbb/index.js | 1 + .../resolve/test/node_path/y/ccc/index.js | 1 + .../node_modules/resolve/test/nonstring.js | 9 + .../node_modules/resolve/test/pathfilter.js | 35 + .../resolve/test/pathfilter/deep_ref/main.js | 0 .../deep_ref/node_modules/deep/alt.js | 0 .../deep_ref/node_modules/deep/deeper/ref.js | 0 .../deep_ref/node_modules/deep/package.json | 4 + .../deep_ref/node_modules/deep/ref.js | 0 .../node_modules/resolve/test/precedence.js | 23 + .../resolve/test/precedence/aaa.js | 1 + .../resolve/test/precedence/aaa/index.js | 1 + .../resolve/test/precedence/aaa/main.js | 1 + .../resolve/test/precedence/bbb.js | 1 + .../resolve/test/precedence/bbb/main.js | 1 + .../node_modules/resolve/test/resolver.js | 281 + .../resolver/bar/node_modules/foo/index.js | 1 + .../resolve/test/resolver/baz/doom.js | 0 .../resolve/test/resolver/baz/package.json | 3 + .../resolve/test/resolver/baz/quux.js | 1 + .../biz/node_modules/garply/lib/index.js | 1 + .../biz/node_modules/garply/package.json | 3 + .../resolver/biz/node_modules/grux/index.js | 1 + .../resolver/biz/node_modules/tiv/index.js | 1 + .../resolve/test/resolver/cup.coffee | 1 + .../node_modules/resolve/test/resolver/foo.js | 1 + .../test/resolver/incorrect_main/index.js | 2 + .../test/resolver/incorrect_main/package.json | 3 + .../resolve/test/resolver/mug.coffee | 0 .../node_modules/resolve/test/resolver/mug.js | 0 .../test/resolver/other_path/lib/other-lib.js | 0 .../resolve/test/resolver/other_path/root.js | 0 .../punycode/node_modules/punycode/index.js | 0 .../resolve/test/resolver/quux/foo/index.js | 1 + .../test/resolver/without_basedir/main.js | 6 + .../without_basedir/node_modules/mymodule.js | 1 + .../resolve/test/resolver_sync.js | 180 + .../node_modules/resolve/test/subdirs.js | 13 + .../test/subdirs/node_modules/a/b/c/x.json | 1 + .../test/subdirs/node_modules/a/package.json | 1 + node_modules/browser-resolve/package.json | 62 + node_modules/browserify-aes/.travis.yml | 15 + node_modules/browserify-aes/LICENSE | 21 + node_modules/browserify-aes/README.md | 19 + node_modules/browserify-aes/aes.js | 228 + node_modules/browserify-aes/authCipher.js | 117 + node_modules/browserify-aes/browser.js | 13 + node_modules/browserify-aes/decrypter.js | 124 + node_modules/browserify-aes/encrypter.js | 114 + node_modules/browserify-aes/ghash.js | 89 + node_modules/browserify-aes/incr32.js | 15 + node_modules/browserify-aes/index.js | 7 + node_modules/browserify-aes/modes/cbc.js | 17 + node_modules/browserify-aes/modes/cfb.js | 33 + node_modules/browserify-aes/modes/cfb1.js | 42 + node_modules/browserify-aes/modes/cfb8.js | 25 + node_modules/browserify-aes/modes/ctr.js | 30 + node_modules/browserify-aes/modes/ecb.js | 7 + node_modules/browserify-aes/modes/index.js | 18 + node_modules/browserify-aes/modes/list.json | 191 + node_modules/browserify-aes/modes/ofb.js | 16 + node_modules/browserify-aes/package.json | 69 + node_modules/browserify-aes/streamCipher.js | 27 + node_modules/browserify-cipher/.travis.yml | 14 + node_modules/browserify-cipher/LICENSE | 21 + node_modules/browserify-cipher/README.md | 7 + node_modules/browserify-cipher/browser.js | 67 + node_modules/browserify-cipher/index.js | 7 + node_modules/browserify-cipher/package.json | 58 + node_modules/browserify-cipher/test.js | 55 + node_modules/browserify-des/.travis.yml | 8 + node_modules/browserify-des/index.js | 50 + node_modules/browserify-des/license | 21 + node_modules/browserify-des/modes.js | 24 + node_modules/browserify-des/package.json | 58 + node_modules/browserify-des/readme.md | 6 + node_modules/browserify-des/test.js | 81 + node_modules/browserify-rsa/.travis.yml | 3 + node_modules/browserify-rsa/LICENSE | 21 + node_modules/browserify-rsa/index.js | 40 + node_modules/browserify-rsa/package.json | 54 + node_modules/browserify-rsa/readme.md | 10 + node_modules/browserify-rsa/test.js | 53 + node_modules/browserify-sign/LICENSE | 13 + node_modules/browserify-sign/README.md | 13 + node_modules/browserify-sign/algos.js | 1 + .../browserify-sign/browser/algorithms.json | 152 + .../browserify-sign/browser/curves.json | 8 + node_modules/browserify-sign/browser/index.js | 91 + node_modules/browserify-sign/browser/sign.js | 145 + .../browserify-sign/browser/verify.js | 83 + node_modules/browserify-sign/index.js | 7 + node_modules/browserify-sign/package.json | 66 + node_modules/browserify-zlib/.npmignore | 7 + node_modules/browserify-zlib/.travis.yml | 16 + node_modules/browserify-zlib/LICENSE | 70 + node_modules/browserify-zlib/README.md | 24 + node_modules/browserify-zlib/karma.conf.js | 11 + node_modules/browserify-zlib/lib/binding.js | 409 + node_modules/browserify-zlib/lib/index.js | 609 + node_modules/browserify-zlib/package.json | 92 + node_modules/browserify-zlib/src/binding.js | 432 + node_modules/browserify-zlib/src/index.js | 650 + node_modules/browserify-zlib/yarn.lock | 3819 ++ node_modules/browserify/.travis.yml | 23 + node_modules/browserify/LICENSE | 84 + node_modules/browserify/appveyor.yml | 27 + node_modules/browserify/assets/browserify.png | Bin 0 -> 61391 bytes node_modules/browserify/assets/logo.png | Bin 0 -> 31422 bytes node_modules/browserify/bin/advanced.txt | 117 + node_modules/browserify/bin/args.js | 260 + node_modules/browserify/bin/cmd.js | 91 + node_modules/browserify/bin/usage.txt | 34 + node_modules/browserify/changelog.markdown | 1339 + node_modules/browserify/code-of-conduct.md | 78 + .../browserify/example/api/browser/bar.js | 1 + .../browserify/example/api/browser/foo.js | 5 + .../browserify/example/api/browser/main.js | 2 + node_modules/browserify/example/api/build.js | 4 + .../example/multiple_bundles/beep.js | 2 + .../example/multiple_bundles/boop.js | 2 + .../example/multiple_bundles/build.sh | 4 + .../example/multiple_bundles/robot.js | 1 + .../example/multiple_bundles/static/beep.html | 2 + .../example/multiple_bundles/static/boop.html | 2 + .../browserify/example/source_maps/build.js | 13 + .../browserify/example/source_maps/build.sh | 4 + .../browserify/example/source_maps/index.html | 11 + .../example/source_maps/js/build/.npmignore | 1 + .../example/source_maps/js/build/bundle.js | 28 + .../browserify/example/source_maps/js/foo.js | 7 + .../browserify/example/source_maps/js/main.js | 4 + .../example/source_maps/js/wunder/bar.js | 8 + node_modules/browserify/index.js | 859 + node_modules/browserify/lib/_empty.js | 0 node_modules/browserify/lib/builtins.js | 40 + .../node_modules/events/.travis.yml | 11 + .../browserify/node_modules/events/.zuul.yml | 13 + .../browserify/node_modules/events/History.md | 58 + .../browserify/node_modules/events/LICENSE | 22 + .../browserify/node_modules/events/Readme.md | 21 + .../browserify/node_modules/events/events.js | 523 + .../node_modules/events/package.json | 66 + .../events/tests/add-listeners.js | 111 + .../events/tests/check-listener-leaks.js | 93 + .../node_modules/events/tests/common.js | 103 + .../node_modules/events/tests/index.js | 25 + .../events/tests/legacy-compat.js | 16 + .../events/tests/listener-count.js | 37 + .../events/tests/listeners-side-effects.js | 57 + .../node_modules/events/tests/listeners.js | 149 + .../events/tests/max-listeners.js | 47 + .../events/tests/modify-in-emit.js | 90 + .../node_modules/events/tests/num-args.js | 69 + .../node_modules/events/tests/once.js | 83 + .../events/tests/remove-all-listeners.js | 139 + .../events/tests/remove-listeners.js | 212 + .../tests/set-max-listeners-side-effects.js | 32 + .../node_modules/events/tests/subclass.js | 73 + node_modules/browserify/package.json | 129 + node_modules/browserify/readme.markdown | 829 + node_modules/browserify/test/args.js | 72 + node_modules/browserify/test/array.js | 74 + node_modules/browserify/test/array/one.js | 1 + node_modules/browserify/test/array/three.js | 1 + node_modules/browserify/test/array/two.js | 1 + node_modules/browserify/test/async.js | 24 + node_modules/browserify/test/async/src.js | 8 + node_modules/browserify/test/backbone.js | 23 + node_modules/browserify/test/bare.js | 173 + .../browserify/test/bare/dirname-filename.js | 4 + node_modules/browserify/test/bare/main.js | 7 + node_modules/browserify/test/bare_shebang.js | 37 + node_modules/browserify/test/bin.js | 31 + node_modules/browserify/test/bin_entry.js | 31 + node_modules/browserify/test/bin_tr_error.js | 27 + .../browserify/test/bin_tr_error/main.js | 1 + .../browserify/test/bin_tr_error/tr.js | 12 + node_modules/browserify/test/bom.js | 19 + node_modules/browserify/test/bom/hello.js | 1 + .../browserify/test/browser_field_file.js | 13 + .../test/browser_field_file/package.json | 5 + .../browserify/test/browser_field_file/wow.js | 1 + .../browserify/test/browser_field_resolve.js | 124 + .../test/browser_field_resolve/a/main.js | 1 + .../a/node_modules/aaa/main.js | 1 + .../a/node_modules/aaa/package.json | 3 + .../test/browser_field_resolve/a/package.json | 5 + .../test/browser_field_resolve/b/main.js | 1 + .../test/browser_field_resolve/b/package.json | 5 + .../test/browser_field_resolve/b/x.js | 1 + .../test/browser_field_resolve/c/main.js | 1 + .../test/browser_field_resolve/c/package.json | 5 + .../test/browser_field_resolve/c/x.js | 1 + .../test/browser_field_resolve/d/main.js | 1 + .../test/browser_field_resolve/d/package.json | 5 + .../test/browser_field_resolve/d/x.js | 1 + .../test/browser_field_resolve/e/main.js | 1 + .../test/browser_field_resolve/e/package.json | 5 + .../test/browser_field_resolve/e/x.js | 1 + .../test/browser_field_resolve/f/main.js | 1 + .../test/browser_field_resolve/f/package.json | 5 + .../test/browser_field_resolve/f/x.js | 1 + .../test/browser_field_resolve/g/main.js | 2 + .../test/browser_field_resolve/g/package.json | 5 + .../test/browser_field_resolve/g/x.js | 1 + .../test/browser_field_resolve/h/main.js | 2 + .../test/browser_field_resolve/h/package.json | 5 + .../test/browser_field_resolve/h/x.js | 1 + .../test/browser_field_resolve/i/browser.js | 1 + .../test/browser_field_resolve/i/main.js | 2 + .../test/browser_field_resolve/i/package.json | 5 + .../test/browser_field_resolve/i/x.js | 1 + .../test/browser_field_resolve/j/browser.js | 1 + .../test/browser_field_resolve/j/main.js | 2 + .../test/browser_field_resolve/j/package.json | 5 + .../test/browser_field_resolve/j/x.js | 1 + .../test/browser_field_resolve/k/main.js | 2 + .../k/node_modules/x/hey.js | 1 + .../k/node_modules/x/package.json | 5 + .../test/browser_field_resolve/l/main.js | 2 + .../l/node_modules/x/hey.js | 1 + .../l/node_modules/x/package.json | 5 + node_modules/browserify/test/buffer.js | 144 + .../browserify/test/bundle-bundle-external.js | 31 + .../test/bundle-bundle-external/bar.js | 2 + .../test/bundle-bundle-external/baz.js | 3 + .../test/bundle-bundle-external/foo.js | 5 + node_modules/browserify/test/bundle-stream.js | 18 + node_modules/browserify/test/bundle.js | 33 + .../browserify/test/bundle_external.js | 26 + .../browserify/test/bundle_external/boop.js | 4 + .../browserify/test/bundle_external/main.js | 4 + .../browserify/test/bundle_external/robot.js | 1 + .../browserify/test/bundle_external_global.js | 24 + .../browserify/test/bundle_sourcemap.js | 32 + node_modules/browserify/test/catch.js | 22 + node_modules/browserify/test/catch/main.js | 1 + node_modules/browserify/test/circular.js | 34 + node_modules/browserify/test/circular/a.js | 3 + node_modules/browserify/test/circular/b.js | 1 + node_modules/browserify/test/circular/main.js | 1 + node_modules/browserify/test/coffee_bin.js | 36 + .../browserify/test/coffee_bin/main.coffee | 2 + .../browserify/test/coffee_bin/x.coffee | 1 + node_modules/browserify/test/coffeeify.js | 19 + .../browserify/test/coffeeify/main.coffee | 2 + node_modules/browserify/test/comment.js | 16 + node_modules/browserify/test/comment/main.js | 2 + node_modules/browserify/test/constants.js | 18 + node_modules/browserify/test/crypto.js | 41 + node_modules/browserify/test/crypto_ig.js | 41 + node_modules/browserify/test/cycle.js | 13 + node_modules/browserify/test/cycle/README.md | 16 + node_modules/browserify/test/cycle/entry.js | 15 + node_modules/browserify/test/cycle/mod1/a.js | 1 + node_modules/browserify/test/cycle/mod1/b.js | 1 + node_modules/browserify/test/cycle/mod2/a.js | 1 + node_modules/browserify/test/cycle/mod2/b.js | 1 + .../browserify/test/debug_standalone.js | 64 + .../browserify/test/debug_standalone/x.js | 1 + node_modules/browserify/test/dedupe-deps.js | 59 + node_modules/browserify/test/dedupe-nomap.js | 64 + node_modules/browserify/test/delay.js | 25 + .../browserify/test/delay/diverted.js | 1 + node_modules/browserify/test/delay/main.js | 1 + node_modules/browserify/test/dep.js | 25 + node_modules/browserify/test/dollar.js | 17 + .../browserify/test/dollar/dollar/index.js | 7 + node_modules/browserify/test/double_buffer.js | 16 + .../browserify/test/double_buffer/explicit.js | 1 + .../browserify/test/double_buffer/implicit.js | 1 + .../browserify/test/double_buffer/main.js | 4 + node_modules/browserify/test/double_bundle.js | 24 + .../browserify/test/double_bundle_error.js | 17 + .../test/double_bundle_error/main.js | 1 + .../test/double_bundle_error/needs_three.js | 1 + .../test/double_bundle_error/one.js | 1 + .../test/double_bundle_error/package.json | 5 + .../test/double_bundle_error/three.js | 3 + .../test/double_bundle_error/two.js | 1 + .../browserify/test/double_bundle_json.js | 37 + .../browserify/test/double_bundle_json/a.json | 1 + .../browserify/test/double_bundle_json/b.json | 1 + .../test/double_bundle_json/index.js | 5 + .../browserify/test/double_bundle_parallel.js | 33 + .../test/double_bundle_parallel_cache.js | 35 + node_modules/browserify/test/dup/foo-dup.js | 4 + node_modules/browserify/test/dup/foo.js | 4 + node_modules/browserify/test/dup/index.js | 5 + node_modules/browserify/test/entry.js | 43 + node_modules/browserify/test/entry/main.js | 1 + .../browserify/test/entry/needs_three.js | 1 + node_modules/browserify/test/entry/one.js | 1 + .../browserify/test/entry/package.json | 5 + node_modules/browserify/test/entry/three.js | 1 + node_modules/browserify/test/entry/two.js | 1 + node_modules/browserify/test/entry_exec.js | 15 + .../browserify/test/entry_exec/fail.js | 1 + .../browserify/test/entry_exec/main.js | 1 + node_modules/browserify/test/entry_expose.js | 18 + .../browserify/test/entry_expose/main.js | 2 + .../browserify/test/entry_relative.js | 45 + node_modules/browserify/test/error_code.js | 28 + .../browserify/test/error_code/src.js | 2 + node_modules/browserify/test/exclude.js | 21 + node_modules/browserify/test/exclude/array.js | 2 + node_modules/browserify/test/exclude/skip.js | 1 + node_modules/browserify/test/exclude/skip2.js | 1 + node_modules/browserify/test/export.js | 35 + node_modules/browserify/test/export/entry.js | 1 + node_modules/browserify/test/external.js | 20 + node_modules/browserify/test/external/main.js | 2 + node_modules/browserify/test/external/x.js | 3 + .../browserify/test/external_args/main.js | 10 + node_modules/browserify/test/external_shim.js | 27 + .../browserify/test/external_shim/bundle1.js | 1 + .../browserify/test/external_shim/bundle2.js | 1 + .../test/external_shim/package.json | 5 + .../browserify/test/external_shim/shim.js | 0 node_modules/browserify/test/externalize.js | 59 + .../browserify/test/externalize/beep.js | 2 + .../browserify/test/externalize/boop.js | 2 + .../browserify/test/externalize/robot.js | 1 + node_modules/browserify/test/fake.js | 15 + node_modules/browserify/test/fake/fake_fs.js | 1 + node_modules/browserify/test/fake/main.js | 2 + node_modules/browserify/test/field.js | 72 + node_modules/browserify/test/field/miss.js | 1 + .../test/field/node_modules/z-miss/browser.js | 1 + .../test/field/node_modules/z-miss/main.js | 1 + .../field/node_modules/z-miss/package.json | 4 + .../field/node_modules/z-object/browser.js | 1 + .../test/field/node_modules/z-object/main.js | 1 + .../field/node_modules/z-object/package.json | 4 + .../field/node_modules/z-string/browser.js | 1 + .../test/field/node_modules/z-string/main.js | 1 + .../field/node_modules/z-string/package.json | 4 + .../field/node_modules/z-sub/browser/a.js | 1 + .../field/node_modules/z-sub/browser/b.js | 1 + .../test/field/node_modules/z-sub/main.js | 1 + .../field/node_modules/z-sub/package.json | 4 + node_modules/browserify/test/field/object.js | 1 + node_modules/browserify/test/field/string.js | 1 + node_modules/browserify/test/field/sub.js | 1 + node_modules/browserify/test/file_event.js | 33 + node_modules/browserify/test/five_bundle.js | 30 + node_modules/browserify/test/full_paths.js | 58 + node_modules/browserify/test/glob.js | 29 + node_modules/browserify/test/glob/a.js | 6 + node_modules/browserify/test/glob/b.js | 5 + node_modules/browserify/test/glob/lib/z.js | 1 + node_modules/browserify/test/glob/vendor/x.js | 1 + node_modules/browserify/test/glob/vendor/y.js | 1 + node_modules/browserify/test/global.js | 92 + node_modules/browserify/test/global/buffer.js | 2 + .../browserify/test/global/filename.js | 2 + node_modules/browserify/test/global/main.js | 2 + .../test/global/node_modules/aaa/index.js | 2 + .../test/global/node_modules/robot/index.js | 1 + .../global/node_modules/robot/lib/beep.js | 2 + node_modules/browserify/test/global/tick.js | 3 + .../browserify/test/global_coffeeify.js | 19 + .../browserify/test/global_noparse.js | 102 + .../browserify/test/global_recorder.js | 22 + .../browserify/test/global_recorder/main.js | 1 + node_modules/browserify/test/hash.js | 15 + .../browserify/test/hash/foo/other.js | 1 + node_modules/browserify/test/hash/foo/two.js | 2 + node_modules/browserify/test/hash/main.js | 2 + node_modules/browserify/test/hash/one.js | 2 + node_modules/browserify/test/hash/other.js | 1 + .../browserify/test/hash_instance_context.js | 25 + .../test/hash_instance_context/main.js | 17 + .../test/hash_instance_context/one/dir/f.js | 3 + .../test/hash_instance_context/one/dir/g.js | 2 + .../test/hash_instance_context/one/f.js | 3 + .../test/hash_instance_context/one/g.js | 2 + .../test/hash_instance_context/three/dir/f.js | 3 + .../test/hash_instance_context/three/dir/g.js | 2 + .../test/hash_instance_context/three/dir/h.js | 2 + .../test/hash_instance_context/three/f.js | 3 + .../test/hash_instance_context/three/g.js | 2 + .../test/hash_instance_context/three/h.js | 2 + .../test/hash_instance_context/two/dir/f.js | 3 + .../test/hash_instance_context/two/dir/g.js | 2 + .../test/hash_instance_context/two/dir/h.js | 2 + .../test/hash_instance_context/two/f.js | 3 + .../test/hash_instance_context/two/g.js | 2 + .../test/hash_instance_context/two/h.js | 2 + node_modules/browserify/test/identical.js | 19 + .../browserify/test/identical/main.js | 6 + node_modules/browserify/test/identical/x.js | 2 + node_modules/browserify/test/identical/y.js | 2 + .../browserify/test/identical_different.js | 19 + .../test/identical_different/main.js | 6 + .../node_modules/op/index.js | 3 + .../wow/node_modules/op/index.js | 3 + .../test/identical_different/wow/y.js | 3 + .../browserify/test/identical_different/x.js | 3 + node_modules/browserify/test/ignore.js | 91 + node_modules/browserify/test/ignore/array.js | 2 + node_modules/browserify/test/ignore/by-id.js | 3 + .../browserify/test/ignore/by-relative.js | 5 + .../browserify/test/ignore/double-skip.js | 2 + .../test/ignore/double-skip/index.js | 1 + .../test/ignore/double-skip/skip.js | 5 + .../browserify/test/ignore/ignored/skip.js | 1 + node_modules/browserify/test/ignore/main.js | 1 + .../browserify/test/ignore/relative/index.js | 1 + node_modules/browserify/test/ignore/skip.js | 1 + node_modules/browserify/test/ignore/skip2.js | 1 + .../browserify/test/ignore_browser_field.js | 21 + .../test/ignore_browser_field/main.js | 2 + .../node_modules/a/browser.js | 1 + .../node_modules/a/main.js | 1 + .../node_modules/a/package.json | 6 + .../node_modules/b/browser-x.js | 1 + .../node_modules/b/main.js | 1 + .../node_modules/b/package.json | 8 + .../ignore_browser_field/node_modules/b/x.js | 1 + .../browserify/test/ignore_missing.js | 41 + .../browserify/test/ignore_missing/main.js | 1 + .../browserify/test/ignore_transform_key.js | 17 + .../test/ignore_transform_key/main.js | 3 + .../node_modules/a/index.js | 1 + .../node_modules/a/package.json | 10 + .../node_modules/evil-transform/index.js | 12 + .../node_modules/evil-transform/package.json | 5 + node_modules/browserify/test/json.js | 48 + node_modules/browserify/test/json/beep.json | 4 + .../browserify/test/json/evil-chars.json | 3 + node_modules/browserify/test/json/evil.js | 2 + node_modules/browserify/test/json/main.js | 2 + node_modules/browserify/test/leak.js | 59 + node_modules/browserify/test/maxlisteners.js | 13 + .../browserify/test/maxlisteners/main.js | 3 + node_modules/browserify/test/multi_bundle.js | 86 + .../browserify/test/multi_bundle/_prelude.js | 1 + .../browserify/test/multi_bundle/a.js | 3 + .../browserify/test/multi_bundle/b.js | 5 + .../browserify/test/multi_bundle/c.js | 4 + .../browserify/test/multi_bundle_unique.js | 56 + node_modules/browserify/test/multi_entry.js | 122 + node_modules/browserify/test/multi_entry/a.js | 2 + node_modules/browserify/test/multi_entry/b.js | 2 + node_modules/browserify/test/multi_entry/c.js | 2 + .../test/multi_entry_cross_require.js | 93 + .../test/multi_entry_cross_require/a.js | 8 + .../test/multi_entry_cross_require/c.js | 7 + .../test/multi_entry_cross_require/lib/b.js | 5 + node_modules/browserify/test/multi_require.js | 18 + .../browserify/test/multi_require/a.js | 3 + .../browserify/test/multi_require/main.js | 4 + node_modules/browserify/test/multi_symlink.js | 13 + .../browserify/test/multi_symlink/main.js | 2 + .../browserify/test/multi_symlink/x.js | 1 + node_modules/browserify/test/no_builtins.js | 66 + .../browserify/test/no_builtins/extra/fs.js | 1 + .../browserify/test/no_builtins/extra/tls.js | 1 + .../browserify/test/no_builtins/main.js | 4 + .../browserify/test/no_builtins/x.txt | 1 + .../test/node_modules/beep/index.js | 1 + .../test/node_modules/plugin-foo/index.js | 9 + .../browserify/test/node_modules/tr/index.js | 8 + node_modules/browserify/test/noparse.js | 31 + node_modules/browserify/test/noparse/a.js | 4 + node_modules/browserify/test/noparse/b.js | 5 + .../browserify/test/noparse/dir1/1.js | 4 + .../browserify/test/noparse/dir1/dir2/2.js | 3 + .../noparse/node_modules/robot/lib/beep.js | 4 + .../noparse/node_modules/robot/lib/boop.js | 3 + .../test/noparse/node_modules/robot/main.js | 4 + .../noparse/node_modules/robot/package.json | 3 + node_modules/browserify/test/pack.js | 33 + node_modules/browserify/test/paths.js | 32 + node_modules/browserify/test/paths/main.js | 3 + .../browserify/test/paths/x/aaa/index.js | 1 + .../browserify/test/paths/x/ccc/index.js | 1 + .../browserify/test/paths/y/bbb/index.js | 1 + .../browserify/test/paths/y/ccc/index.js | 1 + .../browserify/test/paths_transform.js | 76 + node_modules/browserify/test/pipeline_deps.js | 22 + .../browserify/test/pipeline_deps/bar.js | 3 + .../browserify/test/pipeline_deps/foo.js | 5 + .../browserify/test/pipeline_deps/main.js | 2 + .../browserify/test/pipeline_deps/xyz.js | 2 + node_modules/browserify/test/pkg.js | 20 + node_modules/browserify/test/pkg/main.js | 1 + node_modules/browserify/test/pkg/package.json | 1 + node_modules/browserify/test/pkg_event.js | 31 + .../browserify/test/pkg_event/main.js | 1 + .../pkg_event/node_modules/aaa/lib/butts.js | 1 + .../node_modules/aaa/lib/package.json | 4 + .../pkg_event/node_modules/aaa/lib/woo.js | 1 + .../test/pkg_event/node_modules/aaa/main.js | 1 + .../pkg_event/node_modules/aaa/package.json | 4 + .../browserify/test/pkg_event/package.json | 3 + node_modules/browserify/test/plugin.js | 28 + node_modules/browserify/test/plugin/main.js | 1 + .../browserify/test/preserve-symlinks.js | 27 + .../test/preserve_symlinks/a/index.js | 1 + .../a/node_modules/b/index.js | 1 + .../a/node_modules/c/index.js | 0 .../test/preserve_symlinks/b/index.js | 1 + node_modules/browserify/test/process.js | 21 + node_modules/browserify/test/process/main.js | 3 + node_modules/browserify/test/process/one.js | 1 + node_modules/browserify/test/process/two.js | 1 + node_modules/browserify/test/quotes.js | 38 + .../browserify/test/quotes/backtick.js | 1 + node_modules/browserify/test/quotes/main.js | 1 + node_modules/browserify/test/quotes/one.js | 1 + node_modules/browserify/test/quotes/three.js | 1 + node_modules/browserify/test/quotes/two.js | 1 + .../browserify/test/relative_dedupe.js | 17 + .../browserify/test/relative_dedupe/a/a.js | 3 + .../browserify/test/relative_dedupe/a/b.js | 3 + .../test/relative_dedupe/a/index.js | 4 + .../browserify/test/relative_dedupe/b/a.js | 3 + .../browserify/test/relative_dedupe/b/b.js | 3 + .../test/relative_dedupe/b/index.js | 4 + .../browserify/test/relative_dedupe/index.js | 4 + .../browserify/test/relative_dedupe/main.js | 5 + node_modules/browserify/test/require_cache.js | 19 + .../browserify/test/require_expose.js | 53 + .../browserify/test/require_expose/main.js | 1 + .../test/require_expose/some_dep.js | 1 + node_modules/browserify/test/reset.js | 31 + .../browserify/test/resolve_exposed.js | 20 + .../browserify/test/resolve_exposed/main.js | 2 + .../browserify/test/resolve_exposed/x.js | 1 + node_modules/browserify/test/retarget.js | 25 + .../browserify/test/reverse_multi_bundle.js | 47 + .../test/reverse_multi_bundle/app.js | 22 + .../test/reverse_multi_bundle/arbitrary.js | 6 + .../test/reverse_multi_bundle/lazy.js | 9 + .../test/reverse_multi_bundle/shared.js | 6 + .../browserify/test/shared_symlink.js | 16 + .../test/shared_symlink/app/index.js | 1 + .../app/node_modules/foo/index.js | 1 + .../app/node_modules/shared/index.js | 1 + .../browserify/test/shared_symlink/main.js | 1 + .../test/shared_symlink/shared/index.js | 1 + node_modules/browserify/test/shebang.js | 11 + node_modules/browserify/test/shebang/foo.js | 2 + node_modules/browserify/test/shebang/main.js | 4 + node_modules/browserify/test/spread.js | 14 + node_modules/browserify/test/spread/main.js | 1 + node_modules/browserify/test/standalone.js | 85 + .../browserify/test/standalone/main.js | 3 + .../browserify/test/standalone/one.js | 1 + .../browserify/test/standalone/two.js | 1 + .../browserify/test/standalone_events.js | 19 + .../browserify/test/standalone_sourcemap.js | 55 + node_modules/browserify/test/stdin.js | 35 + node_modules/browserify/test/stream.js | 15 + node_modules/browserify/test/stream/bar.js | 1 + node_modules/browserify/test/stream/foo.js | 1 + node_modules/browserify/test/stream/main.js | 2 + node_modules/browserify/test/stream_file.js | 29 + node_modules/browserify/test/subdep.js | 16 + node_modules/browserify/test/subdep/index.js | 1 + .../test/subdep/node_modules/qq/b.js | 1 + .../test/subdep/node_modules/qq/ignore_me.js | 1 + .../node_modules/qq/node_modules/a/index.js | 1 + .../qq/node_modules/a/package.json | 5 + .../node_modules/qq/node_modules/c/index.js | 1 + .../qq/node_modules/c/package.json | 5 + .../node_modules/qq/node_modules/f/index.js | 1 + .../node_modules/qq/node_modules/z/index.js | 1 + .../test/subdep/node_modules/qq/package.json | 3 + .../browserify/test/subdep/package.json | 6 + .../browserify/test/symlink_dedupe.js | 16 + .../browserify/test/symlink_dedupe/main.js | 6 + .../browserify/test/symlink_dedupe/one/f.js | 3 + .../browserify/test/symlink_dedupe/one/g.js | 2 + node_modules/browserify/test/syntax_cache.js | 47 + .../browserify/test/syntax_cache/invalid.js | 2 + .../browserify/test/syntax_cache/valid.js | 2 + node_modules/browserify/test/tr.js | 28 + node_modules/browserify/test/tr/f.js | 2 + node_modules/browserify/test/tr/main.js | 9 + .../test/tr/node_modules/g/index.js | 2 + .../g/node_modules/insert-ggg/index.js | 7 + .../test/tr/node_modules/g/package.json | 6 + .../test/tr/node_modules/insert-aaa/index.js | 7 + .../test/tr/node_modules/insert-bbb/index.js | 7 + .../test/tr/node_modules/m/index.js | 3 + .../test/tr/node_modules/xyz/index.js | 7 + node_modules/browserify/test/tr/package.json | 5 + node_modules/browserify/test/tr/subdir/g.js | 1 + node_modules/browserify/test/tr_args.js | 24 + node_modules/browserify/test/tr_args/main.js | 1 + node_modules/browserify/test/tr_args/tr.js | 12 + node_modules/browserify/test/tr_error.js | 33 + node_modules/browserify/test/tr_flags.js | 36 + node_modules/browserify/test/tr_global.js | 17 + .../browserify/test/tr_global/main.js | 1 + .../test/tr_global/node_modules/tr/index.js | 8 + .../test/tr_global/node_modules/x/index.js | 1 + .../node_modules/x/node_modules/tr/index.js | 8 + node_modules/browserify/test/tr_no_entry.js | 20 + .../browserify/test/tr_no_entry/main.js | 1 + node_modules/browserify/test/tr_once.js | 21 + node_modules/browserify/test/tr_once/main.js | 1 + node_modules/browserify/test/tr_order.js | 23 + .../browserify/test/tr_order/replace_aaa.js | 10 + .../browserify/test/tr_order/replace_bbb.js | 11 + node_modules/browserify/test/tr_symlink.js | 27 + .../test/tr_symlink/a-module/index.js | 1 + .../browserify/test/tr_symlink/app/main.js | 6 + .../tr_symlink/app/node_modules/aaa/index.js | 1 + .../tr_symlink/app/node_modules/bbb/ext.js | 1 + .../tr_symlink/app/node_modules/bbb/index.js | 2 + .../tr_symlink/app/node_modules/tr/index.js | 14 + .../test/tr_symlink/app/package.json | 5 + .../test/tr_symlink/b-module/ext.js | 1 + .../test/tr_symlink/b-module/index.js | 2 + node_modules/browserify/test/unicode.js | 19 + node_modules/browserify/test/unicode/main.js | 1 + node_modules/browserify/test/unicode/one.js | 1 + node_modules/browserify/test/unicode/two.js | 1 + node_modules/browserify/test/util.js | 62 + node_modules/browserify/test/yield.js | 20 + node_modules/browserify/test/yield/f.js | 5 + node_modules/browserify/test/yield/main.js | 4 + node_modules/budo/.travis.yml | 8 + node_modules/budo/CHANGELOG.md | 244 + node_modules/budo/LICENSE.md | 21 + node_modules/budo/README.md | 169 + .../budo/bin/bundle-livereload-client.js | 37 + node_modules/budo/bin/cmd.js | 7 + node_modules/budo/bin/help.txt | 32 + .../budo/build/bundled-livereload-client.js | 1 + node_modules/budo/index.js | 86 + node_modules/budo/lib/budo.js | 331 + node_modules/budo/lib/bundler.js | 50 + node_modules/budo/lib/error-handler.js | 248 + node_modules/budo/lib/file-watch.js | 45 + node_modules/budo/lib/get-ports.js | 24 + node_modules/budo/lib/map-entry.js | 44 + node_modules/budo/lib/middleware.js | 254 + node_modules/budo/lib/parse-args.js | 70 + node_modules/budo/lib/reload/client.js | 155 + node_modules/budo/lib/reload/error-popup.js | 83 + node_modules/budo/lib/reload/server.js | 86 + node_modules/budo/lib/server.js | 59 + node_modules/budo/lib/simple-http-logger.js | 75 + node_modules/budo/package.json | 126 + node_modules/buffer-from/LICENSE | 21 + node_modules/buffer-from/index.js | 69 + node_modules/buffer-from/package.json | 52 + node_modules/buffer-from/readme.md | 69 + node_modules/buffer-xor/.npmignore | 1 + node_modules/buffer-xor/.travis.yml | 9 + node_modules/buffer-xor/LICENSE | 21 + node_modules/buffer-xor/README.md | 41 + node_modules/buffer-xor/index.js | 10 + node_modules/buffer-xor/inline.js | 1 + node_modules/buffer-xor/inplace.js | 9 + node_modules/buffer-xor/package.json | 64 + node_modules/buffer-xor/test/fixtures.json | 23 + node_modules/buffer-xor/test/index.js | 38 + node_modules/buffer/AUTHORS.md | 55 + node_modules/buffer/LICENSE | 21 + node_modules/buffer/README.md | 409 + node_modules/buffer/index.d.ts | 185 + node_modules/buffer/index.js | 1777 + node_modules/buffer/package.json | 110 + node_modules/builtin-status-codes/browser.js | 64 + node_modules/builtin-status-codes/build.js | 8 + node_modules/builtin-status-codes/index.js | 3 + node_modules/builtin-status-codes/license | 21 + .../builtin-status-codes/package.json | 71 + node_modules/builtin-status-codes/readme.md | 31 + node_modules/cache-base/LICENSE | 21 + node_modules/cache-base/README.md | 291 + node_modules/cache-base/index.js | 261 + .../cache-base/node_modules/isobject/LICENSE | 21 + .../node_modules/isobject/README.md | 122 + .../node_modules/isobject/index.d.ts | 5 + .../cache-base/node_modules/isobject/index.js | 12 + .../node_modules/isobject/package.json | 119 + node_modules/cache-base/package.json | 118 + node_modules/cached-path-relative/.npmignore | 2 + node_modules/cached-path-relative/History.md | 0 node_modules/cached-path-relative/Makefile | 20 + node_modules/cached-path-relative/Readme.md | 41 + .../cached-path-relative/lib/index.js | 43 + .../cached-path-relative/package.json | 46 + node_modules/cached-path-relative/shim.js | 12 + .../cached-path-relative/test/index.js | 17 + node_modules/chalk/index.js | 95 + .../chalk/node_modules/.bin/strip-ansi | 1 + .../chalk/node_modules/strip-ansi/cli.js | 39 + .../chalk/node_modules/strip-ansi/index.js | 6 + .../node_modules/strip-ansi/package.json | 88 + .../chalk/node_modules/strip-ansi/readme.md | 43 + node_modules/chalk/package.json | 94 + node_modules/chalk/readme.md | 175 + node_modules/charenc/LICENSE.mkd | 27 + node_modules/charenc/README.js | 1 + node_modules/charenc/charenc.js | 33 + node_modules/charenc/package.json | 54 + node_modules/chokidar/CHANGELOG.md | 274 + node_modules/chokidar/README.md | 293 + node_modules/chokidar/index.js | 716 + node_modules/chokidar/lib/fsevents-handler.js | 397 + node_modules/chokidar/lib/nodefs-handler.js | 481 + node_modules/chokidar/package.json | 85 + node_modules/cipher-base/.eslintrc | 3 + node_modules/cipher-base/.npmignore | 1 + node_modules/cipher-base/.travis.yml | 6 + node_modules/cipher-base/LICENSE | 21 + node_modules/cipher-base/README.md | 17 + node_modules/cipher-base/index.js | 99 + node_modules/cipher-base/package.json | 63 + node_modules/cipher-base/test.js | 111 + node_modules/class-utils/LICENSE | 21 + node_modules/class-utils/README.md | 300 + node_modules/class-utils/index.js | 370 + .../node_modules/define-property/LICENSE | 21 + .../node_modules/define-property/README.md | 77 + .../node_modules/define-property/index.js | 31 + .../node_modules/define-property/package.json | 82 + .../class-utils/node_modules/isobject/LICENSE | 21 + .../node_modules/isobject/README.md | 122 + .../node_modules/isobject/index.d.ts | 5 + .../node_modules/isobject/index.js | 12 + .../node_modules/isobject/package.json | 119 + node_modules/class-utils/package.json | 131 + node_modules/collection-visit/LICENSE | 21 + node_modules/collection-visit/README.md | 89 + node_modules/collection-visit/index.js | 30 + node_modules/collection-visit/package.json | 115 + node_modules/combine-source-map/.npmignore | 16 + node_modules/combine-source-map/.travis.yml | 8 + node_modules/combine-source-map/LICENSE | 23 + node_modules/combine-source-map/README.md | 111 + .../example/two-files-short.js | 26 + .../combine-source-map/example/two-files.js | 46 + node_modules/combine-source-map/index.js | 155 + .../lib/mappings-from-map.js | 30 + .../lib/path-is-absolute.js | 20 + .../lib/path-is-absolute.license | 21 + node_modules/combine-source-map/package.json | 71 + .../test/combine-source-map.js | 347 + node_modules/component-emitter/History.md | 68 + node_modules/component-emitter/LICENSE | 24 + node_modules/component-emitter/Readme.md | 74 + node_modules/component-emitter/index.js | 163 + node_modules/component-emitter/package.json | 57 + node_modules/concat-map/.travis.yml | 4 + node_modules/concat-map/LICENSE | 18 + node_modules/concat-map/README.markdown | 62 + node_modules/concat-map/example/map.js | 6 + node_modules/concat-map/index.js | 13 + node_modules/concat-map/package.json | 88 + node_modules/concat-map/test/map.js | 39 + node_modules/concat-stream/LICENSE | 24 + node_modules/concat-stream/index.js | 144 + node_modules/concat-stream/package.json | 87 + node_modules/concat-stream/readme.md | 102 + node_modules/connect-pushstate/.jshintrc | 17 + node_modules/connect-pushstate/.npmignore | 3 + node_modules/connect-pushstate/Gruntfile.js | 31 + node_modules/connect-pushstate/LICENSE | 22 + node_modules/connect-pushstate/README.md | 77 + .../connect-pushstate/examples/server.js | 15 + node_modules/connect-pushstate/index.js | 26 + node_modules/connect-pushstate/package.json | 66 + .../test/fixtures/www/images/image.png | Bin 0 -> 6279 bytes .../test/fixtures/www/index.html | 1 + .../test/fixtures/www/other/index.html | 1 + .../connect-pushstate/test/pushstate-test.js | 102 + node_modules/console-browserify/.npmignore | 14 + node_modules/console-browserify/.testem.json | 14 + node_modules/console-browserify/.travis.yml | 4 + node_modules/console-browserify/LICENCE | 19 + node_modules/console-browserify/README.md | 33 + node_modules/console-browserify/index.js | 86 + node_modules/console-browserify/package.json | 93 + node_modules/console-browserify/test/index.js | 67 + .../console-browserify/test/static/index.html | 12 + .../test/static/test-adapter.js | 53 + node_modules/constants-browserify/README.md | 54 + node_modules/constants-browserify/build.sh | 1 + .../constants-browserify/constants.json | 209 + .../constants-browserify/package.json | 62 + node_modules/constants-browserify/test.js | 18 + node_modules/convert-source-map/.npmignore | 16 + node_modules/convert-source-map/.travis.yml | 5 + node_modules/convert-source-map/LICENSE | 23 + node_modules/convert-source-map/README.md | 121 + .../example/comment-to-json.js | 15 + node_modules/convert-source-map/index.js | 156 + node_modules/convert-source-map/package.json | 64 + .../convert-source-map/test/comment-regex.js | 138 + .../test/convert-source-map.js | 207 + .../map-file-comment-double-slash.css | 14 + .../test/fixtures/map-file-comment-inline.css | 14 + .../test/fixtures/map-file-comment.css | 14 + .../test/fixtures/map-file-comment.css.map | 6 + .../test/map-file-comment.js | 70 + node_modules/copy-descriptor/LICENSE | 21 + node_modules/copy-descriptor/index.js | 81 + node_modules/copy-descriptor/package.json | 87 + node_modules/core-js/CHANGELOG.md | 667 + node_modules/core-js/Gruntfile.js | 3 + node_modules/core-js/LICENSE | 19 + node_modules/core-js/README.md | 2289 ++ node_modules/core-js/bower.json | 49 + node_modules/core-js/build/Gruntfile.ls | 86 + node_modules/core-js/build/build.ls | 62 + node_modules/core-js/build/config.js | 274 + node_modules/core-js/build/index.js | 104 + node_modules/core-js/client/core.js | 8645 +++++ node_modules/core-js/client/core.min.js | 10 + node_modules/core-js/client/core.min.js.map | 1 + node_modules/core-js/client/library.js | 8129 +++++ node_modules/core-js/client/library.min.js | 10 + .../core-js/client/library.min.js.map | 1 + node_modules/core-js/client/shim.js | 8213 +++++ node_modules/core-js/client/shim.min.js | 10 + node_modules/core-js/client/shim.min.js.map | 1 + node_modules/core-js/core/_.js | 2 + node_modules/core-js/core/delay.js | 2 + node_modules/core-js/core/dict.js | 2 + node_modules/core-js/core/function.js | 2 + node_modules/core-js/core/index.js | 15 + node_modules/core-js/core/number.js | 2 + node_modules/core-js/core/object.js | 5 + node_modules/core-js/core/regexp.js | 2 + node_modules/core-js/core/string.js | 3 + node_modules/core-js/es5/index.js | 37 + node_modules/core-js/es6/array.js | 23 + node_modules/core-js/es6/date.js | 6 + node_modules/core-js/es6/function.js | 4 + node_modules/core-js/es6/index.js | 138 + node_modules/core-js/es6/map.js | 5 + node_modules/core-js/es6/math.js | 18 + node_modules/core-js/es6/number.js | 13 + node_modules/core-js/es6/object.js | 20 + node_modules/core-js/es6/parse-float.js | 2 + node_modules/core-js/es6/parse-int.js | 2 + node_modules/core-js/es6/promise.js | 5 + node_modules/core-js/es6/reflect.js | 15 + node_modules/core-js/es6/regexp.js | 8 + node_modules/core-js/es6/set.js | 5 + node_modules/core-js/es6/string.js | 27 + node_modules/core-js/es6/symbol.js | 3 + node_modules/core-js/es6/typed.js | 13 + node_modules/core-js/es6/weak-map.js | 4 + node_modules/core-js/es6/weak-set.js | 4 + node_modules/core-js/es7/array.js | 4 + node_modules/core-js/es7/asap.js | 2 + node_modules/core-js/es7/error.js | 2 + node_modules/core-js/es7/global.js | 2 + node_modules/core-js/es7/index.js | 56 + node_modules/core-js/es7/map.js | 4 + node_modules/core-js/es7/math.js | 13 + node_modules/core-js/es7/object.js | 8 + node_modules/core-js/es7/observable.js | 7 + node_modules/core-js/es7/promise.js | 3 + node_modules/core-js/es7/reflect.js | 10 + node_modules/core-js/es7/set.js | 4 + node_modules/core-js/es7/string.js | 7 + node_modules/core-js/es7/symbol.js | 3 + node_modules/core-js/es7/system.js | 2 + node_modules/core-js/es7/weak-map.js | 3 + node_modules/core-js/es7/weak-set.js | 3 + node_modules/core-js/fn/_.js | 2 + node_modules/core-js/fn/array/concat.js | 4 + node_modules/core-js/fn/array/copy-within.js | 2 + node_modules/core-js/fn/array/entries.js | 2 + node_modules/core-js/fn/array/every.js | 2 + node_modules/core-js/fn/array/fill.js | 2 + node_modules/core-js/fn/array/filter.js | 2 + node_modules/core-js/fn/array/find-index.js | 2 + node_modules/core-js/fn/array/find.js | 2 + node_modules/core-js/fn/array/flat-map.js | 2 + node_modules/core-js/fn/array/flatten.js | 2 + node_modules/core-js/fn/array/for-each.js | 2 + node_modules/core-js/fn/array/from.js | 3 + node_modules/core-js/fn/array/includes.js | 2 + node_modules/core-js/fn/array/index-of.js | 2 + node_modules/core-js/fn/array/index.js | 26 + node_modules/core-js/fn/array/is-array.js | 2 + node_modules/core-js/fn/array/iterator.js | 2 + node_modules/core-js/fn/array/join.js | 2 + node_modules/core-js/fn/array/keys.js | 2 + .../core-js/fn/array/last-index-of.js | 2 + node_modules/core-js/fn/array/map.js | 2 + node_modules/core-js/fn/array/of.js | 2 + node_modules/core-js/fn/array/pop.js | 4 + node_modules/core-js/fn/array/push.js | 4 + node_modules/core-js/fn/array/reduce-right.js | 2 + node_modules/core-js/fn/array/reduce.js | 2 + node_modules/core-js/fn/array/reverse.js | 4 + node_modules/core-js/fn/array/shift.js | 4 + node_modules/core-js/fn/array/slice.js | 2 + node_modules/core-js/fn/array/some.js | 2 + node_modules/core-js/fn/array/sort.js | 2 + node_modules/core-js/fn/array/splice.js | 4 + node_modules/core-js/fn/array/unshift.js | 4 + node_modules/core-js/fn/array/values.js | 2 + .../core-js/fn/array/virtual/copy-within.js | 2 + .../core-js/fn/array/virtual/entries.js | 2 + .../core-js/fn/array/virtual/every.js | 2 + node_modules/core-js/fn/array/virtual/fill.js | 2 + .../core-js/fn/array/virtual/filter.js | 2 + .../core-js/fn/array/virtual/find-index.js | 2 + node_modules/core-js/fn/array/virtual/find.js | 2 + .../core-js/fn/array/virtual/flat-map.js | 2 + .../core-js/fn/array/virtual/flatten.js | 2 + .../core-js/fn/array/virtual/for-each.js | 2 + .../core-js/fn/array/virtual/includes.js | 2 + .../core-js/fn/array/virtual/index-of.js | 2 + .../core-js/fn/array/virtual/index.js | 20 + .../core-js/fn/array/virtual/iterator.js | 2 + node_modules/core-js/fn/array/virtual/join.js | 2 + node_modules/core-js/fn/array/virtual/keys.js | 2 + .../core-js/fn/array/virtual/last-index-of.js | 2 + node_modules/core-js/fn/array/virtual/map.js | 2 + .../core-js/fn/array/virtual/reduce-right.js | 2 + .../core-js/fn/array/virtual/reduce.js | 2 + .../core-js/fn/array/virtual/slice.js | 2 + node_modules/core-js/fn/array/virtual/some.js | 2 + node_modules/core-js/fn/array/virtual/sort.js | 2 + .../core-js/fn/array/virtual/values.js | 2 + node_modules/core-js/fn/asap.js | 2 + node_modules/core-js/fn/clear-immediate.js | 2 + node_modules/core-js/fn/date/index.js | 6 + node_modules/core-js/fn/date/now.js | 2 + node_modules/core-js/fn/date/to-iso-string.js | 3 + node_modules/core-js/fn/date/to-json.js | 2 + node_modules/core-js/fn/date/to-primitive.js | 5 + node_modules/core-js/fn/date/to-string.js | 5 + node_modules/core-js/fn/delay.js | 2 + node_modules/core-js/fn/dict.js | 2 + .../core-js/fn/dom-collections/index.js | 8 + .../core-js/fn/dom-collections/iterator.js | 2 + node_modules/core-js/fn/error/index.js | 2 + node_modules/core-js/fn/error/is-error.js | 2 + node_modules/core-js/fn/function/bind.js | 2 + .../core-js/fn/function/has-instance.js | 2 + node_modules/core-js/fn/function/index.js | 5 + node_modules/core-js/fn/function/name.js | 1 + node_modules/core-js/fn/function/part.js | 2 + .../core-js/fn/function/virtual/bind.js | 2 + .../core-js/fn/function/virtual/index.js | 3 + .../core-js/fn/function/virtual/part.js | 2 + .../core-js/fn/get-iterator-method.js | 3 + node_modules/core-js/fn/get-iterator.js | 3 + node_modules/core-js/fn/global.js | 2 + node_modules/core-js/fn/is-iterable.js | 3 + node_modules/core-js/fn/json/index.js | 2 + node_modules/core-js/fn/json/stringify.js | 5 + node_modules/core-js/fn/map.js | 8 + node_modules/core-js/fn/map/from.js | 8 + node_modules/core-js/fn/map/index.js | 8 + node_modules/core-js/fn/map/of.js | 8 + node_modules/core-js/fn/math/acosh.js | 2 + node_modules/core-js/fn/math/asinh.js | 2 + node_modules/core-js/fn/math/atanh.js | 2 + node_modules/core-js/fn/math/cbrt.js | 2 + node_modules/core-js/fn/math/clamp.js | 2 + node_modules/core-js/fn/math/clz32.js | 2 + node_modules/core-js/fn/math/cosh.js | 2 + node_modules/core-js/fn/math/deg-per-rad.js | 2 + node_modules/core-js/fn/math/degrees.js | 2 + node_modules/core-js/fn/math/expm1.js | 2 + node_modules/core-js/fn/math/fround.js | 2 + node_modules/core-js/fn/math/fscale.js | 2 + node_modules/core-js/fn/math/hypot.js | 2 + node_modules/core-js/fn/math/iaddh.js | 2 + node_modules/core-js/fn/math/imul.js | 2 + node_modules/core-js/fn/math/imulh.js | 2 + node_modules/core-js/fn/math/index.js | 30 + node_modules/core-js/fn/math/isubh.js | 2 + node_modules/core-js/fn/math/log10.js | 2 + node_modules/core-js/fn/math/log1p.js | 2 + node_modules/core-js/fn/math/log2.js | 2 + node_modules/core-js/fn/math/rad-per-deg.js | 2 + node_modules/core-js/fn/math/radians.js | 2 + node_modules/core-js/fn/math/scale.js | 2 + node_modules/core-js/fn/math/sign.js | 2 + node_modules/core-js/fn/math/signbit.js | 3 + node_modules/core-js/fn/math/sinh.js | 2 + node_modules/core-js/fn/math/tanh.js | 2 + node_modules/core-js/fn/math/trunc.js | 2 + node_modules/core-js/fn/math/umulh.js | 2 + node_modules/core-js/fn/number/constructor.js | 2 + node_modules/core-js/fn/number/epsilon.js | 2 + node_modules/core-js/fn/number/index.js | 14 + node_modules/core-js/fn/number/is-finite.js | 2 + node_modules/core-js/fn/number/is-integer.js | 2 + node_modules/core-js/fn/number/is-nan.js | 2 + .../core-js/fn/number/is-safe-integer.js | 2 + node_modules/core-js/fn/number/iterator.js | 5 + .../core-js/fn/number/max-safe-integer.js | 2 + .../core-js/fn/number/min-safe-integer.js | 2 + node_modules/core-js/fn/number/parse-float.js | 2 + node_modules/core-js/fn/number/parse-int.js | 2 + node_modules/core-js/fn/number/to-fixed.js | 2 + .../core-js/fn/number/to-precision.js | 2 + .../core-js/fn/number/virtual/index.js | 4 + .../core-js/fn/number/virtual/iterator.js | 2 + .../core-js/fn/number/virtual/to-fixed.js | 2 + .../core-js/fn/number/virtual/to-precision.js | 2 + node_modules/core-js/fn/object/assign.js | 2 + node_modules/core-js/fn/object/classof.js | 2 + node_modules/core-js/fn/object/create.js | 5 + .../core-js/fn/object/define-getter.js | 2 + .../core-js/fn/object/define-properties.js | 5 + .../core-js/fn/object/define-property.js | 5 + .../core-js/fn/object/define-setter.js | 2 + node_modules/core-js/fn/object/define.js | 2 + node_modules/core-js/fn/object/entries.js | 2 + node_modules/core-js/fn/object/freeze.js | 2 + .../fn/object/get-own-property-descriptor.js | 5 + .../fn/object/get-own-property-descriptors.js | 2 + .../fn/object/get-own-property-names.js | 5 + .../fn/object/get-own-property-symbols.js | 2 + .../core-js/fn/object/get-prototype-of.js | 2 + node_modules/core-js/fn/object/index.js | 30 + .../core-js/fn/object/is-extensible.js | 2 + node_modules/core-js/fn/object/is-frozen.js | 2 + node_modules/core-js/fn/object/is-object.js | 2 + node_modules/core-js/fn/object/is-sealed.js | 2 + node_modules/core-js/fn/object/is.js | 2 + node_modules/core-js/fn/object/keys.js | 2 + .../core-js/fn/object/lookup-getter.js | 2 + .../core-js/fn/object/lookup-setter.js | 2 + node_modules/core-js/fn/object/make.js | 2 + .../core-js/fn/object/prevent-extensions.js | 2 + node_modules/core-js/fn/object/seal.js | 2 + .../core-js/fn/object/set-prototype-of.js | 2 + node_modules/core-js/fn/object/values.js | 2 + node_modules/core-js/fn/observable.js | 7 + node_modules/core-js/fn/parse-float.js | 2 + node_modules/core-js/fn/parse-int.js | 2 + node_modules/core-js/fn/promise.js | 7 + node_modules/core-js/fn/promise/finally.js | 4 + node_modules/core-js/fn/promise/index.js | 7 + node_modules/core-js/fn/promise/try.js | 8 + node_modules/core-js/fn/reflect/apply.js | 2 + node_modules/core-js/fn/reflect/construct.js | 2 + .../core-js/fn/reflect/define-metadata.js | 2 + .../core-js/fn/reflect/define-property.js | 2 + .../core-js/fn/reflect/delete-metadata.js | 2 + .../core-js/fn/reflect/delete-property.js | 2 + node_modules/core-js/fn/reflect/enumerate.js | 2 + .../core-js/fn/reflect/get-metadata-keys.js | 2 + .../core-js/fn/reflect/get-metadata.js | 2 + .../fn/reflect/get-own-metadata-keys.js | 2 + .../core-js/fn/reflect/get-own-metadata.js | 2 + .../fn/reflect/get-own-property-descriptor.js | 2 + .../core-js/fn/reflect/get-prototype-of.js | 2 + node_modules/core-js/fn/reflect/get.js | 2 + .../core-js/fn/reflect/has-metadata.js | 2 + .../core-js/fn/reflect/has-own-metadata.js | 2 + node_modules/core-js/fn/reflect/has.js | 2 + node_modules/core-js/fn/reflect/index.js | 24 + .../core-js/fn/reflect/is-extensible.js | 2 + node_modules/core-js/fn/reflect/metadata.js | 2 + node_modules/core-js/fn/reflect/own-keys.js | 2 + .../core-js/fn/reflect/prevent-extensions.js | 2 + .../core-js/fn/reflect/set-prototype-of.js | 2 + node_modules/core-js/fn/reflect/set.js | 2 + node_modules/core-js/fn/regexp/constructor.js | 2 + node_modules/core-js/fn/regexp/escape.js | 2 + node_modules/core-js/fn/regexp/flags.js | 5 + node_modules/core-js/fn/regexp/index.js | 9 + node_modules/core-js/fn/regexp/match.js | 5 + node_modules/core-js/fn/regexp/replace.js | 5 + node_modules/core-js/fn/regexp/search.js | 5 + node_modules/core-js/fn/regexp/split.js | 5 + node_modules/core-js/fn/regexp/to-string.js | 5 + node_modules/core-js/fn/set-immediate.js | 2 + node_modules/core-js/fn/set-interval.js | 2 + node_modules/core-js/fn/set-timeout.js | 2 + node_modules/core-js/fn/set.js | 8 + node_modules/core-js/fn/set/from.js | 8 + node_modules/core-js/fn/set/index.js | 8 + node_modules/core-js/fn/set/of.js | 8 + node_modules/core-js/fn/string/anchor.js | 2 + node_modules/core-js/fn/string/at.js | 2 + node_modules/core-js/fn/string/big.js | 2 + node_modules/core-js/fn/string/blink.js | 2 + node_modules/core-js/fn/string/bold.js | 2 + .../core-js/fn/string/code-point-at.js | 2 + node_modules/core-js/fn/string/ends-with.js | 2 + node_modules/core-js/fn/string/escape-html.js | 2 + node_modules/core-js/fn/string/fixed.js | 2 + node_modules/core-js/fn/string/fontcolor.js | 2 + node_modules/core-js/fn/string/fontsize.js | 2 + .../core-js/fn/string/from-code-point.js | 2 + node_modules/core-js/fn/string/includes.js | 2 + node_modules/core-js/fn/string/index.js | 35 + node_modules/core-js/fn/string/italics.js | 2 + node_modules/core-js/fn/string/iterator.js | 5 + node_modules/core-js/fn/string/link.js | 2 + node_modules/core-js/fn/string/match-all.js | 2 + node_modules/core-js/fn/string/pad-end.js | 2 + node_modules/core-js/fn/string/pad-start.js | 2 + node_modules/core-js/fn/string/raw.js | 2 + node_modules/core-js/fn/string/repeat.js | 2 + node_modules/core-js/fn/string/small.js | 2 + node_modules/core-js/fn/string/starts-with.js | 2 + node_modules/core-js/fn/string/strike.js | 2 + node_modules/core-js/fn/string/sub.js | 2 + node_modules/core-js/fn/string/sup.js | 2 + node_modules/core-js/fn/string/trim-end.js | 2 + node_modules/core-js/fn/string/trim-left.js | 2 + node_modules/core-js/fn/string/trim-right.js | 2 + node_modules/core-js/fn/string/trim-start.js | 2 + node_modules/core-js/fn/string/trim.js | 2 + .../core-js/fn/string/unescape-html.js | 2 + .../core-js/fn/string/virtual/anchor.js | 2 + node_modules/core-js/fn/string/virtual/at.js | 2 + node_modules/core-js/fn/string/virtual/big.js | 2 + .../core-js/fn/string/virtual/blink.js | 2 + .../core-js/fn/string/virtual/bold.js | 2 + .../fn/string/virtual/code-point-at.js | 2 + .../core-js/fn/string/virtual/ends-with.js | 2 + .../core-js/fn/string/virtual/escape-html.js | 2 + .../core-js/fn/string/virtual/fixed.js | 2 + .../core-js/fn/string/virtual/fontcolor.js | 2 + .../core-js/fn/string/virtual/fontsize.js | 2 + .../core-js/fn/string/virtual/includes.js | 2 + .../core-js/fn/string/virtual/index.js | 33 + .../core-js/fn/string/virtual/italics.js | 2 + .../core-js/fn/string/virtual/iterator.js | 2 + .../core-js/fn/string/virtual/link.js | 2 + .../core-js/fn/string/virtual/match-all.js | 2 + .../core-js/fn/string/virtual/pad-end.js | 2 + .../core-js/fn/string/virtual/pad-start.js | 2 + .../core-js/fn/string/virtual/repeat.js | 2 + .../core-js/fn/string/virtual/small.js | 2 + .../core-js/fn/string/virtual/starts-with.js | 2 + .../core-js/fn/string/virtual/strike.js | 2 + node_modules/core-js/fn/string/virtual/sub.js | 2 + node_modules/core-js/fn/string/virtual/sup.js | 2 + .../core-js/fn/string/virtual/trim-end.js | 2 + .../core-js/fn/string/virtual/trim-left.js | 2 + .../core-js/fn/string/virtual/trim-right.js | 2 + .../core-js/fn/string/virtual/trim-start.js | 2 + .../core-js/fn/string/virtual/trim.js | 2 + .../fn/string/virtual/unescape-html.js | 2 + .../core-js/fn/symbol/async-iterator.js | 2 + node_modules/core-js/fn/symbol/for.js | 2 + .../core-js/fn/symbol/has-instance.js | 2 + node_modules/core-js/fn/symbol/index.js | 5 + .../core-js/fn/symbol/is-concat-spreadable.js | 1 + node_modules/core-js/fn/symbol/iterator.js | 3 + node_modules/core-js/fn/symbol/key-for.js | 2 + node_modules/core-js/fn/symbol/match.js | 2 + node_modules/core-js/fn/symbol/observable.js | 2 + node_modules/core-js/fn/symbol/replace.js | 2 + node_modules/core-js/fn/symbol/search.js | 2 + node_modules/core-js/fn/symbol/species.js | 1 + node_modules/core-js/fn/symbol/split.js | 2 + .../core-js/fn/symbol/to-primitive.js | 1 + .../core-js/fn/symbol/to-string-tag.js | 2 + node_modules/core-js/fn/symbol/unscopables.js | 1 + node_modules/core-js/fn/system/global.js | 2 + node_modules/core-js/fn/system/index.js | 2 + node_modules/core-js/fn/typed/array-buffer.js | 3 + node_modules/core-js/fn/typed/data-view.js | 3 + .../core-js/fn/typed/float32-array.js | 2 + .../core-js/fn/typed/float64-array.js | 2 + node_modules/core-js/fn/typed/index.js | 13 + node_modules/core-js/fn/typed/int16-array.js | 2 + node_modules/core-js/fn/typed/int32-array.js | 2 + node_modules/core-js/fn/typed/int8-array.js | 2 + node_modules/core-js/fn/typed/uint16-array.js | 2 + node_modules/core-js/fn/typed/uint32-array.js | 2 + node_modules/core-js/fn/typed/uint8-array.js | 2 + .../core-js/fn/typed/uint8-clamped-array.js | 2 + node_modules/core-js/fn/weak-map.js | 6 + node_modules/core-js/fn/weak-map/from.js | 8 + node_modules/core-js/fn/weak-map/index.js | 6 + node_modules/core-js/fn/weak-map/of.js | 8 + node_modules/core-js/fn/weak-set.js | 6 + node_modules/core-js/fn/weak-set/from.js | 8 + node_modules/core-js/fn/weak-set/index.js | 6 + node_modules/core-js/fn/weak-set/of.js | 8 + node_modules/core-js/index.js | 16 + node_modules/core-js/library/core/_.js | 2 + node_modules/core-js/library/core/delay.js | 2 + node_modules/core-js/library/core/dict.js | 2 + node_modules/core-js/library/core/function.js | 2 + node_modules/core-js/library/core/index.js | 15 + node_modules/core-js/library/core/number.js | 2 + node_modules/core-js/library/core/object.js | 5 + node_modules/core-js/library/core/regexp.js | 2 + node_modules/core-js/library/core/string.js | 3 + node_modules/core-js/library/es5/index.js | 37 + node_modules/core-js/library/es6/array.js | 23 + node_modules/core-js/library/es6/date.js | 6 + node_modules/core-js/library/es6/function.js | 4 + node_modules/core-js/library/es6/index.js | 138 + node_modules/core-js/library/es6/map.js | 5 + node_modules/core-js/library/es6/math.js | 18 + node_modules/core-js/library/es6/number.js | 13 + node_modules/core-js/library/es6/object.js | 20 + .../core-js/library/es6/parse-float.js | 2 + node_modules/core-js/library/es6/parse-int.js | 2 + node_modules/core-js/library/es6/promise.js | 5 + node_modules/core-js/library/es6/reflect.js | 15 + node_modules/core-js/library/es6/regexp.js | 8 + node_modules/core-js/library/es6/set.js | 5 + node_modules/core-js/library/es6/string.js | 27 + node_modules/core-js/library/es6/symbol.js | 3 + node_modules/core-js/library/es6/typed.js | 13 + node_modules/core-js/library/es6/weak-map.js | 4 + node_modules/core-js/library/es6/weak-set.js | 4 + node_modules/core-js/library/es7/array.js | 4 + node_modules/core-js/library/es7/asap.js | 2 + node_modules/core-js/library/es7/error.js | 2 + node_modules/core-js/library/es7/global.js | 2 + node_modules/core-js/library/es7/index.js | 56 + node_modules/core-js/library/es7/map.js | 4 + node_modules/core-js/library/es7/math.js | 13 + node_modules/core-js/library/es7/object.js | 8 + .../core-js/library/es7/observable.js | 7 + node_modules/core-js/library/es7/promise.js | 3 + node_modules/core-js/library/es7/reflect.js | 10 + node_modules/core-js/library/es7/set.js | 4 + node_modules/core-js/library/es7/string.js | 7 + node_modules/core-js/library/es7/symbol.js | 3 + node_modules/core-js/library/es7/system.js | 2 + node_modules/core-js/library/es7/weak-map.js | 3 + node_modules/core-js/library/es7/weak-set.js | 3 + node_modules/core-js/library/fn/_.js | 2 + .../core-js/library/fn/array/concat.js | 4 + .../core-js/library/fn/array/copy-within.js | 2 + .../core-js/library/fn/array/entries.js | 2 + .../core-js/library/fn/array/every.js | 2 + node_modules/core-js/library/fn/array/fill.js | 2 + .../core-js/library/fn/array/filter.js | 2 + .../core-js/library/fn/array/find-index.js | 2 + node_modules/core-js/library/fn/array/find.js | 2 + .../core-js/library/fn/array/flat-map.js | 2 + .../core-js/library/fn/array/flatten.js | 2 + .../core-js/library/fn/array/for-each.js | 2 + node_modules/core-js/library/fn/array/from.js | 3 + .../core-js/library/fn/array/includes.js | 2 + .../core-js/library/fn/array/index-of.js | 2 + .../core-js/library/fn/array/index.js | 26 + .../core-js/library/fn/array/is-array.js | 2 + .../core-js/library/fn/array/iterator.js | 2 + node_modules/core-js/library/fn/array/join.js | 2 + node_modules/core-js/library/fn/array/keys.js | 2 + .../core-js/library/fn/array/last-index-of.js | 2 + node_modules/core-js/library/fn/array/map.js | 2 + node_modules/core-js/library/fn/array/of.js | 2 + node_modules/core-js/library/fn/array/pop.js | 4 + node_modules/core-js/library/fn/array/push.js | 4 + .../core-js/library/fn/array/reduce-right.js | 2 + .../core-js/library/fn/array/reduce.js | 2 + .../core-js/library/fn/array/reverse.js | 4 + .../core-js/library/fn/array/shift.js | 4 + .../core-js/library/fn/array/slice.js | 2 + node_modules/core-js/library/fn/array/some.js | 2 + node_modules/core-js/library/fn/array/sort.js | 2 + .../core-js/library/fn/array/splice.js | 4 + .../core-js/library/fn/array/unshift.js | 4 + .../core-js/library/fn/array/values.js | 2 + .../library/fn/array/virtual/copy-within.js | 2 + .../library/fn/array/virtual/entries.js | 2 + .../core-js/library/fn/array/virtual/every.js | 2 + .../core-js/library/fn/array/virtual/fill.js | 2 + .../library/fn/array/virtual/filter.js | 2 + .../library/fn/array/virtual/find-index.js | 2 + .../core-js/library/fn/array/virtual/find.js | 2 + .../library/fn/array/virtual/flat-map.js | 2 + .../library/fn/array/virtual/flatten.js | 2 + .../library/fn/array/virtual/for-each.js | 2 + .../library/fn/array/virtual/includes.js | 2 + .../library/fn/array/virtual/index-of.js | 2 + .../core-js/library/fn/array/virtual/index.js | 20 + .../library/fn/array/virtual/iterator.js | 2 + .../core-js/library/fn/array/virtual/join.js | 2 + .../core-js/library/fn/array/virtual/keys.js | 2 + .../library/fn/array/virtual/last-index-of.js | 2 + .../core-js/library/fn/array/virtual/map.js | 2 + .../library/fn/array/virtual/reduce-right.js | 2 + .../library/fn/array/virtual/reduce.js | 2 + .../core-js/library/fn/array/virtual/slice.js | 2 + .../core-js/library/fn/array/virtual/some.js | 2 + .../core-js/library/fn/array/virtual/sort.js | 2 + .../library/fn/array/virtual/values.js | 2 + node_modules/core-js/library/fn/asap.js | 2 + .../core-js/library/fn/clear-immediate.js | 2 + node_modules/core-js/library/fn/date/index.js | 6 + node_modules/core-js/library/fn/date/now.js | 2 + .../core-js/library/fn/date/to-iso-string.js | 3 + .../core-js/library/fn/date/to-json.js | 2 + .../core-js/library/fn/date/to-primitive.js | 5 + .../core-js/library/fn/date/to-string.js | 5 + node_modules/core-js/library/fn/delay.js | 2 + node_modules/core-js/library/fn/dict.js | 2 + .../library/fn/dom-collections/index.js | 8 + .../library/fn/dom-collections/iterator.js | 2 + .../core-js/library/fn/error/index.js | 2 + .../core-js/library/fn/error/is-error.js | 2 + .../core-js/library/fn/function/bind.js | 2 + .../library/fn/function/has-instance.js | 2 + .../core-js/library/fn/function/index.js | 5 + .../core-js/library/fn/function/name.js | 1 + .../core-js/library/fn/function/part.js | 2 + .../library/fn/function/virtual/bind.js | 2 + .../library/fn/function/virtual/index.js | 3 + .../library/fn/function/virtual/part.js | 2 + .../core-js/library/fn/get-iterator-method.js | 3 + .../core-js/library/fn/get-iterator.js | 3 + node_modules/core-js/library/fn/global.js | 2 + .../core-js/library/fn/is-iterable.js | 3 + node_modules/core-js/library/fn/json/index.js | 2 + .../core-js/library/fn/json/stringify.js | 5 + node_modules/core-js/library/fn/map.js | 8 + node_modules/core-js/library/fn/map/from.js | 8 + node_modules/core-js/library/fn/map/index.js | 8 + node_modules/core-js/library/fn/map/of.js | 8 + node_modules/core-js/library/fn/math/acosh.js | 2 + node_modules/core-js/library/fn/math/asinh.js | 2 + node_modules/core-js/library/fn/math/atanh.js | 2 + node_modules/core-js/library/fn/math/cbrt.js | 2 + node_modules/core-js/library/fn/math/clamp.js | 2 + node_modules/core-js/library/fn/math/clz32.js | 2 + node_modules/core-js/library/fn/math/cosh.js | 2 + .../core-js/library/fn/math/deg-per-rad.js | 2 + .../core-js/library/fn/math/degrees.js | 2 + node_modules/core-js/library/fn/math/expm1.js | 2 + .../core-js/library/fn/math/fround.js | 2 + .../core-js/library/fn/math/fscale.js | 2 + node_modules/core-js/library/fn/math/hypot.js | 2 + node_modules/core-js/library/fn/math/iaddh.js | 2 + node_modules/core-js/library/fn/math/imul.js | 2 + node_modules/core-js/library/fn/math/imulh.js | 2 + node_modules/core-js/library/fn/math/index.js | 30 + node_modules/core-js/library/fn/math/isubh.js | 2 + node_modules/core-js/library/fn/math/log10.js | 2 + node_modules/core-js/library/fn/math/log1p.js | 2 + node_modules/core-js/library/fn/math/log2.js | 2 + .../core-js/library/fn/math/rad-per-deg.js | 2 + .../core-js/library/fn/math/radians.js | 2 + node_modules/core-js/library/fn/math/scale.js | 2 + node_modules/core-js/library/fn/math/sign.js | 2 + .../core-js/library/fn/math/signbit.js | 3 + node_modules/core-js/library/fn/math/sinh.js | 2 + node_modules/core-js/library/fn/math/tanh.js | 2 + node_modules/core-js/library/fn/math/trunc.js | 2 + node_modules/core-js/library/fn/math/umulh.js | 2 + .../core-js/library/fn/number/constructor.js | 2 + .../core-js/library/fn/number/epsilon.js | 2 + .../core-js/library/fn/number/index.js | 14 + .../core-js/library/fn/number/is-finite.js | 2 + .../core-js/library/fn/number/is-integer.js | 2 + .../core-js/library/fn/number/is-nan.js | 2 + .../library/fn/number/is-safe-integer.js | 2 + .../core-js/library/fn/number/iterator.js | 5 + .../library/fn/number/max-safe-integer.js | 2 + .../library/fn/number/min-safe-integer.js | 2 + .../core-js/library/fn/number/parse-float.js | 2 + .../core-js/library/fn/number/parse-int.js | 2 + .../core-js/library/fn/number/to-fixed.js | 2 + .../core-js/library/fn/number/to-precision.js | 2 + .../library/fn/number/virtual/index.js | 4 + .../library/fn/number/virtual/iterator.js | 2 + .../library/fn/number/virtual/to-fixed.js | 2 + .../library/fn/number/virtual/to-precision.js | 2 + .../core-js/library/fn/object/assign.js | 2 + .../core-js/library/fn/object/classof.js | 2 + .../core-js/library/fn/object/create.js | 5 + .../library/fn/object/define-getter.js | 2 + .../library/fn/object/define-properties.js | 5 + .../library/fn/object/define-property.js | 5 + .../library/fn/object/define-setter.js | 2 + .../core-js/library/fn/object/define.js | 2 + .../core-js/library/fn/object/entries.js | 2 + .../core-js/library/fn/object/freeze.js | 2 + .../fn/object/get-own-property-descriptor.js | 5 + .../fn/object/get-own-property-descriptors.js | 2 + .../fn/object/get-own-property-names.js | 5 + .../fn/object/get-own-property-symbols.js | 2 + .../library/fn/object/get-prototype-of.js | 2 + .../core-js/library/fn/object/index.js | 30 + .../library/fn/object/is-extensible.js | 2 + .../core-js/library/fn/object/is-frozen.js | 2 + .../core-js/library/fn/object/is-object.js | 2 + .../core-js/library/fn/object/is-sealed.js | 2 + node_modules/core-js/library/fn/object/is.js | 2 + .../core-js/library/fn/object/keys.js | 2 + .../library/fn/object/lookup-getter.js | 2 + .../library/fn/object/lookup-setter.js | 2 + .../core-js/library/fn/object/make.js | 2 + .../library/fn/object/prevent-extensions.js | 2 + .../core-js/library/fn/object/seal.js | 2 + .../library/fn/object/set-prototype-of.js | 2 + .../core-js/library/fn/object/values.js | 2 + node_modules/core-js/library/fn/observable.js | 7 + .../core-js/library/fn/parse-float.js | 2 + node_modules/core-js/library/fn/parse-int.js | 2 + node_modules/core-js/library/fn/promise.js | 7 + .../core-js/library/fn/promise/finally.js | 4 + .../core-js/library/fn/promise/index.js | 7 + .../core-js/library/fn/promise/try.js | 8 + .../core-js/library/fn/reflect/apply.js | 2 + .../core-js/library/fn/reflect/construct.js | 2 + .../library/fn/reflect/define-metadata.js | 2 + .../library/fn/reflect/define-property.js | 2 + .../library/fn/reflect/delete-metadata.js | 2 + .../library/fn/reflect/delete-property.js | 2 + .../core-js/library/fn/reflect/enumerate.js | 2 + .../library/fn/reflect/get-metadata-keys.js | 2 + .../library/fn/reflect/get-metadata.js | 2 + .../fn/reflect/get-own-metadata-keys.js | 2 + .../library/fn/reflect/get-own-metadata.js | 2 + .../fn/reflect/get-own-property-descriptor.js | 2 + .../library/fn/reflect/get-prototype-of.js | 2 + .../core-js/library/fn/reflect/get.js | 2 + .../library/fn/reflect/has-metadata.js | 2 + .../library/fn/reflect/has-own-metadata.js | 2 + .../core-js/library/fn/reflect/has.js | 2 + .../core-js/library/fn/reflect/index.js | 24 + .../library/fn/reflect/is-extensible.js | 2 + .../core-js/library/fn/reflect/metadata.js | 2 + .../core-js/library/fn/reflect/own-keys.js | 2 + .../library/fn/reflect/prevent-extensions.js | 2 + .../library/fn/reflect/set-prototype-of.js | 2 + .../core-js/library/fn/reflect/set.js | 2 + .../core-js/library/fn/regexp/constructor.js | 2 + .../core-js/library/fn/regexp/escape.js | 2 + .../core-js/library/fn/regexp/flags.js | 5 + .../core-js/library/fn/regexp/index.js | 9 + .../core-js/library/fn/regexp/match.js | 5 + .../core-js/library/fn/regexp/replace.js | 5 + .../core-js/library/fn/regexp/search.js | 5 + .../core-js/library/fn/regexp/split.js | 5 + .../core-js/library/fn/regexp/to-string.js | 5 + .../core-js/library/fn/set-immediate.js | 2 + .../core-js/library/fn/set-interval.js | 2 + .../core-js/library/fn/set-timeout.js | 2 + node_modules/core-js/library/fn/set.js | 8 + node_modules/core-js/library/fn/set/from.js | 8 + node_modules/core-js/library/fn/set/index.js | 8 + node_modules/core-js/library/fn/set/of.js | 8 + .../core-js/library/fn/string/anchor.js | 2 + node_modules/core-js/library/fn/string/at.js | 2 + node_modules/core-js/library/fn/string/big.js | 2 + .../core-js/library/fn/string/blink.js | 2 + .../core-js/library/fn/string/bold.js | 2 + .../library/fn/string/code-point-at.js | 2 + .../core-js/library/fn/string/ends-with.js | 2 + .../core-js/library/fn/string/escape-html.js | 2 + .../core-js/library/fn/string/fixed.js | 2 + .../core-js/library/fn/string/fontcolor.js | 2 + .../core-js/library/fn/string/fontsize.js | 2 + .../library/fn/string/from-code-point.js | 2 + .../core-js/library/fn/string/includes.js | 2 + .../core-js/library/fn/string/index.js | 35 + .../core-js/library/fn/string/italics.js | 2 + .../core-js/library/fn/string/iterator.js | 5 + .../core-js/library/fn/string/link.js | 2 + .../core-js/library/fn/string/match-all.js | 2 + .../core-js/library/fn/string/pad-end.js | 2 + .../core-js/library/fn/string/pad-start.js | 2 + node_modules/core-js/library/fn/string/raw.js | 2 + .../core-js/library/fn/string/repeat.js | 2 + .../core-js/library/fn/string/small.js | 2 + .../core-js/library/fn/string/starts-with.js | 2 + .../core-js/library/fn/string/strike.js | 2 + node_modules/core-js/library/fn/string/sub.js | 2 + node_modules/core-js/library/fn/string/sup.js | 2 + .../core-js/library/fn/string/trim-end.js | 2 + .../core-js/library/fn/string/trim-left.js | 2 + .../core-js/library/fn/string/trim-right.js | 2 + .../core-js/library/fn/string/trim-start.js | 2 + .../core-js/library/fn/string/trim.js | 2 + .../library/fn/string/unescape-html.js | 2 + .../library/fn/string/virtual/anchor.js | 2 + .../core-js/library/fn/string/virtual/at.js | 2 + .../core-js/library/fn/string/virtual/big.js | 2 + .../library/fn/string/virtual/blink.js | 2 + .../core-js/library/fn/string/virtual/bold.js | 2 + .../fn/string/virtual/code-point-at.js | 2 + .../library/fn/string/virtual/ends-with.js | 2 + .../library/fn/string/virtual/escape-html.js | 2 + .../library/fn/string/virtual/fixed.js | 2 + .../library/fn/string/virtual/fontcolor.js | 2 + .../library/fn/string/virtual/fontsize.js | 2 + .../library/fn/string/virtual/includes.js | 2 + .../library/fn/string/virtual/index.js | 33 + .../library/fn/string/virtual/italics.js | 2 + .../library/fn/string/virtual/iterator.js | 2 + .../core-js/library/fn/string/virtual/link.js | 2 + .../library/fn/string/virtual/match-all.js | 2 + .../library/fn/string/virtual/pad-end.js | 2 + .../library/fn/string/virtual/pad-start.js | 2 + .../library/fn/string/virtual/repeat.js | 2 + .../library/fn/string/virtual/small.js | 2 + .../library/fn/string/virtual/starts-with.js | 2 + .../library/fn/string/virtual/strike.js | 2 + .../core-js/library/fn/string/virtual/sub.js | 2 + .../core-js/library/fn/string/virtual/sup.js | 2 + .../library/fn/string/virtual/trim-end.js | 2 + .../library/fn/string/virtual/trim-left.js | 2 + .../library/fn/string/virtual/trim-right.js | 2 + .../library/fn/string/virtual/trim-start.js | 2 + .../core-js/library/fn/string/virtual/trim.js | 2 + .../fn/string/virtual/unescape-html.js | 2 + .../library/fn/symbol/async-iterator.js | 2 + node_modules/core-js/library/fn/symbol/for.js | 2 + .../core-js/library/fn/symbol/has-instance.js | 2 + .../core-js/library/fn/symbol/index.js | 5 + .../library/fn/symbol/is-concat-spreadable.js | 1 + .../core-js/library/fn/symbol/iterator.js | 3 + .../core-js/library/fn/symbol/key-for.js | 2 + .../core-js/library/fn/symbol/match.js | 2 + .../core-js/library/fn/symbol/observable.js | 2 + .../core-js/library/fn/symbol/replace.js | 2 + .../core-js/library/fn/symbol/search.js | 2 + .../core-js/library/fn/symbol/species.js | 1 + .../core-js/library/fn/symbol/split.js | 2 + .../core-js/library/fn/symbol/to-primitive.js | 1 + .../library/fn/symbol/to-string-tag.js | 2 + .../core-js/library/fn/symbol/unscopables.js | 1 + .../core-js/library/fn/system/global.js | 2 + .../core-js/library/fn/system/index.js | 2 + .../core-js/library/fn/typed/array-buffer.js | 3 + .../core-js/library/fn/typed/data-view.js | 3 + .../core-js/library/fn/typed/float32-array.js | 2 + .../core-js/library/fn/typed/float64-array.js | 2 + .../core-js/library/fn/typed/index.js | 13 + .../core-js/library/fn/typed/int16-array.js | 2 + .../core-js/library/fn/typed/int32-array.js | 2 + .../core-js/library/fn/typed/int8-array.js | 2 + .../core-js/library/fn/typed/uint16-array.js | 2 + .../core-js/library/fn/typed/uint32-array.js | 2 + .../core-js/library/fn/typed/uint8-array.js | 2 + .../library/fn/typed/uint8-clamped-array.js | 2 + node_modules/core-js/library/fn/weak-map.js | 6 + .../core-js/library/fn/weak-map/from.js | 8 + .../core-js/library/fn/weak-map/index.js | 6 + .../core-js/library/fn/weak-map/of.js | 8 + node_modules/core-js/library/fn/weak-set.js | 6 + .../core-js/library/fn/weak-set/from.js | 8 + .../core-js/library/fn/weak-set/index.js | 6 + .../core-js/library/fn/weak-set/of.js | 8 + node_modules/core-js/library/index.js | 16 + .../core-js/library/modules/_a-function.js | 4 + .../library/modules/_a-number-value.js | 5 + .../library/modules/_add-to-unscopables.js | 1 + .../core-js/library/modules/_an-instance.js | 5 + .../core-js/library/modules/_an-object.js | 5 + .../library/modules/_array-copy-within.js | 26 + .../core-js/library/modules/_array-fill.js | 15 + .../library/modules/_array-from-iterable.js | 7 + .../library/modules/_array-includes.js | 23 + .../core-js/library/modules/_array-methods.js | 44 + .../core-js/library/modules/_array-reduce.js | 28 + .../modules/_array-species-constructor.js | 16 + .../library/modules/_array-species-create.js | 6 + node_modules/core-js/library/modules/_bind.js | 25 + .../core-js/library/modules/_classof.js | 23 + node_modules/core-js/library/modules/_cof.js | 5 + .../library/modules/_collection-strong.js | 144 + .../library/modules/_collection-to-json.js | 9 + .../library/modules/_collection-weak.js | 85 + .../core-js/library/modules/_collection.js | 59 + node_modules/core-js/library/modules/_core.js | 2 + .../library/modules/_create-property.js | 8 + node_modules/core-js/library/modules/_ctx.js | 20 + .../library/modules/_date-to-iso-string.js | 26 + .../library/modules/_date-to-primitive.js | 9 + .../core-js/library/modules/_defined.js | 5 + .../core-js/library/modules/_descriptors.js | 4 + .../core-js/library/modules/_dom-create.js | 7 + .../core-js/library/modules/_entry-virtual.js | 5 + .../core-js/library/modules/_enum-bug-keys.js | 4 + .../core-js/library/modules/_enum-keys.js | 15 + .../core-js/library/modules/_export.js | 62 + .../library/modules/_fails-is-regexp.js | 12 + .../core-js/library/modules/_fails.js | 7 + .../core-js/library/modules/_fix-re-wks.js | 28 + .../core-js/library/modules/_flags.js | 13 + .../library/modules/_flatten-into-array.js | 39 + .../core-js/library/modules/_for-of.js | 25 + .../core-js/library/modules/_global.js | 6 + node_modules/core-js/library/modules/_has.js | 4 + node_modules/core-js/library/modules/_hide.js | 8 + node_modules/core-js/library/modules/_html.js | 2 + .../library/modules/_ie8-dom-define.js | 3 + .../library/modules/_inherit-if-required.js | 9 + .../core-js/library/modules/_invoke.js | 16 + .../core-js/library/modules/_iobject.js | 6 + .../core-js/library/modules/_is-array-iter.js | 8 + .../core-js/library/modules/_is-array.js | 5 + .../core-js/library/modules/_is-integer.js | 6 + .../core-js/library/modules/_is-object.js | 3 + .../core-js/library/modules/_is-regexp.js | 8 + .../core-js/library/modules/_iter-call.js | 12 + .../core-js/library/modules/_iter-create.js | 13 + .../core-js/library/modules/_iter-define.js | 69 + .../core-js/library/modules/_iter-detect.js | 22 + .../core-js/library/modules/_iter-step.js | 3 + .../core-js/library/modules/_iterators.js | 1 + .../core-js/library/modules/_keyof.js | 10 + .../core-js/library/modules/_library.js | 1 + .../core-js/library/modules/_math-expm1.js | 10 + .../core-js/library/modules/_math-fround.js | 23 + .../core-js/library/modules/_math-log1p.js | 4 + .../core-js/library/modules/_math-scale.js | 18 + .../core-js/library/modules/_math-sign.js | 5 + node_modules/core-js/library/modules/_meta.js | 53 + .../core-js/library/modules/_metadata.js | 51 + .../core-js/library/modules/_microtask.js | 69 + .../modules/_new-promise-capability.js | 18 + .../core-js/library/modules/_object-assign.js | 34 + .../core-js/library/modules/_object-create.js | 41 + .../core-js/library/modules/_object-define.js | 13 + .../core-js/library/modules/_object-dp.js | 16 + .../core-js/library/modules/_object-dps.js | 13 + .../library/modules/_object-forced-pam.js | 9 + .../core-js/library/modules/_object-gopd.js | 16 + .../library/modules/_object-gopn-ext.js | 19 + .../core-js/library/modules/_object-gopn.js | 7 + .../core-js/library/modules/_object-gops.js | 1 + .../core-js/library/modules/_object-gpo.js | 13 + .../library/modules/_object-keys-internal.js | 17 + .../core-js/library/modules/_object-keys.js | 7 + .../core-js/library/modules/_object-pie.js | 1 + .../core-js/library/modules/_object-sap.js | 10 + .../library/modules/_object-to-array.js | 16 + .../core-js/library/modules/_own-keys.js | 10 + .../core-js/library/modules/_parse-float.js | 8 + .../core-js/library/modules/_parse-int.js | 9 + .../core-js/library/modules/_partial.js | 25 + node_modules/core-js/library/modules/_path.js | 1 + .../core-js/library/modules/_perform.js | 7 + .../library/modules/_promise-resolve.js | 12 + .../core-js/library/modules/_property-desc.js | 8 + .../core-js/library/modules/_redefine-all.js | 7 + .../core-js/library/modules/_redefine.js | 1 + .../core-js/library/modules/_replacer.js | 8 + .../core-js/library/modules/_same-value.js | 5 + .../library/modules/_set-collection-from.js | 28 + .../library/modules/_set-collection-of.js | 12 + .../core-js/library/modules/_set-proto.js | 25 + .../core-js/library/modules/_set-species.js | 14 + .../library/modules/_set-to-string-tag.js | 7 + .../core-js/library/modules/_shared-key.js | 5 + .../core-js/library/modules/_shared.js | 12 + .../library/modules/_species-constructor.js | 9 + .../core-js/library/modules/_strict-method.js | 9 + .../core-js/library/modules/_string-at.js | 17 + .../library/modules/_string-context.js | 8 + .../core-js/library/modules/_string-html.js | 19 + .../core-js/library/modules/_string-pad.js | 16 + .../core-js/library/modules/_string-repeat.js | 12 + .../core-js/library/modules/_string-trim.js | 30 + .../core-js/library/modules/_string-ws.js | 2 + node_modules/core-js/library/modules/_task.js | 84 + .../library/modules/_to-absolute-index.js | 7 + .../core-js/library/modules/_to-index.js | 10 + .../core-js/library/modules/_to-integer.js | 6 + .../core-js/library/modules/_to-iobject.js | 6 + .../core-js/library/modules/_to-length.js | 6 + .../core-js/library/modules/_to-object.js | 5 + .../core-js/library/modules/_to-primitive.js | 12 + .../core-js/library/modules/_typed-array.js | 480 + .../core-js/library/modules/_typed-buffer.js | 276 + .../core-js/library/modules/_typed.js | 28 + node_modules/core-js/library/modules/_uid.js | 5 + .../core-js/library/modules/_user-agent.js | 4 + .../library/modules/_validate-collection.js | 5 + .../core-js/library/modules/_wks-define.js | 9 + .../core-js/library/modules/_wks-ext.js | 1 + node_modules/core-js/library/modules/_wks.js | 11 + .../core-js/library/modules/core.delay.js | 12 + .../core-js/library/modules/core.dict.js | 157 + .../library/modules/core.function.part.js | 7 + .../modules/core.get-iterator-method.js | 8 + .../library/modules/core.get-iterator.js | 7 + .../library/modules/core.is-iterable.js | 10 + .../library/modules/core.number.iterator.js | 9 + .../library/modules/core.object.classof.js | 3 + .../library/modules/core.object.define.js | 4 + .../library/modules/core.object.is-object.js | 3 + .../library/modules/core.object.make.js | 9 + .../library/modules/core.regexp.escape.js | 5 + .../modules/core.string.escape-html.js | 11 + .../modules/core.string.unescape-html.js | 11 + node_modules/core-js/library/modules/es5.js | 35 + .../library/modules/es6.array.copy-within.js | 6 + .../library/modules/es6.array.every.js | 10 + .../core-js/library/modules/es6.array.fill.js | 6 + .../library/modules/es6.array.filter.js | 10 + .../library/modules/es6.array.find-index.js | 14 + .../core-js/library/modules/es6.array.find.js | 14 + .../library/modules/es6.array.for-each.js | 11 + .../core-js/library/modules/es6.array.from.js | 37 + .../library/modules/es6.array.index-of.js | 15 + .../library/modules/es6.array.is-array.js | 4 + .../library/modules/es6.array.iterator.js | 34 + .../core-js/library/modules/es6.array.join.js | 12 + .../modules/es6.array.last-index-of.js | 22 + .../core-js/library/modules/es6.array.map.js | 10 + .../core-js/library/modules/es6.array.of.js | 19 + .../library/modules/es6.array.reduce-right.js | 10 + .../library/modules/es6.array.reduce.js | 10 + .../library/modules/es6.array.slice.js | 28 + .../core-js/library/modules/es6.array.some.js | 10 + .../core-js/library/modules/es6.array.sort.js | 23 + .../library/modules/es6.array.species.js | 1 + .../core-js/library/modules/es6.date.now.js | 4 + .../library/modules/es6.date.to-iso-string.js | 8 + .../library/modules/es6.date.to-json.js | 19 + .../library/modules/es6.date.to-primitive.js | 0 .../library/modules/es6.date.to-string.js | 0 .../library/modules/es6.function.bind.js | 4 + .../modules/es6.function.has-instance.js | 13 + .../library/modules/es6.function.name.js | 0 .../core-js/library/modules/es6.map.js | 19 + .../core-js/library/modules/es6.math.acosh.js | 18 + .../core-js/library/modules/es6.math.asinh.js | 10 + .../core-js/library/modules/es6.math.atanh.js | 10 + .../core-js/library/modules/es6.math.cbrt.js | 9 + .../core-js/library/modules/es6.math.clz32.js | 8 + .../core-js/library/modules/es6.math.cosh.js | 9 + .../core-js/library/modules/es6.math.expm1.js | 5 + .../library/modules/es6.math.fround.js | 4 + .../core-js/library/modules/es6.math.hypot.js | 25 + .../core-js/library/modules/es6.math.imul.js | 17 + .../core-js/library/modules/es6.math.log10.js | 8 + .../core-js/library/modules/es6.math.log1p.js | 4 + .../core-js/library/modules/es6.math.log2.js | 8 + .../core-js/library/modules/es6.math.sign.js | 4 + .../core-js/library/modules/es6.math.sinh.js | 15 + .../core-js/library/modules/es6.math.tanh.js | 12 + .../core-js/library/modules/es6.math.trunc.js | 8 + .../library/modules/es6.number.constructor.js | 0 .../library/modules/es6.number.epsilon.js | 4 + .../library/modules/es6.number.is-finite.js | 9 + .../library/modules/es6.number.is-integer.js | 4 + .../library/modules/es6.number.is-nan.js | 9 + .../modules/es6.number.is-safe-integer.js | 10 + .../modules/es6.number.max-safe-integer.js | 4 + .../modules/es6.number.min-safe-integer.js | 4 + .../library/modules/es6.number.parse-float.js | 4 + .../library/modules/es6.number.parse-int.js | 4 + .../library/modules/es6.number.to-fixed.js | 114 + .../modules/es6.number.to-precision.js | 18 + .../library/modules/es6.object.assign.js | 4 + .../library/modules/es6.object.create.js | 3 + .../modules/es6.object.define-properties.js | 3 + .../modules/es6.object.define-property.js | 3 + .../library/modules/es6.object.freeze.js | 9 + .../es6.object.get-own-property-descriptor.js | 9 + .../es6.object.get-own-property-names.js | 4 + .../modules/es6.object.get-prototype-of.js | 9 + .../modules/es6.object.is-extensible.js | 8 + .../library/modules/es6.object.is-frozen.js | 8 + .../library/modules/es6.object.is-sealed.js | 8 + .../core-js/library/modules/es6.object.is.js | 3 + .../library/modules/es6.object.keys.js | 9 + .../modules/es6.object.prevent-extensions.js | 9 + .../library/modules/es6.object.seal.js | 9 + .../modules/es6.object.set-prototype-of.js | 3 + .../library/modules/es6.object.to-string.js | 0 .../library/modules/es6.parse-float.js | 4 + .../core-js/library/modules/es6.parse-int.js | 4 + .../core-js/library/modules/es6.promise.js | 286 + .../library/modules/es6.reflect.apply.js | 16 + .../library/modules/es6.reflect.construct.js | 47 + .../modules/es6.reflect.define-property.js | 23 + .../modules/es6.reflect.delete-property.js | 11 + .../library/modules/es6.reflect.enumerate.js | 26 + ...es6.reflect.get-own-property-descriptor.js | 10 + .../modules/es6.reflect.get-prototype-of.js | 10 + .../library/modules/es6.reflect.get.js | 21 + .../library/modules/es6.reflect.has.js | 8 + .../modules/es6.reflect.is-extensible.js | 11 + .../library/modules/es6.reflect.own-keys.js | 4 + .../modules/es6.reflect.prevent-extensions.js | 16 + .../modules/es6.reflect.set-prototype-of.js | 15 + .../library/modules/es6.reflect.set.js | 33 + .../library/modules/es6.regexp.constructor.js | 1 + .../library/modules/es6.regexp.flags.js | 0 .../library/modules/es6.regexp.match.js | 0 .../library/modules/es6.regexp.replace.js | 0 .../library/modules/es6.regexp.search.js | 0 .../library/modules/es6.regexp.split.js | 0 .../library/modules/es6.regexp.to-string.js | 0 .../core-js/library/modules/es6.set.js | 14 + .../library/modules/es6.string.anchor.js | 7 + .../core-js/library/modules/es6.string.big.js | 7 + .../library/modules/es6.string.blink.js | 7 + .../library/modules/es6.string.bold.js | 7 + .../modules/es6.string.code-point-at.js | 9 + .../library/modules/es6.string.ends-with.js | 20 + .../library/modules/es6.string.fixed.js | 7 + .../library/modules/es6.string.fontcolor.js | 7 + .../library/modules/es6.string.fontsize.js | 7 + .../modules/es6.string.from-code-point.js | 23 + .../library/modules/es6.string.includes.js | 12 + .../library/modules/es6.string.italics.js | 7 + .../library/modules/es6.string.iterator.js | 17 + .../library/modules/es6.string.link.js | 7 + .../core-js/library/modules/es6.string.raw.js | 18 + .../library/modules/es6.string.repeat.js | 6 + .../library/modules/es6.string.small.js | 7 + .../library/modules/es6.string.starts-with.js | 18 + .../library/modules/es6.string.strike.js | 7 + .../core-js/library/modules/es6.string.sub.js | 7 + .../core-js/library/modules/es6.string.sup.js | 7 + .../library/modules/es6.string.trim.js | 7 + .../core-js/library/modules/es6.symbol.js | 234 + .../library/modules/es6.typed.array-buffer.js | 46 + .../library/modules/es6.typed.data-view.js | 4 + .../modules/es6.typed.float32-array.js | 5 + .../modules/es6.typed.float64-array.js | 5 + .../library/modules/es6.typed.int16-array.js | 5 + .../library/modules/es6.typed.int32-array.js | 5 + .../library/modules/es6.typed.int8-array.js | 5 + .../library/modules/es6.typed.uint16-array.js | 5 + .../library/modules/es6.typed.uint32-array.js | 5 + .../library/modules/es6.typed.uint8-array.js | 5 + .../modules/es6.typed.uint8-clamped-array.js | 5 + .../core-js/library/modules/es6.weak-map.js | 59 + .../core-js/library/modules/es6.weak-set.js | 14 + .../library/modules/es7.array.flat-map.js | 22 + .../library/modules/es7.array.flatten.js | 21 + .../library/modules/es7.array.includes.js | 12 + .../core-js/library/modules/es7.asap.js | 12 + .../library/modules/es7.error.is-error.js | 9 + .../core-js/library/modules/es7.global.js | 4 + .../core-js/library/modules/es7.map.from.js | 2 + .../core-js/library/modules/es7.map.of.js | 2 + .../library/modules/es7.map.to-json.js | 4 + .../core-js/library/modules/es7.math.clamp.js | 8 + .../library/modules/es7.math.deg-per-rad.js | 4 + .../library/modules/es7.math.degrees.js | 9 + .../library/modules/es7.math.fscale.js | 10 + .../core-js/library/modules/es7.math.iaddh.js | 11 + .../core-js/library/modules/es7.math.imulh.js | 16 + .../core-js/library/modules/es7.math.isubh.js | 11 + .../library/modules/es7.math.rad-per-deg.js | 4 + .../library/modules/es7.math.radians.js | 9 + .../core-js/library/modules/es7.math.scale.js | 4 + .../library/modules/es7.math.signbit.js | 7 + .../core-js/library/modules/es7.math.umulh.js | 16 + .../modules/es7.object.define-getter.js | 12 + .../modules/es7.object.define-setter.js | 12 + .../library/modules/es7.object.entries.js | 9 + ...es7.object.get-own-property-descriptors.js | 22 + .../modules/es7.object.lookup-getter.js | 18 + .../modules/es7.object.lookup-setter.js | 18 + .../library/modules/es7.object.values.js | 9 + .../core-js/library/modules/es7.observable.js | 199 + .../library/modules/es7.promise.finally.js | 20 + .../library/modules/es7.promise.try.js | 12 + .../modules/es7.reflect.define-metadata.js | 8 + .../modules/es7.reflect.delete-metadata.js | 15 + .../modules/es7.reflect.get-metadata-keys.js | 19 + .../modules/es7.reflect.get-metadata.js | 17 + .../es7.reflect.get-own-metadata-keys.js | 8 + .../modules/es7.reflect.get-own-metadata.js | 9 + .../modules/es7.reflect.has-metadata.js | 16 + .../modules/es7.reflect.has-own-metadata.js | 9 + .../library/modules/es7.reflect.metadata.js | 15 + .../core-js/library/modules/es7.set.from.js | 2 + .../core-js/library/modules/es7.set.of.js | 2 + .../library/modules/es7.set.to-json.js | 4 + .../core-js/library/modules/es7.string.at.js | 10 + .../library/modules/es7.string.match-all.js | 30 + .../library/modules/es7.string.pad-end.js | 12 + .../library/modules/es7.string.pad-start.js | 12 + .../library/modules/es7.string.trim-left.js | 7 + .../library/modules/es7.string.trim-right.js | 7 + .../modules/es7.symbol.async-iterator.js | 1 + .../library/modules/es7.symbol.observable.js | 1 + .../library/modules/es7.system.global.js | 4 + .../library/modules/es7.weak-map.from.js | 2 + .../library/modules/es7.weak-map.of.js | 2 + .../library/modules/es7.weak-set.from.js | 2 + .../library/modules/es7.weak-set.of.js | 2 + .../library/modules/web.dom.iterable.js | 19 + .../core-js/library/modules/web.immediate.js | 6 + .../core-js/library/modules/web.timers.js | 20 + node_modules/core-js/library/shim.js | 197 + node_modules/core-js/library/stage/0.js | 10 + node_modules/core-js/library/stage/1.js | 23 + node_modules/core-js/library/stage/2.js | 4 + node_modules/core-js/library/stage/3.js | 4 + node_modules/core-js/library/stage/4.js | 11 + node_modules/core-js/library/stage/index.js | 1 + node_modules/core-js/library/stage/pre.js | 10 + .../core-js/library/web/dom-collections.js | 2 + node_modules/core-js/library/web/immediate.js | 2 + node_modules/core-js/library/web/index.js | 4 + node_modules/core-js/library/web/timers.js | 2 + node_modules/core-js/modules/_a-function.js | 4 + .../core-js/modules/_a-number-value.js | 5 + .../core-js/modules/_add-to-unscopables.js | 7 + node_modules/core-js/modules/_an-instance.js | 5 + node_modules/core-js/modules/_an-object.js | 5 + .../core-js/modules/_array-copy-within.js | 26 + node_modules/core-js/modules/_array-fill.js | 15 + .../core-js/modules/_array-from-iterable.js | 7 + .../core-js/modules/_array-includes.js | 23 + .../core-js/modules/_array-methods.js | 44 + node_modules/core-js/modules/_array-reduce.js | 28 + .../modules/_array-species-constructor.js | 16 + .../core-js/modules/_array-species-create.js | 6 + node_modules/core-js/modules/_bind.js | 25 + node_modules/core-js/modules/_classof.js | 23 + node_modules/core-js/modules/_cof.js | 5 + .../core-js/modules/_collection-strong.js | 144 + .../core-js/modules/_collection-to-json.js | 9 + .../core-js/modules/_collection-weak.js | 85 + node_modules/core-js/modules/_collection.js | 85 + node_modules/core-js/modules/_core.js | 2 + .../core-js/modules/_create-property.js | 8 + node_modules/core-js/modules/_ctx.js | 20 + .../core-js/modules/_date-to-iso-string.js | 26 + .../core-js/modules/_date-to-primitive.js | 9 + node_modules/core-js/modules/_defined.js | 5 + node_modules/core-js/modules/_descriptors.js | 4 + node_modules/core-js/modules/_dom-create.js | 7 + .../core-js/modules/_entry-virtual.js | 5 + .../core-js/modules/_enum-bug-keys.js | 4 + node_modules/core-js/modules/_enum-keys.js | 15 + node_modules/core-js/modules/_export.js | 43 + .../core-js/modules/_fails-is-regexp.js | 12 + node_modules/core-js/modules/_fails.js | 7 + node_modules/core-js/modules/_fix-re-wks.js | 28 + node_modules/core-js/modules/_flags.js | 13 + .../core-js/modules/_flatten-into-array.js | 39 + node_modules/core-js/modules/_for-of.js | 25 + node_modules/core-js/modules/_global.js | 6 + node_modules/core-js/modules/_has.js | 4 + node_modules/core-js/modules/_hide.js | 8 + node_modules/core-js/modules/_html.js | 2 + .../core-js/modules/_ie8-dom-define.js | 3 + .../core-js/modules/_inherit-if-required.js | 9 + node_modules/core-js/modules/_invoke.js | 16 + node_modules/core-js/modules/_iobject.js | 6 + .../core-js/modules/_is-array-iter.js | 8 + node_modules/core-js/modules/_is-array.js | 5 + node_modules/core-js/modules/_is-integer.js | 6 + node_modules/core-js/modules/_is-object.js | 3 + node_modules/core-js/modules/_is-regexp.js | 8 + node_modules/core-js/modules/_iter-call.js | 12 + node_modules/core-js/modules/_iter-create.js | 13 + node_modules/core-js/modules/_iter-define.js | 69 + node_modules/core-js/modules/_iter-detect.js | 22 + node_modules/core-js/modules/_iter-step.js | 3 + node_modules/core-js/modules/_iterators.js | 1 + node_modules/core-js/modules/_keyof.js | 10 + node_modules/core-js/modules/_library.js | 1 + node_modules/core-js/modules/_math-expm1.js | 10 + node_modules/core-js/modules/_math-fround.js | 23 + node_modules/core-js/modules/_math-log1p.js | 4 + node_modules/core-js/modules/_math-scale.js | 18 + node_modules/core-js/modules/_math-sign.js | 5 + node_modules/core-js/modules/_meta.js | 53 + node_modules/core-js/modules/_metadata.js | 51 + node_modules/core-js/modules/_microtask.js | 69 + .../modules/_new-promise-capability.js | 18 + .../core-js/modules/_object-assign.js | 34 + .../core-js/modules/_object-create.js | 41 + .../core-js/modules/_object-define.js | 13 + node_modules/core-js/modules/_object-dp.js | 16 + node_modules/core-js/modules/_object-dps.js | 13 + .../core-js/modules/_object-forced-pam.js | 9 + node_modules/core-js/modules/_object-gopd.js | 16 + .../core-js/modules/_object-gopn-ext.js | 19 + node_modules/core-js/modules/_object-gopn.js | 7 + node_modules/core-js/modules/_object-gops.js | 1 + node_modules/core-js/modules/_object-gpo.js | 13 + .../core-js/modules/_object-keys-internal.js | 17 + node_modules/core-js/modules/_object-keys.js | 7 + node_modules/core-js/modules/_object-pie.js | 1 + node_modules/core-js/modules/_object-sap.js | 10 + .../core-js/modules/_object-to-array.js | 16 + node_modules/core-js/modules/_own-keys.js | 10 + node_modules/core-js/modules/_parse-float.js | 8 + node_modules/core-js/modules/_parse-int.js | 9 + node_modules/core-js/modules/_partial.js | 25 + node_modules/core-js/modules/_path.js | 1 + node_modules/core-js/modules/_perform.js | 7 + .../core-js/modules/_promise-resolve.js | 12 + .../core-js/modules/_property-desc.js | 8 + node_modules/core-js/modules/_redefine-all.js | 5 + node_modules/core-js/modules/_redefine.js | 31 + node_modules/core-js/modules/_replacer.js | 8 + node_modules/core-js/modules/_same-value.js | 5 + .../core-js/modules/_set-collection-from.js | 28 + .../core-js/modules/_set-collection-of.js | 12 + node_modules/core-js/modules/_set-proto.js | 25 + node_modules/core-js/modules/_set-species.js | 13 + .../core-js/modules/_set-to-string-tag.js | 7 + node_modules/core-js/modules/_shared-key.js | 5 + node_modules/core-js/modules/_shared.js | 12 + .../core-js/modules/_species-constructor.js | 9 + .../core-js/modules/_strict-method.js | 9 + node_modules/core-js/modules/_string-at.js | 17 + .../core-js/modules/_string-context.js | 8 + node_modules/core-js/modules/_string-html.js | 19 + node_modules/core-js/modules/_string-pad.js | 16 + .../core-js/modules/_string-repeat.js | 12 + node_modules/core-js/modules/_string-trim.js | 30 + node_modules/core-js/modules/_string-ws.js | 2 + node_modules/core-js/modules/_task.js | 84 + .../core-js/modules/_to-absolute-index.js | 7 + node_modules/core-js/modules/_to-index.js | 10 + node_modules/core-js/modules/_to-integer.js | 6 + node_modules/core-js/modules/_to-iobject.js | 6 + node_modules/core-js/modules/_to-length.js | 6 + node_modules/core-js/modules/_to-object.js | 5 + node_modules/core-js/modules/_to-primitive.js | 12 + node_modules/core-js/modules/_typed-array.js | 480 + node_modules/core-js/modules/_typed-buffer.js | 276 + node_modules/core-js/modules/_typed.js | 28 + node_modules/core-js/modules/_uid.js | 5 + node_modules/core-js/modules/_user-agent.js | 4 + .../core-js/modules/_validate-collection.js | 5 + node_modules/core-js/modules/_wks-define.js | 9 + node_modules/core-js/modules/_wks-ext.js | 1 + node_modules/core-js/modules/_wks.js | 11 + node_modules/core-js/modules/core.delay.js | 12 + node_modules/core-js/modules/core.dict.js | 157 + .../core-js/modules/core.function.part.js | 7 + .../modules/core.get-iterator-method.js | 8 + .../core-js/modules/core.get-iterator.js | 7 + .../core-js/modules/core.is-iterable.js | 10 + .../core-js/modules/core.number.iterator.js | 9 + .../core-js/modules/core.object.classof.js | 3 + .../core-js/modules/core.object.define.js | 4 + .../core-js/modules/core.object.is-object.js | 3 + .../core-js/modules/core.object.make.js | 9 + .../core-js/modules/core.regexp.escape.js | 5 + .../modules/core.string.escape-html.js | 11 + .../modules/core.string.unescape-html.js | 11 + node_modules/core-js/modules/es5.js | 35 + .../core-js/modules/es6.array.copy-within.js | 6 + .../core-js/modules/es6.array.every.js | 10 + .../core-js/modules/es6.array.fill.js | 6 + .../core-js/modules/es6.array.filter.js | 10 + .../core-js/modules/es6.array.find-index.js | 14 + .../core-js/modules/es6.array.find.js | 14 + .../core-js/modules/es6.array.for-each.js | 11 + .../core-js/modules/es6.array.from.js | 37 + .../core-js/modules/es6.array.index-of.js | 15 + .../core-js/modules/es6.array.is-array.js | 4 + .../core-js/modules/es6.array.iterator.js | 34 + .../core-js/modules/es6.array.join.js | 12 + .../modules/es6.array.last-index-of.js | 22 + node_modules/core-js/modules/es6.array.map.js | 10 + node_modules/core-js/modules/es6.array.of.js | 19 + .../core-js/modules/es6.array.reduce-right.js | 10 + .../core-js/modules/es6.array.reduce.js | 10 + .../core-js/modules/es6.array.slice.js | 28 + .../core-js/modules/es6.array.some.js | 10 + .../core-js/modules/es6.array.sort.js | 23 + .../core-js/modules/es6.array.species.js | 1 + node_modules/core-js/modules/es6.date.now.js | 4 + .../core-js/modules/es6.date.to-iso-string.js | 8 + .../core-js/modules/es6.date.to-json.js | 16 + .../core-js/modules/es6.date.to-primitive.js | 4 + .../core-js/modules/es6.date.to-string.js | 12 + .../core-js/modules/es6.function.bind.js | 4 + .../modules/es6.function.has-instance.js | 13 + .../core-js/modules/es6.function.name.js | 16 + node_modules/core-js/modules/es6.map.js | 19 + .../core-js/modules/es6.math.acosh.js | 18 + .../core-js/modules/es6.math.asinh.js | 10 + .../core-js/modules/es6.math.atanh.js | 10 + node_modules/core-js/modules/es6.math.cbrt.js | 9 + .../core-js/modules/es6.math.clz32.js | 8 + node_modules/core-js/modules/es6.math.cosh.js | 9 + .../core-js/modules/es6.math.expm1.js | 5 + .../core-js/modules/es6.math.fround.js | 4 + .../core-js/modules/es6.math.hypot.js | 25 + node_modules/core-js/modules/es6.math.imul.js | 17 + .../core-js/modules/es6.math.log10.js | 8 + .../core-js/modules/es6.math.log1p.js | 4 + node_modules/core-js/modules/es6.math.log2.js | 8 + node_modules/core-js/modules/es6.math.sign.js | 4 + node_modules/core-js/modules/es6.math.sinh.js | 15 + node_modules/core-js/modules/es6.math.tanh.js | 12 + .../core-js/modules/es6.math.trunc.js | 8 + .../core-js/modules/es6.number.constructor.js | 69 + .../core-js/modules/es6.number.epsilon.js | 4 + .../core-js/modules/es6.number.is-finite.js | 9 + .../core-js/modules/es6.number.is-integer.js | 4 + .../core-js/modules/es6.number.is-nan.js | 9 + .../modules/es6.number.is-safe-integer.js | 10 + .../modules/es6.number.max-safe-integer.js | 4 + .../modules/es6.number.min-safe-integer.js | 4 + .../core-js/modules/es6.number.parse-float.js | 4 + .../core-js/modules/es6.number.parse-int.js | 4 + .../core-js/modules/es6.number.to-fixed.js | 114 + .../modules/es6.number.to-precision.js | 18 + .../core-js/modules/es6.object.assign.js | 4 + .../core-js/modules/es6.object.create.js | 3 + .../modules/es6.object.define-properties.js | 3 + .../modules/es6.object.define-property.js | 3 + .../core-js/modules/es6.object.freeze.js | 9 + .../es6.object.get-own-property-descriptor.js | 9 + .../es6.object.get-own-property-names.js | 4 + .../modules/es6.object.get-prototype-of.js | 9 + .../modules/es6.object.is-extensible.js | 8 + .../core-js/modules/es6.object.is-frozen.js | 8 + .../core-js/modules/es6.object.is-sealed.js | 8 + node_modules/core-js/modules/es6.object.is.js | 3 + .../core-js/modules/es6.object.keys.js | 9 + .../modules/es6.object.prevent-extensions.js | 9 + .../core-js/modules/es6.object.seal.js | 9 + .../modules/es6.object.set-prototype-of.js | 3 + .../core-js/modules/es6.object.to-string.js | 10 + .../core-js/modules/es6.parse-float.js | 4 + node_modules/core-js/modules/es6.parse-int.js | 4 + node_modules/core-js/modules/es6.promise.js | 286 + .../core-js/modules/es6.reflect.apply.js | 16 + .../core-js/modules/es6.reflect.construct.js | 47 + .../modules/es6.reflect.define-property.js | 23 + .../modules/es6.reflect.delete-property.js | 11 + .../core-js/modules/es6.reflect.enumerate.js | 26 + ...es6.reflect.get-own-property-descriptor.js | 10 + .../modules/es6.reflect.get-prototype-of.js | 10 + .../core-js/modules/es6.reflect.get.js | 21 + .../core-js/modules/es6.reflect.has.js | 8 + .../modules/es6.reflect.is-extensible.js | 11 + .../core-js/modules/es6.reflect.own-keys.js | 4 + .../modules/es6.reflect.prevent-extensions.js | 16 + .../modules/es6.reflect.set-prototype-of.js | 15 + .../core-js/modules/es6.reflect.set.js | 33 + .../core-js/modules/es6.regexp.constructor.js | 43 + .../core-js/modules/es6.regexp.flags.js | 5 + .../core-js/modules/es6.regexp.match.js | 10 + .../core-js/modules/es6.regexp.replace.js | 12 + .../core-js/modules/es6.regexp.search.js | 10 + .../core-js/modules/es6.regexp.split.js | 71 + .../core-js/modules/es6.regexp.to-string.js | 25 + node_modules/core-js/modules/es6.set.js | 14 + .../core-js/modules/es6.string.anchor.js | 7 + .../core-js/modules/es6.string.big.js | 7 + .../core-js/modules/es6.string.blink.js | 7 + .../core-js/modules/es6.string.bold.js | 7 + .../modules/es6.string.code-point-at.js | 9 + .../core-js/modules/es6.string.ends-with.js | 20 + .../core-js/modules/es6.string.fixed.js | 7 + .../core-js/modules/es6.string.fontcolor.js | 7 + .../core-js/modules/es6.string.fontsize.js | 7 + .../modules/es6.string.from-code-point.js | 23 + .../core-js/modules/es6.string.includes.js | 12 + .../core-js/modules/es6.string.italics.js | 7 + .../core-js/modules/es6.string.iterator.js | 17 + .../core-js/modules/es6.string.link.js | 7 + .../core-js/modules/es6.string.raw.js | 18 + .../core-js/modules/es6.string.repeat.js | 6 + .../core-js/modules/es6.string.small.js | 7 + .../core-js/modules/es6.string.starts-with.js | 18 + .../core-js/modules/es6.string.strike.js | 7 + .../core-js/modules/es6.string.sub.js | 7 + .../core-js/modules/es6.string.sup.js | 7 + .../core-js/modules/es6.string.trim.js | 7 + node_modules/core-js/modules/es6.symbol.js | 234 + .../core-js/modules/es6.typed.array-buffer.js | 46 + .../core-js/modules/es6.typed.data-view.js | 4 + .../modules/es6.typed.float32-array.js | 5 + .../modules/es6.typed.float64-array.js | 5 + .../core-js/modules/es6.typed.int16-array.js | 5 + .../core-js/modules/es6.typed.int32-array.js | 5 + .../core-js/modules/es6.typed.int8-array.js | 5 + .../core-js/modules/es6.typed.uint16-array.js | 5 + .../core-js/modules/es6.typed.uint32-array.js | 5 + .../core-js/modules/es6.typed.uint8-array.js | 5 + .../modules/es6.typed.uint8-clamped-array.js | 5 + node_modules/core-js/modules/es6.weak-map.js | 59 + node_modules/core-js/modules/es6.weak-set.js | 14 + .../core-js/modules/es7.array.flat-map.js | 22 + .../core-js/modules/es7.array.flatten.js | 21 + .../core-js/modules/es7.array.includes.js | 12 + node_modules/core-js/modules/es7.asap.js | 12 + .../core-js/modules/es7.error.is-error.js | 9 + node_modules/core-js/modules/es7.global.js | 4 + node_modules/core-js/modules/es7.map.from.js | 2 + node_modules/core-js/modules/es7.map.of.js | 2 + .../core-js/modules/es7.map.to-json.js | 4 + .../core-js/modules/es7.math.clamp.js | 8 + .../core-js/modules/es7.math.deg-per-rad.js | 4 + .../core-js/modules/es7.math.degrees.js | 9 + .../core-js/modules/es7.math.fscale.js | 10 + .../core-js/modules/es7.math.iaddh.js | 11 + .../core-js/modules/es7.math.imulh.js | 16 + .../core-js/modules/es7.math.isubh.js | 11 + .../core-js/modules/es7.math.rad-per-deg.js | 4 + .../core-js/modules/es7.math.radians.js | 9 + .../core-js/modules/es7.math.scale.js | 4 + .../core-js/modules/es7.math.signbit.js | 7 + .../core-js/modules/es7.math.umulh.js | 16 + .../modules/es7.object.define-getter.js | 12 + .../modules/es7.object.define-setter.js | 12 + .../core-js/modules/es7.object.entries.js | 9 + ...es7.object.get-own-property-descriptors.js | 22 + .../modules/es7.object.lookup-getter.js | 18 + .../modules/es7.object.lookup-setter.js | 18 + .../core-js/modules/es7.object.values.js | 9 + .../core-js/modules/es7.observable.js | 199 + .../core-js/modules/es7.promise.finally.js | 20 + .../core-js/modules/es7.promise.try.js | 12 + .../modules/es7.reflect.define-metadata.js | 8 + .../modules/es7.reflect.delete-metadata.js | 15 + .../modules/es7.reflect.get-metadata-keys.js | 19 + .../modules/es7.reflect.get-metadata.js | 17 + .../es7.reflect.get-own-metadata-keys.js | 8 + .../modules/es7.reflect.get-own-metadata.js | 9 + .../modules/es7.reflect.has-metadata.js | 16 + .../modules/es7.reflect.has-own-metadata.js | 9 + .../core-js/modules/es7.reflect.metadata.js | 15 + node_modules/core-js/modules/es7.set.from.js | 2 + node_modules/core-js/modules/es7.set.of.js | 2 + .../core-js/modules/es7.set.to-json.js | 4 + node_modules/core-js/modules/es7.string.at.js | 10 + .../core-js/modules/es7.string.match-all.js | 30 + .../core-js/modules/es7.string.pad-end.js | 12 + .../core-js/modules/es7.string.pad-start.js | 12 + .../core-js/modules/es7.string.trim-left.js | 7 + .../core-js/modules/es7.string.trim-right.js | 7 + .../modules/es7.symbol.async-iterator.js | 1 + .../core-js/modules/es7.symbol.observable.js | 1 + .../core-js/modules/es7.system.global.js | 4 + .../core-js/modules/es7.weak-map.from.js | 2 + .../core-js/modules/es7.weak-map.of.js | 2 + .../core-js/modules/es7.weak-set.from.js | 2 + .../core-js/modules/es7.weak-set.of.js | 2 + .../modules/library/_add-to-unscopables.js | 1 + .../core-js/modules/library/_collection.js | 59 + .../core-js/modules/library/_export.js | 62 + .../core-js/modules/library/_library.js | 1 + node_modules/core-js/modules/library/_path.js | 1 + .../core-js/modules/library/_redefine-all.js | 7 + .../core-js/modules/library/_redefine.js | 1 + .../core-js/modules/library/_set-species.js | 14 + .../modules/library/es6.date.to-json.js | 19 + .../modules/library/es6.date.to-primitive.js | 0 .../modules/library/es6.date.to-string.js | 0 .../modules/library/es6.function.name.js | 0 .../modules/library/es6.number.constructor.js | 0 .../modules/library/es6.object.to-string.js | 0 .../modules/library/es6.regexp.constructor.js | 1 + .../modules/library/es6.regexp.flags.js | 0 .../modules/library/es6.regexp.match.js | 0 .../modules/library/es6.regexp.replace.js | 0 .../modules/library/es6.regexp.search.js | 0 .../modules/library/es6.regexp.split.js | 0 .../modules/library/es6.regexp.to-string.js | 0 .../modules/library/web.dom.iterable.js | 19 + .../core-js/modules/web.dom.iterable.js | 58 + node_modules/core-js/modules/web.immediate.js | 6 + node_modules/core-js/modules/web.timers.js | 20 + node_modules/core-js/package.json | 101 + node_modules/core-js/shim.js | 197 + node_modules/core-js/stage/0.js | 10 + node_modules/core-js/stage/1.js | 23 + node_modules/core-js/stage/2.js | 4 + node_modules/core-js/stage/3.js | 4 + node_modules/core-js/stage/4.js | 11 + node_modules/core-js/stage/index.js | 1 + node_modules/core-js/stage/pre.js | 10 + node_modules/core-js/web/dom-collections.js | 2 + node_modules/core-js/web/immediate.js | 2 + node_modules/core-js/web/index.js | 4 + node_modules/core-js/web/timers.js | 2 + node_modules/core-util-is/LICENSE | 19 + node_modules/core-util-is/README.md | 3 + node_modules/core-util-is/float.patch | 604 + node_modules/core-util-is/lib/util.js | 107 + node_modules/core-util-is/package.json | 64 + node_modules/core-util-is/test.js | 68 + node_modules/create-ecdh/.travis.yml | 7 + node_modules/create-ecdh/LICENSE | 21 + node_modules/create-ecdh/browser.js | 124 + node_modules/create-ecdh/index.js | 3 + node_modules/create-ecdh/package.json | 62 + node_modules/create-ecdh/readme.md | 4 + node_modules/create-hash/.travis.yml | 17 + node_modules/create-hash/LICENSE | 21 + node_modules/create-hash/README.md | 19 + node_modules/create-hash/browser.js | 30 + node_modules/create-hash/index.js | 1 + node_modules/create-hash/md5.js | 5 + node_modules/create-hash/package.json | 70 + node_modules/create-hash/test.js | 41 + node_modules/create-hmac/LICENSE | 21 + node_modules/create-hmac/README.md | 20 + node_modules/create-hmac/browser.js | 62 + node_modules/create-hmac/index.js | 1 + node_modules/create-hmac/legacy.js | 46 + node_modules/create-hmac/package.json | 72 + node_modules/cross-spawn/CHANGELOG.md | 100 + node_modules/cross-spawn/LICENSE | 21 + node_modules/cross-spawn/README.md | 94 + node_modules/cross-spawn/index.js | 39 + node_modules/cross-spawn/lib/enoent.js | 59 + node_modules/cross-spawn/lib/parse.js | 125 + node_modules/cross-spawn/lib/util/escape.js | 45 + .../cross-spawn/lib/util/readShebang.js | 32 + .../cross-spawn/lib/util/resolveCommand.js | 47 + node_modules/cross-spawn/package.json | 107 + node_modules/crypt/LICENSE.mkd | 27 + node_modules/crypt/README.mkd | 1 + node_modules/crypt/crypt.js | 96 + node_modules/crypt/package.json | 52 + node_modules/crypto-browserify/.travis.yml | 27 + node_modules/crypto-browserify/.zuul.yml | 1 + node_modules/crypto-browserify/LICENSE | 24 + node_modules/crypto-browserify/README.md | 50 + .../crypto-browserify/example/bundle.js | 637 + .../crypto-browserify/example/index.html | 12 + .../crypto-browserify/example/test.js | 4 + node_modules/crypto-browserify/index.js | 97 + node_modules/crypto-browserify/package.json | 78 + node_modules/crypto-browserify/test/aes.js | 49 + .../crypto-browserify/test/create-hash.js | 50 + .../crypto-browserify/test/create-hmac.js | 50 + node_modules/crypto-browserify/test/dh.js | 49 + node_modules/crypto-browserify/test/ecdh.js | 61 + node_modules/crypto-browserify/test/index.js | 19 + .../crypto-browserify/test/node/dh.js | 51 + node_modules/crypto-browserify/test/pbkdf2.js | 21 + .../crypto-browserify/test/public-encrypt.js | 36 + .../crypto-browserify/test/random-bytes.js | 60 + .../crypto-browserify/test/random-fill.js | 53 + node_modules/crypto-browserify/test/sign.js | 59 + node_modules/csjs-inject/.npmignore | 2 + node_modules/csjs-inject/LICENSE | 22 + node_modules/csjs-inject/README.md | 3 + node_modules/csjs-inject/csjs.js | 15 + node_modules/csjs-inject/get-css.js | 3 + node_modules/csjs-inject/index.js | 7 + node_modules/csjs-inject/package.json | 55 + node_modules/csjs/.istanbul.yml | 4 + node_modules/csjs/.npmignore | 3 + node_modules/csjs/.travis.yml | 8 + node_modules/csjs/.zuul.yml | 16 + node_modules/csjs/LICENSE | 22 + node_modules/csjs/README.md | 245 + node_modules/csjs/csjs.js | 3 + .../csjs/docs/automatic-vendor-prefixing.md | 10 + node_modules/csjs/docs/comments.md | 37 + node_modules/csjs/docs/keyframe-animations.md | 44 + node_modules/csjs/get-css.js | 3 + node_modules/csjs/index.js | 8 + node_modules/csjs/lib/base62-encode.js | 20 + node_modules/csjs/lib/build-exports.js | 42 + node_modules/csjs/lib/composition.js | 78 + node_modules/csjs/lib/csjs.js | 76 + node_modules/csjs/lib/css-extract-extends.js | 51 + node_modules/csjs/lib/css-key.js | 8 + node_modules/csjs/lib/extract-exports.js | 25 + node_modules/csjs/lib/get-css.js | 7 + node_modules/csjs/lib/hash-string.js | 16 + node_modules/csjs/lib/regex.js | 14 + node_modules/csjs/lib/replace-animations.js | 29 + node_modules/csjs/lib/scoped-name.js | 12 + node_modules/csjs/lib/scopeify.js | 39 + node_modules/csjs/package.json | 73 + .../test/animation-as-pseudo.expected.css | 13 + .../test/animation-as-pseudo.expected.json | 4 + .../animation-as-pseudo.noscope.expected.css | 13 + .../animation-as-pseudo.noscope.expected.json | 4 + .../animation-as-pseudo.noscope.source.js | 16 + .../csjs/test/animation-as-pseudo.source.js | 16 + node_modules/csjs/test/basic.expected.css | 6 + node_modules/csjs/test/basic.expected.json | 3 + .../csjs/test/basic.noscope.expected.css | 6 + .../csjs/test/basic.noscope.expected.json | 3 + .../csjs/test/basic.noscope.source.js | 9 + node_modules/csjs/test/basic.source.js | 9 + node_modules/csjs/test/comments.expected.css | 38 + node_modules/csjs/test/comments.expected.json | 4 + .../csjs/test/comments.noscope.expected.css | 38 + .../csjs/test/comments.noscope.expected.json | 4 + node_modules/csjs/test/comments.source.js | 41 + .../csjs/test/comments.source.noscope.js | 41 + .../csjs/test/dot-in-values.expected.css | 8 + .../csjs/test/dot-in-values.expected.json | 5 + .../test/dot-in-values.noscope.expected.css | 8 + .../test/dot-in-values.noscope.expected.json | 5 + .../csjs/test/dot-in-values.noscope.source.js | 11 + .../csjs/test/dot-in-values.source.js | 11 + .../test/extends-in-media-query.expected.css | 30 + .../test/extends-in-media-query.expected.json | 6 + ...xtends-in-media-query.noscope.expected.css | 30 + ...tends-in-media-query.noscope.expected.json | 6 + .../extends-in-media-query.noscope.source.js | 35 + .../test/extends-in-media-query.source.js | 35 + .../csjs/test/extensions.expected.css | 18 + .../csjs/test/extensions.expected.json | 6 + .../csjs/test/extensions.noscope.expected.css | 18 + .../test/extensions.noscope.expected.json | 6 + .../csjs/test/extensions.noscope.source.js | 21 + node_modules/csjs/test/extensions.source.js | 21 + node_modules/csjs/test/index.js | 84 + .../csjs/test/keyframes-usage.expected.css | 10 + .../csjs/test/keyframes-usage.expected.json | 4 + .../test/keyframes-usage.noscope.expected.css | 10 + .../keyframes-usage.noscope.expected.json | 4 + .../test/keyframes-usage.noscope.source.js | 15 + .../csjs/test/keyframes-usage.source.js | 15 + .../test/keyframes-with-decimal.expected.css | 8 + .../test/keyframes-with-decimal.expected.json | 3 + ...eyframes-with-decimal.noscope.expected.css | 8 + ...yframes-with-decimal.noscope.expected.json | 3 + .../keyframes-with-decimal.noscope.source.js | 11 + .../test/keyframes-with-decimal.source.js | 11 + node_modules/csjs/test/keyframes.expected.css | 20 + .../csjs/test/keyframes.expected.json | 6 + .../csjs/test/keyframes.noscope.expected.css | 20 + .../csjs/test/keyframes.noscope.expected.json | 6 + .../csjs/test/keyframes.noscope.source.js | 23 + node_modules/csjs/test/keyframes.source.js | 23 + .../csjs/test/media-query.expected.css | 12 + .../csjs/test/media-query.expected.json | 3 + .../test/media-query.noscope.expected.css | 12 + .../test/media-query.noscope.expected.json | 3 + .../csjs/test/media-query.noscope.source.js | 15 + node_modules/csjs/test/media-query.source.js | 15 + .../test/multiple-extensions.expected.css | 14 + .../test/multiple-extensions.expected.json | 5 + .../multiple-extensions.noscope.expected.css | 14 + .../multiple-extensions.noscope.expected.json | 5 + .../multiple-extensions.noscope.source.js | 19 + .../csjs/test/multiple-extensions.source.js | 19 + node_modules/csjs/test/non-class.expected.css | 6 + .../csjs/test/non-class.expected.json | 1 + .../csjs/test/non-class.noscope.expected.css | 6 + .../csjs/test/non-class.noscope.expected.json | 1 + .../csjs/test/non-class.noscope.source.js | 9 + node_modules/csjs/test/non-class.source.js | 9 + .../csjs/test/not-pseudo.expected.css | 8 + .../csjs/test/not-pseudo.expected.json | 4 + .../csjs/test/not-pseudo.noscope.expected.css | 8 + .../test/not-pseudo.noscope.expected.json | 4 + .../csjs/test/not-pseudo.noscope.source.js | 11 + node_modules/csjs/test/not-pseudo.source.js | 11 + node_modules/cytoscape/.babelrc | 3 + node_modules/cytoscape/.eslintrc.json | 16 + node_modules/cytoscape/.travis.yml | 9 + node_modules/cytoscape/ISSUE_TEMPLATE.md | 74 + node_modules/cytoscape/LICENSE | 21 + node_modules/cytoscape/README.md | 115 + node_modules/cytoscape/dist/cytoscape.cjs.js | 29144 +++++++++++++++ node_modules/cytoscape/dist/cytoscape.js | 29906 ++++++++++++++++ node_modules/cytoscape/dist/cytoscape.min.js | 10 + node_modules/cytoscape/package.json | 171 + node_modules/cytoscape/src/animation.js | 233 + .../src/collection/algorithms/a-star.js | 206 + .../src/collection/algorithms/bellman-ford.js | 192 + .../algorithms/betweenness-centrality.js | 190 + .../src/collection/algorithms/bfs-dfs.js | 130 + .../algorithms/closeness-centrality.js | 128 + .../algorithms/degree-centrality.js | 194 + .../src/collection/algorithms/dijkstra.js | 129 + .../collection/algorithms/floyd-warshall.js | 192 + .../src/collection/algorithms/index.js | 21 + .../src/collection/algorithms/kerger-stein.js | 170 + .../src/collection/algorithms/kruskal.js | 62 + .../src/collection/algorithms/page-rank.js | 179 + .../cytoscape/src/collection/animation.js | 13 + .../cytoscape/src/collection/class.js | 131 + .../cytoscape/src/collection/comparators.js | 90 + .../cytoscape/src/collection/compounds.js | 214 + node_modules/cytoscape/src/collection/data.js | 85 + .../cytoscape/src/collection/degree.js | 119 + .../src/collection/dimensions/bounds.js | 766 + .../src/collection/dimensions/edge-points.js | 23 + .../src/collection/dimensions/index.js | 7 + .../src/collection/dimensions/position.js | 235 + .../src/collection/dimensions/width-height.js | 106 + .../cytoscape/src/collection/element.js | 105 + .../cytoscape/src/collection/events.js | 142 + .../cytoscape/src/collection/filter.js | 368 + .../cytoscape/src/collection/group.js | 28 + .../cytoscape/src/collection/index.js | 731 + .../cytoscape/src/collection/iteration.js | 124 + .../cytoscape/src/collection/layout.js | 193 + .../cytoscape/src/collection/style.js | 443 + .../src/collection/switch-functions.js | 149 + .../cytoscape/src/collection/traversing.js | 440 + .../cytoscape/src/collection/zsort.js | 57 + node_modules/cytoscape/src/core/add-remove.js | 82 + .../src/core/animation/cubic-bezier.js | 158 + .../cytoscape/src/core/animation/ease.js | 78 + .../cytoscape/src/core/animation/easings.js | 76 + .../cytoscape/src/core/animation/index.js | 60 + .../cytoscape/src/core/animation/spring.js | 88 + .../cytoscape/src/core/animation/start.js | 34 + .../cytoscape/src/core/animation/step-all.js | 133 + .../cytoscape/src/core/animation/step.js | 161 + node_modules/cytoscape/src/core/events.js | 93 + node_modules/cytoscape/src/core/export.js | 23 + node_modules/cytoscape/src/core/index.js | 446 + node_modules/cytoscape/src/core/layout.js | 46 + .../cytoscape/src/core/notification.js | 118 + node_modules/cytoscape/src/core/renderer.js | 79 + node_modules/cytoscape/src/core/search.js | 69 + node_modules/cytoscape/src/core/style.js | 36 + node_modules/cytoscape/src/core/viewport.js | 573 + .../cytoscape/src/define/animation.js | 240 + node_modules/cytoscape/src/define/data.js | 194 + node_modules/cytoscape/src/define/events.js | 34 + node_modules/cytoscape/src/define/index.js | 19 + node_modules/cytoscape/src/emitter.js | 226 + node_modules/cytoscape/src/event.js | 111 + node_modules/cytoscape/src/extension.js | 243 + .../cytoscape/src/extensions/index.js | 11 + .../src/extensions/layout/breadthfirst.js | 439 + .../cytoscape/src/extensions/layout/circle.js | 105 + .../src/extensions/layout/concentric.js | 200 + .../cytoscape/src/extensions/layout/cose.js | 1414 + .../cytoscape/src/extensions/layout/grid.js | 247 + .../cytoscape/src/extensions/layout/index.js | 10 + .../cytoscape/src/extensions/layout/null.js | 50 + .../cytoscape/src/extensions/layout/preset.js | 61 + .../cytoscape/src/extensions/layout/random.js | 43 + .../extensions/renderer/base/arrow-shapes.js | 312 + .../renderer/base/coord-ele-math/coords.js | 400 + .../base/coord-ele-math/edge-arrows.js | 179 + .../coord-ele-math/edge-control-points.js | 815 + .../base/coord-ele-math/edge-endpoints.js | 229 + .../base/coord-ele-math/edge-projection.js | 62 + .../renderer/base/coord-ele-math/index.js | 19 + .../renderer/base/coord-ele-math/labels.js | 499 + .../renderer/base/coord-ele-math/nodes.js | 27 + .../base/coord-ele-math/rendered-style.js | 182 + .../base/coord-ele-math/z-ordering.js | 65 + .../src/extensions/renderer/base/images.js | 36 + .../src/extensions/renderer/base/index.js | 210 + .../renderer/base/load-listeners.js | 2085 ++ .../extensions/renderer/base/node-shapes.js | 560 + .../src/extensions/renderer/base/redraw.js | 101 + .../renderer/canvas/arrow-shapes.js | 89 + .../renderer/canvas/drawing-edges.js | 293 + .../renderer/canvas/drawing-elements.js | 112 + .../renderer/canvas/drawing-images.js | 148 + .../renderer/canvas/drawing-label-text.js | 351 + .../renderer/canvas/drawing-nodes.js | 377 + .../renderer/canvas/drawing-redraw.js | 579 + .../renderer/canvas/drawing-shapes.js | 168 + .../renderer/canvas/ele-texture-cache.js | 500 + .../renderer/canvas/export-image.js | 154 + .../src/extensions/renderer/canvas/index.js | 171 + .../renderer/canvas/layered-texture-cache.js | 686 + .../extensions/renderer/canvas/node-shapes.js | 20 + .../renderer/canvas/texture-cache-defs.js | 85 + .../src/extensions/renderer/index.js | 5 + .../src/extensions/renderer/null/index.js | 14 + node_modules/cytoscape/src/heap.js | 1 + node_modules/cytoscape/src/index.js | 40 + node_modules/cytoscape/src/is.js | 179 + node_modules/cytoscape/src/map.js | 25 + node_modules/cytoscape/src/math.js | 1109 + node_modules/cytoscape/src/promise.js | 211 + .../cytoscape/src/selector/expressions.js | 230 + node_modules/cytoscape/src/selector/index.js | 200 + .../cytoscape/src/selector/matching.js | 310 + .../cytoscape/src/selector/new-query.js | 27 + node_modules/cytoscape/src/selector/parse.js | 128 + node_modules/cytoscape/src/selector/state.js | 139 + node_modules/cytoscape/src/selector/tokens.js | 46 + node_modules/cytoscape/src/set.js | 59 + node_modules/cytoscape/src/style/apply.js | 671 + node_modules/cytoscape/src/style/bypass.js | 174 + node_modules/cytoscape/src/style/container.js | 26 + .../cytoscape/src/style/get-for-ele.js | 119 + node_modules/cytoscape/src/style/index.js | 181 + node_modules/cytoscape/src/style/json.js | 59 + node_modules/cytoscape/src/style/parse.js | 423 + .../cytoscape/src/style/properties.js | 578 + .../cytoscape/src/style/string-sheet.js | 136 + node_modules/cytoscape/src/stylesheet.js | 96 + node_modules/cytoscape/src/test.js | 14 + node_modules/cytoscape/src/util/colors.js | 291 + node_modules/cytoscape/src/util/index.js | 169 + node_modules/cytoscape/src/util/maps.js | 116 + node_modules/cytoscape/src/util/memoize.js | 37 + node_modules/cytoscape/src/util/regex.js | 22 + node_modules/cytoscape/src/util/sort.js | 20 + node_modules/cytoscape/src/util/strings.js | 32 + node_modules/cytoscape/src/util/timing.js | 42 + node_modules/cytoscape/src/version.js | 1 + node_modules/cytoscape/src/version.json | 1 + node_modules/cytoscape/src/window.js | 1 + node_modules/cytoscape/webpack.config.js | 59 + node_modules/date-now/.npmignore | 14 + node_modules/date-now/.testem.json | 14 + node_modules/date-now/.travis.yml | 4 + node_modules/date-now/LICENCE | 19 + node_modules/date-now/README.md | 45 + node_modules/date-now/index.js | 5 + node_modules/date-now/package.json | 94 + node_modules/date-now/seed.js | 16 + node_modules/date-now/test/index.js | 28 + node_modules/date-now/test/static/index.html | 10 + node_modules/debounce/History.md | 50 + node_modules/debounce/Makefile | 11 + node_modules/debounce/Readme.md | 69 + node_modules/debounce/component.json | 18 + node_modules/debounce/index.js | 70 + node_modules/debounce/package.json | 59 + node_modules/debounce/test.html | 32 + node_modules/debounce/test.js | 170 + node_modules/debug/.coveralls.yml | 1 + node_modules/debug/.eslintrc | 11 + node_modules/debug/.npmignore | 9 + node_modules/debug/.travis.yml | 14 + node_modules/debug/CHANGELOG.md | 362 + node_modules/debug/LICENSE | 19 + node_modules/debug/Makefile | 50 + node_modules/debug/README.md | 312 + node_modules/debug/component.json | 19 + node_modules/debug/karma.conf.js | 70 + node_modules/debug/node.js | 1 + node_modules/debug/package.json | 91 + node_modules/debug/src/browser.js | 185 + node_modules/debug/src/debug.js | 202 + node_modules/debug/src/index.js | 10 + node_modules/debug/src/inspector-log.js | 15 + node_modules/debug/src/node.js | 248 + node_modules/decode-uri-component/index.js | 94 + node_modules/decode-uri-component/license | 21 + .../decode-uri-component/package.json | 69 + node_modules/decode-uri-component/readme.md | 70 + node_modules/default-gateway/LICENSE | 22 + node_modules/default-gateway/README.md | 50 + node_modules/default-gateway/android.js | 46 + node_modules/default-gateway/darwin.js | 48 + node_modules/default-gateway/freebsd.js | 48 + node_modules/default-gateway/index.js | 25 + node_modules/default-gateway/linux.js | 58 + node_modules/default-gateway/openbsd.js | 48 + node_modules/default-gateway/package.json | 85 + node_modules/default-gateway/sunos.js | 48 + node_modules/default-gateway/win32.js | 67 + node_modules/define-property/CHANGELOG.md | 82 + node_modules/define-property/LICENSE | 21 + node_modules/define-property/README.md | 117 + node_modules/define-property/index.js | 38 + .../is-accessor-descriptor/LICENSE | 21 + .../is-accessor-descriptor/README.md | 144 + .../is-accessor-descriptor/index.js | 69 + .../is-accessor-descriptor/package.json | 110 + .../node_modules/is-data-descriptor/LICENSE | 21 + .../node_modules/is-data-descriptor/README.md | 161 + .../node_modules/is-data-descriptor/index.js | 49 + .../is-data-descriptor/package.json | 109 + .../node_modules/is-descriptor/LICENSE | 21 + .../node_modules/is-descriptor/README.md | 193 + .../node_modules/is-descriptor/index.js | 22 + .../node_modules/is-descriptor/package.json | 114 + .../node_modules/isobject/LICENSE | 21 + .../node_modules/isobject/README.md | 122 + .../node_modules/isobject/index.d.ts | 5 + .../node_modules/isobject/index.js | 12 + .../node_modules/isobject/package.json | 119 + .../node_modules/kind-of/CHANGELOG.md | 157 + .../node_modules/kind-of/LICENSE | 21 + .../node_modules/kind-of/README.md | 365 + .../node_modules/kind-of/index.js | 129 + .../node_modules/kind-of/package.json | 145 + node_modules/define-property/package.json | 106 + node_modules/defined/.travis.yml | 4 + node_modules/defined/LICENSE | 18 + node_modules/defined/example/defined.js | 4 + node_modules/defined/index.js | 5 + node_modules/defined/package.json | 94 + node_modules/defined/readme.markdown | 53 + node_modules/defined/test/def.js | 22 + node_modules/defined/test/falsy.js | 9 + node_modules/depd/History.md | 96 + node_modules/depd/LICENSE | 22 + node_modules/depd/Readme.md | 280 + node_modules/depd/index.js | 522 + node_modules/depd/lib/browser/index.js | 77 + .../depd/lib/compat/callsite-tostring.js | 103 + .../depd/lib/compat/event-listener-count.js | 22 + node_modules/depd/lib/compat/index.js | 79 + node_modules/depd/package.json | 77 + node_modules/deps-sort/.travis.yml | 5 + node_modules/deps-sort/LICENSE | 18 + node_modules/deps-sort/bin/cmd.js | 10 + node_modules/deps-sort/example/sort.js | 6 + node_modules/deps-sort/index.js | 122 + node_modules/deps-sort/package.json | 70 + node_modules/deps-sort/readme.markdown | 83 + .../deps-sort/test/dedupe-deps-of-deps.js | 71 + node_modules/deps-sort/test/dedupe.js | 39 + node_modules/deps-sort/test/dedupe_index.js | 56 + node_modules/deps-sort/test/dedupe_undef.js | 37 + node_modules/deps-sort/test/expose.js | 38 + node_modules/deps-sort/test/expose_str.js | 44 + node_modules/deps-sort/test/indexed.js | 38 + node_modules/deps-sort/test/sort.js | 23 + node_modules/des.js/.jscsrc | 46 + node_modules/des.js/.jshintrc | 89 + node_modules/des.js/.npmignore | 2 + node_modules/des.js/README.md | 26 + node_modules/des.js/lib/des.js | 7 + node_modules/des.js/lib/des/cbc.js | 65 + node_modules/des.js/lib/des/cipher.js | 141 + node_modules/des.js/lib/des/des.js | 143 + node_modules/des.js/lib/des/ede.js | 55 + node_modules/des.js/lib/des/utils.js | 256 + node_modules/des.js/package.json | 62 + node_modules/des.js/test/cbc-test.js | 73 + node_modules/des.js/test/des-test.js | 139 + node_modules/des.js/test/ede-test.js | 73 + node_modules/des.js/test/fixtures.js | 5 + node_modules/des.js/test/utils-test.js | 169 + node_modules/destroy/LICENSE | 22 + node_modules/destroy/README.md | 60 + node_modules/destroy/index.js | 75 + node_modules/destroy/package.json | 71 + node_modules/detective/.travis.yml | 15 + node_modules/detective/CHANGELOG.md | 17 + node_modules/detective/LICENSE | 18 + node_modules/detective/bench/detect.js | 7 + .../detective/bench/esprima_v_acorn.txt | 18 + node_modules/detective/bin/detective.js | 11 + node_modules/detective/example/strings.js | 6 + node_modules/detective/example/strings_src.js | 3 + node_modules/detective/index.js | 80 + node_modules/detective/package.json | 68 + node_modules/detective/readme.markdown | 81 + node_modules/detective/test/both.js | 26 + node_modules/detective/test/chained.js | 9 + node_modules/detective/test/complicated.js | 58 + node_modules/detective/test/es6-module.js | 9 + node_modules/detective/test/files/both.js | 4 + node_modules/detective/test/files/chained.js | 5 + .../detective/test/files/es6-module.js | 5 + .../detective/test/files/generators.js | 5 + .../detective/test/files/isrequire.js | 14 + node_modules/detective/test/files/nested.js | 22 + .../detective/test/files/rest-spread.js | 9 + .../test/files/set-in-object-pattern.js | 10 + node_modules/detective/test/files/shebang.js | 5 + .../detective/test/files/sparse-array.js | 3 + node_modules/detective/test/files/strings.js | 13 + node_modules/detective/test/files/word.js | 13 + node_modules/detective/test/files/yield.js | 4 + node_modules/detective/test/generators.js | 9 + node_modules/detective/test/isrequire.js | 20 + node_modules/detective/test/nested.js | 9 + node_modules/detective/test/noargs.js | 26 + node_modules/detective/test/parseopts.js | 62 + node_modules/detective/test/rest-spread.js | 9 + node_modules/detective/test/return.js | 9 + .../detective/test/set-in-object-pattern.js | 12 + node_modules/detective/test/shebang.js | 9 + node_modules/detective/test/sparse-array.js | 14 + node_modules/detective/test/strings.js | 9 + node_modules/detective/test/word.js | 12 + node_modules/detective/test/yield.js | 9 + node_modules/diffie-hellman/.travis.yml | 10 + node_modules/diffie-hellman/LICENSE | 19 + node_modules/diffie-hellman/browser.js | 42 + node_modules/diffie-hellman/index.js | 10 + node_modules/diffie-hellman/lib/dh.js | 164 + .../diffie-hellman/lib/generatePrime.js | 105 + node_modules/diffie-hellman/lib/primes.json | 34 + node_modules/diffie-hellman/package.json | 62 + node_modules/diffie-hellman/readme.md | 4 + node_modules/domain-browser/HISTORY.md | 46 + node_modules/domain-browser/LICENSE.md | 23 + node_modules/domain-browser/README.md | 121 + node_modules/domain-browser/package.json | 172 + node_modules/domain-browser/source/index.js | 70 + node_modules/duplexer2/LICENSE.md | 26 + node_modules/duplexer2/README.md | 115 + node_modules/duplexer2/index.js | 76 + node_modules/duplexer2/package.json | 66 + node_modules/ee-first/LICENSE | 22 + node_modules/ee-first/README.md | 80 + node_modules/ee-first/index.js | 95 + node_modules/ee-first/package.json | 63 + node_modules/elliptic/README.md | 238 + node_modules/elliptic/lib/elliptic.js | 13 + .../elliptic/lib/elliptic/curve/base.js | 375 + .../elliptic/lib/elliptic/curve/edwards.js | 433 + .../elliptic/lib/elliptic/curve/index.js | 8 + .../elliptic/lib/elliptic/curve/mont.js | 180 + .../elliptic/lib/elliptic/curve/short.js | 937 + node_modules/elliptic/lib/elliptic/curves.js | 205 + .../elliptic/lib/elliptic/ec/index.js | 240 + node_modules/elliptic/lib/elliptic/ec/key.js | 119 + .../elliptic/lib/elliptic/ec/signature.js | 135 + .../elliptic/lib/elliptic/eddsa/index.js | 118 + .../elliptic/lib/elliptic/eddsa/key.js | 96 + .../elliptic/lib/elliptic/eddsa/signature.js | 66 + .../lib/elliptic/precomputed/secp256k1.js | 780 + node_modules/elliptic/lib/elliptic/utils.js | 120 + node_modules/elliptic/package.json | 87 + node_modules/encodeurl/HISTORY.md | 14 + node_modules/encodeurl/LICENSE | 22 + node_modules/encodeurl/README.md | 128 + node_modules/encodeurl/index.js | 60 + node_modules/encodeurl/package.json | 76 + node_modules/es6-promisify/LICENSE | 19 + node_modules/es6-promisify/README.md | 93 + node_modules/es6-promisify/dist/promisify.js | 84 + node_modules/es6-promisify/package.json | 73 + node_modules/escape-html/LICENSE | 24 + node_modules/escape-html/Readme.md | 43 + node_modules/escape-html/index.js | 78 + node_modules/escape-html/package.json | 58 + node_modules/escape-string-regexp/index.js | 11 + node_modules/escape-string-regexp/license | 21 + .../escape-string-regexp/package.json | 81 + node_modules/escape-string-regexp/readme.md | 27 + node_modules/etag/HISTORY.md | 83 + node_modules/etag/LICENSE | 22 + node_modules/etag/README.md | 159 + node_modules/etag/index.js | 131 + node_modules/etag/package.json | 85 + node_modules/events/.npmignore | 1 + node_modules/events/.travis.yml | 8 + node_modules/events/.zuul.yml | 12 + node_modules/events/History.md | 42 + node_modules/events/LICENSE | 22 + node_modules/events/Readme.md | 19 + node_modules/events/events.js | 302 + node_modules/events/package.json | 64 + node_modules/events/tests/add-listeners.js | 63 + .../events/tests/check-listener-leaks.js | 86 + node_modules/events/tests/common.js | 42 + node_modules/events/tests/index.js | 25 + node_modules/events/tests/legacy-compat.js | 18 + node_modules/events/tests/listener-count.js | 36 + .../events/tests/listeners-side-effects.js | 55 + node_modules/events/tests/listeners.js | 51 + node_modules/events/tests/max-listeners.js | 50 + node_modules/events/tests/modify-in-emit.js | 76 + node_modules/events/tests/num-args.js | 44 + node_modules/events/tests/once.js | 59 + .../events/tests/remove-all-listeners.js | 80 + node_modules/events/tests/remove-listeners.js | 84 + .../tests/set-max-listeners-side-effects.js | 29 + node_modules/events/tests/subclass.js | 51 + node_modules/evp_bytestokey/LICENSE | 21 + node_modules/evp_bytestokey/README.md | 51 + node_modules/evp_bytestokey/index.js | 45 + node_modules/evp_bytestokey/package.json | 78 + node_modules/execa/index.js | 366 + node_modules/execa/lib/errname.js | 39 + node_modules/execa/lib/stdio.js | 41 + node_modules/execa/license | 9 + node_modules/execa/package.json | 108 + node_modules/execa/readme.md | 304 + node_modules/expand-brackets/LICENSE | 21 + node_modules/expand-brackets/README.md | 107 + node_modules/expand-brackets/index.js | 163 + node_modules/expand-brackets/package.json | 93 + node_modules/expand-range/LICENSE | 24 + node_modules/expand-range/README.md | 145 + node_modules/expand-range/index.js | 43 + node_modules/expand-range/package.json | 104 + node_modules/extend-shallow/LICENSE | 21 + node_modules/extend-shallow/README.md | 97 + node_modules/extend-shallow/index.js | 60 + .../node_modules/is-extendable/LICENSE | 21 + .../node_modules/is-extendable/README.md | 88 + .../node_modules/is-extendable/index.d.ts | 5 + .../node_modules/is-extendable/index.js | 14 + .../node_modules/is-extendable/package.json | 98 + node_modules/extend-shallow/package.json | 126 + node_modules/extglob/LICENSE | 21 + node_modules/extglob/README.md | 88 + node_modules/extglob/index.js | 178 + node_modules/extglob/package.json | 85 + node_modules/filename-regex/LICENSE | 21 + node_modules/filename-regex/README.md | 63 + node_modules/filename-regex/index.js | 10 + node_modules/filename-regex/package.json | 81 + node_modules/fill-range/LICENSE | 21 + node_modules/fill-range/README.md | 317 + node_modules/fill-range/index.js | 408 + node_modules/fill-range/package.json | 109 + node_modules/for-in/LICENSE | 21 + node_modules/for-in/README.md | 85 + node_modules/for-in/index.js | 16 + node_modules/for-in/package.json | 107 + node_modules/for-own/LICENSE | 21 + node_modules/for-own/README.md | 85 + node_modules/for-own/index.js | 19 + node_modules/for-own/package.json | 109 + node_modules/fragment-cache/LICENSE | 21 + node_modules/fragment-cache/README.md | 156 + node_modules/fragment-cache/index.js | 128 + node_modules/fragment-cache/package.json | 93 + node_modules/fresh/HISTORY.md | 70 + node_modules/fresh/LICENSE | 23 + node_modules/fresh/README.md | 119 + node_modules/fresh/index.js | 137 + node_modules/fresh/package.json | 89 + node_modules/from2-string/LICENSE | 21 + node_modules/from2-string/README.md | 44 + node_modules/from2-string/index.js | 19 + node_modules/from2-string/package.json | 68 + node_modules/from2/.travis.yml | 8 + node_modules/from2/LICENSE.md | 21 + node_modules/from2/README.md | 70 + node_modules/from2/index.js | 103 + node_modules/from2/package.json | 69 + node_modules/from2/test.js | 123 + node_modules/fs.realpath/LICENSE | 43 + node_modules/fs.realpath/README.md | 33 + node_modules/fs.realpath/index.js | 66 + node_modules/fs.realpath/old.js | 303 + node_modules/fs.realpath/package.json | 59 + node_modules/function-bind/.editorconfig | 20 + node_modules/function-bind/.eslintrc | 15 + node_modules/function-bind/.jscs.json | 176 + node_modules/function-bind/.npmignore | 22 + node_modules/function-bind/.travis.yml | 168 + node_modules/function-bind/LICENSE | 20 + node_modules/function-bind/README.md | 48 + node_modules/function-bind/implementation.js | 52 + node_modules/function-bind/index.js | 5 + node_modules/function-bind/package.json | 94 + node_modules/function-bind/test/.eslintrc | 9 + node_modules/function-bind/test/index.js | 252 + node_modules/garnish/LICENSE.md | 21 + node_modules/garnish/README.md | 119 + node_modules/garnish/bin/cmd.js | 15 + node_modules/garnish/index.js | 59 + node_modules/garnish/lib/levels.js | 34 + node_modules/garnish/lib/renderer.js | 192 + node_modules/garnish/package.json | 86 + .../get-assigned-identifiers/.travis.yml | 8 + .../get-assigned-identifiers/CHANGELOG.md | 17 + .../get-assigned-identifiers/LICENSE.md | 15 + .../get-assigned-identifiers/README.md | 45 + .../get-assigned-identifiers/index.js | 57 + .../get-assigned-identifiers/package.json | 61 + .../get-assigned-identifiers/test/index.js | 122 + node_modules/get-ports/LICENSE.md | 21 + node_modules/get-ports/README.md | 48 + node_modules/get-ports/index.js | 50 + node_modules/get-ports/package.json | 68 + node_modules/get-stream/buffer-stream.js | 51 + node_modules/get-stream/index.js | 51 + node_modules/get-stream/license | 21 + node_modules/get-stream/package.json | 80 + node_modules/get-stream/readme.md | 117 + node_modules/get-value/LICENSE | 21 + node_modules/get-value/index.js | 50 + node_modules/get-value/package.json | 113 + node_modules/glob-base/LICENSE | 21 + node_modules/glob-base/README.md | 158 + node_modules/glob-base/index.js | 51 + node_modules/glob-base/package.json | 77 + node_modules/glob-parent/.npmignore | 4 + node_modules/glob-parent/.travis.yml | 8 + node_modules/glob-parent/LICENSE | 15 + node_modules/glob-parent/README.md | 43 + node_modules/glob-parent/index.js | 10 + node_modules/glob-parent/package.json | 63 + node_modules/glob-parent/test.js | 28 + node_modules/glob/LICENSE | 15 + node_modules/glob/README.md | 368 + node_modules/glob/changelog.md | 67 + node_modules/glob/common.js | 240 + node_modules/glob/glob.js | 790 + node_modules/glob/package.json | 76 + node_modules/glob/sync.js | 486 + node_modules/graceful-fs/LICENSE | 15 + node_modules/graceful-fs/README.md | 133 + node_modules/graceful-fs/fs.js | 21 + node_modules/graceful-fs/graceful-fs.js | 262 + node_modules/graceful-fs/legacy-streams.js | 118 + node_modules/graceful-fs/package.json | 76 + node_modules/graceful-fs/polyfills.js | 330 + node_modules/has-ansi/cli.js | 53 + node_modules/has-ansi/index.js | 4 + node_modules/has-ansi/package.json | 89 + node_modules/has-ansi/readme.md | 45 + node_modules/has-value/LICENSE | 21 + node_modules/has-value/README.md | 149 + node_modules/has-value/index.js | 16 + .../has-value/node_modules/isobject/LICENSE | 21 + .../has-value/node_modules/isobject/README.md | 122 + .../node_modules/isobject/index.d.ts | 5 + .../has-value/node_modules/isobject/index.js | 12 + .../node_modules/isobject/package.json | 119 + node_modules/has-value/package.json | 120 + node_modules/has-values/LICENSE | 21 + node_modules/has-values/README.md | 129 + node_modules/has-values/index.js | 60 + .../has-values/node_modules/is-number/LICENSE | 21 + .../node_modules/is-number/README.md | 115 + .../node_modules/is-number/index.js | 22 + .../is-number/node_modules/kind-of/LICENSE | 21 + .../is-number/node_modules/kind-of/README.md | 261 + .../is-number/node_modules/kind-of/index.js | 116 + .../node_modules/kind-of/package.json | 139 + .../node_modules/is-number/package.json | 123 + .../has-values/node_modules/kind-of/LICENSE | 21 + .../has-values/node_modules/kind-of/README.md | 267 + .../has-values/node_modules/kind-of/index.js | 119 + .../node_modules/kind-of/package.json | 139 + node_modules/has-values/package.json | 115 + node_modules/has/LICENSE-MIT | 22 + node_modules/has/README.md | 18 + node_modules/has/package.json | 73 + node_modules/has/src/index.js | 5 + node_modules/has/test/index.js | 10 + node_modules/hash-base/LICENSE | 21 + node_modules/hash-base/README.md | 48 + node_modules/hash-base/index.js | 95 + node_modules/hash-base/package.json | 71 + node_modules/hash.js/.eslintrc.js | 41 + node_modules/hash.js/.travis.yml | 9 + node_modules/hash.js/README.md | 48 + node_modules/hash.js/lib/hash.d.ts | 106 + node_modules/hash.js/lib/hash.js | 15 + node_modules/hash.js/lib/hash/common.js | 92 + node_modules/hash.js/lib/hash/hmac.js | 47 + node_modules/hash.js/lib/hash/ripemd.js | 146 + node_modules/hash.js/lib/hash/sha.js | 7 + node_modules/hash.js/lib/hash/sha/1.js | 74 + node_modules/hash.js/lib/hash/sha/224.js | 30 + node_modules/hash.js/lib/hash/sha/256.js | 105 + node_modules/hash.js/lib/hash/sha/384.js | 35 + node_modules/hash.js/lib/hash/sha/512.js | 330 + node_modules/hash.js/lib/hash/sha/common.js | 49 + node_modules/hash.js/lib/hash/utils.js | 253 + node_modules/hash.js/package.json | 64 + node_modules/hash.js/test/hash-test.js | 124 + node_modules/hash.js/test/hmac-test.js | 62 + node_modules/heap/.npmignore | 2 + node_modules/heap/.travis.yml | 4 + node_modules/heap/Makefile | 17 + node_modules/heap/README.md | 211 + node_modules/heap/bower.json | 19 + node_modules/heap/index.js | 1 + node_modules/heap/lib/heap.js | 375 + node_modules/heap/package.json | 63 + node_modules/heap/src/heap.coffee | 218 + node_modules/heap/test/heap.test.coffee | 100 + node_modules/hmac-drbg/.npmignore | 2 + node_modules/hmac-drbg/.travis.yml | 11 + node_modules/hmac-drbg/README.md | 48 + node_modules/hmac-drbg/lib/hmac-drbg.js | 113 + node_modules/hmac-drbg/package.json | 60 + node_modules/hmac-drbg/test/drbg-test.js | 91 + .../test/fixtures/hmac-drbg-nist.json | 332 + node_modules/htmlescape/.npmignore | 4 + node_modules/htmlescape/CHANGELOG.md | 9 + node_modules/htmlescape/LICENSE | 9 + node_modules/htmlescape/README.md | 30 + node_modules/htmlescape/htmlescape.js | 42 + node_modules/htmlescape/package.json | 61 + node_modules/http-errors/HISTORY.md | 132 + node_modules/http-errors/LICENSE | 23 + node_modules/http-errors/README.md | 135 + node_modules/http-errors/index.js | 260 + node_modules/http-errors/package.json | 90 + node_modules/https-browserify/LICENSE | 20 + node_modules/https-browserify/index.js | 31 + node_modules/https-browserify/package.json | 56 + node_modules/https-browserify/readme.markdown | 22 + .../hyperscript-attribute-to-property/LICENSE | 20 + .../README.md | 53 + .../index.js | 19 + .../package.json | 64 + node_modules/hyperx/.travis.yml | 6 + node_modules/hyperx/LICENSE | 23 + node_modules/hyperx/bench/loop.js | 22 + node_modules/hyperx/bench/raw.js | 22 + node_modules/hyperx/example/deku/index.html | 6 + node_modules/hyperx/example/deku/main.js | 23 + node_modules/hyperx/example/deku/package.json | 6 + node_modules/hyperx/example/hyperscript.js | 15 + .../hyperx/example/main_loop/index.html | 6 + node_modules/hyperx/example/main_loop/main.js | 18 + .../hyperx/example/main_loop/package.json | 6 + node_modules/hyperx/example/react.js | 16 + .../hyperx/example/react_browser/index.html | 6 + .../hyperx/example/react_browser/main.js | 18 + .../hyperx/example/react_browser/package.json | 6 + node_modules/hyperx/example/vdom.js | 15 + node_modules/hyperx/index.js | 294 + node_modules/hyperx/package.json | 70 + node_modules/hyperx/readme.markdown | 203 + node_modules/hyperx/test/attr.js | 76 + node_modules/hyperx/test/attr_to_prop.js | 29 + node_modules/hyperx/test/br.js | 10 + node_modules/hyperx/test/children.js | 42 + node_modules/hyperx/test/comment.js | 51 + node_modules/hyperx/test/concat.js | 49 + node_modules/hyperx/test/esc.js | 24 + .../test/ignore_surounding_whitespace.js | 19 + node_modules/hyperx/test/key.js | 72 + node_modules/hyperx/test/multi_elem_error.js | 12 + node_modules/hyperx/test/style.js | 17 + node_modules/hyperx/test/svg.js | 21 + node_modules/hyperx/test/tags.js | 23 + node_modules/hyperx/test/title.js | 10 + node_modules/hyperx/test/types.js | 28 + node_modules/hyperx/test/value.js | 36 + node_modules/hyperx/test/vdom.js | 26 + node_modules/hyperx/test/z_hyperscript.js | 27 + node_modules/ieee754/LICENSE | 28 + node_modules/ieee754/README.md | 51 + node_modules/ieee754/index.js | 84 + node_modules/ieee754/package.json | 69 + node_modules/individual/.npmignore | 4 + node_modules/individual/.travis.yml | 7 + node_modules/individual/LICENCE | 19 + node_modules/individual/README.md | 69 + node_modules/individual/index.js | 19 + node_modules/individual/one-version.js | 22 + node_modules/individual/package.json | 84 + node_modules/individual/test.js | 25 + node_modules/inflight/LICENSE | 15 + node_modules/inflight/README.md | 37 + node_modules/inflight/inflight.js | 54 + node_modules/inflight/package.json | 58 + node_modules/inherits/LICENSE | 16 + node_modules/inherits/README.md | 42 + node_modules/inherits/inherits.js | 7 + node_modules/inherits/inherits_browser.js | 23 + node_modules/inherits/package.json | 89 + node_modules/inject-lr-script/LICENSE.md | 21 + node_modules/inject-lr-script/index.js | 42 + node_modules/inject-lr-script/package.json | 68 + node_modules/inline-source-map/.npmignore | 16 + node_modules/inline-source-map/.travis.yml | 8 + node_modules/inline-source-map/LICENSE | 23 + node_modules/inline-source-map/README.md | 89 + .../inline-source-map/example/foo-bar.js | 8 + node_modules/inline-source-map/index.js | 135 + node_modules/inline-source-map/package.json | 72 + .../test/inline-source-map.js | 342 + .../inline-source-map/test/source-content.js | 143 + node_modules/insert-css/LICENSE | 18 + node_modules/insert-css/example/bundle.js | 31 + node_modules/insert-css/example/index.html | 6 + node_modules/insert-css/example/insert.js | 5 + node_modules/insert-css/example/style.css | 4 + node_modules/insert-css/index.js | 22 + node_modules/insert-css/package.json | 69 + node_modules/insert-css/readme.markdown | 53 + node_modules/insert-css/test/insert.js | 48 + .../insert-module-globals/.travis.yml | 5 + node_modules/insert-module-globals/LICENSE | 18 + .../insert-module-globals/appveyor.yml | 18 + .../bench/.gitattributes | 1 + .../insert-module-globals/bench/index.js | 15 + node_modules/insert-module-globals/bin/cmd.js | 26 + .../example/files/foo/index.js | 6 + .../example/files/main.js | 6 + .../insert-module-globals/example/insert.js | 12 + node_modules/insert-module-globals/index.js | 194 + .../insert-module-globals/package.json | 81 + .../insert-module-globals/readme.markdown | 146 + .../insert-module-globals/test/always.js | 108 + .../always/custom_globals_without_defaults.js | 7 + .../test/always/hidden_from_quick_test.js | 1 + .../insert-module-globals/test/always/main.js | 10 + .../insert-module-globals/test/global.js | 64 + .../test/global/filename.js | 2 + .../insert-module-globals/test/global/main.js | 2 + .../insert-module-globals/test/immediate.js | 30 + .../test/immediate/main.js | 8 + .../insert-module-globals/test/insert.js | 46 + .../test/insert/buffer.js | 1 + .../test/insert/foo/buf.js | 4 + .../test/insert/foo/index.js | 4 + .../insert-module-globals/test/insert/main.js | 4 + .../insert-module-globals/test/isbuffer.js | 64 + .../test/isbuffer/both.js | 6 + .../test/isbuffer/main.js | 3 + .../test/isbuffer/new.js | 6 + .../insert-module-globals/test/return.js | 27 + .../test/return/foo/index.js | 4 + .../insert-module-globals/test/return/main.js | 6 + .../insert-module-globals/test/roots.js | 35 + .../insert-module-globals/test/roots/main.js | 1 + .../insert-module-globals/test/sourcemap.js | 41 + .../test/sourcemap/main.js | 3 + .../test/sourcemap/main_es6.js | 1 + .../insert-module-globals/test/subdir.js | 37 + .../insert-module-globals/test/subdir/main.js | 1 + .../subdir/node_modules/is-buffer/index.js | 21 + .../insert-module-globals/test/unprefix.js | 34 + .../test/unprefix/hello.js | 2 + .../test/unprefix/main.js | 3 + node_modules/internal-ip/index.js | 47 + node_modules/internal-ip/license | 9 + node_modules/internal-ip/package.json | 82 + node_modules/internal-ip/readme.md | 49 + node_modules/ip-regex/index.js | 24 + node_modules/ip-regex/license | 21 + node_modules/ip-regex/package.json | 77 + node_modules/ip-regex/readme.md | 63 + node_modules/ipaddr.js/README.md | 233 + node_modules/ipaddr.js/ipaddr.min.js | 1 + node_modules/ipaddr.js/lib/ipaddr.js | 636 + node_modules/ipaddr.js/lib/ipaddr.js.d.ts | 71 + node_modules/ipaddr.js/package.json | 69 + node_modules/is-accessor-descriptor/LICENSE | 21 + node_modules/is-accessor-descriptor/README.md | 123 + node_modules/is-accessor-descriptor/index.js | 69 + .../is-accessor-descriptor/package.json | 92 + node_modules/is-binary-path/index.js | 12 + node_modules/is-binary-path/license | 21 + node_modules/is-binary-path/package.json | 71 + node_modules/is-binary-path/readme.md | 34 + node_modules/is-buffer/LICENSE | 21 + node_modules/is-buffer/README.md | 53 + node_modules/is-buffer/index.js | 21 + node_modules/is-buffer/package.json | 84 + node_modules/is-buffer/test/basic.js | 24 + node_modules/is-data-descriptor/LICENSE | 21 + node_modules/is-data-descriptor/README.md | 128 + node_modules/is-data-descriptor/index.js | 55 + node_modules/is-data-descriptor/package.json | 91 + node_modules/is-descriptor/LICENSE | 21 + node_modules/is-descriptor/README.md | 193 + node_modules/is-descriptor/index.js | 22 + .../node_modules/kind-of/LICENSE | 21 + .../node_modules/kind-of/README.md | 342 + .../node_modules/kind-of/index.js | 147 + .../node_modules/kind-of/package.json | 146 + node_modules/is-descriptor/package.json | 117 + node_modules/is-dotfile/LICENSE | 21 + node_modules/is-dotfile/README.md | 95 + node_modules/is-dotfile/index.js | 14 + node_modules/is-dotfile/package.json | 106 + node_modules/is-electron/LICENSE | 21 + node_modules/is-electron/README.md | 25 + node_modules/is-electron/index.js | 21 + node_modules/is-electron/package.json | 64 + node_modules/is-equal-shallow/LICENSE | 21 + node_modules/is-equal-shallow/README.md | 90 + node_modules/is-equal-shallow/index.js | 27 + node_modules/is-equal-shallow/package.json | 85 + node_modules/is-extendable/LICENSE | 21 + node_modules/is-extendable/README.md | 72 + node_modules/is-extendable/index.js | 13 + node_modules/is-extendable/package.json | 92 + node_modules/is-extglob/LICENSE | 21 + node_modules/is-extglob/README.md | 75 + node_modules/is-extglob/index.js | 11 + node_modules/is-extglob/package.json | 79 + node_modules/is-finite/index.js | 6 + node_modules/is-finite/license | 21 + node_modules/is-finite/package.json | 68 + node_modules/is-finite/readme.md | 28 + node_modules/is-glob/LICENSE | 21 + node_modules/is-glob/README.md | 105 + node_modules/is-glob/index.js | 14 + node_modules/is-glob/package.json | 92 + node_modules/is-number/LICENSE | 21 + node_modules/is-number/README.md | 103 + node_modules/is-number/index.js | 19 + node_modules/is-number/package.json | 90 + node_modules/is-plain-object/LICENSE | 21 + node_modules/is-plain-object/README.md | 104 + node_modules/is-plain-object/index.d.ts | 5 + node_modules/is-plain-object/index.js | 37 + .../node_modules/isobject/LICENSE | 21 + .../node_modules/isobject/README.md | 122 + .../node_modules/isobject/index.d.ts | 5 + .../node_modules/isobject/index.js | 12 + .../node_modules/isobject/package.json | 119 + node_modules/is-plain-object/package.json | 124 + node_modules/is-posix-bracket/LICENSE | 21 + node_modules/is-posix-bracket/README.md | 88 + node_modules/is-posix-bracket/index.js | 10 + node_modules/is-posix-bracket/package.json | 95 + node_modules/is-primitive/LICENSE | 21 + node_modules/is-primitive/README.md | 57 + node_modules/is-primitive/index.js | 13 + node_modules/is-primitive/package.json | 71 + node_modules/is-stream/index.js | 21 + node_modules/is-stream/license | 21 + node_modules/is-stream/package.json | 70 + node_modules/is-stream/readme.md | 42 + node_modules/is-windows/LICENSE | 21 + node_modules/is-windows/README.md | 95 + node_modules/is-windows/index.js | 27 + node_modules/is-windows/package.json | 111 + node_modules/isarray/.npmignore | 1 + node_modules/isarray/.travis.yml | 4 + node_modules/isarray/Makefile | 6 + node_modules/isarray/README.md | 60 + node_modules/isarray/component.json | 19 + node_modules/isarray/index.js | 5 + node_modules/isarray/package.json | 75 + node_modules/isarray/test.js | 20 + node_modules/isexe/.npmignore | 2 + node_modules/isexe/LICENSE | 15 + node_modules/isexe/README.md | 51 + node_modules/isexe/index.js | 57 + node_modules/isexe/mode.js | 41 + node_modules/isexe/package.json | 60 + node_modules/isexe/test/basic.js | 221 + node_modules/isexe/windows.js | 42 + node_modules/isobject/LICENSE | 21 + node_modules/isobject/README.md | 112 + node_modules/isobject/index.js | 14 + node_modules/isobject/package.json | 98 + .../json-stable-stringify/.travis.yml | 4 + node_modules/json-stable-stringify/LICENSE | 18 + .../json-stable-stringify/example/key_cmp.js | 7 + .../json-stable-stringify/example/nested.js | 3 + .../json-stable-stringify/example/str.js | 3 + .../example/value_cmp.js | 7 + node_modules/json-stable-stringify/index.js | 50 + .../json-stable-stringify/package.json | 74 + .../json-stable-stringify/readme.markdown | 90 + .../json-stable-stringify/test/cmp.js | 11 + .../json-stable-stringify/test/nested.js | 8 + .../json-stable-stringify/test/str.js | 8 + node_modules/json-stringify-safe/.npmignore | 1 + node_modules/json-stringify-safe/CHANGELOG.md | 14 + node_modules/json-stringify-safe/LICENSE | 15 + node_modules/json-stringify-safe/Makefile | 35 + node_modules/json-stringify-safe/README.md | 52 + node_modules/json-stringify-safe/package.json | 66 + node_modules/json-stringify-safe/stringify.js | 27 + .../json-stringify-safe/test/mocha.opts | 2 + .../test/stringify_test.js | 246 + node_modules/jsonify/README.markdown | 34 + node_modules/jsonify/index.js | 2 + node_modules/jsonify/lib/parse.js | 273 + node_modules/jsonify/lib/stringify.js | 154 + node_modules/jsonify/package.json | 63 + node_modules/jsonify/test/parse.js | 16 + node_modules/jsonify/test/stringify.js | 15 + node_modules/jsonparse/.npmignore | 1 + node_modules/jsonparse/LICENSE | 24 + node_modules/jsonparse/README.markdown | 11 + node_modules/jsonparse/bench.js | 26 + .../jsonparse/examples/twitterfeed.js | 30 + node_modules/jsonparse/jsonparse.js | 413 + node_modules/jsonparse/package.json | 58 + node_modules/jsonparse/samplejson/basic.json | 167 + node_modules/jsonparse/samplejson/basic2.json | 180 + node_modules/jsonparse/test/big-token.js | 24 + node_modules/jsonparse/test/boundary.js | 110 + node_modules/jsonparse/test/offset.js | 67 + node_modules/jsonparse/test/primitives.js | 57 + node_modules/jsonparse/test/surrogate.js | 26 + node_modules/jsonparse/test/unvalid.js | 15 + node_modules/jsonparse/test/utf8.js | 38 + node_modules/kind-of/LICENSE | 21 + node_modules/kind-of/README.md | 261 + node_modules/kind-of/index.js | 116 + node_modules/kind-of/package.json | 146 + .../labeled-stream-splicer/.travis.yml | 6 + node_modules/labeled-stream-splicer/LICENSE | 18 + .../example/browser/bar.js | 3 + .../example/browser/foo.js | 5 + .../example/browser/main.js | 2 + .../example/browser/xyz.js | 2 + .../labeled-stream-splicer/example/bundle.js | 16 + node_modules/labeled-stream-splicer/index.js | 65 + .../node_modules/isarray/README.md | 62 + .../node_modules/isarray/index.js | 5 + .../node_modules/isarray/package.json | 76 + .../labeled-stream-splicer/package.json | 67 + .../labeled-stream-splicer/readme.markdown | 124 + .../labeled-stream-splicer/test/bundle.js | 27 + .../labeled-stream-splicer/test/bundle/bar.js | 3 + .../labeled-stream-splicer/test/bundle/foo.js | 5 + .../test/bundle/main.js | 2 + .../labeled-stream-splicer/test/bundle/xyz.js | 2 + node_modules/lodash.debounce/LICENSE | 47 + node_modules/lodash.debounce/README.md | 18 + node_modules/lodash.debounce/index.js | 377 + node_modules/lodash.debounce/package.json | 69 + node_modules/lodash.memoize/LICENSE.txt | 22 + node_modules/lodash.memoize/README.md | 20 + node_modules/lodash.memoize/index.js | 167 + node_modules/lodash.memoize/package.json | 81 + node_modules/map-cache/LICENSE | 21 + node_modules/map-cache/README.md | 145 + node_modules/map-cache/index.js | 100 + node_modules/map-cache/package.json | 91 + node_modules/map-limit/LICENSE.md | 21 + node_modules/map-limit/README.md | 32 + node_modules/map-limit/index.js | 54 + .../map-limit/node_modules/once/LICENSE | 15 + .../map-limit/node_modules/once/README.md | 51 + .../map-limit/node_modules/once/once.js | 21 + .../map-limit/node_modules/once/package.json | 66 + node_modules/map-limit/package.json | 62 + node_modules/map-limit/test.js | 39 + node_modules/map-visit/LICENSE | 21 + node_modules/map-visit/README.md | 155 + node_modules/map-visit/index.js | 37 + node_modules/map-visit/package.json | 113 + node_modules/math-random/.npmignore | 1 + node_modules/math-random/.travis.yml | 6 + node_modules/math-random/browser.js | 17 + node_modules/math-random/node.js | 13 + node_modules/math-random/package.json | 58 + node_modules/math-random/readme.md | 26 + node_modules/math-random/test.js | 26 + node_modules/md5.js/LICENSE | 21 + node_modules/md5.js/README.md | 29 + node_modules/md5.js/index.js | 146 + node_modules/md5.js/package.json | 68 + node_modules/md5/.npmignore | 1 + node_modules/md5/.travis.yml | 4 + node_modules/md5/LICENSE | 27 + node_modules/md5/README.md | 108 + node_modules/md5/md5.js | 160 + node_modules/md5/package.json | 68 + node_modules/md5/test.js | 45 + node_modules/micromatch/LICENSE | 21 + node_modules/micromatch/README.md | 689 + node_modules/micromatch/index.js | 431 + node_modules/micromatch/lib/chars.js | 67 + node_modules/micromatch/lib/expand.js | 304 + node_modules/micromatch/lib/glob.js | 193 + node_modules/micromatch/lib/utils.js | 149 + node_modules/micromatch/package.json | 146 + node_modules/miller-rabin/.npmignore | 2 + node_modules/miller-rabin/1.js | 7 + node_modules/miller-rabin/README.md | 26 + node_modules/miller-rabin/bin/miller-rabin | 29 + node_modules/miller-rabin/lib/mr.js | 115 + node_modules/miller-rabin/package.json | 62 + node_modules/miller-rabin/test.js | 25 + node_modules/miller-rabin/test/api-test.js | 18 + node_modules/mime/LICENSE | 21 + node_modules/mime/README.md | 90 + node_modules/mime/build/build.js | 11 + node_modules/mime/build/test.js | 60 + node_modules/mime/cli.js | 8 + node_modules/mime/mime.js | 108 + node_modules/mime/package.json | 67 + node_modules/mime/types.json | 1 + node_modules/minimalistic-assert/LICENSE | 13 + node_modules/minimalistic-assert/index.js | 11 + node_modules/minimalistic-assert/package.json | 48 + node_modules/minimalistic-assert/readme.md | 4 + .../minimalistic-crypto-utils/.npmignore | 2 + .../minimalistic-crypto-utils/.travis.yml | 11 + .../minimalistic-crypto-utils/README.md | 47 + .../minimalistic-crypto-utils/lib/utils.js | 58 + .../minimalistic-crypto-utils/package.json | 56 + .../test/utils-test.js | 28 + node_modules/minimatch/LICENSE | 15 + node_modules/minimatch/README.md | 209 + node_modules/minimatch/minimatch.js | 923 + node_modules/minimatch/package.json | 64 + node_modules/minimist/.travis.yml | 8 + node_modules/minimist/LICENSE | 18 + node_modules/minimist/example/parse.js | 2 + node_modules/minimist/index.js | 236 + node_modules/minimist/package.json | 75 + node_modules/minimist/readme.markdown | 91 + node_modules/minimist/test/all_bool.js | 32 + node_modules/minimist/test/bool.js | 166 + node_modules/minimist/test/dash.js | 31 + node_modules/minimist/test/default_bool.js | 35 + node_modules/minimist/test/dotted.js | 22 + node_modules/minimist/test/kv_short.js | 16 + node_modules/minimist/test/long.js | 31 + node_modules/minimist/test/num.js | 36 + node_modules/minimist/test/parse.js | 197 + node_modules/minimist/test/parse_modified.js | 9 + node_modules/minimist/test/short.js | 67 + node_modules/minimist/test/stop_early.js | 15 + node_modules/minimist/test/unknown.js | 102 + node_modules/minimist/test/whitespace.js | 8 + node_modules/mixin-deep/LICENSE | 21 + node_modules/mixin-deep/README.md | 80 + node_modules/mixin-deep/index.js | 53 + .../node_modules/is-extendable/LICENSE | 21 + .../node_modules/is-extendable/README.md | 88 + .../node_modules/is-extendable/index.d.ts | 5 + .../node_modules/is-extendable/index.js | 14 + .../node_modules/is-extendable/package.json | 98 + node_modules/mixin-deep/package.json | 98 + node_modules/mkdirp/.travis.yml | 8 + node_modules/mkdirp/LICENSE | 21 + node_modules/mkdirp/bin/cmd.js | 33 + node_modules/mkdirp/bin/usage.txt | 12 + node_modules/mkdirp/examples/pow.js | 6 + node_modules/mkdirp/index.js | 98 + .../mkdirp/node_modules/minimist/.travis.yml | 4 + .../mkdirp/node_modules/minimist/LICENSE | 18 + .../node_modules/minimist/example/parse.js | 2 + .../mkdirp/node_modules/minimist/index.js | 187 + .../mkdirp/node_modules/minimist/package.json | 71 + .../node_modules/minimist/readme.markdown | 73 + .../mkdirp/node_modules/minimist/test/dash.js | 24 + .../minimist/test/default_bool.js | 20 + .../node_modules/minimist/test/dotted.js | 16 + .../mkdirp/node_modules/minimist/test/long.js | 31 + .../node_modules/minimist/test/parse.js | 318 + .../minimist/test/parse_modified.js | 9 + .../node_modules/minimist/test/short.js | 67 + .../node_modules/minimist/test/whitespace.js | 8 + node_modules/mkdirp/package.json | 62 + node_modules/mkdirp/readme.markdown | 100 + node_modules/mkdirp/test/chmod.js | 41 + node_modules/mkdirp/test/clobber.js | 38 + node_modules/mkdirp/test/mkdirp.js | 28 + node_modules/mkdirp/test/opts_fs.js | 29 + node_modules/mkdirp/test/opts_fs_sync.js | 27 + node_modules/mkdirp/test/perm.js | 32 + node_modules/mkdirp/test/perm_sync.js | 36 + node_modules/mkdirp/test/race.js | 37 + node_modules/mkdirp/test/rel.js | 32 + node_modules/mkdirp/test/return.js | 25 + node_modules/mkdirp/test/return_sync.js | 24 + node_modules/mkdirp/test/root.js | 19 + node_modules/mkdirp/test/sync.js | 32 + node_modules/mkdirp/test/umask.js | 28 + node_modules/mkdirp/test/umask_sync.js | 32 + node_modules/module-deps/.travis.yml | 17 + node_modules/module-deps/CHANGELOG.md | 26 + node_modules/module-deps/LICENSE | 18 + node_modules/module-deps/bin/cmd.js | 28 + node_modules/module-deps/bin/usage.txt | 9 + node_modules/module-deps/example/deps.js | 6 + node_modules/module-deps/example/files/bar.js | 3 + node_modules/module-deps/example/files/foo.js | 5 + .../module-deps/example/files/main.js | 2 + node_modules/module-deps/example/files/xyz.js | 2 + node_modules/module-deps/index.js | 625 + node_modules/module-deps/package.json | 84 + node_modules/module-deps/readme.markdown | 312 + node_modules/module-deps/test/bundle.js | 23 + node_modules/module-deps/test/cache.js | 50 + node_modules/module-deps/test/cache_expose.js | 54 + .../module-deps/test/cache_partial.js | 47 + .../module-deps/test/cache_partial_expose.js | 104 + .../module-deps/test/cache_persistent.js | 122 + .../test/cache_persistent/error_transform.js | 6 + node_modules/module-deps/test/cycle.js | 19 + node_modules/module-deps/test/cycle/bar.js | 3 + node_modules/module-deps/test/cycle/foo.js | 4 + node_modules/module-deps/test/cycle/main.js | 4 + node_modules/module-deps/test/deps.js | 49 + node_modules/module-deps/test/detect.js | 32 + node_modules/module-deps/test/dotdot.js | 20 + .../module-deps/test/dotdot/abc/index.js | 2 + node_modules/module-deps/test/dotdot/index.js | 1 + node_modules/module-deps/test/expose.js | 41 + node_modules/module-deps/test/expose/bar.js | 1 + node_modules/module-deps/test/expose/foo.js | 1 + .../module-deps/test/expose/lib/abc.js | 1 + .../module-deps/test/expose/lib/xyz.js | 2 + node_modules/module-deps/test/expose/main.js | 3 + node_modules/module-deps/test/file_cache.js | 58 + node_modules/module-deps/test/files/bar.js | 3 + node_modules/module-deps/test/files/extra.js | 1 + .../module-deps/test/files/filterable.js | 10 + node_modules/module-deps/test/files/foo.js | 5 + node_modules/module-deps/test/files/main.js | 2 + .../module-deps/test/files/pkg_filter/one.js | 1 + .../test/files/pkg_filter/package.json | 3 + .../module-deps/test/files/pkg_filter/test.js | 1 + .../module-deps/test/files/pkg_filter/two.js | 1 + .../module-deps/test/files/quotes/bar.js | 1 + .../module-deps/test/files/quotes/baz.js | 1 + .../module-deps/test/files/quotes/foo.js | 1 + .../module-deps/test/files/quotes/main.js | 3 + .../module-deps/test/files/syntax_error.js | 2 + .../test/files/tr_2dep_module/f.js | 1 + .../test/files/tr_2dep_module/main.js | 7 + .../module-deps/test/files/tr_global/main.js | 1 + .../test/files/tr_global/package.json | 5 + .../module-deps/test/files/tr_module/f.js | 1 + .../module-deps/test/files/tr_module/index.js | 8 + .../module-deps/test/files/tr_module/main.js | 8 + .../test/files/tr_module/package.json | 5 + .../module-deps/test/files/tr_module/xxx.js | 8 + .../test/files/tr_no_entry/main.js | 1 + .../test/files/tr_rel/package.json | 5 + .../test/files/tr_rel/subdir/main.js | 1 + .../module-deps/test/files/tr_rel/xxx.js | 8 + .../module-deps/test/files/tr_sh/f.js | 1 + .../module-deps/test/files/tr_sh/main.js | 7 + .../module-deps/test/files/tr_sh/tr_a.js | 7 + .../module-deps/test/files/tr_sh/tr_b.js | 7 + .../test/files/tr_whole_package/f.js | 3 + .../test/files/tr_whole_package/main.js | 3 + .../module-deps/test/files/transformdeps.js | 1 + .../module-deps/test/files/unicode/bar.js | 3 + .../module-deps/test/files/unicode/foo.js | 5 + .../module-deps/test/files/unicode/main.js | 2 + node_modules/module-deps/test/files/xyz.js | 2 + node_modules/module-deps/test/filter.js | 36 + .../module-deps/test/ignore_missing.js | 60 + .../module-deps/test/ignore_missing/main.js | 1 + .../module-deps/test/ignore_missing/other.js | 1 + .../module-deps/test/ignore_missing_cache.js | 52 + node_modules/module-deps/test/invalid_pkg.js | 16 + .../module-deps/test/invalid_pkg/file.js | 1 + .../module-deps/test/invalid_pkg/index.js | 1 + .../module-deps/test/invalid_pkg/package.json | 1 + node_modules/module-deps/test/noparse.js | 43 + node_modules/module-deps/test/noparse_row.js | 39 + node_modules/module-deps/test/pkg.js | 20 + node_modules/module-deps/test/pkg/main.js | 2 + .../module-deps/test/pkg/package.json | 4 + node_modules/module-deps/test/pkg_filter.js | 26 + node_modules/module-deps/test/quotes.js | 42 + node_modules/module-deps/test/row_expose.js | 24 + .../test/row_expose_name_is_file_transform.js | 32 + .../module-deps/test/row_expose_transform.js | 31 + node_modules/module-deps/test/source.js | 61 + node_modules/module-deps/test/syntax.js | 23 + .../module-deps/test/tr_2dep_module.js | 23 + node_modules/module-deps/test/tr_deps.js | 60 + node_modules/module-deps/test/tr_err.js | 21 + node_modules/module-deps/test/tr_flags.js | 44 + .../module-deps/test/tr_flags/empty.js | 0 node_modules/module-deps/test/tr_fn.js | 32 + node_modules/module-deps/test/tr_global.js | 29 + node_modules/module-deps/test/tr_module.js | 23 + node_modules/module-deps/test/tr_no_entry.js | 31 + node_modules/module-deps/test/tr_opts.js | 21 + node_modules/module-deps/test/tr_opts/main.js | 1 + .../module-deps/test/tr_opts/package.json | 7 + node_modules/module-deps/test/tr_rel.js | 24 + node_modules/module-deps/test/tr_sh.js | 23 + .../module-deps/test/tr_whole_package.js | 22 + node_modules/module-deps/test/tr_write.js | 32 + .../module-deps/test/tr_write/main.js | 1 + node_modules/module-deps/test/undef_file.js | 49 + node_modules/module-deps/test/unicode.js | 49 + node_modules/ms/index.js | 152 + node_modules/ms/license.md | 21 + node_modules/ms/package.json | 70 + node_modules/ms/readme.md | 51 + node_modules/nanomatch/CHANGELOG.md | 57 + node_modules/nanomatch/LICENSE | 21 + node_modules/nanomatch/README.md | 1148 + node_modules/nanomatch/index.js | 838 + node_modules/nanomatch/lib/cache.js | 1 + node_modules/nanomatch/lib/compilers.js | 339 + node_modules/nanomatch/lib/parsers.js | 386 + node_modules/nanomatch/lib/utils.js | 379 + .../nanomatch/node_modules/arr-diff/LICENSE | 21 + .../nanomatch/node_modules/arr-diff/README.md | 130 + .../nanomatch/node_modules/arr-diff/index.js | 47 + .../node_modules/arr-diff/package.json | 108 + .../node_modules/array-unique/LICENSE | 21 + .../node_modules/array-unique/README.md | 77 + .../node_modules/array-unique/index.js | 43 + .../node_modules/array-unique/package.json | 93 + .../node_modules/kind-of/CHANGELOG.md | 157 + .../nanomatch/node_modules/kind-of/LICENSE | 21 + .../nanomatch/node_modules/kind-of/README.md | 365 + .../nanomatch/node_modules/kind-of/index.js | 129 + .../node_modules/kind-of/package.json | 143 + node_modules/nanomatch/package.json | 171 + node_modules/nice-try/CHANGELOG.md | 21 + node_modules/nice-try/LICENSE | 21 + node_modules/nice-try/README.md | 32 + node_modules/nice-try/package.json | 61 + node_modules/nice-try/src/index.js | 12 + node_modules/normalize-path/LICENSE | 21 + node_modules/normalize-path/README.md | 92 + node_modules/normalize-path/index.js | 19 + node_modules/normalize-path/package.json | 118 + node_modules/npm-run-path/index.js | 39 + node_modules/npm-run-path/license | 21 + node_modules/npm-run-path/package.json | 77 + node_modules/npm-run-path/readme.md | 81 + node_modules/number-is-nan/index.js | 4 + node_modules/number-is-nan/license | 21 + node_modules/number-is-nan/package.json | 67 + node_modules/number-is-nan/readme.md | 28 + node_modules/object-assign/index.js | 90 + node_modules/object-assign/license | 21 + node_modules/object-assign/package.json | 76 + node_modules/object-assign/readme.md | 61 + node_modules/object-copy/LICENSE | 21 + node_modules/object-copy/index.js | 174 + .../node_modules/define-property/LICENSE | 21 + .../node_modules/define-property/README.md | 77 + .../node_modules/define-property/index.js | 31 + .../node_modules/define-property/package.json | 82 + node_modules/object-copy/package.json | 80 + node_modules/object-visit/LICENSE | 21 + node_modules/object-visit/README.md | 83 + node_modules/object-visit/index.js | 33 + .../node_modules/isobject/LICENSE | 21 + .../node_modules/isobject/README.md | 122 + .../node_modules/isobject/index.d.ts | 5 + .../node_modules/isobject/index.js | 12 + .../node_modules/isobject/package.json | 119 + node_modules/object-visit/package.json | 97 + node_modules/object.omit/LICENSE | 21 + node_modules/object.omit/README.md | 118 + node_modules/object.omit/index.js | 40 + node_modules/object.omit/package.json | 98 + node_modules/object.pick/LICENSE | 21 + node_modules/object.pick/README.md | 76 + node_modules/object.pick/index.js | 35 + .../object.pick/node_modules/isobject/LICENSE | 21 + .../node_modules/isobject/README.md | 122 + .../node_modules/isobject/index.d.ts | 5 + .../node_modules/isobject/index.js | 12 + .../node_modules/isobject/package.json | 119 + node_modules/object.pick/package.json | 92 + node_modules/on-finished/HISTORY.md | 88 + node_modules/on-finished/LICENSE | 23 + node_modules/on-finished/README.md | 154 + node_modules/on-finished/index.js | 196 + node_modules/on-finished/package.json | 71 + node_modules/on-headers/HISTORY.md | 16 + node_modules/on-headers/LICENSE | 22 + node_modules/on-headers/README.md | 76 + node_modules/on-headers/index.js | 93 + node_modules/on-headers/package.json | 69 + node_modules/once/LICENSE | 15 + node_modules/once/README.md | 79 + node_modules/once/once.js | 42 + node_modules/once/package.json | 68 + node_modules/opn/index.js | 97 + node_modules/opn/license | 21 + node_modules/opn/package.json | 87 + node_modules/opn/readme.md | 93 + node_modules/opn/xdg-open | 861 + node_modules/options/.npmignore | 7 + node_modules/options/Makefile | 12 + node_modules/options/README.md | 69 + node_modules/options/lib/options.js | 86 + node_modules/options/package.json | 54 + node_modules/os-browserify/.npmignore | 14 + node_modules/os-browserify/LICENSE | 21 + node_modules/os-browserify/README.md | 5 + node_modules/os-browserify/browser.js | 49 + node_modules/os-browserify/main.js | 1 + node_modules/os-browserify/package.json | 53 + node_modules/os-tmpdir/index.js | 25 + node_modules/os-tmpdir/license | 21 + node_modules/os-tmpdir/package.json | 73 + node_modules/os-tmpdir/readme.md | 32 + node_modules/outpipe/.npmignore | 2 + node_modules/outpipe/LICENSE | 18 + node_modules/outpipe/bin/echo.js | 2 + node_modules/outpipe/example/input/x.js | 4 + node_modules/outpipe/example/input/y.js | 5 + node_modules/outpipe/example/input/z.js | 2 + node_modules/outpipe/example/watch.js | 19 + node_modules/outpipe/index.js | 34 + node_modules/outpipe/package.json | 69 + node_modules/outpipe/readme.markdown | 117 + node_modules/outpipe/test/cmd.js | 19 + node_modules/outpipe/test/outfile.js | 19 + node_modules/p-finally/index.js | 15 + node_modules/p-finally/license | 21 + node_modules/p-finally/package.json | 74 + node_modules/p-finally/readme.md | 47 + node_modules/pad-left/LICENSE | 21 + node_modules/pad-left/README.md | 134 + node_modules/pad-left/index.js | 28 + node_modules/pad-left/package.json | 119 + node_modules/pad-right/LICENSE | 21 + node_modules/pad-right/README.md | 71 + node_modules/pad-right/index.js | 20 + node_modules/pad-right/package.json | 95 + node_modules/pako/CHANGELOG.md | 118 + node_modules/pako/LICENSE | 21 + node_modules/pako/README.md | 182 + node_modules/pako/dist/pako.js | 6809 ++++ node_modules/pako/dist/pako.min.js | 1 + node_modules/pako/dist/pako_deflate.js | 3993 +++ node_modules/pako/dist/pako_deflate.min.js | 1 + node_modules/pako/dist/pako_inflate.js | 3293 ++ node_modules/pako/dist/pako_inflate.min.js | 1 + node_modules/pako/index.js | 14 + node_modules/pako/lib/deflate.js | 400 + node_modules/pako/lib/inflate.js | 418 + node_modules/pako/lib/utils/common.js | 105 + node_modules/pako/lib/utils/strings.js | 185 + node_modules/pako/lib/zlib/README | 59 + node_modules/pako/lib/zlib/adler32.js | 51 + node_modules/pako/lib/zlib/constants.js | 68 + node_modules/pako/lib/zlib/crc32.js | 59 + node_modules/pako/lib/zlib/deflate.js | 1874 + node_modules/pako/lib/zlib/gzheader.js | 58 + node_modules/pako/lib/zlib/inffast.js | 345 + node_modules/pako/lib/zlib/inflate.js | 1556 + node_modules/pako/lib/zlib/inftrees.js | 343 + node_modules/pako/lib/zlib/messages.js | 32 + node_modules/pako/lib/zlib/trees.js | 1220 + node_modules/pako/lib/zlib/zstream.js | 47 + node_modules/pako/package.json | 95 + node_modules/parents/.travis.yml | 4 + node_modules/parents/LICENSE | 18 + node_modules/parents/example/dirname.js | 3 + node_modules/parents/example/win32.js | 5 + node_modules/parents/index.js | 48 + node_modules/parents/package.json | 69 + node_modules/parents/readme.markdown | 75 + node_modules/parents/test/dirname.js | 20 + node_modules/parents/test/win32.js | 34 + node_modules/parse-asn1/.travis.yml | 9 + node_modules/parse-asn1/LICENSE | 13 + node_modules/parse-asn1/README.md | 8 + node_modules/parse-asn1/aesid.json | 13 + node_modules/parse-asn1/asn1.js | 122 + node_modules/parse-asn1/certificate.js | 88 + node_modules/parse-asn1/fixProc.js | 30 + node_modules/parse-asn1/index.js | 106 + .../parse-asn1/package-lock.json.1909017369 | 0 node_modules/parse-asn1/package.json | 58 + node_modules/parse-asn1/test/1024.priv | 16 + node_modules/parse-asn1/test/1024.pub | 6 + node_modules/parse-asn1/test/dsa.1024.priv | 18 + node_modules/parse-asn1/test/dsa.1024.pub | 12 + node_modules/parse-asn1/test/dsa.2048.priv | 20 + node_modules/parse-asn1/test/dsa.2048.pub | 20 + node_modules/parse-asn1/test/ec.pass.priv | 7 + node_modules/parse-asn1/test/ec.priv | 5 + node_modules/parse-asn1/test/ec.pub | 4 + node_modules/parse-asn1/test/index.js | 138 + node_modules/parse-asn1/test/node.cert | 20 + node_modules/parse-asn1/test/pass.1024.priv | 18 + node_modules/parse-asn1/test/pass.1024.pub | 6 + .../parse-asn1/test/pass.dsa.1024.priv | 11 + .../parse-asn1/test/pass.dsa.1024.pub | 12 + .../parse-asn1/test/pass.rsa.1024.priv | 18 + .../parse-asn1/test/pass.rsa.1024.pub | 6 + .../parse-asn1/test/pass.rsa.2028.priv | 30 + .../parse-asn1/test/pass.rsa.2028.pub | 9 + .../parse-asn1/test/pass2.dsa.1024.priv | 15 + .../parse-asn1/test/pass2.dsa.1024.pub | 12 + node_modules/parse-asn1/test/rsa.1024.priv | 15 + node_modules/parse-asn1/test/rsa.1024.pub | 5 + node_modules/parse-asn1/test/rsa.2028.priv | 27 + node_modules/parse-asn1/test/rsa.2028.pub | 8 + node_modules/parse-asn1/test/vector.js | 7 + node_modules/parse-asn1/test/vector.priv | 12 + node_modules/parse-asn1/test/vector2.priv | 19 + node_modules/parse-glob/LICENSE | 21 + node_modules/parse-glob/README.md | 115 + node_modules/parse-glob/index.js | 156 + node_modules/parse-glob/package.json | 93 + node_modules/parse-ms/index.js | 16 + node_modules/parse-ms/license | 21 + node_modules/parse-ms/package.json | 66 + node_modules/parse-ms/readme.md | 23 + node_modules/parseurl/HISTORY.md | 53 + node_modules/parseurl/LICENSE | 24 + node_modules/parseurl/README.md | 124 + node_modules/parseurl/index.js | 154 + node_modules/parseurl/package.json | 79 + node_modules/pascalcase/LICENSE | 21 + node_modules/pascalcase/README.md | 80 + node_modules/pascalcase/index.js | 21 + node_modules/pascalcase/package.json | 77 + node_modules/path-browserify/LICENSE | 18 + node_modules/path-browserify/index.js | 302 + node_modules/path-browserify/package.json | 57 + node_modules/path-browserify/readme.markdown | 3 + .../path-browserify/test/test-path.js | 424 + node_modules/path-is-absolute/index.js | 20 + node_modules/path-is-absolute/license | 21 + node_modules/path-is-absolute/package.json | 78 + node_modules/path-is-absolute/readme.md | 59 + node_modules/path-key/index.js | 13 + node_modules/path-key/license | 21 + node_modules/path-key/package.json | 72 + node_modules/path-key/readme.md | 51 + node_modules/path-parse/.travis.yml | 9 + node_modules/path-parse/LICENSE | 21 + node_modules/path-parse/README.md | 42 + node_modules/path-parse/index.js | 93 + node_modules/path-parse/package.json | 61 + node_modules/path-parse/test.js | 77 + node_modules/path-platform/LICENSE | 3 + node_modules/path-platform/README.md | 5 + node_modules/path-platform/package.json | 54 + node_modules/path-platform/path.js | 643 + node_modules/pbkdf2/LICENSE | 21 + node_modules/pbkdf2/README.md | 30 + node_modules/pbkdf2/browser.js | 2 + node_modules/pbkdf2/index.js | 31 + node_modules/pbkdf2/lib/async.js | 100 + node_modules/pbkdf2/lib/default-encoding.js | 10 + node_modules/pbkdf2/lib/precondition.js | 28 + node_modules/pbkdf2/lib/sync-browser.js | 104 + node_modules/pbkdf2/lib/sync.js | 51 + node_modules/pbkdf2/package.json | 98 + node_modules/pelo/README.md | 56 + node_modules/pelo/app.js | 67 + node_modules/pelo/bundle.js | 1053 + node_modules/pelo/client.js | 14 + node_modules/pelo/index.js | 106 + node_modules/pelo/package.json | 59 + node_modules/pelo/server.js | 55 + node_modules/pelo/yarn.lock | 2049 ++ node_modules/pem/.eslintignore | 2 + node_modules/pem/.eslintrc.js | 11 + node_modules/pem/.travis.yml | 63 + node_modules/pem/CHANGELOG.md | 38 + node_modules/pem/CODE_OF_CONDUCT.md | 84 + node_modules/pem/CONTRIBUTING.md | 78 + node_modules/pem/HISTORY.md | 96 + node_modules/pem/LICENSE | 17 + node_modules/pem/README.md | 332 + node_modules/pem/bin/test_build_openssl.sh | 73 + node_modules/pem/jsdoc.json | 44 + node_modules/pem/lib/convert.js | 278 + node_modules/pem/lib/helper.js | 137 + node_modules/pem/lib/openssl.js | 257 + node_modules/pem/lib/pem.js | 1288 + node_modules/pem/mocha.opts | 6 + node_modules/pem/package.json | 135 + node_modules/pem/test/convert.spec.js | 255 + .../pem/test/fixtures/GeoTrust_Primary_CA.pem | 21 + node_modules/pem/test/fixtures/cn_openssl.crt | 34 + node_modules/pem/test/fixtures/cn_openssl.csr | 19 + node_modules/pem/test/fixtures/cn_openssl.key | 52 + .../pem/test/fixtures/cn_openssl_config.conf | 38 + node_modules/pem/test/fixtures/google.com.pem | 68 + node_modules/pem/test/fixtures/idsrv3test.pfx | Bin 0 -> 3395 bytes node_modules/pem/test/fixtures/inclpkey.pem | 86 + node_modules/pem/test/fixtures/nopkey.der | Bin 0 -> 965 bytes node_modules/pem/test/fixtures/nopkey.pem | 23 + node_modules/pem/test/fixtures/pem196.pem | 35 + node_modules/pem/test/fixtures/ru_openssl.crt | 36 + node_modules/pem/test/fixtures/ru_openssl.csr | 20 + node_modules/pem/test/fixtures/ru_openssl.key | 52 + .../pem/test/fixtures/ru_openssl_config.conf | 40 + node_modules/pem/test/fixtures/test.cnf | 26 + node_modules/pem/test/fixtures/test.crt | 16 + node_modules/pem/test/fixtures/test.csr | 13 + node_modules/pem/test/fixtures/test.dh | 5 + node_modules/pem/test/fixtures/test.key | 18 + node_modules/pem/test/fixtures/test.p7b | 17 + node_modules/pem/test/fixtures/testnopw.key | 15 + node_modules/pem/test/helper.spec.js | 77 + node_modules/pem/test/openssl.spec.js | 47 + node_modules/pem/test/pem.helper.js | 132 + node_modules/pem/test/pem.spec.js | 963 + node_modules/plur/index.js | 9 + node_modules/plur/license | 21 + node_modules/plur/package.json | 69 + node_modules/plur/readme.md | 52 + node_modules/posix-character-classes/LICENSE | 21 + .../posix-character-classes/README.md | 103 + node_modules/posix-character-classes/index.js | 22 + .../posix-character-classes/package.json | 85 + node_modules/preserve/.gitattributes | 14 + node_modules/preserve/.jshintrc | 24 + node_modules/preserve/.npmignore | 53 + node_modules/preserve/.travis.yml | 3 + node_modules/preserve/.verb.md | 59 + node_modules/preserve/LICENSE | 24 + node_modules/preserve/README.md | 90 + node_modules/preserve/index.js | 54 + node_modules/preserve/package.json | 73 + node_modules/preserve/test.js | 48 + node_modules/prettier-bytes/.npmignore | 27 + node_modules/prettier-bytes/.travis.yml | 9 + node_modules/prettier-bytes/CHANGELOG.md | 7 + node_modules/prettier-bytes/CONTRIBUTING.md | 61 + node_modules/prettier-bytes/LICENSE | 5 + node_modules/prettier-bytes/README.md | 64 + node_modules/prettier-bytes/index.js | 30 + node_modules/prettier-bytes/package.json | 59 + node_modules/prettier-bytes/test/index.js | 44 + node_modules/pretty-ms/index.js | 47 + node_modules/pretty-ms/license | 21 + node_modules/pretty-ms/package.json | 80 + node_modules/pretty-ms/readme.md | 89 + node_modules/process-nextick-args/index.js | 44 + node_modules/process-nextick-args/license.md | 19 + .../process-nextick-args/package.json | 50 + node_modules/process-nextick-args/readme.md | 18 + node_modules/process/.eslintrc | 21 + node_modules/process/LICENSE | 22 + node_modules/process/README.md | 26 + node_modules/process/browser.js | 184 + node_modules/process/index.js | 2 + node_modules/process/package.json | 61 + node_modules/process/test.js | 199 + node_modules/public-encrypt/.travis.yml | 6 + node_modules/public-encrypt/LICENSE | 19 + node_modules/public-encrypt/browser.js | 10 + node_modules/public-encrypt/index.js | 18 + node_modules/public-encrypt/mgf.js | 19 + node_modules/public-encrypt/package.json | 64 + node_modules/public-encrypt/privateDecrypt.js | 105 + node_modules/public-encrypt/publicEncrypt.js | 88 + node_modules/public-encrypt/readme.md | 8 + node_modules/public-encrypt/test/1024.priv | 16 + node_modules/public-encrypt/test/1024.pub | 6 + node_modules/public-encrypt/test/ec.pass.priv | 7 + node_modules/public-encrypt/test/ec.priv | 5 + node_modules/public-encrypt/test/ec.pub | 4 + node_modules/public-encrypt/test/index.js | 113 + node_modules/public-encrypt/test/nodeTests.js | 51 + .../public-encrypt/test/pass.1024.priv | 18 + .../public-encrypt/test/pass.1024.pub | 6 + .../public-encrypt/test/rsa.1024.priv | 15 + node_modules/public-encrypt/test/rsa.1024.pub | 5 + .../public-encrypt/test/rsa.2028.priv | 27 + node_modules/public-encrypt/test/rsa.2028.pub | 8 + .../public-encrypt/test/rsa.pass.priv | 30 + node_modules/public-encrypt/test/rsa.pass.pub | 9 + .../public-encrypt/test/test_cert.pem | 20 + node_modules/public-encrypt/test/test_key.pem | 15 + .../public-encrypt/test/test_rsa_privkey.pem | 15 + .../test/test_rsa_privkey_encrypted.pem | 18 + .../public-encrypt/test/test_rsa_pubkey.pem | 6 + node_modules/public-encrypt/withPublic.js | 12 + node_modules/public-encrypt/xor.js | 8 + node_modules/punycode/LICENSE-MIT.txt | 20 + node_modules/punycode/README.md | 176 + node_modules/punycode/package.json | 87 + node_modules/punycode/punycode.js | 533 + node_modules/query-string/index.js | 205 + node_modules/query-string/license | 21 + node_modules/query-string/package.json | 76 + node_modules/query-string/readme.md | 184 + node_modules/querystring-es3/.travis.yml | 4 + node_modules/querystring-es3/History.md | 20 + node_modules/querystring-es3/License.md | 19 + node_modules/querystring-es3/Readme.md | 15 + node_modules/querystring-es3/decode.js | 84 + node_modules/querystring-es3/encode.js | 85 + node_modules/querystring-es3/index.js | 4 + node_modules/querystring-es3/package.json | 100 + .../querystring-es3/test/common-index.js | 3 + node_modules/querystring-es3/test/index.js | 210 + .../querystring-es3/test/tap-index.js | 3 + node_modules/querystring/.History.md.un~ | Bin 0 -> 7960 bytes node_modules/querystring/.Readme.md.un~ | Bin 0 -> 3225 bytes node_modules/querystring/.package.json.un~ | Bin 0 -> 5710 bytes node_modules/querystring/.travis.yml | 4 + node_modules/querystring/History.md | 20 + node_modules/querystring/License.md | 19 + node_modules/querystring/Readme.md | 15 + node_modules/querystring/decode.js | 80 + node_modules/querystring/encode.js | 64 + node_modules/querystring/index.js | 4 + node_modules/querystring/package.json | 100 + node_modules/querystring/test/.index.js.un~ | Bin 0 -> 975 bytes node_modules/querystring/test/common-index.js | 3 + node_modules/querystring/test/index.js | 210 + node_modules/querystring/test/tap-index.js | 3 + node_modules/randomatic/LICENSE | 21 + node_modules/randomatic/README.md | 193 + node_modules/randomatic/index.js | 95 + .../randomatic/node_modules/is-number/LICENSE | 21 + .../node_modules/is-number/README.md | 135 + .../node_modules/is-number/index.js | 21 + .../node_modules/is-number/package.json | 113 + .../node_modules/kind-of/CHANGELOG.md | 157 + .../randomatic/node_modules/kind-of/LICENSE | 21 + .../randomatic/node_modules/kind-of/README.md | 365 + .../randomatic/node_modules/kind-of/index.js | 129 + .../node_modules/kind-of/package.json | 143 + node_modules/randomatic/package.json | 135 + node_modules/randombytes/.travis.yml | 15 + node_modules/randombytes/.zuul.yml | 1 + node_modules/randombytes/LICENSE | 21 + node_modules/randombytes/README.md | 14 + node_modules/randombytes/browser.js | 38 + node_modules/randombytes/index.js | 1 + node_modules/randombytes/package.json | 65 + node_modules/randombytes/test.js | 56 + node_modules/randomfill/.travis.yml | 15 + node_modules/randomfill/.zuul.yml | 1 + node_modules/randomfill/LICENSE | 21 + node_modules/randomfill/README.md | 15 + node_modules/randomfill/browser.js | 108 + node_modules/randomfill/index.js | 7 + node_modules/randomfill/package.json | 62 + node_modules/randomfill/test.js | 28 + node_modules/range-parser/HISTORY.md | 51 + node_modules/range-parser/LICENSE | 23 + node_modules/range-parser/README.md | 75 + node_modules/range-parser/index.js | 158 + node_modules/range-parser/package.json | 86 + node_modules/read-only-stream/.travis.yml | 6 + node_modules/read-only-stream/LICENSE | 18 + node_modules/read-only-stream/example/main.js | 3 + node_modules/read-only-stream/example/wrap.js | 8 + node_modules/read-only-stream/index.js | 30 + node_modules/read-only-stream/package.json | 63 + node_modules/read-only-stream/readme.markdown | 60 + node_modules/read-only-stream/test/error.js | 15 + node_modules/read-only-stream/test/ro.js | 22 + .../read-only-stream/test/streams1.js | 21 + node_modules/readable-stream/.travis.yml | 55 + node_modules/readable-stream/CONTRIBUTING.md | 38 + node_modules/readable-stream/GOVERNANCE.md | 136 + node_modules/readable-stream/LICENSE | 47 + node_modules/readable-stream/README.md | 58 + .../doc/wg-meetings/2015-01-30.md | 60 + .../readable-stream/duplex-browser.js | 1 + node_modules/readable-stream/duplex.js | 1 + .../readable-stream/lib/_stream_duplex.js | 131 + .../lib/_stream_passthrough.js | 47 + .../readable-stream/lib/_stream_readable.js | 1019 + .../readable-stream/lib/_stream_transform.js | 214 + .../readable-stream/lib/_stream_writable.js | 687 + .../lib/internal/streams/BufferList.js | 79 + .../lib/internal/streams/destroy.js | 74 + .../lib/internal/streams/stream-browser.js | 1 + .../lib/internal/streams/stream.js | 1 + node_modules/readable-stream/package.json | 93 + node_modules/readable-stream/passthrough.js | 1 + .../readable-stream/readable-browser.js | 7 + node_modules/readable-stream/readable.js | 19 + node_modules/readable-stream/transform.js | 1 + .../readable-stream/writable-browser.js | 1 + node_modules/readable-stream/writable.js | 8 + node_modules/readdirp/LICENSE | 20 + node_modules/readdirp/README.md | 204 + .../readdirp/node_modules/arr-diff/LICENSE | 21 + .../readdirp/node_modules/arr-diff/README.md | 130 + .../readdirp/node_modules/arr-diff/index.js | 47 + .../node_modules/arr-diff/package.json | 108 + .../node_modules/array-unique/LICENSE | 21 + .../node_modules/array-unique/README.md | 77 + .../node_modules/array-unique/index.js | 43 + .../node_modules/array-unique/package.json | 95 + .../readdirp/node_modules/braces/LICENSE | 21 + .../readdirp/node_modules/braces/README.md | 640 + .../readdirp/node_modules/braces/index.js | 318 + .../node_modules/braces/lib/braces.js | 104 + .../node_modules/braces/lib/compilers.js | 282 + .../node_modules/braces/lib/parsers.js | 360 + .../readdirp/node_modules/braces/lib/utils.js | 343 + .../node_modules/extend-shallow/LICENSE | 21 + .../node_modules/extend-shallow/README.md | 61 + .../node_modules/extend-shallow/index.js | 33 + .../node_modules/extend-shallow/package.json | 87 + .../readdirp/node_modules/braces/package.json | 156 + .../node_modules/expand-brackets/LICENSE | 21 + .../node_modules/expand-brackets/README.md | 302 + .../node_modules/expand-brackets/changelog.md | 35 + .../node_modules/expand-brackets/index.js | 211 + .../expand-brackets/lib/compilers.js | 87 + .../expand-brackets/lib/parsers.js | 219 + .../node_modules/expand-brackets/lib/utils.js | 34 + .../node_modules/define-property/LICENSE | 21 + .../node_modules/define-property/README.md | 77 + .../node_modules/define-property/index.js | 31 + .../node_modules/define-property/package.json | 82 + .../node_modules/extend-shallow/LICENSE | 21 + .../node_modules/extend-shallow/README.md | 61 + .../node_modules/extend-shallow/index.js | 33 + .../node_modules/extend-shallow/package.json | 87 + .../is-accessor-descriptor/LICENSE | 21 + .../is-accessor-descriptor/README.md | 123 + .../is-accessor-descriptor/index.js | 69 + .../node_modules/kind-of/LICENSE | 21 + .../node_modules/kind-of/README.md | 261 + .../node_modules/kind-of/index.js | 116 + .../node_modules/kind-of/package.json | 139 + .../is-accessor-descriptor/package.json | 94 + .../node_modules/is-data-descriptor/LICENSE | 21 + .../node_modules/is-data-descriptor/README.md | 128 + .../node_modules/is-data-descriptor/index.js | 55 + .../node_modules/kind-of/LICENSE | 21 + .../node_modules/kind-of/README.md | 261 + .../node_modules/kind-of/index.js | 116 + .../node_modules/kind-of/package.json | 139 + .../is-data-descriptor/package.json | 93 + .../node_modules/is-descriptor/LICENSE | 21 + .../node_modules/is-descriptor/README.md | 193 + .../node_modules/is-descriptor/index.js | 22 + .../node_modules/is-descriptor/package.json | 114 + .../node_modules/kind-of/LICENSE | 21 + .../node_modules/kind-of/README.md | 342 + .../node_modules/kind-of/index.js | 147 + .../node_modules/kind-of/package.json | 146 + .../node_modules/expand-brackets/package.json | 133 + .../readdirp/node_modules/extglob/LICENSE | 21 + .../readdirp/node_modules/extglob/README.md | 362 + .../node_modules/extglob/changelog.md | 25 + .../readdirp/node_modules/extglob/index.js | 331 + .../node_modules/extglob/lib/.DS_Store | Bin 0 -> 6148 bytes .../node_modules/extglob/lib/compilers.js | 169 + .../node_modules/extglob/lib/extglob.js | 78 + .../node_modules/extglob/lib/parsers.js | 156 + .../node_modules/extglob/lib/utils.js | 69 + .../node_modules/define-property/LICENSE | 21 + .../node_modules/define-property/README.md | 95 + .../node_modules/define-property/index.js | 31 + .../node_modules/define-property/package.json | 93 + .../node_modules/extend-shallow/LICENSE | 21 + .../node_modules/extend-shallow/README.md | 61 + .../node_modules/extend-shallow/index.js | 33 + .../node_modules/extend-shallow/package.json | 87 + .../node_modules/extglob/package.json | 160 + .../readdirp/node_modules/fill-range/LICENSE | 21 + .../node_modules/fill-range/README.md | 250 + .../readdirp/node_modules/fill-range/index.js | 208 + .../node_modules/extend-shallow/LICENSE | 21 + .../node_modules/extend-shallow/README.md | 61 + .../node_modules/extend-shallow/index.js | 33 + .../node_modules/extend-shallow/package.json | 87 + .../node_modules/fill-range/package.json | 130 + .../is-accessor-descriptor/LICENSE | 21 + .../is-accessor-descriptor/README.md | 144 + .../is-accessor-descriptor/index.js | 69 + .../is-accessor-descriptor/package.json | 110 + .../node_modules/is-data-descriptor/LICENSE | 21 + .../node_modules/is-data-descriptor/README.md | 161 + .../node_modules/is-data-descriptor/index.js | 49 + .../is-data-descriptor/package.json | 109 + .../node_modules/is-descriptor/LICENSE | 21 + .../node_modules/is-descriptor/README.md | 193 + .../node_modules/is-descriptor/index.js | 22 + .../node_modules/is-descriptor/package.json | 114 + .../readdirp/node_modules/is-number/LICENSE | 21 + .../readdirp/node_modules/is-number/README.md | 115 + .../readdirp/node_modules/is-number/index.js | 22 + .../is-number/node_modules/kind-of/LICENSE | 21 + .../is-number/node_modules/kind-of/README.md | 261 + .../is-number/node_modules/kind-of/index.js | 116 + .../node_modules/kind-of/package.json | 139 + .../node_modules/is-number/package.json | 123 + .../readdirp/node_modules/isobject/LICENSE | 21 + .../readdirp/node_modules/isobject/README.md | 122 + .../readdirp/node_modules/isobject/index.d.ts | 5 + .../readdirp/node_modules/isobject/index.js | 12 + .../node_modules/isobject/package.json | 119 + .../node_modules/kind-of/CHANGELOG.md | 157 + .../readdirp/node_modules/kind-of/LICENSE | 21 + .../readdirp/node_modules/kind-of/README.md | 365 + .../readdirp/node_modules/kind-of/index.js | 129 + .../node_modules/kind-of/package.json | 146 + .../node_modules/micromatch/CHANGELOG.md | 37 + .../readdirp/node_modules/micromatch/LICENSE | 21 + .../node_modules/micromatch/README.md | 1150 + .../readdirp/node_modules/micromatch/index.js | 877 + .../node_modules/micromatch/lib/.DS_Store | Bin 0 -> 6148 bytes .../node_modules/micromatch/lib/cache.js | 1 + .../node_modules/micromatch/lib/compilers.js | 77 + .../node_modules/micromatch/lib/parsers.js | 83 + .../node_modules/micromatch/lib/utils.js | 309 + .../node_modules/micromatch/package.json | 216 + node_modules/readdirp/package.json | 101 + node_modules/readdirp/readdirp.js | 294 + node_modules/readdirp/stream-api.js | 98 + node_modules/regenerator-runtime/README.md | 31 + node_modules/regenerator-runtime/package.json | 46 + node_modules/regenerator-runtime/path.js | 11 + .../regenerator-runtime/runtime-module.js | 35 + node_modules/regenerator-runtime/runtime.js | 727 + node_modules/regex-cache/LICENSE | 21 + node_modules/regex-cache/README.md | 166 + node_modules/regex-cache/index.js | 68 + node_modules/regex-cache/package.json | 101 + node_modules/regex-not/LICENSE | 21 + node_modules/regex-not/README.md | 133 + node_modules/regex-not/index.js | 72 + node_modules/regex-not/package.json | 98 + node_modules/reload-css/LICENSE.md | 21 + node_modules/reload-css/README.md | 31 + node_modules/reload-css/index.js | 244 + node_modules/reload-css/lib/url.js | 21 + node_modules/reload-css/package.json | 66 + .../remove-trailing-separator/history.md | 17 + .../remove-trailing-separator/index.js | 17 + .../remove-trailing-separator/license | 3 + .../remove-trailing-separator/package.json | 64 + .../remove-trailing-separator/readme.md | 51 + node_modules/repeat-element/LICENSE | 21 + node_modules/repeat-element/README.md | 99 + node_modules/repeat-element/index.js | 18 + node_modules/repeat-element/package.json | 82 + node_modules/repeat-string/LICENSE | 21 + node_modules/repeat-string/README.md | 136 + node_modules/repeat-string/index.js | 70 + node_modules/repeat-string/package.json | 132 + node_modules/resolve-url/.jshintrc | 44 + node_modules/resolve-url/LICENSE | 21 + node_modules/resolve-url/bower.json | 15 + node_modules/resolve-url/changelog.md | 15 + node_modules/resolve-url/component.json | 15 + node_modules/resolve-url/package.json | 68 + node_modules/resolve-url/readme.md | 83 + node_modules/resolve-url/resolve-url.js | 47 + node_modules/resolve-url/test/resolve-url.js | 70 + node_modules/resolve/.editorconfig | 20 + node_modules/resolve/.eslintignore | 1 + node_modules/resolve/.eslintrc | 30 + node_modules/resolve/.travis.yml | 219 + node_modules/resolve/LICENSE | 18 + node_modules/resolve/appveyor.yml | 47 + node_modules/resolve/example/async.js | 5 + node_modules/resolve/example/sync.js | 3 + node_modules/resolve/index.js | 8 + node_modules/resolve/lib/async.js | 206 + node_modules/resolve/lib/caller.js | 8 + node_modules/resolve/lib/core.js | 53 + node_modules/resolve/lib/core.json | 72 + .../resolve/lib/node-modules-paths.js | 45 + node_modules/resolve/lib/sync.js | 132 + node_modules/resolve/package.json | 71 + node_modules/resolve/readme.markdown | 173 + node_modules/resolve/test/.eslintrc | 5 + node_modules/resolve/test/core.js | 82 + node_modules/resolve/test/dotdot.js | 29 + node_modules/resolve/test/dotdot/abc/index.js | 2 + node_modules/resolve/test/dotdot/index.js | 1 + node_modules/resolve/test/faulty_basedir.js | 13 + node_modules/resolve/test/filter.js | 34 + node_modules/resolve/test/filter_sync.js | 26 + node_modules/resolve/test/mock.js | 143 + node_modules/resolve/test/mock_sync.js | 67 + node_modules/resolve/test/module_dir.js | 56 + .../test/module_dir/xmodules/aaa/index.js | 1 + .../test/module_dir/ymodules/aaa/index.js | 1 + .../test/module_dir/zmodules/bbb/main.js | 1 + .../test/module_dir/zmodules/bbb/package.json | 3 + .../resolve/test/node-modules-paths.js | 93 + node_modules/resolve/test/node_path.js | 49 + .../resolve/test/node_path/x/aaa/index.js | 1 + .../resolve/test/node_path/x/ccc/index.js | 1 + .../resolve/test/node_path/y/bbb/index.js | 1 + .../resolve/test/node_path/y/ccc/index.js | 1 + node_modules/resolve/test/nonstring.js | 9 + node_modules/resolve/test/pathfilter.js | 75 + .../resolve/test/pathfilter/deep_ref/main.js | 0 node_modules/resolve/test/precedence.js | 23 + node_modules/resolve/test/precedence/aaa.js | 1 + .../resolve/test/precedence/aaa/index.js | 1 + .../resolve/test/precedence/aaa/main.js | 1 + node_modules/resolve/test/precedence/bbb.js | 1 + .../resolve/test/precedence/bbb/main.js | 1 + node_modules/resolve/test/resolver.js | 402 + .../resolve/test/resolver/baz/doom.js | 0 .../resolve/test/resolver/baz/package.json | 3 + .../resolve/test/resolver/baz/quux.js | 1 + .../resolve/test/resolver/browser_field/a.js | 0 .../resolve/test/resolver/browser_field/b.js | 0 .../test/resolver/browser_field/package.json | 5 + node_modules/resolve/test/resolver/cup.coffee | 1 + .../resolve/test/resolver/dot_main/index.js | 1 + .../test/resolver/dot_main/package.json | 3 + .../test/resolver/dot_slash_main/index.js | 1 + .../test/resolver/dot_slash_main/package.json | 3 + node_modules/resolve/test/resolver/foo.js | 1 + .../test/resolver/incorrect_main/index.js | 2 + .../test/resolver/incorrect_main/package.json | 3 + node_modules/resolve/test/resolver/mug.coffee | 0 node_modules/resolve/test/resolver/mug.js | 0 .../test/resolver/other_path/lib/other-lib.js | 0 .../resolve/test/resolver/other_path/root.js | 0 .../resolve/test/resolver/quux/foo/index.js | 1 + .../resolve/test/resolver/same_names/foo.js | 1 + .../test/resolver/same_names/foo/index.js | 1 + .../resolver/symlinked/_/node_modules/foo.js | 0 .../symlinked/_/symlink_target/.gitkeep | 0 .../test/resolver/without_basedir/main.js | 5 + node_modules/resolve/test/resolver_sync.js | 311 + node_modules/resolve/test/subdirs.js | 13 + node_modules/resolve/test/symlinks.js | 56 + node_modules/resp-modifier/README.md | 14 + node_modules/resp-modifier/index.js | 186 + node_modules/resp-modifier/lib/utils.js | 157 + node_modules/resp-modifier/package.json | 73 + node_modules/ret/LICENSE | 19 + node_modules/ret/README.md | 183 + node_modules/ret/lib/index.js | 282 + node_modules/ret/lib/positions.js | 17 + node_modules/ret/lib/sets.js | 82 + node_modules/ret/lib/types.js | 10 + node_modules/ret/lib/util.js | 111 + node_modules/ret/package.json | 67 + node_modules/right-now/LICENSE.md | 18 + node_modules/right-now/README.md | 28 + node_modules/right-now/browser.js | 7 + node_modules/right-now/index.js | 4 + node_modules/right-now/package.json | 60 + node_modules/ripemd160/CHANGELOG.md | 72 + node_modules/ripemd160/LICENSE | 21 + node_modules/ripemd160/README.md | 27 + node_modules/ripemd160/index.js | 163 + node_modules/ripemd160/package.json | 68 + node_modules/safe-buffer/LICENSE | 21 + node_modules/safe-buffer/README.md | 584 + node_modules/safe-buffer/index.d.ts | 187 + node_modules/safe-buffer/index.js | 62 + node_modules/safe-buffer/package.json | 76 + node_modules/safe-regex/.travis.yml | 4 + node_modules/safe-regex/LICENSE | 18 + node_modules/safe-regex/example/safe.js | 3 + node_modules/safe-regex/index.js | 43 + node_modules/safe-regex/package.json | 74 + node_modules/safe-regex/readme.markdown | 65 + node_modules/safe-regex/test/regex.js | 50 + node_modules/semver/LICENSE | 15 + node_modules/semver/README.md | 399 + node_modules/semver/bin/semver | 153 + node_modules/semver/package.json | 54 + node_modules/semver/range.bnf | 16 + node_modules/semver/semver.js | 1352 + node_modules/send/HISTORY.md | 462 + node_modules/send/LICENSE | 23 + node_modules/send/README.md | 306 + node_modules/send/index.js | 1130 + node_modules/send/package.json | 105 + node_modules/serve-static/HISTORY.md | 433 + node_modules/serve-static/LICENSE | 25 + node_modules/serve-static/README.md | 258 + node_modules/serve-static/index.js | 210 + node_modules/serve-static/package.json | 75 + node_modules/set-value/LICENSE | 21 + node_modules/set-value/README.md | 150 + node_modules/set-value/index.js | 51 + .../node_modules/extend-shallow/LICENSE | 21 + .../node_modules/extend-shallow/README.md | 61 + .../node_modules/extend-shallow/index.js | 33 + .../node_modules/extend-shallow/package.json | 87 + node_modules/set-value/package.json | 120 + node_modules/setprototypeof/LICENSE | 13 + node_modules/setprototypeof/README.md | 26 + node_modules/setprototypeof/index.d.ts | 2 + node_modules/setprototypeof/index.js | 15 + node_modules/setprototypeof/package.json | 52 + node_modules/sha.js/.travis.yml | 17 + node_modules/sha.js/LICENSE | 49 + node_modules/sha.js/README.md | 44 + node_modules/sha.js/bin.js | 41 + node_modules/sha.js/hash.js | 81 + node_modules/sha.js/index.js | 15 + node_modules/sha.js/package.json | 67 + node_modules/sha.js/sha.js | 94 + node_modules/sha.js/sha1.js | 99 + node_modules/sha.js/sha224.js | 53 + node_modules/sha.js/sha256.js | 135 + node_modules/sha.js/sha384.js | 57 + node_modules/sha.js/sha512.js | 260 + node_modules/sha.js/test/hash.js | 75 + node_modules/sha.js/test/test.js | 100 + node_modules/sha.js/test/vectors.js | 72 + node_modules/shasum/.npmignore | 3 + node_modules/shasum/.travis.yml | 4 + node_modules/shasum/LICENSE | 22 + node_modules/shasum/README.md | 15 + node_modules/shasum/browser.js | 13 + node_modules/shasum/index.js | 13 + node_modules/shasum/package.json | 56 + node_modules/shasum/test/index.js | 18 + node_modules/shebang-command/index.js | 19 + node_modules/shebang-command/license | 21 + node_modules/shebang-command/package.json | 71 + node_modules/shebang-command/readme.md | 39 + node_modules/shebang-regex/index.js | 2 + node_modules/shebang-regex/license | 21 + node_modules/shebang-regex/package.json | 64 + node_modules/shebang-regex/readme.md | 29 + node_modules/shell-quote/.travis.yml | 4 + node_modules/shell-quote/LICENSE | 24 + node_modules/shell-quote/example/env.js | 3 + node_modules/shell-quote/example/op.js | 3 + node_modules/shell-quote/example/parse.js | 3 + node_modules/shell-quote/example/quote.js | 3 + node_modules/shell-quote/index.js | 199 + node_modules/shell-quote/package.json | 81 + node_modules/shell-quote/readme.markdown | 142 + node_modules/shell-quote/test/comment.js | 14 + node_modules/shell-quote/test/env.js | 39 + node_modules/shell-quote/test/env_fn.js | 19 + node_modules/shell-quote/test/op.js | 67 + node_modules/shell-quote/test/parse.js | 23 + node_modules/shell-quote/test/quote.js | 33 + node_modules/shell-quote/test/set.js | 29 + node_modules/signal-exit/CHANGELOG.md | 27 + node_modules/signal-exit/LICENSE.txt | 16 + node_modules/signal-exit/README.md | 40 + node_modules/signal-exit/index.js | 157 + node_modules/signal-exit/package.json | 66 + node_modules/signal-exit/signals.js | 53 + node_modules/simple-concat/.travis.yml | 3 + node_modules/simple-concat/LICENSE | 20 + node_modules/simple-concat/README.md | 42 + node_modules/simple-concat/index.js | 14 + node_modules/simple-concat/package.json | 58 + node_modules/simple-concat/test/basic.js | 41 + node_modules/simple-html-index/LICENSE.md | 21 + node_modules/simple-html-index/README.md | 71 + node_modules/simple-html-index/index.js | 24 + node_modules/simple-html-index/package.json | 63 + node_modules/snapdragon-node/LICENSE | 21 + node_modules/snapdragon-node/README.md | 453 + node_modules/snapdragon-node/index.js | 492 + .../node_modules/define-property/LICENSE | 21 + .../node_modules/define-property/README.md | 95 + .../node_modules/define-property/index.js | 31 + .../node_modules/define-property/package.json | 93 + .../is-accessor-descriptor/LICENSE | 21 + .../is-accessor-descriptor/README.md | 144 + .../is-accessor-descriptor/index.js | 69 + .../is-accessor-descriptor/package.json | 110 + .../node_modules/is-data-descriptor/LICENSE | 21 + .../node_modules/is-data-descriptor/README.md | 161 + .../node_modules/is-data-descriptor/index.js | 49 + .../is-data-descriptor/package.json | 109 + .../node_modules/is-descriptor/LICENSE | 21 + .../node_modules/is-descriptor/README.md | 193 + .../node_modules/is-descriptor/index.js | 22 + .../node_modules/is-descriptor/package.json | 114 + .../node_modules/isobject/LICENSE | 21 + .../node_modules/isobject/README.md | 122 + .../node_modules/isobject/index.d.ts | 5 + .../node_modules/isobject/index.js | 12 + .../node_modules/isobject/package.json | 119 + .../node_modules/kind-of/CHANGELOG.md | 157 + .../node_modules/kind-of/LICENSE | 21 + .../node_modules/kind-of/README.md | 365 + .../node_modules/kind-of/index.js | 129 + .../node_modules/kind-of/package.json | 145 + node_modules/snapdragon-node/package.json | 107 + node_modules/snapdragon-util/LICENSE | 21 + node_modules/snapdragon-util/README.md | 807 + node_modules/snapdragon-util/index.js | 1019 + node_modules/snapdragon-util/package.json | 96 + node_modules/snapdragon/LICENSE | 21 + node_modules/snapdragon/README.md | 321 + node_modules/snapdragon/index.js | 174 + node_modules/snapdragon/lib/compiler.js | 177 + node_modules/snapdragon/lib/parser.js | 533 + node_modules/snapdragon/lib/position.js | 14 + node_modules/snapdragon/lib/source-maps.js | 145 + node_modules/snapdragon/lib/utils.js | 48 + .../node_modules/define-property/LICENSE | 21 + .../node_modules/define-property/README.md | 77 + .../node_modules/define-property/index.js | 31 + .../node_modules/define-property/package.json | 82 + .../node_modules/extend-shallow/LICENSE | 21 + .../node_modules/extend-shallow/README.md | 61 + .../node_modules/extend-shallow/index.js | 33 + .../node_modules/extend-shallow/package.json | 87 + node_modules/snapdragon/package.json | 126 + node_modules/source-map-resolve/.jshintrc | 46 + node_modules/source-map-resolve/.travis.yml | 3 + node_modules/source-map-resolve/LICENSE | 21 + node_modules/source-map-resolve/bower.json | 30 + node_modules/source-map-resolve/changelog.md | 100 + .../source-map-resolve/component.json | 29 + .../generate-source-map-resolve.js | 28 + .../lib/decode-uri-component.js | 11 + .../source-map-resolve/lib/resolve-url.js | 12 + .../lib/source-map-resolve-node.js | 302 + node_modules/source-map-resolve/package.json | 77 + node_modules/source-map-resolve/readme.md | 231 + .../source-map-resolve/source-map-resolve.js | 309 + .../source-map-resolve.js.template | 22 + .../source-map-resolve/test/common.js | 27 + node_modules/source-map-resolve/test/read.js | 105 + .../test/source-map-resolve.js | 1162 + .../source-map-resolve/test/windows.js | 166 + .../source-map-resolve/x-package.json5 | 68 + node_modules/source-map-url/.jshintrc | 43 + node_modules/source-map-url/LICENSE | 21 + node_modules/source-map-url/bower.json | 20 + node_modules/source-map-url/changelog.md | 52 + node_modules/source-map-url/component.json | 18 + node_modules/source-map-url/package.json | 73 + node_modules/source-map-url/readme.md | 97 + node_modules/source-map-url/source-map-url.js | 57 + .../source-map-url/test/source-map-url.js | 402 + node_modules/source-map-url/x-package.json5 | 55 + node_modules/source-map/CHANGELOG.md | 301 + node_modules/source-map/LICENSE | 28 + node_modules/source-map/README.md | 729 + .../source-map/dist/source-map.debug.js | 3091 ++ node_modules/source-map/dist/source-map.js | 3090 ++ .../source-map/dist/source-map.min.js | 2 + .../source-map/dist/source-map.min.js.map | 1 + node_modules/source-map/lib/array-set.js | 121 + node_modules/source-map/lib/base64-vlq.js | 140 + node_modules/source-map/lib/base64.js | 67 + node_modules/source-map/lib/binary-search.js | 111 + node_modules/source-map/lib/mapping-list.js | 79 + node_modules/source-map/lib/quick-sort.js | 114 + .../source-map/lib/source-map-consumer.js | 1082 + .../source-map/lib/source-map-generator.js | 416 + node_modules/source-map/lib/source-node.js | 413 + node_modules/source-map/lib/util.js | 417 + node_modules/source-map/package.json | 213 + node_modules/source-map/source-map.js | 8 + node_modules/split-string/LICENSE | 21 + node_modules/split-string/README.md | 321 + node_modules/split-string/index.js | 171 + node_modules/split-string/package.json | 103 + node_modules/split2/.README.md.un~ | Bin 0 -> 33830 bytes node_modules/split2/.index.js.un~ | Bin 0 -> 108894 bytes node_modules/split2/.npmignore | 7 + node_modules/split2/.package.json.un~ | Bin 0 -> 6123 bytes node_modules/split2/.test.js.un~ | Bin 0 -> 96451 bytes node_modules/split2/.travis.yml | 3 + node_modules/split2/LICENSE | 13 + node_modules/split2/README.md | 74 + node_modules/split2/index.js | 83 + .../split2/node_modules/isarray/README.md | 54 + .../node_modules/isarray/build/build.js | 209 + .../node_modules/isarray/component.json | 19 + .../split2/node_modules/isarray/index.js | 3 + .../split2/node_modules/isarray/package.json | 57 + .../node_modules/readable-stream/.npmignore | 5 + .../node_modules/readable-stream/LICENSE | 18 + .../node_modules/readable-stream/README.md | 15 + .../node_modules/readable-stream/duplex.js | 1 + .../readable-stream/lib/_stream_duplex.js | 89 + .../lib/_stream_passthrough.js | 46 + .../readable-stream/lib/_stream_readable.js | 982 + .../readable-stream/lib/_stream_transform.js | 210 + .../readable-stream/lib/_stream_writable.js | 386 + .../node_modules/readable-stream/package.json | 65 + .../readable-stream/passthrough.js | 1 + .../node_modules/readable-stream/readable.js | 11 + .../node_modules/readable-stream/transform.js | 1 + .../node_modules/readable-stream/writable.js | 1 + .../node_modules/string_decoder/.npmignore | 2 + .../node_modules/string_decoder/LICENSE | 20 + .../node_modules/string_decoder/README.md | 7 + .../node_modules/string_decoder/index.js | 221 + .../node_modules/string_decoder/package.json | 53 + .../split2/node_modules/through2/.npmignore | 3 + .../split2/node_modules/through2/LICENSE | 39 + .../split2/node_modules/through2/README.md | 132 + .../split2/node_modules/through2/package.json | 64 + .../split2/node_modules/through2/through2.js | 96 + node_modules/split2/package.json | 63 + node_modules/split2/test.js | 149 + node_modules/stacked/.jshintrc | 24 + node_modules/stacked/.npmignore | 2 + node_modules/stacked/.travis.yml | 3 + node_modules/stacked/README.md | 71 + node_modules/stacked/package.json | 57 + node_modules/stacked/stacked.js | 67 + node_modules/stacked/test/stacked.js | 111 + node_modules/static-extend/LICENSE | 21 + node_modules/static-extend/index.js | 90 + .../node_modules/define-property/LICENSE | 21 + .../node_modules/define-property/README.md | 77 + .../node_modules/define-property/index.js | 31 + .../node_modules/define-property/package.json | 82 + node_modules/static-extend/package.json | 96 + node_modules/statuses/HISTORY.md | 60 + node_modules/statuses/LICENSE | 23 + node_modules/statuses/README.md | 127 + node_modules/statuses/codes.json | 65 + node_modules/statuses/index.js | 113 + node_modules/statuses/package.json | 88 + node_modules/stdout-stream/.travis.yml | 6 + node_modules/stdout-stream/LICENSE | 20 + node_modules/stdout-stream/README.md | 45 + node_modules/stdout-stream/index.js | 53 + node_modules/stdout-stream/package.json | 49 + .../stdout-stream/test/fixtures/end.js | 8 + .../test/fixtures/hello-world.js | 4 + node_modules/stdout-stream/test/index.js | 33 + node_modules/stream-browserify/.npmignore | 1 + node_modules/stream-browserify/.travis.yml | 9 + node_modules/stream-browserify/LICENSE | 18 + node_modules/stream-browserify/index.js | 127 + node_modules/stream-browserify/package.json | 79 + .../stream-browserify/readme.markdown | 25 + node_modules/stream-browserify/test/buf.js | 32 + node_modules/stream-combiner2/.npmignore | 3 + node_modules/stream-combiner2/.travis.yml | 6 + node_modules/stream-combiner2/LICENSE | 22 + node_modules/stream-combiner2/README.md | 37 + node_modules/stream-combiner2/index.js | 68 + node_modules/stream-combiner2/package.json | 56 + node_modules/stream-combiner2/test/index.js | 98 + node_modules/stream-http/.airtap.yml | 23 + node_modules/stream-http/.travis.yml | 7 + node_modules/stream-http/LICENSE | 24 + node_modules/stream-http/README.md | 144 + node_modules/stream-http/ie8-polyfill.js | 168 + node_modules/stream-http/index.js | 85 + node_modules/stream-http/lib/capability.js | 73 + node_modules/stream-http/lib/request.js | 327 + node_modules/stream-http/lib/response.js | 224 + node_modules/stream-http/package.json | 73 + .../stream-http/test/browser/abort.js | 55 + node_modules/stream-http/test/browser/auth.js | 22 + .../test/browser/binary-streaming.js | 71 + .../stream-http/test/browser/binary.js | 32 + .../stream-http/test/browser/body-empty.js | 29 + .../stream-http/test/browser/cookie.js | 25 + .../stream-http/test/browser/disable-fetch.js | 37 + .../test/browser/error.js.disabled | 12 + .../stream-http/test/browser/headers.js | 116 + .../test/browser/lib/webworker-worker.js | 20 + .../stream-http/test/browser/package.json | 5 + .../stream-http/test/browser/post-binary.js | 41 + .../stream-http/test/browser/post-text.js | 48 + .../test/browser/text-streaming.js | 43 + node_modules/stream-http/test/browser/text.js | 43 + .../stream-http/test/browser/timeout.js | 43 + .../stream-http/test/browser/webworker.js | 31 + .../stream-http/test/node/http-browserify.js | 147 + node_modules/stream-http/test/server/index.js | 137 + .../stream-http/test/server/static/basic.txt | 19 + .../test/server/static/browserify.png | Bin 0 -> 31422 bytes .../test/server/static/test-polyfill.js | 9 + node_modules/stream-splicer/.travis.yml | 8 + node_modules/stream-splicer/LICENSE | 18 + node_modules/stream-splicer/example/header.js | 22 + node_modules/stream-splicer/index.js | 196 + node_modules/stream-splicer/package.json | 64 + node_modules/stream-splicer/readme.markdown | 139 + node_modules/stream-splicer/test/combiner.js | 31 + .../stream-splicer/test/combiner_stream.js | 29 + node_modules/stream-splicer/test/empty.js | 17 + .../stream-splicer/test/empty_no_data.js | 13 + node_modules/stream-splicer/test/get.js | 41 + node_modules/stream-splicer/test/multipush.js | 31 + .../stream-splicer/test/multiunshift.js | 31 + node_modules/stream-splicer/test/nested.js | 36 + .../stream-splicer/test/nested_middle.js | 42 + node_modules/stream-splicer/test/pop.js | 46 + node_modules/stream-splicer/test/push.js | 57 + node_modules/stream-splicer/test/shift.js | 46 + node_modules/stream-splicer/test/splice.js | 58 + node_modules/stream-splicer/test/unshift.js | 46 + node_modules/strict-uri-encode/index.js | 6 + node_modules/strict-uri-encode/license | 21 + node_modules/strict-uri-encode/package.json | 62 + node_modules/strict-uri-encode/readme.md | 40 + node_modules/string_decoder/.travis.yml | 50 + node_modules/string_decoder/LICENSE | 48 + node_modules/string_decoder/README.md | 47 + .../string_decoder/lib/string_decoder.js | 296 + node_modules/string_decoder/package.json | 60 + node_modules/strip-ansi/index.js | 6 + node_modules/strip-ansi/license | 21 + .../node_modules/ansi-regex/index.js | 4 + .../node_modules/ansi-regex/license | 21 + .../node_modules/ansi-regex/package.json | 108 + .../node_modules/ansi-regex/readme.md | 39 + node_modules/strip-ansi/package.json | 102 + node_modules/strip-ansi/readme.md | 33 + node_modules/strip-eof/index.js | 15 + node_modules/strip-eof/license | 21 + node_modules/strip-eof/package.json | 71 + node_modules/strip-eof/readme.md | 28 + node_modules/subarg/.travis.yml | 4 + node_modules/subarg/LICENSE | 18 + node_modules/subarg/example/show.js | 3 + node_modules/subarg/index.js | 35 + node_modules/subarg/package.json | 83 + node_modules/subarg/readme.markdown | 55 + node_modules/subarg/test/arg.js | 31 + node_modules/subarg/test/recursive.js | 24 + node_modules/supports-color/cli.js | 28 + node_modules/supports-color/index.js | 32 + node_modules/supports-color/package.json | 82 + node_modules/supports-color/readme.md | 44 + node_modules/syntax-error/.travis.yml | 12 + node_modules/syntax-error/LICENSE | 18 + node_modules/syntax-error/example/check.js | 12 + node_modules/syntax-error/example/src.js | 9 + node_modules/syntax-error/index.js | 57 + node_modules/syntax-error/package.json | 65 + node_modules/syntax-error/readme.markdown | 90 + node_modules/syntax-error/test/check.js | 17 + node_modules/syntax-error/test/esm.js | 23 + node_modules/syntax-error/test/html.js | 16 + node_modules/syntax-error/test/ok.js | 13 + node_modules/syntax-error/test/run.js | 12 + node_modules/syntax-error/test/run2.js | 12 + node_modules/syntax-error/test/shebang.js | 13 + .../syntax-error/test/sources/check.js | 9 + node_modules/syntax-error/test/sources/esm.js | 2 + node_modules/syntax-error/test/sources/ok.js | 1 + node_modules/syntax-error/test/sources/run.js | 1 + .../syntax-error/test/sources/run2.js | 3 + .../syntax-error/test/sources/shebang.js | 2 + .../syntax-error/test/sources/spread.js | 2 + .../syntax-error/test/sources/yield.js | 13 + node_modules/syntax-error/test/spread.js | 13 + node_modules/syntax-error/test/yield.js | 13 + node_modules/term-color/.jshintrc | 35 + node_modules/term-color/.npmignore | 64 + node_modules/term-color/.travis.yml | 7 + node_modules/term-color/LICENSE | 19 + node_modules/term-color/README.md | 99 + node_modules/term-color/index.js | 48 + .../node_modules/.bin/supports-color | 1 + .../node_modules/ansi-styles/index.js | 56 + .../node_modules/ansi-styles/license | 21 + .../node_modules/ansi-styles/package.json | 90 + .../node_modules/ansi-styles/readme.md | 86 + .../node_modules/supports-color/cli.js | 29 + .../node_modules/supports-color/index.js | 43 + .../node_modules/supports-color/license | 21 + .../node_modules/supports-color/package.json | 95 + .../node_modules/supports-color/readme.md | 46 + node_modules/term-color/package.json | 83 + node_modules/term-color/test/index.js | 19 + node_modules/through/.travis.yml | 5 + node_modules/through/LICENSE.APACHE2 | 15 + node_modules/through/LICENSE.MIT | 24 + node_modules/through/index.js | 108 + node_modules/through/package.json | 68 + node_modules/through/readme.markdown | 64 + node_modules/through/test/async.js | 28 + node_modules/through/test/auto-destroy.js | 30 + node_modules/through/test/buffering.js | 71 + node_modules/through/test/end.js | 45 + node_modules/through/test/index.js | 133 + node_modules/through2/.npmignore | 3 + node_modules/through2/LICENSE.html | 336 + node_modules/through2/LICENSE.md | 9 + node_modules/through2/README.md | 136 + node_modules/through2/package.json | 70 + node_modules/through2/through2.js | 96 + node_modules/timers-browserify/.npmignore | 2 + node_modules/timers-browserify/CHANGELOG.md | 58 + node_modules/timers-browserify/LICENSE.md | 46 + node_modules/timers-browserify/README.md | 40 + .../timers-browserify/example/enroll/build.sh | 3 + .../example/enroll/index.html | 8 + .../example/enroll/js/browserify.js | 233 + .../example/enroll/js/main.js | 14 + .../example/enroll/server.js | 11 + node_modules/timers-browserify/main.js | 76 + node_modules/timers-browserify/package.json | 103 + node_modules/to-arraybuffer/.npmignore | 4 + node_modules/to-arraybuffer/.travis.yml | 3 + node_modules/to-arraybuffer/.zuul.yml | 16 + node_modules/to-arraybuffer/LICENSE | 24 + node_modules/to-arraybuffer/README.md | 27 + node_modules/to-arraybuffer/index.js | 27 + node_modules/to-arraybuffer/package.json | 61 + node_modules/to-arraybuffer/test.js | 57 + node_modules/to-object-path/LICENSE | 21 + node_modules/to-object-path/README.md | 71 + node_modules/to-object-path/index.js | 33 + node_modules/to-object-path/package.json | 80 + node_modules/to-regex-range/LICENSE | 21 + node_modules/to-regex-range/README.md | 281 + node_modules/to-regex-range/index.js | 294 + .../node_modules/is-number/LICENSE | 21 + .../node_modules/is-number/README.md | 115 + .../node_modules/is-number/index.js | 22 + .../node_modules/is-number/package.json | 121 + node_modules/to-regex-range/package.json | 119 + node_modules/to-regex/LICENSE | 21 + node_modules/to-regex/README.md | 205 + node_modules/to-regex/index.js | 155 + node_modules/to-regex/package.json | 97 + node_modules/tty-browserify/LICENSE | 18 + node_modules/tty-browserify/index.js | 11 + node_modules/tty-browserify/package.json | 57 + node_modules/tty-browserify/readme.markdown | 1 + node_modules/typedarray/.travis.yml | 4 + node_modules/typedarray/LICENSE | 35 + node_modules/typedarray/example/tarray.js | 4 + node_modules/typedarray/index.js | 630 + node_modules/typedarray/package.json | 83 + node_modules/typedarray/readme.markdown | 61 + .../typedarray/test/server/undef_globals.js | 19 + node_modules/typedarray/test/tarray.js | 10 + node_modules/ultron/.npmignore | 3 + node_modules/ultron/.travis.yml | 21 + node_modules/ultron/LICENSE | 22 + node_modules/ultron/README.md | 97 + node_modules/ultron/index.js | 129 + node_modules/ultron/package.json | 68 + node_modules/ultron/test.js | 327 + node_modules/umd/HISTORY.md | 64 + node_modules/umd/LICENSE | 19 + node_modules/umd/README.md | 82 + node_modules/umd/bin/cli.js | 43 + node_modules/umd/index.js | 78 + node_modules/umd/package.json | 61 + .../undeclared-identifiers/.travis.yml | 9 + .../undeclared-identifiers/CHANGELOG.md | 19 + .../undeclared-identifiers/LICENSE.md | 15 + node_modules/undeclared-identifiers/README.md | 55 + .../undeclared-identifiers/bench/index.js | 44 + node_modules/undeclared-identifiers/bin.js | 29 + node_modules/undeclared-identifiers/index.js | 127 + .../undeclared-identifiers/package.json | 72 + .../undeclared-identifiers/test/index.js | 198 + node_modules/union-value/LICENSE | 21 + node_modules/union-value/README.md | 73 + node_modules/union-value/index.js | 30 + .../node_modules/extend-shallow/LICENSE | 21 + .../node_modules/extend-shallow/README.md | 61 + .../node_modules/extend-shallow/index.js | 33 + .../node_modules/extend-shallow/package.json | 87 + .../node_modules/set-value/LICENSE | 21 + .../node_modules/set-value/README.md | 81 + .../node_modules/set-value/index.js | 63 + .../node_modules/set-value/package.json | 121 + node_modules/union-value/package.json | 105 + node_modules/unset-value/LICENSE | 21 + node_modules/unset-value/README.md | 131 + node_modules/unset-value/index.js | 32 + .../node_modules/has-value/LICENSE | 21 + .../node_modules/has-value/README.md | 130 + .../node_modules/has-value/index.js | 19 + .../has-value/node_modules/isobject/LICENSE | 21 + .../has-value/node_modules/isobject/README.md | 112 + .../has-value/node_modules/isobject/index.js | 14 + .../node_modules/isobject/package.json | 98 + .../node_modules/has-value/package.json | 114 + .../node_modules/has-values/LICENSE | 21 + .../node_modules/has-values/README.md | 114 + .../node_modules/has-values/index.js | 36 + .../node_modules/has-values/package.json | 106 + .../unset-value/node_modules/isobject/LICENSE | 21 + .../node_modules/isobject/README.md | 122 + .../node_modules/isobject/index.d.ts | 5 + .../node_modules/isobject/index.js | 12 + .../node_modules/isobject/package.json | 119 + node_modules/unset-value/package.json | 112 + node_modules/urix/.jshintrc | 42 + node_modules/urix/LICENSE | 21 + node_modules/urix/index.js | 17 + node_modules/urix/package.json | 59 + node_modules/urix/readme.md | 46 + node_modules/urix/test/index.js | 43 + node_modules/url-trim/LICENSE.md | 21 + node_modules/url-trim/README.md | 37 + node_modules/url-trim/index.js | 13 + node_modules/url-trim/package.json | 70 + node_modules/url/.npmignore | 1 + node_modules/url/.travis.yml | 7 + node_modules/url/.zuul.yml | 16 + node_modules/url/LICENSE | 21 + node_modules/url/README.md | 108 + .../url/node_modules/punycode/LICENSE-MIT.txt | 20 + .../url/node_modules/punycode/README.md | 176 + .../url/node_modules/punycode/package.json | 80 + .../url/node_modules/punycode/punycode.js | 530 + node_modules/url/package.json | 53 + node_modules/url/test.js | 1599 + node_modules/url/url.js | 732 + node_modules/url/util.js | 16 + node_modules/use/LICENSE | 21 + node_modules/use/README.md | 90 + node_modules/use/index.js | 155 + node_modules/use/package.json | 108 + node_modules/util-deprecate/History.md | 16 + node_modules/util-deprecate/LICENSE | 24 + node_modules/util-deprecate/README.md | 53 + node_modules/util-deprecate/browser.js | 67 + node_modules/util-deprecate/node.js | 6 + node_modules/util-deprecate/package.json | 56 + node_modules/util/LICENSE | 18 + node_modules/util/README.md | 15 + node_modules/util/package.json | 63 + node_modules/util/support/isBuffer.js | 3 + node_modules/util/support/isBufferBrowser.js | 6 + node_modules/util/util.js | 586 + node_modules/vm-browserify/.travis.yml | 6 + node_modules/vm-browserify/CHANGELOG.md | 16 + node_modules/vm-browserify/LICENSE | 18 + .../vm-browserify/example/run/bundle.js | 473 + .../vm-browserify/example/run/entry.js | 6 + .../vm-browserify/example/run/index.html | 9 + .../vm-browserify/example/run/server.js | 6 + node_modules/vm-browserify/index.js | 149 + node_modules/vm-browserify/package.json | 59 + node_modules/vm-browserify/readme.markdown | 67 + node_modules/vm-browserify/test/vm.js | 35 + node_modules/watchify-middleware/LICENSE.md | 21 + node_modules/watchify-middleware/README.md | 154 + .../watchify-middleware/example/app.js | 5 + .../watchify-middleware/example/server.js | 49 + node_modules/watchify-middleware/index.js | 57 + .../watchify-middleware/lib/bundler.js | 133 + .../watchify-middleware/lib/parse-error.js | 9 + node_modules/watchify-middleware/package.json | 84 + node_modules/watchify/.travis.yml | 6 + node_modules/watchify/LICENSE | 18 + node_modules/watchify/bin/args.js | 16 + node_modules/watchify/bin/cmd.js | 69 + node_modules/watchify/example/files/main.js | 2 + node_modules/watchify/example/files/one.js | 3 + node_modules/watchify/example/files/two.js | 1 + node_modules/watchify/index.js | 165 + node_modules/watchify/package.json | 76 + node_modules/watchify/readme.markdown | 233 + node_modules/watchify/test/api.js | 44 + node_modules/watchify/test/api_brfs.js | 53 + .../watchify/test/api_ignore_watch.js | 60 + .../watchify/test/api_ignore_watch_default.js | 60 + .../test/api_ignore_watch_multiple.js | 60 + .../watchify/test/api_implicit_cache.js | 44 + node_modules/watchify/test/bin.js | 52 + node_modules/watchify/test/bin_brfs.js | 62 + .../watchify/test/bin_ignore_watch.js | 71 + .../watchify/test/bin_ignore_watch_default.js | 71 + .../test/bin_ignore_watch_multiple.js | 72 + node_modules/watchify/test/bin_pipe.js | 56 + .../bin_plugins_pipelining_multiple_errors.js | 56 + node_modules/watchify/test/bin_standalone.js | 52 + node_modules/watchify/test/errors.js | 56 + .../watchify/test/errors_transform.js | 83 + node_modules/watchify/test/expose.js | 72 + node_modules/watchify/test/many.js | 101 + node_modules/watchify/test/many_immediate.js | 99 + node_modules/watchify/test/zzz.js | 10 + node_modules/which/CHANGELOG.md | 152 + node_modules/which/LICENSE | 15 + node_modules/which/README.md | 51 + node_modules/which/bin/which | 52 + node_modules/which/package.json | 66 + node_modules/which/which.js | 135 + node_modules/wrappy/LICENSE | 15 + node_modules/wrappy/README.md | 36 + node_modules/wrappy/package.json | 60 + node_modules/wrappy/wrappy.js | 33 + node_modules/ws/README.md | 235 + node_modules/ws/index.js | 49 + node_modules/ws/lib/.DS_Store | Bin 0 -> 6148 bytes node_modules/ws/lib/BufferPool.js | 63 + node_modules/ws/lib/BufferUtil.fallback.js | 47 + node_modules/ws/lib/BufferUtil.js | 17 + node_modules/ws/lib/ErrorCodes.js | 24 + node_modules/ws/lib/Extensions.js | 81 + node_modules/ws/lib/PerMessageDeflate.js | 337 + node_modules/ws/lib/Receiver.hixie.js | 194 + node_modules/ws/lib/Receiver.js | 793 + node_modules/ws/lib/Sender.hixie.js | 124 + node_modules/ws/lib/Sender.js | 310 + node_modules/ws/lib/Validation.fallback.js | 11 + node_modules/ws/lib/Validation.js | 19 + node_modules/ws/lib/WebSocket.js | 987 + node_modules/ws/lib/WebSocketServer.js | 554 + node_modules/ws/package.json | 76 + node_modules/xtend/.jshintrc | 30 + node_modules/xtend/.npmignore | 1 + node_modules/xtend/LICENCE | 19 + node_modules/xtend/Makefile | 4 + node_modules/xtend/README.md | 32 + node_modules/xtend/immutable.js | 19 + node_modules/xtend/mutable.js | 17 + node_modules/xtend/package.json | 95 + node_modules/xtend/test.js | 83 + package-lock.json | 4234 +++ package.json | 30 + src/index.js | 147 + 5453 files changed, 439110 insertions(+), 490 deletions(-) delete mode 100644 JudgingCriteria.md delete mode 100644 LICENSE delete mode 100644 PiratesCode.md delete mode 100644 README.md create mode 100644 bundle.js create mode 100644 index.html create mode 100644 json_s/1.json create mode 100644 json_s/10.json create mode 100644 json_s/2.json create mode 100644 json_s/3.json create mode 100644 json_s/4.json create mode 100644 json_s/5.json create mode 100644 json_s/6.json create mode 100644 json_s/7.json create mode 100644 json_s/8.json create mode 100644 json_s/9.json create mode 120000 node_modules/.bin/JSONStream create mode 120000 node_modules/.bin/acorn create mode 120000 node_modules/.bin/atob create mode 120000 node_modules/.bin/browser-pack create mode 120000 node_modules/.bin/browserify create mode 120000 node_modules/.bin/budo create mode 120000 node_modules/.bin/deps-sort create mode 120000 node_modules/.bin/detective create mode 120000 node_modules/.bin/garnish create mode 120000 node_modules/.bin/has-ansi create mode 120000 node_modules/.bin/insert-module-globals create mode 120000 node_modules/.bin/miller-rabin create mode 120000 node_modules/.bin/mime create mode 120000 node_modules/.bin/mkdirp create mode 120000 node_modules/.bin/module-deps create mode 120000 node_modules/.bin/semver create mode 120000 node_modules/.bin/sha.js create mode 120000 node_modules/.bin/supports-color create mode 120000 node_modules/.bin/umd create mode 120000 node_modules/.bin/undeclared-identifiers create mode 120000 node_modules/.bin/watchify create mode 120000 node_modules/.bin/which create mode 100644 node_modules/@babel/polyfill/LICENSE create mode 100644 node_modules/@babel/polyfill/README.md create mode 100644 node_modules/@babel/polyfill/browser.js create mode 100644 node_modules/@babel/polyfill/dist/polyfill.js create mode 100644 node_modules/@babel/polyfill/dist/polyfill.min.js create mode 100644 node_modules/@babel/polyfill/lib/index.js create mode 100644 node_modules/@babel/polyfill/lib/noConflict.js create mode 100644 node_modules/@babel/polyfill/noConflict.js create mode 100644 node_modules/@babel/polyfill/package.json create mode 100755 node_modules/@babel/polyfill/scripts/build-dist.sh create mode 100644 node_modules/@babel/polyfill/scripts/postpublish.js create mode 100644 node_modules/@babel/polyfill/scripts/prepublish.js create mode 100644 node_modules/JSONStream/.travis.yml create mode 100644 node_modules/JSONStream/LICENSE.APACHE2 create mode 100644 node_modules/JSONStream/LICENSE.MIT create mode 100755 node_modules/JSONStream/bin.js create mode 100644 node_modules/JSONStream/examples/all_docs.js create mode 100755 node_modules/JSONStream/index.js create mode 100644 node_modules/JSONStream/package.json create mode 100644 node_modules/JSONStream/readme.markdown create mode 100644 node_modules/JSONStream/test/bool.js create mode 100644 node_modules/JSONStream/test/browser.js create mode 100644 node_modules/JSONStream/test/destroy_missing.js create mode 100644 node_modules/JSONStream/test/doubledot1.js create mode 100644 node_modules/JSONStream/test/doubledot2.js create mode 100644 node_modules/JSONStream/test/empty.js create mode 100644 node_modules/JSONStream/test/error_contents.js create mode 100644 node_modules/JSONStream/test/fixtures/all_npm.json create mode 100644 node_modules/JSONStream/test/fixtures/couch_sample.json create mode 100644 node_modules/JSONStream/test/fixtures/depth.json create mode 100644 node_modules/JSONStream/test/fixtures/error.json create mode 100644 node_modules/JSONStream/test/fixtures/header_footer.json create mode 100644 node_modules/JSONStream/test/fn.js create mode 100644 node_modules/JSONStream/test/gen.js create mode 100644 node_modules/JSONStream/test/header_footer.js create mode 100644 node_modules/JSONStream/test/issues.js create mode 100644 node_modules/JSONStream/test/keys.js create mode 100644 node_modules/JSONStream/test/map.js create mode 100644 node_modules/JSONStream/test/multiple_objects.js create mode 100644 node_modules/JSONStream/test/multiple_objects_error.js create mode 100644 node_modules/JSONStream/test/null.js create mode 100644 node_modules/JSONStream/test/parsejson.js create mode 100644 node_modules/JSONStream/test/run.js create mode 100644 node_modules/JSONStream/test/stringify.js create mode 100644 node_modules/JSONStream/test/stringify_object.js create mode 100644 node_modules/JSONStream/test/test.js create mode 100644 node_modules/JSONStream/test/test2.js create mode 100644 node_modules/JSONStream/test/two-ways.js create mode 100644 node_modules/acorn-dynamic-import/CHANGELOG.md create mode 100755 node_modules/acorn-dynamic-import/LICENSE create mode 100755 node_modules/acorn-dynamic-import/README.md create mode 100644 node_modules/acorn-dynamic-import/lib/index.js create mode 100644 node_modules/acorn-dynamic-import/lib/walk.js create mode 100644 node_modules/acorn-dynamic-import/package.json create mode 100644 node_modules/acorn-dynamic-import/src/index.js create mode 100644 node_modules/acorn-dynamic-import/src/walk.js create mode 100644 node_modules/acorn-node/.travis.yml create mode 100644 node_modules/acorn-node/CHANGELOG.md create mode 100644 node_modules/acorn-node/LICENSE.md create mode 100644 node_modules/acorn-node/README.md create mode 100644 node_modules/acorn-node/build.js create mode 100644 node_modules/acorn-node/index.js create mode 100644 node_modules/acorn-node/lib/bigint/index.js create mode 100644 node_modules/acorn-node/lib/import-meta/index.js create mode 100644 node_modules/acorn-node/package.json create mode 100644 node_modules/acorn-node/test/index.js create mode 100644 node_modules/acorn-node/walk.js create mode 100644 node_modules/acorn-walk/CHANGELOG.md create mode 100644 node_modules/acorn-walk/LICENSE create mode 100644 node_modules/acorn-walk/README.md create mode 100644 node_modules/acorn-walk/dist/walk.es.js create mode 100644 node_modules/acorn-walk/dist/walk.es.js.map create mode 100644 node_modules/acorn-walk/dist/walk.js create mode 100644 node_modules/acorn-walk/dist/walk.js.map create mode 100644 node_modules/acorn-walk/package.json create mode 100644 node_modules/acorn/CHANGELOG.md create mode 100644 node_modules/acorn/LICENSE create mode 100644 node_modules/acorn/README.md create mode 100755 node_modules/acorn/bin/acorn create mode 100644 node_modules/acorn/dist/acorn.d.ts create mode 100644 node_modules/acorn/dist/acorn.js create mode 100644 node_modules/acorn/dist/acorn.js.map create mode 100644 node_modules/acorn/dist/acorn.mjs create mode 100644 node_modules/acorn/dist/acorn.mjs.map create mode 100644 node_modules/acorn/dist/bin.js create mode 100644 node_modules/acorn/package.json create mode 100644 node_modules/ansi-regex/index.js create mode 100644 node_modules/ansi-regex/package.json create mode 100644 node_modules/ansi-regex/readme.md create mode 100644 node_modules/ansi-styles/index.js create mode 100644 node_modules/ansi-styles/package.json create mode 100644 node_modules/ansi-styles/readme.md create mode 100644 node_modules/anymatch/LICENSE create mode 100644 node_modules/anymatch/README.md create mode 100644 node_modules/anymatch/index.js create mode 100644 node_modules/anymatch/package.json create mode 100755 node_modules/arr-diff/LICENSE create mode 100644 node_modules/arr-diff/README.md create mode 100644 node_modules/arr-diff/index.js create mode 100644 node_modules/arr-diff/package.json create mode 100755 node_modules/arr-flatten/LICENSE create mode 100755 node_modules/arr-flatten/README.md create mode 100644 node_modules/arr-flatten/index.js create mode 100644 node_modules/arr-flatten/package.json create mode 100644 node_modules/arr-union/LICENSE create mode 100644 node_modules/arr-union/README.md create mode 100644 node_modules/arr-union/index.js create mode 100644 node_modules/arr-union/package.json create mode 100644 node_modules/array-filter/.npmignore create mode 100644 node_modules/array-filter/.travis.yml create mode 100644 node_modules/array-filter/README.md create mode 100644 node_modules/array-filter/index.js create mode 100644 node_modules/array-filter/package.json create mode 100644 node_modules/array-filter/test/filter.js create mode 100644 node_modules/array-filter/test/holes.js create mode 100644 node_modules/array-map/.travis.yml create mode 100644 node_modules/array-map/LICENSE create mode 100644 node_modules/array-map/example/map.js create mode 100644 node_modules/array-map/index.js create mode 100644 node_modules/array-map/package.json create mode 100644 node_modules/array-map/readme.markdown create mode 100644 node_modules/array-map/test/map.js create mode 100644 node_modules/array-reduce/.travis.yml create mode 100644 node_modules/array-reduce/LICENSE create mode 100644 node_modules/array-reduce/example/sum.js create mode 100644 node_modules/array-reduce/index.js create mode 100644 node_modules/array-reduce/package.json create mode 100644 node_modules/array-reduce/readme.markdown create mode 100644 node_modules/array-reduce/test/reduce.js create mode 100755 node_modules/array-unique/LICENSE create mode 100755 node_modules/array-unique/README.md create mode 100755 node_modules/array-unique/index.js create mode 100755 node_modules/array-unique/package.json create mode 100644 node_modules/asn1.js/README.md create mode 100644 node_modules/asn1.js/lib/asn1.js create mode 100644 node_modules/asn1.js/lib/asn1/api.js create mode 100644 node_modules/asn1.js/lib/asn1/base/buffer.js create mode 100644 node_modules/asn1.js/lib/asn1/base/index.js create mode 100644 node_modules/asn1.js/lib/asn1/base/node.js create mode 100644 node_modules/asn1.js/lib/asn1/base/reporter.js create mode 100644 node_modules/asn1.js/lib/asn1/constants/der.js create mode 100644 node_modules/asn1.js/lib/asn1/constants/index.js create mode 100644 node_modules/asn1.js/lib/asn1/decoders/der.js create mode 100644 node_modules/asn1.js/lib/asn1/decoders/index.js create mode 100644 node_modules/asn1.js/lib/asn1/decoders/pem.js create mode 100644 node_modules/asn1.js/lib/asn1/encoders/der.js create mode 100644 node_modules/asn1.js/lib/asn1/encoders/index.js create mode 100644 node_modules/asn1.js/lib/asn1/encoders/pem.js create mode 100644 node_modules/asn1.js/package.json create mode 100644 node_modules/assert/.npmignore create mode 100644 node_modules/assert/.travis.yml create mode 100644 node_modules/assert/.zuul.yml create mode 100644 node_modules/assert/LICENSE create mode 100644 node_modules/assert/README.md create mode 100644 node_modules/assert/assert.js create mode 100644 node_modules/assert/node_modules/inherits/LICENSE create mode 100644 node_modules/assert/node_modules/inherits/README.md create mode 100644 node_modules/assert/node_modules/inherits/inherits.js create mode 100644 node_modules/assert/node_modules/inherits/inherits_browser.js create mode 100644 node_modules/assert/node_modules/inherits/package.json create mode 100644 node_modules/assert/node_modules/inherits/test.js create mode 100644 node_modules/assert/node_modules/util/.npmignore create mode 100644 node_modules/assert/node_modules/util/.travis.yml create mode 100644 node_modules/assert/node_modules/util/.zuul.yml create mode 100644 node_modules/assert/node_modules/util/LICENSE create mode 100644 node_modules/assert/node_modules/util/README.md create mode 100644 node_modules/assert/node_modules/util/package.json create mode 100644 node_modules/assert/node_modules/util/support/isBuffer.js create mode 100644 node_modules/assert/node_modules/util/support/isBufferBrowser.js create mode 100644 node_modules/assert/node_modules/util/test/browser/inspect.js create mode 100644 node_modules/assert/node_modules/util/test/browser/is.js create mode 100644 node_modules/assert/node_modules/util/test/node/debug.js create mode 100644 node_modules/assert/node_modules/util/test/node/format.js create mode 100644 node_modules/assert/node_modules/util/test/node/inspect.js create mode 100644 node_modules/assert/node_modules/util/test/node/log.js create mode 100644 node_modules/assert/node_modules/util/test/node/util.js create mode 100644 node_modules/assert/node_modules/util/util.js create mode 100644 node_modules/assert/package.json create mode 100644 node_modules/assert/test.js create mode 100644 node_modules/assign-symbols/LICENSE create mode 100644 node_modules/assign-symbols/README.md create mode 100644 node_modules/assign-symbols/index.js create mode 100644 node_modules/assign-symbols/package.json create mode 100644 node_modules/async-each/.npmignore create mode 100644 node_modules/async-each/CHANGELOG.md create mode 100644 node_modules/async-each/README.md create mode 100644 node_modules/async-each/index.js create mode 100644 node_modules/async-each/package.json create mode 100644 node_modules/atob/LICENSE create mode 100644 node_modules/atob/LICENSE.DOCS create mode 100644 node_modules/atob/README.md create mode 100755 node_modules/atob/bin/atob.js create mode 100644 node_modules/atob/bower.json create mode 100644 node_modules/atob/browser-atob.js create mode 100644 node_modules/atob/node-atob.js create mode 100644 node_modules/atob/package.json create mode 100644 node_modules/atob/test.js create mode 100644 node_modules/balanced-match/.npmignore create mode 100644 node_modules/balanced-match/LICENSE.md create mode 100644 node_modules/balanced-match/README.md create mode 100644 node_modules/balanced-match/index.js create mode 100644 node_modules/balanced-match/package.json create mode 100644 node_modules/base/LICENSE create mode 100644 node_modules/base/README.md create mode 100644 node_modules/base/index.js create mode 100644 node_modules/base/node_modules/define-property/LICENSE create mode 100644 node_modules/base/node_modules/define-property/README.md create mode 100644 node_modules/base/node_modules/define-property/index.js create mode 100644 node_modules/base/node_modules/define-property/package.json create mode 100644 node_modules/base/node_modules/is-accessor-descriptor/LICENSE create mode 100644 node_modules/base/node_modules/is-accessor-descriptor/README.md create mode 100644 node_modules/base/node_modules/is-accessor-descriptor/index.js create mode 100644 node_modules/base/node_modules/is-accessor-descriptor/package.json create mode 100644 node_modules/base/node_modules/is-data-descriptor/LICENSE create mode 100644 node_modules/base/node_modules/is-data-descriptor/README.md create mode 100644 node_modules/base/node_modules/is-data-descriptor/index.js create mode 100644 node_modules/base/node_modules/is-data-descriptor/package.json create mode 100644 node_modules/base/node_modules/is-descriptor/LICENSE create mode 100644 node_modules/base/node_modules/is-descriptor/README.md create mode 100644 node_modules/base/node_modules/is-descriptor/index.js create mode 100644 node_modules/base/node_modules/is-descriptor/package.json create mode 100644 node_modules/base/node_modules/isobject/LICENSE create mode 100644 node_modules/base/node_modules/isobject/README.md create mode 100644 node_modules/base/node_modules/isobject/index.d.ts create mode 100644 node_modules/base/node_modules/isobject/index.js create mode 100644 node_modules/base/node_modules/isobject/package.json create mode 100644 node_modules/base/node_modules/kind-of/CHANGELOG.md create mode 100644 node_modules/base/node_modules/kind-of/LICENSE create mode 100644 node_modules/base/node_modules/kind-of/README.md create mode 100644 node_modules/base/node_modules/kind-of/index.js create mode 100644 node_modules/base/node_modules/kind-of/package.json create mode 100644 node_modules/base/package.json create mode 100644 node_modules/base64-js/LICENSE create mode 100644 node_modules/base64-js/README.md create mode 100644 node_modules/base64-js/base64js.min.js create mode 100644 node_modules/base64-js/index.js create mode 100644 node_modules/base64-js/package.json create mode 100644 node_modules/base64-js/test/big-data.js create mode 100644 node_modules/base64-js/test/convert.js create mode 100644 node_modules/base64-js/test/corrupt.js create mode 100644 node_modules/base64-js/test/url-safe.js create mode 100644 node_modules/bel/.travis.yml create mode 100644 node_modules/bel/README.md create mode 100644 node_modules/bel/appendChild.js create mode 100644 node_modules/bel/bel.d.ts create mode 100644 node_modules/bel/bench/bench.js create mode 100644 node_modules/bel/bench/create-trees.js create mode 100644 node_modules/bel/bench/index.js create mode 100644 node_modules/bel/browser.js create mode 100644 node_modules/bel/index.js create mode 100644 node_modules/bel/package.json create mode 100644 node_modules/bel/raw.js create mode 100644 node_modules/bel/test/api.js create mode 100644 node_modules/bel/test/elements.js create mode 100644 node_modules/bel/test/events.js create mode 100644 node_modules/bel/test/index.js create mode 100644 node_modules/bel/test/raw.js create mode 100644 node_modules/bel/test/server.js create mode 100644 node_modules/binary-extensions/binary-extensions.json create mode 100644 node_modules/binary-extensions/license create mode 100644 node_modules/binary-extensions/package.json create mode 100644 node_modules/binary-extensions/readme.md create mode 100644 node_modules/bn.js/.npmignore create mode 100644 node_modules/bn.js/README.md create mode 100644 node_modules/bn.js/lib/bn.js create mode 100644 node_modules/bn.js/package.json create mode 100644 node_modules/bn.js/util/genCombMulTo.js create mode 100644 node_modules/bn.js/util/genCombMulTo10.js create mode 100644 node_modules/bole/.jshintrc create mode 100644 node_modules/bole/.npmignore create mode 100644 node_modules/bole/LICENSE.md create mode 100644 node_modules/bole/README.md create mode 100644 node_modules/bole/bole.js create mode 100644 node_modules/bole/package.json create mode 100644 node_modules/bole/test.js create mode 100644 node_modules/brace-expansion/LICENSE create mode 100644 node_modules/brace-expansion/README.md create mode 100644 node_modules/brace-expansion/index.js create mode 100644 node_modules/brace-expansion/package.json create mode 100644 node_modules/braces/LICENSE create mode 100644 node_modules/braces/README.md create mode 100644 node_modules/braces/index.js create mode 100644 node_modules/braces/package.json create mode 100644 node_modules/brorand/.npmignore create mode 100644 node_modules/brorand/README.md create mode 100644 node_modules/brorand/index.js create mode 100644 node_modules/brorand/package.json create mode 100644 node_modules/brorand/test/api-test.js create mode 100644 node_modules/browser-pack/.travis.yml create mode 100644 node_modules/browser-pack/CHANGELOG.md create mode 100644 node_modules/browser-pack/LICENSE create mode 100644 node_modules/browser-pack/_prelude.js create mode 100755 node_modules/browser-pack/bin/cmd.js create mode 100755 node_modules/browser-pack/bin/prepublish.js create mode 100644 node_modules/browser-pack/example/input.json create mode 100644 node_modules/browser-pack/example/output.js create mode 100644 node_modules/browser-pack/example/sourcemap/input.json create mode 100644 node_modules/browser-pack/example/sourcemap/output.js create mode 100644 node_modules/browser-pack/index.js create mode 100644 node_modules/browser-pack/package.json create mode 100644 node_modules/browser-pack/prelude.js create mode 100644 node_modules/browser-pack/readme.markdown create mode 100644 node_modules/browser-pack/test/comment.js create mode 100644 node_modules/browser-pack/test/empty.js create mode 100644 node_modules/browser-pack/test/not_found.js create mode 100644 node_modules/browser-pack/test/only_execute_entries.js create mode 100644 node_modules/browser-pack/test/order.js create mode 100644 node_modules/browser-pack/test/pack.js create mode 100644 node_modules/browser-pack/test/raw.js create mode 100644 node_modules/browser-pack/test/source-maps-existing.js create mode 100644 node_modules/browser-pack/test/source-maps.js create mode 100644 node_modules/browser-pack/test/this.js create mode 100644 node_modules/browser-pack/test/unicode.js create mode 100644 node_modules/browser-resolve/LICENSE create mode 100644 node_modules/browser-resolve/README.md create mode 100644 node_modules/browser-resolve/empty.js create mode 100644 node_modules/browser-resolve/index.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/.travis.yml create mode 100644 node_modules/browser-resolve/node_modules/resolve/LICENSE create mode 100644 node_modules/browser-resolve/node_modules/resolve/example/async.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/example/sync.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/index.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/lib/async.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/lib/caller.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/lib/core.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/lib/core.json create mode 100644 node_modules/browser-resolve/node_modules/resolve/lib/node-modules-paths.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/lib/sync.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/package.json create mode 100644 node_modules/browser-resolve/node_modules/resolve/readme.markdown create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/core.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/dotdot.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/dotdot/abc/index.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/dotdot/index.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/faulty_basedir.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/filter.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/filter_sync.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/mock.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/mock_sync.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/module_dir.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/module_dir/xmodules/aaa/index.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/module_dir/ymodules/aaa/index.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/module_dir/zmodules/bbb/main.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/module_dir/zmodules/bbb/package.json create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/node_path.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/node_path/x/aaa/index.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/node_path/x/ccc/index.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/node_path/y/bbb/index.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/node_path/y/ccc/index.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/nonstring.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/pathfilter.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/pathfilter/deep_ref/main.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/alt.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/deeper/ref.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/package.json create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/ref.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/precedence.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/precedence/aaa.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/precedence/aaa/index.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/precedence/aaa/main.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/precedence/bbb.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/precedence/bbb/main.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/bar/node_modules/foo/index.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/baz/doom.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/baz/package.json create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/baz/quux.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/biz/node_modules/garply/lib/index.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/biz/node_modules/garply/package.json create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/biz/node_modules/grux/index.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/biz/node_modules/tiv/index.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/cup.coffee create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/foo.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/incorrect_main/index.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/incorrect_main/package.json create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/mug.coffee create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/mug.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/other_path/lib/other-lib.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/other_path/root.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/punycode/node_modules/punycode/index.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/quux/foo/index.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/without_basedir/main.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/without_basedir/node_modules/mymodule.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver_sync.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/subdirs.js create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json create mode 100644 node_modules/browser-resolve/node_modules/resolve/test/subdirs/node_modules/a/package.json create mode 100644 node_modules/browser-resolve/package.json create mode 100644 node_modules/browserify-aes/.travis.yml create mode 100644 node_modules/browserify-aes/LICENSE create mode 100644 node_modules/browserify-aes/README.md create mode 100644 node_modules/browserify-aes/aes.js create mode 100644 node_modules/browserify-aes/authCipher.js create mode 100644 node_modules/browserify-aes/browser.js create mode 100644 node_modules/browserify-aes/decrypter.js create mode 100644 node_modules/browserify-aes/encrypter.js create mode 100644 node_modules/browserify-aes/ghash.js create mode 100644 node_modules/browserify-aes/incr32.js create mode 100644 node_modules/browserify-aes/index.js create mode 100644 node_modules/browserify-aes/modes/cbc.js create mode 100644 node_modules/browserify-aes/modes/cfb.js create mode 100644 node_modules/browserify-aes/modes/cfb1.js create mode 100644 node_modules/browserify-aes/modes/cfb8.js create mode 100644 node_modules/browserify-aes/modes/ctr.js create mode 100644 node_modules/browserify-aes/modes/ecb.js create mode 100644 node_modules/browserify-aes/modes/index.js create mode 100644 node_modules/browserify-aes/modes/list.json create mode 100644 node_modules/browserify-aes/modes/ofb.js create mode 100644 node_modules/browserify-aes/package.json create mode 100644 node_modules/browserify-aes/streamCipher.js create mode 100644 node_modules/browserify-cipher/.travis.yml create mode 100644 node_modules/browserify-cipher/LICENSE create mode 100644 node_modules/browserify-cipher/README.md create mode 100644 node_modules/browserify-cipher/browser.js create mode 100644 node_modules/browserify-cipher/index.js create mode 100644 node_modules/browserify-cipher/package.json create mode 100644 node_modules/browserify-cipher/test.js create mode 100644 node_modules/browserify-des/.travis.yml create mode 100644 node_modules/browserify-des/index.js create mode 100644 node_modules/browserify-des/license create mode 100644 node_modules/browserify-des/modes.js create mode 100644 node_modules/browserify-des/package.json create mode 100644 node_modules/browserify-des/readme.md create mode 100644 node_modules/browserify-des/test.js create mode 100644 node_modules/browserify-rsa/.travis.yml create mode 100644 node_modules/browserify-rsa/LICENSE create mode 100644 node_modules/browserify-rsa/index.js create mode 100644 node_modules/browserify-rsa/package.json create mode 100644 node_modules/browserify-rsa/readme.md create mode 100644 node_modules/browserify-rsa/test.js create mode 100644 node_modules/browserify-sign/LICENSE create mode 100644 node_modules/browserify-sign/README.md create mode 100644 node_modules/browserify-sign/algos.js create mode 100644 node_modules/browserify-sign/browser/algorithms.json create mode 100644 node_modules/browserify-sign/browser/curves.json create mode 100644 node_modules/browserify-sign/browser/index.js create mode 100644 node_modules/browserify-sign/browser/sign.js create mode 100644 node_modules/browserify-sign/browser/verify.js create mode 100644 node_modules/browserify-sign/index.js create mode 100644 node_modules/browserify-sign/package.json create mode 100644 node_modules/browserify-zlib/.npmignore create mode 100644 node_modules/browserify-zlib/.travis.yml create mode 100644 node_modules/browserify-zlib/LICENSE create mode 100644 node_modules/browserify-zlib/README.md create mode 100644 node_modules/browserify-zlib/karma.conf.js create mode 100644 node_modules/browserify-zlib/lib/binding.js create mode 100644 node_modules/browserify-zlib/lib/index.js create mode 100644 node_modules/browserify-zlib/package.json create mode 100644 node_modules/browserify-zlib/src/binding.js create mode 100644 node_modules/browserify-zlib/src/index.js create mode 100644 node_modules/browserify-zlib/yarn.lock create mode 100644 node_modules/browserify/.travis.yml create mode 100644 node_modules/browserify/LICENSE create mode 100644 node_modules/browserify/appveyor.yml create mode 100644 node_modules/browserify/assets/browserify.png create mode 100644 node_modules/browserify/assets/logo.png create mode 100644 node_modules/browserify/bin/advanced.txt create mode 100644 node_modules/browserify/bin/args.js create mode 100755 node_modules/browserify/bin/cmd.js create mode 100644 node_modules/browserify/bin/usage.txt create mode 100644 node_modules/browserify/changelog.markdown create mode 100644 node_modules/browserify/code-of-conduct.md create mode 100644 node_modules/browserify/example/api/browser/bar.js create mode 100644 node_modules/browserify/example/api/browser/foo.js create mode 100644 node_modules/browserify/example/api/browser/main.js create mode 100644 node_modules/browserify/example/api/build.js create mode 100644 node_modules/browserify/example/multiple_bundles/beep.js create mode 100644 node_modules/browserify/example/multiple_bundles/boop.js create mode 100755 node_modules/browserify/example/multiple_bundles/build.sh create mode 100644 node_modules/browserify/example/multiple_bundles/robot.js create mode 100644 node_modules/browserify/example/multiple_bundles/static/beep.html create mode 100644 node_modules/browserify/example/multiple_bundles/static/boop.html create mode 100644 node_modules/browserify/example/source_maps/build.js create mode 100755 node_modules/browserify/example/source_maps/build.sh create mode 100644 node_modules/browserify/example/source_maps/index.html create mode 100644 node_modules/browserify/example/source_maps/js/build/.npmignore create mode 100644 node_modules/browserify/example/source_maps/js/build/bundle.js create mode 100644 node_modules/browserify/example/source_maps/js/foo.js create mode 100644 node_modules/browserify/example/source_maps/js/main.js create mode 100644 node_modules/browserify/example/source_maps/js/wunder/bar.js create mode 100644 node_modules/browserify/index.js create mode 100644 node_modules/browserify/lib/_empty.js create mode 100644 node_modules/browserify/lib/builtins.js create mode 100644 node_modules/browserify/node_modules/events/.travis.yml create mode 100644 node_modules/browserify/node_modules/events/.zuul.yml create mode 100644 node_modules/browserify/node_modules/events/History.md create mode 100644 node_modules/browserify/node_modules/events/LICENSE create mode 100644 node_modules/browserify/node_modules/events/Readme.md create mode 100644 node_modules/browserify/node_modules/events/events.js create mode 100644 node_modules/browserify/node_modules/events/package.json create mode 100644 node_modules/browserify/node_modules/events/tests/add-listeners.js create mode 100644 node_modules/browserify/node_modules/events/tests/check-listener-leaks.js create mode 100644 node_modules/browserify/node_modules/events/tests/common.js create mode 100644 node_modules/browserify/node_modules/events/tests/index.js create mode 100644 node_modules/browserify/node_modules/events/tests/legacy-compat.js create mode 100644 node_modules/browserify/node_modules/events/tests/listener-count.js create mode 100644 node_modules/browserify/node_modules/events/tests/listeners-side-effects.js create mode 100644 node_modules/browserify/node_modules/events/tests/listeners.js create mode 100644 node_modules/browserify/node_modules/events/tests/max-listeners.js create mode 100644 node_modules/browserify/node_modules/events/tests/modify-in-emit.js create mode 100644 node_modules/browserify/node_modules/events/tests/num-args.js create mode 100644 node_modules/browserify/node_modules/events/tests/once.js create mode 100644 node_modules/browserify/node_modules/events/tests/remove-all-listeners.js create mode 100644 node_modules/browserify/node_modules/events/tests/remove-listeners.js create mode 100644 node_modules/browserify/node_modules/events/tests/set-max-listeners-side-effects.js create mode 100644 node_modules/browserify/node_modules/events/tests/subclass.js create mode 100644 node_modules/browserify/package.json create mode 100644 node_modules/browserify/readme.markdown create mode 100644 node_modules/browserify/test/args.js create mode 100644 node_modules/browserify/test/array.js create mode 100644 node_modules/browserify/test/array/one.js create mode 100644 node_modules/browserify/test/array/three.js create mode 100644 node_modules/browserify/test/array/two.js create mode 100644 node_modules/browserify/test/async.js create mode 100644 node_modules/browserify/test/async/src.js create mode 100644 node_modules/browserify/test/backbone.js create mode 100644 node_modules/browserify/test/bare.js create mode 100644 node_modules/browserify/test/bare/dirname-filename.js create mode 100644 node_modules/browserify/test/bare/main.js create mode 100644 node_modules/browserify/test/bare_shebang.js create mode 100644 node_modules/browserify/test/bin.js create mode 100644 node_modules/browserify/test/bin_entry.js create mode 100644 node_modules/browserify/test/bin_tr_error.js create mode 100644 node_modules/browserify/test/bin_tr_error/main.js create mode 100644 node_modules/browserify/test/bin_tr_error/tr.js create mode 100644 node_modules/browserify/test/bom.js create mode 100644 node_modules/browserify/test/bom/hello.js create mode 100644 node_modules/browserify/test/browser_field_file.js create mode 100644 node_modules/browserify/test/browser_field_file/package.json create mode 100644 node_modules/browserify/test/browser_field_file/wow.js create mode 100644 node_modules/browserify/test/browser_field_resolve.js create mode 100644 node_modules/browserify/test/browser_field_resolve/a/main.js create mode 100644 node_modules/browserify/test/browser_field_resolve/a/node_modules/aaa/main.js create mode 100644 node_modules/browserify/test/browser_field_resolve/a/node_modules/aaa/package.json create mode 100644 node_modules/browserify/test/browser_field_resolve/a/package.json create mode 100644 node_modules/browserify/test/browser_field_resolve/b/main.js create mode 100644 node_modules/browserify/test/browser_field_resolve/b/package.json create mode 100644 node_modules/browserify/test/browser_field_resolve/b/x.js create mode 100644 node_modules/browserify/test/browser_field_resolve/c/main.js create mode 100644 node_modules/browserify/test/browser_field_resolve/c/package.json create mode 100644 node_modules/browserify/test/browser_field_resolve/c/x.js create mode 100644 node_modules/browserify/test/browser_field_resolve/d/main.js create mode 100644 node_modules/browserify/test/browser_field_resolve/d/package.json create mode 100644 node_modules/browserify/test/browser_field_resolve/d/x.js create mode 100644 node_modules/browserify/test/browser_field_resolve/e/main.js create mode 100644 node_modules/browserify/test/browser_field_resolve/e/package.json create mode 100644 node_modules/browserify/test/browser_field_resolve/e/x.js create mode 100644 node_modules/browserify/test/browser_field_resolve/f/main.js create mode 100644 node_modules/browserify/test/browser_field_resolve/f/package.json create mode 100644 node_modules/browserify/test/browser_field_resolve/f/x.js create mode 100644 node_modules/browserify/test/browser_field_resolve/g/main.js create mode 100644 node_modules/browserify/test/browser_field_resolve/g/package.json create mode 100644 node_modules/browserify/test/browser_field_resolve/g/x.js create mode 100644 node_modules/browserify/test/browser_field_resolve/h/main.js create mode 100644 node_modules/browserify/test/browser_field_resolve/h/package.json create mode 100644 node_modules/browserify/test/browser_field_resolve/h/x.js create mode 100644 node_modules/browserify/test/browser_field_resolve/i/browser.js create mode 100644 node_modules/browserify/test/browser_field_resolve/i/main.js create mode 100644 node_modules/browserify/test/browser_field_resolve/i/package.json create mode 100644 node_modules/browserify/test/browser_field_resolve/i/x.js create mode 100644 node_modules/browserify/test/browser_field_resolve/j/browser.js create mode 100644 node_modules/browserify/test/browser_field_resolve/j/main.js create mode 100644 node_modules/browserify/test/browser_field_resolve/j/package.json create mode 100644 node_modules/browserify/test/browser_field_resolve/j/x.js create mode 100644 node_modules/browserify/test/browser_field_resolve/k/main.js create mode 100644 node_modules/browserify/test/browser_field_resolve/k/node_modules/x/hey.js create mode 100644 node_modules/browserify/test/browser_field_resolve/k/node_modules/x/package.json create mode 100644 node_modules/browserify/test/browser_field_resolve/l/main.js create mode 100644 node_modules/browserify/test/browser_field_resolve/l/node_modules/x/hey.js create mode 100644 node_modules/browserify/test/browser_field_resolve/l/node_modules/x/package.json create mode 100644 node_modules/browserify/test/buffer.js create mode 100644 node_modules/browserify/test/bundle-bundle-external.js create mode 100644 node_modules/browserify/test/bundle-bundle-external/bar.js create mode 100644 node_modules/browserify/test/bundle-bundle-external/baz.js create mode 100644 node_modules/browserify/test/bundle-bundle-external/foo.js create mode 100644 node_modules/browserify/test/bundle-stream.js create mode 100644 node_modules/browserify/test/bundle.js create mode 100644 node_modules/browserify/test/bundle_external.js create mode 100644 node_modules/browserify/test/bundle_external/boop.js create mode 100644 node_modules/browserify/test/bundle_external/main.js create mode 100644 node_modules/browserify/test/bundle_external/robot.js create mode 100644 node_modules/browserify/test/bundle_external_global.js create mode 100644 node_modules/browserify/test/bundle_sourcemap.js create mode 100644 node_modules/browserify/test/catch.js create mode 100644 node_modules/browserify/test/catch/main.js create mode 100644 node_modules/browserify/test/circular.js create mode 100644 node_modules/browserify/test/circular/a.js create mode 100644 node_modules/browserify/test/circular/b.js create mode 100644 node_modules/browserify/test/circular/main.js create mode 100644 node_modules/browserify/test/coffee_bin.js create mode 100644 node_modules/browserify/test/coffee_bin/main.coffee create mode 100644 node_modules/browserify/test/coffee_bin/x.coffee create mode 100644 node_modules/browserify/test/coffeeify.js create mode 100644 node_modules/browserify/test/coffeeify/main.coffee create mode 100644 node_modules/browserify/test/comment.js create mode 100644 node_modules/browserify/test/comment/main.js create mode 100644 node_modules/browserify/test/constants.js create mode 100644 node_modules/browserify/test/crypto.js create mode 100644 node_modules/browserify/test/crypto_ig.js create mode 100644 node_modules/browserify/test/cycle.js create mode 100644 node_modules/browserify/test/cycle/README.md create mode 100644 node_modules/browserify/test/cycle/entry.js create mode 100644 node_modules/browserify/test/cycle/mod1/a.js create mode 100644 node_modules/browserify/test/cycle/mod1/b.js create mode 100644 node_modules/browserify/test/cycle/mod2/a.js create mode 100644 node_modules/browserify/test/cycle/mod2/b.js create mode 100644 node_modules/browserify/test/debug_standalone.js create mode 100644 node_modules/browserify/test/debug_standalone/x.js create mode 100644 node_modules/browserify/test/dedupe-deps.js create mode 100644 node_modules/browserify/test/dedupe-nomap.js create mode 100644 node_modules/browserify/test/delay.js create mode 100644 node_modules/browserify/test/delay/diverted.js create mode 100644 node_modules/browserify/test/delay/main.js create mode 100644 node_modules/browserify/test/dep.js create mode 100644 node_modules/browserify/test/dollar.js create mode 100644 node_modules/browserify/test/dollar/dollar/index.js create mode 100644 node_modules/browserify/test/double_buffer.js create mode 100644 node_modules/browserify/test/double_buffer/explicit.js create mode 100644 node_modules/browserify/test/double_buffer/implicit.js create mode 100644 node_modules/browserify/test/double_buffer/main.js create mode 100644 node_modules/browserify/test/double_bundle.js create mode 100644 node_modules/browserify/test/double_bundle_error.js create mode 100644 node_modules/browserify/test/double_bundle_error/main.js create mode 100644 node_modules/browserify/test/double_bundle_error/needs_three.js create mode 100644 node_modules/browserify/test/double_bundle_error/one.js create mode 100644 node_modules/browserify/test/double_bundle_error/package.json create mode 100644 node_modules/browserify/test/double_bundle_error/three.js create mode 100644 node_modules/browserify/test/double_bundle_error/two.js create mode 100644 node_modules/browserify/test/double_bundle_json.js create mode 100644 node_modules/browserify/test/double_bundle_json/a.json create mode 100644 node_modules/browserify/test/double_bundle_json/b.json create mode 100644 node_modules/browserify/test/double_bundle_json/index.js create mode 100644 node_modules/browserify/test/double_bundle_parallel.js create mode 100644 node_modules/browserify/test/double_bundle_parallel_cache.js create mode 100644 node_modules/browserify/test/dup/foo-dup.js create mode 100644 node_modules/browserify/test/dup/foo.js create mode 100644 node_modules/browserify/test/dup/index.js create mode 100644 node_modules/browserify/test/entry.js create mode 100644 node_modules/browserify/test/entry/main.js create mode 100644 node_modules/browserify/test/entry/needs_three.js create mode 100644 node_modules/browserify/test/entry/one.js create mode 100644 node_modules/browserify/test/entry/package.json create mode 100644 node_modules/browserify/test/entry/three.js create mode 100644 node_modules/browserify/test/entry/two.js create mode 100644 node_modules/browserify/test/entry_exec.js create mode 100644 node_modules/browserify/test/entry_exec/fail.js create mode 100644 node_modules/browserify/test/entry_exec/main.js create mode 100644 node_modules/browserify/test/entry_expose.js create mode 100644 node_modules/browserify/test/entry_expose/main.js create mode 100644 node_modules/browserify/test/entry_relative.js create mode 100644 node_modules/browserify/test/error_code.js create mode 100644 node_modules/browserify/test/error_code/src.js create mode 100644 node_modules/browserify/test/exclude.js create mode 100644 node_modules/browserify/test/exclude/array.js create mode 100644 node_modules/browserify/test/exclude/skip.js create mode 100644 node_modules/browserify/test/exclude/skip2.js create mode 100644 node_modules/browserify/test/export.js create mode 100644 node_modules/browserify/test/export/entry.js create mode 100644 node_modules/browserify/test/external.js create mode 100644 node_modules/browserify/test/external/main.js create mode 100644 node_modules/browserify/test/external/x.js create mode 100644 node_modules/browserify/test/external_args/main.js create mode 100644 node_modules/browserify/test/external_shim.js create mode 100644 node_modules/browserify/test/external_shim/bundle1.js create mode 100644 node_modules/browserify/test/external_shim/bundle2.js create mode 100644 node_modules/browserify/test/external_shim/package.json create mode 100644 node_modules/browserify/test/external_shim/shim.js create mode 100644 node_modules/browserify/test/externalize.js create mode 100644 node_modules/browserify/test/externalize/beep.js create mode 100644 node_modules/browserify/test/externalize/boop.js create mode 100644 node_modules/browserify/test/externalize/robot.js create mode 100644 node_modules/browserify/test/fake.js create mode 100644 node_modules/browserify/test/fake/fake_fs.js create mode 100644 node_modules/browserify/test/fake/main.js create mode 100644 node_modules/browserify/test/field.js create mode 100644 node_modules/browserify/test/field/miss.js create mode 100644 node_modules/browserify/test/field/node_modules/z-miss/browser.js create mode 100644 node_modules/browserify/test/field/node_modules/z-miss/main.js create mode 100644 node_modules/browserify/test/field/node_modules/z-miss/package.json create mode 100644 node_modules/browserify/test/field/node_modules/z-object/browser.js create mode 100644 node_modules/browserify/test/field/node_modules/z-object/main.js create mode 100644 node_modules/browserify/test/field/node_modules/z-object/package.json create mode 100644 node_modules/browserify/test/field/node_modules/z-string/browser.js create mode 100644 node_modules/browserify/test/field/node_modules/z-string/main.js create mode 100644 node_modules/browserify/test/field/node_modules/z-string/package.json create mode 100644 node_modules/browserify/test/field/node_modules/z-sub/browser/a.js create mode 100644 node_modules/browserify/test/field/node_modules/z-sub/browser/b.js create mode 100644 node_modules/browserify/test/field/node_modules/z-sub/main.js create mode 100644 node_modules/browserify/test/field/node_modules/z-sub/package.json create mode 100644 node_modules/browserify/test/field/object.js create mode 100644 node_modules/browserify/test/field/string.js create mode 100644 node_modules/browserify/test/field/sub.js create mode 100644 node_modules/browserify/test/file_event.js create mode 100644 node_modules/browserify/test/five_bundle.js create mode 100644 node_modules/browserify/test/full_paths.js create mode 100644 node_modules/browserify/test/glob.js create mode 100644 node_modules/browserify/test/glob/a.js create mode 100644 node_modules/browserify/test/glob/b.js create mode 100644 node_modules/browserify/test/glob/lib/z.js create mode 100644 node_modules/browserify/test/glob/vendor/x.js create mode 100644 node_modules/browserify/test/glob/vendor/y.js create mode 100644 node_modules/browserify/test/global.js create mode 100644 node_modules/browserify/test/global/buffer.js create mode 100644 node_modules/browserify/test/global/filename.js create mode 100644 node_modules/browserify/test/global/main.js create mode 100644 node_modules/browserify/test/global/node_modules/aaa/index.js create mode 100644 node_modules/browserify/test/global/node_modules/robot/index.js create mode 100644 node_modules/browserify/test/global/node_modules/robot/lib/beep.js create mode 100644 node_modules/browserify/test/global/tick.js create mode 100644 node_modules/browserify/test/global_coffeeify.js create mode 100644 node_modules/browserify/test/global_noparse.js create mode 100644 node_modules/browserify/test/global_recorder.js create mode 100644 node_modules/browserify/test/global_recorder/main.js create mode 100644 node_modules/browserify/test/hash.js create mode 100644 node_modules/browserify/test/hash/foo/other.js create mode 100644 node_modules/browserify/test/hash/foo/two.js create mode 100644 node_modules/browserify/test/hash/main.js create mode 100644 node_modules/browserify/test/hash/one.js create mode 100644 node_modules/browserify/test/hash/other.js create mode 100644 node_modules/browserify/test/hash_instance_context.js create mode 100644 node_modules/browserify/test/hash_instance_context/main.js create mode 100644 node_modules/browserify/test/hash_instance_context/one/dir/f.js create mode 100644 node_modules/browserify/test/hash_instance_context/one/dir/g.js create mode 100644 node_modules/browserify/test/hash_instance_context/one/f.js create mode 100644 node_modules/browserify/test/hash_instance_context/one/g.js create mode 100644 node_modules/browserify/test/hash_instance_context/three/dir/f.js create mode 100644 node_modules/browserify/test/hash_instance_context/three/dir/g.js create mode 100644 node_modules/browserify/test/hash_instance_context/three/dir/h.js create mode 100644 node_modules/browserify/test/hash_instance_context/three/f.js create mode 100644 node_modules/browserify/test/hash_instance_context/three/g.js create mode 100644 node_modules/browserify/test/hash_instance_context/three/h.js create mode 100644 node_modules/browserify/test/hash_instance_context/two/dir/f.js create mode 100644 node_modules/browserify/test/hash_instance_context/two/dir/g.js create mode 100644 node_modules/browserify/test/hash_instance_context/two/dir/h.js create mode 100644 node_modules/browserify/test/hash_instance_context/two/f.js create mode 100644 node_modules/browserify/test/hash_instance_context/two/g.js create mode 100644 node_modules/browserify/test/hash_instance_context/two/h.js create mode 100644 node_modules/browserify/test/identical.js create mode 100644 node_modules/browserify/test/identical/main.js create mode 100644 node_modules/browserify/test/identical/x.js create mode 100644 node_modules/browserify/test/identical/y.js create mode 100644 node_modules/browserify/test/identical_different.js create mode 100644 node_modules/browserify/test/identical_different/main.js create mode 100644 node_modules/browserify/test/identical_different/node_modules/op/index.js create mode 100644 node_modules/browserify/test/identical_different/wow/node_modules/op/index.js create mode 100644 node_modules/browserify/test/identical_different/wow/y.js create mode 100644 node_modules/browserify/test/identical_different/x.js create mode 100644 node_modules/browserify/test/ignore.js create mode 100644 node_modules/browserify/test/ignore/array.js create mode 100644 node_modules/browserify/test/ignore/by-id.js create mode 100644 node_modules/browserify/test/ignore/by-relative.js create mode 100644 node_modules/browserify/test/ignore/double-skip.js create mode 100644 node_modules/browserify/test/ignore/double-skip/index.js create mode 100644 node_modules/browserify/test/ignore/double-skip/skip.js create mode 100644 node_modules/browserify/test/ignore/ignored/skip.js create mode 100644 node_modules/browserify/test/ignore/main.js create mode 100644 node_modules/browserify/test/ignore/relative/index.js create mode 100644 node_modules/browserify/test/ignore/skip.js create mode 100644 node_modules/browserify/test/ignore/skip2.js create mode 100644 node_modules/browserify/test/ignore_browser_field.js create mode 100644 node_modules/browserify/test/ignore_browser_field/main.js create mode 100644 node_modules/browserify/test/ignore_browser_field/node_modules/a/browser.js create mode 100644 node_modules/browserify/test/ignore_browser_field/node_modules/a/main.js create mode 100644 node_modules/browserify/test/ignore_browser_field/node_modules/a/package.json create mode 100644 node_modules/browserify/test/ignore_browser_field/node_modules/b/browser-x.js create mode 100644 node_modules/browserify/test/ignore_browser_field/node_modules/b/main.js create mode 100644 node_modules/browserify/test/ignore_browser_field/node_modules/b/package.json create mode 100644 node_modules/browserify/test/ignore_browser_field/node_modules/b/x.js create mode 100644 node_modules/browserify/test/ignore_missing.js create mode 100644 node_modules/browserify/test/ignore_missing/main.js create mode 100644 node_modules/browserify/test/ignore_transform_key.js create mode 100644 node_modules/browserify/test/ignore_transform_key/main.js create mode 100644 node_modules/browserify/test/ignore_transform_key/node_modules/a/index.js create mode 100644 node_modules/browserify/test/ignore_transform_key/node_modules/a/package.json create mode 100644 node_modules/browserify/test/ignore_transform_key/node_modules/evil-transform/index.js create mode 100644 node_modules/browserify/test/ignore_transform_key/node_modules/evil-transform/package.json create mode 100644 node_modules/browserify/test/json.js create mode 100644 node_modules/browserify/test/json/beep.json create mode 100644 node_modules/browserify/test/json/evil-chars.json create mode 100644 node_modules/browserify/test/json/evil.js create mode 100644 node_modules/browserify/test/json/main.js create mode 100644 node_modules/browserify/test/leak.js create mode 100644 node_modules/browserify/test/maxlisteners.js create mode 100644 node_modules/browserify/test/maxlisteners/main.js create mode 100644 node_modules/browserify/test/multi_bundle.js create mode 100644 node_modules/browserify/test/multi_bundle/_prelude.js create mode 100644 node_modules/browserify/test/multi_bundle/a.js create mode 100644 node_modules/browserify/test/multi_bundle/b.js create mode 100644 node_modules/browserify/test/multi_bundle/c.js create mode 100644 node_modules/browserify/test/multi_bundle_unique.js create mode 100644 node_modules/browserify/test/multi_entry.js create mode 100644 node_modules/browserify/test/multi_entry/a.js create mode 100644 node_modules/browserify/test/multi_entry/b.js create mode 100644 node_modules/browserify/test/multi_entry/c.js create mode 100644 node_modules/browserify/test/multi_entry_cross_require.js create mode 100644 node_modules/browserify/test/multi_entry_cross_require/a.js create mode 100644 node_modules/browserify/test/multi_entry_cross_require/c.js create mode 100644 node_modules/browserify/test/multi_entry_cross_require/lib/b.js create mode 100644 node_modules/browserify/test/multi_require.js create mode 100644 node_modules/browserify/test/multi_require/a.js create mode 100644 node_modules/browserify/test/multi_require/main.js create mode 100644 node_modules/browserify/test/multi_symlink.js create mode 100644 node_modules/browserify/test/multi_symlink/main.js create mode 100644 node_modules/browserify/test/multi_symlink/x.js create mode 100644 node_modules/browserify/test/no_builtins.js create mode 100644 node_modules/browserify/test/no_builtins/extra/fs.js create mode 100644 node_modules/browserify/test/no_builtins/extra/tls.js create mode 100644 node_modules/browserify/test/no_builtins/main.js create mode 100644 node_modules/browserify/test/no_builtins/x.txt create mode 100644 node_modules/browserify/test/node_modules/beep/index.js create mode 100644 node_modules/browserify/test/node_modules/plugin-foo/index.js create mode 100644 node_modules/browserify/test/node_modules/tr/index.js create mode 100644 node_modules/browserify/test/noparse.js create mode 100644 node_modules/browserify/test/noparse/a.js create mode 100644 node_modules/browserify/test/noparse/b.js create mode 100644 node_modules/browserify/test/noparse/dir1/1.js create mode 100644 node_modules/browserify/test/noparse/dir1/dir2/2.js create mode 100644 node_modules/browserify/test/noparse/node_modules/robot/lib/beep.js create mode 100644 node_modules/browserify/test/noparse/node_modules/robot/lib/boop.js create mode 100644 node_modules/browserify/test/noparse/node_modules/robot/main.js create mode 100644 node_modules/browserify/test/noparse/node_modules/robot/package.json create mode 100644 node_modules/browserify/test/pack.js create mode 100644 node_modules/browserify/test/paths.js create mode 100644 node_modules/browserify/test/paths/main.js create mode 100644 node_modules/browserify/test/paths/x/aaa/index.js create mode 100644 node_modules/browserify/test/paths/x/ccc/index.js create mode 100644 node_modules/browserify/test/paths/y/bbb/index.js create mode 100644 node_modules/browserify/test/paths/y/ccc/index.js create mode 100644 node_modules/browserify/test/paths_transform.js create mode 100644 node_modules/browserify/test/pipeline_deps.js create mode 100644 node_modules/browserify/test/pipeline_deps/bar.js create mode 100644 node_modules/browserify/test/pipeline_deps/foo.js create mode 100644 node_modules/browserify/test/pipeline_deps/main.js create mode 100644 node_modules/browserify/test/pipeline_deps/xyz.js create mode 100644 node_modules/browserify/test/pkg.js create mode 100644 node_modules/browserify/test/pkg/main.js create mode 100644 node_modules/browserify/test/pkg/package.json create mode 100644 node_modules/browserify/test/pkg_event.js create mode 100644 node_modules/browserify/test/pkg_event/main.js create mode 100644 node_modules/browserify/test/pkg_event/node_modules/aaa/lib/butts.js create mode 100644 node_modules/browserify/test/pkg_event/node_modules/aaa/lib/package.json create mode 100644 node_modules/browserify/test/pkg_event/node_modules/aaa/lib/woo.js create mode 100644 node_modules/browserify/test/pkg_event/node_modules/aaa/main.js create mode 100644 node_modules/browserify/test/pkg_event/node_modules/aaa/package.json create mode 100644 node_modules/browserify/test/pkg_event/package.json create mode 100644 node_modules/browserify/test/plugin.js create mode 100644 node_modules/browserify/test/plugin/main.js create mode 100644 node_modules/browserify/test/preserve-symlinks.js create mode 100644 node_modules/browserify/test/preserve_symlinks/a/index.js create mode 100644 node_modules/browserify/test/preserve_symlinks/a/node_modules/b/index.js create mode 100644 node_modules/browserify/test/preserve_symlinks/a/node_modules/c/index.js create mode 100644 node_modules/browserify/test/preserve_symlinks/b/index.js create mode 100644 node_modules/browserify/test/process.js create mode 100644 node_modules/browserify/test/process/main.js create mode 100644 node_modules/browserify/test/process/one.js create mode 100644 node_modules/browserify/test/process/two.js create mode 100644 node_modules/browserify/test/quotes.js create mode 100644 node_modules/browserify/test/quotes/backtick.js create mode 100644 node_modules/browserify/test/quotes/main.js create mode 100644 node_modules/browserify/test/quotes/one.js create mode 100644 node_modules/browserify/test/quotes/three.js create mode 100644 node_modules/browserify/test/quotes/two.js create mode 100644 node_modules/browserify/test/relative_dedupe.js create mode 100644 node_modules/browserify/test/relative_dedupe/a/a.js create mode 100644 node_modules/browserify/test/relative_dedupe/a/b.js create mode 100644 node_modules/browserify/test/relative_dedupe/a/index.js create mode 100644 node_modules/browserify/test/relative_dedupe/b/a.js create mode 100644 node_modules/browserify/test/relative_dedupe/b/b.js create mode 100644 node_modules/browserify/test/relative_dedupe/b/index.js create mode 100644 node_modules/browserify/test/relative_dedupe/index.js create mode 100644 node_modules/browserify/test/relative_dedupe/main.js create mode 100644 node_modules/browserify/test/require_cache.js create mode 100644 node_modules/browserify/test/require_expose.js create mode 100644 node_modules/browserify/test/require_expose/main.js create mode 100644 node_modules/browserify/test/require_expose/some_dep.js create mode 100644 node_modules/browserify/test/reset.js create mode 100644 node_modules/browserify/test/resolve_exposed.js create mode 100644 node_modules/browserify/test/resolve_exposed/main.js create mode 100644 node_modules/browserify/test/resolve_exposed/x.js create mode 100644 node_modules/browserify/test/retarget.js create mode 100644 node_modules/browserify/test/reverse_multi_bundle.js create mode 100644 node_modules/browserify/test/reverse_multi_bundle/app.js create mode 100644 node_modules/browserify/test/reverse_multi_bundle/arbitrary.js create mode 100644 node_modules/browserify/test/reverse_multi_bundle/lazy.js create mode 100644 node_modules/browserify/test/reverse_multi_bundle/shared.js create mode 100644 node_modules/browserify/test/shared_symlink.js create mode 100644 node_modules/browserify/test/shared_symlink/app/index.js create mode 100644 node_modules/browserify/test/shared_symlink/app/node_modules/foo/index.js create mode 100644 node_modules/browserify/test/shared_symlink/app/node_modules/shared/index.js create mode 100644 node_modules/browserify/test/shared_symlink/main.js create mode 100644 node_modules/browserify/test/shared_symlink/shared/index.js create mode 100644 node_modules/browserify/test/shebang.js create mode 100644 node_modules/browserify/test/shebang/foo.js create mode 100644 node_modules/browserify/test/shebang/main.js create mode 100644 node_modules/browserify/test/spread.js create mode 100644 node_modules/browserify/test/spread/main.js create mode 100644 node_modules/browserify/test/standalone.js create mode 100644 node_modules/browserify/test/standalone/main.js create mode 100644 node_modules/browserify/test/standalone/one.js create mode 100644 node_modules/browserify/test/standalone/two.js create mode 100644 node_modules/browserify/test/standalone_events.js create mode 100644 node_modules/browserify/test/standalone_sourcemap.js create mode 100644 node_modules/browserify/test/stdin.js create mode 100644 node_modules/browserify/test/stream.js create mode 100644 node_modules/browserify/test/stream/bar.js create mode 100644 node_modules/browserify/test/stream/foo.js create mode 100644 node_modules/browserify/test/stream/main.js create mode 100644 node_modules/browserify/test/stream_file.js create mode 100644 node_modules/browserify/test/subdep.js create mode 100644 node_modules/browserify/test/subdep/index.js create mode 100644 node_modules/browserify/test/subdep/node_modules/qq/b.js create mode 100644 node_modules/browserify/test/subdep/node_modules/qq/ignore_me.js create mode 100644 node_modules/browserify/test/subdep/node_modules/qq/node_modules/a/index.js create mode 100644 node_modules/browserify/test/subdep/node_modules/qq/node_modules/a/package.json create mode 100644 node_modules/browserify/test/subdep/node_modules/qq/node_modules/c/index.js create mode 100644 node_modules/browserify/test/subdep/node_modules/qq/node_modules/c/package.json create mode 100644 node_modules/browserify/test/subdep/node_modules/qq/node_modules/f/index.js create mode 100644 node_modules/browserify/test/subdep/node_modules/qq/node_modules/z/index.js create mode 100644 node_modules/browserify/test/subdep/node_modules/qq/package.json create mode 100644 node_modules/browserify/test/subdep/package.json create mode 100644 node_modules/browserify/test/symlink_dedupe.js create mode 100644 node_modules/browserify/test/symlink_dedupe/main.js create mode 100644 node_modules/browserify/test/symlink_dedupe/one/f.js create mode 100644 node_modules/browserify/test/symlink_dedupe/one/g.js create mode 100644 node_modules/browserify/test/syntax_cache.js create mode 100644 node_modules/browserify/test/syntax_cache/invalid.js create mode 100644 node_modules/browserify/test/syntax_cache/valid.js create mode 100644 node_modules/browserify/test/tr.js create mode 100644 node_modules/browserify/test/tr/f.js create mode 100644 node_modules/browserify/test/tr/main.js create mode 100644 node_modules/browserify/test/tr/node_modules/g/index.js create mode 100644 node_modules/browserify/test/tr/node_modules/g/node_modules/insert-ggg/index.js create mode 100644 node_modules/browserify/test/tr/node_modules/g/package.json create mode 100644 node_modules/browserify/test/tr/node_modules/insert-aaa/index.js create mode 100644 node_modules/browserify/test/tr/node_modules/insert-bbb/index.js create mode 100644 node_modules/browserify/test/tr/node_modules/m/index.js create mode 100644 node_modules/browserify/test/tr/node_modules/xyz/index.js create mode 100644 node_modules/browserify/test/tr/package.json create mode 100644 node_modules/browserify/test/tr/subdir/g.js create mode 100644 node_modules/browserify/test/tr_args.js create mode 100644 node_modules/browserify/test/tr_args/main.js create mode 100644 node_modules/browserify/test/tr_args/tr.js create mode 100644 node_modules/browserify/test/tr_error.js create mode 100644 node_modules/browserify/test/tr_flags.js create mode 100644 node_modules/browserify/test/tr_global.js create mode 100644 node_modules/browserify/test/tr_global/main.js create mode 100644 node_modules/browserify/test/tr_global/node_modules/tr/index.js create mode 100644 node_modules/browserify/test/tr_global/node_modules/x/index.js create mode 100644 node_modules/browserify/test/tr_global/node_modules/x/node_modules/tr/index.js create mode 100644 node_modules/browserify/test/tr_no_entry.js create mode 100644 node_modules/browserify/test/tr_no_entry/main.js create mode 100644 node_modules/browserify/test/tr_once.js create mode 100644 node_modules/browserify/test/tr_once/main.js create mode 100644 node_modules/browserify/test/tr_order.js create mode 100644 node_modules/browserify/test/tr_order/replace_aaa.js create mode 100644 node_modules/browserify/test/tr_order/replace_bbb.js create mode 100644 node_modules/browserify/test/tr_symlink.js create mode 100644 node_modules/browserify/test/tr_symlink/a-module/index.js create mode 100644 node_modules/browserify/test/tr_symlink/app/main.js create mode 100644 node_modules/browserify/test/tr_symlink/app/node_modules/aaa/index.js create mode 100644 node_modules/browserify/test/tr_symlink/app/node_modules/bbb/ext.js create mode 100644 node_modules/browserify/test/tr_symlink/app/node_modules/bbb/index.js create mode 100644 node_modules/browserify/test/tr_symlink/app/node_modules/tr/index.js create mode 100644 node_modules/browserify/test/tr_symlink/app/package.json create mode 100644 node_modules/browserify/test/tr_symlink/b-module/ext.js create mode 100644 node_modules/browserify/test/tr_symlink/b-module/index.js create mode 100644 node_modules/browserify/test/unicode.js create mode 100644 node_modules/browserify/test/unicode/main.js create mode 100644 node_modules/browserify/test/unicode/one.js create mode 100644 node_modules/browserify/test/unicode/two.js create mode 100644 node_modules/browserify/test/util.js create mode 100644 node_modules/browserify/test/yield.js create mode 100644 node_modules/browserify/test/yield/f.js create mode 100644 node_modules/browserify/test/yield/main.js create mode 100644 node_modules/budo/.travis.yml create mode 100644 node_modules/budo/CHANGELOG.md create mode 100644 node_modules/budo/LICENSE.md create mode 100644 node_modules/budo/README.md create mode 100644 node_modules/budo/bin/bundle-livereload-client.js create mode 100755 node_modules/budo/bin/cmd.js create mode 100644 node_modules/budo/bin/help.txt create mode 100644 node_modules/budo/build/bundled-livereload-client.js create mode 100644 node_modules/budo/index.js create mode 100644 node_modules/budo/lib/budo.js create mode 100644 node_modules/budo/lib/bundler.js create mode 100644 node_modules/budo/lib/error-handler.js create mode 100644 node_modules/budo/lib/file-watch.js create mode 100644 node_modules/budo/lib/get-ports.js create mode 100644 node_modules/budo/lib/map-entry.js create mode 100644 node_modules/budo/lib/middleware.js create mode 100644 node_modules/budo/lib/parse-args.js create mode 100644 node_modules/budo/lib/reload/client.js create mode 100644 node_modules/budo/lib/reload/error-popup.js create mode 100644 node_modules/budo/lib/reload/server.js create mode 100644 node_modules/budo/lib/server.js create mode 100644 node_modules/budo/lib/simple-http-logger.js create mode 100644 node_modules/budo/package.json create mode 100644 node_modules/buffer-from/LICENSE create mode 100644 node_modules/buffer-from/index.js create mode 100644 node_modules/buffer-from/package.json create mode 100644 node_modules/buffer-from/readme.md create mode 100644 node_modules/buffer-xor/.npmignore create mode 100644 node_modules/buffer-xor/.travis.yml create mode 100644 node_modules/buffer-xor/LICENSE create mode 100644 node_modules/buffer-xor/README.md create mode 100644 node_modules/buffer-xor/index.js create mode 100644 node_modules/buffer-xor/inline.js create mode 100644 node_modules/buffer-xor/inplace.js create mode 100644 node_modules/buffer-xor/package.json create mode 100644 node_modules/buffer-xor/test/fixtures.json create mode 100644 node_modules/buffer-xor/test/index.js create mode 100644 node_modules/buffer/AUTHORS.md create mode 100644 node_modules/buffer/LICENSE create mode 100644 node_modules/buffer/README.md create mode 100644 node_modules/buffer/index.d.ts create mode 100644 node_modules/buffer/index.js create mode 100644 node_modules/buffer/package.json create mode 100644 node_modules/builtin-status-codes/browser.js create mode 100644 node_modules/builtin-status-codes/build.js create mode 100644 node_modules/builtin-status-codes/index.js create mode 100644 node_modules/builtin-status-codes/license create mode 100644 node_modules/builtin-status-codes/package.json create mode 100644 node_modules/builtin-status-codes/readme.md create mode 100644 node_modules/cache-base/LICENSE create mode 100644 node_modules/cache-base/README.md create mode 100644 node_modules/cache-base/index.js create mode 100644 node_modules/cache-base/node_modules/isobject/LICENSE create mode 100644 node_modules/cache-base/node_modules/isobject/README.md create mode 100644 node_modules/cache-base/node_modules/isobject/index.d.ts create mode 100644 node_modules/cache-base/node_modules/isobject/index.js create mode 100644 node_modules/cache-base/node_modules/isobject/package.json create mode 100644 node_modules/cache-base/package.json create mode 100644 node_modules/cached-path-relative/.npmignore create mode 100644 node_modules/cached-path-relative/History.md create mode 100644 node_modules/cached-path-relative/Makefile create mode 100644 node_modules/cached-path-relative/Readme.md create mode 100644 node_modules/cached-path-relative/lib/index.js create mode 100644 node_modules/cached-path-relative/package.json create mode 100644 node_modules/cached-path-relative/shim.js create mode 100644 node_modules/cached-path-relative/test/index.js create mode 100644 node_modules/chalk/index.js create mode 120000 node_modules/chalk/node_modules/.bin/strip-ansi create mode 100755 node_modules/chalk/node_modules/strip-ansi/cli.js create mode 100644 node_modules/chalk/node_modules/strip-ansi/index.js create mode 100644 node_modules/chalk/node_modules/strip-ansi/package.json create mode 100644 node_modules/chalk/node_modules/strip-ansi/readme.md create mode 100644 node_modules/chalk/package.json create mode 100644 node_modules/chalk/readme.md create mode 100644 node_modules/charenc/LICENSE.mkd create mode 100644 node_modules/charenc/README.js create mode 100644 node_modules/charenc/charenc.js create mode 100644 node_modules/charenc/package.json create mode 100644 node_modules/chokidar/CHANGELOG.md create mode 100644 node_modules/chokidar/README.md create mode 100644 node_modules/chokidar/index.js create mode 100644 node_modules/chokidar/lib/fsevents-handler.js create mode 100644 node_modules/chokidar/lib/nodefs-handler.js create mode 100644 node_modules/chokidar/package.json create mode 100644 node_modules/cipher-base/.eslintrc create mode 100644 node_modules/cipher-base/.npmignore create mode 100644 node_modules/cipher-base/.travis.yml create mode 100644 node_modules/cipher-base/LICENSE create mode 100644 node_modules/cipher-base/README.md create mode 100644 node_modules/cipher-base/index.js create mode 100644 node_modules/cipher-base/package.json create mode 100644 node_modules/cipher-base/test.js create mode 100644 node_modules/class-utils/LICENSE create mode 100644 node_modules/class-utils/README.md create mode 100644 node_modules/class-utils/index.js create mode 100644 node_modules/class-utils/node_modules/define-property/LICENSE create mode 100644 node_modules/class-utils/node_modules/define-property/README.md create mode 100644 node_modules/class-utils/node_modules/define-property/index.js create mode 100644 node_modules/class-utils/node_modules/define-property/package.json create mode 100644 node_modules/class-utils/node_modules/isobject/LICENSE create mode 100644 node_modules/class-utils/node_modules/isobject/README.md create mode 100644 node_modules/class-utils/node_modules/isobject/index.d.ts create mode 100644 node_modules/class-utils/node_modules/isobject/index.js create mode 100644 node_modules/class-utils/node_modules/isobject/package.json create mode 100644 node_modules/class-utils/package.json create mode 100644 node_modules/collection-visit/LICENSE create mode 100644 node_modules/collection-visit/README.md create mode 100644 node_modules/collection-visit/index.js create mode 100644 node_modules/collection-visit/package.json create mode 100644 node_modules/combine-source-map/.npmignore create mode 100644 node_modules/combine-source-map/.travis.yml create mode 100644 node_modules/combine-source-map/LICENSE create mode 100644 node_modules/combine-source-map/README.md create mode 100644 node_modules/combine-source-map/example/two-files-short.js create mode 100644 node_modules/combine-source-map/example/two-files.js create mode 100644 node_modules/combine-source-map/index.js create mode 100644 node_modules/combine-source-map/lib/mappings-from-map.js create mode 100644 node_modules/combine-source-map/lib/path-is-absolute.js create mode 100644 node_modules/combine-source-map/lib/path-is-absolute.license create mode 100644 node_modules/combine-source-map/package.json create mode 100644 node_modules/combine-source-map/test/combine-source-map.js create mode 100644 node_modules/component-emitter/History.md create mode 100644 node_modules/component-emitter/LICENSE create mode 100644 node_modules/component-emitter/Readme.md create mode 100644 node_modules/component-emitter/index.js create mode 100644 node_modules/component-emitter/package.json create mode 100644 node_modules/concat-map/.travis.yml create mode 100644 node_modules/concat-map/LICENSE create mode 100644 node_modules/concat-map/README.markdown create mode 100644 node_modules/concat-map/example/map.js create mode 100644 node_modules/concat-map/index.js create mode 100644 node_modules/concat-map/package.json create mode 100644 node_modules/concat-map/test/map.js create mode 100644 node_modules/concat-stream/LICENSE create mode 100644 node_modules/concat-stream/index.js create mode 100644 node_modules/concat-stream/package.json create mode 100644 node_modules/concat-stream/readme.md create mode 100644 node_modules/connect-pushstate/.jshintrc create mode 100644 node_modules/connect-pushstate/.npmignore create mode 100644 node_modules/connect-pushstate/Gruntfile.js create mode 100644 node_modules/connect-pushstate/LICENSE create mode 100644 node_modules/connect-pushstate/README.md create mode 100755 node_modules/connect-pushstate/examples/server.js create mode 100644 node_modules/connect-pushstate/index.js create mode 100644 node_modules/connect-pushstate/package.json create mode 100644 node_modules/connect-pushstate/test/fixtures/www/images/image.png create mode 100644 node_modules/connect-pushstate/test/fixtures/www/index.html create mode 100644 node_modules/connect-pushstate/test/fixtures/www/other/index.html create mode 100644 node_modules/connect-pushstate/test/pushstate-test.js create mode 100644 node_modules/console-browserify/.npmignore create mode 100644 node_modules/console-browserify/.testem.json create mode 100644 node_modules/console-browserify/.travis.yml create mode 100644 node_modules/console-browserify/LICENCE create mode 100644 node_modules/console-browserify/README.md create mode 100644 node_modules/console-browserify/index.js create mode 100644 node_modules/console-browserify/package.json create mode 100644 node_modules/console-browserify/test/index.js create mode 100644 node_modules/console-browserify/test/static/index.html create mode 100644 node_modules/console-browserify/test/static/test-adapter.js create mode 100644 node_modules/constants-browserify/README.md create mode 100755 node_modules/constants-browserify/build.sh create mode 100644 node_modules/constants-browserify/constants.json create mode 100644 node_modules/constants-browserify/package.json create mode 100644 node_modules/constants-browserify/test.js create mode 100644 node_modules/convert-source-map/.npmignore create mode 100644 node_modules/convert-source-map/.travis.yml create mode 100644 node_modules/convert-source-map/LICENSE create mode 100644 node_modules/convert-source-map/README.md create mode 100644 node_modules/convert-source-map/example/comment-to-json.js create mode 100644 node_modules/convert-source-map/index.js create mode 100644 node_modules/convert-source-map/package.json create mode 100644 node_modules/convert-source-map/test/comment-regex.js create mode 100644 node_modules/convert-source-map/test/convert-source-map.js create mode 100644 node_modules/convert-source-map/test/fixtures/map-file-comment-double-slash.css create mode 100644 node_modules/convert-source-map/test/fixtures/map-file-comment-inline.css create mode 100644 node_modules/convert-source-map/test/fixtures/map-file-comment.css create mode 100644 node_modules/convert-source-map/test/fixtures/map-file-comment.css.map create mode 100644 node_modules/convert-source-map/test/map-file-comment.js create mode 100644 node_modules/copy-descriptor/LICENSE create mode 100644 node_modules/copy-descriptor/index.js create mode 100644 node_modules/copy-descriptor/package.json create mode 100644 node_modules/core-js/CHANGELOG.md create mode 100644 node_modules/core-js/Gruntfile.js create mode 100644 node_modules/core-js/LICENSE create mode 100644 node_modules/core-js/README.md create mode 100644 node_modules/core-js/bower.json create mode 100644 node_modules/core-js/build/Gruntfile.ls create mode 100644 node_modules/core-js/build/build.ls create mode 100644 node_modules/core-js/build/config.js create mode 100644 node_modules/core-js/build/index.js create mode 100644 node_modules/core-js/client/core.js create mode 100644 node_modules/core-js/client/core.min.js create mode 100644 node_modules/core-js/client/core.min.js.map create mode 100644 node_modules/core-js/client/library.js create mode 100644 node_modules/core-js/client/library.min.js create mode 100644 node_modules/core-js/client/library.min.js.map create mode 100644 node_modules/core-js/client/shim.js create mode 100644 node_modules/core-js/client/shim.min.js create mode 100644 node_modules/core-js/client/shim.min.js.map create mode 100644 node_modules/core-js/core/_.js create mode 100644 node_modules/core-js/core/delay.js create mode 100644 node_modules/core-js/core/dict.js create mode 100644 node_modules/core-js/core/function.js create mode 100644 node_modules/core-js/core/index.js create mode 100644 node_modules/core-js/core/number.js create mode 100644 node_modules/core-js/core/object.js create mode 100644 node_modules/core-js/core/regexp.js create mode 100644 node_modules/core-js/core/string.js create mode 100644 node_modules/core-js/es5/index.js create mode 100644 node_modules/core-js/es6/array.js create mode 100644 node_modules/core-js/es6/date.js create mode 100644 node_modules/core-js/es6/function.js create mode 100644 node_modules/core-js/es6/index.js create mode 100644 node_modules/core-js/es6/map.js create mode 100644 node_modules/core-js/es6/math.js create mode 100644 node_modules/core-js/es6/number.js create mode 100644 node_modules/core-js/es6/object.js create mode 100644 node_modules/core-js/es6/parse-float.js create mode 100644 node_modules/core-js/es6/parse-int.js create mode 100644 node_modules/core-js/es6/promise.js create mode 100644 node_modules/core-js/es6/reflect.js create mode 100644 node_modules/core-js/es6/regexp.js create mode 100644 node_modules/core-js/es6/set.js create mode 100644 node_modules/core-js/es6/string.js create mode 100644 node_modules/core-js/es6/symbol.js create mode 100644 node_modules/core-js/es6/typed.js create mode 100644 node_modules/core-js/es6/weak-map.js create mode 100644 node_modules/core-js/es6/weak-set.js create mode 100644 node_modules/core-js/es7/array.js create mode 100644 node_modules/core-js/es7/asap.js create mode 100644 node_modules/core-js/es7/error.js create mode 100644 node_modules/core-js/es7/global.js create mode 100644 node_modules/core-js/es7/index.js create mode 100644 node_modules/core-js/es7/map.js create mode 100644 node_modules/core-js/es7/math.js create mode 100644 node_modules/core-js/es7/object.js create mode 100644 node_modules/core-js/es7/observable.js create mode 100644 node_modules/core-js/es7/promise.js create mode 100644 node_modules/core-js/es7/reflect.js create mode 100644 node_modules/core-js/es7/set.js create mode 100644 node_modules/core-js/es7/string.js create mode 100644 node_modules/core-js/es7/symbol.js create mode 100644 node_modules/core-js/es7/system.js create mode 100644 node_modules/core-js/es7/weak-map.js create mode 100644 node_modules/core-js/es7/weak-set.js create mode 100644 node_modules/core-js/fn/_.js create mode 100644 node_modules/core-js/fn/array/concat.js create mode 100644 node_modules/core-js/fn/array/copy-within.js create mode 100644 node_modules/core-js/fn/array/entries.js create mode 100644 node_modules/core-js/fn/array/every.js create mode 100644 node_modules/core-js/fn/array/fill.js create mode 100644 node_modules/core-js/fn/array/filter.js create mode 100644 node_modules/core-js/fn/array/find-index.js create mode 100644 node_modules/core-js/fn/array/find.js create mode 100644 node_modules/core-js/fn/array/flat-map.js create mode 100644 node_modules/core-js/fn/array/flatten.js create mode 100644 node_modules/core-js/fn/array/for-each.js create mode 100644 node_modules/core-js/fn/array/from.js create mode 100644 node_modules/core-js/fn/array/includes.js create mode 100644 node_modules/core-js/fn/array/index-of.js create mode 100644 node_modules/core-js/fn/array/index.js create mode 100644 node_modules/core-js/fn/array/is-array.js create mode 100644 node_modules/core-js/fn/array/iterator.js create mode 100644 node_modules/core-js/fn/array/join.js create mode 100644 node_modules/core-js/fn/array/keys.js create mode 100644 node_modules/core-js/fn/array/last-index-of.js create mode 100644 node_modules/core-js/fn/array/map.js create mode 100644 node_modules/core-js/fn/array/of.js create mode 100644 node_modules/core-js/fn/array/pop.js create mode 100644 node_modules/core-js/fn/array/push.js create mode 100644 node_modules/core-js/fn/array/reduce-right.js create mode 100644 node_modules/core-js/fn/array/reduce.js create mode 100644 node_modules/core-js/fn/array/reverse.js create mode 100644 node_modules/core-js/fn/array/shift.js create mode 100644 node_modules/core-js/fn/array/slice.js create mode 100644 node_modules/core-js/fn/array/some.js create mode 100644 node_modules/core-js/fn/array/sort.js create mode 100644 node_modules/core-js/fn/array/splice.js create mode 100644 node_modules/core-js/fn/array/unshift.js create mode 100644 node_modules/core-js/fn/array/values.js create mode 100644 node_modules/core-js/fn/array/virtual/copy-within.js create mode 100644 node_modules/core-js/fn/array/virtual/entries.js create mode 100644 node_modules/core-js/fn/array/virtual/every.js create mode 100644 node_modules/core-js/fn/array/virtual/fill.js create mode 100644 node_modules/core-js/fn/array/virtual/filter.js create mode 100644 node_modules/core-js/fn/array/virtual/find-index.js create mode 100644 node_modules/core-js/fn/array/virtual/find.js create mode 100644 node_modules/core-js/fn/array/virtual/flat-map.js create mode 100644 node_modules/core-js/fn/array/virtual/flatten.js create mode 100644 node_modules/core-js/fn/array/virtual/for-each.js create mode 100644 node_modules/core-js/fn/array/virtual/includes.js create mode 100644 node_modules/core-js/fn/array/virtual/index-of.js create mode 100644 node_modules/core-js/fn/array/virtual/index.js create mode 100644 node_modules/core-js/fn/array/virtual/iterator.js create mode 100644 node_modules/core-js/fn/array/virtual/join.js create mode 100644 node_modules/core-js/fn/array/virtual/keys.js create mode 100644 node_modules/core-js/fn/array/virtual/last-index-of.js create mode 100644 node_modules/core-js/fn/array/virtual/map.js create mode 100644 node_modules/core-js/fn/array/virtual/reduce-right.js create mode 100644 node_modules/core-js/fn/array/virtual/reduce.js create mode 100644 node_modules/core-js/fn/array/virtual/slice.js create mode 100644 node_modules/core-js/fn/array/virtual/some.js create mode 100644 node_modules/core-js/fn/array/virtual/sort.js create mode 100644 node_modules/core-js/fn/array/virtual/values.js create mode 100644 node_modules/core-js/fn/asap.js create mode 100644 node_modules/core-js/fn/clear-immediate.js create mode 100644 node_modules/core-js/fn/date/index.js create mode 100644 node_modules/core-js/fn/date/now.js create mode 100644 node_modules/core-js/fn/date/to-iso-string.js create mode 100644 node_modules/core-js/fn/date/to-json.js create mode 100644 node_modules/core-js/fn/date/to-primitive.js create mode 100644 node_modules/core-js/fn/date/to-string.js create mode 100644 node_modules/core-js/fn/delay.js create mode 100644 node_modules/core-js/fn/dict.js create mode 100644 node_modules/core-js/fn/dom-collections/index.js create mode 100644 node_modules/core-js/fn/dom-collections/iterator.js create mode 100644 node_modules/core-js/fn/error/index.js create mode 100644 node_modules/core-js/fn/error/is-error.js create mode 100644 node_modules/core-js/fn/function/bind.js create mode 100644 node_modules/core-js/fn/function/has-instance.js create mode 100644 node_modules/core-js/fn/function/index.js create mode 100644 node_modules/core-js/fn/function/name.js create mode 100644 node_modules/core-js/fn/function/part.js create mode 100644 node_modules/core-js/fn/function/virtual/bind.js create mode 100644 node_modules/core-js/fn/function/virtual/index.js create mode 100644 node_modules/core-js/fn/function/virtual/part.js create mode 100644 node_modules/core-js/fn/get-iterator-method.js create mode 100644 node_modules/core-js/fn/get-iterator.js create mode 100644 node_modules/core-js/fn/global.js create mode 100644 node_modules/core-js/fn/is-iterable.js create mode 100644 node_modules/core-js/fn/json/index.js create mode 100644 node_modules/core-js/fn/json/stringify.js create mode 100644 node_modules/core-js/fn/map.js create mode 100644 node_modules/core-js/fn/map/from.js create mode 100644 node_modules/core-js/fn/map/index.js create mode 100644 node_modules/core-js/fn/map/of.js create mode 100644 node_modules/core-js/fn/math/acosh.js create mode 100644 node_modules/core-js/fn/math/asinh.js create mode 100644 node_modules/core-js/fn/math/atanh.js create mode 100644 node_modules/core-js/fn/math/cbrt.js create mode 100644 node_modules/core-js/fn/math/clamp.js create mode 100644 node_modules/core-js/fn/math/clz32.js create mode 100644 node_modules/core-js/fn/math/cosh.js create mode 100644 node_modules/core-js/fn/math/deg-per-rad.js create mode 100644 node_modules/core-js/fn/math/degrees.js create mode 100644 node_modules/core-js/fn/math/expm1.js create mode 100644 node_modules/core-js/fn/math/fround.js create mode 100644 node_modules/core-js/fn/math/fscale.js create mode 100644 node_modules/core-js/fn/math/hypot.js create mode 100644 node_modules/core-js/fn/math/iaddh.js create mode 100644 node_modules/core-js/fn/math/imul.js create mode 100644 node_modules/core-js/fn/math/imulh.js create mode 100644 node_modules/core-js/fn/math/index.js create mode 100644 node_modules/core-js/fn/math/isubh.js create mode 100644 node_modules/core-js/fn/math/log10.js create mode 100644 node_modules/core-js/fn/math/log1p.js create mode 100644 node_modules/core-js/fn/math/log2.js create mode 100644 node_modules/core-js/fn/math/rad-per-deg.js create mode 100644 node_modules/core-js/fn/math/radians.js create mode 100644 node_modules/core-js/fn/math/scale.js create mode 100644 node_modules/core-js/fn/math/sign.js create mode 100644 node_modules/core-js/fn/math/signbit.js create mode 100644 node_modules/core-js/fn/math/sinh.js create mode 100644 node_modules/core-js/fn/math/tanh.js create mode 100644 node_modules/core-js/fn/math/trunc.js create mode 100644 node_modules/core-js/fn/math/umulh.js create mode 100644 node_modules/core-js/fn/number/constructor.js create mode 100644 node_modules/core-js/fn/number/epsilon.js create mode 100644 node_modules/core-js/fn/number/index.js create mode 100644 node_modules/core-js/fn/number/is-finite.js create mode 100644 node_modules/core-js/fn/number/is-integer.js create mode 100644 node_modules/core-js/fn/number/is-nan.js create mode 100644 node_modules/core-js/fn/number/is-safe-integer.js create mode 100644 node_modules/core-js/fn/number/iterator.js create mode 100644 node_modules/core-js/fn/number/max-safe-integer.js create mode 100644 node_modules/core-js/fn/number/min-safe-integer.js create mode 100644 node_modules/core-js/fn/number/parse-float.js create mode 100644 node_modules/core-js/fn/number/parse-int.js create mode 100644 node_modules/core-js/fn/number/to-fixed.js create mode 100644 node_modules/core-js/fn/number/to-precision.js create mode 100644 node_modules/core-js/fn/number/virtual/index.js create mode 100644 node_modules/core-js/fn/number/virtual/iterator.js create mode 100644 node_modules/core-js/fn/number/virtual/to-fixed.js create mode 100644 node_modules/core-js/fn/number/virtual/to-precision.js create mode 100644 node_modules/core-js/fn/object/assign.js create mode 100644 node_modules/core-js/fn/object/classof.js create mode 100644 node_modules/core-js/fn/object/create.js create mode 100644 node_modules/core-js/fn/object/define-getter.js create mode 100644 node_modules/core-js/fn/object/define-properties.js create mode 100644 node_modules/core-js/fn/object/define-property.js create mode 100644 node_modules/core-js/fn/object/define-setter.js create mode 100644 node_modules/core-js/fn/object/define.js create mode 100644 node_modules/core-js/fn/object/entries.js create mode 100644 node_modules/core-js/fn/object/freeze.js create mode 100644 node_modules/core-js/fn/object/get-own-property-descriptor.js create mode 100644 node_modules/core-js/fn/object/get-own-property-descriptors.js create mode 100644 node_modules/core-js/fn/object/get-own-property-names.js create mode 100644 node_modules/core-js/fn/object/get-own-property-symbols.js create mode 100644 node_modules/core-js/fn/object/get-prototype-of.js create mode 100644 node_modules/core-js/fn/object/index.js create mode 100644 node_modules/core-js/fn/object/is-extensible.js create mode 100644 node_modules/core-js/fn/object/is-frozen.js create mode 100644 node_modules/core-js/fn/object/is-object.js create mode 100644 node_modules/core-js/fn/object/is-sealed.js create mode 100644 node_modules/core-js/fn/object/is.js create mode 100644 node_modules/core-js/fn/object/keys.js create mode 100644 node_modules/core-js/fn/object/lookup-getter.js create mode 100644 node_modules/core-js/fn/object/lookup-setter.js create mode 100644 node_modules/core-js/fn/object/make.js create mode 100644 node_modules/core-js/fn/object/prevent-extensions.js create mode 100644 node_modules/core-js/fn/object/seal.js create mode 100644 node_modules/core-js/fn/object/set-prototype-of.js create mode 100644 node_modules/core-js/fn/object/values.js create mode 100644 node_modules/core-js/fn/observable.js create mode 100644 node_modules/core-js/fn/parse-float.js create mode 100644 node_modules/core-js/fn/parse-int.js create mode 100644 node_modules/core-js/fn/promise.js create mode 100644 node_modules/core-js/fn/promise/finally.js create mode 100644 node_modules/core-js/fn/promise/index.js create mode 100644 node_modules/core-js/fn/promise/try.js create mode 100644 node_modules/core-js/fn/reflect/apply.js create mode 100644 node_modules/core-js/fn/reflect/construct.js create mode 100644 node_modules/core-js/fn/reflect/define-metadata.js create mode 100644 node_modules/core-js/fn/reflect/define-property.js create mode 100644 node_modules/core-js/fn/reflect/delete-metadata.js create mode 100644 node_modules/core-js/fn/reflect/delete-property.js create mode 100644 node_modules/core-js/fn/reflect/enumerate.js create mode 100644 node_modules/core-js/fn/reflect/get-metadata-keys.js create mode 100644 node_modules/core-js/fn/reflect/get-metadata.js create mode 100644 node_modules/core-js/fn/reflect/get-own-metadata-keys.js create mode 100644 node_modules/core-js/fn/reflect/get-own-metadata.js create mode 100644 node_modules/core-js/fn/reflect/get-own-property-descriptor.js create mode 100644 node_modules/core-js/fn/reflect/get-prototype-of.js create mode 100644 node_modules/core-js/fn/reflect/get.js create mode 100644 node_modules/core-js/fn/reflect/has-metadata.js create mode 100644 node_modules/core-js/fn/reflect/has-own-metadata.js create mode 100644 node_modules/core-js/fn/reflect/has.js create mode 100644 node_modules/core-js/fn/reflect/index.js create mode 100644 node_modules/core-js/fn/reflect/is-extensible.js create mode 100644 node_modules/core-js/fn/reflect/metadata.js create mode 100644 node_modules/core-js/fn/reflect/own-keys.js create mode 100644 node_modules/core-js/fn/reflect/prevent-extensions.js create mode 100644 node_modules/core-js/fn/reflect/set-prototype-of.js create mode 100644 node_modules/core-js/fn/reflect/set.js create mode 100644 node_modules/core-js/fn/regexp/constructor.js create mode 100644 node_modules/core-js/fn/regexp/escape.js create mode 100644 node_modules/core-js/fn/regexp/flags.js create mode 100644 node_modules/core-js/fn/regexp/index.js create mode 100644 node_modules/core-js/fn/regexp/match.js create mode 100644 node_modules/core-js/fn/regexp/replace.js create mode 100644 node_modules/core-js/fn/regexp/search.js create mode 100644 node_modules/core-js/fn/regexp/split.js create mode 100644 node_modules/core-js/fn/regexp/to-string.js create mode 100644 node_modules/core-js/fn/set-immediate.js create mode 100644 node_modules/core-js/fn/set-interval.js create mode 100644 node_modules/core-js/fn/set-timeout.js create mode 100644 node_modules/core-js/fn/set.js create mode 100644 node_modules/core-js/fn/set/from.js create mode 100644 node_modules/core-js/fn/set/index.js create mode 100644 node_modules/core-js/fn/set/of.js create mode 100644 node_modules/core-js/fn/string/anchor.js create mode 100644 node_modules/core-js/fn/string/at.js create mode 100644 node_modules/core-js/fn/string/big.js create mode 100644 node_modules/core-js/fn/string/blink.js create mode 100644 node_modules/core-js/fn/string/bold.js create mode 100644 node_modules/core-js/fn/string/code-point-at.js create mode 100644 node_modules/core-js/fn/string/ends-with.js create mode 100644 node_modules/core-js/fn/string/escape-html.js create mode 100644 node_modules/core-js/fn/string/fixed.js create mode 100644 node_modules/core-js/fn/string/fontcolor.js create mode 100644 node_modules/core-js/fn/string/fontsize.js create mode 100644 node_modules/core-js/fn/string/from-code-point.js create mode 100644 node_modules/core-js/fn/string/includes.js create mode 100644 node_modules/core-js/fn/string/index.js create mode 100644 node_modules/core-js/fn/string/italics.js create mode 100644 node_modules/core-js/fn/string/iterator.js create mode 100644 node_modules/core-js/fn/string/link.js create mode 100644 node_modules/core-js/fn/string/match-all.js create mode 100644 node_modules/core-js/fn/string/pad-end.js create mode 100644 node_modules/core-js/fn/string/pad-start.js create mode 100644 node_modules/core-js/fn/string/raw.js create mode 100644 node_modules/core-js/fn/string/repeat.js create mode 100644 node_modules/core-js/fn/string/small.js create mode 100644 node_modules/core-js/fn/string/starts-with.js create mode 100644 node_modules/core-js/fn/string/strike.js create mode 100644 node_modules/core-js/fn/string/sub.js create mode 100644 node_modules/core-js/fn/string/sup.js create mode 100644 node_modules/core-js/fn/string/trim-end.js create mode 100644 node_modules/core-js/fn/string/trim-left.js create mode 100644 node_modules/core-js/fn/string/trim-right.js create mode 100644 node_modules/core-js/fn/string/trim-start.js create mode 100644 node_modules/core-js/fn/string/trim.js create mode 100644 node_modules/core-js/fn/string/unescape-html.js create mode 100644 node_modules/core-js/fn/string/virtual/anchor.js create mode 100644 node_modules/core-js/fn/string/virtual/at.js create mode 100644 node_modules/core-js/fn/string/virtual/big.js create mode 100644 node_modules/core-js/fn/string/virtual/blink.js create mode 100644 node_modules/core-js/fn/string/virtual/bold.js create mode 100644 node_modules/core-js/fn/string/virtual/code-point-at.js create mode 100644 node_modules/core-js/fn/string/virtual/ends-with.js create mode 100644 node_modules/core-js/fn/string/virtual/escape-html.js create mode 100644 node_modules/core-js/fn/string/virtual/fixed.js create mode 100644 node_modules/core-js/fn/string/virtual/fontcolor.js create mode 100644 node_modules/core-js/fn/string/virtual/fontsize.js create mode 100644 node_modules/core-js/fn/string/virtual/includes.js create mode 100644 node_modules/core-js/fn/string/virtual/index.js create mode 100644 node_modules/core-js/fn/string/virtual/italics.js create mode 100644 node_modules/core-js/fn/string/virtual/iterator.js create mode 100644 node_modules/core-js/fn/string/virtual/link.js create mode 100644 node_modules/core-js/fn/string/virtual/match-all.js create mode 100644 node_modules/core-js/fn/string/virtual/pad-end.js create mode 100644 node_modules/core-js/fn/string/virtual/pad-start.js create mode 100644 node_modules/core-js/fn/string/virtual/repeat.js create mode 100644 node_modules/core-js/fn/string/virtual/small.js create mode 100644 node_modules/core-js/fn/string/virtual/starts-with.js create mode 100644 node_modules/core-js/fn/string/virtual/strike.js create mode 100644 node_modules/core-js/fn/string/virtual/sub.js create mode 100644 node_modules/core-js/fn/string/virtual/sup.js create mode 100644 node_modules/core-js/fn/string/virtual/trim-end.js create mode 100644 node_modules/core-js/fn/string/virtual/trim-left.js create mode 100644 node_modules/core-js/fn/string/virtual/trim-right.js create mode 100644 node_modules/core-js/fn/string/virtual/trim-start.js create mode 100644 node_modules/core-js/fn/string/virtual/trim.js create mode 100644 node_modules/core-js/fn/string/virtual/unescape-html.js create mode 100644 node_modules/core-js/fn/symbol/async-iterator.js create mode 100644 node_modules/core-js/fn/symbol/for.js create mode 100644 node_modules/core-js/fn/symbol/has-instance.js create mode 100644 node_modules/core-js/fn/symbol/index.js create mode 100644 node_modules/core-js/fn/symbol/is-concat-spreadable.js create mode 100644 node_modules/core-js/fn/symbol/iterator.js create mode 100644 node_modules/core-js/fn/symbol/key-for.js create mode 100644 node_modules/core-js/fn/symbol/match.js create mode 100644 node_modules/core-js/fn/symbol/observable.js create mode 100644 node_modules/core-js/fn/symbol/replace.js create mode 100644 node_modules/core-js/fn/symbol/search.js create mode 100644 node_modules/core-js/fn/symbol/species.js create mode 100644 node_modules/core-js/fn/symbol/split.js create mode 100644 node_modules/core-js/fn/symbol/to-primitive.js create mode 100644 node_modules/core-js/fn/symbol/to-string-tag.js create mode 100644 node_modules/core-js/fn/symbol/unscopables.js create mode 100644 node_modules/core-js/fn/system/global.js create mode 100644 node_modules/core-js/fn/system/index.js create mode 100644 node_modules/core-js/fn/typed/array-buffer.js create mode 100644 node_modules/core-js/fn/typed/data-view.js create mode 100644 node_modules/core-js/fn/typed/float32-array.js create mode 100644 node_modules/core-js/fn/typed/float64-array.js create mode 100644 node_modules/core-js/fn/typed/index.js create mode 100644 node_modules/core-js/fn/typed/int16-array.js create mode 100644 node_modules/core-js/fn/typed/int32-array.js create mode 100644 node_modules/core-js/fn/typed/int8-array.js create mode 100644 node_modules/core-js/fn/typed/uint16-array.js create mode 100644 node_modules/core-js/fn/typed/uint32-array.js create mode 100644 node_modules/core-js/fn/typed/uint8-array.js create mode 100644 node_modules/core-js/fn/typed/uint8-clamped-array.js create mode 100644 node_modules/core-js/fn/weak-map.js create mode 100644 node_modules/core-js/fn/weak-map/from.js create mode 100644 node_modules/core-js/fn/weak-map/index.js create mode 100644 node_modules/core-js/fn/weak-map/of.js create mode 100644 node_modules/core-js/fn/weak-set.js create mode 100644 node_modules/core-js/fn/weak-set/from.js create mode 100644 node_modules/core-js/fn/weak-set/index.js create mode 100644 node_modules/core-js/fn/weak-set/of.js create mode 100644 node_modules/core-js/index.js create mode 100644 node_modules/core-js/library/core/_.js create mode 100644 node_modules/core-js/library/core/delay.js create mode 100644 node_modules/core-js/library/core/dict.js create mode 100644 node_modules/core-js/library/core/function.js create mode 100644 node_modules/core-js/library/core/index.js create mode 100644 node_modules/core-js/library/core/number.js create mode 100644 node_modules/core-js/library/core/object.js create mode 100644 node_modules/core-js/library/core/regexp.js create mode 100644 node_modules/core-js/library/core/string.js create mode 100644 node_modules/core-js/library/es5/index.js create mode 100644 node_modules/core-js/library/es6/array.js create mode 100644 node_modules/core-js/library/es6/date.js create mode 100644 node_modules/core-js/library/es6/function.js create mode 100644 node_modules/core-js/library/es6/index.js create mode 100644 node_modules/core-js/library/es6/map.js create mode 100644 node_modules/core-js/library/es6/math.js create mode 100644 node_modules/core-js/library/es6/number.js create mode 100644 node_modules/core-js/library/es6/object.js create mode 100644 node_modules/core-js/library/es6/parse-float.js create mode 100644 node_modules/core-js/library/es6/parse-int.js create mode 100644 node_modules/core-js/library/es6/promise.js create mode 100644 node_modules/core-js/library/es6/reflect.js create mode 100644 node_modules/core-js/library/es6/regexp.js create mode 100644 node_modules/core-js/library/es6/set.js create mode 100644 node_modules/core-js/library/es6/string.js create mode 100644 node_modules/core-js/library/es6/symbol.js create mode 100644 node_modules/core-js/library/es6/typed.js create mode 100644 node_modules/core-js/library/es6/weak-map.js create mode 100644 node_modules/core-js/library/es6/weak-set.js create mode 100644 node_modules/core-js/library/es7/array.js create mode 100644 node_modules/core-js/library/es7/asap.js create mode 100644 node_modules/core-js/library/es7/error.js create mode 100644 node_modules/core-js/library/es7/global.js create mode 100644 node_modules/core-js/library/es7/index.js create mode 100644 node_modules/core-js/library/es7/map.js create mode 100644 node_modules/core-js/library/es7/math.js create mode 100644 node_modules/core-js/library/es7/object.js create mode 100644 node_modules/core-js/library/es7/observable.js create mode 100644 node_modules/core-js/library/es7/promise.js create mode 100644 node_modules/core-js/library/es7/reflect.js create mode 100644 node_modules/core-js/library/es7/set.js create mode 100644 node_modules/core-js/library/es7/string.js create mode 100644 node_modules/core-js/library/es7/symbol.js create mode 100644 node_modules/core-js/library/es7/system.js create mode 100644 node_modules/core-js/library/es7/weak-map.js create mode 100644 node_modules/core-js/library/es7/weak-set.js create mode 100644 node_modules/core-js/library/fn/_.js create mode 100644 node_modules/core-js/library/fn/array/concat.js create mode 100644 node_modules/core-js/library/fn/array/copy-within.js create mode 100644 node_modules/core-js/library/fn/array/entries.js create mode 100644 node_modules/core-js/library/fn/array/every.js create mode 100644 node_modules/core-js/library/fn/array/fill.js create mode 100644 node_modules/core-js/library/fn/array/filter.js create mode 100644 node_modules/core-js/library/fn/array/find-index.js create mode 100644 node_modules/core-js/library/fn/array/find.js create mode 100644 node_modules/core-js/library/fn/array/flat-map.js create mode 100644 node_modules/core-js/library/fn/array/flatten.js create mode 100644 node_modules/core-js/library/fn/array/for-each.js create mode 100644 node_modules/core-js/library/fn/array/from.js create mode 100644 node_modules/core-js/library/fn/array/includes.js create mode 100644 node_modules/core-js/library/fn/array/index-of.js create mode 100644 node_modules/core-js/library/fn/array/index.js create mode 100644 node_modules/core-js/library/fn/array/is-array.js create mode 100644 node_modules/core-js/library/fn/array/iterator.js create mode 100644 node_modules/core-js/library/fn/array/join.js create mode 100644 node_modules/core-js/library/fn/array/keys.js create mode 100644 node_modules/core-js/library/fn/array/last-index-of.js create mode 100644 node_modules/core-js/library/fn/array/map.js create mode 100644 node_modules/core-js/library/fn/array/of.js create mode 100644 node_modules/core-js/library/fn/array/pop.js create mode 100644 node_modules/core-js/library/fn/array/push.js create mode 100644 node_modules/core-js/library/fn/array/reduce-right.js create mode 100644 node_modules/core-js/library/fn/array/reduce.js create mode 100644 node_modules/core-js/library/fn/array/reverse.js create mode 100644 node_modules/core-js/library/fn/array/shift.js create mode 100644 node_modules/core-js/library/fn/array/slice.js create mode 100644 node_modules/core-js/library/fn/array/some.js create mode 100644 node_modules/core-js/library/fn/array/sort.js create mode 100644 node_modules/core-js/library/fn/array/splice.js create mode 100644 node_modules/core-js/library/fn/array/unshift.js create mode 100644 node_modules/core-js/library/fn/array/values.js create mode 100644 node_modules/core-js/library/fn/array/virtual/copy-within.js create mode 100644 node_modules/core-js/library/fn/array/virtual/entries.js create mode 100644 node_modules/core-js/library/fn/array/virtual/every.js create mode 100644 node_modules/core-js/library/fn/array/virtual/fill.js create mode 100644 node_modules/core-js/library/fn/array/virtual/filter.js create mode 100644 node_modules/core-js/library/fn/array/virtual/find-index.js create mode 100644 node_modules/core-js/library/fn/array/virtual/find.js create mode 100644 node_modules/core-js/library/fn/array/virtual/flat-map.js create mode 100644 node_modules/core-js/library/fn/array/virtual/flatten.js create mode 100644 node_modules/core-js/library/fn/array/virtual/for-each.js create mode 100644 node_modules/core-js/library/fn/array/virtual/includes.js create mode 100644 node_modules/core-js/library/fn/array/virtual/index-of.js create mode 100644 node_modules/core-js/library/fn/array/virtual/index.js create mode 100644 node_modules/core-js/library/fn/array/virtual/iterator.js create mode 100644 node_modules/core-js/library/fn/array/virtual/join.js create mode 100644 node_modules/core-js/library/fn/array/virtual/keys.js create mode 100644 node_modules/core-js/library/fn/array/virtual/last-index-of.js create mode 100644 node_modules/core-js/library/fn/array/virtual/map.js create mode 100644 node_modules/core-js/library/fn/array/virtual/reduce-right.js create mode 100644 node_modules/core-js/library/fn/array/virtual/reduce.js create mode 100644 node_modules/core-js/library/fn/array/virtual/slice.js create mode 100644 node_modules/core-js/library/fn/array/virtual/some.js create mode 100644 node_modules/core-js/library/fn/array/virtual/sort.js create mode 100644 node_modules/core-js/library/fn/array/virtual/values.js create mode 100644 node_modules/core-js/library/fn/asap.js create mode 100644 node_modules/core-js/library/fn/clear-immediate.js create mode 100644 node_modules/core-js/library/fn/date/index.js create mode 100644 node_modules/core-js/library/fn/date/now.js create mode 100644 node_modules/core-js/library/fn/date/to-iso-string.js create mode 100644 node_modules/core-js/library/fn/date/to-json.js create mode 100644 node_modules/core-js/library/fn/date/to-primitive.js create mode 100644 node_modules/core-js/library/fn/date/to-string.js create mode 100644 node_modules/core-js/library/fn/delay.js create mode 100644 node_modules/core-js/library/fn/dict.js create mode 100644 node_modules/core-js/library/fn/dom-collections/index.js create mode 100644 node_modules/core-js/library/fn/dom-collections/iterator.js create mode 100644 node_modules/core-js/library/fn/error/index.js create mode 100644 node_modules/core-js/library/fn/error/is-error.js create mode 100644 node_modules/core-js/library/fn/function/bind.js create mode 100644 node_modules/core-js/library/fn/function/has-instance.js create mode 100644 node_modules/core-js/library/fn/function/index.js create mode 100644 node_modules/core-js/library/fn/function/name.js create mode 100644 node_modules/core-js/library/fn/function/part.js create mode 100644 node_modules/core-js/library/fn/function/virtual/bind.js create mode 100644 node_modules/core-js/library/fn/function/virtual/index.js create mode 100644 node_modules/core-js/library/fn/function/virtual/part.js create mode 100644 node_modules/core-js/library/fn/get-iterator-method.js create mode 100644 node_modules/core-js/library/fn/get-iterator.js create mode 100644 node_modules/core-js/library/fn/global.js create mode 100644 node_modules/core-js/library/fn/is-iterable.js create mode 100644 node_modules/core-js/library/fn/json/index.js create mode 100644 node_modules/core-js/library/fn/json/stringify.js create mode 100644 node_modules/core-js/library/fn/map.js create mode 100644 node_modules/core-js/library/fn/map/from.js create mode 100644 node_modules/core-js/library/fn/map/index.js create mode 100644 node_modules/core-js/library/fn/map/of.js create mode 100644 node_modules/core-js/library/fn/math/acosh.js create mode 100644 node_modules/core-js/library/fn/math/asinh.js create mode 100644 node_modules/core-js/library/fn/math/atanh.js create mode 100644 node_modules/core-js/library/fn/math/cbrt.js create mode 100644 node_modules/core-js/library/fn/math/clamp.js create mode 100644 node_modules/core-js/library/fn/math/clz32.js create mode 100644 node_modules/core-js/library/fn/math/cosh.js create mode 100644 node_modules/core-js/library/fn/math/deg-per-rad.js create mode 100644 node_modules/core-js/library/fn/math/degrees.js create mode 100644 node_modules/core-js/library/fn/math/expm1.js create mode 100644 node_modules/core-js/library/fn/math/fround.js create mode 100644 node_modules/core-js/library/fn/math/fscale.js create mode 100644 node_modules/core-js/library/fn/math/hypot.js create mode 100644 node_modules/core-js/library/fn/math/iaddh.js create mode 100644 node_modules/core-js/library/fn/math/imul.js create mode 100644 node_modules/core-js/library/fn/math/imulh.js create mode 100644 node_modules/core-js/library/fn/math/index.js create mode 100644 node_modules/core-js/library/fn/math/isubh.js create mode 100644 node_modules/core-js/library/fn/math/log10.js create mode 100644 node_modules/core-js/library/fn/math/log1p.js create mode 100644 node_modules/core-js/library/fn/math/log2.js create mode 100644 node_modules/core-js/library/fn/math/rad-per-deg.js create mode 100644 node_modules/core-js/library/fn/math/radians.js create mode 100644 node_modules/core-js/library/fn/math/scale.js create mode 100644 node_modules/core-js/library/fn/math/sign.js create mode 100644 node_modules/core-js/library/fn/math/signbit.js create mode 100644 node_modules/core-js/library/fn/math/sinh.js create mode 100644 node_modules/core-js/library/fn/math/tanh.js create mode 100644 node_modules/core-js/library/fn/math/trunc.js create mode 100644 node_modules/core-js/library/fn/math/umulh.js create mode 100644 node_modules/core-js/library/fn/number/constructor.js create mode 100644 node_modules/core-js/library/fn/number/epsilon.js create mode 100644 node_modules/core-js/library/fn/number/index.js create mode 100644 node_modules/core-js/library/fn/number/is-finite.js create mode 100644 node_modules/core-js/library/fn/number/is-integer.js create mode 100644 node_modules/core-js/library/fn/number/is-nan.js create mode 100644 node_modules/core-js/library/fn/number/is-safe-integer.js create mode 100644 node_modules/core-js/library/fn/number/iterator.js create mode 100644 node_modules/core-js/library/fn/number/max-safe-integer.js create mode 100644 node_modules/core-js/library/fn/number/min-safe-integer.js create mode 100644 node_modules/core-js/library/fn/number/parse-float.js create mode 100644 node_modules/core-js/library/fn/number/parse-int.js create mode 100644 node_modules/core-js/library/fn/number/to-fixed.js create mode 100644 node_modules/core-js/library/fn/number/to-precision.js create mode 100644 node_modules/core-js/library/fn/number/virtual/index.js create mode 100644 node_modules/core-js/library/fn/number/virtual/iterator.js create mode 100644 node_modules/core-js/library/fn/number/virtual/to-fixed.js create mode 100644 node_modules/core-js/library/fn/number/virtual/to-precision.js create mode 100644 node_modules/core-js/library/fn/object/assign.js create mode 100644 node_modules/core-js/library/fn/object/classof.js create mode 100644 node_modules/core-js/library/fn/object/create.js create mode 100644 node_modules/core-js/library/fn/object/define-getter.js create mode 100644 node_modules/core-js/library/fn/object/define-properties.js create mode 100644 node_modules/core-js/library/fn/object/define-property.js create mode 100644 node_modules/core-js/library/fn/object/define-setter.js create mode 100644 node_modules/core-js/library/fn/object/define.js create mode 100644 node_modules/core-js/library/fn/object/entries.js create mode 100644 node_modules/core-js/library/fn/object/freeze.js create mode 100644 node_modules/core-js/library/fn/object/get-own-property-descriptor.js create mode 100644 node_modules/core-js/library/fn/object/get-own-property-descriptors.js create mode 100644 node_modules/core-js/library/fn/object/get-own-property-names.js create mode 100644 node_modules/core-js/library/fn/object/get-own-property-symbols.js create mode 100644 node_modules/core-js/library/fn/object/get-prototype-of.js create mode 100644 node_modules/core-js/library/fn/object/index.js create mode 100644 node_modules/core-js/library/fn/object/is-extensible.js create mode 100644 node_modules/core-js/library/fn/object/is-frozen.js create mode 100644 node_modules/core-js/library/fn/object/is-object.js create mode 100644 node_modules/core-js/library/fn/object/is-sealed.js create mode 100644 node_modules/core-js/library/fn/object/is.js create mode 100644 node_modules/core-js/library/fn/object/keys.js create mode 100644 node_modules/core-js/library/fn/object/lookup-getter.js create mode 100644 node_modules/core-js/library/fn/object/lookup-setter.js create mode 100644 node_modules/core-js/library/fn/object/make.js create mode 100644 node_modules/core-js/library/fn/object/prevent-extensions.js create mode 100644 node_modules/core-js/library/fn/object/seal.js create mode 100644 node_modules/core-js/library/fn/object/set-prototype-of.js create mode 100644 node_modules/core-js/library/fn/object/values.js create mode 100644 node_modules/core-js/library/fn/observable.js create mode 100644 node_modules/core-js/library/fn/parse-float.js create mode 100644 node_modules/core-js/library/fn/parse-int.js create mode 100644 node_modules/core-js/library/fn/promise.js create mode 100644 node_modules/core-js/library/fn/promise/finally.js create mode 100644 node_modules/core-js/library/fn/promise/index.js create mode 100644 node_modules/core-js/library/fn/promise/try.js create mode 100644 node_modules/core-js/library/fn/reflect/apply.js create mode 100644 node_modules/core-js/library/fn/reflect/construct.js create mode 100644 node_modules/core-js/library/fn/reflect/define-metadata.js create mode 100644 node_modules/core-js/library/fn/reflect/define-property.js create mode 100644 node_modules/core-js/library/fn/reflect/delete-metadata.js create mode 100644 node_modules/core-js/library/fn/reflect/delete-property.js create mode 100644 node_modules/core-js/library/fn/reflect/enumerate.js create mode 100644 node_modules/core-js/library/fn/reflect/get-metadata-keys.js create mode 100644 node_modules/core-js/library/fn/reflect/get-metadata.js create mode 100644 node_modules/core-js/library/fn/reflect/get-own-metadata-keys.js create mode 100644 node_modules/core-js/library/fn/reflect/get-own-metadata.js create mode 100644 node_modules/core-js/library/fn/reflect/get-own-property-descriptor.js create mode 100644 node_modules/core-js/library/fn/reflect/get-prototype-of.js create mode 100644 node_modules/core-js/library/fn/reflect/get.js create mode 100644 node_modules/core-js/library/fn/reflect/has-metadata.js create mode 100644 node_modules/core-js/library/fn/reflect/has-own-metadata.js create mode 100644 node_modules/core-js/library/fn/reflect/has.js create mode 100644 node_modules/core-js/library/fn/reflect/index.js create mode 100644 node_modules/core-js/library/fn/reflect/is-extensible.js create mode 100644 node_modules/core-js/library/fn/reflect/metadata.js create mode 100644 node_modules/core-js/library/fn/reflect/own-keys.js create mode 100644 node_modules/core-js/library/fn/reflect/prevent-extensions.js create mode 100644 node_modules/core-js/library/fn/reflect/set-prototype-of.js create mode 100644 node_modules/core-js/library/fn/reflect/set.js create mode 100644 node_modules/core-js/library/fn/regexp/constructor.js create mode 100644 node_modules/core-js/library/fn/regexp/escape.js create mode 100644 node_modules/core-js/library/fn/regexp/flags.js create mode 100644 node_modules/core-js/library/fn/regexp/index.js create mode 100644 node_modules/core-js/library/fn/regexp/match.js create mode 100644 node_modules/core-js/library/fn/regexp/replace.js create mode 100644 node_modules/core-js/library/fn/regexp/search.js create mode 100644 node_modules/core-js/library/fn/regexp/split.js create mode 100644 node_modules/core-js/library/fn/regexp/to-string.js create mode 100644 node_modules/core-js/library/fn/set-immediate.js create mode 100644 node_modules/core-js/library/fn/set-interval.js create mode 100644 node_modules/core-js/library/fn/set-timeout.js create mode 100644 node_modules/core-js/library/fn/set.js create mode 100644 node_modules/core-js/library/fn/set/from.js create mode 100644 node_modules/core-js/library/fn/set/index.js create mode 100644 node_modules/core-js/library/fn/set/of.js create mode 100644 node_modules/core-js/library/fn/string/anchor.js create mode 100644 node_modules/core-js/library/fn/string/at.js create mode 100644 node_modules/core-js/library/fn/string/big.js create mode 100644 node_modules/core-js/library/fn/string/blink.js create mode 100644 node_modules/core-js/library/fn/string/bold.js create mode 100644 node_modules/core-js/library/fn/string/code-point-at.js create mode 100644 node_modules/core-js/library/fn/string/ends-with.js create mode 100644 node_modules/core-js/library/fn/string/escape-html.js create mode 100644 node_modules/core-js/library/fn/string/fixed.js create mode 100644 node_modules/core-js/library/fn/string/fontcolor.js create mode 100644 node_modules/core-js/library/fn/string/fontsize.js create mode 100644 node_modules/core-js/library/fn/string/from-code-point.js create mode 100644 node_modules/core-js/library/fn/string/includes.js create mode 100644 node_modules/core-js/library/fn/string/index.js create mode 100644 node_modules/core-js/library/fn/string/italics.js create mode 100644 node_modules/core-js/library/fn/string/iterator.js create mode 100644 node_modules/core-js/library/fn/string/link.js create mode 100644 node_modules/core-js/library/fn/string/match-all.js create mode 100644 node_modules/core-js/library/fn/string/pad-end.js create mode 100644 node_modules/core-js/library/fn/string/pad-start.js create mode 100644 node_modules/core-js/library/fn/string/raw.js create mode 100644 node_modules/core-js/library/fn/string/repeat.js create mode 100644 node_modules/core-js/library/fn/string/small.js create mode 100644 node_modules/core-js/library/fn/string/starts-with.js create mode 100644 node_modules/core-js/library/fn/string/strike.js create mode 100644 node_modules/core-js/library/fn/string/sub.js create mode 100644 node_modules/core-js/library/fn/string/sup.js create mode 100644 node_modules/core-js/library/fn/string/trim-end.js create mode 100644 node_modules/core-js/library/fn/string/trim-left.js create mode 100644 node_modules/core-js/library/fn/string/trim-right.js create mode 100644 node_modules/core-js/library/fn/string/trim-start.js create mode 100644 node_modules/core-js/library/fn/string/trim.js create mode 100644 node_modules/core-js/library/fn/string/unescape-html.js create mode 100644 node_modules/core-js/library/fn/string/virtual/anchor.js create mode 100644 node_modules/core-js/library/fn/string/virtual/at.js create mode 100644 node_modules/core-js/library/fn/string/virtual/big.js create mode 100644 node_modules/core-js/library/fn/string/virtual/blink.js create mode 100644 node_modules/core-js/library/fn/string/virtual/bold.js create mode 100644 node_modules/core-js/library/fn/string/virtual/code-point-at.js create mode 100644 node_modules/core-js/library/fn/string/virtual/ends-with.js create mode 100644 node_modules/core-js/library/fn/string/virtual/escape-html.js create mode 100644 node_modules/core-js/library/fn/string/virtual/fixed.js create mode 100644 node_modules/core-js/library/fn/string/virtual/fontcolor.js create mode 100644 node_modules/core-js/library/fn/string/virtual/fontsize.js create mode 100644 node_modules/core-js/library/fn/string/virtual/includes.js create mode 100644 node_modules/core-js/library/fn/string/virtual/index.js create mode 100644 node_modules/core-js/library/fn/string/virtual/italics.js create mode 100644 node_modules/core-js/library/fn/string/virtual/iterator.js create mode 100644 node_modules/core-js/library/fn/string/virtual/link.js create mode 100644 node_modules/core-js/library/fn/string/virtual/match-all.js create mode 100644 node_modules/core-js/library/fn/string/virtual/pad-end.js create mode 100644 node_modules/core-js/library/fn/string/virtual/pad-start.js create mode 100644 node_modules/core-js/library/fn/string/virtual/repeat.js create mode 100644 node_modules/core-js/library/fn/string/virtual/small.js create mode 100644 node_modules/core-js/library/fn/string/virtual/starts-with.js create mode 100644 node_modules/core-js/library/fn/string/virtual/strike.js create mode 100644 node_modules/core-js/library/fn/string/virtual/sub.js create mode 100644 node_modules/core-js/library/fn/string/virtual/sup.js create mode 100644 node_modules/core-js/library/fn/string/virtual/trim-end.js create mode 100644 node_modules/core-js/library/fn/string/virtual/trim-left.js create mode 100644 node_modules/core-js/library/fn/string/virtual/trim-right.js create mode 100644 node_modules/core-js/library/fn/string/virtual/trim-start.js create mode 100644 node_modules/core-js/library/fn/string/virtual/trim.js create mode 100644 node_modules/core-js/library/fn/string/virtual/unescape-html.js create mode 100644 node_modules/core-js/library/fn/symbol/async-iterator.js create mode 100644 node_modules/core-js/library/fn/symbol/for.js create mode 100644 node_modules/core-js/library/fn/symbol/has-instance.js create mode 100644 node_modules/core-js/library/fn/symbol/index.js create mode 100644 node_modules/core-js/library/fn/symbol/is-concat-spreadable.js create mode 100644 node_modules/core-js/library/fn/symbol/iterator.js create mode 100644 node_modules/core-js/library/fn/symbol/key-for.js create mode 100644 node_modules/core-js/library/fn/symbol/match.js create mode 100644 node_modules/core-js/library/fn/symbol/observable.js create mode 100644 node_modules/core-js/library/fn/symbol/replace.js create mode 100644 node_modules/core-js/library/fn/symbol/search.js create mode 100644 node_modules/core-js/library/fn/symbol/species.js create mode 100644 node_modules/core-js/library/fn/symbol/split.js create mode 100644 node_modules/core-js/library/fn/symbol/to-primitive.js create mode 100644 node_modules/core-js/library/fn/symbol/to-string-tag.js create mode 100644 node_modules/core-js/library/fn/symbol/unscopables.js create mode 100644 node_modules/core-js/library/fn/system/global.js create mode 100644 node_modules/core-js/library/fn/system/index.js create mode 100644 node_modules/core-js/library/fn/typed/array-buffer.js create mode 100644 node_modules/core-js/library/fn/typed/data-view.js create mode 100644 node_modules/core-js/library/fn/typed/float32-array.js create mode 100644 node_modules/core-js/library/fn/typed/float64-array.js create mode 100644 node_modules/core-js/library/fn/typed/index.js create mode 100644 node_modules/core-js/library/fn/typed/int16-array.js create mode 100644 node_modules/core-js/library/fn/typed/int32-array.js create mode 100644 node_modules/core-js/library/fn/typed/int8-array.js create mode 100644 node_modules/core-js/library/fn/typed/uint16-array.js create mode 100644 node_modules/core-js/library/fn/typed/uint32-array.js create mode 100644 node_modules/core-js/library/fn/typed/uint8-array.js create mode 100644 node_modules/core-js/library/fn/typed/uint8-clamped-array.js create mode 100644 node_modules/core-js/library/fn/weak-map.js create mode 100644 node_modules/core-js/library/fn/weak-map/from.js create mode 100644 node_modules/core-js/library/fn/weak-map/index.js create mode 100644 node_modules/core-js/library/fn/weak-map/of.js create mode 100644 node_modules/core-js/library/fn/weak-set.js create mode 100644 node_modules/core-js/library/fn/weak-set/from.js create mode 100644 node_modules/core-js/library/fn/weak-set/index.js create mode 100644 node_modules/core-js/library/fn/weak-set/of.js create mode 100644 node_modules/core-js/library/index.js create mode 100644 node_modules/core-js/library/modules/_a-function.js create mode 100644 node_modules/core-js/library/modules/_a-number-value.js create mode 100644 node_modules/core-js/library/modules/_add-to-unscopables.js create mode 100644 node_modules/core-js/library/modules/_an-instance.js create mode 100644 node_modules/core-js/library/modules/_an-object.js create mode 100644 node_modules/core-js/library/modules/_array-copy-within.js create mode 100644 node_modules/core-js/library/modules/_array-fill.js create mode 100644 node_modules/core-js/library/modules/_array-from-iterable.js create mode 100644 node_modules/core-js/library/modules/_array-includes.js create mode 100644 node_modules/core-js/library/modules/_array-methods.js create mode 100644 node_modules/core-js/library/modules/_array-reduce.js create mode 100644 node_modules/core-js/library/modules/_array-species-constructor.js create mode 100644 node_modules/core-js/library/modules/_array-species-create.js create mode 100644 node_modules/core-js/library/modules/_bind.js create mode 100644 node_modules/core-js/library/modules/_classof.js create mode 100644 node_modules/core-js/library/modules/_cof.js create mode 100644 node_modules/core-js/library/modules/_collection-strong.js create mode 100644 node_modules/core-js/library/modules/_collection-to-json.js create mode 100644 node_modules/core-js/library/modules/_collection-weak.js create mode 100644 node_modules/core-js/library/modules/_collection.js create mode 100644 node_modules/core-js/library/modules/_core.js create mode 100644 node_modules/core-js/library/modules/_create-property.js create mode 100644 node_modules/core-js/library/modules/_ctx.js create mode 100644 node_modules/core-js/library/modules/_date-to-iso-string.js create mode 100644 node_modules/core-js/library/modules/_date-to-primitive.js create mode 100644 node_modules/core-js/library/modules/_defined.js create mode 100644 node_modules/core-js/library/modules/_descriptors.js create mode 100644 node_modules/core-js/library/modules/_dom-create.js create mode 100644 node_modules/core-js/library/modules/_entry-virtual.js create mode 100644 node_modules/core-js/library/modules/_enum-bug-keys.js create mode 100644 node_modules/core-js/library/modules/_enum-keys.js create mode 100644 node_modules/core-js/library/modules/_export.js create mode 100644 node_modules/core-js/library/modules/_fails-is-regexp.js create mode 100644 node_modules/core-js/library/modules/_fails.js create mode 100644 node_modules/core-js/library/modules/_fix-re-wks.js create mode 100644 node_modules/core-js/library/modules/_flags.js create mode 100644 node_modules/core-js/library/modules/_flatten-into-array.js create mode 100644 node_modules/core-js/library/modules/_for-of.js create mode 100644 node_modules/core-js/library/modules/_global.js create mode 100644 node_modules/core-js/library/modules/_has.js create mode 100644 node_modules/core-js/library/modules/_hide.js create mode 100644 node_modules/core-js/library/modules/_html.js create mode 100644 node_modules/core-js/library/modules/_ie8-dom-define.js create mode 100644 node_modules/core-js/library/modules/_inherit-if-required.js create mode 100644 node_modules/core-js/library/modules/_invoke.js create mode 100644 node_modules/core-js/library/modules/_iobject.js create mode 100644 node_modules/core-js/library/modules/_is-array-iter.js create mode 100644 node_modules/core-js/library/modules/_is-array.js create mode 100644 node_modules/core-js/library/modules/_is-integer.js create mode 100644 node_modules/core-js/library/modules/_is-object.js create mode 100644 node_modules/core-js/library/modules/_is-regexp.js create mode 100644 node_modules/core-js/library/modules/_iter-call.js create mode 100644 node_modules/core-js/library/modules/_iter-create.js create mode 100644 node_modules/core-js/library/modules/_iter-define.js create mode 100644 node_modules/core-js/library/modules/_iter-detect.js create mode 100644 node_modules/core-js/library/modules/_iter-step.js create mode 100644 node_modules/core-js/library/modules/_iterators.js create mode 100644 node_modules/core-js/library/modules/_keyof.js create mode 100644 node_modules/core-js/library/modules/_library.js create mode 100644 node_modules/core-js/library/modules/_math-expm1.js create mode 100644 node_modules/core-js/library/modules/_math-fround.js create mode 100644 node_modules/core-js/library/modules/_math-log1p.js create mode 100644 node_modules/core-js/library/modules/_math-scale.js create mode 100644 node_modules/core-js/library/modules/_math-sign.js create mode 100644 node_modules/core-js/library/modules/_meta.js create mode 100644 node_modules/core-js/library/modules/_metadata.js create mode 100644 node_modules/core-js/library/modules/_microtask.js create mode 100644 node_modules/core-js/library/modules/_new-promise-capability.js create mode 100644 node_modules/core-js/library/modules/_object-assign.js create mode 100644 node_modules/core-js/library/modules/_object-create.js create mode 100644 node_modules/core-js/library/modules/_object-define.js create mode 100644 node_modules/core-js/library/modules/_object-dp.js create mode 100644 node_modules/core-js/library/modules/_object-dps.js create mode 100644 node_modules/core-js/library/modules/_object-forced-pam.js create mode 100644 node_modules/core-js/library/modules/_object-gopd.js create mode 100644 node_modules/core-js/library/modules/_object-gopn-ext.js create mode 100644 node_modules/core-js/library/modules/_object-gopn.js create mode 100644 node_modules/core-js/library/modules/_object-gops.js create mode 100644 node_modules/core-js/library/modules/_object-gpo.js create mode 100644 node_modules/core-js/library/modules/_object-keys-internal.js create mode 100644 node_modules/core-js/library/modules/_object-keys.js create mode 100644 node_modules/core-js/library/modules/_object-pie.js create mode 100644 node_modules/core-js/library/modules/_object-sap.js create mode 100644 node_modules/core-js/library/modules/_object-to-array.js create mode 100644 node_modules/core-js/library/modules/_own-keys.js create mode 100644 node_modules/core-js/library/modules/_parse-float.js create mode 100644 node_modules/core-js/library/modules/_parse-int.js create mode 100644 node_modules/core-js/library/modules/_partial.js create mode 100644 node_modules/core-js/library/modules/_path.js create mode 100644 node_modules/core-js/library/modules/_perform.js create mode 100644 node_modules/core-js/library/modules/_promise-resolve.js create mode 100644 node_modules/core-js/library/modules/_property-desc.js create mode 100644 node_modules/core-js/library/modules/_redefine-all.js create mode 100644 node_modules/core-js/library/modules/_redefine.js create mode 100644 node_modules/core-js/library/modules/_replacer.js create mode 100644 node_modules/core-js/library/modules/_same-value.js create mode 100644 node_modules/core-js/library/modules/_set-collection-from.js create mode 100644 node_modules/core-js/library/modules/_set-collection-of.js create mode 100644 node_modules/core-js/library/modules/_set-proto.js create mode 100644 node_modules/core-js/library/modules/_set-species.js create mode 100644 node_modules/core-js/library/modules/_set-to-string-tag.js create mode 100644 node_modules/core-js/library/modules/_shared-key.js create mode 100644 node_modules/core-js/library/modules/_shared.js create mode 100644 node_modules/core-js/library/modules/_species-constructor.js create mode 100644 node_modules/core-js/library/modules/_strict-method.js create mode 100644 node_modules/core-js/library/modules/_string-at.js create mode 100644 node_modules/core-js/library/modules/_string-context.js create mode 100644 node_modules/core-js/library/modules/_string-html.js create mode 100644 node_modules/core-js/library/modules/_string-pad.js create mode 100644 node_modules/core-js/library/modules/_string-repeat.js create mode 100644 node_modules/core-js/library/modules/_string-trim.js create mode 100644 node_modules/core-js/library/modules/_string-ws.js create mode 100644 node_modules/core-js/library/modules/_task.js create mode 100644 node_modules/core-js/library/modules/_to-absolute-index.js create mode 100644 node_modules/core-js/library/modules/_to-index.js create mode 100644 node_modules/core-js/library/modules/_to-integer.js create mode 100644 node_modules/core-js/library/modules/_to-iobject.js create mode 100644 node_modules/core-js/library/modules/_to-length.js create mode 100644 node_modules/core-js/library/modules/_to-object.js create mode 100644 node_modules/core-js/library/modules/_to-primitive.js create mode 100644 node_modules/core-js/library/modules/_typed-array.js create mode 100644 node_modules/core-js/library/modules/_typed-buffer.js create mode 100644 node_modules/core-js/library/modules/_typed.js create mode 100644 node_modules/core-js/library/modules/_uid.js create mode 100644 node_modules/core-js/library/modules/_user-agent.js create mode 100644 node_modules/core-js/library/modules/_validate-collection.js create mode 100644 node_modules/core-js/library/modules/_wks-define.js create mode 100644 node_modules/core-js/library/modules/_wks-ext.js create mode 100644 node_modules/core-js/library/modules/_wks.js create mode 100644 node_modules/core-js/library/modules/core.delay.js create mode 100644 node_modules/core-js/library/modules/core.dict.js create mode 100644 node_modules/core-js/library/modules/core.function.part.js create mode 100644 node_modules/core-js/library/modules/core.get-iterator-method.js create mode 100644 node_modules/core-js/library/modules/core.get-iterator.js create mode 100644 node_modules/core-js/library/modules/core.is-iterable.js create mode 100644 node_modules/core-js/library/modules/core.number.iterator.js create mode 100644 node_modules/core-js/library/modules/core.object.classof.js create mode 100644 node_modules/core-js/library/modules/core.object.define.js create mode 100644 node_modules/core-js/library/modules/core.object.is-object.js create mode 100644 node_modules/core-js/library/modules/core.object.make.js create mode 100644 node_modules/core-js/library/modules/core.regexp.escape.js create mode 100644 node_modules/core-js/library/modules/core.string.escape-html.js create mode 100644 node_modules/core-js/library/modules/core.string.unescape-html.js create mode 100644 node_modules/core-js/library/modules/es5.js create mode 100644 node_modules/core-js/library/modules/es6.array.copy-within.js create mode 100644 node_modules/core-js/library/modules/es6.array.every.js create mode 100644 node_modules/core-js/library/modules/es6.array.fill.js create mode 100644 node_modules/core-js/library/modules/es6.array.filter.js create mode 100644 node_modules/core-js/library/modules/es6.array.find-index.js create mode 100644 node_modules/core-js/library/modules/es6.array.find.js create mode 100644 node_modules/core-js/library/modules/es6.array.for-each.js create mode 100644 node_modules/core-js/library/modules/es6.array.from.js create mode 100644 node_modules/core-js/library/modules/es6.array.index-of.js create mode 100644 node_modules/core-js/library/modules/es6.array.is-array.js create mode 100644 node_modules/core-js/library/modules/es6.array.iterator.js create mode 100644 node_modules/core-js/library/modules/es6.array.join.js create mode 100644 node_modules/core-js/library/modules/es6.array.last-index-of.js create mode 100644 node_modules/core-js/library/modules/es6.array.map.js create mode 100644 node_modules/core-js/library/modules/es6.array.of.js create mode 100644 node_modules/core-js/library/modules/es6.array.reduce-right.js create mode 100644 node_modules/core-js/library/modules/es6.array.reduce.js create mode 100644 node_modules/core-js/library/modules/es6.array.slice.js create mode 100644 node_modules/core-js/library/modules/es6.array.some.js create mode 100644 node_modules/core-js/library/modules/es6.array.sort.js create mode 100644 node_modules/core-js/library/modules/es6.array.species.js create mode 100644 node_modules/core-js/library/modules/es6.date.now.js create mode 100644 node_modules/core-js/library/modules/es6.date.to-iso-string.js create mode 100644 node_modules/core-js/library/modules/es6.date.to-json.js create mode 100644 node_modules/core-js/library/modules/es6.date.to-primitive.js create mode 100644 node_modules/core-js/library/modules/es6.date.to-string.js create mode 100644 node_modules/core-js/library/modules/es6.function.bind.js create mode 100644 node_modules/core-js/library/modules/es6.function.has-instance.js create mode 100644 node_modules/core-js/library/modules/es6.function.name.js create mode 100644 node_modules/core-js/library/modules/es6.map.js create mode 100644 node_modules/core-js/library/modules/es6.math.acosh.js create mode 100644 node_modules/core-js/library/modules/es6.math.asinh.js create mode 100644 node_modules/core-js/library/modules/es6.math.atanh.js create mode 100644 node_modules/core-js/library/modules/es6.math.cbrt.js create mode 100644 node_modules/core-js/library/modules/es6.math.clz32.js create mode 100644 node_modules/core-js/library/modules/es6.math.cosh.js create mode 100644 node_modules/core-js/library/modules/es6.math.expm1.js create mode 100644 node_modules/core-js/library/modules/es6.math.fround.js create mode 100644 node_modules/core-js/library/modules/es6.math.hypot.js create mode 100644 node_modules/core-js/library/modules/es6.math.imul.js create mode 100644 node_modules/core-js/library/modules/es6.math.log10.js create mode 100644 node_modules/core-js/library/modules/es6.math.log1p.js create mode 100644 node_modules/core-js/library/modules/es6.math.log2.js create mode 100644 node_modules/core-js/library/modules/es6.math.sign.js create mode 100644 node_modules/core-js/library/modules/es6.math.sinh.js create mode 100644 node_modules/core-js/library/modules/es6.math.tanh.js create mode 100644 node_modules/core-js/library/modules/es6.math.trunc.js create mode 100644 node_modules/core-js/library/modules/es6.number.constructor.js create mode 100644 node_modules/core-js/library/modules/es6.number.epsilon.js create mode 100644 node_modules/core-js/library/modules/es6.number.is-finite.js create mode 100644 node_modules/core-js/library/modules/es6.number.is-integer.js create mode 100644 node_modules/core-js/library/modules/es6.number.is-nan.js create mode 100644 node_modules/core-js/library/modules/es6.number.is-safe-integer.js create mode 100644 node_modules/core-js/library/modules/es6.number.max-safe-integer.js create mode 100644 node_modules/core-js/library/modules/es6.number.min-safe-integer.js create mode 100644 node_modules/core-js/library/modules/es6.number.parse-float.js create mode 100644 node_modules/core-js/library/modules/es6.number.parse-int.js create mode 100644 node_modules/core-js/library/modules/es6.number.to-fixed.js create mode 100644 node_modules/core-js/library/modules/es6.number.to-precision.js create mode 100644 node_modules/core-js/library/modules/es6.object.assign.js create mode 100644 node_modules/core-js/library/modules/es6.object.create.js create mode 100644 node_modules/core-js/library/modules/es6.object.define-properties.js create mode 100644 node_modules/core-js/library/modules/es6.object.define-property.js create mode 100644 node_modules/core-js/library/modules/es6.object.freeze.js create mode 100644 node_modules/core-js/library/modules/es6.object.get-own-property-descriptor.js create mode 100644 node_modules/core-js/library/modules/es6.object.get-own-property-names.js create mode 100644 node_modules/core-js/library/modules/es6.object.get-prototype-of.js create mode 100644 node_modules/core-js/library/modules/es6.object.is-extensible.js create mode 100644 node_modules/core-js/library/modules/es6.object.is-frozen.js create mode 100644 node_modules/core-js/library/modules/es6.object.is-sealed.js create mode 100644 node_modules/core-js/library/modules/es6.object.is.js create mode 100644 node_modules/core-js/library/modules/es6.object.keys.js create mode 100644 node_modules/core-js/library/modules/es6.object.prevent-extensions.js create mode 100644 node_modules/core-js/library/modules/es6.object.seal.js create mode 100644 node_modules/core-js/library/modules/es6.object.set-prototype-of.js create mode 100644 node_modules/core-js/library/modules/es6.object.to-string.js create mode 100644 node_modules/core-js/library/modules/es6.parse-float.js create mode 100644 node_modules/core-js/library/modules/es6.parse-int.js create mode 100644 node_modules/core-js/library/modules/es6.promise.js create mode 100644 node_modules/core-js/library/modules/es6.reflect.apply.js create mode 100644 node_modules/core-js/library/modules/es6.reflect.construct.js create mode 100644 node_modules/core-js/library/modules/es6.reflect.define-property.js create mode 100644 node_modules/core-js/library/modules/es6.reflect.delete-property.js create mode 100644 node_modules/core-js/library/modules/es6.reflect.enumerate.js create mode 100644 node_modules/core-js/library/modules/es6.reflect.get-own-property-descriptor.js create mode 100644 node_modules/core-js/library/modules/es6.reflect.get-prototype-of.js create mode 100644 node_modules/core-js/library/modules/es6.reflect.get.js create mode 100644 node_modules/core-js/library/modules/es6.reflect.has.js create mode 100644 node_modules/core-js/library/modules/es6.reflect.is-extensible.js create mode 100644 node_modules/core-js/library/modules/es6.reflect.own-keys.js create mode 100644 node_modules/core-js/library/modules/es6.reflect.prevent-extensions.js create mode 100644 node_modules/core-js/library/modules/es6.reflect.set-prototype-of.js create mode 100644 node_modules/core-js/library/modules/es6.reflect.set.js create mode 100644 node_modules/core-js/library/modules/es6.regexp.constructor.js create mode 100644 node_modules/core-js/library/modules/es6.regexp.flags.js create mode 100644 node_modules/core-js/library/modules/es6.regexp.match.js create mode 100644 node_modules/core-js/library/modules/es6.regexp.replace.js create mode 100644 node_modules/core-js/library/modules/es6.regexp.search.js create mode 100644 node_modules/core-js/library/modules/es6.regexp.split.js create mode 100644 node_modules/core-js/library/modules/es6.regexp.to-string.js create mode 100644 node_modules/core-js/library/modules/es6.set.js create mode 100644 node_modules/core-js/library/modules/es6.string.anchor.js create mode 100644 node_modules/core-js/library/modules/es6.string.big.js create mode 100644 node_modules/core-js/library/modules/es6.string.blink.js create mode 100644 node_modules/core-js/library/modules/es6.string.bold.js create mode 100644 node_modules/core-js/library/modules/es6.string.code-point-at.js create mode 100644 node_modules/core-js/library/modules/es6.string.ends-with.js create mode 100644 node_modules/core-js/library/modules/es6.string.fixed.js create mode 100644 node_modules/core-js/library/modules/es6.string.fontcolor.js create mode 100644 node_modules/core-js/library/modules/es6.string.fontsize.js create mode 100644 node_modules/core-js/library/modules/es6.string.from-code-point.js create mode 100644 node_modules/core-js/library/modules/es6.string.includes.js create mode 100644 node_modules/core-js/library/modules/es6.string.italics.js create mode 100644 node_modules/core-js/library/modules/es6.string.iterator.js create mode 100644 node_modules/core-js/library/modules/es6.string.link.js create mode 100644 node_modules/core-js/library/modules/es6.string.raw.js create mode 100644 node_modules/core-js/library/modules/es6.string.repeat.js create mode 100644 node_modules/core-js/library/modules/es6.string.small.js create mode 100644 node_modules/core-js/library/modules/es6.string.starts-with.js create mode 100644 node_modules/core-js/library/modules/es6.string.strike.js create mode 100644 node_modules/core-js/library/modules/es6.string.sub.js create mode 100644 node_modules/core-js/library/modules/es6.string.sup.js create mode 100644 node_modules/core-js/library/modules/es6.string.trim.js create mode 100644 node_modules/core-js/library/modules/es6.symbol.js create mode 100644 node_modules/core-js/library/modules/es6.typed.array-buffer.js create mode 100644 node_modules/core-js/library/modules/es6.typed.data-view.js create mode 100644 node_modules/core-js/library/modules/es6.typed.float32-array.js create mode 100644 node_modules/core-js/library/modules/es6.typed.float64-array.js create mode 100644 node_modules/core-js/library/modules/es6.typed.int16-array.js create mode 100644 node_modules/core-js/library/modules/es6.typed.int32-array.js create mode 100644 node_modules/core-js/library/modules/es6.typed.int8-array.js create mode 100644 node_modules/core-js/library/modules/es6.typed.uint16-array.js create mode 100644 node_modules/core-js/library/modules/es6.typed.uint32-array.js create mode 100644 node_modules/core-js/library/modules/es6.typed.uint8-array.js create mode 100644 node_modules/core-js/library/modules/es6.typed.uint8-clamped-array.js create mode 100644 node_modules/core-js/library/modules/es6.weak-map.js create mode 100644 node_modules/core-js/library/modules/es6.weak-set.js create mode 100644 node_modules/core-js/library/modules/es7.array.flat-map.js create mode 100644 node_modules/core-js/library/modules/es7.array.flatten.js create mode 100644 node_modules/core-js/library/modules/es7.array.includes.js create mode 100644 node_modules/core-js/library/modules/es7.asap.js create mode 100644 node_modules/core-js/library/modules/es7.error.is-error.js create mode 100644 node_modules/core-js/library/modules/es7.global.js create mode 100644 node_modules/core-js/library/modules/es7.map.from.js create mode 100644 node_modules/core-js/library/modules/es7.map.of.js create mode 100644 node_modules/core-js/library/modules/es7.map.to-json.js create mode 100644 node_modules/core-js/library/modules/es7.math.clamp.js create mode 100644 node_modules/core-js/library/modules/es7.math.deg-per-rad.js create mode 100644 node_modules/core-js/library/modules/es7.math.degrees.js create mode 100644 node_modules/core-js/library/modules/es7.math.fscale.js create mode 100644 node_modules/core-js/library/modules/es7.math.iaddh.js create mode 100644 node_modules/core-js/library/modules/es7.math.imulh.js create mode 100644 node_modules/core-js/library/modules/es7.math.isubh.js create mode 100644 node_modules/core-js/library/modules/es7.math.rad-per-deg.js create mode 100644 node_modules/core-js/library/modules/es7.math.radians.js create mode 100644 node_modules/core-js/library/modules/es7.math.scale.js create mode 100644 node_modules/core-js/library/modules/es7.math.signbit.js create mode 100644 node_modules/core-js/library/modules/es7.math.umulh.js create mode 100644 node_modules/core-js/library/modules/es7.object.define-getter.js create mode 100644 node_modules/core-js/library/modules/es7.object.define-setter.js create mode 100644 node_modules/core-js/library/modules/es7.object.entries.js create mode 100644 node_modules/core-js/library/modules/es7.object.get-own-property-descriptors.js create mode 100644 node_modules/core-js/library/modules/es7.object.lookup-getter.js create mode 100644 node_modules/core-js/library/modules/es7.object.lookup-setter.js create mode 100644 node_modules/core-js/library/modules/es7.object.values.js create mode 100644 node_modules/core-js/library/modules/es7.observable.js create mode 100644 node_modules/core-js/library/modules/es7.promise.finally.js create mode 100644 node_modules/core-js/library/modules/es7.promise.try.js create mode 100644 node_modules/core-js/library/modules/es7.reflect.define-metadata.js create mode 100644 node_modules/core-js/library/modules/es7.reflect.delete-metadata.js create mode 100644 node_modules/core-js/library/modules/es7.reflect.get-metadata-keys.js create mode 100644 node_modules/core-js/library/modules/es7.reflect.get-metadata.js create mode 100644 node_modules/core-js/library/modules/es7.reflect.get-own-metadata-keys.js create mode 100644 node_modules/core-js/library/modules/es7.reflect.get-own-metadata.js create mode 100644 node_modules/core-js/library/modules/es7.reflect.has-metadata.js create mode 100644 node_modules/core-js/library/modules/es7.reflect.has-own-metadata.js create mode 100644 node_modules/core-js/library/modules/es7.reflect.metadata.js create mode 100644 node_modules/core-js/library/modules/es7.set.from.js create mode 100644 node_modules/core-js/library/modules/es7.set.of.js create mode 100644 node_modules/core-js/library/modules/es7.set.to-json.js create mode 100644 node_modules/core-js/library/modules/es7.string.at.js create mode 100644 node_modules/core-js/library/modules/es7.string.match-all.js create mode 100644 node_modules/core-js/library/modules/es7.string.pad-end.js create mode 100644 node_modules/core-js/library/modules/es7.string.pad-start.js create mode 100644 node_modules/core-js/library/modules/es7.string.trim-left.js create mode 100644 node_modules/core-js/library/modules/es7.string.trim-right.js create mode 100644 node_modules/core-js/library/modules/es7.symbol.async-iterator.js create mode 100644 node_modules/core-js/library/modules/es7.symbol.observable.js create mode 100644 node_modules/core-js/library/modules/es7.system.global.js create mode 100644 node_modules/core-js/library/modules/es7.weak-map.from.js create mode 100644 node_modules/core-js/library/modules/es7.weak-map.of.js create mode 100644 node_modules/core-js/library/modules/es7.weak-set.from.js create mode 100644 node_modules/core-js/library/modules/es7.weak-set.of.js create mode 100644 node_modules/core-js/library/modules/web.dom.iterable.js create mode 100644 node_modules/core-js/library/modules/web.immediate.js create mode 100644 node_modules/core-js/library/modules/web.timers.js create mode 100644 node_modules/core-js/library/shim.js create mode 100644 node_modules/core-js/library/stage/0.js create mode 100644 node_modules/core-js/library/stage/1.js create mode 100644 node_modules/core-js/library/stage/2.js create mode 100644 node_modules/core-js/library/stage/3.js create mode 100644 node_modules/core-js/library/stage/4.js create mode 100644 node_modules/core-js/library/stage/index.js create mode 100644 node_modules/core-js/library/stage/pre.js create mode 100644 node_modules/core-js/library/web/dom-collections.js create mode 100644 node_modules/core-js/library/web/immediate.js create mode 100644 node_modules/core-js/library/web/index.js create mode 100644 node_modules/core-js/library/web/timers.js create mode 100644 node_modules/core-js/modules/_a-function.js create mode 100644 node_modules/core-js/modules/_a-number-value.js create mode 100644 node_modules/core-js/modules/_add-to-unscopables.js create mode 100644 node_modules/core-js/modules/_an-instance.js create mode 100644 node_modules/core-js/modules/_an-object.js create mode 100644 node_modules/core-js/modules/_array-copy-within.js create mode 100644 node_modules/core-js/modules/_array-fill.js create mode 100644 node_modules/core-js/modules/_array-from-iterable.js create mode 100644 node_modules/core-js/modules/_array-includes.js create mode 100644 node_modules/core-js/modules/_array-methods.js create mode 100644 node_modules/core-js/modules/_array-reduce.js create mode 100644 node_modules/core-js/modules/_array-species-constructor.js create mode 100644 node_modules/core-js/modules/_array-species-create.js create mode 100644 node_modules/core-js/modules/_bind.js create mode 100644 node_modules/core-js/modules/_classof.js create mode 100644 node_modules/core-js/modules/_cof.js create mode 100644 node_modules/core-js/modules/_collection-strong.js create mode 100644 node_modules/core-js/modules/_collection-to-json.js create mode 100644 node_modules/core-js/modules/_collection-weak.js create mode 100644 node_modules/core-js/modules/_collection.js create mode 100644 node_modules/core-js/modules/_core.js create mode 100644 node_modules/core-js/modules/_create-property.js create mode 100644 node_modules/core-js/modules/_ctx.js create mode 100644 node_modules/core-js/modules/_date-to-iso-string.js create mode 100644 node_modules/core-js/modules/_date-to-primitive.js create mode 100644 node_modules/core-js/modules/_defined.js create mode 100644 node_modules/core-js/modules/_descriptors.js create mode 100644 node_modules/core-js/modules/_dom-create.js create mode 100644 node_modules/core-js/modules/_entry-virtual.js create mode 100644 node_modules/core-js/modules/_enum-bug-keys.js create mode 100644 node_modules/core-js/modules/_enum-keys.js create mode 100644 node_modules/core-js/modules/_export.js create mode 100644 node_modules/core-js/modules/_fails-is-regexp.js create mode 100644 node_modules/core-js/modules/_fails.js create mode 100644 node_modules/core-js/modules/_fix-re-wks.js create mode 100644 node_modules/core-js/modules/_flags.js create mode 100644 node_modules/core-js/modules/_flatten-into-array.js create mode 100644 node_modules/core-js/modules/_for-of.js create mode 100644 node_modules/core-js/modules/_global.js create mode 100644 node_modules/core-js/modules/_has.js create mode 100644 node_modules/core-js/modules/_hide.js create mode 100644 node_modules/core-js/modules/_html.js create mode 100644 node_modules/core-js/modules/_ie8-dom-define.js create mode 100644 node_modules/core-js/modules/_inherit-if-required.js create mode 100644 node_modules/core-js/modules/_invoke.js create mode 100644 node_modules/core-js/modules/_iobject.js create mode 100644 node_modules/core-js/modules/_is-array-iter.js create mode 100644 node_modules/core-js/modules/_is-array.js create mode 100644 node_modules/core-js/modules/_is-integer.js create mode 100644 node_modules/core-js/modules/_is-object.js create mode 100644 node_modules/core-js/modules/_is-regexp.js create mode 100644 node_modules/core-js/modules/_iter-call.js create mode 100644 node_modules/core-js/modules/_iter-create.js create mode 100644 node_modules/core-js/modules/_iter-define.js create mode 100644 node_modules/core-js/modules/_iter-detect.js create mode 100644 node_modules/core-js/modules/_iter-step.js create mode 100644 node_modules/core-js/modules/_iterators.js create mode 100644 node_modules/core-js/modules/_keyof.js create mode 100644 node_modules/core-js/modules/_library.js create mode 100644 node_modules/core-js/modules/_math-expm1.js create mode 100644 node_modules/core-js/modules/_math-fround.js create mode 100644 node_modules/core-js/modules/_math-log1p.js create mode 100644 node_modules/core-js/modules/_math-scale.js create mode 100644 node_modules/core-js/modules/_math-sign.js create mode 100644 node_modules/core-js/modules/_meta.js create mode 100644 node_modules/core-js/modules/_metadata.js create mode 100644 node_modules/core-js/modules/_microtask.js create mode 100644 node_modules/core-js/modules/_new-promise-capability.js create mode 100644 node_modules/core-js/modules/_object-assign.js create mode 100644 node_modules/core-js/modules/_object-create.js create mode 100644 node_modules/core-js/modules/_object-define.js create mode 100644 node_modules/core-js/modules/_object-dp.js create mode 100644 node_modules/core-js/modules/_object-dps.js create mode 100644 node_modules/core-js/modules/_object-forced-pam.js create mode 100644 node_modules/core-js/modules/_object-gopd.js create mode 100644 node_modules/core-js/modules/_object-gopn-ext.js create mode 100644 node_modules/core-js/modules/_object-gopn.js create mode 100644 node_modules/core-js/modules/_object-gops.js create mode 100644 node_modules/core-js/modules/_object-gpo.js create mode 100644 node_modules/core-js/modules/_object-keys-internal.js create mode 100644 node_modules/core-js/modules/_object-keys.js create mode 100644 node_modules/core-js/modules/_object-pie.js create mode 100644 node_modules/core-js/modules/_object-sap.js create mode 100644 node_modules/core-js/modules/_object-to-array.js create mode 100644 node_modules/core-js/modules/_own-keys.js create mode 100644 node_modules/core-js/modules/_parse-float.js create mode 100644 node_modules/core-js/modules/_parse-int.js create mode 100644 node_modules/core-js/modules/_partial.js create mode 100644 node_modules/core-js/modules/_path.js create mode 100644 node_modules/core-js/modules/_perform.js create mode 100644 node_modules/core-js/modules/_promise-resolve.js create mode 100644 node_modules/core-js/modules/_property-desc.js create mode 100644 node_modules/core-js/modules/_redefine-all.js create mode 100644 node_modules/core-js/modules/_redefine.js create mode 100644 node_modules/core-js/modules/_replacer.js create mode 100644 node_modules/core-js/modules/_same-value.js create mode 100644 node_modules/core-js/modules/_set-collection-from.js create mode 100644 node_modules/core-js/modules/_set-collection-of.js create mode 100644 node_modules/core-js/modules/_set-proto.js create mode 100644 node_modules/core-js/modules/_set-species.js create mode 100644 node_modules/core-js/modules/_set-to-string-tag.js create mode 100644 node_modules/core-js/modules/_shared-key.js create mode 100644 node_modules/core-js/modules/_shared.js create mode 100644 node_modules/core-js/modules/_species-constructor.js create mode 100644 node_modules/core-js/modules/_strict-method.js create mode 100644 node_modules/core-js/modules/_string-at.js create mode 100644 node_modules/core-js/modules/_string-context.js create mode 100644 node_modules/core-js/modules/_string-html.js create mode 100644 node_modules/core-js/modules/_string-pad.js create mode 100644 node_modules/core-js/modules/_string-repeat.js create mode 100644 node_modules/core-js/modules/_string-trim.js create mode 100644 node_modules/core-js/modules/_string-ws.js create mode 100644 node_modules/core-js/modules/_task.js create mode 100644 node_modules/core-js/modules/_to-absolute-index.js create mode 100644 node_modules/core-js/modules/_to-index.js create mode 100644 node_modules/core-js/modules/_to-integer.js create mode 100644 node_modules/core-js/modules/_to-iobject.js create mode 100644 node_modules/core-js/modules/_to-length.js create mode 100644 node_modules/core-js/modules/_to-object.js create mode 100644 node_modules/core-js/modules/_to-primitive.js create mode 100644 node_modules/core-js/modules/_typed-array.js create mode 100644 node_modules/core-js/modules/_typed-buffer.js create mode 100644 node_modules/core-js/modules/_typed.js create mode 100644 node_modules/core-js/modules/_uid.js create mode 100644 node_modules/core-js/modules/_user-agent.js create mode 100644 node_modules/core-js/modules/_validate-collection.js create mode 100644 node_modules/core-js/modules/_wks-define.js create mode 100644 node_modules/core-js/modules/_wks-ext.js create mode 100644 node_modules/core-js/modules/_wks.js create mode 100644 node_modules/core-js/modules/core.delay.js create mode 100644 node_modules/core-js/modules/core.dict.js create mode 100644 node_modules/core-js/modules/core.function.part.js create mode 100644 node_modules/core-js/modules/core.get-iterator-method.js create mode 100644 node_modules/core-js/modules/core.get-iterator.js create mode 100644 node_modules/core-js/modules/core.is-iterable.js create mode 100644 node_modules/core-js/modules/core.number.iterator.js create mode 100644 node_modules/core-js/modules/core.object.classof.js create mode 100644 node_modules/core-js/modules/core.object.define.js create mode 100644 node_modules/core-js/modules/core.object.is-object.js create mode 100644 node_modules/core-js/modules/core.object.make.js create mode 100644 node_modules/core-js/modules/core.regexp.escape.js create mode 100644 node_modules/core-js/modules/core.string.escape-html.js create mode 100644 node_modules/core-js/modules/core.string.unescape-html.js create mode 100644 node_modules/core-js/modules/es5.js create mode 100644 node_modules/core-js/modules/es6.array.copy-within.js create mode 100644 node_modules/core-js/modules/es6.array.every.js create mode 100644 node_modules/core-js/modules/es6.array.fill.js create mode 100644 node_modules/core-js/modules/es6.array.filter.js create mode 100644 node_modules/core-js/modules/es6.array.find-index.js create mode 100644 node_modules/core-js/modules/es6.array.find.js create mode 100644 node_modules/core-js/modules/es6.array.for-each.js create mode 100644 node_modules/core-js/modules/es6.array.from.js create mode 100644 node_modules/core-js/modules/es6.array.index-of.js create mode 100644 node_modules/core-js/modules/es6.array.is-array.js create mode 100644 node_modules/core-js/modules/es6.array.iterator.js create mode 100644 node_modules/core-js/modules/es6.array.join.js create mode 100644 node_modules/core-js/modules/es6.array.last-index-of.js create mode 100644 node_modules/core-js/modules/es6.array.map.js create mode 100644 node_modules/core-js/modules/es6.array.of.js create mode 100644 node_modules/core-js/modules/es6.array.reduce-right.js create mode 100644 node_modules/core-js/modules/es6.array.reduce.js create mode 100644 node_modules/core-js/modules/es6.array.slice.js create mode 100644 node_modules/core-js/modules/es6.array.some.js create mode 100644 node_modules/core-js/modules/es6.array.sort.js create mode 100644 node_modules/core-js/modules/es6.array.species.js create mode 100644 node_modules/core-js/modules/es6.date.now.js create mode 100644 node_modules/core-js/modules/es6.date.to-iso-string.js create mode 100644 node_modules/core-js/modules/es6.date.to-json.js create mode 100644 node_modules/core-js/modules/es6.date.to-primitive.js create mode 100644 node_modules/core-js/modules/es6.date.to-string.js create mode 100644 node_modules/core-js/modules/es6.function.bind.js create mode 100644 node_modules/core-js/modules/es6.function.has-instance.js create mode 100644 node_modules/core-js/modules/es6.function.name.js create mode 100644 node_modules/core-js/modules/es6.map.js create mode 100644 node_modules/core-js/modules/es6.math.acosh.js create mode 100644 node_modules/core-js/modules/es6.math.asinh.js create mode 100644 node_modules/core-js/modules/es6.math.atanh.js create mode 100644 node_modules/core-js/modules/es6.math.cbrt.js create mode 100644 node_modules/core-js/modules/es6.math.clz32.js create mode 100644 node_modules/core-js/modules/es6.math.cosh.js create mode 100644 node_modules/core-js/modules/es6.math.expm1.js create mode 100644 node_modules/core-js/modules/es6.math.fround.js create mode 100644 node_modules/core-js/modules/es6.math.hypot.js create mode 100644 node_modules/core-js/modules/es6.math.imul.js create mode 100644 node_modules/core-js/modules/es6.math.log10.js create mode 100644 node_modules/core-js/modules/es6.math.log1p.js create mode 100644 node_modules/core-js/modules/es6.math.log2.js create mode 100644 node_modules/core-js/modules/es6.math.sign.js create mode 100644 node_modules/core-js/modules/es6.math.sinh.js create mode 100644 node_modules/core-js/modules/es6.math.tanh.js create mode 100644 node_modules/core-js/modules/es6.math.trunc.js create mode 100644 node_modules/core-js/modules/es6.number.constructor.js create mode 100644 node_modules/core-js/modules/es6.number.epsilon.js create mode 100644 node_modules/core-js/modules/es6.number.is-finite.js create mode 100644 node_modules/core-js/modules/es6.number.is-integer.js create mode 100644 node_modules/core-js/modules/es6.number.is-nan.js create mode 100644 node_modules/core-js/modules/es6.number.is-safe-integer.js create mode 100644 node_modules/core-js/modules/es6.number.max-safe-integer.js create mode 100644 node_modules/core-js/modules/es6.number.min-safe-integer.js create mode 100644 node_modules/core-js/modules/es6.number.parse-float.js create mode 100644 node_modules/core-js/modules/es6.number.parse-int.js create mode 100644 node_modules/core-js/modules/es6.number.to-fixed.js create mode 100644 node_modules/core-js/modules/es6.number.to-precision.js create mode 100644 node_modules/core-js/modules/es6.object.assign.js create mode 100644 node_modules/core-js/modules/es6.object.create.js create mode 100644 node_modules/core-js/modules/es6.object.define-properties.js create mode 100644 node_modules/core-js/modules/es6.object.define-property.js create mode 100644 node_modules/core-js/modules/es6.object.freeze.js create mode 100644 node_modules/core-js/modules/es6.object.get-own-property-descriptor.js create mode 100644 node_modules/core-js/modules/es6.object.get-own-property-names.js create mode 100644 node_modules/core-js/modules/es6.object.get-prototype-of.js create mode 100644 node_modules/core-js/modules/es6.object.is-extensible.js create mode 100644 node_modules/core-js/modules/es6.object.is-frozen.js create mode 100644 node_modules/core-js/modules/es6.object.is-sealed.js create mode 100644 node_modules/core-js/modules/es6.object.is.js create mode 100644 node_modules/core-js/modules/es6.object.keys.js create mode 100644 node_modules/core-js/modules/es6.object.prevent-extensions.js create mode 100644 node_modules/core-js/modules/es6.object.seal.js create mode 100644 node_modules/core-js/modules/es6.object.set-prototype-of.js create mode 100644 node_modules/core-js/modules/es6.object.to-string.js create mode 100644 node_modules/core-js/modules/es6.parse-float.js create mode 100644 node_modules/core-js/modules/es6.parse-int.js create mode 100644 node_modules/core-js/modules/es6.promise.js create mode 100644 node_modules/core-js/modules/es6.reflect.apply.js create mode 100644 node_modules/core-js/modules/es6.reflect.construct.js create mode 100644 node_modules/core-js/modules/es6.reflect.define-property.js create mode 100644 node_modules/core-js/modules/es6.reflect.delete-property.js create mode 100644 node_modules/core-js/modules/es6.reflect.enumerate.js create mode 100644 node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js create mode 100644 node_modules/core-js/modules/es6.reflect.get-prototype-of.js create mode 100644 node_modules/core-js/modules/es6.reflect.get.js create mode 100644 node_modules/core-js/modules/es6.reflect.has.js create mode 100644 node_modules/core-js/modules/es6.reflect.is-extensible.js create mode 100644 node_modules/core-js/modules/es6.reflect.own-keys.js create mode 100644 node_modules/core-js/modules/es6.reflect.prevent-extensions.js create mode 100644 node_modules/core-js/modules/es6.reflect.set-prototype-of.js create mode 100644 node_modules/core-js/modules/es6.reflect.set.js create mode 100644 node_modules/core-js/modules/es6.regexp.constructor.js create mode 100644 node_modules/core-js/modules/es6.regexp.flags.js create mode 100644 node_modules/core-js/modules/es6.regexp.match.js create mode 100644 node_modules/core-js/modules/es6.regexp.replace.js create mode 100644 node_modules/core-js/modules/es6.regexp.search.js create mode 100644 node_modules/core-js/modules/es6.regexp.split.js create mode 100644 node_modules/core-js/modules/es6.regexp.to-string.js create mode 100644 node_modules/core-js/modules/es6.set.js create mode 100644 node_modules/core-js/modules/es6.string.anchor.js create mode 100644 node_modules/core-js/modules/es6.string.big.js create mode 100644 node_modules/core-js/modules/es6.string.blink.js create mode 100644 node_modules/core-js/modules/es6.string.bold.js create mode 100644 node_modules/core-js/modules/es6.string.code-point-at.js create mode 100644 node_modules/core-js/modules/es6.string.ends-with.js create mode 100644 node_modules/core-js/modules/es6.string.fixed.js create mode 100644 node_modules/core-js/modules/es6.string.fontcolor.js create mode 100644 node_modules/core-js/modules/es6.string.fontsize.js create mode 100644 node_modules/core-js/modules/es6.string.from-code-point.js create mode 100644 node_modules/core-js/modules/es6.string.includes.js create mode 100644 node_modules/core-js/modules/es6.string.italics.js create mode 100644 node_modules/core-js/modules/es6.string.iterator.js create mode 100644 node_modules/core-js/modules/es6.string.link.js create mode 100644 node_modules/core-js/modules/es6.string.raw.js create mode 100644 node_modules/core-js/modules/es6.string.repeat.js create mode 100644 node_modules/core-js/modules/es6.string.small.js create mode 100644 node_modules/core-js/modules/es6.string.starts-with.js create mode 100644 node_modules/core-js/modules/es6.string.strike.js create mode 100644 node_modules/core-js/modules/es6.string.sub.js create mode 100644 node_modules/core-js/modules/es6.string.sup.js create mode 100644 node_modules/core-js/modules/es6.string.trim.js create mode 100644 node_modules/core-js/modules/es6.symbol.js create mode 100644 node_modules/core-js/modules/es6.typed.array-buffer.js create mode 100644 node_modules/core-js/modules/es6.typed.data-view.js create mode 100644 node_modules/core-js/modules/es6.typed.float32-array.js create mode 100644 node_modules/core-js/modules/es6.typed.float64-array.js create mode 100644 node_modules/core-js/modules/es6.typed.int16-array.js create mode 100644 node_modules/core-js/modules/es6.typed.int32-array.js create mode 100644 node_modules/core-js/modules/es6.typed.int8-array.js create mode 100644 node_modules/core-js/modules/es6.typed.uint16-array.js create mode 100644 node_modules/core-js/modules/es6.typed.uint32-array.js create mode 100644 node_modules/core-js/modules/es6.typed.uint8-array.js create mode 100644 node_modules/core-js/modules/es6.typed.uint8-clamped-array.js create mode 100644 node_modules/core-js/modules/es6.weak-map.js create mode 100644 node_modules/core-js/modules/es6.weak-set.js create mode 100644 node_modules/core-js/modules/es7.array.flat-map.js create mode 100644 node_modules/core-js/modules/es7.array.flatten.js create mode 100644 node_modules/core-js/modules/es7.array.includes.js create mode 100644 node_modules/core-js/modules/es7.asap.js create mode 100644 node_modules/core-js/modules/es7.error.is-error.js create mode 100644 node_modules/core-js/modules/es7.global.js create mode 100644 node_modules/core-js/modules/es7.map.from.js create mode 100644 node_modules/core-js/modules/es7.map.of.js create mode 100644 node_modules/core-js/modules/es7.map.to-json.js create mode 100644 node_modules/core-js/modules/es7.math.clamp.js create mode 100644 node_modules/core-js/modules/es7.math.deg-per-rad.js create mode 100644 node_modules/core-js/modules/es7.math.degrees.js create mode 100644 node_modules/core-js/modules/es7.math.fscale.js create mode 100644 node_modules/core-js/modules/es7.math.iaddh.js create mode 100644 node_modules/core-js/modules/es7.math.imulh.js create mode 100644 node_modules/core-js/modules/es7.math.isubh.js create mode 100644 node_modules/core-js/modules/es7.math.rad-per-deg.js create mode 100644 node_modules/core-js/modules/es7.math.radians.js create mode 100644 node_modules/core-js/modules/es7.math.scale.js create mode 100644 node_modules/core-js/modules/es7.math.signbit.js create mode 100644 node_modules/core-js/modules/es7.math.umulh.js create mode 100644 node_modules/core-js/modules/es7.object.define-getter.js create mode 100644 node_modules/core-js/modules/es7.object.define-setter.js create mode 100644 node_modules/core-js/modules/es7.object.entries.js create mode 100644 node_modules/core-js/modules/es7.object.get-own-property-descriptors.js create mode 100644 node_modules/core-js/modules/es7.object.lookup-getter.js create mode 100644 node_modules/core-js/modules/es7.object.lookup-setter.js create mode 100644 node_modules/core-js/modules/es7.object.values.js create mode 100644 node_modules/core-js/modules/es7.observable.js create mode 100644 node_modules/core-js/modules/es7.promise.finally.js create mode 100644 node_modules/core-js/modules/es7.promise.try.js create mode 100644 node_modules/core-js/modules/es7.reflect.define-metadata.js create mode 100644 node_modules/core-js/modules/es7.reflect.delete-metadata.js create mode 100644 node_modules/core-js/modules/es7.reflect.get-metadata-keys.js create mode 100644 node_modules/core-js/modules/es7.reflect.get-metadata.js create mode 100644 node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js create mode 100644 node_modules/core-js/modules/es7.reflect.get-own-metadata.js create mode 100644 node_modules/core-js/modules/es7.reflect.has-metadata.js create mode 100644 node_modules/core-js/modules/es7.reflect.has-own-metadata.js create mode 100644 node_modules/core-js/modules/es7.reflect.metadata.js create mode 100644 node_modules/core-js/modules/es7.set.from.js create mode 100644 node_modules/core-js/modules/es7.set.of.js create mode 100644 node_modules/core-js/modules/es7.set.to-json.js create mode 100644 node_modules/core-js/modules/es7.string.at.js create mode 100644 node_modules/core-js/modules/es7.string.match-all.js create mode 100644 node_modules/core-js/modules/es7.string.pad-end.js create mode 100644 node_modules/core-js/modules/es7.string.pad-start.js create mode 100644 node_modules/core-js/modules/es7.string.trim-left.js create mode 100644 node_modules/core-js/modules/es7.string.trim-right.js create mode 100644 node_modules/core-js/modules/es7.symbol.async-iterator.js create mode 100644 node_modules/core-js/modules/es7.symbol.observable.js create mode 100644 node_modules/core-js/modules/es7.system.global.js create mode 100644 node_modules/core-js/modules/es7.weak-map.from.js create mode 100644 node_modules/core-js/modules/es7.weak-map.of.js create mode 100644 node_modules/core-js/modules/es7.weak-set.from.js create mode 100644 node_modules/core-js/modules/es7.weak-set.of.js create mode 100644 node_modules/core-js/modules/library/_add-to-unscopables.js create mode 100644 node_modules/core-js/modules/library/_collection.js create mode 100644 node_modules/core-js/modules/library/_export.js create mode 100644 node_modules/core-js/modules/library/_library.js create mode 100644 node_modules/core-js/modules/library/_path.js create mode 100644 node_modules/core-js/modules/library/_redefine-all.js create mode 100644 node_modules/core-js/modules/library/_redefine.js create mode 100644 node_modules/core-js/modules/library/_set-species.js create mode 100644 node_modules/core-js/modules/library/es6.date.to-json.js create mode 100644 node_modules/core-js/modules/library/es6.date.to-primitive.js create mode 100644 node_modules/core-js/modules/library/es6.date.to-string.js create mode 100644 node_modules/core-js/modules/library/es6.function.name.js create mode 100644 node_modules/core-js/modules/library/es6.number.constructor.js create mode 100644 node_modules/core-js/modules/library/es6.object.to-string.js create mode 100644 node_modules/core-js/modules/library/es6.regexp.constructor.js create mode 100644 node_modules/core-js/modules/library/es6.regexp.flags.js create mode 100644 node_modules/core-js/modules/library/es6.regexp.match.js create mode 100644 node_modules/core-js/modules/library/es6.regexp.replace.js create mode 100644 node_modules/core-js/modules/library/es6.regexp.search.js create mode 100644 node_modules/core-js/modules/library/es6.regexp.split.js create mode 100644 node_modules/core-js/modules/library/es6.regexp.to-string.js create mode 100644 node_modules/core-js/modules/library/web.dom.iterable.js create mode 100644 node_modules/core-js/modules/web.dom.iterable.js create mode 100644 node_modules/core-js/modules/web.immediate.js create mode 100644 node_modules/core-js/modules/web.timers.js create mode 100644 node_modules/core-js/package.json create mode 100644 node_modules/core-js/shim.js create mode 100644 node_modules/core-js/stage/0.js create mode 100644 node_modules/core-js/stage/1.js create mode 100644 node_modules/core-js/stage/2.js create mode 100644 node_modules/core-js/stage/3.js create mode 100644 node_modules/core-js/stage/4.js create mode 100644 node_modules/core-js/stage/index.js create mode 100644 node_modules/core-js/stage/pre.js create mode 100644 node_modules/core-js/web/dom-collections.js create mode 100644 node_modules/core-js/web/immediate.js create mode 100644 node_modules/core-js/web/index.js create mode 100644 node_modules/core-js/web/timers.js create mode 100644 node_modules/core-util-is/LICENSE create mode 100644 node_modules/core-util-is/README.md create mode 100644 node_modules/core-util-is/float.patch create mode 100644 node_modules/core-util-is/lib/util.js create mode 100644 node_modules/core-util-is/package.json create mode 100644 node_modules/core-util-is/test.js create mode 100644 node_modules/create-ecdh/.travis.yml create mode 100644 node_modules/create-ecdh/LICENSE create mode 100644 node_modules/create-ecdh/browser.js create mode 100644 node_modules/create-ecdh/index.js create mode 100644 node_modules/create-ecdh/package.json create mode 100644 node_modules/create-ecdh/readme.md create mode 100644 node_modules/create-hash/.travis.yml create mode 100644 node_modules/create-hash/LICENSE create mode 100644 node_modules/create-hash/README.md create mode 100644 node_modules/create-hash/browser.js create mode 100644 node_modules/create-hash/index.js create mode 100644 node_modules/create-hash/md5.js create mode 100644 node_modules/create-hash/package.json create mode 100644 node_modules/create-hash/test.js create mode 100644 node_modules/create-hmac/LICENSE create mode 100644 node_modules/create-hmac/README.md create mode 100644 node_modules/create-hmac/browser.js create mode 100644 node_modules/create-hmac/index.js create mode 100644 node_modules/create-hmac/legacy.js create mode 100644 node_modules/create-hmac/package.json create mode 100644 node_modules/cross-spawn/CHANGELOG.md create mode 100644 node_modules/cross-spawn/LICENSE create mode 100644 node_modules/cross-spawn/README.md create mode 100644 node_modules/cross-spawn/index.js create mode 100644 node_modules/cross-spawn/lib/enoent.js create mode 100644 node_modules/cross-spawn/lib/parse.js create mode 100644 node_modules/cross-spawn/lib/util/escape.js create mode 100644 node_modules/cross-spawn/lib/util/readShebang.js create mode 100644 node_modules/cross-spawn/lib/util/resolveCommand.js create mode 100644 node_modules/cross-spawn/package.json create mode 100644 node_modules/crypt/LICENSE.mkd create mode 100644 node_modules/crypt/README.mkd create mode 100644 node_modules/crypt/crypt.js create mode 100644 node_modules/crypt/package.json create mode 100644 node_modules/crypto-browserify/.travis.yml create mode 100644 node_modules/crypto-browserify/.zuul.yml create mode 100644 node_modules/crypto-browserify/LICENSE create mode 100644 node_modules/crypto-browserify/README.md create mode 100644 node_modules/crypto-browserify/example/bundle.js create mode 100644 node_modules/crypto-browserify/example/index.html create mode 100644 node_modules/crypto-browserify/example/test.js create mode 100644 node_modules/crypto-browserify/index.js create mode 100644 node_modules/crypto-browserify/package.json create mode 100644 node_modules/crypto-browserify/test/aes.js create mode 100644 node_modules/crypto-browserify/test/create-hash.js create mode 100644 node_modules/crypto-browserify/test/create-hmac.js create mode 100644 node_modules/crypto-browserify/test/dh.js create mode 100644 node_modules/crypto-browserify/test/ecdh.js create mode 100644 node_modules/crypto-browserify/test/index.js create mode 100644 node_modules/crypto-browserify/test/node/dh.js create mode 100644 node_modules/crypto-browserify/test/pbkdf2.js create mode 100644 node_modules/crypto-browserify/test/public-encrypt.js create mode 100644 node_modules/crypto-browserify/test/random-bytes.js create mode 100644 node_modules/crypto-browserify/test/random-fill.js create mode 100644 node_modules/crypto-browserify/test/sign.js create mode 100644 node_modules/csjs-inject/.npmignore create mode 100644 node_modules/csjs-inject/LICENSE create mode 100644 node_modules/csjs-inject/README.md create mode 100644 node_modules/csjs-inject/csjs.js create mode 100644 node_modules/csjs-inject/get-css.js create mode 100644 node_modules/csjs-inject/index.js create mode 100644 node_modules/csjs-inject/package.json create mode 100644 node_modules/csjs/.istanbul.yml create mode 100644 node_modules/csjs/.npmignore create mode 100644 node_modules/csjs/.travis.yml create mode 100644 node_modules/csjs/.zuul.yml create mode 100644 node_modules/csjs/LICENSE create mode 100644 node_modules/csjs/README.md create mode 100644 node_modules/csjs/csjs.js create mode 100644 node_modules/csjs/docs/automatic-vendor-prefixing.md create mode 100644 node_modules/csjs/docs/comments.md create mode 100644 node_modules/csjs/docs/keyframe-animations.md create mode 100644 node_modules/csjs/get-css.js create mode 100644 node_modules/csjs/index.js create mode 100644 node_modules/csjs/lib/base62-encode.js create mode 100644 node_modules/csjs/lib/build-exports.js create mode 100644 node_modules/csjs/lib/composition.js create mode 100644 node_modules/csjs/lib/csjs.js create mode 100644 node_modules/csjs/lib/css-extract-extends.js create mode 100644 node_modules/csjs/lib/css-key.js create mode 100644 node_modules/csjs/lib/extract-exports.js create mode 100644 node_modules/csjs/lib/get-css.js create mode 100644 node_modules/csjs/lib/hash-string.js create mode 100644 node_modules/csjs/lib/regex.js create mode 100644 node_modules/csjs/lib/replace-animations.js create mode 100644 node_modules/csjs/lib/scoped-name.js create mode 100644 node_modules/csjs/lib/scopeify.js create mode 100644 node_modules/csjs/package.json create mode 100644 node_modules/csjs/test/animation-as-pseudo.expected.css create mode 100644 node_modules/csjs/test/animation-as-pseudo.expected.json create mode 100644 node_modules/csjs/test/animation-as-pseudo.noscope.expected.css create mode 100644 node_modules/csjs/test/animation-as-pseudo.noscope.expected.json create mode 100644 node_modules/csjs/test/animation-as-pseudo.noscope.source.js create mode 100644 node_modules/csjs/test/animation-as-pseudo.source.js create mode 100644 node_modules/csjs/test/basic.expected.css create mode 100644 node_modules/csjs/test/basic.expected.json create mode 100644 node_modules/csjs/test/basic.noscope.expected.css create mode 100644 node_modules/csjs/test/basic.noscope.expected.json create mode 100644 node_modules/csjs/test/basic.noscope.source.js create mode 100644 node_modules/csjs/test/basic.source.js create mode 100644 node_modules/csjs/test/comments.expected.css create mode 100644 node_modules/csjs/test/comments.expected.json create mode 100644 node_modules/csjs/test/comments.noscope.expected.css create mode 100644 node_modules/csjs/test/comments.noscope.expected.json create mode 100644 node_modules/csjs/test/comments.source.js create mode 100644 node_modules/csjs/test/comments.source.noscope.js create mode 100644 node_modules/csjs/test/dot-in-values.expected.css create mode 100644 node_modules/csjs/test/dot-in-values.expected.json create mode 100644 node_modules/csjs/test/dot-in-values.noscope.expected.css create mode 100644 node_modules/csjs/test/dot-in-values.noscope.expected.json create mode 100644 node_modules/csjs/test/dot-in-values.noscope.source.js create mode 100644 node_modules/csjs/test/dot-in-values.source.js create mode 100644 node_modules/csjs/test/extends-in-media-query.expected.css create mode 100644 node_modules/csjs/test/extends-in-media-query.expected.json create mode 100644 node_modules/csjs/test/extends-in-media-query.noscope.expected.css create mode 100644 node_modules/csjs/test/extends-in-media-query.noscope.expected.json create mode 100644 node_modules/csjs/test/extends-in-media-query.noscope.source.js create mode 100644 node_modules/csjs/test/extends-in-media-query.source.js create mode 100644 node_modules/csjs/test/extensions.expected.css create mode 100644 node_modules/csjs/test/extensions.expected.json create mode 100644 node_modules/csjs/test/extensions.noscope.expected.css create mode 100644 node_modules/csjs/test/extensions.noscope.expected.json create mode 100644 node_modules/csjs/test/extensions.noscope.source.js create mode 100644 node_modules/csjs/test/extensions.source.js create mode 100644 node_modules/csjs/test/index.js create mode 100644 node_modules/csjs/test/keyframes-usage.expected.css create mode 100644 node_modules/csjs/test/keyframes-usage.expected.json create mode 100644 node_modules/csjs/test/keyframes-usage.noscope.expected.css create mode 100644 node_modules/csjs/test/keyframes-usage.noscope.expected.json create mode 100644 node_modules/csjs/test/keyframes-usage.noscope.source.js create mode 100644 node_modules/csjs/test/keyframes-usage.source.js create mode 100644 node_modules/csjs/test/keyframes-with-decimal.expected.css create mode 100644 node_modules/csjs/test/keyframes-with-decimal.expected.json create mode 100644 node_modules/csjs/test/keyframes-with-decimal.noscope.expected.css create mode 100644 node_modules/csjs/test/keyframes-with-decimal.noscope.expected.json create mode 100644 node_modules/csjs/test/keyframes-with-decimal.noscope.source.js create mode 100644 node_modules/csjs/test/keyframes-with-decimal.source.js create mode 100644 node_modules/csjs/test/keyframes.expected.css create mode 100644 node_modules/csjs/test/keyframes.expected.json create mode 100644 node_modules/csjs/test/keyframes.noscope.expected.css create mode 100644 node_modules/csjs/test/keyframes.noscope.expected.json create mode 100644 node_modules/csjs/test/keyframes.noscope.source.js create mode 100644 node_modules/csjs/test/keyframes.source.js create mode 100644 node_modules/csjs/test/media-query.expected.css create mode 100644 node_modules/csjs/test/media-query.expected.json create mode 100644 node_modules/csjs/test/media-query.noscope.expected.css create mode 100644 node_modules/csjs/test/media-query.noscope.expected.json create mode 100644 node_modules/csjs/test/media-query.noscope.source.js create mode 100644 node_modules/csjs/test/media-query.source.js create mode 100644 node_modules/csjs/test/multiple-extensions.expected.css create mode 100644 node_modules/csjs/test/multiple-extensions.expected.json create mode 100644 node_modules/csjs/test/multiple-extensions.noscope.expected.css create mode 100644 node_modules/csjs/test/multiple-extensions.noscope.expected.json create mode 100644 node_modules/csjs/test/multiple-extensions.noscope.source.js create mode 100644 node_modules/csjs/test/multiple-extensions.source.js create mode 100644 node_modules/csjs/test/non-class.expected.css create mode 100644 node_modules/csjs/test/non-class.expected.json create mode 100644 node_modules/csjs/test/non-class.noscope.expected.css create mode 100644 node_modules/csjs/test/non-class.noscope.expected.json create mode 100644 node_modules/csjs/test/non-class.noscope.source.js create mode 100644 node_modules/csjs/test/non-class.source.js create mode 100644 node_modules/csjs/test/not-pseudo.expected.css create mode 100644 node_modules/csjs/test/not-pseudo.expected.json create mode 100644 node_modules/csjs/test/not-pseudo.noscope.expected.css create mode 100644 node_modules/csjs/test/not-pseudo.noscope.expected.json create mode 100644 node_modules/csjs/test/not-pseudo.noscope.source.js create mode 100644 node_modules/csjs/test/not-pseudo.source.js create mode 100644 node_modules/cytoscape/.babelrc create mode 100644 node_modules/cytoscape/.eslintrc.json create mode 100644 node_modules/cytoscape/.travis.yml create mode 100644 node_modules/cytoscape/ISSUE_TEMPLATE.md create mode 100644 node_modules/cytoscape/LICENSE create mode 100644 node_modules/cytoscape/README.md create mode 100644 node_modules/cytoscape/dist/cytoscape.cjs.js create mode 100644 node_modules/cytoscape/dist/cytoscape.js create mode 100644 node_modules/cytoscape/dist/cytoscape.min.js create mode 100644 node_modules/cytoscape/package.json create mode 100644 node_modules/cytoscape/src/animation.js create mode 100644 node_modules/cytoscape/src/collection/algorithms/a-star.js create mode 100644 node_modules/cytoscape/src/collection/algorithms/bellman-ford.js create mode 100644 node_modules/cytoscape/src/collection/algorithms/betweenness-centrality.js create mode 100644 node_modules/cytoscape/src/collection/algorithms/bfs-dfs.js create mode 100644 node_modules/cytoscape/src/collection/algorithms/closeness-centrality.js create mode 100644 node_modules/cytoscape/src/collection/algorithms/degree-centrality.js create mode 100644 node_modules/cytoscape/src/collection/algorithms/dijkstra.js create mode 100644 node_modules/cytoscape/src/collection/algorithms/floyd-warshall.js create mode 100644 node_modules/cytoscape/src/collection/algorithms/index.js create mode 100644 node_modules/cytoscape/src/collection/algorithms/kerger-stein.js create mode 100644 node_modules/cytoscape/src/collection/algorithms/kruskal.js create mode 100644 node_modules/cytoscape/src/collection/algorithms/page-rank.js create mode 100644 node_modules/cytoscape/src/collection/animation.js create mode 100644 node_modules/cytoscape/src/collection/class.js create mode 100644 node_modules/cytoscape/src/collection/comparators.js create mode 100644 node_modules/cytoscape/src/collection/compounds.js create mode 100644 node_modules/cytoscape/src/collection/data.js create mode 100644 node_modules/cytoscape/src/collection/degree.js create mode 100644 node_modules/cytoscape/src/collection/dimensions/bounds.js create mode 100644 node_modules/cytoscape/src/collection/dimensions/edge-points.js create mode 100644 node_modules/cytoscape/src/collection/dimensions/index.js create mode 100644 node_modules/cytoscape/src/collection/dimensions/position.js create mode 100644 node_modules/cytoscape/src/collection/dimensions/width-height.js create mode 100644 node_modules/cytoscape/src/collection/element.js create mode 100644 node_modules/cytoscape/src/collection/events.js create mode 100644 node_modules/cytoscape/src/collection/filter.js create mode 100644 node_modules/cytoscape/src/collection/group.js create mode 100644 node_modules/cytoscape/src/collection/index.js create mode 100644 node_modules/cytoscape/src/collection/iteration.js create mode 100644 node_modules/cytoscape/src/collection/layout.js create mode 100644 node_modules/cytoscape/src/collection/style.js create mode 100644 node_modules/cytoscape/src/collection/switch-functions.js create mode 100644 node_modules/cytoscape/src/collection/traversing.js create mode 100644 node_modules/cytoscape/src/collection/zsort.js create mode 100644 node_modules/cytoscape/src/core/add-remove.js create mode 100644 node_modules/cytoscape/src/core/animation/cubic-bezier.js create mode 100644 node_modules/cytoscape/src/core/animation/ease.js create mode 100644 node_modules/cytoscape/src/core/animation/easings.js create mode 100644 node_modules/cytoscape/src/core/animation/index.js create mode 100644 node_modules/cytoscape/src/core/animation/spring.js create mode 100644 node_modules/cytoscape/src/core/animation/start.js create mode 100644 node_modules/cytoscape/src/core/animation/step-all.js create mode 100644 node_modules/cytoscape/src/core/animation/step.js create mode 100644 node_modules/cytoscape/src/core/events.js create mode 100644 node_modules/cytoscape/src/core/export.js create mode 100644 node_modules/cytoscape/src/core/index.js create mode 100644 node_modules/cytoscape/src/core/layout.js create mode 100644 node_modules/cytoscape/src/core/notification.js create mode 100644 node_modules/cytoscape/src/core/renderer.js create mode 100644 node_modules/cytoscape/src/core/search.js create mode 100644 node_modules/cytoscape/src/core/style.js create mode 100644 node_modules/cytoscape/src/core/viewport.js create mode 100644 node_modules/cytoscape/src/define/animation.js create mode 100644 node_modules/cytoscape/src/define/data.js create mode 100644 node_modules/cytoscape/src/define/events.js create mode 100644 node_modules/cytoscape/src/define/index.js create mode 100644 node_modules/cytoscape/src/emitter.js create mode 100644 node_modules/cytoscape/src/event.js create mode 100644 node_modules/cytoscape/src/extension.js create mode 100644 node_modules/cytoscape/src/extensions/index.js create mode 100644 node_modules/cytoscape/src/extensions/layout/breadthfirst.js create mode 100644 node_modules/cytoscape/src/extensions/layout/circle.js create mode 100644 node_modules/cytoscape/src/extensions/layout/concentric.js create mode 100644 node_modules/cytoscape/src/extensions/layout/cose.js create mode 100644 node_modules/cytoscape/src/extensions/layout/grid.js create mode 100644 node_modules/cytoscape/src/extensions/layout/index.js create mode 100644 node_modules/cytoscape/src/extensions/layout/null.js create mode 100644 node_modules/cytoscape/src/extensions/layout/preset.js create mode 100644 node_modules/cytoscape/src/extensions/layout/random.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/base/arrow-shapes.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/coords.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-arrows.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-control-points.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-endpoints.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-projection.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/index.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/labels.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/nodes.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/rendered-style.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/z-ordering.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/base/images.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/base/index.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/base/load-listeners.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/base/node-shapes.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/base/redraw.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/arrow-shapes.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/drawing-edges.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/drawing-elements.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/drawing-images.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/drawing-label-text.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/drawing-nodes.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/drawing-redraw.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/drawing-shapes.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/ele-texture-cache.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/export-image.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/index.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/layered-texture-cache.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/node-shapes.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/texture-cache-defs.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/index.js create mode 100644 node_modules/cytoscape/src/extensions/renderer/null/index.js create mode 100644 node_modules/cytoscape/src/heap.js create mode 100644 node_modules/cytoscape/src/index.js create mode 100644 node_modules/cytoscape/src/is.js create mode 100644 node_modules/cytoscape/src/map.js create mode 100644 node_modules/cytoscape/src/math.js create mode 100644 node_modules/cytoscape/src/promise.js create mode 100644 node_modules/cytoscape/src/selector/expressions.js create mode 100644 node_modules/cytoscape/src/selector/index.js create mode 100644 node_modules/cytoscape/src/selector/matching.js create mode 100644 node_modules/cytoscape/src/selector/new-query.js create mode 100644 node_modules/cytoscape/src/selector/parse.js create mode 100644 node_modules/cytoscape/src/selector/state.js create mode 100644 node_modules/cytoscape/src/selector/tokens.js create mode 100644 node_modules/cytoscape/src/set.js create mode 100644 node_modules/cytoscape/src/style/apply.js create mode 100644 node_modules/cytoscape/src/style/bypass.js create mode 100644 node_modules/cytoscape/src/style/container.js create mode 100644 node_modules/cytoscape/src/style/get-for-ele.js create mode 100644 node_modules/cytoscape/src/style/index.js create mode 100644 node_modules/cytoscape/src/style/json.js create mode 100644 node_modules/cytoscape/src/style/parse.js create mode 100644 node_modules/cytoscape/src/style/properties.js create mode 100644 node_modules/cytoscape/src/style/string-sheet.js create mode 100644 node_modules/cytoscape/src/stylesheet.js create mode 100644 node_modules/cytoscape/src/test.js create mode 100644 node_modules/cytoscape/src/util/colors.js create mode 100644 node_modules/cytoscape/src/util/index.js create mode 100644 node_modules/cytoscape/src/util/maps.js create mode 100644 node_modules/cytoscape/src/util/memoize.js create mode 100644 node_modules/cytoscape/src/util/regex.js create mode 100644 node_modules/cytoscape/src/util/sort.js create mode 100644 node_modules/cytoscape/src/util/strings.js create mode 100644 node_modules/cytoscape/src/util/timing.js create mode 100644 node_modules/cytoscape/src/version.js create mode 100644 node_modules/cytoscape/src/version.json create mode 100644 node_modules/cytoscape/src/window.js create mode 100644 node_modules/cytoscape/webpack.config.js create mode 100644 node_modules/date-now/.npmignore create mode 100644 node_modules/date-now/.testem.json create mode 100644 node_modules/date-now/.travis.yml create mode 100644 node_modules/date-now/LICENCE create mode 100644 node_modules/date-now/README.md create mode 100644 node_modules/date-now/index.js create mode 100644 node_modules/date-now/package.json create mode 100644 node_modules/date-now/seed.js create mode 100644 node_modules/date-now/test/index.js create mode 100644 node_modules/date-now/test/static/index.html create mode 100644 node_modules/debounce/History.md create mode 100644 node_modules/debounce/Makefile create mode 100644 node_modules/debounce/Readme.md create mode 100644 node_modules/debounce/component.json create mode 100644 node_modules/debounce/index.js create mode 100644 node_modules/debounce/package.json create mode 100644 node_modules/debounce/test.html create mode 100644 node_modules/debounce/test.js create mode 100644 node_modules/debug/.coveralls.yml create mode 100644 node_modules/debug/.eslintrc create mode 100644 node_modules/debug/.npmignore create mode 100644 node_modules/debug/.travis.yml create mode 100644 node_modules/debug/CHANGELOG.md create mode 100644 node_modules/debug/LICENSE create mode 100644 node_modules/debug/Makefile create mode 100644 node_modules/debug/README.md create mode 100644 node_modules/debug/component.json create mode 100644 node_modules/debug/karma.conf.js create mode 100644 node_modules/debug/node.js create mode 100644 node_modules/debug/package.json create mode 100644 node_modules/debug/src/browser.js create mode 100644 node_modules/debug/src/debug.js create mode 100644 node_modules/debug/src/index.js create mode 100644 node_modules/debug/src/inspector-log.js create mode 100644 node_modules/debug/src/node.js create mode 100644 node_modules/decode-uri-component/index.js create mode 100644 node_modules/decode-uri-component/license create mode 100644 node_modules/decode-uri-component/package.json create mode 100644 node_modules/decode-uri-component/readme.md create mode 100644 node_modules/default-gateway/LICENSE create mode 100644 node_modules/default-gateway/README.md create mode 100644 node_modules/default-gateway/android.js create mode 100644 node_modules/default-gateway/darwin.js create mode 100644 node_modules/default-gateway/freebsd.js create mode 100644 node_modules/default-gateway/index.js create mode 100644 node_modules/default-gateway/linux.js create mode 100644 node_modules/default-gateway/openbsd.js create mode 100644 node_modules/default-gateway/package.json create mode 100644 node_modules/default-gateway/sunos.js create mode 100644 node_modules/default-gateway/win32.js create mode 100644 node_modules/define-property/CHANGELOG.md create mode 100644 node_modules/define-property/LICENSE create mode 100644 node_modules/define-property/README.md create mode 100644 node_modules/define-property/index.js create mode 100644 node_modules/define-property/node_modules/is-accessor-descriptor/LICENSE create mode 100644 node_modules/define-property/node_modules/is-accessor-descriptor/README.md create mode 100644 node_modules/define-property/node_modules/is-accessor-descriptor/index.js create mode 100644 node_modules/define-property/node_modules/is-accessor-descriptor/package.json create mode 100644 node_modules/define-property/node_modules/is-data-descriptor/LICENSE create mode 100644 node_modules/define-property/node_modules/is-data-descriptor/README.md create mode 100644 node_modules/define-property/node_modules/is-data-descriptor/index.js create mode 100644 node_modules/define-property/node_modules/is-data-descriptor/package.json create mode 100644 node_modules/define-property/node_modules/is-descriptor/LICENSE create mode 100644 node_modules/define-property/node_modules/is-descriptor/README.md create mode 100644 node_modules/define-property/node_modules/is-descriptor/index.js create mode 100644 node_modules/define-property/node_modules/is-descriptor/package.json create mode 100644 node_modules/define-property/node_modules/isobject/LICENSE create mode 100644 node_modules/define-property/node_modules/isobject/README.md create mode 100644 node_modules/define-property/node_modules/isobject/index.d.ts create mode 100644 node_modules/define-property/node_modules/isobject/index.js create mode 100644 node_modules/define-property/node_modules/isobject/package.json create mode 100644 node_modules/define-property/node_modules/kind-of/CHANGELOG.md create mode 100644 node_modules/define-property/node_modules/kind-of/LICENSE create mode 100644 node_modules/define-property/node_modules/kind-of/README.md create mode 100644 node_modules/define-property/node_modules/kind-of/index.js create mode 100644 node_modules/define-property/node_modules/kind-of/package.json create mode 100644 node_modules/define-property/package.json create mode 100644 node_modules/defined/.travis.yml create mode 100644 node_modules/defined/LICENSE create mode 100644 node_modules/defined/example/defined.js create mode 100644 node_modules/defined/index.js create mode 100644 node_modules/defined/package.json create mode 100644 node_modules/defined/readme.markdown create mode 100644 node_modules/defined/test/def.js create mode 100644 node_modules/defined/test/falsy.js create mode 100644 node_modules/depd/History.md create mode 100644 node_modules/depd/LICENSE create mode 100644 node_modules/depd/Readme.md create mode 100644 node_modules/depd/index.js create mode 100644 node_modules/depd/lib/browser/index.js create mode 100644 node_modules/depd/lib/compat/callsite-tostring.js create mode 100644 node_modules/depd/lib/compat/event-listener-count.js create mode 100644 node_modules/depd/lib/compat/index.js create mode 100644 node_modules/depd/package.json create mode 100644 node_modules/deps-sort/.travis.yml create mode 100644 node_modules/deps-sort/LICENSE create mode 100755 node_modules/deps-sort/bin/cmd.js create mode 100644 node_modules/deps-sort/example/sort.js create mode 100644 node_modules/deps-sort/index.js create mode 100644 node_modules/deps-sort/package.json create mode 100644 node_modules/deps-sort/readme.markdown create mode 100644 node_modules/deps-sort/test/dedupe-deps-of-deps.js create mode 100644 node_modules/deps-sort/test/dedupe.js create mode 100644 node_modules/deps-sort/test/dedupe_index.js create mode 100644 node_modules/deps-sort/test/dedupe_undef.js create mode 100644 node_modules/deps-sort/test/expose.js create mode 100644 node_modules/deps-sort/test/expose_str.js create mode 100644 node_modules/deps-sort/test/indexed.js create mode 100644 node_modules/deps-sort/test/sort.js create mode 100644 node_modules/des.js/.jscsrc create mode 100644 node_modules/des.js/.jshintrc create mode 100644 node_modules/des.js/.npmignore create mode 100644 node_modules/des.js/README.md create mode 100644 node_modules/des.js/lib/des.js create mode 100644 node_modules/des.js/lib/des/cbc.js create mode 100644 node_modules/des.js/lib/des/cipher.js create mode 100644 node_modules/des.js/lib/des/des.js create mode 100644 node_modules/des.js/lib/des/ede.js create mode 100644 node_modules/des.js/lib/des/utils.js create mode 100644 node_modules/des.js/package.json create mode 100644 node_modules/des.js/test/cbc-test.js create mode 100644 node_modules/des.js/test/des-test.js create mode 100644 node_modules/des.js/test/ede-test.js create mode 100644 node_modules/des.js/test/fixtures.js create mode 100644 node_modules/des.js/test/utils-test.js create mode 100644 node_modules/destroy/LICENSE create mode 100644 node_modules/destroy/README.md create mode 100644 node_modules/destroy/index.js create mode 100644 node_modules/destroy/package.json create mode 100644 node_modules/detective/.travis.yml create mode 100644 node_modules/detective/CHANGELOG.md create mode 100644 node_modules/detective/LICENSE create mode 100644 node_modules/detective/bench/detect.js create mode 100644 node_modules/detective/bench/esprima_v_acorn.txt create mode 100755 node_modules/detective/bin/detective.js create mode 100644 node_modules/detective/example/strings.js create mode 100644 node_modules/detective/example/strings_src.js create mode 100644 node_modules/detective/index.js create mode 100644 node_modules/detective/package.json create mode 100644 node_modules/detective/readme.markdown create mode 100644 node_modules/detective/test/both.js create mode 100644 node_modules/detective/test/chained.js create mode 100644 node_modules/detective/test/complicated.js create mode 100644 node_modules/detective/test/es6-module.js create mode 100644 node_modules/detective/test/files/both.js create mode 100644 node_modules/detective/test/files/chained.js create mode 100644 node_modules/detective/test/files/es6-module.js create mode 100644 node_modules/detective/test/files/generators.js create mode 100644 node_modules/detective/test/files/isrequire.js create mode 100644 node_modules/detective/test/files/nested.js create mode 100644 node_modules/detective/test/files/rest-spread.js create mode 100644 node_modules/detective/test/files/set-in-object-pattern.js create mode 100644 node_modules/detective/test/files/shebang.js create mode 100644 node_modules/detective/test/files/sparse-array.js create mode 100644 node_modules/detective/test/files/strings.js create mode 100644 node_modules/detective/test/files/word.js create mode 100644 node_modules/detective/test/files/yield.js create mode 100644 node_modules/detective/test/generators.js create mode 100644 node_modules/detective/test/isrequire.js create mode 100644 node_modules/detective/test/nested.js create mode 100644 node_modules/detective/test/noargs.js create mode 100644 node_modules/detective/test/parseopts.js create mode 100644 node_modules/detective/test/rest-spread.js create mode 100644 node_modules/detective/test/return.js create mode 100644 node_modules/detective/test/set-in-object-pattern.js create mode 100644 node_modules/detective/test/shebang.js create mode 100644 node_modules/detective/test/sparse-array.js create mode 100644 node_modules/detective/test/strings.js create mode 100644 node_modules/detective/test/word.js create mode 100644 node_modules/detective/test/yield.js create mode 100644 node_modules/diffie-hellman/.travis.yml create mode 100644 node_modules/diffie-hellman/LICENSE create mode 100644 node_modules/diffie-hellman/browser.js create mode 100644 node_modules/diffie-hellman/index.js create mode 100644 node_modules/diffie-hellman/lib/dh.js create mode 100644 node_modules/diffie-hellman/lib/generatePrime.js create mode 100644 node_modules/diffie-hellman/lib/primes.json create mode 100644 node_modules/diffie-hellman/package.json create mode 100644 node_modules/diffie-hellman/readme.md create mode 100644 node_modules/domain-browser/HISTORY.md create mode 100644 node_modules/domain-browser/LICENSE.md create mode 100644 node_modules/domain-browser/README.md create mode 100644 node_modules/domain-browser/package.json create mode 100644 node_modules/domain-browser/source/index.js create mode 100644 node_modules/duplexer2/LICENSE.md create mode 100644 node_modules/duplexer2/README.md create mode 100644 node_modules/duplexer2/index.js create mode 100644 node_modules/duplexer2/package.json create mode 100644 node_modules/ee-first/LICENSE create mode 100644 node_modules/ee-first/README.md create mode 100644 node_modules/ee-first/index.js create mode 100644 node_modules/ee-first/package.json create mode 100644 node_modules/elliptic/README.md create mode 100644 node_modules/elliptic/lib/elliptic.js create mode 100644 node_modules/elliptic/lib/elliptic/curve/base.js create mode 100644 node_modules/elliptic/lib/elliptic/curve/edwards.js create mode 100644 node_modules/elliptic/lib/elliptic/curve/index.js create mode 100644 node_modules/elliptic/lib/elliptic/curve/mont.js create mode 100644 node_modules/elliptic/lib/elliptic/curve/short.js create mode 100644 node_modules/elliptic/lib/elliptic/curves.js create mode 100644 node_modules/elliptic/lib/elliptic/ec/index.js create mode 100644 node_modules/elliptic/lib/elliptic/ec/key.js create mode 100644 node_modules/elliptic/lib/elliptic/ec/signature.js create mode 100644 node_modules/elliptic/lib/elliptic/eddsa/index.js create mode 100644 node_modules/elliptic/lib/elliptic/eddsa/key.js create mode 100644 node_modules/elliptic/lib/elliptic/eddsa/signature.js create mode 100644 node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js create mode 100644 node_modules/elliptic/lib/elliptic/utils.js create mode 100644 node_modules/elliptic/package.json create mode 100644 node_modules/encodeurl/HISTORY.md create mode 100644 node_modules/encodeurl/LICENSE create mode 100644 node_modules/encodeurl/README.md create mode 100644 node_modules/encodeurl/index.js create mode 100644 node_modules/encodeurl/package.json create mode 100644 node_modules/es6-promisify/LICENSE create mode 100644 node_modules/es6-promisify/README.md create mode 100644 node_modules/es6-promisify/dist/promisify.js create mode 100644 node_modules/es6-promisify/package.json create mode 100644 node_modules/escape-html/LICENSE create mode 100644 node_modules/escape-html/Readme.md create mode 100644 node_modules/escape-html/index.js create mode 100644 node_modules/escape-html/package.json create mode 100644 node_modules/escape-string-regexp/index.js create mode 100644 node_modules/escape-string-regexp/license create mode 100644 node_modules/escape-string-regexp/package.json create mode 100644 node_modules/escape-string-regexp/readme.md create mode 100644 node_modules/etag/HISTORY.md create mode 100644 node_modules/etag/LICENSE create mode 100644 node_modules/etag/README.md create mode 100644 node_modules/etag/index.js create mode 100644 node_modules/etag/package.json create mode 100644 node_modules/events/.npmignore create mode 100644 node_modules/events/.travis.yml create mode 100644 node_modules/events/.zuul.yml create mode 100644 node_modules/events/History.md create mode 100644 node_modules/events/LICENSE create mode 100644 node_modules/events/Readme.md create mode 100644 node_modules/events/events.js create mode 100644 node_modules/events/package.json create mode 100644 node_modules/events/tests/add-listeners.js create mode 100644 node_modules/events/tests/check-listener-leaks.js create mode 100644 node_modules/events/tests/common.js create mode 100644 node_modules/events/tests/index.js create mode 100644 node_modules/events/tests/legacy-compat.js create mode 100644 node_modules/events/tests/listener-count.js create mode 100644 node_modules/events/tests/listeners-side-effects.js create mode 100644 node_modules/events/tests/listeners.js create mode 100644 node_modules/events/tests/max-listeners.js create mode 100644 node_modules/events/tests/modify-in-emit.js create mode 100644 node_modules/events/tests/num-args.js create mode 100644 node_modules/events/tests/once.js create mode 100644 node_modules/events/tests/remove-all-listeners.js create mode 100644 node_modules/events/tests/remove-listeners.js create mode 100644 node_modules/events/tests/set-max-listeners-side-effects.js create mode 100644 node_modules/events/tests/subclass.js create mode 100644 node_modules/evp_bytestokey/LICENSE create mode 100644 node_modules/evp_bytestokey/README.md create mode 100644 node_modules/evp_bytestokey/index.js create mode 100644 node_modules/evp_bytestokey/package.json create mode 100644 node_modules/execa/index.js create mode 100644 node_modules/execa/lib/errname.js create mode 100644 node_modules/execa/lib/stdio.js create mode 100644 node_modules/execa/license create mode 100644 node_modules/execa/package.json create mode 100644 node_modules/execa/readme.md create mode 100644 node_modules/expand-brackets/LICENSE create mode 100644 node_modules/expand-brackets/README.md create mode 100644 node_modules/expand-brackets/index.js create mode 100644 node_modules/expand-brackets/package.json create mode 100644 node_modules/expand-range/LICENSE create mode 100644 node_modules/expand-range/README.md create mode 100644 node_modules/expand-range/index.js create mode 100644 node_modules/expand-range/package.json create mode 100644 node_modules/extend-shallow/LICENSE create mode 100644 node_modules/extend-shallow/README.md create mode 100644 node_modules/extend-shallow/index.js create mode 100644 node_modules/extend-shallow/node_modules/is-extendable/LICENSE create mode 100644 node_modules/extend-shallow/node_modules/is-extendable/README.md create mode 100644 node_modules/extend-shallow/node_modules/is-extendable/index.d.ts create mode 100644 node_modules/extend-shallow/node_modules/is-extendable/index.js create mode 100644 node_modules/extend-shallow/node_modules/is-extendable/package.json create mode 100644 node_modules/extend-shallow/package.json create mode 100644 node_modules/extglob/LICENSE create mode 100644 node_modules/extglob/README.md create mode 100644 node_modules/extglob/index.js create mode 100644 node_modules/extglob/package.json create mode 100644 node_modules/filename-regex/LICENSE create mode 100644 node_modules/filename-regex/README.md create mode 100644 node_modules/filename-regex/index.js create mode 100644 node_modules/filename-regex/package.json create mode 100644 node_modules/fill-range/LICENSE create mode 100644 node_modules/fill-range/README.md create mode 100644 node_modules/fill-range/index.js create mode 100644 node_modules/fill-range/package.json create mode 100644 node_modules/for-in/LICENSE create mode 100644 node_modules/for-in/README.md create mode 100644 node_modules/for-in/index.js create mode 100644 node_modules/for-in/package.json create mode 100644 node_modules/for-own/LICENSE create mode 100644 node_modules/for-own/README.md create mode 100644 node_modules/for-own/index.js create mode 100644 node_modules/for-own/package.json create mode 100644 node_modules/fragment-cache/LICENSE create mode 100644 node_modules/fragment-cache/README.md create mode 100644 node_modules/fragment-cache/index.js create mode 100644 node_modules/fragment-cache/package.json create mode 100644 node_modules/fresh/HISTORY.md create mode 100644 node_modules/fresh/LICENSE create mode 100644 node_modules/fresh/README.md create mode 100644 node_modules/fresh/index.js create mode 100644 node_modules/fresh/package.json create mode 100644 node_modules/from2-string/LICENSE create mode 100644 node_modules/from2-string/README.md create mode 100644 node_modules/from2-string/index.js create mode 100644 node_modules/from2-string/package.json create mode 100644 node_modules/from2/.travis.yml create mode 100644 node_modules/from2/LICENSE.md create mode 100644 node_modules/from2/README.md create mode 100644 node_modules/from2/index.js create mode 100644 node_modules/from2/package.json create mode 100644 node_modules/from2/test.js create mode 100644 node_modules/fs.realpath/LICENSE create mode 100644 node_modules/fs.realpath/README.md create mode 100644 node_modules/fs.realpath/index.js create mode 100644 node_modules/fs.realpath/old.js create mode 100644 node_modules/fs.realpath/package.json create mode 100644 node_modules/function-bind/.editorconfig create mode 100644 node_modules/function-bind/.eslintrc create mode 100644 node_modules/function-bind/.jscs.json create mode 100644 node_modules/function-bind/.npmignore create mode 100644 node_modules/function-bind/.travis.yml create mode 100644 node_modules/function-bind/LICENSE create mode 100644 node_modules/function-bind/README.md create mode 100644 node_modules/function-bind/implementation.js create mode 100644 node_modules/function-bind/index.js create mode 100644 node_modules/function-bind/package.json create mode 100644 node_modules/function-bind/test/.eslintrc create mode 100644 node_modules/function-bind/test/index.js create mode 100644 node_modules/garnish/LICENSE.md create mode 100644 node_modules/garnish/README.md create mode 100755 node_modules/garnish/bin/cmd.js create mode 100644 node_modules/garnish/index.js create mode 100644 node_modules/garnish/lib/levels.js create mode 100644 node_modules/garnish/lib/renderer.js create mode 100644 node_modules/garnish/package.json create mode 100644 node_modules/get-assigned-identifiers/.travis.yml create mode 100644 node_modules/get-assigned-identifiers/CHANGELOG.md create mode 100644 node_modules/get-assigned-identifiers/LICENSE.md create mode 100644 node_modules/get-assigned-identifiers/README.md create mode 100644 node_modules/get-assigned-identifiers/index.js create mode 100644 node_modules/get-assigned-identifiers/package.json create mode 100644 node_modules/get-assigned-identifiers/test/index.js create mode 100644 node_modules/get-ports/LICENSE.md create mode 100644 node_modules/get-ports/README.md create mode 100644 node_modules/get-ports/index.js create mode 100644 node_modules/get-ports/package.json create mode 100644 node_modules/get-stream/buffer-stream.js create mode 100644 node_modules/get-stream/index.js create mode 100644 node_modules/get-stream/license create mode 100644 node_modules/get-stream/package.json create mode 100644 node_modules/get-stream/readme.md create mode 100644 node_modules/get-value/LICENSE create mode 100644 node_modules/get-value/index.js create mode 100644 node_modules/get-value/package.json create mode 100644 node_modules/glob-base/LICENSE create mode 100644 node_modules/glob-base/README.md create mode 100644 node_modules/glob-base/index.js create mode 100644 node_modules/glob-base/package.json create mode 100644 node_modules/glob-parent/.npmignore create mode 100644 node_modules/glob-parent/.travis.yml create mode 100644 node_modules/glob-parent/LICENSE create mode 100644 node_modules/glob-parent/README.md create mode 100644 node_modules/glob-parent/index.js create mode 100644 node_modules/glob-parent/package.json create mode 100644 node_modules/glob-parent/test.js create mode 100644 node_modules/glob/LICENSE create mode 100644 node_modules/glob/README.md create mode 100644 node_modules/glob/changelog.md create mode 100644 node_modules/glob/common.js create mode 100644 node_modules/glob/glob.js create mode 100644 node_modules/glob/package.json create mode 100644 node_modules/glob/sync.js create mode 100644 node_modules/graceful-fs/LICENSE create mode 100644 node_modules/graceful-fs/README.md create mode 100644 node_modules/graceful-fs/fs.js create mode 100644 node_modules/graceful-fs/graceful-fs.js create mode 100644 node_modules/graceful-fs/legacy-streams.js create mode 100644 node_modules/graceful-fs/package.json create mode 100644 node_modules/graceful-fs/polyfills.js create mode 100755 node_modules/has-ansi/cli.js create mode 100644 node_modules/has-ansi/index.js create mode 100644 node_modules/has-ansi/package.json create mode 100644 node_modules/has-ansi/readme.md create mode 100644 node_modules/has-value/LICENSE create mode 100644 node_modules/has-value/README.md create mode 100644 node_modules/has-value/index.js create mode 100644 node_modules/has-value/node_modules/isobject/LICENSE create mode 100644 node_modules/has-value/node_modules/isobject/README.md create mode 100644 node_modules/has-value/node_modules/isobject/index.d.ts create mode 100644 node_modules/has-value/node_modules/isobject/index.js create mode 100644 node_modules/has-value/node_modules/isobject/package.json create mode 100644 node_modules/has-value/package.json create mode 100644 node_modules/has-values/LICENSE create mode 100644 node_modules/has-values/README.md create mode 100644 node_modules/has-values/index.js create mode 100644 node_modules/has-values/node_modules/is-number/LICENSE create mode 100644 node_modules/has-values/node_modules/is-number/README.md create mode 100644 node_modules/has-values/node_modules/is-number/index.js create mode 100644 node_modules/has-values/node_modules/is-number/node_modules/kind-of/LICENSE create mode 100644 node_modules/has-values/node_modules/is-number/node_modules/kind-of/README.md create mode 100644 node_modules/has-values/node_modules/is-number/node_modules/kind-of/index.js create mode 100644 node_modules/has-values/node_modules/is-number/node_modules/kind-of/package.json create mode 100644 node_modules/has-values/node_modules/is-number/package.json create mode 100644 node_modules/has-values/node_modules/kind-of/LICENSE create mode 100644 node_modules/has-values/node_modules/kind-of/README.md create mode 100644 node_modules/has-values/node_modules/kind-of/index.js create mode 100644 node_modules/has-values/node_modules/kind-of/package.json create mode 100644 node_modules/has-values/package.json create mode 100644 node_modules/has/LICENSE-MIT create mode 100644 node_modules/has/README.md create mode 100644 node_modules/has/package.json create mode 100644 node_modules/has/src/index.js create mode 100644 node_modules/has/test/index.js create mode 100644 node_modules/hash-base/LICENSE create mode 100644 node_modules/hash-base/README.md create mode 100644 node_modules/hash-base/index.js create mode 100644 node_modules/hash-base/package.json create mode 100644 node_modules/hash.js/.eslintrc.js create mode 100644 node_modules/hash.js/.travis.yml create mode 100644 node_modules/hash.js/README.md create mode 100644 node_modules/hash.js/lib/hash.d.ts create mode 100644 node_modules/hash.js/lib/hash.js create mode 100644 node_modules/hash.js/lib/hash/common.js create mode 100644 node_modules/hash.js/lib/hash/hmac.js create mode 100644 node_modules/hash.js/lib/hash/ripemd.js create mode 100644 node_modules/hash.js/lib/hash/sha.js create mode 100644 node_modules/hash.js/lib/hash/sha/1.js create mode 100644 node_modules/hash.js/lib/hash/sha/224.js create mode 100644 node_modules/hash.js/lib/hash/sha/256.js create mode 100644 node_modules/hash.js/lib/hash/sha/384.js create mode 100644 node_modules/hash.js/lib/hash/sha/512.js create mode 100644 node_modules/hash.js/lib/hash/sha/common.js create mode 100644 node_modules/hash.js/lib/hash/utils.js create mode 100644 node_modules/hash.js/package.json create mode 100644 node_modules/hash.js/test/hash-test.js create mode 100644 node_modules/hash.js/test/hmac-test.js create mode 100644 node_modules/heap/.npmignore create mode 100644 node_modules/heap/.travis.yml create mode 100644 node_modules/heap/Makefile create mode 100644 node_modules/heap/README.md create mode 100644 node_modules/heap/bower.json create mode 100644 node_modules/heap/index.js create mode 100644 node_modules/heap/lib/heap.js create mode 100644 node_modules/heap/package.json create mode 100644 node_modules/heap/src/heap.coffee create mode 100644 node_modules/heap/test/heap.test.coffee create mode 100644 node_modules/hmac-drbg/.npmignore create mode 100644 node_modules/hmac-drbg/.travis.yml create mode 100644 node_modules/hmac-drbg/README.md create mode 100644 node_modules/hmac-drbg/lib/hmac-drbg.js create mode 100644 node_modules/hmac-drbg/package.json create mode 100644 node_modules/hmac-drbg/test/drbg-test.js create mode 100644 node_modules/hmac-drbg/test/fixtures/hmac-drbg-nist.json create mode 100644 node_modules/htmlescape/.npmignore create mode 100644 node_modules/htmlescape/CHANGELOG.md create mode 100644 node_modules/htmlescape/LICENSE create mode 100644 node_modules/htmlescape/README.md create mode 100644 node_modules/htmlescape/htmlescape.js create mode 100644 node_modules/htmlescape/package.json create mode 100644 node_modules/http-errors/HISTORY.md create mode 100644 node_modules/http-errors/LICENSE create mode 100644 node_modules/http-errors/README.md create mode 100644 node_modules/http-errors/index.js create mode 100644 node_modules/http-errors/package.json create mode 100644 node_modules/https-browserify/LICENSE create mode 100644 node_modules/https-browserify/index.js create mode 100644 node_modules/https-browserify/package.json create mode 100644 node_modules/https-browserify/readme.markdown create mode 100644 node_modules/hyperscript-attribute-to-property/LICENSE create mode 100644 node_modules/hyperscript-attribute-to-property/README.md create mode 100644 node_modules/hyperscript-attribute-to-property/index.js create mode 100644 node_modules/hyperscript-attribute-to-property/package.json create mode 100644 node_modules/hyperx/.travis.yml create mode 100644 node_modules/hyperx/LICENSE create mode 100644 node_modules/hyperx/bench/loop.js create mode 100644 node_modules/hyperx/bench/raw.js create mode 100644 node_modules/hyperx/example/deku/index.html create mode 100644 node_modules/hyperx/example/deku/main.js create mode 100644 node_modules/hyperx/example/deku/package.json create mode 100644 node_modules/hyperx/example/hyperscript.js create mode 100644 node_modules/hyperx/example/main_loop/index.html create mode 100644 node_modules/hyperx/example/main_loop/main.js create mode 100644 node_modules/hyperx/example/main_loop/package.json create mode 100644 node_modules/hyperx/example/react.js create mode 100644 node_modules/hyperx/example/react_browser/index.html create mode 100644 node_modules/hyperx/example/react_browser/main.js create mode 100644 node_modules/hyperx/example/react_browser/package.json create mode 100644 node_modules/hyperx/example/vdom.js create mode 100644 node_modules/hyperx/index.js create mode 100644 node_modules/hyperx/package.json create mode 100644 node_modules/hyperx/readme.markdown create mode 100644 node_modules/hyperx/test/attr.js create mode 100644 node_modules/hyperx/test/attr_to_prop.js create mode 100644 node_modules/hyperx/test/br.js create mode 100644 node_modules/hyperx/test/children.js create mode 100644 node_modules/hyperx/test/comment.js create mode 100644 node_modules/hyperx/test/concat.js create mode 100644 node_modules/hyperx/test/esc.js create mode 100644 node_modules/hyperx/test/ignore_surounding_whitespace.js create mode 100644 node_modules/hyperx/test/key.js create mode 100644 node_modules/hyperx/test/multi_elem_error.js create mode 100644 node_modules/hyperx/test/style.js create mode 100644 node_modules/hyperx/test/svg.js create mode 100644 node_modules/hyperx/test/tags.js create mode 100644 node_modules/hyperx/test/title.js create mode 100644 node_modules/hyperx/test/types.js create mode 100644 node_modules/hyperx/test/value.js create mode 100644 node_modules/hyperx/test/vdom.js create mode 100644 node_modules/hyperx/test/z_hyperscript.js create mode 100644 node_modules/ieee754/LICENSE create mode 100644 node_modules/ieee754/README.md create mode 100644 node_modules/ieee754/index.js create mode 100644 node_modules/ieee754/package.json create mode 100644 node_modules/individual/.npmignore create mode 100644 node_modules/individual/.travis.yml create mode 100644 node_modules/individual/LICENCE create mode 100644 node_modules/individual/README.md create mode 100644 node_modules/individual/index.js create mode 100644 node_modules/individual/one-version.js create mode 100644 node_modules/individual/package.json create mode 100644 node_modules/individual/test.js create mode 100644 node_modules/inflight/LICENSE create mode 100644 node_modules/inflight/README.md create mode 100644 node_modules/inflight/inflight.js create mode 100644 node_modules/inflight/package.json create mode 100644 node_modules/inherits/LICENSE create mode 100644 node_modules/inherits/README.md create mode 100644 node_modules/inherits/inherits.js create mode 100644 node_modules/inherits/inherits_browser.js create mode 100644 node_modules/inherits/package.json create mode 100644 node_modules/inject-lr-script/LICENSE.md create mode 100644 node_modules/inject-lr-script/index.js create mode 100644 node_modules/inject-lr-script/package.json create mode 100644 node_modules/inline-source-map/.npmignore create mode 100644 node_modules/inline-source-map/.travis.yml create mode 100644 node_modules/inline-source-map/LICENSE create mode 100644 node_modules/inline-source-map/README.md create mode 100644 node_modules/inline-source-map/example/foo-bar.js create mode 100644 node_modules/inline-source-map/index.js create mode 100644 node_modules/inline-source-map/package.json create mode 100644 node_modules/inline-source-map/test/inline-source-map.js create mode 100644 node_modules/inline-source-map/test/source-content.js create mode 100644 node_modules/insert-css/LICENSE create mode 100644 node_modules/insert-css/example/bundle.js create mode 100644 node_modules/insert-css/example/index.html create mode 100644 node_modules/insert-css/example/insert.js create mode 100644 node_modules/insert-css/example/style.css create mode 100644 node_modules/insert-css/index.js create mode 100644 node_modules/insert-css/package.json create mode 100644 node_modules/insert-css/readme.markdown create mode 100644 node_modules/insert-css/test/insert.js create mode 100644 node_modules/insert-module-globals/.travis.yml create mode 100644 node_modules/insert-module-globals/LICENSE create mode 100644 node_modules/insert-module-globals/appveyor.yml create mode 100644 node_modules/insert-module-globals/bench/.gitattributes create mode 100644 node_modules/insert-module-globals/bench/index.js create mode 100755 node_modules/insert-module-globals/bin/cmd.js create mode 100644 node_modules/insert-module-globals/example/files/foo/index.js create mode 100644 node_modules/insert-module-globals/example/files/main.js create mode 100644 node_modules/insert-module-globals/example/insert.js create mode 100644 node_modules/insert-module-globals/index.js create mode 100644 node_modules/insert-module-globals/package.json create mode 100644 node_modules/insert-module-globals/readme.markdown create mode 100644 node_modules/insert-module-globals/test/always.js create mode 100644 node_modules/insert-module-globals/test/always/custom_globals_without_defaults.js create mode 100644 node_modules/insert-module-globals/test/always/hidden_from_quick_test.js create mode 100644 node_modules/insert-module-globals/test/always/main.js create mode 100644 node_modules/insert-module-globals/test/global.js create mode 100644 node_modules/insert-module-globals/test/global/filename.js create mode 100644 node_modules/insert-module-globals/test/global/main.js create mode 100644 node_modules/insert-module-globals/test/immediate.js create mode 100644 node_modules/insert-module-globals/test/immediate/main.js create mode 100644 node_modules/insert-module-globals/test/insert.js create mode 100644 node_modules/insert-module-globals/test/insert/buffer.js create mode 100644 node_modules/insert-module-globals/test/insert/foo/buf.js create mode 100644 node_modules/insert-module-globals/test/insert/foo/index.js create mode 100644 node_modules/insert-module-globals/test/insert/main.js create mode 100644 node_modules/insert-module-globals/test/isbuffer.js create mode 100644 node_modules/insert-module-globals/test/isbuffer/both.js create mode 100644 node_modules/insert-module-globals/test/isbuffer/main.js create mode 100644 node_modules/insert-module-globals/test/isbuffer/new.js create mode 100644 node_modules/insert-module-globals/test/return.js create mode 100644 node_modules/insert-module-globals/test/return/foo/index.js create mode 100644 node_modules/insert-module-globals/test/return/main.js create mode 100644 node_modules/insert-module-globals/test/roots.js create mode 100644 node_modules/insert-module-globals/test/roots/main.js create mode 100644 node_modules/insert-module-globals/test/sourcemap.js create mode 100644 node_modules/insert-module-globals/test/sourcemap/main.js create mode 100644 node_modules/insert-module-globals/test/sourcemap/main_es6.js create mode 100644 node_modules/insert-module-globals/test/subdir.js create mode 100644 node_modules/insert-module-globals/test/subdir/main.js create mode 100644 node_modules/insert-module-globals/test/subdir/node_modules/is-buffer/index.js create mode 100644 node_modules/insert-module-globals/test/unprefix.js create mode 100644 node_modules/insert-module-globals/test/unprefix/hello.js create mode 100644 node_modules/insert-module-globals/test/unprefix/main.js create mode 100644 node_modules/internal-ip/index.js create mode 100644 node_modules/internal-ip/license create mode 100644 node_modules/internal-ip/package.json create mode 100644 node_modules/internal-ip/readme.md create mode 100644 node_modules/ip-regex/index.js create mode 100644 node_modules/ip-regex/license create mode 100644 node_modules/ip-regex/package.json create mode 100644 node_modules/ip-regex/readme.md create mode 100644 node_modules/ipaddr.js/README.md create mode 100644 node_modules/ipaddr.js/ipaddr.min.js create mode 100644 node_modules/ipaddr.js/lib/ipaddr.js create mode 100644 node_modules/ipaddr.js/lib/ipaddr.js.d.ts create mode 100644 node_modules/ipaddr.js/package.json create mode 100644 node_modules/is-accessor-descriptor/LICENSE create mode 100644 node_modules/is-accessor-descriptor/README.md create mode 100644 node_modules/is-accessor-descriptor/index.js create mode 100644 node_modules/is-accessor-descriptor/package.json create mode 100644 node_modules/is-binary-path/index.js create mode 100644 node_modules/is-binary-path/license create mode 100644 node_modules/is-binary-path/package.json create mode 100644 node_modules/is-binary-path/readme.md create mode 100644 node_modules/is-buffer/LICENSE create mode 100644 node_modules/is-buffer/README.md create mode 100644 node_modules/is-buffer/index.js create mode 100644 node_modules/is-buffer/package.json create mode 100644 node_modules/is-buffer/test/basic.js create mode 100644 node_modules/is-data-descriptor/LICENSE create mode 100644 node_modules/is-data-descriptor/README.md create mode 100644 node_modules/is-data-descriptor/index.js create mode 100644 node_modules/is-data-descriptor/package.json create mode 100644 node_modules/is-descriptor/LICENSE create mode 100644 node_modules/is-descriptor/README.md create mode 100644 node_modules/is-descriptor/index.js create mode 100644 node_modules/is-descriptor/node_modules/kind-of/LICENSE create mode 100644 node_modules/is-descriptor/node_modules/kind-of/README.md create mode 100644 node_modules/is-descriptor/node_modules/kind-of/index.js create mode 100644 node_modules/is-descriptor/node_modules/kind-of/package.json create mode 100644 node_modules/is-descriptor/package.json create mode 100644 node_modules/is-dotfile/LICENSE create mode 100644 node_modules/is-dotfile/README.md create mode 100644 node_modules/is-dotfile/index.js create mode 100644 node_modules/is-dotfile/package.json create mode 100644 node_modules/is-electron/LICENSE create mode 100644 node_modules/is-electron/README.md create mode 100644 node_modules/is-electron/index.js create mode 100644 node_modules/is-electron/package.json create mode 100644 node_modules/is-equal-shallow/LICENSE create mode 100644 node_modules/is-equal-shallow/README.md create mode 100644 node_modules/is-equal-shallow/index.js create mode 100644 node_modules/is-equal-shallow/package.json create mode 100644 node_modules/is-extendable/LICENSE create mode 100644 node_modules/is-extendable/README.md create mode 100644 node_modules/is-extendable/index.js create mode 100644 node_modules/is-extendable/package.json create mode 100644 node_modules/is-extglob/LICENSE create mode 100644 node_modules/is-extglob/README.md create mode 100644 node_modules/is-extglob/index.js create mode 100644 node_modules/is-extglob/package.json create mode 100644 node_modules/is-finite/index.js create mode 100644 node_modules/is-finite/license create mode 100644 node_modules/is-finite/package.json create mode 100644 node_modules/is-finite/readme.md create mode 100644 node_modules/is-glob/LICENSE create mode 100644 node_modules/is-glob/README.md create mode 100644 node_modules/is-glob/index.js create mode 100644 node_modules/is-glob/package.json create mode 100644 node_modules/is-number/LICENSE create mode 100644 node_modules/is-number/README.md create mode 100644 node_modules/is-number/index.js create mode 100644 node_modules/is-number/package.json create mode 100644 node_modules/is-plain-object/LICENSE create mode 100644 node_modules/is-plain-object/README.md create mode 100644 node_modules/is-plain-object/index.d.ts create mode 100644 node_modules/is-plain-object/index.js create mode 100644 node_modules/is-plain-object/node_modules/isobject/LICENSE create mode 100644 node_modules/is-plain-object/node_modules/isobject/README.md create mode 100644 node_modules/is-plain-object/node_modules/isobject/index.d.ts create mode 100644 node_modules/is-plain-object/node_modules/isobject/index.js create mode 100644 node_modules/is-plain-object/node_modules/isobject/package.json create mode 100644 node_modules/is-plain-object/package.json create mode 100644 node_modules/is-posix-bracket/LICENSE create mode 100644 node_modules/is-posix-bracket/README.md create mode 100644 node_modules/is-posix-bracket/index.js create mode 100644 node_modules/is-posix-bracket/package.json create mode 100644 node_modules/is-primitive/LICENSE create mode 100644 node_modules/is-primitive/README.md create mode 100644 node_modules/is-primitive/index.js create mode 100644 node_modules/is-primitive/package.json create mode 100644 node_modules/is-stream/index.js create mode 100644 node_modules/is-stream/license create mode 100644 node_modules/is-stream/package.json create mode 100644 node_modules/is-stream/readme.md create mode 100644 node_modules/is-windows/LICENSE create mode 100644 node_modules/is-windows/README.md create mode 100644 node_modules/is-windows/index.js create mode 100644 node_modules/is-windows/package.json create mode 100644 node_modules/isarray/.npmignore create mode 100644 node_modules/isarray/.travis.yml create mode 100644 node_modules/isarray/Makefile create mode 100644 node_modules/isarray/README.md create mode 100644 node_modules/isarray/component.json create mode 100644 node_modules/isarray/index.js create mode 100644 node_modules/isarray/package.json create mode 100644 node_modules/isarray/test.js create mode 100644 node_modules/isexe/.npmignore create mode 100644 node_modules/isexe/LICENSE create mode 100644 node_modules/isexe/README.md create mode 100644 node_modules/isexe/index.js create mode 100644 node_modules/isexe/mode.js create mode 100644 node_modules/isexe/package.json create mode 100644 node_modules/isexe/test/basic.js create mode 100644 node_modules/isexe/windows.js create mode 100644 node_modules/isobject/LICENSE create mode 100644 node_modules/isobject/README.md create mode 100644 node_modules/isobject/index.js create mode 100644 node_modules/isobject/package.json create mode 100644 node_modules/json-stable-stringify/.travis.yml create mode 100644 node_modules/json-stable-stringify/LICENSE create mode 100644 node_modules/json-stable-stringify/example/key_cmp.js create mode 100644 node_modules/json-stable-stringify/example/nested.js create mode 100644 node_modules/json-stable-stringify/example/str.js create mode 100644 node_modules/json-stable-stringify/example/value_cmp.js create mode 100644 node_modules/json-stable-stringify/index.js create mode 100644 node_modules/json-stable-stringify/package.json create mode 100644 node_modules/json-stable-stringify/readme.markdown create mode 100644 node_modules/json-stable-stringify/test/cmp.js create mode 100644 node_modules/json-stable-stringify/test/nested.js create mode 100644 node_modules/json-stable-stringify/test/str.js create mode 100644 node_modules/json-stringify-safe/.npmignore create mode 100644 node_modules/json-stringify-safe/CHANGELOG.md create mode 100644 node_modules/json-stringify-safe/LICENSE create mode 100644 node_modules/json-stringify-safe/Makefile create mode 100644 node_modules/json-stringify-safe/README.md create mode 100644 node_modules/json-stringify-safe/package.json create mode 100644 node_modules/json-stringify-safe/stringify.js create mode 100644 node_modules/json-stringify-safe/test/mocha.opts create mode 100644 node_modules/json-stringify-safe/test/stringify_test.js create mode 100644 node_modules/jsonify/README.markdown create mode 100644 node_modules/jsonify/index.js create mode 100644 node_modules/jsonify/lib/parse.js create mode 100644 node_modules/jsonify/lib/stringify.js create mode 100644 node_modules/jsonify/package.json create mode 100644 node_modules/jsonify/test/parse.js create mode 100644 node_modules/jsonify/test/stringify.js create mode 100644 node_modules/jsonparse/.npmignore create mode 100644 node_modules/jsonparse/LICENSE create mode 100644 node_modules/jsonparse/README.markdown create mode 100644 node_modules/jsonparse/bench.js create mode 100644 node_modules/jsonparse/examples/twitterfeed.js create mode 100644 node_modules/jsonparse/jsonparse.js create mode 100644 node_modules/jsonparse/package.json create mode 100644 node_modules/jsonparse/samplejson/basic.json create mode 100644 node_modules/jsonparse/samplejson/basic2.json create mode 100644 node_modules/jsonparse/test/big-token.js create mode 100644 node_modules/jsonparse/test/boundary.js create mode 100644 node_modules/jsonparse/test/offset.js create mode 100644 node_modules/jsonparse/test/primitives.js create mode 100644 node_modules/jsonparse/test/surrogate.js create mode 100644 node_modules/jsonparse/test/unvalid.js create mode 100644 node_modules/jsonparse/test/utf8.js create mode 100644 node_modules/kind-of/LICENSE create mode 100644 node_modules/kind-of/README.md create mode 100644 node_modules/kind-of/index.js create mode 100644 node_modules/kind-of/package.json create mode 100644 node_modules/labeled-stream-splicer/.travis.yml create mode 100644 node_modules/labeled-stream-splicer/LICENSE create mode 100644 node_modules/labeled-stream-splicer/example/browser/bar.js create mode 100644 node_modules/labeled-stream-splicer/example/browser/foo.js create mode 100644 node_modules/labeled-stream-splicer/example/browser/main.js create mode 100644 node_modules/labeled-stream-splicer/example/browser/xyz.js create mode 100644 node_modules/labeled-stream-splicer/example/bundle.js create mode 100644 node_modules/labeled-stream-splicer/index.js create mode 100644 node_modules/labeled-stream-splicer/node_modules/isarray/README.md create mode 100644 node_modules/labeled-stream-splicer/node_modules/isarray/index.js create mode 100644 node_modules/labeled-stream-splicer/node_modules/isarray/package.json create mode 100644 node_modules/labeled-stream-splicer/package.json create mode 100644 node_modules/labeled-stream-splicer/readme.markdown create mode 100644 node_modules/labeled-stream-splicer/test/bundle.js create mode 100644 node_modules/labeled-stream-splicer/test/bundle/bar.js create mode 100644 node_modules/labeled-stream-splicer/test/bundle/foo.js create mode 100644 node_modules/labeled-stream-splicer/test/bundle/main.js create mode 100644 node_modules/labeled-stream-splicer/test/bundle/xyz.js create mode 100644 node_modules/lodash.debounce/LICENSE create mode 100644 node_modules/lodash.debounce/README.md create mode 100644 node_modules/lodash.debounce/index.js create mode 100644 node_modules/lodash.debounce/package.json create mode 100644 node_modules/lodash.memoize/LICENSE.txt create mode 100644 node_modules/lodash.memoize/README.md create mode 100644 node_modules/lodash.memoize/index.js create mode 100644 node_modules/lodash.memoize/package.json create mode 100644 node_modules/map-cache/LICENSE create mode 100644 node_modules/map-cache/README.md create mode 100644 node_modules/map-cache/index.js create mode 100644 node_modules/map-cache/package.json create mode 100644 node_modules/map-limit/LICENSE.md create mode 100644 node_modules/map-limit/README.md create mode 100644 node_modules/map-limit/index.js create mode 100644 node_modules/map-limit/node_modules/once/LICENSE create mode 100644 node_modules/map-limit/node_modules/once/README.md create mode 100644 node_modules/map-limit/node_modules/once/once.js create mode 100644 node_modules/map-limit/node_modules/once/package.json create mode 100644 node_modules/map-limit/package.json create mode 100644 node_modules/map-limit/test.js create mode 100644 node_modules/map-visit/LICENSE create mode 100644 node_modules/map-visit/README.md create mode 100644 node_modules/map-visit/index.js create mode 100644 node_modules/map-visit/package.json create mode 100644 node_modules/math-random/.npmignore create mode 100644 node_modules/math-random/.travis.yml create mode 100644 node_modules/math-random/browser.js create mode 100644 node_modules/math-random/node.js create mode 100644 node_modules/math-random/package.json create mode 100644 node_modules/math-random/readme.md create mode 100644 node_modules/math-random/test.js create mode 100644 node_modules/md5.js/LICENSE create mode 100644 node_modules/md5.js/README.md create mode 100644 node_modules/md5.js/index.js create mode 100644 node_modules/md5.js/package.json create mode 100644 node_modules/md5/.npmignore create mode 100644 node_modules/md5/.travis.yml create mode 100644 node_modules/md5/LICENSE create mode 100644 node_modules/md5/README.md create mode 100644 node_modules/md5/md5.js create mode 100644 node_modules/md5/package.json create mode 100644 node_modules/md5/test.js create mode 100755 node_modules/micromatch/LICENSE create mode 100644 node_modules/micromatch/README.md create mode 100755 node_modules/micromatch/index.js create mode 100644 node_modules/micromatch/lib/chars.js create mode 100644 node_modules/micromatch/lib/expand.js create mode 100644 node_modules/micromatch/lib/glob.js create mode 100644 node_modules/micromatch/lib/utils.js create mode 100644 node_modules/micromatch/package.json create mode 100644 node_modules/miller-rabin/.npmignore create mode 100644 node_modules/miller-rabin/1.js create mode 100644 node_modules/miller-rabin/README.md create mode 100755 node_modules/miller-rabin/bin/miller-rabin create mode 100644 node_modules/miller-rabin/lib/mr.js create mode 100644 node_modules/miller-rabin/package.json create mode 100644 node_modules/miller-rabin/test.js create mode 100644 node_modules/miller-rabin/test/api-test.js create mode 100644 node_modules/mime/LICENSE create mode 100644 node_modules/mime/README.md create mode 100644 node_modules/mime/build/build.js create mode 100644 node_modules/mime/build/test.js create mode 100755 node_modules/mime/cli.js create mode 100644 node_modules/mime/mime.js create mode 100644 node_modules/mime/package.json create mode 100644 node_modules/mime/types.json create mode 100644 node_modules/minimalistic-assert/LICENSE create mode 100644 node_modules/minimalistic-assert/index.js create mode 100644 node_modules/minimalistic-assert/package.json create mode 100644 node_modules/minimalistic-assert/readme.md create mode 100644 node_modules/minimalistic-crypto-utils/.npmignore create mode 100644 node_modules/minimalistic-crypto-utils/.travis.yml create mode 100644 node_modules/minimalistic-crypto-utils/README.md create mode 100644 node_modules/minimalistic-crypto-utils/lib/utils.js create mode 100644 node_modules/minimalistic-crypto-utils/package.json create mode 100644 node_modules/minimalistic-crypto-utils/test/utils-test.js create mode 100644 node_modules/minimatch/LICENSE create mode 100644 node_modules/minimatch/README.md create mode 100644 node_modules/minimatch/minimatch.js create mode 100644 node_modules/minimatch/package.json create mode 100644 node_modules/minimist/.travis.yml create mode 100644 node_modules/minimist/LICENSE create mode 100644 node_modules/minimist/example/parse.js create mode 100644 node_modules/minimist/index.js create mode 100644 node_modules/minimist/package.json create mode 100644 node_modules/minimist/readme.markdown create mode 100644 node_modules/minimist/test/all_bool.js create mode 100644 node_modules/minimist/test/bool.js create mode 100644 node_modules/minimist/test/dash.js create mode 100644 node_modules/minimist/test/default_bool.js create mode 100644 node_modules/minimist/test/dotted.js create mode 100644 node_modules/minimist/test/kv_short.js create mode 100644 node_modules/minimist/test/long.js create mode 100644 node_modules/minimist/test/num.js create mode 100644 node_modules/minimist/test/parse.js create mode 100644 node_modules/minimist/test/parse_modified.js create mode 100644 node_modules/minimist/test/short.js create mode 100644 node_modules/minimist/test/stop_early.js create mode 100644 node_modules/minimist/test/unknown.js create mode 100644 node_modules/minimist/test/whitespace.js create mode 100644 node_modules/mixin-deep/LICENSE create mode 100644 node_modules/mixin-deep/README.md create mode 100644 node_modules/mixin-deep/index.js create mode 100644 node_modules/mixin-deep/node_modules/is-extendable/LICENSE create mode 100644 node_modules/mixin-deep/node_modules/is-extendable/README.md create mode 100644 node_modules/mixin-deep/node_modules/is-extendable/index.d.ts create mode 100644 node_modules/mixin-deep/node_modules/is-extendable/index.js create mode 100644 node_modules/mixin-deep/node_modules/is-extendable/package.json create mode 100644 node_modules/mixin-deep/package.json create mode 100644 node_modules/mkdirp/.travis.yml create mode 100644 node_modules/mkdirp/LICENSE create mode 100755 node_modules/mkdirp/bin/cmd.js create mode 100644 node_modules/mkdirp/bin/usage.txt create mode 100644 node_modules/mkdirp/examples/pow.js create mode 100644 node_modules/mkdirp/index.js create mode 100644 node_modules/mkdirp/node_modules/minimist/.travis.yml create mode 100644 node_modules/mkdirp/node_modules/minimist/LICENSE create mode 100644 node_modules/mkdirp/node_modules/minimist/example/parse.js create mode 100644 node_modules/mkdirp/node_modules/minimist/index.js create mode 100644 node_modules/mkdirp/node_modules/minimist/package.json create mode 100644 node_modules/mkdirp/node_modules/minimist/readme.markdown create mode 100644 node_modules/mkdirp/node_modules/minimist/test/dash.js create mode 100644 node_modules/mkdirp/node_modules/minimist/test/default_bool.js create mode 100644 node_modules/mkdirp/node_modules/minimist/test/dotted.js create mode 100644 node_modules/mkdirp/node_modules/minimist/test/long.js create mode 100644 node_modules/mkdirp/node_modules/minimist/test/parse.js create mode 100644 node_modules/mkdirp/node_modules/minimist/test/parse_modified.js create mode 100644 node_modules/mkdirp/node_modules/minimist/test/short.js create mode 100644 node_modules/mkdirp/node_modules/minimist/test/whitespace.js create mode 100644 node_modules/mkdirp/package.json create mode 100644 node_modules/mkdirp/readme.markdown create mode 100644 node_modules/mkdirp/test/chmod.js create mode 100644 node_modules/mkdirp/test/clobber.js create mode 100644 node_modules/mkdirp/test/mkdirp.js create mode 100644 node_modules/mkdirp/test/opts_fs.js create mode 100644 node_modules/mkdirp/test/opts_fs_sync.js create mode 100644 node_modules/mkdirp/test/perm.js create mode 100644 node_modules/mkdirp/test/perm_sync.js create mode 100644 node_modules/mkdirp/test/race.js create mode 100644 node_modules/mkdirp/test/rel.js create mode 100644 node_modules/mkdirp/test/return.js create mode 100644 node_modules/mkdirp/test/return_sync.js create mode 100644 node_modules/mkdirp/test/root.js create mode 100644 node_modules/mkdirp/test/sync.js create mode 100644 node_modules/mkdirp/test/umask.js create mode 100644 node_modules/mkdirp/test/umask_sync.js create mode 100644 node_modules/module-deps/.travis.yml create mode 100644 node_modules/module-deps/CHANGELOG.md create mode 100644 node_modules/module-deps/LICENSE create mode 100755 node_modules/module-deps/bin/cmd.js create mode 100644 node_modules/module-deps/bin/usage.txt create mode 100644 node_modules/module-deps/example/deps.js create mode 100644 node_modules/module-deps/example/files/bar.js create mode 100644 node_modules/module-deps/example/files/foo.js create mode 100644 node_modules/module-deps/example/files/main.js create mode 100644 node_modules/module-deps/example/files/xyz.js create mode 100644 node_modules/module-deps/index.js create mode 100644 node_modules/module-deps/package.json create mode 100644 node_modules/module-deps/readme.markdown create mode 100644 node_modules/module-deps/test/bundle.js create mode 100644 node_modules/module-deps/test/cache.js create mode 100644 node_modules/module-deps/test/cache_expose.js create mode 100644 node_modules/module-deps/test/cache_partial.js create mode 100644 node_modules/module-deps/test/cache_partial_expose.js create mode 100644 node_modules/module-deps/test/cache_persistent.js create mode 100644 node_modules/module-deps/test/cache_persistent/error_transform.js create mode 100644 node_modules/module-deps/test/cycle.js create mode 100644 node_modules/module-deps/test/cycle/bar.js create mode 100644 node_modules/module-deps/test/cycle/foo.js create mode 100644 node_modules/module-deps/test/cycle/main.js create mode 100644 node_modules/module-deps/test/deps.js create mode 100644 node_modules/module-deps/test/detect.js create mode 100644 node_modules/module-deps/test/dotdot.js create mode 100644 node_modules/module-deps/test/dotdot/abc/index.js create mode 100644 node_modules/module-deps/test/dotdot/index.js create mode 100644 node_modules/module-deps/test/expose.js create mode 100644 node_modules/module-deps/test/expose/bar.js create mode 100644 node_modules/module-deps/test/expose/foo.js create mode 100644 node_modules/module-deps/test/expose/lib/abc.js create mode 100644 node_modules/module-deps/test/expose/lib/xyz.js create mode 100644 node_modules/module-deps/test/expose/main.js create mode 100644 node_modules/module-deps/test/file_cache.js create mode 100644 node_modules/module-deps/test/files/bar.js create mode 100644 node_modules/module-deps/test/files/extra.js create mode 100644 node_modules/module-deps/test/files/filterable.js create mode 100644 node_modules/module-deps/test/files/foo.js create mode 100644 node_modules/module-deps/test/files/main.js create mode 100644 node_modules/module-deps/test/files/pkg_filter/one.js create mode 100644 node_modules/module-deps/test/files/pkg_filter/package.json create mode 100644 node_modules/module-deps/test/files/pkg_filter/test.js create mode 100644 node_modules/module-deps/test/files/pkg_filter/two.js create mode 100644 node_modules/module-deps/test/files/quotes/bar.js create mode 100644 node_modules/module-deps/test/files/quotes/baz.js create mode 100644 node_modules/module-deps/test/files/quotes/foo.js create mode 100644 node_modules/module-deps/test/files/quotes/main.js create mode 100644 node_modules/module-deps/test/files/syntax_error.js create mode 100644 node_modules/module-deps/test/files/tr_2dep_module/f.js create mode 100644 node_modules/module-deps/test/files/tr_2dep_module/main.js create mode 100644 node_modules/module-deps/test/files/tr_global/main.js create mode 100644 node_modules/module-deps/test/files/tr_global/package.json create mode 100644 node_modules/module-deps/test/files/tr_module/f.js create mode 100644 node_modules/module-deps/test/files/tr_module/index.js create mode 100644 node_modules/module-deps/test/files/tr_module/main.js create mode 100644 node_modules/module-deps/test/files/tr_module/package.json create mode 100644 node_modules/module-deps/test/files/tr_module/xxx.js create mode 100644 node_modules/module-deps/test/files/tr_no_entry/main.js create mode 100644 node_modules/module-deps/test/files/tr_rel/package.json create mode 100644 node_modules/module-deps/test/files/tr_rel/subdir/main.js create mode 100644 node_modules/module-deps/test/files/tr_rel/xxx.js create mode 100644 node_modules/module-deps/test/files/tr_sh/f.js create mode 100644 node_modules/module-deps/test/files/tr_sh/main.js create mode 100644 node_modules/module-deps/test/files/tr_sh/tr_a.js create mode 100644 node_modules/module-deps/test/files/tr_sh/tr_b.js create mode 100644 node_modules/module-deps/test/files/tr_whole_package/f.js create mode 100644 node_modules/module-deps/test/files/tr_whole_package/main.js create mode 100644 node_modules/module-deps/test/files/transformdeps.js create mode 100644 node_modules/module-deps/test/files/unicode/bar.js create mode 100644 node_modules/module-deps/test/files/unicode/foo.js create mode 100644 node_modules/module-deps/test/files/unicode/main.js create mode 100644 node_modules/module-deps/test/files/xyz.js create mode 100644 node_modules/module-deps/test/filter.js create mode 100644 node_modules/module-deps/test/ignore_missing.js create mode 100644 node_modules/module-deps/test/ignore_missing/main.js create mode 100644 node_modules/module-deps/test/ignore_missing/other.js create mode 100644 node_modules/module-deps/test/ignore_missing_cache.js create mode 100644 node_modules/module-deps/test/invalid_pkg.js create mode 100644 node_modules/module-deps/test/invalid_pkg/file.js create mode 100644 node_modules/module-deps/test/invalid_pkg/index.js create mode 100644 node_modules/module-deps/test/invalid_pkg/package.json create mode 100644 node_modules/module-deps/test/noparse.js create mode 100644 node_modules/module-deps/test/noparse_row.js create mode 100644 node_modules/module-deps/test/pkg.js create mode 100644 node_modules/module-deps/test/pkg/main.js create mode 100644 node_modules/module-deps/test/pkg/package.json create mode 100644 node_modules/module-deps/test/pkg_filter.js create mode 100644 node_modules/module-deps/test/quotes.js create mode 100644 node_modules/module-deps/test/row_expose.js create mode 100644 node_modules/module-deps/test/row_expose_name_is_file_transform.js create mode 100644 node_modules/module-deps/test/row_expose_transform.js create mode 100644 node_modules/module-deps/test/source.js create mode 100644 node_modules/module-deps/test/syntax.js create mode 100644 node_modules/module-deps/test/tr_2dep_module.js create mode 100644 node_modules/module-deps/test/tr_deps.js create mode 100644 node_modules/module-deps/test/tr_err.js create mode 100644 node_modules/module-deps/test/tr_flags.js create mode 100644 node_modules/module-deps/test/tr_flags/empty.js create mode 100644 node_modules/module-deps/test/tr_fn.js create mode 100644 node_modules/module-deps/test/tr_global.js create mode 100644 node_modules/module-deps/test/tr_module.js create mode 100644 node_modules/module-deps/test/tr_no_entry.js create mode 100644 node_modules/module-deps/test/tr_opts.js create mode 100644 node_modules/module-deps/test/tr_opts/main.js create mode 100644 node_modules/module-deps/test/tr_opts/package.json create mode 100644 node_modules/module-deps/test/tr_rel.js create mode 100644 node_modules/module-deps/test/tr_sh.js create mode 100644 node_modules/module-deps/test/tr_whole_package.js create mode 100644 node_modules/module-deps/test/tr_write.js create mode 100644 node_modules/module-deps/test/tr_write/main.js create mode 100644 node_modules/module-deps/test/undef_file.js create mode 100644 node_modules/module-deps/test/unicode.js create mode 100644 node_modules/ms/index.js create mode 100644 node_modules/ms/license.md create mode 100644 node_modules/ms/package.json create mode 100644 node_modules/ms/readme.md create mode 100644 node_modules/nanomatch/CHANGELOG.md create mode 100644 node_modules/nanomatch/LICENSE create mode 100644 node_modules/nanomatch/README.md create mode 100644 node_modules/nanomatch/index.js create mode 100644 node_modules/nanomatch/lib/cache.js create mode 100644 node_modules/nanomatch/lib/compilers.js create mode 100644 node_modules/nanomatch/lib/parsers.js create mode 100644 node_modules/nanomatch/lib/utils.js create mode 100755 node_modules/nanomatch/node_modules/arr-diff/LICENSE create mode 100644 node_modules/nanomatch/node_modules/arr-diff/README.md create mode 100644 node_modules/nanomatch/node_modules/arr-diff/index.js create mode 100644 node_modules/nanomatch/node_modules/arr-diff/package.json create mode 100755 node_modules/nanomatch/node_modules/array-unique/LICENSE create mode 100755 node_modules/nanomatch/node_modules/array-unique/README.md create mode 100644 node_modules/nanomatch/node_modules/array-unique/index.js create mode 100644 node_modules/nanomatch/node_modules/array-unique/package.json create mode 100644 node_modules/nanomatch/node_modules/kind-of/CHANGELOG.md create mode 100644 node_modules/nanomatch/node_modules/kind-of/LICENSE create mode 100644 node_modules/nanomatch/node_modules/kind-of/README.md create mode 100644 node_modules/nanomatch/node_modules/kind-of/index.js create mode 100644 node_modules/nanomatch/node_modules/kind-of/package.json create mode 100644 node_modules/nanomatch/package.json create mode 100644 node_modules/nice-try/CHANGELOG.md create mode 100644 node_modules/nice-try/LICENSE create mode 100644 node_modules/nice-try/README.md create mode 100644 node_modules/nice-try/package.json create mode 100644 node_modules/nice-try/src/index.js create mode 100644 node_modules/normalize-path/LICENSE create mode 100644 node_modules/normalize-path/README.md create mode 100644 node_modules/normalize-path/index.js create mode 100644 node_modules/normalize-path/package.json create mode 100644 node_modules/npm-run-path/index.js create mode 100644 node_modules/npm-run-path/license create mode 100644 node_modules/npm-run-path/package.json create mode 100644 node_modules/npm-run-path/readme.md create mode 100644 node_modules/number-is-nan/index.js create mode 100644 node_modules/number-is-nan/license create mode 100644 node_modules/number-is-nan/package.json create mode 100644 node_modules/number-is-nan/readme.md create mode 100644 node_modules/object-assign/index.js create mode 100644 node_modules/object-assign/license create mode 100644 node_modules/object-assign/package.json create mode 100644 node_modules/object-assign/readme.md create mode 100644 node_modules/object-copy/LICENSE create mode 100644 node_modules/object-copy/index.js create mode 100644 node_modules/object-copy/node_modules/define-property/LICENSE create mode 100644 node_modules/object-copy/node_modules/define-property/README.md create mode 100644 node_modules/object-copy/node_modules/define-property/index.js create mode 100644 node_modules/object-copy/node_modules/define-property/package.json create mode 100644 node_modules/object-copy/package.json create mode 100644 node_modules/object-visit/LICENSE create mode 100644 node_modules/object-visit/README.md create mode 100644 node_modules/object-visit/index.js create mode 100644 node_modules/object-visit/node_modules/isobject/LICENSE create mode 100644 node_modules/object-visit/node_modules/isobject/README.md create mode 100644 node_modules/object-visit/node_modules/isobject/index.d.ts create mode 100644 node_modules/object-visit/node_modules/isobject/index.js create mode 100644 node_modules/object-visit/node_modules/isobject/package.json create mode 100644 node_modules/object-visit/package.json create mode 100644 node_modules/object.omit/LICENSE create mode 100644 node_modules/object.omit/README.md create mode 100644 node_modules/object.omit/index.js create mode 100644 node_modules/object.omit/package.json create mode 100644 node_modules/object.pick/LICENSE create mode 100644 node_modules/object.pick/README.md create mode 100644 node_modules/object.pick/index.js create mode 100644 node_modules/object.pick/node_modules/isobject/LICENSE create mode 100644 node_modules/object.pick/node_modules/isobject/README.md create mode 100644 node_modules/object.pick/node_modules/isobject/index.d.ts create mode 100644 node_modules/object.pick/node_modules/isobject/index.js create mode 100644 node_modules/object.pick/node_modules/isobject/package.json create mode 100644 node_modules/object.pick/package.json create mode 100644 node_modules/on-finished/HISTORY.md create mode 100644 node_modules/on-finished/LICENSE create mode 100644 node_modules/on-finished/README.md create mode 100644 node_modules/on-finished/index.js create mode 100644 node_modules/on-finished/package.json create mode 100644 node_modules/on-headers/HISTORY.md create mode 100644 node_modules/on-headers/LICENSE create mode 100644 node_modules/on-headers/README.md create mode 100644 node_modules/on-headers/index.js create mode 100644 node_modules/on-headers/package.json create mode 100644 node_modules/once/LICENSE create mode 100644 node_modules/once/README.md create mode 100644 node_modules/once/once.js create mode 100644 node_modules/once/package.json create mode 100644 node_modules/opn/index.js create mode 100644 node_modules/opn/license create mode 100644 node_modules/opn/package.json create mode 100644 node_modules/opn/readme.md create mode 100755 node_modules/opn/xdg-open create mode 100644 node_modules/options/.npmignore create mode 100644 node_modules/options/Makefile create mode 100644 node_modules/options/README.md create mode 100644 node_modules/options/lib/options.js create mode 100644 node_modules/options/package.json create mode 100644 node_modules/os-browserify/.npmignore create mode 100644 node_modules/os-browserify/LICENSE create mode 100644 node_modules/os-browserify/README.md create mode 100644 node_modules/os-browserify/browser.js create mode 100644 node_modules/os-browserify/main.js create mode 100644 node_modules/os-browserify/package.json create mode 100644 node_modules/os-tmpdir/index.js create mode 100644 node_modules/os-tmpdir/license create mode 100644 node_modules/os-tmpdir/package.json create mode 100644 node_modules/os-tmpdir/readme.md create mode 100644 node_modules/outpipe/.npmignore create mode 100644 node_modules/outpipe/LICENSE create mode 100755 node_modules/outpipe/bin/echo.js create mode 100644 node_modules/outpipe/example/input/x.js create mode 100644 node_modules/outpipe/example/input/y.js create mode 100644 node_modules/outpipe/example/input/z.js create mode 100644 node_modules/outpipe/example/watch.js create mode 100644 node_modules/outpipe/index.js create mode 100644 node_modules/outpipe/package.json create mode 100644 node_modules/outpipe/readme.markdown create mode 100644 node_modules/outpipe/test/cmd.js create mode 100644 node_modules/outpipe/test/outfile.js create mode 100644 node_modules/p-finally/index.js create mode 100644 node_modules/p-finally/license create mode 100644 node_modules/p-finally/package.json create mode 100644 node_modules/p-finally/readme.md create mode 100644 node_modules/pad-left/LICENSE create mode 100644 node_modules/pad-left/README.md create mode 100755 node_modules/pad-left/index.js create mode 100644 node_modules/pad-left/package.json create mode 100644 node_modules/pad-right/LICENSE create mode 100644 node_modules/pad-right/README.md create mode 100644 node_modules/pad-right/index.js create mode 100644 node_modules/pad-right/package.json create mode 100644 node_modules/pako/CHANGELOG.md create mode 100644 node_modules/pako/LICENSE create mode 100644 node_modules/pako/README.md create mode 100644 node_modules/pako/dist/pako.js create mode 100644 node_modules/pako/dist/pako.min.js create mode 100644 node_modules/pako/dist/pako_deflate.js create mode 100644 node_modules/pako/dist/pako_deflate.min.js create mode 100644 node_modules/pako/dist/pako_inflate.js create mode 100644 node_modules/pako/dist/pako_inflate.min.js create mode 100644 node_modules/pako/index.js create mode 100644 node_modules/pako/lib/deflate.js create mode 100644 node_modules/pako/lib/inflate.js create mode 100644 node_modules/pako/lib/utils/common.js create mode 100644 node_modules/pako/lib/utils/strings.js create mode 100644 node_modules/pako/lib/zlib/README create mode 100644 node_modules/pako/lib/zlib/adler32.js create mode 100644 node_modules/pako/lib/zlib/constants.js create mode 100644 node_modules/pako/lib/zlib/crc32.js create mode 100644 node_modules/pako/lib/zlib/deflate.js create mode 100644 node_modules/pako/lib/zlib/gzheader.js create mode 100644 node_modules/pako/lib/zlib/inffast.js create mode 100644 node_modules/pako/lib/zlib/inflate.js create mode 100644 node_modules/pako/lib/zlib/inftrees.js create mode 100644 node_modules/pako/lib/zlib/messages.js create mode 100644 node_modules/pako/lib/zlib/trees.js create mode 100644 node_modules/pako/lib/zlib/zstream.js create mode 100644 node_modules/pako/package.json create mode 100644 node_modules/parents/.travis.yml create mode 100644 node_modules/parents/LICENSE create mode 100644 node_modules/parents/example/dirname.js create mode 100644 node_modules/parents/example/win32.js create mode 100644 node_modules/parents/index.js create mode 100644 node_modules/parents/package.json create mode 100644 node_modules/parents/readme.markdown create mode 100644 node_modules/parents/test/dirname.js create mode 100644 node_modules/parents/test/win32.js create mode 100644 node_modules/parse-asn1/.travis.yml create mode 100644 node_modules/parse-asn1/LICENSE create mode 100644 node_modules/parse-asn1/README.md create mode 100644 node_modules/parse-asn1/aesid.json create mode 100644 node_modules/parse-asn1/asn1.js create mode 100644 node_modules/parse-asn1/certificate.js create mode 100644 node_modules/parse-asn1/fixProc.js create mode 100644 node_modules/parse-asn1/index.js create mode 100644 node_modules/parse-asn1/package-lock.json.1909017369 create mode 100644 node_modules/parse-asn1/package.json create mode 100644 node_modules/parse-asn1/test/1024.priv create mode 100644 node_modules/parse-asn1/test/1024.pub create mode 100644 node_modules/parse-asn1/test/dsa.1024.priv create mode 100644 node_modules/parse-asn1/test/dsa.1024.pub create mode 100644 node_modules/parse-asn1/test/dsa.2048.priv create mode 100644 node_modules/parse-asn1/test/dsa.2048.pub create mode 100644 node_modules/parse-asn1/test/ec.pass.priv create mode 100644 node_modules/parse-asn1/test/ec.priv create mode 100644 node_modules/parse-asn1/test/ec.pub create mode 100644 node_modules/parse-asn1/test/index.js create mode 100644 node_modules/parse-asn1/test/node.cert create mode 100644 node_modules/parse-asn1/test/pass.1024.priv create mode 100644 node_modules/parse-asn1/test/pass.1024.pub create mode 100644 node_modules/parse-asn1/test/pass.dsa.1024.priv create mode 100644 node_modules/parse-asn1/test/pass.dsa.1024.pub create mode 100644 node_modules/parse-asn1/test/pass.rsa.1024.priv create mode 100644 node_modules/parse-asn1/test/pass.rsa.1024.pub create mode 100644 node_modules/parse-asn1/test/pass.rsa.2028.priv create mode 100644 node_modules/parse-asn1/test/pass.rsa.2028.pub create mode 100644 node_modules/parse-asn1/test/pass2.dsa.1024.priv create mode 100644 node_modules/parse-asn1/test/pass2.dsa.1024.pub create mode 100644 node_modules/parse-asn1/test/rsa.1024.priv create mode 100644 node_modules/parse-asn1/test/rsa.1024.pub create mode 100644 node_modules/parse-asn1/test/rsa.2028.priv create mode 100644 node_modules/parse-asn1/test/rsa.2028.pub create mode 100644 node_modules/parse-asn1/test/vector.js create mode 100644 node_modules/parse-asn1/test/vector.priv create mode 100644 node_modules/parse-asn1/test/vector2.priv create mode 100644 node_modules/parse-glob/LICENSE create mode 100644 node_modules/parse-glob/README.md create mode 100644 node_modules/parse-glob/index.js create mode 100644 node_modules/parse-glob/package.json create mode 100644 node_modules/parse-ms/index.js create mode 100644 node_modules/parse-ms/license create mode 100644 node_modules/parse-ms/package.json create mode 100644 node_modules/parse-ms/readme.md create mode 100644 node_modules/parseurl/HISTORY.md create mode 100644 node_modules/parseurl/LICENSE create mode 100644 node_modules/parseurl/README.md create mode 100644 node_modules/parseurl/index.js create mode 100644 node_modules/parseurl/package.json create mode 100644 node_modules/pascalcase/LICENSE create mode 100644 node_modules/pascalcase/README.md create mode 100644 node_modules/pascalcase/index.js create mode 100644 node_modules/pascalcase/package.json create mode 100644 node_modules/path-browserify/LICENSE create mode 100644 node_modules/path-browserify/index.js create mode 100644 node_modules/path-browserify/package.json create mode 100644 node_modules/path-browserify/readme.markdown create mode 100644 node_modules/path-browserify/test/test-path.js create mode 100644 node_modules/path-is-absolute/index.js create mode 100644 node_modules/path-is-absolute/license create mode 100644 node_modules/path-is-absolute/package.json create mode 100644 node_modules/path-is-absolute/readme.md create mode 100644 node_modules/path-key/index.js create mode 100644 node_modules/path-key/license create mode 100644 node_modules/path-key/package.json create mode 100644 node_modules/path-key/readme.md create mode 100644 node_modules/path-parse/.travis.yml create mode 100644 node_modules/path-parse/LICENSE create mode 100644 node_modules/path-parse/README.md create mode 100644 node_modules/path-parse/index.js create mode 100644 node_modules/path-parse/package.json create mode 100644 node_modules/path-parse/test.js create mode 100644 node_modules/path-platform/LICENSE create mode 100644 node_modules/path-platform/README.md create mode 100644 node_modules/path-platform/package.json create mode 100644 node_modules/path-platform/path.js create mode 100644 node_modules/pbkdf2/LICENSE create mode 100644 node_modules/pbkdf2/README.md create mode 100644 node_modules/pbkdf2/browser.js create mode 100644 node_modules/pbkdf2/index.js create mode 100644 node_modules/pbkdf2/lib/async.js create mode 100644 node_modules/pbkdf2/lib/default-encoding.js create mode 100644 node_modules/pbkdf2/lib/precondition.js create mode 100644 node_modules/pbkdf2/lib/sync-browser.js create mode 100644 node_modules/pbkdf2/lib/sync.js create mode 100644 node_modules/pbkdf2/package.json create mode 100644 node_modules/pelo/README.md create mode 100644 node_modules/pelo/app.js create mode 100644 node_modules/pelo/bundle.js create mode 100644 node_modules/pelo/client.js create mode 100644 node_modules/pelo/index.js create mode 100644 node_modules/pelo/package.json create mode 100644 node_modules/pelo/server.js create mode 100644 node_modules/pelo/yarn.lock create mode 100644 node_modules/pem/.eslintignore create mode 100644 node_modules/pem/.eslintrc.js create mode 100644 node_modules/pem/.travis.yml create mode 100644 node_modules/pem/CHANGELOG.md create mode 100644 node_modules/pem/CODE_OF_CONDUCT.md create mode 100644 node_modules/pem/CONTRIBUTING.md create mode 100644 node_modules/pem/HISTORY.md create mode 100644 node_modules/pem/LICENSE create mode 100644 node_modules/pem/README.md create mode 100755 node_modules/pem/bin/test_build_openssl.sh create mode 100644 node_modules/pem/jsdoc.json create mode 100644 node_modules/pem/lib/convert.js create mode 100644 node_modules/pem/lib/helper.js create mode 100644 node_modules/pem/lib/openssl.js create mode 100644 node_modules/pem/lib/pem.js create mode 100644 node_modules/pem/mocha.opts create mode 100644 node_modules/pem/package.json create mode 100644 node_modules/pem/test/convert.spec.js create mode 100644 node_modules/pem/test/fixtures/GeoTrust_Primary_CA.pem create mode 100644 node_modules/pem/test/fixtures/cn_openssl.crt create mode 100644 node_modules/pem/test/fixtures/cn_openssl.csr create mode 100644 node_modules/pem/test/fixtures/cn_openssl.key create mode 100644 node_modules/pem/test/fixtures/cn_openssl_config.conf create mode 100644 node_modules/pem/test/fixtures/google.com.pem create mode 100644 node_modules/pem/test/fixtures/idsrv3test.pfx create mode 100644 node_modules/pem/test/fixtures/inclpkey.pem create mode 100644 node_modules/pem/test/fixtures/nopkey.der create mode 100644 node_modules/pem/test/fixtures/nopkey.pem create mode 100644 node_modules/pem/test/fixtures/pem196.pem create mode 100644 node_modules/pem/test/fixtures/ru_openssl.crt create mode 100644 node_modules/pem/test/fixtures/ru_openssl.csr create mode 100644 node_modules/pem/test/fixtures/ru_openssl.key create mode 100644 node_modules/pem/test/fixtures/ru_openssl_config.conf create mode 100644 node_modules/pem/test/fixtures/test.cnf create mode 100644 node_modules/pem/test/fixtures/test.crt create mode 100644 node_modules/pem/test/fixtures/test.csr create mode 100644 node_modules/pem/test/fixtures/test.dh create mode 100644 node_modules/pem/test/fixtures/test.key create mode 100644 node_modules/pem/test/fixtures/test.p7b create mode 100644 node_modules/pem/test/fixtures/testnopw.key create mode 100644 node_modules/pem/test/helper.spec.js create mode 100644 node_modules/pem/test/openssl.spec.js create mode 100644 node_modules/pem/test/pem.helper.js create mode 100644 node_modules/pem/test/pem.spec.js create mode 100644 node_modules/plur/index.js create mode 100644 node_modules/plur/license create mode 100644 node_modules/plur/package.json create mode 100644 node_modules/plur/readme.md create mode 100644 node_modules/posix-character-classes/LICENSE create mode 100644 node_modules/posix-character-classes/README.md create mode 100644 node_modules/posix-character-classes/index.js create mode 100644 node_modules/posix-character-classes/package.json create mode 100644 node_modules/preserve/.gitattributes create mode 100644 node_modules/preserve/.jshintrc create mode 100644 node_modules/preserve/.npmignore create mode 100644 node_modules/preserve/.travis.yml create mode 100644 node_modules/preserve/.verb.md create mode 100644 node_modules/preserve/LICENSE create mode 100644 node_modules/preserve/README.md create mode 100644 node_modules/preserve/index.js create mode 100644 node_modules/preserve/package.json create mode 100644 node_modules/preserve/test.js create mode 100644 node_modules/prettier-bytes/.npmignore create mode 100644 node_modules/prettier-bytes/.travis.yml create mode 100644 node_modules/prettier-bytes/CHANGELOG.md create mode 100644 node_modules/prettier-bytes/CONTRIBUTING.md create mode 100644 node_modules/prettier-bytes/LICENSE create mode 100644 node_modules/prettier-bytes/README.md create mode 100644 node_modules/prettier-bytes/index.js create mode 100644 node_modules/prettier-bytes/package.json create mode 100644 node_modules/prettier-bytes/test/index.js create mode 100644 node_modules/pretty-ms/index.js create mode 100644 node_modules/pretty-ms/license create mode 100644 node_modules/pretty-ms/package.json create mode 100644 node_modules/pretty-ms/readme.md create mode 100644 node_modules/process-nextick-args/index.js create mode 100644 node_modules/process-nextick-args/license.md create mode 100644 node_modules/process-nextick-args/package.json create mode 100644 node_modules/process-nextick-args/readme.md create mode 100644 node_modules/process/.eslintrc create mode 100644 node_modules/process/LICENSE create mode 100644 node_modules/process/README.md create mode 100644 node_modules/process/browser.js create mode 100644 node_modules/process/index.js create mode 100644 node_modules/process/package.json create mode 100644 node_modules/process/test.js create mode 100644 node_modules/public-encrypt/.travis.yml create mode 100644 node_modules/public-encrypt/LICENSE create mode 100644 node_modules/public-encrypt/browser.js create mode 100644 node_modules/public-encrypt/index.js create mode 100644 node_modules/public-encrypt/mgf.js create mode 100644 node_modules/public-encrypt/package.json create mode 100644 node_modules/public-encrypt/privateDecrypt.js create mode 100644 node_modules/public-encrypt/publicEncrypt.js create mode 100644 node_modules/public-encrypt/readme.md create mode 100644 node_modules/public-encrypt/test/1024.priv create mode 100644 node_modules/public-encrypt/test/1024.pub create mode 100644 node_modules/public-encrypt/test/ec.pass.priv create mode 100644 node_modules/public-encrypt/test/ec.priv create mode 100644 node_modules/public-encrypt/test/ec.pub create mode 100644 node_modules/public-encrypt/test/index.js create mode 100644 node_modules/public-encrypt/test/nodeTests.js create mode 100644 node_modules/public-encrypt/test/pass.1024.priv create mode 100644 node_modules/public-encrypt/test/pass.1024.pub create mode 100644 node_modules/public-encrypt/test/rsa.1024.priv create mode 100644 node_modules/public-encrypt/test/rsa.1024.pub create mode 100644 node_modules/public-encrypt/test/rsa.2028.priv create mode 100644 node_modules/public-encrypt/test/rsa.2028.pub create mode 100644 node_modules/public-encrypt/test/rsa.pass.priv create mode 100644 node_modules/public-encrypt/test/rsa.pass.pub create mode 100644 node_modules/public-encrypt/test/test_cert.pem create mode 100644 node_modules/public-encrypt/test/test_key.pem create mode 100644 node_modules/public-encrypt/test/test_rsa_privkey.pem create mode 100644 node_modules/public-encrypt/test/test_rsa_privkey_encrypted.pem create mode 100644 node_modules/public-encrypt/test/test_rsa_pubkey.pem create mode 100644 node_modules/public-encrypt/withPublic.js create mode 100644 node_modules/public-encrypt/xor.js create mode 100644 node_modules/punycode/LICENSE-MIT.txt create mode 100644 node_modules/punycode/README.md create mode 100644 node_modules/punycode/package.json create mode 100644 node_modules/punycode/punycode.js create mode 100644 node_modules/query-string/index.js create mode 100644 node_modules/query-string/license create mode 100644 node_modules/query-string/package.json create mode 100644 node_modules/query-string/readme.md create mode 100644 node_modules/querystring-es3/.travis.yml create mode 100644 node_modules/querystring-es3/History.md create mode 100644 node_modules/querystring-es3/License.md create mode 100644 node_modules/querystring-es3/Readme.md create mode 100644 node_modules/querystring-es3/decode.js create mode 100644 node_modules/querystring-es3/encode.js create mode 100644 node_modules/querystring-es3/index.js create mode 100644 node_modules/querystring-es3/package.json create mode 100644 node_modules/querystring-es3/test/common-index.js create mode 100644 node_modules/querystring-es3/test/index.js create mode 100644 node_modules/querystring-es3/test/tap-index.js create mode 100644 node_modules/querystring/.History.md.un~ create mode 100644 node_modules/querystring/.Readme.md.un~ create mode 100644 node_modules/querystring/.package.json.un~ create mode 100644 node_modules/querystring/.travis.yml create mode 100644 node_modules/querystring/History.md create mode 100644 node_modules/querystring/License.md create mode 100644 node_modules/querystring/Readme.md create mode 100644 node_modules/querystring/decode.js create mode 100644 node_modules/querystring/encode.js create mode 100644 node_modules/querystring/index.js create mode 100644 node_modules/querystring/package.json create mode 100644 node_modules/querystring/test/.index.js.un~ create mode 100644 node_modules/querystring/test/common-index.js create mode 100644 node_modules/querystring/test/index.js create mode 100644 node_modules/querystring/test/tap-index.js create mode 100644 node_modules/randomatic/LICENSE create mode 100644 node_modules/randomatic/README.md create mode 100644 node_modules/randomatic/index.js create mode 100644 node_modules/randomatic/node_modules/is-number/LICENSE create mode 100644 node_modules/randomatic/node_modules/is-number/README.md create mode 100644 node_modules/randomatic/node_modules/is-number/index.js create mode 100644 node_modules/randomatic/node_modules/is-number/package.json create mode 100644 node_modules/randomatic/node_modules/kind-of/CHANGELOG.md create mode 100644 node_modules/randomatic/node_modules/kind-of/LICENSE create mode 100644 node_modules/randomatic/node_modules/kind-of/README.md create mode 100644 node_modules/randomatic/node_modules/kind-of/index.js create mode 100644 node_modules/randomatic/node_modules/kind-of/package.json create mode 100644 node_modules/randomatic/package.json create mode 100644 node_modules/randombytes/.travis.yml create mode 100644 node_modules/randombytes/.zuul.yml create mode 100644 node_modules/randombytes/LICENSE create mode 100644 node_modules/randombytes/README.md create mode 100644 node_modules/randombytes/browser.js create mode 100644 node_modules/randombytes/index.js create mode 100644 node_modules/randombytes/package.json create mode 100644 node_modules/randombytes/test.js create mode 100644 node_modules/randomfill/.travis.yml create mode 100644 node_modules/randomfill/.zuul.yml create mode 100644 node_modules/randomfill/LICENSE create mode 100644 node_modules/randomfill/README.md create mode 100644 node_modules/randomfill/browser.js create mode 100644 node_modules/randomfill/index.js create mode 100644 node_modules/randomfill/package.json create mode 100644 node_modules/randomfill/test.js create mode 100644 node_modules/range-parser/HISTORY.md create mode 100644 node_modules/range-parser/LICENSE create mode 100644 node_modules/range-parser/README.md create mode 100644 node_modules/range-parser/index.js create mode 100644 node_modules/range-parser/package.json create mode 100644 node_modules/read-only-stream/.travis.yml create mode 100644 node_modules/read-only-stream/LICENSE create mode 100644 node_modules/read-only-stream/example/main.js create mode 100644 node_modules/read-only-stream/example/wrap.js create mode 100644 node_modules/read-only-stream/index.js create mode 100644 node_modules/read-only-stream/package.json create mode 100644 node_modules/read-only-stream/readme.markdown create mode 100644 node_modules/read-only-stream/test/error.js create mode 100644 node_modules/read-only-stream/test/ro.js create mode 100644 node_modules/read-only-stream/test/streams1.js create mode 100644 node_modules/readable-stream/.travis.yml create mode 100644 node_modules/readable-stream/CONTRIBUTING.md create mode 100644 node_modules/readable-stream/GOVERNANCE.md create mode 100644 node_modules/readable-stream/LICENSE create mode 100644 node_modules/readable-stream/README.md create mode 100644 node_modules/readable-stream/doc/wg-meetings/2015-01-30.md create mode 100644 node_modules/readable-stream/duplex-browser.js create mode 100644 node_modules/readable-stream/duplex.js create mode 100644 node_modules/readable-stream/lib/_stream_duplex.js create mode 100644 node_modules/readable-stream/lib/_stream_passthrough.js create mode 100644 node_modules/readable-stream/lib/_stream_readable.js create mode 100644 node_modules/readable-stream/lib/_stream_transform.js create mode 100644 node_modules/readable-stream/lib/_stream_writable.js create mode 100644 node_modules/readable-stream/lib/internal/streams/BufferList.js create mode 100644 node_modules/readable-stream/lib/internal/streams/destroy.js create mode 100644 node_modules/readable-stream/lib/internal/streams/stream-browser.js create mode 100644 node_modules/readable-stream/lib/internal/streams/stream.js create mode 100644 node_modules/readable-stream/package.json create mode 100644 node_modules/readable-stream/passthrough.js create mode 100644 node_modules/readable-stream/readable-browser.js create mode 100644 node_modules/readable-stream/readable.js create mode 100644 node_modules/readable-stream/transform.js create mode 100644 node_modules/readable-stream/writable-browser.js create mode 100644 node_modules/readable-stream/writable.js create mode 100644 node_modules/readdirp/LICENSE create mode 100644 node_modules/readdirp/README.md create mode 100755 node_modules/readdirp/node_modules/arr-diff/LICENSE create mode 100644 node_modules/readdirp/node_modules/arr-diff/README.md create mode 100644 node_modules/readdirp/node_modules/arr-diff/index.js create mode 100644 node_modules/readdirp/node_modules/arr-diff/package.json create mode 100755 node_modules/readdirp/node_modules/array-unique/LICENSE create mode 100755 node_modules/readdirp/node_modules/array-unique/README.md create mode 100644 node_modules/readdirp/node_modules/array-unique/index.js create mode 100644 node_modules/readdirp/node_modules/array-unique/package.json create mode 100644 node_modules/readdirp/node_modules/braces/LICENSE create mode 100644 node_modules/readdirp/node_modules/braces/README.md create mode 100644 node_modules/readdirp/node_modules/braces/index.js create mode 100644 node_modules/readdirp/node_modules/braces/lib/braces.js create mode 100644 node_modules/readdirp/node_modules/braces/lib/compilers.js create mode 100644 node_modules/readdirp/node_modules/braces/lib/parsers.js create mode 100644 node_modules/readdirp/node_modules/braces/lib/utils.js create mode 100644 node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/LICENSE create mode 100644 node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/README.md create mode 100644 node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/index.js create mode 100644 node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/package.json create mode 100644 node_modules/readdirp/node_modules/braces/package.json create mode 100644 node_modules/readdirp/node_modules/expand-brackets/LICENSE create mode 100644 node_modules/readdirp/node_modules/expand-brackets/README.md create mode 100644 node_modules/readdirp/node_modules/expand-brackets/changelog.md create mode 100644 node_modules/readdirp/node_modules/expand-brackets/index.js create mode 100644 node_modules/readdirp/node_modules/expand-brackets/lib/compilers.js create mode 100644 node_modules/readdirp/node_modules/expand-brackets/lib/parsers.js create mode 100644 node_modules/readdirp/node_modules/expand-brackets/lib/utils.js create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/LICENSE create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/README.md create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/index.js create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/package.json create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/LICENSE create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/README.md create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/index.js create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/package.json create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/LICENSE create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/README.md create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/index.js create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/LICENSE create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/README.md create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/index.js create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/package.json create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/package.json create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/LICENSE create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/README.md create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/index.js create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/LICENSE create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/README.md create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/index.js create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/package.json create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/package.json create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/LICENSE create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/README.md create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/index.js create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/package.json create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/LICENSE create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/README.md create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/index.js create mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/package.json create mode 100644 node_modules/readdirp/node_modules/expand-brackets/package.json create mode 100644 node_modules/readdirp/node_modules/extglob/LICENSE create mode 100644 node_modules/readdirp/node_modules/extglob/README.md create mode 100644 node_modules/readdirp/node_modules/extglob/changelog.md create mode 100644 node_modules/readdirp/node_modules/extglob/index.js create mode 100644 node_modules/readdirp/node_modules/extglob/lib/.DS_Store create mode 100644 node_modules/readdirp/node_modules/extglob/lib/compilers.js create mode 100644 node_modules/readdirp/node_modules/extglob/lib/extglob.js create mode 100644 node_modules/readdirp/node_modules/extglob/lib/parsers.js create mode 100644 node_modules/readdirp/node_modules/extglob/lib/utils.js create mode 100644 node_modules/readdirp/node_modules/extglob/node_modules/define-property/LICENSE create mode 100644 node_modules/readdirp/node_modules/extglob/node_modules/define-property/README.md create mode 100644 node_modules/readdirp/node_modules/extglob/node_modules/define-property/index.js create mode 100644 node_modules/readdirp/node_modules/extglob/node_modules/define-property/package.json create mode 100644 node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/LICENSE create mode 100644 node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/README.md create mode 100644 node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/index.js create mode 100644 node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/package.json create mode 100644 node_modules/readdirp/node_modules/extglob/package.json create mode 100644 node_modules/readdirp/node_modules/fill-range/LICENSE create mode 100644 node_modules/readdirp/node_modules/fill-range/README.md create mode 100644 node_modules/readdirp/node_modules/fill-range/index.js create mode 100644 node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/LICENSE create mode 100644 node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/README.md create mode 100644 node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/index.js create mode 100644 node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/package.json create mode 100644 node_modules/readdirp/node_modules/fill-range/package.json create mode 100644 node_modules/readdirp/node_modules/is-accessor-descriptor/LICENSE create mode 100644 node_modules/readdirp/node_modules/is-accessor-descriptor/README.md create mode 100644 node_modules/readdirp/node_modules/is-accessor-descriptor/index.js create mode 100644 node_modules/readdirp/node_modules/is-accessor-descriptor/package.json create mode 100644 node_modules/readdirp/node_modules/is-data-descriptor/LICENSE create mode 100644 node_modules/readdirp/node_modules/is-data-descriptor/README.md create mode 100644 node_modules/readdirp/node_modules/is-data-descriptor/index.js create mode 100644 node_modules/readdirp/node_modules/is-data-descriptor/package.json create mode 100644 node_modules/readdirp/node_modules/is-descriptor/LICENSE create mode 100644 node_modules/readdirp/node_modules/is-descriptor/README.md create mode 100644 node_modules/readdirp/node_modules/is-descriptor/index.js create mode 100644 node_modules/readdirp/node_modules/is-descriptor/package.json create mode 100644 node_modules/readdirp/node_modules/is-number/LICENSE create mode 100644 node_modules/readdirp/node_modules/is-number/README.md create mode 100644 node_modules/readdirp/node_modules/is-number/index.js create mode 100644 node_modules/readdirp/node_modules/is-number/node_modules/kind-of/LICENSE create mode 100644 node_modules/readdirp/node_modules/is-number/node_modules/kind-of/README.md create mode 100644 node_modules/readdirp/node_modules/is-number/node_modules/kind-of/index.js create mode 100644 node_modules/readdirp/node_modules/is-number/node_modules/kind-of/package.json create mode 100644 node_modules/readdirp/node_modules/is-number/package.json create mode 100644 node_modules/readdirp/node_modules/isobject/LICENSE create mode 100644 node_modules/readdirp/node_modules/isobject/README.md create mode 100644 node_modules/readdirp/node_modules/isobject/index.d.ts create mode 100644 node_modules/readdirp/node_modules/isobject/index.js create mode 100644 node_modules/readdirp/node_modules/isobject/package.json create mode 100644 node_modules/readdirp/node_modules/kind-of/CHANGELOG.md create mode 100644 node_modules/readdirp/node_modules/kind-of/LICENSE create mode 100644 node_modules/readdirp/node_modules/kind-of/README.md create mode 100644 node_modules/readdirp/node_modules/kind-of/index.js create mode 100644 node_modules/readdirp/node_modules/kind-of/package.json create mode 100644 node_modules/readdirp/node_modules/micromatch/CHANGELOG.md create mode 100755 node_modules/readdirp/node_modules/micromatch/LICENSE create mode 100644 node_modules/readdirp/node_modules/micromatch/README.md create mode 100644 node_modules/readdirp/node_modules/micromatch/index.js create mode 100644 node_modules/readdirp/node_modules/micromatch/lib/.DS_Store create mode 100644 node_modules/readdirp/node_modules/micromatch/lib/cache.js create mode 100644 node_modules/readdirp/node_modules/micromatch/lib/compilers.js create mode 100644 node_modules/readdirp/node_modules/micromatch/lib/parsers.js create mode 100644 node_modules/readdirp/node_modules/micromatch/lib/utils.js create mode 100644 node_modules/readdirp/node_modules/micromatch/package.json create mode 100644 node_modules/readdirp/package.json create mode 100644 node_modules/readdirp/readdirp.js create mode 100644 node_modules/readdirp/stream-api.js create mode 100644 node_modules/regenerator-runtime/README.md create mode 100644 node_modules/regenerator-runtime/package.json create mode 100644 node_modules/regenerator-runtime/path.js create mode 100644 node_modules/regenerator-runtime/runtime-module.js create mode 100644 node_modules/regenerator-runtime/runtime.js create mode 100644 node_modules/regex-cache/LICENSE create mode 100644 node_modules/regex-cache/README.md create mode 100644 node_modules/regex-cache/index.js create mode 100644 node_modules/regex-cache/package.json create mode 100644 node_modules/regex-not/LICENSE create mode 100644 node_modules/regex-not/README.md create mode 100644 node_modules/regex-not/index.js create mode 100644 node_modules/regex-not/package.json create mode 100644 node_modules/reload-css/LICENSE.md create mode 100644 node_modules/reload-css/README.md create mode 100644 node_modules/reload-css/index.js create mode 100644 node_modules/reload-css/lib/url.js create mode 100644 node_modules/reload-css/package.json create mode 100644 node_modules/remove-trailing-separator/history.md create mode 100644 node_modules/remove-trailing-separator/index.js create mode 100644 node_modules/remove-trailing-separator/license create mode 100644 node_modules/remove-trailing-separator/package.json create mode 100644 node_modules/remove-trailing-separator/readme.md create mode 100644 node_modules/repeat-element/LICENSE create mode 100644 node_modules/repeat-element/README.md create mode 100644 node_modules/repeat-element/index.js create mode 100644 node_modules/repeat-element/package.json create mode 100644 node_modules/repeat-string/LICENSE create mode 100644 node_modules/repeat-string/README.md create mode 100644 node_modules/repeat-string/index.js create mode 100644 node_modules/repeat-string/package.json create mode 100644 node_modules/resolve-url/.jshintrc create mode 100644 node_modules/resolve-url/LICENSE create mode 100644 node_modules/resolve-url/bower.json create mode 100644 node_modules/resolve-url/changelog.md create mode 100644 node_modules/resolve-url/component.json create mode 100644 node_modules/resolve-url/package.json create mode 100644 node_modules/resolve-url/readme.md create mode 100644 node_modules/resolve-url/resolve-url.js create mode 100644 node_modules/resolve-url/test/resolve-url.js create mode 100644 node_modules/resolve/.editorconfig create mode 100644 node_modules/resolve/.eslintignore create mode 100644 node_modules/resolve/.eslintrc create mode 100644 node_modules/resolve/.travis.yml create mode 100644 node_modules/resolve/LICENSE create mode 100644 node_modules/resolve/appveyor.yml create mode 100644 node_modules/resolve/example/async.js create mode 100644 node_modules/resolve/example/sync.js create mode 100644 node_modules/resolve/index.js create mode 100644 node_modules/resolve/lib/async.js create mode 100644 node_modules/resolve/lib/caller.js create mode 100644 node_modules/resolve/lib/core.js create mode 100644 node_modules/resolve/lib/core.json create mode 100644 node_modules/resolve/lib/node-modules-paths.js create mode 100644 node_modules/resolve/lib/sync.js create mode 100644 node_modules/resolve/package.json create mode 100644 node_modules/resolve/readme.markdown create mode 100644 node_modules/resolve/test/.eslintrc create mode 100644 node_modules/resolve/test/core.js create mode 100644 node_modules/resolve/test/dotdot.js create mode 100644 node_modules/resolve/test/dotdot/abc/index.js create mode 100644 node_modules/resolve/test/dotdot/index.js create mode 100644 node_modules/resolve/test/faulty_basedir.js create mode 100644 node_modules/resolve/test/filter.js create mode 100644 node_modules/resolve/test/filter_sync.js create mode 100644 node_modules/resolve/test/mock.js create mode 100644 node_modules/resolve/test/mock_sync.js create mode 100644 node_modules/resolve/test/module_dir.js create mode 100644 node_modules/resolve/test/module_dir/xmodules/aaa/index.js create mode 100644 node_modules/resolve/test/module_dir/ymodules/aaa/index.js create mode 100644 node_modules/resolve/test/module_dir/zmodules/bbb/main.js create mode 100644 node_modules/resolve/test/module_dir/zmodules/bbb/package.json create mode 100644 node_modules/resolve/test/node-modules-paths.js create mode 100644 node_modules/resolve/test/node_path.js create mode 100644 node_modules/resolve/test/node_path/x/aaa/index.js create mode 100644 node_modules/resolve/test/node_path/x/ccc/index.js create mode 100644 node_modules/resolve/test/node_path/y/bbb/index.js create mode 100644 node_modules/resolve/test/node_path/y/ccc/index.js create mode 100644 node_modules/resolve/test/nonstring.js create mode 100644 node_modules/resolve/test/pathfilter.js create mode 100644 node_modules/resolve/test/pathfilter/deep_ref/main.js create mode 100644 node_modules/resolve/test/precedence.js create mode 100644 node_modules/resolve/test/precedence/aaa.js create mode 100644 node_modules/resolve/test/precedence/aaa/index.js create mode 100644 node_modules/resolve/test/precedence/aaa/main.js create mode 100644 node_modules/resolve/test/precedence/bbb.js create mode 100644 node_modules/resolve/test/precedence/bbb/main.js create mode 100644 node_modules/resolve/test/resolver.js create mode 100644 node_modules/resolve/test/resolver/baz/doom.js create mode 100644 node_modules/resolve/test/resolver/baz/package.json create mode 100644 node_modules/resolve/test/resolver/baz/quux.js create mode 100644 node_modules/resolve/test/resolver/browser_field/a.js create mode 100644 node_modules/resolve/test/resolver/browser_field/b.js create mode 100644 node_modules/resolve/test/resolver/browser_field/package.json create mode 100644 node_modules/resolve/test/resolver/cup.coffee create mode 100644 node_modules/resolve/test/resolver/dot_main/index.js create mode 100644 node_modules/resolve/test/resolver/dot_main/package.json create mode 100644 node_modules/resolve/test/resolver/dot_slash_main/index.js create mode 100644 node_modules/resolve/test/resolver/dot_slash_main/package.json create mode 100644 node_modules/resolve/test/resolver/foo.js create mode 100644 node_modules/resolve/test/resolver/incorrect_main/index.js create mode 100644 node_modules/resolve/test/resolver/incorrect_main/package.json create mode 100644 node_modules/resolve/test/resolver/mug.coffee create mode 100644 node_modules/resolve/test/resolver/mug.js create mode 100644 node_modules/resolve/test/resolver/other_path/lib/other-lib.js create mode 100644 node_modules/resolve/test/resolver/other_path/root.js create mode 100644 node_modules/resolve/test/resolver/quux/foo/index.js create mode 100644 node_modules/resolve/test/resolver/same_names/foo.js create mode 100644 node_modules/resolve/test/resolver/same_names/foo/index.js create mode 100644 node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js create mode 100644 node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep create mode 100644 node_modules/resolve/test/resolver/without_basedir/main.js create mode 100644 node_modules/resolve/test/resolver_sync.js create mode 100644 node_modules/resolve/test/subdirs.js create mode 100644 node_modules/resolve/test/symlinks.js create mode 100644 node_modules/resp-modifier/README.md create mode 100644 node_modules/resp-modifier/index.js create mode 100644 node_modules/resp-modifier/lib/utils.js create mode 100644 node_modules/resp-modifier/package.json create mode 100644 node_modules/ret/LICENSE create mode 100644 node_modules/ret/README.md create mode 100644 node_modules/ret/lib/index.js create mode 100644 node_modules/ret/lib/positions.js create mode 100644 node_modules/ret/lib/sets.js create mode 100644 node_modules/ret/lib/types.js create mode 100644 node_modules/ret/lib/util.js create mode 100644 node_modules/ret/package.json create mode 100644 node_modules/right-now/LICENSE.md create mode 100644 node_modules/right-now/README.md create mode 100644 node_modules/right-now/browser.js create mode 100644 node_modules/right-now/index.js create mode 100644 node_modules/right-now/package.json create mode 100644 node_modules/ripemd160/CHANGELOG.md create mode 100644 node_modules/ripemd160/LICENSE create mode 100644 node_modules/ripemd160/README.md create mode 100644 node_modules/ripemd160/index.js create mode 100644 node_modules/ripemd160/package.json create mode 100644 node_modules/safe-buffer/LICENSE create mode 100644 node_modules/safe-buffer/README.md create mode 100644 node_modules/safe-buffer/index.d.ts create mode 100644 node_modules/safe-buffer/index.js create mode 100644 node_modules/safe-buffer/package.json create mode 100644 node_modules/safe-regex/.travis.yml create mode 100644 node_modules/safe-regex/LICENSE create mode 100644 node_modules/safe-regex/example/safe.js create mode 100644 node_modules/safe-regex/index.js create mode 100644 node_modules/safe-regex/package.json create mode 100644 node_modules/safe-regex/readme.markdown create mode 100644 node_modules/safe-regex/test/regex.js create mode 100644 node_modules/semver/LICENSE create mode 100644 node_modules/semver/README.md create mode 100755 node_modules/semver/bin/semver create mode 100644 node_modules/semver/package.json create mode 100644 node_modules/semver/range.bnf create mode 100644 node_modules/semver/semver.js create mode 100644 node_modules/send/HISTORY.md create mode 100644 node_modules/send/LICENSE create mode 100644 node_modules/send/README.md create mode 100644 node_modules/send/index.js create mode 100644 node_modules/send/package.json create mode 100644 node_modules/serve-static/HISTORY.md create mode 100644 node_modules/serve-static/LICENSE create mode 100644 node_modules/serve-static/README.md create mode 100644 node_modules/serve-static/index.js create mode 100644 node_modules/serve-static/package.json create mode 100644 node_modules/set-value/LICENSE create mode 100644 node_modules/set-value/README.md create mode 100644 node_modules/set-value/index.js create mode 100644 node_modules/set-value/node_modules/extend-shallow/LICENSE create mode 100644 node_modules/set-value/node_modules/extend-shallow/README.md create mode 100644 node_modules/set-value/node_modules/extend-shallow/index.js create mode 100644 node_modules/set-value/node_modules/extend-shallow/package.json create mode 100644 node_modules/set-value/package.json create mode 100644 node_modules/setprototypeof/LICENSE create mode 100644 node_modules/setprototypeof/README.md create mode 100644 node_modules/setprototypeof/index.d.ts create mode 100644 node_modules/setprototypeof/index.js create mode 100644 node_modules/setprototypeof/package.json create mode 100644 node_modules/sha.js/.travis.yml create mode 100644 node_modules/sha.js/LICENSE create mode 100644 node_modules/sha.js/README.md create mode 100755 node_modules/sha.js/bin.js create mode 100644 node_modules/sha.js/hash.js create mode 100644 node_modules/sha.js/index.js create mode 100644 node_modules/sha.js/package.json create mode 100644 node_modules/sha.js/sha.js create mode 100644 node_modules/sha.js/sha1.js create mode 100644 node_modules/sha.js/sha224.js create mode 100644 node_modules/sha.js/sha256.js create mode 100644 node_modules/sha.js/sha384.js create mode 100644 node_modules/sha.js/sha512.js create mode 100644 node_modules/sha.js/test/hash.js create mode 100644 node_modules/sha.js/test/test.js create mode 100644 node_modules/sha.js/test/vectors.js create mode 100644 node_modules/shasum/.npmignore create mode 100644 node_modules/shasum/.travis.yml create mode 100644 node_modules/shasum/LICENSE create mode 100644 node_modules/shasum/README.md create mode 100644 node_modules/shasum/browser.js create mode 100644 node_modules/shasum/index.js create mode 100644 node_modules/shasum/package.json create mode 100644 node_modules/shasum/test/index.js create mode 100644 node_modules/shebang-command/index.js create mode 100644 node_modules/shebang-command/license create mode 100644 node_modules/shebang-command/package.json create mode 100644 node_modules/shebang-command/readme.md create mode 100644 node_modules/shebang-regex/index.js create mode 100644 node_modules/shebang-regex/license create mode 100644 node_modules/shebang-regex/package.json create mode 100644 node_modules/shebang-regex/readme.md create mode 100644 node_modules/shell-quote/.travis.yml create mode 100644 node_modules/shell-quote/LICENSE create mode 100644 node_modules/shell-quote/example/env.js create mode 100644 node_modules/shell-quote/example/op.js create mode 100644 node_modules/shell-quote/example/parse.js create mode 100644 node_modules/shell-quote/example/quote.js create mode 100644 node_modules/shell-quote/index.js create mode 100644 node_modules/shell-quote/package.json create mode 100644 node_modules/shell-quote/readme.markdown create mode 100644 node_modules/shell-quote/test/comment.js create mode 100644 node_modules/shell-quote/test/env.js create mode 100644 node_modules/shell-quote/test/env_fn.js create mode 100644 node_modules/shell-quote/test/op.js create mode 100644 node_modules/shell-quote/test/parse.js create mode 100644 node_modules/shell-quote/test/quote.js create mode 100644 node_modules/shell-quote/test/set.js create mode 100644 node_modules/signal-exit/CHANGELOG.md create mode 100644 node_modules/signal-exit/LICENSE.txt create mode 100644 node_modules/signal-exit/README.md create mode 100644 node_modules/signal-exit/index.js create mode 100644 node_modules/signal-exit/package.json create mode 100644 node_modules/signal-exit/signals.js create mode 100644 node_modules/simple-concat/.travis.yml create mode 100644 node_modules/simple-concat/LICENSE create mode 100644 node_modules/simple-concat/README.md create mode 100644 node_modules/simple-concat/index.js create mode 100644 node_modules/simple-concat/package.json create mode 100644 node_modules/simple-concat/test/basic.js create mode 100644 node_modules/simple-html-index/LICENSE.md create mode 100644 node_modules/simple-html-index/README.md create mode 100644 node_modules/simple-html-index/index.js create mode 100644 node_modules/simple-html-index/package.json create mode 100644 node_modules/snapdragon-node/LICENSE create mode 100644 node_modules/snapdragon-node/README.md create mode 100644 node_modules/snapdragon-node/index.js create mode 100644 node_modules/snapdragon-node/node_modules/define-property/LICENSE create mode 100644 node_modules/snapdragon-node/node_modules/define-property/README.md create mode 100644 node_modules/snapdragon-node/node_modules/define-property/index.js create mode 100644 node_modules/snapdragon-node/node_modules/define-property/package.json create mode 100644 node_modules/snapdragon-node/node_modules/is-accessor-descriptor/LICENSE create mode 100644 node_modules/snapdragon-node/node_modules/is-accessor-descriptor/README.md create mode 100644 node_modules/snapdragon-node/node_modules/is-accessor-descriptor/index.js create mode 100644 node_modules/snapdragon-node/node_modules/is-accessor-descriptor/package.json create mode 100644 node_modules/snapdragon-node/node_modules/is-data-descriptor/LICENSE create mode 100644 node_modules/snapdragon-node/node_modules/is-data-descriptor/README.md create mode 100644 node_modules/snapdragon-node/node_modules/is-data-descriptor/index.js create mode 100644 node_modules/snapdragon-node/node_modules/is-data-descriptor/package.json create mode 100644 node_modules/snapdragon-node/node_modules/is-descriptor/LICENSE create mode 100644 node_modules/snapdragon-node/node_modules/is-descriptor/README.md create mode 100644 node_modules/snapdragon-node/node_modules/is-descriptor/index.js create mode 100644 node_modules/snapdragon-node/node_modules/is-descriptor/package.json create mode 100644 node_modules/snapdragon-node/node_modules/isobject/LICENSE create mode 100644 node_modules/snapdragon-node/node_modules/isobject/README.md create mode 100644 node_modules/snapdragon-node/node_modules/isobject/index.d.ts create mode 100644 node_modules/snapdragon-node/node_modules/isobject/index.js create mode 100644 node_modules/snapdragon-node/node_modules/isobject/package.json create mode 100644 node_modules/snapdragon-node/node_modules/kind-of/CHANGELOG.md create mode 100644 node_modules/snapdragon-node/node_modules/kind-of/LICENSE create mode 100644 node_modules/snapdragon-node/node_modules/kind-of/README.md create mode 100644 node_modules/snapdragon-node/node_modules/kind-of/index.js create mode 100644 node_modules/snapdragon-node/node_modules/kind-of/package.json create mode 100644 node_modules/snapdragon-node/package.json create mode 100644 node_modules/snapdragon-util/LICENSE create mode 100644 node_modules/snapdragon-util/README.md create mode 100644 node_modules/snapdragon-util/index.js create mode 100644 node_modules/snapdragon-util/package.json create mode 100644 node_modules/snapdragon/LICENSE create mode 100644 node_modules/snapdragon/README.md create mode 100644 node_modules/snapdragon/index.js create mode 100644 node_modules/snapdragon/lib/compiler.js create mode 100644 node_modules/snapdragon/lib/parser.js create mode 100644 node_modules/snapdragon/lib/position.js create mode 100644 node_modules/snapdragon/lib/source-maps.js create mode 100644 node_modules/snapdragon/lib/utils.js create mode 100644 node_modules/snapdragon/node_modules/define-property/LICENSE create mode 100644 node_modules/snapdragon/node_modules/define-property/README.md create mode 100644 node_modules/snapdragon/node_modules/define-property/index.js create mode 100644 node_modules/snapdragon/node_modules/define-property/package.json create mode 100644 node_modules/snapdragon/node_modules/extend-shallow/LICENSE create mode 100644 node_modules/snapdragon/node_modules/extend-shallow/README.md create mode 100644 node_modules/snapdragon/node_modules/extend-shallow/index.js create mode 100644 node_modules/snapdragon/node_modules/extend-shallow/package.json create mode 100644 node_modules/snapdragon/package.json create mode 100644 node_modules/source-map-resolve/.jshintrc create mode 100644 node_modules/source-map-resolve/.travis.yml create mode 100644 node_modules/source-map-resolve/LICENSE create mode 100644 node_modules/source-map-resolve/bower.json create mode 100644 node_modules/source-map-resolve/changelog.md create mode 100644 node_modules/source-map-resolve/component.json create mode 100644 node_modules/source-map-resolve/generate-source-map-resolve.js create mode 100644 node_modules/source-map-resolve/lib/decode-uri-component.js create mode 100644 node_modules/source-map-resolve/lib/resolve-url.js create mode 100644 node_modules/source-map-resolve/lib/source-map-resolve-node.js create mode 100644 node_modules/source-map-resolve/package.json create mode 100644 node_modules/source-map-resolve/readme.md create mode 100644 node_modules/source-map-resolve/source-map-resolve.js create mode 100644 node_modules/source-map-resolve/source-map-resolve.js.template create mode 100644 node_modules/source-map-resolve/test/common.js create mode 100644 node_modules/source-map-resolve/test/read.js create mode 100644 node_modules/source-map-resolve/test/source-map-resolve.js create mode 100644 node_modules/source-map-resolve/test/windows.js create mode 100644 node_modules/source-map-resolve/x-package.json5 create mode 100644 node_modules/source-map-url/.jshintrc create mode 100644 node_modules/source-map-url/LICENSE create mode 100644 node_modules/source-map-url/bower.json create mode 100644 node_modules/source-map-url/changelog.md create mode 100644 node_modules/source-map-url/component.json create mode 100644 node_modules/source-map-url/package.json create mode 100644 node_modules/source-map-url/readme.md create mode 100644 node_modules/source-map-url/source-map-url.js create mode 100644 node_modules/source-map-url/test/source-map-url.js create mode 100644 node_modules/source-map-url/x-package.json5 create mode 100644 node_modules/source-map/CHANGELOG.md create mode 100644 node_modules/source-map/LICENSE create mode 100644 node_modules/source-map/README.md create mode 100644 node_modules/source-map/dist/source-map.debug.js create mode 100644 node_modules/source-map/dist/source-map.js create mode 100644 node_modules/source-map/dist/source-map.min.js create mode 100644 node_modules/source-map/dist/source-map.min.js.map create mode 100644 node_modules/source-map/lib/array-set.js create mode 100644 node_modules/source-map/lib/base64-vlq.js create mode 100644 node_modules/source-map/lib/base64.js create mode 100644 node_modules/source-map/lib/binary-search.js create mode 100644 node_modules/source-map/lib/mapping-list.js create mode 100644 node_modules/source-map/lib/quick-sort.js create mode 100644 node_modules/source-map/lib/source-map-consumer.js create mode 100644 node_modules/source-map/lib/source-map-generator.js create mode 100644 node_modules/source-map/lib/source-node.js create mode 100644 node_modules/source-map/lib/util.js create mode 100644 node_modules/source-map/package.json create mode 100644 node_modules/source-map/source-map.js create mode 100644 node_modules/split-string/LICENSE create mode 100644 node_modules/split-string/README.md create mode 100644 node_modules/split-string/index.js create mode 100644 node_modules/split-string/package.json create mode 100644 node_modules/split2/.README.md.un~ create mode 100644 node_modules/split2/.index.js.un~ create mode 100644 node_modules/split2/.npmignore create mode 100644 node_modules/split2/.package.json.un~ create mode 100644 node_modules/split2/.test.js.un~ create mode 100644 node_modules/split2/.travis.yml create mode 100644 node_modules/split2/LICENSE create mode 100644 node_modules/split2/README.md create mode 100644 node_modules/split2/index.js create mode 100644 node_modules/split2/node_modules/isarray/README.md create mode 100644 node_modules/split2/node_modules/isarray/build/build.js create mode 100644 node_modules/split2/node_modules/isarray/component.json create mode 100644 node_modules/split2/node_modules/isarray/index.js create mode 100644 node_modules/split2/node_modules/isarray/package.json create mode 100644 node_modules/split2/node_modules/readable-stream/.npmignore create mode 100644 node_modules/split2/node_modules/readable-stream/LICENSE create mode 100644 node_modules/split2/node_modules/readable-stream/README.md create mode 100644 node_modules/split2/node_modules/readable-stream/duplex.js create mode 100644 node_modules/split2/node_modules/readable-stream/lib/_stream_duplex.js create mode 100644 node_modules/split2/node_modules/readable-stream/lib/_stream_passthrough.js create mode 100644 node_modules/split2/node_modules/readable-stream/lib/_stream_readable.js create mode 100644 node_modules/split2/node_modules/readable-stream/lib/_stream_transform.js create mode 100644 node_modules/split2/node_modules/readable-stream/lib/_stream_writable.js create mode 100644 node_modules/split2/node_modules/readable-stream/package.json create mode 100644 node_modules/split2/node_modules/readable-stream/passthrough.js create mode 100644 node_modules/split2/node_modules/readable-stream/readable.js create mode 100644 node_modules/split2/node_modules/readable-stream/transform.js create mode 100644 node_modules/split2/node_modules/readable-stream/writable.js create mode 100644 node_modules/split2/node_modules/string_decoder/.npmignore create mode 100644 node_modules/split2/node_modules/string_decoder/LICENSE create mode 100644 node_modules/split2/node_modules/string_decoder/README.md create mode 100644 node_modules/split2/node_modules/string_decoder/index.js create mode 100644 node_modules/split2/node_modules/string_decoder/package.json create mode 100644 node_modules/split2/node_modules/through2/.npmignore create mode 100644 node_modules/split2/node_modules/through2/LICENSE create mode 100644 node_modules/split2/node_modules/through2/README.md create mode 100644 node_modules/split2/node_modules/through2/package.json create mode 100644 node_modules/split2/node_modules/through2/through2.js create mode 100644 node_modules/split2/package.json create mode 100644 node_modules/split2/test.js create mode 100644 node_modules/stacked/.jshintrc create mode 100644 node_modules/stacked/.npmignore create mode 100644 node_modules/stacked/.travis.yml create mode 100644 node_modules/stacked/README.md create mode 100644 node_modules/stacked/package.json create mode 100644 node_modules/stacked/stacked.js create mode 100644 node_modules/stacked/test/stacked.js create mode 100644 node_modules/static-extend/LICENSE create mode 100644 node_modules/static-extend/index.js create mode 100644 node_modules/static-extend/node_modules/define-property/LICENSE create mode 100644 node_modules/static-extend/node_modules/define-property/README.md create mode 100644 node_modules/static-extend/node_modules/define-property/index.js create mode 100644 node_modules/static-extend/node_modules/define-property/package.json create mode 100644 node_modules/static-extend/package.json create mode 100644 node_modules/statuses/HISTORY.md create mode 100644 node_modules/statuses/LICENSE create mode 100644 node_modules/statuses/README.md create mode 100644 node_modules/statuses/codes.json create mode 100644 node_modules/statuses/index.js create mode 100644 node_modules/statuses/package.json create mode 100644 node_modules/stdout-stream/.travis.yml create mode 100644 node_modules/stdout-stream/LICENSE create mode 100644 node_modules/stdout-stream/README.md create mode 100644 node_modules/stdout-stream/index.js create mode 100644 node_modules/stdout-stream/package.json create mode 100644 node_modules/stdout-stream/test/fixtures/end.js create mode 100644 node_modules/stdout-stream/test/fixtures/hello-world.js create mode 100644 node_modules/stdout-stream/test/index.js create mode 100644 node_modules/stream-browserify/.npmignore create mode 100644 node_modules/stream-browserify/.travis.yml create mode 100644 node_modules/stream-browserify/LICENSE create mode 100644 node_modules/stream-browserify/index.js create mode 100644 node_modules/stream-browserify/package.json create mode 100644 node_modules/stream-browserify/readme.markdown create mode 100644 node_modules/stream-browserify/test/buf.js create mode 100644 node_modules/stream-combiner2/.npmignore create mode 100644 node_modules/stream-combiner2/.travis.yml create mode 100644 node_modules/stream-combiner2/LICENSE create mode 100644 node_modules/stream-combiner2/README.md create mode 100644 node_modules/stream-combiner2/index.js create mode 100644 node_modules/stream-combiner2/package.json create mode 100644 node_modules/stream-combiner2/test/index.js create mode 100644 node_modules/stream-http/.airtap.yml create mode 100644 node_modules/stream-http/.travis.yml create mode 100644 node_modules/stream-http/LICENSE create mode 100644 node_modules/stream-http/README.md create mode 100644 node_modules/stream-http/ie8-polyfill.js create mode 100644 node_modules/stream-http/index.js create mode 100644 node_modules/stream-http/lib/capability.js create mode 100644 node_modules/stream-http/lib/request.js create mode 100644 node_modules/stream-http/lib/response.js create mode 100644 node_modules/stream-http/package.json create mode 100644 node_modules/stream-http/test/browser/abort.js create mode 100644 node_modules/stream-http/test/browser/auth.js create mode 100644 node_modules/stream-http/test/browser/binary-streaming.js create mode 100644 node_modules/stream-http/test/browser/binary.js create mode 100644 node_modules/stream-http/test/browser/body-empty.js create mode 100644 node_modules/stream-http/test/browser/cookie.js create mode 100644 node_modules/stream-http/test/browser/disable-fetch.js create mode 100644 node_modules/stream-http/test/browser/error.js.disabled create mode 100644 node_modules/stream-http/test/browser/headers.js create mode 100644 node_modules/stream-http/test/browser/lib/webworker-worker.js create mode 100644 node_modules/stream-http/test/browser/package.json create mode 100644 node_modules/stream-http/test/browser/post-binary.js create mode 100644 node_modules/stream-http/test/browser/post-text.js create mode 100644 node_modules/stream-http/test/browser/text-streaming.js create mode 100644 node_modules/stream-http/test/browser/text.js create mode 100644 node_modules/stream-http/test/browser/timeout.js create mode 100644 node_modules/stream-http/test/browser/webworker.js create mode 100644 node_modules/stream-http/test/node/http-browserify.js create mode 100644 node_modules/stream-http/test/server/index.js create mode 100644 node_modules/stream-http/test/server/static/basic.txt create mode 100644 node_modules/stream-http/test/server/static/browserify.png create mode 100644 node_modules/stream-http/test/server/static/test-polyfill.js create mode 100644 node_modules/stream-splicer/.travis.yml create mode 100644 node_modules/stream-splicer/LICENSE create mode 100644 node_modules/stream-splicer/example/header.js create mode 100644 node_modules/stream-splicer/index.js create mode 100644 node_modules/stream-splicer/package.json create mode 100644 node_modules/stream-splicer/readme.markdown create mode 100644 node_modules/stream-splicer/test/combiner.js create mode 100644 node_modules/stream-splicer/test/combiner_stream.js create mode 100644 node_modules/stream-splicer/test/empty.js create mode 100644 node_modules/stream-splicer/test/empty_no_data.js create mode 100644 node_modules/stream-splicer/test/get.js create mode 100644 node_modules/stream-splicer/test/multipush.js create mode 100644 node_modules/stream-splicer/test/multiunshift.js create mode 100644 node_modules/stream-splicer/test/nested.js create mode 100644 node_modules/stream-splicer/test/nested_middle.js create mode 100644 node_modules/stream-splicer/test/pop.js create mode 100644 node_modules/stream-splicer/test/push.js create mode 100644 node_modules/stream-splicer/test/shift.js create mode 100644 node_modules/stream-splicer/test/splice.js create mode 100644 node_modules/stream-splicer/test/unshift.js create mode 100644 node_modules/strict-uri-encode/index.js create mode 100644 node_modules/strict-uri-encode/license create mode 100644 node_modules/strict-uri-encode/package.json create mode 100644 node_modules/strict-uri-encode/readme.md create mode 100644 node_modules/string_decoder/.travis.yml create mode 100644 node_modules/string_decoder/LICENSE create mode 100644 node_modules/string_decoder/README.md create mode 100644 node_modules/string_decoder/lib/string_decoder.js create mode 100644 node_modules/string_decoder/package.json create mode 100644 node_modules/strip-ansi/index.js create mode 100644 node_modules/strip-ansi/license create mode 100644 node_modules/strip-ansi/node_modules/ansi-regex/index.js create mode 100644 node_modules/strip-ansi/node_modules/ansi-regex/license create mode 100644 node_modules/strip-ansi/node_modules/ansi-regex/package.json create mode 100644 node_modules/strip-ansi/node_modules/ansi-regex/readme.md create mode 100644 node_modules/strip-ansi/package.json create mode 100644 node_modules/strip-ansi/readme.md create mode 100644 node_modules/strip-eof/index.js create mode 100644 node_modules/strip-eof/license create mode 100644 node_modules/strip-eof/package.json create mode 100644 node_modules/strip-eof/readme.md create mode 100644 node_modules/subarg/.travis.yml create mode 100644 node_modules/subarg/LICENSE create mode 100644 node_modules/subarg/example/show.js create mode 100644 node_modules/subarg/index.js create mode 100644 node_modules/subarg/package.json create mode 100644 node_modules/subarg/readme.markdown create mode 100644 node_modules/subarg/test/arg.js create mode 100644 node_modules/subarg/test/recursive.js create mode 100755 node_modules/supports-color/cli.js create mode 100644 node_modules/supports-color/index.js create mode 100644 node_modules/supports-color/package.json create mode 100644 node_modules/supports-color/readme.md create mode 100644 node_modules/syntax-error/.travis.yml create mode 100644 node_modules/syntax-error/LICENSE create mode 100644 node_modules/syntax-error/example/check.js create mode 100644 node_modules/syntax-error/example/src.js create mode 100644 node_modules/syntax-error/index.js create mode 100644 node_modules/syntax-error/package.json create mode 100644 node_modules/syntax-error/readme.markdown create mode 100644 node_modules/syntax-error/test/check.js create mode 100644 node_modules/syntax-error/test/esm.js create mode 100644 node_modules/syntax-error/test/html.js create mode 100644 node_modules/syntax-error/test/ok.js create mode 100644 node_modules/syntax-error/test/run.js create mode 100644 node_modules/syntax-error/test/run2.js create mode 100644 node_modules/syntax-error/test/shebang.js create mode 100644 node_modules/syntax-error/test/sources/check.js create mode 100644 node_modules/syntax-error/test/sources/esm.js create mode 100644 node_modules/syntax-error/test/sources/ok.js create mode 100644 node_modules/syntax-error/test/sources/run.js create mode 100644 node_modules/syntax-error/test/sources/run2.js create mode 100644 node_modules/syntax-error/test/sources/shebang.js create mode 100644 node_modules/syntax-error/test/sources/spread.js create mode 100644 node_modules/syntax-error/test/sources/yield.js create mode 100644 node_modules/syntax-error/test/spread.js create mode 100644 node_modules/syntax-error/test/yield.js create mode 100644 node_modules/term-color/.jshintrc create mode 100644 node_modules/term-color/.npmignore create mode 100644 node_modules/term-color/.travis.yml create mode 100644 node_modules/term-color/LICENSE create mode 100644 node_modules/term-color/README.md create mode 100644 node_modules/term-color/index.js create mode 120000 node_modules/term-color/node_modules/.bin/supports-color create mode 100644 node_modules/term-color/node_modules/ansi-styles/index.js create mode 100644 node_modules/term-color/node_modules/ansi-styles/license create mode 100644 node_modules/term-color/node_modules/ansi-styles/package.json create mode 100644 node_modules/term-color/node_modules/ansi-styles/readme.md create mode 100755 node_modules/term-color/node_modules/supports-color/cli.js create mode 100644 node_modules/term-color/node_modules/supports-color/index.js create mode 100644 node_modules/term-color/node_modules/supports-color/license create mode 100644 node_modules/term-color/node_modules/supports-color/package.json create mode 100644 node_modules/term-color/node_modules/supports-color/readme.md create mode 100644 node_modules/term-color/package.json create mode 100644 node_modules/term-color/test/index.js create mode 100644 node_modules/through/.travis.yml create mode 100644 node_modules/through/LICENSE.APACHE2 create mode 100644 node_modules/through/LICENSE.MIT create mode 100644 node_modules/through/index.js create mode 100644 node_modules/through/package.json create mode 100644 node_modules/through/readme.markdown create mode 100644 node_modules/through/test/async.js create mode 100644 node_modules/through/test/auto-destroy.js create mode 100644 node_modules/through/test/buffering.js create mode 100644 node_modules/through/test/end.js create mode 100644 node_modules/through/test/index.js create mode 100644 node_modules/through2/.npmignore create mode 100644 node_modules/through2/LICENSE.html create mode 100644 node_modules/through2/LICENSE.md create mode 100644 node_modules/through2/README.md create mode 100644 node_modules/through2/package.json create mode 100644 node_modules/through2/through2.js create mode 100644 node_modules/timers-browserify/.npmignore create mode 100644 node_modules/timers-browserify/CHANGELOG.md create mode 100644 node_modules/timers-browserify/LICENSE.md create mode 100644 node_modules/timers-browserify/README.md create mode 100755 node_modules/timers-browserify/example/enroll/build.sh create mode 100644 node_modules/timers-browserify/example/enroll/index.html create mode 100644 node_modules/timers-browserify/example/enroll/js/browserify.js create mode 100644 node_modules/timers-browserify/example/enroll/js/main.js create mode 100644 node_modules/timers-browserify/example/enroll/server.js create mode 100644 node_modules/timers-browserify/main.js create mode 100644 node_modules/timers-browserify/package.json create mode 100644 node_modules/to-arraybuffer/.npmignore create mode 100644 node_modules/to-arraybuffer/.travis.yml create mode 100644 node_modules/to-arraybuffer/.zuul.yml create mode 100644 node_modules/to-arraybuffer/LICENSE create mode 100644 node_modules/to-arraybuffer/README.md create mode 100644 node_modules/to-arraybuffer/index.js create mode 100644 node_modules/to-arraybuffer/package.json create mode 100644 node_modules/to-arraybuffer/test.js create mode 100644 node_modules/to-object-path/LICENSE create mode 100644 node_modules/to-object-path/README.md create mode 100644 node_modules/to-object-path/index.js create mode 100644 node_modules/to-object-path/package.json create mode 100644 node_modules/to-regex-range/LICENSE create mode 100644 node_modules/to-regex-range/README.md create mode 100644 node_modules/to-regex-range/index.js create mode 100644 node_modules/to-regex-range/node_modules/is-number/LICENSE create mode 100644 node_modules/to-regex-range/node_modules/is-number/README.md create mode 100644 node_modules/to-regex-range/node_modules/is-number/index.js create mode 100644 node_modules/to-regex-range/node_modules/is-number/package.json create mode 100644 node_modules/to-regex-range/package.json create mode 100644 node_modules/to-regex/LICENSE create mode 100644 node_modules/to-regex/README.md create mode 100644 node_modules/to-regex/index.js create mode 100644 node_modules/to-regex/package.json create mode 100644 node_modules/tty-browserify/LICENSE create mode 100644 node_modules/tty-browserify/index.js create mode 100644 node_modules/tty-browserify/package.json create mode 100644 node_modules/tty-browserify/readme.markdown create mode 100644 node_modules/typedarray/.travis.yml create mode 100644 node_modules/typedarray/LICENSE create mode 100644 node_modules/typedarray/example/tarray.js create mode 100644 node_modules/typedarray/index.js create mode 100644 node_modules/typedarray/package.json create mode 100644 node_modules/typedarray/readme.markdown create mode 100644 node_modules/typedarray/test/server/undef_globals.js create mode 100644 node_modules/typedarray/test/tarray.js create mode 100644 node_modules/ultron/.npmignore create mode 100644 node_modules/ultron/.travis.yml create mode 100644 node_modules/ultron/LICENSE create mode 100644 node_modules/ultron/README.md create mode 100644 node_modules/ultron/index.js create mode 100644 node_modules/ultron/package.json create mode 100644 node_modules/ultron/test.js create mode 100644 node_modules/umd/HISTORY.md create mode 100644 node_modules/umd/LICENSE create mode 100644 node_modules/umd/README.md create mode 100755 node_modules/umd/bin/cli.js create mode 100644 node_modules/umd/index.js create mode 100644 node_modules/umd/package.json create mode 100644 node_modules/undeclared-identifiers/.travis.yml create mode 100644 node_modules/undeclared-identifiers/CHANGELOG.md create mode 100644 node_modules/undeclared-identifiers/LICENSE.md create mode 100644 node_modules/undeclared-identifiers/README.md create mode 100644 node_modules/undeclared-identifiers/bench/index.js create mode 100755 node_modules/undeclared-identifiers/bin.js create mode 100644 node_modules/undeclared-identifiers/index.js create mode 100644 node_modules/undeclared-identifiers/package.json create mode 100644 node_modules/undeclared-identifiers/test/index.js create mode 100644 node_modules/union-value/LICENSE create mode 100644 node_modules/union-value/README.md create mode 100644 node_modules/union-value/index.js create mode 100644 node_modules/union-value/node_modules/extend-shallow/LICENSE create mode 100644 node_modules/union-value/node_modules/extend-shallow/README.md create mode 100644 node_modules/union-value/node_modules/extend-shallow/index.js create mode 100644 node_modules/union-value/node_modules/extend-shallow/package.json create mode 100644 node_modules/union-value/node_modules/set-value/LICENSE create mode 100644 node_modules/union-value/node_modules/set-value/README.md create mode 100644 node_modules/union-value/node_modules/set-value/index.js create mode 100644 node_modules/union-value/node_modules/set-value/package.json create mode 100644 node_modules/union-value/package.json create mode 100644 node_modules/unset-value/LICENSE create mode 100644 node_modules/unset-value/README.md create mode 100644 node_modules/unset-value/index.js create mode 100644 node_modules/unset-value/node_modules/has-value/LICENSE create mode 100644 node_modules/unset-value/node_modules/has-value/README.md create mode 100644 node_modules/unset-value/node_modules/has-value/index.js create mode 100644 node_modules/unset-value/node_modules/has-value/node_modules/isobject/LICENSE create mode 100644 node_modules/unset-value/node_modules/has-value/node_modules/isobject/README.md create mode 100644 node_modules/unset-value/node_modules/has-value/node_modules/isobject/index.js create mode 100644 node_modules/unset-value/node_modules/has-value/node_modules/isobject/package.json create mode 100644 node_modules/unset-value/node_modules/has-value/package.json create mode 100644 node_modules/unset-value/node_modules/has-values/LICENSE create mode 100644 node_modules/unset-value/node_modules/has-values/README.md create mode 100644 node_modules/unset-value/node_modules/has-values/index.js create mode 100644 node_modules/unset-value/node_modules/has-values/package.json create mode 100644 node_modules/unset-value/node_modules/isobject/LICENSE create mode 100644 node_modules/unset-value/node_modules/isobject/README.md create mode 100644 node_modules/unset-value/node_modules/isobject/index.d.ts create mode 100644 node_modules/unset-value/node_modules/isobject/index.js create mode 100644 node_modules/unset-value/node_modules/isobject/package.json create mode 100644 node_modules/unset-value/package.json create mode 100644 node_modules/urix/.jshintrc create mode 100644 node_modules/urix/LICENSE create mode 100644 node_modules/urix/index.js create mode 100644 node_modules/urix/package.json create mode 100644 node_modules/urix/readme.md create mode 100644 node_modules/urix/test/index.js create mode 100644 node_modules/url-trim/LICENSE.md create mode 100644 node_modules/url-trim/README.md create mode 100644 node_modules/url-trim/index.js create mode 100644 node_modules/url-trim/package.json create mode 100644 node_modules/url/.npmignore create mode 100644 node_modules/url/.travis.yml create mode 100644 node_modules/url/.zuul.yml create mode 100644 node_modules/url/LICENSE create mode 100644 node_modules/url/README.md create mode 100644 node_modules/url/node_modules/punycode/LICENSE-MIT.txt create mode 100644 node_modules/url/node_modules/punycode/README.md create mode 100644 node_modules/url/node_modules/punycode/package.json create mode 100644 node_modules/url/node_modules/punycode/punycode.js create mode 100644 node_modules/url/package.json create mode 100644 node_modules/url/test.js create mode 100644 node_modules/url/url.js create mode 100644 node_modules/url/util.js create mode 100644 node_modules/use/LICENSE create mode 100644 node_modules/use/README.md create mode 100644 node_modules/use/index.js create mode 100644 node_modules/use/package.json create mode 100644 node_modules/util-deprecate/History.md create mode 100644 node_modules/util-deprecate/LICENSE create mode 100644 node_modules/util-deprecate/README.md create mode 100644 node_modules/util-deprecate/browser.js create mode 100644 node_modules/util-deprecate/node.js create mode 100644 node_modules/util-deprecate/package.json create mode 100644 node_modules/util/LICENSE create mode 100644 node_modules/util/README.md create mode 100644 node_modules/util/package.json create mode 100644 node_modules/util/support/isBuffer.js create mode 100644 node_modules/util/support/isBufferBrowser.js create mode 100644 node_modules/util/util.js create mode 100644 node_modules/vm-browserify/.travis.yml create mode 100644 node_modules/vm-browserify/CHANGELOG.md create mode 100644 node_modules/vm-browserify/LICENSE create mode 100644 node_modules/vm-browserify/example/run/bundle.js create mode 100644 node_modules/vm-browserify/example/run/entry.js create mode 100644 node_modules/vm-browserify/example/run/index.html create mode 100644 node_modules/vm-browserify/example/run/server.js create mode 100644 node_modules/vm-browserify/index.js create mode 100644 node_modules/vm-browserify/package.json create mode 100644 node_modules/vm-browserify/readme.markdown create mode 100644 node_modules/vm-browserify/test/vm.js create mode 100644 node_modules/watchify-middleware/LICENSE.md create mode 100644 node_modules/watchify-middleware/README.md create mode 100644 node_modules/watchify-middleware/example/app.js create mode 100644 node_modules/watchify-middleware/example/server.js create mode 100644 node_modules/watchify-middleware/index.js create mode 100644 node_modules/watchify-middleware/lib/bundler.js create mode 100644 node_modules/watchify-middleware/lib/parse-error.js create mode 100644 node_modules/watchify-middleware/package.json create mode 100644 node_modules/watchify/.travis.yml create mode 100644 node_modules/watchify/LICENSE create mode 100644 node_modules/watchify/bin/args.js create mode 100755 node_modules/watchify/bin/cmd.js create mode 100644 node_modules/watchify/example/files/main.js create mode 100644 node_modules/watchify/example/files/one.js create mode 100644 node_modules/watchify/example/files/two.js create mode 100644 node_modules/watchify/index.js create mode 100644 node_modules/watchify/package.json create mode 100644 node_modules/watchify/readme.markdown create mode 100644 node_modules/watchify/test/api.js create mode 100644 node_modules/watchify/test/api_brfs.js create mode 100644 node_modules/watchify/test/api_ignore_watch.js create mode 100644 node_modules/watchify/test/api_ignore_watch_default.js create mode 100644 node_modules/watchify/test/api_ignore_watch_multiple.js create mode 100644 node_modules/watchify/test/api_implicit_cache.js create mode 100644 node_modules/watchify/test/bin.js create mode 100644 node_modules/watchify/test/bin_brfs.js create mode 100644 node_modules/watchify/test/bin_ignore_watch.js create mode 100644 node_modules/watchify/test/bin_ignore_watch_default.js create mode 100644 node_modules/watchify/test/bin_ignore_watch_multiple.js create mode 100644 node_modules/watchify/test/bin_pipe.js create mode 100644 node_modules/watchify/test/bin_plugins_pipelining_multiple_errors.js create mode 100644 node_modules/watchify/test/bin_standalone.js create mode 100644 node_modules/watchify/test/errors.js create mode 100644 node_modules/watchify/test/errors_transform.js create mode 100644 node_modules/watchify/test/expose.js create mode 100644 node_modules/watchify/test/many.js create mode 100644 node_modules/watchify/test/many_immediate.js create mode 100644 node_modules/watchify/test/zzz.js create mode 100644 node_modules/which/CHANGELOG.md create mode 100644 node_modules/which/LICENSE create mode 100644 node_modules/which/README.md create mode 100755 node_modules/which/bin/which create mode 100644 node_modules/which/package.json create mode 100644 node_modules/which/which.js create mode 100644 node_modules/wrappy/LICENSE create mode 100644 node_modules/wrappy/README.md create mode 100644 node_modules/wrappy/package.json create mode 100644 node_modules/wrappy/wrappy.js create mode 100644 node_modules/ws/README.md create mode 100644 node_modules/ws/index.js create mode 100644 node_modules/ws/lib/.DS_Store create mode 100644 node_modules/ws/lib/BufferPool.js create mode 100644 node_modules/ws/lib/BufferUtil.fallback.js create mode 100644 node_modules/ws/lib/BufferUtil.js create mode 100644 node_modules/ws/lib/ErrorCodes.js create mode 100644 node_modules/ws/lib/Extensions.js create mode 100644 node_modules/ws/lib/PerMessageDeflate.js create mode 100644 node_modules/ws/lib/Receiver.hixie.js create mode 100644 node_modules/ws/lib/Receiver.js create mode 100644 node_modules/ws/lib/Sender.hixie.js create mode 100644 node_modules/ws/lib/Sender.js create mode 100644 node_modules/ws/lib/Validation.fallback.js create mode 100644 node_modules/ws/lib/Validation.js create mode 100644 node_modules/ws/lib/WebSocket.js create mode 100644 node_modules/ws/lib/WebSocketServer.js create mode 100644 node_modules/ws/package.json create mode 100644 node_modules/xtend/.jshintrc create mode 100644 node_modules/xtend/.npmignore create mode 100644 node_modules/xtend/LICENCE create mode 100644 node_modules/xtend/Makefile create mode 100644 node_modules/xtend/README.md create mode 100644 node_modules/xtend/immutable.js create mode 100644 node_modules/xtend/mutable.js create mode 100644 node_modules/xtend/package.json create mode 100644 node_modules/xtend/test.js create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 src/index.js diff --git a/JudgingCriteria.md b/JudgingCriteria.md deleted file mode 100644 index ff2a1c7eb..000000000 --- a/JudgingCriteria.md +++ /dev/null @@ -1,47 +0,0 @@ -# #CryptoLife Judging Criteria - -> “Do not wait for the last judgment. It comes every day.” - Albert Camus - -We know that all hackers really want to know is what the rules are before any event occurs (mostly so they can figure out how to break them...) So, here you are good people: the judging criteria we will be using for #CryptoLife in Prague, from the 26-28th October. - -## Intellectual Property Rights - -All submissions remain the intellectual property of the individuals or organizations that developed them. - -All submissions will occur through [this open source repository](https://github.com/status-im/CryptoLife), and code submitted must therefore have an [open source](https://opensource.org/faq) license, some examples of which can be found [here](https://opensource.org/licenses). - -## Protection of Intellectual Property - -By submitting an Entry or accepting any prize, you represent and warrant the following: -* you will not submit content that is copyrighted, protected by trade secret or otherwise subject to third party intellectual property rights or other proprietary rights, including privacy and publicity rights, unless you are the owner of such rights or have permission from their rightful owner to post the content; -* the content submitted by you does not contain any viruses, Trojan horses, worms or other disabling devices or harmful code. - -## Copyright - -You represent and warrant that you are the sole author and copyright owner of the Submission, and that the Submission is an original work of yours, or if the Submission is a work based on an existing application, that you have acquired sufficient rights to use and to authorize others; and that the Submission does not infringe upon any copyright or upon any other third party rights of which you are aware, and that the Submission is free of malware. - -## Eligibility - -CryptoLife organizers have the right at their sole discretion to determine whether an entrant is eligible for the Contest. #CryptoLife may disqualify, at the organizers’ sole discretion, entries (including, without limitation, content submitted in connection therewith) that (a) are in violation of third party rights or law or regulation, or (b) displays or uses content that #CryptoLife or Sponsors otherwise finds objectionable. - -## Judging Criteria - -| Criterion | Weighting Factor | Details | -| -------- | -------- | -------- | -| Creativity | 3 | Buidling products or services that genuinely require blockchains and that also bring real utility to people's lives requires really creative thinking. This category is weighted extra because it's so important to think outside the box when bringing crypto closer to life. | -| Technical Innovation| 2 | a.k.a. "Appropriate use of blockcahins and technical difficulty of task". As important as coming up with creative solutions is implementing them in ways which leverage the benefits networks like Ethereum really provide (distributed computation, censorship resistance, provenance, reliability, security, robustness). We want to see innovative thinking in terms of scaling products or services on shared networks, optimisation of smart contract processes, interesting ways of testing, verification or auditability etc. | -| Execution | 1 | We strongly encourage teams to produce a demo when presenting to the judges on the 28th. We understand that some hacks don't get completed, and that's totally OK! Just show us what you got, because running code really counts. | -| Business Model | 1 | We aren't really looking for a traditional model here, but we need to see evidence that you've thought of the viability of your product or service and how it might sustain itself in the long term. Understanding of how your hack fits into the current ecosystem, and the specific problem it solves in relation to the needs we all share earns extra points, as do models with unique and innovative funding mechanisms (i.e. not everything requires a token). | -| Pitch | 1 | Each time will get a set amount of time to pitch their projects to the judges once the hacking itself has ended. The demo itself is marked separately, but the ability to explain your ideas concisely and directly in a short period of time and in such a way that it grabs people attention are equally important skills in building sustainable products and communities. | -User Experience & Design | 1 | We really care about UX and Deisgn at Status. Building a more distributed future requires designing new ways for people to interact, transact and relate directly. While we understand that polishing a product is not a top priority at a hackathon, we would like to see at least some thought given to how people will be able to use your product/service easily. | -"Wow" Factor | 1 | If we're going to bring crypto closer to life, we have to really "wow" people. Some things at hackathons just don't fit neatly into predetermined categories, so we'll leave the final 10 marks open for the general "wow" you leave in the judges' minds. Such future! | - -## Categories and Prizes - -Each category will be marked out of 10, bringing us to a score out of 100. The top 5 scores in each category will then be discussed independently by the judges, who will announce the winners and runners up in each track after further deliberation. Their decisions will be final. - -Each major sponsor also gets to specify a list of hacks they'd like to see, or potentially even their own track. These will also be announced before the event, and will serve as separate prizes also handed out at the closing ceremony. - -And that's all she wrote. We can't wait to see you in Prague to bring crypto one more step closer to real life for all of us. - - diff --git a/LICENSE b/LICENSE deleted file mode 100644 index a612ad981..000000000 --- a/LICENSE +++ /dev/null @@ -1,373 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -1. Definitions --------------- - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. diff --git a/PiratesCode.md b/PiratesCode.md deleted file mode 100644 index c274d30a3..000000000 --- a/PiratesCode.md +++ /dev/null @@ -1,39 +0,0 @@ -# CryptoLife Pirate's Code -We want to come together to exchange ideas, make new friends, and build things as an inclusive community set adrift on the high digital seas, navigating these distributed networks by no more than the stars in our own eyes. - -Hackers and pirates care about code; not criteria such as degrees, age, race, nationality, sex, sexual orientation, gender, gender identity or expression, disability, physical appearance, religion (or lack thereof), or position. - -## Be Open -Be welcoming to all. Especially welcome newcomers to the community. Great things can happen when we show up with an open mind and curiosity. - -This also refers to the fact that all code submitted to this repo for consideration at the hackathon **must** be [open source](https://opensource.org/faq). We use the Mozilla Public License most often at Status, but you can find a good list of options [here](https://opensource.org/licenses) - -## Be Kind -Be kind to others. Treat their work, time, and perspectives as worthy of your attention. Treat others as you would like to be treated yourself and respect the #buidl. - -## Express Yourself Freely -Dare to create something nobody has before. Code counts more than words, so come and be your most radical self at all levels of the stack. - -## Build Stuff That Matters -We're here to bring crypto closer to life, so pay attention to the world around you, rather than the passing promise of riches or fine booty. Make public data available, protect private data. Build what matters to you. You can create new applications, find/fix bugs & vulnerabilities, work on bounties, or help others during their hacking. You can create art and beauty on a computer: a whole cosmos awaits. - -## Hacking Starts at #CryptoLife -Hacking starts during the event. Teams can form and ideas can evolve before the hackathon. However, the code base, hacks, and prototypes that you submit for prizes or bounties need to be written during the event itself. Apps, hacks, and projects that were built before the event do not qualify and will be excluded from judging and any prizes. - -## Bugs & Vulnerabilities -If you believe you have found a bug or vulnerability, please submit a report to the appropriate team or project right away. Make a good faith effort not to access or destroy another user's data. Act for the common good through the prompt reporting of all found vulnerabilities. Don't willfully exploit others without their permission. - -## Inspiration Drawn From -- [ETHBerlin Code of Conduct](https://github.com/ethberlin-hackathon/ETHBerlin-KnowledgeBase/edit/master/code-of-conduct.md) -- [Hack Code of Conduct](https://hackcodeofconduct.org/) -- [Berlin Code of Conduct](http://berlincodeofconduct.org/) -- [CCC Hacker Ethics](https://www.ccc.de/en/hackerethics) -- [Hacker One Disclosure Guidelines](https://www.hackerone.com/disclosure-guidelines) -- [Steven Levy’s Hacker Ethic](https://en.wikipedia.org/wiki/Hacker_ethic) - -## Contact -If you have any questions, before or during the event, please contact ceri@status.im or find her in person (it's pronounced K-er-y) at #CryptoLife for all your pirate needs. - -## Additional rules -No striking one another on board, but every human's quarrels to be ended on shore, at sword and pistol. The quarter-master of the ship, when the parties will not come to any reconciliation, accompanies them on shore with what assistance he thinks proper, and turns the disputants back to back, at so many paces distance; at the word of command, they turn and fire immediately (or else the piece is knocked out of their hands). If both miss, they come to their cutlasses, and then she is declared the victor who draws the first blood. -To desert the ship or their quarters in battle, is punished with death or marooning. diff --git a/README.md b/README.md deleted file mode 100644 index b7d260797..000000000 --- a/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# CryptoLife -A repo for all the #CryptoLife Hackathon submissions, The National House Smichov, Prague, 26-28th October 2018. - -You can read more about the meaning behind the event [here](https://our.status.im/why-name-the-status-hackathon-cryptolife-what-does-that-actually-mean/). - -The [EthMagicians](https://our.status.im/magic-internet-people/) will be in full attendance! - -You can check out the #CryptoLife Master List [here](https://our.status.im/your-cryptolife-masterlist/). - -# Submit Your Hack To This Repo - -**Reminder:** In line with our principles at Status, all code that is submitted during the #CryptoLife Hackathon is considered completely open source and under the same license as this repo - the Mozilla Public License 2.0. - -## Steps to Follow - -1. Fork the repo to your own profile or orgnaization by using the button in the top right of this page. -2. `git clone ` -3. `cd ` -4. Create a new branch in your forked version of the repo and add your code to it. Use the naming convention suggested by placing your team name first, and your project name after (if there is one). - - `git checkout -b ` - -5. Add, commit and push your changes to your new branch in your forked repo: - - ```shell - git add . - git commit -m " Submission for CryptoLife" - git push - ``` - -6. Go to your forked repo in the browser and submit a PR using the green button there. diff --git a/bundle.js b/bundle.js new file mode 100644 index 000000000..6fa6f8dd3 --- /dev/null +++ b/bundle.js @@ -0,0 +1,1080 @@ +(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i 0) { + str = CHARS[integer % 62] + str; + integer = Math.floor(integer / 62); + } + return str; +}; + +},{}],10:[function(require,module,exports){ +'use strict'; + +var makeComposition = require('./composition').makeComposition; + +module.exports = function createExports(classes, keyframes, compositions) { + var keyframesObj = Object.keys(keyframes).reduce(function(acc, key) { + var val = keyframes[key]; + acc[val] = makeComposition([key], [val], true); + return acc; + }, {}); + + var exports = Object.keys(classes).reduce(function(acc, key) { + var val = classes[key]; + var composition = compositions[key]; + var extended = composition ? getClassChain(composition) : []; + var allClasses = [key].concat(extended); + var unscoped = allClasses.map(function(name) { + return classes[name] ? classes[name] : name; + }); + acc[val] = makeComposition(allClasses, unscoped); + return acc; + }, keyframesObj); + + return exports; +} + +function getClassChain(obj) { + var visited = {}, acc = []; + + function traverse(obj) { + return Object.keys(obj).forEach(function(key) { + if (!visited[key]) { + visited[key] = true; + acc.push(key); + traverse(obj[key]); + } + }); + } + + traverse(obj); + return acc; +} + +},{"./composition":11}],11:[function(require,module,exports){ +'use strict'; + +module.exports = { + makeComposition: makeComposition, + isComposition: isComposition, + ignoreComposition: ignoreComposition +}; + +/** + * Returns an immutable composition object containing the given class names + * @param {array} classNames - The input array of class names + * @return {Composition} - An immutable object that holds multiple + * representations of the class composition + */ +function makeComposition(classNames, unscoped, isAnimation) { + var classString = classNames.join(' '); + return Object.create(Composition.prototype, { + classNames: { // the original array of class names + value: Object.freeze(classNames), + configurable: false, + writable: false, + enumerable: true + }, + unscoped: { // the original array of class names + value: Object.freeze(unscoped), + configurable: false, + writable: false, + enumerable: true + }, + className: { // space-separated class string for use in HTML + value: classString, + configurable: false, + writable: false, + enumerable: true + }, + selector: { // comma-separated, period-prefixed string for use in CSS + value: classNames.map(function(name) { + return isAnimation ? name : '.' + name; + }).join(', '), + configurable: false, + writable: false, + enumerable: true + }, + toString: { // toString() method, returns class string for use in HTML + value: function() { + return classString; + }, + configurable: false, + writeable: false, + enumerable: false + } + }); +} + +/** + * Returns whether the input value is a Composition + * @param value - value to check + * @return {boolean} - whether value is a Composition or not + */ +function isComposition(value) { + return value instanceof Composition; +} + +function ignoreComposition(values) { + return values.reduce(function(acc, val) { + if (isComposition(val)) { + val.classNames.forEach(function(name, i) { + acc[name] = val.unscoped[i]; + }); + } + return acc; + }, {}); +} + +/** + * Private constructor for use in `instanceof` checks + */ +function Composition() {} + +},{}],12:[function(require,module,exports){ +'use strict'; + +var extractExtends = require('./css-extract-extends'); +var composition = require('./composition'); +var isComposition = composition.isComposition; +var ignoreComposition = composition.ignoreComposition; +var buildExports = require('./build-exports'); +var scopify = require('./scopeify'); +var cssKey = require('./css-key'); +var extractExports = require('./extract-exports'); + +module.exports = function csjsTemplate(opts) { + opts = (typeof opts === 'undefined') ? {} : opts; + var noscope = (typeof opts.noscope === 'undefined') ? false : opts.noscope; + + return function csjsHandler(strings, values) { + // Fast path to prevent arguments deopt + var values = Array(arguments.length - 1); + for (var i = 1; i < arguments.length; i++) { + values[i - 1] = arguments[i]; + } + var css = joiner(strings, values.map(selectorize)); + var ignores = ignoreComposition(values); + + var scope = noscope ? extractExports(css) : scopify(css, ignores); + var extracted = extractExtends(scope.css); + var localClasses = without(scope.classes, ignores); + var localKeyframes = without(scope.keyframes, ignores); + var compositions = extracted.compositions; + + var exports = buildExports(localClasses, localKeyframes, compositions); + + return Object.defineProperty(exports, cssKey, { + enumerable: false, + configurable: false, + writeable: false, + value: extracted.css + }); + } +} + +/** + * Replaces class compositions with comma seperated class selectors + * @param value - the potential class composition + * @return - the original value or the selectorized class composition + */ +function selectorize(value) { + return isComposition(value) ? value.selector : value; +} + +/** + * Joins template string literals and values + * @param {array} strings - array of strings + * @param {array} values - array of values + * @return {string} - strings and values joined + */ +function joiner(strings, values) { + return strings.map(function(str, i) { + return (i !== values.length) ? str + values[i] : str; + }).join(''); +} + +/** + * Returns first object without keys of second + * @param {object} obj - source object + * @param {object} unwanted - object with unwanted keys + * @return {object} - first object without unwanted keys + */ +function without(obj, unwanted) { + return Object.keys(obj).reduce(function(acc, key) { + if (!unwanted[key]) { + acc[key] = obj[key]; + } + return acc; + }, {}); +} + +},{"./build-exports":10,"./composition":11,"./css-extract-extends":13,"./css-key":14,"./extract-exports":15,"./scopeify":21}],13:[function(require,module,exports){ +'use strict'; + +var makeComposition = require('./composition').makeComposition; + +var regex = /\.([^\s]+)(\s+)(extends\s+)(\.[^{]+)/g; + +module.exports = function extractExtends(css) { + var found, matches = []; + while (found = regex.exec(css)) { + matches.unshift(found); + } + + function extractCompositions(acc, match) { + var extendee = getClassName(match[1]); + var keyword = match[3]; + var extended = match[4]; + + // remove from output css + var index = match.index + match[1].length + match[2].length; + var len = keyword.length + extended.length; + acc.css = acc.css.slice(0, index) + " " + acc.css.slice(index + len + 1); + + var extendedClasses = splitter(extended); + + extendedClasses.forEach(function(className) { + if (!acc.compositions[extendee]) { + acc.compositions[extendee] = {}; + } + if (!acc.compositions[className]) { + acc.compositions[className] = {}; + } + acc.compositions[extendee][className] = acc.compositions[className]; + }); + return acc; + } + + return matches.reduce(extractCompositions, { + css: css, + compositions: {} + }); + +}; + +function splitter(match) { + return match.split(',').map(getClassName); +} + +function getClassName(str) { + var trimmed = str.trim(); + return trimmed[0] === '.' ? trimmed.substr(1) : trimmed; +} + +},{"./composition":11}],14:[function(require,module,exports){ +'use strict'; + +/** + * CSS identifiers with whitespace are invalid + * Hence this key will not cause a collision + */ + +module.exports = ' css '; + +},{}],15:[function(require,module,exports){ +'use strict'; + +var regex = require('./regex'); +var classRegex = regex.classRegex; +var keyframesRegex = regex.keyframesRegex; + +module.exports = extractExports; + +function extractExports(css) { + return { + css: css, + keyframes: getExport(css, keyframesRegex), + classes: getExport(css, classRegex) + }; +} + +function getExport(css, regex) { + var prop = {}; + var match; + while((match = regex.exec(css)) !== null) { + var name = match[2]; + prop[name] = name; + } + return prop; +} + +},{"./regex":18}],16:[function(require,module,exports){ +'use strict'; + +var cssKey = require('./css-key'); + +module.exports = function getCss(csjs) { + return csjs[cssKey]; +}; + +},{"./css-key":14}],17:[function(require,module,exports){ +'use strict'; + +/** + * djb2 string hash implementation based on string-hash module: + * https://github.com/darkskyapp/string-hash + */ + +module.exports = function hashStr(str) { + var hash = 5381; + var i = str.length; + + while (i) { + hash = (hash * 33) ^ str.charCodeAt(--i) + } + return hash >>> 0; +}; + +},{}],18:[function(require,module,exports){ +'use strict'; + +var findClasses = /(\.)(?!\d)([^\s\.,{\[>+~#:)]*)(?![^{]*})/.source; +var findKeyframes = /(@\S*keyframes\s*)([^{\s]*)/.source; +var ignoreComments = /(?!(?:[^*/]|\*[^/]|\/[^*])*\*+\/)/.source; + +var classRegex = new RegExp(findClasses + ignoreComments, 'g'); +var keyframesRegex = new RegExp(findKeyframes + ignoreComments, 'g'); + +module.exports = { + classRegex: classRegex, + keyframesRegex: keyframesRegex, + ignoreComments: ignoreComments, +}; + +},{}],19:[function(require,module,exports){ +var ignoreComments = require('./regex').ignoreComments; + +module.exports = replaceAnimations; + +function replaceAnimations(result) { + var animations = Object.keys(result.keyframes).reduce(function(acc, key) { + acc[result.keyframes[key]] = key; + return acc; + }, {}); + var unscoped = Object.keys(animations); + + if (unscoped.length) { + var regexStr = '((?:animation|animation-name)\\s*:[^};]*)(' + + unscoped.join('|') + ')([;\\s])' + ignoreComments; + var regex = new RegExp(regexStr, 'g'); + + var replaced = result.css.replace(regex, function(match, preamble, name, ending) { + return preamble + animations[name] + ending; + }); + + return { + css: replaced, + keyframes: result.keyframes, + classes: result.classes + } + } + + return result; +} + +},{"./regex":18}],20:[function(require,module,exports){ +'use strict'; + +var encode = require('./base62-encode'); +var hash = require('./hash-string'); + +module.exports = function fileScoper(fileSrc) { + var suffix = encode(hash(fileSrc)); + + return function scopedName(name) { + return name + '_' + suffix; + } +}; + +},{"./base62-encode":9,"./hash-string":17}],21:[function(require,module,exports){ +'use strict'; + +var fileScoper = require('./scoped-name'); +var replaceAnimations = require('./replace-animations'); +var regex = require('./regex'); +var classRegex = regex.classRegex; +var keyframesRegex = regex.keyframesRegex; + +module.exports = scopify; + +function scopify(css, ignores) { + var makeScopedName = fileScoper(css); + var replacers = { + classes: classRegex, + keyframes: keyframesRegex + }; + + function scopeCss(result, key) { + var replacer = replacers[key]; + function replaceFn(fullMatch, prefix, name) { + var scopedName = ignores[name] ? name : makeScopedName(name); + result[key][scopedName] = name; + return prefix + scopedName; + } + return { + css: result.css.replace(replacer, replaceFn), + keyframes: result.keyframes, + classes: result.classes + }; + } + + var result = Object.keys(replacers).reduce(scopeCss, { + css: css, + keyframes: {}, + classes: {} + }); + + return replaceAnimations(result); +} + +},{"./regex":18,"./replace-animations":19,"./scoped-name":20}],22:[function(require,module,exports){ +module.exports = attributeToProperty + +var transform = { + 'class': 'className', + 'for': 'htmlFor', + 'http-equiv': 'httpEquiv' +} + +function attributeToProperty (h) { + return function (tagName, attrs, children) { + for (var attr in attrs) { + if (attr in transform) { + attrs[transform[attr]] = attrs[attr] + delete attrs[attr] + } + } + return h(tagName, attrs, children) + } +} + +},{}],23:[function(require,module,exports){ +var attrToProp = require('hyperscript-attribute-to-property') + +var VAR = 0, TEXT = 1, OPEN = 2, CLOSE = 3, ATTR = 4 +var ATTR_KEY = 5, ATTR_KEY_W = 6 +var ATTR_VALUE_W = 7, ATTR_VALUE = 8 +var ATTR_VALUE_SQ = 9, ATTR_VALUE_DQ = 10 +var ATTR_EQ = 11, ATTR_BREAK = 12 +var COMMENT = 13 + +module.exports = function (h, opts) { + if (!opts) opts = {} + var concat = opts.concat || function (a, b) { + return String(a) + String(b) + } + if (opts.attrToProp !== false) { + h = attrToProp(h) + } + + return function (strings) { + var state = TEXT, reg = '' + var arglen = arguments.length + var parts = [] + + for (var i = 0; i < strings.length; i++) { + if (i < arglen - 1) { + var arg = arguments[i+1] + var p = parse(strings[i]) + var xstate = state + if (xstate === ATTR_VALUE_DQ) xstate = ATTR_VALUE + if (xstate === ATTR_VALUE_SQ) xstate = ATTR_VALUE + if (xstate === ATTR_VALUE_W) xstate = ATTR_VALUE + if (xstate === ATTR) xstate = ATTR_KEY + if (xstate === OPEN) { + if (reg === '/') { + p.push([ OPEN, '/', arg ]) + reg = '' + } else { + p.push([ OPEN, arg ]) + } + } else { + p.push([ VAR, xstate, arg ]) + } + parts.push.apply(parts, p) + } else parts.push.apply(parts, parse(strings[i])) + } + + var tree = [null,{},[]] + var stack = [[tree,-1]] + for (var i = 0; i < parts.length; i++) { + var cur = stack[stack.length-1][0] + var p = parts[i], s = p[0] + if (s === OPEN && /^\//.test(p[1])) { + var ix = stack[stack.length-1][1] + if (stack.length > 1) { + stack.pop() + stack[stack.length-1][0][2][ix] = h( + cur[0], cur[1], cur[2].length ? cur[2] : undefined + ) + } + } else if (s === OPEN) { + var c = [p[1],{},[]] + cur[2].push(c) + stack.push([c,cur[2].length-1]) + } else if (s === ATTR_KEY || (s === VAR && p[1] === ATTR_KEY)) { + var key = '' + var copyKey + for (; i < parts.length; i++) { + if (parts[i][0] === ATTR_KEY) { + key = concat(key, parts[i][1]) + } else if (parts[i][0] === VAR && parts[i][1] === ATTR_KEY) { + if (typeof parts[i][2] === 'object' && !key) { + for (copyKey in parts[i][2]) { + if (parts[i][2].hasOwnProperty(copyKey) && !cur[1][copyKey]) { + cur[1][copyKey] = parts[i][2][copyKey] + } + } + } else { + key = concat(key, parts[i][2]) + } + } else break + } + if (parts[i][0] === ATTR_EQ) i++ + var j = i + for (; i < parts.length; i++) { + if (parts[i][0] === ATTR_VALUE || parts[i][0] === ATTR_KEY) { + if (!cur[1][key]) cur[1][key] = strfn(parts[i][1]) + else parts[i][1]==="" || (cur[1][key] = concat(cur[1][key], parts[i][1])); + } else if (parts[i][0] === VAR + && (parts[i][1] === ATTR_VALUE || parts[i][1] === ATTR_KEY)) { + if (!cur[1][key]) cur[1][key] = strfn(parts[i][2]) + else parts[i][2]==="" || (cur[1][key] = concat(cur[1][key], parts[i][2])); + } else { + if (key.length && !cur[1][key] && i === j + && (parts[i][0] === CLOSE || parts[i][0] === ATTR_BREAK)) { + // https://html.spec.whatwg.org/multipage/infrastructure.html#boolean-attributes + // empty string is falsy, not well behaved value in browser + cur[1][key] = key.toLowerCase() + } + if (parts[i][0] === CLOSE) { + i-- + } + break + } + } + } else if (s === ATTR_KEY) { + cur[1][p[1]] = true + } else if (s === VAR && p[1] === ATTR_KEY) { + cur[1][p[2]] = true + } else if (s === CLOSE) { + if (selfClosing(cur[0]) && stack.length) { + var ix = stack[stack.length-1][1] + stack.pop() + stack[stack.length-1][0][2][ix] = h( + cur[0], cur[1], cur[2].length ? cur[2] : undefined + ) + } + } else if (s === VAR && p[1] === TEXT) { + if (p[2] === undefined || p[2] === null) p[2] = '' + else if (!p[2]) p[2] = concat('', p[2]) + if (Array.isArray(p[2][0])) { + cur[2].push.apply(cur[2], p[2]) + } else { + cur[2].push(p[2]) + } + } else if (s === TEXT) { + cur[2].push(p[1]) + } else if (s === ATTR_EQ || s === ATTR_BREAK) { + // no-op + } else { + throw new Error('unhandled: ' + s) + } + } + + if (tree[2].length > 1 && /^\s*$/.test(tree[2][0])) { + tree[2].shift() + } + + if (tree[2].length > 2 + || (tree[2].length === 2 && /\S/.test(tree[2][1]))) { + throw new Error( + 'multiple root elements must be wrapped in an enclosing tag' + ) + } + if (Array.isArray(tree[2][0]) && typeof tree[2][0][0] === 'string' + && Array.isArray(tree[2][0][2])) { + tree[2][0] = h(tree[2][0][0], tree[2][0][1], tree[2][0][2]) + } + return tree[2][0] + + function parse (str) { + var res = [] + if (state === ATTR_VALUE_W) state = ATTR + for (var i = 0; i < str.length; i++) { + var c = str.charAt(i) + if (state === TEXT && c === '<') { + if (reg.length) res.push([TEXT, reg]) + reg = '' + state = OPEN + } else if (c === '>' && !quot(state) && state !== COMMENT) { + if (state === OPEN && reg.length) { + res.push([OPEN,reg]) + } else if (state === ATTR_KEY) { + res.push([ATTR_KEY,reg]) + } else if (state === ATTR_VALUE && reg.length) { + res.push([ATTR_VALUE,reg]) + } + res.push([CLOSE]) + reg = '' + state = TEXT + } else if (state === COMMENT && /-$/.test(reg) && c === '-') { + if (opts.comments) { + res.push([ATTR_VALUE,reg.substr(0, reg.length - 1)],[CLOSE]) + } + reg = '' + state = TEXT + } else if (state === OPEN && /^!--$/.test(reg)) { + if (opts.comments) { + res.push([OPEN, reg],[ATTR_KEY,'comment'],[ATTR_EQ]) + } + reg = c + state = COMMENT + } else if (state === TEXT || state === COMMENT) { + reg += c + } else if (state === OPEN && c === '/' && reg.length) { + // no-op, self closing tag without a space
+ } else if (state === OPEN && /\s/.test(c)) { + if (reg.length) { + res.push([OPEN, reg]) + } + reg = '' + state = ATTR + } else if (state === OPEN) { + reg += c + } else if (state === ATTR && /[^\s"'=/]/.test(c)) { + state = ATTR_KEY + reg = c + } else if (state === ATTR && /\s/.test(c)) { + if (reg.length) res.push([ATTR_KEY,reg]) + res.push([ATTR_BREAK]) + } else if (state === ATTR_KEY && /\s/.test(c)) { + res.push([ATTR_KEY,reg]) + reg = '' + state = ATTR_KEY_W + } else if (state === ATTR_KEY && c === '=') { + res.push([ATTR_KEY,reg],[ATTR_EQ]) + reg = '' + state = ATTR_VALUE_W + } else if (state === ATTR_KEY) { + reg += c + } else if ((state === ATTR_KEY_W || state === ATTR) && c === '=') { + res.push([ATTR_EQ]) + state = ATTR_VALUE_W + } else if ((state === ATTR_KEY_W || state === ATTR) && !/\s/.test(c)) { + res.push([ATTR_BREAK]) + if (/[\w-]/.test(c)) { + reg += c + state = ATTR_KEY + } else state = ATTR + } else if (state === ATTR_VALUE_W && c === '"') { + state = ATTR_VALUE_DQ + } else if (state === ATTR_VALUE_W && c === "'") { + state = ATTR_VALUE_SQ + } else if (state === ATTR_VALUE_DQ && c === '"') { + res.push([ATTR_VALUE,reg],[ATTR_BREAK]) + reg = '' + state = ATTR + } else if (state === ATTR_VALUE_SQ && c === "'") { + res.push([ATTR_VALUE,reg],[ATTR_BREAK]) + reg = '' + state = ATTR + } else if (state === ATTR_VALUE_W && !/\s/.test(c)) { + state = ATTR_VALUE + i-- + } else if (state === ATTR_VALUE && /\s/.test(c)) { + res.push([ATTR_VALUE,reg],[ATTR_BREAK]) + reg = '' + state = ATTR + } else if (state === ATTR_VALUE || state === ATTR_VALUE_SQ + || state === ATTR_VALUE_DQ) { + reg += c + } + } + if (state === TEXT && reg.length) { + res.push([TEXT,reg]) + reg = '' + } else if (state === ATTR_VALUE && reg.length) { + res.push([ATTR_VALUE,reg]) + reg = '' + } else if (state === ATTR_VALUE_DQ && reg.length) { + res.push([ATTR_VALUE,reg]) + reg = '' + } else if (state === ATTR_VALUE_SQ && reg.length) { + res.push([ATTR_VALUE,reg]) + reg = '' + } else if (state === ATTR_KEY) { + res.push([ATTR_KEY,reg]) + reg = '' + } + return res + } + } + + function strfn (x) { + if (typeof x === 'function') return x + else if (typeof x === 'string') return x + else if (x && typeof x === 'object') return x + else return concat('', x) + } +} + +function quot (state) { + return state === ATTR_VALUE_SQ || state === ATTR_VALUE_DQ +} + +var hasOwn = Object.prototype.hasOwnProperty +function has (obj, key) { return hasOwn.call(obj, key) } + +var closeRE = RegExp('^(' + [ + 'area', 'base', 'basefont', 'bgsound', 'br', 'col', 'command', 'embed', + 'frame', 'hr', 'img', 'input', 'isindex', 'keygen', 'link', 'meta', 'param', + 'source', 'track', 'wbr', '!--', + // SVG TAGS + 'animate', 'animateTransform', 'circle', 'cursor', 'desc', 'ellipse', + 'feBlend', 'feColorMatrix', 'feComposite', + 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', + 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', + 'feGaussianBlur', 'feImage', 'feMergeNode', 'feMorphology', + 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', + 'feTurbulence', 'font-face-format', 'font-face-name', 'font-face-uri', + 'glyph', 'glyphRef', 'hkern', 'image', 'line', 'missing-glyph', 'mpath', + 'path', 'polygon', 'polyline', 'rect', 'set', 'stop', 'tref', 'use', 'view', + 'vkern' +].join('|') + ')(?:[\.#][a-zA-Z0-9\u007F-\uFFFF_:-]+)*$') +function selfClosing (tag) { return closeRE.test(tag) } + +},{"hyperscript-attribute-to-property":22}],24:[function(require,module,exports){ +var inserted = {}; + +module.exports = function (css, options) { + if (inserted[css]) return; + inserted[css] = true; + + var elem = document.createElement('style'); + elem.setAttribute('type', 'text/css'); + + if ('textContent' in elem) { + elem.textContent = css; + } else { + elem.styleSheet.cssText = css; + } + + var head = document.getElementsByTagName('head')[0]; + if (options && options.prepend) { + head.insertBefore(elem, head.childNodes[0]); + } else { + head.appendChild(elem); + } +}; + +},{}],25:[function(require,module,exports){ +var bel = require('bel') +var css = require('csjs-inject') + +var el = bel`
Hello world
` + +document.body.appendChild(el) + +},{"bel":2,"csjs-inject":5}]},{},[25]); diff --git a/index.html b/index.html new file mode 100644 index 000000000..3928cc698 --- /dev/null +++ b/index.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/json_s/1.json b/json_s/1.json new file mode 100644 index 000000000..06e76e384 --- /dev/null +++ b/json_s/1.json @@ -0,0 +1,15 @@ +{ + "title": "Variables", + "version": "1.0.0", + "icon": "/test/icon.svg", + "chat": "https://gitter.im/ethereum/play", + "lessons": [{ + "lesson": "https://www.youtube.com/watch?v=n9yzr5ved_k", + "tool": "https://solidity.readthedocs.io/en/v0.4.24/structure-of-a-contract.html#state-variables" + }], + "needs": [ + ], + "unlocks": [ + "http://172.31.253.118:9966/json_s/2.json" + ] +} diff --git a/json_s/10.json b/json_s/10.json new file mode 100644 index 000000000..246dea0ca --- /dev/null +++ b/json_s/10.json @@ -0,0 +1,17 @@ +{ + "title": "Test networks", + "version": "1.0.0", + "icon": "/test/icon.svg", + "chat": "https://gitter.im/ethereum/play", + "lessons": [{ + "lesson": "https://www.youtube.com/watch?v=QdG9xsOolJ4", + "tool": "https://solidity.readthedocs.io/en/v0.4.24/types.html", + "info": "./solidity-types.md" + }], + "needs": [ + "http://172.31.253.118:9966/json_s/7.json" + ], + "unlocks": [ + "" + ] + } diff --git a/json_s/2.json b/json_s/2.json new file mode 100644 index 000000000..03054f0b3 --- /dev/null +++ b/json_s/2.json @@ -0,0 +1,18 @@ +{ + "title": "Solidity Events", + "version": "1.0.0", + "icon": "/test/icon.svg", + "chat": "https://gitter.im/ethereum/play", + "lessons": [{ + "lesson": "https://www.youtube.com/watch?v=jXjYu8wNuTA", + "tool": "https://solidity.readthedocs.io/en/v0.4.24/structure-of-a-contract.html#events", + "info": "./solidity-types.md" + }], + "needs": [ + "http://172.31.253.118:9966/json_s/1.json" + ], + "unlocks": [ + "http://172.31.253.118:9966/json_s/3.json", + "http://172.31.253.118:9966/json_s/5.json" + ] +} diff --git a/json_s/3.json b/json_s/3.json new file mode 100644 index 000000000..8fe80e116 --- /dev/null +++ b/json_s/3.json @@ -0,0 +1,17 @@ +{ + "title": "Mappings and Strucks", + "version": "1.0.0", + "icon": "/test/icon.svg", + "chat": "https://gitter.im/ethereum/play", + "lessons": [{ + "lesson": "https://www.youtube.com/watch?v=gfXewa4xmYE", + "tool": "https://solidity.readthedocs.io/en/v0.4.24/types.html#mappings" + }], + "needs": [ + "http://172.31.253.118:9966/json_s/1.json", + "http://172.31.253.118:9966/json_s/2.json" + ], + "unlocks": [ + "http://172.31.253.118:9966/json_s/5.json" + ] +} diff --git a/json_s/4.json b/json_s/4.json new file mode 100644 index 000000000..5ce311da2 --- /dev/null +++ b/json_s/4.json @@ -0,0 +1,19 @@ +{ + "title": "Functions Modifiers", + "version": "1.0.0", + "icon": "/test/icon.svg", + "chat": "https://gitter.im/ethereum/play", + "lessons": [{ + "lesson": "https://www.youtube.com/watch?v=U-5FHKq7weo", + "tool": "https://solidity.readthedocs.io/en/v0.4.24/structure-of-a-contract.html#function-modifiers", + "info": "./solidity-functions-modifiers.md" + }], + "needs": [ + "http://172.31.253.118:9966/json_s/1.json", + "http://172.31.253.118:9966/json_s/2.json", + "http://172.31.253.118:9966/json_s/3.json" + ], + "unlocks": [ + "http://172.31.253.118:9966/json_s/5.json" + ] +} diff --git a/json_s/5.json b/json_s/5.json new file mode 100644 index 000000000..7b5bf4b81 --- /dev/null +++ b/json_s/5.json @@ -0,0 +1,17 @@ +{ + "title": "Types", + "version": "1.0.0", + "icon": "/test/icon.svg", + "chat": "https://gitter.im/ethereum/play", + "lessons": [{ + "lesson": "https://www.youtube.com/watch?v=QdG9xsOolJ4", + "tool": "https://solidity.readthedocs.io/en/v0.4.24/types.html", + "info": "./solidity-types.md" + }], + "needs": [ + "http://172.31.253.118:9966/json_s/2.json" + ], + "unlocks": [ + "" + ] + } diff --git a/json_s/6.json b/json_s/6.json new file mode 100644 index 000000000..736052000 --- /dev/null +++ b/json_s/6.json @@ -0,0 +1,21 @@ +{ + "title": "Imports and Libraries", + "version": "1.0.0", + "icon": "/test/icon.svg", + "chat": "https://gitter.im/ethereum/play", + "lessons": [{ + "lesson": "https://www.youtube.com/watch?v=0Lyf_3kA3Ms", + "tool": "http://remix.ethereum.org", + "info": "./solidity-types.md" + }], + "needs": [ + "http://172.31.253.118:9966/json_s/1.json", + "http://172.31.253.118:9966/json_s/2.json", + "http://172.31.253.118:9966/json_s/3.json", + "http://172.31.253.118:9966/json_s/4.json", + "http://172.31.253.118:9966/json_s/5.json" + ], + "unlocks": [ + "" + ] + } diff --git a/json_s/7.json b/json_s/7.json new file mode 100644 index 000000000..2fae1a2a1 --- /dev/null +++ b/json_s/7.json @@ -0,0 +1,17 @@ +{ + "title": "Solidity Source File", + "version": "1.0.0", + "icon": "/test/icon.svg", + "chat": "https://gitter.im/ethereum/play", + "lessons": [{ + "lesson": "https://www.youtube.com/watch?v=QdG9xsOolJ4", + "tool": "https://solidity.readthedocs.io/en/v0.4.24/types.html", + "info": "./solidity-types.md" + }], + "needs": [ + "http://172.31.253.118:9966/json_s/6.json" + ], + "unlocks": [ + "" + ] + } diff --git a/json_s/8.json b/json_s/8.json new file mode 100644 index 000000000..ea358fe11 --- /dev/null +++ b/json_s/8.json @@ -0,0 +1,17 @@ +{ + "title": "Remix", + "version": "1.0.0", + "icon": "/test/icon.svg", + "chat": "https://gitter.im/ethereum/play", + "lessons": [{ + "lesson": "https://www.youtube.com/watch?v=QdG9xsOolJ4", + "tool": "http://remix.ethereum.org", + "info": "./solidity-types.md" + }], + "needs": [ + "http://172.31.253.118:9966/json_s/7.json" + ], + "unlocks": [ + "" + ] + } diff --git a/json_s/9.json b/json_s/9.json new file mode 100644 index 000000000..526e4bf59 --- /dev/null +++ b/json_s/9.json @@ -0,0 +1,19 @@ +{ + "title": "Deploying to the network", + "version": "1.0.0", + "icon": "/test/icon.svg", + "chat": "https://gitter.im/ethereum/play", + "lessons": [{ + "lesson": "https://www.youtube.com/watch?v=QdG9xsOolJ4", + "tool": "https://solidity.readthedocs.io/en/v0.4.24/types.html", + "info": "./solidity-types.md" + }], + "needs": [ + "http://172.31.253.118:9966/json_s/8.json", + "http://172.31.253.118:9966/json_s/1.json", + "http://172.31.253.118:9966/json_s/10.json" + ], + "unlocks": [ + "" + ] + } diff --git a/node_modules/.bin/JSONStream b/node_modules/.bin/JSONStream new file mode 120000 index 000000000..3983a36c6 --- /dev/null +++ b/node_modules/.bin/JSONStream @@ -0,0 +1 @@ +../JSONStream/bin.js \ No newline at end of file diff --git a/node_modules/.bin/acorn b/node_modules/.bin/acorn new file mode 120000 index 000000000..cf7676038 --- /dev/null +++ b/node_modules/.bin/acorn @@ -0,0 +1 @@ +../acorn/bin/acorn \ No newline at end of file diff --git a/node_modules/.bin/atob b/node_modules/.bin/atob new file mode 120000 index 000000000..a68344a38 --- /dev/null +++ b/node_modules/.bin/atob @@ -0,0 +1 @@ +../atob/bin/atob.js \ No newline at end of file diff --git a/node_modules/.bin/browser-pack b/node_modules/.bin/browser-pack new file mode 120000 index 000000000..1d047b955 --- /dev/null +++ b/node_modules/.bin/browser-pack @@ -0,0 +1 @@ +../browser-pack/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/browserify b/node_modules/.bin/browserify new file mode 120000 index 000000000..ab156b35c --- /dev/null +++ b/node_modules/.bin/browserify @@ -0,0 +1 @@ +../browserify/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/budo b/node_modules/.bin/budo new file mode 120000 index 000000000..da99a43b5 --- /dev/null +++ b/node_modules/.bin/budo @@ -0,0 +1 @@ +../budo/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/deps-sort b/node_modules/.bin/deps-sort new file mode 120000 index 000000000..b2dda9ef1 --- /dev/null +++ b/node_modules/.bin/deps-sort @@ -0,0 +1 @@ +../deps-sort/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/detective b/node_modules/.bin/detective new file mode 120000 index 000000000..8c3093afd --- /dev/null +++ b/node_modules/.bin/detective @@ -0,0 +1 @@ +../detective/bin/detective.js \ No newline at end of file diff --git a/node_modules/.bin/garnish b/node_modules/.bin/garnish new file mode 120000 index 000000000..facb2e0eb --- /dev/null +++ b/node_modules/.bin/garnish @@ -0,0 +1 @@ +../garnish/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/has-ansi b/node_modules/.bin/has-ansi new file mode 120000 index 000000000..c1e7413f1 --- /dev/null +++ b/node_modules/.bin/has-ansi @@ -0,0 +1 @@ +../has-ansi/cli.js \ No newline at end of file diff --git a/node_modules/.bin/insert-module-globals b/node_modules/.bin/insert-module-globals new file mode 120000 index 000000000..68af3a916 --- /dev/null +++ b/node_modules/.bin/insert-module-globals @@ -0,0 +1 @@ +../insert-module-globals/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/miller-rabin b/node_modules/.bin/miller-rabin new file mode 120000 index 000000000..c175fe9f9 --- /dev/null +++ b/node_modules/.bin/miller-rabin @@ -0,0 +1 @@ +../miller-rabin/bin/miller-rabin \ No newline at end of file diff --git a/node_modules/.bin/mime b/node_modules/.bin/mime new file mode 120000 index 000000000..fbb7ee0ee --- /dev/null +++ b/node_modules/.bin/mime @@ -0,0 +1 @@ +../mime/cli.js \ No newline at end of file diff --git a/node_modules/.bin/mkdirp b/node_modules/.bin/mkdirp new file mode 120000 index 000000000..017896ceb --- /dev/null +++ b/node_modules/.bin/mkdirp @@ -0,0 +1 @@ +../mkdirp/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/module-deps b/node_modules/.bin/module-deps new file mode 120000 index 000000000..66a1f2461 --- /dev/null +++ b/node_modules/.bin/module-deps @@ -0,0 +1 @@ +../module-deps/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver new file mode 120000 index 000000000..317eb293d --- /dev/null +++ b/node_modules/.bin/semver @@ -0,0 +1 @@ +../semver/bin/semver \ No newline at end of file diff --git a/node_modules/.bin/sha.js b/node_modules/.bin/sha.js new file mode 120000 index 000000000..3c761051a --- /dev/null +++ b/node_modules/.bin/sha.js @@ -0,0 +1 @@ +../sha.js/bin.js \ No newline at end of file diff --git a/node_modules/.bin/supports-color b/node_modules/.bin/supports-color new file mode 120000 index 000000000..af0f05efe --- /dev/null +++ b/node_modules/.bin/supports-color @@ -0,0 +1 @@ +../supports-color/cli.js \ No newline at end of file diff --git a/node_modules/.bin/umd b/node_modules/.bin/umd new file mode 120000 index 000000000..69767ed8c --- /dev/null +++ b/node_modules/.bin/umd @@ -0,0 +1 @@ +../umd/bin/cli.js \ No newline at end of file diff --git a/node_modules/.bin/undeclared-identifiers b/node_modules/.bin/undeclared-identifiers new file mode 120000 index 000000000..c95efdb46 --- /dev/null +++ b/node_modules/.bin/undeclared-identifiers @@ -0,0 +1 @@ +../undeclared-identifiers/bin.js \ No newline at end of file diff --git a/node_modules/.bin/watchify b/node_modules/.bin/watchify new file mode 120000 index 000000000..994b7318b --- /dev/null +++ b/node_modules/.bin/watchify @@ -0,0 +1 @@ +../watchify/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/which b/node_modules/.bin/which new file mode 120000 index 000000000..f62471c85 --- /dev/null +++ b/node_modules/.bin/which @@ -0,0 +1 @@ +../which/bin/which \ No newline at end of file diff --git a/node_modules/@babel/polyfill/LICENSE b/node_modules/@babel/polyfill/LICENSE new file mode 100644 index 000000000..620366eb9 --- /dev/null +++ b/node_modules/@babel/polyfill/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-2018 Sebastian McKenzie + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/polyfill/README.md b/node_modules/@babel/polyfill/README.md new file mode 100644 index 000000000..5f29e0f5a --- /dev/null +++ b/node_modules/@babel/polyfill/README.md @@ -0,0 +1,19 @@ +# @babel/polyfill + +> Provides polyfills necessary for a full ES2015+ environment + +See our website [@babel/polyfill](https://babeljs.io/docs/en/next/babel-polyfill.html) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20polyfill%22+is%3Aopen) associated with this package. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/polyfill +``` + +or using yarn: + +```sh +yarn add @babel/polyfill --dev +``` diff --git a/node_modules/@babel/polyfill/browser.js b/node_modules/@babel/polyfill/browser.js new file mode 100644 index 000000000..08a010af8 --- /dev/null +++ b/node_modules/@babel/polyfill/browser.js @@ -0,0 +1,3 @@ +!function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var c="function"==typeof require&&require;if(!u&&c)return c(o,!0);if(i)return i(o,!0);var a=new Error("Cannot find module '"+o+"'");throw a.code="MODULE_NOT_FOUND",a}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(n){var r=t[o][1][n];return s(r||n)},f,f.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o2?arguments[2]:void 0,s=Math.min((void 0===f?u:i(f,u))-a,u-c),l=1;for(a0;)a in r?r[c]=r[a]:delete r[c],c+=l,a+=l;return r}},{110:110,114:114,115:115}],17:[function(t,n,r){"use strict";var e=t(115),i=t(110),o=t(114);n.exports=function fill(t){for(var n=e(this),r=o(n.length),u=arguments.length,c=i(u>1?arguments[1]:void 0,r),a=u>2?arguments[2]:void 0,f=void 0===a?r:i(a,r);f>c;)n[c++]=t;return n}},{110:110,114:114,115:115}],18:[function(t,n,r){var e=t(113),i=t(114),o=t(110);n.exports=function(t){return function(n,r,u){var c,a=e(n),f=i(a.length),s=o(u,f);if(t&&r!=r){for(;f>s;)if((c=a[s++])!=c)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===r)return t||s||0;return!t&&-1}}},{110:110,113:113,114:114}],19:[function(t,n,r){var e=t(31),i=t(52),o=t(115),u=t(114),c=t(22);n.exports=function(t,n){var r=1==t,a=2==t,f=3==t,s=4==t,l=6==t,h=5==t||l,p=n||c;return function(n,c,v){for(var y,d,g=o(n),m=i(g),x=e(c,v,3),b=u(m.length),w=0,S=r?p(n,b):a?p(n,0):void 0;b>w;w++)if((h||w in m)&&(y=m[w],d=x(y,w,g),t))if(r)S[w]=d;else if(d)switch(t){case 3:return!0;case 5:return y;case 6:return w;case 2:S.push(y)}else if(s)return!1;return l?-1:f||s?s:S}}},{114:114,115:115,22:22,31:31,52:52}],20:[function(t,n,r){var e=t(11),i=t(115),o=t(52),u=t(114);n.exports=function(t,n,r,c,a){e(n);var f=i(t),s=o(f),l=u(f.length),h=a?l-1:0,p=a?-1:1;if(r<2)for(;;){if(h in s){c=s[h],h+=p;break}if(h+=p,a?h<0:l<=h)throw TypeError("Reduce of empty array with no initial value")}for(;a?h>=0:l>h;h+=p)h in s&&(c=n(c,s[h],h,f));return c}},{11:11,114:114,115:115,52:52}],21:[function(t,n,r){var e=t(56),i=t(54),o=t(125)("species");n.exports=function(t){var n;return i(t)&&(n=t.constructor,"function"!=typeof n||n!==Array&&!i(n.prototype)||(n=void 0),e(n)&&null===(n=n[o])&&(n=void 0)),void 0===n?Array:n}},{125:125,54:54,56:56}],22:[function(t,n,r){var e=t(21);n.exports=function(t,n){return new(e(t))(n)}},{21:21}],23:[function(t,n,r){"use strict";var e=t(11),i=t(56),o=t(51),u=[].slice,c={},a=function(t,n,r){if(!(n in c)){for(var e=[],i=0;i1?arguments[1]:void 0,3);r=r?r.n:this._f;)for(e(r.v,r.k,this);r&&r.r;)r=r.p},has:function has(t){return!!d(v(this,n),t)}}),h&&e(s.prototype,"size",{get:function(){return v(this,n)[y]}}),s},def:function(t,n,r){var e,i,o=d(t,n);return o?o.v=r:(t._l=o={i:i=p(n,!0),k:n,v:r,p:e=t._l,n:void 0,r:!1},t._f||(t._f=o),e&&(e.n=o),t[y]++,"F"!==i&&(t._i[i]=o)),t},getEntry:d,setStrong:function(t,n,r){f(t,n,function(t,r){this._t=v(t,n),this._k=r,this._l=void 0},function(){for(var t=this,n=t._k,r=t._l;r&&r.r;)r=r.p;return t._t&&(t._l=r=r?r.n:t._t._f)?"keys"==n?s(0,r.k):"values"==n?s(0,r.v):s(0,[r.k,r.v]):(t._t=void 0,s(1))},r?"entries":"values",!r,!0),l(n)}}},{122:122,14:14,31:31,35:35,44:44,60:60,62:62,69:69,73:73,74:74,92:92,96:96}],27:[function(t,n,r){"use strict";var e=t(92),i=t(69).getWeak,o=t(15),u=t(56),c=t(14),a=t(44),f=t(19),s=t(46),l=t(122),h=f(5),p=f(6),v=0,y=function(t){return t._l||(t._l=new d)},d=function(){this.a=[]},g=function(t,n){return h(t.a,function(t){return t[0]===n})};d.prototype={get:function(t){var n=g(this,t);if(n)return n[1]},has:function(t){return!!g(this,t)},set:function(t,n){var r=g(this,t);r?r[1]=n:this.a.push([t,n])},delete:function(t){var n=p(this.a,function(n){return n[0]===t});return~n&&this.a.splice(n,1),!!~n}},n.exports={getConstructor:function(t,n,r,o){var f=t(function(t,e){c(t,f,n,"_i"),t._t=n,t._i=v++,t._l=void 0,void 0!=e&&a(e,r,t[o],t)});return e(f.prototype,{delete:function(t){if(!u(t))return!1;var r=i(t);return!0===r?y(l(this,n)).delete(t):r&&s(r,this._i)&&delete r[this._i]},has:function has(t){if(!u(t))return!1;var r=i(t);return!0===r?y(l(this,n)).has(t):r&&s(r,this._i)}}),f},def:function(t,n,r){var e=i(o(n),!0);return!0===e?y(t).set(n,r):e[t._i]=r,t},ufstore:y}},{122:122,14:14,15:15,19:19,44:44,46:46,56:56,69:69,92:92}],28:[function(t,n,r){"use strict";var e=t(45),i=t(39),o=t(93),u=t(92),c=t(69),a=t(44),f=t(14),s=t(56),l=t(41),h=t(61),p=t(97),v=t(50);n.exports=function(t,n,r,y,d,g){var m=e[t],x=m,b=d?"set":"add",w=x&&x.prototype,S={},_=function(t){var n=w[t];o(w,t,"delete"==t?function(t){return!(g&&!s(t))&&n.call(this,0===t?0:t)}:"has"==t?function has(t){return!(g&&!s(t))&&n.call(this,0===t?0:t)}:"get"==t?function get(t){return g&&!s(t)?void 0:n.call(this,0===t?0:t)}:"add"==t?function add(t){return n.call(this,0===t?0:t),this}:function set(t,r){return n.call(this,0===t?0:t,r),this})};if("function"==typeof x&&(g||w.forEach&&!l(function(){(new x).entries().next()}))){var E=new x,F=E[b](g?{}:-0,1)!=E,O=l(function(){E.has(1)}),P=h(function(t){new x(t)}),I=!g&&l(function(){for(var t=new x,n=5;n--;)t[b](n,n);return!t.has(-0)});P||(x=n(function(n,r){f(n,x,t);var e=v(new m,n,x);return void 0!=r&&a(r,d,e[b],e),e}),x.prototype=w,w.constructor=x),(O||I)&&(_("delete"),_("has"),d&&_("get")),(I||F)&&_(b),g&&w.clear&&delete w.clear}else x=y.getConstructor(n,t,d,b),u(x.prototype,r),c.NEED=!0;return p(x,t),S[t]=x,i(i.G+i.W+i.F*(x!=m),S),g||y.setStrong(x,t,d),x}},{14:14,39:39,41:41,44:44,45:45,50:50,56:56,61:61,69:69,92:92,93:93,97:97}],29:[function(t,n,r){var e=n.exports={version:"2.5.7"};"number"==typeof __e&&(__e=e)},{}],30:[function(t,n,r){"use strict";var e=t(74),i=t(91);n.exports=function(t,n,r){n in t?e.f(t,n,i(0,r)):t[n]=r}},{74:74,91:91}],31:[function(t,n,r){var e=t(11);n.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,i){return t.call(n,r,e,i)}}return function(){return t.apply(n,arguments)}}},{11:11}],32:[function(t,n,r){"use strict";var e=t(41),i=Date.prototype.getTime,o=Date.prototype.toISOString,u=function(t){return t>9?t:"0"+t};n.exports=e(function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-5e13-1))})||!e(function(){o.call(new Date(NaN))})?function toISOString(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var t=this,n=t.getUTCFullYear(),r=t.getUTCMilliseconds(),e=n<0?"-":n>9999?"+":"";return e+("00000"+Math.abs(n)).slice(e?-6:-4)+"-"+u(t.getUTCMonth()+1)+"-"+u(t.getUTCDate())+"T"+u(t.getUTCHours())+":"+u(t.getUTCMinutes())+":"+u(t.getUTCSeconds())+"."+(r>99?r:"0"+u(r))+"Z"}:o},{41:41}],33:[function(t,n,r){"use strict";var e=t(15),i=t(116);n.exports=function(t){if("string"!==t&&"number"!==t&&"default"!==t)throw TypeError("Incorrect hint");return i(e(this),"number"!=t)}},{116:116,15:15}],34:[function(t,n,r){n.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},{}],35:[function(t,n,r){n.exports=!t(41)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{41:41}],36:[function(t,n,r){var e=t(56),i=t(45).document,o=e(i)&&e(i.createElement);n.exports=function(t){return o?i.createElement(t):{}}},{45:45,56:56}],37:[function(t,n,r){n.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],38:[function(t,n,r){var e=t(82),i=t(79),o=t(83);n.exports=function(t){var n=e(t),r=i.f;if(r)for(var u,c=r(t),a=o.f,f=0;c.length>f;)a.call(t,u=c[f++])&&n.push(u);return n}},{79:79,82:82,83:83}],39:[function(t,n,r){var e=t(45),i=t(29),o=t(47),u=t(93),c=t(31),a=function(t,n,r){var f,s,l,h,p=t&a.F,v=t&a.G,y=t&a.S,d=t&a.P,g=t&a.B,m=v?e:y?e[n]||(e[n]={}):(e[n]||{}).prototype,x=v?i:i[n]||(i[n]={}),b=x.prototype||(x.prototype={});v&&(r=n);for(f in r)s=!p&&m&&void 0!==m[f],l=(s?m:r)[f],h=g&&s?c(l,e):d&&"function"==typeof l?c(Function.call,l):l,m&&u(m,f,l,t&a.U),x[f]!=l&&o(x,f,h),d&&b[f]!=l&&(b[f]=l)};e.core=i,a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,n.exports=a},{29:29,31:31,45:45,47:47,93:93}],40:[function(t,n,r){var e=t(125)("match");n.exports=function(t){var n=/./;try{"/./"[t](n)}catch(r){try{return n[e]=!1,!"/./"[t](n)}catch(t){}}return!0}},{125:125}],41:[function(t,n,r){n.exports=function(t){try{return!!t()}catch(t){return!0}}},{}],42:[function(t,n,r){"use strict";var e=t(47),i=t(93),o=t(41),u=t(34),c=t(125);n.exports=function(t,n,r){var a=c(t),f=r(u,a,""[t]),s=f[0],l=f[1];o(function(){var n={};return n[a]=function(){return 7},7!=""[t](n)})&&(i(String.prototype,t,s),e(RegExp.prototype,a,2==n?function(t,n){return l.call(t,this,n)}:function(t){return l.call(t,this)}))}},{125:125,34:34,41:41,47:47,93:93}],43:[function(t,n,r){"use strict";var e=t(15);n.exports=function(){var t=e(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}},{15:15}],44:[function(t,n,r){var e=t(31),i=t(58),o=t(53),u=t(15),c=t(114),a=t(126),f={},s={},r=n.exports=function(t,n,r,l,h){var p,v,y,d,g=h?function(){return t}:a(t),m=e(r,l,n?2:1),x=0;if("function"!=typeof g)throw TypeError(t+" is not iterable!");if(o(g)){for(p=c(t.length);p>x;x++)if((d=n?m(u(v=t[x])[0],v[1]):m(t[x]))===f||d===s)return d}else for(y=g.call(t);!(v=y.next()).done;)if((d=i(y,m,v.value,n))===f||d===s)return d};r.BREAK=f,r.RETURN=s},{114:114,126:126,15:15,31:31,53:53,58:58}],45:[function(t,n,r){var e=n.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},{}],46:[function(t,n,r){var e={}.hasOwnProperty;n.exports=function(t,n){return e.call(t,n)}},{}],47:[function(t,n,r){var e=t(74),i=t(91);n.exports=t(35)?function(t,n,r){return e.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},{35:35,74:74,91:91}],48:[function(t,n,r){var e=t(45).document;n.exports=e&&e.documentElement},{45:45}],49:[function(t,n,r){n.exports=!t(35)&&!t(41)(function(){return 7!=Object.defineProperty(t(36)("div"),"a",{get:function(){return 7}}).a})},{35:35,36:36,41:41}],50:[function(t,n,r){var e=t(56),i=t(95).set;n.exports=function(t,n,r){var o,u=n.constructor;return u!==r&&"function"==typeof u&&(o=u.prototype)!==r.prototype&&e(o)&&i&&i(t,o),t}},{56:56,95:95}],51:[function(t,n,r){n.exports=function(t,n,r){var e=void 0===r;switch(n.length){case 0:return e?t():t.call(r);case 1:return e?t(n[0]):t.call(r,n[0]);case 2:return e?t(n[0],n[1]):t.call(r,n[0],n[1]);case 3:return e?t(n[0],n[1],n[2]):t.call(r,n[0],n[1],n[2]);case 4:return e?t(n[0],n[1],n[2],n[3]):t.call(r,n[0],n[1],n[2],n[3])}return t.apply(r,n)}},{}],52:[function(t,n,r){var e=t(25);n.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}},{25:25}],53:[function(t,n,r){var e=t(63),i=t(125)("iterator"),o=Array.prototype;n.exports=function(t){return void 0!==t&&(e.Array===t||o[i]===t)}},{125:125,63:63}],54:[function(t,n,r){var e=t(25);n.exports=Array.isArray||function isArray(t){return"Array"==e(t)}},{25:25}],55:[function(t,n,r){var e=t(56),i=Math.floor;n.exports=function isInteger(t){return!e(t)&&isFinite(t)&&i(t)===t}},{56:56}],56:[function(t,n,r){n.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},{}],57:[function(t,n,r){var e=t(56),i=t(25),o=t(125)("match");n.exports=function(t){var n;return e(t)&&(void 0!==(n=t[o])?!!n:"RegExp"==i(t))}},{125:125,25:25,56:56}],58:[function(t,n,r){var e=t(15);n.exports=function(t,n,r,i){try{return i?n(e(r)[0],r[1]):n(r)}catch(n){var o=t.return;throw void 0!==o&&e(o.call(t)),n}}},{15:15}],59:[function(t,n,r){"use strict";var e=t(73),i=t(91),o=t(97),u={};t(47)(u,t(125)("iterator"),function(){return this}),n.exports=function(t,n,r){t.prototype=e(u,{next:i(1,r)}),o(t,n+" Iterator")}},{125:125,47:47,73:73,91:91,97:97}],60:[function(t,n,r){"use strict";var e=t(64),i=t(39),o=t(93),u=t(47),c=t(63),a=t(59),f=t(97),s=t(80),l=t(125)("iterator"),h=!([].keys&&"next"in[].keys()),p=function(){return this};n.exports=function(t,n,r,v,y,d,g){a(r,n,v);var m,x,b,w=function(t){if(!h&&t in F)return F[t];switch(t){case"keys":return function keys(){return new r(this,t)};case"values":return function values(){return new r(this,t)}}return function entries(){return new r(this,t)}},S=n+" Iterator",_="values"==y,E=!1,F=t.prototype,O=F[l]||F["@@iterator"]||y&&F[y],P=O||w(y),I=y?_?w("entries"):P:void 0,A="Array"==n?F.entries||O:O;if(A&&(b=s(A.call(new t)))!==Object.prototype&&b.next&&(f(b,S,!0),e||"function"==typeof b[l]||u(b,l,p)),_&&O&&"values"!==O.name&&(E=!0,P=function values(){return O.call(this)}),e&&!g||!h&&!E&&F[l]||u(F,l,P),c[n]=P,c[S]=p,y)if(m={values:_?P:w("values"),keys:d?P:w("keys"),entries:I},g)for(x in m)x in F||o(F,x,m[x]);else i(i.P+i.F*(h||E),n,m);return m}},{125:125,39:39,47:47,59:59,63:63,64:64,80:80,93:93,97:97}],61:[function(t,n,r){var e=t(125)("iterator"),i=!1;try{var o=[7][e]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(t){}n.exports=function(t,n){if(!n&&!i)return!1;var r=!1;try{var o=[7],u=o[e]();u.next=function(){return{done:r=!0}},o[e]=function(){return u},t(o)}catch(t){}return r}},{125:125}],62:[function(t,n,r){n.exports=function(t,n){return{value:n,done:!!t}}},{}],63:[function(t,n,r){n.exports={}},{}],64:[function(t,n,r){n.exports=!1},{}],65:[function(t,n,r){var e=Math.expm1;n.exports=!e||e(10)>22025.465794806718||e(10)<22025.465794806718||-2e-17!=e(-2e-17)?function expm1(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:e},{}],66:[function(t,n,r){var e=t(68),i=Math.pow,o=i(2,-52),u=i(2,-23),c=i(2,127)*(2-u),a=i(2,-126),f=function(t){return t+1/o-1/o};n.exports=Math.fround||function fround(t){var n,r,i=Math.abs(t),s=e(t);return ic||r!=r?s*(1/0):s*r)}},{68:68}],67:[function(t,n,r){n.exports=Math.log1p||function log1p(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},{}],68:[function(t,n,r){n.exports=Math.sign||function sign(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},{}],69:[function(t,n,r){var e=t(120)("meta"),i=t(56),o=t(46),u=t(74).f,c=0,a=Object.isExtensible||function(){return!0},f=!t(41)(function(){return a(Object.preventExtensions({}))}),s=function(t){u(t,e,{value:{i:"O"+ ++c,w:{}}})},l=function(t,n){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,e)){if(!a(t))return"F";if(!n)return"E";s(t)}return t[e].i},h=function(t,n){if(!o(t,e)){if(!a(t))return!0;if(!n)return!1;s(t)}return t[e].w},p=function(t){return f&&v.NEED&&a(t)&&!o(t,e)&&s(t),t},v=n.exports={KEY:e,NEED:!1,fastKey:l,getWeak:h,onFreeze:p}},{120:120,41:41,46:46,56:56,74:74}],70:[function(t,n,r){var e=t(45),i=t(109).set,o=e.MutationObserver||e.WebKitMutationObserver,u=e.process,c=e.Promise,a="process"==t(25)(u);n.exports=function(){var t,n,r,f=function(){var e,i;for(a&&(e=u.domain)&&e.exit();t;){i=t.fn,t=t.next;try{i()}catch(e){throw t?r():n=void 0,e}}n=void 0,e&&e.enter()};if(a)r=function(){u.nextTick(f)};else if(!o||e.navigator&&e.navigator.standalone)if(c&&c.resolve){var s=c.resolve(void 0);r=function(){s.then(f)}}else r=function(){i.call(e,f)};else{var l=!0,h=document.createTextNode("");new o(f).observe(h,{characterData:!0}),r=function(){h.data=l=!l}}return function(e){var i={fn:e,next:void 0};n&&(n.next=i),t||(t=i,r()),n=i}}},{109:109,25:25,45:45}],71:[function(t,n,r){"use strict";function PromiseCapability(t){var n,r;this.promise=new t(function(t,e){if(void 0!==n||void 0!==r)throw TypeError("Bad Promise constructor");n=t,r=e}),this.resolve=e(n),this.reject=e(r)}var e=t(11);n.exports.f=function(t){return new PromiseCapability(t)}},{11:11}],72:[function(t,n,r){"use strict";var e=t(82),i=t(79),o=t(83),u=t(115),c=t(52),a=Object.assign;n.exports=!a||t(41)(function(){var t={},n={},r=Symbol(),e="abcdefghijklmnopqrst";return t[r]=7,e.split("").forEach(function(t){n[t]=t}),7!=a({},t)[r]||Object.keys(a({},n)).join("")!=e})?function assign(t,n){for(var r=u(t),a=arguments.length,f=1,s=i.f,l=o.f;a>f;)for(var h,p=c(arguments[f++]),v=s?e(p).concat(s(p)):e(p),y=v.length,d=0;y>d;)l.call(p,h=v[d++])&&(r[h]=p[h]);return r}:a},{115:115,41:41,52:52,79:79,82:82,83:83}],73:[function(t,n,r){var e=t(15),i=t(75),o=t(37),u=t(98)("IE_PROTO"),c=function(){},a=function(){var n,r=t(36)("iframe"),e=o.length;for(r.style.display="none",t(48).appendChild(r),r.src="javascript:",n=r.contentWindow.document,n.open(),n.write(" + diff --git a/node_modules/browserify/example/multiple_bundles/static/boop.html b/node_modules/browserify/example/multiple_bundles/static/boop.html new file mode 100644 index 000000000..13dab7e84 --- /dev/null +++ b/node_modules/browserify/example/multiple_bundles/static/boop.html @@ -0,0 +1,2 @@ + + diff --git a/node_modules/browserify/example/source_maps/build.js b/node_modules/browserify/example/source_maps/build.js new file mode 100644 index 000000000..e65bc7e62 --- /dev/null +++ b/node_modules/browserify/example/source_maps/build.js @@ -0,0 +1,13 @@ +var browserify = require('../..'), + path = require('path'), + fs = require('fs'), + bundlePath = path.join(__dirname, 'js', 'build', 'bundle.js'); + +browserify() + .require(require.resolve('./js/main.js'), { + entry: true, + debug: true + }) + .bundle() + .on('error', function (err) { console.error(err); }) + .pipe(fs.createWriteStream(bundlePath)); diff --git a/node_modules/browserify/example/source_maps/build.sh b/node_modules/browserify/example/source_maps/build.sh new file mode 100755 index 000000000..6ae19fb06 --- /dev/null +++ b/node_modules/browserify/example/source_maps/build.sh @@ -0,0 +1,4 @@ +#!/bin/bash +../../bin/cmd.js --debug -e ./js/main.js > js/build/bundle.js + +echo bundle was generated with source maps, you can now open index.html diff --git a/node_modules/browserify/example/source_maps/index.html b/node_modules/browserify/example/source_maps/index.html new file mode 100644 index 000000000..d06c889dd --- /dev/null +++ b/node_modules/browserify/example/source_maps/index.html @@ -0,0 +1,11 @@ + + + + + + + + +

Open your dev tools ;)

+ + diff --git a/node_modules/browserify/example/source_maps/js/build/.npmignore b/node_modules/browserify/example/source_maps/js/build/.npmignore new file mode 100644 index 000000000..f935021a8 --- /dev/null +++ b/node_modules/browserify/example/source_maps/js/build/.npmignore @@ -0,0 +1 @@ +!.gitignore diff --git a/node_modules/browserify/example/source_maps/js/build/bundle.js b/node_modules/browserify/example/source_maps/js/build/bundle.js new file mode 100644 index 000000000..a807c46f8 --- /dev/null +++ b/node_modules/browserify/example/source_maps/js/build/bundle.js @@ -0,0 +1,28 @@ +;(function(e,t,n,r){function i(r){if(!n[r]){if(!t[r]){if(e)return e(r);throw new Error("Cannot find module '"+r+"'")}var s=n[r]={exports:{}};t[r][0](function(e){var n=t[r][1][e];return i(n?n:e)},s,s.exports)}return n[r].exports}for(var s=0;s= 0) return next(); + if (self._external.indexOf(row.file) >= 0) return next(); + + if (isAbsolutePath(row.id)) { + row.id = '/' + relativePath(basedir, row.file); + } + Object.keys(row.deps || {}).forEach(function (key) { + row.deps[key] = '/' + relativePath(basedir, row.deps[key]); + }); + this.push(row); + next(); + })); + } + return pipeline; +}; + +Browserify.prototype._createDeps = function (opts) { + var self = this; + var mopts = xtend(opts); + var basedir = defined(opts.basedir, process.cwd()); + + // Let mdeps populate these values since it will be resolving file paths + // anyway. + mopts.expose = this._expose; + mopts.extensions = [ '.js', '.json' ].concat(mopts.extensions || []); + self._extensions = mopts.extensions; + + mopts.transform = []; + mopts.transformKey = defined(opts.transformKey, [ 'browserify', 'transform' ]); + mopts.postFilter = function (id, file, pkg) { + if (opts.postFilter && !opts.postFilter(id, file, pkg)) return false; + if (self._external.indexOf(file) >= 0) return false; + if (self._exclude.indexOf(file) >= 0) return false; + + //filter transforms on module dependencies + if (pkg && pkg.browserify && pkg.browserify.transform) { + //In edge cases it may be a string + pkg.browserify.transform = [].concat(pkg.browserify.transform) + .filter(Boolean) + .filter(self._filterTransform); + } + return true; + }; + mopts.filter = function (id) { + if (opts.filter && !opts.filter(id)) return false; + if (self._external.indexOf(id) >= 0) return false; + if (self._exclude.indexOf(id) >= 0) return false; + if (opts.bundleExternal === false && isExternalModule(id)) { + return false; + } + return true; + }; + mopts.resolve = function (id, parent, cb) { + if (self._ignore.indexOf(id) >= 0) return cb(null, paths.empty, {}); + + self._bresolve(id, parent, function (err, file, pkg) { + if (file && self._ignore.indexOf(file) >= 0) { + return cb(null, paths.empty, {}); + } + if (file && self._ignore.length) { + var nm = file.replace(/\\/g, '/').split('/node_modules/')[1]; + if (nm) { + nm = nm.split('/')[0]; + if (self._ignore.indexOf(nm) >= 0) { + return cb(null, paths.empty, {}); + } + } + } + + if (file) { + var ex = '/' + relativePath(basedir, file); + if (self._external.indexOf(ex) >= 0) { + return cb(null, ex); + } + if (self._exclude.indexOf(ex) >= 0) { + return cb(null, ex); + } + if (self._ignore.indexOf(ex) >= 0) { + return cb(null, paths.empty, {}); + } + } + if (err) cb(err, file, pkg) + else if (file) { + if (opts.preserveSymlinks && parent.id !== self._mdeps.top.id) { + return cb(err, path.resolve(file), pkg, file) + } + + fs.realpath(file, function (err, res) { + cb(err, res, pkg, file); + }); + } else cb(err, null, pkg) + }); + }; + + if (opts.builtins === false) { + mopts.modules = {}; + self._exclude.push.apply(self._exclude, Object.keys(builtins)); + } + else if (opts.builtins && isArray(opts.builtins)) { + mopts.modules = {}; + opts.builtins.forEach(function (key) { + mopts.modules[key] = builtins[key]; + }); + } + else if (opts.builtins && typeof opts.builtins === 'object') { + mopts.modules = opts.builtins; + } + else mopts.modules = xtend(builtins); + + Object.keys(builtins).forEach(function (key) { + if (!has(mopts.modules, key)) self._exclude.push(key); + }); + + mopts.globalTransform = []; + if (!this._bundled) { + this.once('bundle', function () { + self.pipeline.write({ + transform: globalTr, + global: true, + options: {} + }); + }); + } + + var no = [].concat(opts.noParse).filter(Boolean); + var absno = no.filter(function(x) { + return typeof x === 'string'; + }).map(function (x) { + return path.resolve(basedir, x); + }); + + function globalTr (file) { + if (opts.detectGlobals === false) return through(); + + if (opts.noParse === true) return through(); + if (no.indexOf(file) >= 0) return through(); + if (absno.indexOf(file) >= 0) return through(); + + var parts = file.replace(/\\/g, '/').split('/node_modules/'); + for (var i = 0; i < no.length; i++) { + if (typeof no[i] === 'function' && no[i](file)) { + return through(); + } + else if (no[i] === parts[parts.length-1].split('/')[0]) { + return through(); + } + else if (no[i] === parts[parts.length-1]) { + return through(); + } + } + + if (opts.commondir === false && opts.builtins === false) { + opts.insertGlobalVars = xtend({ + __dirname: function(file, basedir) { + var dir = path.dirname(path.relative(basedir, file)); + return 'require("path").join(__dirname,' + dir.split(path.sep).map(JSON.stringify).join(',') + ')'; + }, + __filename: function(file, basedir) { + var filename = path.relative(basedir, file); + return 'require("path").join(__dirname,' + filename.split(path.sep).map(JSON.stringify).join(',') + ')'; + } + }, opts.insertGlobalVars); + } + + var vars = xtend({ + process: function () { return "require('_process')" }, + }, opts.insertGlobalVars); + + if (opts.bundleExternal === false) { + vars.process = undefined; + vars.buffer = undefined; + } + + return insertGlobals(file, xtend(opts, { + debug: opts.debug, + always: opts.insertGlobals, + basedir: opts.commondir === false && isArray(opts.builtins) + ? '/' + : opts.basedir || process.cwd() + , + vars: vars + })); + } + return mdeps(mopts); +}; + +Browserify.prototype._recorder = function (opts) { + var self = this; + var ended = false; + this._recorded = []; + + if (!this._ticked) { + process.nextTick(function () { + self._ticked = true; + self._recorded.forEach(function (row) { + stream.push(row); + }); + if (ended) stream.push(null); + }); + } + + var stream = through.obj(write, end); + return stream; + + function write (row, enc, next) { + self._recorded.push(row); + if (self._ticked) this.push(row); + next(); + } + function end () { + ended = true; + if (self._ticked) this.push(null); + } +}; + +Browserify.prototype._json = function () { + return through.obj(function (row, enc, next) { + if (/\.json$/.test(row.file)) { + row.source = 'module.exports=' + sanitize(row.source); + } + this.push(row); + next(); + }); +}; + +Browserify.prototype._unbom = function () { + return through.obj(function (row, enc, next) { + if (/^\ufeff/.test(row.source)) { + row.source = row.source.replace(/^\ufeff/, ''); + } + this.push(row); + next(); + }); +}; + +Browserify.prototype._unshebang = function () { + return through.obj(function (row, enc, next) { + if (/^#!/.test(row.source)) { + row.source = row.source.replace(/^#![^\n]*\n/, ''); + } + this.push(row); + next(); + }); +}; + +Browserify.prototype._syntax = function () { + var self = this; + return through.obj(function (row, enc, next) { + var h = shasum(row.source); + if (typeof self._syntaxCache[h] === 'undefined') { + var err = syntaxError(row.source, row.file || row.id); + if (err) return this.emit('error', err); + self._syntaxCache[h] = true; + } + this.push(row); + next(); + }); +}; + +Browserify.prototype._dedupe = function () { + return through.obj(function (row, enc, next) { + if (!row.dedupeIndex && row.dedupe) { + row.source = 'arguments[4][' + + JSON.stringify(row.dedupe) + + '][0].apply(exports,arguments)' + ; + row.nomap = true; + } + else if (row.dedupeIndex) { + row.source = 'arguments[4][' + + JSON.stringify(row.dedupeIndex) + + '][0].apply(exports,arguments)' + ; + row.nomap = true; + } + if (row.dedupeIndex && row.indexDeps) { + row.indexDeps.dup = row.dedupeIndex; + } + this.push(row); + next(); + }); +}; + +Browserify.prototype._label = function (opts) { + var self = this; + var basedir = defined(opts.basedir, process.cwd()); + + return through.obj(function (row, enc, next) { + var prev = row.id; + + if (self._external.indexOf(row.id) >= 0) return next(); + if (self._external.indexOf('/' + relativePath(basedir, row.id)) >= 0) { + return next(); + } + if (self._external.indexOf(row.file) >= 0) return next(); + + if (row.index) row.id = row.index; + + self.emit('label', prev, row.id); + if (row.indexDeps) row.deps = row.indexDeps || {}; + + Object.keys(row.deps).forEach(function (key) { + if (self._expose[key]) { + row.deps[key] = key; + return; + } + + var afile = path.resolve(path.dirname(row.file), key); + var rfile = '/' + relativePath(basedir, afile); + if (self._external.indexOf(rfile) >= 0) { + row.deps[key] = rfile; + } + if (self._external.indexOf(afile) >= 0) { + row.deps[key] = rfile; + } + if (self._external.indexOf(key) >= 0) { + row.deps[key] = key; + return; + } + + for (var i = 0; i < self._extensions.length; i++) { + var ex = self._extensions[i]; + if (self._external.indexOf(rfile + ex) >= 0) { + row.deps[key] = rfile + ex; + break; + } + } + }); + + if (row.entry || row.expose) { + self._bpack.standaloneModule = row.id; + } + this.push(row); + next(); + }); +}; + +Browserify.prototype._emitDeps = function () { + var self = this; + return through.obj(function (row, enc, next) { + self.emit('dep', row); + this.push(row); + next(); + }) +}; + +Browserify.prototype._debug = function (opts) { + var basedir = defined(opts.basedir, process.cwd()); + return through.obj(function (row, enc, next) { + if (opts.debug) { + row.sourceRoot = 'file://localhost'; + row.sourceFile = relativePath(basedir, row.file); + } + this.push(row); + next(); + }); +}; + +Browserify.prototype.reset = function (opts) { + if (!opts) opts = {}; + var hadExports = this._bpack.hasExports; + this.pipeline = this._createPipeline(xtend(opts, this._options)); + this._bpack.hasExports = hadExports; + this._entryOrder = 0; + this._bundled = false; + this.emit('reset'); +}; + +Browserify.prototype.bundle = function (cb) { + var self = this; + if (cb && typeof cb === 'object') { + throw new Error( + 'bundle() no longer accepts option arguments.\n' + + 'Move all option arguments to the browserify() constructor.' + ); + } + if (this._bundled) { + var recorded = this._recorded; + this.reset(); + recorded.forEach(function (x) { + self.pipeline.write(x); + }); + } + var output = readonly(this.pipeline); + if (cb) { + output.on('error', cb); + output.pipe(concat(function (body) { + cb(null, body); + })); + } + + function ready () { + self.emit('bundle', output); + self.pipeline.end(); + } + + if (this._pending === 0) ready(); + else this.once('_ready', ready); + + this._bundled = true; + return output; +}; + +function isStream (s) { return s && typeof s.pipe === 'function' } +function isAbsolutePath (file) { + var regexp = process.platform === 'win32' ? + /^\w:/ : + /^\//; + return regexp.test(file); +} +function isExternalModule (file) { + var regexp = process.platform === 'win32' ? + /^(\.|\w:)/ : + /^[\/.]/; + return !regexp.test(file); +} +function relativePath (from, to) { + // Replace \ with / for OS-independent behavior + return cachedPathRelative(from, to).replace(/\\/g, '/'); +} diff --git a/node_modules/browserify/lib/_empty.js b/node_modules/browserify/lib/_empty.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/browserify/lib/builtins.js b/node_modules/browserify/lib/builtins.js new file mode 100644 index 000000000..3aaa280e6 --- /dev/null +++ b/node_modules/browserify/lib/builtins.js @@ -0,0 +1,40 @@ +exports.assert = require.resolve('assert/'); +exports.buffer = require.resolve('buffer/'); +exports.child_process = require.resolve('./_empty.js'); +exports.cluster = require.resolve('./_empty.js'); +exports.console = require.resolve('console-browserify'); +exports.constants = require.resolve('constants-browserify'); +exports.crypto = require.resolve('crypto-browserify'); +exports.dgram = require.resolve('./_empty.js'); +exports.dns = require.resolve('./_empty.js'); +exports.domain = require.resolve('domain-browser'); +exports.events = require.resolve('events/'); +exports.fs = require.resolve('./_empty.js'); +exports.http = require.resolve('stream-http'); +exports.https = require.resolve('https-browserify'); +exports.inspector = require.resolve('./_empty.js'); +exports.module = require.resolve('./_empty.js'); +exports.net = require.resolve('./_empty.js'); +exports.os = require.resolve('os-browserify/browser.js'); +exports.path = require.resolve('path-browserify'); +exports.perf_hooks = require.resolve('./_empty.js') +exports.punycode = require.resolve('punycode/'); +exports.querystring = require.resolve('querystring-es3/'); +exports.readline = require.resolve('./_empty.js'); +exports.repl = require.resolve('./_empty.js'); +exports.stream = require.resolve('stream-browserify'); +exports._stream_duplex = require.resolve('readable-stream/duplex.js'); +exports._stream_passthrough = require.resolve('readable-stream/passthrough.js'); +exports._stream_readable = require.resolve('readable-stream/readable.js'); +exports._stream_transform = require.resolve('readable-stream/transform.js'); +exports._stream_writable = require.resolve('readable-stream/writable.js'); +exports.string_decoder = require.resolve('string_decoder/'); +exports.sys = require.resolve('util/util.js'); +exports.timers = require.resolve('timers-browserify'); +exports.tls = require.resolve('./_empty.js'); +exports.tty = require.resolve('tty-browserify'); +exports.url = require.resolve('url/'); +exports.util = require.resolve('util/util.js'); +exports.vm = require.resolve('vm-browserify'); +exports.zlib = require.resolve('browserify-zlib'); +exports._process = require.resolve('process/browser'); diff --git a/node_modules/browserify/node_modules/events/.travis.yml b/node_modules/browserify/node_modules/events/.travis.yml new file mode 100644 index 000000000..54d7e0485 --- /dev/null +++ b/node_modules/browserify/node_modules/events/.travis.yml @@ -0,0 +1,11 @@ +sudo: false +language: node_js +node_js: + - '0.10' +script: + - npm test + - if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then npm run test:browsers; fi +env: + global: + - secure: XcBiD8yReflut9q7leKsigDZ0mI3qTKH+QrNVY8DaqlomJOZw8aOrVuX9Jz12l86ZJ41nbxmKnRNkFzcVr9mbP9YaeTb3DpeOBWmvaoSfud9Wnc16VfXtc1FCcwDhSVcSiM3UtnrmFU5cH+Dw1LPh5PbfylYOS/nJxUvG0FFLqI= + - secure: jNWtEbqhUdQ0xXDHvCYfUbKYeJCi6a7B4LsrcxYCyWWn4NIgncE5x2YbB+FSUUFVYfz0dsn5RKP1oHB99f0laUEo18HBNkrAS/rtyOdVzcpJjbQ6kgSILGjnJD/Ty1B57Rcz3iyev5Y7bLZ6Y1FbDnk/i9/l0faOGz8vTC3Vdkc= diff --git a/node_modules/browserify/node_modules/events/.zuul.yml b/node_modules/browserify/node_modules/events/.zuul.yml new file mode 100644 index 000000000..216b335e2 --- /dev/null +++ b/node_modules/browserify/node_modules/events/.zuul.yml @@ -0,0 +1,13 @@ +ui: mocha-qunit +concurrency: 1 +browsers: + - name: chrome + version: latest + - name: firefox + version: latest + - name: safari + version: 7..latest + - name: iphone + version: latest + - name: ie + version: 8..latest diff --git a/node_modules/browserify/node_modules/events/History.md b/node_modules/browserify/node_modules/events/History.md new file mode 100644 index 000000000..aa9af52ca --- /dev/null +++ b/node_modules/browserify/node_modules/events/History.md @@ -0,0 +1,58 @@ +# 2.1.0 (2018-05-25) + + - add Emitter#rawListeners from Node.js v9.4 + +# 2.0.0 (2018-02-02) + + - Update to events code from node.js 8.x + - Adds `prependListener()` and `prependOnceListener()` + - Adds `eventNames()` method + - (semver major) Unwrap `once()` listeners in `listeners()` + - copy tests from node.js + +Note that this version doubles the gzipped size, jumping from 1.1KB to 2.1KB, +due to new methods and runtime performance improvements. Be aware of that when +upgrading. + +# 1.1.1 (2016-06-22) + + - add more context to errors if they are not instanceof Error + +# 1.1.0 (2015-09-29) + + - add Emitter#listerCount (to match node v4 api) + +# 1.0.2 (2014-08-28) + + - remove un-reachable code + - update devDeps + +## 1.0.1 / 2014-05-11 + + - check for console.trace before using it + +## 1.0.0 / 2013-12-10 + + - Update to latest events code from node.js 0.10 + - copy tests from node.js + +## 0.4.0 / 2011-07-03 ## + + - Switching to graphquire@0.8.0 + +## 0.3.0 / 2011-07-03 ## + + - Switching to URL based module require. + +## 0.2.0 / 2011-06-10 ## + + - Simplified package structure. + - Graphquire for dependency management. + +## 0.1.1 / 2011-05-16 ## + + - Unhandled errors are logged via console.error + +## 0.1.0 / 2011-04-22 ## + + - Initial release diff --git a/node_modules/browserify/node_modules/events/LICENSE b/node_modules/browserify/node_modules/events/LICENSE new file mode 100644 index 000000000..52ed3b0a6 --- /dev/null +++ b/node_modules/browserify/node_modules/events/LICENSE @@ -0,0 +1,22 @@ +MIT + +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. diff --git a/node_modules/browserify/node_modules/events/Readme.md b/node_modules/browserify/node_modules/events/Readme.md new file mode 100644 index 000000000..4fae92256 --- /dev/null +++ b/node_modules/browserify/node_modules/events/Readme.md @@ -0,0 +1,21 @@ +# Status: [Maintainer Needed](https://github.com/Gozala/events/issues/43) + +# events [![Build Status](https://travis-ci.org/Gozala/events.png?branch=master)](https://travis-ci.org/Gozala/events) + +Node's event emitter for all engines. + +## Install ## + +``` +npm install events +``` + +## Require ## + +```javascript +var EventEmitter = require('events') +``` + +## Usage ## + +See the [node.js event emitter docs](http://nodejs.org/api/events.html) diff --git a/node_modules/browserify/node_modules/events/events.js b/node_modules/browserify/node_modules/events/events.js new file mode 100644 index 000000000..a17bcba6b --- /dev/null +++ b/node_modules/browserify/node_modules/events/events.js @@ -0,0 +1,523 @@ +// 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 objectCreate = Object.create || objectCreatePolyfill +var objectKeys = Object.keys || objectKeysPolyfill +var bind = Function.prototype.bind || functionBindPolyfill + +function EventEmitter() { + if (!this._events || !Object.prototype.hasOwnProperty.call(this, '_events')) { + this._events = objectCreate(null); + this._eventsCount = 0; + } + + this._maxListeners = this._maxListeners || undefined; +} +module.exports = EventEmitter; + +// Backwards-compat with node 0.10.x +EventEmitter.EventEmitter = EventEmitter; + +EventEmitter.prototype._events = undefined; +EventEmitter.prototype._maxListeners = undefined; + +// By default EventEmitters will print a warning if more than 10 listeners are +// added to it. This is a useful default which helps finding memory leaks. +var defaultMaxListeners = 10; + +var hasDefineProperty; +try { + var o = {}; + if (Object.defineProperty) Object.defineProperty(o, 'x', { value: 0 }); + hasDefineProperty = o.x === 0; +} catch (err) { hasDefineProperty = false } +if (hasDefineProperty) { + Object.defineProperty(EventEmitter, 'defaultMaxListeners', { + enumerable: true, + get: function() { + return defaultMaxListeners; + }, + set: function(arg) { + // check whether the input is a positive number (whose value is zero or + // greater and not a NaN). + if (typeof arg !== 'number' || arg < 0 || arg !== arg) + throw new TypeError('"defaultMaxListeners" must be a positive number'); + defaultMaxListeners = arg; + } + }); +} else { + EventEmitter.defaultMaxListeners = defaultMaxListeners; +} + +// Obviously not all Emitters should be limited to 10. This function allows +// that to be increased. Set to zero for unlimited. +EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { + if (typeof n !== 'number' || n < 0 || isNaN(n)) + throw new TypeError('"n" argument must be a positive number'); + this._maxListeners = n; + return this; +}; + +function $getMaxListeners(that) { + if (that._maxListeners === undefined) + return EventEmitter.defaultMaxListeners; + return that._maxListeners; +} + +EventEmitter.prototype.getMaxListeners = function getMaxListeners() { + return $getMaxListeners(this); +}; + +// These standalone emit* functions are used to optimize calling of event +// handlers for fast cases because emit() itself often has a variable number of +// arguments and can be deoptimized because of that. These functions always have +// the same number of arguments and thus do not get deoptimized, so the code +// inside them can execute faster. +function emitNone(handler, isFn, self) { + if (isFn) + handler.call(self); + else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + listeners[i].call(self); + } +} +function emitOne(handler, isFn, self, arg1) { + if (isFn) + handler.call(self, arg1); + else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + listeners[i].call(self, arg1); + } +} +function emitTwo(handler, isFn, self, arg1, arg2) { + if (isFn) + handler.call(self, arg1, arg2); + else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + listeners[i].call(self, arg1, arg2); + } +} +function emitThree(handler, isFn, self, arg1, arg2, arg3) { + if (isFn) + handler.call(self, arg1, arg2, arg3); + else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + listeners[i].call(self, arg1, arg2, arg3); + } +} + +function emitMany(handler, isFn, self, args) { + if (isFn) + handler.apply(self, args); + else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + listeners[i].apply(self, args); + } +} + +EventEmitter.prototype.emit = function emit(type) { + var er, handler, len, args, i, events; + var doError = (type === 'error'); + + events = this._events; + if (events) + doError = (doError && events.error == null); + else if (!doError) + return false; + + // If there is no 'error' event listener then throw. + if (doError) { + if (arguments.length > 1) + er = arguments[1]; + if (er instanceof Error) { + throw er; // Unhandled 'error' event + } else { + // At least give some kind of context to the user + var err = new Error('Unhandled "error" event. (' + er + ')'); + err.context = er; + throw err; + } + return false; + } + + handler = events[type]; + + if (!handler) + return false; + + var isFn = typeof handler === 'function'; + len = arguments.length; + switch (len) { + // fast cases + case 1: + emitNone(handler, isFn, this); + break; + case 2: + emitOne(handler, isFn, this, arguments[1]); + break; + case 3: + emitTwo(handler, isFn, this, arguments[1], arguments[2]); + break; + case 4: + emitThree(handler, isFn, this, arguments[1], arguments[2], arguments[3]); + break; + // slower + default: + args = new Array(len - 1); + for (i = 1; i < len; i++) + args[i - 1] = arguments[i]; + emitMany(handler, isFn, this, args); + } + + return true; +}; + +function _addListener(target, type, listener, prepend) { + var m; + var events; + var existing; + + if (typeof listener !== 'function') + throw new TypeError('"listener" argument must be a function'); + + events = target._events; + if (!events) { + events = target._events = objectCreate(null); + target._eventsCount = 0; + } else { + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (events.newListener) { + target.emit('newListener', type, + listener.listener ? listener.listener : listener); + + // Re-assign `events` because a newListener handler could have caused the + // this._events to be assigned to a new object + events = target._events; + } + existing = events[type]; + } + + if (!existing) { + // Optimize the case of one listener. Don't need the extra array object. + existing = events[type] = listener; + ++target._eventsCount; + } else { + if (typeof existing === 'function') { + // Adding the second element, need to change to array. + existing = events[type] = + prepend ? [listener, existing] : [existing, listener]; + } else { + // If we've already got an array, just append. + if (prepend) { + existing.unshift(listener); + } else { + existing.push(listener); + } + } + + // Check for listener leak + if (!existing.warned) { + m = $getMaxListeners(target); + if (m && m > 0 && existing.length > m) { + existing.warned = true; + var w = new Error('Possible EventEmitter memory leak detected. ' + + existing.length + ' "' + String(type) + '" listeners ' + + 'added. Use emitter.setMaxListeners() to ' + + 'increase limit.'); + w.name = 'MaxListenersExceededWarning'; + w.emitter = target; + w.type = type; + w.count = existing.length; + if (typeof console === 'object' && console.warn) { + console.warn('%s: %s', w.name, w.message); + } + } + } + } + + return target; +} + +EventEmitter.prototype.addListener = function addListener(type, listener) { + return _addListener(this, type, listener, false); +}; + +EventEmitter.prototype.on = EventEmitter.prototype.addListener; + +EventEmitter.prototype.prependListener = + function prependListener(type, listener) { + return _addListener(this, type, listener, true); + }; + +function onceWrapper() { + if (!this.fired) { + this.target.removeListener(this.type, this.wrapFn); + this.fired = true; + switch (arguments.length) { + case 0: + return this.listener.call(this.target); + case 1: + return this.listener.call(this.target, arguments[0]); + case 2: + return this.listener.call(this.target, arguments[0], arguments[1]); + case 3: + return this.listener.call(this.target, arguments[0], arguments[1], + arguments[2]); + default: + var args = new Array(arguments.length); + for (var i = 0; i < args.length; ++i) + args[i] = arguments[i]; + this.listener.apply(this.target, args); + } + } +} + +function _onceWrap(target, type, listener) { + var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; + var wrapped = bind.call(onceWrapper, state); + wrapped.listener = listener; + state.wrapFn = wrapped; + return wrapped; +} + +EventEmitter.prototype.once = function once(type, listener) { + if (typeof listener !== 'function') + throw new TypeError('"listener" argument must be a function'); + this.on(type, _onceWrap(this, type, listener)); + return this; +}; + +EventEmitter.prototype.prependOnceListener = + function prependOnceListener(type, listener) { + if (typeof listener !== 'function') + throw new TypeError('"listener" argument must be a function'); + this.prependListener(type, _onceWrap(this, type, listener)); + return this; + }; + +// Emits a 'removeListener' event if and only if the listener was removed. +EventEmitter.prototype.removeListener = + function removeListener(type, listener) { + var list, events, position, i, originalListener; + + if (typeof listener !== 'function') + throw new TypeError('"listener" argument must be a function'); + + events = this._events; + if (!events) + return this; + + list = events[type]; + if (!list) + return this; + + if (list === listener || list.listener === listener) { + if (--this._eventsCount === 0) + this._events = objectCreate(null); + else { + delete events[type]; + if (events.removeListener) + this.emit('removeListener', type, list.listener || listener); + } + } else if (typeof list !== 'function') { + position = -1; + + for (i = list.length - 1; i >= 0; i--) { + if (list[i] === listener || list[i].listener === listener) { + originalListener = list[i].listener; + position = i; + break; + } + } + + if (position < 0) + return this; + + if (position === 0) + list.shift(); + else + spliceOne(list, position); + + if (list.length === 1) + events[type] = list[0]; + + if (events.removeListener) + this.emit('removeListener', type, originalListener || listener); + } + + return this; + }; + +EventEmitter.prototype.removeAllListeners = + function removeAllListeners(type) { + var listeners, events, i; + + events = this._events; + if (!events) + return this; + + // not listening for removeListener, no need to emit + if (!events.removeListener) { + if (arguments.length === 0) { + this._events = objectCreate(null); + this._eventsCount = 0; + } else if (events[type]) { + if (--this._eventsCount === 0) + this._events = objectCreate(null); + else + delete events[type]; + } + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + var keys = objectKeys(events); + var key; + for (i = 0; i < keys.length; ++i) { + key = keys[i]; + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = objectCreate(null); + this._eventsCount = 0; + return this; + } + + listeners = events[type]; + + if (typeof listeners === 'function') { + this.removeListener(type, listeners); + } else if (listeners) { + // LIFO order + for (i = listeners.length - 1; i >= 0; i--) { + this.removeListener(type, listeners[i]); + } + } + + return this; + }; + +function _listeners(target, type, unwrap) { + var events = target._events; + + if (!events) + return []; + + var evlistener = events[type]; + if (!evlistener) + return []; + + if (typeof evlistener === 'function') + return unwrap ? [evlistener.listener || evlistener] : [evlistener]; + + return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); +} + +EventEmitter.prototype.listeners = function listeners(type) { + return _listeners(this, type, true); +}; + +EventEmitter.prototype.rawListeners = function rawListeners(type) { + return _listeners(this, type, false); +}; + +EventEmitter.listenerCount = function(emitter, type) { + if (typeof emitter.listenerCount === 'function') { + return emitter.listenerCount(type); + } else { + return listenerCount.call(emitter, type); + } +}; + +EventEmitter.prototype.listenerCount = listenerCount; +function listenerCount(type) { + var events = this._events; + + if (events) { + var evlistener = events[type]; + + if (typeof evlistener === 'function') { + return 1; + } else if (evlistener) { + return evlistener.length; + } + } + + return 0; +} + +EventEmitter.prototype.eventNames = function eventNames() { + return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : []; +}; + +// About 1.5x faster than the two-arg version of Array#splice(). +function spliceOne(list, index) { + for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) + list[i] = list[k]; + list.pop(); +} + +function arrayClone(arr, n) { + var copy = new Array(n); + for (var i = 0; i < n; ++i) + copy[i] = arr[i]; + return copy; +} + +function unwrapListeners(arr) { + var ret = new Array(arr.length); + for (var i = 0; i < ret.length; ++i) { + ret[i] = arr[i].listener || arr[i]; + } + return ret; +} + +function objectCreatePolyfill(proto) { + var F = function() {}; + F.prototype = proto; + return new F; +} +function objectKeysPolyfill(obj) { + var keys = []; + for (var k in obj) if (Object.prototype.hasOwnProperty.call(obj, k)) { + keys.push(k); + } + return k; +} +function functionBindPolyfill(context) { + var fn = this; + return function () { + return fn.apply(context, arguments); + }; +} diff --git a/node_modules/browserify/node_modules/events/package.json b/node_modules/browserify/node_modules/events/package.json new file mode 100644 index 000000000..dc8853db5 --- /dev/null +++ b/node_modules/browserify/node_modules/events/package.json @@ -0,0 +1,66 @@ +{ + "_from": "events@^2.0.0", + "_id": "events@2.1.0", + "_inBundle": false, + "_integrity": "sha512-3Zmiobend8P9DjmKAty0Era4jV8oJ0yGYe2nJJAxgymF9+N8F2m0hhZiMoWtcfepExzNKZumFU3ksdQbInGWCg==", + "_location": "/browserify/events", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "events@^2.0.0", + "name": "events", + "escapedName": "events", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/browserify" + ], + "_resolved": "https://registry.npmjs.org/events/-/events-2.1.0.tgz", + "_shasum": "2a9a1e18e6106e0e812aa9ebd4a819b3c29c0ba5", + "_spec": "events@^2.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "Irakli Gozalishvili", + "email": "rfobic@gmail.com", + "url": "http://jeditoolkit.com" + }, + "bugs": { + "url": "http://github.com/Gozala/events/issues/" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Node's event emitter for all engines.", + "devDependencies": { + "isarray": "^2.0.2", + "mocha": "^3.5.3", + "object-keys": "^1.0.11", + "zuul": "^3.11.1" + }, + "engines": { + "node": ">=0.4.x" + }, + "homepage": "https://github.com/Gozala/events#readme", + "id": "events", + "keywords": [ + "events", + "eventEmitter", + "eventDispatcher", + "listeners" + ], + "license": "MIT", + "main": "./events.js", + "name": "events", + "repository": { + "type": "git", + "url": "git://github.com/Gozala/events.git", + "web": "https://github.com/Gozala/events" + }, + "scripts": { + "test": "mocha --ui qunit -- tests/index.js", + "test:browsers": "zuul -- tests/index.js" + }, + "version": "2.1.0" +} diff --git a/node_modules/browserify/node_modules/events/tests/add-listeners.js b/node_modules/browserify/node_modules/events/tests/add-listeners.js new file mode 100644 index 000000000..6682862f2 --- /dev/null +++ b/node_modules/browserify/node_modules/events/tests/add-listeners.js @@ -0,0 +1,111 @@ +// 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 common = require('./common'); +var assert = require('assert'); +var EventEmitter = require('../'); + +{ + var ee = new EventEmitter(); + var events_new_listener_emitted = []; + var listeners_new_listener_emitted = []; + + // Sanity check + assert.strictEqual(ee.addListener, ee.on); + + ee.on('newListener', function(event, listener) { + // Don't track newListener listeners. + if (event === 'newListener') + return; + + events_new_listener_emitted.push(event); + listeners_new_listener_emitted.push(listener); + }); + + var hello = common.mustCall(function(a, b) { + assert.strictEqual('a', a); + assert.strictEqual('b', b); + }); + + ee.once('newListener', function(name, listener) { + assert.strictEqual(name, 'hello'); + assert.strictEqual(listener, hello); + + var listeners = this.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); + }); + + ee.on('hello', hello); + ee.once('foo', assert.fail); + + assert.ok(Array.isArray(events_new_listener_emitted)); + assert.strictEqual(events_new_listener_emitted.length, 2); + assert.strictEqual(events_new_listener_emitted[0], 'hello'); + assert.strictEqual(events_new_listener_emitted[1], 'foo'); + + assert.ok(Array.isArray(listeners_new_listener_emitted)); + assert.strictEqual(listeners_new_listener_emitted.length, 2); + assert.strictEqual(listeners_new_listener_emitted[0], hello); + assert.strictEqual(listeners_new_listener_emitted[1], assert.fail); + + ee.emit('hello', 'a', 'b'); +} + +// just make sure that this doesn't throw: +{ + var f = new EventEmitter(); + + f.setMaxListeners(0); +} + +{ + var listen1 = function() {}; + var listen2 = function() {}; + var ee = new EventEmitter(); + + ee.once('newListener', function() { + var listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); + ee.once('newListener', function() { + var listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); + }); + ee.on('hello', listen2); + }); + ee.on('hello', listen1); + // The order of listeners on an event is not always the order in which the + // listeners were added. + var listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 2); + assert.strictEqual(listeners[0], listen2); + assert.strictEqual(listeners[1], listen1); +} + +// Verify that the listener must be a function +assert.throws(function() { + var ee = new EventEmitter(); + + ee.on('foo', null); +}, /^TypeError: "listener" argument must be a function$/); diff --git a/node_modules/browserify/node_modules/events/tests/check-listener-leaks.js b/node_modules/browserify/node_modules/events/tests/check-listener-leaks.js new file mode 100644 index 000000000..3cd0aa2e0 --- /dev/null +++ b/node_modules/browserify/node_modules/events/tests/check-listener-leaks.js @@ -0,0 +1,93 @@ +// 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 common = require('./common'); +var assert = require('assert'); +var events = require('../'); + +// default +{ + var e = new events.EventEmitter(); + + for (var i = 0; i < 10; i++) { + e.on('default', common.mustNotCall()); + } + assert.ok(!e._events['default'].hasOwnProperty('warned')); + e.on('default', common.mustNotCall()); + assert.ok(e._events['default'].warned); + + // specific + e.setMaxListeners(5); + for (var i = 0; i < 5; i++) { + e.on('specific', common.mustNotCall()); + } + assert.ok(!e._events['specific'].hasOwnProperty('warned')); + e.on('specific', common.mustNotCall()); + assert.ok(e._events['specific'].warned); + + // only one + e.setMaxListeners(1); + e.on('only one', common.mustNotCall()); + assert.ok(!e._events['only one'].hasOwnProperty('warned')); + e.on('only one', common.mustNotCall()); + assert.ok(e._events['only one'].hasOwnProperty('warned')); + + // unlimited + e.setMaxListeners(0); + for (var i = 0; i < 1000; i++) { + e.on('unlimited', common.mustNotCall()); + } + assert.ok(!e._events['unlimited'].hasOwnProperty('warned')); +} + +// process-wide +{ + events.EventEmitter.defaultMaxListeners = 42; + var e = new events.EventEmitter(); + + for (var i = 0; i < 42; ++i) { + e.on('fortytwo', common.mustNotCall()); + } + assert.ok(!e._events['fortytwo'].hasOwnProperty('warned')); + e.on('fortytwo', common.mustNotCall()); + assert.ok(e._events['fortytwo'].hasOwnProperty('warned')); + delete e._events['fortytwo'].warned; + + events.EventEmitter.defaultMaxListeners = 44; + e.on('fortytwo', common.mustNotCall()); + assert.ok(!e._events['fortytwo'].hasOwnProperty('warned')); + e.on('fortytwo', common.mustNotCall()); + assert.ok(e._events['fortytwo'].hasOwnProperty('warned')); +} + +// but _maxListeners still has precedence over defaultMaxListeners +{ + events.EventEmitter.defaultMaxListeners = 42; + var e = new events.EventEmitter(); + e.setMaxListeners(1); + e.on('uno', common.mustNotCall()); + assert.ok(!e._events['uno'].hasOwnProperty('warned')); + e.on('uno', common.mustNotCall()); + assert.ok(e._events['uno'].hasOwnProperty('warned')); + + // chainable + assert.strictEqual(e, e.setMaxListeners(1)); +} diff --git a/node_modules/browserify/node_modules/events/tests/common.js b/node_modules/browserify/node_modules/events/tests/common.js new file mode 100644 index 000000000..cdd5aeac6 --- /dev/null +++ b/node_modules/browserify/node_modules/events/tests/common.js @@ -0,0 +1,103 @@ +// 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 assert = require('assert'); + +var noop = function() {}; + +var mustCallChecks = []; + +function runCallChecks(exitCode) { + if (exitCode !== 0) return; + + var failed = filter(mustCallChecks, function(context) { + if ('minimum' in context) { + context.messageSegment = 'at least ' + context.minimum; + return context.actual < context.minimum; + } else { + context.messageSegment = 'exactly ' + context.exact; + return context.actual !== context.exact; + } + }); + + for (var i = 0; i < failed.length; i++) { + var context = failed[i]; + console.log('Mismatched %s function calls. Expected %s, actual %d.', + context.name, + context.messageSegment, + context.actual); + // IE8 has no .stack + if (context.stack) console.log(context.stack.split('\n').slice(2).join('\n')); + } + + assert.strictEqual(failed.length, 0); +} + +exports.mustCall = function(fn, exact) { + return _mustCallInner(fn, exact, 'exact'); +}; + +function _mustCallInner(fn, criteria, field) { + if (typeof criteria == 'undefined') criteria = 1; + + if (typeof fn === 'number') { + criteria = fn; + fn = noop; + } else if (fn === undefined) { + fn = noop; + } + + if (typeof criteria !== 'number') + throw new TypeError('Invalid ' + field + ' value: ' + criteria); + + var context = { + actual: 0, + stack: (new Error()).stack, + name: fn.name || '' + }; + + context[field] = criteria; + + // add the exit listener only once to avoid listener leak warnings + if (mustCallChecks.length === 0) after(function() { runCallChecks(0); }); + + mustCallChecks.push(context); + + return function() { + context.actual++; + return fn.apply(this, arguments); + }; +} + +exports.mustNotCall = function(msg) { + return function mustNotCall() { + assert.fail(msg || 'function should not have been called'); + }; +}; + +function filter(arr, fn) { + if (arr.filter) return arr.filter(fn); + var filtered = []; + for (var i = 0; i < arr.length; i++) { + if (fn(arr[i], i, arr)) filtered.push(arr[i]); + } + return filtered +} diff --git a/node_modules/browserify/node_modules/events/tests/index.js b/node_modules/browserify/node_modules/events/tests/index.js new file mode 100644 index 000000000..f71bc98a1 --- /dev/null +++ b/node_modules/browserify/node_modules/events/tests/index.js @@ -0,0 +1,25 @@ + +require('./legacy-compat'); + +// we do this to easily wrap each file in a mocha test +// and also have browserify be able to statically analyze this file +var orig_require = require; +var require = function(file) { + test(file, function() { + orig_require(file); + }); +}; + +require('./add-listeners.js'); +require('./check-listener-leaks.js'); +require('./listener-count.js'); +require('./listeners-side-effects.js'); +require('./listeners.js'); +require('./max-listeners.js'); +require('./modify-in-emit.js'); +require('./num-args.js'); +require('./once.js'); +require('./set-max-listeners-side-effects.js'); +require('./subclass.js'); +require('./remove-all-listeners.js'); +require('./remove-listeners.js'); diff --git a/node_modules/browserify/node_modules/events/tests/legacy-compat.js b/node_modules/browserify/node_modules/events/tests/legacy-compat.js new file mode 100644 index 000000000..a402be6e2 --- /dev/null +++ b/node_modules/browserify/node_modules/events/tests/legacy-compat.js @@ -0,0 +1,16 @@ +// sigh... life is hard +if (!global.console) { + console = {} +} + +var fns = ['log', 'error', 'trace']; +for (var i=0 ; ifoo should not be emitted'); +} + +e.once('foo', remove); +e.removeListener('foo', remove); +e.emit('foo'); + +e.once('e', common.mustCall(function() { + e.emit('e'); +})); + +e.once('e', common.mustCall()); + +e.emit('e'); + +// Verify that the listener must be a function +assert.throws(function() { + var ee = new EventEmitter(); + + ee.once('foo', null); +}, /^TypeError: "listener" argument must be a function$/); + +{ + // once() has different code paths based on the number of arguments being + // emitted. Verify that all of the cases are covered. + var maxArgs = 4; + + for (var i = 0; i <= maxArgs; ++i) { + var ee = new EventEmitter(); + var args = ['foo']; + + for (var j = 0; j < i; ++j) + args.push(j); + + ee.once('foo', common.mustCall(function() { + var params = Array.prototype.slice.call(arguments); + var restArgs = args.slice(1); + assert.ok(Array.isArray(params)); + assert.strictEqual(params.length, restArgs.length); + for (var index = 0; index < params.length; index++) { + var param = params[index]; + assert.strictEqual(param, restArgs[index]); + } + })); + + EventEmitter.prototype.emit.apply(ee, args); + } +} diff --git a/node_modules/browserify/node_modules/events/tests/remove-all-listeners.js b/node_modules/browserify/node_modules/events/tests/remove-all-listeners.js new file mode 100644 index 000000000..df2999807 --- /dev/null +++ b/node_modules/browserify/node_modules/events/tests/remove-all-listeners.js @@ -0,0 +1,139 @@ +// 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 common = require('./common'); +var assert = require('assert'); +var events = require('../'); + +var after_checks = []; +after(function() { + for (var i = 0 ; i < after_checks.length ; ++i) { + after_checks[i](); + } +}); + +function expect(expected) { + var actual = []; + after_checks.push(function() { + var sortedActual = actual.sort(); + var sortedExpected = expected.sort(); + assert.strictEqual(sortedActual.length, sortedExpected.length); + for (var index = 0; index < sortedActual.length; index++) { + var value = sortedActual[index]; + assert.strictEqual(value, sortedExpected[index]); + } + }); + function listener(name) { + actual.push(name); + } + return common.mustCall(listener, expected.length); +} + +{ + var ee = new events.EventEmitter(); + var noop = common.mustNotCall(); + ee.on('foo', noop); + ee.on('bar', noop); + ee.on('baz', noop); + ee.on('baz', noop); + var fooListeners = ee.listeners('foo'); + var barListeners = ee.listeners('bar'); + var bazListeners = ee.listeners('baz'); + ee.on('removeListener', expect(['bar', 'baz', 'baz'])); + ee.removeAllListeners('bar'); + ee.removeAllListeners('baz'); + + var listeners = ee.listeners('foo'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 1); + assert.strictEqual(listeners[0], noop); + + listeners = ee.listeners('bar'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); + listeners = ee.listeners('baz'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); + // After calling removeAllListeners(), + // the old listeners array should stay unchanged. + assert.strictEqual(fooListeners.length, 1); + assert.strictEqual(fooListeners[0], noop); + assert.strictEqual(barListeners.length, 1); + assert.strictEqual(barListeners[0], noop); + assert.strictEqual(bazListeners.length, 2); + assert.strictEqual(bazListeners[0], noop); + assert.strictEqual(bazListeners[1], noop); + // After calling removeAllListeners(), + // new listeners arrays is different from the old. + assert.notStrictEqual(ee.listeners('bar'), barListeners); + assert.notStrictEqual(ee.listeners('baz'), bazListeners); +} + +{ + var ee = new events.EventEmitter(); + ee.on('foo', common.mustNotCall()); + ee.on('bar', common.mustNotCall()); + // Expect LIFO order + ee.on('removeListener', expect(['foo', 'bar', 'removeListener'])); + ee.on('removeListener', expect(['foo', 'bar'])); + ee.removeAllListeners(); + + var listeners = ee.listeners('foo'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); + listeners = ee.listeners('bar'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); +} + +{ + var ee = new events.EventEmitter(); + ee.on('removeListener', common.mustNotCall()); + // Check for regression where removeAllListeners() throws when + // there exists a 'removeListener' listener, but there exists + // no listeners for the provided event type. + assert.doesNotThrow(function () { ee.removeAllListeners(ee, 'foo') }); +} + +{ + var ee = new events.EventEmitter(); + var expectLength = 2; + ee.on('removeListener', function() { + assert.strictEqual(expectLength--, this.listeners('baz').length); + }); + ee.on('baz', common.mustNotCall()); + ee.on('baz', common.mustNotCall()); + ee.on('baz', common.mustNotCall()); + assert.strictEqual(ee.listeners('baz').length, expectLength + 1); + ee.removeAllListeners('baz'); + assert.strictEqual(ee.listeners('baz').length, 0); +} + +{ + var ee = new events.EventEmitter(); + assert.strictEqual(ee, ee.removeAllListeners()); +} + +{ + var ee = new events.EventEmitter(); + ee._events = undefined; + assert.strictEqual(ee, ee.removeAllListeners()); +} diff --git a/node_modules/browserify/node_modules/events/tests/remove-listeners.js b/node_modules/browserify/node_modules/events/tests/remove-listeners.js new file mode 100644 index 000000000..6cccd9697 --- /dev/null +++ b/node_modules/browserify/node_modules/events/tests/remove-listeners.js @@ -0,0 +1,212 @@ +// 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 common = require('./common'); +var assert = require('assert'); +var EventEmitter = require('../'); + +var listener1 = function listener1() {}; +var listener2 = function listener2() {}; + +{ + var ee = new EventEmitter(); + ee.on('hello', listener1); + ee.on('removeListener', common.mustCall(function(name, cb) { + assert.strictEqual(name, 'hello'); + assert.strictEqual(cb, listener1); + })); + ee.removeListener('hello', listener1); + var listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); +} + +{ + var ee = new EventEmitter(); + ee.on('hello', listener1); + ee.on('removeListener', common.mustNotCall()); + ee.removeListener('hello', listener2); + + var listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 1); + assert.strictEqual(listeners[0], listener1); +} + +{ + var ee = new EventEmitter(); + ee.on('hello', listener1); + ee.on('hello', listener2); + + var listeners; + ee.once('removeListener', common.mustCall(function(name, cb) { + assert.strictEqual(name, 'hello'); + assert.strictEqual(cb, listener1); + listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 1); + assert.strictEqual(listeners[0], listener2); + })); + ee.removeListener('hello', listener1); + listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 1); + assert.strictEqual(listeners[0], listener2); + ee.once('removeListener', common.mustCall(function(name, cb) { + assert.strictEqual(name, 'hello'); + assert.strictEqual(cb, listener2); + listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); + })); + ee.removeListener('hello', listener2); + listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); +} + +{ + var ee = new EventEmitter(); + + function remove1() { + assert.fail('remove1 should not have been called'); + } + + function remove2() { + assert.fail('remove2 should not have been called'); + } + + ee.on('removeListener', common.mustCall(function(name, cb) { + if (cb !== remove1) return; + this.removeListener('quux', remove2); + this.emit('quux'); + }, 2)); + ee.on('quux', remove1); + ee.on('quux', remove2); + ee.removeListener('quux', remove1); +} + +{ + var ee = new EventEmitter(); + ee.on('hello', listener1); + ee.on('hello', listener2); + + var listeners; + ee.once('removeListener', common.mustCall(function(name, cb) { + assert.strictEqual(name, 'hello'); + assert.strictEqual(cb, listener1); + listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 1); + assert.strictEqual(listeners[0], listener2); + ee.once('removeListener', common.mustCall(function(name, cb) { + assert.strictEqual(name, 'hello'); + assert.strictEqual(cb, listener2); + listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); + })); + ee.removeListener('hello', listener2); + listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); + })); + ee.removeListener('hello', listener1); + listeners = ee.listeners('hello'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 0); +} + +{ + var ee = new EventEmitter(); + var listener3 = common.mustCall(function() { + ee.removeListener('hello', listener4); + }, 2); + var listener4 = common.mustCall(); + + ee.on('hello', listener3); + ee.on('hello', listener4); + + // listener4 will still be called although it is removed by listener 3. + ee.emit('hello'); + // This is so because the interal listener array at time of emit + // was [listener3,listener4] + + // Interal listener array [listener3] + ee.emit('hello'); +} + +{ + var ee = new EventEmitter(); + + ee.once('hello', listener1); + ee.on('removeListener', common.mustCall(function(eventName, listener) { + assert.strictEqual(eventName, 'hello'); + assert.strictEqual(listener, listener1); + })); + ee.emit('hello'); +} + +{ + var ee = new EventEmitter(); + + assert.strictEqual(ee, ee.removeListener('foo', function() {})); +} + +// Verify that the removed listener must be a function +assert.throws(function() { + var ee = new EventEmitter(); + + ee.removeListener('foo', null); +}, /^TypeError: "listener" argument must be a function$/); + +{ + var ee = new EventEmitter(); + var listener = function() {}; + ee._events = undefined; + var e = ee.removeListener('foo', listener); + assert.strictEqual(e, ee); +} + +{ + var ee = new EventEmitter(); + + ee.on('foo', listener1); + ee.on('foo', listener2); + var listeners = ee.listeners('foo'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 2); + assert.strictEqual(listeners[0], listener1); + assert.strictEqual(listeners[1], listener2); + + ee.removeListener('foo', listener1); + assert.strictEqual(ee._events.foo, listener2); + + ee.on('foo', listener1); + listeners = ee.listeners('foo'); + assert.ok(Array.isArray(listeners)); + assert.strictEqual(listeners.length, 2); + assert.strictEqual(listeners[0], listener2); + assert.strictEqual(listeners[1], listener1); + + ee.removeListener('foo', listener1); + assert.strictEqual(ee._events.foo, listener2); +} diff --git a/node_modules/browserify/node_modules/events/tests/set-max-listeners-side-effects.js b/node_modules/browserify/node_modules/events/tests/set-max-listeners-side-effects.js new file mode 100644 index 000000000..99471db73 --- /dev/null +++ b/node_modules/browserify/node_modules/events/tests/set-max-listeners-side-effects.js @@ -0,0 +1,32 @@ +// 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. + +require('./common'); +var assert = require('assert'); +var events = require('../'); +var objectKeys = require('object-keys'); + +var e = new events.EventEmitter(); + +if (Object.create) assert.ok(!(e._events instanceof Object)); +assert.strictEqual(objectKeys(e._events).length, 0); +e.setMaxListeners(5); +assert.strictEqual(objectKeys(e._events).length, 0); diff --git a/node_modules/browserify/node_modules/events/tests/subclass.js b/node_modules/browserify/node_modules/events/tests/subclass.js new file mode 100644 index 000000000..6c2ae642b --- /dev/null +++ b/node_modules/browserify/node_modules/events/tests/subclass.js @@ -0,0 +1,73 @@ +// 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 common = require('./common'); +var assert = require('assert'); +var EventEmitter = require('../').EventEmitter; +var util = require('util'); +var objectKeys = require('object-keys'); + +var after_checks = []; +after(function() { + for (var i = 0 ; i < after_checks.length ; ++i) { + after_checks[i](); + } +}); + +util.inherits(MyEE, EventEmitter); + +function MyEE(cb) { + this.once(1, cb); + this.emit(1); + this.removeAllListeners(); + EventEmitter.call(this); +} + +var myee = new MyEE(common.mustCall()); + + +util.inherits(ErrorEE, EventEmitter); +function ErrorEE() { + this.emit('error', new Error('blerg')); +} + +assert.throws(function() { + new ErrorEE(); +}, /blerg/); + +after_checks.push(function() { + if (Object.create) assert.ok(!(myee._events instanceof Object)); + assert.strictEqual(objectKeys(myee._events).length, 0); +}); + + +function MyEE2() { + EventEmitter.call(this); +} + +MyEE2.prototype = new EventEmitter(); + +var ee1 = new MyEE2(); +var ee2 = new MyEE2(); + +ee1.on('x', function() {}); + +assert.strictEqual(ee2.listenerCount('x'), 0); diff --git a/node_modules/browserify/package.json b/node_modules/browserify/package.json new file mode 100644 index 000000000..09ce978ad --- /dev/null +++ b/node_modules/browserify/package.json @@ -0,0 +1,129 @@ +{ + "_from": "browserify@^16.1.0", + "_id": "browserify@16.2.3", + "_inBundle": false, + "_integrity": "sha512-zQt/Gd1+W+IY+h/xX2NYMW4orQWhqSwyV+xsblycTtpOuB27h1fZhhNQuipJ4t79ohw4P4mMem0jp/ZkISQtjQ==", + "_location": "/browserify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "browserify@^16.1.0", + "name": "browserify", + "escapedName": "browserify", + "rawSpec": "^16.1.0", + "saveSpec": null, + "fetchSpec": "^16.1.0" + }, + "_requiredBy": [ + "/budo", + "/watchify" + ], + "_resolved": "https://registry.npmjs.org/browserify/-/browserify-16.2.3.tgz", + "_shasum": "7ee6e654ba4f92bce6ab3599c3485b1cc7a0ad0b", + "_spec": "browserify@^16.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bin": { + "browserify": "bin/cmd.js" + }, + "bugs": { + "url": "https://github.com/browserify/browserify/issues" + }, + "bundleDependencies": false, + "dependencies": { + "JSONStream": "^1.0.3", + "assert": "^1.4.0", + "browser-pack": "^6.0.1", + "browser-resolve": "^1.11.0", + "browserify-zlib": "~0.2.0", + "buffer": "^5.0.2", + "cached-path-relative": "^1.0.0", + "concat-stream": "^1.6.0", + "console-browserify": "^1.1.0", + "constants-browserify": "~1.0.0", + "crypto-browserify": "^3.0.0", + "defined": "^1.0.0", + "deps-sort": "^2.0.0", + "domain-browser": "^1.2.0", + "duplexer2": "~0.1.2", + "events": "^2.0.0", + "glob": "^7.1.0", + "has": "^1.0.0", + "htmlescape": "^1.1.0", + "https-browserify": "^1.0.0", + "inherits": "~2.0.1", + "insert-module-globals": "^7.0.0", + "labeled-stream-splicer": "^2.0.0", + "mkdirp": "^0.5.0", + "module-deps": "^6.0.0", + "os-browserify": "~0.3.0", + "parents": "^1.0.1", + "path-browserify": "~0.0.0", + "process": "~0.11.0", + "punycode": "^1.3.2", + "querystring-es3": "~0.2.0", + "read-only-stream": "^2.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.1.4", + "shasum": "^1.0.0", + "shell-quote": "^1.6.1", + "stream-browserify": "^2.0.0", + "stream-http": "^2.0.0", + "string_decoder": "^1.1.1", + "subarg": "^1.0.0", + "syntax-error": "^1.1.1", + "through2": "^2.0.0", + "timers-browserify": "^1.0.1", + "tty-browserify": "0.0.1", + "url": "~0.11.0", + "util": "~0.10.1", + "vm-browserify": "^1.0.0", + "xtend": "^4.0.0" + }, + "deprecated": false, + "description": "browser-side require() the node way", + "devDependencies": { + "backbone": "~0.9.2", + "browser-unpack": "^1.1.1", + "coffee-script": "~1.10.0", + "coffeeify": "~1.1.0", + "has-object-spread": "^1.0.0", + "has-template-literals": "^1.0.0", + "isstream": "^0.1.2", + "make-generator-function": "^1.1.0", + "semver": "^5.5.0", + "seq": "0.3.5", + "tap": "^10.7.2", + "temp": "^0.8.1", + "through": "^2.3.4" + }, + "engines": { + "node": ">= 0.8" + }, + "homepage": "https://github.com/browserify/browserify#readme", + "keywords": [ + "browser", + "require", + "commonjs", + "commonj-esque", + "bundle", + "npm", + "javascript" + ], + "license": "MIT", + "main": "index.js", + "name": "browserify", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/browserify/browserify.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "16.2.3" +} diff --git a/node_modules/browserify/readme.markdown b/node_modules/browserify/readme.markdown new file mode 100644 index 000000000..7d6f87e62 --- /dev/null +++ b/node_modules/browserify/readme.markdown @@ -0,0 +1,829 @@ +# browserify + +`require('modules')` in the browser + +Use a [node](http://nodejs.org)-style `require()` to organize your browser code +and load modules installed by [npm](https://www.npmjs.com). + +browserify will recursively analyze all the `require()` calls in your app in +order to build a bundle you can serve up to the browser in a single `` into your +html! + +# install + +With [npm](https://www.npmjs.com/) do: + +``` +npm install -g browserify +``` + +# usage + +``` +Usage: browserify [entry files] {OPTIONS} + +Standard Options: + + --outfile, -o Write the browserify bundle to this file. + If unspecified, browserify prints to stdout. + + --require, -r A module name or file to bundle.require() + Optionally use a colon separator to set the target. + + --entry, -e An entry point of your app + + --ignore, -i Replace a file with an empty stub. Files can be globs. + + --exclude, -u Omit a file from the output bundle. Files can be globs. + + --external, -x Reference a file from another bundle. Files can be globs. + + --transform, -t Use a transform module on top-level files. + + --command, -c Use a transform command on top-level files. + + --standalone -s Generate a UMD bundle for the supplied export name. + This bundle works with other module systems and sets the name + given as a window global if no module system is found. + + --debug -d Enable source maps that allow you to debug your files + separately. + + --help, -h Show this message + +For advanced options, type `browserify --help advanced`. + +Specify a parameter. +``` + +``` +Advanced Options: + + --insert-globals, --ig, --fast [default: false] + + Skip detection and always insert definitions for process, global, + __filename, and __dirname. + + benefit: faster builds + cost: extra bytes + + --insert-global-vars, --igv + + Comma-separated list of global variables to detect and define. + Default: __filename,__dirname,process,Buffer,global + + --detect-globals, --dg [default: true] + + Detect the presence of process, global, __filename, and __dirname and define + these values when present. + + benefit: npm modules more likely to work + cost: slower builds + + --ignore-missing, --im [default: false] + + Ignore `require()` statements that don't resolve to anything. + + --noparse=FILE + + Don't parse FILE at all. This will make bundling much, much faster for giant + libs like jquery or threejs. + + --no-builtins + + Turn off builtins. This is handy when you want to run a bundle in node which + provides the core builtins. + + --no-commondir + + Turn off setting a commondir. This is useful if you want to preserve the + original paths that a bundle was generated with. + + --no-bundle-external + + Turn off bundling of all external modules. This is useful if you only want + to bundle your local files. + + --bare + + Alias for both --no-builtins, --no-commondir, and sets --insert-global-vars + to just "__filename,__dirname". This is handy if you want to run bundles in + node. + + --no-browser-field, --no-bf + + Turn off package.json browser field resolution. This is also handy if you + need to run a bundle in node. + + --transform-key + + Instead of the default package.json#browserify#transform field to list + all transforms to apply when running browserify, a custom field, like, e.g. + package.json#browserify#production or package.json#browserify#staging + can be used, by for example running: + * `browserify index.js --transform-key=production > bundle.js` + * `browserify index.js --transform-key=staging > bundle.js` + + --node + + Alias for --bare and --no-browser-field. + + --full-paths + + Turn off converting module ids into numerical indexes. This is useful for + preserving the original paths that a bundle was generated with. + + --deps + + Instead of standard bundle output, print the dependency array generated by + module-deps. + + --no-dedupe + + Turn off deduping. + + --list + + Print each file in the dependency graph. Useful for makefiles. + + --extension=EXTENSION + + Consider files with specified EXTENSION as modules, this option can used + multiple times. + + --global-transform=MODULE, -g MODULE + + Use a transform module on all files after any ordinary transforms have run. + + --ignore-transform=MODULE, -it MODULE + + Do not run certain transformations, even if specified elsewhere. + + --plugin=MODULE, -p MODULE + + Register MODULE as a plugin. + +Passing arguments to transforms and plugins: + + For -t, -g, and -p, you may use subarg syntax to pass options to the + transforms or plugin function as the second parameter. For example: + + -t [ foo -x 3 --beep ] + + will call the `foo` transform for each applicable file by calling: + + foo(file, { x: 3, beep: true }) + +``` + +# compatibility + +Many [npm](https://www.npmjs.com/) modules that don't do IO will just work after being +browserified. Others take more work. + +Many node built-in modules have been wrapped to work in the browser, but only +when you explicitly `require()` or use their functionality. + +When you `require()` any of these modules, you will get a browser-specific shim: + +* [assert](https://www.npmjs.com/package/assert) +* [buffer](https://www.npmjs.com/package/buffer) +* [console](https://www.npmjs.com/package/console-browserify) +* [constants](https://www.npmjs.com/package/constants-browserify) +* [crypto](https://www.npmjs.com/package/crypto-browserify) +* [domain](https://www.npmjs.com/package/domain-browser) +* [events](https://www.npmjs.com/package/events) +* [http](https://www.npmjs.com/package/stream-http) +* [https](https://www.npmjs.com/package/https-browserify) +* [os](https://www.npmjs.com/package/os-browserify) +* [path](https://www.npmjs.com/package/path-browserify) +* [punycode](https://www.npmjs.com/package/punycode) +* [querystring](https://www.npmjs.com/package/querystring-es3) +* [stream](https://www.npmjs.com/package/stream-browserify) +* [string_decoder](https://www.npmjs.com/package/string_decoder) +* [timers](https://www.npmjs.com/package/timers-browserify) +* [tty](https://www.npmjs.com/package/tty-browserify) +* [url](https://www.npmjs.com/package/url) +* [util](https://www.npmjs.com/package/util) +* [vm](https://www.npmjs.com/package/vm-browserify) +* [zlib](https://www.npmjs.com/package/browserify-zlib) + +Additionally, if you use any of these variables, they +[will be defined](https://github.com/browserify/insert-module-globals) +in the bundled output in a browser-appropriate way: + +* [process](https://www.npmjs.com/package/process) +* [Buffer](https://www.npmjs.com/package/buffer) +* global - top-level scope object (window) +* __filename - file path of the currently executing file +* __dirname - directory path of the currently executing file + +# more examples + +## external requires + +You can just as easily create a bundle that will export a `require()` function so +you can `require()` modules from another script tag. Here we'll create a +`bundle.js` with the [through](https://www.npmjs.com/package/through) +and [duplexer](https://www.npmjs.com/package/duplexer) modules. + +``` +$ browserify -r through -r duplexer -r ./my-file.js:my-module > bundle.js +``` + +Then in your page you can do: + +``` html + + +``` + +## external source maps + +If you prefer the source maps be saved to a separate `.js.map` source map file, you may use +[exorcist](https://github.com/thlorenz/exorcist) in order to achieve that. It's as simple as: + +``` +$ browserify main.js --debug | exorcist bundle.js.map > bundle.js +``` + +Learn about additional options [here](https://github.com/thlorenz/exorcist#usage). + +## multiple bundles + +If browserify finds a `require`d function already defined in the page scope, it +will fall back to that function if it didn't find any matches in its own set of +bundled modules. + +In this way, you can use browserify to split up bundles among multiple pages to +get the benefit of caching for shared, infrequently-changing modules, while +still being able to use `require()`. Just use a combination of `--external` and +`--require` to factor out common dependencies. + +For example, if a website with 2 pages, `beep.js`: + +``` js +var robot = require('./robot.js'); +console.log(robot('beep')); +``` + +and `boop.js`: + +``` js +var robot = require('./robot.js'); +console.log(robot('boop')); +``` + +both depend on `robot.js`: + +``` js +module.exports = function (s) { return s.toUpperCase() + '!' }; +``` + +``` +$ browserify -r ./robot.js > static/common.js +$ browserify -x ./robot.js beep.js > static/beep.js +$ browserify -x ./robot.js boop.js > static/boop.js +``` + +Then on the beep page you can have: + +``` html + + +``` + +while the boop page can have: + +``` html + + +``` + +This approach using `-r` and `-x` works fine for a small number of split assets, +but there are plugins for automatically factoring out components which are +described in the +[partitioning section of the browserify handbook](https://github.com/browserify/browserify-handbook#partitioning). + +## api example + +You can use the API directly too: + +``` js +var browserify = require('browserify'); +var b = browserify(); +b.add('./browser/main.js'); +b.bundle().pipe(process.stdout); +``` + +# methods + +``` js +var browserify = require('browserify') +``` + +## `browserify([files] [, opts])` + +Returns a new browserify instance. + +
+
+files +
+ +
+String, file object, or array of those types (they may be mixed) specifying entry file(s). +
+ +
+opts +
+ +
+Object. +
+
+ +`files` and `opts` are both optional, but must be in the order shown if both are +passed. + +Entry files may be passed in `files` and / or `opts.entries`. + +External requires may be specified in `opts.require`, accepting the same formats +that the `files` argument does. + +If an entry file is a stream, its contents will be used. You should pass +`opts.basedir` when using streaming files so that relative requires can be +resolved. + +`opts.entries` has the same definition as `files`. + +`opts.noParse` is an array which will skip all require() and global parsing for +each file in the array. Use this for giant libs like jquery or threejs that +don't have any requires or node-style globals but take forever to parse. + +`opts.transform` is an array of transform functions or modules names which will +transform the source code before the parsing. + +`opts.ignoreTransform` is an array of transformations that will not be run, +even if specified elsewhere. + +`opts.plugin` is an array of plugin functions or module names to use. See the +plugins section below for details. + +`opts.extensions` is an array of optional extra extensions for the module lookup +machinery to use when the extension has not been specified. +By default browserify considers only `.js` and `.json` files in such cases. + +`opts.basedir` is the directory that browserify starts bundling from for +filenames that start with `.`. + +`opts.paths` is an array of directories that browserify searches when looking +for modules which are not referenced using relative path. Can be absolute or +relative to `basedir`. Equivalent of setting `NODE_PATH` environmental variable +when calling `browserify` command. + +`opts.commondir` sets the algorithm used to parse out the common paths. Use +`false` to turn this off, otherwise it uses the +[commondir](https://www.npmjs.com/package/commondir) module. + +`opts.fullPaths` disables converting module ids into numerical indexes. This is +useful for preserving the original paths that a bundle was generated with. + +`opts.builtins` sets the list of built-ins to use, which by default is set in +`lib/builtins.js` in this distribution. + +`opts.bundleExternal` boolean option to set if external modules should be +bundled. Defaults to true. + +When `opts.browserField` is false, the package.json browser field will be ignored. + +When `opts.insertGlobals` is true, always insert `process`, `global`, +`__filename`, and `__dirname` without analyzing the AST for faster builds but +larger output bundles. Default false. + +When `opts.detectGlobals` is true, scan all files for `process`, `global`, +`__filename`, and `__dirname`, defining as necessary. With this option npm +modules are more likely to work but bundling takes longer. Default true. + +When `opts.ignoreMissing` is true, ignore `require()` statements that don't +resolve to anything. + +When `opts.debug` is true, add a source map inline to the end of the bundle. +This makes debugging easier because you can see all the original files if +you are in a modern enough browser. + +When `opts.standalone` is a non-empty string, a standalone module is created +with that name and a [umd](https://github.com/forbeslindesay/umd) wrapper. +You can use namespaces in the standalone global export using a `.` in the string +name as a separator, for example `'A.B.C'`. The global export will be [sanitized +and camel cased](https://github.com/ForbesLindesay/umd#name-casing-and-characters). + +Note that in standalone mode the `require()` calls from the original source will +still be around, which may trip up AMD loaders scanning for `require()` calls. +You can remove these calls with +[derequire](https://www.npmjs.com/package/derequire): + +``` +$ npm install -g derequire +$ browserify main.js --standalone Foo | derequire > bundle.js +``` + +`opts.insertGlobalVars` will be passed to +[insert-module-globals](https://www.npmjs.com/package/insert-module-globals) +as the `opts.vars` parameter. + +`opts.externalRequireName` defaults to `'require'` in `expose` mode but you can +use another name. + +`opts.bare` creates a bundle that does not include Node builtins, and does not +replace global Node variables except for `__dirname` and `__filename`. + +`opts.node` creates a bundle that runs in Node and does not use the browser +versions of dependencies. Same as passing `{ bare: true, browserField: false }`. + +Note that if files do not contain javascript source code then you also need to +specify a corresponding transform for them. + +All other options are forwarded along to +[module-deps](https://www.npmjs.com/package/module-deps) +and [browser-pack](https://www.npmjs.com/package/browser-pack) directly. + +## b.add(file, opts) + +Add an entry file from `file` that will be executed when the bundle loads. + +If `file` is an array, each item in `file` will be added as an entry file. + +## b.require(file, opts) + +Make `file` available from outside the bundle with `require(file)`. + +The `file` param is anything that can be resolved by `require.resolve()`, +including files from `node_modules`. Like with `require.resolve()`, you must +prefix `file` with `./` to require a local file (not in `node_modules`). + +`file` can also be a stream, but you should also use `opts.basedir` so that +relative requires will be resolvable. + +If `file` is an array, each item in `file` will be required. +In `file` array form, you can use a string or object for each item. Object items +should have a `file` property and the rest of the parameters will be used for +the `opts`. + +Use the `expose` property of opts to specify a custom dependency name. +`require('./vendor/angular/angular.js', {expose: 'angular'})` enables `require('angular')` + +## b.bundle(cb) + +Bundle the files and their dependencies into a single javascript file. + +Return a readable stream with the javascript file contents or +optionally specify a `cb(err, buf)` to get the buffered results. + +## b.external(file) + +Prevent `file` from being loaded into the current bundle, instead referencing +from another bundle. + +If `file` is an array, each item in `file` will be externalized. + +If `file` is another bundle, that bundle's contents will be read and excluded +from the current bundle as the bundle in `file` gets bundled. + +## b.ignore(file) + +Prevent the module name or file at `file` from showing up in the output bundle. + +If `file` is an array, each item in `file` will be ignored. + +Instead you will get a file with `module.exports = {}`. + +## b.exclude(file) + +Prevent the module name or file at `file` from showing up in the output bundle. + +If `file` is an array, each item in `file` will be excluded. + +If your code tries to `require()` that file it will throw unless you've provided +another mechanism for loading it. + +## b.transform(tr, opts={}) + +Transform source code before parsing it for `require()` calls with the transform +function or module name `tr`. + +If `tr` is a function, it will be called with `tr(file)` and it should return a +[through-stream](https://github.com/substack/stream-handbook#through) +that takes the raw file contents and produces the transformed source. + +If `tr` is a string, it should be a module name or file path of a +[transform module](https://github.com/browserify/module-deps#transforms) +with a signature of: + +``` js +var through = require('through'); +module.exports = function (file) { return through() }; +``` + +You don't need to necessarily use the +[through](https://www.npmjs.com/package/through) module. +Browserify is compatible with the newer, more verbose +[Transform streams](http://nodejs.org/api/stream.html#stream_class_stream_transform_1) +built into Node v0.10. + +Here's how you might compile coffee script on the fly using `.transform()`: + +``` js +var coffee = require('coffee-script'); +var through = require('through'); + +b.transform(function (file) { + var data = ''; + return through(write, end); + + function write (buf) { data += buf } + function end () { + this.queue(coffee.compile(data)); + this.queue(null); + } +}); +``` + +Note that on the command-line with the `-c` flag you can just do: + +``` +$ browserify -c 'coffee -sc' main.coffee > bundle.js +``` + +Or better still, use the [coffeeify](https://github.com/jnordberg/coffeeify) +module: + +``` +$ npm install coffeeify +$ browserify -t coffeeify main.coffee > bundle.js +``` + +If `opts.global` is `true`, the transform will operate on ALL files, despite +whether they exist up a level in a `node_modules/` directory. Use global +transforms cautiously and sparingly, since most of the time an ordinary +transform will suffice. You can also not configure global transforms in a +`package.json` like you can with ordinary transforms. + +Global transforms always run after any ordinary transforms have run. + +Transforms may obtain options from the command-line with +[subarg](https://www.npmjs.com/package/subarg) syntax: + +``` +$ browserify -t [ foo --bar=555 ] main.js +``` + +or from the api: + +``` +b.transform('foo', { bar: 555 }) +``` + +In both cases, these options are provided as the second argument to the +transform function: + +``` +module.exports = function (file, opts) { /* opts.bar === 555 */ } +``` + +Options sent to the browserify constructor are also provided under +`opts._flags`. These browserify options are sometimes required if your transform +needs to do something different when browserify is run in debug mode, for +example. + +## b.plugin(plugin, opts) + +Register a `plugin` with `opts`. Plugins can be a string module name or a +function the same as transforms. + +`plugin(b, opts)` is called with the browserify instance `b`. + +For more information, consult the plugins section below. + +## b.pipeline + +There is an internal +[labeled-stream-splicer](https://www.npmjs.com/package/labeled-stream-splicer) +pipeline with these labels: + +* `'record'` - save inputs to play back later on subsequent `bundle()` calls +* `'deps'` - [module-deps](https://www.npmjs.com/package/module-deps) +* `'json'` - adds `module.exports=` to the beginning of json files +* `'unbom'` - remove byte-order markers +* `'unshebang'` - remove #! labels on the first line +* `'syntax'` - check for syntax errors +* `'sort'` - sort the dependencies for deterministic bundles +* `'dedupe'` - remove duplicate source contents +* `'label'` - apply integer labels to files +* `'emit-deps'` - emit `'dep'` event +* `'debug'` - apply source maps +* `'pack'` - [browser-pack](https://www.npmjs.com/package/browser-pack) +* `'wrap'` - apply final wrapping, `require=` and a newline and semicolon + +You can call `b.pipeline.get()` with a label name to get a handle on a stream pipeline +that you can `push()`, `unshift()`, or `splice()` to insert your own transform +streams. + +## b.reset(opts) + +Reset the pipeline back to a normal state. This function is called automatically +when `bundle()` is called multiple times. + +This function triggers a 'reset' event. + +# package.json + +browserify uses the `package.json` in its module resolution algorithm, just like +node. If there is a `"main"` field, browserify will start resolving the package +at that point. If there is no `"main"` field, browserify will look for an +`"index.js"` file in the module root directory. Here are some more +sophisticated things you can do in the package.json: + +## browser field + +There is a special "[browser](https://github.com/defunctzombie/package-browser-field-spec)" field you can +set in your package.json on a per-module basis to override file resolution for +browser-specific versions of files. + +For example, if you want to have a browser-specific module entry point for your +`"main"` field you can just set the `"browser"` field to a string: + +``` json +"browser": "./browser.js" +``` + +or you can have overrides on a per-file basis: + +``` json +"browser": { + "fs": "level-fs", + "./lib/ops.js": "./browser/opts.js" +} +``` + +Note that the browser field only applies to files in the local module, and like +transforms, it doesn't apply into `node_modules` directories. + +## browserify.transform + +You can specify source transforms in the package.json in the +`browserify.transform` field. There is more information about how source +transforms work in package.json on the +[module-deps readme](https://github.com/browserify/module-deps#transforms). + +For example, if your module requires [brfs](https://www.npmjs.com/package/brfs), you +can add + +``` json +"browserify": { "transform": [ "brfs" ] } +``` + +to your package.json. Now when somebody `require()`s your module, brfs will +automatically be applied to the files in your module without explicit +intervention by the person using your module. Make sure to add transforms to +your package.json dependencies field. + +# events + +## b.on('file', function (file, id, parent) {}) +## b.pipeline.on('file', function (file, id, parent) {}) + +When a file is resolved for the bundle, the bundle emits a `'file'` event with +the full `file` path, the `id` string passed to `require()`, and the `parent` +object used by +[browser-resolve](https://github.com/defunctzombie/node-browser-resolve). + +You could use the `file` event to implement a file watcher to regenerate bundles +when files change. + +## b.on('package', function (pkg) {}) +## b.pipeline.on('package', function (pkg) {}) + +When a package file is read, this event fires with the contents. The package +directory is available at `pkg.__dirname`. + +## b.on('bundle', function (bundle) {}) + +When `.bundle()` is called, this event fires with the `bundle` output stream. + +## b.on('reset', function () {}) + +When the `.reset()` method is called or implicitly called by another call to +`.bundle()`, this event fires. + +## b.on('transform', function (tr, file) {}) +## b.pipeline.on('transform', function (tr, file) {}) + +When a transform is applied to a file, the `'transform'` event fires on the +bundle stream with the transform stream `tr` and the `file` that the transform +is being applied to. + +# plugins + +For some more advanced use-cases, a transform is not sufficiently extensible. +Plugins are modules that take the bundle instance as their first parameter and +an option hash as their second. + +Plugins can be used to do perform some fancy features that transforms can't do. +For example, [factor-bundle](https://www.npmjs.com/package/factor-bundle) is a +plugin that can factor out common dependencies from multiple entry-points into a +common bundle. Use plugins with `-p` and pass options to plugins with +[subarg](https://www.npmjs.com/package/subarg) syntax: + +``` +browserify x.js y.js -p [ factor-bundle -o bundle/x.js -o bundle/y.js ] \ + > bundle/common.js +``` + +For a list of plugins, consult the +[browserify-plugin tag](https://www.npmjs.com/browse/keyword/browserify-plugin) +on npm. + +# list of source transforms + +There is a [wiki page that lists the known browserify +transforms](https://github.com/browserify/browserify/wiki/list-of-transforms). + +If you write a transform, make sure to add your transform to that wiki page and +add a package.json keyword of `browserify-transform` so that +[people can browse for all the browserify +transforms](https://www.npmjs.com/browse/keyword/browserify-transform) on npmjs.org. + +# third-party tools + +There is a [wiki page that lists the known browserify +tools](https://github.com/browserify/browserify/wiki/browserify-tools). + +If you write a tool, make sure to add it to that wiki page and +add a package.json keyword of `browserify-tool` so that +[people can browse for all the browserify +tools](https://www.npmjs.com/browse/keyword/browserify-tool) on npmjs.org. + +# changelog + +Releases are documented in +[changelog.markdown](changelog.markdown) and on the +[browserify twitter feed](https://twitter.com/browserify). + +# license + +[MIT](./LICENSE) + +![browserify!](./assets/browserify.png) diff --git a/node_modules/browserify/test/args.js b/node_modules/browserify/test/args.js new file mode 100644 index 000000000..6f8cb0216 --- /dev/null +++ b/node_modules/browserify/test/args.js @@ -0,0 +1,72 @@ +var test = require('tap').test; +var fromArgs = require('../bin/args.js'); +var path = require('path'); +var vm = require('vm'); + +test('bundle from an arguments array', function (t) { + t.plan(2); + + var b = fromArgs([ __dirname + '/entry/two.js', '-s', 'XYZ' ]); + b.bundle(function (err, src) { + t.ifError(err); + var c = { window: {} }; + vm.runInNewContext(src, c); + t.equal(c.window.XYZ, 2); + }); +}); + +test('external flag for node modules', function(t) { + t.plan(2); + + var b = fromArgs([ __dirname + '/external_args/main.js', '-x', 'backbone' ]); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, {t: t}); + }); +}); + +test('bundle from an arguments with --insert-global-vars', function (t) { + t.plan(4); + + var b = fromArgs([ + __dirname + '/global/filename.js', + '--insert-global-vars=__filename,__dirname', + '--basedir', __dirname + ]); + b.require(__dirname + '/global/filename.js', { expose: 'x' }); + b.bundle(function (err, src) { + t.ifError(err, 'b.bundle()'); + var c = {}, x; + vm.runInNewContext(src, c); + t.doesNotThrow(function() { + x = c.require('x'); + }, 'x = c.require(\'x\')'); + t.equal(x && x.filename, '/global/filename.js', 'x.filename'); + t.equal(x && x.dirname, '/global', 'x.dirname'); + }) +}); + +test('numeric module names', function(t) { + t.plan(1); + + var b = fromArgs([ '-x', '1337' ]); + b.bundle(function (err, src) { + t.ifError(err); + }); +}); + +test('entry expose', function (t) { + t.plan(3) + + var b = fromArgs([ + path.join(__dirname, '/entry_expose/main.js'), + '--require', path.join(__dirname, '/entry_expose/main.js') + ':x', + ]); + b.bundle(function (err, src) { + t.ifError(err); + var c = { console: { log: log } }; + function log (msg) { t.equal(msg, 'wow') } + vm.runInNewContext(src, c); + t.equal(c.require('x'), 555); + }) +}); diff --git a/node_modules/browserify/test/array.js b/node_modules/browserify/test/array.js new file mode 100644 index 000000000..31d4c89ee --- /dev/null +++ b/node_modules/browserify/test/array.js @@ -0,0 +1,74 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('array add', function (t) { + var expected = [ 'ONE', 'TWO', 'THREE' ]; + t.plan(expected.length); + + var b = browserify(); + var files = [ + __dirname + '/array/one.js', + __dirname + '/array/two.js', + __dirname + '/array/three.js' + ]; + b.add(files); + b.bundle(function (err, src) { + vm.runInNewContext(src, { console: { log: log } }); + function log (msg) { + t.equal(msg, expected.shift()); + } + }); +}); + +test('array require', function (t) { + t.plan(3); + + var b = browserify(); + var files = [ 'defined', 'subarg' ]; + b.require(files); + b.bundle(function (err, src) { + var c = {}; + vm.runInNewContext(src, c); + + t.equal(c.require('defined')(undefined, true), true); + t.equal(c.require('defined')(undefined, false), false); + t.deepEqual(c.require('subarg')(['-x', '3']), { x: 3, _: [] }); + }); +}); + +test('array require opts', function (t) { + t.plan(3); + + var b = browserify(); + var files = [ + { file: require.resolve('defined'), expose: 'abc' }, + { file: require.resolve('subarg'), expose: 'def' } + ]; + b.require(files); + b.bundle(function (err, src) { + var c = {}; + vm.runInNewContext(src, c); + + t.equal(c.require('abc')(undefined, true), true); + t.equal(c.require('abc')(undefined, false), false); + t.deepEqual(c.require('def')(['-x', '3']), { x: 3, _: [] }); + }); +}); + +test('array external', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/external/main.js'); + b.external(['util','freelist']); + b.bundle(function (err, src) { + if (err) return t.fail(err); + vm.runInNewContext( + 'function require (x) {' + + 'if (x==="freelist") return function (n) { return n + 1000 }' + + '}' + + src, + { t: t } + ); + }); +}); diff --git a/node_modules/browserify/test/array/one.js b/node_modules/browserify/test/array/one.js new file mode 100644 index 000000000..c6312fd4c --- /dev/null +++ b/node_modules/browserify/test/array/one.js @@ -0,0 +1 @@ +console.log('ONE'); diff --git a/node_modules/browserify/test/array/three.js b/node_modules/browserify/test/array/three.js new file mode 100644 index 000000000..77a6c3afb --- /dev/null +++ b/node_modules/browserify/test/array/three.js @@ -0,0 +1 @@ +console.log('THREE'); diff --git a/node_modules/browserify/test/array/two.js b/node_modules/browserify/test/array/two.js new file mode 100644 index 000000000..fa60b5ad7 --- /dev/null +++ b/node_modules/browserify/test/array/two.js @@ -0,0 +1 @@ +console.log('TWO'); diff --git a/node_modules/browserify/test/async.js b/node_modules/browserify/test/async.js new file mode 100644 index 000000000..e9bd246aa --- /dev/null +++ b/node_modules/browserify/test/async.js @@ -0,0 +1,24 @@ +var browserify = require('../'); +var fs = require('fs'); +var vm = require('vm'); +var test = require('tap').test; + +var src = fs.readFileSync(__dirname + '/async/src.js','utf8'); +var canAsync = true; +try { Function(src) } catch (err) { canAsync = false } + +if (!canAsync) console.error('# async/await unsupported in this environment') +else test('async/await', function (t) { + t.plan(2); + var b = browserify(__dirname + '/async/src.js'); + b.bundle(function (err, src) { + t.error(err) + var c = { + console: { log: log }, + setTimeout: setTimeout, + clearTimeout: clearTimeout + } + vm.runInNewContext(src, c); + function log (msg) { t.equal(msg, 60) } + }); +}); diff --git a/node_modules/browserify/test/async/src.js b/node_modules/browserify/test/async/src.js new file mode 100644 index 000000000..7a50fbcd5 --- /dev/null +++ b/node_modules/browserify/test/async/src.js @@ -0,0 +1,8 @@ +function f (x) { return new Promise(resolve => { + process.nextTick(() => { resolve(x) }) }) } + +async function add (x) { + return x + await f(20) + await f(30) +} + +add(10).then(v => { console.log(v) }) diff --git a/node_modules/browserify/test/backbone.js b/node_modules/browserify/test/backbone.js new file mode 100644 index 000000000..03e6f690d --- /dev/null +++ b/node_modules/browserify/test/backbone.js @@ -0,0 +1,23 @@ +var browserify = require('../'); +var vm = require('vm'); +var backbone = require('backbone'); +var test = require('tap').test; + +test('backbone', function (t) { + t.plan(3); + var b = browserify(); + b.require('backbone'); + b.bundle(function (err, buf) { + t.ok(Buffer.isBuffer(buf)); + var src = buf.toString('utf8'); + t.ok(src.length > 0); + + var c = { console: console }; + vm.runInNewContext(src, c); + t.deepEqual( + Object.keys(backbone).sort(), + Object.keys(c.require('backbone')).sort() + ); + t.end(); + }); +}); diff --git a/node_modules/browserify/test/bare.js b/node_modules/browserify/test/bare.js new file mode 100644 index 000000000..039c587a8 --- /dev/null +++ b/node_modules/browserify/test/bare.js @@ -0,0 +1,173 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var browserify = require('../'); +var path = require('path'); +var concat = require('concat-stream'); +var vm = require('vm'); +var fs = require('fs'); +var through = require('through2'); +var temp = require('temp'); +temp.track(); +var tmpdir = temp.mkdirSync({prefix: 'browserify-test'}); + +test('bare', function (t) { + t.plan(4); + + var cwd = process.cwd(); + process.chdir(__dirname); + + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + '-', '--bare' + ]); + ps.stdout.pipe(concat(function (body) { + vm.runInNewContext(body, { + Buffer: function (s) { return s.toLowerCase() }, + console: { + log: function (msg) { t.equal(msg, 'abc') } + } + }); + vm.runInNewContext(body, { + Buffer: Buffer, + console: { + log: function (msg) { + t.ok(Buffer.isBuffer(msg)); + t.equal(msg.toString('utf8'), 'ABC') + } + } + }); + })); + ps.stdin.end('console.log(Buffer("ABC"))'); + + ps.on('exit', function (code) { + t.equal(code, 0); + }); +}); + +test('bare api', function (t) { + t.plan(3); + + var input = through(); + var b = browserify(input, { bare: true }); + b.bundle().pipe(concat(function (body) { + vm.runInNewContext(body, { + Buffer: function (s) { return s.toLowerCase() }, + console: { + log: function (msg) { t.equal(msg, 'abc') } + } + }); + vm.runInNewContext(body, { + Buffer: Buffer, + console: { + log: function (msg) { + t.ok(Buffer.isBuffer(msg)); + t.equal(msg.toString('utf8'), 'ABC') + } + } + }); + })); + input.end('console.log(Buffer("ABC"))'); +}); + +test('bare inserts __filename,__dirname but not process,global,Buffer', function (t) { + t.plan(2); + + var file = path.resolve(__dirname, 'bare/main.js'); + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + file, + '--bare' + ]); + + ps.stdout.pipe(concat(function (body) { + vm.runInNewContext(body, { + require: require, + __dirname: process.cwd(), + console: { + log: function (msg) { + t.same(msg, [ + path.join(__dirname, 'bare'), + path.join(__dirname, 'bare/main.js'), + 'undefined', + 'undefined', + 'undefined' + ]); + } + } + }); + })); + ps.stdin.end(); + + ps.on('exit', function (code) { + t.equal(code, 0); + }); +}); + +test('bare inserts dynamic __filename,__dirname', function (t) { + t.plan(2); + + var file = path.join(tmpdir, 'dirname-filename.js'); + + fs.writeFileSync( + file, + fs.readFileSync(path.resolve(__dirname, 'bare/dirname-filename.js')) + ); + + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + file, + '--bare' + ]); + + ps.stdout.pipe(concat(function (body) { + vm.runInNewContext(body, { + require: require, + __dirname: process.cwd(), + console: { + log: function (msg) { + t.same(msg, [ + path.dirname(file), + file + ]); + } + } + }); + })); + ps.stdin.end(); + + ps.on('exit', function (code) { + t.equal(code, 0); + }); +}); + +test('bare inserts dynamic __filename,__dirname with basedir', function (t) { + t.plan(2); + + var file = 'dirname-filename.js'; + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + file, + '--bare', + '--basedir=' + path.join(__dirname, 'bare') + ]); + + ps.stdout.pipe(concat(function (body) { + vm.runInNewContext(body, { + require: require, + __dirname: process.cwd(), + console: { + log: function (msg) { + t.same(msg, [ + __dirname, + path.join(__dirname, file) + ]); + } + } + }); + })); + ps.stdin.end(); + + ps.on('exit', function (code) { + t.equal(code, 0); + }); +}); diff --git a/node_modules/browserify/test/bare/dirname-filename.js b/node_modules/browserify/test/bare/dirname-filename.js new file mode 100644 index 000000000..c10337d07 --- /dev/null +++ b/node_modules/browserify/test/bare/dirname-filename.js @@ -0,0 +1,4 @@ +console.log([ + __dirname, + __filename +]); diff --git a/node_modules/browserify/test/bare/main.js b/node_modules/browserify/test/bare/main.js new file mode 100644 index 000000000..e79174303 --- /dev/null +++ b/node_modules/browserify/test/bare/main.js @@ -0,0 +1,7 @@ +console.log([ + __dirname, + __filename, + typeof process, + typeof global, + typeof Buffer +]); diff --git a/node_modules/browserify/test/bare_shebang.js b/node_modules/browserify/test/bare_shebang.js new file mode 100644 index 000000000..c47bf44d0 --- /dev/null +++ b/node_modules/browserify/test/bare_shebang.js @@ -0,0 +1,37 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var path = require('path'); +var concat = require('concat-stream'); +var vm = require('vm'); + +test('bare shebang', function (t) { + t.plan(4); + + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + '-', '--bare' + ]); + ps.stderr.pipe(process.stderr); + ps.stdout.pipe(concat(function (body) { + vm.runInNewContext(body, { + Buffer: function (s) { return s.toLowerCase() }, + console: { + log: function (msg) { t.equal(msg, 'woo') } + } + }); + vm.runInNewContext(body, { + Buffer: Buffer, + console: { + log: function (msg) { + t.ok(Buffer.isBuffer(msg)); + t.equal(msg.toString('utf8'), 'WOO') + } + } + }); + })); + ps.stdin.end('#!/usr/bin/env node\nconsole.log(Buffer("WOO"))'); + + ps.on('exit', function (code) { + t.equal(code, 0); + }); +}); diff --git a/node_modules/browserify/test/bin.js b/node_modules/browserify/test/bin.js new file mode 100644 index 000000000..cb7b17aab --- /dev/null +++ b/node_modules/browserify/test/bin.js @@ -0,0 +1,31 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var path = require('path'); +var vm = require('vm'); + +test('bin', function (t) { + t.plan(3); + + var cwd = process.cwd(); + process.chdir(__dirname); + + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + 'entry/main.js' + ]); + var src = ''; + var err = ''; + ps.stdout.on('data', function (buf) { src += buf }); + ps.stderr.on('data', function (buf) { err += buf }); + + ps.on('exit', function (code) { + t.equal(code, 0); + t.equal(err, ''); + + var allDone = false; + var c = { done : function () { allDone = true } }; + + vm.runInNewContext(src, c); + t.ok(allDone); + }); +}); diff --git a/node_modules/browserify/test/bin_entry.js b/node_modules/browserify/test/bin_entry.js new file mode 100644 index 000000000..f7e9af322 --- /dev/null +++ b/node_modules/browserify/test/bin_entry.js @@ -0,0 +1,31 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var path = require('path'); +var vm = require('vm'); + +test('bin --entry', function (t) { + t.plan(3); + + var cwd = process.cwd(); + process.chdir(__dirname); + + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + '--entry', 'entry/main.js' + ]); + var src = ''; + var err = ''; + ps.stdout.on('data', function (buf) { src += buf }); + ps.stderr.on('data', function (buf) { err += buf }); + + ps.on('exit', function (code) { + t.equal(code, 0); + t.equal(err, ''); + + var allDone = false; + var c = { done : function () { allDone = true } }; + + vm.runInNewContext(src, c); + t.ok(allDone); + }); +}); diff --git a/node_modules/browserify/test/bin_tr_error.js b/node_modules/browserify/test/bin_tr_error.js new file mode 100644 index 000000000..a68127545 --- /dev/null +++ b/node_modules/browserify/test/bin_tr_error.js @@ -0,0 +1,27 @@ +var browserify = require('../'); +var spawn = require('child_process').spawn; +var test = require('tap').test; +var path = require('path') +var semver = require('semver'); + +// TODO this should be fixable I guess +var flaky = process.platform === 'win32' && semver.satisfies(process.version, 'v0.10.x'); + +test('function transform', { skip: flaky }, function (t) { + t.plan(3); + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + '-t', './tr.js', './main.js' + ], {cwd: path.resolve(__dirname, 'bin_tr_error')}); + var src = ''; + var err = ''; + ps.stdout.on('data', function (buf) { src += buf }); + ps.stderr.on('data', function (buf) { err += buf }); + + ps.on('exit', function (code) { + t.notEqual(code, 0); + var errorFile = path.resolve(__dirname, 'bin_tr_error', 'tr.js'); + t.notEqual(err.indexOf('there was error'), -1, 'Error should contain error message') + t.notEqual(err.indexOf(errorFile), -1, 'Error should contain stack trace') + }); +}); diff --git a/node_modules/browserify/test/bin_tr_error/main.js b/node_modules/browserify/test/bin_tr_error/main.js new file mode 100644 index 000000000..ec448ae83 --- /dev/null +++ b/node_modules/browserify/test/bin_tr_error/main.js @@ -0,0 +1 @@ +t.equal(XXX * 5, 555); diff --git a/node_modules/browserify/test/bin_tr_error/tr.js b/node_modules/browserify/test/bin_tr_error/tr.js new file mode 100644 index 000000000..c4e537e1d --- /dev/null +++ b/node_modules/browserify/test/bin_tr_error/tr.js @@ -0,0 +1,12 @@ +var through = require('through2'); + +module.exports = function (file, opts) { + var data = ''; + return through(write, end); + + function write (buf, enc, next) { data += buf; next() } + function end () { + this.emit('error', new Error('there was error')) + this.push(null); + } +}; diff --git a/node_modules/browserify/test/bom.js b/node_modules/browserify/test/bom.js new file mode 100644 index 000000000..78cca51e6 --- /dev/null +++ b/node_modules/browserify/test/bom.js @@ -0,0 +1,19 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('byte order marker', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/bom/hello.js'); + b.bundle(function (err, src) { + if (err) t.fail(err); + var c = { + console: { log: function (msg) { + t.equal(msg, 'hello'); + } } + }; + vm.runInNewContext(src, c); + t.notOk(/\ufeff/.test(src.toString('utf8'))); + }); +}); diff --git a/node_modules/browserify/test/bom/hello.js b/node_modules/browserify/test/bom/hello.js new file mode 100644 index 000000000..03b374a1e --- /dev/null +++ b/node_modules/browserify/test/bom/hello.js @@ -0,0 +1 @@ +console.log('hello') diff --git a/node_modules/browserify/test/browser_field_file.js b/node_modules/browserify/test/browser_field_file.js new file mode 100644 index 000000000..cecaef227 --- /dev/null +++ b/node_modules/browserify/test/browser_field_file.js @@ -0,0 +1,13 @@ +var test = require('tap').test; +var vm = require('vm'); +var browserify = require('../'); + +test('browser field file no ext', function (t) { + t.plan(2); + var b = browserify(__dirname + '/browser_field_file/xyz'); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { console: { log: log } }); + function log (msg) { t.equal(msg, 'cool beans') } + }); +}); diff --git a/node_modules/browserify/test/browser_field_file/package.json b/node_modules/browserify/test/browser_field_file/package.json new file mode 100644 index 000000000..f146bccdb --- /dev/null +++ b/node_modules/browserify/test/browser_field_file/package.json @@ -0,0 +1,5 @@ +{ + "browser": { + "./xyz": "wow.js" + } +} diff --git a/node_modules/browserify/test/browser_field_file/wow.js b/node_modules/browserify/test/browser_field_file/wow.js new file mode 100644 index 000000000..eca0d7591 --- /dev/null +++ b/node_modules/browserify/test/browser_field_file/wow.js @@ -0,0 +1 @@ +console.log('cool beans'); diff --git a/node_modules/browserify/test/browser_field_resolve.js b/node_modules/browserify/test/browser_field_resolve.js new file mode 100644 index 000000000..0b26fef4a --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve.js @@ -0,0 +1,124 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('browser field resolve (a)', function (t) { + t.plan(2); + var b = browserify(__dirname + '/browser_field_resolve/a/main.js'); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { console: { log: log } }); + function log (x) { t.equal(x, 555) } + }); +}); + +test('browser field resolve (b)', function (t) { + t.plan(2); + var b = browserify(__dirname + '/browser_field_resolve/b/main.js'); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { console: { log: log } }); + function log (x) { t.equal(x, 444) } + }); +}); + +test('browser field resolve (c)', function (t) { + t.plan(2); + var b = browserify(__dirname + '/browser_field_resolve/c/main.js'); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { console: { log: log } }); + function log (x) { t.equal(x, 333) } + }); + +}); + +test('browser field resolve (d)', function (t) { + t.plan(2); + var b = browserify(__dirname + '/browser_field_resolve/d/main.js'); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { console: { log: log } }); + function log (x) { t.equal(x, 222) } + }); +}); + +test('browser field resolve (e)', function (t) { + t.plan(2); + var b = browserify(__dirname + '/browser_field_resolve/e/main.js'); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { console: { log: log } }); + function log (x) { t.equal(x, 111) } + }); +}); + +test('browser field resolve (f)', function (t) { + t.plan(2); + var b = browserify(__dirname + '/browser_field_resolve/f/main.js'); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { console: { log: log } }); + function log (x) { t.equal(x, 999) } + }); +}); + +test('browser field resolve (g)', function (t) { + t.plan(2); + var b = browserify(__dirname + '/browser_field_resolve/g/main.js'); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { console: { log: log } }); + function log (x) { t.deepEqual(x, {}) } + }); +}); + +test('browser field resolve (h)', function (t) { + t.plan(2); + var b = browserify(__dirname + '/browser_field_resolve/h/main.js'); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { console: { log: log } }); + function log (x) { t.deepEqual(x, {}) } + }); +}); + +test('browser field resolve (i)', function (t) { + t.plan(2); + var b = browserify(__dirname + '/browser_field_resolve/i/main.js'); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { console: { log: log } }); + function log (x) { t.deepEqual(x, 5000) } + }); +}); + +test('browser field resolve (j)', function (t) { + t.plan(2); + var b = browserify(__dirname + '/browser_field_resolve/j/main.js'); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { console: { log: log } }); + function log (x) { t.deepEqual(x, 5000) } + }); +}); + +test('browser field resolve (k)', function (t) { + t.plan(2); + var b = browserify(__dirname + '/browser_field_resolve/k/main.js'); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { console: { log: log } }); + function log (x) { t.deepEqual(x, 3000) } + }); +}); + +test('browser field resolve (l)', function (t) { + t.plan(2); + var b = browserify(__dirname + '/browser_field_resolve/l/main.js'); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { console: { log: log } }); + function log (x) { t.deepEqual(x, 3000) } + }); +}); diff --git a/node_modules/browserify/test/browser_field_resolve/a/main.js b/node_modules/browserify/test/browser_field_resolve/a/main.js new file mode 100644 index 000000000..04798b6ba --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/a/main.js @@ -0,0 +1 @@ +console.log(require('zzz')) diff --git a/node_modules/browserify/test/browser_field_resolve/a/node_modules/aaa/main.js b/node_modules/browserify/test/browser_field_resolve/a/node_modules/aaa/main.js new file mode 100644 index 000000000..3e842e734 --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/a/node_modules/aaa/main.js @@ -0,0 +1 @@ +module.exports = 555 diff --git a/node_modules/browserify/test/browser_field_resolve/a/node_modules/aaa/package.json b/node_modules/browserify/test/browser_field_resolve/a/node_modules/aaa/package.json new file mode 100644 index 000000000..c13b8cf6a --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/a/node_modules/aaa/package.json @@ -0,0 +1,3 @@ +{ + "main": "main.js" +} diff --git a/node_modules/browserify/test/browser_field_resolve/a/package.json b/node_modules/browserify/test/browser_field_resolve/a/package.json new file mode 100644 index 000000000..36ad48686 --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/a/package.json @@ -0,0 +1,5 @@ +{ + "browser": { + "zzz": "aaa" + } +} diff --git a/node_modules/browserify/test/browser_field_resolve/b/main.js b/node_modules/browserify/test/browser_field_resolve/b/main.js new file mode 100644 index 000000000..04798b6ba --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/b/main.js @@ -0,0 +1 @@ +console.log(require('zzz')) diff --git a/node_modules/browserify/test/browser_field_resolve/b/package.json b/node_modules/browserify/test/browser_field_resolve/b/package.json new file mode 100644 index 000000000..ed91400b5 --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/b/package.json @@ -0,0 +1,5 @@ +{ + "browser": { + "zzz": "./x" + } +} diff --git a/node_modules/browserify/test/browser_field_resolve/b/x.js b/node_modules/browserify/test/browser_field_resolve/b/x.js new file mode 100644 index 000000000..41a4973b3 --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/b/x.js @@ -0,0 +1 @@ +module.exports = 444 diff --git a/node_modules/browserify/test/browser_field_resolve/c/main.js b/node_modules/browserify/test/browser_field_resolve/c/main.js new file mode 100644 index 000000000..d2bbb5368 --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/c/main.js @@ -0,0 +1 @@ +console.log(require('./z.js')) diff --git a/node_modules/browserify/test/browser_field_resolve/c/package.json b/node_modules/browserify/test/browser_field_resolve/c/package.json new file mode 100644 index 000000000..2bd5e9ded --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/c/package.json @@ -0,0 +1,5 @@ +{ + "browser": { + "./z": "./x" + } +} diff --git a/node_modules/browserify/test/browser_field_resolve/c/x.js b/node_modules/browserify/test/browser_field_resolve/c/x.js new file mode 100644 index 000000000..91238822e --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/c/x.js @@ -0,0 +1 @@ +module.exports = 333 diff --git a/node_modules/browserify/test/browser_field_resolve/d/main.js b/node_modules/browserify/test/browser_field_resolve/d/main.js new file mode 100644 index 000000000..d2bbb5368 --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/d/main.js @@ -0,0 +1 @@ +console.log(require('./z.js')) diff --git a/node_modules/browserify/test/browser_field_resolve/d/package.json b/node_modules/browserify/test/browser_field_resolve/d/package.json new file mode 100644 index 000000000..deeed5621 --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/d/package.json @@ -0,0 +1,5 @@ +{ + "browser": { + "./z.js": "./x.js" + } +} diff --git a/node_modules/browserify/test/browser_field_resolve/d/x.js b/node_modules/browserify/test/browser_field_resolve/d/x.js new file mode 100644 index 000000000..fb98b131b --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/d/x.js @@ -0,0 +1 @@ +module.exports = 222 diff --git a/node_modules/browserify/test/browser_field_resolve/e/main.js b/node_modules/browserify/test/browser_field_resolve/e/main.js new file mode 100644 index 000000000..d2bbb5368 --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/e/main.js @@ -0,0 +1 @@ +console.log(require('./z.js')) diff --git a/node_modules/browserify/test/browser_field_resolve/e/package.json b/node_modules/browserify/test/browser_field_resolve/e/package.json new file mode 100644 index 000000000..8538725e4 --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/e/package.json @@ -0,0 +1,5 @@ +{ + "browser": { + "./z": "./x.js" + } +} diff --git a/node_modules/browserify/test/browser_field_resolve/e/x.js b/node_modules/browserify/test/browser_field_resolve/e/x.js new file mode 100644 index 000000000..409ecf48a --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/e/x.js @@ -0,0 +1 @@ +module.exports = 111 diff --git a/node_modules/browserify/test/browser_field_resolve/f/main.js b/node_modules/browserify/test/browser_field_resolve/f/main.js new file mode 100644 index 000000000..9e1be0024 --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/f/main.js @@ -0,0 +1 @@ +console.log(require('aaa/what.js')) diff --git a/node_modules/browserify/test/browser_field_resolve/f/package.json b/node_modules/browserify/test/browser_field_resolve/f/package.json new file mode 100644 index 000000000..339004096 --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/f/package.json @@ -0,0 +1,5 @@ +{ + "browser": { + "aaa/what": "./x.js" + } +} diff --git a/node_modules/browserify/test/browser_field_resolve/f/x.js b/node_modules/browserify/test/browser_field_resolve/f/x.js new file mode 100644 index 000000000..95c041e1a --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/f/x.js @@ -0,0 +1 @@ +module.exports = 999 diff --git a/node_modules/browserify/test/browser_field_resolve/g/main.js b/node_modules/browserify/test/browser_field_resolve/g/main.js new file mode 100644 index 000000000..3100f1d9b --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/g/main.js @@ -0,0 +1,2 @@ +try { var x = require('./x') } catch (err) {} +console.log(x) diff --git a/node_modules/browserify/test/browser_field_resolve/g/package.json b/node_modules/browserify/test/browser_field_resolve/g/package.json new file mode 100644 index 000000000..3d0142ce6 --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/g/package.json @@ -0,0 +1,5 @@ +{ + "browser": { + "./x.js": false + } +} diff --git a/node_modules/browserify/test/browser_field_resolve/g/x.js b/node_modules/browserify/test/browser_field_resolve/g/x.js new file mode 100644 index 000000000..ae629b69b --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/g/x.js @@ -0,0 +1 @@ +module.exports = 1000 diff --git a/node_modules/browserify/test/browser_field_resolve/h/main.js b/node_modules/browserify/test/browser_field_resolve/h/main.js new file mode 100644 index 000000000..29ad627e9 --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/h/main.js @@ -0,0 +1,2 @@ +try { var x = require('./x.js') } catch (err) {} +console.log(x) diff --git a/node_modules/browserify/test/browser_field_resolve/h/package.json b/node_modules/browserify/test/browser_field_resolve/h/package.json new file mode 100644 index 000000000..d8bf9d12e --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/h/package.json @@ -0,0 +1,5 @@ +{ + "browser": { + "./x": false + } +} diff --git a/node_modules/browserify/test/browser_field_resolve/h/x.js b/node_modules/browserify/test/browser_field_resolve/h/x.js new file mode 100644 index 000000000..ae629b69b --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/h/x.js @@ -0,0 +1 @@ +module.exports = 1000 diff --git a/node_modules/browserify/test/browser_field_resolve/i/browser.js b/node_modules/browserify/test/browser_field_resolve/i/browser.js new file mode 100644 index 000000000..7651b1ab7 --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/i/browser.js @@ -0,0 +1 @@ +module.exports = 5000 diff --git a/node_modules/browserify/test/browser_field_resolve/i/main.js b/node_modules/browserify/test/browser_field_resolve/i/main.js new file mode 100644 index 000000000..164cd233e --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/i/main.js @@ -0,0 +1,2 @@ +var x = require('./x.js') +console.log(x) diff --git a/node_modules/browserify/test/browser_field_resolve/i/package.json b/node_modules/browserify/test/browser_field_resolve/i/package.json new file mode 100644 index 000000000..aac08b068 --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/i/package.json @@ -0,0 +1,5 @@ +{ + "browser": { + "./x": "./browser" + } +} diff --git a/node_modules/browserify/test/browser_field_resolve/i/x.js b/node_modules/browserify/test/browser_field_resolve/i/x.js new file mode 100644 index 000000000..ae629b69b --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/i/x.js @@ -0,0 +1 @@ +module.exports = 1000 diff --git a/node_modules/browserify/test/browser_field_resolve/j/browser.js b/node_modules/browserify/test/browser_field_resolve/j/browser.js new file mode 100644 index 000000000..7651b1ab7 --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/j/browser.js @@ -0,0 +1 @@ +module.exports = 5000 diff --git a/node_modules/browserify/test/browser_field_resolve/j/main.js b/node_modules/browserify/test/browser_field_resolve/j/main.js new file mode 100644 index 000000000..b9f40553b --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/j/main.js @@ -0,0 +1,2 @@ +var x = require('./x') +console.log(x) diff --git a/node_modules/browserify/test/browser_field_resolve/j/package.json b/node_modules/browserify/test/browser_field_resolve/j/package.json new file mode 100644 index 000000000..8f617288f --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/j/package.json @@ -0,0 +1,5 @@ +{ + "browser": { + "./x.js": "./browser.js" + } +} diff --git a/node_modules/browserify/test/browser_field_resolve/j/x.js b/node_modules/browserify/test/browser_field_resolve/j/x.js new file mode 100644 index 000000000..ae629b69b --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/j/x.js @@ -0,0 +1 @@ +module.exports = 1000 diff --git a/node_modules/browserify/test/browser_field_resolve/k/main.js b/node_modules/browserify/test/browser_field_resolve/k/main.js new file mode 100644 index 000000000..993b834eb --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/k/main.js @@ -0,0 +1,2 @@ +var zzz = require('x/zzz') +console.log(zzz) diff --git a/node_modules/browserify/test/browser_field_resolve/k/node_modules/x/hey.js b/node_modules/browserify/test/browser_field_resolve/k/node_modules/x/hey.js new file mode 100644 index 000000000..6202b34c2 --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/k/node_modules/x/hey.js @@ -0,0 +1 @@ +module.exports = 3000 diff --git a/node_modules/browserify/test/browser_field_resolve/k/node_modules/x/package.json b/node_modules/browserify/test/browser_field_resolve/k/node_modules/x/package.json new file mode 100644 index 000000000..cf1ec93f4 --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/k/node_modules/x/package.json @@ -0,0 +1,5 @@ +{ + "browser": { + "./zzz": "./hey" + } +} diff --git a/node_modules/browserify/test/browser_field_resolve/l/main.js b/node_modules/browserify/test/browser_field_resolve/l/main.js new file mode 100644 index 000000000..993b834eb --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/l/main.js @@ -0,0 +1,2 @@ +var zzz = require('x/zzz') +console.log(zzz) diff --git a/node_modules/browserify/test/browser_field_resolve/l/node_modules/x/hey.js b/node_modules/browserify/test/browser_field_resolve/l/node_modules/x/hey.js new file mode 100644 index 000000000..6202b34c2 --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/l/node_modules/x/hey.js @@ -0,0 +1 @@ +module.exports = 3000 diff --git a/node_modules/browserify/test/browser_field_resolve/l/node_modules/x/package.json b/node_modules/browserify/test/browser_field_resolve/l/node_modules/x/package.json new file mode 100644 index 000000000..aa9ac588b --- /dev/null +++ b/node_modules/browserify/test/browser_field_resolve/l/node_modules/x/package.json @@ -0,0 +1,5 @@ +{ + "browser": { + "./zzz.js": "./hey" + } +} diff --git a/node_modules/browserify/test/buffer.js b/node_modules/browserify/test/buffer.js new file mode 100644 index 000000000..7cfdb1c0f --- /dev/null +++ b/node_modules/browserify/test/buffer.js @@ -0,0 +1,144 @@ +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); + +if (!ArrayBuffer.isView) ArrayBuffer.isView = function () { return false; }; + +test('utf8 buffer to base64', function (t) { + t.plan(1); + var b = browserify(); + b.require('buffer'); + b.bundle(function (err, src) { + if (err) return t.fail(err); + var c = context(); + vm.runInNewContext(src, c); + t.equal( + new c.require('buffer').Buffer("Ձאab", "utf8").toString("base64"), + new Buffer("Ձאab", "utf8").toString("base64") + ); + }); +}); + +test('utf8 buffer to hex', function (t) { + t.plan(1); + var b = browserify(); + b.require('buffer'); + b.bundle(function (err, src) { + var c = context(); + vm.runInNewContext(src, c); + t.equal( + new c.require('buffer').Buffer("Ձאab", "utf8").toString("hex"), + new Buffer("Ձאab", "utf8").toString("hex") + ); + }); +}); + +test('ascii buffer to base64', function (t) { + t.plan(1); + var b = browserify(); + b.require('buffer'); + + b.bundle(function (err, src) { + var c = context(); + vm.runInNewContext(src, c); + t.equal( + new c.require('buffer').Buffer("123456!@#$%^", "ascii").toString("base64"), + new Buffer("123456!@#$%^", "ascii").toString("base64") + ); + }); +}); + +test('ascii buffer to hex', function (t) { + t.plan(1); + var b = browserify(); + b.require('buffer'); + b.bundle(function (err, src) { + var c = context(); + vm.runInNewContext(src, c); + t.equal( + new c.require('buffer').Buffer("123456!@#$%^", "ascii").toString("hex"), + new Buffer("123456!@#$%^", "ascii").toString("hex") + ); + }); +}); + +test('base64 buffer to utf8', function (t) { + t.plan(1); + var b = browserify(); + b.require('buffer'); + b.bundle(function (err, src) { + var c = context(); + vm.runInNewContext(src, c); + t.equal( + new c.require('buffer').Buffer("1YHXkGFi", "base64").toString("utf8"), + new Buffer("1YHXkGFi", "base64").toString("utf8") + ); + }); +}); + +test('hex buffer to utf8', function (t) { + t.plan(1); + var b = browserify(); + b.require('buffer'); + b.bundle(function (err, src) { + var c = context(); + vm.runInNewContext(src, c); + var B = c.require('buffer'); + t.equal( + new B.Buffer("d581d7906162", "hex").toString("utf8"), + new Buffer("d581d7906162", "hex").toString("utf8") + ); + }); +}); + +test('base64 buffer to ascii', function (t) { + t.plan(1); + var b = browserify(); + b.require('buffer'); + b.bundle(function (err, src) { + var c = context(); + vm.runInNewContext(src, c); + t.equal( + new c.require('buffer').Buffer("MTIzNDU2IUAjJCVe", "base64").toString("ascii"), + new Buffer("MTIzNDU2IUAjJCVe", "base64").toString("ascii") + ); + }); +}); + +test('hex buffer to ascii', function (t) { + t.plan(1); + var b = browserify(); + b.require('buffer'); + b.bundle(function (err, src) { + var c = context(); + vm.runInNewContext(src, c); + t.equal( + new c.require('buffer').Buffer("31323334353621402324255e", "hex").toString("ascii"), + new Buffer("31323334353621402324255e", "hex").toString("ascii") + ); + }); +}); + +test('indexing a buffer', function (t) { + t.plan(5); + var b = browserify(); + b.require('buffer'); + b.bundle(function (err, src) { + var c = context(); + vm.runInNewContext(src, c); + var buf = c.require('buffer').Buffer('abc'); + t.equal(buf[0], 97); + t.equal(buf[1], 98); + t.equal(buf[2], 99); + t.equal(buf[3], undefined); + t.equal(buf.toString('utf8'), 'abc'); + }); +}); + +function context () { + return { + ArrayBuffer: ArrayBuffer, + Uint8Array: Uint8Array, + DataView: DataView + }; +} diff --git a/node_modules/browserify/test/bundle-bundle-external.js b/node_modules/browserify/test/bundle-bundle-external.js new file mode 100644 index 000000000..559e7f1fc --- /dev/null +++ b/node_modules/browserify/test/bundle-bundle-external.js @@ -0,0 +1,31 @@ +var browserify = require('../'); +var test = require('tap').test; + +var pubdir = __dirname; +var dir = pubdir + '/bundle-bundle-external'; + +var opt = { + debug: true, + basedir: pubdir, + exposeAll: true +}; + +test('bundle bundle external', function (t) { + t.plan(1); + var bundle1 = browserify(opt); + var name = dir + '/foo.js'; + bundle1.require(name, { entry: true, expose: name, basedir: pubdir }); + + var bundle2 = browserify({ + debug: true, + basedir: pubdir, + entries: [ dir + '/baz.js' ] + }); + + // adding and removing this line causes failure // + //bundle2.external(bundle1); + + bundle2.bundle(function(err, src) { + t.ifError(err); + }); +}); diff --git a/node_modules/browserify/test/bundle-bundle-external/bar.js b/node_modules/browserify/test/bundle-bundle-external/bar.js new file mode 100644 index 000000000..8079379c1 --- /dev/null +++ b/node_modules/browserify/test/bundle-bundle-external/bar.js @@ -0,0 +1,2 @@ +module.exports = 'bar'; +done(); diff --git a/node_modules/browserify/test/bundle-bundle-external/baz.js b/node_modules/browserify/test/bundle-bundle-external/baz.js new file mode 100644 index 000000000..1dda5de34 --- /dev/null +++ b/node_modules/browserify/test/bundle-bundle-external/baz.js @@ -0,0 +1,3 @@ +var foo = require('./foo'); +assert.equal(foo, 'foo'); +done(); diff --git a/node_modules/browserify/test/bundle-bundle-external/foo.js b/node_modules/browserify/test/bundle-bundle-external/foo.js new file mode 100644 index 000000000..99cf946d2 --- /dev/null +++ b/node_modules/browserify/test/bundle-bundle-external/foo.js @@ -0,0 +1,5 @@ +var bar = require('./bar'); +assert.equal(bar, 'bar'); + +module.exports = 'foo'; +done(); diff --git a/node_modules/browserify/test/bundle-stream.js b/node_modules/browserify/test/bundle-stream.js new file mode 100644 index 000000000..4193b3342 --- /dev/null +++ b/node_modules/browserify/test/bundle-stream.js @@ -0,0 +1,18 @@ +var browserify = require('../'); +var test = require('tap').test; + +var isReadable = require('isstream').isReadable; +var isWritable = require('isstream').isWritable; + +test('bundle is readable stream', function (t) { + t.plan(4); + var b = browserify(__dirname + '/entry/main.js'); + b.on('bundle', function(bundle) { + t.ok(isReadable(bundle)); + t.notok(isWritable(bundle)); + }); + + var stream = b.bundle(); + t.ok(isReadable(stream)); + t.notok(isWritable(stream)); +}); diff --git a/node_modules/browserify/test/bundle.js b/node_modules/browserify/test/bundle.js new file mode 100644 index 000000000..115317a61 --- /dev/null +++ b/node_modules/browserify/test/bundle.js @@ -0,0 +1,33 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('bundle', function (t) { + var b = browserify(); + b.require('seq'); + b.bundle(function (err, src) { + t.plan(3); + + t.ifError(err); + t.ok(src.length > 0); + + var c = { + setTimeout : setTimeout, + clearTimeout : clearTimeout, + console : console + }; + vm.runInNewContext(src, c); + + c.require('seq')([1,2,3]) + .parMap_(function (next, x) { + setTimeout(function () { + next.ok(x * 100) + }, 10) + }) + .seq(function (x,y,z) { + t.deepEqual([x,y,z], [100,200,300]); + t.end(); + }) + ; + }); +}); diff --git a/node_modules/browserify/test/bundle_external.js b/node_modules/browserify/test/bundle_external.js new file mode 100644 index 000000000..05a0ac272 --- /dev/null +++ b/node_modules/browserify/test/bundle_external.js @@ -0,0 +1,26 @@ +var test = require('tap').test; +var browserify = require('../'); +var vm = require('vm'); + +test('bundle external', function (t) { + t.plan(3); + + var expected = [ + { name: 'beep', value: 111 }, + { name: 't-rex', value: 5 } + ]; + + var b = browserify({ bundleExternal: false }); + b.add(__dirname + '/bundle_external/main.js'); + b.bundle(function (err, src) { + var c = { + t: t, + require: function (name) { + var r = expected.shift(); + t.equal(name, r.name); + return r.value; + } + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/bundle_external/boop.js b/node_modules/browserify/test/bundle_external/boop.js new file mode 100644 index 000000000..e785264e0 --- /dev/null +++ b/node_modules/browserify/test/bundle_external/boop.js @@ -0,0 +1,4 @@ +var robot = require('./robot.js'); +var trex = require('t-rex'); + +module.exports = function (n) { return robot(n) * trex }; diff --git a/node_modules/browserify/test/bundle_external/main.js b/node_modules/browserify/test/bundle_external/main.js new file mode 100644 index 000000000..88e3f1d75 --- /dev/null +++ b/node_modules/browserify/test/bundle_external/main.js @@ -0,0 +1,4 @@ +var beep = require('beep'); +var boop = require('./boop.js'); + +t.equal(boop(beep), 560); diff --git a/node_modules/browserify/test/bundle_external/robot.js b/node_modules/browserify/test/bundle_external/robot.js new file mode 100644 index 000000000..2a569dd9c --- /dev/null +++ b/node_modules/browserify/test/bundle_external/robot.js @@ -0,0 +1 @@ +module.exports = function (n) { return n + 1 }; diff --git a/node_modules/browserify/test/bundle_external_global.js b/node_modules/browserify/test/bundle_external_global.js new file mode 100644 index 000000000..ae02b8105 --- /dev/null +++ b/node_modules/browserify/test/bundle_external_global.js @@ -0,0 +1,24 @@ +var test = require('tap').test; +var browserify = require('../'); +var through = require('through2'); +var vm = require('vm'); + +test('bundle external global', function (t) { + t.plan(1); + + var stream = through(); + stream.push('console.log(process)'); + stream.push(null); + + var b = browserify({ bundleExternal: false }); + b.add(stream); + b.bundle(function (err, src) { + vm.runInNewContext(src, { + console: { log: log }, + process: process + }); + function log (msg) { + t.equal(msg, process); + } + }); +}); diff --git a/node_modules/browserify/test/bundle_sourcemap.js b/node_modules/browserify/test/bundle_sourcemap.js new file mode 100644 index 000000000..02b8f4323 --- /dev/null +++ b/node_modules/browserify/test/bundle_sourcemap.js @@ -0,0 +1,32 @@ +var browserify = require('../'); +var test = require('tap').test; + +test('bundle in debug mode', function (t) { + t.plan(3); + + var b = browserify({ debug: true }); + b.require('seq'); + b.bundle(function (err, buf) { + var src = buf.toString('utf8'); + var secondtolastLine = src.split('\n').slice(-2); + + t.ok(typeof src === 'string'); + t.ok(src.length > 0); + t.ok(/^\/\/# sourceMappingURL=/.test(secondtolastLine), 'includes sourcemap'); + }); +}); + +test('bundle in non debug mode', function (t) { + t.plan(3); + + var b = browserify(); + b.require('seq'); + b.bundle(function (err, buf) { + var src = buf.toString('utf8'); + var secondtolastLine = src.split('\n').slice(-2); + + t.ok(typeof src === 'string'); + t.ok(src.length > 0); + t.notOk(/^\/\/# sourceMappingURL=/.test(secondtolastLine), 'includes no sourcemap'); + }); +}); diff --git a/node_modules/browserify/test/catch.js b/node_modules/browserify/test/catch.js new file mode 100644 index 000000000..f85b67baf --- /dev/null +++ b/node_modules/browserify/test/catch.js @@ -0,0 +1,22 @@ +var browserify = require('../'); +var test = require('tap').test; + +test('catch pipeline errors with a callback', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/catch/main.js'); + b.bundle(function (err, src) { + t.ok(err); + t.ok(/no_such_file/.test(err)); + }); +}); + +test('catch pipeline errors with an event', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/catch/main.js').bundle(); + b.on('error', function (err) { + t.ok(err); + t.ok(/no_such_file/.test(err)); + }); +}); diff --git a/node_modules/browserify/test/catch/main.js b/node_modules/browserify/test/catch/main.js new file mode 100644 index 000000000..a522a65cb --- /dev/null +++ b/node_modules/browserify/test/catch/main.js @@ -0,0 +1 @@ +require('./no_such_file'); diff --git a/node_modules/browserify/test/circular.js b/node_modules/browserify/test/circular.js new file mode 100644 index 000000000..92efadee3 --- /dev/null +++ b/node_modules/browserify/test/circular.js @@ -0,0 +1,34 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('circular', function (t) { + t.plan(1); + + var b = browserify(__dirname + '/circular/main.js'); + b.bundle(function (err, src) { + vm.runInNewContext(src, { t: t }); + }); +}); + +test('circular expose', function (t) { + t.plan(1); + + var b = browserify(__dirname + '/circular/main.js'); + b.require(__dirname + '/circular/a.js', { expose: './a.js' }); + b.require(__dirname + '/circular/b.js', { expose: './b.js' }); + b.bundle(function (err, src) { + vm.runInNewContext(src, { t: t }); + }); +}); + +test('circular require', function (t) { + t.plan(1); + + var b = browserify(__dirname + '/circular/main.js'); + b.require(__dirname + '/circular/a.js'); + b.require(__dirname + '/circular/b.js'); + b.bundle(function (err, src) { + vm.runInNewContext(src, { t: t }); + }); +}); diff --git a/node_modules/browserify/test/circular/a.js b/node_modules/browserify/test/circular/a.js new file mode 100644 index 000000000..f3adf1da0 --- /dev/null +++ b/node_modules/browserify/test/circular/a.js @@ -0,0 +1,3 @@ +exports.a = 1; +exports.b = require('./b'); +exports.a = 5; diff --git a/node_modules/browserify/test/circular/b.js b/node_modules/browserify/test/circular/b.js new file mode 100644 index 000000000..f342a8420 --- /dev/null +++ b/node_modules/browserify/test/circular/b.js @@ -0,0 +1 @@ +module.exports = 2 + require('./a').a diff --git a/node_modules/browserify/test/circular/main.js b/node_modules/browserify/test/circular/main.js new file mode 100644 index 000000000..cbabf9710 --- /dev/null +++ b/node_modules/browserify/test/circular/main.js @@ -0,0 +1 @@ +t.deepEqual(require('./a.js'), { a: 5, b: 3 }); diff --git a/node_modules/browserify/test/coffee_bin.js b/node_modules/browserify/test/coffee_bin.js new file mode 100644 index 000000000..e50569236 --- /dev/null +++ b/node_modules/browserify/test/coffee_bin.js @@ -0,0 +1,36 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var path = require('path'); +var vm = require('vm'); + +test('compiling coffee with -c', function (t) { + t.plan(4); + + var cwd = process.cwd(); + process.chdir(__dirname); + + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + '-c', '"' + process.execPath + '" "' + __dirname + '/../node_modules/coffee-script/bin/coffee" -sc', + 'coffee_bin/main.coffee' + ]); + var src = ''; + var err = ''; + ps.stdout.on('data', function (buf) { src += buf }); + ps.stderr.on('data', function (buf) { err += buf }); + + ps.on('exit', function (code) { + t.equal(code, 0); + t.equal(err, ''); + + var msgs = [ 'hello world!', 'from x!' ]; + var c = { + console: { + log: function (msg) { + t.equal(msg, msgs.shift()); + } + } + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/coffee_bin/main.coffee b/node_modules/browserify/test/coffee_bin/main.coffee new file mode 100644 index 000000000..e9b9dc923 --- /dev/null +++ b/node_modules/browserify/test/coffee_bin/main.coffee @@ -0,0 +1,2 @@ +console.log "hello world!" +require './x.coffee' diff --git a/node_modules/browserify/test/coffee_bin/x.coffee b/node_modules/browserify/test/coffee_bin/x.coffee new file mode 100644 index 000000000..3bbf3ca33 --- /dev/null +++ b/node_modules/browserify/test/coffee_bin/x.coffee @@ -0,0 +1 @@ +console.log "from x!" diff --git a/node_modules/browserify/test/coffeeify.js b/node_modules/browserify/test/coffeeify.js new file mode 100644 index 000000000..176008c00 --- /dev/null +++ b/node_modules/browserify/test/coffeeify.js @@ -0,0 +1,19 @@ +var test = require('tap').test; +var browserify = require('../'); +var vm = require('vm'); + +test('coffeeify with an implicit global', function (t) { + t.plan(1); + + var b = browserify(__dirname + '/coffeeify/main.coffee'); + b.transform('coffeeify'); + b.bundle(function (err, src) { + if (err) t.fail(err); + vm.runInNewContext(src, { + console: { log: log }, + setTimeout: setTimeout, + clearTimeout: clearTimeout + }); + function log (msg) { t.equal(msg, 'eyo') } + }); +}); diff --git a/node_modules/browserify/test/coffeeify/main.coffee b/node_modules/browserify/test/coffeeify/main.coffee new file mode 100644 index 000000000..3e6a9e823 --- /dev/null +++ b/node_modules/browserify/test/coffeeify/main.coffee @@ -0,0 +1,2 @@ +process.nextTick -> + console.log 'eyo' diff --git a/node_modules/browserify/test/comment.js b/node_modules/browserify/test/comment.js new file mode 100644 index 000000000..f22278f4e --- /dev/null +++ b/node_modules/browserify/test/comment.js @@ -0,0 +1,16 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('trailing comment', function (t) { + t.plan(1); + var b = browserify(__dirname + '/comment/main.js'); + b.bundle(function (err, src) { + var c = { + ex : function (obj) { + t.same(obj, 1234); + } + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/comment/main.js b/node_modules/browserify/test/comment/main.js new file mode 100644 index 000000000..2eca52644 --- /dev/null +++ b/node_modules/browserify/test/comment/main.js @@ -0,0 +1,2 @@ +ex(1234) +// test \ No newline at end of file diff --git a/node_modules/browserify/test/constants.js b/node_modules/browserify/test/constants.js new file mode 100644 index 000000000..0efbc6d2d --- /dev/null +++ b/node_modules/browserify/test/constants.js @@ -0,0 +1,18 @@ +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); +var through = require('through2'); + +test('constants', function (t) { + t.plan(2); + var stream = through(); + stream.push('console.log(require("constants").ENOENT)'); + stream.push(null); + var b = browserify(stream); + + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { console: { log: log } }); + function log (msg) { t.equal(msg, 2) } + }); +}); diff --git a/node_modules/browserify/test/crypto.js b/node_modules/browserify/test/crypto.js new file mode 100644 index 000000000..7edb25594 --- /dev/null +++ b/node_modules/browserify/test/crypto.js @@ -0,0 +1,41 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var path = require('path'); +var fs = require('fs'); +var vm = require('vm'); +var concat = require('concat-stream'); + +var temp = require('temp'); +temp.track(); +var tmpdir = temp.mkdirSync({prefix: 'browserify-test'}); + +fs.writeFileSync(tmpdir + '/main.js', 'beep(require("crypto"))\n'); + +if (!ArrayBuffer.isView) ArrayBuffer.isView = function () { return false; }; + +test('*-browserify libs from node_modules/', function (t) { + t.plan(2); + + var bin = __dirname + '/../bin/cmd.js'; + var ps = spawn(process.execPath, [ bin, 'main.js' ], { cwd : tmpdir }); + + ps.stderr.pipe(process.stderr, { end : false }); + + ps.on('exit', function (code) { + t.equal(code, 0); + }); + + ps.stdout.pipe(concat(function (src) { + var c = { + Int32Array: Int32Array, + ArrayBuffer: ArrayBuffer, + Uint8Array: Uint8Array, + DataView: DataView, + beep : function (c) { + t.equal(typeof c.createHash, 'function'); + }, + require: function () {} + }; + vm.runInNewContext(src.toString('utf8'), c); + })); +}); diff --git a/node_modules/browserify/test/crypto_ig.js b/node_modules/browserify/test/crypto_ig.js new file mode 100644 index 000000000..c60b5bf60 --- /dev/null +++ b/node_modules/browserify/test/crypto_ig.js @@ -0,0 +1,41 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var path = require('path'); +var fs = require('fs'); +var vm = require('vm'); +var concat = require('concat-stream'); + +var temp = require('temp'); +temp.track(); +var tmpdir = temp.mkdirSync({prefix: 'browserify-test'}); + +fs.writeFileSync(tmpdir + '/main.js', 'beep(require("crypto"))\n'); + +if (!ArrayBuffer.isView) ArrayBuffer.isView = function () { return false; }; + +test('crypto --insertGlobals', function (t) { + t.plan(2); + + var bin = __dirname + '/../bin/cmd.js'; + var ps = spawn(process.execPath, [ bin, 'main.js', '--ig' ], { cwd : tmpdir }); + + ps.stderr.pipe(process.stderr, { end : false }); + + ps.on('exit', function (code) { + t.equal(code, 0); + }); + + ps.stdout.pipe(concat(function (src) { + var c = { + Int32Array: Int32Array, + ArrayBuffer: ArrayBuffer, + Uint8Array: Uint8Array, + DataView: DataView, + beep : function (c) { + t.equal(typeof c.createHash, 'function'); + }, + require: function () {} + }; + vm.runInNewContext(src.toString('utf8'), c); + })); +}); diff --git a/node_modules/browserify/test/cycle.js b/node_modules/browserify/test/cycle.js new file mode 100644 index 000000000..6cfd3c259 --- /dev/null +++ b/node_modules/browserify/test/cycle.js @@ -0,0 +1,13 @@ +var test = require('tap').test; +var browserify = require('../'); +var vm = require('vm'); + +test('cycle', function (t) { + t.plan(2); + var b = browserify(__dirname + '/cycle/entry.js'); + b.bundle(function (err, body) { + t.ifError(err); + vm.runInNewContext(body); + t.ok(true); + }); +}); diff --git a/node_modules/browserify/test/cycle/README.md b/node_modules/browserify/test/cycle/README.md new file mode 100644 index 000000000..d41c39739 --- /dev/null +++ b/node_modules/browserify/test/cycle/README.md @@ -0,0 +1,16 @@ +browserify-bug-713 +================== + +substack/node-browserify#713 breaks resolving an identical module multiple time from different locations when the module has a circular require. + +## Reproduce + +Module requires two copies of the same module (identical apart from path) and the sub module has a circular require. + +## Example + +This is the case with [readable-stream](https://github.com/isaacs/readable-stream). If two different modules depend on the same version readable-stream (and no npm dedupe), then both of those modules are required in the same project, browserify throws a `RangeError: Maximum call stack size exceeded` + +See https://github.com/isaacs/readable-stream/blob/master/lib/_stream_writable.js#L134 and https://github.com/isaacs/readable-stream/blob/master/lib/_stream_duplex.js#L44 + +This issue is most likely related: substack/node-browserify#735 diff --git a/node_modules/browserify/test/cycle/entry.js b/node_modules/browserify/test/cycle/entry.js new file mode 100644 index 000000000..6a8dd8ebd --- /dev/null +++ b/node_modules/browserify/test/cycle/entry.js @@ -0,0 +1,15 @@ +// RE: substack/node-browserify#713 + +// https://github.com/substack/node-browserify/pull/713 breaks resolving +// an identical module multiple time from different locations when the +// module has a circular require. + +// other than path, mod1 and mod2 are identical + +require('./mod1/a') +require('./mod2/a') + +// browserify entry.js + +// works in 3.37.2 +// >= 3.38 throws RangeError: Maximum call stack size exceeded \ No newline at end of file diff --git a/node_modules/browserify/test/cycle/mod1/a.js b/node_modules/browserify/test/cycle/mod1/a.js new file mode 100644 index 000000000..c40d2fed2 --- /dev/null +++ b/node_modules/browserify/test/cycle/mod1/a.js @@ -0,0 +1 @@ +require('./b') \ No newline at end of file diff --git a/node_modules/browserify/test/cycle/mod1/b.js b/node_modules/browserify/test/cycle/mod1/b.js new file mode 100644 index 000000000..54c7b9c11 --- /dev/null +++ b/node_modules/browserify/test/cycle/mod1/b.js @@ -0,0 +1 @@ +require('./a') \ No newline at end of file diff --git a/node_modules/browserify/test/cycle/mod2/a.js b/node_modules/browserify/test/cycle/mod2/a.js new file mode 100644 index 000000000..c40d2fed2 --- /dev/null +++ b/node_modules/browserify/test/cycle/mod2/a.js @@ -0,0 +1 @@ +require('./b') \ No newline at end of file diff --git a/node_modules/browserify/test/cycle/mod2/b.js b/node_modules/browserify/test/cycle/mod2/b.js new file mode 100644 index 000000000..54c7b9c11 --- /dev/null +++ b/node_modules/browserify/test/cycle/mod2/b.js @@ -0,0 +1 @@ +require('./a') \ No newline at end of file diff --git a/node_modules/browserify/test/debug_standalone.js b/node_modules/browserify/test/debug_standalone.js new file mode 100644 index 000000000..207090c3a --- /dev/null +++ b/node_modules/browserify/test/debug_standalone.js @@ -0,0 +1,64 @@ +var test = require('tap').test; +var browserify = require('../'); +var through = require('through2'); +var vm = require('vm'); + +test('ordinary debug', function (t) { + t.plan(1); + + var stream = through(); + stream.push('console.log(1+2)'); + stream.push(null); + + var b = browserify({ debug: true }); + b.add(stream); + b.bundle(function (err, buf) { + var src = buf.toString('utf8'); + var last = src.split('\n').slice(-2)[0]; + t.ok( + /\/\/# sourceMappingURL=data:application\/json;charset=utf-8;base64,[\w+\/=]+$/ + .test(last) + ); + }); +}); + +test('debug standalone', function (t) { + t.plan(1); + + var stream = through(); + stream.push('console.log(1+2)'); + stream.push(null); + + var b = browserify({ debug: true, standalone: 'xyz' }); + b.add(stream); + b.bundle(function (err, buf) { + var src = buf.toString('utf8'); + var last = src.split('\n').slice(-2)[0]; + t.ok( + /\/\/# sourceMappingURL=data:application\/json;charset=utf-8;base64,[\w+\/=]+$/ + .test(last) + ); + }); +}); + +test('debug standalone exposed', function (t) { + t.plan(2); + + var stream = through(); + stream.push('console.log(1+2)'); + stream.push(null); + + var b = browserify({ debug: true, standalone: 'xyz' }); + b.require(__dirname + '/debug_standalone/x.js', { expose: 'xxx' }); + b.bundle(function (err, buf) { + var src = buf.toString('utf8'); + var last = src.split('\n').slice(-2)[0]; + t.ok( + /\/\/# sourceMappingURL=data:application\/json;charset=utf-8;base64,[\w+\/=]+$/ + .test(last) + ); + var c = { window: {} }; + vm.runInNewContext(src, c); + t.equal(c.window.xyz, 555); + }); +}); diff --git a/node_modules/browserify/test/debug_standalone/x.js b/node_modules/browserify/test/debug_standalone/x.js new file mode 100644 index 000000000..3e842e734 --- /dev/null +++ b/node_modules/browserify/test/debug_standalone/x.js @@ -0,0 +1 @@ +module.exports = 555 diff --git a/node_modules/browserify/test/dedupe-deps.js b/node_modules/browserify/test/dedupe-deps.js new file mode 100644 index 000000000..ebb6dedc2 --- /dev/null +++ b/node_modules/browserify/test/dedupe-deps.js @@ -0,0 +1,59 @@ +var browserify = require('../'); +var test = require('tap').test; + +test('identical content gets deduped and the row gets an implicit dep on the original source', function (t) { + t.plan(1) + + var rows = []; + browserify() + .on('dep', [].push.bind(rows)) + .require(require.resolve('./dup'), { entry: true }) + .bundle(check); + + function check(err, src) { + if (err) return t.fail(err); + var deduped = rows.filter(function (x) { return x.dedupeIndex }); + var d = deduped[0]; + + t.deepEqual(d.deps, { 'dup': d.dedupeIndex }, "adds implicit dep"); + } +}) + +test('identical content gets deduped with fullPaths', function (t) { + t.plan(1) + + var rows = []; + browserify({fullPaths: true}) + .on('dep', [].push.bind(rows)) + .require(require.resolve('./dup'), { entry: true }) + .bundle(check); + + function check(err, src) { + if (err) return t.fail(err); + var deduped = rows.filter(function (x) { return x.dedupe }); + var d = deduped[0]; + + t.deepEqual( + d.source, + 'arguments[4]['+ JSON.stringify(d.dedupe) + '][0]' + + '.apply(exports,arguments)', + "dedupes content" + ); + } +}) + +test('identical content does not get deduped with dedupe option false', function (t) { + t.plan(1) + + var rows = []; + browserify({fullPaths: true, dedupe: false}) + .on('dep', [].push.bind(rows)) + .require(require.resolve('./dup'), { entry: true }) + .bundle(check); + + function check(err, src) { + if (err) return t.fail(err); + var deduped = rows.filter(function (x) { return x.dedupe }); + t.equal(deduped.length, 0, 'does not dedupe'); + } +}) diff --git a/node_modules/browserify/test/dedupe-nomap.js b/node_modules/browserify/test/dedupe-nomap.js new file mode 100644 index 000000000..906fadc0e --- /dev/null +++ b/node_modules/browserify/test/dedupe-nomap.js @@ -0,0 +1,64 @@ +var browserify = require('../'); +var test = require('tap').test; + +test('identical content gets deduped and the row gets a "nomap" flag set when sourcemaps are turned on', function (t) { + t.plan(4) + + var rows = []; + browserify({ debug: true }) + .on('dep', [].push.bind(rows)) + .require(require.resolve('./dup'), { entry: true }) + .bundle(check); + + function check(err, src) { + if (err) return t.fail(err); + var nomappeds = rows.filter(function (x) { return x.nomap }); + var nm = nomappeds[0]; + + t.equal(rows.length, 3, 'packs 3 rows'); + t.equal(nomappeds.length, 1, 'one of has nomapped flag set'); + t.equal( + rows.filter(function (x) { + return x.id == nm.dedupeIndex + }).length, + 1, + '2 rows with the same hash as the duplicate exist' + ); + t.similar( + nm.source, + /arguments\[4\]\[.+\]\[0\]\.apply\(exports,arguments\)$/, + 'redirects duplicate to original via require call' + ); + } +}) + +test('identical content gets deduped and the row gets a "nomap" flag set when sourcemaps are turned off', function (t) { + t.plan(4) + + var rows = []; + browserify({ debug: false }) + .on('dep', [].push.bind(rows)) + .require(require.resolve('./dup'), { entry: true }) + .bundle(check); + + function check(err, src) { + if (err) return t.fail(err); + var nomappeds = rows.filter(function (x) { return x.nomap }); + var nm = nomappeds[0]; + + t.equal(rows.length, 3, 'packs 3 rows'); + t.equal(nomappeds.length, 1, 'one of has nomapped flag set'); + t.equal( + rows.filter(function (x) { + return x.id == nm.dedupeIndex + }).length, + 1, + '2 rows with the same hash as the duplicate exist' + ); + t.similar( + nm.source, + /arguments\[4\]\[.+\]\[0\]\.apply\(exports,arguments\)$/, + 'redirects duplicate to original via require call' + ); + } +}) diff --git a/node_modules/browserify/test/delay.js b/node_modules/browserify/test/delay.js new file mode 100644 index 000000000..63c1d8785 --- /dev/null +++ b/node_modules/browserify/test/delay.js @@ -0,0 +1,25 @@ +var browserify = require('../'); +var vm = require('vm'); +var path = require('path'); +var test = require('tap').test; +var through = require('through2'); + +test('delay for pipelines', function (t) { + t.plan(3); + + var b = browserify(__dirname + '/delay/main.js'); + b.pipeline.get('record').push(through.obj(function (row, enc, next) { + if (row.file) { + t.equal(row.file, path.join(__dirname, 'delay/main.js')); + row.file = path.join(__dirname, 'delay/diverted.js'); + } + this.push(row); + next(); + })); + + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { console: { log: log } }); + function log (msg) { t.equal(msg, 900) } + }); +}); diff --git a/node_modules/browserify/test/delay/diverted.js b/node_modules/browserify/test/delay/diverted.js new file mode 100644 index 000000000..3037cd95e --- /dev/null +++ b/node_modules/browserify/test/delay/diverted.js @@ -0,0 +1 @@ +console.log(900) diff --git a/node_modules/browserify/test/delay/main.js b/node_modules/browserify/test/delay/main.js new file mode 100644 index 000000000..67eaa257b --- /dev/null +++ b/node_modules/browserify/test/delay/main.js @@ -0,0 +1 @@ +console.log(500) diff --git a/node_modules/browserify/test/dep.js b/node_modules/browserify/test/dep.js new file mode 100644 index 000000000..13ee026e4 --- /dev/null +++ b/node_modules/browserify/test/dep.js @@ -0,0 +1,25 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('dependency events', function (t) { + t.plan(4); + var b = browserify(__dirname + '/entry/main.js'); + var deps = []; + b.on('dep', function (row) { + deps.push({ id: row.id, deps: row.deps }); + t.equal(typeof row.source, 'string'); + }); + + b.bundle(function (err, src) { + t.deepEqual(deps.sort(cmp), [ + { id: 1, deps: { './one': 2, './two': 3 } }, + { id: 2, deps: {} }, + { id: 3, deps: {} } + ]); + }); + + function cmp (a, b) { + return a.id < b.id ? -1 : 1; + } +}); diff --git a/node_modules/browserify/test/dollar.js b/node_modules/browserify/test/dollar.js new file mode 100644 index 000000000..872cee535 --- /dev/null +++ b/node_modules/browserify/test/dollar.js @@ -0,0 +1,17 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('dollar', function (t) { + t.plan(2); + var b = browserify(); + b.require(__dirname + '/dollar/dollar/index.js', { expose: 'dollar' }); + b.bundle(function (err, src) { + t.ok(src.length > 0); + + var c = {}; + vm.runInNewContext(src, c); + var res = vm.runInNewContext('require("dollar")(100)', c); + t.equal(res, 10000); + }); +}); diff --git a/node_modules/browserify/test/dollar/dollar/index.js b/node_modules/browserify/test/dollar/dollar/index.js new file mode 100644 index 000000000..a6012aa6b --- /dev/null +++ b/node_modules/browserify/test/dollar/dollar/index.js @@ -0,0 +1,7 @@ +// foo $ bar $ baz + +var $ = function (x) { + return x * 100; +}; + +module.exports = $; diff --git a/node_modules/browserify/test/double_buffer.js b/node_modules/browserify/test/double_buffer.js new file mode 100644 index 000000000..dfda808f9 --- /dev/null +++ b/node_modules/browserify/test/double_buffer.js @@ -0,0 +1,16 @@ +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); + +if (!ArrayBuffer.isView) ArrayBuffer.isView = function () { return false; }; + +test('double buffer', function (t) { + t.plan(1); + + var b = browserify(__dirname + '/double_buffer/main.js'); + b.require('buffer'); + b.bundle(function (err, src) { + if (err) return t.fail(err); + vm.runInNewContext(src, { t: t, Uint8Array: Uint8Array }); + }); +}); diff --git a/node_modules/browserify/test/double_buffer/explicit.js b/node_modules/browserify/test/double_buffer/explicit.js new file mode 100644 index 000000000..fa76b1f45 --- /dev/null +++ b/node_modules/browserify/test/double_buffer/explicit.js @@ -0,0 +1 @@ +module.exports = require('buffer').Buffer diff --git a/node_modules/browserify/test/double_buffer/implicit.js b/node_modules/browserify/test/double_buffer/implicit.js new file mode 100644 index 000000000..70c9e753b --- /dev/null +++ b/node_modules/browserify/test/double_buffer/implicit.js @@ -0,0 +1 @@ +module.exports = Buffer diff --git a/node_modules/browserify/test/double_buffer/main.js b/node_modules/browserify/test/double_buffer/main.js new file mode 100644 index 000000000..bf124fd81 --- /dev/null +++ b/node_modules/browserify/test/double_buffer/main.js @@ -0,0 +1,4 @@ +var implicit = require('./implicit.js'); +var explicit = require('./explicit.js'); + +t.equal(implicit, explicit); diff --git a/node_modules/browserify/test/double_bundle.js b/node_modules/browserify/test/double_bundle.js new file mode 100644 index 000000000..d5b9a1b41 --- /dev/null +++ b/node_modules/browserify/test/double_bundle.js @@ -0,0 +1,24 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('double bundle', function (t) { + t.plan(5); + + var b = browserify(__dirname + '/entry/main.js'); + b.bundle(function (err, src0) { + t.ifError(err); + var c = { + done : function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + } + }; + vm.runInNewContext(src0, c); + + b.bundle(function (err, src1) { + t.ifError(err); + t.equal(src1.toString('utf8'), src0.toString('utf8')); + }); + }); +}); diff --git a/node_modules/browserify/test/double_bundle_error.js b/node_modules/browserify/test/double_bundle_error.js new file mode 100644 index 000000000..02ff015e7 --- /dev/null +++ b/node_modules/browserify/test/double_bundle_error.js @@ -0,0 +1,17 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('double bundle error', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/double_bundle_error/main.js'); + var x = b.bundle(); + x.on('error', function (err) { + t.ok(err); + var y = b.bundle(); + y.on('error', function (err) { + t.ok(err); + }); + }); +}); diff --git a/node_modules/browserify/test/double_bundle_error/main.js b/node_modules/browserify/test/double_bundle_error/main.js new file mode 100644 index 000000000..89bb8a036 --- /dev/null +++ b/node_modules/browserify/test/double_bundle_error/main.js @@ -0,0 +1 @@ +done(require('./one'), require('./two')); \ No newline at end of file diff --git a/node_modules/browserify/test/double_bundle_error/needs_three.js b/node_modules/browserify/test/double_bundle_error/needs_three.js new file mode 100644 index 000000000..9def415e6 --- /dev/null +++ b/node_modules/browserify/test/double_bundle_error/needs_three.js @@ -0,0 +1 @@ +require("three"); diff --git a/node_modules/browserify/test/double_bundle_error/one.js b/node_modules/browserify/test/double_bundle_error/one.js new file mode 100644 index 000000000..bd816eaba --- /dev/null +++ b/node_modules/browserify/test/double_bundle_error/one.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/browserify/test/double_bundle_error/package.json b/node_modules/browserify/test/double_bundle_error/package.json new file mode 100644 index 000000000..ad2f40384 --- /dev/null +++ b/node_modules/browserify/test/double_bundle_error/package.json @@ -0,0 +1,5 @@ +{ + "browser": { + "three": "./three.js" + } +} diff --git a/node_modules/browserify/test/double_bundle_error/three.js b/node_modules/browserify/test/double_bundle_error/three.js new file mode 100644 index 000000000..b15da2728 --- /dev/null +++ b/node_modules/browserify/test/double_bundle_error/three.js @@ -0,0 +1,3 @@ +require('./nosuchfile.js'); + +module.exports = 3; diff --git a/node_modules/browserify/test/double_bundle_error/two.js b/node_modules/browserify/test/double_bundle_error/two.js new file mode 100644 index 000000000..72461a5d3 --- /dev/null +++ b/node_modules/browserify/test/double_bundle_error/two.js @@ -0,0 +1 @@ +module.exports = require('./three.js') - 1; diff --git a/node_modules/browserify/test/double_bundle_json.js b/node_modules/browserify/test/double_bundle_json.js new file mode 100644 index 000000000..ac72709b7 --- /dev/null +++ b/node_modules/browserify/test/double_bundle_json.js @@ -0,0 +1,37 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var through = require('through2'); +var xtend = require('xtend'); + +test('double bundle json', function (t) { + t.plan(6); + var expected0 = [ 'a=500', 'b=500' ]; + var expected1 = [ 'a=500', 'b=500' ]; + + function log0 (msg) { t.equal(msg, expected0.shift()) } + function log1 (msg) { t.equal(msg, expected1.shift()) } + + var cache = {}; + var b = browserify(__dirname + '/double_bundle_json/index.js', { + cache: cache + }); + b.pipeline.get('deps').push(through.obj(function(row, enc, next) { + cache[row.file] = { + source: row.source, + deps: xtend(row.deps) + }; + this.push(row); + next(); + })); + b.bundle(function (err, src0) { + t.ifError(err); + vm.runInNewContext(src0, { console: { log: log0 } }); + delete cache[__dirname + '/double_bundle_json/index.js']; + + b.bundle(function (err, src1) { + t.ifError(err); + vm.runInNewContext(src1, { console: { log: log1 } }); + }); + }); +}); diff --git a/node_modules/browserify/test/double_bundle_json/a.json b/node_modules/browserify/test/double_bundle_json/a.json new file mode 100644 index 000000000..bf0cf63b8 --- /dev/null +++ b/node_modules/browserify/test/double_bundle_json/a.json @@ -0,0 +1 @@ +{"x":500} diff --git a/node_modules/browserify/test/double_bundle_json/b.json b/node_modules/browserify/test/double_bundle_json/b.json new file mode 100644 index 000000000..bf0cf63b8 --- /dev/null +++ b/node_modules/browserify/test/double_bundle_json/b.json @@ -0,0 +1 @@ +{"x":500} diff --git a/node_modules/browserify/test/double_bundle_json/index.js b/node_modules/browserify/test/double_bundle_json/index.js new file mode 100644 index 000000000..fd8f6820d --- /dev/null +++ b/node_modules/browserify/test/double_bundle_json/index.js @@ -0,0 +1,5 @@ +var a = require('./a.json'); +var b = require('./b.json'); + +console.log('a=' + a.x); +console.log('b=' + b.x); diff --git a/node_modules/browserify/test/double_bundle_parallel.js b/node_modules/browserify/test/double_bundle_parallel.js new file mode 100644 index 000000000..ffeed20ad --- /dev/null +++ b/node_modules/browserify/test/double_bundle_parallel.js @@ -0,0 +1,33 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('double bundle parallel', function (t) { + t.plan(7); + + var sources = []; + var b = browserify(__dirname + '/entry/main.js'); + + var pending = 2; + b.bundle(check(0)); + b.bundle(check(1)); + + function check (index) { + return function (err, src) { + t.ifError(err); + var c = { + done : function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + } + }; + vm.runInNewContext(src, c); + sources[index] = src.toString('utf8'); + if (--pending === 0) done(); + }; + } + + function done () { + t.equal(sources[0], sources[1]); + } +}); diff --git a/node_modules/browserify/test/double_bundle_parallel_cache.js b/node_modules/browserify/test/double_bundle_parallel_cache.js new file mode 100644 index 000000000..521eda4dc --- /dev/null +++ b/node_modules/browserify/test/double_bundle_parallel_cache.js @@ -0,0 +1,35 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('double bundle parallel cached', function (t) { + t.plan(7); + + var sources = []; + var b = browserify(__dirname + '/entry/main.js', { + cache: {} + }); + + var pending = 2; + b.bundle(check(0)); + b.bundle(check(1)); + + function check (index) { + return function (err, src) { + t.ifError(err); + var c = { + done : function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + } + }; + vm.runInNewContext(src, c); + sources[index] = src.toString('utf8'); + if (--pending === 0) done(); + }; + } + + function done () { + t.equal(sources[0], sources[1]); + } +}); diff --git a/node_modules/browserify/test/dup/foo-dup.js b/node_modules/browserify/test/dup/foo-dup.js new file mode 100644 index 000000000..8fadf8895 --- /dev/null +++ b/node_modules/browserify/test/dup/foo-dup.js @@ -0,0 +1,4 @@ +// something on first line +module.exports = function () { + console.log('I like to duplicate myself'); +}; diff --git a/node_modules/browserify/test/dup/foo.js b/node_modules/browserify/test/dup/foo.js new file mode 100644 index 000000000..8fadf8895 --- /dev/null +++ b/node_modules/browserify/test/dup/foo.js @@ -0,0 +1,4 @@ +// something on first line +module.exports = function () { + console.log('I like to duplicate myself'); +}; diff --git a/node_modules/browserify/test/dup/index.js b/node_modules/browserify/test/dup/index.js new file mode 100644 index 000000000..ea4428877 --- /dev/null +++ b/node_modules/browserify/test/dup/index.js @@ -0,0 +1,5 @@ +var foo = require('./foo'); +var foodup = require('./foo-dup'); + +foo(); +foodup(); diff --git a/node_modules/browserify/test/entry.js b/node_modules/browserify/test/entry.js new file mode 100644 index 000000000..23a2ee254 --- /dev/null +++ b/node_modules/browserify/test/entry.js @@ -0,0 +1,43 @@ +var browserify = require('../'); +var vm = require('vm'); +var path = require('path'); +var test = require('tap').test; + +test('entry', function (t) { + t.plan(3); + + var b = browserify(__dirname + '/entry/main.js'); + b.on('dep', function(row) { + if (row.entry) t.equal(row.file, path.join(__dirname, 'entry/main.js')); + }); + b.bundle(function (err, src) { + var c = { + done : function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + t.end(); + } + }; + vm.runInNewContext(src, c); + }); +}); + +test('entry via add', function (t) { + t.plan(3); + + var b = browserify(); + b.add(__dirname + '/entry/main.js'); + b.on('dep', function(row) { + if (row.entry) t.equal(row.file, path.join(__dirname, 'entry/main.js')); + }); + b.bundle(function (err, src) { + var c = { + done : function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + t.end(); + } + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/entry/main.js b/node_modules/browserify/test/entry/main.js new file mode 100644 index 000000000..89bb8a036 --- /dev/null +++ b/node_modules/browserify/test/entry/main.js @@ -0,0 +1 @@ +done(require('./one'), require('./two')); \ No newline at end of file diff --git a/node_modules/browserify/test/entry/needs_three.js b/node_modules/browserify/test/entry/needs_three.js new file mode 100644 index 000000000..9def415e6 --- /dev/null +++ b/node_modules/browserify/test/entry/needs_three.js @@ -0,0 +1 @@ +require("three"); diff --git a/node_modules/browserify/test/entry/one.js b/node_modules/browserify/test/entry/one.js new file mode 100644 index 000000000..bd816eaba --- /dev/null +++ b/node_modules/browserify/test/entry/one.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/browserify/test/entry/package.json b/node_modules/browserify/test/entry/package.json new file mode 100644 index 000000000..ad2f40384 --- /dev/null +++ b/node_modules/browserify/test/entry/package.json @@ -0,0 +1,5 @@ +{ + "browser": { + "three": "./three.js" + } +} diff --git a/node_modules/browserify/test/entry/three.js b/node_modules/browserify/test/entry/three.js new file mode 100644 index 000000000..690aad34a --- /dev/null +++ b/node_modules/browserify/test/entry/three.js @@ -0,0 +1 @@ +module.exports = 3; diff --git a/node_modules/browserify/test/entry/two.js b/node_modules/browserify/test/entry/two.js new file mode 100644 index 000000000..4bbffde10 --- /dev/null +++ b/node_modules/browserify/test/entry/two.js @@ -0,0 +1 @@ +module.exports = 2; diff --git a/node_modules/browserify/test/entry_exec.js b/node_modules/browserify/test/entry_exec.js new file mode 100644 index 000000000..c70281e55 --- /dev/null +++ b/node_modules/browserify/test/entry_exec.js @@ -0,0 +1,15 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('only execute entry files', function (t) { + t.plan(1); + + var b = browserify(); + b.add(__dirname + '/entry_exec/main.js'); + b.require(__dirname + '/entry_exec/fail.js'); + b.bundle(function (err, src) { + var c = { t: t }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/entry_exec/fail.js b/node_modules/browserify/test/entry_exec/fail.js new file mode 100644 index 000000000..8da5557b6 --- /dev/null +++ b/node_modules/browserify/test/entry_exec/fail.js @@ -0,0 +1 @@ +t.fail('only entry files should get executed right away'); diff --git a/node_modules/browserify/test/entry_exec/main.js b/node_modules/browserify/test/entry_exec/main.js new file mode 100644 index 000000000..98331f475 --- /dev/null +++ b/node_modules/browserify/test/entry_exec/main.js @@ -0,0 +1 @@ +t.ok(true); diff --git a/node_modules/browserify/test/entry_expose.js b/node_modules/browserify/test/entry_expose.js new file mode 100644 index 000000000..381bdc5f5 --- /dev/null +++ b/node_modules/browserify/test/entry_expose.js @@ -0,0 +1,18 @@ +var test = require('tap').test; +var browserify = require('../'); +var vm = require('vm'); + +test('entry expose', function (t) { + t.plan(3) + + var b = browserify(); + b.add(__dirname + '/entry_expose/main.js'); + b.require(__dirname + '/entry_expose/main.js', { expose: 'x' }); + b.bundle(function (err, src) { + t.ifError(err); + var c = { console: { log: log } }; + function log (msg) { t.equal(msg, 'wow') } + vm.runInNewContext(src, c); + t.equal(c.require('x'), 555); + }) +}); diff --git a/node_modules/browserify/test/entry_expose/main.js b/node_modules/browserify/test/entry_expose/main.js new file mode 100644 index 000000000..bf2b2d6fe --- /dev/null +++ b/node_modules/browserify/test/entry_expose/main.js @@ -0,0 +1,2 @@ +console.log('wow'); +module.exports = 555; diff --git a/node_modules/browserify/test/entry_relative.js b/node_modules/browserify/test/entry_relative.js new file mode 100644 index 000000000..178a8ac1b --- /dev/null +++ b/node_modules/browserify/test/entry_relative.js @@ -0,0 +1,45 @@ +var browserify = require('../'); +var vm = require('vm'); +var path = require('path'); +var test = require('tap').test; + +test('entry - relative path', function (t) { + process.chdir(__dirname); + + t.plan(3); + + var b = browserify('entry/main.js'); + b.on('dep', function(row) { + if (row.entry) t.equal(row.file, path.join(__dirname, 'entry/main.js')); + }); + b.bundle(function (err, src) { + var c = { + done : function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + t.end(); + } + }; + vm.runInNewContext(src, c); + }); +}); + +test('entry - relative path via add', function (t) { + t.plan(3); + + var b = browserify({basedir: __dirname}); + b.add('entry/main.js'); + b.on('dep', function(row) { + if (row.entry) t.equal(row.file, path.join(__dirname, 'entry/main.js')); + }); + b.bundle(function (err, src) { + var c = { + done : function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + t.end(); + } + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/error_code.js b/node_modules/browserify/test/error_code.js new file mode 100644 index 000000000..5d0b2b1d7 --- /dev/null +++ b/node_modules/browserify/test/error_code.js @@ -0,0 +1,28 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var path = require('path'); +var semver = require('semver'); + +// TODO this should be fixable I guess +var knownFailure = process.platform === 'win32' && semver.satisfies(process.version, 'v0.10.x'); + +test('error code', { skip: knownFailure }, function (t) { + t.plan(2); + + var cwd = process.cwd(); + process.chdir(__dirname); + + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + path.resolve(__dirname, 'error_code/src.js') + ]); + var err = ''; + ps.stderr.on('data', function (buf) { err += buf }); + ps.stderr.on('end', function () { + t.ok(/^(Syntax|Parse)Error:/m.test(err)); + }); + + ps.on('exit', function (code) { + t.notEqual(code, 0); + }); +}); diff --git a/node_modules/browserify/test/error_code/src.js b/node_modules/browserify/test/error_code/src.js new file mode 100644 index 000000000..e85c07cca --- /dev/null +++ b/node_modules/browserify/test/error_code/src.js @@ -0,0 +1,2 @@ +var x = { +var y = 6; diff --git a/node_modules/browserify/test/exclude.js b/node_modules/browserify/test/exclude.js new file mode 100644 index 000000000..382967737 --- /dev/null +++ b/node_modules/browserify/test/exclude.js @@ -0,0 +1,21 @@ +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); + +test('exclude array', function(t) { + t.plan(2); + + var b = browserify(); + b.add(__dirname + '/exclude/array.js'); + b.exclude([ + __dirname + '/exclude/skip.js', + __dirname + '/exclude/skip2.js' + ]); + + b.bundle(function (err, src) { + if (err) { + t.fail(err); + } + vm.runInNewContext(src, { t: t }); + }); +}); diff --git a/node_modules/browserify/test/exclude/array.js b/node_modules/browserify/test/exclude/array.js new file mode 100644 index 000000000..de417c40e --- /dev/null +++ b/node_modules/browserify/test/exclude/array.js @@ -0,0 +1,2 @@ +t.throws(function () { require('./skip.js') }); +t.throws(function () { require('./skip2.js') }); diff --git a/node_modules/browserify/test/exclude/skip.js b/node_modules/browserify/test/exclude/skip.js new file mode 100644 index 000000000..006521e56 --- /dev/null +++ b/node_modules/browserify/test/exclude/skip.js @@ -0,0 +1 @@ +t.fail('this file should have been skipped'); diff --git a/node_modules/browserify/test/exclude/skip2.js b/node_modules/browserify/test/exclude/skip2.js new file mode 100644 index 000000000..006521e56 --- /dev/null +++ b/node_modules/browserify/test/exclude/skip2.js @@ -0,0 +1 @@ +t.fail('this file should have been skipped'); diff --git a/node_modules/browserify/test/export.js b/node_modules/browserify/test/export.js new file mode 100644 index 000000000..def4dfd85 --- /dev/null +++ b/node_modules/browserify/test/export.js @@ -0,0 +1,35 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('no exports when no files are loaded', function (t) { + t.plan(1); + var b = browserify(); + b.bundle(function (err, src) { + var c = {}; + vm.runInNewContext(src, c); + t.same(Object.keys(c), []); + }); +}); + +test('no exports when entries are defined', function (t) { + t.plan(1); + var b = browserify(); + b.add(__dirname + '/export/entry.js'); + b.bundle(function (err, src) { + var c = {}; + vm.runInNewContext(src, c); + t.same(c, {}); + }); +}); + +test('require export when files are required', function (t) { + t.plan(1); + var b = browserify(); + b.require(__dirname + '/export/entry.js'); + b.bundle(function (err, src) { + var c = {}; + vm.runInNewContext(src, c); + t.same(Object.keys(c), [ 'require' ]); + }); +}); diff --git a/node_modules/browserify/test/export/entry.js b/node_modules/browserify/test/export/entry.js new file mode 100644 index 000000000..6f037f8a9 --- /dev/null +++ b/node_modules/browserify/test/export/entry.js @@ -0,0 +1 @@ +// nop diff --git a/node_modules/browserify/test/external.js b/node_modules/browserify/test/external.js new file mode 100644 index 000000000..a107a4cfc --- /dev/null +++ b/node_modules/browserify/test/external.js @@ -0,0 +1,20 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('external', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/external/main.js'); + b.external('freelist'); + b.bundle(function (err, src) { + if (err) return t.fail(err); + vm.runInNewContext( + 'function require (x) {' + + 'if (x==="freelist") return function (n) { return n + 1000 }' + + '}' + + src, + { t: t } + ); + }); +}); diff --git a/node_modules/browserify/test/external/main.js b/node_modules/browserify/test/external/main.js new file mode 100644 index 000000000..82ceeda83 --- /dev/null +++ b/node_modules/browserify/test/external/main.js @@ -0,0 +1,2 @@ +t.equal(require('freelist')(5), 1005); +t.equal(require('./x.js')(6), 1016); diff --git a/node_modules/browserify/test/external/x.js b/node_modules/browserify/test/external/x.js new file mode 100644 index 000000000..a587ef44a --- /dev/null +++ b/node_modules/browserify/test/external/x.js @@ -0,0 +1,3 @@ +var fl = require('freelist'); + +module.exports = function (n) { return fl(n) + 10 }; diff --git a/node_modules/browserify/test/external_args/main.js b/node_modules/browserify/test/external_args/main.js new file mode 100644 index 000000000..b19e6c112 --- /dev/null +++ b/node_modules/browserify/test/external_args/main.js @@ -0,0 +1,10 @@ +try { + var Backbone = require('backbone'); + throw new Error('module included'); +} catch (e) { + if (e.message === 'module included') { + throw e; + } else { + t.ok(true); + } +} \ No newline at end of file diff --git a/node_modules/browserify/test/external_shim.js b/node_modules/browserify/test/external_shim.js new file mode 100644 index 000000000..1c251242a --- /dev/null +++ b/node_modules/browserify/test/external_shim.js @@ -0,0 +1,27 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('requiring a shimmed module name from an external bundle', function (t) { + t.plan(1); + var b1 = browserify(); + var b2 = browserify(); + + b1.require(__dirname + '/external_shim/bundle1.js', { expose: 'bundle1' }); + b2.external(b1); + b2.require(__dirname + '/external_shim/bundle2.js', { expose: 'bundle2' }); + + b1.bundle(function (err, src1) { + b2.bundle(function (err, src2) { + + var c = { + console: console, + setTimeout: setTimeout, + clearTimeout: clearTimeout + }; + vm.runInNewContext(src1 + src2, c); + + t.ok(c.require('bundle1').shim === c.require('bundle2').shim); + }); + }); +}); diff --git a/node_modules/browserify/test/external_shim/bundle1.js b/node_modules/browserify/test/external_shim/bundle1.js new file mode 100644 index 000000000..4753f09b7 --- /dev/null +++ b/node_modules/browserify/test/external_shim/bundle1.js @@ -0,0 +1 @@ +exports.shim = require('shim'); diff --git a/node_modules/browserify/test/external_shim/bundle2.js b/node_modules/browserify/test/external_shim/bundle2.js new file mode 100644 index 000000000..4753f09b7 --- /dev/null +++ b/node_modules/browserify/test/external_shim/bundle2.js @@ -0,0 +1 @@ +exports.shim = require('shim'); diff --git a/node_modules/browserify/test/external_shim/package.json b/node_modules/browserify/test/external_shim/package.json new file mode 100644 index 000000000..2047ac699 --- /dev/null +++ b/node_modules/browserify/test/external_shim/package.json @@ -0,0 +1,5 @@ +{ + "browser": { + "shim": "./shim.js" + } +} \ No newline at end of file diff --git a/node_modules/browserify/test/external_shim/shim.js b/node_modules/browserify/test/external_shim/shim.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/browserify/test/externalize.js b/node_modules/browserify/test/externalize.js new file mode 100644 index 000000000..8d76055bb --- /dev/null +++ b/node_modules/browserify/test/externalize.js @@ -0,0 +1,59 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var concat = require('concat-stream'); +var path = require('path'); +var fs = require('fs'); +var vm = require('vm'); + +var temp = require('temp'); +temp.track(); +var tmpdir = temp.mkdirSync({prefix: 'browserify-test'}); +var pubdir = path.join(tmpdir, 'public'); + +fs.mkdirSync(pubdir); +fs.writeFileSync( + path.join(tmpdir, 'robot.js'), + fs.readFileSync(path.join(__dirname, 'externalize/robot.js')) +); +fs.writeFileSync( + path.join(tmpdir, 'beep.js'), + fs.readFileSync(path.join(__dirname, 'externalize/beep.js')) +); +fs.writeFileSync( + path.join(tmpdir, 'boop.js'), + fs.readFileSync(path.join(__dirname, 'externalize/boop.js')) +); + +test('externalize bin', function (t) { + t.plan(5); + + var commands = [ + [ '-r', './robot.js', '-o', path.join(pubdir, 'common.js') ], + [ '-x', './robot.js', 'beep.js', '-o', path.join(pubdir, 'beep.js') ], + [ '-x', './robot.js', 'boop.js', '-o', path.join(pubdir, 'boop/bop.js') ] + ]; + (function next () { + if (commands.length === 0) { + var common = fs.readFileSync(path.join(pubdir, 'common.js')); + var beep = fs.readFileSync(path.join(pubdir, 'beep.js')); + var boop = fs.readFileSync(path.join(pubdir, 'boop/bop.js')); + + vm.runInNewContext(common + beep, { + console: { log: function (msg) { t.equal(msg, 'BEEP!') } } + }); + vm.runInNewContext(common + boop, { + console: { log: function (msg) { t.equal(msg, 'BOOP!') } } + }); + } + else { + var args = commands.shift(); + args.unshift(path.join(__dirname, '../bin/cmd.js')); + var ps = spawn(process.execPath, args, { cwd: tmpdir }); + ps.stderr.pipe(process.stderr); + ps.on('exit', function (code) { + t.equal(code, 0, 'exit code'); + next() + }); + } + })(); +}); diff --git a/node_modules/browserify/test/externalize/beep.js b/node_modules/browserify/test/externalize/beep.js new file mode 100644 index 000000000..4daf2bdd5 --- /dev/null +++ b/node_modules/browserify/test/externalize/beep.js @@ -0,0 +1,2 @@ +var robot = require('./robot.js'); +console.log(robot('beep')); \ No newline at end of file diff --git a/node_modules/browserify/test/externalize/boop.js b/node_modules/browserify/test/externalize/boop.js new file mode 100644 index 000000000..586e87fcd --- /dev/null +++ b/node_modules/browserify/test/externalize/boop.js @@ -0,0 +1,2 @@ +var robot = require('./robot.js'); +console.log(robot('boop')); \ No newline at end of file diff --git a/node_modules/browserify/test/externalize/robot.js b/node_modules/browserify/test/externalize/robot.js new file mode 100644 index 000000000..8a7ccd883 --- /dev/null +++ b/node_modules/browserify/test/externalize/robot.js @@ -0,0 +1 @@ +module.exports = function (s) { return s.toUpperCase() + '!' }; \ No newline at end of file diff --git a/node_modules/browserify/test/fake.js b/node_modules/browserify/test/fake.js new file mode 100644 index 000000000..a62fb933b --- /dev/null +++ b/node_modules/browserify/test/fake.js @@ -0,0 +1,15 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('fake', function (t) { + t.plan(1); + + var b = browserify(); + b.require(__dirname + '/fake/fake_fs.js', { expose: 'fs' }); + b.add(__dirname + '/fake/main.js'); + b.bundle(function (err, src) { + var c = { t: t }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/fake/fake_fs.js b/node_modules/browserify/test/fake/fake_fs.js new file mode 100644 index 000000000..1ebc261c7 --- /dev/null +++ b/node_modules/browserify/test/fake/fake_fs.js @@ -0,0 +1 @@ +exports.party = function () { return 'PaRtY!1!1!' }; diff --git a/node_modules/browserify/test/fake/main.js b/node_modules/browserify/test/fake/main.js new file mode 100644 index 000000000..fd4339a06 --- /dev/null +++ b/node_modules/browserify/test/fake/main.js @@ -0,0 +1,2 @@ +var fs = require('fs'); +t.equal(fs.party(), 'PaRtY!1!1!'); diff --git a/node_modules/browserify/test/field.js b/node_modules/browserify/test/field.js new file mode 100644 index 000000000..83535046b --- /dev/null +++ b/node_modules/browserify/test/field.js @@ -0,0 +1,72 @@ +var assert = require('assert'); +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('fieldString', function (t) { + t.plan(1); + + var b = browserify(); + b.require(__dirname + '/field/string.js', { expose: './string.js' }); + b.bundle(function (err, src) { + if (err) return t.fail(err); + + var c = {}; + vm.runInNewContext(src, c); + t.equal( + c.require('./string.js'), + 'browser' + ); + }); +}); + +test('fieldObject', function (t) { + t.plan(1); + + var b = browserify(); + b.require(__dirname + '/field/object.js', { expose: './object.js' }); + b.bundle(function (err, src) { + if (err) return t.fail(err); + + var c = {}; + vm.runInNewContext(src, c); + t.equal( + c.require('./object.js'), + '!browser' + ); + }); +}); + +test('missObject', function (t) { + t.plan(1); + + var b = browserify(); + b.require(__dirname + '/field/miss.js', { expose: './miss.js' }); + b.bundle(function (err, src) { + if (err) return t.fail(err); + + var c = {}; + vm.runInNewContext(src, c); + t.equal( + c.require('./miss.js'), + '!browser' + ); + }); +}); + +test('fieldSub', function (t) { + t.plan(1); + + var b = browserify(); + b.require(__dirname + '/field/sub.js', { expose: './sub.js' }); + b.bundle(function (err, src) { + if (err) return t.fail(err); + + var c = {}; + vm.runInNewContext(src, c); + t.equal( + c.require('./sub.js'), + 'browser' + ); + }); +}); diff --git a/node_modules/browserify/test/field/miss.js b/node_modules/browserify/test/field/miss.js new file mode 100644 index 000000000..361999048 --- /dev/null +++ b/node_modules/browserify/test/field/miss.js @@ -0,0 +1 @@ +module.exports = require('z-miss') diff --git a/node_modules/browserify/test/field/node_modules/z-miss/browser.js b/node_modules/browserify/test/field/node_modules/z-miss/browser.js new file mode 100644 index 000000000..842765579 --- /dev/null +++ b/node_modules/browserify/test/field/node_modules/z-miss/browser.js @@ -0,0 +1 @@ +module.exports = 'browser'; diff --git a/node_modules/browserify/test/field/node_modules/z-miss/main.js b/node_modules/browserify/test/field/node_modules/z-miss/main.js new file mode 100644 index 000000000..219e0f97d --- /dev/null +++ b/node_modules/browserify/test/field/node_modules/z-miss/main.js @@ -0,0 +1 @@ +module.exports = '!browser'; diff --git a/node_modules/browserify/test/field/node_modules/z-miss/package.json b/node_modules/browserify/test/field/node_modules/z-miss/package.json new file mode 100644 index 000000000..c1b67aedd --- /dev/null +++ b/node_modules/browserify/test/field/node_modules/z-miss/package.json @@ -0,0 +1,4 @@ +{ + "main" : "main.js", + "browserify" : {} +} diff --git a/node_modules/browserify/test/field/node_modules/z-object/browser.js b/node_modules/browserify/test/field/node_modules/z-object/browser.js new file mode 100644 index 000000000..842765579 --- /dev/null +++ b/node_modules/browserify/test/field/node_modules/z-object/browser.js @@ -0,0 +1 @@ +module.exports = 'browser'; diff --git a/node_modules/browserify/test/field/node_modules/z-object/main.js b/node_modules/browserify/test/field/node_modules/z-object/main.js new file mode 100644 index 000000000..219e0f97d --- /dev/null +++ b/node_modules/browserify/test/field/node_modules/z-object/main.js @@ -0,0 +1 @@ +module.exports = '!browser'; diff --git a/node_modules/browserify/test/field/node_modules/z-object/package.json b/node_modules/browserify/test/field/node_modules/z-object/package.json new file mode 100644 index 000000000..dee081b31 --- /dev/null +++ b/node_modules/browserify/test/field/node_modules/z-object/package.json @@ -0,0 +1,4 @@ +{ + "main" : "main.js", + "browserify" : { "main.js" : "browser.js" } +} diff --git a/node_modules/browserify/test/field/node_modules/z-string/browser.js b/node_modules/browserify/test/field/node_modules/z-string/browser.js new file mode 100644 index 000000000..842765579 --- /dev/null +++ b/node_modules/browserify/test/field/node_modules/z-string/browser.js @@ -0,0 +1 @@ +module.exports = 'browser'; diff --git a/node_modules/browserify/test/field/node_modules/z-string/main.js b/node_modules/browserify/test/field/node_modules/z-string/main.js new file mode 100644 index 000000000..219e0f97d --- /dev/null +++ b/node_modules/browserify/test/field/node_modules/z-string/main.js @@ -0,0 +1 @@ +module.exports = '!browser'; diff --git a/node_modules/browserify/test/field/node_modules/z-string/package.json b/node_modules/browserify/test/field/node_modules/z-string/package.json new file mode 100644 index 000000000..8647c0fb0 --- /dev/null +++ b/node_modules/browserify/test/field/node_modules/z-string/package.json @@ -0,0 +1,4 @@ +{ + "main" : "main.js", + "browserify" : "browser.js" +} diff --git a/node_modules/browserify/test/field/node_modules/z-sub/browser/a.js b/node_modules/browserify/test/field/node_modules/z-sub/browser/a.js new file mode 100644 index 000000000..0952f7666 --- /dev/null +++ b/node_modules/browserify/test/field/node_modules/z-sub/browser/a.js @@ -0,0 +1 @@ +module.exports = require('./b'); diff --git a/node_modules/browserify/test/field/node_modules/z-sub/browser/b.js b/node_modules/browserify/test/field/node_modules/z-sub/browser/b.js new file mode 100644 index 000000000..842765579 --- /dev/null +++ b/node_modules/browserify/test/field/node_modules/z-sub/browser/b.js @@ -0,0 +1 @@ +module.exports = 'browser'; diff --git a/node_modules/browserify/test/field/node_modules/z-sub/main.js b/node_modules/browserify/test/field/node_modules/z-sub/main.js new file mode 100644 index 000000000..219e0f97d --- /dev/null +++ b/node_modules/browserify/test/field/node_modules/z-sub/main.js @@ -0,0 +1 @@ +module.exports = '!browser'; diff --git a/node_modules/browserify/test/field/node_modules/z-sub/package.json b/node_modules/browserify/test/field/node_modules/z-sub/package.json new file mode 100644 index 000000000..4f4ed6291 --- /dev/null +++ b/node_modules/browserify/test/field/node_modules/z-sub/package.json @@ -0,0 +1,4 @@ +{ + "main" : "main.js", + "browserify" : "browser/a.js" +} diff --git a/node_modules/browserify/test/field/object.js b/node_modules/browserify/test/field/object.js new file mode 100644 index 000000000..c373dc9e4 --- /dev/null +++ b/node_modules/browserify/test/field/object.js @@ -0,0 +1 @@ +module.exports = require('z-object') diff --git a/node_modules/browserify/test/field/string.js b/node_modules/browserify/test/field/string.js new file mode 100644 index 000000000..ee4c65d36 --- /dev/null +++ b/node_modules/browserify/test/field/string.js @@ -0,0 +1 @@ +module.exports = require('z-string') diff --git a/node_modules/browserify/test/field/sub.js b/node_modules/browserify/test/field/sub.js new file mode 100644 index 000000000..8c662a97f --- /dev/null +++ b/node_modules/browserify/test/field/sub.js @@ -0,0 +1 @@ +module.exports = require('z-sub') diff --git a/node_modules/browserify/test/file_event.js b/node_modules/browserify/test/file_event.js new file mode 100644 index 000000000..33ac36ce5 --- /dev/null +++ b/node_modules/browserify/test/file_event.js @@ -0,0 +1,33 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var path = require('path'); + +test('file event', function (t) { + t.plan(8); + + var b = browserify(__dirname + '/entry/main.js'); + var files = { + 'main.js': path.join(__dirname, 'entry/main.js'), + 'one.js': './one', + 'two.js': './two' + }; + + b.on('file', function (file, id) { + var key = path.basename(file); + t.equal(file, path.join(__dirname, 'entry', key)); + t.equal(id, files[key]); + delete files[key]; + }); + + b.bundle(function (err, src) { + var c = { + done : function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + t.end(); + } + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/five_bundle.js b/node_modules/browserify/test/five_bundle.js new file mode 100644 index 000000000..473f037de --- /dev/null +++ b/node_modules/browserify/test/five_bundle.js @@ -0,0 +1,30 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('five bundle', function (t) { + t.plan(3+4*2); + + var b = browserify(__dirname + '/entry/main.js'); + var source; + + b.bundle(function (err, src0) { + t.ifError(err); + var c = { + done : function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + } + }; + vm.runInNewContext(src0, c); + + (function next (count) { + if (count === 5) return; + b.bundle(function (err, src1) { + t.ifError(err); + t.equal(src1.toString('utf8'), src0.toString('utf8')); + next(count+1); + }); + })(1); + }); +}); diff --git a/node_modules/browserify/test/full_paths.js b/node_modules/browserify/test/full_paths.js new file mode 100644 index 000000000..11431beb2 --- /dev/null +++ b/node_modules/browserify/test/full_paths.js @@ -0,0 +1,58 @@ +var unpack = require('browser-unpack'); +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); +var path = require('path'); + +var deps = [ + path.join(__dirname, '/entry/main.js'), + path.join(__dirname, '/entry/one.js'), + path.join(__dirname, '/entry/two.js') +]; + +test('fullPaths enabled', function (t) { + t.plan(3); + + var b = browserify({ + entries: [ deps[0] ], + fullPaths: true + }); + + b.bundle(function (err, src) { + unpack(src).forEach(function(dep) { + t.notEqual(deps.indexOf(dep.id), -1, 'full path name for dep.id'); + }); + }); +}); + +test('fullPaths disabled', function (t) { + t.plan(3); + + var b = browserify({ + entries: [ deps[0] ], + fullPaths: false + }); + + b.bundle(function (err, src) { + unpack(src).forEach(function(dep) { + t.equal(deps.indexOf(dep.id), -1, 'full path name no longer available'); + }); + }); +}); + +test('fullPaths enabled, with custom exposed dependency name', function (t) { + t.plan(1); + + var b = browserify({ + entries: [__dirname + '/entry/needs_three.js'], + fullPaths: true + }); + + b.require(__dirname + '/entry/three.js', { expose: 'three' }); + + b.bundle(function (err, src) { + t.doesNotThrow(function () { + vm.runInNewContext(src, { console: console, t: t }); + }); + }); +}); diff --git a/node_modules/browserify/test/glob.js b/node_modules/browserify/test/glob.js new file mode 100644 index 000000000..4ac8093ca --- /dev/null +++ b/node_modules/browserify/test/glob.js @@ -0,0 +1,29 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var path = require('path'); +var concat = require('concat-stream'); +var vm = require('vm'); + +test('glob', function (t) { + var expected = [ 'a', '!x', 'z', 'b', '!y' ]; + t.plan(expected.length + 1); + + var cwd = process.cwd(); + process.chdir(__dirname); + + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + 'a.js', 'b.js', + '-u', 'vendor/*.js' + ], { cwd: __dirname + '/glob' }); + ps.stderr.pipe(process.stderr); + ps.stdout.pipe(concat(function (body) { + var c = { console: { log: log } }; + vm.runInNewContext(body.toString('utf8'), c); + function log (msg) { t.equal(msg, expected.shift()) } + })); + + ps.on('exit', function (code) { + t.equal(code, 0); + }); +}); diff --git a/node_modules/browserify/test/glob/a.js b/node_modules/browserify/test/glob/a.js new file mode 100644 index 000000000..97fe11aa9 --- /dev/null +++ b/node_modules/browserify/test/glob/a.js @@ -0,0 +1,6 @@ +console.log('a'); + +try { require('./vendor/x.js') } +catch (err) { console.log('!x') } + +require('./lib/z.js') diff --git a/node_modules/browserify/test/glob/b.js b/node_modules/browserify/test/glob/b.js new file mode 100644 index 000000000..fedd5f44d --- /dev/null +++ b/node_modules/browserify/test/glob/b.js @@ -0,0 +1,5 @@ +console.log('b'); + +try { require('./vendor/y.js') } +catch (err) { console.log('!y') } + diff --git a/node_modules/browserify/test/glob/lib/z.js b/node_modules/browserify/test/glob/lib/z.js new file mode 100644 index 000000000..0475609d4 --- /dev/null +++ b/node_modules/browserify/test/glob/lib/z.js @@ -0,0 +1 @@ +console.log('z'); diff --git a/node_modules/browserify/test/glob/vendor/x.js b/node_modules/browserify/test/glob/vendor/x.js new file mode 100644 index 000000000..5eee8647d --- /dev/null +++ b/node_modules/browserify/test/glob/vendor/x.js @@ -0,0 +1 @@ +console.log('x'); diff --git a/node_modules/browserify/test/glob/vendor/y.js b/node_modules/browserify/test/glob/vendor/y.js new file mode 100644 index 000000000..78a89b3a2 --- /dev/null +++ b/node_modules/browserify/test/glob/vendor/y.js @@ -0,0 +1 @@ +console.log('y'); diff --git a/node_modules/browserify/test/global.js b/node_modules/browserify/test/global.js new file mode 100644 index 000000000..8026bcfb3 --- /dev/null +++ b/node_modules/browserify/test/global.js @@ -0,0 +1,92 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +if (!ArrayBuffer.isView) ArrayBuffer.isView = function () { return false; }; + +test('global', function (t) { + t.plan(2); + + var b = browserify(); + b.add(__dirname + '/global/main.js'); + b.bundle(function (err, src) { + var c = { + t : t, + a : 555, + }; + c.self = c; + vm.runInNewContext(src, c); + }); +}); + +test('__filename and __dirname with insertGlobals: true', function (t) { + t.plan(2); + + var b = browserify({ + insertGlobals: true, + basedir: __dirname + '/global' + }); + b.require(__dirname + '/global/filename.js', { expose: 'x' }); + b.bundle(function (err, src) { + var c = { Uint8Array: Uint8Array }; + c.self = c; + vm.runInNewContext(src, c); + var x = c.require('x'); + t.equal(x.filename, '/filename.js'); + t.equal(x.dirname, '/'); + }); +}); + +test('__filename and __dirname', function (t) { + t.plan(2); + + var b = browserify({ basedir: __dirname + '/global' }); + b.require(__dirname + '/global/filename.js', { expose: 'x' }); + b.bundle(function (err, src) { + var c = {}; + vm.runInNewContext(src, c); + var x = c.require('x'); + t.equal(x.filename, '/filename.js'); + t.equal(x.dirname, '/'); + }); +}); + +test('__filename and __dirname with basedir', function (t) { + t.plan(2); + + var b = browserify({ basedir: __dirname }); + b.require(__dirname + '/global/filename.js', { expose: 'x' }); + b.bundle(function (err, src) { + var c = {}; + vm.runInNewContext(src, c); + var x = c.require('x'); + t.equal(x.filename, '/global/filename.js'); + t.equal(x.dirname, '/global'); + }); +}); + +test('process.nextTick', function (t) { + t.plan(1); + + var b = browserify(); + b.add(__dirname + '/global/tick.js'); + b.bundle(function (err, src) { + var c = { t: t, setTimeout: setTimeout, clearTimeout: clearTimeout }; + vm.runInNewContext(src, c); + }); +}); + +test('Buffer', function (t) { + t.plan(2); + + var b = browserify(); + b.add(__dirname + '/global/buffer.js'); + b.bundle(function (err, src) { + var c = { + t: t, + Uint8Array: Uint8Array, + ArrayBuffer: ArrayBuffer + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/global/buffer.js b/node_modules/browserify/test/global/buffer.js new file mode 100644 index 000000000..fec6eeb8a --- /dev/null +++ b/node_modules/browserify/test/global/buffer.js @@ -0,0 +1,2 @@ +t.equal(Buffer('xyz').toString('base64'), 'eHl6'); +t.equal(Buffer('eHl6', 'base64').toString(), 'xyz'); diff --git a/node_modules/browserify/test/global/filename.js b/node_modules/browserify/test/global/filename.js new file mode 100644 index 000000000..85dc112bf --- /dev/null +++ b/node_modules/browserify/test/global/filename.js @@ -0,0 +1,2 @@ +exports.filename = __filename; +exports.dirname = __dirname; diff --git a/node_modules/browserify/test/global/main.js b/node_modules/browserify/test/global/main.js new file mode 100644 index 000000000..d77852b23 --- /dev/null +++ b/node_modules/browserify/test/global/main.js @@ -0,0 +1,2 @@ +t.equal(a, 555); +t.equal(a, global.a); diff --git a/node_modules/browserify/test/global/node_modules/aaa/index.js b/node_modules/browserify/test/global/node_modules/aaa/index.js new file mode 100644 index 000000000..85dc112bf --- /dev/null +++ b/node_modules/browserify/test/global/node_modules/aaa/index.js @@ -0,0 +1,2 @@ +exports.filename = __filename; +exports.dirname = __dirname; diff --git a/node_modules/browserify/test/global/node_modules/robot/index.js b/node_modules/browserify/test/global/node_modules/robot/index.js new file mode 100644 index 000000000..dc8377968 --- /dev/null +++ b/node_modules/browserify/test/global/node_modules/robot/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/beep'); diff --git a/node_modules/browserify/test/global/node_modules/robot/lib/beep.js b/node_modules/browserify/test/global/node_modules/robot/lib/beep.js new file mode 100644 index 000000000..85dc112bf --- /dev/null +++ b/node_modules/browserify/test/global/node_modules/robot/lib/beep.js @@ -0,0 +1,2 @@ +exports.filename = __filename; +exports.dirname = __dirname; diff --git a/node_modules/browserify/test/global/tick.js b/node_modules/browserify/test/global/tick.js new file mode 100644 index 000000000..428f3efc5 --- /dev/null +++ b/node_modules/browserify/test/global/tick.js @@ -0,0 +1,3 @@ +process.nextTick(function () { + t.ok(true); +}); diff --git a/node_modules/browserify/test/global_coffeeify.js b/node_modules/browserify/test/global_coffeeify.js new file mode 100644 index 000000000..00aa54a1d --- /dev/null +++ b/node_modules/browserify/test/global_coffeeify.js @@ -0,0 +1,19 @@ +var test = require('tap').test; +var browserify = require('../'); +var vm = require('vm'); + +test('coffeeify globally', function (t) { + t.plan(1); + + var b = browserify(__dirname + '/coffeeify/main.coffee'); + b.transform('coffeeify', { global: true }); + b.bundle(function (err, src) { + if (err) t.fail(err); + vm.runInNewContext(src, { + console: { log: log }, + setTimeout: setTimeout, + clearTimeout: clearTimeout + }); + function log (msg) { t.equal(msg, 'eyo') } + }); +}); diff --git a/node_modules/browserify/test/global_noparse.js b/node_modules/browserify/test/global_noparse.js new file mode 100644 index 000000000..a4e5a7051 --- /dev/null +++ b/node_modules/browserify/test/global_noparse.js @@ -0,0 +1,102 @@ +var browserify = require('../'); +var vm = require('vm'); +var path = require('path'); +var test = require('tap').test; + +test('global noparse module', function (t) { + t.plan(2); + + var b = browserify({ + noParse: 'aaa' + }); + b.require(__dirname + '/global/node_modules/aaa', { expose: 'x' }); + b.bundle(function (err, src) { + var c = { + __filename: __filename, + __dirname: __dirname + }; + vm.runInNewContext(src, c); + var x = c.require('x'); + t.equal(x.filename, __filename); + t.equal(x.dirname, __dirname); + }); +}); + +test('global noparse module file', function (t) { + t.plan(2); + + var b = browserify({ + noParse: 'aaa/index.js' + }); + b.require(__dirname + '/global/node_modules/aaa', { expose: 'x' }); + b.bundle(function (err, src) { + var c = { + __filename: __filename, + __dirname: __dirname + }; + vm.runInNewContext(src, c); + var x = c.require('x'); + t.equal(x.filename, __filename); + t.equal(x.dirname, __dirname); + }); +}); + +test('global noparse module deep file', function (t) { + t.plan(2); + + var b = browserify({ + noParse: 'robot/lib/beep.js' + }); + b.require(__dirname + '/global/node_modules/robot', { expose: 'x' }); + b.bundle(function (err, src) { + var c = { + __filename: __filename, + __dirname: __dirname + }; + vm.runInNewContext(src, c); + var x = c.require('x'); + t.equal(x.filename, __filename); + t.equal(x.dirname, __dirname); + }); +}); + +test('global noparse basedir', function (t) { + t.plan(2); + + var b = browserify({ + basedir: __dirname + '/global', + noParse: 'filename.js' + }); + b.require(__dirname + '/global/filename.js', { expose: 'x' }); + b.bundle(function (err, src) { + var c = { + __filename: __filename, + __dirname: __dirname + }; + vm.runInNewContext(src, c); + var x = c.require('x'); + t.equal(x.filename, __filename); + t.equal(x.dirname, __dirname); + }); +}); + +test('global noparse function', function (t) { + t.plan(2); + + var b = browserify({ + noParse: function(file) { + return file === path.join(__dirname, 'global/filename.js'); + } + }); + b.require(__dirname + '/global/filename.js', { expose: 'x' }); + b.bundle(function (err, src) { + var c = { + __filename: __filename, + __dirname: __dirname + }; + vm.runInNewContext(src, c); + var x = c.require('x'); + t.equal(x.filename, __filename); + t.equal(x.dirname, __dirname); + }); +}); diff --git a/node_modules/browserify/test/global_recorder.js b/node_modules/browserify/test/global_recorder.js new file mode 100644 index 000000000..7fdc07fb3 --- /dev/null +++ b/node_modules/browserify/test/global_recorder.js @@ -0,0 +1,22 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('recorded global tr', function (t) { + t.plan(6); + + var b = browserify(__dirname + '/global_recorder/main.js'); + var context = { + console: { log: function (msg) { t.equal(msg, 'wow') } } + }; + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, context); + t.equal(b._recorded.length, 2); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, context); + t.equal(b._recorded.length, 2); + }); + }); +}); diff --git a/node_modules/browserify/test/global_recorder/main.js b/node_modules/browserify/test/global_recorder/main.js new file mode 100644 index 000000000..6036bec63 --- /dev/null +++ b/node_modules/browserify/test/global_recorder/main.js @@ -0,0 +1 @@ +console.log('wow'); diff --git a/node_modules/browserify/test/hash.js b/node_modules/browserify/test/hash.js new file mode 100644 index 000000000..a459a40a6 --- /dev/null +++ b/node_modules/browserify/test/hash.js @@ -0,0 +1,15 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('hash', function (t) { + t.plan(3); + + var b = browserify(__dirname + '/hash/main.js'); + b.bundle(function (err, buf) { + var c = { t: t }; + var src = buf.toString('utf8'); + t.equal(src.match(RegExp('// FILE CONTENTS', 'g')).length, 1); + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/hash/foo/other.js b/node_modules/browserify/test/hash/foo/other.js new file mode 100644 index 000000000..f4e8d9d29 --- /dev/null +++ b/node_modules/browserify/test/hash/foo/other.js @@ -0,0 +1 @@ +module.exports = 5; diff --git a/node_modules/browserify/test/hash/foo/two.js b/node_modules/browserify/test/hash/foo/two.js new file mode 100644 index 000000000..86c05b925 --- /dev/null +++ b/node_modules/browserify/test/hash/foo/two.js @@ -0,0 +1,2 @@ +// FILE CONTENTS +module.exports = 111 * require('./other.js'); diff --git a/node_modules/browserify/test/hash/main.js b/node_modules/browserify/test/hash/main.js new file mode 100644 index 000000000..b37dd8831 --- /dev/null +++ b/node_modules/browserify/test/hash/main.js @@ -0,0 +1,2 @@ +t.equal(require('./foo/two.js'), 555); +t.equal(require('./one.js'), 333); diff --git a/node_modules/browserify/test/hash/one.js b/node_modules/browserify/test/hash/one.js new file mode 100644 index 000000000..86c05b925 --- /dev/null +++ b/node_modules/browserify/test/hash/one.js @@ -0,0 +1,2 @@ +// FILE CONTENTS +module.exports = 111 * require('./other.js'); diff --git a/node_modules/browserify/test/hash/other.js b/node_modules/browserify/test/hash/other.js new file mode 100644 index 000000000..690aad34a --- /dev/null +++ b/node_modules/browserify/test/hash/other.js @@ -0,0 +1 @@ +module.exports = 3; diff --git a/node_modules/browserify/test/hash_instance_context.js b/node_modules/browserify/test/hash_instance_context.js new file mode 100644 index 000000000..dda45aa47 --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context.js @@ -0,0 +1,25 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('hash instances with hashed contexts', function (t) { + t.plan(17); + + var b = browserify(__dirname + '/hash_instance_context/main.js'); + b.bundle(function (err, buf) { + var c = { t: t }; + var src = buf.toString('utf8'); + t.equal(src.match(RegExp('// FILE F ONE', 'g')).length, 1); + t.equal(src.match(RegExp('// FILE G ONE', 'g')).length, 2); + + t.equal(src.match(RegExp('// FILE F TWO', 'g')).length, 1); + t.equal(src.match(RegExp('// FILE G TWO', 'g')).length, 1); + t.equal(src.match(RegExp('// FILE H TWO', 'g')).length, 2); + + t.equal(src.match(RegExp('// FILE F THREE', 'g')).length, 1); + t.equal(src.match(RegExp('// FILE G THREE', 'g')).length, 1); + t.equal(src.match(RegExp('// FILE H THREE', 'g')).length, 1); + + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/hash_instance_context/main.js b/node_modules/browserify/test/hash_instance_context/main.js new file mode 100644 index 000000000..db1e23e97 --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/main.js @@ -0,0 +1,17 @@ +var A = require('./one/f.js'); +var B = require('./one/dir/f.js'); +t.notEqual(A, B); +t.equal(A(), 555); +t.equal(B(), 333); + +var C = require('./two/f.js'); +var D = require('./two/dir/f.js'); +t.notEqual(C, D); +t.equal(C(), 555); +t.equal(D(), 333); + +var E = require('./three/f.js'); +var F = require('./three/dir/f.js'); +t.notEqual(E, F); +t.equal(E(), 555); +t.equal(F(), 555); diff --git a/node_modules/browserify/test/hash_instance_context/one/dir/f.js b/node_modules/browserify/test/hash_instance_context/one/dir/f.js new file mode 100644 index 000000000..a315c1e7d --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/one/dir/f.js @@ -0,0 +1,3 @@ +// FILE F ONE +var G = require('./g.js'); +module.exports = function () { return 111 * G }; diff --git a/node_modules/browserify/test/hash_instance_context/one/dir/g.js b/node_modules/browserify/test/hash_instance_context/one/dir/g.js new file mode 100644 index 000000000..9cab61b8d --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/one/dir/g.js @@ -0,0 +1,2 @@ +// FILE G ONE +module.exports = 3 diff --git a/node_modules/browserify/test/hash_instance_context/one/f.js b/node_modules/browserify/test/hash_instance_context/one/f.js new file mode 100644 index 000000000..a315c1e7d --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/one/f.js @@ -0,0 +1,3 @@ +// FILE F ONE +var G = require('./g.js'); +module.exports = function () { return 111 * G }; diff --git a/node_modules/browserify/test/hash_instance_context/one/g.js b/node_modules/browserify/test/hash_instance_context/one/g.js new file mode 100644 index 000000000..837303206 --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/one/g.js @@ -0,0 +1,2 @@ +// FILE G ONE +module.exports = 5 diff --git a/node_modules/browserify/test/hash_instance_context/three/dir/f.js b/node_modules/browserify/test/hash_instance_context/three/dir/f.js new file mode 100644 index 000000000..51b1e7327 --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/three/dir/f.js @@ -0,0 +1,3 @@ +// FILE F THREE +var G = require('./g.js'); +module.exports = function () { return 111 * G }; diff --git a/node_modules/browserify/test/hash_instance_context/three/dir/g.js b/node_modules/browserify/test/hash_instance_context/three/dir/g.js new file mode 100644 index 000000000..654f021c3 --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/three/dir/g.js @@ -0,0 +1,2 @@ +// FILE G THREE +module.exports = require('./h.js') + 1; diff --git a/node_modules/browserify/test/hash_instance_context/three/dir/h.js b/node_modules/browserify/test/hash_instance_context/three/dir/h.js new file mode 100644 index 000000000..afcc80fd3 --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/three/dir/h.js @@ -0,0 +1,2 @@ +// FILE H THREE +module.exports = 4 diff --git a/node_modules/browserify/test/hash_instance_context/three/f.js b/node_modules/browserify/test/hash_instance_context/three/f.js new file mode 100644 index 000000000..51b1e7327 --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/three/f.js @@ -0,0 +1,3 @@ +// FILE F THREE +var G = require('./g.js'); +module.exports = function () { return 111 * G }; diff --git a/node_modules/browserify/test/hash_instance_context/three/g.js b/node_modules/browserify/test/hash_instance_context/three/g.js new file mode 100644 index 000000000..654f021c3 --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/three/g.js @@ -0,0 +1,2 @@ +// FILE G THREE +module.exports = require('./h.js') + 1; diff --git a/node_modules/browserify/test/hash_instance_context/three/h.js b/node_modules/browserify/test/hash_instance_context/three/h.js new file mode 100644 index 000000000..afcc80fd3 --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/three/h.js @@ -0,0 +1,2 @@ +// FILE H THREE +module.exports = 4 diff --git a/node_modules/browserify/test/hash_instance_context/two/dir/f.js b/node_modules/browserify/test/hash_instance_context/two/dir/f.js new file mode 100644 index 000000000..1178f93fb --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/two/dir/f.js @@ -0,0 +1,3 @@ +// FILE F TWO +var G = require('./g.js'); +module.exports = function () { return 111 * G }; diff --git a/node_modules/browserify/test/hash_instance_context/two/dir/g.js b/node_modules/browserify/test/hash_instance_context/two/dir/g.js new file mode 100644 index 000000000..b940ee76f --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/two/dir/g.js @@ -0,0 +1,2 @@ +// FILE G TWO +module.exports = require('./h.js') + 1; diff --git a/node_modules/browserify/test/hash_instance_context/two/dir/h.js b/node_modules/browserify/test/hash_instance_context/two/dir/h.js new file mode 100644 index 000000000..74a8a7a47 --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/two/dir/h.js @@ -0,0 +1,2 @@ +// FILE H TWO +module.exports = 2 diff --git a/node_modules/browserify/test/hash_instance_context/two/f.js b/node_modules/browserify/test/hash_instance_context/two/f.js new file mode 100644 index 000000000..1178f93fb --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/two/f.js @@ -0,0 +1,3 @@ +// FILE F TWO +var G = require('./g.js'); +module.exports = function () { return 111 * G }; diff --git a/node_modules/browserify/test/hash_instance_context/two/g.js b/node_modules/browserify/test/hash_instance_context/two/g.js new file mode 100644 index 000000000..b940ee76f --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/two/g.js @@ -0,0 +1,2 @@ +// FILE G TWO +module.exports = require('./h.js') + 1; diff --git a/node_modules/browserify/test/hash_instance_context/two/h.js b/node_modules/browserify/test/hash_instance_context/two/h.js new file mode 100644 index 000000000..42684f036 --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/two/h.js @@ -0,0 +1,2 @@ +// FILE H TWO +module.exports = 4 diff --git a/node_modules/browserify/test/identical.js b/node_modules/browserify/test/identical.js new file mode 100644 index 000000000..7d0deaeb9 --- /dev/null +++ b/node_modules/browserify/test/identical.js @@ -0,0 +1,19 @@ +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); + +test('identical', function (t) { + var expected = [ 0, 1, 0, 1 ]; + t.plan(expected.length + 1); + + var b = browserify(__dirname + '/identical/main.js'); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src.toString('utf8'), { + console: { log: log } + }); + function log (msg) { + t.equal(msg, expected.shift()); + } + }); +}); diff --git a/node_modules/browserify/test/identical/main.js b/node_modules/browserify/test/identical/main.js new file mode 100644 index 000000000..c2e83ed20 --- /dev/null +++ b/node_modules/browserify/test/identical/main.js @@ -0,0 +1,6 @@ +var x = require('./x'); +var y = require('./y'); +console.log(x()); +console.log(x()); +console.log(y()); +console.log(y()); diff --git a/node_modules/browserify/test/identical/x.js b/node_modules/browserify/test/identical/x.js new file mode 100644 index 000000000..13c441d79 --- /dev/null +++ b/node_modules/browserify/test/identical/x.js @@ -0,0 +1,2 @@ +var i = 0; +module.exports = function () { return i++ }; diff --git a/node_modules/browserify/test/identical/y.js b/node_modules/browserify/test/identical/y.js new file mode 100644 index 000000000..13c441d79 --- /dev/null +++ b/node_modules/browserify/test/identical/y.js @@ -0,0 +1,2 @@ +var i = 0; +module.exports = function () { return i++ }; diff --git a/node_modules/browserify/test/identical_different.js b/node_modules/browserify/test/identical_different.js new file mode 100644 index 000000000..a2e7911d3 --- /dev/null +++ b/node_modules/browserify/test/identical_different.js @@ -0,0 +1,19 @@ +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); + +test('identical', function (t) { + var expected = [ 1, 2, 10, 110 ]; + t.plan(expected.length + 1); + + var b = browserify(__dirname + '/identical_different/main.js'); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src.toString('utf8'), { + console: { log: log } + }); + function log (msg) { + t.equal(msg, expected.shift()); + } + }); +}); diff --git a/node_modules/browserify/test/identical_different/main.js b/node_modules/browserify/test/identical_different/main.js new file mode 100644 index 000000000..5a4154b1d --- /dev/null +++ b/node_modules/browserify/test/identical_different/main.js @@ -0,0 +1,6 @@ +var x = require('./x'); +var y = require('./wow/y'); +console.log(x()); +console.log(x()); +console.log(y()); +console.log(y()); diff --git a/node_modules/browserify/test/identical_different/node_modules/op/index.js b/node_modules/browserify/test/identical_different/node_modules/op/index.js new file mode 100644 index 000000000..7014688aa --- /dev/null +++ b/node_modules/browserify/test/identical_different/node_modules/op/index.js @@ -0,0 +1,3 @@ +module.exports = function (n) { + return n + 1; +}; diff --git a/node_modules/browserify/test/identical_different/wow/node_modules/op/index.js b/node_modules/browserify/test/identical_different/wow/node_modules/op/index.js new file mode 100644 index 000000000..e08a1ce12 --- /dev/null +++ b/node_modules/browserify/test/identical_different/wow/node_modules/op/index.js @@ -0,0 +1,3 @@ +module.exports = function (n) { + return (n+1) * 10; +}; diff --git a/node_modules/browserify/test/identical_different/wow/y.js b/node_modules/browserify/test/identical_different/wow/y.js new file mode 100644 index 000000000..0b8636f5c --- /dev/null +++ b/node_modules/browserify/test/identical_different/wow/y.js @@ -0,0 +1,3 @@ +var op = require('op'); +var i = 0; +module.exports = function () { i = op(i); return i }; diff --git a/node_modules/browserify/test/identical_different/x.js b/node_modules/browserify/test/identical_different/x.js new file mode 100644 index 000000000..0b8636f5c --- /dev/null +++ b/node_modules/browserify/test/identical_different/x.js @@ -0,0 +1,3 @@ +var op = require('op'); +var i = 0; +module.exports = function () { i = op(i); return i }; diff --git a/node_modules/browserify/test/ignore.js b/node_modules/browserify/test/ignore.js new file mode 100644 index 000000000..4cb70971f --- /dev/null +++ b/node_modules/browserify/test/ignore.js @@ -0,0 +1,91 @@ +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); +var path = require('path'); + +test('ignore', function (t) { + t.plan(1); + + var b = browserify(); + b.add(__dirname + '/ignore/main.js'); + b.ignore(path.join(__dirname, 'ignore/skip.js')); + + b.bundle(function (err, src) { + if (err) t.fail(err); + vm.runInNewContext(src, { t: t }); + }); +}); + +test('ignore array', function(t) { + t.plan(2); + + var b = browserify(); + b.add(__dirname + '/ignore/array.js'); + b.ignore([ + path.join(__dirname, 'ignore/skip.js'), + path.join(__dirname, 'ignore/skip2.js') + ]); + + b.bundle(function (err, src) { + if (err) { + t.fail(err); + } + vm.runInNewContext(src, { t: t }); + }); +}); + +test('ignore by package or id', function (t) { + t.plan(3); + + var b = browserify(); + b.add(__dirname + '/ignore/by-id.js'); + b.ignore('events'); + b.ignore('beep'); + b.ignore('bad id'); + + b.bundle(function (err, src) { + if (err) t.fail(err); + vm.runInNewContext(src, { t: t }); + }); +}); + +test('ignore files referenced by relative path', function (t) { + // Change the current working directory relative to this file + var cwd = process.cwd(); + process.chdir(__dirname); + + t.plan(1); + + var b = browserify(); + b.add(__dirname + '/ignore/by-relative.js'); + b.ignore('./ignore/ignored/skip.js'); + + b.bundle(function (err, src) { + if (err) t.fail(err); + vm.runInNewContext(src, { t: t }); + }); + + // Revert CWD + process.chdir(cwd); +}); + +test('do not ignore files with relative paths that do not resolve', function (t) { + // Change the current working directory to the ignore folder + var cwd = process.cwd(); + process.chdir(__dirname + '/ignore'); + + t.plan(2); + + var b = browserify(); + b.add(__dirname + '/ignore/double-skip.js'); + + b.ignore('./skip.js'); + + b.bundle(function (err, src) { + if (err) t.fail(err); + vm.runInNewContext(src, { t: t }); + }); + + // Revert CWD + process.chdir(cwd); +}); diff --git a/node_modules/browserify/test/ignore/array.js b/node_modules/browserify/test/ignore/array.js new file mode 100644 index 000000000..837e179b5 --- /dev/null +++ b/node_modules/browserify/test/ignore/array.js @@ -0,0 +1,2 @@ +t.deepEqual(require('./skip.js'), {}); +t.deepEqual(require('./skip2.js'), {}); diff --git a/node_modules/browserify/test/ignore/by-id.js b/node_modules/browserify/test/ignore/by-id.js new file mode 100644 index 000000000..61c0baaba --- /dev/null +++ b/node_modules/browserify/test/ignore/by-id.js @@ -0,0 +1,3 @@ +t.deepEqual(require('events'), {}); +t.deepEqual(require('bad id'), {}); +t.deepEqual(require('beep'), {}); \ No newline at end of file diff --git a/node_modules/browserify/test/ignore/by-relative.js b/node_modules/browserify/test/ignore/by-relative.js new file mode 100644 index 000000000..e50676efb --- /dev/null +++ b/node_modules/browserify/test/ignore/by-relative.js @@ -0,0 +1,5 @@ +/** + * This test is to check to make sure that files that are ignored do not get + * bundled when referenced with a nested relative path. + */ +t.deepEqual(require('./relative'), {}); diff --git a/node_modules/browserify/test/ignore/double-skip.js b/node_modules/browserify/test/ignore/double-skip.js new file mode 100644 index 000000000..ad61cce9f --- /dev/null +++ b/node_modules/browserify/test/ignore/double-skip.js @@ -0,0 +1,2 @@ +t.deepEqual(require('./skip.js'), {}); +t.deepEqual(require('./double-skip/index'), {foo: 'bar'}); \ No newline at end of file diff --git a/node_modules/browserify/test/ignore/double-skip/index.js b/node_modules/browserify/test/ignore/double-skip/index.js new file mode 100644 index 000000000..affe2f2d8 --- /dev/null +++ b/node_modules/browserify/test/ignore/double-skip/index.js @@ -0,0 +1 @@ +module.exports = require('./skip.js'); \ No newline at end of file diff --git a/node_modules/browserify/test/ignore/double-skip/skip.js b/node_modules/browserify/test/ignore/double-skip/skip.js new file mode 100644 index 000000000..1922194b8 --- /dev/null +++ b/node_modules/browserify/test/ignore/double-skip/skip.js @@ -0,0 +1,5 @@ +// this module should return something + +module.exports = { + foo: 'bar' +}; diff --git a/node_modules/browserify/test/ignore/ignored/skip.js b/node_modules/browserify/test/ignore/ignored/skip.js new file mode 100644 index 000000000..006521e56 --- /dev/null +++ b/node_modules/browserify/test/ignore/ignored/skip.js @@ -0,0 +1 @@ +t.fail('this file should have been skipped'); diff --git a/node_modules/browserify/test/ignore/main.js b/node_modules/browserify/test/ignore/main.js new file mode 100644 index 000000000..0149b755c --- /dev/null +++ b/node_modules/browserify/test/ignore/main.js @@ -0,0 +1 @@ +t.deepEqual(require('./skip.js'), {}); diff --git a/node_modules/browserify/test/ignore/relative/index.js b/node_modules/browserify/test/ignore/relative/index.js new file mode 100644 index 000000000..3f73c326a --- /dev/null +++ b/node_modules/browserify/test/ignore/relative/index.js @@ -0,0 +1 @@ +module.exports = require('../ignored/skip.js'); \ No newline at end of file diff --git a/node_modules/browserify/test/ignore/skip.js b/node_modules/browserify/test/ignore/skip.js new file mode 100644 index 000000000..006521e56 --- /dev/null +++ b/node_modules/browserify/test/ignore/skip.js @@ -0,0 +1 @@ +t.fail('this file should have been skipped'); diff --git a/node_modules/browserify/test/ignore/skip2.js b/node_modules/browserify/test/ignore/skip2.js new file mode 100644 index 000000000..006521e56 --- /dev/null +++ b/node_modules/browserify/test/ignore/skip2.js @@ -0,0 +1 @@ +t.fail('this file should have been skipped'); diff --git a/node_modules/browserify/test/ignore_browser_field.js b/node_modules/browserify/test/ignore_browser_field.js new file mode 100644 index 000000000..a925f2e62 --- /dev/null +++ b/node_modules/browserify/test/ignore_browser_field.js @@ -0,0 +1,21 @@ +var test = require('tap').test; +var browserify = require('../'); +var path = require('path'); +var mainfile = path.join(__dirname, 'ignore_browser_field/main.js'); +var vm = require('vm'); + +test('ignore browser field', function (t) { + t.plan(3); + var b = browserify(mainfile, { browserField: false }); + var expected = [ 'A:NODE', 'B:X.JS' ]; + + b.bundle(function (err, src) { + t.ifError(err); + var c = { console: { log: log } }; + vm.runInNewContext(src, c); + + function log (msg) { + t.equal(msg, expected.shift()); + } + }); +}); diff --git a/node_modules/browserify/test/ignore_browser_field/main.js b/node_modules/browserify/test/ignore_browser_field/main.js new file mode 100644 index 000000000..bae4a2290 --- /dev/null +++ b/node_modules/browserify/test/ignore_browser_field/main.js @@ -0,0 +1,2 @@ +console.log(require('a')); +console.log(require('b')); diff --git a/node_modules/browserify/test/ignore_browser_field/node_modules/a/browser.js b/node_modules/browserify/test/ignore_browser_field/node_modules/a/browser.js new file mode 100644 index 000000000..229aa83cb --- /dev/null +++ b/node_modules/browserify/test/ignore_browser_field/node_modules/a/browser.js @@ -0,0 +1 @@ +module.exports = 'A:BROWSER' diff --git a/node_modules/browserify/test/ignore_browser_field/node_modules/a/main.js b/node_modules/browserify/test/ignore_browser_field/node_modules/a/main.js new file mode 100644 index 000000000..1f95fc3c3 --- /dev/null +++ b/node_modules/browserify/test/ignore_browser_field/node_modules/a/main.js @@ -0,0 +1 @@ +module.exports = 'A:NODE' diff --git a/node_modules/browserify/test/ignore_browser_field/node_modules/a/package.json b/node_modules/browserify/test/ignore_browser_field/node_modules/a/package.json new file mode 100644 index 000000000..d7572b6f9 --- /dev/null +++ b/node_modules/browserify/test/ignore_browser_field/node_modules/a/package.json @@ -0,0 +1,6 @@ +{ + "name": "a", + "version": "1.0.0", + "main": "main.js", + "browser": "browser.js" +} diff --git a/node_modules/browserify/test/ignore_browser_field/node_modules/b/browser-x.js b/node_modules/browserify/test/ignore_browser_field/node_modules/b/browser-x.js new file mode 100644 index 000000000..aca586288 --- /dev/null +++ b/node_modules/browserify/test/ignore_browser_field/node_modules/b/browser-x.js @@ -0,0 +1 @@ +module.exports = 'browser-x.js' diff --git a/node_modules/browserify/test/ignore_browser_field/node_modules/b/main.js b/node_modules/browserify/test/ignore_browser_field/node_modules/b/main.js new file mode 100644 index 000000000..5b7a8817b --- /dev/null +++ b/node_modules/browserify/test/ignore_browser_field/node_modules/b/main.js @@ -0,0 +1 @@ +module.exports = ('b:' + require('./x.js')).toUpperCase(); diff --git a/node_modules/browserify/test/ignore_browser_field/node_modules/b/package.json b/node_modules/browserify/test/ignore_browser_field/node_modules/b/package.json new file mode 100644 index 000000000..021d8bb38 --- /dev/null +++ b/node_modules/browserify/test/ignore_browser_field/node_modules/b/package.json @@ -0,0 +1,8 @@ +{ + "name": "b", + "version": "1.0.0", + "main": "main.js", + "browser": { + "./x.js": "./browser-x.js" + } +} diff --git a/node_modules/browserify/test/ignore_browser_field/node_modules/b/x.js b/node_modules/browserify/test/ignore_browser_field/node_modules/b/x.js new file mode 100644 index 000000000..43396403b --- /dev/null +++ b/node_modules/browserify/test/ignore_browser_field/node_modules/b/x.js @@ -0,0 +1 @@ +module.exports = 'x.js'; diff --git a/node_modules/browserify/test/ignore_missing.js b/node_modules/browserify/test/ignore_missing.js new file mode 100644 index 000000000..ddf72ed20 --- /dev/null +++ b/node_modules/browserify/test/ignore_missing.js @@ -0,0 +1,41 @@ +var browserify = require('../'); +var test = require('tap').test; + +test('ignoreMissing option', function (t) { + t.test('on browserify', function(t) { + t.plan(1); + + var ignored = browserify({ + entries: [__dirname + '/ignore_missing/main.js'], + ignoreMissing: true + }); + + ignored.bundle(function(err) { + t.ok(!err, "bundle completed with missing file ignored"); + }); + }); + + t.test('on .bundle', function(t) { + t.plan(1); + + var ignored = browserify(__dirname + '/ignore_missing/main.js', { + ignoreMissing: true + }); + + ignored.bundle(function(err) { + t.ok(!err, "bundle completed with missing file ignored"); + }); + }); + + t.test('defaults to false', function (t) { + t.plan(1); + + var expected = browserify(__dirname + '/ignore_missing/main.js'); + + expected.bundle(function(err) { + t.ok(err, 'ignoreMissing was false, an error was raised'); + }); + }); + + t.end(); +}); diff --git a/node_modules/browserify/test/ignore_missing/main.js b/node_modules/browserify/test/ignore_missing/main.js new file mode 100644 index 000000000..a522a65cb --- /dev/null +++ b/node_modules/browserify/test/ignore_missing/main.js @@ -0,0 +1 @@ +require('./no_such_file'); diff --git a/node_modules/browserify/test/ignore_transform_key.js b/node_modules/browserify/test/ignore_transform_key.js new file mode 100644 index 000000000..253f64051 --- /dev/null +++ b/node_modules/browserify/test/ignore_transform_key.js @@ -0,0 +1,17 @@ +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); + +test('ignore transform', function(t) { + t.plan(1); + + var b = browserify({ + transformKey: false + }); + b.add(__dirname + '/ignore_transform_key/main.js'); + + b.bundle(function(err, src) { + if (err) t.fail(err); + vm.runInNewContext(src, {t: t}); + }); +}); diff --git a/node_modules/browserify/test/ignore_transform_key/main.js b/node_modules/browserify/test/ignore_transform_key/main.js new file mode 100644 index 000000000..97be0ea7c --- /dev/null +++ b/node_modules/browserify/test/ignore_transform_key/main.js @@ -0,0 +1,3 @@ +var a = require('a'); + +t.equal(a, 'good'); diff --git a/node_modules/browserify/test/ignore_transform_key/node_modules/a/index.js b/node_modules/browserify/test/ignore_transform_key/node_modules/a/index.js new file mode 100644 index 000000000..1f9bee291 --- /dev/null +++ b/node_modules/browserify/test/ignore_transform_key/node_modules/a/index.js @@ -0,0 +1 @@ +module.exports = 'good'; diff --git a/node_modules/browserify/test/ignore_transform_key/node_modules/a/package.json b/node_modules/browserify/test/ignore_transform_key/node_modules/a/package.json new file mode 100644 index 000000000..7d9c4b3d5 --- /dev/null +++ b/node_modules/browserify/test/ignore_transform_key/node_modules/a/package.json @@ -0,0 +1,10 @@ +{ + "name": "a", + "version": "1.0.0", + "private": true, + "browserify": { + "transform": [ + "evil-transform" + ] + } +} diff --git a/node_modules/browserify/test/ignore_transform_key/node_modules/evil-transform/index.js b/node_modules/browserify/test/ignore_transform_key/node_modules/evil-transform/index.js new file mode 100644 index 000000000..a4dd44451 --- /dev/null +++ b/node_modules/browserify/test/ignore_transform_key/node_modules/evil-transform/index.js @@ -0,0 +1,12 @@ +const through2 = require('through2'); + +module.exports = function() { + + return through2.obj(function(row, enc, next) { + return next(); + }, + function(next) { + next(null, "module.exports = 'evil';"); + } + ) +}; diff --git a/node_modules/browserify/test/ignore_transform_key/node_modules/evil-transform/package.json b/node_modules/browserify/test/ignore_transform_key/node_modules/evil-transform/package.json new file mode 100644 index 000000000..81ca8df1a --- /dev/null +++ b/node_modules/browserify/test/ignore_transform_key/node_modules/evil-transform/package.json @@ -0,0 +1,5 @@ +{ + "name": "evil-transform", + "version": "1.0.0", + "private": true +} diff --git a/node_modules/browserify/test/json.js b/node_modules/browserify/test/json.js new file mode 100644 index 000000000..e0f2e27ea --- /dev/null +++ b/node_modules/browserify/test/json.js @@ -0,0 +1,48 @@ +var browserify = require('../'); +var fs = require('fs'); +var vm = require('vm'); +var semver = require('semver'); +var test = require('tap').test; + +test('json', function (t) { + t.plan(2); + var b = browserify(); + b.add(__dirname + '/json/main.js'); + b.bundle(function (err, src) { + if (err) t.fail(err); + var c = { + ex : function (obj) { + t.same(obj, { beep : 'boop', x : 555 }); + } + }; + vm.runInNewContext(src, c); + }); +}); + +// This works in Node v10 and up thanks to the JSON superset proposal, which +// allows the evil chars in javascript strings. +// https://github.com/tc39/proposal-json-superset +test('verify evil json', { skip: semver.gte(process.version, 'v10.0.0') }, function(t) { + t.plan(1); + fs.readFile(__dirname + '/json/evil-chars.json', function(err, data) { + if (err) t.fail(err); + t.throws(function() { + vm.runInNewContext('(' + data.toString() + ')'); + }); + }); +}); + +test('evil json', function (t) { + t.plan(2); + var b = browserify(); + b.add(__dirname + '/json/evil.js'); + b.bundle(function (err, src) { + if (err) t.fail(err); + var c = { + ex : function (obj) { + t.same(obj, { evil : '\u2028\u2029' }); + } + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/json/beep.json b/node_modules/browserify/test/json/beep.json new file mode 100644 index 000000000..d85cfe565 --- /dev/null +++ b/node_modules/browserify/test/json/beep.json @@ -0,0 +1,4 @@ +{ + "beep" : "boop", + "x" : 555 +} diff --git a/node_modules/browserify/test/json/evil-chars.json b/node_modules/browserify/test/json/evil-chars.json new file mode 100644 index 000000000..4a5851bb6 --- /dev/null +++ b/node_modules/browserify/test/json/evil-chars.json @@ -0,0 +1,3 @@ +{ + "evil": "

" +} diff --git a/node_modules/browserify/test/json/evil.js b/node_modules/browserify/test/json/evil.js new file mode 100644 index 000000000..767e9cb27 --- /dev/null +++ b/node_modules/browserify/test/json/evil.js @@ -0,0 +1,2 @@ +ex(require('./evil-chars.json')); +ex(require('./evil-chars')); diff --git a/node_modules/browserify/test/json/main.js b/node_modules/browserify/test/json/main.js new file mode 100644 index 000000000..f459f30f2 --- /dev/null +++ b/node_modules/browserify/test/json/main.js @@ -0,0 +1,2 @@ +ex(require('./beep.json')); +ex(require('./beep')); diff --git a/node_modules/browserify/test/leak.js b/node_modules/browserify/test/leak.js new file mode 100644 index 000000000..06881655d --- /dev/null +++ b/node_modules/browserify/test/leak.js @@ -0,0 +1,59 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var path = require('path'); +var through = require('through2'); + +var os = require('os'); +var tmpdir = (os.tmpdir || os.tmpDir)(); +var dir = path.join( + tmpdir, + 'browserify-test-' + Math.random(), + 'aaabbbzzz' +); +var dirstring = dir.split(path.sep).slice(-2).join(path.sep); + +if (!ArrayBuffer.isView) ArrayBuffer.isView = function () { return false; }; + +test('leaking information about system paths (process)', function (t) { + t.plan(4); + + var b = browserify({ basedir: dir }); + var stream = through(); + stream.push('process.nextTick(function () {' + + 't.ok(true)' + + '})' + ); + stream.push(null); + b.add(stream); + + b.bundle(function (err, buf) { + var src = buf.toString('utf8'); + t.equal(src.indexOf(dirstring), -1, 'temp directory visible'); + t.equal(src.indexOf(process.cwd()), -1, 'cwd directory visible'); + t.equal(src.indexOf('/home'), -1, 'home directory visible'); + vm.runInNewContext(src, { + t: t, + setTimeout: setTimeout, + clearTimeout: clearTimeout + }); + }); +}); + +test('leaking information about system paths (Buffer)', function (t) { + t.plan(4); + + var b = browserify({ basedir: dir }); + var stream = through(); + stream.push('t.equal(Buffer("eHl6", "base64").toString(), "xyz")'); + stream.push(null); + b.add(stream); + + b.bundle(function (err, buf) { + var src = buf.toString('utf8'); + t.equal(src.indexOf(dirstring), -1, 'temp directory visible'); + t.equal(src.indexOf(process.cwd()), -1, 'cwd directory visible'); + t.equal(src.indexOf('/home'), -1, 'home directory visible'); + vm.runInNewContext(src, { t: t, setTimeout: setTimeout, Uint8Array: Uint8Array, ArrayBuffer: ArrayBuffer }); + }); +}); diff --git a/node_modules/browserify/test/maxlisteners.js b/node_modules/browserify/test/maxlisteners.js new file mode 100644 index 000000000..11cfd825c --- /dev/null +++ b/node_modules/browserify/test/maxlisteners.js @@ -0,0 +1,13 @@ +var test = require('tap').test; +var browserify = require('../'); +var vm = require('vm'); + +test('setMaxListener', function (t) { + t.plan(1); + var b = browserify(); + b.add(__dirname + '/maxlisteners/main.js'); + b.bundle(function (err, src) { + vm.runInNewContext(src); + t.ok(true); // didn't crash + }); +}); diff --git a/node_modules/browserify/test/maxlisteners/main.js b/node_modules/browserify/test/maxlisteners/main.js new file mode 100644 index 000000000..a5496a613 --- /dev/null +++ b/node_modules/browserify/test/maxlisteners/main.js @@ -0,0 +1,3 @@ +var EventEmitter = require('events').EventEmitter +var ee = new EventEmitter; +ee.setMaxListeners(5); diff --git a/node_modules/browserify/test/multi_bundle.js b/node_modules/browserify/test/multi_bundle.js new file mode 100644 index 000000000..05411d328 --- /dev/null +++ b/node_modules/browserify/test/multi_bundle.js @@ -0,0 +1,86 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('multi bundle', function (t) { + t.plan(5); + + var core = browserify(); + core.require(__dirname + '/multi_bundle/b.js', { expose: true }); + + var app = browserify([__dirname + '/multi_bundle/a.js']); + // inform this bundle that b exists in another bundle + app.external(__dirname + '/multi_bundle/b.js'); + + core.bundle(function (err, src) { + var c = { + console: console, + t : t, + baton: { + times: 0 + } + }; + + // loading core will cause no require to run + vm.runInNewContext(src, c); + t.equal(c.baton.times, 0); + + // loading the app will require + app.bundle(function (err, src) { + vm.runInNewContext(src, c); + + // b required for the first time + t.equal(c.baton.times, 1); + + // running the file again + // because it is using the same b, no reloading + vm.runInNewContext(src, c); + + // b should not have been required again + // because it was part of the core bundle + t.equal(c.baton.times, 1); + }); + }); +}); + +// re-enable this in future releases +test('multi bundle', function (t) { + t.plan(8); + + var core = browserify({ exposeAll: true }); + core.require(__dirname + '/multi_bundle/a.js', { expose: true }); + + var app = browserify([__dirname + '/multi_bundle/c.js']); + // inform this bundle that b exists in another bundle + app.external(core); + + core.bundle(function (err, src) { + var c = { + console: console, + t : t, + baton: { + times: 0 + } + }; + + // loading core will cause no require to run + vm.runInNewContext(src, c); + t.equal(c.baton.times, 0); + + // loading the app will require + app.bundle(function (err, src) { + vm.runInNewContext(src, c); + + // b required for the first time + t.equal(c.baton.times, 1); + + // running the file again + // because it is using the same b, no reloading + vm.runInNewContext(src, c); + + // b should not have been required again + // because it was part of the core bundle + t.equal(c.baton.times, 1); + }); + }); +}); diff --git a/node_modules/browserify/test/multi_bundle/_prelude.js b/node_modules/browserify/test/multi_bundle/_prelude.js new file mode 100644 index 000000000..95eb4bc84 --- /dev/null +++ b/node_modules/browserify/test/multi_bundle/_prelude.js @@ -0,0 +1 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof unique_require=="function"&&unique_require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof unique_require=="function"&&unique_require;for(var o=0;o -1, 'should contain full entry path'); + } + }); + + b.bundle(function (err, src) { + var c = { + times : 0, + t : t + }; + vm.runInNewContext(src, c); + }); +}); + +test('multi entry relative', function (t) { + t.plan(6); + + var rTestFiles = testFiles.map(function(x) { + return x.replace(__dirname + '/', ''); + }); + + var b = browserify({ + entries: [rTestFiles[0], rTestFiles[1]], + basedir: __dirname + }); + b.add(rTestFiles[2]); + + b.on('dep', function(row) { + if (row.entry) { + t.ok(testFiles.indexOf(row.file) > -1, 'should contain full entry path'); + } + }); + + b.bundle(function (err, src) { + var c = { + times : 0, + t : t + }; + vm.runInNewContext(src, c); + }); +}); + +test('multi entry relative cwd', function (t) { + t.plan(6); + + var rTestFiles = testFiles.map(function(x) { + return x.replace(__dirname + '/', './'); + }); + + var b = browserify({ + entries: [rTestFiles[0], rTestFiles[1]], + basedir: __dirname + }); + b.add(rTestFiles[2]); + + b.on('dep', function(row) { + if (row.entry) { + t.ok(testFiles.indexOf(row.file) > -1, 'should contain full entry path'); + } + }); + + b.bundle(function (err, src) { + var c = { + times : 0, + t : t + }; + vm.runInNewContext(src, c); + }); +}); + +test('entries as streams', function (t) { + t.plan(6); + + // commondir blows up with streams and without basedir + var opts = { basedir: __dirname + '/multi_entry' }; + + var b = browserify([ + fs.createReadStream(testFiles[0]), + fs.createReadStream(testFiles[1]) + ], opts); + b.add(fs.createReadStream(testFiles[2])); + + b.on('dep', function(row) { + if (row.entry) { + t.similar( + row.file, + RegExp(path.join(__dirname, 'multi_entry/_stream_').replace(/\\/g, '\\\\') + '[\\d].js'), + 'should be full entry path' + ); + } + }); + + b.bundle(function (err, src) { + var c = { + times : 0, + t : t + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/multi_entry/a.js b/node_modules/browserify/test/multi_entry/a.js new file mode 100644 index 000000000..d4e250ee9 --- /dev/null +++ b/node_modules/browserify/test/multi_entry/a.js @@ -0,0 +1,2 @@ +times ++; +t.equal(times, 1); diff --git a/node_modules/browserify/test/multi_entry/b.js b/node_modules/browserify/test/multi_entry/b.js new file mode 100644 index 000000000..bed7bbbaf --- /dev/null +++ b/node_modules/browserify/test/multi_entry/b.js @@ -0,0 +1,2 @@ +times ++; +t.equal(times, 2); diff --git a/node_modules/browserify/test/multi_entry/c.js b/node_modules/browserify/test/multi_entry/c.js new file mode 100644 index 000000000..ac3c174da --- /dev/null +++ b/node_modules/browserify/test/multi_entry/c.js @@ -0,0 +1,2 @@ +times ++; +t.equal(times, 3); diff --git a/node_modules/browserify/test/multi_entry_cross_require.js b/node_modules/browserify/test/multi_entry_cross_require.js new file mode 100644 index 000000000..43f04ea51 --- /dev/null +++ b/node_modules/browserify/test/multi_entry_cross_require.js @@ -0,0 +1,93 @@ +var browserify = require('../'); +var vm = require('vm'); +var path = require('path'); +var test = require('tap').test; + +var testFiles = [ + path.join(__dirname, 'multi_entry_cross_require/a.js'), + path.join(__dirname, 'multi_entry_cross_require/lib/b.js'), + path.join(__dirname, 'multi_entry_cross_require/c.js') +]; + +test('multi entry cross require', function (t) { + t.plan(8); + + var b = browserify([ + testFiles[0], + testFiles[1] + ]); + b.add(testFiles[2]); + + b.on('dep', function(row) { + if (row.entry) { + t.ok(testFiles.indexOf(row.file) > -1, 'should contain full entry path'); + } + }); + + b.bundle(function (err, src) { + if (err) throw err; + var c = { + times : 0, + t : t + }; + vm.runInNewContext(src, c); + }); +}); + +test('multi entry cross require - relative cwd', function (t) { + t.plan(8); + + var dsTestFiles = testFiles.map(function(x) { + return x.replace(__dirname + '/', './'); + }); + + var b = browserify({ + entries: [dsTestFiles[0], dsTestFiles[1]], + basedir: __dirname + }); + b.add(dsTestFiles[2]); + + b.on('dep', function(row) { + if (row.entry) { + t.ok(testFiles.indexOf(row.file) > -1, 'should contain full entry path'); + } + }); + + b.bundle(function (err, src) { + if (err) throw err; + var c = { + times : 0, + t : t + }; + vm.runInNewContext(src, c); + }); +}); + +test('multi entry cross require - relative', function (t) { + t.plan(8); + + var rTestFiles = testFiles.map(function(x) { + return x.replace(__dirname + '/', ''); + }); + + var b = browserify({ + entries: [rTestFiles[0], rTestFiles[1]], + basedir: __dirname + }); + b.add(rTestFiles[2]); + + b.on('dep', function(row) { + if (row.entry) { + t.ok(testFiles.indexOf(row.file) > -1, 'should contain full entry path'); + } + }); + + b.bundle(function (err, src) { + if (err) throw err; + var c = { + times : 0, + t : t + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/multi_entry_cross_require/a.js b/node_modules/browserify/test/multi_entry_cross_require/a.js new file mode 100644 index 000000000..0223dafc0 --- /dev/null +++ b/node_modules/browserify/test/multi_entry_cross_require/a.js @@ -0,0 +1,8 @@ +times ++; +t.equal(times, 1); + +var b = require('./lib/b'); +t.equal(times, 2); + +b.foo(); +t.equal(times, 3); diff --git a/node_modules/browserify/test/multi_entry_cross_require/c.js b/node_modules/browserify/test/multi_entry_cross_require/c.js new file mode 100644 index 000000000..e1918384b --- /dev/null +++ b/node_modules/browserify/test/multi_entry_cross_require/c.js @@ -0,0 +1,7 @@ +times++; +t.equal(times, 4); + +var b = require('./lib/b'); +b.foo(); + +t.equal(times, 5); diff --git a/node_modules/browserify/test/multi_entry_cross_require/lib/b.js b/node_modules/browserify/test/multi_entry_cross_require/lib/b.js new file mode 100644 index 000000000..e7d2dad1f --- /dev/null +++ b/node_modules/browserify/test/multi_entry_cross_require/lib/b.js @@ -0,0 +1,5 @@ +times++; + +module.exports.foo = function() { + times++; +}; diff --git a/node_modules/browserify/test/multi_require.js b/node_modules/browserify/test/multi_require.js new file mode 100644 index 000000000..a1b3f64e1 --- /dev/null +++ b/node_modules/browserify/test/multi_require.js @@ -0,0 +1,18 @@ +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); + +test('require same file locally and globally', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/multi_require/main.js', { + basedir: __dirname + }); + b.require('./multi_require/a.js', {expose: 'a'}); + + b.bundle(function (err, src) { + t.ifError(err); + var c = {t: t}; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/multi_require/a.js b/node_modules/browserify/test/multi_require/a.js new file mode 100644 index 000000000..18dea6747 --- /dev/null +++ b/node_modules/browserify/test/multi_require/a.js @@ -0,0 +1,3 @@ +module.exports = function() { + return 'a'; +} diff --git a/node_modules/browserify/test/multi_require/main.js b/node_modules/browserify/test/multi_require/main.js new file mode 100644 index 000000000..6f548ec96 --- /dev/null +++ b/node_modules/browserify/test/multi_require/main.js @@ -0,0 +1,4 @@ +var localA = require('./a.js'); +var globalA = require('a'); + +t.equal(localA, globalA); diff --git a/node_modules/browserify/test/multi_symlink.js b/node_modules/browserify/test/multi_symlink.js new file mode 100644 index 000000000..08a5b1dd6 --- /dev/null +++ b/node_modules/browserify/test/multi_symlink.js @@ -0,0 +1,13 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('multiple symlink execution', { skip: process.platform === 'win32' }, function (t) { + t.plan(1); + var b = browserify(__dirname + '/multi_symlink/main.js'); + b.bundle(function (err, src) { + var c = { console: { log: log } }; + vm.runInNewContext(src, c); + function log (msg) { t.equal(msg, 'X') } + }); +}); diff --git a/node_modules/browserify/test/multi_symlink/main.js b/node_modules/browserify/test/multi_symlink/main.js new file mode 100644 index 000000000..0f904dc91 --- /dev/null +++ b/node_modules/browserify/test/multi_symlink/main.js @@ -0,0 +1,2 @@ +require('./x.js'); +require('./y.js'); diff --git a/node_modules/browserify/test/multi_symlink/x.js b/node_modules/browserify/test/multi_symlink/x.js new file mode 100644 index 000000000..e894542cb --- /dev/null +++ b/node_modules/browserify/test/multi_symlink/x.js @@ -0,0 +1 @@ +console.log('X'); diff --git a/node_modules/browserify/test/no_builtins.js b/node_modules/browserify/test/no_builtins.js new file mode 100644 index 000000000..4a25c93f2 --- /dev/null +++ b/node_modules/browserify/test/no_builtins.js @@ -0,0 +1,66 @@ +var browserify = require('../'); +var test = require('tap').test; +var path = require('path'); +var vm = require('vm'); + +test('builtins false', function (t) { + t.plan(1); + + var file = __dirname + '/no_builtins/main.js'; + var b = browserify({ + entries: [ file ], + commondir: false, + builtins: false + }); + b.bundle(function (err, src) { + var c = { + console: { log: function (msg) { + t.equal(msg, 'beep boop\n'); + } }, + require: require, + __dirname: process.cwd() + }; + vm.runInNewContext(src, c); + }); +}); + +test('builtins []', function (t) { + t.plan(1); + var b = browserify({ + entries: [ __dirname + '/no_builtins/main.js' ], + commondir: false, + builtins: [] + }); + b.bundle(function (err, src) { + var c = { + console: { log: function (msg) { + t.equal(msg, 'beep boop\n'); + } }, + require: require + }; + vm.runInNewContext(src, c); + }); +}); + +test('builtins object', function (t) { + t.plan(2); + var b = browserify({ + entries: [ __dirname + '/no_builtins/main.js' ], + commondir: false, + builtins: { + fs: require.resolve('./no_builtins/extra/fs.js'), + tls: require.resolve('./no_builtins/extra/tls.js') + } + }); + var expected = [ + 'WRITE CODE EVERY DAY', + 'WHATEVER' + ]; + b.bundle(function (err, src) { + var c = { console: { log: log }, require: require }; + function log (msg) { + t.equal(msg, expected.shift()); + } + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/no_builtins/extra/fs.js b/node_modules/browserify/test/no_builtins/extra/fs.js new file mode 100644 index 000000000..b8bdd44e2 --- /dev/null +++ b/node_modules/browserify/test/no_builtins/extra/fs.js @@ -0,0 +1 @@ +exports.readFileSync = function () { return 'WHATEVER' }; diff --git a/node_modules/browserify/test/no_builtins/extra/tls.js b/node_modules/browserify/test/no_builtins/extra/tls.js new file mode 100644 index 000000000..ceea2a64a --- /dev/null +++ b/node_modules/browserify/test/no_builtins/extra/tls.js @@ -0,0 +1 @@ +console.log('WRITE CODE EVERY DAY'); diff --git a/node_modules/browserify/test/no_builtins/main.js b/node_modules/browserify/test/no_builtins/main.js new file mode 100644 index 000000000..f2dadc653 --- /dev/null +++ b/node_modules/browserify/test/no_builtins/main.js @@ -0,0 +1,4 @@ +var fs = require('fs'); +var tls = require('tls'); + +console.log(fs.readFileSync(__dirname + '/x.txt', 'utf8')); diff --git a/node_modules/browserify/test/no_builtins/x.txt b/node_modules/browserify/test/no_builtins/x.txt new file mode 100644 index 000000000..fae06e349 --- /dev/null +++ b/node_modules/browserify/test/no_builtins/x.txt @@ -0,0 +1 @@ +beep boop diff --git a/node_modules/browserify/test/node_modules/beep/index.js b/node_modules/browserify/test/node_modules/beep/index.js new file mode 100644 index 000000000..2d3c19425 --- /dev/null +++ b/node_modules/browserify/test/node_modules/beep/index.js @@ -0,0 +1 @@ +module.exports = 'boop' diff --git a/node_modules/browserify/test/node_modules/plugin-foo/index.js b/node_modules/browserify/test/node_modules/plugin-foo/index.js new file mode 100644 index 000000000..a2dde3e7e --- /dev/null +++ b/node_modules/browserify/test/node_modules/plugin-foo/index.js @@ -0,0 +1,9 @@ +var through = require('through2'); + +module.exports = function (b, opts) { + var stream = through(function () {}, function () {}); + stream.push(opts.msg); + stream.push(null); + + b.pipeline.get('wrap').splice(0,1,stream); +}; diff --git a/node_modules/browserify/test/node_modules/tr/index.js b/node_modules/browserify/test/node_modules/tr/index.js new file mode 100644 index 000000000..b3c484f22 --- /dev/null +++ b/node_modules/browserify/test/node_modules/tr/index.js @@ -0,0 +1,8 @@ +var through = require('through2'); + +module.exports = function () { + return through(function (buf, enc, next) { + this.push(buf.toString('utf8').replace(/X/g, 'Z')); + next(); + }); +}; diff --git a/node_modules/browserify/test/noparse.js b/node_modules/browserify/test/noparse.js new file mode 100644 index 000000000..ddb024df1 --- /dev/null +++ b/node_modules/browserify/test/noparse.js @@ -0,0 +1,31 @@ +var browserify = require('../'); +var test = require('tap').test; +var path = require('path'); + +test('noParse array', function (t) { + process.chdir(__dirname); + + t.plan(2); + + var actual = []; + var expected = [ + 'noparse/a.js', + 'noparse/b.js', + 'noparse/dir1/1.js', + 'noparse/node_modules/robot/main.js' + ].map(function (x) {return path.resolve(x);}).sort(); + + var b = browserify({ + entries: [ __dirname + '/noparse/a.js' ], + noParse: [ + path.join(__dirname, 'noparse/dir1/1.js'), + path.join(__dirname, 'noparse/node_modules/robot/main.js') + ] + }); + b.on('dep', function(dep) { actual.push(dep.file); }); + b.bundle(function (err, src) { + actual.sort(); + t.ifError(err); + t.deepEqual(actual, expected); + }); +}); diff --git a/node_modules/browserify/test/noparse/a.js b/node_modules/browserify/test/noparse/a.js new file mode 100644 index 000000000..076812a66 --- /dev/null +++ b/node_modules/browserify/test/noparse/a.js @@ -0,0 +1,4 @@ +module.exports = { + a: true, + b: require('./b') +}; diff --git a/node_modules/browserify/test/noparse/b.js b/node_modules/browserify/test/noparse/b.js new file mode 100644 index 000000000..de0ba559a --- /dev/null +++ b/node_modules/browserify/test/noparse/b.js @@ -0,0 +1,5 @@ +module.exports = { + b: true, + 1: require('./dir1/1'), + robot: require('robot') +}; diff --git a/node_modules/browserify/test/noparse/dir1/1.js b/node_modules/browserify/test/noparse/dir1/1.js new file mode 100644 index 000000000..960968b0b --- /dev/null +++ b/node_modules/browserify/test/noparse/dir1/1.js @@ -0,0 +1,4 @@ +module.exports = { + 1: true, + 2: require('./dir2/2') +}; diff --git a/node_modules/browserify/test/noparse/dir1/dir2/2.js b/node_modules/browserify/test/noparse/dir1/dir2/2.js new file mode 100644 index 000000000..ef4ba1962 --- /dev/null +++ b/node_modules/browserify/test/noparse/dir1/dir2/2.js @@ -0,0 +1,3 @@ +module.exports = { + 2: true +}; diff --git a/node_modules/browserify/test/noparse/node_modules/robot/lib/beep.js b/node_modules/browserify/test/noparse/node_modules/robot/lib/beep.js new file mode 100644 index 000000000..6529dd85c --- /dev/null +++ b/node_modules/browserify/test/noparse/node_modules/robot/lib/beep.js @@ -0,0 +1,4 @@ +module.exports = { + beep: true, + boop: require('./boop') +}; diff --git a/node_modules/browserify/test/noparse/node_modules/robot/lib/boop.js b/node_modules/browserify/test/noparse/node_modules/robot/lib/boop.js new file mode 100644 index 000000000..696a67245 --- /dev/null +++ b/node_modules/browserify/test/noparse/node_modules/robot/lib/boop.js @@ -0,0 +1,3 @@ +module.exports = { + boop: true +}; diff --git a/node_modules/browserify/test/noparse/node_modules/robot/main.js b/node_modules/browserify/test/noparse/node_modules/robot/main.js new file mode 100644 index 000000000..87af6096a --- /dev/null +++ b/node_modules/browserify/test/noparse/node_modules/robot/main.js @@ -0,0 +1,4 @@ +module.exports = { + robot: true, + beep: require('./lib/beep') +}; diff --git a/node_modules/browserify/test/noparse/node_modules/robot/package.json b/node_modules/browserify/test/noparse/node_modules/robot/package.json new file mode 100644 index 000000000..c13b8cf6a --- /dev/null +++ b/node_modules/browserify/test/noparse/node_modules/robot/package.json @@ -0,0 +1,3 @@ +{ + "main": "main.js" +} diff --git a/node_modules/browserify/test/pack.js b/node_modules/browserify/test/pack.js new file mode 100644 index 000000000..68a6e2c69 --- /dev/null +++ b/node_modules/browserify/test/pack.js @@ -0,0 +1,33 @@ +var browserify = require('../'); +var vm = require('vm'); +var through = require('through2'); +var test = require('tap').test; + +var fs = require('fs'); +var sources = { + 1: fs.readFileSync(__dirname + '/entry/main.js', 'utf8'), + 2: fs.readFileSync(__dirname + '/entry/one.js', 'utf8'), + 3: fs.readFileSync(__dirname + '/entry/two.js', 'utf8') +}; + +var deps = { + 1: { './two': 3, './one': 2 }, + 2: {}, + 3: {} +}; + +test('custom packer', function (t) { + t.plan(7); + + var b = browserify(__dirname + '/entry/main.js'); + b.pipeline.get('pack').splice(0,1, through.obj(function (row, enc, next) { + t.equal(sources[row.id], row.source); + t.deepEqual(deps[row.id], row.deps); + this.push(row.id + '\n'); + next(); + })); + b.pipeline.get('wrap').splice(0); + b.bundle(function (err, src) { + t.equal(src.toString('utf8'), '1\n2\n3\n'); + }); +}); diff --git a/node_modules/browserify/test/paths.js b/node_modules/browserify/test/paths.js new file mode 100644 index 000000000..c3d5728fa --- /dev/null +++ b/node_modules/browserify/test/paths.js @@ -0,0 +1,32 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('$NODE_PATHS', function (t) { + t.plan(3); + var paths = [ __dirname + '/paths/x', __dirname + '/paths/y' ]; + var sep = /^win/i.test(process.platform) ? ';' : ':'; + + process.env.NODE_PATH = (process.env.NODE_PATHS || '') + .split(sep).concat(paths).join(sep) + ; + + var b = browserify(__dirname + '/paths/main.js'); + b.bundle(function (err, src) { + if (err) t.fail(err); + vm.runInNewContext(src, { t: t }); + }); +}); + +test('opts.paths', function (t) { + t.plan(3); + + var b = browserify({ + paths: [ __dirname + '/paths/x', __dirname + '/paths/y' ], + entries: __dirname + '/paths/main.js' + }); + b.bundle(function (err, src) { + if (err) t.fail(err); + vm.runInNewContext(src, { t: t }); + }); +}); diff --git a/node_modules/browserify/test/paths/main.js b/node_modules/browserify/test/paths/main.js new file mode 100644 index 000000000..ec0d8a18d --- /dev/null +++ b/node_modules/browserify/test/paths/main.js @@ -0,0 +1,3 @@ +t.equal(require('aaa'), 'AX'); +t.equal(require('bbb'), 'BY'); +t.equal(require('ccc'), 'CX'); diff --git a/node_modules/browserify/test/paths/x/aaa/index.js b/node_modules/browserify/test/paths/x/aaa/index.js new file mode 100644 index 000000000..b76ce87ec --- /dev/null +++ b/node_modules/browserify/test/paths/x/aaa/index.js @@ -0,0 +1 @@ +module.exports = 'AX' diff --git a/node_modules/browserify/test/paths/x/ccc/index.js b/node_modules/browserify/test/paths/x/ccc/index.js new file mode 100644 index 000000000..882058e33 --- /dev/null +++ b/node_modules/browserify/test/paths/x/ccc/index.js @@ -0,0 +1 @@ +module.exports = 'CX' diff --git a/node_modules/browserify/test/paths/y/bbb/index.js b/node_modules/browserify/test/paths/y/bbb/index.js new file mode 100644 index 000000000..5dbca4475 --- /dev/null +++ b/node_modules/browserify/test/paths/y/bbb/index.js @@ -0,0 +1 @@ +module.exports = 'BY' diff --git a/node_modules/browserify/test/paths/y/ccc/index.js b/node_modules/browserify/test/paths/y/ccc/index.js new file mode 100644 index 000000000..d0043d1ec --- /dev/null +++ b/node_modules/browserify/test/paths/y/ccc/index.js @@ -0,0 +1 @@ +module.exports = 'CY' diff --git a/node_modules/browserify/test/paths_transform.js b/node_modules/browserify/test/paths_transform.js new file mode 100644 index 000000000..bd0607052 --- /dev/null +++ b/node_modules/browserify/test/paths_transform.js @@ -0,0 +1,76 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +function ensureTransform(t, buf) { + var srcAsString = (buf||'').toString('utf-8'), + containsAX = srcAsString.indexOf('AX') > -1, + containsAZ = srcAsString.indexOf('AZ') > -1; + t.notOk(containsAX,"should not contain AX's"); + t.ok(containsAZ,"should contain AZ's"); +} + +test('absolute paths with transform property', function (t) { + t.plan(6); + + var b = browserify({ + transform: ['tr'], + basedir: __dirname, + paths: [ __dirname + '/paths/x', __dirname + '/paths/y' ], + entries: __dirname + '/paths/main.js' + }); + b.bundle(function (err, src) { + t.ifError(err); + ensureTransform(t,src); + vm.runInNewContext(src, { t: t }); + }); +}); + +test('relative paths with transform property', function (t) { + t.plan(6); + + var b = browserify({ + transform: ['tr'], + basedir: __dirname, + paths: [ './paths/x', './paths/y' ], + entries: __dirname + '/paths/main.js' + }); + b.bundle(function (err, src) { + t.ifError(err); + ensureTransform(t,src); + vm.runInNewContext(src, { t: t }); + }); +}); + + +test('absolute paths with transform method', function (t) { + t.plan(6); + + var b = browserify({ + basedir: __dirname, + paths: [ __dirname + '/paths/x', __dirname + '/paths/y' ], + entries: __dirname + '/paths/main.js' + }); + b.transform('tr'); + b.bundle(function (err, src) { + t.ifError(err); + ensureTransform(t,src); + vm.runInNewContext(src, { t: t }); + }); +}); + + +test('relative paths with transform method', function (t) { + t.plan(6); + var b = browserify({ + basedir: __dirname, + paths: ['./paths/x', './paths/y' ], + entries: __dirname + '/paths/main.js' + }); + b.transform('tr'); + b.bundle(function (err, src) { + t.ifError(err); + ensureTransform(t,src); + vm.runInNewContext(src, { t: t }); + }); +}); diff --git a/node_modules/browserify/test/pipeline_deps.js b/node_modules/browserify/test/pipeline_deps.js new file mode 100644 index 000000000..8f847a755 --- /dev/null +++ b/node_modules/browserify/test/pipeline_deps.js @@ -0,0 +1,22 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var through = require('through2'); + +test('deps pipeline', function (t) { + t.plan(1); + + var b = browserify(__dirname + '/pipeline_deps/main.js'); + b.pipeline.get('deps').push(through.obj(function (row, enc, next) { + row.source = row.source.replace(/111/g, '11111'); + this.push(row); + next(); + })); + + b.bundle(function (err, src) { + Function([ 'console' ], src)({ log: log }); + function log (msg) { + t.equal(msg, 'main: 56055'); + } + }); +}); diff --git a/node_modules/browserify/test/pipeline_deps/bar.js b/node_modules/browserify/test/pipeline_deps/bar.js new file mode 100644 index 000000000..c57fa530a --- /dev/null +++ b/node_modules/browserify/test/pipeline_deps/bar.js @@ -0,0 +1,3 @@ +module.exports = function (n) { + return n * 100; +}; diff --git a/node_modules/browserify/test/pipeline_deps/foo.js b/node_modules/browserify/test/pipeline_deps/foo.js new file mode 100644 index 000000000..c62e63856 --- /dev/null +++ b/node_modules/browserify/test/pipeline_deps/foo.js @@ -0,0 +1,5 @@ +var bar = require('./bar'); + +module.exports = function (n) { + return n * 111 + bar(n); +}; diff --git a/node_modules/browserify/test/pipeline_deps/main.js b/node_modules/browserify/test/pipeline_deps/main.js new file mode 100644 index 000000000..8c71d7997 --- /dev/null +++ b/node_modules/browserify/test/pipeline_deps/main.js @@ -0,0 +1,2 @@ +var foo = require('./foo'); +console.log('main: ' + foo(5)); diff --git a/node_modules/browserify/test/pipeline_deps/xyz.js b/node_modules/browserify/test/pipeline_deps/xyz.js new file mode 100644 index 000000000..dff6877a8 --- /dev/null +++ b/node_modules/browserify/test/pipeline_deps/xyz.js @@ -0,0 +1,2 @@ +var foo = require('./foo'); +console.log('xyz: ' + foo(6)); diff --git a/node_modules/browserify/test/pkg.js b/node_modules/browserify/test/pkg.js new file mode 100644 index 000000000..753e6d8c0 --- /dev/null +++ b/node_modules/browserify/test/pkg.js @@ -0,0 +1,20 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var path = require('path'); + +var pkg = require('./pkg/package.json'); +pkg.__dirname = path.join(__dirname, 'pkg'); + +test('package', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/pkg/main.js'); + b.on('package', function (pkg_) { + t.deepEqual(pkg_, pkg); + }); + + b.bundle(function (err) { + t.ifError(err); + }); +}); diff --git a/node_modules/browserify/test/pkg/main.js b/node_modules/browserify/test/pkg/main.js new file mode 100644 index 000000000..07a8fbf2c --- /dev/null +++ b/node_modules/browserify/test/pkg/main.js @@ -0,0 +1 @@ +console.log(555) diff --git a/node_modules/browserify/test/pkg/package.json b/node_modules/browserify/test/pkg/package.json new file mode 100644 index 000000000..cc806a70a --- /dev/null +++ b/node_modules/browserify/test/pkg/package.json @@ -0,0 +1 @@ +{ "beep": "boop" } diff --git a/node_modules/browserify/test/pkg_event.js b/node_modules/browserify/test/pkg_event.js new file mode 100644 index 000000000..77ada96bf --- /dev/null +++ b/node_modules/browserify/test/pkg_event.js @@ -0,0 +1,31 @@ +var browserify = require('../'); +var path = require('path'); +var vm = require('vm'); +var test = require('tap').test; + +var expected = [ + readpkg('pkg_event'), + readpkg('pkg_event/node_modules/aaa'), + readpkg('pkg_event/node_modules/aaa/lib') +]; + +test('package event', function (t) { + t.plan(2 + expected.length); + + var b = browserify(__dirname + '/pkg_event/main.js'); + b.on('package', function (pkg) { + t.deepEqual(pkg, expected.shift()); + }); + + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { console: { log: log } }); + function log (msg) { t.equal(msg, 555) } + }); +}); + +function readpkg (dir) { + var pkg = require(path.join(__dirname, dir, 'package.json')); + pkg.__dirname = path.join(__dirname, dir); + return pkg; +} diff --git a/node_modules/browserify/test/pkg_event/main.js b/node_modules/browserify/test/pkg_event/main.js new file mode 100644 index 000000000..bef366aec --- /dev/null +++ b/node_modules/browserify/test/pkg_event/main.js @@ -0,0 +1 @@ +console.log(require('aaa')) diff --git a/node_modules/browserify/test/pkg_event/node_modules/aaa/lib/butts.js b/node_modules/browserify/test/pkg_event/node_modules/aaa/lib/butts.js new file mode 100644 index 000000000..f4e8d9d29 --- /dev/null +++ b/node_modules/browserify/test/pkg_event/node_modules/aaa/lib/butts.js @@ -0,0 +1 @@ +module.exports = 5; diff --git a/node_modules/browserify/test/pkg_event/node_modules/aaa/lib/package.json b/node_modules/browserify/test/pkg_event/node_modules/aaa/lib/package.json new file mode 100644 index 000000000..b47402f55 --- /dev/null +++ b/node_modules/browserify/test/pkg_event/node_modules/aaa/lib/package.json @@ -0,0 +1,4 @@ +{ + "name": "aaa-lib", + "main": "woo.js" +} diff --git a/node_modules/browserify/test/pkg_event/node_modules/aaa/lib/woo.js b/node_modules/browserify/test/pkg_event/node_modules/aaa/lib/woo.js new file mode 100644 index 000000000..82cef514e --- /dev/null +++ b/node_modules/browserify/test/pkg_event/node_modules/aaa/lib/woo.js @@ -0,0 +1 @@ +module.exports = require('./butts.js'); diff --git a/node_modules/browserify/test/pkg_event/node_modules/aaa/main.js b/node_modules/browserify/test/pkg_event/node_modules/aaa/main.js new file mode 100644 index 000000000..822d064da --- /dev/null +++ b/node_modules/browserify/test/pkg_event/node_modules/aaa/main.js @@ -0,0 +1 @@ +module.exports = require('./lib') * 111; diff --git a/node_modules/browserify/test/pkg_event/node_modules/aaa/package.json b/node_modules/browserify/test/pkg_event/node_modules/aaa/package.json new file mode 100644 index 000000000..e9f2198f4 --- /dev/null +++ b/node_modules/browserify/test/pkg_event/node_modules/aaa/package.json @@ -0,0 +1,4 @@ +{ + "name": "aaa", + "main": "main.js" +} diff --git a/node_modules/browserify/test/pkg_event/package.json b/node_modules/browserify/test/pkg_event/package.json new file mode 100644 index 000000000..21d82d8e6 --- /dev/null +++ b/node_modules/browserify/test/pkg_event/package.json @@ -0,0 +1,3 @@ +{ + "name": "pkg_event" +} diff --git a/node_modules/browserify/test/plugin.js b/node_modules/browserify/test/plugin.js new file mode 100644 index 000000000..be143a3ed --- /dev/null +++ b/node_modules/browserify/test/plugin.js @@ -0,0 +1,28 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('plugin fn', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/plugin/main.js', { basedir: __dirname }); + b.plugin(function (b_) { + t.equal(b, b_); + }); + + b.bundle(function (err, src) { + t.ifError(err); + }); +}); + +test('plugin module', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/plugin/main.js', { basedir: __dirname }); + b.plugin('plugin-foo', { msg: 'beep boop' }); + + b.bundle(function (err, src) { + t.ifError(err); + t.equal(src.toString('utf8'), 'beep boop'); + }); +}); diff --git a/node_modules/browserify/test/plugin/main.js b/node_modules/browserify/test/plugin/main.js new file mode 100644 index 000000000..3e842e734 --- /dev/null +++ b/node_modules/browserify/test/plugin/main.js @@ -0,0 +1 @@ +module.exports = 555 diff --git a/node_modules/browserify/test/preserve-symlinks.js b/node_modules/browserify/test/preserve-symlinks.js new file mode 100644 index 000000000..83940ddc4 --- /dev/null +++ b/node_modules/browserify/test/preserve-symlinks.js @@ -0,0 +1,27 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('optionally preserves symlinks', { skip: process.platform === 'win32' }, function (t) { + t.plan(2); + + var b = browserify(__dirname + '/preserve_symlinks/a/index.js', {preserveSymlinks: true}); + b.bundle(function (err, buf) { + t.ifError(err); + t.ok(buf); + var src = buf.toString('utf8'); + vm.runInNewContext(src, {}); + }); +}); + +test('always resolve entry point symlink', { skip: process.platform === 'win32' }, function (t) { + t.plan(2); + + var b = browserify(__dirname + '/preserve_symlinks/linked-entry.js', {preserveSymlinks: true}); + b.bundle(function (err, buf) { + t.ifError(err); + t.ok(buf); + var src = buf.toString('utf8'); + vm.runInNewContext(src, {}); + }); +}) diff --git a/node_modules/browserify/test/preserve_symlinks/a/index.js b/node_modules/browserify/test/preserve_symlinks/a/index.js new file mode 100644 index 000000000..5f6937c38 --- /dev/null +++ b/node_modules/browserify/test/preserve_symlinks/a/index.js @@ -0,0 +1 @@ +require('b'); diff --git a/node_modules/browserify/test/preserve_symlinks/a/node_modules/b/index.js b/node_modules/browserify/test/preserve_symlinks/a/node_modules/b/index.js new file mode 100644 index 000000000..a56a50847 --- /dev/null +++ b/node_modules/browserify/test/preserve_symlinks/a/node_modules/b/index.js @@ -0,0 +1 @@ +require('c'); diff --git a/node_modules/browserify/test/preserve_symlinks/a/node_modules/c/index.js b/node_modules/browserify/test/preserve_symlinks/a/node_modules/c/index.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/browserify/test/preserve_symlinks/b/index.js b/node_modules/browserify/test/preserve_symlinks/b/index.js new file mode 100644 index 000000000..a56a50847 --- /dev/null +++ b/node_modules/browserify/test/preserve_symlinks/b/index.js @@ -0,0 +1 @@ +require('c'); diff --git a/node_modules/browserify/test/process.js b/node_modules/browserify/test/process.js new file mode 100644 index 000000000..83ffa14ff --- /dev/null +++ b/node_modules/browserify/test/process.js @@ -0,0 +1,21 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('implicit process global', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/process/main.js'); + b.bundle(function (err, src) { + var c = { + done : function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + t.end(); + }, + setTimeout: setTimeout, + clearTimeout: clearTimeout + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/process/main.js b/node_modules/browserify/test/process/main.js new file mode 100644 index 000000000..089557918 --- /dev/null +++ b/node_modules/browserify/test/process/main.js @@ -0,0 +1,3 @@ +process.nextTick(function () { + done(require('./one'), require('./two')); +}); diff --git a/node_modules/browserify/test/process/one.js b/node_modules/browserify/test/process/one.js new file mode 100644 index 000000000..bd816eaba --- /dev/null +++ b/node_modules/browserify/test/process/one.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/browserify/test/process/two.js b/node_modules/browserify/test/process/two.js new file mode 100644 index 000000000..4bbffde10 --- /dev/null +++ b/node_modules/browserify/test/process/two.js @@ -0,0 +1 @@ +module.exports = 2; diff --git a/node_modules/browserify/test/quotes.js b/node_modules/browserify/test/quotes.js new file mode 100644 index 000000000..4c82b7ebe --- /dev/null +++ b/node_modules/browserify/test/quotes.js @@ -0,0 +1,38 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +var hasTemplateLiterals = require('has-template-literals')(); + +test('quotes', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/quotes/main.js'); + b.bundle(function (err, src) { + var c = { + done : function (single, double) { + t.equal(single, 'success', 'single quotes'); + t.equal(double, 'success', 'double quotes'); + t.end(); + } + }; + vm.runInNewContext(src, c); + }); +}); + +test('interpolation literals', { skip: !hasTemplateLiterals }, function (t) { + t.plan(3); + + var b = browserify(__dirname + '/quotes/backtick.js'); + b.bundle(function (err, src) { + var c = { + done : function (single, double, backtick) { + t.equal(single, 'success', 'single quotes'); + t.equal(double, 'success', 'double quotes'); + t.equal(backtick, 'success', 'backtick quotes'); + t.end(); + } + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/quotes/backtick.js b/node_modules/browserify/test/quotes/backtick.js new file mode 100644 index 000000000..7dd85f1f3 --- /dev/null +++ b/node_modules/browserify/test/quotes/backtick.js @@ -0,0 +1 @@ +done(require('./one.js'), require("./two.js"), require(`./three.js`)); diff --git a/node_modules/browserify/test/quotes/main.js b/node_modules/browserify/test/quotes/main.js new file mode 100644 index 000000000..327b5826b --- /dev/null +++ b/node_modules/browserify/test/quotes/main.js @@ -0,0 +1 @@ +done(require('./one.js'), require("./two.js")); diff --git a/node_modules/browserify/test/quotes/one.js b/node_modules/browserify/test/quotes/one.js new file mode 100644 index 000000000..52b5cbb33 --- /dev/null +++ b/node_modules/browserify/test/quotes/one.js @@ -0,0 +1 @@ +module.exports = 'success'; diff --git a/node_modules/browserify/test/quotes/three.js b/node_modules/browserify/test/quotes/three.js new file mode 100644 index 000000000..52b5cbb33 --- /dev/null +++ b/node_modules/browserify/test/quotes/three.js @@ -0,0 +1 @@ +module.exports = 'success'; diff --git a/node_modules/browserify/test/quotes/two.js b/node_modules/browserify/test/quotes/two.js new file mode 100644 index 000000000..52b5cbb33 --- /dev/null +++ b/node_modules/browserify/test/quotes/two.js @@ -0,0 +1 @@ +module.exports = 'success'; diff --git a/node_modules/browserify/test/relative_dedupe.js b/node_modules/browserify/test/relative_dedupe.js new file mode 100644 index 000000000..5a4a25250 --- /dev/null +++ b/node_modules/browserify/test/relative_dedupe.js @@ -0,0 +1,17 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('relative dedupe', function (t) { + var expected = [ 'a a', 'a b', 'b a', 'b b' ]; + t.plan(expected.length + 1); + + var b = browserify(__dirname + '/relative_dedupe/main.js'); + b.bundle(function (err, src) { + t.ifError(err); + var c = { console: { log: log } }; + vm.runInNewContext(src, c); + }); + + function log (msg) { t.equal(msg, expected.shift()) } +}); diff --git a/node_modules/browserify/test/relative_dedupe/a/a.js b/node_modules/browserify/test/relative_dedupe/a/a.js new file mode 100644 index 000000000..fd6bd9491 --- /dev/null +++ b/node_modules/browserify/test/relative_dedupe/a/a.js @@ -0,0 +1,3 @@ +module.exports = function() { + console.log("a a") +}; diff --git a/node_modules/browserify/test/relative_dedupe/a/b.js b/node_modules/browserify/test/relative_dedupe/a/b.js new file mode 100644 index 000000000..3bdfe50d3 --- /dev/null +++ b/node_modules/browserify/test/relative_dedupe/a/b.js @@ -0,0 +1,3 @@ +module.exports = function() { + console.log("a b") +}; diff --git a/node_modules/browserify/test/relative_dedupe/a/index.js b/node_modules/browserify/test/relative_dedupe/a/index.js new file mode 100644 index 000000000..5002ffcb1 --- /dev/null +++ b/node_modules/browserify/test/relative_dedupe/a/index.js @@ -0,0 +1,4 @@ +module.exports = { + a: require("./a"), + b: require("./b") +}; diff --git a/node_modules/browserify/test/relative_dedupe/b/a.js b/node_modules/browserify/test/relative_dedupe/b/a.js new file mode 100644 index 000000000..eb66e54be --- /dev/null +++ b/node_modules/browserify/test/relative_dedupe/b/a.js @@ -0,0 +1,3 @@ +module.exports = function() { + console.log("b a") +}; diff --git a/node_modules/browserify/test/relative_dedupe/b/b.js b/node_modules/browserify/test/relative_dedupe/b/b.js new file mode 100644 index 000000000..94faa6281 --- /dev/null +++ b/node_modules/browserify/test/relative_dedupe/b/b.js @@ -0,0 +1,3 @@ +module.exports = function() { + console.log("b b") +}; diff --git a/node_modules/browserify/test/relative_dedupe/b/index.js b/node_modules/browserify/test/relative_dedupe/b/index.js new file mode 100644 index 000000000..5002ffcb1 --- /dev/null +++ b/node_modules/browserify/test/relative_dedupe/b/index.js @@ -0,0 +1,4 @@ +module.exports = { + a: require("./a"), + b: require("./b") +}; diff --git a/node_modules/browserify/test/relative_dedupe/index.js b/node_modules/browserify/test/relative_dedupe/index.js new file mode 100644 index 000000000..69ce41bf9 --- /dev/null +++ b/node_modules/browserify/test/relative_dedupe/index.js @@ -0,0 +1,4 @@ +module.exports = { + a: require("./a"), + b: require("./b") +}; diff --git a/node_modules/browserify/test/relative_dedupe/main.js b/node_modules/browserify/test/relative_dedupe/main.js new file mode 100644 index 000000000..deb937044 --- /dev/null +++ b/node_modules/browserify/test/relative_dedupe/main.js @@ -0,0 +1,5 @@ +var ix = require('./'); +ix.a.a(); +ix.a.b(); +ix.b.a(); +ix.b.b(); diff --git a/node_modules/browserify/test/require_cache.js b/node_modules/browserify/test/require_cache.js new file mode 100644 index 000000000..871e05500 --- /dev/null +++ b/node_modules/browserify/test/require_cache.js @@ -0,0 +1,19 @@ +var vm = require('vm'); +var browserify = require('../'); +var test = require('tap').test; + +test('cached require results', function (t) { + t.plan(1); + + var b = browserify(); + b.require('seq'); + b.bundle(function (err, src) { + var c = {}; + vm.runInNewContext(src, c); + + var seq0 = c.require('seq'); + var seq1 = c.require('seq'); + + t.ok(seq0 === seq1); + }); +}); diff --git a/node_modules/browserify/test/require_expose.js b/node_modules/browserify/test/require_expose.js new file mode 100644 index 000000000..60f9383f4 --- /dev/null +++ b/node_modules/browserify/test/require_expose.js @@ -0,0 +1,53 @@ +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); + +test('require expose external module', function (t) { + t.plan(2); + + var b = browserify({ basedir: __dirname }); + b.require('beep', { expose: 'bip' }); + b.bundle(function (err, src) { + t.ifError(err); + var c = { }; + vm.runInNewContext(src, c); + t.equal(c.require('bip'), 'boop'); + }) +}); + +test('renaming builtin', function (t) { + t.plan(2); + + var b = browserify({ basedir: __dirname }); + b.require('os', { expose: 'bone' }); + b.bundle(function (err, src) { + t.ifError(err); + var c = { }; + vm.runInNewContext(src, c); + t.equal(c.require('bone').platform(), 'browser'); + }) +}); + +test('exposed modules do not leak across bundles', function (t) { + var bundle1, bundle2; + + bundle1 = browserify(); + bundle1.add(__dirname + '/require_expose/main.js'); + bundle1.require(__dirname + '/require_expose/some_dep.js', { expose: 'foo' }); + + bundle1.bundle(function (err, src) { + if (err) t.fail(err); + + var c = {}; + vm.runInNewContext(src, c); + t.equal(c.foo, 'some_dep'); + + bundle2 = browserify(); + bundle2.add(__dirname + '/require_expose/main.js'); + + bundle2.bundle(function (err) { + t.ok(err && err.message.match(/Cannot find module 'foo'/), 'should fail with missing module'); + t.end(); + }); + }); +}); diff --git a/node_modules/browserify/test/require_expose/main.js b/node_modules/browserify/test/require_expose/main.js new file mode 100644 index 000000000..f99908f64 --- /dev/null +++ b/node_modules/browserify/test/require_expose/main.js @@ -0,0 +1 @@ +foo = require('foo'); diff --git a/node_modules/browserify/test/require_expose/some_dep.js b/node_modules/browserify/test/require_expose/some_dep.js new file mode 100644 index 000000000..353c90dbf --- /dev/null +++ b/node_modules/browserify/test/require_expose/some_dep.js @@ -0,0 +1 @@ +module.exports = 'some_dep'; diff --git a/node_modules/browserify/test/reset.js b/node_modules/browserify/test/reset.js new file mode 100644 index 000000000..dad18b3af --- /dev/null +++ b/node_modules/browserify/test/reset.js @@ -0,0 +1,31 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('reset', function (t) { + t.plan(4); + + var b = browserify(); + b.require('path'); + b.bundle(function (err, src) { + check(err, src); + b.bundle(function (err, src) { + check(err, src); + }); + }); + + function check (err, src) { + t.ifError(err); + var c = { + setTimeout : setTimeout, + clearTimeout : clearTimeout, + console : console + }; + vm.runInNewContext(src, c); + + t.equal( + c.require('path').join('/a', 'b'), + '/a/b' + ); + } +}); diff --git a/node_modules/browserify/test/resolve_exposed.js b/node_modules/browserify/test/resolve_exposed.js new file mode 100644 index 000000000..0d3efc24b --- /dev/null +++ b/node_modules/browserify/test/resolve_exposed.js @@ -0,0 +1,20 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('resolve exposed files', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/resolve_exposed/main.js', { + basedir: __dirname + '/resolve_exposed' + }); + b.require('./x.js', { expose: 'xyz' }); + b.bundle(function (err, src) { + t.ifError(err); + var c = { console: { log: log } }; + vm.runInNewContext(src, c); + function log (x) { + t.equal(x, 333); + } + }); +}); diff --git a/node_modules/browserify/test/resolve_exposed/main.js b/node_modules/browserify/test/resolve_exposed/main.js new file mode 100644 index 000000000..08a137dc7 --- /dev/null +++ b/node_modules/browserify/test/resolve_exposed/main.js @@ -0,0 +1,2 @@ +var xyz = require('xyz'); +console.log(xyz * 111); diff --git a/node_modules/browserify/test/resolve_exposed/x.js b/node_modules/browserify/test/resolve_exposed/x.js new file mode 100644 index 000000000..6887896a4 --- /dev/null +++ b/node_modules/browserify/test/resolve_exposed/x.js @@ -0,0 +1 @@ +module.exports = 3 diff --git a/node_modules/browserify/test/retarget.js b/node_modules/browserify/test/retarget.js new file mode 100644 index 000000000..7670bc098 --- /dev/null +++ b/node_modules/browserify/test/retarget.js @@ -0,0 +1,25 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var path = require('path'); +var vm = require('vm'); + +test('retarget with -r', function (t) { + t.plan(2); + + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + '-r', 'beep' + ], { cwd: __dirname }); + var src = ''; + ps.stdout.on('data', function (buf) { src += buf }); + ps.stderr.pipe(process.stderr); + + ps.on('exit', function (code) { + t.equal(code, 0); + + var c = {}; + vm.runInNewContext(src, c); + t.equal(c.require('beep'), 'boop'); + }); + ps.stdin.end(); +}); diff --git a/node_modules/browserify/test/reverse_multi_bundle.js b/node_modules/browserify/test/reverse_multi_bundle.js new file mode 100644 index 000000000..8d9f8325f --- /dev/null +++ b/node_modules/browserify/test/reverse_multi_bundle.js @@ -0,0 +1,47 @@ +/** + * To be able to lazy load bundles with script loaders the loaded bundles + * must have access to modules exposed by previous bundles. + * + * In effect this is the same as adding the bundles in reverse order + **/ + +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('reverse multi bundle', function (t) { + t.plan(5); + + // Main app bundle has the main app code and the shared libarary code + var app = browserify([__dirname + '/reverse_multi_bundle/app.js']) + .external(__dirname + '/reverse_multi_bundle/lazy.js') + .require(__dirname + '/reverse_multi_bundle/shared.js', { expose: true }) + .require(__dirname + '/reverse_multi_bundle/arbitrary.js', {expose: 'not/real'}); + + // Lazily loaded bundle has only its own code even it uses code from the + // shared library. + var lazy = browserify({ + filter: function (id) { + return id !== 'not/real'; + } + }) + .require(__dirname + '/reverse_multi_bundle/lazy.js', { expose: true }) + .external(__dirname + '/reverse_multi_bundle/shared.js') + .external('not/real'); + + + app.bundle(function (err, appSrc) { + if (err) throw err; + lazy.bundle(function(err, lazySrc) { + if (err) throw err; + + var src = appSrc + ';' + lazySrc; + var c = { + setTimeout: setTimeout, + clearTimeout: clearTimeout, + t: t + }; + vm.runInNewContext(src, c); + }); + }); +}); diff --git a/node_modules/browserify/test/reverse_multi_bundle/app.js b/node_modules/browserify/test/reverse_multi_bundle/app.js new file mode 100644 index 000000000..ab6b10147 --- /dev/null +++ b/node_modules/browserify/test/reverse_multi_bundle/app.js @@ -0,0 +1,22 @@ + +t.equal( + require("./shared")(), 1, + "the main app bundle can already use the shared library" +); + +t.throws(function() { + require("./lazy"); +}, "lazy bundle is not executed yet so the lazy module cannot be required yet"); + +// Use setTimeout as script loader simulator as in real use case this would be +// a call to one. Now we just let the rest of the source code string we build +// to execute. +setTimeout(function() { + // After lazy bundle is executed we can require the lazy.js module + require("./lazy"); + t.equal( + require("./shared")(),3, + "lazy module was able to use shared code" + ); +}, 1); + diff --git a/node_modules/browserify/test/reverse_multi_bundle/arbitrary.js b/node_modules/browserify/test/reverse_multi_bundle/arbitrary.js new file mode 100644 index 000000000..ba7d87215 --- /dev/null +++ b/node_modules/browserify/test/reverse_multi_bundle/arbitrary.js @@ -0,0 +1,6 @@ +var i = 0; +module.exports = function() { + return ++i; +}; + +// 175e62 diff --git a/node_modules/browserify/test/reverse_multi_bundle/lazy.js b/node_modules/browserify/test/reverse_multi_bundle/lazy.js new file mode 100644 index 000000000..012cdeb73 --- /dev/null +++ b/node_modules/browserify/test/reverse_multi_bundle/lazy.js @@ -0,0 +1,9 @@ +t.equal( + require("./shared")(),2, + "lazy.js can use the shared library" +); +t.equal( + require("not/real")(),1, + "lazy.js can use library code with arbitrary names" +); + diff --git a/node_modules/browserify/test/reverse_multi_bundle/shared.js b/node_modules/browserify/test/reverse_multi_bundle/shared.js new file mode 100644 index 000000000..6bb03fbba --- /dev/null +++ b/node_modules/browserify/test/reverse_multi_bundle/shared.js @@ -0,0 +1,6 @@ +var i = 0; +module.exports = function() { + return ++i; +}; + +// 77aa70 diff --git a/node_modules/browserify/test/shared_symlink.js b/node_modules/browserify/test/shared_symlink.js new file mode 100644 index 000000000..f10d57339 --- /dev/null +++ b/node_modules/browserify/test/shared_symlink.js @@ -0,0 +1,16 @@ +// https://github.com/substack/node-browserify/issues/1325 + +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('shared symlink', { skip: process.platform === 'win32' }, function (t) { + t.plan(1); + var b = browserify(__dirname + '/shared_symlink/main.js'); + b.bundle(function (err, src) { + // does the same thing as node: crashes + t.equal(err.message, "Cannot find module 'foo' from '" + + __dirname + "/shared_symlink/shared'" + ); + }); +}); diff --git a/node_modules/browserify/test/shared_symlink/app/index.js b/node_modules/browserify/test/shared_symlink/app/index.js new file mode 100644 index 000000000..489c017f6 --- /dev/null +++ b/node_modules/browserify/test/shared_symlink/app/index.js @@ -0,0 +1 @@ +module.exports = require('shared') + require('foo') diff --git a/node_modules/browserify/test/shared_symlink/app/node_modules/foo/index.js b/node_modules/browserify/test/shared_symlink/app/node_modules/foo/index.js new file mode 100644 index 000000000..7afe02674 --- /dev/null +++ b/node_modules/browserify/test/shared_symlink/app/node_modules/foo/index.js @@ -0,0 +1 @@ +module.exports = 1234 diff --git a/node_modules/browserify/test/shared_symlink/app/node_modules/shared/index.js b/node_modules/browserify/test/shared_symlink/app/node_modules/shared/index.js new file mode 100644 index 000000000..176676407 --- /dev/null +++ b/node_modules/browserify/test/shared_symlink/app/node_modules/shared/index.js @@ -0,0 +1 @@ +module.exports = require('foo') * 2 diff --git a/node_modules/browserify/test/shared_symlink/main.js b/node_modules/browserify/test/shared_symlink/main.js new file mode 100644 index 000000000..a13f52481 --- /dev/null +++ b/node_modules/browserify/test/shared_symlink/main.js @@ -0,0 +1 @@ +console.log(require('./app')) diff --git a/node_modules/browserify/test/shared_symlink/shared/index.js b/node_modules/browserify/test/shared_symlink/shared/index.js new file mode 100644 index 000000000..176676407 --- /dev/null +++ b/node_modules/browserify/test/shared_symlink/shared/index.js @@ -0,0 +1 @@ +module.exports = require('foo') * 2 diff --git a/node_modules/browserify/test/shebang.js b/node_modules/browserify/test/shebang.js new file mode 100644 index 000000000..5965ac949 --- /dev/null +++ b/node_modules/browserify/test/shebang.js @@ -0,0 +1,11 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('files with shebangs', function (t) { + t.plan(1); + var b = browserify(__dirname + '/shebang/main.js'); + b.bundle(function (err, src) { + vm.runInNewContext(src, { t: t }); + }); +}); diff --git a/node_modules/browserify/test/shebang/foo.js b/node_modules/browserify/test/shebang/foo.js new file mode 100644 index 000000000..3ec10cd5e --- /dev/null +++ b/node_modules/browserify/test/shebang/foo.js @@ -0,0 +1,2 @@ +#!/blah +module.exports = 1234; diff --git a/node_modules/browserify/test/shebang/main.js b/node_modules/browserify/test/shebang/main.js new file mode 100644 index 000000000..eb41711b4 --- /dev/null +++ b/node_modules/browserify/test/shebang/main.js @@ -0,0 +1,4 @@ +#!/usr/bin/env node + +var foo = require('./foo'); +t.equal(foo, 1234); diff --git a/node_modules/browserify/test/spread.js b/node_modules/browserify/test/spread.js new file mode 100644 index 000000000..ba4fd3745 --- /dev/null +++ b/node_modules/browserify/test/spread.js @@ -0,0 +1,14 @@ +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); +var hasObjectSpread = require('has-object-spread')(); + +test('yield', { skip: !hasObjectSpread }, function (t) { + t.plan(2); + var b = browserify(__dirname + '/spread/main.js'); + + b.bundle(function (err, src) { + t.error(err); + t.notEqual(src.indexOf('...b'), -1, 'passed through spread syntax') + }); +}); diff --git a/node_modules/browserify/test/spread/main.js b/node_modules/browserify/test/spread/main.js new file mode 100644 index 000000000..c3e1a4008 --- /dev/null +++ b/node_modules/browserify/test/spread/main.js @@ -0,0 +1 @@ +var a = { ...b } diff --git a/node_modules/browserify/test/standalone.js b/node_modules/browserify/test/standalone.js new file mode 100644 index 000000000..16c105a71 --- /dev/null +++ b/node_modules/browserify/test/standalone.js @@ -0,0 +1,85 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('standalone', function (t) { + t.plan(3); + + var b = browserify(__dirname + '/standalone/main.js', { + standalone: 'stand-test' + }); + b.bundle(function (err, src) { + t.test('window global', function (t) { + t.plan(2); + var c = { + window: {}, + done : done(t) + }; + vm.runInNewContext(src + 'window.standTest(done)', c); + }); + t.test('CommonJS', function (t) { + t.plan(2); + var exp = {}; + var c = { + module: { exports: exp }, + exports: exp, + done : done(t) + }; + vm.runInNewContext(src + 'module.exports(done)', c); + }); + t.test('RequireJS', function (t) { + t.plan(2); + var c = { + define: function (dependencies, fn) { + fn()(done(t)); + } + }; + c.define.amd = true; + vm.runInNewContext(src, c); + }); + }); +}); + +test('A.B.C standalone', function (t) { + t.plan(3); + + var b = browserify(__dirname + '/standalone/main.js', { + standalone: 'A.B.C' + }); + b.bundle(function (err, src) { + t.test('window global', function (t) { + t.plan(2); + var c = { window: {} }; + vm.runInNewContext(src, c); + c.window.A.B.C(done(t)); + }); + t.test('CommonJS', function (t) { + t.plan(2); + var exp = {}; + var c = { + module: { exports: exp }, + exports: exp + }; + vm.runInNewContext(src, c); + c.module.exports(done(t)); + }); + t.test('RequireJS', function (t) { + t.plan(2); + var c = { + define: function (dependencies, fn) { + fn()(done(t)); + } + }; + c.define.amd = true; + vm.runInNewContext(src, c); + }); + }); +}); + +function done(t) { + return function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + t.end(); + }; +} diff --git a/node_modules/browserify/test/standalone/main.js b/node_modules/browserify/test/standalone/main.js new file mode 100644 index 000000000..400038d6a --- /dev/null +++ b/node_modules/browserify/test/standalone/main.js @@ -0,0 +1,3 @@ +module.exports = function (cb) { + cb(require('./one'), require('./two')); +}; \ No newline at end of file diff --git a/node_modules/browserify/test/standalone/one.js b/node_modules/browserify/test/standalone/one.js new file mode 100644 index 000000000..bd816eaba --- /dev/null +++ b/node_modules/browserify/test/standalone/one.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/browserify/test/standalone/two.js b/node_modules/browserify/test/standalone/two.js new file mode 100644 index 000000000..4bbffde10 --- /dev/null +++ b/node_modules/browserify/test/standalone/two.js @@ -0,0 +1 @@ +module.exports = 2; diff --git a/node_modules/browserify/test/standalone_events.js b/node_modules/browserify/test/standalone_events.js new file mode 100644 index 000000000..eb42afb4b --- /dev/null +++ b/node_modules/browserify/test/standalone_events.js @@ -0,0 +1,19 @@ +var browserify = require('../'); +var test = require('tap').test; + +test('standalone bundle close event', {timeout: 1000}, function (t) { + t.plan(1); + + var ended = false; + + var b = browserify(__dirname + '/standalone/main.js', { + standalone: 'stand-test' + }); + var r = b.bundle(); + r.resume(); + r.on('end', function() { + t.ok(!ended); + ended = true; + t.end(); + }); +}); diff --git a/node_modules/browserify/test/standalone_sourcemap.js b/node_modules/browserify/test/standalone_sourcemap.js new file mode 100644 index 000000000..a11c4542d --- /dev/null +++ b/node_modules/browserify/test/standalone_sourcemap.js @@ -0,0 +1,55 @@ +var browserify = require('../'); +var fs = require('fs'); +var vm = require('vm'); +var test = require('tap').test; + +test('standalone in debug mode', function (t) { + t.plan(3); + + var main = fs.readFileSync(__dirname + '/standalone/main.js'); + + var b = browserify(__dirname + '/standalone/main.js', { + standalone: 'stand-test', + debug: true + }); + b.bundle(function (err, buf) { + var src = buf.toString('utf8'); + t.test('window global', function (t) { + t.plan(2); + var c = { + window: {}, + done : done(t) + }; + vm.runInNewContext(src + '\nwindow.standTest(done)', c); + }); + t.test('CommonJS', function (t) { + t.plan(2); + var exp = {}; + var c = { + module: { exports: exp }, + exports: exp, + done : done(t) + }; + vm.runInNewContext(src + '\nmodule.exports(done)', c); + }); + t.test('RequireJS', function (t) { + t.plan(2); + var c = { + define: function (dependencies, fn) { + fn()(done(t)); + } + }; + c.define.amd = true; + vm.runInNewContext(src, c); + }); + }); +}); + +function done(t) { + return function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + t.end(); + }; +} + diff --git a/node_modules/browserify/test/stdin.js b/node_modules/browserify/test/stdin.js new file mode 100644 index 000000000..da5415d49 --- /dev/null +++ b/node_modules/browserify/test/stdin.js @@ -0,0 +1,35 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var concat = require('concat-stream'); +var path = require('path'); +var vm = require('vm'); + +test('stdin', function (t) { + t.plan(2); + + var cwd = process.cwd(); + process.chdir(__dirname); + + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + '-' + ]); + + ps.stdout.pipe(concat(function (body) { + var c = { console: { + log: function (msg) { + t.equal(msg, 'hello'); + } + } }; + vm.runInNewContext(body, c); + })); + ps.stderr.pipe(process.stderr); + + ps.on('exit', function (code) { + t.equal(code, 0); + }); + + ps.stdin.write("console.log('hello')"); + ps.stdin.end(); + +}); diff --git a/node_modules/browserify/test/stream.js b/node_modules/browserify/test/stream.js new file mode 100644 index 000000000..a15a5ee91 --- /dev/null +++ b/node_modules/browserify/test/stream.js @@ -0,0 +1,15 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var fs = require('fs'); + +test('stream', function (t) { + t.plan(2); + + var stream = fs.createReadStream(__dirname + '/stream/main.js'); + var b = browserify(stream, { basedir: __dirname + '/stream' }); + + b.bundle(function (err, src) { + vm.runInNewContext(src, { t: t }); + }); +}); diff --git a/node_modules/browserify/test/stream/bar.js b/node_modules/browserify/test/stream/bar.js new file mode 100644 index 000000000..5828b13ee --- /dev/null +++ b/node_modules/browserify/test/stream/bar.js @@ -0,0 +1 @@ +module.exports = require('./foo.js') * 4 / 3 diff --git a/node_modules/browserify/test/stream/foo.js b/node_modules/browserify/test/stream/foo.js new file mode 100644 index 000000000..91238822e --- /dev/null +++ b/node_modules/browserify/test/stream/foo.js @@ -0,0 +1 @@ +module.exports = 333 diff --git a/node_modules/browserify/test/stream/main.js b/node_modules/browserify/test/stream/main.js new file mode 100644 index 000000000..33063b271 --- /dev/null +++ b/node_modules/browserify/test/stream/main.js @@ -0,0 +1,2 @@ +t.equal(require('./foo.js'), 333); +t.equal(require('./bar.js'), 444); diff --git a/node_modules/browserify/test/stream_file.js b/node_modules/browserify/test/stream_file.js new file mode 100644 index 000000000..100471ce8 --- /dev/null +++ b/node_modules/browserify/test/stream_file.js @@ -0,0 +1,29 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var fs = require('fs'); +var through = require('through2'); +var path = require('path'); + +test('stream file', function (t) { + var expected = {}; + expected[ path.join(__dirname, 'stream/fake.js') ] = true; + expected[ path.join(__dirname, 'stream/bar.js' ) ] = true; + expected[ path.join(__dirname, 'stream/foo.js' ) ] = true; + + t.plan(5); + + var stream = fs.createReadStream(__dirname + '/stream/main.js'); + stream.file = path.join(__dirname, '/stream/fake.js'); + + var b = browserify(stream, { basedir: __dirname + '/stream' }); + b.transform(function (file) { + t.ok(expected[file]); + delete expected[file]; + return through(); + }); + + b.bundle(function (err, src) { + vm.runInNewContext(src, { t: t }); + }); +}); diff --git a/node_modules/browserify/test/subdep.js b/node_modules/browserify/test/subdep.js new file mode 100644 index 000000000..fd58d6ec7 --- /dev/null +++ b/node_modules/browserify/test/subdep.js @@ -0,0 +1,16 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('subdep', function (t) { + t.plan(1); + + var b = browserify(); + b.require(__dirname + '/subdep/index.js', { expose: 'subdep' }); + + b.bundle(function (err, src) { + var c = {}; + vm.runInNewContext(src, c); + t.equal(c.require('subdep'), 'zzz'); + }); +}); diff --git a/node_modules/browserify/test/subdep/index.js b/node_modules/browserify/test/subdep/index.js new file mode 100644 index 000000000..f05301b7f --- /dev/null +++ b/node_modules/browserify/test/subdep/index.js @@ -0,0 +1 @@ +module.exports = require('qq'); diff --git a/node_modules/browserify/test/subdep/node_modules/qq/b.js b/node_modules/browserify/test/subdep/node_modules/qq/b.js new file mode 100644 index 000000000..015ad7e1f --- /dev/null +++ b/node_modules/browserify/test/subdep/node_modules/qq/b.js @@ -0,0 +1 @@ +module.exports = require('a'); diff --git a/node_modules/browserify/test/subdep/node_modules/qq/ignore_me.js b/node_modules/browserify/test/subdep/node_modules/qq/ignore_me.js new file mode 100644 index 000000000..498930331 --- /dev/null +++ b/node_modules/browserify/test/subdep/node_modules/qq/ignore_me.js @@ -0,0 +1 @@ +module.exports = 'IGNORE ME'; diff --git a/node_modules/browserify/test/subdep/node_modules/qq/node_modules/a/index.js b/node_modules/browserify/test/subdep/node_modules/qq/node_modules/a/index.js new file mode 100644 index 000000000..aecaca26f --- /dev/null +++ b/node_modules/browserify/test/subdep/node_modules/qq/node_modules/a/index.js @@ -0,0 +1 @@ +module.exports = require('z'); diff --git a/node_modules/browserify/test/subdep/node_modules/qq/node_modules/a/package.json b/node_modules/browserify/test/subdep/node_modules/qq/node_modules/a/package.json new file mode 100644 index 000000000..ea2ec7205 --- /dev/null +++ b/node_modules/browserify/test/subdep/node_modules/qq/node_modules/a/package.json @@ -0,0 +1,5 @@ +{ + "dependencies" : { + "z" : "*" + } +} diff --git a/node_modules/browserify/test/subdep/node_modules/qq/node_modules/c/index.js b/node_modules/browserify/test/subdep/node_modules/qq/node_modules/c/index.js new file mode 100644 index 000000000..b192ca258 --- /dev/null +++ b/node_modules/browserify/test/subdep/node_modules/qq/node_modules/c/index.js @@ -0,0 +1 @@ +module.exports = 'ccc'; diff --git a/node_modules/browserify/test/subdep/node_modules/qq/node_modules/c/package.json b/node_modules/browserify/test/subdep/node_modules/qq/node_modules/c/package.json new file mode 100644 index 000000000..0d0cfd59d --- /dev/null +++ b/node_modules/browserify/test/subdep/node_modules/qq/node_modules/c/package.json @@ -0,0 +1,5 @@ +{ + "dependencies" : { + "f" : "*" + } +} diff --git a/node_modules/browserify/test/subdep/node_modules/qq/node_modules/f/index.js b/node_modules/browserify/test/subdep/node_modules/qq/node_modules/f/index.js new file mode 100644 index 000000000..b5cf2e10b --- /dev/null +++ b/node_modules/browserify/test/subdep/node_modules/qq/node_modules/f/index.js @@ -0,0 +1 @@ +module.exports = 'fff'; diff --git a/node_modules/browserify/test/subdep/node_modules/qq/node_modules/z/index.js b/node_modules/browserify/test/subdep/node_modules/qq/node_modules/z/index.js new file mode 100644 index 000000000..c27268eb5 --- /dev/null +++ b/node_modules/browserify/test/subdep/node_modules/qq/node_modules/z/index.js @@ -0,0 +1 @@ +module.exports = 'zzz'; diff --git a/node_modules/browserify/test/subdep/node_modules/qq/package.json b/node_modules/browserify/test/subdep/node_modules/qq/package.json new file mode 100644 index 000000000..d693ab598 --- /dev/null +++ b/node_modules/browserify/test/subdep/node_modules/qq/package.json @@ -0,0 +1,3 @@ +{ + "main" : "./b.js" +} diff --git a/node_modules/browserify/test/subdep/package.json b/node_modules/browserify/test/subdep/package.json new file mode 100644 index 000000000..518d22aa9 --- /dev/null +++ b/node_modules/browserify/test/subdep/package.json @@ -0,0 +1,6 @@ +{ + "dependencies" : { + "qq" : "*" + }, + "main" : "index.js" +} diff --git a/node_modules/browserify/test/symlink_dedupe.js b/node_modules/browserify/test/symlink_dedupe.js new file mode 100644 index 000000000..dbc7afe63 --- /dev/null +++ b/node_modules/browserify/test/symlink_dedupe.js @@ -0,0 +1,16 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('hash instances with hashed contexts', { skip: process.platform === 'win32' }, function (t) { + t.plan(5); + + var b = browserify(__dirname + '/symlink_dedupe/main.js'); + b.bundle(function (err, buf) { + var c = { t: t }; + var src = buf.toString('utf8'); + t.equal(src.match(RegExp('// FILE F ONE', 'g')).length, 1); + t.equal(src.match(RegExp('// FILE G ONE', 'g')).length, 1); + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/symlink_dedupe/main.js b/node_modules/browserify/test/symlink_dedupe/main.js new file mode 100644 index 000000000..92ff18df1 --- /dev/null +++ b/node_modules/browserify/test/symlink_dedupe/main.js @@ -0,0 +1,6 @@ +var A = require('./one/f.js'); +var B = require('./one/dir/f.js'); +t.equal(A, B); +t.equal(A(), 555); +t.equal(B(), 555); + diff --git a/node_modules/browserify/test/symlink_dedupe/one/f.js b/node_modules/browserify/test/symlink_dedupe/one/f.js new file mode 100644 index 000000000..a315c1e7d --- /dev/null +++ b/node_modules/browserify/test/symlink_dedupe/one/f.js @@ -0,0 +1,3 @@ +// FILE F ONE +var G = require('./g.js'); +module.exports = function () { return 111 * G }; diff --git a/node_modules/browserify/test/symlink_dedupe/one/g.js b/node_modules/browserify/test/symlink_dedupe/one/g.js new file mode 100644 index 000000000..837303206 --- /dev/null +++ b/node_modules/browserify/test/symlink_dedupe/one/g.js @@ -0,0 +1,2 @@ +// FILE G ONE +module.exports = 5 diff --git a/node_modules/browserify/test/syntax_cache.js b/node_modules/browserify/test/syntax_cache.js new file mode 100644 index 000000000..ff2a5deec --- /dev/null +++ b/node_modules/browserify/test/syntax_cache.js @@ -0,0 +1,47 @@ +var Seq = require('seq'); +var browserify = require('../'); +var test = require('tap').test; +var shasum = require('shasum'); + +test('syntax cache - valid', function (t) { + t.plan(2); + + var expectedCache = {} + var cacheKey; + + var b = browserify(__dirname + '/syntax_cache/valid.js'); + b.once('dep', function(row) { + cacheKey = shasum(row.source); + expectedCache[cacheKey] = true; + }); + + Seq() + .seq(function() { b.bundle(this); }) + .seq(function() { + t.deepEqual(b._syntaxCache, expectedCache); + b._syntaxCache[cacheKey] = expectedCache[cacheKey] = 'beep'; + b.bundle(function(err, src) { + // if the cache worked, the "cacheKey" + // should not be reset to "true" + t.deepEqual(b._syntaxCache, expectedCache); + }); + }); +}); + +test('syntax cache - skip invalid', function (t) { + t.plan(5); + + var b = browserify(__dirname + '/syntax_cache/invalid.js'); + + Seq() + .seq(function() { b.bundle(this); }) + .catch(function(lastErr) { + t.deepEqual(b._syntaxCache, {}); + t.similar(String(lastErr), /ParseError/); + b.bundle(function(err, src) { + t.deepEqual(b._syntaxCache, {}); + t.similar(String(err), /ParseError/); + t.notEqual(lastErr, err, 'errors should be unique'); + }); + }); +}); diff --git a/node_modules/browserify/test/syntax_cache/invalid.js b/node_modules/browserify/test/syntax_cache/invalid.js new file mode 100644 index 000000000..e85c07cca --- /dev/null +++ b/node_modules/browserify/test/syntax_cache/invalid.js @@ -0,0 +1,2 @@ +var x = { +var y = 6; diff --git a/node_modules/browserify/test/syntax_cache/valid.js b/node_modules/browserify/test/syntax_cache/valid.js new file mode 100644 index 000000000..cf4f426f5 --- /dev/null +++ b/node_modules/browserify/test/syntax_cache/valid.js @@ -0,0 +1,2 @@ +var x = {}; +var y = 6; diff --git a/node_modules/browserify/test/tr.js b/node_modules/browserify/test/tr.js new file mode 100644 index 000000000..69c72488f --- /dev/null +++ b/node_modules/browserify/test/tr.js @@ -0,0 +1,28 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var through = require('through2'); + +test('function transform', function (t) { + t.plan(7); + + var b = browserify(__dirname + '/tr/main.js'); + b.transform({ global: true }, function (file) { + return through(function (buf, enc, next) { + this.push(String(buf).replace(/ZZZ/g, '1')); + next(); + }); + }); + b.transform(function (file) { + return through(function (buf, enc, next) { + this.push(String(buf) + .replace(/AAA/g, '5') + .replace(/BBB/g, '50') + ); + next(); + }) + }); + b.bundle(function (err, src) { + vm.runInNewContext(src, { t: t }); + }); +}); diff --git a/node_modules/browserify/test/tr/f.js b/node_modules/browserify/test/tr/f.js new file mode 100644 index 000000000..a56a0975c --- /dev/null +++ b/node_modules/browserify/test/tr/f.js @@ -0,0 +1,2 @@ +t.equal(XYZ, 909); +module.exports = function (x) { return x + BBB } diff --git a/node_modules/browserify/test/tr/main.js b/node_modules/browserify/test/tr/main.js new file mode 100644 index 000000000..8503c470f --- /dev/null +++ b/node_modules/browserify/test/tr/main.js @@ -0,0 +1,9 @@ +var f = require('./f.js'); +var m = require('m'); +var g = require('g'); +t.equal(require('./subdir/g.js'), 999); + +t.equal(m(f(AAA)), 555, 'transformation scope'); +t.equal(g(3), 332, 'sub-transformation applied'); +t.equal(typeof GGG, 'undefined', 'GGG leak'); +t.equal(XYZ, 909); diff --git a/node_modules/browserify/test/tr/node_modules/g/index.js b/node_modules/browserify/test/tr/node_modules/g/index.js new file mode 100644 index 000000000..84ad716aa --- /dev/null +++ b/node_modules/browserify/test/tr/node_modules/g/index.js @@ -0,0 +1,2 @@ +t.equal(typeof XYZ, 'undefined'); +module.exports = function (x) { return x * GGG - ZZZ } diff --git a/node_modules/browserify/test/tr/node_modules/g/node_modules/insert-ggg/index.js b/node_modules/browserify/test/tr/node_modules/g/node_modules/insert-ggg/index.js new file mode 100644 index 000000000..d0e4862f6 --- /dev/null +++ b/node_modules/browserify/test/tr/node_modules/g/node_modules/insert-ggg/index.js @@ -0,0 +1,7 @@ +var through = require('through'); + +module.exports = function (file) { + return through(function (buf) { + this.queue(String(buf).replace(/GGG/g, '111')); + }); +}; diff --git a/node_modules/browserify/test/tr/node_modules/g/package.json b/node_modules/browserify/test/tr/node_modules/g/package.json new file mode 100644 index 000000000..3a16bd458 --- /dev/null +++ b/node_modules/browserify/test/tr/node_modules/g/package.json @@ -0,0 +1,6 @@ +{ + "main": "index.js", + "browserify": { + "transform": "insert-ggg" + } +} diff --git a/node_modules/browserify/test/tr/node_modules/insert-aaa/index.js b/node_modules/browserify/test/tr/node_modules/insert-aaa/index.js new file mode 100644 index 000000000..0394d4e8b --- /dev/null +++ b/node_modules/browserify/test/tr/node_modules/insert-aaa/index.js @@ -0,0 +1,7 @@ +var through = require('through'); + +module.exports = function (file) { + return through(function (buf) { + this.queue(String(buf).replace(/AAA/g, '5')); + }); +}; diff --git a/node_modules/browserify/test/tr/node_modules/insert-bbb/index.js b/node_modules/browserify/test/tr/node_modules/insert-bbb/index.js new file mode 100644 index 000000000..d48906a82 --- /dev/null +++ b/node_modules/browserify/test/tr/node_modules/insert-bbb/index.js @@ -0,0 +1,7 @@ +var through = require('through'); + +module.exports = function (file) { + return through(function (buf) { + this.queue(String(buf).replace(/BBB/g, '50')); + }); +}; diff --git a/node_modules/browserify/test/tr/node_modules/m/index.js b/node_modules/browserify/test/tr/node_modules/m/index.js new file mode 100644 index 000000000..4cd0ff36e --- /dev/null +++ b/node_modules/browserify/test/tr/node_modules/m/index.js @@ -0,0 +1,3 @@ +var AAA = 200, BBB = 300; + +module.exports = function (x) { return AAA + BBB + x } diff --git a/node_modules/browserify/test/tr/node_modules/xyz/index.js b/node_modules/browserify/test/tr/node_modules/xyz/index.js new file mode 100644 index 000000000..8c5ccabaa --- /dev/null +++ b/node_modules/browserify/test/tr/node_modules/xyz/index.js @@ -0,0 +1,7 @@ +var through = require('through'); + +module.exports = function (file) { + return through(function (buf) { + this.queue(String(buf).replace(/XYZ/g, '909')); + }); +}; diff --git a/node_modules/browserify/test/tr/package.json b/node_modules/browserify/test/tr/package.json new file mode 100644 index 000000000..6687fa119 --- /dev/null +++ b/node_modules/browserify/test/tr/package.json @@ -0,0 +1,5 @@ +{ + "browserify": { + "transform": [ "xyz" ] + } +} diff --git a/node_modules/browserify/test/tr/subdir/g.js b/node_modules/browserify/test/tr/subdir/g.js new file mode 100644 index 000000000..047280d04 --- /dev/null +++ b/node_modules/browserify/test/tr/subdir/g.js @@ -0,0 +1 @@ +module.exports = XYZ + 90; diff --git a/node_modules/browserify/test/tr_args.js b/node_modules/browserify/test/tr_args.js new file mode 100644 index 000000000..ace453043 --- /dev/null +++ b/node_modules/browserify/test/tr_args.js @@ -0,0 +1,24 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var path = require('path'); +var concat = require('concat-stream'); +var vm = require('vm'); + +test('transform arguments', function (t) { + t.plan(2); + + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + __dirname + '/tr_args/main.js', + '-t', '[', __dirname + '/tr_args/tr.js', '-x', '1', ']' + ]); + + ps.stderr.pipe(process.stderr); + ps.stdout.pipe(concat(function (body) { + vm.runInNewContext(body.toString('utf8'), { t: t }); + })); + + ps.on('exit', function (code) { + t.equal(code, 0); + }); +}); diff --git a/node_modules/browserify/test/tr_args/main.js b/node_modules/browserify/test/tr_args/main.js new file mode 100644 index 000000000..ec448ae83 --- /dev/null +++ b/node_modules/browserify/test/tr_args/main.js @@ -0,0 +1 @@ +t.equal(XXX * 5, 555); diff --git a/node_modules/browserify/test/tr_args/tr.js b/node_modules/browserify/test/tr_args/tr.js new file mode 100644 index 000000000..6d0a1a875 --- /dev/null +++ b/node_modules/browserify/test/tr_args/tr.js @@ -0,0 +1,12 @@ +var through = require('through2'); + +module.exports = function (file, opts) { + var data = ''; + return through(write, end); + + function write (buf, enc, next) { data += buf; next() } + function end () { + this.push(data.replace(/X/g, opts.x)); + this.push(null); + } +}; diff --git a/node_modules/browserify/test/tr_error.js b/node_modules/browserify/test/tr_error.js new file mode 100644 index 000000000..e7d857c09 --- /dev/null +++ b/node_modules/browserify/test/tr_error.js @@ -0,0 +1,33 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var through = require('through2'); + +test('transform errors errback', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/tr/main.js'); + b.transform(function (file) { + return through(function (buf) { + this.emit('error', new Error('blah')); + }) + }); + b.bundle(function (err, src) { + t.ok(/^blah/.test(err.message)); + t.equal(src, undefined); + }); +}); + +test('transform errors propagate', function (t) { + t.plan(1); + + var b = browserify(__dirname + '/tr/main.js'); + b.transform(function (file) { + return through(function (buf) { + this.emit('error', new Error('blah')); + }); + }); + b.bundle().on('error', function (err) { + t.ok(/^blah/.test(err.message)); + }); +}); diff --git a/node_modules/browserify/test/tr_flags.js b/node_modules/browserify/test/tr_flags.js new file mode 100644 index 000000000..b6bff9201 --- /dev/null +++ b/node_modules/browserify/test/tr_flags.js @@ -0,0 +1,36 @@ +var through = require('through2'); +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); + +test('--debug passed to transforms', function (t) { + var empty = require.resolve('../lib/_empty'); + + t.plan(3); + + [true, false].forEach(function(debug) { + var b = browserify(empty, { debug: debug }); + + b.transform(function(file, opts) { + t.equal(opts._flags.debug, debug, 'debug: ' + debug); + return through(); + }); + + b.bundle(function (err, src) { + if (err) return t.fail(err.message); + }); + }); + + var b = browserify(empty, { debug: true }); + + b.transform({ + _flags: Infinity + }, function(file, opts) { + t.equal(opts._flags, Infinity, 'transform arguents are preserved'); + return through(); + }); + + b.bundle(function(err, src) { + if (err) return t.fail(err.message); + }); +}); diff --git a/node_modules/browserify/test/tr_global.js b/node_modules/browserify/test/tr_global.js new file mode 100644 index 000000000..941eaf4f3 --- /dev/null +++ b/node_modules/browserify/test/tr_global.js @@ -0,0 +1,17 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var through = require('through2'); + +test('global transform precedence', function (t) { + t.plan(1); + + var b = browserify(__dirname + '/tr_global/main.js', { + basedir: __dirname + '/tr_global' + }); + b.transform('tr', { global: true }); + b.bundle(function (err, src) { + vm.runInNewContext(src, { console: { log: log } }); + function log (msg) { t.equal(msg, 444) } + }); +}); diff --git a/node_modules/browserify/test/tr_global/main.js b/node_modules/browserify/test/tr_global/main.js new file mode 100644 index 000000000..208d369bf --- /dev/null +++ b/node_modules/browserify/test/tr_global/main.js @@ -0,0 +1 @@ +console.log(require('x')); diff --git a/node_modules/browserify/test/tr_global/node_modules/tr/index.js b/node_modules/browserify/test/tr_global/node_modules/tr/index.js new file mode 100644 index 000000000..b11f32dcb --- /dev/null +++ b/node_modules/browserify/test/tr_global/node_modules/tr/index.js @@ -0,0 +1,8 @@ +var through = require('through2'); + +module.exports = function () { + return through(function (buf, enc, next) { + this.push(buf.toString('utf8').replace(/VAR/, 4)); + next(); + }); +}; diff --git a/node_modules/browserify/test/tr_global/node_modules/x/index.js b/node_modules/browserify/test/tr_global/node_modules/x/index.js new file mode 100644 index 000000000..1e8d9e3c0 --- /dev/null +++ b/node_modules/browserify/test/tr_global/node_modules/x/index.js @@ -0,0 +1 @@ +module.exports = 111 * VAR diff --git a/node_modules/browserify/test/tr_global/node_modules/x/node_modules/tr/index.js b/node_modules/browserify/test/tr_global/node_modules/x/node_modules/tr/index.js new file mode 100644 index 000000000..597e4f81a --- /dev/null +++ b/node_modules/browserify/test/tr_global/node_modules/x/node_modules/tr/index.js @@ -0,0 +1,8 @@ +var through = require('through2'); + +module.exports = function () { + return through(function (buf, enc, next) { + this.push(buf.toString('utf8').replace(/VAR/, 5)); + next(); + }); +}; diff --git a/node_modules/browserify/test/tr_no_entry.js b/node_modules/browserify/test/tr_no_entry.js new file mode 100644 index 000000000..f41d9ceb5 --- /dev/null +++ b/node_modules/browserify/test/tr_no_entry.js @@ -0,0 +1,20 @@ +var browserify = require('../'); +var test = require('tap').test; +var path = require('path') + +test('transform with no entry files', function (t) { + process.chdir(__dirname); + + t.plan(2); + var b = browserify(); + b.transform('tr'); + b.require(path.join(__dirname, 'tr_no_entry/main.js'), { + expose: 'yoyo' + }); + b.bundle(function (err, body) { + t.ifError(err); + var src = body.toString('utf8') + 'require("yoyo")'; + var con = { log: function (msg) { t.equal(msg, 'ZZZ') } }; + Function('console', src)(con); + }); +}); diff --git a/node_modules/browserify/test/tr_no_entry/main.js b/node_modules/browserify/test/tr_no_entry/main.js new file mode 100644 index 000000000..3dce90898 --- /dev/null +++ b/node_modules/browserify/test/tr_no_entry/main.js @@ -0,0 +1 @@ +console.log('XXX'); diff --git a/node_modules/browserify/test/tr_once.js b/node_modules/browserify/test/tr_once.js new file mode 100644 index 000000000..a892189e2 --- /dev/null +++ b/node_modules/browserify/test/tr_once.js @@ -0,0 +1,21 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var through = require('through2'); +var path = require('path'); + +test('transform exactly once', function (t) { + t.plan(3); + + var b = browserify(__dirname + '/tr_once/main.js', { + transform: function (file) { + t.equal(file, path.join(__dirname, 'tr_once/main.js') ); + return through(); + } + }); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { console: { log: log } }); + function log (msg) { t.equal(msg, 'wow') } + }); +}); diff --git a/node_modules/browserify/test/tr_once/main.js b/node_modules/browserify/test/tr_once/main.js new file mode 100644 index 000000000..6036bec63 --- /dev/null +++ b/node_modules/browserify/test/tr_once/main.js @@ -0,0 +1 @@ +console.log('wow'); diff --git a/node_modules/browserify/test/tr_order.js b/node_modules/browserify/test/tr_order.js new file mode 100644 index 000000000..020b86e32 --- /dev/null +++ b/node_modules/browserify/test/tr_order.js @@ -0,0 +1,23 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var through = require('through2'); + +test('function transform', function (t) { + debugger; + t.plan(8); + + var b = browserify(__dirname + '/tr/main.js'); + b.transform({ global: true }, function (file) { + return through(function (buf, enc, next) { + this.push(String(buf).replace(/ZZZ/g, '1')); + next(); + }); + }); + b.transform(__dirname + '/tr_order/replace_aaa'); + b.transform(__dirname + '/tr_order/replace_bbb.js'); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { t: t }); + }); +}); diff --git a/node_modules/browserify/test/tr_order/replace_aaa.js b/node_modules/browserify/test/tr_order/replace_aaa.js new file mode 100644 index 000000000..f1af976c0 --- /dev/null +++ b/node_modules/browserify/test/tr_order/replace_aaa.js @@ -0,0 +1,10 @@ +var through = require('through2'); + +module.exports = function(file) { + return through(function (buf, enc, next) { + this.push(String(buf) + .replace(/AAA/g, '5') + ); + next(); + }) +} diff --git a/node_modules/browserify/test/tr_order/replace_bbb.js b/node_modules/browserify/test/tr_order/replace_bbb.js new file mode 100644 index 000000000..cf57725cd --- /dev/null +++ b/node_modules/browserify/test/tr_order/replace_bbb.js @@ -0,0 +1,11 @@ +var through = require('through2'); + +module.exports = function(file) { + return through(function (buf, enc, next) { + this.push(String(buf) + .replace(/AAA/g, '6') + .replace(/BBB/g, '50') + ); + next(); + }) +} diff --git a/node_modules/browserify/test/tr_symlink.js b/node_modules/browserify/test/tr_symlink.js new file mode 100644 index 000000000..9fcca56de --- /dev/null +++ b/node_modules/browserify/test/tr_symlink.js @@ -0,0 +1,27 @@ +// based on this scenario: +// https://github.com/substack/node-browserify/pull/831#issuecomment-49546902 + +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var through = require('through2'); + +test('transform symlink', { skip: process.platform === 'win32' }, function (t) { + t.plan(4); + var expected = [ 9, 555, 777 ]; + var b = browserify(__dirname + '/tr_symlink/app/main.js', { + basedir: __dirname + '/tr_symlink/app' + }); + b.transform(function (file) { + return through(function (buf, enc, next) { + this.push(String(buf).replace(/7/g, 9)); + next(); + }) + }); + b.bundle(function (err, src) { + t.ifError(err); + var c = { console: { log: log } }; + vm.runInNewContext(src, c); + function log (msg) { t.equal(msg, expected.shift()) } + }); +}); diff --git a/node_modules/browserify/test/tr_symlink/a-module/index.js b/node_modules/browserify/test/tr_symlink/a-module/index.js new file mode 100644 index 000000000..3e842e734 --- /dev/null +++ b/node_modules/browserify/test/tr_symlink/a-module/index.js @@ -0,0 +1 @@ +module.exports = 555 diff --git a/node_modules/browserify/test/tr_symlink/app/main.js b/node_modules/browserify/test/tr_symlink/app/main.js new file mode 100644 index 000000000..da0ac769b --- /dev/null +++ b/node_modules/browserify/test/tr_symlink/app/main.js @@ -0,0 +1,6 @@ +var a = require('aaa'); +var b = require('bbb'); + +console.log(5); +console.log(a); +console.log(b); diff --git a/node_modules/browserify/test/tr_symlink/app/node_modules/aaa/index.js b/node_modules/browserify/test/tr_symlink/app/node_modules/aaa/index.js new file mode 100644 index 000000000..3e842e734 --- /dev/null +++ b/node_modules/browserify/test/tr_symlink/app/node_modules/aaa/index.js @@ -0,0 +1 @@ +module.exports = 555 diff --git a/node_modules/browserify/test/tr_symlink/app/node_modules/bbb/ext.js b/node_modules/browserify/test/tr_symlink/app/node_modules/bbb/ext.js new file mode 100644 index 000000000..2fad98701 --- /dev/null +++ b/node_modules/browserify/test/tr_symlink/app/node_modules/bbb/ext.js @@ -0,0 +1 @@ +module.exports = 777; diff --git a/node_modules/browserify/test/tr_symlink/app/node_modules/bbb/index.js b/node_modules/browserify/test/tr_symlink/app/node_modules/bbb/index.js new file mode 100644 index 000000000..dae6275e7 --- /dev/null +++ b/node_modules/browserify/test/tr_symlink/app/node_modules/bbb/index.js @@ -0,0 +1,2 @@ +var ext = require('./ext'); +module.exports = ext; diff --git a/node_modules/browserify/test/tr_symlink/app/node_modules/tr/index.js b/node_modules/browserify/test/tr_symlink/app/node_modules/tr/index.js new file mode 100644 index 000000000..f9d056885 --- /dev/null +++ b/node_modules/browserify/test/tr_symlink/app/node_modules/tr/index.js @@ -0,0 +1,14 @@ +var through = require('through2'); + +module.exports = function () { + var bufs = []; + return through(write, end); + function write (buf, enc, next) { + bufs.push(buf); + next(); + } + function end () { + this.push(Buffer.concat(bufs).toString().replace(/5/g, 9)); + this.push(null); + } +}; diff --git a/node_modules/browserify/test/tr_symlink/app/package.json b/node_modules/browserify/test/tr_symlink/app/package.json new file mode 100644 index 000000000..2f2bbfff8 --- /dev/null +++ b/node_modules/browserify/test/tr_symlink/app/package.json @@ -0,0 +1,5 @@ +{ + "browserify": { + "transform": [ "tr" ] + } +} diff --git a/node_modules/browserify/test/tr_symlink/b-module/ext.js b/node_modules/browserify/test/tr_symlink/b-module/ext.js new file mode 100644 index 000000000..2fad98701 --- /dev/null +++ b/node_modules/browserify/test/tr_symlink/b-module/ext.js @@ -0,0 +1 @@ +module.exports = 777; diff --git a/node_modules/browserify/test/tr_symlink/b-module/index.js b/node_modules/browserify/test/tr_symlink/b-module/index.js new file mode 100644 index 000000000..dae6275e7 --- /dev/null +++ b/node_modules/browserify/test/tr_symlink/b-module/index.js @@ -0,0 +1,2 @@ +var ext = require('./ext'); +module.exports = ext; diff --git a/node_modules/browserify/test/unicode.js b/node_modules/browserify/test/unicode.js new file mode 100644 index 000000000..2b68515ec --- /dev/null +++ b/node_modules/browserify/test/unicode.js @@ -0,0 +1,19 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('unicode entry', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/unicode/main.js'); + b.bundle(function (err, src) { + var c = { + done : function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + t.end(); + } + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/unicode/main.js b/node_modules/browserify/test/unicode/main.js new file mode 100644 index 000000000..89bb8a036 --- /dev/null +++ b/node_modules/browserify/test/unicode/main.js @@ -0,0 +1 @@ +done(require('./one'), require('./two')); \ No newline at end of file diff --git a/node_modules/browserify/test/unicode/one.js b/node_modules/browserify/test/unicode/one.js new file mode 100644 index 000000000..bd816eaba --- /dev/null +++ b/node_modules/browserify/test/unicode/one.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/browserify/test/unicode/two.js b/node_modules/browserify/test/unicode/two.js new file mode 100644 index 000000000..4bbffde10 --- /dev/null +++ b/node_modules/browserify/test/unicode/two.js @@ -0,0 +1 @@ +module.exports = 2; diff --git a/node_modules/browserify/test/util.js b/node_modules/browserify/test/util.js new file mode 100644 index 000000000..760acf1e3 --- /dev/null +++ b/node_modules/browserify/test/util.js @@ -0,0 +1,62 @@ +var browserify = require('../'); +var test = require('tap').test; +var util = require('util'); +var vm = require('vm'); + +test('util.inspect', function (t) { + t.plan(1); + + var b = browserify(); + b.require('util'); + b.bundle(function (err ,src) { + var c = {}; + vm.runInNewContext(src, c); + t.equal( + c.require('util').inspect([1,2,3]), + util.inspect([1,2,3]) + ); + }); +}); + +test('util.inherits', function (t) { + t.plan(2); + + var b = browserify(); + b.require('util'); + b.require('events'); + + b.bundle(function (err, src) { + var c = {}; + vm.runInNewContext(src, c); + var EE = c.require('events').EventEmitter; + + function Beep () {} + c.require('util').inherits(Beep, EE); + var beep = new Beep; + + t.ok(beep instanceof Beep); + t.ok(beep instanceof EE); + }); +}); + +test('util.inherits without Object.create', function (t) { + t.plan(2); + var b = browserify(); + b.require('util'); + b.require('events'); + + b.bundle(function (err, src) { + var c = { Object : { prototype: Object.prototype } }; + vm.runInNewContext(src, c); + var EE = c.require('events').EventEmitter; + + function Beep () {} + Beep.prototype = {}; + + c.require('util').inherits(Beep, EE); + var beep = new Beep; + + t.ok(beep instanceof Beep); + t.ok(beep instanceof EE); + }); +}); diff --git a/node_modules/browserify/test/yield.js b/node_modules/browserify/test/yield.js new file mode 100644 index 000000000..164a5aaf7 --- /dev/null +++ b/node_modules/browserify/test/yield.js @@ -0,0 +1,20 @@ +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); +var generatorFunction = require('make-generator-function'); + +test('yield', { skip: !generatorFunction }, function (t) { + t.plan(6); + var b = browserify(__dirname + '/yield/main.js'); + + b.bundle(function (err, src) { + t.error(err); + var c = { console: { log: log } }; + var index = 0; + vm.runInNewContext(src, c); + + function log (msg) { + t.equal(index++, msg); + } + }); +}); diff --git a/node_modules/browserify/test/yield/f.js b/node_modules/browserify/test/yield/f.js new file mode 100644 index 000000000..8bb123b8d --- /dev/null +++ b/node_modules/browserify/test/yield/f.js @@ -0,0 +1,5 @@ +module.exports = function *() { + for (var i = 0; i < 5; i++) { + yield i; + } +} diff --git a/node_modules/browserify/test/yield/main.js b/node_modules/browserify/test/yield/main.js new file mode 100644 index 000000000..5a2e6bbb7 --- /dev/null +++ b/node_modules/browserify/test/yield/main.js @@ -0,0 +1,4 @@ +var f = require('./f.js')(); +for (var r = f.next(); !r.done; r = f.next()) { + console.log(r.value); +} diff --git a/node_modules/budo/.travis.yml b/node_modules/budo/.travis.yml new file mode 100644 index 000000000..7067e1aed --- /dev/null +++ b/node_modules/budo/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - "5.0" + - "6.0" + - "7.0" + - "8.0" +before_install: + - npm install -g npm@~2.14.5 diff --git a/node_modules/budo/CHANGELOG.md b/node_modules/budo/CHANGELOG.md new file mode 100644 index 000000000..9da6fedb8 --- /dev/null +++ b/node_modules/budo/CHANGELOG.md @@ -0,0 +1,244 @@ +# 11.x + +#### Breaking Changes + +- Upgraded to `browserify@15`, set supported node version to `>= 4` + +# 10.x + +:tada: + +#### Breaking Changes + +- Upgraded to `browserify@14` +- The `--pushstate` boolean argument should now come *after* entries in the CLI, as it supports subarg options. Using it before entries will still work but may log a warning. +- Major overhaul to LiveReload backend to make it faster and more robust [#194](https://github.com/mattdesl/budo/issues/194) + - No longer uses `tiny-lr` or the old school LiveReload stuff, so it no longer supports some of the feature set from that tool + - No longer supports the LiveReload browser plugin + - Budo runs everything on a single port/server instead of a second server for LiveReload + - `/budo/livereload.js` now serves the LiveReload client + +#### Other Changes + +- `opts.staticOptions` is now passed onto `serve-static` module +- `opts.pushstate` (boolean or object) is now passed onto `connect-pushstate` module +- CLI now supports subarg syntax for commands like `--static-options` and `--pushstate` +- `defaultIndex` function now accepts a `req` as the second parameter + +# 9.4.7 + +- Make HTTP logging more accurate: previously the time and byte size was not correct + +# 9.4.5 .. 9.4.6 + +- Small tweaks to frontend build error styling +- Add `pushstate` flag as a boolean so it doesn't swallow entry + +# 9.4.3 + +- Disable cache control for `serve-static`, I've found this greatly reduces load time +- Slight change to `package.json` scripts so they work on Windows + +# 9.4.2 + +- Improve Windows terminal color support, fixes [#179](https://github.com/mattdesl/budo/issues/179) + +# 9.4.0 + +- Improve build error parsing and rendering + +# 9.3.0 + +- Add `force-default-index` to CLI [#188](https://github.com/mattdesl/budo/pull/188) + +# 9.2.2 + +- Minimize XSS risks in URLs on 404 [#182](https://github.com/mattdesl/budo/pull/183) + +# 9.2.0 + +- Improved `--cors` flag in middleware stack [#172](https://github.com/mattdesl/budo/pull/172) + +# 9.1.0 + +- Support `browserify: { entries: [] }` in API options [#167](https://github.com/mattdesl/budo/pull/167) +- The `connect` event also returns a `server` instance, so you can use it with things like SocketIO + +# 9.0.0 + +When `--ssl` is specified without a `--cert` and `--key` option, budo will use [pem](https://www.npmjs.com/package/pem) to generate a self-signed certificate. This is a breaking change from previous versions, but more convenient for most users. + +Also updated docs with more SSL info. + +# 8.4.0 + +Add `--base` flag for working with push state servers. + +# 8.3.0 + +Bump to latest browserify. + +# 8.2.2 + +Fix shorthand for `--serve` (`-s`). + +# 8.2.0 + +Add support for SSL (HTTPS) with `--ssl`, `--cert` and `--key` options. + +# 8.1.0 + +Add `--cors` flag to enable `Access-Control-Allow-Origin: *` + +# 8.0.4 + +Bump required deps. + +# 8.0.3 + +Fix `opts.live` as a string, allowing an array of options to be passed to filter file names. + +# 8.0.2 + +Fix flow so that bundling events start after server connects, also updated upstream in watchify-middleware. + +# 8.0.1 + +Fix parsing issue with LiveReload resp modifier. + +# 8.0.0 + +The server code has been refactored to use connect/express-style middleware stacking. Fixes [#80](https://github.com/mattdesl/budo/issues/80), [#79](https://github.com/mattdesl/budo/issues/79), [#124](https://github.com/mattdesl/budo/issues/124), [#128](https://github.com/mattdesl/budo/issues/128). + +##### Major Changes + +Functions for `opts.middleware` now assumes the following signature, and will not behave differently based on the number of arguments you specify: + + - `middleware(req, res, next)` + +##### Minor Changes + +The `middleware` options can now be an array of functions, or a single function. + +# 7.1.0 + +Added `--watch-glob` option which allows you to override the default watch glob without having to go through the `live()` / `watch()` API + +# 7.0.4 + +Small patch [#117](https://github.com/mattdesl/budo/pull/117) to fix a failing test in 7.0.3. + +# 7.0.3 + +- Bole no longer double-logs on shut-down and re-start. +- Fixed issue with request sizes being logged incorrectly in terminal + +# 7.0.1 .. 7.0.2 + +Small patches for [#110](https://github.com/mattdesl/budo/pull/110) and [#111](https://github.com/mattdesl/budo/pull/111). + +# 7.0.0 + +Fixes previous patch and also updates to garnish redesign, leading to new log styles. + +Since various ndjson flags have changed, this is a potentially breaking change. + +Also added a `--verbose` / `-v` option like watchify, which adds some additional debug messages. + +# 6.1.1 + +Fixes live reload for directory routes like `localhost:9966/mydir`. + +# 6.1.0 + +Search for `index.html` across all static `--dir` folders, finding the first one. + +# 6.0.0 + +##### Major Changes + +- `garnish` is now included by default in CLI and API + - you can use `--ndjson` and `ndjson: true` to have raw output (for custom pretty-printers) + +##### Minor Changes + +- added `--title` option for the default HTML title +- added `--css` option for a default style sheet + +# 5.0.0 + +##### Major Changes + +- you can just type `budo . | garnish` for the entry point (or `index.js`) +- added `--onupdate` for things like linting, see [the docs](docs/command-line-usage.md#--onupdate) +- if no `--host` is specified, resolves to internal IP + - you can still hit `localhost:9966` and it will work +- the ` + + + + + + diff --git a/node_modules/console-browserify/test/static/test-adapter.js b/node_modules/console-browserify/test/static/test-adapter.js new file mode 100644 index 000000000..8b4c12dc5 --- /dev/null +++ b/node_modules/console-browserify/test/static/test-adapter.js @@ -0,0 +1,53 @@ +(function () { + var Testem = window.Testem + var regex = /^((?:not )?ok) (\d+) (.+)$/ + + Testem.useCustomAdapter(tapAdapter) + + function tapAdapter(socket){ + var results = { + failed: 0 + , passed: 0 + , total: 0 + , tests: [] + } + + socket.emit('tests-start') + + Testem.handleConsoleMessage = function(msg){ + var m = msg.match(regex) + if (m) { + var passed = m[1] === 'ok' + var test = { + passed: passed ? 1 : 0, + failed: passed ? 0 : 1, + total: 1, + id: m[2], + name: m[3], + items: [] + } + + if (passed) { + results.passed++ + } else { + console.error("failure", m) + + results.failed++ + } + + results.total++ + + // console.log("emitted test", test) + socket.emit('test-result', test) + results.tests.push(test) + } else if (msg === '# ok' || msg.match(/^# tests \d+/)){ + // console.log("emitted all test") + socket.emit('all-test-results', results) + } + + // return false if you want to prevent the console message from + // going to the console + // return false + } + } +}()) diff --git a/node_modules/constants-browserify/README.md b/node_modules/constants-browserify/README.md new file mode 100644 index 000000000..9dd5a46fe --- /dev/null +++ b/node_modules/constants-browserify/README.md @@ -0,0 +1,54 @@ + +# constants-browserify + +Node's `constants` module for the browser. + +[![downloads](https://img.shields.io/npm/dm/constants-browserify.svg)](https://www.npmjs.org/package/constants-browserify) + +## Usage + +To use with browserify cli: + +```bash +$ browserify -r constants:constants-browserify script.js +``` + +To use with browserify api: + +```js +browserify() + .require('constants-browserify', { expose: 'constants' }) + .add(__dirname + '/script.js') + .bundle() + // ... +``` + +## Installation + +With [npm](http://npmjs.org) do + +```bash +$ npm install constants-browserify +``` + +## License + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/constants-browserify/build.sh b/node_modules/constants-browserify/build.sh new file mode 100755 index 000000000..60012d667 --- /dev/null +++ b/node_modules/constants-browserify/build.sh @@ -0,0 +1 @@ +node -pe 'JSON.stringify(require("constants"), null, " ")' > constants.json diff --git a/node_modules/constants-browserify/constants.json b/node_modules/constants-browserify/constants.json new file mode 100644 index 000000000..9a69b858d --- /dev/null +++ b/node_modules/constants-browserify/constants.json @@ -0,0 +1,209 @@ +{ + "O_RDONLY": 0, + "O_WRONLY": 1, + "O_RDWR": 2, + "S_IFMT": 61440, + "S_IFREG": 32768, + "S_IFDIR": 16384, + "S_IFCHR": 8192, + "S_IFBLK": 24576, + "S_IFIFO": 4096, + "S_IFLNK": 40960, + "S_IFSOCK": 49152, + "O_CREAT": 512, + "O_EXCL": 2048, + "O_NOCTTY": 131072, + "O_TRUNC": 1024, + "O_APPEND": 8, + "O_DIRECTORY": 1048576, + "O_NOFOLLOW": 256, + "O_SYNC": 128, + "O_SYMLINK": 2097152, + "O_NONBLOCK": 4, + "S_IRWXU": 448, + "S_IRUSR": 256, + "S_IWUSR": 128, + "S_IXUSR": 64, + "S_IRWXG": 56, + "S_IRGRP": 32, + "S_IWGRP": 16, + "S_IXGRP": 8, + "S_IRWXO": 7, + "S_IROTH": 4, + "S_IWOTH": 2, + "S_IXOTH": 1, + "E2BIG": 7, + "EACCES": 13, + "EADDRINUSE": 48, + "EADDRNOTAVAIL": 49, + "EAFNOSUPPORT": 47, + "EAGAIN": 35, + "EALREADY": 37, + "EBADF": 9, + "EBADMSG": 94, + "EBUSY": 16, + "ECANCELED": 89, + "ECHILD": 10, + "ECONNABORTED": 53, + "ECONNREFUSED": 61, + "ECONNRESET": 54, + "EDEADLK": 11, + "EDESTADDRREQ": 39, + "EDOM": 33, + "EDQUOT": 69, + "EEXIST": 17, + "EFAULT": 14, + "EFBIG": 27, + "EHOSTUNREACH": 65, + "EIDRM": 90, + "EILSEQ": 92, + "EINPROGRESS": 36, + "EINTR": 4, + "EINVAL": 22, + "EIO": 5, + "EISCONN": 56, + "EISDIR": 21, + "ELOOP": 62, + "EMFILE": 24, + "EMLINK": 31, + "EMSGSIZE": 40, + "EMULTIHOP": 95, + "ENAMETOOLONG": 63, + "ENETDOWN": 50, + "ENETRESET": 52, + "ENETUNREACH": 51, + "ENFILE": 23, + "ENOBUFS": 55, + "ENODATA": 96, + "ENODEV": 19, + "ENOENT": 2, + "ENOEXEC": 8, + "ENOLCK": 77, + "ENOLINK": 97, + "ENOMEM": 12, + "ENOMSG": 91, + "ENOPROTOOPT": 42, + "ENOSPC": 28, + "ENOSR": 98, + "ENOSTR": 99, + "ENOSYS": 78, + "ENOTCONN": 57, + "ENOTDIR": 20, + "ENOTEMPTY": 66, + "ENOTSOCK": 38, + "ENOTSUP": 45, + "ENOTTY": 25, + "ENXIO": 6, + "EOPNOTSUPP": 102, + "EOVERFLOW": 84, + "EPERM": 1, + "EPIPE": 32, + "EPROTO": 100, + "EPROTONOSUPPORT": 43, + "EPROTOTYPE": 41, + "ERANGE": 34, + "EROFS": 30, + "ESPIPE": 29, + "ESRCH": 3, + "ESTALE": 70, + "ETIME": 101, + "ETIMEDOUT": 60, + "ETXTBSY": 26, + "EWOULDBLOCK": 35, + "EXDEV": 18, + "SIGHUP": 1, + "SIGINT": 2, + "SIGQUIT": 3, + "SIGILL": 4, + "SIGTRAP": 5, + "SIGABRT": 6, + "SIGIOT": 6, + "SIGBUS": 10, + "SIGFPE": 8, + "SIGKILL": 9, + "SIGUSR1": 30, + "SIGSEGV": 11, + "SIGUSR2": 31, + "SIGPIPE": 13, + "SIGALRM": 14, + "SIGTERM": 15, + "SIGCHLD": 20, + "SIGCONT": 19, + "SIGSTOP": 17, + "SIGTSTP": 18, + "SIGTTIN": 21, + "SIGTTOU": 22, + "SIGURG": 16, + "SIGXCPU": 24, + "SIGXFSZ": 25, + "SIGVTALRM": 26, + "SIGPROF": 27, + "SIGWINCH": 28, + "SIGIO": 23, + "SIGSYS": 12, + "SSL_OP_ALL": 2147486719, + "SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION": 262144, + "SSL_OP_CIPHER_SERVER_PREFERENCE": 4194304, + "SSL_OP_CISCO_ANYCONNECT": 32768, + "SSL_OP_COOKIE_EXCHANGE": 8192, + "SSL_OP_CRYPTOPRO_TLSEXT_BUG": 2147483648, + "SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS": 2048, + "SSL_OP_EPHEMERAL_RSA": 0, + "SSL_OP_LEGACY_SERVER_CONNECT": 4, + "SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER": 32, + "SSL_OP_MICROSOFT_SESS_ID_BUG": 1, + "SSL_OP_MSIE_SSLV2_RSA_PADDING": 0, + "SSL_OP_NETSCAPE_CA_DN_BUG": 536870912, + "SSL_OP_NETSCAPE_CHALLENGE_BUG": 2, + "SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG": 1073741824, + "SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG": 8, + "SSL_OP_NO_COMPRESSION": 131072, + "SSL_OP_NO_QUERY_MTU": 4096, + "SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION": 65536, + "SSL_OP_NO_SSLv2": 16777216, + "SSL_OP_NO_SSLv3": 33554432, + "SSL_OP_NO_TICKET": 16384, + "SSL_OP_NO_TLSv1": 67108864, + "SSL_OP_NO_TLSv1_1": 268435456, + "SSL_OP_NO_TLSv1_2": 134217728, + "SSL_OP_PKCS1_CHECK_1": 0, + "SSL_OP_PKCS1_CHECK_2": 0, + "SSL_OP_SINGLE_DH_USE": 1048576, + "SSL_OP_SINGLE_ECDH_USE": 524288, + "SSL_OP_SSLEAY_080_CLIENT_DH_BUG": 128, + "SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG": 0, + "SSL_OP_TLS_BLOCK_PADDING_BUG": 512, + "SSL_OP_TLS_D5_BUG": 256, + "SSL_OP_TLS_ROLLBACK_BUG": 8388608, + "ENGINE_METHOD_DSA": 2, + "ENGINE_METHOD_DH": 4, + "ENGINE_METHOD_RAND": 8, + "ENGINE_METHOD_ECDH": 16, + "ENGINE_METHOD_ECDSA": 32, + "ENGINE_METHOD_CIPHERS": 64, + "ENGINE_METHOD_DIGESTS": 128, + "ENGINE_METHOD_STORE": 256, + "ENGINE_METHOD_PKEY_METHS": 512, + "ENGINE_METHOD_PKEY_ASN1_METHS": 1024, + "ENGINE_METHOD_ALL": 65535, + "ENGINE_METHOD_NONE": 0, + "DH_CHECK_P_NOT_SAFE_PRIME": 2, + "DH_CHECK_P_NOT_PRIME": 1, + "DH_UNABLE_TO_CHECK_GENERATOR": 4, + "DH_NOT_SUITABLE_GENERATOR": 8, + "NPN_ENABLED": 1, + "RSA_PKCS1_PADDING": 1, + "RSA_SSLV23_PADDING": 2, + "RSA_NO_PADDING": 3, + "RSA_PKCS1_OAEP_PADDING": 4, + "RSA_X931_PADDING": 5, + "RSA_PKCS1_PSS_PADDING": 6, + "POINT_CONVERSION_COMPRESSED": 2, + "POINT_CONVERSION_UNCOMPRESSED": 4, + "POINT_CONVERSION_HYBRID": 6, + "F_OK": 0, + "R_OK": 4, + "W_OK": 2, + "X_OK": 1, + "UV_UDP_REUSEADDR": 4 +} diff --git a/node_modules/constants-browserify/package.json b/node_modules/constants-browserify/package.json new file mode 100644 index 000000000..50d7ad11e --- /dev/null +++ b/node_modules/constants-browserify/package.json @@ -0,0 +1,62 @@ +{ + "_from": "constants-browserify@~1.0.0", + "_id": "constants-browserify@1.0.0", + "_inBundle": false, + "_integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "_location": "/constants-browserify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "constants-browserify@~1.0.0", + "name": "constants-browserify", + "escapedName": "constants-browserify", + "rawSpec": "~1.0.0", + "saveSpec": null, + "fetchSpec": "~1.0.0" + }, + "_requiredBy": [ + "/browserify" + ], + "_resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "_shasum": "c20b96d8c617748aaf1c16021760cd27fcb8cb75", + "_spec": "constants-browserify@~1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "Julian Gruber", + "email": "julian@juliangruber.com", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/constants-browserify/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "James J. Womack", + "email": "james@womack.io", + "url": "http://netflix.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "node's constants module for the browser", + "homepage": "https://github.com/juliangruber/constants-browserify", + "keywords": [ + "constants", + "node", + "browser", + "browserify" + ], + "license": "MIT", + "main": "constants.json", + "name": "constants-browserify", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/constants-browserify.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/node_modules/constants-browserify/test.js b/node_modules/constants-browserify/test.js new file mode 100644 index 000000000..58cc30198 --- /dev/null +++ b/node_modules/constants-browserify/test.js @@ -0,0 +1,18 @@ +'use strict'; + +var Assert = require('assert') +var Constants = require('./') + +try { + var nodeConstants = require('constants') + + Assert.deepEqual(nodeConstants, Constants, 'The constants file was not equal') +} + +catch (e) { + console.error(e) + console.error('\nTests failed!') + process.exit(1) +} + +console.info('Tests passed!') diff --git a/node_modules/convert-source-map/.npmignore b/node_modules/convert-source-map/.npmignore new file mode 100644 index 000000000..de78e273f --- /dev/null +++ b/node_modules/convert-source-map/.npmignore @@ -0,0 +1,16 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +node_modules +npm-debug.log +tmp diff --git a/node_modules/convert-source-map/.travis.yml b/node_modules/convert-source-map/.travis.yml new file mode 100644 index 000000000..a55b235f9 --- /dev/null +++ b/node_modules/convert-source-map/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - 0.8 + - 0.10 + - 0.11 \ No newline at end of file diff --git a/node_modules/convert-source-map/LICENSE b/node_modules/convert-source-map/LICENSE new file mode 100644 index 000000000..41702c504 --- /dev/null +++ b/node_modules/convert-source-map/LICENSE @@ -0,0 +1,23 @@ +Copyright 2013 Thorsten Lorenz. +All rights reserved. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/convert-source-map/README.md b/node_modules/convert-source-map/README.md new file mode 100644 index 000000000..e415fecc9 --- /dev/null +++ b/node_modules/convert-source-map/README.md @@ -0,0 +1,121 @@ +# convert-source-map [![build status](https://secure.travis-ci.org/thlorenz/convert-source-map.png)](http://travis-ci.org/thlorenz/convert-source-map) + +[![NPM](https://nodei.co/npm/convert-source-map.png?downloads=true&stars=true)](https://nodei.co/npm/convert-source-map/) + +Converts a source-map from/to different formats and allows adding/changing properties. + +```js +var convert = require('convert-source-map'); + +var json = convert + .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9vLmpzIiwic291cmNlcyI6WyJjb25zb2xlLmxvZyhcImhpXCIpOyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') + .toJSON(); + +var modified = convert + .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9vLmpzIiwic291cmNlcyI6WyJjb25zb2xlLmxvZyhcImhpXCIpOyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') + .setProperty('sources', [ 'CONSOLE.LOG("HI");' ]) + .toJSON(); + +console.log(json); +console.log(modified); +``` + +```json +{"version":3,"file":"foo.js","sources":["console.log(\"hi\");"],"names":[],"mappings":"AAAA","sourceRoot":"/"} +{"version":3,"file":"foo.js","sources":["CONSOLE.LOG(\"HI\");"],"names":[],"mappings":"AAAA","sourceRoot":"/"} +``` + +## API + +### fromObject(obj) + +Returns source map converter from given object. + +### fromJSON(json) + +Returns source map converter from given json string. + +### fromBase64(base64) + +Returns source map converter from given base64 encoded json string. + +### fromComment(comment) + +Returns source map converter from given base64 encoded json string prefixed with `//# sourceMappingURL=...`. + +### fromMapFileComment(comment, mapFileDir) + +Returns source map converter from given `filename` by parsing `//# sourceMappingURL=filename`. + +`filename` must point to a file that is found inside the `mapFileDir`. Most tools store this file right next to the +generated file, i.e. the one containing the source map. + +### fromSource(source[, largeSource]) + +Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was found. + +If `largeSource` is set to `true`, an algorithm that does not use regex is applied to find the source map. This is faster and especially useful if you're running into "call stack size exceeded" errors with the default algorithm. + +However, it is less accurate and may match content that isn't a source map comment. + +### fromMapFileSource(source, mapFileDir) + +Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was +found. + +The sourcemap will be read from the map file found by parsing `# sourceMappingURL=file` comment. For more info see +fromMapFileComment. + +### toObject() + +Returns a copy of the underlying source map. + +### toJSON([space]) + +Converts source map to json string. If `space` is given (optional), this will be passed to +[JSON.stringify](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/stringify) when the +JSON string is generated. + +### toBase64() + +Converts source map to base64 encoded json string. + +### toComment([options]) + +Converts source map to an inline comment that can be appended to the source-file. + +By default, the comment is formatted like: `//# sourceMappingURL=...`, which you would +normally see in a JS source file. + +When `options.multiline == true`, the comment is formatted like: `/*# sourceMappingURL=... */`, which you would find in a CSS source file. + +### addProperty(key, value) + +Adds given property to the source map. Throws an error if property already exists. + +### setProperty(key, value) + +Sets given property to the source map. If property doesn't exist it is added, otherwise its value is updated. + +### getProperty(key) + +Gets given property of the source map. + +### removeComments(src) + +Returns `src` with all source map comments removed + +### removeMapFileComments(src) + +Returns `src` with all source map comments pointing to map files removed. + +### commentRegex + +Returns the regex used to find source map comments. + +### mapFileCommentRegex + +Returns the regex used to find source map comments pointing to map files. + + +[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/thlorenz/convert-source-map/trend.png)](https://bitdeli.com/free "Bitdeli Badge") diff --git a/node_modules/convert-source-map/example/comment-to-json.js b/node_modules/convert-source-map/example/comment-to-json.js new file mode 100644 index 000000000..dfab18617 --- /dev/null +++ b/node_modules/convert-source-map/example/comment-to-json.js @@ -0,0 +1,15 @@ +'use strict'; + +var convert = require('..'); + +var json = convert + .fromComment('//@ sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9vLmpzIiwic291cmNlcyI6WyJjb25zb2xlLmxvZyhcImhpXCIpOyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') + .toJSON(); + +var modified = convert + .fromComment('//@ sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9vLmpzIiwic291cmNlcyI6WyJjb25zb2xlLmxvZyhcImhpXCIpOyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') + .setProperty('sources', [ 'CONSOLE.LOG("HI");' ]) + .toJSON(); + +console.log(json); +console.log(modified); diff --git a/node_modules/convert-source-map/index.js b/node_modules/convert-source-map/index.js new file mode 100644 index 000000000..bfe92d1e2 --- /dev/null +++ b/node_modules/convert-source-map/index.js @@ -0,0 +1,156 @@ +'use strict'; +var fs = require('fs'); +var path = require('path'); + +var commentRx = /^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+;)?base64,(.*)$/mg; +var mapFileCommentRx = + //Example (Extra space between slashes added to solve Safari bug. Exclude space in production): + // / /# sourceMappingURL=foo.js.map /*# sourceMappingURL=foo.js.map */ + /(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/mg + +function decodeBase64(base64) { + return new Buffer(base64, 'base64').toString(); +} + +function stripComment(sm) { + return sm.split(',').pop(); +} + +function readFromFileMap(sm, dir) { + // NOTE: this will only work on the server since it attempts to read the map file + + var r = mapFileCommentRx.exec(sm); + mapFileCommentRx.lastIndex = 0; + + // for some odd reason //# .. captures in 1 and /* .. */ in 2 + var filename = r[1] || r[2]; + var filepath = path.join(dir, filename); + + try { + return fs.readFileSync(filepath, 'utf8'); + } catch (e) { + throw new Error('An error occurred while trying to read the map file at ' + filepath + '\n' + e); + } +} + +function Converter (sm, opts) { + opts = opts || {}; + + if (opts.isFileComment) sm = readFromFileMap(sm, opts.commentFileDir); + if (opts.hasComment) sm = stripComment(sm); + if (opts.isEncoded) sm = decodeBase64(sm); + if (opts.isJSON || opts.isEncoded) sm = JSON.parse(sm); + + this.sourcemap = sm; +} + +function convertFromLargeSource(content){ + var lines = content.split('\n'); + var line; + // find first line which contains a source map starting at end of content + for (var i = lines.length - 1; i > 0; i--) { + line = lines[i] + if (~line.indexOf('sourceMappingURL=data:')) return exports.fromComment(line); + } +} + +Converter.prototype.toJSON = function (space) { + return JSON.stringify(this.sourcemap, null, space); +}; + +Converter.prototype.toBase64 = function () { + var json = this.toJSON(); + return new Buffer(json).toString('base64'); +}; + +Converter.prototype.toComment = function (options) { + var base64 = this.toBase64(); + var data = 'sourceMappingURL=data:application/json;base64,' + base64; + return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; +}; + +// returns copy instead of original +Converter.prototype.toObject = function () { + return JSON.parse(this.toJSON()); +}; + +Converter.prototype.addProperty = function (key, value) { + if (this.sourcemap.hasOwnProperty(key)) throw new Error('property %s already exists on the sourcemap, use set property instead'); + return this.setProperty(key, value); +}; + +Converter.prototype.setProperty = function (key, value) { + this.sourcemap[key] = value; + return this; +}; + +Converter.prototype.getProperty = function (key) { + return this.sourcemap[key]; +}; + +exports.fromObject = function (obj) { + return new Converter(obj); +}; + +exports.fromJSON = function (json) { + return new Converter(json, { isJSON: true }); +}; + +exports.fromBase64 = function (base64) { + return new Converter(base64, { isEncoded: true }); +}; + +exports.fromComment = function (comment) { + comment = comment + .replace(/^\/\*/g, '//') + .replace(/\*\/$/g, ''); + + return new Converter(comment, { isEncoded: true, hasComment: true }); +}; + +exports.fromMapFileComment = function (comment, dir) { + return new Converter(comment, { commentFileDir: dir, isFileComment: true, isJSON: true }); +}; + +// Finds last sourcemap comment in file or returns null if none was found +exports.fromSource = function (content, largeSource) { + if (largeSource) { + var res = convertFromLargeSource(content); + return res ? res : null; + } + + var m = content.match(commentRx); + commentRx.lastIndex = 0; + return m ? exports.fromComment(m.pop()) : null; +}; + +// Finds last sourcemap comment in file or returns null if none was found +exports.fromMapFileSource = function (content, dir) { + var m = content.match(mapFileCommentRx); + mapFileCommentRx.lastIndex = 0; + return m ? exports.fromMapFileComment(m.pop(), dir) : null; +}; + +exports.removeComments = function (src) { + commentRx.lastIndex = 0; + return src.replace(commentRx, ''); +}; + +exports.removeMapFileComments = function (src) { + mapFileCommentRx.lastIndex = 0; + return src.replace(mapFileCommentRx, ''); +}; + +Object.defineProperty(exports, 'commentRegex', { + get: function getCommentRegex () { + commentRx.lastIndex = 0; + return commentRx; + } +}); + +Object.defineProperty(exports, 'mapFileCommentRegex', { + get: function getMapFileCommentRegex () { + mapFileCommentRx.lastIndex = 0; + return mapFileCommentRx; + } +}); diff --git a/node_modules/convert-source-map/package.json b/node_modules/convert-source-map/package.json new file mode 100644 index 000000000..170417d55 --- /dev/null +++ b/node_modules/convert-source-map/package.json @@ -0,0 +1,64 @@ +{ + "_from": "convert-source-map@~1.1.0", + "_id": "convert-source-map@1.1.3", + "_inBundle": false, + "_integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", + "_location": "/convert-source-map", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "convert-source-map@~1.1.0", + "name": "convert-source-map", + "escapedName": "convert-source-map", + "rawSpec": "~1.1.0", + "saveSpec": null, + "fetchSpec": "~1.1.0" + }, + "_requiredBy": [ + "/combine-source-map" + ], + "_resolved": "http://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "_shasum": "4829c877e9fe49b3161f3bf3673888e204699860", + "_spec": "convert-source-map@~1.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/combine-source-map", + "author": { + "name": "Thorsten Lorenz", + "email": "thlorenz@gmx.de", + "url": "http://thlorenz.com" + }, + "bugs": { + "url": "https://github.com/thlorenz/convert-source-map/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Converts a source-map from/to different formats and allows adding/changing properties.", + "devDependencies": { + "inline-source-map": "~0.3.1", + "tap": "~0.4.13" + }, + "engine": { + "node": ">=0.6" + }, + "homepage": "https://github.com/thlorenz/convert-source-map", + "keywords": [ + "convert", + "sourcemap", + "source", + "map", + "browser", + "debug" + ], + "license": "MIT", + "main": "index.js", + "name": "convert-source-map", + "repository": { + "type": "git", + "url": "git://github.com/thlorenz/convert-source-map.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "1.1.3" +} diff --git a/node_modules/convert-source-map/test/comment-regex.js b/node_modules/convert-source-map/test/comment-regex.js new file mode 100644 index 000000000..16331ccb8 --- /dev/null +++ b/node_modules/convert-source-map/test/comment-regex.js @@ -0,0 +1,138 @@ +'use strict'; +/*jshint asi: true */ + +var test = require('tap').test + , generator = require('inline-source-map') + , rx = require('..').commentRegex + , mapFileRx = require('..').mapFileCommentRegex + +function comment(prefix, suffix) { + rx.lastIndex = 0; + return rx.test(prefix + 'sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' + suffix) +} + +function commentWithCharSet(prefix, suffix, sep) { + sep = sep || ':'; + rx.lastIndex = 0; + return rx.test(prefix + 'sourceMappingURL=data:application/json;charset' + sep +'utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' + suffix) +} + +// Source Map v2 Tests +test('comment regex old spec - @', function (t) { + [ + '//@ ', + ' //@ ', // with leading space + '\t//@ ', // with leading tab + '//@ ', // with leading text + '/*@ ', // multi line style + ' /*@ ', // multi line style with leading spaces + '\t/*@ ', // multi line style with leading tab + '/*@ ', // multi line style with leading text + ].forEach(function (x) { + t.ok(comment(x, ''), 'matches ' + x) + t.ok(commentWithCharSet(x, ''), 'matches ' + x + ' with charset') + t.ok(commentWithCharSet(x, '', '='), 'matches ' + x + ' with charset') + }); + + [ + ' @// @', + ' @/* @', + ].forEach(function (x) { t.ok(!comment(x, ''), 'should not match ' + x) }) + + t.end() +}) + +test('comment regex new spec - #', function (t) { + [ + ' //# ', // with leading spaces + '\t//# ', // with leading tab + '//# ', // with leading text + '/*# ', // multi line style + ' /*# ', // multi line style with leading spaces + '\t/*# ', // multi line style with leading tab + '/*# ', // multi line style with leading text + ].forEach(function (x) { + t.ok(comment(x, ''), 'matches ' + x) + t.ok(commentWithCharSet(x, ''), 'matches ' + x + ' with charset') + t.ok(commentWithCharSet(x, '', '='), 'matches ' + x + ' with charset') + }); + + [ + ' #// #', + ' #/* #', + ].forEach(function (x) { t.ok(!comment(x, ''), 'should not match ' + x) }) + + t.end() +}) + +function mapFileCommentWrap(s1, s2) { + mapFileRx.lastIndex = 0; + return mapFileRx.test(s1 + 'sourceMappingURL=foo.js.map' + s2) +} + +test('mapFileComment regex old spec - @', function (t) { + + [ + ['//@ ', ''], + [' //@ ', ''], // with leading spaces + ['\t//@ ', ''], // with a leading tab + ['///@ ', ''], // with a leading text + [';//@ ', ''], // with a leading text + ['return//@ ', ''], // with a leading text + ].forEach(function (x) { t.ok(mapFileCommentWrap(x[0], x[1]), 'matches ' + x.join(' :: ')) }); + + [ + [' @// @', ''], + ['var sm = "//@ ', '"'], // not inside a string + ['var sm = \'//@ ', '\''], // not inside a string + ['var sm = \' //@ ', '\''], // not inside a string + ].forEach(function (x) { t.ok(!mapFileCommentWrap(x[0], x[1]), 'does not match ' + x.join(' :: ')) }) + t.end() +}) + +test('mapFileComment regex new spec - #', function (t) { + [ + ['//# ', ''], + [' //# ', ''], // with leading space + ['\t//# ', ''], // with leading tab + ['///# ', ''], // with leading text + [';//# ', ''], // with leading text + ['return//# ', ''], // with leading text + ].forEach(function (x) { t.ok(mapFileCommentWrap(x[0], x[1]), 'matches ' + x.join(' :: ')) }); + + [ + [' #// #', ''], + ['var sm = "//# ', '"'], // not inside a string + ['var sm = \'//# ', '\''], // not inside a string + ['var sm = \' //# ', '\''], // not inside a string + ].forEach(function (x) { t.ok(!mapFileCommentWrap(x[0], x[1]), 'does not match ' + x.join(' :: ')) }) + t.end() +}) + +test('mapFileComment regex /* */ old spec - @', function (t) { + [ [ '/*@ ', '*/' ] + , [' /*@ ', ' */ ' ] // with leading spaces + , [ '\t/*@ ', ' \t*/\t '] // with a leading tab + , [ 'leading string/*@ ', '*/' ] // with a leading string + , [ '/*@ ', ' \t*/\t '] // with trailing whitespace + ].forEach(function (x) { t.ok(mapFileCommentWrap(x[0], x[1]), 'matches ' + x.join(' :: ')) }); + + [ ['/*@ ', ' */ */ ' ], // not the last thing on its line + ['/*@ ', ' */ more text ' ] // not the last thing on its line + ].forEach(function (x) { t.ok(!mapFileCommentWrap(x[0], x[1]), 'does not match ' + x.join(' :: ')) }); + t.end() +}) + +test('mapFileComment regex /* */ new spec - #', function (t) { + [ [ '/*# ', '*/' ] + , [' /*# ', ' */ ' ] // with leading spaces + , [ '\t/*# ', ' \t*/\t '] // with a leading tab + , [ 'leading string/*# ', '*/' ] // with a leading string + , [ '/*# ', ' \t*/\t '] // with trailing whitespace + ].forEach(function (x) { t.ok(mapFileCommentWrap(x[0], x[1]), 'matches ' + x.join(' :: ')) }); + + [ ['/*# ', ' */ */ ' ], // not the last thing on its line + ['/*# ', ' */ more text ' ] // not the last thing on its line + ].forEach(function (x) { t.ok(!mapFileCommentWrap(x[0], x[1]), 'does not match ' + x.join(' :: ')) }); + t.end() +}) diff --git a/node_modules/convert-source-map/test/convert-source-map.js b/node_modules/convert-source-map/test/convert-source-map.js new file mode 100644 index 000000000..9bd3ba91e --- /dev/null +++ b/node_modules/convert-source-map/test/convert-source-map.js @@ -0,0 +1,207 @@ +'use strict'; +/*jshint asi: true */ + +var test = require('tap').test + , generator = require('inline-source-map') + , convert = require('..') + +var gen = generator() + .addMappings('foo.js', [{ original: { line: 2, column: 3 } , generated: { line: 5, column: 10 } }], { line: 5 }) + .addGeneratedMappings('bar.js', 'var a = 2;\nconsole.log(a)', { line: 23, column: 22 }) + + , base64 = gen.base64Encode() + , comment = gen.inlineMappingUrl() + , json = gen.toString() + , obj = JSON.parse(json) + +test('different formats', function (t) { + + t.equal(convert.fromComment(comment).toComment(), comment, 'comment -> comment') + t.equal(convert.fromComment(comment).toBase64(), base64, 'comment -> base64') + t.equal(convert.fromComment(comment).toJSON(), json, 'comment -> json') + t.deepEqual(convert.fromComment(comment).toObject(), obj, 'comment -> object') + + t.equal(convert.fromBase64(base64).toBase64(), base64, 'base64 -> base64') + t.equal(convert.fromBase64(base64).toComment(), comment, 'base64 -> comment') + t.equal(convert.fromBase64(base64).toJSON(), json, 'base64 -> json') + t.deepEqual(convert.fromBase64(base64).toObject(), obj, 'base64 -> object') + + t.equal(convert.fromJSON(json).toJSON(), json, 'json -> json') + t.equal(convert.fromJSON(json).toBase64(), base64, 'json -> base64') + t.equal(convert.fromJSON(json).toComment(), comment, 'json -> comment') + t.deepEqual(convert.fromJSON(json).toObject(), obj, 'json -> object') + t.end() +}) + +test('to object returns a copy', function (t) { + var c = convert.fromJSON(json) + var o = c.toObject() + o.version = '99'; + t.equal(c.toObject().version, 3, 'setting property on returned object does not affect original') + t.end() +}) + +test('to multi-line map', function (t) { + var c = convert.fromObject(obj); + var s = c.toComment({ multiline: true }); + t.similar(s, /^\/\*# sourceMappingURL=.+ \*\/$/); + t.end(); +}) + +test('from source', function (t) { + var foo = [ + 'function foo() {' + , ' console.log("hello I am foo");' + , ' console.log("who are you");' + , '}' + , '' + , 'foo();' + , '' + ].join('\n') + , map = '//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' + , otherMap = '//# sourceMappingURL=data:application/json;base64,otherZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' + + function getComment(src) { + var map = convert.fromSource(src); + return map ? map.toComment() : null; + } + + t.equal(getComment(foo), null, 'no comment returns null') + t.equal(getComment(foo + map), map, 'beginning of last line') + t.equal(getComment(foo + ' ' + map), map, 'indented of last line') + t.equal(getComment(foo + ' ' + map + '\n\n'), map, 'indented on last non empty line') + t.equal(getComment(foo + map + '\nconsole.log("more code");\nfoo()\n'), map, 'in the middle of code') + t.equal(getComment(foo + otherMap + '\n' + map), map, 'finds last map in source') + t.end() +}) + +test('from source with a large source', function (t) { + var foo = [ + 'function foo() {' + , ' console.log("hello I am foo");' + , ' console.log("who are you");' + , '}' + , '' + , 'foo();' + , '' + ].join('\n') + , map = '//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' + , otherMap = '//# sourceMappingURL=data:application/json;base64,otherZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' + + function getComment(src) { + var map = convert.fromSource(src, true); + return map ? map.toComment() : null; + } + + t.equal(getComment(foo), null, 'no comment returns null') + t.equal(getComment(foo + map), map, 'beginning of last line') + t.equal(getComment(foo + ' ' + map), map, 'indented of last line') + t.equal(getComment(foo + ' ' + map + '\n\n'), map, 'indented on last non empty line') + t.equal(getComment(foo + map + '\nconsole.log("more code");\nfoo()\n'), map, 'in the middle of code') + t.equal(getComment(foo + otherMap + '\n' + map), map, 'finds last map in source') + t.end() +}) + +test('remove comments', function (t) { + var foo = [ + 'function foo() {' + , ' console.log("hello I am foo");' + , ' console.log("who are you");' + , '}' + , '' + , 'foo();' + , '' + ].join('\n') + // this one is old spec on purpose + , map = '//@ sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' + , otherMap = '//# sourceMappingURL=data:application/json;base64,ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' + , extraCode = '\nconsole.log("more code");\nfoo()\n' + + t.equal(convert.removeComments(foo + map), foo, 'from last line') + t.equal(convert.removeComments(foo + map + extraCode), foo + extraCode, 'from the middle of code') + t.equal(convert.removeComments(foo + otherMap + extraCode + map), foo + extraCode, 'multiple comments from the middle of code') + t.end() +}) + +test('remove map file comments', function (t) { + var foo = [ + 'function foo() {' + , ' console.log("hello I am foo");' + , ' console.log("who are you");' + , '}' + , '' + , 'foo();' + , '' + ].join('\n') + , fileMap1 = '//# sourceMappingURL=foo.js.map' + , fileMap2 = '/*# sourceMappingURL=foo.js.map */'; + + t.equal(convert.removeMapFileComments(foo + fileMap1), foo, '// style filemap comment') + t.equal(convert.removeMapFileComments(foo + fileMap2), foo, '/* */ style filemap comment') + t.end() +}) + +test('pretty json', function (t) { + var mod = convert.fromJSON(json).toJSON(2) + , expected = JSON.stringify(obj, null, 2); + + t.equal( + mod + , expected + , 'pretty prints json when space is given') + t.end() +}) + +test('adding properties', function (t) { + var mod = convert + .fromJSON(json) + .addProperty('foo', 'bar') + .toJSON() + , expected = JSON.parse(json); + expected.foo = 'bar'; + t.equal( + mod + , JSON.stringify(expected) + , 'includes added property' + ) + t.end() +}) + +test('setting properties', function (t) { + var mod = convert + .fromJSON(json) + .setProperty('version', '2') + .setProperty('mappings', ';;;UACG') + .setProperty('should add', 'this') + .toJSON() + , expected = JSON.parse(json); + expected.version = '2'; + expected.mappings = ';;;UACG'; + expected['should add'] = 'this'; + t.equal( + mod + , JSON.stringify(expected) + , 'includes new property and changes existing properties' + ) + t.end() +}) + +test('getting properties', function (t) { + var sm = convert.fromJSON(json) + + t.equal(sm.getProperty('version'), 3, 'gets version') + t.deepEqual(sm.getProperty('sources'), ['foo.js', 'bar.js'], 'gets sources') + t.end() +}) + +test('return null fromSource when largeSource is true', function(t) { + var mod = convert.fromSource('', true) + , expected = null; + + t.equal( + mod + , expected + , 'return value should be null' + ) + t.end() +}) diff --git a/node_modules/convert-source-map/test/fixtures/map-file-comment-double-slash.css b/node_modules/convert-source-map/test/fixtures/map-file-comment-double-slash.css new file mode 100644 index 000000000..e77799167 --- /dev/null +++ b/node_modules/convert-source-map/test/fixtures/map-file-comment-double-slash.css @@ -0,0 +1,14 @@ +.header { + background: #444; + border: solid; + padding: 10px; + border-radius: 10px 5px 10px 5px; + color: #b4b472; } + +#main li { + color: green; + margin: 10px; + padding: 10px; + font-size: 18px; } + +//# sourceMappingURL=map-file-comment.css.map diff --git a/node_modules/convert-source-map/test/fixtures/map-file-comment-inline.css b/node_modules/convert-source-map/test/fixtures/map-file-comment-inline.css new file mode 100644 index 000000000..1e61b2417 --- /dev/null +++ b/node_modules/convert-source-map/test/fixtures/map-file-comment-inline.css @@ -0,0 +1,14 @@ +.header { + background: #444; + border: solid; + padding: 10px; + border-radius: 10px 5px 10px 5px; + color: #b4b472; } + +#main li { + color: green; + margin: 10px; + padding: 10px; + font-size: 18px; } + +/*# sourceMappingURL=data:application/json;base64,ewoidmVyc2lvbiI6ICIzIiwKIm1hcHBpbmdzIjogIkFBQUEsd0JBQXlCO0VBQ3ZCLFVBQVUsRUFBRSxJQUFJO0VBQ2hCLE1BQU0sRUFBRSxLQUFLO0VBQ2IsT0FBTyxFQUFFLElBQUk7RUFDYixhQUFhLEVBQUUsaUJBQWlCO0VBQ2hDLEtBQUssRUFBRSxPQUFrQjs7QUFHM0Isd0JBQXlCO0VBQ3ZCLE9BQU8sRUFBRSxJQUFJOztBQ1RmLGdCQUFpQjtFQUNmLFVBQVUsRUFBRSxJQUFJO0VBQ2hCLEtBQUssRUFBRSxNQUFNOztBQUdmLGtCQUFtQjtFQUNqQixNQUFNLEVBQUUsSUFBSTtFQUNaLE9BQU8sRUFBRSxJQUFJO0VBQ2IsVUFBVSxFQUFFLEtBQUs7RUFDakIsYUFBYSxFQUFFLEdBQUc7RUFDbEIsS0FBSyxFQUFFLEtBQUs7O0FBRWQsa0JBQW1CO0VBQ2pCLEtBQUssRUFBRSxLQUFLOztBQUdkLG1CQUFvQjtFQUNsQixLQUFLLEVBQUUsS0FBSztFQUNaLE1BQU0sRUFBRSxJQUFJO0VBQ1osT0FBTyxFQUFFLElBQUk7RUFDYixTQUFTLEVBQUUsSUFBSSIsCiJzb3VyY2VzIjogWyIuL2NsaWVudC9zYXNzL2NvcmUuc2NzcyIsIi4vY2xpZW50L3Nhc3MvbWFpbi5zY3NzIl0sCiJmaWxlIjogIm1hcC1maWxlLWNvbW1lbnQuY3NzIgp9 */ diff --git a/node_modules/convert-source-map/test/fixtures/map-file-comment.css b/node_modules/convert-source-map/test/fixtures/map-file-comment.css new file mode 100644 index 000000000..8b282680a --- /dev/null +++ b/node_modules/convert-source-map/test/fixtures/map-file-comment.css @@ -0,0 +1,14 @@ +.header { + background: #444; + border: solid; + padding: 10px; + border-radius: 10px 5px 10px 5px; + color: #b4b472; } + +#main li { + color: green; + margin: 10px; + padding: 10px; + font-size: 18px; } + +/*# sourceMappingURL=map-file-comment.css.map */ diff --git a/node_modules/convert-source-map/test/fixtures/map-file-comment.css.map b/node_modules/convert-source-map/test/fixtures/map-file-comment.css.map new file mode 100644 index 000000000..25950ea24 --- /dev/null +++ b/node_modules/convert-source-map/test/fixtures/map-file-comment.css.map @@ -0,0 +1,6 @@ +{ +"version": "3", +"mappings": "AAAA,wBAAyB;EACvB,UAAU,EAAE,IAAI;EAChB,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,IAAI;EACb,aAAa,EAAE,iBAAiB;EAChC,KAAK,EAAE,OAAkB;;AAG3B,wBAAyB;EACvB,OAAO,EAAE,IAAI;;ACTf,gBAAiB;EACf,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,MAAM;;AAGf,kBAAmB;EACjB,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,UAAU,EAAE,KAAK;EACjB,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,KAAK;;AAEd,kBAAmB;EACjB,KAAK,EAAE,KAAK;;AAGd,mBAAoB;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,SAAS,EAAE,IAAI", +"sources": ["./client/sass/core.scss","./client/sass/main.scss"], +"file": "map-file-comment.css" +} diff --git a/node_modules/convert-source-map/test/map-file-comment.js b/node_modules/convert-source-map/test/map-file-comment.js new file mode 100644 index 000000000..b41678777 --- /dev/null +++ b/node_modules/convert-source-map/test/map-file-comment.js @@ -0,0 +1,70 @@ +'use strict'; +/*jshint asi: true */ + +var test = require('tap').test + , rx = require('..') + , fs = require('fs') + , convert = require('..') + +test('\nresolving a "/*# sourceMappingURL=map-file-comment.css.map*/" style comment inside a given css content', function (t) { + var css = fs.readFileSync(__dirname + '/fixtures/map-file-comment.css', 'utf8') + var conv = convert.fromMapFileSource(css, __dirname + '/fixtures'); + var sm = conv.toObject(); + + t.deepEqual( + sm.sources + , [ './client/sass/core.scss', + './client/sass/main.scss' ] + , 'resolves paths of original sources' + ) + + t.equal(sm.file, 'map-file-comment.css', 'includes filename of generated file') + t.equal( + sm.mappings + , 'AAAA,wBAAyB;EACvB,UAAU,EAAE,IAAI;EAChB,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,IAAI;EACb,aAAa,EAAE,iBAAiB;EAChC,KAAK,EAAE,OAAkB;;AAG3B,wBAAyB;EACvB,OAAO,EAAE,IAAI;;ACTf,gBAAiB;EACf,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,MAAM;;AAGf,kBAAmB;EACjB,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,UAAU,EAAE,KAAK;EACjB,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,KAAK;;AAEd,kBAAmB;EACjB,KAAK,EAAE,KAAK;;AAGd,mBAAoB;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,SAAS,EAAE,IAAI' + , 'includes mappings' + ) + t.end() +}) + +test('\nresolving a "//# sourceMappingURL=map-file-comment.css.map" style comment inside a given css content', function (t) { + var css = fs.readFileSync(__dirname + '/fixtures/map-file-comment-double-slash.css', 'utf8') + var conv = convert.fromMapFileSource(css, __dirname + '/fixtures'); + var sm = conv.toObject(); + + t.deepEqual( + sm.sources + , [ './client/sass/core.scss', + './client/sass/main.scss' ] + , 'resolves paths of original sources' + ) + + t.equal(sm.file, 'map-file-comment.css', 'includes filename of generated file') + t.equal( + sm.mappings + , 'AAAA,wBAAyB;EACvB,UAAU,EAAE,IAAI;EAChB,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,IAAI;EACb,aAAa,EAAE,iBAAiB;EAChC,KAAK,EAAE,OAAkB;;AAG3B,wBAAyB;EACvB,OAAO,EAAE,IAAI;;ACTf,gBAAiB;EACf,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,MAAM;;AAGf,kBAAmB;EACjB,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,UAAU,EAAE,KAAK;EACjB,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,KAAK;;AAEd,kBAAmB;EACjB,KAAK,EAAE,KAAK;;AAGd,mBAAoB;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,SAAS,EAAE,IAAI' + , 'includes mappings' + ) + t.end() +}) + +test('\nresolving a /*# sourceMappingURL=data:application/json;base64,... */ style comment inside a given css content', function(t) { + var css = fs.readFileSync(__dirname + '/fixtures/map-file-comment-inline.css', 'utf8') + var conv = convert.fromSource(css, __dirname + '/fixtures') + var sm = conv.toObject() + + t.deepEqual( + sm.sources + , [ './client/sass/core.scss', + './client/sass/main.scss' ] + , 'resolves paths of original sources' + ) + + t.equal(sm.file, 'map-file-comment.css', 'includes filename of generated file') + t.equal( + sm.mappings + , 'AAAA,wBAAyB;EACvB,UAAU,EAAE,IAAI;EAChB,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,IAAI;EACb,aAAa,EAAE,iBAAiB;EAChC,KAAK,EAAE,OAAkB;;AAG3B,wBAAyB;EACvB,OAAO,EAAE,IAAI;;ACTf,gBAAiB;EACf,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,MAAM;;AAGf,kBAAmB;EACjB,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,UAAU,EAAE,KAAK;EACjB,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,KAAK;;AAEd,kBAAmB;EACjB,KAAK,EAAE,KAAK;;AAGd,mBAAoB;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,SAAS,EAAE,IAAI' + , 'includes mappings' + ) + t.end() +}) diff --git a/node_modules/copy-descriptor/LICENSE b/node_modules/copy-descriptor/LICENSE new file mode 100644 index 000000000..652517172 --- /dev/null +++ b/node_modules/copy-descriptor/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2016, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/copy-descriptor/index.js b/node_modules/copy-descriptor/index.js new file mode 100644 index 000000000..6da21b1b0 --- /dev/null +++ b/node_modules/copy-descriptor/index.js @@ -0,0 +1,81 @@ +/*! + * copy-descriptor + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +/** + * Copy a descriptor from one object to another. + * + * ```js + * function App() { + * this.cache = {}; + * } + * App.prototype.set = function(key, val) { + * this.cache[key] = val; + * return this; + * }; + * Object.defineProperty(App.prototype, 'count', { + * get: function() { + * return Object.keys(this.cache).length; + * } + * }); + * + * copy(App.prototype, 'count', 'len'); + * + * // create an instance + * var app = new App(); + * + * app.set('a', true); + * app.set('b', true); + * app.set('c', true); + * + * console.log(app.count); + * //=> 3 + * console.log(app.len); + * //=> 3 + * ``` + * @name copy + * @param {Object} `receiver` The target object + * @param {Object} `provider` The provider object + * @param {String} `from` The key to copy on provider. + * @param {String} `to` Optionally specify a new key name to use. + * @return {Object} + * @api public + */ + +module.exports = function copyDescriptor(receiver, provider, from, to) { + if (!isObject(provider) && typeof provider !== 'function') { + to = from; + from = provider; + provider = receiver; + } + if (!isObject(receiver) && typeof receiver !== 'function') { + throw new TypeError('expected the first argument to be an object'); + } + if (!isObject(provider) && typeof provider !== 'function') { + throw new TypeError('expected provider to be an object'); + } + + if (typeof to !== 'string') { + to = from; + } + if (typeof from !== 'string') { + throw new TypeError('expected key to be a string'); + } + + if (!(from in provider)) { + throw new Error('property "' + from + '" does not exist'); + } + + var val = Object.getOwnPropertyDescriptor(provider, from); + if (val) Object.defineProperty(receiver, to, val); +}; + +function isObject(val) { + return {}.toString.call(val) === '[object Object]'; +} + diff --git a/node_modules/copy-descriptor/package.json b/node_modules/copy-descriptor/package.json new file mode 100644 index 000000000..7d4fc0298 --- /dev/null +++ b/node_modules/copy-descriptor/package.json @@ -0,0 +1,87 @@ +{ + "_from": "copy-descriptor@^0.1.0", + "_id": "copy-descriptor@0.1.1", + "_inBundle": false, + "_integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "_location": "/copy-descriptor", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "copy-descriptor@^0.1.0", + "name": "copy-descriptor", + "escapedName": "copy-descriptor", + "rawSpec": "^0.1.0", + "saveSpec": null, + "fetchSpec": "^0.1.0" + }, + "_requiredBy": [ + "/object-copy" + ], + "_resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "_shasum": "676f6eb3c39997c2ee1ac3a924fd6124748f578d", + "_spec": "copy-descriptor@^0.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/object-copy", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/copy-descriptor/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Copy a descriptor from object A to object B", + "devDependencies": { + "gulp-format-md": "^0.1.9", + "mocha": "^2.5.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/copy-descriptor", + "keywords": [ + "copy", + "descriptor" + ], + "license": "MIT", + "main": "index.js", + "name": "copy-descriptor", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/copy-descriptor.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "is-accessor-descriptor", + "is-data-descriptor", + "is-descriptor", + "is-plain-object", + "isobject" + ] + }, + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb-readme-generator", + "verb" + ] + }, + "version": "0.1.1" +} diff --git a/node_modules/core-js/CHANGELOG.md b/node_modules/core-js/CHANGELOG.md new file mode 100644 index 000000000..382c3c2d5 --- /dev/null +++ b/node_modules/core-js/CHANGELOG.md @@ -0,0 +1,667 @@ +## Changelog +##### 2.5.7 - 2018.05.26 +- Get rid of reserved variable name `final`, related [#400](https://github.com/zloirock/core-js/issues/400) + +##### 2.5.6 - 2018.05.07 +- Forced replace native `Promise` in V8 6.6 (Node 10 and Chrome 66) because of [a bug with resolving custom thenables](https://bugs.chromium.org/p/chromium/issues/detail?id=830565) +- Added a workaround for usage buggy native LG WebOS 2 `Promise` in microtask implementation, [#396](https://github.com/zloirock/core-js/issues/396) +- Added modern version internal debugging information about used versions + +##### 2.5.5 - 2018.04.08 +- Fix some edge cases of `Reflect.set`, [#392](https://github.com/zloirock/core-js/issues/392) and [#393](https://github.com/zloirock/core-js/issues/393) + +##### 2.5.4 - 2018.03.27 +- Fixed one case of deoptimization built-in iterators in V8, related [#377](https://github.com/zloirock/core-js/issues/377) +- Fixed some cases of iterators feature detection, [#368](https://github.com/zloirock/core-js/issues/368) +- Fixed manually entered NodeJS domains issue in `Promise`, [#367](https://github.com/zloirock/core-js/issues/367) +- Fixed `Number.{parseInt, parseFloat}` entry points +- Fixed `__(define|lookup)[GS]etter__` import in the `library` version + +##### 2.5.3 - 2017.12.12 +- Fixed calling `onunhandledrejectionhandler` multiple times for one `Promise` chain, [#318](https://github.com/zloirock/core-js/issues/318) +- Forced replacement of `String#{padStart, padEnd}` in Safari 10 because of [a bug](https://bugs.webkit.org/show_bug.cgi?id=161944), [#280](https://github.com/zloirock/core-js/issues/280) +- Fixed `Array#@@iterator` in a very rare version of `WebKit`, [#236](https://github.com/zloirock/core-js/issues/236) and [#237](https://github.com/zloirock/core-js/issues/237) +- One more [#345](https://github.com/zloirock/core-js/issues/345)-related fix + +##### 2.5.2 - 2017.12.09 +- `MutationObserver` no longer used for microtask implementation in iOS Safari because of bug with scrolling, [#339](https://github.com/zloirock/core-js/issues/339) +- Fixed `JSON.stringify(undefined, replacer)` case in the wrapper from the `Symbol` polyfill, [#345](https://github.com/zloirock/core-js/issues/345) +- `Array()` calls changed to `new Array()` for V8 optimisation + +##### 2.5.1 - 2017.09.01 +- Updated `Promise#finally` per [tc39/proposal-promise-finally#37](https://github.com/tc39/proposal-promise-finally/issues/37) +- Optimized usage of some internal helpers for reducing size of `shim` version +- Fixed some entry points for virtual methods + +##### 2.5.0 - 2017.08.05 +- Added `Promise#finally` [stage 3 proposal](https://github.com/tc39/proposal-promise-finally), [#225](https://github.com/zloirock/core-js/issues/225) +- Added `Promise.try` [stage 1 proposal](https://github.com/tc39/proposal-promise-try) +- Added `Array#flatten` and `Array#flatMap` [stage 1 proposal](https://tc39.github.io/proposal-flatMap) +- Added `.of` and `.from` methods on collection constructors [stage 1 proposal](https://github.com/tc39/proposal-setmap-offrom): + - `Map.of` + - `Set.of` + - `WeakSet.of` + - `WeakMap.of` + - `Map.from` + - `Set.from` + - `WeakSet.from` + - `WeakMap.from` +- Added `Math` extensions [stage 1 proposal](https://github.com/rwaldron/proposal-math-extensions), [#226](https://github.com/zloirock/core-js/issues/226): + - `Math.clamp` + - `Math.DEG_PER_RAD` + - `Math.degrees` + - `Math.fscale` + - `Math.RAD_PER_DEG` + - `Math.radians` + - `Math.scale` +- Added `Math.signbit` [stage 1 proposal](http://jfbastien.github.io/papers/Math.signbit.html) +- Updated `global` [stage 3 proposal](https://github.com/tc39/proposal-global) - added `global` global object, `System.global` deprecated +- Updated `Object.getOwnPropertyDescriptors` to the [final version](https://tc39.github.io/ecma262/2017/#sec-object.getownpropertydescriptors) - it should not create properties if descriptors are `undefined` +- Updated the list of iterable DOM collections, [#249](https://github.com/zloirock/core-js/issues/249), added: + - `CSSStyleDeclaration#@@iterator` + - `CSSValueList#@@iterator` + - `ClientRectList#@@iterator` + - `DOMRectList#@@iterator` + - `DOMStringList#@@iterator` + - `DataTransferItemList#@@iterator` + - `FileList#@@iterator` + - `HTMLAllCollection#@@iterator` + - `HTMLCollection#@@iterator` + - `HTMLFormElement#@@iterator` + - `HTMLSelectElement#@@iterator` + - `MimeTypeArray#@@iterator` + - `NamedNodeMap#@@iterator` + - `PaintRequestList#@@iterator` + - `Plugin#@@iterator` + - `PluginArray#@@iterator` + - `SVGLengthList#@@iterator` + - `SVGNumberList#@@iterator` + - `SVGPathSegList#@@iterator` + - `SVGPointList#@@iterator` + - `SVGStringList#@@iterator` + - `SVGTransformList#@@iterator` + - `SourceBufferList#@@iterator` + - `TextTrackCueList#@@iterator` + - `TextTrackList#@@iterator` + - `TouchList#@@iterator` +- Updated stages of proposals: + - [`Object.getOwnPropertyDescriptors`](https://github.com/tc39/proposal-object-getownpropertydescriptors) to [stage 4 (ES2017)](https://tc39.github.io/ecma262/2017/#sec-object.getownpropertydescriptors) + - [String padding](https://github.com/tc39/proposal-string-pad-start-end) to [stage 4 (ES2017)](https://tc39.github.io/ecma262/2017/#sec-string.prototype.padend) + - [`global`](https://github.com/tc39/proposal-global) to [stage 3](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-09/sept-28.md#revisit-systemglobal--global) + - [String trimming](https://github.com/tc39/proposal-string-left-right-trim) to [stage 2](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-07/jul-27.md#10iic-trimstarttrimend) +- Updated typed arrays to the modern (ES2016+) arguments validation, +[#293](https://github.com/zloirock/core-js/pull/293) +- Fixed `%TypedArray%.from` Safari bug, [#285](https://github.com/zloirock/core-js/issues/285) +- Fixed compatibility with old version of Prototype.js, [#278](https://github.com/zloirock/core-js/issues/278), [#289](https://github.com/zloirock/core-js/issues/289) +- `Function#name` no longer cache the result for correct behaviour with inherited constructors, [#296](https://github.com/zloirock/core-js/issues/296) +- Added errors on incorrect context of collection methods, [#272](https://github.com/zloirock/core-js/issues/272) +- Fixed conversion typed array constructors to string, fix [#300](https://github.com/zloirock/core-js/issues/300) +- Fixed `Set#size` with debugger ReactNative for Android, [#297](https://github.com/zloirock/core-js/issues/297) +- Fixed an issue with Electron-based debugger, [#230](https://github.com/zloirock/core-js/issues/230) +- Fixed compatibility with incomplete third-party `WeakMap` polyfills, [#252](https://github.com/zloirock/core-js/pull/252) +- Added a fallback for `Date#toJSON` in engines without native `Date#toISOString`, [#220](https://github.com/zloirock/core-js/issues/220) +- Added support for Sphere Dispatch API, [#286](https://github.com/zloirock/core-js/pull/286) +- Seriously changed the coding style and the [ESLint config](https://github.com/zloirock/core-js/blob/master/.eslintrc.js) +- Updated many dev dependencies (`webpack`, `uglify`, etc) +- Some other minor fixes and optimizations + +##### 2.4.1 - 2016.07.18 +- Fixed `script` tag for some parsers, [#204](https://github.com/zloirock/core-js/issues/204), [#216](https://github.com/zloirock/core-js/issues/216) +- Removed some unused variables, [#217](https://github.com/zloirock/core-js/issues/217), [#218](https://github.com/zloirock/core-js/issues/218) +- Fixed MS Edge `Reflect.construct` and `Reflect.apply` - they should not allow primitive as `argumentsList` argument + +##### 1.2.7 [LEGACY] - 2016.07.18 +- Some fixes for issues like [#159](https://github.com/zloirock/core-js/issues/159), [#186](https://github.com/zloirock/core-js/issues/186), [#194](https://github.com/zloirock/core-js/issues/194), [#207](https://github.com/zloirock/core-js/issues/207) + +##### 2.4.0 - 2016.05.08 +- Added `Observable`, [stage 1 proposal](https://github.com/zenparsing/es-observable) +- Fixed behavior `Object.{getOwnPropertySymbols, getOwnPropertyDescriptor}` and `Object#propertyIsEnumerable` on `Object.prototype` +- `Reflect.construct` and `Reflect.apply` should throw an error if `argumentsList` argument is not an object, [#194](https://github.com/zloirock/core-js/issues/194) + +##### 2.3.0 - 2016.04.24 +- Added `asap` for enqueuing microtasks, [stage 0 proposal](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask) +- Added well-known symbol `Symbol.asyncIterator` for [stage 2 async iteration proposal](https://github.com/tc39/proposal-async-iteration) +- Added well-known symbol `Symbol.observable` for [stage 1 observables proposal](https://github.com/zenparsing/es-observable) +- `String#{padStart, padEnd}` returns original string if filler is empty string, [TC39 meeting notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-03/march-29.md#stringprototypepadstartpadend) +- `Object.values` and `Object.entries` moved to stage 4 from 3, [TC39 meeting notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-03/march-29.md#objectvalues--objectentries) +- `System.global` moved to stage 2 from 1, [TC39 meeting notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-03/march-29.md#systemglobal) +- `Map#toJSON` and `Set#toJSON` rejected and will be removed from the next major release, [TC39 meeting notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-03/march-31.md#mapprototypetojsonsetprototypetojson) +- `Error.isError` withdrawn and will be removed from the next major release, [TC39 meeting notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-03/march-29.md#erroriserror) +- Added fallback for `Function#name` on non-extensible functions and functions with broken `toString` conversion, [#193](https://github.com/zloirock/core-js/issues/193) + +##### 2.2.2 - 2016.04.06 +- Added conversion `-0` to `+0` to `Array#{indexOf, lastIndexOf}`, [ES2016 fix](https://github.com/tc39/ecma262/pull/316) +- Added fixes for some `Math` methods in Tor Browser +- `Array.{from, of}` no longer calls prototype setters +- Added workaround over Chrome DevTools strange behavior, [#186](https://github.com/zloirock/core-js/issues/186) + +##### 2.2.1 - 2016.03.19 +- Fixed `Object.getOwnPropertyNames(window)` `2.1+` versions bug, [#181](https://github.com/zloirock/core-js/issues/181) + +##### 2.2.0 - 2016.03.15 +- Added `String#matchAll`, [proposal](https://github.com/tc39/String.prototype.matchAll) +- Added `Object#__(define|lookup)[GS]etter__`, [annex B ES2017](https://github.com/tc39/ecma262/pull/381) +- Added `@@toPrimitive` methods to `Date` and `Symbol` +- Fixed `%TypedArray%#slice` in Edge ~ 13 (throws with `@@species` and wrapped / inherited constructor) +- Some other minor fixes + +##### 2.1.5 - 2016.03.12 +- Improved support NodeJS domains in `Promise#then`, [#180](https://github.com/zloirock/core-js/issues/180) +- Added fallback for `Date#toJSON` bug in Qt Script, [#173](https://github.com/zloirock/core-js/issues/173#issuecomment-193972502) + +##### 2.1.4 - 2016.03.08 +- Added fallback for `Symbol` polyfill in Qt Script, [#173](https://github.com/zloirock/core-js/issues/173) +- Added one more fallback for IE11 `Script Access Denied` error with iframes, [#165](https://github.com/zloirock/core-js/issues/165) + +##### 2.1.3 - 2016.02.29 +- Added fallback for [`es6-promise` package bug](https://github.com/stefanpenner/es6-promise/issues/169), [#176](https://github.com/zloirock/core-js/issues/176) + +##### 2.1.2 - 2016.02.29 +- Some minor `Promise` fixes: + - Browsers `rejectionhandled` event better HTML spec complaint + - Errors in unhandled rejection handlers should not cause any problems + - Fixed typo in feature detection + +##### 2.1.1 - 2016.02.22 +- Some `Promise` improvements: + - Feature detection: + - **Added detection unhandled rejection tracking support - now it's available everywhere**, [#140](https://github.com/zloirock/core-js/issues/140) + - Added detection `@@species` pattern support for completely correct subclassing + - Removed usage `Object.setPrototypeOf` from feature detection and noisy console message about it in FF + - `Promise.all` fixed for some very specific cases + +##### 2.1.0 - 2016.02.09 +- **API**: + - ES5 polyfills are split and logic, used in other polyfills, moved to internal modules + - **All entry point works in ES3 environment like IE8- without `core-js/(library/)es5`** + - **Added all missed single entry points for ES5 polyfills** + - Separated ES5 polyfills moved to the ES6 namespace. Why? + - Mainly, for prevent duplication features in different namespaces - logic of most required ES5 polyfills changed in ES6+: + - Already added changes for: `Object` statics - should accept primitives, new whitespaces lists in `String#trim`, `parse(Int|float)`, `RegExp#toString` logic, `String#split`, etc + - Should be changed in the future: `@@species` and `ToLength` logic in `Array` methods, `Date` parsing, `Function#bind`, etc + - Should not be changed only several features like `Array.isArray` and `Date.now` + - Some ES5 polyfills required for modern engines + - All old entry points should work fine, but in the next major release API can be changed + - `Object.getOwnPropertyDescriptors` moved to the stage 3, [January TC39 meeting](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-01/2016-01-28.md#objectgetownpropertydescriptors-to-stage-3-jordan-harband-low-priority-but-super-quick) + - Added `umd` option for [custom build process](https://github.com/zloirock/core-js#custom-build-from-external-scripts), [#169](https://github.com/zloirock/core-js/issues/169) + - Returned entry points for `Array` statics, removed in `2.0`, for compatibility with `babel` `6` and for future fixes +- **Deprecated**: + - `Reflect.enumerate` deprecated and will be removed from the next major release, [January TC39 meeting](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-01/2016-01-28.md#5xix-revisit-proxy-enumerate---revisit-decision-to-exhaust-iterator) +- **New Features**: + - Added [`Reflect` metadata API](https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md) as a pre-strawman feature, [#152](https://github.com/zloirock/core-js/issues/152): + - `Reflect.defineMetadata` + - `Reflect.deleteMetadata` + - `Reflect.getMetadata` + - `Reflect.getMetadataKeys` + - `Reflect.getOwnMetadata` + - `Reflect.getOwnMetadataKeys` + - `Reflect.hasMetadata` + - `Reflect.hasOwnMetadata` + - `Reflect.metadata` + - Implementation / fixes `Date#toJSON` + - Fixes for `parseInt` and `Number.parseInt` + - Fixes for `parseFloat` and `Number.parseFloat` + - Fixes for `RegExp#toString` + - Fixes for `Array#sort` + - Fixes for `Number#toFixed` + - Fixes for `Number#toPrecision` + - Additional fixes for `String#split` (`RegExp#@@split`) +- **Improvements**: + - Correct subclassing wrapped collections, `Number` and `RegExp` constructors with native class syntax + - Correct support `SharedArrayBuffer` and buffers from other realms in typed arrays wrappers + - Additional validations for `Object.{defineProperty, getOwnPropertyDescriptor}` and `Reflect.defineProperty` +- **Bug Fixes**: + - Fixed some cases `Array#lastIndexOf` with negative second argument + +##### 2.0.3 - 2016.01.11 +- Added fallback for V8 ~ Chrome 49 `Promise` subclassing bug causes unhandled rejection on feature detection, [#159](https://github.com/zloirock/core-js/issues/159) +- Added fix for very specific environments with global `window === null` + +##### 2.0.2 - 2016.01.04 +- Temporarily removed `length` validation from `Uint8Array` constructor wrapper. Reason - [bug in `ws` module](https://github.com/websockets/ws/pull/645) (-> `socket.io`) which passes to `Buffer` constructor -> `Uint8Array` float and uses [the `V8` bug](https://code.google.com/p/v8/issues/detail?id=4552) for conversion to int (by the spec should be thrown an error). [It creates problems for many people.](https://github.com/karma-runner/karma/issues/1768) I hope, it will be returned after fixing this bug in `V8`. + +##### 2.0.1 - 2015.12.31 +- Forced usage `Promise.resolve` polyfill in the `library` version for correct work with wrapper +- `Object.assign` should be defined in the strict mode -> throw an error on extension non-extensible objects, [#154](https://github.com/zloirock/core-js/issues/154) + +##### 2.0.0 - 2015.12.24 +- Added implementations and fixes [Typed Arrays](https://github.com/zloirock/core-js#ecmascript-6-typed-arrays)-related features + - `ArrayBuffer`, `ArrayBuffer.isView`, `ArrayBuffer#slice` + - `DataView` with all getter / setter methods + - `Int8Array`, `Uint8Array`, `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, `Int32Array`, `Uint32Array`, `Float32Array` and `Float64Array` constructors + - `%TypedArray%.{for, of}`, `%TypedArray%#{copyWithin, every, fill, filter, find, findIndex, forEach, indexOf, includes, join, lastIndexOf, map, reduce, reduceRight, reverse, set, slice, some, sort, subarray, values, keys, entries, @@iterator, ...}` +- Added [`System.global`](https://github.com/zloirock/core-js#ecmascript-7-proposals), [proposal](https://github.com/tc39/proposal-global), [November TC39 meeting](https://github.com/rwaldron/tc39-notes/tree/master/es7/2015-11/nov-19.md#systemglobal-jhd) +- Added [`Error.isError`](https://github.com/zloirock/core-js#ecmascript-7-proposals), [proposal](https://github.com/ljharb/proposal-is-error), [November TC39 meeting](https://github.com/rwaldron/tc39-notes/tree/master/es7/2015-11/nov-19.md#jhd-erroriserror) +- Added [`Math.{iaddh, isubh, imulh, umulh}`](https://github.com/zloirock/core-js#ecmascript-7-proposals), [proposal](https://gist.github.com/BrendanEich/4294d5c212a6d2254703) +- `RegExp.escape` moved from the `es7` to the non-standard `core` namespace, [July TC39 meeting](https://github.com/rwaldron/tc39-notes/blob/master/es7/2015-07/july-28.md#62-regexpescape) - too slow, but it's condition of stability, [#116](https://github.com/zloirock/core-js/issues/116) +- [`Promise`](https://github.com/zloirock/core-js#ecmascript-6-promise) + - Some performance optimisations + - Added basic support [`rejectionHandled` event / `onrejectionhandled` handler](https://github.com/zloirock/core-js#unhandled-rejection-tracking) to the polyfill + - Removed usage `@@species` from `Promise.{all, race}`, [November TC39 meeting](https://github.com/rwaldron/tc39-notes/tree/master/es7/2015-11/nov-18.md#conclusionresolution-2) +- Some improvements [collections polyfills](https://github.com/zloirock/core-js#ecmascript-6-collections) + - `O(1)` and preventing possible leaks with frozen keys, [#134](https://github.com/zloirock/core-js/issues/134) + - Correct observable state object keys +- Renamed `String#{padLeft, padRight}` -> [`String#{padStart, padEnd}`](https://github.com/zloirock/core-js#ecmascript-7-proposals), [proposal](https://github.com/tc39/proposal-string-pad-start-end), [November TC39 meeting](https://github.com/rwaldron/tc39-notes/tree/master/es7/2015-11/nov-17.md#conclusionresolution-2) (they want to rename it on each meeting?O_o), [#132](https://github.com/zloirock/core-js/issues/132) +- Added [`String#{trimStart, trimEnd}` as aliases for `String#{trimLeft, trimRight}`](https://github.com/zloirock/core-js#ecmascript-7-proposals), [proposal](https://github.com/sebmarkbage/ecmascript-string-left-right-trim), [November TC39 meeting](https://github.com/rwaldron/tc39-notes/tree/master/es7/2015-11/nov-17.md#conclusionresolution-2) +- Added [annex B HTML methods](https://github.com/zloirock/core-js#ecmascript-6-string) - ugly, but also [the part of the spec](http://www.ecma-international.org/ecma-262/6.0/#sec-string.prototype.anchor) +- Added little fix for [`Date#toString`](https://github.com/zloirock/core-js#ecmascript-6-date) - `new Date(NaN).toString()` [should be `'Invalid Date'`](http://www.ecma-international.org/ecma-262/6.0/#sec-todatestring) +- Added [`{keys, values, entries, @@iterator}` methods to DOM collections](https://github.com/zloirock/core-js#iterable-dom-collections) which should have [iterable interface](https://heycam.github.io/webidl/#idl-iterable) or should be [inherited from `Array`](https://heycam.github.io/webidl/#LegacyArrayClass) - `NodeList`, `DOMTokenList`, `MediaList`, `StyleSheetList`, `CSSRuleList`. +- Removed Mozilla `Array` generics - [deprecated and will be removed from FF](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#Array_generic_methods), [looks like strawman is dead](http://wiki.ecmascript.org/doku.php?id=strawman:array_statics), available [alternative shim](https://github.com/plusdude/array-generics) +- Removed `core.log` module +- CommonJS API + - Added entry points for [virtual methods](https://github.com/zloirock/core-js#commonjs-and-prototype-methods-without-global-namespace-pollution) + - Added entry points for [stages proposals](https://github.com/zloirock/core-js#ecmascript-7-proposals) + - Some other minor changes +- [Custom build from external scripts](https://github.com/zloirock/core-js#custom-build-from-external-scripts) moved to the separate package for preventing problems with dependencies +- Changed `$` prefix for internal modules file names because Team Foundation Server does not support it, [#129](https://github.com/zloirock/core-js/issues/129) +- Additional fix for `SameValueZero` in V8 ~ Chromium 39-42 collections +- Additional fix for FF27 `Array` iterator +- Removed usage shortcuts for `arguments` object - old WebKit bug, [#150](https://github.com/zloirock/core-js/issues/150) +- `{Map, Set}#forEach` non-generic, [#144](https://github.com/zloirock/core-js/issues/144) +- Many other improvements + +##### 1.2.6 - 2015.11.09 +* Reject with `TypeError` on attempt resolve promise itself +* Correct behavior with broken `Promise` subclass constructors / methods +* Added `Promise`-based fallback for microtask +* Fixed V8 and FF `Array#{values, @@iterator}.name` +* Fixed IE7- `[1, 2].join(undefined) -> '1,2'` +* Some other fixes / improvements / optimizations + +##### 1.2.5 - 2015.11.02 +* Some more `Number` constructor fixes: + * Fixed V8 ~ Node 0.8 bug: `Number('+0x1')` should be `NaN` + * Fixed `Number(' 0b1\n')` case, should be `1` + * Fixed `Number()` case, should be `0` + +##### 1.2.4 - 2015.11.01 +* Fixed `Number('0b12') -> NaN` case in the shim +* Fixed V8 ~ Chromium 40- bug - `Weak(Map|Set)#{delete, get, has}` should not throw errors [#124](https://github.com/zloirock/core-js/issues/124) +* Some other fixes and optimizations + +##### 1.2.3 - 2015.10.23 +* Fixed some problems related old V8 bug `Object('a').propertyIsEnumerable(0) // => false`, for example, `Object.assign({}, 'qwe')` from the last release +* Fixed `.name` property and `Function#toString` conversion some polyfilled methods +* Fixed `Math.imul` arity in Safari 8- + +##### 1.2.2 - 2015.10.18 +* Improved optimisations for V8 +* Fixed build process from external packages, [#120](https://github.com/zloirock/core-js/pull/120) +* One more `Object.{assign, values, entries}` fix for [**very** specific case](https://github.com/ljharb/proposal-object-values-entries/issues/5) + +##### 1.2.1 - 2015.10.02 +* Replaced fix `JSON.stringify` + `Symbol` behavior from `.toJSON` method to wrapping `JSON.stringify` - little more correct, [compat-table/642](https://github.com/kangax/compat-table/pull/642) +* Fixed typo which broke tasks scheduler in WebWorkers in old FF, [#114](https://github.com/zloirock/core-js/pull/114) + +##### 1.2.0 - 2015.09.27 +* Added browser [`Promise` rejection hook](#unhandled-rejection-tracking), [#106](https://github.com/zloirock/core-js/issues/106) +* Added correct [`IsRegExp`](http://www.ecma-international.org/ecma-262/6.0/#sec-isregexp) logic to [`String#{includes, startsWith, endsWith}`](https://github.com/zloirock/core-js/#ecmascript-6-string) and [`RegExp` constructor](https://github.com/zloirock/core-js/#ecmascript-6-regexp), `@@match` case, [example](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/match#Disabling_the_isRegExp_check) +* Updated [`String#leftPad`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) [with proposal](https://github.com/ljharb/proposal-string-pad-left-right/issues/6): string filler truncated from the right side +* Replaced V8 [`Object.assign`](https://github.com/zloirock/core-js/#ecmascript-6-object) - its properties order not only [incorrect](https://github.com/sindresorhus/object-assign/issues/22), it is non-deterministic and it causes some problems +* Fixed behavior with deleted in getters properties for `Object.{`[`assign`](https://github.com/zloirock/core-js/#ecmascript-6-object)`, `[`entries, values`](https://github.com/zloirock/core-js/#ecmascript-7-proposals)`}`, [example](http://goo.gl/iQE01c) +* Fixed [`Math.sinh`](https://github.com/zloirock/core-js/#ecmascript-6-math) with very small numbers in V8 near Chromium 38 +* Some other fixes and optimizations + +##### 1.1.4 - 2015.09.05 +* Fixed support symbols in FF34-35 [`Object.assign`](https://github.com/zloirock/core-js/#ecmascript-6-object) +* Fixed [collections iterators](https://github.com/zloirock/core-js/#ecmascript-6-iterators) in FF25-26 +* Fixed non-generic WebKit [`Array.of`](https://github.com/zloirock/core-js/#ecmascript-6-array) +* Some other fixes and optimizations + +##### 1.1.3 - 2015.08.29 +* Fixed support Node.js domains in [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise), [#103](https://github.com/zloirock/core-js/issues/103) + +##### 1.1.2 - 2015.08.28 +* Added `toJSON` method to [`Symbol`](https://github.com/zloirock/core-js/#ecmascript-6-symbol) polyfill and to MS Edge implementation for expected `JSON.stringify` result w/o patching this method +* Replaced [`Reflect.construct`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) implementations w/o correct support third argument +* Fixed `global` detection with changed `document.domain` in ~IE8, [#100](https://github.com/zloirock/core-js/issues/100) + +##### 1.1.1 - 2015.08.20 +* Added more correct microtask implementation for [`Promise`](#ecmascript-6-promise) + +##### 1.1.0 - 2015.08.17 +* Updated [string padding](https://github.com/zloirock/core-js/#ecmascript-7-proposals) to [actual proposal](https://github.com/ljharb/proposal-string-pad-left-right) - renamed, minor internal changes: + * `String#lpad` -> `String#padLeft` + * `String#rpad` -> `String#padRight` +* Added [string trim functions](#ecmascript-7-proposals) - [proposal](https://github.com/sebmarkbage/ecmascript-string-left-right-trim), defacto standard - required only for IE11- and fixed for some old engines: + * `String#trimLeft` + * `String#trimRight` +* [`String#trim`](https://github.com/zloirock/core-js/#ecmascript-6-string) fixed for some engines by es6 spec and moved from `es5` to single `es6` module +* Splitted [`es6.object.statics-accept-primitives`](https://github.com/zloirock/core-js/#ecmascript-6-object) +* Caps for `freeze`-family `Object` methods moved from `es5` to `es6` namespace and joined with [es6 wrappers](https://github.com/zloirock/core-js/#ecmascript-6-object) +* `es5` [namespace](https://github.com/zloirock/core-js/#commonjs) also includes modules, moved to `es6` namespace - you can use it as before +* Increased `MessageChannel` priority in `$.task`, [#95](https://github.com/zloirock/core-js/issues/95) +* Does not get `global.Symbol` on each getting iterator, if you wanna use alternative `Symbol` shim - add it before `core-js` +* [`Reflect.construct`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) optimized and fixed for some cases +* Simplified [`Reflect.enumerate`](https://github.com/zloirock/core-js/#ecmascript-6-reflect), see [this question](https://esdiscuss.org/topic/question-about-enumerate-and-property-decision-timing) +* Some corrections in [`Math.acosh`](https://github.com/zloirock/core-js/#ecmascript-6-math) +* Fixed [`Math.imul`](https://github.com/zloirock/core-js/#ecmascript-6-math) for old WebKit +* Some fixes in string / RegExp [well-known symbols](https://github.com/zloirock/core-js/#ecmascript-6-regexp) logic +* Some other fixes and optimizations + +##### 1.0.1 - 2015.07.31 +* Some fixes for final MS Edge, replaced broken native `Reflect.defineProperty` +* Some minor fixes and optimizations +* Changed compression `client/*.min.js` options for safe `Function#name` and `Function#length`, should be fixed [#92](https://github.com/zloirock/core-js/issues/92) + +##### 1.0.0 - 2015.07.22 +* Added logic for [well-known symbols](https://github.com/zloirock/core-js/#ecmascript-6-regexp): + * `Symbol.match` + * `Symbol.replace` + * `Symbol.split` + * `Symbol.search` +* Actualized and optimized work with iterables: + * Optimized [`Map`, `Set`, `WeakMap`, `WeakSet` constructors](https://github.com/zloirock/core-js/#ecmascript-6-collections), [`Promise.all`, `Promise.race`](https://github.com/zloirock/core-js/#ecmascript-6-promise) for default `Array Iterator` + * Optimized [`Array.from`](https://github.com/zloirock/core-js/#ecmascript-6-array) for default `Array Iterator` + * Added [`core.getIteratorMethod`](https://github.com/zloirock/core-js/#ecmascript-6-iterators) helper +* Uses enumerable properties in shimmed instances - collections, iterators, etc for optimize performance +* Added support native constructors to [`Reflect.construct`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) with 2 arguments +* Added support native constructors to [`Function#bind`](https://github.com/zloirock/core-js/#ecmascript-5) shim with `new` +* Removed obsolete `.clear` methods native [`Weak`-collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) +* Maximum modularity, reduced minimal custom build size, separated into submodules: + * [`es6.reflect`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) + * [`es6.regexp`](https://github.com/zloirock/core-js/#ecmascript-6-regexp) + * [`es6.math`](https://github.com/zloirock/core-js/#ecmascript-6-math) + * [`es6.number`](https://github.com/zloirock/core-js/#ecmascript-6-number) + * [`es7.object.to-array`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) + * [`core.object`](https://github.com/zloirock/core-js/#object) + * [`core.string`](https://github.com/zloirock/core-js/#escaping-strings) + * [`core.iter-helpers`](https://github.com/zloirock/core-js/#ecmascript-6-iterators) + * Internal modules (`$`, `$.iter`, etc) +* Many other optimizations +* Final cleaning non-standard features + * Moved `$for` to [separate library](https://github.com/zloirock/forof). This work for syntax - `for-of` loop and comprehensions + * Moved `Date#{format, formatUTC}` to [separate library](https://github.com/zloirock/dtf). Standard way for this - `ECMA-402` + * Removed `Math` methods from `Number.prototype`. Slight sugar for simple `Math` methods calling + * Removed `{Array#, Array, Dict}.turn` + * Removed `core.global` +* Uses `ToNumber` instead of `ToLength` in [`Number Iterator`](https://github.com/zloirock/core-js/#number-iterator), `Array.from(2.5)` will be `[0, 1, 2]` instead of `[0, 1]` +* Fixed [#85](https://github.com/zloirock/core-js/issues/85) - invalid `Promise` unhandled rejection message in nested `setTimeout` +* Fixed [#86](https://github.com/zloirock/core-js/issues/86) - support FF extensions +* Fixed [#89](https://github.com/zloirock/core-js/issues/89) - behavior `Number` constructor in strange case + +##### 0.9.18 - 2015.06.17 +* Removed `/` from [`RegExp.escape`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) escaped characters + +##### 0.9.17 - 2015.06.14 +* Updated [`RegExp.escape`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) to the [latest proposal](https://github.com/benjamingr/RexExp.escape) +* Fixed conflict with webpack dev server + IE buggy behavior + +##### 0.9.16 - 2015.06.11 +* More correct order resolving thenable in [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) polyfill +* Uses polyfill instead of [buggy V8 `Promise`](https://github.com/zloirock/core-js/issues/78) + +##### 0.9.15 - 2015.06.09 +* [Collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) from `library` version return wrapped native instances +* Fixed collections prototype methods in `library` version +* Optimized [`Math.hypot`](https://github.com/zloirock/core-js/#ecmascript-6-math) + +##### 0.9.14 - 2015.06.04 +* Updated [`Promise.resolve` behavior](https://esdiscuss.org/topic/fixing-promise-resolve) +* Added fallback for IE11 buggy `Object.getOwnPropertyNames` + iframe +* Some other fixes + +##### 0.9.13 - 2015.05.25 +* Added fallback for [`Symbol` polyfill](https://github.com/zloirock/core-js/#ecmascript-6-symbol) for old Android +* Some other fixes + +##### 0.9.12 - 2015.05.24 +* Different instances `core-js` should use / recognize the same symbols +* Some fixes + +##### 0.9.11 - 2015.05.18 +* Simplified [custom build](https://github.com/zloirock/core-js/#custom-build) + * Added custom build js api + * Added `grunt-cli` to `devDependencies` for `npm run grunt` +* Some fixes + +##### 0.9.10 - 2015.05.16 +* Wrapped `Function#toString` for correct work wrapped methods / constructors with methods similar to the [`lodash` `isNative`](https://github.com/lodash/lodash/issues/1197) +* Added proto versions of methods to export object in `default` version for consistency with `library` version + +##### 0.9.9 - 2015.05.14 +* Wrapped `Object#propertyIsEnumerable` for [`Symbol` polyfill](https://github.com/zloirock/core-js/#ecmascript-6-symbol) +* [Added proto versions of methods to `library` for ES7 bind syntax](https://github.com/zloirock/core-js/issues/65) +* Some other fixes + +##### 0.9.8 - 2015.05.12 +* Fixed [`Math.hypot`](https://github.com/zloirock/core-js/#ecmascript-6-math) with negative arguments +* Added `Object#toString.toString` as fallback for [`lodash` `isNative`](https://github.com/lodash/lodash/issues/1197) + +##### 0.9.7 - 2015.05.07 +* Added [support DOM collections](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice#Streamlining_cross-browser_behavior) to IE8- `Array#slice` + +##### 0.9.6 - 2015.05.01 +* Added [`String#lpad`, `String#rpad`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) + +##### 0.9.5 - 2015.04.30 +* Added cap for `Function#@@hasInstance` +* Some fixes and optimizations + +##### 0.9.4 - 2015.04.27 +* Fixed `RegExp` constructor + +##### 0.9.3 - 2015.04.26 +* Some fixes and optimizations + +##### 0.9.2 - 2015.04.25 +* More correct [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) unhandled rejection tracking and resolving / rejection priority + +##### 0.9.1 - 2015.04.25 +* Fixed `__proto__`-based [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) subclassing in some environments + +##### 0.9.0 - 2015.04.24 +* Added correct [symbols](https://github.com/zloirock/core-js/#ecmascript-6-symbol) descriptors + * Fixed behavior `Object.{assign, create, defineProperty, defineProperties, getOwnPropertyDescriptor, getOwnPropertyDescriptors}` with symbols + * Added [single entry points](https://github.com/zloirock/core-js/#commonjs) for `Object.{create, defineProperty, defineProperties}` +* Added [`Map#toJSON`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) +* Removed non-standard methods `Object#[_]` and `Function#only` - they solves syntax problems, but now in compilers available arrows and ~~in near future will be available~~ [available](http://babeljs.io/blog/2015/05/14/function-bind/) [bind syntax](https://github.com/zenparsing/es-function-bind) +* Removed non-standard undocumented methods `Symbol.{pure, set}` +* Some fixes and internal changes + +##### 0.8.4 - 2015.04.18 +* Uses `webpack` instead of `browserify` for browser builds - more compression-friendly result + +##### 0.8.3 - 2015.04.14 +* Fixed `Array` statics with single entry points + +##### 0.8.2 - 2015.04.13 +* [`Math.fround`](https://github.com/zloirock/core-js/#ecmascript-6-math) now also works in IE9- +* Added [`Set#toJSON`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) +* Some optimizations and fixes + +##### 0.8.1 - 2015.04.03 +* Fixed `Symbol.keyFor` + +##### 0.8.0 - 2015.04.02 +* Changed [CommonJS API](https://github.com/zloirock/core-js/#commonjs) +* Splitted and renamed some modules +* Added support ES3 environment (ES5 polyfill) to **all** default versions - size increases slightly (+ ~4kb w/o gzip), many issues disappear, if you don't need it - [simply include only required namespaces / features / modules](https://github.com/zloirock/core-js/#commonjs) +* Removed [abstract references](https://github.com/zenparsing/es-abstract-refs) support - proposal has been superseded =\ +* [`$for.isIterable` -> `core.isIterable`, `$for.getIterator` -> `core.getIterator`](https://github.com/zloirock/core-js/#ecmascript-6-iterators), temporary available in old namespace +* Fixed iterators support in v8 `Promise.all` and `Promise.race` +* Many other fixes + +##### 0.7.2 - 2015.03.09 +* Some fixes + +##### 0.7.1 - 2015.03.07 +* Some fixes + +##### 0.7.0 - 2015.03.06 +* Rewritten and splitted into [CommonJS modules](https://github.com/zloirock/core-js/#commonjs) + +##### 0.6.1 - 2015.02.24 +* Fixed support [`Object.defineProperty`](https://github.com/zloirock/core-js/#ecmascript-5) with accessors on DOM elements on IE8 + +##### 0.6.0 - 2015.02.23 +* Added support safe closing iteration - calling `iterator.return` on abort iteration, if it exists +* Added basic support [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) unhandled rejection tracking in shim +* Added [`Object.getOwnPropertyDescriptors`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) +* Removed `console` cap - creates too many problems +* Restructuring [namespaces](https://github.com/zloirock/core-js/#custom-build) +* Some fixes + +##### 0.5.4 - 2015.02.15 +* Some fixes + +##### 0.5.3 - 2015.02.14 +* Added [support binary and octal literals](https://github.com/zloirock/core-js/#ecmascript-6-number) to `Number` constructor +* Added [`Date#toISOString`](https://github.com/zloirock/core-js/#ecmascript-5) + +##### 0.5.2 - 2015.02.10 +* Some fixes + +##### 0.5.1 - 2015.02.09 +* Some fixes + +##### 0.5.0 - 2015.02.08 +* Systematization of modules +* Splitted [`es6` module](https://github.com/zloirock/core-js/#ecmascript-6) +* Splitted `console` module: `web.console` - only cap for missing methods, `core.log` - bound methods & additional features +* Added [`delay` method](https://github.com/zloirock/core-js/#delay) +* Some fixes + +##### 0.4.10 - 2015.01.28 +* [`Object.getOwnPropertySymbols`](https://github.com/zloirock/core-js/#ecmascript-6-symbol) polyfill returns array of wrapped keys + +##### 0.4.9 - 2015.01.27 +* FF20-24 fix + +##### 0.4.8 - 2015.01.25 +* Some [collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) fixes + +##### 0.4.7 - 2015.01.25 +* Added support frozen objects as [collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) keys + +##### 0.4.6 - 2015.01.21 +* Added [`Object.getOwnPropertySymbols`](https://github.com/zloirock/core-js/#ecmascript-6-symbol) +* Added [`NodeList.prototype[@@iterator]`](https://github.com/zloirock/core-js/#ecmascript-6-iterators) +* Added basic `@@species` logic - getter in native constructors +* Removed `Function#by` +* Some fixes + +##### 0.4.5 - 2015.01.16 +* Some fixes + +##### 0.4.4 - 2015.01.11 +* Enabled CSP support + +##### 0.4.3 - 2015.01.10 +* Added `Function` instances `name` property for IE9+ + +##### 0.4.2 - 2015.01.10 +* `Object` static methods accept primitives +* `RegExp` constructor can alter flags (IE9+) +* Added `Array.prototype[Symbol.unscopables]` + +##### 0.4.1 - 2015.01.05 +* Some fixes + +##### 0.4.0 - 2015.01.03 +* Added [`es6.reflect`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) module: + * Added `Reflect.apply` + * Added `Reflect.construct` + * Added `Reflect.defineProperty` + * Added `Reflect.deleteProperty` + * Added `Reflect.enumerate` + * Added `Reflect.get` + * Added `Reflect.getOwnPropertyDescriptor` + * Added `Reflect.getPrototypeOf` + * Added `Reflect.has` + * Added `Reflect.isExtensible` + * Added `Reflect.preventExtensions` + * Added `Reflect.set` + * Added `Reflect.setPrototypeOf` +* `core-js` methods now can use external `Symbol.iterator` polyfill +* Some fixes + +##### 0.3.3 - 2014.12.28 +* [Console cap](https://github.com/zloirock/core-js/#console) excluded from node.js default builds + +##### 0.3.2 - 2014.12.25 +* Added cap for [ES5](https://github.com/zloirock/core-js/#ecmascript-5) freeze-family methods +* Fixed `console` bug + +##### 0.3.1 - 2014.12.23 +* Some fixes + +##### 0.3.0 - 2014.12.23 +* Optimize [`Map` & `Set`](https://github.com/zloirock/core-js/#ecmascript-6-collections): + * Use entries chain on hash table + * Fast & correct iteration + * Iterators moved to [`es6`](https://github.com/zloirock/core-js/#ecmascript-6) and [`es6.collections`](https://github.com/zloirock/core-js/#ecmascript-6-collections) modules + +##### 0.2.5 - 2014.12.20 +* `console` no longer shortcut for `console.log` (compatibility problems) +* Some fixes + +##### 0.2.4 - 2014.12.17 +* Better compliance of ES6 +* Added [`Math.fround`](https://github.com/zloirock/core-js/#ecmascript-6-math) (IE10+) +* Some fixes + +##### 0.2.3 - 2014.12.15 +* [Symbols](https://github.com/zloirock/core-js/#ecmascript-6-symbol): + * Added option to disable addition setter to `Object.prototype` for Symbol polyfill: + * Added `Symbol.useSimple` + * Added `Symbol.useSetter` + * Added cap for well-known Symbols: + * Added `Symbol.hasInstance` + * Added `Symbol.isConcatSpreadable` + * Added `Symbol.match` + * Added `Symbol.replace` + * Added `Symbol.search` + * Added `Symbol.species` + * Added `Symbol.split` + * Added `Symbol.toPrimitive` + * Added `Symbol.unscopables` + +##### 0.2.2 - 2014.12.13 +* Added [`RegExp#flags`](https://github.com/zloirock/core-js/#ecmascript-6-regexp) ([December 2014 Draft Rev 29](http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#december_6_2014_draft_rev_29)) +* Added [`String.raw`](https://github.com/zloirock/core-js/#ecmascript-6-string) + +##### 0.2.1 - 2014.12.12 +* Repair converting -0 to +0 in [native collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) + +##### 0.2.0 - 2014.12.06 +* Added [`es7.proposals`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) and [`es7.abstract-refs`](https://github.com/zenparsing/es-abstract-refs) modules +* Added [`String#at`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) +* Added real [`String Iterator`](https://github.com/zloirock/core-js/#ecmascript-6-iterators), older versions used Array Iterator +* Added abstract references support: + * Added `Symbol.referenceGet` + * Added `Symbol.referenceSet` + * Added `Symbol.referenceDelete` + * Added `Function#@@referenceGet` + * Added `Map#@@referenceGet` + * Added `Map#@@referenceSet` + * Added `Map#@@referenceDelete` + * Added `WeakMap#@@referenceGet` + * Added `WeakMap#@@referenceSet` + * Added `WeakMap#@@referenceDelete` + * Added `Dict.{...methods}[@@referenceGet]` +* Removed deprecated `.contains` methods +* Some fixes + +##### 0.1.5 - 2014.12.01 +* Added [`Array#copyWithin`](https://github.com/zloirock/core-js/#ecmascript-6-array) +* Added [`String#codePointAt`](https://github.com/zloirock/core-js/#ecmascript-6-string) +* Added [`String.fromCodePoint`](https://github.com/zloirock/core-js/#ecmascript-6-string) + +##### 0.1.4 - 2014.11.27 +* Added [`Dict.mapPairs`](https://github.com/zloirock/core-js/#dict) + +##### 0.1.3 - 2014.11.20 +* [TC39 November meeting](https://github.com/rwaldron/tc39-notes/tree/master/es6/2014-11): + * [`.contains` -> `.includes`](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-11/nov-18.md#51--44-arrayprototypecontains-and-stringprototypecontains) + * `String#contains` -> [`String#includes`](https://github.com/zloirock/core-js/#ecmascript-6-string) + * `Array#contains` -> [`Array#includes`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) + * `Dict.contains` -> [`Dict.includes`](https://github.com/zloirock/core-js/#dict) + * [Removed `WeakMap#clear`](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-11/nov-19.md#412-should-weakmapweakset-have-a-clear-method-markm) + * [Removed `WeakSet#clear`](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-11/nov-19.md#412-should-weakmapweakset-have-a-clear-method-markm) + +##### 0.1.2 - 2014.11.19 +* `Map` & `Set` bug fix + +##### 0.1.1 - 2014.11.18 +* Public release \ No newline at end of file diff --git a/node_modules/core-js/Gruntfile.js b/node_modules/core-js/Gruntfile.js new file mode 100644 index 000000000..02b832c75 --- /dev/null +++ b/node_modules/core-js/Gruntfile.js @@ -0,0 +1,3 @@ +require('LiveScript'); +// eslint-disable-next-line import/no-unresolved +module.exports = require('./build/Gruntfile'); diff --git a/node_modules/core-js/LICENSE b/node_modules/core-js/LICENSE new file mode 100644 index 000000000..44ff6d0ea --- /dev/null +++ b/node_modules/core-js/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014-2018 Denis Pushkarev + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/core-js/README.md b/node_modules/core-js/README.md new file mode 100644 index 000000000..7cfbe89d5 --- /dev/null +++ b/node_modules/core-js/README.md @@ -0,0 +1,2289 @@ +# core-js + +[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/zloirock/core-js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![version](https://img.shields.io/npm/v/core-js.svg)](https://www.npmjs.com/package/core-js) [![npm downloads](https://img.shields.io/npm/dm/core-js.svg)](http://npm-stat.com/charts.html?package=core-js&author=&from=2014-11-18) [![Build Status](https://travis-ci.org/zloirock/core-js.svg)](https://travis-ci.org/zloirock/core-js) [![devDependency status](https://david-dm.org/zloirock/core-js/dev-status.svg)](https://david-dm.org/zloirock/core-js?type=dev) +#### As advertising: the author is looking for a good job :) + +Modular standard library for JavaScript. Includes polyfills for [ECMAScript 5](#ecmascript-5), [ECMAScript 6](#ecmascript-6): [promises](#ecmascript-6-promise), [symbols](#ecmascript-6-symbol), [collections](#ecmascript-6-collections), iterators, [typed arrays](#ecmascript-6-typed-arrays), [ECMAScript 7+ proposals](#ecmascript-7-proposals), [setImmediate](#setimmediate), etc. Some additional features such as [dictionaries](#dict) or [extended partial application](#partial-application). You can require only needed features or use it without global namespace pollution. + +[*Example*](http://goo.gl/a2xexl): +```js +Array.from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3] +'*'.repeat(10); // => '**********' +Promise.resolve(32).then(x => console.log(x)); // => 32 +setImmediate(x => console.log(x), 42); // => 42 +``` + +[*Without global namespace pollution*](http://goo.gl/paOHb0): +```js +var core = require('core-js/library'); // With a modular system, otherwise use global `core` +core.Array.from(new core.Set([1, 2, 3, 2, 1])); // => [1, 2, 3] +core.String.repeat('*', 10); // => '**********' +core.Promise.resolve(32).then(x => console.log(x)); // => 32 +core.setImmediate(x => console.log(x), 42); // => 42 +``` + +### Index +- [Usage](#usage) + - [Basic](#basic) + - [CommonJS](#commonjs) + - [Custom build](#custom-build-from-the-command-line) +- [Supported engines](#supported-engines) +- [Features](#features) + - [ECMAScript 5](#ecmascript-5) + - [ECMAScript 6](#ecmascript-6) + - [ECMAScript 6: Object](#ecmascript-6-object) + - [ECMAScript 6: Function](#ecmascript-6-function) + - [ECMAScript 6: Array](#ecmascript-6-array) + - [ECMAScript 6: String](#ecmascript-6-string) + - [ECMAScript 6: RegExp](#ecmascript-6-regexp) + - [ECMAScript 6: Number](#ecmascript-6-number) + - [ECMAScript 6: Math](#ecmascript-6-math) + - [ECMAScript 6: Date](#ecmascript-6-date) + - [ECMAScript 6: Promise](#ecmascript-6-promise) + - [ECMAScript 6: Symbol](#ecmascript-6-symbol) + - [ECMAScript 6: Collections](#ecmascript-6-collections) + - [ECMAScript 6: Typed Arrays](#ecmascript-6-typed-arrays) + - [ECMAScript 6: Reflect](#ecmascript-6-reflect) + - [ECMAScript 7+ proposals](#ecmascript-7-proposals) + - [stage 4 proposals](#stage-4-proposals) + - [stage 3 proposals](#stage-3-proposals) + - [stage 2 proposals](#stage-2-proposals) + - [stage 1 proposals](#stage-1-proposals) + - [stage 0 proposals](#stage-0-proposals) + - [pre-stage 0 proposals](#pre-stage-0-proposals) + - [Web standards](#web-standards) + - [setTimeout / setInterval](#settimeout--setinterval) + - [setImmediate](#setimmediate) + - [iterable DOM collections](#iterable-dom-collections) + - [Non-standard](#non-standard) + - [Object](#object) + - [Dict](#dict) + - [partial application](#partial-application) + - [Number Iterator](#number-iterator) + - [escaping strings](#escaping-strings) + - [delay](#delay) + - [helpers for iterators](#helpers-for-iterators) +- [Missing polyfills](#missing-polyfills) +- [Changelog](./CHANGELOG.md) + +## Usage +### Basic +``` +npm i core-js +bower install core.js +``` + +```js +// Default +require('core-js'); +// Without global namespace pollution +var core = require('core-js/library'); +// Shim only +require('core-js/shim'); +``` +If you need complete build for browser, use builds from `core-js/client` path: + +* [default](https://raw.githack.com/zloirock/core-js/v2.5.7/client/core.min.js): Includes all features, standard and non-standard. +* [as a library](https://raw.githack.com/zloirock/core-js/v2.5.7/client/library.min.js): Like "default", but does not pollute the global namespace (see [2nd example at the top](#core-js)). +* [shim only](https://raw.githack.com/zloirock/core-js/v2.5.7/client/shim.min.js): Only includes the standard methods. + +Warning: if you use `core-js` with the extension of native objects, require all needed `core-js` modules at the beginning of entry point of your application, otherwise, conflicts may occur. + +### CommonJS +You can require only needed modules. + +```js +require('core-js/fn/set'); +require('core-js/fn/array/from'); +require('core-js/fn/array/find-index'); +Array.from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3] +[1, 2, NaN, 3, 4].findIndex(isNaN); // => 2 + +// or, w/o global namespace pollution: + +var Set = require('core-js/library/fn/set'); +var from = require('core-js/library/fn/array/from'); +var findIndex = require('core-js/library/fn/array/find-index'); +from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3] +findIndex([1, 2, NaN, 3, 4], isNaN); // => 2 +``` +Available entry points for methods / constructors, as above examples, and namespaces: for example, `core-js/es6/array` (`core-js/library/es6/array`) contains all [ES6 `Array` features](#ecmascript-6-array), `core-js/es6` (`core-js/library/es6`) contains all ES6 features. + +##### Caveats when using CommonJS API: + +* `modules` path is internal API, does not inject all required dependencies and can be changed in minor or patch releases. Use it only for a custom build and / or if you know what are you doing. +* `core-js` is extremely modular and uses a lot of very tiny modules, because of that for usage in browsers bundle up `core-js` instead of usage loader for each file, otherwise, you will have hundreds of requests. + +#### CommonJS and prototype methods without global namespace pollution +In the `library` version, we can't pollute prototypes of native constructors. Because of that, prototype methods transformed to static methods like in examples above. `babel` `runtime` transformer also can't transform them. But with transpilers we can use one more trick - [bind operator and virtual methods](https://github.com/zenparsing/es-function-bind). Special for that, available `/virtual/` entry points. Example: +```js +import fill from 'core-js/library/fn/array/virtual/fill'; +import findIndex from 'core-js/library/fn/array/virtual/find-index'; + +Array(10)::fill(0).map((a, b) => b * b)::findIndex(it => it && !(it % 8)); // => 4 + +// or + +import {fill, findIndex} from 'core-js/library/fn/array/virtual'; + +Array(10)::fill(0).map((a, b) => b * b)::findIndex(it => it && !(it % 8)); // => 4 + +``` + +### Custom build (from the command-line) +``` +npm i core-js && cd node_modules/core-js && npm i +npm run grunt build:core.dict,es6 -- --blacklist=es6.promise,es6.math --library=on --path=custom uglify +``` +Where `core.dict` and `es6` are modules (namespaces) names, which will be added to the build, `es6.promise` and `es6.math` are modules (namespaces) names, which will be excluded from the build, `--library=on` is flag for build without global namespace pollution and `custom` is target file name. + +Available namespaces: for example, `es6.array` contains [ES6 `Array` features](#ecmascript-6-array), `es6` contains all modules whose names start with `es6`. + +### Custom build (from external scripts) + +[`core-js-builder`](https://www.npmjs.com/package/core-js-builder) package exports a function that takes the same parameters as the `build` target from the previous section. This will conditionally include or exclude certain parts of `core-js`: + +```js +require('core-js-builder')({ + modules: ['es6', 'core.dict'], // modules / namespaces + blacklist: ['es6.reflect'], // blacklist of modules / namespaces, by default - empty list + library: false, // flag for build without global namespace pollution, by default - false + umd: true // use UMD wrapper for export `core` object, by default - true +}).then(code => { + // ... +}).catch(error => { + // ... +}); +``` +## Supported engines +**Tested in:** +- Chrome 26+ +- Firefox 4+ +- Safari 5+ +- Opera 12+ +- Internet Explorer 6+ (sure, IE8- with ES3 limitations) +- Edge +- Android Browser 2.3+ +- iOS Safari 5.1+ +- PhantomJS 1.9 / 2.1 +- NodeJS 0.8+ + +...and it doesn't mean `core-js` will not work in other engines, they just have not been tested. + +## Features: +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library) <- all features +core-js(/library)/shim <- only polyfills +``` +### ECMAScript 5 +All features moved to the [`es6` namespace](#ecmascript-6), here just a list of features: +```js +Object + .create(proto | null, descriptors?) -> object + .getPrototypeOf(object) -> proto | null + .defineProperty(target, key, desc) -> target, cap for ie8- + .defineProperties(target, descriptors) -> target, cap for ie8- + .getOwnPropertyDescriptor(object, key) -> desc + .getOwnPropertyNames(object) -> array + .keys(object) -> array + .seal(object) -> object, cap for ie8- + .freeze(object) -> object, cap for ie8- + .preventExtensions(object) -> object, cap for ie8- + .isSealed(object) -> bool, cap for ie8- + .isFrozen(object) -> bool, cap for ie8- + .isExtensible(object) -> bool, cap for ie8- +Array + .isArray(var) -> bool + #slice(start?, end?) -> array, fix for ie7- + #join(string = ',') -> string, fix for ie7- + #indexOf(var, from?) -> int + #lastIndexOf(var, from?) -> int + #every(fn(val, index, @), that) -> bool + #some(fn(val, index, @), that) -> bool + #forEach(fn(val, index, @), that) -> void + #map(fn(val, index, @), that) -> array + #filter(fn(val, index, @), that) -> array + #reduce(fn(memo, val, index, @), memo?) -> var + #reduceRight(fn(memo, val, index, @), memo?) -> var + #sort(fn?) -> @, fixes for some engines +Function + #bind(object, ...args) -> boundFn(...args) +String + #split(separator, limit) -> array + #trim() -> str +RegExp + #toString() -> str +Number + #toFixed(digits) -> string + #toPrecision(precision) -> string +parseInt(str, radix) -> int +parseFloat(str) -> num +Date + .now() -> int + #toISOString() -> string + #toJSON() -> string +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es5 +``` + +### ECMAScript 6 +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6 +``` +#### ECMAScript 6: Object +Modules [`es6.object.assign`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.assign.js), [`es6.object.is`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.is.js), [`es6.object.set-prototype-of`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.set-prototype-of.js) and [`es6.object.to-string`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.to-string.js). + +In ES6 most `Object` static methods should work with primitives. Modules [`es6.object.freeze`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.freeze.js), [`es6.object.seal`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.seal.js), [`es6.object.prevent-extensions`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.prevent-extensions.js), [`es6.object.is-frozen`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.is-frozen.js), [`es6.object.is-sealed`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.is-sealed.js), [`es6.object.is-extensible`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.is-extensible.js), [`es6.object.get-own-property-descriptor`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.get-own-property-descriptor.js), [`es6.object.get-prototype-of`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.get-prototype-of.js), [`es6.object.keys`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.keys.js) and [`es6.object.get-own-property-names`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.get-own-property-names.js). + +Just ES5 features: [`es6.object.create`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.create.js), [`es6.object.define-property`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.define-property.js) and [`es6.object.define-properties`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.es6.object.define-properties.js). +```js +Object + .assign(target, ...src) -> target + .is(a, b) -> bool + .setPrototypeOf(target, proto | null) -> target (required __proto__ - IE11+) + .create(object | null, descriptors?) -> object + .getPrototypeOf(var) -> object | null + .defineProperty(object, key, desc) -> target + .defineProperties(object, descriptors) -> target + .getOwnPropertyDescriptor(var, key) -> desc | undefined + .keys(var) -> array + .getOwnPropertyNames(var) -> array + .freeze(var) -> var + .seal(var) -> var + .preventExtensions(var) -> var + .isFrozen(var) -> bool + .isSealed(var) -> bool + .isExtensible(var) -> bool + #toString() -> string, ES6 fix: @@toStringTag support +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/object +core-js(/library)/fn/object/assign +core-js(/library)/fn/object/is +core-js(/library)/fn/object/set-prototype-of +core-js(/library)/fn/object/get-prototype-of +core-js(/library)/fn/object/create +core-js(/library)/fn/object/define-property +core-js(/library)/fn/object/define-properties +core-js(/library)/fn/object/get-own-property-descriptor +core-js(/library)/fn/object/keys +core-js(/library)/fn/object/get-own-property-names +core-js(/library)/fn/object/freeze +core-js(/library)/fn/object/seal +core-js(/library)/fn/object/prevent-extensions +core-js(/library)/fn/object/is-frozen +core-js(/library)/fn/object/is-sealed +core-js(/library)/fn/object/is-extensible +core-js/fn/object/to-string +``` +[*Examples*](http://goo.gl/ywdwPz): +```js +var foo = {q: 1, w: 2} + , bar = {e: 3, r: 4} + , baz = {t: 5, y: 6}; +Object.assign(foo, bar, baz); // => foo = {q: 1, w: 2, e: 3, r: 4, t: 5, y: 6} + +Object.is(NaN, NaN); // => true +Object.is(0, -0); // => false +Object.is(42, 42); // => true +Object.is(42, '42'); // => false + +function Parent(){} +function Child(){} +Object.setPrototypeOf(Child.prototype, Parent.prototype); +new Child instanceof Child; // => true +new Child instanceof Parent; // => true + +var O = {}; +O[Symbol.toStringTag] = 'Foo'; +'' + O; // => '[object Foo]' + +Object.keys('qwe'); // => ['0', '1', '2'] +Object.getPrototypeOf('qwe') === String.prototype; // => true +``` +#### ECMAScript 6: Function +Modules [`es6.function.name`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.function.name.js), [`es6.function.has-instance`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.function.has-instance.js). Just ES5: [`es6.function.bind`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.function.bind.js). +```js +Function + #bind(object, ...args) -> boundFn(...args) + #name -> string (IE9+) + #@@hasInstance(var) -> bool +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js/es6/function +core-js/fn/function/name +core-js/fn/function/has-instance +core-js/fn/function/bind +core-js/fn/function/virtual/bind +``` +[*Example*](http://goo.gl/zqu3Wp): +```js +(function foo(){}).name // => 'foo' + +console.log.bind(console, 42)(43); // => 42 43 +``` +#### ECMAScript 6: Array +Modules [`es6.array.from`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.from.js), [`es6.array.of`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.of.js), [`es6.array.copy-within`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.copy-within.js), [`es6.array.fill`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.fill.js), [`es6.array.find`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.find.js), [`es6.array.find-index`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.find-index.js), [`es6.array.iterator`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.iterator.js). ES5 features with fixes: [`es6.array.is-array`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.is-array.js), [`es6.array.slice`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.slice.js), [`es6.array.join`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.join.js), [`es6.array.index-of`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.index-of.js), [`es6.array.last-index-of`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.last-index-of.js), [`es6.array.every`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.every.js), [`es6.array.some`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.some.js), [`es6.array.for-each`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.for-each.js), [`es6.array.map`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.map.js), [`es6.array.filter`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.filter.js), [`es6.array.reduce`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.reduce.js), [`es6.array.reduce-right`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.reduce-right.js), [`es6.array.sort`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.sort.js). +```js +Array + .from(iterable | array-like, mapFn(val, index)?, that) -> array + .of(...args) -> array + .isArray(var) -> bool + #copyWithin(target = 0, start = 0, end = @length) -> @ + #fill(val, start = 0, end = @length) -> @ + #find(fn(val, index, @), that) -> val + #findIndex(fn(val, index, @), that) -> index | -1 + #values() -> iterator + #keys() -> iterator + #entries() -> iterator + #join(string = ',') -> string, fix for ie7- + #slice(start?, end?) -> array, fix for ie7- + #indexOf(var, from?) -> index | -1 + #lastIndexOf(var, from?) -> index | -1 + #every(fn(val, index, @), that) -> bool + #some(fn(val, index, @), that) -> bool + #forEach(fn(val, index, @), that) -> void + #map(fn(val, index, @), that) -> array + #filter(fn(val, index, @), that) -> array + #reduce(fn(memo, val, index, @), memo?) -> var + #reduceRight(fn(memo, val, index, @), memo?) -> var + #sort(fn?) -> @, invalid arguments fix + #@@iterator() -> iterator (values) + #@@unscopables -> object (cap) +Arguments + #@@iterator() -> iterator (values, available only in core-js methods) +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/array +core-js(/library)/fn/array/from +core-js(/library)/fn/array/of +core-js(/library)/fn/array/is-array +core-js(/library)/fn/array/iterator +core-js(/library)/fn/array/copy-within +core-js(/library)/fn/array/fill +core-js(/library)/fn/array/find +core-js(/library)/fn/array/find-index +core-js(/library)/fn/array/values +core-js(/library)/fn/array/keys +core-js(/library)/fn/array/entries +core-js(/library)/fn/array/slice +core-js(/library)/fn/array/join +core-js(/library)/fn/array/index-of +core-js(/library)/fn/array/last-index-of +core-js(/library)/fn/array/every +core-js(/library)/fn/array/some +core-js(/library)/fn/array/for-each +core-js(/library)/fn/array/map +core-js(/library)/fn/array/filter +core-js(/library)/fn/array/reduce +core-js(/library)/fn/array/reduce-right +core-js(/library)/fn/array/sort +core-js(/library)/fn/array/virtual/iterator +core-js(/library)/fn/array/virtual/copy-within +core-js(/library)/fn/array/virtual/fill +core-js(/library)/fn/array/virtual/find +core-js(/library)/fn/array/virtual/find-index +core-js(/library)/fn/array/virtual/values +core-js(/library)/fn/array/virtual/keys +core-js(/library)/fn/array/virtual/entries +core-js(/library)/fn/array/virtual/slice +core-js(/library)/fn/array/virtual/join +core-js(/library)/fn/array/virtual/index-of +core-js(/library)/fn/array/virtual/last-index-of +core-js(/library)/fn/array/virtual/every +core-js(/library)/fn/array/virtual/some +core-js(/library)/fn/array/virtual/for-each +core-js(/library)/fn/array/virtual/map +core-js(/library)/fn/array/virtual/filter +core-js(/library)/fn/array/virtual/reduce +core-js(/library)/fn/array/virtual/reduce-right +core-js(/library)/fn/array/virtual/sort +``` +[*Examples*](http://goo.gl/oaUFUf): +```js +Array.from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3] +Array.from({0: 1, 1: 2, 2: 3, length: 3}); // => [1, 2, 3] +Array.from('123', Number); // => [1, 2, 3] +Array.from('123', function(it){ + return it * it; +}); // => [1, 4, 9] + +Array.of(1); // => [1] +Array.of(1, 2, 3); // => [1, 2, 3] + +var array = ['a', 'b', 'c']; + +for(var val of array)console.log(val); // => 'a', 'b', 'c' +for(var val of array.values())console.log(val); // => 'a', 'b', 'c' +for(var key of array.keys())console.log(key); // => 0, 1, 2 +for(var [key, val] of array.entries()){ + console.log(key); // => 0, 1, 2 + console.log(val); // => 'a', 'b', 'c' +} + +function isOdd(val){ + return val % 2; +} +[4, 8, 15, 16, 23, 42].find(isOdd); // => 15 +[4, 8, 15, 16, 23, 42].findIndex(isOdd); // => 2 +[4, 8, 15, 16, 23, 42].find(isNaN); // => undefined +[4, 8, 15, 16, 23, 42].findIndex(isNaN); // => -1 + +Array(5).fill(42); // => [42, 42, 42, 42, 42] + +[1, 2, 3, 4, 5].copyWithin(0, 3); // => [4, 5, 3, 4, 5] +``` +#### ECMAScript 6: String +Modules [`es6.string.from-code-point`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.from-code-point.js), [`es6.string.raw`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.raw.js), [`es6.string.iterator`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.iterator.js), [`es6.string.code-point-at`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.code-point-at.js), [`es6.string.ends-with`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.ends-with.js), [`es6.string.includes`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.includes.js), [`es6.string.repeat`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.repeat.js), [`es6.string.starts-with`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.starts-with.js) and [`es6.string.trim`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.trim.js). + +Annex B HTML methods. Ugly, but it's also the part of the spec. Modules [`es6.string.anchor`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.anchor.js), [`es6.string.big`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.big.js), [`es6.string.blink`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.blink.js), [`es6.string.bold`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.bold.js), [`es6.string.fixed`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.fixed.js), [`es6.string.fontcolor`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.fontcolor.js), [`es6.string.fontsize`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.fontsize.js), [`es6.string.italics`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.italics.js), [`es6.string.link`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.link.js), [`es6.string.small`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.small.js), [`es6.string.strike`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.strike.js), [`es6.string.sub`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.sub.js) and [`es6.string.sup`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.sup.js). +```js +String + .fromCodePoint(...codePoints) -> str + .raw({raw}, ...substitutions) -> str + #includes(str, from?) -> bool + #startsWith(str, from?) -> bool + #endsWith(str, from?) -> bool + #repeat(num) -> str + #codePointAt(pos) -> uint + #trim() -> str, ES6 fix + #anchor(name) -> str + #big() -> str + #blink() -> str + #bold() -> str + #fixed() -> str + #fontcolor(color) -> str + #fontsize(size) -> str + #italics() -> str + #link(url) -> str + #small() -> str + #strike() -> str + #sub() -> str + #sup() -> str + #@@iterator() -> iterator (code points) +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/string +core-js(/library)/fn/string/from-code-point +core-js(/library)/fn/string/raw +core-js(/library)/fn/string/includes +core-js(/library)/fn/string/starts-with +core-js(/library)/fn/string/ends-with +core-js(/library)/fn/string/repeat +core-js(/library)/fn/string/code-point-at +core-js(/library)/fn/string/trim +core-js(/library)/fn/string/anchor +core-js(/library)/fn/string/big +core-js(/library)/fn/string/blink +core-js(/library)/fn/string/bold +core-js(/library)/fn/string/fixed +core-js(/library)/fn/string/fontcolor +core-js(/library)/fn/string/fontsize +core-js(/library)/fn/string/italics +core-js(/library)/fn/string/link +core-js(/library)/fn/string/small +core-js(/library)/fn/string/strike +core-js(/library)/fn/string/sub +core-js(/library)/fn/string/sup +core-js(/library)/fn/string/iterator +core-js(/library)/fn/string/virtual/includes +core-js(/library)/fn/string/virtual/starts-with +core-js(/library)/fn/string/virtual/ends-with +core-js(/library)/fn/string/virtual/repeat +core-js(/library)/fn/string/virtual/code-point-at +core-js(/library)/fn/string/virtual/trim +core-js(/library)/fn/string/virtual/anchor +core-js(/library)/fn/string/virtual/big +core-js(/library)/fn/string/virtual/blink +core-js(/library)/fn/string/virtual/bold +core-js(/library)/fn/string/virtual/fixed +core-js(/library)/fn/string/virtual/fontcolor +core-js(/library)/fn/string/virtual/fontsize +core-js(/library)/fn/string/virtual/italics +core-js(/library)/fn/string/virtual/link +core-js(/library)/fn/string/virtual/small +core-js(/library)/fn/string/virtual/strike +core-js(/library)/fn/string/virtual/sub +core-js(/library)/fn/string/virtual/sup +core-js(/library)/fn/string/virtual/iterator +``` +[*Examples*](http://goo.gl/3UaQ93): +```js +for(var val of 'a𠮷b'){ + console.log(val); // => 'a', '𠮷', 'b' +} + +'foobarbaz'.includes('bar'); // => true +'foobarbaz'.includes('bar', 4); // => false +'foobarbaz'.startsWith('foo'); // => true +'foobarbaz'.startsWith('bar', 3); // => true +'foobarbaz'.endsWith('baz'); // => true +'foobarbaz'.endsWith('bar', 6); // => true + +'string'.repeat(3); // => 'stringstringstring' + +'𠮷'.codePointAt(0); // => 134071 +String.fromCodePoint(97, 134071, 98); // => 'a𠮷b' + +var name = 'Bob'; +String.raw`Hi\n${name}!`; // => 'Hi\\nBob!' (ES6 template string syntax) +String.raw({raw: 'test'}, 0, 1, 2); // => 't0e1s2t' + +'foo'.bold(); // => 'foo' +'bar'.anchor('a"b'); // => 'bar' +'baz'.link('http://example.com'); // => 'baz' +``` +#### ECMAScript 6: RegExp +Modules [`es6.regexp.constructor`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.regexp.constructor.js) and [`es6.regexp.flags`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.regexp.flags.js). + +Support well-known [symbols](#ecmascript-6-symbol) `@@match`, `@@replace`, `@@search` and `@@split`, modules [`es6.regexp.match`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.regexp.match.js), [`es6.regexp.replace`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.regexp.replace.js), [`es6.regexp.search`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.regexp.search.js) and [`es6.regexp.split`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.regexp.split.js). +``` +[new] RegExp(pattern, flags?) -> regexp, ES6 fix: can alter flags (IE9+) + #flags -> str (IE9+) + #toString() -> str, ES6 fixes + #@@match(str) -> array | null + #@@replace(str, replacer) -> string + #@@search(str) -> index + #@@split(str, limit) -> array +String + #match(tpl) -> var, ES6 fix for support @@match + #replace(tpl, replacer) -> var, ES6 fix for support @@replace + #search(tpl) -> var, ES6 fix for support @@search + #split(tpl, limit) -> var, ES6 fix for support @@split, some fixes for old engines +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js/es6/regexp +core-js/fn/regexp/constructor +core-js(/library)/fn/regexp/flags +core-js/fn/regexp/to-string +core-js/fn/regexp/match +core-js/fn/regexp/replace +core-js/fn/regexp/search +core-js/fn/regexp/split +``` +[*Examples*](http://goo.gl/PiJxBD): +```js +RegExp(/./g, 'm'); // => /./m + +/foo/.flags; // => '' +/foo/gim.flags; // => 'gim' + +'foo'.match({[Symbol.match]: _ => 1}); // => 1 +'foo'.replace({[Symbol.replace]: _ => 2}); // => 2 +'foo'.search({[Symbol.search]: _ => 3}); // => 3 +'foo'.split({[Symbol.split]: _ => 4}); // => 4 + +RegExp.prototype.toString.call({source: 'foo', flags: 'bar'}); // => '/foo/bar' +``` +#### ECMAScript 6: Number +Module [`es6.number.constructor`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.constructor.js). `Number` constructor support binary and octal literals, [*example*](http://goo.gl/jRd6b3): +```js +Number('0b1010101'); // => 85 +Number('0o7654321'); // => 2054353 +``` +Modules [`es6.number.epsilon`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.epsilon.js), [`es6.number.is-finite`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.is-finite.js), [`es6.number.is-integer`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.is-integer.js), [`es6.number.is-nan`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.is-nan.js), [`es6.number.is-safe-integer`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.is-safe-integer.js), [`es6.number.max-safe-integer`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.max-safe-integer.js), [`es6.number.min-safe-integer`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.min-safe-integer.js), [`es6.number.parse-float`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.parse-float.js), [`es6.number.parse-int`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.parse-int.js), [`es6.number.to-fixed`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.to-fixed.js), [`es6.number.to-precision`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.to-precision.js), [`es6.parse-int`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.parse-int.js), [`es6.parse-float`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.parse-float.js). +```js +[new] Number(var) -> number | number object + .isFinite(num) -> bool + .isNaN(num) -> bool + .isInteger(num) -> bool + .isSafeInteger(num) -> bool + .parseFloat(str) -> num + .parseInt(str) -> int + .EPSILON -> num + .MAX_SAFE_INTEGER -> int + .MIN_SAFE_INTEGER -> int + #toFixed(digits) -> string, fixes + #toPrecision(precision) -> string, fixes +parseFloat(str) -> num, fixes +parseInt(str) -> int, fixes +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/number +core-js/es6/number/constructor +core-js(/library)/fn/number/is-finite +core-js(/library)/fn/number/is-nan +core-js(/library)/fn/number/is-integer +core-js(/library)/fn/number/is-safe-integer +core-js(/library)/fn/number/parse-float +core-js(/library)/fn/number/parse-int +core-js(/library)/fn/number/epsilon +core-js(/library)/fn/number/max-safe-integer +core-js(/library)/fn/number/min-safe-integer +core-js(/library)/fn/number/to-fixed +core-js(/library)/fn/number/to-precision +core-js(/library)/fn/parse-float +core-js(/library)/fn/parse-int +``` +#### ECMAScript 6: Math +Modules [`es6.math.acosh`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.acosh.js), [`es6.math.asinh`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.asinh.js), [`es6.math.atanh`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.atanh.js), [`es6.math.cbrt`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.cbrt.js), [`es6.math.clz32`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.clz32.js), [`es6.math.cosh`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.cosh.js), [`es6.math.expm1`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.expm1.js), [`es6.math.fround`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.fround.js), [`es6.math.hypot`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.hypot.js), [`es6.math.imul`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.imul.js), [`es6.math.log10`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.log10.js), [`es6.math.log1p`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.log1p.js), [`es6.math.log2`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.log2.js), [`es6.math.sign`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.sign.js), [`es6.math.sinh`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.sinh.js), [`es6.math.tanh`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.tanh.js), [`es6.math.trunc`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.trunc.js). +```js +Math + .acosh(num) -> num + .asinh(num) -> num + .atanh(num) -> num + .cbrt(num) -> num + .clz32(num) -> uint + .cosh(num) -> num + .expm1(num) -> num + .fround(num) -> num + .hypot(...args) -> num + .imul(num, num) -> int + .log1p(num) -> num + .log10(num) -> num + .log2(num) -> num + .sign(num) -> 1 | -1 | 0 | -0 | NaN + .sinh(num) -> num + .tanh(num) -> num + .trunc(num) -> num +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/math +core-js(/library)/fn/math/acosh +core-js(/library)/fn/math/asinh +core-js(/library)/fn/math/atanh +core-js(/library)/fn/math/cbrt +core-js(/library)/fn/math/clz32 +core-js(/library)/fn/math/cosh +core-js(/library)/fn/math/expm1 +core-js(/library)/fn/math/fround +core-js(/library)/fn/math/hypot +core-js(/library)/fn/math/imul +core-js(/library)/fn/math/log1p +core-js(/library)/fn/math/log10 +core-js(/library)/fn/math/log2 +core-js(/library)/fn/math/sign +core-js(/library)/fn/math/sinh +core-js(/library)/fn/math/tanh +core-js(/library)/fn/math/trunc +``` +#### ECMAScript 6: Date +Modules [`es6.date.to-string`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.date.to-string.js), ES5 features with fixes: [`es6.date.now`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.date.now.js), [`es6.date.to-iso-string`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.date.to-iso-string.js), [`es6.date.to-json`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.date.to-json.js) and [`es6.date.to-primitive`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.date.to-primitive.js). +```js +Date + .now() -> int + #toISOString() -> string + #toJSON() -> string + #toString() -> string + #@@toPrimitive(hint) -> primitive +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js/es6/date +core-js/fn/date/to-string +core-js(/library)/fn/date/now +core-js(/library)/fn/date/to-iso-string +core-js(/library)/fn/date/to-json +core-js(/library)/fn/date/to-primitive +``` +[*Example*](http://goo.gl/haeHLR): +```js +new Date(NaN).toString(); // => 'Invalid Date' +``` + +#### ECMAScript 6: Promise +Module [`es6.promise`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.promise.js). +```js +new Promise(executor(resolve(var), reject(var))) -> promise + #then(resolved(var), rejected(var)) -> promise + #catch(rejected(var)) -> promise + .resolve(promise | var) -> promise + .reject(var) -> promise + .all(iterable) -> promise + .race(iterable) -> promise +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/promise +core-js(/library)/fn/promise +``` +Basic [*example*](http://goo.gl/vGrtUC): +```js +function sleepRandom(time){ + return new Promise(function(resolve, reject){ + setTimeout(resolve, time * 1e3, 0 | Math.random() * 1e3); + }); +} + +console.log('Run'); // => Run +sleepRandom(5).then(function(result){ + console.log(result); // => 869, after 5 sec. + return sleepRandom(10); +}).then(function(result){ + console.log(result); // => 202, after 10 sec. +}).then(function(){ + console.log('immediately after'); // => immediately after + throw Error('Irror!'); +}).then(function(){ + console.log('will not be displayed'); +}).catch(x => console.log(x)); // => => Error: Irror! +``` +`Promise.resolve` and `Promise.reject` [*example*](http://goo.gl/vr8TN3): +```js +Promise.resolve(42).then(x => console.log(x)); // => 42 +Promise.reject(42).catch(x => console.log(x)); // => 42 + +Promise.resolve($.getJSON('/data.json')); // => ES6 promise +``` +`Promise.all` [*example*](http://goo.gl/RdoDBZ): +```js +Promise.all([ + 'foo', + sleepRandom(5), + sleepRandom(15), + sleepRandom(10) // after 15 sec: +]).then(x => console.log(x)); // => ['foo', 956, 85, 382] +``` +`Promise.race` [*example*](http://goo.gl/L8ovkJ): +```js +function timeLimit(promise, time){ + return Promise.race([promise, new Promise(function(resolve, reject){ + setTimeout(reject, time * 1e3, Error('Await > ' + time + ' sec')); + })]); +} + +timeLimit(sleepRandom(5), 10).then(x => console.log(x)); // => 853, after 5 sec. +timeLimit(sleepRandom(15), 10).catch(x => console.log(x)); // Error: Await > 10 sec +``` +ECMAScript 7 [async functions](https://tc39.github.io/ecmascript-asyncawait) [example](http://goo.gl/wnQS4j): +```js +var delay = time => new Promise(resolve => setTimeout(resolve, time)) + +async function sleepRandom(time){ + await delay(time * 1e3); + return 0 | Math.random() * 1e3; +}; +async function sleepError(time, msg){ + await delay(time * 1e3); + throw Error(msg); +}; + +(async () => { + try { + console.log('Run'); // => Run + console.log(await sleepRandom(5)); // => 936, after 5 sec. + var [a, b, c] = await Promise.all([ + sleepRandom(5), + sleepRandom(15), + sleepRandom(10) + ]); + console.log(a, b, c); // => 210 445 71, after 15 sec. + await sleepError(5, 'Irror!'); + console.log('Will not be displayed'); + } catch(e){ + console.log(e); // => Error: 'Irror!', after 5 sec. + } +})(); +``` + +##### Unhandled rejection tracking + +In Node.js, like in native implementation, available events [`unhandledRejection`](https://nodejs.org/api/process.html#process_event_unhandledrejection) and [`rejectionHandled`](https://nodejs.org/api/process.html#process_event_rejectionhandled): +```js +process.on('unhandledRejection', (reason, promise) => console.log('unhandled', reason, promise)); +process.on('rejectionHandled', (promise) => console.log('handled', promise)); + +var p = Promise.reject(42); +// unhandled 42 [object Promise] + +setTimeout(() => p.catch(_ => _), 1e3); +// handled [object Promise] +``` +In a browser on rejection, by default, you will see notify in the console, or you can add a custom handler and a handler on handling unhandled, [*example*](http://goo.gl/Wozskl): +```js +window.onunhandledrejection = e => console.log('unhandled', e.reason, e.promise); +window.onrejectionhandled = e => console.log('handled', e.reason, e.promise); + +var p = Promise.reject(42); +// unhandled 42 [object Promise] + +setTimeout(() => p.catch(_ => _), 1e3); +// handled 42 [object Promise] +``` + +#### ECMAScript 6: Symbol +Module [`es6.symbol`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.symbol.js). +```js +Symbol(description?) -> symbol + .hasInstance -> @@hasInstance + .isConcatSpreadable -> @@isConcatSpreadable + .iterator -> @@iterator + .match -> @@match + .replace -> @@replace + .search -> @@search + .species -> @@species + .split -> @@split + .toPrimitive -> @@toPrimitive + .toStringTag -> @@toStringTag + .unscopables -> @@unscopables + .for(key) -> symbol + .keyFor(symbol) -> key + .useSimple() -> void + .useSetter() -> void +Object + .getOwnPropertySymbols(object) -> array +``` +Also wrapped some methods for correct work with `Symbol` polyfill. +```js +Object + .create(proto | null, descriptors?) -> object + .defineProperty(target, key, desc) -> target + .defineProperties(target, descriptors) -> target + .getOwnPropertyDescriptor(var, key) -> desc | undefined + .getOwnPropertyNames(var) -> array + #propertyIsEnumerable(key) -> bool +JSON + .stringify(target, replacer?, space?) -> string | undefined +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/symbol +core-js(/library)/fn/symbol +core-js(/library)/fn/symbol/has-instance +core-js(/library)/fn/symbol/is-concat-spreadable +core-js(/library)/fn/symbol/iterator +core-js(/library)/fn/symbol/match +core-js(/library)/fn/symbol/replace +core-js(/library)/fn/symbol/search +core-js(/library)/fn/symbol/species +core-js(/library)/fn/symbol/split +core-js(/library)/fn/symbol/to-primitive +core-js(/library)/fn/symbol/to-string-tag +core-js(/library)/fn/symbol/unscopables +core-js(/library)/fn/symbol/for +core-js(/library)/fn/symbol/key-for +``` +[*Basic example*](http://goo.gl/BbvWFc): +```js +var Person = (function(){ + var NAME = Symbol('name'); + function Person(name){ + this[NAME] = name; + } + Person.prototype.getName = function(){ + return this[NAME]; + }; + return Person; +})(); + +var person = new Person('Vasya'); +console.log(person.getName()); // => 'Vasya' +console.log(person['name']); // => undefined +console.log(person[Symbol('name')]); // => undefined, symbols are uniq +for(var key in person)console.log(key); // => only 'getName', symbols are not enumerable +``` +`Symbol.for` & `Symbol.keyFor` [*example*](http://goo.gl/0pdJjX): +```js +var symbol = Symbol.for('key'); +symbol === Symbol.for('key'); // true +Symbol.keyFor(symbol); // 'key' +``` +[*Example*](http://goo.gl/mKVOQJ) with methods for getting own object keys: +```js +var O = {a: 1}; +Object.defineProperty(O, 'b', {value: 2}); +O[Symbol('c')] = 3; +Object.keys(O); // => ['a'] +Object.getOwnPropertyNames(O); // => ['a', 'b'] +Object.getOwnPropertySymbols(O); // => [Symbol(c)] +Reflect.ownKeys(O); // => ['a', 'b', Symbol(c)] +``` +##### Caveats when using `Symbol` polyfill: + +* We can't add new primitive type, `Symbol` returns object. +* `Symbol.for` and `Symbol.keyFor` can't be shimmed cross-realm. +* By default, to hide the keys, `Symbol` polyfill defines setter in `Object.prototype`. For this reason, uncontrolled creation of symbols can cause memory leak and the `in` operator is not working correctly with `Symbol` polyfill: `Symbol() in {} // => true`. + +You can disable defining setters in `Object.prototype`. [Example](http://goo.gl/N5UD7J): +```js +Symbol.useSimple(); +var s1 = Symbol('s1') + , o1 = {}; +o1[s1] = true; +for(var key in o1)console.log(key); // => 'Symbol(s1)_t.qamkg9f3q', w/o native Symbol + +Symbol.useSetter(); +var s2 = Symbol('s2') + , o2 = {}; +o2[s2] = true; +for(var key in o2)console.log(key); // nothing +``` +* Currently, `core-js` not adds setters to `Object.prototype` for well-known symbols for correct work something like `Symbol.iterator in foo`. It can cause problems with their enumerability. +* Some problems possible with environment exotic objects (for example, IE `localStorage`). + +#### ECMAScript 6: Collections +`core-js` uses native collections in most case, just fixes methods / constructor, if it's required, and in old environment uses fast polyfill (O(1) lookup). +#### Map +Module [`es6.map`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.map.js). +```js +new Map(iterable (entries) ?) -> map + #clear() -> void + #delete(key) -> bool + #forEach(fn(val, key, @), that) -> void + #get(key) -> val + #has(key) -> bool + #set(key, val) -> @ + #size -> uint + #values() -> iterator + #keys() -> iterator + #entries() -> iterator + #@@iterator() -> iterator (entries) +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/map +core-js(/library)/fn/map +``` +[*Examples*](http://goo.gl/GWR7NI): +```js +var a = [1]; + +var map = new Map([['a', 1], [42, 2]]); +map.set(a, 3).set(true, 4); + +console.log(map.size); // => 4 +console.log(map.has(a)); // => true +console.log(map.has([1])); // => false +console.log(map.get(a)); // => 3 +map.forEach(function(val, key){ + console.log(val); // => 1, 2, 3, 4 + console.log(key); // => 'a', 42, [1], true +}); +map.delete(a); +console.log(map.size); // => 3 +console.log(map.get(a)); // => undefined +console.log(Array.from(map)); // => [['a', 1], [42, 2], [true, 4]] + +var map = new Map([['a', 1], ['b', 2], ['c', 3]]); + +for(var [key, val] of map){ + console.log(key); // => 'a', 'b', 'c' + console.log(val); // => 1, 2, 3 +} +for(var val of map.values())console.log(val); // => 1, 2, 3 +for(var key of map.keys())console.log(key); // => 'a', 'b', 'c' +for(var [key, val] of map.entries()){ + console.log(key); // => 'a', 'b', 'c' + console.log(val); // => 1, 2, 3 +} +``` +#### Set +Module [`es6.set`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.set.js). +```js +new Set(iterable?) -> set + #add(key) -> @ + #clear() -> void + #delete(key) -> bool + #forEach(fn(el, el, @), that) -> void + #has(key) -> bool + #size -> uint + #values() -> iterator + #keys() -> iterator + #entries() -> iterator + #@@iterator() -> iterator (values) +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/set +core-js(/library)/fn/set +``` +[*Examples*](http://goo.gl/bmhLwg): +```js +var set = new Set(['a', 'b', 'a', 'c']); +set.add('d').add('b').add('e'); +console.log(set.size); // => 5 +console.log(set.has('b')); // => true +set.forEach(function(it){ + console.log(it); // => 'a', 'b', 'c', 'd', 'e' +}); +set.delete('b'); +console.log(set.size); // => 4 +console.log(set.has('b')); // => false +console.log(Array.from(set)); // => ['a', 'c', 'd', 'e'] + +var set = new Set([1, 2, 3, 2, 1]); + +for(var val of set)console.log(val); // => 1, 2, 3 +for(var val of set.values())console.log(val); // => 1, 2, 3 +for(var key of set.keys())console.log(key); // => 1, 2, 3 +for(var [key, val] of set.entries()){ + console.log(key); // => 1, 2, 3 + console.log(val); // => 1, 2, 3 +} +``` +#### WeakMap +Module [`es6.weak-map`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.weak-map.js). +```js +new WeakMap(iterable (entries) ?) -> weakmap + #delete(key) -> bool + #get(key) -> val + #has(key) -> bool + #set(key, val) -> @ +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/weak-map +core-js(/library)/fn/weak-map +``` +[*Examples*](http://goo.gl/SILXyw): +```js +var a = [1] + , b = [2] + , c = [3]; + +var wmap = new WeakMap([[a, 1], [b, 2]]); +wmap.set(c, 3).set(b, 4); +console.log(wmap.has(a)); // => true +console.log(wmap.has([1])); // => false +console.log(wmap.get(a)); // => 1 +wmap.delete(a); +console.log(wmap.get(a)); // => undefined + +// Private properties store: +var Person = (function(){ + var names = new WeakMap; + function Person(name){ + names.set(this, name); + } + Person.prototype.getName = function(){ + return names.get(this); + }; + return Person; +})(); + +var person = new Person('Vasya'); +console.log(person.getName()); // => 'Vasya' +for(var key in person)console.log(key); // => only 'getName' +``` +#### WeakSet +Module [`es6.weak-set`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.weak-set.js). +```js +new WeakSet(iterable?) -> weakset + #add(key) -> @ + #delete(key) -> bool + #has(key) -> bool +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/weak-set +core-js(/library)/fn/weak-set +``` +[*Examples*](http://goo.gl/TdFbEx): +```js +var a = [1] + , b = [2] + , c = [3]; + +var wset = new WeakSet([a, b, a]); +wset.add(c).add(b).add(c); +console.log(wset.has(b)); // => true +console.log(wset.has([2])); // => false +wset.delete(b); +console.log(wset.has(b)); // => false +``` +##### Caveats when using collections polyfill: + +* Weak-collections polyfill stores values as hidden properties of keys. It works correct and not leak in most cases. However, it is desirable to store a collection longer than its keys. + +#### ECMAScript 6: Typed Arrays +Implementations and fixes `ArrayBuffer`, `DataView`, typed arrays constructors, static and prototype methods. Typed Arrays work only in environments with support descriptors (IE9+), `ArrayBuffer` and `DataView` should work anywhere. + +Modules [`es6.typed.array-buffer`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.typed.array-buffer.js), [`es6.typed.data-view`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.typed.data-view.js), [`es6.typed.int8-array`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.typed.int8-array.js), [`es6.typed.uint8-array`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.typed.uint8-array.js), [`es6.typed.uint8-clamped-array`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.typed.uint8-clamped-array.js), [`es6.typed.int16-array`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.typed.int16-array.js), [`es6.typed.uint16-array`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.typed.uint16-array.js), [`es6.typed.int32-array`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.typed.int32-array.js), [`es6.typed.uint32-array`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.typed.uint32-array.js), [`es6.typed.float32-array`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.typed.float32-array.js) and [`es6.typed.float64-array`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.typed.float64-array.js). +```js +new ArrayBuffer(length) -> buffer + .isView(var) -> bool + #slice(start = 0, end = @length) -> buffer + #byteLength -> uint + +new DataView(buffer, byteOffset = 0, byteLength = buffer.byteLength - byteOffset) -> view + #getInt8(offset) -> int8 + #getUint8(offset) -> uint8 + #getInt16(offset, littleEndian = false) -> int16 + #getUint16(offset, littleEndian = false) -> uint16 + #getInt32(offset, littleEndian = false) -> int32 + #getUint32(offset, littleEndian = false) -> uint32 + #getFloat32(offset, littleEndian = false) -> float32 + #getFloat64(offset, littleEndian = false) -> float64 + #setInt8(offset, value) -> void + #setUint8(offset, value) -> void + #setInt16(offset, value, littleEndian = false) -> void + #setUint16(offset, value, littleEndian = false) -> void + #setInt32(offset, value, littleEndian = false) -> void + #setUint32(offset, value, littleEndian = false) -> void + #setFloat32(offset, value, littleEndian = false) -> void + #setFloat64(offset, value, littleEndian = false) -> void + #buffer -> buffer + #byteLength -> uint + #byteOffset -> uint + +{ + Int8Array, + Uint8Array, + Uint8ClampedArray, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array +} + new %TypedArray%(length) -> typed + new %TypedArray%(typed) -> typed + new %TypedArray%(arrayLike) -> typed + new %TypedArray%(iterable) -> typed + new %TypedArray%(buffer, byteOffset = 0, length = (buffer.byteLength - byteOffset) / @BYTES_PER_ELEMENT) -> typed + .BYTES_PER_ELEMENT -> uint + .from(arrayLike | iterable, mapFn(val, index)?, that) -> typed + .of(...args) -> typed + #BYTES_PER_ELEMENT -> uint + #copyWithin(target = 0, start = 0, end = @length) -> @ + #every(fn(val, index, @), that) -> bool + #fill(val, start = 0, end = @length) -> @ + #filter(fn(val, index, @), that) -> typed + #find(fn(val, index, @), that) -> val + #findIndex(fn(val, index, @), that) -> index + #forEach(fn(val, index, @), that) -> void + #indexOf(var, from?) -> int + #join(string = ',') -> string + #lastIndexOf(var, from?) -> int + #map(fn(val, index, @), that) -> typed + #reduce(fn(memo, val, index, @), memo?) -> var + #reduceRight(fn(memo, val, index, @), memo?) -> var + #reverse() -> @ + #set(arrayLike, offset = 0) -> void + #slice(start = 0, end = @length) -> typed + #some(fn(val, index, @), that) -> bool + #sort(fn(a, b)?) -> @ + #subarray(start = 0, end = @length) -> typed + #toString() -> string + #toLocaleString() -> string + #values() -> iterator + #keys() -> iterator + #entries() -> iterator + #@@iterator() -> iterator (values) + #buffer -> buffer + #byteLength -> uint + #byteOffset -> uint + #length -> uint +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/typed +core-js(/library)/fn/typed +core-js(/library)/fn/typed/array-buffer +core-js(/library)/fn/typed/data-view +core-js(/library)/fn/typed/int8-array +core-js(/library)/fn/typed/uint8-array +core-js(/library)/fn/typed/uint8-clamped-array +core-js(/library)/fn/typed/int16-array +core-js(/library)/fn/typed/uint16-array +core-js(/library)/fn/typed/int32-array +core-js(/library)/fn/typed/uint32-array +core-js(/library)/fn/typed/float32-array +core-js(/library)/fn/typed/float64-array +``` +[*Examples*](http://goo.gl/yla75z): +```js +new Int32Array(4); // => [0, 0, 0, 0] +new Uint8ClampedArray([1, 2, 3, 666]); // => [1, 2, 3, 255] +new Float32Array(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3] + +var buffer = new ArrayBuffer(8); +var view = new DataView(buffer); +view.setFloat64(0, 123.456, true); +new Uint8Array(buffer.slice(4)); // => [47, 221, 94, 64] + +Int8Array.of(1, 1.5, 5.7, 745); // => [1, 1, 5, -23] +Uint8Array.from([1, 1.5, 5.7, 745]); // => [1, 1, 5, 233] + +var typed = new Uint8Array([1, 2, 3]); + +var a = typed.slice(1); // => [2, 3] +typed.buffer === a.buffer; // => false +var b = typed.subarray(1); // => [2, 3] +typed.buffer === b.buffer; // => true + +typed.filter(it => it % 2); // => [1, 3] +typed.map(it => it * 1.5); // => [1, 3, 4] + +for(var val of typed)console.log(val); // => 1, 2, 3 +for(var val of typed.values())console.log(val); // => 1, 2, 3 +for(var key of typed.keys())console.log(key); // => 0, 1, 2 +for(var [key, val] of typed.entries()){ + console.log(key); // => 0, 1, 2 + console.log(val); // => 1, 2, 3 +} +``` +##### Caveats when using typed arrays: + +* Typed Arrays polyfills works completely how should work by the spec, but because of internal use getter / setters on each instance, is slow and consumes significant memory. However, typed arrays polyfills required mainly for IE9 (and for `Uint8ClampedArray` in IE10 and early IE11), all modern engines have native typed arrays and requires only constructors fixes and methods. +* The current version hasn't special entry points for methods, they can be added only with constructors. It can be added in the future. +* In the `library` version we can't pollute native prototypes, so prototype methods available as constructors static. + +#### ECMAScript 6: Reflect +Modules [`es6.reflect.apply`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.apply.js), [`es6.reflect.construct`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.construct.js), [`es6.reflect.define-property`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.define-property.js), [`es6.reflect.delete-property`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.delete-property.js), [`es6.reflect.enumerate`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.enumerate.js), [`es6.reflect.get`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.get.js), [`es6.reflect.get-own-property-descriptor`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.get-own-property-descriptor.js), [`es6.reflect.get-prototype-of`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.get-prototype-of.js), [`es6.reflect.has`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.has.js), [`es6.reflect.is-extensible`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.is-extensible.js), [`es6.reflect.own-keys`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.own-keys.js), [`es6.reflect.prevent-extensions`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.prevent-extensions.js), [`es6.reflect.set`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.set.js), [`es6.reflect.set-prototype-of`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.set-prototype-of.js). +```js +Reflect + .apply(target, thisArgument, argumentsList) -> var + .construct(target, argumentsList, newTarget?) -> object + .defineProperty(target, propertyKey, attributes) -> bool + .deleteProperty(target, propertyKey) -> bool + .enumerate(target) -> iterator (removed from the spec and will be removed from core-js@3) + .get(target, propertyKey, receiver?) -> var + .getOwnPropertyDescriptor(target, propertyKey) -> desc + .getPrototypeOf(target) -> object | null + .has(target, propertyKey) -> bool + .isExtensible(target) -> bool + .ownKeys(target) -> array + .preventExtensions(target) -> bool + .set(target, propertyKey, V, receiver?) -> bool + .setPrototypeOf(target, proto) -> bool (required __proto__ - IE11+) +``` +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es6/reflect +core-js(/library)/fn/reflect +core-js(/library)/fn/reflect/apply +core-js(/library)/fn/reflect/construct +core-js(/library)/fn/reflect/define-property +core-js(/library)/fn/reflect/delete-property +core-js(/library)/fn/reflect/enumerate (deprecated and will be removed from the next major release) +core-js(/library)/fn/reflect/get +core-js(/library)/fn/reflect/get-own-property-descriptor +core-js(/library)/fn/reflect/get-prototype-of +core-js(/library)/fn/reflect/has +core-js(/library)/fn/reflect/is-extensible +core-js(/library)/fn/reflect/own-keys +core-js(/library)/fn/reflect/prevent-extensions +core-js(/library)/fn/reflect/set +core-js(/library)/fn/reflect/set-prototype-of +``` +[*Examples*](http://goo.gl/gVT0cH): +```js +var O = {a: 1}; +Object.defineProperty(O, 'b', {value: 2}); +O[Symbol('c')] = 3; +Reflect.ownKeys(O); // => ['a', 'b', Symbol(c)] + +function C(a, b){ + this.c = a + b; +} + +var instance = Reflect.construct(C, [20, 22]); +instance.c; // => 42 +``` + +### ECMAScript 7+ proposals +[The TC39 process.](https://tc39.github.io/process-document/) + +[*CommonJS entry points:*](#commonjs) +``` +core-js(/library)/es7 +core-js(/library)/es7/array +core-js(/library)/es7/global +core-js(/library)/es7/string +core-js(/library)/es7/map +core-js(/library)/es7/set +core-js(/library)/es7/error +core-js(/library)/es7/math +core-js(/library)/es7/system +core-js(/library)/es7/symbol +core-js(/library)/es7/reflect +core-js(/library)/es7/observable +``` +`core-js/stage/4` entry point contains only stage 4 proposals, `core-js/stage/3` - stage 3 and stage 4, etc. +#### Stage 4 proposals + +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/stage/4 +``` +* `{Array, %TypedArray%}#includes` [proposal](https://github.com/tc39/Array.prototype.includes) - module [`es7.array.includes`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.array.includes.js), `%TypedArray%` version in modules from [this section](#ecmascript-6-typed-arrays). +```js +Array + #includes(var, from?) -> bool +{ + Int8Array, + Uint8Array, + Uint8ClampedArray, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array +} + #includes(var, from?) -> bool +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/array/includes +``` +[*Examples*](http://goo.gl/2Gq4ma): +```js +[1, 2, 3].includes(2); // => true +[1, 2, 3].includes(4); // => false +[1, 2, 3].includes(2, 2); // => false + +[NaN].indexOf(NaN); // => -1 +[NaN].includes(NaN); // => true +Array(1).indexOf(undefined); // => -1 +Array(1).includes(undefined); // => true +``` +* `Object.values`, `Object.entries` [proposal](https://github.com/tc39/proposal-object-values-entries) - modules [`es7.object.values`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.object.values.js), [`es7.object.entries`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.object.entries.js) +```js +Object + .values(object) -> array + .entries(object) -> array +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/object/values +core-js(/library)/fn/object/entries +``` +[*Examples*](http://goo.gl/6kuGOn): +```js +Object.values({a: 1, b: 2, c: 3}); // => [1, 2, 3] +Object.entries({a: 1, b: 2, c: 3}); // => [['a', 1], ['b', 2], ['c', 3]] + +for(let [key, value] of Object.entries({a: 1, b: 2, c: 3})){ + console.log(key); // => 'a', 'b', 'c' + console.log(value); // => 1, 2, 3 +} +``` +* `Object.getOwnPropertyDescriptors` [proposal](https://github.com/tc39/proposal-object-getownpropertydescriptors) - module [`es7.object.get-own-property-descriptors`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.object.get-own-property-descriptors.js) +```js +Object + .getOwnPropertyDescriptors(object) -> object +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/object/get-own-property-descriptors +``` +*Examples*: +```js +// Shallow object cloning with prototype and descriptors: +var copy = Object.create(Object.getPrototypeOf(O), Object.getOwnPropertyDescriptors(O)); +// Mixin: +Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); +``` +* `String#padStart`, `String#padEnd` [proposal](https://github.com/tc39/proposal-string-pad-start-end) - modules [`es7.string.pad-start`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.string.pad-start.js), [`es7.string.pad-end`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.string.pad-end.js) +```js +String + #padStart(length, fillStr = ' ') -> string + #padEnd(length, fillStr = ' ') -> string +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/string/pad-start +core-js(/library)/fn/string/pad-end +core-js(/library)/fn/string/virtual/pad-start +core-js(/library)/fn/string/virtual/pad-end +``` +[*Examples*](http://goo.gl/hK5ccv): +```js +'hello'.padStart(10); // => ' hello' +'hello'.padStart(10, '1234'); // => '12341hello' +'hello'.padEnd(10); // => 'hello ' +'hello'.padEnd(10, '1234'); // => 'hello12341' +``` +* `Object#__(define|lookup)[GS]etter__`, [annex B ES2017](https://github.com/tc39/ecma262/pull/381), but we haven't special namespace for that - modules [`es7.object.define-setter`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.object.define-setter.js), [`es7.object.define-getter`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.object.define-getter.js), [`es7.object.lookup-setter`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.object.lookup-setter.js) and [`es7.object.lookup-getter`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.object.lookup-getter.js). +```js +Object + #__defineSetter__(key, fn) -> void + #__defineGetter__(key, fn) -> void + #__lookupSetter__(key) -> fn | void + #__lookupGetter__(key) -> fn | void +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/object/define-getter +core-js(/library)/fn/object/define-setter +core-js(/library)/fn/object/lookup-getter +core-js(/library)/fn/object/lookup-setter +``` + +#### Stage 3 proposals +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/stage/3 +``` +* `global` [proposal](https://github.com/tc39/proposal-global) - modules [`es7.global`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.global.js) and [`es7.system.global`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.system.global.js) (obsolete) +```js +global -> object +System + .global -> object (obsolete) +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/global +core-js(/library)/fn/system/global (obsolete) +``` +[*Examples*](http://goo.gl/gEqMl7): +```js +global.Array === Array; // => true +``` +* `Promise#finally` [proposal](https://github.com/tc39/proposal-promise-finally) - module [`es7.promise.finally`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.promise.finally.js) +```js +Promise + #finally(onFinally()) -> promise +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/promise/finally +``` +[*Examples*](https://goo.gl/AhyBbJ): +```js +Promise.resolve(42).finally(() => console.log('You will see it anyway')); + +Promise.reject(42).finally(() => console.log('You will see it anyway')); + +#### Stage 2 proposals +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/stage/2 +``` +* `String#trimLeft`, `String#trimRight` / `String#trimStart`, `String#trimEnd` [proposal](https://github.com/sebmarkbage/ecmascript-string-left-right-trim) - modules [`es7.string.trim-left`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.string.trim-right.js), [`es7.string.trim-right`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.string.trim-right.js) +```js +String + #trimLeft() -> string + #trimRight() -> string + #trimStart() -> string + #trimEnd() -> string +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/string/trim-start +core-js(/library)/fn/string/trim-end +core-js(/library)/fn/string/trim-left +core-js(/library)/fn/string/trim-right +core-js(/library)/fn/string/virtual/trim-start +core-js(/library)/fn/string/virtual/trim-end +core-js(/library)/fn/string/virtual/trim-left +core-js(/library)/fn/string/virtual/trim-right +``` +[*Examples*](http://goo.gl/Er5lMJ): +```js +' hello '.trimLeft(); // => 'hello ' +' hello '.trimRight(); // => ' hello' +``` +``` +* `Symbol.asyncIterator` for [async iteration proposal](https://github.com/tc39/proposal-async-iteration) - module [`es7.symbol.async-iterator`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.symbol.async-iterator.js) +```js +Symbol + .asyncIterator -> @@asyncIterator +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/symbol/async-iterator +``` + +#### Stage 1 proposals +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/stage/1 +``` +* `Promise.try` [proposal](https://github.com/tc39/proposal-promise-try) - module [`es7.promise.try`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.promise.try.js) +```js +Promise + .try(function()) -> promise +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/promise/try +``` +[*Examples*](https://goo.gl/k5GGRo): +```js +Promise.try(() => 42).then(it => console.log(`Promise, resolved as ${it}`)); + +Promise.try(() => { throw 42; }).catch(it => console.log(`Promise, rejected as ${it}`)); +``` +* `Array#flatten` and `Array#flatMap` [proposal](https://tc39.github.io/proposal-flatMap) - modules [`es7.array.flatten`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.array.flatten.js) and [`es7.array.flat-map`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.array.flat-map.js) +```js +Array + #flatten(depthArg = 1) -> array + #flatMap(fn(val, key, @), that) -> array +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/array/flatten +core-js(/library)/fn/array/flat-map +core-js(/library)/fn/array/virtual/flatten +core-js(/library)/fn/array/virtual/flat-map +``` +[*Examples*](https://goo.gl/jTXsZi): +```js +[1, [2, 3], [4, 5]].flatten(); // => [1, 2, 3, 4, 5] +[1, [2, [3, [4]]], 5].flatten(); // => [1, 2, [3, [4]], 5] +[1, [2, [3, [4]]], 5].flatten(3); // => [1, 2, 3, 4, 5] + +[{a: 1, b: 2}, {a: 3, b: 4}, {a: 5, b: 6}].flatMap(it => [it.a, it.b]); // => [1, 2, 3, 4, 5, 6] +``` +* `.of` and `.from` methods on collection constructors [proposal](https://github.com/tc39/proposal-setmap-offrom) - modules [`es7.set.of`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.set.of.js), [`es7.set.from`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.set.from.js), [`es7.map.of`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.map.of.js), [`es7.map.from`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.map.from.js), [`es7.weak-set.of`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.weak-set.of.js), [`es7.weak-set.from`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.weak-set.from.js), [`es7.weak-map.of`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.weak-map.of.js), [`es7.weak-map.from`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.weak-map.from.js) +```js +Set + .of(...args) -> set + .from(iterable, mapFn(val, index)?, that?) -> set +Map + .of(...args) -> map + .from(iterable, mapFn(val, index)?, that?) -> map +WeakSet + .of(...args) -> weakset + .from(iterable, mapFn(val, index)?, that?) -> weakset +WeakMap + .of(...args) -> weakmap + .from(iterable, mapFn(val, index)?, that?) -> weakmap +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/set/of +core-js(/library)/fn/set/from +core-js(/library)/fn/map/of +core-js(/library)/fn/map/from +core-js(/library)/fn/weak-set/of +core-js(/library)/fn/weak-set/from +core-js(/library)/fn/weak-map/of +core-js(/library)/fn/weak-map/from +``` +[*Examples*](https://goo.gl/mSC7eU): +```js +Set.of(1, 2, 3, 2, 1); // => Set {1, 2, 3} + +Map.from([[1, 2], [3, 4]], ([key, val]) => [key ** 2, val ** 2]); // => Map {1: 4, 9: 16} +``` +* `String#matchAll` [proposal](https://github.com/tc39/String.prototype.matchAll) - module [`es7.string.match-all`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.string.match-all.js) +```js +String + #matchAll(regexp) -> iterator +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/string/match-all +core-js(/library)/fn/string/virtual/match-all +``` +[*Examples*](http://goo.gl/6kp9EB): +```js +for(let [_, d, D] of '1111a2b3cccc'.matchAll(/(\d)(\D)/)){ + console.log(d, D); // => 1 a, 2 b, 3 c +} +``` +* `Observable` [proposal](https://github.com/zenparsing/es-observable) - modules [`es7.observable`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.observable.js) and [`es7.symbol.observable`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.symbol.observable.js) +```js +new Observable(fn) -> observable + #subscribe(observer) -> subscription + #forEach(fn) -> promise + #@@observable() -> @ + .of(...items) -> observable + .from(observable | iterable) -> observable + .@@species -> @ +Symbol + .observable -> @@observable +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/observable +core-js(/library)/fn/symbol/observable +``` +[*Examples*](http://goo.gl/1LDywi): +```js +new Observable(observer => { + observer.next('hello'); + observer.next('world'); + observer.complete(); +}).forEach(it => console.log(it)) + .then(_ => console.log('!')); +``` +* `Math.{clamp, DEG_PER_RAD, degrees, fscale, rad-per-deg, radians, scale}` + [proposal](https://github.com/rwaldron/proposal-math-extensions) - modules + [`es7.math.clamp`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.clamp.js), + [`es7.math.DEG_PER_RAD`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.DEG_PER_RAD.js), + [`es7.math.degrees`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.degrees.js), + [`es7.math.fscale`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.fscale.js), + [`es7.math.RAD_PER_DEG`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.RAD_PER_DEG.js), + [`es7.math.radians`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.radians.js) and + [`es7.math.scale`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.scale.js) +```js +Math + .DEG_PER_RAD -> number + .RAD_PER_DEG -> number + .clamp(x, lower, upper) -> number + .degrees(radians) -> number + .fscale(x, inLow, inHigh, outLow, outHigh) -> number + .radians(degrees) -> number + .scale(x, inLow, inHigh, outLow, outHigh) -> number +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/math/clamp +core-js(/library)/fn/math/deg-per-rad +core-js(/library)/fn/math/degrees +core-js(/library)/fn/math/fscale +core-js(/library)/fn/math/rad-per-deg +core-js(/library)/fn/math/radians +core-js(/library)/fn/math/scale +``` +* `Math.signbit` [proposal](http://jfbastien.github.io/papers/Math.signbit.html) - module [`es7.math.signbit`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.signbit.js) +```js +Math + .signbit(x) -> bool +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/math/signbit +``` +[*Examples*](http://es6.zloirock.ru/): +```js +Math.signbit(NaN); // => NaN +Math.signbit(1); // => true +Math.signbit(-1); // => false +Math.signbit(0); // => true +Math.signbit(-0); // => false +``` + +#### Stage 0 proposals +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/stage/0 +``` +* `String#at` [proposal](https://github.com/mathiasbynens/String.prototype.at) - module [`es7.string.at`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.string.at.js) +```js +String + #at(index) -> string +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/string/at +core-js(/library)/fn/string/virtual/at +``` +[*Examples*](http://goo.gl/XluXI8): +```js +'a𠮷b'.at(1); // => '𠮷' +'a𠮷b'.at(1).length; // => 2 +``` +* `Map#toJSON`, `Set#toJSON` [proposal](https://github.com/DavidBruant/Map-Set.prototype.toJSON) - modules [`es7.map.to-json`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.map.to-json.js), [`es7.set.to-json`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.set.to-json.js) (rejected and will be removed from `core-js@3`) +```js +Map + #toJSON() -> array (rejected and will be removed from core-js@3) +Set + #toJSON() -> array (rejected and will be removed from core-js@3) +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/map +core-js(/library)/fn/set +``` +* `Error.isError` [proposal](https://github.com/ljharb/proposal-is-error) - module [`es7.error.is-error`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.error.is-error.js) (withdrawn and will be removed from `core-js@3`) +```js +Error + .isError(it) -> bool (withdrawn and will be removed from core-js@3) +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/error/is-error +``` +* `Math.{iaddh, isubh, imulh, umulh}` [proposal](https://gist.github.com/BrendanEich/4294d5c212a6d2254703) - modules [`es7.math.iaddh`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.iaddh.js), [`es7.math.isubh`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.isubh.js), [`es7.math.imulh`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.imulh.js) and [`es7.math.umulh`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.umulh.js) +```js +Math + .iaddh(lo0, hi0, lo1, hi1) -> int32 + .isubh(lo0, hi0, lo1, hi1) -> int32 + .imulh(a, b) -> int32 + .umulh(a, b) -> uint32 +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/math/iaddh +core-js(/library)/fn/math/isubh +core-js(/library)/fn/math/imulh +core-js(/library)/fn/math/umulh +``` +* `global.asap`, [TC39 discussion](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask), module [`es7.asap`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.asap.js) +```js +asap(fn) -> void +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/asap +``` +[*Examples*](http://goo.gl/tx3SRK): +```js +asap(() => console.log('called as microtask')); +``` + +#### Pre-stage 0 proposals +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/stage/pre +``` +* `Reflect` metadata [proposal](https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md) - modules [`es7.reflect.define-metadata`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.reflect.define-metadata.js), [`es7.reflect.delete-metadata`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.reflect.delete-metadata.js), [`es7.reflect.get-metadata`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.reflect.get-metadata.js), [`es7.reflect.get-metadata-keys`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.reflect.get-metadata-keys.js), [`es7.reflect.get-own-metadata`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.reflect.get-own-metadata.js), [`es7.reflect.get-own-metadata-keys`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.reflect.get-own-metadata-keys.js), [`es7.reflect.has-metadata`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.reflect.has-metadata.js), [`es7.reflect.has-own-metadata`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.reflect.has-own-metadata.js) and [`es7.reflect.metadata`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.reflect.metadata.js). +```js +Reflect + .defineMetadata(metadataKey, metadataValue, target, propertyKey?) -> void + .getMetadata(metadataKey, target, propertyKey?) -> var + .getOwnMetadata(metadataKey, target, propertyKey?) -> var + .hasMetadata(metadataKey, target, propertyKey?) -> bool + .hasOwnMetadata(metadataKey, target, propertyKey?) -> bool + .deleteMetadata(metadataKey, target, propertyKey?) -> bool + .getMetadataKeys(target, propertyKey?) -> array + .getOwnMetadataKeys(target, propertyKey?) -> array + .metadata(metadataKey, metadataValue) -> decorator(target, targetKey?) -> void +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/reflect/define-metadata +core-js(/library)/fn/reflect/delete-metadata +core-js(/library)/fn/reflect/get-metadata +core-js(/library)/fn/reflect/get-metadata-keys +core-js(/library)/fn/reflect/get-own-metadata +core-js(/library)/fn/reflect/get-own-metadata-keys +core-js(/library)/fn/reflect/has-metadata +core-js(/library)/fn/reflect/has-own-metadata +core-js(/library)/fn/reflect/metadata +``` +[*Examples*](http://goo.gl/KCo3PS): +```js +var O = {}; +Reflect.defineMetadata('foo', 'bar', O); +Reflect.ownKeys(O); // => [] +Reflect.getOwnMetadataKeys(O); // => ['foo'] +Reflect.getOwnMetadata('foo', O); // => 'bar' +``` + +### Web standards +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/web +``` +#### setTimeout / setInterval +Module [`web.timers`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/web.timers.js). Additional arguments fix for IE9-. +```js +setTimeout(fn(...args), time, ...args) -> id +setInterval(fn(...args), time, ...args) -> id +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/web/timers +core-js(/library)/fn/set-timeout +core-js(/library)/fn/set-interval +``` +```js +// Before: +setTimeout(log.bind(null, 42), 1000); +// After: +setTimeout(log, 1000, 42); +``` +#### setImmediate +Module [`web.immediate`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/web.immediate.js). [`setImmediate` proposal](https://developer.mozilla.org/en-US/docs/Web/API/Window.setImmediate) polyfill. +```js +setImmediate(fn(...args), ...args) -> id +clearImmediate(id) -> void +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/web/immediate +core-js(/library)/fn/set-immediate +core-js(/library)/fn/clear-immediate +``` +[*Examples*](http://goo.gl/6nXGrx): +```js +setImmediate(function(arg1, arg2){ + console.log(arg1, arg2); // => Message will be displayed with minimum delay +}, 'Message will be displayed', 'with minimum delay'); + +clearImmediate(setImmediate(function(){ + console.log('Message will not be displayed'); +})); +``` +#### Iterable DOM collections +Some DOM collections should have [iterable interface](https://heycam.github.io/webidl/#idl-iterable) or should be [inherited from `Array`](https://heycam.github.io/webidl/#LegacyArrayClass). That mean they should have `keys`, `values`, `entries` and `@@iterator` methods for iteration. So add them. Module [`web.dom.iterable`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/web.dom.iterable.js): +```js +{ + 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 +} + #@@iterator() -> iterator (values) + +{ + DOMTokenList, + NodeList +} + #values() -> iterator + #keys() -> iterator + #entries() -> iterator +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/web/dom-collections +core-js(/library)/fn/dom-collections/iterator +``` +[*Examples*](http://goo.gl/lfXVFl): +```js +for(var {id} of document.querySelectorAll('*')){ + if(id)console.log(id); +} + +for(var [index, {id}] of document.querySelectorAll('*').entries()){ + if(id)console.log(index, id); +} +``` +### Non-standard +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/core +``` +#### Object +Modules [`core.object.is-object`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.object.is-object.js), [`core.object.classof`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.object.classof.js), [`core.object.define`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.object.define.js), [`core.object.make`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.object.make.js). +```js +Object + .isObject(var) -> bool + .classof(var) -> string + .define(target, mixin) -> target + .make(proto | null, mixin?) -> object +``` + +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/core/object +core-js(/library)/fn/object/is-object +core-js(/library)/fn/object/define +core-js(/library)/fn/object/make +``` +Object classify [*examples*](http://goo.gl/YZQmGo): +```js +Object.isObject({}); // => true +Object.isObject(isNaN); // => true +Object.isObject(null); // => false + +var classof = Object.classof; + +classof(null); // => 'Null' +classof(undefined); // => 'Undefined' +classof(1); // => 'Number' +classof(true); // => 'Boolean' +classof('string'); // => 'String' +classof(Symbol()); // => 'Symbol' + +classof(new Number(1)); // => 'Number' +classof(new Boolean(true)); // => 'Boolean' +classof(new String('string')); // => 'String' + +var fn = function(){} + , list = (function(){return arguments})(1, 2, 3); + +classof({}); // => 'Object' +classof(fn); // => 'Function' +classof([]); // => 'Array' +classof(list); // => 'Arguments' +classof(/./); // => 'RegExp' +classof(new TypeError); // => 'Error' + +classof(new Set); // => 'Set' +classof(new Map); // => 'Map' +classof(new WeakSet); // => 'WeakSet' +classof(new WeakMap); // => 'WeakMap' +classof(new Promise(fn)); // => 'Promise' + +classof([].values()); // => 'Array Iterator' +classof(new Set().values()); // => 'Set Iterator' +classof(new Map().values()); // => 'Map Iterator' + +classof(Math); // => 'Math' +classof(JSON); // => 'JSON' + +function Example(){} +Example.prototype[Symbol.toStringTag] = 'Example'; + +classof(new Example); // => 'Example' +``` +`Object.define` and `Object.make` [*examples*](http://goo.gl/rtpD5Z): +```js +// Before: +Object.defineProperty(target, 'c', { + enumerable: true, + configurable: true, + get: function(){ + return this.a + this.b; + } +}); + +// After: +Object.define(target, { + get c(){ + return this.a + this.b; + } +}); + +// Shallow object cloning with prototype and descriptors: +var copy = Object.make(Object.getPrototypeOf(src), src); + +// Simple inheritance: +function Vector2D(x, y){ + this.x = x; + this.y = y; +} +Object.define(Vector2D.prototype, { + get xy(){ + return Math.hypot(this.x, this.y); + } +}); +function Vector3D(x, y, z){ + Vector2D.apply(this, arguments); + this.z = z; +} +Vector3D.prototype = Object.make(Vector2D.prototype, { + constructor: Vector3D, + get xyz(){ + return Math.hypot(this.x, this.y, this.z); + } +}); + +var vector = new Vector3D(9, 12, 20); +console.log(vector.xy); // => 15 +console.log(vector.xyz); // => 25 +vector.y++; +console.log(vector.xy); // => 15.811388300841896 +console.log(vector.xyz); // => 25.495097567963924 +``` +#### Dict +Module [`core.dict`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.dict.js). Based on [TC39 discuss](https://github.com/rwaldron/tc39-notes/blob/master/es6/2012-11/nov-29.md#collection-apis-review) / [strawman](http://wiki.ecmascript.org/doku.php?id=harmony:modules_standard#dictionaries). +```js +[new] Dict(iterable (entries) | object ?) -> dict + .isDict(var) -> bool + .values(object) -> iterator + .keys(object) -> iterator + .entries(object) -> iterator (entries) + .has(object, key) -> bool + .get(object, key) -> val + .set(object, key, value) -> object + .forEach(object, fn(val, key, @), that) -> void + .map(object, fn(val, key, @), that) -> new @ + .mapPairs(object, fn(val, key, @), that) -> new @ + .filter(object, fn(val, key, @), that) -> new @ + .some(object, fn(val, key, @), that) -> bool + .every(object, fn(val, key, @), that) -> bool + .find(object, fn(val, key, @), that) -> val + .findKey(object, fn(val, key, @), that) -> key + .keyOf(object, var) -> key + .includes(object, var) -> bool + .reduce(object, fn(memo, val, key, @), memo?) -> var +``` + +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/core/dict +core-js(/library)/fn/dict +``` +`Dict` create object without prototype from iterable or simple object. + +[*Examples*](http://goo.gl/pnp8Vr): +```js +var map = new Map([['a', 1], ['b', 2], ['c', 3]]); + +Dict(); // => {__proto__: null} +Dict({a: 1, b: 2, c: 3}); // => {__proto__: null, a: 1, b: 2, c: 3} +Dict(map); // => {__proto__: null, a: 1, b: 2, c: 3} +Dict([1, 2, 3].entries()); // => {__proto__: null, 0: 1, 1: 2, 2: 3} + +var dict = Dict({a: 42}); +dict instanceof Object; // => false +dict.a; // => 42 +dict.toString; // => undefined +'a' in dict; // => true +'hasOwnProperty' in dict; // => false + +Dict.isDict({}); // => false +Dict.isDict(Dict()); // => true +``` +`Dict.keys`, `Dict.values` and `Dict.entries` returns iterators for objects. + +[*Examples*](http://goo.gl/xAvECH): +```js +var dict = {a: 1, b: 2, c: 3}; + +for(var key of Dict.keys(dict))console.log(key); // => 'a', 'b', 'c' + +for(var val of Dict.values(dict))console.log(val); // => 1, 2, 3 + +for(var [key, val] of Dict.entries(dict)){ + console.log(key); // => 'a', 'b', 'c' + console.log(val); // => 1, 2, 3 +} + +new Map(Dict.entries(dict)); // => Map {a: 1, b: 2, c: 3} +``` +Basic dict operations for objects with prototype [*examples*](http://goo.gl/B28UnG): +```js +'q' in {q: 1}; // => true +'toString' in {}; // => true + +Dict.has({q: 1}, 'q'); // => true +Dict.has({}, 'toString'); // => false + +({q: 1})['q']; // => 1 +({}).toString; // => function toString(){ [native code] } + +Dict.get({q: 1}, 'q'); // => 1 +Dict.get({}, 'toString'); // => undefined + +var O = {}; +O['q'] = 1; +O['q']; // => 1 +O['__proto__'] = {w: 2}; +O['__proto__']; // => {w: 2} +O['w']; // => 2 + +var O = {}; +Dict.set(O, 'q', 1); +O['q']; // => 1 +Dict.set(O, '__proto__', {w: 2}); +O['__proto__']; // => {w: 2} +O['w']; // => undefined +``` +Other methods of `Dict` module are static equivalents of `Array.prototype` methods for dictionaries. + +[*Examples*](http://goo.gl/xFi1RH): +```js +var dict = {a: 1, b: 2, c: 3}; + +Dict.forEach(dict, console.log, console); +// => 1, 'a', {a: 1, b: 2, c: 3} +// => 2, 'b', {a: 1, b: 2, c: 3} +// => 3, 'c', {a: 1, b: 2, c: 3} + +Dict.map(dict, function(it){ + return it * it; +}); // => {a: 1, b: 4, c: 9} + +Dict.mapPairs(dict, function(val, key){ + if(key != 'b')return [key + key, val * val]; +}); // => {aa: 1, cc: 9} + +Dict.filter(dict, function(it){ + return it % 2; +}); // => {a: 1, c: 3} + +Dict.some(dict, function(it){ + return it === 2; +}); // => true + +Dict.every(dict, function(it){ + return it === 2; +}); // => false + +Dict.find(dict, function(it){ + return it > 2; +}); // => 3 +Dict.find(dict, function(it){ + return it > 4; +}); // => undefined + +Dict.findKey(dict, function(it){ + return it > 2; +}); // => 'c' +Dict.findKey(dict, function(it){ + return it > 4; +}); // => undefined + +Dict.keyOf(dict, 2); // => 'b' +Dict.keyOf(dict, 4); // => undefined + +Dict.includes(dict, 2); // => true +Dict.includes(dict, 4); // => false + +Dict.reduce(dict, function(memo, it){ + return memo + it; +}); // => 6 +Dict.reduce(dict, function(memo, it){ + return memo + it; +}, ''); // => '123' +``` +#### Partial application +Module [`core.function.part`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.function.part.js). +```js +Function + #part(...args | _) -> fn(...args) +``` + +[*CommonJS entry points:*](#commonjs) +```js +core-js/core/function +core-js(/library)/fn/function/part +core-js(/library)/fn/function/virtual/part +core-js(/library)/fn/_ +``` +`Function#part` partial apply function without `this` binding. Uses global variable `_` (`core._` for builds without global namespace pollution) as placeholder and not conflict with `Underscore` / `LoDash`. + +[*Examples*](http://goo.gl/p9ZJ8K): +```js +var fn1 = log.part(1, 2); +fn1(3, 4); // => 1, 2, 3, 4 + +var fn2 = log.part(_, 2, _, 4); +fn2(1, 3); // => 1, 2, 3, 4 + +var fn3 = log.part(1, _, _, 4); +fn3(2, 3); // => 1, 2, 3, 4 + +fn2(1, 3, 5); // => 1, 2, 3, 4, 5 +fn2(1); // => 1, 2, undefined, 4 +``` +#### Number Iterator +Module [`core.number.iterator`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.number.iterator.js). +```js +Number + #@@iterator() -> iterator +``` + +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/core/number +core-js(/library)/fn/number/iterator +core-js(/library)/fn/number/virtual/iterator +``` +[*Examples*](http://goo.gl/o45pCN): +```js +for(var i of 3)console.log(i); // => 0, 1, 2 + +[...10]; // => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + +Array.from(10, Math.random); // => [0.9817775336559862, 0.02720663254149258, ...] + +Array.from(10, function(it){ + return this + it * it; +}, .42); // => [0.42, 1.42, 4.42, 9.42, 16.42, 25.42, 36.42, 49.42, 64.42, 81.42] +``` +#### Escaping strings +Modules [`core.regexp.escape`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.regexp.escape.js), [`core.string.escape-html`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.string.escape-html.js) and [`core.string.unescape-html`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.string.unescape-html.js). +```js +RegExp + .escape(str) -> str +String + #escapeHTML() -> str + #unescapeHTML() -> str +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/core/regexp +core-js(/library)/core/string +core-js(/library)/fn/regexp/escape +core-js(/library)/fn/string/escape-html +core-js(/library)/fn/string/unescape-html +core-js(/library)/fn/string/virtual/escape-html +core-js(/library)/fn/string/virtual/unescape-html +``` +[*Examples*](http://goo.gl/6bOvsQ): +```js +RegExp.escape('Hello, []{}()*+?.\\^$|!'); // => 'Hello, \[\]\{\}\(\)\*\+\?\.\\\^\$\|!' + +''.escapeHTML(); // => '<script>doSomething();</script>' +'<script>doSomething();</script>'.unescapeHTML(); // => '' +``` +#### delay +Module [`core.delay`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.delay.js). [Promise](#ecmascript-6-promise)-returning delay function, [esdiscuss](https://esdiscuss.org/topic/promise-returning-delay-function). +```js +delay(ms) -> promise +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/core/delay +core-js(/library)/fn/delay +``` +[*Examples*](http://goo.gl/lbucba): +```js +delay(1e3).then(() => console.log('after 1 sec')); + +(async () => { + await delay(3e3); + console.log('after 3 sec'); + + while(await delay(3e3))console.log('each 3 sec'); +})(); +``` +#### Helpers for iterators +Modules [`core.is-iterable`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.is-iterable.js), [`core.get-iterator`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.get-iterator.js), [`core.get-iterator-method`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.get-iterator-method.js) - helpers for check iterability / get iterator in the `library` version or, for example, for `arguments` object: +```js +core + .isIterable(var) -> bool + .getIterator(iterable) -> iterator + .getIteratorMethod(var) -> function | undefined +``` +[*CommonJS entry points:*](#commonjs) +```js +core-js(/library)/fn/is-iterable +core-js(/library)/fn/get-iterator +core-js(/library)/fn/get-iterator-method +``` +[*Examples*](http://goo.gl/SXsM6D): +```js +var list = (function(){ + return arguments; +})(1, 2, 3); + +console.log(core.isIterable(list)); // true; + +var iter = core.getIterator(list); +console.log(iter.next().value); // 1 +console.log(iter.next().value); // 2 +console.log(iter.next().value); // 3 +console.log(iter.next().value); // undefined + +core.getIterator({}); // TypeError: [object Object] is not iterable! + +var iterFn = core.getIteratorMethod(list); +console.log(typeof iterFn); // 'function' +var iter = iterFn.call(list); +console.log(iter.next().value); // 1 +console.log(iter.next().value); // 2 +console.log(iter.next().value); // 3 +console.log(iter.next().value); // undefined + +console.log(core.getIteratorMethod({})); // undefined +``` + +## Missing polyfills +- ES5 `JSON` is missing now only in IE7- and never will it be added to `core-js`, if you need it in these old browsers, many implementations are available, for example, [json3](https://github.com/bestiejs/json3). +- ES6 `String#normalize` is not a very useful feature, but this polyfill will be very large. If you need it, you can use [unorm](https://github.com/walling/unorm/). +- ES6 `Proxy` can't be polyfilled, but for Node.js / Chromium with additional flags you can try [harmony-reflect](https://github.com/tvcutsem/harmony-reflect) for adapt old style `Proxy` API to final ES6 version. +- ES6 logic for `@@isConcatSpreadable` and `@@species` (in most places) can be polyfilled without problems, but it will cause a serious slowdown in popular cases in some engines. It will be polyfilled when it will be implemented in modern engines. +- ES7 `SIMD`. `core-js` doesn't add polyfill of this feature because of large size and some other reasons. You can use [this polyfill](https://github.com/tc39/ecmascript_simd/blob/master/src/ecmascript_simd.js). +- `window.fetch` is not a cross-platform feature, in some environments it makes no sense. For this reason, I don't think it should be in `core-js`. Looking at a large number of requests it *may be* added in the future. Now you can use, for example, [this polyfill](https://github.com/github/fetch). +- ECMA-402 `Intl` is missed because of size. You can use [this polyfill](https://github.com/andyearnshaw/Intl.js/). diff --git a/node_modules/core-js/bower.json b/node_modules/core-js/bower.json new file mode 100644 index 000000000..0700602a0 --- /dev/null +++ b/node_modules/core-js/bower.json @@ -0,0 +1,49 @@ +{ + "name": "core.js", + "main": "client/core.js", + "version": "2.5.7", + "description": "Standard Library", + "keywords": [ + "ES3", + "ES5", + "ES6", + "ES7", + "ES2015", + "ES2016", + "ES2017", + "ECMAScript 3", + "ECMAScript 5", + "ECMAScript 6", + "ECMAScript 7", + "ECMAScript 2015", + "ECMAScript 2016", + "ECMAScript 2017", + "Harmony", + "Strawman", + "Map", + "Set", + "WeakMap", + "WeakSet", + "Promise", + "Symbol", + "TypedArray", + "setImmediate", + "Dict", + "polyfill", + "shim" + ], + "authors": [ + "Denis Pushkarev (http://zloirock.ru/)" + ], + "license": "MIT", + "homepage": "https://github.com/zloirock/core-js", + "repository": { + "type": "git", + "url": "https://github.com/zloirock/core-js.git" + }, + "ignore": [ + "build", + "node_modules", + "tests" + ] +} diff --git a/node_modules/core-js/build/Gruntfile.ls b/node_modules/core-js/build/Gruntfile.ls new file mode 100644 index 000000000..7b8e46562 --- /dev/null +++ b/node_modules/core-js/build/Gruntfile.ls @@ -0,0 +1,86 @@ +require! <[./build fs ./config]> +module.exports = (grunt)-> + grunt.loadNpmTasks \grunt-contrib-clean + grunt.loadNpmTasks \grunt-contrib-copy + grunt.loadNpmTasks \grunt-contrib-uglify + grunt.loadNpmTasks \grunt-contrib-watch + grunt.loadNpmTasks \grunt-livescript + grunt.loadNpmTasks \grunt-karma + grunt.initConfig do + pkg: grunt.file.readJSON './package.json' + uglify: build: + files: '<%=grunt.option("path")%>.min.js': '<%=grunt.option("path")%>.js' + options: + mangle: {+keep_fnames} + compress: {+keep_fnames, +pure_getters} + output: {max_line_len: 32000} + ie8: on + sourceMap: on + banner: config.banner + livescript: src: files: + './tests/helpers.js': './tests/helpers/*' + './tests/tests.js': './tests/tests/*' + './tests/library.js': './tests/library/*' + './tests/es.js': './tests/tests/es*' + './tests/experimental.js': './tests/experimental/*' + './build/index.js': './build/build.ls*' + clean: <[./library]> + copy: lib: files: + * expand: on + cwd: './' + src: <[es5/** es6/** es7/** stage/** web/** core/** fn/** index.js shim.js]> + dest: './library/' + * expand: on + cwd: './' + src: <[modules/*]> + dest: './library/' + filter: \isFile + * expand: on + cwd: './modules/library/' + src: '*' + dest: './library/modules/' + watch: + core: + files: './modules/*' + tasks: \default + tests: + files: './tests/tests/*' + tasks: \livescript + karma: + 'options': + configFile: './tests/karma.conf.js' + browsers: <[PhantomJS]> + singleRun: on + 'default': {} + 'library': files: <[client/library.js tests/helpers.js tests/library.js]>map -> src: it + grunt.registerTask \build (options)-> + done = @async! + build { + modules: (options || 'es5,es6,es7,js,web,core')split \, + blacklist: (grunt.option(\blacklist) || '')split \, + library: grunt.option(\library) in <[yes on true]> + umd: grunt.option(\umd) not in <[no off false]> + } + .then !-> + grunt.option(\path) || grunt.option(\path, './custom') + fs.writeFile grunt.option(\path) + '.js', it, done + .catch !-> + console.error it + process.exit 1 + grunt.registerTask \client -> + grunt.option \library '' + grunt.option \path './client/core' + grunt.task.run <[build:es5,es6,es7,js,web,core uglify]> + grunt.registerTask \library -> + grunt.option \library 'true' + grunt.option \path './client/library' + grunt.task.run <[build:es5,es6,es7,js,web,core uglify]> + grunt.registerTask \shim -> + grunt.option \library '' + grunt.option \path './client/shim' + grunt.task.run <[build:es5,es6,es7,js,web uglify]> + grunt.registerTask \e -> + grunt.option \library ''> + grunt.option \path './client/core' + grunt.task.run <[build:es5,es6,es7,js,web,core,exp uglify]> + grunt.registerTask \default <[clean copy client library shim]> \ No newline at end of file diff --git a/node_modules/core-js/build/build.ls b/node_modules/core-js/build/build.ls new file mode 100644 index 000000000..6dbfa5825 --- /dev/null +++ b/node_modules/core-js/build/build.ls @@ -0,0 +1,62 @@ +require! { + '../library/fn/promise': Promise + './config': {list, experimental, libraryBlacklist, es5SpecialCase, banner} + fs: {readFile, writeFile, unlink} + path: {basename, dirname, join} + webpack, temp +} + +module.exports = ({modules = [], blacklist = [], library = no, umd = on})-> + resolve, reject <~! new Promise _ + let @ = modules.reduce ((memo, it)-> memo[it] = on; memo), {} + if @exp => for experimental => @[..] = on + if @es5 => for es5SpecialCase => @[..] = on + for ns of @ + if @[ns] + for name in list + if name.indexOf("#ns.") is 0 and name not in experimental + @[name] = on + + if library => blacklist ++= libraryBlacklist + for ns in blacklist + for name in list + if name is ns or name.indexOf("#ns.") is 0 + @[name] = no + + TARGET = temp.path {suffix: '.js'} + + err, info <~! webpack do + entry: list.filter(~> @[it]).map ~> + if library => join __dirname, '..', 'library', 'modules', it + else join __dirname, '..', 'modules', it + output: + path: dirname TARGET + filename: basename "./#TARGET" + if err => return reject err + + err, script <~! readFile TARGET + if err => return reject err + + err <~! unlink TARGET + if err => return reject err + + if umd + exportScript = """ + // CommonJS export + if (typeof module != 'undefined' && module.exports) module.exports = __e; + // RequireJS export + else if (typeof define == 'function' && define.amd) define(function () { return __e; }); + // Export to global object + else __g.core = __e; + """ + else + exportScript = "" + + resolve """ + #banner + !function(__e, __g, undefined){ + 'use strict'; + #script + #exportScript + }(1, 1); + """ \ No newline at end of file diff --git a/node_modules/core-js/build/config.js b/node_modules/core-js/build/config.js new file mode 100644 index 000000000..062d81058 --- /dev/null +++ b/node_modules/core-js/build/config.js @@ -0,0 +1,274 @@ +module.exports = { + list: [ + 'es6.symbol', + 'es6.object.define-property', + 'es6.object.define-properties', + 'es6.object.get-own-property-descriptor', + 'es6.object.create', + 'es6.object.get-prototype-of', + 'es6.object.keys', + 'es6.object.get-own-property-names', + 'es6.object.freeze', + 'es6.object.seal', + 'es6.object.prevent-extensions', + 'es6.object.is-frozen', + 'es6.object.is-sealed', + 'es6.object.is-extensible', + 'es6.object.assign', + 'es6.object.is', + 'es6.object.set-prototype-of', + 'es6.object.to-string', + 'es6.function.bind', + 'es6.function.name', + 'es6.function.has-instance', + 'es6.number.constructor', + 'es6.number.to-fixed', + 'es6.number.to-precision', + 'es6.number.epsilon', + 'es6.number.is-finite', + 'es6.number.is-integer', + 'es6.number.is-nan', + 'es6.number.is-safe-integer', + 'es6.number.max-safe-integer', + 'es6.number.min-safe-integer', + 'es6.number.parse-float', + 'es6.number.parse-int', + 'es6.parse-int', + 'es6.parse-float', + 'es6.math.acosh', + 'es6.math.asinh', + 'es6.math.atanh', + 'es6.math.cbrt', + 'es6.math.clz32', + 'es6.math.cosh', + 'es6.math.expm1', + 'es6.math.fround', + 'es6.math.hypot', + 'es6.math.imul', + 'es6.math.log10', + 'es6.math.log1p', + 'es6.math.log2', + 'es6.math.sign', + 'es6.math.sinh', + 'es6.math.tanh', + 'es6.math.trunc', + 'es6.string.from-code-point', + 'es6.string.raw', + 'es6.string.trim', + 'es6.string.code-point-at', + 'es6.string.ends-with', + 'es6.string.includes', + 'es6.string.repeat', + 'es6.string.starts-with', + 'es6.string.iterator', + 'es6.string.anchor', + 'es6.string.big', + 'es6.string.blink', + 'es6.string.bold', + 'es6.string.fixed', + 'es6.string.fontcolor', + 'es6.string.fontsize', + 'es6.string.italics', + 'es6.string.link', + 'es6.string.small', + 'es6.string.strike', + 'es6.string.sub', + 'es6.string.sup', + 'es6.array.is-array', + 'es6.array.from', + 'es6.array.of', + 'es6.array.join', + 'es6.array.slice', + 'es6.array.sort', + 'es6.array.for-each', + 'es6.array.map', + 'es6.array.filter', + 'es6.array.some', + 'es6.array.every', + 'es6.array.reduce', + 'es6.array.reduce-right', + 'es6.array.index-of', + 'es6.array.last-index-of', + 'es6.array.copy-within', + 'es6.array.fill', + 'es6.array.find', + 'es6.array.find-index', + 'es6.array.iterator', + 'es6.array.species', + 'es6.regexp.constructor', + 'es6.regexp.to-string', + 'es6.regexp.flags', + 'es6.regexp.match', + 'es6.regexp.replace', + 'es6.regexp.search', + 'es6.regexp.split', + 'es6.promise', + 'es6.map', + 'es6.set', + 'es6.weak-map', + 'es6.weak-set', + 'es6.reflect.apply', + 'es6.reflect.construct', + 'es6.reflect.define-property', + 'es6.reflect.delete-property', + 'es6.reflect.enumerate', + 'es6.reflect.get', + 'es6.reflect.get-own-property-descriptor', + 'es6.reflect.get-prototype-of', + 'es6.reflect.has', + 'es6.reflect.is-extensible', + 'es6.reflect.own-keys', + 'es6.reflect.prevent-extensions', + 'es6.reflect.set', + 'es6.reflect.set-prototype-of', + 'es6.date.now', + 'es6.date.to-json', + 'es6.date.to-iso-string', + 'es6.date.to-string', + 'es6.date.to-primitive', + 'es6.typed.array-buffer', + 'es6.typed.data-view', + 'es6.typed.int8-array', + 'es6.typed.uint8-array', + 'es6.typed.uint8-clamped-array', + 'es6.typed.int16-array', + 'es6.typed.uint16-array', + 'es6.typed.int32-array', + 'es6.typed.uint32-array', + 'es6.typed.float32-array', + 'es6.typed.float64-array', + 'es7.array.includes', + 'es7.array.flat-map', + 'es7.array.flatten', + 'es7.string.at', + 'es7.string.pad-start', + 'es7.string.pad-end', + 'es7.string.trim-left', + 'es7.string.trim-right', + 'es7.string.match-all', + 'es7.symbol.async-iterator', + 'es7.symbol.observable', + 'es7.object.get-own-property-descriptors', + 'es7.object.values', + 'es7.object.entries', + 'es7.object.define-getter', + 'es7.object.define-setter', + 'es7.object.lookup-getter', + 'es7.object.lookup-setter', + 'es7.map.to-json', + 'es7.set.to-json', + 'es7.map.of', + 'es7.set.of', + 'es7.weak-map.of', + 'es7.weak-set.of', + 'es7.map.from', + 'es7.set.from', + 'es7.weak-map.from', + 'es7.weak-set.from', + 'es7.global', + 'es7.system.global', + 'es7.error.is-error', + 'es7.math.clamp', + 'es7.math.deg-per-rad', + 'es7.math.degrees', + 'es7.math.fscale', + 'es7.math.iaddh', + 'es7.math.isubh', + 'es7.math.imulh', + 'es7.math.rad-per-deg', + 'es7.math.radians', + 'es7.math.scale', + 'es7.math.umulh', + 'es7.math.signbit', + 'es7.promise.finally', + 'es7.promise.try', + 'es7.reflect.define-metadata', + 'es7.reflect.delete-metadata', + 'es7.reflect.get-metadata', + 'es7.reflect.get-metadata-keys', + 'es7.reflect.get-own-metadata', + 'es7.reflect.get-own-metadata-keys', + 'es7.reflect.has-metadata', + 'es7.reflect.has-own-metadata', + 'es7.reflect.metadata', + 'es7.asap', + 'es7.observable', + 'web.immediate', + 'web.dom.iterable', + 'web.timers', + 'core.dict', + 'core.get-iterator-method', + 'core.get-iterator', + 'core.is-iterable', + 'core.delay', + 'core.function.part', + 'core.object.is-object', + 'core.object.classof', + 'core.object.define', + 'core.object.make', + 'core.number.iterator', + 'core.regexp.escape', + 'core.string.escape-html', + 'core.string.unescape-html', + ], + experimental: [ + ], + libraryBlacklist: [ + 'es6.object.to-string', + 'es6.function.name', + 'es6.regexp.constructor', + 'es6.regexp.to-string', + 'es6.regexp.flags', + 'es6.regexp.match', + 'es6.regexp.replace', + 'es6.regexp.search', + 'es6.regexp.split', + 'es6.number.constructor', + 'es6.date.to-string', + 'es6.date.to-primitive', + ], + es5SpecialCase: [ + 'es6.object.create', + 'es6.object.define-property', + 'es6.object.define-properties', + 'es6.object.get-own-property-descriptor', + 'es6.object.get-prototype-of', + 'es6.object.keys', + 'es6.object.get-own-property-names', + 'es6.object.freeze', + 'es6.object.seal', + 'es6.object.prevent-extensions', + 'es6.object.is-frozen', + 'es6.object.is-sealed', + 'es6.object.is-extensible', + 'es6.function.bind', + 'es6.array.is-array', + 'es6.array.join', + 'es6.array.slice', + 'es6.array.sort', + 'es6.array.for-each', + 'es6.array.map', + 'es6.array.filter', + 'es6.array.some', + 'es6.array.every', + 'es6.array.reduce', + 'es6.array.reduce-right', + 'es6.array.index-of', + 'es6.array.last-index-of', + 'es6.number.to-fixed', + 'es6.number.to-precision', + 'es6.date.now', + 'es6.date.to-iso-string', + 'es6.date.to-json', + 'es6.string.trim', + 'es6.regexp.to-string', + 'es6.parse-int', + 'es6.parse-float', + ], + banner: '/**\n' + + ' * core-js ' + require('../package').version + '\n' + + ' * https://github.com/zloirock/core-js\n' + + ' * License: http://rock.mit-license.org\n' + + ' * © ' + new Date().getFullYear() + ' Denis Pushkarev\n' + + ' */', +}; diff --git a/node_modules/core-js/build/index.js b/node_modules/core-js/build/index.js new file mode 100644 index 000000000..1df7f10cc --- /dev/null +++ b/node_modules/core-js/build/index.js @@ -0,0 +1,104 @@ +// Generated by LiveScript 1.4.0 +(function(){ + var Promise, ref$, list, experimental, libraryBlacklist, es5SpecialCase, banner, readFile, writeFile, unlink, basename, dirname, join, webpack, temp; + Promise = require('../library/fn/promise'); + ref$ = require('./config'), list = ref$.list, experimental = ref$.experimental, libraryBlacklist = ref$.libraryBlacklist, es5SpecialCase = ref$.es5SpecialCase, banner = ref$.banner; + ref$ = require('fs'), readFile = ref$.readFile, writeFile = ref$.writeFile, unlink = ref$.unlink; + ref$ = require('path'), basename = ref$.basename, dirname = ref$.dirname, join = ref$.join; + webpack = require('webpack'); + temp = require('temp'); + module.exports = function(arg$){ + var modules, ref$, blacklist, library, umd, this$ = this; + modules = (ref$ = arg$.modules) != null + ? ref$ + : [], blacklist = (ref$ = arg$.blacklist) != null + ? ref$ + : [], library = (ref$ = arg$.library) != null ? ref$ : false, umd = (ref$ = arg$.umd) != null ? ref$ : true; + return new Promise(function(resolve, reject){ + (function(){ + var i$, x$, ref$, len$, y$, ns, name, j$, len1$, TARGET, this$ = this; + if (this.exp) { + for (i$ = 0, len$ = (ref$ = experimental).length; i$ < len$; ++i$) { + x$ = ref$[i$]; + this[x$] = true; + } + } + if (this.es5) { + for (i$ = 0, len$ = (ref$ = es5SpecialCase).length; i$ < len$; ++i$) { + y$ = ref$[i$]; + this[y$] = true; + } + } + for (ns in this) { + if (this[ns]) { + for (i$ = 0, len$ = (ref$ = list).length; i$ < len$; ++i$) { + name = ref$[i$]; + if (name.indexOf(ns + ".") === 0 && !in$(name, experimental)) { + this[name] = true; + } + } + } + } + if (library) { + blacklist = blacklist.concat(libraryBlacklist); + } + for (i$ = 0, len$ = blacklist.length; i$ < len$; ++i$) { + ns = blacklist[i$]; + for (j$ = 0, len1$ = (ref$ = list).length; j$ < len1$; ++j$) { + name = ref$[j$]; + if (name === ns || name.indexOf(ns + ".") === 0) { + this[name] = false; + } + } + } + TARGET = temp.path({ + suffix: '.js' + }); + webpack({ + entry: list.filter(function(it){ + return this$[it]; + }).map(function(it){ + if (library) { + return join(__dirname, '..', 'library', 'modules', it); + } else { + return join(__dirname, '..', 'modules', it); + } + }), + output: { + path: dirname(TARGET), + filename: basename("./" + TARGET) + } + }, function(err, info){ + if (err) { + return reject(err); + } + readFile(TARGET, function(err, script){ + if (err) { + return reject(err); + } + unlink(TARGET, function(err){ + var exportScript; + if (err) { + return reject(err); + } + if (umd) { + exportScript = "// CommonJS export\nif (typeof module != 'undefined' && module.exports) module.exports = __e;\n// RequireJS export\nelse if (typeof define == 'function' && define.amd) define(function () { return __e; });\n// Export to global object\nelse __g.core = __e;"; + } else { + exportScript = ""; + } + resolve("" + banner + "\n!function(__e, __g, undefined){\n'use strict';\n" + script + "\n" + exportScript + "\n}(1, 1);"); + }); + }); + }); + }.call(modules.reduce(function(memo, it){ + memo[it] = true; + return memo; + }, {}))); + }); + }; + function in$(x, xs){ + var i = -1, l = xs.length >>> 0; + while (++i < l) if (x === xs[i]) return true; + return false; + } +}).call(this); diff --git a/node_modules/core-js/client/core.js b/node_modules/core-js/client/core.js new file mode 100644 index 000000000..61090772b --- /dev/null +++ b/node_modules/core-js/client/core.js @@ -0,0 +1,8645 @@ +/** + * core-js 2.5.7 + * https://github.com/zloirock/core-js + * License: http://rock.mit-license.org + * © 2018 Denis Pushkarev + */ +!function(__e, __g, undefined){ +'use strict'; +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 129); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var core = __webpack_require__(13); +var hide = __webpack_require__(14); +var redefine = __webpack_require__(15); +var ctx = __webpack_require__(19); +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 target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; + var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); + var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); + var key, own, out, exp; + if (IS_GLOBAL) source = name; + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + // export native or passed + out = (own ? target : source)[key]; + // bind timers to global for call from export context + exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // extend global + if (target) redefine(target, key, out, type & $export.U); + // export + if (exports[key] != out) hide(exports, key, exp); + if (IS_PROTO && expProto[key] != out) expProto[key] = out; + } +}; +global.core = core; +// 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; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(3); +module.exports = function (it) { + if (!isObject(it)) throw TypeError(it + ' is not an object!'); + return it; +}; + + +/***/ }), +/* 2 */ +/***/ (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 + + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } +}; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +var store = __webpack_require__(50)('wks'); +var uid = __webpack_require__(36); +var Symbol = __webpack_require__(2).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; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(1); +var IE8_DOM_DEFINE = __webpack_require__(95); +var toPrimitive = __webpack_require__(22); +var dP = Object.defineProperty; + +exports.f = __webpack_require__(7) ? 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; +}; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +// Thank's IE8 for his funny defineProperty +module.exports = !__webpack_require__(4)(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.15 ToLength +var toInteger = __webpack_require__(24); +var min = Math.min; +module.exports = function (it) { + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.13 ToObject(argument) +var defined = __webpack_require__(23); +module.exports = function (it) { + return Object(defined(it)); +}; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports) { + +module.exports = function (it) { + if (typeof it != 'function') throw TypeError(it + ' is not a function!'); + return it; +}; + + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = __webpack_require__(47); +var defined = __webpack_require__(23); +module.exports = function (it) { + return IObject(defined(it)); +}; + + +/***/ }), +/* 12 */ +/***/ (function(module, exports) { + +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function (it, key) { + return hasOwnProperty.call(it, key); +}; + + +/***/ }), +/* 13 */ +/***/ (function(module, exports) { + +var core = module.exports = { version: '2.5.7' }; +if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef + + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(6); +var createDesc = __webpack_require__(31); +module.exports = __webpack_require__(7) ? function (object, key, value) { + return dP.f(object, key, createDesc(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; +}; + + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var hide = __webpack_require__(14); +var has = __webpack_require__(12); +var SRC = __webpack_require__(36)('src'); +var TO_STRING = 'toString'; +var $toString = Function[TO_STRING]; +var TPL = ('' + $toString).split(TO_STRING); + +__webpack_require__(13).inspectSource = function (it) { + return $toString.call(it); +}; + +(module.exports = function (O, key, val, safe) { + var isFunction = typeof val == 'function'; + if (isFunction) has(val, 'name') || hide(val, 'name', key); + if (O[key] === val) return; + if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); + if (O === global) { + O[key] = val; + } else if (!safe) { + delete O[key]; + hide(O, key, val); + } else if (O[key]) { + O[key] = val; + } else { + hide(O, key, val); + } +// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative +})(Function.prototype, TO_STRING, function toString() { + return typeof this == 'function' && this[SRC] || $toString.call(this); +}); + + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +var pIE = __webpack_require__(48); +var createDesc = __webpack_require__(31); +var toIObject = __webpack_require__(11); +var toPrimitive = __webpack_require__(22); +var has = __webpack_require__(12); +var IE8_DOM_DEFINE = __webpack_require__(95); +var gOPD = Object.getOwnPropertyDescriptor; + +exports.f = __webpack_require__(7) ? 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]); +}; + + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) +var has = __webpack_require__(12); +var toObject = __webpack_require__(9); +var IE_PROTO = __webpack_require__(69)('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; +}; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var fails = __webpack_require__(4); +var defined = __webpack_require__(23); +var quot = /"/g; +// B.2.3.2.1 CreateHTML(string, tag, attribute, value) +var createHTML = function (string, tag, attribute, value) { + var S = String(defined(string)); + var p1 = '<' + tag; + if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; + return p1 + '>' + S + ''; +}; +module.exports = function (NAME, exec) { + var O = {}; + O[NAME] = exec(createHTML); + $export($export.P + $export.F * fails(function () { + var test = ''[NAME]('"'); + return test !== test.toLowerCase() || test.split('"').length > 3; + }), 'String', O); +}; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +// optional / simple context binding +var aFunction = __webpack_require__(10); +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); + }; +}; + + +/***/ }), +/* 20 */ +/***/ (function(module, exports) { + +var toString = {}.toString; + +module.exports = function (it) { + return toString.call(it).slice(8, -1); +}; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var fails = __webpack_require__(4); + +module.exports = function (method, arg) { + return !!method && fails(function () { + // eslint-disable-next-line no-useless-call + arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null); + }); +}; + + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = __webpack_require__(3); +// 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"); +}; + + +/***/ }), +/* 23 */ +/***/ (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; +}; + + +/***/ }), +/* 24 */ +/***/ (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); +}; + + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +// most Object methods by ES6 should accept primitives +var $export = __webpack_require__(0); +var core = __webpack_require__(13); +var fails = __webpack_require__(4); +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); +}; + + +/***/ }), +/* 26 */ +/***/ (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__(19); +var IObject = __webpack_require__(47); +var toObject = __webpack_require__(9); +var toLength = __webpack_require__(8); +var asc = __webpack_require__(85); +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; + }; +}; + + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = __webpack_require__(97); +var enumBugKeys = __webpack_require__(70); + +module.exports = Object.keys || function keys(O) { + return $keys(O, enumBugKeys); +}; + + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +var anObject = __webpack_require__(1); +var dPs = __webpack_require__(98); +var enumBugKeys = __webpack_require__(70); +var IE_PROTO = __webpack_require__(69)('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__(67)('iframe'); + var i = enumBugKeys.length; + var lt = '<'; + var gt = '>'; + var iframeDocument; + iframe.style.display = 'none'; + __webpack_require__(71).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); +}; + + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +if (__webpack_require__(7)) { + var LIBRARY = __webpack_require__(33); + var global = __webpack_require__(2); + var fails = __webpack_require__(4); + var $export = __webpack_require__(0); + var $typed = __webpack_require__(63); + var $buffer = __webpack_require__(93); + var ctx = __webpack_require__(19); + var anInstance = __webpack_require__(42); + var propertyDesc = __webpack_require__(31); + var hide = __webpack_require__(14); + var redefineAll = __webpack_require__(43); + var toInteger = __webpack_require__(24); + var toLength = __webpack_require__(8); + var toIndex = __webpack_require__(118); + var toAbsoluteIndex = __webpack_require__(37); + var toPrimitive = __webpack_require__(22); + var has = __webpack_require__(12); + var classof = __webpack_require__(39); + var isObject = __webpack_require__(3); + var toObject = __webpack_require__(9); + var isArrayIter = __webpack_require__(83); + var create = __webpack_require__(28); + var getPrototypeOf = __webpack_require__(17); + var gOPN = __webpack_require__(38).f; + var getIterFn = __webpack_require__(49); + var uid = __webpack_require__(36); + var wks = __webpack_require__(5); + var createArrayMethod = __webpack_require__(26); + var createArrayIncludes = __webpack_require__(51); + var speciesConstructor = __webpack_require__(60); + var ArrayIterators = __webpack_require__(87); + var Iterators = __webpack_require__(40); + var $iterDetect = __webpack_require__(57); + var setSpecies = __webpack_require__(41); + var arrayFill = __webpack_require__(86); + var arrayCopyWithin = __webpack_require__(109); + var $DP = __webpack_require__(6); + var $GOPD = __webpack_require__(16); + var dP = $DP.f; + var gOPD = $GOPD.f; + var RangeError = global.RangeError; + var TypeError = global.TypeError; + var Uint8Array = global.Uint8Array; + var ARRAY_BUFFER = 'ArrayBuffer'; + var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER; + var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; + var PROTOTYPE = 'prototype'; + var ArrayProto = Array[PROTOTYPE]; + var $ArrayBuffer = $buffer.ArrayBuffer; + var $DataView = $buffer.DataView; + var arrayForEach = createArrayMethod(0); + var arrayFilter = createArrayMethod(2); + var arraySome = createArrayMethod(3); + var arrayEvery = createArrayMethod(4); + var arrayFind = createArrayMethod(5); + var arrayFindIndex = createArrayMethod(6); + var arrayIncludes = createArrayIncludes(true); + var arrayIndexOf = createArrayIncludes(false); + var arrayValues = ArrayIterators.values; + var arrayKeys = ArrayIterators.keys; + var arrayEntries = ArrayIterators.entries; + var arrayLastIndexOf = ArrayProto.lastIndexOf; + var arrayReduce = ArrayProto.reduce; + var arrayReduceRight = ArrayProto.reduceRight; + var arrayJoin = ArrayProto.join; + var arraySort = ArrayProto.sort; + var arraySlice = ArrayProto.slice; + var arrayToString = ArrayProto.toString; + var arrayToLocaleString = ArrayProto.toLocaleString; + var ITERATOR = wks('iterator'); + var TAG = wks('toStringTag'); + var TYPED_CONSTRUCTOR = uid('typed_constructor'); + var DEF_CONSTRUCTOR = uid('def_constructor'); + var ALL_CONSTRUCTORS = $typed.CONSTR; + var TYPED_ARRAY = $typed.TYPED; + var VIEW = $typed.VIEW; + var WRONG_LENGTH = 'Wrong length!'; + + var $map = createArrayMethod(1, function (O, length) { + return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); + }); + + var LITTLE_ENDIAN = fails(function () { + // eslint-disable-next-line no-undef + return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; + }); + + var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () { + new Uint8Array(1).set({}); + }); + + var toOffset = function (it, BYTES) { + var offset = toInteger(it); + if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!'); + return offset; + }; + + var validate = function (it) { + if (isObject(it) && TYPED_ARRAY in it) return it; + throw TypeError(it + ' is not a typed array!'); + }; + + var allocate = function (C, length) { + if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) { + throw TypeError('It is not a typed array constructor!'); + } return new C(length); + }; + + var speciesFromList = function (O, list) { + return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); + }; + + var fromList = function (C, list) { + var index = 0; + var length = list.length; + var result = allocate(C, length); + while (length > index) result[index] = list[index++]; + return result; + }; + + var addGetter = function (it, key, internal) { + dP(it, key, { get: function () { return this._d[internal]; } }); + }; + + var $from = function from(source /* , mapfn, thisArg */) { + var O = toObject(source); + var aLen = arguments.length; + var mapfn = aLen > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var iterFn = getIterFn(O); + var i, length, values, result, step, iterator; + if (iterFn != undefined && !isArrayIter(iterFn)) { + for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) { + values.push(step.value); + } O = values; + } + if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2); + for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) { + result[i] = mapping ? mapfn(O[i], i) : O[i]; + } + return result; + }; + + var $of = function of(/* ...items */) { + var index = 0; + var length = arguments.length; + var result = allocate(this, length); + while (length > index) result[index] = arguments[index++]; + return result; + }; + + // iOS Safari 6.x fails here + var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); }); + + var $toLocaleString = function toLocaleString() { + return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); + }; + + var proto = { + copyWithin: function copyWithin(target, start /* , end */) { + return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); + }, + every: function every(callbackfn /* , thisArg */) { + return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars + return arrayFill.apply(validate(this), arguments); + }, + filter: function filter(callbackfn /* , thisArg */) { + return speciesFromList(this, arrayFilter(validate(this), callbackfn, + arguments.length > 1 ? arguments[1] : undefined)); + }, + find: function find(predicate /* , thisArg */) { + return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + findIndex: function findIndex(predicate /* , thisArg */) { + return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + forEach: function forEach(callbackfn /* , thisArg */) { + arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + indexOf: function indexOf(searchElement /* , fromIndex */) { + return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + includes: function includes(searchElement /* , fromIndex */) { + return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + join: function join(separator) { // eslint-disable-line no-unused-vars + return arrayJoin.apply(validate(this), arguments); + }, + lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars + return arrayLastIndexOf.apply(validate(this), arguments); + }, + map: function map(mapfn /* , thisArg */) { + return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); + }, + reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars + return arrayReduce.apply(validate(this), arguments); + }, + reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars + return arrayReduceRight.apply(validate(this), arguments); + }, + reverse: function reverse() { + var that = this; + var length = validate(that).length; + var middle = Math.floor(length / 2); + var index = 0; + var value; + while (index < middle) { + value = that[index]; + that[index++] = that[--length]; + that[length] = value; + } return that; + }, + some: function some(callbackfn /* , thisArg */) { + return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + sort: function sort(comparefn) { + return arraySort.call(validate(this), comparefn); + }, + subarray: function subarray(begin, end) { + var O = validate(this); + var length = O.length; + var $begin = toAbsoluteIndex(begin, length); + return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( + O.buffer, + O.byteOffset + $begin * O.BYTES_PER_ELEMENT, + toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin) + ); + } + }; + + var $slice = function slice(start, end) { + return speciesFromList(this, arraySlice.call(validate(this), start, end)); + }; + + var $set = function set(arrayLike /* , offset */) { + validate(this); + var offset = toOffset(arguments[1], 1); + var length = this.length; + var src = toObject(arrayLike); + var len = toLength(src.length); + var index = 0; + if (len + offset > length) throw RangeError(WRONG_LENGTH); + while (index < len) this[offset + index] = src[index++]; + }; + + var $iterators = { + entries: function entries() { + return arrayEntries.call(validate(this)); + }, + keys: function keys() { + return arrayKeys.call(validate(this)); + }, + values: function values() { + return arrayValues.call(validate(this)); + } + }; + + var isTAIndex = function (target, key) { + return isObject(target) + && target[TYPED_ARRAY] + && typeof key != 'symbol' + && key in target + && String(+key) == String(key); + }; + var $getDesc = function getOwnPropertyDescriptor(target, key) { + return isTAIndex(target, key = toPrimitive(key, true)) + ? propertyDesc(2, target[key]) + : gOPD(target, key); + }; + var $setDesc = function defineProperty(target, key, desc) { + if (isTAIndex(target, key = toPrimitive(key, true)) + && isObject(desc) + && has(desc, 'value') + && !has(desc, 'get') + && !has(desc, 'set') + // TODO: add validation descriptor w/o calling accessors + && !desc.configurable + && (!has(desc, 'writable') || desc.writable) + && (!has(desc, 'enumerable') || desc.enumerable) + ) { + target[key] = desc.value; + return target; + } return dP(target, key, desc); + }; + + if (!ALL_CONSTRUCTORS) { + $GOPD.f = $getDesc; + $DP.f = $setDesc; + } + + $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { + getOwnPropertyDescriptor: $getDesc, + defineProperty: $setDesc + }); + + if (fails(function () { arrayToString.call({}); })) { + arrayToString = arrayToLocaleString = function toString() { + return arrayJoin.call(this); + }; + } + + var $TypedArrayPrototype$ = redefineAll({}, proto); + redefineAll($TypedArrayPrototype$, $iterators); + hide($TypedArrayPrototype$, ITERATOR, $iterators.values); + redefineAll($TypedArrayPrototype$, { + slice: $slice, + set: $set, + constructor: function () { /* noop */ }, + toString: arrayToString, + toLocaleString: $toLocaleString + }); + addGetter($TypedArrayPrototype$, 'buffer', 'b'); + addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); + addGetter($TypedArrayPrototype$, 'byteLength', 'l'); + addGetter($TypedArrayPrototype$, 'length', 'e'); + dP($TypedArrayPrototype$, TAG, { + get: function () { return this[TYPED_ARRAY]; } + }); + + // eslint-disable-next-line max-statements + module.exports = function (KEY, BYTES, wrapper, CLAMPED) { + CLAMPED = !!CLAMPED; + var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'; + var GETTER = 'get' + KEY; + var SETTER = 'set' + KEY; + var TypedArray = global[NAME]; + var Base = TypedArray || {}; + var TAC = TypedArray && getPrototypeOf(TypedArray); + var FORCED = !TypedArray || !$typed.ABV; + var O = {}; + var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; + var getter = function (that, index) { + var data = that._d; + return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); + }; + var setter = function (that, index, value) { + var data = that._d; + if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; + data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); + }; + var addElement = function (that, index) { + dP(that, index, { + get: function () { + return getter(this, index); + }, + set: function (value) { + return setter(this, index, value); + }, + enumerable: true + }); + }; + if (FORCED) { + TypedArray = wrapper(function (that, data, $offset, $length) { + anInstance(that, TypedArray, NAME, '_d'); + var index = 0; + var offset = 0; + var buffer, byteLength, length, klass; + if (!isObject(data)) { + length = toIndex(data); + byteLength = length * BYTES; + buffer = new $ArrayBuffer(byteLength); + } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { + buffer = data; + offset = toOffset($offset, BYTES); + var $len = data.byteLength; + if ($length === undefined) { + if ($len % BYTES) throw RangeError(WRONG_LENGTH); + byteLength = $len - offset; + if (byteLength < 0) throw RangeError(WRONG_LENGTH); + } else { + byteLength = toLength($length) * BYTES; + if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH); + } + length = byteLength / BYTES; + } else if (TYPED_ARRAY in data) { + return fromList(TypedArray, data); + } else { + return $from.call(TypedArray, data); + } + hide(that, '_d', { + b: buffer, + o: offset, + l: byteLength, + e: length, + v: new $DataView(buffer) + }); + while (index < length) addElement(that, index++); + }); + TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); + hide(TypedArrayPrototype, 'constructor', TypedArray); + } else if (!fails(function () { + TypedArray(1); + }) || !fails(function () { + new TypedArray(-1); // eslint-disable-line no-new + }) || !$iterDetect(function (iter) { + new TypedArray(); // eslint-disable-line no-new + new TypedArray(null); // eslint-disable-line no-new + new TypedArray(1.5); // eslint-disable-line no-new + new TypedArray(iter); // eslint-disable-line no-new + }, true)) { + TypedArray = wrapper(function (that, data, $offset, $length) { + anInstance(that, TypedArray, NAME); + var klass; + // `ws` module bug, temporarily remove validation length for Uint8Array + // https://github.com/websockets/ws/pull/645 + if (!isObject(data)) return new Base(toIndex(data)); + if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { + return $length !== undefined + ? new Base(data, toOffset($offset, BYTES), $length) + : $offset !== undefined + ? new Base(data, toOffset($offset, BYTES)) + : new Base(data); + } + if (TYPED_ARRAY in data) return fromList(TypedArray, data); + return $from.call(TypedArray, data); + }); + arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) { + if (!(key in TypedArray)) hide(TypedArray, key, Base[key]); + }); + TypedArray[PROTOTYPE] = TypedArrayPrototype; + if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray; + } + var $nativeIterator = TypedArrayPrototype[ITERATOR]; + var CORRECT_ITER_NAME = !!$nativeIterator + && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined); + var $iterator = $iterators.values; + hide(TypedArray, TYPED_CONSTRUCTOR, true); + hide(TypedArrayPrototype, TYPED_ARRAY, NAME); + hide(TypedArrayPrototype, VIEW, true); + hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); + + if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) { + dP(TypedArrayPrototype, TAG, { + get: function () { return NAME; } + }); + } + + O[NAME] = TypedArray; + + $export($export.G + $export.W + $export.F * (TypedArray != Base), O); + + $export($export.S, NAME, { + BYTES_PER_ELEMENT: BYTES + }); + + $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, { + from: $from, + of: $of + }); + + if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); + + $export($export.P, NAME, proto); + + setSpecies(NAME); + + $export($export.P + $export.F * FORCED_SET, NAME, { set: $set }); + + $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); + + if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString; + + $export($export.P + $export.F * fails(function () { + new TypedArray(1).slice(); + }), NAME, { slice: $slice }); + + $export($export.P + $export.F * (fails(function () { + return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString(); + }) || !fails(function () { + TypedArrayPrototype.toLocaleString.call([1, 2]); + })), NAME, { toLocaleString: $toLocaleString }); + + Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; + if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator); + }; +} else module.exports = function () { /* empty */ }; + + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +var Map = __webpack_require__(113); +var $export = __webpack_require__(0); +var shared = __webpack_require__(50)('metadata'); +var store = shared.store || (shared.store = new (__webpack_require__(116))()); + +var getOrCreateMetadataMap = function (target, targetKey, create) { + var targetMetadata = store.get(target); + if (!targetMetadata) { + if (!create) return undefined; + store.set(target, targetMetadata = new Map()); + } + var keyMetadata = targetMetadata.get(targetKey); + if (!keyMetadata) { + if (!create) return undefined; + targetMetadata.set(targetKey, keyMetadata = new Map()); + } return keyMetadata; +}; +var ordinaryHasOwnMetadata = function (MetadataKey, O, P) { + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? false : metadataMap.has(MetadataKey); +}; +var ordinaryGetOwnMetadata = function (MetadataKey, O, P) { + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); +}; +var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) { + getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); +}; +var ordinaryOwnMetadataKeys = function (target, targetKey) { + var metadataMap = getOrCreateMetadataMap(target, targetKey, false); + var keys = []; + if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); }); + return keys; +}; +var toMetaKey = function (it) { + return it === undefined || typeof it == 'symbol' ? it : String(it); +}; +var exp = function (O) { + $export($export.S, 'Reflect', O); +}; + +module.exports = { + store: store, + map: getOrCreateMetadataMap, + has: ordinaryHasOwnMetadata, + get: ordinaryGetOwnMetadata, + set: ordinaryDefineOwnMetadata, + keys: ordinaryOwnMetadataKeys, + key: toMetaKey, + exp: exp +}; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports) { + +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; + + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +var META = __webpack_require__(36)('meta'); +var isObject = __webpack_require__(3); +var has = __webpack_require__(12); +var setDesc = __webpack_require__(6).f; +var id = 0; +var isExtensible = Object.isExtensible || function () { + return true; +}; +var FREEZE = !__webpack_require__(4)(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 +}; + + +/***/ }), +/* 33 */ +/***/ (function(module, exports) { + +module.exports = false; + + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +// 22.1.3.31 Array.prototype[@@unscopables] +var UNSCOPABLES = __webpack_require__(5)('unscopables'); +var ArrayProto = Array.prototype; +if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(14)(ArrayProto, UNSCOPABLES, {}); +module.exports = function (key) { + ArrayProto[UNSCOPABLES][key] = true; +}; + + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +var ctx = __webpack_require__(19); +var call = __webpack_require__(107); +var isArrayIter = __webpack_require__(83); +var anObject = __webpack_require__(1); +var toLength = __webpack_require__(8); +var getIterFn = __webpack_require__(49); +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; + + +/***/ }), +/* 36 */ +/***/ (function(module, exports) { + +var id = 0; +var px = Math.random(); +module.exports = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; + + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__(24); +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); +}; + + +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) +var $keys = __webpack_require__(97); +var hiddenKeys = __webpack_require__(70).concat('length', 'prototype'); + +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return $keys(O, hiddenKeys); +}; + + +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { + +// getting tag from 19.1.3.6 Object.prototype.toString() +var cof = __webpack_require__(20); +var TAG = __webpack_require__(5)('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; +}; + + +/***/ }), +/* 40 */ +/***/ (function(module, exports) { + +module.exports = {}; + + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(2); +var dP = __webpack_require__(6); +var DESCRIPTORS = __webpack_require__(7); +var SPECIES = __webpack_require__(5)('species'); + +module.exports = function (KEY) { + var C = global[KEY]; + if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { + configurable: true, + get: function () { return this; } + }); +}; + + +/***/ }), +/* 42 */ +/***/ (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; +}; + + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +var redefine = __webpack_require__(15); +module.exports = function (target, src, safe) { + for (var key in src) redefine(target, key, src[key], safe); + return target; +}; + + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +var def = __webpack_require__(6).f; +var has = __webpack_require__(12); +var TAG = __webpack_require__(5)('toStringTag'); + +module.exports = function (it, tag, stat) { + if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); +}; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var defined = __webpack_require__(23); +var fails = __webpack_require__(4); +var spaces = __webpack_require__(76); +var space = '[' + spaces + ']'; +var non = '\u200b\u0085'; +var ltrim = RegExp('^' + space + space + '*'); +var rtrim = RegExp(space + space + '*$'); + +var exporter = function (KEY, exec, ALIAS) { + var exp = {}; + var FORCE = fails(function () { + return !!spaces[KEY]() || non[KEY]() != non; + }); + var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; + if (ALIAS) exp[ALIAS] = fn; + $export($export.P + $export.F * FORCE, 'String', exp); +}; + +// 1 -> String#trimLeft +// 2 -> String#trimRight +// 3 -> String#trim +var trim = exporter.trim = function (string, TYPE) { + string = String(defined(string)); + if (TYPE & 1) string = string.replace(ltrim, ''); + if (TYPE & 2) string = string.replace(rtrim, ''); + return string; +}; + +module.exports = exporter; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(3); +module.exports = function (it, TYPE) { + if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); + return it; +}; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = __webpack_require__(20); +// eslint-disable-next-line no-prototype-builtins +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { + return cof(it) == 'String' ? it.split('') : Object(it); +}; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports) { + +exports.f = {}.propertyIsEnumerable; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +var classof = __webpack_require__(39); +var ITERATOR = __webpack_require__(5)('iterator'); +var Iterators = __webpack_require__(40); +module.exports = __webpack_require__(13).getIteratorMethod = function (it) { + if (it != undefined) return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; +}; + + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + +var core = __webpack_require__(13); +var global = __webpack_require__(2); +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__(33) ? 'pure' : 'global', + copyright: '© 2018 Denis Pushkarev (zloirock.ru)' +}); + + +/***/ }), +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { + +// false -> Array#indexOf +// true -> Array#includes +var toIObject = __webpack_require__(11); +var toLength = __webpack_require__(8); +var toAbsoluteIndex = __webpack_require__(37); +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; + }; +}; + + +/***/ }), +/* 52 */ +/***/ (function(module, exports) { + +exports.f = Object.getOwnPropertySymbols; + + +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.2.2 IsArray(argument) +var cof = __webpack_require__(20); +module.exports = Array.isArray || function isArray(arg) { + return cof(arg) == 'Array'; +}; + + +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.2.8 IsRegExp(argument) +var isObject = __webpack_require__(3); +var cof = __webpack_require__(20); +var MATCH = __webpack_require__(5)('match'); +module.exports = function (it) { + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); +}; + + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var LIBRARY = __webpack_require__(33); +var $export = __webpack_require__(0); +var redefine = __webpack_require__(15); +var hide = __webpack_require__(14); +var Iterators = __webpack_require__(40); +var $iterCreate = __webpack_require__(56); +var setToStringTag = __webpack_require__(44); +var getPrototypeOf = __webpack_require__(17); +var ITERATOR = __webpack_require__(5)('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; +}; + + +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var create = __webpack_require__(28); +var descriptor = __webpack_require__(31); +var setToStringTag = __webpack_require__(44); +var IteratorPrototype = {}; + +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +__webpack_require__(14)(IteratorPrototype, __webpack_require__(5)('iterator'), function () { return this; }); + +module.exports = function (Constructor, NAME, next) { + Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); + setToStringTag(Constructor, NAME + ' Iterator'); +}; + + +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { + +var ITERATOR = __webpack_require__(5)('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; +}; + + +/***/ }), +/* 58 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 21.2.5.3 get RegExp.prototype.flags +var anObject = __webpack_require__(1); +module.exports = function () { + var that = anObject(this); + var result = ''; + if (that.global) result += 'g'; + if (that.ignoreCase) result += 'i'; + if (that.multiline) result += 'm'; + if (that.unicode) result += 'u'; + if (that.sticky) result += 'y'; + return result; +}; + + +/***/ }), +/* 59 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var hide = __webpack_require__(14); +var redefine = __webpack_require__(15); +var fails = __webpack_require__(4); +var defined = __webpack_require__(23); +var wks = __webpack_require__(5); + +module.exports = function (KEY, length, exec) { + var SYMBOL = wks(KEY); + var fns = exec(defined, SYMBOL, ''[KEY]); + var strfn = fns[0]; + var rxfn = fns[1]; + if (fails(function () { + var O = {}; + O[SYMBOL] = function () { return 7; }; + return ''[KEY](O) != 7; + })) { + redefine(String.prototype, KEY, strfn); + hide(RegExp.prototype, SYMBOL, length == 2 + // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) + // 21.2.5.11 RegExp.prototype[@@split](string, limit) + ? function (string, arg) { return rxfn.call(string, this, arg); } + // 21.2.5.6 RegExp.prototype[@@match](string) + // 21.2.5.9 RegExp.prototype[@@search](string) + : function (string) { return rxfn.call(string, this); } + ); + } +}; + + +/***/ }), +/* 60 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.3.20 SpeciesConstructor(O, defaultConstructor) +var anObject = __webpack_require__(1); +var aFunction = __webpack_require__(10); +var SPECIES = __webpack_require__(5)('species'); +module.exports = function (O, D) { + var C = anObject(O).constructor; + var S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); +}; + + +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var navigator = global.navigator; + +module.exports = navigator && navigator.userAgent || ''; + + +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(2); +var $export = __webpack_require__(0); +var redefine = __webpack_require__(15); +var redefineAll = __webpack_require__(43); +var meta = __webpack_require__(32); +var forOf = __webpack_require__(35); +var anInstance = __webpack_require__(42); +var isObject = __webpack_require__(3); +var fails = __webpack_require__(4); +var $iterDetect = __webpack_require__(57); +var setToStringTag = __webpack_require__(44); +var inheritIfRequired = __webpack_require__(75); + +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 = {}; + var fixMethod = function (KEY) { + var fn = proto[KEY]; + redefine(proto, KEY, + KEY == 'delete' ? function (a) { + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'has' ? function has(a) { + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'get' ? function get(a) { + return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; } + : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; } + ); + }; + if (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 { + var instance = new C(); + // early implementations not supports chaining + var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; + // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false + var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); + // most early implementations doesn't supports iterables, most modern - not close it correctly + var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new + // for early implementations -0 and +0 not the same + var BUGGY_ZERO = !IS_WEAK && fails(function () { + // V8 ~ Chromium 42- fails only with 5+ elements + var $instance = new C(); + var index = 5; + while (index--) $instance[ADDER](index, index); + return !$instance.has(-0); + }); + if (!ACCEPT_ITERABLES) { + C = wrapper(function (target, iterable) { + anInstance(target, C, NAME); + var that = inheritIfRequired(new Base(), target, C); + if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); + return that; + }); + C.prototype = proto; + proto.constructor = C; + } + if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { + fixMethod('delete'); + fixMethod('has'); + IS_MAP && fixMethod('get'); + } + if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); + // weak collections should not contains .clear method + if (IS_WEAK && proto.clear) delete proto.clear; + } + + setToStringTag(C, NAME); + + O[NAME] = C; + $export($export.G + $export.W + $export.F * (C != Base), O); + + if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); + + return C; +}; + + +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var hide = __webpack_require__(14); +var uid = __webpack_require__(36); +var TYPED = uid('typed_array'); +var VIEW = uid('view'); +var ABV = !!(global.ArrayBuffer && global.DataView); +var CONSTR = ABV; +var i = 0; +var l = 9; +var Typed; + +var TypedArrayConstructors = ( + 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' +).split(','); + +while (i < l) { + if (Typed = global[TypedArrayConstructors[i++]]) { + hide(Typed.prototype, TYPED, true); + hide(Typed.prototype, VIEW, true); + } else CONSTR = false; +} + +module.exports = { + ABV: ABV, + CONSTR: CONSTR, + TYPED: TYPED, + VIEW: VIEW +}; + + +/***/ }), +/* 64 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// Forced replacement prototype accessors methods +module.exports = __webpack_require__(33) || !__webpack_require__(4)(function () { + var K = Math.random(); + // In FF throws only define methods + // eslint-disable-next-line no-undef, no-useless-call + __defineSetter__.call(null, K, function () { /* empty */ }); + delete __webpack_require__(2)[K]; +}); + + +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-setmap-offrom/ +var $export = __webpack_require__(0); + +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); + } }); +}; + + +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-setmap-offrom/ +var $export = __webpack_require__(0); +var aFunction = __webpack_require__(10); +var ctx = __webpack_require__(19); +var forOf = __webpack_require__(35); + +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); + } }); +}; + + +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(3); +var document = __webpack_require__(2).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) : {}; +}; + + +/***/ }), +/* 68 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var core = __webpack_require__(13); +var LIBRARY = __webpack_require__(33); +var wksExt = __webpack_require__(96); +var defineProperty = __webpack_require__(6).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) }); +}; + + +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { + +var shared = __webpack_require__(50)('keys'); +var uid = __webpack_require__(36); +module.exports = function (key) { + return shared[key] || (shared[key] = uid(key)); +}; + + +/***/ }), +/* 70 */ +/***/ (function(module, exports) { + +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); + + +/***/ }), +/* 71 */ +/***/ (function(module, exports, __webpack_require__) { + +var document = __webpack_require__(2).document; +module.exports = document && document.documentElement; + + +/***/ }), +/* 72 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 19.1.2.1 Object.assign(target, source, ...) +var getKeys = __webpack_require__(27); +var gOPS = __webpack_require__(52); +var pIE = __webpack_require__(48); +var toObject = __webpack_require__(9); +var IObject = __webpack_require__(47); +var $assign = Object.assign; + +// should work with symbols and should have deterministic property order (V8 bug) +module.exports = !$assign || __webpack_require__(4)(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) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; + } return T; +} : $assign; + + +/***/ }), +/* 73 */ +/***/ (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__(3); +var anObject = __webpack_require__(1); +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__(19)(Function.call, __webpack_require__(16).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 +}; + + +/***/ }), +/* 74 */ +/***/ (function(module, exports) { + +// fast apply, http://jsperf.lnkit.com/fast-apply/5 +module.exports = function (fn, args, that) { + var un = that === undefined; + switch (args.length) { + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); +}; + + +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(3); +var setPrototypeOf = __webpack_require__(73).set; +module.exports = function (that, target, C) { + var S = target.constructor; + var P; + if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { + setPrototypeOf(that, P); + } return that; +}; + + +/***/ }), +/* 76 */ +/***/ (function(module, exports) { + +module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; + + +/***/ }), +/* 77 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var toInteger = __webpack_require__(24); +var defined = __webpack_require__(23); + +module.exports = function repeat(count) { + var str = String(defined(this)); + var res = ''; + var n = toInteger(count); + if (n < 0 || n == Infinity) throw RangeError("Count can't be negative"); + for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str; + return res; +}; + + +/***/ }), +/* 78 */ +/***/ (function(module, exports) { + +// 20.2.2.28 Math.sign(x) +module.exports = Math.sign || function sign(x) { + // eslint-disable-next-line no-self-compare + return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; +}; + + +/***/ }), +/* 79 */ +/***/ (function(module, exports) { + +// 20.2.2.14 Math.expm1(x) +var $expm1 = Math.expm1; +module.exports = (!$expm1 + // Old FF bug + || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 + // Tor Browser bug + || $expm1(-2e-17) != -2e-17 +) ? function expm1(x) { + return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; +} : $expm1; + + +/***/ }), +/* 80 */ +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__(24); +var defined = __webpack_require__(23); +// 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; + }; +}; + + +/***/ }), +/* 81 */ +/***/ (function(module, exports, __webpack_require__) { + +// helper for String#{startsWith, endsWith, includes} +var isRegExp = __webpack_require__(54); +var defined = __webpack_require__(23); + +module.exports = function (that, searchString, NAME) { + if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); + return String(defined(that)); +}; + + +/***/ }), +/* 82 */ +/***/ (function(module, exports, __webpack_require__) { + +var MATCH = __webpack_require__(5)('match'); +module.exports = function (KEY) { + var re = /./; + try { + '/./'[KEY](re); + } catch (e) { + try { + re[MATCH] = false; + return !'/./'[KEY](re); + } catch (f) { /* empty */ } + } return true; +}; + + +/***/ }), +/* 83 */ +/***/ (function(module, exports, __webpack_require__) { + +// check on default Array iterator +var Iterators = __webpack_require__(40); +var ITERATOR = __webpack_require__(5)('iterator'); +var ArrayProto = Array.prototype; + +module.exports = function (it) { + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); +}; + + +/***/ }), +/* 84 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $defineProperty = __webpack_require__(6); +var createDesc = __webpack_require__(31); + +module.exports = function (object, index, value) { + if (index in object) $defineProperty.f(object, index, createDesc(0, value)); + else object[index] = value; +}; + + +/***/ }), +/* 85 */ +/***/ (function(module, exports, __webpack_require__) { + +// 9.4.2.3 ArraySpeciesCreate(originalArray, length) +var speciesConstructor = __webpack_require__(213); + +module.exports = function (original, length) { + return new (speciesConstructor(original))(length); +}; + + +/***/ }), +/* 86 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) + +var toObject = __webpack_require__(9); +var toAbsoluteIndex = __webpack_require__(37); +var toLength = __webpack_require__(8); +module.exports = function fill(value /* , start = 0, end = @length */) { + var O = toObject(this); + var length = toLength(O.length); + var aLen = arguments.length; + var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); + var end = aLen > 2 ? arguments[2] : undefined; + var endPos = end === undefined ? length : toAbsoluteIndex(end, length); + while (endPos > index) O[index++] = value; + return O; +}; + + +/***/ }), +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var addToUnscopables = __webpack_require__(34); +var step = __webpack_require__(88); +var Iterators = __webpack_require__(40); +var toIObject = __webpack_require__(11); + +// 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__(55)(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'); + + +/***/ }), +/* 88 */ +/***/ (function(module, exports) { + +module.exports = function (done, value) { + return { value: value, done: !!done }; +}; + + +/***/ }), +/* 89 */ +/***/ (function(module, exports, __webpack_require__) { + +var ctx = __webpack_require__(19); +var invoke = __webpack_require__(74); +var html = __webpack_require__(71); +var cel = __webpack_require__(67); +var global = __webpack_require__(2); +var process = global.process; +var setTask = global.setImmediate; +var clearTask = global.clearImmediate; +var MessageChannel = global.MessageChannel; +var Dispatch = global.Dispatch; +var counter = 0; +var queue = {}; +var ONREADYSTATECHANGE = 'onreadystatechange'; +var defer, channel, port; +var run = function () { + var id = +this; + // eslint-disable-next-line no-prototype-builtins + if (queue.hasOwnProperty(id)) { + var fn = queue[id]; + delete queue[id]; + fn(); + } +}; +var listener = function (event) { + run.call(event.data); +}; +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: +if (!setTask || !clearTask) { + setTask = function setImmediate(fn) { + var args = []; + var i = 1; + while (arguments.length > i) args.push(arguments[i++]); + queue[++counter] = function () { + // eslint-disable-next-line no-new-func + invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id) { + delete queue[id]; + }; + // Node.js 0.8- + if (__webpack_require__(20)(process) == 'process') { + defer = function (id) { + process.nextTick(ctx(run, id, 1)); + }; + // Sphere (JS game engine) Dispatch API + } else if (Dispatch && Dispatch.now) { + defer = function (id) { + Dispatch.now(ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if (MessageChannel) { + channel = new MessageChannel(); + port = channel.port2; + channel.port1.onmessage = listener; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { + defer = function (id) { + global.postMessage(id + '', '*'); + }; + global.addEventListener('message', listener, false); + // IE8- + } else if (ONREADYSTATECHANGE in cel('script')) { + defer = function (id) { + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { + html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function (id) { + setTimeout(ctx(run, id, 1), 0); + }; + } +} +module.exports = { + set: setTask, + clear: clearTask +}; + + +/***/ }), +/* 90 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var macrotask = __webpack_require__(89).set; +var Observer = global.MutationObserver || global.WebKitMutationObserver; +var process = global.process; +var Promise = global.Promise; +var isNode = __webpack_require__(20)(process) == 'process'; + +module.exports = function () { + var head, last, notify; + + var flush = function () { + var parent, fn; + if (isNode && (parent = process.domain)) parent.exit(); + while (head) { + fn = head.fn; + head = head.next; + try { + fn(); + } catch (e) { + if (head) notify(); + else last = undefined; + throw e; + } + } last = undefined; + if (parent) parent.enter(); + }; + + // Node.js + if (isNode) { + notify = function () { + process.nextTick(flush); + }; + // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 + } else if (Observer && !(global.navigator && global.navigator.standalone)) { + var toggle = true; + var node = document.createTextNode(''); + new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new + notify = function () { + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if (Promise && Promise.resolve) { + // Promise.resolve without an argument throws an error in LG WebOS 2 + var promise = Promise.resolve(undefined); + notify = function () { + promise.then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function () { + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } + + return function (fn) { + var task = { fn: fn, next: undefined }; + if (last) last.next = task; + if (!head) { + head = task; + notify(); + } last = task; + }; +}; + + +/***/ }), +/* 91 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 25.4.1.5 NewPromiseCapability(C) +var aFunction = __webpack_require__(10); + +function PromiseCapability(C) { + var resolve, reject; + this.promise = new C(function ($$resolve, $$reject) { + if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); +} + +module.exports.f = function (C) { + return new PromiseCapability(C); +}; + + +/***/ }), +/* 92 */ +/***/ (function(module, exports, __webpack_require__) { + +// all object keys, includes non-enumerable and symbols +var gOPN = __webpack_require__(38); +var gOPS = __webpack_require__(52); +var anObject = __webpack_require__(1); +var Reflect = __webpack_require__(2).Reflect; +module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { + var keys = gOPN.f(anObject(it)); + var getSymbols = gOPS.f; + return getSymbols ? keys.concat(getSymbols(it)) : keys; +}; + + +/***/ }), +/* 93 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(2); +var DESCRIPTORS = __webpack_require__(7); +var LIBRARY = __webpack_require__(33); +var $typed = __webpack_require__(63); +var hide = __webpack_require__(14); +var redefineAll = __webpack_require__(43); +var fails = __webpack_require__(4); +var anInstance = __webpack_require__(42); +var toInteger = __webpack_require__(24); +var toLength = __webpack_require__(8); +var toIndex = __webpack_require__(118); +var gOPN = __webpack_require__(38).f; +var dP = __webpack_require__(6).f; +var arrayFill = __webpack_require__(86); +var setToStringTag = __webpack_require__(44); +var ARRAY_BUFFER = 'ArrayBuffer'; +var DATA_VIEW = 'DataView'; +var PROTOTYPE = 'prototype'; +var WRONG_LENGTH = 'Wrong length!'; +var WRONG_INDEX = 'Wrong index!'; +var $ArrayBuffer = global[ARRAY_BUFFER]; +var $DataView = global[DATA_VIEW]; +var Math = global.Math; +var RangeError = global.RangeError; +// eslint-disable-next-line no-shadow-restricted-names +var Infinity = global.Infinity; +var BaseBuffer = $ArrayBuffer; +var abs = Math.abs; +var pow = Math.pow; +var floor = Math.floor; +var log = Math.log; +var LN2 = Math.LN2; +var BUFFER = 'buffer'; +var BYTE_LENGTH = 'byteLength'; +var BYTE_OFFSET = 'byteOffset'; +var $BUFFER = DESCRIPTORS ? '_b' : BUFFER; +var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH; +var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; + +// IEEE754 conversions based on https://github.com/feross/ieee754 +function packIEEE754(value, mLen, nBytes) { + var buffer = new Array(nBytes); + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0; + var i = 0; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + var e, m, c; + value = abs(value); + // eslint-disable-next-line no-self-compare + if (value != value || value === Infinity) { + // eslint-disable-next-line no-self-compare + m = value != value ? 1 : 0; + e = eMax; + } else { + e = floor(log(value) / LN2); + if (value * (c = pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * pow(2, mLen); + e = e + eBias; + } else { + m = value * pow(2, eBias - 1) * pow(2, mLen); + e = 0; + } + } + for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); + e = e << mLen | m; + eLen += mLen; + for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); + buffer[--i] |= s * 128; + return buffer; +} +function unpackIEEE754(buffer, mLen, nBytes) { + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = eLen - 7; + var i = nBytes - 1; + var s = buffer[i--]; + var e = s & 127; + var m; + s >>= 7; + for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : s ? -Infinity : Infinity; + } else { + m = m + pow(2, mLen); + e = e - eBias; + } return (s ? -1 : 1) * m * pow(2, e - mLen); +} + +function unpackI32(bytes) { + return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; +} +function packI8(it) { + return [it & 0xff]; +} +function packI16(it) { + return [it & 0xff, it >> 8 & 0xff]; +} +function packI32(it) { + return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; +} +function packF64(it) { + return packIEEE754(it, 52, 8); +} +function packF32(it) { + return packIEEE754(it, 23, 4); +} + +function addGetter(C, key, internal) { + dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } }); +} + +function get(view, bytes, index, isLittleEndian) { + var numIndex = +index; + var intIndex = toIndex(numIndex); + if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b; + var start = intIndex + view[$OFFSET]; + var pack = store.slice(start, start + bytes); + return isLittleEndian ? pack : pack.reverse(); +} +function set(view, bytes, index, conversion, value, isLittleEndian) { + var numIndex = +index; + var intIndex = toIndex(numIndex); + if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b; + var start = intIndex + view[$OFFSET]; + var pack = conversion(+value); + for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; +} + +if (!$typed.ABV) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer, ARRAY_BUFFER); + var byteLength = toIndex(length); + this._b = arrayFill.call(new Array(byteLength), 0); + this[$LENGTH] = byteLength; + }; + + $DataView = function DataView(buffer, byteOffset, byteLength) { + anInstance(this, $DataView, DATA_VIEW); + anInstance(buffer, $ArrayBuffer, DATA_VIEW); + var bufferLength = buffer[$LENGTH]; + var offset = toInteger(byteOffset); + if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!'); + byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); + if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); + this[$BUFFER] = buffer; + this[$OFFSET] = offset; + this[$LENGTH] = byteLength; + }; + + if (DESCRIPTORS) { + addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); + addGetter($DataView, BUFFER, '_b'); + addGetter($DataView, BYTE_LENGTH, '_l'); + addGetter($DataView, BYTE_OFFSET, '_o'); + } + + redefineAll($DataView[PROTOTYPE], { + getInt8: function getInt8(byteOffset) { + return get(this, 1, byteOffset)[0] << 24 >> 24; + }, + getUint8: function getUint8(byteOffset) { + return get(this, 1, byteOffset)[0]; + }, + getInt16: function getInt16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments[1]); + return (bytes[1] << 8 | bytes[0]) << 16 >> 16; + }, + getUint16: function getUint16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments[1]); + return bytes[1] << 8 | bytes[0]; + }, + getInt32: function getInt32(byteOffset /* , littleEndian */) { + return unpackI32(get(this, 4, byteOffset, arguments[1])); + }, + getUint32: function getUint32(byteOffset /* , littleEndian */) { + return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; + }, + getFloat32: function getFloat32(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); + }, + getFloat64: function getFloat64(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); + }, + setInt8: function setInt8(byteOffset, value) { + set(this, 1, byteOffset, packI8, value); + }, + setUint8: function setUint8(byteOffset, value) { + set(this, 1, byteOffset, packI8, value); + }, + setInt16: function setInt16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setUint16: function setUint16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setInt32: function setInt32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setUint32: function setUint32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packF32, value, arguments[2]); + }, + setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { + set(this, 8, byteOffset, packF64, value, arguments[2]); + } + }); +} else { + if (!fails(function () { + $ArrayBuffer(1); + }) || !fails(function () { + new $ArrayBuffer(-1); // eslint-disable-line no-new + }) || fails(function () { + new $ArrayBuffer(); // eslint-disable-line no-new + new $ArrayBuffer(1.5); // eslint-disable-line no-new + new $ArrayBuffer(NaN); // eslint-disable-line no-new + return $ArrayBuffer.name != ARRAY_BUFFER; + })) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer); + return new BaseBuffer(toIndex(length)); + }; + var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; + for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) { + if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]); + } + if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer; + } + // iOS Safari 7.x bug + var view = new $DataView(new $ArrayBuffer(2)); + var $setInt8 = $DataView[PROTOTYPE].setInt8; + view.setInt8(0, 2147483648); + view.setInt8(1, 2147483649); + if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], { + setInt8: function setInt8(byteOffset, value) { + $setInt8.call(this, byteOffset, value << 24 >> 24); + }, + setUint8: function setUint8(byteOffset, value) { + $setInt8.call(this, byteOffset, value << 24 >> 24); + } + }, true); +} +setToStringTag($ArrayBuffer, ARRAY_BUFFER); +setToStringTag($DataView, DATA_VIEW); +hide($DataView[PROTOTYPE], $typed.VIEW, true); +exports[ARRAY_BUFFER] = $ArrayBuffer; +exports[DATA_VIEW] = $DataView; + + +/***/ }), +/* 94 */ +/***/ (function(module, exports) { + +module.exports = function (regExp, replace) { + var replacer = replace === Object(replace) ? function (part) { + return replace[part]; + } : replace; + return function (it) { + return String(it).replace(regExp, replacer); + }; +}; + + +/***/ }), +/* 95 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = !__webpack_require__(7) && !__webpack_require__(4)(function () { + return Object.defineProperty(__webpack_require__(67)('div'), 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), +/* 96 */ +/***/ (function(module, exports, __webpack_require__) { + +exports.f = __webpack_require__(5); + + +/***/ }), +/* 97 */ +/***/ (function(module, exports, __webpack_require__) { + +var has = __webpack_require__(12); +var toIObject = __webpack_require__(11); +var arrayIndexOf = __webpack_require__(51)(false); +var IE_PROTO = __webpack_require__(69)('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; +}; + + +/***/ }), +/* 98 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(6); +var anObject = __webpack_require__(1); +var getKeys = __webpack_require__(27); + +module.exports = __webpack_require__(7) ? 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; +}; + + +/***/ }), +/* 99 */ +/***/ (function(module, exports, __webpack_require__) { + +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +var toIObject = __webpack_require__(11); +var gOPN = __webpack_require__(38).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)); +}; + + +/***/ }), +/* 100 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var aFunction = __webpack_require__(10); +var isObject = __webpack_require__(3); +var invoke = __webpack_require__(74); +var arraySlice = [].slice; +var factories = {}; + +var construct = function (F, len, args) { + if (!(len in factories)) { + for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']'; + // eslint-disable-next-line no-new-func + factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); + } return factories[len](F, args); +}; + +module.exports = Function.bind || function bind(that /* , ...args */) { + var fn = aFunction(this); + var partArgs = arraySlice.call(arguments, 1); + var bound = function (/* args... */) { + var args = partArgs.concat(arraySlice.call(arguments)); + return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); + }; + if (isObject(fn.prototype)) bound.prototype = fn.prototype; + return bound; +}; + + +/***/ }), +/* 101 */ +/***/ (function(module, exports, __webpack_require__) { + +var cof = __webpack_require__(20); +module.exports = function (it, msg) { + if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg); + return +it; +}; + + +/***/ }), +/* 102 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.3 Number.isInteger(number) +var isObject = __webpack_require__(3); +var floor = Math.floor; +module.exports = function isInteger(it) { + return !isObject(it) && isFinite(it) && floor(it) === it; +}; + + +/***/ }), +/* 103 */ +/***/ (function(module, exports, __webpack_require__) { + +var $parseFloat = __webpack_require__(2).parseFloat; +var $trim = __webpack_require__(45).trim; + +module.exports = 1 / $parseFloat(__webpack_require__(76) + '-0') !== -Infinity ? function parseFloat(str) { + var string = $trim(String(str), 3); + var result = $parseFloat(string); + return result === 0 && string.charAt(0) == '-' ? -0 : result; +} : $parseFloat; + + +/***/ }), +/* 104 */ +/***/ (function(module, exports, __webpack_require__) { + +var $parseInt = __webpack_require__(2).parseInt; +var $trim = __webpack_require__(45).trim; +var ws = __webpack_require__(76); +var hex = /^[-+]?0[xX]/; + +module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) { + var string = $trim(String(str), 3); + return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); +} : $parseInt; + + +/***/ }), +/* 105 */ +/***/ (function(module, exports) { + +// 20.2.2.20 Math.log1p(x) +module.exports = Math.log1p || function log1p(x) { + return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); +}; + + +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.16 Math.fround(x) +var sign = __webpack_require__(78); +var pow = Math.pow; +var EPSILON = pow(2, -52); +var EPSILON32 = pow(2, -23); +var MAX32 = pow(2, 127) * (2 - EPSILON32); +var MIN32 = pow(2, -126); + +var roundTiesToEven = function (n) { + return n + 1 / EPSILON - 1 / EPSILON; +}; + +module.exports = Math.fround || function fround(x) { + var $abs = Math.abs(x); + var $sign = sign(x); + var a, result; + if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; + a = (1 + EPSILON32 / EPSILON) * $abs; + result = a - (a - $abs); + // eslint-disable-next-line no-self-compare + if (result > MAX32 || result != result) return $sign * Infinity; + return $sign * result; +}; + + +/***/ }), +/* 107 */ +/***/ (function(module, exports, __webpack_require__) { + +// call something on iterator step with safe closing on error +var anObject = __webpack_require__(1); +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; + } +}; + + +/***/ }), +/* 108 */ +/***/ (function(module, exports, __webpack_require__) { + +var aFunction = __webpack_require__(10); +var toObject = __webpack_require__(9); +var IObject = __webpack_require__(47); +var toLength = __webpack_require__(8); + +module.exports = function (that, callbackfn, aLen, memo, isRight) { + aFunction(callbackfn); + var O = toObject(that); + var self = IObject(O); + var length = toLength(O.length); + var index = isRight ? length - 1 : 0; + var i = isRight ? -1 : 1; + if (aLen < 2) for (;;) { + if (index in self) { + memo = self[index]; + index += i; + break; + } + index += i; + if (isRight ? index < 0 : length <= index) { + throw TypeError('Reduce of empty array with no initial value'); + } + } + for (;isRight ? index >= 0 : length > index; index += i) if (index in self) { + memo = callbackfn(memo, self[index], index, O); + } + return memo; +}; + + +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) + +var toObject = __webpack_require__(9); +var toAbsoluteIndex = __webpack_require__(37); +var toLength = __webpack_require__(8); + +module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { + var O = toObject(this); + var len = toLength(O.length); + var to = toAbsoluteIndex(target, len); + var from = toAbsoluteIndex(start, len); + var end = arguments.length > 2 ? arguments[2] : undefined; + var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); + var inc = 1; + if (from < to && to < from + count) { + inc = -1; + from += count - 1; + to += count - 1; + } + while (count-- > 0) { + if (from in O) O[to] = O[from]; + else delete O[to]; + to += inc; + from += inc; + } return O; +}; + + +/***/ }), +/* 110 */ +/***/ (function(module, exports, __webpack_require__) { + +// 21.2.5.3 get RegExp.prototype.flags() +if (__webpack_require__(7) && /./g.flags != 'g') __webpack_require__(6).f(RegExp.prototype, 'flags', { + configurable: true, + get: __webpack_require__(58) +}); + + +/***/ }), +/* 111 */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return { e: false, v: exec() }; + } catch (e) { + return { e: true, v: e }; + } +}; + + +/***/ }), +/* 112 */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(1); +var isObject = __webpack_require__(3); +var newPromiseCapability = __webpack_require__(91); + +module.exports = function (C, x) { + anObject(C); + if (isObject(x) && x.constructor === C) return x; + var promiseCapability = newPromiseCapability.f(C); + var resolve = promiseCapability.resolve; + resolve(x); + return promiseCapability.promise; +}; + + +/***/ }), +/* 113 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var strong = __webpack_require__(114); +var validate = __webpack_require__(46); +var MAP = 'Map'; + +// 23.1 Map Objects +module.exports = __webpack_require__(62)(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); + + +/***/ }), +/* 114 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var dP = __webpack_require__(6).f; +var create = __webpack_require__(28); +var redefineAll = __webpack_require__(43); +var ctx = __webpack_require__(19); +var anInstance = __webpack_require__(42); +var forOf = __webpack_require__(35); +var $iterDefine = __webpack_require__(55); +var step = __webpack_require__(88); +var setSpecies = __webpack_require__(41); +var DESCRIPTORS = __webpack_require__(7); +var fastKey = __webpack_require__(32).fastKey; +var validate = __webpack_require__(46); +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); + } +}; + + +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var strong = __webpack_require__(114); +var validate = __webpack_require__(46); +var SET = 'Set'; + +// 23.2 Set Objects +module.exports = __webpack_require__(62)(SET, function (get) { + return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value) { + return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value); + } +}, strong); + + +/***/ }), +/* 116 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var each = __webpack_require__(26)(0); +var redefine = __webpack_require__(15); +var meta = __webpack_require__(32); +var assign = __webpack_require__(72); +var weak = __webpack_require__(117); +var isObject = __webpack_require__(3); +var fails = __webpack_require__(4); +var validate = __webpack_require__(46); +var WEAK_MAP = 'WeakMap'; +var getWeak = meta.getWeak; +var isExtensible = Object.isExtensible; +var uncaughtFrozenStore = weak.ufstore; +var tmp = {}; +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__(62)(WEAK_MAP, wrapper, methods, weak, true, true); + +// IE11 WeakMap frozen keys fix +if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) { + 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); + }); + }); +} + + +/***/ }), +/* 117 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var redefineAll = __webpack_require__(43); +var getWeak = __webpack_require__(32).getWeak; +var anObject = __webpack_require__(1); +var isObject = __webpack_require__(3); +var anInstance = __webpack_require__(42); +var forOf = __webpack_require__(35); +var createArrayMethod = __webpack_require__(26); +var $has = __webpack_require__(12); +var validate = __webpack_require__(46); +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 +}; + + +/***/ }), +/* 118 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/ecma262/#sec-toindex +var toInteger = __webpack_require__(24); +var toLength = __webpack_require__(8); +module.exports = function (it) { + if (it === undefined) return 0; + var number = toInteger(it); + var length = toLength(number); + if (number !== length) throw RangeError('Wrong length!'); + return length; +}; + + +/***/ }), +/* 119 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray +var isArray = __webpack_require__(53); +var isObject = __webpack_require__(3); +var toLength = __webpack_require__(8); +var ctx = __webpack_require__(19); +var IS_CONCAT_SPREADABLE = __webpack_require__(5)('isConcatSpreadable'); + +function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) { + var targetIndex = start; + var sourceIndex = 0; + var mapFn = mapper ? ctx(mapper, thisArg, 3) : false; + var element, spreadable; + + while (sourceIndex < sourceLen) { + if (sourceIndex in source) { + element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; + + spreadable = false; + if (isObject(element)) { + spreadable = element[IS_CONCAT_SPREADABLE]; + spreadable = spreadable !== undefined ? !!spreadable : isArray(element); + } + + if (spreadable && depth > 0) { + targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1; + } else { + if (targetIndex >= 0x1fffffffffffff) throw TypeError(); + target[targetIndex] = element; + } + + targetIndex++; + } + sourceIndex++; + } + return targetIndex; +} + +module.exports = flattenIntoArray; + + +/***/ }), +/* 120 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-string-pad-start-end +var toLength = __webpack_require__(8); +var repeat = __webpack_require__(77); +var defined = __webpack_require__(23); + +module.exports = function (that, maxLength, fillString, left) { + var S = String(defined(that)); + var stringLength = S.length; + var fillStr = fillString === undefined ? ' ' : String(fillString); + var intMaxLength = toLength(maxLength); + if (intMaxLength <= stringLength || fillStr == '') return S; + var fillLen = intMaxLength - stringLength; + var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); + if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); + return left ? stringFiller + S : S + stringFiller; +}; + + +/***/ }), +/* 121 */ +/***/ (function(module, exports, __webpack_require__) { + +var getKeys = __webpack_require__(27); +var toIObject = __webpack_require__(11); +var isEnum = __webpack_require__(48).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) if (isEnum.call(O, key = keys[i++])) { + result.push(isEntries ? [key, O[key]] : O[key]); + } return result; + }; +}; + + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var classof = __webpack_require__(39); +var from = __webpack_require__(123); +module.exports = function (NAME) { + return function toJSON() { + if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); + return from(this); + }; +}; + + +/***/ }), +/* 123 */ +/***/ (function(module, exports, __webpack_require__) { + +var forOf = __webpack_require__(35); + +module.exports = function (iter, ITERATOR) { + var result = []; + forOf(iter, false, result.push, result, ITERATOR); + return result; +}; + + +/***/ }), +/* 124 */ +/***/ (function(module, exports) { + +// https://rwaldron.github.io/proposal-math-extensions/ +module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) { + if ( + arguments.length === 0 + // eslint-disable-next-line no-self-compare + || x != x + // eslint-disable-next-line no-self-compare + || inLow != inLow + // eslint-disable-next-line no-self-compare + || inHigh != inHigh + // eslint-disable-next-line no-self-compare + || outLow != outLow + // eslint-disable-next-line no-self-compare + || outHigh != outHigh + ) return NaN; + if (x === Infinity || x === -Infinity) return x; + return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow; +}; + + +/***/ }), +/* 125 */ +/***/ (function(module, exports, __webpack_require__) { + +var classof = __webpack_require__(39); +var ITERATOR = __webpack_require__(5)('iterator'); +var Iterators = __webpack_require__(40); +module.exports = __webpack_require__(13).isIterable = function (it) { + var O = Object(it); + return O[ITERATOR] !== undefined + || '@@iterator' in O + // eslint-disable-next-line no-prototype-builtins + || Iterators.hasOwnProperty(classof(O)); +}; + + +/***/ }), +/* 126 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var path = __webpack_require__(127); +var invoke = __webpack_require__(74); +var aFunction = __webpack_require__(10); +module.exports = function (/* ...pargs */) { + var fn = aFunction(this); + var length = arguments.length; + var pargs = new Array(length); + var i = 0; + var _ = path._; + var holder = false; + while (length > i) if ((pargs[i] = arguments[i++]) === _) holder = true; + return function (/* ...args */) { + var that = this; + var aLen = arguments.length; + var j = 0; + var k = 0; + var args; + if (!holder && !aLen) return invoke(fn, pargs, that); + args = pargs.slice(); + if (holder) for (;length > j; j++) if (args[j] === _) args[j] = arguments[k++]; + while (aLen > k) args.push(arguments[k++]); + return invoke(fn, args, that); + }; +}; + + +/***/ }), +/* 127 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(2); + + +/***/ }), +/* 128 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(6); +var gOPD = __webpack_require__(16); +var ownKeys = __webpack_require__(92); +var toIObject = __webpack_require__(11); + +module.exports = function define(target, mixin) { + var keys = ownKeys(toIObject(mixin)); + var length = keys.length; + var i = 0; + var key; + while (length > i) dP.f(target, key = keys[i++], gOPD.f(mixin, key)); + return target; +}; + + +/***/ }), +/* 129 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(130); +__webpack_require__(132); +__webpack_require__(133); +__webpack_require__(134); +__webpack_require__(135); +__webpack_require__(136); +__webpack_require__(137); +__webpack_require__(138); +__webpack_require__(139); +__webpack_require__(140); +__webpack_require__(141); +__webpack_require__(142); +__webpack_require__(143); +__webpack_require__(144); +__webpack_require__(145); +__webpack_require__(146); +__webpack_require__(148); +__webpack_require__(149); +__webpack_require__(150); +__webpack_require__(151); +__webpack_require__(152); +__webpack_require__(153); +__webpack_require__(154); +__webpack_require__(155); +__webpack_require__(156); +__webpack_require__(157); +__webpack_require__(158); +__webpack_require__(159); +__webpack_require__(160); +__webpack_require__(161); +__webpack_require__(162); +__webpack_require__(163); +__webpack_require__(164); +__webpack_require__(165); +__webpack_require__(166); +__webpack_require__(167); +__webpack_require__(168); +__webpack_require__(169); +__webpack_require__(170); +__webpack_require__(171); +__webpack_require__(172); +__webpack_require__(173); +__webpack_require__(174); +__webpack_require__(175); +__webpack_require__(176); +__webpack_require__(177); +__webpack_require__(178); +__webpack_require__(179); +__webpack_require__(180); +__webpack_require__(181); +__webpack_require__(182); +__webpack_require__(183); +__webpack_require__(184); +__webpack_require__(185); +__webpack_require__(186); +__webpack_require__(187); +__webpack_require__(188); +__webpack_require__(189); +__webpack_require__(190); +__webpack_require__(191); +__webpack_require__(192); +__webpack_require__(193); +__webpack_require__(194); +__webpack_require__(195); +__webpack_require__(196); +__webpack_require__(197); +__webpack_require__(198); +__webpack_require__(199); +__webpack_require__(200); +__webpack_require__(201); +__webpack_require__(202); +__webpack_require__(203); +__webpack_require__(204); +__webpack_require__(205); +__webpack_require__(206); +__webpack_require__(207); +__webpack_require__(208); +__webpack_require__(209); +__webpack_require__(210); +__webpack_require__(211); +__webpack_require__(212); +__webpack_require__(214); +__webpack_require__(215); +__webpack_require__(216); +__webpack_require__(217); +__webpack_require__(218); +__webpack_require__(219); +__webpack_require__(220); +__webpack_require__(221); +__webpack_require__(222); +__webpack_require__(223); +__webpack_require__(224); +__webpack_require__(225); +__webpack_require__(87); +__webpack_require__(226); +__webpack_require__(227); +__webpack_require__(228); +__webpack_require__(110); +__webpack_require__(229); +__webpack_require__(230); +__webpack_require__(231); +__webpack_require__(232); +__webpack_require__(233); +__webpack_require__(113); +__webpack_require__(115); +__webpack_require__(116); +__webpack_require__(234); +__webpack_require__(235); +__webpack_require__(236); +__webpack_require__(237); +__webpack_require__(238); +__webpack_require__(239); +__webpack_require__(240); +__webpack_require__(241); +__webpack_require__(242); +__webpack_require__(243); +__webpack_require__(244); +__webpack_require__(245); +__webpack_require__(246); +__webpack_require__(247); +__webpack_require__(248); +__webpack_require__(249); +__webpack_require__(250); +__webpack_require__(251); +__webpack_require__(253); +__webpack_require__(254); +__webpack_require__(256); +__webpack_require__(257); +__webpack_require__(258); +__webpack_require__(259); +__webpack_require__(260); +__webpack_require__(261); +__webpack_require__(262); +__webpack_require__(263); +__webpack_require__(264); +__webpack_require__(265); +__webpack_require__(266); +__webpack_require__(267); +__webpack_require__(268); +__webpack_require__(269); +__webpack_require__(270); +__webpack_require__(271); +__webpack_require__(272); +__webpack_require__(273); +__webpack_require__(274); +__webpack_require__(275); +__webpack_require__(276); +__webpack_require__(277); +__webpack_require__(278); +__webpack_require__(279); +__webpack_require__(280); +__webpack_require__(281); +__webpack_require__(282); +__webpack_require__(283); +__webpack_require__(284); +__webpack_require__(285); +__webpack_require__(286); +__webpack_require__(287); +__webpack_require__(288); +__webpack_require__(289); +__webpack_require__(290); +__webpack_require__(291); +__webpack_require__(292); +__webpack_require__(293); +__webpack_require__(294); +__webpack_require__(295); +__webpack_require__(296); +__webpack_require__(297); +__webpack_require__(298); +__webpack_require__(299); +__webpack_require__(300); +__webpack_require__(301); +__webpack_require__(302); +__webpack_require__(303); +__webpack_require__(304); +__webpack_require__(305); +__webpack_require__(306); +__webpack_require__(307); +__webpack_require__(308); +__webpack_require__(309); +__webpack_require__(310); +__webpack_require__(311); +__webpack_require__(312); +__webpack_require__(313); +__webpack_require__(314); +__webpack_require__(315); +__webpack_require__(316); +__webpack_require__(317); +__webpack_require__(318); +__webpack_require__(319); +__webpack_require__(320); +__webpack_require__(321); +__webpack_require__(322); +__webpack_require__(323); +__webpack_require__(324); +__webpack_require__(325); +__webpack_require__(326); +__webpack_require__(49); +__webpack_require__(328); +__webpack_require__(125); +__webpack_require__(329); +__webpack_require__(330); +__webpack_require__(331); +__webpack_require__(332); +__webpack_require__(333); +__webpack_require__(334); +__webpack_require__(335); +__webpack_require__(336); +__webpack_require__(337); +module.exports = __webpack_require__(338); + + +/***/ }), +/* 130 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// ECMAScript 6 symbols shim +var global = __webpack_require__(2); +var has = __webpack_require__(12); +var DESCRIPTORS = __webpack_require__(7); +var $export = __webpack_require__(0); +var redefine = __webpack_require__(15); +var META = __webpack_require__(32).KEY; +var $fails = __webpack_require__(4); +var shared = __webpack_require__(50); +var setToStringTag = __webpack_require__(44); +var uid = __webpack_require__(36); +var wks = __webpack_require__(5); +var wksExt = __webpack_require__(96); +var wksDefine = __webpack_require__(68); +var enumKeys = __webpack_require__(131); +var isArray = __webpack_require__(53); +var anObject = __webpack_require__(1); +var isObject = __webpack_require__(3); +var toIObject = __webpack_require__(11); +var toPrimitive = __webpack_require__(22); +var createDesc = __webpack_require__(31); +var _create = __webpack_require__(28); +var gOPNExt = __webpack_require__(99); +var $GOPD = __webpack_require__(16); +var $DP = __webpack_require__(6); +var $keys = __webpack_require__(27); +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'; +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__(38).f = gOPNExt.f = $getOwnPropertyNames; + __webpack_require__(48).f = $propertyIsEnumerable; + __webpack_require__(52).f = $getOwnPropertySymbols; + + if (DESCRIPTORS && !__webpack_require__(33)) { + 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 +}); + +// 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__(14)($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); + + +/***/ }), +/* 131 */ +/***/ (function(module, exports, __webpack_require__) { + +// all enumerable object keys, includes symbols +var getKeys = __webpack_require__(27); +var gOPS = __webpack_require__(52); +var pIE = __webpack_require__(48); +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; +}; + + +/***/ }), +/* 132 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) +$export($export.S + $export.F * !__webpack_require__(7), 'Object', { defineProperty: __webpack_require__(6).f }); + + +/***/ }), +/* 133 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) +$export($export.S + $export.F * !__webpack_require__(7), 'Object', { defineProperties: __webpack_require__(98) }); + + +/***/ }), +/* 134 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) +var toIObject = __webpack_require__(11); +var $getOwnPropertyDescriptor = __webpack_require__(16).f; + +__webpack_require__(25)('getOwnPropertyDescriptor', function () { + return function getOwnPropertyDescriptor(it, key) { + return $getOwnPropertyDescriptor(toIObject(it), key); + }; +}); + + +/***/ }), +/* 135 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +$export($export.S, 'Object', { create: __webpack_require__(28) }); + + +/***/ }), +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.9 Object.getPrototypeOf(O) +var toObject = __webpack_require__(9); +var $getPrototypeOf = __webpack_require__(17); + +__webpack_require__(25)('getPrototypeOf', function () { + return function getPrototypeOf(it) { + return $getPrototypeOf(toObject(it)); + }; +}); + + +/***/ }), +/* 137 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 Object.keys(O) +var toObject = __webpack_require__(9); +var $keys = __webpack_require__(27); + +__webpack_require__(25)('keys', function () { + return function keys(it) { + return $keys(toObject(it)); + }; +}); + + +/***/ }), +/* 138 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.7 Object.getOwnPropertyNames(O) +__webpack_require__(25)('getOwnPropertyNames', function () { + return __webpack_require__(99).f; +}); + + +/***/ }), +/* 139 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.5 Object.freeze(O) +var isObject = __webpack_require__(3); +var meta = __webpack_require__(32).onFreeze; + +__webpack_require__(25)('freeze', function ($freeze) { + return function freeze(it) { + return $freeze && isObject(it) ? $freeze(meta(it)) : it; + }; +}); + + +/***/ }), +/* 140 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.17 Object.seal(O) +var isObject = __webpack_require__(3); +var meta = __webpack_require__(32).onFreeze; + +__webpack_require__(25)('seal', function ($seal) { + return function seal(it) { + return $seal && isObject(it) ? $seal(meta(it)) : it; + }; +}); + + +/***/ }), +/* 141 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.15 Object.preventExtensions(O) +var isObject = __webpack_require__(3); +var meta = __webpack_require__(32).onFreeze; + +__webpack_require__(25)('preventExtensions', function ($preventExtensions) { + return function preventExtensions(it) { + return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; + }; +}); + + +/***/ }), +/* 142 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.12 Object.isFrozen(O) +var isObject = __webpack_require__(3); + +__webpack_require__(25)('isFrozen', function ($isFrozen) { + return function isFrozen(it) { + return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; + }; +}); + + +/***/ }), +/* 143 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.13 Object.isSealed(O) +var isObject = __webpack_require__(3); + +__webpack_require__(25)('isSealed', function ($isSealed) { + return function isSealed(it) { + return isObject(it) ? $isSealed ? $isSealed(it) : false : true; + }; +}); + + +/***/ }), +/* 144 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.11 Object.isExtensible(O) +var isObject = __webpack_require__(3); + +__webpack_require__(25)('isExtensible', function ($isExtensible) { + return function isExtensible(it) { + return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; + }; +}); + + +/***/ }), +/* 145 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.3.1 Object.assign(target, source) +var $export = __webpack_require__(0); + +$export($export.S + $export.F, 'Object', { assign: __webpack_require__(72) }); + + +/***/ }), +/* 146 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.3.10 Object.is(value1, value2) +var $export = __webpack_require__(0); +$export($export.S, 'Object', { is: __webpack_require__(147) }); + + +/***/ }), +/* 147 */ +/***/ (function(module, exports) { + +// 7.2.9 SameValue(x, y) +module.exports = Object.is || function is(x, y) { + // eslint-disable-next-line no-self-compare + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; +}; + + +/***/ }), +/* 148 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.3.19 Object.setPrototypeOf(O, proto) +var $export = __webpack_require__(0); +$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(73).set }); + + +/***/ }), +/* 149 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 19.1.3.6 Object.prototype.toString() +var classof = __webpack_require__(39); +var test = {}; +test[__webpack_require__(5)('toStringTag')] = 'z'; +if (test + '' != '[object z]') { + __webpack_require__(15)(Object.prototype, 'toString', function toString() { + return '[object ' + classof(this) + ']'; + }, true); +} + + +/***/ }), +/* 150 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) +var $export = __webpack_require__(0); + +$export($export.P, 'Function', { bind: __webpack_require__(100) }); + + +/***/ }), +/* 151 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(6).f; +var FProto = Function.prototype; +var nameRE = /^\s*function ([^ (]*)/; +var NAME = 'name'; + +// 19.2.4.2 name +NAME in FProto || __webpack_require__(7) && dP(FProto, NAME, { + configurable: true, + get: function () { + try { + return ('' + this).match(nameRE)[1]; + } catch (e) { + return ''; + } + } +}); + + +/***/ }), +/* 152 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var isObject = __webpack_require__(3); +var getPrototypeOf = __webpack_require__(17); +var HAS_INSTANCE = __webpack_require__(5)('hasInstance'); +var FunctionProto = Function.prototype; +// 19.2.3.6 Function.prototype[@@hasInstance](V) +if (!(HAS_INSTANCE in FunctionProto)) __webpack_require__(6).f(FunctionProto, HAS_INSTANCE, { value: function (O) { + if (typeof this != 'function' || !isObject(O)) return false; + if (!isObject(this.prototype)) return O instanceof this; + // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: + while (O = getPrototypeOf(O)) if (this.prototype === O) return true; + return false; +} }); + + +/***/ }), +/* 153 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(2); +var has = __webpack_require__(12); +var cof = __webpack_require__(20); +var inheritIfRequired = __webpack_require__(75); +var toPrimitive = __webpack_require__(22); +var fails = __webpack_require__(4); +var gOPN = __webpack_require__(38).f; +var gOPD = __webpack_require__(16).f; +var dP = __webpack_require__(6).f; +var $trim = __webpack_require__(45).trim; +var NUMBER = 'Number'; +var $Number = global[NUMBER]; +var Base = $Number; +var proto = $Number.prototype; +// Opera ~12 has broken Object#toString +var BROKEN_COF = cof(__webpack_require__(28)(proto)) == NUMBER; +var TRIM = 'trim' in String.prototype; + +// 7.1.3 ToNumber(argument) +var toNumber = function (argument) { + var it = toPrimitive(argument, false); + if (typeof it == 'string' && it.length > 2) { + it = TRIM ? it.trim() : $trim(it, 3); + var first = it.charCodeAt(0); + var third, radix, maxCode; + if (first === 43 || first === 45) { + third = it.charCodeAt(2); + if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix + } else if (first === 48) { + switch (it.charCodeAt(1)) { + case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i + case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i + default: return +it; + } + for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) { + code = digits.charCodeAt(i); + // parseInt parses a string to a first unavailable symbol + // but ToNumber should return NaN if a string contains unavailable symbols + if (code < 48 || code > maxCode) return NaN; + } return parseInt(digits, radix); + } + } return +it; +}; + +if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) { + $Number = function Number(value) { + var it = arguments.length < 1 ? 0 : value; + var that = this; + return that instanceof $Number + // check on 1..constructor(foo) case + && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER) + ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it); + }; + for (var keys = __webpack_require__(7) ? gOPN(Base) : ( + // ES3: + 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + + // ES6 (in case, if modules with ES6 Number statics required before): + 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + + 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' + ).split(','), j = 0, key; keys.length > j; j++) { + if (has(Base, key = keys[j]) && !has($Number, key)) { + dP($Number, key, gOPD(Base, key)); + } + } + $Number.prototype = proto; + proto.constructor = $Number; + __webpack_require__(15)(global, NUMBER, $Number); +} + + +/***/ }), +/* 154 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toInteger = __webpack_require__(24); +var aNumberValue = __webpack_require__(101); +var repeat = __webpack_require__(77); +var $toFixed = 1.0.toFixed; +var floor = Math.floor; +var data = [0, 0, 0, 0, 0, 0]; +var ERROR = 'Number.toFixed: incorrect invocation!'; +var ZERO = '0'; + +var multiply = function (n, c) { + var i = -1; + var c2 = c; + while (++i < 6) { + c2 += n * data[i]; + data[i] = c2 % 1e7; + c2 = floor(c2 / 1e7); + } +}; +var divide = function (n) { + var i = 6; + var c = 0; + while (--i >= 0) { + c += data[i]; + data[i] = floor(c / n); + c = (c % n) * 1e7; + } +}; +var numToString = function () { + var i = 6; + var s = ''; + while (--i >= 0) { + if (s !== '' || i === 0 || data[i] !== 0) { + var t = String(data[i]); + s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; + } + } return s; +}; +var pow = function (x, n, acc) { + return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); +}; +var log = function (x) { + var n = 0; + var x2 = x; + while (x2 >= 4096) { + n += 12; + x2 /= 4096; + } + while (x2 >= 2) { + n += 1; + x2 /= 2; + } return n; +}; + +$export($export.P + $export.F * (!!$toFixed && ( + 0.00008.toFixed(3) !== '0.000' || + 0.9.toFixed(0) !== '1' || + 1.255.toFixed(2) !== '1.25' || + 1000000000000000128.0.toFixed(0) !== '1000000000000000128' +) || !__webpack_require__(4)(function () { + // V8 ~ Android 4.3- + $toFixed.call({}); +})), 'Number', { + toFixed: function toFixed(fractionDigits) { + var x = aNumberValue(this, ERROR); + var f = toInteger(fractionDigits); + var s = ''; + var m = ZERO; + var e, z, j, k; + if (f < 0 || f > 20) throw RangeError(ERROR); + // eslint-disable-next-line no-self-compare + if (x != x) return 'NaN'; + if (x <= -1e21 || x >= 1e21) return String(x); + if (x < 0) { + s = '-'; + x = -x; + } + if (x > 1e-21) { + e = log(x * pow(2, 69, 1)) - 69; + z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); + z *= 0x10000000000000; + e = 52 - e; + if (e > 0) { + multiply(0, z); + j = f; + while (j >= 7) { + multiply(1e7, 0); + j -= 7; + } + multiply(pow(10, j, 1), 0); + j = e - 1; + while (j >= 23) { + divide(1 << 23); + j -= 23; + } + divide(1 << j); + multiply(1, 1); + divide(2); + m = numToString(); + } else { + multiply(0, z); + multiply(1 << -e, 0); + m = numToString() + repeat.call(ZERO, f); + } + } + if (f > 0) { + k = m.length; + m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); + } else { + m = s + m; + } return m; + } +}); + + +/***/ }), +/* 155 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $fails = __webpack_require__(4); +var aNumberValue = __webpack_require__(101); +var $toPrecision = 1.0.toPrecision; + +$export($export.P + $export.F * ($fails(function () { + // IE7- + return $toPrecision.call(1, undefined) !== '1'; +}) || !$fails(function () { + // V8 ~ Android 4.3- + $toPrecision.call({}); +})), 'Number', { + toPrecision: function toPrecision(precision) { + var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); + return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); + } +}); + + +/***/ }), +/* 156 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.1 Number.EPSILON +var $export = __webpack_require__(0); + +$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) }); + + +/***/ }), +/* 157 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.2 Number.isFinite(number) +var $export = __webpack_require__(0); +var _isFinite = __webpack_require__(2).isFinite; + +$export($export.S, 'Number', { + isFinite: function isFinite(it) { + return typeof it == 'number' && _isFinite(it); + } +}); + + +/***/ }), +/* 158 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.3 Number.isInteger(number) +var $export = __webpack_require__(0); + +$export($export.S, 'Number', { isInteger: __webpack_require__(102) }); + + +/***/ }), +/* 159 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.4 Number.isNaN(number) +var $export = __webpack_require__(0); + +$export($export.S, 'Number', { + isNaN: function isNaN(number) { + // eslint-disable-next-line no-self-compare + return number != number; + } +}); + + +/***/ }), +/* 160 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.5 Number.isSafeInteger(number) +var $export = __webpack_require__(0); +var isInteger = __webpack_require__(102); +var abs = Math.abs; + +$export($export.S, 'Number', { + isSafeInteger: function isSafeInteger(number) { + return isInteger(number) && abs(number) <= 0x1fffffffffffff; + } +}); + + +/***/ }), +/* 161 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.6 Number.MAX_SAFE_INTEGER +var $export = __webpack_require__(0); + +$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); + + +/***/ }), +/* 162 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.10 Number.MIN_SAFE_INTEGER +var $export = __webpack_require__(0); + +$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff }); + + +/***/ }), +/* 163 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var $parseFloat = __webpack_require__(103); +// 20.1.2.12 Number.parseFloat(string) +$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat }); + + +/***/ }), +/* 164 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var $parseInt = __webpack_require__(104); +// 20.1.2.13 Number.parseInt(string, radix) +$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt }); + + +/***/ }), +/* 165 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var $parseInt = __webpack_require__(104); +// 18.2.5 parseInt(string, radix) +$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt }); + + +/***/ }), +/* 166 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var $parseFloat = __webpack_require__(103); +// 18.2.4 parseFloat(string) +$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat }); + + +/***/ }), +/* 167 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.3 Math.acosh(x) +var $export = __webpack_require__(0); +var log1p = __webpack_require__(105); +var sqrt = Math.sqrt; +var $acosh = Math.acosh; + +$export($export.S + $export.F * !($acosh + // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 + && Math.floor($acosh(Number.MAX_VALUE)) == 710 + // Tor Browser bug: Math.acosh(Infinity) -> NaN + && $acosh(Infinity) == Infinity +), 'Math', { + acosh: function acosh(x) { + return (x = +x) < 1 ? NaN : x > 94906265.62425156 + ? Math.log(x) + Math.LN2 + : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); + } +}); + + +/***/ }), +/* 168 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.5 Math.asinh(x) +var $export = __webpack_require__(0); +var $asinh = Math.asinh; + +function asinh(x) { + return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); +} + +// Tor Browser bug: Math.asinh(0) -> -0 +$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh }); + + +/***/ }), +/* 169 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.7 Math.atanh(x) +var $export = __webpack_require__(0); +var $atanh = Math.atanh; + +// Tor Browser bug: Math.atanh(-0) -> 0 +$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { + atanh: function atanh(x) { + return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; + } +}); + + +/***/ }), +/* 170 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.9 Math.cbrt(x) +var $export = __webpack_require__(0); +var sign = __webpack_require__(78); + +$export($export.S, 'Math', { + cbrt: function cbrt(x) { + return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); + } +}); + + +/***/ }), +/* 171 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.11 Math.clz32(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + clz32: function clz32(x) { + return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; + } +}); + + +/***/ }), +/* 172 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.12 Math.cosh(x) +var $export = __webpack_require__(0); +var exp = Math.exp; + +$export($export.S, 'Math', { + cosh: function cosh(x) { + return (exp(x = +x) + exp(-x)) / 2; + } +}); + + +/***/ }), +/* 173 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.14 Math.expm1(x) +var $export = __webpack_require__(0); +var $expm1 = __webpack_require__(79); + +$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 }); + + +/***/ }), +/* 174 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.16 Math.fround(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { fround: __webpack_require__(106) }); + + +/***/ }), +/* 175 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) +var $export = __webpack_require__(0); +var abs = Math.abs; + +$export($export.S, 'Math', { + hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars + var sum = 0; + var i = 0; + var aLen = arguments.length; + var larg = 0; + var arg, div; + while (i < aLen) { + arg = abs(arguments[i++]); + if (larg < arg) { + div = larg / arg; + sum = sum * div * div + 1; + larg = arg; + } else if (arg > 0) { + div = arg / larg; + sum += div * div; + } else sum += arg; + } + return larg === Infinity ? Infinity : larg * Math.sqrt(sum); + } +}); + + +/***/ }), +/* 176 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.18 Math.imul(x, y) +var $export = __webpack_require__(0); +var $imul = Math.imul; + +// some WebKit versions fails with big numbers, some has wrong arity +$export($export.S + $export.F * __webpack_require__(4)(function () { + return $imul(0xffffffff, 5) != -5 || $imul.length != 2; +}), 'Math', { + imul: function imul(x, y) { + var UINT16 = 0xffff; + var xn = +x; + var yn = +y; + var xl = UINT16 & xn; + var yl = UINT16 & yn; + return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); + } +}); + + +/***/ }), +/* 177 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.21 Math.log10(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + log10: function log10(x) { + return Math.log(x) * Math.LOG10E; + } +}); + + +/***/ }), +/* 178 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.20 Math.log1p(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { log1p: __webpack_require__(105) }); + + +/***/ }), +/* 179 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.22 Math.log2(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + log2: function log2(x) { + return Math.log(x) / Math.LN2; + } +}); + + +/***/ }), +/* 180 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.28 Math.sign(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { sign: __webpack_require__(78) }); + + +/***/ }), +/* 181 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.30 Math.sinh(x) +var $export = __webpack_require__(0); +var expm1 = __webpack_require__(79); +var exp = Math.exp; + +// V8 near Chromium 38 has a problem with very small numbers +$export($export.S + $export.F * __webpack_require__(4)(function () { + return !Math.sinh(-2e-17) != -2e-17; +}), 'Math', { + sinh: function sinh(x) { + return Math.abs(x = +x) < 1 + ? (expm1(x) - expm1(-x)) / 2 + : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); + } +}); + + +/***/ }), +/* 182 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.33 Math.tanh(x) +var $export = __webpack_require__(0); +var expm1 = __webpack_require__(79); +var exp = Math.exp; + +$export($export.S, 'Math', { + tanh: function tanh(x) { + var a = expm1(x = +x); + var b = expm1(-x); + return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); + } +}); + + +/***/ }), +/* 183 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.34 Math.trunc(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + trunc: function trunc(it) { + return (it > 0 ? Math.floor : Math.ceil)(it); + } +}); + + +/***/ }), +/* 184 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var toAbsoluteIndex = __webpack_require__(37); +var fromCharCode = String.fromCharCode; +var $fromCodePoint = String.fromCodePoint; + +// length should be 1, old FF problem +$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { + // 21.1.2.2 String.fromCodePoint(...codePoints) + fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars + var res = []; + var aLen = arguments.length; + var i = 0; + var code; + while (aLen > i) { + code = +arguments[i++]; + if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); + res.push(code < 0x10000 + ? fromCharCode(code) + : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) + ); + } return res.join(''); + } +}); + + +/***/ }), +/* 185 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var toIObject = __webpack_require__(11); +var toLength = __webpack_require__(8); + +$export($export.S, 'String', { + // 21.1.2.4 String.raw(callSite, ...substitutions) + raw: function raw(callSite) { + var tpl = toIObject(callSite.raw); + var len = toLength(tpl.length); + var aLen = arguments.length; + var res = []; + var i = 0; + while (len > i) { + res.push(String(tpl[i++])); + if (i < aLen) res.push(String(arguments[i])); + } return res.join(''); + } +}); + + +/***/ }), +/* 186 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 21.1.3.25 String.prototype.trim() +__webpack_require__(45)('trim', function ($trim) { + return function trim() { + return $trim(this, 3); + }; +}); + + +/***/ }), +/* 187 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $at = __webpack_require__(80)(false); +$export($export.P, 'String', { + // 21.1.3.3 String.prototype.codePointAt(pos) + codePointAt: function codePointAt(pos) { + return $at(this, pos); + } +}); + + +/***/ }), +/* 188 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) + +var $export = __webpack_require__(0); +var toLength = __webpack_require__(8); +var context = __webpack_require__(81); +var ENDS_WITH = 'endsWith'; +var $endsWith = ''[ENDS_WITH]; + +$export($export.P + $export.F * __webpack_require__(82)(ENDS_WITH), 'String', { + endsWith: function endsWith(searchString /* , endPosition = @length */) { + var that = context(this, searchString, ENDS_WITH); + var endPosition = arguments.length > 1 ? arguments[1] : undefined; + var len = toLength(that.length); + var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); + var search = String(searchString); + return $endsWith + ? $endsWith.call(that, search, end) + : that.slice(end - search.length, end) === search; + } +}); + + +/***/ }), +/* 189 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 21.1.3.7 String.prototype.includes(searchString, position = 0) + +var $export = __webpack_require__(0); +var context = __webpack_require__(81); +var INCLUDES = 'includes'; + +$export($export.P + $export.F * __webpack_require__(82)(INCLUDES), 'String', { + includes: function includes(searchString /* , position = 0 */) { + return !!~context(this, searchString, INCLUDES) + .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); + } +}); + + +/***/ }), +/* 190 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); + +$export($export.P, 'String', { + // 21.1.3.13 String.prototype.repeat(count) + repeat: __webpack_require__(77) +}); + + +/***/ }), +/* 191 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 21.1.3.18 String.prototype.startsWith(searchString [, position ]) + +var $export = __webpack_require__(0); +var toLength = __webpack_require__(8); +var context = __webpack_require__(81); +var STARTS_WITH = 'startsWith'; +var $startsWith = ''[STARTS_WITH]; + +$export($export.P + $export.F * __webpack_require__(82)(STARTS_WITH), 'String', { + startsWith: function startsWith(searchString /* , position = 0 */) { + var that = context(this, searchString, STARTS_WITH); + var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); + var search = String(searchString); + return $startsWith + ? $startsWith.call(that, search, index) + : that.slice(index, index + search.length) === search; + } +}); + + +/***/ }), +/* 192 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $at = __webpack_require__(80)(true); + +// 21.1.3.27 String.prototype[@@iterator]() +__webpack_require__(55)(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 }; +}); + + +/***/ }), +/* 193 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.2 String.prototype.anchor(name) +__webpack_require__(18)('anchor', function (createHTML) { + return function anchor(name) { + return createHTML(this, 'a', 'name', name); + }; +}); + + +/***/ }), +/* 194 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.3 String.prototype.big() +__webpack_require__(18)('big', function (createHTML) { + return function big() { + return createHTML(this, 'big', '', ''); + }; +}); + + +/***/ }), +/* 195 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.4 String.prototype.blink() +__webpack_require__(18)('blink', function (createHTML) { + return function blink() { + return createHTML(this, 'blink', '', ''); + }; +}); + + +/***/ }), +/* 196 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.5 String.prototype.bold() +__webpack_require__(18)('bold', function (createHTML) { + return function bold() { + return createHTML(this, 'b', '', ''); + }; +}); + + +/***/ }), +/* 197 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.6 String.prototype.fixed() +__webpack_require__(18)('fixed', function (createHTML) { + return function fixed() { + return createHTML(this, 'tt', '', ''); + }; +}); + + +/***/ }), +/* 198 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.7 String.prototype.fontcolor(color) +__webpack_require__(18)('fontcolor', function (createHTML) { + return function fontcolor(color) { + return createHTML(this, 'font', 'color', color); + }; +}); + + +/***/ }), +/* 199 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.8 String.prototype.fontsize(size) +__webpack_require__(18)('fontsize', function (createHTML) { + return function fontsize(size) { + return createHTML(this, 'font', 'size', size); + }; +}); + + +/***/ }), +/* 200 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.9 String.prototype.italics() +__webpack_require__(18)('italics', function (createHTML) { + return function italics() { + return createHTML(this, 'i', '', ''); + }; +}); + + +/***/ }), +/* 201 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.10 String.prototype.link(url) +__webpack_require__(18)('link', function (createHTML) { + return function link(url) { + return createHTML(this, 'a', 'href', url); + }; +}); + + +/***/ }), +/* 202 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.11 String.prototype.small() +__webpack_require__(18)('small', function (createHTML) { + return function small() { + return createHTML(this, 'small', '', ''); + }; +}); + + +/***/ }), +/* 203 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.12 String.prototype.strike() +__webpack_require__(18)('strike', function (createHTML) { + return function strike() { + return createHTML(this, 'strike', '', ''); + }; +}); + + +/***/ }), +/* 204 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.13 String.prototype.sub() +__webpack_require__(18)('sub', function (createHTML) { + return function sub() { + return createHTML(this, 'sub', '', ''); + }; +}); + + +/***/ }), +/* 205 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.14 String.prototype.sup() +__webpack_require__(18)('sup', function (createHTML) { + return function sup() { + return createHTML(this, 'sup', '', ''); + }; +}); + + +/***/ }), +/* 206 */ +/***/ (function(module, exports, __webpack_require__) { + +// 22.1.2.2 / 15.4.3.2 Array.isArray(arg) +var $export = __webpack_require__(0); + +$export($export.S, 'Array', { isArray: __webpack_require__(53) }); + + +/***/ }), +/* 207 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var ctx = __webpack_require__(19); +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var call = __webpack_require__(107); +var isArrayIter = __webpack_require__(83); +var toLength = __webpack_require__(8); +var createProperty = __webpack_require__(84); +var getIterFn = __webpack_require__(49); + +$export($export.S + $export.F * !__webpack_require__(57)(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; + } +}); + + +/***/ }), +/* 208 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var createProperty = __webpack_require__(84); + +// WebKit Array.of isn't generic +$export($export.S + $export.F * __webpack_require__(4)(function () { + function F() { /* empty */ } + return !(Array.of.call(F) instanceof F); +}), 'Array', { + // 22.1.2.3 Array.of( ...items) + of: function of(/* ...args */) { + var index = 0; + var aLen = arguments.length; + var result = new (typeof this == 'function' ? this : Array)(aLen); + while (aLen > index) createProperty(result, index, arguments[index++]); + result.length = aLen; + return result; + } +}); + + +/***/ }), +/* 209 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 22.1.3.13 Array.prototype.join(separator) +var $export = __webpack_require__(0); +var toIObject = __webpack_require__(11); +var arrayJoin = [].join; + +// fallback for not array-like strings +$export($export.P + $export.F * (__webpack_require__(47) != Object || !__webpack_require__(21)(arrayJoin)), 'Array', { + join: function join(separator) { + return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); + } +}); + + +/***/ }), +/* 210 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var html = __webpack_require__(71); +var cof = __webpack_require__(20); +var toAbsoluteIndex = __webpack_require__(37); +var toLength = __webpack_require__(8); +var arraySlice = [].slice; + +// fallback for not array-like ES3 strings and DOM objects +$export($export.P + $export.F * __webpack_require__(4)(function () { + if (html) arraySlice.call(html); +}), 'Array', { + slice: function slice(begin, end) { + var len = toLength(this.length); + var klass = cof(this); + end = end === undefined ? len : end; + if (klass == 'Array') return arraySlice.call(this, begin, end); + var start = toAbsoluteIndex(begin, len); + var upTo = toAbsoluteIndex(end, len); + var size = toLength(upTo - start); + var cloned = new Array(size); + var i = 0; + for (; i < size; i++) cloned[i] = klass == 'String' + ? this.charAt(start + i) + : this[start + i]; + return cloned; + } +}); + + +/***/ }), +/* 211 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var aFunction = __webpack_require__(10); +var toObject = __webpack_require__(9); +var fails = __webpack_require__(4); +var $sort = [].sort; +var test = [1, 2, 3]; + +$export($export.P + $export.F * (fails(function () { + // IE8- + test.sort(undefined); +}) || !fails(function () { + // V8 bug + test.sort(null); + // Old WebKit +}) || !__webpack_require__(21)($sort)), 'Array', { + // 22.1.3.25 Array.prototype.sort(comparefn) + sort: function sort(comparefn) { + return comparefn === undefined + ? $sort.call(toObject(this)) + : $sort.call(toObject(this), aFunction(comparefn)); + } +}); + + +/***/ }), +/* 212 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $forEach = __webpack_require__(26)(0); +var STRICT = __webpack_require__(21)([].forEach, true); + +$export($export.P + $export.F * !STRICT, 'Array', { + // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) + forEach: function forEach(callbackfn /* , thisArg */) { + return $forEach(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), +/* 213 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(3); +var isArray = __webpack_require__(53); +var SPECIES = __webpack_require__(5)('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; +}; + + +/***/ }), +/* 214 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $map = __webpack_require__(26)(1); + +$export($export.P + $export.F * !__webpack_require__(21)([].map, true), 'Array', { + // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) + map: function map(callbackfn /* , thisArg */) { + return $map(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), +/* 215 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $filter = __webpack_require__(26)(2); + +$export($export.P + $export.F * !__webpack_require__(21)([].filter, true), 'Array', { + // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) + filter: function filter(callbackfn /* , thisArg */) { + return $filter(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), +/* 216 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $some = __webpack_require__(26)(3); + +$export($export.P + $export.F * !__webpack_require__(21)([].some, true), 'Array', { + // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) + some: function some(callbackfn /* , thisArg */) { + return $some(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), +/* 217 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $every = __webpack_require__(26)(4); + +$export($export.P + $export.F * !__webpack_require__(21)([].every, true), 'Array', { + // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) + every: function every(callbackfn /* , thisArg */) { + return $every(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), +/* 218 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $reduce = __webpack_require__(108); + +$export($export.P + $export.F * !__webpack_require__(21)([].reduce, true), 'Array', { + // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) + reduce: function reduce(callbackfn /* , initialValue */) { + return $reduce(this, callbackfn, arguments.length, arguments[1], false); + } +}); + + +/***/ }), +/* 219 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $reduce = __webpack_require__(108); + +$export($export.P + $export.F * !__webpack_require__(21)([].reduceRight, true), 'Array', { + // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) + reduceRight: function reduceRight(callbackfn /* , initialValue */) { + return $reduce(this, callbackfn, arguments.length, arguments[1], true); + } +}); + + +/***/ }), +/* 220 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $indexOf = __webpack_require__(51)(false); +var $native = [].indexOf; +var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; + +$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(21)($native)), 'Array', { + // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) + indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { + return NEGATIVE_ZERO + // convert -0 to +0 + ? $native.apply(this, arguments) || 0 + : $indexOf(this, searchElement, arguments[1]); + } +}); + + +/***/ }), +/* 221 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toIObject = __webpack_require__(11); +var toInteger = __webpack_require__(24); +var toLength = __webpack_require__(8); +var $native = [].lastIndexOf; +var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; + +$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(21)($native)), 'Array', { + // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) + lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { + // convert -0 to +0 + if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0; + var O = toIObject(this); + var length = toLength(O.length); + var index = length - 1; + if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1])); + if (index < 0) index = length + index; + for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0; + return -1; + } +}); + + +/***/ }), +/* 222 */ +/***/ (function(module, exports, __webpack_require__) { + +// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) +var $export = __webpack_require__(0); + +$export($export.P, 'Array', { copyWithin: __webpack_require__(109) }); + +__webpack_require__(34)('copyWithin'); + + +/***/ }), +/* 223 */ +/***/ (function(module, exports, __webpack_require__) { + +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) +var $export = __webpack_require__(0); + +$export($export.P, 'Array', { fill: __webpack_require__(86) }); + +__webpack_require__(34)('fill'); + + +/***/ }), +/* 224 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) +var $export = __webpack_require__(0); +var $find = __webpack_require__(26)(5); +var KEY = 'find'; +var forced = true; +// Shouldn't skip holes +if (KEY in []) Array(1)[KEY](function () { forced = false; }); +$export($export.P + $export.F * forced, 'Array', { + find: function find(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); +__webpack_require__(34)(KEY); + + +/***/ }), +/* 225 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) +var $export = __webpack_require__(0); +var $find = __webpack_require__(26)(6); +var KEY = 'findIndex'; +var forced = true; +// Shouldn't skip holes +if (KEY in []) Array(1)[KEY](function () { forced = false; }); +$export($export.P + $export.F * forced, 'Array', { + findIndex: function findIndex(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); +__webpack_require__(34)(KEY); + + +/***/ }), +/* 226 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(41)('Array'); + + +/***/ }), +/* 227 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var inheritIfRequired = __webpack_require__(75); +var dP = __webpack_require__(6).f; +var gOPN = __webpack_require__(38).f; +var isRegExp = __webpack_require__(54); +var $flags = __webpack_require__(58); +var $RegExp = global.RegExp; +var Base = $RegExp; +var proto = $RegExp.prototype; +var re1 = /a/g; +var re2 = /a/g; +// "new" creates a new object, old webkit buggy here +var CORRECT_NEW = new $RegExp(re1) !== re1; + +if (__webpack_require__(7) && (!CORRECT_NEW || __webpack_require__(4)(function () { + re2[__webpack_require__(5)('match')] = false; + // RegExp constructor can alter flags and IsRegExp works correct with @@match + return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i'; +}))) { + $RegExp = function RegExp(p, f) { + var tiRE = this instanceof $RegExp; + var piRE = isRegExp(p); + var fiU = f === undefined; + return !tiRE && piRE && p.constructor === $RegExp && fiU ? p + : inheritIfRequired(CORRECT_NEW + ? new Base(piRE && !fiU ? p.source : p, f) + : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f) + , tiRE ? this : proto, $RegExp); + }; + var proxy = function (key) { + key in $RegExp || dP($RegExp, key, { + configurable: true, + get: function () { return Base[key]; }, + set: function (it) { Base[key] = it; } + }); + }; + for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]); + proto.constructor = $RegExp; + $RegExp.prototype = proto; + __webpack_require__(15)(global, 'RegExp', $RegExp); +} + +__webpack_require__(41)('RegExp'); + + +/***/ }), +/* 228 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +__webpack_require__(110); +var anObject = __webpack_require__(1); +var $flags = __webpack_require__(58); +var DESCRIPTORS = __webpack_require__(7); +var TO_STRING = 'toString'; +var $toString = /./[TO_STRING]; + +var define = function (fn) { + __webpack_require__(15)(RegExp.prototype, TO_STRING, fn, true); +}; + +// 21.2.5.14 RegExp.prototype.toString() +if (__webpack_require__(4)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) { + define(function toString() { + var R = anObject(this); + return '/'.concat(R.source, '/', + 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined); + }); +// FF44- RegExp#toString has a wrong name +} else if ($toString.name != TO_STRING) { + define(function toString() { + return $toString.call(this); + }); +} + + +/***/ }), +/* 229 */ +/***/ (function(module, exports, __webpack_require__) { + +// @@match logic +__webpack_require__(59)('match', 1, function (defined, MATCH, $match) { + // 21.1.3.11 String.prototype.match(regexp) + return [function match(regexp) { + 'use strict'; + var O = defined(this); + var fn = regexp == undefined ? undefined : regexp[MATCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); + }, $match]; +}); + + +/***/ }), +/* 230 */ +/***/ (function(module, exports, __webpack_require__) { + +// @@replace logic +__webpack_require__(59)('replace', 2, function (defined, REPLACE, $replace) { + // 21.1.3.14 String.prototype.replace(searchValue, replaceValue) + return [function replace(searchValue, replaceValue) { + 'use strict'; + var O = defined(this); + var fn = searchValue == undefined ? undefined : searchValue[REPLACE]; + return fn !== undefined + ? fn.call(searchValue, O, replaceValue) + : $replace.call(String(O), searchValue, replaceValue); + }, $replace]; +}); + + +/***/ }), +/* 231 */ +/***/ (function(module, exports, __webpack_require__) { + +// @@search logic +__webpack_require__(59)('search', 1, function (defined, SEARCH, $search) { + // 21.1.3.15 String.prototype.search(regexp) + return [function search(regexp) { + 'use strict'; + var O = defined(this); + var fn = regexp == undefined ? undefined : regexp[SEARCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); + }, $search]; +}); + + +/***/ }), +/* 232 */ +/***/ (function(module, exports, __webpack_require__) { + +// @@split logic +__webpack_require__(59)('split', 2, function (defined, SPLIT, $split) { + 'use strict'; + var isRegExp = __webpack_require__(54); + var _split = $split; + var $push = [].push; + var $SPLIT = 'split'; + var LENGTH = 'length'; + var LAST_INDEX = 'lastIndex'; + if ( + 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || + 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || + 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || + '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || + '.'[$SPLIT](/()()/)[LENGTH] > 1 || + ''[$SPLIT](/.?/)[LENGTH] + ) { + var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group + // based on es5-shim implementation, need to rework it + $split = function (separator, limit) { + var string = String(this); + if (separator === undefined && limit === 0) return []; + // If `separator` is not a regex, use native split + if (!isRegExp(separator)) return _split.call(string, separator, limit); + var output = []; + var flags = (separator.ignoreCase ? 'i' : '') + + (separator.multiline ? 'm' : '') + + (separator.unicode ? 'u' : '') + + (separator.sticky ? 'y' : ''); + var lastLastIndex = 0; + var splitLimit = limit === undefined ? 4294967295 : limit >>> 0; + // Make `global` and avoid `lastIndex` issues by working with a copy + var separatorCopy = new RegExp(separator.source, flags + 'g'); + var separator2, match, lastIndex, lastLength, i; + // Doesn't need flags gy, but they don't hurt + if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags); + while (match = separatorCopy.exec(string)) { + // `separatorCopy.lastIndex` is not reliable cross-browser + lastIndex = match.index + match[0][LENGTH]; + if (lastIndex > lastLastIndex) { + output.push(string.slice(lastLastIndex, match.index)); + // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG + // eslint-disable-next-line no-loop-func + if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () { + for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined; + }); + if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1)); + lastLength = match[0][LENGTH]; + lastLastIndex = lastIndex; + if (output[LENGTH] >= splitLimit) break; + } + if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop + } + if (lastLastIndex === string[LENGTH]) { + if (lastLength || !separatorCopy.test('')) output.push(''); + } else output.push(string.slice(lastLastIndex)); + return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; + }; + // Chakra, V8 + } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) { + $split = function (separator, limit) { + return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit); + }; + } + // 21.1.3.17 String.prototype.split(separator, limit) + return [function split(separator, limit) { + var O = defined(this); + var fn = separator == undefined ? undefined : separator[SPLIT]; + return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit); + }, $split]; +}); + + +/***/ }), +/* 233 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var LIBRARY = __webpack_require__(33); +var global = __webpack_require__(2); +var ctx = __webpack_require__(19); +var classof = __webpack_require__(39); +var $export = __webpack_require__(0); +var isObject = __webpack_require__(3); +var aFunction = __webpack_require__(10); +var anInstance = __webpack_require__(42); +var forOf = __webpack_require__(35); +var speciesConstructor = __webpack_require__(60); +var task = __webpack_require__(89).set; +var microtask = __webpack_require__(90)(); +var newPromiseCapabilityModule = __webpack_require__(91); +var perform = __webpack_require__(111); +var userAgent = __webpack_require__(61); +var promiseResolve = __webpack_require__(112); +var PROMISE = 'Promise'; +var TypeError = global.TypeError; +var process = global.process; +var versions = process && process.versions; +var v8 = versions && versions.v8 || ''; +var $Promise = global[PROMISE]; +var isNode = classof(process) == 'process'; +var empty = function () { /* empty */ }; +var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; +var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; + +var USE_NATIVE = !!function () { + try { + // correct subclassing with @@species support + var promise = $Promise.resolve(1); + var FakePromise = (promise.constructor = {})[__webpack_require__(5)('species')] = function (exec) { + exec(empty, empty); + }; + // unhandled rejections tracking support, NodeJS Promise without it fails @@species test + return (isNode || typeof PromiseRejectionEvent == 'function') + && promise.then(empty) instanceof FakePromise + // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables + // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 + // we can't detect it synchronously, so just check versions + && v8.indexOf('6.6') !== 0 + && userAgent.indexOf('Chrome/66') === -1; + } catch (e) { /* empty */ } +}(); + +// helpers +var isThenable = function (it) { + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; +}; +var notify = function (promise, isReject) { + if (promise._n) return; + promise._n = true; + var chain = promise._c; + microtask(function () { + var value = promise._v; + var ok = promise._s == 1; + var i = 0; + var run = function (reaction) { + var handler = ok ? reaction.ok : reaction.fail; + var resolve = reaction.resolve; + var reject = reaction.reject; + var domain = reaction.domain; + var result, then, exited; + try { + if (handler) { + if (!ok) { + if (promise._h == 2) onHandleUnhandled(promise); + promise._h = 1; + } + if (handler === true) result = value; + else { + if (domain) domain.enter(); + result = handler(value); // may throw + if (domain) { + domain.exit(); + exited = true; + } + } + if (result === reaction.promise) { + reject(TypeError('Promise-chain cycle')); + } else if (then = isThenable(result)) { + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch (e) { + if (domain && !exited) domain.exit(); + reject(e); + } + }; + while (chain.length > i) run(chain[i++]); // variable length - can't use forEach + promise._c = []; + promise._n = false; + if (isReject && !promise._h) onUnhandled(promise); + }); +}; +var onUnhandled = function (promise) { + task.call(global, function () { + var value = promise._v; + var unhandled = isUnhandled(promise); + var result, handler, console; + if (unhandled) { + result = perform(function () { + if (isNode) { + process.emit('unhandledRejection', value, promise); + } else if (handler = global.onunhandledrejection) { + handler({ promise: promise, reason: value }); + } else if ((console = global.console) && console.error) { + console.error('Unhandled promise rejection', value); + } + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + promise._h = isNode || isUnhandled(promise) ? 2 : 1; + } promise._a = undefined; + if (unhandled && result.e) throw result.v; + }); +}; +var isUnhandled = function (promise) { + return promise._h !== 1 && (promise._a || promise._c).length === 0; +}; +var onHandleUnhandled = function (promise) { + task.call(global, function () { + var handler; + if (isNode) { + process.emit('rejectionHandled', promise); + } else if (handler = global.onrejectionhandled) { + handler({ promise: promise, reason: promise._v }); + } + }); +}; +var $reject = function (value) { + var promise = this; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + promise._v = value; + promise._s = 2; + if (!promise._a) promise._a = promise._c.slice(); + notify(promise, true); +}; +var $resolve = function (value) { + var promise = this; + var then; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + try { + if (promise === value) throw TypeError("Promise can't be resolved itself"); + if (then = isThenable(value)) { + microtask(function () { + var wrapper = { _w: promise, _d: false }; // wrap + try { + then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); + } catch (e) { + $reject.call(wrapper, e); + } + }); + } else { + promise._v = value; + promise._s = 1; + notify(promise, false); + } + } catch (e) { + $reject.call({ _w: promise, _d: false }, e); // wrap + } +}; + +// constructor polyfill +if (!USE_NATIVE) { + // 25.4.3.1 Promise(executor) + $Promise = function Promise(executor) { + anInstance(this, $Promise, PROMISE, '_h'); + aFunction(executor); + Internal.call(this); + try { + executor(ctx($resolve, this, 1), ctx($reject, this, 1)); + } catch (err) { + $reject.call(this, err); + } + }; + // eslint-disable-next-line no-unused-vars + Internal = function Promise(executor) { + this._c = []; // <- awaiting reactions + this._a = undefined; // <- checked in isUnhandled reactions + this._s = 0; // <- state + this._d = false; // <- done + this._v = undefined; // <- value + this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled + this._n = false; // <- notify + }; + Internal.prototype = __webpack_require__(43)($Promise.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected) { + var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = isNode ? process.domain : undefined; + this._c.push(reaction); + if (this._a) this._a.push(reaction); + if (this._s) notify(this, false); + return reaction.promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function (onRejected) { + return this.then(undefined, onRejected); + } + }); + OwnPromiseCapability = function () { + var promise = new Internal(); + this.promise = promise; + this.resolve = ctx($resolve, promise, 1); + this.reject = ctx($reject, promise, 1); + }; + newPromiseCapabilityModule.f = newPromiseCapability = function (C) { + return C === $Promise || C === Wrapper + ? new OwnPromiseCapability(C) + : newGenericPromiseCapability(C); + }; +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); +__webpack_require__(44)($Promise, PROMISE); +__webpack_require__(41)(PROMISE); +Wrapper = __webpack_require__(13)[PROMISE]; + +// statics +$export($export.S + $export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r) { + var capability = newPromiseCapability(this); + var $$reject = capability.reject; + $$reject(r); + return capability.promise; + } +}); +$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x) { + return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); + } +}); +$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(57)(function (iter) { + $Promise.all(iter)['catch'](empty); +})), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var resolve = capability.resolve; + var reject = capability.reject; + var result = perform(function () { + var values = []; + var index = 0; + var remaining = 1; + forOf(iterable, false, function (promise) { + var $index = index++; + var alreadyCalled = false; + values.push(undefined); + remaining++; + C.resolve(promise).then(function (value) { + if (alreadyCalled) return; + alreadyCalled = true; + values[$index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if (result.e) reject(result.v); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var reject = capability.reject; + var result = perform(function () { + forOf(iterable, false, function (promise) { + C.resolve(promise).then(capability.resolve, reject); + }); + }); + if (result.e) reject(result.v); + return capability.promise; + } +}); + + +/***/ }), +/* 234 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var weak = __webpack_require__(117); +var validate = __webpack_require__(46); +var WEAK_SET = 'WeakSet'; + +// 23.4 WeakSet Objects +__webpack_require__(62)(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); + + +/***/ }), +/* 235 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.1 Reflect.apply(target, thisArgument, argumentsList) +var $export = __webpack_require__(0); +var aFunction = __webpack_require__(10); +var anObject = __webpack_require__(1); +var rApply = (__webpack_require__(2).Reflect || {}).apply; +var fApply = Function.apply; +// MS Edge argumentsList argument is optional +$export($export.S + $export.F * !__webpack_require__(4)(function () { + rApply(function () { /* empty */ }); +}), 'Reflect', { + apply: function apply(target, thisArgument, argumentsList) { + var T = aFunction(target); + var L = anObject(argumentsList); + return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); + } +}); + + +/***/ }), +/* 236 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) +var $export = __webpack_require__(0); +var create = __webpack_require__(28); +var aFunction = __webpack_require__(10); +var anObject = __webpack_require__(1); +var isObject = __webpack_require__(3); +var fails = __webpack_require__(4); +var bind = __webpack_require__(100); +var rConstruct = (__webpack_require__(2).Reflect || {}).construct; + +// MS Edge supports only 2 arguments and argumentsList argument is optional +// FF Nightly sets third argument as `new.target`, but does not create `this` from it +var NEW_TARGET_BUG = fails(function () { + function F() { /* empty */ } + return !(rConstruct(function () { /* empty */ }, [], F) instanceof F); +}); +var ARGS_BUG = !fails(function () { + rConstruct(function () { /* empty */ }); +}); + +$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { + construct: function construct(Target, args /* , newTarget */) { + aFunction(Target); + anObject(args); + var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); + if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget); + if (Target == newTarget) { + // w/o altered newTarget, optimization for 0-4 arguments + switch (args.length) { + case 0: return new Target(); + case 1: return new Target(args[0]); + case 2: return new Target(args[0], args[1]); + case 3: return new Target(args[0], args[1], args[2]); + case 4: return new Target(args[0], args[1], args[2], args[3]); + } + // w/o altered newTarget, lot of arguments case + var $args = [null]; + $args.push.apply($args, args); + return new (bind.apply(Target, $args))(); + } + // with altered newTarget, not support built-in constructors + var proto = newTarget.prototype; + var instance = create(isObject(proto) ? proto : Object.prototype); + var result = Function.apply.call(Target, instance, args); + return isObject(result) ? result : instance; + } +}); + + +/***/ }), +/* 237 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) +var dP = __webpack_require__(6); +var $export = __webpack_require__(0); +var anObject = __webpack_require__(1); +var toPrimitive = __webpack_require__(22); + +// MS Edge has broken Reflect.defineProperty - throwing instead of returning false +$export($export.S + $export.F * __webpack_require__(4)(function () { + // eslint-disable-next-line no-undef + Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 }); +}), 'Reflect', { + defineProperty: function defineProperty(target, propertyKey, attributes) { + anObject(target); + propertyKey = toPrimitive(propertyKey, true); + anObject(attributes); + try { + dP.f(target, propertyKey, attributes); + return true; + } catch (e) { + return false; + } + } +}); + + +/***/ }), +/* 238 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.4 Reflect.deleteProperty(target, propertyKey) +var $export = __webpack_require__(0); +var gOPD = __webpack_require__(16).f; +var anObject = __webpack_require__(1); + +$export($export.S, 'Reflect', { + deleteProperty: function deleteProperty(target, propertyKey) { + var desc = gOPD(anObject(target), propertyKey); + return desc && !desc.configurable ? false : delete target[propertyKey]; + } +}); + + +/***/ }), +/* 239 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 26.1.5 Reflect.enumerate(target) +var $export = __webpack_require__(0); +var anObject = __webpack_require__(1); +var Enumerate = function (iterated) { + this._t = anObject(iterated); // target + this._i = 0; // next index + var keys = this._k = []; // keys + var key; + for (key in iterated) keys.push(key); +}; +__webpack_require__(56)(Enumerate, 'Object', function () { + var that = this; + var keys = that._k; + var key; + do { + if (that._i >= keys.length) return { value: undefined, done: true }; + } while (!((key = keys[that._i++]) in that._t)); + return { value: key, done: false }; +}); + +$export($export.S, 'Reflect', { + enumerate: function enumerate(target) { + return new Enumerate(target); + } +}); + + +/***/ }), +/* 240 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.6 Reflect.get(target, propertyKey [, receiver]) +var gOPD = __webpack_require__(16); +var getPrototypeOf = __webpack_require__(17); +var has = __webpack_require__(12); +var $export = __webpack_require__(0); +var isObject = __webpack_require__(3); +var anObject = __webpack_require__(1); + +function get(target, propertyKey /* , receiver */) { + var receiver = arguments.length < 3 ? target : arguments[2]; + var desc, proto; + if (anObject(target) === receiver) return target[propertyKey]; + if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value') + ? desc.value + : desc.get !== undefined + ? desc.get.call(receiver) + : undefined; + if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver); +} + +$export($export.S, 'Reflect', { get: get }); + + +/***/ }), +/* 241 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) +var gOPD = __webpack_require__(16); +var $export = __webpack_require__(0); +var anObject = __webpack_require__(1); + +$export($export.S, 'Reflect', { + getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { + return gOPD.f(anObject(target), propertyKey); + } +}); + + +/***/ }), +/* 242 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.8 Reflect.getPrototypeOf(target) +var $export = __webpack_require__(0); +var getProto = __webpack_require__(17); +var anObject = __webpack_require__(1); + +$export($export.S, 'Reflect', { + getPrototypeOf: function getPrototypeOf(target) { + return getProto(anObject(target)); + } +}); + + +/***/ }), +/* 243 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.9 Reflect.has(target, propertyKey) +var $export = __webpack_require__(0); + +$export($export.S, 'Reflect', { + has: function has(target, propertyKey) { + return propertyKey in target; + } +}); + + +/***/ }), +/* 244 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.10 Reflect.isExtensible(target) +var $export = __webpack_require__(0); +var anObject = __webpack_require__(1); +var $isExtensible = Object.isExtensible; + +$export($export.S, 'Reflect', { + isExtensible: function isExtensible(target) { + anObject(target); + return $isExtensible ? $isExtensible(target) : true; + } +}); + + +/***/ }), +/* 245 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.11 Reflect.ownKeys(target) +var $export = __webpack_require__(0); + +$export($export.S, 'Reflect', { ownKeys: __webpack_require__(92) }); + + +/***/ }), +/* 246 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.12 Reflect.preventExtensions(target) +var $export = __webpack_require__(0); +var anObject = __webpack_require__(1); +var $preventExtensions = Object.preventExtensions; + +$export($export.S, 'Reflect', { + preventExtensions: function preventExtensions(target) { + anObject(target); + try { + if ($preventExtensions) $preventExtensions(target); + return true; + } catch (e) { + return false; + } + } +}); + + +/***/ }), +/* 247 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) +var dP = __webpack_require__(6); +var gOPD = __webpack_require__(16); +var getPrototypeOf = __webpack_require__(17); +var has = __webpack_require__(12); +var $export = __webpack_require__(0); +var createDesc = __webpack_require__(31); +var anObject = __webpack_require__(1); +var isObject = __webpack_require__(3); + +function set(target, propertyKey, V /* , receiver */) { + var receiver = arguments.length < 4 ? target : arguments[3]; + var ownDesc = gOPD.f(anObject(target), propertyKey); + var existingDescriptor, proto; + if (!ownDesc) { + if (isObject(proto = getPrototypeOf(target))) { + return set(proto, propertyKey, V, receiver); + } + ownDesc = createDesc(0); + } + if (has(ownDesc, 'value')) { + if (ownDesc.writable === false || !isObject(receiver)) return false; + if (existingDescriptor = gOPD.f(receiver, propertyKey)) { + if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false; + existingDescriptor.value = V; + dP.f(receiver, propertyKey, existingDescriptor); + } else dP.f(receiver, propertyKey, createDesc(0, V)); + return true; + } + return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); +} + +$export($export.S, 'Reflect', { set: set }); + + +/***/ }), +/* 248 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.14 Reflect.setPrototypeOf(target, proto) +var $export = __webpack_require__(0); +var setProto = __webpack_require__(73); + +if (setProto) $export($export.S, 'Reflect', { + setPrototypeOf: function setPrototypeOf(target, proto) { + setProto.check(target, proto); + try { + setProto.set(target, proto); + return true; + } catch (e) { + return false; + } + } +}); + + +/***/ }), +/* 249 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.3.3.1 / 15.9.4.4 Date.now() +var $export = __webpack_require__(0); + +$export($export.S, 'Date', { now: function () { return new Date().getTime(); } }); + + +/***/ }), +/* 250 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var toPrimitive = __webpack_require__(22); + +$export($export.P + $export.F * __webpack_require__(4)(function () { + return new Date(NaN).toJSON() !== null + || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; +}), 'Date', { + // eslint-disable-next-line no-unused-vars + toJSON: function toJSON(key) { + var O = toObject(this); + var pv = toPrimitive(O); + return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); + } +}); + + +/***/ }), +/* 251 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() +var $export = __webpack_require__(0); +var toISOString = __webpack_require__(252); + +// PhantomJS / old WebKit has a broken implementations +$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', { + toISOString: toISOString +}); + + +/***/ }), +/* 252 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() +var fails = __webpack_require__(4); +var getTime = Date.prototype.getTime; +var $toISOString = Date.prototype.toISOString; + +var lz = function (num) { + return num > 9 ? num : '0' + num; +}; + +// PhantomJS / old WebKit has a broken implementations +module.exports = (fails(function () { + return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; +}) || !fails(function () { + $toISOString.call(new Date(NaN)); +})) ? function toISOString() { + if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value'); + var d = this; + var y = d.getUTCFullYear(); + var m = d.getUTCMilliseconds(); + var s = y < 0 ? '-' : y > 9999 ? '+' : ''; + return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + + '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + + 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + + ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; +} : $toISOString; + + +/***/ }), +/* 253 */ +/***/ (function(module, exports, __webpack_require__) { + +var DateProto = Date.prototype; +var INVALID_DATE = 'Invalid Date'; +var TO_STRING = 'toString'; +var $toString = DateProto[TO_STRING]; +var getTime = DateProto.getTime; +if (new Date(NaN) + '' != INVALID_DATE) { + __webpack_require__(15)(DateProto, TO_STRING, function toString() { + var value = getTime.call(this); + // eslint-disable-next-line no-self-compare + return value === value ? $toString.call(this) : INVALID_DATE; + }); +} + + +/***/ }), +/* 254 */ +/***/ (function(module, exports, __webpack_require__) { + +var TO_PRIMITIVE = __webpack_require__(5)('toPrimitive'); +var proto = Date.prototype; + +if (!(TO_PRIMITIVE in proto)) __webpack_require__(14)(proto, TO_PRIMITIVE, __webpack_require__(255)); + + +/***/ }), +/* 255 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var anObject = __webpack_require__(1); +var toPrimitive = __webpack_require__(22); +var NUMBER = 'number'; + +module.exports = function (hint) { + if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint'); + return toPrimitive(anObject(this), hint != NUMBER); +}; + + +/***/ }), +/* 256 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $typed = __webpack_require__(63); +var buffer = __webpack_require__(93); +var anObject = __webpack_require__(1); +var toAbsoluteIndex = __webpack_require__(37); +var toLength = __webpack_require__(8); +var isObject = __webpack_require__(3); +var ArrayBuffer = __webpack_require__(2).ArrayBuffer; +var speciesConstructor = __webpack_require__(60); +var $ArrayBuffer = buffer.ArrayBuffer; +var $DataView = buffer.DataView; +var $isView = $typed.ABV && ArrayBuffer.isView; +var $slice = $ArrayBuffer.prototype.slice; +var VIEW = $typed.VIEW; +var ARRAY_BUFFER = 'ArrayBuffer'; + +$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer }); + +$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { + // 24.1.3.1 ArrayBuffer.isView(arg) + isView: function isView(it) { + return $isView && $isView(it) || isObject(it) && VIEW in it; + } +}); + +$export($export.P + $export.U + $export.F * __webpack_require__(4)(function () { + return !new $ArrayBuffer(2).slice(1, undefined).byteLength; +}), ARRAY_BUFFER, { + // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) + slice: function slice(start, end) { + if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix + var len = anObject(this).byteLength; + var first = toAbsoluteIndex(start, len); + var fin = toAbsoluteIndex(end === undefined ? len : end, len); + var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first)); + var viewS = new $DataView(this); + var viewT = new $DataView(result); + var index = 0; + while (first < fin) { + viewT.setUint8(index++, viewS.getUint8(first++)); + } return result; + } +}); + +__webpack_require__(41)(ARRAY_BUFFER); + + +/***/ }), +/* 257 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +$export($export.G + $export.W + $export.F * !__webpack_require__(63).ABV, { + DataView: __webpack_require__(93).DataView +}); + + +/***/ }), +/* 258 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(29)('Int8', 1, function (init) { + return function Int8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 259 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(29)('Uint8', 1, function (init) { + return function Uint8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 260 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(29)('Uint8', 1, function (init) { + return function Uint8ClampedArray(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}, true); + + +/***/ }), +/* 261 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(29)('Int16', 2, function (init) { + return function Int16Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 262 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(29)('Uint16', 2, function (init) { + return function Uint16Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 263 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(29)('Int32', 4, function (init) { + return function Int32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 264 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(29)('Uint32', 4, function (init) { + return function Uint32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 265 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(29)('Float32', 4, function (init) { + return function Float32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 266 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(29)('Float64', 8, function (init) { + return function Float64Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 267 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/tc39/Array.prototype.includes +var $export = __webpack_require__(0); +var $includes = __webpack_require__(51)(true); + +$export($export.P, 'Array', { + includes: function includes(el /* , fromIndex = 0 */) { + return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +__webpack_require__(34)('includes'); + + +/***/ }), +/* 268 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap +var $export = __webpack_require__(0); +var flattenIntoArray = __webpack_require__(119); +var toObject = __webpack_require__(9); +var toLength = __webpack_require__(8); +var aFunction = __webpack_require__(10); +var arraySpeciesCreate = __webpack_require__(85); + +$export($export.P, 'Array', { + flatMap: function flatMap(callbackfn /* , thisArg */) { + var O = toObject(this); + var sourceLen, A; + aFunction(callbackfn); + sourceLen = toLength(O.length); + A = arraySpeciesCreate(O, 0); + flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]); + return A; + } +}); + +__webpack_require__(34)('flatMap'); + + +/***/ }), +/* 269 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten +var $export = __webpack_require__(0); +var flattenIntoArray = __webpack_require__(119); +var toObject = __webpack_require__(9); +var toLength = __webpack_require__(8); +var toInteger = __webpack_require__(24); +var arraySpeciesCreate = __webpack_require__(85); + +$export($export.P, 'Array', { + flatten: function flatten(/* depthArg = 1 */) { + var depthArg = arguments[0]; + var O = toObject(this); + var sourceLen = toLength(O.length); + var A = arraySpeciesCreate(O, 0); + flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg)); + return A; + } +}); + +__webpack_require__(34)('flatten'); + + +/***/ }), +/* 270 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/mathiasbynens/String.prototype.at +var $export = __webpack_require__(0); +var $at = __webpack_require__(80)(true); + +$export($export.P, 'String', { + at: function at(pos) { + return $at(this, pos); + } +}); + + +/***/ }), +/* 271 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/tc39/proposal-string-pad-start-end +var $export = __webpack_require__(0); +var $pad = __webpack_require__(120); +var userAgent = __webpack_require__(61); + +// https://github.com/zloirock/core-js/issues/280 +$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { + padStart: function padStart(maxLength /* , fillString = ' ' */) { + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); + } +}); + + +/***/ }), +/* 272 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/tc39/proposal-string-pad-start-end +var $export = __webpack_require__(0); +var $pad = __webpack_require__(120); +var userAgent = __webpack_require__(61); + +// https://github.com/zloirock/core-js/issues/280 +$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { + padEnd: function padEnd(maxLength /* , fillString = ' ' */) { + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); + } +}); + + +/***/ }), +/* 273 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/sebmarkbage/ecmascript-string-left-right-trim +__webpack_require__(45)('trimLeft', function ($trim) { + return function trimLeft() { + return $trim(this, 1); + }; +}, 'trimStart'); + + +/***/ }), +/* 274 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/sebmarkbage/ecmascript-string-left-right-trim +__webpack_require__(45)('trimRight', function ($trim) { + return function trimRight() { + return $trim(this, 2); + }; +}, 'trimEnd'); + + +/***/ }), +/* 275 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/String.prototype.matchAll/ +var $export = __webpack_require__(0); +var defined = __webpack_require__(23); +var toLength = __webpack_require__(8); +var isRegExp = __webpack_require__(54); +var getFlags = __webpack_require__(58); +var RegExpProto = RegExp.prototype; + +var $RegExpStringIterator = function (regexp, string) { + this._r = regexp; + this._s = string; +}; + +__webpack_require__(56)($RegExpStringIterator, 'RegExp String', function next() { + var match = this._r.exec(this._s); + return { value: match, done: match === null }; +}); + +$export($export.P, 'String', { + matchAll: function matchAll(regexp) { + defined(this); + if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!'); + var S = String(this); + var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp); + var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags); + rx.lastIndex = toLength(regexp.lastIndex); + return new $RegExpStringIterator(rx, S); + } +}); + + +/***/ }), +/* 276 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(68)('asyncIterator'); + + +/***/ }), +/* 277 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(68)('observable'); + + +/***/ }), +/* 278 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-object-getownpropertydescriptors +var $export = __webpack_require__(0); +var ownKeys = __webpack_require__(92); +var toIObject = __webpack_require__(11); +var gOPD = __webpack_require__(16); +var createProperty = __webpack_require__(84); + +$export($export.S, 'Object', { + getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { + var O = toIObject(object); + var getDesc = gOPD.f; + var keys = ownKeys(O); + var result = {}; + var i = 0; + var key, desc; + while (keys.length > i) { + desc = getDesc(O, key = keys[i++]); + if (desc !== undefined) createProperty(result, key, desc); + } + return result; + } +}); + + +/***/ }), +/* 279 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-object-values-entries +var $export = __webpack_require__(0); +var $values = __webpack_require__(121)(false); + +$export($export.S, 'Object', { + values: function values(it) { + return $values(it); + } +}); + + +/***/ }), +/* 280 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-object-values-entries +var $export = __webpack_require__(0); +var $entries = __webpack_require__(121)(true); + +$export($export.S, 'Object', { + entries: function entries(it) { + return $entries(it); + } +}); + + +/***/ }), +/* 281 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var aFunction = __webpack_require__(10); +var $defineProperty = __webpack_require__(6); + +// B.2.2.2 Object.prototype.__defineGetter__(P, getter) +__webpack_require__(7) && $export($export.P + __webpack_require__(64), 'Object', { + __defineGetter__: function __defineGetter__(P, getter) { + $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true }); + } +}); + + +/***/ }), +/* 282 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var aFunction = __webpack_require__(10); +var $defineProperty = __webpack_require__(6); + +// B.2.2.3 Object.prototype.__defineSetter__(P, setter) +__webpack_require__(7) && $export($export.P + __webpack_require__(64), 'Object', { + __defineSetter__: function __defineSetter__(P, setter) { + $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true }); + } +}); + + +/***/ }), +/* 283 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var toPrimitive = __webpack_require__(22); +var getPrototypeOf = __webpack_require__(17); +var getOwnPropertyDescriptor = __webpack_require__(16).f; + +// B.2.2.4 Object.prototype.__lookupGetter__(P) +__webpack_require__(7) && $export($export.P + __webpack_require__(64), 'Object', { + __lookupGetter__: function __lookupGetter__(P) { + var O = toObject(this); + var K = toPrimitive(P, true); + var D; + do { + if (D = getOwnPropertyDescriptor(O, K)) return D.get; + } while (O = getPrototypeOf(O)); + } +}); + + +/***/ }), +/* 284 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var toPrimitive = __webpack_require__(22); +var getPrototypeOf = __webpack_require__(17); +var getOwnPropertyDescriptor = __webpack_require__(16).f; + +// B.2.2.5 Object.prototype.__lookupSetter__(P) +__webpack_require__(7) && $export($export.P + __webpack_require__(64), 'Object', { + __lookupSetter__: function __lookupSetter__(P) { + var O = toObject(this); + var K = toPrimitive(P, true); + var D; + do { + if (D = getOwnPropertyDescriptor(O, K)) return D.set; + } while (O = getPrototypeOf(O)); + } +}); + + +/***/ }), +/* 285 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = __webpack_require__(0); + +$export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(122)('Map') }); + + +/***/ }), +/* 286 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = __webpack_require__(0); + +$export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(122)('Set') }); + + +/***/ }), +/* 287 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of +__webpack_require__(65)('Map'); + + +/***/ }), +/* 288 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of +__webpack_require__(65)('Set'); + + +/***/ }), +/* 289 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of +__webpack_require__(65)('WeakMap'); + + +/***/ }), +/* 290 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of +__webpack_require__(65)('WeakSet'); + + +/***/ }), +/* 291 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from +__webpack_require__(66)('Map'); + + +/***/ }), +/* 292 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from +__webpack_require__(66)('Set'); + + +/***/ }), +/* 293 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from +__webpack_require__(66)('WeakMap'); + + +/***/ }), +/* 294 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from +__webpack_require__(66)('WeakSet'); + + +/***/ }), +/* 295 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-global +var $export = __webpack_require__(0); + +$export($export.G, { global: __webpack_require__(2) }); + + +/***/ }), +/* 296 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-global +var $export = __webpack_require__(0); + +$export($export.S, 'System', { global: __webpack_require__(2) }); + + +/***/ }), +/* 297 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/ljharb/proposal-is-error +var $export = __webpack_require__(0); +var cof = __webpack_require__(20); + +$export($export.S, 'Error', { + isError: function isError(it) { + return cof(it) === 'Error'; + } +}); + + +/***/ }), +/* 298 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + clamp: function clamp(x, lower, upper) { + return Math.min(upper, Math.max(lower, x)); + } +}); + + +/***/ }), +/* 299 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 }); + + +/***/ }), +/* 300 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); +var RAD_PER_DEG = 180 / Math.PI; + +$export($export.S, 'Math', { + degrees: function degrees(radians) { + return radians * RAD_PER_DEG; + } +}); + + +/***/ }), +/* 301 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); +var scale = __webpack_require__(124); +var fround = __webpack_require__(106); + +$export($export.S, 'Math', { + fscale: function fscale(x, inLow, inHigh, outLow, outHigh) { + return fround(scale(x, inLow, inHigh, outLow, outHigh)); + } +}); + + +/***/ }), +/* 302 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + iaddh: function iaddh(x0, x1, y0, y1) { + var $x0 = x0 >>> 0; + var $x1 = x1 >>> 0; + var $y0 = y0 >>> 0; + return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; + } +}); + + +/***/ }), +/* 303 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + isubh: function isubh(x0, x1, y0, y1) { + var $x0 = x0 >>> 0; + var $x1 = x1 >>> 0; + var $y0 = y0 >>> 0; + return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; + } +}); + + +/***/ }), +/* 304 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + imulh: function imulh(u, v) { + var UINT16 = 0xffff; + var $u = +u; + var $v = +v; + var u0 = $u & UINT16; + var v0 = $v & UINT16; + var u1 = $u >> 16; + var v1 = $v >> 16; + var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); + } +}); + + +/***/ }), +/* 305 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI }); + + +/***/ }), +/* 306 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); +var DEG_PER_RAD = Math.PI / 180; + +$export($export.S, 'Math', { + radians: function radians(degrees) { + return degrees * DEG_PER_RAD; + } +}); + + +/***/ }), +/* 307 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { scale: __webpack_require__(124) }); + + +/***/ }), +/* 308 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + umulh: function umulh(u, v) { + var UINT16 = 0xffff; + var $u = +u; + var $v = +v; + var u0 = $u & UINT16; + var v0 = $v & UINT16; + var u1 = $u >>> 16; + var v1 = $v >>> 16; + var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); + } +}); + + +/***/ }), +/* 309 */ +/***/ (function(module, exports, __webpack_require__) { + +// http://jfbastien.github.io/papers/Math.signbit.html +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { signbit: function signbit(x) { + // eslint-disable-next-line no-self-compare + return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0; +} }); + + +/***/ }), +/* 310 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// https://github.com/tc39/proposal-promise-finally + +var $export = __webpack_require__(0); +var core = __webpack_require__(13); +var global = __webpack_require__(2); +var speciesConstructor = __webpack_require__(60); +var promiseResolve = __webpack_require__(112); + +$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { + var C = speciesConstructor(this, core.Promise || global.Promise); + var isFunction = typeof onFinally == 'function'; + return this.then( + isFunction ? function (x) { + return promiseResolve(C, onFinally()).then(function () { return x; }); + } : onFinally, + isFunction ? function (e) { + return promiseResolve(C, onFinally()).then(function () { throw e; }); + } : onFinally + ); +} }); + + +/***/ }), +/* 311 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/tc39/proposal-promise-try +var $export = __webpack_require__(0); +var newPromiseCapability = __webpack_require__(91); +var perform = __webpack_require__(111); + +$export($export.S, 'Promise', { 'try': function (callbackfn) { + var promiseCapability = newPromiseCapability.f(this); + var result = perform(callbackfn); + (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); + return promiseCapability.promise; +} }); + + +/***/ }), +/* 312 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(30); +var anObject = __webpack_require__(1); +var toMetaKey = metadata.key; +var ordinaryDefineOwnMetadata = metadata.set; + +metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) { + ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); +} }); + + +/***/ }), +/* 313 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(30); +var anObject = __webpack_require__(1); +var toMetaKey = metadata.key; +var getOrCreateMetadataMap = metadata.map; +var store = metadata.store; + +metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) { + var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]); + var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); + if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false; + if (metadataMap.size) return true; + var targetMetadata = store.get(target); + targetMetadata['delete'](targetKey); + return !!targetMetadata.size || store['delete'](target); +} }); + + +/***/ }), +/* 314 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(30); +var anObject = __webpack_require__(1); +var getPrototypeOf = __webpack_require__(17); +var ordinaryHasOwnMetadata = metadata.has; +var ordinaryGetOwnMetadata = metadata.get; +var toMetaKey = metadata.key; + +var ordinaryGetMetadata = function (MetadataKey, O, P) { + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P); + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; +}; + +metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) { + return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); + + +/***/ }), +/* 315 */ +/***/ (function(module, exports, __webpack_require__) { + +var Set = __webpack_require__(115); +var from = __webpack_require__(123); +var metadata = __webpack_require__(30); +var anObject = __webpack_require__(1); +var getPrototypeOf = __webpack_require__(17); +var ordinaryOwnMetadataKeys = metadata.keys; +var toMetaKey = metadata.key; + +var ordinaryMetadataKeys = function (O, P) { + var oKeys = ordinaryOwnMetadataKeys(O, P); + var parent = getPrototypeOf(O); + if (parent === null) return oKeys; + var pKeys = ordinaryMetadataKeys(parent, P); + return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys; +}; + +metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) { + return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); +} }); + + +/***/ }), +/* 316 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(30); +var anObject = __webpack_require__(1); +var ordinaryGetOwnMetadata = metadata.get; +var toMetaKey = metadata.key; + +metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) { + return ordinaryGetOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); + + +/***/ }), +/* 317 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(30); +var anObject = __webpack_require__(1); +var ordinaryOwnMetadataKeys = metadata.keys; +var toMetaKey = metadata.key; + +metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) { + return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); +} }); + + +/***/ }), +/* 318 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(30); +var anObject = __webpack_require__(1); +var getPrototypeOf = __webpack_require__(17); +var ordinaryHasOwnMetadata = metadata.has; +var toMetaKey = metadata.key; + +var ordinaryHasMetadata = function (MetadataKey, O, P) { + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) return true; + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; +}; + +metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) { + return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); + + +/***/ }), +/* 319 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(30); +var anObject = __webpack_require__(1); +var ordinaryHasOwnMetadata = metadata.has; +var toMetaKey = metadata.key; + +metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) { + return ordinaryHasOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); + + +/***/ }), +/* 320 */ +/***/ (function(module, exports, __webpack_require__) { + +var $metadata = __webpack_require__(30); +var anObject = __webpack_require__(1); +var aFunction = __webpack_require__(10); +var toMetaKey = $metadata.key; +var ordinaryDefineOwnMetadata = $metadata.set; + +$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) { + return function decorator(target, targetKey) { + ordinaryDefineOwnMetadata( + metadataKey, metadataValue, + (targetKey !== undefined ? anObject : aFunction)(target), + toMetaKey(targetKey) + ); + }; +} }); + + +/***/ }), +/* 321 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask +var $export = __webpack_require__(0); +var microtask = __webpack_require__(90)(); +var process = __webpack_require__(2).process; +var isNode = __webpack_require__(20)(process) == 'process'; + +$export($export.G, { + asap: function asap(fn) { + var domain = isNode && process.domain; + microtask(domain ? domain.bind(fn) : fn); + } +}); + + +/***/ }), +/* 322 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/zenparsing/es-observable +var $export = __webpack_require__(0); +var global = __webpack_require__(2); +var core = __webpack_require__(13); +var microtask = __webpack_require__(90)(); +var OBSERVABLE = __webpack_require__(5)('observable'); +var aFunction = __webpack_require__(10); +var anObject = __webpack_require__(1); +var anInstance = __webpack_require__(42); +var redefineAll = __webpack_require__(43); +var hide = __webpack_require__(14); +var forOf = __webpack_require__(35); +var RETURN = forOf.RETURN; + +var getMethod = function (fn) { + return fn == null ? undefined : aFunction(fn); +}; + +var cleanupSubscription = function (subscription) { + var cleanup = subscription._c; + if (cleanup) { + subscription._c = undefined; + cleanup(); + } +}; + +var subscriptionClosed = function (subscription) { + return subscription._o === undefined; +}; + +var closeSubscription = function (subscription) { + if (!subscriptionClosed(subscription)) { + subscription._o = undefined; + cleanupSubscription(subscription); + } +}; + +var Subscription = function (observer, subscriber) { + anObject(observer); + this._c = undefined; + this._o = observer; + observer = new SubscriptionObserver(this); + try { + var cleanup = subscriber(observer); + var subscription = cleanup; + if (cleanup != null) { + if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); }; + else aFunction(cleanup); + this._c = cleanup; + } + } catch (e) { + observer.error(e); + return; + } if (subscriptionClosed(this)) cleanupSubscription(this); +}; + +Subscription.prototype = redefineAll({}, { + unsubscribe: function unsubscribe() { closeSubscription(this); } +}); + +var SubscriptionObserver = function (subscription) { + this._s = subscription; +}; + +SubscriptionObserver.prototype = redefineAll({}, { + next: function next(value) { + var subscription = this._s; + if (!subscriptionClosed(subscription)) { + var observer = subscription._o; + try { + var m = getMethod(observer.next); + if (m) return m.call(observer, value); + } catch (e) { + try { + closeSubscription(subscription); + } finally { + throw e; + } + } + } + }, + error: function error(value) { + var subscription = this._s; + if (subscriptionClosed(subscription)) throw value; + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.error); + if (!m) throw value; + value = m.call(observer, value); + } catch (e) { + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + }, + complete: function complete(value) { + var subscription = this._s; + if (!subscriptionClosed(subscription)) { + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.complete); + value = m ? m.call(observer, value) : undefined; + } catch (e) { + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + } + } +}); + +var $Observable = function Observable(subscriber) { + anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber); +}; + +redefineAll($Observable.prototype, { + subscribe: function subscribe(observer) { + return new Subscription(observer, this._f); + }, + forEach: function forEach(fn) { + var that = this; + return new (core.Promise || global.Promise)(function (resolve, reject) { + aFunction(fn); + var subscription = that.subscribe({ + next: function (value) { + try { + return fn(value); + } catch (e) { + reject(e); + subscription.unsubscribe(); + } + }, + error: reject, + complete: resolve + }); + }); + } +}); + +redefineAll($Observable, { + from: function from(x) { + var C = typeof this === 'function' ? this : $Observable; + var method = getMethod(anObject(x)[OBSERVABLE]); + if (method) { + var observable = anObject(method.call(x)); + return observable.constructor === C ? observable : new C(function (observer) { + return observable.subscribe(observer); + }); + } + return new C(function (observer) { + var done = false; + microtask(function () { + if (!done) { + try { + if (forOf(x, false, function (it) { + observer.next(it); + if (done) return RETURN; + }) === RETURN) return; + } catch (e) { + if (done) throw e; + observer.error(e); + return; + } observer.complete(); + } + }); + return function () { done = true; }; + }); + }, + of: function of() { + for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++]; + return new (typeof this === 'function' ? this : $Observable)(function (observer) { + var done = false; + microtask(function () { + if (!done) { + for (var j = 0; j < items.length; ++j) { + observer.next(items[j]); + if (done) return; + } observer.complete(); + } + }); + return function () { done = true; }; + }); + } +}); + +hide($Observable.prototype, OBSERVABLE, function () { return this; }); + +$export($export.G, { Observable: $Observable }); + +__webpack_require__(41)('Observable'); + + +/***/ }), +/* 323 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var $task = __webpack_require__(89); +$export($export.G + $export.B, { + setImmediate: $task.set, + clearImmediate: $task.clear +}); + + +/***/ }), +/* 324 */ +/***/ (function(module, exports, __webpack_require__) { + +var $iterators = __webpack_require__(87); +var getKeys = __webpack_require__(27); +var redefine = __webpack_require__(15); +var global = __webpack_require__(2); +var hide = __webpack_require__(14); +var Iterators = __webpack_require__(40); +var wks = __webpack_require__(5); +var ITERATOR = wks('iterator'); +var TO_STRING_TAG = wks('toStringTag'); +var ArrayValues = Iterators.Array; + +var DOMIterables = { + CSSRuleList: true, // TODO: Not spec compliant, should be false. + CSSStyleDeclaration: false, + CSSValueList: false, + ClientRectList: false, + DOMRectList: false, + DOMStringList: false, + DOMTokenList: true, + DataTransferItemList: false, + FileList: false, + HTMLAllCollection: false, + HTMLCollection: false, + HTMLFormElement: false, + HTMLSelectElement: false, + MediaList: true, // TODO: Not spec compliant, should be false. + MimeTypeArray: false, + NamedNodeMap: false, + NodeList: true, + PaintRequestList: false, + Plugin: false, + PluginArray: false, + SVGLengthList: false, + SVGNumberList: false, + SVGPathSegList: false, + SVGPointList: false, + SVGStringList: false, + SVGTransformList: false, + SourceBufferList: false, + StyleSheetList: true, // TODO: Not spec compliant, should be false. + TextTrackCueList: false, + TextTrackList: false, + TouchList: false +}; + +for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) { + var NAME = collections[i]; + var explicit = DOMIterables[NAME]; + var Collection = global[NAME]; + var proto = Collection && Collection.prototype; + var key; + if (proto) { + if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues); + if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); + Iterators[NAME] = ArrayValues; + if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true); + } +} + + +/***/ }), +/* 325 */ +/***/ (function(module, exports, __webpack_require__) { + +// ie9- setTimeout & setInterval additional parameters fix +var global = __webpack_require__(2); +var $export = __webpack_require__(0); +var userAgent = __webpack_require__(61); +var slice = [].slice; +var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check +var wrap = function (set) { + return function (fn, time /* , ...args */) { + var boundArgs = arguments.length > 2; + var args = boundArgs ? slice.call(arguments, 2) : false; + return set(boundArgs ? function () { + // eslint-disable-next-line no-new-func + (typeof fn == 'function' ? fn : Function(fn)).apply(this, args); + } : fn, time); + }; +}; +$export($export.G + $export.B + $export.F * MSIE, { + setTimeout: wrap(global.setTimeout), + setInterval: wrap(global.setInterval) +}); + + +/***/ }), +/* 326 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var ctx = __webpack_require__(19); +var $export = __webpack_require__(0); +var createDesc = __webpack_require__(31); +var assign = __webpack_require__(72); +var create = __webpack_require__(28); +var getPrototypeOf = __webpack_require__(17); +var getKeys = __webpack_require__(27); +var dP = __webpack_require__(6); +var keyOf = __webpack_require__(327); +var aFunction = __webpack_require__(10); +var forOf = __webpack_require__(35); +var isIterable = __webpack_require__(125); +var $iterCreate = __webpack_require__(56); +var step = __webpack_require__(88); +var isObject = __webpack_require__(3); +var toIObject = __webpack_require__(11); +var DESCRIPTORS = __webpack_require__(7); +var has = __webpack_require__(12); + +// 0 -> Dict.forEach +// 1 -> Dict.map +// 2 -> Dict.filter +// 3 -> Dict.some +// 4 -> Dict.every +// 5 -> Dict.find +// 6 -> Dict.findKey +// 7 -> Dict.mapPairs +var createDictMethod = function (TYPE) { + var IS_MAP = TYPE == 1; + var IS_EVERY = TYPE == 4; + return function (object, callbackfn, that /* = undefined */) { + var f = ctx(callbackfn, that, 3); + var O = toIObject(object); + var result = IS_MAP || TYPE == 7 || TYPE == 2 + ? new (typeof this == 'function' ? this : Dict)() : undefined; + var key, val, res; + for (key in O) if (has(O, key)) { + val = O[key]; + res = f(val, key, object); + if (TYPE) { + if (IS_MAP) result[key] = res; // map + else if (res) switch (TYPE) { + case 2: result[key] = val; break; // filter + case 3: return true; // some + case 5: return val; // find + case 6: return key; // findKey + case 7: result[res[0]] = res[1]; // mapPairs + } else if (IS_EVERY) return false; // every + } + } + return TYPE == 3 || IS_EVERY ? IS_EVERY : result; + }; +}; +var findKey = createDictMethod(6); + +var createDictIter = function (kind) { + return function (it) { + return new DictIterator(it, kind); + }; +}; +var DictIterator = function (iterated, kind) { + this._t = toIObject(iterated); // target + this._a = getKeys(iterated); // keys + this._i = 0; // next index + this._k = kind; // kind +}; +$iterCreate(DictIterator, 'Dict', function () { + var that = this; + var O = that._t; + var keys = that._a; + var kind = that._k; + var key; + do { + if (that._i >= keys.length) { + that._t = undefined; + return step(1); + } + } while (!has(O, key = keys[that._i++])); + if (kind == 'keys') return step(0, key); + if (kind == 'values') return step(0, O[key]); + return step(0, [key, O[key]]); +}); + +function Dict(iterable) { + var dict = create(null); + if (iterable != undefined) { + if (isIterable(iterable)) { + forOf(iterable, true, function (key, value) { + dict[key] = value; + }); + } else assign(dict, iterable); + } + return dict; +} +Dict.prototype = null; + +function reduce(object, mapfn, init) { + aFunction(mapfn); + var O = toIObject(object); + var keys = getKeys(O); + var length = keys.length; + var i = 0; + var memo, key; + if (arguments.length < 3) { + if (!length) throw TypeError('Reduce of empty object with no initial value'); + memo = O[keys[i++]]; + } else memo = Object(init); + while (length > i) if (has(O, key = keys[i++])) { + memo = mapfn(memo, O[key], key, object); + } + return memo; +} + +function includes(object, el) { + // eslint-disable-next-line no-self-compare + return (el == el ? keyOf(object, el) : findKey(object, function (it) { + // eslint-disable-next-line no-self-compare + return it != it; + })) !== undefined; +} + +function get(object, key) { + if (has(object, key)) return object[key]; +} +function set(object, key, value) { + if (DESCRIPTORS && key in Object) dP.f(object, key, createDesc(0, value)); + else object[key] = value; + return object; +} + +function isDict(it) { + return isObject(it) && getPrototypeOf(it) === Dict.prototype; +} + +$export($export.G + $export.F, { Dict: Dict }); + +$export($export.S, 'Dict', { + keys: createDictIter('keys'), + values: createDictIter('values'), + entries: createDictIter('entries'), + forEach: createDictMethod(0), + map: createDictMethod(1), + filter: createDictMethod(2), + some: createDictMethod(3), + every: createDictMethod(4), + find: createDictMethod(5), + findKey: findKey, + mapPairs: createDictMethod(7), + reduce: reduce, + keyOf: keyOf, + includes: includes, + has: has, + get: get, + set: set, + isDict: isDict +}); + + +/***/ }), +/* 327 */ +/***/ (function(module, exports, __webpack_require__) { + +var getKeys = __webpack_require__(27); +var toIObject = __webpack_require__(11); +module.exports = function (object, el) { + var O = toIObject(object); + var keys = getKeys(O); + var length = keys.length; + var index = 0; + var key; + while (length > index) if (O[key = keys[index++]] === el) return key; +}; + + +/***/ }), +/* 328 */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(1); +var get = __webpack_require__(49); +module.exports = __webpack_require__(13).getIterator = function (it) { + var iterFn = get(it); + if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!'); + return anObject(iterFn.call(it)); +}; + + +/***/ }), +/* 329 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var core = __webpack_require__(13); +var $export = __webpack_require__(0); +var partial = __webpack_require__(126); +// https://esdiscuss.org/topic/promise-returning-delay-function +$export($export.G + $export.F, { + delay: function delay(time) { + return new (core.Promise || global.Promise)(function (resolve) { + setTimeout(partial.call(resolve, true), time); + }); + } +}); + + +/***/ }), +/* 330 */ +/***/ (function(module, exports, __webpack_require__) { + +var path = __webpack_require__(127); +var $export = __webpack_require__(0); + +// Placeholder +__webpack_require__(13)._ = path._ = path._ || {}; + +$export($export.P + $export.F, 'Function', { part: __webpack_require__(126) }); + + +/***/ }), +/* 331 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); + +$export($export.S + $export.F, 'Object', { isObject: __webpack_require__(3) }); + + +/***/ }), +/* 332 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); + +$export($export.S + $export.F, 'Object', { classof: __webpack_require__(39) }); + + +/***/ }), +/* 333 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var define = __webpack_require__(128); + +$export($export.S + $export.F, 'Object', { define: define }); + + +/***/ }), +/* 334 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var define = __webpack_require__(128); +var create = __webpack_require__(28); + +$export($export.S + $export.F, 'Object', { + make: function (proto, mixin) { + return define(create(proto), mixin); + } +}); + + +/***/ }), +/* 335 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +__webpack_require__(55)(Number, 'Number', function (iterated) { + this._l = +iterated; + this._i = 0; +}, function () { + var i = this._i++; + var done = !(i < this._l); + return { done: done, value: done ? undefined : i }; +}); + + +/***/ }), +/* 336 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/benjamingr/RexExp.escape +var $export = __webpack_require__(0); +var $re = __webpack_require__(94)(/[\\^$*+?.()|[\]{}]/g, '\\$&'); + +$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } }); + + +/***/ }), +/* 337 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $re = __webpack_require__(94)(/[&<>"']/g, { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' +}); + +$export($export.P + $export.F, 'String', { escapeHTML: function escapeHTML() { return $re(this); } }); + + +/***/ }), +/* 338 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $re = __webpack_require__(94)(/&(?:amp|lt|gt|quot|apos);/g, { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" +}); + +$export($export.P + $export.F, 'String', { unescapeHTML: function unescapeHTML() { return $re(this); } }); + + +/***/ }) +/******/ ]); +// CommonJS export +if (typeof module != 'undefined' && module.exports) module.exports = __e; +// RequireJS export +else if (typeof define == 'function' && define.amd) define(function () { return __e; }); +// Export to global object +else __g.core = __e; +}(1, 1); \ No newline at end of file diff --git a/node_modules/core-js/client/core.min.js b/node_modules/core-js/client/core.min.js new file mode 100644 index 000000000..eb4d971f1 --- /dev/null +++ b/node_modules/core-js/client/core.min.js @@ -0,0 +1,10 @@ +/** + * core-js 2.5.7 + * https://github.com/zloirock/core-js + * License: http://rock.mit-license.org + * © 2018 Denis Pushkarev + */ +!function(e,i,Jt){"use strict";!function(r){var e={};function __webpack_require__(t){if(e[t])return e[t].exports;var n=e[t]={i:t,l:!1,exports:{}};return r[t].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}__webpack_require__.m=r,__webpack_require__.c=e,__webpack_require__.d=function(t,n,r){__webpack_require__.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},__webpack_require__.n=function(t){var n=t&&t.__esModule?function getDefault(){return t["default"]}:function getModuleExports(){return t};return __webpack_require__.d(n,"a",n),n},__webpack_require__.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=129)}([function(t,n,r){var v=r(2),g=r(13),y=r(14),d=r(15),_=r(19),b="prototype",S=function(t,n,r){var e,i,o,u,c=t&S.F,f=t&S.G,a=t&S.P,s=t&S.B,l=f?v:t&S.S?v[n]||(v[n]={}):(v[n]||{})[b],h=f?g:g[n]||(g[n]={}),p=h[b]||(h[b]={});for(e in f&&(r=n),r)o=((i=!c&&l&&l[e]!==Jt)?l:r)[e],u=s&&i?_(o,v):a&&"function"==typeof o?_(Function.call,o):o,l&&d(l,e,o,t&S.U),h[e]!=o&&y(h,e,u),a&&p[e]!=o&&(p[e]=o)};v.core=g,S.F=1,S.G=2,S.S=4,S.P=8,S.B=16,S.W=32,S.U=64,S.R=128,t.exports=S},function(t,n,r){var e=r(3);t.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof i&&(i=r)},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},function(t,n,r){var e=r(50)("wks"),i=r(36),o=r(2).Symbol,u="function"==typeof o;(t.exports=function(t){return e[t]||(e[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=e},function(t,n,r){var i=r(1),o=r(95),u=r(22),c=Object.defineProperty;n.f=r(7)?Object.defineProperty:function defineProperty(t,n,r){if(i(t),n=u(n,!0),i(r),o)try{return c(t,n,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[n]=r.value),t}},function(t,n,r){t.exports=!r(4)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n,r){var e=r(24),i=Math.min;t.exports=function(t){return 0"+i+""};t.exports=function(n,t){var r={};r[n]=t(o),e(e.P+e.F*i(function(){var t=""[n]('"');return t!==t.toLowerCase()||3document.F=Object<\/script>"),t.close(),s=t.F;r--;)delete s[a][u[r]];return s()};t.exports=Object.create||function create(t,n){var r;return null!==t?(f[a]=i(t),r=new f,f[a]=null,r[c]=t):r=s(),n===Jt?r:o(r,n)}},function(t,n,r){if(r(7)){var y=r(33),d=r(2),_=r(4),b=r(0),S=r(63),e=r(93),h=r(19),m=r(42),i=r(31),x=r(14),o=r(43),u=r(24),w=r(8),E=r(118),c=r(37),f=r(22),a=r(12),O=r(39),P=r(3),p=r(9),v=r(83),M=r(28),F=r(17),I=r(38).f,g=r(49),s=r(36),l=r(5),A=r(26),k=r(51),j=r(60),N=r(87),T=r(40),R=r(57),D=r(41),L=r(86),C=r(109),U=r(6),W=r(16),G=U.f,V=W.f,B=d.RangeError,q=d.TypeError,z=d.Uint8Array,K="ArrayBuffer",J="Shared"+K,H="BYTES_PER_ELEMENT",Y="prototype",X=Array[Y],$=e.ArrayBuffer,Z=e.DataView,Q=A(0),tt=A(2),nt=A(3),rt=A(4),et=A(5),it=A(6),ot=k(!0),ut=k(!1),ct=N.values,ft=N.keys,at=N.entries,st=X.lastIndexOf,lt=X.reduce,ht=X.reduceRight,pt=X.join,vt=X.sort,gt=X.slice,yt=X.toString,dt=X.toLocaleString,_t=l("iterator"),bt=l("toStringTag"),St=s("typed_constructor"),mt=s("def_constructor"),xt=S.CONSTR,wt=S.TYPED,Et=S.VIEW,Ot="Wrong length!",Pt=A(1,function(t,n){return kt(j(t,t[mt]),n)}),Mt=_(function(){return 1===new z(new Uint16Array([1]).buffer)[0]}),Ft=!!z&&!!z[Y].set&&_(function(){new z(1).set({})}),It=function(t,n){var r=u(t);if(r<0||r%n)throw B("Wrong offset!");return r},At=function(t){if(P(t)&&wt in t)return t;throw q(t+" is not a typed array!")},kt=function(t,n){if(!(P(t)&&St in t))throw q("It is not a typed array constructor!");return new t(n)},jt=function(t,n){return Nt(j(t,t[mt]),n)},Nt=function(t,n){for(var r=0,e=n.length,i=kt(t,e);r>>=1)&&(n+=n))1&e&&(r+=n);return r}},function(t,n){t.exports=Math.sign||function sign(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,n){var r=Math.expm1;t.exports=!r||22025.465794806718>1,s=23===n?I(2,-24)-I(2,-77):0,l=0,h=t<0||0===t&&1/t<0?1:0;for((t=F(t))!=t||t===P?(i=t!=t?1:0,e=f):(e=A(k(t)/j),t*(o=I(2,-e))<1&&(e--,o*=2),2<=(t+=1<=e+a?s/o:s*I(2,1-a))*o&&(e++,o/=2),f<=e+a?(i=0,e=f):1<=e+a?(i=(t*o-1)*I(2,n),e+=a):(i=t*I(2,a-1)*I(2,n),e=0));8<=n;u[l++]=255&i,i/=256,n-=8);for(e=e<>1,c=i-7,f=r-1,a=t[f--],s=127&a;for(a>>=7;0>=-c,c+=n;0>8&255]}function packI32(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function packF64(t){return packIEEE754(t,52,8)}function packF32(t){return packIEEE754(t,23,4)}function addGetter(t,n,r){g(t[S],n,{get:function(){return this[r]}})}function get(t,n,r,e){var i=p(+r);if(t[D]>24)},setUint8:function setUint8(t,n){B.call(this,t,n<<24>>24)}},!0)}else x=function ArrayBuffer(t){s(this,x,_);var n=p(t);this._b=y.call(new Array(n),0),this[D]=n},w=function DataView(t,n,r){s(this,w,b),s(t,x,b);var e=t[D],i=l(n);if(i<0||e>24},getUint8:function getUint8(t){return get(this,1,t)[0]},getInt16:function getInt16(t){var n=get(this,2,t,arguments[1]);return(n[1]<<8|n[0])<<16>>16},getUint16:function getUint16(t){var n=get(this,2,t,arguments[1]);return n[1]<<8|n[0]},getInt32:function getInt32(t){return unpackI32(get(this,4,t,arguments[1]))},getUint32:function getUint32(t){return unpackI32(get(this,4,t,arguments[1]))>>>0},getFloat32:function getFloat32(t){return unpackIEEE754(get(this,4,t,arguments[1]),23,4)},getFloat64:function getFloat64(t){return unpackIEEE754(get(this,8,t,arguments[1]),52,8)},setInt8:function setInt8(t,n){set(this,1,t,packI8,n)},setUint8:function setUint8(t,n){set(this,1,t,packI8,n)},setInt16:function setInt16(t,n){set(this,2,t,packI16,n,arguments[2])},setUint16:function setUint16(t,n){set(this,2,t,packI16,n,arguments[2])},setInt32:function setInt32(t,n){set(this,4,t,packI32,n,arguments[2])},setUint32:function setUint32(t,n){set(this,4,t,packI32,n,arguments[2])},setFloat32:function setFloat32(t,n){set(this,4,t,packF32,n,arguments[2])},setFloat64:function setFloat64(t,n){set(this,8,t,packF64,n,arguments[2])}});d(x,_),d(w,b),c(w[S],u.VIEW,!0),n[_]=x,n[b]=w},function(t,n){t.exports=function(n,r){var e=r===Object(r)?function(t){return r[t]}:r;return function(t){return String(t).replace(n,e)}}},function(t,n,r){t.exports=!r(7)&&!r(4)(function(){return 7!=Object.defineProperty(r(67)("div"),"a",{get:function(){return 7}}).a})},function(t,n,r){n.f=r(5)},function(t,n,r){var u=r(12),c=r(11),f=r(51)(!1),a=r(69)("IE_PROTO");t.exports=function(t,n){var r,e=c(t),i=0,o=[];for(r in e)r!=a&&u(e,r)&&o.push(r);for(;i>>0||(u.test(r)?16:10))}:e},function(t,n){t.exports=Math.log1p||function log1p(t){return-1e-8<(t=+t)&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,n,r){var o=r(78),e=Math.pow,u=e(2,-52),c=e(2,-23),f=e(2,127)*(2-c),a=e(2,-126);t.exports=Math.fround||function fround(t){var n,r,e=Math.abs(t),i=o(t);return e>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,n,r){var e=r(0),i=Math.exp;e(e.S,"Math",{cosh:function cosh(t){return(i(t=+t)+i(-t))/2}})},function(t,n,r){var e=r(0),i=r(79);e(e.S+e.F*(i!=Math.expm1),"Math",{expm1:i})},function(t,n,r){var e=r(0);e(e.S,"Math",{fround:r(106)})},function(t,n,r){var e=r(0),f=Math.abs;e(e.S,"Math",{hypot:function hypot(t,n){for(var r,e,i=0,o=0,u=arguments.length,c=0;o>>16)*u+o*(r&i>>>16)<<16>>>0)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{log10:function log10(t){return Math.log(t)*Math.LOG10E}})},function(t,n,r){var e=r(0);e(e.S,"Math",{log1p:r(105)})},function(t,n,r){var e=r(0);e(e.S,"Math",{log2:function log2(t){return Math.log(t)/Math.LN2}})},function(t,n,r){var e=r(0);e(e.S,"Math",{sign:r(78)})},function(t,n,r){var e=r(0),i=r(79),o=Math.exp;e(e.S+e.F*r(4)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function sinh(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},function(t,n,r){var e=r(0),i=r(79),o=Math.exp;e(e.S,"Math",{tanh:function tanh(t){var n=i(t=+t),r=i(-t);return n==Infinity?1:r==Infinity?-1:(n-r)/(o(t)+o(-t))}})},function(t,n,r){var e=r(0);e(e.S,"Math",{trunc:function trunc(t){return(0>10),n%1024+56320))}return r.join("")}})},function(t,n,r){var e=r(0),u=r(11),c=r(8);e(e.S,"String",{raw:function raw(t){for(var n=u(t.raw),r=c(n.length),e=arguments.length,i=[],o=0;o>>0,h=new RegExp(t.source,a+"g");for(_||(e=new RegExp("^"+h.source+"$(?!\\s)",a));(i=h.exec(r))&&!(s<(o=i.index+i[0][y])&&(f.push(r.slice(s,i.index)),!_&&1>>0,o=r>>>0;return(n>>>0)+(e>>>0)+((i&o|(i|o)&~(i+o>>>0))>>>31)|0}})},function(t,n,r){var e=r(0);e(e.S,"Math",{isubh:function isubh(t,n,r,e){var i=t>>>0,o=r>>>0;return(n>>>0)-(e>>>0)-((~i&o|~(i^o)&i-o>>>0)>>>31)|0}})},function(t,n,r){var e=r(0);e(e.S,"Math",{imulh:function imulh(t,n){var r=+t,e=+n,i=65535&r,o=65535&e,u=r>>16,c=e>>16,f=(u*o>>>0)+(i*o>>>16);return u*c+(f>>16)+((i*c>>>0)+(65535&f)>>16)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{RAD_PER_DEG:180/Math.PI})},function(t,n,r){var e=r(0),i=Math.PI/180;e(e.S,"Math",{radians:function radians(t){return t*i}})},function(t,n,r){var e=r(0);e(e.S,"Math",{scale:r(124)})},function(t,n,r){var e=r(0);e(e.S,"Math",{umulh:function umulh(t,n){var r=+t,e=+n,i=65535&r,o=65535&e,u=r>>>16,c=e>>>16,f=(u*o>>>0)+(i*o>>>16);return u*c+(f>>>16)+((i*c>>>0)+(65535&f)>>>16)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{signbit:function signbit(t){return(t=+t)!=t?t:0==t?1/t==Infinity:0"']/g,{"&":"&","<":"<",">":">",'"':""","'":"'"});e(e.P+e.F,"String",{escapeHTML:function escapeHTML(){return i(this)}})},function(t,n,r){var e=r(0),i=r(94)(/&(?:amp|lt|gt|quot|apos);/g,{"&":"&","<":"<",">":">",""":'"',"'":"'"});e(e.P+e.F,"String",{unescapeHTML:function unescapeHTML(){return i(this)}})}]),"undefined"!=typeof module&&module.exports?module.exports=e:"function"==typeof define&&define.amd?define(function(){return e}):i.core=e}(1,1); +//# sourceMappingURL=core.min.js.map \ No newline at end of file diff --git a/node_modules/core-js/client/core.min.js.map b/node_modules/core-js/client/core.min.js.map new file mode 100644 index 000000000..3d7880299 --- /dev/null +++ b/node_modules/core-js/client/core.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["core.js"],"names":["__e","__g","undefined","modules","installedModules","__webpack_require__","moduleId","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","getDefault","getModuleExports","object","property","prototype","hasOwnProperty","p","s","global","core","hide","redefine","ctx","PROTOTYPE","$export","type","source","key","own","out","exp","IS_FORCED","F","IS_GLOBAL","G","IS_PROTO","P","IS_BIND","B","target","S","expProto","Function","U","W","R","isObject","it","TypeError","window","Math","self","exec","e","store","uid","Symbol","USE_SYMBOL","anObject","IE8_DOM_DEFINE","toPrimitive","dP","f","O","Attributes","value","a","toInteger","min","defined","IObject","version","createDesc","has","SRC","TO_STRING","$toString","TPL","split","inspectSource","val","safe","isFunction","join","String","toString","this","pIE","toIObject","gOPD","getOwnPropertyDescriptor","toObject","IE_PROTO","ObjectProto","getPrototypeOf","constructor","fails","quot","createHTML","string","tag","attribute","p1","replace","NAME","test","toLowerCase","length","aFunction","fn","that","b","apply","arguments","slice","method","arg","valueOf","ceil","floor","isNaN","KEY","toLength","asc","TYPE","$create","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","create","$this","callbackfn","res","index","result","push","$keys","enumBugKeys","keys","dPs","Empty","createDict","iframeDocument","iframe","style","display","appendChild","src","contentWindow","document","open","write","lt","close","Properties","LIBRARY","$typed","$buffer","anInstance","propertyDesc","redefineAll","toIndex","toAbsoluteIndex","classof","isArrayIter","gOPN","getIterFn","wks","createArrayMethod","createArrayIncludes","speciesConstructor","ArrayIterators","Iterators","$iterDetect","setSpecies","arrayFill","arrayCopyWithin","$DP","$GOPD","RangeError","Uint8Array","ARRAY_BUFFER","SHARED_BUFFER","BYTES_PER_ELEMENT","ArrayProto","Array","$ArrayBuffer","ArrayBuffer","$DataView","DataView","arrayForEach","arrayFilter","arraySome","arrayEvery","arrayFind","arrayFindIndex","arrayIncludes","arrayIndexOf","arrayValues","values","arrayKeys","arrayEntries","entries","arrayLastIndexOf","lastIndexOf","arrayReduce","reduce","arrayReduceRight","reduceRight","arrayJoin","arraySort","sort","arraySlice","arrayToString","arrayToLocaleString","toLocaleString","ITERATOR","TAG","TYPED_CONSTRUCTOR","DEF_CONSTRUCTOR","ALL_CONSTRUCTORS","CONSTR","TYPED_ARRAY","TYPED","VIEW","WRONG_LENGTH","$map","allocate","LITTLE_ENDIAN","Uint16Array","buffer","FORCED_SET","set","toOffset","BYTES","offset","validate","C","speciesFromList","list","fromList","addGetter","internal","_d","$from","from","step","iterator","aLen","mapfn","mapping","iterFn","next","done","$of","of","TO_LOCALE_BUG","$toLocaleString","proto","copyWithin","start","every","fill","filter","find","predicate","findIndex","forEach","indexOf","searchElement","includes","separator","map","reverse","middle","some","comparefn","subarray","begin","end","$begin","byteOffset","$slice","$set","arrayLike","len","$iterators","isTAIndex","$getDesc","$setDesc","desc","writable","$TypedArrayPrototype$","wrapper","CLAMPED","GETTER","SETTER","TypedArray","Base","TAC","TypedArrayPrototype","addElement","data","v","round","ABV","$offset","$length","byteLength","klass","$len","iter","concat","$nativeIterator","CORRECT_ITER_NAME","$iterator","Map","shared","getOrCreateMetadataMap","targetKey","targetMetadata","keyMetadata","MetadataKey","metadataMap","MetadataValue","_","bitmap","META","setDesc","id","isExtensible","FREEZE","preventExtensions","setMeta","w","meta","NEED","fastKey","getWeak","onFreeze","UNSCOPABLES","BREAK","RETURN","iterable","px","random","max","hiddenKeys","getOwnPropertyNames","cof","ARG","T","tryGet","callee","DESCRIPTORS","SPECIES","Constructor","forbiddenField","def","stat","spaces","space","ltrim","RegExp","rtrim","exporter","ALIAS","FORCE","trim","_t","propertyIsEnumerable","getIteratorMethod","SHARED","mode","copyright","IS_INCLUDES","el","fromIndex","getOwnPropertySymbols","isArray","MATCH","isRegExp","$iterCreate","setToStringTag","BUGGY","VALUES","returnThis","DEFAULT","IS_SET","FORCED","methods","IteratorPrototype","getMethod","kind","DEF_VALUES","VALUES_BUG","$native","$default","$entries","$anyNative","descriptor","SAFE_CLOSING","riter","skipClosing","arr","ignoreCase","multiline","unicode","sticky","SYMBOL","fns","strfn","rxfn","D","navigator","userAgent","forOf","inheritIfRequired","common","IS_WEAK","ADDER","fixMethod","add","instance","HASNT_CHAINING","THROWS_ON_PRIMITIVES","ACCEPT_ITERABLES","BUGGY_ZERO","$instance","clear","getConstructor","setStrong","Typed","TypedArrayConstructors","K","__defineSetter__","COLLECTION","A","cb","mapFn","nextItem","is","createElement","wksExt","$Symbol","charAt","documentElement","getKeys","gOPS","$assign","assign","k","getSymbols","isEnum","j","check","setPrototypeOf","buggy","__proto__","args","un","repeat","count","str","Infinity","sign","x","$expm1","expm1","pos","charCodeAt","searchString","re","$defineProperty","original","endPos","addToUnscopables","iterated","_i","_k","Arguments","defer","channel","port","invoke","html","cel","process","setTask","setImmediate","clearTask","clearImmediate","MessageChannel","Dispatch","counter","queue","ONREADYSTATECHANGE","run","listener","event","nextTick","now","port2","port1","onmessage","postMessage","addEventListener","importScripts","removeChild","setTimeout","macrotask","Observer","MutationObserver","WebKitMutationObserver","Promise","isNode","head","last","notify","flush","parent","domain","exit","enter","standalone","resolve","promise","then","toggle","node","createTextNode","observe","characterData","task","PromiseCapability","reject","$$resolve","$$reject","Reflect","ownKeys","DATA_VIEW","WRONG_INDEX","BaseBuffer","abs","pow","log","LN2","BYTE_LENGTH","BYTE_OFFSET","$BUFFER","$LENGTH","$OFFSET","packIEEE754","mLen","nBytes","eLen","eMax","eBias","rt","unpackIEEE754","nBits","NaN","unpackI32","bytes","packI8","packI16","packI32","packF64","packF32","view","isLittleEndian","intIndex","pack","_b","conversion","ArrayBufferProto","$setInt8","setInt8","getInt8","setUint8","bufferLength","getUint8","getInt16","getUint16","getInt32","getUint32","getFloat32","getFloat64","setInt16","setUint16","setInt32","setUint32","setFloat32","setFloat64","regExp","replacer","part","names","defineProperties","windowNames","getWindowNames","factories","bind","partArgs","bound","construct","msg","isInteger","isFinite","$parseFloat","parseFloat","$trim","$parseInt","parseInt","ws","hex","radix","log1p","EPSILON","EPSILON32","MAX32","MIN32","fround","$abs","$sign","ret","memo","isRight","to","inc","flags","newPromiseCapability","promiseCapability","strong","entry","getEntry","$iterDefine","SIZE","_f","_l","r","delete","prev","Set","InternalMap","each","weak","WEAK_MAP","uncaughtFrozenStore","ufstore","tmp","WeakMap","$WeakMap","freeze","$has","UncaughtFrozenStore","findUncaughtFrozen","splice","number","IS_CONCAT_SPREADABLE","flattenIntoArray","sourceLen","depth","mapper","thisArg","element","spreadable","targetIndex","sourceIndex","maxLength","fillString","left","stringLength","fillStr","intMaxLength","fillLen","stringFiller","isEntries","toJSON","scale","inLow","inHigh","outLow","outHigh","isIterable","path","pargs","holder","define","mixin","$fails","wksDefine","enumKeys","_create","gOPNExt","$JSON","JSON","_stringify","stringify","HIDDEN","TO_PRIMITIVE","SymbolRegistry","AllSymbols","OPSymbols","USE_NATIVE","QObject","setter","findChild","setSymbolDesc","protoDesc","wrap","sym","isSymbol","$defineProperties","$propertyIsEnumerable","E","$getOwnPropertyDescriptor","$getOwnPropertyNames","$getOwnPropertySymbols","IS_OP","es6Symbols","wellKnownSymbols","for","keyFor","useSetter","useSimple","$replacer","symbols","$getPrototypeOf","$freeze","$seal","seal","$preventExtensions","$isFrozen","isFrozen","$isSealed","isSealed","$isExtensible","y","FProto","nameRE","match","HAS_INSTANCE","FunctionProto","NUMBER","$Number","BROKEN_COF","TRIM","toNumber","argument","third","maxCode","first","code","digits","Number","aNumberValue","$toFixed","toFixed","ERROR","multiply","c2","divide","numToString","t","acc","fractionDigits","z","x2","$toPrecision","toPrecision","precision","_isFinite","isSafeInteger","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","sqrt","$acosh","acosh","MAX_VALUE","$asinh","asinh","$atanh","atanh","cbrt","clz32","LOG2E","cosh","hypot","value1","value2","div","sum","larg","$imul","imul","UINT16","xn","yn","xl","yl","log10","LOG10E","log2","sinh","tanh","trunc","fromCharCode","$fromCodePoint","fromCodePoint","raw","callSite","tpl","$at","codePointAt","context","ENDS_WITH","$endsWith","endsWith","endPosition","search","INCLUDES","STARTS_WITH","$startsWith","startsWith","point","anchor","big","blink","bold","fixed","fontcolor","color","fontsize","size","italics","link","url","small","strike","sub","sup","createProperty","upTo","cloned","$sort","$forEach","STRICT","$filter","$some","$every","$reduce","$indexOf","NEGATIVE_ZERO","$find","forced","$flags","$RegExp","re1","re2","CORRECT_NEW","tiRE","piRE","fiU","proxy","$match","regexp","REPLACE","$replace","searchValue","replaceValue","SEARCH","$search","SPLIT","$split","_split","$push","$SPLIT","LENGTH","LAST_INDEX","NPCG","limit","separator2","lastIndex","lastLength","output","lastLastIndex","splitLimit","separatorCopy","Internal","newGenericPromiseCapability","OwnPromiseCapability","Wrapper","microtask","newPromiseCapabilityModule","perform","promiseResolve","PROMISE","versions","v8","$Promise","empty","FakePromise","PromiseRejectionEvent","isThenable","isReject","_n","chain","_c","_v","ok","_s","reaction","exited","handler","fail","_h","onHandleUnhandled","onUnhandled","console","unhandled","isUnhandled","emit","onunhandledrejection","reason","error","_a","onrejectionhandled","$reject","_w","$resolve","executor","err","onFulfilled","onRejected","catch","capability","all","remaining","$index","alreadyCalled","race","WEAK_SET","WeakSet","rApply","fApply","thisArgument","argumentsList","L","rConstruct","NEW_TARGET_BUG","ARGS_BUG","Target","newTarget","$args","propertyKey","attributes","deleteProperty","Enumerate","enumerate","receiver","getProto","V","existingDescriptor","ownDesc","setProto","Date","getTime","toISOString","pv","$toISOString","lz","num","getUTCFullYear","getUTCMilliseconds","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","DateProto","INVALID_DATE","hint","$isView","isView","fin","viewS","viewT","init","Int8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint32Array","Float32Array","Float64Array","$includes","arraySpeciesCreate","flatMap","flatten","depthArg","at","$pad","padStart","padEnd","trimLeft","trimRight","getFlags","RegExpProto","$RegExpStringIterator","_r","matchAll","rx","getOwnPropertyDescriptors","getDesc","$values","__defineGetter__","__lookupGetter__","__lookupSetter__","isError","clamp","lower","upper","DEG_PER_RAD","PI","RAD_PER_DEG","degrees","radians","fscale","iaddh","x0","x1","y0","y1","$x0","$y0","isubh","imulh","u","$u","$v","u0","v0","u1","v1","umulh","signbit","finally","onFinally","try","metadata","toMetaKey","ordinaryDefineOwnMetadata","defineMetadata","metadataKey","metadataValue","deleteMetadata","ordinaryHasOwnMetadata","ordinaryGetOwnMetadata","ordinaryGetMetadata","getMetadata","ordinaryOwnMetadataKeys","ordinaryMetadataKeys","oKeys","pKeys","getMetadataKeys","getOwnMetadata","getOwnMetadataKeys","ordinaryHasMetadata","hasMetadata","hasOwnMetadata","$metadata","decorator","asap","OBSERVABLE","cleanupSubscription","subscription","cleanup","subscriptionClosed","_o","closeSubscription","Subscription","observer","subscriber","SubscriptionObserver","unsubscribe","complete","$Observable","Observable","subscribe","observable","items","$task","TO_STRING_TAG","ArrayValues","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","collections","explicit","Collection","MSIE","time","boundArgs","setInterval","keyOf","createDictMethod","Dict","findKey","createDictIter","DictIterator","dict","mapPairs","isDict","getIterator","partial","delay","make","$re","escape","&","<",">","\"","'","escapeHTML","&","<",">",""","'","unescapeHTML","amd"],"mappings":";;;;;;CAMC,SAASA,EAAKC,EAAKC,IACpB,cACS,SAAUC,GAET,IAAIC,EAAmB,GAGvB,SAASC,oBAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAJ,EAAQG,GAAUK,KAAKH,EAAOD,QAASC,EAAQA,EAAOD,QAASF,qBAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,oBAAoBO,EAAIT,EAGxBE,oBAAoBQ,EAAIT,EAGxBC,oBAAoBS,EAAI,SAASP,EAASQ,EAAMC,GAC3CX,oBAAoBY,EAAEV,EAASQ,IAClCG,OAAOC,eAAeZ,EAASQ,EAAM,CACpCK,cAAc,EACdC,YAAY,EACZC,IAAKN,KAMRX,oBAAoBkB,EAAI,SAASf,GAChC,IAAIQ,EAASR,GAAUA,EAAOgB,WAC7B,SAASC,aAAe,OAAOjB,EAAgB,YAC/C,SAASkB,mBAAqB,OAAOlB,GAEtC,OADAH,oBAAoBS,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRX,oBAAoBY,EAAI,SAASU,EAAQC,GAAY,OAAOV,OAAOW,UAAUC,eAAenB,KAAKgB,EAAQC,IAGzGvB,oBAAoB0B,EAAI,GAGjB1B,oBAAoBA,oBAAoB2B,EAAI,KA9DpD,CAiEC,CAEJ,SAAUxB,EAAQD,EAASF,GAEjC,IAAI4B,EAAS5B,EAAoB,GAC7B6B,EAAO7B,EAAoB,IAC3B8B,EAAO9B,EAAoB,IAC3B+B,EAAW/B,EAAoB,IAC/BgC,EAAMhC,EAAoB,IAC1BiC,EAAY,YAEZC,EAAU,SAAUC,EAAMzB,EAAM0B,GAClC,IAQIC,EAAKC,EAAKC,EAAKC,EARfC,EAAYN,EAAOD,EAAQQ,EAC3BC,EAAYR,EAAOD,EAAQU,EAE3BC,EAAWV,EAAOD,EAAQY,EAC1BC,EAAUZ,EAAOD,EAAQc,EACzBC,EAASN,EAAYf,EAHTO,EAAOD,EAAQgB,EAGetB,EAAOlB,KAAUkB,EAAOlB,GAAQ,KAAOkB,EAAOlB,IAAS,IAAIuB,GACrG/B,EAAUyC,EAAYd,EAAOA,EAAKnB,KAAUmB,EAAKnB,GAAQ,IACzDyC,EAAWjD,EAAQ+B,KAAe/B,EAAQ+B,GAAa,IAG3D,IAAKI,KADDM,IAAWP,EAAS1B,GACZ0B,EAIVG,IAFAD,GAAOG,GAAaQ,GAAUA,EAAOZ,KAASxC,IAEjCoD,EAASb,GAAQC,GAE9BG,EAAMO,GAAWT,EAAMN,EAAIO,EAAKX,GAAUiB,GAA0B,mBAAPN,EAAoBP,EAAIoB,SAAS9C,KAAMiC,GAAOA,EAEvGU,GAAQlB,EAASkB,EAAQZ,EAAKE,EAAKJ,EAAOD,EAAQmB,GAElDnD,EAAQmC,IAAQE,GAAKT,EAAK5B,EAASmC,EAAKG,GACxCK,GAAYM,EAASd,IAAQE,IAAKY,EAASd,GAAOE,IAG1DX,EAAOC,KAAOA,EAEdK,EAAQQ,EAAI,EACZR,EAAQU,EAAI,EACZV,EAAQgB,EAAI,EACZhB,EAAQY,EAAI,EACZZ,EAAQc,EAAI,GACZd,EAAQoB,EAAI,GACZpB,EAAQmB,EAAI,GACZnB,EAAQqB,EAAI,IACZpD,EAAOD,QAAUgC,GAKX,SAAU/B,EAAQD,EAASF,GAEjC,IAAIwD,EAAWxD,EAAoB,GACnCG,EAAOD,QAAU,SAAUuD,GACzB,IAAKD,EAASC,GAAK,MAAMC,UAAUD,EAAK,sBACxC,OAAOA,IAMH,SAAUtD,EAAQD,GAGxB,IAAI0B,EAASzB,EAAOD,QAA2B,oBAAVyD,QAAyBA,OAAOC,MAAQA,KACzED,OAAwB,oBAARE,MAAuBA,KAAKD,MAAQA,KAAOC,KAE3DT,SAAS,cAATA,GACc,iBAAPxD,IAAiBA,EAAMgC,IAK5B,SAAUzB,EAAQD,GAExBC,EAAOD,QAAU,SAAUuD,GACzB,MAAqB,iBAAPA,EAAyB,OAAPA,EAA4B,mBAAPA,IAMjD,SAAUtD,EAAQD,GAExBC,EAAOD,QAAU,SAAU4D,GACzB,IACE,QAASA,IACT,MAAOC,GACP,OAAO,KAOL,SAAU5D,EAAQD,EAASF,GAEjC,IAAIgE,EAAQhE,EAAoB,GAApBA,CAAwB,OAChCiE,EAAMjE,EAAoB,IAC1BkE,EAASlE,EAAoB,GAAGkE,OAChCC,EAA8B,mBAAVD,GAET/D,EAAOD,QAAU,SAAUQ,GACxC,OAAOsD,EAAMtD,KAAUsD,EAAMtD,GAC3ByD,GAAcD,EAAOxD,KAAUyD,EAAaD,EAASD,GAAK,UAAYvD,MAGjEsD,MAAQA,GAKX,SAAU7D,EAAQD,EAASF,GAEjC,IAAIoE,EAAWpE,EAAoB,GAC/BqE,EAAiBrE,EAAoB,IACrCsE,EAActE,EAAoB,IAClCuE,EAAK1D,OAAOC,eAEhBZ,EAAQsE,EAAIxE,EAAoB,GAAKa,OAAOC,eAAiB,SAASA,eAAe2D,EAAG3B,EAAG4B,GAIzF,GAHAN,EAASK,GACT3B,EAAIwB,EAAYxB,GAAG,GACnBsB,EAASM,GACLL,EAAgB,IAClB,OAAOE,EAAGE,EAAG3B,EAAG4B,GAChB,MAAOX,IACT,GAAI,QAASW,GAAc,QAASA,EAAY,MAAMhB,UAAU,4BAEhE,MADI,UAAWgB,IAAYD,EAAE3B,GAAK4B,EAAWC,OACtCF,IAMH,SAAUtE,EAAQD,EAASF,GAGjCG,EAAOD,SAAWF,EAAoB,EAApBA,CAAuB,WACvC,OAA+E,GAAxEa,OAAOC,eAAe,GAAI,IAAK,CAAEG,IAAK,WAAc,OAAO,KAAQ2D,KAMtE,SAAUzE,EAAQD,EAASF,GAGjC,IAAI6E,EAAY7E,EAAoB,IAChC8E,EAAMlB,KAAKkB,IACf3E,EAAOD,QAAU,SAAUuD,GACzB,OAAY,EAALA,EAASqB,EAAID,EAAUpB,GAAK,kBAAoB,IAMnD,SAAUtD,EAAQD,EAASF,GAGjC,IAAI+E,EAAU/E,EAAoB,IAClCG,EAAOD,QAAU,SAAUuD,GACzB,OAAO5C,OAAOkE,EAAQtB,MAMlB,SAAUtD,EAAQD,GAExBC,EAAOD,QAAU,SAAUuD,GACzB,GAAiB,mBAANA,EAAkB,MAAMC,UAAUD,EAAK,uBAClD,OAAOA,IAMH,SAAUtD,EAAQD,EAASF,GAGjC,IAAIgF,EAAUhF,EAAoB,IAC9B+E,EAAU/E,EAAoB,IAClCG,EAAOD,QAAU,SAAUuD,GACzB,OAAOuB,EAAQD,EAAQtB,MAMnB,SAAUtD,EAAQD,GAExB,IAAIuB,EAAiB,GAAGA,eACxBtB,EAAOD,QAAU,SAAUuD,EAAIpB,GAC7B,OAAOZ,EAAenB,KAAKmD,EAAIpB,KAM3B,SAAUlC,EAAQD,GAExB,IAAI2B,EAAO1B,EAAOD,QAAU,CAAE+E,QAAS,SACrB,iBAAPtF,IAAiBA,EAAMkC,IAK5B,SAAU1B,EAAQD,EAASF,GAEjC,IAAIuE,EAAKvE,EAAoB,GACzBkF,EAAalF,EAAoB,IACrCG,EAAOD,QAAUF,EAAoB,GAAK,SAAUsB,EAAQe,EAAKsC,GAC/D,OAAOJ,EAAGC,EAAElD,EAAQe,EAAK6C,EAAW,EAAGP,KACrC,SAAUrD,EAAQe,EAAKsC,GAEzB,OADArD,EAAOe,GAAOsC,EACPrD,IAMH,SAAUnB,EAAQD,EAASF,GAEjC,IAAI4B,EAAS5B,EAAoB,GAC7B8B,EAAO9B,EAAoB,IAC3BmF,EAAMnF,EAAoB,IAC1BoF,EAAMpF,EAAoB,GAApBA,CAAwB,OAC9BqF,EAAY,WACZC,EAAYlC,SAASiC,GACrBE,GAAO,GAAKD,GAAWE,MAAMH,GAEjCrF,EAAoB,IAAIyF,cAAgB,SAAUhC,GAChD,OAAO6B,EAAUhF,KAAKmD,KAGvBtD,EAAOD,QAAU,SAAUuE,EAAGpC,EAAKqD,EAAKC,GACvC,IAAIC,EAA2B,mBAAPF,EACpBE,IAAYT,EAAIO,EAAK,SAAW5D,EAAK4D,EAAK,OAAQrD,IAClDoC,EAAEpC,KAASqD,IACXE,IAAYT,EAAIO,EAAKN,IAAQtD,EAAK4D,EAAKN,EAAKX,EAAEpC,GAAO,GAAKoC,EAAEpC,GAAOkD,EAAIM,KAAKC,OAAOzD,MACnFoC,IAAM7C,EACR6C,EAAEpC,GAAOqD,EACCC,EAGDlB,EAAEpC,GACXoC,EAAEpC,GAAOqD,EAET5D,EAAK2C,EAAGpC,EAAKqD,WALNjB,EAAEpC,GACTP,EAAK2C,EAAGpC,EAAKqD,OAOdtC,SAAS5B,UAAW6D,EAAW,SAASU,WACzC,MAAsB,mBAARC,MAAsBA,KAAKZ,IAAQE,EAAUhF,KAAK0F,SAM5D,SAAU7F,EAAQD,EAASF,GAEjC,IAAIiG,EAAMjG,EAAoB,IAC1BkF,EAAalF,EAAoB,IACjCkG,EAAYlG,EAAoB,IAChCsE,EAActE,EAAoB,IAClCmF,EAAMnF,EAAoB,IAC1BqE,EAAiBrE,EAAoB,IACrCmG,EAAOtF,OAAOuF,yBAElBlG,EAAQsE,EAAIxE,EAAoB,GAAKmG,EAAO,SAASC,yBAAyB3B,EAAG3B,GAG/E,GAFA2B,EAAIyB,EAAUzB,GACd3B,EAAIwB,EAAYxB,GAAG,GACfuB,EAAgB,IAClB,OAAO8B,EAAK1B,EAAG3B,GACf,MAAOiB,IACT,GAAIoB,EAAIV,EAAG3B,GAAI,OAAOoC,GAAYe,EAAIzB,EAAElE,KAAKmE,EAAG3B,GAAI2B,EAAE3B,MAMlD,SAAU3C,EAAQD,EAASF,GAGjC,IAAImF,EAAMnF,EAAoB,IAC1BqG,EAAWrG,EAAoB,GAC/BsG,EAAWtG,EAAoB,GAApBA,CAAwB,YACnCuG,EAAc1F,OAAOW,UAEzBrB,EAAOD,QAAUW,OAAO2F,gBAAkB,SAAU/B,GAElD,OADAA,EAAI4B,EAAS5B,GACTU,EAAIV,EAAG6B,GAAkB7B,EAAE6B,GACH,mBAAjB7B,EAAEgC,aAA6BhC,aAAaA,EAAEgC,YAChDhC,EAAEgC,YAAYjF,UACdiD,aAAa5D,OAAS0F,EAAc,OAMzC,SAAUpG,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B0G,EAAQ1G,EAAoB,GAC5B+E,EAAU/E,EAAoB,IAC9B2G,EAAO,KAEPC,EAAa,SAAUC,EAAQC,EAAKC,EAAWpC,GACjD,IAAIzB,EAAI4C,OAAOf,EAAQ8B,IACnBG,EAAK,IAAMF,EAEf,MADkB,KAAdC,IAAkBC,GAAM,IAAMD,EAAY,KAAOjB,OAAOnB,GAAOsC,QAAQN,EAAM,UAAY,KACtFK,EAAK,IAAM9D,EAAI,KAAO4D,EAAM,KAErC3G,EAAOD,QAAU,SAAUgH,EAAMpD,GAC/B,IAAIW,EAAI,GACRA,EAAEyC,GAAQpD,EAAK8C,GACf1E,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAIgE,EAAM,WACpC,IAAIS,EAAO,GAAGD,GAAM,KACpB,OAAOC,IAASA,EAAKC,eAA0C,EAAzBD,EAAK3B,MAAM,KAAK6B,SACpD,SAAU5C,KAMV,SAAUtE,EAAQD,EAASF,GAGjC,IAAIsH,EAAYtH,EAAoB,IACpCG,EAAOD,QAAU,SAAUqH,EAAIC,EAAMH,GAEnC,GADAC,EAAUC,GACNC,IAAS3H,GAAW,OAAO0H,EAC/B,OAAQF,GACN,KAAK,EAAG,OAAO,SAAUzC,GACvB,OAAO2C,EAAGjH,KAAKkH,EAAM5C,IAEvB,KAAK,EAAG,OAAO,SAAUA,EAAG6C,GAC1B,OAAOF,EAAGjH,KAAKkH,EAAM5C,EAAG6C,IAE1B,KAAK,EAAG,OAAO,SAAU7C,EAAG6C,EAAGjH,GAC7B,OAAO+G,EAAGjH,KAAKkH,EAAM5C,EAAG6C,EAAGjH,IAG/B,OAAO,WACL,OAAO+G,EAAGG,MAAMF,EAAMG,cAOpB,SAAUxH,EAAQD,GAExB,IAAI6F,EAAW,GAAGA,SAElB5F,EAAOD,QAAU,SAAUuD,GACzB,OAAOsC,EAASzF,KAAKmD,GAAImE,MAAM,GAAI,KAM/B,SAAUzH,EAAQD,EAASF,GAIjC,IAAI0G,EAAQ1G,EAAoB,GAEhCG,EAAOD,QAAU,SAAU2H,EAAQC,GACjC,QAASD,GAAUnB,EAAM,WAEvBoB,EAAMD,EAAOvH,KAAK,KAAM,aAA6B,GAAKuH,EAAOvH,KAAK,UAOpE,SAAUH,EAAQD,EAASF,GAGjC,IAAIwD,EAAWxD,EAAoB,GAGnCG,EAAOD,QAAU,SAAUuD,EAAIP,GAC7B,IAAKM,EAASC,GAAK,OAAOA,EAC1B,IAAI8D,EAAI7B,EACR,GAAIxC,GAAkC,mBAArBqE,EAAK9D,EAAGsC,YAA4BvC,EAASkC,EAAM6B,EAAGjH,KAAKmD,IAAM,OAAOiC,EACzF,GAAgC,mBAApB6B,EAAK9D,EAAGsE,WAA2BvE,EAASkC,EAAM6B,EAAGjH,KAAKmD,IAAM,OAAOiC,EACnF,IAAKxC,GAAkC,mBAArBqE,EAAK9D,EAAGsC,YAA4BvC,EAASkC,EAAM6B,EAAGjH,KAAKmD,IAAM,OAAOiC,EAC1F,MAAMhC,UAAU,6CAMZ,SAAUvD,EAAQD,GAGxBC,EAAOD,QAAU,SAAUuD,GACzB,GAAIA,GAAM5D,GAAW,MAAM6D,UAAU,yBAA2BD,GAChE,OAAOA,IAMH,SAAUtD,EAAQD,GAGxB,IAAI8H,EAAOpE,KAAKoE,KACZC,EAAQrE,KAAKqE,MACjB9H,EAAOD,QAAU,SAAUuD,GACzB,OAAOyE,MAAMzE,GAAMA,GAAM,GAAU,EAALA,EAASwE,EAAQD,GAAMvE,KAMjD,SAAUtD,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B6B,EAAO7B,EAAoB,IAC3B0G,EAAQ1G,EAAoB,GAChCG,EAAOD,QAAU,SAAUiI,EAAKrE,GAC9B,IAAIyD,GAAM1F,EAAKhB,QAAU,IAAIsH,IAAQtH,OAAOsH,GACxC3F,EAAM,GACVA,EAAI2F,GAAOrE,EAAKyD,GAChBrF,EAAQA,EAAQgB,EAAIhB,EAAQQ,EAAIgE,EAAM,WAAca,EAAG,KAAQ,SAAU/E,KAMrE,SAAUrC,EAAQD,EAASF,GASjC,IAAIgC,EAAMhC,EAAoB,IAC1BgF,EAAUhF,EAAoB,IAC9BqG,EAAWrG,EAAoB,GAC/BoI,EAAWpI,EAAoB,GAC/BqI,EAAMrI,EAAoB,IAC9BG,EAAOD,QAAU,SAAUoI,EAAMC,GAC/B,IAAIC,EAAiB,GAARF,EACTG,EAAoB,GAARH,EACZI,EAAkB,GAARJ,EACVK,EAAmB,GAARL,EACXM,EAAwB,GAARN,EAChBO,EAAmB,GAARP,GAAaM,EACxBE,EAASP,GAAWF,EACxB,OAAO,SAAUU,EAAOC,EAAYxB,GAQlC,IAPA,IAMI9B,EAAKuD,EANLxE,EAAI4B,EAAS0C,GACblF,EAAOmB,EAAQP,GACfD,EAAIxC,EAAIgH,EAAYxB,EAAM,GAC1BH,EAASe,EAASvE,EAAKwD,QACvB6B,EAAQ,EACRC,EAASX,EAASM,EAAOC,EAAO1B,GAAUoB,EAAYK,EAAOC,EAAO,GAAKlJ,GAE9DqJ,EAAT7B,EAAgB6B,IAAS,IAAIL,GAAYK,KAASrF,KAEtDoF,EAAMzE,EADNkB,EAAM7B,EAAKqF,GACEA,EAAOzE,GAChB6D,GACF,GAAIE,EAAQW,EAAOD,GAASD,OACvB,GAAIA,EAAK,OAAQX,GACpB,KAAK,EAAG,OAAO,EACf,KAAK,EAAG,OAAO5C,EACf,KAAK,EAAG,OAAOwD,EACf,KAAK,EAAGC,EAAOC,KAAK1D,QACf,GAAIiD,EAAU,OAAO,EAGhC,OAAOC,GAAiB,EAAIF,GAAWC,EAAWA,EAAWQ,KAO3D,SAAUhJ,EAAQD,EAASF,GAGjC,IAAIqJ,EAAQrJ,EAAoB,IAC5BsJ,EAActJ,EAAoB,IAEtCG,EAAOD,QAAUW,OAAO0I,MAAQ,SAASA,KAAK9E,GAC5C,OAAO4E,EAAM5E,EAAG6E,KAMZ,SAAUnJ,EAAQD,EAASF,GAGjC,IAAIoE,EAAWpE,EAAoB,GAC/BwJ,EAAMxJ,EAAoB,IAC1BsJ,EAActJ,EAAoB,IAClCsG,EAAWtG,EAAoB,GAApBA,CAAwB,YACnCyJ,EAAQ,aACRxH,EAAY,YAGZyH,EAAa,WAEf,IAIIC,EAJAC,EAAS5J,EAAoB,GAApBA,CAAwB,UACjCI,EAAIkJ,EAAYjC,OAcpB,IAVAuC,EAAOC,MAAMC,QAAU,OACvB9J,EAAoB,IAAI+J,YAAYH,GACpCA,EAAOI,IAAM,eAGbL,EAAiBC,EAAOK,cAAcC,UACvBC,OACfR,EAAeS,MAAMC,uCACrBV,EAAeW,QACfZ,EAAaC,EAAejH,EACrBtC,YAAYsJ,EAAWzH,GAAWqH,EAAYlJ,IACrD,OAAOsJ,KAGTvJ,EAAOD,QAAUW,OAAOiI,QAAU,SAASA,OAAOrE,EAAG8F,GACnD,IAAIpB,EAQJ,OAPU,OAAN1E,GACFgF,EAAMxH,GAAamC,EAASK,GAC5B0E,EAAS,IAAIM,EACbA,EAAMxH,GAAa,KAEnBkH,EAAO7C,GAAY7B,GACd0E,EAASO,IACTa,IAAe1K,GAAYsJ,EAASK,EAAIL,EAAQoB,KAMnD,SAAUpK,EAAQD,EAASF,GAIjC,GAAIA,EAAoB,GAAI,CAC1B,IAAIwK,EAAUxK,EAAoB,IAC9B4B,EAAS5B,EAAoB,GAC7B0G,EAAQ1G,EAAoB,GAC5BkC,EAAUlC,EAAoB,GAC9ByK,EAASzK,EAAoB,IAC7B0K,EAAU1K,EAAoB,IAC9BgC,EAAMhC,EAAoB,IAC1B2K,EAAa3K,EAAoB,IACjC4K,EAAe5K,EAAoB,IACnC8B,EAAO9B,EAAoB,IAC3B6K,EAAc7K,EAAoB,IAClC6E,EAAY7E,EAAoB,IAChCoI,EAAWpI,EAAoB,GAC/B8K,EAAU9K,EAAoB,KAC9B+K,EAAkB/K,EAAoB,IACtCsE,EAActE,EAAoB,IAClCmF,EAAMnF,EAAoB,IAC1BgL,EAAUhL,EAAoB,IAC9BwD,EAAWxD,EAAoB,GAC/BqG,EAAWrG,EAAoB,GAC/BiL,EAAcjL,EAAoB,IAClC8I,EAAS9I,EAAoB,IAC7BwG,EAAiBxG,EAAoB,IACrCkL,EAAOlL,EAAoB,IAAIwE,EAC/B2G,EAAYnL,EAAoB,IAChCiE,EAAMjE,EAAoB,IAC1BoL,EAAMpL,EAAoB,GAC1BqL,EAAoBrL,EAAoB,IACxCsL,EAAsBtL,EAAoB,IAC1CuL,EAAqBvL,EAAoB,IACzCwL,EAAiBxL,EAAoB,IACrCyL,EAAYzL,EAAoB,IAChC0L,EAAc1L,EAAoB,IAClC2L,EAAa3L,EAAoB,IACjC4L,EAAY5L,EAAoB,IAChC6L,EAAkB7L,EAAoB,KACtC8L,EAAM9L,EAAoB,GAC1B+L,EAAQ/L,EAAoB,IAC5BuE,EAAKuH,EAAItH,EACT2B,EAAO4F,EAAMvH,EACbwH,EAAapK,EAAOoK,WACpBtI,EAAY9B,EAAO8B,UACnBuI,EAAarK,EAAOqK,WACpBC,EAAe,cACfC,EAAgB,SAAWD,EAC3BE,EAAoB,oBACpBnK,EAAY,YACZoK,EAAaC,MAAMrK,GACnBsK,EAAe7B,EAAQ8B,YACvBC,EAAY/B,EAAQgC,SACpBC,EAAetB,EAAkB,GACjCuB,GAAcvB,EAAkB,GAChCwB,GAAYxB,EAAkB,GAC9ByB,GAAazB,EAAkB,GAC/B0B,GAAY1B,EAAkB,GAC9B2B,GAAiB3B,EAAkB,GACnC4B,GAAgB3B,GAAoB,GACpC4B,GAAe5B,GAAoB,GACnC6B,GAAc3B,EAAe4B,OAC7BC,GAAY7B,EAAejC,KAC3B+D,GAAe9B,EAAe+B,QAC9BC,GAAmBnB,EAAWoB,YAC9BC,GAAcrB,EAAWsB,OACzBC,GAAmBvB,EAAWwB,YAC9BC,GAAYzB,EAAWxG,KACvBkI,GAAY1B,EAAW2B,KACvBC,GAAa5B,EAAWzE,MACxBsG,GAAgB7B,EAAWtG,SAC3BoI,GAAsB9B,EAAW+B,eACjCC,GAAWjD,EAAI,YACfkD,GAAMlD,EAAI,eACVmD,GAAoBtK,EAAI,qBACxBuK,GAAkBvK,EAAI,mBACtBwK,GAAmBhE,EAAOiE,OAC1BC,GAAclE,EAAOmE,MACrBC,GAAOpE,EAAOoE,KACdC,GAAe,gBAEfC,GAAO1D,EAAkB,EAAG,SAAU5G,EAAG4C,GAC3C,OAAO2H,GAASzD,EAAmB9G,EAAGA,EAAE+J,KAAmBnH,KAGzD4H,GAAgBvI,EAAM,WAExB,OAA0D,IAAnD,IAAIuF,EAAW,IAAIiD,YAAY,CAAC,IAAIC,QAAQ,KAGjDC,KAAenD,KAAgBA,EAAWhK,GAAWoN,KAAO3I,EAAM,WACpE,IAAIuF,EAAW,GAAGoD,IAAI,MAGpBC,GAAW,SAAU7L,EAAI8L,GAC3B,IAAIC,EAAS3K,EAAUpB,GACvB,GAAI+L,EAAS,GAAKA,EAASD,EAAO,MAAMvD,EAAW,iBACnD,OAAOwD,GAGLC,GAAW,SAAUhM,GACvB,GAAID,EAASC,IAAOkL,MAAelL,EAAI,OAAOA,EAC9C,MAAMC,EAAUD,EAAK,2BAGnBuL,GAAW,SAAUU,EAAGrI,GAC1B,KAAM7D,EAASkM,IAAMnB,MAAqBmB,GACxC,MAAMhM,EAAU,wCAChB,OAAO,IAAIgM,EAAErI,IAGbsI,GAAkB,SAAUlL,EAAGmL,GACjC,OAAOC,GAAStE,EAAmB9G,EAAGA,EAAE+J,KAAmBoB,IAGzDC,GAAW,SAAUH,EAAGE,GAI1B,IAHA,IAAI1G,EAAQ,EACR7B,EAASuI,EAAKvI,OACd8B,EAAS6F,GAASU,EAAGrI,GACT6B,EAAT7B,GAAgB8B,EAAOD,GAAS0G,EAAK1G,KAC5C,OAAOC,GAGL2G,GAAY,SAAUrM,EAAIpB,EAAK0N,GACjCxL,EAAGd,EAAIpB,EAAK,CAAEpB,IAAK,WAAc,OAAO+E,KAAKgK,GAAGD,OAG9CE,GAAQ,SAASC,KAAK9N,GACxB,IAKIhC,EAAGiH,EAAQ+F,EAAQjE,EAAQgH,EAAMC,EALjC3L,EAAI4B,EAASjE,GACbiO,EAAO1I,UAAUN,OACjBiJ,EAAe,EAAPD,EAAW1I,UAAU,GAAK9H,GAClC0Q,EAAUD,IAAUzQ,GACpB2Q,EAASrF,EAAU1G,GAEvB,GAAI+L,GAAU3Q,KAAcoL,EAAYuF,GAAS,CAC/C,IAAKJ,EAAWI,EAAOlQ,KAAKmE,GAAI2I,EAAS,GAAIhN,EAAI,IAAK+P,EAAOC,EAASK,QAAQC,KAAMtQ,IAClFgN,EAAOhE,KAAK+G,EAAKxL,OACjBF,EAAI2I,EAGR,IADImD,GAAkB,EAAPF,IAAUC,EAAQtO,EAAIsO,EAAO3I,UAAU,GAAI,IACrDvH,EAAI,EAAGiH,EAASe,EAAS3D,EAAE4C,QAAS8B,EAAS6F,GAAShJ,KAAMqB,GAAkBjH,EAATiH,EAAYjH,IACpF+I,EAAO/I,GAAKmQ,EAAUD,EAAM7L,EAAErE,GAAIA,GAAKqE,EAAErE,GAE3C,OAAO+I,GAGLwH,GAAM,SAASC,KAIjB,IAHA,IAAI1H,EAAQ,EACR7B,EAASM,UAAUN,OACnB8B,EAAS6F,GAAShJ,KAAMqB,GACZ6B,EAAT7B,GAAgB8B,EAAOD,GAASvB,UAAUuB,KACjD,OAAOC,GAIL0H,KAAkB5E,GAAcvF,EAAM,WAAcyH,GAAoB7N,KAAK,IAAI2L,EAAW,MAE5F6E,GAAkB,SAAS1C,iBAC7B,OAAOD,GAAoBzG,MAAMmJ,GAAgB5C,GAAW3N,KAAKmP,GAASzJ,OAASyJ,GAASzJ,MAAO2B,YAGjGoJ,GAAQ,CACVC,WAAY,SAASA,WAAW/N,EAAQgO,GACtC,OAAOpF,EAAgBvL,KAAKmP,GAASzJ,MAAO/C,EAAQgO,EAA0B,EAAnBtJ,UAAUN,OAAaM,UAAU,GAAK9H,KAEnGqR,MAAO,SAASA,MAAMlI,GACpB,OAAO8D,GAAW2C,GAASzJ,MAAOgD,EAA+B,EAAnBrB,UAAUN,OAAaM,UAAU,GAAK9H,KAEtFsR,KAAM,SAASA,KAAKxM,GAClB,OAAOiH,EAAUlE,MAAM+H,GAASzJ,MAAO2B,YAEzCyJ,OAAQ,SAASA,OAAOpI,GACtB,OAAO2G,GAAgB3J,KAAM4G,GAAY6C,GAASzJ,MAAOgD,EACpC,EAAnBrB,UAAUN,OAAaM,UAAU,GAAK9H,MAE1CwR,KAAM,SAASA,KAAKC,GAClB,OAAOvE,GAAU0C,GAASzJ,MAAOsL,EAA8B,EAAnB3J,UAAUN,OAAaM,UAAU,GAAK9H,KAEpF0R,UAAW,SAASA,UAAUD,GAC5B,OAAOtE,GAAeyC,GAASzJ,MAAOsL,EAA8B,EAAnB3J,UAAUN,OAAaM,UAAU,GAAK9H,KAEzF2R,QAAS,SAASA,QAAQxI,GACxB2D,EAAa8C,GAASzJ,MAAOgD,EAA+B,EAAnBrB,UAAUN,OAAaM,UAAU,GAAK9H,KAEjF4R,QAAS,SAASA,QAAQC,GACxB,OAAOxE,GAAauC,GAASzJ,MAAO0L,EAAkC,EAAnB/J,UAAUN,OAAaM,UAAU,GAAK9H,KAE3F8R,SAAU,SAASA,SAASD,GAC1B,OAAOzE,GAAcwC,GAASzJ,MAAO0L,EAAkC,EAAnB/J,UAAUN,OAAaM,UAAU,GAAK9H,KAE5FgG,KAAM,SAASA,KAAK+L,GAClB,OAAO9D,GAAUpG,MAAM+H,GAASzJ,MAAO2B,YAEzC8F,YAAa,SAASA,YAAYiE,GAChC,OAAOlE,GAAiB9F,MAAM+H,GAASzJ,MAAO2B,YAEhDkK,IAAK,SAASA,IAAIvB,GAChB,OAAOvB,GAAKU,GAASzJ,MAAOsK,EAA0B,EAAnB3I,UAAUN,OAAaM,UAAU,GAAK9H,KAE3E8N,OAAQ,SAASA,OAAO3E,GACtB,OAAO0E,GAAYhG,MAAM+H,GAASzJ,MAAO2B,YAE3CkG,YAAa,SAASA,YAAY7E,GAChC,OAAO4E,GAAiBlG,MAAM+H,GAASzJ,MAAO2B,YAEhDmK,QAAS,SAASA,UAMhB,IALA,IAIInN,EAJA6C,EAAOxB,KACPqB,EAASoI,GAASjI,GAAMH,OACxB0K,EAASnO,KAAKqE,MAAMZ,EAAS,GAC7B6B,EAAQ,EAELA,EAAQ6I,GACbpN,EAAQ6C,EAAK0B,GACb1B,EAAK0B,KAAW1B,IAAOH,GACvBG,EAAKH,GAAU1C,EACf,OAAO6C,GAEXwK,KAAM,SAASA,KAAKhJ,GAClB,OAAO6D,GAAU4C,GAASzJ,MAAOgD,EAA+B,EAAnBrB,UAAUN,OAAaM,UAAU,GAAK9H,KAErFmO,KAAM,SAASA,KAAKiE,GAClB,OAAOlE,GAAUzN,KAAKmP,GAASzJ,MAAOiM,IAExCC,SAAU,SAASA,SAASC,EAAOC,GACjC,IAAI3N,EAAIgL,GAASzJ,MACbqB,EAAS5C,EAAE4C,OACXgL,EAAStH,EAAgBoH,EAAO9K,GACpC,OAAO,IAAKkE,EAAmB9G,EAAGA,EAAE+J,KAA7B,CACL/J,EAAE0K,OACF1K,EAAE6N,WAAaD,EAAS5N,EAAE2H,kBAC1BhE,GAAUgK,IAAQvS,GAAYwH,EAAS0D,EAAgBqH,EAAK/K,IAAWgL,MAKzEE,GAAS,SAAS3K,MAAMqJ,EAAOmB,GACjC,OAAOzC,GAAgB3J,KAAMiI,GAAW3N,KAAKmP,GAASzJ,MAAOiL,EAAOmB,KAGlEI,GAAO,SAASnD,IAAIoD,GACtBhD,GAASzJ,MACT,IAAIwJ,EAASF,GAAS3H,UAAU,GAAI,GAChCN,EAASrB,KAAKqB,OACd2C,EAAM3D,EAASoM,GACfC,EAAMtK,EAAS4B,EAAI3C,QACnB6B,EAAQ,EACZ,GAAmB7B,EAAfqL,EAAMlD,EAAiB,MAAMxD,EAAW8C,IAC5C,KAAO5F,EAAQwJ,GAAK1M,KAAKwJ,EAAStG,GAASc,EAAId,MAG7CyJ,GAAa,CACfpF,QAAS,SAASA,UAChB,OAAOD,GAAahN,KAAKmP,GAASzJ,QAEpCuD,KAAM,SAASA,OACb,OAAO8D,GAAU/M,KAAKmP,GAASzJ,QAEjCoH,OAAQ,SAASA,SACf,OAAOD,GAAY7M,KAAKmP,GAASzJ,SAIjC4M,GAAY,SAAU3P,EAAQZ,GAChC,OAAOmB,EAASP,IACXA,EAAO0L,KACO,iBAAPtM,GACPA,KAAOY,GACP6C,QAAQzD,IAAQyD,OAAOzD,IAE1BwQ,GAAW,SAASzM,yBAAyBnD,EAAQZ,GACvD,OAAOuQ,GAAU3P,EAAQZ,EAAMiC,EAAYjC,GAAK,IAC5CuI,EAAa,EAAG3H,EAAOZ,IACvB8D,EAAKlD,EAAQZ,IAEfyQ,GAAW,SAAShS,eAAemC,EAAQZ,EAAK0Q,GAClD,QAAIH,GAAU3P,EAAQZ,EAAMiC,EAAYjC,GAAK,KACxCmB,EAASuP,IACT5N,EAAI4N,EAAM,WACT5N,EAAI4N,EAAM,QACV5N,EAAI4N,EAAM,QAEVA,EAAKhS,cACJoE,EAAI4N,EAAM,cAAeA,EAAKC,UAC9B7N,EAAI4N,EAAM,gBAAiBA,EAAK/R,WAI9BuD,EAAGtB,EAAQZ,EAAK0Q,IAFvB9P,EAAOZ,GAAO0Q,EAAKpO,MACZ1B,IAINwL,KACH1C,EAAMvH,EAAIqO,GACV/G,EAAItH,EAAIsO,IAGV5Q,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAK+L,GAAkB,SAAU,CAC3DrI,yBAA0ByM,GAC1B/R,eAAgBgS,KAGdpM,EAAM,WAAcwH,GAAc5N,KAAK,QACzC4N,GAAgBC,GAAsB,SAASpI,WAC7C,OAAO+H,GAAUxN,KAAK0F,QAI1B,IAAIiN,GAAwBpI,EAAY,GAAIkG,IAC5ClG,EAAYoI,GAAuBN,IACnC7Q,EAAKmR,GAAuB5E,GAAUsE,GAAWvF,QACjDvC,EAAYoI,GAAuB,CACjCrL,MAAO2K,GACPlD,IAAKmD,GACL/L,YAAa,aACbV,SAAUmI,GACVE,eAAgB0C,KAElBhB,GAAUmD,GAAuB,SAAU,KAC3CnD,GAAUmD,GAAuB,aAAc,KAC/CnD,GAAUmD,GAAuB,aAAc,KAC/CnD,GAAUmD,GAAuB,SAAU,KAC3C1O,EAAG0O,GAAuB3E,GAAK,CAC7BrN,IAAK,WAAc,OAAO+E,KAAK2I,OAIjCxO,EAAOD,QAAU,SAAUiI,EAAKoH,EAAO2D,EAASC,GAE9C,IAAIjM,EAAOiB,IADXgL,IAAYA,GACgB,UAAY,IAAM,QAC1CC,EAAS,MAAQjL,EACjBkL,EAAS,MAAQlL,EACjBmL,EAAa1R,EAAOsF,GACpBqM,EAAOD,GAAc,GACrBE,EAAMF,GAAc9M,EAAe8M,GAEnC7O,EAAI,GACJgP,EAAsBH,GAAcA,EAAWrR,GAU/CyR,EAAa,SAAUlM,EAAM0B,GAC/B3E,EAAGiD,EAAM0B,EAAO,CACdjI,IAAK,WACH,OAXA0S,EAWc3N,KAXFgK,IACJ4D,EAAER,GAUUlK,EAVMqG,EAAQoE,EAAK/S,EAAGqO,IAFnC,IACP0E,GAaFtE,IAAK,SAAU1K,GACb,OAXuBuE,EAWHA,EAXUvE,EAWHA,EAV3BgP,EAUc3N,KAVFgK,GACZmD,IAASxO,GAASA,EAAQf,KAAKiQ,MAAMlP,IAAU,EAAI,EAAY,IAARA,EAAe,IAAe,IAARA,QACjFgP,EAAKC,EAAEP,GAAQnK,EAAQqG,EAAQoE,EAAK/S,EAAG+D,EAAOsK,IAHnC,IAAgB/F,EAAOvE,EAC9BgP,GAYF3S,YAAY,MApBFsS,IAAe7I,EAAOqJ,KAwBlCR,EAAaJ,EAAQ,SAAU1L,EAAMmM,EAAMI,EAASC,GAClDrJ,EAAWnD,EAAM8L,EAAYpM,EAAM,MACnC,IAEIiI,EAAQ8E,EAAY5M,EAAQ6M,EAF5BhL,EAAQ,EACRsG,EAAS,EAEb,GAAKhM,EAASmQ,GAIP,CAAA,KAAIA,aAAgBpH,IAAiB2H,EAAQlJ,EAAQ2I,KAAUzH,GAAgBgI,GAAS/H,GAaxF,OAAIwC,MAAegF,EACjB9D,GAASyD,EAAYK,GAErB1D,GAAM3P,KAAKgT,EAAYK,GAf9BxE,EAASwE,EACTnE,EAASF,GAASyE,EAASxE,GAC3B,IAAI4E,EAAOR,EAAKM,WAChB,GAAID,IAAYnU,GAAW,CACzB,GAAIsU,EAAO5E,EAAO,MAAMvD,EAAW8C,IAEnC,IADAmF,EAAaE,EAAO3E,GACH,EAAG,MAAMxD,EAAW8C,SAGrC,GAA0BqF,GAD1BF,EAAa7L,EAAS4L,GAAWzE,GAChBC,EAAe,MAAMxD,EAAW8C,IAEnDzH,EAAS4M,EAAa1E,OAftBlI,EAASyD,EAAQ6I,GAEjBxE,EAAS,IAAI5C,EADb0H,EAAa5M,EAASkI,GA2BxB,IAPAzN,EAAK0F,EAAM,KAAM,CACfC,EAAG0H,EACHvO,EAAG4O,EACHnP,EAAG4T,EACHlQ,EAAGsD,EACHuM,EAAG,IAAInH,EAAU0C,KAEZjG,EAAQ7B,GAAQqM,EAAWlM,EAAM0B,OAE1CuK,EAAsBH,EAAWrR,GAAa6G,EAAOmK,IACrDnR,EAAK2R,EAAqB,cAAeH,IAC/B5M,EAAM,WAChB4M,EAAW,MACN5M,EAAM,WACX,IAAI4M,GAAY,MACX5H,EAAY,SAAU0I,GAC3B,IAAId,EACJ,IAAIA,EAAW,MACf,IAAIA,EAAW,KACf,IAAIA,EAAWc,KACd,KACDd,EAAaJ,EAAQ,SAAU1L,EAAMmM,EAAMI,EAASC,GAElD,IAAIE,EAGJ,OAJAvJ,EAAWnD,EAAM8L,EAAYpM,GAIxB1D,EAASmQ,GACVA,aAAgBpH,IAAiB2H,EAAQlJ,EAAQ2I,KAAUzH,GAAgBgI,GAAS/H,EAC/E6H,IAAYnU,GACf,IAAI0T,EAAKI,EAAMrE,GAASyE,EAASxE,GAAQyE,GACzCD,IAAYlU,GACV,IAAI0T,EAAKI,EAAMrE,GAASyE,EAASxE,IACjC,IAAIgE,EAAKI,GAEbhF,MAAegF,EAAa9D,GAASyD,EAAYK,GAC9C1D,GAAM3P,KAAKgT,EAAYK,GATF,IAAIJ,EAAKzI,EAAQ6I,MAW/ChH,EAAa6G,IAAQpQ,SAAS5B,UAAY0J,EAAKqI,GAAMc,OAAOnJ,EAAKsI,IAAQtI,EAAKqI,GAAO,SAAUlR,GACvFA,KAAOiR,GAAaxR,EAAKwR,EAAYjR,EAAKkR,EAAKlR,MAEvDiR,EAAWrR,GAAawR,EACnBjJ,IAASiJ,EAAoBhN,YAAc6M,IAElD,IAAIgB,EAAkBb,EAAoBpF,IACtCkG,IAAsBD,IACI,UAAxBA,EAAgB5T,MAAoB4T,EAAgB5T,MAAQb,IAC9D2U,EAAY7B,GAAWvF,OAC3BtL,EAAKwR,EAAY/E,IAAmB,GACpCzM,EAAK2R,EAAqB9E,GAAazH,GACvCpF,EAAK2R,EAAqB5E,IAAM,GAChC/M,EAAK2R,EAAqBjF,GAAiB8E,IAEvCH,EAAU,IAAIG,EAAW,GAAGhF,KAAQpH,EAASoH,MAAOmF,IACtDlP,EAAGkP,EAAqBnF,GAAK,CAC3BrN,IAAK,WAAc,OAAOiG,KAM9BhF,EAAQA,EAAQU,EAAIV,EAAQoB,EAAIpB,EAAQQ,IAFxC+B,EAAEyC,GAAQoM,IAEiDC,GAAO9O,GAElEvC,EAAQA,EAAQgB,EAAGgE,EAAM,CACvBkF,kBAAmBmD,IAGrBrN,EAAQA,EAAQgB,EAAIhB,EAAQQ,EAAIgE,EAAM,WAAc6M,EAAK3C,GAAGtQ,KAAKgT,EAAY,KAAQpM,EAAM,CACzFgJ,KAAMD,GACNW,GAAID,KAGAvE,KAAqBqH,GAAsB3R,EAAK2R,EAAqBrH,EAAmBmD,GAE9FrN,EAAQA,EAAQY,EAAGoE,EAAM6J,IAEzBpF,EAAWzE,GAEXhF,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAI0M,GAAYlI,EAAM,CAAEmI,IAAKmD,KAEzDtQ,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAK6R,EAAmBrN,EAAMyL,IAErDnI,GAAWiJ,EAAoB1N,UAAYmI,KAAeuF,EAAoB1N,SAAWmI,IAE9FhM,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAIgE,EAAM,WACpC,IAAI4M,EAAW,GAAG1L,UAChBV,EAAM,CAAEU,MAAO2K,KAEnBrQ,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAKgE,EAAM,WACrC,MAAO,CAAC,EAAG,GAAG0H,kBAAoB,IAAIkF,EAAW,CAAC,EAAG,IAAIlF,qBACpD1H,EAAM,WACX+M,EAAoBrF,eAAe9N,KAAK,CAAC,EAAG,OACzC4G,EAAM,CAAEkH,eAAgB0C,KAE7BrF,EAAUvE,GAAQqN,EAAoBD,EAAkBE,EACnDhK,GAAY+J,GAAmBzS,EAAK2R,EAAqBpF,GAAUmG,SAErErU,EAAOD,QAAU,cAKlB,SAAUC,EAAQD,EAASF,GAEjC,IAAIyU,EAAMzU,EAAoB,KAC1BkC,EAAUlC,EAAoB,GAC9B0U,EAAS1U,EAAoB,GAApBA,CAAwB,YACjCgE,EAAQ0Q,EAAO1Q,QAAU0Q,EAAO1Q,MAAQ,IAAKhE,EAAoB,OAEjE2U,EAAyB,SAAU1R,EAAQ2R,EAAW9L,GACxD,IAAI+L,EAAiB7Q,EAAM/C,IAAIgC,GAC/B,IAAK4R,EAAgB,CACnB,IAAK/L,EAAQ,OAAOjJ,GACpBmE,EAAMqL,IAAIpM,EAAQ4R,EAAiB,IAAIJ,GAEzC,IAAIK,EAAcD,EAAe5T,IAAI2T,GACrC,IAAKE,EAAa,CAChB,IAAKhM,EAAQ,OAAOjJ,GACpBgV,EAAexF,IAAIuF,EAAWE,EAAc,IAAIL,GAChD,OAAOK,GA0BX3U,EAAOD,QAAU,CACf8D,MAAOA,EACP6N,IAAK8C,EACLxP,IA3B2B,SAAU4P,EAAatQ,EAAG3B,GACrD,IAAIkS,EAAcL,EAAuBlQ,EAAG3B,GAAG,GAC/C,OAAOkS,IAAgBnV,IAAoBmV,EAAY7P,IAAI4P,IA0B3D9T,IAxB2B,SAAU8T,EAAatQ,EAAG3B,GACrD,IAAIkS,EAAcL,EAAuBlQ,EAAG3B,GAAG,GAC/C,OAAOkS,IAAgBnV,GAAYA,GAAYmV,EAAY/T,IAAI8T,IAuB/D1F,IArB8B,SAAU0F,EAAaE,EAAexQ,EAAG3B,GACvE6R,EAAuBlQ,EAAG3B,GAAG,GAAMuM,IAAI0F,EAAaE,IAqBpD1L,KAnB4B,SAAUtG,EAAQ2R,GAC9C,IAAII,EAAcL,EAAuB1R,EAAQ2R,GAAW,GACxDrL,EAAO,GAEX,OADIyL,GAAaA,EAAYxD,QAAQ,SAAU0D,EAAG7S,GAAOkH,EAAKH,KAAK/G,KAC5DkH,GAgBPlH,IAdc,SAAUoB,GACxB,OAAOA,IAAO5D,IAA0B,iBAAN4D,EAAiBA,EAAKqC,OAAOrC,IAc/DjB,IAZQ,SAAUiC,GAClBvC,EAAQA,EAAQgB,EAAG,UAAWuB,MAiB1B,SAAUtE,EAAQD,GAExBC,EAAOD,QAAU,SAAUiV,EAAQxQ,GACjC,MAAO,CACL3D,aAAuB,EAATmU,GACdpU,eAAyB,EAAToU,GAChBnC,WAAqB,EAATmC,GACZxQ,MAAOA,KAOL,SAAUxE,EAAQD,EAASF,GAEjC,IAAIoV,EAAOpV,EAAoB,GAApBA,CAAwB,QAC/BwD,EAAWxD,EAAoB,GAC/BmF,EAAMnF,EAAoB,IAC1BqV,EAAUrV,EAAoB,GAAGwE,EACjC8Q,EAAK,EACLC,EAAe1U,OAAO0U,cAAgB,WACxC,OAAO,GAELC,GAAUxV,EAAoB,EAApBA,CAAuB,WACnC,OAAOuV,EAAa1U,OAAO4U,kBAAkB,OAE3CC,EAAU,SAAUjS,GACtB4R,EAAQ5R,EAAI2R,EAAM,CAAEzQ,MAAO,CACzBvE,EAAG,OAAQkV,EACXK,EAAG,OAgCHC,EAAOzV,EAAOD,QAAU,CAC1BiI,IAAKiN,EACLS,MAAM,EACNC,QAhCY,SAAUrS,EAAIqF,GAE1B,IAAKtF,EAASC,GAAK,MAAoB,iBAANA,EAAiBA,GAAmB,iBAANA,EAAiB,IAAM,KAAOA,EAC7F,IAAK0B,EAAI1B,EAAI2R,GAAO,CAElB,IAAKG,EAAa9R,GAAK,MAAO,IAE9B,IAAKqF,EAAQ,MAAO,IAEpB4M,EAAQjS,GAER,OAAOA,EAAG2R,GAAMhV,GAsBlB2V,QApBY,SAAUtS,EAAIqF,GAC1B,IAAK3D,EAAI1B,EAAI2R,GAAO,CAElB,IAAKG,EAAa9R,GAAK,OAAO,EAE9B,IAAKqF,EAAQ,OAAO,EAEpB4M,EAAQjS,GAER,OAAOA,EAAG2R,GAAMO,GAYlBK,SATa,SAAUvS,GAEvB,OADI+R,GAAUI,EAAKC,MAAQN,EAAa9R,KAAQ0B,EAAI1B,EAAI2R,IAAOM,EAAQjS,GAChEA,KAaH,SAAUtD,EAAQD,GAExBC,EAAOD,SAAU,GAKX,SAAUC,EAAQD,EAASF,GAGjC,IAAIiW,EAAcjW,EAAoB,EAApBA,CAAuB,eACrCqM,EAAaC,MAAM9K,UACnB6K,EAAW4J,IAAgBpW,IAAWG,EAAoB,GAApBA,CAAwBqM,EAAY4J,EAAa,IAC3F9V,EAAOD,QAAU,SAAUmC,GACzBgK,EAAW4J,GAAa5T,IAAO,IAM3B,SAAUlC,EAAQD,EAASF,GAEjC,IAAIgC,EAAMhC,EAAoB,IAC1BM,EAAON,EAAoB,KAC3BiL,EAAcjL,EAAoB,IAClCoE,EAAWpE,EAAoB,GAC/BoI,EAAWpI,EAAoB,GAC/BmL,EAAYnL,EAAoB,IAChCkW,EAAQ,GACRC,EAAS,IACTjW,EAAUC,EAAOD,QAAU,SAAUkW,EAAU7I,EAAShG,EAAIC,EAAM6G,GACpE,IAGIhH,EAAQ8I,EAAMC,EAAUjH,EAHxBqH,EAASnC,EAAW,WAAc,OAAO+H,GAAcjL,EAAUiL,GACjE5R,EAAIxC,EAAIuF,EAAIC,EAAM+F,EAAU,EAAI,GAChCrE,EAAQ,EAEZ,GAAqB,mBAAVsH,EAAsB,MAAM9M,UAAU0S,EAAW,qBAE5D,GAAInL,EAAYuF,IAAS,IAAKnJ,EAASe,EAASgO,EAAS/O,QAAkB6B,EAAT7B,EAAgB6B,IAEhF,IADAC,EAASoE,EAAU/I,EAAEJ,EAAS+L,EAAOiG,EAASlN,IAAQ,GAAIiH,EAAK,IAAM3L,EAAE4R,EAASlN,OACjEgN,GAAS/M,IAAWgN,EAAQ,OAAOhN,OAC7C,IAAKiH,EAAWI,EAAOlQ,KAAK8V,KAAajG,EAAOC,EAASK,QAAQC,MAEtE,IADAvH,EAAS7I,EAAK8P,EAAU5L,EAAG2L,EAAKxL,MAAO4I,MACxB2I,GAAS/M,IAAWgN,EAAQ,OAAOhN,IAG9C+M,MAAQA,EAChBhW,EAAQiW,OAASA,GAKX,SAAUhW,EAAQD,GAExB,IAAIoV,EAAK,EACLe,EAAKzS,KAAK0S,SACdnW,EAAOD,QAAU,SAAUmC,GACzB,MAAO,UAAUgS,OAAOhS,IAAQxC,GAAY,GAAKwC,EAAK,QAASiT,EAAKe,GAAItQ,SAAS,OAM7E,SAAU5F,EAAQD,EAASF,GAEjC,IAAI6E,EAAY7E,EAAoB,IAChCuW,EAAM3S,KAAK2S,IACXzR,EAAMlB,KAAKkB,IACf3E,EAAOD,QAAU,SAAUgJ,EAAO7B,GAEhC,OADA6B,EAAQrE,EAAUqE,IACH,EAAIqN,EAAIrN,EAAQ7B,EAAQ,GAAKvC,EAAIoE,EAAO7B,KAMnD,SAAUlH,EAAQD,EAASF,GAGjC,IAAIqJ,EAAQrJ,EAAoB,IAC5BwW,EAAaxW,EAAoB,IAAIqU,OAAO,SAAU,aAE1DnU,EAAQsE,EAAI3D,OAAO4V,qBAAuB,SAASA,oBAAoBhS,GACrE,OAAO4E,EAAM5E,EAAG+R,KAMZ,SAAUrW,EAAQD,EAASF,GAGjC,IAAI0W,EAAM1W,EAAoB,IAC1BsO,EAAMtO,EAAoB,EAApBA,CAAuB,eAE7B2W,EAAkD,aAA5CD,EAAI,WAAc,OAAO/O,UAArB,IASdxH,EAAOD,QAAU,SAAUuD,GACzB,IAAIgB,EAAGmS,EAAG5T,EACV,OAAOS,IAAO5D,GAAY,YAAqB,OAAP4D,EAAc,OAEN,iBAApCmT,EAVD,SAAUnT,EAAIpB,GACzB,IACE,OAAOoB,EAAGpB,GACV,MAAO0B,KAOO8S,CAAOpS,EAAI5D,OAAO4C,GAAK6K,IAAoBsI,EAEvDD,EAAMD,EAAIjS,GAEM,WAAfzB,EAAI0T,EAAIjS,KAAsC,mBAAZA,EAAEqS,OAAuB,YAAc9T,IAM1E,SAAU7C,EAAQD,GAExBC,EAAOD,QAAU,IAKX,SAAUC,EAAQD,EAASF,GAIjC,IAAI4B,EAAS5B,EAAoB,GAC7BuE,EAAKvE,EAAoB,GACzB+W,EAAc/W,EAAoB,GAClCgX,EAAUhX,EAAoB,EAApBA,CAAuB,WAErCG,EAAOD,QAAU,SAAUiI,GACzB,IAAIuH,EAAI9N,EAAOuG,GACX4O,GAAerH,IAAMA,EAAEsH,IAAUzS,EAAGC,EAAEkL,EAAGsH,EAAS,CACpDjW,cAAc,EACdE,IAAK,WAAc,OAAO+E,UAOxB,SAAU7F,EAAQD,GAExBC,EAAOD,QAAU,SAAUuD,EAAIwT,EAAavW,EAAMwW,GAChD,KAAMzT,aAAcwT,IAAiBC,IAAmBrX,IAAaqX,KAAkBzT,EACrF,MAAMC,UAAUhD,EAAO,2BACvB,OAAO+C,IAML,SAAUtD,EAAQD,EAASF,GAEjC,IAAI+B,EAAW/B,EAAoB,IACnCG,EAAOD,QAAU,SAAU+C,EAAQ+G,EAAKrE,GACtC,IAAK,IAAItD,KAAO2H,EAAKjI,EAASkB,EAAQZ,EAAK2H,EAAI3H,GAAMsD,GACrD,OAAO1C,IAMH,SAAU9C,EAAQD,EAASF,GAEjC,IAAImX,EAAMnX,EAAoB,GAAGwE,EAC7BW,EAAMnF,EAAoB,IAC1BsO,EAAMtO,EAAoB,EAApBA,CAAuB,eAEjCG,EAAOD,QAAU,SAAUuD,EAAIqD,EAAKsQ,GAC9B3T,IAAO0B,EAAI1B,EAAK2T,EAAO3T,EAAKA,EAAGjC,UAAW8M,IAAM6I,EAAI1T,EAAI6K,EAAK,CAAEvN,cAAc,EAAM4D,MAAOmC,MAM1F,SAAU3G,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B+E,EAAU/E,EAAoB,IAC9B0G,EAAQ1G,EAAoB,GAC5BqX,EAASrX,EAAoB,IAC7BsX,EAAQ,IAAMD,EAAS,IAEvBE,EAAQC,OAAO,IAAMF,EAAQA,EAAQ,KACrCG,EAAQD,OAAOF,EAAQA,EAAQ,MAE/BI,EAAW,SAAUvP,EAAKrE,EAAM6T,GAClC,IAAInV,EAAM,GACNoV,EAAQlR,EAAM,WAChB,QAAS2Q,EAAOlP,MAPV,MAAA,KAOwBA,OAE5BZ,EAAK/E,EAAI2F,GAAOyP,EAAQ9T,EAAK+T,GAAQR,EAAOlP,GAC5CwP,IAAOnV,EAAImV,GAASpQ,GACxBrF,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAIkV,EAAO,SAAUpV,IAM/CqV,EAAOH,EAASG,KAAO,SAAUhR,EAAQyB,GAI3C,OAHAzB,EAASf,OAAOf,EAAQ8B,IACb,EAAPyB,IAAUzB,EAASA,EAAOI,QAAQsQ,EAAO,KAClC,EAAPjP,IAAUzB,EAASA,EAAOI,QAAQwQ,EAAO,KACtC5Q,GAGT1G,EAAOD,QAAUwX,GAKX,SAAUvX,EAAQD,EAASF,GAEjC,IAAIwD,EAAWxD,EAAoB,GACnCG,EAAOD,QAAU,SAAUuD,EAAI6E,GAC7B,IAAK9E,EAASC,IAAOA,EAAGqU,KAAOxP,EAAM,MAAM5E,UAAU,0BAA4B4E,EAAO,cACxF,OAAO7E,IAMH,SAAUtD,EAAQD,EAASF,GAGjC,IAAI0W,EAAM1W,EAAoB,IAE9BG,EAAOD,QAAUW,OAAO,KAAKkX,qBAAqB,GAAKlX,OAAS,SAAU4C,GACxE,MAAkB,UAAXiT,EAAIjT,GAAkBA,EAAG+B,MAAM,IAAM3E,OAAO4C,KAM/C,SAAUtD,EAAQD,GAExBA,EAAQsE,EAAI,GAAGuT,sBAKT,SAAU5X,EAAQD,EAASF,GAEjC,IAAIgL,EAAUhL,EAAoB,IAC9BqO,EAAWrO,EAAoB,EAApBA,CAAuB,YAClCyL,EAAYzL,EAAoB,IACpCG,EAAOD,QAAUF,EAAoB,IAAIgY,kBAAoB,SAAUvU,GACrE,GAAIA,GAAM5D,GAAW,OAAO4D,EAAG4K,IAC1B5K,EAAG,eACHgI,EAAUT,EAAQvH,MAMnB,SAAUtD,EAAQD,EAASF,GAEjC,IAAI6B,EAAO7B,EAAoB,IAC3B4B,EAAS5B,EAAoB,GAC7BiY,EAAS,qBACTjU,EAAQpC,EAAOqW,KAAYrW,EAAOqW,GAAU,KAE/C9X,EAAOD,QAAU,SAAUmC,EAAKsC,GAC/B,OAAOX,EAAM3B,KAAS2B,EAAM3B,GAAOsC,IAAU9E,GAAY8E,EAAQ,MAChE,WAAY,IAAIyE,KAAK,CACtBnE,QAASpD,EAAKoD,QACdiT,KAAMlY,EAAoB,IAAM,OAAS,SACzCmY,UAAW,0CAMP,SAAUhY,EAAQD,EAASF,GAIjC,IAAIkG,EAAYlG,EAAoB,IAChCoI,EAAWpI,EAAoB,GAC/B+K,EAAkB/K,EAAoB,IAC1CG,EAAOD,QAAU,SAAUkY,GACzB,OAAO,SAAUrP,EAAOsP,EAAIC,GAC1B,IAGI3T,EAHAF,EAAIyB,EAAU6C,GACd1B,EAASe,EAAS3D,EAAE4C,QACpB6B,EAAQ6B,EAAgBuN,EAAWjR,GAIvC,GAAI+Q,GAAeC,GAAMA,GAAI,KAAgBnP,EAAT7B,GAGlC,IAFA1C,EAAQF,EAAEyE,OAEGvE,EAAO,OAAO,OAEtB,KAAeuE,EAAT7B,EAAgB6B,IAAS,IAAIkP,GAAelP,KAASzE,IAC5DA,EAAEyE,KAAWmP,EAAI,OAAOD,GAAelP,GAAS,EACpD,OAAQkP,IAAgB,KAOxB,SAAUjY,EAAQD,GAExBA,EAAQsE,EAAI3D,OAAO0X,uBAKb,SAAUpY,EAAQD,EAASF,GAGjC,IAAI0W,EAAM1W,EAAoB,IAC9BG,EAAOD,QAAUoM,MAAMkM,SAAW,SAASA,QAAQ1Q,GACjD,MAAmB,SAAZ4O,EAAI5O,KAMP,SAAU3H,EAAQD,EAASF,GAGjC,IAAIwD,EAAWxD,EAAoB,GAC/B0W,EAAM1W,EAAoB,IAC1ByY,EAAQzY,EAAoB,EAApBA,CAAuB,SACnCG,EAAOD,QAAU,SAAUuD,GACzB,IAAIiV,EACJ,OAAOlV,EAASC,MAASiV,EAAWjV,EAAGgV,MAAY5Y,KAAc6Y,EAAsB,UAAXhC,EAAIjT,MAM5E,SAAUtD,EAAQD,EAASF,GAIjC,IAAIwK,EAAUxK,EAAoB,IAC9BkC,EAAUlC,EAAoB,GAC9B+B,EAAW/B,EAAoB,IAC/B8B,EAAO9B,EAAoB,IAC3ByL,EAAYzL,EAAoB,IAChC2Y,EAAc3Y,EAAoB,IAClC4Y,EAAiB5Y,EAAoB,IACrCwG,EAAiBxG,EAAoB,IACrCqO,EAAWrO,EAAoB,EAApBA,CAAuB,YAClC6Y,IAAU,GAAGtP,MAAQ,QAAU,GAAGA,QAGlCuP,EAAS,SAETC,EAAa,WAAc,OAAO/S,MAEtC7F,EAAOD,QAAU,SAAUqT,EAAMrM,EAAM+P,EAAaxG,EAAMuI,EAASC,EAAQC,GACzEP,EAAY1B,EAAa/P,EAAMuJ,GAC/B,IAeI0I,EAAS9W,EAAK+W,EAfdC,EAAY,SAAUC,GACxB,IAAKT,GAASS,KAAQvI,EAAO,OAAOA,EAAMuI,GAC1C,OAAQA,GACN,IAVK,OAUM,OAAO,SAAS/P,OAAS,OAAO,IAAI0N,EAAYjR,KAAMsT,IACjE,KAAKR,EAAQ,OAAO,SAAS1L,SAAW,OAAO,IAAI6J,EAAYjR,KAAMsT,IACrE,OAAO,SAAS/L,UAAY,OAAO,IAAI0J,EAAYjR,KAAMsT,KAEzDhL,EAAMpH,EAAO,YACbqS,EAAaP,GAAWF,EACxBU,GAAa,EACbzI,EAAQwC,EAAK/R,UACbiY,EAAU1I,EAAM1C,IAAa0C,EAnBjB,eAmBuCiI,GAAWjI,EAAMiI,GACpEU,EAAWD,GAAWJ,EAAUL,GAChCW,EAAWX,EAAWO,EAAwBF,EAAU,WAArBK,EAAkC7Z,GACrE+Z,EAAqB,SAAR1S,GAAkB6J,EAAMxD,SAAqBkM,EAwB9D,GArBIG,IACFR,EAAoB5S,EAAeoT,EAAWtZ,KAAK,IAAIiT,OAC7B1S,OAAOW,WAAa4X,EAAkB3I,OAE9DmI,EAAeQ,EAAmB9K,GAAK,GAElC9D,GAAiD,mBAA/B4O,EAAkB/K,IAAyBvM,EAAKsX,EAAmB/K,EAAU0K,IAIpGQ,GAAcE,GAAWA,EAAQ/Y,OAASoY,IAC5CU,GAAa,EACbE,EAAW,SAAStM,SAAW,OAAOqM,EAAQnZ,KAAK0F,QAG/CwE,IAAW0O,IAAYL,IAASW,GAAezI,EAAM1C,IACzDvM,EAAKiP,EAAO1C,EAAUqL,GAGxBjO,EAAUvE,GAAQwS,EAClBjO,EAAU6C,GAAOyK,EACbC,EAMF,GALAG,EAAU,CACR/L,OAAQmM,EAAaG,EAAWL,EAAUP,GAC1CvP,KAAM0P,EAASS,EAAWL,EAhDrB,QAiDL9L,QAASoM,GAEPT,EAAQ,IAAK7W,KAAO8W,EAChB9W,KAAO0O,GAAQhP,EAASgP,EAAO1O,EAAK8W,EAAQ9W,SAC7CH,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAKmW,GAASW,GAAatS,EAAMiS,GAEtE,OAAOA,IAMH,SAAUhZ,EAAQD,EAASF,GAIjC,IAAI8I,EAAS9I,EAAoB,IAC7B6Z,EAAa7Z,EAAoB,IACjC4Y,EAAiB5Y,EAAoB,IACrCoZ,EAAoB,GAGxBpZ,EAAoB,GAApBA,CAAwBoZ,EAAmBpZ,EAAoB,EAApBA,CAAuB,YAAa,WAAc,OAAOgG,OAEpG7F,EAAOD,QAAU,SAAU+W,EAAa/P,EAAMuJ,GAC5CwG,EAAYzV,UAAYsH,EAAOsQ,EAAmB,CAAE3I,KAAMoJ,EAAW,EAAGpJ,KACxEmI,EAAe3B,EAAa/P,EAAO,eAM/B,SAAU/G,EAAQD,EAASF,GAEjC,IAAIqO,EAAWrO,EAAoB,EAApBA,CAAuB,YAClC8Z,GAAe,EAEnB,IACE,IAAIC,EAAQ,CAAC,GAAG1L,KAChB0L,EAAc,UAAI,WAAcD,GAAe,GAE/CxN,MAAM4D,KAAK6J,EAAO,WAAc,MAAM,IACtC,MAAOhW,IAET5D,EAAOD,QAAU,SAAU4D,EAAMkW,GAC/B,IAAKA,IAAgBF,EAAc,OAAO,EAC1C,IAAInU,GAAO,EACX,IACE,IAAIsU,EAAM,CAAC,GACP7F,EAAO6F,EAAI5L,KACf+F,EAAK3D,KAAO,WAAc,MAAO,CAAEC,KAAM/K,GAAO,IAChDsU,EAAI5L,GAAY,WAAc,OAAO+F,GACrCtQ,EAAKmW,GACL,MAAOlW,IACT,OAAO4B,IAMH,SAAUxF,EAAQD,EAASF,GAKjC,IAAIoE,EAAWpE,EAAoB,GACnCG,EAAOD,QAAU,WACf,IAAIsH,EAAOpD,EAAS4B,MAChBmD,EAAS,GAMb,OALI3B,EAAK5F,SAAQuH,GAAU,KACvB3B,EAAK0S,aAAY/Q,GAAU,KAC3B3B,EAAK2S,YAAWhR,GAAU,KAC1B3B,EAAK4S,UAASjR,GAAU,KACxB3B,EAAK6S,SAAQlR,GAAU,KACpBA,IAMH,SAAUhJ,EAAQD,EAASF,GAIjC,IAAI8B,EAAO9B,EAAoB,IAC3B+B,EAAW/B,EAAoB,IAC/B0G,EAAQ1G,EAAoB,GAC5B+E,EAAU/E,EAAoB,IAC9BoL,EAAMpL,EAAoB,GAE9BG,EAAOD,QAAU,SAAUiI,EAAKd,EAAQvD,GACtC,IAAIwW,EAASlP,EAAIjD,GACboS,EAAMzW,EAAKiB,EAASuV,EAAQ,GAAGnS,IAC/BqS,EAAQD,EAAI,GACZE,EAAOF,EAAI,GACX7T,EAAM,WACR,IAAIjC,EAAI,GAER,OADAA,EAAE6V,GAAU,WAAc,OAAO,GACZ,GAAd,GAAGnS,GAAK1D,OAEf1C,EAAS+D,OAAOtE,UAAW2G,EAAKqS,GAChC1Y,EAAK0V,OAAOhW,UAAW8Y,EAAkB,GAAVjT,EAG3B,SAAUR,EAAQiB,GAAO,OAAO2S,EAAKna,KAAKuG,EAAQb,KAAM8B,IAGxD,SAAUjB,GAAU,OAAO4T,EAAKna,KAAKuG,EAAQb,WAQ/C,SAAU7F,EAAQD,EAASF,GAGjC,IAAIoE,EAAWpE,EAAoB,GAC/BsH,EAAYtH,EAAoB,IAChCgX,EAAUhX,EAAoB,EAApBA,CAAuB,WACrCG,EAAOD,QAAU,SAAUuE,EAAGiW,GAC5B,IACIxX,EADAwM,EAAItL,EAASK,GAAGgC,YAEpB,OAAOiJ,IAAM7P,KAAcqD,EAAIkB,EAASsL,GAAGsH,KAAanX,GAAY6a,EAAIpT,EAAUpE,KAM9E,SAAU/C,EAAQD,EAASF,GAEjC,IACI2a,EADS3a,EAAoB,GACV2a,UAEvBxa,EAAOD,QAAUya,GAAaA,EAAUC,WAAa,IAK/C,SAAUza,EAAQD,EAASF,GAIjC,IAAI4B,EAAS5B,EAAoB,GAC7BkC,EAAUlC,EAAoB,GAC9B+B,EAAW/B,EAAoB,IAC/B6K,EAAc7K,EAAoB,IAClC4V,EAAO5V,EAAoB,IAC3B6a,EAAQ7a,EAAoB,IAC5B2K,EAAa3K,EAAoB,IACjCwD,EAAWxD,EAAoB,GAC/B0G,EAAQ1G,EAAoB,GAC5B0L,EAAc1L,EAAoB,IAClC4Y,EAAiB5Y,EAAoB,IACrC8a,EAAoB9a,EAAoB,IAE5CG,EAAOD,QAAU,SAAUgH,EAAMgM,EAASiG,EAAS4B,EAAQvS,EAAQwS,GACjE,IAAIzH,EAAO3R,EAAOsF,GACdwI,EAAI6D,EACJ0H,EAAQzS,EAAS,MAAQ,MACzBuI,EAAQrB,GAAKA,EAAElO,UACfiD,EAAI,GACJyW,EAAY,SAAU/S,GACxB,IAAIZ,EAAKwJ,EAAM5I,GACfpG,EAASgP,EAAO5I,EACP,UAAPA,EAAkB,SAAUvD,GAC1B,QAAOoW,IAAYxX,EAASoB,KAAa2C,EAAGjH,KAAK0F,KAAY,IAANpB,EAAU,EAAIA,IAC5D,OAAPuD,EAAe,SAAShD,IAAIP,GAC9B,QAAOoW,IAAYxX,EAASoB,KAAa2C,EAAGjH,KAAK0F,KAAY,IAANpB,EAAU,EAAIA,IAC5D,OAAPuD,EAAe,SAASlH,IAAI2D,GAC9B,OAAOoW,IAAYxX,EAASoB,GAAK/E,GAAY0H,EAAGjH,KAAK0F,KAAY,IAANpB,EAAU,EAAIA,IAChE,OAAPuD,EAAe,SAASgT,IAAIvW,GAAqC,OAAhC2C,EAAGjH,KAAK0F,KAAY,IAANpB,EAAU,EAAIA,GAAWoB,MACxE,SAASqJ,IAAIzK,EAAG6C,GAAwC,OAAnCF,EAAGjH,KAAK0F,KAAY,IAANpB,EAAU,EAAIA,EAAG6C,GAAWzB,QAGvE,GAAgB,mBAAL0J,IAAqBsL,GAAWjK,EAAMS,UAAY9K,EAAM,YACjE,IAAIgJ,GAAInC,UAAUkD,UAMb,CACL,IAAI2K,EAAW,IAAI1L,EAEf2L,EAAiBD,EAASH,GAAOD,EAAU,IAAM,EAAG,IAAMI,EAE1DE,EAAuB5U,EAAM,WAAc0U,EAASjW,IAAI,KAExDoW,EAAmB7P,EAAY,SAAU0I,GAAQ,IAAI1E,EAAE0E,KAEvDoH,GAAcR,GAAWtU,EAAM,WAIjC,IAFA,IAAI+U,EAAY,IAAI/L,EAChBxG,EAAQ,EACLA,KAASuS,EAAUR,GAAO/R,EAAOA,GACxC,OAAQuS,EAAUtW,KAAK,KAEpBoW,MACH7L,EAAIwD,EAAQ,SAAUjQ,EAAQmT,GAC5BzL,EAAW1H,EAAQyM,EAAGxI,GACtB,IAAIM,EAAOsT,EAAkB,IAAIvH,EAAQtQ,EAAQyM,GAEjD,OADI0G,GAAYvW,IAAWgb,EAAMzE,EAAU5N,EAAQhB,EAAKyT,GAAQzT,GACzDA,KAEPhG,UAAYuP,GACRtK,YAAciJ,IAElB4L,GAAwBE,KAC1BN,EAAU,UACVA,EAAU,OACV1S,GAAU0S,EAAU,SAElBM,GAAcH,IAAgBH,EAAUD,GAExCD,GAAWjK,EAAM2K,cAAc3K,EAAM2K,WApCzChM,EAAIqL,EAAOY,eAAezI,EAAShM,EAAMsB,EAAQyS,GACjDpQ,EAAY6E,EAAElO,UAAW2X,GACzBvD,EAAKC,MAAO,EA4Cd,OAPA+C,EAAelJ,EAAGxI,GAGlBhF,EAAQA,EAAQU,EAAIV,EAAQoB,EAAIpB,EAAQQ,IADxC+B,EAAEyC,GAAQwI,IACwC6D,GAAO9O,GAEpDuW,GAASD,EAAOa,UAAUlM,EAAGxI,EAAMsB,GAEjCkH,IAMH,SAAUvP,EAAQD,EAASF,GAiBjC,IAfA,IASI6b,EATAja,EAAS5B,EAAoB,GAC7B8B,EAAO9B,EAAoB,IAC3BiE,EAAMjE,EAAoB,IAC1B4O,EAAQ3K,EAAI,eACZ4K,EAAO5K,EAAI,QACX6P,KAASlS,EAAO4K,cAAe5K,EAAO8K,UACtCgC,EAASoF,EACT1T,EAAI,EAIJ0b,EAAyB,iHAE3BtW,MAAM,KAEDpF,EAPC,IAQFyb,EAAQja,EAAOka,EAAuB1b,QACxC0B,EAAK+Z,EAAMra,UAAWoN,GAAO,GAC7B9M,EAAK+Z,EAAMra,UAAWqN,GAAM,IACvBH,GAAS,EAGlBvO,EAAOD,QAAU,CACf4T,IAAKA,EACLpF,OAAQA,EACRE,MAAOA,EACPC,KAAMA,IAMF,SAAU1O,EAAQD,EAASF,GAKjCG,EAAOD,QAAUF,EAAoB,MAAQA,EAAoB,EAApBA,CAAuB,WAClE,IAAI+b,EAAInY,KAAK0S,SAGb0F,iBAAiB1b,KAAK,KAAMyb,EAAG,qBACxB/b,EAAoB,GAAG+b,MAM1B,SAAU5b,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAElCG,EAAOD,QAAU,SAAU+b,GACzB/Z,EAAQA,EAAQgB,EAAG+Y,EAAY,CAAErL,GAAI,SAASA,KAG5C,IAFA,IAAIvJ,EAASM,UAAUN,OACnB6U,EAAI,IAAI5P,MAAMjF,GACXA,KAAU6U,EAAE7U,GAAUM,UAAUN,GACvC,OAAO,IAAIrB,KAAKkW,QAOd,SAAU/b,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BsH,EAAYtH,EAAoB,IAChCgC,EAAMhC,EAAoB,IAC1B6a,EAAQ7a,EAAoB,IAEhCG,EAAOD,QAAU,SAAU+b,GACzB/Z,EAAQA,EAAQgB,EAAG+Y,EAAY,CAAE/L,KAAM,SAASA,KAAK9N,GACnD,IACImO,EAAS2L,EAAGhb,EAAGib,EADfC,EAAQzU,UAAU,GAKtB,OAHAL,EAAUtB,OACVuK,EAAU6L,IAAUvc,KACPyH,EAAU8U,GACnBha,GAAUvC,GAAkB,IAAImG,MACpCkW,EAAI,GACA3L,GACFrP,EAAI,EACJib,EAAKna,EAAIoa,EAAOzU,UAAU,GAAI,GAC9BkT,EAAMzY,GAAQ,EAAO,SAAUia,GAC7BH,EAAE9S,KAAK+S,EAAGE,EAAUnb,SAGtB2Z,EAAMzY,GAAQ,EAAO8Z,EAAE9S,KAAM8S,GAExB,IAAIlW,KAAKkW,SAOd,SAAU/b,EAAQD,EAASF,GAEjC,IAAIwD,EAAWxD,EAAoB,GAC/BkK,EAAWlK,EAAoB,GAAGkK,SAElCoS,EAAK9Y,EAAS0G,IAAa1G,EAAS0G,EAASqS,eACjDpc,EAAOD,QAAU,SAAUuD,GACzB,OAAO6Y,EAAKpS,EAASqS,cAAc9Y,GAAM,KAMrC,SAAUtD,EAAQD,EAASF,GAEjC,IAAI4B,EAAS5B,EAAoB,GAC7B6B,EAAO7B,EAAoB,IAC3BwK,EAAUxK,EAAoB,IAC9Bwc,EAASxc,EAAoB,IAC7Bc,EAAiBd,EAAoB,GAAGwE,EAC5CrE,EAAOD,QAAU,SAAUQ,GACzB,IAAI+b,EAAU5a,EAAKqC,SAAWrC,EAAKqC,OAASsG,EAAU,GAAK5I,EAAOsC,QAAU,IACtD,KAAlBxD,EAAKgc,OAAO,IAAehc,KAAQ+b,GAAU3b,EAAe2b,EAAS/b,EAAM,CAAEiE,MAAO6X,EAAOhY,EAAE9D,OAM7F,SAAUP,EAAQD,EAASF,GAEjC,IAAI0U,EAAS1U,EAAoB,GAApBA,CAAwB,QACjCiE,EAAMjE,EAAoB,IAC9BG,EAAOD,QAAU,SAAUmC,GACzB,OAAOqS,EAAOrS,KAASqS,EAAOrS,GAAO4B,EAAI5B,MAMrC,SAAUlC,EAAQD,GAGxBC,EAAOD,QAAU,gGAEfsF,MAAM,MAKF,SAAUrF,EAAQD,EAASF,GAEjC,IAAIkK,EAAWlK,EAAoB,GAAGkK,SACtC/J,EAAOD,QAAUgK,GAAYA,EAASyS,iBAKhC,SAAUxc,EAAQD,EAASF,GAKjC,IAAI4c,EAAU5c,EAAoB,IAC9B6c,EAAO7c,EAAoB,IAC3BiG,EAAMjG,EAAoB,IAC1BqG,EAAWrG,EAAoB,GAC/BgF,EAAUhF,EAAoB,IAC9B8c,EAAUjc,OAAOkc,OAGrB5c,EAAOD,SAAW4c,GAAW9c,EAAoB,EAApBA,CAAuB,WAClD,IAAIkc,EAAI,GACJlZ,EAAI,GAEJE,EAAIgB,SACJ6X,EAAI,uBAGR,OAFAG,EAAEhZ,GAAK,EACP6Y,EAAEvW,MAAM,IAAIgM,QAAQ,SAAUwL,GAAKha,EAAEga,GAAKA,IACd,GAArBF,EAAQ,GAAIZ,GAAGhZ,IAAWrC,OAAO0I,KAAKuT,EAAQ,GAAI9Z,IAAI6C,KAAK,KAAOkW,IACtE,SAASgB,OAAO9Z,EAAQb,GAM3B,IALA,IAAIwU,EAAIvQ,EAASpD,GACboN,EAAO1I,UAAUN,OACjB6B,EAAQ,EACR+T,EAAaJ,EAAKrY,EAClB0Y,EAASjX,EAAIzB,EACH0E,EAAPmH,GAML,IALA,IAIIhO,EAJAa,EAAI8B,EAAQ2C,UAAUuB,MACtBK,EAAO0T,EAAaL,EAAQ1Z,GAAGmR,OAAO4I,EAAW/Z,IAAM0Z,EAAQ1Z,GAC/DmE,EAASkC,EAAKlC,OACd8V,EAAI,EAEQA,EAAT9V,GAAgB6V,EAAO5c,KAAK4C,EAAGb,EAAMkH,EAAK4T,QAAOvG,EAAEvU,GAAOa,EAAEb,IACnE,OAAOuU,GACPkG,GAKE,SAAU3c,EAAQD,EAASF,GAIjC,IAAIwD,EAAWxD,EAAoB,GAC/BoE,EAAWpE,EAAoB,GAC/Bod,EAAQ,SAAU3Y,EAAGsM,GAEvB,GADA3M,EAASK,IACJjB,EAASuN,IAAoB,OAAVA,EAAgB,MAAMrN,UAAUqN,EAAQ,8BAElE5Q,EAAOD,QAAU,CACfmP,IAAKxO,OAAOwc,iBAAmB,aAAe,GAC5C,SAAUlW,EAAMmW,EAAOjO,GACrB,KACEA,EAAMrP,EAAoB,GAApBA,CAAwBoD,SAAS9C,KAAMN,EAAoB,IAAIwE,EAAE3D,OAAOW,UAAW,aAAa6N,IAAK,IACvGlI,EAAM,IACVmW,IAAUnW,aAAgBmF,OAC1B,MAAOvI,GAAKuZ,GAAQ,EACtB,OAAO,SAASD,eAAe5Y,EAAGsM,GAIhC,OAHAqM,EAAM3Y,EAAGsM,GACLuM,EAAO7Y,EAAE8Y,UAAYxM,EACpB1B,EAAI5K,EAAGsM,GACLtM,GAVX,CAYE,IAAI,GAAS5E,IACjBud,MAAOA,IAMH,SAAUjd,EAAQD,GAGxBC,EAAOD,QAAU,SAAUqH,EAAIiW,EAAMhW,GACnC,IAAIiW,EAAKjW,IAAS3H,GAClB,OAAQ2d,EAAKnW,QACX,KAAK,EAAG,OAAOoW,EAAKlW,IACAA,EAAGjH,KAAKkH,GAC5B,KAAK,EAAG,OAAOiW,EAAKlW,EAAGiW,EAAK,IACRjW,EAAGjH,KAAKkH,EAAMgW,EAAK,IACvC,KAAK,EAAG,OAAOC,EAAKlW,EAAGiW,EAAK,GAAIA,EAAK,IACjBjW,EAAGjH,KAAKkH,EAAMgW,EAAK,GAAIA,EAAK,IAChD,KAAK,EAAG,OAAOC,EAAKlW,EAAGiW,EAAK,GAAIA,EAAK,GAAIA,EAAK,IAC1BjW,EAAGjH,KAAKkH,EAAMgW,EAAK,GAAIA,EAAK,GAAIA,EAAK,IACzD,KAAK,EAAG,OAAOC,EAAKlW,EAAGiW,EAAK,GAAIA,EAAK,GAAIA,EAAK,GAAIA,EAAK,IACnCjW,EAAGjH,KAAKkH,EAAMgW,EAAK,GAAIA,EAAK,GAAIA,EAAK,GAAIA,EAAK,IAClE,OAAOjW,EAAGG,MAAMF,EAAMgW,KAMpB,SAAUrd,EAAQD,EAASF,GAEjC,IAAIwD,EAAWxD,EAAoB,GAC/Bqd,EAAiBrd,EAAoB,IAAIqP,IAC7ClP,EAAOD,QAAU,SAAUsH,EAAMvE,EAAQyM,GACvC,IACI5M,EADAI,EAAID,EAAOwD,YAIb,OAFEvD,IAAMwM,GAAiB,mBAALxM,IAAoBJ,EAAII,EAAE1B,aAAekO,EAAElO,WAAagC,EAASV,IAAMua,GAC3FA,EAAe7V,EAAM1E,GACd0E,IAML,SAAUrH,EAAQD,GAExBC,EAAOD,QAAU,oDAMX,SAAUC,EAAQD,EAASF,GAIjC,IAAI6E,EAAY7E,EAAoB,IAChC+E,EAAU/E,EAAoB,IAElCG,EAAOD,QAAU,SAASwd,OAAOC,GAC/B,IAAIC,EAAM9X,OAAOf,EAAQiB,OACrBiD,EAAM,GACN/H,EAAI2D,EAAU8Y,GAClB,GAAIzc,EAAI,GAAKA,GAAK2c,SAAU,MAAM7R,WAAW,2BAC7C,KAAU,EAAJ9K,GAAQA,KAAO,KAAO0c,GAAOA,GAAc,EAAJ1c,IAAO+H,GAAO2U,GAC3D,OAAO3U,IAMH,SAAU9I,EAAQD,GAGxBC,EAAOD,QAAU0D,KAAKka,MAAQ,SAASA,KAAKC,GAE1C,OAAmB,IAAXA,GAAKA,IAAWA,GAAKA,EAAIA,EAAIA,EAAI,GAAK,EAAI,IAM9C,SAAU5d,EAAQD,GAGxB,IAAI8d,EAASpa,KAAKqa,MAClB9d,EAAOD,SAAY8d,GAED,mBAAbA,EAAO,KAA4BA,EAAO,IAAM,qBAE7B,OAAnBA,GAAQ,OACT,SAASC,MAAMF,GACjB,OAAmB,IAAXA,GAAKA,GAAUA,GAAS,KAALA,GAAaA,EAAI,KAAOA,EAAIA,EAAIA,EAAI,EAAIna,KAAKpB,IAAIub,GAAK,GAC/EC,GAKE,SAAU7d,EAAQD,EAASF,GAEjC,IAAI6E,EAAY7E,EAAoB,IAChC+E,EAAU/E,EAAoB,IAGlCG,EAAOD,QAAU,SAAUmF,GACzB,OAAO,SAAUmC,EAAM0W,GACrB,IAGItZ,EAAG6C,EAHH9F,EAAImE,OAAOf,EAAQyC,IACnBpH,EAAIyE,EAAUqZ,GACd7d,EAAIsB,EAAE0F,OAEV,OAAIjH,EAAI,GAAUC,GAALD,EAAeiF,EAAY,GAAKxF,IAC7C+E,EAAIjD,EAAEwc,WAAW/d,IACN,OAAc,MAAJwE,GAAcxE,EAAI,IAAMC,IAAMoH,EAAI9F,EAAEwc,WAAW/d,EAAI,IAAM,OAAc,MAAJqH,EACpFpC,EAAY1D,EAAE+a,OAAOtc,GAAKwE,EAC1BS,EAAY1D,EAAEiG,MAAMxH,EAAGA,EAAI,GAA2BqH,EAAI,OAAzB7C,EAAI,OAAU,IAAqB,SAOtE,SAAUzE,EAAQD,EAASF,GAGjC,IAAI0Y,EAAW1Y,EAAoB,IAC/B+E,EAAU/E,EAAoB,IAElCG,EAAOD,QAAU,SAAUsH,EAAM4W,EAAclX,GAC7C,GAAIwR,EAAS0F,GAAe,MAAM1a,UAAU,UAAYwD,EAAO,0BAC/D,OAAOpB,OAAOf,EAAQyC,MAMlB,SAAUrH,EAAQD,EAASF,GAEjC,IAAIyY,EAAQzY,EAAoB,EAApBA,CAAuB,SACnCG,EAAOD,QAAU,SAAUiI,GACzB,IAAIkW,EAAK,IACT,IACE,MAAMlW,GAAKkW,GACX,MAAOta,GACP,IAEE,OADAsa,EAAG5F,IAAS,GACJ,MAAMtQ,GAAKkW,GACnB,MAAO7Z,KACT,OAAO,IAML,SAAUrE,EAAQD,EAASF,GAGjC,IAAIyL,EAAYzL,EAAoB,IAChCqO,EAAWrO,EAAoB,EAApBA,CAAuB,YAClCqM,EAAaC,MAAM9K,UAEvBrB,EAAOD,QAAU,SAAUuD,GACzB,OAAOA,IAAO5D,KAAc4L,EAAUa,QAAU7I,GAAM4I,EAAWgC,KAAc5K,KAM3E,SAAUtD,EAAQD,EAASF,GAIjC,IAAIse,EAAkBte,EAAoB,GACtCkF,EAAalF,EAAoB,IAErCG,EAAOD,QAAU,SAAUoB,EAAQ4H,EAAOvE,GACpCuE,KAAS5H,EAAQgd,EAAgB9Z,EAAElD,EAAQ4H,EAAOhE,EAAW,EAAGP,IAC/DrD,EAAO4H,GAASvE,IAMjB,SAAUxE,EAAQD,EAASF,GAGjC,IAAIuL,EAAqBvL,EAAoB,KAE7CG,EAAOD,QAAU,SAAUqe,EAAUlX,GACnC,OAAO,IAAKkE,EAAmBgT,GAAxB,CAAmClX,KAMtC,SAAUlH,EAAQD,EAASF,GAKjC,IAAIqG,EAAWrG,EAAoB,GAC/B+K,EAAkB/K,EAAoB,IACtCoI,EAAWpI,EAAoB,GACnCG,EAAOD,QAAU,SAASiR,KAAKxM,GAO7B,IANA,IAAIF,EAAI4B,EAASL,MACbqB,EAASe,EAAS3D,EAAE4C,QACpBgJ,EAAO1I,UAAUN,OACjB6B,EAAQ6B,EAAuB,EAAPsF,EAAW1I,UAAU,GAAK9H,GAAWwH,GAC7D+K,EAAa,EAAP/B,EAAW1I,UAAU,GAAK9H,GAChC2e,EAASpM,IAAQvS,GAAYwH,EAAS0D,EAAgBqH,EAAK/K,GAC/C6B,EAATsV,GAAgB/Z,EAAEyE,KAAWvE,EACpC,OAAOF,IAMH,SAAUtE,EAAQD,EAASF,GAIjC,IAAIye,EAAmBze,EAAoB,IACvCmQ,EAAOnQ,EAAoB,IAC3ByL,EAAYzL,EAAoB,IAChCkG,EAAYlG,EAAoB,IAMpCG,EAAOD,QAAUF,EAAoB,GAApBA,CAAwBsM,MAAO,QAAS,SAAUoS,EAAUpF,GAC3EtT,KAAK8R,GAAK5R,EAAUwY,GACpB1Y,KAAK2Y,GAAK,EACV3Y,KAAK4Y,GAAKtF,GAET,WACD,IAAI7U,EAAIuB,KAAK8R,GACTwB,EAAOtT,KAAK4Y,GACZ1V,EAAQlD,KAAK2Y,KACjB,OAAKla,GAAcA,EAAE4C,QAAX6B,GACRlD,KAAK8R,GAAKjY,GACHsQ,EAAK,IAEaA,EAAK,EAApB,QAARmJ,EAA+BpQ,EACvB,UAARoQ,EAAiC7U,EAAEyE,GACxB,CAACA,EAAOzE,EAAEyE,MACxB,UAGHuC,EAAUoT,UAAYpT,EAAUa,MAEhCmS,EAAiB,QACjBA,EAAiB,UACjBA,EAAiB,YAKX,SAAUte,EAAQD,GAExBC,EAAOD,QAAU,SAAUwQ,EAAM/L,GAC/B,MAAO,CAAEA,MAAOA,EAAO+L,OAAQA,KAM3B,SAAUvQ,EAAQD,EAASF,GAEjC,IAaI8e,EAAOC,EAASC,EAbhBhd,EAAMhC,EAAoB,IAC1Bif,EAASjf,EAAoB,IAC7Bkf,EAAOlf,EAAoB,IAC3Bmf,EAAMnf,EAAoB,IAC1B4B,EAAS5B,EAAoB,GAC7Bof,EAAUxd,EAAOwd,QACjBC,EAAUzd,EAAO0d,aACjBC,EAAY3d,EAAO4d,eACnBC,EAAiB7d,EAAO6d,eACxBC,EAAW9d,EAAO8d,SAClBC,EAAU,EACVC,EAAQ,GACRC,EAAqB,qBAErBC,EAAM,WACR,IAAIxK,GAAMtP,KAEV,GAAI4Z,EAAMne,eAAe6T,GAAK,CAC5B,IAAI/N,EAAKqY,EAAMtK,UACRsK,EAAMtK,GACb/N,MAGAwY,EAAW,SAAUC,GACvBF,EAAIxf,KAAK0f,EAAMrM,OAGZ0L,GAAYE,IACfF,EAAU,SAASC,aAAa/X,GAG9B,IAFA,IAAIiW,EAAO,GACPpd,EAAI,EACkBA,EAAnBuH,UAAUN,QAAYmW,EAAKpU,KAAKzB,UAAUvH,MAMjD,OALAwf,IAAQD,GAAW,WAEjBV,EAAoB,mBAAN1X,EAAmBA,EAAKnE,SAASmE,GAAKiW,IAEtDsB,EAAMa,GACCA,GAETJ,EAAY,SAASC,eAAelK,UAC3BsK,EAAMtK,IAGyB,WAApCtV,EAAoB,GAApBA,CAAwBof,GAC1BN,EAAQ,SAAUxJ,GAChB8J,EAAQa,SAASje,EAAI8d,EAAKxK,EAAI,KAGvBoK,GAAYA,EAASQ,IAC9BpB,EAAQ,SAAUxJ,GAChBoK,EAASQ,IAAIle,EAAI8d,EAAKxK,EAAI,KAGnBmK,GAETT,GADAD,EAAU,IAAIU,GACCU,MACfpB,EAAQqB,MAAMC,UAAYN,EAC1BjB,EAAQ9c,EAAIgd,EAAKsB,YAAatB,EAAM,IAG3Bpd,EAAO2e,kBAA0C,mBAAfD,cAA8B1e,EAAO4e,eAChF1B,EAAQ,SAAUxJ,GAChB1T,EAAO0e,YAAYhL,EAAK,GAAI,MAE9B1T,EAAO2e,iBAAiB,UAAWR,GAAU,IAG7CjB,EADSe,KAAsBV,EAAI,UAC3B,SAAU7J,GAChB4J,EAAKnV,YAAYoV,EAAI,WAAWU,GAAsB,WACpDX,EAAKuB,YAAYza,MACjB8Z,EAAIxf,KAAKgV,KAKL,SAAUA,GAChBoL,WAAW1e,EAAI8d,EAAKxK,EAAI,GAAI,KAIlCnV,EAAOD,QAAU,CACfmP,IAAKgQ,EACL3D,MAAO6D,IAMH,SAAUpf,EAAQD,EAASF,GAEjC,IAAI4B,EAAS5B,EAAoB,GAC7B2gB,EAAY3gB,EAAoB,IAAIqP,IACpCuR,EAAWhf,EAAOif,kBAAoBjf,EAAOkf,uBAC7C1B,EAAUxd,EAAOwd,QACjB2B,EAAUnf,EAAOmf,QACjBC,EAA6C,WAApChhB,EAAoB,GAApBA,CAAwBof,GAErCjf,EAAOD,QAAU,WACf,IAAI+gB,EAAMC,EAAMC,EAEZC,EAAQ,WACV,IAAIC,EAAQ9Z,EAEZ,IADIyZ,IAAWK,EAASjC,EAAQkC,SAASD,EAAOE,OACzCN,GAAM,CACX1Z,EAAK0Z,EAAK1Z,GACV0Z,EAAOA,EAAKxQ,KACZ,IACElJ,IACA,MAAOxD,GAGP,MAFIkd,EAAME,IACLD,EAAOrhB,GACNkE,GAERmd,EAAOrhB,GACLwhB,GAAQA,EAAOG,SAIrB,GAAIR,EACFG,EAAS,WACP/B,EAAQa,SAASmB,SAGd,IAAIR,GAAchf,EAAO+Y,WAAa/Y,EAAO+Y,UAAU8G,WAQvD,GAAIV,GAAWA,EAAQW,QAAS,CAErC,IAAIC,EAAUZ,EAAQW,QAAQ7hB,IAC9BshB,EAAS,WACPQ,EAAQC,KAAKR,SASfD,EAAS,WAEPR,EAAUrgB,KAAKsB,EAAQwf,QAvBgD,CACzE,IAAIS,GAAS,EACTC,EAAO5X,SAAS6X,eAAe,IACnC,IAAInB,EAASQ,GAAOY,QAAQF,EAAM,CAAEG,eAAe,IACnDd,EAAS,WACPW,EAAKnO,KAAOkO,GAAUA,GAsB1B,OAAO,SAAUta,GACf,IAAI2a,EAAO,CAAE3a,GAAIA,EAAIkJ,KAAM5Q,IACvBqhB,IAAMA,EAAKzQ,KAAOyR,GACjBjB,IACHA,EAAOiB,EACPf,KACAD,EAAOgB,KAOP,SAAU/hB,EAAQD,EAASF,GAKjC,IAAIsH,EAAYtH,EAAoB,IAEpC,SAASmiB,kBAAkBzS,GACzB,IAAIgS,EAASU,EACbpc,KAAK2b,QAAU,IAAIjS,EAAE,SAAU2S,EAAWC,GACxC,GAAIZ,IAAY7hB,IAAauiB,IAAWviB,GAAW,MAAM6D,UAAU,2BACnEge,EAAUW,EACVD,EAASE,IAEXtc,KAAK0b,QAAUpa,EAAUoa,GACzB1b,KAAKoc,OAAS9a,EAAU8a,GAG1BjiB,EAAOD,QAAQsE,EAAI,SAAUkL,GAC3B,OAAO,IAAIyS,kBAAkBzS,KAMzB,SAAUvP,EAAQD,EAASF,GAGjC,IAAIkL,EAAOlL,EAAoB,IAC3B6c,EAAO7c,EAAoB,IAC3BoE,EAAWpE,EAAoB,GAC/BuiB,EAAUviB,EAAoB,GAAGuiB,QACrCpiB,EAAOD,QAAUqiB,GAAWA,EAAQC,SAAW,SAASA,QAAQ/e,GAC9D,IAAI8F,EAAO2B,EAAK1G,EAAEJ,EAASX,IACvBwZ,EAAaJ,EAAKrY,EACtB,OAAOyY,EAAa1T,EAAK8K,OAAO4I,EAAWxZ,IAAO8F,IAM9C,SAAUpJ,EAAQD,EAASF,GAIjC,IAAI4B,EAAS5B,EAAoB,GAC7B+W,EAAc/W,EAAoB,GAClCwK,EAAUxK,EAAoB,IAC9ByK,EAASzK,EAAoB,IAC7B8B,EAAO9B,EAAoB,IAC3B6K,EAAc7K,EAAoB,IAClC0G,EAAQ1G,EAAoB,GAC5B2K,EAAa3K,EAAoB,IACjC6E,EAAY7E,EAAoB,IAChCoI,EAAWpI,EAAoB,GAC/B8K,EAAU9K,EAAoB,KAC9BkL,EAAOlL,EAAoB,IAAIwE,EAC/BD,EAAKvE,EAAoB,GAAGwE,EAC5BoH,EAAY5L,EAAoB,IAChC4Y,EAAiB5Y,EAAoB,IACrCkM,EAAe,cACfuW,EAAY,WACZxgB,EAAY,YAEZygB,EAAc,eACdnW,EAAe3K,EAAOsK,GACtBO,EAAY7K,EAAO6gB,GACnB7e,EAAOhC,EAAOgC,KACdoI,EAAapK,EAAOoK,WAEpB6R,EAAWjc,EAAOic,SAClB8E,EAAapW,EACbqW,EAAMhf,EAAKgf,IACXC,EAAMjf,EAAKif,IACX5a,EAAQrE,EAAKqE,MACb6a,EAAMlf,EAAKkf,IACXC,EAAMnf,EAAKmf,IAEXC,EAAc,aACdC,EAAc,aACdC,EAAUnM,EAAc,KAHf,SAIToM,EAAUpM,EAAc,KAAOiM,EAC/BI,EAAUrM,EAAc,KAAOkM,EAGnC,SAASI,YAAY1e,EAAO2e,EAAMC,GAChC,IAOIxf,EAAGxD,EAAGC,EAPN2O,EAAS,IAAI7C,MAAMiX,GACnBC,EAAgB,EAATD,EAAaD,EAAO,EAC3BG,GAAQ,GAAKD,GAAQ,EACrBE,EAAQD,GAAQ,EAChBE,EAAc,KAATL,EAAcT,EAAI,GAAI,IAAMA,EAAI,GAAI,IAAM,EAC/CziB,EAAI,EACJuB,EAAIgD,EAAQ,GAAe,IAAVA,GAAe,EAAIA,EAAQ,EAAI,EAAI,EAkCxD,KAhCAA,EAAQie,EAAIje,KAECA,GAASA,IAAUkZ,GAE9Btd,EAAIoE,GAASA,EAAQ,EAAI,EACzBZ,EAAI0f,IAEJ1f,EAAIkE,EAAM6a,EAAIne,GAASoe,GACnBpe,GAASnE,EAAIqiB,EAAI,GAAI9e,IAAM,IAC7BA,IACAvD,GAAK,GAOU,IAJfmE,GADe,GAAbZ,EAAI2f,EACGC,EAAKnjB,EAELmjB,EAAKd,EAAI,EAAG,EAAIa,IAEfljB,IACVuD,IACAvD,GAAK,GAEUijB,GAAb1f,EAAI2f,GACNnjB,EAAI,EACJwD,EAAI0f,GACkB,GAAb1f,EAAI2f,GACbnjB,GAAKoE,EAAQnE,EAAI,GAAKqiB,EAAI,EAAGS,GAC7Bvf,GAAQ2f,IAERnjB,EAAIoE,EAAQke,EAAI,EAAGa,EAAQ,GAAKb,EAAI,EAAGS,GACvCvf,EAAI,IAGO,GAARuf,EAAWnU,EAAO/O,KAAW,IAAJG,EAASA,GAAK,IAAK+iB,GAAQ,GAG3D,IAFAvf,EAAIA,GAAKuf,EAAO/iB,EAChBijB,GAAQF,EACM,EAAPE,EAAUrU,EAAO/O,KAAW,IAAJ2D,EAASA,GAAK,IAAKyf,GAAQ,GAE1D,OADArU,IAAS/O,IAAU,IAAJuB,EACRwN,EAET,SAASyU,cAAczU,EAAQmU,EAAMC,GACnC,IAOIhjB,EAPAijB,EAAgB,EAATD,EAAaD,EAAO,EAC3BG,GAAQ,GAAKD,GAAQ,EACrBE,EAAQD,GAAQ,EAChBI,EAAQL,EAAO,EACfpjB,EAAImjB,EAAS,EACb5hB,EAAIwN,EAAO/O,KACX2D,EAAQ,IAAJpC,EAGR,IADAA,IAAM,EACS,EAARkiB,EAAW9f,EAAQ,IAAJA,EAAUoL,EAAO/O,GAAIA,IAAKyjB,GAAS,GAIzD,IAHAtjB,EAAIwD,GAAK,IAAM8f,GAAS,EACxB9f,KAAO8f,EACPA,GAASP,EACM,EAARO,EAAWtjB,EAAQ,IAAJA,EAAU4O,EAAO/O,GAAIA,IAAKyjB,GAAS,GACzD,GAAU,IAAN9f,EACFA,EAAI,EAAI2f,MACH,CAAA,GAAI3f,IAAM0f,EACf,OAAOljB,EAAIujB,IAAMniB,GAAKkc,EAAWA,EAEjCtd,GAAQsiB,EAAI,EAAGS,GACfvf,GAAQ2f,EACR,OAAQ/hB,GAAK,EAAI,GAAKpB,EAAIsiB,EAAI,EAAG9e,EAAIuf,GAGzC,SAASS,UAAUC,GACjB,OAAOA,EAAM,IAAM,GAAKA,EAAM,IAAM,GAAKA,EAAM,IAAM,EAAIA,EAAM,GAEjE,SAASC,OAAOxgB,GACd,MAAO,CAAM,IAALA,GAEV,SAASygB,QAAQzgB,GACf,MAAO,CAAM,IAALA,EAAWA,GAAM,EAAI,KAE/B,SAAS0gB,QAAQ1gB,GACf,MAAO,CAAM,IAALA,EAAWA,GAAM,EAAI,IAAMA,GAAM,GAAK,IAAMA,GAAM,GAAK,KAEjE,SAAS2gB,QAAQ3gB,GACf,OAAO4f,YAAY5f,EAAI,GAAI,GAE7B,SAAS4gB,QAAQ5gB,GACf,OAAO4f,YAAY5f,EAAI,GAAI,GAG7B,SAASqM,UAAUJ,EAAGrN,EAAK0N,GACzBxL,EAAGmL,EAAEzN,GAAYI,EAAK,CAAEpB,IAAK,WAAc,OAAO+E,KAAK+J,MAGzD,SAAS9O,IAAIqjB,EAAMN,EAAO9a,EAAOqb,GAC/B,IACIC,EAAW1Z,GADC5B,GAEhB,GAAuBob,EAAKnB,GAAxBqB,EAAWR,EAAuB,MAAMhY,EAAW0W,GACvD,IACIzR,EAAQuT,EAAWF,EAAKlB,GACxBqB,EAFQH,EAAKpB,GAASwB,GAET9c,MAAMqJ,EAAOA,EAAQ+S,GACtC,OAAOO,EAAiBE,EAAOA,EAAK3S,UAEtC,SAASzC,IAAIiV,EAAMN,EAAO9a,EAAOyb,EAAYhgB,EAAO4f,GAClD,IACIC,EAAW1Z,GADC5B,GAEhB,GAAuBob,EAAKnB,GAAxBqB,EAAWR,EAAuB,MAAMhY,EAAW0W,GAIvD,IAHA,IAAI1e,EAAQsgB,EAAKpB,GAASwB,GACtBzT,EAAQuT,EAAWF,EAAKlB,GACxBqB,EAAOE,GAAYhgB,GACdvE,EAAI,EAAGA,EAAI4jB,EAAO5jB,IAAK4D,EAAMiN,EAAQ7Q,GAAKqkB,EAAKF,EAAiBnkB,EAAI4jB,EAAQ5jB,EAAI,GAG3F,GAAKqK,EAAOqJ,IAgFL,CACL,IAAKpN,EAAM,WACT6F,EAAa,OACR7F,EAAM,WACX,IAAI6F,GAAc,MACd7F,EAAM,WAIV,OAHA,IAAI6F,EACJ,IAAIA,EAAa,KACjB,IAAIA,EAAauX,KACVvX,EAAa7L,MAAQwL,IAC1B,CAMF,IADA,IACyC7J,EADrCuiB,GAJJrY,EAAe,SAASC,YAAYnF,GAElC,OADAsD,EAAW3E,KAAMuG,GACV,IAAIoW,EAAW7X,EAAQzD,MAEIpF,GAAa0gB,EAAW1gB,GACnDsH,EAAO2B,EAAKyX,GAAaxF,EAAI,EAAsBA,EAAd5T,EAAKlC,SAC1ChF,EAAMkH,EAAK4T,QAAS5Q,GAAezK,EAAKyK,EAAclK,EAAKsgB,EAAWtgB,IAE1EmI,IAASoa,EAAiBne,YAAc8F,GAG/C,IAAI+X,EAAO,IAAI7X,EAAU,IAAIF,EAAa,IACtCsY,EAAWpY,EAAUxK,GAAW6iB,QACpCR,EAAKQ,QAAQ,EAAG,YAChBR,EAAKQ,QAAQ,EAAG,aACZR,EAAKS,QAAQ,IAAOT,EAAKS,QAAQ,IAAIla,EAAY4B,EAAUxK,GAAY,CACzE6iB,QAAS,SAASA,QAAQxS,EAAY3N,GACpCkgB,EAASvkB,KAAK0F,KAAMsM,EAAY3N,GAAS,IAAM,KAEjDqgB,SAAU,SAASA,SAAS1S,EAAY3N,GACtCkgB,EAASvkB,KAAK0F,KAAMsM,EAAY3N,GAAS,IAAM,OAEhD,QAhHH4H,EAAe,SAASC,YAAYnF,GAClCsD,EAAW3E,KAAMuG,EAAcL,GAC/B,IAAI+H,EAAanJ,EAAQzD,GACzBrB,KAAK0e,GAAK9Y,EAAUtL,KAAK,IAAIgM,MAAM2H,GAAa,GAChDjO,KAAKmd,GAAWlP,GAGlBxH,EAAY,SAASC,SAASyC,EAAQmD,EAAY2B,GAChDtJ,EAAW3E,KAAMyG,EAAWgW,GAC5B9X,EAAWwE,EAAQ5C,EAAckW,GACjC,IAAIwC,EAAe9V,EAAOgU,GACtB3T,EAAS3K,EAAUyN,GACvB,GAAI9C,EAAS,GAAcyV,EAATzV,EAAuB,MAAMxD,EAAW,iBAE1D,GAA0BiZ,EAAtBzV,GADJyE,EAAaA,IAAepU,GAAYolB,EAAezV,EAASpH,EAAS6L,IACjC,MAAMjI,EAxJ/B,iBAyJfhG,KAAKkd,GAAW/T,EAChBnJ,KAAKod,GAAW5T,EAChBxJ,KAAKmd,GAAWlP,GAGd8C,IACFjH,UAAUvD,EAAcyW,EAAa,MACrClT,UAAUrD,EAlJD,SAkJoB,MAC7BqD,UAAUrD,EAAWuW,EAAa,MAClClT,UAAUrD,EAAWwW,EAAa,OAGpCpY,EAAY4B,EAAUxK,GAAY,CAChC8iB,QAAS,SAASA,QAAQzS,GACxB,OAAOrR,IAAI+E,KAAM,EAAGsM,GAAY,IAAM,IAAM,IAE9C4S,SAAU,SAASA,SAAS5S,GAC1B,OAAOrR,IAAI+E,KAAM,EAAGsM,GAAY,IAElC6S,SAAU,SAASA,SAAS7S,GAC1B,IAAI0R,EAAQ/iB,IAAI+E,KAAM,EAAGsM,EAAY3K,UAAU,IAC/C,OAAQqc,EAAM,IAAM,EAAIA,EAAM,KAAO,IAAM,IAE7CoB,UAAW,SAASA,UAAU9S,GAC5B,IAAI0R,EAAQ/iB,IAAI+E,KAAM,EAAGsM,EAAY3K,UAAU,IAC/C,OAAOqc,EAAM,IAAM,EAAIA,EAAM,IAE/BqB,SAAU,SAASA,SAAS/S,GAC1B,OAAOyR,UAAU9iB,IAAI+E,KAAM,EAAGsM,EAAY3K,UAAU,MAEtD2d,UAAW,SAASA,UAAUhT,GAC5B,OAAOyR,UAAU9iB,IAAI+E,KAAM,EAAGsM,EAAY3K,UAAU,OAAS,GAE/D4d,WAAY,SAASA,WAAWjT,GAC9B,OAAOsR,cAAc3iB,IAAI+E,KAAM,EAAGsM,EAAY3K,UAAU,IAAK,GAAI,IAEnE6d,WAAY,SAASA,WAAWlT,GAC9B,OAAOsR,cAAc3iB,IAAI+E,KAAM,EAAGsM,EAAY3K,UAAU,IAAK,GAAI,IAEnEmd,QAAS,SAASA,QAAQxS,EAAY3N,GACpC0K,IAAIrJ,KAAM,EAAGsM,EAAY2R,OAAQtf,IAEnCqgB,SAAU,SAASA,SAAS1S,EAAY3N,GACtC0K,IAAIrJ,KAAM,EAAGsM,EAAY2R,OAAQtf,IAEnC8gB,SAAU,SAASA,SAASnT,EAAY3N,GACtC0K,IAAIrJ,KAAM,EAAGsM,EAAY4R,QAASvf,EAAOgD,UAAU,KAErD+d,UAAW,SAASA,UAAUpT,EAAY3N,GACxC0K,IAAIrJ,KAAM,EAAGsM,EAAY4R,QAASvf,EAAOgD,UAAU,KAErDge,SAAU,SAASA,SAASrT,EAAY3N,GACtC0K,IAAIrJ,KAAM,EAAGsM,EAAY6R,QAASxf,EAAOgD,UAAU,KAErDie,UAAW,SAASA,UAAUtT,EAAY3N,GACxC0K,IAAIrJ,KAAM,EAAGsM,EAAY6R,QAASxf,EAAOgD,UAAU,KAErDke,WAAY,SAASA,WAAWvT,EAAY3N,GAC1C0K,IAAIrJ,KAAM,EAAGsM,EAAY+R,QAAS1f,EAAOgD,UAAU,KAErDme,WAAY,SAASA,WAAWxT,EAAY3N,GAC1C0K,IAAIrJ,KAAM,EAAGsM,EAAY8R,QAASzf,EAAOgD,UAAU,OAsCzDiR,EAAerM,EAAcL,GAC7B0M,EAAenM,EAAWgW,GAC1B3gB,EAAK2K,EAAUxK,GAAYwI,EAAOoE,MAAM,GACxC3O,EAAQgM,GAAgBK,EACxBrM,EAAQuiB,GAAahW,GAKf,SAAUtM,EAAQD,GAExBC,EAAOD,QAAU,SAAU6lB,EAAQ9e,GACjC,IAAI+e,EAAW/e,IAAYpG,OAAOoG,GAAW,SAAUgf,GACrD,OAAOhf,EAAQgf,IACbhf,EACJ,OAAO,SAAUxD,GACf,OAAOqC,OAAOrC,GAAIwD,QAAQ8e,EAAQC,MAOhC,SAAU7lB,EAAQD,EAASF,GAEjCG,EAAOD,SAAWF,EAAoB,KAAOA,EAAoB,EAApBA,CAAuB,WAClE,OAA2G,GAApGa,OAAOC,eAAed,EAAoB,GAApBA,CAAwB,OAAQ,IAAK,CAAEiB,IAAK,WAAc,OAAO,KAAQ2D,KAMlG,SAAUzE,EAAQD,EAASF,GAEjCE,EAAQsE,EAAIxE,EAAoB,IAK1B,SAAUG,EAAQD,EAASF,GAEjC,IAAImF,EAAMnF,EAAoB,IAC1BkG,EAAYlG,EAAoB,IAChCkN,EAAelN,EAAoB,GAApBA,EAAwB,GACvCsG,EAAWtG,EAAoB,GAApBA,CAAwB,YAEvCG,EAAOD,QAAU,SAAUoB,EAAQ4kB,GACjC,IAGI7jB,EAHAoC,EAAIyB,EAAU5E,GACdlB,EAAI,EACJ+I,EAAS,GAEb,IAAK9G,KAAOoC,EAAOpC,GAAOiE,GAAUnB,EAAIV,EAAGpC,IAAQ8G,EAAOC,KAAK/G,GAE/D,KAAsBjC,EAAf8lB,EAAM7e,QAAgBlC,EAAIV,EAAGpC,EAAM6jB,EAAM9lB;KAC7C8M,EAAa/D,EAAQ9G,IAAQ8G,EAAOC,KAAK/G,IAE5C,OAAO8G,IAMH,SAAUhJ,EAAQD,EAASF,GAEjC,IAAIuE,EAAKvE,EAAoB,GACzBoE,EAAWpE,EAAoB,GAC/B4c,EAAU5c,EAAoB,IAElCG,EAAOD,QAAUF,EAAoB,GAAKa,OAAOslB,iBAAmB,SAASA,iBAAiB1hB,EAAG8F,GAC/FnG,EAASK,GAKT,IAJA,IAGI3B,EAHAyG,EAAOqT,EAAQrS,GACflD,EAASkC,EAAKlC,OACdjH,EAAI,EAEQA,EAATiH,GAAY9C,EAAGC,EAAEC,EAAG3B,EAAIyG,EAAKnJ,KAAMmK,EAAWzH,IACrD,OAAO2B,IAMH,SAAUtE,EAAQD,EAASF,GAGjC,IAAIkG,EAAYlG,EAAoB,IAChCkL,EAAOlL,EAAoB,IAAIwE,EAC/BuB,EAAW,GAAGA,SAEdqgB,EAA+B,iBAAVziB,QAAsBA,QAAU9C,OAAO4V,oBAC5D5V,OAAO4V,oBAAoB9S,QAAU,GAUzCxD,EAAOD,QAAQsE,EAAI,SAASiS,oBAAoBhT,GAC9C,OAAO2iB,GAAoC,mBAArBrgB,EAASzF,KAAKmD,GATjB,SAAUA,GAC7B,IACE,OAAOyH,EAAKzH,GACZ,MAAOM,GACP,OAAOqiB,EAAYxe,SAK0Cye,CAAe5iB,GAAMyH,EAAKhF,EAAUzC,MAM/F,SAAUtD,EAAQD,EAASF,GAIjC,IAAIsH,EAAYtH,EAAoB,IAChCwD,EAAWxD,EAAoB,GAC/Bif,EAASjf,EAAoB,IAC7BiO,EAAa,GAAGrG,MAChB0e,EAAY,GAUhBnmB,EAAOD,QAAUkD,SAASmjB,MAAQ,SAASA,KAAK/e,GAC9C,IAAID,EAAKD,EAAUtB,MACfwgB,EAAWvY,EAAW3N,KAAKqH,UAAW,GACtC8e,EAAQ,WACV,IAAIjJ,EAAOgJ,EAASnS,OAAOpG,EAAW3N,KAAKqH,YAC3C,OAAO3B,gBAAgBygB,EAbX,SAAU/jB,EAAGgQ,EAAK8K,GAChC,KAAM9K,KAAO4T,GAAY,CACvB,IAAK,IAAIplB,EAAI,GAAId,EAAI,EAAGA,EAAIsS,EAAKtS,IAAKc,EAAEd,GAAK,KAAOA,EAAI,IAExDkmB,EAAU5T,GAAOtP,SAAS,MAAO,gBAAkBlC,EAAE2E,KAAK,KAAO,KACjE,OAAOygB,EAAU5T,GAAKhQ,EAAG8a,GAQMkJ,CAAUnf,EAAIiW,EAAKnW,OAAQmW,GAAQyB,EAAO1X,EAAIiW,EAAMhW,IAGrF,OADIhE,EAAS+D,EAAG/F,aAAYilB,EAAMjlB,UAAY+F,EAAG/F,WAC1CilB,IAMH,SAAUtmB,EAAQD,EAASF,GAEjC,IAAI0W,EAAM1W,EAAoB,IAC9BG,EAAOD,QAAU,SAAUuD,EAAIkjB,GAC7B,GAAiB,iBAANljB,GAA6B,UAAXiT,EAAIjT,GAAiB,MAAMC,UAAUijB,GAClE,OAAQljB,IAMJ,SAAUtD,EAAQD,EAASF,GAGjC,IAAIwD,EAAWxD,EAAoB,GAC/BiI,EAAQrE,KAAKqE,MACjB9H,EAAOD,QAAU,SAAS0mB,UAAUnjB,GAClC,OAAQD,EAASC,IAAOojB,SAASpjB,IAAOwE,EAAMxE,KAAQA,IAMlD,SAAUtD,EAAQD,EAASF,GAEjC,IAAI8mB,EAAc9mB,EAAoB,GAAG+mB,WACrCC,EAAQhnB,EAAoB,IAAI6X,KAEpC1X,EAAOD,QAAU,EAAI4mB,EAAY9mB,EAAoB,IAAM,QAAW6d,SAAW,SAASkJ,WAAWnJ,GACnG,IAAI/W,EAASmgB,EAAMlhB,OAAO8X,GAAM,GAC5BzU,EAAS2d,EAAYjgB,GACzB,OAAkB,IAAXsC,GAAoC,KAApBtC,EAAO6V,OAAO,IAAa,EAAIvT,GACpD2d,GAKE,SAAU3mB,EAAQD,EAASF,GAEjC,IAAIinB,EAAYjnB,EAAoB,GAAGknB,SACnCF,EAAQhnB,EAAoB,IAAI6X,KAChCsP,EAAKnnB,EAAoB,IACzBonB,EAAM,cAEVjnB,EAAOD,QAAmC,IAAzB+mB,EAAUE,EAAK,OAA0C,KAA3BF,EAAUE,EAAK,QAAiB,SAASD,SAAStJ,EAAKyJ,GACpG,IAAIxgB,EAASmgB,EAAMlhB,OAAO8X,GAAM,GAChC,OAAOqJ,EAAUpgB,EAASwgB,IAAU,IAAOD,EAAIjgB,KAAKN,GAAU,GAAK,MACjEogB,GAKE,SAAU9mB,EAAQD,GAGxBC,EAAOD,QAAU0D,KAAK0jB,OAAS,SAASA,MAAMvJ,GAC5C,OAAmB,MAAXA,GAAKA,IAAcA,EAAI,KAAOA,EAAIA,EAAIA,EAAI,EAAIna,KAAKkf,IAAI,EAAI/E,KAM/D,SAAU5d,EAAQD,EAASF,GAGjC,IAAI8d,EAAO9d,EAAoB,IAC3B6iB,EAAMjf,KAAKif,IACX0E,EAAU1E,EAAI,GAAI,IAClB2E,EAAY3E,EAAI,GAAI,IACpB4E,EAAQ5E,EAAI,EAAG,MAAQ,EAAI2E,GAC3BE,EAAQ7E,EAAI,GAAI,KAMpB1iB,EAAOD,QAAU0D,KAAK+jB,QAAU,SAASA,OAAO5J,GAC9C,IAEInZ,EAAGuE,EAFHye,EAAOhkB,KAAKgf,IAAI7E,GAChB8J,EAAQ/J,EAAKC,GAEjB,OAAI6J,EAAOF,EAAcG,GAAwBD,EAAOF,EAAQF,EAPrD,EAAID,EAAU,EAAIA,GAOgDG,EAAQF,EAIxEC,GAFbte,GADAvE,GAAK,EAAI4iB,EAAYD,GAAWK,IAClBhjB,EAAIgjB,KAEIze,GAAUA,EAAe0e,EAAQhK,SAChDgK,EAAQ1e,IAMX,SAAUhJ,EAAQD,EAASF,GAGjC,IAAIoE,EAAWpE,EAAoB,GACnCG,EAAOD,QAAU,SAAUkQ,EAAU7I,EAAI5C,EAAO4I,GAC9C,IACE,OAAOA,EAAUhG,EAAGnD,EAASO,GAAO,GAAIA,EAAM,IAAM4C,EAAG5C,GAEvD,MAAOZ,GACP,IAAI+jB,EAAM1X,EAAiB,UAE3B,MADI0X,IAAQjoB,IAAWuE,EAAS0jB,EAAIxnB,KAAK8P,IACnCrM,KAOJ,SAAU5D,EAAQD,EAASF,GAEjC,IAAIsH,EAAYtH,EAAoB,IAChCqG,EAAWrG,EAAoB,GAC/BgF,EAAUhF,EAAoB,IAC9BoI,EAAWpI,EAAoB,GAEnCG,EAAOD,QAAU,SAAUsH,EAAMwB,EAAYqH,EAAM0X,EAAMC,GACvD1gB,EAAU0B,GACV,IAAIvE,EAAI4B,EAASmB,GACb3D,EAAOmB,EAAQP,GACf4C,EAASe,EAAS3D,EAAE4C,QACpB6B,EAAQ8e,EAAU3gB,EAAS,EAAI,EAC/BjH,EAAI4nB,GAAW,EAAI,EACvB,GAAI3X,EAAO,EAAG,OAAS,CACrB,GAAInH,KAASrF,EAAM,CACjBkkB,EAAOlkB,EAAKqF,GACZA,GAAS9I,EACT,MAGF,GADA8I,GAAS9I,EACL4nB,EAAU9e,EAAQ,EAAI7B,GAAU6B,EAClC,MAAMxF,UAAU,+CAGpB,KAAMskB,EAAmB,GAAT9e,EAAsBA,EAAT7B,EAAgB6B,GAAS9I,EAAO8I,KAASrF,IACpEkkB,EAAO/e,EAAW+e,EAAMlkB,EAAKqF,GAAQA,EAAOzE,IAE9C,OAAOsjB,IAMH,SAAU5nB,EAAQD,EAASF,GAKjC,IAAIqG,EAAWrG,EAAoB,GAC/B+K,EAAkB/K,EAAoB,IACtCoI,EAAWpI,EAAoB,GAEnCG,EAAOD,QAAU,GAAG8Q,YAAc,SAASA,WAAW/N,EAAkBgO,GACtE,IAAIxM,EAAI4B,EAASL,MACb0M,EAAMtK,EAAS3D,EAAE4C,QACjB4gB,EAAKld,EAAgB9H,EAAQyP,GAC7BxC,EAAOnF,EAAgBkG,EAAOyB,GAC9BN,EAAyB,EAAnBzK,UAAUN,OAAaM,UAAU,GAAK9H,GAC5C8d,EAAQ/Z,KAAKkB,KAAKsN,IAAQvS,GAAY6S,EAAM3H,EAAgBqH,EAAKM,IAAQxC,EAAMwC,EAAMuV,GACrFC,EAAM,EAMV,IALIhY,EAAO+X,GAAMA,EAAK/X,EAAOyN,IAC3BuK,GAAO,EACPhY,GAAQyN,EAAQ,EAChBsK,GAAMtK,EAAQ,GAEC,EAAVA,KACDzN,KAAQzL,EAAGA,EAAEwjB,GAAMxjB,EAAEyL,UACbzL,EAAEwjB,GACdA,GAAMC,EACNhY,GAAQgY,EACR,OAAOzjB,IAML,SAAUtE,EAAQD,EAASF,GAG7BA,EAAoB,IAAoB,KAAd,KAAKmoB,OAAcnoB,EAAoB,GAAGwE,EAAEgT,OAAOhW,UAAW,QAAS,CACnGT,cAAc,EACdE,IAAKjB,EAAoB,OAMrB,SAAUG,EAAQD,GAExBC,EAAOD,QAAU,SAAU4D,GACzB,IACE,MAAO,CAAEC,GAAG,EAAO6P,EAAG9P,KACtB,MAAOC,GACP,MAAO,CAAEA,GAAG,EAAM6P,EAAG7P,MAOnB,SAAU5D,EAAQD,EAASF,GAEjC,IAAIoE,EAAWpE,EAAoB,GAC/BwD,EAAWxD,EAAoB,GAC/BooB,EAAuBpoB,EAAoB,IAE/CG,EAAOD,QAAU,SAAUwP,EAAGqO,GAE5B,GADA3Z,EAASsL,GACLlM,EAASua,IAAMA,EAAEtX,cAAgBiJ,EAAG,OAAOqO,EAC/C,IAAIsK,EAAoBD,EAAqB5jB,EAAEkL,GAG/C,OADAgS,EADc2G,EAAkB3G,SACxB3D,GACDsK,EAAkB1G,UAMrB,SAAUxhB,EAAQD,EAASF,GAIjC,IAAIsoB,EAAStoB,EAAoB,KAC7ByP,EAAWzP,EAAoB,IAInCG,EAAOD,QAAUF,EAAoB,GAApBA,CAHP,MAGoC,SAAUiB,GACtD,OAAO,SAASwT,MAAQ,OAAOxT,EAAI+E,KAAyB,EAAnB2B,UAAUN,OAAaM,UAAU,GAAK9H,MAC9E,CAEDoB,IAAK,SAASA,IAAIoB,GAChB,IAAIkmB,EAAQD,EAAOE,SAAS/Y,EAASzJ,KAR/B,OAQ2C3D,GACjD,OAAOkmB,GAASA,EAAM3U,GAGxBvE,IAAK,SAASA,IAAIhN,EAAKsC,GACrB,OAAO2jB,EAAOnR,IAAI1H,EAASzJ,KAbrB,OAayC,IAAR3D,EAAY,EAAIA,EAAKsC,KAE7D2jB,GAAQ,IAKL,SAAUnoB,EAAQD,EAASF,GAIjC,IAAIuE,EAAKvE,EAAoB,GAAGwE,EAC5BsE,EAAS9I,EAAoB,IAC7B6K,EAAc7K,EAAoB,IAClCgC,EAAMhC,EAAoB,IAC1B2K,EAAa3K,EAAoB,IACjC6a,EAAQ7a,EAAoB,IAC5ByoB,EAAczoB,EAAoB,IAClCmQ,EAAOnQ,EAAoB,IAC3B2L,EAAa3L,EAAoB,IACjC+W,EAAc/W,EAAoB,GAClC8V,EAAU9V,EAAoB,IAAI8V,QAClCrG,EAAWzP,EAAoB,IAC/B0oB,EAAO3R,EAAc,KAAO,OAE5ByR,EAAW,SAAUhhB,EAAMnF,GAE7B,IACIkmB,EADArf,EAAQ4M,EAAQzT,GAEpB,GAAc,MAAV6G,EAAe,OAAO1B,EAAKmX,GAAGzV,GAElC,IAAKqf,EAAQ/gB,EAAKmhB,GAAIJ,EAAOA,EAAQA,EAAMrnB,EACzC,GAAIqnB,EAAMvL,GAAK3a,EAAK,OAAOkmB,GAI/BpoB,EAAOD,QAAU,CACfyb,eAAgB,SAAUzI,EAAShM,EAAMsB,EAAQyS,GAC/C,IAAIvL,EAAIwD,EAAQ,SAAU1L,EAAM4O,GAC9BzL,EAAWnD,EAAMkI,EAAGxI,EAAM,MAC1BM,EAAKsQ,GAAK5Q,EACVM,EAAKmX,GAAK7V,EAAO,MACjBtB,EAAKmhB,GAAK9oB,GACV2H,EAAKohB,GAAK/oB,GACV2H,EAAKkhB,GAAQ,EACTtS,GAAYvW,IAAWgb,EAAMzE,EAAU5N,EAAQhB,EAAKyT,GAAQzT,KAsDlE,OApDAqD,EAAY6E,EAAElO,UAAW,CAGvBka,MAAO,SAASA,QACd,IAAK,IAAIlU,EAAOiI,EAASzJ,KAAMkB,GAAOyM,EAAOnM,EAAKmX,GAAI4J,EAAQ/gB,EAAKmhB,GAAIJ,EAAOA,EAAQA,EAAMrnB,EAC1FqnB,EAAMM,GAAI,EACNN,EAAM7mB,IAAG6mB,EAAM7mB,EAAI6mB,EAAM7mB,EAAER,EAAIrB,WAC5B8T,EAAK4U,EAAMnoB,GAEpBoH,EAAKmhB,GAAKnhB,EAAKohB,GAAK/oB,GACpB2H,EAAKkhB,GAAQ,GAIfI,SAAU,SAAUzmB,GAClB,IAAImF,EAAOiI,EAASzJ,KAAMkB,GACtBqhB,EAAQC,EAAShhB,EAAMnF,GAC3B,GAAIkmB,EAAO,CACT,IAAI9X,EAAO8X,EAAMrnB,EACb6nB,EAAOR,EAAM7mB,SACV8F,EAAKmX,GAAG4J,EAAMnoB,GACrBmoB,EAAMM,GAAI,EACNE,IAAMA,EAAK7nB,EAAIuP,GACfA,IAAMA,EAAK/O,EAAIqnB,GACfvhB,EAAKmhB,IAAMJ,IAAO/gB,EAAKmhB,GAAKlY,GAC5BjJ,EAAKohB,IAAML,IAAO/gB,EAAKohB,GAAKG,GAChCvhB,EAAKkhB,KACL,QAASH,GAIb/W,QAAS,SAASA,QAAQxI,GACxByG,EAASzJ,KAAMkB,GAGf,IAFA,IACIqhB,EADA/jB,EAAIxC,EAAIgH,EAA+B,EAAnBrB,UAAUN,OAAaM,UAAU,GAAK9H,GAAW,GAElE0oB,EAAQA,EAAQA,EAAMrnB,EAAI8E,KAAK2iB,IAGpC,IAFAnkB,EAAE+jB,EAAM3U,EAAG2U,EAAMvL,EAAGhX,MAEbuiB,GAASA,EAAMM,GAAGN,EAAQA,EAAM7mB,GAK3CyD,IAAK,SAASA,IAAI9C,GAChB,QAASmmB,EAAS/Y,EAASzJ,KAAMkB,GAAO7E,MAGxC0U,GAAaxS,EAAGmL,EAAElO,UAAW,OAAQ,CACvCP,IAAK,WACH,OAAOwO,EAASzJ,KAAMkB,GAAMwhB,MAGzBhZ,GAETyH,IAAK,SAAU3P,EAAMnF,EAAKsC,GACxB,IACIokB,EAAM7f,EADNqf,EAAQC,EAAShhB,EAAMnF,GAoBzB,OAjBEkmB,EACFA,EAAM3U,EAAIjP,GAGV6C,EAAKohB,GAAKL,EAAQ,CAChBnoB,EAAG8I,EAAQ4M,EAAQzT,GAAK,GACxB2a,EAAG3a,EACHuR,EAAGjP,EACHjD,EAAGqnB,EAAOvhB,EAAKohB,GACf1nB,EAAGrB,GACHgpB,GAAG,GAEArhB,EAAKmhB,KAAInhB,EAAKmhB,GAAKJ,GACpBQ,IAAMA,EAAK7nB,EAAIqnB,GACnB/gB,EAAKkhB,KAES,MAAVxf,IAAe1B,EAAKmX,GAAGzV,GAASqf,IAC7B/gB,GAEXghB,SAAUA,EACV5M,UAAW,SAAUlM,EAAGxI,EAAMsB,GAG5BigB,EAAY/Y,EAAGxI,EAAM,SAAUwX,EAAUpF,GACvCtT,KAAK8R,GAAKrI,EAASiP,EAAUxX,GAC7BlB,KAAK4Y,GAAKtF,EACVtT,KAAK4iB,GAAK/oB,IACT,WAKD,IAJA,IAAI2H,EAAOxB,KACPsT,EAAO9R,EAAKoX,GACZ2J,EAAQ/gB,EAAKohB,GAEVL,GAASA,EAAMM,GAAGN,EAAQA,EAAM7mB,EAEvC,OAAK8F,EAAKsQ,KAAQtQ,EAAKohB,GAAKL,EAAQA,EAAQA,EAAMrnB,EAAIsG,EAAKsQ,GAAG6Q,IAMnCxY,EAAK,EAApB,QAARmJ,EAA+BiP,EAAMvL,EAC7B,UAAR1D,EAAiCiP,EAAM3U,EAC5B,CAAC2U,EAAMvL,EAAGuL,EAAM3U,KAN7BpM,EAAKsQ,GAAKjY,GACHsQ,EAAK,KAMb3H,EAAS,UAAY,UAAWA,GAAQ,GAG3CmD,EAAWzE,MAOT,SAAU/G,EAAQD,EAASF,GAIjC,IAAIsoB,EAAStoB,EAAoB,KAC7ByP,EAAWzP,EAAoB,IAInCG,EAAOD,QAAUF,EAAoB,GAApBA,CAHP,MAGoC,SAAUiB,GACtD,OAAO,SAAS+nB,MAAQ,OAAO/nB,EAAI+E,KAAyB,EAAnB2B,UAAUN,OAAaM,UAAU,GAAK9H,MAC9E,CAEDsb,IAAK,SAASA,IAAIxW,GAChB,OAAO2jB,EAAOnR,IAAI1H,EAASzJ,KARrB,OAQiCrB,EAAkB,IAAVA,EAAc,EAAIA,EAAOA,KAEzE2jB,IAKG,SAAUnoB,EAAQD,EAASF,GAIjC,IAaIipB,EAbAC,EAAOlpB,EAAoB,GAApBA,CAAwB,GAC/B+B,EAAW/B,EAAoB,IAC/B4V,EAAO5V,EAAoB,IAC3B+c,EAAS/c,EAAoB,IAC7BmpB,EAAOnpB,EAAoB,KAC3BwD,EAAWxD,EAAoB,GAC/B0G,EAAQ1G,EAAoB,GAC5ByP,EAAWzP,EAAoB,IAC/BopB,EAAW,UACXrT,EAAUH,EAAKG,QACfR,EAAe1U,OAAO0U,aACtB8T,EAAsBF,EAAKG,QAC3BC,EAAM,GAGNrW,EAAU,SAAUjS,GACtB,OAAO,SAASuoB,UACd,OAAOvoB,EAAI+E,KAAyB,EAAnB2B,UAAUN,OAAaM,UAAU,GAAK9H,MAIvDsZ,EAAU,CAEZlY,IAAK,SAASA,IAAIoB,GAChB,GAAImB,EAASnB,GAAM,CACjB,IAAIsR,EAAOoC,EAAQ1T,GACnB,OAAa,IAATsR,EAAsB0V,EAAoB5Z,EAASzJ,KAAMojB,IAAWnoB,IAAIoB,GACrEsR,EAAOA,EAAK3N,KAAK2Y,IAAM9e,KAIlCwP,IAAK,SAASA,IAAIhN,EAAKsC,GACrB,OAAOwkB,EAAKhS,IAAI1H,EAASzJ,KAAMojB,GAAW/mB,EAAKsC,KAK/C8kB,EAAWtpB,EAAOD,QAAUF,EAAoB,GAApBA,CAAwBopB,EAAUlW,EAASiG,EAASgQ,GAAM,GAAM,GAG5FziB,EAAM,WAAc,OAAyE,IAAlE,IAAI+iB,GAAWpa,KAAKxO,OAAO6oB,QAAU7oB,QAAQ0oB,GAAM,GAAGtoB,IAAIsoB,OAEvFxM,GADAkM,EAAcE,EAAKxN,eAAezI,EAASkW,IACxB5nB,UAAW2X,GAC9BvD,EAAKC,MAAO,EACZqT,EAAK,CAAC,SAAU,MAAO,MAAO,OAAQ,SAAU7mB,GAC9C,IAAI0O,EAAQ0Y,EAASjoB,UACjBqG,EAASkJ,EAAM1O,GACnBN,EAASgP,EAAO1O,EAAK,SAAUuC,EAAG6C,GAEhC,GAAIjE,EAASoB,KAAO2Q,EAAa3Q,GAAI,CAC9BoB,KAAK2iB,KAAI3iB,KAAK2iB,GAAK,IAAIM,GAC5B,IAAI9f,EAASnD,KAAK2iB,GAAGtmB,GAAKuC,EAAG6C,GAC7B,MAAc,OAAPpF,EAAe2D,KAAOmD,EAE7B,OAAOtB,EAAOvH,KAAK0F,KAAMpB,EAAG6C,SAQ9B,SAAUtH,EAAQD,EAASF,GAIjC,IAAI6K,EAAc7K,EAAoB,IAClC+V,EAAU/V,EAAoB,IAAI+V,QAClC3R,EAAWpE,EAAoB,GAC/BwD,EAAWxD,EAAoB,GAC/B2K,EAAa3K,EAAoB,IACjC6a,EAAQ7a,EAAoB,IAC5BqL,EAAoBrL,EAAoB,IACxC2pB,EAAO3pB,EAAoB,IAC3ByP,EAAWzP,EAAoB,IAC/B+M,EAAY1B,EAAkB,GAC9B2B,EAAiB3B,EAAkB,GACnCiK,EAAK,EAGL+T,EAAsB,SAAU7hB,GAClC,OAAOA,EAAKohB,KAAOphB,EAAKohB,GAAK,IAAIgB,IAE/BA,EAAsB,WACxB5jB,KAAKpB,EAAI,IAEPilB,EAAqB,SAAU7lB,EAAO3B,GACxC,OAAO0K,EAAU/I,EAAMY,EAAG,SAAUnB,GAClC,OAAOA,EAAG,KAAOpB,KAGrBunB,EAAoBpoB,UAAY,CAC9BP,IAAK,SAAUoB,GACb,IAAIkmB,EAAQsB,EAAmB7jB,KAAM3D,GACrC,GAAIkmB,EAAO,OAAOA,EAAM,IAE1BpjB,IAAK,SAAU9C,GACb,QAASwnB,EAAmB7jB,KAAM3D,IAEpCgN,IAAK,SAAUhN,EAAKsC,GAClB,IAAI4jB,EAAQsB,EAAmB7jB,KAAM3D,GACjCkmB,EAAOA,EAAM,GAAK5jB,EACjBqB,KAAKpB,EAAEwE,KAAK,CAAC/G,EAAKsC,KAEzBmkB,SAAU,SAAUzmB,GAClB,IAAI6G,EAAQ8D,EAAehH,KAAKpB,EAAG,SAAUnB,GAC3C,OAAOA,EAAG,KAAOpB,IAGnB,OADK6G,GAAOlD,KAAKpB,EAAEklB,OAAO5gB,EAAO,MACvBA,IAId/I,EAAOD,QAAU,CACfyb,eAAgB,SAAUzI,EAAShM,EAAMsB,EAAQyS,GAC/C,IAAIvL,EAAIwD,EAAQ,SAAU1L,EAAM4O,GAC9BzL,EAAWnD,EAAMkI,EAAGxI,EAAM,MAC1BM,EAAKsQ,GAAK5Q,EACVM,EAAKmX,GAAKrJ,IAENc,IADJ5O,EAAKohB,GAAK/oB,KACiBgb,EAAMzE,EAAU5N,EAAQhB,EAAKyT,GAAQzT,KAoBlE,OAlBAqD,EAAY6E,EAAElO,UAAW,CAGvBsnB,SAAU,SAAUzmB,GAClB,IAAKmB,EAASnB,GAAM,OAAO,EAC3B,IAAIsR,EAAOoC,EAAQ1T,GACnB,OAAa,IAATsR,EAAsB0V,EAAoB5Z,EAASzJ,KAAMkB,IAAe,UAAE7E,GACvEsR,GAAQgW,EAAKhW,EAAM3N,KAAK2Y,YAAchL,EAAK3N,KAAK2Y,KAIzDxZ,IAAK,SAASA,IAAI9C,GAChB,IAAKmB,EAASnB,GAAM,OAAO,EAC3B,IAAIsR,EAAOoC,EAAQ1T,GACnB,OAAa,IAATsR,EAAsB0V,EAAoB5Z,EAASzJ,KAAMkB,IAAO/B,IAAI9C,GACjEsR,GAAQgW,EAAKhW,EAAM3N,KAAK2Y,OAG5BjP,GAETyH,IAAK,SAAU3P,EAAMnF,EAAKsC,GACxB,IAAIgP,EAAOoC,EAAQ3R,EAAS/B,IAAM,GAGlC,OAFa,IAATsR,EAAe0V,EAAoB7hB,GAAM6H,IAAIhN,EAAKsC,GACjDgP,EAAKnM,EAAKmX,IAAMha,EACd6C,GAET8hB,QAASD,IAML,SAAUlpB,EAAQD,EAASF,GAGjC,IAAI6E,EAAY7E,EAAoB,IAChCoI,EAAWpI,EAAoB,GACnCG,EAAOD,QAAU,SAAUuD,GACzB,GAAIA,IAAO5D,GAAW,OAAO,EAC7B,IAAIkqB,EAASllB,EAAUpB,GACnB4D,EAASe,EAAS2hB,GACtB,GAAIA,IAAW1iB,EAAQ,MAAM2E,WAAW,iBACxC,OAAO3E,IAMH,SAAUlH,EAAQD,EAASF,GAKjC,IAAIwY,EAAUxY,EAAoB,IAC9BwD,EAAWxD,EAAoB,GAC/BoI,EAAWpI,EAAoB,GAC/BgC,EAAMhC,EAAoB,IAC1BgqB,EAAuBhqB,EAAoB,EAApBA,CAAuB,sBAgClDG,EAAOD,QA9BP,SAAS+pB,iBAAiBhnB,EAAQsb,EAAUnc,EAAQ8nB,EAAWjZ,EAAOkZ,EAAOC,EAAQC,GAMnF,IALA,IAGIC,EAASC,EAHTC,EAAcvZ,EACdwZ,EAAc,EACdrO,IAAQgO,GAASpoB,EAAIooB,EAAQC,EAAS,GAGnCI,EAAcP,GAAW,CAC9B,GAAIO,KAAeroB,EAAQ,CASzB,GARAkoB,EAAUlO,EAAQA,EAAMha,EAAOqoB,GAAcA,EAAalM,GAAYnc,EAAOqoB,GAE7EF,GAAa,EACT/mB,EAAS8mB,KAEXC,GADAA,EAAaD,EAAQN,MACOnqB,KAAc0qB,EAAa/R,EAAQ8R,IAG7DC,GAAsB,EAARJ,EAChBK,EAAcP,iBAAiBhnB,EAAQsb,EAAU+L,EAASliB,EAASkiB,EAAQjjB,QAASmjB,EAAaL,EAAQ,GAAK,MACzG,CACL,GAAmB,kBAAfK,EAAiC,MAAM9mB,YAC3CT,EAAOunB,GAAeF,EAGxBE,IAEFC,IAEF,OAAOD,IAQH,SAAUrqB,EAAQD,EAASF,GAGjC,IAAIoI,EAAWpI,EAAoB,GAC/B0d,EAAS1d,EAAoB,IAC7B+E,EAAU/E,EAAoB,IAElCG,EAAOD,QAAU,SAAUsH,EAAMkjB,EAAWC,EAAYC,GACtD,IAAI1nB,EAAI4C,OAAOf,EAAQyC,IACnBqjB,EAAe3nB,EAAEmE,OACjByjB,EAAUH,IAAe9qB,GAAY,IAAMiG,OAAO6kB,GAClDI,EAAe3iB,EAASsiB,GAC5B,GAAIK,GAAgBF,GAA2B,IAAXC,EAAe,OAAO5nB,EAC1D,IAAI8nB,EAAUD,EAAeF,EACzBI,EAAevN,EAAOpd,KAAKwqB,EAASlnB,KAAKoE,KAAKgjB,EAAUF,EAAQzjB,SAEpE,OAD0B2jB,EAAtBC,EAAa5jB,SAAkB4jB,EAAeA,EAAarjB,MAAM,EAAGojB,IACjEJ,EAAOK,EAAe/nB,EAAIA,EAAI+nB,IAMjC,SAAU9qB,EAAQD,EAASF,GAEjC,IAAI4c,EAAU5c,EAAoB,IAC9BkG,EAAYlG,EAAoB,IAChCkd,EAASld,EAAoB,IAAIwE,EACrCrE,EAAOD,QAAU,SAAUgrB,GACzB,OAAO,SAAUznB,GAOf,IANA,IAKIpB,EALAoC,EAAIyB,EAAUzC,GACd8F,EAAOqT,EAAQnY,GACf4C,EAASkC,EAAKlC,OACdjH,EAAI,EACJ+I,EAAS,GAEG/I,EAATiH,GAAgB6V,EAAO5c,KAAKmE,EAAGpC,EAAMkH,EAAKnJ,OAC/C+I,EAAOC,KAAK8hB,EAAY,CAAC7oB,EAAKoC,EAAEpC,IAAQoC,EAAEpC,IAC1C,OAAO8G,KAOP,SAAUhJ,EAAQD,EAASF,GAGjC,IAAIgL,EAAUhL,EAAoB,IAC9BkQ,EAAOlQ,EAAoB,KAC/BG,EAAOD,QAAU,SAAUgH,GACzB,OAAO,SAASikB,SACd,GAAIngB,EAAQhF,OAASkB,EAAM,MAAMxD,UAAUwD,EAAO,yBAClD,OAAOgJ,EAAKlK,SAOV,SAAU7F,EAAQD,EAASF,GAEjC,IAAI6a,EAAQ7a,EAAoB,IAEhCG,EAAOD,QAAU,SAAUkU,EAAM/F,GAC/B,IAAIlF,EAAS,GAEb,OADA0R,EAAMzG,GAAM,EAAOjL,EAAOC,KAAMD,EAAQkF,GACjClF,IAMH,SAAUhJ,EAAQD,GAGxBC,EAAOD,QAAU0D,KAAKwnB,OAAS,SAASA,MAAMrN,EAAGsN,EAAOC,EAAQC,EAAQC,GACtE,OACuB,IAArB7jB,UAAUN,QAEL0W,GAAKA,GAELsN,GAASA,GAETC,GAAUA,GAEVC,GAAUA,GAEVC,GAAWA,EACT1H,IACL/F,IAAMF,UAAYE,KAAOF,SAAiBE,GACtCA,EAAIsN,IAAUG,EAAUD,IAAWD,EAASD,GAASE,IAMzD,SAAUprB,EAAQD,EAASF,GAEjC,IAAIgL,EAAUhL,EAAoB,IAC9BqO,EAAWrO,EAAoB,EAApBA,CAAuB,YAClCyL,EAAYzL,EAAoB,IACpCG,EAAOD,QAAUF,EAAoB,IAAIyrB,WAAa,SAAUhoB,GAC9D,IAAIgB,EAAI5D,OAAO4C,GACf,OAAOgB,EAAE4J,KAAcxO,IAClB,eAAgB4E,GAEhBgH,EAAUhK,eAAeuJ,EAAQvG,MAMlC,SAAUtE,EAAQD,EAASF,GAIjC,IAAI0rB,EAAO1rB,EAAoB,KAC3Bif,EAASjf,EAAoB,IAC7BsH,EAAYtH,EAAoB,IACpCG,EAAOD,QAAU,WAOf,IANA,IAAIqH,EAAKD,EAAUtB,MACfqB,EAASM,UAAUN,OACnBskB,EAAQ,IAAIrf,MAAMjF,GAClBjH,EAAI,EACJ8U,EAAIwW,EAAKxW,EACT0W,GAAS,EACGxrB,EAATiH,IAAiBskB,EAAMvrB,GAAKuH,UAAUvH,QAAU8U,IAAG0W,GAAS,GACnE,OAAO,WACL,IAIIpO,EAHAnN,EAAO1I,UAAUN,OACjB8V,EAAI,EACJH,EAAI,EAER,IAAK4O,IAAWvb,EAAM,OAAO4O,EAAO1X,EAAIokB,EAL7B3lB,MAOX,GADAwX,EAAOmO,EAAM/jB,QACTgkB,EAAQ,KAAezO,EAAT9V,EAAY8V,IAASK,EAAKL,KAAOjI,IAAGsI,EAAKL,GAAKxV,UAAUqV,MAC1E,KAAcA,EAAP3M,GAAUmN,EAAKpU,KAAKzB,UAAUqV,MACrC,OAAOiC,EAAO1X,EAAIiW,EATPxX,SAgBT,SAAU7F,EAAQD,EAASF,GAEjCG,EAAOD,QAAUF,EAAoB,IAK/B,SAAUG,EAAQD,EAASF,GAEjC,IAAIuE,EAAKvE,EAAoB,GACzBmG,EAAOnG,EAAoB,IAC3BwiB,EAAUxiB,EAAoB,IAC9BkG,EAAYlG,EAAoB,IAEpCG,EAAOD,QAAU,SAAS2rB,OAAO5oB,EAAQ6oB,GAKvC,IAJA,IAGIzpB,EAHAkH,EAAOiZ,EAAQtc,EAAU4lB,IACzBzkB,EAASkC,EAAKlC,OACdjH,EAAI,EAEQA,EAATiH,GAAY9C,EAAGC,EAAEvB,EAAQZ,EAAMkH,EAAKnJ,KAAM+F,EAAK3B,EAAEsnB,EAAOzpB,IAC/D,OAAOY,IAMH,SAAU9C,EAAQD,EAASF,GAEjCA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,IACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,IACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBG,EAAOD,QAAUF,EAAoB,MAK/B,SAAUG,EAAQD,EAASF,GAKjC,IAAI4B,EAAS5B,EAAoB,GAC7BmF,EAAMnF,EAAoB,IAC1B+W,EAAc/W,EAAoB,GAClCkC,EAAUlC,EAAoB,GAC9B+B,EAAW/B,EAAoB,IAC/BoV,EAAOpV,EAAoB,IAAImI,IAC/B4jB,EAAS/rB,EAAoB,GAC7B0U,EAAS1U,EAAoB,IAC7B4Y,EAAiB5Y,EAAoB,IACrCiE,EAAMjE,EAAoB,IAC1BoL,EAAMpL,EAAoB,GAC1Bwc,EAASxc,EAAoB,IAC7BgsB,EAAYhsB,EAAoB,IAChCisB,EAAWjsB,EAAoB,KAC/BwY,EAAUxY,EAAoB,IAC9BoE,EAAWpE,EAAoB,GAC/BwD,EAAWxD,EAAoB,GAC/BkG,EAAYlG,EAAoB,IAChCsE,EAActE,EAAoB,IAClCkF,EAAalF,EAAoB,IACjCksB,EAAUlsB,EAAoB,IAC9BmsB,EAAUnsB,EAAoB,IAC9B+L,EAAQ/L,EAAoB,IAC5B8L,EAAM9L,EAAoB,GAC1BqJ,EAAQrJ,EAAoB,IAC5BmG,EAAO4F,EAAMvH,EACbD,EAAKuH,EAAItH,EACT0G,EAAOihB,EAAQ3nB,EACfiY,EAAU7a,EAAOsC,OACjBkoB,EAAQxqB,EAAOyqB,KACfC,EAAaF,GAASA,EAAMG,UAC5BtqB,EAAY,YACZuqB,EAASphB,EAAI,WACbqhB,EAAerhB,EAAI,eACnB8R,EAAS,GAAGnF,qBACZ2U,EAAiBhY,EAAO,mBACxBiY,EAAajY,EAAO,WACpBkY,EAAYlY,EAAO,cACnBnO,EAAc1F,OAAOoB,GACrB4qB,EAA+B,mBAAXpQ,EACpBqQ,EAAUlrB,EAAOkrB,QAEjBC,GAAUD,IAAYA,EAAQ7qB,KAAe6qB,EAAQ7qB,GAAW+qB,UAGhEC,EAAgBlW,GAAegV,EAAO,WACxC,OAES,GAFFG,EAAQ3nB,EAAG,GAAI,IAAK,CACzBtD,IAAK,WAAc,OAAOsD,EAAGyB,KAAM,IAAK,CAAErB,MAAO,IAAKC,MACpDA,IACD,SAAUnB,EAAIpB,EAAKqY,GACtB,IAAIwS,EAAY/mB,EAAKI,EAAalE,GAC9B6qB,UAAkB3mB,EAAYlE,GAClCkC,EAAGd,EAAIpB,EAAKqY,GACRwS,GAAazpB,IAAO8C,GAAahC,EAAGgC,EAAalE,EAAK6qB,IACxD3oB,EAEA4oB,EAAO,SAAUrmB,GACnB,IAAIsmB,EAAMT,EAAW7lB,GAAOolB,EAAQzP,EAAQxa,IAE5C,OADAmrB,EAAIxO,GAAK9X,EACFsmB,GAGLC,EAAWR,GAAyC,iBAApBpQ,EAAQrM,SAAuB,SAAU3M,GAC3E,MAAoB,iBAANA,GACZ,SAAUA,GACZ,OAAOA,aAAcgZ,GAGnB6B,EAAkB,SAASxd,eAAe2C,EAAIpB,EAAKqY,GAKrD,OAJIjX,IAAO8C,GAAa+X,EAAgBsO,EAAWvqB,EAAKqY,GACxDtW,EAASX,GACTpB,EAAMiC,EAAYjC,GAAK,GACvB+B,EAASsW,GACLvV,EAAIwnB,EAAYtqB,IACbqY,EAAE1Z,YAIDmE,EAAI1B,EAAI+oB,IAAW/oB,EAAG+oB,GAAQnqB,KAAMoB,EAAG+oB,GAAQnqB,IAAO,GAC1DqY,EAAIwR,EAAQxR,EAAG,CAAE1Z,WAAYkE,EAAW,GAAG,OAJtCC,EAAI1B,EAAI+oB,IAASjoB,EAAGd,EAAI+oB,EAAQtnB,EAAW,EAAG,KACnDzB,EAAG+oB,GAAQnqB,IAAO,GAIX4qB,EAAcxpB,EAAIpB,EAAKqY,IACzBnW,EAAGd,EAAIpB,EAAKqY,IAEnB4S,EAAoB,SAASnH,iBAAiB1iB,EAAIX,GACpDsB,EAASX,GAKT,IAJA,IAGIpB,EAHAkH,EAAO0iB,EAASnpB,EAAIoD,EAAUpD,IAC9B1C,EAAI,EACJC,EAAIkJ,EAAKlC,OAEFjH,EAAJC,GAAOie,EAAgB7a,EAAIpB,EAAMkH,EAAKnJ,KAAM0C,EAAET,IACrD,OAAOoB,GAKL8pB,EAAwB,SAASxV,qBAAqB1V,GACxD,IAAImrB,EAAItQ,EAAO5c,KAAK0F,KAAM3D,EAAMiC,EAAYjC,GAAK,IACjD,QAAI2D,OAASO,GAAepB,EAAIwnB,EAAYtqB,KAAS8C,EAAIynB,EAAWvqB,QAC7DmrB,IAAMroB,EAAIa,KAAM3D,KAAS8C,EAAIwnB,EAAYtqB,IAAQ8C,EAAIa,KAAMwmB,IAAWxmB,KAAKwmB,GAAQnqB,KAAOmrB,IAE/FC,EAA4B,SAASrnB,yBAAyB3C,EAAIpB,GAGpE,GAFAoB,EAAKyC,EAAUzC,GACfpB,EAAMiC,EAAYjC,GAAK,GACnBoB,IAAO8C,IAAepB,EAAIwnB,EAAYtqB,IAAS8C,EAAIynB,EAAWvqB,GAAlE,CACA,IAAIqY,EAAIvU,EAAK1C,EAAIpB,GAEjB,OADIqY,IAAKvV,EAAIwnB,EAAYtqB,IAAU8C,EAAI1B,EAAI+oB,IAAW/oB,EAAG+oB,GAAQnqB,KAAOqY,EAAE1Z,YAAa,GAChF0Z,IAELgT,EAAuB,SAASjX,oBAAoBhT,GAKtD,IAJA,IAGIpB,EAHA6jB,EAAQhb,EAAKhF,EAAUzC,IACvB0F,EAAS,GACT/I,EAAI,EAEcA,EAAf8lB,EAAM7e,QACNlC,EAAIwnB,EAAYtqB,EAAM6jB,EAAM9lB,OAASiC,GAAOmqB,GAAUnqB,GAAO+S,GAAMjM,EAAOC,KAAK/G,GACpF,OAAO8G,GAEPwkB,EAAyB,SAASpV,sBAAsB9U,GAM1D,IALA,IAIIpB,EAJAurB,EAAQnqB,IAAO8C,EACf2f,EAAQhb,EAAK0iB,EAAQhB,EAAY1mB,EAAUzC,IAC3C0F,EAAS,GACT/I,EAAI,EAEcA,EAAf8lB,EAAM7e,SACPlC,EAAIwnB,EAAYtqB,EAAM6jB,EAAM9lB,OAAUwtB,IAAQzoB,EAAIoB,EAAalE,IAAc8G,EAAOC,KAAKujB,EAAWtqB,IACxG,OAAO8G,GAIN0jB,IAYH9qB,GAXA0a,EAAU,SAASvY,SACjB,GAAI8B,gBAAgByW,EAAS,MAAM/Y,UAAU,gCAC7C,IAAIoD,EAAM7C,EAAuB,EAAnB0D,UAAUN,OAAaM,UAAU,GAAK9H,IAChD2S,EAAO,SAAU7N,GACfqB,OAASO,GAAaiM,EAAKlS,KAAKssB,EAAWjoB,GAC3CQ,EAAIa,KAAMwmB,IAAWrnB,EAAIa,KAAKwmB,GAAS1lB,KAAMd,KAAKwmB,GAAQ1lB,IAAO,GACrEmmB,EAAcjnB,KAAMc,EAAK5B,EAAW,EAAGP,KAGzC,OADIoS,GAAegW,GAAQE,EAAc1mB,EAAaO,EAAK,CAAE/F,cAAc,EAAMsO,IAAKmD,IAC/E2a,EAAKrmB,KAEG7E,GAAY,WAAY,SAAS8D,WAChD,OAAOC,KAAK4Y,KAGd7S,EAAMvH,EAAIipB,EACV3hB,EAAItH,EAAI8Z,EACRte,EAAoB,IAAIwE,EAAI2nB,EAAQ3nB,EAAIkpB,EACxC1tB,EAAoB,IAAIwE,EAAI+oB,EAC5BvtB,EAAoB,IAAIwE,EAAImpB,EAExB5W,IAAgB/W,EAAoB,KACtC+B,EAASwE,EAAa,uBAAwBgnB,GAAuB,GAGvE/Q,EAAOhY,EAAI,SAAU9D,GACnB,OAAOysB,EAAK/hB,EAAI1K,MAIpBwB,EAAQA,EAAQU,EAAIV,EAAQoB,EAAIpB,EAAQQ,GAAKmqB,EAAY,CAAE3oB,OAAQuY,IAEnE,IAAK,IAAIoR,GAAa,iHAGpBroB,MAAM,KAAM2X,GAAI,EAAuBA,GAApB0Q,GAAWxmB,QAAY+D,EAAIyiB,GAAW1Q,OAE3D,IAAK,IAAI2Q,GAAmBzkB,EAAM+B,EAAIpH,OAAQgZ,GAAI,EAA6BA,GAA1B8Q,GAAiBzmB,QAAa2kB,EAAU8B,GAAiB9Q,OAE9G9a,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAKmqB,EAAY,SAAU,CAErDkB,MAAO,SAAU1rB,GACf,OAAO8C,EAAIunB,EAAgBrqB,GAAO,IAC9BqqB,EAAerqB,GACfqqB,EAAerqB,GAAOoa,EAAQpa,IAGpC2rB,OAAQ,SAASA,OAAOZ,GACtB,IAAKC,EAASD,GAAM,MAAM1pB,UAAU0pB,EAAM,qBAC1C,IAAK,IAAI/qB,KAAOqqB,EAAgB,GAAIA,EAAerqB,KAAS+qB,EAAK,OAAO/qB,GAE1E4rB,UAAW,WAAclB,GAAS,GAClCmB,UAAW,WAAcnB,GAAS,KAGpC7qB,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAKmqB,EAAY,SAAU,CAErD/jB,OA/FY,SAASA,OAAOrF,EAAIX,GAChC,OAAOA,IAAMjD,GAAYqsB,EAAQzoB,GAAM6pB,EAAkBpB,EAAQzoB,GAAKX,IAgGtEhC,eAAgBwd,EAEhB6H,iBAAkBmH,EAElBlnB,yBAA0BqnB,EAE1BhX,oBAAqBiX,EAErBnV,sBAAuBoV,IAIzBvB,GAASlqB,EAAQA,EAAQgB,EAAIhB,EAAQQ,IAAMmqB,GAAcd,EAAO,WAC9D,IAAI7oB,EAAIuZ,IAIR,MAA0B,UAAnB6P,EAAW,CAACppB,KAA2C,MAAxBopB,EAAW,CAAE1nB,EAAG1B,KAAyC,MAAzBopB,EAAWzrB,OAAOqC,OACrF,OAAQ,CACXqpB,UAAW,SAASA,UAAU9oB,GAI5B,IAHA,IAEIuiB,EAAUmI,EAFV3Q,EAAO,CAAC/Z,GACRrD,EAAI,EAEkBA,EAAnBuH,UAAUN,QAAYmW,EAAKpU,KAAKzB,UAAUvH,MAEjD,GADA+tB,EAAYnI,EAAWxI,EAAK,IACvBha,EAASwiB,IAAaviB,IAAO5D,MAAawtB,EAAS5pB,GAMxD,OALK+U,EAAQwN,KAAWA,EAAW,SAAU3jB,EAAKsC,GAEhD,GADwB,mBAAbwpB,IAAyBxpB,EAAQwpB,EAAU7tB,KAAK0F,KAAM3D,EAAKsC,KACjE0oB,EAAS1oB,GAAQ,OAAOA,IAE/B6Y,EAAK,GAAKwI,EACHsG,EAAW5kB,MAAM0kB,EAAO5O,MAKnCf,EAAQxa,GAAWwqB,IAAiBzsB,EAAoB,GAApBA,CAAwByc,EAAQxa,GAAYwqB,EAAchQ,EAAQxa,GAAW8F,SAEjH6Q,EAAe6D,EAAS,UAExB7D,EAAehV,KAAM,QAAQ,GAE7BgV,EAAehX,EAAOyqB,KAAM,QAAQ,IAK9B,SAAUlsB,EAAQD,EAASF,GAGjC,IAAI4c,EAAU5c,EAAoB,IAC9B6c,EAAO7c,EAAoB,IAC3BiG,EAAMjG,EAAoB,IAC9BG,EAAOD,QAAU,SAAUuD,GACzB,IAAI0F,EAASyT,EAAQnZ,GACjBwZ,EAAaJ,EAAKrY,EACtB,GAAIyY,EAKF,IAJA,IAGI5a,EAHA+rB,EAAUnR,EAAWxZ,GACrByZ,EAASjX,EAAIzB,EACbpE,EAAI,EAEgBA,EAAjBguB,EAAQ/mB,QAAgB6V,EAAO5c,KAAKmD,EAAIpB,EAAM+rB,EAAQhuB,OAAO+I,EAAOC,KAAK/G,GAChF,OAAO8G,IAML,SAAUhJ,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAK1C,EAAoB,GAAI,SAAU,CAAEc,eAAgBd,EAAoB,GAAGwE,KAKtG,SAAUrE,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAK1C,EAAoB,GAAI,SAAU,CAAEmmB,iBAAkBnmB,EAAoB,OAKrG,SAAUG,EAAQD,EAASF,GAGjC,IAAIkG,EAAYlG,EAAoB,IAChCytB,EAA4BztB,EAAoB,IAAIwE,EAExDxE,EAAoB,GAApBA,CAAwB,2BAA4B,WAClD,OAAO,SAASoG,yBAAyB3C,EAAIpB,GAC3C,OAAOorB,EAA0BvnB,EAAUzC,GAAKpB,OAO9C,SAAUlC,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,SAAU,CAAE4F,OAAQ9I,EAAoB,OAKrD,SAAUG,EAAQD,EAASF,GAGjC,IAAIqG,EAAWrG,EAAoB,GAC/BquB,EAAkBruB,EAAoB,IAE1CA,EAAoB,GAApBA,CAAwB,iBAAkB,WACxC,OAAO,SAASwG,eAAe/C,GAC7B,OAAO4qB,EAAgBhoB,EAAS5C,QAO9B,SAAUtD,EAAQD,EAASF,GAGjC,IAAIqG,EAAWrG,EAAoB,GAC/BqJ,EAAQrJ,EAAoB,IAEhCA,EAAoB,GAApBA,CAAwB,OAAQ,WAC9B,OAAO,SAASuJ,KAAK9F,GACnB,OAAO4F,EAAMhD,EAAS5C,QAOpB,SAAUtD,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,sBAAuB,WAC7C,OAAOA,EAAoB,IAAIwE,KAM3B,SAAUrE,EAAQD,EAASF,GAGjC,IAAIwD,EAAWxD,EAAoB,GAC/B4V,EAAO5V,EAAoB,IAAIgW,SAEnChW,EAAoB,GAApBA,CAAwB,SAAU,SAAUsuB,GAC1C,OAAO,SAAS5E,OAAOjmB,GACrB,OAAO6qB,GAAW9qB,EAASC,GAAM6qB,EAAQ1Y,EAAKnS,IAAOA,MAOnD,SAAUtD,EAAQD,EAASF,GAGjC,IAAIwD,EAAWxD,EAAoB,GAC/B4V,EAAO5V,EAAoB,IAAIgW,SAEnChW,EAAoB,GAApBA,CAAwB,OAAQ,SAAUuuB,GACxC,OAAO,SAASC,KAAK/qB,GACnB,OAAO8qB,GAAS/qB,EAASC,GAAM8qB,EAAM3Y,EAAKnS,IAAOA,MAO/C,SAAUtD,EAAQD,EAASF,GAGjC,IAAIwD,EAAWxD,EAAoB,GAC/B4V,EAAO5V,EAAoB,IAAIgW,SAEnChW,EAAoB,GAApBA,CAAwB,oBAAqB,SAAUyuB,GACrD,OAAO,SAAShZ,kBAAkBhS,GAChC,OAAOgrB,GAAsBjrB,EAASC,GAAMgrB,EAAmB7Y,EAAKnS,IAAOA,MAOzE,SAAUtD,EAAQD,EAASF,GAGjC,IAAIwD,EAAWxD,EAAoB,GAEnCA,EAAoB,GAApBA,CAAwB,WAAY,SAAU0uB,GAC5C,OAAO,SAASC,SAASlrB,GACvB,OAAOD,EAASC,MAAMirB,GAAYA,EAAUjrB,OAO1C,SAAUtD,EAAQD,EAASF,GAGjC,IAAIwD,EAAWxD,EAAoB,GAEnCA,EAAoB,GAApBA,CAAwB,WAAY,SAAU4uB,GAC5C,OAAO,SAASC,SAASprB,GACvB,OAAOD,EAASC,MAAMmrB,GAAYA,EAAUnrB,OAO1C,SAAUtD,EAAQD,EAASF,GAGjC,IAAIwD,EAAWxD,EAAoB,GAEnCA,EAAoB,GAApBA,CAAwB,eAAgB,SAAU8uB,GAChD,OAAO,SAASvZ,aAAa9R,GAC3B,QAAOD,EAASC,MAAMqrB,GAAgBA,EAAcrrB,QAOlD,SAAUtD,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,EAAG,SAAU,CAAEqa,OAAQ/c,EAAoB,OAKjE,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAClCkC,EAAQA,EAAQgB,EAAG,SAAU,CAAEoZ,GAAItc,EAAoB,QAKjD,SAAUG,EAAQD,GAGxBC,EAAOD,QAAUW,OAAOyb,IAAM,SAASA,GAAGyB,EAAGgR,GAE3C,OAAOhR,IAAMgR,EAAU,IAANhR,GAAW,EAAIA,GAAM,EAAIgR,EAAIhR,GAAKA,GAAKgR,GAAKA,IAMzD,SAAU5uB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAClCkC,EAAQA,EAAQgB,EAAG,SAAU,CAAEma,eAAgBrd,EAAoB,IAAIqP,OAKjE,SAAUlP,EAAQD,EAASF,GAKjC,IAAIgL,EAAUhL,EAAoB,IAC9BmH,EAAO,GACXA,EAAKnH,EAAoB,EAApBA,CAAuB,gBAAkB,IAC1CmH,EAAO,IAAM,cACfnH,EAAoB,GAApBA,CAAwBa,OAAOW,UAAW,WAAY,SAASuE,WAC7D,MAAO,WAAaiF,EAAQhF,MAAQ,MACnC,IAMC,SAAU7F,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQY,EAAG,WAAY,CAAEyjB,KAAMvmB,EAAoB,QAKrD,SAAUG,EAAQD,EAASF,GAEjC,IAAIuE,EAAKvE,EAAoB,GAAGwE,EAC5BwqB,EAAS5rB,SAAS5B,UAClBytB,EAAS,wBACF,SAGHD,GAAUhvB,EAAoB,IAAMuE,EAAGyqB,EAHpC,OAGkD,CAC3DjuB,cAAc,EACdE,IAAK,WACH,IACE,OAAQ,GAAK+E,MAAMkpB,MAAMD,GAAQ,GACjC,MAAOlrB,GACP,MAAO,QAQP,SAAU5D,EAAQD,EAASF,GAIjC,IAAIwD,EAAWxD,EAAoB,GAC/BwG,EAAiBxG,EAAoB,IACrCmvB,EAAenvB,EAAoB,EAApBA,CAAuB,eACtCovB,EAAgBhsB,SAAS5B,UAEvB2tB,KAAgBC,GAAgBpvB,EAAoB,GAAGwE,EAAE4qB,EAAeD,EAAc,CAAExqB,MAAO,SAAUF,GAC7G,GAAmB,mBAARuB,OAAuBxC,EAASiB,GAAI,OAAO,EACtD,IAAKjB,EAASwC,KAAKxE,WAAY,OAAOiD,aAAauB,KAEnD,KAAOvB,EAAI+B,EAAe/B,IAAI,GAAIuB,KAAKxE,YAAciD,EAAG,OAAO,EAC/D,OAAO,MAMH,SAAUtE,EAAQD,EAASF,GAIjC,IAAI4B,EAAS5B,EAAoB,GAC7BmF,EAAMnF,EAAoB,IAC1B0W,EAAM1W,EAAoB,IAC1B8a,EAAoB9a,EAAoB,IACxCsE,EAActE,EAAoB,IAClC0G,EAAQ1G,EAAoB,GAC5BkL,EAAOlL,EAAoB,IAAIwE,EAC/B2B,EAAOnG,EAAoB,IAAIwE,EAC/BD,EAAKvE,EAAoB,GAAGwE,EAC5BwiB,EAAQhnB,EAAoB,IAAI6X,KAChCwX,EAAS,SACTC,EAAU1tB,EAAOytB,GACjB9b,EAAO+b,EACPve,EAAQue,EAAQ9tB,UAEhB+tB,EAAa7Y,EAAI1W,EAAoB,GAApBA,CAAwB+Q,KAAWse,EACpDG,EAAO,SAAU1pB,OAAOtE,UAGxBiuB,EAAW,SAAUC,GACvB,IAAIjsB,EAAKa,EAAYorB,GAAU,GAC/B,GAAiB,iBAANjsB,GAA8B,EAAZA,EAAG4D,OAAY,CAE1C,IACIsoB,EAAOtI,EAAOuI,EADdC,GADJpsB,EAAK+rB,EAAO/rB,EAAGoU,OAASmP,EAAMvjB,EAAI,IACnB0a,WAAW,GAE1B,GAAc,KAAV0R,GAA0B,KAAVA,GAElB,GAAc,MADdF,EAAQlsB,EAAG0a,WAAW,KACQ,MAAVwR,EAAe,OAAO7L,SACrC,GAAc,KAAV+L,EAAc,CACvB,OAAQpsB,EAAG0a,WAAW,IACpB,KAAK,GAAI,KAAK,GAAIkJ,EAAQ,EAAGuI,EAAU,GAAI,MAC3C,KAAK,GAAI,KAAK,IAAKvI,EAAQ,EAAGuI,EAAU,GAAI,MAC5C,QAAS,OAAQnsB,EAEnB,IAAK,IAAoDqsB,EAAhDC,EAAStsB,EAAGmE,MAAM,GAAIxH,EAAI,EAAGC,EAAI0vB,EAAO1oB,OAAcjH,EAAIC,EAAGD,IAIpE,IAHA0vB,EAAOC,EAAO5R,WAAW/d,IAGd,IAAawvB,EAAPE,EAAgB,OAAOhM,IACxC,OAAOoD,SAAS6I,EAAQ1I,IAE5B,OAAQ5jB,GAGZ,IAAK6rB,EAAQ,UAAYA,EAAQ,QAAUA,EAAQ,QAAS,CAC1DA,EAAU,SAASU,OAAOrrB,GACxB,IAAIlB,EAAKkE,UAAUN,OAAS,EAAI,EAAI1C,EAChC6C,EAAOxB,KACX,OAAOwB,aAAgB8nB,IAEjBC,EAAa7oB,EAAM,WAAcqK,EAAMhJ,QAAQzH,KAAKkH,KAAYkP,EAAIlP,IAAS6nB,GAC7EvU,EAAkB,IAAIvH,EAAKkc,EAAShsB,IAAM+D,EAAM8nB,GAAWG,EAAShsB,IAE5E,IAAK,IAMgBpB,EANZkH,EAAOvJ,EAAoB,GAAKkL,EAAKqI,GAAQ,6KAMpD/N,MAAM,KAAM2X,EAAI,EAAsBA,EAAd5T,EAAKlC,OAAY8V,IACrChY,EAAIoO,EAAMlR,EAAMkH,EAAK4T,MAAQhY,EAAImqB,EAASjtB,IAC5CkC,EAAG+qB,EAASjtB,EAAK8D,EAAKoN,EAAMlR,KAGhCitB,EAAQ9tB,UAAYuP,GACdtK,YAAc6oB,EACpBtvB,EAAoB,GAApBA,CAAwB4B,EAAQytB,EAAQC,KAMpC,SAAUnvB,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B6E,EAAY7E,EAAoB,IAChCiwB,EAAejwB,EAAoB,KACnC0d,EAAS1d,EAAoB,IAC7BkwB,EAAW,GAAIC,QACfloB,EAAQrE,KAAKqE,MACb0L,EAAO,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,GACvByc,EAAQ,wCAGRC,EAAW,SAAUnvB,EAAGV,GAG1B,IAFA,IAAIJ,GAAK,EACLkwB,EAAK9vB,IACAJ,EAAI,GAEXuT,EAAKvT,IADLkwB,GAAMpvB,EAAIyS,EAAKvT,IACA,IACfkwB,EAAKroB,EAAMqoB,EAAK,MAGhBC,EAAS,SAAUrvB,GAGrB,IAFA,IAAId,EAAI,EACJI,EAAI,EACM,KAALJ,GAEPuT,EAAKvT,GAAK6H,GADVzH,GAAKmT,EAAKvT,IACUc,GACpBV,EAAKA,EAAIU,EAAK,KAGdsvB,EAAc,WAGhB,IAFA,IAAIpwB,EAAI,EACJuB,EAAI,GACM,KAALvB,GACP,GAAU,KAANuB,GAAkB,IAANvB,GAAuB,IAAZuT,EAAKvT,GAAU,CACxC,IAAIqwB,EAAI3qB,OAAO6N,EAAKvT,IACpBuB,EAAU,KAANA,EAAW8uB,EAAI9uB,EAAI+b,EAAOpd,KA1BzB,IA0BoC,EAAImwB,EAAEppB,QAAUopB,EAE3D,OAAO9uB,GAEPkhB,EAAM,SAAU9E,EAAG7c,EAAGwvB,GACxB,OAAa,IAANxvB,EAAUwvB,EAAMxvB,EAAI,GAAM,EAAI2hB,EAAI9E,EAAG7c,EAAI,EAAGwvB,EAAM3S,GAAK8E,EAAI9E,EAAIA,EAAG7c,EAAI,EAAGwvB,IAelFxuB,EAAQA,EAAQY,EAAIZ,EAAQQ,KAAOwtB,IACV,UAAvB,KAAQC,QAAQ,IACG,MAAnB,GAAIA,QAAQ,IACS,SAArB,MAAMA,QAAQ,IACuB,yBAArC,mBAAsBA,QAAQ,MAC1BnwB,EAAoB,EAApBA,CAAuB,WAE3BkwB,EAAS5vB,KAAK,OACX,SAAU,CACb6vB,QAAS,SAASA,QAAQQ,GACxB,IAII5sB,EAAG6sB,EAAGzT,EAAGH,EAJTe,EAAIkS,EAAajqB,KAAMoqB,GACvB5rB,EAAIK,EAAU8rB,GACdhvB,EAAI,GACJpB,EA3DG,IA6DP,GAAIiE,EAAI,GAAS,GAAJA,EAAQ,MAAMwH,WAAWokB,GAEtC,GAAIrS,GAAKA,EAAG,MAAO,MACnB,GAAIA,IAAM,MAAa,MAALA,EAAW,OAAOjY,OAAOiY,GAK3C,GAJIA,EAAI,IACNpc,EAAI,IACJoc,GAAKA,GAEC,MAAJA,EAKF,GAHA6S,GADA7sB,EArCI,SAAUga,GAGlB,IAFA,IAAI7c,EAAI,EACJ2vB,EAAK9S,EACI,MAAN8S,GACL3vB,GAAK,GACL2vB,GAAM,KAER,KAAa,GAANA,GACL3vB,GAAK,EACL2vB,GAAM,EACN,OAAO3vB,EA2BD4hB,CAAI/E,EAAI8E,EAAI,EAAG,GAAI,IAAM,IACrB,EAAI9E,EAAI8E,EAAI,GAAI9e,EAAG,GAAKga,EAAI8E,EAAI,EAAG9e,EAAG,GAC9C6sB,GAAK,iBAEG,GADR7sB,EAAI,GAAKA,GACE,CAGT,IAFAssB,EAAS,EAAGO,GACZzT,EAAI3Y,EACQ,GAAL2Y,GACLkT,EAAS,IAAK,GACdlT,GAAK,EAIP,IAFAkT,EAASxN,EAAI,GAAI1F,EAAG,GAAI,GACxBA,EAAIpZ,EAAI,EACI,IAALoZ,GACLoT,EAAO,GAAK,IACZpT,GAAK,GAEPoT,EAAO,GAAKpT,GACZkT,EAAS,EAAG,GACZE,EAAO,GACPhwB,EAAIiwB,SAEJH,EAAS,EAAGO,GACZP,EAAS,IAAMtsB,EAAG,GAClBxD,EAAIiwB,IAAgB9S,EAAOpd,KA9FxB,IA8FmCkE,GAQxC,OAHAjE,EAFM,EAAJiE,EAEE7C,IADJqb,EAAIzc,EAAE8G,SACQ7C,EAAI,KAAOkZ,EAAOpd,KAnG3B,IAmGsCkE,EAAIwY,GAAKzc,EAAIA,EAAEqH,MAAM,EAAGoV,EAAIxY,GAAK,IAAMjE,EAAEqH,MAAMoV,EAAIxY,IAE1F7C,EAAIpB,MAQR,SAAUJ,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B+rB,EAAS/rB,EAAoB,GAC7BiwB,EAAejwB,EAAoB,KACnC8wB,EAAe,GAAIC,YAEvB7uB,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAKqpB,EAAO,WAEtC,MAA2C,MAApC+E,EAAaxwB,KAAK,EAAGT,QACvBksB,EAAO,WAEZ+E,EAAaxwB,KAAK,OACf,SAAU,CACbywB,YAAa,SAASA,YAAYC,GAChC,IAAIxpB,EAAOyoB,EAAajqB,KAAM,6CAC9B,OAAOgrB,IAAcnxB,GAAYixB,EAAaxwB,KAAKkH,GAAQspB,EAAaxwB,KAAKkH,EAAMwpB,OAOjF,SAAU7wB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,SAAU,CAAEqkB,QAAS3jB,KAAKif,IAAI,GAAI,OAK/C,SAAU1iB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BixB,EAAYjxB,EAAoB,GAAG6mB,SAEvC3kB,EAAQA,EAAQgB,EAAG,SAAU,CAC3B2jB,SAAU,SAASA,SAASpjB,GAC1B,MAAoB,iBAANA,GAAkBwtB,EAAUxtB,OAOxC,SAAUtD,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,SAAU,CAAE0jB,UAAW5mB,EAAoB,QAKxD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,SAAU,CAC3BgF,MAAO,SAASA,MAAM6hB,GAEpB,OAAOA,GAAUA,MAOf,SAAU5pB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B4mB,EAAY5mB,EAAoB,KAChC4iB,EAAMhf,KAAKgf,IAEf1gB,EAAQA,EAAQgB,EAAG,SAAU,CAC3BguB,cAAe,SAASA,cAAcnH,GACpC,OAAOnD,EAAUmD,IAAWnH,EAAImH,IAAW,qBAOzC,SAAU5pB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,SAAU,CAAEiuB,iBAAkB,oBAK3C,SAAUhxB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,SAAU,CAAEkuB,kBAAmB,oBAK5C,SAAUjxB,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B8mB,EAAc9mB,EAAoB,KAEtCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAKstB,OAAOjJ,YAAcD,GAAc,SAAU,CAAEC,WAAYD,KAKtF,SAAU3mB,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9BinB,EAAYjnB,EAAoB,KAEpCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAKstB,OAAO9I,UAAYD,GAAY,SAAU,CAAEC,SAAUD,KAKhF,SAAU9mB,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9BinB,EAAYjnB,EAAoB,KAEpCkC,EAAQA,EAAQU,EAAIV,EAAQQ,GAAKwkB,UAAYD,GAAY,CAAEC,SAAUD,KAK/D,SAAU9mB,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B8mB,EAAc9mB,EAAoB,KAEtCkC,EAAQA,EAAQU,EAAIV,EAAQQ,GAAKqkB,YAAcD,GAAc,CAAEC,WAAYD,KAKrE,SAAU3mB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BsnB,EAAQtnB,EAAoB,KAC5BqxB,EAAOztB,KAAKytB,KACZC,EAAS1tB,KAAK2tB,MAElBrvB,EAAQA,EAAQgB,EAAIhB,EAAQQ,IAAM4uB,GAEW,KAAxC1tB,KAAKqE,MAAMqpB,EAAOtB,OAAOwB,aAEzBF,EAAOzT,WAAaA,UACtB,OAAQ,CACT0T,MAAO,SAASA,MAAMxT,GACpB,OAAQA,GAAKA,GAAK,EAAI+F,IAAU,kBAAJ/F,EACxBna,KAAKkf,IAAI/E,GAAKna,KAAKmf,IACnBuE,EAAMvJ,EAAI,EAAIsT,EAAKtT,EAAI,GAAKsT,EAAKtT,EAAI,QAOvC,SAAU5d,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9ByxB,EAAS7tB,KAAK8tB,MAOlBxvB,EAAQA,EAAQgB,EAAIhB,EAAQQ,IAAM+uB,GAA0B,EAAhB,EAAIA,EAAO,IAAS,OAAQ,CAAEC,MAL1E,SAASA,MAAM3T,GACb,OAAQ8I,SAAS9I,GAAKA,IAAW,GAALA,EAAaA,EAAI,GAAK2T,OAAO3T,GAAKna,KAAKkf,IAAI/E,EAAIna,KAAKytB,KAAKtT,EAAIA,EAAI,IAAxDA,MASjC,SAAU5d,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B2xB,EAAS/tB,KAAKguB,MAGlB1vB,EAAQA,EAAQgB,EAAIhB,EAAQQ,IAAMivB,GAAU,EAAIA,GAAQ,GAAK,GAAI,OAAQ,CACvEC,MAAO,SAASA,MAAM7T,GACpB,OAAmB,IAAXA,GAAKA,GAAUA,EAAIna,KAAKkf,KAAK,EAAI/E,IAAM,EAAIA,IAAM,MAOvD,SAAU5d,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B8d,EAAO9d,EAAoB,IAE/BkC,EAAQA,EAAQgB,EAAG,OAAQ,CACzB2uB,KAAM,SAASA,KAAK9T,GAClB,OAAOD,EAAKC,GAAKA,GAAKna,KAAKif,IAAIjf,KAAKgf,IAAI7E,GAAI,EAAI,OAO9C,SAAU5d,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CACzB4uB,MAAO,SAASA,MAAM/T,GACpB,OAAQA,KAAO,GAAK,GAAKna,KAAKqE,MAAMrE,KAAKkf,IAAI/E,EAAI,IAAOna,KAAKmuB,OAAS,OAOpE,SAAU5xB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BwC,EAAMoB,KAAKpB,IAEfN,EAAQA,EAAQgB,EAAG,OAAQ,CACzB8uB,KAAM,SAASA,KAAKjU,GAClB,OAAQvb,EAAIub,GAAKA,GAAKvb,GAAKub,IAAM,MAO/B,SAAU5d,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Bge,EAAShe,EAAoB,IAEjCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAKsb,GAAUpa,KAAKqa,OAAQ,OAAQ,CAAEA,MAAOD,KAKnE,SAAU7d,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CAAEykB,OAAQ3nB,EAAoB,QAKnD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B4iB,EAAMhf,KAAKgf,IAEf1gB,EAAQA,EAAQgB,EAAG,OAAQ,CACzB+uB,MAAO,SAASA,MAAMC,EAAQC,GAM5B,IALA,IAIIrqB,EAAKsqB,EAJLC,EAAM,EACNjyB,EAAI,EACJiQ,EAAO1I,UAAUN,OACjBirB,EAAO,EAEJlyB,EAAIiQ,GAELiiB,GADJxqB,EAAM8a,EAAIjb,UAAUvH,QAGlBiyB,EAAMA,GADND,EAAME,EAAOxqB,GACKsqB,EAAM,EACxBE,EAAOxqB,GAGPuqB,GAFe,EAANvqB,GACTsqB,EAAMtqB,EAAMwqB,GACCF,EACDtqB,EAEhB,OAAOwqB,IAASzU,SAAWA,SAAWyU,EAAO1uB,KAAKytB,KAAKgB,OAOrD,SAAUlyB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BuyB,EAAQ3uB,KAAK4uB,KAGjBtwB,EAAQA,EAAQgB,EAAIhB,EAAQQ,EAAI1C,EAAoB,EAApBA,CAAuB,WACrD,OAAgC,GAAzBuyB,EAAM,WAAY,IAA4B,GAAhBA,EAAMlrB,SACzC,OAAQ,CACVmrB,KAAM,SAASA,KAAKzU,EAAGgR,GACrB,IAAI0D,EAAS,MACTC,GAAM3U,EACN4U,GAAM5D,EACN6D,EAAKH,EAASC,EACdG,EAAKJ,EAASE,EAClB,OAAO,EAAIC,EAAKC,IAAOJ,EAASC,IAAO,IAAMG,EAAKD,GAAMH,EAASE,IAAO,KAAO,KAAO,OAOpF,SAAUxyB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CACzB4vB,MAAO,SAASA,MAAM/U,GACpB,OAAOna,KAAKkf,IAAI/E,GAAKna,KAAKmvB,WAOxB,SAAU5yB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CAAEokB,MAAOtnB,EAAoB,QAKlD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CACzB8vB,KAAM,SAASA,KAAKjV,GAClB,OAAOna,KAAKkf,IAAI/E,GAAKna,KAAKmf,QAOxB,SAAU5iB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CAAE4a,KAAM9d,EAAoB,OAKjD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Bie,EAAQje,EAAoB,IAC5BwC,EAAMoB,KAAKpB,IAGfN,EAAQA,EAAQgB,EAAIhB,EAAQQ,EAAI1C,EAAoB,EAApBA,CAAuB,WACrD,OAA8B,QAAtB4D,KAAKqvB,MAAM,SACjB,OAAQ,CACVA,KAAM,SAASA,KAAKlV,GAClB,OAAOna,KAAKgf,IAAI7E,GAAKA,GAAK,GACrBE,EAAMF,GAAKE,GAAOF,IAAM,GACxBvb,EAAIub,EAAI,GAAKvb,GAAKub,EAAI,KAAOna,KAAK4pB,EAAI,OAOzC,SAAUrtB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Bie,EAAQje,EAAoB,IAC5BwC,EAAMoB,KAAKpB,IAEfN,EAAQA,EAAQgB,EAAG,OAAQ,CACzBgwB,KAAM,SAASA,KAAKnV,GAClB,IAAInZ,EAAIqZ,EAAMF,GAAKA,GACftW,EAAIwW,GAAOF,GACf,OAAOnZ,GAAKiZ,SAAW,EAAIpW,GAAKoW,UAAY,GAAKjZ,EAAI6C,IAAMjF,EAAIub,GAAKvb,GAAKub,QAOvE,SAAU5d,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CACzBiwB,MAAO,SAASA,MAAM1vB,GACpB,OAAa,EAALA,EAASG,KAAKqE,MAAQrE,KAAKoE,MAAMvE,OAOvC,SAAUtD,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B+K,EAAkB/K,EAAoB,IACtCozB,EAAettB,OAAOstB,aACtBC,EAAiBvtB,OAAOwtB,cAG5BpxB,EAAQA,EAAQgB,EAAIhB,EAAQQ,KAAO2wB,GAA2C,GAAzBA,EAAehsB,QAAc,SAAU,CAE1FisB,cAAe,SAASA,cAAcvV,GAKpC,IAJA,IAGI+R,EAHA7mB,EAAM,GACNoH,EAAO1I,UAAUN,OACjBjH,EAAI,EAEMA,EAAPiQ,GAAU,CAEf,GADAyf,GAAQnoB,UAAUvH,KACd2K,EAAgB+kB,EAAM,WAAcA,EAAM,MAAM9jB,WAAW8jB,EAAO,8BACtE7mB,EAAIG,KAAK0mB,EAAO,MACZsD,EAAatD,GACbsD,EAAyC,QAA1BtD,GAAQ,QAAY,IAAcA,EAAO,KAAQ,QAEpE,OAAO7mB,EAAIpD,KAAK,QAOhB,SAAU1F,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9BkG,EAAYlG,EAAoB,IAChCoI,EAAWpI,EAAoB,GAEnCkC,EAAQA,EAAQgB,EAAG,SAAU,CAE3BqwB,IAAK,SAASA,IAAIC,GAMhB,IALA,IAAIC,EAAMvtB,EAAUstB,EAASD,KACzB7gB,EAAMtK,EAASqrB,EAAIpsB,QACnBgJ,EAAO1I,UAAUN,OACjB4B,EAAM,GACN7I,EAAI,EACKA,EAANsS,GACLzJ,EAAIG,KAAKtD,OAAO2tB,EAAIrzB,OAChBA,EAAIiQ,GAAMpH,EAAIG,KAAKtD,OAAO6B,UAAUvH,KACxC,OAAO6I,EAAIpD,KAAK,QAOhB,SAAU1F,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,OAAQ,SAAUgnB,GACxC,OAAO,SAASnP,OACd,OAAOmP,EAAMhhB,KAAM,OAOjB,SAAU7F,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B0zB,EAAM1zB,EAAoB,GAApBA,EAAwB,GAClCkC,EAAQA,EAAQY,EAAG,SAAU,CAE3B6wB,YAAa,SAASA,YAAYzV,GAChC,OAAOwV,EAAI1tB,KAAMkY,OAOf,SAAU/d,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BoI,EAAWpI,EAAoB,GAC/B4zB,EAAU5zB,EAAoB,IAC9B6zB,EAAY,WACZC,EAAY,GAAGD,GAEnB3xB,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAI1C,EAAoB,GAApBA,CAAwB6zB,GAAY,SAAU,CAC5EE,SAAU,SAASA,SAAS3V,GAC1B,IAAI5W,EAAOosB,EAAQ5tB,KAAMoY,EAAcyV,GACnCG,EAAiC,EAAnBrsB,UAAUN,OAAaM,UAAU,GAAK9H,GACpD6S,EAAMtK,EAASZ,EAAKH,QACpB+K,EAAM4hB,IAAgBn0B,GAAY6S,EAAM9O,KAAKkB,IAAIsD,EAAS4rB,GAActhB,GACxEuhB,EAASnuB,OAAOsY,GACpB,OAAO0V,EACHA,EAAUxzB,KAAKkH,EAAMysB,EAAQ7hB,GAC7B5K,EAAKI,MAAMwK,EAAM6hB,EAAO5sB,OAAQ+K,KAAS6hB,MAO3C,SAAU9zB,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B4zB,EAAU5zB,EAAoB,IAC9Bk0B,EAAW,WAEfhyB,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAI1C,EAAoB,GAApBA,CAAwBk0B,GAAW,SAAU,CAC3EviB,SAAU,SAASA,SAASyM,GAC1B,SAAUwV,EAAQ5tB,KAAMoY,EAAc8V,GACnCziB,QAAQ2M,EAAiC,EAAnBzW,UAAUN,OAAaM,UAAU,GAAK9H,QAO7D,SAAUM,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQY,EAAG,SAAU,CAE3B4a,OAAQ1d,EAAoB,OAMxB,SAAUG,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BoI,EAAWpI,EAAoB,GAC/B4zB,EAAU5zB,EAAoB,IAC9Bm0B,EAAc,aACdC,EAAc,GAAGD,GAErBjyB,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAI1C,EAAoB,GAApBA,CAAwBm0B,GAAc,SAAU,CAC9EE,WAAY,SAASA,WAAWjW,GAC9B,IAAI5W,EAAOosB,EAAQ5tB,KAAMoY,EAAc+V,GACnCjrB,EAAQd,EAASxE,KAAKkB,IAAuB,EAAnB6C,UAAUN,OAAaM,UAAU,GAAK9H,GAAW2H,EAAKH,SAChF4sB,EAASnuB,OAAOsY,GACpB,OAAOgW,EACHA,EAAY9zB,KAAKkH,EAAMysB,EAAQ/qB,GAC/B1B,EAAKI,MAAMsB,EAAOA,EAAQ+qB,EAAO5sB,UAAY4sB,MAO/C,SAAU9zB,EAAQD,EAASF,GAIjC,IAAI0zB,EAAM1zB,EAAoB,GAApBA,EAAwB,GAGlCA,EAAoB,GAApBA,CAAwB8F,OAAQ,SAAU,SAAU4Y,GAClD1Y,KAAK8R,GAAKhS,OAAO4Y,GACjB1Y,KAAK2Y,GAAK,GAET,WACD,IAEI2V,EAFA7vB,EAAIuB,KAAK8R,GACT5O,EAAQlD,KAAK2Y,GAEjB,OAAala,EAAE4C,QAAX6B,EAA0B,CAAEvE,MAAO9E,GAAW6Q,MAAM,IACxD4jB,EAAQZ,EAAIjvB,EAAGyE,GACflD,KAAK2Y,IAAM2V,EAAMjtB,OACV,CAAE1C,MAAO2vB,EAAO5jB,MAAM,OAMzB,SAAUvQ,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,SAAU,SAAU4G,GAC1C,OAAO,SAAS2tB,OAAO7zB,GACrB,OAAOkG,EAAWZ,KAAM,IAAK,OAAQtF,OAOnC,SAAUP,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,MAAO,SAAU4G,GACvC,OAAO,SAAS4tB,MACd,OAAO5tB,EAAWZ,KAAM,MAAO,GAAI,QAOjC,SAAU7F,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,QAAS,SAAU4G,GACzC,OAAO,SAAS6tB,QACd,OAAO7tB,EAAWZ,KAAM,QAAS,GAAI,QAOnC,SAAU7F,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,OAAQ,SAAU4G,GACxC,OAAO,SAAS8tB,OACd,OAAO9tB,EAAWZ,KAAM,IAAK,GAAI,QAO/B,SAAU7F,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,QAAS,SAAU4G,GACzC,OAAO,SAAS+tB,QACd,OAAO/tB,EAAWZ,KAAM,KAAM,GAAI,QAOhC,SAAU7F,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,YAAa,SAAU4G,GAC7C,OAAO,SAASguB,UAAUC,GACxB,OAAOjuB,EAAWZ,KAAM,OAAQ,QAAS6uB,OAOvC,SAAU10B,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,WAAY,SAAU4G,GAC5C,OAAO,SAASkuB,SAASC,GACvB,OAAOnuB,EAAWZ,KAAM,OAAQ,OAAQ+uB,OAOtC,SAAU50B,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,UAAW,SAAU4G,GAC3C,OAAO,SAASouB,UACd,OAAOpuB,EAAWZ,KAAM,IAAK,GAAI,QAO/B,SAAU7F,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,OAAQ,SAAU4G,GACxC,OAAO,SAASquB,KAAKC,GACnB,OAAOtuB,EAAWZ,KAAM,IAAK,OAAQkvB,OAOnC,SAAU/0B,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,QAAS,SAAU4G,GACzC,OAAO,SAASuuB,QACd,OAAOvuB,EAAWZ,KAAM,QAAS,GAAI,QAOnC,SAAU7F,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,SAAU,SAAU4G,GAC1C,OAAO,SAASwuB,SACd,OAAOxuB,EAAWZ,KAAM,SAAU,GAAI,QAOpC,SAAU7F,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,MAAO,SAAU4G,GACvC,OAAO,SAASyuB,MACd,OAAOzuB,EAAWZ,KAAM,MAAO,GAAI,QAOjC,SAAU7F,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,MAAO,SAAU4G,GACvC,OAAO,SAAS0uB,MACd,OAAO1uB,EAAWZ,KAAM,MAAO,GAAI,QAOjC,SAAU7F,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,QAAS,CAAEsV,QAASxY,EAAoB,OAKrD,SAAUG,EAAQD,EAASF,GAIjC,IAAIgC,EAAMhC,EAAoB,IAC1BkC,EAAUlC,EAAoB,GAC9BqG,EAAWrG,EAAoB,GAC/BM,EAAON,EAAoB,KAC3BiL,EAAcjL,EAAoB,IAClCoI,EAAWpI,EAAoB,GAC/Bu1B,EAAiBv1B,EAAoB,IACrCmL,EAAYnL,EAAoB,IAEpCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAK1C,EAAoB,GAApBA,CAAwB,SAAUoU,GAAQ9H,MAAM4D,KAAKkE,KAAW,QAAS,CAExGlE,KAAM,SAASA,KAAKuC,GAClB,IAOIpL,EAAQ8B,EAAQgH,EAAMC,EAPtB3L,EAAI4B,EAASoM,GACb/C,EAAmB,mBAAR1J,KAAqBA,KAAOsG,MACvC+D,EAAO1I,UAAUN,OACjBiJ,EAAe,EAAPD,EAAW1I,UAAU,GAAK9H,GAClC0Q,EAAUD,IAAUzQ,GACpBqJ,EAAQ,EACRsH,EAASrF,EAAU1G,GAIvB,GAFI8L,IAASD,EAAQtO,EAAIsO,EAAc,EAAPD,EAAW1I,UAAU,GAAK9H,GAAW,IAEjE2Q,GAAU3Q,IAAe6P,GAAKpD,OAASrB,EAAYuF,GAMrD,IAAKrH,EAAS,IAAIuG,EADlBrI,EAASe,EAAS3D,EAAE4C,SACkB6B,EAAT7B,EAAgB6B,IAC3CqsB,EAAepsB,EAAQD,EAAOqH,EAAUD,EAAM7L,EAAEyE,GAAQA,GAASzE,EAAEyE,SANrE,IAAKkH,EAAWI,EAAOlQ,KAAKmE,GAAI0E,EAAS,IAAIuG,IAAOS,EAAOC,EAASK,QAAQC,KAAMxH,IAChFqsB,EAAepsB,EAAQD,EAAOqH,EAAUjQ,EAAK8P,EAAUE,EAAO,CAACH,EAAKxL,MAAOuE,IAAQ,GAAQiH,EAAKxL,OASpG,OADAwE,EAAO9B,OAAS6B,EACTC,MAOL,SAAUhJ,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9Bu1B,EAAiBv1B,EAAoB,IAGzCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,EAAI1C,EAAoB,EAApBA,CAAuB,WACrD,SAAS0C,KACT,QAAS4J,MAAMsE,GAAGtQ,KAAKoC,aAAcA,KACnC,QAAS,CAEXkO,GAAI,SAASA,KAIX,IAHA,IAAI1H,EAAQ,EACRmH,EAAO1I,UAAUN,OACjB8B,EAAS,IAAoB,mBAARnD,KAAqBA,KAAOsG,OAAO+D,GAC9CnH,EAAPmH,GAAcklB,EAAepsB,EAAQD,EAAOvB,UAAUuB,MAE7D,OADAC,EAAO9B,OAASgJ,EACTlH,MAOL,SAAUhJ,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BkG,EAAYlG,EAAoB,IAChC8N,EAAY,GAAGjI,KAGnB3D,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAK1C,EAAoB,KAAOa,SAAWb,EAAoB,GAApBA,CAAwB8N,IAAa,QAAS,CACnHjI,KAAM,SAASA,KAAK+L,GAClB,OAAO9D,EAAUxN,KAAK4F,EAAUF,MAAO4L,IAAc/R,GAAY,IAAM+R,OAOrE,SAAUzR,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9Bkf,EAAOlf,EAAoB,IAC3B0W,EAAM1W,EAAoB,IAC1B+K,EAAkB/K,EAAoB,IACtCoI,EAAWpI,EAAoB,GAC/BiO,EAAa,GAAGrG,MAGpB1F,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAI1C,EAAoB,EAApBA,CAAuB,WACjDkf,GAAMjR,EAAW3N,KAAK4e,KACxB,QAAS,CACXtX,MAAO,SAASA,MAAMuK,EAAOC,GAC3B,IAAIM,EAAMtK,EAASpC,KAAKqB,QACpB6M,EAAQwC,EAAI1Q,MAEhB,GADAoM,EAAMA,IAAQvS,GAAY6S,EAAMN,EACnB,SAAT8B,EAAkB,OAAOjG,EAAW3N,KAAK0F,KAAMmM,EAAOC,GAM1D,IALA,IAAInB,EAAQlG,EAAgBoH,EAAOO,GAC/B8iB,EAAOzqB,EAAgBqH,EAAKM,GAC5BqiB,EAAO3sB,EAASotB,EAAOvkB,GACvBwkB,EAAS,IAAInpB,MAAMyoB,GACnB30B,EAAI,EACDA,EAAI20B,EAAM30B,IAAKq1B,EAAOr1B,GAAc,UAAT8T,EAC9BlO,KAAK0W,OAAOzL,EAAQ7Q,GACpB4F,KAAKiL,EAAQ7Q,GACjB,OAAOq1B,MAOL,SAAUt1B,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BsH,EAAYtH,EAAoB,IAChCqG,EAAWrG,EAAoB,GAC/B0G,EAAQ1G,EAAoB,GAC5B01B,EAAQ,GAAG1nB,KACX7G,EAAO,CAAC,EAAG,EAAG,GAElBjF,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAKgE,EAAM,WAErCS,EAAK6G,KAAKnO,QACL6G,EAAM,WAEXS,EAAK6G,KAAK,UAELhO,EAAoB,GAApBA,CAAwB01B,IAAS,QAAS,CAE/C1nB,KAAM,SAASA,KAAKiE,GAClB,OAAOA,IAAcpS,GACjB61B,EAAMp1B,KAAK+F,EAASL,OACpB0vB,EAAMp1B,KAAK+F,EAASL,MAAOsB,EAAU2K,QAOvC,SAAU9R,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B21B,EAAW31B,EAAoB,GAApBA,CAAwB,GACnC41B,EAAS51B,EAAoB,GAApBA,CAAwB,GAAGwR,SAAS,GAEjDtP,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAKkzB,EAAQ,QAAS,CAEhDpkB,QAAS,SAASA,QAAQxI,GACxB,OAAO2sB,EAAS3vB,KAAMgD,EAAYrB,UAAU,QAO1C,SAAUxH,EAAQD,EAASF,GAEjC,IAAIwD,EAAWxD,EAAoB,GAC/BwY,EAAUxY,EAAoB,IAC9BgX,EAAUhX,EAAoB,EAApBA,CAAuB,WAErCG,EAAOD,QAAU,SAAUqe,GACzB,IAAI7O,EASF,OARE8I,EAAQ+F,KAGM,mBAFhB7O,EAAI6O,EAAS9X,cAEkBiJ,IAAMpD,QAASkM,EAAQ9I,EAAElO,aAAakO,EAAI7P,IACrE2D,EAASkM,IAED,QADVA,EAAIA,EAAEsH,MACUtH,EAAI7P,KAEf6P,IAAM7P,GAAYyM,MAAQoD,IAM/B,SAAUvP,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B+O,EAAO/O,EAAoB,GAApBA,CAAwB,GAEnCkC,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAK1C,EAAoB,GAApBA,CAAwB,GAAG6R,KAAK,GAAO,QAAS,CAE/EA,IAAK,SAASA,IAAI7I,GAChB,OAAO+F,EAAK/I,KAAMgD,EAAYrB,UAAU,QAOtC,SAAUxH,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B61B,EAAU71B,EAAoB,GAApBA,CAAwB,GAEtCkC,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAK1C,EAAoB,GAApBA,CAAwB,GAAGoR,QAAQ,GAAO,QAAS,CAElFA,OAAQ,SAASA,OAAOpI,GACtB,OAAO6sB,EAAQ7vB,KAAMgD,EAAYrB,UAAU,QAOzC,SAAUxH,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B81B,EAAQ91B,EAAoB,GAApBA,CAAwB,GAEpCkC,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAK1C,EAAoB,GAApBA,CAAwB,GAAGgS,MAAM,GAAO,QAAS,CAEhFA,KAAM,SAASA,KAAKhJ,GAClB,OAAO8sB,EAAM9vB,KAAMgD,EAAYrB,UAAU,QAOvC,SAAUxH,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B+1B,EAAS/1B,EAAoB,GAApBA,CAAwB,GAErCkC,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAK1C,EAAoB,GAApBA,CAAwB,GAAGkR,OAAO,GAAO,QAAS,CAEjFA,MAAO,SAASA,MAAMlI,GACpB,OAAO+sB,EAAO/vB,KAAMgD,EAAYrB,UAAU,QAOxC,SAAUxH,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9Bg2B,EAAUh2B,EAAoB,KAElCkC,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAK1C,EAAoB,GAApBA,CAAwB,GAAG2N,QAAQ,GAAO,QAAS,CAElFA,OAAQ,SAASA,OAAO3E,GACtB,OAAOgtB,EAAQhwB,KAAMgD,EAAYrB,UAAUN,OAAQM,UAAU,IAAI,OAO/D,SAAUxH,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9Bg2B,EAAUh2B,EAAoB,KAElCkC,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAK1C,EAAoB,GAApBA,CAAwB,GAAG6N,aAAa,GAAO,QAAS,CAEvFA,YAAa,SAASA,YAAY7E,GAChC,OAAOgtB,EAAQhwB,KAAMgD,EAAYrB,UAAUN,OAAQM,UAAU,IAAI,OAO/D,SAAUxH,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9Bi2B,EAAWj2B,EAAoB,GAApBA,EAAwB,GACnCyZ,EAAU,GAAGhI,QACbykB,IAAkBzc,GAAW,EAAI,CAAC,GAAGhI,QAAQ,GAAI,GAAK,EAE1DvP,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAKwzB,IAAkBl2B,EAAoB,GAApBA,CAAwByZ,IAAW,QAAS,CAE7FhI,QAAS,SAASA,QAAQC,GACxB,OAAOwkB,EAEHzc,EAAQ/R,MAAM1B,KAAM2B,YAAc,EAClCsuB,EAASjwB,KAAM0L,EAAe/J,UAAU,QAO1C,SAAUxH,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BkG,EAAYlG,EAAoB,IAChC6E,EAAY7E,EAAoB,IAChCoI,EAAWpI,EAAoB,GAC/ByZ,EAAU,GAAGhM,YACbyoB,IAAkBzc,GAAW,EAAI,CAAC,GAAGhM,YAAY,GAAI,GAAK,EAE9DvL,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAKwzB,IAAkBl2B,EAAoB,GAApBA,CAAwByZ,IAAW,QAAS,CAE7FhM,YAAa,SAASA,YAAYiE,GAEhC,GAAIwkB,EAAe,OAAOzc,EAAQ/R,MAAM1B,KAAM2B,YAAc,EAC5D,IAAIlD,EAAIyB,EAAUF,MACdqB,EAASe,EAAS3D,EAAE4C,QACpB6B,EAAQ7B,EAAS,EAGrB,IAFuB,EAAnBM,UAAUN,SAAY6B,EAAQtF,KAAKkB,IAAIoE,EAAOrE,EAAU8C,UAAU,MAClEuB,EAAQ,IAAGA,EAAQ7B,EAAS6B,GACjB,GAATA,EAAYA,IAAS,GAAIA,KAASzE,GAAOA,EAAEyE,KAAWwI,EAAe,OAAOxI,GAAS,EAC3F,OAAQ,MAON,SAAU/I,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQY,EAAG,QAAS,CAAEkO,WAAYhR,EAAoB,OAE9DA,EAAoB,GAApBA,CAAwB,eAKlB,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQY,EAAG,QAAS,CAAEqO,KAAMnR,EAAoB,MAExDA,EAAoB,GAApBA,CAAwB,SAKlB,SAAUG,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9Bm2B,EAAQn2B,EAAoB,GAApBA,CAAwB,GAChCmI,EAAM,OACNiuB,GAAS,EAETjuB,IAAO,IAAImE,MAAM,GAAGnE,GAAK,WAAciuB,GAAS,IACpDl0B,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAI0zB,EAAQ,QAAS,CAC/C/kB,KAAM,SAASA,KAAKrI,GAClB,OAAOmtB,EAAMnwB,KAAMgD,EAA+B,EAAnBrB,UAAUN,OAAaM,UAAU,GAAK9H,OAGzEG,EAAoB,GAApBA,CAAwBmI,IAKlB,SAAUhI,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9Bm2B,EAAQn2B,EAAoB,GAApBA,CAAwB,GAChCmI,EAAM,YACNiuB,GAAS,EAETjuB,IAAO,IAAImE,MAAM,GAAGnE,GAAK,WAAciuB,GAAS,IACpDl0B,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAI0zB,EAAQ,QAAS,CAC/C7kB,UAAW,SAASA,UAAUvI,GAC5B,OAAOmtB,EAAMnwB,KAAMgD,EAA+B,EAAnBrB,UAAUN,OAAaM,UAAU,GAAK9H,OAGzEG,EAAoB,GAApBA,CAAwBmI,IAKlB,SAAUhI,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,UAKlB,SAAUG,EAAQD,EAASF,GAEjC,IAAI4B,EAAS5B,EAAoB,GAC7B8a,EAAoB9a,EAAoB,IACxCuE,EAAKvE,EAAoB,GAAGwE,EAC5B0G,EAAOlL,EAAoB,IAAIwE,EAC/BkU,EAAW1Y,EAAoB,IAC/Bq2B,EAASr2B,EAAoB,IAC7Bs2B,EAAU10B,EAAO4V,OACjBjE,EAAO+iB,EACPvlB,EAAQulB,EAAQ90B,UAChB+0B,EAAM,KACNC,EAAM,KAENC,EAAc,IAAIH,EAAQC,KAASA,EAEvC,GAAIv2B,EAAoB,MAAQy2B,GAAez2B,EAAoB,EAApBA,CAAuB,WAGpE,OAFAw2B,EAAIx2B,EAAoB,EAApBA,CAAuB,WAAY,EAEhCs2B,EAAQC,IAAQA,GAAOD,EAAQE,IAAQA,GAA4B,QAArBF,EAAQC,EAAK,QAC/D,CACHD,EAAU,SAAS9e,OAAO9V,EAAG8C,GAC3B,IAAIkyB,EAAO1wB,gBAAgBswB,EACvBK,EAAOje,EAAShX,GAChBk1B,EAAMpyB,IAAM3E,GAChB,OAAQ62B,GAAQC,GAAQj1B,EAAE+E,cAAgB6vB,GAAWM,EAAMl1B,EACvDoZ,EAAkB2b,EAChB,IAAIljB,EAAKojB,IAASC,EAAMl1B,EAAEU,OAASV,EAAG8C,GACtC+O,GAAMojB,EAAOj1B,aAAa40B,GAAW50B,EAAEU,OAASV,EAAGi1B,GAAQC,EAAMP,EAAO/1B,KAAKoB,GAAK8C,GACpFkyB,EAAO1wB,KAAO+K,EAAOulB,IAS3B,IAPA,IAAIO,EAAQ,SAAUx0B,GACpBA,KAAOi0B,GAAW/xB,EAAG+xB,EAASj0B,EAAK,CACjCtB,cAAc,EACdE,IAAK,WAAc,OAAOsS,EAAKlR,IAC/BgN,IAAK,SAAU5L,GAAM8P,EAAKlR,GAAOoB,MAG5B8F,EAAO2B,EAAKqI,GAAOnT,EAAI,EAAiBA,EAAdmJ,EAAKlC,QAAawvB,EAAMttB,EAAKnJ,OAChE2Q,EAAMtK,YAAc6vB,GACZ90B,UAAYuP,EACpB/Q,EAAoB,GAApBA,CAAwB4B,EAAQ,SAAU00B,GAG5Ct2B,EAAoB,GAApBA,CAAwB,WAKlB,SAAUG,EAAQD,EAASF,GAIjCA,EAAoB,KACpB,IAAIoE,EAAWpE,EAAoB,GAC/Bq2B,EAASr2B,EAAoB,IAC7B+W,EAAc/W,EAAoB,GAClCqF,EAAY,WACZC,EAAY,IAAID,GAEhBwmB,EAAS,SAAUtkB,GACrBvH,EAAoB,GAApBA,CAAwBwX,OAAOhW,UAAW6D,EAAWkC,GAAI,IAIvDvH,EAAoB,EAApBA,CAAuB,WAAc,MAAsD,QAA/CsF,EAAUhF,KAAK,CAAE8B,OAAQ,IAAK+lB,MAAO,QACnF0D,EAAO,SAAS9lB,WACd,IAAIxC,EAAIa,EAAS4B,MACjB,MAAO,IAAIqO,OAAO9Q,EAAEnB,OAAQ,IAC1B,UAAWmB,EAAIA,EAAE4kB,OAASpR,GAAexT,aAAaiU,OAAS6e,EAAO/1B,KAAKiD,GAAK1D,MAG3EyF,EAAU5E,MAAQ2E,GAC3BwmB,EAAO,SAAS9lB,WACd,OAAOT,EAAUhF,KAAK0F,SAOpB,SAAU7F,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,QAAS,EAAG,SAAU+E,EAAS0T,EAAOqe,GAE5D,MAAO,CAAC,SAAS5H,MAAM6H,GAErB,IAAItyB,EAAIM,EAAQiB,MACZuB,EAAKwvB,GAAUl3B,GAAYA,GAAYk3B,EAAOte,GAClD,OAAOlR,IAAO1H,GAAY0H,EAAGjH,KAAKy2B,EAAQtyB,GAAK,IAAI+S,OAAOuf,GAAQte,GAAO3S,OAAOrB,KAC/EqyB,MAMC,SAAU32B,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,UAAW,EAAG,SAAU+E,EAASiyB,EAASC,GAEhE,MAAO,CAAC,SAAShwB,QAAQiwB,EAAaC,GAEpC,IAAI1yB,EAAIM,EAAQiB,MACZuB,EAAK2vB,GAAer3B,GAAYA,GAAYq3B,EAAYF,GAC5D,OAAOzvB,IAAO1H,GACV0H,EAAGjH,KAAK42B,EAAazyB,EAAG0yB,GACxBF,EAAS32B,KAAKwF,OAAOrB,GAAIyyB,EAAaC,IACzCF,MAMC,SAAU92B,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,SAAU,EAAG,SAAU+E,EAASqyB,EAAQC,GAE9D,MAAO,CAAC,SAASpD,OAAO8C,GAEtB,IAAItyB,EAAIM,EAAQiB,MACZuB,EAAKwvB,GAAUl3B,GAAYA,GAAYk3B,EAAOK,GAClD,OAAO7vB,IAAO1H,GAAY0H,EAAGjH,KAAKy2B,EAAQtyB,GAAK,IAAI+S,OAAOuf,GAAQK,GAAQtxB,OAAOrB,KAChF4yB,MAMC,SAAUl3B,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,QAAS,EAAG,SAAU+E,EAASuyB,EAAOC,GAE5D,IAAI7e,EAAW1Y,EAAoB,IAC/Bw3B,EAASD,EACTE,EAAQ,GAAGruB,KACXsuB,EAAS,QACTC,EAAS,SACTC,EAAa,YACjB,GAC+B,KAA7B,OAAOF,GAAQ,QAAQ,IACe,GAAtC,OAAOA,GAAQ,QAAS,GAAGC,IACQ,GAAnC,KAAKD,GAAQ,WAAWC,IACW,GAAnC,IAAID,GAAQ,YAAYC,IACM,EAA9B,IAAID,GAAQ,QAAQC,IACpB,GAAGD,GAAQ,MAAMC,GACjB,CACA,IAAIE,EAAO,OAAO/zB,KAAK,IAAI,KAAOjE,GAElC03B,EAAS,SAAU3lB,EAAWkmB,GAC5B,IAAIjxB,EAASf,OAAOE,MACpB,GAAI4L,IAAc/R,IAAuB,IAAVi4B,EAAa,MAAO,GAEnD,IAAKpf,EAAS9G,GAAY,OAAO4lB,EAAOl3B,KAAKuG,EAAQ+K,EAAWkmB,GAChE,IASIC,EAAY7I,EAAO8I,EAAWC,EAAY73B,EAT1C83B,EAAS,GACT/P,GAASvW,EAAUsI,WAAa,IAAM,KAC7BtI,EAAUuI,UAAY,IAAM,KAC5BvI,EAAUwI,QAAU,IAAM,KAC1BxI,EAAUyI,OAAS,IAAM,IAClC8d,EAAgB,EAChBC,EAAaN,IAAUj4B,GAAY,WAAai4B,IAAU,EAE1DO,EAAgB,IAAI7gB,OAAO5F,EAAUxP,OAAQ+lB,EAAQ,KAIzD,IADK0P,IAAME,EAAa,IAAIvgB,OAAO,IAAM6gB,EAAcj2B,OAAS,WAAY+lB,KACrE+G,EAAQmJ,EAAcv0B,KAAK+C,OAGhBsxB,GADhBH,EAAY9I,EAAMhmB,MAAQgmB,EAAM,GAAGyI,MAEjCO,EAAO9uB,KAAKvC,EAAOe,MAAMuwB,EAAejJ,EAAMhmB,SAGzC2uB,GAAwB,EAAhB3I,EAAMyI,IAAazI,EAAM,GAAGjoB,QAAQ8wB,EAAY,WAC3D,IAAK33B,EAAI,EAAGA,EAAIuH,UAAUgwB,GAAU,EAAGv3B,IAASuH,UAAUvH,KAAOP,KAAWqvB,EAAM9uB,GAAKP,MAErE,EAAhBqvB,EAAMyI,IAAezI,EAAMhmB,MAAQrC,EAAO8wB,IAASF,EAAM/vB,MAAMwwB,EAAQhJ,EAAMtnB,MAAM,IACvFqwB,EAAa/I,EAAM,GAAGyI,GACtBQ,EAAgBH,EACMI,GAAlBF,EAAOP,MAETU,EAAcT,KAAgB1I,EAAMhmB,OAAOmvB,EAAcT,KAK/D,OAHIO,IAAkBtxB,EAAO8wB,IACvBM,GAAeI,EAAclxB,KAAK,KAAK+wB,EAAO9uB,KAAK,IAClD8uB,EAAO9uB,KAAKvC,EAAOe,MAAMuwB,IACRC,EAAjBF,EAAOP,GAAuBO,EAAOtwB,MAAM,EAAGwwB,GAAcF,OAG5D,IAAIR,GAAQ73B,GAAW,GAAG83B,KACnCJ,EAAS,SAAU3lB,EAAWkmB,GAC5B,OAAOlmB,IAAc/R,IAAuB,IAAVi4B,EAAc,GAAKN,EAAOl3B,KAAK0F,KAAM4L,EAAWkmB,KAItF,MAAO,CAAC,SAAStyB,MAAMoM,EAAWkmB,GAChC,IAAIrzB,EAAIM,EAAQiB,MACZuB,EAAKqK,GAAa/R,GAAYA,GAAY+R,EAAU0lB,GACxD,OAAO/vB,IAAO1H,GAAY0H,EAAGjH,KAAKsR,EAAWnN,EAAGqzB,GAASP,EAAOj3B,KAAKwF,OAAOrB,GAAImN,EAAWkmB,IAC1FP,MAMC,SAAUp3B,EAAQD,EAASF,GAIjC,IAwBIs4B,EAAUC,EAA6BC,EAAsBC,EAxB7DjuB,EAAUxK,EAAoB,IAC9B4B,EAAS5B,EAAoB,GAC7BgC,EAAMhC,EAAoB,IAC1BgL,EAAUhL,EAAoB,IAC9BkC,EAAUlC,EAAoB,GAC9BwD,EAAWxD,EAAoB,GAC/BsH,EAAYtH,EAAoB,IAChC2K,EAAa3K,EAAoB,IACjC6a,EAAQ7a,EAAoB,IAC5BuL,EAAqBvL,EAAoB,IACzCkiB,EAAOliB,EAAoB,IAAIqP,IAC/BqpB,EAAY14B,EAAoB,GAApBA,GACZ24B,EAA6B34B,EAAoB,IACjD44B,EAAU54B,EAAoB,KAC9B4a,EAAY5a,EAAoB,IAChC64B,EAAiB74B,EAAoB,KACrC84B,EAAU,UACVp1B,EAAY9B,EAAO8B,UACnB0b,EAAUxd,EAAOwd,QACjB2Z,EAAW3Z,GAAWA,EAAQ2Z,SAC9BC,EAAKD,GAAYA,EAASC,IAAM,GAChCC,EAAWr3B,EAAOk3B,GAClB9X,EAA6B,WAApBhW,EAAQoU,GACjB8Z,EAAQ,aAER9Q,EAAuBmQ,EAA8BI,EAA2Bn0B,EAEhFqoB,IAAe,WACjB,IAEE,IAAIlL,EAAUsX,EAASvX,QAAQ,GAC3ByX;AAAexX,EAAQlb,YAAc,IAAIzG,EAAoB,EAApBA,CAAuB,YAAc,SAAU8D,GAC1FA,EAAKo1B,EAAOA,IAGd,OAAQlY,GAA0C,mBAAzBoY,wBACpBzX,EAAQC,KAAKsX,aAAkBC,GAIT,IAAtBH,EAAGvnB,QAAQ,SACyB,IAApCmJ,EAAUnJ,QAAQ,aACvB,MAAO1N,KAfQ,GAmBfs1B,EAAa,SAAU51B,GACzB,IAAIme,EACJ,SAAOpe,EAASC,IAAkC,mBAAnBme,EAAOne,EAAGme,QAAsBA,GAE7DT,EAAS,SAAUQ,EAAS2X,GAC9B,IAAI3X,EAAQ4X,GAAZ,CACA5X,EAAQ4X,IAAK,EACb,IAAIC,EAAQ7X,EAAQ8X,GACpBf,EAAU,WAoCR,IAnCA,IAAI/zB,EAAQgd,EAAQ+X,GAChBC,EAAmB,GAAdhY,EAAQiY,GACbx5B,EAAI,EACJ0f,EAAM,SAAU+Z,GAClB,IAII1wB,EAAQyY,EAAMkY,EAJdC,EAAUJ,EAAKE,EAASF,GAAKE,EAASG,KACtCtY,EAAUmY,EAASnY,QACnBU,EAASyX,EAASzX,OAClBd,EAASuY,EAASvY,OAEtB,IACMyY,GACGJ,IACe,GAAdhY,EAAQsY,IAASC,EAAkBvY,GACvCA,EAAQsY,GAAK,IAEC,IAAZF,EAAkB5wB,EAASxE,GAEzB2c,GAAQA,EAAOE,QACnBrY,EAAS4wB,EAAQp1B,GACb2c,IACFA,EAAOC,OACPuY,GAAS,IAGT3wB,IAAW0wB,EAASlY,QACtBS,EAAO1e,EAAU,yBACRke,EAAOyX,EAAWlwB,IAC3ByY,EAAKthB,KAAK6I,EAAQuY,EAASU,GACtBV,EAAQvY,IACViZ,EAAOzd,GACd,MAAOZ,GACHud,IAAWwY,GAAQxY,EAAOC,OAC9Ba,EAAOre,KAGW3D,EAAfo5B,EAAMnyB,QAAYyY,EAAI0Z,EAAMp5B,MACnCuhB,EAAQ8X,GAAK,GACb9X,EAAQ4X,IAAK,EACTD,IAAa3X,EAAQsY,IAAIE,EAAYxY,OAGzCwY,EAAc,SAAUxY,GAC1BO,EAAK5hB,KAAKsB,EAAQ,WAChB,IAEIuH,EAAQ4wB,EAASK,EAFjBz1B,EAAQgd,EAAQ+X,GAChBW,EAAYC,EAAY3Y,GAe5B,GAbI0Y,IACFlxB,EAASyvB,EAAQ,WACX5X,EACF5B,EAAQmb,KAAK,qBAAsB51B,EAAOgd,IACjCoY,EAAUn4B,EAAO44B,sBAC1BT,EAAQ,CAAEpY,QAASA,EAAS8Y,OAAQ91B,KAC1By1B,EAAUx4B,EAAOw4B,UAAYA,EAAQM,OAC/CN,EAAQM,MAAM,8BAA+B/1B,KAIjDgd,EAAQsY,GAAKjZ,GAAUsZ,EAAY3Y,GAAW,EAAI,GAClDA,EAAQgZ,GAAK96B,GACXw6B,GAAalxB,EAAOpF,EAAG,MAAMoF,EAAOyK,KAGxC0mB,EAAc,SAAU3Y,GAC1B,OAAsB,IAAfA,EAAQsY,IAAkD,KAArCtY,EAAQgZ,IAAMhZ,EAAQ8X,IAAIpyB,QAEpD6yB,EAAoB,SAAUvY,GAChCO,EAAK5hB,KAAKsB,EAAQ,WAChB,IAAIm4B,EACA/Y,EACF5B,EAAQmb,KAAK,mBAAoB5Y,IACxBoY,EAAUn4B,EAAOg5B,qBAC1Bb,EAAQ,CAAEpY,QAASA,EAAS8Y,OAAQ9Y,EAAQ+X,QAI9CmB,EAAU,SAAUl2B,GACtB,IAAIgd,EAAU3b,KACV2b,EAAQ3R,KACZ2R,EAAQ3R,IAAK,GACb2R,EAAUA,EAAQmZ,IAAMnZ,GAChB+X,GAAK/0B,EACbgd,EAAQiY,GAAK,EACRjY,EAAQgZ,KAAIhZ,EAAQgZ,GAAKhZ,EAAQ8X,GAAG7xB,SACzCuZ,EAAOQ,GAAS,KAEdoZ,EAAW,SAAUp2B,GACvB,IACIid,EADAD,EAAU3b,KAEd,IAAI2b,EAAQ3R,GAAZ,CACA2R,EAAQ3R,IAAK,EACb2R,EAAUA,EAAQmZ,IAAMnZ,EACxB,IACE,GAAIA,IAAYhd,EAAO,MAAMjB,EAAU,qCACnCke,EAAOyX,EAAW10B,IACpB+zB,EAAU,WACR,IAAIxlB,EAAU,CAAE4nB,GAAInZ,EAAS3R,IAAI,GACjC,IACE4R,EAAKthB,KAAKqE,EAAO3C,EAAI+4B,EAAU7nB,EAAS,GAAIlR,EAAI64B,EAAS3nB,EAAS,IAClE,MAAOnP,GACP82B,EAAQv6B,KAAK4S,EAASnP,OAI1B4d,EAAQ+X,GAAK/0B,EACbgd,EAAQiY,GAAK,EACbzY,EAAOQ,GAAS,IAElB,MAAO5d,GACP82B,EAAQv6B,KAAK,CAAEw6B,GAAInZ,EAAS3R,IAAI,GAASjM,MAKxC8oB,IAEHoM,EAAW,SAASlY,QAAQia,GAC1BrwB,EAAW3E,KAAMizB,EAAUH,EAAS,MACpCxxB,EAAU0zB,GACV1C,EAASh4B,KAAK0F,MACd,IACEg1B,EAASh5B,EAAI+4B,EAAU/0B,KAAM,GAAIhE,EAAI64B,EAAS70B,KAAM,IACpD,MAAOi1B,GACPJ,EAAQv6B,KAAK0F,KAAMi1B,MAIvB3C,EAAW,SAASvX,QAAQia,GAC1Bh1B,KAAKyzB,GAAK,GACVzzB,KAAK20B,GAAK96B,GACVmG,KAAK4zB,GAAK,EACV5zB,KAAKgK,IAAK,EACVhK,KAAK0zB,GAAK75B,GACVmG,KAAKi0B,GAAK,EACVj0B,KAAKuzB,IAAK,IAEH/3B,UAAYxB,EAAoB,GAApBA,CAAwBi5B,EAASz3B,UAAW,CAE/DogB,KAAM,SAASA,KAAKsZ,EAAaC,GAC/B,IAAItB,EAAWzR,EAAqB7c,EAAmBvF,KAAMizB,IAO7D,OANAY,EAASF,GAA2B,mBAAfuB,GAA4BA,EACjDrB,EAASG,KAA4B,mBAAdmB,GAA4BA,EACnDtB,EAASvY,OAASN,EAAS5B,EAAQkC,OAASzhB,GAC5CmG,KAAKyzB,GAAGrwB,KAAKywB,GACT7zB,KAAK20B,IAAI30B,KAAK20B,GAAGvxB,KAAKywB,GACtB7zB,KAAK4zB,IAAIzY,EAAOnb,MAAM,GACnB6zB,EAASlY,SAGlByZ,QAAS,SAAUD,GACjB,OAAOn1B,KAAK4b,KAAK/hB,GAAWs7B,MAGhC3C,EAAuB,WACrB,IAAI7W,EAAU,IAAI2W,EAClBtyB,KAAK2b,QAAUA,EACf3b,KAAK0b,QAAU1f,EAAI+4B,EAAUpZ,EAAS,GACtC3b,KAAKoc,OAASpgB,EAAI64B,EAASlZ,EAAS,IAEtCgX,EAA2Bn0B,EAAI4jB,EAAuB,SAAU1Y,GAC9D,OAAOA,IAAMupB,GAAYvpB,IAAM+oB,EAC3B,IAAID,EAAqB9oB,GACzB6oB,EAA4B7oB,KAIpCxN,EAAQA,EAAQU,EAAIV,EAAQoB,EAAIpB,EAAQQ,GAAKmqB,EAAY,CAAE9L,QAASkY,IACpEj5B,EAAoB,GAApBA,CAAwBi5B,EAAUH,GAClC94B,EAAoB,GAApBA,CAAwB84B,GACxBL,EAAUz4B,EAAoB,IAAI84B,GAGlC52B,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAKmqB,EAAYiM,EAAS,CAEpD1W,OAAQ,SAASA,OAAOyG,GACtB,IAAIwS,EAAajT,EAAqBpiB,MAGtC,OADAsc,EADe+Y,EAAWjZ,QACjByG,GACFwS,EAAW1Z,WAGtBzf,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAK8H,IAAYqiB,GAAaiM,EAAS,CAEjEpX,QAAS,SAASA,QAAQ3D,GACxB,OAAO8a,EAAeruB,GAAWxE,OAASyyB,EAAUQ,EAAWjzB,KAAM+X,MAGzE7b,EAAQA,EAAQgB,EAAIhB,EAAQQ,IAAMmqB,GAAc7sB,EAAoB,GAApBA,CAAwB,SAAUoU,GAChF6kB,EAASqC,IAAIlnB,GAAa,SAAE8kB,MACzBJ,EAAS,CAEZwC,IAAK,SAASA,IAAIllB,GAChB,IAAI1G,EAAI1J,KACJq1B,EAAajT,EAAqB1Y,GAClCgS,EAAU2Z,EAAW3Z,QACrBU,EAASiZ,EAAWjZ,OACpBjZ,EAASyvB,EAAQ,WACnB,IAAIxrB,EAAS,GACTlE,EAAQ,EACRqyB,EAAY,EAChB1gB,EAAMzE,GAAU,EAAO,SAAUuL,GAC/B,IAAI6Z,EAAStyB,IACTuyB,GAAgB,EACpBruB,EAAOhE,KAAKvJ,IACZ07B,IACA7rB,EAAEgS,QAAQC,GAASC,KAAK,SAAUjd,GAC5B82B,IACJA,GAAgB,EAChBruB,EAAOouB,GAAU72B,IACf42B,GAAa7Z,EAAQtU,KACtBgV,OAEHmZ,GAAa7Z,EAAQtU,KAGzB,OADIjE,EAAOpF,GAAGqe,EAAOjZ,EAAOyK,GACrBynB,EAAW1Z,SAGpB+Z,KAAM,SAASA,KAAKtlB,GAClB,IAAI1G,EAAI1J,KACJq1B,EAAajT,EAAqB1Y,GAClC0S,EAASiZ,EAAWjZ,OACpBjZ,EAASyvB,EAAQ,WACnB/d,EAAMzE,GAAU,EAAO,SAAUuL,GAC/BjS,EAAEgS,QAAQC,GAASC,KAAKyZ,EAAW3Z,QAASU,OAIhD,OADIjZ,EAAOpF,GAAGqe,EAAOjZ,EAAOyK,GACrBynB,EAAW1Z,YAOhB,SAAUxhB,EAAQD,EAASF,GAIjC,IAAImpB,EAAOnpB,EAAoB,KAC3ByP,EAAWzP,EAAoB,IAC/B27B,EAAW,UAGf37B,EAAoB,GAApBA,CAAwB27B,EAAU,SAAU16B,GAC1C,OAAO,SAAS26B,UAAY,OAAO36B,EAAI+E,KAAyB,EAAnB2B,UAAUN,OAAaM,UAAU,GAAK9H,MAClF,CAEDsb,IAAK,SAASA,IAAIxW,GAChB,OAAOwkB,EAAKhS,IAAI1H,EAASzJ,KAAM21B,GAAWh3B,GAAO,KAElDwkB,GAAM,GAAO,IAKV,SAAUhpB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BsH,EAAYtH,EAAoB,IAChCoE,EAAWpE,EAAoB,GAC/B67B,GAAU77B,EAAoB,GAAGuiB,SAAW,IAAI7a,MAChDo0B,EAAS14B,SAASsE,MAEtBxF,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAK1C,EAAoB,EAApBA,CAAuB,WACtD67B,EAAO,gBACL,UAAW,CACbn0B,MAAO,SAASA,MAAMzE,EAAQ84B,EAAcC,GAC1C,IAAIplB,EAAItP,EAAUrE,GACdg5B,EAAI73B,EAAS43B,GACjB,OAAOH,EAASA,EAAOjlB,EAAGmlB,EAAcE,GAAKH,EAAOx7B,KAAKsW,EAAGmlB,EAAcE,OAOxE,SAAU97B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B8I,EAAS9I,EAAoB,IAC7BsH,EAAYtH,EAAoB,IAChCoE,EAAWpE,EAAoB,GAC/BwD,EAAWxD,EAAoB,GAC/B0G,EAAQ1G,EAAoB,GAC5BumB,EAAOvmB,EAAoB,KAC3Bk8B,GAAcl8B,EAAoB,GAAGuiB,SAAW,IAAImE,UAIpDyV,EAAiBz1B,EAAM,WACzB,SAAShE,KACT,QAASw5B,EAAW,aAA6B,GAAIx5B,aAAcA,KAEjE05B,GAAY11B,EAAM,WACpBw1B,EAAW,gBAGbh6B,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAKy5B,GAAkBC,GAAW,UAAW,CACvE1V,UAAW,SAASA,UAAU2V,EAAQ7e,GACpClW,EAAU+0B,GACVj4B,EAASoZ,GACT,IAAI8e,EAAY30B,UAAUN,OAAS,EAAIg1B,EAAS/0B,EAAUK,UAAU,IACpE,GAAIy0B,IAAaD,EAAgB,OAAOD,EAAWG,EAAQ7e,EAAM8e,GACjE,GAAID,GAAUC,EAAW,CAEvB,OAAQ9e,EAAKnW,QACX,KAAK,EAAG,OAAO,IAAIg1B,EACnB,KAAK,EAAG,OAAO,IAAIA,EAAO7e,EAAK,IAC/B,KAAK,EAAG,OAAO,IAAI6e,EAAO7e,EAAK,GAAIA,EAAK,IACxC,KAAK,EAAG,OAAO,IAAI6e,EAAO7e,EAAK,GAAIA,EAAK,GAAIA,EAAK,IACjD,KAAK,EAAG,OAAO,IAAI6e,EAAO7e,EAAK,GAAIA,EAAK,GAAIA,EAAK,GAAIA,EAAK,IAG5D,IAAI+e,EAAQ,CAAC,MAEb,OADAA,EAAMnzB,KAAK1B,MAAM60B,EAAO/e,GACjB,IAAK+I,EAAK7e,MAAM20B,EAAQE,IAGjC,IAAIxrB,EAAQurB,EAAU96B,UAClB4Z,EAAWtS,EAAOtF,EAASuN,GAASA,EAAQlQ,OAAOW,WACnD2H,EAAS/F,SAASsE,MAAMpH,KAAK+7B,EAAQjhB,EAAUoC,GACnD,OAAOha,EAAS2F,GAAUA,EAASiS,MAOjC,SAAUjb,EAAQD,EAASF,GAGjC,IAAIuE,EAAKvE,EAAoB,GACzBkC,EAAUlC,EAAoB,GAC9BoE,EAAWpE,EAAoB,GAC/BsE,EAActE,EAAoB,IAGtCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,EAAI1C,EAAoB,EAApBA,CAAuB,WAErDuiB,QAAQzhB,eAAeyD,EAAGC,EAAE,GAAI,EAAG,CAAEG,MAAO,IAAM,EAAG,CAAEA,MAAO,MAC5D,UAAW,CACb7D,eAAgB,SAASA,eAAemC,EAAQu5B,EAAaC,GAC3Dr4B,EAASnB,GACTu5B,EAAcl4B,EAAYk4B,GAAa,GACvCp4B,EAASq4B,GACT,IAEE,OADAl4B,EAAGC,EAAEvB,EAAQu5B,EAAaC,IACnB,EACP,MAAO14B,GACP,OAAO,OAQP,SAAU5D,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BmG,EAAOnG,EAAoB,IAAIwE,EAC/BJ,EAAWpE,EAAoB,GAEnCkC,EAAQA,EAAQgB,EAAG,UAAW,CAC5Bw5B,eAAgB,SAASA,eAAez5B,EAAQu5B,GAC9C,IAAIzpB,EAAO5M,EAAK/B,EAASnB,GAASu5B,GAClC,QAAOzpB,IAASA,EAAKhS,sBAA8BkC,EAAOu5B,OAOxD,SAAUr8B,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BoE,EAAWpE,EAAoB,GAC/B28B,EAAY,SAAUje,GACxB1Y,KAAK8R,GAAK1T,EAASsa,GACnB1Y,KAAK2Y,GAAK,EACV,IACItc,EADAkH,EAAOvD,KAAK4Y,GAAK,GAErB,IAAKvc,KAAOqc,EAAUnV,EAAKH,KAAK/G,IAElCrC,EAAoB,GAApBA,CAAwB28B,EAAW,SAAU,WAC3C,IAEIt6B,EADAkH,EADOvD,KACK4Y,GAEhB,GACE,GAAerV,EAAKlC,QAJXrB,KAIA2Y,GAAmB,MAAO,CAAEha,MAAO9E,GAAW6Q,MAAM,YACnDrO,EAAMkH,EALPvD,KAKiB2Y,SALjB3Y,KAKgC8R,KAC3C,MAAO,CAAEnT,MAAOtC,EAAKqO,MAAM,KAG7BxO,EAAQA,EAAQgB,EAAG,UAAW,CAC5B05B,UAAW,SAASA,UAAU35B,GAC5B,OAAO,IAAI05B,EAAU15B,OAOnB,SAAU9C,EAAQD,EAASF,GAGjC,IAAImG,EAAOnG,EAAoB,IAC3BwG,EAAiBxG,EAAoB,IACrCmF,EAAMnF,EAAoB,IAC1BkC,EAAUlC,EAAoB,GAC9BwD,EAAWxD,EAAoB,GAC/BoE,EAAWpE,EAAoB,GAcnCkC,EAAQA,EAAQgB,EAAG,UAAW,CAAEjC,IAZhC,SAASA,IAAIgC,EAAQu5B,GACnB,IACIzpB,EAAMhC,EADN8rB,EAAWl1B,UAAUN,OAAS,EAAIpE,EAAS0E,UAAU,GAEzD,OAAIvD,EAASnB,KAAY45B,EAAiB55B,EAAOu5B,IAC7CzpB,EAAO5M,EAAK3B,EAAEvB,EAAQu5B,IAAqBr3B,EAAI4N,EAAM,SACrDA,EAAKpO,MACLoO,EAAK9R,MAAQpB,GACXkT,EAAK9R,IAAIX,KAAKu8B,GACdh9B,GACF2D,EAASuN,EAAQvK,EAAevD,IAAiBhC,IAAI8P,EAAOyrB,EAAaK,QAA7E,MAQI,SAAU18B,EAAQD,EAASF,GAGjC,IAAImG,EAAOnG,EAAoB,IAC3BkC,EAAUlC,EAAoB,GAC9BoE,EAAWpE,EAAoB,GAEnCkC,EAAQA,EAAQgB,EAAG,UAAW,CAC5BkD,yBAA0B,SAASA,yBAAyBnD,EAAQu5B,GAClE,OAAOr2B,EAAK3B,EAAEJ,EAASnB,GAASu5B,OAO9B,SAAUr8B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B88B,EAAW98B,EAAoB,IAC/BoE,EAAWpE,EAAoB,GAEnCkC,EAAQA,EAAQgB,EAAG,UAAW,CAC5BsD,eAAgB,SAASA,eAAevD,GACtC,OAAO65B,EAAS14B,EAASnB,QAOvB,SAAU9C,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,UAAW,CAC5BiC,IAAK,SAASA,IAAIlC,EAAQu5B,GACxB,OAAOA,KAAev5B,MAOpB,SAAU9C,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BoE,EAAWpE,EAAoB,GAC/B8uB,EAAgBjuB,OAAO0U,aAE3BrT,EAAQA,EAAQgB,EAAG,UAAW,CAC5BqS,aAAc,SAASA,aAAatS,GAElC,OADAmB,EAASnB,IACF6rB,GAAgBA,EAAc7rB,OAOnC,SAAU9C,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,UAAW,CAAEsf,QAASxiB,EAAoB,OAKvD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BoE,EAAWpE,EAAoB,GAC/ByuB,EAAqB5tB,OAAO4U,kBAEhCvT,EAAQA,EAAQgB,EAAG,UAAW,CAC5BuS,kBAAmB,SAASA,kBAAkBxS,GAC5CmB,EAASnB,GACT,IAEE,OADIwrB,GAAoBA,EAAmBxrB,IACpC,EACP,MAAOc,GACP,OAAO,OAQP,SAAU5D,EAAQD,EAASF,GAGjC,IAAIuE,EAAKvE,EAAoB,GACzBmG,EAAOnG,EAAoB,IAC3BwG,EAAiBxG,EAAoB,IACrCmF,EAAMnF,EAAoB,IAC1BkC,EAAUlC,EAAoB,GAC9BkF,EAAalF,EAAoB,IACjCoE,EAAWpE,EAAoB,GAC/BwD,EAAWxD,EAAoB,GAwBnCkC,EAAQA,EAAQgB,EAAG,UAAW,CAAEmM,IAtBhC,SAASA,IAAIpM,EAAQu5B,EAAaO,GAChC,IAEIC,EAAoBjsB,EAFpB8rB,EAAWl1B,UAAUN,OAAS,EAAIpE,EAAS0E,UAAU,GACrDs1B,EAAU92B,EAAK3B,EAAEJ,EAASnB,GAASu5B,GAEvC,IAAKS,EAAS,CACZ,GAAIz5B,EAASuN,EAAQvK,EAAevD,IAClC,OAAOoM,IAAI0B,EAAOyrB,EAAaO,EAAGF,GAEpCI,EAAU/3B,EAAW,GAEvB,GAAIC,EAAI83B,EAAS,SAAU,CACzB,IAAyB,IAArBA,EAAQjqB,WAAuBxP,EAASq5B,GAAW,OAAO,EAC9D,GAAIG,EAAqB72B,EAAK3B,EAAEq4B,EAAUL,GAAc,CACtD,GAAIQ,EAAmB/7B,KAAO+7B,EAAmB3tB,MAAuC,IAAhC2tB,EAAmBhqB,SAAoB,OAAO,EACtGgqB,EAAmBr4B,MAAQo4B,EAC3Bx4B,EAAGC,EAAEq4B,EAAUL,EAAaQ,QACvBz4B,EAAGC,EAAEq4B,EAAUL,EAAat3B,EAAW,EAAG63B,IACjD,OAAO,EAET,OAAOE,EAAQ5tB,MAAQxP,KAAqBo9B,EAAQ5tB,IAAI/O,KAAKu8B,EAAUE,IAAI,OAQvE,SAAU58B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Bk9B,EAAWl9B,EAAoB,IAE/Bk9B,GAAUh7B,EAAQA,EAAQgB,EAAG,UAAW,CAC1Cma,eAAgB,SAASA,eAAepa,EAAQ8N,GAC9CmsB,EAAS9f,MAAMna,EAAQ8N,GACvB,IAEE,OADAmsB,EAAS7tB,IAAIpM,EAAQ8N,IACd,EACP,MAAOhN,GACP,OAAO,OAQP,SAAU5D,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CAAEgd,IAAK,WAAc,OAAO,IAAIid,MAAOC,cAK5D,SAAUj9B,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BqG,EAAWrG,EAAoB,GAC/BsE,EAActE,EAAoB,IAEtCkC,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAI1C,EAAoB,EAApBA,CAAuB,WACrD,OAAkC,OAA3B,IAAIm9B,KAAKrZ,KAAKqH,UAC2D,IAA3EgS,KAAK37B,UAAU2pB,OAAO7qB,KAAK,CAAE+8B,YAAa,WAAc,OAAO,OAClE,OAAQ,CAEVlS,OAAQ,SAASA,OAAO9oB,GACtB,IAAIoC,EAAI4B,EAASL,MACbs3B,EAAKh5B,EAAYG,GACrB,MAAoB,iBAAN64B,GAAmBzW,SAASyW,GAAa74B,EAAE44B,cAAT,SAO9C,SAAUl9B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Bq9B,EAAcr9B,EAAoB,KAGtCkC,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAKy6B,KAAK37B,UAAU67B,cAAgBA,GAAc,OAAQ,CACpFA,YAAaA,KAMT,SAAUl9B,EAAQD,EAASF,GAKjC,IAAI0G,EAAQ1G,EAAoB,GAC5Bo9B,EAAUD,KAAK37B,UAAU47B,QACzBG,EAAeJ,KAAK37B,UAAU67B,YAE9BG,EAAK,SAAUC,GACjB,OAAa,EAANA,EAAUA,EAAM,IAAMA,GAI/Bt9B,EAAOD,QAAWwG,EAAM,WACtB,MAAiD,4BAA1C62B,EAAaj9B,KAAK,IAAI68B,MAAM,KAAO,QACrCz2B,EAAM,WACX62B,EAAaj9B,KAAK,IAAI68B,KAAKrZ,QACvB,SAASuZ,cACb,IAAKxW,SAASuW,EAAQ98B,KAAK0F,OAAQ,MAAMgG,WAAW,sBACpD,IAAIvL,EAAIuF,KACJ+oB,EAAItuB,EAAEi9B,iBACNn9B,EAAIE,EAAEk9B,qBACNh8B,EAAIotB,EAAI,EAAI,IAAU,KAAJA,EAAW,IAAM,GACvC,OAAOptB,GAAK,QAAUiC,KAAKgf,IAAImM,IAAInnB,MAAMjG,GAAK,GAAK,GACjD,IAAM67B,EAAG/8B,EAAEm9B,cAAgB,GAAK,IAAMJ,EAAG/8B,EAAEo9B,cAC3C,IAAML,EAAG/8B,EAAEq9B,eAAiB,IAAMN,EAAG/8B,EAAEs9B,iBACvC,IAAMP,EAAG/8B,EAAEu9B,iBAAmB,KAAW,GAAJz9B,EAASA,EAAI,IAAMi9B,EAAGj9B,IAAM,KACjEg9B,GAKE,SAAUp9B,EAAQD,EAASF,GAEjC,IAAIi+B,EAAYd,KAAK37B,UACjB08B,EAAe,eACf74B,EAAY,WACZC,EAAY24B,EAAU54B,GACtB+3B,EAAUa,EAAUb,QACpB,IAAID,KAAKrZ,KAAO,IAAMoa,GACxBl+B,EAAoB,GAApBA,CAAwBi+B,EAAW54B,EAAW,SAASU,WACrD,IAAIpB,EAAQy4B,EAAQ98B,KAAK0F,MAEzB,OAAOrB,GAAUA,EAAQW,EAAUhF,KAAK0F,MAAQk4B,KAO9C,SAAU/9B,EAAQD,EAASF,GAEjC,IAAIysB,EAAezsB,EAAoB,EAApBA,CAAuB,eACtC+Q,EAAQosB,KAAK37B,UAEXirB,KAAgB1b,GAAQ/Q,EAAoB,GAApBA,CAAwB+Q,EAAO0b,EAAczsB,EAAoB,OAKzF,SAAUG,EAAQD,EAASF,GAIjC,IAAIoE,EAAWpE,EAAoB,GAC/BsE,EAActE,EAAoB,IAGtCG,EAAOD,QAAU,SAAUi+B,GACzB,GAAa,WAATA,GAHO,WAGcA,GAA4B,YAATA,EAAoB,MAAMz6B,UAAU,kBAChF,OAAOY,EAAYF,EAAS4B,MAJjB,UAIwBm4B,KAM/B,SAAUh+B,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9ByK,EAASzK,EAAoB,IAC7BmP,EAASnP,EAAoB,IAC7BoE,EAAWpE,EAAoB,GAC/B+K,EAAkB/K,EAAoB,IACtCoI,EAAWpI,EAAoB,GAC/BwD,EAAWxD,EAAoB,GAC/BwM,EAAcxM,EAAoB,GAAGwM,YACrCjB,EAAqBvL,EAAoB,IACzCuM,EAAe4C,EAAO3C,YACtBC,EAAY0C,EAAOzC,SACnB0xB,EAAU3zB,EAAOqJ,KAAOtH,EAAY6xB,OACpC9rB,EAAShG,EAAa/K,UAAUoG,MAChCiH,EAAOpE,EAAOoE,KACd3C,EAAe,cAEnBhK,EAAQA,EAAQU,EAAIV,EAAQoB,EAAIpB,EAAQQ,GAAK8J,IAAgBD,GAAe,CAAEC,YAAaD,IAE3FrK,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAK+H,EAAOiE,OAAQxC,EAAc,CAE5DmyB,OAAQ,SAASA,OAAO56B,GACtB,OAAO26B,GAAWA,EAAQ36B,IAAOD,EAASC,IAAOoL,KAAQpL,KAI7DvB,EAAQA,EAAQY,EAAIZ,EAAQmB,EAAInB,EAAQQ,EAAI1C,EAAoB,EAApBA,CAAuB,WACjE,OAAQ,IAAIuM,EAAa,GAAG3E,MAAM,EAAG/H,IAAWoU,aAC9C/H,EAAc,CAEhBtE,MAAO,SAASA,MAAMqJ,EAAOmB,GAC3B,GAAIG,IAAW1S,IAAauS,IAAQvS,GAAW,OAAO0S,EAAOjS,KAAK8D,EAAS4B,MAAOiL,GAQlF,IAPA,IAAIyB,EAAMtO,EAAS4B,MAAMiO,WACrB4b,EAAQ9kB,EAAgBkG,EAAOyB,GAC/B4rB,EAAMvzB,EAAgBqH,IAAQvS,GAAY6S,EAAMN,EAAKM,GACrDvJ,EAAS,IAAKoC,EAAmBvF,KAAMuG,GAA9B,CAA6CnE,EAASk2B,EAAMzO,IACrE0O,EAAQ,IAAI9xB,EAAUzG,MACtBw4B,EAAQ,IAAI/xB,EAAUtD,GACtBD,EAAQ,EACL2mB,EAAQyO,GACbE,EAAMxZ,SAAS9b,IAASq1B,EAAMrZ,SAAS2K,MACvC,OAAO1mB,KAIbnJ,EAAoB,GAApBA,CAAwBkM,IAKlB,SAAU/L,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAClCkC,EAAQA,EAAQU,EAAIV,EAAQoB,EAAIpB,EAAQQ,GAAK1C,EAAoB,IAAI8T,IAAK,CACxEpH,SAAU1M,EAAoB,IAAI0M,YAM9B,SAAUvM,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,OAAQ,EAAG,SAAUy+B,GAC3C,OAAO,SAASC,UAAU/qB,EAAMrB,EAAYjL,GAC1C,OAAOo3B,EAAKz4B,KAAM2N,EAAMrB,EAAYjL,OAOlC,SAAUlH,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,QAAS,EAAG,SAAUy+B,GAC5C,OAAO,SAASxyB,WAAW0H,EAAMrB,EAAYjL,GAC3C,OAAOo3B,EAAKz4B,KAAM2N,EAAMrB,EAAYjL,OAOlC,SAAUlH,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,QAAS,EAAG,SAAUy+B,GAC5C,OAAO,SAASE,kBAAkBhrB,EAAMrB,EAAYjL,GAClD,OAAOo3B,EAAKz4B,KAAM2N,EAAMrB,EAAYjL,MAErC,IAKG,SAAUlH,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,QAAS,EAAG,SAAUy+B,GAC5C,OAAO,SAASG,WAAWjrB,EAAMrB,EAAYjL,GAC3C,OAAOo3B,EAAKz4B,KAAM2N,EAAMrB,EAAYjL,OAOlC,SAAUlH,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,SAAU,EAAG,SAAUy+B,GAC7C,OAAO,SAASvvB,YAAYyE,EAAMrB,EAAYjL,GAC5C,OAAOo3B,EAAKz4B,KAAM2N,EAAMrB,EAAYjL,OAOlC,SAAUlH,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,QAAS,EAAG,SAAUy+B,GAC5C,OAAO,SAASI,WAAWlrB,EAAMrB,EAAYjL,GAC3C,OAAOo3B,EAAKz4B,KAAM2N,EAAMrB,EAAYjL,OAOlC,SAAUlH,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,SAAU,EAAG,SAAUy+B,GAC7C,OAAO,SAASK,YAAYnrB,EAAMrB,EAAYjL,GAC5C,OAAOo3B,EAAKz4B,KAAM2N,EAAMrB,EAAYjL,OAOlC,SAAUlH,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,UAAW,EAAG,SAAUy+B,GAC9C,OAAO,SAASM,aAAaprB,EAAMrB,EAAYjL,GAC7C,OAAOo3B,EAAKz4B,KAAM2N,EAAMrB,EAAYjL,OAOlC,SAAUlH,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,UAAW,EAAG,SAAUy+B,GAC9C,OAAO,SAASO,aAAarrB,EAAMrB,EAAYjL,GAC7C,OAAOo3B,EAAKz4B,KAAM2N,EAAMrB,EAAYjL,OAOlC,SAAUlH,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9Bi/B,EAAYj/B,EAAoB,GAApBA,EAAwB,GAExCkC,EAAQA,EAAQY,EAAG,QAAS,CAC1B6O,SAAU,SAASA,SAAS0G,GAC1B,OAAO4mB,EAAUj5B,KAAMqS,EAAuB,EAAnB1Q,UAAUN,OAAaM,UAAU,GAAK9H,OAIrEG,EAAoB,GAApBA,CAAwB,aAKlB,SAAUG,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BiqB,EAAmBjqB,EAAoB,KACvCqG,EAAWrG,EAAoB,GAC/BoI,EAAWpI,EAAoB,GAC/BsH,EAAYtH,EAAoB,IAChCk/B,EAAqBl/B,EAAoB,IAE7CkC,EAAQA,EAAQY,EAAG,QAAS,CAC1Bq8B,QAAS,SAASA,QAAQn2B,GACxB,IACIkhB,EAAWhO,EADXzX,EAAI4B,EAASL,MAMjB,OAJAsB,EAAU0B,GACVkhB,EAAY9hB,EAAS3D,EAAE4C,QACvB6U,EAAIgjB,EAAmBz6B,EAAG,GAC1BwlB,EAAiB/N,EAAGzX,EAAGA,EAAGylB,EAAW,EAAG,EAAGlhB,EAAYrB,UAAU,IAC1DuU,KAIXlc,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BiqB,EAAmBjqB,EAAoB,KACvCqG,EAAWrG,EAAoB,GAC/BoI,EAAWpI,EAAoB,GAC/B6E,EAAY7E,EAAoB,IAChCk/B,EAAqBl/B,EAAoB,IAE7CkC,EAAQA,EAAQY,EAAG,QAAS,CAC1Bs8B,QAAS,SAASA,UAChB,IAAIC,EAAW13B,UAAU,GACrBlD,EAAI4B,EAASL,MACbkkB,EAAY9hB,EAAS3D,EAAE4C,QACvB6U,EAAIgjB,EAAmBz6B,EAAG,GAE9B,OADAwlB,EAAiB/N,EAAGzX,EAAGA,EAAGylB,EAAW,EAAGmV,IAAax/B,GAAY,EAAIgF,EAAUw6B,IACxEnjB,KAIXlc,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B0zB,EAAM1zB,EAAoB,GAApBA,EAAwB,GAElCkC,EAAQA,EAAQY,EAAG,SAAU,CAC3Bw8B,GAAI,SAASA,GAAGphB,GACd,OAAOwV,EAAI1tB,KAAMkY,OAOf,SAAU/d,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9Bu/B,EAAOv/B,EAAoB,KAC3B4a,EAAY5a,EAAoB,IAGpCkC,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAI,oCAAoCyE,KAAKyT,GAAY,SAAU,CAC7F4kB,SAAU,SAASA,SAAS9U,GAC1B,OAAO6U,EAAKv5B,KAAM0kB,EAA8B,EAAnB/iB,UAAUN,OAAaM,UAAU,GAAK9H,IAAW,OAO5E,SAAUM,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9Bu/B,EAAOv/B,EAAoB,KAC3B4a,EAAY5a,EAAoB,IAGpCkC,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAI,oCAAoCyE,KAAKyT,GAAY,SAAU,CAC7F6kB,OAAQ,SAASA,OAAO/U,GACtB,OAAO6U,EAAKv5B,KAAM0kB,EAA8B,EAAnB/iB,UAAUN,OAAaM,UAAU,GAAK9H,IAAW,OAO5E,SAAUM,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,WAAY,SAAUgnB,GAC5C,OAAO,SAAS0Y,WACd,OAAO1Y,EAAMhhB,KAAM,KAEpB,cAKG,SAAU7F,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,YAAa,SAAUgnB,GAC7C,OAAO,SAAS2Y,YACd,OAAO3Y,EAAMhhB,KAAM,KAEpB,YAKG,SAAU7F,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B+E,EAAU/E,EAAoB,IAC9BoI,EAAWpI,EAAoB,GAC/B0Y,EAAW1Y,EAAoB,IAC/B4/B,EAAW5/B,EAAoB,IAC/B6/B,EAAcroB,OAAOhW,UAErBs+B,EAAwB,SAAU/I,EAAQlwB,GAC5Cb,KAAK+5B,GAAKhJ,EACV/wB,KAAK4zB,GAAK/yB,GAGZ7G,EAAoB,GAApBA,CAAwB8/B,EAAuB,gBAAiB,SAASrvB,OACvE,IAAIye,EAAQlpB,KAAK+5B,GAAGj8B,KAAKkC,KAAK4zB,IAC9B,MAAO,CAAEj1B,MAAOuqB,EAAOxe,KAAgB,OAAVwe,KAG/BhtB,EAAQA,EAAQY,EAAG,SAAU,CAC3Bk9B,SAAU,SAASA,SAASjJ,GAE1B,GADAhyB,EAAQiB,OACH0S,EAASqe,GAAS,MAAMrzB,UAAUqzB,EAAS,qBAChD,IAAI7zB,EAAI4C,OAAOE,MACXmiB,EAAQ,UAAW0X,EAAc/5B,OAAOixB,EAAO5O,OAASyX,EAASt/B,KAAKy2B,GACtEkJ,EAAK,IAAIzoB,OAAOuf,EAAO30B,QAAS+lB,EAAM1W,QAAQ,KAAO0W,EAAQ,IAAMA,GAEvE,OADA8X,EAAGjI,UAAY5vB,EAAS2uB,EAAOiB,WACxB,IAAI8H,EAAsBG,EAAI/8B,OAOnC,SAAU/C,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,kBAKlB,SAAUG,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,eAKlB,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BwiB,EAAUxiB,EAAoB,IAC9BkG,EAAYlG,EAAoB,IAChCmG,EAAOnG,EAAoB,IAC3Bu1B,EAAiBv1B,EAAoB,IAEzCkC,EAAQA,EAAQgB,EAAG,SAAU,CAC3Bg9B,0BAA2B,SAASA,0BAA0B5+B,GAO5D,IANA,IAKIe,EAAK0Q,EALLtO,EAAIyB,EAAU5E,GACd6+B,EAAUh6B,EAAK3B,EACf+E,EAAOiZ,EAAQ/d,GACf0E,EAAS,GACT/I,EAAI,EAEaA,EAAdmJ,EAAKlC,SACV0L,EAAOotB,EAAQ17B,EAAGpC,EAAMkH,EAAKnJ,SAChBP,IAAW01B,EAAepsB,EAAQ9G,EAAK0Q,GAEtD,OAAO5J,MAOL,SAAUhJ,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BogC,EAAUpgC,EAAoB,IAApBA,EAAyB,GAEvCkC,EAAQA,EAAQgB,EAAG,SAAU,CAC3BkK,OAAQ,SAASA,OAAO3J,GACtB,OAAO28B,EAAQ38B,OAOb,SAAUtD,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B2Z,EAAW3Z,EAAoB,IAApBA,EAAyB,GAExCkC,EAAQA,EAAQgB,EAAG,SAAU,CAC3BqK,QAAS,SAASA,QAAQ9J,GACxB,OAAOkW,EAASlW,OAOd,SAAUtD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BqG,EAAWrG,EAAoB,GAC/BsH,EAAYtH,EAAoB,IAChCse,EAAkBte,EAAoB,GAG1CA,EAAoB,IAAMkC,EAAQA,EAAQY,EAAI9C,EAAoB,IAAK,SAAU,CAC/EqgC,iBAAkB,SAASA,iBAAiBv9B,EAAGnC,GAC7C2d,EAAgB9Z,EAAE6B,EAASL,MAAOlD,EAAG,CAAE7B,IAAKqG,EAAU3G,GAASK,YAAY,EAAMD,cAAc,QAO7F,SAAUZ,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BqG,EAAWrG,EAAoB,GAC/BsH,EAAYtH,EAAoB,IAChCse,EAAkBte,EAAoB,GAG1CA,EAAoB,IAAMkC,EAAQA,EAAQY,EAAI9C,EAAoB,IAAK,SAAU,CAC/Egc,iBAAkB,SAASA,iBAAiBlZ,EAAGiqB,GAC7CzO,EAAgB9Z,EAAE6B,EAASL,MAAOlD,EAAG,CAAEuM,IAAK/H,EAAUylB,GAAS/rB,YAAY,EAAMD,cAAc,QAO7F,SAAUZ,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BqG,EAAWrG,EAAoB,GAC/BsE,EAActE,EAAoB,IAClCwG,EAAiBxG,EAAoB,IACrCoG,EAA2BpG,EAAoB,IAAIwE,EAGvDxE,EAAoB,IAAMkC,EAAQA,EAAQY,EAAI9C,EAAoB,IAAK,SAAU,CAC/EsgC,iBAAkB,SAASA,iBAAiBx9B,GAC1C,IAEI4X,EAFAjW,EAAI4B,EAASL,MACb+V,EAAIzX,EAAYxB,GAAG,GAEvB,GACE,GAAI4X,EAAItU,EAAyB3B,EAAGsX,GAAI,OAAOrB,EAAEzZ,UAC1CwD,EAAI+B,EAAe/B,QAO1B,SAAUtE,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BqG,EAAWrG,EAAoB,GAC/BsE,EAActE,EAAoB,IAClCwG,EAAiBxG,EAAoB,IACrCoG,EAA2BpG,EAAoB,IAAIwE,EAGvDxE,EAAoB,IAAMkC,EAAQA,EAAQY,EAAI9C,EAAoB,IAAK,SAAU,CAC/EugC,iBAAkB,SAASA,iBAAiBz9B,GAC1C,IAEI4X,EAFAjW,EAAI4B,EAASL,MACb+V,EAAIzX,EAAYxB,GAAG,GAEvB,GACE,GAAI4X,EAAItU,EAAyB3B,EAAGsX,GAAI,OAAOrB,EAAErL,UAC1C5K,EAAI+B,EAAe/B,QAO1B,SAAUtE,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQY,EAAIZ,EAAQqB,EAAG,MAAO,CAAE4nB,OAAQnrB,EAAoB,IAApBA,CAAyB,UAKnE,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQY,EAAIZ,EAAQqB,EAAG,MAAO,CAAE4nB,OAAQnrB,EAAoB,IAApBA,CAAyB,UAKnE,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,QAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,QAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,QAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,QAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQU,EAAG,CAAEhB,OAAQ5B,EAAoB,MAK3C,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,SAAU,CAAEtB,OAAQ5B,EAAoB,MAKrD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B0W,EAAM1W,EAAoB,IAE9BkC,EAAQA,EAAQgB,EAAG,QAAS,CAC1Bs9B,QAAS,SAASA,QAAQ/8B,GACxB,MAAmB,UAAZiT,EAAIjT,OAOT,SAAUtD,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CACzBu9B,MAAO,SAASA,MAAM1iB,EAAG2iB,EAAOC,GAC9B,OAAO/8B,KAAKkB,IAAI67B,EAAO/8B,KAAK2S,IAAImqB,EAAO3iB,QAOrC,SAAU5d,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CAAE09B,YAAah9B,KAAKi9B,GAAK,OAK9C,SAAU1gC,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B8gC,EAAc,IAAMl9B,KAAKi9B,GAE7B3+B,EAAQA,EAAQgB,EAAG,OAAQ,CACzB69B,QAAS,SAASA,QAAQC,GACxB,OAAOA,EAAUF,MAOf,SAAU3gC,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BorB,EAAQprB,EAAoB,KAC5B2nB,EAAS3nB,EAAoB,KAEjCkC,EAAQA,EAAQgB,EAAG,OAAQ,CACzB+9B,OAAQ,SAASA,OAAOljB,EAAGsN,EAAOC,EAAQC,EAAQC,GAChD,OAAO7D,EAAOyD,EAAMrN,EAAGsN,EAAOC,EAAQC,EAAQC,QAO5C,SAAUrrB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CACzBg+B,MAAO,SAASA,MAAMC,EAAIC,EAAIC,EAAIC,GAChC,IAAIC,EAAMJ,IAAO,EAEbK,EAAMH,IAAO,EACjB,OAFUD,IAAO,IAEHE,IAAO,KAAOC,EAAMC,GAAOD,EAAMC,KAASD,EAAMC,IAAQ,MAAQ,IAAM,MAOlF,SAAUrhC,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CACzBu+B,MAAO,SAASA,MAAMN,EAAIC,EAAIC,EAAIC,GAChC,IAAIC,EAAMJ,IAAO,EAEbK,EAAMH,IAAO,EACjB,OAFUD,IAAO,IAEHE,IAAO,MAAQC,EAAMC,IAAQD,EAAMC,GAAOD,EAAMC,IAAQ,KAAO,IAAM,MAOjF,SAAUrhC,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CACzBw+B,MAAO,SAASA,MAAMC,EAAG/tB,GACvB,IACIguB,GAAMD,EACNE,GAAMjuB,EACNkuB,EAHS,MAGJF,EACLG,EAJS,MAIJF,EACLG,EAAKJ,GAAM,GACXK,EAAKJ,GAAM,GACXpR,GAAKuR,EAAKD,IAAO,IAAMD,EAAKC,IAAO,IACvC,OAAOC,EAAKC,GAAMxR,GAAK,MAAQqR,EAAKG,IAAO,IAR9B,MAQoCxR,IAAe,QAO9D,SAAUtwB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CAAE49B,YAAa,IAAMl9B,KAAKi9B,MAK/C,SAAU1gC,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B4gC,EAAch9B,KAAKi9B,GAAK,IAE5B3+B,EAAQA,EAAQgB,EAAG,OAAQ,CACzB89B,QAAS,SAASA,QAAQD,GACxB,OAAOA,EAAUH,MAOf,SAAUzgC,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CAAEkoB,MAAOprB,EAAoB,QAKlD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CACzBg/B,MAAO,SAASA,MAAMP,EAAG/tB,GACvB,IACIguB,GAAMD,EACNE,GAAMjuB,EACNkuB,EAHS,MAGJF,EACLG,EAJS,MAIJF,EACLG,EAAKJ,IAAO,GACZK,EAAKJ,IAAO,GACZpR,GAAKuR,EAAKD,IAAO,IAAMD,EAAKC,IAAO,IACvC,OAAOC,EAAKC,GAAMxR,IAAM,MAAQqR,EAAKG,IAAO,IAR/B,MAQqCxR,KAAgB,QAOhE,SAAUtwB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CAAEi/B,QAAS,SAASA,QAAQpkB,GAErD,OAAQA,GAAKA,IAAMA,EAAIA,EAAS,GAALA,EAAS,EAAIA,GAAKF,SAAe,EAAJE,MAMpD,SAAU5d,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B6B,EAAO7B,EAAoB,IAC3B4B,EAAS5B,EAAoB,GAC7BuL,EAAqBvL,EAAoB,IACzC64B,EAAiB74B,EAAoB,KAEzCkC,EAAQA,EAAQY,EAAIZ,EAAQqB,EAAG,UAAW,CAAE6+B,UAAW,SAAUC,GAC/D,IAAI3yB,EAAInE,EAAmBvF,KAAMnE,EAAKkf,SAAWnf,EAAOmf,SACpDnb,EAAiC,mBAAby8B,EACxB,OAAOr8B,KAAK4b,KACVhc,EAAa,SAAUmY,GACrB,OAAO8a,EAAenpB,EAAG2yB,KAAazgB,KAAK,WAAc,OAAO7D,KAC9DskB,EACJz8B,EAAa,SAAU7B,GACrB,OAAO80B,EAAenpB,EAAG2yB,KAAazgB,KAAK,WAAc,MAAM7d,KAC7Ds+B,OAOF,SAAUliC,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BooB,EAAuBpoB,EAAoB,IAC3C44B,EAAU54B,EAAoB,KAElCkC,EAAQA,EAAQgB,EAAG,UAAW,CAAEo/B,MAAO,SAAUt5B,GAC/C,IAAIqf,EAAoBD,EAAqB5jB,EAAEwB,MAC3CmD,EAASyvB,EAAQ5vB,GAErB,OADCG,EAAOpF,EAAIskB,EAAkBjG,OAASiG,EAAkB3G,SAASvY,EAAOyK,GAClEyU,EAAkB1G,YAMrB,SAAUxhB,EAAQD,EAASF,GAEjC,IAAIuiC,EAAWviC,EAAoB,IAC/BoE,EAAWpE,EAAoB,GAC/BwiC,EAAYD,EAASlgC,IACrBogC,EAA4BF,EAASlzB,IAEzCkzB,EAAS//B,IAAI,CAAEkgC,eAAgB,SAASA,eAAeC,EAAaC,EAAe3/B,EAAQ2R,GACzF6tB,EAA0BE,EAAaC,EAAex+B,EAASnB,GAASu/B,EAAU5tB,QAM9E,SAAUzU,EAAQD,EAASF,GAEjC,IAAIuiC,EAAWviC,EAAoB,IAC/BoE,EAAWpE,EAAoB,GAC/BwiC,EAAYD,EAASlgC,IACrBsS,EAAyB4tB,EAAS1wB,IAClC7N,EAAQu+B,EAASv+B,MAErBu+B,EAAS//B,IAAI,CAAEqgC,eAAgB,SAASA,eAAeF,EAAa1/B,GAClE,IAAI2R,EAAYjN,UAAUN,OAAS,EAAIxH,GAAY2iC,EAAU76B,UAAU,IACnEqN,EAAcL,EAAuBvQ,EAASnB,GAAS2R,GAAW,GACtE,GAAII,IAAgBnV,KAAcmV,EAAoB,UAAE2tB,GAAc,OAAO,EAC7E,GAAI3tB,EAAY+f,KAAM,OAAO,EAC7B,IAAIlgB,EAAiB7Q,EAAM/C,IAAIgC,GAE/B,OADA4R,EAAuB,UAAED,KAChBC,EAAekgB,MAAQ/wB,EAAc,UAAEf,OAM5C,SAAU9C,EAAQD,EAASF,GAEjC,IAAIuiC,EAAWviC,EAAoB,IAC/BoE,EAAWpE,EAAoB,GAC/BwG,EAAiBxG,EAAoB,IACrC8iC,EAAyBP,EAASp9B,IAClC49B,EAAyBR,EAASthC,IAClCuhC,EAAYD,EAASlgC,IAErB2gC,EAAsB,SAAUjuB,EAAatQ,EAAG3B,GAElD,GADaggC,EAAuB/tB,EAAatQ,EAAG3B,GACxC,OAAOigC,EAAuBhuB,EAAatQ,EAAG3B,GAC1D,IAAIue,EAAS7a,EAAe/B,GAC5B,OAAkB,OAAX4c,EAAkB2hB,EAAoBjuB,EAAasM,EAAQve,GAAKjD,IAGzE0iC,EAAS//B,IAAI,CAAEygC,YAAa,SAASA,YAAYN,EAAa1/B,GAC5D,OAAO+/B,EAAoBL,EAAav+B,EAASnB,GAAS0E,UAAUN,OAAS,EAAIxH,GAAY2iC,EAAU76B,UAAU,SAM7G,SAAUxH,EAAQD,EAASF,GAEjC,IAAIgpB,EAAMhpB,EAAoB,KAC1BkQ,EAAOlQ,EAAoB,KAC3BuiC,EAAWviC,EAAoB,IAC/BoE,EAAWpE,EAAoB,GAC/BwG,EAAiBxG,EAAoB,IACrCkjC,EAA0BX,EAASh5B,KACnCi5B,EAAYD,EAASlgC,IAErB8gC,EAAuB,SAAU1+B,EAAG3B,GACtC,IAAIsgC,EAAQF,EAAwBz+B,EAAG3B,GACnCue,EAAS7a,EAAe/B,GAC5B,GAAe,OAAX4c,EAAiB,OAAO+hB,EAC5B,IAAIC,EAAQF,EAAqB9hB,EAAQve,GACzC,OAAOugC,EAAMh8B,OAAS+7B,EAAM/7B,OAAS6I,EAAK,IAAI8Y,EAAIoa,EAAM/uB,OAAOgvB,KAAWA,EAAQD,GAGpFb,EAAS//B,IAAI,CAAE8gC,gBAAiB,SAASA,gBAAgBrgC,GACvD,OAAOkgC,EAAqB/+B,EAASnB,GAAS0E,UAAUN,OAAS,EAAIxH,GAAY2iC,EAAU76B,UAAU,SAMjG,SAAUxH,EAAQD,EAASF,GAEjC,IAAIuiC,EAAWviC,EAAoB,IAC/BoE,EAAWpE,EAAoB,GAC/B+iC,EAAyBR,EAASthC,IAClCuhC,EAAYD,EAASlgC,IAEzBkgC,EAAS//B,IAAI,CAAE+gC,eAAgB,SAASA,eAAeZ,EAAa1/B,GAClE,OAAO8/B,EAAuBJ,EAAav+B,EAASnB,GAChD0E,UAAUN,OAAS,EAAIxH,GAAY2iC,EAAU76B,UAAU,SAMvD,SAAUxH,EAAQD,EAASF,GAEjC,IAAIuiC,EAAWviC,EAAoB,IAC/BoE,EAAWpE,EAAoB,GAC/BkjC,EAA0BX,EAASh5B,KACnCi5B,EAAYD,EAASlgC,IAEzBkgC,EAAS//B,IAAI,CAAEghC,mBAAoB,SAASA,mBAAmBvgC,GAC7D,OAAOigC,EAAwB9+B,EAASnB,GAAS0E,UAAUN,OAAS,EAAIxH,GAAY2iC,EAAU76B,UAAU,SAMpG,SAAUxH,EAAQD,EAASF,GAEjC,IAAIuiC,EAAWviC,EAAoB,IAC/BoE,EAAWpE,EAAoB,GAC/BwG,EAAiBxG,EAAoB,IACrC8iC,EAAyBP,EAASp9B,IAClCq9B,EAAYD,EAASlgC,IAErBohC,EAAsB,SAAU1uB,EAAatQ,EAAG3B,GAElD,GADaggC,EAAuB/tB,EAAatQ,EAAG3B,GACxC,OAAO,EACnB,IAAIue,EAAS7a,EAAe/B,GAC5B,OAAkB,OAAX4c,GAAkBoiB,EAAoB1uB,EAAasM,EAAQve,IAGpEy/B,EAAS//B,IAAI,CAAEkhC,YAAa,SAASA,YAAYf,EAAa1/B,GAC5D,OAAOwgC,EAAoBd,EAAav+B,EAASnB,GAAS0E,UAAUN,OAAS,EAAIxH,GAAY2iC,EAAU76B,UAAU,SAM7G,SAAUxH,EAAQD,EAASF,GAEjC,IAAIuiC,EAAWviC,EAAoB,IAC/BoE,EAAWpE,EAAoB,GAC/B8iC,EAAyBP,EAASp9B,IAClCq9B,EAAYD,EAASlgC,IAEzBkgC,EAAS//B,IAAI,CAAEmhC,eAAgB,SAASA,eAAehB,EAAa1/B,GAClE,OAAO6/B,EAAuBH,EAAav+B,EAASnB,GAChD0E,UAAUN,OAAS,EAAIxH,GAAY2iC,EAAU76B,UAAU,SAMvD,SAAUxH,EAAQD,EAASF,GAEjC,IAAI4jC,EAAY5jC,EAAoB,IAChCoE,EAAWpE,EAAoB,GAC/BsH,EAAYtH,EAAoB,IAChCwiC,EAAYoB,EAAUvhC,IACtBogC,EAA4BmB,EAAUv0B,IAE1Cu0B,EAAUphC,IAAI,CAAE+/B,SAAU,SAASA,SAASI,EAAaC,GACvD,OAAO,SAASiB,UAAU5gC,EAAQ2R,GAChC6tB,EACEE,EAAaC,GACZhuB,IAAc/U,GAAYuE,EAAWkD,GAAWrE,GACjDu/B,EAAU5tB,SAQV,SAAUzU,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B04B,EAAY14B,EAAoB,GAApBA,GACZof,EAAUpf,EAAoB,GAAGof,QACjC4B,EAA6C,WAApChhB,EAAoB,GAApBA,CAAwBof,GAErCld,EAAQA,EAAQU,EAAG,CACjBkhC,KAAM,SAASA,KAAKv8B,GAClB,IAAI+Z,EAASN,GAAU5B,EAAQkC,OAC/BoX,EAAUpX,EAASA,EAAOiF,KAAKhf,GAAMA,OAOnC,SAAUpH,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B4B,EAAS5B,EAAoB,GAC7B6B,EAAO7B,EAAoB,IAC3B04B,EAAY14B,EAAoB,GAApBA,GACZ+jC,EAAa/jC,EAAoB,EAApBA,CAAuB,cACpCsH,EAAYtH,EAAoB,IAChCoE,EAAWpE,EAAoB,GAC/B2K,EAAa3K,EAAoB,IACjC6K,EAAc7K,EAAoB,IAClC8B,EAAO9B,EAAoB,IAC3B6a,EAAQ7a,EAAoB,IAC5BmW,EAAS0E,EAAM1E,OAEfkD,EAAY,SAAU9R,GACxB,OAAa,MAANA,EAAa1H,GAAYyH,EAAUC,IAGxCy8B,EAAsB,SAAUC,GAClC,IAAIC,EAAUD,EAAaxK,GACvByK,IACFD,EAAaxK,GAAK55B,GAClBqkC,MAIAC,EAAqB,SAAUF,GACjC,OAAOA,EAAaG,KAAOvkC,IAGzBwkC,EAAoB,SAAUJ,GAC3BE,EAAmBF,KACtBA,EAAaG,GAAKvkC,GAClBmkC,EAAoBC,KAIpBK,EAAe,SAAUC,EAAUC,GACrCpgC,EAASmgC,GACTv+B,KAAKyzB,GAAK55B,GACVmG,KAAKo+B,GAAKG,EACVA,EAAW,IAAIE,EAAqBz+B,MACpC,IACE,IAAIk+B,EAAUM,EAAWD,GACrBN,EAAeC,EACJ,MAAXA,IACiC,mBAAxBA,EAAQQ,YAA4BR,EAAU,WAAcD,EAAaS,eAC/Ep9B,EAAU48B,GACfl+B,KAAKyzB,GAAKyK,GAEZ,MAAOngC,GAEP,YADAwgC,EAAS7J,MAAM32B,GAEXogC,EAAmBn+B,OAAOg+B,EAAoBh+B,OAGtDs+B,EAAa9iC,UAAYqJ,EAAY,GAAI,CACvC65B,YAAa,SAASA,cAAgBL,EAAkBr+B,SAG1D,IAAIy+B,EAAuB,SAAUR,GACnCj+B,KAAK4zB,GAAKqK,GAGZQ,EAAqBjjC,UAAYqJ,EAAY,GAAI,CAC/C4F,KAAM,SAASA,KAAK9L,GAClB,IAAIs/B,EAAej+B,KAAK4zB,GACxB,IAAKuK,EAAmBF,GAAe,CACrC,IAAIM,EAAWN,EAAaG,GAC5B,IACE,IAAI7jC,EAAI8Y,EAAUkrB,EAAS9zB,MAC3B,GAAIlQ,EAAG,OAAOA,EAAED,KAAKikC,EAAU5/B,GAC/B,MAAOZ,GACP,IACEsgC,EAAkBJ,GAClB,QACA,MAAMlgC,MAKd22B,MAAO,SAASA,MAAM/1B,GACpB,IAAIs/B,EAAej+B,KAAK4zB,GACxB,GAAIuK,EAAmBF,GAAe,MAAMt/B,EAC5C,IAAI4/B,EAAWN,EAAaG,GAC5BH,EAAaG,GAAKvkC,GAClB,IACE,IAAIU,EAAI8Y,EAAUkrB,EAAS7J,OAC3B,IAAKn6B,EAAG,MAAMoE,EACdA,EAAQpE,EAAED,KAAKikC,EAAU5/B,GACzB,MAAOZ,GACP,IACEigC,EAAoBC,GACpB,QACA,MAAMlgC,GAGV,OADEigC,EAAoBC,GACft/B,GAETggC,SAAU,SAASA,SAAShgC,GAC1B,IAAIs/B,EAAej+B,KAAK4zB,GACxB,IAAKuK,EAAmBF,GAAe,CACrC,IAAIM,EAAWN,EAAaG,GAC5BH,EAAaG,GAAKvkC,GAClB,IACE,IAAIU,EAAI8Y,EAAUkrB,EAASI,UAC3BhgC,EAAQpE,EAAIA,EAAED,KAAKikC,EAAU5/B,GAAS9E,GACtC,MAAOkE,GACP,IACEigC,EAAoBC,GACpB,QACA,MAAMlgC,GAGV,OADEigC,EAAoBC,GACft/B,MAKb,IAAIigC,EAAc,SAASC,WAAWL,GACpC75B,EAAW3E,KAAM4+B,EAAa,aAAc,MAAMjc,GAAKrhB,EAAUk9B,IAGnE35B,EAAY+5B,EAAYpjC,UAAW,CACjCsjC,UAAW,SAASA,UAAUP,GAC5B,OAAO,IAAID,EAAaC,EAAUv+B,KAAK2iB,KAEzCnX,QAAS,SAASA,QAAQjK,GACxB,IAAIC,EAAOxB,KACX,OAAO,IAAKnE,EAAKkf,SAAWnf,EAAOmf,SAAS,SAAUW,EAASU,GAC7D9a,EAAUC,GACV,IAAI08B,EAAez8B,EAAKs9B,UAAU,CAChCr0B,KAAM,SAAU9L,GACd,IACE,OAAO4C,EAAG5C,GACV,MAAOZ,GACPqe,EAAOre,GACPkgC,EAAaS,gBAGjBhK,MAAOtY,EACPuiB,SAAUjjB,SAMlB7W,EAAY+5B,EAAa,CACvB10B,KAAM,SAASA,KAAK6N,GAClB,IAAIrO,EAAoB,mBAAT1J,KAAsBA,KAAO4+B,EACxC/8B,EAASwR,EAAUjV,EAAS2Z,GAAGgmB,IACnC,GAAIl8B,EAAQ,CACV,IAAIk9B,EAAa3gC,EAASyD,EAAOvH,KAAKyd,IACtC,OAAOgnB,EAAWt+B,cAAgBiJ,EAAIq1B,EAAa,IAAIr1B,EAAE,SAAU60B,GACjE,OAAOQ,EAAWD,UAAUP,KAGhC,OAAO,IAAI70B,EAAE,SAAU60B,GACrB,IAAI7zB,GAAO,EAeX,OAdAgoB,EAAU,WACR,IAAKhoB,EAAM,CACT,IACE,GAAImK,EAAMkD,GAAG,EAAO,SAAUta,GAE5B,GADA8gC,EAAS9zB,KAAKhN,GACViN,EAAM,OAAOyF,MACZA,EAAQ,OACf,MAAOpS,GACP,GAAI2M,EAAM,MAAM3M,EAEhB,YADAwgC,EAAS7J,MAAM32B,GAEfwgC,EAASI,cAGR,WAAcj0B,GAAO,MAGhCE,GAAI,SAASA,KACX,IAAK,IAAIxQ,EAAI,EAAGC,EAAIsH,UAAUN,OAAQ29B,EAAQ,IAAI14B,MAAMjM,GAAID,EAAIC,GAAI2kC,EAAM5kC,GAAKuH,UAAUvH,KACzF,OAAO,IAAqB,mBAAT4F,KAAsBA,KAAO4+B,GAAa,SAAUL,GACrE,IAAI7zB,GAAO,EASX,OARAgoB,EAAU,WACR,IAAKhoB,EAAM,CACT,IAAK,IAAIyM,EAAI,EAAGA,EAAI6nB,EAAM39B,SAAU8V,EAElC,GADAonB,EAAS9zB,KAAKu0B,EAAM7nB,IAChBzM,EAAM,OACV6zB,EAASI,cAGR,WAAcj0B,GAAO,QAKlC5O,EAAK8iC,EAAYpjC,UAAWuiC,EAAY,WAAc,OAAO/9B,OAE7D9D,EAAQA,EAAQU,EAAG,CAAEiiC,WAAYD,IAEjC5kC,EAAoB,GAApBA,CAAwB,eAKlB,SAAUG,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9BilC,EAAQjlC,EAAoB,IAChCkC,EAAQA,EAAQU,EAAIV,EAAQc,EAAG,CAC7Bsc,aAAc2lB,EAAM51B,IACpBmQ,eAAgBylB,EAAMvpB,SAMlB,SAAUvb,EAAQD,EAASF,GA+CjC,IA7CA,IAAI2S,EAAa3S,EAAoB,IACjC4c,EAAU5c,EAAoB,IAC9B+B,EAAW/B,EAAoB,IAC/B4B,EAAS5B,EAAoB,GAC7B8B,EAAO9B,EAAoB,IAC3ByL,EAAYzL,EAAoB,IAChCoL,EAAMpL,EAAoB,GAC1BqO,EAAWjD,EAAI,YACf85B,EAAgB95B,EAAI,eACpB+5B,EAAc15B,EAAUa,MAExB84B,EAAe,CACjBC,aAAa,EACbC,qBAAqB,EACrBC,cAAc,EACdC,gBAAgB,EAChBC,aAAa,EACbC,eAAe,EACfC,cAAc,EACdC,sBAAsB,EACtBC,UAAU,EACVC,mBAAmB,EACnBC,gBAAgB,EAChBC,iBAAiB,EACjBC,mBAAmB,EACnBC,WAAW,EACXC,eAAe,EACfC,cAAc,EACdC,UAAU,EACVC,kBAAkB,EAClBC,QAAQ,EACRC,aAAa,EACbC,eAAe,EACfC,eAAe,EACfC,gBAAgB,EAChBC,cAAc,EACdC,eAAe,EACfC,kBAAkB,EAClBC,kBAAkB,EAClBC,gBAAgB,EAChBC,kBAAkB,EAClBC,eAAe,EACfC,WAAW,GAGJC,EAAcxqB,EAAQwoB,GAAehlC,EAAI,EAAGA,EAAIgnC,EAAY//B,OAAQjH,IAAK,CAChF,IAIIiC,EAJA6E,EAAOkgC,EAAYhnC,GACnBinC,EAAWjC,EAAal+B,GACxBogC,EAAa1lC,EAAOsF,GACpB6J,EAAQu2B,GAAcA,EAAW9lC,UAErC,GAAIuP,IACGA,EAAM1C,IAAWvM,EAAKiP,EAAO1C,EAAU82B,GACvCp0B,EAAMm0B,IAAgBpjC,EAAKiP,EAAOm0B,EAAeh+B,GACtDuE,EAAUvE,GAAQi+B,EACdkC,GAAU,IAAKhlC,KAAOsQ,EAAiB5B,EAAM1O,IAAMN,EAASgP,EAAO1O,EAAKsQ,EAAWtQ,IAAM,KAO3F,SAAUlC,EAAQD,EAASF,GAGjC,IAAI4B,EAAS5B,EAAoB,GAC7BkC,EAAUlC,EAAoB,GAC9B4a,EAAY5a,EAAoB,IAChC4H,EAAQ,GAAGA,MACX2/B,EAAO,WAAWpgC,KAAKyT,GACvBuS,EAAO,SAAU9d,GACnB,OAAO,SAAU9H,EAAIigC,GACnB,IAAIC,EAA+B,EAAnB9/B,UAAUN,OACtBmW,IAAOiqB,GAAY7/B,EAAMtH,KAAKqH,UAAW,GAC7C,OAAO0H,EAAIo4B,EAAY,YAEP,mBAANlgC,EAAmBA,EAAKnE,SAASmE,IAAKG,MAAM1B,KAAMwX,IACxDjW,EAAIigC,KAGZtlC,EAAQA,EAAQU,EAAIV,EAAQc,EAAId,EAAQQ,EAAI6kC,EAAM,CAChD7mB,WAAYyM,EAAKvrB,EAAO8e,YACxBgnB,YAAava,EAAKvrB,EAAO8lC,gBAMrB,SAAUvnC,EAAQD,EAASF,GAIjC,IAAIgC,EAAMhC,EAAoB,IAC1BkC,EAAUlC,EAAoB,GAC9BkF,EAAalF,EAAoB,IACjC+c,EAAS/c,EAAoB,IAC7B8I,EAAS9I,EAAoB,IAC7BwG,EAAiBxG,EAAoB,IACrC4c,EAAU5c,EAAoB,IAC9BuE,EAAKvE,EAAoB,GACzB2nC,EAAQ3nC,EAAoB,KAC5BsH,EAAYtH,EAAoB,IAChC6a,EAAQ7a,EAAoB,IAC5ByrB,EAAazrB,EAAoB,KACjC2Y,EAAc3Y,EAAoB,IAClCmQ,EAAOnQ,EAAoB,IAC3BwD,EAAWxD,EAAoB,GAC/BkG,EAAYlG,EAAoB,IAChC+W,EAAc/W,EAAoB,GAClCmF,EAAMnF,EAAoB,IAU1B4nC,EAAmB,SAAUt/B,GAC/B,IAAIE,EAAiB,GAARF,EACTK,EAAmB,GAARL,EACf,OAAO,SAAUhH,EAAQ0H,EAAYxB,GACnC,IAIInF,EAAKqD,EAAKuD,EAJVzE,EAAIxC,EAAIgH,EAAYxB,EAAM,GAC1B/C,EAAIyB,EAAU5E,GACd6H,EAASX,GAAkB,GAARF,GAAqB,GAARA,EAC5B,IAAoB,mBAARtC,KAAqBA,KAAO6hC,MAAUhoC,GAE1D,IAAKwC,KAAOoC,EAAG,GAAIU,EAAIV,EAAGpC,KAExB4G,EAAMzE,EADNkB,EAAMjB,EAAEpC,GACKA,EAAKf,GACdgH,GACF,GAAIE,EAAQW,EAAO9G,GAAO4G,OACrB,GAAIA,EAAK,OAAQX,GACpB,KAAK,EAAGa,EAAO9G,GAAOqD,EAAK,MAC3B,KAAK,EAAG,OAAO,EACf,KAAK,EAAG,OAAOA,EACf,KAAK,EAAG,OAAOrD,EACf,KAAK,EAAG8G,EAAOF,EAAI,IAAMA,EAAI,QACxB,GAAIN,EAAU,OAAO,EAGhC,OAAe,GAARL,GAAaK,EAAWA,EAAWQ,IAG1C2+B,EAAUF,EAAiB,GAE3BG,EAAiB,SAAUzuB,GAC7B,OAAO,SAAU7V,GACf,OAAO,IAAIukC,EAAavkC,EAAI6V,KAG5B0uB,EAAe,SAAUtpB,EAAUpF,GACrCtT,KAAK8R,GAAK5R,EAAUwY,GACpB1Y,KAAK20B,GAAK/d,EAAQ8B,GAClB1Y,KAAK2Y,GAAK,EACV3Y,KAAK4Y,GAAKtF,GAmBZ,SAASuuB,KAAKzxB,GACZ,IAAI6xB,EAAOn/B,EAAO,MAQlB,OAPIsN,GAAYvW,KACV4rB,EAAWrV,GACbyE,EAAMzE,GAAU,EAAM,SAAU/T,EAAKsC,GACnCsjC,EAAK5lC,GAAOsC,IAEToY,EAAOkrB,EAAM7xB,IAEf6xB,EA1BTtvB,EAAYqvB,EAAc,OAAQ,WAChC,IAII3lC,EAHAoC,EADOuB,KACE8R,GACTvO,EAFOvD,KAEK20B,GACZrhB,EAHOtT,KAGK4Y,GAEhB,GACE,GAAerV,EAAKlC,QANXrB,KAMA2Y,GAEP,OARO3Y,KAOF8R,GAAKjY,GACHsQ,EAAK,UAENhL,EAAIV,EAAGpC,EAAMkH,EAVZvD,KAUsB2Y,QACjC,OAA2BxO,EAAK,EAApB,QAARmJ,EAA+BjX,EACvB,UAARiX,EAAiC7U,EAAEpC,GACxB,CAACA,EAAKoC,EAAEpC,OAczBwlC,KAAKrmC,UAAY,KAwCjBU,EAAQA,EAAQU,EAAIV,EAAQQ,EAAG,CAAEmlC,KAAMA,OAEvC3lC,EAAQA,EAAQgB,EAAG,OAAQ,CACzBqG,KAAMw+B,EAAe,QACrB36B,OAAQ26B,EAAe,UACvBx6B,QAASw6B,EAAe,WACxBv2B,QAASo2B,EAAiB,GAC1B/1B,IAAK+1B,EAAiB,GACtBx2B,OAAQw2B,EAAiB,GACzB51B,KAAM41B,EAAiB,GACvB12B,MAAO02B,EAAiB,GACxBv2B,KAAMu2B,EAAiB,GACvBE,QAASA,EACTI,SAAUN,EAAiB,GAC3Bj6B,OApDF,SAASA,OAAOrM,EAAQgP,EAAOmuB,GAC7Bn3B,EAAUgJ,GACV,IAIIyX,EAAM1lB,EAJNoC,EAAIyB,EAAU5E,GACdiI,EAAOqT,EAAQnY,GACf4C,EAASkC,EAAKlC,OACdjH,EAAI,EAER,GAAIuH,UAAUN,OAAS,EAAG,CACxB,IAAKA,EAAQ,MAAM3D,UAAU,gDAC7BqkB,EAAOtjB,EAAE8E,EAAKnJ,WACT2nB,EAAOlnB,OAAO49B,GACrB,KAAgBr+B,EAATiH,GAAgBlC,EAAIV,EAAGpC,EAAMkH,EAAKnJ,QACvC2nB,EAAOzX,EAAMyX,EAAMtjB,EAAEpC,GAAMA,EAAKf,IAElC,OAAOymB,GAuCP4f,MAAOA,EACPh2B,SArCF,SAASA,SAASrQ,EAAQ+W,GAExB,OAAQA,GAAMA,EAAKsvB,EAAMrmC,EAAQ+W,GAAMyvB,EAAQxmC,EAAQ,SAAUmC,GAE/D,OAAOA,GAAMA,OACP5D,IAiCRsF,IAAKA,EACLlE,IA/BF,SAASA,IAAIK,EAAQe,GACnB,GAAI8C,EAAI7D,EAAQe,GAAM,OAAOf,EAAOe,IA+BpCgN,IA7BF,SAASA,IAAI/N,EAAQe,EAAKsC,GAGxB,OAFIoS,GAAe1U,KAAOxB,OAAQ0D,EAAGC,EAAElD,EAAQe,EAAK6C,EAAW,EAAGP,IAC7DrD,EAAOe,GAAOsC,EACZrD,GA2BP6mC,OAxBF,SAASA,OAAO1kC,GACd,OAAOD,EAASC,IAAO+C,EAAe/C,KAAQokC,KAAKrmC,cA6B/C,SAAUrB,EAAQD,EAASF,GAEjC,IAAI4c,EAAU5c,EAAoB,IAC9BkG,EAAYlG,EAAoB,IACpCG,EAAOD,QAAU,SAAUoB,EAAQ+W,GAMjC,IALA,IAIIhW,EAJAoC,EAAIyB,EAAU5E,GACdiI,EAAOqT,EAAQnY,GACf4C,EAASkC,EAAKlC,OACd6B,EAAQ,EAEIA,EAAT7B,GAAgB,GAAI5C,EAAEpC,EAAMkH,EAAKL,QAAcmP,EAAI,OAAOhW,IAM7D,SAAUlC,EAAQD,EAASF,GAEjC,IAAIoE,EAAWpE,EAAoB,GAC/BiB,EAAMjB,EAAoB,IAC9BG,EAAOD,QAAUF,EAAoB,IAAIooC,YAAc,SAAU3kC,GAC/D,IAAI+M,EAASvP,EAAIwC,GACjB,GAAqB,mBAAV+M,EAAsB,MAAM9M,UAAUD,EAAK,qBACtD,OAAOW,EAASoM,EAAOlQ,KAAKmD,MAMxB,SAAUtD,EAAQD,EAASF,GAEjC,IAAI4B,EAAS5B,EAAoB,GAC7B6B,EAAO7B,EAAoB,IAC3BkC,EAAUlC,EAAoB,GAC9BqoC,EAAUroC,EAAoB,KAElCkC,EAAQA,EAAQU,EAAIV,EAAQQ,EAAG,CAC7B4lC,MAAO,SAASA,MAAMd,GACpB,OAAO,IAAK3lC,EAAKkf,SAAWnf,EAAOmf,SAAS,SAAUW,GACpDhB,WAAW2nB,EAAQ/nC,KAAKohB,GAAS,GAAO8lB,SAQxC,SAAUrnC,EAAQD,EAASF,GAEjC,IAAI0rB,EAAO1rB,EAAoB,KAC3BkC,EAAUlC,EAAoB,GAGlCA,EAAoB,IAAIkV,EAAIwW,EAAKxW,EAAIwW,EAAKxW,GAAK,GAE/ChT,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAG,WAAY,CAAEujB,KAAMjmB,EAAoB,QAKjE,SAAUG,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,EAAG,SAAU,CAAEc,SAAUxD,EAAoB,MAKnE,SAAUG,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,EAAG,SAAU,CAAEsI,QAAShL,EAAoB,OAKlE,SAAUG,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B6rB,EAAS7rB,EAAoB,KAEjCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,EAAG,SAAU,CAAEmpB,OAAQA,KAK7C,SAAU1rB,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B6rB,EAAS7rB,EAAoB,KAC7B8I,EAAS9I,EAAoB,IAEjCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,EAAG,SAAU,CACvC6lC,KAAM,SAAUx3B,EAAO+a,GACrB,OAAOD,EAAO/iB,EAAOiI,GAAQ+a,OAO3B,SAAU3rB,EAAQD,EAASF,GAIjCA,EAAoB,GAApBA,CAAwBgwB,OAAQ,SAAU,SAAUtR,GAClD1Y,KAAK4iB,IAAMlK,EACX1Y,KAAK2Y,GAAK,GACT,WACD,IAAIve,EAAI4F,KAAK2Y,KACTjO,IAAStQ,EAAI4F,KAAK4iB,IACtB,MAAO,CAAElY,KAAMA,EAAM/L,MAAO+L,EAAO7Q,GAAYO,MAM3C,SAAUD,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BwoC,EAAMxoC,EAAoB,GAApBA,CAAwB,sBAAuB,QAEzDkC,EAAQA,EAAQgB,EAAG,SAAU,CAAEulC,OAAQ,SAASA,OAAOhlC,GAAM,OAAO+kC,EAAI/kC,OAKlE,SAAUtD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BwoC,EAAMxoC,EAAoB,GAApBA,CAAwB,WAAY,CAC5C0oC,IAAK,QACLC,IAAK,OACLC,IAAK,OACLC,IAAK,SACLC,IAAK,WAGP5mC,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAG,SAAU,CAAEqmC,WAAY,SAASA,aAAe,OAAOP,EAAIxiC,UAKpF,SAAU7F,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BwoC,EAAMxoC,EAAoB,GAApBA,CAAwB,6BAA8B,CAC9DgpC,QAAS,IACTC,OAAQ,IACRC,OAAQ,IACRC,SAAU,IACVC,SAAU,MAGZlnC,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAG,SAAU,CAAE2mC,aAAc,SAASA,eAAiB,OAAOb,EAAIxiC,YAMzE,oBAAV7F,QAAyBA,OAAOD,QAASC,OAAOD,QAAUP,EAE3C,mBAAVksB,QAAwBA,OAAOyd,IAAKzd,OAAO,WAAc,OAAOlsB,IAE3EC,EAAIiC,KAAOlC,EA77Qf,CA87QC,EAAG","file":"core.min.js"} \ No newline at end of file diff --git a/node_modules/core-js/client/library.js b/node_modules/core-js/client/library.js new file mode 100644 index 000000000..7179088e5 --- /dev/null +++ b/node_modules/core-js/client/library.js @@ -0,0 +1,8129 @@ +/** + * core-js 2.5.7 + * https://github.com/zloirock/core-js + * License: http://rock.mit-license.org + * © 2018 Denis Pushkarev + */ +!function(__e, __g, undefined){ +'use strict'; +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 126); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var core = __webpack_require__(12); +var ctx = __webpack_require__(16); +var hide = __webpack_require__(17); +var has = __webpack_require__(15); +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; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(3); +module.exports = function (it) { + if (!isObject(it)) throw TypeError(it + ' is not an object!'); + return it; +}; + + +/***/ }), +/* 2 */ +/***/ (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 + + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } +}; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +var store = __webpack_require__(49)('wks'); +var uid = __webpack_require__(40); +var Symbol = __webpack_require__(2).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; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.15 ToLength +var toInteger = __webpack_require__(22); +var min = Math.min; +module.exports = function (it) { + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(1); +var IE8_DOM_DEFINE = __webpack_require__(90); +var toPrimitive = __webpack_require__(27); +var dP = Object.defineProperty; + +exports.f = __webpack_require__(8) ? 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; +}; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +// Thank's IE8 for his funny defineProperty +module.exports = !__webpack_require__(4)(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.13 ToObject(argument) +var defined = __webpack_require__(24); +module.exports = function (it) { + return Object(defined(it)); +}; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports) { + +module.exports = function (it) { + if (typeof it != 'function') throw TypeError(it + ' is not a function!'); + return it; +}; + + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = __webpack_require__(44); +var defined = __webpack_require__(24); +module.exports = function (it) { + return IObject(defined(it)); +}; + + +/***/ }), +/* 12 */ +/***/ (function(module, exports) { + +var core = module.exports = { version: '2.5.7' }; +if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef + + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) +var has = __webpack_require__(15); +var toObject = __webpack_require__(9); +var IE_PROTO = __webpack_require__(65)('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; +}; + + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var fails = __webpack_require__(4); +var defined = __webpack_require__(24); +var quot = /"/g; +// B.2.3.2.1 CreateHTML(string, tag, attribute, value) +var createHTML = function (string, tag, attribute, value) { + var S = String(defined(string)); + var p1 = '<' + tag; + if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; + return p1 + '>' + S + ''; +}; +module.exports = function (NAME, exec) { + var O = {}; + O[NAME] = exec(createHTML); + $export($export.P + $export.F * fails(function () { + var test = ''[NAME]('"'); + return test !== test.toLowerCase() || test.split('"').length > 3; + }), 'String', O); +}; + + +/***/ }), +/* 15 */ +/***/ (function(module, exports) { + +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function (it, key) { + return hasOwnProperty.call(it, key); +}; + + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +// optional / simple context binding +var aFunction = __webpack_require__(10); +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); + }; +}; + + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(7); +var createDesc = __webpack_require__(28); +module.exports = __webpack_require__(8) ? function (object, key, value) { + return dP.f(object, key, createDesc(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; +}; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +var pIE = __webpack_require__(45); +var createDesc = __webpack_require__(28); +var toIObject = __webpack_require__(11); +var toPrimitive = __webpack_require__(27); +var has = __webpack_require__(15); +var IE8_DOM_DEFINE = __webpack_require__(90); +var gOPD = Object.getOwnPropertyDescriptor; + +exports.f = __webpack_require__(8) ? 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]); +}; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var fails = __webpack_require__(4); + +module.exports = function (method, arg) { + return !!method && fails(function () { + // eslint-disable-next-line no-useless-call + arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null); + }); +}; + + +/***/ }), +/* 20 */ +/***/ (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__(16); +var IObject = __webpack_require__(44); +var toObject = __webpack_require__(9); +var toLength = __webpack_require__(6); +var asc = __webpack_require__(80); +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; + }; +}; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports) { + +var toString = {}.toString; + +module.exports = function (it) { + return toString.call(it).slice(8, -1); +}; + + +/***/ }), +/* 22 */ +/***/ (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); +}; + + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +// most Object methods by ES6 should accept primitives +var $export = __webpack_require__(0); +var core = __webpack_require__(12); +var fails = __webpack_require__(4); +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); +}; + + +/***/ }), +/* 24 */ +/***/ (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; +}; + + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +if (__webpack_require__(8)) { + var LIBRARY = __webpack_require__(30); + var global = __webpack_require__(2); + var fails = __webpack_require__(4); + var $export = __webpack_require__(0); + var $typed = __webpack_require__(58); + var $buffer = __webpack_require__(88); + var ctx = __webpack_require__(16); + var anInstance = __webpack_require__(38); + var propertyDesc = __webpack_require__(28); + var hide = __webpack_require__(17); + var redefineAll = __webpack_require__(39); + var toInteger = __webpack_require__(22); + var toLength = __webpack_require__(6); + var toIndex = __webpack_require__(115); + var toAbsoluteIndex = __webpack_require__(35); + var toPrimitive = __webpack_require__(27); + var has = __webpack_require__(15); + var classof = __webpack_require__(37); + var isObject = __webpack_require__(3); + var toObject = __webpack_require__(9); + var isArrayIter = __webpack_require__(77); + var create = __webpack_require__(32); + var getPrototypeOf = __webpack_require__(13); + var gOPN = __webpack_require__(46).f; + var getIterFn = __webpack_require__(48); + var uid = __webpack_require__(40); + var wks = __webpack_require__(5); + var createArrayMethod = __webpack_require__(20); + var createArrayIncludes = __webpack_require__(50); + var speciesConstructor = __webpack_require__(55); + var ArrayIterators = __webpack_require__(82); + var Iterators = __webpack_require__(36); + var $iterDetect = __webpack_require__(79); + var setSpecies = __webpack_require__(42); + var arrayFill = __webpack_require__(81); + var arrayCopyWithin = __webpack_require__(106); + var $DP = __webpack_require__(7); + var $GOPD = __webpack_require__(18); + var dP = $DP.f; + var gOPD = $GOPD.f; + var RangeError = global.RangeError; + var TypeError = global.TypeError; + var Uint8Array = global.Uint8Array; + var ARRAY_BUFFER = 'ArrayBuffer'; + var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER; + var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; + var PROTOTYPE = 'prototype'; + var ArrayProto = Array[PROTOTYPE]; + var $ArrayBuffer = $buffer.ArrayBuffer; + var $DataView = $buffer.DataView; + var arrayForEach = createArrayMethod(0); + var arrayFilter = createArrayMethod(2); + var arraySome = createArrayMethod(3); + var arrayEvery = createArrayMethod(4); + var arrayFind = createArrayMethod(5); + var arrayFindIndex = createArrayMethod(6); + var arrayIncludes = createArrayIncludes(true); + var arrayIndexOf = createArrayIncludes(false); + var arrayValues = ArrayIterators.values; + var arrayKeys = ArrayIterators.keys; + var arrayEntries = ArrayIterators.entries; + var arrayLastIndexOf = ArrayProto.lastIndexOf; + var arrayReduce = ArrayProto.reduce; + var arrayReduceRight = ArrayProto.reduceRight; + var arrayJoin = ArrayProto.join; + var arraySort = ArrayProto.sort; + var arraySlice = ArrayProto.slice; + var arrayToString = ArrayProto.toString; + var arrayToLocaleString = ArrayProto.toLocaleString; + var ITERATOR = wks('iterator'); + var TAG = wks('toStringTag'); + var TYPED_CONSTRUCTOR = uid('typed_constructor'); + var DEF_CONSTRUCTOR = uid('def_constructor'); + var ALL_CONSTRUCTORS = $typed.CONSTR; + var TYPED_ARRAY = $typed.TYPED; + var VIEW = $typed.VIEW; + var WRONG_LENGTH = 'Wrong length!'; + + var $map = createArrayMethod(1, function (O, length) { + return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); + }); + + var LITTLE_ENDIAN = fails(function () { + // eslint-disable-next-line no-undef + return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; + }); + + var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () { + new Uint8Array(1).set({}); + }); + + var toOffset = function (it, BYTES) { + var offset = toInteger(it); + if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!'); + return offset; + }; + + var validate = function (it) { + if (isObject(it) && TYPED_ARRAY in it) return it; + throw TypeError(it + ' is not a typed array!'); + }; + + var allocate = function (C, length) { + if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) { + throw TypeError('It is not a typed array constructor!'); + } return new C(length); + }; + + var speciesFromList = function (O, list) { + return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); + }; + + var fromList = function (C, list) { + var index = 0; + var length = list.length; + var result = allocate(C, length); + while (length > index) result[index] = list[index++]; + return result; + }; + + var addGetter = function (it, key, internal) { + dP(it, key, { get: function () { return this._d[internal]; } }); + }; + + var $from = function from(source /* , mapfn, thisArg */) { + var O = toObject(source); + var aLen = arguments.length; + var mapfn = aLen > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var iterFn = getIterFn(O); + var i, length, values, result, step, iterator; + if (iterFn != undefined && !isArrayIter(iterFn)) { + for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) { + values.push(step.value); + } O = values; + } + if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2); + for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) { + result[i] = mapping ? mapfn(O[i], i) : O[i]; + } + return result; + }; + + var $of = function of(/* ...items */) { + var index = 0; + var length = arguments.length; + var result = allocate(this, length); + while (length > index) result[index] = arguments[index++]; + return result; + }; + + // iOS Safari 6.x fails here + var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); }); + + var $toLocaleString = function toLocaleString() { + return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); + }; + + var proto = { + copyWithin: function copyWithin(target, start /* , end */) { + return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); + }, + every: function every(callbackfn /* , thisArg */) { + return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars + return arrayFill.apply(validate(this), arguments); + }, + filter: function filter(callbackfn /* , thisArg */) { + return speciesFromList(this, arrayFilter(validate(this), callbackfn, + arguments.length > 1 ? arguments[1] : undefined)); + }, + find: function find(predicate /* , thisArg */) { + return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + findIndex: function findIndex(predicate /* , thisArg */) { + return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + forEach: function forEach(callbackfn /* , thisArg */) { + arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + indexOf: function indexOf(searchElement /* , fromIndex */) { + return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + includes: function includes(searchElement /* , fromIndex */) { + return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + join: function join(separator) { // eslint-disable-line no-unused-vars + return arrayJoin.apply(validate(this), arguments); + }, + lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars + return arrayLastIndexOf.apply(validate(this), arguments); + }, + map: function map(mapfn /* , thisArg */) { + return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); + }, + reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars + return arrayReduce.apply(validate(this), arguments); + }, + reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars + return arrayReduceRight.apply(validate(this), arguments); + }, + reverse: function reverse() { + var that = this; + var length = validate(that).length; + var middle = Math.floor(length / 2); + var index = 0; + var value; + while (index < middle) { + value = that[index]; + that[index++] = that[--length]; + that[length] = value; + } return that; + }, + some: function some(callbackfn /* , thisArg */) { + return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + sort: function sort(comparefn) { + return arraySort.call(validate(this), comparefn); + }, + subarray: function subarray(begin, end) { + var O = validate(this); + var length = O.length; + var $begin = toAbsoluteIndex(begin, length); + return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( + O.buffer, + O.byteOffset + $begin * O.BYTES_PER_ELEMENT, + toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin) + ); + } + }; + + var $slice = function slice(start, end) { + return speciesFromList(this, arraySlice.call(validate(this), start, end)); + }; + + var $set = function set(arrayLike /* , offset */) { + validate(this); + var offset = toOffset(arguments[1], 1); + var length = this.length; + var src = toObject(arrayLike); + var len = toLength(src.length); + var index = 0; + if (len + offset > length) throw RangeError(WRONG_LENGTH); + while (index < len) this[offset + index] = src[index++]; + }; + + var $iterators = { + entries: function entries() { + return arrayEntries.call(validate(this)); + }, + keys: function keys() { + return arrayKeys.call(validate(this)); + }, + values: function values() { + return arrayValues.call(validate(this)); + } + }; + + var isTAIndex = function (target, key) { + return isObject(target) + && target[TYPED_ARRAY] + && typeof key != 'symbol' + && key in target + && String(+key) == String(key); + }; + var $getDesc = function getOwnPropertyDescriptor(target, key) { + return isTAIndex(target, key = toPrimitive(key, true)) + ? propertyDesc(2, target[key]) + : gOPD(target, key); + }; + var $setDesc = function defineProperty(target, key, desc) { + if (isTAIndex(target, key = toPrimitive(key, true)) + && isObject(desc) + && has(desc, 'value') + && !has(desc, 'get') + && !has(desc, 'set') + // TODO: add validation descriptor w/o calling accessors + && !desc.configurable + && (!has(desc, 'writable') || desc.writable) + && (!has(desc, 'enumerable') || desc.enumerable) + ) { + target[key] = desc.value; + return target; + } return dP(target, key, desc); + }; + + if (!ALL_CONSTRUCTORS) { + $GOPD.f = $getDesc; + $DP.f = $setDesc; + } + + $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { + getOwnPropertyDescriptor: $getDesc, + defineProperty: $setDesc + }); + + if (fails(function () { arrayToString.call({}); })) { + arrayToString = arrayToLocaleString = function toString() { + return arrayJoin.call(this); + }; + } + + var $TypedArrayPrototype$ = redefineAll({}, proto); + redefineAll($TypedArrayPrototype$, $iterators); + hide($TypedArrayPrototype$, ITERATOR, $iterators.values); + redefineAll($TypedArrayPrototype$, { + slice: $slice, + set: $set, + constructor: function () { /* noop */ }, + toString: arrayToString, + toLocaleString: $toLocaleString + }); + addGetter($TypedArrayPrototype$, 'buffer', 'b'); + addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); + addGetter($TypedArrayPrototype$, 'byteLength', 'l'); + addGetter($TypedArrayPrototype$, 'length', 'e'); + dP($TypedArrayPrototype$, TAG, { + get: function () { return this[TYPED_ARRAY]; } + }); + + // eslint-disable-next-line max-statements + module.exports = function (KEY, BYTES, wrapper, CLAMPED) { + CLAMPED = !!CLAMPED; + var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'; + var GETTER = 'get' + KEY; + var SETTER = 'set' + KEY; + var TypedArray = global[NAME]; + var Base = TypedArray || {}; + var TAC = TypedArray && getPrototypeOf(TypedArray); + var FORCED = !TypedArray || !$typed.ABV; + var O = {}; + var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; + var getter = function (that, index) { + var data = that._d; + return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); + }; + var setter = function (that, index, value) { + var data = that._d; + if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; + data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); + }; + var addElement = function (that, index) { + dP(that, index, { + get: function () { + return getter(this, index); + }, + set: function (value) { + return setter(this, index, value); + }, + enumerable: true + }); + }; + if (FORCED) { + TypedArray = wrapper(function (that, data, $offset, $length) { + anInstance(that, TypedArray, NAME, '_d'); + var index = 0; + var offset = 0; + var buffer, byteLength, length, klass; + if (!isObject(data)) { + length = toIndex(data); + byteLength = length * BYTES; + buffer = new $ArrayBuffer(byteLength); + } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { + buffer = data; + offset = toOffset($offset, BYTES); + var $len = data.byteLength; + if ($length === undefined) { + if ($len % BYTES) throw RangeError(WRONG_LENGTH); + byteLength = $len - offset; + if (byteLength < 0) throw RangeError(WRONG_LENGTH); + } else { + byteLength = toLength($length) * BYTES; + if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH); + } + length = byteLength / BYTES; + } else if (TYPED_ARRAY in data) { + return fromList(TypedArray, data); + } else { + return $from.call(TypedArray, data); + } + hide(that, '_d', { + b: buffer, + o: offset, + l: byteLength, + e: length, + v: new $DataView(buffer) + }); + while (index < length) addElement(that, index++); + }); + TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); + hide(TypedArrayPrototype, 'constructor', TypedArray); + } else if (!fails(function () { + TypedArray(1); + }) || !fails(function () { + new TypedArray(-1); // eslint-disable-line no-new + }) || !$iterDetect(function (iter) { + new TypedArray(); // eslint-disable-line no-new + new TypedArray(null); // eslint-disable-line no-new + new TypedArray(1.5); // eslint-disable-line no-new + new TypedArray(iter); // eslint-disable-line no-new + }, true)) { + TypedArray = wrapper(function (that, data, $offset, $length) { + anInstance(that, TypedArray, NAME); + var klass; + // `ws` module bug, temporarily remove validation length for Uint8Array + // https://github.com/websockets/ws/pull/645 + if (!isObject(data)) return new Base(toIndex(data)); + if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { + return $length !== undefined + ? new Base(data, toOffset($offset, BYTES), $length) + : $offset !== undefined + ? new Base(data, toOffset($offset, BYTES)) + : new Base(data); + } + if (TYPED_ARRAY in data) return fromList(TypedArray, data); + return $from.call(TypedArray, data); + }); + arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) { + if (!(key in TypedArray)) hide(TypedArray, key, Base[key]); + }); + TypedArray[PROTOTYPE] = TypedArrayPrototype; + if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray; + } + var $nativeIterator = TypedArrayPrototype[ITERATOR]; + var CORRECT_ITER_NAME = !!$nativeIterator + && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined); + var $iterator = $iterators.values; + hide(TypedArray, TYPED_CONSTRUCTOR, true); + hide(TypedArrayPrototype, TYPED_ARRAY, NAME); + hide(TypedArrayPrototype, VIEW, true); + hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); + + if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) { + dP(TypedArrayPrototype, TAG, { + get: function () { return NAME; } + }); + } + + O[NAME] = TypedArray; + + $export($export.G + $export.W + $export.F * (TypedArray != Base), O); + + $export($export.S, NAME, { + BYTES_PER_ELEMENT: BYTES + }); + + $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, { + from: $from, + of: $of + }); + + if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); + + $export($export.P, NAME, proto); + + setSpecies(NAME); + + $export($export.P + $export.F * FORCED_SET, NAME, { set: $set }); + + $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); + + if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString; + + $export($export.P + $export.F * fails(function () { + new TypedArray(1).slice(); + }), NAME, { slice: $slice }); + + $export($export.P + $export.F * (fails(function () { + return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString(); + }) || !fails(function () { + TypedArrayPrototype.toLocaleString.call([1, 2]); + })), NAME, { toLocaleString: $toLocaleString }); + + Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; + if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator); + }; +} else module.exports = function () { /* empty */ }; + + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +var Map = __webpack_require__(109); +var $export = __webpack_require__(0); +var shared = __webpack_require__(49)('metadata'); +var store = shared.store || (shared.store = new (__webpack_require__(112))()); + +var getOrCreateMetadataMap = function (target, targetKey, create) { + var targetMetadata = store.get(target); + if (!targetMetadata) { + if (!create) return undefined; + store.set(target, targetMetadata = new Map()); + } + var keyMetadata = targetMetadata.get(targetKey); + if (!keyMetadata) { + if (!create) return undefined; + targetMetadata.set(targetKey, keyMetadata = new Map()); + } return keyMetadata; +}; +var ordinaryHasOwnMetadata = function (MetadataKey, O, P) { + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? false : metadataMap.has(MetadataKey); +}; +var ordinaryGetOwnMetadata = function (MetadataKey, O, P) { + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); +}; +var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) { + getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); +}; +var ordinaryOwnMetadataKeys = function (target, targetKey) { + var metadataMap = getOrCreateMetadataMap(target, targetKey, false); + var keys = []; + if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); }); + return keys; +}; +var toMetaKey = function (it) { + return it === undefined || typeof it == 'symbol' ? it : String(it); +}; +var exp = function (O) { + $export($export.S, 'Reflect', O); +}; + +module.exports = { + store: store, + map: getOrCreateMetadataMap, + has: ordinaryHasOwnMetadata, + get: ordinaryGetOwnMetadata, + set: ordinaryDefineOwnMetadata, + keys: ordinaryOwnMetadataKeys, + key: toMetaKey, + exp: exp +}; + + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = __webpack_require__(3); +// 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"); +}; + + +/***/ }), +/* 28 */ +/***/ (function(module, exports) { + +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; + + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +var META = __webpack_require__(40)('meta'); +var isObject = __webpack_require__(3); +var has = __webpack_require__(15); +var setDesc = __webpack_require__(7).f; +var id = 0; +var isExtensible = Object.isExtensible || function () { + return true; +}; +var FREEZE = !__webpack_require__(4)(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 +}; + + +/***/ }), +/* 30 */ +/***/ (function(module, exports) { + +module.exports = true; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = __webpack_require__(92); +var enumBugKeys = __webpack_require__(66); + +module.exports = Object.keys || function keys(O) { + return $keys(O, enumBugKeys); +}; + + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +var anObject = __webpack_require__(1); +var dPs = __webpack_require__(93); +var enumBugKeys = __webpack_require__(66); +var IE_PROTO = __webpack_require__(65)('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__(62)('iframe'); + var i = enumBugKeys.length; + var lt = '<'; + var gt = '>'; + var iframeDocument; + iframe.style.display = 'none'; + __webpack_require__(67).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); +}; + + +/***/ }), +/* 33 */ +/***/ (function(module, exports) { + +module.exports = function () { /* empty */ }; + + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +var ctx = __webpack_require__(16); +var call = __webpack_require__(104); +var isArrayIter = __webpack_require__(77); +var anObject = __webpack_require__(1); +var toLength = __webpack_require__(6); +var getIterFn = __webpack_require__(48); +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; + + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__(22); +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); +}; + + +/***/ }), +/* 36 */ +/***/ (function(module, exports) { + +module.exports = {}; + + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +// getting tag from 19.1.3.6 Object.prototype.toString() +var cof = __webpack_require__(21); +var TAG = __webpack_require__(5)('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; +}; + + +/***/ }), +/* 38 */ +/***/ (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; +}; + + +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { + +var hide = __webpack_require__(17); +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; +}; + + +/***/ }), +/* 40 */ +/***/ (function(module, exports) { + +var id = 0; +var px = Math.random(); +module.exports = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; + + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +var def = __webpack_require__(7).f; +var has = __webpack_require__(15); +var TAG = __webpack_require__(5)('toStringTag'); + +module.exports = function (it, tag, stat) { + if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); +}; + + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(2); +var core = __webpack_require__(12); +var dP = __webpack_require__(7); +var DESCRIPTORS = __webpack_require__(8); +var SPECIES = __webpack_require__(5)('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; } + }); +}; + + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(3); +module.exports = function (it, TYPE) { + if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); + return it; +}; + + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = __webpack_require__(21); +// eslint-disable-next-line no-prototype-builtins +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { + return cof(it) == 'String' ? it.split('') : Object(it); +}; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports) { + +exports.f = {}.propertyIsEnumerable; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) +var $keys = __webpack_require__(92); +var hiddenKeys = __webpack_require__(66).concat('length', 'prototype'); + +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return $keys(O, hiddenKeys); +}; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var defined = __webpack_require__(24); +var fails = __webpack_require__(4); +var spaces = __webpack_require__(71); +var space = '[' + spaces + ']'; +var non = '\u200b\u0085'; +var ltrim = RegExp('^' + space + space + '*'); +var rtrim = RegExp(space + space + '*$'); + +var exporter = function (KEY, exec, ALIAS) { + var exp = {}; + var FORCE = fails(function () { + return !!spaces[KEY]() || non[KEY]() != non; + }); + var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; + if (ALIAS) exp[ALIAS] = fn; + $export($export.P + $export.F * FORCE, 'String', exp); +}; + +// 1 -> String#trimLeft +// 2 -> String#trimRight +// 3 -> String#trim +var trim = exporter.trim = function (string, TYPE) { + string = String(defined(string)); + if (TYPE & 1) string = string.replace(ltrim, ''); + if (TYPE & 2) string = string.replace(rtrim, ''); + return string; +}; + +module.exports = exporter; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { + +var classof = __webpack_require__(37); +var ITERATOR = __webpack_require__(5)('iterator'); +var Iterators = __webpack_require__(36); +module.exports = __webpack_require__(12).getIteratorMethod = function (it) { + if (it != undefined) return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; +}; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +var core = __webpack_require__(12); +var global = __webpack_require__(2); +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__(30) ? 'pure' : 'global', + copyright: '© 2018 Denis Pushkarev (zloirock.ru)' +}); + + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + +// false -> Array#indexOf +// true -> Array#includes +var toIObject = __webpack_require__(11); +var toLength = __webpack_require__(6); +var toAbsoluteIndex = __webpack_require__(35); +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; + }; +}; + + +/***/ }), +/* 51 */ +/***/ (function(module, exports) { + +exports.f = Object.getOwnPropertySymbols; + + +/***/ }), +/* 52 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.2.2 IsArray(argument) +var cof = __webpack_require__(21); +module.exports = Array.isArray || function isArray(arg) { + return cof(arg) == 'Array'; +}; + + +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var LIBRARY = __webpack_require__(30); +var $export = __webpack_require__(0); +var redefine = __webpack_require__(63); +var hide = __webpack_require__(17); +var Iterators = __webpack_require__(36); +var $iterCreate = __webpack_require__(54); +var setToStringTag = __webpack_require__(41); +var getPrototypeOf = __webpack_require__(13); +var ITERATOR = __webpack_require__(5)('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; +}; + + +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var create = __webpack_require__(32); +var descriptor = __webpack_require__(28); +var setToStringTag = __webpack_require__(41); +var IteratorPrototype = {}; + +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +__webpack_require__(17)(IteratorPrototype, __webpack_require__(5)('iterator'), function () { return this; }); + +module.exports = function (Constructor, NAME, next) { + Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); + setToStringTag(Constructor, NAME + ' Iterator'); +}; + + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.3.20 SpeciesConstructor(O, defaultConstructor) +var anObject = __webpack_require__(1); +var aFunction = __webpack_require__(10); +var SPECIES = __webpack_require__(5)('species'); +module.exports = function (O, D) { + var C = anObject(O).constructor; + var S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); +}; + + +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var navigator = global.navigator; + +module.exports = navigator && navigator.userAgent || ''; + + +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(2); +var $export = __webpack_require__(0); +var meta = __webpack_require__(29); +var fails = __webpack_require__(4); +var hide = __webpack_require__(17); +var redefineAll = __webpack_require__(39); +var forOf = __webpack_require__(34); +var anInstance = __webpack_require__(38); +var isObject = __webpack_require__(3); +var setToStringTag = __webpack_require__(41); +var dP = __webpack_require__(7).f; +var each = __webpack_require__(20)(0); +var DESCRIPTORS = __webpack_require__(8); + +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; +}; + + +/***/ }), +/* 58 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var hide = __webpack_require__(17); +var uid = __webpack_require__(40); +var TYPED = uid('typed_array'); +var VIEW = uid('view'); +var ABV = !!(global.ArrayBuffer && global.DataView); +var CONSTR = ABV; +var i = 0; +var l = 9; +var Typed; + +var TypedArrayConstructors = ( + 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' +).split(','); + +while (i < l) { + if (Typed = global[TypedArrayConstructors[i++]]) { + hide(Typed.prototype, TYPED, true); + hide(Typed.prototype, VIEW, true); + } else CONSTR = false; +} + +module.exports = { + ABV: ABV, + CONSTR: CONSTR, + TYPED: TYPED, + VIEW: VIEW +}; + + +/***/ }), +/* 59 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// Forced replacement prototype accessors methods +module.exports = __webpack_require__(30) || !__webpack_require__(4)(function () { + var K = Math.random(); + // In FF throws only define methods + // eslint-disable-next-line no-undef, no-useless-call + __defineSetter__.call(null, K, function () { /* empty */ }); + delete __webpack_require__(2)[K]; +}); + + +/***/ }), +/* 60 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-setmap-offrom/ +var $export = __webpack_require__(0); + +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); + } }); +}; + + +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-setmap-offrom/ +var $export = __webpack_require__(0); +var aFunction = __webpack_require__(10); +var ctx = __webpack_require__(16); +var forOf = __webpack_require__(34); + +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); + } }); +}; + + +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(3); +var document = __webpack_require__(2).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) : {}; +}; + + +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(17); + + +/***/ }), +/* 64 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var core = __webpack_require__(12); +var LIBRARY = __webpack_require__(30); +var wksExt = __webpack_require__(91); +var defineProperty = __webpack_require__(7).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) }); +}; + + +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + +var shared = __webpack_require__(49)('keys'); +var uid = __webpack_require__(40); +module.exports = function (key) { + return shared[key] || (shared[key] = uid(key)); +}; + + +/***/ }), +/* 66 */ +/***/ (function(module, exports) { + +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); + + +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { + +var document = __webpack_require__(2).document; +module.exports = document && document.documentElement; + + +/***/ }), +/* 68 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 19.1.2.1 Object.assign(target, source, ...) +var getKeys = __webpack_require__(31); +var gOPS = __webpack_require__(51); +var pIE = __webpack_require__(45); +var toObject = __webpack_require__(9); +var IObject = __webpack_require__(44); +var $assign = Object.assign; + +// should work with symbols and should have deterministic property order (V8 bug) +module.exports = !$assign || __webpack_require__(4)(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) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; + } return T; +} : $assign; + + +/***/ }), +/* 69 */ +/***/ (function(module, exports) { + +// fast apply, http://jsperf.lnkit.com/fast-apply/5 +module.exports = function (fn, args, that) { + var un = that === undefined; + switch (args.length) { + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); +}; + + +/***/ }), +/* 70 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var toInteger = __webpack_require__(22); +var defined = __webpack_require__(24); + +module.exports = function repeat(count) { + var str = String(defined(this)); + var res = ''; + var n = toInteger(count); + if (n < 0 || n == Infinity) throw RangeError("Count can't be negative"); + for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str; + return res; +}; + + +/***/ }), +/* 71 */ +/***/ (function(module, exports) { + +module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; + + +/***/ }), +/* 72 */ +/***/ (function(module, exports) { + +// 20.2.2.28 Math.sign(x) +module.exports = Math.sign || function sign(x) { + // eslint-disable-next-line no-self-compare + return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; +}; + + +/***/ }), +/* 73 */ +/***/ (function(module, exports) { + +// 20.2.2.14 Math.expm1(x) +var $expm1 = Math.expm1; +module.exports = (!$expm1 + // Old FF bug + || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 + // Tor Browser bug + || $expm1(-2e-17) != -2e-17 +) ? function expm1(x) { + return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; +} : $expm1; + + +/***/ }), +/* 74 */ +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__(22); +var defined = __webpack_require__(24); +// 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; + }; +}; + + +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { + +// helper for String#{startsWith, endsWith, includes} +var isRegExp = __webpack_require__(103); +var defined = __webpack_require__(24); + +module.exports = function (that, searchString, NAME) { + if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); + return String(defined(that)); +}; + + +/***/ }), +/* 76 */ +/***/ (function(module, exports, __webpack_require__) { + +var MATCH = __webpack_require__(5)('match'); +module.exports = function (KEY) { + var re = /./; + try { + '/./'[KEY](re); + } catch (e) { + try { + re[MATCH] = false; + return !'/./'[KEY](re); + } catch (f) { /* empty */ } + } return true; +}; + + +/***/ }), +/* 77 */ +/***/ (function(module, exports, __webpack_require__) { + +// check on default Array iterator +var Iterators = __webpack_require__(36); +var ITERATOR = __webpack_require__(5)('iterator'); +var ArrayProto = Array.prototype; + +module.exports = function (it) { + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); +}; + + +/***/ }), +/* 78 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $defineProperty = __webpack_require__(7); +var createDesc = __webpack_require__(28); + +module.exports = function (object, index, value) { + if (index in object) $defineProperty.f(object, index, createDesc(0, value)); + else object[index] = value; +}; + + +/***/ }), +/* 79 */ +/***/ (function(module, exports, __webpack_require__) { + +var ITERATOR = __webpack_require__(5)('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; +}; + + +/***/ }), +/* 80 */ +/***/ (function(module, exports, __webpack_require__) { + +// 9.4.2.3 ArraySpeciesCreate(originalArray, length) +var speciesConstructor = __webpack_require__(207); + +module.exports = function (original, length) { + return new (speciesConstructor(original))(length); +}; + + +/***/ }), +/* 81 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) + +var toObject = __webpack_require__(9); +var toAbsoluteIndex = __webpack_require__(35); +var toLength = __webpack_require__(6); +module.exports = function fill(value /* , start = 0, end = @length */) { + var O = toObject(this); + var length = toLength(O.length); + var aLen = arguments.length; + var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); + var end = aLen > 2 ? arguments[2] : undefined; + var endPos = end === undefined ? length : toAbsoluteIndex(end, length); + while (endPos > index) O[index++] = value; + return O; +}; + + +/***/ }), +/* 82 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var addToUnscopables = __webpack_require__(33); +var step = __webpack_require__(83); +var Iterators = __webpack_require__(36); +var toIObject = __webpack_require__(11); + +// 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__(53)(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'); + + +/***/ }), +/* 83 */ +/***/ (function(module, exports) { + +module.exports = function (done, value) { + return { value: value, done: !!done }; +}; + + +/***/ }), +/* 84 */ +/***/ (function(module, exports, __webpack_require__) { + +var ctx = __webpack_require__(16); +var invoke = __webpack_require__(69); +var html = __webpack_require__(67); +var cel = __webpack_require__(62); +var global = __webpack_require__(2); +var process = global.process; +var setTask = global.setImmediate; +var clearTask = global.clearImmediate; +var MessageChannel = global.MessageChannel; +var Dispatch = global.Dispatch; +var counter = 0; +var queue = {}; +var ONREADYSTATECHANGE = 'onreadystatechange'; +var defer, channel, port; +var run = function () { + var id = +this; + // eslint-disable-next-line no-prototype-builtins + if (queue.hasOwnProperty(id)) { + var fn = queue[id]; + delete queue[id]; + fn(); + } +}; +var listener = function (event) { + run.call(event.data); +}; +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: +if (!setTask || !clearTask) { + setTask = function setImmediate(fn) { + var args = []; + var i = 1; + while (arguments.length > i) args.push(arguments[i++]); + queue[++counter] = function () { + // eslint-disable-next-line no-new-func + invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id) { + delete queue[id]; + }; + // Node.js 0.8- + if (__webpack_require__(21)(process) == 'process') { + defer = function (id) { + process.nextTick(ctx(run, id, 1)); + }; + // Sphere (JS game engine) Dispatch API + } else if (Dispatch && Dispatch.now) { + defer = function (id) { + Dispatch.now(ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if (MessageChannel) { + channel = new MessageChannel(); + port = channel.port2; + channel.port1.onmessage = listener; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { + defer = function (id) { + global.postMessage(id + '', '*'); + }; + global.addEventListener('message', listener, false); + // IE8- + } else if (ONREADYSTATECHANGE in cel('script')) { + defer = function (id) { + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { + html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function (id) { + setTimeout(ctx(run, id, 1), 0); + }; + } +} +module.exports = { + set: setTask, + clear: clearTask +}; + + +/***/ }), +/* 85 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var macrotask = __webpack_require__(84).set; +var Observer = global.MutationObserver || global.WebKitMutationObserver; +var process = global.process; +var Promise = global.Promise; +var isNode = __webpack_require__(21)(process) == 'process'; + +module.exports = function () { + var head, last, notify; + + var flush = function () { + var parent, fn; + if (isNode && (parent = process.domain)) parent.exit(); + while (head) { + fn = head.fn; + head = head.next; + try { + fn(); + } catch (e) { + if (head) notify(); + else last = undefined; + throw e; + } + } last = undefined; + if (parent) parent.enter(); + }; + + // Node.js + if (isNode) { + notify = function () { + process.nextTick(flush); + }; + // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 + } else if (Observer && !(global.navigator && global.navigator.standalone)) { + var toggle = true; + var node = document.createTextNode(''); + new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new + notify = function () { + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if (Promise && Promise.resolve) { + // Promise.resolve without an argument throws an error in LG WebOS 2 + var promise = Promise.resolve(undefined); + notify = function () { + promise.then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function () { + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } + + return function (fn) { + var task = { fn: fn, next: undefined }; + if (last) last.next = task; + if (!head) { + head = task; + notify(); + } last = task; + }; +}; + + +/***/ }), +/* 86 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 25.4.1.5 NewPromiseCapability(C) +var aFunction = __webpack_require__(10); + +function PromiseCapability(C) { + var resolve, reject; + this.promise = new C(function ($$resolve, $$reject) { + if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); +} + +module.exports.f = function (C) { + return new PromiseCapability(C); +}; + + +/***/ }), +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { + +// all object keys, includes non-enumerable and symbols +var gOPN = __webpack_require__(46); +var gOPS = __webpack_require__(51); +var anObject = __webpack_require__(1); +var Reflect = __webpack_require__(2).Reflect; +module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { + var keys = gOPN.f(anObject(it)); + var getSymbols = gOPS.f; + return getSymbols ? keys.concat(getSymbols(it)) : keys; +}; + + +/***/ }), +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(2); +var DESCRIPTORS = __webpack_require__(8); +var LIBRARY = __webpack_require__(30); +var $typed = __webpack_require__(58); +var hide = __webpack_require__(17); +var redefineAll = __webpack_require__(39); +var fails = __webpack_require__(4); +var anInstance = __webpack_require__(38); +var toInteger = __webpack_require__(22); +var toLength = __webpack_require__(6); +var toIndex = __webpack_require__(115); +var gOPN = __webpack_require__(46).f; +var dP = __webpack_require__(7).f; +var arrayFill = __webpack_require__(81); +var setToStringTag = __webpack_require__(41); +var ARRAY_BUFFER = 'ArrayBuffer'; +var DATA_VIEW = 'DataView'; +var PROTOTYPE = 'prototype'; +var WRONG_LENGTH = 'Wrong length!'; +var WRONG_INDEX = 'Wrong index!'; +var $ArrayBuffer = global[ARRAY_BUFFER]; +var $DataView = global[DATA_VIEW]; +var Math = global.Math; +var RangeError = global.RangeError; +// eslint-disable-next-line no-shadow-restricted-names +var Infinity = global.Infinity; +var BaseBuffer = $ArrayBuffer; +var abs = Math.abs; +var pow = Math.pow; +var floor = Math.floor; +var log = Math.log; +var LN2 = Math.LN2; +var BUFFER = 'buffer'; +var BYTE_LENGTH = 'byteLength'; +var BYTE_OFFSET = 'byteOffset'; +var $BUFFER = DESCRIPTORS ? '_b' : BUFFER; +var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH; +var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; + +// IEEE754 conversions based on https://github.com/feross/ieee754 +function packIEEE754(value, mLen, nBytes) { + var buffer = new Array(nBytes); + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0; + var i = 0; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + var e, m, c; + value = abs(value); + // eslint-disable-next-line no-self-compare + if (value != value || value === Infinity) { + // eslint-disable-next-line no-self-compare + m = value != value ? 1 : 0; + e = eMax; + } else { + e = floor(log(value) / LN2); + if (value * (c = pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * pow(2, mLen); + e = e + eBias; + } else { + m = value * pow(2, eBias - 1) * pow(2, mLen); + e = 0; + } + } + for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); + e = e << mLen | m; + eLen += mLen; + for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); + buffer[--i] |= s * 128; + return buffer; +} +function unpackIEEE754(buffer, mLen, nBytes) { + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = eLen - 7; + var i = nBytes - 1; + var s = buffer[i--]; + var e = s & 127; + var m; + s >>= 7; + for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : s ? -Infinity : Infinity; + } else { + m = m + pow(2, mLen); + e = e - eBias; + } return (s ? -1 : 1) * m * pow(2, e - mLen); +} + +function unpackI32(bytes) { + return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; +} +function packI8(it) { + return [it & 0xff]; +} +function packI16(it) { + return [it & 0xff, it >> 8 & 0xff]; +} +function packI32(it) { + return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; +} +function packF64(it) { + return packIEEE754(it, 52, 8); +} +function packF32(it) { + return packIEEE754(it, 23, 4); +} + +function addGetter(C, key, internal) { + dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } }); +} + +function get(view, bytes, index, isLittleEndian) { + var numIndex = +index; + var intIndex = toIndex(numIndex); + if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b; + var start = intIndex + view[$OFFSET]; + var pack = store.slice(start, start + bytes); + return isLittleEndian ? pack : pack.reverse(); +} +function set(view, bytes, index, conversion, value, isLittleEndian) { + var numIndex = +index; + var intIndex = toIndex(numIndex); + if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b; + var start = intIndex + view[$OFFSET]; + var pack = conversion(+value); + for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; +} + +if (!$typed.ABV) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer, ARRAY_BUFFER); + var byteLength = toIndex(length); + this._b = arrayFill.call(new Array(byteLength), 0); + this[$LENGTH] = byteLength; + }; + + $DataView = function DataView(buffer, byteOffset, byteLength) { + anInstance(this, $DataView, DATA_VIEW); + anInstance(buffer, $ArrayBuffer, DATA_VIEW); + var bufferLength = buffer[$LENGTH]; + var offset = toInteger(byteOffset); + if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!'); + byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); + if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); + this[$BUFFER] = buffer; + this[$OFFSET] = offset; + this[$LENGTH] = byteLength; + }; + + if (DESCRIPTORS) { + addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); + addGetter($DataView, BUFFER, '_b'); + addGetter($DataView, BYTE_LENGTH, '_l'); + addGetter($DataView, BYTE_OFFSET, '_o'); + } + + redefineAll($DataView[PROTOTYPE], { + getInt8: function getInt8(byteOffset) { + return get(this, 1, byteOffset)[0] << 24 >> 24; + }, + getUint8: function getUint8(byteOffset) { + return get(this, 1, byteOffset)[0]; + }, + getInt16: function getInt16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments[1]); + return (bytes[1] << 8 | bytes[0]) << 16 >> 16; + }, + getUint16: function getUint16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments[1]); + return bytes[1] << 8 | bytes[0]; + }, + getInt32: function getInt32(byteOffset /* , littleEndian */) { + return unpackI32(get(this, 4, byteOffset, arguments[1])); + }, + getUint32: function getUint32(byteOffset /* , littleEndian */) { + return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; + }, + getFloat32: function getFloat32(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); + }, + getFloat64: function getFloat64(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); + }, + setInt8: function setInt8(byteOffset, value) { + set(this, 1, byteOffset, packI8, value); + }, + setUint8: function setUint8(byteOffset, value) { + set(this, 1, byteOffset, packI8, value); + }, + setInt16: function setInt16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setUint16: function setUint16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setInt32: function setInt32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setUint32: function setUint32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packF32, value, arguments[2]); + }, + setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { + set(this, 8, byteOffset, packF64, value, arguments[2]); + } + }); +} else { + if (!fails(function () { + $ArrayBuffer(1); + }) || !fails(function () { + new $ArrayBuffer(-1); // eslint-disable-line no-new + }) || fails(function () { + new $ArrayBuffer(); // eslint-disable-line no-new + new $ArrayBuffer(1.5); // eslint-disable-line no-new + new $ArrayBuffer(NaN); // eslint-disable-line no-new + return $ArrayBuffer.name != ARRAY_BUFFER; + })) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer); + return new BaseBuffer(toIndex(length)); + }; + var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; + for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) { + if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]); + } + if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer; + } + // iOS Safari 7.x bug + var view = new $DataView(new $ArrayBuffer(2)); + var $setInt8 = $DataView[PROTOTYPE].setInt8; + view.setInt8(0, 2147483648); + view.setInt8(1, 2147483649); + if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], { + setInt8: function setInt8(byteOffset, value) { + $setInt8.call(this, byteOffset, value << 24 >> 24); + }, + setUint8: function setUint8(byteOffset, value) { + $setInt8.call(this, byteOffset, value << 24 >> 24); + } + }, true); +} +setToStringTag($ArrayBuffer, ARRAY_BUFFER); +setToStringTag($DataView, DATA_VIEW); +hide($DataView[PROTOTYPE], $typed.VIEW, true); +exports[ARRAY_BUFFER] = $ArrayBuffer; +exports[DATA_VIEW] = $DataView; + + +/***/ }), +/* 89 */ +/***/ (function(module, exports) { + +module.exports = function (regExp, replace) { + var replacer = replace === Object(replace) ? function (part) { + return replace[part]; + } : replace; + return function (it) { + return String(it).replace(regExp, replacer); + }; +}; + + +/***/ }), +/* 90 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = !__webpack_require__(8) && !__webpack_require__(4)(function () { + return Object.defineProperty(__webpack_require__(62)('div'), 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), +/* 91 */ +/***/ (function(module, exports, __webpack_require__) { + +exports.f = __webpack_require__(5); + + +/***/ }), +/* 92 */ +/***/ (function(module, exports, __webpack_require__) { + +var has = __webpack_require__(15); +var toIObject = __webpack_require__(11); +var arrayIndexOf = __webpack_require__(50)(false); +var IE_PROTO = __webpack_require__(65)('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; +}; + + +/***/ }), +/* 93 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(7); +var anObject = __webpack_require__(1); +var getKeys = __webpack_require__(31); + +module.exports = __webpack_require__(8) ? 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; +}; + + +/***/ }), +/* 94 */ +/***/ (function(module, exports, __webpack_require__) { + +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +var toIObject = __webpack_require__(11); +var gOPN = __webpack_require__(46).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)); +}; + + +/***/ }), +/* 95 */ +/***/ (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__(3); +var anObject = __webpack_require__(1); +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__(16)(Function.call, __webpack_require__(18).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 +}; + + +/***/ }), +/* 96 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var aFunction = __webpack_require__(10); +var isObject = __webpack_require__(3); +var invoke = __webpack_require__(69); +var arraySlice = [].slice; +var factories = {}; + +var construct = function (F, len, args) { + if (!(len in factories)) { + for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']'; + // eslint-disable-next-line no-new-func + factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); + } return factories[len](F, args); +}; + +module.exports = Function.bind || function bind(that /* , ...args */) { + var fn = aFunction(this); + var partArgs = arraySlice.call(arguments, 1); + var bound = function (/* args... */) { + var args = partArgs.concat(arraySlice.call(arguments)); + return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); + }; + if (isObject(fn.prototype)) bound.prototype = fn.prototype; + return bound; +}; + + +/***/ }), +/* 97 */ +/***/ (function(module, exports, __webpack_require__) { + +var cof = __webpack_require__(21); +module.exports = function (it, msg) { + if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg); + return +it; +}; + + +/***/ }), +/* 98 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.3 Number.isInteger(number) +var isObject = __webpack_require__(3); +var floor = Math.floor; +module.exports = function isInteger(it) { + return !isObject(it) && isFinite(it) && floor(it) === it; +}; + + +/***/ }), +/* 99 */ +/***/ (function(module, exports, __webpack_require__) { + +var $parseFloat = __webpack_require__(2).parseFloat; +var $trim = __webpack_require__(47).trim; + +module.exports = 1 / $parseFloat(__webpack_require__(71) + '-0') !== -Infinity ? function parseFloat(str) { + var string = $trim(String(str), 3); + var result = $parseFloat(string); + return result === 0 && string.charAt(0) == '-' ? -0 : result; +} : $parseFloat; + + +/***/ }), +/* 100 */ +/***/ (function(module, exports, __webpack_require__) { + +var $parseInt = __webpack_require__(2).parseInt; +var $trim = __webpack_require__(47).trim; +var ws = __webpack_require__(71); +var hex = /^[-+]?0[xX]/; + +module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) { + var string = $trim(String(str), 3); + return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); +} : $parseInt; + + +/***/ }), +/* 101 */ +/***/ (function(module, exports) { + +// 20.2.2.20 Math.log1p(x) +module.exports = Math.log1p || function log1p(x) { + return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); +}; + + +/***/ }), +/* 102 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.16 Math.fround(x) +var sign = __webpack_require__(72); +var pow = Math.pow; +var EPSILON = pow(2, -52); +var EPSILON32 = pow(2, -23); +var MAX32 = pow(2, 127) * (2 - EPSILON32); +var MIN32 = pow(2, -126); + +var roundTiesToEven = function (n) { + return n + 1 / EPSILON - 1 / EPSILON; +}; + +module.exports = Math.fround || function fround(x) { + var $abs = Math.abs(x); + var $sign = sign(x); + var a, result; + if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; + a = (1 + EPSILON32 / EPSILON) * $abs; + result = a - (a - $abs); + // eslint-disable-next-line no-self-compare + if (result > MAX32 || result != result) return $sign * Infinity; + return $sign * result; +}; + + +/***/ }), +/* 103 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.2.8 IsRegExp(argument) +var isObject = __webpack_require__(3); +var cof = __webpack_require__(21); +var MATCH = __webpack_require__(5)('match'); +module.exports = function (it) { + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); +}; + + +/***/ }), +/* 104 */ +/***/ (function(module, exports, __webpack_require__) { + +// call something on iterator step with safe closing on error +var anObject = __webpack_require__(1); +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; + } +}; + + +/***/ }), +/* 105 */ +/***/ (function(module, exports, __webpack_require__) { + +var aFunction = __webpack_require__(10); +var toObject = __webpack_require__(9); +var IObject = __webpack_require__(44); +var toLength = __webpack_require__(6); + +module.exports = function (that, callbackfn, aLen, memo, isRight) { + aFunction(callbackfn); + var O = toObject(that); + var self = IObject(O); + var length = toLength(O.length); + var index = isRight ? length - 1 : 0; + var i = isRight ? -1 : 1; + if (aLen < 2) for (;;) { + if (index in self) { + memo = self[index]; + index += i; + break; + } + index += i; + if (isRight ? index < 0 : length <= index) { + throw TypeError('Reduce of empty array with no initial value'); + } + } + for (;isRight ? index >= 0 : length > index; index += i) if (index in self) { + memo = callbackfn(memo, self[index], index, O); + } + return memo; +}; + + +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) + +var toObject = __webpack_require__(9); +var toAbsoluteIndex = __webpack_require__(35); +var toLength = __webpack_require__(6); + +module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { + var O = toObject(this); + var len = toLength(O.length); + var to = toAbsoluteIndex(target, len); + var from = toAbsoluteIndex(start, len); + var end = arguments.length > 2 ? arguments[2] : undefined; + var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); + var inc = 1; + if (from < to && to < from + count) { + inc = -1; + from += count - 1; + to += count - 1; + } + while (count-- > 0) { + if (from in O) O[to] = O[from]; + else delete O[to]; + to += inc; + from += inc; + } return O; +}; + + +/***/ }), +/* 107 */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return { e: false, v: exec() }; + } catch (e) { + return { e: true, v: e }; + } +}; + + +/***/ }), +/* 108 */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(1); +var isObject = __webpack_require__(3); +var newPromiseCapability = __webpack_require__(86); + +module.exports = function (C, x) { + anObject(C); + if (isObject(x) && x.constructor === C) return x; + var promiseCapability = newPromiseCapability.f(C); + var resolve = promiseCapability.resolve; + resolve(x); + return promiseCapability.promise; +}; + + +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var strong = __webpack_require__(110); +var validate = __webpack_require__(43); +var MAP = 'Map'; + +// 23.1 Map Objects +module.exports = __webpack_require__(57)(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); + + +/***/ }), +/* 110 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var dP = __webpack_require__(7).f; +var create = __webpack_require__(32); +var redefineAll = __webpack_require__(39); +var ctx = __webpack_require__(16); +var anInstance = __webpack_require__(38); +var forOf = __webpack_require__(34); +var $iterDefine = __webpack_require__(53); +var step = __webpack_require__(83); +var setSpecies = __webpack_require__(42); +var DESCRIPTORS = __webpack_require__(8); +var fastKey = __webpack_require__(29).fastKey; +var validate = __webpack_require__(43); +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); + } +}; + + +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var strong = __webpack_require__(110); +var validate = __webpack_require__(43); +var SET = 'Set'; + +// 23.2 Set Objects +module.exports = __webpack_require__(57)(SET, function (get) { + return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value) { + return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value); + } +}, strong); + + +/***/ }), +/* 112 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var each = __webpack_require__(20)(0); +var redefine = __webpack_require__(63); +var meta = __webpack_require__(29); +var assign = __webpack_require__(68); +var weak = __webpack_require__(113); +var isObject = __webpack_require__(3); +var fails = __webpack_require__(4); +var validate = __webpack_require__(43); +var WEAK_MAP = 'WeakMap'; +var getWeak = meta.getWeak; +var isExtensible = Object.isExtensible; +var uncaughtFrozenStore = weak.ufstore; +var tmp = {}; +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__(57)(WEAK_MAP, wrapper, methods, weak, true, true); + +// IE11 WeakMap frozen keys fix +if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) { + 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); + }); + }); +} + + +/***/ }), +/* 113 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var redefineAll = __webpack_require__(39); +var getWeak = __webpack_require__(29).getWeak; +var anObject = __webpack_require__(1); +var isObject = __webpack_require__(3); +var anInstance = __webpack_require__(38); +var forOf = __webpack_require__(34); +var createArrayMethod = __webpack_require__(20); +var $has = __webpack_require__(15); +var validate = __webpack_require__(43); +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 +}; + + +/***/ }), +/* 114 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() +var fails = __webpack_require__(4); +var getTime = Date.prototype.getTime; +var $toISOString = Date.prototype.toISOString; + +var lz = function (num) { + return num > 9 ? num : '0' + num; +}; + +// PhantomJS / old WebKit has a broken implementations +module.exports = (fails(function () { + return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; +}) || !fails(function () { + $toISOString.call(new Date(NaN)); +})) ? function toISOString() { + if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value'); + var d = this; + var y = d.getUTCFullYear(); + var m = d.getUTCMilliseconds(); + var s = y < 0 ? '-' : y > 9999 ? '+' : ''; + return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + + '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + + 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + + ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; +} : $toISOString; + + +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/ecma262/#sec-toindex +var toInteger = __webpack_require__(22); +var toLength = __webpack_require__(6); +module.exports = function (it) { + if (it === undefined) return 0; + var number = toInteger(it); + var length = toLength(number); + if (number !== length) throw RangeError('Wrong length!'); + return length; +}; + + +/***/ }), +/* 116 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray +var isArray = __webpack_require__(52); +var isObject = __webpack_require__(3); +var toLength = __webpack_require__(6); +var ctx = __webpack_require__(16); +var IS_CONCAT_SPREADABLE = __webpack_require__(5)('isConcatSpreadable'); + +function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) { + var targetIndex = start; + var sourceIndex = 0; + var mapFn = mapper ? ctx(mapper, thisArg, 3) : false; + var element, spreadable; + + while (sourceIndex < sourceLen) { + if (sourceIndex in source) { + element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; + + spreadable = false; + if (isObject(element)) { + spreadable = element[IS_CONCAT_SPREADABLE]; + spreadable = spreadable !== undefined ? !!spreadable : isArray(element); + } + + if (spreadable && depth > 0) { + targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1; + } else { + if (targetIndex >= 0x1fffffffffffff) throw TypeError(); + target[targetIndex] = element; + } + + targetIndex++; + } + sourceIndex++; + } + return targetIndex; +} + +module.exports = flattenIntoArray; + + +/***/ }), +/* 117 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-string-pad-start-end +var toLength = __webpack_require__(6); +var repeat = __webpack_require__(70); +var defined = __webpack_require__(24); + +module.exports = function (that, maxLength, fillString, left) { + var S = String(defined(that)); + var stringLength = S.length; + var fillStr = fillString === undefined ? ' ' : String(fillString); + var intMaxLength = toLength(maxLength); + if (intMaxLength <= stringLength || fillStr == '') return S; + var fillLen = intMaxLength - stringLength; + var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); + if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); + return left ? stringFiller + S : S + stringFiller; +}; + + +/***/ }), +/* 118 */ +/***/ (function(module, exports, __webpack_require__) { + +var getKeys = __webpack_require__(31); +var toIObject = __webpack_require__(11); +var isEnum = __webpack_require__(45).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) if (isEnum.call(O, key = keys[i++])) { + result.push(isEntries ? [key, O[key]] : O[key]); + } return result; + }; +}; + + +/***/ }), +/* 119 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var classof = __webpack_require__(37); +var from = __webpack_require__(120); +module.exports = function (NAME) { + return function toJSON() { + if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); + return from(this); + }; +}; + + +/***/ }), +/* 120 */ +/***/ (function(module, exports, __webpack_require__) { + +var forOf = __webpack_require__(34); + +module.exports = function (iter, ITERATOR) { + var result = []; + forOf(iter, false, result.push, result, ITERATOR); + return result; +}; + + +/***/ }), +/* 121 */ +/***/ (function(module, exports) { + +// https://rwaldron.github.io/proposal-math-extensions/ +module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) { + if ( + arguments.length === 0 + // eslint-disable-next-line no-self-compare + || x != x + // eslint-disable-next-line no-self-compare + || inLow != inLow + // eslint-disable-next-line no-self-compare + || inHigh != inHigh + // eslint-disable-next-line no-self-compare + || outLow != outLow + // eslint-disable-next-line no-self-compare + || outHigh != outHigh + ) return NaN; + if (x === Infinity || x === -Infinity) return x; + return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow; +}; + + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +var classof = __webpack_require__(37); +var ITERATOR = __webpack_require__(5)('iterator'); +var Iterators = __webpack_require__(36); +module.exports = __webpack_require__(12).isIterable = function (it) { + var O = Object(it); + return O[ITERATOR] !== undefined + || '@@iterator' in O + // eslint-disable-next-line no-prototype-builtins + || Iterators.hasOwnProperty(classof(O)); +}; + + +/***/ }), +/* 123 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var path = __webpack_require__(124); +var invoke = __webpack_require__(69); +var aFunction = __webpack_require__(10); +module.exports = function (/* ...pargs */) { + var fn = aFunction(this); + var length = arguments.length; + var pargs = new Array(length); + var i = 0; + var _ = path._; + var holder = false; + while (length > i) if ((pargs[i] = arguments[i++]) === _) holder = true; + return function (/* ...args */) { + var that = this; + var aLen = arguments.length; + var j = 0; + var k = 0; + var args; + if (!holder && !aLen) return invoke(fn, pargs, that); + args = pargs.slice(); + if (holder) for (;length > j; j++) if (args[j] === _) args[j] = arguments[k++]; + while (aLen > k) args.push(arguments[k++]); + return invoke(fn, args, that); + }; +}; + + +/***/ }), +/* 124 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(12); + + +/***/ }), +/* 125 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(7); +var gOPD = __webpack_require__(18); +var ownKeys = __webpack_require__(87); +var toIObject = __webpack_require__(11); + +module.exports = function define(target, mixin) { + var keys = ownKeys(toIObject(mixin)); + var length = keys.length; + var i = 0; + var key; + while (length > i) dP.f(target, key = keys[i++], gOPD.f(mixin, key)); + return target; +}; + + +/***/ }), +/* 126 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(127); +__webpack_require__(129); +__webpack_require__(130); +__webpack_require__(131); +__webpack_require__(132); +__webpack_require__(133); +__webpack_require__(134); +__webpack_require__(135); +__webpack_require__(136); +__webpack_require__(137); +__webpack_require__(138); +__webpack_require__(139); +__webpack_require__(140); +__webpack_require__(141); +__webpack_require__(142); +__webpack_require__(143); +__webpack_require__(145); +__webpack_require__(146); +__webpack_require__(147); +__webpack_require__(148); +__webpack_require__(149); +__webpack_require__(150); +__webpack_require__(151); +__webpack_require__(152); +__webpack_require__(153); +__webpack_require__(154); +__webpack_require__(155); +__webpack_require__(156); +__webpack_require__(157); +__webpack_require__(158); +__webpack_require__(159); +__webpack_require__(160); +__webpack_require__(161); +__webpack_require__(162); +__webpack_require__(163); +__webpack_require__(164); +__webpack_require__(165); +__webpack_require__(166); +__webpack_require__(167); +__webpack_require__(168); +__webpack_require__(169); +__webpack_require__(170); +__webpack_require__(171); +__webpack_require__(172); +__webpack_require__(173); +__webpack_require__(174); +__webpack_require__(175); +__webpack_require__(176); +__webpack_require__(177); +__webpack_require__(178); +__webpack_require__(179); +__webpack_require__(180); +__webpack_require__(181); +__webpack_require__(182); +__webpack_require__(183); +__webpack_require__(184); +__webpack_require__(185); +__webpack_require__(186); +__webpack_require__(187); +__webpack_require__(188); +__webpack_require__(189); +__webpack_require__(190); +__webpack_require__(191); +__webpack_require__(192); +__webpack_require__(193); +__webpack_require__(194); +__webpack_require__(195); +__webpack_require__(196); +__webpack_require__(197); +__webpack_require__(198); +__webpack_require__(199); +__webpack_require__(200); +__webpack_require__(201); +__webpack_require__(202); +__webpack_require__(203); +__webpack_require__(204); +__webpack_require__(205); +__webpack_require__(206); +__webpack_require__(208); +__webpack_require__(209); +__webpack_require__(210); +__webpack_require__(211); +__webpack_require__(212); +__webpack_require__(213); +__webpack_require__(214); +__webpack_require__(215); +__webpack_require__(216); +__webpack_require__(217); +__webpack_require__(218); +__webpack_require__(219); +__webpack_require__(82); +__webpack_require__(220); +__webpack_require__(221); +__webpack_require__(109); +__webpack_require__(111); +__webpack_require__(112); +__webpack_require__(222); +__webpack_require__(223); +__webpack_require__(224); +__webpack_require__(225); +__webpack_require__(226); +__webpack_require__(227); +__webpack_require__(228); +__webpack_require__(229); +__webpack_require__(230); +__webpack_require__(231); +__webpack_require__(232); +__webpack_require__(233); +__webpack_require__(234); +__webpack_require__(235); +__webpack_require__(236); +__webpack_require__(237); +__webpack_require__(238); +__webpack_require__(239); +__webpack_require__(240); +__webpack_require__(241); +__webpack_require__(242); +__webpack_require__(243); +__webpack_require__(244); +__webpack_require__(245); +__webpack_require__(246); +__webpack_require__(247); +__webpack_require__(248); +__webpack_require__(249); +__webpack_require__(250); +__webpack_require__(251); +__webpack_require__(252); +__webpack_require__(253); +__webpack_require__(254); +__webpack_require__(255); +__webpack_require__(256); +__webpack_require__(257); +__webpack_require__(258); +__webpack_require__(259); +__webpack_require__(261); +__webpack_require__(262); +__webpack_require__(263); +__webpack_require__(264); +__webpack_require__(265); +__webpack_require__(266); +__webpack_require__(267); +__webpack_require__(268); +__webpack_require__(269); +__webpack_require__(270); +__webpack_require__(271); +__webpack_require__(272); +__webpack_require__(273); +__webpack_require__(274); +__webpack_require__(275); +__webpack_require__(276); +__webpack_require__(277); +__webpack_require__(278); +__webpack_require__(279); +__webpack_require__(280); +__webpack_require__(281); +__webpack_require__(282); +__webpack_require__(283); +__webpack_require__(284); +__webpack_require__(285); +__webpack_require__(286); +__webpack_require__(287); +__webpack_require__(288); +__webpack_require__(289); +__webpack_require__(290); +__webpack_require__(291); +__webpack_require__(292); +__webpack_require__(293); +__webpack_require__(294); +__webpack_require__(295); +__webpack_require__(296); +__webpack_require__(297); +__webpack_require__(298); +__webpack_require__(299); +__webpack_require__(300); +__webpack_require__(301); +__webpack_require__(302); +__webpack_require__(303); +__webpack_require__(304); +__webpack_require__(305); +__webpack_require__(306); +__webpack_require__(307); +__webpack_require__(308); +__webpack_require__(309); +__webpack_require__(310); +__webpack_require__(311); +__webpack_require__(48); +__webpack_require__(313); +__webpack_require__(122); +__webpack_require__(314); +__webpack_require__(315); +__webpack_require__(316); +__webpack_require__(317); +__webpack_require__(318); +__webpack_require__(319); +__webpack_require__(320); +__webpack_require__(321); +__webpack_require__(322); +module.exports = __webpack_require__(323); + + +/***/ }), +/* 127 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// ECMAScript 6 symbols shim +var global = __webpack_require__(2); +var has = __webpack_require__(15); +var DESCRIPTORS = __webpack_require__(8); +var $export = __webpack_require__(0); +var redefine = __webpack_require__(63); +var META = __webpack_require__(29).KEY; +var $fails = __webpack_require__(4); +var shared = __webpack_require__(49); +var setToStringTag = __webpack_require__(41); +var uid = __webpack_require__(40); +var wks = __webpack_require__(5); +var wksExt = __webpack_require__(91); +var wksDefine = __webpack_require__(64); +var enumKeys = __webpack_require__(128); +var isArray = __webpack_require__(52); +var anObject = __webpack_require__(1); +var isObject = __webpack_require__(3); +var toIObject = __webpack_require__(11); +var toPrimitive = __webpack_require__(27); +var createDesc = __webpack_require__(28); +var _create = __webpack_require__(32); +var gOPNExt = __webpack_require__(94); +var $GOPD = __webpack_require__(18); +var $DP = __webpack_require__(7); +var $keys = __webpack_require__(31); +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'; +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__(46).f = gOPNExt.f = $getOwnPropertyNames; + __webpack_require__(45).f = $propertyIsEnumerable; + __webpack_require__(51).f = $getOwnPropertySymbols; + + if (DESCRIPTORS && !__webpack_require__(30)) { + 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 +}); + +// 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__(17)($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); + + +/***/ }), +/* 128 */ +/***/ (function(module, exports, __webpack_require__) { + +// all enumerable object keys, includes symbols +var getKeys = __webpack_require__(31); +var gOPS = __webpack_require__(51); +var pIE = __webpack_require__(45); +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; +}; + + +/***/ }), +/* 129 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) +$export($export.S + $export.F * !__webpack_require__(8), 'Object', { defineProperty: __webpack_require__(7).f }); + + +/***/ }), +/* 130 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) +$export($export.S + $export.F * !__webpack_require__(8), 'Object', { defineProperties: __webpack_require__(93) }); + + +/***/ }), +/* 131 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) +var toIObject = __webpack_require__(11); +var $getOwnPropertyDescriptor = __webpack_require__(18).f; + +__webpack_require__(23)('getOwnPropertyDescriptor', function () { + return function getOwnPropertyDescriptor(it, key) { + return $getOwnPropertyDescriptor(toIObject(it), key); + }; +}); + + +/***/ }), +/* 132 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +$export($export.S, 'Object', { create: __webpack_require__(32) }); + + +/***/ }), +/* 133 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.9 Object.getPrototypeOf(O) +var toObject = __webpack_require__(9); +var $getPrototypeOf = __webpack_require__(13); + +__webpack_require__(23)('getPrototypeOf', function () { + return function getPrototypeOf(it) { + return $getPrototypeOf(toObject(it)); + }; +}); + + +/***/ }), +/* 134 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 Object.keys(O) +var toObject = __webpack_require__(9); +var $keys = __webpack_require__(31); + +__webpack_require__(23)('keys', function () { + return function keys(it) { + return $keys(toObject(it)); + }; +}); + + +/***/ }), +/* 135 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.7 Object.getOwnPropertyNames(O) +__webpack_require__(23)('getOwnPropertyNames', function () { + return __webpack_require__(94).f; +}); + + +/***/ }), +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.5 Object.freeze(O) +var isObject = __webpack_require__(3); +var meta = __webpack_require__(29).onFreeze; + +__webpack_require__(23)('freeze', function ($freeze) { + return function freeze(it) { + return $freeze && isObject(it) ? $freeze(meta(it)) : it; + }; +}); + + +/***/ }), +/* 137 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.17 Object.seal(O) +var isObject = __webpack_require__(3); +var meta = __webpack_require__(29).onFreeze; + +__webpack_require__(23)('seal', function ($seal) { + return function seal(it) { + return $seal && isObject(it) ? $seal(meta(it)) : it; + }; +}); + + +/***/ }), +/* 138 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.15 Object.preventExtensions(O) +var isObject = __webpack_require__(3); +var meta = __webpack_require__(29).onFreeze; + +__webpack_require__(23)('preventExtensions', function ($preventExtensions) { + return function preventExtensions(it) { + return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; + }; +}); + + +/***/ }), +/* 139 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.12 Object.isFrozen(O) +var isObject = __webpack_require__(3); + +__webpack_require__(23)('isFrozen', function ($isFrozen) { + return function isFrozen(it) { + return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; + }; +}); + + +/***/ }), +/* 140 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.13 Object.isSealed(O) +var isObject = __webpack_require__(3); + +__webpack_require__(23)('isSealed', function ($isSealed) { + return function isSealed(it) { + return isObject(it) ? $isSealed ? $isSealed(it) : false : true; + }; +}); + + +/***/ }), +/* 141 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.11 Object.isExtensible(O) +var isObject = __webpack_require__(3); + +__webpack_require__(23)('isExtensible', function ($isExtensible) { + return function isExtensible(it) { + return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; + }; +}); + + +/***/ }), +/* 142 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.3.1 Object.assign(target, source) +var $export = __webpack_require__(0); + +$export($export.S + $export.F, 'Object', { assign: __webpack_require__(68) }); + + +/***/ }), +/* 143 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.3.10 Object.is(value1, value2) +var $export = __webpack_require__(0); +$export($export.S, 'Object', { is: __webpack_require__(144) }); + + +/***/ }), +/* 144 */ +/***/ (function(module, exports) { + +// 7.2.9 SameValue(x, y) +module.exports = Object.is || function is(x, y) { + // eslint-disable-next-line no-self-compare + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; +}; + + +/***/ }), +/* 145 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.3.19 Object.setPrototypeOf(O, proto) +var $export = __webpack_require__(0); +$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(95).set }); + + +/***/ }), +/* 146 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) +var $export = __webpack_require__(0); + +$export($export.P, 'Function', { bind: __webpack_require__(96) }); + + +/***/ }), +/* 147 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var isObject = __webpack_require__(3); +var getPrototypeOf = __webpack_require__(13); +var HAS_INSTANCE = __webpack_require__(5)('hasInstance'); +var FunctionProto = Function.prototype; +// 19.2.3.6 Function.prototype[@@hasInstance](V) +if (!(HAS_INSTANCE in FunctionProto)) __webpack_require__(7).f(FunctionProto, HAS_INSTANCE, { value: function (O) { + if (typeof this != 'function' || !isObject(O)) return false; + if (!isObject(this.prototype)) return O instanceof this; + // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: + while (O = getPrototypeOf(O)) if (this.prototype === O) return true; + return false; +} }); + + +/***/ }), +/* 148 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toInteger = __webpack_require__(22); +var aNumberValue = __webpack_require__(97); +var repeat = __webpack_require__(70); +var $toFixed = 1.0.toFixed; +var floor = Math.floor; +var data = [0, 0, 0, 0, 0, 0]; +var ERROR = 'Number.toFixed: incorrect invocation!'; +var ZERO = '0'; + +var multiply = function (n, c) { + var i = -1; + var c2 = c; + while (++i < 6) { + c2 += n * data[i]; + data[i] = c2 % 1e7; + c2 = floor(c2 / 1e7); + } +}; +var divide = function (n) { + var i = 6; + var c = 0; + while (--i >= 0) { + c += data[i]; + data[i] = floor(c / n); + c = (c % n) * 1e7; + } +}; +var numToString = function () { + var i = 6; + var s = ''; + while (--i >= 0) { + if (s !== '' || i === 0 || data[i] !== 0) { + var t = String(data[i]); + s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; + } + } return s; +}; +var pow = function (x, n, acc) { + return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); +}; +var log = function (x) { + var n = 0; + var x2 = x; + while (x2 >= 4096) { + n += 12; + x2 /= 4096; + } + while (x2 >= 2) { + n += 1; + x2 /= 2; + } return n; +}; + +$export($export.P + $export.F * (!!$toFixed && ( + 0.00008.toFixed(3) !== '0.000' || + 0.9.toFixed(0) !== '1' || + 1.255.toFixed(2) !== '1.25' || + 1000000000000000128.0.toFixed(0) !== '1000000000000000128' +) || !__webpack_require__(4)(function () { + // V8 ~ Android 4.3- + $toFixed.call({}); +})), 'Number', { + toFixed: function toFixed(fractionDigits) { + var x = aNumberValue(this, ERROR); + var f = toInteger(fractionDigits); + var s = ''; + var m = ZERO; + var e, z, j, k; + if (f < 0 || f > 20) throw RangeError(ERROR); + // eslint-disable-next-line no-self-compare + if (x != x) return 'NaN'; + if (x <= -1e21 || x >= 1e21) return String(x); + if (x < 0) { + s = '-'; + x = -x; + } + if (x > 1e-21) { + e = log(x * pow(2, 69, 1)) - 69; + z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); + z *= 0x10000000000000; + e = 52 - e; + if (e > 0) { + multiply(0, z); + j = f; + while (j >= 7) { + multiply(1e7, 0); + j -= 7; + } + multiply(pow(10, j, 1), 0); + j = e - 1; + while (j >= 23) { + divide(1 << 23); + j -= 23; + } + divide(1 << j); + multiply(1, 1); + divide(2); + m = numToString(); + } else { + multiply(0, z); + multiply(1 << -e, 0); + m = numToString() + repeat.call(ZERO, f); + } + } + if (f > 0) { + k = m.length; + m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); + } else { + m = s + m; + } return m; + } +}); + + +/***/ }), +/* 149 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $fails = __webpack_require__(4); +var aNumberValue = __webpack_require__(97); +var $toPrecision = 1.0.toPrecision; + +$export($export.P + $export.F * ($fails(function () { + // IE7- + return $toPrecision.call(1, undefined) !== '1'; +}) || !$fails(function () { + // V8 ~ Android 4.3- + $toPrecision.call({}); +})), 'Number', { + toPrecision: function toPrecision(precision) { + var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); + return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); + } +}); + + +/***/ }), +/* 150 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.1 Number.EPSILON +var $export = __webpack_require__(0); + +$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) }); + + +/***/ }), +/* 151 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.2 Number.isFinite(number) +var $export = __webpack_require__(0); +var _isFinite = __webpack_require__(2).isFinite; + +$export($export.S, 'Number', { + isFinite: function isFinite(it) { + return typeof it == 'number' && _isFinite(it); + } +}); + + +/***/ }), +/* 152 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.3 Number.isInteger(number) +var $export = __webpack_require__(0); + +$export($export.S, 'Number', { isInteger: __webpack_require__(98) }); + + +/***/ }), +/* 153 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.4 Number.isNaN(number) +var $export = __webpack_require__(0); + +$export($export.S, 'Number', { + isNaN: function isNaN(number) { + // eslint-disable-next-line no-self-compare + return number != number; + } +}); + + +/***/ }), +/* 154 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.5 Number.isSafeInteger(number) +var $export = __webpack_require__(0); +var isInteger = __webpack_require__(98); +var abs = Math.abs; + +$export($export.S, 'Number', { + isSafeInteger: function isSafeInteger(number) { + return isInteger(number) && abs(number) <= 0x1fffffffffffff; + } +}); + + +/***/ }), +/* 155 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.6 Number.MAX_SAFE_INTEGER +var $export = __webpack_require__(0); + +$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); + + +/***/ }), +/* 156 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.10 Number.MIN_SAFE_INTEGER +var $export = __webpack_require__(0); + +$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff }); + + +/***/ }), +/* 157 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var $parseFloat = __webpack_require__(99); +// 20.1.2.12 Number.parseFloat(string) +$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat }); + + +/***/ }), +/* 158 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var $parseInt = __webpack_require__(100); +// 20.1.2.13 Number.parseInt(string, radix) +$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt }); + + +/***/ }), +/* 159 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var $parseInt = __webpack_require__(100); +// 18.2.5 parseInt(string, radix) +$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt }); + + +/***/ }), +/* 160 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var $parseFloat = __webpack_require__(99); +// 18.2.4 parseFloat(string) +$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat }); + + +/***/ }), +/* 161 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.3 Math.acosh(x) +var $export = __webpack_require__(0); +var log1p = __webpack_require__(101); +var sqrt = Math.sqrt; +var $acosh = Math.acosh; + +$export($export.S + $export.F * !($acosh + // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 + && Math.floor($acosh(Number.MAX_VALUE)) == 710 + // Tor Browser bug: Math.acosh(Infinity) -> NaN + && $acosh(Infinity) == Infinity +), 'Math', { + acosh: function acosh(x) { + return (x = +x) < 1 ? NaN : x > 94906265.62425156 + ? Math.log(x) + Math.LN2 + : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); + } +}); + + +/***/ }), +/* 162 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.5 Math.asinh(x) +var $export = __webpack_require__(0); +var $asinh = Math.asinh; + +function asinh(x) { + return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); +} + +// Tor Browser bug: Math.asinh(0) -> -0 +$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh }); + + +/***/ }), +/* 163 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.7 Math.atanh(x) +var $export = __webpack_require__(0); +var $atanh = Math.atanh; + +// Tor Browser bug: Math.atanh(-0) -> 0 +$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { + atanh: function atanh(x) { + return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; + } +}); + + +/***/ }), +/* 164 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.9 Math.cbrt(x) +var $export = __webpack_require__(0); +var sign = __webpack_require__(72); + +$export($export.S, 'Math', { + cbrt: function cbrt(x) { + return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); + } +}); + + +/***/ }), +/* 165 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.11 Math.clz32(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + clz32: function clz32(x) { + return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; + } +}); + + +/***/ }), +/* 166 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.12 Math.cosh(x) +var $export = __webpack_require__(0); +var exp = Math.exp; + +$export($export.S, 'Math', { + cosh: function cosh(x) { + return (exp(x = +x) + exp(-x)) / 2; + } +}); + + +/***/ }), +/* 167 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.14 Math.expm1(x) +var $export = __webpack_require__(0); +var $expm1 = __webpack_require__(73); + +$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 }); + + +/***/ }), +/* 168 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.16 Math.fround(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { fround: __webpack_require__(102) }); + + +/***/ }), +/* 169 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) +var $export = __webpack_require__(0); +var abs = Math.abs; + +$export($export.S, 'Math', { + hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars + var sum = 0; + var i = 0; + var aLen = arguments.length; + var larg = 0; + var arg, div; + while (i < aLen) { + arg = abs(arguments[i++]); + if (larg < arg) { + div = larg / arg; + sum = sum * div * div + 1; + larg = arg; + } else if (arg > 0) { + div = arg / larg; + sum += div * div; + } else sum += arg; + } + return larg === Infinity ? Infinity : larg * Math.sqrt(sum); + } +}); + + +/***/ }), +/* 170 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.18 Math.imul(x, y) +var $export = __webpack_require__(0); +var $imul = Math.imul; + +// some WebKit versions fails with big numbers, some has wrong arity +$export($export.S + $export.F * __webpack_require__(4)(function () { + return $imul(0xffffffff, 5) != -5 || $imul.length != 2; +}), 'Math', { + imul: function imul(x, y) { + var UINT16 = 0xffff; + var xn = +x; + var yn = +y; + var xl = UINT16 & xn; + var yl = UINT16 & yn; + return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); + } +}); + + +/***/ }), +/* 171 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.21 Math.log10(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + log10: function log10(x) { + return Math.log(x) * Math.LOG10E; + } +}); + + +/***/ }), +/* 172 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.20 Math.log1p(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { log1p: __webpack_require__(101) }); + + +/***/ }), +/* 173 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.22 Math.log2(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + log2: function log2(x) { + return Math.log(x) / Math.LN2; + } +}); + + +/***/ }), +/* 174 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.28 Math.sign(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { sign: __webpack_require__(72) }); + + +/***/ }), +/* 175 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.30 Math.sinh(x) +var $export = __webpack_require__(0); +var expm1 = __webpack_require__(73); +var exp = Math.exp; + +// V8 near Chromium 38 has a problem with very small numbers +$export($export.S + $export.F * __webpack_require__(4)(function () { + return !Math.sinh(-2e-17) != -2e-17; +}), 'Math', { + sinh: function sinh(x) { + return Math.abs(x = +x) < 1 + ? (expm1(x) - expm1(-x)) / 2 + : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); + } +}); + + +/***/ }), +/* 176 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.33 Math.tanh(x) +var $export = __webpack_require__(0); +var expm1 = __webpack_require__(73); +var exp = Math.exp; + +$export($export.S, 'Math', { + tanh: function tanh(x) { + var a = expm1(x = +x); + var b = expm1(-x); + return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); + } +}); + + +/***/ }), +/* 177 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.34 Math.trunc(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + trunc: function trunc(it) { + return (it > 0 ? Math.floor : Math.ceil)(it); + } +}); + + +/***/ }), +/* 178 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var toAbsoluteIndex = __webpack_require__(35); +var fromCharCode = String.fromCharCode; +var $fromCodePoint = String.fromCodePoint; + +// length should be 1, old FF problem +$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { + // 21.1.2.2 String.fromCodePoint(...codePoints) + fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars + var res = []; + var aLen = arguments.length; + var i = 0; + var code; + while (aLen > i) { + code = +arguments[i++]; + if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); + res.push(code < 0x10000 + ? fromCharCode(code) + : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) + ); + } return res.join(''); + } +}); + + +/***/ }), +/* 179 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var toIObject = __webpack_require__(11); +var toLength = __webpack_require__(6); + +$export($export.S, 'String', { + // 21.1.2.4 String.raw(callSite, ...substitutions) + raw: function raw(callSite) { + var tpl = toIObject(callSite.raw); + var len = toLength(tpl.length); + var aLen = arguments.length; + var res = []; + var i = 0; + while (len > i) { + res.push(String(tpl[i++])); + if (i < aLen) res.push(String(arguments[i])); + } return res.join(''); + } +}); + + +/***/ }), +/* 180 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 21.1.3.25 String.prototype.trim() +__webpack_require__(47)('trim', function ($trim) { + return function trim() { + return $trim(this, 3); + }; +}); + + +/***/ }), +/* 181 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $at = __webpack_require__(74)(false); +$export($export.P, 'String', { + // 21.1.3.3 String.prototype.codePointAt(pos) + codePointAt: function codePointAt(pos) { + return $at(this, pos); + } +}); + + +/***/ }), +/* 182 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) + +var $export = __webpack_require__(0); +var toLength = __webpack_require__(6); +var context = __webpack_require__(75); +var ENDS_WITH = 'endsWith'; +var $endsWith = ''[ENDS_WITH]; + +$export($export.P + $export.F * __webpack_require__(76)(ENDS_WITH), 'String', { + endsWith: function endsWith(searchString /* , endPosition = @length */) { + var that = context(this, searchString, ENDS_WITH); + var endPosition = arguments.length > 1 ? arguments[1] : undefined; + var len = toLength(that.length); + var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); + var search = String(searchString); + return $endsWith + ? $endsWith.call(that, search, end) + : that.slice(end - search.length, end) === search; + } +}); + + +/***/ }), +/* 183 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 21.1.3.7 String.prototype.includes(searchString, position = 0) + +var $export = __webpack_require__(0); +var context = __webpack_require__(75); +var INCLUDES = 'includes'; + +$export($export.P + $export.F * __webpack_require__(76)(INCLUDES), 'String', { + includes: function includes(searchString /* , position = 0 */) { + return !!~context(this, searchString, INCLUDES) + .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); + } +}); + + +/***/ }), +/* 184 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); + +$export($export.P, 'String', { + // 21.1.3.13 String.prototype.repeat(count) + repeat: __webpack_require__(70) +}); + + +/***/ }), +/* 185 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 21.1.3.18 String.prototype.startsWith(searchString [, position ]) + +var $export = __webpack_require__(0); +var toLength = __webpack_require__(6); +var context = __webpack_require__(75); +var STARTS_WITH = 'startsWith'; +var $startsWith = ''[STARTS_WITH]; + +$export($export.P + $export.F * __webpack_require__(76)(STARTS_WITH), 'String', { + startsWith: function startsWith(searchString /* , position = 0 */) { + var that = context(this, searchString, STARTS_WITH); + var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); + var search = String(searchString); + return $startsWith + ? $startsWith.call(that, search, index) + : that.slice(index, index + search.length) === search; + } +}); + + +/***/ }), +/* 186 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $at = __webpack_require__(74)(true); + +// 21.1.3.27 String.prototype[@@iterator]() +__webpack_require__(53)(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 }; +}); + + +/***/ }), +/* 187 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.2 String.prototype.anchor(name) +__webpack_require__(14)('anchor', function (createHTML) { + return function anchor(name) { + return createHTML(this, 'a', 'name', name); + }; +}); + + +/***/ }), +/* 188 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.3 String.prototype.big() +__webpack_require__(14)('big', function (createHTML) { + return function big() { + return createHTML(this, 'big', '', ''); + }; +}); + + +/***/ }), +/* 189 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.4 String.prototype.blink() +__webpack_require__(14)('blink', function (createHTML) { + return function blink() { + return createHTML(this, 'blink', '', ''); + }; +}); + + +/***/ }), +/* 190 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.5 String.prototype.bold() +__webpack_require__(14)('bold', function (createHTML) { + return function bold() { + return createHTML(this, 'b', '', ''); + }; +}); + + +/***/ }), +/* 191 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.6 String.prototype.fixed() +__webpack_require__(14)('fixed', function (createHTML) { + return function fixed() { + return createHTML(this, 'tt', '', ''); + }; +}); + + +/***/ }), +/* 192 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.7 String.prototype.fontcolor(color) +__webpack_require__(14)('fontcolor', function (createHTML) { + return function fontcolor(color) { + return createHTML(this, 'font', 'color', color); + }; +}); + + +/***/ }), +/* 193 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.8 String.prototype.fontsize(size) +__webpack_require__(14)('fontsize', function (createHTML) { + return function fontsize(size) { + return createHTML(this, 'font', 'size', size); + }; +}); + + +/***/ }), +/* 194 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.9 String.prototype.italics() +__webpack_require__(14)('italics', function (createHTML) { + return function italics() { + return createHTML(this, 'i', '', ''); + }; +}); + + +/***/ }), +/* 195 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.10 String.prototype.link(url) +__webpack_require__(14)('link', function (createHTML) { + return function link(url) { + return createHTML(this, 'a', 'href', url); + }; +}); + + +/***/ }), +/* 196 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.11 String.prototype.small() +__webpack_require__(14)('small', function (createHTML) { + return function small() { + return createHTML(this, 'small', '', ''); + }; +}); + + +/***/ }), +/* 197 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.12 String.prototype.strike() +__webpack_require__(14)('strike', function (createHTML) { + return function strike() { + return createHTML(this, 'strike', '', ''); + }; +}); + + +/***/ }), +/* 198 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.13 String.prototype.sub() +__webpack_require__(14)('sub', function (createHTML) { + return function sub() { + return createHTML(this, 'sub', '', ''); + }; +}); + + +/***/ }), +/* 199 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.14 String.prototype.sup() +__webpack_require__(14)('sup', function (createHTML) { + return function sup() { + return createHTML(this, 'sup', '', ''); + }; +}); + + +/***/ }), +/* 200 */ +/***/ (function(module, exports, __webpack_require__) { + +// 22.1.2.2 / 15.4.3.2 Array.isArray(arg) +var $export = __webpack_require__(0); + +$export($export.S, 'Array', { isArray: __webpack_require__(52) }); + + +/***/ }), +/* 201 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var ctx = __webpack_require__(16); +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var call = __webpack_require__(104); +var isArrayIter = __webpack_require__(77); +var toLength = __webpack_require__(6); +var createProperty = __webpack_require__(78); +var getIterFn = __webpack_require__(48); + +$export($export.S + $export.F * !__webpack_require__(79)(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; + } +}); + + +/***/ }), +/* 202 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var createProperty = __webpack_require__(78); + +// WebKit Array.of isn't generic +$export($export.S + $export.F * __webpack_require__(4)(function () { + function F() { /* empty */ } + return !(Array.of.call(F) instanceof F); +}), 'Array', { + // 22.1.2.3 Array.of( ...items) + of: function of(/* ...args */) { + var index = 0; + var aLen = arguments.length; + var result = new (typeof this == 'function' ? this : Array)(aLen); + while (aLen > index) createProperty(result, index, arguments[index++]); + result.length = aLen; + return result; + } +}); + + +/***/ }), +/* 203 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 22.1.3.13 Array.prototype.join(separator) +var $export = __webpack_require__(0); +var toIObject = __webpack_require__(11); +var arrayJoin = [].join; + +// fallback for not array-like strings +$export($export.P + $export.F * (__webpack_require__(44) != Object || !__webpack_require__(19)(arrayJoin)), 'Array', { + join: function join(separator) { + return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); + } +}); + + +/***/ }), +/* 204 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var html = __webpack_require__(67); +var cof = __webpack_require__(21); +var toAbsoluteIndex = __webpack_require__(35); +var toLength = __webpack_require__(6); +var arraySlice = [].slice; + +// fallback for not array-like ES3 strings and DOM objects +$export($export.P + $export.F * __webpack_require__(4)(function () { + if (html) arraySlice.call(html); +}), 'Array', { + slice: function slice(begin, end) { + var len = toLength(this.length); + var klass = cof(this); + end = end === undefined ? len : end; + if (klass == 'Array') return arraySlice.call(this, begin, end); + var start = toAbsoluteIndex(begin, len); + var upTo = toAbsoluteIndex(end, len); + var size = toLength(upTo - start); + var cloned = new Array(size); + var i = 0; + for (; i < size; i++) cloned[i] = klass == 'String' + ? this.charAt(start + i) + : this[start + i]; + return cloned; + } +}); + + +/***/ }), +/* 205 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var aFunction = __webpack_require__(10); +var toObject = __webpack_require__(9); +var fails = __webpack_require__(4); +var $sort = [].sort; +var test = [1, 2, 3]; + +$export($export.P + $export.F * (fails(function () { + // IE8- + test.sort(undefined); +}) || !fails(function () { + // V8 bug + test.sort(null); + // Old WebKit +}) || !__webpack_require__(19)($sort)), 'Array', { + // 22.1.3.25 Array.prototype.sort(comparefn) + sort: function sort(comparefn) { + return comparefn === undefined + ? $sort.call(toObject(this)) + : $sort.call(toObject(this), aFunction(comparefn)); + } +}); + + +/***/ }), +/* 206 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $forEach = __webpack_require__(20)(0); +var STRICT = __webpack_require__(19)([].forEach, true); + +$export($export.P + $export.F * !STRICT, 'Array', { + // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) + forEach: function forEach(callbackfn /* , thisArg */) { + return $forEach(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), +/* 207 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(3); +var isArray = __webpack_require__(52); +var SPECIES = __webpack_require__(5)('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; +}; + + +/***/ }), +/* 208 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $map = __webpack_require__(20)(1); + +$export($export.P + $export.F * !__webpack_require__(19)([].map, true), 'Array', { + // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) + map: function map(callbackfn /* , thisArg */) { + return $map(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), +/* 209 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $filter = __webpack_require__(20)(2); + +$export($export.P + $export.F * !__webpack_require__(19)([].filter, true), 'Array', { + // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) + filter: function filter(callbackfn /* , thisArg */) { + return $filter(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), +/* 210 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $some = __webpack_require__(20)(3); + +$export($export.P + $export.F * !__webpack_require__(19)([].some, true), 'Array', { + // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) + some: function some(callbackfn /* , thisArg */) { + return $some(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), +/* 211 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $every = __webpack_require__(20)(4); + +$export($export.P + $export.F * !__webpack_require__(19)([].every, true), 'Array', { + // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) + every: function every(callbackfn /* , thisArg */) { + return $every(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), +/* 212 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $reduce = __webpack_require__(105); + +$export($export.P + $export.F * !__webpack_require__(19)([].reduce, true), 'Array', { + // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) + reduce: function reduce(callbackfn /* , initialValue */) { + return $reduce(this, callbackfn, arguments.length, arguments[1], false); + } +}); + + +/***/ }), +/* 213 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $reduce = __webpack_require__(105); + +$export($export.P + $export.F * !__webpack_require__(19)([].reduceRight, true), 'Array', { + // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) + reduceRight: function reduceRight(callbackfn /* , initialValue */) { + return $reduce(this, callbackfn, arguments.length, arguments[1], true); + } +}); + + +/***/ }), +/* 214 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $indexOf = __webpack_require__(50)(false); +var $native = [].indexOf; +var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; + +$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(19)($native)), 'Array', { + // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) + indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { + return NEGATIVE_ZERO + // convert -0 to +0 + ? $native.apply(this, arguments) || 0 + : $indexOf(this, searchElement, arguments[1]); + } +}); + + +/***/ }), +/* 215 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toIObject = __webpack_require__(11); +var toInteger = __webpack_require__(22); +var toLength = __webpack_require__(6); +var $native = [].lastIndexOf; +var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; + +$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(19)($native)), 'Array', { + // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) + lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { + // convert -0 to +0 + if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0; + var O = toIObject(this); + var length = toLength(O.length); + var index = length - 1; + if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1])); + if (index < 0) index = length + index; + for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0; + return -1; + } +}); + + +/***/ }), +/* 216 */ +/***/ (function(module, exports, __webpack_require__) { + +// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) +var $export = __webpack_require__(0); + +$export($export.P, 'Array', { copyWithin: __webpack_require__(106) }); + +__webpack_require__(33)('copyWithin'); + + +/***/ }), +/* 217 */ +/***/ (function(module, exports, __webpack_require__) { + +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) +var $export = __webpack_require__(0); + +$export($export.P, 'Array', { fill: __webpack_require__(81) }); + +__webpack_require__(33)('fill'); + + +/***/ }), +/* 218 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) +var $export = __webpack_require__(0); +var $find = __webpack_require__(20)(5); +var KEY = 'find'; +var forced = true; +// Shouldn't skip holes +if (KEY in []) Array(1)[KEY](function () { forced = false; }); +$export($export.P + $export.F * forced, 'Array', { + find: function find(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); +__webpack_require__(33)(KEY); + + +/***/ }), +/* 219 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) +var $export = __webpack_require__(0); +var $find = __webpack_require__(20)(6); +var KEY = 'findIndex'; +var forced = true; +// Shouldn't skip holes +if (KEY in []) Array(1)[KEY](function () { forced = false; }); +$export($export.P + $export.F * forced, 'Array', { + findIndex: function findIndex(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); +__webpack_require__(33)(KEY); + + +/***/ }), +/* 220 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(42)('Array'); + + +/***/ }), +/* 221 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var LIBRARY = __webpack_require__(30); +var global = __webpack_require__(2); +var ctx = __webpack_require__(16); +var classof = __webpack_require__(37); +var $export = __webpack_require__(0); +var isObject = __webpack_require__(3); +var aFunction = __webpack_require__(10); +var anInstance = __webpack_require__(38); +var forOf = __webpack_require__(34); +var speciesConstructor = __webpack_require__(55); +var task = __webpack_require__(84).set; +var microtask = __webpack_require__(85)(); +var newPromiseCapabilityModule = __webpack_require__(86); +var perform = __webpack_require__(107); +var userAgent = __webpack_require__(56); +var promiseResolve = __webpack_require__(108); +var PROMISE = 'Promise'; +var TypeError = global.TypeError; +var process = global.process; +var versions = process && process.versions; +var v8 = versions && versions.v8 || ''; +var $Promise = global[PROMISE]; +var isNode = classof(process) == 'process'; +var empty = function () { /* empty */ }; +var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; +var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; + +var USE_NATIVE = !!function () { + try { + // correct subclassing with @@species support + var promise = $Promise.resolve(1); + var FakePromise = (promise.constructor = {})[__webpack_require__(5)('species')] = function (exec) { + exec(empty, empty); + }; + // unhandled rejections tracking support, NodeJS Promise without it fails @@species test + return (isNode || typeof PromiseRejectionEvent == 'function') + && promise.then(empty) instanceof FakePromise + // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables + // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 + // we can't detect it synchronously, so just check versions + && v8.indexOf('6.6') !== 0 + && userAgent.indexOf('Chrome/66') === -1; + } catch (e) { /* empty */ } +}(); + +// helpers +var isThenable = function (it) { + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; +}; +var notify = function (promise, isReject) { + if (promise._n) return; + promise._n = true; + var chain = promise._c; + microtask(function () { + var value = promise._v; + var ok = promise._s == 1; + var i = 0; + var run = function (reaction) { + var handler = ok ? reaction.ok : reaction.fail; + var resolve = reaction.resolve; + var reject = reaction.reject; + var domain = reaction.domain; + var result, then, exited; + try { + if (handler) { + if (!ok) { + if (promise._h == 2) onHandleUnhandled(promise); + promise._h = 1; + } + if (handler === true) result = value; + else { + if (domain) domain.enter(); + result = handler(value); // may throw + if (domain) { + domain.exit(); + exited = true; + } + } + if (result === reaction.promise) { + reject(TypeError('Promise-chain cycle')); + } else if (then = isThenable(result)) { + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch (e) { + if (domain && !exited) domain.exit(); + reject(e); + } + }; + while (chain.length > i) run(chain[i++]); // variable length - can't use forEach + promise._c = []; + promise._n = false; + if (isReject && !promise._h) onUnhandled(promise); + }); +}; +var onUnhandled = function (promise) { + task.call(global, function () { + var value = promise._v; + var unhandled = isUnhandled(promise); + var result, handler, console; + if (unhandled) { + result = perform(function () { + if (isNode) { + process.emit('unhandledRejection', value, promise); + } else if (handler = global.onunhandledrejection) { + handler({ promise: promise, reason: value }); + } else if ((console = global.console) && console.error) { + console.error('Unhandled promise rejection', value); + } + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + promise._h = isNode || isUnhandled(promise) ? 2 : 1; + } promise._a = undefined; + if (unhandled && result.e) throw result.v; + }); +}; +var isUnhandled = function (promise) { + return promise._h !== 1 && (promise._a || promise._c).length === 0; +}; +var onHandleUnhandled = function (promise) { + task.call(global, function () { + var handler; + if (isNode) { + process.emit('rejectionHandled', promise); + } else if (handler = global.onrejectionhandled) { + handler({ promise: promise, reason: promise._v }); + } + }); +}; +var $reject = function (value) { + var promise = this; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + promise._v = value; + promise._s = 2; + if (!promise._a) promise._a = promise._c.slice(); + notify(promise, true); +}; +var $resolve = function (value) { + var promise = this; + var then; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + try { + if (promise === value) throw TypeError("Promise can't be resolved itself"); + if (then = isThenable(value)) { + microtask(function () { + var wrapper = { _w: promise, _d: false }; // wrap + try { + then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); + } catch (e) { + $reject.call(wrapper, e); + } + }); + } else { + promise._v = value; + promise._s = 1; + notify(promise, false); + } + } catch (e) { + $reject.call({ _w: promise, _d: false }, e); // wrap + } +}; + +// constructor polyfill +if (!USE_NATIVE) { + // 25.4.3.1 Promise(executor) + $Promise = function Promise(executor) { + anInstance(this, $Promise, PROMISE, '_h'); + aFunction(executor); + Internal.call(this); + try { + executor(ctx($resolve, this, 1), ctx($reject, this, 1)); + } catch (err) { + $reject.call(this, err); + } + }; + // eslint-disable-next-line no-unused-vars + Internal = function Promise(executor) { + this._c = []; // <- awaiting reactions + this._a = undefined; // <- checked in isUnhandled reactions + this._s = 0; // <- state + this._d = false; // <- done + this._v = undefined; // <- value + this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled + this._n = false; // <- notify + }; + Internal.prototype = __webpack_require__(39)($Promise.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected) { + var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = isNode ? process.domain : undefined; + this._c.push(reaction); + if (this._a) this._a.push(reaction); + if (this._s) notify(this, false); + return reaction.promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function (onRejected) { + return this.then(undefined, onRejected); + } + }); + OwnPromiseCapability = function () { + var promise = new Internal(); + this.promise = promise; + this.resolve = ctx($resolve, promise, 1); + this.reject = ctx($reject, promise, 1); + }; + newPromiseCapabilityModule.f = newPromiseCapability = function (C) { + return C === $Promise || C === Wrapper + ? new OwnPromiseCapability(C) + : newGenericPromiseCapability(C); + }; +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); +__webpack_require__(41)($Promise, PROMISE); +__webpack_require__(42)(PROMISE); +Wrapper = __webpack_require__(12)[PROMISE]; + +// statics +$export($export.S + $export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r) { + var capability = newPromiseCapability(this); + var $$reject = capability.reject; + $$reject(r); + return capability.promise; + } +}); +$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x) { + return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); + } +}); +$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(79)(function (iter) { + $Promise.all(iter)['catch'](empty); +})), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var resolve = capability.resolve; + var reject = capability.reject; + var result = perform(function () { + var values = []; + var index = 0; + var remaining = 1; + forOf(iterable, false, function (promise) { + var $index = index++; + var alreadyCalled = false; + values.push(undefined); + remaining++; + C.resolve(promise).then(function (value) { + if (alreadyCalled) return; + alreadyCalled = true; + values[$index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if (result.e) reject(result.v); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var reject = capability.reject; + var result = perform(function () { + forOf(iterable, false, function (promise) { + C.resolve(promise).then(capability.resolve, reject); + }); + }); + if (result.e) reject(result.v); + return capability.promise; + } +}); + + +/***/ }), +/* 222 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var weak = __webpack_require__(113); +var validate = __webpack_require__(43); +var WEAK_SET = 'WeakSet'; + +// 23.4 WeakSet Objects +__webpack_require__(57)(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); + + +/***/ }), +/* 223 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.1 Reflect.apply(target, thisArgument, argumentsList) +var $export = __webpack_require__(0); +var aFunction = __webpack_require__(10); +var anObject = __webpack_require__(1); +var rApply = (__webpack_require__(2).Reflect || {}).apply; +var fApply = Function.apply; +// MS Edge argumentsList argument is optional +$export($export.S + $export.F * !__webpack_require__(4)(function () { + rApply(function () { /* empty */ }); +}), 'Reflect', { + apply: function apply(target, thisArgument, argumentsList) { + var T = aFunction(target); + var L = anObject(argumentsList); + return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); + } +}); + + +/***/ }), +/* 224 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) +var $export = __webpack_require__(0); +var create = __webpack_require__(32); +var aFunction = __webpack_require__(10); +var anObject = __webpack_require__(1); +var isObject = __webpack_require__(3); +var fails = __webpack_require__(4); +var bind = __webpack_require__(96); +var rConstruct = (__webpack_require__(2).Reflect || {}).construct; + +// MS Edge supports only 2 arguments and argumentsList argument is optional +// FF Nightly sets third argument as `new.target`, but does not create `this` from it +var NEW_TARGET_BUG = fails(function () { + function F() { /* empty */ } + return !(rConstruct(function () { /* empty */ }, [], F) instanceof F); +}); +var ARGS_BUG = !fails(function () { + rConstruct(function () { /* empty */ }); +}); + +$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { + construct: function construct(Target, args /* , newTarget */) { + aFunction(Target); + anObject(args); + var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); + if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget); + if (Target == newTarget) { + // w/o altered newTarget, optimization for 0-4 arguments + switch (args.length) { + case 0: return new Target(); + case 1: return new Target(args[0]); + case 2: return new Target(args[0], args[1]); + case 3: return new Target(args[0], args[1], args[2]); + case 4: return new Target(args[0], args[1], args[2], args[3]); + } + // w/o altered newTarget, lot of arguments case + var $args = [null]; + $args.push.apply($args, args); + return new (bind.apply(Target, $args))(); + } + // with altered newTarget, not support built-in constructors + var proto = newTarget.prototype; + var instance = create(isObject(proto) ? proto : Object.prototype); + var result = Function.apply.call(Target, instance, args); + return isObject(result) ? result : instance; + } +}); + + +/***/ }), +/* 225 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) +var dP = __webpack_require__(7); +var $export = __webpack_require__(0); +var anObject = __webpack_require__(1); +var toPrimitive = __webpack_require__(27); + +// MS Edge has broken Reflect.defineProperty - throwing instead of returning false +$export($export.S + $export.F * __webpack_require__(4)(function () { + // eslint-disable-next-line no-undef + Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 }); +}), 'Reflect', { + defineProperty: function defineProperty(target, propertyKey, attributes) { + anObject(target); + propertyKey = toPrimitive(propertyKey, true); + anObject(attributes); + try { + dP.f(target, propertyKey, attributes); + return true; + } catch (e) { + return false; + } + } +}); + + +/***/ }), +/* 226 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.4 Reflect.deleteProperty(target, propertyKey) +var $export = __webpack_require__(0); +var gOPD = __webpack_require__(18).f; +var anObject = __webpack_require__(1); + +$export($export.S, 'Reflect', { + deleteProperty: function deleteProperty(target, propertyKey) { + var desc = gOPD(anObject(target), propertyKey); + return desc && !desc.configurable ? false : delete target[propertyKey]; + } +}); + + +/***/ }), +/* 227 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 26.1.5 Reflect.enumerate(target) +var $export = __webpack_require__(0); +var anObject = __webpack_require__(1); +var Enumerate = function (iterated) { + this._t = anObject(iterated); // target + this._i = 0; // next index + var keys = this._k = []; // keys + var key; + for (key in iterated) keys.push(key); +}; +__webpack_require__(54)(Enumerate, 'Object', function () { + var that = this; + var keys = that._k; + var key; + do { + if (that._i >= keys.length) return { value: undefined, done: true }; + } while (!((key = keys[that._i++]) in that._t)); + return { value: key, done: false }; +}); + +$export($export.S, 'Reflect', { + enumerate: function enumerate(target) { + return new Enumerate(target); + } +}); + + +/***/ }), +/* 228 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.6 Reflect.get(target, propertyKey [, receiver]) +var gOPD = __webpack_require__(18); +var getPrototypeOf = __webpack_require__(13); +var has = __webpack_require__(15); +var $export = __webpack_require__(0); +var isObject = __webpack_require__(3); +var anObject = __webpack_require__(1); + +function get(target, propertyKey /* , receiver */) { + var receiver = arguments.length < 3 ? target : arguments[2]; + var desc, proto; + if (anObject(target) === receiver) return target[propertyKey]; + if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value') + ? desc.value + : desc.get !== undefined + ? desc.get.call(receiver) + : undefined; + if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver); +} + +$export($export.S, 'Reflect', { get: get }); + + +/***/ }), +/* 229 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) +var gOPD = __webpack_require__(18); +var $export = __webpack_require__(0); +var anObject = __webpack_require__(1); + +$export($export.S, 'Reflect', { + getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { + return gOPD.f(anObject(target), propertyKey); + } +}); + + +/***/ }), +/* 230 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.8 Reflect.getPrototypeOf(target) +var $export = __webpack_require__(0); +var getProto = __webpack_require__(13); +var anObject = __webpack_require__(1); + +$export($export.S, 'Reflect', { + getPrototypeOf: function getPrototypeOf(target) { + return getProto(anObject(target)); + } +}); + + +/***/ }), +/* 231 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.9 Reflect.has(target, propertyKey) +var $export = __webpack_require__(0); + +$export($export.S, 'Reflect', { + has: function has(target, propertyKey) { + return propertyKey in target; + } +}); + + +/***/ }), +/* 232 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.10 Reflect.isExtensible(target) +var $export = __webpack_require__(0); +var anObject = __webpack_require__(1); +var $isExtensible = Object.isExtensible; + +$export($export.S, 'Reflect', { + isExtensible: function isExtensible(target) { + anObject(target); + return $isExtensible ? $isExtensible(target) : true; + } +}); + + +/***/ }), +/* 233 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.11 Reflect.ownKeys(target) +var $export = __webpack_require__(0); + +$export($export.S, 'Reflect', { ownKeys: __webpack_require__(87) }); + + +/***/ }), +/* 234 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.12 Reflect.preventExtensions(target) +var $export = __webpack_require__(0); +var anObject = __webpack_require__(1); +var $preventExtensions = Object.preventExtensions; + +$export($export.S, 'Reflect', { + preventExtensions: function preventExtensions(target) { + anObject(target); + try { + if ($preventExtensions) $preventExtensions(target); + return true; + } catch (e) { + return false; + } + } +}); + + +/***/ }), +/* 235 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) +var dP = __webpack_require__(7); +var gOPD = __webpack_require__(18); +var getPrototypeOf = __webpack_require__(13); +var has = __webpack_require__(15); +var $export = __webpack_require__(0); +var createDesc = __webpack_require__(28); +var anObject = __webpack_require__(1); +var isObject = __webpack_require__(3); + +function set(target, propertyKey, V /* , receiver */) { + var receiver = arguments.length < 4 ? target : arguments[3]; + var ownDesc = gOPD.f(anObject(target), propertyKey); + var existingDescriptor, proto; + if (!ownDesc) { + if (isObject(proto = getPrototypeOf(target))) { + return set(proto, propertyKey, V, receiver); + } + ownDesc = createDesc(0); + } + if (has(ownDesc, 'value')) { + if (ownDesc.writable === false || !isObject(receiver)) return false; + if (existingDescriptor = gOPD.f(receiver, propertyKey)) { + if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false; + existingDescriptor.value = V; + dP.f(receiver, propertyKey, existingDescriptor); + } else dP.f(receiver, propertyKey, createDesc(0, V)); + return true; + } + return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); +} + +$export($export.S, 'Reflect', { set: set }); + + +/***/ }), +/* 236 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.14 Reflect.setPrototypeOf(target, proto) +var $export = __webpack_require__(0); +var setProto = __webpack_require__(95); + +if (setProto) $export($export.S, 'Reflect', { + setPrototypeOf: function setPrototypeOf(target, proto) { + setProto.check(target, proto); + try { + setProto.set(target, proto); + return true; + } catch (e) { + return false; + } + } +}); + + +/***/ }), +/* 237 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.3.3.1 / 15.9.4.4 Date.now() +var $export = __webpack_require__(0); + +$export($export.S, 'Date', { now: function () { return new Date().getTime(); } }); + + +/***/ }), +/* 238 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var toPrimitive = __webpack_require__(27); +var toISOString = __webpack_require__(114); +var classof = __webpack_require__(37); + +$export($export.P + $export.F * __webpack_require__(4)(function () { + return new Date(NaN).toJSON() !== null + || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; +}), 'Date', { + // eslint-disable-next-line no-unused-vars + toJSON: function toJSON(key) { + var O = toObject(this); + var pv = toPrimitive(O); + return typeof pv == 'number' && !isFinite(pv) ? null : + (!('toISOString' in O) && classof(O) == 'Date') ? toISOString.call(O) : O.toISOString(); + } +}); + + +/***/ }), +/* 239 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() +var $export = __webpack_require__(0); +var toISOString = __webpack_require__(114); + +// PhantomJS / old WebKit has a broken implementations +$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', { + toISOString: toISOString +}); + + +/***/ }), +/* 240 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $typed = __webpack_require__(58); +var buffer = __webpack_require__(88); +var anObject = __webpack_require__(1); +var toAbsoluteIndex = __webpack_require__(35); +var toLength = __webpack_require__(6); +var isObject = __webpack_require__(3); +var ArrayBuffer = __webpack_require__(2).ArrayBuffer; +var speciesConstructor = __webpack_require__(55); +var $ArrayBuffer = buffer.ArrayBuffer; +var $DataView = buffer.DataView; +var $isView = $typed.ABV && ArrayBuffer.isView; +var $slice = $ArrayBuffer.prototype.slice; +var VIEW = $typed.VIEW; +var ARRAY_BUFFER = 'ArrayBuffer'; + +$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer }); + +$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { + // 24.1.3.1 ArrayBuffer.isView(arg) + isView: function isView(it) { + return $isView && $isView(it) || isObject(it) && VIEW in it; + } +}); + +$export($export.P + $export.U + $export.F * __webpack_require__(4)(function () { + return !new $ArrayBuffer(2).slice(1, undefined).byteLength; +}), ARRAY_BUFFER, { + // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) + slice: function slice(start, end) { + if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix + var len = anObject(this).byteLength; + var first = toAbsoluteIndex(start, len); + var fin = toAbsoluteIndex(end === undefined ? len : end, len); + var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first)); + var viewS = new $DataView(this); + var viewT = new $DataView(result); + var index = 0; + while (first < fin) { + viewT.setUint8(index++, viewS.getUint8(first++)); + } return result; + } +}); + +__webpack_require__(42)(ARRAY_BUFFER); + + +/***/ }), +/* 241 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +$export($export.G + $export.W + $export.F * !__webpack_require__(58).ABV, { + DataView: __webpack_require__(88).DataView +}); + + +/***/ }), +/* 242 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(25)('Int8', 1, function (init) { + return function Int8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 243 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(25)('Uint8', 1, function (init) { + return function Uint8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 244 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(25)('Uint8', 1, function (init) { + return function Uint8ClampedArray(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}, true); + + +/***/ }), +/* 245 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(25)('Int16', 2, function (init) { + return function Int16Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 246 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(25)('Uint16', 2, function (init) { + return function Uint16Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 247 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(25)('Int32', 4, function (init) { + return function Int32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 248 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(25)('Uint32', 4, function (init) { + return function Uint32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 249 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(25)('Float32', 4, function (init) { + return function Float32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 250 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(25)('Float64', 8, function (init) { + return function Float64Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 251 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/tc39/Array.prototype.includes +var $export = __webpack_require__(0); +var $includes = __webpack_require__(50)(true); + +$export($export.P, 'Array', { + includes: function includes(el /* , fromIndex = 0 */) { + return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +__webpack_require__(33)('includes'); + + +/***/ }), +/* 252 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap +var $export = __webpack_require__(0); +var flattenIntoArray = __webpack_require__(116); +var toObject = __webpack_require__(9); +var toLength = __webpack_require__(6); +var aFunction = __webpack_require__(10); +var arraySpeciesCreate = __webpack_require__(80); + +$export($export.P, 'Array', { + flatMap: function flatMap(callbackfn /* , thisArg */) { + var O = toObject(this); + var sourceLen, A; + aFunction(callbackfn); + sourceLen = toLength(O.length); + A = arraySpeciesCreate(O, 0); + flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]); + return A; + } +}); + +__webpack_require__(33)('flatMap'); + + +/***/ }), +/* 253 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten +var $export = __webpack_require__(0); +var flattenIntoArray = __webpack_require__(116); +var toObject = __webpack_require__(9); +var toLength = __webpack_require__(6); +var toInteger = __webpack_require__(22); +var arraySpeciesCreate = __webpack_require__(80); + +$export($export.P, 'Array', { + flatten: function flatten(/* depthArg = 1 */) { + var depthArg = arguments[0]; + var O = toObject(this); + var sourceLen = toLength(O.length); + var A = arraySpeciesCreate(O, 0); + flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg)); + return A; + } +}); + +__webpack_require__(33)('flatten'); + + +/***/ }), +/* 254 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/mathiasbynens/String.prototype.at +var $export = __webpack_require__(0); +var $at = __webpack_require__(74)(true); + +$export($export.P, 'String', { + at: function at(pos) { + return $at(this, pos); + } +}); + + +/***/ }), +/* 255 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/tc39/proposal-string-pad-start-end +var $export = __webpack_require__(0); +var $pad = __webpack_require__(117); +var userAgent = __webpack_require__(56); + +// https://github.com/zloirock/core-js/issues/280 +$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { + padStart: function padStart(maxLength /* , fillString = ' ' */) { + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); + } +}); + + +/***/ }), +/* 256 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/tc39/proposal-string-pad-start-end +var $export = __webpack_require__(0); +var $pad = __webpack_require__(117); +var userAgent = __webpack_require__(56); + +// https://github.com/zloirock/core-js/issues/280 +$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { + padEnd: function padEnd(maxLength /* , fillString = ' ' */) { + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); + } +}); + + +/***/ }), +/* 257 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/sebmarkbage/ecmascript-string-left-right-trim +__webpack_require__(47)('trimLeft', function ($trim) { + return function trimLeft() { + return $trim(this, 1); + }; +}, 'trimStart'); + + +/***/ }), +/* 258 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/sebmarkbage/ecmascript-string-left-right-trim +__webpack_require__(47)('trimRight', function ($trim) { + return function trimRight() { + return $trim(this, 2); + }; +}, 'trimEnd'); + + +/***/ }), +/* 259 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/String.prototype.matchAll/ +var $export = __webpack_require__(0); +var defined = __webpack_require__(24); +var toLength = __webpack_require__(6); +var isRegExp = __webpack_require__(103); +var getFlags = __webpack_require__(260); +var RegExpProto = RegExp.prototype; + +var $RegExpStringIterator = function (regexp, string) { + this._r = regexp; + this._s = string; +}; + +__webpack_require__(54)($RegExpStringIterator, 'RegExp String', function next() { + var match = this._r.exec(this._s); + return { value: match, done: match === null }; +}); + +$export($export.P, 'String', { + matchAll: function matchAll(regexp) { + defined(this); + if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!'); + var S = String(this); + var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp); + var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags); + rx.lastIndex = toLength(regexp.lastIndex); + return new $RegExpStringIterator(rx, S); + } +}); + + +/***/ }), +/* 260 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 21.2.5.3 get RegExp.prototype.flags +var anObject = __webpack_require__(1); +module.exports = function () { + var that = anObject(this); + var result = ''; + if (that.global) result += 'g'; + if (that.ignoreCase) result += 'i'; + if (that.multiline) result += 'm'; + if (that.unicode) result += 'u'; + if (that.sticky) result += 'y'; + return result; +}; + + +/***/ }), +/* 261 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(64)('asyncIterator'); + + +/***/ }), +/* 262 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(64)('observable'); + + +/***/ }), +/* 263 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-object-getownpropertydescriptors +var $export = __webpack_require__(0); +var ownKeys = __webpack_require__(87); +var toIObject = __webpack_require__(11); +var gOPD = __webpack_require__(18); +var createProperty = __webpack_require__(78); + +$export($export.S, 'Object', { + getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { + var O = toIObject(object); + var getDesc = gOPD.f; + var keys = ownKeys(O); + var result = {}; + var i = 0; + var key, desc; + while (keys.length > i) { + desc = getDesc(O, key = keys[i++]); + if (desc !== undefined) createProperty(result, key, desc); + } + return result; + } +}); + + +/***/ }), +/* 264 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-object-values-entries +var $export = __webpack_require__(0); +var $values = __webpack_require__(118)(false); + +$export($export.S, 'Object', { + values: function values(it) { + return $values(it); + } +}); + + +/***/ }), +/* 265 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-object-values-entries +var $export = __webpack_require__(0); +var $entries = __webpack_require__(118)(true); + +$export($export.S, 'Object', { + entries: function entries(it) { + return $entries(it); + } +}); + + +/***/ }), +/* 266 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var aFunction = __webpack_require__(10); +var $defineProperty = __webpack_require__(7); + +// B.2.2.2 Object.prototype.__defineGetter__(P, getter) +__webpack_require__(8) && $export($export.P + __webpack_require__(59), 'Object', { + __defineGetter__: function __defineGetter__(P, getter) { + $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true }); + } +}); + + +/***/ }), +/* 267 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var aFunction = __webpack_require__(10); +var $defineProperty = __webpack_require__(7); + +// B.2.2.3 Object.prototype.__defineSetter__(P, setter) +__webpack_require__(8) && $export($export.P + __webpack_require__(59), 'Object', { + __defineSetter__: function __defineSetter__(P, setter) { + $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true }); + } +}); + + +/***/ }), +/* 268 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var toPrimitive = __webpack_require__(27); +var getPrototypeOf = __webpack_require__(13); +var getOwnPropertyDescriptor = __webpack_require__(18).f; + +// B.2.2.4 Object.prototype.__lookupGetter__(P) +__webpack_require__(8) && $export($export.P + __webpack_require__(59), 'Object', { + __lookupGetter__: function __lookupGetter__(P) { + var O = toObject(this); + var K = toPrimitive(P, true); + var D; + do { + if (D = getOwnPropertyDescriptor(O, K)) return D.get; + } while (O = getPrototypeOf(O)); + } +}); + + +/***/ }), +/* 269 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var toPrimitive = __webpack_require__(27); +var getPrototypeOf = __webpack_require__(13); +var getOwnPropertyDescriptor = __webpack_require__(18).f; + +// B.2.2.5 Object.prototype.__lookupSetter__(P) +__webpack_require__(8) && $export($export.P + __webpack_require__(59), 'Object', { + __lookupSetter__: function __lookupSetter__(P) { + var O = toObject(this); + var K = toPrimitive(P, true); + var D; + do { + if (D = getOwnPropertyDescriptor(O, K)) return D.set; + } while (O = getPrototypeOf(O)); + } +}); + + +/***/ }), +/* 270 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = __webpack_require__(0); + +$export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(119)('Map') }); + + +/***/ }), +/* 271 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = __webpack_require__(0); + +$export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(119)('Set') }); + + +/***/ }), +/* 272 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of +__webpack_require__(60)('Map'); + + +/***/ }), +/* 273 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of +__webpack_require__(60)('Set'); + + +/***/ }), +/* 274 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of +__webpack_require__(60)('WeakMap'); + + +/***/ }), +/* 275 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of +__webpack_require__(60)('WeakSet'); + + +/***/ }), +/* 276 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from +__webpack_require__(61)('Map'); + + +/***/ }), +/* 277 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from +__webpack_require__(61)('Set'); + + +/***/ }), +/* 278 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from +__webpack_require__(61)('WeakMap'); + + +/***/ }), +/* 279 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from +__webpack_require__(61)('WeakSet'); + + +/***/ }), +/* 280 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-global +var $export = __webpack_require__(0); + +$export($export.G, { global: __webpack_require__(2) }); + + +/***/ }), +/* 281 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-global +var $export = __webpack_require__(0); + +$export($export.S, 'System', { global: __webpack_require__(2) }); + + +/***/ }), +/* 282 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/ljharb/proposal-is-error +var $export = __webpack_require__(0); +var cof = __webpack_require__(21); + +$export($export.S, 'Error', { + isError: function isError(it) { + return cof(it) === 'Error'; + } +}); + + +/***/ }), +/* 283 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + clamp: function clamp(x, lower, upper) { + return Math.min(upper, Math.max(lower, x)); + } +}); + + +/***/ }), +/* 284 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 }); + + +/***/ }), +/* 285 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); +var RAD_PER_DEG = 180 / Math.PI; + +$export($export.S, 'Math', { + degrees: function degrees(radians) { + return radians * RAD_PER_DEG; + } +}); + + +/***/ }), +/* 286 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); +var scale = __webpack_require__(121); +var fround = __webpack_require__(102); + +$export($export.S, 'Math', { + fscale: function fscale(x, inLow, inHigh, outLow, outHigh) { + return fround(scale(x, inLow, inHigh, outLow, outHigh)); + } +}); + + +/***/ }), +/* 287 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + iaddh: function iaddh(x0, x1, y0, y1) { + var $x0 = x0 >>> 0; + var $x1 = x1 >>> 0; + var $y0 = y0 >>> 0; + return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; + } +}); + + +/***/ }), +/* 288 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + isubh: function isubh(x0, x1, y0, y1) { + var $x0 = x0 >>> 0; + var $x1 = x1 >>> 0; + var $y0 = y0 >>> 0; + return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; + } +}); + + +/***/ }), +/* 289 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + imulh: function imulh(u, v) { + var UINT16 = 0xffff; + var $u = +u; + var $v = +v; + var u0 = $u & UINT16; + var v0 = $v & UINT16; + var u1 = $u >> 16; + var v1 = $v >> 16; + var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); + } +}); + + +/***/ }), +/* 290 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI }); + + +/***/ }), +/* 291 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); +var DEG_PER_RAD = Math.PI / 180; + +$export($export.S, 'Math', { + radians: function radians(degrees) { + return degrees * DEG_PER_RAD; + } +}); + + +/***/ }), +/* 292 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { scale: __webpack_require__(121) }); + + +/***/ }), +/* 293 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + umulh: function umulh(u, v) { + var UINT16 = 0xffff; + var $u = +u; + var $v = +v; + var u0 = $u & UINT16; + var v0 = $v & UINT16; + var u1 = $u >>> 16; + var v1 = $v >>> 16; + var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); + } +}); + + +/***/ }), +/* 294 */ +/***/ (function(module, exports, __webpack_require__) { + +// http://jfbastien.github.io/papers/Math.signbit.html +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { signbit: function signbit(x) { + // eslint-disable-next-line no-self-compare + return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0; +} }); + + +/***/ }), +/* 295 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// https://github.com/tc39/proposal-promise-finally + +var $export = __webpack_require__(0); +var core = __webpack_require__(12); +var global = __webpack_require__(2); +var speciesConstructor = __webpack_require__(55); +var promiseResolve = __webpack_require__(108); + +$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { + var C = speciesConstructor(this, core.Promise || global.Promise); + var isFunction = typeof onFinally == 'function'; + return this.then( + isFunction ? function (x) { + return promiseResolve(C, onFinally()).then(function () { return x; }); + } : onFinally, + isFunction ? function (e) { + return promiseResolve(C, onFinally()).then(function () { throw e; }); + } : onFinally + ); +} }); + + +/***/ }), +/* 296 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/tc39/proposal-promise-try +var $export = __webpack_require__(0); +var newPromiseCapability = __webpack_require__(86); +var perform = __webpack_require__(107); + +$export($export.S, 'Promise', { 'try': function (callbackfn) { + var promiseCapability = newPromiseCapability.f(this); + var result = perform(callbackfn); + (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); + return promiseCapability.promise; +} }); + + +/***/ }), +/* 297 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(26); +var anObject = __webpack_require__(1); +var toMetaKey = metadata.key; +var ordinaryDefineOwnMetadata = metadata.set; + +metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) { + ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); +} }); + + +/***/ }), +/* 298 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(26); +var anObject = __webpack_require__(1); +var toMetaKey = metadata.key; +var getOrCreateMetadataMap = metadata.map; +var store = metadata.store; + +metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) { + var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]); + var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); + if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false; + if (metadataMap.size) return true; + var targetMetadata = store.get(target); + targetMetadata['delete'](targetKey); + return !!targetMetadata.size || store['delete'](target); +} }); + + +/***/ }), +/* 299 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(26); +var anObject = __webpack_require__(1); +var getPrototypeOf = __webpack_require__(13); +var ordinaryHasOwnMetadata = metadata.has; +var ordinaryGetOwnMetadata = metadata.get; +var toMetaKey = metadata.key; + +var ordinaryGetMetadata = function (MetadataKey, O, P) { + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P); + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; +}; + +metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) { + return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); + + +/***/ }), +/* 300 */ +/***/ (function(module, exports, __webpack_require__) { + +var Set = __webpack_require__(111); +var from = __webpack_require__(120); +var metadata = __webpack_require__(26); +var anObject = __webpack_require__(1); +var getPrototypeOf = __webpack_require__(13); +var ordinaryOwnMetadataKeys = metadata.keys; +var toMetaKey = metadata.key; + +var ordinaryMetadataKeys = function (O, P) { + var oKeys = ordinaryOwnMetadataKeys(O, P); + var parent = getPrototypeOf(O); + if (parent === null) return oKeys; + var pKeys = ordinaryMetadataKeys(parent, P); + return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys; +}; + +metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) { + return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); +} }); + + +/***/ }), +/* 301 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(26); +var anObject = __webpack_require__(1); +var ordinaryGetOwnMetadata = metadata.get; +var toMetaKey = metadata.key; + +metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) { + return ordinaryGetOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); + + +/***/ }), +/* 302 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(26); +var anObject = __webpack_require__(1); +var ordinaryOwnMetadataKeys = metadata.keys; +var toMetaKey = metadata.key; + +metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) { + return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); +} }); + + +/***/ }), +/* 303 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(26); +var anObject = __webpack_require__(1); +var getPrototypeOf = __webpack_require__(13); +var ordinaryHasOwnMetadata = metadata.has; +var toMetaKey = metadata.key; + +var ordinaryHasMetadata = function (MetadataKey, O, P) { + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) return true; + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; +}; + +metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) { + return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); + + +/***/ }), +/* 304 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(26); +var anObject = __webpack_require__(1); +var ordinaryHasOwnMetadata = metadata.has; +var toMetaKey = metadata.key; + +metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) { + return ordinaryHasOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); + + +/***/ }), +/* 305 */ +/***/ (function(module, exports, __webpack_require__) { + +var $metadata = __webpack_require__(26); +var anObject = __webpack_require__(1); +var aFunction = __webpack_require__(10); +var toMetaKey = $metadata.key; +var ordinaryDefineOwnMetadata = $metadata.set; + +$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) { + return function decorator(target, targetKey) { + ordinaryDefineOwnMetadata( + metadataKey, metadataValue, + (targetKey !== undefined ? anObject : aFunction)(target), + toMetaKey(targetKey) + ); + }; +} }); + + +/***/ }), +/* 306 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask +var $export = __webpack_require__(0); +var microtask = __webpack_require__(85)(); +var process = __webpack_require__(2).process; +var isNode = __webpack_require__(21)(process) == 'process'; + +$export($export.G, { + asap: function asap(fn) { + var domain = isNode && process.domain; + microtask(domain ? domain.bind(fn) : fn); + } +}); + + +/***/ }), +/* 307 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/zenparsing/es-observable +var $export = __webpack_require__(0); +var global = __webpack_require__(2); +var core = __webpack_require__(12); +var microtask = __webpack_require__(85)(); +var OBSERVABLE = __webpack_require__(5)('observable'); +var aFunction = __webpack_require__(10); +var anObject = __webpack_require__(1); +var anInstance = __webpack_require__(38); +var redefineAll = __webpack_require__(39); +var hide = __webpack_require__(17); +var forOf = __webpack_require__(34); +var RETURN = forOf.RETURN; + +var getMethod = function (fn) { + return fn == null ? undefined : aFunction(fn); +}; + +var cleanupSubscription = function (subscription) { + var cleanup = subscription._c; + if (cleanup) { + subscription._c = undefined; + cleanup(); + } +}; + +var subscriptionClosed = function (subscription) { + return subscription._o === undefined; +}; + +var closeSubscription = function (subscription) { + if (!subscriptionClosed(subscription)) { + subscription._o = undefined; + cleanupSubscription(subscription); + } +}; + +var Subscription = function (observer, subscriber) { + anObject(observer); + this._c = undefined; + this._o = observer; + observer = new SubscriptionObserver(this); + try { + var cleanup = subscriber(observer); + var subscription = cleanup; + if (cleanup != null) { + if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); }; + else aFunction(cleanup); + this._c = cleanup; + } + } catch (e) { + observer.error(e); + return; + } if (subscriptionClosed(this)) cleanupSubscription(this); +}; + +Subscription.prototype = redefineAll({}, { + unsubscribe: function unsubscribe() { closeSubscription(this); } +}); + +var SubscriptionObserver = function (subscription) { + this._s = subscription; +}; + +SubscriptionObserver.prototype = redefineAll({}, { + next: function next(value) { + var subscription = this._s; + if (!subscriptionClosed(subscription)) { + var observer = subscription._o; + try { + var m = getMethod(observer.next); + if (m) return m.call(observer, value); + } catch (e) { + try { + closeSubscription(subscription); + } finally { + throw e; + } + } + } + }, + error: function error(value) { + var subscription = this._s; + if (subscriptionClosed(subscription)) throw value; + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.error); + if (!m) throw value; + value = m.call(observer, value); + } catch (e) { + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + }, + complete: function complete(value) { + var subscription = this._s; + if (!subscriptionClosed(subscription)) { + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.complete); + value = m ? m.call(observer, value) : undefined; + } catch (e) { + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + } + } +}); + +var $Observable = function Observable(subscriber) { + anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber); +}; + +redefineAll($Observable.prototype, { + subscribe: function subscribe(observer) { + return new Subscription(observer, this._f); + }, + forEach: function forEach(fn) { + var that = this; + return new (core.Promise || global.Promise)(function (resolve, reject) { + aFunction(fn); + var subscription = that.subscribe({ + next: function (value) { + try { + return fn(value); + } catch (e) { + reject(e); + subscription.unsubscribe(); + } + }, + error: reject, + complete: resolve + }); + }); + } +}); + +redefineAll($Observable, { + from: function from(x) { + var C = typeof this === 'function' ? this : $Observable; + var method = getMethod(anObject(x)[OBSERVABLE]); + if (method) { + var observable = anObject(method.call(x)); + return observable.constructor === C ? observable : new C(function (observer) { + return observable.subscribe(observer); + }); + } + return new C(function (observer) { + var done = false; + microtask(function () { + if (!done) { + try { + if (forOf(x, false, function (it) { + observer.next(it); + if (done) return RETURN; + }) === RETURN) return; + } catch (e) { + if (done) throw e; + observer.error(e); + return; + } observer.complete(); + } + }); + return function () { done = true; }; + }); + }, + of: function of() { + for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++]; + return new (typeof this === 'function' ? this : $Observable)(function (observer) { + var done = false; + microtask(function () { + if (!done) { + for (var j = 0; j < items.length; ++j) { + observer.next(items[j]); + if (done) return; + } observer.complete(); + } + }); + return function () { done = true; }; + }); + } +}); + +hide($Observable.prototype, OBSERVABLE, function () { return this; }); + +$export($export.G, { Observable: $Observable }); + +__webpack_require__(42)('Observable'); + + +/***/ }), +/* 308 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var $task = __webpack_require__(84); +$export($export.G + $export.B, { + setImmediate: $task.set, + clearImmediate: $task.clear +}); + + +/***/ }), +/* 309 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(82); +var global = __webpack_require__(2); +var hide = __webpack_require__(17); +var Iterators = __webpack_require__(36); +var TO_STRING_TAG = __webpack_require__(5)('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; +} + + +/***/ }), +/* 310 */ +/***/ (function(module, exports, __webpack_require__) { + +// ie9- setTimeout & setInterval additional parameters fix +var global = __webpack_require__(2); +var $export = __webpack_require__(0); +var userAgent = __webpack_require__(56); +var slice = [].slice; +var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check +var wrap = function (set) { + return function (fn, time /* , ...args */) { + var boundArgs = arguments.length > 2; + var args = boundArgs ? slice.call(arguments, 2) : false; + return set(boundArgs ? function () { + // eslint-disable-next-line no-new-func + (typeof fn == 'function' ? fn : Function(fn)).apply(this, args); + } : fn, time); + }; +}; +$export($export.G + $export.B + $export.F * MSIE, { + setTimeout: wrap(global.setTimeout), + setInterval: wrap(global.setInterval) +}); + + +/***/ }), +/* 311 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var ctx = __webpack_require__(16); +var $export = __webpack_require__(0); +var createDesc = __webpack_require__(28); +var assign = __webpack_require__(68); +var create = __webpack_require__(32); +var getPrototypeOf = __webpack_require__(13); +var getKeys = __webpack_require__(31); +var dP = __webpack_require__(7); +var keyOf = __webpack_require__(312); +var aFunction = __webpack_require__(10); +var forOf = __webpack_require__(34); +var isIterable = __webpack_require__(122); +var $iterCreate = __webpack_require__(54); +var step = __webpack_require__(83); +var isObject = __webpack_require__(3); +var toIObject = __webpack_require__(11); +var DESCRIPTORS = __webpack_require__(8); +var has = __webpack_require__(15); + +// 0 -> Dict.forEach +// 1 -> Dict.map +// 2 -> Dict.filter +// 3 -> Dict.some +// 4 -> Dict.every +// 5 -> Dict.find +// 6 -> Dict.findKey +// 7 -> Dict.mapPairs +var createDictMethod = function (TYPE) { + var IS_MAP = TYPE == 1; + var IS_EVERY = TYPE == 4; + return function (object, callbackfn, that /* = undefined */) { + var f = ctx(callbackfn, that, 3); + var O = toIObject(object); + var result = IS_MAP || TYPE == 7 || TYPE == 2 + ? new (typeof this == 'function' ? this : Dict)() : undefined; + var key, val, res; + for (key in O) if (has(O, key)) { + val = O[key]; + res = f(val, key, object); + if (TYPE) { + if (IS_MAP) result[key] = res; // map + else if (res) switch (TYPE) { + case 2: result[key] = val; break; // filter + case 3: return true; // some + case 5: return val; // find + case 6: return key; // findKey + case 7: result[res[0]] = res[1]; // mapPairs + } else if (IS_EVERY) return false; // every + } + } + return TYPE == 3 || IS_EVERY ? IS_EVERY : result; + }; +}; +var findKey = createDictMethod(6); + +var createDictIter = function (kind) { + return function (it) { + return new DictIterator(it, kind); + }; +}; +var DictIterator = function (iterated, kind) { + this._t = toIObject(iterated); // target + this._a = getKeys(iterated); // keys + this._i = 0; // next index + this._k = kind; // kind +}; +$iterCreate(DictIterator, 'Dict', function () { + var that = this; + var O = that._t; + var keys = that._a; + var kind = that._k; + var key; + do { + if (that._i >= keys.length) { + that._t = undefined; + return step(1); + } + } while (!has(O, key = keys[that._i++])); + if (kind == 'keys') return step(0, key); + if (kind == 'values') return step(0, O[key]); + return step(0, [key, O[key]]); +}); + +function Dict(iterable) { + var dict = create(null); + if (iterable != undefined) { + if (isIterable(iterable)) { + forOf(iterable, true, function (key, value) { + dict[key] = value; + }); + } else assign(dict, iterable); + } + return dict; +} +Dict.prototype = null; + +function reduce(object, mapfn, init) { + aFunction(mapfn); + var O = toIObject(object); + var keys = getKeys(O); + var length = keys.length; + var i = 0; + var memo, key; + if (arguments.length < 3) { + if (!length) throw TypeError('Reduce of empty object with no initial value'); + memo = O[keys[i++]]; + } else memo = Object(init); + while (length > i) if (has(O, key = keys[i++])) { + memo = mapfn(memo, O[key], key, object); + } + return memo; +} + +function includes(object, el) { + // eslint-disable-next-line no-self-compare + return (el == el ? keyOf(object, el) : findKey(object, function (it) { + // eslint-disable-next-line no-self-compare + return it != it; + })) !== undefined; +} + +function get(object, key) { + if (has(object, key)) return object[key]; +} +function set(object, key, value) { + if (DESCRIPTORS && key in Object) dP.f(object, key, createDesc(0, value)); + else object[key] = value; + return object; +} + +function isDict(it) { + return isObject(it) && getPrototypeOf(it) === Dict.prototype; +} + +$export($export.G + $export.F, { Dict: Dict }); + +$export($export.S, 'Dict', { + keys: createDictIter('keys'), + values: createDictIter('values'), + entries: createDictIter('entries'), + forEach: createDictMethod(0), + map: createDictMethod(1), + filter: createDictMethod(2), + some: createDictMethod(3), + every: createDictMethod(4), + find: createDictMethod(5), + findKey: findKey, + mapPairs: createDictMethod(7), + reduce: reduce, + keyOf: keyOf, + includes: includes, + has: has, + get: get, + set: set, + isDict: isDict +}); + + +/***/ }), +/* 312 */ +/***/ (function(module, exports, __webpack_require__) { + +var getKeys = __webpack_require__(31); +var toIObject = __webpack_require__(11); +module.exports = function (object, el) { + var O = toIObject(object); + var keys = getKeys(O); + var length = keys.length; + var index = 0; + var key; + while (length > index) if (O[key = keys[index++]] === el) return key; +}; + + +/***/ }), +/* 313 */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(1); +var get = __webpack_require__(48); +module.exports = __webpack_require__(12).getIterator = function (it) { + var iterFn = get(it); + if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!'); + return anObject(iterFn.call(it)); +}; + + +/***/ }), +/* 314 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var core = __webpack_require__(12); +var $export = __webpack_require__(0); +var partial = __webpack_require__(123); +// https://esdiscuss.org/topic/promise-returning-delay-function +$export($export.G + $export.F, { + delay: function delay(time) { + return new (core.Promise || global.Promise)(function (resolve) { + setTimeout(partial.call(resolve, true), time); + }); + } +}); + + +/***/ }), +/* 315 */ +/***/ (function(module, exports, __webpack_require__) { + +var path = __webpack_require__(124); +var $export = __webpack_require__(0); + +// Placeholder +__webpack_require__(12)._ = path._ = path._ || {}; + +$export($export.P + $export.F, 'Function', { part: __webpack_require__(123) }); + + +/***/ }), +/* 316 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); + +$export($export.S + $export.F, 'Object', { isObject: __webpack_require__(3) }); + + +/***/ }), +/* 317 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); + +$export($export.S + $export.F, 'Object', { classof: __webpack_require__(37) }); + + +/***/ }), +/* 318 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var define = __webpack_require__(125); + +$export($export.S + $export.F, 'Object', { define: define }); + + +/***/ }), +/* 319 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var define = __webpack_require__(125); +var create = __webpack_require__(32); + +$export($export.S + $export.F, 'Object', { + make: function (proto, mixin) { + return define(create(proto), mixin); + } +}); + + +/***/ }), +/* 320 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +__webpack_require__(53)(Number, 'Number', function (iterated) { + this._l = +iterated; + this._i = 0; +}, function () { + var i = this._i++; + var done = !(i < this._l); + return { done: done, value: done ? undefined : i }; +}); + + +/***/ }), +/* 321 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/benjamingr/RexExp.escape +var $export = __webpack_require__(0); +var $re = __webpack_require__(89)(/[\\^$*+?.()|[\]{}]/g, '\\$&'); + +$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } }); + + +/***/ }), +/* 322 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $re = __webpack_require__(89)(/[&<>"']/g, { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' +}); + +$export($export.P + $export.F, 'String', { escapeHTML: function escapeHTML() { return $re(this); } }); + + +/***/ }), +/* 323 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $re = __webpack_require__(89)(/&(?:amp|lt|gt|quot|apos);/g, { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" +}); + +$export($export.P + $export.F, 'String', { unescapeHTML: function unescapeHTML() { return $re(this); } }); + + +/***/ }) +/******/ ]); +// CommonJS export +if (typeof module != 'undefined' && module.exports) module.exports = __e; +// RequireJS export +else if (typeof define == 'function' && define.amd) define(function () { return __e; }); +// Export to global object +else __g.core = __e; +}(1, 1); \ No newline at end of file diff --git a/node_modules/core-js/client/library.min.js b/node_modules/core-js/client/library.min.js new file mode 100644 index 000000000..f49c0a021 --- /dev/null +++ b/node_modules/core-js/client/library.min.js @@ -0,0 +1,10 @@ +/** + * core-js 2.5.7 + * https://github.com/zloirock/core-js + * License: http://rock.mit-license.org + * © 2018 Denis Pushkarev + */ +!function(e,i,Jt){"use strict";!function(r){var e={};function __webpack_require__(t){if(e[t])return e[t].exports;var n=e[t]={i:t,l:!1,exports:{}};return r[t].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}__webpack_require__.m=r,__webpack_require__.c=e,__webpack_require__.d=function(t,n,r){__webpack_require__.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},__webpack_require__.n=function(t){var n=t&&t.__esModule?function getDefault(){return t["default"]}:function getModuleExports(){return t};return __webpack_require__.d(n,"a",n),n},__webpack_require__.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=126)}([function(t,n,r){var y=r(2),g=r(12),d=r(16),_=r(17),b=r(15),S="prototype",m=function(t,n,r){var e,i,o,u=t&m.F,c=t&m.G,f=t&m.S,a=t&m.P,s=t&m.B,l=t&m.W,h=c?g:g[n]||(g[n]={}),p=h[S],v=c?y:f?y[n]:(y[n]||{})[S];for(e in c&&(r=n),r)(i=!u&&v&&v[e]!==Jt)&&b(h,e)||(o=i?v[e]:r[e],h[e]=c&&"function"!=typeof v[e]?r[e]:s&&i?d(o,y):l&&v[e]==o?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t[S]=e[S],t}(o):a&&"function"==typeof o?d(Function.call,o):o,a&&((h.virtual||(h.virtual={}))[e]=o,t&m.R&&p&&!p[e]&&_(p,e,o)))};m.F=1,m.G=2,m.S=4,m.P=8,m.B=16,m.W=32,m.U=64,m.R=128,t.exports=m},function(t,n,r){var e=r(3);t.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof i&&(i=r)},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},function(t,n,r){var e=r(49)("wks"),i=r(40),o=r(2).Symbol,u="function"==typeof o;(t.exports=function(t){return e[t]||(e[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=e},function(t,n,r){var e=r(22),i=Math.min;t.exports=function(t){return 0"+i+""};t.exports=function(n,t){var r={};r[n]=t(o),e(e.P+e.F*i(function(){var t=""[n]('"');return t!==t.toLowerCase()||3document.F=Object<\/script>"),t.close(),s=t.F;r--;)delete s[a][u[r]];return s()};t.exports=Object.create||function create(t,n){var r;return null!==t?(f[a]=i(t),r=new f,f[a]=null,r[c]=t):r=s(),n===Jt?r:o(r,n)}},function(t,n){t.exports=function(){}},function(t,n,r){var h=r(16),p=r(104),v=r(77),y=r(1),g=r(6),d=r(48),_={},b={};(n=t.exports=function(t,n,r,e,i){var o,u,c,f,a=i?function(){return t}:d(t),s=h(r,e,n?2:1),l=0;if("function"!=typeof a)throw TypeError(t+" is not iterable!");if(v(a)){for(o=g(t.length);l>>=1)&&(n+=n))1&e&&(r+=n);return r}},function(t,n){t.exports="\t\n\x0B\f\r   ᠎              \u2028\u2029\ufeff"},function(t,n){t.exports=Math.sign||function sign(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,n){var r=Math.expm1;t.exports=!r||22025.465794806718>1,s=23===n?I(2,-24)-I(2,-77):0,l=0,h=t<0||0===t&&1/t<0?1:0;for((t=F(t))!=t||t===M?(i=t!=t?1:0,e=f):(e=k(A(t)/j),t*(o=I(2,-e))<1&&(e--,o*=2),2<=(t+=1<=e+a?s/o:s*I(2,1-a))*o&&(e++,o/=2),f<=e+a?(i=0,e=f):1<=e+a?(i=(t*o-1)*I(2,n),e+=a):(i=t*I(2,a-1)*I(2,n),e=0));8<=n;u[l++]=255&i,i/=256,n-=8);for(e=e<>1,c=i-7,f=r-1,a=t[f--],s=127&a;for(a>>=7;0>=-c,c+=n;0>8&255]}function packI32(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function packF64(t){return packIEEE754(t,52,8)}function packF32(t){return packIEEE754(t,23,4)}function addGetter(t,n,r){y(t[S],n,{get:function(){return this[r]}})}function get(t,n,r,e){var i=p(+r);if(t[D]>24)},setUint8:function setUint8(t,n){B.call(this,t,n<<24>>24)}},!0)}else w=function ArrayBuffer(t){s(this,w,_);var n=p(t);this._b=g.call(new Array(n),0),this[D]=n},x=function DataView(t,n,r){s(this,x,b),s(t,w,b);var e=t[D],i=l(n);if(i<0||e>24},getUint8:function getUint8(t){return get(this,1,t)[0]},getInt16:function getInt16(t){var n=get(this,2,t,arguments[1]);return(n[1]<<8|n[0])<<16>>16},getUint16:function getUint16(t){var n=get(this,2,t,arguments[1]);return n[1]<<8|n[0]},getInt32:function getInt32(t){return unpackI32(get(this,4,t,arguments[1]))},getUint32:function getUint32(t){return unpackI32(get(this,4,t,arguments[1]))>>>0},getFloat32:function getFloat32(t){return unpackIEEE754(get(this,4,t,arguments[1]),23,4)},getFloat64:function getFloat64(t){return unpackIEEE754(get(this,8,t,arguments[1]),52,8)},setInt8:function setInt8(t,n){set(this,1,t,packI8,n)},setUint8:function setUint8(t,n){set(this,1,t,packI8,n)},setInt16:function setInt16(t,n){set(this,2,t,packI16,n,arguments[2])},setUint16:function setUint16(t,n){set(this,2,t,packI16,n,arguments[2])},setInt32:function setInt32(t,n){set(this,4,t,packI32,n,arguments[2])},setUint32:function setUint32(t,n){set(this,4,t,packI32,n,arguments[2])},setFloat32:function setFloat32(t,n){set(this,4,t,packF32,n,arguments[2])},setFloat64:function setFloat64(t,n){set(this,8,t,packF64,n,arguments[2])}});d(w,_),d(x,b),c(x[S],u.VIEW,!0),n[_]=w,n[b]=x},function(t,n){t.exports=function(n,r){var e=r===Object(r)?function(t){return r[t]}:r;return function(t){return String(t).replace(n,e)}}},function(t,n,r){t.exports=!r(8)&&!r(4)(function(){return 7!=Object.defineProperty(r(62)("div"),"a",{get:function(){return 7}}).a})},function(t,n,r){n.f=r(5)},function(t,n,r){var u=r(15),c=r(11),f=r(50)(!1),a=r(65)("IE_PROTO");t.exports=function(t,n){var r,e=c(t),i=0,o=[];for(r in e)r!=a&&u(e,r)&&o.push(r);for(;i>>0||(u.test(r)?16:10))}:e},function(t,n){t.exports=Math.log1p||function log1p(t){return-1e-8<(t=+t)&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,n,r){var o=r(72),e=Math.pow,u=e(2,-52),c=e(2,-23),f=e(2,127)*(2-c),a=e(2,-126);t.exports=Math.fround||function fround(t){var n,r,e=Math.abs(t),i=o(t);return e>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,n,r){var e=r(0),i=Math.exp;e(e.S,"Math",{cosh:function cosh(t){return(i(t=+t)+i(-t))/2}})},function(t,n,r){var e=r(0),i=r(73);e(e.S+e.F*(i!=Math.expm1),"Math",{expm1:i})},function(t,n,r){var e=r(0);e(e.S,"Math",{fround:r(102)})},function(t,n,r){var e=r(0),f=Math.abs;e(e.S,"Math",{hypot:function hypot(t,n){for(var r,e,i=0,o=0,u=arguments.length,c=0;o>>16)*u+o*(r&i>>>16)<<16>>>0)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{log10:function log10(t){return Math.log(t)*Math.LOG10E}})},function(t,n,r){var e=r(0);e(e.S,"Math",{log1p:r(101)})},function(t,n,r){var e=r(0);e(e.S,"Math",{log2:function log2(t){return Math.log(t)/Math.LN2}})},function(t,n,r){var e=r(0);e(e.S,"Math",{sign:r(72)})},function(t,n,r){var e=r(0),i=r(73),o=Math.exp;e(e.S+e.F*r(4)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function sinh(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},function(t,n,r){var e=r(0),i=r(73),o=Math.exp;e(e.S,"Math",{tanh:function tanh(t){var n=i(t=+t),r=i(-t);return n==Infinity?1:r==Infinity?-1:(n-r)/(o(t)+o(-t))}})},function(t,n,r){var e=r(0);e(e.S,"Math",{trunc:function trunc(t){return(0>10),n%1024+56320))}return r.join("")}})},function(t,n,r){var e=r(0),u=r(11),c=r(6);e(e.S,"String",{raw:function raw(t){for(var n=u(t.raw),r=c(n.length),e=arguments.length,i=[],o=0;o>>0,o=r>>>0;return(n>>>0)+(e>>>0)+((i&o|(i|o)&~(i+o>>>0))>>>31)|0}})},function(t,n,r){var e=r(0);e(e.S,"Math",{isubh:function isubh(t,n,r,e){var i=t>>>0,o=r>>>0;return(n>>>0)-(e>>>0)-((~i&o|~(i^o)&i-o>>>0)>>>31)|0}})},function(t,n,r){var e=r(0);e(e.S,"Math",{imulh:function imulh(t,n){var r=+t,e=+n,i=65535&r,o=65535&e,u=r>>16,c=e>>16,f=(u*o>>>0)+(i*o>>>16);return u*c+(f>>16)+((i*c>>>0)+(65535&f)>>16)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{RAD_PER_DEG:180/Math.PI})},function(t,n,r){var e=r(0),i=Math.PI/180;e(e.S,"Math",{radians:function radians(t){return t*i}})},function(t,n,r){var e=r(0);e(e.S,"Math",{scale:r(121)})},function(t,n,r){var e=r(0);e(e.S,"Math",{umulh:function umulh(t,n){var r=+t,e=+n,i=65535&r,o=65535&e,u=r>>>16,c=e>>>16,f=(u*o>>>0)+(i*o>>>16);return u*c+(f>>>16)+((i*c>>>0)+(65535&f)>>>16)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{signbit:function signbit(t){return(t=+t)!=t?t:0==t?1/t==Infinity:0"']/g,{"&":"&","<":"<",">":">",'"':""","'":"'"});e(e.P+e.F,"String",{escapeHTML:function escapeHTML(){return i(this)}})},function(t,n,r){var e=r(0),i=r(89)(/&(?:amp|lt|gt|quot|apos);/g,{"&":"&","<":"<",">":">",""":'"',"'":"'"});e(e.P+e.F,"String",{unescapeHTML:function unescapeHTML(){return i(this)}})}]),"undefined"!=typeof module&&module.exports?module.exports=e:"function"==typeof define&&define.amd?define(function(){return e}):i.core=e}(1,1); +//# sourceMappingURL=library.min.js.map \ No newline at end of file diff --git a/node_modules/core-js/client/library.min.js.map b/node_modules/core-js/client/library.min.js.map new file mode 100644 index 000000000..eda6ec32c --- /dev/null +++ b/node_modules/core-js/client/library.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["library.js"],"names":["__e","__g","undefined","modules","installedModules","__webpack_require__","moduleId","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","getDefault","getModuleExports","object","property","prototype","hasOwnProperty","p","s","global","core","ctx","hide","has","PROTOTYPE","$export","type","source","key","own","out","IS_FORCED","F","IS_GLOBAL","G","IS_STATIC","S","IS_PROTO","P","IS_BIND","B","IS_WRAP","W","expProto","target","C","a","b","this","arguments","length","apply","Function","virtual","R","U","isObject","it","TypeError","window","Math","self","exec","e","store","uid","Symbol","USE_SYMBOL","toInteger","min","anObject","IE8_DOM_DEFINE","toPrimitive","dP","f","O","Attributes","value","defined","IObject","version","toObject","IE_PROTO","ObjectProto","getPrototypeOf","constructor","fails","quot","createHTML","string","tag","attribute","String","p1","replace","NAME","test","toLowerCase","split","aFunction","fn","that","createDesc","pIE","toIObject","gOPD","getOwnPropertyDescriptor","method","arg","toLength","asc","TYPE","$create","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","create","$this","callbackfn","val","res","index","result","push","toString","slice","ceil","floor","isNaN","KEY","exp","LIBRARY","$typed","$buffer","anInstance","propertyDesc","redefineAll","toIndex","toAbsoluteIndex","classof","isArrayIter","gOPN","getIterFn","wks","createArrayMethod","createArrayIncludes","speciesConstructor","ArrayIterators","Iterators","$iterDetect","setSpecies","arrayFill","arrayCopyWithin","$DP","$GOPD","RangeError","Uint8Array","ARRAY_BUFFER","SHARED_BUFFER","BYTES_PER_ELEMENT","ArrayProto","Array","$ArrayBuffer","ArrayBuffer","$DataView","DataView","arrayForEach","arrayFilter","arraySome","arrayEvery","arrayFind","arrayFindIndex","arrayIncludes","arrayIndexOf","arrayValues","values","arrayKeys","keys","arrayEntries","entries","arrayLastIndexOf","lastIndexOf","arrayReduce","reduce","arrayReduceRight","reduceRight","arrayJoin","join","arraySort","sort","arraySlice","arrayToString","arrayToLocaleString","toLocaleString","ITERATOR","TAG","TYPED_CONSTRUCTOR","DEF_CONSTRUCTOR","ALL_CONSTRUCTORS","CONSTR","TYPED_ARRAY","TYPED","VIEW","WRONG_LENGTH","$map","allocate","LITTLE_ENDIAN","Uint16Array","buffer","FORCED_SET","set","toOffset","BYTES","offset","validate","speciesFromList","list","fromList","addGetter","internal","_d","$from","from","step","iterator","aLen","mapfn","mapping","iterFn","next","done","$of","of","TO_LOCALE_BUG","$toLocaleString","proto","copyWithin","start","every","fill","filter","find","predicate","findIndex","forEach","indexOf","searchElement","includes","separator","map","reverse","middle","some","comparefn","subarray","begin","end","$begin","byteOffset","$slice","$set","arrayLike","src","len","$iterators","isTAIndex","$getDesc","$setDesc","desc","writable","$TypedArrayPrototype$","wrapper","CLAMPED","GETTER","SETTER","TypedArray","Base","TAC","TypedArrayPrototype","addElement","data","v","round","ABV","$offset","$length","byteLength","klass","$len","iter","concat","$nativeIterator","CORRECT_ITER_NAME","$iterator","Map","shared","getOrCreateMetadataMap","targetKey","targetMetadata","keyMetadata","MetadataKey","metadataMap","MetadataValue","_","valueOf","bitmap","META","setDesc","id","isExtensible","FREEZE","preventExtensions","setMeta","w","meta","NEED","fastKey","getWeak","onFreeze","$keys","enumBugKeys","dPs","Empty","createDict","iframeDocument","iframe","style","display","appendChild","contentWindow","document","open","write","lt","close","Properties","BREAK","RETURN","iterable","max","cof","ARG","T","tryGet","callee","Constructor","forbiddenField","safe","px","random","def","stat","DESCRIPTORS","SPECIES","_t","propertyIsEnumerable","hiddenKeys","getOwnPropertyNames","spaces","space","ltrim","RegExp","rtrim","exporter","ALIAS","FORCE","trim","getIteratorMethod","SHARED","mode","copyright","IS_INCLUDES","el","fromIndex","getOwnPropertySymbols","isArray","redefine","$iterCreate","setToStringTag","BUGGY","VALUES","returnThis","DEFAULT","IS_SET","FORCED","methods","IteratorPrototype","getMethod","kind","DEF_VALUES","VALUES_BUG","$native","$default","$entries","$anyNative","descriptor","D","navigator","userAgent","forOf","each","common","IS_WEAK","ADDER","_c","IS_ADDER","size","getConstructor","setStrong","Typed","TypedArrayConstructors","K","__defineSetter__","COLLECTION","A","cb","mapFn","nextItem","is","createElement","wksExt","$Symbol","charAt","documentElement","getKeys","gOPS","$assign","assign","k","getSymbols","isEnum","j","args","un","repeat","count","str","Infinity","sign","x","$expm1","expm1","TO_STRING","pos","charCodeAt","isRegExp","searchString","MATCH","re","$defineProperty","SAFE_CLOSING","riter","skipClosing","arr","original","endPos","addToUnscopables","iterated","_i","_k","Arguments","defer","channel","port","invoke","html","cel","process","setTask","setImmediate","clearTask","clearImmediate","MessageChannel","Dispatch","counter","queue","ONREADYSTATECHANGE","run","listener","event","nextTick","now","port2","port1","onmessage","postMessage","addEventListener","importScripts","removeChild","setTimeout","clear","macrotask","Observer","MutationObserver","WebKitMutationObserver","Promise","isNode","head","last","notify","flush","parent","domain","exit","enter","standalone","resolve","promise","then","toggle","node","createTextNode","observe","characterData","task","PromiseCapability","reject","$$resolve","$$reject","Reflect","ownKeys","DATA_VIEW","WRONG_INDEX","BaseBuffer","abs","pow","log","LN2","BYTE_LENGTH","BYTE_OFFSET","$BUFFER","$LENGTH","$OFFSET","packIEEE754","mLen","nBytes","eLen","eMax","eBias","rt","unpackIEEE754","nBits","NaN","unpackI32","bytes","packI8","packI16","packI32","packF64","packF32","view","isLittleEndian","intIndex","pack","_b","conversion","ArrayBufferProto","$setInt8","setInt8","getInt8","setUint8","bufferLength","getUint8","getInt16","getUint16","getInt32","getUint32","getFloat32","getFloat64","setInt16","setUint16","setInt32","setUint32","setFloat32","setFloat64","regExp","replacer","part","names","defineProperties","windowNames","getWindowNames","check","setPrototypeOf","buggy","__proto__","factories","bind","partArgs","bound","construct","msg","isInteger","isFinite","$parseFloat","parseFloat","$trim","$parseInt","parseInt","ws","hex","radix","log1p","EPSILON","EPSILON32","MAX32","MIN32","fround","$abs","$sign","ret","memo","isRight","to","inc","newPromiseCapability","promiseCapability","strong","entry","getEntry","$iterDefine","SIZE","_f","_l","r","delete","prev","Set","add","InternalMap","weak","WEAK_MAP","uncaughtFrozenStore","ufstore","tmp","WeakMap","$WeakMap","freeze","$has","UncaughtFrozenStore","findUncaughtFrozen","splice","getTime","Date","$toISOString","toISOString","lz","num","y","getUTCFullYear","getUTCMilliseconds","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","number","IS_CONCAT_SPREADABLE","flattenIntoArray","sourceLen","depth","mapper","thisArg","element","spreadable","targetIndex","sourceIndex","maxLength","fillString","left","stringLength","fillStr","intMaxLength","fillLen","stringFiller","isEntries","toJSON","scale","inLow","inHigh","outLow","outHigh","isIterable","path","pargs","holder","define","mixin","$fails","wksDefine","enumKeys","_create","gOPNExt","$JSON","JSON","_stringify","stringify","HIDDEN","TO_PRIMITIVE","SymbolRegistry","AllSymbols","OPSymbols","USE_NATIVE","QObject","setter","findChild","setSymbolDesc","protoDesc","wrap","sym","isSymbol","$defineProperties","$propertyIsEnumerable","E","$getOwnPropertyDescriptor","$getOwnPropertyNames","$getOwnPropertySymbols","IS_OP","es6Symbols","wellKnownSymbols","for","keyFor","useSetter","useSimple","$replacer","symbols","$getPrototypeOf","$freeze","$seal","seal","$preventExtensions","$isFrozen","isFrozen","$isSealed","isSealed","$isExtensible","HAS_INSTANCE","FunctionProto","aNumberValue","$toFixed","toFixed","ERROR","multiply","c2","divide","numToString","t","acc","fractionDigits","z","x2","$toPrecision","toPrecision","precision","_isFinite","isSafeInteger","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","Number","sqrt","$acosh","acosh","MAX_VALUE","$asinh","asinh","$atanh","atanh","cbrt","clz32","LOG2E","cosh","hypot","value1","value2","div","sum","larg","$imul","imul","UINT16","xn","yn","xl","yl","log10","LOG10E","log2","sinh","tanh","trunc","fromCharCode","$fromCodePoint","fromCodePoint","code","raw","callSite","tpl","$at","codePointAt","context","ENDS_WITH","$endsWith","endsWith","endPosition","search","INCLUDES","STARTS_WITH","$startsWith","startsWith","point","anchor","big","blink","bold","fixed","fontcolor","color","fontsize","italics","link","url","small","strike","sub","sup","createProperty","upTo","cloned","$sort","$forEach","STRICT","$filter","$some","$every","$reduce","$indexOf","NEGATIVE_ZERO","$find","forced","Internal","newGenericPromiseCapability","OwnPromiseCapability","Wrapper","microtask","newPromiseCapabilityModule","perform","promiseResolve","PROMISE","versions","v8","$Promise","empty","FakePromise","PromiseRejectionEvent","isThenable","isReject","_n","chain","_v","ok","_s","reaction","exited","handler","fail","_h","onHandleUnhandled","onUnhandled","console","unhandled","isUnhandled","emit","onunhandledrejection","reason","error","_a","onrejectionhandled","$reject","_w","$resolve","executor","err","onFulfilled","onRejected","catch","capability","all","remaining","$index","alreadyCalled","race","WEAK_SET","WeakSet","rApply","fApply","thisArgument","argumentsList","L","rConstruct","NEW_TARGET_BUG","ARGS_BUG","Target","newTarget","$args","instance","propertyKey","attributes","deleteProperty","Enumerate","enumerate","receiver","getProto","V","existingDescriptor","ownDesc","setProto","pv","$isView","isView","first","fin","viewS","viewT","init","Int8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint32Array","Float32Array","Float64Array","$includes","arraySpeciesCreate","flatMap","flatten","depthArg","at","$pad","padStart","padEnd","trimLeft","trimRight","getFlags","RegExpProto","$RegExpStringIterator","regexp","_r","match","matchAll","flags","rx","lastIndex","ignoreCase","multiline","unicode","sticky","getOwnPropertyDescriptors","getDesc","$values","__defineGetter__","__lookupGetter__","__lookupSetter__","isError","clamp","lower","upper","DEG_PER_RAD","PI","RAD_PER_DEG","degrees","radians","fscale","iaddh","x0","x1","y0","y1","$x0","$y0","isubh","imulh","u","$u","$v","u0","v0","u1","v1","umulh","signbit","finally","onFinally","isFunction","try","metadata","toMetaKey","ordinaryDefineOwnMetadata","defineMetadata","metadataKey","metadataValue","deleteMetadata","ordinaryHasOwnMetadata","ordinaryGetOwnMetadata","ordinaryGetMetadata","getMetadata","ordinaryOwnMetadataKeys","ordinaryMetadataKeys","oKeys","pKeys","getMetadataKeys","getOwnMetadata","getOwnMetadataKeys","ordinaryHasMetadata","hasMetadata","hasOwnMetadata","$metadata","decorator","asap","OBSERVABLE","cleanupSubscription","subscription","cleanup","subscriptionClosed","_o","closeSubscription","Subscription","observer","subscriber","SubscriptionObserver","unsubscribe","complete","$Observable","Observable","subscribe","observable","items","$task","TO_STRING_TAG","DOMIterables","Collection","MSIE","time","boundArgs","setInterval","keyOf","createDictMethod","Dict","findKey","createDictIter","DictIterator","dict","mapPairs","isDict","getIterator","partial","delay","make","$re","escape","&","<",">","\"","'","escapeHTML","&","<",">",""","'","unescapeHTML","amd"],"mappings":";;;;;;CAMC,SAASA,EAAKC,EAAKC,IACpB,cACS,SAAUC,GAET,IAAIC,EAAmB,GAGvB,SAASC,oBAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAJ,EAAQG,GAAUK,KAAKH,EAAOD,QAASC,EAAQA,EAAOD,QAASF,qBAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,oBAAoBO,EAAIT,EAGxBE,oBAAoBQ,EAAIT,EAGxBC,oBAAoBS,EAAI,SAASP,EAASQ,EAAMC,GAC3CX,oBAAoBY,EAAEV,EAASQ,IAClCG,OAAOC,eAAeZ,EAASQ,EAAM,CACpCK,cAAc,EACdC,YAAY,EACZC,IAAKN,KAMRX,oBAAoBkB,EAAI,SAASf,GAChC,IAAIQ,EAASR,GAAUA,EAAOgB,WAC7B,SAASC,aAAe,OAAOjB,EAAgB,YAC/C,SAASkB,mBAAqB,OAAOlB,GAEtC,OADAH,oBAAoBS,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRX,oBAAoBY,EAAI,SAASU,EAAQC,GAAY,OAAOV,OAAOW,UAAUC,eAAenB,KAAKgB,EAAQC,IAGzGvB,oBAAoB0B,EAAI,GAGjB1B,oBAAoBA,oBAAoB2B,EAAI,KA9DpD,CAiEC,CAEJ,SAAUxB,EAAQD,EAASF,GAEjC,IAAI4B,EAAS5B,EAAoB,GAC7B6B,EAAO7B,EAAoB,IAC3B8B,EAAM9B,EAAoB,IAC1B+B,EAAO/B,EAAoB,IAC3BgC,EAAMhC,EAAoB,IAC1BiC,EAAY,YAEZC,EAAU,SAAUC,EAAMzB,EAAM0B,GAClC,IASIC,EAAKC,EAAKC,EATVC,EAAYL,EAAOD,EAAQO,EAC3BC,EAAYP,EAAOD,EAAQS,EAC3BC,EAAYT,EAAOD,EAAQW,EAC3BC,EAAWX,EAAOD,EAAQa,EAC1BC,EAAUb,EAAOD,EAAQe,EACzBC,EAAUf,EAAOD,EAAQiB,EACzBjD,EAAUwC,EAAYb,EAAOA,EAAKnB,KAAUmB,EAAKnB,GAAQ,IACzD0C,EAAWlD,EAAQ+B,GACnBoB,EAASX,EAAYd,EAASgB,EAAYhB,EAAOlB,IAASkB,EAAOlB,IAAS,IAAIuB,GAGlF,IAAKI,KADDK,IAAWN,EAAS1B,GACZ0B,GAEVE,GAAOE,GAAaa,GAAUA,EAAOhB,KAASxC,KACnCmC,EAAI9B,EAASmC,KAExBE,EAAMD,EAAMe,EAAOhB,GAAOD,EAAOC,GAEjCnC,EAAQmC,GAAOK,GAAmC,mBAAfW,EAAOhB,GAAqBD,EAAOC,GAEpEW,GAAWV,EAAMR,EAAIS,EAAKX,GAE1BsB,GAAWG,EAAOhB,IAAQE,EAAM,SAAWe,GAC3C,IAAIb,EAAI,SAAUc,EAAGC,EAAGhD,GACtB,GAAIiD,gBAAgBH,EAAG,CACrB,OAAQI,UAAUC,QAChB,KAAK,EAAG,OAAO,IAAIL,EACnB,KAAK,EAAG,OAAO,IAAIA,EAAEC,GACrB,KAAK,EAAG,OAAO,IAAID,EAAEC,EAAGC,GACxB,OAAO,IAAIF,EAAEC,EAAGC,EAAGhD,GACrB,OAAO8C,EAAEM,MAAMH,KAAMC,YAGzB,OADAjB,EAAER,GAAaqB,EAAErB,GACVQ,EAXyB,CAa/BF,GAAOO,GAA0B,mBAAPP,EAAoBT,EAAI+B,SAASvD,KAAMiC,GAAOA,EAEvEO,KACD5C,EAAQ4D,UAAY5D,EAAQ4D,QAAU,KAAKzB,GAAOE,EAE/CJ,EAAOD,EAAQ6B,GAAKX,IAAaA,EAASf,IAAMN,EAAKqB,EAAUf,EAAKE,MAK9EL,EAAQO,EAAI,EACZP,EAAQS,EAAI,EACZT,EAAQW,EAAI,EACZX,EAAQa,EAAI,EACZb,EAAQe,EAAI,GACZf,EAAQiB,EAAI,GACZjB,EAAQ8B,EAAI,GACZ9B,EAAQ6B,EAAI,IACZ5D,EAAOD,QAAUgC,GAKX,SAAU/B,EAAQD,EAASF,GAEjC,IAAIiE,EAAWjE,EAAoB,GACnCG,EAAOD,QAAU,SAAUgE,GACzB,IAAKD,EAASC,GAAK,MAAMC,UAAUD,EAAK,sBACxC,OAAOA,IAMH,SAAU/D,EAAQD,GAGxB,IAAI0B,EAASzB,EAAOD,QAA2B,oBAAVkE,QAAyBA,OAAOC,MAAQA,KACzED,OAAwB,oBAARE,MAAuBA,KAAKD,MAAQA,KAAOC,KAE3DT,SAAS,cAATA,GACc,iBAAPjE,IAAiBA,EAAMgC,IAK5B,SAAUzB,EAAQD,GAExBC,EAAOD,QAAU,SAAUgE,GACzB,MAAqB,iBAAPA,EAAyB,OAAPA,EAA4B,mBAAPA,IAMjD,SAAU/D,EAAQD,GAExBC,EAAOD,QAAU,SAAUqE,GACzB,IACE,QAASA,IACT,MAAOC,GACP,OAAO,KAOL,SAAUrE,EAAQD,EAASF,GAEjC,IAAIyE,EAAQzE,EAAoB,GAApBA,CAAwB,OAChC0E,EAAM1E,EAAoB,IAC1B2E,EAAS3E,EAAoB,GAAG2E,OAChCC,EAA8B,mBAAVD,GAETxE,EAAOD,QAAU,SAAUQ,GACxC,OAAO+D,EAAM/D,KAAU+D,EAAM/D,GAC3BkE,GAAcD,EAAOjE,KAAUkE,EAAaD,EAASD,GAAK,UAAYhE,MAGjE+D,MAAQA,GAKX,SAAUtE,EAAQD,EAASF,GAGjC,IAAI6E,EAAY7E,EAAoB,IAChC8E,EAAMT,KAAKS,IACf3E,EAAOD,QAAU,SAAUgE,GACzB,OAAY,EAALA,EAASY,EAAID,EAAUX,GAAK,kBAAoB,IAMnD,SAAU/D,EAAQD,EAASF,GAEjC,IAAI+E,EAAW/E,EAAoB,GAC/BgF,EAAiBhF,EAAoB,IACrCiF,EAAcjF,EAAoB,IAClCkF,EAAKrE,OAAOC,eAEhBZ,EAAQiF,EAAInF,EAAoB,GAAKa,OAAOC,eAAiB,SAASA,eAAesE,EAAGrC,EAAGsC,GAIzF,GAHAN,EAASK,GACTrC,EAAIkC,EAAYlC,GAAG,GACnBgC,EAASM,GACLL,EAAgB,IAClB,OAAOE,EAAGE,EAAGrC,EAAGsC,GAChB,MAAOb,IACT,GAAI,QAASa,GAAc,QAASA,EAAY,MAAMlB,UAAU,4BAEhE,MADI,UAAWkB,IAAYD,EAAErC,GAAKsC,EAAWC,OACtCF,IAMH,SAAUjF,EAAQD,EAASF,GAGjCG,EAAOD,SAAWF,EAAoB,EAApBA,CAAuB,WACvC,OAA+E,GAAxEa,OAAOC,eAAe,GAAI,IAAK,CAAEG,IAAK,WAAc,OAAO,KAAQsC,KAMtE,SAAUpD,EAAQD,EAASF,GAGjC,IAAIuF,EAAUvF,EAAoB,IAClCG,EAAOD,QAAU,SAAUgE,GACzB,OAAOrD,OAAO0E,EAAQrB,MAMlB,SAAU/D,EAAQD,GAExBC,EAAOD,QAAU,SAAUgE,GACzB,GAAiB,mBAANA,EAAkB,MAAMC,UAAUD,EAAK,uBAClD,OAAOA,IAMH,SAAU/D,EAAQD,EAASF,GAGjC,IAAIwF,EAAUxF,EAAoB,IAC9BuF,EAAUvF,EAAoB,IAClCG,EAAOD,QAAU,SAAUgE,GACzB,OAAOsB,EAAQD,EAAQrB,MAMnB,SAAU/D,EAAQD,GAExB,IAAI2B,EAAO1B,EAAOD,QAAU,CAAEuF,QAAS,SACrB,iBAAP9F,IAAiBA,EAAMkC,IAK5B,SAAU1B,EAAQD,EAASF,GAGjC,IAAIgC,EAAMhC,EAAoB,IAC1B0F,EAAW1F,EAAoB,GAC/B2F,EAAW3F,EAAoB,GAApBA,CAAwB,YACnC4F,EAAc/E,OAAOW,UAEzBrB,EAAOD,QAAUW,OAAOgF,gBAAkB,SAAUT,GAElD,OADAA,EAAIM,EAASN,GACTpD,EAAIoD,EAAGO,GAAkBP,EAAEO,GACH,mBAAjBP,EAAEU,aAA6BV,aAAaA,EAAEU,YAChDV,EAAEU,YAAYtE,UACd4D,aAAavE,OAAS+E,EAAc,OAMzC,SAAUzF,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B+F,EAAQ/F,EAAoB,GAC5BuF,EAAUvF,EAAoB,IAC9BgG,EAAO,KAEPC,EAAa,SAAUC,EAAQC,EAAKC,EAAWd,GACjD,IAAIzC,EAAIwD,OAAOd,EAAQW,IACnBI,EAAK,IAAMH,EAEf,MADkB,KAAdC,IAAkBE,GAAM,IAAMF,EAAY,KAAOC,OAAOf,GAAOiB,QAAQP,EAAM,UAAY,KACtFM,EAAK,IAAMzD,EAAI,KAAOsD,EAAM,KAErChG,EAAOD,QAAU,SAAUsG,EAAMjC,GAC/B,IAAIa,EAAI,GACRA,EAAEoB,GAAQjC,EAAK0B,GACf/D,EAAQA,EAAQa,EAAIb,EAAQO,EAAIsD,EAAM,WACpC,IAAIU,EAAO,GAAGD,GAAM,KACpB,OAAOC,IAASA,EAAKC,eAA0C,EAAzBD,EAAKE,MAAM,KAAKhD,SACpD,SAAUyB,KAMV,SAAUjF,EAAQD,GAExB,IAAIuB,EAAiB,GAAGA,eACxBtB,EAAOD,QAAU,SAAUgE,EAAI7B,GAC7B,OAAOZ,EAAenB,KAAK4D,EAAI7B,KAM3B,SAAUlC,EAAQD,EAASF,GAGjC,IAAI4G,EAAY5G,EAAoB,IACpCG,EAAOD,QAAU,SAAU2G,EAAIC,EAAMnD,GAEnC,GADAiD,EAAUC,GACNC,IAASjH,GAAW,OAAOgH,EAC/B,OAAQlD,GACN,KAAK,EAAG,OAAO,SAAUJ,GACvB,OAAOsD,EAAGvG,KAAKwG,EAAMvD,IAEvB,KAAK,EAAG,OAAO,SAAUA,EAAGC,GAC1B,OAAOqD,EAAGvG,KAAKwG,EAAMvD,EAAGC,IAE1B,KAAK,EAAG,OAAO,SAAUD,EAAGC,EAAGhD,GAC7B,OAAOqG,EAAGvG,KAAKwG,EAAMvD,EAAGC,EAAGhD,IAG/B,OAAO,WACL,OAAOqG,EAAGjD,MAAMkD,EAAMpD,cAOpB,SAAUvD,EAAQD,EAASF,GAEjC,IAAIkF,EAAKlF,EAAoB,GACzB+G,EAAa/G,EAAoB,IACrCG,EAAOD,QAAUF,EAAoB,GAAK,SAAUsB,EAAQe,EAAKiD,GAC/D,OAAOJ,EAAGC,EAAE7D,EAAQe,EAAK0E,EAAW,EAAGzB,KACrC,SAAUhE,EAAQe,EAAKiD,GAEzB,OADAhE,EAAOe,GAAOiD,EACPhE,IAMH,SAAUnB,EAAQD,EAASF,GAEjC,IAAIgH,EAAMhH,EAAoB,IAC1B+G,EAAa/G,EAAoB,IACjCiH,EAAYjH,EAAoB,IAChCiF,EAAcjF,EAAoB,IAClCgC,EAAMhC,EAAoB,IAC1BgF,EAAiBhF,EAAoB,IACrCkH,EAAOrG,OAAOsG,yBAElBjH,EAAQiF,EAAInF,EAAoB,GAAKkH,EAAO,SAASC,yBAAyB/B,EAAGrC,GAG/E,GAFAqC,EAAI6B,EAAU7B,GACdrC,EAAIkC,EAAYlC,GAAG,GACfiC,EAAgB,IAClB,OAAOkC,EAAK9B,EAAGrC,GACf,MAAOyB,IACT,GAAIxC,EAAIoD,EAAGrC,GAAI,OAAOgE,GAAYC,EAAI7B,EAAE7E,KAAK8E,EAAGrC,GAAIqC,EAAErC,MAMlD,SAAU5C,EAAQD,EAASF,GAIjC,IAAI+F,EAAQ/F,EAAoB,GAEhCG,EAAOD,QAAU,SAAUkH,EAAQC,GACjC,QAASD,GAAUrB,EAAM,WAEvBsB,EAAMD,EAAO9G,KAAK,KAAM,aAA6B,GAAK8G,EAAO9G,KAAK,UAOpE,SAAUH,EAAQD,EAASF,GASjC,IAAI8B,EAAM9B,EAAoB,IAC1BwF,EAAUxF,EAAoB,IAC9B0F,EAAW1F,EAAoB,GAC/BsH,EAAWtH,EAAoB,GAC/BuH,EAAMvH,EAAoB,IAC9BG,EAAOD,QAAU,SAAUsH,EAAMC,GAC/B,IAAIC,EAAiB,GAARF,EACTG,EAAoB,GAARH,EACZI,EAAkB,GAARJ,EACVK,EAAmB,GAARL,EACXM,EAAwB,GAARN,EAChBO,EAAmB,GAARP,GAAaM,EACxBE,EAASP,GAAWF,EACxB,OAAO,SAAUU,EAAOC,EAAYpB,GAQlC,IAPA,IAMIqB,EAAKC,EANLhD,EAAIM,EAASuC,GACb3D,EAAOkB,EAAQJ,GACfD,EAAIrD,EAAIoG,EAAYpB,EAAM,GAC1BnD,EAAS2D,EAAShD,EAAKX,QACvB0E,EAAQ,EACRC,EAASZ,EAASM,EAAOC,EAAOtE,GAAUgE,EAAYK,EAAOC,EAAO,GAAKpI,GAE9DwI,EAAT1E,EAAgB0E,IAAS,IAAIN,GAAYM,KAAS/D,KAEtD8D,EAAMjD,EADNgD,EAAM7D,EAAK+D,GACEA,EAAOjD,GAChBoC,GACF,GAAIE,EAAQY,EAAOD,GAASD,OACvB,GAAIA,EAAK,OAAQZ,GACpB,KAAK,EAAG,OAAO,EACf,KAAK,EAAG,OAAOW,EACf,KAAK,EAAG,OAAOE,EACf,KAAK,EAAGC,EAAOC,KAAKJ,QACf,GAAIN,EAAU,OAAO,EAGhC,OAAOC,GAAiB,EAAIF,GAAWC,EAAWA,EAAWS,KAO3D,SAAUnI,EAAQD,GAExB,IAAIsI,EAAW,GAAGA,SAElBrI,EAAOD,QAAU,SAAUgE,GACzB,OAAOsE,EAASlI,KAAK4D,GAAIuE,MAAM,GAAI,KAM/B,SAAUtI,EAAQD,GAGxB,IAAIwI,EAAOrE,KAAKqE,KACZC,EAAQtE,KAAKsE,MACjBxI,EAAOD,QAAU,SAAUgE,GACzB,OAAO0E,MAAM1E,GAAMA,GAAM,GAAU,EAALA,EAASyE,EAAQD,GAAMxE,KAMjD,SAAU/D,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B6B,EAAO7B,EAAoB,IAC3B+F,EAAQ/F,EAAoB,GAChCG,EAAOD,QAAU,SAAU2I,EAAKtE,GAC9B,IAAIsC,GAAMhF,EAAKhB,QAAU,IAAIgI,IAAQhI,OAAOgI,GACxCC,EAAM,GACVA,EAAID,GAAOtE,EAAKsC,GAChB3E,EAAQA,EAAQW,EAAIX,EAAQO,EAAIsD,EAAM,WAAcc,EAAG,KAAQ,SAAUiC,KAMrE,SAAU3I,EAAQD,GAGxBC,EAAOD,QAAU,SAAUgE,GACzB,GAAIA,GAAMrE,GAAW,MAAMsE,UAAU,yBAA2BD,GAChE,OAAOA,IAMH,SAAU/D,EAAQD,EAASF,GAIjC,GAAIA,EAAoB,GAAI,CAC1B,IAAI+I,EAAU/I,EAAoB,IAC9B4B,EAAS5B,EAAoB,GAC7B+F,EAAQ/F,EAAoB,GAC5BkC,EAAUlC,EAAoB,GAC9BgJ,EAAShJ,EAAoB,IAC7BiJ,EAAUjJ,EAAoB,IAC9B8B,EAAM9B,EAAoB,IAC1BkJ,EAAalJ,EAAoB,IACjCmJ,EAAenJ,EAAoB,IACnC+B,EAAO/B,EAAoB,IAC3BoJ,EAAcpJ,EAAoB,IAClC6E,EAAY7E,EAAoB,IAChCsH,EAAWtH,EAAoB,GAC/BqJ,EAAUrJ,EAAoB,KAC9BsJ,EAAkBtJ,EAAoB,IACtCiF,EAAcjF,EAAoB,IAClCgC,EAAMhC,EAAoB,IAC1BuJ,EAAUvJ,EAAoB,IAC9BiE,EAAWjE,EAAoB,GAC/B0F,EAAW1F,EAAoB,GAC/BwJ,EAAcxJ,EAAoB,IAClCgI,EAAShI,EAAoB,IAC7B6F,EAAiB7F,EAAoB,IACrCyJ,EAAOzJ,EAAoB,IAAImF,EAC/BuE,EAAY1J,EAAoB,IAChC0E,EAAM1E,EAAoB,IAC1B2J,EAAM3J,EAAoB,GAC1B4J,EAAoB5J,EAAoB,IACxC6J,EAAsB7J,EAAoB,IAC1C8J,EAAqB9J,EAAoB,IACzC+J,EAAiB/J,EAAoB,IACrCgK,EAAYhK,EAAoB,IAChCiK,EAAcjK,EAAoB,IAClCkK,EAAalK,EAAoB,IACjCmK,EAAYnK,EAAoB,IAChCoK,EAAkBpK,EAAoB,KACtCqK,EAAMrK,EAAoB,GAC1BsK,EAAQtK,EAAoB,IAC5BkF,EAAKmF,EAAIlF,EACT+B,EAAOoD,EAAMnF,EACboF,EAAa3I,EAAO2I,WACpBpG,EAAYvC,EAAOuC,UACnBqG,EAAa5I,EAAO4I,WACpBC,EAAe,cACfC,EAAgB,SAAWD,EAC3BE,EAAoB,oBACpB1I,EAAY,YACZ2I,EAAaC,MAAM5I,GACnB6I,EAAe7B,EAAQ8B,YACvBC,EAAY/B,EAAQgC,SACpBC,EAAetB,EAAkB,GACjCuB,GAAcvB,EAAkB,GAChCwB,GAAYxB,EAAkB,GAC9ByB,GAAazB,EAAkB,GAC/B0B,GAAY1B,EAAkB,GAC9B2B,GAAiB3B,EAAkB,GACnC4B,GAAgB3B,GAAoB,GACpC4B,GAAe5B,GAAoB,GACnC6B,GAAc3B,EAAe4B,OAC7BC,GAAY7B,EAAe8B,KAC3BC,GAAe/B,EAAegC,QAC9BC,GAAmBpB,EAAWqB,YAC9BC,GAActB,EAAWuB,OACzBC,GAAmBxB,EAAWyB,YAC9BC,GAAY1B,EAAW2B,KACvBC,GAAY5B,EAAW6B,KACvBC,GAAa9B,EAAWnC,MACxBkE,GAAgB/B,EAAWpC,SAC3BoE,GAAsBhC,EAAWiC,eACjCC,GAAWnD,EAAI,YACfoD,GAAMpD,EAAI,eACVqD,GAAoBtI,EAAI,qBACxBuI,GAAkBvI,EAAI,mBACtBwI,GAAmBlE,EAAOmE,OAC1BC,GAAcpE,EAAOqE,MACrBC,GAAOtE,EAAOsE,KACdC,GAAe,gBAEfC,GAAO5D,EAAkB,EAAG,SAAUxE,EAAGzB,GAC3C,OAAO8J,GAAS3D,EAAmB1E,EAAGA,EAAE6H,KAAmBtJ,KAGzD+J,GAAgB3H,EAAM,WAExB,OAA0D,IAAnD,IAAIyE,EAAW,IAAImD,YAAY,CAAC,IAAIC,QAAQ,KAGjDC,KAAerD,KAAgBA,EAAWvI,GAAW6L,KAAO/H,EAAM,WACpE,IAAIyE,EAAW,GAAGsD,IAAI,MAGpBC,GAAW,SAAU7J,EAAI8J,GAC3B,IAAIC,EAASpJ,EAAUX,GACvB,GAAI+J,EAAS,GAAKA,EAASD,EAAO,MAAMzD,EAAW,iBACnD,OAAO0D,GAGLC,GAAW,SAAUhK,GACvB,GAAID,EAASC,IAAOkJ,MAAelJ,EAAI,OAAOA,EAC9C,MAAMC,EAAUD,EAAK,2BAGnBuJ,GAAW,SAAUnK,EAAGK,GAC1B,KAAMM,EAASX,IAAM0J,MAAqB1J,GACxC,MAAMa,EAAU,wCAChB,OAAO,IAAIb,EAAEK,IAGbwK,GAAkB,SAAU/I,EAAGgJ,GACjC,OAAOC,GAASvE,EAAmB1E,EAAGA,EAAE6H,KAAmBmB,IAGzDC,GAAW,SAAU/K,EAAG8K,GAI1B,IAHA,IAAI/F,EAAQ,EACR1E,EAASyK,EAAKzK,OACd2E,EAASmF,GAASnK,EAAGK,GACT0E,EAAT1E,GAAgB2E,EAAOD,GAAS+F,EAAK/F,KAC5C,OAAOC,GAGLgG,GAAY,SAAUpK,EAAI7B,EAAKkM,GACjCrJ,EAAGhB,EAAI7B,EAAK,CAAEpB,IAAK,WAAc,OAAOwC,KAAK+K,GAAGD,OAG9CE,GAAQ,SAASC,KAAKtM,GACxB,IAKIhC,EAAGuD,EAAQgI,EAAQrD,EAAQqG,EAAMC,EALjCxJ,EAAIM,EAAStD,GACbyM,EAAOnL,UAAUC,OACjBmL,EAAe,EAAPD,EAAWnL,UAAU,GAAK7D,GAClCkP,EAAUD,IAAUjP,GACpBmP,EAAStF,EAAUtE,GAEvB,GAAI4J,GAAUnP,KAAc2J,EAAYwF,GAAS,CAC/C,IAAKJ,EAAWI,EAAO1O,KAAK8E,GAAIuG,EAAS,GAAIvL,EAAI,IAAKuO,EAAOC,EAASK,QAAQC,KAAM9O,IAClFuL,EAAOpD,KAAKoG,EAAKrJ,OACjBF,EAAIuG,EAGR,IADIoD,GAAkB,EAAPF,IAAUC,EAAQhN,EAAIgN,EAAOpL,UAAU,GAAI,IACrDtD,EAAI,EAAGuD,EAAS2D,EAASlC,EAAEzB,QAAS2E,EAASmF,GAAShK,KAAME,GAAkBvD,EAATuD,EAAYvD,IACpFkI,EAAOlI,GAAK2O,EAAUD,EAAM1J,EAAEhF,GAAIA,GAAKgF,EAAEhF,GAE3C,OAAOkI,GAGL6G,GAAM,SAASC,KAIjB,IAHA,IAAI/G,EAAQ,EACR1E,EAASD,UAAUC,OACnB2E,EAASmF,GAAShK,KAAME,GACZ0E,EAAT1E,GAAgB2E,EAAOD,GAAS3E,UAAU2E,KACjD,OAAOC,GAIL+G,KAAkB7E,GAAczE,EAAM,WAAc6G,GAAoBtM,KAAK,IAAIkK,EAAW,MAE5F8E,GAAkB,SAASzC,iBAC7B,OAAOD,GAAoBhJ,MAAMyL,GAAgB3C,GAAWpM,KAAK4N,GAASzK,OAASyK,GAASzK,MAAOC,YAGjG6L,GAAQ,CACVC,WAAY,SAASA,WAAWnM,EAAQoM,GACtC,OAAOrF,EAAgB9J,KAAK4N,GAASzK,MAAOJ,EAAQoM,EAA0B,EAAnB/L,UAAUC,OAAaD,UAAU,GAAK7D,KAEnG6P,MAAO,SAASA,MAAMxH,GACpB,OAAOmD,GAAW6C,GAASzK,MAAOyE,EAA+B,EAAnBxE,UAAUC,OAAaD,UAAU,GAAK7D,KAEtF8P,KAAM,SAASA,KAAKrK,GAClB,OAAO6E,EAAUvG,MAAMsK,GAASzK,MAAOC,YAEzCkM,OAAQ,SAASA,OAAO1H,GACtB,OAAOiG,GAAgB1K,KAAM0H,GAAY+C,GAASzK,MAAOyE,EACpC,EAAnBxE,UAAUC,OAAaD,UAAU,GAAK7D,MAE1CgQ,KAAM,SAASA,KAAKC,GAClB,OAAOxE,GAAU4C,GAASzK,MAAOqM,EAA8B,EAAnBpM,UAAUC,OAAaD,UAAU,GAAK7D,KAEpFkQ,UAAW,SAASA,UAAUD,GAC5B,OAAOvE,GAAe2C,GAASzK,MAAOqM,EAA8B,EAAnBpM,UAAUC,OAAaD,UAAU,GAAK7D,KAEzFmQ,QAAS,SAASA,QAAQ9H,GACxBgD,EAAagD,GAASzK,MAAOyE,EAA+B,EAAnBxE,UAAUC,OAAaD,UAAU,GAAK7D,KAEjFoQ,QAAS,SAASA,QAAQC,GACxB,OAAOzE,GAAayC,GAASzK,MAAOyM,EAAkC,EAAnBxM,UAAUC,OAAaD,UAAU,GAAK7D,KAE3FsQ,SAAU,SAASA,SAASD,GAC1B,OAAO1E,GAAc0C,GAASzK,MAAOyM,EAAkC,EAAnBxM,UAAUC,OAAaD,UAAU,GAAK7D,KAE5F0M,KAAM,SAASA,KAAK6D,GAClB,OAAO9D,GAAU1I,MAAMsK,GAASzK,MAAOC,YAEzCuI,YAAa,SAASA,YAAYiE,GAChC,OAAOlE,GAAiBpI,MAAMsK,GAASzK,MAAOC,YAEhD2M,IAAK,SAASA,IAAIvB,GAChB,OAAOtB,GAAKU,GAASzK,MAAOqL,EAA0B,EAAnBpL,UAAUC,OAAaD,UAAU,GAAK7D,KAE3EsM,OAAQ,SAASA,OAAOjE,GACtB,OAAOgE,GAAYtI,MAAMsK,GAASzK,MAAOC,YAE3C2I,YAAa,SAASA,YAAYnE,GAChC,OAAOkE,GAAiBxI,MAAMsK,GAASzK,MAAOC,YAEhD4M,QAAS,SAASA,UAMhB,IALA,IAIIhL,EAJAwB,EAAOrD,KACPE,EAASuK,GAASpH,GAAMnD,OACxB4M,EAASlM,KAAKsE,MAAMhF,EAAS,GAC7B0E,EAAQ,EAELA,EAAQkI,GACbjL,EAAQwB,EAAKuB,GACbvB,EAAKuB,KAAWvB,IAAOnD,GACvBmD,EAAKnD,GAAU2B,EACf,OAAOwB,GAEX0J,KAAM,SAASA,KAAKtI,GAClB,OAAOkD,GAAU8C,GAASzK,MAAOyE,EAA+B,EAAnBxE,UAAUC,OAAaD,UAAU,GAAK7D,KAErF4M,KAAM,SAASA,KAAKgE,GAClB,OAAOjE,GAAUlM,KAAK4N,GAASzK,MAAOgN,IAExCC,SAAU,SAASA,SAASC,EAAOC,GACjC,IAAIxL,EAAI8I,GAASzK,MACbE,EAASyB,EAAEzB,OACXkN,EAASvH,EAAgBqH,EAAOhN,GACpC,OAAO,IAAKmG,EAAmB1E,EAAGA,EAAE6H,KAA7B,CACL7H,EAAEwI,OACFxI,EAAE0L,WAAaD,EAASzL,EAAEuF,kBAC1BrD,GAAUsJ,IAAQ/Q,GAAY8D,EAAS2F,EAAgBsH,EAAKjN,IAAWkN,MAKzEE,GAAS,SAAStI,MAAMgH,EAAOmB,GACjC,OAAOzC,GAAgB1K,KAAMiJ,GAAWpM,KAAK4N,GAASzK,MAAOgM,EAAOmB,KAGlEI,GAAO,SAASlD,IAAImD,GACtB/C,GAASzK,MACT,IAAIwK,EAASF,GAASrK,UAAU,GAAI,GAChCC,EAASF,KAAKE,OACduN,EAAMxL,EAASuL,GACfE,EAAM7J,EAAS4J,EAAIvN,QACnB0E,EAAQ,EACZ,GAAmB1E,EAAfwN,EAAMlD,EAAiB,MAAM1D,EAAWgD,IAC5C,KAAOlF,EAAQ8I,GAAK1N,KAAKwK,EAAS5F,GAAS6I,EAAI7I,MAG7C+I,GAAa,CACfrF,QAAS,SAASA,UAChB,OAAOD,GAAaxL,KAAK4N,GAASzK,QAEpCoI,KAAM,SAASA,OACb,OAAOD,GAAUtL,KAAK4N,GAASzK,QAEjCkI,OAAQ,SAASA,SACf,OAAOD,GAAYpL,KAAK4N,GAASzK,SAIjC4N,GAAY,SAAUhO,EAAQhB,GAChC,OAAO4B,EAASZ,IACXA,EAAO+J,KACO,iBAAP/K,GACPA,KAAOgB,GACPgD,QAAQhE,IAAQgE,OAAOhE,IAE1BiP,GAAW,SAASnK,yBAAyB9D,EAAQhB,GACvD,OAAOgP,GAAUhO,EAAQhB,EAAM4C,EAAY5C,GAAK,IAC5C8G,EAAa,EAAG9F,EAAOhB,IACvB6E,EAAK7D,EAAQhB,IAEfkP,GAAW,SAASzQ,eAAeuC,EAAQhB,EAAKmP,GAClD,QAAIH,GAAUhO,EAAQhB,EAAM4C,EAAY5C,GAAK,KACxC4B,EAASuN,IACTxP,EAAIwP,EAAM,WACTxP,EAAIwP,EAAM,QACVxP,EAAIwP,EAAM,QAEVA,EAAKzQ,cACJiB,EAAIwP,EAAM,cAAeA,EAAKC,UAC9BzP,EAAIwP,EAAM,gBAAiBA,EAAKxQ,WAI9BkE,EAAG7B,EAAQhB,EAAKmP,IAFvBnO,EAAOhB,GAAOmP,EAAKlM,MACZjC,IAIN6J,KACH5C,EAAMnF,EAAImM,GACVjH,EAAIlF,EAAIoM,IAGVrP,EAAQA,EAAQW,EAAIX,EAAQO,GAAKyK,GAAkB,SAAU,CAC3D/F,yBAA0BmK,GAC1BxQ,eAAgByQ,KAGdxL,EAAM,WAAc4G,GAAcrM,KAAK,QACzCqM,GAAgBC,GAAsB,SAASpE,WAC7C,OAAO8D,GAAUhM,KAAKmD,QAI1B,IAAIiO,GAAwBtI,EAAY,GAAImG,IAC5CnG,EAAYsI,GAAuBN,IACnCrP,EAAK2P,GAAuB5E,GAAUsE,GAAWzF,QACjDvC,EAAYsI,GAAuB,CACjCjJ,MAAOsI,GACPjD,IAAKkD,GACLlL,YAAa,aACb0C,SAAUmE,GACVE,eAAgByC,KAElBhB,GAAUoD,GAAuB,SAAU,KAC3CpD,GAAUoD,GAAuB,aAAc,KAC/CpD,GAAUoD,GAAuB,aAAc,KAC/CpD,GAAUoD,GAAuB,SAAU,KAC3CxM,EAAGwM,GAAuB3E,GAAK,CAC7B9L,IAAK,WAAc,OAAOwC,KAAK2J,OAIjCjN,EAAOD,QAAU,SAAU2I,EAAKmF,EAAO2D,EAASC,GAE9C,IAAIpL,EAAOqC,IADX+I,IAAYA,GACgB,UAAY,IAAM,QAC1CC,EAAS,MAAQhJ,EACjBiJ,EAAS,MAAQjJ,EACjBkJ,EAAanQ,EAAO4E,GACpBwL,EAAOD,GAAc,GACrBE,EAAMF,GAAclM,EAAekM,GAEnC3M,EAAI,GACJ8M,EAAsBH,GAAcA,EAAW9P,GAU/CkQ,EAAa,SAAUrL,EAAMuB,GAC/BnD,EAAG4B,EAAMuB,EAAO,CACdpH,IAAK,WACH,OAXAmR,EAWc3O,KAXF+K,IACJ6D,EAAER,GAUUxJ,EAVM2F,EAAQoE,EAAKxR,EAAG8M,IAFnC,IACP0E,GAaFtE,IAAK,SAAUxI,GACb,OAXuB+C,EAWHA,EAXU/C,EAWHA,EAV3B8M,EAUc3O,KAVF+K,GACZoD,IAAStM,GAASA,EAAQjB,KAAKiO,MAAMhN,IAAU,EAAI,EAAY,IAARA,EAAe,IAAe,IAARA,QACjF8M,EAAKC,EAAEP,GAAQzJ,EAAQ2F,EAAQoE,EAAKxR,EAAG0E,EAAOoI,IAHnC,IAAgBrF,EAAO/C,EAC9B8M,GAYFpR,YAAY,MApBF+Q,IAAe/I,EAAOuJ,KAwBlCR,EAAaJ,EAAQ,SAAU7K,EAAMsL,EAAMI,EAASC,GAClDvJ,EAAWpC,EAAMiL,EAAYvL,EAAM,MACnC,IAEIoH,EAAQ8E,EAAY/O,EAAQgP,EAF5BtK,EAAQ,EACR4F,EAAS,EAEb,GAAKhK,EAASmO,GAIP,CAAA,KAAIA,aAAgBtH,IAAiB6H,EAAQpJ,EAAQ6I,KAAU3H,GAAgBkI,GAASjI,GAaxF,OAAI0C,MAAegF,EACjB/D,GAAS0D,EAAYK,GAErB3D,GAAMnO,KAAKyR,EAAYK,GAf9BxE,EAASwE,EACTnE,EAASF,GAASyE,EAASxE,GAC3B,IAAI4E,EAAOR,EAAKM,WAChB,GAAID,IAAY5S,GAAW,CACzB,GAAI+S,EAAO5E,EAAO,MAAMzD,EAAWgD,IAEnC,IADAmF,EAAaE,EAAO3E,GACH,EAAG,MAAM1D,EAAWgD,SAGrC,GAA0BqF,GAD1BF,EAAapL,EAASmL,GAAWzE,GAChBC,EAAe,MAAM1D,EAAWgD,IAEnD5J,EAAS+O,EAAa1E,OAftBrK,EAAS0F,EAAQ+I,GAEjBxE,EAAS,IAAI9C,EADb4H,EAAa/O,EAASqK,GA2BxB,IAPAjM,EAAK+E,EAAM,KAAM,CACftD,EAAGoK,EACHhN,EAAGqN,EACH5N,EAAGqS,EACHlO,EAAGb,EACH0O,EAAG,IAAIrH,EAAU4C,KAEZvF,EAAQ1E,GAAQwO,EAAWrL,EAAMuB,OAE1C6J,EAAsBH,EAAW9P,GAAa+F,EAAO0J,IACrD3P,EAAKmQ,EAAqB,cAAeH,IAC/BhM,EAAM,WAChBgM,EAAW,MACNhM,EAAM,WACX,IAAIgM,GAAY,MACX9H,EAAY,SAAU4I,GAC3B,IAAId,EACJ,IAAIA,EAAW,MACf,IAAIA,EAAW,KACf,IAAIA,EAAWc,KACd,KACDd,EAAaJ,EAAQ,SAAU7K,EAAMsL,EAAMI,EAASC,GAElD,IAAIE,EAGJ,OAJAzJ,EAAWpC,EAAMiL,EAAYvL,GAIxBvC,EAASmO,GACVA,aAAgBtH,IAAiB6H,EAAQpJ,EAAQ6I,KAAU3H,GAAgBkI,GAASjI,EAC/E+H,IAAY5S,GACf,IAAImS,EAAKI,EAAMrE,GAASyE,EAASxE,GAAQyE,GACzCD,IAAY3S,GACV,IAAImS,EAAKI,EAAMrE,GAASyE,EAASxE,IACjC,IAAIgE,EAAKI,GAEbhF,MAAegF,EAAa/D,GAAS0D,EAAYK,GAC9C3D,GAAMnO,KAAKyR,EAAYK,GATF,IAAIJ,EAAK3I,EAAQ+I,MAW/ClH,EAAa+G,IAAQpO,SAASrC,UAAYiI,EAAKuI,GAAMc,OAAOrJ,EAAKwI,IAAQxI,EAAKuI,GAAO,SAAU3P,GACvFA,KAAO0P,GAAahQ,EAAKgQ,EAAY1P,EAAK2P,EAAK3P,MAEvD0P,EAAW9P,GAAaiQ,EACnBnJ,IAASmJ,EAAoBpM,YAAciM,IAElD,IAAIgB,EAAkBb,EAAoBpF,IACtCkG,IAAsBD,IACI,UAAxBA,EAAgBrS,MAAoBqS,EAAgBrS,MAAQb,IAC9DoT,EAAY7B,GAAWzF,OAC3B5J,EAAKgQ,EAAY/E,IAAmB,GACpCjL,EAAKmQ,EAAqB9E,GAAa5G,GACvCzE,EAAKmQ,EAAqB5E,IAAM,GAChCvL,EAAKmQ,EAAqBjF,GAAiB8E,IAEvCH,EAAU,IAAIG,EAAW,GAAGhF,KAAQvG,EAASuG,MAAOmF,IACtDhN,EAAGgN,EAAqBnF,GAAK,CAC3B9L,IAAK,WAAc,OAAOuF,KAM9BtE,EAAQA,EAAQS,EAAIT,EAAQiB,EAAIjB,EAAQO,IAFxC2C,EAAEoB,GAAQuL,IAEiDC,GAAO5M,GAElElD,EAAQA,EAAQW,EAAG2D,EAAM,CACvBmE,kBAAmBqD,IAGrB9L,EAAQA,EAAQW,EAAIX,EAAQO,EAAIsD,EAAM,WAAciM,EAAK5C,GAAG9O,KAAKyR,EAAY,KAAQvL,EAAM,CACzFkI,KAAMD,GACNW,GAAID,KAGAxE,KAAqBuH,GAAsBnQ,EAAKmQ,EAAqBvH,EAAmBqD,GAE9F9L,EAAQA,EAAQa,EAAGyD,EAAM+I,IAEzBrF,EAAW1D,GAEXtE,EAAQA,EAAQa,EAAIb,EAAQO,EAAIoL,GAAYrH,EAAM,CAAEsH,IAAKkD,KAEzD9O,EAAQA,EAAQa,EAAIb,EAAQO,GAAKuQ,EAAmBxM,EAAM4K,IAErDrI,GAAWmJ,EAAoB1J,UAAYmE,KAAeuF,EAAoB1J,SAAWmE,IAE9FzK,EAAQA,EAAQa,EAAIb,EAAQO,EAAIsD,EAAM,WACpC,IAAIgM,EAAW,GAAGtJ,UAChBjC,EAAM,CAAEiC,MAAOsI,KAEnB7O,EAAQA,EAAQa,EAAIb,EAAQO,GAAKsD,EAAM,WACrC,MAAO,CAAC,EAAG,GAAG8G,kBAAoB,IAAIkF,EAAW,CAAC,EAAG,IAAIlF,qBACpD9G,EAAM,WACXmM,EAAoBrF,eAAevM,KAAK,CAAC,EAAG,OACzCkG,EAAM,CAAEqG,eAAgByC,KAE7BtF,EAAUxD,GAAQwM,EAAoBD,EAAkBE,EACnDlK,GAAYiK,GAAmBjR,EAAKmQ,EAAqBpF,GAAUmG,SAErE9S,EAAOD,QAAU,cAKlB,SAAUC,EAAQD,EAASF,GAEjC,IAAIkT,EAAMlT,EAAoB,KAC1BkC,EAAUlC,EAAoB,GAC9BmT,EAASnT,EAAoB,GAApBA,CAAwB,YACjCyE,EAAQ0O,EAAO1O,QAAU0O,EAAO1O,MAAQ,IAAKzE,EAAoB,OAEjEoT,EAAyB,SAAU/P,EAAQgQ,EAAWrL,GACxD,IAAIsL,EAAiB7O,EAAMxD,IAAIoC,GAC/B,IAAKiQ,EAAgB,CACnB,IAAKtL,EAAQ,OAAOnI,GACpB4E,EAAMqJ,IAAIzK,EAAQiQ,EAAiB,IAAIJ,GAEzC,IAAIK,EAAcD,EAAerS,IAAIoS,GACrC,IAAKE,EAAa,CAChB,IAAKvL,EAAQ,OAAOnI,GACpByT,EAAexF,IAAIuF,EAAWE,EAAc,IAAIL,GAChD,OAAOK,GA0BXpT,EAAOD,QAAU,CACfuE,MAAOA,EACP4L,IAAK+C,EACLpR,IA3B2B,SAAUwR,EAAapO,EAAGrC,GACrD,IAAI0Q,EAAcL,EAAuBhO,EAAGrC,GAAG,GAC/C,OAAO0Q,IAAgB5T,IAAoB4T,EAAYzR,IAAIwR,IA0B3DvS,IAxB2B,SAAUuS,EAAapO,EAAGrC,GACrD,IAAI0Q,EAAcL,EAAuBhO,EAAGrC,GAAG,GAC/C,OAAO0Q,IAAgB5T,GAAYA,GAAY4T,EAAYxS,IAAIuS,IAuB/D1F,IArB8B,SAAU0F,EAAaE,EAAetO,EAAGrC,GACvEqQ,EAAuBhO,EAAGrC,GAAG,GAAM+K,IAAI0F,EAAaE,IAqBpD7H,KAnB4B,SAAUxI,EAAQgQ,GAC9C,IAAII,EAAcL,EAAuB/P,EAAQgQ,GAAW,GACxDxH,EAAO,GAEX,OADI4H,GAAaA,EAAYzD,QAAQ,SAAU2D,EAAGtR,GAAOwJ,EAAKtD,KAAKlG,KAC5DwJ,GAgBPxJ,IAdc,SAAU6B,GACxB,OAAOA,IAAOrE,IAA0B,iBAANqE,EAAiBA,EAAKmC,OAAOnC,IAc/D4E,IAZQ,SAAU1D,GAClBlD,EAAQA,EAAQW,EAAG,UAAWuC,MAiB1B,SAAUjF,EAAQD,EAASF,GAGjC,IAAIiE,EAAWjE,EAAoB,GAGnCG,EAAOD,QAAU,SAAUgE,EAAIrB,GAC7B,IAAKoB,EAASC,GAAK,OAAOA,EAC1B,IAAI2C,EAAIsB,EACR,GAAItF,GAAkC,mBAArBgE,EAAK3C,EAAGsE,YAA4BvE,EAASkE,EAAMtB,EAAGvG,KAAK4D,IAAM,OAAOiE,EACzF,GAAgC,mBAApBtB,EAAK3C,EAAG0P,WAA2B3P,EAASkE,EAAMtB,EAAGvG,KAAK4D,IAAM,OAAOiE,EACnF,IAAKtF,GAAkC,mBAArBgE,EAAK3C,EAAGsE,YAA4BvE,EAASkE,EAAMtB,EAAGvG,KAAK4D,IAAM,OAAOiE,EAC1F,MAAMhE,UAAU,6CAMZ,SAAUhE,EAAQD,GAExBC,EAAOD,QAAU,SAAU2T,EAAQvO,GACjC,MAAO,CACLtE,aAAuB,EAAT6S,GACd9S,eAAyB,EAAT8S,GAChBpC,WAAqB,EAAToC,GACZvO,MAAOA,KAOL,SAAUnF,EAAQD,EAASF,GAEjC,IAAI8T,EAAO9T,EAAoB,GAApBA,CAAwB,QAC/BiE,EAAWjE,EAAoB,GAC/BgC,EAAMhC,EAAoB,IAC1B+T,EAAU/T,EAAoB,GAAGmF,EACjC6O,EAAK,EACLC,EAAepT,OAAOoT,cAAgB,WACxC,OAAO,GAELC,GAAUlU,EAAoB,EAApBA,CAAuB,WACnC,OAAOiU,EAAapT,OAAOsT,kBAAkB,OAE3CC,EAAU,SAAUlQ,GACtB6P,EAAQ7P,EAAI4P,EAAM,CAAExO,MAAO,CACzBlF,EAAG,OAAQ4T,EACXK,EAAG,OAgCHC,EAAOnU,EAAOD,QAAU,CAC1B2I,IAAKiL,EACLS,MAAM,EACNC,QAhCY,SAAUtQ,EAAI8D,GAE1B,IAAK/D,EAASC,GAAK,MAAoB,iBAANA,EAAiBA,GAAmB,iBAANA,EAAiB,IAAM,KAAOA,EAC7F,IAAKlC,EAAIkC,EAAI4P,GAAO,CAElB,IAAKG,EAAa/P,GAAK,MAAO,IAE9B,IAAK8D,EAAQ,MAAO,IAEpBoM,EAAQlQ,GAER,OAAOA,EAAG4P,GAAM1T,GAsBlBqU,QApBY,SAAUvQ,EAAI8D,GAC1B,IAAKhG,EAAIkC,EAAI4P,GAAO,CAElB,IAAKG,EAAa/P,GAAK,OAAO,EAE9B,IAAK8D,EAAQ,OAAO,EAEpBoM,EAAQlQ,GAER,OAAOA,EAAG4P,GAAMO,GAYlBK,SATa,SAAUxQ,GAEvB,OADIgQ,GAAUI,EAAKC,MAAQN,EAAa/P,KAAQlC,EAAIkC,EAAI4P,IAAOM,EAAQlQ,GAChEA,KAaH,SAAU/D,EAAQD,GAExBC,EAAOD,SAAU,GAKX,SAAUC,EAAQD,EAASF,GAGjC,IAAI2U,EAAQ3U,EAAoB,IAC5B4U,EAAc5U,EAAoB,IAEtCG,EAAOD,QAAUW,OAAOgL,MAAQ,SAASA,KAAKzG,GAC5C,OAAOuP,EAAMvP,EAAGwP,KAMZ,SAAUzU,EAAQD,EAASF,GAGjC,IAAI+E,EAAW/E,EAAoB,GAC/B6U,EAAM7U,EAAoB,IAC1B4U,EAAc5U,EAAoB,IAClC2F,EAAW3F,EAAoB,GAApBA,CAAwB,YACnC8U,EAAQ,aACR7S,EAAY,YAGZ8S,EAAa,WAEf,IAIIC,EAJAC,EAASjV,EAAoB,GAApBA,CAAwB,UACjCI,EAAIwU,EAAYjR,OAcpB,IAVAsR,EAAOC,MAAMC,QAAU,OACvBnV,EAAoB,IAAIoV,YAAYH,GACpCA,EAAO/D,IAAM,eAGb8D,EAAiBC,EAAOI,cAAcC,UACvBC,OACfP,EAAeQ,MAAMC,uCACrBT,EAAeU,QACfX,EAAaC,EAAevS,EACrBrC,YAAY2U,EAAW9S,GAAW2S,EAAYxU,IACrD,OAAO2U,KAGT5U,EAAOD,QAAUW,OAAOmH,QAAU,SAASA,OAAO5C,EAAGuQ,GACnD,IAAIrN,EAQJ,OAPU,OAANlD,GACF0P,EAAM7S,GAAa8C,EAASK,GAC5BkD,EAAS,IAAIwM,EACbA,EAAM7S,GAAa,KAEnBqG,EAAO3C,GAAYP,GACdkD,EAASyM,IACTY,IAAe9V,GAAYyI,EAASuM,EAAIvM,EAAQqN,KAMnD,SAAUxV,EAAQD,GAExBC,EAAOD,QAAU,cAKX,SAAUC,EAAQD,EAASF,GAEjC,IAAI8B,EAAM9B,EAAoB,IAC1BM,EAAON,EAAoB,KAC3BwJ,EAAcxJ,EAAoB,IAClC+E,EAAW/E,EAAoB,GAC/BsH,EAAWtH,EAAoB,GAC/B0J,EAAY1J,EAAoB,IAChC4V,EAAQ,GACRC,EAAS,IACT3V,EAAUC,EAAOD,QAAU,SAAU4V,EAAU/J,EAASlF,EAAIC,EAAMgG,GACpE,IAGInJ,EAAQgL,EAAMC,EAAUtG,EAHxB0G,EAASlC,EAAW,WAAc,OAAOgJ,GAAcpM,EAAUoM,GACjE3Q,EAAIrD,EAAI+E,EAAIC,EAAMiF,EAAU,EAAI,GAChC1D,EAAQ,EAEZ,GAAqB,mBAAV2G,EAAsB,MAAM7K,UAAU2R,EAAW,qBAE5D,GAAItM,EAAYwF,IAAS,IAAKrL,EAAS2D,EAASwO,EAASnS,QAAkB0E,EAAT1E,EAAgB0E,IAEhF,IADAC,EAASyD,EAAU5G,EAAEJ,EAAS4J,EAAOmH,EAASzN,IAAQ,GAAIsG,EAAK,IAAMxJ,EAAE2Q,EAASzN,OACjEuN,GAAStN,IAAWuN,EAAQ,OAAOvN,OAC7C,IAAKsG,EAAWI,EAAO1O,KAAKwV,KAAanH,EAAOC,EAASK,QAAQC,MAEtE,IADA5G,EAAShI,EAAKsO,EAAUzJ,EAAGwJ,EAAKrJ,MAAOyG,MACxB6J,GAAStN,IAAWuN,EAAQ,OAAOvN,IAG9CsN,MAAQA,EAChB1V,EAAQ2V,OAASA,GAKX,SAAU1V,EAAQD,EAASF,GAEjC,IAAI6E,EAAY7E,EAAoB,IAChC+V,EAAM1R,KAAK0R,IACXjR,EAAMT,KAAKS,IACf3E,EAAOD,QAAU,SAAUmI,EAAO1E,GAEhC,OADA0E,EAAQxD,EAAUwD,IACH,EAAI0N,EAAI1N,EAAQ1E,EAAQ,GAAKmB,EAAIuD,EAAO1E,KAMnD,SAAUxD,EAAQD,GAExBC,EAAOD,QAAU,IAKX,SAAUC,EAAQD,EAASF,GAGjC,IAAIgW,EAAMhW,EAAoB,IAC1B+M,EAAM/M,EAAoB,EAApBA,CAAuB,eAE7BiW,EAAkD,aAA5CD,EAAI,WAAc,OAAOtS,UAArB,IASdvD,EAAOD,QAAU,SAAUgE,GACzB,IAAIkB,EAAG8Q,EAAGjT,EACV,OAAOiB,IAAOrE,GAAY,YAAqB,OAAPqE,EAAc,OAEN,iBAApCgS,EAVD,SAAUhS,EAAI7B,GACzB,IACE,OAAO6B,EAAG7B,GACV,MAAOmC,KAOO2R,CAAO/Q,EAAIvE,OAAOqD,GAAK6I,IAAoBmJ,EAEvDD,EAAMD,EAAI5Q,GAEM,WAAfnC,EAAI+S,EAAI5Q,KAAsC,mBAAZA,EAAEgR,OAAuB,YAAcnT,IAM1E,SAAU9C,EAAQD,GAExBC,EAAOD,QAAU,SAAUgE,EAAImS,EAAa3V,EAAM4V,GAChD,KAAMpS,aAAcmS,IAAiBC,IAAmBzW,IAAayW,KAAkBpS,EACrF,MAAMC,UAAUzD,EAAO,2BACvB,OAAOwD,IAML,SAAU/D,EAAQD,EAASF,GAEjC,IAAI+B,EAAO/B,EAAoB,IAC/BG,EAAOD,QAAU,SAAUmD,EAAQ6N,EAAKqF,GACtC,IAAK,IAAIlU,KAAO6O,EACVqF,GAAQlT,EAAOhB,GAAMgB,EAAOhB,GAAO6O,EAAI7O,GACtCN,EAAKsB,EAAQhB,EAAK6O,EAAI7O,IAC3B,OAAOgB,IAML,SAAUlD,EAAQD,GAExB,IAAI8T,EAAK,EACLwC,EAAKnS,KAAKoS,SACdtW,EAAOD,QAAU,SAAUmC,GACzB,MAAO,UAAUyQ,OAAOzQ,IAAQxC,GAAY,GAAKwC,EAAK,QAAS2R,EAAKwC,GAAIhO,SAAS,OAM7E,SAAUrI,EAAQD,EAASF,GAEjC,IAAI0W,EAAM1W,EAAoB,GAAGmF,EAC7BnD,EAAMhC,EAAoB,IAC1B+M,EAAM/M,EAAoB,EAApBA,CAAuB,eAEjCG,EAAOD,QAAU,SAAUgE,EAAIiC,EAAKwQ,GAC9BzS,IAAOlC,EAAIkC,EAAKyS,EAAOzS,EAAKA,EAAG1C,UAAWuL,IAAM2J,EAAIxS,EAAI6I,EAAK,CAAEhM,cAAc,EAAMuE,MAAOa,MAM1F,SAAUhG,EAAQD,EAASF,GAIjC,IAAI4B,EAAS5B,EAAoB,GAC7B6B,EAAO7B,EAAoB,IAC3BkF,EAAKlF,EAAoB,GACzB4W,EAAc5W,EAAoB,GAClC6W,EAAU7W,EAAoB,EAApBA,CAAuB,WAErCG,EAAOD,QAAU,SAAU2I,GACzB,IAAIvF,EAAwB,mBAAbzB,EAAKgH,GAAqBhH,EAAKgH,GAAOjH,EAAOiH,GACxD+N,GAAetT,IAAMA,EAAEuT,IAAU3R,EAAGC,EAAE7B,EAAGuT,EAAS,CACpD9V,cAAc,EACdE,IAAK,WAAc,OAAOwC,UAOxB,SAAUtD,EAAQD,EAASF,GAEjC,IAAIiE,EAAWjE,EAAoB,GACnCG,EAAOD,QAAU,SAAUgE,EAAIsD,GAC7B,IAAKvD,EAASC,IAAOA,EAAG4S,KAAOtP,EAAM,MAAMrD,UAAU,0BAA4BqD,EAAO,cACxF,OAAOtD,IAMH,SAAU/D,EAAQD,EAASF,GAGjC,IAAIgW,EAAMhW,EAAoB,IAE9BG,EAAOD,QAAUW,OAAO,KAAKkW,qBAAqB,GAAKlW,OAAS,SAAUqD,GACxE,MAAkB,UAAX8R,EAAI9R,GAAkBA,EAAGyC,MAAM,IAAM9F,OAAOqD,KAM/C,SAAU/D,EAAQD,GAExBA,EAAQiF,EAAI,GAAG4R,sBAKT,SAAU5W,EAAQD,EAASF,GAGjC,IAAI2U,EAAQ3U,EAAoB,IAC5BgX,EAAahX,EAAoB,IAAI8S,OAAO,SAAU,aAE1D5S,EAAQiF,EAAItE,OAAOoW,qBAAuB,SAASA,oBAAoB7R,GACrE,OAAOuP,EAAMvP,EAAG4R,KAMZ,SAAU7W,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9BuF,EAAUvF,EAAoB,IAC9B+F,EAAQ/F,EAAoB,GAC5BkX,EAASlX,EAAoB,IAC7BmX,EAAQ,IAAMD,EAAS,IAEvBE,EAAQC,OAAO,IAAMF,EAAQA,EAAQ,KACrCG,EAAQD,OAAOF,EAAQA,EAAQ,MAE/BI,EAAW,SAAU1O,EAAKtE,EAAMiT,GAClC,IAAI1O,EAAM,GACN2O,EAAQ1R,EAAM,WAChB,QAASmR,EAAOrO,MAPV,MAAA,KAOwBA,OAE5BhC,EAAKiC,EAAID,GAAO4O,EAAQlT,EAAKmT,GAAQR,EAAOrO,GAC5C2O,IAAO1O,EAAI0O,GAAS3Q,GACxB3E,EAAQA,EAAQa,EAAIb,EAAQO,EAAIgV,EAAO,SAAU3O,IAM/C4O,EAAOH,EAASG,KAAO,SAAUxR,EAAQsB,GAI3C,OAHAtB,EAASG,OAAOd,EAAQW,IACb,EAAPsB,IAAUtB,EAASA,EAAOK,QAAQ6Q,EAAO,KAClC,EAAP5P,IAAUtB,EAASA,EAAOK,QAAQ+Q,EAAO,KACtCpR,GAGT/F,EAAOD,QAAUqX,GAKX,SAAUpX,EAAQD,EAASF,GAEjC,IAAIuJ,EAAUvJ,EAAoB,IAC9B8M,EAAW9M,EAAoB,EAApBA,CAAuB,YAClCgK,EAAYhK,EAAoB,IACpCG,EAAOD,QAAUF,EAAoB,IAAI2X,kBAAoB,SAAUzT,GACrE,GAAIA,GAAMrE,GAAW,OAAOqE,EAAG4I,IAC1B5I,EAAG,eACH8F,EAAUT,EAAQrF,MAMnB,SAAU/D,EAAQD,EAASF,GAEjC,IAAI6B,EAAO7B,EAAoB,IAC3B4B,EAAS5B,EAAoB,GAC7B4X,EAAS,qBACTnT,EAAQ7C,EAAOgW,KAAYhW,EAAOgW,GAAU,KAE/CzX,EAAOD,QAAU,SAAUmC,EAAKiD,GAC/B,OAAOb,EAAMpC,KAASoC,EAAMpC,GAAOiD,IAAUzF,GAAYyF,EAAQ,MAChE,WAAY,IAAIiD,KAAK,CACtB9C,QAAS5D,EAAK4D,QACdoS,KAAM7X,EAAoB,IAAM,OAAS,SACzC8X,UAAW,0CAMP,SAAU3X,EAAQD,EAASF,GAIjC,IAAIiH,EAAYjH,EAAoB,IAChCsH,EAAWtH,EAAoB,GAC/BsJ,EAAkBtJ,EAAoB,IAC1CG,EAAOD,QAAU,SAAU6X,GACzB,OAAO,SAAU9P,EAAO+P,EAAIC,GAC1B,IAGI3S,EAHAF,EAAI6B,EAAUgB,GACdtE,EAAS2D,EAASlC,EAAEzB,QACpB0E,EAAQiB,EAAgB2O,EAAWtU,GAIvC,GAAIoU,GAAeC,GAAMA,GAAI,KAAgB3P,EAAT1E,GAGlC,IAFA2B,EAAQF,EAAEiD,OAEG/C,EAAO,OAAO,OAEtB,KAAe+C,EAAT1E,EAAgB0E,IAAS,IAAI0P,GAAe1P,KAASjD,IAC5DA,EAAEiD,KAAW2P,EAAI,OAAOD,GAAe1P,GAAS,EACpD,OAAQ0P,IAAgB,KAOxB,SAAU5X,EAAQD,GAExBA,EAAQiF,EAAItE,OAAOqX,uBAKb,SAAU/X,EAAQD,EAASF,GAGjC,IAAIgW,EAAMhW,EAAoB,IAC9BG,EAAOD,QAAU2K,MAAMsN,SAAW,SAASA,QAAQ9Q,GACjD,MAAmB,SAAZ2O,EAAI3O,KAMP,SAAUlH,EAAQD,EAASF,GAIjC,IAAI+I,EAAU/I,EAAoB,IAC9BkC,EAAUlC,EAAoB,GAC9BoY,EAAWpY,EAAoB,IAC/B+B,EAAO/B,EAAoB,IAC3BgK,EAAYhK,EAAoB,IAChCqY,EAAcrY,EAAoB,IAClCsY,EAAiBtY,EAAoB,IACrC6F,EAAiB7F,EAAoB,IACrC8M,EAAW9M,EAAoB,EAApBA,CAAuB,YAClCuY,IAAU,GAAG1M,MAAQ,QAAU,GAAGA,QAGlC2M,EAAS,SAETC,EAAa,WAAc,OAAOhV,MAEtCtD,EAAOD,QAAU,SAAU8R,EAAMxL,EAAM6P,EAAapH,EAAMyJ,EAASC,EAAQC,GACzEP,EAAYhC,EAAa7P,EAAMyI,GAC/B,IAeI4J,EAASxW,EAAKyW,EAfdC,EAAY,SAAUC,GACxB,IAAKT,GAASS,KAAQzJ,EAAO,OAAOA,EAAMyJ,GAC1C,OAAQA,GACN,IAVK,OAUM,OAAO,SAASnN,OAAS,OAAO,IAAIwK,EAAY5S,KAAMuV,IACjE,KAAKR,EAAQ,OAAO,SAAS7M,SAAW,OAAO,IAAI0K,EAAY5S,KAAMuV,IACrE,OAAO,SAASjN,UAAY,OAAO,IAAIsK,EAAY5S,KAAMuV,KAEzDjM,EAAMvG,EAAO,YACbyS,EAAaP,GAAWF,EACxBU,GAAa,EACb3J,EAAQyC,EAAKxQ,UACb2X,EAAU5J,EAAMzC,IAAayC,EAnBjB,eAmBuCmJ,GAAWnJ,EAAMmJ,GACpEU,EAAWD,GAAWJ,EAAUL,GAChCW,EAAWX,EAAWO,EAAwBF,EAAU,WAArBK,EAAkCvZ,GACrEyZ,EAAqB,SAAR9S,GAAkB+I,EAAMxD,SAAqBoN,EAwB9D,GArBIG,IACFR,EAAoBjT,EAAeyT,EAAWhZ,KAAK,IAAI0R,OAC7BnR,OAAOW,WAAasX,EAAkB7J,OAE9DqJ,EAAeQ,EAAmB/L,GAAK,GAElChE,GAAiD,mBAA/B+P,EAAkBhM,IAAyB/K,EAAK+W,EAAmBhM,EAAU2L,IAIpGQ,GAAcE,GAAWA,EAAQzY,OAAS8X,IAC5CU,GAAa,EACbE,EAAW,SAASzN,SAAW,OAAOwN,EAAQ7Y,KAAKmD,QAG/CsF,IAAW6P,IAAYL,IAASW,GAAe3J,EAAMzC,IACzD/K,EAAKwN,EAAOzC,EAAUsM,GAGxBpP,EAAUxD,GAAQ4S,EAClBpP,EAAU+C,GAAO0L,EACbC,EAMF,GALAG,EAAU,CACRlN,OAAQsN,EAAaG,EAAWL,EAAUP,GAC1C3M,KAAM8M,EAASS,EAAWL,EAhDrB,QAiDLhN,QAASsN,GAEPT,EAAQ,IAAKvW,KAAOwW,EAChBxW,KAAOkN,GAAQ6I,EAAS7I,EAAOlN,EAAKwW,EAAQxW,SAC7CH,EAAQA,EAAQa,EAAIb,EAAQO,GAAK8V,GAASW,GAAa1S,EAAMqS,GAEtE,OAAOA,IAMH,SAAU1Y,EAAQD,EAASF,GAIjC,IAAIgI,EAAShI,EAAoB,IAC7BuZ,EAAavZ,EAAoB,IACjCsY,EAAiBtY,EAAoB,IACrC8Y,EAAoB,GAGxB9Y,EAAoB,GAApBA,CAAwB8Y,EAAmB9Y,EAAoB,EAApBA,CAAuB,YAAa,WAAc,OAAOyD,OAEpGtD,EAAOD,QAAU,SAAUmW,EAAa7P,EAAMyI,GAC5CoH,EAAY7U,UAAYwG,EAAO8Q,EAAmB,CAAE7J,KAAMsK,EAAW,EAAGtK,KACxEqJ,EAAejC,EAAa7P,EAAO,eAM/B,SAAUrG,EAAQD,EAASF,GAGjC,IAAI+E,EAAW/E,EAAoB,GAC/B4G,EAAY5G,EAAoB,IAChC6W,EAAU7W,EAAoB,EAApBA,CAAuB,WACrCG,EAAOD,QAAU,SAAUkF,EAAGoU,GAC5B,IACI3W,EADAS,EAAIyB,EAASK,GAAGU,YAEpB,OAAOxC,IAAMzD,KAAcgD,EAAIkC,EAASzB,GAAGuT,KAAahX,GAAY2Z,EAAI5S,EAAU/D,KAM9E,SAAU1C,EAAQD,EAASF,GAEjC,IACIyZ,EADSzZ,EAAoB,GACVyZ,UAEvBtZ,EAAOD,QAAUuZ,GAAaA,EAAUC,WAAa,IAK/C,SAAUvZ,EAAQD,EAASF,GAIjC,IAAI4B,EAAS5B,EAAoB,GAC7BkC,EAAUlC,EAAoB,GAC9BsU,EAAOtU,EAAoB,IAC3B+F,EAAQ/F,EAAoB,GAC5B+B,EAAO/B,EAAoB,IAC3BoJ,EAAcpJ,EAAoB,IAClC2Z,EAAQ3Z,EAAoB,IAC5BkJ,EAAalJ,EAAoB,IACjCiE,EAAWjE,EAAoB,GAC/BsY,EAAiBtY,EAAoB,IACrCkF,EAAKlF,EAAoB,GAAGmF,EAC5ByU,EAAO5Z,EAAoB,GAApBA,CAAwB,GAC/B4W,EAAc5W,EAAoB,GAEtCG,EAAOD,QAAU,SAAUsG,EAAMmL,EAASkH,EAASgB,EAAQnS,EAAQoS,GACjE,IAAI9H,EAAOpQ,EAAO4E,GACdlD,EAAI0O,EACJ+H,EAAQrS,EAAS,MAAQ,MACzB6H,EAAQjM,GAAKA,EAAE9B,UACf4D,EAAI,GAqCR,OApCKwR,GAA2B,mBAALtT,IAAqBwW,GAAWvK,EAAMS,UAAYjK,EAAM,YACjF,IAAIzC,GAAIyI,UAAUkD,WAOlB3L,EAAIqO,EAAQ,SAAUtO,EAAQyS,GAC5B5M,EAAW7F,EAAQC,EAAGkD,EAAM,MAC5BnD,EAAO2W,GAAK,IAAIhI,EACZ8D,GAAYjW,IAAW8Z,EAAM7D,EAAUpO,EAAQrE,EAAO0W,GAAQ1W,KAEpEuW,EAAK,kEAAkEjT,MAAM,KAAM,SAAUkC,GAC3F,IAAIoR,EAAkB,OAAPpR,GAAuB,OAAPA,EAC3BA,KAAO0G,KAAWuK,GAAkB,SAAPjR,IAAiB9G,EAAKuB,EAAE9B,UAAWqH,EAAK,SAAUtF,EAAGC,GAEpF,GADA0F,EAAWzF,KAAMH,EAAGuF,IACfoR,GAAYH,IAAY7V,EAASV,GAAI,MAAc,OAAPsF,GAAehJ,GAChE,IAAIyI,EAAS7E,KAAKuW,GAAGnR,GAAW,IAANtF,EAAU,EAAIA,EAAGC,GAC3C,OAAOyW,EAAWxW,KAAO6E,MAG7BwR,GAAW5U,EAAG5B,EAAE9B,UAAW,OAAQ,CACjCP,IAAK,WACH,OAAOwC,KAAKuW,GAAGE,UApBnB5W,EAAIuW,EAAOM,eAAexI,EAASnL,EAAMkB,EAAQqS,GACjD3Q,EAAY9F,EAAE9B,UAAWqX,GACzBvE,EAAKC,MAAO,GAuBd+D,EAAehV,EAAGkD,GAElBpB,EAAEoB,GAAQlD,EACVpB,EAAQA,EAAQS,EAAIT,EAAQiB,EAAIjB,EAAQO,EAAG2C,GAEtC0U,GAASD,EAAOO,UAAU9W,EAAGkD,EAAMkB,GAEjCpE,IAMH,SAAUnD,EAAQD,EAASF,GAiBjC,IAfA,IASIqa,EATAzY,EAAS5B,EAAoB,GAC7B+B,EAAO/B,EAAoB,IAC3B0E,EAAM1E,EAAoB,IAC1BqN,EAAQ3I,EAAI,eACZ4I,EAAO5I,EAAI,QACX6N,KAAS3Q,EAAOmJ,cAAenJ,EAAOqJ,UACtCkC,EAASoF,EACTnS,EAAI,EAIJka,EAAyB,iHAE3B3T,MAAM,KAEDvG,EAPC,IAQFia,EAAQzY,EAAO0Y,EAAuBla,QACxC2B,EAAKsY,EAAM7Y,UAAW6L,GAAO,GAC7BtL,EAAKsY,EAAM7Y,UAAW8L,GAAM,IACvBH,GAAS,EAGlBhN,EAAOD,QAAU,CACfqS,IAAKA,EACLpF,OAAQA,EACRE,MAAOA,EACPC,KAAMA,IAMF,SAAUnN,EAAQD,EAASF,GAKjCG,EAAOD,QAAUF,EAAoB,MAAQA,EAAoB,EAApBA,CAAuB,WAClE,IAAIua,EAAIlW,KAAKoS,SAGb+D,iBAAiBla,KAAK,KAAMia,EAAG,qBACxBva,EAAoB,GAAGua,MAM1B,SAAUpa,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAElCG,EAAOD,QAAU,SAAUua,GACzBvY,EAAQA,EAAQW,EAAG4X,EAAY,CAAErL,GAAI,SAASA,KAG5C,IAFA,IAAIzL,EAASD,UAAUC,OACnB+W,EAAI,IAAI7P,MAAMlH,GACXA,KAAU+W,EAAE/W,GAAUD,UAAUC,GACvC,OAAO,IAAIF,KAAKiX,QAOd,SAAUva,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B4G,EAAY5G,EAAoB,IAChC8B,EAAM9B,EAAoB,IAC1B2Z,EAAQ3Z,EAAoB,IAEhCG,EAAOD,QAAU,SAAUua,GACzBvY,EAAQA,EAAQW,EAAG4X,EAAY,CAAE/L,KAAM,SAASA,KAAKtM,GACnD,IACI2M,EAAS2L,EAAGxZ,EAAGyZ,EADfC,EAAQlX,UAAU,GAKtB,OAHAkD,EAAUnD,OACVsL,EAAU6L,IAAU/a,KACP+G,EAAUgU,GACnBxY,GAAUvC,GAAkB,IAAI4D,MACpCiX,EAAI,GACA3L,GACF7N,EAAI,EACJyZ,EAAK7Y,EAAI8Y,EAAOlX,UAAU,GAAI,GAC9BiW,EAAMvX,GAAQ,EAAO,SAAUyY,GAC7BH,EAAEnS,KAAKoS,EAAGE,EAAU3Z,SAGtByY,EAAMvX,GAAQ,EAAOsY,EAAEnS,KAAMmS,GAExB,IAAIjX,KAAKiX,SAOd,SAAUva,EAAQD,EAASF,GAEjC,IAAIiE,EAAWjE,EAAoB,GAC/BsV,EAAWtV,EAAoB,GAAGsV,SAElCwF,EAAK7W,EAASqR,IAAarR,EAASqR,EAASyF,eACjD5a,EAAOD,QAAU,SAAUgE,GACzB,OAAO4W,EAAKxF,EAASyF,cAAc7W,GAAM,KAMrC,SAAU/D,EAAQD,EAASF,GAEjCG,EAAOD,QAAUF,EAAoB,KAK/B,SAAUG,EAAQD,EAASF,GAEjC,IAAI4B,EAAS5B,EAAoB,GAC7B6B,EAAO7B,EAAoB,IAC3B+I,EAAU/I,EAAoB,IAC9Bgb,EAAShb,EAAoB,IAC7Bc,EAAiBd,EAAoB,GAAGmF,EAC5ChF,EAAOD,QAAU,SAAUQ,GACzB,IAAIua,EAAUpZ,EAAK8C,SAAW9C,EAAK8C,OAASoE,EAAU,GAAKnH,EAAO+C,QAAU,IACtD,KAAlBjE,EAAKwa,OAAO,IAAexa,KAAQua,GAAUna,EAAema,EAASva,EAAM,CAAE4E,MAAO0V,EAAO7V,EAAEzE,OAM7F,SAAUP,EAAQD,EAASF,GAEjC,IAAImT,EAASnT,EAAoB,GAApBA,CAAwB,QACjC0E,EAAM1E,EAAoB,IAC9BG,EAAOD,QAAU,SAAUmC,GACzB,OAAO8Q,EAAO9Q,KAAS8Q,EAAO9Q,GAAOqC,EAAIrC,MAMrC,SAAUlC,EAAQD,GAGxBC,EAAOD,QAAU,gGAEfyG,MAAM,MAKF,SAAUxG,EAAQD,EAASF,GAEjC,IAAIsV,EAAWtV,EAAoB,GAAGsV,SACtCnV,EAAOD,QAAUoV,GAAYA,EAAS6F,iBAKhC,SAAUhb,EAAQD,EAASF,GAKjC,IAAIob,EAAUpb,EAAoB,IAC9Bqb,EAAOrb,EAAoB,IAC3BgH,EAAMhH,EAAoB,IAC1B0F,EAAW1F,EAAoB,GAC/BwF,EAAUxF,EAAoB,IAC9Bsb,EAAUza,OAAO0a,OAGrBpb,EAAOD,SAAWob,GAAWtb,EAAoB,EAApBA,CAAuB,WAClD,IAAI0a,EAAI,GACJzX,EAAI,GAEJJ,EAAI8B,SACJ4V,EAAI,uBAGR,OAFAG,EAAE7X,GAAK,EACP0X,EAAE5T,MAAM,IAAIqJ,QAAQ,SAAUwL,GAAKvY,EAAEuY,GAAKA,IACd,GAArBF,EAAQ,GAAIZ,GAAG7X,IAAWhC,OAAOgL,KAAKyP,EAAQ,GAAIrY,IAAIsJ,KAAK,KAAOgO,IACtE,SAASgB,OAAOlY,EAAQjB,GAM3B,IALA,IAAI8T,EAAIxQ,EAASrC,GACbwL,EAAOnL,UAAUC,OACjB0E,EAAQ,EACRoT,EAAaJ,EAAKlW,EAClBuW,EAAS1U,EAAI7B,EACHkD,EAAPwG,GAML,IALA,IAIIxM,EAJAQ,EAAI2C,EAAQ9B,UAAU2E,MACtBwD,EAAO4P,EAAaL,EAAQvY,GAAGiQ,OAAO2I,EAAW5Y,IAAMuY,EAAQvY,GAC/Dc,EAASkI,EAAKlI,OACdgY,EAAI,EAEQA,EAAThY,GAAgB+X,EAAOpb,KAAKuC,EAAGR,EAAMwJ,EAAK8P,QAAOzF,EAAE7T,GAAOQ,EAAER,IACnE,OAAO6T,GACPoF,GAKE,SAAUnb,EAAQD,GAGxBC,EAAOD,QAAU,SAAU2G,EAAI+U,EAAM9U,GACnC,IAAI+U,EAAK/U,IAASjH,GAClB,OAAQ+b,EAAKjY,QACX,KAAK,EAAG,OAAOkY,EAAKhV,IACAA,EAAGvG,KAAKwG,GAC5B,KAAK,EAAG,OAAO+U,EAAKhV,EAAG+U,EAAK,IACR/U,EAAGvG,KAAKwG,EAAM8U,EAAK,IACvC,KAAK,EAAG,OAAOC,EAAKhV,EAAG+U,EAAK,GAAIA,EAAK,IACjB/U,EAAGvG,KAAKwG,EAAM8U,EAAK,GAAIA,EAAK,IAChD,KAAK,EAAG,OAAOC,EAAKhV,EAAG+U,EAAK,GAAIA,EAAK,GAAIA,EAAK,IAC1B/U,EAAGvG,KAAKwG,EAAM8U,EAAK,GAAIA,EAAK,GAAIA,EAAK,IACzD,KAAK,EAAG,OAAOC,EAAKhV,EAAG+U,EAAK,GAAIA,EAAK,GAAIA,EAAK,GAAIA,EAAK,IACnC/U,EAAGvG,KAAKwG,EAAM8U,EAAK,GAAIA,EAAK,GAAIA,EAAK,GAAIA,EAAK,IAClE,OAAO/U,EAAGjD,MAAMkD,EAAM8U,KAMpB,SAAUzb,EAAQD,EAASF,GAIjC,IAAI6E,EAAY7E,EAAoB,IAChCuF,EAAUvF,EAAoB,IAElCG,EAAOD,QAAU,SAAS4b,OAAOC,GAC/B,IAAIC,EAAM3V,OAAOd,EAAQ9B,OACrB2E,EAAM,GACNlH,EAAI2D,EAAUkX,GAClB,GAAI7a,EAAI,GAAKA,GAAK+a,SAAU,MAAM1R,WAAW,2BAC7C,KAAU,EAAJrJ,GAAQA,KAAO,KAAO8a,GAAOA,GAAc,EAAJ9a,IAAOkH,GAAO4T,GAC3D,OAAO5T,IAMH,SAAUjI,EAAQD,GAExBC,EAAOD,QAAU,oDAMX,SAAUC,EAAQD,GAGxBC,EAAOD,QAAUmE,KAAK6X,MAAQ,SAASA,KAAKC,GAE1C,OAAmB,IAAXA,GAAKA,IAAWA,GAAKA,EAAIA,EAAIA,EAAI,GAAK,EAAI,IAM9C,SAAUhc,EAAQD,GAGxB,IAAIkc,EAAS/X,KAAKgY,MAClBlc,EAAOD,SAAYkc,GAED,mBAAbA,EAAO,KAA4BA,EAAO,IAAM,qBAE7B,OAAnBA,GAAQ,OACT,SAASC,MAAMF,GACjB,OAAmB,IAAXA,GAAKA,GAAUA,GAAS,KAALA,GAAaA,EAAI,KAAOA,EAAIA,EAAIA,EAAI,EAAI9X,KAAKyE,IAAIqT,GAAK,GAC/EC,GAKE,SAAUjc,EAAQD,EAASF,GAEjC,IAAI6E,EAAY7E,EAAoB,IAChCuF,EAAUvF,EAAoB,IAGlCG,EAAOD,QAAU,SAAUoc,GACzB,OAAO,SAAUxV,EAAMyV,GACrB,IAGIhZ,EAAGC,EAHH7B,EAAI0E,OAAOd,EAAQuB,IACnB1G,EAAIyE,EAAU0X,GACdlc,EAAIsB,EAAEgC,OAEV,OAAIvD,EAAI,GAAUC,GAALD,EAAekc,EAAY,GAAKzc,IAC7C0D,EAAI5B,EAAE6a,WAAWpc,IACN,OAAc,MAAJmD,GAAcnD,EAAI,IAAMC,IAAMmD,EAAI7B,EAAE6a,WAAWpc,EAAI,IAAM,OAAc,MAAJoD,EACpF8Y,EAAY3a,EAAEuZ,OAAO9a,GAAKmD,EAC1B+Y,EAAY3a,EAAE8G,MAAMrI,EAAGA,EAAI,GAA2BoD,EAAI,OAAzBD,EAAI,OAAU,IAAqB,SAOtE,SAAUpD,EAAQD,EAASF,GAGjC,IAAIyc,EAAWzc,EAAoB,KAC/BuF,EAAUvF,EAAoB,IAElCG,EAAOD,QAAU,SAAU4G,EAAM4V,EAAclW,GAC7C,GAAIiW,EAASC,GAAe,MAAMvY,UAAU,UAAYqC,EAAO,0BAC/D,OAAOH,OAAOd,EAAQuB,MAMlB,SAAU3G,EAAQD,EAASF,GAEjC,IAAI2c,EAAQ3c,EAAoB,EAApBA,CAAuB,SACnCG,EAAOD,QAAU,SAAU2I,GACzB,IAAI+T,EAAK,IACT,IACE,MAAM/T,GAAK+T,GACX,MAAOpY,GACP,IAEE,OADAoY,EAAGD,IAAS,GACJ,MAAM9T,GAAK+T,GACnB,MAAOzX,KACT,OAAO,IAML,SAAUhF,EAAQD,EAASF,GAGjC,IAAIgK,EAAYhK,EAAoB,IAChC8M,EAAW9M,EAAoB,EAApBA,CAAuB,YAClC4K,EAAaC,MAAMrJ,UAEvBrB,EAAOD,QAAU,SAAUgE,GACzB,OAAOA,IAAOrE,KAAcmK,EAAUa,QAAU3G,GAAM0G,EAAWkC,KAAc5I,KAM3E,SAAU/D,EAAQD,EAASF,GAIjC,IAAI6c,EAAkB7c,EAAoB,GACtC+G,EAAa/G,EAAoB,IAErCG,EAAOD,QAAU,SAAUoB,EAAQ+G,EAAO/C,GACpC+C,KAAS/G,EAAQub,EAAgB1X,EAAE7D,EAAQ+G,EAAOtB,EAAW,EAAGzB,IAC/DhE,EAAO+G,GAAS/C,IAMjB,SAAUnF,EAAQD,EAASF,GAEjC,IAAI8M,EAAW9M,EAAoB,EAApBA,CAAuB,YAClC8c,GAAe,EAEnB,IACE,IAAIC,EAAQ,CAAC,GAAGjQ,KAChBiQ,EAAc,UAAI,WAAcD,GAAe,GAE/CjS,MAAM6D,KAAKqO,EAAO,WAAc,MAAM,IACtC,MAAOvY,IAETrE,EAAOD,QAAU,SAAUqE,EAAMyY,GAC/B,IAAKA,IAAgBF,EAAc,OAAO,EAC1C,IAAIvG,GAAO,EACX,IACE,IAAI0G,EAAM,CAAC,GACPpK,EAAOoK,EAAInQ,KACf+F,EAAK5D,KAAO,WAAc,MAAO,CAAEC,KAAMqH,GAAO,IAChD0G,EAAInQ,GAAY,WAAc,OAAO+F,GACrCtO,EAAK0Y,GACL,MAAOzY,IACT,OAAO+R,IAMH,SAAUpW,EAAQD,EAASF,GAGjC,IAAI8J,EAAqB9J,EAAoB,KAE7CG,EAAOD,QAAU,SAAUgd,EAAUvZ,GACnC,OAAO,IAAKmG,EAAmBoT,GAAxB,CAAmCvZ,KAMtC,SAAUxD,EAAQD,EAASF,GAKjC,IAAI0F,EAAW1F,EAAoB,GAC/BsJ,EAAkBtJ,EAAoB,IACtCsH,EAAWtH,EAAoB,GACnCG,EAAOD,QAAU,SAASyP,KAAKrK,GAO7B,IANA,IAAIF,EAAIM,EAASjC,MACbE,EAAS2D,EAASlC,EAAEzB,QACpBkL,EAAOnL,UAAUC,OACjB0E,EAAQiB,EAAuB,EAAPuF,EAAWnL,UAAU,GAAK7D,GAAW8D,GAC7DiN,EAAa,EAAP/B,EAAWnL,UAAU,GAAK7D,GAChCsd,EAASvM,IAAQ/Q,GAAY8D,EAAS2F,EAAgBsH,EAAKjN,GAC/C0E,EAAT8U,GAAgB/X,EAAEiD,KAAW/C,EACpC,OAAOF,IAMH,SAAUjF,EAAQD,EAASF,GAIjC,IAAIod,EAAmBpd,EAAoB,IACvC2O,EAAO3O,EAAoB,IAC3BgK,EAAYhK,EAAoB,IAChCiH,EAAYjH,EAAoB,IAMpCG,EAAOD,QAAUF,EAAoB,GAApBA,CAAwB6K,MAAO,QAAS,SAAUwS,EAAUrE,GAC3EvV,KAAKqT,GAAK7P,EAAUoW,GACpB5Z,KAAK6Z,GAAK,EACV7Z,KAAK8Z,GAAKvE,GAET,WACD,IAAI5T,EAAI3B,KAAKqT,GACTkC,EAAOvV,KAAK8Z,GACZlV,EAAQ5E,KAAK6Z,KACjB,OAAKlY,GAAcA,EAAEzB,QAAX0E,GACR5E,KAAKqT,GAAKjX,GACH8O,EAAK,IAEaA,EAAK,EAApB,QAARqK,EAA+B3Q,EACvB,UAAR2Q,EAAiC5T,EAAEiD,GACxB,CAACA,EAAOjD,EAAEiD,MACxB,UAGH2B,EAAUwT,UAAYxT,EAAUa,MAEhCuS,EAAiB,QACjBA,EAAiB,UACjBA,EAAiB,YAKX,SAAUjd,EAAQD,GAExBC,EAAOD,QAAU,SAAUgP,EAAM5J,GAC/B,MAAO,CAAEA,MAAOA,EAAO4J,OAAQA,KAM3B,SAAU/O,EAAQD,EAASF,GAEjC,IAaIyd,EAAOC,EAASC,EAbhB7b,EAAM9B,EAAoB,IAC1B4d,EAAS5d,EAAoB,IAC7B6d,EAAO7d,EAAoB,IAC3B8d,EAAM9d,EAAoB,IAC1B4B,EAAS5B,EAAoB,GAC7B+d,EAAUnc,EAAOmc,QACjBC,EAAUpc,EAAOqc,aACjBC,EAAYtc,EAAOuc,eACnBC,EAAiBxc,EAAOwc,eACxBC,EAAWzc,EAAOyc,SAClBC,EAAU,EACVC,EAAQ,GACRC,EAAqB,qBAErBC,EAAM,WACR,IAAIzK,GAAMvQ,KAEV,GAAI8a,EAAM9c,eAAeuS,GAAK,CAC5B,IAAInN,EAAK0X,EAAMvK,UACRuK,EAAMvK,GACbnN,MAGA6X,EAAW,SAAUC,GACvBF,EAAIne,KAAKqe,EAAMvM,OAGZ4L,GAAYE,IACfF,EAAU,SAASC,aAAapX,GAG9B,IAFA,IAAI+U,EAAO,GACPxb,EAAI,EACkBA,EAAnBsD,UAAUC,QAAYiY,EAAKrT,KAAK7E,UAAUtD,MAMjD,OALAme,IAAQD,GAAW,WAEjBV,EAAoB,mBAAN/W,EAAmBA,EAAKhD,SAASgD,GAAK+U,IAEtD6B,EAAMa,GACCA,GAETJ,EAAY,SAASC,eAAenK,UAC3BuK,EAAMvK,IAGyB,WAApChU,EAAoB,GAApBA,CAAwB+d,GAC1BN,EAAQ,SAAUzJ,GAChB+J,EAAQa,SAAS9c,EAAI2c,EAAKzK,EAAI,KAGvBqK,GAAYA,EAASQ,IAC9BpB,EAAQ,SAAUzJ,GAChBqK,EAASQ,IAAI/c,EAAI2c,EAAKzK,EAAI,KAGnBoK,GAETT,GADAD,EAAU,IAAIU,GACCU,MACfpB,EAAQqB,MAAMC,UAAYN,EAC1BjB,EAAQ3b,EAAI6b,EAAKsB,YAAatB,EAAM,IAG3B/b,EAAOsd,kBAA0C,mBAAfD,cAA8Brd,EAAOud,eAChF1B,EAAQ,SAAUzJ,GAChBpS,EAAOqd,YAAYjL,EAAK,GAAI,MAE9BpS,EAAOsd,iBAAiB,UAAWR,GAAU,IAG7CjB,EADSe,KAAsBV,EAAI,UAC3B,SAAU9J,GAChB6J,EAAKzI,YAAY0I,EAAI,WAAWU,GAAsB,WACpDX,EAAKuB,YAAY3b,MACjBgb,EAAIne,KAAK0T,KAKL,SAAUA,GAChBqL,WAAWvd,EAAI2c,EAAKzK,EAAI,GAAI,KAIlC7T,EAAOD,QAAU,CACf4N,IAAKkQ,EACLsB,MAAOpB,IAMH,SAAU/d,EAAQD,EAASF,GAEjC,IAAI4B,EAAS5B,EAAoB,GAC7Buf,EAAYvf,EAAoB,IAAI8N,IACpC0R,EAAW5d,EAAO6d,kBAAoB7d,EAAO8d,uBAC7C3B,EAAUnc,EAAOmc,QACjB4B,EAAU/d,EAAO+d,QACjBC,EAA6C,WAApC5f,EAAoB,GAApBA,CAAwB+d,GAErC5d,EAAOD,QAAU,WACf,IAAI2f,EAAMC,EAAMC,EAEZC,EAAQ,WACV,IAAIC,EAAQpZ,EAEZ,IADI+Y,IAAWK,EAASlC,EAAQmC,SAASD,EAAOE,OACzCN,GAAM,CACXhZ,EAAKgZ,EAAKhZ,GACVgZ,EAAOA,EAAK5Q,KACZ,IACEpI,IACA,MAAOrC,GAGP,MAFIqb,EAAME,IACLD,EAAOjgB,GACN2E,GAERsb,EAAOjgB,GACLogB,GAAQA,EAAOG,SAIrB,GAAIR,EACFG,EAAS,WACPhC,EAAQa,SAASoB,SAGd,IAAIR,GAAc5d,EAAO6X,WAAa7X,EAAO6X,UAAU4G,WAQvD,GAAIV,GAAWA,EAAQW,QAAS,CAErC,IAAIC,EAAUZ,EAAQW,QAAQzgB,IAC9BkgB,EAAS,WACPQ,EAAQC,KAAKR,SASfD,EAAS,WAEPR,EAAUjf,KAAKsB,EAAQoe,QAvBgD,CACzE,IAAIS,GAAS,EACTC,EAAOpL,SAASqL,eAAe,IACnC,IAAInB,EAASQ,GAAOY,QAAQF,EAAM,CAAEG,eAAe,IACnDd,EAAS,WACPW,EAAKtO,KAAOqO,GAAUA,GAsB1B,OAAO,SAAU5Z,GACf,IAAIia,EAAO,CAAEja,GAAIA,EAAIoI,KAAMpP,IACvBigB,IAAMA,EAAK7Q,KAAO6R,GACjBjB,IACHA,EAAOiB,EACPf,KACAD,EAAOgB,KAOP,SAAU3gB,EAAQD,EAASF,GAKjC,IAAI4G,EAAY5G,EAAoB,IAEpC,SAAS+gB,kBAAkBzd,GACzB,IAAIgd,EAASU,EACbvd,KAAK8c,QAAU,IAAIjd,EAAE,SAAU2d,EAAWC,GACxC,GAAIZ,IAAYzgB,IAAamhB,IAAWnhB,GAAW,MAAMsE,UAAU,2BACnEmc,EAAUW,EACVD,EAASE,IAEXzd,KAAK6c,QAAU1Z,EAAU0Z,GACzB7c,KAAKud,OAASpa,EAAUoa,GAG1B7gB,EAAOD,QAAQiF,EAAI,SAAU7B,GAC3B,OAAO,IAAIyd,kBAAkBzd,KAMzB,SAAUnD,EAAQD,EAASF,GAGjC,IAAIyJ,EAAOzJ,EAAoB,IAC3Bqb,EAAOrb,EAAoB,IAC3B+E,EAAW/E,EAAoB,GAC/BmhB,EAAUnhB,EAAoB,GAAGmhB,QACrChhB,EAAOD,QAAUihB,GAAWA,EAAQC,SAAW,SAASA,QAAQld,GAC9D,IAAI2H,EAAOpC,EAAKtE,EAAEJ,EAASb,IACvBuX,EAAaJ,EAAKlW,EACtB,OAAOsW,EAAa5P,EAAKiH,OAAO2I,EAAWvX,IAAO2H,IAM9C,SAAU1L,EAAQD,EAASF,GAIjC,IAAI4B,EAAS5B,EAAoB,GAC7B4W,EAAc5W,EAAoB,GAClC+I,EAAU/I,EAAoB,IAC9BgJ,EAAShJ,EAAoB,IAC7B+B,EAAO/B,EAAoB,IAC3BoJ,EAAcpJ,EAAoB,IAClC+F,EAAQ/F,EAAoB,GAC5BkJ,EAAalJ,EAAoB,IACjC6E,EAAY7E,EAAoB,IAChCsH,EAAWtH,EAAoB,GAC/BqJ,EAAUrJ,EAAoB,KAC9ByJ,EAAOzJ,EAAoB,IAAImF,EAC/BD,EAAKlF,EAAoB,GAAGmF,EAC5BgF,EAAYnK,EAAoB,IAChCsY,EAAiBtY,EAAoB,IACrCyK,EAAe,cACf4W,EAAY,WACZpf,EAAY,YAEZqf,EAAc,eACdxW,EAAelJ,EAAO6I,GACtBO,EAAYpJ,EAAOyf,GACnBhd,EAAOzC,EAAOyC,KACdkG,EAAa3I,EAAO2I,WAEpB0R,EAAWra,EAAOqa,SAClBsF,EAAazW,EACb0W,EAAMnd,EAAKmd,IACXC,EAAMpd,EAAKod,IACX9Y,EAAQtE,EAAKsE,MACb+Y,EAAMrd,EAAKqd,IACXC,EAAMtd,EAAKsd,IAEXC,EAAc,aACdC,EAAc,aACdC,EAAUlL,EAAc,KAHf,SAITmL,EAAUnL,EAAc,KAAOgL,EAC/BI,EAAUpL,EAAc,KAAOiL,EAGnC,SAASI,YAAY3c,EAAO4c,EAAMC,GAChC,IAOI3d,EAAGjE,EAAGC,EAPNoN,EAAS,IAAI/C,MAAMsX,GACnBC,EAAgB,EAATD,EAAaD,EAAO,EAC3BG,GAAQ,GAAKD,GAAQ,EACrBE,EAAQD,GAAQ,EAChBE,EAAc,KAATL,EAAcT,EAAI,GAAI,IAAMA,EAAI,GAAI,IAAM,EAC/CrhB,EAAI,EACJuB,EAAI2D,EAAQ,GAAe,IAAVA,GAAe,EAAIA,EAAQ,EAAI,EAAI,EAkCxD,KAhCAA,EAAQkc,EAAIlc,KAECA,GAASA,IAAU2W,GAE9B1b,EAAI+E,GAASA,EAAQ,EAAI,EACzBd,EAAI6d,IAEJ7d,EAAImE,EAAM+Y,EAAIpc,GAASqc,GACnBrc,GAAS9E,EAAIihB,EAAI,GAAIjd,IAAM,IAC7BA,IACAhE,GAAK,GAOU,IAJf8E,GADe,GAAbd,EAAI8d,EACGC,EAAK/hB,EAEL+hB,EAAKd,EAAI,EAAG,EAAIa,IAEf9hB,IACVgE,IACAhE,GAAK,GAEU6hB,GAAb7d,EAAI8d,GACN/hB,EAAI,EACJiE,EAAI6d,GACkB,GAAb7d,EAAI8d,GACb/hB,GAAK+E,EAAQ9E,EAAI,GAAKihB,EAAI,EAAGS,GAC7B1d,GAAQ8d,IAER/hB,EAAI+E,EAAQmc,EAAI,EAAGa,EAAQ,GAAKb,EAAI,EAAGS,GACvC1d,EAAI,IAGO,GAAR0d,EAAWtU,EAAOxN,KAAW,IAAJG,EAASA,GAAK,IAAK2hB,GAAQ,GAG3D,IAFA1d,EAAIA,GAAK0d,EAAO3hB,EAChB6hB,GAAQF,EACM,EAAPE,EAAUxU,EAAOxN,KAAW,IAAJoE,EAASA,GAAK,IAAK4d,GAAQ,GAE1D,OADAxU,IAASxN,IAAU,IAAJuB,EACRiM,EAET,SAAS4U,cAAc5U,EAAQsU,EAAMC,GACnC,IAOI5hB,EAPA6hB,EAAgB,EAATD,EAAaD,EAAO,EAC3BG,GAAQ,GAAKD,GAAQ,EACrBE,EAAQD,GAAQ,EAChBI,EAAQL,EAAO,EACfhiB,EAAI+hB,EAAS,EACbxgB,EAAIiM,EAAOxN,KACXoE,EAAQ,IAAJ7C,EAGR,IADAA,IAAM,EACS,EAAR8gB,EAAWje,EAAQ,IAAJA,EAAUoJ,EAAOxN,GAAIA,IAAKqiB,GAAS,GAIzD,IAHAliB,EAAIiE,GAAK,IAAMie,GAAS,EACxBje,KAAOie,EACPA,GAASP,EACM,EAARO,EAAWliB,EAAQ,IAAJA,EAAUqN,EAAOxN,GAAIA,IAAKqiB,GAAS,GACzD,GAAU,IAANje,EACFA,EAAI,EAAI8d,MACH,CAAA,GAAI9d,IAAM6d,EACf,OAAO9hB,EAAImiB,IAAM/gB,GAAKsa,EAAWA,EAEjC1b,GAAQkhB,EAAI,EAAGS,GACf1d,GAAQ8d,EACR,OAAQ3gB,GAAK,EAAI,GAAKpB,EAAIkhB,EAAI,EAAGjd,EAAI0d,GAGzC,SAASS,UAAUC,GACjB,OAAOA,EAAM,IAAM,GAAKA,EAAM,IAAM,GAAKA,EAAM,IAAM,EAAIA,EAAM,GAEjE,SAASC,OAAO3e,GACd,MAAO,CAAM,IAALA,GAEV,SAAS4e,QAAQ5e,GACf,MAAO,CAAM,IAALA,EAAWA,GAAM,EAAI,KAE/B,SAAS6e,QAAQ7e,GACf,MAAO,CAAM,IAALA,EAAWA,GAAM,EAAI,IAAMA,GAAM,GAAK,IAAMA,GAAM,GAAK,KAEjE,SAAS8e,QAAQ9e,GACf,OAAO+d,YAAY/d,EAAI,GAAI,GAE7B,SAAS+e,QAAQ/e,GACf,OAAO+d,YAAY/d,EAAI,GAAI,GAG7B,SAASoK,UAAUhL,EAAGjB,EAAKkM,GACzBrJ,EAAG5B,EAAErB,GAAYI,EAAK,CAAEpB,IAAK,WAAc,OAAOwC,KAAK8K,MAGzD,SAAStN,IAAIiiB,EAAMN,EAAOva,EAAO8a,GAC/B,IACIC,EAAW/Z,GADChB,GAEhB,GAAuB6a,EAAKnB,GAAxBqB,EAAWR,EAAuB,MAAMrY,EAAW+W,GACvD,IACI7R,EAAQ2T,EAAWF,EAAKlB,GACxBqB,EAFQH,EAAKpB,GAASwB,GAET7a,MAAMgH,EAAOA,EAAQmT,GACtC,OAAOO,EAAiBE,EAAOA,EAAK/S,UAEtC,SAASxC,IAAIoV,EAAMN,EAAOva,EAAOkb,EAAYje,EAAO6d,GAClD,IACIC,EAAW/Z,GADChB,GAEhB,GAAuB6a,EAAKnB,GAAxBqB,EAAWR,EAAuB,MAAMrY,EAAW+W,GAIvD,IAHA,IAAI7c,EAAQye,EAAKpB,GAASwB,GACtB7T,EAAQ2T,EAAWF,EAAKlB,GACxBqB,EAAOE,GAAYje,GACdlF,EAAI,EAAGA,EAAIwiB,EAAOxiB,IAAKqE,EAAMgL,EAAQrP,GAAKijB,EAAKF,EAAiB/iB,EAAIwiB,EAAQxiB,EAAI,GAG3F,GAAK4I,EAAOuJ,IAgFL,CACL,IAAKxM,EAAM,WACT+E,EAAa,OACR/E,EAAM,WACX,IAAI+E,GAAc,MACd/E,EAAM,WAIV,OAHA,IAAI+E,EACJ,IAAIA,EAAa,KACjB,IAAIA,EAAa4X,KACV5X,EAAapK,MAAQ+J,IAC1B,CAMF,IADA,IACyCpI,EADrCmhB,GAJJ1Y,EAAe,SAASC,YAAYpH,GAElC,OADAuF,EAAWzF,KAAMqH,GACV,IAAIyW,EAAWlY,EAAQ1F,MAEI1B,GAAasf,EAAWtf,GACnD4J,EAAOpC,EAAK8X,GAAa5F,EAAI,EAAsBA,EAAd9P,EAAKlI,SAC1CtB,EAAMwJ,EAAK8P,QAAS7Q,GAAe/I,EAAK+I,EAAczI,EAAKkf,EAAWlf,IAE1E0G,IAASya,EAAiB1d,YAAcgF,GAG/C,IAAIoY,EAAO,IAAIlY,EAAU,IAAIF,EAAa,IACtC2Y,EAAWzY,EAAU/I,GAAWyhB,QACpCR,EAAKQ,QAAQ,EAAG,YAChBR,EAAKQ,QAAQ,EAAG,aACZR,EAAKS,QAAQ,IAAOT,EAAKS,QAAQ,IAAIva,EAAY4B,EAAU/I,GAAY,CACzEyhB,QAAS,SAASA,QAAQ5S,EAAYxL,GACpCme,EAASnjB,KAAKmD,KAAMqN,EAAYxL,GAAS,IAAM,KAEjDse,SAAU,SAASA,SAAS9S,EAAYxL,GACtCme,EAASnjB,KAAKmD,KAAMqN,EAAYxL,GAAS,IAAM,OAEhD,QAhHHwF,EAAe,SAASC,YAAYpH,GAClCuF,EAAWzF,KAAMqH,EAAcL,GAC/B,IAAIiI,EAAarJ,EAAQ1F,GACzBF,KAAK6f,GAAKnZ,EAAU7J,KAAK,IAAIuK,MAAM6H,GAAa,GAChDjP,KAAKse,GAAWrP,GAGlB1H,EAAY,SAASC,SAAS2C,EAAQkD,EAAY4B,GAChDxJ,EAAWzF,KAAMuH,EAAWqW,GAC5BnY,EAAW0E,EAAQ9C,EAAcuW,GACjC,IAAIwC,EAAejW,EAAOmU,GACtB9T,EAASpJ,EAAUiM,GACvB,GAAI7C,EAAS,GAAc4V,EAAT5V,EAAuB,MAAM1D,EAAW,iBAE1D,GAA0BsZ,EAAtB5V,GADJyE,EAAaA,IAAe7S,GAAYgkB,EAAe5V,EAAS3G,EAASoL,IACjC,MAAMnI,EAxJ/B,iBAyJf9G,KAAKqe,GAAWlU,EAChBnK,KAAKue,GAAW/T,EAChBxK,KAAKse,GAAWrP,GAGdkE,IACFtI,UAAUxD,EAAc8W,EAAa,MACrCtT,UAAUtD,EAlJD,SAkJoB,MAC7BsD,UAAUtD,EAAW4W,EAAa,MAClCtT,UAAUtD,EAAW6W,EAAa,OAGpCzY,EAAY4B,EAAU/I,GAAY,CAChC0hB,QAAS,SAASA,QAAQ7S,GACxB,OAAO7P,IAAIwC,KAAM,EAAGqN,GAAY,IAAM,IAAM,IAE9CgT,SAAU,SAASA,SAAShT,GAC1B,OAAO7P,IAAIwC,KAAM,EAAGqN,GAAY,IAElCiT,SAAU,SAASA,SAASjT,GAC1B,IAAI8R,EAAQ3hB,IAAIwC,KAAM,EAAGqN,EAAYpN,UAAU,IAC/C,OAAQkf,EAAM,IAAM,EAAIA,EAAM,KAAO,IAAM,IAE7CoB,UAAW,SAASA,UAAUlT,GAC5B,IAAI8R,EAAQ3hB,IAAIwC,KAAM,EAAGqN,EAAYpN,UAAU,IAC/C,OAAOkf,EAAM,IAAM,EAAIA,EAAM,IAE/BqB,SAAU,SAASA,SAASnT,GAC1B,OAAO6R,UAAU1hB,IAAIwC,KAAM,EAAGqN,EAAYpN,UAAU,MAEtDwgB,UAAW,SAASA,UAAUpT,GAC5B,OAAO6R,UAAU1hB,IAAIwC,KAAM,EAAGqN,EAAYpN,UAAU,OAAS,GAE/DygB,WAAY,SAASA,WAAWrT,GAC9B,OAAO0R,cAAcvhB,IAAIwC,KAAM,EAAGqN,EAAYpN,UAAU,IAAK,GAAI,IAEnE0gB,WAAY,SAASA,WAAWtT,GAC9B,OAAO0R,cAAcvhB,IAAIwC,KAAM,EAAGqN,EAAYpN,UAAU,IAAK,GAAI,IAEnEggB,QAAS,SAASA,QAAQ5S,EAAYxL,GACpCwI,IAAIrK,KAAM,EAAGqN,EAAY+R,OAAQvd,IAEnCse,SAAU,SAASA,SAAS9S,EAAYxL,GACtCwI,IAAIrK,KAAM,EAAGqN,EAAY+R,OAAQvd,IAEnC+e,SAAU,SAASA,SAASvT,EAAYxL,GACtCwI,IAAIrK,KAAM,EAAGqN,EAAYgS,QAASxd,EAAO5B,UAAU,KAErD4gB,UAAW,SAASA,UAAUxT,EAAYxL,GACxCwI,IAAIrK,KAAM,EAAGqN,EAAYgS,QAASxd,EAAO5B,UAAU,KAErD6gB,SAAU,SAASA,SAASzT,EAAYxL,GACtCwI,IAAIrK,KAAM,EAAGqN,EAAYiS,QAASzd,EAAO5B,UAAU,KAErD8gB,UAAW,SAASA,UAAU1T,EAAYxL,GACxCwI,IAAIrK,KAAM,EAAGqN,EAAYiS,QAASzd,EAAO5B,UAAU,KAErD+gB,WAAY,SAASA,WAAW3T,EAAYxL,GAC1CwI,IAAIrK,KAAM,EAAGqN,EAAYmS,QAAS3d,EAAO5B,UAAU,KAErDghB,WAAY,SAASA,WAAW5T,EAAYxL,GAC1CwI,IAAIrK,KAAM,EAAGqN,EAAYkS,QAAS1d,EAAO5B,UAAU,OAsCzD4U,EAAexN,EAAcL,GAC7B6N,EAAetN,EAAWqW,GAC1Btf,EAAKiJ,EAAU/I,GAAY+G,EAAOsE,MAAM,GACxCpN,EAAQuK,GAAgBK,EACxB5K,EAAQmhB,GAAarW,GAKf,SAAU7K,EAAQD,GAExBC,EAAOD,QAAU,SAAUykB,EAAQpe,GACjC,IAAIqe,EAAWre,IAAY1F,OAAO0F,GAAW,SAAUse,GACrD,OAAOte,EAAQse,IACbte,EACJ,OAAO,SAAUrC,GACf,OAAOmC,OAAOnC,GAAIqC,QAAQoe,EAAQC,MAOhC,SAAUzkB,EAAQD,EAASF,GAEjCG,EAAOD,SAAWF,EAAoB,KAAOA,EAAoB,EAApBA,CAAuB,WAClE,OAA2G,GAApGa,OAAOC,eAAed,EAAoB,GAApBA,CAAwB,OAAQ,IAAK,CAAEiB,IAAK,WAAc,OAAO,KAAQsC,KAMlG,SAAUpD,EAAQD,EAASF,GAEjCE,EAAQiF,EAAInF,EAAoB,IAK1B,SAAUG,EAAQD,EAASF,GAEjC,IAAIgC,EAAMhC,EAAoB,IAC1BiH,EAAYjH,EAAoB,IAChCyL,EAAezL,EAAoB,GAApBA,EAAwB,GACvC2F,EAAW3F,EAAoB,GAApBA,CAAwB,YAEvCG,EAAOD,QAAU,SAAUoB,EAAQwjB,GACjC,IAGIziB,EAHA+C,EAAI6B,EAAU3F,GACdlB,EAAI,EACJkI,EAAS,GAEb,IAAKjG,KAAO+C,EAAO/C,GAAOsD,GAAU3D,EAAIoD,EAAG/C,IAAQiG,EAAOC,KAAKlG,GAE/D,KAAsBjC,EAAf0kB,EAAMnhB,QAAgB3B,EAAIoD,EAAG/C,EAAMyiB,EAAM1kB,SAC7CqL,EAAanD,EAAQjG,IAAQiG,EAAOC,KAAKlG,IAE5C,OAAOiG,IAMH,SAAUnI,EAAQD,EAASF,GAEjC,IAAIkF,EAAKlF,EAAoB,GACzB+E,EAAW/E,EAAoB,GAC/Bob,EAAUpb,EAAoB,IAElCG,EAAOD,QAAUF,EAAoB,GAAKa,OAAOkkB,iBAAmB,SAASA,iBAAiB3f,EAAGuQ,GAC/F5Q,EAASK,GAKT,IAJA,IAGIrC,EAHA8I,EAAOuP,EAAQzF,GACfhS,EAASkI,EAAKlI,OACdvD,EAAI,EAEQA,EAATuD,GAAYuB,EAAGC,EAAEC,EAAGrC,EAAI8I,EAAKzL,KAAMuV,EAAW5S,IACrD,OAAOqC,IAMH,SAAUjF,EAAQD,EAASF,GAGjC,IAAIiH,EAAYjH,EAAoB,IAChCyJ,EAAOzJ,EAAoB,IAAImF,EAC/BqD,EAAW,GAAGA,SAEdwc,EAA+B,iBAAV5gB,QAAsBA,QAAUvD,OAAOoW,oBAC5DpW,OAAOoW,oBAAoB7S,QAAU,GAUzCjE,EAAOD,QAAQiF,EAAI,SAAS8R,oBAAoB/S,GAC9C,OAAO8gB,GAAoC,mBAArBxc,EAASlI,KAAK4D,GATjB,SAAUA,GAC7B,IACE,OAAOuF,EAAKvF,GACZ,MAAOM,GACP,OAAOwgB,EAAYvc,SAK0Cwc,CAAe/gB,GAAMuF,EAAKxC,EAAU/C,MAM/F,SAAU/D,EAAQD,EAASF,GAIjC,IAAIiE,EAAWjE,EAAoB,GAC/B+E,EAAW/E,EAAoB,GAC/BklB,EAAQ,SAAU9f,EAAGmK,GAEvB,GADAxK,EAASK,IACJnB,EAASsL,IAAoB,OAAVA,EAAgB,MAAMpL,UAAUoL,EAAQ,8BAElEpP,EAAOD,QAAU,CACf4N,IAAKjN,OAAOskB,iBAAmB,aAAe,GAC5C,SAAU1e,EAAM2e,EAAOtX,GACrB,KACEA,EAAM9N,EAAoB,GAApBA,CAAwB6D,SAASvD,KAAMN,EAAoB,IAAImF,EAAEtE,OAAOW,UAAW,aAAasM,IAAK,IACvGrH,EAAM,IACV2e,IAAU3e,aAAgBoE,OAC1B,MAAOrG,GAAK4gB,GAAQ,EACtB,OAAO,SAASD,eAAe/f,EAAGmK,GAIhC,OAHA2V,EAAM9f,EAAGmK,GACL6V,EAAOhgB,EAAEigB,UAAY9V,EACpBzB,EAAI1I,EAAGmK,GACLnK,GAVX,CAYE,IAAI,GAASvF,IACjBqlB,MAAOA,IAMH,SAAU/kB,EAAQD,EAASF,GAIjC,IAAI4G,EAAY5G,EAAoB,IAChCiE,EAAWjE,EAAoB,GAC/B4d,EAAS5d,EAAoB,IAC7B0M,EAAa,GAAGjE,MAChB6c,EAAY,GAUhBnlB,EAAOD,QAAU2D,SAAS0hB,MAAQ,SAASA,KAAKze,GAC9C,IAAID,EAAKD,EAAUnD,MACf+hB,EAAW9Y,EAAWpM,KAAKoD,UAAW,GACtC+hB,EAAQ,WACV,IAAI7J,EAAO4J,EAAS1S,OAAOpG,EAAWpM,KAAKoD,YAC3C,OAAOD,gBAAgBgiB,EAbX,SAAUhjB,EAAG0O,EAAKyK,GAChC,KAAMzK,KAAOmU,GAAY,CACvB,IAAK,IAAIpkB,EAAI,GAAId,EAAI,EAAGA,EAAI+Q,EAAK/Q,IAAKc,EAAEd,GAAK,KAAOA,EAAI,IAExDklB,EAAUnU,GAAOtN,SAAS,MAAO,gBAAkB3C,EAAEqL,KAAK,KAAO,KACjE,OAAO+Y,EAAUnU,GAAK1O,EAAGmZ,GAQM8J,CAAU7e,EAAI+U,EAAKjY,OAAQiY,GAAQgC,EAAO/W,EAAI+U,EAAM9U,IAGrF,OADI7C,EAAS4C,EAAGrF,aAAYikB,EAAMjkB,UAAYqF,EAAGrF,WAC1CikB,IAMH,SAAUtlB,EAAQD,EAASF,GAEjC,IAAIgW,EAAMhW,EAAoB,IAC9BG,EAAOD,QAAU,SAAUgE,EAAIyhB,GAC7B,GAAiB,iBAANzhB,GAA6B,UAAX8R,EAAI9R,GAAiB,MAAMC,UAAUwhB,GAClE,OAAQzhB,IAMJ,SAAU/D,EAAQD,EAASF,GAGjC,IAAIiE,EAAWjE,EAAoB,GAC/B2I,EAAQtE,KAAKsE,MACjBxI,EAAOD,QAAU,SAAS0lB,UAAU1hB,GAClC,OAAQD,EAASC,IAAO2hB,SAAS3hB,IAAOyE,EAAMzE,KAAQA,IAMlD,SAAU/D,EAAQD,EAASF,GAEjC,IAAI8lB,EAAc9lB,EAAoB,GAAG+lB,WACrCC,EAAQhmB,EAAoB,IAAI0X,KAEpCvX,EAAOD,QAAU,EAAI4lB,EAAY9lB,EAAoB,IAAM,QAAWic,SAAW,SAAS8J,WAAW/J,GACnG,IAAI9V,EAAS8f;AAAM3f,OAAO2V,GAAM,GAC5B1T,EAASwd,EAAY5f,GACzB,OAAkB,IAAXoC,GAAoC,KAApBpC,EAAOgV,OAAO,IAAa,EAAI5S,GACpDwd,GAKE,SAAU3lB,EAAQD,EAASF,GAEjC,IAAIimB,EAAYjmB,EAAoB,GAAGkmB,SACnCF,EAAQhmB,EAAoB,IAAI0X,KAChCyO,EAAKnmB,EAAoB,IACzBomB,EAAM,cAEVjmB,EAAOD,QAAmC,IAAzB+lB,EAAUE,EAAK,OAA0C,KAA3BF,EAAUE,EAAK,QAAiB,SAASD,SAASlK,EAAKqK,GACpG,IAAIngB,EAAS8f,EAAM3f,OAAO2V,GAAM,GAChC,OAAOiK,EAAU/f,EAASmgB,IAAU,IAAOD,EAAI3f,KAAKP,GAAU,GAAK,MACjE+f,GAKE,SAAU9lB,EAAQD,GAGxBC,EAAOD,QAAUmE,KAAKiiB,OAAS,SAASA,MAAMnK,GAC5C,OAAmB,MAAXA,GAAKA,IAAcA,EAAI,KAAOA,EAAIA,EAAIA,EAAI,EAAI9X,KAAKqd,IAAI,EAAIvF,KAM/D,SAAUhc,EAAQD,EAASF,GAGjC,IAAIkc,EAAOlc,EAAoB,IAC3ByhB,EAAMpd,KAAKod,IACX8E,EAAU9E,EAAI,GAAI,IAClB+E,EAAY/E,EAAI,GAAI,IACpBgF,EAAQhF,EAAI,EAAG,MAAQ,EAAI+E,GAC3BE,EAAQjF,EAAI,GAAI,KAMpBthB,EAAOD,QAAUmE,KAAKsiB,QAAU,SAASA,OAAOxK,GAC9C,IAEI5Y,EAAG+E,EAFHse,EAAOviB,KAAKmd,IAAIrF,GAChB0K,EAAQ3K,EAAKC,GAEjB,OAAIyK,EAAOF,EAAcG,GAAwBD,EAAOF,EAAQF,EAPrD,EAAID,EAAU,EAAIA,GAOgDG,EAAQF,EAIxEC,GAFbne,GADA/E,GAAK,EAAIijB,EAAYD,GAAWK,IAClBrjB,EAAIqjB,KAEIte,GAAUA,EAAeue,EAAQ5K,SAChD4K,EAAQve,IAMX,SAAUnI,EAAQD,EAASF,GAGjC,IAAIiE,EAAWjE,EAAoB,GAC/BgW,EAAMhW,EAAoB,IAC1B2c,EAAQ3c,EAAoB,EAApBA,CAAuB,SACnCG,EAAOD,QAAU,SAAUgE,GACzB,IAAIuY,EACJ,OAAOxY,EAASC,MAASuY,EAAWvY,EAAGyY,MAAY9c,KAAc4c,EAAsB,UAAXzG,EAAI9R,MAM5E,SAAU/D,EAAQD,EAASF,GAGjC,IAAI+E,EAAW/E,EAAoB,GACnCG,EAAOD,QAAU,SAAU0O,EAAU/H,EAAIvB,EAAOyG,GAC9C,IACE,OAAOA,EAAUlF,EAAG9B,EAASO,GAAO,GAAIA,EAAM,IAAMuB,EAAGvB,GAEvD,MAAOd,GACP,IAAIsiB,EAAMlY,EAAiB,UAE3B,MADIkY,IAAQjnB,IAAWkF,EAAS+hB,EAAIxmB,KAAKsO,IACnCpK,KAOJ,SAAUrE,EAAQD,EAASF,GAEjC,IAAI4G,EAAY5G,EAAoB,IAChC0F,EAAW1F,EAAoB,GAC/BwF,EAAUxF,EAAoB,IAC9BsH,EAAWtH,EAAoB,GAEnCG,EAAOD,QAAU,SAAU4G,EAAMoB,EAAY2G,EAAMkY,EAAMC,GACvDpgB,EAAUsB,GACV,IAAI9C,EAAIM,EAASoB,GACbxC,EAAOkB,EAAQJ,GACfzB,EAAS2D,EAASlC,EAAEzB,QACpB0E,EAAQ2e,EAAUrjB,EAAS,EAAI,EAC/BvD,EAAI4mB,GAAW,EAAI,EACvB,GAAInY,EAAO,EAAG,OAAS,CACrB,GAAIxG,KAAS/D,EAAM,CACjByiB,EAAOziB,EAAK+D,GACZA,GAASjI,EACT,MAGF,GADAiI,GAASjI,EACL4mB,EAAU3e,EAAQ,EAAI1E,GAAU0E,EAClC,MAAMlE,UAAU,+CAGpB,KAAM6iB,EAAmB,GAAT3e,EAAsBA,EAAT1E,EAAgB0E,GAASjI,EAAOiI,KAAS/D,IACpEyiB,EAAO7e,EAAW6e,EAAMziB,EAAK+D,GAAQA,EAAOjD,IAE9C,OAAO2hB,IAMH,SAAU5mB,EAAQD,EAASF,GAKjC,IAAI0F,EAAW1F,EAAoB,GAC/BsJ,EAAkBtJ,EAAoB,IACtCsH,EAAWtH,EAAoB,GAEnCG,EAAOD,QAAU,GAAGsP,YAAc,SAASA,WAAWnM,EAAkBoM,GACtE,IAAIrK,EAAIM,EAASjC,MACb0N,EAAM7J,EAASlC,EAAEzB,QACjBsjB,EAAK3d,EAAgBjG,EAAQ8N,GAC7BzC,EAAOpF,EAAgBmG,EAAO0B,GAC9BP,EAAyB,EAAnBlN,UAAUC,OAAaD,UAAU,GAAK7D,GAC5Ckc,EAAQ1X,KAAKS,KAAK8L,IAAQ/Q,GAAYsR,EAAM7H,EAAgBsH,EAAKO,IAAQzC,EAAMyC,EAAM8V,GACrFC,EAAM,EAMV,IALIxY,EAAOuY,GAAMA,EAAKvY,EAAOqN,IAC3BmL,GAAO,EACPxY,GAAQqN,EAAQ,EAChBkL,GAAMlL,EAAQ,GAEC,EAAVA,KACDrN,KAAQtJ,EAAGA,EAAE6hB,GAAM7hB,EAAEsJ,UACbtJ,EAAE6hB,GACdA,GAAMC,EACNxY,GAAQwY,EACR,OAAO9hB,IAML,SAAUjF,EAAQD,GAExBC,EAAOD,QAAU,SAAUqE,GACzB,IACE,MAAO,CAAEC,GAAG,EAAO6N,EAAG9N,KACtB,MAAOC,GACP,MAAO,CAAEA,GAAG,EAAM6N,EAAG7N,MAOnB,SAAUrE,EAAQD,EAASF,GAEjC,IAAI+E,EAAW/E,EAAoB,GAC/BiE,EAAWjE,EAAoB,GAC/BmnB,EAAuBnnB,EAAoB,IAE/CG,EAAOD,QAAU,SAAUoD,EAAG6Y,GAE5B,GADApX,EAASzB,GACLW,EAASkY,IAAMA,EAAErW,cAAgBxC,EAAG,OAAO6Y,EAC/C,IAAIiL,EAAoBD,EAAqBhiB,EAAE7B,GAG/C,OADAgd,EADc8G,EAAkB9G,SACxBnE,GACDiL,EAAkB7G,UAMrB,SAAUpgB,EAAQD,EAASF,GAIjC,IAAIqnB,EAASrnB,EAAoB,KAC7BkO,EAAWlO,EAAoB,IAInCG,EAAOD,QAAUF,EAAoB,GAApBA,CAHP,MAGoC,SAAUiB,GACtD,OAAO,SAASiS,MAAQ,OAAOjS,EAAIwC,KAAyB,EAAnBC,UAAUC,OAAaD,UAAU,GAAK7D,MAC9E,CAEDoB,IAAK,SAASA,IAAIoB,GAChB,IAAIilB,EAAQD,EAAOE,SAASrZ,EAASzK,KAR/B,OAQ2CpB,GACjD,OAAOilB,GAASA,EAAMjV,GAGxBvE,IAAK,SAASA,IAAIzL,EAAKiD,GACrB,OAAO+hB,EAAO3Q,IAAIxI,EAASzK,KAbrB,OAayC,IAARpB,EAAY,EAAIA,EAAKiD,KAE7D+hB,GAAQ,IAKL,SAAUlnB,EAAQD,EAASF,GAIjC,IAAIkF,EAAKlF,EAAoB,GAAGmF,EAC5B6C,EAAShI,EAAoB,IAC7BoJ,EAAcpJ,EAAoB,IAClC8B,EAAM9B,EAAoB,IAC1BkJ,EAAalJ,EAAoB,IACjC2Z,EAAQ3Z,EAAoB,IAC5BwnB,EAAcxnB,EAAoB,IAClC2O,EAAO3O,EAAoB,IAC3BkK,EAAalK,EAAoB,IACjC4W,EAAc5W,EAAoB,GAClCwU,EAAUxU,EAAoB,IAAIwU,QAClCtG,EAAWlO,EAAoB,IAC/BynB,EAAO7Q,EAAc,KAAO,OAE5B2Q,EAAW,SAAUzgB,EAAMzE,GAE7B,IACIilB,EADAjf,EAAQmM,EAAQnS,GAEpB,GAAc,MAAVgG,EAAe,OAAOvB,EAAKwW,GAAGjV,GAElC,IAAKif,EAAQxgB,EAAK4gB,GAAIJ,EAAOA,EAAQA,EAAMpmB,EACzC,GAAIomB,EAAM9L,GAAKnZ,EAAK,OAAOilB,GAI/BnnB,EAAOD,QAAU,CACfia,eAAgB,SAAUxI,EAASnL,EAAMkB,EAAQqS,GAC/C,IAAIzW,EAAIqO,EAAQ,SAAU7K,EAAMgP,GAC9B5M,EAAWpC,EAAMxD,EAAGkD,EAAM,MAC1BM,EAAKgQ,GAAKtQ,EACVM,EAAKwW,GAAKtV,EAAO,MACjBlB,EAAK4gB,GAAK7nB,GACViH,EAAK6gB,GAAK9nB,GACViH,EAAK2gB,GAAQ,EACT3R,GAAYjW,IAAW8Z,EAAM7D,EAAUpO,EAAQZ,EAAKiT,GAAQjT,KAsDlE,OApDAsC,EAAY9F,EAAE9B,UAAW,CAGvB8d,MAAO,SAASA,QACd,IAAK,IAAIxY,EAAOoH,EAASzK,KAAM+C,GAAO4L,EAAOtL,EAAKwW,GAAIgK,EAAQxgB,EAAK4gB,GAAIJ,EAAOA,EAAQA,EAAMpmB,EAC1FomB,EAAMM,GAAI,EACNN,EAAM5lB,IAAG4lB,EAAM5lB,EAAI4lB,EAAM5lB,EAAER,EAAIrB,WAC5BuS,EAAKkV,EAAMlnB,GAEpB0G,EAAK4gB,GAAK5gB,EAAK6gB,GAAK9nB,GACpBiH,EAAK2gB,GAAQ,GAIfI,SAAU,SAAUxlB,GAClB,IAAIyE,EAAOoH,EAASzK,KAAM+C,GACtB8gB,EAAQC,EAASzgB,EAAMzE,GAC3B,GAAIilB,EAAO,CACT,IAAIrY,EAAOqY,EAAMpmB,EACb4mB,EAAOR,EAAM5lB,SACVoF,EAAKwW,GAAGgK,EAAMlnB,GACrBknB,EAAMM,GAAI,EACNE,IAAMA,EAAK5mB,EAAI+N,GACfA,IAAMA,EAAKvN,EAAIomB,GACfhhB,EAAK4gB,IAAMJ,IAAOxgB,EAAK4gB,GAAKzY,GAC5BnI,EAAK6gB,IAAML,IAAOxgB,EAAK6gB,GAAKG,GAChChhB,EAAK2gB,KACL,QAASH,GAIbtX,QAAS,SAASA,QAAQ9H,GACxBgG,EAASzK,KAAM+C,GAGf,IAFA,IACI8gB,EADAniB,EAAIrD,EAAIoG,EAA+B,EAAnBxE,UAAUC,OAAaD,UAAU,GAAK7D,GAAW,GAElEynB,EAAQA,EAAQA,EAAMpmB,EAAIuC,KAAKikB,IAGpC,IAFAviB,EAAEmiB,EAAMjV,EAAGiV,EAAM9L,EAAG/X,MAEb6jB,GAASA,EAAMM,GAAGN,EAAQA,EAAM5lB,GAK3CM,IAAK,SAASA,IAAIK,GAChB,QAASklB,EAASrZ,EAASzK,KAAM+C,GAAOnE,MAGxCuU,GAAa1R,EAAG5B,EAAE9B,UAAW,OAAQ,CACvCP,IAAK,WACH,OAAOiN,EAASzK,KAAM+C,GAAMihB,MAGzBnkB,GAEToT,IAAK,SAAU5P,EAAMzE,EAAKiD,GACxB,IACIwiB,EAAMzf,EADNif,EAAQC,EAASzgB,EAAMzE,GAoBzB,OAjBEilB,EACFA,EAAMjV,EAAI/M,GAGVwB,EAAK6gB,GAAKL,EAAQ,CAChBlnB,EAAGiI,EAAQmM,EAAQnS,GAAK,GACxBmZ,EAAGnZ,EACHgQ,EAAG/M,EACH5D,EAAGomB,EAAOhhB,EAAK6gB,GACfzmB,EAAGrB,GACH+nB,GAAG,GAEA9gB,EAAK4gB,KAAI5gB,EAAK4gB,GAAKJ,GACpBQ,IAAMA,EAAK5mB,EAAIomB,GACnBxgB,EAAK2gB,KAES,MAAVpf,IAAevB,EAAKwW,GAAGjV,GAASif,IAC7BxgB,GAEXygB,SAAUA,EACVnN,UAAW,SAAU9W,EAAGkD,EAAMkB,GAG5B8f,EAAYlkB,EAAGkD,EAAM,SAAU6W,EAAUrE,GACvCvV,KAAKqT,GAAK5I,EAASmP,EAAU7W,GAC7B/C,KAAK8Z,GAAKvE,EACVvV,KAAKkkB,GAAK9nB,IACT,WAKD,IAJA,IAAIiH,EAAOrD,KACPuV,EAAOlS,EAAKyW,GACZ+J,EAAQxgB,EAAK6gB,GAEVL,GAASA,EAAMM,GAAGN,EAAQA,EAAM5lB,EAEvC,OAAKoF,EAAKgQ,KAAQhQ,EAAK6gB,GAAKL,EAAQA,EAAQA,EAAMpmB,EAAI4F,EAAKgQ,GAAG4Q,IAMnC/Y,EAAK,EAApB,QAARqK,EAA+BsO,EAAM9L,EAC7B,UAARxC,EAAiCsO,EAAMjV,EAC5B,CAACiV,EAAM9L,EAAG8L,EAAMjV,KAN7BvL,EAAKgQ,GAAKjX,GACH8O,EAAK,KAMbjH,EAAS,UAAY,UAAWA,GAAQ,GAG3CwC,EAAW1D,MAOT,SAAUrG,EAAQD,EAASF,GAIjC,IAAIqnB,EAASrnB,EAAoB,KAC7BkO,EAAWlO,EAAoB,IAInCG,EAAOD,QAAUF,EAAoB,GAApBA,CAHP,MAGoC,SAAUiB,GACtD,OAAO,SAAS8mB,MAAQ,OAAO9mB,EAAIwC,KAAyB,EAAnBC,UAAUC,OAAaD,UAAU,GAAK7D,MAC9E,CAEDmoB,IAAK,SAASA,IAAI1iB,GAChB,OAAO+hB,EAAO3Q,IAAIxI,EAASzK,KARrB,OAQiC6B,EAAkB,IAAVA,EAAc,EAAIA,EAAOA,KAEzE+hB,IAKG,SAAUlnB,EAAQD,EAASF,GAIjC,IAaIioB,EAbArO,EAAO5Z,EAAoB,GAApBA,CAAwB,GAC/BoY,EAAWpY,EAAoB,IAC/BsU,EAAOtU,EAAoB,IAC3Bub,EAASvb,EAAoB,IAC7BkoB,EAAOloB,EAAoB,KAC3BiE,EAAWjE,EAAoB,GAC/B+F,EAAQ/F,EAAoB,GAC5BkO,EAAWlO,EAAoB,IAC/BmoB,EAAW,UACX1T,EAAUH,EAAKG,QACfR,EAAepT,OAAOoT,aACtBmU,EAAsBF,EAAKG,QAC3BC,EAAM,GAGN3W,EAAU,SAAU1Q,GACtB,OAAO,SAASsnB,UACd,OAAOtnB,EAAIwC,KAAyB,EAAnBC,UAAUC,OAAaD,UAAU,GAAK7D,MAIvDgZ,EAAU,CAEZ5X,IAAK,SAASA,IAAIoB,GAChB,GAAI4B,EAAS5B,GAAM,CACjB,IAAI+P,EAAOqC,EAAQpS,GACnB,OAAa,IAAT+P,EAAsBgW,EAAoBla,EAASzK,KAAM0kB,IAAWlnB,IAAIoB,GACrE+P,EAAOA,EAAK3O,KAAK6Z,IAAMzd,KAIlCiO,IAAK,SAASA,IAAIzL,EAAKiD,GACrB,OAAO4iB,EAAKxR,IAAIxI,EAASzK,KAAM0kB,GAAW9lB,EAAKiD,KAK/CkjB,EAAWroB,EAAOD,QAAUF,EAAoB,GAApBA,CAAwBmoB,EAAUxW,EAASkH,EAASqP,GAAM,GAAM,GAG5FniB,EAAM,WAAc,OAAyE,IAAlE,IAAIyiB,GAAW1a,KAAKjN,OAAO4nB,QAAU5nB,QAAQynB,GAAM,GAAGrnB,IAAIqnB,OAEvF/M,GADA0M,EAAcC,EAAK/N,eAAexI,EAASwW,IACxB3mB,UAAWqX,GAC9BvE,EAAKC,MAAO,EACZqF,EAAK,CAAC,SAAU,MAAO,MAAO,OAAQ,SAAUvX,GAC9C,IAAIkN,EAAQiZ,EAAShnB,UACjB4F,EAASmI,EAAMlN,GACnB+V,EAAS7I,EAAOlN,EAAK,SAAUkB,EAAGC,GAEhC,GAAIS,EAASV,KAAO0Q,EAAa1Q,GAAI,CAC9BE,KAAKikB,KAAIjkB,KAAKikB,GAAK,IAAIO,GAC5B,IAAI3f,EAAS7E,KAAKikB,GAAGrlB,GAAKkB,EAAGC,GAC7B,MAAc,OAAPnB,EAAeoB,KAAO6E,EAE7B,OAAOlB,EAAO9G,KAAKmD,KAAMF,EAAGC,SAQ9B,SAAUrD,EAAQD,EAASF,GAIjC,IAAIoJ,EAAcpJ,EAAoB,IAClCyU,EAAUzU,EAAoB,IAAIyU,QAClC1P,EAAW/E,EAAoB,GAC/BiE,EAAWjE,EAAoB,GAC/BkJ,EAAalJ,EAAoB,IACjC2Z,EAAQ3Z,EAAoB,IAC5B4J,EAAoB5J,EAAoB,IACxC0oB,EAAO1oB,EAAoB,IAC3BkO,EAAWlO,EAAoB,IAC/BsL,EAAY1B,EAAkB,GAC9B2B,EAAiB3B,EAAkB,GACnCoK,EAAK,EAGLoU,EAAsB,SAAUthB,GAClC,OAAOA,EAAK6gB,KAAO7gB,EAAK6gB,GAAK,IAAIgB,IAE/BA,EAAsB,WACxBllB,KAAKF,EAAI,IAEPqlB,EAAqB,SAAUnkB,EAAOpC,GACxC,OAAOiJ,EAAU7G,EAAMlB,EAAG,SAAUW,GAClC,OAAOA,EAAG,KAAO7B,KAGrBsmB,EAAoBnnB,UAAY,CAC9BP,IAAK,SAAUoB,GACb,IAAIilB,EAAQsB,EAAmBnlB,KAAMpB,GACrC,GAAIilB,EAAO,OAAOA,EAAM,IAE1BtlB,IAAK,SAAUK,GACb,QAASumB,EAAmBnlB,KAAMpB,IAEpCyL,IAAK,SAAUzL,EAAKiD,GAClB,IAAIgiB,EAAQsB,EAAmBnlB,KAAMpB,GACjCilB,EAAOA,EAAM,GAAKhiB,EACjB7B,KAAKF,EAAEgF,KAAK,CAAClG,EAAKiD,KAEzBuiB,SAAU,SAAUxlB,GAClB,IAAIgG,EAAQkD,EAAe9H,KAAKF,EAAG,SAAUW,GAC3C,OAAOA,EAAG,KAAO7B,IAGnB,OADKgG,GAAO5E,KAAKF,EAAEslB,OAAOxgB,EAAO,MACvBA,IAIdlI,EAAOD,QAAU,CACfia,eAAgB,SAAUxI,EAASnL,EAAMkB,EAAQqS,GAC/C,IAAIzW,EAAIqO,EAAQ,SAAU7K,EAAMgP,GAC9B5M,EAAWpC,EAAMxD,EAAGkD,EAAM,MAC1BM,EAAKgQ,GAAKtQ,EACVM,EAAKwW,GAAKtJ,IAEN8B,IADJhP,EAAK6gB,GAAK9nB,KACiB8Z,EAAM7D,EAAUpO,EAAQZ,EAAKiT,GAAQjT,KAoBlE,OAlBAsC,EAAY9F,EAAE9B,UAAW,CAGvBqmB,SAAU,SAAUxlB,GAClB,IAAK4B,EAAS5B,GAAM,OAAO,EAC3B,IAAI+P,EAAOqC,EAAQpS,GACnB,OAAa,IAAT+P,EAAsBgW,EAAoBla,EAASzK,KAAM+C,IAAe,UAAEnE,GACvE+P,GAAQsW,EAAKtW,EAAM3O,KAAK6Z,YAAclL,EAAK3O,KAAK6Z,KAIzDtb,IAAK,SAASA,IAAIK,GAChB,IAAK4B,EAAS5B,GAAM,OAAO,EAC3B,IAAI+P,EAAOqC,EAAQpS,GACnB,OAAa,IAAT+P,EAAsBgW,EAAoBla,EAASzK,KAAM+C,IAAOxE,IAAIK,GACjE+P,GAAQsW,EAAKtW,EAAM3O,KAAK6Z,OAG5Bha,GAEToT,IAAK,SAAU5P,EAAMzE,EAAKiD,GACxB,IAAI8M,EAAOqC,EAAQ1P,EAAS1C,IAAM,GAGlC,OAFa,IAAT+P,EAAegW,EAAoBthB,GAAMgH,IAAIzL,EAAKiD,GACjD8M,EAAKtL,EAAKwW,IAAMhY,EACdwB,GAETuhB,QAASD,IAML,SAAUjoB,EAAQD,EAASF,GAKjC,IAAI+F,EAAQ/F,EAAoB,GAC5B8oB,EAAUC,KAAKvnB,UAAUsnB,QACzBE,EAAeD,KAAKvnB,UAAUynB,YAE9BC,EAAK,SAAUC,GACjB,OAAa,EAANA,EAAUA,EAAM,IAAMA,GAI/BhpB,EAAOD,QAAW6F,EAAM,WACtB,MAAiD,4BAA1CijB,EAAa1oB,KAAK,IAAIyoB,MAAM,KAAO,QACrChjB,EAAM,WACXijB,EAAa1oB,KAAK,IAAIyoB,KAAKrG,QACvB,SAASuG,cACb,IAAKpD,SAASiD,EAAQxoB,KAAKmD,OAAQ,MAAM8G,WAAW,sBACpD,IAAI9J,EAAIgD,KACJ2lB,EAAI3oB,EAAE4oB,iBACN9oB,EAAIE,EAAE6oB,qBACN3nB,EAAIynB,EAAI,EAAI,IAAU,KAAJA,EAAW,IAAM,GACvC,OAAOznB,GAAK,QAAU0C,KAAKmd,IAAI4H,IAAI3gB,MAAM9G,GAAK,GAAK,GACjD,IAAMunB,EAAGzoB,EAAE8oB,cAAgB,GAAK,IAAML,EAAGzoB,EAAE+oB,cAC3C,IAAMN,EAAGzoB,EAAEgpB,eAAiB,IAAMP,EAAGzoB,EAAEipB,iBACvC,IAAMR,EAAGzoB,EAAEkpB,iBAAmB,KAAW,GAAJppB,EAASA,EAAI,IAAM2oB,EAAG3oB,IAAM,KACjEyoB,GAKE,SAAU7oB,EAAQD,EAASF,GAGjC,IAAI6E,EAAY7E,EAAoB,IAChCsH,EAAWtH,EAAoB,GACnCG,EAAOD,QAAU,SAAUgE,GACzB,GAAIA,IAAOrE,GAAW,OAAO,EAC7B,IAAI+pB,EAAS/kB,EAAUX,GACnBP,EAAS2D,EAASsiB,GACtB,GAAIA,IAAWjmB,EAAQ,MAAM4G,WAAW,iBACxC,OAAO5G,IAMH,SAAUxD,EAAQD,EAASF,GAKjC,IAAImY,EAAUnY,EAAoB,IAC9BiE,EAAWjE,EAAoB,GAC/BsH,EAAWtH,EAAoB,GAC/B8B,EAAM9B,EAAoB,IAC1B6pB,EAAuB7pB,EAAoB,EAApBA,CAAuB,sBAgClDG,EAAOD,QA9BP,SAAS4pB,iBAAiBzmB,EAAQ6Z,EAAU9a,EAAQ2nB,EAAWta,EAAOua,EAAOC,EAAQC,GAMnF,IALA,IAGIC,EAASC,EAHTC,EAAc5a,EACd6a,EAAc,EACd1P,IAAQqP,GAASnoB,EAAImoB,EAAQC,EAAS,GAGnCI,EAAcP,GAAW,CAC9B,GAAIO,KAAeloB,EAAQ,CASzB,GARA+nB,EAAUvP,EAAQA,EAAMxY,EAAOkoB,GAAcA,EAAapN,GAAY9a,EAAOkoB,GAE7EF,GAAa,EACTnmB,EAASkmB,KAEXC,GADAA,EAAaD,EAAQN,MACOhqB,KAAcuqB,EAAajS,EAAQgS,IAG7DC,GAAsB,EAARJ,EAChBK,EAAcP,iBAAiBzmB,EAAQ6Z,EAAUiN,EAAS7iB,EAAS6iB,EAAQxmB,QAAS0mB,EAAaL,EAAQ,GAAK,MACzG,CACL,GAAmB,kBAAfK,EAAiC,MAAMlmB,YAC3Cd,EAAOgnB,GAAeF,EAGxBE,IAEFC,IAEF,OAAOD,IAQH,SAAUlqB,EAAQD,EAASF,GAGjC,IAAIsH,EAAWtH,EAAoB,GAC/B8b,EAAS9b,EAAoB,IAC7BuF,EAAUvF,EAAoB,IAElCG,EAAOD,QAAU,SAAU4G,EAAMyjB,EAAWC,EAAYC,GACtD,IAAI5nB,EAAIwD,OAAOd,EAAQuB,IACnB4jB,EAAe7nB,EAAEc,OACjBgnB,EAAUH,IAAe3qB,GAAY,IAAMwG,OAAOmkB,GAClDI,EAAetjB,EAASijB,GAC5B,GAAIK,GAAgBF,GAA2B,IAAXC,EAAe,OAAO9nB,EAC1D,IAAIgoB,EAAUD,EAAeF,EACzBI,EAAehP,EAAOxb,KAAKqqB,EAAStmB,KAAKqE,KAAKmiB,EAAUF,EAAQhnB,SAEpE,OAD0BknB,EAAtBC,EAAannB,SAAkBmnB,EAAeA,EAAariB,MAAM,EAAGoiB,IACjEJ,EAAOK,EAAejoB,EAAIA,EAAIioB,IAMjC,SAAU3qB,EAAQD,EAASF,GAEjC,IAAIob,EAAUpb,EAAoB,IAC9BiH,EAAYjH,EAAoB,IAChC0b,EAAS1b,EAAoB,IAAImF,EACrChF,EAAOD,QAAU,SAAU6qB,GACzB,OAAO,SAAU7mB,GAOf,IANA,IAKI7B,EALA+C,EAAI6B,EAAU/C,GACd2H,EAAOuP,EAAQhW,GACfzB,EAASkI,EAAKlI,OACdvD,EAAI,EACJkI,EAAS,GAEGlI,EAATuD,GAAgB+X,EAAOpb,KAAK8E,EAAG/C,EAAMwJ,EAAKzL,OAC/CkI,EAAOC,KAAKwiB,EAAY,CAAC1oB,EAAK+C,EAAE/C,IAAQ+C,EAAE/C,IAC1C,OAAOiG,KAOP,SAAUnI,EAAQD,EAASF,GAGjC,IAAIuJ,EAAUvJ,EAAoB,IAC9B0O,EAAO1O,EAAoB,KAC/BG,EAAOD,QAAU,SAAUsG,GACzB,OAAO,SAASwkB,SACd,GAAIzhB,EAAQ9F,OAAS+C,EAAM,MAAMrC,UAAUqC,EAAO,yBAClD,OAAOkI,EAAKjL,SAOV,SAAUtD,EAAQD,EAASF,GAEjC,IAAI2Z,EAAQ3Z,EAAoB,IAEhCG,EAAOD,QAAU,SAAU2S,EAAM/F,GAC/B,IAAIxE,EAAS,GAEb,OADAqR,EAAM9G,GAAM,EAAOvK,EAAOC,KAAMD,EAAQwE,GACjCxE,IAMH,SAAUnI,EAAQD,GAGxBC,EAAOD,QAAUmE,KAAK4mB,OAAS,SAASA,MAAM9O,EAAG+O,EAAOC,EAAQC,EAAQC,GACtE,OACuB,IAArB3nB,UAAUC,QAELwY,GAAKA,GAEL+O,GAASA,GAETC,GAAUA,GAEVC,GAAUA,GAEVC,GAAWA,EACT3I,IACLvG,IAAMF,UAAYE,KAAOF,SAAiBE,GACtCA,EAAI+O,IAAUG,EAAUD,IAAWD,EAASD,GAASE,IAMzD,SAAUjrB,EAAQD,EAASF,GAEjC,IAAIuJ,EAAUvJ,EAAoB,IAC9B8M,EAAW9M,EAAoB,EAApBA,CAAuB,YAClCgK,EAAYhK,EAAoB,IACpCG,EAAOD,QAAUF,EAAoB,IAAIsrB,WAAa,SAAUpnB,GAC9D,IAAIkB,EAAIvE,OAAOqD,GACf,OAAOkB,EAAE0H,KAAcjN,IAClB,eAAgBuF,GAEhB4E,EAAUvI,eAAe8H,EAAQnE,MAMlC,SAAUjF,EAAQD,EAASF,GAIjC,IAAIurB,EAAOvrB,EAAoB,KAC3B4d,EAAS5d,EAAoB,IAC7B4G,EAAY5G,EAAoB,IACpCG,EAAOD,QAAU,WAOf,IANA,IAAI2G,EAAKD,EAAUnD,MACfE,EAASD,UAAUC,OACnB6nB,EAAQ,IAAI3gB,MAAMlH,GAClBvD,EAAI,EACJuT,EAAI4X,EAAK5X,EACT8X,GAAS,EACGrrB,EAATuD,IAAiB6nB,EAAMprB,GAAKsD,UAAUtD,QAAUuT,IAAG8X,GAAS,GACnE,OAAO,WACL,IAII7P,EAHA/M,EAAOnL,UAAUC,OACjBgY,EAAI,EACJH,EAAI,EAER,IAAKiQ,IAAW5c,EAAM,OAAO+O,EAAO/W,EAAI2kB,EAL7B/nB,MAOX,GADAmY,EAAO4P,EAAM/iB,QACTgjB,EAAQ,KAAe9P,EAAThY,EAAYgY,IAASC,EAAKD,KAAOhI,IAAGiI,EAAKD,GAAKjY,UAAU8X,MAC1E,KAAcA,EAAP3M,GAAU+M,EAAKrT,KAAK7E,UAAU8X,MACrC,OAAOoC,EAAO/W,EAAI+U,EATPnY,SAgBT,SAAUtD,EAAQD,EAASF,GAEjCG,EAAOD,QAAUF,EAAoB,KAK/B,SAAUG,EAAQD,EAASF,GAEjC,IAAIkF,EAAKlF,EAAoB,GACzBkH,EAAOlH,EAAoB,IAC3BohB,EAAUphB,EAAoB,IAC9BiH,EAAYjH,EAAoB,IAEpCG,EAAOD,QAAU,SAASwrB,OAAOroB,EAAQsoB,GAKvC,IAJA,IAGItpB,EAHAwJ,EAAOuV,EAAQna,EAAU0kB,IACzBhoB,EAASkI,EAAKlI,OACdvD,EAAI,EAEQA,EAATuD,GAAYuB,EAAGC,EAAE9B,EAAQhB,EAAMwJ,EAAKzL,KAAM8G,EAAK/B,EAAEwmB,EAAOtpB,IAC/D,OAAOgB,IAMH,SAAUlD,EAAQD,EAASF,GAEjCA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,IACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,IACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBG,EAAOD,QAAUF,EAAoB,MAK/B,SAAUG,EAAQD,EAASF,GAKjC,IAAI4B,EAAS5B,EAAoB,GAC7BgC,EAAMhC,EAAoB,IAC1B4W,EAAc5W,EAAoB,GAClCkC,EAAUlC,EAAoB,GAC9BoY,EAAWpY,EAAoB,IAC/B8T,EAAO9T,EAAoB,IAAI6I,IAC/B+iB,EAAS5rB,EAAoB,GAC7BmT,EAASnT,EAAoB,IAC7BsY,EAAiBtY,EAAoB,IACrC0E,EAAM1E,EAAoB,IAC1B2J,EAAM3J,EAAoB,GAC1Bgb,EAAShb,EAAoB,IAC7B6rB,EAAY7rB,EAAoB,IAChC8rB,EAAW9rB,EAAoB,KAC/BmY,EAAUnY,EAAoB,IAC9B+E,EAAW/E,EAAoB,GAC/BiE,EAAWjE,EAAoB,GAC/BiH,EAAYjH,EAAoB,IAChCiF,EAAcjF,EAAoB,IAClC+G,EAAa/G,EAAoB,IACjC+rB,EAAU/rB,EAAoB,IAC9BgsB,EAAUhsB,EAAoB,IAC9BsK,EAAQtK,EAAoB,IAC5BqK,EAAMrK,EAAoB,GAC1B2U,EAAQ3U,EAAoB,IAC5BkH,EAAOoD,EAAMnF,EACbD,EAAKmF,EAAIlF,EACTsE,EAAOuiB,EAAQ7mB,EACf8V,EAAUrZ,EAAO+C,OACjBsnB,EAAQrqB,EAAOsqB,KACfC,EAAaF,GAASA,EAAMG,UAC5BnqB,EAAY,YACZoqB,EAAS1iB,EAAI,WACb2iB,EAAe3iB,EAAI,eACnB+R,EAAS,GAAG3E,qBACZwV,EAAiBpZ,EAAO,mBACxBqZ,EAAarZ,EAAO,WACpBsZ,EAAYtZ,EAAO,cACnBvN,EAAc/E,OAAOoB,GACrByqB,EAA+B,mBAAXzR,EACpB0R,EAAU/qB,EAAO+qB,QAEjBC,GAAUD,IAAYA,EAAQ1qB,KAAe0qB,EAAQ1qB,GAAW4qB,UAGhEC,EAAgBlW,GAAegV,EAAO,WACxC,OAES,GAFFG,EAAQ7mB,EAAG,GAAI,IAAK,CACzBjE,IAAK,WAAc,OAAOiE,EAAGzB,KAAM,IAAK,CAAE6B,MAAO,IAAK/B,MACpDA,IACD,SAAUW,EAAI7B,EAAKmX,GACtB,IAAIuT,EAAY7lB,EAAKtB,EAAavD,GAC9B0qB,UAAkBnnB,EAAYvD,GAClC6C,EAAGhB,EAAI7B,EAAKmX,GACRuT,GAAa7oB,IAAO0B,GAAaV,EAAGU,EAAavD,EAAK0qB,IACxD7nB,EAEA8nB,EAAO,SAAU7mB,GACnB,IAAI8mB,EAAMT,EAAWrmB,GAAO4lB,EAAQ9Q,EAAQhZ,IAE5C,OADAgrB,EAAI1P,GAAKpX,EACF8mB,GAGLC,EAAWR,GAAyC,iBAApBzR,EAAQrM,SAAuB,SAAU1K,GAC3E,MAAoB,iBAANA,GACZ,SAAUA,GACZ,OAAOA,aAAc+W,GAGnB4B,EAAkB,SAAS/b,eAAeoD,EAAI7B,EAAKmX,GAKrD,OAJItV,IAAO0B,GAAaiX,EAAgB4P,EAAWpqB,EAAKmX,GACxDzU,EAASb,GACT7B,EAAM4C,EAAY5C,GAAK,GACvB0C,EAASyU,GACLxX,EAAIwqB,EAAYnqB,IACbmX,EAAExY,YAIDgB,EAAIkC,EAAImoB,IAAWnoB,EAAGmoB,GAAQhqB,KAAM6B,EAAGmoB,GAAQhqB,IAAO,GAC1DmX,EAAIuS,EAAQvS,EAAG,CAAExY,WAAY+F,EAAW,GAAG,OAJtC/E,EAAIkC,EAAImoB,IAASnnB,EAAGhB,EAAImoB,EAAQtlB,EAAW,EAAG,KACnD7C,EAAGmoB,GAAQhqB,IAAO,GAIXyqB,EAAc5oB,EAAI7B,EAAKmX,IACzBtU,EAAGhB,EAAI7B,EAAKmX,IAEnB2T,EAAoB,SAASpI,iBAAiB7gB,EAAInB,GACpDgC,EAASb,GAKT,IAJA,IAGI7B,EAHAwJ,EAAOigB,EAAS/oB,EAAIkE,EAAUlE,IAC9B3C,EAAI,EACJC,EAAIwL,EAAKlI,OAEFvD,EAAJC,GAAOwc,EAAgB3Y,EAAI7B,EAAMwJ,EAAKzL,KAAM2C,EAAEV,IACrD,OAAO6B,GAKLkpB,EAAwB,SAASrW,qBAAqB1U,GACxD,IAAIgrB,EAAI3R,EAAOpb,KAAKmD,KAAMpB,EAAM4C,EAAY5C,GAAK,IACjD,QAAIoB,OAASmC,GAAe5D,EAAIwqB,EAAYnqB,KAASL,EAAIyqB,EAAWpqB,QAC7DgrB,IAAMrrB,EAAIyB,KAAMpB,KAASL,EAAIwqB,EAAYnqB,IAAQL,EAAIyB,KAAM4oB,IAAW5oB,KAAK4oB,GAAQhqB,KAAOgrB,IAE/FC,EAA4B,SAASnmB,yBAAyBjD,EAAI7B,GAGpE,GAFA6B,EAAK+C,EAAU/C,GACf7B,EAAM4C,EAAY5C,GAAK,GACnB6B,IAAO0B,IAAe5D,EAAIwqB,EAAYnqB,IAASL,EAAIyqB,EAAWpqB,GAAlE,CACA,IAAImX,EAAItS,EAAKhD,EAAI7B,GAEjB,OADImX,IAAKxX,EAAIwqB,EAAYnqB,IAAUL,EAAIkC,EAAImoB,IAAWnoB,EAAGmoB,GAAQhqB,KAAOmX,EAAExY,YAAa,GAChFwY,IAEL+T,EAAuB,SAAStW,oBAAoB/S,GAKtD,IAJA,IAGI7B,EAHAyiB,EAAQrb,EAAKxC,EAAU/C,IACvBoE,EAAS,GACTlI,EAAI,EAEcA,EAAf0kB,EAAMnhB,QACN3B,EAAIwqB,EAAYnqB,EAAMyiB,EAAM1kB,OAASiC,GAAOgqB,GAAUhqB,GAAOyR,GAAMxL,EAAOC,KAAKlG,GACpF,OAAOiG,GAEPklB,EAAyB,SAAStV,sBAAsBhU,GAM1D,IALA,IAII7B,EAJAorB,EAAQvpB,IAAO0B,EACfkf,EAAQrb,EAAKgkB,EAAQhB,EAAYxlB,EAAU/C,IAC3CoE,EAAS,GACTlI,EAAI,EAEcA,EAAf0kB,EAAMnhB,SACP3B,EAAIwqB,EAAYnqB,EAAMyiB,EAAM1kB,OAAUqtB,IAAQzrB,EAAI4D,EAAavD,IAAciG,EAAOC,KAAKikB,EAAWnqB,IACxG,OAAOiG,GAINokB,IAYHtU,GAXA6C,EAAU,SAAStW,SACjB,GAAIlB,gBAAgBwX,EAAS,MAAM9W,UAAU,gCAC7C,IAAIgC,EAAMzB,EAAuB,EAAnBhB,UAAUC,OAAaD,UAAU,GAAK7D,IAChDmR,EAAO,SAAU1L,GACf7B,OAASmC,GAAaoL,EAAK1Q,KAAKmsB,EAAWnnB,GAC3CtD,EAAIyB,KAAM4oB,IAAWrqB,EAAIyB,KAAK4oB,GAASlmB,KAAM1C,KAAK4oB,GAAQlmB,IAAO,GACrE2mB,EAAcrpB,KAAM0C,EAAKY,EAAW,EAAGzB,KAGzC,OADIsR,GAAegW,GAAQE,EAAclnB,EAAaO,EAAK,CAAEpF,cAAc,EAAM+M,IAAKkD,IAC/Egc,EAAK7mB,KAEGlE,GAAY,WAAY,SAASuG,WAChD,OAAO/E,KAAK8Z,KAGdjT,EAAMnF,EAAImoB,EACVjjB,EAAIlF,EAAI0X,EACR7c,EAAoB,IAAImF,EAAI6mB,EAAQ7mB,EAAIooB,EACxCvtB,EAAoB,IAAImF,EAAIioB,EAC5BptB,EAAoB,IAAImF,EAAIqoB,EAExB5W,IAAgB5W,EAAoB,KACtCoY,EAASxS,EAAa,uBAAwBwnB,GAAuB,GAGvEpS,EAAO7V,EAAI,SAAUzE,GACnB,OAAOssB,EAAKrjB,EAAIjJ,MAIpBwB,EAAQA,EAAQS,EAAIT,EAAQiB,EAAIjB,EAAQO,GAAKiqB,EAAY,CAAE/nB,OAAQsW,IAEnE,IAAK,IAAIyS,GAAa,iHAGpB/mB,MAAM,KAAMgV,GAAI,EAAuBA,GAApB+R,GAAW/pB,QAAYgG,EAAI+jB,GAAW/R,OAE3D,IAAK,IAAIgS,GAAmBhZ,EAAMhL,EAAIlF,OAAQ+W,GAAI,EAA6BA,GAA1BmS,GAAiBhqB,QAAakoB,EAAU8B,GAAiBnS,OAE9GtZ,EAAQA,EAAQW,EAAIX,EAAQO,GAAKiqB,EAAY,SAAU,CAErDkB,MAAO,SAAUvrB,GACf,OAAOL,EAAIuqB,EAAgBlqB,GAAO,IAC9BkqB,EAAelqB,GACfkqB,EAAelqB,GAAO4Y,EAAQ5Y,IAGpCwrB,OAAQ,SAASA,OAAOZ,GACtB,IAAKC,EAASD,GAAM,MAAM9oB,UAAU8oB,EAAM,qBAC1C,IAAK,IAAI5qB,KAAOkqB,EAAgB,GAAIA,EAAelqB,KAAS4qB,EAAK,OAAO5qB,GAE1EyrB,UAAW,WAAclB,GAAS,GAClCmB,UAAW,WAAcnB,GAAS,KAGpC1qB,EAAQA,EAAQW,EAAIX,EAAQO,GAAKiqB,EAAY,SAAU,CAErD1kB,OA/FY,SAASA,OAAO9D,EAAInB,GAChC,OAAOA,IAAMlD,GAAYksB,EAAQ7nB,GAAMipB,EAAkBpB,EAAQ7nB,GAAKnB,IAgGtEjC,eAAgB+b,EAEhBkI,iBAAkBoI,EAElBhmB,yBAA0BmmB,EAE1BrW,oBAAqBsW,EAErBrV,sBAAuBsV,IAIzBvB,GAAS/pB,EAAQA,EAAQW,EAAIX,EAAQO,IAAMiqB,GAAcd,EAAO,WAC9D,IAAI/oB,EAAIoY,IAIR,MAA0B,UAAnBkR,EAAW,CAACtpB,KAA2C,MAAxBspB,EAAW,CAAE5oB,EAAGV,KAAyC,MAAzBspB,EAAWtrB,OAAOgC,OACrF,OAAQ,CACXupB,UAAW,SAASA,UAAUloB,GAI5B,IAHA,IAEI0gB,EAAUoJ,EAFVpS,EAAO,CAAC1X,GACR9D,EAAI,EAEkBA,EAAnBsD,UAAUC,QAAYiY,EAAKrT,KAAK7E,UAAUtD,MAEjD,GADA4tB,EAAYpJ,EAAWhJ,EAAK,IACvB3X,EAAS2gB,IAAa1gB,IAAOrE,MAAaqtB,EAAShpB,GAMxD,OALKiU,EAAQyM,KAAWA,EAAW,SAAUviB,EAAKiD,GAEhD,GADwB,mBAAb0oB,IAAyB1oB,EAAQ0oB,EAAU1tB,KAAKmD,KAAMpB,EAAKiD,KACjE4nB,EAAS5nB,GAAQ,OAAOA,IAE/BsW,EAAK,GAAKgJ,EACHuH,EAAWvoB,MAAMqoB,EAAOrQ,MAKnCX,EAAQhZ,GAAWqqB,IAAiBtsB,EAAoB,GAApBA,CAAwBib,EAAQhZ,GAAYqqB,EAAcrR,EAAQhZ,GAAW2R,SAEjH0E,EAAe2C,EAAS,UAExB3C,EAAejU,KAAM,QAAQ,GAE7BiU,EAAe1W,EAAOsqB,KAAM,QAAQ,IAK9B,SAAU/rB,EAAQD,EAASF,GAGjC,IAAIob,EAAUpb,EAAoB,IAC9Bqb,EAAOrb,EAAoB,IAC3BgH,EAAMhH,EAAoB,IAC9BG,EAAOD,QAAU,SAAUgE,GACzB,IAAIoE,EAAS8S,EAAQlX,GACjBuX,EAAaJ,EAAKlW,EACtB,GAAIsW,EAKF,IAJA,IAGIpZ,EAHA4rB,EAAUxS,EAAWvX,GACrBwX,EAAS1U,EAAI7B,EACb/E,EAAI,EAEgBA,EAAjB6tB,EAAQtqB,QAAgB+X,EAAOpb,KAAK4D,EAAI7B,EAAM4rB,EAAQ7tB,OAAOkI,EAAOC,KAAKlG,GAChF,OAAOiG,IAML,SAAUnI,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAIX,EAAQO,GAAKzC,EAAoB,GAAI,SAAU,CAAEc,eAAgBd,EAAoB,GAAGmF,KAKtG,SAAUhF,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAIX,EAAQO,GAAKzC,EAAoB,GAAI,SAAU,CAAE+kB,iBAAkB/kB,EAAoB,OAKrG,SAAUG,EAAQD,EAASF,GAGjC,IAAIiH,EAAYjH,EAAoB,IAChCstB,EAA4BttB,EAAoB,IAAImF,EAExDnF,EAAoB,GAApBA,CAAwB,2BAA4B,WAClD,OAAO,SAASmH,yBAAyBjD,EAAI7B,GAC3C,OAAOirB,EAA0BrmB,EAAU/C,GAAK7B,OAO9C,SAAUlC,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,SAAU,CAAEmF,OAAQhI,EAAoB,OAKrD,SAAUG,EAAQD,EAASF,GAGjC,IAAI0F,EAAW1F,EAAoB,GAC/BkuB,EAAkBluB,EAAoB,IAE1CA,EAAoB,GAApBA,CAAwB,iBAAkB,WACxC,OAAO,SAAS6F,eAAe3B,GAC7B,OAAOgqB,EAAgBxoB,EAASxB,QAO9B,SAAU/D,EAAQD,EAASF,GAGjC,IAAI0F,EAAW1F,EAAoB,GAC/B2U,EAAQ3U,EAAoB,IAEhCA,EAAoB,GAApBA,CAAwB,OAAQ,WAC9B,OAAO,SAAS6L,KAAK3H,GACnB,OAAOyQ,EAAMjP,EAASxB,QAOpB,SAAU/D,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,sBAAuB,WAC7C,OAAOA,EAAoB,IAAImF,KAM3B,SAAUhF,EAAQD,EAASF,GAGjC,IAAIiE,EAAWjE,EAAoB,GAC/BsU,EAAOtU,EAAoB,IAAI0U,SAEnC1U,EAAoB,GAApBA,CAAwB,SAAU,SAAUmuB,GAC1C,OAAO,SAAS1F,OAAOvkB,GACrB,OAAOiqB,GAAWlqB,EAASC,GAAMiqB,EAAQ7Z,EAAKpQ,IAAOA,MAOnD,SAAU/D,EAAQD,EAASF,GAGjC,IAAIiE,EAAWjE,EAAoB,GAC/BsU,EAAOtU,EAAoB,IAAI0U,SAEnC1U,EAAoB,GAApBA,CAAwB,OAAQ,SAAUouB,GACxC,OAAO,SAASC,KAAKnqB,GACnB,OAAOkqB,GAASnqB,EAASC,GAAMkqB,EAAM9Z,EAAKpQ,IAAOA,MAO/C,SAAU/D,EAAQD,EAASF,GAGjC,IAAIiE,EAAWjE,EAAoB,GAC/BsU,EAAOtU,EAAoB,IAAI0U,SAEnC1U,EAAoB,GAApBA,CAAwB,oBAAqB,SAAUsuB,GACrD,OAAO,SAASna,kBAAkBjQ,GAChC,OAAOoqB,GAAsBrqB,EAASC,GAAMoqB,EAAmBha,EAAKpQ,IAAOA,MAOzE,SAAU/D,EAAQD,EAASF,GAGjC,IAAIiE,EAAWjE,EAAoB,GAEnCA,EAAoB,GAApBA,CAAwB,WAAY,SAAUuuB,GAC5C,OAAO,SAASC,SAAStqB,GACvB,OAAOD,EAASC,MAAMqqB,GAAYA,EAAUrqB,OAO1C,SAAU/D,EAAQD,EAASF,GAGjC,IAAIiE,EAAWjE,EAAoB,GAEnCA,EAAoB,GAApBA,CAAwB,WAAY,SAAUyuB,GAC5C,OAAO,SAASC,SAASxqB,GACvB,OAAOD,EAASC,MAAMuqB,GAAYA,EAAUvqB,OAO1C,SAAU/D,EAAQD,EAASF,GAGjC,IAAIiE,EAAWjE,EAAoB,GAEnCA,EAAoB,GAApBA,CAAwB,eAAgB,SAAU2uB,GAChD,OAAO,SAAS1a,aAAa/P,GAC3B,QAAOD,EAASC,MAAMyqB,GAAgBA,EAAczqB,QAOlD,SAAU/D,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAIX,EAAQO,EAAG,SAAU,CAAE8Y,OAAQvb,EAAoB,OAKjE,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAClCkC,EAAQA,EAAQW,EAAG,SAAU,CAAEiY,GAAI9a,EAAoB,QAKjD,SAAUG,EAAQD,GAGxBC,EAAOD,QAAUW,OAAOia,IAAM,SAASA,GAAGqB,EAAGiN,GAE3C,OAAOjN,IAAMiN,EAAU,IAANjN,GAAW,EAAIA,GAAM,EAAIiN,EAAIjN,GAAKA,GAAKiN,GAAKA,IAMzD,SAAUjpB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAClCkC,EAAQA,EAAQW,EAAG,SAAU,CAAEsiB,eAAgBnlB,EAAoB,IAAI8N,OAKjE,SAAU3N,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQa,EAAG,WAAY,CAAEwiB,KAAMvlB,EAAoB,OAKrD,SAAUG,EAAQD,EAASF,GAIjC,IAAIiE,EAAWjE,EAAoB,GAC/B6F,EAAiB7F,EAAoB,IACrC4uB,EAAe5uB,EAAoB,EAApBA,CAAuB,eACtC6uB,EAAgBhrB,SAASrC,UAEvBotB,KAAgBC,GAAgB7uB,EAAoB,GAAGmF,EAAE0pB,EAAeD,EAAc,CAAEtpB,MAAO,SAAUF,GAC7G,GAAmB,mBAAR3B,OAAuBQ,EAASmB,GAAI,OAAO,EACtD,IAAKnB,EAASR,KAAKjC,WAAY,OAAO4D,aAAa3B,KAEnD,KAAO2B,EAAIS,EAAeT,IAAI,GAAI3B,KAAKjC,YAAc4D,EAAG,OAAO,EAC/D,OAAO,MAMH,SAAUjF,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B6E,EAAY7E,EAAoB,IAChC8uB,EAAe9uB,EAAoB,IACnC8b,EAAS9b,EAAoB,IAC7B+uB,EAAW,GAAIC,QACfrmB,EAAQtE,KAAKsE,MACbyJ,EAAO,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,GACvB6c,EAAQ,wCAGRC,EAAW,SAAUhuB,EAAGV,GAG1B,IAFA,IAAIJ,GAAK,EACL+uB,EAAK3uB,IACAJ,EAAI,GAEXgS,EAAKhS,IADL+uB,GAAMjuB,EAAIkR,EAAKhS,IACA,IACf+uB,EAAKxmB,EAAMwmB,EAAK,MAGhBC,EAAS,SAAUluB,GAGrB,IAFA,IAAId,EAAI,EACJI,EAAI,EACM,KAALJ,GAEPgS,EAAKhS,GAAKuI,GADVnI,GAAK4R,EAAKhS,IACUc,GACpBV,EAAKA,EAAIU,EAAK,KAGdmuB,EAAc,WAGhB,IAFA,IAAIjvB,EAAI,EACJuB,EAAI,GACM,KAALvB,GACP,GAAU,KAANuB,GAAkB,IAANvB,GAAuB,IAAZgS,EAAKhS,GAAU,CACxC,IAAIkvB,EAAIjpB,OAAO+L,EAAKhS,IACpBuB,EAAU,KAANA,EAAW2tB,EAAI3tB,EAAIma,EAAOxb,KA1BzB,IA0BoC,EAAIgvB,EAAE3rB,QAAU2rB,EAE3D,OAAO3tB,GAEP8f,EAAM,SAAUtF,EAAGjb,EAAGquB,GACxB,OAAa,IAANruB,EAAUquB,EAAMruB,EAAI,GAAM,EAAIugB,EAAItF,EAAGjb,EAAI,EAAGquB,EAAMpT,GAAKsF,EAAItF,EAAIA,EAAGjb,EAAI,EAAGquB,IAelFrtB,EAAQA,EAAQa,EAAIb,EAAQO,KAAOssB,IACV,UAAvB,KAAQC,QAAQ,IACG,MAAnB,GAAIA,QAAQ,IACS,SAArB,MAAMA,QAAQ,IACuB,yBAArC,mBAAsBA,QAAQ,MAC1BhvB,EAAoB,EAApBA,CAAuB,WAE3B+uB,EAASzuB,KAAK,OACX,SAAU,CACb0uB,QAAS,SAASA,QAAQQ,GACxB,IAIIhrB,EAAGirB,EAAG9T,EAAGH,EAJTW,EAAI2S,EAAarrB,KAAMwrB,GACvB9pB,EAAIN,EAAU2qB,GACd7tB,EAAI,GACJpB,EA3DG,IA6DP,GAAI4E,EAAI,GAAS,GAAJA,EAAQ,MAAMoF,WAAW0kB,GAEtC,GAAI9S,GAAKA,EAAG,MAAO,MACnB,GAAIA,IAAM,MAAa,MAALA,EAAW,OAAO9V,OAAO8V,GAK3C,GAJIA,EAAI,IACNxa,EAAI,IACJwa,GAAKA,GAEC,MAAJA,EAKF,GAHAsT,GADAjrB,EArCI,SAAU2X,GAGlB,IAFA,IAAIjb,EAAI,EACJwuB,EAAKvT,EACI,MAANuT,GACLxuB,GAAK,GACLwuB,GAAM,KAER,KAAa,GAANA,GACLxuB,GAAK,EACLwuB,GAAM,EACN,OAAOxuB,EA2BDwgB,CAAIvF,EAAIsF,EAAI,EAAG,GAAI,IAAM,IACrB,EAAItF,EAAIsF,EAAI,GAAIjd,EAAG,GAAK2X,EAAIsF,EAAI,EAAGjd,EAAG,GAC9CirB,GAAK,iBAEG,GADRjrB,EAAI,GAAKA,GACE,CAGT,IAFA0qB,EAAS,EAAGO,GACZ9T,EAAIxW,EACQ,GAALwW,GACLuT,EAAS,IAAK,GACdvT,GAAK,EAIP,IAFAuT,EAASzN,EAAI,GAAI9F,EAAG,GAAI,GACxBA,EAAInX,EAAI,EACI,IAALmX,GACLyT,EAAO,GAAK,IACZzT,GAAK,GAEPyT,EAAO,GAAKzT,GACZuT,EAAS,EAAG,GACZE,EAAO,GACP7uB,EAAI8uB,SAEJH,EAAS,EAAGO,GACZP,EAAS,IAAM1qB,EAAG,GAClBjE,EAAI8uB,IAAgBvT,EAAOxb,KA9FxB,IA8FmC6E,GAQxC,OAHA5E,EAFM,EAAJ4E,EAEExD,IADJ6Z,EAAIjb,EAAEoD,SACQwB,EAAI,KAAO2W,EAAOxb,KAnG3B,IAmGsC6E,EAAIqW,GAAKjb,EAAIA,EAAEkI,MAAM,EAAG+S,EAAIrW,GAAK,IAAM5E,EAAEkI,MAAM+S,EAAIrW,IAE1FxD,EAAIpB,MAQR,SAAUJ,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B4rB,EAAS5rB,EAAoB,GAC7B8uB,EAAe9uB,EAAoB,IACnC2vB,EAAe,GAAIC,YAEvB1tB,EAAQA,EAAQa,EAAIb,EAAQO,GAAKmpB,EAAO,WAEtC,MAA2C,MAApC+D,EAAarvB,KAAK,EAAGT,QACvB+rB,EAAO,WAEZ+D,EAAarvB,KAAK,OACf,SAAU,CACbsvB,YAAa,SAASA,YAAYC,GAChC,IAAI/oB,EAAOgoB,EAAarrB,KAAM,6CAC9B,OAAOosB,IAAchwB,GAAY8vB,EAAarvB,KAAKwG,GAAQ6oB,EAAarvB,KAAKwG,EAAM+oB,OAOjF,SAAU1vB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,SAAU,CAAE0jB,QAASliB,KAAKod,IAAI,GAAI,OAK/C,SAAUthB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B8vB,EAAY9vB,EAAoB,GAAG6lB,SAEvC3jB,EAAQA,EAAQW,EAAG,SAAU,CAC3BgjB,SAAU,SAASA,SAAS3hB,GAC1B,MAAoB,iBAANA,GAAkB4rB,EAAU5rB,OAOxC,SAAU/D,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,SAAU,CAAE+iB,UAAW5lB,EAAoB,OAKxD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,SAAU,CAC3B+F,MAAO,SAASA,MAAMghB,GAEpB,OAAOA,GAAUA,MAOf,SAAUzpB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B4lB,EAAY5lB,EAAoB,IAChCwhB,EAAMnd,KAAKmd,IAEftf,EAAQA,EAAQW,EAAG,SAAU,CAC3BktB,cAAe,SAASA,cAAcnG,GACpC,OAAOhE,EAAUgE,IAAWpI,EAAIoI,IAAW,qBAOzC,SAAUzpB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,SAAU,CAAEmtB,iBAAkB,oBAK3C,SAAU7vB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,SAAU,CAAEotB,kBAAmB,oBAK5C,SAAU9vB,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B8lB,EAAc9lB,EAAoB,IAEtCkC,EAAQA,EAAQW,EAAIX,EAAQO,GAAKytB,OAAOnK,YAAcD,GAAc,SAAU,CAAEC,WAAYD,KAKtF,SAAU3lB,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9BimB,EAAYjmB,EAAoB,KAEpCkC,EAAQA,EAAQW,EAAIX,EAAQO,GAAKytB,OAAOhK,UAAYD,GAAY,SAAU,CAAEC,SAAUD,KAKhF,SAAU9lB,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9BimB,EAAYjmB,EAAoB,KAEpCkC,EAAQA,EAAQS,EAAIT,EAAQO,GAAKyjB,UAAYD,GAAY,CAAEC,SAAUD,KAK/D,SAAU9lB,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B8lB,EAAc9lB,EAAoB,IAEtCkC,EAAQA,EAAQS,EAAIT,EAAQO,GAAKsjB,YAAcD,GAAc,CAAEC,WAAYD,KAKrE,SAAU3lB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BsmB,EAAQtmB,EAAoB,KAC5BmwB,EAAO9rB,KAAK8rB,KACZC,EAAS/rB,KAAKgsB,MAElBnuB,EAAQA,EAAQW,EAAIX,EAAQO,IAAM2tB,GAEW,KAAxC/rB,KAAKsE,MAAMynB,EAAOF,OAAOI,aAEzBF,EAAOnU,WAAaA,UACtB,OAAQ,CACToU,MAAO,SAASA,MAAMlU,GACpB,OAAQA,GAAKA,GAAK,EAAIuG,IAAU,kBAAJvG,EACxB9X,KAAKqd,IAAIvF,GAAK9X,KAAKsd,IACnB2E,EAAMnK,EAAI,EAAIgU,EAAKhU,EAAI,GAAKgU,EAAKhU,EAAI,QAOvC,SAAUhc,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BuwB,EAASlsB,KAAKmsB,MAOlBtuB,EAAQA,EAAQW,EAAIX,EAAQO,IAAM8tB,GAA0B,EAAhB,EAAIA,EAAO,IAAS,OAAQ,CAAEC,MAL1E,SAASA,MAAMrU,GACb,OAAQ0J,SAAS1J,GAAKA,IAAW,GAALA,EAAaA,EAAI,GAAKqU,OAAOrU,GAAK9X,KAAKqd,IAAIvF,EAAI9X,KAAK8rB,KAAKhU,EAAIA,EAAI,IAAxDA,MASjC,SAAUhc,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BywB,EAASpsB,KAAKqsB,MAGlBxuB,EAAQA,EAAQW,EAAIX,EAAQO,IAAMguB,GAAU,EAAIA,GAAQ,GAAK,GAAI,OAAQ,CACvEC,MAAO,SAASA,MAAMvU,GACpB,OAAmB,IAAXA,GAAKA,GAAUA,EAAI9X,KAAKqd,KAAK,EAAIvF,IAAM,EAAIA,IAAM,MAOvD,SAAUhc,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Bkc,EAAOlc,EAAoB,IAE/BkC,EAAQA,EAAQW,EAAG,OAAQ,CACzB8tB,KAAM,SAASA,KAAKxU,GAClB,OAAOD,EAAKC,GAAKA,GAAK9X,KAAKod,IAAIpd,KAAKmd,IAAIrF,GAAI,EAAI,OAO9C,SAAUhc,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CACzB+tB,MAAO,SAASA,MAAMzU,GACpB,OAAQA,KAAO,GAAK,GAAK9X,KAAKsE,MAAMtE,KAAKqd,IAAIvF,EAAI,IAAO9X,KAAKwsB,OAAS,OAOpE,SAAU1wB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B8I,EAAMzE,KAAKyE,IAEf5G,EAAQA,EAAQW,EAAG,OAAQ,CACzBiuB,KAAM,SAASA,KAAK3U,GAClB,OAAQrT,EAAIqT,GAAKA,GAAKrT,GAAKqT,IAAM,MAO/B,SAAUhc,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Boc,EAASpc,EAAoB,IAEjCkC,EAAQA,EAAQW,EAAIX,EAAQO,GAAK2Z,GAAU/X,KAAKgY,OAAQ,OAAQ,CAAEA,MAAOD,KAKnE,SAAUjc,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CAAE8jB,OAAQ3mB,EAAoB,QAKnD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BwhB,EAAMnd,KAAKmd,IAEftf,EAAQA,EAAQW,EAAG,OAAQ,CACzBkuB,MAAO,SAASA,MAAMC,EAAQC,GAM5B,IALA,IAII5pB,EAAK6pB,EAJLC,EAAM,EACN/wB,EAAI,EACJyO,EAAOnL,UAAUC,OACjBytB,EAAO,EAEJhxB,EAAIyO,GAELuiB,GADJ/pB,EAAMma,EAAI9d,UAAUtD,QAGlB+wB,EAAMA,GADND,EAAME,EAAO/pB,GACK6pB,EAAM,EACxBE,EAAO/pB,GAGP8pB,GAFe,EAAN9pB,GACT6pB,EAAM7pB,EAAM+pB,GACCF,EACD7pB,EAEhB,OAAO+pB,IAASnV,SAAWA,SAAWmV,EAAO/sB,KAAK8rB,KAAKgB,OAOrD,SAAUhxB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BqxB,EAAQhtB,KAAKitB,KAGjBpvB,EAAQA,EAAQW,EAAIX,EAAQO,EAAIzC,EAAoB,EAApBA,CAAuB,WACrD,OAAgC,GAAzBqxB,EAAM,WAAY,IAA4B,GAAhBA,EAAM1tB,SACzC,OAAQ,CACV2tB,KAAM,SAASA,KAAKnV,EAAGiN,GACrB,IAAImI,EAAS,MACTC,GAAMrV,EACNsV,GAAMrI,EACNsI,EAAKH,EAASC,EACdG,EAAKJ,EAASE,EAClB,OAAO,EAAIC,EAAKC,IAAOJ,EAASC,IAAO,IAAMG,EAAKD,GAAMH,EAASE,IAAO,KAAO,KAAO,OAOpF,SAAUtxB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CACzB+uB,MAAO,SAASA,MAAMzV,GACpB,OAAO9X,KAAKqd,IAAIvF,GAAK9X,KAAKwtB,WAOxB,SAAU1xB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CAAEyjB,MAAOtmB,EAAoB,QAKlD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CACzBivB,KAAM,SAASA,KAAK3V,GAClB,OAAO9X,KAAKqd,IAAIvF,GAAK9X,KAAKsd,QAOxB,SAAUxhB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CAAEqZ,KAAMlc,EAAoB,OAKjD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Bqc,EAAQrc,EAAoB,IAC5B8I,EAAMzE,KAAKyE,IAGf5G,EAAQA,EAAQW,EAAIX,EAAQO,EAAIzC,EAAoB,EAApBA,CAAuB,WACrD,OAA8B,QAAtBqE,KAAK0tB,MAAM,SACjB,OAAQ,CACVA,KAAM,SAASA,KAAK5V,GAClB,OAAO9X,KAAKmd,IAAIrF,GAAKA,GAAK,GACrBE,EAAMF,GAAKE,GAAOF,IAAM,GACxBrT,EAAIqT,EAAI,GAAKrT,GAAKqT,EAAI,KAAO9X,KAAKgpB,EAAI,OAOzC,SAAUltB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Bqc,EAAQrc,EAAoB,IAC5B8I,EAAMzE,KAAKyE,IAEf5G,EAAQA,EAAQW,EAAG,OAAQ,CACzBmvB,KAAM,SAASA,KAAK7V,GAClB,IAAI5Y,EAAI8Y,EAAMF,GAAKA,GACf3Y,EAAI6Y,GAAOF,GACf,OAAO5Y,GAAK0Y,SAAW,EAAIzY,GAAKyY,UAAY,GAAK1Y,EAAIC,IAAMsF,EAAIqT,GAAKrT,GAAKqT,QAOvE,SAAUhc,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CACzBovB,MAAO,SAASA,MAAM/tB,GACpB,OAAa,EAALA,EAASG,KAAKsE,MAAQtE,KAAKqE,MAAMxE,OAOvC,SAAU/D,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9BsJ,EAAkBtJ,EAAoB,IACtCkyB,EAAe7rB,OAAO6rB,aACtBC,EAAiB9rB,OAAO+rB,cAG5BlwB,EAAQA,EAAQW,EAAIX,EAAQO,KAAO0vB,GAA2C,GAAzBA,EAAexuB,QAAc,SAAU,CAE1FyuB,cAAe,SAASA,cAAcjW,GAKpC,IAJA,IAGIkW,EAHAjqB,EAAM,GACNyG,EAAOnL,UAAUC,OACjBvD,EAAI,EAEMA,EAAPyO,GAAU,CAEf,GADAwjB,GAAQ3uB,UAAUtD,KACdkJ,EAAgB+oB,EAAM,WAAcA,EAAM,MAAM9nB,WAAW8nB,EAAO,8BACtEjqB,EAAIG,KAAK8pB,EAAO,MACZH,EAAaG,GACbH,EAAyC,QAA1BG,GAAQ,QAAY,IAAcA,EAAO,KAAQ,QAEpE,OAAOjqB,EAAImE,KAAK,QAOhB,SAAUpM,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9BiH,EAAYjH,EAAoB,IAChCsH,EAAWtH,EAAoB,GAEnCkC,EAAQA,EAAQW,EAAG,SAAU,CAE3ByvB,IAAK,SAASA,IAAIC,GAMhB,IALA,IAAIC,EAAMvrB,EAAUsrB,EAASD,KACzBnhB,EAAM7J,EAASkrB,EAAI7uB,QACnBkL,EAAOnL,UAAUC,OACjByE,EAAM,GACNhI,EAAI,EACKA,EAAN+Q,GACL/I,EAAIG,KAAKlC,OAAOmsB,EAAIpyB,OAChBA,EAAIyO,GAAMzG,EAAIG,KAAKlC,OAAO3C,UAAUtD,KACxC,OAAOgI,EAAImE,KAAK,QAOhB,SAAUpM,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,OAAQ,SAAUgmB,GACxC,OAAO,SAAStO,OACd,OAAOsO,EAAMviB,KAAM,OAOjB,SAAUtD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9ByyB,EAAMzyB,EAAoB,GAApBA,EAAwB,GAClCkC,EAAQA,EAAQa,EAAG,SAAU,CAE3B2vB,YAAa,SAASA,YAAYnW,GAChC,OAAOkW,EAAIhvB,KAAM8Y,OAOf,SAAUpc,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BsH,EAAWtH,EAAoB,GAC/B2yB,EAAU3yB,EAAoB,IAC9B4yB,EAAY,WACZC,EAAY,GAAGD,GAEnB1wB,EAAQA,EAAQa,EAAIb,EAAQO,EAAIzC,EAAoB,GAApBA,CAAwB4yB,GAAY,SAAU,CAC5EE,SAAU,SAASA,SAASpW,GAC1B,IAAI5V,EAAO6rB,EAAQlvB,KAAMiZ,EAAckW,GACnCG,EAAiC,EAAnBrvB,UAAUC,OAAaD,UAAU,GAAK7D,GACpDsR,EAAM7J,EAASR,EAAKnD,QACpBiN,EAAMmiB,IAAgBlzB,GAAYsR,EAAM9M,KAAKS,IAAIwC,EAASyrB,GAAc5hB,GACxE6hB,EAAS3sB,OAAOqW,GACpB,OAAOmW,EACHA,EAAUvyB,KAAKwG,EAAMksB,EAAQpiB,GAC7B9J,EAAK2B,MAAMmI,EAAMoiB,EAAOrvB,OAAQiN,KAASoiB,MAO3C,SAAU7yB,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B2yB,EAAU3yB,EAAoB,IAC9BizB,EAAW,WAEf/wB,EAAQA,EAAQa,EAAIb,EAAQO,EAAIzC,EAAoB,GAApBA,CAAwBizB,GAAW,SAAU,CAC3E9iB,SAAU,SAASA,SAASuM,GAC1B,SAAUiW,EAAQlvB,KAAMiZ,EAAcuW,GACnChjB,QAAQyM,EAAiC,EAAnBhZ,UAAUC,OAAaD,UAAU,GAAK7D,QAO7D,SAAUM,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQa,EAAG,SAAU,CAE3B+Y,OAAQ9b,EAAoB,OAMxB,SAAUG,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BsH,EAAWtH,EAAoB,GAC/B2yB,EAAU3yB,EAAoB,IAC9BkzB,EAAc,aACdC,EAAc,GAAGD,GAErBhxB,EAAQA,EAAQa,EAAIb,EAAQO,EAAIzC,EAAoB,GAApBA,CAAwBkzB,GAAc,SAAU,CAC9EE,WAAY,SAASA,WAAW1W,GAC9B,IAAI5V,EAAO6rB,EAAQlvB,KAAMiZ,EAAcwW,GACnC7qB,EAAQf,EAASjD,KAAKS,IAAuB,EAAnBpB,UAAUC,OAAaD,UAAU,GAAK7D,GAAWiH,EAAKnD,SAChFqvB,EAAS3sB,OAAOqW,GACpB,OAAOyW,EACHA,EAAY7yB,KAAKwG,EAAMksB,EAAQ3qB,GAC/BvB,EAAK2B,MAAMJ,EAAOA,EAAQ2qB,EAAOrvB,UAAYqvB,MAO/C,SAAU7yB,EAAQD,EAASF,GAIjC,IAAIyyB,EAAMzyB,EAAoB,GAApBA,EAAwB,GAGlCA,EAAoB,GAApBA,CAAwBqG,OAAQ,SAAU,SAAUgX,GAClD5Z,KAAKqT,GAAKzQ,OAAOgX,GACjB5Z,KAAK6Z,GAAK,GAET,WACD,IAEI+V,EAFAjuB,EAAI3B,KAAKqT,GACTzO,EAAQ5E,KAAK6Z,GAEjB,OAAalY,EAAEzB,QAAX0E,EAA0B,CAAE/C,MAAOzF,GAAWqP,MAAM,IACxDmkB,EAAQZ,EAAIrtB,EAAGiD,GACf5E,KAAK6Z,IAAM+V,EAAM1vB,OACV,CAAE2B,MAAO+tB,EAAOnkB,MAAM,OAMzB,SAAU/O,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,SAAU,SAAUiG,GAC1C,OAAO,SAASqtB,OAAO5yB,GACrB,OAAOuF,EAAWxC,KAAM,IAAK,OAAQ/C,OAOnC,SAAUP,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,MAAO,SAAUiG,GACvC,OAAO,SAASstB,MACd,OAAOttB,EAAWxC,KAAM,MAAO,GAAI,QAOjC,SAAUtD,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,QAAS,SAAUiG,GACzC,OAAO,SAASutB,QACd,OAAOvtB,EAAWxC,KAAM,QAAS,GAAI,QAOnC,SAAUtD,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,OAAQ,SAAUiG,GACxC,OAAO,SAASwtB,OACd,OAAOxtB,EAAWxC,KAAM,IAAK,GAAI,QAO/B,SAAUtD,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,QAAS,SAAUiG,GACzC,OAAO,SAASytB,QACd,OAAOztB,EAAWxC,KAAM,KAAM,GAAI,QAOhC,SAAUtD,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,YAAa,SAAUiG,GAC7C,OAAO,SAAS0tB,UAAUC,GACxB,OAAO3tB,EAAWxC,KAAM,OAAQ,QAASmwB,OAOvC,SAAUzzB,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,WAAY,SAAUiG,GAC5C,OAAO,SAAS4tB,SAAS3Z,GACvB,OAAOjU,EAAWxC,KAAM,OAAQ,OAAQyW,OAOtC,SAAU/Z,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,UAAW,SAAUiG,GAC3C,OAAO,SAAS6tB,UACd,OAAO7tB,EAAWxC,KAAM,IAAK,GAAI,QAO/B,SAAUtD,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,OAAQ,SAAUiG,GACxC,OAAO,SAAS8tB,KAAKC,GACnB,OAAO/tB,EAAWxC,KAAM,IAAK,OAAQuwB,OAOnC,SAAU7zB,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,QAAS,SAAUiG,GACzC,OAAO,SAASguB,QACd,OAAOhuB,EAAWxC,KAAM,QAAS,GAAI,QAOnC,SAAUtD,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,SAAU,SAAUiG,GAC1C,OAAO,SAASiuB,SACd,OAAOjuB,EAAWxC,KAAM,SAAU,GAAI,QAOpC,SAAUtD,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,MAAO,SAAUiG,GACvC,OAAO,SAASkuB,MACd,OAAOluB,EAAWxC,KAAM,MAAO,GAAI,QAOjC,SAAUtD,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,MAAO,SAAUiG,GACvC,OAAO,SAASmuB,MACd,OAAOnuB,EAAWxC,KAAM,MAAO,GAAI,QAOjC,SAAUtD,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,QAAS,CAAEsV,QAASnY,EAAoB,OAKrD,SAAUG,EAAQD,EAASF,GAIjC,IAAI8B,EAAM9B,EAAoB,IAC1BkC,EAAUlC,EAAoB,GAC9B0F,EAAW1F,EAAoB,GAC/BM,EAAON,EAAoB,KAC3BwJ,EAAcxJ,EAAoB,IAClCsH,EAAWtH,EAAoB,GAC/Bq0B,EAAiBr0B,EAAoB,IACrC0J,EAAY1J,EAAoB,IAEpCkC,EAAQA,EAAQW,EAAIX,EAAQO,GAAKzC,EAAoB,GAApBA,CAAwB,SAAU6S,GAAQhI,MAAM6D,KAAKmE,KAAW,QAAS,CAExGnE,KAAM,SAASA,KAAKuC,GAClB,IAOItN,EAAQ2E,EAAQqG,EAAMC,EAPtBxJ,EAAIM,EAASuL,GACb3N,EAAmB,mBAARG,KAAqBA,KAAOoH,MACvCgE,EAAOnL,UAAUC,OACjBmL,EAAe,EAAPD,EAAWnL,UAAU,GAAK7D,GAClCkP,EAAUD,IAAUjP,GACpBwI,EAAQ,EACR2G,EAAStF,EAAUtE,GAIvB,GAFI2J,IAASD,EAAQhN,EAAIgN,EAAc,EAAPD,EAAWnL,UAAU,GAAK7D,GAAW,IAEjEmP,GAAUnP,IAAeyD,GAAKuH,OAASrB,EAAYwF,GAMrD,IAAK1G,EAAS,IAAIhF,EADlBK,EAAS2D,EAASlC,EAAEzB,SACkB0E,EAAT1E,EAAgB0E,IAC3CgsB,EAAe/rB,EAAQD,EAAO0G,EAAUD,EAAM1J,EAAEiD,GAAQA,GAASjD,EAAEiD,SANrE,IAAKuG,EAAWI,EAAO1O,KAAK8E,GAAIkD,EAAS,IAAIhF,IAAOqL,EAAOC,EAASK,QAAQC,KAAM7G,IAChFgsB,EAAe/rB,EAAQD,EAAO0G,EAAUzO,EAAKsO,EAAUE,EAAO,CAACH,EAAKrJ,MAAO+C,IAAQ,GAAQsG,EAAKrJ,OASpG,OADAgD,EAAO3E,OAAS0E,EACTC,MAOL,SAAUnI,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9Bq0B,EAAiBr0B,EAAoB,IAGzCkC,EAAQA,EAAQW,EAAIX,EAAQO,EAAIzC,EAAoB,EAApBA,CAAuB,WACrD,SAASyC,KACT,QAASoI,MAAMuE,GAAG9O,KAAKmC,aAAcA,KACnC,QAAS,CAEX2M,GAAI,SAASA,KAIX,IAHA,IAAI/G,EAAQ,EACRwG,EAAOnL,UAAUC,OACjB2E,EAAS,IAAoB,mBAAR7E,KAAqBA,KAAOoH,OAAOgE,GAC9CxG,EAAPwG,GAAcwlB,EAAe/rB,EAAQD,EAAO3E,UAAU2E,MAE7D,OADAC,EAAO3E,OAASkL,EACTvG,MAOL,SAAUnI,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BiH,EAAYjH,EAAoB,IAChCsM,EAAY,GAAGC,KAGnBrK,EAAQA,EAAQa,EAAIb,EAAQO,GAAKzC,EAAoB,KAAOa,SAAWb,EAAoB,GAApBA,CAAwBsM,IAAa,QAAS,CACnHC,KAAM,SAASA,KAAK6D,GAClB,OAAO9D,EAAUhM,KAAK2G,EAAUxD,MAAO2M,IAAcvQ,GAAY,IAAMuQ,OAOrE,SAAUjQ,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B6d,EAAO7d,EAAoB,IAC3BgW,EAAMhW,EAAoB,IAC1BsJ,EAAkBtJ,EAAoB,IACtCsH,EAAWtH,EAAoB,GAC/B0M,EAAa,GAAGjE,MAGpBvG,EAAQA,EAAQa,EAAIb,EAAQO,EAAIzC,EAAoB,EAApBA,CAAuB,WACjD6d,GAAMnR,EAAWpM,KAAKud,KACxB,QAAS,CACXpV,MAAO,SAASA,MAAMkI,EAAOC,GAC3B,IAAIO,EAAM7J,EAAS7D,KAAKE,QACpBgP,EAAQqD,EAAIvS,MAEhB,GADAmN,EAAMA,IAAQ/Q,GAAYsR,EAAMP,EACnB,SAAT+B,EAAkB,OAAOjG,EAAWpM,KAAKmD,KAAMkN,EAAOC,GAM1D,IALA,IAAInB,EAAQnG,EAAgBqH,EAAOQ,GAC/BmjB,EAAOhrB,EAAgBsH,EAAKO,GAC5B+I,EAAO5S,EAASgtB,EAAO7kB,GACvB8kB,EAAS,IAAI1pB,MAAMqP,GACnB9Z,EAAI,EACDA,EAAI8Z,EAAM9Z,IAAKm0B,EAAOn0B,GAAc,UAATuS,EAC9BlP,KAAKyX,OAAOzL,EAAQrP,GACpBqD,KAAKgM,EAAQrP,GACjB,OAAOm0B,MAOL,SAAUp0B,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B4G,EAAY5G,EAAoB,IAChC0F,EAAW1F,EAAoB,GAC/B+F,EAAQ/F,EAAoB,GAC5Bw0B,EAAQ,GAAG/nB,KACXhG,EAAO,CAAC,EAAG,EAAG,GAElBvE,EAAQA,EAAQa,EAAIb,EAAQO,GAAKsD,EAAM,WAErCU,EAAKgG,KAAK5M,QACLkG,EAAM,WAEXU,EAAKgG,KAAK,UAELzM,EAAoB,GAApBA,CAAwBw0B,IAAS,QAAS,CAE/C/nB,KAAM,SAASA,KAAKgE,GAClB,OAAOA,IAAc5Q,GACjB20B,EAAMl0B,KAAKoF,EAASjC,OACpB+wB,EAAMl0B,KAAKoF,EAASjC,MAAOmD,EAAU6J,QAOvC,SAAUtQ,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9By0B,EAAWz0B,EAAoB,GAApBA,CAAwB,GACnC00B,EAAS10B,EAAoB,GAApBA,CAAwB,GAAGgQ,SAAS,GAEjD9N,EAAQA,EAAQa,EAAIb,EAAQO,GAAKiyB,EAAQ,QAAS,CAEhD1kB,QAAS,SAASA,QAAQ9H,GACxB,OAAOusB,EAAShxB,KAAMyE,EAAYxE,UAAU,QAO1C,SAAUvD,EAAQD,EAASF,GAEjC,IAAIiE,EAAWjE,EAAoB,GAC/BmY,EAAUnY,EAAoB,IAC9B6W,EAAU7W,EAAoB,EAApBA,CAAuB,WAErCG,EAAOD,QAAU,SAAUgd,GACzB,IAAI5Z,EASF,OARE6U,EAAQ+E,KAGM,mBAFhB5Z,EAAI4Z,EAASpX,cAEkBxC,IAAMuH,QAASsN,EAAQ7U,EAAE9B,aAAa8B,EAAIzD,IACrEoE,EAASX,IAED,QADVA,EAAIA,EAAEuT,MACUvT,EAAIzD,KAEfyD,IAAMzD,GAAYgL,MAAQvH,IAM/B,SAAUnD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BwN,EAAOxN,EAAoB,GAApBA,CAAwB,GAEnCkC,EAAQA,EAAQa,EAAIb,EAAQO,GAAKzC,EAAoB,GAApBA,CAAwB,GAAGqQ,KAAK,GAAO,QAAS,CAE/EA,IAAK,SAASA,IAAInI,GAChB,OAAOsF,EAAK/J,KAAMyE,EAAYxE,UAAU,QAOtC,SAAUvD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B20B,EAAU30B,EAAoB,GAApBA,CAAwB,GAEtCkC,EAAQA,EAAQa,EAAIb,EAAQO,GAAKzC,EAAoB,GAApBA,CAAwB,GAAG4P,QAAQ,GAAO,QAAS,CAElFA,OAAQ,SAASA,OAAO1H,GACtB,OAAOysB,EAAQlxB,KAAMyE,EAAYxE,UAAU,QAOzC,SAAUvD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B40B,EAAQ50B,EAAoB,GAApBA,CAAwB,GAEpCkC,EAAQA,EAAQa,EAAIb,EAAQO,GAAKzC,EAAoB,GAApBA,CAAwB,GAAGwQ,MAAM,GAAO,QAAS,CAEhFA,KAAM,SAASA,KAAKtI,GAClB,OAAO0sB,EAAMnxB,KAAMyE,EAAYxE,UAAU,QAOvC,SAAUvD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B60B,EAAS70B,EAAoB,GAApBA,CAAwB,GAErCkC,EAAQA,EAAQa,EAAIb,EAAQO,GAAKzC,EAAoB,GAApBA,CAAwB,GAAG0P,OAAO,GAAO,QAAS,CAEjFA,MAAO,SAASA,MAAMxH,GACpB,OAAO2sB,EAAOpxB,KAAMyE,EAAYxE,UAAU,QAOxC,SAAUvD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B80B,EAAU90B,EAAoB,KAElCkC,EAAQA,EAAQa,EAAIb,EAAQO,GAAKzC,EAAoB,GAApBA,CAAwB,GAAGmM,QAAQ,GAAO,QAAS,CAElFA,OAAQ,SAASA,OAAOjE,GACtB,OAAO4sB,EAAQrxB,KAAMyE,EAAYxE,UAAUC,OAAQD,UAAU,IAAI,OAO/D,SAAUvD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B80B,EAAU90B,EAAoB,KAElCkC,EAAQA,EAAQa,EAAIb,EAAQO,GAAKzC,EAAoB,GAApBA,CAAwB,GAAGqM,aAAa,GAAO,QAAS,CAEvFA,YAAa,SAASA,YAAYnE,GAChC,OAAO4sB,EAAQrxB,KAAMyE,EAAYxE,UAAUC,OAAQD,UAAU,IAAI,OAO/D,SAAUvD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B+0B,EAAW/0B,EAAoB,GAApBA,EAAwB,GACnCmZ,EAAU,GAAGlJ,QACb+kB,IAAkB7b,GAAW,EAAI,CAAC,GAAGlJ,QAAQ,GAAI,GAAK,EAE1D/N,EAAQA,EAAQa,EAAIb,EAAQO,GAAKuyB,IAAkBh1B,EAAoB,GAApBA,CAAwBmZ,IAAW,QAAS,CAE7FlJ,QAAS,SAASA,QAAQC,GACxB,OAAO8kB,EAEH7b,EAAQvV,MAAMH,KAAMC,YAAc,EAClCqxB,EAAStxB,KAAMyM,EAAexM,UAAU,QAO1C,SAAUvD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BiH,EAAYjH,EAAoB,IAChC6E,EAAY7E,EAAoB,IAChCsH,EAAWtH,EAAoB,GAC/BmZ,EAAU,GAAGlN,YACb+oB,IAAkB7b,GAAW,EAAI,CAAC,GAAGlN,YAAY,GAAI,GAAK,EAE9D/J,EAAQA,EAAQa,EAAIb,EAAQO,GAAKuyB,IAAkBh1B,EAAoB,GAApBA,CAAwBmZ,IAAW,QAAS,CAE7FlN,YAAa,SAASA,YAAYiE,GAEhC,GAAI8kB,EAAe,OAAO7b,EAAQvV,MAAMH,KAAMC,YAAc,EAC5D,IAAI0B,EAAI6B,EAAUxD,MACdE,EAAS2D,EAASlC,EAAEzB,QACpB0E,EAAQ1E,EAAS,EAGrB,IAFuB,EAAnBD,UAAUC,SAAY0E,EAAQhE,KAAKS,IAAIuD,EAAOxD,EAAUnB,UAAU,MAClE2E,EAAQ,IAAGA,EAAQ1E,EAAS0E,GACjB,GAATA,EAAYA,IAAS,GAAIA,KAASjD,GAAOA,EAAEiD,KAAW6H,EAAe,OAAO7H,GAAS,EAC3F,OAAQ,MAON,SAAUlI,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQa,EAAG,QAAS,CAAEyM,WAAYxP,EAAoB,OAE9DA,EAAoB,GAApBA,CAAwB,eAKlB,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQa,EAAG,QAAS,CAAE4M,KAAM3P,EAAoB,MAExDA,EAAoB,GAApBA,CAAwB,SAKlB,SAAUG,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9Bi1B,EAAQj1B,EAAoB,GAApBA,CAAwB,GAChC6I,EAAM,OACNqsB,GAAS,EAETrsB,IAAO,IAAIgC,MAAM,GAAGhC,GAAK,WAAcqsB,GAAS,IACpDhzB,EAAQA,EAAQa,EAAIb,EAAQO,EAAIyyB,EAAQ,QAAS,CAC/CrlB,KAAM,SAASA,KAAK3H,GAClB,OAAO+sB,EAAMxxB,KAAMyE,EAA+B,EAAnBxE,UAAUC,OAAaD,UAAU,GAAK7D,OAGzEG,EAAoB,GAApBA,CAAwB6I,IAKlB,SAAU1I,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9Bi1B,EAAQj1B,EAAoB,GAApBA,CAAwB,GAChC6I,EAAM,YACNqsB,GAAS,EAETrsB,IAAO,IAAIgC,MAAM,GAAGhC,GAAK,WAAcqsB,GAAS,IACpDhzB,EAAQA,EAAQa,EAAIb,EAAQO,EAAIyyB,EAAQ,QAAS,CAC/CnlB,UAAW,SAASA,UAAU7H,GAC5B,OAAO+sB,EAAMxxB,KAAMyE,EAA+B,EAAnBxE,UAAUC,OAAaD,UAAU,GAAK7D,OAGzEG,EAAoB,GAApBA,CAAwB6I,IAKlB,SAAU1I,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,UAKlB,SAAUG,EAAQD,EAASF,GAIjC,IAwBIm1B,EAAUC,EAA6BC,EAAsBC,EAxB7DvsB,EAAU/I,EAAoB,IAC9B4B,EAAS5B,EAAoB,GAC7B8B,EAAM9B,EAAoB,IAC1BuJ,EAAUvJ,EAAoB,IAC9BkC,EAAUlC,EAAoB,GAC9BiE,EAAWjE,EAAoB,GAC/B4G,EAAY5G,EAAoB,IAChCkJ,EAAalJ,EAAoB,IACjC2Z,EAAQ3Z,EAAoB,IAC5B8J,EAAqB9J,EAAoB,IACzC8gB,EAAO9gB,EAAoB,IAAI8N,IAC/BynB,EAAYv1B,EAAoB,GAApBA,GACZw1B,EAA6Bx1B,EAAoB,IACjDy1B,EAAUz1B,EAAoB,KAC9B0Z,EAAY1Z,EAAoB,IAChC01B,EAAiB11B,EAAoB,KACrC21B,EAAU,UACVxxB,EAAYvC,EAAOuC,UACnB4Z,EAAUnc,EAAOmc,QACjB6X,EAAW7X,GAAWA,EAAQ6X,SAC9BC,EAAKD,GAAYA,EAASC,IAAM,GAChCC,EAAWl0B,EAAO+zB,GAClB/V,EAA6B,WAApBrW,EAAQwU,GACjBgY,EAAQ,aAER5O,EAAuBiO,EAA8BI,EAA2BrwB,EAEhFunB,IAAe,WACjB,IAEE,IAAInM,EAAUuV,EAASxV,QAAQ,GAC3B0V,GAAezV,EAAQza,YAAc,IAAI9F,EAAoB,EAApBA,CAAuB,YAAc,SAAUuE,GAC1FA,EAAKwxB,EAAOA,IAGd,OAAQnW,GAA0C,mBAAzBqW,wBACpB1V,EAAQC,KAAKuV,aAAkBC,GAIT,IAAtBH,EAAG5lB,QAAQ,SACyB,IAApCyJ,EAAUzJ,QAAQ,aACvB,MAAOzL,KAfQ,GAmBf0xB,EAAa,SAAUhyB,GACzB,IAAIsc,EACJ,SAAOvc,EAASC,IAAkC,mBAAnBsc,EAAOtc,EAAGsc,QAAsBA,GAE7DT,EAAS,SAAUQ,EAAS4V,GAC9B,IAAI5V,EAAQ6V,GAAZ,CACA7V,EAAQ6V,IAAK,EACb,IAAIC,EAAQ9V,EAAQvG,GACpBub,EAAU,WAoCR,IAnCA,IAAIjwB,EAAQib,EAAQ+V,GAChBC,EAAmB,GAAdhW,EAAQiW,GACbp2B,EAAI,EACJqe,EAAM,SAAUgY,GAClB,IAIInuB,EAAQkY,EAAMkW,EAJdC,EAAUJ,EAAKE,EAASF,GAAKE,EAASG,KACtCtW,EAAUmW,EAASnW,QACnBU,EAASyV,EAASzV,OAClBd,EAASuW,EAASvW,OAEtB,IACMyW,GACGJ,IACe,GAAdhW,EAAQsW,IAASC,EAAkBvW,GACvCA,EAAQsW,GAAK,IAEC,IAAZF,EAAkBruB,EAAShD,GAEzB4a,GAAQA,EAAOE,QACnB9X,EAASquB,EAAQrxB,GACb4a,IACFA,EAAOC,OACPuW,GAAS,IAGTpuB,IAAWmuB,EAASlW,QACtBS,EAAO7c,EAAU,yBACRqc,EAAO0V,EAAW5tB,IAC3BkY,EAAKlgB,KAAKgI,EAAQgY,EAASU,GACtBV,EAAQhY,IACV0Y,EAAO1b,GACd,MAAOd,GACH0b,IAAWwW,GAAQxW,EAAOC,OAC9Ba,EAAOxc,KAGWpE,EAAfi2B,EAAM1yB,QAAY8a,EAAI4X,EAAMj2B,MACnCmgB,EAAQvG,GAAK,GACbuG,EAAQ6V,IAAK,EACTD,IAAa5V,EAAQsW,IAAIE,EAAYxW,OAGzCwW,EAAc,SAAUxW,GAC1BO,EAAKxgB,KAAKsB,EAAQ,WAChB,IAEI0G,EAAQquB,EAASK,EAFjB1xB,EAAQib,EAAQ+V,GAChBW,EAAYC,EAAY3W,GAe5B,GAbI0W,IACF3uB,EAASmtB,EAAQ,WACX7V,EACF7B,EAAQoZ,KAAK,qBAAsB7xB,EAAOib,IACjCoW,EAAU/0B,EAAOw1B,sBAC1BT,EAAQ,CAAEpW,QAASA,EAAS8W,OAAQ/xB,KAC1B0xB,EAAUp1B,EAAOo1B,UAAYA,EAAQM,OAC/CN,EAAQM,MAAM,8BAA+BhyB,KAIjDib,EAAQsW,GAAKjX,GAAUsX,EAAY3W,GAAW,EAAI,GAClDA,EAAQgX,GAAK13B,GACXo3B,GAAa3uB,EAAO9D,EAAG,MAAM8D,EAAO+J,KAGxC6kB,EAAc,SAAU3W,GAC1B,OAAsB,IAAfA,EAAQsW,IAAkD,KAArCtW,EAAQgX,IAAMhX,EAAQvG,IAAIrW,QAEpDmzB,EAAoB,SAAUvW,GAChCO,EAAKxgB,KAAKsB,EAAQ,WAChB,IAAI+0B,EACA/W,EACF7B,EAAQoZ,KAAK,mBAAoB5W,IACxBoW,EAAU/0B,EAAO41B,qBAC1Bb,EAAQ,CAAEpW,QAASA,EAAS8W,OAAQ9W,EAAQ+V,QAI9CmB,EAAU,SAAUnyB,GACtB,IAAIib,EAAU9c,KACV8c,EAAQ/R,KACZ+R,EAAQ/R,IAAK,GACb+R,EAAUA,EAAQmX,IAAMnX,GAChB+V,GAAKhxB,EACbib,EAAQiW,GAAK,EACRjW,EAAQgX,KAAIhX,EAAQgX,GAAKhX,EAAQvG,GAAGvR,SACzCsX,EAAOQ,GAAS,KAEdoX,EAAW,SAAUryB,GACvB,IACIkb,EADAD,EAAU9c,KAEd,IAAI8c,EAAQ/R,GAAZ,CACA+R,EAAQ/R,IAAK,EACb+R,EAAUA,EAAQmX,IAAMnX,EACxB,IACE,GAAIA,IAAYjb,EAAO,MAAMnB,EAAU,qCACnCqc,EAAO0V,EAAW5wB,IACpBiwB,EAAU,WACR,IAAI5jB,EAAU,CAAE+lB,GAAInX,EAAS/R,IAAI,GACjC,IACEgS,EAAKlgB,KAAKgF,EAAOxD,EAAI61B,EAAUhmB,EAAS,GAAI7P,EAAI21B,EAAS9lB,EAAS,IAClE,MAAOnN,GACPizB,EAAQn3B,KAAKqR,EAASnN,OAI1B+b,EAAQ+V,GAAKhxB,EACbib,EAAQiW,GAAK,EACbzW,EAAOQ,GAAS,IAElB,MAAO/b,GACPizB,EAAQn3B,KAAK,CAAEo3B,GAAInX,EAAS/R,IAAI,GAAShK,MAKxCkoB,IAEHoJ,EAAW,SAASnW,QAAQiY,GAC1B1uB,EAAWzF,KAAMqyB,EAAUH,EAAS,MACpC/uB,EAAUgxB,GACVzC,EAAS70B,KAAKmD,MACd,IACEm0B,EAAS91B,EAAI61B,EAAUl0B,KAAM,GAAI3B,EAAI21B,EAASh0B,KAAM,IACpD,MAAOo0B,GACPJ,EAAQn3B,KAAKmD,KAAMo0B,MAIvB1C,EAAW,SAASxV,QAAQiY,GAC1Bn0B,KAAKuW,GAAK,GACVvW,KAAK8zB,GAAK13B,GACV4D,KAAK+yB,GAAK,EACV/yB,KAAK+K,IAAK,EACV/K,KAAK6yB,GAAKz2B,GACV4D,KAAKozB,GAAK,EACVpzB,KAAK2yB,IAAK,IAEH50B,UAAYxB,EAAoB,GAApBA,CAAwB81B,EAASt0B,UAAW,CAE/Dgf,KAAM,SAASA,KAAKsX,EAAaC,GAC/B,IAAItB,EAAWtP,EAAqBrd,EAAmBrG,KAAMqyB,IAO7D,OANAW,EAASF,GAA2B,mBAAfuB,GAA4BA,EACjDrB,EAASG,KAA4B,mBAAdmB,GAA4BA,EACnDtB,EAASvW,OAASN,EAAS7B,EAAQmC,OAASrgB,GAC5C4D,KAAKuW,GAAGzR,KAAKkuB,GACThzB,KAAK8zB,IAAI9zB,KAAK8zB,GAAGhvB,KAAKkuB,GACtBhzB,KAAK+yB,IAAIzW,EAAOtc,MAAM,GACnBgzB,EAASlW,SAGlByX,QAAS,SAAUD,GACjB,OAAOt0B,KAAK+c,KAAK3gB,GAAWk4B,MAGhC1C,EAAuB,WACrB,IAAI9U,EAAU,IAAI4U,EAClB1xB,KAAK8c,QAAUA,EACf9c,KAAK6c,QAAUxe,EAAI61B,EAAUpX,EAAS,GACtC9c,KAAKud,OAASlf,EAAI21B,EAASlX,EAAS,IAEtCiV,EAA2BrwB,EAAIgiB,EAAuB,SAAU7jB,GAC9D,OAAOA,IAAMwyB,GAAYxyB,IAAMgyB,EAC3B,IAAID,EAAqB/xB,GACzB8xB,EAA4B9xB,KAIpCpB,EAAQA,EAAQS,EAAIT,EAAQiB,EAAIjB,EAAQO,GAAKiqB,EAAY,CAAE/M,QAASmW,IACpE91B,EAAoB,GAApBA,CAAwB81B,EAAUH,GAClC31B,EAAoB,GAApBA,CAAwB21B,GACxBL,EAAUt1B,EAAoB,IAAI21B,GAGlCzzB,EAAQA,EAAQW,EAAIX,EAAQO,GAAKiqB,EAAYiJ,EAAS,CAEpD3U,OAAQ,SAASA,OAAO4G,GACtB,IAAIqQ,EAAa9Q,EAAqB1jB,MAGtC,OADAyd,EADe+W,EAAWjX,QACjB4G,GACFqQ,EAAW1X,WAGtBre,EAAQA,EAAQW,EAAIX,EAAQO,GAAKsG,IAAY2jB,GAAaiJ,EAAS,CAEjErV,QAAS,SAASA,QAAQnE,GACxB,OAAOuZ,EAAe3sB,GAAWtF,OAAS6xB,EAAUQ,EAAWryB,KAAM0Y,MAGzEja,EAAQA,EAAQW,EAAIX,EAAQO,IAAMiqB,GAAc1sB,EAAoB,GAApBA,CAAwB,SAAU6S,GAChFijB,EAASoC,IAAIrlB,GAAa,SAAEkjB,MACzBJ,EAAS,CAEZuC,IAAK,SAASA,IAAIpiB,GAChB,IAAIxS,EAAIG,KACJw0B,EAAa9Q,EAAqB7jB,GAClCgd,EAAU2X,EAAW3X,QACrBU,EAASiX,EAAWjX,OACpB1Y,EAASmtB,EAAQ,WACnB,IAAI9pB,EAAS,GACTtD,EAAQ,EACR8vB,EAAY,EAChBxe,EAAM7D,GAAU,EAAO,SAAUyK,GAC/B,IAAI6X,EAAS/vB,IACTgwB,GAAgB,EACpB1sB,EAAOpD,KAAK1I,IACZs4B,IACA70B,EAAEgd,QAAQC,GAASC,KAAK,SAAUlb,GAC5B+yB,IACJA,GAAgB,EAChB1sB,EAAOysB,GAAU9yB,IACf6yB,GAAa7X,EAAQ3U,KACtBqV,OAEHmX,GAAa7X,EAAQ3U,KAGzB,OADIrD,EAAO9D,GAAGwc,EAAO1Y,EAAO+J,GACrB4lB,EAAW1X,SAGpB+X,KAAM,SAASA,KAAKxiB,GAClB,IAAIxS,EAAIG,KACJw0B,EAAa9Q,EAAqB7jB,GAClC0d,EAASiX,EAAWjX,OACpB1Y,EAASmtB,EAAQ,WACnB9b,EAAM7D,GAAU,EAAO,SAAUyK,GAC/Bjd,EAAEgd,QAAQC,GAASC,KAAKyX,EAAW3X,QAASU,OAIhD,OADI1Y,EAAO9D,GAAGwc,EAAO1Y,EAAO+J,GACrB4lB,EAAW1X,YAOhB,SAAUpgB,EAAQD,EAASF,GAIjC,IAAIkoB,EAAOloB,EAAoB,KAC3BkO,EAAWlO,EAAoB,IAC/Bu4B,EAAW,UAGfv4B,EAAoB,GAApBA,CAAwBu4B,EAAU,SAAUt3B,GAC1C,OAAO,SAASu3B,UAAY,OAAOv3B,EAAIwC,KAAyB,EAAnBC,UAAUC,OAAaD,UAAU,GAAK7D,MAClF,CAEDmoB,IAAK,SAASA,IAAI1iB,GAChB,OAAO4iB,EAAKxR,IAAIxI,EAASzK,KAAM80B,GAAWjzB,GAAO,KAElD4iB,GAAM,GAAO,IAKV,SAAU/nB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B4G,EAAY5G,EAAoB,IAChC+E,EAAW/E,EAAoB,GAC/By4B,GAAUz4B,EAAoB,GAAGmhB,SAAW,IAAIvd,MAChD80B,EAAS70B,SAASD,MAEtB1B,EAAQA,EAAQW,EAAIX,EAAQO,GAAKzC,EAAoB,EAApBA,CAAuB,WACtDy4B,EAAO,gBACL,UAAW,CACb70B,MAAO,SAASA,MAAMP,EAAQs1B,EAAcC,GAC1C,IAAI1iB,EAAItP,EAAUvD,GACdw1B,EAAI9zB,EAAS6zB,GACjB,OAAOH,EAASA,EAAOviB,EAAGyiB,EAAcE,GAAKH,EAAOp4B,KAAK4V,EAAGyiB,EAAcE,OAOxE,SAAU14B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BgI,EAAShI,EAAoB,IAC7B4G,EAAY5G,EAAoB,IAChC+E,EAAW/E,EAAoB,GAC/BiE,EAAWjE,EAAoB,GAC/B+F,EAAQ/F,EAAoB,GAC5BulB,EAAOvlB,EAAoB,IAC3B84B,GAAc94B,EAAoB,GAAGmhB,SAAW,IAAIuE,UAIpDqT,EAAiBhzB,EAAM,WACzB,SAAStD,KACT,QAASq2B,EAAW,aAA6B,GAAIr2B,aAAcA,KAEjEu2B,GAAYjzB,EAAM,WACpB+yB,EAAW,gBAGb52B,EAAQA,EAAQW,EAAIX,EAAQO,GAAKs2B,GAAkBC,GAAW,UAAW,CACvEtT,UAAW,SAASA,UAAUuT,EAAQrd,GACpChV,EAAUqyB,GACVl0B,EAAS6W,GACT,IAAIsd,EAAYx1B,UAAUC,OAAS,EAAIs1B,EAASryB,EAAUlD,UAAU,IACpE,GAAIs1B,IAAaD,EAAgB,OAAOD,EAAWG,EAAQrd,EAAMsd,GACjE,GAAID,GAAUC,EAAW,CAEvB,OAAQtd,EAAKjY,QACX,KAAK,EAAG,OAAO,IAAIs1B,EACnB,KAAK,EAAG,OAAO,IAAIA,EAAOrd,EAAK,IAC/B,KAAK,EAAG,OAAO,IAAIqd,EAAOrd,EAAK,GAAIA,EAAK,IACxC,KAAK,EAAG,OAAO,IAAIqd,EAAOrd,EAAK,GAAIA,EAAK,GAAIA,EAAK,IACjD,KAAK,EAAG,OAAO,IAAIqd,EAAOrd,EAAK,GAAIA,EAAK,GAAIA,EAAK,GAAIA,EAAK,IAG5D,IAAIud,EAAQ,CAAC,MAEb,OADAA,EAAM5wB,KAAK3E,MAAMu1B,EAAOvd,GACjB,IAAK2J,EAAK3hB,MAAMq1B,EAAQE,IAGjC,IAAI5pB,EAAQ2pB,EAAU13B,UAClB43B,EAAWpxB,EAAO/D,EAASsL,GAASA,EAAQ1O,OAAOW,WACnD8G,EAASzE,SAASD,MAAMtD,KAAK24B,EAAQG,EAAUxd,GACnD,OAAO3X,EAASqE,GAAUA,EAAS8wB,MAOjC,SAAUj5B,EAAQD,EAASF,GAGjC,IAAIkF,EAAKlF,EAAoB,GACzBkC,EAAUlC,EAAoB,GAC9B+E,EAAW/E,EAAoB,GAC/BiF,EAAcjF,EAAoB,IAGtCkC,EAAQA,EAAQW,EAAIX,EAAQO,EAAIzC,EAAoB,EAApBA,CAAuB,WAErDmhB,QAAQrgB,eAAeoE,EAAGC,EAAE,GAAI,EAAG,CAAEG,MAAO,IAAM,EAAG,CAAEA,MAAO,MAC5D,UAAW,CACbxE,eAAgB,SAASA,eAAeuC,EAAQg2B,EAAaC,GAC3Dv0B,EAAS1B,GACTg2B,EAAcp0B,EAAYo0B,GAAa,GACvCt0B,EAASu0B,GACT,IAEE,OADAp0B,EAAGC,EAAE9B,EAAQg2B,EAAaC,IACnB,EACP,MAAO90B,GACP,OAAO,OAQP,SAAUrE,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BkH,EAAOlH,EAAoB,IAAImF,EAC/BJ,EAAW/E,EAAoB,GAEnCkC,EAAQA,EAAQW,EAAG,UAAW,CAC5B02B,eAAgB,SAASA,eAAel2B,EAAQg2B,GAC9C,IAAI7nB,EAAOtK,EAAKnC,EAAS1B,GAASg2B,GAClC,QAAO7nB,IAASA,EAAKzQ,sBAA8BsC,EAAOg2B,OAOxD,SAAUl5B,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B+E,EAAW/E,EAAoB,GAC/Bw5B,EAAY,SAAUnc,GACxB5Z,KAAKqT,GAAK/R,EAASsY,GACnB5Z,KAAK6Z,GAAK,EACV,IACIjb,EADAwJ,EAAOpI,KAAK8Z,GAAK,GAErB,IAAKlb,KAAOgb,EAAUxR,EAAKtD,KAAKlG,IAElCrC,EAAoB,GAApBA,CAAwBw5B,EAAW,SAAU,WAC3C,IAEIn3B,EADAwJ,EADOpI,KACK8Z,GAEhB,GACE,GAAe1R,EAAKlI,QAJXF,KAIA6Z,GAAmB,MAAO,CAAEhY,MAAOzF,GAAWqP,MAAM,YACnD7M,EAAMwJ,EALPpI,KAKiB6Z,SALjB7Z,KAKgCqT,KAC3C,MAAO,CAAExR,MAAOjD,EAAK6M,MAAM,KAG7BhN,EAAQA,EAAQW,EAAG,UAAW,CAC5B42B,UAAW,SAASA,UAAUp2B,GAC5B,OAAO,IAAIm2B,EAAUn2B,OAOnB,SAAUlD,EAAQD,EAASF,GAGjC,IAAIkH,EAAOlH,EAAoB,IAC3B6F,EAAiB7F,EAAoB,IACrCgC,EAAMhC,EAAoB,IAC1BkC,EAAUlC,EAAoB,GAC9BiE,EAAWjE,EAAoB,GAC/B+E,EAAW/E,EAAoB,GAcnCkC,EAAQA,EAAQW,EAAG,UAAW,CAAE5B,IAZhC,SAASA,IAAIoC,EAAQg2B,GACnB,IACI7nB,EAAMjC;AADNmqB,EAAWh2B,UAAUC,OAAS,EAAIN,EAASK,UAAU,GAEzD,OAAIqB,EAAS1B,KAAYq2B,EAAiBr2B,EAAOg2B,IAC7C7nB,EAAOtK,EAAK/B,EAAE9B,EAAQg2B,IAAqBr3B,EAAIwP,EAAM,SACrDA,EAAKlM,MACLkM,EAAKvQ,MAAQpB,GACX2R,EAAKvQ,IAAIX,KAAKo5B,GACd75B,GACFoE,EAASsL,EAAQ1J,EAAexC,IAAiBpC,IAAIsO,EAAO8pB,EAAaK,QAA7E,MAQI,SAAUv5B,EAAQD,EAASF,GAGjC,IAAIkH,EAAOlH,EAAoB,IAC3BkC,EAAUlC,EAAoB,GAC9B+E,EAAW/E,EAAoB,GAEnCkC,EAAQA,EAAQW,EAAG,UAAW,CAC5BsE,yBAA0B,SAASA,yBAAyB9D,EAAQg2B,GAClE,OAAOnyB,EAAK/B,EAAEJ,EAAS1B,GAASg2B,OAO9B,SAAUl5B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B25B,EAAW35B,EAAoB,IAC/B+E,EAAW/E,EAAoB,GAEnCkC,EAAQA,EAAQW,EAAG,UAAW,CAC5BgD,eAAgB,SAASA,eAAexC,GACtC,OAAOs2B,EAAS50B,EAAS1B,QAOvB,SAAUlD,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,UAAW,CAC5Bb,IAAK,SAASA,IAAIqB,EAAQg2B,GACxB,OAAOA,KAAeh2B,MAOpB,SAAUlD,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B+E,EAAW/E,EAAoB,GAC/B2uB,EAAgB9tB,OAAOoT,aAE3B/R,EAAQA,EAAQW,EAAG,UAAW,CAC5BoR,aAAc,SAASA,aAAa5Q,GAElC,OADA0B,EAAS1B,IACFsrB,GAAgBA,EAActrB,OAOnC,SAAUlD,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,UAAW,CAAEue,QAASphB,EAAoB,OAKvD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B+E,EAAW/E,EAAoB,GAC/BsuB,EAAqBztB,OAAOsT,kBAEhCjS,EAAQA,EAAQW,EAAG,UAAW,CAC5BsR,kBAAmB,SAASA,kBAAkB9Q,GAC5C0B,EAAS1B,GACT,IAEE,OADIirB,GAAoBA,EAAmBjrB,IACpC,EACP,MAAOmB,GACP,OAAO,OAQP,SAAUrE,EAAQD,EAASF,GAGjC,IAAIkF,EAAKlF,EAAoB,GACzBkH,EAAOlH,EAAoB,IAC3B6F,EAAiB7F,EAAoB,IACrCgC,EAAMhC,EAAoB,IAC1BkC,EAAUlC,EAAoB,GAC9B+G,EAAa/G,EAAoB,IACjC+E,EAAW/E,EAAoB,GAC/BiE,EAAWjE,EAAoB,GAwBnCkC,EAAQA,EAAQW,EAAG,UAAW,CAAEiL,IAtBhC,SAASA,IAAIzK,EAAQg2B,EAAaO,GAChC,IAEIC,EAAoBtqB,EAFpBmqB,EAAWh2B,UAAUC,OAAS,EAAIN,EAASK,UAAU,GACrDo2B,EAAU5yB,EAAK/B,EAAEJ,EAAS1B,GAASg2B,GAEvC,IAAKS,EAAS,CACZ,GAAI71B,EAASsL,EAAQ1J,EAAexC,IAClC,OAAOyK,IAAIyB,EAAO8pB,EAAaO,EAAGF,GAEpCI,EAAU/yB,EAAW,GAEvB,GAAI/E,EAAI83B,EAAS,SAAU,CACzB,IAAyB,IAArBA,EAAQroB,WAAuBxN,EAASy1B,GAAW,OAAO,EAC9D,GAAIG,EAAqB3yB,EAAK/B,EAAEu0B,EAAUL,GAAc,CACtD,GAAIQ,EAAmB54B,KAAO44B,EAAmB/rB,MAAuC,IAAhC+rB,EAAmBpoB,SAAoB,OAAO,EACtGooB,EAAmBv0B,MAAQs0B,EAC3B10B,EAAGC,EAAEu0B,EAAUL,EAAaQ,QACvB30B,EAAGC,EAAEu0B,EAAUL,EAAatyB,EAAW,EAAG6yB,IACjD,OAAO,EAET,OAAOE,EAAQhsB,MAAQjO,KAAqBi6B,EAAQhsB,IAAIxN,KAAKo5B,EAAUE,IAAI,OAQvE,SAAUz5B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B+5B,EAAW/5B,EAAoB,IAE/B+5B,GAAU73B,EAAQA,EAAQW,EAAG,UAAW,CAC1CsiB,eAAgB,SAASA,eAAe9hB,EAAQkM,GAC9CwqB,EAAS7U,MAAM7hB,EAAQkM,GACvB,IAEE,OADAwqB,EAASjsB,IAAIzK,EAAQkM,IACd,EACP,MAAO/K,GACP,OAAO,OAQP,SAAUrE,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CAAEgc,IAAK,WAAc,OAAO,IAAIkK,MAAOD,cAK5D,SAAU3oB,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B0F,EAAW1F,EAAoB,GAC/BiF,EAAcjF,EAAoB,IAClCipB,EAAcjpB,EAAoB,KAClCuJ,EAAUvJ,EAAoB,IAElCkC,EAAQA,EAAQa,EAAIb,EAAQO,EAAIzC,EAAoB,EAApBA,CAAuB,WACrD,OAAkC,OAA3B,IAAI+oB,KAAKrG,KAAKsI,UAC2D,IAA3EjC,KAAKvnB,UAAUwpB,OAAO1qB,KAAK,CAAE2oB,YAAa,WAAc,OAAO,OAClE,OAAQ,CAEV+B,OAAQ,SAASA,OAAO3oB,GACtB,IAAI+C,EAAIM,EAASjC,MACbu2B,EAAK/0B,EAAYG,GACrB,MAAoB,iBAAN40B,GAAmBnU,SAASmU,GACrC,gBAAiB50B,GAAoB,QAAdmE,EAAQnE,GAAsCA,EAAE6jB,cAAxBA,EAAY3oB,KAAK8E,GADrB,SAQ9C,SAAUjF,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BipB,EAAcjpB,EAAoB,KAGtCkC,EAAQA,EAAQa,EAAIb,EAAQO,GAAKsmB,KAAKvnB,UAAUynB,cAAgBA,GAAc,OAAQ,CACpFA,YAAaA,KAMT,SAAU9oB,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BgJ,EAAShJ,EAAoB,IAC7B4N,EAAS5N,EAAoB,IAC7B+E,EAAW/E,EAAoB,GAC/BsJ,EAAkBtJ,EAAoB,IACtCsH,EAAWtH,EAAoB,GAC/BiE,EAAWjE,EAAoB,GAC/B+K,EAAc/K,EAAoB,GAAG+K,YACrCjB,EAAqB9J,EAAoB,IACzC8K,EAAe8C,EAAO7C,YACtBC,EAAY4C,EAAO3C,SACnBgvB,EAAUjxB,EAAOuJ,KAAOxH,EAAYmvB,OACpCnpB,EAASjG,EAAatJ,UAAUiH,MAChC6E,EAAOtE,EAAOsE,KACd7C,EAAe,cAEnBvI,EAAQA,EAAQS,EAAIT,EAAQiB,EAAIjB,EAAQO,GAAKsI,IAAgBD,GAAe,CAAEC,YAAaD,IAE3F5I,EAAQA,EAAQW,EAAIX,EAAQO,GAAKuG,EAAOmE,OAAQ1C,EAAc,CAE5DyvB,OAAQ,SAASA,OAAOh2B,GACtB,OAAO+1B,GAAWA,EAAQ/1B,IAAOD,EAASC,IAAOoJ,KAAQpJ,KAI7DhC,EAAQA,EAAQa,EAAIb,EAAQ8B,EAAI9B,EAAQO,EAAIzC,EAAoB,EAApBA,CAAuB,WACjE,OAAQ,IAAI8K,EAAa,GAAGrC,MAAM,EAAG5I,IAAW6S,aAC9CjI,EAAc,CAEhBhC,MAAO,SAASA,MAAMgH,EAAOmB,GAC3B,GAAIG,IAAWlR,IAAa+Q,IAAQ/Q,GAAW,OAAOkR,EAAOzQ,KAAKyE,EAAStB,MAAOgM,GAQlF,IAPA,IAAI0B,EAAMpM,EAAStB,MAAMiP,WACrBynB,EAAQ7wB,EAAgBmG,EAAO0B,GAC/BipB,EAAM9wB,EAAgBsH,IAAQ/Q,GAAYsR,EAAMP,EAAKO,GACrD7I,EAAS,IAAKwB,EAAmBrG,KAAMqH,GAA9B,CAA6CxD,EAAS8yB,EAAMD,IACrEE,EAAQ,IAAIrvB,EAAUvH,MACtB62B,EAAQ,IAAItvB,EAAU1C,GACtBD,EAAQ,EACL8xB,EAAQC,GACbE,EAAM1W,SAASvb,IAASgyB,EAAMvW,SAASqW,MACvC,OAAO7xB,KAIbtI,EAAoB,GAApBA,CAAwByK,IAKlB,SAAUtK,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAClCkC,EAAQA,EAAQS,EAAIT,EAAQiB,EAAIjB,EAAQO,GAAKzC,EAAoB,IAAIuS,IAAK,CACxEtH,SAAUjL,EAAoB,IAAIiL,YAM9B,SAAU9K,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,OAAQ,EAAG,SAAUu6B,GAC3C,OAAO,SAASC,UAAUpoB,EAAMtB,EAAYnN,GAC1C,OAAO42B,EAAK92B,KAAM2O,EAAMtB,EAAYnN,OAOlC,SAAUxD,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,QAAS,EAAG,SAAUu6B,GAC5C,OAAO,SAAS/vB,WAAW4H,EAAMtB,EAAYnN,GAC3C,OAAO42B,EAAK92B,KAAM2O,EAAMtB,EAAYnN,OAOlC,SAAUxD,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,QAAS,EAAG,SAAUu6B,GAC5C,OAAO,SAASE,kBAAkBroB,EAAMtB,EAAYnN,GAClD,OAAO42B,EAAK92B,KAAM2O,EAAMtB,EAAYnN,MAErC,IAKG,SAAUxD,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,QAAS,EAAG,SAAUu6B,GAC5C,OAAO,SAASG,WAAWtoB,EAAMtB,EAAYnN,GAC3C,OAAO42B,EAAK92B,KAAM2O,EAAMtB,EAAYnN,OAOlC,SAAUxD,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,SAAU,EAAG,SAAUu6B,GAC7C,OAAO,SAAS5sB,YAAYyE,EAAMtB,EAAYnN,GAC5C,OAAO42B,EAAK92B,KAAM2O,EAAMtB,EAAYnN,OAOlC,SAAUxD,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,QAAS,EAAG,SAAUu6B,GAC5C,OAAO,SAASI,WAAWvoB,EAAMtB,EAAYnN,GAC3C,OAAO42B,EAAK92B,KAAM2O,EAAMtB,EAAYnN,OAOlC,SAAUxD,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,SAAU,EAAG,SAAUu6B,GAC7C,OAAO,SAASK,YAAYxoB,EAAMtB,EAAYnN,GAC5C,OAAO42B,EAAK92B,KAAM2O,EAAMtB,EAAYnN,OAOlC,SAAUxD,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,UAAW,EAAG,SAAUu6B,GAC9C,OAAO,SAASM,aAAazoB,EAAMtB,EAAYnN,GAC7C,OAAO42B,EAAK92B,KAAM2O,EAAMtB,EAAYnN,OAOlC,SAAUxD,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,UAAW,EAAG,SAAUu6B,GAC9C,OAAO,SAASO,aAAa1oB,EAAMtB,EAAYnN,GAC7C,OAAO42B,EAAK92B,KAAM2O,EAAMtB,EAAYnN,OAOlC,SAAUxD,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B+6B,EAAY/6B,EAAoB,GAApBA,EAAwB,GAExCkC,EAAQA,EAAQa,EAAG,QAAS,CAC1BoN,SAAU,SAASA,SAAS6H,GAC1B,OAAO+iB,EAAUt3B,KAAMuU,EAAuB,EAAnBtU,UAAUC,OAAaD,UAAU,GAAK7D,OAIrEG,EAAoB,GAApBA,CAAwB,aAKlB,SAAUG,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B8pB,EAAmB9pB,EAAoB,KACvC0F,EAAW1F,EAAoB,GAC/BsH,EAAWtH,EAAoB,GAC/B4G,EAAY5G,EAAoB,IAChCg7B,EAAqBh7B,EAAoB,IAE7CkC,EAAQA,EAAQa,EAAG,QAAS,CAC1Bk4B,QAAS,SAASA,QAAQ/yB,GACxB,IACI6hB,EAAWrP,EADXtV,EAAIM,EAASjC,MAMjB,OAJAmD,EAAUsB,GACV6hB,EAAYziB,EAASlC,EAAEzB,QACvB+W,EAAIsgB,EAAmB51B,EAAG,GAC1B0kB,EAAiBpP,EAAGtV,EAAGA,EAAG2kB,EAAW,EAAG,EAAG7hB,EAAYxE,UAAU,IAC1DgX,KAIX1a,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B8pB,EAAmB9pB,EAAoB,KACvC0F,EAAW1F,EAAoB,GAC/BsH,EAAWtH,EAAoB,GAC/B6E,EAAY7E,EAAoB,IAChCg7B,EAAqBh7B,EAAoB,IAE7CkC,EAAQA,EAAQa,EAAG,QAAS,CAC1Bm4B,QAAS,SAASA,UAChB,IAAIC,EAAWz3B,UAAU,GACrB0B,EAAIM,EAASjC,MACbsmB,EAAYziB,EAASlC,EAAEzB,QACvB+W,EAAIsgB,EAAmB51B,EAAG,GAE9B,OADA0kB,EAAiBpP,EAAGtV,EAAGA,EAAG2kB,EAAW,EAAGoR,IAAat7B,GAAY,EAAIgF,EAAUs2B,IACxEzgB,KAIX1a,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9ByyB,EAAMzyB,EAAoB,GAApBA,EAAwB,GAElCkC,EAAQA,EAAQa,EAAG,SAAU,CAC3Bq4B,GAAI,SAASA,GAAG7e,GACd,OAAOkW,EAAIhvB,KAAM8Y,OAOf,SAAUpc,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9Bq7B,EAAOr7B,EAAoB,KAC3B0Z,EAAY1Z,EAAoB,IAGpCkC,EAAQA,EAAQa,EAAIb,EAAQO,EAAI,oCAAoCgE,KAAKiT,GAAY,SAAU,CAC7F4hB,SAAU,SAASA,SAAS/Q,GAC1B,OAAO8Q,EAAK53B,KAAM8mB,EAA8B,EAAnB7mB,UAAUC,OAAaD,UAAU,GAAK7D,IAAW,OAO5E,SAAUM,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9Bq7B,EAAOr7B,EAAoB,KAC3B0Z,EAAY1Z,EAAoB,IAGpCkC,EAAQA,EAAQa,EAAIb,EAAQO,EAAI,oCAAoCgE,KAAKiT,GAAY,SAAU,CAC7F6hB,OAAQ,SAASA,OAAOhR,GACtB,OAAO8Q,EAAK53B,KAAM8mB,EAA8B,EAAnB7mB,UAAUC,OAAaD,UAAU,GAAK7D,IAAW,OAO5E,SAAUM,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,WAAY,SAAUgmB,GAC5C,OAAO,SAASwV,WACd,OAAOxV,EAAMviB,KAAM,KAEpB,cAKG,SAAUtD,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,YAAa,SAAUgmB,GAC7C,OAAO,SAASyV,YACd,OAAOzV,EAAMviB,KAAM,KAEpB,YAKG,SAAUtD,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BuF,EAAUvF,EAAoB,IAC9BsH,EAAWtH,EAAoB,GAC/Byc,EAAWzc,EAAoB,KAC/B07B,EAAW17B,EAAoB,KAC/B27B,EAActkB,OAAO7V,UAErBo6B,EAAwB,SAAUC,EAAQ31B,GAC5CzC,KAAKq4B,GAAKD,EACVp4B,KAAK+yB,GAAKtwB,GAGZlG,EAAoB,GAApBA,CAAwB47B,EAAuB,gBAAiB,SAAS3sB,OACvE,IAAI8sB,EAAQt4B,KAAKq4B,GAAGv3B,KAAKd,KAAK+yB,IAC9B,MAAO,CAAElxB,MAAOy2B,EAAO7sB,KAAgB,OAAV6sB,KAG/B75B,EAAQA,EAAQa,EAAG,SAAU,CAC3Bi5B,SAAU,SAASA,SAASH,GAE1B,GADAt2B,EAAQ9B,OACHgZ,EAASof,GAAS,MAAM13B,UAAU03B,EAAS,qBAChD,IAAIh5B,EAAIwD,OAAO5C,MACXw4B,EAAQ,UAAWN,EAAct1B,OAAOw1B,EAAOI,OAASP,EAASp7B,KAAKu7B,GACtEK,EAAK,IAAI7kB,OAAOwkB,EAAOz5B,QAAS65B,EAAMhsB,QAAQ,KAAOgsB,EAAQ,IAAMA,GAEvE,OADAC,EAAGC,UAAY70B,EAASu0B,EAAOM,WACxB,IAAIP,EAAsBM,EAAIr5B,OAOnC,SAAU1C,EAAQD,EAASF,GAKjC,IAAI+E,EAAW/E,EAAoB,GACnCG,EAAOD,QAAU,WACf,IAAI4G,EAAO/B,EAAStB,MAChB6E,EAAS,GAMb,OALIxB,EAAKlF,SAAQ0G,GAAU,KACvBxB,EAAKs1B,aAAY9zB,GAAU,KAC3BxB,EAAKu1B,YAAW/zB,GAAU,KAC1BxB,EAAKw1B,UAASh0B,GAAU,KACxBxB,EAAKy1B,SAAQj0B,GAAU,KACpBA,IAMH,SAAUnI,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,kBAKlB,SAAUG,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,eAKlB,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BohB,EAAUphB,EAAoB,IAC9BiH,EAAYjH,EAAoB,IAChCkH,EAAOlH,EAAoB,IAC3Bq0B,EAAiBr0B,EAAoB,IAEzCkC,EAAQA,EAAQW,EAAG,SAAU,CAC3B25B,0BAA2B,SAASA,0BAA0Bl7B,GAO5D,IANA,IAKIe,EAAKmP,EALLpM,EAAI6B,EAAU3F,GACdm7B,EAAUv1B,EAAK/B,EACf0G,EAAOuV,EAAQhc,GACfkD,EAAS,GACTlI,EAAI,EAEaA,EAAdyL,EAAKlI,SACV6N,EAAOirB,EAAQr3B,EAAG/C,EAAMwJ,EAAKzL,SAChBP,IAAWw0B,EAAe/rB,EAAQjG,EAAKmP,GAEtD,OAAOlJ,MAOL,SAAUnI,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B08B,EAAU18B,EAAoB,IAApBA,EAAyB,GAEvCkC,EAAQA,EAAQW,EAAG,SAAU,CAC3B8I,OAAQ,SAASA,OAAOzH,GACtB,OAAOw4B,EAAQx4B,OAOb,SAAU/D,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BqZ,EAAWrZ,EAAoB,IAApBA,EAAyB,GAExCkC,EAAQA,EAAQW,EAAG,SAAU,CAC3BkJ,QAAS,SAASA,QAAQ7H,GACxB,OAAOmV,EAASnV,OAOd,SAAU/D,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B0F,EAAW1F,EAAoB,GAC/B4G,EAAY5G,EAAoB,IAChC6c,EAAkB7c,EAAoB,GAG1CA,EAAoB,IAAMkC,EAAQA,EAAQa,EAAI/C,EAAoB,IAAK,SAAU,CAC/E28B,iBAAkB,SAASA,iBAAiB55B,EAAGpC,GAC7Ckc,EAAgB1X,EAAEO,EAASjC,MAAOV,EAAG,CAAE9B,IAAK2F,EAAUjG,GAASK,YAAY,EAAMD,cAAc,QAO7F,SAAUZ,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B0F,EAAW1F,EAAoB,GAC/B4G,EAAY5G,EAAoB,IAChC6c,EAAkB7c,EAAoB,GAG1CA,EAAoB,IAAMkC,EAAQA,EAAQa,EAAI/C,EAAoB,IAAK,SAAU,CAC/Ewa,iBAAkB,SAASA,iBAAiBzX,EAAG6pB,GAC7C/P,EAAgB1X,EAAEO,EAASjC,MAAOV,EAAG,CAAE+K,IAAKlH,EAAUgmB,GAAS5rB,YAAY,EAAMD,cAAc,QAO7F,SAAUZ,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B0F,EAAW1F,EAAoB,GAC/BiF,EAAcjF,EAAoB,IAClC6F,EAAiB7F,EAAoB,IACrCmH,EAA2BnH,EAAoB,IAAImF,EAGvDnF,EAAoB,IAAMkC,EAAQA,EAAQa,EAAI/C,EAAoB,IAAK,SAAU,CAC/E48B,iBAAkB,SAASA,iBAAiB75B,GAC1C,IAEIyW,EAFApU,EAAIM,EAASjC,MACb8W,EAAItV,EAAYlC,GAAG,GAEvB,GACE,GAAIyW,EAAIrS,EAAyB/B,EAAGmV,GAAI,OAAOf,EAAEvY,UAC1CmE,EAAIS,EAAeT,QAO1B,SAAUjF,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B0F,EAAW1F,EAAoB,GAC/BiF,EAAcjF,EAAoB,IAClC6F,EAAiB7F,EAAoB,IACrCmH,EAA2BnH,EAAoB,IAAImF,EAGvDnF,EAAoB,IAAMkC,EAAQA,EAAQa,EAAI/C,EAAoB,IAAK,SAAU,CAC/E68B,iBAAkB,SAASA,iBAAiB95B,GAC1C,IAEIyW,EAFApU,EAAIM,EAASjC,MACb8W,EAAItV,EAAYlC,GAAG,GAEvB,GACE,GAAIyW,EAAIrS,EAAyB/B,EAAGmV,GAAI,OAAOf,EAAE1L,UAC1C1I,EAAIS,EAAeT,QAO1B,SAAUjF,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQa,EAAIb,EAAQ6B,EAAG,MAAO,CAAEinB,OAAQhrB,EAAoB,IAApBA,CAAyB,UAKnE,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQa,EAAIb,EAAQ6B,EAAG,MAAO,CAAEinB,OAAQhrB,EAAoB,IAApBA,CAAyB,UAKnE,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,QAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,QAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,QAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,QAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQS,EAAG,CAAEf,OAAQ5B,EAAoB,MAK3C,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,SAAU,CAAEjB,OAAQ5B,EAAoB,MAKrD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BgW,EAAMhW,EAAoB,IAE9BkC,EAAQA,EAAQW,EAAG,QAAS,CAC1Bi6B,QAAS,SAASA,QAAQ54B,GACxB,MAAmB,UAAZ8R,EAAI9R,OAOT,SAAU/D,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CACzBk6B,MAAO,SAASA,MAAM5gB,EAAG6gB,EAAOC,GAC9B,OAAO54B,KAAKS,IAAIm4B,EAAO54B,KAAK0R,IAAIinB,EAAO7gB,QAOrC,SAAUhc,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CAAEq6B,YAAa74B,KAAK84B,GAAK,OAK9C,SAAUh9B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Bo9B,EAAc,IAAM/4B,KAAK84B,GAE7Bj7B,EAAQA,EAAQW,EAAG,OAAQ,CACzBw6B,QAAS,SAASA,QAAQC,GACxB,OAAOA,EAAUF,MAOf,SAAUj9B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BirB,EAAQjrB,EAAoB,KAC5B2mB,EAAS3mB,EAAoB,KAEjCkC,EAAQA,EAAQW,EAAG,OAAQ,CACzB06B,OAAQ,SAASA,OAAOphB,EAAG+O,EAAOC,EAAQC,EAAQC,GAChD,OAAO1E,EAAOsE,EAAM9O,EAAG+O,EAAOC,EAAQC,EAAQC,QAO5C,SAAUlrB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CACzB26B,MAAO,SAASA,MAAMC,EAAIC,EAAIC,EAAIC,GAChC,IAAIC,EAAMJ,IAAO,EAEbK,EAAMH,IAAO,EACjB,OAFUD,IAAO,IAEHE,IAAO,KAAOC,EAAMC,GAAOD,EAAMC,KAASD,EAAMC,IAAQ,MAAQ,IAAM,MAOlF,SAAU39B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CACzBk7B,MAAO,SAASA,MAAMN,EAAIC,EAAIC,EAAIC,GAChC,IAAIC,EAAMJ,IAAO,EAEbK,EAAMH,IAAO,EACjB,OAFUD,IAAO,IAEHE,IAAO,MAAQC,EAAMC,IAAQD,EAAMC,GAAOD,EAAMC,IAAQ,KAAO,IAAM,MAOjF,SAAU39B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CACzBm7B,MAAO,SAASA,MAAMC,EAAG5rB,GACvB,IACI6rB,GAAMD,EACNE,GAAM9rB,EACN+rB,EAHS,MAGJF,EACLG,EAJS,MAIJF,EACLG,EAAKJ,GAAM,GACXK,EAAKJ,GAAM,GACX7O,GAAKgP,EAAKD,IAAO,IAAMD,EAAKC,IAAO,IACvC,OAAOC,EAAKC,GAAMjP,GAAK,MAAQ8O,EAAKG,IAAO,IAR9B,MAQoCjP,IAAe,QAO9D,SAAUnvB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CAAEu6B,YAAa,IAAM/4B,KAAK84B,MAK/C,SAAUh9B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Bk9B,EAAc74B,KAAK84B,GAAK,IAE5Bj7B,EAAQA,EAAQW,EAAG,OAAQ,CACzBy6B,QAAS,SAASA,QAAQD,GACxB,OAAOA,EAAUH,MAOf,SAAU/8B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CAAEooB,MAAOjrB,EAAoB,QAKlD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CACzB27B,MAAO,SAASA,MAAMP,EAAG5rB,GACvB,IACI6rB,GAAMD,EACNE,GAAM9rB,EACN+rB,EAHS,MAGJF,EACLG,EAJS,MAIJF,EACLG,EAAKJ,IAAO,GACZK,EAAKJ,IAAO,GACZ7O,GAAKgP,EAAKD,IAAO,IAAMD,EAAKC,IAAO,IACvC,OAAOC,EAAKC,GAAMjP,IAAM,MAAQ8O,EAAKG,IAAO,IAR/B,MAQqCjP,KAAgB,QAOhE,SAAUnvB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CAAE47B,QAAS,SAASA,QAAQtiB,GAErD,OAAQA,GAAKA,IAAMA,EAAIA,EAAS,GAALA,EAAS,EAAIA,GAAKF,SAAe,EAAJE,MAMpD,SAAUhc,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B6B,EAAO7B,EAAoB,IAC3B4B,EAAS5B,EAAoB,GAC7B8J,EAAqB9J,EAAoB,IACzC01B,EAAiB11B,EAAoB,KAEzCkC,EAAQA,EAAQa,EAAIb,EAAQ6B,EAAG,UAAW,CAAE26B,UAAW,SAAUC,GAC/D,IAAIr7B,EAAIwG,EAAmBrG,KAAM5B,EAAK8d,SAAW/d,EAAO+d,SACpDif,EAAiC,mBAAbD,EACxB,OAAOl7B,KAAK+c,KACVoe,EAAa,SAAUziB,GACrB,OAAOuZ,EAAepyB,EAAGq7B,KAAane,KAAK,WAAc,OAAOrE,KAC9DwiB,EACJC,EAAa,SAAUp6B,GACrB,OAAOkxB,EAAepyB,EAAGq7B,KAAane,KAAK,WAAc,MAAMhc,KAC7Dm6B,OAOF,SAAUx+B,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BmnB,EAAuBnnB,EAAoB,IAC3Cy1B,EAAUz1B,EAAoB,KAElCkC,EAAQA,EAAQW,EAAG,UAAW,CAAEg8B,MAAO,SAAU32B,GAC/C,IAAIkf,EAAoBD,EAAqBhiB,EAAE1B,MAC3C6E,EAASmtB,EAAQvtB,GAErB,OADCI,EAAO9D,EAAI4iB,EAAkBpG,OAASoG,EAAkB9G,SAAShY,EAAO+J,GAClE+U,EAAkB7G,YAMrB,SAAUpgB,EAAQD,EAASF,GAEjC,IAAI8+B,EAAW9+B,EAAoB,IAC/B+E,EAAW/E,EAAoB,GAC/B++B,EAAYD,EAASz8B,IACrB28B,EAA4BF,EAAShxB,IAEzCgxB,EAASh2B,IAAI,CAAEm2B,eAAgB,SAASA,eAAeC,EAAaC,EAAe97B,EAAQgQ,GACzF2rB,EAA0BE,EAAaC,EAAep6B,EAAS1B,GAAS07B,EAAU1rB,QAM9E,SAAUlT,EAAQD,EAASF,GAEjC,IAAI8+B,EAAW9+B,EAAoB,IAC/B+E,EAAW/E,EAAoB,GAC/B++B,EAAYD,EAASz8B,IACrB+Q,EAAyB0rB,EAASzuB,IAClC5L,EAAQq6B,EAASr6B,MAErBq6B,EAASh2B,IAAI,CAAEs2B,eAAgB,SAASA,eAAeF,EAAa77B,GAClE,IAAIgQ,EAAY3P,UAAUC,OAAS,EAAI9D,GAAYk/B,EAAUr7B,UAAU,IACnE+P,EAAcL,EAAuBrO,EAAS1B,GAASgQ,GAAW,GACtE,GAAII,IAAgB5T,KAAc4T,EAAoB,UAAEyrB,GAAc,OAAO,EAC7E,GAAIzrB,EAAYyG,KAAM,OAAO,EAC7B,IAAI5G,EAAiB7O,EAAMxD,IAAIoC,GAE/B,OADAiQ,EAAuB,UAAED,KAChBC,EAAe4G,MAAQzV,EAAc,UAAEpB,OAM5C,SAAUlD,EAAQD,EAASF,GAEjC,IAAI8+B,EAAW9+B,EAAoB,IAC/B+E,EAAW/E,EAAoB,GAC/B6F,EAAiB7F,EAAoB,IACrCq/B,EAAyBP,EAAS98B,IAClCs9B,EAAyBR,EAAS79B,IAClC89B,EAAYD,EAASz8B,IAErBk9B,EAAsB,SAAU/rB,EAAapO,EAAGrC,GAElD,GADas8B,EAAuB7rB,EAAapO,EAAGrC,GACxC,OAAOu8B,EAAuB9rB,EAAapO,EAAGrC,GAC1D,IAAIkd,EAASpa,EAAeT,GAC5B,OAAkB,OAAX6a,EAAkBsf,EAAoB/rB,EAAayM,EAAQld,GAAKlD,IAGzEi/B,EAASh2B,IAAI,CAAE02B,YAAa,SAASA,YAAYN,EAAa77B,GAC5D,OAAOk8B,EAAoBL,EAAan6B,EAAS1B,GAASK,UAAUC,OAAS,EAAI9D,GAAYk/B,EAAUr7B,UAAU,SAM7G,SAAUvD,EAAQD,EAASF,GAEjC,IAAI+nB,EAAM/nB,EAAoB,KAC1B0O,EAAO1O,EAAoB,KAC3B8+B,EAAW9+B,EAAoB,IAC/B+E,EAAW/E,EAAoB,GAC/B6F,EAAiB7F,EAAoB,IACrCy/B,EAA0BX,EAASjzB,KACnCkzB,EAAYD,EAASz8B,IAErBq9B,EAAuB,SAAUt6B,EAAGrC,GACtC,IAAI48B,EAAQF,EAAwBr6B,EAAGrC,GACnCkd,EAASpa,EAAeT,GAC5B,GAAe,OAAX6a,EAAiB,OAAO0f,EAC5B,IAAIC,EAAQF,EAAqBzf,EAAQld,GACzC,OAAO68B,EAAMj8B,OAASg8B,EAAMh8B,OAAS+K,EAAK,IAAIqZ,EAAI4X,EAAM7sB,OAAO8sB,KAAWA,EAAQD,GAGpFb,EAASh2B,IAAI,CAAE+2B,gBAAiB,SAASA,gBAAgBx8B,GACvD,OAAOq8B,EAAqB36B,EAAS1B,GAASK,UAAUC,OAAS,EAAI9D,GAAYk/B,EAAUr7B,UAAU,SAMjG,SAAUvD,EAAQD,EAASF,GAEjC,IAAI8+B,EAAW9+B,EAAoB,IAC/B+E,EAAW/E,EAAoB,GAC/Bs/B,EAAyBR,EAAS79B,IAClC89B,EAAYD,EAASz8B,IAEzBy8B,EAASh2B,IAAI,CAAEg3B,eAAgB,SAASA,eAAeZ,EAAa77B,GAClE,OAAOi8B,EAAuBJ,EAAan6B,EAAS1B,GAChDK,UAAUC,OAAS,EAAI9D,GAAYk/B,EAAUr7B,UAAU,SAMvD,SAAUvD,EAAQD,EAASF,GAEjC,IAAI8+B,EAAW9+B,EAAoB,IAC/B+E,EAAW/E,EAAoB,GAC/By/B,EAA0BX,EAASjzB,KACnCkzB,EAAYD,EAASz8B,IAEzBy8B,EAASh2B,IAAI,CAAEi3B,mBAAoB,SAASA,mBAAmB18B,GAC7D,OAAOo8B,EAAwB16B,EAAS1B,GAASK,UAAUC,OAAS,EAAI9D,GAAYk/B,EAAUr7B,UAAU,SAMpG,SAAUvD,EAAQD,EAASF,GAEjC,IAAI8+B,EAAW9+B,EAAoB,IAC/B+E,EAAW/E,EAAoB,GAC/B6F,EAAiB7F,EAAoB,IACrCq/B,EAAyBP,EAAS98B,IAClC+8B,EAAYD,EAASz8B,IAErB29B,EAAsB,SAAUxsB,EAAapO,EAAGrC,GAElD,GADas8B,EAAuB7rB,EAAapO,EAAGrC,GACxC,OAAO,EACnB,IAAIkd,EAASpa,EAAeT,GAC5B,OAAkB,OAAX6a,GAAkB+f,EAAoBxsB,EAAayM,EAAQld,IAGpE+7B,EAASh2B,IAAI,CAAEm3B,YAAa,SAASA,YAAYf,EAAa77B,GAC5D,OAAO28B,EAAoBd,EAAan6B,EAAS1B,GAASK,UAAUC,OAAS,EAAI9D,GAAYk/B,EAAUr7B,UAAU,SAM7G,SAAUvD,EAAQD,EAASF,GAEjC,IAAI8+B,EAAW9+B,EAAoB,IAC/B+E,EAAW/E,EAAoB,GAC/Bq/B,EAAyBP,EAAS98B,IAClC+8B,EAAYD,EAASz8B,IAEzBy8B,EAASh2B,IAAI,CAAEo3B,eAAgB,SAASA,eAAehB,EAAa77B,GAClE,OAAOg8B,EAAuBH,EAAan6B,EAAS1B,GAChDK,UAAUC,OAAS,EAAI9D,GAAYk/B,EAAUr7B,UAAU,SAMvD,SAAUvD,EAAQD,EAASF,GAEjC,IAAImgC,EAAYngC,EAAoB,IAChC+E,EAAW/E,EAAoB,GAC/B4G,EAAY5G,EAAoB,IAChC++B,EAAYoB,EAAU99B,IACtB28B,EAA4BmB,EAAUryB,IAE1CqyB,EAAUr3B,IAAI,CAAEg2B,SAAU,SAASA,SAASI,EAAaC,GACvD,OAAO,SAASiB,UAAU/8B,EAAQgQ,GAChC2rB,EACEE,EAAaC,GACZ9rB,IAAcxT,GAAYkF,EAAW6B,GAAWvD,GACjD07B,EAAU1rB,SAQV,SAAUlT,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Bu1B,EAAYv1B,EAAoB,GAApBA,GACZ+d,EAAU/d,EAAoB,GAAG+d,QACjC6B,EAA6C,WAApC5f,EAAoB,GAApBA,CAAwB+d,GAErC7b,EAAQA,EAAQS,EAAG,CACjB09B,KAAM,SAASA,KAAKx5B,GAClB,IAAIqZ,EAASN,GAAU7B,EAAQmC,OAC/BqV,EAAUrV,EAASA,EAAOqF,KAAK1e,GAAMA,OAOnC,SAAU1G,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B4B,EAAS5B,EAAoB,GAC7B6B,EAAO7B,EAAoB,IAC3Bu1B,EAAYv1B,EAAoB,GAApBA,GACZsgC,EAAatgC,EAAoB,EAApBA,CAAuB,cACpC4G,EAAY5G,EAAoB,IAChC+E,EAAW/E,EAAoB,GAC/BkJ,EAAalJ,EAAoB,IACjCoJ,EAAcpJ,EAAoB,IAClC+B,EAAO/B,EAAoB,IAC3B2Z,EAAQ3Z,EAAoB,IAC5B6V,EAAS8D,EAAM9D,OAEfkD,EAAY,SAAUlS,GACxB,OAAa,MAANA,EAAahH,GAAY+G,EAAUC,IAGxC05B,EAAsB,SAAUC,GAClC,IAAIC,EAAUD,EAAaxmB,GACvBymB,IACFD,EAAaxmB,GAAKna,GAClB4gC,MAIAC,EAAqB,SAAUF,GACjC,OAAOA,EAAaG,KAAO9gC,IAGzB+gC,EAAoB,SAAUJ,GAC3BE,EAAmBF,KACtBA,EAAaG,GAAK9gC,GAClB0gC,EAAoBC,KAIpBK,EAAe,SAAUC,EAAUC,GACrCh8B,EAAS+7B,GACTr9B,KAAKuW,GAAKna,GACV4D,KAAKk9B,GAAKG,EACVA,EAAW,IAAIE,EAAqBv9B,MACpC,IACE,IAAIg9B,EAAUM,EAAWD,GACrBN,EAAeC,EACJ,MAAXA,IACiC,mBAAxBA,EAAQQ,YAA4BR,EAAU,WAAcD,EAAaS,eAC/Er6B,EAAU65B,GACfh9B,KAAKuW,GAAKymB,GAEZ,MAAOj8B,GAEP,YADAs8B,EAASxJ,MAAM9yB,GAEXk8B,EAAmBj9B,OAAO88B,EAAoB98B,OAGtDo9B,EAAar/B,UAAY4H,EAAY,GAAI,CACvC63B,YAAa,SAASA,cAAgBL,EAAkBn9B,SAG1D,IAAIu9B,EAAuB,SAAUR,GACnC/8B,KAAK+yB,GAAKgK,GAGZQ,EAAqBx/B,UAAY4H,EAAY,GAAI,CAC/C6F,KAAM,SAASA,KAAK3J,GAClB,IAAIk7B,EAAe/8B,KAAK+yB,GACxB,IAAKkK,EAAmBF,GAAe,CACrC,IAAIM,EAAWN,EAAaG,GAC5B,IACE,IAAIpgC,EAAIwY,EAAU+nB,EAAS7xB,MAC3B,GAAI1O,EAAG,OAAOA,EAAED,KAAKwgC,EAAUx7B,GAC/B,MAAOd,GACP,IACEo8B,EAAkBJ,GAClB,QACA,MAAMh8B,MAKd8yB,MAAO,SAASA,MAAMhyB,GACpB,IAAIk7B,EAAe/8B,KAAK+yB,GACxB,GAAIkK,EAAmBF,GAAe,MAAMl7B,EAC5C,IAAIw7B,EAAWN,EAAaG,GAC5BH,EAAaG,GAAK9gC,GAClB,IACE,IAAIU,EAAIwY,EAAU+nB,EAASxJ,OAC3B,IAAK/2B,EAAG,MAAM+E,EACdA,EAAQ/E,EAAED,KAAKwgC,EAAUx7B,GACzB,MAAOd,GACP,IACE+7B,EAAoBC,GACpB,QACA,MAAMh8B,GAGV,OADE+7B,EAAoBC,GACfl7B,GAET47B,SAAU,SAASA,SAAS57B,GAC1B,IAAIk7B,EAAe/8B,KAAK+yB,GACxB,IAAKkK,EAAmBF,GAAe,CACrC,IAAIM,EAAWN,EAAaG,GAC5BH,EAAaG,GAAK9gC,GAClB,IACE,IAAIU,EAAIwY,EAAU+nB,EAASI,UAC3B57B,EAAQ/E,EAAIA,EAAED,KAAKwgC,EAAUx7B,GAASzF,GACtC,MAAO2E,GACP,IACE+7B,EAAoBC,GACpB,QACA,MAAMh8B,GAGV,OADE+7B,EAAoBC,GACfl7B,MAKb,IAAI67B,EAAc,SAASC,WAAWL,GACpC73B,EAAWzF,KAAM09B,EAAa,aAAc,MAAMzZ,GAAK9gB,EAAUm6B,IAGnE33B,EAAY+3B,EAAY3/B,UAAW,CACjC6/B,UAAW,SAASA,UAAUP,GAC5B,OAAO,IAAID,EAAaC,EAAUr9B,KAAKikB,KAEzC1X,QAAS,SAASA,QAAQnJ,GACxB,IAAIC,EAAOrD,KACX,OAAO,IAAK5B,EAAK8d,SAAW/d,EAAO+d,SAAS,SAAUW,EAASU,GAC7Dpa,EAAUC,GACV,IAAI25B,EAAe15B,EAAKu6B,UAAU,CAChCpyB,KAAM,SAAU3J,GACd,IACE,OAAOuB,EAAGvB,GACV,MAAOd,GACPwc,EAAOxc,GACPg8B,EAAaS,gBAGjB3J,MAAOtW,EACPkgB,SAAU5gB,SAMlBlX,EAAY+3B,EAAa,CACvBzyB,KAAM,SAASA,KAAKyN,GAClB,IAAI7Y,EAAoB,mBAATG,KAAsBA,KAAO09B,EACxC/5B,EAAS2R,EAAUhU,EAASoX,GAAGmkB,IACnC,GAAIl5B,EAAQ,CACV,IAAIk6B,EAAav8B,EAASqC,EAAO9G,KAAK6b,IACtC,OAAOmlB,EAAWx7B,cAAgBxC,EAAIg+B,EAAa,IAAIh+B,EAAE,SAAUw9B,GACjE,OAAOQ,EAAWD,UAAUP,KAGhC,OAAO,IAAIx9B,EAAE,SAAUw9B,GACrB,IAAI5xB,GAAO,EAeX,OAdAqmB,EAAU,WACR,IAAKrmB,EAAM,CACT,IACE,GAAIyK,EAAMwC,GAAG,EAAO,SAAUjY,GAE5B,GADA48B,EAAS7xB,KAAK/K,GACVgL,EAAM,OAAO2G,MACZA,EAAQ,OACf,MAAOrR,GACP,GAAI0K,EAAM,MAAM1K,EAEhB,YADAs8B,EAASxJ,MAAM9yB,GAEfs8B,EAASI,cAGR,WAAchyB,GAAO,MAGhCE,GAAI,SAASA,KACX,IAAK,IAAIhP,EAAI,EAAGC,EAAIqD,UAAUC,OAAQ49B,EAAQ,IAAI12B,MAAMxK,GAAID,EAAIC,GAAIkhC,EAAMnhC,GAAKsD,UAAUtD,KACzF,OAAO,IAAqB,mBAATqD,KAAsBA,KAAO09B,GAAa,SAAUL,GACrE,IAAI5xB,GAAO,EASX,OARAqmB,EAAU,WACR,IAAKrmB,EAAM,CACT,IAAK,IAAIyM,EAAI,EAAGA,EAAI4lB,EAAM59B,SAAUgY,EAElC,GADAmlB,EAAS7xB,KAAKsyB,EAAM5lB,IAChBzM,EAAM,OACV4xB,EAASI,cAGR,WAAchyB,GAAO,QAKlCnN,EAAKo/B,EAAY3/B,UAAW8+B,EAAY,WAAc,OAAO78B,OAE7DvB,EAAQA,EAAQS,EAAG,CAAEy+B,WAAYD,IAEjCnhC,EAAoB,GAApBA,CAAwB,eAKlB,SAAUG,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9BwhC,EAAQxhC,EAAoB,IAChCkC,EAAQA,EAAQS,EAAIT,EAAQe,EAAG,CAC7Bgb,aAAcujB,EAAM1zB,IACpBqQ,eAAgBqjB,EAAMliB,SAMlB,SAAUnf,EAAQD,EAASF,GAEjCA,EAAoB,IAYpB,IAXA,IAAI4B,EAAS5B,EAAoB,GAC7B+B,EAAO/B,EAAoB,IAC3BgK,EAAYhK,EAAoB,IAChCyhC,EAAgBzhC,EAAoB,EAApBA,CAAuB,eAEvC0hC,EAAe,wbAIU/6B,MAAM,KAE1BvG,EAAI,EAAGA,EAAIshC,EAAa/9B,OAAQvD,IAAK,CAC5C,IAAIoG,EAAOk7B,EAAathC,GACpBuhC,EAAa//B,EAAO4E,GACpB+I,EAAQoyB,GAAcA,EAAWngC,UACjC+N,IAAUA,EAAMkyB,IAAgB1/B,EAAKwN,EAAOkyB,EAAej7B,GAC/DwD,EAAUxD,GAAQwD,EAAUa,QAMxB,SAAU1K,EAAQD,EAASF,GAGjC,IAAI4B,EAAS5B,EAAoB,GAC7BkC,EAAUlC,EAAoB,GAC9B0Z,EAAY1Z,EAAoB,IAChCyI,EAAQ,GAAGA,MACXm5B,EAAO,WAAWn7B,KAAKiT,GACvBsT,EAAO,SAAUlf,GACnB,OAAO,SAAUjH,EAAIg7B,GACnB,IAAIC,EAA+B,EAAnBp+B,UAAUC,OACtBiY,IAAOkmB,GAAYr5B,EAAMnI,KAAKoD,UAAW,GAC7C,OAAOoK,EAAIg0B,EAAY,YAEP,mBAANj7B,EAAmBA,EAAKhD,SAASgD,IAAKjD,MAAMH,KAAMmY,IACxD/U,EAAIg7B,KAGZ3/B,EAAQA,EAAQS,EAAIT,EAAQe,EAAIf,EAAQO,EAAIm/B,EAAM,CAChDviB,WAAY2N,EAAKprB,EAAOyd,YACxB0iB,YAAa/U,EAAKprB,EAAOmgC,gBAMrB,SAAU5hC,EAAQD,EAASF,GAIjC,IAAI8B,EAAM9B,EAAoB,IAC1BkC,EAAUlC,EAAoB,GAC9B+G,EAAa/G,EAAoB,IACjCub,EAASvb,EAAoB,IAC7BgI,EAAShI,EAAoB,IAC7B6F,EAAiB7F,EAAoB,IACrCob,EAAUpb,EAAoB,IAC9BkF,EAAKlF,EAAoB,GACzBgiC,EAAQhiC,EAAoB,KAC5B4G,EAAY5G,EAAoB,IAChC2Z,EAAQ3Z,EAAoB,IAC5BsrB,EAAatrB,EAAoB,KACjCqY,EAAcrY,EAAoB,IAClC2O,EAAO3O,EAAoB,IAC3BiE,EAAWjE,EAAoB,GAC/BiH,EAAYjH,EAAoB,IAChC4W,EAAc5W,EAAoB,GAClCgC,EAAMhC,EAAoB,IAU1BiiC,EAAmB,SAAUz6B,GAC/B,IAAIE,EAAiB,GAARF,EACTK,EAAmB,GAARL,EACf,OAAO,SAAUlG,EAAQ4G,EAAYpB,GACnC,IAIIzE,EAAK8F,EAAKC,EAJVjD,EAAIrD,EAAIoG,EAAYpB,EAAM,GAC1B1B,EAAI6B,EAAU3F,GACdgH,EAASZ,GAAkB,GAARF,GAAqB,GAARA,EAC5B,IAAoB,mBAAR/D,KAAqBA,KAAOy+B,MAAUriC,GAE1D,IAAKwC,KAAO+C,EAAG,GAAIpD,EAAIoD,EAAG/C,KAExB+F,EAAMjD,EADNgD,EAAM/C,EAAE/C,GACKA,EAAKf,GACdkG,GACF,GAAIE,EAAQY,EAAOjG,GAAO+F,OACrB,GAAIA,EAAK,OAAQZ,GACpB,KAAK,EAAGc,EAAOjG,GAAO8F,EAAK,MAC3B,KAAK,EAAG,OAAO,EACf,KAAK,EAAG,OAAOA,EACf,KAAK,EAAG,OAAO9F,EACf,KAAK,EAAGiG,EAAOF,EAAI,IAAMA,EAAI,QACxB,GAAIP,EAAU,OAAO,EAGhC,OAAe,GAARL,GAAaK,EAAWA,EAAWS,IAG1C65B,EAAUF,EAAiB,GAE3BG,EAAiB,SAAUppB,GAC7B,OAAO,SAAU9U,GACf,OAAO,IAAIm+B,EAAan+B,EAAI8U,KAG5BqpB,EAAe,SAAUhlB,EAAUrE,GACrCvV,KAAKqT,GAAK7P,EAAUoW,GACpB5Z,KAAK8zB,GAAKnc,EAAQiC,GAClB5Z,KAAK6Z,GAAK,EACV7Z,KAAK8Z,GAAKvE,GAmBZ,SAASkpB,KAAKpsB,GACZ,IAAIwsB,EAAOt6B,EAAO,MAQlB,OAPI8N,GAAYjW,KACVyrB,EAAWxV,GACb6D,EAAM7D,GAAU,EAAM,SAAUzT,EAAKiD,GACnCg9B,EAAKjgC,GAAOiD,IAETiW,EAAO+mB,EAAMxsB,IAEfwsB,EA1BTjqB,EAAYgqB,EAAc,OAAQ,WAChC,IAIIhgC,EAJAyE,EAAOrD,KACP2B,EAAI0B,EAAKgQ,GACTjL,EAAO/E,EAAKywB,GACZve,EAAOlS,EAAKyW,GAEhB,GACE,GAAe1R,EAAKlI,QAAhBmD,EAAKwW,GAEP,OADAxW,EAAKgQ,GAAKjX,GACH8O,EAAK,UAEN3M,EAAIoD,EAAG/C,EAAMwJ,EAAK/E,EAAKwW,QACjC,OAA2B3O,EAAK,EAApB,QAARqK,EAA+B3W,EACvB,UAAR2W,EAAiC5T,EAAE/C,GACxB,CAACA,EAAK+C,EAAE/C,OAczB6/B,KAAK1gC,UAAY,KAwCjBU,EAAQA,EAAQS,EAAIT,EAAQO,EAAG,CAAEy/B,KAAMA,OAEvChgC,EAAQA,EAAQW,EAAG,OAAQ,CACzBgJ,KAAMu2B,EAAe,QACrBz2B,OAAQy2B,EAAe,UACvBr2B,QAASq2B,EAAe,WACxBpyB,QAASiyB,EAAiB,GAC1B5xB,IAAK4xB,EAAiB,GACtBryB,OAAQqyB,EAAiB,GACzBzxB,KAAMyxB,EAAiB,GACvBvyB,MAAOuyB,EAAiB,GACxBpyB,KAAMoyB,EAAiB,GACvBE,QAASA,EACTI,SAAUN,EAAiB,GAC3B91B,OApDF,SAASA,OAAO7K,EAAQwN,EAAOyrB,GAC7B3zB,EAAUkI,GACV,IAIIiY,EAAM1kB,EAJN+C,EAAI6B,EAAU3F,GACduK,EAAOuP,EAAQhW,GACfzB,EAASkI,EAAKlI,OACdvD,EAAI,EAER,GAAIsD,UAAUC,OAAS,EAAG,CACxB,IAAKA,EAAQ,MAAMQ,UAAU,gDAC7B4iB,EAAO3hB,EAAEyG,EAAKzL,WACT2mB,EAAOlmB,OAAO05B,GACrB,KAAgBn6B,EAATuD,GAAgB3B,EAAIoD,EAAG/C,EAAMwJ,EAAKzL,QACvC2mB,EAAOjY,EAAMiY,EAAM3hB,EAAE/C,GAAMA,EAAKf,IAElC,OAAOylB,GAuCPib,MAAOA,EACP7xB,SArCF,SAASA,SAAS7O,EAAQ0W,GAExB,OAAQA,GAAMA,EAAKgqB,EAAM1gC,EAAQ0W,GAAMmqB,EAAQ7gC,EAAQ,SAAU4C,GAE/D,OAAOA,GAAMA,OACPrE,IAiCRmC,IAAKA,EACLf,IA/BF,SAASA,IAAIK,EAAQe,GACnB,GAAIL,EAAIV,EAAQe,GAAM,OAAOf,EAAOe,IA+BpCyL,IA7BF,SAASA,IAAIxM,EAAQe,EAAKiD,GAGxB,OAFIsR,GAAevU,KAAOxB,OAAQqE,EAAGC,EAAE7D,EAAQe,EAAK0E,EAAW,EAAGzB,IAC7DhE,EAAOe,GAAOiD,EACZhE,GA2BPkhC,OAxBF,SAASA,OAAOt+B,GACd,OAAOD,EAASC,IAAO2B,EAAe3B,KAAQg+B,KAAK1gC,cA6B/C,SAAUrB,EAAQD,EAASF,GAEjC,IAAIob,EAAUpb,EAAoB,IAC9BiH,EAAYjH,EAAoB,IACpCG,EAAOD,QAAU,SAAUoB,EAAQ0W,GAMjC,IALA,IAII3V,EAJA+C,EAAI6B,EAAU3F,GACduK,EAAOuP,EAAQhW,GACfzB,EAASkI,EAAKlI,OACd0E,EAAQ,EAEIA,EAAT1E,GAAgB,GAAIyB,EAAE/C,EAAMwJ,EAAKxD,QAAc2P,EAAI,OAAO3V,IAM7D,SAAUlC,EAAQD,EAASF,GAEjC,IAAI+E,EAAW/E,EAAoB,GAC/BiB,EAAMjB,EAAoB,IAC9BG,EAAOD,QAAUF,EAAoB,IAAIyiC,YAAc,SAAUv+B,GAC/D,IAAI8K,EAAS/N,EAAIiD,GACjB,GAAqB,mBAAV8K,EAAsB,MAAM7K,UAAUD,EAAK,qBACtD,OAAOa,EAASiK,EAAO1O,KAAK4D,MAMxB,SAAU/D,EAAQD,EAASF,GAEjC,IAAI4B,EAAS5B,EAAoB,GAC7B6B,EAAO7B,EAAoB,IAC3BkC,EAAUlC,EAAoB,GAC9B0iC,EAAU1iC,EAAoB,KAElCkC,EAAQA,EAAQS,EAAIT,EAAQO,EAAG,CAC7BkgC,MAAO,SAASA,MAAMd,GACpB,OAAO,IAAKhgC,EAAK8d,SAAW/d,EAAO+d,SAAS,SAAUW,GACpDjB,WAAWqjB,EAAQpiC,KAAKggB,GAAS,GAAOuhB,SAQxC,SAAU1hC,EAAQD,EAASF,GAEjC,IAAIurB,EAAOvrB,EAAoB,KAC3BkC,EAAUlC,EAAoB,GAGlCA,EAAoB,IAAI2T,EAAI4X,EAAK5X,EAAI4X,EAAK5X,GAAK,GAE/CzR,EAAQA,EAAQa,EAAIb,EAAQO,EAAG,WAAY,CAAEoiB,KAAM7kB,EAAoB,QAKjE,SAAUG,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAIX,EAAQO,EAAG,SAAU,CAAEwB,SAAUjE,EAAoB,MAKnE,SAAUG,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAIX,EAAQO,EAAG,SAAU,CAAE8G,QAASvJ,EAAoB,OAKlE,SAAUG,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B0rB,EAAS1rB,EAAoB,KAEjCkC,EAAQA,EAAQW,EAAIX,EAAQO,EAAG,SAAU,CAAEipB,OAAQA,KAK7C,SAAUvrB,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B0rB,EAAS1rB,EAAoB,KAC7BgI,EAAShI,EAAoB,IAEjCkC,EAAQA,EAAQW,EAAIX,EAAQO,EAAG,SAAU,CACvCmgC,KAAM,SAAUrzB,EAAOoc,GACrB,OAAOD,EAAO1jB,EAAOuH,GAAQoc,OAO3B,SAAUxrB,EAAQD,EAASF,GAIjCA,EAAoB,GAApBA,CAAwBkwB,OAAQ,SAAU,SAAU7S,GAClD5Z,KAAKkkB,IAAMtK,EACX5Z,KAAK6Z,GAAK,GACT,WACD,IAAIld,EAAIqD,KAAK6Z,KACTpO,IAAS9O,EAAIqD,KAAKkkB,IACtB,MAAO,CAAEzY,KAAMA,EAAM5J,MAAO4J,EAAOrP,GAAYO,MAM3C,SAAUD,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B6iC,EAAM7iC,EAAoB,GAApBA,CAAwB,sBAAuB,QAEzDkC,EAAQA,EAAQW,EAAG,SAAU,CAAEigC,OAAQ,SAASA,OAAO5+B,GAAM,OAAO2+B,EAAI3+B,OAKlE,SAAU/D,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B6iC,EAAM7iC,EAAoB,GAApBA,CAAwB,WAAY,CAC5C+iC,IAAK,QACLC,IAAK,OACLC,IAAK,OACLC,IAAK,SACLC,IAAK,WAGPjhC,EAAQA,EAAQa,EAAIb,EAAQO,EAAG,SAAU,CAAE2gC,WAAY,SAASA,aAAe,OAAOP,EAAIp/B,UAKpF,SAAUtD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B6iC,EAAM7iC,EAAoB,GAApBA,CAAwB,6BAA8B,CAC9DqjC,QAAS,IACTC,OAAQ,IACRC,OAAQ,IACRC,SAAU,IACVC,SAAU,MAGZvhC,EAAQA,EAAQa,EAAIb,EAAQO,EAAG,SAAU,CAAEihC,aAAc,SAASA,eAAiB,OAAOb,EAAIp/B,YAMzE,oBAAVtD,QAAyBA,OAAOD,QAASC,OAAOD,QAAUP,EAE3C,mBAAV+rB,QAAwBA,OAAOiY,IAAKjY,OAAO,WAAc,OAAO/rB,IAE3EC,EAAIiC,KAAOlC,EAz7Pf,CA07PC,EAAG","file":"library.min.js"} \ No newline at end of file diff --git a/node_modules/core-js/client/shim.js b/node_modules/core-js/client/shim.js new file mode 100644 index 000000000..0fd6a20e2 --- /dev/null +++ b/node_modules/core-js/client/shim.js @@ -0,0 +1,8213 @@ +/** + * core-js 2.5.7 + * https://github.com/zloirock/core-js + * License: http://rock.mit-license.org + * © 2018 Denis Pushkarev + */ +!function(__e, __g, undefined){ +'use strict'; +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 124); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var core = __webpack_require__(26); +var hide = __webpack_require__(11); +var redefine = __webpack_require__(12); +var ctx = __webpack_require__(18); +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 target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; + var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); + var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); + var key, own, out, exp; + if (IS_GLOBAL) source = name; + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + // export native or passed + out = (own ? target : source)[key]; + // bind timers to global for call from export context + exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // extend global + if (target) redefine(target, key, out, type & $export.U); + // export + if (exports[key] != out) hide(exports, key, exp); + if (IS_PROTO && expProto[key] != out) expProto[key] = out; + } +}; +global.core = core; +// 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; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(4); +module.exports = function (it) { + if (!isObject(it)) throw TypeError(it + ' is not an object!'); + return it; +}; + + +/***/ }), +/* 2 */ +/***/ (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 + + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } +}; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +var store = __webpack_require__(49)('wks'); +var uid = __webpack_require__(33); +var Symbol = __webpack_require__(2).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; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +// Thank's IE8 for his funny defineProperty +module.exports = !__webpack_require__(3)(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(1); +var IE8_DOM_DEFINE = __webpack_require__(90); +var toPrimitive = __webpack_require__(21); +var dP = Object.defineProperty; + +exports.f = __webpack_require__(6) ? 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; +}; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.15 ToLength +var toInteger = __webpack_require__(23); +var min = Math.min; +module.exports = function (it) { + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.13 ToObject(argument) +var defined = __webpack_require__(22); +module.exports = function (it) { + return Object(defined(it)); +}; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports) { + +module.exports = function (it) { + if (typeof it != 'function') throw TypeError(it + ' is not a function!'); + return it; +}; + + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(7); +var createDesc = __webpack_require__(32); +module.exports = __webpack_require__(6) ? function (object, key, value) { + return dP.f(object, key, createDesc(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; +}; + + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var hide = __webpack_require__(11); +var has = __webpack_require__(14); +var SRC = __webpack_require__(33)('src'); +var TO_STRING = 'toString'; +var $toString = Function[TO_STRING]; +var TPL = ('' + $toString).split(TO_STRING); + +__webpack_require__(26).inspectSource = function (it) { + return $toString.call(it); +}; + +(module.exports = function (O, key, val, safe) { + var isFunction = typeof val == 'function'; + if (isFunction) has(val, 'name') || hide(val, 'name', key); + if (O[key] === val) return; + if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); + if (O === global) { + O[key] = val; + } else if (!safe) { + delete O[key]; + hide(O, key, val); + } else if (O[key]) { + O[key] = val; + } else { + hide(O, key, val); + } +// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative +})(Function.prototype, TO_STRING, function toString() { + return typeof this == 'function' && this[SRC] || $toString.call(this); +}); + + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var fails = __webpack_require__(3); +var defined = __webpack_require__(22); +var quot = /"/g; +// B.2.3.2.1 CreateHTML(string, tag, attribute, value) +var createHTML = function (string, tag, attribute, value) { + var S = String(defined(string)); + var p1 = '<' + tag; + if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; + return p1 + '>' + S + ''; +}; +module.exports = function (NAME, exec) { + var O = {}; + O[NAME] = exec(createHTML); + $export($export.P + $export.F * fails(function () { + var test = ''[NAME]('"'); + return test !== test.toLowerCase() || test.split('"').length > 3; + }), 'String', O); +}; + + +/***/ }), +/* 14 */ +/***/ (function(module, exports) { + +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function (it, key) { + return hasOwnProperty.call(it, key); +}; + + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = __webpack_require__(46); +var defined = __webpack_require__(22); +module.exports = function (it) { + return IObject(defined(it)); +}; + + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +var pIE = __webpack_require__(47); +var createDesc = __webpack_require__(32); +var toIObject = __webpack_require__(15); +var toPrimitive = __webpack_require__(21); +var has = __webpack_require__(14); +var IE8_DOM_DEFINE = __webpack_require__(90); +var gOPD = Object.getOwnPropertyDescriptor; + +exports.f = __webpack_require__(6) ? 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]); +}; + + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) +var has = __webpack_require__(14); +var toObject = __webpack_require__(9); +var IE_PROTO = __webpack_require__(66)('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; +}; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +// optional / simple context binding +var aFunction = __webpack_require__(10); +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); + }; +}; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports) { + +var toString = {}.toString; + +module.exports = function (it) { + return toString.call(it).slice(8, -1); +}; + + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var fails = __webpack_require__(3); + +module.exports = function (method, arg) { + return !!method && fails(function () { + // eslint-disable-next-line no-useless-call + arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null); + }); +}; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = __webpack_require__(4); +// 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"); +}; + + +/***/ }), +/* 22 */ +/***/ (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; +}; + + +/***/ }), +/* 23 */ +/***/ (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); +}; + + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +// most Object methods by ES6 should accept primitives +var $export = __webpack_require__(0); +var core = __webpack_require__(26); +var fails = __webpack_require__(3); +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); +}; + + +/***/ }), +/* 25 */ +/***/ (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__(18); +var IObject = __webpack_require__(46); +var toObject = __webpack_require__(9); +var toLength = __webpack_require__(8); +var asc = __webpack_require__(83); +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; + }; +}; + + +/***/ }), +/* 26 */ +/***/ (function(module, exports) { + +var core = module.exports = { version: '2.5.7' }; +if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef + + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +if (__webpack_require__(6)) { + var LIBRARY = __webpack_require__(30); + var global = __webpack_require__(2); + var fails = __webpack_require__(3); + var $export = __webpack_require__(0); + var $typed = __webpack_require__(60); + var $buffer = __webpack_require__(89); + var ctx = __webpack_require__(18); + var anInstance = __webpack_require__(39); + var propertyDesc = __webpack_require__(32); + var hide = __webpack_require__(11); + var redefineAll = __webpack_require__(41); + var toInteger = __webpack_require__(23); + var toLength = __webpack_require__(8); + var toIndex = __webpack_require__(117); + var toAbsoluteIndex = __webpack_require__(35); + var toPrimitive = __webpack_require__(21); + var has = __webpack_require__(14); + var classof = __webpack_require__(48); + var isObject = __webpack_require__(4); + var toObject = __webpack_require__(9); + var isArrayIter = __webpack_require__(80); + var create = __webpack_require__(36); + var getPrototypeOf = __webpack_require__(17); + var gOPN = __webpack_require__(37).f; + var getIterFn = __webpack_require__(82); + var uid = __webpack_require__(33); + var wks = __webpack_require__(5); + var createArrayMethod = __webpack_require__(25); + var createArrayIncludes = __webpack_require__(50); + var speciesConstructor = __webpack_require__(57); + var ArrayIterators = __webpack_require__(85); + var Iterators = __webpack_require__(44); + var $iterDetect = __webpack_require__(54); + var setSpecies = __webpack_require__(38); + var arrayFill = __webpack_require__(84); + var arrayCopyWithin = __webpack_require__(106); + var $DP = __webpack_require__(7); + var $GOPD = __webpack_require__(16); + var dP = $DP.f; + var gOPD = $GOPD.f; + var RangeError = global.RangeError; + var TypeError = global.TypeError; + var Uint8Array = global.Uint8Array; + var ARRAY_BUFFER = 'ArrayBuffer'; + var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER; + var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; + var PROTOTYPE = 'prototype'; + var ArrayProto = Array[PROTOTYPE]; + var $ArrayBuffer = $buffer.ArrayBuffer; + var $DataView = $buffer.DataView; + var arrayForEach = createArrayMethod(0); + var arrayFilter = createArrayMethod(2); + var arraySome = createArrayMethod(3); + var arrayEvery = createArrayMethod(4); + var arrayFind = createArrayMethod(5); + var arrayFindIndex = createArrayMethod(6); + var arrayIncludes = createArrayIncludes(true); + var arrayIndexOf = createArrayIncludes(false); + var arrayValues = ArrayIterators.values; + var arrayKeys = ArrayIterators.keys; + var arrayEntries = ArrayIterators.entries; + var arrayLastIndexOf = ArrayProto.lastIndexOf; + var arrayReduce = ArrayProto.reduce; + var arrayReduceRight = ArrayProto.reduceRight; + var arrayJoin = ArrayProto.join; + var arraySort = ArrayProto.sort; + var arraySlice = ArrayProto.slice; + var arrayToString = ArrayProto.toString; + var arrayToLocaleString = ArrayProto.toLocaleString; + var ITERATOR = wks('iterator'); + var TAG = wks('toStringTag'); + var TYPED_CONSTRUCTOR = uid('typed_constructor'); + var DEF_CONSTRUCTOR = uid('def_constructor'); + var ALL_CONSTRUCTORS = $typed.CONSTR; + var TYPED_ARRAY = $typed.TYPED; + var VIEW = $typed.VIEW; + var WRONG_LENGTH = 'Wrong length!'; + + var $map = createArrayMethod(1, function (O, length) { + return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); + }); + + var LITTLE_ENDIAN = fails(function () { + // eslint-disable-next-line no-undef + return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; + }); + + var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () { + new Uint8Array(1).set({}); + }); + + var toOffset = function (it, BYTES) { + var offset = toInteger(it); + if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!'); + return offset; + }; + + var validate = function (it) { + if (isObject(it) && TYPED_ARRAY in it) return it; + throw TypeError(it + ' is not a typed array!'); + }; + + var allocate = function (C, length) { + if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) { + throw TypeError('It is not a typed array constructor!'); + } return new C(length); + }; + + var speciesFromList = function (O, list) { + return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); + }; + + var fromList = function (C, list) { + var index = 0; + var length = list.length; + var result = allocate(C, length); + while (length > index) result[index] = list[index++]; + return result; + }; + + var addGetter = function (it, key, internal) { + dP(it, key, { get: function () { return this._d[internal]; } }); + }; + + var $from = function from(source /* , mapfn, thisArg */) { + var O = toObject(source); + var aLen = arguments.length; + var mapfn = aLen > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var iterFn = getIterFn(O); + var i, length, values, result, step, iterator; + if (iterFn != undefined && !isArrayIter(iterFn)) { + for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) { + values.push(step.value); + } O = values; + } + if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2); + for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) { + result[i] = mapping ? mapfn(O[i], i) : O[i]; + } + return result; + }; + + var $of = function of(/* ...items */) { + var index = 0; + var length = arguments.length; + var result = allocate(this, length); + while (length > index) result[index] = arguments[index++]; + return result; + }; + + // iOS Safari 6.x fails here + var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); }); + + var $toLocaleString = function toLocaleString() { + return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); + }; + + var proto = { + copyWithin: function copyWithin(target, start /* , end */) { + return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); + }, + every: function every(callbackfn /* , thisArg */) { + return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars + return arrayFill.apply(validate(this), arguments); + }, + filter: function filter(callbackfn /* , thisArg */) { + return speciesFromList(this, arrayFilter(validate(this), callbackfn, + arguments.length > 1 ? arguments[1] : undefined)); + }, + find: function find(predicate /* , thisArg */) { + return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + findIndex: function findIndex(predicate /* , thisArg */) { + return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + forEach: function forEach(callbackfn /* , thisArg */) { + arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + indexOf: function indexOf(searchElement /* , fromIndex */) { + return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + includes: function includes(searchElement /* , fromIndex */) { + return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + join: function join(separator) { // eslint-disable-line no-unused-vars + return arrayJoin.apply(validate(this), arguments); + }, + lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars + return arrayLastIndexOf.apply(validate(this), arguments); + }, + map: function map(mapfn /* , thisArg */) { + return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); + }, + reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars + return arrayReduce.apply(validate(this), arguments); + }, + reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars + return arrayReduceRight.apply(validate(this), arguments); + }, + reverse: function reverse() { + var that = this; + var length = validate(that).length; + var middle = Math.floor(length / 2); + var index = 0; + var value; + while (index < middle) { + value = that[index]; + that[index++] = that[--length]; + that[length] = value; + } return that; + }, + some: function some(callbackfn /* , thisArg */) { + return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + sort: function sort(comparefn) { + return arraySort.call(validate(this), comparefn); + }, + subarray: function subarray(begin, end) { + var O = validate(this); + var length = O.length; + var $begin = toAbsoluteIndex(begin, length); + return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( + O.buffer, + O.byteOffset + $begin * O.BYTES_PER_ELEMENT, + toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin) + ); + } + }; + + var $slice = function slice(start, end) { + return speciesFromList(this, arraySlice.call(validate(this), start, end)); + }; + + var $set = function set(arrayLike /* , offset */) { + validate(this); + var offset = toOffset(arguments[1], 1); + var length = this.length; + var src = toObject(arrayLike); + var len = toLength(src.length); + var index = 0; + if (len + offset > length) throw RangeError(WRONG_LENGTH); + while (index < len) this[offset + index] = src[index++]; + }; + + var $iterators = { + entries: function entries() { + return arrayEntries.call(validate(this)); + }, + keys: function keys() { + return arrayKeys.call(validate(this)); + }, + values: function values() { + return arrayValues.call(validate(this)); + } + }; + + var isTAIndex = function (target, key) { + return isObject(target) + && target[TYPED_ARRAY] + && typeof key != 'symbol' + && key in target + && String(+key) == String(key); + }; + var $getDesc = function getOwnPropertyDescriptor(target, key) { + return isTAIndex(target, key = toPrimitive(key, true)) + ? propertyDesc(2, target[key]) + : gOPD(target, key); + }; + var $setDesc = function defineProperty(target, key, desc) { + if (isTAIndex(target, key = toPrimitive(key, true)) + && isObject(desc) + && has(desc, 'value') + && !has(desc, 'get') + && !has(desc, 'set') + // TODO: add validation descriptor w/o calling accessors + && !desc.configurable + && (!has(desc, 'writable') || desc.writable) + && (!has(desc, 'enumerable') || desc.enumerable) + ) { + target[key] = desc.value; + return target; + } return dP(target, key, desc); + }; + + if (!ALL_CONSTRUCTORS) { + $GOPD.f = $getDesc; + $DP.f = $setDesc; + } + + $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { + getOwnPropertyDescriptor: $getDesc, + defineProperty: $setDesc + }); + + if (fails(function () { arrayToString.call({}); })) { + arrayToString = arrayToLocaleString = function toString() { + return arrayJoin.call(this); + }; + } + + var $TypedArrayPrototype$ = redefineAll({}, proto); + redefineAll($TypedArrayPrototype$, $iterators); + hide($TypedArrayPrototype$, ITERATOR, $iterators.values); + redefineAll($TypedArrayPrototype$, { + slice: $slice, + set: $set, + constructor: function () { /* noop */ }, + toString: arrayToString, + toLocaleString: $toLocaleString + }); + addGetter($TypedArrayPrototype$, 'buffer', 'b'); + addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); + addGetter($TypedArrayPrototype$, 'byteLength', 'l'); + addGetter($TypedArrayPrototype$, 'length', 'e'); + dP($TypedArrayPrototype$, TAG, { + get: function () { return this[TYPED_ARRAY]; } + }); + + // eslint-disable-next-line max-statements + module.exports = function (KEY, BYTES, wrapper, CLAMPED) { + CLAMPED = !!CLAMPED; + var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'; + var GETTER = 'get' + KEY; + var SETTER = 'set' + KEY; + var TypedArray = global[NAME]; + var Base = TypedArray || {}; + var TAC = TypedArray && getPrototypeOf(TypedArray); + var FORCED = !TypedArray || !$typed.ABV; + var O = {}; + var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; + var getter = function (that, index) { + var data = that._d; + return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); + }; + var setter = function (that, index, value) { + var data = that._d; + if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; + data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); + }; + var addElement = function (that, index) { + dP(that, index, { + get: function () { + return getter(this, index); + }, + set: function (value) { + return setter(this, index, value); + }, + enumerable: true + }); + }; + if (FORCED) { + TypedArray = wrapper(function (that, data, $offset, $length) { + anInstance(that, TypedArray, NAME, '_d'); + var index = 0; + var offset = 0; + var buffer, byteLength, length, klass; + if (!isObject(data)) { + length = toIndex(data); + byteLength = length * BYTES; + buffer = new $ArrayBuffer(byteLength); + } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { + buffer = data; + offset = toOffset($offset, BYTES); + var $len = data.byteLength; + if ($length === undefined) { + if ($len % BYTES) throw RangeError(WRONG_LENGTH); + byteLength = $len - offset; + if (byteLength < 0) throw RangeError(WRONG_LENGTH); + } else { + byteLength = toLength($length) * BYTES; + if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH); + } + length = byteLength / BYTES; + } else if (TYPED_ARRAY in data) { + return fromList(TypedArray, data); + } else { + return $from.call(TypedArray, data); + } + hide(that, '_d', { + b: buffer, + o: offset, + l: byteLength, + e: length, + v: new $DataView(buffer) + }); + while (index < length) addElement(that, index++); + }); + TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); + hide(TypedArrayPrototype, 'constructor', TypedArray); + } else if (!fails(function () { + TypedArray(1); + }) || !fails(function () { + new TypedArray(-1); // eslint-disable-line no-new + }) || !$iterDetect(function (iter) { + new TypedArray(); // eslint-disable-line no-new + new TypedArray(null); // eslint-disable-line no-new + new TypedArray(1.5); // eslint-disable-line no-new + new TypedArray(iter); // eslint-disable-line no-new + }, true)) { + TypedArray = wrapper(function (that, data, $offset, $length) { + anInstance(that, TypedArray, NAME); + var klass; + // `ws` module bug, temporarily remove validation length for Uint8Array + // https://github.com/websockets/ws/pull/645 + if (!isObject(data)) return new Base(toIndex(data)); + if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { + return $length !== undefined + ? new Base(data, toOffset($offset, BYTES), $length) + : $offset !== undefined + ? new Base(data, toOffset($offset, BYTES)) + : new Base(data); + } + if (TYPED_ARRAY in data) return fromList(TypedArray, data); + return $from.call(TypedArray, data); + }); + arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) { + if (!(key in TypedArray)) hide(TypedArray, key, Base[key]); + }); + TypedArray[PROTOTYPE] = TypedArrayPrototype; + if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray; + } + var $nativeIterator = TypedArrayPrototype[ITERATOR]; + var CORRECT_ITER_NAME = !!$nativeIterator + && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined); + var $iterator = $iterators.values; + hide(TypedArray, TYPED_CONSTRUCTOR, true); + hide(TypedArrayPrototype, TYPED_ARRAY, NAME); + hide(TypedArrayPrototype, VIEW, true); + hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); + + if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) { + dP(TypedArrayPrototype, TAG, { + get: function () { return NAME; } + }); + } + + O[NAME] = TypedArray; + + $export($export.G + $export.W + $export.F * (TypedArray != Base), O); + + $export($export.S, NAME, { + BYTES_PER_ELEMENT: BYTES + }); + + $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, { + from: $from, + of: $of + }); + + if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); + + $export($export.P, NAME, proto); + + setSpecies(NAME); + + $export($export.P + $export.F * FORCED_SET, NAME, { set: $set }); + + $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); + + if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString; + + $export($export.P + $export.F * fails(function () { + new TypedArray(1).slice(); + }), NAME, { slice: $slice }); + + $export($export.P + $export.F * (fails(function () { + return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString(); + }) || !fails(function () { + TypedArrayPrototype.toLocaleString.call([1, 2]); + })), NAME, { toLocaleString: $toLocaleString }); + + Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; + if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator); + }; +} else module.exports = function () { /* empty */ }; + + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +var Map = __webpack_require__(111); +var $export = __webpack_require__(0); +var shared = __webpack_require__(49)('metadata'); +var store = shared.store || (shared.store = new (__webpack_require__(114))()); + +var getOrCreateMetadataMap = function (target, targetKey, create) { + var targetMetadata = store.get(target); + if (!targetMetadata) { + if (!create) return undefined; + store.set(target, targetMetadata = new Map()); + } + var keyMetadata = targetMetadata.get(targetKey); + if (!keyMetadata) { + if (!create) return undefined; + targetMetadata.set(targetKey, keyMetadata = new Map()); + } return keyMetadata; +}; +var ordinaryHasOwnMetadata = function (MetadataKey, O, P) { + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? false : metadataMap.has(MetadataKey); +}; +var ordinaryGetOwnMetadata = function (MetadataKey, O, P) { + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); +}; +var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) { + getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); +}; +var ordinaryOwnMetadataKeys = function (target, targetKey) { + var metadataMap = getOrCreateMetadataMap(target, targetKey, false); + var keys = []; + if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); }); + return keys; +}; +var toMetaKey = function (it) { + return it === undefined || typeof it == 'symbol' ? it : String(it); +}; +var exp = function (O) { + $export($export.S, 'Reflect', O); +}; + +module.exports = { + store: store, + map: getOrCreateMetadataMap, + has: ordinaryHasOwnMetadata, + get: ordinaryGetOwnMetadata, + set: ordinaryDefineOwnMetadata, + keys: ordinaryOwnMetadataKeys, + key: toMetaKey, + exp: exp +}; + + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +var META = __webpack_require__(33)('meta'); +var isObject = __webpack_require__(4); +var has = __webpack_require__(14); +var setDesc = __webpack_require__(7).f; +var id = 0; +var isExtensible = Object.isExtensible || function () { + return true; +}; +var FREEZE = !__webpack_require__(3)(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 +}; + + +/***/ }), +/* 30 */ +/***/ (function(module, exports) { + +module.exports = false; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +// 22.1.3.31 Array.prototype[@@unscopables] +var UNSCOPABLES = __webpack_require__(5)('unscopables'); +var ArrayProto = Array.prototype; +if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(11)(ArrayProto, UNSCOPABLES, {}); +module.exports = function (key) { + ArrayProto[UNSCOPABLES][key] = true; +}; + + +/***/ }), +/* 32 */ +/***/ (function(module, exports) { + +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; + + +/***/ }), +/* 33 */ +/***/ (function(module, exports) { + +var id = 0; +var px = Math.random(); +module.exports = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; + + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = __webpack_require__(92); +var enumBugKeys = __webpack_require__(67); + +module.exports = Object.keys || function keys(O) { + return $keys(O, enumBugKeys); +}; + + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__(23); +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); +}; + + +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +var anObject = __webpack_require__(1); +var dPs = __webpack_require__(93); +var enumBugKeys = __webpack_require__(67); +var IE_PROTO = __webpack_require__(66)('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__(64)('iframe'); + var i = enumBugKeys.length; + var lt = '<'; + var gt = '>'; + var iframeDocument; + iframe.style.display = 'none'; + __webpack_require__(68).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); +}; + + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) +var $keys = __webpack_require__(92); +var hiddenKeys = __webpack_require__(67).concat('length', 'prototype'); + +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return $keys(O, hiddenKeys); +}; + + +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(2); +var dP = __webpack_require__(7); +var DESCRIPTORS = __webpack_require__(6); +var SPECIES = __webpack_require__(5)('species'); + +module.exports = function (KEY) { + var C = global[KEY]; + if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { + configurable: true, + get: function () { return this; } + }); +}; + + +/***/ }), +/* 39 */ +/***/ (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; +}; + + +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { + +var ctx = __webpack_require__(18); +var call = __webpack_require__(104); +var isArrayIter = __webpack_require__(80); +var anObject = __webpack_require__(1); +var toLength = __webpack_require__(8); +var getIterFn = __webpack_require__(82); +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; + + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +var redefine = __webpack_require__(12); +module.exports = function (target, src, safe) { + for (var key in src) redefine(target, key, src[key], safe); + return target; +}; + + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +var def = __webpack_require__(7).f; +var has = __webpack_require__(14); +var TAG = __webpack_require__(5)('toStringTag'); + +module.exports = function (it, tag, stat) { + if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); +}; + + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var defined = __webpack_require__(22); +var fails = __webpack_require__(3); +var spaces = __webpack_require__(71); +var space = '[' + spaces + ']'; +var non = '\u200b\u0085'; +var ltrim = RegExp('^' + space + space + '*'); +var rtrim = RegExp(space + space + '*$'); + +var exporter = function (KEY, exec, ALIAS) { + var exp = {}; + var FORCE = fails(function () { + return !!spaces[KEY]() || non[KEY]() != non; + }); + var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; + if (ALIAS) exp[ALIAS] = fn; + $export($export.P + $export.F * FORCE, 'String', exp); +}; + +// 1 -> String#trimLeft +// 2 -> String#trimRight +// 3 -> String#trim +var trim = exporter.trim = function (string, TYPE) { + string = String(defined(string)); + if (TYPE & 1) string = string.replace(ltrim, ''); + if (TYPE & 2) string = string.replace(rtrim, ''); + return string; +}; + +module.exports = exporter; + + +/***/ }), +/* 44 */ +/***/ (function(module, exports) { + +module.exports = {}; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(4); +module.exports = function (it, TYPE) { + if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); + return it; +}; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = __webpack_require__(19); +// eslint-disable-next-line no-prototype-builtins +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { + return cof(it) == 'String' ? it.split('') : Object(it); +}; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports) { + +exports.f = {}.propertyIsEnumerable; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { + +// getting tag from 19.1.3.6 Object.prototype.toString() +var cof = __webpack_require__(19); +var TAG = __webpack_require__(5)('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; +}; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +var core = __webpack_require__(26); +var global = __webpack_require__(2); +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__(30) ? 'pure' : 'global', + copyright: '© 2018 Denis Pushkarev (zloirock.ru)' +}); + + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + +// false -> Array#indexOf +// true -> Array#includes +var toIObject = __webpack_require__(15); +var toLength = __webpack_require__(8); +var toAbsoluteIndex = __webpack_require__(35); +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; + }; +}; + + +/***/ }), +/* 51 */ +/***/ (function(module, exports) { + +exports.f = Object.getOwnPropertySymbols; + + +/***/ }), +/* 52 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.2.2 IsArray(argument) +var cof = __webpack_require__(19); +module.exports = Array.isArray || function isArray(arg) { + return cof(arg) == 'Array'; +}; + + +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.2.8 IsRegExp(argument) +var isObject = __webpack_require__(4); +var cof = __webpack_require__(19); +var MATCH = __webpack_require__(5)('match'); +module.exports = function (it) { + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); +}; + + +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { + +var ITERATOR = __webpack_require__(5)('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; +}; + + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 21.2.5.3 get RegExp.prototype.flags +var anObject = __webpack_require__(1); +module.exports = function () { + var that = anObject(this); + var result = ''; + if (that.global) result += 'g'; + if (that.ignoreCase) result += 'i'; + if (that.multiline) result += 'm'; + if (that.unicode) result += 'u'; + if (that.sticky) result += 'y'; + return result; +}; + + +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var hide = __webpack_require__(11); +var redefine = __webpack_require__(12); +var fails = __webpack_require__(3); +var defined = __webpack_require__(22); +var wks = __webpack_require__(5); + +module.exports = function (KEY, length, exec) { + var SYMBOL = wks(KEY); + var fns = exec(defined, SYMBOL, ''[KEY]); + var strfn = fns[0]; + var rxfn = fns[1]; + if (fails(function () { + var O = {}; + O[SYMBOL] = function () { return 7; }; + return ''[KEY](O) != 7; + })) { + redefine(String.prototype, KEY, strfn); + hide(RegExp.prototype, SYMBOL, length == 2 + // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) + // 21.2.5.11 RegExp.prototype[@@split](string, limit) + ? function (string, arg) { return rxfn.call(string, this, arg); } + // 21.2.5.6 RegExp.prototype[@@match](string) + // 21.2.5.9 RegExp.prototype[@@search](string) + : function (string) { return rxfn.call(string, this); } + ); + } +}; + + +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.3.20 SpeciesConstructor(O, defaultConstructor) +var anObject = __webpack_require__(1); +var aFunction = __webpack_require__(10); +var SPECIES = __webpack_require__(5)('species'); +module.exports = function (O, D) { + var C = anObject(O).constructor; + var S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); +}; + + +/***/ }), +/* 58 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var navigator = global.navigator; + +module.exports = navigator && navigator.userAgent || ''; + + +/***/ }), +/* 59 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(2); +var $export = __webpack_require__(0); +var redefine = __webpack_require__(12); +var redefineAll = __webpack_require__(41); +var meta = __webpack_require__(29); +var forOf = __webpack_require__(40); +var anInstance = __webpack_require__(39); +var isObject = __webpack_require__(4); +var fails = __webpack_require__(3); +var $iterDetect = __webpack_require__(54); +var setToStringTag = __webpack_require__(42); +var inheritIfRequired = __webpack_require__(70); + +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 = {}; + var fixMethod = function (KEY) { + var fn = proto[KEY]; + redefine(proto, KEY, + KEY == 'delete' ? function (a) { + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'has' ? function has(a) { + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'get' ? function get(a) { + return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; } + : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; } + ); + }; + if (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 { + var instance = new C(); + // early implementations not supports chaining + var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; + // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false + var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); + // most early implementations doesn't supports iterables, most modern - not close it correctly + var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new + // for early implementations -0 and +0 not the same + var BUGGY_ZERO = !IS_WEAK && fails(function () { + // V8 ~ Chromium 42- fails only with 5+ elements + var $instance = new C(); + var index = 5; + while (index--) $instance[ADDER](index, index); + return !$instance.has(-0); + }); + if (!ACCEPT_ITERABLES) { + C = wrapper(function (target, iterable) { + anInstance(target, C, NAME); + var that = inheritIfRequired(new Base(), target, C); + if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); + return that; + }); + C.prototype = proto; + proto.constructor = C; + } + if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { + fixMethod('delete'); + fixMethod('has'); + IS_MAP && fixMethod('get'); + } + if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); + // weak collections should not contains .clear method + if (IS_WEAK && proto.clear) delete proto.clear; + } + + setToStringTag(C, NAME); + + O[NAME] = C; + $export($export.G + $export.W + $export.F * (C != Base), O); + + if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); + + return C; +}; + + +/***/ }), +/* 60 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var hide = __webpack_require__(11); +var uid = __webpack_require__(33); +var TYPED = uid('typed_array'); +var VIEW = uid('view'); +var ABV = !!(global.ArrayBuffer && global.DataView); +var CONSTR = ABV; +var i = 0; +var l = 9; +var Typed; + +var TypedArrayConstructors = ( + 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' +).split(','); + +while (i < l) { + if (Typed = global[TypedArrayConstructors[i++]]) { + hide(Typed.prototype, TYPED, true); + hide(Typed.prototype, VIEW, true); + } else CONSTR = false; +} + +module.exports = { + ABV: ABV, + CONSTR: CONSTR, + TYPED: TYPED, + VIEW: VIEW +}; + + +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// Forced replacement prototype accessors methods +module.exports = __webpack_require__(30) || !__webpack_require__(3)(function () { + var K = Math.random(); + // In FF throws only define methods + // eslint-disable-next-line no-undef, no-useless-call + __defineSetter__.call(null, K, function () { /* empty */ }); + delete __webpack_require__(2)[K]; +}); + + +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-setmap-offrom/ +var $export = __webpack_require__(0); + +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); + } }); +}; + + +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-setmap-offrom/ +var $export = __webpack_require__(0); +var aFunction = __webpack_require__(10); +var ctx = __webpack_require__(18); +var forOf = __webpack_require__(40); + +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); + } }); +}; + + +/***/ }), +/* 64 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(4); +var document = __webpack_require__(2).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) : {}; +}; + + +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var core = __webpack_require__(26); +var LIBRARY = __webpack_require__(30); +var wksExt = __webpack_require__(91); +var defineProperty = __webpack_require__(7).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) }); +}; + + +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { + +var shared = __webpack_require__(49)('keys'); +var uid = __webpack_require__(33); +module.exports = function (key) { + return shared[key] || (shared[key] = uid(key)); +}; + + +/***/ }), +/* 67 */ +/***/ (function(module, exports) { + +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); + + +/***/ }), +/* 68 */ +/***/ (function(module, exports, __webpack_require__) { + +var document = __webpack_require__(2).document; +module.exports = document && document.documentElement; + + +/***/ }), +/* 69 */ +/***/ (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__(4); +var anObject = __webpack_require__(1); +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__(18)(Function.call, __webpack_require__(16).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 +}; + + +/***/ }), +/* 70 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(4); +var setPrototypeOf = __webpack_require__(69).set; +module.exports = function (that, target, C) { + var S = target.constructor; + var P; + if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { + setPrototypeOf(that, P); + } return that; +}; + + +/***/ }), +/* 71 */ +/***/ (function(module, exports) { + +module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; + + +/***/ }), +/* 72 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var toInteger = __webpack_require__(23); +var defined = __webpack_require__(22); + +module.exports = function repeat(count) { + var str = String(defined(this)); + var res = ''; + var n = toInteger(count); + if (n < 0 || n == Infinity) throw RangeError("Count can't be negative"); + for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str; + return res; +}; + + +/***/ }), +/* 73 */ +/***/ (function(module, exports) { + +// 20.2.2.28 Math.sign(x) +module.exports = Math.sign || function sign(x) { + // eslint-disable-next-line no-self-compare + return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; +}; + + +/***/ }), +/* 74 */ +/***/ (function(module, exports) { + +// 20.2.2.14 Math.expm1(x) +var $expm1 = Math.expm1; +module.exports = (!$expm1 + // Old FF bug + || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 + // Tor Browser bug + || $expm1(-2e-17) != -2e-17 +) ? function expm1(x) { + return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; +} : $expm1; + + +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__(23); +var defined = __webpack_require__(22); +// 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; + }; +}; + + +/***/ }), +/* 76 */ +/***/ (function(module, exports, __webpack_require__) { + +// helper for String#{startsWith, endsWith, includes} +var isRegExp = __webpack_require__(53); +var defined = __webpack_require__(22); + +module.exports = function (that, searchString, NAME) { + if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); + return String(defined(that)); +}; + + +/***/ }), +/* 77 */ +/***/ (function(module, exports, __webpack_require__) { + +var MATCH = __webpack_require__(5)('match'); +module.exports = function (KEY) { + var re = /./; + try { + '/./'[KEY](re); + } catch (e) { + try { + re[MATCH] = false; + return !'/./'[KEY](re); + } catch (f) { /* empty */ } + } return true; +}; + + +/***/ }), +/* 78 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var LIBRARY = __webpack_require__(30); +var $export = __webpack_require__(0); +var redefine = __webpack_require__(12); +var hide = __webpack_require__(11); +var Iterators = __webpack_require__(44); +var $iterCreate = __webpack_require__(79); +var setToStringTag = __webpack_require__(42); +var getPrototypeOf = __webpack_require__(17); +var ITERATOR = __webpack_require__(5)('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; +}; + + +/***/ }), +/* 79 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var create = __webpack_require__(36); +var descriptor = __webpack_require__(32); +var setToStringTag = __webpack_require__(42); +var IteratorPrototype = {}; + +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +__webpack_require__(11)(IteratorPrototype, __webpack_require__(5)('iterator'), function () { return this; }); + +module.exports = function (Constructor, NAME, next) { + Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); + setToStringTag(Constructor, NAME + ' Iterator'); +}; + + +/***/ }), +/* 80 */ +/***/ (function(module, exports, __webpack_require__) { + +// check on default Array iterator +var Iterators = __webpack_require__(44); +var ITERATOR = __webpack_require__(5)('iterator'); +var ArrayProto = Array.prototype; + +module.exports = function (it) { + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); +}; + + +/***/ }), +/* 81 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $defineProperty = __webpack_require__(7); +var createDesc = __webpack_require__(32); + +module.exports = function (object, index, value) { + if (index in object) $defineProperty.f(object, index, createDesc(0, value)); + else object[index] = value; +}; + + +/***/ }), +/* 82 */ +/***/ (function(module, exports, __webpack_require__) { + +var classof = __webpack_require__(48); +var ITERATOR = __webpack_require__(5)('iterator'); +var Iterators = __webpack_require__(44); +module.exports = __webpack_require__(26).getIteratorMethod = function (it) { + if (it != undefined) return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; +}; + + +/***/ }), +/* 83 */ +/***/ (function(module, exports, __webpack_require__) { + +// 9.4.2.3 ArraySpeciesCreate(originalArray, length) +var speciesConstructor = __webpack_require__(208); + +module.exports = function (original, length) { + return new (speciesConstructor(original))(length); +}; + + +/***/ }), +/* 84 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) + +var toObject = __webpack_require__(9); +var toAbsoluteIndex = __webpack_require__(35); +var toLength = __webpack_require__(8); +module.exports = function fill(value /* , start = 0, end = @length */) { + var O = toObject(this); + var length = toLength(O.length); + var aLen = arguments.length; + var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); + var end = aLen > 2 ? arguments[2] : undefined; + var endPos = end === undefined ? length : toAbsoluteIndex(end, length); + while (endPos > index) O[index++] = value; + return O; +}; + + +/***/ }), +/* 85 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var addToUnscopables = __webpack_require__(31); +var step = __webpack_require__(107); +var Iterators = __webpack_require__(44); +var toIObject = __webpack_require__(15); + +// 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__(78)(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'); + + +/***/ }), +/* 86 */ +/***/ (function(module, exports, __webpack_require__) { + +var ctx = __webpack_require__(18); +var invoke = __webpack_require__(97); +var html = __webpack_require__(68); +var cel = __webpack_require__(64); +var global = __webpack_require__(2); +var process = global.process; +var setTask = global.setImmediate; +var clearTask = global.clearImmediate; +var MessageChannel = global.MessageChannel; +var Dispatch = global.Dispatch; +var counter = 0; +var queue = {}; +var ONREADYSTATECHANGE = 'onreadystatechange'; +var defer, channel, port; +var run = function () { + var id = +this; + // eslint-disable-next-line no-prototype-builtins + if (queue.hasOwnProperty(id)) { + var fn = queue[id]; + delete queue[id]; + fn(); + } +}; +var listener = function (event) { + run.call(event.data); +}; +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: +if (!setTask || !clearTask) { + setTask = function setImmediate(fn) { + var args = []; + var i = 1; + while (arguments.length > i) args.push(arguments[i++]); + queue[++counter] = function () { + // eslint-disable-next-line no-new-func + invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id) { + delete queue[id]; + }; + // Node.js 0.8- + if (__webpack_require__(19)(process) == 'process') { + defer = function (id) { + process.nextTick(ctx(run, id, 1)); + }; + // Sphere (JS game engine) Dispatch API + } else if (Dispatch && Dispatch.now) { + defer = function (id) { + Dispatch.now(ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if (MessageChannel) { + channel = new MessageChannel(); + port = channel.port2; + channel.port1.onmessage = listener; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { + defer = function (id) { + global.postMessage(id + '', '*'); + }; + global.addEventListener('message', listener, false); + // IE8- + } else if (ONREADYSTATECHANGE in cel('script')) { + defer = function (id) { + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { + html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function (id) { + setTimeout(ctx(run, id, 1), 0); + }; + } +} +module.exports = { + set: setTask, + clear: clearTask +}; + + +/***/ }), +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var macrotask = __webpack_require__(86).set; +var Observer = global.MutationObserver || global.WebKitMutationObserver; +var process = global.process; +var Promise = global.Promise; +var isNode = __webpack_require__(19)(process) == 'process'; + +module.exports = function () { + var head, last, notify; + + var flush = function () { + var parent, fn; + if (isNode && (parent = process.domain)) parent.exit(); + while (head) { + fn = head.fn; + head = head.next; + try { + fn(); + } catch (e) { + if (head) notify(); + else last = undefined; + throw e; + } + } last = undefined; + if (parent) parent.enter(); + }; + + // Node.js + if (isNode) { + notify = function () { + process.nextTick(flush); + }; + // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 + } else if (Observer && !(global.navigator && global.navigator.standalone)) { + var toggle = true; + var node = document.createTextNode(''); + new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new + notify = function () { + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if (Promise && Promise.resolve) { + // Promise.resolve without an argument throws an error in LG WebOS 2 + var promise = Promise.resolve(undefined); + notify = function () { + promise.then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function () { + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } + + return function (fn) { + var task = { fn: fn, next: undefined }; + if (last) last.next = task; + if (!head) { + head = task; + notify(); + } last = task; + }; +}; + + +/***/ }), +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 25.4.1.5 NewPromiseCapability(C) +var aFunction = __webpack_require__(10); + +function PromiseCapability(C) { + var resolve, reject; + this.promise = new C(function ($$resolve, $$reject) { + if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); +} + +module.exports.f = function (C) { + return new PromiseCapability(C); +}; + + +/***/ }), +/* 89 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(2); +var DESCRIPTORS = __webpack_require__(6); +var LIBRARY = __webpack_require__(30); +var $typed = __webpack_require__(60); +var hide = __webpack_require__(11); +var redefineAll = __webpack_require__(41); +var fails = __webpack_require__(3); +var anInstance = __webpack_require__(39); +var toInteger = __webpack_require__(23); +var toLength = __webpack_require__(8); +var toIndex = __webpack_require__(117); +var gOPN = __webpack_require__(37).f; +var dP = __webpack_require__(7).f; +var arrayFill = __webpack_require__(84); +var setToStringTag = __webpack_require__(42); +var ARRAY_BUFFER = 'ArrayBuffer'; +var DATA_VIEW = 'DataView'; +var PROTOTYPE = 'prototype'; +var WRONG_LENGTH = 'Wrong length!'; +var WRONG_INDEX = 'Wrong index!'; +var $ArrayBuffer = global[ARRAY_BUFFER]; +var $DataView = global[DATA_VIEW]; +var Math = global.Math; +var RangeError = global.RangeError; +// eslint-disable-next-line no-shadow-restricted-names +var Infinity = global.Infinity; +var BaseBuffer = $ArrayBuffer; +var abs = Math.abs; +var pow = Math.pow; +var floor = Math.floor; +var log = Math.log; +var LN2 = Math.LN2; +var BUFFER = 'buffer'; +var BYTE_LENGTH = 'byteLength'; +var BYTE_OFFSET = 'byteOffset'; +var $BUFFER = DESCRIPTORS ? '_b' : BUFFER; +var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH; +var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; + +// IEEE754 conversions based on https://github.com/feross/ieee754 +function packIEEE754(value, mLen, nBytes) { + var buffer = new Array(nBytes); + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0; + var i = 0; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + var e, m, c; + value = abs(value); + // eslint-disable-next-line no-self-compare + if (value != value || value === Infinity) { + // eslint-disable-next-line no-self-compare + m = value != value ? 1 : 0; + e = eMax; + } else { + e = floor(log(value) / LN2); + if (value * (c = pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * pow(2, mLen); + e = e + eBias; + } else { + m = value * pow(2, eBias - 1) * pow(2, mLen); + e = 0; + } + } + for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); + e = e << mLen | m; + eLen += mLen; + for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); + buffer[--i] |= s * 128; + return buffer; +} +function unpackIEEE754(buffer, mLen, nBytes) { + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = eLen - 7; + var i = nBytes - 1; + var s = buffer[i--]; + var e = s & 127; + var m; + s >>= 7; + for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : s ? -Infinity : Infinity; + } else { + m = m + pow(2, mLen); + e = e - eBias; + } return (s ? -1 : 1) * m * pow(2, e - mLen); +} + +function unpackI32(bytes) { + return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; +} +function packI8(it) { + return [it & 0xff]; +} +function packI16(it) { + return [it & 0xff, it >> 8 & 0xff]; +} +function packI32(it) { + return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; +} +function packF64(it) { + return packIEEE754(it, 52, 8); +} +function packF32(it) { + return packIEEE754(it, 23, 4); +} + +function addGetter(C, key, internal) { + dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } }); +} + +function get(view, bytes, index, isLittleEndian) { + var numIndex = +index; + var intIndex = toIndex(numIndex); + if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b; + var start = intIndex + view[$OFFSET]; + var pack = store.slice(start, start + bytes); + return isLittleEndian ? pack : pack.reverse(); +} +function set(view, bytes, index, conversion, value, isLittleEndian) { + var numIndex = +index; + var intIndex = toIndex(numIndex); + if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b; + var start = intIndex + view[$OFFSET]; + var pack = conversion(+value); + for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; +} + +if (!$typed.ABV) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer, ARRAY_BUFFER); + var byteLength = toIndex(length); + this._b = arrayFill.call(new Array(byteLength), 0); + this[$LENGTH] = byteLength; + }; + + $DataView = function DataView(buffer, byteOffset, byteLength) { + anInstance(this, $DataView, DATA_VIEW); + anInstance(buffer, $ArrayBuffer, DATA_VIEW); + var bufferLength = buffer[$LENGTH]; + var offset = toInteger(byteOffset); + if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!'); + byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); + if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); + this[$BUFFER] = buffer; + this[$OFFSET] = offset; + this[$LENGTH] = byteLength; + }; + + if (DESCRIPTORS) { + addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); + addGetter($DataView, BUFFER, '_b'); + addGetter($DataView, BYTE_LENGTH, '_l'); + addGetter($DataView, BYTE_OFFSET, '_o'); + } + + redefineAll($DataView[PROTOTYPE], { + getInt8: function getInt8(byteOffset) { + return get(this, 1, byteOffset)[0] << 24 >> 24; + }, + getUint8: function getUint8(byteOffset) { + return get(this, 1, byteOffset)[0]; + }, + getInt16: function getInt16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments[1]); + return (bytes[1] << 8 | bytes[0]) << 16 >> 16; + }, + getUint16: function getUint16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments[1]); + return bytes[1] << 8 | bytes[0]; + }, + getInt32: function getInt32(byteOffset /* , littleEndian */) { + return unpackI32(get(this, 4, byteOffset, arguments[1])); + }, + getUint32: function getUint32(byteOffset /* , littleEndian */) { + return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; + }, + getFloat32: function getFloat32(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); + }, + getFloat64: function getFloat64(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); + }, + setInt8: function setInt8(byteOffset, value) { + set(this, 1, byteOffset, packI8, value); + }, + setUint8: function setUint8(byteOffset, value) { + set(this, 1, byteOffset, packI8, value); + }, + setInt16: function setInt16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setUint16: function setUint16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setInt32: function setInt32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setUint32: function setUint32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packF32, value, arguments[2]); + }, + setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { + set(this, 8, byteOffset, packF64, value, arguments[2]); + } + }); +} else { + if (!fails(function () { + $ArrayBuffer(1); + }) || !fails(function () { + new $ArrayBuffer(-1); // eslint-disable-line no-new + }) || fails(function () { + new $ArrayBuffer(); // eslint-disable-line no-new + new $ArrayBuffer(1.5); // eslint-disable-line no-new + new $ArrayBuffer(NaN); // eslint-disable-line no-new + return $ArrayBuffer.name != ARRAY_BUFFER; + })) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer); + return new BaseBuffer(toIndex(length)); + }; + var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; + for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) { + if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]); + } + if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer; + } + // iOS Safari 7.x bug + var view = new $DataView(new $ArrayBuffer(2)); + var $setInt8 = $DataView[PROTOTYPE].setInt8; + view.setInt8(0, 2147483648); + view.setInt8(1, 2147483649); + if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], { + setInt8: function setInt8(byteOffset, value) { + $setInt8.call(this, byteOffset, value << 24 >> 24); + }, + setUint8: function setUint8(byteOffset, value) { + $setInt8.call(this, byteOffset, value << 24 >> 24); + } + }, true); +} +setToStringTag($ArrayBuffer, ARRAY_BUFFER); +setToStringTag($DataView, DATA_VIEW); +hide($DataView[PROTOTYPE], $typed.VIEW, true); +exports[ARRAY_BUFFER] = $ArrayBuffer; +exports[DATA_VIEW] = $DataView; + + +/***/ }), +/* 90 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = !__webpack_require__(6) && !__webpack_require__(3)(function () { + return Object.defineProperty(__webpack_require__(64)('div'), 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), +/* 91 */ +/***/ (function(module, exports, __webpack_require__) { + +exports.f = __webpack_require__(5); + + +/***/ }), +/* 92 */ +/***/ (function(module, exports, __webpack_require__) { + +var has = __webpack_require__(14); +var toIObject = __webpack_require__(15); +var arrayIndexOf = __webpack_require__(50)(false); +var IE_PROTO = __webpack_require__(66)('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; +}; + + +/***/ }), +/* 93 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(7); +var anObject = __webpack_require__(1); +var getKeys = __webpack_require__(34); + +module.exports = __webpack_require__(6) ? 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; +}; + + +/***/ }), +/* 94 */ +/***/ (function(module, exports, __webpack_require__) { + +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +var toIObject = __webpack_require__(15); +var gOPN = __webpack_require__(37).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)); +}; + + +/***/ }), +/* 95 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 19.1.2.1 Object.assign(target, source, ...) +var getKeys = __webpack_require__(34); +var gOPS = __webpack_require__(51); +var pIE = __webpack_require__(47); +var toObject = __webpack_require__(9); +var IObject = __webpack_require__(46); +var $assign = Object.assign; + +// should work with symbols and should have deterministic property order (V8 bug) +module.exports = !$assign || __webpack_require__(3)(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) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; + } return T; +} : $assign; + + +/***/ }), +/* 96 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var aFunction = __webpack_require__(10); +var isObject = __webpack_require__(4); +var invoke = __webpack_require__(97); +var arraySlice = [].slice; +var factories = {}; + +var construct = function (F, len, args) { + if (!(len in factories)) { + for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']'; + // eslint-disable-next-line no-new-func + factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); + } return factories[len](F, args); +}; + +module.exports = Function.bind || function bind(that /* , ...args */) { + var fn = aFunction(this); + var partArgs = arraySlice.call(arguments, 1); + var bound = function (/* args... */) { + var args = partArgs.concat(arraySlice.call(arguments)); + return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); + }; + if (isObject(fn.prototype)) bound.prototype = fn.prototype; + return bound; +}; + + +/***/ }), +/* 97 */ +/***/ (function(module, exports) { + +// fast apply, http://jsperf.lnkit.com/fast-apply/5 +module.exports = function (fn, args, that) { + var un = that === undefined; + switch (args.length) { + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); +}; + + +/***/ }), +/* 98 */ +/***/ (function(module, exports, __webpack_require__) { + +var cof = __webpack_require__(19); +module.exports = function (it, msg) { + if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg); + return +it; +}; + + +/***/ }), +/* 99 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.3 Number.isInteger(number) +var isObject = __webpack_require__(4); +var floor = Math.floor; +module.exports = function isInteger(it) { + return !isObject(it) && isFinite(it) && floor(it) === it; +}; + + +/***/ }), +/* 100 */ +/***/ (function(module, exports, __webpack_require__) { + +var $parseFloat = __webpack_require__(2).parseFloat; +var $trim = __webpack_require__(43).trim; + +module.exports = 1 / $parseFloat(__webpack_require__(71) + '-0') !== -Infinity ? function parseFloat(str) { + var string = $trim(String(str), 3); + var result = $parseFloat(string); + return result === 0 && string.charAt(0) == '-' ? -0 : result; +} : $parseFloat; + + +/***/ }), +/* 101 */ +/***/ (function(module, exports, __webpack_require__) { + +var $parseInt = __webpack_require__(2).parseInt; +var $trim = __webpack_require__(43).trim; +var ws = __webpack_require__(71); +var hex = /^[-+]?0[xX]/; + +module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) { + var string = $trim(String(str), 3); + return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); +} : $parseInt; + + +/***/ }), +/* 102 */ +/***/ (function(module, exports) { + +// 20.2.2.20 Math.log1p(x) +module.exports = Math.log1p || function log1p(x) { + return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); +}; + + +/***/ }), +/* 103 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.16 Math.fround(x) +var sign = __webpack_require__(73); +var pow = Math.pow; +var EPSILON = pow(2, -52); +var EPSILON32 = pow(2, -23); +var MAX32 = pow(2, 127) * (2 - EPSILON32); +var MIN32 = pow(2, -126); + +var roundTiesToEven = function (n) { + return n + 1 / EPSILON - 1 / EPSILON; +}; + +module.exports = Math.fround || function fround(x) { + var $abs = Math.abs(x); + var $sign = sign(x); + var a, result; + if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; + a = (1 + EPSILON32 / EPSILON) * $abs; + result = a - (a - $abs); + // eslint-disable-next-line no-self-compare + if (result > MAX32 || result != result) return $sign * Infinity; + return $sign * result; +}; + + +/***/ }), +/* 104 */ +/***/ (function(module, exports, __webpack_require__) { + +// call something on iterator step with safe closing on error +var anObject = __webpack_require__(1); +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; + } +}; + + +/***/ }), +/* 105 */ +/***/ (function(module, exports, __webpack_require__) { + +var aFunction = __webpack_require__(10); +var toObject = __webpack_require__(9); +var IObject = __webpack_require__(46); +var toLength = __webpack_require__(8); + +module.exports = function (that, callbackfn, aLen, memo, isRight) { + aFunction(callbackfn); + var O = toObject(that); + var self = IObject(O); + var length = toLength(O.length); + var index = isRight ? length - 1 : 0; + var i = isRight ? -1 : 1; + if (aLen < 2) for (;;) { + if (index in self) { + memo = self[index]; + index += i; + break; + } + index += i; + if (isRight ? index < 0 : length <= index) { + throw TypeError('Reduce of empty array with no initial value'); + } + } + for (;isRight ? index >= 0 : length > index; index += i) if (index in self) { + memo = callbackfn(memo, self[index], index, O); + } + return memo; +}; + + +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) + +var toObject = __webpack_require__(9); +var toAbsoluteIndex = __webpack_require__(35); +var toLength = __webpack_require__(8); + +module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { + var O = toObject(this); + var len = toLength(O.length); + var to = toAbsoluteIndex(target, len); + var from = toAbsoluteIndex(start, len); + var end = arguments.length > 2 ? arguments[2] : undefined; + var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); + var inc = 1; + if (from < to && to < from + count) { + inc = -1; + from += count - 1; + to += count - 1; + } + while (count-- > 0) { + if (from in O) O[to] = O[from]; + else delete O[to]; + to += inc; + from += inc; + } return O; +}; + + +/***/ }), +/* 107 */ +/***/ (function(module, exports) { + +module.exports = function (done, value) { + return { value: value, done: !!done }; +}; + + +/***/ }), +/* 108 */ +/***/ (function(module, exports, __webpack_require__) { + +// 21.2.5.3 get RegExp.prototype.flags() +if (__webpack_require__(6) && /./g.flags != 'g') __webpack_require__(7).f(RegExp.prototype, 'flags', { + configurable: true, + get: __webpack_require__(55) +}); + + +/***/ }), +/* 109 */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return { e: false, v: exec() }; + } catch (e) { + return { e: true, v: e }; + } +}; + + +/***/ }), +/* 110 */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(1); +var isObject = __webpack_require__(4); +var newPromiseCapability = __webpack_require__(88); + +module.exports = function (C, x) { + anObject(C); + if (isObject(x) && x.constructor === C) return x; + var promiseCapability = newPromiseCapability.f(C); + var resolve = promiseCapability.resolve; + resolve(x); + return promiseCapability.promise; +}; + + +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var strong = __webpack_require__(112); +var validate = __webpack_require__(45); +var MAP = 'Map'; + +// 23.1 Map Objects +module.exports = __webpack_require__(59)(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); + + +/***/ }), +/* 112 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var dP = __webpack_require__(7).f; +var create = __webpack_require__(36); +var redefineAll = __webpack_require__(41); +var ctx = __webpack_require__(18); +var anInstance = __webpack_require__(39); +var forOf = __webpack_require__(40); +var $iterDefine = __webpack_require__(78); +var step = __webpack_require__(107); +var setSpecies = __webpack_require__(38); +var DESCRIPTORS = __webpack_require__(6); +var fastKey = __webpack_require__(29).fastKey; +var validate = __webpack_require__(45); +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); + } +}; + + +/***/ }), +/* 113 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var strong = __webpack_require__(112); +var validate = __webpack_require__(45); +var SET = 'Set'; + +// 23.2 Set Objects +module.exports = __webpack_require__(59)(SET, function (get) { + return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value) { + return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value); + } +}, strong); + + +/***/ }), +/* 114 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var each = __webpack_require__(25)(0); +var redefine = __webpack_require__(12); +var meta = __webpack_require__(29); +var assign = __webpack_require__(95); +var weak = __webpack_require__(115); +var isObject = __webpack_require__(4); +var fails = __webpack_require__(3); +var validate = __webpack_require__(45); +var WEAK_MAP = 'WeakMap'; +var getWeak = meta.getWeak; +var isExtensible = Object.isExtensible; +var uncaughtFrozenStore = weak.ufstore; +var tmp = {}; +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__(59)(WEAK_MAP, wrapper, methods, weak, true, true); + +// IE11 WeakMap frozen keys fix +if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) { + 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); + }); + }); +} + + +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var redefineAll = __webpack_require__(41); +var getWeak = __webpack_require__(29).getWeak; +var anObject = __webpack_require__(1); +var isObject = __webpack_require__(4); +var anInstance = __webpack_require__(39); +var forOf = __webpack_require__(40); +var createArrayMethod = __webpack_require__(25); +var $has = __webpack_require__(14); +var validate = __webpack_require__(45); +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 +}; + + +/***/ }), +/* 116 */ +/***/ (function(module, exports, __webpack_require__) { + +// all object keys, includes non-enumerable and symbols +var gOPN = __webpack_require__(37); +var gOPS = __webpack_require__(51); +var anObject = __webpack_require__(1); +var Reflect = __webpack_require__(2).Reflect; +module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { + var keys = gOPN.f(anObject(it)); + var getSymbols = gOPS.f; + return getSymbols ? keys.concat(getSymbols(it)) : keys; +}; + + +/***/ }), +/* 117 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/ecma262/#sec-toindex +var toInteger = __webpack_require__(23); +var toLength = __webpack_require__(8); +module.exports = function (it) { + if (it === undefined) return 0; + var number = toInteger(it); + var length = toLength(number); + if (number !== length) throw RangeError('Wrong length!'); + return length; +}; + + +/***/ }), +/* 118 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray +var isArray = __webpack_require__(52); +var isObject = __webpack_require__(4); +var toLength = __webpack_require__(8); +var ctx = __webpack_require__(18); +var IS_CONCAT_SPREADABLE = __webpack_require__(5)('isConcatSpreadable'); + +function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) { + var targetIndex = start; + var sourceIndex = 0; + var mapFn = mapper ? ctx(mapper, thisArg, 3) : false; + var element, spreadable; + + while (sourceIndex < sourceLen) { + if (sourceIndex in source) { + element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; + + spreadable = false; + if (isObject(element)) { + spreadable = element[IS_CONCAT_SPREADABLE]; + spreadable = spreadable !== undefined ? !!spreadable : isArray(element); + } + + if (spreadable && depth > 0) { + targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1; + } else { + if (targetIndex >= 0x1fffffffffffff) throw TypeError(); + target[targetIndex] = element; + } + + targetIndex++; + } + sourceIndex++; + } + return targetIndex; +} + +module.exports = flattenIntoArray; + + +/***/ }), +/* 119 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-string-pad-start-end +var toLength = __webpack_require__(8); +var repeat = __webpack_require__(72); +var defined = __webpack_require__(22); + +module.exports = function (that, maxLength, fillString, left) { + var S = String(defined(that)); + var stringLength = S.length; + var fillStr = fillString === undefined ? ' ' : String(fillString); + var intMaxLength = toLength(maxLength); + if (intMaxLength <= stringLength || fillStr == '') return S; + var fillLen = intMaxLength - stringLength; + var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); + if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); + return left ? stringFiller + S : S + stringFiller; +}; + + +/***/ }), +/* 120 */ +/***/ (function(module, exports, __webpack_require__) { + +var getKeys = __webpack_require__(34); +var toIObject = __webpack_require__(15); +var isEnum = __webpack_require__(47).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) if (isEnum.call(O, key = keys[i++])) { + result.push(isEntries ? [key, O[key]] : O[key]); + } return result; + }; +}; + + +/***/ }), +/* 121 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var classof = __webpack_require__(48); +var from = __webpack_require__(122); +module.exports = function (NAME) { + return function toJSON() { + if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); + return from(this); + }; +}; + + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +var forOf = __webpack_require__(40); + +module.exports = function (iter, ITERATOR) { + var result = []; + forOf(iter, false, result.push, result, ITERATOR); + return result; +}; + + +/***/ }), +/* 123 */ +/***/ (function(module, exports) { + +// https://rwaldron.github.io/proposal-math-extensions/ +module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) { + if ( + arguments.length === 0 + // eslint-disable-next-line no-self-compare + || x != x + // eslint-disable-next-line no-self-compare + || inLow != inLow + // eslint-disable-next-line no-self-compare + || inHigh != inHigh + // eslint-disable-next-line no-self-compare + || outLow != outLow + // eslint-disable-next-line no-self-compare + || outHigh != outHigh + ) return NaN; + if (x === Infinity || x === -Infinity) return x; + return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow; +}; + + +/***/ }), +/* 124 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(125); +__webpack_require__(127); +__webpack_require__(128); +__webpack_require__(129); +__webpack_require__(130); +__webpack_require__(131); +__webpack_require__(132); +__webpack_require__(133); +__webpack_require__(134); +__webpack_require__(135); +__webpack_require__(136); +__webpack_require__(137); +__webpack_require__(138); +__webpack_require__(139); +__webpack_require__(140); +__webpack_require__(141); +__webpack_require__(143); +__webpack_require__(144); +__webpack_require__(145); +__webpack_require__(146); +__webpack_require__(147); +__webpack_require__(148); +__webpack_require__(149); +__webpack_require__(150); +__webpack_require__(151); +__webpack_require__(152); +__webpack_require__(153); +__webpack_require__(154); +__webpack_require__(155); +__webpack_require__(156); +__webpack_require__(157); +__webpack_require__(158); +__webpack_require__(159); +__webpack_require__(160); +__webpack_require__(161); +__webpack_require__(162); +__webpack_require__(163); +__webpack_require__(164); +__webpack_require__(165); +__webpack_require__(166); +__webpack_require__(167); +__webpack_require__(168); +__webpack_require__(169); +__webpack_require__(170); +__webpack_require__(171); +__webpack_require__(172); +__webpack_require__(173); +__webpack_require__(174); +__webpack_require__(175); +__webpack_require__(176); +__webpack_require__(177); +__webpack_require__(178); +__webpack_require__(179); +__webpack_require__(180); +__webpack_require__(181); +__webpack_require__(182); +__webpack_require__(183); +__webpack_require__(184); +__webpack_require__(185); +__webpack_require__(186); +__webpack_require__(187); +__webpack_require__(188); +__webpack_require__(189); +__webpack_require__(190); +__webpack_require__(191); +__webpack_require__(192); +__webpack_require__(193); +__webpack_require__(194); +__webpack_require__(195); +__webpack_require__(196); +__webpack_require__(197); +__webpack_require__(198); +__webpack_require__(199); +__webpack_require__(200); +__webpack_require__(201); +__webpack_require__(202); +__webpack_require__(203); +__webpack_require__(204); +__webpack_require__(205); +__webpack_require__(206); +__webpack_require__(207); +__webpack_require__(209); +__webpack_require__(210); +__webpack_require__(211); +__webpack_require__(212); +__webpack_require__(213); +__webpack_require__(214); +__webpack_require__(215); +__webpack_require__(216); +__webpack_require__(217); +__webpack_require__(218); +__webpack_require__(219); +__webpack_require__(220); +__webpack_require__(85); +__webpack_require__(221); +__webpack_require__(222); +__webpack_require__(223); +__webpack_require__(108); +__webpack_require__(224); +__webpack_require__(225); +__webpack_require__(226); +__webpack_require__(227); +__webpack_require__(228); +__webpack_require__(111); +__webpack_require__(113); +__webpack_require__(114); +__webpack_require__(229); +__webpack_require__(230); +__webpack_require__(231); +__webpack_require__(232); +__webpack_require__(233); +__webpack_require__(234); +__webpack_require__(235); +__webpack_require__(236); +__webpack_require__(237); +__webpack_require__(238); +__webpack_require__(239); +__webpack_require__(240); +__webpack_require__(241); +__webpack_require__(242); +__webpack_require__(243); +__webpack_require__(244); +__webpack_require__(245); +__webpack_require__(246); +__webpack_require__(248); +__webpack_require__(249); +__webpack_require__(251); +__webpack_require__(252); +__webpack_require__(253); +__webpack_require__(254); +__webpack_require__(255); +__webpack_require__(256); +__webpack_require__(257); +__webpack_require__(258); +__webpack_require__(259); +__webpack_require__(260); +__webpack_require__(261); +__webpack_require__(262); +__webpack_require__(263); +__webpack_require__(264); +__webpack_require__(265); +__webpack_require__(266); +__webpack_require__(267); +__webpack_require__(268); +__webpack_require__(269); +__webpack_require__(270); +__webpack_require__(271); +__webpack_require__(272); +__webpack_require__(273); +__webpack_require__(274); +__webpack_require__(275); +__webpack_require__(276); +__webpack_require__(277); +__webpack_require__(278); +__webpack_require__(279); +__webpack_require__(280); +__webpack_require__(281); +__webpack_require__(282); +__webpack_require__(283); +__webpack_require__(284); +__webpack_require__(285); +__webpack_require__(286); +__webpack_require__(287); +__webpack_require__(288); +__webpack_require__(289); +__webpack_require__(290); +__webpack_require__(291); +__webpack_require__(292); +__webpack_require__(293); +__webpack_require__(294); +__webpack_require__(295); +__webpack_require__(296); +__webpack_require__(297); +__webpack_require__(298); +__webpack_require__(299); +__webpack_require__(300); +__webpack_require__(301); +__webpack_require__(302); +__webpack_require__(303); +__webpack_require__(304); +__webpack_require__(305); +__webpack_require__(306); +__webpack_require__(307); +__webpack_require__(308); +__webpack_require__(309); +__webpack_require__(310); +__webpack_require__(311); +__webpack_require__(312); +__webpack_require__(313); +__webpack_require__(314); +__webpack_require__(315); +__webpack_require__(316); +__webpack_require__(317); +__webpack_require__(318); +__webpack_require__(319); +module.exports = __webpack_require__(320); + + +/***/ }), +/* 125 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// ECMAScript 6 symbols shim +var global = __webpack_require__(2); +var has = __webpack_require__(14); +var DESCRIPTORS = __webpack_require__(6); +var $export = __webpack_require__(0); +var redefine = __webpack_require__(12); +var META = __webpack_require__(29).KEY; +var $fails = __webpack_require__(3); +var shared = __webpack_require__(49); +var setToStringTag = __webpack_require__(42); +var uid = __webpack_require__(33); +var wks = __webpack_require__(5); +var wksExt = __webpack_require__(91); +var wksDefine = __webpack_require__(65); +var enumKeys = __webpack_require__(126); +var isArray = __webpack_require__(52); +var anObject = __webpack_require__(1); +var isObject = __webpack_require__(4); +var toIObject = __webpack_require__(15); +var toPrimitive = __webpack_require__(21); +var createDesc = __webpack_require__(32); +var _create = __webpack_require__(36); +var gOPNExt = __webpack_require__(94); +var $GOPD = __webpack_require__(16); +var $DP = __webpack_require__(7); +var $keys = __webpack_require__(34); +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'; +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__(37).f = gOPNExt.f = $getOwnPropertyNames; + __webpack_require__(47).f = $propertyIsEnumerable; + __webpack_require__(51).f = $getOwnPropertySymbols; + + if (DESCRIPTORS && !__webpack_require__(30)) { + 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 +}); + +// 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__(11)($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); + + +/***/ }), +/* 126 */ +/***/ (function(module, exports, __webpack_require__) { + +// all enumerable object keys, includes symbols +var getKeys = __webpack_require__(34); +var gOPS = __webpack_require__(51); +var pIE = __webpack_require__(47); +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; +}; + + +/***/ }), +/* 127 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) +$export($export.S + $export.F * !__webpack_require__(6), 'Object', { defineProperty: __webpack_require__(7).f }); + + +/***/ }), +/* 128 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) +$export($export.S + $export.F * !__webpack_require__(6), 'Object', { defineProperties: __webpack_require__(93) }); + + +/***/ }), +/* 129 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) +var toIObject = __webpack_require__(15); +var $getOwnPropertyDescriptor = __webpack_require__(16).f; + +__webpack_require__(24)('getOwnPropertyDescriptor', function () { + return function getOwnPropertyDescriptor(it, key) { + return $getOwnPropertyDescriptor(toIObject(it), key); + }; +}); + + +/***/ }), +/* 130 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +$export($export.S, 'Object', { create: __webpack_require__(36) }); + + +/***/ }), +/* 131 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.9 Object.getPrototypeOf(O) +var toObject = __webpack_require__(9); +var $getPrototypeOf = __webpack_require__(17); + +__webpack_require__(24)('getPrototypeOf', function () { + return function getPrototypeOf(it) { + return $getPrototypeOf(toObject(it)); + }; +}); + + +/***/ }), +/* 132 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 Object.keys(O) +var toObject = __webpack_require__(9); +var $keys = __webpack_require__(34); + +__webpack_require__(24)('keys', function () { + return function keys(it) { + return $keys(toObject(it)); + }; +}); + + +/***/ }), +/* 133 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.7 Object.getOwnPropertyNames(O) +__webpack_require__(24)('getOwnPropertyNames', function () { + return __webpack_require__(94).f; +}); + + +/***/ }), +/* 134 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.5 Object.freeze(O) +var isObject = __webpack_require__(4); +var meta = __webpack_require__(29).onFreeze; + +__webpack_require__(24)('freeze', function ($freeze) { + return function freeze(it) { + return $freeze && isObject(it) ? $freeze(meta(it)) : it; + }; +}); + + +/***/ }), +/* 135 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.17 Object.seal(O) +var isObject = __webpack_require__(4); +var meta = __webpack_require__(29).onFreeze; + +__webpack_require__(24)('seal', function ($seal) { + return function seal(it) { + return $seal && isObject(it) ? $seal(meta(it)) : it; + }; +}); + + +/***/ }), +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.15 Object.preventExtensions(O) +var isObject = __webpack_require__(4); +var meta = __webpack_require__(29).onFreeze; + +__webpack_require__(24)('preventExtensions', function ($preventExtensions) { + return function preventExtensions(it) { + return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; + }; +}); + + +/***/ }), +/* 137 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.12 Object.isFrozen(O) +var isObject = __webpack_require__(4); + +__webpack_require__(24)('isFrozen', function ($isFrozen) { + return function isFrozen(it) { + return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; + }; +}); + + +/***/ }), +/* 138 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.13 Object.isSealed(O) +var isObject = __webpack_require__(4); + +__webpack_require__(24)('isSealed', function ($isSealed) { + return function isSealed(it) { + return isObject(it) ? $isSealed ? $isSealed(it) : false : true; + }; +}); + + +/***/ }), +/* 139 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.11 Object.isExtensible(O) +var isObject = __webpack_require__(4); + +__webpack_require__(24)('isExtensible', function ($isExtensible) { + return function isExtensible(it) { + return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; + }; +}); + + +/***/ }), +/* 140 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.3.1 Object.assign(target, source) +var $export = __webpack_require__(0); + +$export($export.S + $export.F, 'Object', { assign: __webpack_require__(95) }); + + +/***/ }), +/* 141 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.3.10 Object.is(value1, value2) +var $export = __webpack_require__(0); +$export($export.S, 'Object', { is: __webpack_require__(142) }); + + +/***/ }), +/* 142 */ +/***/ (function(module, exports) { + +// 7.2.9 SameValue(x, y) +module.exports = Object.is || function is(x, y) { + // eslint-disable-next-line no-self-compare + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; +}; + + +/***/ }), +/* 143 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.3.19 Object.setPrototypeOf(O, proto) +var $export = __webpack_require__(0); +$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(69).set }); + + +/***/ }), +/* 144 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 19.1.3.6 Object.prototype.toString() +var classof = __webpack_require__(48); +var test = {}; +test[__webpack_require__(5)('toStringTag')] = 'z'; +if (test + '' != '[object z]') { + __webpack_require__(12)(Object.prototype, 'toString', function toString() { + return '[object ' + classof(this) + ']'; + }, true); +} + + +/***/ }), +/* 145 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) +var $export = __webpack_require__(0); + +$export($export.P, 'Function', { bind: __webpack_require__(96) }); + + +/***/ }), +/* 146 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(7).f; +var FProto = Function.prototype; +var nameRE = /^\s*function ([^ (]*)/; +var NAME = 'name'; + +// 19.2.4.2 name +NAME in FProto || __webpack_require__(6) && dP(FProto, NAME, { + configurable: true, + get: function () { + try { + return ('' + this).match(nameRE)[1]; + } catch (e) { + return ''; + } + } +}); + + +/***/ }), +/* 147 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var isObject = __webpack_require__(4); +var getPrototypeOf = __webpack_require__(17); +var HAS_INSTANCE = __webpack_require__(5)('hasInstance'); +var FunctionProto = Function.prototype; +// 19.2.3.6 Function.prototype[@@hasInstance](V) +if (!(HAS_INSTANCE in FunctionProto)) __webpack_require__(7).f(FunctionProto, HAS_INSTANCE, { value: function (O) { + if (typeof this != 'function' || !isObject(O)) return false; + if (!isObject(this.prototype)) return O instanceof this; + // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: + while (O = getPrototypeOf(O)) if (this.prototype === O) return true; + return false; +} }); + + +/***/ }), +/* 148 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(2); +var has = __webpack_require__(14); +var cof = __webpack_require__(19); +var inheritIfRequired = __webpack_require__(70); +var toPrimitive = __webpack_require__(21); +var fails = __webpack_require__(3); +var gOPN = __webpack_require__(37).f; +var gOPD = __webpack_require__(16).f; +var dP = __webpack_require__(7).f; +var $trim = __webpack_require__(43).trim; +var NUMBER = 'Number'; +var $Number = global[NUMBER]; +var Base = $Number; +var proto = $Number.prototype; +// Opera ~12 has broken Object#toString +var BROKEN_COF = cof(__webpack_require__(36)(proto)) == NUMBER; +var TRIM = 'trim' in String.prototype; + +// 7.1.3 ToNumber(argument) +var toNumber = function (argument) { + var it = toPrimitive(argument, false); + if (typeof it == 'string' && it.length > 2) { + it = TRIM ? it.trim() : $trim(it, 3); + var first = it.charCodeAt(0); + var third, radix, maxCode; + if (first === 43 || first === 45) { + third = it.charCodeAt(2); + if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix + } else if (first === 48) { + switch (it.charCodeAt(1)) { + case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i + case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i + default: return +it; + } + for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) { + code = digits.charCodeAt(i); + // parseInt parses a string to a first unavailable symbol + // but ToNumber should return NaN if a string contains unavailable symbols + if (code < 48 || code > maxCode) return NaN; + } return parseInt(digits, radix); + } + } return +it; +}; + +if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) { + $Number = function Number(value) { + var it = arguments.length < 1 ? 0 : value; + var that = this; + return that instanceof $Number + // check on 1..constructor(foo) case + && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER) + ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it); + }; + for (var keys = __webpack_require__(6) ? gOPN(Base) : ( + // ES3: + 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + + // ES6 (in case, if modules with ES6 Number statics required before): + 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + + 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' + ).split(','), j = 0, key; keys.length > j; j++) { + if (has(Base, key = keys[j]) && !has($Number, key)) { + dP($Number, key, gOPD(Base, key)); + } + } + $Number.prototype = proto; + proto.constructor = $Number; + __webpack_require__(12)(global, NUMBER, $Number); +} + + +/***/ }), +/* 149 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toInteger = __webpack_require__(23); +var aNumberValue = __webpack_require__(98); +var repeat = __webpack_require__(72); +var $toFixed = 1.0.toFixed; +var floor = Math.floor; +var data = [0, 0, 0, 0, 0, 0]; +var ERROR = 'Number.toFixed: incorrect invocation!'; +var ZERO = '0'; + +var multiply = function (n, c) { + var i = -1; + var c2 = c; + while (++i < 6) { + c2 += n * data[i]; + data[i] = c2 % 1e7; + c2 = floor(c2 / 1e7); + } +}; +var divide = function (n) { + var i = 6; + var c = 0; + while (--i >= 0) { + c += data[i]; + data[i] = floor(c / n); + c = (c % n) * 1e7; + } +}; +var numToString = function () { + var i = 6; + var s = ''; + while (--i >= 0) { + if (s !== '' || i === 0 || data[i] !== 0) { + var t = String(data[i]); + s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; + } + } return s; +}; +var pow = function (x, n, acc) { + return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); +}; +var log = function (x) { + var n = 0; + var x2 = x; + while (x2 >= 4096) { + n += 12; + x2 /= 4096; + } + while (x2 >= 2) { + n += 1; + x2 /= 2; + } return n; +}; + +$export($export.P + $export.F * (!!$toFixed && ( + 0.00008.toFixed(3) !== '0.000' || + 0.9.toFixed(0) !== '1' || + 1.255.toFixed(2) !== '1.25' || + 1000000000000000128.0.toFixed(0) !== '1000000000000000128' +) || !__webpack_require__(3)(function () { + // V8 ~ Android 4.3- + $toFixed.call({}); +})), 'Number', { + toFixed: function toFixed(fractionDigits) { + var x = aNumberValue(this, ERROR); + var f = toInteger(fractionDigits); + var s = ''; + var m = ZERO; + var e, z, j, k; + if (f < 0 || f > 20) throw RangeError(ERROR); + // eslint-disable-next-line no-self-compare + if (x != x) return 'NaN'; + if (x <= -1e21 || x >= 1e21) return String(x); + if (x < 0) { + s = '-'; + x = -x; + } + if (x > 1e-21) { + e = log(x * pow(2, 69, 1)) - 69; + z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); + z *= 0x10000000000000; + e = 52 - e; + if (e > 0) { + multiply(0, z); + j = f; + while (j >= 7) { + multiply(1e7, 0); + j -= 7; + } + multiply(pow(10, j, 1), 0); + j = e - 1; + while (j >= 23) { + divide(1 << 23); + j -= 23; + } + divide(1 << j); + multiply(1, 1); + divide(2); + m = numToString(); + } else { + multiply(0, z); + multiply(1 << -e, 0); + m = numToString() + repeat.call(ZERO, f); + } + } + if (f > 0) { + k = m.length; + m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); + } else { + m = s + m; + } return m; + } +}); + + +/***/ }), +/* 150 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $fails = __webpack_require__(3); +var aNumberValue = __webpack_require__(98); +var $toPrecision = 1.0.toPrecision; + +$export($export.P + $export.F * ($fails(function () { + // IE7- + return $toPrecision.call(1, undefined) !== '1'; +}) || !$fails(function () { + // V8 ~ Android 4.3- + $toPrecision.call({}); +})), 'Number', { + toPrecision: function toPrecision(precision) { + var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); + return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); + } +}); + + +/***/ }), +/* 151 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.1 Number.EPSILON +var $export = __webpack_require__(0); + +$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) }); + + +/***/ }), +/* 152 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.2 Number.isFinite(number) +var $export = __webpack_require__(0); +var _isFinite = __webpack_require__(2).isFinite; + +$export($export.S, 'Number', { + isFinite: function isFinite(it) { + return typeof it == 'number' && _isFinite(it); + } +}); + + +/***/ }), +/* 153 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.3 Number.isInteger(number) +var $export = __webpack_require__(0); + +$export($export.S, 'Number', { isInteger: __webpack_require__(99) }); + + +/***/ }), +/* 154 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.4 Number.isNaN(number) +var $export = __webpack_require__(0); + +$export($export.S, 'Number', { + isNaN: function isNaN(number) { + // eslint-disable-next-line no-self-compare + return number != number; + } +}); + + +/***/ }), +/* 155 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.5 Number.isSafeInteger(number) +var $export = __webpack_require__(0); +var isInteger = __webpack_require__(99); +var abs = Math.abs; + +$export($export.S, 'Number', { + isSafeInteger: function isSafeInteger(number) { + return isInteger(number) && abs(number) <= 0x1fffffffffffff; + } +}); + + +/***/ }), +/* 156 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.6 Number.MAX_SAFE_INTEGER +var $export = __webpack_require__(0); + +$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); + + +/***/ }), +/* 157 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.10 Number.MIN_SAFE_INTEGER +var $export = __webpack_require__(0); + +$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff }); + + +/***/ }), +/* 158 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var $parseFloat = __webpack_require__(100); +// 20.1.2.12 Number.parseFloat(string) +$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat }); + + +/***/ }), +/* 159 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var $parseInt = __webpack_require__(101); +// 20.1.2.13 Number.parseInt(string, radix) +$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt }); + + +/***/ }), +/* 160 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var $parseInt = __webpack_require__(101); +// 18.2.5 parseInt(string, radix) +$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt }); + + +/***/ }), +/* 161 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var $parseFloat = __webpack_require__(100); +// 18.2.4 parseFloat(string) +$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat }); + + +/***/ }), +/* 162 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.3 Math.acosh(x) +var $export = __webpack_require__(0); +var log1p = __webpack_require__(102); +var sqrt = Math.sqrt; +var $acosh = Math.acosh; + +$export($export.S + $export.F * !($acosh + // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 + && Math.floor($acosh(Number.MAX_VALUE)) == 710 + // Tor Browser bug: Math.acosh(Infinity) -> NaN + && $acosh(Infinity) == Infinity +), 'Math', { + acosh: function acosh(x) { + return (x = +x) < 1 ? NaN : x > 94906265.62425156 + ? Math.log(x) + Math.LN2 + : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); + } +}); + + +/***/ }), +/* 163 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.5 Math.asinh(x) +var $export = __webpack_require__(0); +var $asinh = Math.asinh; + +function asinh(x) { + return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); +} + +// Tor Browser bug: Math.asinh(0) -> -0 +$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh }); + + +/***/ }), +/* 164 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.7 Math.atanh(x) +var $export = __webpack_require__(0); +var $atanh = Math.atanh; + +// Tor Browser bug: Math.atanh(-0) -> 0 +$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { + atanh: function atanh(x) { + return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; + } +}); + + +/***/ }), +/* 165 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.9 Math.cbrt(x) +var $export = __webpack_require__(0); +var sign = __webpack_require__(73); + +$export($export.S, 'Math', { + cbrt: function cbrt(x) { + return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); + } +}); + + +/***/ }), +/* 166 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.11 Math.clz32(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + clz32: function clz32(x) { + return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; + } +}); + + +/***/ }), +/* 167 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.12 Math.cosh(x) +var $export = __webpack_require__(0); +var exp = Math.exp; + +$export($export.S, 'Math', { + cosh: function cosh(x) { + return (exp(x = +x) + exp(-x)) / 2; + } +}); + + +/***/ }), +/* 168 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.14 Math.expm1(x) +var $export = __webpack_require__(0); +var $expm1 = __webpack_require__(74); + +$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 }); + + +/***/ }), +/* 169 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.16 Math.fround(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { fround: __webpack_require__(103) }); + + +/***/ }), +/* 170 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) +var $export = __webpack_require__(0); +var abs = Math.abs; + +$export($export.S, 'Math', { + hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars + var sum = 0; + var i = 0; + var aLen = arguments.length; + var larg = 0; + var arg, div; + while (i < aLen) { + arg = abs(arguments[i++]); + if (larg < arg) { + div = larg / arg; + sum = sum * div * div + 1; + larg = arg; + } else if (arg > 0) { + div = arg / larg; + sum += div * div; + } else sum += arg; + } + return larg === Infinity ? Infinity : larg * Math.sqrt(sum); + } +}); + + +/***/ }), +/* 171 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.18 Math.imul(x, y) +var $export = __webpack_require__(0); +var $imul = Math.imul; + +// some WebKit versions fails with big numbers, some has wrong arity +$export($export.S + $export.F * __webpack_require__(3)(function () { + return $imul(0xffffffff, 5) != -5 || $imul.length != 2; +}), 'Math', { + imul: function imul(x, y) { + var UINT16 = 0xffff; + var xn = +x; + var yn = +y; + var xl = UINT16 & xn; + var yl = UINT16 & yn; + return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); + } +}); + + +/***/ }), +/* 172 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.21 Math.log10(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + log10: function log10(x) { + return Math.log(x) * Math.LOG10E; + } +}); + + +/***/ }), +/* 173 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.20 Math.log1p(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { log1p: __webpack_require__(102) }); + + +/***/ }), +/* 174 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.22 Math.log2(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + log2: function log2(x) { + return Math.log(x) / Math.LN2; + } +}); + + +/***/ }), +/* 175 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.28 Math.sign(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { sign: __webpack_require__(73) }); + + +/***/ }), +/* 176 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.30 Math.sinh(x) +var $export = __webpack_require__(0); +var expm1 = __webpack_require__(74); +var exp = Math.exp; + +// V8 near Chromium 38 has a problem with very small numbers +$export($export.S + $export.F * __webpack_require__(3)(function () { + return !Math.sinh(-2e-17) != -2e-17; +}), 'Math', { + sinh: function sinh(x) { + return Math.abs(x = +x) < 1 + ? (expm1(x) - expm1(-x)) / 2 + : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); + } +}); + + +/***/ }), +/* 177 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.33 Math.tanh(x) +var $export = __webpack_require__(0); +var expm1 = __webpack_require__(74); +var exp = Math.exp; + +$export($export.S, 'Math', { + tanh: function tanh(x) { + var a = expm1(x = +x); + var b = expm1(-x); + return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); + } +}); + + +/***/ }), +/* 178 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.34 Math.trunc(x) +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + trunc: function trunc(it) { + return (it > 0 ? Math.floor : Math.ceil)(it); + } +}); + + +/***/ }), +/* 179 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var toAbsoluteIndex = __webpack_require__(35); +var fromCharCode = String.fromCharCode; +var $fromCodePoint = String.fromCodePoint; + +// length should be 1, old FF problem +$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { + // 21.1.2.2 String.fromCodePoint(...codePoints) + fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars + var res = []; + var aLen = arguments.length; + var i = 0; + var code; + while (aLen > i) { + code = +arguments[i++]; + if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); + res.push(code < 0x10000 + ? fromCharCode(code) + : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) + ); + } return res.join(''); + } +}); + + +/***/ }), +/* 180 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var toIObject = __webpack_require__(15); +var toLength = __webpack_require__(8); + +$export($export.S, 'String', { + // 21.1.2.4 String.raw(callSite, ...substitutions) + raw: function raw(callSite) { + var tpl = toIObject(callSite.raw); + var len = toLength(tpl.length); + var aLen = arguments.length; + var res = []; + var i = 0; + while (len > i) { + res.push(String(tpl[i++])); + if (i < aLen) res.push(String(arguments[i])); + } return res.join(''); + } +}); + + +/***/ }), +/* 181 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 21.1.3.25 String.prototype.trim() +__webpack_require__(43)('trim', function ($trim) { + return function trim() { + return $trim(this, 3); + }; +}); + + +/***/ }), +/* 182 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $at = __webpack_require__(75)(false); +$export($export.P, 'String', { + // 21.1.3.3 String.prototype.codePointAt(pos) + codePointAt: function codePointAt(pos) { + return $at(this, pos); + } +}); + + +/***/ }), +/* 183 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) + +var $export = __webpack_require__(0); +var toLength = __webpack_require__(8); +var context = __webpack_require__(76); +var ENDS_WITH = 'endsWith'; +var $endsWith = ''[ENDS_WITH]; + +$export($export.P + $export.F * __webpack_require__(77)(ENDS_WITH), 'String', { + endsWith: function endsWith(searchString /* , endPosition = @length */) { + var that = context(this, searchString, ENDS_WITH); + var endPosition = arguments.length > 1 ? arguments[1] : undefined; + var len = toLength(that.length); + var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); + var search = String(searchString); + return $endsWith + ? $endsWith.call(that, search, end) + : that.slice(end - search.length, end) === search; + } +}); + + +/***/ }), +/* 184 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 21.1.3.7 String.prototype.includes(searchString, position = 0) + +var $export = __webpack_require__(0); +var context = __webpack_require__(76); +var INCLUDES = 'includes'; + +$export($export.P + $export.F * __webpack_require__(77)(INCLUDES), 'String', { + includes: function includes(searchString /* , position = 0 */) { + return !!~context(this, searchString, INCLUDES) + .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); + } +}); + + +/***/ }), +/* 185 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); + +$export($export.P, 'String', { + // 21.1.3.13 String.prototype.repeat(count) + repeat: __webpack_require__(72) +}); + + +/***/ }), +/* 186 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 21.1.3.18 String.prototype.startsWith(searchString [, position ]) + +var $export = __webpack_require__(0); +var toLength = __webpack_require__(8); +var context = __webpack_require__(76); +var STARTS_WITH = 'startsWith'; +var $startsWith = ''[STARTS_WITH]; + +$export($export.P + $export.F * __webpack_require__(77)(STARTS_WITH), 'String', { + startsWith: function startsWith(searchString /* , position = 0 */) { + var that = context(this, searchString, STARTS_WITH); + var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); + var search = String(searchString); + return $startsWith + ? $startsWith.call(that, search, index) + : that.slice(index, index + search.length) === search; + } +}); + + +/***/ }), +/* 187 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $at = __webpack_require__(75)(true); + +// 21.1.3.27 String.prototype[@@iterator]() +__webpack_require__(78)(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 }; +}); + + +/***/ }), +/* 188 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.2 String.prototype.anchor(name) +__webpack_require__(13)('anchor', function (createHTML) { + return function anchor(name) { + return createHTML(this, 'a', 'name', name); + }; +}); + + +/***/ }), +/* 189 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.3 String.prototype.big() +__webpack_require__(13)('big', function (createHTML) { + return function big() { + return createHTML(this, 'big', '', ''); + }; +}); + + +/***/ }), +/* 190 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.4 String.prototype.blink() +__webpack_require__(13)('blink', function (createHTML) { + return function blink() { + return createHTML(this, 'blink', '', ''); + }; +}); + + +/***/ }), +/* 191 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.5 String.prototype.bold() +__webpack_require__(13)('bold', function (createHTML) { + return function bold() { + return createHTML(this, 'b', '', ''); + }; +}); + + +/***/ }), +/* 192 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.6 String.prototype.fixed() +__webpack_require__(13)('fixed', function (createHTML) { + return function fixed() { + return createHTML(this, 'tt', '', ''); + }; +}); + + +/***/ }), +/* 193 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.7 String.prototype.fontcolor(color) +__webpack_require__(13)('fontcolor', function (createHTML) { + return function fontcolor(color) { + return createHTML(this, 'font', 'color', color); + }; +}); + + +/***/ }), +/* 194 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.8 String.prototype.fontsize(size) +__webpack_require__(13)('fontsize', function (createHTML) { + return function fontsize(size) { + return createHTML(this, 'font', 'size', size); + }; +}); + + +/***/ }), +/* 195 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.9 String.prototype.italics() +__webpack_require__(13)('italics', function (createHTML) { + return function italics() { + return createHTML(this, 'i', '', ''); + }; +}); + + +/***/ }), +/* 196 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.10 String.prototype.link(url) +__webpack_require__(13)('link', function (createHTML) { + return function link(url) { + return createHTML(this, 'a', 'href', url); + }; +}); + + +/***/ }), +/* 197 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.11 String.prototype.small() +__webpack_require__(13)('small', function (createHTML) { + return function small() { + return createHTML(this, 'small', '', ''); + }; +}); + + +/***/ }), +/* 198 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.12 String.prototype.strike() +__webpack_require__(13)('strike', function (createHTML) { + return function strike() { + return createHTML(this, 'strike', '', ''); + }; +}); + + +/***/ }), +/* 199 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.13 String.prototype.sub() +__webpack_require__(13)('sub', function (createHTML) { + return function sub() { + return createHTML(this, 'sub', '', ''); + }; +}); + + +/***/ }), +/* 200 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.14 String.prototype.sup() +__webpack_require__(13)('sup', function (createHTML) { + return function sup() { + return createHTML(this, 'sup', '', ''); + }; +}); + + +/***/ }), +/* 201 */ +/***/ (function(module, exports, __webpack_require__) { + +// 22.1.2.2 / 15.4.3.2 Array.isArray(arg) +var $export = __webpack_require__(0); + +$export($export.S, 'Array', { isArray: __webpack_require__(52) }); + + +/***/ }), +/* 202 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var ctx = __webpack_require__(18); +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var call = __webpack_require__(104); +var isArrayIter = __webpack_require__(80); +var toLength = __webpack_require__(8); +var createProperty = __webpack_require__(81); +var getIterFn = __webpack_require__(82); + +$export($export.S + $export.F * !__webpack_require__(54)(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; + } +}); + + +/***/ }), +/* 203 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var createProperty = __webpack_require__(81); + +// WebKit Array.of isn't generic +$export($export.S + $export.F * __webpack_require__(3)(function () { + function F() { /* empty */ } + return !(Array.of.call(F) instanceof F); +}), 'Array', { + // 22.1.2.3 Array.of( ...items) + of: function of(/* ...args */) { + var index = 0; + var aLen = arguments.length; + var result = new (typeof this == 'function' ? this : Array)(aLen); + while (aLen > index) createProperty(result, index, arguments[index++]); + result.length = aLen; + return result; + } +}); + + +/***/ }), +/* 204 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 22.1.3.13 Array.prototype.join(separator) +var $export = __webpack_require__(0); +var toIObject = __webpack_require__(15); +var arrayJoin = [].join; + +// fallback for not array-like strings +$export($export.P + $export.F * (__webpack_require__(46) != Object || !__webpack_require__(20)(arrayJoin)), 'Array', { + join: function join(separator) { + return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); + } +}); + + +/***/ }), +/* 205 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var html = __webpack_require__(68); +var cof = __webpack_require__(19); +var toAbsoluteIndex = __webpack_require__(35); +var toLength = __webpack_require__(8); +var arraySlice = [].slice; + +// fallback for not array-like ES3 strings and DOM objects +$export($export.P + $export.F * __webpack_require__(3)(function () { + if (html) arraySlice.call(html); +}), 'Array', { + slice: function slice(begin, end) { + var len = toLength(this.length); + var klass = cof(this); + end = end === undefined ? len : end; + if (klass == 'Array') return arraySlice.call(this, begin, end); + var start = toAbsoluteIndex(begin, len); + var upTo = toAbsoluteIndex(end, len); + var size = toLength(upTo - start); + var cloned = new Array(size); + var i = 0; + for (; i < size; i++) cloned[i] = klass == 'String' + ? this.charAt(start + i) + : this[start + i]; + return cloned; + } +}); + + +/***/ }), +/* 206 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var aFunction = __webpack_require__(10); +var toObject = __webpack_require__(9); +var fails = __webpack_require__(3); +var $sort = [].sort; +var test = [1, 2, 3]; + +$export($export.P + $export.F * (fails(function () { + // IE8- + test.sort(undefined); +}) || !fails(function () { + // V8 bug + test.sort(null); + // Old WebKit +}) || !__webpack_require__(20)($sort)), 'Array', { + // 22.1.3.25 Array.prototype.sort(comparefn) + sort: function sort(comparefn) { + return comparefn === undefined + ? $sort.call(toObject(this)) + : $sort.call(toObject(this), aFunction(comparefn)); + } +}); + + +/***/ }), +/* 207 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $forEach = __webpack_require__(25)(0); +var STRICT = __webpack_require__(20)([].forEach, true); + +$export($export.P + $export.F * !STRICT, 'Array', { + // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) + forEach: function forEach(callbackfn /* , thisArg */) { + return $forEach(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), +/* 208 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(4); +var isArray = __webpack_require__(52); +var SPECIES = __webpack_require__(5)('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; +}; + + +/***/ }), +/* 209 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $map = __webpack_require__(25)(1); + +$export($export.P + $export.F * !__webpack_require__(20)([].map, true), 'Array', { + // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) + map: function map(callbackfn /* , thisArg */) { + return $map(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), +/* 210 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $filter = __webpack_require__(25)(2); + +$export($export.P + $export.F * !__webpack_require__(20)([].filter, true), 'Array', { + // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) + filter: function filter(callbackfn /* , thisArg */) { + return $filter(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), +/* 211 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $some = __webpack_require__(25)(3); + +$export($export.P + $export.F * !__webpack_require__(20)([].some, true), 'Array', { + // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) + some: function some(callbackfn /* , thisArg */) { + return $some(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), +/* 212 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $every = __webpack_require__(25)(4); + +$export($export.P + $export.F * !__webpack_require__(20)([].every, true), 'Array', { + // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) + every: function every(callbackfn /* , thisArg */) { + return $every(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), +/* 213 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $reduce = __webpack_require__(105); + +$export($export.P + $export.F * !__webpack_require__(20)([].reduce, true), 'Array', { + // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) + reduce: function reduce(callbackfn /* , initialValue */) { + return $reduce(this, callbackfn, arguments.length, arguments[1], false); + } +}); + + +/***/ }), +/* 214 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $reduce = __webpack_require__(105); + +$export($export.P + $export.F * !__webpack_require__(20)([].reduceRight, true), 'Array', { + // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) + reduceRight: function reduceRight(callbackfn /* , initialValue */) { + return $reduce(this, callbackfn, arguments.length, arguments[1], true); + } +}); + + +/***/ }), +/* 215 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $indexOf = __webpack_require__(50)(false); +var $native = [].indexOf; +var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; + +$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(20)($native)), 'Array', { + // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) + indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { + return NEGATIVE_ZERO + // convert -0 to +0 + ? $native.apply(this, arguments) || 0 + : $indexOf(this, searchElement, arguments[1]); + } +}); + + +/***/ }), +/* 216 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toIObject = __webpack_require__(15); +var toInteger = __webpack_require__(23); +var toLength = __webpack_require__(8); +var $native = [].lastIndexOf; +var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; + +$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(20)($native)), 'Array', { + // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) + lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { + // convert -0 to +0 + if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0; + var O = toIObject(this); + var length = toLength(O.length); + var index = length - 1; + if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1])); + if (index < 0) index = length + index; + for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0; + return -1; + } +}); + + +/***/ }), +/* 217 */ +/***/ (function(module, exports, __webpack_require__) { + +// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) +var $export = __webpack_require__(0); + +$export($export.P, 'Array', { copyWithin: __webpack_require__(106) }); + +__webpack_require__(31)('copyWithin'); + + +/***/ }), +/* 218 */ +/***/ (function(module, exports, __webpack_require__) { + +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) +var $export = __webpack_require__(0); + +$export($export.P, 'Array', { fill: __webpack_require__(84) }); + +__webpack_require__(31)('fill'); + + +/***/ }), +/* 219 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) +var $export = __webpack_require__(0); +var $find = __webpack_require__(25)(5); +var KEY = 'find'; +var forced = true; +// Shouldn't skip holes +if (KEY in []) Array(1)[KEY](function () { forced = false; }); +$export($export.P + $export.F * forced, 'Array', { + find: function find(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); +__webpack_require__(31)(KEY); + + +/***/ }), +/* 220 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) +var $export = __webpack_require__(0); +var $find = __webpack_require__(25)(6); +var KEY = 'findIndex'; +var forced = true; +// Shouldn't skip holes +if (KEY in []) Array(1)[KEY](function () { forced = false; }); +$export($export.P + $export.F * forced, 'Array', { + findIndex: function findIndex(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); +__webpack_require__(31)(KEY); + + +/***/ }), +/* 221 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(38)('Array'); + + +/***/ }), +/* 222 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(2); +var inheritIfRequired = __webpack_require__(70); +var dP = __webpack_require__(7).f; +var gOPN = __webpack_require__(37).f; +var isRegExp = __webpack_require__(53); +var $flags = __webpack_require__(55); +var $RegExp = global.RegExp; +var Base = $RegExp; +var proto = $RegExp.prototype; +var re1 = /a/g; +var re2 = /a/g; +// "new" creates a new object, old webkit buggy here +var CORRECT_NEW = new $RegExp(re1) !== re1; + +if (__webpack_require__(6) && (!CORRECT_NEW || __webpack_require__(3)(function () { + re2[__webpack_require__(5)('match')] = false; + // RegExp constructor can alter flags and IsRegExp works correct with @@match + return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i'; +}))) { + $RegExp = function RegExp(p, f) { + var tiRE = this instanceof $RegExp; + var piRE = isRegExp(p); + var fiU = f === undefined; + return !tiRE && piRE && p.constructor === $RegExp && fiU ? p + : inheritIfRequired(CORRECT_NEW + ? new Base(piRE && !fiU ? p.source : p, f) + : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f) + , tiRE ? this : proto, $RegExp); + }; + var proxy = function (key) { + key in $RegExp || dP($RegExp, key, { + configurable: true, + get: function () { return Base[key]; }, + set: function (it) { Base[key] = it; } + }); + }; + for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]); + proto.constructor = $RegExp; + $RegExp.prototype = proto; + __webpack_require__(12)(global, 'RegExp', $RegExp); +} + +__webpack_require__(38)('RegExp'); + + +/***/ }), +/* 223 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +__webpack_require__(108); +var anObject = __webpack_require__(1); +var $flags = __webpack_require__(55); +var DESCRIPTORS = __webpack_require__(6); +var TO_STRING = 'toString'; +var $toString = /./[TO_STRING]; + +var define = function (fn) { + __webpack_require__(12)(RegExp.prototype, TO_STRING, fn, true); +}; + +// 21.2.5.14 RegExp.prototype.toString() +if (__webpack_require__(3)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) { + define(function toString() { + var R = anObject(this); + return '/'.concat(R.source, '/', + 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined); + }); +// FF44- RegExp#toString has a wrong name +} else if ($toString.name != TO_STRING) { + define(function toString() { + return $toString.call(this); + }); +} + + +/***/ }), +/* 224 */ +/***/ (function(module, exports, __webpack_require__) { + +// @@match logic +__webpack_require__(56)('match', 1, function (defined, MATCH, $match) { + // 21.1.3.11 String.prototype.match(regexp) + return [function match(regexp) { + 'use strict'; + var O = defined(this); + var fn = regexp == undefined ? undefined : regexp[MATCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); + }, $match]; +}); + + +/***/ }), +/* 225 */ +/***/ (function(module, exports, __webpack_require__) { + +// @@replace logic +__webpack_require__(56)('replace', 2, function (defined, REPLACE, $replace) { + // 21.1.3.14 String.prototype.replace(searchValue, replaceValue) + return [function replace(searchValue, replaceValue) { + 'use strict'; + var O = defined(this); + var fn = searchValue == undefined ? undefined : searchValue[REPLACE]; + return fn !== undefined + ? fn.call(searchValue, O, replaceValue) + : $replace.call(String(O), searchValue, replaceValue); + }, $replace]; +}); + + +/***/ }), +/* 226 */ +/***/ (function(module, exports, __webpack_require__) { + +// @@search logic +__webpack_require__(56)('search', 1, function (defined, SEARCH, $search) { + // 21.1.3.15 String.prototype.search(regexp) + return [function search(regexp) { + 'use strict'; + var O = defined(this); + var fn = regexp == undefined ? undefined : regexp[SEARCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); + }, $search]; +}); + + +/***/ }), +/* 227 */ +/***/ (function(module, exports, __webpack_require__) { + +// @@split logic +__webpack_require__(56)('split', 2, function (defined, SPLIT, $split) { + 'use strict'; + var isRegExp = __webpack_require__(53); + var _split = $split; + var $push = [].push; + var $SPLIT = 'split'; + var LENGTH = 'length'; + var LAST_INDEX = 'lastIndex'; + if ( + 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || + 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || + 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || + '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || + '.'[$SPLIT](/()()/)[LENGTH] > 1 || + ''[$SPLIT](/.?/)[LENGTH] + ) { + var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group + // based on es5-shim implementation, need to rework it + $split = function (separator, limit) { + var string = String(this); + if (separator === undefined && limit === 0) return []; + // If `separator` is not a regex, use native split + if (!isRegExp(separator)) return _split.call(string, separator, limit); + var output = []; + var flags = (separator.ignoreCase ? 'i' : '') + + (separator.multiline ? 'm' : '') + + (separator.unicode ? 'u' : '') + + (separator.sticky ? 'y' : ''); + var lastLastIndex = 0; + var splitLimit = limit === undefined ? 4294967295 : limit >>> 0; + // Make `global` and avoid `lastIndex` issues by working with a copy + var separatorCopy = new RegExp(separator.source, flags + 'g'); + var separator2, match, lastIndex, lastLength, i; + // Doesn't need flags gy, but they don't hurt + if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags); + while (match = separatorCopy.exec(string)) { + // `separatorCopy.lastIndex` is not reliable cross-browser + lastIndex = match.index + match[0][LENGTH]; + if (lastIndex > lastLastIndex) { + output.push(string.slice(lastLastIndex, match.index)); + // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG + // eslint-disable-next-line no-loop-func + if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () { + for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined; + }); + if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1)); + lastLength = match[0][LENGTH]; + lastLastIndex = lastIndex; + if (output[LENGTH] >= splitLimit) break; + } + if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop + } + if (lastLastIndex === string[LENGTH]) { + if (lastLength || !separatorCopy.test('')) output.push(''); + } else output.push(string.slice(lastLastIndex)); + return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; + }; + // Chakra, V8 + } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) { + $split = function (separator, limit) { + return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit); + }; + } + // 21.1.3.17 String.prototype.split(separator, limit) + return [function split(separator, limit) { + var O = defined(this); + var fn = separator == undefined ? undefined : separator[SPLIT]; + return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit); + }, $split]; +}); + + +/***/ }), +/* 228 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var LIBRARY = __webpack_require__(30); +var global = __webpack_require__(2); +var ctx = __webpack_require__(18); +var classof = __webpack_require__(48); +var $export = __webpack_require__(0); +var isObject = __webpack_require__(4); +var aFunction = __webpack_require__(10); +var anInstance = __webpack_require__(39); +var forOf = __webpack_require__(40); +var speciesConstructor = __webpack_require__(57); +var task = __webpack_require__(86).set; +var microtask = __webpack_require__(87)(); +var newPromiseCapabilityModule = __webpack_require__(88); +var perform = __webpack_require__(109); +var userAgent = __webpack_require__(58); +var promiseResolve = __webpack_require__(110); +var PROMISE = 'Promise'; +var TypeError = global.TypeError; +var process = global.process; +var versions = process && process.versions; +var v8 = versions && versions.v8 || ''; +var $Promise = global[PROMISE]; +var isNode = classof(process) == 'process'; +var empty = function () { /* empty */ }; +var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; +var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; + +var USE_NATIVE = !!function () { + try { + // correct subclassing with @@species support + var promise = $Promise.resolve(1); + var FakePromise = (promise.constructor = {})[__webpack_require__(5)('species')] = function (exec) { + exec(empty, empty); + }; + // unhandled rejections tracking support, NodeJS Promise without it fails @@species test + return (isNode || typeof PromiseRejectionEvent == 'function') + && promise.then(empty) instanceof FakePromise + // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables + // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 + // we can't detect it synchronously, so just check versions + && v8.indexOf('6.6') !== 0 + && userAgent.indexOf('Chrome/66') === -1; + } catch (e) { /* empty */ } +}(); + +// helpers +var isThenable = function (it) { + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; +}; +var notify = function (promise, isReject) { + if (promise._n) return; + promise._n = true; + var chain = promise._c; + microtask(function () { + var value = promise._v; + var ok = promise._s == 1; + var i = 0; + var run = function (reaction) { + var handler = ok ? reaction.ok : reaction.fail; + var resolve = reaction.resolve; + var reject = reaction.reject; + var domain = reaction.domain; + var result, then, exited; + try { + if (handler) { + if (!ok) { + if (promise._h == 2) onHandleUnhandled(promise); + promise._h = 1; + } + if (handler === true) result = value; + else { + if (domain) domain.enter(); + result = handler(value); // may throw + if (domain) { + domain.exit(); + exited = true; + } + } + if (result === reaction.promise) { + reject(TypeError('Promise-chain cycle')); + } else if (then = isThenable(result)) { + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch (e) { + if (domain && !exited) domain.exit(); + reject(e); + } + }; + while (chain.length > i) run(chain[i++]); // variable length - can't use forEach + promise._c = []; + promise._n = false; + if (isReject && !promise._h) onUnhandled(promise); + }); +}; +var onUnhandled = function (promise) { + task.call(global, function () { + var value = promise._v; + var unhandled = isUnhandled(promise); + var result, handler, console; + if (unhandled) { + result = perform(function () { + if (isNode) { + process.emit('unhandledRejection', value, promise); + } else if (handler = global.onunhandledrejection) { + handler({ promise: promise, reason: value }); + } else if ((console = global.console) && console.error) { + console.error('Unhandled promise rejection', value); + } + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + promise._h = isNode || isUnhandled(promise) ? 2 : 1; + } promise._a = undefined; + if (unhandled && result.e) throw result.v; + }); +}; +var isUnhandled = function (promise) { + return promise._h !== 1 && (promise._a || promise._c).length === 0; +}; +var onHandleUnhandled = function (promise) { + task.call(global, function () { + var handler; + if (isNode) { + process.emit('rejectionHandled', promise); + } else if (handler = global.onrejectionhandled) { + handler({ promise: promise, reason: promise._v }); + } + }); +}; +var $reject = function (value) { + var promise = this; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + promise._v = value; + promise._s = 2; + if (!promise._a) promise._a = promise._c.slice(); + notify(promise, true); +}; +var $resolve = function (value) { + var promise = this; + var then; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + try { + if (promise === value) throw TypeError("Promise can't be resolved itself"); + if (then = isThenable(value)) { + microtask(function () { + var wrapper = { _w: promise, _d: false }; // wrap + try { + then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); + } catch (e) { + $reject.call(wrapper, e); + } + }); + } else { + promise._v = value; + promise._s = 1; + notify(promise, false); + } + } catch (e) { + $reject.call({ _w: promise, _d: false }, e); // wrap + } +}; + +// constructor polyfill +if (!USE_NATIVE) { + // 25.4.3.1 Promise(executor) + $Promise = function Promise(executor) { + anInstance(this, $Promise, PROMISE, '_h'); + aFunction(executor); + Internal.call(this); + try { + executor(ctx($resolve, this, 1), ctx($reject, this, 1)); + } catch (err) { + $reject.call(this, err); + } + }; + // eslint-disable-next-line no-unused-vars + Internal = function Promise(executor) { + this._c = []; // <- awaiting reactions + this._a = undefined; // <- checked in isUnhandled reactions + this._s = 0; // <- state + this._d = false; // <- done + this._v = undefined; // <- value + this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled + this._n = false; // <- notify + }; + Internal.prototype = __webpack_require__(41)($Promise.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected) { + var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = isNode ? process.domain : undefined; + this._c.push(reaction); + if (this._a) this._a.push(reaction); + if (this._s) notify(this, false); + return reaction.promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function (onRejected) { + return this.then(undefined, onRejected); + } + }); + OwnPromiseCapability = function () { + var promise = new Internal(); + this.promise = promise; + this.resolve = ctx($resolve, promise, 1); + this.reject = ctx($reject, promise, 1); + }; + newPromiseCapabilityModule.f = newPromiseCapability = function (C) { + return C === $Promise || C === Wrapper + ? new OwnPromiseCapability(C) + : newGenericPromiseCapability(C); + }; +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); +__webpack_require__(42)($Promise, PROMISE); +__webpack_require__(38)(PROMISE); +Wrapper = __webpack_require__(26)[PROMISE]; + +// statics +$export($export.S + $export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r) { + var capability = newPromiseCapability(this); + var $$reject = capability.reject; + $$reject(r); + return capability.promise; + } +}); +$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x) { + return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); + } +}); +$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(54)(function (iter) { + $Promise.all(iter)['catch'](empty); +})), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var resolve = capability.resolve; + var reject = capability.reject; + var result = perform(function () { + var values = []; + var index = 0; + var remaining = 1; + forOf(iterable, false, function (promise) { + var $index = index++; + var alreadyCalled = false; + values.push(undefined); + remaining++; + C.resolve(promise).then(function (value) { + if (alreadyCalled) return; + alreadyCalled = true; + values[$index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if (result.e) reject(result.v); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var reject = capability.reject; + var result = perform(function () { + forOf(iterable, false, function (promise) { + C.resolve(promise).then(capability.resolve, reject); + }); + }); + if (result.e) reject(result.v); + return capability.promise; + } +}); + + +/***/ }), +/* 229 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var weak = __webpack_require__(115); +var validate = __webpack_require__(45); +var WEAK_SET = 'WeakSet'; + +// 23.4 WeakSet Objects +__webpack_require__(59)(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); + + +/***/ }), +/* 230 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.1 Reflect.apply(target, thisArgument, argumentsList) +var $export = __webpack_require__(0); +var aFunction = __webpack_require__(10); +var anObject = __webpack_require__(1); +var rApply = (__webpack_require__(2).Reflect || {}).apply; +var fApply = Function.apply; +// MS Edge argumentsList argument is optional +$export($export.S + $export.F * !__webpack_require__(3)(function () { + rApply(function () { /* empty */ }); +}), 'Reflect', { + apply: function apply(target, thisArgument, argumentsList) { + var T = aFunction(target); + var L = anObject(argumentsList); + return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); + } +}); + + +/***/ }), +/* 231 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) +var $export = __webpack_require__(0); +var create = __webpack_require__(36); +var aFunction = __webpack_require__(10); +var anObject = __webpack_require__(1); +var isObject = __webpack_require__(4); +var fails = __webpack_require__(3); +var bind = __webpack_require__(96); +var rConstruct = (__webpack_require__(2).Reflect || {}).construct; + +// MS Edge supports only 2 arguments and argumentsList argument is optional +// FF Nightly sets third argument as `new.target`, but does not create `this` from it +var NEW_TARGET_BUG = fails(function () { + function F() { /* empty */ } + return !(rConstruct(function () { /* empty */ }, [], F) instanceof F); +}); +var ARGS_BUG = !fails(function () { + rConstruct(function () { /* empty */ }); +}); + +$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { + construct: function construct(Target, args /* , newTarget */) { + aFunction(Target); + anObject(args); + var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); + if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget); + if (Target == newTarget) { + // w/o altered newTarget, optimization for 0-4 arguments + switch (args.length) { + case 0: return new Target(); + case 1: return new Target(args[0]); + case 2: return new Target(args[0], args[1]); + case 3: return new Target(args[0], args[1], args[2]); + case 4: return new Target(args[0], args[1], args[2], args[3]); + } + // w/o altered newTarget, lot of arguments case + var $args = [null]; + $args.push.apply($args, args); + return new (bind.apply(Target, $args))(); + } + // with altered newTarget, not support built-in constructors + var proto = newTarget.prototype; + var instance = create(isObject(proto) ? proto : Object.prototype); + var result = Function.apply.call(Target, instance, args); + return isObject(result) ? result : instance; + } +}); + + +/***/ }), +/* 232 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) +var dP = __webpack_require__(7); +var $export = __webpack_require__(0); +var anObject = __webpack_require__(1); +var toPrimitive = __webpack_require__(21); + +// MS Edge has broken Reflect.defineProperty - throwing instead of returning false +$export($export.S + $export.F * __webpack_require__(3)(function () { + // eslint-disable-next-line no-undef + Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 }); +}), 'Reflect', { + defineProperty: function defineProperty(target, propertyKey, attributes) { + anObject(target); + propertyKey = toPrimitive(propertyKey, true); + anObject(attributes); + try { + dP.f(target, propertyKey, attributes); + return true; + } catch (e) { + return false; + } + } +}); + + +/***/ }), +/* 233 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.4 Reflect.deleteProperty(target, propertyKey) +var $export = __webpack_require__(0); +var gOPD = __webpack_require__(16).f; +var anObject = __webpack_require__(1); + +$export($export.S, 'Reflect', { + deleteProperty: function deleteProperty(target, propertyKey) { + var desc = gOPD(anObject(target), propertyKey); + return desc && !desc.configurable ? false : delete target[propertyKey]; + } +}); + + +/***/ }), +/* 234 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 26.1.5 Reflect.enumerate(target) +var $export = __webpack_require__(0); +var anObject = __webpack_require__(1); +var Enumerate = function (iterated) { + this._t = anObject(iterated); // target + this._i = 0; // next index + var keys = this._k = []; // keys + var key; + for (key in iterated) keys.push(key); +}; +__webpack_require__(79)(Enumerate, 'Object', function () { + var that = this; + var keys = that._k; + var key; + do { + if (that._i >= keys.length) return { value: undefined, done: true }; + } while (!((key = keys[that._i++]) in that._t)); + return { value: key, done: false }; +}); + +$export($export.S, 'Reflect', { + enumerate: function enumerate(target) { + return new Enumerate(target); + } +}); + + +/***/ }), +/* 235 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.6 Reflect.get(target, propertyKey [, receiver]) +var gOPD = __webpack_require__(16); +var getPrototypeOf = __webpack_require__(17); +var has = __webpack_require__(14); +var $export = __webpack_require__(0); +var isObject = __webpack_require__(4); +var anObject = __webpack_require__(1); + +function get(target, propertyKey /* , receiver */) { + var receiver = arguments.length < 3 ? target : arguments[2]; + var desc, proto; + if (anObject(target) === receiver) return target[propertyKey]; + if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value') + ? desc.value + : desc.get !== undefined + ? desc.get.call(receiver) + : undefined; + if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver); +} + +$export($export.S, 'Reflect', { get: get }); + + +/***/ }), +/* 236 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) +var gOPD = __webpack_require__(16); +var $export = __webpack_require__(0); +var anObject = __webpack_require__(1); + +$export($export.S, 'Reflect', { + getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { + return gOPD.f(anObject(target), propertyKey); + } +}); + + +/***/ }), +/* 237 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.8 Reflect.getPrototypeOf(target) +var $export = __webpack_require__(0); +var getProto = __webpack_require__(17); +var anObject = __webpack_require__(1); + +$export($export.S, 'Reflect', { + getPrototypeOf: function getPrototypeOf(target) { + return getProto(anObject(target)); + } +}); + + +/***/ }), +/* 238 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.9 Reflect.has(target, propertyKey) +var $export = __webpack_require__(0); + +$export($export.S, 'Reflect', { + has: function has(target, propertyKey) { + return propertyKey in target; + } +}); + + +/***/ }), +/* 239 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.10 Reflect.isExtensible(target) +var $export = __webpack_require__(0); +var anObject = __webpack_require__(1); +var $isExtensible = Object.isExtensible; + +$export($export.S, 'Reflect', { + isExtensible: function isExtensible(target) { + anObject(target); + return $isExtensible ? $isExtensible(target) : true; + } +}); + + +/***/ }), +/* 240 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.11 Reflect.ownKeys(target) +var $export = __webpack_require__(0); + +$export($export.S, 'Reflect', { ownKeys: __webpack_require__(116) }); + + +/***/ }), +/* 241 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.12 Reflect.preventExtensions(target) +var $export = __webpack_require__(0); +var anObject = __webpack_require__(1); +var $preventExtensions = Object.preventExtensions; + +$export($export.S, 'Reflect', { + preventExtensions: function preventExtensions(target) { + anObject(target); + try { + if ($preventExtensions) $preventExtensions(target); + return true; + } catch (e) { + return false; + } + } +}); + + +/***/ }), +/* 242 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) +var dP = __webpack_require__(7); +var gOPD = __webpack_require__(16); +var getPrototypeOf = __webpack_require__(17); +var has = __webpack_require__(14); +var $export = __webpack_require__(0); +var createDesc = __webpack_require__(32); +var anObject = __webpack_require__(1); +var isObject = __webpack_require__(4); + +function set(target, propertyKey, V /* , receiver */) { + var receiver = arguments.length < 4 ? target : arguments[3]; + var ownDesc = gOPD.f(anObject(target), propertyKey); + var existingDescriptor, proto; + if (!ownDesc) { + if (isObject(proto = getPrototypeOf(target))) { + return set(proto, propertyKey, V, receiver); + } + ownDesc = createDesc(0); + } + if (has(ownDesc, 'value')) { + if (ownDesc.writable === false || !isObject(receiver)) return false; + if (existingDescriptor = gOPD.f(receiver, propertyKey)) { + if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false; + existingDescriptor.value = V; + dP.f(receiver, propertyKey, existingDescriptor); + } else dP.f(receiver, propertyKey, createDesc(0, V)); + return true; + } + return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); +} + +$export($export.S, 'Reflect', { set: set }); + + +/***/ }), +/* 243 */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.14 Reflect.setPrototypeOf(target, proto) +var $export = __webpack_require__(0); +var setProto = __webpack_require__(69); + +if (setProto) $export($export.S, 'Reflect', { + setPrototypeOf: function setPrototypeOf(target, proto) { + setProto.check(target, proto); + try { + setProto.set(target, proto); + return true; + } catch (e) { + return false; + } + } +}); + + +/***/ }), +/* 244 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.3.3.1 / 15.9.4.4 Date.now() +var $export = __webpack_require__(0); + +$export($export.S, 'Date', { now: function () { return new Date().getTime(); } }); + + +/***/ }), +/* 245 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var toPrimitive = __webpack_require__(21); + +$export($export.P + $export.F * __webpack_require__(3)(function () { + return new Date(NaN).toJSON() !== null + || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; +}), 'Date', { + // eslint-disable-next-line no-unused-vars + toJSON: function toJSON(key) { + var O = toObject(this); + var pv = toPrimitive(O); + return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); + } +}); + + +/***/ }), +/* 246 */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() +var $export = __webpack_require__(0); +var toISOString = __webpack_require__(247); + +// PhantomJS / old WebKit has a broken implementations +$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', { + toISOString: toISOString +}); + + +/***/ }), +/* 247 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() +var fails = __webpack_require__(3); +var getTime = Date.prototype.getTime; +var $toISOString = Date.prototype.toISOString; + +var lz = function (num) { + return num > 9 ? num : '0' + num; +}; + +// PhantomJS / old WebKit has a broken implementations +module.exports = (fails(function () { + return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; +}) || !fails(function () { + $toISOString.call(new Date(NaN)); +})) ? function toISOString() { + if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value'); + var d = this; + var y = d.getUTCFullYear(); + var m = d.getUTCMilliseconds(); + var s = y < 0 ? '-' : y > 9999 ? '+' : ''; + return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + + '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + + 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + + ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; +} : $toISOString; + + +/***/ }), +/* 248 */ +/***/ (function(module, exports, __webpack_require__) { + +var DateProto = Date.prototype; +var INVALID_DATE = 'Invalid Date'; +var TO_STRING = 'toString'; +var $toString = DateProto[TO_STRING]; +var getTime = DateProto.getTime; +if (new Date(NaN) + '' != INVALID_DATE) { + __webpack_require__(12)(DateProto, TO_STRING, function toString() { + var value = getTime.call(this); + // eslint-disable-next-line no-self-compare + return value === value ? $toString.call(this) : INVALID_DATE; + }); +} + + +/***/ }), +/* 249 */ +/***/ (function(module, exports, __webpack_require__) { + +var TO_PRIMITIVE = __webpack_require__(5)('toPrimitive'); +var proto = Date.prototype; + +if (!(TO_PRIMITIVE in proto)) __webpack_require__(11)(proto, TO_PRIMITIVE, __webpack_require__(250)); + + +/***/ }), +/* 250 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var anObject = __webpack_require__(1); +var toPrimitive = __webpack_require__(21); +var NUMBER = 'number'; + +module.exports = function (hint) { + if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint'); + return toPrimitive(anObject(this), hint != NUMBER); +}; + + +/***/ }), +/* 251 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var $typed = __webpack_require__(60); +var buffer = __webpack_require__(89); +var anObject = __webpack_require__(1); +var toAbsoluteIndex = __webpack_require__(35); +var toLength = __webpack_require__(8); +var isObject = __webpack_require__(4); +var ArrayBuffer = __webpack_require__(2).ArrayBuffer; +var speciesConstructor = __webpack_require__(57); +var $ArrayBuffer = buffer.ArrayBuffer; +var $DataView = buffer.DataView; +var $isView = $typed.ABV && ArrayBuffer.isView; +var $slice = $ArrayBuffer.prototype.slice; +var VIEW = $typed.VIEW; +var ARRAY_BUFFER = 'ArrayBuffer'; + +$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer }); + +$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { + // 24.1.3.1 ArrayBuffer.isView(arg) + isView: function isView(it) { + return $isView && $isView(it) || isObject(it) && VIEW in it; + } +}); + +$export($export.P + $export.U + $export.F * __webpack_require__(3)(function () { + return !new $ArrayBuffer(2).slice(1, undefined).byteLength; +}), ARRAY_BUFFER, { + // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) + slice: function slice(start, end) { + if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix + var len = anObject(this).byteLength; + var first = toAbsoluteIndex(start, len); + var fin = toAbsoluteIndex(end === undefined ? len : end, len); + var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first)); + var viewS = new $DataView(this); + var viewT = new $DataView(result); + var index = 0; + while (first < fin) { + viewT.setUint8(index++, viewS.getUint8(first++)); + } return result; + } +}); + +__webpack_require__(38)(ARRAY_BUFFER); + + +/***/ }), +/* 252 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +$export($export.G + $export.W + $export.F * !__webpack_require__(60).ABV, { + DataView: __webpack_require__(89).DataView +}); + + +/***/ }), +/* 253 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(27)('Int8', 1, function (init) { + return function Int8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 254 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(27)('Uint8', 1, function (init) { + return function Uint8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 255 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(27)('Uint8', 1, function (init) { + return function Uint8ClampedArray(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}, true); + + +/***/ }), +/* 256 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(27)('Int16', 2, function (init) { + return function Int16Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 257 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(27)('Uint16', 2, function (init) { + return function Uint16Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 258 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(27)('Int32', 4, function (init) { + return function Int32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 259 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(27)('Uint32', 4, function (init) { + return function Uint32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 260 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(27)('Float32', 4, function (init) { + return function Float32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 261 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(27)('Float64', 8, function (init) { + return function Float64Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), +/* 262 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/tc39/Array.prototype.includes +var $export = __webpack_require__(0); +var $includes = __webpack_require__(50)(true); + +$export($export.P, 'Array', { + includes: function includes(el /* , fromIndex = 0 */) { + return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +__webpack_require__(31)('includes'); + + +/***/ }), +/* 263 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap +var $export = __webpack_require__(0); +var flattenIntoArray = __webpack_require__(118); +var toObject = __webpack_require__(9); +var toLength = __webpack_require__(8); +var aFunction = __webpack_require__(10); +var arraySpeciesCreate = __webpack_require__(83); + +$export($export.P, 'Array', { + flatMap: function flatMap(callbackfn /* , thisArg */) { + var O = toObject(this); + var sourceLen, A; + aFunction(callbackfn); + sourceLen = toLength(O.length); + A = arraySpeciesCreate(O, 0); + flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]); + return A; + } +}); + +__webpack_require__(31)('flatMap'); + + +/***/ }), +/* 264 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten +var $export = __webpack_require__(0); +var flattenIntoArray = __webpack_require__(118); +var toObject = __webpack_require__(9); +var toLength = __webpack_require__(8); +var toInteger = __webpack_require__(23); +var arraySpeciesCreate = __webpack_require__(83); + +$export($export.P, 'Array', { + flatten: function flatten(/* depthArg = 1 */) { + var depthArg = arguments[0]; + var O = toObject(this); + var sourceLen = toLength(O.length); + var A = arraySpeciesCreate(O, 0); + flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg)); + return A; + } +}); + +__webpack_require__(31)('flatten'); + + +/***/ }), +/* 265 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/mathiasbynens/String.prototype.at +var $export = __webpack_require__(0); +var $at = __webpack_require__(75)(true); + +$export($export.P, 'String', { + at: function at(pos) { + return $at(this, pos); + } +}); + + +/***/ }), +/* 266 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/tc39/proposal-string-pad-start-end +var $export = __webpack_require__(0); +var $pad = __webpack_require__(119); +var userAgent = __webpack_require__(58); + +// https://github.com/zloirock/core-js/issues/280 +$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { + padStart: function padStart(maxLength /* , fillString = ' ' */) { + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); + } +}); + + +/***/ }), +/* 267 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/tc39/proposal-string-pad-start-end +var $export = __webpack_require__(0); +var $pad = __webpack_require__(119); +var userAgent = __webpack_require__(58); + +// https://github.com/zloirock/core-js/issues/280 +$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { + padEnd: function padEnd(maxLength /* , fillString = ' ' */) { + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); + } +}); + + +/***/ }), +/* 268 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/sebmarkbage/ecmascript-string-left-right-trim +__webpack_require__(43)('trimLeft', function ($trim) { + return function trimLeft() { + return $trim(this, 1); + }; +}, 'trimStart'); + + +/***/ }), +/* 269 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/sebmarkbage/ecmascript-string-left-right-trim +__webpack_require__(43)('trimRight', function ($trim) { + return function trimRight() { + return $trim(this, 2); + }; +}, 'trimEnd'); + + +/***/ }), +/* 270 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/String.prototype.matchAll/ +var $export = __webpack_require__(0); +var defined = __webpack_require__(22); +var toLength = __webpack_require__(8); +var isRegExp = __webpack_require__(53); +var getFlags = __webpack_require__(55); +var RegExpProto = RegExp.prototype; + +var $RegExpStringIterator = function (regexp, string) { + this._r = regexp; + this._s = string; +}; + +__webpack_require__(79)($RegExpStringIterator, 'RegExp String', function next() { + var match = this._r.exec(this._s); + return { value: match, done: match === null }; +}); + +$export($export.P, 'String', { + matchAll: function matchAll(regexp) { + defined(this); + if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!'); + var S = String(this); + var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp); + var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags); + rx.lastIndex = toLength(regexp.lastIndex); + return new $RegExpStringIterator(rx, S); + } +}); + + +/***/ }), +/* 271 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(65)('asyncIterator'); + + +/***/ }), +/* 272 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(65)('observable'); + + +/***/ }), +/* 273 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-object-getownpropertydescriptors +var $export = __webpack_require__(0); +var ownKeys = __webpack_require__(116); +var toIObject = __webpack_require__(15); +var gOPD = __webpack_require__(16); +var createProperty = __webpack_require__(81); + +$export($export.S, 'Object', { + getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { + var O = toIObject(object); + var getDesc = gOPD.f; + var keys = ownKeys(O); + var result = {}; + var i = 0; + var key, desc; + while (keys.length > i) { + desc = getDesc(O, key = keys[i++]); + if (desc !== undefined) createProperty(result, key, desc); + } + return result; + } +}); + + +/***/ }), +/* 274 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-object-values-entries +var $export = __webpack_require__(0); +var $values = __webpack_require__(120)(false); + +$export($export.S, 'Object', { + values: function values(it) { + return $values(it); + } +}); + + +/***/ }), +/* 275 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-object-values-entries +var $export = __webpack_require__(0); +var $entries = __webpack_require__(120)(true); + +$export($export.S, 'Object', { + entries: function entries(it) { + return $entries(it); + } +}); + + +/***/ }), +/* 276 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var aFunction = __webpack_require__(10); +var $defineProperty = __webpack_require__(7); + +// B.2.2.2 Object.prototype.__defineGetter__(P, getter) +__webpack_require__(6) && $export($export.P + __webpack_require__(61), 'Object', { + __defineGetter__: function __defineGetter__(P, getter) { + $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true }); + } +}); + + +/***/ }), +/* 277 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var aFunction = __webpack_require__(10); +var $defineProperty = __webpack_require__(7); + +// B.2.2.3 Object.prototype.__defineSetter__(P, setter) +__webpack_require__(6) && $export($export.P + __webpack_require__(61), 'Object', { + __defineSetter__: function __defineSetter__(P, setter) { + $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true }); + } +}); + + +/***/ }), +/* 278 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var toPrimitive = __webpack_require__(21); +var getPrototypeOf = __webpack_require__(17); +var getOwnPropertyDescriptor = __webpack_require__(16).f; + +// B.2.2.4 Object.prototype.__lookupGetter__(P) +__webpack_require__(6) && $export($export.P + __webpack_require__(61), 'Object', { + __lookupGetter__: function __lookupGetter__(P) { + var O = toObject(this); + var K = toPrimitive(P, true); + var D; + do { + if (D = getOwnPropertyDescriptor(O, K)) return D.get; + } while (O = getPrototypeOf(O)); + } +}); + + +/***/ }), +/* 279 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(0); +var toObject = __webpack_require__(9); +var toPrimitive = __webpack_require__(21); +var getPrototypeOf = __webpack_require__(17); +var getOwnPropertyDescriptor = __webpack_require__(16).f; + +// B.2.2.5 Object.prototype.__lookupSetter__(P) +__webpack_require__(6) && $export($export.P + __webpack_require__(61), 'Object', { + __lookupSetter__: function __lookupSetter__(P) { + var O = toObject(this); + var K = toPrimitive(P, true); + var D; + do { + if (D = getOwnPropertyDescriptor(O, K)) return D.set; + } while (O = getPrototypeOf(O)); + } +}); + + +/***/ }), +/* 280 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = __webpack_require__(0); + +$export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(121)('Map') }); + + +/***/ }), +/* 281 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = __webpack_require__(0); + +$export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(121)('Set') }); + + +/***/ }), +/* 282 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of +__webpack_require__(62)('Map'); + + +/***/ }), +/* 283 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of +__webpack_require__(62)('Set'); + + +/***/ }), +/* 284 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of +__webpack_require__(62)('WeakMap'); + + +/***/ }), +/* 285 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of +__webpack_require__(62)('WeakSet'); + + +/***/ }), +/* 286 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from +__webpack_require__(63)('Map'); + + +/***/ }), +/* 287 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from +__webpack_require__(63)('Set'); + + +/***/ }), +/* 288 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from +__webpack_require__(63)('WeakMap'); + + +/***/ }), +/* 289 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from +__webpack_require__(63)('WeakSet'); + + +/***/ }), +/* 290 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-global +var $export = __webpack_require__(0); + +$export($export.G, { global: __webpack_require__(2) }); + + +/***/ }), +/* 291 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-global +var $export = __webpack_require__(0); + +$export($export.S, 'System', { global: __webpack_require__(2) }); + + +/***/ }), +/* 292 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/ljharb/proposal-is-error +var $export = __webpack_require__(0); +var cof = __webpack_require__(19); + +$export($export.S, 'Error', { + isError: function isError(it) { + return cof(it) === 'Error'; + } +}); + + +/***/ }), +/* 293 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + clamp: function clamp(x, lower, upper) { + return Math.min(upper, Math.max(lower, x)); + } +}); + + +/***/ }), +/* 294 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 }); + + +/***/ }), +/* 295 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); +var RAD_PER_DEG = 180 / Math.PI; + +$export($export.S, 'Math', { + degrees: function degrees(radians) { + return radians * RAD_PER_DEG; + } +}); + + +/***/ }), +/* 296 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); +var scale = __webpack_require__(123); +var fround = __webpack_require__(103); + +$export($export.S, 'Math', { + fscale: function fscale(x, inLow, inHigh, outLow, outHigh) { + return fround(scale(x, inLow, inHigh, outLow, outHigh)); + } +}); + + +/***/ }), +/* 297 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + iaddh: function iaddh(x0, x1, y0, y1) { + var $x0 = x0 >>> 0; + var $x1 = x1 >>> 0; + var $y0 = y0 >>> 0; + return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; + } +}); + + +/***/ }), +/* 298 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + isubh: function isubh(x0, x1, y0, y1) { + var $x0 = x0 >>> 0; + var $x1 = x1 >>> 0; + var $y0 = y0 >>> 0; + return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; + } +}); + + +/***/ }), +/* 299 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + imulh: function imulh(u, v) { + var UINT16 = 0xffff; + var $u = +u; + var $v = +v; + var u0 = $u & UINT16; + var v0 = $v & UINT16; + var u1 = $u >> 16; + var v1 = $v >> 16; + var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); + } +}); + + +/***/ }), +/* 300 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI }); + + +/***/ }), +/* 301 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); +var DEG_PER_RAD = Math.PI / 180; + +$export($export.S, 'Math', { + radians: function radians(degrees) { + return degrees * DEG_PER_RAD; + } +}); + + +/***/ }), +/* 302 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { scale: __webpack_require__(123) }); + + +/***/ }), +/* 303 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { + umulh: function umulh(u, v) { + var UINT16 = 0xffff; + var $u = +u; + var $v = +v; + var u0 = $u & UINT16; + var v0 = $v & UINT16; + var u1 = $u >>> 16; + var v1 = $v >>> 16; + var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); + } +}); + + +/***/ }), +/* 304 */ +/***/ (function(module, exports, __webpack_require__) { + +// http://jfbastien.github.io/papers/Math.signbit.html +var $export = __webpack_require__(0); + +$export($export.S, 'Math', { signbit: function signbit(x) { + // eslint-disable-next-line no-self-compare + return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0; +} }); + + +/***/ }), +/* 305 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// https://github.com/tc39/proposal-promise-finally + +var $export = __webpack_require__(0); +var core = __webpack_require__(26); +var global = __webpack_require__(2); +var speciesConstructor = __webpack_require__(57); +var promiseResolve = __webpack_require__(110); + +$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { + var C = speciesConstructor(this, core.Promise || global.Promise); + var isFunction = typeof onFinally == 'function'; + return this.then( + isFunction ? function (x) { + return promiseResolve(C, onFinally()).then(function () { return x; }); + } : onFinally, + isFunction ? function (e) { + return promiseResolve(C, onFinally()).then(function () { throw e; }); + } : onFinally + ); +} }); + + +/***/ }), +/* 306 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/tc39/proposal-promise-try +var $export = __webpack_require__(0); +var newPromiseCapability = __webpack_require__(88); +var perform = __webpack_require__(109); + +$export($export.S, 'Promise', { 'try': function (callbackfn) { + var promiseCapability = newPromiseCapability.f(this); + var result = perform(callbackfn); + (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); + return promiseCapability.promise; +} }); + + +/***/ }), +/* 307 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(28); +var anObject = __webpack_require__(1); +var toMetaKey = metadata.key; +var ordinaryDefineOwnMetadata = metadata.set; + +metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) { + ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); +} }); + + +/***/ }), +/* 308 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(28); +var anObject = __webpack_require__(1); +var toMetaKey = metadata.key; +var getOrCreateMetadataMap = metadata.map; +var store = metadata.store; + +metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) { + var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]); + var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); + if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false; + if (metadataMap.size) return true; + var targetMetadata = store.get(target); + targetMetadata['delete'](targetKey); + return !!targetMetadata.size || store['delete'](target); +} }); + + +/***/ }), +/* 309 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(28); +var anObject = __webpack_require__(1); +var getPrototypeOf = __webpack_require__(17); +var ordinaryHasOwnMetadata = metadata.has; +var ordinaryGetOwnMetadata = metadata.get; +var toMetaKey = metadata.key; + +var ordinaryGetMetadata = function (MetadataKey, O, P) { + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P); + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; +}; + +metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) { + return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); + + +/***/ }), +/* 310 */ +/***/ (function(module, exports, __webpack_require__) { + +var Set = __webpack_require__(113); +var from = __webpack_require__(122); +var metadata = __webpack_require__(28); +var anObject = __webpack_require__(1); +var getPrototypeOf = __webpack_require__(17); +var ordinaryOwnMetadataKeys = metadata.keys; +var toMetaKey = metadata.key; + +var ordinaryMetadataKeys = function (O, P) { + var oKeys = ordinaryOwnMetadataKeys(O, P); + var parent = getPrototypeOf(O); + if (parent === null) return oKeys; + var pKeys = ordinaryMetadataKeys(parent, P); + return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys; +}; + +metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) { + return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); +} }); + + +/***/ }), +/* 311 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(28); +var anObject = __webpack_require__(1); +var ordinaryGetOwnMetadata = metadata.get; +var toMetaKey = metadata.key; + +metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) { + return ordinaryGetOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); + + +/***/ }), +/* 312 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(28); +var anObject = __webpack_require__(1); +var ordinaryOwnMetadataKeys = metadata.keys; +var toMetaKey = metadata.key; + +metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) { + return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); +} }); + + +/***/ }), +/* 313 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(28); +var anObject = __webpack_require__(1); +var getPrototypeOf = __webpack_require__(17); +var ordinaryHasOwnMetadata = metadata.has; +var toMetaKey = metadata.key; + +var ordinaryHasMetadata = function (MetadataKey, O, P) { + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) return true; + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; +}; + +metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) { + return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); + + +/***/ }), +/* 314 */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(28); +var anObject = __webpack_require__(1); +var ordinaryHasOwnMetadata = metadata.has; +var toMetaKey = metadata.key; + +metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) { + return ordinaryHasOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); + + +/***/ }), +/* 315 */ +/***/ (function(module, exports, __webpack_require__) { + +var $metadata = __webpack_require__(28); +var anObject = __webpack_require__(1); +var aFunction = __webpack_require__(10); +var toMetaKey = $metadata.key; +var ordinaryDefineOwnMetadata = $metadata.set; + +$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) { + return function decorator(target, targetKey) { + ordinaryDefineOwnMetadata( + metadataKey, metadataValue, + (targetKey !== undefined ? anObject : aFunction)(target), + toMetaKey(targetKey) + ); + }; +} }); + + +/***/ }), +/* 316 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask +var $export = __webpack_require__(0); +var microtask = __webpack_require__(87)(); +var process = __webpack_require__(2).process; +var isNode = __webpack_require__(19)(process) == 'process'; + +$export($export.G, { + asap: function asap(fn) { + var domain = isNode && process.domain; + microtask(domain ? domain.bind(fn) : fn); + } +}); + + +/***/ }), +/* 317 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/zenparsing/es-observable +var $export = __webpack_require__(0); +var global = __webpack_require__(2); +var core = __webpack_require__(26); +var microtask = __webpack_require__(87)(); +var OBSERVABLE = __webpack_require__(5)('observable'); +var aFunction = __webpack_require__(10); +var anObject = __webpack_require__(1); +var anInstance = __webpack_require__(39); +var redefineAll = __webpack_require__(41); +var hide = __webpack_require__(11); +var forOf = __webpack_require__(40); +var RETURN = forOf.RETURN; + +var getMethod = function (fn) { + return fn == null ? undefined : aFunction(fn); +}; + +var cleanupSubscription = function (subscription) { + var cleanup = subscription._c; + if (cleanup) { + subscription._c = undefined; + cleanup(); + } +}; + +var subscriptionClosed = function (subscription) { + return subscription._o === undefined; +}; + +var closeSubscription = function (subscription) { + if (!subscriptionClosed(subscription)) { + subscription._o = undefined; + cleanupSubscription(subscription); + } +}; + +var Subscription = function (observer, subscriber) { + anObject(observer); + this._c = undefined; + this._o = observer; + observer = new SubscriptionObserver(this); + try { + var cleanup = subscriber(observer); + var subscription = cleanup; + if (cleanup != null) { + if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); }; + else aFunction(cleanup); + this._c = cleanup; + } + } catch (e) { + observer.error(e); + return; + } if (subscriptionClosed(this)) cleanupSubscription(this); +}; + +Subscription.prototype = redefineAll({}, { + unsubscribe: function unsubscribe() { closeSubscription(this); } +}); + +var SubscriptionObserver = function (subscription) { + this._s = subscription; +}; + +SubscriptionObserver.prototype = redefineAll({}, { + next: function next(value) { + var subscription = this._s; + if (!subscriptionClosed(subscription)) { + var observer = subscription._o; + try { + var m = getMethod(observer.next); + if (m) return m.call(observer, value); + } catch (e) { + try { + closeSubscription(subscription); + } finally { + throw e; + } + } + } + }, + error: function error(value) { + var subscription = this._s; + if (subscriptionClosed(subscription)) throw value; + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.error); + if (!m) throw value; + value = m.call(observer, value); + } catch (e) { + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + }, + complete: function complete(value) { + var subscription = this._s; + if (!subscriptionClosed(subscription)) { + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.complete); + value = m ? m.call(observer, value) : undefined; + } catch (e) { + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + } + } +}); + +var $Observable = function Observable(subscriber) { + anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber); +}; + +redefineAll($Observable.prototype, { + subscribe: function subscribe(observer) { + return new Subscription(observer, this._f); + }, + forEach: function forEach(fn) { + var that = this; + return new (core.Promise || global.Promise)(function (resolve, reject) { + aFunction(fn); + var subscription = that.subscribe({ + next: function (value) { + try { + return fn(value); + } catch (e) { + reject(e); + subscription.unsubscribe(); + } + }, + error: reject, + complete: resolve + }); + }); + } +}); + +redefineAll($Observable, { + from: function from(x) { + var C = typeof this === 'function' ? this : $Observable; + var method = getMethod(anObject(x)[OBSERVABLE]); + if (method) { + var observable = anObject(method.call(x)); + return observable.constructor === C ? observable : new C(function (observer) { + return observable.subscribe(observer); + }); + } + return new C(function (observer) { + var done = false; + microtask(function () { + if (!done) { + try { + if (forOf(x, false, function (it) { + observer.next(it); + if (done) return RETURN; + }) === RETURN) return; + } catch (e) { + if (done) throw e; + observer.error(e); + return; + } observer.complete(); + } + }); + return function () { done = true; }; + }); + }, + of: function of() { + for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++]; + return new (typeof this === 'function' ? this : $Observable)(function (observer) { + var done = false; + microtask(function () { + if (!done) { + for (var j = 0; j < items.length; ++j) { + observer.next(items[j]); + if (done) return; + } observer.complete(); + } + }); + return function () { done = true; }; + }); + } +}); + +hide($Observable.prototype, OBSERVABLE, function () { return this; }); + +$export($export.G, { Observable: $Observable }); + +__webpack_require__(38)('Observable'); + + +/***/ }), +/* 318 */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(0); +var $task = __webpack_require__(86); +$export($export.G + $export.B, { + setImmediate: $task.set, + clearImmediate: $task.clear +}); + + +/***/ }), +/* 319 */ +/***/ (function(module, exports, __webpack_require__) { + +var $iterators = __webpack_require__(85); +var getKeys = __webpack_require__(34); +var redefine = __webpack_require__(12); +var global = __webpack_require__(2); +var hide = __webpack_require__(11); +var Iterators = __webpack_require__(44); +var wks = __webpack_require__(5); +var ITERATOR = wks('iterator'); +var TO_STRING_TAG = wks('toStringTag'); +var ArrayValues = Iterators.Array; + +var DOMIterables = { + CSSRuleList: true, // TODO: Not spec compliant, should be false. + CSSStyleDeclaration: false, + CSSValueList: false, + ClientRectList: false, + DOMRectList: false, + DOMStringList: false, + DOMTokenList: true, + DataTransferItemList: false, + FileList: false, + HTMLAllCollection: false, + HTMLCollection: false, + HTMLFormElement: false, + HTMLSelectElement: false, + MediaList: true, // TODO: Not spec compliant, should be false. + MimeTypeArray: false, + NamedNodeMap: false, + NodeList: true, + PaintRequestList: false, + Plugin: false, + PluginArray: false, + SVGLengthList: false, + SVGNumberList: false, + SVGPathSegList: false, + SVGPointList: false, + SVGStringList: false, + SVGTransformList: false, + SourceBufferList: false, + StyleSheetList: true, // TODO: Not spec compliant, should be false. + TextTrackCueList: false, + TextTrackList: false, + TouchList: false +}; + +for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) { + var NAME = collections[i]; + var explicit = DOMIterables[NAME]; + var Collection = global[NAME]; + var proto = Collection && Collection.prototype; + var key; + if (proto) { + if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues); + if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); + Iterators[NAME] = ArrayValues; + if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true); + } +} + + +/***/ }), +/* 320 */ +/***/ (function(module, exports, __webpack_require__) { + +// ie9- setTimeout & setInterval additional parameters fix +var global = __webpack_require__(2); +var $export = __webpack_require__(0); +var userAgent = __webpack_require__(58); +var slice = [].slice; +var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check +var wrap = function (set) { + return function (fn, time /* , ...args */) { + var boundArgs = arguments.length > 2; + var args = boundArgs ? slice.call(arguments, 2) : false; + return set(boundArgs ? function () { + // eslint-disable-next-line no-new-func + (typeof fn == 'function' ? fn : Function(fn)).apply(this, args); + } : fn, time); + }; +}; +$export($export.G + $export.B + $export.F * MSIE, { + setTimeout: wrap(global.setTimeout), + setInterval: wrap(global.setInterval) +}); + + +/***/ }) +/******/ ]); +// CommonJS export +if (typeof module != 'undefined' && module.exports) module.exports = __e; +// RequireJS export +else if (typeof define == 'function' && define.amd) define(function () { return __e; }); +// Export to global object +else __g.core = __e; +}(1, 1); \ No newline at end of file diff --git a/node_modules/core-js/client/shim.min.js b/node_modules/core-js/client/shim.min.js new file mode 100644 index 000000000..bc9b13fb8 --- /dev/null +++ b/node_modules/core-js/client/shim.min.js @@ -0,0 +1,10 @@ +/** + * core-js 2.5.7 + * https://github.com/zloirock/core-js + * License: http://rock.mit-license.org + * © 2018 Denis Pushkarev + */ +!function(e,i,Jt){"use strict";!function(r){var e={};function __webpack_require__(t){if(e[t])return e[t].exports;var n=e[t]={i:t,l:!1,exports:{}};return r[t].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}__webpack_require__.m=r,__webpack_require__.c=e,__webpack_require__.d=function(t,n,r){__webpack_require__.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},__webpack_require__.n=function(t){var n=t&&t.__esModule?function getDefault(){return t["default"]}:function getModuleExports(){return t};return __webpack_require__.d(n,"a",n),n},__webpack_require__.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=124)}([function(t,n,r){var v=r(2),g=r(26),y=r(11),d=r(12),_=r(18),b="prototype",S=function(t,n,r){var e,i,o,u,c=t&S.F,f=t&S.G,a=t&S.P,s=t&S.B,l=f?v:t&S.S?v[n]||(v[n]={}):(v[n]||{})[b],h=f?g:g[n]||(g[n]={}),p=h[b]||(h[b]={});for(e in f&&(r=n),r)o=((i=!c&&l&&l[e]!==Jt)?l:r)[e],u=s&&i?_(o,v):a&&"function"==typeof o?_(Function.call,o):o,l&&d(l,e,o,t&S.U),h[e]!=o&&y(h,e,u),a&&p[e]!=o&&(p[e]=o)};v.core=g,S.F=1,S.G=2,S.S=4,S.P=8,S.B=16,S.W=32,S.U=64,S.R=128,t.exports=S},function(t,n,r){var e=r(4);t.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof i&&(i=r)},function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,r){var e=r(49)("wks"),i=r(33),o=r(2).Symbol,u="function"==typeof o;(t.exports=function(t){return e[t]||(e[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=e},function(t,n,r){t.exports=!r(3)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n,r){var i=r(1),o=r(90),u=r(21),c=Object.defineProperty;n.f=r(6)?Object.defineProperty:function defineProperty(t,n,r){if(i(t),n=u(n,!0),i(r),o)try{return c(t,n,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[n]=r.value),t}},function(t,n,r){var e=r(23),i=Math.min;t.exports=function(t){return 0"+i+""};t.exports=function(n,t){var r={};r[n]=t(o),e(e.P+e.F*i(function(){var t=""[n]('"');return t!==t.toLowerCase()||3document.F=Object<\/script>"),t.close(),s=t.F;r--;)delete s[a][u[r]];return s()};t.exports=Object.create||function create(t,n){var r;return null!==t?(f[a]=i(t),r=new f,f[a]=null,r[c]=t):r=s(),n===Jt?r:o(r,n)}},function(t,n,r){var e=r(92),i=r(67).concat("length","prototype");n.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return e(t,i)}},function(t,n,r){var e=r(2),i=r(7),o=r(6),u=r(5)("species");t.exports=function(t){var n=e[t];o&&n&&!n[u]&&i.f(n,u,{configurable:!0,get:function(){return this}})}},function(t,n){t.exports=function(t,n,r,e){if(!(t instanceof n)||e!==Jt&&e in t)throw TypeError(r+": incorrect invocation!");return t}},function(t,n,r){var h=r(18),p=r(104),v=r(80),g=r(1),y=r(8),d=r(82),_={},b={};(n=t.exports=function(t,n,r,e,i){var o,u,c,f,a=i?function(){return t}:d(t),s=h(r,e,n?2:1),l=0;if("function"!=typeof a)throw TypeError(t+" is not iterable!");if(v(a)){for(o=y(t.length);l>>=1)&&(n+=n))1&e&&(r+=n);return r}},function(t,n){t.exports=Math.sign||function sign(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,n){var r=Math.expm1;t.exports=!r||22025.465794806718>1,s=23===n?I(2,-24)-I(2,-77):0,l=0,h=t<0||0===t&&1/t<0?1:0;for((t=F(t))!=t||t===M?(i=t!=t?1:0,e=f):(e=A(k(t)/N),t*(o=I(2,-e))<1&&(e--,o*=2),2<=(t+=1<=e+a?s/o:s*I(2,1-a))*o&&(e++,o/=2),f<=e+a?(i=0,e=f):1<=e+a?(i=(t*o-1)*I(2,n),e+=a):(i=t*I(2,a-1)*I(2,n),e=0));8<=n;u[l++]=255&i,i/=256,n-=8);for(e=e<>1,c=i-7,f=r-1,a=t[f--],s=127&a;for(a>>=7;0>=-c,c+=n;0>8&255]}function packI32(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function packF64(t){return packIEEE754(t,52,8)}function packF32(t){return packIEEE754(t,23,4)}function addGetter(t,n,r){g(t[S],n,{get:function(){return this[r]}})}function get(t,n,r,e){var i=p(+r);if(t[L]>24)},setUint8:function setUint8(t,n){B.call(this,t,n<<24>>24)}},!0)}else x=function ArrayBuffer(t){s(this,x,_);var n=p(t);this._b=y.call(new Array(n),0),this[L]=n},w=function DataView(t,n,r){s(this,w,b),s(t,x,b);var e=t[L],i=l(n);if(i<0||e>24},getUint8:function getUint8(t){return get(this,1,t)[0]},getInt16:function getInt16(t){var n=get(this,2,t,arguments[1]);return(n[1]<<8|n[0])<<16>>16},getUint16:function getUint16(t){var n=get(this,2,t,arguments[1]);return n[1]<<8|n[0]},getInt32:function getInt32(t){return unpackI32(get(this,4,t,arguments[1]))},getUint32:function getUint32(t){return unpackI32(get(this,4,t,arguments[1]))>>>0},getFloat32:function getFloat32(t){return unpackIEEE754(get(this,4,t,arguments[1]),23,4)},getFloat64:function getFloat64(t){return unpackIEEE754(get(this,8,t,arguments[1]),52,8)},setInt8:function setInt8(t,n){set(this,1,t,packI8,n)},setUint8:function setUint8(t,n){set(this,1,t,packI8,n)},setInt16:function setInt16(t,n){set(this,2,t,packI16,n,arguments[2])},setUint16:function setUint16(t,n){set(this,2,t,packI16,n,arguments[2])},setInt32:function setInt32(t,n){set(this,4,t,packI32,n,arguments[2])},setUint32:function setUint32(t,n){set(this,4,t,packI32,n,arguments[2])},setFloat32:function setFloat32(t,n){set(this,4,t,packF32,n,arguments[2])},setFloat64:function setFloat64(t,n){set(this,8,t,packF64,n,arguments[2])}});d(x,_),d(w,b),c(w[S],u.VIEW,!0),n[_]=x,n[b]=w},function(t,n,r){t.exports=!r(6)&&!r(3)(function(){return 7!=Object.defineProperty(r(64)("div"),"a",{get:function(){return 7}}).a})},function(t,n,r){n.f=r(5)},function(t,n,r){var u=r(14),c=r(15),f=r(50)(!1),a=r(66)("IE_PROTO");t.exports=function(t,n){var r,e=c(t),i=0,o=[];for(r in e)r!=a&&u(e,r)&&o.push(r);for(;i>>0||(u.test(r)?16:10))}:e},function(t,n){t.exports=Math.log1p||function log1p(t){return-1e-8<(t=+t)&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,n,r){var o=r(73),e=Math.pow,u=e(2,-52),c=e(2,-23),f=e(2,127)*(2-c),a=e(2,-126);t.exports=Math.fround||function fround(t){var n,r,e=Math.abs(t),i=o(t);return e>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,n,r){var e=r(0),i=Math.exp;e(e.S,"Math",{cosh:function cosh(t){return(i(t=+t)+i(-t))/2}})},function(t,n,r){var e=r(0),i=r(74);e(e.S+e.F*(i!=Math.expm1),"Math",{expm1:i})},function(t,n,r){var e=r(0);e(e.S,"Math",{fround:r(103)})},function(t,n,r){var e=r(0),f=Math.abs;e(e.S,"Math",{hypot:function hypot(t,n){for(var r,e,i=0,o=0,u=arguments.length,c=0;o>>16)*u+o*(r&i>>>16)<<16>>>0)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{log10:function log10(t){return Math.log(t)*Math.LOG10E}})},function(t,n,r){var e=r(0);e(e.S,"Math",{log1p:r(102)})},function(t,n,r){var e=r(0);e(e.S,"Math",{log2:function log2(t){return Math.log(t)/Math.LN2}})},function(t,n,r){var e=r(0);e(e.S,"Math",{sign:r(73)})},function(t,n,r){var e=r(0),i=r(74),o=Math.exp;e(e.S+e.F*r(3)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function sinh(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},function(t,n,r){var e=r(0),i=r(74),o=Math.exp;e(e.S,"Math",{tanh:function tanh(t){var n=i(t=+t),r=i(-t);return n==Infinity?1:r==Infinity?-1:(n-r)/(o(t)+o(-t))}})},function(t,n,r){var e=r(0);e(e.S,"Math",{trunc:function trunc(t){return(0>10),n%1024+56320))}return r.join("")}})},function(t,n,r){var e=r(0),u=r(15),c=r(8);e(e.S,"String",{raw:function raw(t){for(var n=u(t.raw),r=c(n.length),e=arguments.length,i=[],o=0;o>>0,h=new RegExp(t.source,a+"g");for(_||(e=new RegExp("^"+h.source+"$(?!\\s)",a));(i=h.exec(r))&&!(s<(o=i.index+i[0][y])&&(f.push(r.slice(s,i.index)),!_&&1>>0,o=r>>>0;return(n>>>0)+(e>>>0)+((i&o|(i|o)&~(i+o>>>0))>>>31)|0}})},function(t,n,r){var e=r(0);e(e.S,"Math",{isubh:function isubh(t,n,r,e){var i=t>>>0,o=r>>>0;return(n>>>0)-(e>>>0)-((~i&o|~(i^o)&i-o>>>0)>>>31)|0}})},function(t,n,r){var e=r(0);e(e.S,"Math",{imulh:function imulh(t,n){var r=+t,e=+n,i=65535&r,o=65535&e,u=r>>16,c=e>>16,f=(u*o>>>0)+(i*o>>>16);return u*c+(f>>16)+((i*c>>>0)+(65535&f)>>16)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{RAD_PER_DEG:180/Math.PI})},function(t,n,r){var e=r(0),i=Math.PI/180;e(e.S,"Math",{radians:function radians(t){return t*i}})},function(t,n,r){var e=r(0);e(e.S,"Math",{scale:r(123)})},function(t,n,r){var e=r(0);e(e.S,"Math",{umulh:function umulh(t,n){var r=+t,e=+n,i=65535&r,o=65535&e,u=r>>>16,c=e>>>16,f=(u*o>>>0)+(i*o>>>16);return u*c+(f>>>16)+((i*c>>>0)+(65535&f)>>>16)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{signbit:function signbit(t){return(t=+t)!=t?t:0==t?1/t==Infinity:0 2 ? arguments[2] : undefined; + var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); + var inc = 1; + if (from < to && to < from + count) { + inc = -1; + from += count - 1; + to += count - 1; + } + while (count-- > 0) { + if (from in O) O[to] = O[from]; + else delete O[to]; + to += inc; + from += inc; + } return O; +}; diff --git a/node_modules/core-js/library/modules/_array-fill.js b/node_modules/core-js/library/modules/_array-fill.js new file mode 100644 index 000000000..0753c36ac --- /dev/null +++ b/node_modules/core-js/library/modules/_array-fill.js @@ -0,0 +1,15 @@ +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) +'use strict'; +var toObject = require('./_to-object'); +var toAbsoluteIndex = require('./_to-absolute-index'); +var toLength = require('./_to-length'); +module.exports = function fill(value /* , start = 0, end = @length */) { + var O = toObject(this); + var length = toLength(O.length); + var aLen = arguments.length; + var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); + var end = aLen > 2 ? arguments[2] : undefined; + var endPos = end === undefined ? length : toAbsoluteIndex(end, length); + while (endPos > index) O[index++] = value; + return O; +}; diff --git a/node_modules/core-js/library/modules/_array-from-iterable.js b/node_modules/core-js/library/modules/_array-from-iterable.js new file mode 100644 index 000000000..08be255f0 --- /dev/null +++ b/node_modules/core-js/library/modules/_array-from-iterable.js @@ -0,0 +1,7 @@ +var forOf = require('./_for-of'); + +module.exports = function (iter, ITERATOR) { + var result = []; + forOf(iter, false, result.push, result, ITERATOR); + return result; +}; diff --git a/node_modules/core-js/library/modules/_array-includes.js b/node_modules/core-js/library/modules/_array-includes.js new file mode 100644 index 000000000..0ef3efebe --- /dev/null +++ b/node_modules/core-js/library/modules/_array-includes.js @@ -0,0 +1,23 @@ +// false -> Array#indexOf +// true -> Array#includes +var toIObject = require('./_to-iobject'); +var toLength = require('./_to-length'); +var toAbsoluteIndex = require('./_to-absolute-index'); +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; + }; +}; diff --git a/node_modules/core-js/library/modules/_array-methods.js b/node_modules/core-js/library/modules/_array-methods.js new file mode 100644 index 000000000..ae7f447da --- /dev/null +++ b/node_modules/core-js/library/modules/_array-methods.js @@ -0,0 +1,44 @@ +// 0 -> Array#forEach +// 1 -> Array#map +// 2 -> Array#filter +// 3 -> Array#some +// 4 -> Array#every +// 5 -> Array#find +// 6 -> Array#findIndex +var ctx = require('./_ctx'); +var IObject = require('./_iobject'); +var toObject = require('./_to-object'); +var toLength = require('./_to-length'); +var asc = require('./_array-species-create'); +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; + }; +}; diff --git a/node_modules/core-js/library/modules/_array-reduce.js b/node_modules/core-js/library/modules/_array-reduce.js new file mode 100644 index 000000000..8596ac70a --- /dev/null +++ b/node_modules/core-js/library/modules/_array-reduce.js @@ -0,0 +1,28 @@ +var aFunction = require('./_a-function'); +var toObject = require('./_to-object'); +var IObject = require('./_iobject'); +var toLength = require('./_to-length'); + +module.exports = function (that, callbackfn, aLen, memo, isRight) { + aFunction(callbackfn); + var O = toObject(that); + var self = IObject(O); + var length = toLength(O.length); + var index = isRight ? length - 1 : 0; + var i = isRight ? -1 : 1; + if (aLen < 2) for (;;) { + if (index in self) { + memo = self[index]; + index += i; + break; + } + index += i; + if (isRight ? index < 0 : length <= index) { + throw TypeError('Reduce of empty array with no initial value'); + } + } + for (;isRight ? index >= 0 : length > index; index += i) if (index in self) { + memo = callbackfn(memo, self[index], index, O); + } + return memo; +}; diff --git a/node_modules/core-js/library/modules/_array-species-constructor.js b/node_modules/core-js/library/modules/_array-species-constructor.js new file mode 100644 index 000000000..0771c236d --- /dev/null +++ b/node_modules/core-js/library/modules/_array-species-constructor.js @@ -0,0 +1,16 @@ +var isObject = require('./_is-object'); +var isArray = require('./_is-array'); +var SPECIES = require('./_wks')('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; +}; diff --git a/node_modules/core-js/library/modules/_array-species-create.js b/node_modules/core-js/library/modules/_array-species-create.js new file mode 100644 index 000000000..36ed58bd7 --- /dev/null +++ b/node_modules/core-js/library/modules/_array-species-create.js @@ -0,0 +1,6 @@ +// 9.4.2.3 ArraySpeciesCreate(originalArray, length) +var speciesConstructor = require('./_array-species-constructor'); + +module.exports = function (original, length) { + return new (speciesConstructor(original))(length); +}; diff --git a/node_modules/core-js/library/modules/_bind.js b/node_modules/core-js/library/modules/_bind.js new file mode 100644 index 000000000..3cf1e5ae5 --- /dev/null +++ b/node_modules/core-js/library/modules/_bind.js @@ -0,0 +1,25 @@ +'use strict'; +var aFunction = require('./_a-function'); +var isObject = require('./_is-object'); +var invoke = require('./_invoke'); +var arraySlice = [].slice; +var factories = {}; + +var construct = function (F, len, args) { + if (!(len in factories)) { + for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']'; + // eslint-disable-next-line no-new-func + factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); + } return factories[len](F, args); +}; + +module.exports = Function.bind || function bind(that /* , ...args */) { + var fn = aFunction(this); + var partArgs = arraySlice.call(arguments, 1); + var bound = function (/* args... */) { + var args = partArgs.concat(arraySlice.call(arguments)); + return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); + }; + if (isObject(fn.prototype)) bound.prototype = fn.prototype; + return bound; +}; diff --git a/node_modules/core-js/library/modules/_classof.js b/node_modules/core-js/library/modules/_classof.js new file mode 100644 index 000000000..d106d5be6 --- /dev/null +++ b/node_modules/core-js/library/modules/_classof.js @@ -0,0 +1,23 @@ +// getting tag from 19.1.3.6 Object.prototype.toString() +var cof = require('./_cof'); +var TAG = require('./_wks')('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; +}; diff --git a/node_modules/core-js/library/modules/_cof.js b/node_modules/core-js/library/modules/_cof.js new file mode 100644 index 000000000..332c0bc0b --- /dev/null +++ b/node_modules/core-js/library/modules/_cof.js @@ -0,0 +1,5 @@ +var toString = {}.toString; + +module.exports = function (it) { + return toString.call(it).slice(8, -1); +}; diff --git a/node_modules/core-js/library/modules/_collection-strong.js b/node_modules/core-js/library/modules/_collection-strong.js new file mode 100644 index 000000000..68ce63f0e --- /dev/null +++ b/node_modules/core-js/library/modules/_collection-strong.js @@ -0,0 +1,144 @@ +'use strict'; +var dP = require('./_object-dp').f; +var create = require('./_object-create'); +var redefineAll = require('./_redefine-all'); +var ctx = require('./_ctx'); +var anInstance = require('./_an-instance'); +var forOf = require('./_for-of'); +var $iterDefine = require('./_iter-define'); +var step = require('./_iter-step'); +var setSpecies = require('./_set-species'); +var DESCRIPTORS = require('./_descriptors'); +var fastKey = require('./_meta').fastKey; +var validate = require('./_validate-collection'); +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); + } +}; diff --git a/node_modules/core-js/library/modules/_collection-to-json.js b/node_modules/core-js/library/modules/_collection-to-json.js new file mode 100644 index 000000000..a6ee0029a --- /dev/null +++ b/node_modules/core-js/library/modules/_collection-to-json.js @@ -0,0 +1,9 @@ +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var classof = require('./_classof'); +var from = require('./_array-from-iterable'); +module.exports = function (NAME) { + return function toJSON() { + if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); + return from(this); + }; +}; diff --git a/node_modules/core-js/library/modules/_collection-weak.js b/node_modules/core-js/library/modules/_collection-weak.js new file mode 100644 index 000000000..04d3af5af --- /dev/null +++ b/node_modules/core-js/library/modules/_collection-weak.js @@ -0,0 +1,85 @@ +'use strict'; +var redefineAll = require('./_redefine-all'); +var getWeak = require('./_meta').getWeak; +var anObject = require('./_an-object'); +var isObject = require('./_is-object'); +var anInstance = require('./_an-instance'); +var forOf = require('./_for-of'); +var createArrayMethod = require('./_array-methods'); +var $has = require('./_has'); +var validate = require('./_validate-collection'); +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 +}; diff --git a/node_modules/core-js/library/modules/_collection.js b/node_modules/core-js/library/modules/_collection.js new file mode 100644 index 000000000..31a36b87a --- /dev/null +++ b/node_modules/core-js/library/modules/_collection.js @@ -0,0 +1,59 @@ +'use strict'; +var global = require('./_global'); +var $export = require('./_export'); +var meta = require('./_meta'); +var fails = require('./_fails'); +var hide = require('./_hide'); +var redefineAll = require('./_redefine-all'); +var forOf = require('./_for-of'); +var anInstance = require('./_an-instance'); +var isObject = require('./_is-object'); +var setToStringTag = require('./_set-to-string-tag'); +var dP = require('./_object-dp').f; +var each = require('./_array-methods')(0); +var DESCRIPTORS = require('./_descriptors'); + +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; +}; diff --git a/node_modules/core-js/library/modules/_core.js b/node_modules/core-js/library/modules/_core.js new file mode 100644 index 000000000..c61ad5100 --- /dev/null +++ b/node_modules/core-js/library/modules/_core.js @@ -0,0 +1,2 @@ +var core = module.exports = { version: '2.5.7' }; +if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef diff --git a/node_modules/core-js/library/modules/_create-property.js b/node_modules/core-js/library/modules/_create-property.js new file mode 100644 index 000000000..fd0ea8c9a --- /dev/null +++ b/node_modules/core-js/library/modules/_create-property.js @@ -0,0 +1,8 @@ +'use strict'; +var $defineProperty = require('./_object-dp'); +var createDesc = require('./_property-desc'); + +module.exports = function (object, index, value) { + if (index in object) $defineProperty.f(object, index, createDesc(0, value)); + else object[index] = value; +}; diff --git a/node_modules/core-js/library/modules/_ctx.js b/node_modules/core-js/library/modules/_ctx.js new file mode 100644 index 000000000..0a100ff3d --- /dev/null +++ b/node_modules/core-js/library/modules/_ctx.js @@ -0,0 +1,20 @@ +// optional / simple context binding +var aFunction = require('./_a-function'); +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); + }; +}; diff --git a/node_modules/core-js/library/modules/_date-to-iso-string.js b/node_modules/core-js/library/modules/_date-to-iso-string.js new file mode 100644 index 000000000..95a02e224 --- /dev/null +++ b/node_modules/core-js/library/modules/_date-to-iso-string.js @@ -0,0 +1,26 @@ +'use strict'; +// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() +var fails = require('./_fails'); +var getTime = Date.prototype.getTime; +var $toISOString = Date.prototype.toISOString; + +var lz = function (num) { + return num > 9 ? num : '0' + num; +}; + +// PhantomJS / old WebKit has a broken implementations +module.exports = (fails(function () { + return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; +}) || !fails(function () { + $toISOString.call(new Date(NaN)); +})) ? function toISOString() { + if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value'); + var d = this; + var y = d.getUTCFullYear(); + var m = d.getUTCMilliseconds(); + var s = y < 0 ? '-' : y > 9999 ? '+' : ''; + return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + + '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + + 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + + ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; +} : $toISOString; diff --git a/node_modules/core-js/library/modules/_date-to-primitive.js b/node_modules/core-js/library/modules/_date-to-primitive.js new file mode 100644 index 000000000..57c32030c --- /dev/null +++ b/node_modules/core-js/library/modules/_date-to-primitive.js @@ -0,0 +1,9 @@ +'use strict'; +var anObject = require('./_an-object'); +var toPrimitive = require('./_to-primitive'); +var NUMBER = 'number'; + +module.exports = function (hint) { + if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint'); + return toPrimitive(anObject(this), hint != NUMBER); +}; diff --git a/node_modules/core-js/library/modules/_defined.js b/node_modules/core-js/library/modules/_defined.js new file mode 100644 index 000000000..66c7ed323 --- /dev/null +++ b/node_modules/core-js/library/modules/_defined.js @@ -0,0 +1,5 @@ +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; +}; diff --git a/node_modules/core-js/library/modules/_descriptors.js b/node_modules/core-js/library/modules/_descriptors.js new file mode 100644 index 000000000..046974066 --- /dev/null +++ b/node_modules/core-js/library/modules/_descriptors.js @@ -0,0 +1,4 @@ +// Thank's IE8 for his funny defineProperty +module.exports = !require('./_fails')(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; +}); diff --git a/node_modules/core-js/library/modules/_dom-create.js b/node_modules/core-js/library/modules/_dom-create.js new file mode 100644 index 000000000..39ca2569d --- /dev/null +++ b/node_modules/core-js/library/modules/_dom-create.js @@ -0,0 +1,7 @@ +var isObject = require('./_is-object'); +var document = require('./_global').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) : {}; +}; diff --git a/node_modules/core-js/library/modules/_entry-virtual.js b/node_modules/core-js/library/modules/_entry-virtual.js new file mode 100644 index 000000000..7a734390a --- /dev/null +++ b/node_modules/core-js/library/modules/_entry-virtual.js @@ -0,0 +1,5 @@ +var core = require('./_core'); +module.exports = function (CONSTRUCTOR) { + var C = core[CONSTRUCTOR]; + return (C.virtual || C.prototype); +}; diff --git a/node_modules/core-js/library/modules/_enum-bug-keys.js b/node_modules/core-js/library/modules/_enum-bug-keys.js new file mode 100644 index 000000000..d9ad85514 --- /dev/null +++ b/node_modules/core-js/library/modules/_enum-bug-keys.js @@ -0,0 +1,4 @@ +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); diff --git a/node_modules/core-js/library/modules/_enum-keys.js b/node_modules/core-js/library/modules/_enum-keys.js new file mode 100644 index 000000000..3e7053d13 --- /dev/null +++ b/node_modules/core-js/library/modules/_enum-keys.js @@ -0,0 +1,15 @@ +// all enumerable object keys, includes symbols +var getKeys = require('./_object-keys'); +var gOPS = require('./_object-gops'); +var pIE = require('./_object-pie'); +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; +}; diff --git a/node_modules/core-js/library/modules/_export.js b/node_modules/core-js/library/modules/_export.js new file mode 100644 index 000000000..02bddc0aa --- /dev/null +++ b/node_modules/core-js/library/modules/_export.js @@ -0,0 +1,62 @@ +var global = require('./_global'); +var core = require('./_core'); +var ctx = require('./_ctx'); +var hide = require('./_hide'); +var has = require('./_has'); +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; diff --git a/node_modules/core-js/library/modules/_fails-is-regexp.js b/node_modules/core-js/library/modules/_fails-is-regexp.js new file mode 100644 index 000000000..8eec2e471 --- /dev/null +++ b/node_modules/core-js/library/modules/_fails-is-regexp.js @@ -0,0 +1,12 @@ +var MATCH = require('./_wks')('match'); +module.exports = function (KEY) { + var re = /./; + try { + '/./'[KEY](re); + } catch (e) { + try { + re[MATCH] = false; + return !'/./'[KEY](re); + } catch (f) { /* empty */ } + } return true; +}; diff --git a/node_modules/core-js/library/modules/_fails.js b/node_modules/core-js/library/modules/_fails.js new file mode 100644 index 000000000..3b4cdf674 --- /dev/null +++ b/node_modules/core-js/library/modules/_fails.js @@ -0,0 +1,7 @@ +module.exports = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } +}; diff --git a/node_modules/core-js/library/modules/_fix-re-wks.js b/node_modules/core-js/library/modules/_fix-re-wks.js new file mode 100644 index 000000000..9a62380b3 --- /dev/null +++ b/node_modules/core-js/library/modules/_fix-re-wks.js @@ -0,0 +1,28 @@ +'use strict'; +var hide = require('./_hide'); +var redefine = require('./_redefine'); +var fails = require('./_fails'); +var defined = require('./_defined'); +var wks = require('./_wks'); + +module.exports = function (KEY, length, exec) { + var SYMBOL = wks(KEY); + var fns = exec(defined, SYMBOL, ''[KEY]); + var strfn = fns[0]; + var rxfn = fns[1]; + if (fails(function () { + var O = {}; + O[SYMBOL] = function () { return 7; }; + return ''[KEY](O) != 7; + })) { + redefine(String.prototype, KEY, strfn); + hide(RegExp.prototype, SYMBOL, length == 2 + // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) + // 21.2.5.11 RegExp.prototype[@@split](string, limit) + ? function (string, arg) { return rxfn.call(string, this, arg); } + // 21.2.5.6 RegExp.prototype[@@match](string) + // 21.2.5.9 RegExp.prototype[@@search](string) + : function (string) { return rxfn.call(string, this); } + ); + } +}; diff --git a/node_modules/core-js/library/modules/_flags.js b/node_modules/core-js/library/modules/_flags.js new file mode 100644 index 000000000..b6fc324bd --- /dev/null +++ b/node_modules/core-js/library/modules/_flags.js @@ -0,0 +1,13 @@ +'use strict'; +// 21.2.5.3 get RegExp.prototype.flags +var anObject = require('./_an-object'); +module.exports = function () { + var that = anObject(this); + var result = ''; + if (that.global) result += 'g'; + if (that.ignoreCase) result += 'i'; + if (that.multiline) result += 'm'; + if (that.unicode) result += 'u'; + if (that.sticky) result += 'y'; + return result; +}; diff --git a/node_modules/core-js/library/modules/_flatten-into-array.js b/node_modules/core-js/library/modules/_flatten-into-array.js new file mode 100644 index 000000000..1838517ae --- /dev/null +++ b/node_modules/core-js/library/modules/_flatten-into-array.js @@ -0,0 +1,39 @@ +'use strict'; +// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray +var isArray = require('./_is-array'); +var isObject = require('./_is-object'); +var toLength = require('./_to-length'); +var ctx = require('./_ctx'); +var IS_CONCAT_SPREADABLE = require('./_wks')('isConcatSpreadable'); + +function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) { + var targetIndex = start; + var sourceIndex = 0; + var mapFn = mapper ? ctx(mapper, thisArg, 3) : false; + var element, spreadable; + + while (sourceIndex < sourceLen) { + if (sourceIndex in source) { + element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; + + spreadable = false; + if (isObject(element)) { + spreadable = element[IS_CONCAT_SPREADABLE]; + spreadable = spreadable !== undefined ? !!spreadable : isArray(element); + } + + if (spreadable && depth > 0) { + targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1; + } else { + if (targetIndex >= 0x1fffffffffffff) throw TypeError(); + target[targetIndex] = element; + } + + targetIndex++; + } + sourceIndex++; + } + return targetIndex; +} + +module.exports = flattenIntoArray; diff --git a/node_modules/core-js/library/modules/_for-of.js b/node_modules/core-js/library/modules/_for-of.js new file mode 100644 index 000000000..9ed22818b --- /dev/null +++ b/node_modules/core-js/library/modules/_for-of.js @@ -0,0 +1,25 @@ +var ctx = require('./_ctx'); +var call = require('./_iter-call'); +var isArrayIter = require('./_is-array-iter'); +var anObject = require('./_an-object'); +var toLength = require('./_to-length'); +var getIterFn = require('./core.get-iterator-method'); +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; diff --git a/node_modules/core-js/library/modules/_global.js b/node_modules/core-js/library/modules/_global.js new file mode 100644 index 000000000..bf85b44a1 --- /dev/null +++ b/node_modules/core-js/library/modules/_global.js @@ -0,0 +1,6 @@ +// 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 diff --git a/node_modules/core-js/library/modules/_has.js b/node_modules/core-js/library/modules/_has.js new file mode 100644 index 000000000..2a37d8b7a --- /dev/null +++ b/node_modules/core-js/library/modules/_has.js @@ -0,0 +1,4 @@ +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function (it, key) { + return hasOwnProperty.call(it, key); +}; diff --git a/node_modules/core-js/library/modules/_hide.js b/node_modules/core-js/library/modules/_hide.js new file mode 100644 index 000000000..cec258a0a --- /dev/null +++ b/node_modules/core-js/library/modules/_hide.js @@ -0,0 +1,8 @@ +var dP = require('./_object-dp'); +var createDesc = require('./_property-desc'); +module.exports = require('./_descriptors') ? function (object, key, value) { + return dP.f(object, key, createDesc(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; +}; diff --git a/node_modules/core-js/library/modules/_html.js b/node_modules/core-js/library/modules/_html.js new file mode 100644 index 000000000..7daff14ca --- /dev/null +++ b/node_modules/core-js/library/modules/_html.js @@ -0,0 +1,2 @@ +var document = require('./_global').document; +module.exports = document && document.documentElement; diff --git a/node_modules/core-js/library/modules/_ie8-dom-define.js b/node_modules/core-js/library/modules/_ie8-dom-define.js new file mode 100644 index 000000000..a3805cb7f --- /dev/null +++ b/node_modules/core-js/library/modules/_ie8-dom-define.js @@ -0,0 +1,3 @@ +module.exports = !require('./_descriptors') && !require('./_fails')(function () { + return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7; +}); diff --git a/node_modules/core-js/library/modules/_inherit-if-required.js b/node_modules/core-js/library/modules/_inherit-if-required.js new file mode 100644 index 000000000..b95fcd984 --- /dev/null +++ b/node_modules/core-js/library/modules/_inherit-if-required.js @@ -0,0 +1,9 @@ +var isObject = require('./_is-object'); +var setPrototypeOf = require('./_set-proto').set; +module.exports = function (that, target, C) { + var S = target.constructor; + var P; + if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { + setPrototypeOf(that, P); + } return that; +}; diff --git a/node_modules/core-js/library/modules/_invoke.js b/node_modules/core-js/library/modules/_invoke.js new file mode 100644 index 000000000..6cccebdc1 --- /dev/null +++ b/node_modules/core-js/library/modules/_invoke.js @@ -0,0 +1,16 @@ +// fast apply, http://jsperf.lnkit.com/fast-apply/5 +module.exports = function (fn, args, that) { + var un = that === undefined; + switch (args.length) { + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); +}; diff --git a/node_modules/core-js/library/modules/_iobject.js b/node_modules/core-js/library/modules/_iobject.js new file mode 100644 index 000000000..2b57c8a07 --- /dev/null +++ b/node_modules/core-js/library/modules/_iobject.js @@ -0,0 +1,6 @@ +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = require('./_cof'); +// eslint-disable-next-line no-prototype-builtins +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { + return cof(it) == 'String' ? it.split('') : Object(it); +}; diff --git a/node_modules/core-js/library/modules/_is-array-iter.js b/node_modules/core-js/library/modules/_is-array-iter.js new file mode 100644 index 000000000..6f67d9052 --- /dev/null +++ b/node_modules/core-js/library/modules/_is-array-iter.js @@ -0,0 +1,8 @@ +// check on default Array iterator +var Iterators = require('./_iterators'); +var ITERATOR = require('./_wks')('iterator'); +var ArrayProto = Array.prototype; + +module.exports = function (it) { + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); +}; diff --git a/node_modules/core-js/library/modules/_is-array.js b/node_modules/core-js/library/modules/_is-array.js new file mode 100644 index 000000000..0581dc2e7 --- /dev/null +++ b/node_modules/core-js/library/modules/_is-array.js @@ -0,0 +1,5 @@ +// 7.2.2 IsArray(argument) +var cof = require('./_cof'); +module.exports = Array.isArray || function isArray(arg) { + return cof(arg) == 'Array'; +}; diff --git a/node_modules/core-js/library/modules/_is-integer.js b/node_modules/core-js/library/modules/_is-integer.js new file mode 100644 index 000000000..0074ae975 --- /dev/null +++ b/node_modules/core-js/library/modules/_is-integer.js @@ -0,0 +1,6 @@ +// 20.1.2.3 Number.isInteger(number) +var isObject = require('./_is-object'); +var floor = Math.floor; +module.exports = function isInteger(it) { + return !isObject(it) && isFinite(it) && floor(it) === it; +}; diff --git a/node_modules/core-js/library/modules/_is-object.js b/node_modules/core-js/library/modules/_is-object.js new file mode 100644 index 000000000..dda6e04d2 --- /dev/null +++ b/node_modules/core-js/library/modules/_is-object.js @@ -0,0 +1,3 @@ +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; diff --git a/node_modules/core-js/library/modules/_is-regexp.js b/node_modules/core-js/library/modules/_is-regexp.js new file mode 100644 index 000000000..598d159d5 --- /dev/null +++ b/node_modules/core-js/library/modules/_is-regexp.js @@ -0,0 +1,8 @@ +// 7.2.8 IsRegExp(argument) +var isObject = require('./_is-object'); +var cof = require('./_cof'); +var MATCH = require('./_wks')('match'); +module.exports = function (it) { + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); +}; diff --git a/node_modules/core-js/library/modules/_iter-call.js b/node_modules/core-js/library/modules/_iter-call.js new file mode 100644 index 000000000..a7026e347 --- /dev/null +++ b/node_modules/core-js/library/modules/_iter-call.js @@ -0,0 +1,12 @@ +// call something on iterator step with safe closing on error +var anObject = require('./_an-object'); +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; + } +}; diff --git a/node_modules/core-js/library/modules/_iter-create.js b/node_modules/core-js/library/modules/_iter-create.js new file mode 100644 index 000000000..04708c83c --- /dev/null +++ b/node_modules/core-js/library/modules/_iter-create.js @@ -0,0 +1,13 @@ +'use strict'; +var create = require('./_object-create'); +var descriptor = require('./_property-desc'); +var setToStringTag = require('./_set-to-string-tag'); +var IteratorPrototype = {}; + +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +require('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; }); + +module.exports = function (Constructor, NAME, next) { + Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); + setToStringTag(Constructor, NAME + ' Iterator'); +}; diff --git a/node_modules/core-js/library/modules/_iter-define.js b/node_modules/core-js/library/modules/_iter-define.js new file mode 100644 index 000000000..578dfb734 --- /dev/null +++ b/node_modules/core-js/library/modules/_iter-define.js @@ -0,0 +1,69 @@ +'use strict'; +var LIBRARY = require('./_library'); +var $export = require('./_export'); +var redefine = require('./_redefine'); +var hide = require('./_hide'); +var Iterators = require('./_iterators'); +var $iterCreate = require('./_iter-create'); +var setToStringTag = require('./_set-to-string-tag'); +var getPrototypeOf = require('./_object-gpo'); +var ITERATOR = require('./_wks')('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; +}; diff --git a/node_modules/core-js/library/modules/_iter-detect.js b/node_modules/core-js/library/modules/_iter-detect.js new file mode 100644 index 000000000..5cb34973c --- /dev/null +++ b/node_modules/core-js/library/modules/_iter-detect.js @@ -0,0 +1,22 @@ +var ITERATOR = require('./_wks')('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; +}; diff --git a/node_modules/core-js/library/modules/_iter-step.js b/node_modules/core-js/library/modules/_iter-step.js new file mode 100644 index 000000000..b0691c883 --- /dev/null +++ b/node_modules/core-js/library/modules/_iter-step.js @@ -0,0 +1,3 @@ +module.exports = function (done, value) { + return { value: value, done: !!done }; +}; diff --git a/node_modules/core-js/library/modules/_iterators.js b/node_modules/core-js/library/modules/_iterators.js new file mode 100644 index 000000000..f053ebf79 --- /dev/null +++ b/node_modules/core-js/library/modules/_iterators.js @@ -0,0 +1 @@ +module.exports = {}; diff --git a/node_modules/core-js/library/modules/_keyof.js b/node_modules/core-js/library/modules/_keyof.js new file mode 100644 index 000000000..0786096fd --- /dev/null +++ b/node_modules/core-js/library/modules/_keyof.js @@ -0,0 +1,10 @@ +var getKeys = require('./_object-keys'); +var toIObject = require('./_to-iobject'); +module.exports = function (object, el) { + var O = toIObject(object); + var keys = getKeys(O); + var length = keys.length; + var index = 0; + var key; + while (length > index) if (O[key = keys[index++]] === el) return key; +}; diff --git a/node_modules/core-js/library/modules/_library.js b/node_modules/core-js/library/modules/_library.js new file mode 100644 index 000000000..ec01c2c14 --- /dev/null +++ b/node_modules/core-js/library/modules/_library.js @@ -0,0 +1 @@ +module.exports = true; diff --git a/node_modules/core-js/library/modules/_math-expm1.js b/node_modules/core-js/library/modules/_math-expm1.js new file mode 100644 index 000000000..75c685014 --- /dev/null +++ b/node_modules/core-js/library/modules/_math-expm1.js @@ -0,0 +1,10 @@ +// 20.2.2.14 Math.expm1(x) +var $expm1 = Math.expm1; +module.exports = (!$expm1 + // Old FF bug + || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 + // Tor Browser bug + || $expm1(-2e-17) != -2e-17 +) ? function expm1(x) { + return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; +} : $expm1; diff --git a/node_modules/core-js/library/modules/_math-fround.js b/node_modules/core-js/library/modules/_math-fround.js new file mode 100644 index 000000000..c85eb4b7e --- /dev/null +++ b/node_modules/core-js/library/modules/_math-fround.js @@ -0,0 +1,23 @@ +// 20.2.2.16 Math.fround(x) +var sign = require('./_math-sign'); +var pow = Math.pow; +var EPSILON = pow(2, -52); +var EPSILON32 = pow(2, -23); +var MAX32 = pow(2, 127) * (2 - EPSILON32); +var MIN32 = pow(2, -126); + +var roundTiesToEven = function (n) { + return n + 1 / EPSILON - 1 / EPSILON; +}; + +module.exports = Math.fround || function fround(x) { + var $abs = Math.abs(x); + var $sign = sign(x); + var a, result; + if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; + a = (1 + EPSILON32 / EPSILON) * $abs; + result = a - (a - $abs); + // eslint-disable-next-line no-self-compare + if (result > MAX32 || result != result) return $sign * Infinity; + return $sign * result; +}; diff --git a/node_modules/core-js/library/modules/_math-log1p.js b/node_modules/core-js/library/modules/_math-log1p.js new file mode 100644 index 000000000..16d5f4931 --- /dev/null +++ b/node_modules/core-js/library/modules/_math-log1p.js @@ -0,0 +1,4 @@ +// 20.2.2.20 Math.log1p(x) +module.exports = Math.log1p || function log1p(x) { + return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); +}; diff --git a/node_modules/core-js/library/modules/_math-scale.js b/node_modules/core-js/library/modules/_math-scale.js new file mode 100644 index 000000000..ba3cdb20c --- /dev/null +++ b/node_modules/core-js/library/modules/_math-scale.js @@ -0,0 +1,18 @@ +// https://rwaldron.github.io/proposal-math-extensions/ +module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) { + if ( + arguments.length === 0 + // eslint-disable-next-line no-self-compare + || x != x + // eslint-disable-next-line no-self-compare + || inLow != inLow + // eslint-disable-next-line no-self-compare + || inHigh != inHigh + // eslint-disable-next-line no-self-compare + || outLow != outLow + // eslint-disable-next-line no-self-compare + || outHigh != outHigh + ) return NaN; + if (x === Infinity || x === -Infinity) return x; + return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow; +}; diff --git a/node_modules/core-js/library/modules/_math-sign.js b/node_modules/core-js/library/modules/_math-sign.js new file mode 100644 index 000000000..7a46b9d08 --- /dev/null +++ b/node_modules/core-js/library/modules/_math-sign.js @@ -0,0 +1,5 @@ +// 20.2.2.28 Math.sign(x) +module.exports = Math.sign || function sign(x) { + // eslint-disable-next-line no-self-compare + return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; +}; diff --git a/node_modules/core-js/library/modules/_meta.js b/node_modules/core-js/library/modules/_meta.js new file mode 100644 index 000000000..2d4b32579 --- /dev/null +++ b/node_modules/core-js/library/modules/_meta.js @@ -0,0 +1,53 @@ +var META = require('./_uid')('meta'); +var isObject = require('./_is-object'); +var has = require('./_has'); +var setDesc = require('./_object-dp').f; +var id = 0; +var isExtensible = Object.isExtensible || function () { + return true; +}; +var FREEZE = !require('./_fails')(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 +}; diff --git a/node_modules/core-js/library/modules/_metadata.js b/node_modules/core-js/library/modules/_metadata.js new file mode 100644 index 000000000..759cfc445 --- /dev/null +++ b/node_modules/core-js/library/modules/_metadata.js @@ -0,0 +1,51 @@ +var Map = require('./es6.map'); +var $export = require('./_export'); +var shared = require('./_shared')('metadata'); +var store = shared.store || (shared.store = new (require('./es6.weak-map'))()); + +var getOrCreateMetadataMap = function (target, targetKey, create) { + var targetMetadata = store.get(target); + if (!targetMetadata) { + if (!create) return undefined; + store.set(target, targetMetadata = new Map()); + } + var keyMetadata = targetMetadata.get(targetKey); + if (!keyMetadata) { + if (!create) return undefined; + targetMetadata.set(targetKey, keyMetadata = new Map()); + } return keyMetadata; +}; +var ordinaryHasOwnMetadata = function (MetadataKey, O, P) { + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? false : metadataMap.has(MetadataKey); +}; +var ordinaryGetOwnMetadata = function (MetadataKey, O, P) { + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); +}; +var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) { + getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); +}; +var ordinaryOwnMetadataKeys = function (target, targetKey) { + var metadataMap = getOrCreateMetadataMap(target, targetKey, false); + var keys = []; + if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); }); + return keys; +}; +var toMetaKey = function (it) { + return it === undefined || typeof it == 'symbol' ? it : String(it); +}; +var exp = function (O) { + $export($export.S, 'Reflect', O); +}; + +module.exports = { + store: store, + map: getOrCreateMetadataMap, + has: ordinaryHasOwnMetadata, + get: ordinaryGetOwnMetadata, + set: ordinaryDefineOwnMetadata, + keys: ordinaryOwnMetadataKeys, + key: toMetaKey, + exp: exp +}; diff --git a/node_modules/core-js/library/modules/_microtask.js b/node_modules/core-js/library/modules/_microtask.js new file mode 100644 index 000000000..b321c648c --- /dev/null +++ b/node_modules/core-js/library/modules/_microtask.js @@ -0,0 +1,69 @@ +var global = require('./_global'); +var macrotask = require('./_task').set; +var Observer = global.MutationObserver || global.WebKitMutationObserver; +var process = global.process; +var Promise = global.Promise; +var isNode = require('./_cof')(process) == 'process'; + +module.exports = function () { + var head, last, notify; + + var flush = function () { + var parent, fn; + if (isNode && (parent = process.domain)) parent.exit(); + while (head) { + fn = head.fn; + head = head.next; + try { + fn(); + } catch (e) { + if (head) notify(); + else last = undefined; + throw e; + } + } last = undefined; + if (parent) parent.enter(); + }; + + // Node.js + if (isNode) { + notify = function () { + process.nextTick(flush); + }; + // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 + } else if (Observer && !(global.navigator && global.navigator.standalone)) { + var toggle = true; + var node = document.createTextNode(''); + new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new + notify = function () { + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if (Promise && Promise.resolve) { + // Promise.resolve without an argument throws an error in LG WebOS 2 + var promise = Promise.resolve(undefined); + notify = function () { + promise.then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function () { + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } + + return function (fn) { + var task = { fn: fn, next: undefined }; + if (last) last.next = task; + if (!head) { + head = task; + notify(); + } last = task; + }; +}; diff --git a/node_modules/core-js/library/modules/_new-promise-capability.js b/node_modules/core-js/library/modules/_new-promise-capability.js new file mode 100644 index 000000000..82b74a331 --- /dev/null +++ b/node_modules/core-js/library/modules/_new-promise-capability.js @@ -0,0 +1,18 @@ +'use strict'; +// 25.4.1.5 NewPromiseCapability(C) +var aFunction = require('./_a-function'); + +function PromiseCapability(C) { + var resolve, reject; + this.promise = new C(function ($$resolve, $$reject) { + if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); +} + +module.exports.f = function (C) { + return new PromiseCapability(C); +}; diff --git a/node_modules/core-js/library/modules/_object-assign.js b/node_modules/core-js/library/modules/_object-assign.js new file mode 100644 index 000000000..7d4943a2a --- /dev/null +++ b/node_modules/core-js/library/modules/_object-assign.js @@ -0,0 +1,34 @@ +'use strict'; +// 19.1.2.1 Object.assign(target, source, ...) +var getKeys = require('./_object-keys'); +var gOPS = require('./_object-gops'); +var pIE = require('./_object-pie'); +var toObject = require('./_to-object'); +var IObject = require('./_iobject'); +var $assign = Object.assign; + +// should work with symbols and should have deterministic property order (V8 bug) +module.exports = !$assign || require('./_fails')(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) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; + } return T; +} : $assign; diff --git a/node_modules/core-js/library/modules/_object-create.js b/node_modules/core-js/library/modules/_object-create.js new file mode 100644 index 000000000..a76808ea6 --- /dev/null +++ b/node_modules/core-js/library/modules/_object-create.js @@ -0,0 +1,41 @@ +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +var anObject = require('./_an-object'); +var dPs = require('./_object-dps'); +var enumBugKeys = require('./_enum-bug-keys'); +var IE_PROTO = require('./_shared-key')('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 = require('./_dom-create')('iframe'); + var i = enumBugKeys.length; + var lt = '<'; + var gt = '>'; + var iframeDocument; + iframe.style.display = 'none'; + require('./_html').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); +}; diff --git a/node_modules/core-js/library/modules/_object-define.js b/node_modules/core-js/library/modules/_object-define.js new file mode 100644 index 000000000..4d131f331 --- /dev/null +++ b/node_modules/core-js/library/modules/_object-define.js @@ -0,0 +1,13 @@ +var dP = require('./_object-dp'); +var gOPD = require('./_object-gopd'); +var ownKeys = require('./_own-keys'); +var toIObject = require('./_to-iobject'); + +module.exports = function define(target, mixin) { + var keys = ownKeys(toIObject(mixin)); + var length = keys.length; + var i = 0; + var key; + while (length > i) dP.f(target, key = keys[i++], gOPD.f(mixin, key)); + return target; +}; diff --git a/node_modules/core-js/library/modules/_object-dp.js b/node_modules/core-js/library/modules/_object-dp.js new file mode 100644 index 000000000..0340a8308 --- /dev/null +++ b/node_modules/core-js/library/modules/_object-dp.js @@ -0,0 +1,16 @@ +var anObject = require('./_an-object'); +var IE8_DOM_DEFINE = require('./_ie8-dom-define'); +var toPrimitive = require('./_to-primitive'); +var dP = Object.defineProperty; + +exports.f = require('./_descriptors') ? 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; +}; diff --git a/node_modules/core-js/library/modules/_object-dps.js b/node_modules/core-js/library/modules/_object-dps.js new file mode 100644 index 000000000..173c338ff --- /dev/null +++ b/node_modules/core-js/library/modules/_object-dps.js @@ -0,0 +1,13 @@ +var dP = require('./_object-dp'); +var anObject = require('./_an-object'); +var getKeys = require('./_object-keys'); + +module.exports = require('./_descriptors') ? 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; +}; diff --git a/node_modules/core-js/library/modules/_object-forced-pam.js b/node_modules/core-js/library/modules/_object-forced-pam.js new file mode 100644 index 000000000..71ede9225 --- /dev/null +++ b/node_modules/core-js/library/modules/_object-forced-pam.js @@ -0,0 +1,9 @@ +'use strict'; +// Forced replacement prototype accessors methods +module.exports = require('./_library') || !require('./_fails')(function () { + var K = Math.random(); + // In FF throws only define methods + // eslint-disable-next-line no-undef, no-useless-call + __defineSetter__.call(null, K, function () { /* empty */ }); + delete require('./_global')[K]; +}); diff --git a/node_modules/core-js/library/modules/_object-gopd.js b/node_modules/core-js/library/modules/_object-gopd.js new file mode 100644 index 000000000..555dd31a5 --- /dev/null +++ b/node_modules/core-js/library/modules/_object-gopd.js @@ -0,0 +1,16 @@ +var pIE = require('./_object-pie'); +var createDesc = require('./_property-desc'); +var toIObject = require('./_to-iobject'); +var toPrimitive = require('./_to-primitive'); +var has = require('./_has'); +var IE8_DOM_DEFINE = require('./_ie8-dom-define'); +var gOPD = Object.getOwnPropertyDescriptor; + +exports.f = require('./_descriptors') ? 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]); +}; diff --git a/node_modules/core-js/library/modules/_object-gopn-ext.js b/node_modules/core-js/library/modules/_object-gopn-ext.js new file mode 100644 index 000000000..4abb6ae83 --- /dev/null +++ b/node_modules/core-js/library/modules/_object-gopn-ext.js @@ -0,0 +1,19 @@ +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +var toIObject = require('./_to-iobject'); +var gOPN = require('./_object-gopn').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)); +}; diff --git a/node_modules/core-js/library/modules/_object-gopn.js b/node_modules/core-js/library/modules/_object-gopn.js new file mode 100644 index 000000000..da82333f6 --- /dev/null +++ b/node_modules/core-js/library/modules/_object-gopn.js @@ -0,0 +1,7 @@ +// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) +var $keys = require('./_object-keys-internal'); +var hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype'); + +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return $keys(O, hiddenKeys); +}; diff --git a/node_modules/core-js/library/modules/_object-gops.js b/node_modules/core-js/library/modules/_object-gops.js new file mode 100644 index 000000000..bc0672905 --- /dev/null +++ b/node_modules/core-js/library/modules/_object-gops.js @@ -0,0 +1 @@ +exports.f = Object.getOwnPropertySymbols; diff --git a/node_modules/core-js/library/modules/_object-gpo.js b/node_modules/core-js/library/modules/_object-gpo.js new file mode 100644 index 000000000..27f2a94e8 --- /dev/null +++ b/node_modules/core-js/library/modules/_object-gpo.js @@ -0,0 +1,13 @@ +// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) +var has = require('./_has'); +var toObject = require('./_to-object'); +var IE_PROTO = require('./_shared-key')('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; +}; diff --git a/node_modules/core-js/library/modules/_object-keys-internal.js b/node_modules/core-js/library/modules/_object-keys-internal.js new file mode 100644 index 000000000..71abdd1a5 --- /dev/null +++ b/node_modules/core-js/library/modules/_object-keys-internal.js @@ -0,0 +1,17 @@ +var has = require('./_has'); +var toIObject = require('./_to-iobject'); +var arrayIndexOf = require('./_array-includes')(false); +var IE_PROTO = require('./_shared-key')('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; +}; diff --git a/node_modules/core-js/library/modules/_object-keys.js b/node_modules/core-js/library/modules/_object-keys.js new file mode 100644 index 000000000..62f73f91e --- /dev/null +++ b/node_modules/core-js/library/modules/_object-keys.js @@ -0,0 +1,7 @@ +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = require('./_object-keys-internal'); +var enumBugKeys = require('./_enum-bug-keys'); + +module.exports = Object.keys || function keys(O) { + return $keys(O, enumBugKeys); +}; diff --git a/node_modules/core-js/library/modules/_object-pie.js b/node_modules/core-js/library/modules/_object-pie.js new file mode 100644 index 000000000..4cc71072d --- /dev/null +++ b/node_modules/core-js/library/modules/_object-pie.js @@ -0,0 +1 @@ +exports.f = {}.propertyIsEnumerable; diff --git a/node_modules/core-js/library/modules/_object-sap.js b/node_modules/core-js/library/modules/_object-sap.js new file mode 100644 index 000000000..643535e0a --- /dev/null +++ b/node_modules/core-js/library/modules/_object-sap.js @@ -0,0 +1,10 @@ +// most Object methods by ES6 should accept primitives +var $export = require('./_export'); +var core = require('./_core'); +var fails = require('./_fails'); +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); +}; diff --git a/node_modules/core-js/library/modules/_object-to-array.js b/node_modules/core-js/library/modules/_object-to-array.js new file mode 100644 index 000000000..120100d09 --- /dev/null +++ b/node_modules/core-js/library/modules/_object-to-array.js @@ -0,0 +1,16 @@ +var getKeys = require('./_object-keys'); +var toIObject = require('./_to-iobject'); +var isEnum = require('./_object-pie').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) if (isEnum.call(O, key = keys[i++])) { + result.push(isEntries ? [key, O[key]] : O[key]); + } return result; + }; +}; diff --git a/node_modules/core-js/library/modules/_own-keys.js b/node_modules/core-js/library/modules/_own-keys.js new file mode 100644 index 000000000..84faece8f --- /dev/null +++ b/node_modules/core-js/library/modules/_own-keys.js @@ -0,0 +1,10 @@ +// all object keys, includes non-enumerable and symbols +var gOPN = require('./_object-gopn'); +var gOPS = require('./_object-gops'); +var anObject = require('./_an-object'); +var Reflect = require('./_global').Reflect; +module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { + var keys = gOPN.f(anObject(it)); + var getSymbols = gOPS.f; + return getSymbols ? keys.concat(getSymbols(it)) : keys; +}; diff --git a/node_modules/core-js/library/modules/_parse-float.js b/node_modules/core-js/library/modules/_parse-float.js new file mode 100644 index 000000000..acfb350f9 --- /dev/null +++ b/node_modules/core-js/library/modules/_parse-float.js @@ -0,0 +1,8 @@ +var $parseFloat = require('./_global').parseFloat; +var $trim = require('./_string-trim').trim; + +module.exports = 1 / $parseFloat(require('./_string-ws') + '-0') !== -Infinity ? function parseFloat(str) { + var string = $trim(String(str), 3); + var result = $parseFloat(string); + return result === 0 && string.charAt(0) == '-' ? -0 : result; +} : $parseFloat; diff --git a/node_modules/core-js/library/modules/_parse-int.js b/node_modules/core-js/library/modules/_parse-int.js new file mode 100644 index 000000000..ddd7172a9 --- /dev/null +++ b/node_modules/core-js/library/modules/_parse-int.js @@ -0,0 +1,9 @@ +var $parseInt = require('./_global').parseInt; +var $trim = require('./_string-trim').trim; +var ws = require('./_string-ws'); +var hex = /^[-+]?0[xX]/; + +module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) { + var string = $trim(String(str), 3); + return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); +} : $parseInt; diff --git a/node_modules/core-js/library/modules/_partial.js b/node_modules/core-js/library/modules/_partial.js new file mode 100644 index 000000000..ca3f35bf8 --- /dev/null +++ b/node_modules/core-js/library/modules/_partial.js @@ -0,0 +1,25 @@ +'use strict'; +var path = require('./_path'); +var invoke = require('./_invoke'); +var aFunction = require('./_a-function'); +module.exports = function (/* ...pargs */) { + var fn = aFunction(this); + var length = arguments.length; + var pargs = new Array(length); + var i = 0; + var _ = path._; + var holder = false; + while (length > i) if ((pargs[i] = arguments[i++]) === _) holder = true; + return function (/* ...args */) { + var that = this; + var aLen = arguments.length; + var j = 0; + var k = 0; + var args; + if (!holder && !aLen) return invoke(fn, pargs, that); + args = pargs.slice(); + if (holder) for (;length > j; j++) if (args[j] === _) args[j] = arguments[k++]; + while (aLen > k) args.push(arguments[k++]); + return invoke(fn, args, that); + }; +}; diff --git a/node_modules/core-js/library/modules/_path.js b/node_modules/core-js/library/modules/_path.js new file mode 100644 index 000000000..2796ebcb9 --- /dev/null +++ b/node_modules/core-js/library/modules/_path.js @@ -0,0 +1 @@ +module.exports = require('./_core'); diff --git a/node_modules/core-js/library/modules/_perform.js b/node_modules/core-js/library/modules/_perform.js new file mode 100644 index 000000000..bfc7b296d --- /dev/null +++ b/node_modules/core-js/library/modules/_perform.js @@ -0,0 +1,7 @@ +module.exports = function (exec) { + try { + return { e: false, v: exec() }; + } catch (e) { + return { e: true, v: e }; + } +}; diff --git a/node_modules/core-js/library/modules/_promise-resolve.js b/node_modules/core-js/library/modules/_promise-resolve.js new file mode 100644 index 000000000..c3cac7646 --- /dev/null +++ b/node_modules/core-js/library/modules/_promise-resolve.js @@ -0,0 +1,12 @@ +var anObject = require('./_an-object'); +var isObject = require('./_is-object'); +var newPromiseCapability = require('./_new-promise-capability'); + +module.exports = function (C, x) { + anObject(C); + if (isObject(x) && x.constructor === C) return x; + var promiseCapability = newPromiseCapability.f(C); + var resolve = promiseCapability.resolve; + resolve(x); + return promiseCapability.promise; +}; diff --git a/node_modules/core-js/library/modules/_property-desc.js b/node_modules/core-js/library/modules/_property-desc.js new file mode 100644 index 000000000..090593405 --- /dev/null +++ b/node_modules/core-js/library/modules/_property-desc.js @@ -0,0 +1,8 @@ +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; diff --git a/node_modules/core-js/library/modules/_redefine-all.js b/node_modules/core-js/library/modules/_redefine-all.js new file mode 100644 index 000000000..bf8c0ea39 --- /dev/null +++ b/node_modules/core-js/library/modules/_redefine-all.js @@ -0,0 +1,7 @@ +var hide = require('./_hide'); +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; +}; diff --git a/node_modules/core-js/library/modules/_redefine.js b/node_modules/core-js/library/modules/_redefine.js new file mode 100644 index 000000000..fde6108ef --- /dev/null +++ b/node_modules/core-js/library/modules/_redefine.js @@ -0,0 +1 @@ +module.exports = require('./_hide'); diff --git a/node_modules/core-js/library/modules/_replacer.js b/node_modules/core-js/library/modules/_replacer.js new file mode 100644 index 000000000..c37703dd2 --- /dev/null +++ b/node_modules/core-js/library/modules/_replacer.js @@ -0,0 +1,8 @@ +module.exports = function (regExp, replace) { + var replacer = replace === Object(replace) ? function (part) { + return replace[part]; + } : replace; + return function (it) { + return String(it).replace(regExp, replacer); + }; +}; diff --git a/node_modules/core-js/library/modules/_same-value.js b/node_modules/core-js/library/modules/_same-value.js new file mode 100644 index 000000000..c6d045e83 --- /dev/null +++ b/node_modules/core-js/library/modules/_same-value.js @@ -0,0 +1,5 @@ +// 7.2.9 SameValue(x, y) +module.exports = Object.is || function is(x, y) { + // eslint-disable-next-line no-self-compare + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; +}; diff --git a/node_modules/core-js/library/modules/_set-collection-from.js b/node_modules/core-js/library/modules/_set-collection-from.js new file mode 100644 index 000000000..d5001f93e --- /dev/null +++ b/node_modules/core-js/library/modules/_set-collection-from.js @@ -0,0 +1,28 @@ +'use strict'; +// https://tc39.github.io/proposal-setmap-offrom/ +var $export = require('./_export'); +var aFunction = require('./_a-function'); +var ctx = require('./_ctx'); +var forOf = require('./_for-of'); + +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); + } }); +}; diff --git a/node_modules/core-js/library/modules/_set-collection-of.js b/node_modules/core-js/library/modules/_set-collection-of.js new file mode 100644 index 000000000..f559af3fc --- /dev/null +++ b/node_modules/core-js/library/modules/_set-collection-of.js @@ -0,0 +1,12 @@ +'use strict'; +// https://tc39.github.io/proposal-setmap-offrom/ +var $export = require('./_export'); + +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); + } }); +}; diff --git a/node_modules/core-js/library/modules/_set-proto.js b/node_modules/core-js/library/modules/_set-proto.js new file mode 100644 index 000000000..c1990622e --- /dev/null +++ b/node_modules/core-js/library/modules/_set-proto.js @@ -0,0 +1,25 @@ +// Works with __proto__ only. Old v8 can't work with null proto objects. +/* eslint-disable no-proto */ +var isObject = require('./_is-object'); +var anObject = require('./_an-object'); +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 = require('./_ctx')(Function.call, require('./_object-gopd').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 +}; diff --git a/node_modules/core-js/library/modules/_set-species.js b/node_modules/core-js/library/modules/_set-species.js new file mode 100644 index 000000000..1f25fde1e --- /dev/null +++ b/node_modules/core-js/library/modules/_set-species.js @@ -0,0 +1,14 @@ +'use strict'; +var global = require('./_global'); +var core = require('./_core'); +var dP = require('./_object-dp'); +var DESCRIPTORS = require('./_descriptors'); +var SPECIES = require('./_wks')('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; } + }); +}; diff --git a/node_modules/core-js/library/modules/_set-to-string-tag.js b/node_modules/core-js/library/modules/_set-to-string-tag.js new file mode 100644 index 000000000..5bd64144f --- /dev/null +++ b/node_modules/core-js/library/modules/_set-to-string-tag.js @@ -0,0 +1,7 @@ +var def = require('./_object-dp').f; +var has = require('./_has'); +var TAG = require('./_wks')('toStringTag'); + +module.exports = function (it, tag, stat) { + if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); +}; diff --git a/node_modules/core-js/library/modules/_shared-key.js b/node_modules/core-js/library/modules/_shared-key.js new file mode 100644 index 000000000..d47fe7a28 --- /dev/null +++ b/node_modules/core-js/library/modules/_shared-key.js @@ -0,0 +1,5 @@ +var shared = require('./_shared')('keys'); +var uid = require('./_uid'); +module.exports = function (key) { + return shared[key] || (shared[key] = uid(key)); +}; diff --git a/node_modules/core-js/library/modules/_shared.js b/node_modules/core-js/library/modules/_shared.js new file mode 100644 index 000000000..2c6abc22e --- /dev/null +++ b/node_modules/core-js/library/modules/_shared.js @@ -0,0 +1,12 @@ +var core = require('./_core'); +var global = require('./_global'); +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: require('./_library') ? 'pure' : 'global', + copyright: '© 2018 Denis Pushkarev (zloirock.ru)' +}); diff --git a/node_modules/core-js/library/modules/_species-constructor.js b/node_modules/core-js/library/modules/_species-constructor.js new file mode 100644 index 000000000..0cb4ffb8f --- /dev/null +++ b/node_modules/core-js/library/modules/_species-constructor.js @@ -0,0 +1,9 @@ +// 7.3.20 SpeciesConstructor(O, defaultConstructor) +var anObject = require('./_an-object'); +var aFunction = require('./_a-function'); +var SPECIES = require('./_wks')('species'); +module.exports = function (O, D) { + var C = anObject(O).constructor; + var S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); +}; diff --git a/node_modules/core-js/library/modules/_strict-method.js b/node_modules/core-js/library/modules/_strict-method.js new file mode 100644 index 000000000..e68f41bb6 --- /dev/null +++ b/node_modules/core-js/library/modules/_strict-method.js @@ -0,0 +1,9 @@ +'use strict'; +var fails = require('./_fails'); + +module.exports = function (method, arg) { + return !!method && fails(function () { + // eslint-disable-next-line no-useless-call + arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null); + }); +}; diff --git a/node_modules/core-js/library/modules/_string-at.js b/node_modules/core-js/library/modules/_string-at.js new file mode 100644 index 000000000..88d66bd18 --- /dev/null +++ b/node_modules/core-js/library/modules/_string-at.js @@ -0,0 +1,17 @@ +var toInteger = require('./_to-integer'); +var defined = require('./_defined'); +// 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; + }; +}; diff --git a/node_modules/core-js/library/modules/_string-context.js b/node_modules/core-js/library/modules/_string-context.js new file mode 100644 index 000000000..becf3fbeb --- /dev/null +++ b/node_modules/core-js/library/modules/_string-context.js @@ -0,0 +1,8 @@ +// helper for String#{startsWith, endsWith, includes} +var isRegExp = require('./_is-regexp'); +var defined = require('./_defined'); + +module.exports = function (that, searchString, NAME) { + if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); + return String(defined(that)); +}; diff --git a/node_modules/core-js/library/modules/_string-html.js b/node_modules/core-js/library/modules/_string-html.js new file mode 100644 index 000000000..1dcc95bcd --- /dev/null +++ b/node_modules/core-js/library/modules/_string-html.js @@ -0,0 +1,19 @@ +var $export = require('./_export'); +var fails = require('./_fails'); +var defined = require('./_defined'); +var quot = /"/g; +// B.2.3.2.1 CreateHTML(string, tag, attribute, value) +var createHTML = function (string, tag, attribute, value) { + var S = String(defined(string)); + var p1 = '<' + tag; + if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; + return p1 + '>' + S + ''; +}; +module.exports = function (NAME, exec) { + var O = {}; + O[NAME] = exec(createHTML); + $export($export.P + $export.F * fails(function () { + var test = ''[NAME]('"'); + return test !== test.toLowerCase() || test.split('"').length > 3; + }), 'String', O); +}; diff --git a/node_modules/core-js/library/modules/_string-pad.js b/node_modules/core-js/library/modules/_string-pad.js new file mode 100644 index 000000000..ceb6077f0 --- /dev/null +++ b/node_modules/core-js/library/modules/_string-pad.js @@ -0,0 +1,16 @@ +// https://github.com/tc39/proposal-string-pad-start-end +var toLength = require('./_to-length'); +var repeat = require('./_string-repeat'); +var defined = require('./_defined'); + +module.exports = function (that, maxLength, fillString, left) { + var S = String(defined(that)); + var stringLength = S.length; + var fillStr = fillString === undefined ? ' ' : String(fillString); + var intMaxLength = toLength(maxLength); + if (intMaxLength <= stringLength || fillStr == '') return S; + var fillLen = intMaxLength - stringLength; + var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); + if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); + return left ? stringFiller + S : S + stringFiller; +}; diff --git a/node_modules/core-js/library/modules/_string-repeat.js b/node_modules/core-js/library/modules/_string-repeat.js new file mode 100644 index 000000000..a69b9626b --- /dev/null +++ b/node_modules/core-js/library/modules/_string-repeat.js @@ -0,0 +1,12 @@ +'use strict'; +var toInteger = require('./_to-integer'); +var defined = require('./_defined'); + +module.exports = function repeat(count) { + var str = String(defined(this)); + var res = ''; + var n = toInteger(count); + if (n < 0 || n == Infinity) throw RangeError("Count can't be negative"); + for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str; + return res; +}; diff --git a/node_modules/core-js/library/modules/_string-trim.js b/node_modules/core-js/library/modules/_string-trim.js new file mode 100644 index 000000000..6b54a81a8 --- /dev/null +++ b/node_modules/core-js/library/modules/_string-trim.js @@ -0,0 +1,30 @@ +var $export = require('./_export'); +var defined = require('./_defined'); +var fails = require('./_fails'); +var spaces = require('./_string-ws'); +var space = '[' + spaces + ']'; +var non = '\u200b\u0085'; +var ltrim = RegExp('^' + space + space + '*'); +var rtrim = RegExp(space + space + '*$'); + +var exporter = function (KEY, exec, ALIAS) { + var exp = {}; + var FORCE = fails(function () { + return !!spaces[KEY]() || non[KEY]() != non; + }); + var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; + if (ALIAS) exp[ALIAS] = fn; + $export($export.P + $export.F * FORCE, 'String', exp); +}; + +// 1 -> String#trimLeft +// 2 -> String#trimRight +// 3 -> String#trim +var trim = exporter.trim = function (string, TYPE) { + string = String(defined(string)); + if (TYPE & 1) string = string.replace(ltrim, ''); + if (TYPE & 2) string = string.replace(rtrim, ''); + return string; +}; + +module.exports = exporter; diff --git a/node_modules/core-js/library/modules/_string-ws.js b/node_modules/core-js/library/modules/_string-ws.js new file mode 100644 index 000000000..2c68cf9f4 --- /dev/null +++ b/node_modules/core-js/library/modules/_string-ws.js @@ -0,0 +1,2 @@ +module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; diff --git a/node_modules/core-js/library/modules/_task.js b/node_modules/core-js/library/modules/_task.js new file mode 100644 index 000000000..8777a6e28 --- /dev/null +++ b/node_modules/core-js/library/modules/_task.js @@ -0,0 +1,84 @@ +var ctx = require('./_ctx'); +var invoke = require('./_invoke'); +var html = require('./_html'); +var cel = require('./_dom-create'); +var global = require('./_global'); +var process = global.process; +var setTask = global.setImmediate; +var clearTask = global.clearImmediate; +var MessageChannel = global.MessageChannel; +var Dispatch = global.Dispatch; +var counter = 0; +var queue = {}; +var ONREADYSTATECHANGE = 'onreadystatechange'; +var defer, channel, port; +var run = function () { + var id = +this; + // eslint-disable-next-line no-prototype-builtins + if (queue.hasOwnProperty(id)) { + var fn = queue[id]; + delete queue[id]; + fn(); + } +}; +var listener = function (event) { + run.call(event.data); +}; +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: +if (!setTask || !clearTask) { + setTask = function setImmediate(fn) { + var args = []; + var i = 1; + while (arguments.length > i) args.push(arguments[i++]); + queue[++counter] = function () { + // eslint-disable-next-line no-new-func + invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id) { + delete queue[id]; + }; + // Node.js 0.8- + if (require('./_cof')(process) == 'process') { + defer = function (id) { + process.nextTick(ctx(run, id, 1)); + }; + // Sphere (JS game engine) Dispatch API + } else if (Dispatch && Dispatch.now) { + defer = function (id) { + Dispatch.now(ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if (MessageChannel) { + channel = new MessageChannel(); + port = channel.port2; + channel.port1.onmessage = listener; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { + defer = function (id) { + global.postMessage(id + '', '*'); + }; + global.addEventListener('message', listener, false); + // IE8- + } else if (ONREADYSTATECHANGE in cel('script')) { + defer = function (id) { + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { + html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function (id) { + setTimeout(ctx(run, id, 1), 0); + }; + } +} +module.exports = { + set: setTask, + clear: clearTask +}; diff --git a/node_modules/core-js/library/modules/_to-absolute-index.js b/node_modules/core-js/library/modules/_to-absolute-index.js new file mode 100644 index 000000000..dfee02e8e --- /dev/null +++ b/node_modules/core-js/library/modules/_to-absolute-index.js @@ -0,0 +1,7 @@ +var toInteger = require('./_to-integer'); +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); +}; diff --git a/node_modules/core-js/library/modules/_to-index.js b/node_modules/core-js/library/modules/_to-index.js new file mode 100644 index 000000000..8f51c32d2 --- /dev/null +++ b/node_modules/core-js/library/modules/_to-index.js @@ -0,0 +1,10 @@ +// https://tc39.github.io/ecma262/#sec-toindex +var toInteger = require('./_to-integer'); +var toLength = require('./_to-length'); +module.exports = function (it) { + if (it === undefined) return 0; + var number = toInteger(it); + var length = toLength(number); + if (number !== length) throw RangeError('Wrong length!'); + return length; +}; diff --git a/node_modules/core-js/library/modules/_to-integer.js b/node_modules/core-js/library/modules/_to-integer.js new file mode 100644 index 000000000..3d50f97dd --- /dev/null +++ b/node_modules/core-js/library/modules/_to-integer.js @@ -0,0 +1,6 @@ +// 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); +}; diff --git a/node_modules/core-js/library/modules/_to-iobject.js b/node_modules/core-js/library/modules/_to-iobject.js new file mode 100644 index 000000000..7614503a2 --- /dev/null +++ b/node_modules/core-js/library/modules/_to-iobject.js @@ -0,0 +1,6 @@ +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = require('./_iobject'); +var defined = require('./_defined'); +module.exports = function (it) { + return IObject(defined(it)); +}; diff --git a/node_modules/core-js/library/modules/_to-length.js b/node_modules/core-js/library/modules/_to-length.js new file mode 100644 index 000000000..a9db50173 --- /dev/null +++ b/node_modules/core-js/library/modules/_to-length.js @@ -0,0 +1,6 @@ +// 7.1.15 ToLength +var toInteger = require('./_to-integer'); +var min = Math.min; +module.exports = function (it) { + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; diff --git a/node_modules/core-js/library/modules/_to-object.js b/node_modules/core-js/library/modules/_to-object.js new file mode 100644 index 000000000..0efea4c69 --- /dev/null +++ b/node_modules/core-js/library/modules/_to-object.js @@ -0,0 +1,5 @@ +// 7.1.13 ToObject(argument) +var defined = require('./_defined'); +module.exports = function (it) { + return Object(defined(it)); +}; diff --git a/node_modules/core-js/library/modules/_to-primitive.js b/node_modules/core-js/library/modules/_to-primitive.js new file mode 100644 index 000000000..de3dd6b19 --- /dev/null +++ b/node_modules/core-js/library/modules/_to-primitive.js @@ -0,0 +1,12 @@ +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = require('./_is-object'); +// 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"); +}; diff --git a/node_modules/core-js/library/modules/_typed-array.js b/node_modules/core-js/library/modules/_typed-array.js new file mode 100644 index 000000000..30d9c0ba5 --- /dev/null +++ b/node_modules/core-js/library/modules/_typed-array.js @@ -0,0 +1,480 @@ +'use strict'; +if (require('./_descriptors')) { + var LIBRARY = require('./_library'); + var global = require('./_global'); + var fails = require('./_fails'); + var $export = require('./_export'); + var $typed = require('./_typed'); + var $buffer = require('./_typed-buffer'); + var ctx = require('./_ctx'); + var anInstance = require('./_an-instance'); + var propertyDesc = require('./_property-desc'); + var hide = require('./_hide'); + var redefineAll = require('./_redefine-all'); + var toInteger = require('./_to-integer'); + var toLength = require('./_to-length'); + var toIndex = require('./_to-index'); + var toAbsoluteIndex = require('./_to-absolute-index'); + var toPrimitive = require('./_to-primitive'); + var has = require('./_has'); + var classof = require('./_classof'); + var isObject = require('./_is-object'); + var toObject = require('./_to-object'); + var isArrayIter = require('./_is-array-iter'); + var create = require('./_object-create'); + var getPrototypeOf = require('./_object-gpo'); + var gOPN = require('./_object-gopn').f; + var getIterFn = require('./core.get-iterator-method'); + var uid = require('./_uid'); + var wks = require('./_wks'); + var createArrayMethod = require('./_array-methods'); + var createArrayIncludes = require('./_array-includes'); + var speciesConstructor = require('./_species-constructor'); + var ArrayIterators = require('./es6.array.iterator'); + var Iterators = require('./_iterators'); + var $iterDetect = require('./_iter-detect'); + var setSpecies = require('./_set-species'); + var arrayFill = require('./_array-fill'); + var arrayCopyWithin = require('./_array-copy-within'); + var $DP = require('./_object-dp'); + var $GOPD = require('./_object-gopd'); + var dP = $DP.f; + var gOPD = $GOPD.f; + var RangeError = global.RangeError; + var TypeError = global.TypeError; + var Uint8Array = global.Uint8Array; + var ARRAY_BUFFER = 'ArrayBuffer'; + var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER; + var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; + var PROTOTYPE = 'prototype'; + var ArrayProto = Array[PROTOTYPE]; + var $ArrayBuffer = $buffer.ArrayBuffer; + var $DataView = $buffer.DataView; + var arrayForEach = createArrayMethod(0); + var arrayFilter = createArrayMethod(2); + var arraySome = createArrayMethod(3); + var arrayEvery = createArrayMethod(4); + var arrayFind = createArrayMethod(5); + var arrayFindIndex = createArrayMethod(6); + var arrayIncludes = createArrayIncludes(true); + var arrayIndexOf = createArrayIncludes(false); + var arrayValues = ArrayIterators.values; + var arrayKeys = ArrayIterators.keys; + var arrayEntries = ArrayIterators.entries; + var arrayLastIndexOf = ArrayProto.lastIndexOf; + var arrayReduce = ArrayProto.reduce; + var arrayReduceRight = ArrayProto.reduceRight; + var arrayJoin = ArrayProto.join; + var arraySort = ArrayProto.sort; + var arraySlice = ArrayProto.slice; + var arrayToString = ArrayProto.toString; + var arrayToLocaleString = ArrayProto.toLocaleString; + var ITERATOR = wks('iterator'); + var TAG = wks('toStringTag'); + var TYPED_CONSTRUCTOR = uid('typed_constructor'); + var DEF_CONSTRUCTOR = uid('def_constructor'); + var ALL_CONSTRUCTORS = $typed.CONSTR; + var TYPED_ARRAY = $typed.TYPED; + var VIEW = $typed.VIEW; + var WRONG_LENGTH = 'Wrong length!'; + + var $map = createArrayMethod(1, function (O, length) { + return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); + }); + + var LITTLE_ENDIAN = fails(function () { + // eslint-disable-next-line no-undef + return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; + }); + + var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () { + new Uint8Array(1).set({}); + }); + + var toOffset = function (it, BYTES) { + var offset = toInteger(it); + if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!'); + return offset; + }; + + var validate = function (it) { + if (isObject(it) && TYPED_ARRAY in it) return it; + throw TypeError(it + ' is not a typed array!'); + }; + + var allocate = function (C, length) { + if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) { + throw TypeError('It is not a typed array constructor!'); + } return new C(length); + }; + + var speciesFromList = function (O, list) { + return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); + }; + + var fromList = function (C, list) { + var index = 0; + var length = list.length; + var result = allocate(C, length); + while (length > index) result[index] = list[index++]; + return result; + }; + + var addGetter = function (it, key, internal) { + dP(it, key, { get: function () { return this._d[internal]; } }); + }; + + var $from = function from(source /* , mapfn, thisArg */) { + var O = toObject(source); + var aLen = arguments.length; + var mapfn = aLen > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var iterFn = getIterFn(O); + var i, length, values, result, step, iterator; + if (iterFn != undefined && !isArrayIter(iterFn)) { + for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) { + values.push(step.value); + } O = values; + } + if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2); + for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) { + result[i] = mapping ? mapfn(O[i], i) : O[i]; + } + return result; + }; + + var $of = function of(/* ...items */) { + var index = 0; + var length = arguments.length; + var result = allocate(this, length); + while (length > index) result[index] = arguments[index++]; + return result; + }; + + // iOS Safari 6.x fails here + var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); }); + + var $toLocaleString = function toLocaleString() { + return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); + }; + + var proto = { + copyWithin: function copyWithin(target, start /* , end */) { + return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); + }, + every: function every(callbackfn /* , thisArg */) { + return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars + return arrayFill.apply(validate(this), arguments); + }, + filter: function filter(callbackfn /* , thisArg */) { + return speciesFromList(this, arrayFilter(validate(this), callbackfn, + arguments.length > 1 ? arguments[1] : undefined)); + }, + find: function find(predicate /* , thisArg */) { + return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + findIndex: function findIndex(predicate /* , thisArg */) { + return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + forEach: function forEach(callbackfn /* , thisArg */) { + arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + indexOf: function indexOf(searchElement /* , fromIndex */) { + return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + includes: function includes(searchElement /* , fromIndex */) { + return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + join: function join(separator) { // eslint-disable-line no-unused-vars + return arrayJoin.apply(validate(this), arguments); + }, + lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars + return arrayLastIndexOf.apply(validate(this), arguments); + }, + map: function map(mapfn /* , thisArg */) { + return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); + }, + reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars + return arrayReduce.apply(validate(this), arguments); + }, + reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars + return arrayReduceRight.apply(validate(this), arguments); + }, + reverse: function reverse() { + var that = this; + var length = validate(that).length; + var middle = Math.floor(length / 2); + var index = 0; + var value; + while (index < middle) { + value = that[index]; + that[index++] = that[--length]; + that[length] = value; + } return that; + }, + some: function some(callbackfn /* , thisArg */) { + return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + sort: function sort(comparefn) { + return arraySort.call(validate(this), comparefn); + }, + subarray: function subarray(begin, end) { + var O = validate(this); + var length = O.length; + var $begin = toAbsoluteIndex(begin, length); + return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( + O.buffer, + O.byteOffset + $begin * O.BYTES_PER_ELEMENT, + toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin) + ); + } + }; + + var $slice = function slice(start, end) { + return speciesFromList(this, arraySlice.call(validate(this), start, end)); + }; + + var $set = function set(arrayLike /* , offset */) { + validate(this); + var offset = toOffset(arguments[1], 1); + var length = this.length; + var src = toObject(arrayLike); + var len = toLength(src.length); + var index = 0; + if (len + offset > length) throw RangeError(WRONG_LENGTH); + while (index < len) this[offset + index] = src[index++]; + }; + + var $iterators = { + entries: function entries() { + return arrayEntries.call(validate(this)); + }, + keys: function keys() { + return arrayKeys.call(validate(this)); + }, + values: function values() { + return arrayValues.call(validate(this)); + } + }; + + var isTAIndex = function (target, key) { + return isObject(target) + && target[TYPED_ARRAY] + && typeof key != 'symbol' + && key in target + && String(+key) == String(key); + }; + var $getDesc = function getOwnPropertyDescriptor(target, key) { + return isTAIndex(target, key = toPrimitive(key, true)) + ? propertyDesc(2, target[key]) + : gOPD(target, key); + }; + var $setDesc = function defineProperty(target, key, desc) { + if (isTAIndex(target, key = toPrimitive(key, true)) + && isObject(desc) + && has(desc, 'value') + && !has(desc, 'get') + && !has(desc, 'set') + // TODO: add validation descriptor w/o calling accessors + && !desc.configurable + && (!has(desc, 'writable') || desc.writable) + && (!has(desc, 'enumerable') || desc.enumerable) + ) { + target[key] = desc.value; + return target; + } return dP(target, key, desc); + }; + + if (!ALL_CONSTRUCTORS) { + $GOPD.f = $getDesc; + $DP.f = $setDesc; + } + + $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { + getOwnPropertyDescriptor: $getDesc, + defineProperty: $setDesc + }); + + if (fails(function () { arrayToString.call({}); })) { + arrayToString = arrayToLocaleString = function toString() { + return arrayJoin.call(this); + }; + } + + var $TypedArrayPrototype$ = redefineAll({}, proto); + redefineAll($TypedArrayPrototype$, $iterators); + hide($TypedArrayPrototype$, ITERATOR, $iterators.values); + redefineAll($TypedArrayPrototype$, { + slice: $slice, + set: $set, + constructor: function () { /* noop */ }, + toString: arrayToString, + toLocaleString: $toLocaleString + }); + addGetter($TypedArrayPrototype$, 'buffer', 'b'); + addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); + addGetter($TypedArrayPrototype$, 'byteLength', 'l'); + addGetter($TypedArrayPrototype$, 'length', 'e'); + dP($TypedArrayPrototype$, TAG, { + get: function () { return this[TYPED_ARRAY]; } + }); + + // eslint-disable-next-line max-statements + module.exports = function (KEY, BYTES, wrapper, CLAMPED) { + CLAMPED = !!CLAMPED; + var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'; + var GETTER = 'get' + KEY; + var SETTER = 'set' + KEY; + var TypedArray = global[NAME]; + var Base = TypedArray || {}; + var TAC = TypedArray && getPrototypeOf(TypedArray); + var FORCED = !TypedArray || !$typed.ABV; + var O = {}; + var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; + var getter = function (that, index) { + var data = that._d; + return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); + }; + var setter = function (that, index, value) { + var data = that._d; + if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; + data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); + }; + var addElement = function (that, index) { + dP(that, index, { + get: function () { + return getter(this, index); + }, + set: function (value) { + return setter(this, index, value); + }, + enumerable: true + }); + }; + if (FORCED) { + TypedArray = wrapper(function (that, data, $offset, $length) { + anInstance(that, TypedArray, NAME, '_d'); + var index = 0; + var offset = 0; + var buffer, byteLength, length, klass; + if (!isObject(data)) { + length = toIndex(data); + byteLength = length * BYTES; + buffer = new $ArrayBuffer(byteLength); + } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { + buffer = data; + offset = toOffset($offset, BYTES); + var $len = data.byteLength; + if ($length === undefined) { + if ($len % BYTES) throw RangeError(WRONG_LENGTH); + byteLength = $len - offset; + if (byteLength < 0) throw RangeError(WRONG_LENGTH); + } else { + byteLength = toLength($length) * BYTES; + if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH); + } + length = byteLength / BYTES; + } else if (TYPED_ARRAY in data) { + return fromList(TypedArray, data); + } else { + return $from.call(TypedArray, data); + } + hide(that, '_d', { + b: buffer, + o: offset, + l: byteLength, + e: length, + v: new $DataView(buffer) + }); + while (index < length) addElement(that, index++); + }); + TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); + hide(TypedArrayPrototype, 'constructor', TypedArray); + } else if (!fails(function () { + TypedArray(1); + }) || !fails(function () { + new TypedArray(-1); // eslint-disable-line no-new + }) || !$iterDetect(function (iter) { + new TypedArray(); // eslint-disable-line no-new + new TypedArray(null); // eslint-disable-line no-new + new TypedArray(1.5); // eslint-disable-line no-new + new TypedArray(iter); // eslint-disable-line no-new + }, true)) { + TypedArray = wrapper(function (that, data, $offset, $length) { + anInstance(that, TypedArray, NAME); + var klass; + // `ws` module bug, temporarily remove validation length for Uint8Array + // https://github.com/websockets/ws/pull/645 + if (!isObject(data)) return new Base(toIndex(data)); + if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { + return $length !== undefined + ? new Base(data, toOffset($offset, BYTES), $length) + : $offset !== undefined + ? new Base(data, toOffset($offset, BYTES)) + : new Base(data); + } + if (TYPED_ARRAY in data) return fromList(TypedArray, data); + return $from.call(TypedArray, data); + }); + arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) { + if (!(key in TypedArray)) hide(TypedArray, key, Base[key]); + }); + TypedArray[PROTOTYPE] = TypedArrayPrototype; + if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray; + } + var $nativeIterator = TypedArrayPrototype[ITERATOR]; + var CORRECT_ITER_NAME = !!$nativeIterator + && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined); + var $iterator = $iterators.values; + hide(TypedArray, TYPED_CONSTRUCTOR, true); + hide(TypedArrayPrototype, TYPED_ARRAY, NAME); + hide(TypedArrayPrototype, VIEW, true); + hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); + + if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) { + dP(TypedArrayPrototype, TAG, { + get: function () { return NAME; } + }); + } + + O[NAME] = TypedArray; + + $export($export.G + $export.W + $export.F * (TypedArray != Base), O); + + $export($export.S, NAME, { + BYTES_PER_ELEMENT: BYTES + }); + + $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, { + from: $from, + of: $of + }); + + if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); + + $export($export.P, NAME, proto); + + setSpecies(NAME); + + $export($export.P + $export.F * FORCED_SET, NAME, { set: $set }); + + $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); + + if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString; + + $export($export.P + $export.F * fails(function () { + new TypedArray(1).slice(); + }), NAME, { slice: $slice }); + + $export($export.P + $export.F * (fails(function () { + return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString(); + }) || !fails(function () { + TypedArrayPrototype.toLocaleString.call([1, 2]); + })), NAME, { toLocaleString: $toLocaleString }); + + Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; + if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator); + }; +} else module.exports = function () { /* empty */ }; diff --git a/node_modules/core-js/library/modules/_typed-buffer.js b/node_modules/core-js/library/modules/_typed-buffer.js new file mode 100644 index 000000000..c24cef38c --- /dev/null +++ b/node_modules/core-js/library/modules/_typed-buffer.js @@ -0,0 +1,276 @@ +'use strict'; +var global = require('./_global'); +var DESCRIPTORS = require('./_descriptors'); +var LIBRARY = require('./_library'); +var $typed = require('./_typed'); +var hide = require('./_hide'); +var redefineAll = require('./_redefine-all'); +var fails = require('./_fails'); +var anInstance = require('./_an-instance'); +var toInteger = require('./_to-integer'); +var toLength = require('./_to-length'); +var toIndex = require('./_to-index'); +var gOPN = require('./_object-gopn').f; +var dP = require('./_object-dp').f; +var arrayFill = require('./_array-fill'); +var setToStringTag = require('./_set-to-string-tag'); +var ARRAY_BUFFER = 'ArrayBuffer'; +var DATA_VIEW = 'DataView'; +var PROTOTYPE = 'prototype'; +var WRONG_LENGTH = 'Wrong length!'; +var WRONG_INDEX = 'Wrong index!'; +var $ArrayBuffer = global[ARRAY_BUFFER]; +var $DataView = global[DATA_VIEW]; +var Math = global.Math; +var RangeError = global.RangeError; +// eslint-disable-next-line no-shadow-restricted-names +var Infinity = global.Infinity; +var BaseBuffer = $ArrayBuffer; +var abs = Math.abs; +var pow = Math.pow; +var floor = Math.floor; +var log = Math.log; +var LN2 = Math.LN2; +var BUFFER = 'buffer'; +var BYTE_LENGTH = 'byteLength'; +var BYTE_OFFSET = 'byteOffset'; +var $BUFFER = DESCRIPTORS ? '_b' : BUFFER; +var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH; +var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; + +// IEEE754 conversions based on https://github.com/feross/ieee754 +function packIEEE754(value, mLen, nBytes) { + var buffer = new Array(nBytes); + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0; + var i = 0; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + var e, m, c; + value = abs(value); + // eslint-disable-next-line no-self-compare + if (value != value || value === Infinity) { + // eslint-disable-next-line no-self-compare + m = value != value ? 1 : 0; + e = eMax; + } else { + e = floor(log(value) / LN2); + if (value * (c = pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * pow(2, mLen); + e = e + eBias; + } else { + m = value * pow(2, eBias - 1) * pow(2, mLen); + e = 0; + } + } + for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); + e = e << mLen | m; + eLen += mLen; + for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); + buffer[--i] |= s * 128; + return buffer; +} +function unpackIEEE754(buffer, mLen, nBytes) { + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = eLen - 7; + var i = nBytes - 1; + var s = buffer[i--]; + var e = s & 127; + var m; + s >>= 7; + for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : s ? -Infinity : Infinity; + } else { + m = m + pow(2, mLen); + e = e - eBias; + } return (s ? -1 : 1) * m * pow(2, e - mLen); +} + +function unpackI32(bytes) { + return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; +} +function packI8(it) { + return [it & 0xff]; +} +function packI16(it) { + return [it & 0xff, it >> 8 & 0xff]; +} +function packI32(it) { + return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; +} +function packF64(it) { + return packIEEE754(it, 52, 8); +} +function packF32(it) { + return packIEEE754(it, 23, 4); +} + +function addGetter(C, key, internal) { + dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } }); +} + +function get(view, bytes, index, isLittleEndian) { + var numIndex = +index; + var intIndex = toIndex(numIndex); + if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b; + var start = intIndex + view[$OFFSET]; + var pack = store.slice(start, start + bytes); + return isLittleEndian ? pack : pack.reverse(); +} +function set(view, bytes, index, conversion, value, isLittleEndian) { + var numIndex = +index; + var intIndex = toIndex(numIndex); + if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b; + var start = intIndex + view[$OFFSET]; + var pack = conversion(+value); + for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; +} + +if (!$typed.ABV) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer, ARRAY_BUFFER); + var byteLength = toIndex(length); + this._b = arrayFill.call(new Array(byteLength), 0); + this[$LENGTH] = byteLength; + }; + + $DataView = function DataView(buffer, byteOffset, byteLength) { + anInstance(this, $DataView, DATA_VIEW); + anInstance(buffer, $ArrayBuffer, DATA_VIEW); + var bufferLength = buffer[$LENGTH]; + var offset = toInteger(byteOffset); + if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!'); + byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); + if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); + this[$BUFFER] = buffer; + this[$OFFSET] = offset; + this[$LENGTH] = byteLength; + }; + + if (DESCRIPTORS) { + addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); + addGetter($DataView, BUFFER, '_b'); + addGetter($DataView, BYTE_LENGTH, '_l'); + addGetter($DataView, BYTE_OFFSET, '_o'); + } + + redefineAll($DataView[PROTOTYPE], { + getInt8: function getInt8(byteOffset) { + return get(this, 1, byteOffset)[0] << 24 >> 24; + }, + getUint8: function getUint8(byteOffset) { + return get(this, 1, byteOffset)[0]; + }, + getInt16: function getInt16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments[1]); + return (bytes[1] << 8 | bytes[0]) << 16 >> 16; + }, + getUint16: function getUint16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments[1]); + return bytes[1] << 8 | bytes[0]; + }, + getInt32: function getInt32(byteOffset /* , littleEndian */) { + return unpackI32(get(this, 4, byteOffset, arguments[1])); + }, + getUint32: function getUint32(byteOffset /* , littleEndian */) { + return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; + }, + getFloat32: function getFloat32(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); + }, + getFloat64: function getFloat64(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); + }, + setInt8: function setInt8(byteOffset, value) { + set(this, 1, byteOffset, packI8, value); + }, + setUint8: function setUint8(byteOffset, value) { + set(this, 1, byteOffset, packI8, value); + }, + setInt16: function setInt16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setUint16: function setUint16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setInt32: function setInt32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setUint32: function setUint32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packF32, value, arguments[2]); + }, + setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { + set(this, 8, byteOffset, packF64, value, arguments[2]); + } + }); +} else { + if (!fails(function () { + $ArrayBuffer(1); + }) || !fails(function () { + new $ArrayBuffer(-1); // eslint-disable-line no-new + }) || fails(function () { + new $ArrayBuffer(); // eslint-disable-line no-new + new $ArrayBuffer(1.5); // eslint-disable-line no-new + new $ArrayBuffer(NaN); // eslint-disable-line no-new + return $ArrayBuffer.name != ARRAY_BUFFER; + })) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer); + return new BaseBuffer(toIndex(length)); + }; + var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; + for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) { + if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]); + } + if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer; + } + // iOS Safari 7.x bug + var view = new $DataView(new $ArrayBuffer(2)); + var $setInt8 = $DataView[PROTOTYPE].setInt8; + view.setInt8(0, 2147483648); + view.setInt8(1, 2147483649); + if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], { + setInt8: function setInt8(byteOffset, value) { + $setInt8.call(this, byteOffset, value << 24 >> 24); + }, + setUint8: function setUint8(byteOffset, value) { + $setInt8.call(this, byteOffset, value << 24 >> 24); + } + }, true); +} +setToStringTag($ArrayBuffer, ARRAY_BUFFER); +setToStringTag($DataView, DATA_VIEW); +hide($DataView[PROTOTYPE], $typed.VIEW, true); +exports[ARRAY_BUFFER] = $ArrayBuffer; +exports[DATA_VIEW] = $DataView; diff --git a/node_modules/core-js/library/modules/_typed.js b/node_modules/core-js/library/modules/_typed.js new file mode 100644 index 000000000..8747ffd71 --- /dev/null +++ b/node_modules/core-js/library/modules/_typed.js @@ -0,0 +1,28 @@ +var global = require('./_global'); +var hide = require('./_hide'); +var uid = require('./_uid'); +var TYPED = uid('typed_array'); +var VIEW = uid('view'); +var ABV = !!(global.ArrayBuffer && global.DataView); +var CONSTR = ABV; +var i = 0; +var l = 9; +var Typed; + +var TypedArrayConstructors = ( + 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' +).split(','); + +while (i < l) { + if (Typed = global[TypedArrayConstructors[i++]]) { + hide(Typed.prototype, TYPED, true); + hide(Typed.prototype, VIEW, true); + } else CONSTR = false; +} + +module.exports = { + ABV: ABV, + CONSTR: CONSTR, + TYPED: TYPED, + VIEW: VIEW +}; diff --git a/node_modules/core-js/library/modules/_uid.js b/node_modules/core-js/library/modules/_uid.js new file mode 100644 index 000000000..ffbe7185f --- /dev/null +++ b/node_modules/core-js/library/modules/_uid.js @@ -0,0 +1,5 @@ +var id = 0; +var px = Math.random(); +module.exports = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; diff --git a/node_modules/core-js/library/modules/_user-agent.js b/node_modules/core-js/library/modules/_user-agent.js new file mode 100644 index 000000000..363fedc25 --- /dev/null +++ b/node_modules/core-js/library/modules/_user-agent.js @@ -0,0 +1,4 @@ +var global = require('./_global'); +var navigator = global.navigator; + +module.exports = navigator && navigator.userAgent || ''; diff --git a/node_modules/core-js/library/modules/_validate-collection.js b/node_modules/core-js/library/modules/_validate-collection.js new file mode 100644 index 000000000..cec1ceff7 --- /dev/null +++ b/node_modules/core-js/library/modules/_validate-collection.js @@ -0,0 +1,5 @@ +var isObject = require('./_is-object'); +module.exports = function (it, TYPE) { + if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); + return it; +}; diff --git a/node_modules/core-js/library/modules/_wks-define.js b/node_modules/core-js/library/modules/_wks-define.js new file mode 100644 index 000000000..7284d6ada --- /dev/null +++ b/node_modules/core-js/library/modules/_wks-define.js @@ -0,0 +1,9 @@ +var global = require('./_global'); +var core = require('./_core'); +var LIBRARY = require('./_library'); +var wksExt = require('./_wks-ext'); +var defineProperty = require('./_object-dp').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) }); +}; diff --git a/node_modules/core-js/library/modules/_wks-ext.js b/node_modules/core-js/library/modules/_wks-ext.js new file mode 100644 index 000000000..13bd83b16 --- /dev/null +++ b/node_modules/core-js/library/modules/_wks-ext.js @@ -0,0 +1 @@ +exports.f = require('./_wks'); diff --git a/node_modules/core-js/library/modules/_wks.js b/node_modules/core-js/library/modules/_wks.js new file mode 100644 index 000000000..e33f857a6 --- /dev/null +++ b/node_modules/core-js/library/modules/_wks.js @@ -0,0 +1,11 @@ +var store = require('./_shared')('wks'); +var uid = require('./_uid'); +var Symbol = require('./_global').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; diff --git a/node_modules/core-js/library/modules/core.delay.js b/node_modules/core-js/library/modules/core.delay.js new file mode 100644 index 000000000..73712c012 --- /dev/null +++ b/node_modules/core-js/library/modules/core.delay.js @@ -0,0 +1,12 @@ +var global = require('./_global'); +var core = require('./_core'); +var $export = require('./_export'); +var partial = require('./_partial'); +// https://esdiscuss.org/topic/promise-returning-delay-function +$export($export.G + $export.F, { + delay: function delay(time) { + return new (core.Promise || global.Promise)(function (resolve) { + setTimeout(partial.call(resolve, true), time); + }); + } +}); diff --git a/node_modules/core-js/library/modules/core.dict.js b/node_modules/core-js/library/modules/core.dict.js new file mode 100644 index 000000000..5422ad30d --- /dev/null +++ b/node_modules/core-js/library/modules/core.dict.js @@ -0,0 +1,157 @@ +'use strict'; +var ctx = require('./_ctx'); +var $export = require('./_export'); +var createDesc = require('./_property-desc'); +var assign = require('./_object-assign'); +var create = require('./_object-create'); +var getPrototypeOf = require('./_object-gpo'); +var getKeys = require('./_object-keys'); +var dP = require('./_object-dp'); +var keyOf = require('./_keyof'); +var aFunction = require('./_a-function'); +var forOf = require('./_for-of'); +var isIterable = require('./core.is-iterable'); +var $iterCreate = require('./_iter-create'); +var step = require('./_iter-step'); +var isObject = require('./_is-object'); +var toIObject = require('./_to-iobject'); +var DESCRIPTORS = require('./_descriptors'); +var has = require('./_has'); + +// 0 -> Dict.forEach +// 1 -> Dict.map +// 2 -> Dict.filter +// 3 -> Dict.some +// 4 -> Dict.every +// 5 -> Dict.find +// 6 -> Dict.findKey +// 7 -> Dict.mapPairs +var createDictMethod = function (TYPE) { + var IS_MAP = TYPE == 1; + var IS_EVERY = TYPE == 4; + return function (object, callbackfn, that /* = undefined */) { + var f = ctx(callbackfn, that, 3); + var O = toIObject(object); + var result = IS_MAP || TYPE == 7 || TYPE == 2 + ? new (typeof this == 'function' ? this : Dict)() : undefined; + var key, val, res; + for (key in O) if (has(O, key)) { + val = O[key]; + res = f(val, key, object); + if (TYPE) { + if (IS_MAP) result[key] = res; // map + else if (res) switch (TYPE) { + case 2: result[key] = val; break; // filter + case 3: return true; // some + case 5: return val; // find + case 6: return key; // findKey + case 7: result[res[0]] = res[1]; // mapPairs + } else if (IS_EVERY) return false; // every + } + } + return TYPE == 3 || IS_EVERY ? IS_EVERY : result; + }; +}; +var findKey = createDictMethod(6); + +var createDictIter = function (kind) { + return function (it) { + return new DictIterator(it, kind); + }; +}; +var DictIterator = function (iterated, kind) { + this._t = toIObject(iterated); // target + this._a = getKeys(iterated); // keys + this._i = 0; // next index + this._k = kind; // kind +}; +$iterCreate(DictIterator, 'Dict', function () { + var that = this; + var O = that._t; + var keys = that._a; + var kind = that._k; + var key; + do { + if (that._i >= keys.length) { + that._t = undefined; + return step(1); + } + } while (!has(O, key = keys[that._i++])); + if (kind == 'keys') return step(0, key); + if (kind == 'values') return step(0, O[key]); + return step(0, [key, O[key]]); +}); + +function Dict(iterable) { + var dict = create(null); + if (iterable != undefined) { + if (isIterable(iterable)) { + forOf(iterable, true, function (key, value) { + dict[key] = value; + }); + } else assign(dict, iterable); + } + return dict; +} +Dict.prototype = null; + +function reduce(object, mapfn, init) { + aFunction(mapfn); + var O = toIObject(object); + var keys = getKeys(O); + var length = keys.length; + var i = 0; + var memo, key; + if (arguments.length < 3) { + if (!length) throw TypeError('Reduce of empty object with no initial value'); + memo = O[keys[i++]]; + } else memo = Object(init); + while (length > i) if (has(O, key = keys[i++])) { + memo = mapfn(memo, O[key], key, object); + } + return memo; +} + +function includes(object, el) { + // eslint-disable-next-line no-self-compare + return (el == el ? keyOf(object, el) : findKey(object, function (it) { + // eslint-disable-next-line no-self-compare + return it != it; + })) !== undefined; +} + +function get(object, key) { + if (has(object, key)) return object[key]; +} +function set(object, key, value) { + if (DESCRIPTORS && key in Object) dP.f(object, key, createDesc(0, value)); + else object[key] = value; + return object; +} + +function isDict(it) { + return isObject(it) && getPrototypeOf(it) === Dict.prototype; +} + +$export($export.G + $export.F, { Dict: Dict }); + +$export($export.S, 'Dict', { + keys: createDictIter('keys'), + values: createDictIter('values'), + entries: createDictIter('entries'), + forEach: createDictMethod(0), + map: createDictMethod(1), + filter: createDictMethod(2), + some: createDictMethod(3), + every: createDictMethod(4), + find: createDictMethod(5), + findKey: findKey, + mapPairs: createDictMethod(7), + reduce: reduce, + keyOf: keyOf, + includes: includes, + has: has, + get: get, + set: set, + isDict: isDict +}); diff --git a/node_modules/core-js/library/modules/core.function.part.js b/node_modules/core-js/library/modules/core.function.part.js new file mode 100644 index 000000000..050154f85 --- /dev/null +++ b/node_modules/core-js/library/modules/core.function.part.js @@ -0,0 +1,7 @@ +var path = require('./_path'); +var $export = require('./_export'); + +// Placeholder +require('./_core')._ = path._ = path._ || {}; + +$export($export.P + $export.F, 'Function', { part: require('./_partial') }); diff --git a/node_modules/core-js/library/modules/core.get-iterator-method.js b/node_modules/core-js/library/modules/core.get-iterator-method.js new file mode 100644 index 000000000..9b6fa62a5 --- /dev/null +++ b/node_modules/core-js/library/modules/core.get-iterator-method.js @@ -0,0 +1,8 @@ +var classof = require('./_classof'); +var ITERATOR = require('./_wks')('iterator'); +var Iterators = require('./_iterators'); +module.exports = require('./_core').getIteratorMethod = function (it) { + if (it != undefined) return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; +}; diff --git a/node_modules/core-js/library/modules/core.get-iterator.js b/node_modules/core-js/library/modules/core.get-iterator.js new file mode 100644 index 000000000..04568c86c --- /dev/null +++ b/node_modules/core-js/library/modules/core.get-iterator.js @@ -0,0 +1,7 @@ +var anObject = require('./_an-object'); +var get = require('./core.get-iterator-method'); +module.exports = require('./_core').getIterator = function (it) { + var iterFn = get(it); + if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!'); + return anObject(iterFn.call(it)); +}; diff --git a/node_modules/core-js/library/modules/core.is-iterable.js b/node_modules/core-js/library/modules/core.is-iterable.js new file mode 100644 index 000000000..388e5e35b --- /dev/null +++ b/node_modules/core-js/library/modules/core.is-iterable.js @@ -0,0 +1,10 @@ +var classof = require('./_classof'); +var ITERATOR = require('./_wks')('iterator'); +var Iterators = require('./_iterators'); +module.exports = require('./_core').isIterable = function (it) { + var O = Object(it); + return O[ITERATOR] !== undefined + || '@@iterator' in O + // eslint-disable-next-line no-prototype-builtins + || Iterators.hasOwnProperty(classof(O)); +}; diff --git a/node_modules/core-js/library/modules/core.number.iterator.js b/node_modules/core-js/library/modules/core.number.iterator.js new file mode 100644 index 000000000..fa37791eb --- /dev/null +++ b/node_modules/core-js/library/modules/core.number.iterator.js @@ -0,0 +1,9 @@ +'use strict'; +require('./_iter-define')(Number, 'Number', function (iterated) { + this._l = +iterated; + this._i = 0; +}, function () { + var i = this._i++; + var done = !(i < this._l); + return { done: done, value: done ? undefined : i }; +}); diff --git a/node_modules/core-js/library/modules/core.object.classof.js b/node_modules/core-js/library/modules/core.object.classof.js new file mode 100644 index 000000000..fe16595a5 --- /dev/null +++ b/node_modules/core-js/library/modules/core.object.classof.js @@ -0,0 +1,3 @@ +var $export = require('./_export'); + +$export($export.S + $export.F, 'Object', { classof: require('./_classof') }); diff --git a/node_modules/core-js/library/modules/core.object.define.js b/node_modules/core-js/library/modules/core.object.define.js new file mode 100644 index 000000000..e4e717b58 --- /dev/null +++ b/node_modules/core-js/library/modules/core.object.define.js @@ -0,0 +1,4 @@ +var $export = require('./_export'); +var define = require('./_object-define'); + +$export($export.S + $export.F, 'Object', { define: define }); diff --git a/node_modules/core-js/library/modules/core.object.is-object.js b/node_modules/core-js/library/modules/core.object.is-object.js new file mode 100644 index 000000000..fea80b606 --- /dev/null +++ b/node_modules/core-js/library/modules/core.object.is-object.js @@ -0,0 +1,3 @@ +var $export = require('./_export'); + +$export($export.S + $export.F, 'Object', { isObject: require('./_is-object') }); diff --git a/node_modules/core-js/library/modules/core.object.make.js b/node_modules/core-js/library/modules/core.object.make.js new file mode 100644 index 000000000..51d47740a --- /dev/null +++ b/node_modules/core-js/library/modules/core.object.make.js @@ -0,0 +1,9 @@ +var $export = require('./_export'); +var define = require('./_object-define'); +var create = require('./_object-create'); + +$export($export.S + $export.F, 'Object', { + make: function (proto, mixin) { + return define(create(proto), mixin); + } +}); diff --git a/node_modules/core-js/library/modules/core.regexp.escape.js b/node_modules/core-js/library/modules/core.regexp.escape.js new file mode 100644 index 000000000..3ddd748c0 --- /dev/null +++ b/node_modules/core-js/library/modules/core.regexp.escape.js @@ -0,0 +1,5 @@ +// https://github.com/benjamingr/RexExp.escape +var $export = require('./_export'); +var $re = require('./_replacer')(/[\\^$*+?.()|[\]{}]/g, '\\$&'); + +$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } }); diff --git a/node_modules/core-js/library/modules/core.string.escape-html.js b/node_modules/core-js/library/modules/core.string.escape-html.js new file mode 100644 index 000000000..f96788614 --- /dev/null +++ b/node_modules/core-js/library/modules/core.string.escape-html.js @@ -0,0 +1,11 @@ +'use strict'; +var $export = require('./_export'); +var $re = require('./_replacer')(/[&<>"']/g, { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' +}); + +$export($export.P + $export.F, 'String', { escapeHTML: function escapeHTML() { return $re(this); } }); diff --git a/node_modules/core-js/library/modules/core.string.unescape-html.js b/node_modules/core-js/library/modules/core.string.unescape-html.js new file mode 100644 index 000000000..eb8a6cfbf --- /dev/null +++ b/node_modules/core-js/library/modules/core.string.unescape-html.js @@ -0,0 +1,11 @@ +'use strict'; +var $export = require('./_export'); +var $re = require('./_replacer')(/&(?:amp|lt|gt|quot|apos);/g, { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" +}); + +$export($export.P + $export.F, 'String', { unescapeHTML: function unescapeHTML() { return $re(this); } }); diff --git a/node_modules/core-js/library/modules/es5.js b/node_modules/core-js/library/modules/es5.js new file mode 100644 index 000000000..ca10612d1 --- /dev/null +++ b/node_modules/core-js/library/modules/es5.js @@ -0,0 +1,35 @@ +// This file still here for a legacy code and will be removed in a near time +require('./es6.object.create'); +require('./es6.object.define-property'); +require('./es6.object.define-properties'); +require('./es6.object.get-own-property-descriptor'); +require('./es6.object.get-prototype-of'); +require('./es6.object.keys'); +require('./es6.object.get-own-property-names'); +require('./es6.object.freeze'); +require('./es6.object.seal'); +require('./es6.object.prevent-extensions'); +require('./es6.object.is-frozen'); +require('./es6.object.is-sealed'); +require('./es6.object.is-extensible'); +require('./es6.function.bind'); +require('./es6.array.is-array'); +require('./es6.array.join'); +require('./es6.array.slice'); +require('./es6.array.sort'); +require('./es6.array.for-each'); +require('./es6.array.map'); +require('./es6.array.filter'); +require('./es6.array.some'); +require('./es6.array.every'); +require('./es6.array.reduce'); +require('./es6.array.reduce-right'); +require('./es6.array.index-of'); +require('./es6.array.last-index-of'); +require('./es6.date.now'); +require('./es6.date.to-iso-string'); +require('./es6.date.to-json'); +require('./es6.parse-int'); +require('./es6.parse-float'); +require('./es6.string.trim'); +require('./es6.regexp.to-string'); diff --git a/node_modules/core-js/library/modules/es6.array.copy-within.js b/node_modules/core-js/library/modules/es6.array.copy-within.js new file mode 100644 index 000000000..f866a9591 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.copy-within.js @@ -0,0 +1,6 @@ +// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) +var $export = require('./_export'); + +$export($export.P, 'Array', { copyWithin: require('./_array-copy-within') }); + +require('./_add-to-unscopables')('copyWithin'); diff --git a/node_modules/core-js/library/modules/es6.array.every.js b/node_modules/core-js/library/modules/es6.array.every.js new file mode 100644 index 000000000..cfd448f5c --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.every.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export'); +var $every = require('./_array-methods')(4); + +$export($export.P + $export.F * !require('./_strict-method')([].every, true), 'Array', { + // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) + every: function every(callbackfn /* , thisArg */) { + return $every(this, callbackfn, arguments[1]); + } +}); diff --git a/node_modules/core-js/library/modules/es6.array.fill.js b/node_modules/core-js/library/modules/es6.array.fill.js new file mode 100644 index 000000000..ac1714424 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.fill.js @@ -0,0 +1,6 @@ +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) +var $export = require('./_export'); + +$export($export.P, 'Array', { fill: require('./_array-fill') }); + +require('./_add-to-unscopables')('fill'); diff --git a/node_modules/core-js/library/modules/es6.array.filter.js b/node_modules/core-js/library/modules/es6.array.filter.js new file mode 100644 index 000000000..447ecf403 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.filter.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export'); +var $filter = require('./_array-methods')(2); + +$export($export.P + $export.F * !require('./_strict-method')([].filter, true), 'Array', { + // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) + filter: function filter(callbackfn /* , thisArg */) { + return $filter(this, callbackfn, arguments[1]); + } +}); diff --git a/node_modules/core-js/library/modules/es6.array.find-index.js b/node_modules/core-js/library/modules/es6.array.find-index.js new file mode 100644 index 000000000..374cadd77 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.find-index.js @@ -0,0 +1,14 @@ +'use strict'; +// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) +var $export = require('./_export'); +var $find = require('./_array-methods')(6); +var KEY = 'findIndex'; +var forced = true; +// Shouldn't skip holes +if (KEY in []) Array(1)[KEY](function () { forced = false; }); +$export($export.P + $export.F * forced, 'Array', { + findIndex: function findIndex(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); +require('./_add-to-unscopables')(KEY); diff --git a/node_modules/core-js/library/modules/es6.array.find.js b/node_modules/core-js/library/modules/es6.array.find.js new file mode 100644 index 000000000..4fbe76ce0 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.find.js @@ -0,0 +1,14 @@ +'use strict'; +// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) +var $export = require('./_export'); +var $find = require('./_array-methods')(5); +var KEY = 'find'; +var forced = true; +// Shouldn't skip holes +if (KEY in []) Array(1)[KEY](function () { forced = false; }); +$export($export.P + $export.F * forced, 'Array', { + find: function find(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); +require('./_add-to-unscopables')(KEY); diff --git a/node_modules/core-js/library/modules/es6.array.for-each.js b/node_modules/core-js/library/modules/es6.array.for-each.js new file mode 100644 index 000000000..525ba0740 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.for-each.js @@ -0,0 +1,11 @@ +'use strict'; +var $export = require('./_export'); +var $forEach = require('./_array-methods')(0); +var STRICT = require('./_strict-method')([].forEach, true); + +$export($export.P + $export.F * !STRICT, 'Array', { + // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) + forEach: function forEach(callbackfn /* , thisArg */) { + return $forEach(this, callbackfn, arguments[1]); + } +}); diff --git a/node_modules/core-js/library/modules/es6.array.from.js b/node_modules/core-js/library/modules/es6.array.from.js new file mode 100644 index 000000000..4db38017f --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.from.js @@ -0,0 +1,37 @@ +'use strict'; +var ctx = require('./_ctx'); +var $export = require('./_export'); +var toObject = require('./_to-object'); +var call = require('./_iter-call'); +var isArrayIter = require('./_is-array-iter'); +var toLength = require('./_to-length'); +var createProperty = require('./_create-property'); +var getIterFn = require('./core.get-iterator-method'); + +$export($export.S + $export.F * !require('./_iter-detect')(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; + } +}); diff --git a/node_modules/core-js/library/modules/es6.array.index-of.js b/node_modules/core-js/library/modules/es6.array.index-of.js new file mode 100644 index 000000000..231c92e9c --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.index-of.js @@ -0,0 +1,15 @@ +'use strict'; +var $export = require('./_export'); +var $indexOf = require('./_array-includes')(false); +var $native = [].indexOf; +var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; + +$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', { + // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) + indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { + return NEGATIVE_ZERO + // convert -0 to +0 + ? $native.apply(this, arguments) || 0 + : $indexOf(this, searchElement, arguments[1]); + } +}); diff --git a/node_modules/core-js/library/modules/es6.array.is-array.js b/node_modules/core-js/library/modules/es6.array.is-array.js new file mode 100644 index 000000000..27ca6fc5b --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.is-array.js @@ -0,0 +1,4 @@ +// 22.1.2.2 / 15.4.3.2 Array.isArray(arg) +var $export = require('./_export'); + +$export($export.S, 'Array', { isArray: require('./_is-array') }); diff --git a/node_modules/core-js/library/modules/es6.array.iterator.js b/node_modules/core-js/library/modules/es6.array.iterator.js new file mode 100644 index 000000000..c64e88b1b --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.iterator.js @@ -0,0 +1,34 @@ +'use strict'; +var addToUnscopables = require('./_add-to-unscopables'); +var step = require('./_iter-step'); +var Iterators = require('./_iterators'); +var toIObject = require('./_to-iobject'); + +// 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 = require('./_iter-define')(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'); diff --git a/node_modules/core-js/library/modules/es6.array.join.js b/node_modules/core-js/library/modules/es6.array.join.js new file mode 100644 index 000000000..48e55d2e3 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.join.js @@ -0,0 +1,12 @@ +'use strict'; +// 22.1.3.13 Array.prototype.join(separator) +var $export = require('./_export'); +var toIObject = require('./_to-iobject'); +var arrayJoin = [].join; + +// fallback for not array-like strings +$export($export.P + $export.F * (require('./_iobject') != Object || !require('./_strict-method')(arrayJoin)), 'Array', { + join: function join(separator) { + return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); + } +}); diff --git a/node_modules/core-js/library/modules/es6.array.last-index-of.js b/node_modules/core-js/library/modules/es6.array.last-index-of.js new file mode 100644 index 000000000..1f70e340d --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.last-index-of.js @@ -0,0 +1,22 @@ +'use strict'; +var $export = require('./_export'); +var toIObject = require('./_to-iobject'); +var toInteger = require('./_to-integer'); +var toLength = require('./_to-length'); +var $native = [].lastIndexOf; +var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; + +$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', { + // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) + lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { + // convert -0 to +0 + if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0; + var O = toIObject(this); + var length = toLength(O.length); + var index = length - 1; + if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1])); + if (index < 0) index = length + index; + for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0; + return -1; + } +}); diff --git a/node_modules/core-js/library/modules/es6.array.map.js b/node_modules/core-js/library/modules/es6.array.map.js new file mode 100644 index 000000000..1326033f1 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.map.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export'); +var $map = require('./_array-methods')(1); + +$export($export.P + $export.F * !require('./_strict-method')([].map, true), 'Array', { + // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) + map: function map(callbackfn /* , thisArg */) { + return $map(this, callbackfn, arguments[1]); + } +}); diff --git a/node_modules/core-js/library/modules/es6.array.of.js b/node_modules/core-js/library/modules/es6.array.of.js new file mode 100644 index 000000000..b83e058c1 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.of.js @@ -0,0 +1,19 @@ +'use strict'; +var $export = require('./_export'); +var createProperty = require('./_create-property'); + +// WebKit Array.of isn't generic +$export($export.S + $export.F * require('./_fails')(function () { + function F() { /* empty */ } + return !(Array.of.call(F) instanceof F); +}), 'Array', { + // 22.1.2.3 Array.of( ...items) + of: function of(/* ...args */) { + var index = 0; + var aLen = arguments.length; + var result = new (typeof this == 'function' ? this : Array)(aLen); + while (aLen > index) createProperty(result, index, arguments[index++]); + result.length = aLen; + return result; + } +}); diff --git a/node_modules/core-js/library/modules/es6.array.reduce-right.js b/node_modules/core-js/library/modules/es6.array.reduce-right.js new file mode 100644 index 000000000..168e421d8 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.reduce-right.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export'); +var $reduce = require('./_array-reduce'); + +$export($export.P + $export.F * !require('./_strict-method')([].reduceRight, true), 'Array', { + // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) + reduceRight: function reduceRight(callbackfn /* , initialValue */) { + return $reduce(this, callbackfn, arguments.length, arguments[1], true); + } +}); diff --git a/node_modules/core-js/library/modules/es6.array.reduce.js b/node_modules/core-js/library/modules/es6.array.reduce.js new file mode 100644 index 000000000..f4e476121 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.reduce.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export'); +var $reduce = require('./_array-reduce'); + +$export($export.P + $export.F * !require('./_strict-method')([].reduce, true), 'Array', { + // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) + reduce: function reduce(callbackfn /* , initialValue */) { + return $reduce(this, callbackfn, arguments.length, arguments[1], false); + } +}); diff --git a/node_modules/core-js/library/modules/es6.array.slice.js b/node_modules/core-js/library/modules/es6.array.slice.js new file mode 100644 index 000000000..bdd496ecb --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.slice.js @@ -0,0 +1,28 @@ +'use strict'; +var $export = require('./_export'); +var html = require('./_html'); +var cof = require('./_cof'); +var toAbsoluteIndex = require('./_to-absolute-index'); +var toLength = require('./_to-length'); +var arraySlice = [].slice; + +// fallback for not array-like ES3 strings and DOM objects +$export($export.P + $export.F * require('./_fails')(function () { + if (html) arraySlice.call(html); +}), 'Array', { + slice: function slice(begin, end) { + var len = toLength(this.length); + var klass = cof(this); + end = end === undefined ? len : end; + if (klass == 'Array') return arraySlice.call(this, begin, end); + var start = toAbsoluteIndex(begin, len); + var upTo = toAbsoluteIndex(end, len); + var size = toLength(upTo - start); + var cloned = new Array(size); + var i = 0; + for (; i < size; i++) cloned[i] = klass == 'String' + ? this.charAt(start + i) + : this[start + i]; + return cloned; + } +}); diff --git a/node_modules/core-js/library/modules/es6.array.some.js b/node_modules/core-js/library/modules/es6.array.some.js new file mode 100644 index 000000000..14c5eec26 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.some.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export'); +var $some = require('./_array-methods')(3); + +$export($export.P + $export.F * !require('./_strict-method')([].some, true), 'Array', { + // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) + some: function some(callbackfn /* , thisArg */) { + return $some(this, callbackfn, arguments[1]); + } +}); diff --git a/node_modules/core-js/library/modules/es6.array.sort.js b/node_modules/core-js/library/modules/es6.array.sort.js new file mode 100644 index 000000000..39817ffae --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.sort.js @@ -0,0 +1,23 @@ +'use strict'; +var $export = require('./_export'); +var aFunction = require('./_a-function'); +var toObject = require('./_to-object'); +var fails = require('./_fails'); +var $sort = [].sort; +var test = [1, 2, 3]; + +$export($export.P + $export.F * (fails(function () { + // IE8- + test.sort(undefined); +}) || !fails(function () { + // V8 bug + test.sort(null); + // Old WebKit +}) || !require('./_strict-method')($sort)), 'Array', { + // 22.1.3.25 Array.prototype.sort(comparefn) + sort: function sort(comparefn) { + return comparefn === undefined + ? $sort.call(toObject(this)) + : $sort.call(toObject(this), aFunction(comparefn)); + } +}); diff --git a/node_modules/core-js/library/modules/es6.array.species.js b/node_modules/core-js/library/modules/es6.array.species.js new file mode 100644 index 000000000..ce0b8917f --- /dev/null +++ b/node_modules/core-js/library/modules/es6.array.species.js @@ -0,0 +1 @@ +require('./_set-species')('Array'); diff --git a/node_modules/core-js/library/modules/es6.date.now.js b/node_modules/core-js/library/modules/es6.date.now.js new file mode 100644 index 000000000..65f134e56 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.date.now.js @@ -0,0 +1,4 @@ +// 20.3.3.1 / 15.9.4.4 Date.now() +var $export = require('./_export'); + +$export($export.S, 'Date', { now: function () { return new Date().getTime(); } }); diff --git a/node_modules/core-js/library/modules/es6.date.to-iso-string.js b/node_modules/core-js/library/modules/es6.date.to-iso-string.js new file mode 100644 index 000000000..13b27818c --- /dev/null +++ b/node_modules/core-js/library/modules/es6.date.to-iso-string.js @@ -0,0 +1,8 @@ +// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() +var $export = require('./_export'); +var toISOString = require('./_date-to-iso-string'); + +// PhantomJS / old WebKit has a broken implementations +$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', { + toISOString: toISOString +}); diff --git a/node_modules/core-js/library/modules/es6.date.to-json.js b/node_modules/core-js/library/modules/es6.date.to-json.js new file mode 100644 index 000000000..69b1f3018 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.date.to-json.js @@ -0,0 +1,19 @@ +'use strict'; +var $export = require('./_export'); +var toObject = require('./_to-object'); +var toPrimitive = require('./_to-primitive'); +var toISOString = require('./_date-to-iso-string'); +var classof = require('./_classof'); + +$export($export.P + $export.F * require('./_fails')(function () { + return new Date(NaN).toJSON() !== null + || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; +}), 'Date', { + // eslint-disable-next-line no-unused-vars + toJSON: function toJSON(key) { + var O = toObject(this); + var pv = toPrimitive(O); + return typeof pv == 'number' && !isFinite(pv) ? null : + (!('toISOString' in O) && classof(O) == 'Date') ? toISOString.call(O) : O.toISOString(); + } +}); diff --git a/node_modules/core-js/library/modules/es6.date.to-primitive.js b/node_modules/core-js/library/modules/es6.date.to-primitive.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/core-js/library/modules/es6.date.to-string.js b/node_modules/core-js/library/modules/es6.date.to-string.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/core-js/library/modules/es6.function.bind.js b/node_modules/core-js/library/modules/es6.function.bind.js new file mode 100644 index 000000000..38e84e1ac --- /dev/null +++ b/node_modules/core-js/library/modules/es6.function.bind.js @@ -0,0 +1,4 @@ +// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) +var $export = require('./_export'); + +$export($export.P, 'Function', { bind: require('./_bind') }); diff --git a/node_modules/core-js/library/modules/es6.function.has-instance.js b/node_modules/core-js/library/modules/es6.function.has-instance.js new file mode 100644 index 000000000..7556ed9bd --- /dev/null +++ b/node_modules/core-js/library/modules/es6.function.has-instance.js @@ -0,0 +1,13 @@ +'use strict'; +var isObject = require('./_is-object'); +var getPrototypeOf = require('./_object-gpo'); +var HAS_INSTANCE = require('./_wks')('hasInstance'); +var FunctionProto = Function.prototype; +// 19.2.3.6 Function.prototype[@@hasInstance](V) +if (!(HAS_INSTANCE in FunctionProto)) require('./_object-dp').f(FunctionProto, HAS_INSTANCE, { value: function (O) { + if (typeof this != 'function' || !isObject(O)) return false; + if (!isObject(this.prototype)) return O instanceof this; + // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: + while (O = getPrototypeOf(O)) if (this.prototype === O) return true; + return false; +} }); diff --git a/node_modules/core-js/library/modules/es6.function.name.js b/node_modules/core-js/library/modules/es6.function.name.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/core-js/library/modules/es6.map.js b/node_modules/core-js/library/modules/es6.map.js new file mode 100644 index 000000000..a282f0222 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.map.js @@ -0,0 +1,19 @@ +'use strict'; +var strong = require('./_collection-strong'); +var validate = require('./_validate-collection'); +var MAP = 'Map'; + +// 23.1 Map Objects +module.exports = require('./_collection')(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); diff --git a/node_modules/core-js/library/modules/es6.math.acosh.js b/node_modules/core-js/library/modules/es6.math.acosh.js new file mode 100644 index 000000000..8a8989ebb --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.acosh.js @@ -0,0 +1,18 @@ +// 20.2.2.3 Math.acosh(x) +var $export = require('./_export'); +var log1p = require('./_math-log1p'); +var sqrt = Math.sqrt; +var $acosh = Math.acosh; + +$export($export.S + $export.F * !($acosh + // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 + && Math.floor($acosh(Number.MAX_VALUE)) == 710 + // Tor Browser bug: Math.acosh(Infinity) -> NaN + && $acosh(Infinity) == Infinity +), 'Math', { + acosh: function acosh(x) { + return (x = +x) < 1 ? NaN : x > 94906265.62425156 + ? Math.log(x) + Math.LN2 + : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); + } +}); diff --git a/node_modules/core-js/library/modules/es6.math.asinh.js b/node_modules/core-js/library/modules/es6.math.asinh.js new file mode 100644 index 000000000..ddf466628 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.asinh.js @@ -0,0 +1,10 @@ +// 20.2.2.5 Math.asinh(x) +var $export = require('./_export'); +var $asinh = Math.asinh; + +function asinh(x) { + return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); +} + +// Tor Browser bug: Math.asinh(0) -> -0 +$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh }); diff --git a/node_modules/core-js/library/modules/es6.math.atanh.js b/node_modules/core-js/library/modules/es6.math.atanh.js new file mode 100644 index 000000000..af3c3e809 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.atanh.js @@ -0,0 +1,10 @@ +// 20.2.2.7 Math.atanh(x) +var $export = require('./_export'); +var $atanh = Math.atanh; + +// Tor Browser bug: Math.atanh(-0) -> 0 +$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { + atanh: function atanh(x) { + return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; + } +}); diff --git a/node_modules/core-js/library/modules/es6.math.cbrt.js b/node_modules/core-js/library/modules/es6.math.cbrt.js new file mode 100644 index 000000000..e45ac4445 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.cbrt.js @@ -0,0 +1,9 @@ +// 20.2.2.9 Math.cbrt(x) +var $export = require('./_export'); +var sign = require('./_math-sign'); + +$export($export.S, 'Math', { + cbrt: function cbrt(x) { + return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); + } +}); diff --git a/node_modules/core-js/library/modules/es6.math.clz32.js b/node_modules/core-js/library/modules/es6.math.clz32.js new file mode 100644 index 000000000..1e4d7e19c --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.clz32.js @@ -0,0 +1,8 @@ +// 20.2.2.11 Math.clz32(x) +var $export = require('./_export'); + +$export($export.S, 'Math', { + clz32: function clz32(x) { + return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; + } +}); diff --git a/node_modules/core-js/library/modules/es6.math.cosh.js b/node_modules/core-js/library/modules/es6.math.cosh.js new file mode 100644 index 000000000..1e0cffc1a --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.cosh.js @@ -0,0 +1,9 @@ +// 20.2.2.12 Math.cosh(x) +var $export = require('./_export'); +var exp = Math.exp; + +$export($export.S, 'Math', { + cosh: function cosh(x) { + return (exp(x = +x) + exp(-x)) / 2; + } +}); diff --git a/node_modules/core-js/library/modules/es6.math.expm1.js b/node_modules/core-js/library/modules/es6.math.expm1.js new file mode 100644 index 000000000..da4c90df8 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.expm1.js @@ -0,0 +1,5 @@ +// 20.2.2.14 Math.expm1(x) +var $export = require('./_export'); +var $expm1 = require('./_math-expm1'); + +$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 }); diff --git a/node_modules/core-js/library/modules/es6.math.fround.js b/node_modules/core-js/library/modules/es6.math.fround.js new file mode 100644 index 000000000..9c262f2ec --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.fround.js @@ -0,0 +1,4 @@ +// 20.2.2.16 Math.fround(x) +var $export = require('./_export'); + +$export($export.S, 'Math', { fround: require('./_math-fround') }); diff --git a/node_modules/core-js/library/modules/es6.math.hypot.js b/node_modules/core-js/library/modules/es6.math.hypot.js new file mode 100644 index 000000000..41ffdb27a --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.hypot.js @@ -0,0 +1,25 @@ +// 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) +var $export = require('./_export'); +var abs = Math.abs; + +$export($export.S, 'Math', { + hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars + var sum = 0; + var i = 0; + var aLen = arguments.length; + var larg = 0; + var arg, div; + while (i < aLen) { + arg = abs(arguments[i++]); + if (larg < arg) { + div = larg / arg; + sum = sum * div * div + 1; + larg = arg; + } else if (arg > 0) { + div = arg / larg; + sum += div * div; + } else sum += arg; + } + return larg === Infinity ? Infinity : larg * Math.sqrt(sum); + } +}); diff --git a/node_modules/core-js/library/modules/es6.math.imul.js b/node_modules/core-js/library/modules/es6.math.imul.js new file mode 100644 index 000000000..96e683d25 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.imul.js @@ -0,0 +1,17 @@ +// 20.2.2.18 Math.imul(x, y) +var $export = require('./_export'); +var $imul = Math.imul; + +// some WebKit versions fails with big numbers, some has wrong arity +$export($export.S + $export.F * require('./_fails')(function () { + return $imul(0xffffffff, 5) != -5 || $imul.length != 2; +}), 'Math', { + imul: function imul(x, y) { + var UINT16 = 0xffff; + var xn = +x; + var yn = +y; + var xl = UINT16 & xn; + var yl = UINT16 & yn; + return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); + } +}); diff --git a/node_modules/core-js/library/modules/es6.math.log10.js b/node_modules/core-js/library/modules/es6.math.log10.js new file mode 100644 index 000000000..9ee8ae68f --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.log10.js @@ -0,0 +1,8 @@ +// 20.2.2.21 Math.log10(x) +var $export = require('./_export'); + +$export($export.S, 'Math', { + log10: function log10(x) { + return Math.log(x) * Math.LOG10E; + } +}); diff --git a/node_modules/core-js/library/modules/es6.math.log1p.js b/node_modules/core-js/library/modules/es6.math.log1p.js new file mode 100644 index 000000000..62959800a --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.log1p.js @@ -0,0 +1,4 @@ +// 20.2.2.20 Math.log1p(x) +var $export = require('./_export'); + +$export($export.S, 'Math', { log1p: require('./_math-log1p') }); diff --git a/node_modules/core-js/library/modules/es6.math.log2.js b/node_modules/core-js/library/modules/es6.math.log2.js new file mode 100644 index 000000000..03d127cba --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.log2.js @@ -0,0 +1,8 @@ +// 20.2.2.22 Math.log2(x) +var $export = require('./_export'); + +$export($export.S, 'Math', { + log2: function log2(x) { + return Math.log(x) / Math.LN2; + } +}); diff --git a/node_modules/core-js/library/modules/es6.math.sign.js b/node_modules/core-js/library/modules/es6.math.sign.js new file mode 100644 index 000000000..981f69e56 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.sign.js @@ -0,0 +1,4 @@ +// 20.2.2.28 Math.sign(x) +var $export = require('./_export'); + +$export($export.S, 'Math', { sign: require('./_math-sign') }); diff --git a/node_modules/core-js/library/modules/es6.math.sinh.js b/node_modules/core-js/library/modules/es6.math.sinh.js new file mode 100644 index 000000000..57606333c --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.sinh.js @@ -0,0 +1,15 @@ +// 20.2.2.30 Math.sinh(x) +var $export = require('./_export'); +var expm1 = require('./_math-expm1'); +var exp = Math.exp; + +// V8 near Chromium 38 has a problem with very small numbers +$export($export.S + $export.F * require('./_fails')(function () { + return !Math.sinh(-2e-17) != -2e-17; +}), 'Math', { + sinh: function sinh(x) { + return Math.abs(x = +x) < 1 + ? (expm1(x) - expm1(-x)) / 2 + : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); + } +}); diff --git a/node_modules/core-js/library/modules/es6.math.tanh.js b/node_modules/core-js/library/modules/es6.math.tanh.js new file mode 100644 index 000000000..0d3135b0f --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.tanh.js @@ -0,0 +1,12 @@ +// 20.2.2.33 Math.tanh(x) +var $export = require('./_export'); +var expm1 = require('./_math-expm1'); +var exp = Math.exp; + +$export($export.S, 'Math', { + tanh: function tanh(x) { + var a = expm1(x = +x); + var b = expm1(-x); + return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); + } +}); diff --git a/node_modules/core-js/library/modules/es6.math.trunc.js b/node_modules/core-js/library/modules/es6.math.trunc.js new file mode 100644 index 000000000..35ddb8086 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.math.trunc.js @@ -0,0 +1,8 @@ +// 20.2.2.34 Math.trunc(x) +var $export = require('./_export'); + +$export($export.S, 'Math', { + trunc: function trunc(it) { + return (it > 0 ? Math.floor : Math.ceil)(it); + } +}); diff --git a/node_modules/core-js/library/modules/es6.number.constructor.js b/node_modules/core-js/library/modules/es6.number.constructor.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/core-js/library/modules/es6.number.epsilon.js b/node_modules/core-js/library/modules/es6.number.epsilon.js new file mode 100644 index 000000000..34a2ec5fa --- /dev/null +++ b/node_modules/core-js/library/modules/es6.number.epsilon.js @@ -0,0 +1,4 @@ +// 20.1.2.1 Number.EPSILON +var $export = require('./_export'); + +$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) }); diff --git a/node_modules/core-js/library/modules/es6.number.is-finite.js b/node_modules/core-js/library/modules/es6.number.is-finite.js new file mode 100644 index 000000000..8719da971 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.number.is-finite.js @@ -0,0 +1,9 @@ +// 20.1.2.2 Number.isFinite(number) +var $export = require('./_export'); +var _isFinite = require('./_global').isFinite; + +$export($export.S, 'Number', { + isFinite: function isFinite(it) { + return typeof it == 'number' && _isFinite(it); + } +}); diff --git a/node_modules/core-js/library/modules/es6.number.is-integer.js b/node_modules/core-js/library/modules/es6.number.is-integer.js new file mode 100644 index 000000000..f1ab5dc4c --- /dev/null +++ b/node_modules/core-js/library/modules/es6.number.is-integer.js @@ -0,0 +1,4 @@ +// 20.1.2.3 Number.isInteger(number) +var $export = require('./_export'); + +$export($export.S, 'Number', { isInteger: require('./_is-integer') }); diff --git a/node_modules/core-js/library/modules/es6.number.is-nan.js b/node_modules/core-js/library/modules/es6.number.is-nan.js new file mode 100644 index 000000000..01d76ba28 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.number.is-nan.js @@ -0,0 +1,9 @@ +// 20.1.2.4 Number.isNaN(number) +var $export = require('./_export'); + +$export($export.S, 'Number', { + isNaN: function isNaN(number) { + // eslint-disable-next-line no-self-compare + return number != number; + } +}); diff --git a/node_modules/core-js/library/modules/es6.number.is-safe-integer.js b/node_modules/core-js/library/modules/es6.number.is-safe-integer.js new file mode 100644 index 000000000..004e7d16f --- /dev/null +++ b/node_modules/core-js/library/modules/es6.number.is-safe-integer.js @@ -0,0 +1,10 @@ +// 20.1.2.5 Number.isSafeInteger(number) +var $export = require('./_export'); +var isInteger = require('./_is-integer'); +var abs = Math.abs; + +$export($export.S, 'Number', { + isSafeInteger: function isSafeInteger(number) { + return isInteger(number) && abs(number) <= 0x1fffffffffffff; + } +}); diff --git a/node_modules/core-js/library/modules/es6.number.max-safe-integer.js b/node_modules/core-js/library/modules/es6.number.max-safe-integer.js new file mode 100644 index 000000000..a4f248f1b --- /dev/null +++ b/node_modules/core-js/library/modules/es6.number.max-safe-integer.js @@ -0,0 +1,4 @@ +// 20.1.2.6 Number.MAX_SAFE_INTEGER +var $export = require('./_export'); + +$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); diff --git a/node_modules/core-js/library/modules/es6.number.min-safe-integer.js b/node_modules/core-js/library/modules/es6.number.min-safe-integer.js new file mode 100644 index 000000000..34df374bc --- /dev/null +++ b/node_modules/core-js/library/modules/es6.number.min-safe-integer.js @@ -0,0 +1,4 @@ +// 20.1.2.10 Number.MIN_SAFE_INTEGER +var $export = require('./_export'); + +$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff }); diff --git a/node_modules/core-js/library/modules/es6.number.parse-float.js b/node_modules/core-js/library/modules/es6.number.parse-float.js new file mode 100644 index 000000000..317c43109 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.number.parse-float.js @@ -0,0 +1,4 @@ +var $export = require('./_export'); +var $parseFloat = require('./_parse-float'); +// 20.1.2.12 Number.parseFloat(string) +$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat }); diff --git a/node_modules/core-js/library/modules/es6.number.parse-int.js b/node_modules/core-js/library/modules/es6.number.parse-int.js new file mode 100644 index 000000000..cb48da28d --- /dev/null +++ b/node_modules/core-js/library/modules/es6.number.parse-int.js @@ -0,0 +1,4 @@ +var $export = require('./_export'); +var $parseInt = require('./_parse-int'); +// 20.1.2.13 Number.parseInt(string, radix) +$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt }); diff --git a/node_modules/core-js/library/modules/es6.number.to-fixed.js b/node_modules/core-js/library/modules/es6.number.to-fixed.js new file mode 100644 index 000000000..2bf78af91 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.number.to-fixed.js @@ -0,0 +1,114 @@ +'use strict'; +var $export = require('./_export'); +var toInteger = require('./_to-integer'); +var aNumberValue = require('./_a-number-value'); +var repeat = require('./_string-repeat'); +var $toFixed = 1.0.toFixed; +var floor = Math.floor; +var data = [0, 0, 0, 0, 0, 0]; +var ERROR = 'Number.toFixed: incorrect invocation!'; +var ZERO = '0'; + +var multiply = function (n, c) { + var i = -1; + var c2 = c; + while (++i < 6) { + c2 += n * data[i]; + data[i] = c2 % 1e7; + c2 = floor(c2 / 1e7); + } +}; +var divide = function (n) { + var i = 6; + var c = 0; + while (--i >= 0) { + c += data[i]; + data[i] = floor(c / n); + c = (c % n) * 1e7; + } +}; +var numToString = function () { + var i = 6; + var s = ''; + while (--i >= 0) { + if (s !== '' || i === 0 || data[i] !== 0) { + var t = String(data[i]); + s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; + } + } return s; +}; +var pow = function (x, n, acc) { + return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); +}; +var log = function (x) { + var n = 0; + var x2 = x; + while (x2 >= 4096) { + n += 12; + x2 /= 4096; + } + while (x2 >= 2) { + n += 1; + x2 /= 2; + } return n; +}; + +$export($export.P + $export.F * (!!$toFixed && ( + 0.00008.toFixed(3) !== '0.000' || + 0.9.toFixed(0) !== '1' || + 1.255.toFixed(2) !== '1.25' || + 1000000000000000128.0.toFixed(0) !== '1000000000000000128' +) || !require('./_fails')(function () { + // V8 ~ Android 4.3- + $toFixed.call({}); +})), 'Number', { + toFixed: function toFixed(fractionDigits) { + var x = aNumberValue(this, ERROR); + var f = toInteger(fractionDigits); + var s = ''; + var m = ZERO; + var e, z, j, k; + if (f < 0 || f > 20) throw RangeError(ERROR); + // eslint-disable-next-line no-self-compare + if (x != x) return 'NaN'; + if (x <= -1e21 || x >= 1e21) return String(x); + if (x < 0) { + s = '-'; + x = -x; + } + if (x > 1e-21) { + e = log(x * pow(2, 69, 1)) - 69; + z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); + z *= 0x10000000000000; + e = 52 - e; + if (e > 0) { + multiply(0, z); + j = f; + while (j >= 7) { + multiply(1e7, 0); + j -= 7; + } + multiply(pow(10, j, 1), 0); + j = e - 1; + while (j >= 23) { + divide(1 << 23); + j -= 23; + } + divide(1 << j); + multiply(1, 1); + divide(2); + m = numToString(); + } else { + multiply(0, z); + multiply(1 << -e, 0); + m = numToString() + repeat.call(ZERO, f); + } + } + if (f > 0) { + k = m.length; + m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); + } else { + m = s + m; + } return m; + } +}); diff --git a/node_modules/core-js/library/modules/es6.number.to-precision.js b/node_modules/core-js/library/modules/es6.number.to-precision.js new file mode 100644 index 000000000..0d92527ff --- /dev/null +++ b/node_modules/core-js/library/modules/es6.number.to-precision.js @@ -0,0 +1,18 @@ +'use strict'; +var $export = require('./_export'); +var $fails = require('./_fails'); +var aNumberValue = require('./_a-number-value'); +var $toPrecision = 1.0.toPrecision; + +$export($export.P + $export.F * ($fails(function () { + // IE7- + return $toPrecision.call(1, undefined) !== '1'; +}) || !$fails(function () { + // V8 ~ Android 4.3- + $toPrecision.call({}); +})), 'Number', { + toPrecision: function toPrecision(precision) { + var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); + return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); + } +}); diff --git a/node_modules/core-js/library/modules/es6.object.assign.js b/node_modules/core-js/library/modules/es6.object.assign.js new file mode 100644 index 000000000..d28085a7e --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.assign.js @@ -0,0 +1,4 @@ +// 19.1.3.1 Object.assign(target, source) +var $export = require('./_export'); + +$export($export.S + $export.F, 'Object', { assign: require('./_object-assign') }); diff --git a/node_modules/core-js/library/modules/es6.object.create.js b/node_modules/core-js/library/modules/es6.object.create.js new file mode 100644 index 000000000..70627d69c --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.create.js @@ -0,0 +1,3 @@ +var $export = require('./_export'); +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +$export($export.S, 'Object', { create: require('./_object-create') }); diff --git a/node_modules/core-js/library/modules/es6.object.define-properties.js b/node_modules/core-js/library/modules/es6.object.define-properties.js new file mode 100644 index 000000000..5ec34214d --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.define-properties.js @@ -0,0 +1,3 @@ +var $export = require('./_export'); +// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) +$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperties: require('./_object-dps') }); diff --git a/node_modules/core-js/library/modules/es6.object.define-property.js b/node_modules/core-js/library/modules/es6.object.define-property.js new file mode 100644 index 000000000..120685825 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.define-property.js @@ -0,0 +1,3 @@ +var $export = require('./_export'); +// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) +$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperty: require('./_object-dp').f }); diff --git a/node_modules/core-js/library/modules/es6.object.freeze.js b/node_modules/core-js/library/modules/es6.object.freeze.js new file mode 100644 index 000000000..0856ce9d7 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.freeze.js @@ -0,0 +1,9 @@ +// 19.1.2.5 Object.freeze(O) +var isObject = require('./_is-object'); +var meta = require('./_meta').onFreeze; + +require('./_object-sap')('freeze', function ($freeze) { + return function freeze(it) { + return $freeze && isObject(it) ? $freeze(meta(it)) : it; + }; +}); diff --git a/node_modules/core-js/library/modules/es6.object.get-own-property-descriptor.js b/node_modules/core-js/library/modules/es6.object.get-own-property-descriptor.js new file mode 100644 index 000000000..9df214172 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.get-own-property-descriptor.js @@ -0,0 +1,9 @@ +// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) +var toIObject = require('./_to-iobject'); +var $getOwnPropertyDescriptor = require('./_object-gopd').f; + +require('./_object-sap')('getOwnPropertyDescriptor', function () { + return function getOwnPropertyDescriptor(it, key) { + return $getOwnPropertyDescriptor(toIObject(it), key); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.object.get-own-property-names.js b/node_modules/core-js/library/modules/es6.object.get-own-property-names.js new file mode 100644 index 000000000..172f51c73 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.get-own-property-names.js @@ -0,0 +1,4 @@ +// 19.1.2.7 Object.getOwnPropertyNames(O) +require('./_object-sap')('getOwnPropertyNames', function () { + return require('./_object-gopn-ext').f; +}); diff --git a/node_modules/core-js/library/modules/es6.object.get-prototype-of.js b/node_modules/core-js/library/modules/es6.object.get-prototype-of.js new file mode 100644 index 000000000..8fe2728c0 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.get-prototype-of.js @@ -0,0 +1,9 @@ +// 19.1.2.9 Object.getPrototypeOf(O) +var toObject = require('./_to-object'); +var $getPrototypeOf = require('./_object-gpo'); + +require('./_object-sap')('getPrototypeOf', function () { + return function getPrototypeOf(it) { + return $getPrototypeOf(toObject(it)); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.object.is-extensible.js b/node_modules/core-js/library/modules/es6.object.is-extensible.js new file mode 100644 index 000000000..5cd4575a5 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.is-extensible.js @@ -0,0 +1,8 @@ +// 19.1.2.11 Object.isExtensible(O) +var isObject = require('./_is-object'); + +require('./_object-sap')('isExtensible', function ($isExtensible) { + return function isExtensible(it) { + return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; + }; +}); diff --git a/node_modules/core-js/library/modules/es6.object.is-frozen.js b/node_modules/core-js/library/modules/es6.object.is-frozen.js new file mode 100644 index 000000000..0ceeabbb0 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.is-frozen.js @@ -0,0 +1,8 @@ +// 19.1.2.12 Object.isFrozen(O) +var isObject = require('./_is-object'); + +require('./_object-sap')('isFrozen', function ($isFrozen) { + return function isFrozen(it) { + return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; + }; +}); diff --git a/node_modules/core-js/library/modules/es6.object.is-sealed.js b/node_modules/core-js/library/modules/es6.object.is-sealed.js new file mode 100644 index 000000000..7fa8ddedd --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.is-sealed.js @@ -0,0 +1,8 @@ +// 19.1.2.13 Object.isSealed(O) +var isObject = require('./_is-object'); + +require('./_object-sap')('isSealed', function ($isSealed) { + return function isSealed(it) { + return isObject(it) ? $isSealed ? $isSealed(it) : false : true; + }; +}); diff --git a/node_modules/core-js/library/modules/es6.object.is.js b/node_modules/core-js/library/modules/es6.object.is.js new file mode 100644 index 000000000..204d7030f --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.is.js @@ -0,0 +1,3 @@ +// 19.1.3.10 Object.is(value1, value2) +var $export = require('./_export'); +$export($export.S, 'Object', { is: require('./_same-value') }); diff --git a/node_modules/core-js/library/modules/es6.object.keys.js b/node_modules/core-js/library/modules/es6.object.keys.js new file mode 100644 index 000000000..e9dade7de --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.keys.js @@ -0,0 +1,9 @@ +// 19.1.2.14 Object.keys(O) +var toObject = require('./_to-object'); +var $keys = require('./_object-keys'); + +require('./_object-sap')('keys', function () { + return function keys(it) { + return $keys(toObject(it)); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.object.prevent-extensions.js b/node_modules/core-js/library/modules/es6.object.prevent-extensions.js new file mode 100644 index 000000000..2f729181f --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.prevent-extensions.js @@ -0,0 +1,9 @@ +// 19.1.2.15 Object.preventExtensions(O) +var isObject = require('./_is-object'); +var meta = require('./_meta').onFreeze; + +require('./_object-sap')('preventExtensions', function ($preventExtensions) { + return function preventExtensions(it) { + return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; + }; +}); diff --git a/node_modules/core-js/library/modules/es6.object.seal.js b/node_modules/core-js/library/modules/es6.object.seal.js new file mode 100644 index 000000000..12c3f6a3a --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.seal.js @@ -0,0 +1,9 @@ +// 19.1.2.17 Object.seal(O) +var isObject = require('./_is-object'); +var meta = require('./_meta').onFreeze; + +require('./_object-sap')('seal', function ($seal) { + return function seal(it) { + return $seal && isObject(it) ? $seal(meta(it)) : it; + }; +}); diff --git a/node_modules/core-js/library/modules/es6.object.set-prototype-of.js b/node_modules/core-js/library/modules/es6.object.set-prototype-of.js new file mode 100644 index 000000000..461dbd2ed --- /dev/null +++ b/node_modules/core-js/library/modules/es6.object.set-prototype-of.js @@ -0,0 +1,3 @@ +// 19.1.3.19 Object.setPrototypeOf(O, proto) +var $export = require('./_export'); +$export($export.S, 'Object', { setPrototypeOf: require('./_set-proto').set }); diff --git a/node_modules/core-js/library/modules/es6.object.to-string.js b/node_modules/core-js/library/modules/es6.object.to-string.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/core-js/library/modules/es6.parse-float.js b/node_modules/core-js/library/modules/es6.parse-float.js new file mode 100644 index 000000000..cbf50ead5 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.parse-float.js @@ -0,0 +1,4 @@ +var $export = require('./_export'); +var $parseFloat = require('./_parse-float'); +// 18.2.4 parseFloat(string) +$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat }); diff --git a/node_modules/core-js/library/modules/es6.parse-int.js b/node_modules/core-js/library/modules/es6.parse-int.js new file mode 100644 index 000000000..7ea358e84 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.parse-int.js @@ -0,0 +1,4 @@ +var $export = require('./_export'); +var $parseInt = require('./_parse-int'); +// 18.2.5 parseInt(string, radix) +$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt }); diff --git a/node_modules/core-js/library/modules/es6.promise.js b/node_modules/core-js/library/modules/es6.promise.js new file mode 100644 index 000000000..b0ff3bfcf --- /dev/null +++ b/node_modules/core-js/library/modules/es6.promise.js @@ -0,0 +1,286 @@ +'use strict'; +var LIBRARY = require('./_library'); +var global = require('./_global'); +var ctx = require('./_ctx'); +var classof = require('./_classof'); +var $export = require('./_export'); +var isObject = require('./_is-object'); +var aFunction = require('./_a-function'); +var anInstance = require('./_an-instance'); +var forOf = require('./_for-of'); +var speciesConstructor = require('./_species-constructor'); +var task = require('./_task').set; +var microtask = require('./_microtask')(); +var newPromiseCapabilityModule = require('./_new-promise-capability'); +var perform = require('./_perform'); +var userAgent = require('./_user-agent'); +var promiseResolve = require('./_promise-resolve'); +var PROMISE = 'Promise'; +var TypeError = global.TypeError; +var process = global.process; +var versions = process && process.versions; +var v8 = versions && versions.v8 || ''; +var $Promise = global[PROMISE]; +var isNode = classof(process) == 'process'; +var empty = function () { /* empty */ }; +var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; +var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; + +var USE_NATIVE = !!function () { + try { + // correct subclassing with @@species support + var promise = $Promise.resolve(1); + var FakePromise = (promise.constructor = {})[require('./_wks')('species')] = function (exec) { + exec(empty, empty); + }; + // unhandled rejections tracking support, NodeJS Promise without it fails @@species test + return (isNode || typeof PromiseRejectionEvent == 'function') + && promise.then(empty) instanceof FakePromise + // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables + // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 + // we can't detect it synchronously, so just check versions + && v8.indexOf('6.6') !== 0 + && userAgent.indexOf('Chrome/66') === -1; + } catch (e) { /* empty */ } +}(); + +// helpers +var isThenable = function (it) { + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; +}; +var notify = function (promise, isReject) { + if (promise._n) return; + promise._n = true; + var chain = promise._c; + microtask(function () { + var value = promise._v; + var ok = promise._s == 1; + var i = 0; + var run = function (reaction) { + var handler = ok ? reaction.ok : reaction.fail; + var resolve = reaction.resolve; + var reject = reaction.reject; + var domain = reaction.domain; + var result, then, exited; + try { + if (handler) { + if (!ok) { + if (promise._h == 2) onHandleUnhandled(promise); + promise._h = 1; + } + if (handler === true) result = value; + else { + if (domain) domain.enter(); + result = handler(value); // may throw + if (domain) { + domain.exit(); + exited = true; + } + } + if (result === reaction.promise) { + reject(TypeError('Promise-chain cycle')); + } else if (then = isThenable(result)) { + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch (e) { + if (domain && !exited) domain.exit(); + reject(e); + } + }; + while (chain.length > i) run(chain[i++]); // variable length - can't use forEach + promise._c = []; + promise._n = false; + if (isReject && !promise._h) onUnhandled(promise); + }); +}; +var onUnhandled = function (promise) { + task.call(global, function () { + var value = promise._v; + var unhandled = isUnhandled(promise); + var result, handler, console; + if (unhandled) { + result = perform(function () { + if (isNode) { + process.emit('unhandledRejection', value, promise); + } else if (handler = global.onunhandledrejection) { + handler({ promise: promise, reason: value }); + } else if ((console = global.console) && console.error) { + console.error('Unhandled promise rejection', value); + } + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + promise._h = isNode || isUnhandled(promise) ? 2 : 1; + } promise._a = undefined; + if (unhandled && result.e) throw result.v; + }); +}; +var isUnhandled = function (promise) { + return promise._h !== 1 && (promise._a || promise._c).length === 0; +}; +var onHandleUnhandled = function (promise) { + task.call(global, function () { + var handler; + if (isNode) { + process.emit('rejectionHandled', promise); + } else if (handler = global.onrejectionhandled) { + handler({ promise: promise, reason: promise._v }); + } + }); +}; +var $reject = function (value) { + var promise = this; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + promise._v = value; + promise._s = 2; + if (!promise._a) promise._a = promise._c.slice(); + notify(promise, true); +}; +var $resolve = function (value) { + var promise = this; + var then; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + try { + if (promise === value) throw TypeError("Promise can't be resolved itself"); + if (then = isThenable(value)) { + microtask(function () { + var wrapper = { _w: promise, _d: false }; // wrap + try { + then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); + } catch (e) { + $reject.call(wrapper, e); + } + }); + } else { + promise._v = value; + promise._s = 1; + notify(promise, false); + } + } catch (e) { + $reject.call({ _w: promise, _d: false }, e); // wrap + } +}; + +// constructor polyfill +if (!USE_NATIVE) { + // 25.4.3.1 Promise(executor) + $Promise = function Promise(executor) { + anInstance(this, $Promise, PROMISE, '_h'); + aFunction(executor); + Internal.call(this); + try { + executor(ctx($resolve, this, 1), ctx($reject, this, 1)); + } catch (err) { + $reject.call(this, err); + } + }; + // eslint-disable-next-line no-unused-vars + Internal = function Promise(executor) { + this._c = []; // <- awaiting reactions + this._a = undefined; // <- checked in isUnhandled reactions + this._s = 0; // <- state + this._d = false; // <- done + this._v = undefined; // <- value + this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled + this._n = false; // <- notify + }; + Internal.prototype = require('./_redefine-all')($Promise.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected) { + var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = isNode ? process.domain : undefined; + this._c.push(reaction); + if (this._a) this._a.push(reaction); + if (this._s) notify(this, false); + return reaction.promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function (onRejected) { + return this.then(undefined, onRejected); + } + }); + OwnPromiseCapability = function () { + var promise = new Internal(); + this.promise = promise; + this.resolve = ctx($resolve, promise, 1); + this.reject = ctx($reject, promise, 1); + }; + newPromiseCapabilityModule.f = newPromiseCapability = function (C) { + return C === $Promise || C === Wrapper + ? new OwnPromiseCapability(C) + : newGenericPromiseCapability(C); + }; +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); +require('./_set-to-string-tag')($Promise, PROMISE); +require('./_set-species')(PROMISE); +Wrapper = require('./_core')[PROMISE]; + +// statics +$export($export.S + $export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r) { + var capability = newPromiseCapability(this); + var $$reject = capability.reject; + $$reject(r); + return capability.promise; + } +}); +$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x) { + return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); + } +}); +$export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(function (iter) { + $Promise.all(iter)['catch'](empty); +})), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var resolve = capability.resolve; + var reject = capability.reject; + var result = perform(function () { + var values = []; + var index = 0; + var remaining = 1; + forOf(iterable, false, function (promise) { + var $index = index++; + var alreadyCalled = false; + values.push(undefined); + remaining++; + C.resolve(promise).then(function (value) { + if (alreadyCalled) return; + alreadyCalled = true; + values[$index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if (result.e) reject(result.v); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var reject = capability.reject; + var result = perform(function () { + forOf(iterable, false, function (promise) { + C.resolve(promise).then(capability.resolve, reject); + }); + }); + if (result.e) reject(result.v); + return capability.promise; + } +}); diff --git a/node_modules/core-js/library/modules/es6.reflect.apply.js b/node_modules/core-js/library/modules/es6.reflect.apply.js new file mode 100644 index 000000000..3b9c03a91 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.apply.js @@ -0,0 +1,16 @@ +// 26.1.1 Reflect.apply(target, thisArgument, argumentsList) +var $export = require('./_export'); +var aFunction = require('./_a-function'); +var anObject = require('./_an-object'); +var rApply = (require('./_global').Reflect || {}).apply; +var fApply = Function.apply; +// MS Edge argumentsList argument is optional +$export($export.S + $export.F * !require('./_fails')(function () { + rApply(function () { /* empty */ }); +}), 'Reflect', { + apply: function apply(target, thisArgument, argumentsList) { + var T = aFunction(target); + var L = anObject(argumentsList); + return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); + } +}); diff --git a/node_modules/core-js/library/modules/es6.reflect.construct.js b/node_modules/core-js/library/modules/es6.reflect.construct.js new file mode 100644 index 000000000..380addb57 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.construct.js @@ -0,0 +1,47 @@ +// 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) +var $export = require('./_export'); +var create = require('./_object-create'); +var aFunction = require('./_a-function'); +var anObject = require('./_an-object'); +var isObject = require('./_is-object'); +var fails = require('./_fails'); +var bind = require('./_bind'); +var rConstruct = (require('./_global').Reflect || {}).construct; + +// MS Edge supports only 2 arguments and argumentsList argument is optional +// FF Nightly sets third argument as `new.target`, but does not create `this` from it +var NEW_TARGET_BUG = fails(function () { + function F() { /* empty */ } + return !(rConstruct(function () { /* empty */ }, [], F) instanceof F); +}); +var ARGS_BUG = !fails(function () { + rConstruct(function () { /* empty */ }); +}); + +$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { + construct: function construct(Target, args /* , newTarget */) { + aFunction(Target); + anObject(args); + var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); + if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget); + if (Target == newTarget) { + // w/o altered newTarget, optimization for 0-4 arguments + switch (args.length) { + case 0: return new Target(); + case 1: return new Target(args[0]); + case 2: return new Target(args[0], args[1]); + case 3: return new Target(args[0], args[1], args[2]); + case 4: return new Target(args[0], args[1], args[2], args[3]); + } + // w/o altered newTarget, lot of arguments case + var $args = [null]; + $args.push.apply($args, args); + return new (bind.apply(Target, $args))(); + } + // with altered newTarget, not support built-in constructors + var proto = newTarget.prototype; + var instance = create(isObject(proto) ? proto : Object.prototype); + var result = Function.apply.call(Target, instance, args); + return isObject(result) ? result : instance; + } +}); diff --git a/node_modules/core-js/library/modules/es6.reflect.define-property.js b/node_modules/core-js/library/modules/es6.reflect.define-property.js new file mode 100644 index 000000000..be7fbde6b --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.define-property.js @@ -0,0 +1,23 @@ +// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) +var dP = require('./_object-dp'); +var $export = require('./_export'); +var anObject = require('./_an-object'); +var toPrimitive = require('./_to-primitive'); + +// MS Edge has broken Reflect.defineProperty - throwing instead of returning false +$export($export.S + $export.F * require('./_fails')(function () { + // eslint-disable-next-line no-undef + Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 }); +}), 'Reflect', { + defineProperty: function defineProperty(target, propertyKey, attributes) { + anObject(target); + propertyKey = toPrimitive(propertyKey, true); + anObject(attributes); + try { + dP.f(target, propertyKey, attributes); + return true; + } catch (e) { + return false; + } + } +}); diff --git a/node_modules/core-js/library/modules/es6.reflect.delete-property.js b/node_modules/core-js/library/modules/es6.reflect.delete-property.js new file mode 100644 index 000000000..0902b38a9 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.delete-property.js @@ -0,0 +1,11 @@ +// 26.1.4 Reflect.deleteProperty(target, propertyKey) +var $export = require('./_export'); +var gOPD = require('./_object-gopd').f; +var anObject = require('./_an-object'); + +$export($export.S, 'Reflect', { + deleteProperty: function deleteProperty(target, propertyKey) { + var desc = gOPD(anObject(target), propertyKey); + return desc && !desc.configurable ? false : delete target[propertyKey]; + } +}); diff --git a/node_modules/core-js/library/modules/es6.reflect.enumerate.js b/node_modules/core-js/library/modules/es6.reflect.enumerate.js new file mode 100644 index 000000000..9e7c76a34 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.enumerate.js @@ -0,0 +1,26 @@ +'use strict'; +// 26.1.5 Reflect.enumerate(target) +var $export = require('./_export'); +var anObject = require('./_an-object'); +var Enumerate = function (iterated) { + this._t = anObject(iterated); // target + this._i = 0; // next index + var keys = this._k = []; // keys + var key; + for (key in iterated) keys.push(key); +}; +require('./_iter-create')(Enumerate, 'Object', function () { + var that = this; + var keys = that._k; + var key; + do { + if (that._i >= keys.length) return { value: undefined, done: true }; + } while (!((key = keys[that._i++]) in that._t)); + return { value: key, done: false }; +}); + +$export($export.S, 'Reflect', { + enumerate: function enumerate(target) { + return new Enumerate(target); + } +}); diff --git a/node_modules/core-js/library/modules/es6.reflect.get-own-property-descriptor.js b/node_modules/core-js/library/modules/es6.reflect.get-own-property-descriptor.js new file mode 100644 index 000000000..e1299f906 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.get-own-property-descriptor.js @@ -0,0 +1,10 @@ +// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) +var gOPD = require('./_object-gopd'); +var $export = require('./_export'); +var anObject = require('./_an-object'); + +$export($export.S, 'Reflect', { + getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { + return gOPD.f(anObject(target), propertyKey); + } +}); diff --git a/node_modules/core-js/library/modules/es6.reflect.get-prototype-of.js b/node_modules/core-js/library/modules/es6.reflect.get-prototype-of.js new file mode 100644 index 000000000..28351d410 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.get-prototype-of.js @@ -0,0 +1,10 @@ +// 26.1.8 Reflect.getPrototypeOf(target) +var $export = require('./_export'); +var getProto = require('./_object-gpo'); +var anObject = require('./_an-object'); + +$export($export.S, 'Reflect', { + getPrototypeOf: function getPrototypeOf(target) { + return getProto(anObject(target)); + } +}); diff --git a/node_modules/core-js/library/modules/es6.reflect.get.js b/node_modules/core-js/library/modules/es6.reflect.get.js new file mode 100644 index 000000000..a7ee76667 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.get.js @@ -0,0 +1,21 @@ +// 26.1.6 Reflect.get(target, propertyKey [, receiver]) +var gOPD = require('./_object-gopd'); +var getPrototypeOf = require('./_object-gpo'); +var has = require('./_has'); +var $export = require('./_export'); +var isObject = require('./_is-object'); +var anObject = require('./_an-object'); + +function get(target, propertyKey /* , receiver */) { + var receiver = arguments.length < 3 ? target : arguments[2]; + var desc, proto; + if (anObject(target) === receiver) return target[propertyKey]; + if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value') + ? desc.value + : desc.get !== undefined + ? desc.get.call(receiver) + : undefined; + if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver); +} + +$export($export.S, 'Reflect', { get: get }); diff --git a/node_modules/core-js/library/modules/es6.reflect.has.js b/node_modules/core-js/library/modules/es6.reflect.has.js new file mode 100644 index 000000000..4f5efa992 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.has.js @@ -0,0 +1,8 @@ +// 26.1.9 Reflect.has(target, propertyKey) +var $export = require('./_export'); + +$export($export.S, 'Reflect', { + has: function has(target, propertyKey) { + return propertyKey in target; + } +}); diff --git a/node_modules/core-js/library/modules/es6.reflect.is-extensible.js b/node_modules/core-js/library/modules/es6.reflect.is-extensible.js new file mode 100644 index 000000000..700f938ac --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.is-extensible.js @@ -0,0 +1,11 @@ +// 26.1.10 Reflect.isExtensible(target) +var $export = require('./_export'); +var anObject = require('./_an-object'); +var $isExtensible = Object.isExtensible; + +$export($export.S, 'Reflect', { + isExtensible: function isExtensible(target) { + anObject(target); + return $isExtensible ? $isExtensible(target) : true; + } +}); diff --git a/node_modules/core-js/library/modules/es6.reflect.own-keys.js b/node_modules/core-js/library/modules/es6.reflect.own-keys.js new file mode 100644 index 000000000..9f2424ae8 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.own-keys.js @@ -0,0 +1,4 @@ +// 26.1.11 Reflect.ownKeys(target) +var $export = require('./_export'); + +$export($export.S, 'Reflect', { ownKeys: require('./_own-keys') }); diff --git a/node_modules/core-js/library/modules/es6.reflect.prevent-extensions.js b/node_modules/core-js/library/modules/es6.reflect.prevent-extensions.js new file mode 100644 index 000000000..e1037fa19 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.prevent-extensions.js @@ -0,0 +1,16 @@ +// 26.1.12 Reflect.preventExtensions(target) +var $export = require('./_export'); +var anObject = require('./_an-object'); +var $preventExtensions = Object.preventExtensions; + +$export($export.S, 'Reflect', { + preventExtensions: function preventExtensions(target) { + anObject(target); + try { + if ($preventExtensions) $preventExtensions(target); + return true; + } catch (e) { + return false; + } + } +}); diff --git a/node_modules/core-js/library/modules/es6.reflect.set-prototype-of.js b/node_modules/core-js/library/modules/es6.reflect.set-prototype-of.js new file mode 100644 index 000000000..5dae90122 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.set-prototype-of.js @@ -0,0 +1,15 @@ +// 26.1.14 Reflect.setPrototypeOf(target, proto) +var $export = require('./_export'); +var setProto = require('./_set-proto'); + +if (setProto) $export($export.S, 'Reflect', { + setPrototypeOf: function setPrototypeOf(target, proto) { + setProto.check(target, proto); + try { + setProto.set(target, proto); + return true; + } catch (e) { + return false; + } + } +}); diff --git a/node_modules/core-js/library/modules/es6.reflect.set.js b/node_modules/core-js/library/modules/es6.reflect.set.js new file mode 100644 index 000000000..d809d7a4e --- /dev/null +++ b/node_modules/core-js/library/modules/es6.reflect.set.js @@ -0,0 +1,33 @@ +// 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) +var dP = require('./_object-dp'); +var gOPD = require('./_object-gopd'); +var getPrototypeOf = require('./_object-gpo'); +var has = require('./_has'); +var $export = require('./_export'); +var createDesc = require('./_property-desc'); +var anObject = require('./_an-object'); +var isObject = require('./_is-object'); + +function set(target, propertyKey, V /* , receiver */) { + var receiver = arguments.length < 4 ? target : arguments[3]; + var ownDesc = gOPD.f(anObject(target), propertyKey); + var existingDescriptor, proto; + if (!ownDesc) { + if (isObject(proto = getPrototypeOf(target))) { + return set(proto, propertyKey, V, receiver); + } + ownDesc = createDesc(0); + } + if (has(ownDesc, 'value')) { + if (ownDesc.writable === false || !isObject(receiver)) return false; + if (existingDescriptor = gOPD.f(receiver, propertyKey)) { + if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false; + existingDescriptor.value = V; + dP.f(receiver, propertyKey, existingDescriptor); + } else dP.f(receiver, propertyKey, createDesc(0, V)); + return true; + } + return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); +} + +$export($export.S, 'Reflect', { set: set }); diff --git a/node_modules/core-js/library/modules/es6.regexp.constructor.js b/node_modules/core-js/library/modules/es6.regexp.constructor.js new file mode 100644 index 000000000..e85e3141a --- /dev/null +++ b/node_modules/core-js/library/modules/es6.regexp.constructor.js @@ -0,0 +1 @@ +require('./_set-species')('RegExp'); diff --git a/node_modules/core-js/library/modules/es6.regexp.flags.js b/node_modules/core-js/library/modules/es6.regexp.flags.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/core-js/library/modules/es6.regexp.match.js b/node_modules/core-js/library/modules/es6.regexp.match.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/core-js/library/modules/es6.regexp.replace.js b/node_modules/core-js/library/modules/es6.regexp.replace.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/core-js/library/modules/es6.regexp.search.js b/node_modules/core-js/library/modules/es6.regexp.search.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/core-js/library/modules/es6.regexp.split.js b/node_modules/core-js/library/modules/es6.regexp.split.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/core-js/library/modules/es6.regexp.to-string.js b/node_modules/core-js/library/modules/es6.regexp.to-string.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/core-js/library/modules/es6.set.js b/node_modules/core-js/library/modules/es6.set.js new file mode 100644 index 000000000..55b8bdd89 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.set.js @@ -0,0 +1,14 @@ +'use strict'; +var strong = require('./_collection-strong'); +var validate = require('./_validate-collection'); +var SET = 'Set'; + +// 23.2 Set Objects +module.exports = require('./_collection')(SET, function (get) { + return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value) { + return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value); + } +}, strong); diff --git a/node_modules/core-js/library/modules/es6.string.anchor.js b/node_modules/core-js/library/modules/es6.string.anchor.js new file mode 100644 index 000000000..3493e54c0 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.anchor.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.2 String.prototype.anchor(name) +require('./_string-html')('anchor', function (createHTML) { + return function anchor(name) { + return createHTML(this, 'a', 'name', name); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.string.big.js b/node_modules/core-js/library/modules/es6.string.big.js new file mode 100644 index 000000000..38aab3414 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.big.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.3 String.prototype.big() +require('./_string-html')('big', function (createHTML) { + return function big() { + return createHTML(this, 'big', '', ''); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.string.blink.js b/node_modules/core-js/library/modules/es6.string.blink.js new file mode 100644 index 000000000..6188d96e3 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.blink.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.4 String.prototype.blink() +require('./_string-html')('blink', function (createHTML) { + return function blink() { + return createHTML(this, 'blink', '', ''); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.string.bold.js b/node_modules/core-js/library/modules/es6.string.bold.js new file mode 100644 index 000000000..ff3ecb9cb --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.bold.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.5 String.prototype.bold() +require('./_string-html')('bold', function (createHTML) { + return function bold() { + return createHTML(this, 'b', '', ''); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.string.code-point-at.js b/node_modules/core-js/library/modules/es6.string.code-point-at.js new file mode 100644 index 000000000..e39b8c5ea --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.code-point-at.js @@ -0,0 +1,9 @@ +'use strict'; +var $export = require('./_export'); +var $at = require('./_string-at')(false); +$export($export.P, 'String', { + // 21.1.3.3 String.prototype.codePointAt(pos) + codePointAt: function codePointAt(pos) { + return $at(this, pos); + } +}); diff --git a/node_modules/core-js/library/modules/es6.string.ends-with.js b/node_modules/core-js/library/modules/es6.string.ends-with.js new file mode 100644 index 000000000..065688884 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.ends-with.js @@ -0,0 +1,20 @@ +// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) +'use strict'; +var $export = require('./_export'); +var toLength = require('./_to-length'); +var context = require('./_string-context'); +var ENDS_WITH = 'endsWith'; +var $endsWith = ''[ENDS_WITH]; + +$export($export.P + $export.F * require('./_fails-is-regexp')(ENDS_WITH), 'String', { + endsWith: function endsWith(searchString /* , endPosition = @length */) { + var that = context(this, searchString, ENDS_WITH); + var endPosition = arguments.length > 1 ? arguments[1] : undefined; + var len = toLength(that.length); + var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); + var search = String(searchString); + return $endsWith + ? $endsWith.call(that, search, end) + : that.slice(end - search.length, end) === search; + } +}); diff --git a/node_modules/core-js/library/modules/es6.string.fixed.js b/node_modules/core-js/library/modules/es6.string.fixed.js new file mode 100644 index 000000000..d4a60f37d --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.fixed.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.6 String.prototype.fixed() +require('./_string-html')('fixed', function (createHTML) { + return function fixed() { + return createHTML(this, 'tt', '', ''); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.string.fontcolor.js b/node_modules/core-js/library/modules/es6.string.fontcolor.js new file mode 100644 index 000000000..f7b95957c --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.fontcolor.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.7 String.prototype.fontcolor(color) +require('./_string-html')('fontcolor', function (createHTML) { + return function fontcolor(color) { + return createHTML(this, 'font', 'color', color); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.string.fontsize.js b/node_modules/core-js/library/modules/es6.string.fontsize.js new file mode 100644 index 000000000..f4cc20aec --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.fontsize.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.8 String.prototype.fontsize(size) +require('./_string-html')('fontsize', function (createHTML) { + return function fontsize(size) { + return createHTML(this, 'font', 'size', size); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.string.from-code-point.js b/node_modules/core-js/library/modules/es6.string.from-code-point.js new file mode 100644 index 000000000..bece66e29 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.from-code-point.js @@ -0,0 +1,23 @@ +var $export = require('./_export'); +var toAbsoluteIndex = require('./_to-absolute-index'); +var fromCharCode = String.fromCharCode; +var $fromCodePoint = String.fromCodePoint; + +// length should be 1, old FF problem +$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { + // 21.1.2.2 String.fromCodePoint(...codePoints) + fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars + var res = []; + var aLen = arguments.length; + var i = 0; + var code; + while (aLen > i) { + code = +arguments[i++]; + if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); + res.push(code < 0x10000 + ? fromCharCode(code) + : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) + ); + } return res.join(''); + } +}); diff --git a/node_modules/core-js/library/modules/es6.string.includes.js b/node_modules/core-js/library/modules/es6.string.includes.js new file mode 100644 index 000000000..28d17416b --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.includes.js @@ -0,0 +1,12 @@ +// 21.1.3.7 String.prototype.includes(searchString, position = 0) +'use strict'; +var $export = require('./_export'); +var context = require('./_string-context'); +var INCLUDES = 'includes'; + +$export($export.P + $export.F * require('./_fails-is-regexp')(INCLUDES), 'String', { + includes: function includes(searchString /* , position = 0 */) { + return !!~context(this, searchString, INCLUDES) + .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); + } +}); diff --git a/node_modules/core-js/library/modules/es6.string.italics.js b/node_modules/core-js/library/modules/es6.string.italics.js new file mode 100644 index 000000000..ed4cc3bf0 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.italics.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.9 String.prototype.italics() +require('./_string-html')('italics', function (createHTML) { + return function italics() { + return createHTML(this, 'i', '', ''); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.string.iterator.js b/node_modules/core-js/library/modules/es6.string.iterator.js new file mode 100644 index 000000000..5d84c7fde --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.iterator.js @@ -0,0 +1,17 @@ +'use strict'; +var $at = require('./_string-at')(true); + +// 21.1.3.27 String.prototype[@@iterator]() +require('./_iter-define')(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 }; +}); diff --git a/node_modules/core-js/library/modules/es6.string.link.js b/node_modules/core-js/library/modules/es6.string.link.js new file mode 100644 index 000000000..d0255edd6 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.link.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.10 String.prototype.link(url) +require('./_string-html')('link', function (createHTML) { + return function link(url) { + return createHTML(this, 'a', 'href', url); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.string.raw.js b/node_modules/core-js/library/modules/es6.string.raw.js new file mode 100644 index 000000000..aa40ff6fa --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.raw.js @@ -0,0 +1,18 @@ +var $export = require('./_export'); +var toIObject = require('./_to-iobject'); +var toLength = require('./_to-length'); + +$export($export.S, 'String', { + // 21.1.2.4 String.raw(callSite, ...substitutions) + raw: function raw(callSite) { + var tpl = toIObject(callSite.raw); + var len = toLength(tpl.length); + var aLen = arguments.length; + var res = []; + var i = 0; + while (len > i) { + res.push(String(tpl[i++])); + if (i < aLen) res.push(String(arguments[i])); + } return res.join(''); + } +}); diff --git a/node_modules/core-js/library/modules/es6.string.repeat.js b/node_modules/core-js/library/modules/es6.string.repeat.js new file mode 100644 index 000000000..08412d91b --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.repeat.js @@ -0,0 +1,6 @@ +var $export = require('./_export'); + +$export($export.P, 'String', { + // 21.1.3.13 String.prototype.repeat(count) + repeat: require('./_string-repeat') +}); diff --git a/node_modules/core-js/library/modules/es6.string.small.js b/node_modules/core-js/library/modules/es6.string.small.js new file mode 100644 index 000000000..941e4a767 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.small.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.11 String.prototype.small() +require('./_string-html')('small', function (createHTML) { + return function small() { + return createHTML(this, 'small', '', ''); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.string.starts-with.js b/node_modules/core-js/library/modules/es6.string.starts-with.js new file mode 100644 index 000000000..c1723767d --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.starts-with.js @@ -0,0 +1,18 @@ +// 21.1.3.18 String.prototype.startsWith(searchString [, position ]) +'use strict'; +var $export = require('./_export'); +var toLength = require('./_to-length'); +var context = require('./_string-context'); +var STARTS_WITH = 'startsWith'; +var $startsWith = ''[STARTS_WITH]; + +$export($export.P + $export.F * require('./_fails-is-regexp')(STARTS_WITH), 'String', { + startsWith: function startsWith(searchString /* , position = 0 */) { + var that = context(this, searchString, STARTS_WITH); + var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); + var search = String(searchString); + return $startsWith + ? $startsWith.call(that, search, index) + : that.slice(index, index + search.length) === search; + } +}); diff --git a/node_modules/core-js/library/modules/es6.string.strike.js b/node_modules/core-js/library/modules/es6.string.strike.js new file mode 100644 index 000000000..66055bc00 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.strike.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.12 String.prototype.strike() +require('./_string-html')('strike', function (createHTML) { + return function strike() { + return createHTML(this, 'strike', '', ''); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.string.sub.js b/node_modules/core-js/library/modules/es6.string.sub.js new file mode 100644 index 000000000..e295a27b0 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.sub.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.13 String.prototype.sub() +require('./_string-html')('sub', function (createHTML) { + return function sub() { + return createHTML(this, 'sub', '', ''); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.string.sup.js b/node_modules/core-js/library/modules/es6.string.sup.js new file mode 100644 index 000000000..125a989a7 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.sup.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.14 String.prototype.sup() +require('./_string-html')('sup', function (createHTML) { + return function sup() { + return createHTML(this, 'sup', '', ''); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.string.trim.js b/node_modules/core-js/library/modules/es6.string.trim.js new file mode 100644 index 000000000..02b8a6c69 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.string.trim.js @@ -0,0 +1,7 @@ +'use strict'; +// 21.1.3.25 String.prototype.trim() +require('./_string-trim')('trim', function ($trim) { + return function trim() { + return $trim(this, 3); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.symbol.js b/node_modules/core-js/library/modules/es6.symbol.js new file mode 100644 index 000000000..5bf7c4884 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.symbol.js @@ -0,0 +1,234 @@ +'use strict'; +// ECMAScript 6 symbols shim +var global = require('./_global'); +var has = require('./_has'); +var DESCRIPTORS = require('./_descriptors'); +var $export = require('./_export'); +var redefine = require('./_redefine'); +var META = require('./_meta').KEY; +var $fails = require('./_fails'); +var shared = require('./_shared'); +var setToStringTag = require('./_set-to-string-tag'); +var uid = require('./_uid'); +var wks = require('./_wks'); +var wksExt = require('./_wks-ext'); +var wksDefine = require('./_wks-define'); +var enumKeys = require('./_enum-keys'); +var isArray = require('./_is-array'); +var anObject = require('./_an-object'); +var isObject = require('./_is-object'); +var toIObject = require('./_to-iobject'); +var toPrimitive = require('./_to-primitive'); +var createDesc = require('./_property-desc'); +var _create = require('./_object-create'); +var gOPNExt = require('./_object-gopn-ext'); +var $GOPD = require('./_object-gopd'); +var $DP = require('./_object-dp'); +var $keys = require('./_object-keys'); +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'; +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; + require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames; + require('./_object-pie').f = $propertyIsEnumerable; + require('./_object-gops').f = $getOwnPropertySymbols; + + if (DESCRIPTORS && !require('./_library')) { + 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 +}); + +// 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] || require('./_hide')($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); diff --git a/node_modules/core-js/library/modules/es6.typed.array-buffer.js b/node_modules/core-js/library/modules/es6.typed.array-buffer.js new file mode 100644 index 000000000..b2473709c --- /dev/null +++ b/node_modules/core-js/library/modules/es6.typed.array-buffer.js @@ -0,0 +1,46 @@ +'use strict'; +var $export = require('./_export'); +var $typed = require('./_typed'); +var buffer = require('./_typed-buffer'); +var anObject = require('./_an-object'); +var toAbsoluteIndex = require('./_to-absolute-index'); +var toLength = require('./_to-length'); +var isObject = require('./_is-object'); +var ArrayBuffer = require('./_global').ArrayBuffer; +var speciesConstructor = require('./_species-constructor'); +var $ArrayBuffer = buffer.ArrayBuffer; +var $DataView = buffer.DataView; +var $isView = $typed.ABV && ArrayBuffer.isView; +var $slice = $ArrayBuffer.prototype.slice; +var VIEW = $typed.VIEW; +var ARRAY_BUFFER = 'ArrayBuffer'; + +$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer }); + +$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { + // 24.1.3.1 ArrayBuffer.isView(arg) + isView: function isView(it) { + return $isView && $isView(it) || isObject(it) && VIEW in it; + } +}); + +$export($export.P + $export.U + $export.F * require('./_fails')(function () { + return !new $ArrayBuffer(2).slice(1, undefined).byteLength; +}), ARRAY_BUFFER, { + // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) + slice: function slice(start, end) { + if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix + var len = anObject(this).byteLength; + var first = toAbsoluteIndex(start, len); + var fin = toAbsoluteIndex(end === undefined ? len : end, len); + var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first)); + var viewS = new $DataView(this); + var viewT = new $DataView(result); + var index = 0; + while (first < fin) { + viewT.setUint8(index++, viewS.getUint8(first++)); + } return result; + } +}); + +require('./_set-species')(ARRAY_BUFFER); diff --git a/node_modules/core-js/library/modules/es6.typed.data-view.js b/node_modules/core-js/library/modules/es6.typed.data-view.js new file mode 100644 index 000000000..d0e23536b --- /dev/null +++ b/node_modules/core-js/library/modules/es6.typed.data-view.js @@ -0,0 +1,4 @@ +var $export = require('./_export'); +$export($export.G + $export.W + $export.F * !require('./_typed').ABV, { + DataView: require('./_typed-buffer').DataView +}); diff --git a/node_modules/core-js/library/modules/es6.typed.float32-array.js b/node_modules/core-js/library/modules/es6.typed.float32-array.js new file mode 100644 index 000000000..f49700617 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.typed.float32-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Float32', 4, function (init) { + return function Float32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.typed.float64-array.js b/node_modules/core-js/library/modules/es6.typed.float64-array.js new file mode 100644 index 000000000..85dedcd59 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.typed.float64-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Float64', 8, function (init) { + return function Float64Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.typed.int16-array.js b/node_modules/core-js/library/modules/es6.typed.int16-array.js new file mode 100644 index 000000000..b20ed0413 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.typed.int16-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Int16', 2, function (init) { + return function Int16Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.typed.int32-array.js b/node_modules/core-js/library/modules/es6.typed.int32-array.js new file mode 100644 index 000000000..c7e6ae06f --- /dev/null +++ b/node_modules/core-js/library/modules/es6.typed.int32-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Int32', 4, function (init) { + return function Int32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.typed.int8-array.js b/node_modules/core-js/library/modules/es6.typed.int8-array.js new file mode 100644 index 000000000..58ab9f36e --- /dev/null +++ b/node_modules/core-js/library/modules/es6.typed.int8-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Int8', 1, function (init) { + return function Int8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.typed.uint16-array.js b/node_modules/core-js/library/modules/es6.typed.uint16-array.js new file mode 100644 index 000000000..992805d63 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.typed.uint16-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Uint16', 2, function (init) { + return function Uint16Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.typed.uint32-array.js b/node_modules/core-js/library/modules/es6.typed.uint32-array.js new file mode 100644 index 000000000..5c444246a --- /dev/null +++ b/node_modules/core-js/library/modules/es6.typed.uint32-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Uint32', 4, function (init) { + return function Uint32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.typed.uint8-array.js b/node_modules/core-js/library/modules/es6.typed.uint8-array.js new file mode 100644 index 000000000..465cdc806 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.typed.uint8-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Uint8', 1, function (init) { + return function Uint8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/node_modules/core-js/library/modules/es6.typed.uint8-clamped-array.js b/node_modules/core-js/library/modules/es6.typed.uint8-clamped-array.js new file mode 100644 index 000000000..a84a1c1ac --- /dev/null +++ b/node_modules/core-js/library/modules/es6.typed.uint8-clamped-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Uint8', 1, function (init) { + return function Uint8ClampedArray(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}, true); diff --git a/node_modules/core-js/library/modules/es6.weak-map.js b/node_modules/core-js/library/modules/es6.weak-map.js new file mode 100644 index 000000000..f21556d7c --- /dev/null +++ b/node_modules/core-js/library/modules/es6.weak-map.js @@ -0,0 +1,59 @@ +'use strict'; +var each = require('./_array-methods')(0); +var redefine = require('./_redefine'); +var meta = require('./_meta'); +var assign = require('./_object-assign'); +var weak = require('./_collection-weak'); +var isObject = require('./_is-object'); +var fails = require('./_fails'); +var validate = require('./_validate-collection'); +var WEAK_MAP = 'WeakMap'; +var getWeak = meta.getWeak; +var isExtensible = Object.isExtensible; +var uncaughtFrozenStore = weak.ufstore; +var tmp = {}; +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 = require('./_collection')(WEAK_MAP, wrapper, methods, weak, true, true); + +// IE11 WeakMap frozen keys fix +if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) { + 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); + }); + }); +} diff --git a/node_modules/core-js/library/modules/es6.weak-set.js b/node_modules/core-js/library/modules/es6.weak-set.js new file mode 100644 index 000000000..18a81e524 --- /dev/null +++ b/node_modules/core-js/library/modules/es6.weak-set.js @@ -0,0 +1,14 @@ +'use strict'; +var weak = require('./_collection-weak'); +var validate = require('./_validate-collection'); +var WEAK_SET = 'WeakSet'; + +// 23.4 WeakSet Objects +require('./_collection')(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); diff --git a/node_modules/core-js/library/modules/es7.array.flat-map.js b/node_modules/core-js/library/modules/es7.array.flat-map.js new file mode 100644 index 000000000..2a210cd35 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.array.flat-map.js @@ -0,0 +1,22 @@ +'use strict'; +// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap +var $export = require('./_export'); +var flattenIntoArray = require('./_flatten-into-array'); +var toObject = require('./_to-object'); +var toLength = require('./_to-length'); +var aFunction = require('./_a-function'); +var arraySpeciesCreate = require('./_array-species-create'); + +$export($export.P, 'Array', { + flatMap: function flatMap(callbackfn /* , thisArg */) { + var O = toObject(this); + var sourceLen, A; + aFunction(callbackfn); + sourceLen = toLength(O.length); + A = arraySpeciesCreate(O, 0); + flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]); + return A; + } +}); + +require('./_add-to-unscopables')('flatMap'); diff --git a/node_modules/core-js/library/modules/es7.array.flatten.js b/node_modules/core-js/library/modules/es7.array.flatten.js new file mode 100644 index 000000000..9019b2d1c --- /dev/null +++ b/node_modules/core-js/library/modules/es7.array.flatten.js @@ -0,0 +1,21 @@ +'use strict'; +// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten +var $export = require('./_export'); +var flattenIntoArray = require('./_flatten-into-array'); +var toObject = require('./_to-object'); +var toLength = require('./_to-length'); +var toInteger = require('./_to-integer'); +var arraySpeciesCreate = require('./_array-species-create'); + +$export($export.P, 'Array', { + flatten: function flatten(/* depthArg = 1 */) { + var depthArg = arguments[0]; + var O = toObject(this); + var sourceLen = toLength(O.length); + var A = arraySpeciesCreate(O, 0); + flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg)); + return A; + } +}); + +require('./_add-to-unscopables')('flatten'); diff --git a/node_modules/core-js/library/modules/es7.array.includes.js b/node_modules/core-js/library/modules/es7.array.includes.js new file mode 100644 index 000000000..1b77f0eb8 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.array.includes.js @@ -0,0 +1,12 @@ +'use strict'; +// https://github.com/tc39/Array.prototype.includes +var $export = require('./_export'); +var $includes = require('./_array-includes')(true); + +$export($export.P, 'Array', { + includes: function includes(el /* , fromIndex = 0 */) { + return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +require('./_add-to-unscopables')('includes'); diff --git a/node_modules/core-js/library/modules/es7.asap.js b/node_modules/core-js/library/modules/es7.asap.js new file mode 100644 index 000000000..d36f7c760 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.asap.js @@ -0,0 +1,12 @@ +// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask +var $export = require('./_export'); +var microtask = require('./_microtask')(); +var process = require('./_global').process; +var isNode = require('./_cof')(process) == 'process'; + +$export($export.G, { + asap: function asap(fn) { + var domain = isNode && process.domain; + microtask(domain ? domain.bind(fn) : fn); + } +}); diff --git a/node_modules/core-js/library/modules/es7.error.is-error.js b/node_modules/core-js/library/modules/es7.error.is-error.js new file mode 100644 index 000000000..ba94f5d13 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.error.is-error.js @@ -0,0 +1,9 @@ +// https://github.com/ljharb/proposal-is-error +var $export = require('./_export'); +var cof = require('./_cof'); + +$export($export.S, 'Error', { + isError: function isError(it) { + return cof(it) === 'Error'; + } +}); diff --git a/node_modules/core-js/library/modules/es7.global.js b/node_modules/core-js/library/modules/es7.global.js new file mode 100644 index 000000000..a315fd430 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.global.js @@ -0,0 +1,4 @@ +// https://github.com/tc39/proposal-global +var $export = require('./_export'); + +$export($export.G, { global: require('./_global') }); diff --git a/node_modules/core-js/library/modules/es7.map.from.js b/node_modules/core-js/library/modules/es7.map.from.js new file mode 100644 index 000000000..a60573704 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.map.from.js @@ -0,0 +1,2 @@ +// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from +require('./_set-collection-from')('Map'); diff --git a/node_modules/core-js/library/modules/es7.map.of.js b/node_modules/core-js/library/modules/es7.map.of.js new file mode 100644 index 000000000..a2bf1fef7 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.map.of.js @@ -0,0 +1,2 @@ +// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of +require('./_set-collection-of')('Map'); diff --git a/node_modules/core-js/library/modules/es7.map.to-json.js b/node_modules/core-js/library/modules/es7.map.to-json.js new file mode 100644 index 000000000..95a3569fa --- /dev/null +++ b/node_modules/core-js/library/modules/es7.map.to-json.js @@ -0,0 +1,4 @@ +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = require('./_export'); + +$export($export.P + $export.R, 'Map', { toJSON: require('./_collection-to-json')('Map') }); diff --git a/node_modules/core-js/library/modules/es7.math.clamp.js b/node_modules/core-js/library/modules/es7.math.clamp.js new file mode 100644 index 000000000..319cda609 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.math.clamp.js @@ -0,0 +1,8 @@ +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = require('./_export'); + +$export($export.S, 'Math', { + clamp: function clamp(x, lower, upper) { + return Math.min(upper, Math.max(lower, x)); + } +}); diff --git a/node_modules/core-js/library/modules/es7.math.deg-per-rad.js b/node_modules/core-js/library/modules/es7.math.deg-per-rad.js new file mode 100644 index 000000000..99b95bba9 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.math.deg-per-rad.js @@ -0,0 +1,4 @@ +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = require('./_export'); + +$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 }); diff --git a/node_modules/core-js/library/modules/es7.math.degrees.js b/node_modules/core-js/library/modules/es7.math.degrees.js new file mode 100644 index 000000000..6637d915e --- /dev/null +++ b/node_modules/core-js/library/modules/es7.math.degrees.js @@ -0,0 +1,9 @@ +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = require('./_export'); +var RAD_PER_DEG = 180 / Math.PI; + +$export($export.S, 'Math', { + degrees: function degrees(radians) { + return radians * RAD_PER_DEG; + } +}); diff --git a/node_modules/core-js/library/modules/es7.math.fscale.js b/node_modules/core-js/library/modules/es7.math.fscale.js new file mode 100644 index 000000000..ad660a058 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.math.fscale.js @@ -0,0 +1,10 @@ +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = require('./_export'); +var scale = require('./_math-scale'); +var fround = require('./_math-fround'); + +$export($export.S, 'Math', { + fscale: function fscale(x, inLow, inHigh, outLow, outHigh) { + return fround(scale(x, inLow, inHigh, outLow, outHigh)); + } +}); diff --git a/node_modules/core-js/library/modules/es7.math.iaddh.js b/node_modules/core-js/library/modules/es7.math.iaddh.js new file mode 100644 index 000000000..a331ba9b2 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.math.iaddh.js @@ -0,0 +1,11 @@ +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = require('./_export'); + +$export($export.S, 'Math', { + iaddh: function iaddh(x0, x1, y0, y1) { + var $x0 = x0 >>> 0; + var $x1 = x1 >>> 0; + var $y0 = y0 >>> 0; + return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; + } +}); diff --git a/node_modules/core-js/library/modules/es7.math.imulh.js b/node_modules/core-js/library/modules/es7.math.imulh.js new file mode 100644 index 000000000..58d19f3ac --- /dev/null +++ b/node_modules/core-js/library/modules/es7.math.imulh.js @@ -0,0 +1,16 @@ +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = require('./_export'); + +$export($export.S, 'Math', { + imulh: function imulh(u, v) { + var UINT16 = 0xffff; + var $u = +u; + var $v = +v; + var u0 = $u & UINT16; + var v0 = $v & UINT16; + var u1 = $u >> 16; + var v1 = $v >> 16; + var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); + } +}); diff --git a/node_modules/core-js/library/modules/es7.math.isubh.js b/node_modules/core-js/library/modules/es7.math.isubh.js new file mode 100644 index 000000000..de22793c1 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.math.isubh.js @@ -0,0 +1,11 @@ +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = require('./_export'); + +$export($export.S, 'Math', { + isubh: function isubh(x0, x1, y0, y1) { + var $x0 = x0 >>> 0; + var $x1 = x1 >>> 0; + var $y0 = y0 >>> 0; + return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; + } +}); diff --git a/node_modules/core-js/library/modules/es7.math.rad-per-deg.js b/node_modules/core-js/library/modules/es7.math.rad-per-deg.js new file mode 100644 index 000000000..6f702596a --- /dev/null +++ b/node_modules/core-js/library/modules/es7.math.rad-per-deg.js @@ -0,0 +1,4 @@ +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = require('./_export'); + +$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI }); diff --git a/node_modules/core-js/library/modules/es7.math.radians.js b/node_modules/core-js/library/modules/es7.math.radians.js new file mode 100644 index 000000000..abd9575fe --- /dev/null +++ b/node_modules/core-js/library/modules/es7.math.radians.js @@ -0,0 +1,9 @@ +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = require('./_export'); +var DEG_PER_RAD = Math.PI / 180; + +$export($export.S, 'Math', { + radians: function radians(degrees) { + return degrees * DEG_PER_RAD; + } +}); diff --git a/node_modules/core-js/library/modules/es7.math.scale.js b/node_modules/core-js/library/modules/es7.math.scale.js new file mode 100644 index 000000000..2866dcd7c --- /dev/null +++ b/node_modules/core-js/library/modules/es7.math.scale.js @@ -0,0 +1,4 @@ +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = require('./_export'); + +$export($export.S, 'Math', { scale: require('./_math-scale') }); diff --git a/node_modules/core-js/library/modules/es7.math.signbit.js b/node_modules/core-js/library/modules/es7.math.signbit.js new file mode 100644 index 000000000..c25680486 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.math.signbit.js @@ -0,0 +1,7 @@ +// http://jfbastien.github.io/papers/Math.signbit.html +var $export = require('./_export'); + +$export($export.S, 'Math', { signbit: function signbit(x) { + // eslint-disable-next-line no-self-compare + return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0; +} }); diff --git a/node_modules/core-js/library/modules/es7.math.umulh.js b/node_modules/core-js/library/modules/es7.math.umulh.js new file mode 100644 index 000000000..3ddfa4685 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.math.umulh.js @@ -0,0 +1,16 @@ +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = require('./_export'); + +$export($export.S, 'Math', { + umulh: function umulh(u, v) { + var UINT16 = 0xffff; + var $u = +u; + var $v = +v; + var u0 = $u & UINT16; + var v0 = $v & UINT16; + var u1 = $u >>> 16; + var v1 = $v >>> 16; + var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); + } +}); diff --git a/node_modules/core-js/library/modules/es7.object.define-getter.js b/node_modules/core-js/library/modules/es7.object.define-getter.js new file mode 100644 index 000000000..ffc6203fd --- /dev/null +++ b/node_modules/core-js/library/modules/es7.object.define-getter.js @@ -0,0 +1,12 @@ +'use strict'; +var $export = require('./_export'); +var toObject = require('./_to-object'); +var aFunction = require('./_a-function'); +var $defineProperty = require('./_object-dp'); + +// B.2.2.2 Object.prototype.__defineGetter__(P, getter) +require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { + __defineGetter__: function __defineGetter__(P, getter) { + $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true }); + } +}); diff --git a/node_modules/core-js/library/modules/es7.object.define-setter.js b/node_modules/core-js/library/modules/es7.object.define-setter.js new file mode 100644 index 000000000..8ceefdd68 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.object.define-setter.js @@ -0,0 +1,12 @@ +'use strict'; +var $export = require('./_export'); +var toObject = require('./_to-object'); +var aFunction = require('./_a-function'); +var $defineProperty = require('./_object-dp'); + +// B.2.2.3 Object.prototype.__defineSetter__(P, setter) +require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { + __defineSetter__: function __defineSetter__(P, setter) { + $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true }); + } +}); diff --git a/node_modules/core-js/library/modules/es7.object.entries.js b/node_modules/core-js/library/modules/es7.object.entries.js new file mode 100644 index 000000000..2f83437c8 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.object.entries.js @@ -0,0 +1,9 @@ +// https://github.com/tc39/proposal-object-values-entries +var $export = require('./_export'); +var $entries = require('./_object-to-array')(true); + +$export($export.S, 'Object', { + entries: function entries(it) { + return $entries(it); + } +}); diff --git a/node_modules/core-js/library/modules/es7.object.get-own-property-descriptors.js b/node_modules/core-js/library/modules/es7.object.get-own-property-descriptors.js new file mode 100644 index 000000000..b1ab72fde --- /dev/null +++ b/node_modules/core-js/library/modules/es7.object.get-own-property-descriptors.js @@ -0,0 +1,22 @@ +// https://github.com/tc39/proposal-object-getownpropertydescriptors +var $export = require('./_export'); +var ownKeys = require('./_own-keys'); +var toIObject = require('./_to-iobject'); +var gOPD = require('./_object-gopd'); +var createProperty = require('./_create-property'); + +$export($export.S, 'Object', { + getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { + var O = toIObject(object); + var getDesc = gOPD.f; + var keys = ownKeys(O); + var result = {}; + var i = 0; + var key, desc; + while (keys.length > i) { + desc = getDesc(O, key = keys[i++]); + if (desc !== undefined) createProperty(result, key, desc); + } + return result; + } +}); diff --git a/node_modules/core-js/library/modules/es7.object.lookup-getter.js b/node_modules/core-js/library/modules/es7.object.lookup-getter.js new file mode 100644 index 000000000..f80222916 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.object.lookup-getter.js @@ -0,0 +1,18 @@ +'use strict'; +var $export = require('./_export'); +var toObject = require('./_to-object'); +var toPrimitive = require('./_to-primitive'); +var getPrototypeOf = require('./_object-gpo'); +var getOwnPropertyDescriptor = require('./_object-gopd').f; + +// B.2.2.4 Object.prototype.__lookupGetter__(P) +require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { + __lookupGetter__: function __lookupGetter__(P) { + var O = toObject(this); + var K = toPrimitive(P, true); + var D; + do { + if (D = getOwnPropertyDescriptor(O, K)) return D.get; + } while (O = getPrototypeOf(O)); + } +}); diff --git a/node_modules/core-js/library/modules/es7.object.lookup-setter.js b/node_modules/core-js/library/modules/es7.object.lookup-setter.js new file mode 100644 index 000000000..8bf8b64ea --- /dev/null +++ b/node_modules/core-js/library/modules/es7.object.lookup-setter.js @@ -0,0 +1,18 @@ +'use strict'; +var $export = require('./_export'); +var toObject = require('./_to-object'); +var toPrimitive = require('./_to-primitive'); +var getPrototypeOf = require('./_object-gpo'); +var getOwnPropertyDescriptor = require('./_object-gopd').f; + +// B.2.2.5 Object.prototype.__lookupSetter__(P) +require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { + __lookupSetter__: function __lookupSetter__(P) { + var O = toObject(this); + var K = toPrimitive(P, true); + var D; + do { + if (D = getOwnPropertyDescriptor(O, K)) return D.set; + } while (O = getPrototypeOf(O)); + } +}); diff --git a/node_modules/core-js/library/modules/es7.object.values.js b/node_modules/core-js/library/modules/es7.object.values.js new file mode 100644 index 000000000..d6f095275 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.object.values.js @@ -0,0 +1,9 @@ +// https://github.com/tc39/proposal-object-values-entries +var $export = require('./_export'); +var $values = require('./_object-to-array')(false); + +$export($export.S, 'Object', { + values: function values(it) { + return $values(it); + } +}); diff --git a/node_modules/core-js/library/modules/es7.observable.js b/node_modules/core-js/library/modules/es7.observable.js new file mode 100644 index 000000000..6dcb2c8f2 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.observable.js @@ -0,0 +1,199 @@ +'use strict'; +// https://github.com/zenparsing/es-observable +var $export = require('./_export'); +var global = require('./_global'); +var core = require('./_core'); +var microtask = require('./_microtask')(); +var OBSERVABLE = require('./_wks')('observable'); +var aFunction = require('./_a-function'); +var anObject = require('./_an-object'); +var anInstance = require('./_an-instance'); +var redefineAll = require('./_redefine-all'); +var hide = require('./_hide'); +var forOf = require('./_for-of'); +var RETURN = forOf.RETURN; + +var getMethod = function (fn) { + return fn == null ? undefined : aFunction(fn); +}; + +var cleanupSubscription = function (subscription) { + var cleanup = subscription._c; + if (cleanup) { + subscription._c = undefined; + cleanup(); + } +}; + +var subscriptionClosed = function (subscription) { + return subscription._o === undefined; +}; + +var closeSubscription = function (subscription) { + if (!subscriptionClosed(subscription)) { + subscription._o = undefined; + cleanupSubscription(subscription); + } +}; + +var Subscription = function (observer, subscriber) { + anObject(observer); + this._c = undefined; + this._o = observer; + observer = new SubscriptionObserver(this); + try { + var cleanup = subscriber(observer); + var subscription = cleanup; + if (cleanup != null) { + if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); }; + else aFunction(cleanup); + this._c = cleanup; + } + } catch (e) { + observer.error(e); + return; + } if (subscriptionClosed(this)) cleanupSubscription(this); +}; + +Subscription.prototype = redefineAll({}, { + unsubscribe: function unsubscribe() { closeSubscription(this); } +}); + +var SubscriptionObserver = function (subscription) { + this._s = subscription; +}; + +SubscriptionObserver.prototype = redefineAll({}, { + next: function next(value) { + var subscription = this._s; + if (!subscriptionClosed(subscription)) { + var observer = subscription._o; + try { + var m = getMethod(observer.next); + if (m) return m.call(observer, value); + } catch (e) { + try { + closeSubscription(subscription); + } finally { + throw e; + } + } + } + }, + error: function error(value) { + var subscription = this._s; + if (subscriptionClosed(subscription)) throw value; + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.error); + if (!m) throw value; + value = m.call(observer, value); + } catch (e) { + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + }, + complete: function complete(value) { + var subscription = this._s; + if (!subscriptionClosed(subscription)) { + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.complete); + value = m ? m.call(observer, value) : undefined; + } catch (e) { + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + } + } +}); + +var $Observable = function Observable(subscriber) { + anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber); +}; + +redefineAll($Observable.prototype, { + subscribe: function subscribe(observer) { + return new Subscription(observer, this._f); + }, + forEach: function forEach(fn) { + var that = this; + return new (core.Promise || global.Promise)(function (resolve, reject) { + aFunction(fn); + var subscription = that.subscribe({ + next: function (value) { + try { + return fn(value); + } catch (e) { + reject(e); + subscription.unsubscribe(); + } + }, + error: reject, + complete: resolve + }); + }); + } +}); + +redefineAll($Observable, { + from: function from(x) { + var C = typeof this === 'function' ? this : $Observable; + var method = getMethod(anObject(x)[OBSERVABLE]); + if (method) { + var observable = anObject(method.call(x)); + return observable.constructor === C ? observable : new C(function (observer) { + return observable.subscribe(observer); + }); + } + return new C(function (observer) { + var done = false; + microtask(function () { + if (!done) { + try { + if (forOf(x, false, function (it) { + observer.next(it); + if (done) return RETURN; + }) === RETURN) return; + } catch (e) { + if (done) throw e; + observer.error(e); + return; + } observer.complete(); + } + }); + return function () { done = true; }; + }); + }, + of: function of() { + for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++]; + return new (typeof this === 'function' ? this : $Observable)(function (observer) { + var done = false; + microtask(function () { + if (!done) { + for (var j = 0; j < items.length; ++j) { + observer.next(items[j]); + if (done) return; + } observer.complete(); + } + }); + return function () { done = true; }; + }); + } +}); + +hide($Observable.prototype, OBSERVABLE, function () { return this; }); + +$export($export.G, { Observable: $Observable }); + +require('./_set-species')('Observable'); diff --git a/node_modules/core-js/library/modules/es7.promise.finally.js b/node_modules/core-js/library/modules/es7.promise.finally.js new file mode 100644 index 000000000..fa04b6399 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.promise.finally.js @@ -0,0 +1,20 @@ +// https://github.com/tc39/proposal-promise-finally +'use strict'; +var $export = require('./_export'); +var core = require('./_core'); +var global = require('./_global'); +var speciesConstructor = require('./_species-constructor'); +var promiseResolve = require('./_promise-resolve'); + +$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { + var C = speciesConstructor(this, core.Promise || global.Promise); + var isFunction = typeof onFinally == 'function'; + return this.then( + isFunction ? function (x) { + return promiseResolve(C, onFinally()).then(function () { return x; }); + } : onFinally, + isFunction ? function (e) { + return promiseResolve(C, onFinally()).then(function () { throw e; }); + } : onFinally + ); +} }); diff --git a/node_modules/core-js/library/modules/es7.promise.try.js b/node_modules/core-js/library/modules/es7.promise.try.js new file mode 100644 index 000000000..e8163720b --- /dev/null +++ b/node_modules/core-js/library/modules/es7.promise.try.js @@ -0,0 +1,12 @@ +'use strict'; +// https://github.com/tc39/proposal-promise-try +var $export = require('./_export'); +var newPromiseCapability = require('./_new-promise-capability'); +var perform = require('./_perform'); + +$export($export.S, 'Promise', { 'try': function (callbackfn) { + var promiseCapability = newPromiseCapability.f(this); + var result = perform(callbackfn); + (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); + return promiseCapability.promise; +} }); diff --git a/node_modules/core-js/library/modules/es7.reflect.define-metadata.js b/node_modules/core-js/library/modules/es7.reflect.define-metadata.js new file mode 100644 index 000000000..ebef52c24 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.reflect.define-metadata.js @@ -0,0 +1,8 @@ +var metadata = require('./_metadata'); +var anObject = require('./_an-object'); +var toMetaKey = metadata.key; +var ordinaryDefineOwnMetadata = metadata.set; + +metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) { + ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); +} }); diff --git a/node_modules/core-js/library/modules/es7.reflect.delete-metadata.js b/node_modules/core-js/library/modules/es7.reflect.delete-metadata.js new file mode 100644 index 000000000..590ed53ce --- /dev/null +++ b/node_modules/core-js/library/modules/es7.reflect.delete-metadata.js @@ -0,0 +1,15 @@ +var metadata = require('./_metadata'); +var anObject = require('./_an-object'); +var toMetaKey = metadata.key; +var getOrCreateMetadataMap = metadata.map; +var store = metadata.store; + +metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) { + var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]); + var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); + if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false; + if (metadataMap.size) return true; + var targetMetadata = store.get(target); + targetMetadata['delete'](targetKey); + return !!targetMetadata.size || store['delete'](target); +} }); diff --git a/node_modules/core-js/library/modules/es7.reflect.get-metadata-keys.js b/node_modules/core-js/library/modules/es7.reflect.get-metadata-keys.js new file mode 100644 index 000000000..f344172b5 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.reflect.get-metadata-keys.js @@ -0,0 +1,19 @@ +var Set = require('./es6.set'); +var from = require('./_array-from-iterable'); +var metadata = require('./_metadata'); +var anObject = require('./_an-object'); +var getPrototypeOf = require('./_object-gpo'); +var ordinaryOwnMetadataKeys = metadata.keys; +var toMetaKey = metadata.key; + +var ordinaryMetadataKeys = function (O, P) { + var oKeys = ordinaryOwnMetadataKeys(O, P); + var parent = getPrototypeOf(O); + if (parent === null) return oKeys; + var pKeys = ordinaryMetadataKeys(parent, P); + return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys; +}; + +metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) { + return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); +} }); diff --git a/node_modules/core-js/library/modules/es7.reflect.get-metadata.js b/node_modules/core-js/library/modules/es7.reflect.get-metadata.js new file mode 100644 index 000000000..58c278e98 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.reflect.get-metadata.js @@ -0,0 +1,17 @@ +var metadata = require('./_metadata'); +var anObject = require('./_an-object'); +var getPrototypeOf = require('./_object-gpo'); +var ordinaryHasOwnMetadata = metadata.has; +var ordinaryGetOwnMetadata = metadata.get; +var toMetaKey = metadata.key; + +var ordinaryGetMetadata = function (MetadataKey, O, P) { + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P); + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; +}; + +metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) { + return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); diff --git a/node_modules/core-js/library/modules/es7.reflect.get-own-metadata-keys.js b/node_modules/core-js/library/modules/es7.reflect.get-own-metadata-keys.js new file mode 100644 index 000000000..03e3201bb --- /dev/null +++ b/node_modules/core-js/library/modules/es7.reflect.get-own-metadata-keys.js @@ -0,0 +1,8 @@ +var metadata = require('./_metadata'); +var anObject = require('./_an-object'); +var ordinaryOwnMetadataKeys = metadata.keys; +var toMetaKey = metadata.key; + +metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) { + return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); +} }); diff --git a/node_modules/core-js/library/modules/es7.reflect.get-own-metadata.js b/node_modules/core-js/library/modules/es7.reflect.get-own-metadata.js new file mode 100644 index 000000000..4a18b0717 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.reflect.get-own-metadata.js @@ -0,0 +1,9 @@ +var metadata = require('./_metadata'); +var anObject = require('./_an-object'); +var ordinaryGetOwnMetadata = metadata.get; +var toMetaKey = metadata.key; + +metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) { + return ordinaryGetOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); diff --git a/node_modules/core-js/library/modules/es7.reflect.has-metadata.js b/node_modules/core-js/library/modules/es7.reflect.has-metadata.js new file mode 100644 index 000000000..b934bb4ec --- /dev/null +++ b/node_modules/core-js/library/modules/es7.reflect.has-metadata.js @@ -0,0 +1,16 @@ +var metadata = require('./_metadata'); +var anObject = require('./_an-object'); +var getPrototypeOf = require('./_object-gpo'); +var ordinaryHasOwnMetadata = metadata.has; +var toMetaKey = metadata.key; + +var ordinaryHasMetadata = function (MetadataKey, O, P) { + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) return true; + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; +}; + +metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) { + return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); diff --git a/node_modules/core-js/library/modules/es7.reflect.has-own-metadata.js b/node_modules/core-js/library/modules/es7.reflect.has-own-metadata.js new file mode 100644 index 000000000..512850dd8 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.reflect.has-own-metadata.js @@ -0,0 +1,9 @@ +var metadata = require('./_metadata'); +var anObject = require('./_an-object'); +var ordinaryHasOwnMetadata = metadata.has; +var toMetaKey = metadata.key; + +metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) { + return ordinaryHasOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); diff --git a/node_modules/core-js/library/modules/es7.reflect.metadata.js b/node_modules/core-js/library/modules/es7.reflect.metadata.js new file mode 100644 index 000000000..efb9a9e26 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.reflect.metadata.js @@ -0,0 +1,15 @@ +var $metadata = require('./_metadata'); +var anObject = require('./_an-object'); +var aFunction = require('./_a-function'); +var toMetaKey = $metadata.key; +var ordinaryDefineOwnMetadata = $metadata.set; + +$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) { + return function decorator(target, targetKey) { + ordinaryDefineOwnMetadata( + metadataKey, metadataValue, + (targetKey !== undefined ? anObject : aFunction)(target), + toMetaKey(targetKey) + ); + }; +} }); diff --git a/node_modules/core-js/library/modules/es7.set.from.js b/node_modules/core-js/library/modules/es7.set.from.js new file mode 100644 index 000000000..26542b664 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.set.from.js @@ -0,0 +1,2 @@ +// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from +require('./_set-collection-from')('Set'); diff --git a/node_modules/core-js/library/modules/es7.set.of.js b/node_modules/core-js/library/modules/es7.set.of.js new file mode 100644 index 000000000..2a50ad911 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.set.of.js @@ -0,0 +1,2 @@ +// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of +require('./_set-collection-of')('Set'); diff --git a/node_modules/core-js/library/modules/es7.set.to-json.js b/node_modules/core-js/library/modules/es7.set.to-json.js new file mode 100644 index 000000000..95cbcfa51 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.set.to-json.js @@ -0,0 +1,4 @@ +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = require('./_export'); + +$export($export.P + $export.R, 'Set', { toJSON: require('./_collection-to-json')('Set') }); diff --git a/node_modules/core-js/library/modules/es7.string.at.js b/node_modules/core-js/library/modules/es7.string.at.js new file mode 100644 index 000000000..8b3ab98db --- /dev/null +++ b/node_modules/core-js/library/modules/es7.string.at.js @@ -0,0 +1,10 @@ +'use strict'; +// https://github.com/mathiasbynens/String.prototype.at +var $export = require('./_export'); +var $at = require('./_string-at')(true); + +$export($export.P, 'String', { + at: function at(pos) { + return $at(this, pos); + } +}); diff --git a/node_modules/core-js/library/modules/es7.string.match-all.js b/node_modules/core-js/library/modules/es7.string.match-all.js new file mode 100644 index 000000000..78237036e --- /dev/null +++ b/node_modules/core-js/library/modules/es7.string.match-all.js @@ -0,0 +1,30 @@ +'use strict'; +// https://tc39.github.io/String.prototype.matchAll/ +var $export = require('./_export'); +var defined = require('./_defined'); +var toLength = require('./_to-length'); +var isRegExp = require('./_is-regexp'); +var getFlags = require('./_flags'); +var RegExpProto = RegExp.prototype; + +var $RegExpStringIterator = function (regexp, string) { + this._r = regexp; + this._s = string; +}; + +require('./_iter-create')($RegExpStringIterator, 'RegExp String', function next() { + var match = this._r.exec(this._s); + return { value: match, done: match === null }; +}); + +$export($export.P, 'String', { + matchAll: function matchAll(regexp) { + defined(this); + if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!'); + var S = String(this); + var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp); + var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags); + rx.lastIndex = toLength(regexp.lastIndex); + return new $RegExpStringIterator(rx, S); + } +}); diff --git a/node_modules/core-js/library/modules/es7.string.pad-end.js b/node_modules/core-js/library/modules/es7.string.pad-end.js new file mode 100644 index 000000000..df55ce70b --- /dev/null +++ b/node_modules/core-js/library/modules/es7.string.pad-end.js @@ -0,0 +1,12 @@ +'use strict'; +// https://github.com/tc39/proposal-string-pad-start-end +var $export = require('./_export'); +var $pad = require('./_string-pad'); +var userAgent = require('./_user-agent'); + +// https://github.com/zloirock/core-js/issues/280 +$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { + padEnd: function padEnd(maxLength /* , fillString = ' ' */) { + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); + } +}); diff --git a/node_modules/core-js/library/modules/es7.string.pad-start.js b/node_modules/core-js/library/modules/es7.string.pad-start.js new file mode 100644 index 000000000..61549121d --- /dev/null +++ b/node_modules/core-js/library/modules/es7.string.pad-start.js @@ -0,0 +1,12 @@ +'use strict'; +// https://github.com/tc39/proposal-string-pad-start-end +var $export = require('./_export'); +var $pad = require('./_string-pad'); +var userAgent = require('./_user-agent'); + +// https://github.com/zloirock/core-js/issues/280 +$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { + padStart: function padStart(maxLength /* , fillString = ' ' */) { + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); + } +}); diff --git a/node_modules/core-js/library/modules/es7.string.trim-left.js b/node_modules/core-js/library/modules/es7.string.trim-left.js new file mode 100644 index 000000000..39a4b47cf --- /dev/null +++ b/node_modules/core-js/library/modules/es7.string.trim-left.js @@ -0,0 +1,7 @@ +'use strict'; +// https://github.com/sebmarkbage/ecmascript-string-left-right-trim +require('./_string-trim')('trimLeft', function ($trim) { + return function trimLeft() { + return $trim(this, 1); + }; +}, 'trimStart'); diff --git a/node_modules/core-js/library/modules/es7.string.trim-right.js b/node_modules/core-js/library/modules/es7.string.trim-right.js new file mode 100644 index 000000000..7b7c45298 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.string.trim-right.js @@ -0,0 +1,7 @@ +'use strict'; +// https://github.com/sebmarkbage/ecmascript-string-left-right-trim +require('./_string-trim')('trimRight', function ($trim) { + return function trimRight() { + return $trim(this, 2); + }; +}, 'trimEnd'); diff --git a/node_modules/core-js/library/modules/es7.symbol.async-iterator.js b/node_modules/core-js/library/modules/es7.symbol.async-iterator.js new file mode 100644 index 000000000..f56dc2a8e --- /dev/null +++ b/node_modules/core-js/library/modules/es7.symbol.async-iterator.js @@ -0,0 +1 @@ +require('./_wks-define')('asyncIterator'); diff --git a/node_modules/core-js/library/modules/es7.symbol.observable.js b/node_modules/core-js/library/modules/es7.symbol.observable.js new file mode 100644 index 000000000..fc9a23761 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.symbol.observable.js @@ -0,0 +1 @@ +require('./_wks-define')('observable'); diff --git a/node_modules/core-js/library/modules/es7.system.global.js b/node_modules/core-js/library/modules/es7.system.global.js new file mode 100644 index 000000000..310a802ad --- /dev/null +++ b/node_modules/core-js/library/modules/es7.system.global.js @@ -0,0 +1,4 @@ +// https://github.com/tc39/proposal-global +var $export = require('./_export'); + +$export($export.S, 'System', { global: require('./_global') }); diff --git a/node_modules/core-js/library/modules/es7.weak-map.from.js b/node_modules/core-js/library/modules/es7.weak-map.from.js new file mode 100644 index 000000000..1a0136576 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.weak-map.from.js @@ -0,0 +1,2 @@ +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from +require('./_set-collection-from')('WeakMap'); diff --git a/node_modules/core-js/library/modules/es7.weak-map.of.js b/node_modules/core-js/library/modules/es7.weak-map.of.js new file mode 100644 index 000000000..52c3f66df --- /dev/null +++ b/node_modules/core-js/library/modules/es7.weak-map.of.js @@ -0,0 +1,2 @@ +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of +require('./_set-collection-of')('WeakMap'); diff --git a/node_modules/core-js/library/modules/es7.weak-set.from.js b/node_modules/core-js/library/modules/es7.weak-set.from.js new file mode 100644 index 000000000..493e5bee0 --- /dev/null +++ b/node_modules/core-js/library/modules/es7.weak-set.from.js @@ -0,0 +1,2 @@ +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from +require('./_set-collection-from')('WeakSet'); diff --git a/node_modules/core-js/library/modules/es7.weak-set.of.js b/node_modules/core-js/library/modules/es7.weak-set.of.js new file mode 100644 index 000000000..5941e72aa --- /dev/null +++ b/node_modules/core-js/library/modules/es7.weak-set.of.js @@ -0,0 +1,2 @@ +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of +require('./_set-collection-of')('WeakSet'); diff --git a/node_modules/core-js/library/modules/web.dom.iterable.js b/node_modules/core-js/library/modules/web.dom.iterable.js new file mode 100644 index 000000000..fc00afac4 --- /dev/null +++ b/node_modules/core-js/library/modules/web.dom.iterable.js @@ -0,0 +1,19 @@ +require('./es6.array.iterator'); +var global = require('./_global'); +var hide = require('./_hide'); +var Iterators = require('./_iterators'); +var TO_STRING_TAG = require('./_wks')('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; +} diff --git a/node_modules/core-js/library/modules/web.immediate.js b/node_modules/core-js/library/modules/web.immediate.js new file mode 100644 index 000000000..70f3e70da --- /dev/null +++ b/node_modules/core-js/library/modules/web.immediate.js @@ -0,0 +1,6 @@ +var $export = require('./_export'); +var $task = require('./_task'); +$export($export.G + $export.B, { + setImmediate: $task.set, + clearImmediate: $task.clear +}); diff --git a/node_modules/core-js/library/modules/web.timers.js b/node_modules/core-js/library/modules/web.timers.js new file mode 100644 index 000000000..c87908304 --- /dev/null +++ b/node_modules/core-js/library/modules/web.timers.js @@ -0,0 +1,20 @@ +// ie9- setTimeout & setInterval additional parameters fix +var global = require('./_global'); +var $export = require('./_export'); +var userAgent = require('./_user-agent'); +var slice = [].slice; +var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check +var wrap = function (set) { + return function (fn, time /* , ...args */) { + var boundArgs = arguments.length > 2; + var args = boundArgs ? slice.call(arguments, 2) : false; + return set(boundArgs ? function () { + // eslint-disable-next-line no-new-func + (typeof fn == 'function' ? fn : Function(fn)).apply(this, args); + } : fn, time); + }; +}; +$export($export.G + $export.B + $export.F * MSIE, { + setTimeout: wrap(global.setTimeout), + setInterval: wrap(global.setInterval) +}); diff --git a/node_modules/core-js/library/shim.js b/node_modules/core-js/library/shim.js new file mode 100644 index 000000000..d865a2a3e --- /dev/null +++ b/node_modules/core-js/library/shim.js @@ -0,0 +1,197 @@ +require('./modules/es6.symbol'); +require('./modules/es6.object.create'); +require('./modules/es6.object.define-property'); +require('./modules/es6.object.define-properties'); +require('./modules/es6.object.get-own-property-descriptor'); +require('./modules/es6.object.get-prototype-of'); +require('./modules/es6.object.keys'); +require('./modules/es6.object.get-own-property-names'); +require('./modules/es6.object.freeze'); +require('./modules/es6.object.seal'); +require('./modules/es6.object.prevent-extensions'); +require('./modules/es6.object.is-frozen'); +require('./modules/es6.object.is-sealed'); +require('./modules/es6.object.is-extensible'); +require('./modules/es6.object.assign'); +require('./modules/es6.object.is'); +require('./modules/es6.object.set-prototype-of'); +require('./modules/es6.object.to-string'); +require('./modules/es6.function.bind'); +require('./modules/es6.function.name'); +require('./modules/es6.function.has-instance'); +require('./modules/es6.parse-int'); +require('./modules/es6.parse-float'); +require('./modules/es6.number.constructor'); +require('./modules/es6.number.to-fixed'); +require('./modules/es6.number.to-precision'); +require('./modules/es6.number.epsilon'); +require('./modules/es6.number.is-finite'); +require('./modules/es6.number.is-integer'); +require('./modules/es6.number.is-nan'); +require('./modules/es6.number.is-safe-integer'); +require('./modules/es6.number.max-safe-integer'); +require('./modules/es6.number.min-safe-integer'); +require('./modules/es6.number.parse-float'); +require('./modules/es6.number.parse-int'); +require('./modules/es6.math.acosh'); +require('./modules/es6.math.asinh'); +require('./modules/es6.math.atanh'); +require('./modules/es6.math.cbrt'); +require('./modules/es6.math.clz32'); +require('./modules/es6.math.cosh'); +require('./modules/es6.math.expm1'); +require('./modules/es6.math.fround'); +require('./modules/es6.math.hypot'); +require('./modules/es6.math.imul'); +require('./modules/es6.math.log10'); +require('./modules/es6.math.log1p'); +require('./modules/es6.math.log2'); +require('./modules/es6.math.sign'); +require('./modules/es6.math.sinh'); +require('./modules/es6.math.tanh'); +require('./modules/es6.math.trunc'); +require('./modules/es6.string.from-code-point'); +require('./modules/es6.string.raw'); +require('./modules/es6.string.trim'); +require('./modules/es6.string.iterator'); +require('./modules/es6.string.code-point-at'); +require('./modules/es6.string.ends-with'); +require('./modules/es6.string.includes'); +require('./modules/es6.string.repeat'); +require('./modules/es6.string.starts-with'); +require('./modules/es6.string.anchor'); +require('./modules/es6.string.big'); +require('./modules/es6.string.blink'); +require('./modules/es6.string.bold'); +require('./modules/es6.string.fixed'); +require('./modules/es6.string.fontcolor'); +require('./modules/es6.string.fontsize'); +require('./modules/es6.string.italics'); +require('./modules/es6.string.link'); +require('./modules/es6.string.small'); +require('./modules/es6.string.strike'); +require('./modules/es6.string.sub'); +require('./modules/es6.string.sup'); +require('./modules/es6.date.now'); +require('./modules/es6.date.to-json'); +require('./modules/es6.date.to-iso-string'); +require('./modules/es6.date.to-string'); +require('./modules/es6.date.to-primitive'); +require('./modules/es6.array.is-array'); +require('./modules/es6.array.from'); +require('./modules/es6.array.of'); +require('./modules/es6.array.join'); +require('./modules/es6.array.slice'); +require('./modules/es6.array.sort'); +require('./modules/es6.array.for-each'); +require('./modules/es6.array.map'); +require('./modules/es6.array.filter'); +require('./modules/es6.array.some'); +require('./modules/es6.array.every'); +require('./modules/es6.array.reduce'); +require('./modules/es6.array.reduce-right'); +require('./modules/es6.array.index-of'); +require('./modules/es6.array.last-index-of'); +require('./modules/es6.array.copy-within'); +require('./modules/es6.array.fill'); +require('./modules/es6.array.find'); +require('./modules/es6.array.find-index'); +require('./modules/es6.array.species'); +require('./modules/es6.array.iterator'); +require('./modules/es6.regexp.constructor'); +require('./modules/es6.regexp.to-string'); +require('./modules/es6.regexp.flags'); +require('./modules/es6.regexp.match'); +require('./modules/es6.regexp.replace'); +require('./modules/es6.regexp.search'); +require('./modules/es6.regexp.split'); +require('./modules/es6.promise'); +require('./modules/es6.map'); +require('./modules/es6.set'); +require('./modules/es6.weak-map'); +require('./modules/es6.weak-set'); +require('./modules/es6.typed.array-buffer'); +require('./modules/es6.typed.data-view'); +require('./modules/es6.typed.int8-array'); +require('./modules/es6.typed.uint8-array'); +require('./modules/es6.typed.uint8-clamped-array'); +require('./modules/es6.typed.int16-array'); +require('./modules/es6.typed.uint16-array'); +require('./modules/es6.typed.int32-array'); +require('./modules/es6.typed.uint32-array'); +require('./modules/es6.typed.float32-array'); +require('./modules/es6.typed.float64-array'); +require('./modules/es6.reflect.apply'); +require('./modules/es6.reflect.construct'); +require('./modules/es6.reflect.define-property'); +require('./modules/es6.reflect.delete-property'); +require('./modules/es6.reflect.enumerate'); +require('./modules/es6.reflect.get'); +require('./modules/es6.reflect.get-own-property-descriptor'); +require('./modules/es6.reflect.get-prototype-of'); +require('./modules/es6.reflect.has'); +require('./modules/es6.reflect.is-extensible'); +require('./modules/es6.reflect.own-keys'); +require('./modules/es6.reflect.prevent-extensions'); +require('./modules/es6.reflect.set'); +require('./modules/es6.reflect.set-prototype-of'); +require('./modules/es7.array.includes'); +require('./modules/es7.array.flat-map'); +require('./modules/es7.array.flatten'); +require('./modules/es7.string.at'); +require('./modules/es7.string.pad-start'); +require('./modules/es7.string.pad-end'); +require('./modules/es7.string.trim-left'); +require('./modules/es7.string.trim-right'); +require('./modules/es7.string.match-all'); +require('./modules/es7.symbol.async-iterator'); +require('./modules/es7.symbol.observable'); +require('./modules/es7.object.get-own-property-descriptors'); +require('./modules/es7.object.values'); +require('./modules/es7.object.entries'); +require('./modules/es7.object.define-getter'); +require('./modules/es7.object.define-setter'); +require('./modules/es7.object.lookup-getter'); +require('./modules/es7.object.lookup-setter'); +require('./modules/es7.map.to-json'); +require('./modules/es7.set.to-json'); +require('./modules/es7.map.of'); +require('./modules/es7.set.of'); +require('./modules/es7.weak-map.of'); +require('./modules/es7.weak-set.of'); +require('./modules/es7.map.from'); +require('./modules/es7.set.from'); +require('./modules/es7.weak-map.from'); +require('./modules/es7.weak-set.from'); +require('./modules/es7.global'); +require('./modules/es7.system.global'); +require('./modules/es7.error.is-error'); +require('./modules/es7.math.clamp'); +require('./modules/es7.math.deg-per-rad'); +require('./modules/es7.math.degrees'); +require('./modules/es7.math.fscale'); +require('./modules/es7.math.iaddh'); +require('./modules/es7.math.isubh'); +require('./modules/es7.math.imulh'); +require('./modules/es7.math.rad-per-deg'); +require('./modules/es7.math.radians'); +require('./modules/es7.math.scale'); +require('./modules/es7.math.umulh'); +require('./modules/es7.math.signbit'); +require('./modules/es7.promise.finally'); +require('./modules/es7.promise.try'); +require('./modules/es7.reflect.define-metadata'); +require('./modules/es7.reflect.delete-metadata'); +require('./modules/es7.reflect.get-metadata'); +require('./modules/es7.reflect.get-metadata-keys'); +require('./modules/es7.reflect.get-own-metadata'); +require('./modules/es7.reflect.get-own-metadata-keys'); +require('./modules/es7.reflect.has-metadata'); +require('./modules/es7.reflect.has-own-metadata'); +require('./modules/es7.reflect.metadata'); +require('./modules/es7.asap'); +require('./modules/es7.observable'); +require('./modules/web.timers'); +require('./modules/web.immediate'); +require('./modules/web.dom.iterable'); +module.exports = require('./modules/_core'); diff --git a/node_modules/core-js/library/stage/0.js b/node_modules/core-js/library/stage/0.js new file mode 100644 index 000000000..4aa50704c --- /dev/null +++ b/node_modules/core-js/library/stage/0.js @@ -0,0 +1,10 @@ +require('../modules/es7.string.at'); +require('../modules/es7.map.to-json'); +require('../modules/es7.set.to-json'); +require('../modules/es7.error.is-error'); +require('../modules/es7.math.iaddh'); +require('../modules/es7.math.isubh'); +require('../modules/es7.math.imulh'); +require('../modules/es7.math.umulh'); +require('../modules/es7.asap'); +module.exports = require('./1'); diff --git a/node_modules/core-js/library/stage/1.js b/node_modules/core-js/library/stage/1.js new file mode 100644 index 000000000..5f634d80b --- /dev/null +++ b/node_modules/core-js/library/stage/1.js @@ -0,0 +1,23 @@ +require('../modules/es7.map.of'); +require('../modules/es7.set.of'); +require('../modules/es7.weak-map.of'); +require('../modules/es7.weak-set.of'); +require('../modules/es7.map.from'); +require('../modules/es7.set.from'); +require('../modules/es7.weak-map.from'); +require('../modules/es7.weak-set.from'); +require('../modules/es7.math.clamp'); +require('../modules/es7.math.deg-per-rad'); +require('../modules/es7.math.degrees'); +require('../modules/es7.math.fscale'); +require('../modules/es7.math.rad-per-deg'); +require('../modules/es7.math.radians'); +require('../modules/es7.math.scale'); +require('../modules/es7.math.signbit'); +require('../modules/es7.promise.try'); +require('../modules/es7.string.match-all'); +require('../modules/es7.symbol.observable'); +require('../modules/es7.observable'); +require('../modules/es7.array.flat-map'); +require('../modules/es7.array.flatten'); +module.exports = require('./2'); diff --git a/node_modules/core-js/library/stage/2.js b/node_modules/core-js/library/stage/2.js new file mode 100644 index 000000000..d7aaa0ef9 --- /dev/null +++ b/node_modules/core-js/library/stage/2.js @@ -0,0 +1,4 @@ +require('../modules/es7.string.trim-left'); +require('../modules/es7.string.trim-right'); +require('../modules/es7.symbol.async-iterator'); +module.exports = require('./3'); diff --git a/node_modules/core-js/library/stage/3.js b/node_modules/core-js/library/stage/3.js new file mode 100644 index 000000000..9afd07fe9 --- /dev/null +++ b/node_modules/core-js/library/stage/3.js @@ -0,0 +1,4 @@ +require('../modules/es7.global'); +require('../modules/es7.system.global'); +require('../modules/es7.promise.finally'); +module.exports = require('./4'); diff --git a/node_modules/core-js/library/stage/4.js b/node_modules/core-js/library/stage/4.js new file mode 100644 index 000000000..875762a23 --- /dev/null +++ b/node_modules/core-js/library/stage/4.js @@ -0,0 +1,11 @@ +require('../modules/es7.object.define-getter'); +require('../modules/es7.object.define-setter'); +require('../modules/es7.object.lookup-getter'); +require('../modules/es7.object.lookup-setter'); +require('../modules/es7.object.values'); +require('../modules/es7.object.entries'); +require('../modules/es7.object.get-own-property-descriptors'); +require('../modules/es7.array.includes'); +require('../modules/es7.string.pad-start'); +require('../modules/es7.string.pad-end'); +module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/library/stage/index.js b/node_modules/core-js/library/stage/index.js new file mode 100644 index 000000000..24dcf2e56 --- /dev/null +++ b/node_modules/core-js/library/stage/index.js @@ -0,0 +1 @@ +module.exports = require('./pre'); diff --git a/node_modules/core-js/library/stage/pre.js b/node_modules/core-js/library/stage/pre.js new file mode 100644 index 000000000..ed197a8ba --- /dev/null +++ b/node_modules/core-js/library/stage/pre.js @@ -0,0 +1,10 @@ +require('../modules/es7.reflect.define-metadata'); +require('../modules/es7.reflect.delete-metadata'); +require('../modules/es7.reflect.get-metadata'); +require('../modules/es7.reflect.get-metadata-keys'); +require('../modules/es7.reflect.get-own-metadata'); +require('../modules/es7.reflect.get-own-metadata-keys'); +require('../modules/es7.reflect.has-metadata'); +require('../modules/es7.reflect.has-own-metadata'); +require('../modules/es7.reflect.metadata'); +module.exports = require('./0'); diff --git a/node_modules/core-js/library/web/dom-collections.js b/node_modules/core-js/library/web/dom-collections.js new file mode 100644 index 000000000..a138bb9dd --- /dev/null +++ b/node_modules/core-js/library/web/dom-collections.js @@ -0,0 +1,2 @@ +require('../modules/web.dom.iterable'); +module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/library/web/immediate.js b/node_modules/core-js/library/web/immediate.js new file mode 100644 index 000000000..6866abdeb --- /dev/null +++ b/node_modules/core-js/library/web/immediate.js @@ -0,0 +1,2 @@ +require('../modules/web.immediate'); +module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/library/web/index.js b/node_modules/core-js/library/web/index.js new file mode 100644 index 000000000..66db256d6 --- /dev/null +++ b/node_modules/core-js/library/web/index.js @@ -0,0 +1,4 @@ +require('../modules/web.timers'); +require('../modules/web.immediate'); +require('../modules/web.dom.iterable'); +module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/library/web/timers.js b/node_modules/core-js/library/web/timers.js new file mode 100644 index 000000000..a3f528e4d --- /dev/null +++ b/node_modules/core-js/library/web/timers.js @@ -0,0 +1,2 @@ +require('../modules/web.timers'); +module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/modules/_a-function.js b/node_modules/core-js/modules/_a-function.js new file mode 100644 index 000000000..a9a5d84ff --- /dev/null +++ b/node_modules/core-js/modules/_a-function.js @@ -0,0 +1,4 @@ +module.exports = function (it) { + if (typeof it != 'function') throw TypeError(it + ' is not a function!'); + return it; +}; diff --git a/node_modules/core-js/modules/_a-number-value.js b/node_modules/core-js/modules/_a-number-value.js new file mode 100644 index 000000000..2723de4d0 --- /dev/null +++ b/node_modules/core-js/modules/_a-number-value.js @@ -0,0 +1,5 @@ +var cof = require('./_cof'); +module.exports = function (it, msg) { + if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg); + return +it; +}; diff --git a/node_modules/core-js/modules/_add-to-unscopables.js b/node_modules/core-js/modules/_add-to-unscopables.js new file mode 100644 index 000000000..a2dd97d99 --- /dev/null +++ b/node_modules/core-js/modules/_add-to-unscopables.js @@ -0,0 +1,7 @@ +// 22.1.3.31 Array.prototype[@@unscopables] +var UNSCOPABLES = require('./_wks')('unscopables'); +var ArrayProto = Array.prototype; +if (ArrayProto[UNSCOPABLES] == undefined) require('./_hide')(ArrayProto, UNSCOPABLES, {}); +module.exports = function (key) { + ArrayProto[UNSCOPABLES][key] = true; +}; diff --git a/node_modules/core-js/modules/_an-instance.js b/node_modules/core-js/modules/_an-instance.js new file mode 100644 index 000000000..c0a5f9200 --- /dev/null +++ b/node_modules/core-js/modules/_an-instance.js @@ -0,0 +1,5 @@ +module.exports = function (it, Constructor, name, forbiddenField) { + if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { + throw TypeError(name + ': incorrect invocation!'); + } return it; +}; diff --git a/node_modules/core-js/modules/_an-object.js b/node_modules/core-js/modules/_an-object.js new file mode 100644 index 000000000..b1c316cd2 --- /dev/null +++ b/node_modules/core-js/modules/_an-object.js @@ -0,0 +1,5 @@ +var isObject = require('./_is-object'); +module.exports = function (it) { + if (!isObject(it)) throw TypeError(it + ' is not an object!'); + return it; +}; diff --git a/node_modules/core-js/modules/_array-copy-within.js b/node_modules/core-js/modules/_array-copy-within.js new file mode 100644 index 000000000..d331576c4 --- /dev/null +++ b/node_modules/core-js/modules/_array-copy-within.js @@ -0,0 +1,26 @@ +// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) +'use strict'; +var toObject = require('./_to-object'); +var toAbsoluteIndex = require('./_to-absolute-index'); +var toLength = require('./_to-length'); + +module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { + var O = toObject(this); + var len = toLength(O.length); + var to = toAbsoluteIndex(target, len); + var from = toAbsoluteIndex(start, len); + var end = arguments.length > 2 ? arguments[2] : undefined; + var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); + var inc = 1; + if (from < to && to < from + count) { + inc = -1; + from += count - 1; + to += count - 1; + } + while (count-- > 0) { + if (from in O) O[to] = O[from]; + else delete O[to]; + to += inc; + from += inc; + } return O; +}; diff --git a/node_modules/core-js/modules/_array-fill.js b/node_modules/core-js/modules/_array-fill.js new file mode 100644 index 000000000..0753c36ac --- /dev/null +++ b/node_modules/core-js/modules/_array-fill.js @@ -0,0 +1,15 @@ +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) +'use strict'; +var toObject = require('./_to-object'); +var toAbsoluteIndex = require('./_to-absolute-index'); +var toLength = require('./_to-length'); +module.exports = function fill(value /* , start = 0, end = @length */) { + var O = toObject(this); + var length = toLength(O.length); + var aLen = arguments.length; + var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); + var end = aLen > 2 ? arguments[2] : undefined; + var endPos = end === undefined ? length : toAbsoluteIndex(end, length); + while (endPos > index) O[index++] = value; + return O; +}; diff --git a/node_modules/core-js/modules/_array-from-iterable.js b/node_modules/core-js/modules/_array-from-iterable.js new file mode 100644 index 000000000..08be255f0 --- /dev/null +++ b/node_modules/core-js/modules/_array-from-iterable.js @@ -0,0 +1,7 @@ +var forOf = require('./_for-of'); + +module.exports = function (iter, ITERATOR) { + var result = []; + forOf(iter, false, result.push, result, ITERATOR); + return result; +}; diff --git a/node_modules/core-js/modules/_array-includes.js b/node_modules/core-js/modules/_array-includes.js new file mode 100644 index 000000000..0ef3efebe --- /dev/null +++ b/node_modules/core-js/modules/_array-includes.js @@ -0,0 +1,23 @@ +// false -> Array#indexOf +// true -> Array#includes +var toIObject = require('./_to-iobject'); +var toLength = require('./_to-length'); +var toAbsoluteIndex = require('./_to-absolute-index'); +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; + }; +}; diff --git a/node_modules/core-js/modules/_array-methods.js b/node_modules/core-js/modules/_array-methods.js new file mode 100644 index 000000000..ae7f447da --- /dev/null +++ b/node_modules/core-js/modules/_array-methods.js @@ -0,0 +1,44 @@ +// 0 -> Array#forEach +// 1 -> Array#map +// 2 -> Array#filter +// 3 -> Array#some +// 4 -> Array#every +// 5 -> Array#find +// 6 -> Array#findIndex +var ctx = require('./_ctx'); +var IObject = require('./_iobject'); +var toObject = require('./_to-object'); +var toLength = require('./_to-length'); +var asc = require('./_array-species-create'); +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; + }; +}; diff --git a/node_modules/core-js/modules/_array-reduce.js b/node_modules/core-js/modules/_array-reduce.js new file mode 100644 index 000000000..8596ac70a --- /dev/null +++ b/node_modules/core-js/modules/_array-reduce.js @@ -0,0 +1,28 @@ +var aFunction = require('./_a-function'); +var toObject = require('./_to-object'); +var IObject = require('./_iobject'); +var toLength = require('./_to-length'); + +module.exports = function (that, callbackfn, aLen, memo, isRight) { + aFunction(callbackfn); + var O = toObject(that); + var self = IObject(O); + var length = toLength(O.length); + var index = isRight ? length - 1 : 0; + var i = isRight ? -1 : 1; + if (aLen < 2) for (;;) { + if (index in self) { + memo = self[index]; + index += i; + break; + } + index += i; + if (isRight ? index < 0 : length <= index) { + throw TypeError('Reduce of empty array with no initial value'); + } + } + for (;isRight ? index >= 0 : length > index; index += i) if (index in self) { + memo = callbackfn(memo, self[index], index, O); + } + return memo; +}; diff --git a/node_modules/core-js/modules/_array-species-constructor.js b/node_modules/core-js/modules/_array-species-constructor.js new file mode 100644 index 000000000..0771c236d --- /dev/null +++ b/node_modules/core-js/modules/_array-species-constructor.js @@ -0,0 +1,16 @@ +var isObject = require('./_is-object'); +var isArray = require('./_is-array'); +var SPECIES = require('./_wks')('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; +}; diff --git a/node_modules/core-js/modules/_array-species-create.js b/node_modules/core-js/modules/_array-species-create.js new file mode 100644 index 000000000..36ed58bd7 --- /dev/null +++ b/node_modules/core-js/modules/_array-species-create.js @@ -0,0 +1,6 @@ +// 9.4.2.3 ArraySpeciesCreate(originalArray, length) +var speciesConstructor = require('./_array-species-constructor'); + +module.exports = function (original, length) { + return new (speciesConstructor(original))(length); +}; diff --git a/node_modules/core-js/modules/_bind.js b/node_modules/core-js/modules/_bind.js new file mode 100644 index 000000000..3cf1e5ae5 --- /dev/null +++ b/node_modules/core-js/modules/_bind.js @@ -0,0 +1,25 @@ +'use strict'; +var aFunction = require('./_a-function'); +var isObject = require('./_is-object'); +var invoke = require('./_invoke'); +var arraySlice = [].slice; +var factories = {}; + +var construct = function (F, len, args) { + if (!(len in factories)) { + for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']'; + // eslint-disable-next-line no-new-func + factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); + } return factories[len](F, args); +}; + +module.exports = Function.bind || function bind(that /* , ...args */) { + var fn = aFunction(this); + var partArgs = arraySlice.call(arguments, 1); + var bound = function (/* args... */) { + var args = partArgs.concat(arraySlice.call(arguments)); + return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); + }; + if (isObject(fn.prototype)) bound.prototype = fn.prototype; + return bound; +}; diff --git a/node_modules/core-js/modules/_classof.js b/node_modules/core-js/modules/_classof.js new file mode 100644 index 000000000..d106d5be6 --- /dev/null +++ b/node_modules/core-js/modules/_classof.js @@ -0,0 +1,23 @@ +// getting tag from 19.1.3.6 Object.prototype.toString() +var cof = require('./_cof'); +var TAG = require('./_wks')('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; +}; diff --git a/node_modules/core-js/modules/_cof.js b/node_modules/core-js/modules/_cof.js new file mode 100644 index 000000000..332c0bc0b --- /dev/null +++ b/node_modules/core-js/modules/_cof.js @@ -0,0 +1,5 @@ +var toString = {}.toString; + +module.exports = function (it) { + return toString.call(it).slice(8, -1); +}; diff --git a/node_modules/core-js/modules/_collection-strong.js b/node_modules/core-js/modules/_collection-strong.js new file mode 100644 index 000000000..68ce63f0e --- /dev/null +++ b/node_modules/core-js/modules/_collection-strong.js @@ -0,0 +1,144 @@ +'use strict'; +var dP = require('./_object-dp').f; +var create = require('./_object-create'); +var redefineAll = require('./_redefine-all'); +var ctx = require('./_ctx'); +var anInstance = require('./_an-instance'); +var forOf = require('./_for-of'); +var $iterDefine = require('./_iter-define'); +var step = require('./_iter-step'); +var setSpecies = require('./_set-species'); +var DESCRIPTORS = require('./_descriptors'); +var fastKey = require('./_meta').fastKey; +var validate = require('./_validate-collection'); +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); + } +}; diff --git a/node_modules/core-js/modules/_collection-to-json.js b/node_modules/core-js/modules/_collection-to-json.js new file mode 100644 index 000000000..a6ee0029a --- /dev/null +++ b/node_modules/core-js/modules/_collection-to-json.js @@ -0,0 +1,9 @@ +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var classof = require('./_classof'); +var from = require('./_array-from-iterable'); +module.exports = function (NAME) { + return function toJSON() { + if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); + return from(this); + }; +}; diff --git a/node_modules/core-js/modules/_collection-weak.js b/node_modules/core-js/modules/_collection-weak.js new file mode 100644 index 000000000..04d3af5af --- /dev/null +++ b/node_modules/core-js/modules/_collection-weak.js @@ -0,0 +1,85 @@ +'use strict'; +var redefineAll = require('./_redefine-all'); +var getWeak = require('./_meta').getWeak; +var anObject = require('./_an-object'); +var isObject = require('./_is-object'); +var anInstance = require('./_an-instance'); +var forOf = require('./_for-of'); +var createArrayMethod = require('./_array-methods'); +var $has = require('./_has'); +var validate = require('./_validate-collection'); +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 +}; diff --git a/node_modules/core-js/modules/_collection.js b/node_modules/core-js/modules/_collection.js new file mode 100644 index 000000000..767dde506 --- /dev/null +++ b/node_modules/core-js/modules/_collection.js @@ -0,0 +1,85 @@ +'use strict'; +var global = require('./_global'); +var $export = require('./_export'); +var redefine = require('./_redefine'); +var redefineAll = require('./_redefine-all'); +var meta = require('./_meta'); +var forOf = require('./_for-of'); +var anInstance = require('./_an-instance'); +var isObject = require('./_is-object'); +var fails = require('./_fails'); +var $iterDetect = require('./_iter-detect'); +var setToStringTag = require('./_set-to-string-tag'); +var inheritIfRequired = require('./_inherit-if-required'); + +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 = {}; + var fixMethod = function (KEY) { + var fn = proto[KEY]; + redefine(proto, KEY, + KEY == 'delete' ? function (a) { + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'has' ? function has(a) { + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'get' ? function get(a) { + return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; } + : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; } + ); + }; + if (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 { + var instance = new C(); + // early implementations not supports chaining + var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; + // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false + var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); + // most early implementations doesn't supports iterables, most modern - not close it correctly + var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new + // for early implementations -0 and +0 not the same + var BUGGY_ZERO = !IS_WEAK && fails(function () { + // V8 ~ Chromium 42- fails only with 5+ elements + var $instance = new C(); + var index = 5; + while (index--) $instance[ADDER](index, index); + return !$instance.has(-0); + }); + if (!ACCEPT_ITERABLES) { + C = wrapper(function (target, iterable) { + anInstance(target, C, NAME); + var that = inheritIfRequired(new Base(), target, C); + if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); + return that; + }); + C.prototype = proto; + proto.constructor = C; + } + if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { + fixMethod('delete'); + fixMethod('has'); + IS_MAP && fixMethod('get'); + } + if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); + // weak collections should not contains .clear method + if (IS_WEAK && proto.clear) delete proto.clear; + } + + setToStringTag(C, NAME); + + O[NAME] = C; + $export($export.G + $export.W + $export.F * (C != Base), O); + + if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); + + return C; +}; diff --git a/node_modules/core-js/modules/_core.js b/node_modules/core-js/modules/_core.js new file mode 100644 index 000000000..c61ad5100 --- /dev/null +++ b/node_modules/core-js/modules/_core.js @@ -0,0 +1,2 @@ +var core = module.exports = { version: '2.5.7' }; +if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef diff --git a/node_modules/core-js/modules/_create-property.js b/node_modules/core-js/modules/_create-property.js new file mode 100644 index 000000000..fd0ea8c9a --- /dev/null +++ b/node_modules/core-js/modules/_create-property.js @@ -0,0 +1,8 @@ +'use strict'; +var $defineProperty = require('./_object-dp'); +var createDesc = require('./_property-desc'); + +module.exports = function (object, index, value) { + if (index in object) $defineProperty.f(object, index, createDesc(0, value)); + else object[index] = value; +}; diff --git a/node_modules/core-js/modules/_ctx.js b/node_modules/core-js/modules/_ctx.js new file mode 100644 index 000000000..0a100ff3d --- /dev/null +++ b/node_modules/core-js/modules/_ctx.js @@ -0,0 +1,20 @@ +// optional / simple context binding +var aFunction = require('./_a-function'); +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); + }; +}; diff --git a/node_modules/core-js/modules/_date-to-iso-string.js b/node_modules/core-js/modules/_date-to-iso-string.js new file mode 100644 index 000000000..95a02e224 --- /dev/null +++ b/node_modules/core-js/modules/_date-to-iso-string.js @@ -0,0 +1,26 @@ +'use strict'; +// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() +var fails = require('./_fails'); +var getTime = Date.prototype.getTime; +var $toISOString = Date.prototype.toISOString; + +var lz = function (num) { + return num > 9 ? num : '0' + num; +}; + +// PhantomJS / old WebKit has a broken implementations +module.exports = (fails(function () { + return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; +}) || !fails(function () { + $toISOString.call(new Date(NaN)); +})) ? function toISOString() { + if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value'); + var d = this; + var y = d.getUTCFullYear(); + var m = d.getUTCMilliseconds(); + var s = y < 0 ? '-' : y > 9999 ? '+' : ''; + return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + + '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + + 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + + ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; +} : $toISOString; diff --git a/node_modules/core-js/modules/_date-to-primitive.js b/node_modules/core-js/modules/_date-to-primitive.js new file mode 100644 index 000000000..57c32030c --- /dev/null +++ b/node_modules/core-js/modules/_date-to-primitive.js @@ -0,0 +1,9 @@ +'use strict'; +var anObject = require('./_an-object'); +var toPrimitive = require('./_to-primitive'); +var NUMBER = 'number'; + +module.exports = function (hint) { + if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint'); + return toPrimitive(anObject(this), hint != NUMBER); +}; diff --git a/node_modules/core-js/modules/_defined.js b/node_modules/core-js/modules/_defined.js new file mode 100644 index 000000000..66c7ed323 --- /dev/null +++ b/node_modules/core-js/modules/_defined.js @@ -0,0 +1,5 @@ +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; +}; diff --git a/node_modules/core-js/modules/_descriptors.js b/node_modules/core-js/modules/_descriptors.js new file mode 100644 index 000000000..046974066 --- /dev/null +++ b/node_modules/core-js/modules/_descriptors.js @@ -0,0 +1,4 @@ +// Thank's IE8 for his funny defineProperty +module.exports = !require('./_fails')(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; +}); diff --git a/node_modules/core-js/modules/_dom-create.js b/node_modules/core-js/modules/_dom-create.js new file mode 100644 index 000000000..39ca2569d --- /dev/null +++ b/node_modules/core-js/modules/_dom-create.js @@ -0,0 +1,7 @@ +var isObject = require('./_is-object'); +var document = require('./_global').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) : {}; +}; diff --git a/node_modules/core-js/modules/_entry-virtual.js b/node_modules/core-js/modules/_entry-virtual.js new file mode 100644 index 000000000..7a734390a --- /dev/null +++ b/node_modules/core-js/modules/_entry-virtual.js @@ -0,0 +1,5 @@ +var core = require('./_core'); +module.exports = function (CONSTRUCTOR) { + var C = core[CONSTRUCTOR]; + return (C.virtual || C.prototype); +}; diff --git a/node_modules/core-js/modules/_enum-bug-keys.js b/node_modules/core-js/modules/_enum-bug-keys.js new file mode 100644 index 000000000..d9ad85514 --- /dev/null +++ b/node_modules/core-js/modules/_enum-bug-keys.js @@ -0,0 +1,4 @@ +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); diff --git a/node_modules/core-js/modules/_enum-keys.js b/node_modules/core-js/modules/_enum-keys.js new file mode 100644 index 000000000..3e7053d13 --- /dev/null +++ b/node_modules/core-js/modules/_enum-keys.js @@ -0,0 +1,15 @@ +// all enumerable object keys, includes symbols +var getKeys = require('./_object-keys'); +var gOPS = require('./_object-gops'); +var pIE = require('./_object-pie'); +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; +}; diff --git a/node_modules/core-js/modules/_export.js b/node_modules/core-js/modules/_export.js new file mode 100644 index 000000000..3c907c6ea --- /dev/null +++ b/node_modules/core-js/modules/_export.js @@ -0,0 +1,43 @@ +var global = require('./_global'); +var core = require('./_core'); +var hide = require('./_hide'); +var redefine = require('./_redefine'); +var ctx = require('./_ctx'); +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 target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; + var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); + var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); + var key, own, out, exp; + if (IS_GLOBAL) source = name; + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + // export native or passed + out = (own ? target : source)[key]; + // bind timers to global for call from export context + exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // extend global + if (target) redefine(target, key, out, type & $export.U); + // export + if (exports[key] != out) hide(exports, key, exp); + if (IS_PROTO && expProto[key] != out) expProto[key] = out; + } +}; +global.core = core; +// 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; diff --git a/node_modules/core-js/modules/_fails-is-regexp.js b/node_modules/core-js/modules/_fails-is-regexp.js new file mode 100644 index 000000000..8eec2e471 --- /dev/null +++ b/node_modules/core-js/modules/_fails-is-regexp.js @@ -0,0 +1,12 @@ +var MATCH = require('./_wks')('match'); +module.exports = function (KEY) { + var re = /./; + try { + '/./'[KEY](re); + } catch (e) { + try { + re[MATCH] = false; + return !'/./'[KEY](re); + } catch (f) { /* empty */ } + } return true; +}; diff --git a/node_modules/core-js/modules/_fails.js b/node_modules/core-js/modules/_fails.js new file mode 100644 index 000000000..3b4cdf674 --- /dev/null +++ b/node_modules/core-js/modules/_fails.js @@ -0,0 +1,7 @@ +module.exports = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } +}; diff --git a/node_modules/core-js/modules/_fix-re-wks.js b/node_modules/core-js/modules/_fix-re-wks.js new file mode 100644 index 000000000..9a62380b3 --- /dev/null +++ b/node_modules/core-js/modules/_fix-re-wks.js @@ -0,0 +1,28 @@ +'use strict'; +var hide = require('./_hide'); +var redefine = require('./_redefine'); +var fails = require('./_fails'); +var defined = require('./_defined'); +var wks = require('./_wks'); + +module.exports = function (KEY, length, exec) { + var SYMBOL = wks(KEY); + var fns = exec(defined, SYMBOL, ''[KEY]); + var strfn = fns[0]; + var rxfn = fns[1]; + if (fails(function () { + var O = {}; + O[SYMBOL] = function () { return 7; }; + return ''[KEY](O) != 7; + })) { + redefine(String.prototype, KEY, strfn); + hide(RegExp.prototype, SYMBOL, length == 2 + // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) + // 21.2.5.11 RegExp.prototype[@@split](string, limit) + ? function (string, arg) { return rxfn.call(string, this, arg); } + // 21.2.5.6 RegExp.prototype[@@match](string) + // 21.2.5.9 RegExp.prototype[@@search](string) + : function (string) { return rxfn.call(string, this); } + ); + } +}; diff --git a/node_modules/core-js/modules/_flags.js b/node_modules/core-js/modules/_flags.js new file mode 100644 index 000000000..b6fc324bd --- /dev/null +++ b/node_modules/core-js/modules/_flags.js @@ -0,0 +1,13 @@ +'use strict'; +// 21.2.5.3 get RegExp.prototype.flags +var anObject = require('./_an-object'); +module.exports = function () { + var that = anObject(this); + var result = ''; + if (that.global) result += 'g'; + if (that.ignoreCase) result += 'i'; + if (that.multiline) result += 'm'; + if (that.unicode) result += 'u'; + if (that.sticky) result += 'y'; + return result; +}; diff --git a/node_modules/core-js/modules/_flatten-into-array.js b/node_modules/core-js/modules/_flatten-into-array.js new file mode 100644 index 000000000..1838517ae --- /dev/null +++ b/node_modules/core-js/modules/_flatten-into-array.js @@ -0,0 +1,39 @@ +'use strict'; +// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray +var isArray = require('./_is-array'); +var isObject = require('./_is-object'); +var toLength = require('./_to-length'); +var ctx = require('./_ctx'); +var IS_CONCAT_SPREADABLE = require('./_wks')('isConcatSpreadable'); + +function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) { + var targetIndex = start; + var sourceIndex = 0; + var mapFn = mapper ? ctx(mapper, thisArg, 3) : false; + var element, spreadable; + + while (sourceIndex < sourceLen) { + if (sourceIndex in source) { + element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; + + spreadable = false; + if (isObject(element)) { + spreadable = element[IS_CONCAT_SPREADABLE]; + spreadable = spreadable !== undefined ? !!spreadable : isArray(element); + } + + if (spreadable && depth > 0) { + targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1; + } else { + if (targetIndex >= 0x1fffffffffffff) throw TypeError(); + target[targetIndex] = element; + } + + targetIndex++; + } + sourceIndex++; + } + return targetIndex; +} + +module.exports = flattenIntoArray; diff --git a/node_modules/core-js/modules/_for-of.js b/node_modules/core-js/modules/_for-of.js new file mode 100644 index 000000000..9ed22818b --- /dev/null +++ b/node_modules/core-js/modules/_for-of.js @@ -0,0 +1,25 @@ +var ctx = require('./_ctx'); +var call = require('./_iter-call'); +var isArrayIter = require('./_is-array-iter'); +var anObject = require('./_an-object'); +var toLength = require('./_to-length'); +var getIterFn = require('./core.get-iterator-method'); +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; diff --git a/node_modules/core-js/modules/_global.js b/node_modules/core-js/modules/_global.js new file mode 100644 index 000000000..bf85b44a1 --- /dev/null +++ b/node_modules/core-js/modules/_global.js @@ -0,0 +1,6 @@ +// 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 diff --git a/node_modules/core-js/modules/_has.js b/node_modules/core-js/modules/_has.js new file mode 100644 index 000000000..2a37d8b7a --- /dev/null +++ b/node_modules/core-js/modules/_has.js @@ -0,0 +1,4 @@ +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function (it, key) { + return hasOwnProperty.call(it, key); +}; diff --git a/node_modules/core-js/modules/_hide.js b/node_modules/core-js/modules/_hide.js new file mode 100644 index 000000000..cec258a0a --- /dev/null +++ b/node_modules/core-js/modules/_hide.js @@ -0,0 +1,8 @@ +var dP = require('./_object-dp'); +var createDesc = require('./_property-desc'); +module.exports = require('./_descriptors') ? function (object, key, value) { + return dP.f(object, key, createDesc(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; +}; diff --git a/node_modules/core-js/modules/_html.js b/node_modules/core-js/modules/_html.js new file mode 100644 index 000000000..7daff14ca --- /dev/null +++ b/node_modules/core-js/modules/_html.js @@ -0,0 +1,2 @@ +var document = require('./_global').document; +module.exports = document && document.documentElement; diff --git a/node_modules/core-js/modules/_ie8-dom-define.js b/node_modules/core-js/modules/_ie8-dom-define.js new file mode 100644 index 000000000..a3805cb7f --- /dev/null +++ b/node_modules/core-js/modules/_ie8-dom-define.js @@ -0,0 +1,3 @@ +module.exports = !require('./_descriptors') && !require('./_fails')(function () { + return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7; +}); diff --git a/node_modules/core-js/modules/_inherit-if-required.js b/node_modules/core-js/modules/_inherit-if-required.js new file mode 100644 index 000000000..b95fcd984 --- /dev/null +++ b/node_modules/core-js/modules/_inherit-if-required.js @@ -0,0 +1,9 @@ +var isObject = require('./_is-object'); +var setPrototypeOf = require('./_set-proto').set; +module.exports = function (that, target, C) { + var S = target.constructor; + var P; + if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { + setPrototypeOf(that, P); + } return that; +}; diff --git a/node_modules/core-js/modules/_invoke.js b/node_modules/core-js/modules/_invoke.js new file mode 100644 index 000000000..6cccebdc1 --- /dev/null +++ b/node_modules/core-js/modules/_invoke.js @@ -0,0 +1,16 @@ +// fast apply, http://jsperf.lnkit.com/fast-apply/5 +module.exports = function (fn, args, that) { + var un = that === undefined; + switch (args.length) { + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); +}; diff --git a/node_modules/core-js/modules/_iobject.js b/node_modules/core-js/modules/_iobject.js new file mode 100644 index 000000000..2b57c8a07 --- /dev/null +++ b/node_modules/core-js/modules/_iobject.js @@ -0,0 +1,6 @@ +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = require('./_cof'); +// eslint-disable-next-line no-prototype-builtins +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { + return cof(it) == 'String' ? it.split('') : Object(it); +}; diff --git a/node_modules/core-js/modules/_is-array-iter.js b/node_modules/core-js/modules/_is-array-iter.js new file mode 100644 index 000000000..6f67d9052 --- /dev/null +++ b/node_modules/core-js/modules/_is-array-iter.js @@ -0,0 +1,8 @@ +// check on default Array iterator +var Iterators = require('./_iterators'); +var ITERATOR = require('./_wks')('iterator'); +var ArrayProto = Array.prototype; + +module.exports = function (it) { + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); +}; diff --git a/node_modules/core-js/modules/_is-array.js b/node_modules/core-js/modules/_is-array.js new file mode 100644 index 000000000..0581dc2e7 --- /dev/null +++ b/node_modules/core-js/modules/_is-array.js @@ -0,0 +1,5 @@ +// 7.2.2 IsArray(argument) +var cof = require('./_cof'); +module.exports = Array.isArray || function isArray(arg) { + return cof(arg) == 'Array'; +}; diff --git a/node_modules/core-js/modules/_is-integer.js b/node_modules/core-js/modules/_is-integer.js new file mode 100644 index 000000000..0074ae975 --- /dev/null +++ b/node_modules/core-js/modules/_is-integer.js @@ -0,0 +1,6 @@ +// 20.1.2.3 Number.isInteger(number) +var isObject = require('./_is-object'); +var floor = Math.floor; +module.exports = function isInteger(it) { + return !isObject(it) && isFinite(it) && floor(it) === it; +}; diff --git a/node_modules/core-js/modules/_is-object.js b/node_modules/core-js/modules/_is-object.js new file mode 100644 index 000000000..dda6e04d2 --- /dev/null +++ b/node_modules/core-js/modules/_is-object.js @@ -0,0 +1,3 @@ +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; diff --git a/node_modules/core-js/modules/_is-regexp.js b/node_modules/core-js/modules/_is-regexp.js new file mode 100644 index 000000000..598d159d5 --- /dev/null +++ b/node_modules/core-js/modules/_is-regexp.js @@ -0,0 +1,8 @@ +// 7.2.8 IsRegExp(argument) +var isObject = require('./_is-object'); +var cof = require('./_cof'); +var MATCH = require('./_wks')('match'); +module.exports = function (it) { + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); +}; diff --git a/node_modules/core-js/modules/_iter-call.js b/node_modules/core-js/modules/_iter-call.js new file mode 100644 index 000000000..a7026e347 --- /dev/null +++ b/node_modules/core-js/modules/_iter-call.js @@ -0,0 +1,12 @@ +// call something on iterator step with safe closing on error +var anObject = require('./_an-object'); +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; + } +}; diff --git a/node_modules/core-js/modules/_iter-create.js b/node_modules/core-js/modules/_iter-create.js new file mode 100644 index 000000000..04708c83c --- /dev/null +++ b/node_modules/core-js/modules/_iter-create.js @@ -0,0 +1,13 @@ +'use strict'; +var create = require('./_object-create'); +var descriptor = require('./_property-desc'); +var setToStringTag = require('./_set-to-string-tag'); +var IteratorPrototype = {}; + +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +require('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; }); + +module.exports = function (Constructor, NAME, next) { + Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); + setToStringTag(Constructor, NAME + ' Iterator'); +}; diff --git a/node_modules/core-js/modules/_iter-define.js b/node_modules/core-js/modules/_iter-define.js new file mode 100644 index 000000000..578dfb734 --- /dev/null +++ b/node_modules/core-js/modules/_iter-define.js @@ -0,0 +1,69 @@ +'use strict'; +var LIBRARY = require('./_library'); +var $export = require('./_export'); +var redefine = require('./_redefine'); +var hide = require('./_hide'); +var Iterators = require('./_iterators'); +var $iterCreate = require('./_iter-create'); +var setToStringTag = require('./_set-to-string-tag'); +var getPrototypeOf = require('./_object-gpo'); +var ITERATOR = require('./_wks')('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; +}; diff --git a/node_modules/core-js/modules/_iter-detect.js b/node_modules/core-js/modules/_iter-detect.js new file mode 100644 index 000000000..5cb34973c --- /dev/null +++ b/node_modules/core-js/modules/_iter-detect.js @@ -0,0 +1,22 @@ +var ITERATOR = require('./_wks')('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; +}; diff --git a/node_modules/core-js/modules/_iter-step.js b/node_modules/core-js/modules/_iter-step.js new file mode 100644 index 000000000..b0691c883 --- /dev/null +++ b/node_modules/core-js/modules/_iter-step.js @@ -0,0 +1,3 @@ +module.exports = function (done, value) { + return { value: value, done: !!done }; +}; diff --git a/node_modules/core-js/modules/_iterators.js b/node_modules/core-js/modules/_iterators.js new file mode 100644 index 000000000..f053ebf79 --- /dev/null +++ b/node_modules/core-js/modules/_iterators.js @@ -0,0 +1 @@ +module.exports = {}; diff --git a/node_modules/core-js/modules/_keyof.js b/node_modules/core-js/modules/_keyof.js new file mode 100644 index 000000000..0786096fd --- /dev/null +++ b/node_modules/core-js/modules/_keyof.js @@ -0,0 +1,10 @@ +var getKeys = require('./_object-keys'); +var toIObject = require('./_to-iobject'); +module.exports = function (object, el) { + var O = toIObject(object); + var keys = getKeys(O); + var length = keys.length; + var index = 0; + var key; + while (length > index) if (O[key = keys[index++]] === el) return key; +}; diff --git a/node_modules/core-js/modules/_library.js b/node_modules/core-js/modules/_library.js new file mode 100644 index 000000000..a5d30209b --- /dev/null +++ b/node_modules/core-js/modules/_library.js @@ -0,0 +1 @@ +module.exports = false; diff --git a/node_modules/core-js/modules/_math-expm1.js b/node_modules/core-js/modules/_math-expm1.js new file mode 100644 index 000000000..75c685014 --- /dev/null +++ b/node_modules/core-js/modules/_math-expm1.js @@ -0,0 +1,10 @@ +// 20.2.2.14 Math.expm1(x) +var $expm1 = Math.expm1; +module.exports = (!$expm1 + // Old FF bug + || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 + // Tor Browser bug + || $expm1(-2e-17) != -2e-17 +) ? function expm1(x) { + return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; +} : $expm1; diff --git a/node_modules/core-js/modules/_math-fround.js b/node_modules/core-js/modules/_math-fround.js new file mode 100644 index 000000000..c85eb4b7e --- /dev/null +++ b/node_modules/core-js/modules/_math-fround.js @@ -0,0 +1,23 @@ +// 20.2.2.16 Math.fround(x) +var sign = require('./_math-sign'); +var pow = Math.pow; +var EPSILON = pow(2, -52); +var EPSILON32 = pow(2, -23); +var MAX32 = pow(2, 127) * (2 - EPSILON32); +var MIN32 = pow(2, -126); + +var roundTiesToEven = function (n) { + return n + 1 / EPSILON - 1 / EPSILON; +}; + +module.exports = Math.fround || function fround(x) { + var $abs = Math.abs(x); + var $sign = sign(x); + var a, result; + if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; + a = (1 + EPSILON32 / EPSILON) * $abs; + result = a - (a - $abs); + // eslint-disable-next-line no-self-compare + if (result > MAX32 || result != result) return $sign * Infinity; + return $sign * result; +}; diff --git a/node_modules/core-js/modules/_math-log1p.js b/node_modules/core-js/modules/_math-log1p.js new file mode 100644 index 000000000..16d5f4931 --- /dev/null +++ b/node_modules/core-js/modules/_math-log1p.js @@ -0,0 +1,4 @@ +// 20.2.2.20 Math.log1p(x) +module.exports = Math.log1p || function log1p(x) { + return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); +}; diff --git a/node_modules/core-js/modules/_math-scale.js b/node_modules/core-js/modules/_math-scale.js new file mode 100644 index 000000000..ba3cdb20c --- /dev/null +++ b/node_modules/core-js/modules/_math-scale.js @@ -0,0 +1,18 @@ +// https://rwaldron.github.io/proposal-math-extensions/ +module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) { + if ( + arguments.length === 0 + // eslint-disable-next-line no-self-compare + || x != x + // eslint-disable-next-line no-self-compare + || inLow != inLow + // eslint-disable-next-line no-self-compare + || inHigh != inHigh + // eslint-disable-next-line no-self-compare + || outLow != outLow + // eslint-disable-next-line no-self-compare + || outHigh != outHigh + ) return NaN; + if (x === Infinity || x === -Infinity) return x; + return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow; +}; diff --git a/node_modules/core-js/modules/_math-sign.js b/node_modules/core-js/modules/_math-sign.js new file mode 100644 index 000000000..7a46b9d08 --- /dev/null +++ b/node_modules/core-js/modules/_math-sign.js @@ -0,0 +1,5 @@ +// 20.2.2.28 Math.sign(x) +module.exports = Math.sign || function sign(x) { + // eslint-disable-next-line no-self-compare + return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; +}; diff --git a/node_modules/core-js/modules/_meta.js b/node_modules/core-js/modules/_meta.js new file mode 100644 index 000000000..2d4b32579 --- /dev/null +++ b/node_modules/core-js/modules/_meta.js @@ -0,0 +1,53 @@ +var META = require('./_uid')('meta'); +var isObject = require('./_is-object'); +var has = require('./_has'); +var setDesc = require('./_object-dp').f; +var id = 0; +var isExtensible = Object.isExtensible || function () { + return true; +}; +var FREEZE = !require('./_fails')(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 +}; diff --git a/node_modules/core-js/modules/_metadata.js b/node_modules/core-js/modules/_metadata.js new file mode 100644 index 000000000..759cfc445 --- /dev/null +++ b/node_modules/core-js/modules/_metadata.js @@ -0,0 +1,51 @@ +var Map = require('./es6.map'); +var $export = require('./_export'); +var shared = require('./_shared')('metadata'); +var store = shared.store || (shared.store = new (require('./es6.weak-map'))()); + +var getOrCreateMetadataMap = function (target, targetKey, create) { + var targetMetadata = store.get(target); + if (!targetMetadata) { + if (!create) return undefined; + store.set(target, targetMetadata = new Map()); + } + var keyMetadata = targetMetadata.get(targetKey); + if (!keyMetadata) { + if (!create) return undefined; + targetMetadata.set(targetKey, keyMetadata = new Map()); + } return keyMetadata; +}; +var ordinaryHasOwnMetadata = function (MetadataKey, O, P) { + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? false : metadataMap.has(MetadataKey); +}; +var ordinaryGetOwnMetadata = function (MetadataKey, O, P) { + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); +}; +var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) { + getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); +}; +var ordinaryOwnMetadataKeys = function (target, targetKey) { + var metadataMap = getOrCreateMetadataMap(target, targetKey, false); + var keys = []; + if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); }); + return keys; +}; +var toMetaKey = function (it) { + return it === undefined || typeof it == 'symbol' ? it : String(it); +}; +var exp = function (O) { + $export($export.S, 'Reflect', O); +}; + +module.exports = { + store: store, + map: getOrCreateMetadataMap, + has: ordinaryHasOwnMetadata, + get: ordinaryGetOwnMetadata, + set: ordinaryDefineOwnMetadata, + keys: ordinaryOwnMetadataKeys, + key: toMetaKey, + exp: exp +}; diff --git a/node_modules/core-js/modules/_microtask.js b/node_modules/core-js/modules/_microtask.js new file mode 100644 index 000000000..b321c648c --- /dev/null +++ b/node_modules/core-js/modules/_microtask.js @@ -0,0 +1,69 @@ +var global = require('./_global'); +var macrotask = require('./_task').set; +var Observer = global.MutationObserver || global.WebKitMutationObserver; +var process = global.process; +var Promise = global.Promise; +var isNode = require('./_cof')(process) == 'process'; + +module.exports = function () { + var head, last, notify; + + var flush = function () { + var parent, fn; + if (isNode && (parent = process.domain)) parent.exit(); + while (head) { + fn = head.fn; + head = head.next; + try { + fn(); + } catch (e) { + if (head) notify(); + else last = undefined; + throw e; + } + } last = undefined; + if (parent) parent.enter(); + }; + + // Node.js + if (isNode) { + notify = function () { + process.nextTick(flush); + }; + // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 + } else if (Observer && !(global.navigator && global.navigator.standalone)) { + var toggle = true; + var node = document.createTextNode(''); + new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new + notify = function () { + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if (Promise && Promise.resolve) { + // Promise.resolve without an argument throws an error in LG WebOS 2 + var promise = Promise.resolve(undefined); + notify = function () { + promise.then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function () { + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } + + return function (fn) { + var task = { fn: fn, next: undefined }; + if (last) last.next = task; + if (!head) { + head = task; + notify(); + } last = task; + }; +}; diff --git a/node_modules/core-js/modules/_new-promise-capability.js b/node_modules/core-js/modules/_new-promise-capability.js new file mode 100644 index 000000000..82b74a331 --- /dev/null +++ b/node_modules/core-js/modules/_new-promise-capability.js @@ -0,0 +1,18 @@ +'use strict'; +// 25.4.1.5 NewPromiseCapability(C) +var aFunction = require('./_a-function'); + +function PromiseCapability(C) { + var resolve, reject; + this.promise = new C(function ($$resolve, $$reject) { + if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); +} + +module.exports.f = function (C) { + return new PromiseCapability(C); +}; diff --git a/node_modules/core-js/modules/_object-assign.js b/node_modules/core-js/modules/_object-assign.js new file mode 100644 index 000000000..7d4943a2a --- /dev/null +++ b/node_modules/core-js/modules/_object-assign.js @@ -0,0 +1,34 @@ +'use strict'; +// 19.1.2.1 Object.assign(target, source, ...) +var getKeys = require('./_object-keys'); +var gOPS = require('./_object-gops'); +var pIE = require('./_object-pie'); +var toObject = require('./_to-object'); +var IObject = require('./_iobject'); +var $assign = Object.assign; + +// should work with symbols and should have deterministic property order (V8 bug) +module.exports = !$assign || require('./_fails')(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) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; + } return T; +} : $assign; diff --git a/node_modules/core-js/modules/_object-create.js b/node_modules/core-js/modules/_object-create.js new file mode 100644 index 000000000..a76808ea6 --- /dev/null +++ b/node_modules/core-js/modules/_object-create.js @@ -0,0 +1,41 @@ +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +var anObject = require('./_an-object'); +var dPs = require('./_object-dps'); +var enumBugKeys = require('./_enum-bug-keys'); +var IE_PROTO = require('./_shared-key')('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 = require('./_dom-create')('iframe'); + var i = enumBugKeys.length; + var lt = '<'; + var gt = '>'; + var iframeDocument; + iframe.style.display = 'none'; + require('./_html').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); +}; diff --git a/node_modules/core-js/modules/_object-define.js b/node_modules/core-js/modules/_object-define.js new file mode 100644 index 000000000..4d131f331 --- /dev/null +++ b/node_modules/core-js/modules/_object-define.js @@ -0,0 +1,13 @@ +var dP = require('./_object-dp'); +var gOPD = require('./_object-gopd'); +var ownKeys = require('./_own-keys'); +var toIObject = require('./_to-iobject'); + +module.exports = function define(target, mixin) { + var keys = ownKeys(toIObject(mixin)); + var length = keys.length; + var i = 0; + var key; + while (length > i) dP.f(target, key = keys[i++], gOPD.f(mixin, key)); + return target; +}; diff --git a/node_modules/core-js/modules/_object-dp.js b/node_modules/core-js/modules/_object-dp.js new file mode 100644 index 000000000..0340a8308 --- /dev/null +++ b/node_modules/core-js/modules/_object-dp.js @@ -0,0 +1,16 @@ +var anObject = require('./_an-object'); +var IE8_DOM_DEFINE = require('./_ie8-dom-define'); +var toPrimitive = require('./_to-primitive'); +var dP = Object.defineProperty; + +exports.f = require('./_descriptors') ? 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; +}; diff --git a/node_modules/core-js/modules/_object-dps.js b/node_modules/core-js/modules/_object-dps.js new file mode 100644 index 000000000..173c338ff --- /dev/null +++ b/node_modules/core-js/modules/_object-dps.js @@ -0,0 +1,13 @@ +var dP = require('./_object-dp'); +var anObject = require('./_an-object'); +var getKeys = require('./_object-keys'); + +module.exports = require('./_descriptors') ? 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; +}; diff --git a/node_modules/core-js/modules/_object-forced-pam.js b/node_modules/core-js/modules/_object-forced-pam.js new file mode 100644 index 000000000..71ede9225 --- /dev/null +++ b/node_modules/core-js/modules/_object-forced-pam.js @@ -0,0 +1,9 @@ +'use strict'; +// Forced replacement prototype accessors methods +module.exports = require('./_library') || !require('./_fails')(function () { + var K = Math.random(); + // In FF throws only define methods + // eslint-disable-next-line no-undef, no-useless-call + __defineSetter__.call(null, K, function () { /* empty */ }); + delete require('./_global')[K]; +}); diff --git a/node_modules/core-js/modules/_object-gopd.js b/node_modules/core-js/modules/_object-gopd.js new file mode 100644 index 000000000..555dd31a5 --- /dev/null +++ b/node_modules/core-js/modules/_object-gopd.js @@ -0,0 +1,16 @@ +var pIE = require('./_object-pie'); +var createDesc = require('./_property-desc'); +var toIObject = require('./_to-iobject'); +var toPrimitive = require('./_to-primitive'); +var has = require('./_has'); +var IE8_DOM_DEFINE = require('./_ie8-dom-define'); +var gOPD = Object.getOwnPropertyDescriptor; + +exports.f = require('./_descriptors') ? 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]); +}; diff --git a/node_modules/core-js/modules/_object-gopn-ext.js b/node_modules/core-js/modules/_object-gopn-ext.js new file mode 100644 index 000000000..4abb6ae83 --- /dev/null +++ b/node_modules/core-js/modules/_object-gopn-ext.js @@ -0,0 +1,19 @@ +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +var toIObject = require('./_to-iobject'); +var gOPN = require('./_object-gopn').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)); +}; diff --git a/node_modules/core-js/modules/_object-gopn.js b/node_modules/core-js/modules/_object-gopn.js new file mode 100644 index 000000000..da82333f6 --- /dev/null +++ b/node_modules/core-js/modules/_object-gopn.js @@ -0,0 +1,7 @@ +// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) +var $keys = require('./_object-keys-internal'); +var hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype'); + +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return $keys(O, hiddenKeys); +}; diff --git a/node_modules/core-js/modules/_object-gops.js b/node_modules/core-js/modules/_object-gops.js new file mode 100644 index 000000000..bc0672905 --- /dev/null +++ b/node_modules/core-js/modules/_object-gops.js @@ -0,0 +1 @@ +exports.f = Object.getOwnPropertySymbols; diff --git a/node_modules/core-js/modules/_object-gpo.js b/node_modules/core-js/modules/_object-gpo.js new file mode 100644 index 000000000..27f2a94e8 --- /dev/null +++ b/node_modules/core-js/modules/_object-gpo.js @@ -0,0 +1,13 @@ +// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) +var has = require('./_has'); +var toObject = require('./_to-object'); +var IE_PROTO = require('./_shared-key')('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; +}; diff --git a/node_modules/core-js/modules/_object-keys-internal.js b/node_modules/core-js/modules/_object-keys-internal.js new file mode 100644 index 000000000..71abdd1a5 --- /dev/null +++ b/node_modules/core-js/modules/_object-keys-internal.js @@ -0,0 +1,17 @@ +var has = require('./_has'); +var toIObject = require('./_to-iobject'); +var arrayIndexOf = require('./_array-includes')(false); +var IE_PROTO = require('./_shared-key')('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; +}; diff --git a/node_modules/core-js/modules/_object-keys.js b/node_modules/core-js/modules/_object-keys.js new file mode 100644 index 000000000..62f73f91e --- /dev/null +++ b/node_modules/core-js/modules/_object-keys.js @@ -0,0 +1,7 @@ +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = require('./_object-keys-internal'); +var enumBugKeys = require('./_enum-bug-keys'); + +module.exports = Object.keys || function keys(O) { + return $keys(O, enumBugKeys); +}; diff --git a/node_modules/core-js/modules/_object-pie.js b/node_modules/core-js/modules/_object-pie.js new file mode 100644 index 000000000..4cc71072d --- /dev/null +++ b/node_modules/core-js/modules/_object-pie.js @@ -0,0 +1 @@ +exports.f = {}.propertyIsEnumerable; diff --git a/node_modules/core-js/modules/_object-sap.js b/node_modules/core-js/modules/_object-sap.js new file mode 100644 index 000000000..643535e0a --- /dev/null +++ b/node_modules/core-js/modules/_object-sap.js @@ -0,0 +1,10 @@ +// most Object methods by ES6 should accept primitives +var $export = require('./_export'); +var core = require('./_core'); +var fails = require('./_fails'); +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); +}; diff --git a/node_modules/core-js/modules/_object-to-array.js b/node_modules/core-js/modules/_object-to-array.js new file mode 100644 index 000000000..120100d09 --- /dev/null +++ b/node_modules/core-js/modules/_object-to-array.js @@ -0,0 +1,16 @@ +var getKeys = require('./_object-keys'); +var toIObject = require('./_to-iobject'); +var isEnum = require('./_object-pie').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) if (isEnum.call(O, key = keys[i++])) { + result.push(isEntries ? [key, O[key]] : O[key]); + } return result; + }; +}; diff --git a/node_modules/core-js/modules/_own-keys.js b/node_modules/core-js/modules/_own-keys.js new file mode 100644 index 000000000..84faece8f --- /dev/null +++ b/node_modules/core-js/modules/_own-keys.js @@ -0,0 +1,10 @@ +// all object keys, includes non-enumerable and symbols +var gOPN = require('./_object-gopn'); +var gOPS = require('./_object-gops'); +var anObject = require('./_an-object'); +var Reflect = require('./_global').Reflect; +module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { + var keys = gOPN.f(anObject(it)); + var getSymbols = gOPS.f; + return getSymbols ? keys.concat(getSymbols(it)) : keys; +}; diff --git a/node_modules/core-js/modules/_parse-float.js b/node_modules/core-js/modules/_parse-float.js new file mode 100644 index 000000000..acfb350f9 --- /dev/null +++ b/node_modules/core-js/modules/_parse-float.js @@ -0,0 +1,8 @@ +var $parseFloat = require('./_global').parseFloat; +var $trim = require('./_string-trim').trim; + +module.exports = 1 / $parseFloat(require('./_string-ws') + '-0') !== -Infinity ? function parseFloat(str) { + var string = $trim(String(str), 3); + var result = $parseFloat(string); + return result === 0 && string.charAt(0) == '-' ? -0 : result; +} : $parseFloat; diff --git a/node_modules/core-js/modules/_parse-int.js b/node_modules/core-js/modules/_parse-int.js new file mode 100644 index 000000000..ddd7172a9 --- /dev/null +++ b/node_modules/core-js/modules/_parse-int.js @@ -0,0 +1,9 @@ +var $parseInt = require('./_global').parseInt; +var $trim = require('./_string-trim').trim; +var ws = require('./_string-ws'); +var hex = /^[-+]?0[xX]/; + +module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) { + var string = $trim(String(str), 3); + return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); +} : $parseInt; diff --git a/node_modules/core-js/modules/_partial.js b/node_modules/core-js/modules/_partial.js new file mode 100644 index 000000000..ca3f35bf8 --- /dev/null +++ b/node_modules/core-js/modules/_partial.js @@ -0,0 +1,25 @@ +'use strict'; +var path = require('./_path'); +var invoke = require('./_invoke'); +var aFunction = require('./_a-function'); +module.exports = function (/* ...pargs */) { + var fn = aFunction(this); + var length = arguments.length; + var pargs = new Array(length); + var i = 0; + var _ = path._; + var holder = false; + while (length > i) if ((pargs[i] = arguments[i++]) === _) holder = true; + return function (/* ...args */) { + var that = this; + var aLen = arguments.length; + var j = 0; + var k = 0; + var args; + if (!holder && !aLen) return invoke(fn, pargs, that); + args = pargs.slice(); + if (holder) for (;length > j; j++) if (args[j] === _) args[j] = arguments[k++]; + while (aLen > k) args.push(arguments[k++]); + return invoke(fn, args, that); + }; +}; diff --git a/node_modules/core-js/modules/_path.js b/node_modules/core-js/modules/_path.js new file mode 100644 index 000000000..754592ada --- /dev/null +++ b/node_modules/core-js/modules/_path.js @@ -0,0 +1 @@ +module.exports = require('./_global'); diff --git a/node_modules/core-js/modules/_perform.js b/node_modules/core-js/modules/_perform.js new file mode 100644 index 000000000..bfc7b296d --- /dev/null +++ b/node_modules/core-js/modules/_perform.js @@ -0,0 +1,7 @@ +module.exports = function (exec) { + try { + return { e: false, v: exec() }; + } catch (e) { + return { e: true, v: e }; + } +}; diff --git a/node_modules/core-js/modules/_promise-resolve.js b/node_modules/core-js/modules/_promise-resolve.js new file mode 100644 index 000000000..c3cac7646 --- /dev/null +++ b/node_modules/core-js/modules/_promise-resolve.js @@ -0,0 +1,12 @@ +var anObject = require('./_an-object'); +var isObject = require('./_is-object'); +var newPromiseCapability = require('./_new-promise-capability'); + +module.exports = function (C, x) { + anObject(C); + if (isObject(x) && x.constructor === C) return x; + var promiseCapability = newPromiseCapability.f(C); + var resolve = promiseCapability.resolve; + resolve(x); + return promiseCapability.promise; +}; diff --git a/node_modules/core-js/modules/_property-desc.js b/node_modules/core-js/modules/_property-desc.js new file mode 100644 index 000000000..090593405 --- /dev/null +++ b/node_modules/core-js/modules/_property-desc.js @@ -0,0 +1,8 @@ +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; diff --git a/node_modules/core-js/modules/_redefine-all.js b/node_modules/core-js/modules/_redefine-all.js new file mode 100644 index 000000000..dcf7944f5 --- /dev/null +++ b/node_modules/core-js/modules/_redefine-all.js @@ -0,0 +1,5 @@ +var redefine = require('./_redefine'); +module.exports = function (target, src, safe) { + for (var key in src) redefine(target, key, src[key], safe); + return target; +}; diff --git a/node_modules/core-js/modules/_redefine.js b/node_modules/core-js/modules/_redefine.js new file mode 100644 index 000000000..b7ba9f30e --- /dev/null +++ b/node_modules/core-js/modules/_redefine.js @@ -0,0 +1,31 @@ +var global = require('./_global'); +var hide = require('./_hide'); +var has = require('./_has'); +var SRC = require('./_uid')('src'); +var TO_STRING = 'toString'; +var $toString = Function[TO_STRING]; +var TPL = ('' + $toString).split(TO_STRING); + +require('./_core').inspectSource = function (it) { + return $toString.call(it); +}; + +(module.exports = function (O, key, val, safe) { + var isFunction = typeof val == 'function'; + if (isFunction) has(val, 'name') || hide(val, 'name', key); + if (O[key] === val) return; + if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); + if (O === global) { + O[key] = val; + } else if (!safe) { + delete O[key]; + hide(O, key, val); + } else if (O[key]) { + O[key] = val; + } else { + hide(O, key, val); + } +// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative +})(Function.prototype, TO_STRING, function toString() { + return typeof this == 'function' && this[SRC] || $toString.call(this); +}); diff --git a/node_modules/core-js/modules/_replacer.js b/node_modules/core-js/modules/_replacer.js new file mode 100644 index 000000000..c37703dd2 --- /dev/null +++ b/node_modules/core-js/modules/_replacer.js @@ -0,0 +1,8 @@ +module.exports = function (regExp, replace) { + var replacer = replace === Object(replace) ? function (part) { + return replace[part]; + } : replace; + return function (it) { + return String(it).replace(regExp, replacer); + }; +}; diff --git a/node_modules/core-js/modules/_same-value.js b/node_modules/core-js/modules/_same-value.js new file mode 100644 index 000000000..c6d045e83 --- /dev/null +++ b/node_modules/core-js/modules/_same-value.js @@ -0,0 +1,5 @@ +// 7.2.9 SameValue(x, y) +module.exports = Object.is || function is(x, y) { + // eslint-disable-next-line no-self-compare + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; +}; diff --git a/node_modules/core-js/modules/_set-collection-from.js b/node_modules/core-js/modules/_set-collection-from.js new file mode 100644 index 000000000..d5001f93e --- /dev/null +++ b/node_modules/core-js/modules/_set-collection-from.js @@ -0,0 +1,28 @@ +'use strict'; +// https://tc39.github.io/proposal-setmap-offrom/ +var $export = require('./_export'); +var aFunction = require('./_a-function'); +var ctx = require('./_ctx'); +var forOf = require('./_for-of'); + +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); + } }); +}; diff --git a/node_modules/core-js/modules/_set-collection-of.js b/node_modules/core-js/modules/_set-collection-of.js new file mode 100644 index 000000000..f559af3fc --- /dev/null +++ b/node_modules/core-js/modules/_set-collection-of.js @@ -0,0 +1,12 @@ +'use strict'; +// https://tc39.github.io/proposal-setmap-offrom/ +var $export = require('./_export'); + +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); + } }); +}; diff --git a/node_modules/core-js/modules/_set-proto.js b/node_modules/core-js/modules/_set-proto.js new file mode 100644 index 000000000..c1990622e --- /dev/null +++ b/node_modules/core-js/modules/_set-proto.js @@ -0,0 +1,25 @@ +// Works with __proto__ only. Old v8 can't work with null proto objects. +/* eslint-disable no-proto */ +var isObject = require('./_is-object'); +var anObject = require('./_an-object'); +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 = require('./_ctx')(Function.call, require('./_object-gopd').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 +}; diff --git a/node_modules/core-js/modules/_set-species.js b/node_modules/core-js/modules/_set-species.js new file mode 100644 index 000000000..2d505d2aa --- /dev/null +++ b/node_modules/core-js/modules/_set-species.js @@ -0,0 +1,13 @@ +'use strict'; +var global = require('./_global'); +var dP = require('./_object-dp'); +var DESCRIPTORS = require('./_descriptors'); +var SPECIES = require('./_wks')('species'); + +module.exports = function (KEY) { + var C = global[KEY]; + if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { + configurable: true, + get: function () { return this; } + }); +}; diff --git a/node_modules/core-js/modules/_set-to-string-tag.js b/node_modules/core-js/modules/_set-to-string-tag.js new file mode 100644 index 000000000..5bd64144f --- /dev/null +++ b/node_modules/core-js/modules/_set-to-string-tag.js @@ -0,0 +1,7 @@ +var def = require('./_object-dp').f; +var has = require('./_has'); +var TAG = require('./_wks')('toStringTag'); + +module.exports = function (it, tag, stat) { + if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); +}; diff --git a/node_modules/core-js/modules/_shared-key.js b/node_modules/core-js/modules/_shared-key.js new file mode 100644 index 000000000..d47fe7a28 --- /dev/null +++ b/node_modules/core-js/modules/_shared-key.js @@ -0,0 +1,5 @@ +var shared = require('./_shared')('keys'); +var uid = require('./_uid'); +module.exports = function (key) { + return shared[key] || (shared[key] = uid(key)); +}; diff --git a/node_modules/core-js/modules/_shared.js b/node_modules/core-js/modules/_shared.js new file mode 100644 index 000000000..2c6abc22e --- /dev/null +++ b/node_modules/core-js/modules/_shared.js @@ -0,0 +1,12 @@ +var core = require('./_core'); +var global = require('./_global'); +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: require('./_library') ? 'pure' : 'global', + copyright: '© 2018 Denis Pushkarev (zloirock.ru)' +}); diff --git a/node_modules/core-js/modules/_species-constructor.js b/node_modules/core-js/modules/_species-constructor.js new file mode 100644 index 000000000..0cb4ffb8f --- /dev/null +++ b/node_modules/core-js/modules/_species-constructor.js @@ -0,0 +1,9 @@ +// 7.3.20 SpeciesConstructor(O, defaultConstructor) +var anObject = require('./_an-object'); +var aFunction = require('./_a-function'); +var SPECIES = require('./_wks')('species'); +module.exports = function (O, D) { + var C = anObject(O).constructor; + var S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); +}; diff --git a/node_modules/core-js/modules/_strict-method.js b/node_modules/core-js/modules/_strict-method.js new file mode 100644 index 000000000..e68f41bb6 --- /dev/null +++ b/node_modules/core-js/modules/_strict-method.js @@ -0,0 +1,9 @@ +'use strict'; +var fails = require('./_fails'); + +module.exports = function (method, arg) { + return !!method && fails(function () { + // eslint-disable-next-line no-useless-call + arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null); + }); +}; diff --git a/node_modules/core-js/modules/_string-at.js b/node_modules/core-js/modules/_string-at.js new file mode 100644 index 000000000..88d66bd18 --- /dev/null +++ b/node_modules/core-js/modules/_string-at.js @@ -0,0 +1,17 @@ +var toInteger = require('./_to-integer'); +var defined = require('./_defined'); +// 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; + }; +}; diff --git a/node_modules/core-js/modules/_string-context.js b/node_modules/core-js/modules/_string-context.js new file mode 100644 index 000000000..becf3fbeb --- /dev/null +++ b/node_modules/core-js/modules/_string-context.js @@ -0,0 +1,8 @@ +// helper for String#{startsWith, endsWith, includes} +var isRegExp = require('./_is-regexp'); +var defined = require('./_defined'); + +module.exports = function (that, searchString, NAME) { + if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); + return String(defined(that)); +}; diff --git a/node_modules/core-js/modules/_string-html.js b/node_modules/core-js/modules/_string-html.js new file mode 100644 index 000000000..1dcc95bcd --- /dev/null +++ b/node_modules/core-js/modules/_string-html.js @@ -0,0 +1,19 @@ +var $export = require('./_export'); +var fails = require('./_fails'); +var defined = require('./_defined'); +var quot = /"/g; +// B.2.3.2.1 CreateHTML(string, tag, attribute, value) +var createHTML = function (string, tag, attribute, value) { + var S = String(defined(string)); + var p1 = '<' + tag; + if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; + return p1 + '>' + S + ''; +}; +module.exports = function (NAME, exec) { + var O = {}; + O[NAME] = exec(createHTML); + $export($export.P + $export.F * fails(function () { + var test = ''[NAME]('"'); + return test !== test.toLowerCase() || test.split('"').length > 3; + }), 'String', O); +}; diff --git a/node_modules/core-js/modules/_string-pad.js b/node_modules/core-js/modules/_string-pad.js new file mode 100644 index 000000000..ceb6077f0 --- /dev/null +++ b/node_modules/core-js/modules/_string-pad.js @@ -0,0 +1,16 @@ +// https://github.com/tc39/proposal-string-pad-start-end +var toLength = require('./_to-length'); +var repeat = require('./_string-repeat'); +var defined = require('./_defined'); + +module.exports = function (that, maxLength, fillString, left) { + var S = String(defined(that)); + var stringLength = S.length; + var fillStr = fillString === undefined ? ' ' : String(fillString); + var intMaxLength = toLength(maxLength); + if (intMaxLength <= stringLength || fillStr == '') return S; + var fillLen = intMaxLength - stringLength; + var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); + if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); + return left ? stringFiller + S : S + stringFiller; +}; diff --git a/node_modules/core-js/modules/_string-repeat.js b/node_modules/core-js/modules/_string-repeat.js new file mode 100644 index 000000000..a69b9626b --- /dev/null +++ b/node_modules/core-js/modules/_string-repeat.js @@ -0,0 +1,12 @@ +'use strict'; +var toInteger = require('./_to-integer'); +var defined = require('./_defined'); + +module.exports = function repeat(count) { + var str = String(defined(this)); + var res = ''; + var n = toInteger(count); + if (n < 0 || n == Infinity) throw RangeError("Count can't be negative"); + for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str; + return res; +}; diff --git a/node_modules/core-js/modules/_string-trim.js b/node_modules/core-js/modules/_string-trim.js new file mode 100644 index 000000000..6b54a81a8 --- /dev/null +++ b/node_modules/core-js/modules/_string-trim.js @@ -0,0 +1,30 @@ +var $export = require('./_export'); +var defined = require('./_defined'); +var fails = require('./_fails'); +var spaces = require('./_string-ws'); +var space = '[' + spaces + ']'; +var non = '\u200b\u0085'; +var ltrim = RegExp('^' + space + space + '*'); +var rtrim = RegExp(space + space + '*$'); + +var exporter = function (KEY, exec, ALIAS) { + var exp = {}; + var FORCE = fails(function () { + return !!spaces[KEY]() || non[KEY]() != non; + }); + var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; + if (ALIAS) exp[ALIAS] = fn; + $export($export.P + $export.F * FORCE, 'String', exp); +}; + +// 1 -> String#trimLeft +// 2 -> String#trimRight +// 3 -> String#trim +var trim = exporter.trim = function (string, TYPE) { + string = String(defined(string)); + if (TYPE & 1) string = string.replace(ltrim, ''); + if (TYPE & 2) string = string.replace(rtrim, ''); + return string; +}; + +module.exports = exporter; diff --git a/node_modules/core-js/modules/_string-ws.js b/node_modules/core-js/modules/_string-ws.js new file mode 100644 index 000000000..2c68cf9f4 --- /dev/null +++ b/node_modules/core-js/modules/_string-ws.js @@ -0,0 +1,2 @@ +module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; diff --git a/node_modules/core-js/modules/_task.js b/node_modules/core-js/modules/_task.js new file mode 100644 index 000000000..8777a6e28 --- /dev/null +++ b/node_modules/core-js/modules/_task.js @@ -0,0 +1,84 @@ +var ctx = require('./_ctx'); +var invoke = require('./_invoke'); +var html = require('./_html'); +var cel = require('./_dom-create'); +var global = require('./_global'); +var process = global.process; +var setTask = global.setImmediate; +var clearTask = global.clearImmediate; +var MessageChannel = global.MessageChannel; +var Dispatch = global.Dispatch; +var counter = 0; +var queue = {}; +var ONREADYSTATECHANGE = 'onreadystatechange'; +var defer, channel, port; +var run = function () { + var id = +this; + // eslint-disable-next-line no-prototype-builtins + if (queue.hasOwnProperty(id)) { + var fn = queue[id]; + delete queue[id]; + fn(); + } +}; +var listener = function (event) { + run.call(event.data); +}; +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: +if (!setTask || !clearTask) { + setTask = function setImmediate(fn) { + var args = []; + var i = 1; + while (arguments.length > i) args.push(arguments[i++]); + queue[++counter] = function () { + // eslint-disable-next-line no-new-func + invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id) { + delete queue[id]; + }; + // Node.js 0.8- + if (require('./_cof')(process) == 'process') { + defer = function (id) { + process.nextTick(ctx(run, id, 1)); + }; + // Sphere (JS game engine) Dispatch API + } else if (Dispatch && Dispatch.now) { + defer = function (id) { + Dispatch.now(ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if (MessageChannel) { + channel = new MessageChannel(); + port = channel.port2; + channel.port1.onmessage = listener; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { + defer = function (id) { + global.postMessage(id + '', '*'); + }; + global.addEventListener('message', listener, false); + // IE8- + } else if (ONREADYSTATECHANGE in cel('script')) { + defer = function (id) { + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { + html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function (id) { + setTimeout(ctx(run, id, 1), 0); + }; + } +} +module.exports = { + set: setTask, + clear: clearTask +}; diff --git a/node_modules/core-js/modules/_to-absolute-index.js b/node_modules/core-js/modules/_to-absolute-index.js new file mode 100644 index 000000000..dfee02e8e --- /dev/null +++ b/node_modules/core-js/modules/_to-absolute-index.js @@ -0,0 +1,7 @@ +var toInteger = require('./_to-integer'); +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); +}; diff --git a/node_modules/core-js/modules/_to-index.js b/node_modules/core-js/modules/_to-index.js new file mode 100644 index 000000000..8f51c32d2 --- /dev/null +++ b/node_modules/core-js/modules/_to-index.js @@ -0,0 +1,10 @@ +// https://tc39.github.io/ecma262/#sec-toindex +var toInteger = require('./_to-integer'); +var toLength = require('./_to-length'); +module.exports = function (it) { + if (it === undefined) return 0; + var number = toInteger(it); + var length = toLength(number); + if (number !== length) throw RangeError('Wrong length!'); + return length; +}; diff --git a/node_modules/core-js/modules/_to-integer.js b/node_modules/core-js/modules/_to-integer.js new file mode 100644 index 000000000..3d50f97dd --- /dev/null +++ b/node_modules/core-js/modules/_to-integer.js @@ -0,0 +1,6 @@ +// 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); +}; diff --git a/node_modules/core-js/modules/_to-iobject.js b/node_modules/core-js/modules/_to-iobject.js new file mode 100644 index 000000000..7614503a2 --- /dev/null +++ b/node_modules/core-js/modules/_to-iobject.js @@ -0,0 +1,6 @@ +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = require('./_iobject'); +var defined = require('./_defined'); +module.exports = function (it) { + return IObject(defined(it)); +}; diff --git a/node_modules/core-js/modules/_to-length.js b/node_modules/core-js/modules/_to-length.js new file mode 100644 index 000000000..a9db50173 --- /dev/null +++ b/node_modules/core-js/modules/_to-length.js @@ -0,0 +1,6 @@ +// 7.1.15 ToLength +var toInteger = require('./_to-integer'); +var min = Math.min; +module.exports = function (it) { + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; diff --git a/node_modules/core-js/modules/_to-object.js b/node_modules/core-js/modules/_to-object.js new file mode 100644 index 000000000..0efea4c69 --- /dev/null +++ b/node_modules/core-js/modules/_to-object.js @@ -0,0 +1,5 @@ +// 7.1.13 ToObject(argument) +var defined = require('./_defined'); +module.exports = function (it) { + return Object(defined(it)); +}; diff --git a/node_modules/core-js/modules/_to-primitive.js b/node_modules/core-js/modules/_to-primitive.js new file mode 100644 index 000000000..de3dd6b19 --- /dev/null +++ b/node_modules/core-js/modules/_to-primitive.js @@ -0,0 +1,12 @@ +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = require('./_is-object'); +// 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"); +}; diff --git a/node_modules/core-js/modules/_typed-array.js b/node_modules/core-js/modules/_typed-array.js new file mode 100644 index 000000000..30d9c0ba5 --- /dev/null +++ b/node_modules/core-js/modules/_typed-array.js @@ -0,0 +1,480 @@ +'use strict'; +if (require('./_descriptors')) { + var LIBRARY = require('./_library'); + var global = require('./_global'); + var fails = require('./_fails'); + var $export = require('./_export'); + var $typed = require('./_typed'); + var $buffer = require('./_typed-buffer'); + var ctx = require('./_ctx'); + var anInstance = require('./_an-instance'); + var propertyDesc = require('./_property-desc'); + var hide = require('./_hide'); + var redefineAll = require('./_redefine-all'); + var toInteger = require('./_to-integer'); + var toLength = require('./_to-length'); + var toIndex = require('./_to-index'); + var toAbsoluteIndex = require('./_to-absolute-index'); + var toPrimitive = require('./_to-primitive'); + var has = require('./_has'); + var classof = require('./_classof'); + var isObject = require('./_is-object'); + var toObject = require('./_to-object'); + var isArrayIter = require('./_is-array-iter'); + var create = require('./_object-create'); + var getPrototypeOf = require('./_object-gpo'); + var gOPN = require('./_object-gopn').f; + var getIterFn = require('./core.get-iterator-method'); + var uid = require('./_uid'); + var wks = require('./_wks'); + var createArrayMethod = require('./_array-methods'); + var createArrayIncludes = require('./_array-includes'); + var speciesConstructor = require('./_species-constructor'); + var ArrayIterators = require('./es6.array.iterator'); + var Iterators = require('./_iterators'); + var $iterDetect = require('./_iter-detect'); + var setSpecies = require('./_set-species'); + var arrayFill = require('./_array-fill'); + var arrayCopyWithin = require('./_array-copy-within'); + var $DP = require('./_object-dp'); + var $GOPD = require('./_object-gopd'); + var dP = $DP.f; + var gOPD = $GOPD.f; + var RangeError = global.RangeError; + var TypeError = global.TypeError; + var Uint8Array = global.Uint8Array; + var ARRAY_BUFFER = 'ArrayBuffer'; + var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER; + var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; + var PROTOTYPE = 'prototype'; + var ArrayProto = Array[PROTOTYPE]; + var $ArrayBuffer = $buffer.ArrayBuffer; + var $DataView = $buffer.DataView; + var arrayForEach = createArrayMethod(0); + var arrayFilter = createArrayMethod(2); + var arraySome = createArrayMethod(3); + var arrayEvery = createArrayMethod(4); + var arrayFind = createArrayMethod(5); + var arrayFindIndex = createArrayMethod(6); + var arrayIncludes = createArrayIncludes(true); + var arrayIndexOf = createArrayIncludes(false); + var arrayValues = ArrayIterators.values; + var arrayKeys = ArrayIterators.keys; + var arrayEntries = ArrayIterators.entries; + var arrayLastIndexOf = ArrayProto.lastIndexOf; + var arrayReduce = ArrayProto.reduce; + var arrayReduceRight = ArrayProto.reduceRight; + var arrayJoin = ArrayProto.join; + var arraySort = ArrayProto.sort; + var arraySlice = ArrayProto.slice; + var arrayToString = ArrayProto.toString; + var arrayToLocaleString = ArrayProto.toLocaleString; + var ITERATOR = wks('iterator'); + var TAG = wks('toStringTag'); + var TYPED_CONSTRUCTOR = uid('typed_constructor'); + var DEF_CONSTRUCTOR = uid('def_constructor'); + var ALL_CONSTRUCTORS = $typed.CONSTR; + var TYPED_ARRAY = $typed.TYPED; + var VIEW = $typed.VIEW; + var WRONG_LENGTH = 'Wrong length!'; + + var $map = createArrayMethod(1, function (O, length) { + return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); + }); + + var LITTLE_ENDIAN = fails(function () { + // eslint-disable-next-line no-undef + return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; + }); + + var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () { + new Uint8Array(1).set({}); + }); + + var toOffset = function (it, BYTES) { + var offset = toInteger(it); + if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!'); + return offset; + }; + + var validate = function (it) { + if (isObject(it) && TYPED_ARRAY in it) return it; + throw TypeError(it + ' is not a typed array!'); + }; + + var allocate = function (C, length) { + if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) { + throw TypeError('It is not a typed array constructor!'); + } return new C(length); + }; + + var speciesFromList = function (O, list) { + return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); + }; + + var fromList = function (C, list) { + var index = 0; + var length = list.length; + var result = allocate(C, length); + while (length > index) result[index] = list[index++]; + return result; + }; + + var addGetter = function (it, key, internal) { + dP(it, key, { get: function () { return this._d[internal]; } }); + }; + + var $from = function from(source /* , mapfn, thisArg */) { + var O = toObject(source); + var aLen = arguments.length; + var mapfn = aLen > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var iterFn = getIterFn(O); + var i, length, values, result, step, iterator; + if (iterFn != undefined && !isArrayIter(iterFn)) { + for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) { + values.push(step.value); + } O = values; + } + if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2); + for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) { + result[i] = mapping ? mapfn(O[i], i) : O[i]; + } + return result; + }; + + var $of = function of(/* ...items */) { + var index = 0; + var length = arguments.length; + var result = allocate(this, length); + while (length > index) result[index] = arguments[index++]; + return result; + }; + + // iOS Safari 6.x fails here + var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); }); + + var $toLocaleString = function toLocaleString() { + return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); + }; + + var proto = { + copyWithin: function copyWithin(target, start /* , end */) { + return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); + }, + every: function every(callbackfn /* , thisArg */) { + return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars + return arrayFill.apply(validate(this), arguments); + }, + filter: function filter(callbackfn /* , thisArg */) { + return speciesFromList(this, arrayFilter(validate(this), callbackfn, + arguments.length > 1 ? arguments[1] : undefined)); + }, + find: function find(predicate /* , thisArg */) { + return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + findIndex: function findIndex(predicate /* , thisArg */) { + return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + forEach: function forEach(callbackfn /* , thisArg */) { + arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + indexOf: function indexOf(searchElement /* , fromIndex */) { + return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + includes: function includes(searchElement /* , fromIndex */) { + return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + join: function join(separator) { // eslint-disable-line no-unused-vars + return arrayJoin.apply(validate(this), arguments); + }, + lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars + return arrayLastIndexOf.apply(validate(this), arguments); + }, + map: function map(mapfn /* , thisArg */) { + return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); + }, + reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars + return arrayReduce.apply(validate(this), arguments); + }, + reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars + return arrayReduceRight.apply(validate(this), arguments); + }, + reverse: function reverse() { + var that = this; + var length = validate(that).length; + var middle = Math.floor(length / 2); + var index = 0; + var value; + while (index < middle) { + value = that[index]; + that[index++] = that[--length]; + that[length] = value; + } return that; + }, + some: function some(callbackfn /* , thisArg */) { + return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + sort: function sort(comparefn) { + return arraySort.call(validate(this), comparefn); + }, + subarray: function subarray(begin, end) { + var O = validate(this); + var length = O.length; + var $begin = toAbsoluteIndex(begin, length); + return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( + O.buffer, + O.byteOffset + $begin * O.BYTES_PER_ELEMENT, + toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin) + ); + } + }; + + var $slice = function slice(start, end) { + return speciesFromList(this, arraySlice.call(validate(this), start, end)); + }; + + var $set = function set(arrayLike /* , offset */) { + validate(this); + var offset = toOffset(arguments[1], 1); + var length = this.length; + var src = toObject(arrayLike); + var len = toLength(src.length); + var index = 0; + if (len + offset > length) throw RangeError(WRONG_LENGTH); + while (index < len) this[offset + index] = src[index++]; + }; + + var $iterators = { + entries: function entries() { + return arrayEntries.call(validate(this)); + }, + keys: function keys() { + return arrayKeys.call(validate(this)); + }, + values: function values() { + return arrayValues.call(validate(this)); + } + }; + + var isTAIndex = function (target, key) { + return isObject(target) + && target[TYPED_ARRAY] + && typeof key != 'symbol' + && key in target + && String(+key) == String(key); + }; + var $getDesc = function getOwnPropertyDescriptor(target, key) { + return isTAIndex(target, key = toPrimitive(key, true)) + ? propertyDesc(2, target[key]) + : gOPD(target, key); + }; + var $setDesc = function defineProperty(target, key, desc) { + if (isTAIndex(target, key = toPrimitive(key, true)) + && isObject(desc) + && has(desc, 'value') + && !has(desc, 'get') + && !has(desc, 'set') + // TODO: add validation descriptor w/o calling accessors + && !desc.configurable + && (!has(desc, 'writable') || desc.writable) + && (!has(desc, 'enumerable') || desc.enumerable) + ) { + target[key] = desc.value; + return target; + } return dP(target, key, desc); + }; + + if (!ALL_CONSTRUCTORS) { + $GOPD.f = $getDesc; + $DP.f = $setDesc; + } + + $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { + getOwnPropertyDescriptor: $getDesc, + defineProperty: $setDesc + }); + + if (fails(function () { arrayToString.call({}); })) { + arrayToString = arrayToLocaleString = function toString() { + return arrayJoin.call(this); + }; + } + + var $TypedArrayPrototype$ = redefineAll({}, proto); + redefineAll($TypedArrayPrototype$, $iterators); + hide($TypedArrayPrototype$, ITERATOR, $iterators.values); + redefineAll($TypedArrayPrototype$, { + slice: $slice, + set: $set, + constructor: function () { /* noop */ }, + toString: arrayToString, + toLocaleString: $toLocaleString + }); + addGetter($TypedArrayPrototype$, 'buffer', 'b'); + addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); + addGetter($TypedArrayPrototype$, 'byteLength', 'l'); + addGetter($TypedArrayPrototype$, 'length', 'e'); + dP($TypedArrayPrototype$, TAG, { + get: function () { return this[TYPED_ARRAY]; } + }); + + // eslint-disable-next-line max-statements + module.exports = function (KEY, BYTES, wrapper, CLAMPED) { + CLAMPED = !!CLAMPED; + var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'; + var GETTER = 'get' + KEY; + var SETTER = 'set' + KEY; + var TypedArray = global[NAME]; + var Base = TypedArray || {}; + var TAC = TypedArray && getPrototypeOf(TypedArray); + var FORCED = !TypedArray || !$typed.ABV; + var O = {}; + var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; + var getter = function (that, index) { + var data = that._d; + return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); + }; + var setter = function (that, index, value) { + var data = that._d; + if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; + data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); + }; + var addElement = function (that, index) { + dP(that, index, { + get: function () { + return getter(this, index); + }, + set: function (value) { + return setter(this, index, value); + }, + enumerable: true + }); + }; + if (FORCED) { + TypedArray = wrapper(function (that, data, $offset, $length) { + anInstance(that, TypedArray, NAME, '_d'); + var index = 0; + var offset = 0; + var buffer, byteLength, length, klass; + if (!isObject(data)) { + length = toIndex(data); + byteLength = length * BYTES; + buffer = new $ArrayBuffer(byteLength); + } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { + buffer = data; + offset = toOffset($offset, BYTES); + var $len = data.byteLength; + if ($length === undefined) { + if ($len % BYTES) throw RangeError(WRONG_LENGTH); + byteLength = $len - offset; + if (byteLength < 0) throw RangeError(WRONG_LENGTH); + } else { + byteLength = toLength($length) * BYTES; + if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH); + } + length = byteLength / BYTES; + } else if (TYPED_ARRAY in data) { + return fromList(TypedArray, data); + } else { + return $from.call(TypedArray, data); + } + hide(that, '_d', { + b: buffer, + o: offset, + l: byteLength, + e: length, + v: new $DataView(buffer) + }); + while (index < length) addElement(that, index++); + }); + TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); + hide(TypedArrayPrototype, 'constructor', TypedArray); + } else if (!fails(function () { + TypedArray(1); + }) || !fails(function () { + new TypedArray(-1); // eslint-disable-line no-new + }) || !$iterDetect(function (iter) { + new TypedArray(); // eslint-disable-line no-new + new TypedArray(null); // eslint-disable-line no-new + new TypedArray(1.5); // eslint-disable-line no-new + new TypedArray(iter); // eslint-disable-line no-new + }, true)) { + TypedArray = wrapper(function (that, data, $offset, $length) { + anInstance(that, TypedArray, NAME); + var klass; + // `ws` module bug, temporarily remove validation length for Uint8Array + // https://github.com/websockets/ws/pull/645 + if (!isObject(data)) return new Base(toIndex(data)); + if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { + return $length !== undefined + ? new Base(data, toOffset($offset, BYTES), $length) + : $offset !== undefined + ? new Base(data, toOffset($offset, BYTES)) + : new Base(data); + } + if (TYPED_ARRAY in data) return fromList(TypedArray, data); + return $from.call(TypedArray, data); + }); + arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) { + if (!(key in TypedArray)) hide(TypedArray, key, Base[key]); + }); + TypedArray[PROTOTYPE] = TypedArrayPrototype; + if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray; + } + var $nativeIterator = TypedArrayPrototype[ITERATOR]; + var CORRECT_ITER_NAME = !!$nativeIterator + && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined); + var $iterator = $iterators.values; + hide(TypedArray, TYPED_CONSTRUCTOR, true); + hide(TypedArrayPrototype, TYPED_ARRAY, NAME); + hide(TypedArrayPrototype, VIEW, true); + hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); + + if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) { + dP(TypedArrayPrototype, TAG, { + get: function () { return NAME; } + }); + } + + O[NAME] = TypedArray; + + $export($export.G + $export.W + $export.F * (TypedArray != Base), O); + + $export($export.S, NAME, { + BYTES_PER_ELEMENT: BYTES + }); + + $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, { + from: $from, + of: $of + }); + + if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); + + $export($export.P, NAME, proto); + + setSpecies(NAME); + + $export($export.P + $export.F * FORCED_SET, NAME, { set: $set }); + + $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); + + if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString; + + $export($export.P + $export.F * fails(function () { + new TypedArray(1).slice(); + }), NAME, { slice: $slice }); + + $export($export.P + $export.F * (fails(function () { + return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString(); + }) || !fails(function () { + TypedArrayPrototype.toLocaleString.call([1, 2]); + })), NAME, { toLocaleString: $toLocaleString }); + + Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; + if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator); + }; +} else module.exports = function () { /* empty */ }; diff --git a/node_modules/core-js/modules/_typed-buffer.js b/node_modules/core-js/modules/_typed-buffer.js new file mode 100644 index 000000000..c24cef38c --- /dev/null +++ b/node_modules/core-js/modules/_typed-buffer.js @@ -0,0 +1,276 @@ +'use strict'; +var global = require('./_global'); +var DESCRIPTORS = require('./_descriptors'); +var LIBRARY = require('./_library'); +var $typed = require('./_typed'); +var hide = require('./_hide'); +var redefineAll = require('./_redefine-all'); +var fails = require('./_fails'); +var anInstance = require('./_an-instance'); +var toInteger = require('./_to-integer'); +var toLength = require('./_to-length'); +var toIndex = require('./_to-index'); +var gOPN = require('./_object-gopn').f; +var dP = require('./_object-dp').f; +var arrayFill = require('./_array-fill'); +var setToStringTag = require('./_set-to-string-tag'); +var ARRAY_BUFFER = 'ArrayBuffer'; +var DATA_VIEW = 'DataView'; +var PROTOTYPE = 'prototype'; +var WRONG_LENGTH = 'Wrong length!'; +var WRONG_INDEX = 'Wrong index!'; +var $ArrayBuffer = global[ARRAY_BUFFER]; +var $DataView = global[DATA_VIEW]; +var Math = global.Math; +var RangeError = global.RangeError; +// eslint-disable-next-line no-shadow-restricted-names +var Infinity = global.Infinity; +var BaseBuffer = $ArrayBuffer; +var abs = Math.abs; +var pow = Math.pow; +var floor = Math.floor; +var log = Math.log; +var LN2 = Math.LN2; +var BUFFER = 'buffer'; +var BYTE_LENGTH = 'byteLength'; +var BYTE_OFFSET = 'byteOffset'; +var $BUFFER = DESCRIPTORS ? '_b' : BUFFER; +var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH; +var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; + +// IEEE754 conversions based on https://github.com/feross/ieee754 +function packIEEE754(value, mLen, nBytes) { + var buffer = new Array(nBytes); + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0; + var i = 0; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + var e, m, c; + value = abs(value); + // eslint-disable-next-line no-self-compare + if (value != value || value === Infinity) { + // eslint-disable-next-line no-self-compare + m = value != value ? 1 : 0; + e = eMax; + } else { + e = floor(log(value) / LN2); + if (value * (c = pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * pow(2, mLen); + e = e + eBias; + } else { + m = value * pow(2, eBias - 1) * pow(2, mLen); + e = 0; + } + } + for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); + e = e << mLen | m; + eLen += mLen; + for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); + buffer[--i] |= s * 128; + return buffer; +} +function unpackIEEE754(buffer, mLen, nBytes) { + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = eLen - 7; + var i = nBytes - 1; + var s = buffer[i--]; + var e = s & 127; + var m; + s >>= 7; + for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : s ? -Infinity : Infinity; + } else { + m = m + pow(2, mLen); + e = e - eBias; + } return (s ? -1 : 1) * m * pow(2, e - mLen); +} + +function unpackI32(bytes) { + return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; +} +function packI8(it) { + return [it & 0xff]; +} +function packI16(it) { + return [it & 0xff, it >> 8 & 0xff]; +} +function packI32(it) { + return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; +} +function packF64(it) { + return packIEEE754(it, 52, 8); +} +function packF32(it) { + return packIEEE754(it, 23, 4); +} + +function addGetter(C, key, internal) { + dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } }); +} + +function get(view, bytes, index, isLittleEndian) { + var numIndex = +index; + var intIndex = toIndex(numIndex); + if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b; + var start = intIndex + view[$OFFSET]; + var pack = store.slice(start, start + bytes); + return isLittleEndian ? pack : pack.reverse(); +} +function set(view, bytes, index, conversion, value, isLittleEndian) { + var numIndex = +index; + var intIndex = toIndex(numIndex); + if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b; + var start = intIndex + view[$OFFSET]; + var pack = conversion(+value); + for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; +} + +if (!$typed.ABV) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer, ARRAY_BUFFER); + var byteLength = toIndex(length); + this._b = arrayFill.call(new Array(byteLength), 0); + this[$LENGTH] = byteLength; + }; + + $DataView = function DataView(buffer, byteOffset, byteLength) { + anInstance(this, $DataView, DATA_VIEW); + anInstance(buffer, $ArrayBuffer, DATA_VIEW); + var bufferLength = buffer[$LENGTH]; + var offset = toInteger(byteOffset); + if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!'); + byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); + if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); + this[$BUFFER] = buffer; + this[$OFFSET] = offset; + this[$LENGTH] = byteLength; + }; + + if (DESCRIPTORS) { + addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); + addGetter($DataView, BUFFER, '_b'); + addGetter($DataView, BYTE_LENGTH, '_l'); + addGetter($DataView, BYTE_OFFSET, '_o'); + } + + redefineAll($DataView[PROTOTYPE], { + getInt8: function getInt8(byteOffset) { + return get(this, 1, byteOffset)[0] << 24 >> 24; + }, + getUint8: function getUint8(byteOffset) { + return get(this, 1, byteOffset)[0]; + }, + getInt16: function getInt16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments[1]); + return (bytes[1] << 8 | bytes[0]) << 16 >> 16; + }, + getUint16: function getUint16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments[1]); + return bytes[1] << 8 | bytes[0]; + }, + getInt32: function getInt32(byteOffset /* , littleEndian */) { + return unpackI32(get(this, 4, byteOffset, arguments[1])); + }, + getUint32: function getUint32(byteOffset /* , littleEndian */) { + return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; + }, + getFloat32: function getFloat32(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); + }, + getFloat64: function getFloat64(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); + }, + setInt8: function setInt8(byteOffset, value) { + set(this, 1, byteOffset, packI8, value); + }, + setUint8: function setUint8(byteOffset, value) { + set(this, 1, byteOffset, packI8, value); + }, + setInt16: function setInt16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setUint16: function setUint16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setInt32: function setInt32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setUint32: function setUint32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packF32, value, arguments[2]); + }, + setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { + set(this, 8, byteOffset, packF64, value, arguments[2]); + } + }); +} else { + if (!fails(function () { + $ArrayBuffer(1); + }) || !fails(function () { + new $ArrayBuffer(-1); // eslint-disable-line no-new + }) || fails(function () { + new $ArrayBuffer(); // eslint-disable-line no-new + new $ArrayBuffer(1.5); // eslint-disable-line no-new + new $ArrayBuffer(NaN); // eslint-disable-line no-new + return $ArrayBuffer.name != ARRAY_BUFFER; + })) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer); + return new BaseBuffer(toIndex(length)); + }; + var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; + for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) { + if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]); + } + if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer; + } + // iOS Safari 7.x bug + var view = new $DataView(new $ArrayBuffer(2)); + var $setInt8 = $DataView[PROTOTYPE].setInt8; + view.setInt8(0, 2147483648); + view.setInt8(1, 2147483649); + if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], { + setInt8: function setInt8(byteOffset, value) { + $setInt8.call(this, byteOffset, value << 24 >> 24); + }, + setUint8: function setUint8(byteOffset, value) { + $setInt8.call(this, byteOffset, value << 24 >> 24); + } + }, true); +} +setToStringTag($ArrayBuffer, ARRAY_BUFFER); +setToStringTag($DataView, DATA_VIEW); +hide($DataView[PROTOTYPE], $typed.VIEW, true); +exports[ARRAY_BUFFER] = $ArrayBuffer; +exports[DATA_VIEW] = $DataView; diff --git a/node_modules/core-js/modules/_typed.js b/node_modules/core-js/modules/_typed.js new file mode 100644 index 000000000..8747ffd71 --- /dev/null +++ b/node_modules/core-js/modules/_typed.js @@ -0,0 +1,28 @@ +var global = require('./_global'); +var hide = require('./_hide'); +var uid = require('./_uid'); +var TYPED = uid('typed_array'); +var VIEW = uid('view'); +var ABV = !!(global.ArrayBuffer && global.DataView); +var CONSTR = ABV; +var i = 0; +var l = 9; +var Typed; + +var TypedArrayConstructors = ( + 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' +).split(','); + +while (i < l) { + if (Typed = global[TypedArrayConstructors[i++]]) { + hide(Typed.prototype, TYPED, true); + hide(Typed.prototype, VIEW, true); + } else CONSTR = false; +} + +module.exports = { + ABV: ABV, + CONSTR: CONSTR, + TYPED: TYPED, + VIEW: VIEW +}; diff --git a/node_modules/core-js/modules/_uid.js b/node_modules/core-js/modules/_uid.js new file mode 100644 index 000000000..ffbe7185f --- /dev/null +++ b/node_modules/core-js/modules/_uid.js @@ -0,0 +1,5 @@ +var id = 0; +var px = Math.random(); +module.exports = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; diff --git a/node_modules/core-js/modules/_user-agent.js b/node_modules/core-js/modules/_user-agent.js new file mode 100644 index 000000000..363fedc25 --- /dev/null +++ b/node_modules/core-js/modules/_user-agent.js @@ -0,0 +1,4 @@ +var global = require('./_global'); +var navigator = global.navigator; + +module.exports = navigator && navigator.userAgent || ''; diff --git a/node_modules/core-js/modules/_validate-collection.js b/node_modules/core-js/modules/_validate-collection.js new file mode 100644 index 000000000..cec1ceff7 --- /dev/null +++ b/node_modules/core-js/modules/_validate-collection.js @@ -0,0 +1,5 @@ +var isObject = require('./_is-object'); +module.exports = function (it, TYPE) { + if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); + return it; +}; diff --git a/node_modules/core-js/modules/_wks-define.js b/node_modules/core-js/modules/_wks-define.js new file mode 100644 index 000000000..7284d6ada --- /dev/null +++ b/node_modules/core-js/modules/_wks-define.js @@ -0,0 +1,9 @@ +var global = require('./_global'); +var core = require('./_core'); +var LIBRARY = require('./_library'); +var wksExt = require('./_wks-ext'); +var defineProperty = require('./_object-dp').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) }); +}; diff --git a/node_modules/core-js/modules/_wks-ext.js b/node_modules/core-js/modules/_wks-ext.js new file mode 100644 index 000000000..13bd83b16 --- /dev/null +++ b/node_modules/core-js/modules/_wks-ext.js @@ -0,0 +1 @@ +exports.f = require('./_wks'); diff --git a/node_modules/core-js/modules/_wks.js b/node_modules/core-js/modules/_wks.js new file mode 100644 index 000000000..e33f857a6 --- /dev/null +++ b/node_modules/core-js/modules/_wks.js @@ -0,0 +1,11 @@ +var store = require('./_shared')('wks'); +var uid = require('./_uid'); +var Symbol = require('./_global').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; diff --git a/node_modules/core-js/modules/core.delay.js b/node_modules/core-js/modules/core.delay.js new file mode 100644 index 000000000..73712c012 --- /dev/null +++ b/node_modules/core-js/modules/core.delay.js @@ -0,0 +1,12 @@ +var global = require('./_global'); +var core = require('./_core'); +var $export = require('./_export'); +var partial = require('./_partial'); +// https://esdiscuss.org/topic/promise-returning-delay-function +$export($export.G + $export.F, { + delay: function delay(time) { + return new (core.Promise || global.Promise)(function (resolve) { + setTimeout(partial.call(resolve, true), time); + }); + } +}); diff --git a/node_modules/core-js/modules/core.dict.js b/node_modules/core-js/modules/core.dict.js new file mode 100644 index 000000000..5422ad30d --- /dev/null +++ b/node_modules/core-js/modules/core.dict.js @@ -0,0 +1,157 @@ +'use strict'; +var ctx = require('./_ctx'); +var $export = require('./_export'); +var createDesc = require('./_property-desc'); +var assign = require('./_object-assign'); +var create = require('./_object-create'); +var getPrototypeOf = require('./_object-gpo'); +var getKeys = require('./_object-keys'); +var dP = require('./_object-dp'); +var keyOf = require('./_keyof'); +var aFunction = require('./_a-function'); +var forOf = require('./_for-of'); +var isIterable = require('./core.is-iterable'); +var $iterCreate = require('./_iter-create'); +var step = require('./_iter-step'); +var isObject = require('./_is-object'); +var toIObject = require('./_to-iobject'); +var DESCRIPTORS = require('./_descriptors'); +var has = require('./_has'); + +// 0 -> Dict.forEach +// 1 -> Dict.map +// 2 -> Dict.filter +// 3 -> Dict.some +// 4 -> Dict.every +// 5 -> Dict.find +// 6 -> Dict.findKey +// 7 -> Dict.mapPairs +var createDictMethod = function (TYPE) { + var IS_MAP = TYPE == 1; + var IS_EVERY = TYPE == 4; + return function (object, callbackfn, that /* = undefined */) { + var f = ctx(callbackfn, that, 3); + var O = toIObject(object); + var result = IS_MAP || TYPE == 7 || TYPE == 2 + ? new (typeof this == 'function' ? this : Dict)() : undefined; + var key, val, res; + for (key in O) if (has(O, key)) { + val = O[key]; + res = f(val, key, object); + if (TYPE) { + if (IS_MAP) result[key] = res; // map + else if (res) switch (TYPE) { + case 2: result[key] = val; break; // filter + case 3: return true; // some + case 5: return val; // find + case 6: return key; // findKey + case 7: result[res[0]] = res[1]; // mapPairs + } else if (IS_EVERY) return false; // every + } + } + return TYPE == 3 || IS_EVERY ? IS_EVERY : result; + }; +}; +var findKey = createDictMethod(6); + +var createDictIter = function (kind) { + return function (it) { + return new DictIterator(it, kind); + }; +}; +var DictIterator = function (iterated, kind) { + this._t = toIObject(iterated); // target + this._a = getKeys(iterated); // keys + this._i = 0; // next index + this._k = kind; // kind +}; +$iterCreate(DictIterator, 'Dict', function () { + var that = this; + var O = that._t; + var keys = that._a; + var kind = that._k; + var key; + do { + if (that._i >= keys.length) { + that._t = undefined; + return step(1); + } + } while (!has(O, key = keys[that._i++])); + if (kind == 'keys') return step(0, key); + if (kind == 'values') return step(0, O[key]); + return step(0, [key, O[key]]); +}); + +function Dict(iterable) { + var dict = create(null); + if (iterable != undefined) { + if (isIterable(iterable)) { + forOf(iterable, true, function (key, value) { + dict[key] = value; + }); + } else assign(dict, iterable); + } + return dict; +} +Dict.prototype = null; + +function reduce(object, mapfn, init) { + aFunction(mapfn); + var O = toIObject(object); + var keys = getKeys(O); + var length = keys.length; + var i = 0; + var memo, key; + if (arguments.length < 3) { + if (!length) throw TypeError('Reduce of empty object with no initial value'); + memo = O[keys[i++]]; + } else memo = Object(init); + while (length > i) if (has(O, key = keys[i++])) { + memo = mapfn(memo, O[key], key, object); + } + return memo; +} + +function includes(object, el) { + // eslint-disable-next-line no-self-compare + return (el == el ? keyOf(object, el) : findKey(object, function (it) { + // eslint-disable-next-line no-self-compare + return it != it; + })) !== undefined; +} + +function get(object, key) { + if (has(object, key)) return object[key]; +} +function set(object, key, value) { + if (DESCRIPTORS && key in Object) dP.f(object, key, createDesc(0, value)); + else object[key] = value; + return object; +} + +function isDict(it) { + return isObject(it) && getPrototypeOf(it) === Dict.prototype; +} + +$export($export.G + $export.F, { Dict: Dict }); + +$export($export.S, 'Dict', { + keys: createDictIter('keys'), + values: createDictIter('values'), + entries: createDictIter('entries'), + forEach: createDictMethod(0), + map: createDictMethod(1), + filter: createDictMethod(2), + some: createDictMethod(3), + every: createDictMethod(4), + find: createDictMethod(5), + findKey: findKey, + mapPairs: createDictMethod(7), + reduce: reduce, + keyOf: keyOf, + includes: includes, + has: has, + get: get, + set: set, + isDict: isDict +}); diff --git a/node_modules/core-js/modules/core.function.part.js b/node_modules/core-js/modules/core.function.part.js new file mode 100644 index 000000000..050154f85 --- /dev/null +++ b/node_modules/core-js/modules/core.function.part.js @@ -0,0 +1,7 @@ +var path = require('./_path'); +var $export = require('./_export'); + +// Placeholder +require('./_core')._ = path._ = path._ || {}; + +$export($export.P + $export.F, 'Function', { part: require('./_partial') }); diff --git a/node_modules/core-js/modules/core.get-iterator-method.js b/node_modules/core-js/modules/core.get-iterator-method.js new file mode 100644 index 000000000..9b6fa62a5 --- /dev/null +++ b/node_modules/core-js/modules/core.get-iterator-method.js @@ -0,0 +1,8 @@ +var classof = require('./_classof'); +var ITERATOR = require('./_wks')('iterator'); +var Iterators = require('./_iterators'); +module.exports = require('./_core').getIteratorMethod = function (it) { + if (it != undefined) return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; +}; diff --git a/node_modules/core-js/modules/core.get-iterator.js b/node_modules/core-js/modules/core.get-iterator.js new file mode 100644 index 000000000..04568c86c --- /dev/null +++ b/node_modules/core-js/modules/core.get-iterator.js @@ -0,0 +1,7 @@ +var anObject = require('./_an-object'); +var get = require('./core.get-iterator-method'); +module.exports = require('./_core').getIterator = function (it) { + var iterFn = get(it); + if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!'); + return anObject(iterFn.call(it)); +}; diff --git a/node_modules/core-js/modules/core.is-iterable.js b/node_modules/core-js/modules/core.is-iterable.js new file mode 100644 index 000000000..388e5e35b --- /dev/null +++ b/node_modules/core-js/modules/core.is-iterable.js @@ -0,0 +1,10 @@ +var classof = require('./_classof'); +var ITERATOR = require('./_wks')('iterator'); +var Iterators = require('./_iterators'); +module.exports = require('./_core').isIterable = function (it) { + var O = Object(it); + return O[ITERATOR] !== undefined + || '@@iterator' in O + // eslint-disable-next-line no-prototype-builtins + || Iterators.hasOwnProperty(classof(O)); +}; diff --git a/node_modules/core-js/modules/core.number.iterator.js b/node_modules/core-js/modules/core.number.iterator.js new file mode 100644 index 000000000..fa37791eb --- /dev/null +++ b/node_modules/core-js/modules/core.number.iterator.js @@ -0,0 +1,9 @@ +'use strict'; +require('./_iter-define')(Number, 'Number', function (iterated) { + this._l = +iterated; + this._i = 0; +}, function () { + var i = this._i++; + var done = !(i < this._l); + return { done: done, value: done ? undefined : i }; +}); diff --git a/node_modules/core-js/modules/core.object.classof.js b/node_modules/core-js/modules/core.object.classof.js new file mode 100644 index 000000000..fe16595a5 --- /dev/null +++ b/node_modules/core-js/modules/core.object.classof.js @@ -0,0 +1,3 @@ +var $export = require('./_export'); + +$export($export.S + $export.F, 'Object', { classof: require('./_classof') }); diff --git a/node_modules/core-js/modules/core.object.define.js b/node_modules/core-js/modules/core.object.define.js new file mode 100644 index 000000000..e4e717b58 --- /dev/null +++ b/node_modules/core-js/modules/core.object.define.js @@ -0,0 +1,4 @@ +var $export = require('./_export'); +var define = require('./_object-define'); + +$export($export.S + $export.F, 'Object', { define: define }); diff --git a/node_modules/core-js/modules/core.object.is-object.js b/node_modules/core-js/modules/core.object.is-object.js new file mode 100644 index 000000000..fea80b606 --- /dev/null +++ b/node_modules/core-js/modules/core.object.is-object.js @@ -0,0 +1,3 @@ +var $export = require('./_export'); + +$export($export.S + $export.F, 'Object', { isObject: require('./_is-object') }); diff --git a/node_modules/core-js/modules/core.object.make.js b/node_modules/core-js/modules/core.object.make.js new file mode 100644 index 000000000..51d47740a --- /dev/null +++ b/node_modules/core-js/modules/core.object.make.js @@ -0,0 +1,9 @@ +var $export = require('./_export'); +var define = require('./_object-define'); +var create = require('./_object-create'); + +$export($export.S + $export.F, 'Object', { + make: function (proto, mixin) { + return define(create(proto), mixin); + } +}); diff --git a/node_modules/core-js/modules/core.regexp.escape.js b/node_modules/core-js/modules/core.regexp.escape.js new file mode 100644 index 000000000..3ddd748c0 --- /dev/null +++ b/node_modules/core-js/modules/core.regexp.escape.js @@ -0,0 +1,5 @@ +// https://github.com/benjamingr/RexExp.escape +var $export = require('./_export'); +var $re = require('./_replacer')(/[\\^$*+?.()|[\]{}]/g, '\\$&'); + +$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } }); diff --git a/node_modules/core-js/modules/core.string.escape-html.js b/node_modules/core-js/modules/core.string.escape-html.js new file mode 100644 index 000000000..f96788614 --- /dev/null +++ b/node_modules/core-js/modules/core.string.escape-html.js @@ -0,0 +1,11 @@ +'use strict'; +var $export = require('./_export'); +var $re = require('./_replacer')(/[&<>"']/g, { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' +}); + +$export($export.P + $export.F, 'String', { escapeHTML: function escapeHTML() { return $re(this); } }); diff --git a/node_modules/core-js/modules/core.string.unescape-html.js b/node_modules/core-js/modules/core.string.unescape-html.js new file mode 100644 index 000000000..eb8a6cfbf --- /dev/null +++ b/node_modules/core-js/modules/core.string.unescape-html.js @@ -0,0 +1,11 @@ +'use strict'; +var $export = require('./_export'); +var $re = require('./_replacer')(/&(?:amp|lt|gt|quot|apos);/g, { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" +}); + +$export($export.P + $export.F, 'String', { unescapeHTML: function unescapeHTML() { return $re(this); } }); diff --git a/node_modules/core-js/modules/es5.js b/node_modules/core-js/modules/es5.js new file mode 100644 index 000000000..ca10612d1 --- /dev/null +++ b/node_modules/core-js/modules/es5.js @@ -0,0 +1,35 @@ +// This file still here for a legacy code and will be removed in a near time +require('./es6.object.create'); +require('./es6.object.define-property'); +require('./es6.object.define-properties'); +require('./es6.object.get-own-property-descriptor'); +require('./es6.object.get-prototype-of'); +require('./es6.object.keys'); +require('./es6.object.get-own-property-names'); +require('./es6.object.freeze'); +require('./es6.object.seal'); +require('./es6.object.prevent-extensions'); +require('./es6.object.is-frozen'); +require('./es6.object.is-sealed'); +require('./es6.object.is-extensible'); +require('./es6.function.bind'); +require('./es6.array.is-array'); +require('./es6.array.join'); +require('./es6.array.slice'); +require('./es6.array.sort'); +require('./es6.array.for-each'); +require('./es6.array.map'); +require('./es6.array.filter'); +require('./es6.array.some'); +require('./es6.array.every'); +require('./es6.array.reduce'); +require('./es6.array.reduce-right'); +require('./es6.array.index-of'); +require('./es6.array.last-index-of'); +require('./es6.date.now'); +require('./es6.date.to-iso-string'); +require('./es6.date.to-json'); +require('./es6.parse-int'); +require('./es6.parse-float'); +require('./es6.string.trim'); +require('./es6.regexp.to-string'); diff --git a/node_modules/core-js/modules/es6.array.copy-within.js b/node_modules/core-js/modules/es6.array.copy-within.js new file mode 100644 index 000000000..f866a9591 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.copy-within.js @@ -0,0 +1,6 @@ +// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) +var $export = require('./_export'); + +$export($export.P, 'Array', { copyWithin: require('./_array-copy-within') }); + +require('./_add-to-unscopables')('copyWithin'); diff --git a/node_modules/core-js/modules/es6.array.every.js b/node_modules/core-js/modules/es6.array.every.js new file mode 100644 index 000000000..cfd448f5c --- /dev/null +++ b/node_modules/core-js/modules/es6.array.every.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export'); +var $every = require('./_array-methods')(4); + +$export($export.P + $export.F * !require('./_strict-method')([].every, true), 'Array', { + // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) + every: function every(callbackfn /* , thisArg */) { + return $every(this, callbackfn, arguments[1]); + } +}); diff --git a/node_modules/core-js/modules/es6.array.fill.js b/node_modules/core-js/modules/es6.array.fill.js new file mode 100644 index 000000000..ac1714424 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.fill.js @@ -0,0 +1,6 @@ +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) +var $export = require('./_export'); + +$export($export.P, 'Array', { fill: require('./_array-fill') }); + +require('./_add-to-unscopables')('fill'); diff --git a/node_modules/core-js/modules/es6.array.filter.js b/node_modules/core-js/modules/es6.array.filter.js new file mode 100644 index 000000000..447ecf403 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.filter.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export'); +var $filter = require('./_array-methods')(2); + +$export($export.P + $export.F * !require('./_strict-method')([].filter, true), 'Array', { + // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) + filter: function filter(callbackfn /* , thisArg */) { + return $filter(this, callbackfn, arguments[1]); + } +}); diff --git a/node_modules/core-js/modules/es6.array.find-index.js b/node_modules/core-js/modules/es6.array.find-index.js new file mode 100644 index 000000000..374cadd77 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.find-index.js @@ -0,0 +1,14 @@ +'use strict'; +// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) +var $export = require('./_export'); +var $find = require('./_array-methods')(6); +var KEY = 'findIndex'; +var forced = true; +// Shouldn't skip holes +if (KEY in []) Array(1)[KEY](function () { forced = false; }); +$export($export.P + $export.F * forced, 'Array', { + findIndex: function findIndex(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); +require('./_add-to-unscopables')(KEY); diff --git a/node_modules/core-js/modules/es6.array.find.js b/node_modules/core-js/modules/es6.array.find.js new file mode 100644 index 000000000..4fbe76ce0 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.find.js @@ -0,0 +1,14 @@ +'use strict'; +// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) +var $export = require('./_export'); +var $find = require('./_array-methods')(5); +var KEY = 'find'; +var forced = true; +// Shouldn't skip holes +if (KEY in []) Array(1)[KEY](function () { forced = false; }); +$export($export.P + $export.F * forced, 'Array', { + find: function find(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); +require('./_add-to-unscopables')(KEY); diff --git a/node_modules/core-js/modules/es6.array.for-each.js b/node_modules/core-js/modules/es6.array.for-each.js new file mode 100644 index 000000000..525ba0740 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.for-each.js @@ -0,0 +1,11 @@ +'use strict'; +var $export = require('./_export'); +var $forEach = require('./_array-methods')(0); +var STRICT = require('./_strict-method')([].forEach, true); + +$export($export.P + $export.F * !STRICT, 'Array', { + // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) + forEach: function forEach(callbackfn /* , thisArg */) { + return $forEach(this, callbackfn, arguments[1]); + } +}); diff --git a/node_modules/core-js/modules/es6.array.from.js b/node_modules/core-js/modules/es6.array.from.js new file mode 100644 index 000000000..4db38017f --- /dev/null +++ b/node_modules/core-js/modules/es6.array.from.js @@ -0,0 +1,37 @@ +'use strict'; +var ctx = require('./_ctx'); +var $export = require('./_export'); +var toObject = require('./_to-object'); +var call = require('./_iter-call'); +var isArrayIter = require('./_is-array-iter'); +var toLength = require('./_to-length'); +var createProperty = require('./_create-property'); +var getIterFn = require('./core.get-iterator-method'); + +$export($export.S + $export.F * !require('./_iter-detect')(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; + } +}); diff --git a/node_modules/core-js/modules/es6.array.index-of.js b/node_modules/core-js/modules/es6.array.index-of.js new file mode 100644 index 000000000..231c92e9c --- /dev/null +++ b/node_modules/core-js/modules/es6.array.index-of.js @@ -0,0 +1,15 @@ +'use strict'; +var $export = require('./_export'); +var $indexOf = require('./_array-includes')(false); +var $native = [].indexOf; +var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; + +$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', { + // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) + indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { + return NEGATIVE_ZERO + // convert -0 to +0 + ? $native.apply(this, arguments) || 0 + : $indexOf(this, searchElement, arguments[1]); + } +}); diff --git a/node_modules/core-js/modules/es6.array.is-array.js b/node_modules/core-js/modules/es6.array.is-array.js new file mode 100644 index 000000000..27ca6fc5b --- /dev/null +++ b/node_modules/core-js/modules/es6.array.is-array.js @@ -0,0 +1,4 @@ +// 22.1.2.2 / 15.4.3.2 Array.isArray(arg) +var $export = require('./_export'); + +$export($export.S, 'Array', { isArray: require('./_is-array') }); diff --git a/node_modules/core-js/modules/es6.array.iterator.js b/node_modules/core-js/modules/es6.array.iterator.js new file mode 100644 index 000000000..c64e88b1b --- /dev/null +++ b/node_modules/core-js/modules/es6.array.iterator.js @@ -0,0 +1,34 @@ +'use strict'; +var addToUnscopables = require('./_add-to-unscopables'); +var step = require('./_iter-step'); +var Iterators = require('./_iterators'); +var toIObject = require('./_to-iobject'); + +// 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 = require('./_iter-define')(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'); diff --git a/node_modules/core-js/modules/es6.array.join.js b/node_modules/core-js/modules/es6.array.join.js new file mode 100644 index 000000000..48e55d2e3 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.join.js @@ -0,0 +1,12 @@ +'use strict'; +// 22.1.3.13 Array.prototype.join(separator) +var $export = require('./_export'); +var toIObject = require('./_to-iobject'); +var arrayJoin = [].join; + +// fallback for not array-like strings +$export($export.P + $export.F * (require('./_iobject') != Object || !require('./_strict-method')(arrayJoin)), 'Array', { + join: function join(separator) { + return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); + } +}); diff --git a/node_modules/core-js/modules/es6.array.last-index-of.js b/node_modules/core-js/modules/es6.array.last-index-of.js new file mode 100644 index 000000000..1f70e340d --- /dev/null +++ b/node_modules/core-js/modules/es6.array.last-index-of.js @@ -0,0 +1,22 @@ +'use strict'; +var $export = require('./_export'); +var toIObject = require('./_to-iobject'); +var toInteger = require('./_to-integer'); +var toLength = require('./_to-length'); +var $native = [].lastIndexOf; +var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; + +$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', { + // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) + lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { + // convert -0 to +0 + if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0; + var O = toIObject(this); + var length = toLength(O.length); + var index = length - 1; + if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1])); + if (index < 0) index = length + index; + for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0; + return -1; + } +}); diff --git a/node_modules/core-js/modules/es6.array.map.js b/node_modules/core-js/modules/es6.array.map.js new file mode 100644 index 000000000..1326033f1 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.map.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export'); +var $map = require('./_array-methods')(1); + +$export($export.P + $export.F * !require('./_strict-method')([].map, true), 'Array', { + // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) + map: function map(callbackfn /* , thisArg */) { + return $map(this, callbackfn, arguments[1]); + } +}); diff --git a/node_modules/core-js/modules/es6.array.of.js b/node_modules/core-js/modules/es6.array.of.js new file mode 100644 index 000000000..b83e058c1 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.of.js @@ -0,0 +1,19 @@ +'use strict'; +var $export = require('./_export'); +var createProperty = require('./_create-property'); + +// WebKit Array.of isn't generic +$export($export.S + $export.F * require('./_fails')(function () { + function F() { /* empty */ } + return !(Array.of.call(F) instanceof F); +}), 'Array', { + // 22.1.2.3 Array.of( ...items) + of: function of(/* ...args */) { + var index = 0; + var aLen = arguments.length; + var result = new (typeof this == 'function' ? this : Array)(aLen); + while (aLen > index) createProperty(result, index, arguments[index++]); + result.length = aLen; + return result; + } +}); diff --git a/node_modules/core-js/modules/es6.array.reduce-right.js b/node_modules/core-js/modules/es6.array.reduce-right.js new file mode 100644 index 000000000..168e421d8 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.reduce-right.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export'); +var $reduce = require('./_array-reduce'); + +$export($export.P + $export.F * !require('./_strict-method')([].reduceRight, true), 'Array', { + // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) + reduceRight: function reduceRight(callbackfn /* , initialValue */) { + return $reduce(this, callbackfn, arguments.length, arguments[1], true); + } +}); diff --git a/node_modules/core-js/modules/es6.array.reduce.js b/node_modules/core-js/modules/es6.array.reduce.js new file mode 100644 index 000000000..f4e476121 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.reduce.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export'); +var $reduce = require('./_array-reduce'); + +$export($export.P + $export.F * !require('./_strict-method')([].reduce, true), 'Array', { + // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) + reduce: function reduce(callbackfn /* , initialValue */) { + return $reduce(this, callbackfn, arguments.length, arguments[1], false); + } +}); diff --git a/node_modules/core-js/modules/es6.array.slice.js b/node_modules/core-js/modules/es6.array.slice.js new file mode 100644 index 000000000..bdd496ecb --- /dev/null +++ b/node_modules/core-js/modules/es6.array.slice.js @@ -0,0 +1,28 @@ +'use strict'; +var $export = require('./_export'); +var html = require('./_html'); +var cof = require('./_cof'); +var toAbsoluteIndex = require('./_to-absolute-index'); +var toLength = require('./_to-length'); +var arraySlice = [].slice; + +// fallback for not array-like ES3 strings and DOM objects +$export($export.P + $export.F * require('./_fails')(function () { + if (html) arraySlice.call(html); +}), 'Array', { + slice: function slice(begin, end) { + var len = toLength(this.length); + var klass = cof(this); + end = end === undefined ? len : end; + if (klass == 'Array') return arraySlice.call(this, begin, end); + var start = toAbsoluteIndex(begin, len); + var upTo = toAbsoluteIndex(end, len); + var size = toLength(upTo - start); + var cloned = new Array(size); + var i = 0; + for (; i < size; i++) cloned[i] = klass == 'String' + ? this.charAt(start + i) + : this[start + i]; + return cloned; + } +}); diff --git a/node_modules/core-js/modules/es6.array.some.js b/node_modules/core-js/modules/es6.array.some.js new file mode 100644 index 000000000..14c5eec26 --- /dev/null +++ b/node_modules/core-js/modules/es6.array.some.js @@ -0,0 +1,10 @@ +'use strict'; +var $export = require('./_export'); +var $some = require('./_array-methods')(3); + +$export($export.P + $export.F * !require('./_strict-method')([].some, true), 'Array', { + // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) + some: function some(callbackfn /* , thisArg */) { + return $some(this, callbackfn, arguments[1]); + } +}); diff --git a/node_modules/core-js/modules/es6.array.sort.js b/node_modules/core-js/modules/es6.array.sort.js new file mode 100644 index 000000000..39817ffae --- /dev/null +++ b/node_modules/core-js/modules/es6.array.sort.js @@ -0,0 +1,23 @@ +'use strict'; +var $export = require('./_export'); +var aFunction = require('./_a-function'); +var toObject = require('./_to-object'); +var fails = require('./_fails'); +var $sort = [].sort; +var test = [1, 2, 3]; + +$export($export.P + $export.F * (fails(function () { + // IE8- + test.sort(undefined); +}) || !fails(function () { + // V8 bug + test.sort(null); + // Old WebKit +}) || !require('./_strict-method')($sort)), 'Array', { + // 22.1.3.25 Array.prototype.sort(comparefn) + sort: function sort(comparefn) { + return comparefn === undefined + ? $sort.call(toObject(this)) + : $sort.call(toObject(this), aFunction(comparefn)); + } +}); diff --git a/node_modules/core-js/modules/es6.array.species.js b/node_modules/core-js/modules/es6.array.species.js new file mode 100644 index 000000000..ce0b8917f --- /dev/null +++ b/node_modules/core-js/modules/es6.array.species.js @@ -0,0 +1 @@ +require('./_set-species')('Array'); diff --git a/node_modules/core-js/modules/es6.date.now.js b/node_modules/core-js/modules/es6.date.now.js new file mode 100644 index 000000000..65f134e56 --- /dev/null +++ b/node_modules/core-js/modules/es6.date.now.js @@ -0,0 +1,4 @@ +// 20.3.3.1 / 15.9.4.4 Date.now() +var $export = require('./_export'); + +$export($export.S, 'Date', { now: function () { return new Date().getTime(); } }); diff --git a/node_modules/core-js/modules/es6.date.to-iso-string.js b/node_modules/core-js/modules/es6.date.to-iso-string.js new file mode 100644 index 000000000..13b27818c --- /dev/null +++ b/node_modules/core-js/modules/es6.date.to-iso-string.js @@ -0,0 +1,8 @@ +// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() +var $export = require('./_export'); +var toISOString = require('./_date-to-iso-string'); + +// PhantomJS / old WebKit has a broken implementations +$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', { + toISOString: toISOString +}); diff --git a/node_modules/core-js/modules/es6.date.to-json.js b/node_modules/core-js/modules/es6.date.to-json.js new file mode 100644 index 000000000..1508e0428 --- /dev/null +++ b/node_modules/core-js/modules/es6.date.to-json.js @@ -0,0 +1,16 @@ +'use strict'; +var $export = require('./_export'); +var toObject = require('./_to-object'); +var toPrimitive = require('./_to-primitive'); + +$export($export.P + $export.F * require('./_fails')(function () { + return new Date(NaN).toJSON() !== null + || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; +}), 'Date', { + // eslint-disable-next-line no-unused-vars + toJSON: function toJSON(key) { + var O = toObject(this); + var pv = toPrimitive(O); + return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); + } +}); diff --git a/node_modules/core-js/modules/es6.date.to-primitive.js b/node_modules/core-js/modules/es6.date.to-primitive.js new file mode 100644 index 000000000..41754b9c2 --- /dev/null +++ b/node_modules/core-js/modules/es6.date.to-primitive.js @@ -0,0 +1,4 @@ +var TO_PRIMITIVE = require('./_wks')('toPrimitive'); +var proto = Date.prototype; + +if (!(TO_PRIMITIVE in proto)) require('./_hide')(proto, TO_PRIMITIVE, require('./_date-to-primitive')); diff --git a/node_modules/core-js/modules/es6.date.to-string.js b/node_modules/core-js/modules/es6.date.to-string.js new file mode 100644 index 000000000..15ee75ac1 --- /dev/null +++ b/node_modules/core-js/modules/es6.date.to-string.js @@ -0,0 +1,12 @@ +var DateProto = Date.prototype; +var INVALID_DATE = 'Invalid Date'; +var TO_STRING = 'toString'; +var $toString = DateProto[TO_STRING]; +var getTime = DateProto.getTime; +if (new Date(NaN) + '' != INVALID_DATE) { + require('./_redefine')(DateProto, TO_STRING, function toString() { + var value = getTime.call(this); + // eslint-disable-next-line no-self-compare + return value === value ? $toString.call(this) : INVALID_DATE; + }); +} diff --git a/node_modules/core-js/modules/es6.function.bind.js b/node_modules/core-js/modules/es6.function.bind.js new file mode 100644 index 000000000..38e84e1ac --- /dev/null +++ b/node_modules/core-js/modules/es6.function.bind.js @@ -0,0 +1,4 @@ +// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) +var $export = require('./_export'); + +$export($export.P, 'Function', { bind: require('./_bind') }); diff --git a/node_modules/core-js/modules/es6.function.has-instance.js b/node_modules/core-js/modules/es6.function.has-instance.js new file mode 100644 index 000000000..7556ed9bd --- /dev/null +++ b/node_modules/core-js/modules/es6.function.has-instance.js @@ -0,0 +1,13 @@ +'use strict'; +var isObject = require('./_is-object'); +var getPrototypeOf = require('./_object-gpo'); +var HAS_INSTANCE = require('./_wks')('hasInstance'); +var FunctionProto = Function.prototype; +// 19.2.3.6 Function.prototype[@@hasInstance](V) +if (!(HAS_INSTANCE in FunctionProto)) require('./_object-dp').f(FunctionProto, HAS_INSTANCE, { value: function (O) { + if (typeof this != 'function' || !isObject(O)) return false; + if (!isObject(this.prototype)) return O instanceof this; + // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: + while (O = getPrototypeOf(O)) if (this.prototype === O) return true; + return false; +} }); diff --git a/node_modules/core-js/modules/es6.function.name.js b/node_modules/core-js/modules/es6.function.name.js new file mode 100644 index 000000000..05dd333f8 --- /dev/null +++ b/node_modules/core-js/modules/es6.function.name.js @@ -0,0 +1,16 @@ +var dP = require('./_object-dp').f; +var FProto = Function.prototype; +var nameRE = /^\s*function ([^ (]*)/; +var NAME = 'name'; + +// 19.2.4.2 name +NAME in FProto || require('./_descriptors') && dP(FProto, NAME, { + configurable: true, + get: function () { + try { + return ('' + this).match(nameRE)[1]; + } catch (e) { + return ''; + } + } +}); diff --git a/node_modules/core-js/modules/es6.map.js b/node_modules/core-js/modules/es6.map.js new file mode 100644 index 000000000..a282f0222 --- /dev/null +++ b/node_modules/core-js/modules/es6.map.js @@ -0,0 +1,19 @@ +'use strict'; +var strong = require('./_collection-strong'); +var validate = require('./_validate-collection'); +var MAP = 'Map'; + +// 23.1 Map Objects +module.exports = require('./_collection')(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); diff --git a/node_modules/core-js/modules/es6.math.acosh.js b/node_modules/core-js/modules/es6.math.acosh.js new file mode 100644 index 000000000..8a8989ebb --- /dev/null +++ b/node_modules/core-js/modules/es6.math.acosh.js @@ -0,0 +1,18 @@ +// 20.2.2.3 Math.acosh(x) +var $export = require('./_export'); +var log1p = require('./_math-log1p'); +var sqrt = Math.sqrt; +var $acosh = Math.acosh; + +$export($export.S + $export.F * !($acosh + // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 + && Math.floor($acosh(Number.MAX_VALUE)) == 710 + // Tor Browser bug: Math.acosh(Infinity) -> NaN + && $acosh(Infinity) == Infinity +), 'Math', { + acosh: function acosh(x) { + return (x = +x) < 1 ? NaN : x > 94906265.62425156 + ? Math.log(x) + Math.LN2 + : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); + } +}); diff --git a/node_modules/core-js/modules/es6.math.asinh.js b/node_modules/core-js/modules/es6.math.asinh.js new file mode 100644 index 000000000..ddf466628 --- /dev/null +++ b/node_modules/core-js/modules/es6.math.asinh.js @@ -0,0 +1,10 @@ +// 20.2.2.5 Math.asinh(x) +var $export = require('./_export'); +var $asinh = Math.asinh; + +function asinh(x) { + return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); +} + +// Tor Browser bug: Math.asinh(0) -> -0 +$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh }); diff --git a/node_modules/core-js/modules/es6.math.atanh.js b/node_modules/core-js/modules/es6.math.atanh.js new file mode 100644 index 000000000..af3c3e809 --- /dev/null +++ b/node_modules/core-js/modules/es6.math.atanh.js @@ -0,0 +1,10 @@ +// 20.2.2.7 Math.atanh(x) +var $export = require('./_export'); +var $atanh = Math.atanh; + +// Tor Browser bug: Math.atanh(-0) -> 0 +$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { + atanh: function atanh(x) { + return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; + } +}); diff --git a/node_modules/core-js/modules/es6.math.cbrt.js b/node_modules/core-js/modules/es6.math.cbrt.js new file mode 100644 index 000000000..e45ac4445 --- /dev/null +++ b/node_modules/core-js/modules/es6.math.cbrt.js @@ -0,0 +1,9 @@ +// 20.2.2.9 Math.cbrt(x) +var $export = require('./_export'); +var sign = require('./_math-sign'); + +$export($export.S, 'Math', { + cbrt: function cbrt(x) { + return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); + } +}); diff --git a/node_modules/core-js/modules/es6.math.clz32.js b/node_modules/core-js/modules/es6.math.clz32.js new file mode 100644 index 000000000..1e4d7e19c --- /dev/null +++ b/node_modules/core-js/modules/es6.math.clz32.js @@ -0,0 +1,8 @@ +// 20.2.2.11 Math.clz32(x) +var $export = require('./_export'); + +$export($export.S, 'Math', { + clz32: function clz32(x) { + return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; + } +}); diff --git a/node_modules/core-js/modules/es6.math.cosh.js b/node_modules/core-js/modules/es6.math.cosh.js new file mode 100644 index 000000000..1e0cffc1a --- /dev/null +++ b/node_modules/core-js/modules/es6.math.cosh.js @@ -0,0 +1,9 @@ +// 20.2.2.12 Math.cosh(x) +var $export = require('./_export'); +var exp = Math.exp; + +$export($export.S, 'Math', { + cosh: function cosh(x) { + return (exp(x = +x) + exp(-x)) / 2; + } +}); diff --git a/node_modules/core-js/modules/es6.math.expm1.js b/node_modules/core-js/modules/es6.math.expm1.js new file mode 100644 index 000000000..da4c90df8 --- /dev/null +++ b/node_modules/core-js/modules/es6.math.expm1.js @@ -0,0 +1,5 @@ +// 20.2.2.14 Math.expm1(x) +var $export = require('./_export'); +var $expm1 = require('./_math-expm1'); + +$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 }); diff --git a/node_modules/core-js/modules/es6.math.fround.js b/node_modules/core-js/modules/es6.math.fround.js new file mode 100644 index 000000000..9c262f2ec --- /dev/null +++ b/node_modules/core-js/modules/es6.math.fround.js @@ -0,0 +1,4 @@ +// 20.2.2.16 Math.fround(x) +var $export = require('./_export'); + +$export($export.S, 'Math', { fround: require('./_math-fround') }); diff --git a/node_modules/core-js/modules/es6.math.hypot.js b/node_modules/core-js/modules/es6.math.hypot.js new file mode 100644 index 000000000..41ffdb27a --- /dev/null +++ b/node_modules/core-js/modules/es6.math.hypot.js @@ -0,0 +1,25 @@ +// 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) +var $export = require('./_export'); +var abs = Math.abs; + +$export($export.S, 'Math', { + hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars + var sum = 0; + var i = 0; + var aLen = arguments.length; + var larg = 0; + var arg, div; + while (i < aLen) { + arg = abs(arguments[i++]); + if (larg < arg) { + div = larg / arg; + sum = sum * div * div + 1; + larg = arg; + } else if (arg > 0) { + div = arg / larg; + sum += div * div; + } else sum += arg; + } + return larg === Infinity ? Infinity : larg * Math.sqrt(sum); + } +}); diff --git a/node_modules/core-js/modules/es6.math.imul.js b/node_modules/core-js/modules/es6.math.imul.js new file mode 100644 index 000000000..96e683d25 --- /dev/null +++ b/node_modules/core-js/modules/es6.math.imul.js @@ -0,0 +1,17 @@ +// 20.2.2.18 Math.imul(x, y) +var $export = require('./_export'); +var $imul = Math.imul; + +// some WebKit versions fails with big numbers, some has wrong arity +$export($export.S + $export.F * require('./_fails')(function () { + return $imul(0xffffffff, 5) != -5 || $imul.length != 2; +}), 'Math', { + imul: function imul(x, y) { + var UINT16 = 0xffff; + var xn = +x; + var yn = +y; + var xl = UINT16 & xn; + var yl = UINT16 & yn; + return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); + } +}); diff --git a/node_modules/core-js/modules/es6.math.log10.js b/node_modules/core-js/modules/es6.math.log10.js new file mode 100644 index 000000000..9ee8ae68f --- /dev/null +++ b/node_modules/core-js/modules/es6.math.log10.js @@ -0,0 +1,8 @@ +// 20.2.2.21 Math.log10(x) +var $export = require('./_export'); + +$export($export.S, 'Math', { + log10: function log10(x) { + return Math.log(x) * Math.LOG10E; + } +}); diff --git a/node_modules/core-js/modules/es6.math.log1p.js b/node_modules/core-js/modules/es6.math.log1p.js new file mode 100644 index 000000000..62959800a --- /dev/null +++ b/node_modules/core-js/modules/es6.math.log1p.js @@ -0,0 +1,4 @@ +// 20.2.2.20 Math.log1p(x) +var $export = require('./_export'); + +$export($export.S, 'Math', { log1p: require('./_math-log1p') }); diff --git a/node_modules/core-js/modules/es6.math.log2.js b/node_modules/core-js/modules/es6.math.log2.js new file mode 100644 index 000000000..03d127cba --- /dev/null +++ b/node_modules/core-js/modules/es6.math.log2.js @@ -0,0 +1,8 @@ +// 20.2.2.22 Math.log2(x) +var $export = require('./_export'); + +$export($export.S, 'Math', { + log2: function log2(x) { + return Math.log(x) / Math.LN2; + } +}); diff --git a/node_modules/core-js/modules/es6.math.sign.js b/node_modules/core-js/modules/es6.math.sign.js new file mode 100644 index 000000000..981f69e56 --- /dev/null +++ b/node_modules/core-js/modules/es6.math.sign.js @@ -0,0 +1,4 @@ +// 20.2.2.28 Math.sign(x) +var $export = require('./_export'); + +$export($export.S, 'Math', { sign: require('./_math-sign') }); diff --git a/node_modules/core-js/modules/es6.math.sinh.js b/node_modules/core-js/modules/es6.math.sinh.js new file mode 100644 index 000000000..57606333c --- /dev/null +++ b/node_modules/core-js/modules/es6.math.sinh.js @@ -0,0 +1,15 @@ +// 20.2.2.30 Math.sinh(x) +var $export = require('./_export'); +var expm1 = require('./_math-expm1'); +var exp = Math.exp; + +// V8 near Chromium 38 has a problem with very small numbers +$export($export.S + $export.F * require('./_fails')(function () { + return !Math.sinh(-2e-17) != -2e-17; +}), 'Math', { + sinh: function sinh(x) { + return Math.abs(x = +x) < 1 + ? (expm1(x) - expm1(-x)) / 2 + : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); + } +}); diff --git a/node_modules/core-js/modules/es6.math.tanh.js b/node_modules/core-js/modules/es6.math.tanh.js new file mode 100644 index 000000000..0d3135b0f --- /dev/null +++ b/node_modules/core-js/modules/es6.math.tanh.js @@ -0,0 +1,12 @@ +// 20.2.2.33 Math.tanh(x) +var $export = require('./_export'); +var expm1 = require('./_math-expm1'); +var exp = Math.exp; + +$export($export.S, 'Math', { + tanh: function tanh(x) { + var a = expm1(x = +x); + var b = expm1(-x); + return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); + } +}); diff --git a/node_modules/core-js/modules/es6.math.trunc.js b/node_modules/core-js/modules/es6.math.trunc.js new file mode 100644 index 000000000..35ddb8086 --- /dev/null +++ b/node_modules/core-js/modules/es6.math.trunc.js @@ -0,0 +1,8 @@ +// 20.2.2.34 Math.trunc(x) +var $export = require('./_export'); + +$export($export.S, 'Math', { + trunc: function trunc(it) { + return (it > 0 ? Math.floor : Math.ceil)(it); + } +}); diff --git a/node_modules/core-js/modules/es6.number.constructor.js b/node_modules/core-js/modules/es6.number.constructor.js new file mode 100644 index 000000000..aee40e9ac --- /dev/null +++ b/node_modules/core-js/modules/es6.number.constructor.js @@ -0,0 +1,69 @@ +'use strict'; +var global = require('./_global'); +var has = require('./_has'); +var cof = require('./_cof'); +var inheritIfRequired = require('./_inherit-if-required'); +var toPrimitive = require('./_to-primitive'); +var fails = require('./_fails'); +var gOPN = require('./_object-gopn').f; +var gOPD = require('./_object-gopd').f; +var dP = require('./_object-dp').f; +var $trim = require('./_string-trim').trim; +var NUMBER = 'Number'; +var $Number = global[NUMBER]; +var Base = $Number; +var proto = $Number.prototype; +// Opera ~12 has broken Object#toString +var BROKEN_COF = cof(require('./_object-create')(proto)) == NUMBER; +var TRIM = 'trim' in String.prototype; + +// 7.1.3 ToNumber(argument) +var toNumber = function (argument) { + var it = toPrimitive(argument, false); + if (typeof it == 'string' && it.length > 2) { + it = TRIM ? it.trim() : $trim(it, 3); + var first = it.charCodeAt(0); + var third, radix, maxCode; + if (first === 43 || first === 45) { + third = it.charCodeAt(2); + if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix + } else if (first === 48) { + switch (it.charCodeAt(1)) { + case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i + case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i + default: return +it; + } + for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) { + code = digits.charCodeAt(i); + // parseInt parses a string to a first unavailable symbol + // but ToNumber should return NaN if a string contains unavailable symbols + if (code < 48 || code > maxCode) return NaN; + } return parseInt(digits, radix); + } + } return +it; +}; + +if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) { + $Number = function Number(value) { + var it = arguments.length < 1 ? 0 : value; + var that = this; + return that instanceof $Number + // check on 1..constructor(foo) case + && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER) + ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it); + }; + for (var keys = require('./_descriptors') ? gOPN(Base) : ( + // ES3: + 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + + // ES6 (in case, if modules with ES6 Number statics required before): + 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + + 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' + ).split(','), j = 0, key; keys.length > j; j++) { + if (has(Base, key = keys[j]) && !has($Number, key)) { + dP($Number, key, gOPD(Base, key)); + } + } + $Number.prototype = proto; + proto.constructor = $Number; + require('./_redefine')(global, NUMBER, $Number); +} diff --git a/node_modules/core-js/modules/es6.number.epsilon.js b/node_modules/core-js/modules/es6.number.epsilon.js new file mode 100644 index 000000000..34a2ec5fa --- /dev/null +++ b/node_modules/core-js/modules/es6.number.epsilon.js @@ -0,0 +1,4 @@ +// 20.1.2.1 Number.EPSILON +var $export = require('./_export'); + +$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) }); diff --git a/node_modules/core-js/modules/es6.number.is-finite.js b/node_modules/core-js/modules/es6.number.is-finite.js new file mode 100644 index 000000000..8719da971 --- /dev/null +++ b/node_modules/core-js/modules/es6.number.is-finite.js @@ -0,0 +1,9 @@ +// 20.1.2.2 Number.isFinite(number) +var $export = require('./_export'); +var _isFinite = require('./_global').isFinite; + +$export($export.S, 'Number', { + isFinite: function isFinite(it) { + return typeof it == 'number' && _isFinite(it); + } +}); diff --git a/node_modules/core-js/modules/es6.number.is-integer.js b/node_modules/core-js/modules/es6.number.is-integer.js new file mode 100644 index 000000000..f1ab5dc4c --- /dev/null +++ b/node_modules/core-js/modules/es6.number.is-integer.js @@ -0,0 +1,4 @@ +// 20.1.2.3 Number.isInteger(number) +var $export = require('./_export'); + +$export($export.S, 'Number', { isInteger: require('./_is-integer') }); diff --git a/node_modules/core-js/modules/es6.number.is-nan.js b/node_modules/core-js/modules/es6.number.is-nan.js new file mode 100644 index 000000000..01d76ba28 --- /dev/null +++ b/node_modules/core-js/modules/es6.number.is-nan.js @@ -0,0 +1,9 @@ +// 20.1.2.4 Number.isNaN(number) +var $export = require('./_export'); + +$export($export.S, 'Number', { + isNaN: function isNaN(number) { + // eslint-disable-next-line no-self-compare + return number != number; + } +}); diff --git a/node_modules/core-js/modules/es6.number.is-safe-integer.js b/node_modules/core-js/modules/es6.number.is-safe-integer.js new file mode 100644 index 000000000..004e7d16f --- /dev/null +++ b/node_modules/core-js/modules/es6.number.is-safe-integer.js @@ -0,0 +1,10 @@ +// 20.1.2.5 Number.isSafeInteger(number) +var $export = require('./_export'); +var isInteger = require('./_is-integer'); +var abs = Math.abs; + +$export($export.S, 'Number', { + isSafeInteger: function isSafeInteger(number) { + return isInteger(number) && abs(number) <= 0x1fffffffffffff; + } +}); diff --git a/node_modules/core-js/modules/es6.number.max-safe-integer.js b/node_modules/core-js/modules/es6.number.max-safe-integer.js new file mode 100644 index 000000000..a4f248f1b --- /dev/null +++ b/node_modules/core-js/modules/es6.number.max-safe-integer.js @@ -0,0 +1,4 @@ +// 20.1.2.6 Number.MAX_SAFE_INTEGER +var $export = require('./_export'); + +$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); diff --git a/node_modules/core-js/modules/es6.number.min-safe-integer.js b/node_modules/core-js/modules/es6.number.min-safe-integer.js new file mode 100644 index 000000000..34df374bc --- /dev/null +++ b/node_modules/core-js/modules/es6.number.min-safe-integer.js @@ -0,0 +1,4 @@ +// 20.1.2.10 Number.MIN_SAFE_INTEGER +var $export = require('./_export'); + +$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff }); diff --git a/node_modules/core-js/modules/es6.number.parse-float.js b/node_modules/core-js/modules/es6.number.parse-float.js new file mode 100644 index 000000000..317c43109 --- /dev/null +++ b/node_modules/core-js/modules/es6.number.parse-float.js @@ -0,0 +1,4 @@ +var $export = require('./_export'); +var $parseFloat = require('./_parse-float'); +// 20.1.2.12 Number.parseFloat(string) +$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat }); diff --git a/node_modules/core-js/modules/es6.number.parse-int.js b/node_modules/core-js/modules/es6.number.parse-int.js new file mode 100644 index 000000000..cb48da28d --- /dev/null +++ b/node_modules/core-js/modules/es6.number.parse-int.js @@ -0,0 +1,4 @@ +var $export = require('./_export'); +var $parseInt = require('./_parse-int'); +// 20.1.2.13 Number.parseInt(string, radix) +$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt }); diff --git a/node_modules/core-js/modules/es6.number.to-fixed.js b/node_modules/core-js/modules/es6.number.to-fixed.js new file mode 100644 index 000000000..2bf78af91 --- /dev/null +++ b/node_modules/core-js/modules/es6.number.to-fixed.js @@ -0,0 +1,114 @@ +'use strict'; +var $export = require('./_export'); +var toInteger = require('./_to-integer'); +var aNumberValue = require('./_a-number-value'); +var repeat = require('./_string-repeat'); +var $toFixed = 1.0.toFixed; +var floor = Math.floor; +var data = [0, 0, 0, 0, 0, 0]; +var ERROR = 'Number.toFixed: incorrect invocation!'; +var ZERO = '0'; + +var multiply = function (n, c) { + var i = -1; + var c2 = c; + while (++i < 6) { + c2 += n * data[i]; + data[i] = c2 % 1e7; + c2 = floor(c2 / 1e7); + } +}; +var divide = function (n) { + var i = 6; + var c = 0; + while (--i >= 0) { + c += data[i]; + data[i] = floor(c / n); + c = (c % n) * 1e7; + } +}; +var numToString = function () { + var i = 6; + var s = ''; + while (--i >= 0) { + if (s !== '' || i === 0 || data[i] !== 0) { + var t = String(data[i]); + s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; + } + } return s; +}; +var pow = function (x, n, acc) { + return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); +}; +var log = function (x) { + var n = 0; + var x2 = x; + while (x2 >= 4096) { + n += 12; + x2 /= 4096; + } + while (x2 >= 2) { + n += 1; + x2 /= 2; + } return n; +}; + +$export($export.P + $export.F * (!!$toFixed && ( + 0.00008.toFixed(3) !== '0.000' || + 0.9.toFixed(0) !== '1' || + 1.255.toFixed(2) !== '1.25' || + 1000000000000000128.0.toFixed(0) !== '1000000000000000128' +) || !require('./_fails')(function () { + // V8 ~ Android 4.3- + $toFixed.call({}); +})), 'Number', { + toFixed: function toFixed(fractionDigits) { + var x = aNumberValue(this, ERROR); + var f = toInteger(fractionDigits); + var s = ''; + var m = ZERO; + var e, z, j, k; + if (f < 0 || f > 20) throw RangeError(ERROR); + // eslint-disable-next-line no-self-compare + if (x != x) return 'NaN'; + if (x <= -1e21 || x >= 1e21) return String(x); + if (x < 0) { + s = '-'; + x = -x; + } + if (x > 1e-21) { + e = log(x * pow(2, 69, 1)) - 69; + z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); + z *= 0x10000000000000; + e = 52 - e; + if (e > 0) { + multiply(0, z); + j = f; + while (j >= 7) { + multiply(1e7, 0); + j -= 7; + } + multiply(pow(10, j, 1), 0); + j = e - 1; + while (j >= 23) { + divide(1 << 23); + j -= 23; + } + divide(1 << j); + multiply(1, 1); + divide(2); + m = numToString(); + } else { + multiply(0, z); + multiply(1 << -e, 0); + m = numToString() + repeat.call(ZERO, f); + } + } + if (f > 0) { + k = m.length; + m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); + } else { + m = s + m; + } return m; + } +}); diff --git a/node_modules/core-js/modules/es6.number.to-precision.js b/node_modules/core-js/modules/es6.number.to-precision.js new file mode 100644 index 000000000..0d92527ff --- /dev/null +++ b/node_modules/core-js/modules/es6.number.to-precision.js @@ -0,0 +1,18 @@ +'use strict'; +var $export = require('./_export'); +var $fails = require('./_fails'); +var aNumberValue = require('./_a-number-value'); +var $toPrecision = 1.0.toPrecision; + +$export($export.P + $export.F * ($fails(function () { + // IE7- + return $toPrecision.call(1, undefined) !== '1'; +}) || !$fails(function () { + // V8 ~ Android 4.3- + $toPrecision.call({}); +})), 'Number', { + toPrecision: function toPrecision(precision) { + var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); + return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); + } +}); diff --git a/node_modules/core-js/modules/es6.object.assign.js b/node_modules/core-js/modules/es6.object.assign.js new file mode 100644 index 000000000..d28085a7e --- /dev/null +++ b/node_modules/core-js/modules/es6.object.assign.js @@ -0,0 +1,4 @@ +// 19.1.3.1 Object.assign(target, source) +var $export = require('./_export'); + +$export($export.S + $export.F, 'Object', { assign: require('./_object-assign') }); diff --git a/node_modules/core-js/modules/es6.object.create.js b/node_modules/core-js/modules/es6.object.create.js new file mode 100644 index 000000000..70627d69c --- /dev/null +++ b/node_modules/core-js/modules/es6.object.create.js @@ -0,0 +1,3 @@ +var $export = require('./_export'); +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +$export($export.S, 'Object', { create: require('./_object-create') }); diff --git a/node_modules/core-js/modules/es6.object.define-properties.js b/node_modules/core-js/modules/es6.object.define-properties.js new file mode 100644 index 000000000..5ec34214d --- /dev/null +++ b/node_modules/core-js/modules/es6.object.define-properties.js @@ -0,0 +1,3 @@ +var $export = require('./_export'); +// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) +$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperties: require('./_object-dps') }); diff --git a/node_modules/core-js/modules/es6.object.define-property.js b/node_modules/core-js/modules/es6.object.define-property.js new file mode 100644 index 000000000..120685825 --- /dev/null +++ b/node_modules/core-js/modules/es6.object.define-property.js @@ -0,0 +1,3 @@ +var $export = require('./_export'); +// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) +$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperty: require('./_object-dp').f }); diff --git a/node_modules/core-js/modules/es6.object.freeze.js b/node_modules/core-js/modules/es6.object.freeze.js new file mode 100644 index 000000000..0856ce9d7 --- /dev/null +++ b/node_modules/core-js/modules/es6.object.freeze.js @@ -0,0 +1,9 @@ +// 19.1.2.5 Object.freeze(O) +var isObject = require('./_is-object'); +var meta = require('./_meta').onFreeze; + +require('./_object-sap')('freeze', function ($freeze) { + return function freeze(it) { + return $freeze && isObject(it) ? $freeze(meta(it)) : it; + }; +}); diff --git a/node_modules/core-js/modules/es6.object.get-own-property-descriptor.js b/node_modules/core-js/modules/es6.object.get-own-property-descriptor.js new file mode 100644 index 000000000..9df214172 --- /dev/null +++ b/node_modules/core-js/modules/es6.object.get-own-property-descriptor.js @@ -0,0 +1,9 @@ +// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) +var toIObject = require('./_to-iobject'); +var $getOwnPropertyDescriptor = require('./_object-gopd').f; + +require('./_object-sap')('getOwnPropertyDescriptor', function () { + return function getOwnPropertyDescriptor(it, key) { + return $getOwnPropertyDescriptor(toIObject(it), key); + }; +}); diff --git a/node_modules/core-js/modules/es6.object.get-own-property-names.js b/node_modules/core-js/modules/es6.object.get-own-property-names.js new file mode 100644 index 000000000..172f51c73 --- /dev/null +++ b/node_modules/core-js/modules/es6.object.get-own-property-names.js @@ -0,0 +1,4 @@ +// 19.1.2.7 Object.getOwnPropertyNames(O) +require('./_object-sap')('getOwnPropertyNames', function () { + return require('./_object-gopn-ext').f; +}); diff --git a/node_modules/core-js/modules/es6.object.get-prototype-of.js b/node_modules/core-js/modules/es6.object.get-prototype-of.js new file mode 100644 index 000000000..8fe2728c0 --- /dev/null +++ b/node_modules/core-js/modules/es6.object.get-prototype-of.js @@ -0,0 +1,9 @@ +// 19.1.2.9 Object.getPrototypeOf(O) +var toObject = require('./_to-object'); +var $getPrototypeOf = require('./_object-gpo'); + +require('./_object-sap')('getPrototypeOf', function () { + return function getPrototypeOf(it) { + return $getPrototypeOf(toObject(it)); + }; +}); diff --git a/node_modules/core-js/modules/es6.object.is-extensible.js b/node_modules/core-js/modules/es6.object.is-extensible.js new file mode 100644 index 000000000..5cd4575a5 --- /dev/null +++ b/node_modules/core-js/modules/es6.object.is-extensible.js @@ -0,0 +1,8 @@ +// 19.1.2.11 Object.isExtensible(O) +var isObject = require('./_is-object'); + +require('./_object-sap')('isExtensible', function ($isExtensible) { + return function isExtensible(it) { + return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; + }; +}); diff --git a/node_modules/core-js/modules/es6.object.is-frozen.js b/node_modules/core-js/modules/es6.object.is-frozen.js new file mode 100644 index 000000000..0ceeabbb0 --- /dev/null +++ b/node_modules/core-js/modules/es6.object.is-frozen.js @@ -0,0 +1,8 @@ +// 19.1.2.12 Object.isFrozen(O) +var isObject = require('./_is-object'); + +require('./_object-sap')('isFrozen', function ($isFrozen) { + return function isFrozen(it) { + return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; + }; +}); diff --git a/node_modules/core-js/modules/es6.object.is-sealed.js b/node_modules/core-js/modules/es6.object.is-sealed.js new file mode 100644 index 000000000..7fa8ddedd --- /dev/null +++ b/node_modules/core-js/modules/es6.object.is-sealed.js @@ -0,0 +1,8 @@ +// 19.1.2.13 Object.isSealed(O) +var isObject = require('./_is-object'); + +require('./_object-sap')('isSealed', function ($isSealed) { + return function isSealed(it) { + return isObject(it) ? $isSealed ? $isSealed(it) : false : true; + }; +}); diff --git a/node_modules/core-js/modules/es6.object.is.js b/node_modules/core-js/modules/es6.object.is.js new file mode 100644 index 000000000..204d7030f --- /dev/null +++ b/node_modules/core-js/modules/es6.object.is.js @@ -0,0 +1,3 @@ +// 19.1.3.10 Object.is(value1, value2) +var $export = require('./_export'); +$export($export.S, 'Object', { is: require('./_same-value') }); diff --git a/node_modules/core-js/modules/es6.object.keys.js b/node_modules/core-js/modules/es6.object.keys.js new file mode 100644 index 000000000..e9dade7de --- /dev/null +++ b/node_modules/core-js/modules/es6.object.keys.js @@ -0,0 +1,9 @@ +// 19.1.2.14 Object.keys(O) +var toObject = require('./_to-object'); +var $keys = require('./_object-keys'); + +require('./_object-sap')('keys', function () { + return function keys(it) { + return $keys(toObject(it)); + }; +}); diff --git a/node_modules/core-js/modules/es6.object.prevent-extensions.js b/node_modules/core-js/modules/es6.object.prevent-extensions.js new file mode 100644 index 000000000..2f729181f --- /dev/null +++ b/node_modules/core-js/modules/es6.object.prevent-extensions.js @@ -0,0 +1,9 @@ +// 19.1.2.15 Object.preventExtensions(O) +var isObject = require('./_is-object'); +var meta = require('./_meta').onFreeze; + +require('./_object-sap')('preventExtensions', function ($preventExtensions) { + return function preventExtensions(it) { + return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; + }; +}); diff --git a/node_modules/core-js/modules/es6.object.seal.js b/node_modules/core-js/modules/es6.object.seal.js new file mode 100644 index 000000000..12c3f6a3a --- /dev/null +++ b/node_modules/core-js/modules/es6.object.seal.js @@ -0,0 +1,9 @@ +// 19.1.2.17 Object.seal(O) +var isObject = require('./_is-object'); +var meta = require('./_meta').onFreeze; + +require('./_object-sap')('seal', function ($seal) { + return function seal(it) { + return $seal && isObject(it) ? $seal(meta(it)) : it; + }; +}); diff --git a/node_modules/core-js/modules/es6.object.set-prototype-of.js b/node_modules/core-js/modules/es6.object.set-prototype-of.js new file mode 100644 index 000000000..461dbd2ed --- /dev/null +++ b/node_modules/core-js/modules/es6.object.set-prototype-of.js @@ -0,0 +1,3 @@ +// 19.1.3.19 Object.setPrototypeOf(O, proto) +var $export = require('./_export'); +$export($export.S, 'Object', { setPrototypeOf: require('./_set-proto').set }); diff --git a/node_modules/core-js/modules/es6.object.to-string.js b/node_modules/core-js/modules/es6.object.to-string.js new file mode 100644 index 000000000..1c7b85feb --- /dev/null +++ b/node_modules/core-js/modules/es6.object.to-string.js @@ -0,0 +1,10 @@ +'use strict'; +// 19.1.3.6 Object.prototype.toString() +var classof = require('./_classof'); +var test = {}; +test[require('./_wks')('toStringTag')] = 'z'; +if (test + '' != '[object z]') { + require('./_redefine')(Object.prototype, 'toString', function toString() { + return '[object ' + classof(this) + ']'; + }, true); +} diff --git a/node_modules/core-js/modules/es6.parse-float.js b/node_modules/core-js/modules/es6.parse-float.js new file mode 100644 index 000000000..cbf50ead5 --- /dev/null +++ b/node_modules/core-js/modules/es6.parse-float.js @@ -0,0 +1,4 @@ +var $export = require('./_export'); +var $parseFloat = require('./_parse-float'); +// 18.2.4 parseFloat(string) +$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat }); diff --git a/node_modules/core-js/modules/es6.parse-int.js b/node_modules/core-js/modules/es6.parse-int.js new file mode 100644 index 000000000..7ea358e84 --- /dev/null +++ b/node_modules/core-js/modules/es6.parse-int.js @@ -0,0 +1,4 @@ +var $export = require('./_export'); +var $parseInt = require('./_parse-int'); +// 18.2.5 parseInt(string, radix) +$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt }); diff --git a/node_modules/core-js/modules/es6.promise.js b/node_modules/core-js/modules/es6.promise.js new file mode 100644 index 000000000..b0ff3bfcf --- /dev/null +++ b/node_modules/core-js/modules/es6.promise.js @@ -0,0 +1,286 @@ +'use strict'; +var LIBRARY = require('./_library'); +var global = require('./_global'); +var ctx = require('./_ctx'); +var classof = require('./_classof'); +var $export = require('./_export'); +var isObject = require('./_is-object'); +var aFunction = require('./_a-function'); +var anInstance = require('./_an-instance'); +var forOf = require('./_for-of'); +var speciesConstructor = require('./_species-constructor'); +var task = require('./_task').set; +var microtask = require('./_microtask')(); +var newPromiseCapabilityModule = require('./_new-promise-capability'); +var perform = require('./_perform'); +var userAgent = require('./_user-agent'); +var promiseResolve = require('./_promise-resolve'); +var PROMISE = 'Promise'; +var TypeError = global.TypeError; +var process = global.process; +var versions = process && process.versions; +var v8 = versions && versions.v8 || ''; +var $Promise = global[PROMISE]; +var isNode = classof(process) == 'process'; +var empty = function () { /* empty */ }; +var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; +var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; + +var USE_NATIVE = !!function () { + try { + // correct subclassing with @@species support + var promise = $Promise.resolve(1); + var FakePromise = (promise.constructor = {})[require('./_wks')('species')] = function (exec) { + exec(empty, empty); + }; + // unhandled rejections tracking support, NodeJS Promise without it fails @@species test + return (isNode || typeof PromiseRejectionEvent == 'function') + && promise.then(empty) instanceof FakePromise + // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables + // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 + // we can't detect it synchronously, so just check versions + && v8.indexOf('6.6') !== 0 + && userAgent.indexOf('Chrome/66') === -1; + } catch (e) { /* empty */ } +}(); + +// helpers +var isThenable = function (it) { + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; +}; +var notify = function (promise, isReject) { + if (promise._n) return; + promise._n = true; + var chain = promise._c; + microtask(function () { + var value = promise._v; + var ok = promise._s == 1; + var i = 0; + var run = function (reaction) { + var handler = ok ? reaction.ok : reaction.fail; + var resolve = reaction.resolve; + var reject = reaction.reject; + var domain = reaction.domain; + var result, then, exited; + try { + if (handler) { + if (!ok) { + if (promise._h == 2) onHandleUnhandled(promise); + promise._h = 1; + } + if (handler === true) result = value; + else { + if (domain) domain.enter(); + result = handler(value); // may throw + if (domain) { + domain.exit(); + exited = true; + } + } + if (result === reaction.promise) { + reject(TypeError('Promise-chain cycle')); + } else if (then = isThenable(result)) { + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch (e) { + if (domain && !exited) domain.exit(); + reject(e); + } + }; + while (chain.length > i) run(chain[i++]); // variable length - can't use forEach + promise._c = []; + promise._n = false; + if (isReject && !promise._h) onUnhandled(promise); + }); +}; +var onUnhandled = function (promise) { + task.call(global, function () { + var value = promise._v; + var unhandled = isUnhandled(promise); + var result, handler, console; + if (unhandled) { + result = perform(function () { + if (isNode) { + process.emit('unhandledRejection', value, promise); + } else if (handler = global.onunhandledrejection) { + handler({ promise: promise, reason: value }); + } else if ((console = global.console) && console.error) { + console.error('Unhandled promise rejection', value); + } + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + promise._h = isNode || isUnhandled(promise) ? 2 : 1; + } promise._a = undefined; + if (unhandled && result.e) throw result.v; + }); +}; +var isUnhandled = function (promise) { + return promise._h !== 1 && (promise._a || promise._c).length === 0; +}; +var onHandleUnhandled = function (promise) { + task.call(global, function () { + var handler; + if (isNode) { + process.emit('rejectionHandled', promise); + } else if (handler = global.onrejectionhandled) { + handler({ promise: promise, reason: promise._v }); + } + }); +}; +var $reject = function (value) { + var promise = this; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + promise._v = value; + promise._s = 2; + if (!promise._a) promise._a = promise._c.slice(); + notify(promise, true); +}; +var $resolve = function (value) { + var promise = this; + var then; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + try { + if (promise === value) throw TypeError("Promise can't be resolved itself"); + if (then = isThenable(value)) { + microtask(function () { + var wrapper = { _w: promise, _d: false }; // wrap + try { + then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); + } catch (e) { + $reject.call(wrapper, e); + } + }); + } else { + promise._v = value; + promise._s = 1; + notify(promise, false); + } + } catch (e) { + $reject.call({ _w: promise, _d: false }, e); // wrap + } +}; + +// constructor polyfill +if (!USE_NATIVE) { + // 25.4.3.1 Promise(executor) + $Promise = function Promise(executor) { + anInstance(this, $Promise, PROMISE, '_h'); + aFunction(executor); + Internal.call(this); + try { + executor(ctx($resolve, this, 1), ctx($reject, this, 1)); + } catch (err) { + $reject.call(this, err); + } + }; + // eslint-disable-next-line no-unused-vars + Internal = function Promise(executor) { + this._c = []; // <- awaiting reactions + this._a = undefined; // <- checked in isUnhandled reactions + this._s = 0; // <- state + this._d = false; // <- done + this._v = undefined; // <- value + this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled + this._n = false; // <- notify + }; + Internal.prototype = require('./_redefine-all')($Promise.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected) { + var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = isNode ? process.domain : undefined; + this._c.push(reaction); + if (this._a) this._a.push(reaction); + if (this._s) notify(this, false); + return reaction.promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function (onRejected) { + return this.then(undefined, onRejected); + } + }); + OwnPromiseCapability = function () { + var promise = new Internal(); + this.promise = promise; + this.resolve = ctx($resolve, promise, 1); + this.reject = ctx($reject, promise, 1); + }; + newPromiseCapabilityModule.f = newPromiseCapability = function (C) { + return C === $Promise || C === Wrapper + ? new OwnPromiseCapability(C) + : newGenericPromiseCapability(C); + }; +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); +require('./_set-to-string-tag')($Promise, PROMISE); +require('./_set-species')(PROMISE); +Wrapper = require('./_core')[PROMISE]; + +// statics +$export($export.S + $export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r) { + var capability = newPromiseCapability(this); + var $$reject = capability.reject; + $$reject(r); + return capability.promise; + } +}); +$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x) { + return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); + } +}); +$export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(function (iter) { + $Promise.all(iter)['catch'](empty); +})), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var resolve = capability.resolve; + var reject = capability.reject; + var result = perform(function () { + var values = []; + var index = 0; + var remaining = 1; + forOf(iterable, false, function (promise) { + var $index = index++; + var alreadyCalled = false; + values.push(undefined); + remaining++; + C.resolve(promise).then(function (value) { + if (alreadyCalled) return; + alreadyCalled = true; + values[$index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if (result.e) reject(result.v); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var reject = capability.reject; + var result = perform(function () { + forOf(iterable, false, function (promise) { + C.resolve(promise).then(capability.resolve, reject); + }); + }); + if (result.e) reject(result.v); + return capability.promise; + } +}); diff --git a/node_modules/core-js/modules/es6.reflect.apply.js b/node_modules/core-js/modules/es6.reflect.apply.js new file mode 100644 index 000000000..3b9c03a91 --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.apply.js @@ -0,0 +1,16 @@ +// 26.1.1 Reflect.apply(target, thisArgument, argumentsList) +var $export = require('./_export'); +var aFunction = require('./_a-function'); +var anObject = require('./_an-object'); +var rApply = (require('./_global').Reflect || {}).apply; +var fApply = Function.apply; +// MS Edge argumentsList argument is optional +$export($export.S + $export.F * !require('./_fails')(function () { + rApply(function () { /* empty */ }); +}), 'Reflect', { + apply: function apply(target, thisArgument, argumentsList) { + var T = aFunction(target); + var L = anObject(argumentsList); + return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); + } +}); diff --git a/node_modules/core-js/modules/es6.reflect.construct.js b/node_modules/core-js/modules/es6.reflect.construct.js new file mode 100644 index 000000000..380addb57 --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.construct.js @@ -0,0 +1,47 @@ +// 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) +var $export = require('./_export'); +var create = require('./_object-create'); +var aFunction = require('./_a-function'); +var anObject = require('./_an-object'); +var isObject = require('./_is-object'); +var fails = require('./_fails'); +var bind = require('./_bind'); +var rConstruct = (require('./_global').Reflect || {}).construct; + +// MS Edge supports only 2 arguments and argumentsList argument is optional +// FF Nightly sets third argument as `new.target`, but does not create `this` from it +var NEW_TARGET_BUG = fails(function () { + function F() { /* empty */ } + return !(rConstruct(function () { /* empty */ }, [], F) instanceof F); +}); +var ARGS_BUG = !fails(function () { + rConstruct(function () { /* empty */ }); +}); + +$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { + construct: function construct(Target, args /* , newTarget */) { + aFunction(Target); + anObject(args); + var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); + if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget); + if (Target == newTarget) { + // w/o altered newTarget, optimization for 0-4 arguments + switch (args.length) { + case 0: return new Target(); + case 1: return new Target(args[0]); + case 2: return new Target(args[0], args[1]); + case 3: return new Target(args[0], args[1], args[2]); + case 4: return new Target(args[0], args[1], args[2], args[3]); + } + // w/o altered newTarget, lot of arguments case + var $args = [null]; + $args.push.apply($args, args); + return new (bind.apply(Target, $args))(); + } + // with altered newTarget, not support built-in constructors + var proto = newTarget.prototype; + var instance = create(isObject(proto) ? proto : Object.prototype); + var result = Function.apply.call(Target, instance, args); + return isObject(result) ? result : instance; + } +}); diff --git a/node_modules/core-js/modules/es6.reflect.define-property.js b/node_modules/core-js/modules/es6.reflect.define-property.js new file mode 100644 index 000000000..be7fbde6b --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.define-property.js @@ -0,0 +1,23 @@ +// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) +var dP = require('./_object-dp'); +var $export = require('./_export'); +var anObject = require('./_an-object'); +var toPrimitive = require('./_to-primitive'); + +// MS Edge has broken Reflect.defineProperty - throwing instead of returning false +$export($export.S + $export.F * require('./_fails')(function () { + // eslint-disable-next-line no-undef + Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 }); +}), 'Reflect', { + defineProperty: function defineProperty(target, propertyKey, attributes) { + anObject(target); + propertyKey = toPrimitive(propertyKey, true); + anObject(attributes); + try { + dP.f(target, propertyKey, attributes); + return true; + } catch (e) { + return false; + } + } +}); diff --git a/node_modules/core-js/modules/es6.reflect.delete-property.js b/node_modules/core-js/modules/es6.reflect.delete-property.js new file mode 100644 index 000000000..0902b38a9 --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.delete-property.js @@ -0,0 +1,11 @@ +// 26.1.4 Reflect.deleteProperty(target, propertyKey) +var $export = require('./_export'); +var gOPD = require('./_object-gopd').f; +var anObject = require('./_an-object'); + +$export($export.S, 'Reflect', { + deleteProperty: function deleteProperty(target, propertyKey) { + var desc = gOPD(anObject(target), propertyKey); + return desc && !desc.configurable ? false : delete target[propertyKey]; + } +}); diff --git a/node_modules/core-js/modules/es6.reflect.enumerate.js b/node_modules/core-js/modules/es6.reflect.enumerate.js new file mode 100644 index 000000000..9e7c76a34 --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.enumerate.js @@ -0,0 +1,26 @@ +'use strict'; +// 26.1.5 Reflect.enumerate(target) +var $export = require('./_export'); +var anObject = require('./_an-object'); +var Enumerate = function (iterated) { + this._t = anObject(iterated); // target + this._i = 0; // next index + var keys = this._k = []; // keys + var key; + for (key in iterated) keys.push(key); +}; +require('./_iter-create')(Enumerate, 'Object', function () { + var that = this; + var keys = that._k; + var key; + do { + if (that._i >= keys.length) return { value: undefined, done: true }; + } while (!((key = keys[that._i++]) in that._t)); + return { value: key, done: false }; +}); + +$export($export.S, 'Reflect', { + enumerate: function enumerate(target) { + return new Enumerate(target); + } +}); diff --git a/node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js b/node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js new file mode 100644 index 000000000..e1299f906 --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js @@ -0,0 +1,10 @@ +// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) +var gOPD = require('./_object-gopd'); +var $export = require('./_export'); +var anObject = require('./_an-object'); + +$export($export.S, 'Reflect', { + getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { + return gOPD.f(anObject(target), propertyKey); + } +}); diff --git a/node_modules/core-js/modules/es6.reflect.get-prototype-of.js b/node_modules/core-js/modules/es6.reflect.get-prototype-of.js new file mode 100644 index 000000000..28351d410 --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.get-prototype-of.js @@ -0,0 +1,10 @@ +// 26.1.8 Reflect.getPrototypeOf(target) +var $export = require('./_export'); +var getProto = require('./_object-gpo'); +var anObject = require('./_an-object'); + +$export($export.S, 'Reflect', { + getPrototypeOf: function getPrototypeOf(target) { + return getProto(anObject(target)); + } +}); diff --git a/node_modules/core-js/modules/es6.reflect.get.js b/node_modules/core-js/modules/es6.reflect.get.js new file mode 100644 index 000000000..a7ee76667 --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.get.js @@ -0,0 +1,21 @@ +// 26.1.6 Reflect.get(target, propertyKey [, receiver]) +var gOPD = require('./_object-gopd'); +var getPrototypeOf = require('./_object-gpo'); +var has = require('./_has'); +var $export = require('./_export'); +var isObject = require('./_is-object'); +var anObject = require('./_an-object'); + +function get(target, propertyKey /* , receiver */) { + var receiver = arguments.length < 3 ? target : arguments[2]; + var desc, proto; + if (anObject(target) === receiver) return target[propertyKey]; + if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value') + ? desc.value + : desc.get !== undefined + ? desc.get.call(receiver) + : undefined; + if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver); +} + +$export($export.S, 'Reflect', { get: get }); diff --git a/node_modules/core-js/modules/es6.reflect.has.js b/node_modules/core-js/modules/es6.reflect.has.js new file mode 100644 index 000000000..4f5efa992 --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.has.js @@ -0,0 +1,8 @@ +// 26.1.9 Reflect.has(target, propertyKey) +var $export = require('./_export'); + +$export($export.S, 'Reflect', { + has: function has(target, propertyKey) { + return propertyKey in target; + } +}); diff --git a/node_modules/core-js/modules/es6.reflect.is-extensible.js b/node_modules/core-js/modules/es6.reflect.is-extensible.js new file mode 100644 index 000000000..700f938ac --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.is-extensible.js @@ -0,0 +1,11 @@ +// 26.1.10 Reflect.isExtensible(target) +var $export = require('./_export'); +var anObject = require('./_an-object'); +var $isExtensible = Object.isExtensible; + +$export($export.S, 'Reflect', { + isExtensible: function isExtensible(target) { + anObject(target); + return $isExtensible ? $isExtensible(target) : true; + } +}); diff --git a/node_modules/core-js/modules/es6.reflect.own-keys.js b/node_modules/core-js/modules/es6.reflect.own-keys.js new file mode 100644 index 000000000..9f2424ae8 --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.own-keys.js @@ -0,0 +1,4 @@ +// 26.1.11 Reflect.ownKeys(target) +var $export = require('./_export'); + +$export($export.S, 'Reflect', { ownKeys: require('./_own-keys') }); diff --git a/node_modules/core-js/modules/es6.reflect.prevent-extensions.js b/node_modules/core-js/modules/es6.reflect.prevent-extensions.js new file mode 100644 index 000000000..e1037fa19 --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.prevent-extensions.js @@ -0,0 +1,16 @@ +// 26.1.12 Reflect.preventExtensions(target) +var $export = require('./_export'); +var anObject = require('./_an-object'); +var $preventExtensions = Object.preventExtensions; + +$export($export.S, 'Reflect', { + preventExtensions: function preventExtensions(target) { + anObject(target); + try { + if ($preventExtensions) $preventExtensions(target); + return true; + } catch (e) { + return false; + } + } +}); diff --git a/node_modules/core-js/modules/es6.reflect.set-prototype-of.js b/node_modules/core-js/modules/es6.reflect.set-prototype-of.js new file mode 100644 index 000000000..5dae90122 --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.set-prototype-of.js @@ -0,0 +1,15 @@ +// 26.1.14 Reflect.setPrototypeOf(target, proto) +var $export = require('./_export'); +var setProto = require('./_set-proto'); + +if (setProto) $export($export.S, 'Reflect', { + setPrototypeOf: function setPrototypeOf(target, proto) { + setProto.check(target, proto); + try { + setProto.set(target, proto); + return true; + } catch (e) { + return false; + } + } +}); diff --git a/node_modules/core-js/modules/es6.reflect.set.js b/node_modules/core-js/modules/es6.reflect.set.js new file mode 100644 index 000000000..d809d7a4e --- /dev/null +++ b/node_modules/core-js/modules/es6.reflect.set.js @@ -0,0 +1,33 @@ +// 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) +var dP = require('./_object-dp'); +var gOPD = require('./_object-gopd'); +var getPrototypeOf = require('./_object-gpo'); +var has = require('./_has'); +var $export = require('./_export'); +var createDesc = require('./_property-desc'); +var anObject = require('./_an-object'); +var isObject = require('./_is-object'); + +function set(target, propertyKey, V /* , receiver */) { + var receiver = arguments.length < 4 ? target : arguments[3]; + var ownDesc = gOPD.f(anObject(target), propertyKey); + var existingDescriptor, proto; + if (!ownDesc) { + if (isObject(proto = getPrototypeOf(target))) { + return set(proto, propertyKey, V, receiver); + } + ownDesc = createDesc(0); + } + if (has(ownDesc, 'value')) { + if (ownDesc.writable === false || !isObject(receiver)) return false; + if (existingDescriptor = gOPD.f(receiver, propertyKey)) { + if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false; + existingDescriptor.value = V; + dP.f(receiver, propertyKey, existingDescriptor); + } else dP.f(receiver, propertyKey, createDesc(0, V)); + return true; + } + return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); +} + +$export($export.S, 'Reflect', { set: set }); diff --git a/node_modules/core-js/modules/es6.regexp.constructor.js b/node_modules/core-js/modules/es6.regexp.constructor.js new file mode 100644 index 000000000..76247c32f --- /dev/null +++ b/node_modules/core-js/modules/es6.regexp.constructor.js @@ -0,0 +1,43 @@ +var global = require('./_global'); +var inheritIfRequired = require('./_inherit-if-required'); +var dP = require('./_object-dp').f; +var gOPN = require('./_object-gopn').f; +var isRegExp = require('./_is-regexp'); +var $flags = require('./_flags'); +var $RegExp = global.RegExp; +var Base = $RegExp; +var proto = $RegExp.prototype; +var re1 = /a/g; +var re2 = /a/g; +// "new" creates a new object, old webkit buggy here +var CORRECT_NEW = new $RegExp(re1) !== re1; + +if (require('./_descriptors') && (!CORRECT_NEW || require('./_fails')(function () { + re2[require('./_wks')('match')] = false; + // RegExp constructor can alter flags and IsRegExp works correct with @@match + return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i'; +}))) { + $RegExp = function RegExp(p, f) { + var tiRE = this instanceof $RegExp; + var piRE = isRegExp(p); + var fiU = f === undefined; + return !tiRE && piRE && p.constructor === $RegExp && fiU ? p + : inheritIfRequired(CORRECT_NEW + ? new Base(piRE && !fiU ? p.source : p, f) + : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f) + , tiRE ? this : proto, $RegExp); + }; + var proxy = function (key) { + key in $RegExp || dP($RegExp, key, { + configurable: true, + get: function () { return Base[key]; }, + set: function (it) { Base[key] = it; } + }); + }; + for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]); + proto.constructor = $RegExp; + $RegExp.prototype = proto; + require('./_redefine')(global, 'RegExp', $RegExp); +} + +require('./_set-species')('RegExp'); diff --git a/node_modules/core-js/modules/es6.regexp.flags.js b/node_modules/core-js/modules/es6.regexp.flags.js new file mode 100644 index 000000000..47008680b --- /dev/null +++ b/node_modules/core-js/modules/es6.regexp.flags.js @@ -0,0 +1,5 @@ +// 21.2.5.3 get RegExp.prototype.flags() +if (require('./_descriptors') && /./g.flags != 'g') require('./_object-dp').f(RegExp.prototype, 'flags', { + configurable: true, + get: require('./_flags') +}); diff --git a/node_modules/core-js/modules/es6.regexp.match.js b/node_modules/core-js/modules/es6.regexp.match.js new file mode 100644 index 000000000..4f71de091 --- /dev/null +++ b/node_modules/core-js/modules/es6.regexp.match.js @@ -0,0 +1,10 @@ +// @@match logic +require('./_fix-re-wks')('match', 1, function (defined, MATCH, $match) { + // 21.1.3.11 String.prototype.match(regexp) + return [function match(regexp) { + 'use strict'; + var O = defined(this); + var fn = regexp == undefined ? undefined : regexp[MATCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); + }, $match]; +}); diff --git a/node_modules/core-js/modules/es6.regexp.replace.js b/node_modules/core-js/modules/es6.regexp.replace.js new file mode 100644 index 000000000..75ce2df74 --- /dev/null +++ b/node_modules/core-js/modules/es6.regexp.replace.js @@ -0,0 +1,12 @@ +// @@replace logic +require('./_fix-re-wks')('replace', 2, function (defined, REPLACE, $replace) { + // 21.1.3.14 String.prototype.replace(searchValue, replaceValue) + return [function replace(searchValue, replaceValue) { + 'use strict'; + var O = defined(this); + var fn = searchValue == undefined ? undefined : searchValue[REPLACE]; + return fn !== undefined + ? fn.call(searchValue, O, replaceValue) + : $replace.call(String(O), searchValue, replaceValue); + }, $replace]; +}); diff --git a/node_modules/core-js/modules/es6.regexp.search.js b/node_modules/core-js/modules/es6.regexp.search.js new file mode 100644 index 000000000..df80ed9af --- /dev/null +++ b/node_modules/core-js/modules/es6.regexp.search.js @@ -0,0 +1,10 @@ +// @@search logic +require('./_fix-re-wks')('search', 1, function (defined, SEARCH, $search) { + // 21.1.3.15 String.prototype.search(regexp) + return [function search(regexp) { + 'use strict'; + var O = defined(this); + var fn = regexp == undefined ? undefined : regexp[SEARCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); + }, $search]; +}); diff --git a/node_modules/core-js/modules/es6.regexp.split.js b/node_modules/core-js/modules/es6.regexp.split.js new file mode 100644 index 000000000..ce796b384 --- /dev/null +++ b/node_modules/core-js/modules/es6.regexp.split.js @@ -0,0 +1,71 @@ +// @@split logic +require('./_fix-re-wks')('split', 2, function (defined, SPLIT, $split) { + 'use strict'; + var isRegExp = require('./_is-regexp'); + var _split = $split; + var $push = [].push; + var $SPLIT = 'split'; + var LENGTH = 'length'; + var LAST_INDEX = 'lastIndex'; + if ( + 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || + 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || + 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || + '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || + '.'[$SPLIT](/()()/)[LENGTH] > 1 || + ''[$SPLIT](/.?/)[LENGTH] + ) { + var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group + // based on es5-shim implementation, need to rework it + $split = function (separator, limit) { + var string = String(this); + if (separator === undefined && limit === 0) return []; + // If `separator` is not a regex, use native split + if (!isRegExp(separator)) return _split.call(string, separator, limit); + var output = []; + var flags = (separator.ignoreCase ? 'i' : '') + + (separator.multiline ? 'm' : '') + + (separator.unicode ? 'u' : '') + + (separator.sticky ? 'y' : ''); + var lastLastIndex = 0; + var splitLimit = limit === undefined ? 4294967295 : limit >>> 0; + // Make `global` and avoid `lastIndex` issues by working with a copy + var separatorCopy = new RegExp(separator.source, flags + 'g'); + var separator2, match, lastIndex, lastLength, i; + // Doesn't need flags gy, but they don't hurt + if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags); + while (match = separatorCopy.exec(string)) { + // `separatorCopy.lastIndex` is not reliable cross-browser + lastIndex = match.index + match[0][LENGTH]; + if (lastIndex > lastLastIndex) { + output.push(string.slice(lastLastIndex, match.index)); + // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG + // eslint-disable-next-line no-loop-func + if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () { + for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined; + }); + if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1)); + lastLength = match[0][LENGTH]; + lastLastIndex = lastIndex; + if (output[LENGTH] >= splitLimit) break; + } + if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop + } + if (lastLastIndex === string[LENGTH]) { + if (lastLength || !separatorCopy.test('')) output.push(''); + } else output.push(string.slice(lastLastIndex)); + return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; + }; + // Chakra, V8 + } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) { + $split = function (separator, limit) { + return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit); + }; + } + // 21.1.3.17 String.prototype.split(separator, limit) + return [function split(separator, limit) { + var O = defined(this); + var fn = separator == undefined ? undefined : separator[SPLIT]; + return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit); + }, $split]; +}); diff --git a/node_modules/core-js/modules/es6.regexp.to-string.js b/node_modules/core-js/modules/es6.regexp.to-string.js new file mode 100644 index 000000000..33d6e6fe3 --- /dev/null +++ b/node_modules/core-js/modules/es6.regexp.to-string.js @@ -0,0 +1,25 @@ +'use strict'; +require('./es6.regexp.flags'); +var anObject = require('./_an-object'); +var $flags = require('./_flags'); +var DESCRIPTORS = require('./_descriptors'); +var TO_STRING = 'toString'; +var $toString = /./[TO_STRING]; + +var define = function (fn) { + require('./_redefine')(RegExp.prototype, TO_STRING, fn, true); +}; + +// 21.2.5.14 RegExp.prototype.toString() +if (require('./_fails')(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) { + define(function toString() { + var R = anObject(this); + return '/'.concat(R.source, '/', + 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined); + }); +// FF44- RegExp#toString has a wrong name +} else if ($toString.name != TO_STRING) { + define(function toString() { + return $toString.call(this); + }); +} diff --git a/node_modules/core-js/modules/es6.set.js b/node_modules/core-js/modules/es6.set.js new file mode 100644 index 000000000..55b8bdd89 --- /dev/null +++ b/node_modules/core-js/modules/es6.set.js @@ -0,0 +1,14 @@ +'use strict'; +var strong = require('./_collection-strong'); +var validate = require('./_validate-collection'); +var SET = 'Set'; + +// 23.2 Set Objects +module.exports = require('./_collection')(SET, function (get) { + return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value) { + return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value); + } +}, strong); diff --git a/node_modules/core-js/modules/es6.string.anchor.js b/node_modules/core-js/modules/es6.string.anchor.js new file mode 100644 index 000000000..3493e54c0 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.anchor.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.2 String.prototype.anchor(name) +require('./_string-html')('anchor', function (createHTML) { + return function anchor(name) { + return createHTML(this, 'a', 'name', name); + }; +}); diff --git a/node_modules/core-js/modules/es6.string.big.js b/node_modules/core-js/modules/es6.string.big.js new file mode 100644 index 000000000..38aab3414 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.big.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.3 String.prototype.big() +require('./_string-html')('big', function (createHTML) { + return function big() { + return createHTML(this, 'big', '', ''); + }; +}); diff --git a/node_modules/core-js/modules/es6.string.blink.js b/node_modules/core-js/modules/es6.string.blink.js new file mode 100644 index 000000000..6188d96e3 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.blink.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.4 String.prototype.blink() +require('./_string-html')('blink', function (createHTML) { + return function blink() { + return createHTML(this, 'blink', '', ''); + }; +}); diff --git a/node_modules/core-js/modules/es6.string.bold.js b/node_modules/core-js/modules/es6.string.bold.js new file mode 100644 index 000000000..ff3ecb9cb --- /dev/null +++ b/node_modules/core-js/modules/es6.string.bold.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.5 String.prototype.bold() +require('./_string-html')('bold', function (createHTML) { + return function bold() { + return createHTML(this, 'b', '', ''); + }; +}); diff --git a/node_modules/core-js/modules/es6.string.code-point-at.js b/node_modules/core-js/modules/es6.string.code-point-at.js new file mode 100644 index 000000000..e39b8c5ea --- /dev/null +++ b/node_modules/core-js/modules/es6.string.code-point-at.js @@ -0,0 +1,9 @@ +'use strict'; +var $export = require('./_export'); +var $at = require('./_string-at')(false); +$export($export.P, 'String', { + // 21.1.3.3 String.prototype.codePointAt(pos) + codePointAt: function codePointAt(pos) { + return $at(this, pos); + } +}); diff --git a/node_modules/core-js/modules/es6.string.ends-with.js b/node_modules/core-js/modules/es6.string.ends-with.js new file mode 100644 index 000000000..065688884 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.ends-with.js @@ -0,0 +1,20 @@ +// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) +'use strict'; +var $export = require('./_export'); +var toLength = require('./_to-length'); +var context = require('./_string-context'); +var ENDS_WITH = 'endsWith'; +var $endsWith = ''[ENDS_WITH]; + +$export($export.P + $export.F * require('./_fails-is-regexp')(ENDS_WITH), 'String', { + endsWith: function endsWith(searchString /* , endPosition = @length */) { + var that = context(this, searchString, ENDS_WITH); + var endPosition = arguments.length > 1 ? arguments[1] : undefined; + var len = toLength(that.length); + var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); + var search = String(searchString); + return $endsWith + ? $endsWith.call(that, search, end) + : that.slice(end - search.length, end) === search; + } +}); diff --git a/node_modules/core-js/modules/es6.string.fixed.js b/node_modules/core-js/modules/es6.string.fixed.js new file mode 100644 index 000000000..d4a60f37d --- /dev/null +++ b/node_modules/core-js/modules/es6.string.fixed.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.6 String.prototype.fixed() +require('./_string-html')('fixed', function (createHTML) { + return function fixed() { + return createHTML(this, 'tt', '', ''); + }; +}); diff --git a/node_modules/core-js/modules/es6.string.fontcolor.js b/node_modules/core-js/modules/es6.string.fontcolor.js new file mode 100644 index 000000000..f7b95957c --- /dev/null +++ b/node_modules/core-js/modules/es6.string.fontcolor.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.7 String.prototype.fontcolor(color) +require('./_string-html')('fontcolor', function (createHTML) { + return function fontcolor(color) { + return createHTML(this, 'font', 'color', color); + }; +}); diff --git a/node_modules/core-js/modules/es6.string.fontsize.js b/node_modules/core-js/modules/es6.string.fontsize.js new file mode 100644 index 000000000..f4cc20aec --- /dev/null +++ b/node_modules/core-js/modules/es6.string.fontsize.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.8 String.prototype.fontsize(size) +require('./_string-html')('fontsize', function (createHTML) { + return function fontsize(size) { + return createHTML(this, 'font', 'size', size); + }; +}); diff --git a/node_modules/core-js/modules/es6.string.from-code-point.js b/node_modules/core-js/modules/es6.string.from-code-point.js new file mode 100644 index 000000000..bece66e29 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.from-code-point.js @@ -0,0 +1,23 @@ +var $export = require('./_export'); +var toAbsoluteIndex = require('./_to-absolute-index'); +var fromCharCode = String.fromCharCode; +var $fromCodePoint = String.fromCodePoint; + +// length should be 1, old FF problem +$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { + // 21.1.2.2 String.fromCodePoint(...codePoints) + fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars + var res = []; + var aLen = arguments.length; + var i = 0; + var code; + while (aLen > i) { + code = +arguments[i++]; + if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); + res.push(code < 0x10000 + ? fromCharCode(code) + : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) + ); + } return res.join(''); + } +}); diff --git a/node_modules/core-js/modules/es6.string.includes.js b/node_modules/core-js/modules/es6.string.includes.js new file mode 100644 index 000000000..28d17416b --- /dev/null +++ b/node_modules/core-js/modules/es6.string.includes.js @@ -0,0 +1,12 @@ +// 21.1.3.7 String.prototype.includes(searchString, position = 0) +'use strict'; +var $export = require('./_export'); +var context = require('./_string-context'); +var INCLUDES = 'includes'; + +$export($export.P + $export.F * require('./_fails-is-regexp')(INCLUDES), 'String', { + includes: function includes(searchString /* , position = 0 */) { + return !!~context(this, searchString, INCLUDES) + .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); + } +}); diff --git a/node_modules/core-js/modules/es6.string.italics.js b/node_modules/core-js/modules/es6.string.italics.js new file mode 100644 index 000000000..ed4cc3bf0 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.italics.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.9 String.prototype.italics() +require('./_string-html')('italics', function (createHTML) { + return function italics() { + return createHTML(this, 'i', '', ''); + }; +}); diff --git a/node_modules/core-js/modules/es6.string.iterator.js b/node_modules/core-js/modules/es6.string.iterator.js new file mode 100644 index 000000000..5d84c7fde --- /dev/null +++ b/node_modules/core-js/modules/es6.string.iterator.js @@ -0,0 +1,17 @@ +'use strict'; +var $at = require('./_string-at')(true); + +// 21.1.3.27 String.prototype[@@iterator]() +require('./_iter-define')(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 }; +}); diff --git a/node_modules/core-js/modules/es6.string.link.js b/node_modules/core-js/modules/es6.string.link.js new file mode 100644 index 000000000..d0255edd6 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.link.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.10 String.prototype.link(url) +require('./_string-html')('link', function (createHTML) { + return function link(url) { + return createHTML(this, 'a', 'href', url); + }; +}); diff --git a/node_modules/core-js/modules/es6.string.raw.js b/node_modules/core-js/modules/es6.string.raw.js new file mode 100644 index 000000000..aa40ff6fa --- /dev/null +++ b/node_modules/core-js/modules/es6.string.raw.js @@ -0,0 +1,18 @@ +var $export = require('./_export'); +var toIObject = require('./_to-iobject'); +var toLength = require('./_to-length'); + +$export($export.S, 'String', { + // 21.1.2.4 String.raw(callSite, ...substitutions) + raw: function raw(callSite) { + var tpl = toIObject(callSite.raw); + var len = toLength(tpl.length); + var aLen = arguments.length; + var res = []; + var i = 0; + while (len > i) { + res.push(String(tpl[i++])); + if (i < aLen) res.push(String(arguments[i])); + } return res.join(''); + } +}); diff --git a/node_modules/core-js/modules/es6.string.repeat.js b/node_modules/core-js/modules/es6.string.repeat.js new file mode 100644 index 000000000..08412d91b --- /dev/null +++ b/node_modules/core-js/modules/es6.string.repeat.js @@ -0,0 +1,6 @@ +var $export = require('./_export'); + +$export($export.P, 'String', { + // 21.1.3.13 String.prototype.repeat(count) + repeat: require('./_string-repeat') +}); diff --git a/node_modules/core-js/modules/es6.string.small.js b/node_modules/core-js/modules/es6.string.small.js new file mode 100644 index 000000000..941e4a767 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.small.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.11 String.prototype.small() +require('./_string-html')('small', function (createHTML) { + return function small() { + return createHTML(this, 'small', '', ''); + }; +}); diff --git a/node_modules/core-js/modules/es6.string.starts-with.js b/node_modules/core-js/modules/es6.string.starts-with.js new file mode 100644 index 000000000..c1723767d --- /dev/null +++ b/node_modules/core-js/modules/es6.string.starts-with.js @@ -0,0 +1,18 @@ +// 21.1.3.18 String.prototype.startsWith(searchString [, position ]) +'use strict'; +var $export = require('./_export'); +var toLength = require('./_to-length'); +var context = require('./_string-context'); +var STARTS_WITH = 'startsWith'; +var $startsWith = ''[STARTS_WITH]; + +$export($export.P + $export.F * require('./_fails-is-regexp')(STARTS_WITH), 'String', { + startsWith: function startsWith(searchString /* , position = 0 */) { + var that = context(this, searchString, STARTS_WITH); + var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); + var search = String(searchString); + return $startsWith + ? $startsWith.call(that, search, index) + : that.slice(index, index + search.length) === search; + } +}); diff --git a/node_modules/core-js/modules/es6.string.strike.js b/node_modules/core-js/modules/es6.string.strike.js new file mode 100644 index 000000000..66055bc00 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.strike.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.12 String.prototype.strike() +require('./_string-html')('strike', function (createHTML) { + return function strike() { + return createHTML(this, 'strike', '', ''); + }; +}); diff --git a/node_modules/core-js/modules/es6.string.sub.js b/node_modules/core-js/modules/es6.string.sub.js new file mode 100644 index 000000000..e295a27b0 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.sub.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.13 String.prototype.sub() +require('./_string-html')('sub', function (createHTML) { + return function sub() { + return createHTML(this, 'sub', '', ''); + }; +}); diff --git a/node_modules/core-js/modules/es6.string.sup.js b/node_modules/core-js/modules/es6.string.sup.js new file mode 100644 index 000000000..125a989a7 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.sup.js @@ -0,0 +1,7 @@ +'use strict'; +// B.2.3.14 String.prototype.sup() +require('./_string-html')('sup', function (createHTML) { + return function sup() { + return createHTML(this, 'sup', '', ''); + }; +}); diff --git a/node_modules/core-js/modules/es6.string.trim.js b/node_modules/core-js/modules/es6.string.trim.js new file mode 100644 index 000000000..02b8a6c69 --- /dev/null +++ b/node_modules/core-js/modules/es6.string.trim.js @@ -0,0 +1,7 @@ +'use strict'; +// 21.1.3.25 String.prototype.trim() +require('./_string-trim')('trim', function ($trim) { + return function trim() { + return $trim(this, 3); + }; +}); diff --git a/node_modules/core-js/modules/es6.symbol.js b/node_modules/core-js/modules/es6.symbol.js new file mode 100644 index 000000000..5bf7c4884 --- /dev/null +++ b/node_modules/core-js/modules/es6.symbol.js @@ -0,0 +1,234 @@ +'use strict'; +// ECMAScript 6 symbols shim +var global = require('./_global'); +var has = require('./_has'); +var DESCRIPTORS = require('./_descriptors'); +var $export = require('./_export'); +var redefine = require('./_redefine'); +var META = require('./_meta').KEY; +var $fails = require('./_fails'); +var shared = require('./_shared'); +var setToStringTag = require('./_set-to-string-tag'); +var uid = require('./_uid'); +var wks = require('./_wks'); +var wksExt = require('./_wks-ext'); +var wksDefine = require('./_wks-define'); +var enumKeys = require('./_enum-keys'); +var isArray = require('./_is-array'); +var anObject = require('./_an-object'); +var isObject = require('./_is-object'); +var toIObject = require('./_to-iobject'); +var toPrimitive = require('./_to-primitive'); +var createDesc = require('./_property-desc'); +var _create = require('./_object-create'); +var gOPNExt = require('./_object-gopn-ext'); +var $GOPD = require('./_object-gopd'); +var $DP = require('./_object-dp'); +var $keys = require('./_object-keys'); +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'; +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; + require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames; + require('./_object-pie').f = $propertyIsEnumerable; + require('./_object-gops').f = $getOwnPropertySymbols; + + if (DESCRIPTORS && !require('./_library')) { + 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 +}); + +// 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] || require('./_hide')($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); diff --git a/node_modules/core-js/modules/es6.typed.array-buffer.js b/node_modules/core-js/modules/es6.typed.array-buffer.js new file mode 100644 index 000000000..b2473709c --- /dev/null +++ b/node_modules/core-js/modules/es6.typed.array-buffer.js @@ -0,0 +1,46 @@ +'use strict'; +var $export = require('./_export'); +var $typed = require('./_typed'); +var buffer = require('./_typed-buffer'); +var anObject = require('./_an-object'); +var toAbsoluteIndex = require('./_to-absolute-index'); +var toLength = require('./_to-length'); +var isObject = require('./_is-object'); +var ArrayBuffer = require('./_global').ArrayBuffer; +var speciesConstructor = require('./_species-constructor'); +var $ArrayBuffer = buffer.ArrayBuffer; +var $DataView = buffer.DataView; +var $isView = $typed.ABV && ArrayBuffer.isView; +var $slice = $ArrayBuffer.prototype.slice; +var VIEW = $typed.VIEW; +var ARRAY_BUFFER = 'ArrayBuffer'; + +$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer }); + +$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { + // 24.1.3.1 ArrayBuffer.isView(arg) + isView: function isView(it) { + return $isView && $isView(it) || isObject(it) && VIEW in it; + } +}); + +$export($export.P + $export.U + $export.F * require('./_fails')(function () { + return !new $ArrayBuffer(2).slice(1, undefined).byteLength; +}), ARRAY_BUFFER, { + // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) + slice: function slice(start, end) { + if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix + var len = anObject(this).byteLength; + var first = toAbsoluteIndex(start, len); + var fin = toAbsoluteIndex(end === undefined ? len : end, len); + var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first)); + var viewS = new $DataView(this); + var viewT = new $DataView(result); + var index = 0; + while (first < fin) { + viewT.setUint8(index++, viewS.getUint8(first++)); + } return result; + } +}); + +require('./_set-species')(ARRAY_BUFFER); diff --git a/node_modules/core-js/modules/es6.typed.data-view.js b/node_modules/core-js/modules/es6.typed.data-view.js new file mode 100644 index 000000000..d0e23536b --- /dev/null +++ b/node_modules/core-js/modules/es6.typed.data-view.js @@ -0,0 +1,4 @@ +var $export = require('./_export'); +$export($export.G + $export.W + $export.F * !require('./_typed').ABV, { + DataView: require('./_typed-buffer').DataView +}); diff --git a/node_modules/core-js/modules/es6.typed.float32-array.js b/node_modules/core-js/modules/es6.typed.float32-array.js new file mode 100644 index 000000000..f49700617 --- /dev/null +++ b/node_modules/core-js/modules/es6.typed.float32-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Float32', 4, function (init) { + return function Float32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/node_modules/core-js/modules/es6.typed.float64-array.js b/node_modules/core-js/modules/es6.typed.float64-array.js new file mode 100644 index 000000000..85dedcd59 --- /dev/null +++ b/node_modules/core-js/modules/es6.typed.float64-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Float64', 8, function (init) { + return function Float64Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/node_modules/core-js/modules/es6.typed.int16-array.js b/node_modules/core-js/modules/es6.typed.int16-array.js new file mode 100644 index 000000000..b20ed0413 --- /dev/null +++ b/node_modules/core-js/modules/es6.typed.int16-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Int16', 2, function (init) { + return function Int16Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/node_modules/core-js/modules/es6.typed.int32-array.js b/node_modules/core-js/modules/es6.typed.int32-array.js new file mode 100644 index 000000000..c7e6ae06f --- /dev/null +++ b/node_modules/core-js/modules/es6.typed.int32-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Int32', 4, function (init) { + return function Int32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/node_modules/core-js/modules/es6.typed.int8-array.js b/node_modules/core-js/modules/es6.typed.int8-array.js new file mode 100644 index 000000000..58ab9f36e --- /dev/null +++ b/node_modules/core-js/modules/es6.typed.int8-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Int8', 1, function (init) { + return function Int8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/node_modules/core-js/modules/es6.typed.uint16-array.js b/node_modules/core-js/modules/es6.typed.uint16-array.js new file mode 100644 index 000000000..992805d63 --- /dev/null +++ b/node_modules/core-js/modules/es6.typed.uint16-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Uint16', 2, function (init) { + return function Uint16Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/node_modules/core-js/modules/es6.typed.uint32-array.js b/node_modules/core-js/modules/es6.typed.uint32-array.js new file mode 100644 index 000000000..5c444246a --- /dev/null +++ b/node_modules/core-js/modules/es6.typed.uint32-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Uint32', 4, function (init) { + return function Uint32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/node_modules/core-js/modules/es6.typed.uint8-array.js b/node_modules/core-js/modules/es6.typed.uint8-array.js new file mode 100644 index 000000000..465cdc806 --- /dev/null +++ b/node_modules/core-js/modules/es6.typed.uint8-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Uint8', 1, function (init) { + return function Uint8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); diff --git a/node_modules/core-js/modules/es6.typed.uint8-clamped-array.js b/node_modules/core-js/modules/es6.typed.uint8-clamped-array.js new file mode 100644 index 000000000..a84a1c1ac --- /dev/null +++ b/node_modules/core-js/modules/es6.typed.uint8-clamped-array.js @@ -0,0 +1,5 @@ +require('./_typed-array')('Uint8', 1, function (init) { + return function Uint8ClampedArray(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}, true); diff --git a/node_modules/core-js/modules/es6.weak-map.js b/node_modules/core-js/modules/es6.weak-map.js new file mode 100644 index 000000000..f21556d7c --- /dev/null +++ b/node_modules/core-js/modules/es6.weak-map.js @@ -0,0 +1,59 @@ +'use strict'; +var each = require('./_array-methods')(0); +var redefine = require('./_redefine'); +var meta = require('./_meta'); +var assign = require('./_object-assign'); +var weak = require('./_collection-weak'); +var isObject = require('./_is-object'); +var fails = require('./_fails'); +var validate = require('./_validate-collection'); +var WEAK_MAP = 'WeakMap'; +var getWeak = meta.getWeak; +var isExtensible = Object.isExtensible; +var uncaughtFrozenStore = weak.ufstore; +var tmp = {}; +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 = require('./_collection')(WEAK_MAP, wrapper, methods, weak, true, true); + +// IE11 WeakMap frozen keys fix +if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) { + 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); + }); + }); +} diff --git a/node_modules/core-js/modules/es6.weak-set.js b/node_modules/core-js/modules/es6.weak-set.js new file mode 100644 index 000000000..18a81e524 --- /dev/null +++ b/node_modules/core-js/modules/es6.weak-set.js @@ -0,0 +1,14 @@ +'use strict'; +var weak = require('./_collection-weak'); +var validate = require('./_validate-collection'); +var WEAK_SET = 'WeakSet'; + +// 23.4 WeakSet Objects +require('./_collection')(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); diff --git a/node_modules/core-js/modules/es7.array.flat-map.js b/node_modules/core-js/modules/es7.array.flat-map.js new file mode 100644 index 000000000..2a210cd35 --- /dev/null +++ b/node_modules/core-js/modules/es7.array.flat-map.js @@ -0,0 +1,22 @@ +'use strict'; +// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap +var $export = require('./_export'); +var flattenIntoArray = require('./_flatten-into-array'); +var toObject = require('./_to-object'); +var toLength = require('./_to-length'); +var aFunction = require('./_a-function'); +var arraySpeciesCreate = require('./_array-species-create'); + +$export($export.P, 'Array', { + flatMap: function flatMap(callbackfn /* , thisArg */) { + var O = toObject(this); + var sourceLen, A; + aFunction(callbackfn); + sourceLen = toLength(O.length); + A = arraySpeciesCreate(O, 0); + flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]); + return A; + } +}); + +require('./_add-to-unscopables')('flatMap'); diff --git a/node_modules/core-js/modules/es7.array.flatten.js b/node_modules/core-js/modules/es7.array.flatten.js new file mode 100644 index 000000000..9019b2d1c --- /dev/null +++ b/node_modules/core-js/modules/es7.array.flatten.js @@ -0,0 +1,21 @@ +'use strict'; +// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten +var $export = require('./_export'); +var flattenIntoArray = require('./_flatten-into-array'); +var toObject = require('./_to-object'); +var toLength = require('./_to-length'); +var toInteger = require('./_to-integer'); +var arraySpeciesCreate = require('./_array-species-create'); + +$export($export.P, 'Array', { + flatten: function flatten(/* depthArg = 1 */) { + var depthArg = arguments[0]; + var O = toObject(this); + var sourceLen = toLength(O.length); + var A = arraySpeciesCreate(O, 0); + flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg)); + return A; + } +}); + +require('./_add-to-unscopables')('flatten'); diff --git a/node_modules/core-js/modules/es7.array.includes.js b/node_modules/core-js/modules/es7.array.includes.js new file mode 100644 index 000000000..1b77f0eb8 --- /dev/null +++ b/node_modules/core-js/modules/es7.array.includes.js @@ -0,0 +1,12 @@ +'use strict'; +// https://github.com/tc39/Array.prototype.includes +var $export = require('./_export'); +var $includes = require('./_array-includes')(true); + +$export($export.P, 'Array', { + includes: function includes(el /* , fromIndex = 0 */) { + return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +require('./_add-to-unscopables')('includes'); diff --git a/node_modules/core-js/modules/es7.asap.js b/node_modules/core-js/modules/es7.asap.js new file mode 100644 index 000000000..d36f7c760 --- /dev/null +++ b/node_modules/core-js/modules/es7.asap.js @@ -0,0 +1,12 @@ +// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask +var $export = require('./_export'); +var microtask = require('./_microtask')(); +var process = require('./_global').process; +var isNode = require('./_cof')(process) == 'process'; + +$export($export.G, { + asap: function asap(fn) { + var domain = isNode && process.domain; + microtask(domain ? domain.bind(fn) : fn); + } +}); diff --git a/node_modules/core-js/modules/es7.error.is-error.js b/node_modules/core-js/modules/es7.error.is-error.js new file mode 100644 index 000000000..ba94f5d13 --- /dev/null +++ b/node_modules/core-js/modules/es7.error.is-error.js @@ -0,0 +1,9 @@ +// https://github.com/ljharb/proposal-is-error +var $export = require('./_export'); +var cof = require('./_cof'); + +$export($export.S, 'Error', { + isError: function isError(it) { + return cof(it) === 'Error'; + } +}); diff --git a/node_modules/core-js/modules/es7.global.js b/node_modules/core-js/modules/es7.global.js new file mode 100644 index 000000000..a315fd430 --- /dev/null +++ b/node_modules/core-js/modules/es7.global.js @@ -0,0 +1,4 @@ +// https://github.com/tc39/proposal-global +var $export = require('./_export'); + +$export($export.G, { global: require('./_global') }); diff --git a/node_modules/core-js/modules/es7.map.from.js b/node_modules/core-js/modules/es7.map.from.js new file mode 100644 index 000000000..a60573704 --- /dev/null +++ b/node_modules/core-js/modules/es7.map.from.js @@ -0,0 +1,2 @@ +// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from +require('./_set-collection-from')('Map'); diff --git a/node_modules/core-js/modules/es7.map.of.js b/node_modules/core-js/modules/es7.map.of.js new file mode 100644 index 000000000..a2bf1fef7 --- /dev/null +++ b/node_modules/core-js/modules/es7.map.of.js @@ -0,0 +1,2 @@ +// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of +require('./_set-collection-of')('Map'); diff --git a/node_modules/core-js/modules/es7.map.to-json.js b/node_modules/core-js/modules/es7.map.to-json.js new file mode 100644 index 000000000..95a3569fa --- /dev/null +++ b/node_modules/core-js/modules/es7.map.to-json.js @@ -0,0 +1,4 @@ +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = require('./_export'); + +$export($export.P + $export.R, 'Map', { toJSON: require('./_collection-to-json')('Map') }); diff --git a/node_modules/core-js/modules/es7.math.clamp.js b/node_modules/core-js/modules/es7.math.clamp.js new file mode 100644 index 000000000..319cda609 --- /dev/null +++ b/node_modules/core-js/modules/es7.math.clamp.js @@ -0,0 +1,8 @@ +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = require('./_export'); + +$export($export.S, 'Math', { + clamp: function clamp(x, lower, upper) { + return Math.min(upper, Math.max(lower, x)); + } +}); diff --git a/node_modules/core-js/modules/es7.math.deg-per-rad.js b/node_modules/core-js/modules/es7.math.deg-per-rad.js new file mode 100644 index 000000000..99b95bba9 --- /dev/null +++ b/node_modules/core-js/modules/es7.math.deg-per-rad.js @@ -0,0 +1,4 @@ +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = require('./_export'); + +$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 }); diff --git a/node_modules/core-js/modules/es7.math.degrees.js b/node_modules/core-js/modules/es7.math.degrees.js new file mode 100644 index 000000000..6637d915e --- /dev/null +++ b/node_modules/core-js/modules/es7.math.degrees.js @@ -0,0 +1,9 @@ +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = require('./_export'); +var RAD_PER_DEG = 180 / Math.PI; + +$export($export.S, 'Math', { + degrees: function degrees(radians) { + return radians * RAD_PER_DEG; + } +}); diff --git a/node_modules/core-js/modules/es7.math.fscale.js b/node_modules/core-js/modules/es7.math.fscale.js new file mode 100644 index 000000000..ad660a058 --- /dev/null +++ b/node_modules/core-js/modules/es7.math.fscale.js @@ -0,0 +1,10 @@ +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = require('./_export'); +var scale = require('./_math-scale'); +var fround = require('./_math-fround'); + +$export($export.S, 'Math', { + fscale: function fscale(x, inLow, inHigh, outLow, outHigh) { + return fround(scale(x, inLow, inHigh, outLow, outHigh)); + } +}); diff --git a/node_modules/core-js/modules/es7.math.iaddh.js b/node_modules/core-js/modules/es7.math.iaddh.js new file mode 100644 index 000000000..a331ba9b2 --- /dev/null +++ b/node_modules/core-js/modules/es7.math.iaddh.js @@ -0,0 +1,11 @@ +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = require('./_export'); + +$export($export.S, 'Math', { + iaddh: function iaddh(x0, x1, y0, y1) { + var $x0 = x0 >>> 0; + var $x1 = x1 >>> 0; + var $y0 = y0 >>> 0; + return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; + } +}); diff --git a/node_modules/core-js/modules/es7.math.imulh.js b/node_modules/core-js/modules/es7.math.imulh.js new file mode 100644 index 000000000..58d19f3ac --- /dev/null +++ b/node_modules/core-js/modules/es7.math.imulh.js @@ -0,0 +1,16 @@ +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = require('./_export'); + +$export($export.S, 'Math', { + imulh: function imulh(u, v) { + var UINT16 = 0xffff; + var $u = +u; + var $v = +v; + var u0 = $u & UINT16; + var v0 = $v & UINT16; + var u1 = $u >> 16; + var v1 = $v >> 16; + var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); + } +}); diff --git a/node_modules/core-js/modules/es7.math.isubh.js b/node_modules/core-js/modules/es7.math.isubh.js new file mode 100644 index 000000000..de22793c1 --- /dev/null +++ b/node_modules/core-js/modules/es7.math.isubh.js @@ -0,0 +1,11 @@ +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = require('./_export'); + +$export($export.S, 'Math', { + isubh: function isubh(x0, x1, y0, y1) { + var $x0 = x0 >>> 0; + var $x1 = x1 >>> 0; + var $y0 = y0 >>> 0; + return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; + } +}); diff --git a/node_modules/core-js/modules/es7.math.rad-per-deg.js b/node_modules/core-js/modules/es7.math.rad-per-deg.js new file mode 100644 index 000000000..6f702596a --- /dev/null +++ b/node_modules/core-js/modules/es7.math.rad-per-deg.js @@ -0,0 +1,4 @@ +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = require('./_export'); + +$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI }); diff --git a/node_modules/core-js/modules/es7.math.radians.js b/node_modules/core-js/modules/es7.math.radians.js new file mode 100644 index 000000000..abd9575fe --- /dev/null +++ b/node_modules/core-js/modules/es7.math.radians.js @@ -0,0 +1,9 @@ +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = require('./_export'); +var DEG_PER_RAD = Math.PI / 180; + +$export($export.S, 'Math', { + radians: function radians(degrees) { + return degrees * DEG_PER_RAD; + } +}); diff --git a/node_modules/core-js/modules/es7.math.scale.js b/node_modules/core-js/modules/es7.math.scale.js new file mode 100644 index 000000000..2866dcd7c --- /dev/null +++ b/node_modules/core-js/modules/es7.math.scale.js @@ -0,0 +1,4 @@ +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = require('./_export'); + +$export($export.S, 'Math', { scale: require('./_math-scale') }); diff --git a/node_modules/core-js/modules/es7.math.signbit.js b/node_modules/core-js/modules/es7.math.signbit.js new file mode 100644 index 000000000..c25680486 --- /dev/null +++ b/node_modules/core-js/modules/es7.math.signbit.js @@ -0,0 +1,7 @@ +// http://jfbastien.github.io/papers/Math.signbit.html +var $export = require('./_export'); + +$export($export.S, 'Math', { signbit: function signbit(x) { + // eslint-disable-next-line no-self-compare + return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0; +} }); diff --git a/node_modules/core-js/modules/es7.math.umulh.js b/node_modules/core-js/modules/es7.math.umulh.js new file mode 100644 index 000000000..3ddfa4685 --- /dev/null +++ b/node_modules/core-js/modules/es7.math.umulh.js @@ -0,0 +1,16 @@ +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = require('./_export'); + +$export($export.S, 'Math', { + umulh: function umulh(u, v) { + var UINT16 = 0xffff; + var $u = +u; + var $v = +v; + var u0 = $u & UINT16; + var v0 = $v & UINT16; + var u1 = $u >>> 16; + var v1 = $v >>> 16; + var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); + } +}); diff --git a/node_modules/core-js/modules/es7.object.define-getter.js b/node_modules/core-js/modules/es7.object.define-getter.js new file mode 100644 index 000000000..ffc6203fd --- /dev/null +++ b/node_modules/core-js/modules/es7.object.define-getter.js @@ -0,0 +1,12 @@ +'use strict'; +var $export = require('./_export'); +var toObject = require('./_to-object'); +var aFunction = require('./_a-function'); +var $defineProperty = require('./_object-dp'); + +// B.2.2.2 Object.prototype.__defineGetter__(P, getter) +require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { + __defineGetter__: function __defineGetter__(P, getter) { + $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true }); + } +}); diff --git a/node_modules/core-js/modules/es7.object.define-setter.js b/node_modules/core-js/modules/es7.object.define-setter.js new file mode 100644 index 000000000..8ceefdd68 --- /dev/null +++ b/node_modules/core-js/modules/es7.object.define-setter.js @@ -0,0 +1,12 @@ +'use strict'; +var $export = require('./_export'); +var toObject = require('./_to-object'); +var aFunction = require('./_a-function'); +var $defineProperty = require('./_object-dp'); + +// B.2.2.3 Object.prototype.__defineSetter__(P, setter) +require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { + __defineSetter__: function __defineSetter__(P, setter) { + $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true }); + } +}); diff --git a/node_modules/core-js/modules/es7.object.entries.js b/node_modules/core-js/modules/es7.object.entries.js new file mode 100644 index 000000000..2f83437c8 --- /dev/null +++ b/node_modules/core-js/modules/es7.object.entries.js @@ -0,0 +1,9 @@ +// https://github.com/tc39/proposal-object-values-entries +var $export = require('./_export'); +var $entries = require('./_object-to-array')(true); + +$export($export.S, 'Object', { + entries: function entries(it) { + return $entries(it); + } +}); diff --git a/node_modules/core-js/modules/es7.object.get-own-property-descriptors.js b/node_modules/core-js/modules/es7.object.get-own-property-descriptors.js new file mode 100644 index 000000000..b1ab72fde --- /dev/null +++ b/node_modules/core-js/modules/es7.object.get-own-property-descriptors.js @@ -0,0 +1,22 @@ +// https://github.com/tc39/proposal-object-getownpropertydescriptors +var $export = require('./_export'); +var ownKeys = require('./_own-keys'); +var toIObject = require('./_to-iobject'); +var gOPD = require('./_object-gopd'); +var createProperty = require('./_create-property'); + +$export($export.S, 'Object', { + getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { + var O = toIObject(object); + var getDesc = gOPD.f; + var keys = ownKeys(O); + var result = {}; + var i = 0; + var key, desc; + while (keys.length > i) { + desc = getDesc(O, key = keys[i++]); + if (desc !== undefined) createProperty(result, key, desc); + } + return result; + } +}); diff --git a/node_modules/core-js/modules/es7.object.lookup-getter.js b/node_modules/core-js/modules/es7.object.lookup-getter.js new file mode 100644 index 000000000..f80222916 --- /dev/null +++ b/node_modules/core-js/modules/es7.object.lookup-getter.js @@ -0,0 +1,18 @@ +'use strict'; +var $export = require('./_export'); +var toObject = require('./_to-object'); +var toPrimitive = require('./_to-primitive'); +var getPrototypeOf = require('./_object-gpo'); +var getOwnPropertyDescriptor = require('./_object-gopd').f; + +// B.2.2.4 Object.prototype.__lookupGetter__(P) +require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { + __lookupGetter__: function __lookupGetter__(P) { + var O = toObject(this); + var K = toPrimitive(P, true); + var D; + do { + if (D = getOwnPropertyDescriptor(O, K)) return D.get; + } while (O = getPrototypeOf(O)); + } +}); diff --git a/node_modules/core-js/modules/es7.object.lookup-setter.js b/node_modules/core-js/modules/es7.object.lookup-setter.js new file mode 100644 index 000000000..8bf8b64ea --- /dev/null +++ b/node_modules/core-js/modules/es7.object.lookup-setter.js @@ -0,0 +1,18 @@ +'use strict'; +var $export = require('./_export'); +var toObject = require('./_to-object'); +var toPrimitive = require('./_to-primitive'); +var getPrototypeOf = require('./_object-gpo'); +var getOwnPropertyDescriptor = require('./_object-gopd').f; + +// B.2.2.5 Object.prototype.__lookupSetter__(P) +require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { + __lookupSetter__: function __lookupSetter__(P) { + var O = toObject(this); + var K = toPrimitive(P, true); + var D; + do { + if (D = getOwnPropertyDescriptor(O, K)) return D.set; + } while (O = getPrototypeOf(O)); + } +}); diff --git a/node_modules/core-js/modules/es7.object.values.js b/node_modules/core-js/modules/es7.object.values.js new file mode 100644 index 000000000..d6f095275 --- /dev/null +++ b/node_modules/core-js/modules/es7.object.values.js @@ -0,0 +1,9 @@ +// https://github.com/tc39/proposal-object-values-entries +var $export = require('./_export'); +var $values = require('./_object-to-array')(false); + +$export($export.S, 'Object', { + values: function values(it) { + return $values(it); + } +}); diff --git a/node_modules/core-js/modules/es7.observable.js b/node_modules/core-js/modules/es7.observable.js new file mode 100644 index 000000000..6dcb2c8f2 --- /dev/null +++ b/node_modules/core-js/modules/es7.observable.js @@ -0,0 +1,199 @@ +'use strict'; +// https://github.com/zenparsing/es-observable +var $export = require('./_export'); +var global = require('./_global'); +var core = require('./_core'); +var microtask = require('./_microtask')(); +var OBSERVABLE = require('./_wks')('observable'); +var aFunction = require('./_a-function'); +var anObject = require('./_an-object'); +var anInstance = require('./_an-instance'); +var redefineAll = require('./_redefine-all'); +var hide = require('./_hide'); +var forOf = require('./_for-of'); +var RETURN = forOf.RETURN; + +var getMethod = function (fn) { + return fn == null ? undefined : aFunction(fn); +}; + +var cleanupSubscription = function (subscription) { + var cleanup = subscription._c; + if (cleanup) { + subscription._c = undefined; + cleanup(); + } +}; + +var subscriptionClosed = function (subscription) { + return subscription._o === undefined; +}; + +var closeSubscription = function (subscription) { + if (!subscriptionClosed(subscription)) { + subscription._o = undefined; + cleanupSubscription(subscription); + } +}; + +var Subscription = function (observer, subscriber) { + anObject(observer); + this._c = undefined; + this._o = observer; + observer = new SubscriptionObserver(this); + try { + var cleanup = subscriber(observer); + var subscription = cleanup; + if (cleanup != null) { + if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); }; + else aFunction(cleanup); + this._c = cleanup; + } + } catch (e) { + observer.error(e); + return; + } if (subscriptionClosed(this)) cleanupSubscription(this); +}; + +Subscription.prototype = redefineAll({}, { + unsubscribe: function unsubscribe() { closeSubscription(this); } +}); + +var SubscriptionObserver = function (subscription) { + this._s = subscription; +}; + +SubscriptionObserver.prototype = redefineAll({}, { + next: function next(value) { + var subscription = this._s; + if (!subscriptionClosed(subscription)) { + var observer = subscription._o; + try { + var m = getMethod(observer.next); + if (m) return m.call(observer, value); + } catch (e) { + try { + closeSubscription(subscription); + } finally { + throw e; + } + } + } + }, + error: function error(value) { + var subscription = this._s; + if (subscriptionClosed(subscription)) throw value; + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.error); + if (!m) throw value; + value = m.call(observer, value); + } catch (e) { + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + }, + complete: function complete(value) { + var subscription = this._s; + if (!subscriptionClosed(subscription)) { + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.complete); + value = m ? m.call(observer, value) : undefined; + } catch (e) { + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + } + } +}); + +var $Observable = function Observable(subscriber) { + anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber); +}; + +redefineAll($Observable.prototype, { + subscribe: function subscribe(observer) { + return new Subscription(observer, this._f); + }, + forEach: function forEach(fn) { + var that = this; + return new (core.Promise || global.Promise)(function (resolve, reject) { + aFunction(fn); + var subscription = that.subscribe({ + next: function (value) { + try { + return fn(value); + } catch (e) { + reject(e); + subscription.unsubscribe(); + } + }, + error: reject, + complete: resolve + }); + }); + } +}); + +redefineAll($Observable, { + from: function from(x) { + var C = typeof this === 'function' ? this : $Observable; + var method = getMethod(anObject(x)[OBSERVABLE]); + if (method) { + var observable = anObject(method.call(x)); + return observable.constructor === C ? observable : new C(function (observer) { + return observable.subscribe(observer); + }); + } + return new C(function (observer) { + var done = false; + microtask(function () { + if (!done) { + try { + if (forOf(x, false, function (it) { + observer.next(it); + if (done) return RETURN; + }) === RETURN) return; + } catch (e) { + if (done) throw e; + observer.error(e); + return; + } observer.complete(); + } + }); + return function () { done = true; }; + }); + }, + of: function of() { + for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++]; + return new (typeof this === 'function' ? this : $Observable)(function (observer) { + var done = false; + microtask(function () { + if (!done) { + for (var j = 0; j < items.length; ++j) { + observer.next(items[j]); + if (done) return; + } observer.complete(); + } + }); + return function () { done = true; }; + }); + } +}); + +hide($Observable.prototype, OBSERVABLE, function () { return this; }); + +$export($export.G, { Observable: $Observable }); + +require('./_set-species')('Observable'); diff --git a/node_modules/core-js/modules/es7.promise.finally.js b/node_modules/core-js/modules/es7.promise.finally.js new file mode 100644 index 000000000..fa04b6399 --- /dev/null +++ b/node_modules/core-js/modules/es7.promise.finally.js @@ -0,0 +1,20 @@ +// https://github.com/tc39/proposal-promise-finally +'use strict'; +var $export = require('./_export'); +var core = require('./_core'); +var global = require('./_global'); +var speciesConstructor = require('./_species-constructor'); +var promiseResolve = require('./_promise-resolve'); + +$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { + var C = speciesConstructor(this, core.Promise || global.Promise); + var isFunction = typeof onFinally == 'function'; + return this.then( + isFunction ? function (x) { + return promiseResolve(C, onFinally()).then(function () { return x; }); + } : onFinally, + isFunction ? function (e) { + return promiseResolve(C, onFinally()).then(function () { throw e; }); + } : onFinally + ); +} }); diff --git a/node_modules/core-js/modules/es7.promise.try.js b/node_modules/core-js/modules/es7.promise.try.js new file mode 100644 index 000000000..e8163720b --- /dev/null +++ b/node_modules/core-js/modules/es7.promise.try.js @@ -0,0 +1,12 @@ +'use strict'; +// https://github.com/tc39/proposal-promise-try +var $export = require('./_export'); +var newPromiseCapability = require('./_new-promise-capability'); +var perform = require('./_perform'); + +$export($export.S, 'Promise', { 'try': function (callbackfn) { + var promiseCapability = newPromiseCapability.f(this); + var result = perform(callbackfn); + (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); + return promiseCapability.promise; +} }); diff --git a/node_modules/core-js/modules/es7.reflect.define-metadata.js b/node_modules/core-js/modules/es7.reflect.define-metadata.js new file mode 100644 index 000000000..ebef52c24 --- /dev/null +++ b/node_modules/core-js/modules/es7.reflect.define-metadata.js @@ -0,0 +1,8 @@ +var metadata = require('./_metadata'); +var anObject = require('./_an-object'); +var toMetaKey = metadata.key; +var ordinaryDefineOwnMetadata = metadata.set; + +metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) { + ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); +} }); diff --git a/node_modules/core-js/modules/es7.reflect.delete-metadata.js b/node_modules/core-js/modules/es7.reflect.delete-metadata.js new file mode 100644 index 000000000..590ed53ce --- /dev/null +++ b/node_modules/core-js/modules/es7.reflect.delete-metadata.js @@ -0,0 +1,15 @@ +var metadata = require('./_metadata'); +var anObject = require('./_an-object'); +var toMetaKey = metadata.key; +var getOrCreateMetadataMap = metadata.map; +var store = metadata.store; + +metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) { + var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]); + var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); + if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false; + if (metadataMap.size) return true; + var targetMetadata = store.get(target); + targetMetadata['delete'](targetKey); + return !!targetMetadata.size || store['delete'](target); +} }); diff --git a/node_modules/core-js/modules/es7.reflect.get-metadata-keys.js b/node_modules/core-js/modules/es7.reflect.get-metadata-keys.js new file mode 100644 index 000000000..f344172b5 --- /dev/null +++ b/node_modules/core-js/modules/es7.reflect.get-metadata-keys.js @@ -0,0 +1,19 @@ +var Set = require('./es6.set'); +var from = require('./_array-from-iterable'); +var metadata = require('./_metadata'); +var anObject = require('./_an-object'); +var getPrototypeOf = require('./_object-gpo'); +var ordinaryOwnMetadataKeys = metadata.keys; +var toMetaKey = metadata.key; + +var ordinaryMetadataKeys = function (O, P) { + var oKeys = ordinaryOwnMetadataKeys(O, P); + var parent = getPrototypeOf(O); + if (parent === null) return oKeys; + var pKeys = ordinaryMetadataKeys(parent, P); + return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys; +}; + +metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) { + return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); +} }); diff --git a/node_modules/core-js/modules/es7.reflect.get-metadata.js b/node_modules/core-js/modules/es7.reflect.get-metadata.js new file mode 100644 index 000000000..58c278e98 --- /dev/null +++ b/node_modules/core-js/modules/es7.reflect.get-metadata.js @@ -0,0 +1,17 @@ +var metadata = require('./_metadata'); +var anObject = require('./_an-object'); +var getPrototypeOf = require('./_object-gpo'); +var ordinaryHasOwnMetadata = metadata.has; +var ordinaryGetOwnMetadata = metadata.get; +var toMetaKey = metadata.key; + +var ordinaryGetMetadata = function (MetadataKey, O, P) { + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P); + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; +}; + +metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) { + return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); diff --git a/node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js b/node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js new file mode 100644 index 000000000..03e3201bb --- /dev/null +++ b/node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js @@ -0,0 +1,8 @@ +var metadata = require('./_metadata'); +var anObject = require('./_an-object'); +var ordinaryOwnMetadataKeys = metadata.keys; +var toMetaKey = metadata.key; + +metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) { + return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); +} }); diff --git a/node_modules/core-js/modules/es7.reflect.get-own-metadata.js b/node_modules/core-js/modules/es7.reflect.get-own-metadata.js new file mode 100644 index 000000000..4a18b0717 --- /dev/null +++ b/node_modules/core-js/modules/es7.reflect.get-own-metadata.js @@ -0,0 +1,9 @@ +var metadata = require('./_metadata'); +var anObject = require('./_an-object'); +var ordinaryGetOwnMetadata = metadata.get; +var toMetaKey = metadata.key; + +metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) { + return ordinaryGetOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); diff --git a/node_modules/core-js/modules/es7.reflect.has-metadata.js b/node_modules/core-js/modules/es7.reflect.has-metadata.js new file mode 100644 index 000000000..b934bb4ec --- /dev/null +++ b/node_modules/core-js/modules/es7.reflect.has-metadata.js @@ -0,0 +1,16 @@ +var metadata = require('./_metadata'); +var anObject = require('./_an-object'); +var getPrototypeOf = require('./_object-gpo'); +var ordinaryHasOwnMetadata = metadata.has; +var toMetaKey = metadata.key; + +var ordinaryHasMetadata = function (MetadataKey, O, P) { + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) return true; + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; +}; + +metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) { + return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); diff --git a/node_modules/core-js/modules/es7.reflect.has-own-metadata.js b/node_modules/core-js/modules/es7.reflect.has-own-metadata.js new file mode 100644 index 000000000..512850dd8 --- /dev/null +++ b/node_modules/core-js/modules/es7.reflect.has-own-metadata.js @@ -0,0 +1,9 @@ +var metadata = require('./_metadata'); +var anObject = require('./_an-object'); +var ordinaryHasOwnMetadata = metadata.has; +var toMetaKey = metadata.key; + +metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) { + return ordinaryHasOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); diff --git a/node_modules/core-js/modules/es7.reflect.metadata.js b/node_modules/core-js/modules/es7.reflect.metadata.js new file mode 100644 index 000000000..efb9a9e26 --- /dev/null +++ b/node_modules/core-js/modules/es7.reflect.metadata.js @@ -0,0 +1,15 @@ +var $metadata = require('./_metadata'); +var anObject = require('./_an-object'); +var aFunction = require('./_a-function'); +var toMetaKey = $metadata.key; +var ordinaryDefineOwnMetadata = $metadata.set; + +$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) { + return function decorator(target, targetKey) { + ordinaryDefineOwnMetadata( + metadataKey, metadataValue, + (targetKey !== undefined ? anObject : aFunction)(target), + toMetaKey(targetKey) + ); + }; +} }); diff --git a/node_modules/core-js/modules/es7.set.from.js b/node_modules/core-js/modules/es7.set.from.js new file mode 100644 index 000000000..26542b664 --- /dev/null +++ b/node_modules/core-js/modules/es7.set.from.js @@ -0,0 +1,2 @@ +// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from +require('./_set-collection-from')('Set'); diff --git a/node_modules/core-js/modules/es7.set.of.js b/node_modules/core-js/modules/es7.set.of.js new file mode 100644 index 000000000..2a50ad911 --- /dev/null +++ b/node_modules/core-js/modules/es7.set.of.js @@ -0,0 +1,2 @@ +// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of +require('./_set-collection-of')('Set'); diff --git a/node_modules/core-js/modules/es7.set.to-json.js b/node_modules/core-js/modules/es7.set.to-json.js new file mode 100644 index 000000000..95cbcfa51 --- /dev/null +++ b/node_modules/core-js/modules/es7.set.to-json.js @@ -0,0 +1,4 @@ +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = require('./_export'); + +$export($export.P + $export.R, 'Set', { toJSON: require('./_collection-to-json')('Set') }); diff --git a/node_modules/core-js/modules/es7.string.at.js b/node_modules/core-js/modules/es7.string.at.js new file mode 100644 index 000000000..8b3ab98db --- /dev/null +++ b/node_modules/core-js/modules/es7.string.at.js @@ -0,0 +1,10 @@ +'use strict'; +// https://github.com/mathiasbynens/String.prototype.at +var $export = require('./_export'); +var $at = require('./_string-at')(true); + +$export($export.P, 'String', { + at: function at(pos) { + return $at(this, pos); + } +}); diff --git a/node_modules/core-js/modules/es7.string.match-all.js b/node_modules/core-js/modules/es7.string.match-all.js new file mode 100644 index 000000000..78237036e --- /dev/null +++ b/node_modules/core-js/modules/es7.string.match-all.js @@ -0,0 +1,30 @@ +'use strict'; +// https://tc39.github.io/String.prototype.matchAll/ +var $export = require('./_export'); +var defined = require('./_defined'); +var toLength = require('./_to-length'); +var isRegExp = require('./_is-regexp'); +var getFlags = require('./_flags'); +var RegExpProto = RegExp.prototype; + +var $RegExpStringIterator = function (regexp, string) { + this._r = regexp; + this._s = string; +}; + +require('./_iter-create')($RegExpStringIterator, 'RegExp String', function next() { + var match = this._r.exec(this._s); + return { value: match, done: match === null }; +}); + +$export($export.P, 'String', { + matchAll: function matchAll(regexp) { + defined(this); + if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!'); + var S = String(this); + var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp); + var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags); + rx.lastIndex = toLength(regexp.lastIndex); + return new $RegExpStringIterator(rx, S); + } +}); diff --git a/node_modules/core-js/modules/es7.string.pad-end.js b/node_modules/core-js/modules/es7.string.pad-end.js new file mode 100644 index 000000000..df55ce70b --- /dev/null +++ b/node_modules/core-js/modules/es7.string.pad-end.js @@ -0,0 +1,12 @@ +'use strict'; +// https://github.com/tc39/proposal-string-pad-start-end +var $export = require('./_export'); +var $pad = require('./_string-pad'); +var userAgent = require('./_user-agent'); + +// https://github.com/zloirock/core-js/issues/280 +$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { + padEnd: function padEnd(maxLength /* , fillString = ' ' */) { + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); + } +}); diff --git a/node_modules/core-js/modules/es7.string.pad-start.js b/node_modules/core-js/modules/es7.string.pad-start.js new file mode 100644 index 000000000..61549121d --- /dev/null +++ b/node_modules/core-js/modules/es7.string.pad-start.js @@ -0,0 +1,12 @@ +'use strict'; +// https://github.com/tc39/proposal-string-pad-start-end +var $export = require('./_export'); +var $pad = require('./_string-pad'); +var userAgent = require('./_user-agent'); + +// https://github.com/zloirock/core-js/issues/280 +$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { + padStart: function padStart(maxLength /* , fillString = ' ' */) { + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); + } +}); diff --git a/node_modules/core-js/modules/es7.string.trim-left.js b/node_modules/core-js/modules/es7.string.trim-left.js new file mode 100644 index 000000000..39a4b47cf --- /dev/null +++ b/node_modules/core-js/modules/es7.string.trim-left.js @@ -0,0 +1,7 @@ +'use strict'; +// https://github.com/sebmarkbage/ecmascript-string-left-right-trim +require('./_string-trim')('trimLeft', function ($trim) { + return function trimLeft() { + return $trim(this, 1); + }; +}, 'trimStart'); diff --git a/node_modules/core-js/modules/es7.string.trim-right.js b/node_modules/core-js/modules/es7.string.trim-right.js new file mode 100644 index 000000000..7b7c45298 --- /dev/null +++ b/node_modules/core-js/modules/es7.string.trim-right.js @@ -0,0 +1,7 @@ +'use strict'; +// https://github.com/sebmarkbage/ecmascript-string-left-right-trim +require('./_string-trim')('trimRight', function ($trim) { + return function trimRight() { + return $trim(this, 2); + }; +}, 'trimEnd'); diff --git a/node_modules/core-js/modules/es7.symbol.async-iterator.js b/node_modules/core-js/modules/es7.symbol.async-iterator.js new file mode 100644 index 000000000..f56dc2a8e --- /dev/null +++ b/node_modules/core-js/modules/es7.symbol.async-iterator.js @@ -0,0 +1 @@ +require('./_wks-define')('asyncIterator'); diff --git a/node_modules/core-js/modules/es7.symbol.observable.js b/node_modules/core-js/modules/es7.symbol.observable.js new file mode 100644 index 000000000..fc9a23761 --- /dev/null +++ b/node_modules/core-js/modules/es7.symbol.observable.js @@ -0,0 +1 @@ +require('./_wks-define')('observable'); diff --git a/node_modules/core-js/modules/es7.system.global.js b/node_modules/core-js/modules/es7.system.global.js new file mode 100644 index 000000000..310a802ad --- /dev/null +++ b/node_modules/core-js/modules/es7.system.global.js @@ -0,0 +1,4 @@ +// https://github.com/tc39/proposal-global +var $export = require('./_export'); + +$export($export.S, 'System', { global: require('./_global') }); diff --git a/node_modules/core-js/modules/es7.weak-map.from.js b/node_modules/core-js/modules/es7.weak-map.from.js new file mode 100644 index 000000000..1a0136576 --- /dev/null +++ b/node_modules/core-js/modules/es7.weak-map.from.js @@ -0,0 +1,2 @@ +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from +require('./_set-collection-from')('WeakMap'); diff --git a/node_modules/core-js/modules/es7.weak-map.of.js b/node_modules/core-js/modules/es7.weak-map.of.js new file mode 100644 index 000000000..52c3f66df --- /dev/null +++ b/node_modules/core-js/modules/es7.weak-map.of.js @@ -0,0 +1,2 @@ +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of +require('./_set-collection-of')('WeakMap'); diff --git a/node_modules/core-js/modules/es7.weak-set.from.js b/node_modules/core-js/modules/es7.weak-set.from.js new file mode 100644 index 000000000..493e5bee0 --- /dev/null +++ b/node_modules/core-js/modules/es7.weak-set.from.js @@ -0,0 +1,2 @@ +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from +require('./_set-collection-from')('WeakSet'); diff --git a/node_modules/core-js/modules/es7.weak-set.of.js b/node_modules/core-js/modules/es7.weak-set.of.js new file mode 100644 index 000000000..5941e72aa --- /dev/null +++ b/node_modules/core-js/modules/es7.weak-set.of.js @@ -0,0 +1,2 @@ +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of +require('./_set-collection-of')('WeakSet'); diff --git a/node_modules/core-js/modules/library/_add-to-unscopables.js b/node_modules/core-js/modules/library/_add-to-unscopables.js new file mode 100644 index 000000000..02ef44ba4 --- /dev/null +++ b/node_modules/core-js/modules/library/_add-to-unscopables.js @@ -0,0 +1 @@ +module.exports = function () { /* empty */ }; diff --git a/node_modules/core-js/modules/library/_collection.js b/node_modules/core-js/modules/library/_collection.js new file mode 100644 index 000000000..31a36b87a --- /dev/null +++ b/node_modules/core-js/modules/library/_collection.js @@ -0,0 +1,59 @@ +'use strict'; +var global = require('./_global'); +var $export = require('./_export'); +var meta = require('./_meta'); +var fails = require('./_fails'); +var hide = require('./_hide'); +var redefineAll = require('./_redefine-all'); +var forOf = require('./_for-of'); +var anInstance = require('./_an-instance'); +var isObject = require('./_is-object'); +var setToStringTag = require('./_set-to-string-tag'); +var dP = require('./_object-dp').f; +var each = require('./_array-methods')(0); +var DESCRIPTORS = require('./_descriptors'); + +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; +}; diff --git a/node_modules/core-js/modules/library/_export.js b/node_modules/core-js/modules/library/_export.js new file mode 100644 index 000000000..02bddc0aa --- /dev/null +++ b/node_modules/core-js/modules/library/_export.js @@ -0,0 +1,62 @@ +var global = require('./_global'); +var core = require('./_core'); +var ctx = require('./_ctx'); +var hide = require('./_hide'); +var has = require('./_has'); +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; diff --git a/node_modules/core-js/modules/library/_library.js b/node_modules/core-js/modules/library/_library.js new file mode 100644 index 000000000..ec01c2c14 --- /dev/null +++ b/node_modules/core-js/modules/library/_library.js @@ -0,0 +1 @@ +module.exports = true; diff --git a/node_modules/core-js/modules/library/_path.js b/node_modules/core-js/modules/library/_path.js new file mode 100644 index 000000000..2796ebcb9 --- /dev/null +++ b/node_modules/core-js/modules/library/_path.js @@ -0,0 +1 @@ +module.exports = require('./_core'); diff --git a/node_modules/core-js/modules/library/_redefine-all.js b/node_modules/core-js/modules/library/_redefine-all.js new file mode 100644 index 000000000..bf8c0ea39 --- /dev/null +++ b/node_modules/core-js/modules/library/_redefine-all.js @@ -0,0 +1,7 @@ +var hide = require('./_hide'); +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; +}; diff --git a/node_modules/core-js/modules/library/_redefine.js b/node_modules/core-js/modules/library/_redefine.js new file mode 100644 index 000000000..fde6108ef --- /dev/null +++ b/node_modules/core-js/modules/library/_redefine.js @@ -0,0 +1 @@ +module.exports = require('./_hide'); diff --git a/node_modules/core-js/modules/library/_set-species.js b/node_modules/core-js/modules/library/_set-species.js new file mode 100644 index 000000000..1f25fde1e --- /dev/null +++ b/node_modules/core-js/modules/library/_set-species.js @@ -0,0 +1,14 @@ +'use strict'; +var global = require('./_global'); +var core = require('./_core'); +var dP = require('./_object-dp'); +var DESCRIPTORS = require('./_descriptors'); +var SPECIES = require('./_wks')('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; } + }); +}; diff --git a/node_modules/core-js/modules/library/es6.date.to-json.js b/node_modules/core-js/modules/library/es6.date.to-json.js new file mode 100644 index 000000000..69b1f3018 --- /dev/null +++ b/node_modules/core-js/modules/library/es6.date.to-json.js @@ -0,0 +1,19 @@ +'use strict'; +var $export = require('./_export'); +var toObject = require('./_to-object'); +var toPrimitive = require('./_to-primitive'); +var toISOString = require('./_date-to-iso-string'); +var classof = require('./_classof'); + +$export($export.P + $export.F * require('./_fails')(function () { + return new Date(NaN).toJSON() !== null + || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; +}), 'Date', { + // eslint-disable-next-line no-unused-vars + toJSON: function toJSON(key) { + var O = toObject(this); + var pv = toPrimitive(O); + return typeof pv == 'number' && !isFinite(pv) ? null : + (!('toISOString' in O) && classof(O) == 'Date') ? toISOString.call(O) : O.toISOString(); + } +}); diff --git a/node_modules/core-js/modules/library/es6.date.to-primitive.js b/node_modules/core-js/modules/library/es6.date.to-primitive.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/core-js/modules/library/es6.date.to-string.js b/node_modules/core-js/modules/library/es6.date.to-string.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/core-js/modules/library/es6.function.name.js b/node_modules/core-js/modules/library/es6.function.name.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/core-js/modules/library/es6.number.constructor.js b/node_modules/core-js/modules/library/es6.number.constructor.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/core-js/modules/library/es6.object.to-string.js b/node_modules/core-js/modules/library/es6.object.to-string.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/core-js/modules/library/es6.regexp.constructor.js b/node_modules/core-js/modules/library/es6.regexp.constructor.js new file mode 100644 index 000000000..e85e3141a --- /dev/null +++ b/node_modules/core-js/modules/library/es6.regexp.constructor.js @@ -0,0 +1 @@ +require('./_set-species')('RegExp'); diff --git a/node_modules/core-js/modules/library/es6.regexp.flags.js b/node_modules/core-js/modules/library/es6.regexp.flags.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/core-js/modules/library/es6.regexp.match.js b/node_modules/core-js/modules/library/es6.regexp.match.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/core-js/modules/library/es6.regexp.replace.js b/node_modules/core-js/modules/library/es6.regexp.replace.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/core-js/modules/library/es6.regexp.search.js b/node_modules/core-js/modules/library/es6.regexp.search.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/core-js/modules/library/es6.regexp.split.js b/node_modules/core-js/modules/library/es6.regexp.split.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/core-js/modules/library/es6.regexp.to-string.js b/node_modules/core-js/modules/library/es6.regexp.to-string.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/core-js/modules/library/web.dom.iterable.js b/node_modules/core-js/modules/library/web.dom.iterable.js new file mode 100644 index 000000000..fc00afac4 --- /dev/null +++ b/node_modules/core-js/modules/library/web.dom.iterable.js @@ -0,0 +1,19 @@ +require('./es6.array.iterator'); +var global = require('./_global'); +var hide = require('./_hide'); +var Iterators = require('./_iterators'); +var TO_STRING_TAG = require('./_wks')('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; +} diff --git a/node_modules/core-js/modules/web.dom.iterable.js b/node_modules/core-js/modules/web.dom.iterable.js new file mode 100644 index 000000000..40834b02b --- /dev/null +++ b/node_modules/core-js/modules/web.dom.iterable.js @@ -0,0 +1,58 @@ +var $iterators = require('./es6.array.iterator'); +var getKeys = require('./_object-keys'); +var redefine = require('./_redefine'); +var global = require('./_global'); +var hide = require('./_hide'); +var Iterators = require('./_iterators'); +var wks = require('./_wks'); +var ITERATOR = wks('iterator'); +var TO_STRING_TAG = wks('toStringTag'); +var ArrayValues = Iterators.Array; + +var DOMIterables = { + CSSRuleList: true, // TODO: Not spec compliant, should be false. + CSSStyleDeclaration: false, + CSSValueList: false, + ClientRectList: false, + DOMRectList: false, + DOMStringList: false, + DOMTokenList: true, + DataTransferItemList: false, + FileList: false, + HTMLAllCollection: false, + HTMLCollection: false, + HTMLFormElement: false, + HTMLSelectElement: false, + MediaList: true, // TODO: Not spec compliant, should be false. + MimeTypeArray: false, + NamedNodeMap: false, + NodeList: true, + PaintRequestList: false, + Plugin: false, + PluginArray: false, + SVGLengthList: false, + SVGNumberList: false, + SVGPathSegList: false, + SVGPointList: false, + SVGStringList: false, + SVGTransformList: false, + SourceBufferList: false, + StyleSheetList: true, // TODO: Not spec compliant, should be false. + TextTrackCueList: false, + TextTrackList: false, + TouchList: false +}; + +for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) { + var NAME = collections[i]; + var explicit = DOMIterables[NAME]; + var Collection = global[NAME]; + var proto = Collection && Collection.prototype; + var key; + if (proto) { + if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues); + if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); + Iterators[NAME] = ArrayValues; + if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true); + } +} diff --git a/node_modules/core-js/modules/web.immediate.js b/node_modules/core-js/modules/web.immediate.js new file mode 100644 index 000000000..70f3e70da --- /dev/null +++ b/node_modules/core-js/modules/web.immediate.js @@ -0,0 +1,6 @@ +var $export = require('./_export'); +var $task = require('./_task'); +$export($export.G + $export.B, { + setImmediate: $task.set, + clearImmediate: $task.clear +}); diff --git a/node_modules/core-js/modules/web.timers.js b/node_modules/core-js/modules/web.timers.js new file mode 100644 index 000000000..c87908304 --- /dev/null +++ b/node_modules/core-js/modules/web.timers.js @@ -0,0 +1,20 @@ +// ie9- setTimeout & setInterval additional parameters fix +var global = require('./_global'); +var $export = require('./_export'); +var userAgent = require('./_user-agent'); +var slice = [].slice; +var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check +var wrap = function (set) { + return function (fn, time /* , ...args */) { + var boundArgs = arguments.length > 2; + var args = boundArgs ? slice.call(arguments, 2) : false; + return set(boundArgs ? function () { + // eslint-disable-next-line no-new-func + (typeof fn == 'function' ? fn : Function(fn)).apply(this, args); + } : fn, time); + }; +}; +$export($export.G + $export.B + $export.F * MSIE, { + setTimeout: wrap(global.setTimeout), + setInterval: wrap(global.setInterval) +}); diff --git a/node_modules/core-js/package.json b/node_modules/core-js/package.json new file mode 100644 index 000000000..910471c80 --- /dev/null +++ b/node_modules/core-js/package.json @@ -0,0 +1,101 @@ +{ + "_from": "core-js@^2.5.7", + "_id": "core-js@2.5.7", + "_inBundle": false, + "_integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==", + "_location": "/core-js", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "core-js@^2.5.7", + "name": "core-js", + "escapedName": "core-js", + "rawSpec": "^2.5.7", + "saveSpec": null, + "fetchSpec": "^2.5.7" + }, + "_requiredBy": [ + "/@babel/polyfill" + ], + "_resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", + "_shasum": "f972608ff0cead68b841a16a932d0b183791814e", + "_spec": "core-js@^2.5.7", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/@babel/polyfill", + "bugs": { + "url": "https://github.com/zloirock/core-js/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Standard library", + "devDependencies": { + "LiveScript": "1.3.x", + "es-observable-tests": "0.2.x", + "eslint": "4.19.x", + "eslint-plugin-import": "2.12.x", + "grunt": "^1.0.2", + "grunt-cli": "^1.2.0", + "grunt-contrib-clean": "^1.1.0", + "grunt-contrib-copy": "^1.0.0", + "grunt-contrib-uglify": "3.3.x", + "grunt-contrib-watch": "^1.0.0", + "grunt-karma": "^2.0.0", + "grunt-livescript": "0.6.x", + "karma": "^2.0.0", + "karma-chrome-launcher": "^2.2.0", + "karma-firefox-launcher": "^1.0.1", + "karma-ie-launcher": "^1.0.0", + "karma-phantomjs-launcher": "1.0.x", + "karma-qunit": "^2.1.0", + "phantomjs-prebuilt": "2.1.x", + "promises-aplus-tests": "^2.1.2", + "qunit": "2.6.x", + "temp": "^0.8.3", + "webpack": "^3.11.0" + }, + "homepage": "https://github.com/zloirock/core-js#readme", + "keywords": [ + "ES3", + "ES5", + "ES6", + "ES7", + "ES2015", + "ES2016", + "ES2017", + "ECMAScript 3", + "ECMAScript 5", + "ECMAScript 6", + "ECMAScript 7", + "ECMAScript 2015", + "ECMAScript 2016", + "ECMAScript 2017", + "Harmony", + "Strawman", + "Map", + "Set", + "WeakMap", + "WeakSet", + "Promise", + "Symbol", + "TypedArray", + "setImmediate", + "Dict", + "polyfill", + "shim" + ], + "license": "MIT", + "main": "index.js", + "name": "core-js", + "repository": { + "type": "git", + "url": "git+https://github.com/zloirock/core-js.git" + }, + "scripts": { + "grunt": "grunt", + "lint": "eslint ./", + "observables-tests": "node tests/observables/adapter && node tests/observables/adapter-library", + "promises-tests": "promises-aplus-tests tests/promises-aplus/adapter", + "test": "npm run grunt clean copy && npm run lint && npm run grunt livescript client karma:default && npm run grunt library karma:library && npm run promises-tests && npm run observables-tests && lsc tests/commonjs" + }, + "version": "2.5.7" +} diff --git a/node_modules/core-js/shim.js b/node_modules/core-js/shim.js new file mode 100644 index 000000000..d865a2a3e --- /dev/null +++ b/node_modules/core-js/shim.js @@ -0,0 +1,197 @@ +require('./modules/es6.symbol'); +require('./modules/es6.object.create'); +require('./modules/es6.object.define-property'); +require('./modules/es6.object.define-properties'); +require('./modules/es6.object.get-own-property-descriptor'); +require('./modules/es6.object.get-prototype-of'); +require('./modules/es6.object.keys'); +require('./modules/es6.object.get-own-property-names'); +require('./modules/es6.object.freeze'); +require('./modules/es6.object.seal'); +require('./modules/es6.object.prevent-extensions'); +require('./modules/es6.object.is-frozen'); +require('./modules/es6.object.is-sealed'); +require('./modules/es6.object.is-extensible'); +require('./modules/es6.object.assign'); +require('./modules/es6.object.is'); +require('./modules/es6.object.set-prototype-of'); +require('./modules/es6.object.to-string'); +require('./modules/es6.function.bind'); +require('./modules/es6.function.name'); +require('./modules/es6.function.has-instance'); +require('./modules/es6.parse-int'); +require('./modules/es6.parse-float'); +require('./modules/es6.number.constructor'); +require('./modules/es6.number.to-fixed'); +require('./modules/es6.number.to-precision'); +require('./modules/es6.number.epsilon'); +require('./modules/es6.number.is-finite'); +require('./modules/es6.number.is-integer'); +require('./modules/es6.number.is-nan'); +require('./modules/es6.number.is-safe-integer'); +require('./modules/es6.number.max-safe-integer'); +require('./modules/es6.number.min-safe-integer'); +require('./modules/es6.number.parse-float'); +require('./modules/es6.number.parse-int'); +require('./modules/es6.math.acosh'); +require('./modules/es6.math.asinh'); +require('./modules/es6.math.atanh'); +require('./modules/es6.math.cbrt'); +require('./modules/es6.math.clz32'); +require('./modules/es6.math.cosh'); +require('./modules/es6.math.expm1'); +require('./modules/es6.math.fround'); +require('./modules/es6.math.hypot'); +require('./modules/es6.math.imul'); +require('./modules/es6.math.log10'); +require('./modules/es6.math.log1p'); +require('./modules/es6.math.log2'); +require('./modules/es6.math.sign'); +require('./modules/es6.math.sinh'); +require('./modules/es6.math.tanh'); +require('./modules/es6.math.trunc'); +require('./modules/es6.string.from-code-point'); +require('./modules/es6.string.raw'); +require('./modules/es6.string.trim'); +require('./modules/es6.string.iterator'); +require('./modules/es6.string.code-point-at'); +require('./modules/es6.string.ends-with'); +require('./modules/es6.string.includes'); +require('./modules/es6.string.repeat'); +require('./modules/es6.string.starts-with'); +require('./modules/es6.string.anchor'); +require('./modules/es6.string.big'); +require('./modules/es6.string.blink'); +require('./modules/es6.string.bold'); +require('./modules/es6.string.fixed'); +require('./modules/es6.string.fontcolor'); +require('./modules/es6.string.fontsize'); +require('./modules/es6.string.italics'); +require('./modules/es6.string.link'); +require('./modules/es6.string.small'); +require('./modules/es6.string.strike'); +require('./modules/es6.string.sub'); +require('./modules/es6.string.sup'); +require('./modules/es6.date.now'); +require('./modules/es6.date.to-json'); +require('./modules/es6.date.to-iso-string'); +require('./modules/es6.date.to-string'); +require('./modules/es6.date.to-primitive'); +require('./modules/es6.array.is-array'); +require('./modules/es6.array.from'); +require('./modules/es6.array.of'); +require('./modules/es6.array.join'); +require('./modules/es6.array.slice'); +require('./modules/es6.array.sort'); +require('./modules/es6.array.for-each'); +require('./modules/es6.array.map'); +require('./modules/es6.array.filter'); +require('./modules/es6.array.some'); +require('./modules/es6.array.every'); +require('./modules/es6.array.reduce'); +require('./modules/es6.array.reduce-right'); +require('./modules/es6.array.index-of'); +require('./modules/es6.array.last-index-of'); +require('./modules/es6.array.copy-within'); +require('./modules/es6.array.fill'); +require('./modules/es6.array.find'); +require('./modules/es6.array.find-index'); +require('./modules/es6.array.species'); +require('./modules/es6.array.iterator'); +require('./modules/es6.regexp.constructor'); +require('./modules/es6.regexp.to-string'); +require('./modules/es6.regexp.flags'); +require('./modules/es6.regexp.match'); +require('./modules/es6.regexp.replace'); +require('./modules/es6.regexp.search'); +require('./modules/es6.regexp.split'); +require('./modules/es6.promise'); +require('./modules/es6.map'); +require('./modules/es6.set'); +require('./modules/es6.weak-map'); +require('./modules/es6.weak-set'); +require('./modules/es6.typed.array-buffer'); +require('./modules/es6.typed.data-view'); +require('./modules/es6.typed.int8-array'); +require('./modules/es6.typed.uint8-array'); +require('./modules/es6.typed.uint8-clamped-array'); +require('./modules/es6.typed.int16-array'); +require('./modules/es6.typed.uint16-array'); +require('./modules/es6.typed.int32-array'); +require('./modules/es6.typed.uint32-array'); +require('./modules/es6.typed.float32-array'); +require('./modules/es6.typed.float64-array'); +require('./modules/es6.reflect.apply'); +require('./modules/es6.reflect.construct'); +require('./modules/es6.reflect.define-property'); +require('./modules/es6.reflect.delete-property'); +require('./modules/es6.reflect.enumerate'); +require('./modules/es6.reflect.get'); +require('./modules/es6.reflect.get-own-property-descriptor'); +require('./modules/es6.reflect.get-prototype-of'); +require('./modules/es6.reflect.has'); +require('./modules/es6.reflect.is-extensible'); +require('./modules/es6.reflect.own-keys'); +require('./modules/es6.reflect.prevent-extensions'); +require('./modules/es6.reflect.set'); +require('./modules/es6.reflect.set-prototype-of'); +require('./modules/es7.array.includes'); +require('./modules/es7.array.flat-map'); +require('./modules/es7.array.flatten'); +require('./modules/es7.string.at'); +require('./modules/es7.string.pad-start'); +require('./modules/es7.string.pad-end'); +require('./modules/es7.string.trim-left'); +require('./modules/es7.string.trim-right'); +require('./modules/es7.string.match-all'); +require('./modules/es7.symbol.async-iterator'); +require('./modules/es7.symbol.observable'); +require('./modules/es7.object.get-own-property-descriptors'); +require('./modules/es7.object.values'); +require('./modules/es7.object.entries'); +require('./modules/es7.object.define-getter'); +require('./modules/es7.object.define-setter'); +require('./modules/es7.object.lookup-getter'); +require('./modules/es7.object.lookup-setter'); +require('./modules/es7.map.to-json'); +require('./modules/es7.set.to-json'); +require('./modules/es7.map.of'); +require('./modules/es7.set.of'); +require('./modules/es7.weak-map.of'); +require('./modules/es7.weak-set.of'); +require('./modules/es7.map.from'); +require('./modules/es7.set.from'); +require('./modules/es7.weak-map.from'); +require('./modules/es7.weak-set.from'); +require('./modules/es7.global'); +require('./modules/es7.system.global'); +require('./modules/es7.error.is-error'); +require('./modules/es7.math.clamp'); +require('./modules/es7.math.deg-per-rad'); +require('./modules/es7.math.degrees'); +require('./modules/es7.math.fscale'); +require('./modules/es7.math.iaddh'); +require('./modules/es7.math.isubh'); +require('./modules/es7.math.imulh'); +require('./modules/es7.math.rad-per-deg'); +require('./modules/es7.math.radians'); +require('./modules/es7.math.scale'); +require('./modules/es7.math.umulh'); +require('./modules/es7.math.signbit'); +require('./modules/es7.promise.finally'); +require('./modules/es7.promise.try'); +require('./modules/es7.reflect.define-metadata'); +require('./modules/es7.reflect.delete-metadata'); +require('./modules/es7.reflect.get-metadata'); +require('./modules/es7.reflect.get-metadata-keys'); +require('./modules/es7.reflect.get-own-metadata'); +require('./modules/es7.reflect.get-own-metadata-keys'); +require('./modules/es7.reflect.has-metadata'); +require('./modules/es7.reflect.has-own-metadata'); +require('./modules/es7.reflect.metadata'); +require('./modules/es7.asap'); +require('./modules/es7.observable'); +require('./modules/web.timers'); +require('./modules/web.immediate'); +require('./modules/web.dom.iterable'); +module.exports = require('./modules/_core'); diff --git a/node_modules/core-js/stage/0.js b/node_modules/core-js/stage/0.js new file mode 100644 index 000000000..4aa50704c --- /dev/null +++ b/node_modules/core-js/stage/0.js @@ -0,0 +1,10 @@ +require('../modules/es7.string.at'); +require('../modules/es7.map.to-json'); +require('../modules/es7.set.to-json'); +require('../modules/es7.error.is-error'); +require('../modules/es7.math.iaddh'); +require('../modules/es7.math.isubh'); +require('../modules/es7.math.imulh'); +require('../modules/es7.math.umulh'); +require('../modules/es7.asap'); +module.exports = require('./1'); diff --git a/node_modules/core-js/stage/1.js b/node_modules/core-js/stage/1.js new file mode 100644 index 000000000..5f634d80b --- /dev/null +++ b/node_modules/core-js/stage/1.js @@ -0,0 +1,23 @@ +require('../modules/es7.map.of'); +require('../modules/es7.set.of'); +require('../modules/es7.weak-map.of'); +require('../modules/es7.weak-set.of'); +require('../modules/es7.map.from'); +require('../modules/es7.set.from'); +require('../modules/es7.weak-map.from'); +require('../modules/es7.weak-set.from'); +require('../modules/es7.math.clamp'); +require('../modules/es7.math.deg-per-rad'); +require('../modules/es7.math.degrees'); +require('../modules/es7.math.fscale'); +require('../modules/es7.math.rad-per-deg'); +require('../modules/es7.math.radians'); +require('../modules/es7.math.scale'); +require('../modules/es7.math.signbit'); +require('../modules/es7.promise.try'); +require('../modules/es7.string.match-all'); +require('../modules/es7.symbol.observable'); +require('../modules/es7.observable'); +require('../modules/es7.array.flat-map'); +require('../modules/es7.array.flatten'); +module.exports = require('./2'); diff --git a/node_modules/core-js/stage/2.js b/node_modules/core-js/stage/2.js new file mode 100644 index 000000000..d7aaa0ef9 --- /dev/null +++ b/node_modules/core-js/stage/2.js @@ -0,0 +1,4 @@ +require('../modules/es7.string.trim-left'); +require('../modules/es7.string.trim-right'); +require('../modules/es7.symbol.async-iterator'); +module.exports = require('./3'); diff --git a/node_modules/core-js/stage/3.js b/node_modules/core-js/stage/3.js new file mode 100644 index 000000000..9afd07fe9 --- /dev/null +++ b/node_modules/core-js/stage/3.js @@ -0,0 +1,4 @@ +require('../modules/es7.global'); +require('../modules/es7.system.global'); +require('../modules/es7.promise.finally'); +module.exports = require('./4'); diff --git a/node_modules/core-js/stage/4.js b/node_modules/core-js/stage/4.js new file mode 100644 index 000000000..875762a23 --- /dev/null +++ b/node_modules/core-js/stage/4.js @@ -0,0 +1,11 @@ +require('../modules/es7.object.define-getter'); +require('../modules/es7.object.define-setter'); +require('../modules/es7.object.lookup-getter'); +require('../modules/es7.object.lookup-setter'); +require('../modules/es7.object.values'); +require('../modules/es7.object.entries'); +require('../modules/es7.object.get-own-property-descriptors'); +require('../modules/es7.array.includes'); +require('../modules/es7.string.pad-start'); +require('../modules/es7.string.pad-end'); +module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/stage/index.js b/node_modules/core-js/stage/index.js new file mode 100644 index 000000000..24dcf2e56 --- /dev/null +++ b/node_modules/core-js/stage/index.js @@ -0,0 +1 @@ +module.exports = require('./pre'); diff --git a/node_modules/core-js/stage/pre.js b/node_modules/core-js/stage/pre.js new file mode 100644 index 000000000..ed197a8ba --- /dev/null +++ b/node_modules/core-js/stage/pre.js @@ -0,0 +1,10 @@ +require('../modules/es7.reflect.define-metadata'); +require('../modules/es7.reflect.delete-metadata'); +require('../modules/es7.reflect.get-metadata'); +require('../modules/es7.reflect.get-metadata-keys'); +require('../modules/es7.reflect.get-own-metadata'); +require('../modules/es7.reflect.get-own-metadata-keys'); +require('../modules/es7.reflect.has-metadata'); +require('../modules/es7.reflect.has-own-metadata'); +require('../modules/es7.reflect.metadata'); +module.exports = require('./0'); diff --git a/node_modules/core-js/web/dom-collections.js b/node_modules/core-js/web/dom-collections.js new file mode 100644 index 000000000..a138bb9dd --- /dev/null +++ b/node_modules/core-js/web/dom-collections.js @@ -0,0 +1,2 @@ +require('../modules/web.dom.iterable'); +module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/web/immediate.js b/node_modules/core-js/web/immediate.js new file mode 100644 index 000000000..6866abdeb --- /dev/null +++ b/node_modules/core-js/web/immediate.js @@ -0,0 +1,2 @@ +require('../modules/web.immediate'); +module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/web/index.js b/node_modules/core-js/web/index.js new file mode 100644 index 000000000..66db256d6 --- /dev/null +++ b/node_modules/core-js/web/index.js @@ -0,0 +1,4 @@ +require('../modules/web.timers'); +require('../modules/web.immediate'); +require('../modules/web.dom.iterable'); +module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/web/timers.js b/node_modules/core-js/web/timers.js new file mode 100644 index 000000000..a3f528e4d --- /dev/null +++ b/node_modules/core-js/web/timers.js @@ -0,0 +1,2 @@ +require('../modules/web.timers'); +module.exports = require('../modules/_core'); diff --git a/node_modules/core-util-is/LICENSE b/node_modules/core-util-is/LICENSE new file mode 100644 index 000000000..d8d7f9437 --- /dev/null +++ b/node_modules/core-util-is/LICENSE @@ -0,0 +1,19 @@ +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/node_modules/core-util-is/README.md b/node_modules/core-util-is/README.md new file mode 100644 index 000000000..5a76b4149 --- /dev/null +++ b/node_modules/core-util-is/README.md @@ -0,0 +1,3 @@ +# core-util-is + +The `util.is*` functions introduced in Node v0.12. diff --git a/node_modules/core-util-is/float.patch b/node_modules/core-util-is/float.patch new file mode 100644 index 000000000..a06d5c05f --- /dev/null +++ b/node_modules/core-util-is/float.patch @@ -0,0 +1,604 @@ +diff --git a/lib/util.js b/lib/util.js +index a03e874..9074e8e 100644 +--- a/lib/util.js ++++ b/lib/util.js +@@ -19,430 +19,6 @@ + // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + // USE OR OTHER DEALINGS IN THE SOFTWARE. + +-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) { +- // Allow for deprecating things in the process of starting up. +- if (isUndefined(global.process)) { +- return function() { +- return exports.deprecate(fn, msg).apply(this, arguments); +- }; +- } +- +- if (process.noDeprecation === true) { +- return fn; +- } +- +- 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 = process.env.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); +- } +- +- // 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)) { +- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0, +- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 . +- if (value === 0 && 1 / value < 0) +- return ctx.stylize('-0', 'number'); +- 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) { +@@ -522,166 +98,10 @@ function isPrimitive(arg) { + exports.isPrimitive = isPrimitive; + + function isBuffer(arg) { +- return arg instanceof Buffer; ++ return Buffer.isBuffer(arg); + } + exports.isBuffer = isBuffer; + + 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 = function(ctor, superCtor) { +- ctor.super_ = superCtor; +- ctor.prototype = Object.create(superCtor.prototype, { +- constructor: { +- value: ctor, +- enumerable: false, +- writable: true, +- configurable: true +- } +- }); +-}; +- +-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); +-} +- +- +-// Deprecated old stuff. +- +-exports.p = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- console.error(exports.inspect(arguments[i])); +- } +-}, 'util.p: Use console.error() instead'); +- +- +-exports.exec = exports.deprecate(function() { +- return require('child_process').exec.apply(this, arguments); +-}, 'util.exec is now called `child_process.exec`.'); +- +- +-exports.print = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stdout.write(String(arguments[i])); +- } +-}, 'util.print: Use console.log instead'); +- +- +-exports.puts = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stdout.write(arguments[i] + '\n'); +- } +-}, 'util.puts: Use console.log instead'); +- +- +-exports.debug = exports.deprecate(function(x) { +- process.stderr.write('DEBUG: ' + x + '\n'); +-}, 'util.debug: Use console.error instead'); +- +- +-exports.error = exports.deprecate(function(x) { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stderr.write(arguments[i] + '\n'); +- } +-}, 'util.error: Use console.error instead'); +- +- +-exports.pump = exports.deprecate(function(readStream, writeStream, callback) { +- var callbackCalled = false; +- +- function call(a, b, c) { +- if (callback && !callbackCalled) { +- callback(a, b, c); +- callbackCalled = true; +- } +- } +- +- readStream.addListener('data', function(chunk) { +- if (writeStream.write(chunk) === false) readStream.pause(); +- }); +- +- writeStream.addListener('drain', function() { +- readStream.resume(); +- }); +- +- readStream.addListener('end', function() { +- writeStream.end(); +- }); +- +- readStream.addListener('close', function() { +- call(); +- }); +- +- readStream.addListener('error', function(err) { +- writeStream.end(); +- call(err); +- }); +- +- writeStream.addListener('error', function(err) { +- readStream.destroy(); +- call(err); +- }); +-}, 'util.pump(): Use readableStream.pipe() instead'); +- +- +-var uv; +-exports._errnoException = function(err, syscall) { +- if (isUndefined(uv)) uv = process.binding('uv'); +- var errname = uv.errname(err); +- var e = new Error(syscall + ' ' + errname); +- e.code = errname; +- e.errno = errname; +- e.syscall = syscall; +- return e; +-}; ++} \ No newline at end of file diff --git a/node_modules/core-util-is/lib/util.js b/node_modules/core-util-is/lib/util.js new file mode 100644 index 000000000..ff4c851c0 --- /dev/null +++ b/node_modules/core-util-is/lib/util.js @@ -0,0 +1,107 @@ +// 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. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. + +function isArray(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString(arg) === '[object Array]'; +} +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 objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return (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 = Buffer.isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} diff --git a/node_modules/core-util-is/package.json b/node_modules/core-util-is/package.json new file mode 100644 index 000000000..b0b38e3f0 --- /dev/null +++ b/node_modules/core-util-is/package.json @@ -0,0 +1,64 @@ +{ + "_from": "core-util-is@>=1.0.1 <1.1.0-0", + "_id": "core-util-is@1.0.2", + "_inBundle": false, + "_integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "_location": "/core-util-is", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "core-util-is@>=1.0.1 <1.1.0-0", + "name": "core-util-is", + "escapedName": "core-util-is", + "rawSpec": ">=1.0.1 <1.1.0-0", + "saveSpec": null, + "fetchSpec": ">=1.0.1 <1.1.0-0" + }, + "_requiredBy": [ + "/bole", + "/readable-stream", + "/split2/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", + "_spec": "core-util-is@>=1.0.1 <1.1.0-0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/bole", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/core-util-is/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "The `util.is*` functions introduced in Node v0.12.", + "devDependencies": { + "tap": "^2.3.0" + }, + "homepage": "https://github.com/isaacs/core-util-is#readme", + "keywords": [ + "util", + "isBuffer", + "isArray", + "isNumber", + "isString", + "isRegExp", + "isThis", + "isThat", + "polyfill" + ], + "license": "MIT", + "main": "lib/util.js", + "name": "core-util-is", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/core-util-is.git" + }, + "scripts": { + "test": "tap test.js" + }, + "version": "1.0.2" +} diff --git a/node_modules/core-util-is/test.js b/node_modules/core-util-is/test.js new file mode 100644 index 000000000..1a490c65a --- /dev/null +++ b/node_modules/core-util-is/test.js @@ -0,0 +1,68 @@ +var assert = require('tap'); + +var t = require('./lib/util'); + +assert.equal(t.isArray([]), true); +assert.equal(t.isArray({}), false); + +assert.equal(t.isBoolean(null), false); +assert.equal(t.isBoolean(true), true); +assert.equal(t.isBoolean(false), true); + +assert.equal(t.isNull(null), true); +assert.equal(t.isNull(undefined), false); +assert.equal(t.isNull(false), false); +assert.equal(t.isNull(), false); + +assert.equal(t.isNullOrUndefined(null), true); +assert.equal(t.isNullOrUndefined(undefined), true); +assert.equal(t.isNullOrUndefined(false), false); +assert.equal(t.isNullOrUndefined(), true); + +assert.equal(t.isNumber(null), false); +assert.equal(t.isNumber('1'), false); +assert.equal(t.isNumber(1), true); + +assert.equal(t.isString(null), false); +assert.equal(t.isString('1'), true); +assert.equal(t.isString(1), false); + +assert.equal(t.isSymbol(null), false); +assert.equal(t.isSymbol('1'), false); +assert.equal(t.isSymbol(1), false); +assert.equal(t.isSymbol(Symbol()), true); + +assert.equal(t.isUndefined(null), false); +assert.equal(t.isUndefined(undefined), true); +assert.equal(t.isUndefined(false), false); +assert.equal(t.isUndefined(), true); + +assert.equal(t.isRegExp(null), false); +assert.equal(t.isRegExp('1'), false); +assert.equal(t.isRegExp(new RegExp()), true); + +assert.equal(t.isObject({}), true); +assert.equal(t.isObject([]), true); +assert.equal(t.isObject(new RegExp()), true); +assert.equal(t.isObject(new Date()), true); + +assert.equal(t.isDate(null), false); +assert.equal(t.isDate('1'), false); +assert.equal(t.isDate(new Date()), true); + +assert.equal(t.isError(null), false); +assert.equal(t.isError({ err: true }), false); +assert.equal(t.isError(new Error()), true); + +assert.equal(t.isFunction(null), false); +assert.equal(t.isFunction({ }), false); +assert.equal(t.isFunction(function() {}), true); + +assert.equal(t.isPrimitive(null), true); +assert.equal(t.isPrimitive(''), true); +assert.equal(t.isPrimitive(0), true); +assert.equal(t.isPrimitive(new Date()), false); + +assert.equal(t.isBuffer(null), false); +assert.equal(t.isBuffer({}), false); +assert.equal(t.isBuffer(new Buffer(0)), true); diff --git a/node_modules/create-ecdh/.travis.yml b/node_modules/create-ecdh/.travis.yml new file mode 100644 index 000000000..4ceadcbea --- /dev/null +++ b/node_modules/create-ecdh/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +sudo: false +node_js: + - 6 + - 8 + - 9 + - 10 diff --git a/node_modules/create-ecdh/LICENSE b/node_modules/create-ecdh/LICENSE new file mode 100644 index 000000000..58b3e845c --- /dev/null +++ b/node_modules/create-ecdh/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017 createECDH 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. diff --git a/node_modules/create-ecdh/browser.js b/node_modules/create-ecdh/browser.js new file mode 100644 index 000000000..3613b4514 --- /dev/null +++ b/node_modules/create-ecdh/browser.js @@ -0,0 +1,124 @@ +var elliptic = require('elliptic') +var BN = require('bn.js') + +module.exports = function createECDH (curve) { + return new ECDH(curve) +} + +var aliases = { + secp256k1: { + name: 'secp256k1', + byteLength: 32 + }, + secp224r1: { + name: 'p224', + byteLength: 28 + }, + prime256v1: { + name: 'p256', + byteLength: 32 + }, + prime192v1: { + name: 'p192', + byteLength: 24 + }, + ed25519: { + name: 'ed25519', + byteLength: 32 + }, + secp384r1: { + name: 'p384', + byteLength: 48 + }, + secp521r1: { + name: 'p521', + byteLength: 66 + } +} + +aliases.p224 = aliases.secp224r1 +aliases.p256 = aliases.secp256r1 = aliases.prime256v1 +aliases.p192 = aliases.secp192r1 = aliases.prime192v1 +aliases.p384 = aliases.secp384r1 +aliases.p521 = aliases.secp521r1 + +function ECDH (curve) { + this.curveType = aliases[curve] + if (!this.curveType) { + this.curveType = { + name: curve + } + } + this.curve = new elliptic.ec(this.curveType.name) // eslint-disable-line new-cap + this.keys = void 0 +} + +ECDH.prototype.generateKeys = function (enc, format) { + this.keys = this.curve.genKeyPair() + return this.getPublicKey(enc, format) +} + +ECDH.prototype.computeSecret = function (other, inenc, enc) { + inenc = inenc || 'utf8' + if (!Buffer.isBuffer(other)) { + other = new Buffer(other, inenc) + } + var otherPub = this.curve.keyFromPublic(other).getPublic() + var out = otherPub.mul(this.keys.getPrivate()).getX() + return formatReturnValue(out, enc, this.curveType.byteLength) +} + +ECDH.prototype.getPublicKey = function (enc, format) { + var key = this.keys.getPublic(format === 'compressed', true) + if (format === 'hybrid') { + if (key[key.length - 1] % 2) { + key[0] = 7 + } else { + key[0] = 6 + } + } + return formatReturnValue(key, enc) +} + +ECDH.prototype.getPrivateKey = function (enc) { + return formatReturnValue(this.keys.getPrivate(), enc) +} + +ECDH.prototype.setPublicKey = function (pub, enc) { + enc = enc || 'utf8' + if (!Buffer.isBuffer(pub)) { + pub = new Buffer(pub, enc) + } + this.keys._importPublic(pub) + return this +} + +ECDH.prototype.setPrivateKey = function (priv, enc) { + enc = enc || 'utf8' + if (!Buffer.isBuffer(priv)) { + priv = new Buffer(priv, enc) + } + + var _priv = new BN(priv) + _priv = _priv.toString(16) + this.keys = this.curve.genKeyPair() + this.keys._importPrivate(_priv) + return this +} + +function formatReturnValue (bn, enc, len) { + if (!Array.isArray(bn)) { + bn = bn.toArray() + } + var buf = new Buffer(bn) + if (len && buf.length < len) { + var zeros = new Buffer(len - buf.length) + zeros.fill(0) + buf = Buffer.concat([zeros, buf]) + } + if (!enc) { + return buf + } else { + return buf.toString(enc) + } +} diff --git a/node_modules/create-ecdh/index.js b/node_modules/create-ecdh/index.js new file mode 100644 index 000000000..841d085ec --- /dev/null +++ b/node_modules/create-ecdh/index.js @@ -0,0 +1,3 @@ +var createECDH = require('crypto').createECDH + +module.exports = createECDH || require('./browser') diff --git a/node_modules/create-ecdh/package.json b/node_modules/create-ecdh/package.json new file mode 100644 index 000000000..addfb0743 --- /dev/null +++ b/node_modules/create-ecdh/package.json @@ -0,0 +1,62 @@ +{ + "_from": "create-ecdh@^4.0.0", + "_id": "create-ecdh@4.0.3", + "_inBundle": false, + "_integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", + "_location": "/create-ecdh", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "create-ecdh@^4.0.0", + "name": "create-ecdh", + "escapedName": "create-ecdh", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/crypto-browserify" + ], + "_resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", + "_shasum": "c9111b6f33045c4697f144787f9254cdc77c45ff", + "_spec": "create-ecdh@^4.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/crypto-browserify", + "author": { + "name": "Calvin Metcalf" + }, + "browser": "browser.js", + "bugs": { + "url": "https://github.com/crypto-browserify/createECDH/issues" + }, + "bundleDependencies": false, + "dependencies": { + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" + }, + "deprecated": false, + "description": "createECDH but browserifiable", + "devDependencies": { + "standard": "^5.4.1", + "tap-spec": "^1.0.1", + "tape": "^3.0.1" + }, + "homepage": "https://github.com/crypto-browserify/createECDH", + "keywords": [ + "diffie", + "hellman", + "diffiehellman", + "ECDH" + ], + "license": "MIT", + "main": "index.js", + "name": "create-ecdh", + "repository": { + "type": "git", + "url": "git+https://github.com/crypto-browserify/createECDH.git" + }, + "scripts": { + "test": "standard && node test.js | tspec" + }, + "version": "4.0.3" +} diff --git a/node_modules/create-ecdh/readme.md b/node_modules/create-ecdh/readme.md new file mode 100644 index 000000000..7e5ce47b5 --- /dev/null +++ b/node_modules/create-ecdh/readme.md @@ -0,0 +1,4 @@ +createECDH [![Build Status](https://travis-ci.org/crypto-browserify/createECDH.svg)](https://travis-ci.org/crypto-browserify/createECDH) +==== + +In io.js or node >= 0.11 this module is just a shortcut to crypto.createECDH. In node <= 0.11 or the browser this is a pure JavaScript implimentation, more specifically a wrapper around [elliptic](https://github.com/indutny/elliptic), to give it the same API as node. `secp256k1`, `secp224r1` (aka p224), `prime256v1` (aka p256, secp256r1), `prime192v1` (aka p192, secp192r1), `secp384r1` (aka p384), `secp521r1` (aka p521) curves all work in both this library and node (though only the highlighted name will work in node). diff --git a/node_modules/create-hash/.travis.yml b/node_modules/create-hash/.travis.yml new file mode 100644 index 000000000..da59431d2 --- /dev/null +++ b/node_modules/create-hash/.travis.yml @@ -0,0 +1,17 @@ +sudo: false +language: node_js +before_install: + - "npm install npm -g" +node_js: + - "4" + - "5" + - "6" + - "7" +env: + matrix: + - TEST_SUITE=unit +matrix: + include: + - node_js: "7" + env: TEST_SUITE=standard +script: npm run $TEST_SUITE diff --git a/node_modules/create-hash/LICENSE b/node_modules/create-hash/LICENSE new file mode 100644 index 000000000..f06007ae3 --- /dev/null +++ b/node_modules/create-hash/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 crypto-browserify 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. diff --git a/node_modules/create-hash/README.md b/node_modules/create-hash/README.md new file mode 100644 index 000000000..bad028d32 --- /dev/null +++ b/node_modules/create-hash/README.md @@ -0,0 +1,19 @@ +# create-hash + +[![Build Status](https://travis-ci.org/crypto-browserify/createHash.svg)](https://travis-ci.org/crypto-browserify/createHash) + +Node style hashes for use in the browser, with native hash functions in node. + +API is the same as hashes in node: +```js +var createHash = require('create-hash') +var hash = createHash('sha224') +hash.update('synchronous write') // optional encoding parameter +hash.digest() // synchronously get result with optional encoding parameter + +hash.write('write to it as a stream') +hash.end() // remember it's a stream +hash.read() // only if you ended it as a stream though +``` + +To get the JavaScript version even in node do `require('create-hash/browser')` diff --git a/node_modules/create-hash/browser.js b/node_modules/create-hash/browser.js new file mode 100644 index 000000000..01841bb9b --- /dev/null +++ b/node_modules/create-hash/browser.js @@ -0,0 +1,30 @@ +'use strict' +var inherits = require('inherits') +var MD5 = require('md5.js') +var RIPEMD160 = require('ripemd160') +var sha = require('sha.js') +var Base = require('cipher-base') + +function Hash (hash) { + Base.call(this, 'digest') + + this._hash = hash +} + +inherits(Hash, Base) + +Hash.prototype._update = function (data) { + this._hash.update(data) +} + +Hash.prototype._final = function () { + return this._hash.digest() +} + +module.exports = function createHash (alg) { + alg = alg.toLowerCase() + if (alg === 'md5') return new MD5() + if (alg === 'rmd160' || alg === 'ripemd160') return new RIPEMD160() + + return new Hash(sha(alg)) +} diff --git a/node_modules/create-hash/index.js b/node_modules/create-hash/index.js new file mode 100644 index 000000000..658f6a02e --- /dev/null +++ b/node_modules/create-hash/index.js @@ -0,0 +1 @@ +module.exports = require('crypto').createHash diff --git a/node_modules/create-hash/md5.js b/node_modules/create-hash/md5.js new file mode 100644 index 000000000..3643ee299 --- /dev/null +++ b/node_modules/create-hash/md5.js @@ -0,0 +1,5 @@ +var MD5 = require('md5.js') + +module.exports = function (buffer) { + return new MD5().update(buffer).digest() +} diff --git a/node_modules/create-hash/package.json b/node_modules/create-hash/package.json new file mode 100644 index 000000000..90e7a1e38 --- /dev/null +++ b/node_modules/create-hash/package.json @@ -0,0 +1,70 @@ +{ + "_from": "create-hash@^1.1.0", + "_id": "create-hash@1.2.0", + "_inBundle": false, + "_integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "_location": "/create-hash", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "create-hash@^1.1.0", + "name": "create-hash", + "escapedName": "create-hash", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/browserify-aes", + "/browserify-sign", + "/create-hmac", + "/crypto-browserify", + "/parse-asn1", + "/pbkdf2", + "/public-encrypt" + ], + "_resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "_shasum": "889078af11a63756bcfb59bd221996be3a9ef196", + "_spec": "create-hash@^1.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/crypto-browserify", + "author": "", + "browser": "browser.js", + "bugs": { + "url": "https://github.com/crypto-browserify/createHash/issues" + }, + "bundleDependencies": false, + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + }, + "deprecated": false, + "description": "create hashes for browserify", + "devDependencies": { + "hash-test-vectors": "^1.3.2", + "safe-buffer": "^5.0.1", + "standard": "^10.0.2", + "tap-spec": "^2.1.2", + "tape": "^4.6.3" + }, + "homepage": "https://github.com/crypto-browserify/createHash", + "keywords": [ + "crypto" + ], + "license": "MIT", + "main": "index.js", + "name": "create-hash", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/crypto-browserify/createHash.git" + }, + "scripts": { + "standard": "standard", + "test": "npm run-script standard && npm run-script unit", + "unit": "node test.js | tspec" + }, + "version": "1.2.0" +} diff --git a/node_modules/create-hash/test.js b/node_modules/create-hash/test.js new file mode 100644 index 000000000..7c98f9fca --- /dev/null +++ b/node_modules/create-hash/test.js @@ -0,0 +1,41 @@ +var test = require('tape') + +var Buffer = require('safe-buffer').Buffer +var algorithms = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160', 'ripemd160'] +var encodings = ['hex', 'base64'] // ignore binary +var vectors = require('hash-test-vectors') +vectors.forEach(function (vector) { + vector.ripemd160 = vector.rmd160 +}) +var createHash = require('./browser') + +algorithms.forEach(function (algorithm) { + test('test ' + algorithm + ' against test vectors', function (t) { + vectors.forEach(function (obj, i) { + var input = Buffer.from(obj.input, 'base64') + var node = obj[algorithm] + var js = createHash(algorithm).update(input).digest('hex') + t.equal(js, node, algorithm + '(testVector[' + i + ']) == ' + node) + }) + + encodings.forEach(function (encoding) { + vectors.forEach(function (obj, i) { + var input = Buffer.from(obj.input, 'base64').toString(encoding) + var node = obj[algorithm] + var js = createHash(algorithm).update(input, encoding).digest('hex') + t.equal(js, node, algorithm + '(testVector[' + i + '], ' + encoding + ') == ' + node) + }) + }) + + vectors.forEach(function (obj, i) { + var input = Buffer.from(obj.input, 'base64') + var node = obj[algorithm] + var hash = createHash(algorithm) + hash.end(input) + var js = hash.read().toString('hex') + t.equal(js, node, algorithm + '(testVector[' + i + ']) == ' + node) + }) + + t.end() + }) +}) diff --git a/node_modules/create-hmac/LICENSE b/node_modules/create-hmac/LICENSE new file mode 100644 index 000000000..f06007ae3 --- /dev/null +++ b/node_modules/create-hmac/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 crypto-browserify 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. diff --git a/node_modules/create-hmac/README.md b/node_modules/create-hmac/README.md new file mode 100644 index 000000000..e8de47f8a --- /dev/null +++ b/node_modules/create-hmac/README.md @@ -0,0 +1,20 @@ +# create-hmac + +[![NPM Package](https://img.shields.io/npm/v/create-hmac.svg?style=flat-square)](https://www.npmjs.org/package/create-hmac) +[![Build Status](https://img.shields.io/travis/crypto-browserify/createHmac.svg?branch=master&style=flat-square)](https://travis-ci.org/crypto-browserify/createHmac) +[![Dependency status](https://img.shields.io/david/crypto-browserify/createHmac.svg?style=flat-square)](https://david-dm.org/crypto-browserify/createHmac#info=dependencies) + +[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) + +Node style HMACs for use in the browser, with native HMAC functions in node. API is the same as HMACs in node: + +```js +var createHmac = require('create-hmac') +var hmac = createHmac('sha224', Buffer.from('secret key')) +hmac.update('synchronous write') //optional encoding parameter +hmac.digest() // synchronously get result with optional encoding parameter + +hmac.write('write to it as a stream') +hmac.end() //remember it's a stream +hmac.read() //only if you ended it as a stream though +``` diff --git a/node_modules/create-hmac/browser.js b/node_modules/create-hmac/browser.js new file mode 100644 index 000000000..a5c9b61ea --- /dev/null +++ b/node_modules/create-hmac/browser.js @@ -0,0 +1,62 @@ +'use strict' +var inherits = require('inherits') +var Legacy = require('./legacy') +var Base = require('cipher-base') +var Buffer = require('safe-buffer').Buffer +var md5 = require('create-hash/md5') +var RIPEMD160 = require('ripemd160') + +var sha = require('sha.js') + +var ZEROS = Buffer.alloc(128) + +function Hmac (alg, key) { + Base.call(this, 'digest') + if (typeof key === 'string') { + key = Buffer.from(key) + } + + var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64 + + this._alg = alg + this._key = key + if (key.length > blocksize) { + var hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg) + key = hash.update(key).digest() + } else if (key.length < blocksize) { + key = Buffer.concat([key, ZEROS], blocksize) + } + + var ipad = this._ipad = Buffer.allocUnsafe(blocksize) + var opad = this._opad = Buffer.allocUnsafe(blocksize) + + for (var i = 0; i < blocksize; i++) { + ipad[i] = key[i] ^ 0x36 + opad[i] = key[i] ^ 0x5C + } + this._hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg) + this._hash.update(ipad) +} + +inherits(Hmac, Base) + +Hmac.prototype._update = function (data) { + this._hash.update(data) +} + +Hmac.prototype._final = function () { + var h = this._hash.digest() + var hash = this._alg === 'rmd160' ? new RIPEMD160() : sha(this._alg) + return hash.update(this._opad).update(h).digest() +} + +module.exports = function createHmac (alg, key) { + alg = alg.toLowerCase() + if (alg === 'rmd160' || alg === 'ripemd160') { + return new Hmac('rmd160', key) + } + if (alg === 'md5') { + return new Legacy(md5, key) + } + return new Hmac(alg, key) +} diff --git a/node_modules/create-hmac/index.js b/node_modules/create-hmac/index.js new file mode 100644 index 000000000..ec8c4f728 --- /dev/null +++ b/node_modules/create-hmac/index.js @@ -0,0 +1 @@ +module.exports = require('crypto').createHmac diff --git a/node_modules/create-hmac/legacy.js b/node_modules/create-hmac/legacy.js new file mode 100644 index 000000000..5039c2a7a --- /dev/null +++ b/node_modules/create-hmac/legacy.js @@ -0,0 +1,46 @@ +'use strict' +var inherits = require('inherits') +var Buffer = require('safe-buffer').Buffer + +var Base = require('cipher-base') + +var ZEROS = Buffer.alloc(128) +var blocksize = 64 + +function Hmac (alg, key) { + Base.call(this, 'digest') + if (typeof key === 'string') { + key = Buffer.from(key) + } + + this._alg = alg + this._key = key + + if (key.length > blocksize) { + key = alg(key) + } else if (key.length < blocksize) { + key = Buffer.concat([key, ZEROS], blocksize) + } + + var ipad = this._ipad = Buffer.allocUnsafe(blocksize) + var opad = this._opad = Buffer.allocUnsafe(blocksize) + + for (var i = 0; i < blocksize; i++) { + ipad[i] = key[i] ^ 0x36 + opad[i] = key[i] ^ 0x5C + } + + this._hash = [ipad] +} + +inherits(Hmac, Base) + +Hmac.prototype._update = function (data) { + this._hash.push(data) +} + +Hmac.prototype._final = function () { + var h = this._alg(Buffer.concat(this._hash)) + return this._alg(Buffer.concat([this._opad, h])) +} +module.exports = Hmac diff --git a/node_modules/create-hmac/package.json b/node_modules/create-hmac/package.json new file mode 100644 index 000000000..abfd4d1c0 --- /dev/null +++ b/node_modules/create-hmac/package.json @@ -0,0 +1,72 @@ +{ + "_from": "create-hmac@^1.1.0", + "_id": "create-hmac@1.1.7", + "_inBundle": false, + "_integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "_location": "/create-hmac", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "create-hmac@^1.1.0", + "name": "create-hmac", + "escapedName": "create-hmac", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/browserify-sign", + "/crypto-browserify", + "/pbkdf2" + ], + "_resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "_shasum": "69170c78b3ab957147b2b8b04572e47ead2243ff", + "_spec": "create-hmac@^1.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/crypto-browserify", + "author": "", + "browser": "./browser.js", + "bugs": { + "url": "https://github.com/crypto-browserify/createHmac/issues" + }, + "bundleDependencies": false, + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + }, + "deprecated": false, + "description": "node style hmacs in the browser", + "devDependencies": { + "hash-test-vectors": "^1.3.2", + "standard": "^5.3.1", + "tap-spec": "^2.1.2", + "tape": "^3.0.3" + }, + "files": [ + "browser.js", + "index.js", + "legacy.js" + ], + "homepage": "https://github.com/crypto-browserify/createHmac", + "keywords": [ + "crypto", + "hmac" + ], + "license": "MIT", + "main": "index.js", + "name": "create-hmac", + "repository": { + "type": "git", + "url": "git+https://github.com/crypto-browserify/createHmac.git" + }, + "scripts": { + "standard": "standard", + "test": "npm run-script standard && npm run-script unit", + "unit": "node test.js | tspec" + }, + "version": "1.1.7" +} diff --git a/node_modules/cross-spawn/CHANGELOG.md b/node_modules/cross-spawn/CHANGELOG.md new file mode 100644 index 000000000..ded9620b1 --- /dev/null +++ b/node_modules/cross-spawn/CHANGELOG.md @@ -0,0 +1,100 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +## [6.0.5](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.4...v6.0.5) (2018-03-02) + + +### Bug Fixes + +* avoid using deprecated Buffer constructor ([#94](https://github.com/moxystudio/node-cross-spawn/issues/94)) ([d5770df](https://github.com/moxystudio/node-cross-spawn/commit/d5770df)), closes [/nodejs.org/api/deprecations.html#deprecations_dep0005](https://github.com//nodejs.org/api/deprecations.html/issues/deprecations_dep0005) + + + + +## [6.0.4](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.3...v6.0.4) (2018-01-31) + + +### Bug Fixes + +* fix paths being incorrectly normalized on unix ([06ee3c6](https://github.com/moxystudio/node-cross-spawn/commit/06ee3c6)), closes [#90](https://github.com/moxystudio/node-cross-spawn/issues/90) + + + + +## [6.0.3](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.2...v6.0.3) (2018-01-23) + + + + +## [6.0.2](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.1...v6.0.2) (2018-01-23) + + + + +## [6.0.1](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.0...v6.0.1) (2018-01-23) + + + + +# [6.0.0](https://github.com/moxystudio/node-cross-spawn/compare/5.1.0...6.0.0) (2018-01-23) + + +### Bug Fixes + +* fix certain arguments not being correctly escaped or causing batch syntax error ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10)), closes [#82](https://github.com/moxystudio/node-cross-spawn/issues/82) [#51](https://github.com/moxystudio/node-cross-spawn/issues/51) +* fix commands as posix relatixe paths not working correctly, e.g.: `./my-command` ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10)) +* fix `options` argument being mutated ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10)) +* fix commands resolution when PATH was actually Path ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10)) + + +### Features + +* improve compliance with node's ENOENT errors ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10)) +* improve detection of node's shell option support ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10)) + + +### Chores + +* upgrade tooling +* upgrate project to es6 (node v4) + + +### BREAKING CHANGES + +* remove support for older nodejs versions, only `node >= 4` is supported + + + +## [5.1.0](https://github.com/moxystudio/node-cross-spawn/compare/5.0.1...5.1.0) (2017-02-26) + + +### Bug Fixes + +* fix `options.shell` support for NodeJS [v4.8](https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V4.md#4.8.0) + + + +## [5.0.1](https://github.com/moxystudio/node-cross-spawn/compare/5.0.0...5.0.1) (2016-11-04) + + +### Bug Fixes + +* fix `options.shell` support for NodeJS v7 + + + +# [5.0.0](https://github.com/moxystudio/node-cross-spawn/compare/4.0.2...5.0.0) (2016-10-30) + + +## Features + +* add support for `options.shell` +* improve parsing of shebangs by using [`shebang-command`](https://github.com/kevva/shebang-command) module + + +## Chores + +* refactor some code to make it more clear +* update README caveats diff --git a/node_modules/cross-spawn/LICENSE b/node_modules/cross-spawn/LICENSE new file mode 100644 index 000000000..8407b9a30 --- /dev/null +++ b/node_modules/cross-spawn/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 Made With MOXY Lda + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/cross-spawn/README.md b/node_modules/cross-spawn/README.md new file mode 100644 index 000000000..e895cd7a7 --- /dev/null +++ b/node_modules/cross-spawn/README.md @@ -0,0 +1,94 @@ +# cross-spawn + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Build status][appveyor-image]][appveyor-url] [![Coverage Status][codecov-image]][codecov-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url] [![Greenkeeper badge][greenkeeper-image]][greenkeeper-url] + +[npm-url]:https://npmjs.org/package/cross-spawn +[downloads-image]:http://img.shields.io/npm/dm/cross-spawn.svg +[npm-image]:http://img.shields.io/npm/v/cross-spawn.svg +[travis-url]:https://travis-ci.org/moxystudio/node-cross-spawn +[travis-image]:http://img.shields.io/travis/moxystudio/node-cross-spawn/master.svg +[appveyor-url]:https://ci.appveyor.com/project/satazor/node-cross-spawn +[appveyor-image]:https://img.shields.io/appveyor/ci/satazor/node-cross-spawn/master.svg +[codecov-url]:https://codecov.io/gh/moxystudio/node-cross-spawn +[codecov-image]:https://img.shields.io/codecov/c/github/moxystudio/node-cross-spawn/master.svg +[david-dm-url]:https://david-dm.org/moxystudio/node-cross-spawn +[david-dm-image]:https://img.shields.io/david/moxystudio/node-cross-spawn.svg +[david-dm-dev-url]:https://david-dm.org/moxystudio/node-cross-spawn?type=dev +[david-dm-dev-image]:https://img.shields.io/david/dev/moxystudio/node-cross-spawn.svg +[greenkeeper-image]:https://badges.greenkeeper.io/moxystudio/node-cross-spawn.svg +[greenkeeper-url]:https://greenkeeper.io/ + +A cross platform solution to node's spawn and spawnSync. + + +## Installation + +`$ npm install cross-spawn` + + +## Why + +Node has issues when using spawn on Windows: + +- It ignores [PATHEXT](https://github.com/joyent/node/issues/2318) +- It does not support [shebangs](https://en.wikipedia.org/wiki/Shebang_(Unix)) +- Has problems running commands with [spaces](https://github.com/nodejs/node/issues/7367) +- Has problems running commands with posix relative paths (e.g.: `./my-folder/my-executable`) +- Has an [issue](https://github.com/moxystudio/node-cross-spawn/issues/82) with command shims (files in `node_modules/.bin/`), where arguments with quotes and parenthesis would result in [invalid syntax error](https://github.com/moxystudio/node-cross-spawn/blob/e77b8f22a416db46b6196767bcd35601d7e11d54/test/index.test.js#L149) +- No `options.shell` support on node `` where `` must not contain any arguments. +If you would like to have the shebang support improved, feel free to contribute via a pull-request. + +Remember to always test your code on Windows! + + +## Tests + +`$ npm test` +`$ npm test -- --watch` during development + +## License + +Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php). diff --git a/node_modules/cross-spawn/index.js b/node_modules/cross-spawn/index.js new file mode 100644 index 000000000..5509742ca --- /dev/null +++ b/node_modules/cross-spawn/index.js @@ -0,0 +1,39 @@ +'use strict'; + +const cp = require('child_process'); +const parse = require('./lib/parse'); +const enoent = require('./lib/enoent'); + +function spawn(command, args, options) { + // Parse the arguments + const parsed = parse(command, args, options); + + // Spawn the child process + const spawned = cp.spawn(parsed.command, parsed.args, parsed.options); + + // Hook into child process "exit" event to emit an error if the command + // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 + enoent.hookChildProcess(spawned, parsed); + + return spawned; +} + +function spawnSync(command, args, options) { + // Parse the arguments + const parsed = parse(command, args, options); + + // Spawn the child process + const result = cp.spawnSync(parsed.command, parsed.args, parsed.options); + + // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 + result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); + + return result; +} + +module.exports = spawn; +module.exports.spawn = spawn; +module.exports.sync = spawnSync; + +module.exports._parse = parse; +module.exports._enoent = enoent; diff --git a/node_modules/cross-spawn/lib/enoent.js b/node_modules/cross-spawn/lib/enoent.js new file mode 100644 index 000000000..14df9b623 --- /dev/null +++ b/node_modules/cross-spawn/lib/enoent.js @@ -0,0 +1,59 @@ +'use strict'; + +const isWin = process.platform === 'win32'; + +function notFoundError(original, syscall) { + return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), { + code: 'ENOENT', + errno: 'ENOENT', + syscall: `${syscall} ${original.command}`, + path: original.command, + spawnargs: original.args, + }); +} + +function hookChildProcess(cp, parsed) { + if (!isWin) { + return; + } + + const originalEmit = cp.emit; + + cp.emit = function (name, arg1) { + // If emitting "exit" event and exit code is 1, we need to check if + // the command exists and emit an "error" instead + // See https://github.com/IndigoUnited/node-cross-spawn/issues/16 + if (name === 'exit') { + const err = verifyENOENT(arg1, parsed, 'spawn'); + + if (err) { + return originalEmit.call(cp, 'error', err); + } + } + + return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params + }; +} + +function verifyENOENT(status, parsed) { + if (isWin && status === 1 && !parsed.file) { + return notFoundError(parsed.original, 'spawn'); + } + + return null; +} + +function verifyENOENTSync(status, parsed) { + if (isWin && status === 1 && !parsed.file) { + return notFoundError(parsed.original, 'spawnSync'); + } + + return null; +} + +module.exports = { + hookChildProcess, + verifyENOENT, + verifyENOENTSync, + notFoundError, +}; diff --git a/node_modules/cross-spawn/lib/parse.js b/node_modules/cross-spawn/lib/parse.js new file mode 100644 index 000000000..962827a94 --- /dev/null +++ b/node_modules/cross-spawn/lib/parse.js @@ -0,0 +1,125 @@ +'use strict'; + +const path = require('path'); +const niceTry = require('nice-try'); +const resolveCommand = require('./util/resolveCommand'); +const escape = require('./util/escape'); +const readShebang = require('./util/readShebang'); +const semver = require('semver'); + +const isWin = process.platform === 'win32'; +const isExecutableRegExp = /\.(?:com|exe)$/i; +const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; + +// `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0 +const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false; + +function detectShebang(parsed) { + parsed.file = resolveCommand(parsed); + + const shebang = parsed.file && readShebang(parsed.file); + + if (shebang) { + parsed.args.unshift(parsed.file); + parsed.command = shebang; + + return resolveCommand(parsed); + } + + return parsed.file; +} + +function parseNonShell(parsed) { + if (!isWin) { + return parsed; + } + + // Detect & add support for shebangs + const commandFile = detectShebang(parsed); + + // We don't need a shell if the command filename is an executable + const needsShell = !isExecutableRegExp.test(commandFile); + + // If a shell is required, use cmd.exe and take care of escaping everything correctly + // Note that `forceShell` is an hidden option used only in tests + if (parsed.options.forceShell || needsShell) { + // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/` + // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument + // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called, + // we need to double escape them + const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); + + // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar) + // This is necessary otherwise it will always fail with ENOENT in those cases + parsed.command = path.normalize(parsed.command); + + // Escape command & arguments + parsed.command = escape.command(parsed.command); + parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars)); + + const shellCommand = [parsed.command].concat(parsed.args).join(' '); + + parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`]; + parsed.command = process.env.comspec || 'cmd.exe'; + parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped + } + + return parsed; +} + +function parseShell(parsed) { + // If node supports the shell option, there's no need to mimic its behavior + if (supportsShellOption) { + return parsed; + } + + // Mimic node shell option + // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335 + const shellCommand = [parsed.command].concat(parsed.args).join(' '); + + if (isWin) { + parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe'; + parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`]; + parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped + } else { + if (typeof parsed.options.shell === 'string') { + parsed.command = parsed.options.shell; + } else if (process.platform === 'android') { + parsed.command = '/system/bin/sh'; + } else { + parsed.command = '/bin/sh'; + } + + parsed.args = ['-c', shellCommand]; + } + + return parsed; +} + +function parse(command, args, options) { + // Normalize arguments, similar to nodejs + if (args && !Array.isArray(args)) { + options = args; + args = null; + } + + args = args ? args.slice(0) : []; // Clone array to avoid changing the original + options = Object.assign({}, options); // Clone object to avoid changing the original + + // Build our parsed object + const parsed = { + command, + args, + options, + file: undefined, + original: { + command, + args, + }, + }; + + // Delegate further parsing to shell or non-shell + return options.shell ? parseShell(parsed) : parseNonShell(parsed); +} + +module.exports = parse; diff --git a/node_modules/cross-spawn/lib/util/escape.js b/node_modules/cross-spawn/lib/util/escape.js new file mode 100644 index 000000000..b0bb84c3a --- /dev/null +++ b/node_modules/cross-spawn/lib/util/escape.js @@ -0,0 +1,45 @@ +'use strict'; + +// See http://www.robvanderwoude.com/escapechars.php +const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g; + +function escapeCommand(arg) { + // Escape meta chars + arg = arg.replace(metaCharsRegExp, '^$1'); + + return arg; +} + +function escapeArgument(arg, doubleEscapeMetaChars) { + // Convert to string + arg = `${arg}`; + + // Algorithm below is based on https://qntm.org/cmd + + // Sequence of backslashes followed by a double quote: + // double up all the backslashes and escape the double quote + arg = arg.replace(/(\\*)"/g, '$1$1\\"'); + + // Sequence of backslashes followed by the end of the string + // (which will become a double quote later): + // double up all the backslashes + arg = arg.replace(/(\\*)$/, '$1$1'); + + // All other backslashes occur literally + + // Quote the whole thing: + arg = `"${arg}"`; + + // Escape meta chars + arg = arg.replace(metaCharsRegExp, '^$1'); + + // Double escape meta chars if necessary + if (doubleEscapeMetaChars) { + arg = arg.replace(metaCharsRegExp, '^$1'); + } + + return arg; +} + +module.exports.command = escapeCommand; +module.exports.argument = escapeArgument; diff --git a/node_modules/cross-spawn/lib/util/readShebang.js b/node_modules/cross-spawn/lib/util/readShebang.js new file mode 100644 index 000000000..bd4f1280c --- /dev/null +++ b/node_modules/cross-spawn/lib/util/readShebang.js @@ -0,0 +1,32 @@ +'use strict'; + +const fs = require('fs'); +const shebangCommand = require('shebang-command'); + +function readShebang(command) { + // Read the first 150 bytes from the file + const size = 150; + let buffer; + + if (Buffer.alloc) { + // Node.js v4.5+ / v5.10+ + buffer = Buffer.alloc(size); + } else { + // Old Node.js API + buffer = new Buffer(size); + buffer.fill(0); // zero-fill + } + + let fd; + + try { + fd = fs.openSync(command, 'r'); + fs.readSync(fd, buffer, 0, size, 0); + fs.closeSync(fd); + } catch (e) { /* Empty */ } + + // Attempt to extract shebang (null is returned if not a shebang) + return shebangCommand(buffer.toString()); +} + +module.exports = readShebang; diff --git a/node_modules/cross-spawn/lib/util/resolveCommand.js b/node_modules/cross-spawn/lib/util/resolveCommand.js new file mode 100644 index 000000000..2fd5ad270 --- /dev/null +++ b/node_modules/cross-spawn/lib/util/resolveCommand.js @@ -0,0 +1,47 @@ +'use strict'; + +const path = require('path'); +const which = require('which'); +const pathKey = require('path-key')(); + +function resolveCommandAttempt(parsed, withoutPathExt) { + const cwd = process.cwd(); + const hasCustomCwd = parsed.options.cwd != null; + + // If a custom `cwd` was specified, we need to change the process cwd + // because `which` will do stat calls but does not support a custom cwd + if (hasCustomCwd) { + try { + process.chdir(parsed.options.cwd); + } catch (err) { + /* Empty */ + } + } + + let resolved; + + try { + resolved = which.sync(parsed.command, { + path: (parsed.options.env || process.env)[pathKey], + pathExt: withoutPathExt ? path.delimiter : undefined, + }); + } catch (e) { + /* Empty */ + } finally { + process.chdir(cwd); + } + + // If we successfully resolved, ensure that an absolute path is returned + // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it + if (resolved) { + resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved); + } + + return resolved; +} + +function resolveCommand(parsed) { + return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true); +} + +module.exports = resolveCommand; diff --git a/node_modules/cross-spawn/package.json b/node_modules/cross-spawn/package.json new file mode 100644 index 000000000..be4af8539 --- /dev/null +++ b/node_modules/cross-spawn/package.json @@ -0,0 +1,107 @@ +{ + "_from": "cross-spawn@^6.0.0", + "_id": "cross-spawn@6.0.5", + "_inBundle": false, + "_integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "_location": "/cross-spawn", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "cross-spawn@^6.0.0", + "name": "cross-spawn", + "escapedName": "cross-spawn", + "rawSpec": "^6.0.0", + "saveSpec": null, + "fetchSpec": "^6.0.0" + }, + "_requiredBy": [ + "/execa" + ], + "_resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "_shasum": "4a5ec7c64dfae22c3a14124dbacdee846d80cbc4", + "_spec": "cross-spawn@^6.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/execa", + "author": { + "name": "André Cruz", + "email": "andre@moxy.studio" + }, + "bugs": { + "url": "https://github.com/moxystudio/node-cross-spawn/issues" + }, + "bundleDependencies": false, + "commitlint": { + "extends": [ + "@commitlint/config-conventional" + ] + }, + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "deprecated": false, + "description": "Cross platform child_process#spawn and child_process#spawnSync", + "devDependencies": { + "@commitlint/cli": "^6.0.0", + "@commitlint/config-conventional": "^6.0.2", + "babel-core": "^6.26.0", + "babel-jest": "^22.1.0", + "babel-preset-moxy": "^2.2.1", + "eslint": "^4.3.0", + "eslint-config-moxy": "^5.0.0", + "husky": "^0.14.3", + "jest": "^22.0.0", + "lint-staged": "^7.0.0", + "mkdirp": "^0.5.1", + "regenerator-runtime": "^0.11.1", + "rimraf": "^2.6.2", + "standard-version": "^4.2.0" + }, + "engines": { + "node": ">=4.8" + }, + "files": [ + "lib" + ], + "homepage": "https://github.com/moxystudio/node-cross-spawn", + "keywords": [ + "spawn", + "spawnSync", + "windows", + "cross-platform", + "path-ext", + "shebang", + "cmd", + "execute" + ], + "license": "MIT", + "lint-staged": { + "*.js": [ + "eslint --fix", + "git add" + ] + }, + "main": "index.js", + "name": "cross-spawn", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/moxystudio/node-cross-spawn.git" + }, + "scripts": { + "commitmsg": "commitlint -e $GIT_PARAMS", + "lint": "eslint .", + "precommit": "lint-staged", + "prerelease": "npm t && npm run lint", + "release": "standard-version", + "test": "jest --env node --coverage" + }, + "standard-version": { + "scripts": { + "posttag": "git push --follow-tags origin master && npm publish" + } + }, + "version": "6.0.5" +} diff --git a/node_modules/crypt/LICENSE.mkd b/node_modules/crypt/LICENSE.mkd new file mode 100644 index 000000000..96d4c428e --- /dev/null +++ b/node_modules/crypt/LICENSE.mkd @@ -0,0 +1,27 @@ +Copyright © 2011, Paul Vorbach. All rights reserved. +Copyright © 2009, Jeff Mott. All rights reserved. + +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 Crypto-JS 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 HOLDER 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. diff --git a/node_modules/crypt/README.mkd b/node_modules/crypt/README.mkd new file mode 100644 index 000000000..2b1169fc5 --- /dev/null +++ b/node_modules/crypt/README.mkd @@ -0,0 +1 @@ +**crypt** provides utilities for encryption and hashing diff --git a/node_modules/crypt/crypt.js b/node_modules/crypt/crypt.js new file mode 100644 index 000000000..4ec09076d --- /dev/null +++ b/node_modules/crypt/crypt.js @@ -0,0 +1,96 @@ +(function() { + var base64map + = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', + + crypt = { + // Bit-wise rotation left + rotl: function(n, b) { + return (n << b) | (n >>> (32 - b)); + }, + + // Bit-wise rotation right + rotr: function(n, b) { + return (n << (32 - b)) | (n >>> b); + }, + + // Swap big-endian to little-endian and vice versa + endian: function(n) { + // If number given, swap endian + if (n.constructor == Number) { + return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00; + } + + // Else, assume array and swap all items + for (var i = 0; i < n.length; i++) + n[i] = crypt.endian(n[i]); + return n; + }, + + // Generate an array of any length of random bytes + randomBytes: function(n) { + for (var bytes = []; n > 0; n--) + bytes.push(Math.floor(Math.random() * 256)); + return bytes; + }, + + // Convert a byte array to big-endian 32-bit words + bytesToWords: function(bytes) { + for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8) + words[b >>> 5] |= bytes[i] << (24 - b % 32); + return words; + }, + + // Convert big-endian 32-bit words to a byte array + wordsToBytes: function(words) { + for (var bytes = [], b = 0; b < words.length * 32; b += 8) + bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF); + return bytes; + }, + + // Convert a byte array to a hex string + bytesToHex: function(bytes) { + for (var hex = [], i = 0; i < bytes.length; i++) { + hex.push((bytes[i] >>> 4).toString(16)); + hex.push((bytes[i] & 0xF).toString(16)); + } + return hex.join(''); + }, + + // Convert a hex string to a byte array + hexToBytes: function(hex) { + for (var bytes = [], c = 0; c < hex.length; c += 2) + bytes.push(parseInt(hex.substr(c, 2), 16)); + return bytes; + }, + + // Convert a byte array to a base-64 string + bytesToBase64: function(bytes) { + for (var base64 = [], i = 0; i < bytes.length; i += 3) { + var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2]; + for (var j = 0; j < 4; j++) + if (i * 8 + j * 6 <= bytes.length * 8) + base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F)); + else + base64.push('='); + } + return base64.join(''); + }, + + // Convert a base-64 string to a byte array + base64ToBytes: function(base64) { + // Remove non-base-64 characters + base64 = base64.replace(/[^A-Z0-9+\/]/ig, ''); + + for (var bytes = [], i = 0, imod4 = 0; i < base64.length; + imod4 = ++i % 4) { + if (imod4 == 0) continue; + bytes.push(((base64map.indexOf(base64.charAt(i - 1)) + & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2)) + | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2))); + } + return bytes; + } + }; + + module.exports = crypt; +})(); diff --git a/node_modules/crypt/package.json b/node_modules/crypt/package.json new file mode 100644 index 000000000..2a1dfce16 --- /dev/null +++ b/node_modules/crypt/package.json @@ -0,0 +1,52 @@ +{ + "_from": "crypt@~0.0.1", + "_id": "crypt@0.0.2", + "_inBundle": false, + "_integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=", + "_location": "/crypt", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "crypt@~0.0.1", + "name": "crypt", + "escapedName": "crypt", + "rawSpec": "~0.0.1", + "saveSpec": null, + "fetchSpec": "~0.0.1" + }, + "_requiredBy": [ + "/md5" + ], + "_resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "_shasum": "88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b", + "_spec": "crypt@~0.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/md5", + "author": { + "name": "Paul Vorbach", + "email": "paul@vorb.de", + "url": "http://vorb.de" + }, + "bugs": { + "url": "https://github.com/pvorb/node-crypt/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "utilities for encryption and hashing", + "engines": { + "node": "*" + }, + "homepage": "https://github.com/pvorb/node-crypt#readme", + "license": "BSD-3-Clause", + "main": "crypt.js", + "name": "crypt", + "repository": { + "type": "git", + "url": "git://github.com/pvorb/node-crypt.git" + }, + "tags": [ + "hash", + "security" + ], + "version": "0.0.2" +} diff --git a/node_modules/crypto-browserify/.travis.yml b/node_modules/crypto-browserify/.travis.yml new file mode 100644 index 000000000..5ad8439a8 --- /dev/null +++ b/node_modules/crypto-browserify/.travis.yml @@ -0,0 +1,27 @@ +sudo: false +language: node_js +matrix: + include: + - node_js: '0.11' + env: TEST_SUITE=unit + - node_js: '0.12' + env: TEST_SUITE=unit + - node_js: '4' + env: TEST_SUITE=unit + - node_js: '4' + env: TEST_SUITE=standard + - node_js: '4' + env: TEST_SUITE=browser BROWSER_NAME=ie BROWSER_VERSION="10..latest" + - node_js: '4' + env: TEST_SUITE=browser BROWSER_NAME=chrome BROWSER_VERSION="-2..beta" + - node_js: '4' + env: TEST_SUITE=browser BROWSER_NAME=firefox BROWSER_VERSION="-2..latest" + - node_js: '4' + env: TEST_SUITE=browser BROWSER_NAME=safari BROWSER_VERSION="7..latest" + - node_js: '4' + env: TEST_SUITE=browser BROWSER_NAME=android BROWSER_VERSION="5.0..latest" +script: "npm run-script $TEST_SUITE" +env: + global: + - secure: YHNUDQmx/WiW3gmDcRCfb6KLDeio7Mr5tqPY2kHPdZlBSytsQjNk75ytM4U6Cu8Uk8iEIoj/aFlxiVMpJNA8J4QSUyW/YkbVaIz0+1oywoV0Ht8aRBfZ1jvXfX6789+1Q9c4xaMkYYbJpXSh9JcirsiwmqWd4+IDd7hcESodsDQ= + - secure: Nhj5yejKZxUbtHGZta+GjYWqXGaOZB7ainTkOuGcpXM+OwwjeDpYlTBrwS90Q7hqens7KXVzQM09aDbadpsDCsOo1nyaEigMtomAorZ1UC1CpEoVz1ZuikF9bEhb+/7M9pzuL1fX+Ke9Dx4mPPeb8sf/2SrAu1RqXkSwZV/duAc= diff --git a/node_modules/crypto-browserify/.zuul.yml b/node_modules/crypto-browserify/.zuul.yml new file mode 100644 index 000000000..96d9cfbd3 --- /dev/null +++ b/node_modules/crypto-browserify/.zuul.yml @@ -0,0 +1 @@ +ui: tape diff --git a/node_modules/crypto-browserify/LICENSE b/node_modules/crypto-browserify/LICENSE new file mode 100644 index 000000000..8abb57d65 --- /dev/null +++ b/node_modules/crypto-browserify/LICENSE @@ -0,0 +1,24 @@ +The MIT License + +Copyright (c) 2013 Dominic Tarr + +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. \ No newline at end of file diff --git a/node_modules/crypto-browserify/README.md b/node_modules/crypto-browserify/README.md new file mode 100644 index 000000000..1b9cf3b08 --- /dev/null +++ b/node_modules/crypto-browserify/README.md @@ -0,0 +1,50 @@ +# crypto-browserify + +A port of node's `crypto` module to the browser. + +[![Build Status](https://travis-ci.org/crypto-browserify/crypto-browserify.svg?branch=master)](https://travis-ci.org/crypto-browserify/crypto-browserify) +[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) +[![Sauce Test Status](https://saucelabs.com/browser-matrix/crypto-browserify.svg)](https://saucelabs.com/u/crypto-browserify) + +The goal of this module is to reimplement node's crypto module, +in pure javascript so that it can run in the browser. + +Here is the subset that is currently implemented: + +* createHash (sha1, sha224, sha256, sha384, sha512, md5, rmd160) +* createHmac (sha1, sha224, sha256, sha384, sha512, md5, rmd160) +* pbkdf2 +* pbkdf2Sync +* randomBytes +* pseudoRandomBytes +* createCipher (aes) +* createDecipher (aes) +* createDiffieHellman +* createSign (rsa, ecdsa) +* createVerify (rsa, ecdsa) +* createECDH (secp256k1) +* publicEncrypt/privateDecrypt (rsa) +* privateEncrypt/publicDecrypt (rsa) + +## todo + +these features from node's `crypto` are still unimplemented. + +* createCredentials + +## contributions + +If you are interested in writing a feature, please implement as a new module, +which will be incorporated into crypto-browserify as a dependency. + +All deps must be compatible with node's crypto +(generate example inputs and outputs with node, +and save base64 strings inside JSON, so that tests can run in the browser. +see [sha.js](https://github.com/dominictarr/sha.js) + +Crypto is _extra serious_ so please do not hesitate to review the code, +and post comments if you do. + +## License + +MIT diff --git a/node_modules/crypto-browserify/example/bundle.js b/node_modules/crypto-browserify/example/bundle.js new file mode 100644 index 000000000..02698cc77 --- /dev/null +++ b/node_modules/crypto-browserify/example/bundle.js @@ -0,0 +1,637 @@ +var require = function (file, cwd) { + var resolved = require.resolve(file, cwd || '/'); + var mod = require.modules[resolved]; + if (!mod) throw new Error( + 'Failed to resolve module ' + file + ', tried ' + resolved + ); + var res = mod._cached ? mod._cached : mod(); + return res; +} + +require.paths = []; +require.modules = {}; +require.extensions = [".js",".coffee"]; + +require._core = { + 'assert': true, + 'events': true, + 'fs': true, + 'path': true, + 'vm': true +}; + +require.resolve = (function () { + return function (x, cwd) { + if (!cwd) cwd = '/'; + + if (require._core[x]) return x; + var path = require.modules.path(); + cwd = path.resolve('/', cwd); + var y = cwd || '/'; + + if (x.match(/^(?:\.\.?\/|\/)/)) { + var m = loadAsFileSync(path.resolve(y, x)) + || loadAsDirectorySync(path.resolve(y, x)); + if (m) return m; + } + + var n = loadNodeModulesSync(x, y); + if (n) return n; + + throw new Error("Cannot find module '" + x + "'"); + + function loadAsFileSync (x) { + if (require.modules[x]) { + return x; + } + + for (var i = 0; i < require.extensions.length; i++) { + var ext = require.extensions[i]; + if (require.modules[x + ext]) return x + ext; + } + } + + function loadAsDirectorySync (x) { + x = x.replace(/\/+$/, ''); + var pkgfile = x + '/package.json'; + if (require.modules[pkgfile]) { + var pkg = require.modules[pkgfile](); + var b = pkg.browserify; + if (typeof b === 'object' && b.main) { + var m = loadAsFileSync(path.resolve(x, b.main)); + if (m) return m; + } + else if (typeof b === 'string') { + var m = loadAsFileSync(path.resolve(x, b)); + if (m) return m; + } + else if (pkg.main) { + var m = loadAsFileSync(path.resolve(x, pkg.main)); + if (m) return m; + } + } + + return loadAsFileSync(x + '/index'); + } + + function loadNodeModulesSync (x, start) { + var dirs = nodeModulesPathsSync(start); + for (var i = 0; i < dirs.length; i++) { + var dir = dirs[i]; + var m = loadAsFileSync(dir + '/' + x); + if (m) return m; + var n = loadAsDirectorySync(dir + '/' + x); + if (n) return n; + } + + var m = loadAsFileSync(x); + if (m) return m; + } + + function nodeModulesPathsSync (start) { + var parts; + if (start === '/') parts = [ '' ]; + else parts = path.normalize(start).split('/'); + + var dirs = []; + for (var i = parts.length - 1; i >= 0; i--) { + if (parts[i] === 'node_modules') continue; + var dir = parts.slice(0, i + 1).join('/') + '/node_modules'; + dirs.push(dir); + } + + return dirs; + } + }; +})(); + +require.alias = function (from, to) { + var path = require.modules.path(); + var res = null; + try { + res = require.resolve(from + '/package.json', '/'); + } + catch (err) { + res = require.resolve(from, '/'); + } + var basedir = path.dirname(res); + + var keys = (Object.keys || function (obj) { + var res = []; + for (var key in obj) res.push(key) + return res; + })(require.modules); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (key.slice(0, basedir.length + 1) === basedir + '/') { + var f = key.slice(basedir.length); + require.modules[to + f] = require.modules[basedir + f]; + } + else if (key === basedir) { + require.modules[to] = require.modules[basedir]; + } + } +}; + +require.define = function (filename, fn) { + var dirname = require._core[filename] + ? '' + : require.modules.path().dirname(filename) + ; + + var require_ = function (file) { + return require(file, dirname) + }; + require_.resolve = function (name) { + return require.resolve(name, dirname); + }; + require_.modules = require.modules; + require_.define = require.define; + var module_ = { exports : {} }; + + require.modules[filename] = function () { + require.modules[filename]._cached = module_.exports; + fn.call( + module_.exports, + require_, + module_, + module_.exports, + dirname, + filename + ); + require.modules[filename]._cached = module_.exports; + return module_.exports; + }; +}; + +if (typeof process === 'undefined') process = {}; + +if (!process.nextTick) process.nextTick = (function () { + var queue = []; + var canPost = typeof window !== 'undefined' + && window.postMessage && window.addEventListener + ; + + if (canPost) { + window.addEventListener('message', function (ev) { + if (ev.source === window && ev.data === 'browserify-tick') { + ev.stopPropagation(); + if (queue.length > 0) { + var fn = queue.shift(); + fn(); + } + } + }, true); + } + + return function (fn) { + if (canPost) { + queue.push(fn); + window.postMessage('browserify-tick', '*'); + } + else setTimeout(fn, 0); + }; +})(); + +if (!process.title) process.title = 'browser'; + +if (!process.binding) process.binding = function (name) { + if (name === 'evals') return require('vm') + else throw new Error('No such module') +}; + +if (!process.cwd) process.cwd = function () { return '.' }; + +if (!process.env) process.env = {}; +if (!process.argv) process.argv = []; + +require.define("path", function (require, module, exports, __dirname, __filename) { +function filter (xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + if (fn(xs[i], i, xs)) res.push(xs[i]); + } + return res; +} + +// 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; 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; +} + +// Regex to split a filename into [*, dir, basename, ext] +// posix version +var splitPathRe = /^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/; + +// path.resolve([from ...], to) +// posix version +exports.resolve = function() { +var resolvedPath = '', + resolvedAbsolute = false; + +for (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) { + var path = (i >= 0) + ? arguments[i] + : process.cwd(); + + // Skip empty and invalid entries + if (typeof path !== 'string' || !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 = path.charAt(0) === '/', + trailingSlash = path.slice(-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.join = function() { + var paths = Array.prototype.slice.call(arguments, 0); + return exports.normalize(filter(paths, function(p, index) { + return p && typeof p === 'string'; + }).join('/')); +}; + + +exports.dirname = function(path) { + var dir = splitPathRe.exec(path)[1] || ''; + var isWindows = false; + if (!dir) { + // No dirname + return '.'; + } else if (dir.length === 1 || + (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) { + // It is just a slash or a drive letter with a slash + return dir; + } else { + // It is a full dirname, strip trailing slash + return dir.substring(0, dir.length - 1); + } +}; + + +exports.basename = function(path, ext) { + var f = splitPathRe.exec(path)[2] || ''; + // TODO: make this comparison case-insensitive on windows? + if (ext && f.substr(-1 * ext.length) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; +}; + + +exports.extname = function(path) { + return splitPathRe.exec(path)[3] || ''; +}; + +}); + +require.define("crypto", function (require, module, exports, __dirname, __filename) { +module.exports = require("crypto-browserify") +}); + +require.define("/node_modules/crypto-browserify/package.json", function (require, module, exports, __dirname, __filename) { +module.exports = {} +}); + +require.define("/node_modules/crypto-browserify/index.js", function (require, module, exports, __dirname, __filename) { +var sha = require('./sha') + +var algorithms = { + sha1: { + hex: sha.hex_sha1, + binary: sha.b64_sha1, + ascii: sha.str_sha1 + } +} + +function error () { + var m = [].slice.call(arguments).join(' ') + throw new Error([ + m, + 'we accept pull requests', + 'http://github.com/dominictarr/crypto-browserify' + ].join('\n')) +} + +exports.createHash = function (alg) { + alg = alg || 'sha1' + if(!algorithms[alg]) + error('algorithm:', alg, 'is not yet supported') + var s = '' + _alg = algorithms[alg] + return { + update: function (data) { + s += data + return this + }, + digest: function (enc) { + enc = enc || 'binary' + var fn + if(!(fn = _alg[enc])) + error('encoding:', enc , 'is not yet supported for algorithm', alg) + var r = fn(s) + s = null //not meant to use the hash after you've called digest. + return r + } + } +} +// the least I can do is make error messages for the rest of the node.js/crypto api. +;['createCredentials' +, 'createHmac' +, 'createCypher' +, 'createCypheriv' +, 'createDecipher' +, 'createDecipheriv' +, 'createSign' +, 'createVerify' +, 'createDeffieHellman', +, 'pbkdf2', +, 'randomBytes' ].forEach(function (name) { + exports[name] = function () { + error('sorry,', name, 'is not implemented yet') + } +}) + +}); + +require.define("/node_modules/crypto-browserify/sha.js", function (require, module, exports, __dirname, __filename) { +/* + * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined + * in FIPS PUB 180-1 + * Version 2.1a Copyright Paul Johnston 2000 - 2002. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for details. + */ + +exports.hex_sha1 = hex_sha1; +exports.b64_sha1 = b64_sha1; +exports.str_sha1 = str_sha1; +exports.hex_hmac_sha1 = hex_hmac_sha1; +exports.b64_hmac_sha1 = b64_hmac_sha1; +exports.str_hmac_sha1 = str_hmac_sha1; + +/* + * Configurable variables. You may need to tweak these to be compatible with + * the server-side, but the defaults work in most cases. + */ +var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */ +var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */ +var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */ + +/* + * These are the functions you'll usually want to call + * They take string arguments and return either hex or base-64 encoded strings + */ +function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));} +function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));} +function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));} +function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));} +function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));} +function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));} + +/* + * Perform a simple self-test to see if the VM is working + */ +function sha1_vm_test() +{ + return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d"; +} + +/* + * Calculate the SHA-1 of an array of big-endian words, and a bit length + */ +function core_sha1(x, len) +{ + /* append padding */ + x[len >> 5] |= 0x80 << (24 - len % 32); + x[((len + 64 >> 9) << 4) + 15] = len; + + var w = Array(80); + var a = 1732584193; + var b = -271733879; + var c = -1732584194; + var d = 271733878; + var e = -1009589776; + + for(var i = 0; i < x.length; i += 16) + { + var olda = a; + var oldb = b; + var oldc = c; + var oldd = d; + var olde = e; + + for(var j = 0; j < 80; j++) + { + if(j < 16) w[j] = x[i + j]; + else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1); + var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)), + safe_add(safe_add(e, w[j]), sha1_kt(j))); + e = d; + d = c; + c = rol(b, 30); + b = a; + a = t; + } + + a = safe_add(a, olda); + b = safe_add(b, oldb); + c = safe_add(c, oldc); + d = safe_add(d, oldd); + e = safe_add(e, olde); + } + return Array(a, b, c, d, e); + +} + +/* + * Perform the appropriate triplet combination function for the current + * iteration + */ +function sha1_ft(t, b, c, d) +{ + if(t < 20) return (b & c) | ((~b) & d); + if(t < 40) return b ^ c ^ d; + if(t < 60) return (b & c) | (b & d) | (c & d); + return b ^ c ^ d; +} + +/* + * Determine the appropriate additive constant for the current iteration + */ +function sha1_kt(t) +{ + return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 : + (t < 60) ? -1894007588 : -899497514; +} + +/* + * Calculate the HMAC-SHA1 of a key and some data + */ +function core_hmac_sha1(key, data) +{ + var bkey = str2binb(key); + if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz); + + var ipad = Array(16), opad = Array(16); + for(var i = 0; i < 16; i++) + { + ipad[i] = bkey[i] ^ 0x36363636; + opad[i] = bkey[i] ^ 0x5C5C5C5C; + } + + var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz); + return core_sha1(opad.concat(hash), 512 + 160); +} + +/* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + */ +function safe_add(x, y) +{ + var lsw = (x & 0xFFFF) + (y & 0xFFFF); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xFFFF); +} + +/* + * Bitwise rotate a 32-bit number to the left. + */ +function rol(num, cnt) +{ + return (num << cnt) | (num >>> (32 - cnt)); +} + +/* + * Convert an 8-bit or 16-bit string to an array of big-endian words + * In 8-bit function, characters >255 have their hi-byte silently ignored. + */ +function str2binb(str) +{ + var bin = Array(); + var mask = (1 << chrsz) - 1; + for(var i = 0; i < str.length * chrsz; i += chrsz) + bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i%32); + return bin; +} + +/* + * Convert an array of big-endian words to a string + */ +function binb2str(bin) +{ + var str = ""; + var mask = (1 << chrsz) - 1; + for(var i = 0; i < bin.length * 32; i += chrsz) + str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask); + return str; +} + +/* + * Convert an array of big-endian words to a hex string. + */ +function binb2hex(binarray) +{ + var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; + var str = ""; + for(var i = 0; i < binarray.length * 4; i++) + { + str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) + + hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF); + } + return str; +} + +/* + * Convert an array of big-endian words to a base-64 string + */ +function binb2b64(binarray) +{ + var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + var str = ""; + for(var i = 0; i < binarray.length * 4; i += 3) + { + var triplet = (((binarray[i >> 2] >> 8 * (3 - i %4)) & 0xFF) << 16) + | (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 ) + | ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF); + for(var j = 0; j < 4; j++) + { + if(i * 8 + j * 6 > binarray.length * 32) str += b64pad; + else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F); + } + } + return str; +} + + +}); + +require.define("/test.js", function (require, module, exports, __dirname, __filename) { + var crypto = require('crypto') +var abc = crypto.createHash('sha1').update('abc').digest('hex') +console.log(abc) +//require('hello').inlineCall().call2() + +}); +require("/test.js"); diff --git a/node_modules/crypto-browserify/example/index.html b/node_modules/crypto-browserify/example/index.html new file mode 100644 index 000000000..9d55c6d73 --- /dev/null +++ b/node_modules/crypto-browserify/example/index.html @@ -0,0 +1,12 @@ + + + + +
+  require('crypto').createHash('sha1').update('abc').digest('hex') == ''
+  
+ + + diff --git a/node_modules/crypto-browserify/example/test.js b/node_modules/crypto-browserify/example/test.js new file mode 100644 index 000000000..0b76c0153 --- /dev/null +++ b/node_modules/crypto-browserify/example/test.js @@ -0,0 +1,4 @@ +var crypto = require('crypto') +var abc = crypto.createHash('sha1').update('abc').digest('hex') +console.log(abc) +// require('hello').inlineCall().call2() diff --git a/node_modules/crypto-browserify/index.js b/node_modules/crypto-browserify/index.js new file mode 100644 index 000000000..b6d4d24e1 --- /dev/null +++ b/node_modules/crypto-browserify/index.js @@ -0,0 +1,97 @@ +'use strict' + +exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = require('randombytes') +exports.createHash = exports.Hash = require('create-hash') +exports.createHmac = exports.Hmac = require('create-hmac') + +var algos = require('browserify-sign/algos') +var algoKeys = Object.keys(algos) +var hashes = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160'].concat(algoKeys) +exports.getHashes = function () { + return hashes +} + +var p = require('pbkdf2') +exports.pbkdf2 = p.pbkdf2 +exports.pbkdf2Sync = p.pbkdf2Sync + +var aes = require('browserify-cipher') + +exports.Cipher = aes.Cipher +exports.createCipher = aes.createCipher +exports.Cipheriv = aes.Cipheriv +exports.createCipheriv = aes.createCipheriv +exports.Decipher = aes.Decipher +exports.createDecipher = aes.createDecipher +exports.Decipheriv = aes.Decipheriv +exports.createDecipheriv = aes.createDecipheriv +exports.getCiphers = aes.getCiphers +exports.listCiphers = aes.listCiphers + +var dh = require('diffie-hellman') + +exports.DiffieHellmanGroup = dh.DiffieHellmanGroup +exports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup +exports.getDiffieHellman = dh.getDiffieHellman +exports.createDiffieHellman = dh.createDiffieHellman +exports.DiffieHellman = dh.DiffieHellman + +var sign = require('browserify-sign') + +exports.createSign = sign.createSign +exports.Sign = sign.Sign +exports.createVerify = sign.createVerify +exports.Verify = sign.Verify + +exports.createECDH = require('create-ecdh') + +var publicEncrypt = require('public-encrypt') + +exports.publicEncrypt = publicEncrypt.publicEncrypt +exports.privateEncrypt = publicEncrypt.privateEncrypt +exports.publicDecrypt = publicEncrypt.publicDecrypt +exports.privateDecrypt = publicEncrypt.privateDecrypt + +// the least I can do is make error messages for the rest of the node.js/crypto api. +// ;[ +// 'createCredentials' +// ].forEach(function (name) { +// exports[name] = function () { +// throw new Error([ +// 'sorry, ' + name + ' is not implemented yet', +// 'we accept pull requests', +// 'https://github.com/crypto-browserify/crypto-browserify' +// ].join('\n')) +// } +// }) + +var rf = require('randomfill') + +exports.randomFill = rf.randomFill +exports.randomFillSync = rf.randomFillSync + +exports.createCredentials = function () { + throw new Error([ + 'sorry, createCredentials is not implemented yet', + 'we accept pull requests', + 'https://github.com/crypto-browserify/crypto-browserify' + ].join('\n')) +} + +exports.constants = { + 'DH_CHECK_P_NOT_SAFE_PRIME': 2, + 'DH_CHECK_P_NOT_PRIME': 1, + 'DH_UNABLE_TO_CHECK_GENERATOR': 4, + 'DH_NOT_SUITABLE_GENERATOR': 8, + 'NPN_ENABLED': 1, + 'ALPN_ENABLED': 1, + 'RSA_PKCS1_PADDING': 1, + 'RSA_SSLV23_PADDING': 2, + 'RSA_NO_PADDING': 3, + 'RSA_PKCS1_OAEP_PADDING': 4, + 'RSA_X931_PADDING': 5, + 'RSA_PKCS1_PSS_PADDING': 6, + 'POINT_CONVERSION_COMPRESSED': 2, + 'POINT_CONVERSION_UNCOMPRESSED': 4, + 'POINT_CONVERSION_HYBRID': 6 +} diff --git a/node_modules/crypto-browserify/package.json b/node_modules/crypto-browserify/package.json new file mode 100644 index 000000000..98b6eb346 --- /dev/null +++ b/node_modules/crypto-browserify/package.json @@ -0,0 +1,78 @@ +{ + "_from": "crypto-browserify@^3.0.0", + "_id": "crypto-browserify@3.12.0", + "_inBundle": false, + "_integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "_location": "/crypto-browserify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "crypto-browserify@^3.0.0", + "name": "crypto-browserify", + "escapedName": "crypto-browserify", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/browserify" + ], + "_resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "_shasum": "396cf9f3137f03e4b8e532c58f698254e00f80ec", + "_spec": "crypto-browserify@^3.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "Dominic Tarr", + "email": "dominic.tarr@gmail.com", + "url": "dominictarr.com" + }, + "browser": { + "crypto": false + }, + "bugs": { + "url": "https://github.com/crypto-browserify/crypto-browserify/issues" + }, + "bundleDependencies": false, + "dependencies": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + }, + "deprecated": false, + "description": "implementation of crypto for the browser", + "devDependencies": { + "hash-test-vectors": "~1.3.2", + "pseudorandombytes": "^2.0.0", + "safe-buffer": "^5.1.1", + "standard": "^5.0.2", + "tape": "~2.3.2", + "zuul": "^3.6.0" + }, + "engines": { + "node": "*" + }, + "homepage": "https://github.com/crypto-browserify/crypto-browserify", + "license": "MIT", + "name": "crypto-browserify", + "optionalDependencies": {}, + "repository": { + "type": "git", + "url": "git://github.com/crypto-browserify/crypto-browserify.git" + }, + "scripts": { + "browser": "zuul --browser-version $BROWSER_VERSION --browser-name $BROWSER_NAME -- test/index.js", + "standard": "standard", + "test": "npm run standard && npm run unit", + "unit": "node test/" + }, + "version": "3.12.0" +} diff --git a/node_modules/crypto-browserify/test/aes.js b/node_modules/crypto-browserify/test/aes.js new file mode 100644 index 000000000..916a0192d --- /dev/null +++ b/node_modules/crypto-browserify/test/aes.js @@ -0,0 +1,49 @@ +var test = require('tape') +var crypto = require('browserify-cipher/browser') +var randomBytes = require('pseudorandombytes') + +function runIt (i) { + crypto.listCiphers().forEach(function (cipher) { + test('run: ' + i, function (t) { + t.test('ciphers: ' + cipher, function (t) { + t.plan(1) + var data = randomBytes(562) + var password = randomBytes(20) + var crypter = crypto.createCipher(cipher, password) + var decrypter = crypto.createDecipher(cipher, password) + var out = [] + out.push(decrypter.update(crypter.update(data))) + out.push(decrypter.update(crypter.final())) + if (cipher.indexOf('gcm') > -1) { + decrypter.setAuthTag(crypter.getAuthTag()) + } + out.push(decrypter.final()) + t.equals(data.toString('hex'), Buffer.concat(out).toString('hex')) + }) + }) + }) + if (i < 4) { + setTimeout(runIt, 0, i + 1) + } +} +runIt(1) +test('getCiphers', function (t) { + t.plan(1) + t.ok(crypto.getCiphers().length, 'get ciphers returns an array') +}) + +test('through crypto browserify works', function (t) { + t.plan(2) + var crypto = require('../') + var cipher = 'aes-128-ctr' + var data = randomBytes(562) + var password = randomBytes(20) + var crypter = crypto.createCipher(cipher, password) + var decrypter = crypto.createDecipher(cipher, password) + var out = [] + out.push(decrypter.update(crypter.update(data))) + out.push(decrypter.update(crypter.final())) + out.push(decrypter.final()) + t.equals(data.toString('hex'), Buffer.concat(out).toString('hex')) + t.ok(crypto.getCiphers().length, 'get ciphers returns an array') +}) diff --git a/node_modules/crypto-browserify/test/create-hash.js b/node_modules/crypto-browserify/test/create-hash.js new file mode 100644 index 000000000..33532fd7a --- /dev/null +++ b/node_modules/crypto-browserify/test/create-hash.js @@ -0,0 +1,50 @@ +var test = require('tape') + +var algorithms = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160'] +var encodings = ['hex', 'base64'] // FIXME: test binary +var vectors = require('hash-test-vectors') + +testLib('createHash in crypto-browserify', require('../').createHash) +testLib('create-hash/browser', require('create-hash/browser')) + +function testLib (name, createHash) { + algorithms.forEach(function (algorithm) { + runTest(name, createHash, algorithm) + }) +} +function runTest (name, createHash, algorithm) { + test(name + ' test ' + algorithm + ' against test vectors', function (t) { + run(0) + function run (i) { + if (i >= vectors.length) { + return t.end() + } + var obj = vectors[i] + + var input = new Buffer(obj.input, 'base64') + var node = obj[algorithm] + var js = createHash(algorithm).update(input).digest('hex') + if (js !== node) { + t.equal(js, node, algorithm + '(testVector[' + i + ']) == ' + node) + } + + encodings.forEach(function (encoding) { + var input = new Buffer(obj.input, 'base64').toString(encoding) + var node = obj[algorithm] + var js = createHash(algorithm).update(input, encoding).digest('hex') + if (js !== node) { + t.equal(js, node, algorithm + '(testVector[' + i + '], ' + encoding + ') == ' + node) + } + }) + input = new Buffer(obj.input, 'base64') + node = obj[algorithm] + var hash = createHash(algorithm) + hash.end(input) + js = hash.read().toString('hex') + if (js !== node) { + t.equal(js, node, algorithm + '(testVector[' + i + ']) == ' + node) + } + setTimeout(run, 0, i + 1) + } + }) +} diff --git a/node_modules/crypto-browserify/test/create-hmac.js b/node_modules/crypto-browserify/test/create-hmac.js new file mode 100644 index 000000000..08488ab73 --- /dev/null +++ b/node_modules/crypto-browserify/test/create-hmac.js @@ -0,0 +1,50 @@ +var test = require('tape') + +var algorithms = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160'] +var vectors = require('hash-test-vectors/hmac') +testLib('createHmac in crypto-browserify', require('../').createHmac) +testLib('create-hmac/browser', require('create-hmac/browser')) + +function testLib (name, createHmac) { + algorithms.forEach(function (alg) { + test(name + ' hmac(' + alg + ')', function (t) { + run(0) + function run (i) { + if (i >= vectors.length) { + return t.end() + } + var input = vectors[i] + var output = createHmac(alg, new Buffer(input.key, 'hex')) + .update(input.data, 'hex').digest() + + output = input.truncate ? output.slice(0, input.truncate) : output + output = output.toString('hex') + if (output !== input[alg]) { + t.equal(output, input[alg]) + } + setTimeout(run, 0, i + 1) + } + }) + + test('hmac(' + alg + ')', function (t) { + run(0) + function run (i) { + if (i >= vectors.length) { + return t.end() + } + var input = vectors[i] + var hmac = createHmac(alg, new Buffer(input.key, 'hex')) + + hmac.end(input.data, 'hex') + var output = hmac.read() + + output = input.truncate ? output.slice(0, input.truncate) : output + output = output.toString('hex') + if (output !== input[alg]) { + t.equal(output, input[alg]) + } + setTimeout(run, 0, i + 1) + } + }) + }) +} diff --git a/node_modules/crypto-browserify/test/dh.js b/node_modules/crypto-browserify/test/dh.js new file mode 100644 index 000000000..61fd07443 --- /dev/null +++ b/node_modules/crypto-browserify/test/dh.js @@ -0,0 +1,49 @@ +var test = require('tape') +var crypto = require('diffie-hellman/browser') + +test('diffie-hellman mod groups', function (t) { + [ + 'modp1', 'modp2', 'modp5', 'modp14', 'modp15', 'modp16' + ].forEach(function (mod) { + t.test(mod, function (t) { + t.plan(3) + var dh1 = crypto.getDiffieHellman(mod) + var p1 = dh1.getPrime().toString('hex') + dh1.generateKeys() + var dh2 = crypto.getDiffieHellman(mod) + var p2 = dh2.getPrime().toString('hex') + dh2.generateKeys() + t.equals(p1, p2, 'equal primes') + var pubk1 = dh1.getPublicKey() + var pubk2 = dh2.getPublicKey() + t.notEquals(pubk1, pubk2, 'diff public keys') + var pub1 = dh1.computeSecret(pubk2).toString('hex') + var pub2 = dh2.computeSecret(dh1.getPublicKey()).toString('hex') + t.equals(pub1, pub2, 'equal secrets') + }) + }) +}) + +test('diffie-hellman key lengths', function (t) { + [ + 64, 65, 192 + ].forEach(function (len) { + t.test('' + len, function (t) { + t.plan(3) + var dh2 = crypto.createDiffieHellman(len) + var prime2 = dh2.getPrime() + var p2 = prime2.toString('hex') + var dh1 = crypto.createDiffieHellman(prime2) + var p1 = dh1.getPrime().toString('hex') + dh1.generateKeys() + dh2.generateKeys() + t.equals(p1, p2, 'equal primes') + var pubk1 = dh1.getPublicKey() + var pubk2 = dh2.getPublicKey() + t.notEquals(pubk1, pubk2, 'diff public keys') + var pub1 = dh1.computeSecret(pubk2).toString('hex') + var pub2 = dh2.computeSecret(dh1.getPublicKey()).toString('hex') + t.equals(pub1, pub2, 'equal secrets') + }) + }) +}) diff --git a/node_modules/crypto-browserify/test/ecdh.js b/node_modules/crypto-browserify/test/ecdh.js new file mode 100644 index 000000000..86b5aed5d --- /dev/null +++ b/node_modules/crypto-browserify/test/ecdh.js @@ -0,0 +1,61 @@ +var mods = [ + 'secp256k1', + 'secp224r1', + 'prime256v1', + 'prime192v1' +] +var test = require('tape') +var _crypto = require('../') +var createECDH1 = _crypto.createECDH +var createECDH2 = require('create-ecdh/browser') + +mods.forEach(function (mod) { + test('createECDH: ' + mod + ' uncompressed', function (t) { + t.plan(2) + var dh1 = createECDH1(mod) + dh1.generateKeys() + var dh2 = createECDH2(mod) + dh2.generateKeys() + var pubk1 = dh1.getPublicKey() + var pubk2 = dh2.getPublicKey() + t.notEquals(pubk1.toString('hex'), pubk2.toString('hex'), 'diff public keys') + var pub1 = dh1.computeSecret(pubk2).toString('hex') + var pub2 = dh2.computeSecret(pubk1).toString('hex') + t.equals(pub1, pub2, 'equal secrets') + }) + + test('createECDH: ' + mod + ' compressed', function (t) { + t.plan(2) + var dh1 = createECDH1(mod) + dh1.generateKeys() + var dh2 = createECDH2(mod) + dh2.generateKeys() + var pubk1 = dh1.getPublicKey(null, 'compressed') + var pubk2 = dh2.getPublicKey(null, 'compressed') + t.notEquals(pubk1.toString('hex'), pubk2.toString('hex'), 'diff public keys') + var pub1 = dh1.computeSecret(pubk2).toString('hex') + var pub2 = dh2.computeSecret(pubk1).toString('hex') + t.equals(pub1, pub2, 'equal secrets') + }) + + test('createECDH: ' + mod + ' set stuff', function (t) { + t.plan(5) + var dh1 = createECDH1(mod) + var dh2 = createECDH2(mod) + dh1.generateKeys() + dh2.generateKeys() + dh1.setPrivateKey(dh2.getPrivateKey()) + dh1.setPublicKey(dh2.getPublicKey()) + var priv1 = dh1.getPrivateKey('hex') + var priv2 = dh2.getPrivateKey('hex') + t.equals(priv1, priv2, 'same private key') + var pubk1 = dh1.getPublicKey() + var pubk2 = dh2.getPublicKey() + t.equals(pubk1.toString('hex'), pubk2.toString('hex'), 'same public keys, uncompressed') + t.equals(dh1.getPublicKey('hex', 'compressed'), dh2.getPublicKey('hex', 'compressed'), 'same public keys compressed') + t.equals(dh1.getPublicKey('hex', 'hybrid'), dh2.getPublicKey('hex', 'hybrid'), 'same public keys hybrid') + var pub1 = dh1.computeSecret(pubk2).toString('hex') + var pub2 = dh2.computeSecret(pubk1).toString('hex') + t.equals(pub1, pub2, 'equal secrets') + }) +}) diff --git a/node_modules/crypto-browserify/test/index.js b/node_modules/crypto-browserify/test/index.js new file mode 100644 index 000000000..2ac709446 --- /dev/null +++ b/node_modules/crypto-browserify/test/index.js @@ -0,0 +1,19 @@ + +require('./create-hash') +require('./create-hmac') +if (!process.browser) { + require('./dh') +} + +require('./pbkdf2') +try { + require('randombytes')(8) + require('./ecdh') + require('./public-encrypt') + require('./random-bytes') + require('./sign') + require('./random-fill') +} catch (e) { + console.log('no secure rng avaiable') +} +require('./aes') diff --git a/node_modules/crypto-browserify/test/node/dh.js b/node_modules/crypto-browserify/test/node/dh.js new file mode 100644 index 000000000..0b3aa710e --- /dev/null +++ b/node_modules/crypto-browserify/test/node/dh.js @@ -0,0 +1,51 @@ +var test = require('tape') +var cryptoB = require('../../') +var crypto = require('crypto') + +test('diffie-hellman mod groups', function (t) { + [ + 'modp1', 'modp2', 'modp5', 'modp14', 'modp15', 'modp16' + ].forEach(function (mod) { + t.test(mod, function (t) { + t.plan(3) + var dh1 = cryptoB.getDiffieHellman(mod) + var p1 = dh1.getPrime().toString('hex') + dh1.generateKeys() + + var dh2 = crypto.getDiffieHellman(mod) + var p2 = dh2.getPrime().toString('hex') + dh2.generateKeys() + t.equals(p1, p2, 'equal primes') + var pubk1 = dh1.getPublicKey() + var pubk2 = dh2.getPublicKey() + t.notEquals(pubk1, pubk2, 'diff public keys') + var pub1 = dh1.computeSecret(pubk2).toString('hex') + var pub2 = dh2.computeSecret(pubk1).toString('hex') + t.equals(pub1, pub2, 'equal secrets') + }) + }) +}) + +test('diffie-hellman key lengths', function (t) { + [ + 64, 65, 192 + ].forEach(function (len) { + t.test('' + len, function (t) { + t.plan(3) + var dh2 = cryptoB.createDiffieHellman(len) + var prime2 = dh2.getPrime() + var p2 = prime2.toString('hex') + var dh1 = crypto.createDiffieHellman(prime2) + var p1 = dh1.getPrime().toString('hex') + dh1.generateKeys() + dh2.generateKeys() + t.equals(p1, p2, 'equal primes') + var pubk1 = dh1.getPublicKey() + var pubk2 = dh2.getPublicKey() + t.notEquals(pubk1, pubk2, 'diff public keys') + var pub1 = dh1.computeSecret(pubk2).toString('hex') + var pub2 = dh2.computeSecret(dh1.getPublicKey()).toString('hex') + t.equals(pub1, pub2, 'equal secrets') + }) + }) +}) diff --git a/node_modules/crypto-browserify/test/pbkdf2.js b/node_modules/crypto-browserify/test/pbkdf2.js new file mode 100644 index 000000000..084014eed --- /dev/null +++ b/node_modules/crypto-browserify/test/pbkdf2.js @@ -0,0 +1,21 @@ +var tape = require('tape') +var crypto = require('pbkdf2/browser') + +var vectors = require('hash-test-vectors/pbkdf2') + +tape('pbkdf2', function (t) { + vectors.forEach(function (input) { + // skip inputs that will take way too long + if (input.iterations > 10000) return + + var key = crypto.pbkdf2Sync(input.password, input.salt, input.iterations, input.length) + + if (key.toString('hex') !== input.sha1) { + console.log(input) + } + + t.equal(key.toString('hex'), input.sha1) + }) + + t.end() +}) diff --git a/node_modules/crypto-browserify/test/public-encrypt.js b/node_modules/crypto-browserify/test/public-encrypt.js new file mode 100644 index 000000000..edb435c98 --- /dev/null +++ b/node_modules/crypto-browserify/test/public-encrypt.js @@ -0,0 +1,36 @@ +var test = require('tape') +var crypto1 = require('../') +var rsa = { + 'private': '2d2d2d2d2d424547494e205253412050524956415445204b45592d2d2d2d2d0a4d4949456a77494241414b422f6779376d6a615767506546645659445a5752434139424e69763370506230657332372b464b593068737a4c614f7734374578430a744157704473483438545841667948425977424c67756179666b344c4749757078622b43474d62526f337845703043626659314a62793236543976476a5243310a666f484444554a4738347561526279487161663469367a74346756522b786c4145496a6b614641414b38634f6f58415431435671474c4c6c6a554363684c38500a6a61486a2f7972695a2f53377264776c49334c6e41427877776d4c726d522f7637315774706d4f2f614e47384e2b31706f2b5177616768546b79513539452f5a0a7641754f6b4657486f6b32712f523650594161326a645a397a696d3046714f502b6e6b5161454452624246426d4271547635664647666b32577341664b662f520a47302f5646642b5a654d353235315465547658483639356e6c53476175566c3941674d42414145436766344c725748592f6c35346f7554685a577676627275670a70667a36734a583267396c3779586d576c455773504543566f2f375355627059467074364f5a7939397a53672b494b624771574b6664686f4b725477495674430a4c30595a304e6c6d646e414e53497a30726f785147375a786b4c352b764853772f506d443978345577662b437a38684154436d4e42763171633630646b7975570a34434c71653732716154695657526f4f316961675167684e634c6f6f36765379363545784c614344545068613779753276773468465a705769456a57346478660a7246644c696978353242433836596c416c784d452f724c6738494a5676696c62796f39615764586d784f6155544c527636506b4644312f6756647738563951720a534c4e39466c4b326b6b6a695830647a6f6962765a7733744d6e74337979644178305838372b734d5256616843316270336b56507a3448793045575834514a2f0a504d33317647697549546b324e43643531445874314c746e324f503546614a536d4361456a6830586b5534716f7559796a585774384275364254436c327675610a466730556a6939432b496b504c6d61554d624d494f7761546b386357714c74685378734c6537304a354f6b477267664b554d2f772b4248483150742f506a7a6a0a432b2b6c306b6946614f5644566141563947704c504c43426f4b2f50433952622f72784d4d6f43434e774a2f4e5a756564496e793277334c4d69693737682f540a7a53766572674e47686a5936526e7661386c4c584a36646c726b6350417970733367577778716a344e5230542b474d3062445550564c62374d303758563753580a7637564a476d35324a625247774d3173732b72385854544e656d65476b2b5752784737546774734d715947584c66423851786b2f66352f4d63633030546c38750a7758464e7366784a786d7436416273547233673336774a2f49684f6e69627a3941642b6e63686c426e4e3351655733434b48717a61523138766f717674566d320a6b4a66484b31357072482f7353476d786d6945476772434a545a78744462614e434f372f56426a6e4b756455554968434177734c747571302f7a7562397641640a384731736366497076357161534e7a6d4b6f5838624f77417276725336775037794b726354737557496c484438724a5649374945446e516f5470354738664b310a68774a2f4d4968384d35763072356455594576366f494a5747636c65364148314a6d73503557496166677137325a32323838704863434648774e59384467394a0a3736517377564c6e556850546c6d6d33454f4f50474574616d32694144357230416679746c62346c624e6f51736a32737a65584f4e4458422b366f7565616a680a564e454c55723848635350356c677a525a6a4a57366146497a6a394c44526d516e55414f6a475358564f517445774a2f4d43515a374e2f763464494b654452410a3864385545785a332b674748756d7a697a7447524a30745172795a483250616b50354937562b316c377145556e4a3263336d462b65317634314570394c4376680a627a72504b773964786831386734622b37624d707357506e7372614b6836697078633761614f615a5630447867657a347a635a753050316f6c4f30634e334b4d0a6e784a305064733352386241684e43446453324a5a61527035513d3d0a2d2d2d2d2d454e44205253412050524956415445204b45592d2d2d2d2d0a', + 'public': '2d2d2d2d2d424547494e20525341205055424c4943204b45592d2d2d2d2d0a4d49494242674b422f6779376d6a615767506546645659445a5752434139424e69763370506230657332372b464b593068737a4c614f773437457843744157700a4473483438545841667948425977424c67756179666b344c4749757078622b43474d62526f337845703043626659314a62793236543976476a524331666f48440a44554a4738347561526279487161663469367a74346756522b786c4145496a6b614641414b38634f6f58415431435671474c4c6c6a554363684c38506a61486a0a2f7972695a2f53377264776c49334c6e41427877776d4c726d522f7637315774706d4f2f614e47384e2b31706f2b5177616768546b79513539452f5a7641754f0a6b4657486f6b32712f523650594161326a645a397a696d3046714f502b6e6b5161454452624246426d4271547635664647666b32577341664b662f5247302f560a46642b5a654d353235315465547658483639356e6c53476175566c3941674d424141453d0a2d2d2d2d2d454e4420525341205055424c4943204b45592d2d2d2d2d0a' +} +var crypto2 = require('public-encrypt/browser') +rsa.private = new Buffer(rsa.private, 'hex') +rsa.public = new Buffer(rsa.public, 'hex') +var encrypted = '0bcd6462ad7a563be2d42b0b73e0b0a163886304e7723b025f97605144fe1781e84acdc4031327d6bccd67fe13183e8fbdc8c5fe947b49d011ce3ebb08b11e83b87a77328ca57ee77cfdc78743b0749366643d7a21b2abcd4aa32dee9832938445540ee3007b7a70191c8dc9ff2ad76fe8dfaa5362d9d2c4b31a67b816d7b7970a293cb95bf3437a301bedb9f431b7075aa2f9df77b4385bea2a37982beda467260b384a58258b5eb4e36a0e0bf7dff83589636f5f97bf542084f0f76868c9f3f989a27fee5b8cd2bfee0bae1eae958df7c3184e5a40fda101196214f371606feca4330b221f30577804bbd4f61578a84e85dcd298849f509e630d275280' + +test('publicEncrypt/privateDecrypt', function (t) { + t.test('can decrypt', function (t) { + t.plan(2) + // note encryption is ranomized so can't test to see if they encrypt the same + t.equals(crypto1.privateDecrypt(rsa.private, new Buffer(encrypted, 'hex')).toString(), 'hello there I am a nice message', 'decrypt it properly') + t.equals(crypto2.privateDecrypt(rsa.private, new Buffer(encrypted, 'hex')).toString(), 'hello there I am a nice message', 'decrypt it properly') + }) + t.test('can round trip', function (t) { + t.plan(2) + var msg = 'this is a message' + // note encryption is ranomized so can't test to see if they encrypt the same + t.equals(crypto1.privateDecrypt(rsa.private, crypto2.publicEncrypt(rsa.public, new Buffer(msg))).toString(), msg, 'round trip it') + t.equals(crypto2.privateDecrypt(rsa.private, crypto1.publicEncrypt(rsa.public, new Buffer(msg))).toString(), msg, 'round trip it') + }) +}) + +test('privateEncrypt/publicDecrypt', function (t) { + t.test('can round trip', function (t) { + t.plan(2) + var msg = 'this is a message' + // note encryption is ranomized so can't test to see if they encrypt the same + t.equals(crypto1.publicDecrypt(rsa.public, crypto2.privateEncrypt(rsa.private, new Buffer(msg))).toString(), msg, 'round trip it') + t.equals(crypto2.publicDecrypt(rsa.public, crypto1.privateEncrypt(rsa.private, new Buffer(msg))).toString(), msg, 'round trip it') + }) +}) diff --git a/node_modules/crypto-browserify/test/random-bytes.js b/node_modules/crypto-browserify/test/random-bytes.js new file mode 100644 index 000000000..398af24a5 --- /dev/null +++ b/node_modules/crypto-browserify/test/random-bytes.js @@ -0,0 +1,60 @@ +var test = require('tape') +var crypto = require('../') + +var randomBytesFunctions = { + randomBytes: require('randombytes'), + pseudoRandomBytes: crypto.pseudoRandomBytes +} + +for (var randomBytesName in randomBytesFunctions) { + // Both randomBytes and pseudoRandomBytes should provide the same interface + var randomBytes = randomBytesFunctions[randomBytesName] + + test('get error message', function (t) { + try { + var b = randomBytes(10) + t.ok(Buffer.isBuffer(b)) + t.end() + } catch (err) { + t.ok(/not supported/.test(err.message), '"not supported" is in error message') + t.end() + } + }) + + test(randomBytesName, function (t) { + t.plan(5) + t.equal(randomBytes(10).length, 10) + t.ok(Buffer.isBuffer(randomBytes(10))) + randomBytes(10, function (ex, bytes) { + t.error(ex) + t.equal(bytes.length, 10) + t.ok(Buffer.isBuffer(bytes)) + t.end() + }) + }) + + test(randomBytesName + ' seem random', function (t) { + var L = 1000 + var b = randomBytes(L) + + var mean = [].reduce.call(b, function (a, b) { return a + b }, 0) / L + + // test that the random numbers are plausably random. + // Math.random() will pass this, but this will catch + // terrible mistakes such as this blunder: + // https://github.com/dominictarr/crypto-browserify/commit/3267955e1df7edd1680e52aeede9a89506ed2464#commitcomment-7916835 + + // this doesn't check that the bytes are in a random *order* + // but it's better than nothing. + + var expected = 256 / 2 + var smean = Math.sqrt(mean) + + // console.log doesn't work right on testling, *grumble grumble* + console.log(JSON.stringify([expected - smean, mean, expected + smean])) + t.ok(mean < expected + smean) + t.ok(mean > expected - smean) + + t.end() + }) +} diff --git a/node_modules/crypto-browserify/test/random-fill.js b/node_modules/crypto-browserify/test/random-fill.js new file mode 100644 index 000000000..63c885add --- /dev/null +++ b/node_modules/crypto-browserify/test/random-fill.js @@ -0,0 +1,53 @@ +var test = require('tape') +var crypto = require('../') +var Buffer = require('safe-buffer').Buffer + +test('get error message', function (t) { + try { + var b = crypto.randomFillSync(Buffer.alloc(10)) + t.ok(Buffer.isBuffer(b)) + t.end() + } catch (err) { + t.ok(/not supported/.test(err.message), '"not supported" is in error message') + t.end() + } +}) + +test('randomfill', function (t) { + t.plan(5) + t.equal(crypto.randomFillSync(Buffer.alloc(10)).length, 10) + t.ok(Buffer.isBuffer(crypto.randomFillSync(Buffer.alloc(10)))) + crypto.randomFill(Buffer.alloc(10), function (ex, bytes) { + t.error(ex) + t.equal(bytes.length, 10) + t.ok(Buffer.isBuffer(bytes)) + t.end() + }) +}) + +test('seems random', function (t) { + var L = 1000 + var b = crypto.randomFillSync(Buffer.alloc(L)) + + var mean = [].reduce.call(b, function (a, b) { + return a + b + }, 0) / L + + // test that the random numbers are plausably random. + // Math.random() will pass this, but this will catch + // terrible mistakes such as this blunder: + // https://github.com/dominictarr/crypto-browserify/commit/3267955e1df7edd1680e52aeede9a89506ed2464#commitcomment-7916835 + + // this doesn't check that the bytes are in a random *order* + // but it's better than nothing. + + var expected = 256 / 2 + var smean = Math.sqrt(mean) + + // console.log doesn't work right on testling, *grumble grumble* + console.log(JSON.stringify([expected - smean, mean, expected + smean])) + t.ok(mean < expected + smean) + t.ok(mean > expected - smean) + + t.end() +}) diff --git a/node_modules/crypto-browserify/test/sign.js b/node_modules/crypto-browserify/test/sign.js new file mode 100644 index 000000000..7d67685c7 --- /dev/null +++ b/node_modules/crypto-browserify/test/sign.js @@ -0,0 +1,59 @@ +var test = require('tape') +var nodeCrypto = require('../') +var ourCrypto = require('browserify-sign/browser') + +var rsa = { + 'private': '2d2d2d2d2d424547494e205253412050524956415445204b45592d2d2d2d2d0a4d4949456a77494241414b422f6779376d6a615767506546645659445a5752434139424e69763370506230657332372b464b593068737a4c614f7734374578430a744157704473483438545841667948425977424c67756179666b344c4749757078622b43474d62526f337845703043626659314a62793236543976476a5243310a666f484444554a4738347561526279487161663469367a74346756522b786c4145496a6b614641414b38634f6f58415431435671474c4c6c6a554363684c38500a6a61486a2f7972695a2f53377264776c49334c6e41427877776d4c726d522f7637315774706d4f2f614e47384e2b31706f2b5177616768546b79513539452f5a0a7641754f6b4657486f6b32712f523650594161326a645a397a696d3046714f502b6e6b5161454452624246426d4271547635664647666b32577341664b662f520a47302f5646642b5a654d353235315465547658483639356e6c53476175566c3941674d42414145436766344c725748592f6c35346f7554685a577676627275670a70667a36734a583267396c3779586d576c455773504543566f2f375355627059467074364f5a7939397a53672b494b624771574b6664686f4b725477495674430a4c30595a304e6c6d646e414e53497a30726f785147375a786b4c352b764853772f506d443978345577662b437a38684154436d4e42763171633630646b7975570a34434c71653732716154695657526f4f316961675167684e634c6f6f36765379363545784c614344545068613779753276773468465a705769456a57346478660a7246644c696978353242433836596c416c784d452f724c6738494a5676696c62796f39615764586d784f6155544c527636506b4644312f6756647738563951720a534c4e39466c4b326b6b6a695830647a6f6962765a7733744d6e74337979644178305838372b734d5256616843316270336b56507a3448793045575834514a2f0a504d33317647697549546b324e43643531445874314c746e324f503546614a536d4361456a6830586b5534716f7559796a585774384275364254436c327675610a466730556a6939432b496b504c6d61554d624d494f7761546b386357714c74685378734c6537304a354f6b477267664b554d2f772b4248483150742f506a7a6a0a432b2b6c306b6946614f5644566141563947704c504c43426f4b2f50433952622f72784d4d6f43434e774a2f4e5a756564496e793277334c4d69693737682f540a7a53766572674e47686a5936526e7661386c4c584a36646c726b6350417970733367577778716a344e5230542b474d3062445550564c62374d303758563753580a7637564a476d35324a625247774d3173732b72385854544e656d65476b2b5752784737546774734d715947584c66423851786b2f66352f4d63633030546c38750a7758464e7366784a786d7436416273547233673336774a2f49684f6e69627a3941642b6e63686c426e4e3351655733434b48717a61523138766f717674566d320a6b4a66484b31357072482f7353476d786d6945476772434a545a78744462614e434f372f56426a6e4b756455554968434177734c747571302f7a7562397641640a384731736366497076357161534e7a6d4b6f5838624f77417276725336775037794b726354737557496c484438724a5649374945446e516f5470354738664b310a68774a2f4d4968384d35763072356455594576366f494a5747636c65364148314a6d73503557496166677137325a32323838704863434648774e59384467394a0a3736517377564c6e556850546c6d6d33454f4f50474574616d32694144357230416679746c62346c624e6f51736a32737a65584f4e4458422b366f7565616a680a564e454c55723848635350356c677a525a6a4a57366146497a6a394c44526d516e55414f6a475358564f517445774a2f4d43515a374e2f763464494b654452410a3864385545785a332b674748756d7a697a7447524a30745172795a483250616b50354937562b316c377145556e4a3263336d462b65317634314570394c4376680a627a72504b773964786831386734622b37624d707357506e7372614b6836697078633761614f615a5630447867657a347a635a753050316f6c4f30634e334b4d0a6e784a305064733352386241684e43446453324a5a61527035513d3d0a2d2d2d2d2d454e44205253412050524956415445204b45592d2d2d2d2d0a', + 'public': '2d2d2d2d2d424547494e20525341205055424c4943204b45592d2d2d2d2d0a4d49494242674b422f6779376d6a615767506546645659445a5752434139424e69763370506230657332372b464b593068737a4c614f773437457843744157700a4473483438545841667948425977424c67756179666b344c4749757078622b43474d62526f337845703043626659314a62793236543976476a524331666f48440a44554a4738347561526279487161663469367a74346756522b786c4145496a6b614641414b38634f6f58415431435671474c4c6c6a554363684c38506a61486a0a2f7972695a2f53377264776c49334c6e41427877776d4c726d522f7637315774706d4f2f614e47384e2b31706f2b5177616768546b79513539452f5a7641754f0a6b4657486f6b32712f523650594161326a645a397a696d3046714f502b6e6b5161454452624246426d4271547635664647666b32577341664b662f5247302f560a46642b5a654d353235315465547658483639356e6c53476175566c3941674d424141453d0a2d2d2d2d2d454e4420525341205055424c4943204b45592d2d2d2d2d0a' +} + +var ec = { + 'private': '2d2d2d2d2d424547494e2045432050524956415445204b45592d2d2d2d2d0a4d485143415145454944463658763853762f2f77475557442b6337383070704772553051645a5743417a78415150515838722f756f416347425375424241414b0a6f55514451674145495a656f7744796c6c73344b2f7766426a4f313862596f37674778386e595152696a6134652f71454d696b4f484a616937676565557265550a7235586b792f4178377332644774656773504e7350674765354d705176673d3d0a2d2d2d2d2d454e442045432050524956415445204b45592d2d2d2d2d0a', + 'public': '2d2d2d2d2d424547494e205055424c4943204b45592d2d2d2d2d0a4d465977454159484b6f5a497a6a3043415159464b34454541416f4451674145495a656f7744796c6c73344b2f7766426a4f313862596f37674778386e5951520a696a6134652f71454d696b4f484a616937676565557265557235586b792f4178377332644774656773504e7350674765354d705176673d3d0a2d2d2d2d2d454e44205055424c4943204b45592d2d2d2d2d0a' +} + +rsa.private = new Buffer(rsa.private, 'hex') +rsa.public = new Buffer(rsa.public, 'hex') +ec.private = new Buffer(ec.private, 'hex') +ec.public = new Buffer(ec.public, 'hex') + +function testit (keys, message, scheme) { + var pub = keys.public + var priv = keys.private + test(message.toString(), function (t) { + t.test('js sign and verify', function (t) { + t.plan(t) + var mySign = ourCrypto.createSign(scheme) + var mySig = mySign.update(message).sign(priv) + var myVer = ourCrypto.createVerify(scheme) + t.ok(myVer.update(message).verify(pub, mySig), 'validates') + }) + + t.test('node sign and verify', function (t) { + t.plan(t) + var mySign = nodeCrypto.createSign(scheme) + var mySig = mySign.update(message).sign(priv) + var myVer = nodeCrypto.createVerify(scheme) + t.ok(myVer.update(message).verify(pub, mySig), 'validates') + }) + + t.test('node sign and js verify', function (t) { + t.plan(t) + var mySign = nodeCrypto.createSign(scheme) + var mySig = mySign.update(message).sign(priv) + var myVer = ourCrypto.createVerify(scheme) + t.ok(myVer.update(message).verify(pub, mySig), 'validates') + }) + + t.test('js sign and node verify', function (t) { + t.plan(t) + var mySign = ourCrypto.createSign(scheme) + var mySig = mySign.update(message).sign(priv) + var myVer = nodeCrypto.createVerify(scheme) + t.ok(myVer.update(message).verify(pub, mySig), 'validates') + }) + }) +} + +testit(rsa, new Buffer('rsa with sha256'), 'RSA-SHA256') +testit(ec, new Buffer('ec with sha1'), 'ecdsa-with-SHA1') diff --git a/node_modules/csjs-inject/.npmignore b/node_modules/csjs-inject/.npmignore new file mode 100644 index 000000000..1ca957177 --- /dev/null +++ b/node_modules/csjs-inject/.npmignore @@ -0,0 +1,2 @@ +node_modules/ +npm-debug.log diff --git a/node_modules/csjs-inject/LICENSE b/node_modules/csjs-inject/LICENSE new file mode 100644 index 000000000..fdbdf2b8b --- /dev/null +++ b/node_modules/csjs-inject/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Ryan Tsao + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/csjs-inject/README.md b/node_modules/csjs-inject/README.md new file mode 100644 index 000000000..0fbe39dc5 --- /dev/null +++ b/node_modules/csjs-inject/README.md @@ -0,0 +1,3 @@ +# csjs-inject + +A [CSJS](https://github.com/rtsao/csjs) wrapper module that works exactly like CSJS, but adds auto-injection of styles into the DOM. Powered by [substack/insert-css](https://github.com/substack/insert-css). diff --git a/node_modules/csjs-inject/csjs.js b/node_modules/csjs-inject/csjs.js new file mode 100644 index 000000000..a5390aa83 --- /dev/null +++ b/node_modules/csjs-inject/csjs.js @@ -0,0 +1,15 @@ +'use strict'; + +var csjs = require('csjs'); +var insertCss = require('insert-css'); + +function csjsInserter() { + var args = Array.prototype.slice.call(arguments); + var result = csjs.apply(null, args); + if (global.document) { + insertCss(csjs.getCss(result)); + } + return result; +} + +module.exports = csjsInserter; diff --git a/node_modules/csjs-inject/get-css.js b/node_modules/csjs-inject/get-css.js new file mode 100644 index 000000000..72b61bd0b --- /dev/null +++ b/node_modules/csjs-inject/get-css.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('csjs/get-css'); diff --git a/node_modules/csjs-inject/index.js b/node_modules/csjs-inject/index.js new file mode 100644 index 000000000..3d40ba159 --- /dev/null +++ b/node_modules/csjs-inject/index.js @@ -0,0 +1,7 @@ +'use strict'; + +var csjs = require('./csjs'); + +module.exports = csjs; +module.exports.csjs = csjs; +module.exports.getCss = require('./get-css'); diff --git a/node_modules/csjs-inject/package.json b/node_modules/csjs-inject/package.json new file mode 100644 index 000000000..b8cf4755f --- /dev/null +++ b/node_modules/csjs-inject/package.json @@ -0,0 +1,55 @@ +{ + "_from": "csjs-inject", + "_id": "csjs-inject@1.0.1", + "_inBundle": false, + "_integrity": "sha1-3iIRPEC0bP4X09YqAMd8nX2nUnw=", + "_location": "/csjs-inject", + "_phantomChildren": {}, + "_requested": { + "type": "tag", + "registry": true, + "raw": "csjs-inject", + "name": "csjs-inject", + "escapedName": "csjs-inject", + "rawSpec": "", + "saveSpec": null, + "fetchSpec": "latest" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/csjs-inject/-/csjs-inject-1.0.1.tgz", + "_shasum": "de22113c40b46cfe17d3d62a00c77c9d7da7527c", + "_spec": "csjs-inject", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon", + "author": { + "name": "Ryan Tsao", + "email": "ryan.j.tsao@gmail.com" + }, + "bugs": { + "url": "https://github.com/rtsao/csjs-inject/issues" + }, + "bundleDependencies": false, + "dependencies": { + "csjs": "^1.0.0", + "insert-css": "^0.2.0" + }, + "deprecated": false, + "description": "CSJS with auto-injection of styles", + "engines": { + "node": ">=4.0.0" + }, + "homepage": "https://github.com/rtsao/csjs-inject", + "keywords": [ + "csjs" + ], + "license": "MIT", + "main": "index.js", + "name": "csjs-inject", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/rtsao/csjs-inject.git" + }, + "version": "1.0.1" +} diff --git a/node_modules/csjs/.istanbul.yml b/node_modules/csjs/.istanbul.yml new file mode 100644 index 000000000..66ba183e5 --- /dev/null +++ b/node_modules/csjs/.istanbul.yml @@ -0,0 +1,4 @@ +instrumentation: + excludes: + - 'lib/base62-encode.js' + - 'lib/hash-string.js' diff --git a/node_modules/csjs/.npmignore b/node_modules/csjs/.npmignore new file mode 100644 index 000000000..df9af16ba --- /dev/null +++ b/node_modules/csjs/.npmignore @@ -0,0 +1,3 @@ +coverage +node_modules +npm-debug.log diff --git a/node_modules/csjs/.travis.yml b/node_modules/csjs/.travis.yml new file mode 100644 index 000000000..8ab39c6f2 --- /dev/null +++ b/node_modules/csjs/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: +- '4' +script: if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then npm run travis-test && npm run travis-test-browser; else npm run travis-test; fi +env: + global: + - secure: API1krUNaYB5ixJXZoNBKyEmyMqzAvfu/YG6DrVK69ITDCvg2RDbWkv9xm17DTWhX4htczvY0YPs1MX6NNJLwLdTOl3aelGXrbdJt0pGmOYg0KnNuw3hexCwm0std35iT2YOlF7Y5AwVLM5x3tqoPMIuc5WG5MVQoQXJ8yI7YbS2nqA5t9RaO9juaTiQeYTdNhJWMXn0LsFzay42HTi60jf0OQPjZsKYSseLYjsm/J7DU5TkMGed9UDIj8e4qf8CajHEOEUMHX1ZtU6L4TvX4y5H/5Ut5ACg7Fkh1Ojgc2NTb2fAdDrnU3DhpVo/DMhoJ+PYRSBU6+OtJaLuJgdOlg7ekShxMoYz9Y2iDnjiA6gs9/LLgMox3e5SNi7zZkpx0Q+7CtpRD19M4pVsw4EUHLKxuCBFCjwOb9/xGRnf0ow0gLjENPQ2K3XAxpwUtGH9EHO3APOUwBnaLGsz7bjuyrI1igMya/Az/Gzfj+L28dehXWVMK+AwnKwEJw4wvaZpiM0dKfgBFUVzA6/ujmKcwaQ/VgbR2+F0JkBboXCKkHXRItRzDvl44iJETMgkOZNZbQYJXzplqEDgPQ1XJPeg5f34YCuy24ask/CAkOIiEpsN9PJOHyLcWfZ/pX1SZq/NyJcMWXGZUSE/2kwJblLk0FlPZI0TCHxZqz7ALJenZ6E= + - secure: PSwziCwGTcLNqgqWv8iduHD4aJdPg8YTlPSAnMgyj7Q9Xjc1ino3kW9dDhUyAOi7nNSVWHpmSUcG7oFH7zDfHBLkvxW8yZTJJMDgPuUp5G/mDM2RSQINzwSduLhQvazvRS9gp6Dq5DBun9MxSTf4U+n4ZAwS4laPoweoCuFMa9ljo2dOJj8kDsiveXJAcOYIYxknaMoBhcdOWAkF/DS6I0jUO0WLb/TAqdT+SduWbPnC5RUn049xU6i3skaAnmXvaP+sqA1zuRHHF2qaycOo5qAv17HIfFp+51HstnMpjtt68NZI74SWunXbefwzgaFBWOrr/+kkHYw9svXPT34HmmU7BqlykcR8zlqJY6oFqjcQKZBNCaVSTzJaGhNgt6qjzTaPj71/WVmKL8++LNBIftGF78xq5iwq5D+1/a/iiZb4pGEOGuI3oUnT9nfBpE6sluEsufJnymucgC6T0oO9eUUo1iPUJWWhmlKfZrwLotV+8rtJOdLA1ZLQ/HonxSxU/odha0D+9Vm/rj9bXpgtWXkT/meD6wwScRE8m5CrZ7l/HOuO24u2zzsrV+M5Vsf/lTjrWUI7EHD9uAWgvV+Kb/CX/FAQSqTIOnT+sa3bzmqs9vuWNHJD3Giiumf2C77d1sk5SHF16V4y87IpF62ga8dVmxiFjrdWKmaK4EGUDvI= diff --git a/node_modules/csjs/.zuul.yml b/node_modules/csjs/.zuul.yml new file mode 100644 index 000000000..383861d29 --- /dev/null +++ b/node_modules/csjs/.zuul.yml @@ -0,0 +1,16 @@ +ui: tape +browsers: + - name: chrome + version: latest + - name: firefox + version: latest + - name: safari + version: latest + - name: iphone + version: latest + - name: microsoftedge + version: latest +browserify: + - transform: bulkify + - transform: brfs + - transform: folderify diff --git a/node_modules/csjs/LICENSE b/node_modules/csjs/LICENSE new file mode 100644 index 000000000..fdbdf2b8b --- /dev/null +++ b/node_modules/csjs/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Ryan Tsao + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/csjs/README.md b/node_modules/csjs/README.md new file mode 100644 index 000000000..4ae145a7b --- /dev/null +++ b/node_modules/csjs/README.md @@ -0,0 +1,245 @@ +# [![CSJS logo](https://cdn.rawgit.com/rtsao/csjs/logo/logo.svg "CSJS (Cascading Style JavaScripts)")](https://github.com/rtsao/csjs) + +[![build status][build-badge]][build-href] +[![coverage status][coverage-badge]][coverage-href] +[![dependencies status][deps-badge]][deps-href] +[![npm version][npm-badge]][npm-href] + +> CSJS allows you to write modular, scoped CSS with valid JavaScript. + +## Features +* Extremely simple and lightweight + * Zero dependencies, [~2KB minified and gzipped][csjs-bundle] +* Leverages native ES6 and CSS features [(1)] rather than reinventing the wheel + * Seamless modular, scoped styles with explicit dependencies powered by CommonJS/ES6 modules + * Dead-simple variables/mixins using tagged ES6 template strings + * Style composition with optimal reuse via natural class composition mechanics already in CSS/HTML[(2)] +* Works tooling-free; no required transpilation/compilation/build steps [(3)] +* Framework-agnostic (No React dependency; works with Web Components, etc.) +* Fully supported native CSS media queries, pseudo-classes, keyframe animations, etc. +* Server-rendered/universal JavaScript support + +## Quick Example +([Live editable codepen.io demo](http://codepen.io/rtsao/pen/jWRJZj?editors=0010)) +```javascript +const csjs = require('csjs'); +const {div, h1} = require('react').DOM; + +const green = '#33aa22'; + +const styles = csjs` + + .panel { + border: 1px solid black; + background-color: ${green}; + } + + .title { + padding: 4px; + font-size: 15px; + } + +`; + +const html = require('react-dom/server').renderToStaticMarkup( + div({className: styles.panel}, [ + h1({className: styles.title}, 'Hello World!') + ]) +); +/* +
+

Hello World!

+
+*/ + +const css = csjs.getCss(styles); +/* +.panel_4Eda43 { + border: 1px solid black; + background-color: #33aa22; +} + +.title_4Eda43 { + padding: 4px; + font-size: 15px; +} +*/ +``` + +### Simple, tooling-free + +CSJS runs in ES6 environments without transpilation, compilation, or build steps (including Node 4+ and latest stable Chrome/Firefox/Safari/Edge). + +[![sauce labs test status][sauce-badge]][sauce-href] + +Of course, you can always transpile ES6 template strings using Babel, allowing you to use CSJS in any ES5 environment. + +### Framework-agnostic + +CSJS works with any framework, be it React, native Web Components, or something else. + +### Full power of JavaScript in your CSS + +* Real, full-fledged JavaScript +* Obviates the need for Sass/Less or other preprocessors + * Proper imports/require + * Real variables, functions, loops, etc. + * As extensible as JavaScript itself + +### Class Composition Syntax + +CSJS also features class composition that works like [CSS Modules]: + +([Live editable codepen.io demo](http://codepen.io/rtsao/pen/RrmpdX?editors=0010)) + +**common-styles.js** +```javascript +const csjs = require('csjs'); + +module.exports = csjs` + + .border { + border: 1px solid black; + } + + .italic { + font-family: serif; + font-style: italic; + } + +`; + +``` + +**quote-styles.js** +```javascript +const csjs = require('csjs'); + +const common = require('./common-styles'); + +module.exports = csjs` + + .blockQuote extends ${common.italic} { + background: #ccc; + padding: 8px; + border-radius: 4px; + } + + .pullQuote extends .blockQuote, ${common.border} { + background: #eee; + font-weight: bold; + } + +`; + +``` + +**app.js** +```javascript +const getCss = require('csjs/get-css'); +const commonStyles = require('./common-styles'); +const quoteStyles = require('./quote-styles'); + +quoteStyles.blockQuote; +// => "blockQuote_2bVd7K italic_3YGtO7" + +quoteStyles.pullQuote; +// => "pullQuote_2bVd7K blockQuote_2bVd7K italic_3YGtO7 border_3YGtO7" + +getCss(quoteStyles); +/* +.blockQuote_2bVd7K { + background: #ccc; + padding: 8px; + border-radius: 4px; +} + +.pullQuote_2bVd7K { + background: #eee; + font-weight: bold; +} +*/ + +getCss(commonStyles); +/* +.border_3YGtO7 { + border: 1px solid black; +} + +.italic_3YGtO7 { + font-family: serif; + font-style: italic; +} +*/ +``` + +### Optional tooling + +#### Extracted static CSS bundles + +[csjs-extractify](https://github.com/rtsao/csjs-extractify) is a browserify plugin that allows you to extract your application's CSJS into a static CSS file at build time. + +#### Automatic CSS injection + +[csjs-injectify](https://github.com/rtsao/csjs-injectify) is a browserify transform that automatically replaces `csjs` with [`csjs-inject`](https://github.com/rtsao/csjs-inject), which automatically injects your scoped CSS into the `` at runtime. It is recommended to use this rather than the [csjs-inject](https://github.com/rtsao/csjs-inject) module directly. + +#### PostCSS + +[babel-plugin-csjs-postcss](https://github.com/rtsao/babel-plugin-csjs-postcss) is a Babel plugin that allows you to run PostCSS on the CSS contained within CSJS template string literals at build time. Works with plugins such as [Autoprefixer]. + +#### Syntax highlighting +[neurosnap](https://github.com/neurosnap) has created an [Atom plugin for syntax highlighting](https://github.com/neurosnap/language-csjs) CSS within CSJS tagged template strings. + + +## FAQ + +##### Why the name CSJS? + +CSJS is 100% valid JavaScript, hence the name Cascading Style JavaScripts. + +##### Why not Sass? + +Sass doesn't provide any way to scope CSS, thus encapsulation of styles in components isn't possible with Sass alone. Additionally, because Sass was designed for use in a global CSS namespace, many of its features just don't make sense when styles are scoped and encapsulated in components. `@extend` in Sass is extremely problematic, whereas CSJS has a proper mechanism for class composition that actually works like it should. Furthermore, with CSJS, you have the ability to use real JavaScript in CSS, which is significantly more powerful and extensible than the language features included in Sass, so there's not really any reason to use Sass at all. + +##### Why not CSS Modules? + +CSJS was inspired by [CSS Modules] and they are virtually identical in concept. However, unlike CSS Modules which attempts to reproduce an ES6-style module system into CSS itself, CSJS simply uses native JS modules. CSJS also uses normal JS variables whereas CSS Modules invents its own CSS variable syntax. + +Consquently, CSJS is merely plain JavaScript and works without any extra tooling (CSS Modules is not valid CSS). Furthermore, because CSJS is essentially an amalgamation of plain JavaScript and plain CSS, there's no any new syntax or semantics to learn (besides the optional composition syntactic sugar, which closely mimicks ES6 classes). + +##### Why not Radium? + +Inline styles are cool, but there are limitations to using pure inline styles. For example, CSS pseudo-classes and media queries aren't possible with inline styles. This is the premise behind Radium, which works around this by re-implementing these CSS features using JavaScript. + +Whereas Radium is wholly dependent on React and involves performance trade-offs in its JavaScript implementations of CSS features, CSJS works regardless of framework (or lack thereof) and allows for the use of all CSS features natively (including media queries and pseudo-classes). + +## See Also +* https://github.com/rtsao/csjs-example-app +* https://github.com/rtsao/csjs-extractify +* https://github.com/rtsao/csjs-injectify +* https://github.com/rtsao/csjs-inject +* https://github.com/rtsao/babel-plugin-csjs-postcss +* https://github.com/rtsao/scope-styles + +## License +MIT + +[(1)]: #full-power-of-javascript-in-your-css +[(2)]: #class-composition-syntax +[(3)]: #simple-tooling-free + +[CSS Modules]: https://github.com/css-modules/css-modules +[Autoprefixer]: https://github.com/postcss/autoprefixer + +[csjs-bundle]: https://wzrd.in/bundle/csjs@latest + +[npm-badge]: https://badge.fury.io/js/csjs.svg +[npm-href]: https://www.npmjs.com/package/csjs +[build-badge]: https://travis-ci.org/rtsao/csjs.svg?branch=master +[build-href]: https://travis-ci.org/rtsao/csjs +[coverage-badge]: https://coveralls.io/repos/rtsao/csjs/badge.svg?branch=master&service=github +[coverage-href]: https://coveralls.io/github/rtsao/csjs?branch=master +[deps-badge]: https://img.shields.io/badge/dependencies-none-brightgreen.svg +[deps-href]: https://david-dm.org/rtsao/csjs +[sauce-badge]: https://saucelabs.com/browser-matrix/csjs.svg +[sauce-href]: https://saucelabs.com/u/csjs diff --git a/node_modules/csjs/csjs.js b/node_modules/csjs/csjs.js new file mode 100644 index 000000000..6cdda6a45 --- /dev/null +++ b/node_modules/csjs/csjs.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./lib/csjs'); diff --git a/node_modules/csjs/docs/automatic-vendor-prefixing.md b/node_modules/csjs/docs/automatic-vendor-prefixing.md new file mode 100644 index 000000000..65bace24d --- /dev/null +++ b/node_modules/csjs/docs/automatic-vendor-prefixing.md @@ -0,0 +1,10 @@ +# Automatic Vendor Prefixing + +## Runtime solutions + +* http://leaverou.github.io/prefixfree/ + +## Buildtime solutions + +* https://github.com/rtsao/babel-plugin-csjs-postcss w/ https://github.com/postcss/autoprefixer +* https://github.com/rtsao/csjs-extractify w/ https://github.com/postcss/autoprefixer diff --git a/node_modules/csjs/docs/comments.md b/node_modules/csjs/docs/comments.md new file mode 100644 index 000000000..8d0651fa5 --- /dev/null +++ b/node_modules/csjs/docs/comments.md @@ -0,0 +1,37 @@ +# CSS Comments + +CSJS will ignore everything inside CSS `/* */` comments, but preserve it in the output CSS. Note that CSJS will break if there are unbalanced comments. + +([Live editable codepen.io demo](http://codepen.io/rtsao/pen/MKNaPR?editors=0010)) + +```javascript +const csjs = require('csjs'); +const {h1} = require('react').DOM; + +const styles = csjs` + + /* + @keyframes fadeIn { + from { opacity: 0; } + to { opacity: 1; } + } + */ + + /* .foo { color: red; } */ + + .pulse { + animation: 1s ease-in-out infinite fadeIn alternate; + } + +`; + +const html = require('react-dom/server').renderToStaticMarkup( + h1({className: styles.title}, 'Hello World!') +); +/* +

Hello World!

+*/ + +console.log(styles); +// => {pulse: "pulse_1uRFrA"} +``` diff --git a/node_modules/csjs/docs/keyframe-animations.md b/node_modules/csjs/docs/keyframe-animations.md new file mode 100644 index 000000000..76c1621df --- /dev/null +++ b/node_modules/csjs/docs/keyframe-animations.md @@ -0,0 +1,44 @@ +# CSS3 Keyframe Animations + +## Scoped Animations + +CSJS scopes your keyframe animations just like class names. Note that they occupy the same namespace, so you can't export a keyframe animation with the same name as a class in the same template string literal. + +([Live editable codepen.io demo](http://codepen.io/rtsao/pen/KVOdWB?editors=0010)) + +```javascript +const csjs = require('csjs'); +const {h1} = require('react').DOM; + +const styles = csjs` + + @keyframes fadeIn { + from { opacity: 0; } + to { opacity: 1; } + } + + .pulse { + animation: 1s ease-in-out infinite fadeIn alternate; + } + +`; + +const html = require('react-dom/server').renderToStaticMarkup( + h1({className: styles.title}, 'Hello World!') +); +/* +

Hello World!

+*/ + +const css = csjs.getCss(styles); +/* +@keyframes fadeIn_1G6o1t { + from { opacity: 0; } + to { opacity: 1; } +} + +.pulse_1G6o1t { + animation: 1s ease-in-out infinite fadeIn_1G6o1t alternate; +} + */ +``` diff --git a/node_modules/csjs/get-css.js b/node_modules/csjs/get-css.js new file mode 100644 index 000000000..5ba4d4245 --- /dev/null +++ b/node_modules/csjs/get-css.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./lib/get-css'); diff --git a/node_modules/csjs/index.js b/node_modules/csjs/index.js new file mode 100644 index 000000000..bb5fe546b --- /dev/null +++ b/node_modules/csjs/index.js @@ -0,0 +1,8 @@ +'use strict'; + +var csjs = require('./csjs'); + +module.exports = csjs(); +module.exports.csjs = csjs; +module.exports.noScope = csjs({ noscope: true }); +module.exports.getCss = require('./get-css'); diff --git a/node_modules/csjs/lib/base62-encode.js b/node_modules/csjs/lib/base62-encode.js new file mode 100644 index 000000000..1da894978 --- /dev/null +++ b/node_modules/csjs/lib/base62-encode.js @@ -0,0 +1,20 @@ +'use strict'; + +/** + * base62 encode implementation based on base62 module: + * https://github.com/andrew/base62.js + */ + +var CHARS = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + +module.exports = function encode(integer) { + if (integer === 0) { + return '0'; + } + var str = ''; + while (integer > 0) { + str = CHARS[integer % 62] + str; + integer = Math.floor(integer / 62); + } + return str; +}; diff --git a/node_modules/csjs/lib/build-exports.js b/node_modules/csjs/lib/build-exports.js new file mode 100644 index 000000000..6914cd4a7 --- /dev/null +++ b/node_modules/csjs/lib/build-exports.js @@ -0,0 +1,42 @@ +'use strict'; + +var makeComposition = require('./composition').makeComposition; + +module.exports = function createExports(classes, keyframes, compositions) { + var keyframesObj = Object.keys(keyframes).reduce(function(acc, key) { + var val = keyframes[key]; + acc[val] = makeComposition([key], [val], true); + return acc; + }, {}); + + var exports = Object.keys(classes).reduce(function(acc, key) { + var val = classes[key]; + var composition = compositions[key]; + var extended = composition ? getClassChain(composition) : []; + var allClasses = [key].concat(extended); + var unscoped = allClasses.map(function(name) { + return classes[name] ? classes[name] : name; + }); + acc[val] = makeComposition(allClasses, unscoped); + return acc; + }, keyframesObj); + + return exports; +} + +function getClassChain(obj) { + var visited = {}, acc = []; + + function traverse(obj) { + return Object.keys(obj).forEach(function(key) { + if (!visited[key]) { + visited[key] = true; + acc.push(key); + traverse(obj[key]); + } + }); + } + + traverse(obj); + return acc; +} diff --git a/node_modules/csjs/lib/composition.js b/node_modules/csjs/lib/composition.js new file mode 100644 index 000000000..be1397222 --- /dev/null +++ b/node_modules/csjs/lib/composition.js @@ -0,0 +1,78 @@ +'use strict'; + +module.exports = { + makeComposition: makeComposition, + isComposition: isComposition, + ignoreComposition: ignoreComposition +}; + +/** + * Returns an immutable composition object containing the given class names + * @param {array} classNames - The input array of class names + * @return {Composition} - An immutable object that holds multiple + * representations of the class composition + */ +function makeComposition(classNames, unscoped, isAnimation) { + var classString = classNames.join(' '); + return Object.create(Composition.prototype, { + classNames: { // the original array of class names + value: Object.freeze(classNames), + configurable: false, + writable: false, + enumerable: true + }, + unscoped: { // the original array of class names + value: Object.freeze(unscoped), + configurable: false, + writable: false, + enumerable: true + }, + className: { // space-separated class string for use in HTML + value: classString, + configurable: false, + writable: false, + enumerable: true + }, + selector: { // comma-separated, period-prefixed string for use in CSS + value: classNames.map(function(name) { + return isAnimation ? name : '.' + name; + }).join(', '), + configurable: false, + writable: false, + enumerable: true + }, + toString: { // toString() method, returns class string for use in HTML + value: function() { + return classString; + }, + configurable: false, + writeable: false, + enumerable: false + } + }); +} + +/** + * Returns whether the input value is a Composition + * @param value - value to check + * @return {boolean} - whether value is a Composition or not + */ +function isComposition(value) { + return value instanceof Composition; +} + +function ignoreComposition(values) { + return values.reduce(function(acc, val) { + if (isComposition(val)) { + val.classNames.forEach(function(name, i) { + acc[name] = val.unscoped[i]; + }); + } + return acc; + }, {}); +} + +/** + * Private constructor for use in `instanceof` checks + */ +function Composition() {} diff --git a/node_modules/csjs/lib/csjs.js b/node_modules/csjs/lib/csjs.js new file mode 100644 index 000000000..59d3b5dd9 --- /dev/null +++ b/node_modules/csjs/lib/csjs.js @@ -0,0 +1,76 @@ +'use strict'; + +var extractExtends = require('./css-extract-extends'); +var composition = require('./composition'); +var isComposition = composition.isComposition; +var ignoreComposition = composition.ignoreComposition; +var buildExports = require('./build-exports'); +var scopify = require('./scopeify'); +var cssKey = require('./css-key'); +var extractExports = require('./extract-exports'); + +module.exports = function csjsTemplate(opts) { + opts = (typeof opts === 'undefined') ? {} : opts; + var noscope = (typeof opts.noscope === 'undefined') ? false : opts.noscope; + + return function csjsHandler(strings, values) { + // Fast path to prevent arguments deopt + var values = Array(arguments.length - 1); + for (var i = 1; i < arguments.length; i++) { + values[i - 1] = arguments[i]; + } + var css = joiner(strings, values.map(selectorize)); + var ignores = ignoreComposition(values); + + var scope = noscope ? extractExports(css) : scopify(css, ignores); + var extracted = extractExtends(scope.css); + var localClasses = without(scope.classes, ignores); + var localKeyframes = without(scope.keyframes, ignores); + var compositions = extracted.compositions; + + var exports = buildExports(localClasses, localKeyframes, compositions); + + return Object.defineProperty(exports, cssKey, { + enumerable: false, + configurable: false, + writeable: false, + value: extracted.css + }); + } +} + +/** + * Replaces class compositions with comma seperated class selectors + * @param value - the potential class composition + * @return - the original value or the selectorized class composition + */ +function selectorize(value) { + return isComposition(value) ? value.selector : value; +} + +/** + * Joins template string literals and values + * @param {array} strings - array of strings + * @param {array} values - array of values + * @return {string} - strings and values joined + */ +function joiner(strings, values) { + return strings.map(function(str, i) { + return (i !== values.length) ? str + values[i] : str; + }).join(''); +} + +/** + * Returns first object without keys of second + * @param {object} obj - source object + * @param {object} unwanted - object with unwanted keys + * @return {object} - first object without unwanted keys + */ +function without(obj, unwanted) { + return Object.keys(obj).reduce(function(acc, key) { + if (!unwanted[key]) { + acc[key] = obj[key]; + } + return acc; + }, {}); +} diff --git a/node_modules/csjs/lib/css-extract-extends.js b/node_modules/csjs/lib/css-extract-extends.js new file mode 100644 index 000000000..da10c9d9b --- /dev/null +++ b/node_modules/csjs/lib/css-extract-extends.js @@ -0,0 +1,51 @@ +'use strict'; + +var makeComposition = require('./composition').makeComposition; + +var regex = /\.([^\s]+)(\s+)(extends\s+)(\.[^{]+)/g; + +module.exports = function extractExtends(css) { + var found, matches = []; + while (found = regex.exec(css)) { + matches.unshift(found); + } + + function extractCompositions(acc, match) { + var extendee = getClassName(match[1]); + var keyword = match[3]; + var extended = match[4]; + + // remove from output css + var index = match.index + match[1].length + match[2].length; + var len = keyword.length + extended.length; + acc.css = acc.css.slice(0, index) + " " + acc.css.slice(index + len + 1); + + var extendedClasses = splitter(extended); + + extendedClasses.forEach(function(className) { + if (!acc.compositions[extendee]) { + acc.compositions[extendee] = {}; + } + if (!acc.compositions[className]) { + acc.compositions[className] = {}; + } + acc.compositions[extendee][className] = acc.compositions[className]; + }); + return acc; + } + + return matches.reduce(extractCompositions, { + css: css, + compositions: {} + }); + +}; + +function splitter(match) { + return match.split(',').map(getClassName); +} + +function getClassName(str) { + var trimmed = str.trim(); + return trimmed[0] === '.' ? trimmed.substr(1) : trimmed; +} diff --git a/node_modules/csjs/lib/css-key.js b/node_modules/csjs/lib/css-key.js new file mode 100644 index 000000000..64722b083 --- /dev/null +++ b/node_modules/csjs/lib/css-key.js @@ -0,0 +1,8 @@ +'use strict'; + +/** + * CSS identifiers with whitespace are invalid + * Hence this key will not cause a collision + */ + +module.exports = ' css '; diff --git a/node_modules/csjs/lib/extract-exports.js b/node_modules/csjs/lib/extract-exports.js new file mode 100644 index 000000000..b0de09657 --- /dev/null +++ b/node_modules/csjs/lib/extract-exports.js @@ -0,0 +1,25 @@ +'use strict'; + +var regex = require('./regex'); +var classRegex = regex.classRegex; +var keyframesRegex = regex.keyframesRegex; + +module.exports = extractExports; + +function extractExports(css) { + return { + css: css, + keyframes: getExport(css, keyframesRegex), + classes: getExport(css, classRegex) + }; +} + +function getExport(css, regex) { + var prop = {}; + var match; + while((match = regex.exec(css)) !== null) { + var name = match[2]; + prop[name] = name; + } + return prop; +} diff --git a/node_modules/csjs/lib/get-css.js b/node_modules/csjs/lib/get-css.js new file mode 100644 index 000000000..36ecbd79d --- /dev/null +++ b/node_modules/csjs/lib/get-css.js @@ -0,0 +1,7 @@ +'use strict'; + +var cssKey = require('./css-key'); + +module.exports = function getCss(csjs) { + return csjs[cssKey]; +}; diff --git a/node_modules/csjs/lib/hash-string.js b/node_modules/csjs/lib/hash-string.js new file mode 100644 index 000000000..926a24109 --- /dev/null +++ b/node_modules/csjs/lib/hash-string.js @@ -0,0 +1,16 @@ +'use strict'; + +/** + * djb2 string hash implementation based on string-hash module: + * https://github.com/darkskyapp/string-hash + */ + +module.exports = function hashStr(str) { + var hash = 5381; + var i = str.length; + + while (i) { + hash = (hash * 33) ^ str.charCodeAt(--i) + } + return hash >>> 0; +}; diff --git a/node_modules/csjs/lib/regex.js b/node_modules/csjs/lib/regex.js new file mode 100644 index 000000000..21a730a47 --- /dev/null +++ b/node_modules/csjs/lib/regex.js @@ -0,0 +1,14 @@ +'use strict'; + +var findClasses = /(\.)(?!\d)([^\s\.,{\[>+~#:)]*)(?![^{]*})/.source; +var findKeyframes = /(@\S*keyframes\s*)([^{\s]*)/.source; +var ignoreComments = /(?!(?:[^*/]|\*[^/]|\/[^*])*\*+\/)/.source; + +var classRegex = new RegExp(findClasses + ignoreComments, 'g'); +var keyframesRegex = new RegExp(findKeyframes + ignoreComments, 'g'); + +module.exports = { + classRegex: classRegex, + keyframesRegex: keyframesRegex, + ignoreComments: ignoreComments, +}; diff --git a/node_modules/csjs/lib/replace-animations.js b/node_modules/csjs/lib/replace-animations.js new file mode 100644 index 000000000..a090bad13 --- /dev/null +++ b/node_modules/csjs/lib/replace-animations.js @@ -0,0 +1,29 @@ +var ignoreComments = require('./regex').ignoreComments; + +module.exports = replaceAnimations; + +function replaceAnimations(result) { + var animations = Object.keys(result.keyframes).reduce(function(acc, key) { + acc[result.keyframes[key]] = key; + return acc; + }, {}); + var unscoped = Object.keys(animations); + + if (unscoped.length) { + var regexStr = '((?:animation|animation-name)\\s*:[^};]*)(' + + unscoped.join('|') + ')([;\\s])' + ignoreComments; + var regex = new RegExp(regexStr, 'g'); + + var replaced = result.css.replace(regex, function(match, preamble, name, ending) { + return preamble + animations[name] + ending; + }); + + return { + css: replaced, + keyframes: result.keyframes, + classes: result.classes + } + } + + return result; +} diff --git a/node_modules/csjs/lib/scoped-name.js b/node_modules/csjs/lib/scoped-name.js new file mode 100644 index 000000000..6da19eaae --- /dev/null +++ b/node_modules/csjs/lib/scoped-name.js @@ -0,0 +1,12 @@ +'use strict'; + +var encode = require('./base62-encode'); +var hash = require('./hash-string'); + +module.exports = function fileScoper(fileSrc) { + var suffix = encode(hash(fileSrc)); + + return function scopedName(name) { + return name + '_' + suffix; + } +}; diff --git a/node_modules/csjs/lib/scopeify.js b/node_modules/csjs/lib/scopeify.js new file mode 100644 index 000000000..1ffaa0de6 --- /dev/null +++ b/node_modules/csjs/lib/scopeify.js @@ -0,0 +1,39 @@ +'use strict'; + +var fileScoper = require('./scoped-name'); +var replaceAnimations = require('./replace-animations'); +var regex = require('./regex'); +var classRegex = regex.classRegex; +var keyframesRegex = regex.keyframesRegex; + +module.exports = scopify; + +function scopify(css, ignores) { + var makeScopedName = fileScoper(css); + var replacers = { + classes: classRegex, + keyframes: keyframesRegex + }; + + function scopeCss(result, key) { + var replacer = replacers[key]; + function replaceFn(fullMatch, prefix, name) { + var scopedName = ignores[name] ? name : makeScopedName(name); + result[key][scopedName] = name; + return prefix + scopedName; + } + return { + css: result.css.replace(replacer, replaceFn), + keyframes: result.keyframes, + classes: result.classes + }; + } + + var result = Object.keys(replacers).reduce(scopeCss, { + css: css, + keyframes: {}, + classes: {} + }); + + return replaceAnimations(result); +} diff --git a/node_modules/csjs/package.json b/node_modules/csjs/package.json new file mode 100644 index 000000000..6718af614 --- /dev/null +++ b/node_modules/csjs/package.json @@ -0,0 +1,73 @@ +{ + "_from": "csjs@^1.0.0", + "_id": "csjs@1.1.0", + "_inBundle": false, + "_integrity": "sha1-G1dTxr2QLaJp3rNpIVWFpdjx84A=", + "_location": "/csjs", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "csjs@^1.0.0", + "name": "csjs", + "escapedName": "csjs", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/csjs-inject" + ], + "_resolved": "https://registry.npmjs.org/csjs/-/csjs-1.1.0.tgz", + "_shasum": "1b5753c6bd902da269deb369215585a5d8f1f380", + "_spec": "csjs@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/csjs-inject", + "author": { + "name": "Ryan Tsao", + "email": "ryan.j.tsao@gmail.com" + }, + "bugs": { + "url": "https://github.com/rtsao/csjs/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Cascading Style JavaScripts", + "devDependencies": { + "brfs": "^1.4.2", + "bulk-require": "^0.2.1", + "bulkify": "^1.1.1", + "coveralls": "^2.11.4", + "folderify": "https://github.com/rtsao/folderify/tarball/patch-1", + "include-folder": "^1.0.0", + "istanbul": "^0.4.0", + "tape": "^4.2.0", + "zuul": "^3.8.0" + }, + "engines": { + "node": ">=4.0.0" + }, + "homepage": "https://github.com/rtsao/csjs", + "keywords": [ + "csjs", + "css-modules", + "scoped-css", + "css-in-js", + "modular-css", + "css" + ], + "license": "MIT", + "main": "index.js", + "name": "csjs", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/rtsao/csjs.git" + }, + "scripts": { + "cover": "istanbul cover test/index.js", + "test": "node test/index.js", + "travis-test": "npm run cover && ((cat coverage/lcov.info | coveralls) || exit 0)", + "travis-test-browser": "zuul -- test/index.js" + }, + "version": "1.1.0" +} diff --git a/node_modules/csjs/test/animation-as-pseudo.expected.css b/node_modules/csjs/test/animation-as-pseudo.expected.css new file mode 100644 index 000000000..f671bf2b6 --- /dev/null +++ b/node_modules/csjs/test/animation-as-pseudo.expected.css @@ -0,0 +1,13 @@ + + + @keyframes hover_zz7qS { + 0% { opacity: 0.0; } + 100% { opacity: 0.5; } + } + + @media (max-width: 480px) { + .animation_zz7qS:hover { + background: green; + } + } + diff --git a/node_modules/csjs/test/animation-as-pseudo.expected.json b/node_modules/csjs/test/animation-as-pseudo.expected.json new file mode 100644 index 000000000..c68d208ba --- /dev/null +++ b/node_modules/csjs/test/animation-as-pseudo.expected.json @@ -0,0 +1,4 @@ +{ + "animation": "animation_zz7qS", + "hover": "hover_zz7qS" +} diff --git a/node_modules/csjs/test/animation-as-pseudo.noscope.expected.css b/node_modules/csjs/test/animation-as-pseudo.noscope.expected.css new file mode 100644 index 000000000..3e7c1c408 --- /dev/null +++ b/node_modules/csjs/test/animation-as-pseudo.noscope.expected.css @@ -0,0 +1,13 @@ + + + @keyframes hover { + 0% { opacity: 0.0; } + 100% { opacity: 0.5; } + } + + @media (max-width: 480px) { + .animation:hover { + background: green; + } + } + diff --git a/node_modules/csjs/test/animation-as-pseudo.noscope.expected.json b/node_modules/csjs/test/animation-as-pseudo.noscope.expected.json new file mode 100644 index 000000000..3d2a63b3c --- /dev/null +++ b/node_modules/csjs/test/animation-as-pseudo.noscope.expected.json @@ -0,0 +1,4 @@ +{ + "animation": "animation", + "hover": "hover" +} diff --git a/node_modules/csjs/test/animation-as-pseudo.noscope.source.js b/node_modules/csjs/test/animation-as-pseudo.noscope.source.js new file mode 100644 index 000000000..be34b0497 --- /dev/null +++ b/node_modules/csjs/test/animation-as-pseudo.noscope.source.js @@ -0,0 +1,16 @@ +const csjs = require('../').noScope; + +module.exports = csjs` + + @keyframes hover { + 0% { opacity: 0.0; } + 100% { opacity: 0.5; } + } + + @media (max-width: 480px) { + .animation:hover { + background: green; + } + } + +`; diff --git a/node_modules/csjs/test/animation-as-pseudo.source.js b/node_modules/csjs/test/animation-as-pseudo.source.js new file mode 100644 index 000000000..afe32eaab --- /dev/null +++ b/node_modules/csjs/test/animation-as-pseudo.source.js @@ -0,0 +1,16 @@ +const csjs = require('../'); + +module.exports = csjs` + + @keyframes hover { + 0% { opacity: 0.0; } + 100% { opacity: 0.5; } + } + + @media (max-width: 480px) { + .animation:hover { + background: green; + } + } + +`; diff --git a/node_modules/csjs/test/basic.expected.css b/node_modules/csjs/test/basic.expected.css new file mode 100644 index 000000000..40285bbbc --- /dev/null +++ b/node_modules/csjs/test/basic.expected.css @@ -0,0 +1,6 @@ + + + .foo_4xZqpC { + color: red; + } + diff --git a/node_modules/csjs/test/basic.expected.json b/node_modules/csjs/test/basic.expected.json new file mode 100644 index 000000000..9abd204d7 --- /dev/null +++ b/node_modules/csjs/test/basic.expected.json @@ -0,0 +1,3 @@ +{ + "foo": "foo_4xZqpC" +} diff --git a/node_modules/csjs/test/basic.noscope.expected.css b/node_modules/csjs/test/basic.noscope.expected.css new file mode 100644 index 000000000..d3da2a55d --- /dev/null +++ b/node_modules/csjs/test/basic.noscope.expected.css @@ -0,0 +1,6 @@ + + + .foo { + color: red; + } + diff --git a/node_modules/csjs/test/basic.noscope.expected.json b/node_modules/csjs/test/basic.noscope.expected.json new file mode 100644 index 000000000..abdd5202b --- /dev/null +++ b/node_modules/csjs/test/basic.noscope.expected.json @@ -0,0 +1,3 @@ +{ + "foo": "foo" +} diff --git a/node_modules/csjs/test/basic.noscope.source.js b/node_modules/csjs/test/basic.noscope.source.js new file mode 100644 index 000000000..217776b2b --- /dev/null +++ b/node_modules/csjs/test/basic.noscope.source.js @@ -0,0 +1,9 @@ +const csjs = require('../').noScope; + +module.exports = csjs` + + .foo { + color: red; + } + +`; diff --git a/node_modules/csjs/test/basic.source.js b/node_modules/csjs/test/basic.source.js new file mode 100644 index 000000000..ccc3ec2cd --- /dev/null +++ b/node_modules/csjs/test/basic.source.js @@ -0,0 +1,9 @@ +const csjs = require('../'); + +module.exports = csjs` + + .foo { + color: red; + } + +`; diff --git a/node_modules/csjs/test/comments.expected.css b/node_modules/csjs/test/comments.expected.css new file mode 100644 index 000000000..f23bfb4b3 --- /dev/null +++ b/node_modules/csjs/test/comments.expected.css @@ -0,0 +1,38 @@ + + /* Here's a comment */ + /*squishedcomment*/ + /********crazycomment********/ + /* A comment with a period at the end. */ + /* A comment with a period followed by numbers v1.2.3 */ + /* A comment with a .className */ + /* + * Here's a comment + * A comment with a period at the end. + * A comment with a period followed by numbers v1.2.3 + * A comment with a .className + */ + /* .inlineCss { color: red; } */ + /* + .commentedOutCss { + color: blue; + } + */ + .foo_1LMZVZ { + color: red; /* comment on a line */ + animation-name: wow_1LMZVZ; + } + + @keyframes wow_1LMZVZ {} + + /* + @keyframes bam {} + */ + + /* .woot { + animation-name: bam; + } */ + + /* .hmm { + animation-name: wow; + } */ + diff --git a/node_modules/csjs/test/comments.expected.json b/node_modules/csjs/test/comments.expected.json new file mode 100644 index 000000000..3f853cad7 --- /dev/null +++ b/node_modules/csjs/test/comments.expected.json @@ -0,0 +1,4 @@ +{ + "foo": "foo_1LMZVZ", + "wow": "wow_1LMZVZ" +} diff --git a/node_modules/csjs/test/comments.noscope.expected.css b/node_modules/csjs/test/comments.noscope.expected.css new file mode 100644 index 000000000..29a2a02fa --- /dev/null +++ b/node_modules/csjs/test/comments.noscope.expected.css @@ -0,0 +1,38 @@ + + /* Here's a comment */ + /*squishedcomment*/ + /********crazycomment********/ + /* A comment with a period at the end. */ + /* A comment with a period followed by numbers v1.2.3 */ + /* A comment with a .className */ + /* + * Here's a comment + * A comment with a period at the end. + * A comment with a period followed by numbers v1.2.3 + * A comment with a .className + */ + /* .inlineCss { color: red; } */ + /* + .commentedOutCss { + color: blue; + } + */ + .foo { + color: red; /* comment on a line */ + animation-name: wow; + } + + @keyframes wow {} + + /* + @keyframes bam {} + */ + + /* .woot { + animation-name: bam; + } */ + + /* .hmm { + animation-name: wow; + } */ + diff --git a/node_modules/csjs/test/comments.noscope.expected.json b/node_modules/csjs/test/comments.noscope.expected.json new file mode 100644 index 000000000..3f853cad7 --- /dev/null +++ b/node_modules/csjs/test/comments.noscope.expected.json @@ -0,0 +1,4 @@ +{ + "foo": "foo_1LMZVZ", + "wow": "wow_1LMZVZ" +} diff --git a/node_modules/csjs/test/comments.source.js b/node_modules/csjs/test/comments.source.js new file mode 100644 index 000000000..c07e858e4 --- /dev/null +++ b/node_modules/csjs/test/comments.source.js @@ -0,0 +1,41 @@ +const csjs = require('../'); + +module.exports = csjs` + /* Here's a comment */ + /*squishedcomment*/ + /********crazycomment********/ + /* A comment with a period at the end. */ + /* A comment with a period followed by numbers v1.2.3 */ + /* A comment with a .className */ + /* + * Here's a comment + * A comment with a period at the end. + * A comment with a period followed by numbers v1.2.3 + * A comment with a .className + */ + /* .inlineCss { color: red; } */ + /* + .commentedOutCss { + color: blue; + } + */ + .foo { + color: red; /* comment on a line */ + animation-name: wow; + } + + @keyframes wow {} + + /* + @keyframes bam {} + */ + + /* .woot { + animation-name: bam; + } */ + + /* .hmm { + animation-name: wow; + } */ + +`; diff --git a/node_modules/csjs/test/comments.source.noscope.js b/node_modules/csjs/test/comments.source.noscope.js new file mode 100644 index 000000000..653622c48 --- /dev/null +++ b/node_modules/csjs/test/comments.source.noscope.js @@ -0,0 +1,41 @@ +const csjs = require('../').noScope; + +module.exports = csjs` + /* Here's a comment */ + /*squishedcomment*/ + /********crazycomment********/ + /* A comment with a period at the end. */ + /* A comment with a period followed by numbers v1.2.3 */ + /* A comment with a .className */ + /* + * Here's a comment + * A comment with a period at the end. + * A comment with a period followed by numbers v1.2.3 + * A comment with a .className + */ + /* .inlineCss { color: red; } */ + /* + .commentedOutCss { + color: blue; + } + */ + .foo { + color: red; /* comment on a line */ + animation-name: wow; + } + + @keyframes wow {} + + /* + @keyframes bam {} + */ + + /* .woot { + animation-name: bam; + } */ + + /* .hmm { + animation-name: wow; + } */ + +`; diff --git a/node_modules/csjs/test/dot-in-values.expected.css b/node_modules/csjs/test/dot-in-values.expected.css new file mode 100644 index 000000000..5198ccbb8 --- /dev/null +++ b/node_modules/csjs/test/dot-in-values.expected.css @@ -0,0 +1,8 @@ + + + .foo_1Veq6n { + font-size: 1.3em; + } + + .bar_1Veq6n { font-size: 12.5px; } .baz_1Veq6n { width: 33.3% } + diff --git a/node_modules/csjs/test/dot-in-values.expected.json b/node_modules/csjs/test/dot-in-values.expected.json new file mode 100644 index 000000000..4170531fa --- /dev/null +++ b/node_modules/csjs/test/dot-in-values.expected.json @@ -0,0 +1,5 @@ +{ + "foo": "foo_1Veq6n", + "baz": "baz_1Veq6n", + "bar": "bar_1Veq6n" +} diff --git a/node_modules/csjs/test/dot-in-values.noscope.expected.css b/node_modules/csjs/test/dot-in-values.noscope.expected.css new file mode 100644 index 000000000..50fb90677 --- /dev/null +++ b/node_modules/csjs/test/dot-in-values.noscope.expected.css @@ -0,0 +1,8 @@ + + + .foo { + font-size: 1.3em; + } + + .bar { font-size: 12.5px; } .baz { width: 33.3% } + diff --git a/node_modules/csjs/test/dot-in-values.noscope.expected.json b/node_modules/csjs/test/dot-in-values.noscope.expected.json new file mode 100644 index 000000000..8c71ae57d --- /dev/null +++ b/node_modules/csjs/test/dot-in-values.noscope.expected.json @@ -0,0 +1,5 @@ +{ + "foo": "foo", + "baz": "baz", + "bar": "bar" +} diff --git a/node_modules/csjs/test/dot-in-values.noscope.source.js b/node_modules/csjs/test/dot-in-values.noscope.source.js new file mode 100644 index 000000000..98ce1f904 --- /dev/null +++ b/node_modules/csjs/test/dot-in-values.noscope.source.js @@ -0,0 +1,11 @@ +const csjs = require('../').noScope; + +module.exports = csjs` + + .foo { + font-size: 1.3em; + } + + .bar { font-size: 12.5px; } .baz { width: 33.3% } + +`; diff --git a/node_modules/csjs/test/dot-in-values.source.js b/node_modules/csjs/test/dot-in-values.source.js new file mode 100644 index 000000000..065c92683 --- /dev/null +++ b/node_modules/csjs/test/dot-in-values.source.js @@ -0,0 +1,11 @@ +const csjs = require('../'); + +module.exports = csjs` + + .foo { + font-size: 1.3em; + } + + .bar { font-size: 12.5px; } .baz { width: 33.3% } + +`; diff --git a/node_modules/csjs/test/extends-in-media-query.expected.css b/node_modules/csjs/test/extends-in-media-query.expected.css new file mode 100644 index 000000000..3d4c9eeb5 --- /dev/null +++ b/node_modules/csjs/test/extends-in-media-query.expected.css @@ -0,0 +1,30 @@ + + + .woot_2XWyPW { + color: red; + } + + .hello_2XWyPW { + font-size: 10px; + } + + .yay_2XWyPW { + font-weight: bold; + } + + @media (max-width: 480px) { + .woot_2XWyPW { + color: blue; + } + } + + @media (max-width: 580px) { + .woot_2XWyPW { + color: green; + } + } + + .underline_2XWyPW { + text-decoration: underline; + } + diff --git a/node_modules/csjs/test/extends-in-media-query.expected.json b/node_modules/csjs/test/extends-in-media-query.expected.json new file mode 100644 index 000000000..33de78946 --- /dev/null +++ b/node_modules/csjs/test/extends-in-media-query.expected.json @@ -0,0 +1,6 @@ +{ + "hello": "hello_2XWyPW", + "underline": "underline_2XWyPW", + "woot": "woot_2XWyPW foo_4xZqpC underline_2XWyPW hello_2XWyPW yay_2XWyPW", + "yay": "yay_2XWyPW" +} diff --git a/node_modules/csjs/test/extends-in-media-query.noscope.expected.css b/node_modules/csjs/test/extends-in-media-query.noscope.expected.css new file mode 100644 index 000000000..68764b222 --- /dev/null +++ b/node_modules/csjs/test/extends-in-media-query.noscope.expected.css @@ -0,0 +1,30 @@ + + + .woot { + color: red; + } + + .hello { + font-size: 10px; + } + + .yay { + font-weight: bold; + } + + @media (max-width: 480px) { + .woot { + color: blue; + } + } + + @media (max-width: 580px) { + .woot { + color: green; + } + } + + .underline { + text-decoration: underline; + } + diff --git a/node_modules/csjs/test/extends-in-media-query.noscope.expected.json b/node_modules/csjs/test/extends-in-media-query.noscope.expected.json new file mode 100644 index 000000000..9a7413ebd --- /dev/null +++ b/node_modules/csjs/test/extends-in-media-query.noscope.expected.json @@ -0,0 +1,6 @@ +{ + "hello": "hello", + "underline": "underline", + "woot": "woot foo underline hello yay", + "yay": "yay" +} diff --git a/node_modules/csjs/test/extends-in-media-query.noscope.source.js b/node_modules/csjs/test/extends-in-media-query.noscope.source.js new file mode 100644 index 000000000..152fdc924 --- /dev/null +++ b/node_modules/csjs/test/extends-in-media-query.noscope.source.js @@ -0,0 +1,35 @@ +const csjs = require('../').noScope; + +const basic = require('./basic.noscope.source'); + +module.exports = csjs` + + .woot { + color: red; + } + + .hello { + font-size: 10px; + } + + .yay { + font-weight: bold; + } + + @media (max-width: 480px) { + .woot extends .hello, .yay { + color: blue; + } + } + + @media (max-width: 580px) { + .woot extends ${basic.foo}, .underline { + color: green; + } + } + + .underline { + text-decoration: underline; + } + +`; diff --git a/node_modules/csjs/test/extends-in-media-query.source.js b/node_modules/csjs/test/extends-in-media-query.source.js new file mode 100644 index 000000000..553110cf3 --- /dev/null +++ b/node_modules/csjs/test/extends-in-media-query.source.js @@ -0,0 +1,35 @@ +const csjs = require('../'); + +const basic = require('./basic.source'); + +module.exports = csjs` + + .woot { + color: red; + } + + .hello { + font-size: 10px; + } + + .yay { + font-weight: bold; + } + + @media (max-width: 480px) { + .woot extends .hello, .yay { + color: blue; + } + } + + @media (max-width: 580px) { + .woot extends ${basic.foo}, .underline { + color: green; + } + } + + .underline { + text-decoration: underline; + } + +`; diff --git a/node_modules/csjs/test/extensions.expected.css b/node_modules/csjs/test/extensions.expected.css new file mode 100644 index 000000000..d228f5e59 --- /dev/null +++ b/node_modules/csjs/test/extensions.expected.css @@ -0,0 +1,18 @@ + + + .foo_g7Bft { + color: red; + } + + .bar_g7Bft { + background: blue; + } + + .baz_g7Bft { + text-transform: uppercase; + } + + .bazz_g7Bft { + color: white; + } + diff --git a/node_modules/csjs/test/extensions.expected.json b/node_modules/csjs/test/extensions.expected.json new file mode 100644 index 000000000..971808b5c --- /dev/null +++ b/node_modules/csjs/test/extensions.expected.json @@ -0,0 +1,6 @@ +{ + "foo": "foo_g7Bft", + "bar": "bar_g7Bft foo_g7Bft", + "baz": "baz_g7Bft bar_g7Bft foo_g7Bft", + "bazz": "bazz_g7Bft bar_g7Bft foo_g7Bft" +} diff --git a/node_modules/csjs/test/extensions.noscope.expected.css b/node_modules/csjs/test/extensions.noscope.expected.css new file mode 100644 index 000000000..ae2d98611 --- /dev/null +++ b/node_modules/csjs/test/extensions.noscope.expected.css @@ -0,0 +1,18 @@ + + + .foo { + color: red; + } + + .bar { + background: blue; + } + + .baz { + text-transform: uppercase; + } + + .bazz { + color: white; + } + diff --git a/node_modules/csjs/test/extensions.noscope.expected.json b/node_modules/csjs/test/extensions.noscope.expected.json new file mode 100644 index 000000000..ef57afcd2 --- /dev/null +++ b/node_modules/csjs/test/extensions.noscope.expected.json @@ -0,0 +1,6 @@ +{ + "foo": "foo", + "bar": "bar foo", + "baz": "baz bar foo", + "bazz": "bazz bar foo" +} diff --git a/node_modules/csjs/test/extensions.noscope.source.js b/node_modules/csjs/test/extensions.noscope.source.js new file mode 100644 index 000000000..45155b638 --- /dev/null +++ b/node_modules/csjs/test/extensions.noscope.source.js @@ -0,0 +1,21 @@ +const csjs = require('../').noScope; + +module.exports = csjs` + + .foo { + color: red; + } + + .bar extends .foo { + background: blue; + } + + .baz extends .bar { + text-transform: uppercase; + } + + .bazz extends .bar{ + color: white; + } + +`; diff --git a/node_modules/csjs/test/extensions.source.js b/node_modules/csjs/test/extensions.source.js new file mode 100644 index 000000000..b6689a813 --- /dev/null +++ b/node_modules/csjs/test/extensions.source.js @@ -0,0 +1,21 @@ +const csjs = require('../'); + +module.exports = csjs` + + .foo { + color: red; + } + + .bar extends .foo { + background: blue; + } + + .baz extends .bar { + text-transform: uppercase; + } + + .bazz extends .bar{ + color: white; + } + +`; diff --git a/node_modules/csjs/test/index.js b/node_modules/csjs/test/index.js new file mode 100644 index 000000000..2c5c72994 --- /dev/null +++ b/node_modules/csjs/test/index.js @@ -0,0 +1,84 @@ +'use strict'; + +var fs = require('fs'); +var path = require('path'); +var test = require('tape'); + +var includeFolder = require('include-folder'); +var bulk = require('bulk-require'); + +var csjs = require('../'); + +var extensions = { + source: '.source.js', + json: '.expected.json', + css: '.expected.css' +}; + +var testFiles = fs.readdirSync('test'); + +var required = bulk(__dirname, [ + '*.source.js', + '*.expected.json' +]); + +var cssFiles = includeFolder('./test', /expected\.css$/, { + preserveFilenames: true +}); + +var fixtureRegex = new RegExp(extensions.source + '$'); +var matchesFixture = fixtureRegex.test.bind(fixtureRegex); + +var tests = testFiles + .filter(matchesFixture) + .map(function toName(file) { + return path.basename(file, extensions.source); + }); + +tests.forEach(testFromName); + +function testFromName(name) { + var fixtures = getFixtures(name); + runTest(name, fixtures.result, fixtures.expected); +} + +function runTest(name, result, expected) { + test('test ' + name, function t(assert) { + assert.equal(csjs.getCss(result), expected.css, 'css matches expected'); + assert.deepEqual(stringifyVals(result), expected.json, 'object matches expected'); + assert.end(); + }); +} + +function getFixtures(name) { + var sourcePath = name + '.source'; + var jsonPath = name + '.expected'; + var cssPath = name + extensions.css; + + return { + result: required[sourcePath], + expected: { + json: required[jsonPath], + css: cssFiles[cssPath] + } + } +} + +function moduleExists(name) { + try { + return Boolean(require.resolve(name)); + } catch(e) { + return false; + } +} + +function fixturePath(name, ext) { + return path.join(__dirname, name + ext); +} + +function stringifyVals(obj) { + return Object.keys(obj).reduce(function(acc, key) { + acc[key] = obj[key].toString(); + return acc; + }, {}); +} diff --git a/node_modules/csjs/test/keyframes-usage.expected.css b/node_modules/csjs/test/keyframes-usage.expected.css new file mode 100644 index 000000000..2d8cad6cf --- /dev/null +++ b/node_modules/csjs/test/keyframes-usage.expected.css @@ -0,0 +1,10 @@ + + + .woo_2MFmAf { + animation: yolo_4lrRRM 5s infinite; + } + + .boo_2MFmAf { + animation-name: yoloYolo_4lrRRM; + } + diff --git a/node_modules/csjs/test/keyframes-usage.expected.json b/node_modules/csjs/test/keyframes-usage.expected.json new file mode 100644 index 000000000..d80676587 --- /dev/null +++ b/node_modules/csjs/test/keyframes-usage.expected.json @@ -0,0 +1,4 @@ +{ + "boo": "boo_2MFmAf", + "woo": "woo_2MFmAf" +} diff --git a/node_modules/csjs/test/keyframes-usage.noscope.expected.css b/node_modules/csjs/test/keyframes-usage.noscope.expected.css new file mode 100644 index 000000000..6cd34f310 --- /dev/null +++ b/node_modules/csjs/test/keyframes-usage.noscope.expected.css @@ -0,0 +1,10 @@ + + + .woo { + animation: yolo 5s infinite; + } + + .boo { + animation-name: yoloYolo; + } + diff --git a/node_modules/csjs/test/keyframes-usage.noscope.expected.json b/node_modules/csjs/test/keyframes-usage.noscope.expected.json new file mode 100644 index 000000000..7b6ef07a9 --- /dev/null +++ b/node_modules/csjs/test/keyframes-usage.noscope.expected.json @@ -0,0 +1,4 @@ +{ + "boo": "boo", + "woo": "woo" +} diff --git a/node_modules/csjs/test/keyframes-usage.noscope.source.js b/node_modules/csjs/test/keyframes-usage.noscope.source.js new file mode 100644 index 000000000..ad6ef61c1 --- /dev/null +++ b/node_modules/csjs/test/keyframes-usage.noscope.source.js @@ -0,0 +1,15 @@ +const csjs = require('../').noScope; + +const keyframes = require('./keyframes.noscope.source'); + +module.exports = csjs` + + .woo { + animation: ${keyframes.yolo} 5s infinite; + } + + .boo { + animation-name: ${keyframes.yoloYolo}; + } + +`; diff --git a/node_modules/csjs/test/keyframes-usage.source.js b/node_modules/csjs/test/keyframes-usage.source.js new file mode 100644 index 000000000..615b031c3 --- /dev/null +++ b/node_modules/csjs/test/keyframes-usage.source.js @@ -0,0 +1,15 @@ +const csjs = require('../'); + +const keyframes = require('./keyframes.source'); + +module.exports = csjs` + + .woo { + animation: ${keyframes.yolo} 5s infinite; + } + + .boo { + animation-name: ${keyframes.yoloYolo}; + } + +`; diff --git a/node_modules/csjs/test/keyframes-with-decimal.expected.css b/node_modules/csjs/test/keyframes-with-decimal.expected.css new file mode 100644 index 000000000..b39fe8f84 --- /dev/null +++ b/node_modules/csjs/test/keyframes-with-decimal.expected.css @@ -0,0 +1,8 @@ + + + @keyframes woot_3xZGg2 { + 0% { opacity: 0; } + 33.3% { opacity: 0.333; } + 100% { opacity: 1; } + } + diff --git a/node_modules/csjs/test/keyframes-with-decimal.expected.json b/node_modules/csjs/test/keyframes-with-decimal.expected.json new file mode 100644 index 000000000..836b14d41 --- /dev/null +++ b/node_modules/csjs/test/keyframes-with-decimal.expected.json @@ -0,0 +1,3 @@ +{ + "woot": "woot_3xZGg2" +} diff --git a/node_modules/csjs/test/keyframes-with-decimal.noscope.expected.css b/node_modules/csjs/test/keyframes-with-decimal.noscope.expected.css new file mode 100644 index 000000000..c56a4c694 --- /dev/null +++ b/node_modules/csjs/test/keyframes-with-decimal.noscope.expected.css @@ -0,0 +1,8 @@ + + + @keyframes woot { + 0% { opacity: 0; } + 33.3% { opacity: 0.333; } + 100% { opacity: 1; } + } + diff --git a/node_modules/csjs/test/keyframes-with-decimal.noscope.expected.json b/node_modules/csjs/test/keyframes-with-decimal.noscope.expected.json new file mode 100644 index 000000000..3c675bb45 --- /dev/null +++ b/node_modules/csjs/test/keyframes-with-decimal.noscope.expected.json @@ -0,0 +1,3 @@ +{ + "woot": "woot" +} diff --git a/node_modules/csjs/test/keyframes-with-decimal.noscope.source.js b/node_modules/csjs/test/keyframes-with-decimal.noscope.source.js new file mode 100644 index 000000000..e9fe1f0f0 --- /dev/null +++ b/node_modules/csjs/test/keyframes-with-decimal.noscope.source.js @@ -0,0 +1,11 @@ +const csjs = require('../').noScope; + +module.exports = csjs` + + @keyframes woot { + 0% { opacity: 0; } + 33.3% { opacity: 0.333; } + 100% { opacity: 1; } + } + +`; diff --git a/node_modules/csjs/test/keyframes-with-decimal.source.js b/node_modules/csjs/test/keyframes-with-decimal.source.js new file mode 100644 index 000000000..36f80c413 --- /dev/null +++ b/node_modules/csjs/test/keyframes-with-decimal.source.js @@ -0,0 +1,11 @@ +const csjs = require('../'); + +module.exports = csjs` + + @keyframes woot { + 0% { opacity: 0; } + 33.3% { opacity: 0.333; } + 100% { opacity: 1; } + } + +`; diff --git a/node_modules/csjs/test/keyframes.expected.css b/node_modules/csjs/test/keyframes.expected.css new file mode 100644 index 000000000..43ff05548 --- /dev/null +++ b/node_modules/csjs/test/keyframes.expected.css @@ -0,0 +1,20 @@ + + + @keyframes yolo_4lrRRM { + 0% { opacity: 0; } + 100% { opacity: 1; } + } + + .foo_4lrRRM { + animation: yolo_4lrRRM 5s infinite; + } + + @keyframes yoloYolo_4lrRRM { + 0% { opacity: 0; } + 100% { opacity: 1; } + } + + .bar_4lrRRM { + animation: yoloYolo_4lrRRM 5s infinite; + } + diff --git a/node_modules/csjs/test/keyframes.expected.json b/node_modules/csjs/test/keyframes.expected.json new file mode 100644 index 000000000..aadeee812 --- /dev/null +++ b/node_modules/csjs/test/keyframes.expected.json @@ -0,0 +1,6 @@ +{ + "yolo": "yolo_4lrRRM", + "yoloYolo": "yoloYolo_4lrRRM", + "foo": "foo_4lrRRM", + "bar": "bar_4lrRRM" +} diff --git a/node_modules/csjs/test/keyframes.noscope.expected.css b/node_modules/csjs/test/keyframes.noscope.expected.css new file mode 100644 index 000000000..69658896c --- /dev/null +++ b/node_modules/csjs/test/keyframes.noscope.expected.css @@ -0,0 +1,20 @@ + + + @keyframes yolo { + 0% { opacity: 0; } + 100% { opacity: 1; } + } + + .foo { + animation: yolo 5s infinite; + } + + @keyframes yoloYolo { + 0% { opacity: 0; } + 100% { opacity: 1; } + } + + .bar { + animation: yoloYolo 5s infinite; + } + diff --git a/node_modules/csjs/test/keyframes.noscope.expected.json b/node_modules/csjs/test/keyframes.noscope.expected.json new file mode 100644 index 000000000..e6c1cfa78 --- /dev/null +++ b/node_modules/csjs/test/keyframes.noscope.expected.json @@ -0,0 +1,6 @@ +{ + "yolo": "yolo", + "yoloYolo": "yoloYolo", + "foo": "foo", + "bar": "bar" +} diff --git a/node_modules/csjs/test/keyframes.noscope.source.js b/node_modules/csjs/test/keyframes.noscope.source.js new file mode 100644 index 000000000..a5987312c --- /dev/null +++ b/node_modules/csjs/test/keyframes.noscope.source.js @@ -0,0 +1,23 @@ +const csjs = require('../').noScope; + +module.exports = csjs` + + @keyframes yolo { + 0% { opacity: 0; } + 100% { opacity: 1; } + } + + .foo { + animation: yolo 5s infinite; + } + + @keyframes yoloYolo { + 0% { opacity: 0; } + 100% { opacity: 1; } + } + + .bar { + animation: yoloYolo 5s infinite; + } + +`; diff --git a/node_modules/csjs/test/keyframes.source.js b/node_modules/csjs/test/keyframes.source.js new file mode 100644 index 000000000..47db3de1c --- /dev/null +++ b/node_modules/csjs/test/keyframes.source.js @@ -0,0 +1,23 @@ +const csjs = require('../'); + +module.exports = csjs` + + @keyframes yolo { + 0% { opacity: 0; } + 100% { opacity: 1; } + } + + .foo { + animation: yolo 5s infinite; + } + + @keyframes yoloYolo { + 0% { opacity: 0; } + 100% { opacity: 1; } + } + + .bar { + animation: yoloYolo 5s infinite; + } + +`; diff --git a/node_modules/csjs/test/media-query.expected.css b/node_modules/csjs/test/media-query.expected.css new file mode 100644 index 000000000..69fe4627c --- /dev/null +++ b/node_modules/csjs/test/media-query.expected.css @@ -0,0 +1,12 @@ + + + .foo_nYfJE { + color: red; + } + + @media (max-width: 480px) { + .foo_nYfJE { + color: blue; + } + } + diff --git a/node_modules/csjs/test/media-query.expected.json b/node_modules/csjs/test/media-query.expected.json new file mode 100644 index 000000000..a9b2eb56f --- /dev/null +++ b/node_modules/csjs/test/media-query.expected.json @@ -0,0 +1,3 @@ +{ + "foo": "foo_nYfJE" +} diff --git a/node_modules/csjs/test/media-query.noscope.expected.css b/node_modules/csjs/test/media-query.noscope.expected.css new file mode 100644 index 000000000..4f8020a52 --- /dev/null +++ b/node_modules/csjs/test/media-query.noscope.expected.css @@ -0,0 +1,12 @@ + + + .foo { + color: red; + } + + @media (max-width: 480px) { + .foo { + color: blue; + } + } + diff --git a/node_modules/csjs/test/media-query.noscope.expected.json b/node_modules/csjs/test/media-query.noscope.expected.json new file mode 100644 index 000000000..abdd5202b --- /dev/null +++ b/node_modules/csjs/test/media-query.noscope.expected.json @@ -0,0 +1,3 @@ +{ + "foo": "foo" +} diff --git a/node_modules/csjs/test/media-query.noscope.source.js b/node_modules/csjs/test/media-query.noscope.source.js new file mode 100644 index 000000000..721f5a689 --- /dev/null +++ b/node_modules/csjs/test/media-query.noscope.source.js @@ -0,0 +1,15 @@ +const csjs = require('../').noScope; + +module.exports = csjs` + + .foo { + color: red; + } + + @media (max-width: 480px) { + .foo { + color: blue; + } + } + +`; diff --git a/node_modules/csjs/test/media-query.source.js b/node_modules/csjs/test/media-query.source.js new file mode 100644 index 000000000..f37f8af1d --- /dev/null +++ b/node_modules/csjs/test/media-query.source.js @@ -0,0 +1,15 @@ +const csjs = require('../'); + +module.exports = csjs` + + .foo { + color: red; + } + + @media (max-width: 480px) { + .foo { + color: blue; + } + } + +`; diff --git a/node_modules/csjs/test/multiple-extensions.expected.css b/node_modules/csjs/test/multiple-extensions.expected.css new file mode 100644 index 000000000..2719ebfca --- /dev/null +++ b/node_modules/csjs/test/multiple-extensions.expected.css @@ -0,0 +1,14 @@ + + + .lol_IZbgA { + font-family: serif; + } + + .baz_IZbgA { + font-size: 12px; + } + + .fob_IZbgA { + font-weight: 500; + } + diff --git a/node_modules/csjs/test/multiple-extensions.expected.json b/node_modules/csjs/test/multiple-extensions.expected.json new file mode 100644 index 000000000..cf4780bbe --- /dev/null +++ b/node_modules/csjs/test/multiple-extensions.expected.json @@ -0,0 +1,5 @@ +{ + "lol": "lol_IZbgA", + "baz": "baz_IZbgA lol_IZbgA bar_g7Bft foo_g7Bft", + "fob": "fob_IZbgA foo_g7Bft" +} diff --git a/node_modules/csjs/test/multiple-extensions.noscope.expected.css b/node_modules/csjs/test/multiple-extensions.noscope.expected.css new file mode 100644 index 000000000..a4d69b6f0 --- /dev/null +++ b/node_modules/csjs/test/multiple-extensions.noscope.expected.css @@ -0,0 +1,14 @@ + + + .lol { + font-family: serif; + } + + .baz { + font-size: 12px; + } + + .fob { + font-weight: 500; + } + diff --git a/node_modules/csjs/test/multiple-extensions.noscope.expected.json b/node_modules/csjs/test/multiple-extensions.noscope.expected.json new file mode 100644 index 000000000..1f0dbb40f --- /dev/null +++ b/node_modules/csjs/test/multiple-extensions.noscope.expected.json @@ -0,0 +1,5 @@ +{ + "lol": "lol", + "baz": "baz lol bar foo", + "fob": "fob foo" +} diff --git a/node_modules/csjs/test/multiple-extensions.noscope.source.js b/node_modules/csjs/test/multiple-extensions.noscope.source.js new file mode 100644 index 000000000..4653d0f7b --- /dev/null +++ b/node_modules/csjs/test/multiple-extensions.noscope.source.js @@ -0,0 +1,19 @@ +const csjs = require('../').noScope; + +const external = require('./extensions.noscope.source'); + +module.exports = csjs` + + .lol { + font-family: serif; + } + + .baz extends .lol, ${external.bar} { + font-size: 12px; + } + + .fob extends ${external.foo} { + font-weight: 500; + } + +`; diff --git a/node_modules/csjs/test/multiple-extensions.source.js b/node_modules/csjs/test/multiple-extensions.source.js new file mode 100644 index 000000000..48bf5de1e --- /dev/null +++ b/node_modules/csjs/test/multiple-extensions.source.js @@ -0,0 +1,19 @@ +const csjs = require('../'); + +const external = require('./extensions.source'); + +module.exports = csjs` + + .lol { + font-family: serif; + } + + .baz extends .lol, ${external.bar} { + font-size: 12px; + } + + .fob extends ${external.foo} { + font-weight: 500; + } + +`; diff --git a/node_modules/csjs/test/non-class.expected.css b/node_modules/csjs/test/non-class.expected.css new file mode 100644 index 000000000..6b73fc54e --- /dev/null +++ b/node_modules/csjs/test/non-class.expected.css @@ -0,0 +1,6 @@ + + + #foo { + color: red; + } + diff --git a/node_modules/csjs/test/non-class.expected.json b/node_modules/csjs/test/non-class.expected.json new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/node_modules/csjs/test/non-class.expected.json @@ -0,0 +1 @@ +{} diff --git a/node_modules/csjs/test/non-class.noscope.expected.css b/node_modules/csjs/test/non-class.noscope.expected.css new file mode 100644 index 000000000..6b73fc54e --- /dev/null +++ b/node_modules/csjs/test/non-class.noscope.expected.css @@ -0,0 +1,6 @@ + + + #foo { + color: red; + } + diff --git a/node_modules/csjs/test/non-class.noscope.expected.json b/node_modules/csjs/test/non-class.noscope.expected.json new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/node_modules/csjs/test/non-class.noscope.expected.json @@ -0,0 +1 @@ +{} diff --git a/node_modules/csjs/test/non-class.noscope.source.js b/node_modules/csjs/test/non-class.noscope.source.js new file mode 100644 index 000000000..4384c49b6 --- /dev/null +++ b/node_modules/csjs/test/non-class.noscope.source.js @@ -0,0 +1,9 @@ +const csjs = require('../').noScope; + +module.exports = csjs` + + #foo { + color: red; + } + +`; diff --git a/node_modules/csjs/test/non-class.source.js b/node_modules/csjs/test/non-class.source.js new file mode 100644 index 000000000..0e782ea24 --- /dev/null +++ b/node_modules/csjs/test/non-class.source.js @@ -0,0 +1,9 @@ +const csjs = require('../'); + +module.exports = csjs` + + #foo { + color: red; + } + +`; diff --git a/node_modules/csjs/test/not-pseudo.expected.css b/node_modules/csjs/test/not-pseudo.expected.css new file mode 100644 index 000000000..77c9598fd --- /dev/null +++ b/node_modules/csjs/test/not-pseudo.expected.css @@ -0,0 +1,8 @@ + + + @media screen and (min-width: 769px) { + .foo_25D7El:not(.bar_25D7El) { + display: flex; + } + } + diff --git a/node_modules/csjs/test/not-pseudo.expected.json b/node_modules/csjs/test/not-pseudo.expected.json new file mode 100644 index 000000000..89d9fda36 --- /dev/null +++ b/node_modules/csjs/test/not-pseudo.expected.json @@ -0,0 +1,4 @@ +{ + "foo": "foo_25D7El", + "bar": "bar_25D7El" +} diff --git a/node_modules/csjs/test/not-pseudo.noscope.expected.css b/node_modules/csjs/test/not-pseudo.noscope.expected.css new file mode 100644 index 000000000..907bd49f9 --- /dev/null +++ b/node_modules/csjs/test/not-pseudo.noscope.expected.css @@ -0,0 +1,8 @@ + + + @media screen and (min-width: 769px) { + .foo:not(.bar) { + display: flex; + } + } + diff --git a/node_modules/csjs/test/not-pseudo.noscope.expected.json b/node_modules/csjs/test/not-pseudo.noscope.expected.json new file mode 100644 index 000000000..5c294f87c --- /dev/null +++ b/node_modules/csjs/test/not-pseudo.noscope.expected.json @@ -0,0 +1,4 @@ +{ + "foo": "foo", + "bar": "bar" +} diff --git a/node_modules/csjs/test/not-pseudo.noscope.source.js b/node_modules/csjs/test/not-pseudo.noscope.source.js new file mode 100644 index 000000000..d4a9819a3 --- /dev/null +++ b/node_modules/csjs/test/not-pseudo.noscope.source.js @@ -0,0 +1,11 @@ +const csjs = require('../').noScope; + +module.exports = csjs` + + @media screen and (min-width: 769px) { + .foo:not(.bar) { + display: flex; + } + } + +`; diff --git a/node_modules/csjs/test/not-pseudo.source.js b/node_modules/csjs/test/not-pseudo.source.js new file mode 100644 index 000000000..47488b328 --- /dev/null +++ b/node_modules/csjs/test/not-pseudo.source.js @@ -0,0 +1,11 @@ +const csjs = require('../'); + +module.exports = csjs` + + @media screen and (min-width: 769px) { + .foo:not(.bar) { + display: flex; + } + } + +`; diff --git a/node_modules/cytoscape/.babelrc b/node_modules/cytoscape/.babelrc new file mode 100644 index 000000000..002b4aa0d --- /dev/null +++ b/node_modules/cytoscape/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["env"] +} diff --git a/node_modules/cytoscape/.eslintrc.json b/node_modules/cytoscape/.eslintrc.json new file mode 100644 index 000000000..f4c5bb248 --- /dev/null +++ b/node_modules/cytoscape/.eslintrc.json @@ -0,0 +1,16 @@ +{ + "env": { + "commonjs": true, + "shared-node-browser": true, + "node": true, + "mocha": true + }, + "parserOptions": { + "ecmaVersion": 6 + }, + "extends": "eslint:recommended", + "rules": { + "no-redeclare": "off", + "semi": "error" + } +} diff --git a/node_modules/cytoscape/.travis.yml b/node_modules/cytoscape/.travis.yml new file mode 100644 index 000000000..983729473 --- /dev/null +++ b/node_modules/cytoscape/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +node_js: + - "4" + - "5" + - "6" + - "7" + - "8" +sudo: false +script: npm run test-travis diff --git a/node_modules/cytoscape/ISSUE_TEMPLATE.md b/node_modules/cytoscape/ISSUE_TEMPLATE.md new file mode 100644 index 000000000..1804bc9ad --- /dev/null +++ b/node_modules/cytoscape/ISSUE_TEMPLATE.md @@ -0,0 +1,74 @@ + + +**Issue type** + + + + +Bug report +Feature request + + + + + + +**Environment info** + +- Cytoscape.js version : +- Browser/Node.js & version : + +**Current (buggy) behaviour** + + + + +**Desired behaviour** + + + + +**Minimum steps to reproduce** + + + + + + + + + + +**Description of new feature** + + + + +**Motivation for new feature** + + + + + diff --git a/node_modules/cytoscape/LICENSE b/node_modules/cytoscape/LICENSE new file mode 100644 index 000000000..9e21a7e3e --- /dev/null +++ b/node_modules/cytoscape/LICENSE @@ -0,0 +1,21 @@ + + +Copyright (c) 2016-2018, The Cytoscape Consortium. + +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. \ No newline at end of file diff --git a/node_modules/cytoscape/README.md b/node_modules/cytoscape/README.md new file mode 100644 index 000000000..7ee3f7b73 --- /dev/null +++ b/node_modules/cytoscape/README.md @@ -0,0 +1,115 @@ +# Cytoscape.js + +[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?maxAge=1)](https://raw.githubusercontent.com/cytoscape/cytoscape.js/master/LICENSE) +[![DOI](https://zenodo.org/badge/2255947.svg)](https://zenodo.org/badge/latestdoi/2255947) +[![npm](https://img.shields.io/npm/v/cytoscape.svg?maxAge=1)](https://www.npmjs.com/package/cytoscape) +[![CDNJS version](https://img.shields.io/cdnjs/v/cytoscape.svg)](https://cdnjs.com/libraries/cytoscape) +
[![npm installs](https://img.shields.io/npm/dm/cytoscape.svg?maxAge=1&label=npm%20installs)](https://www.npmjs.com/package/cytoscape) +[![master branch tests](https://img.shields.io/travis/cytoscape/cytoscape.js/master.svg?maxAge=1&label=master%20branch)](https://travis-ci.org/cytoscape/cytoscape.js) +[![unstable branch tests](https://img.shields.io/travis/cytoscape/cytoscape.js/unstable.svg?maxAge=1&label=unstable%20branch)](https://travis-ci.org/cytoscape/cytoscape.js) + + +Graph theory (a.k.a. network) library for analysis and visualisation : [http://js.cytoscape.org](http://js.cytoscape.org) + + + +## Description + +Cytoscape.js is a fully featured [graph theory](https://en.wikipedia.org/wiki/Graph_theory) library. Do you need to model and/or visualise relational data, like biological data or social networks? If so, Cytoscape.js is just what you need. + +Cytoscape.js contains a graph theory model and an optional renderer to display interactive graphs. This library was designed to make it as easy as possible for programmers and scientists to use graph theory in their apps, whether it's for server-side analysis in a Node.js app or for a rich user interface. + +You can get started with Cytoscape.js with one line: + +```js +var cy = cytoscape({ elements: myElements, container: myDiv }); +``` + +Learn more about the features of Cytoscape.js by reading [its documentation](http://js.cytoscape.org). + + + + + +## Documentation + +You can find the documentation and downloads on the [project website](http://js.cytoscape.org). + + + +## Roadmap + +Future versions of Cytoscape.js are planned in the [milestones of the Github issue tracker](https://github.com/cytoscape/cytoscape.js/milestones). You can use the milestones to see what's currently planned for future releases. + + + + +## Contributing to Cytoscape.js + +Please refer to [CONTRIBUTING.md](CONTRIBUTING.md). + + + +## Citation + +To cite Cytoscape.js in a paper, please cite the Oxford Bioinformatics issue: + +*Cytoscape.js: a graph theory library for visualisation and analysis* + +Franz M, Lopes CT, Huck G, Dong Y, Sumer O, Bader GD + +[Bioinformatics (2016) 32 (2): 309-311 first published online September 28, 2015 doi:10.1093/bioinformatics/btv557 (PDF)](http://bioinformatics.oxfordjournals.org/content/32/2/309) + +[PubMed Abstract](http://www.ncbi.nlm.nih.gov/pubmed/26415722) + + + + +## Build dependencies + +Install `node`, `npm` and `gulp` (optional). Of course, `npm install` before using `gulp` or `npm run`. + + + + +## Build instructions + +Run `npm run ` or `gulp ` in the console. The main targets are: + +**Building:** + + * `build` (default) : build the library + * `clean` : clean the `build` directory + * `watch` : automatically build lib and tests for debugging (no babel, very quick) + * `watch-babel` : automatically build lib and tests for debugging (with babel; good for testing out of date browsers) + * `zip` : build the release ZIP + * `dist` : update the distribution JS for npm, bower, etc. + +**Testing:** + +If the `TRAVIS` or `TEST_BUILD` environment variables are defined, then `mocha` or `gulp test` will test `build/cytoscape.cjs.js`. Otherwise, the unbundled, unbabelified, raw source is tested. This keeps local tests very quick to run on modern versions of Node while ensuring we can test old versions of Node as well. The library can be built on `node>=4`, but it can be tested on `node>=0.10`. + + * `test` : run the Mocha unit tests + * `lint` : lint the JS sources via eslint + * `benchmark` : run benchmark regression tests + * `benchmark-single` : run benchmarks only for the suite specified in `benchmark/single` + * `sniper` : runs a BioJS sniper server that hosts demos + + + +## Release instructions + + 1. Do each backport patch release before the corresponding current release. This ensures that npm lists the current version as the latest one. + 1. Make sure the docs are updated with the list of releases in `documentation/md/intro.md` + 1. Update the `VERSION` environment variable, e.g. `export VERSION=1.2.3` + 1. Confirm JS files pass linting: `gulp lint` + 1. Confirm all tests passing: `gulp test` + 1. Test the docs and demos with the latest code: `gulp docs-pub` + 1. Build and publish the release: `gulp publish` + 1. [Create a release](https://github.com/cytoscape/cytoscape.js/releases/new) for Zenodo from the latest tag + + + +## Tests + +Mocha tests are found in the [test directory](https://github.com/cytoscape/cytoscape.js/tree/master/test). The tests can be run in the browser or they can be run via Node.js (`gulp test` or `mocha`). diff --git a/node_modules/cytoscape/dist/cytoscape.cjs.js b/node_modules/cytoscape/dist/cytoscape.cjs.js new file mode 100644 index 000000000..d15d3dbb2 --- /dev/null +++ b/node_modules/cytoscape/dist/cytoscape.cjs.js @@ -0,0 +1,29144 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("lodash.debounce"), require("heap")); + else if(typeof define === 'function' && define.amd) + define(["lodash.debounce", "heap"], factory); + else if(typeof exports === 'object') + exports["cytoscape"] = factory(require("lodash.debounce"), require("heap")); + else + root["cytoscape"] = factory(root["lodash.debounce"], root["heap"]); +})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_26__, __WEBPACK_EXTERNAL_MODULE_32__) { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 20); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +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; }; + +/*global HTMLElement DocumentTouch */ + +var window = __webpack_require__(3); +var navigator = window ? window.navigator : null; +var document = window ? window.document : null; + +var typeofstr = _typeof(''); +var typeofobj = _typeof({}); +var typeoffn = _typeof(function () {}); +var typeofhtmlele = typeof HTMLElement === 'undefined' ? 'undefined' : _typeof(HTMLElement); + +var instanceStr = function instanceStr(obj) { + return obj && obj.instanceString && is.fn(obj.instanceString) ? obj.instanceString() : null; +}; + +var is = { + defined: function defined(obj) { + return obj != null; // not undefined or null + }, + + string: function string(obj) { + return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) == typeofstr; + }, + + fn: function fn(obj) { + return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === typeoffn; + }, + + array: function array(obj) { + return Array.isArray ? Array.isArray(obj) : obj != null && obj instanceof Array; + }, + + plainObject: function plainObject(obj) { + return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === typeofobj && !is.array(obj) && obj.constructor === Object; + }, + + object: function object(obj) { + return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === typeofobj; + }, + + number: function number(obj) { + return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === _typeof(1) && !isNaN(obj); + }, + + integer: function integer(obj) { + return is.number(obj) && Math.floor(obj) === obj; + }, + + bool: function bool(obj) { + return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === _typeof(true); + }, + + htmlElement: function htmlElement(obj) { + if ('undefined' === typeofhtmlele) { + return undefined; + } else { + return null != obj && obj instanceof HTMLElement; + } + }, + + elementOrCollection: function elementOrCollection(obj) { + return is.element(obj) || is.collection(obj); + }, + + element: function element(obj) { + return instanceStr(obj) === 'collection' && obj._private.single; + }, + + collection: function collection(obj) { + return instanceStr(obj) === 'collection' && !obj._private.single; + }, + + core: function core(obj) { + return instanceStr(obj) === 'core'; + }, + + style: function style(obj) { + return instanceStr(obj) === 'style'; + }, + + stylesheet: function stylesheet(obj) { + return instanceStr(obj) === 'stylesheet'; + }, + + event: function event(obj) { + return instanceStr(obj) === 'event'; + }, + + thread: function thread(obj) { + return instanceStr(obj) === 'thread'; + }, + + fabric: function fabric(obj) { + return instanceStr(obj) === 'fabric'; + }, + + emptyString: function emptyString(obj) { + if (obj === undefined || obj === null) { + // null is empty + return true; + } else if (obj === '' || obj.match(/^\s+$/)) { + return true; // empty string is empty + } + + return false; // otherwise, we don't know what we've got + }, + + nonemptyString: function nonemptyString(obj) { + if (obj && is.string(obj) && obj !== '' && !obj.match(/^\s+$/)) { + return true; + } + + return false; + }, + + domElement: function domElement(obj) { + if (typeof HTMLElement === 'undefined') { + return false; // we're not in a browser so it doesn't matter + } else { + return obj instanceof HTMLElement; + } + }, + + boundingBox: function boundingBox(obj) { + return is.plainObject(obj) && is.number(obj.x1) && is.number(obj.x2) && is.number(obj.y1) && is.number(obj.y2); + }, + + promise: function promise(obj) { + return is.object(obj) && is.fn(obj.then); + }, + + touch: function touch() { + return window && ('ontouchstart' in window || window.DocumentTouch && document instanceof DocumentTouch); + }, + + gecko: function gecko() { + return window && (typeof InstallTrigger !== 'undefined' || 'MozAppearance' in document.documentElement.style); + }, + + webkit: function webkit() { + return window && (typeof webkitURL !== 'undefined' || 'WebkitAppearance' in document.documentElement.style); + }, + + chromium: function chromium() { + return window && typeof chrome !== 'undefined'; + }, + + khtml: function khtml() { + return navigator && navigator.vendor.match(/kde/i); // probably a better way to detect this... + }, + + khtmlEtc: function khtmlEtc() { + return is.khtml() || is.webkit() || is.chromium(); + }, + + ms: function ms() { + return navigator && navigator.userAgent.match(/msie|trident|edge/i); // probably a better way to detect this... + }, + + windows: function windows() { + return navigator && navigator.appVersion.match(/Win/i); + }, + + mac: function mac() { + return navigator && navigator.appVersion.match(/Mac/i); + }, + + linux: function linux() { + return navigator && navigator.appVersion.match(/Linux/i); + }, + + unix: function unix() { + return navigator && navigator.appVersion.match(/X11/i); + } +}; + +module.exports = is; + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/*global console */ + +var is = __webpack_require__(0); +var math = __webpack_require__(2); + +var util = { + + MAX_INT: Number.MAX_SAFE_INTEGER || 9007199254740991, + + trueify: function trueify() { + return true; + }, + + falsify: function falsify() { + return false; + }, + + zeroify: function zeroify() { + return 0; + }, + + noop: function noop() {}, + + error: function error(msg) { + /* eslint-disable */ + if (console.error) { + console.error.apply(console, arguments); + + if (console.trace) { + console.trace(); + } + } else { + console.log.apply(console, arguments); + + if (console.trace) { + console.trace(); + } + } + /* eslint-enable */ + }, + + clone: function clone(obj) { + return this.extend({}, obj); + }, + + // gets a shallow copy of the argument + copy: function copy(obj) { + if (obj == null) { + return obj; + }if (is.array(obj)) { + return obj.slice(); + } else if (is.plainObject(obj)) { + return this.clone(obj); + } else { + return obj; + } + }, + + copyArray: function copyArray(arr) { + return arr.slice(); + }, + + clonePosition: function clonePosition(pos) { + return { x: pos.x, y: pos.y }; + }, + + uuid: function uuid(a, b // placeholders + ) { + for ( // loop :) + b = a = ''; // b - result , a - numeric letiable + a++ < 36; // + b += a * 51 & 52 // if "a" is not 9 or 14 or 19 or 24 + ? // return a random number or 4 + (a ^ 15 // if "a" is not 15 + ? // genetate a random number from 0 to 15 + 8 ^ Math.random() * (a ^ 20 ? 16 : 4) // unless "a" is 20, in which case a random number from 8 to 11 + : 4 // otherwise 4 + ).toString(16) : '-' // in other cases (if "a" is 9,14,19,24) insert "-" + ) {} + return b; + } + +}; + +util.makeBoundingBox = math.makeBoundingBox.bind(math); + +util._staticEmptyObject = {}; + +util.staticEmptyObject = function () { + return util._staticEmptyObject; +}; + +util.extend = Object.assign != null ? Object.assign.bind(Object) : function (tgt) { + var args = arguments; + + for (var i = 1; i < args.length; i++) { + var obj = args[i]; + + if (obj == null) { + continue; + } + + var keys = Object.keys(obj); + + for (var j = 0; j < keys.length; j++) { + var k = keys[j]; + + tgt[k] = obj[k]; + } + } + + return tgt; +}; + +util.assign = util.extend; + +util.default = function (val, def) { + if (val === undefined) { + return def; + } else { + return val; + } +}; + +util.removeFromArray = function (arr, ele, manyCopies) { + for (var i = arr.length; i >= 0; i--) { + if (arr[i] === ele) { + arr.splice(i, 1); + + if (!manyCopies) { + break; + } + } + } +}; + +util.clearArray = function (arr) { + arr.splice(0, arr.length); +}; + +util.push = function (arr, otherArr) { + for (var i = 0; i < otherArr.length; i++) { + var el = otherArr[i]; + + arr.push(el); + } +}; + +util.getPrefixedProperty = function (obj, propName, prefix) { + if (prefix) { + propName = this.prependCamel(prefix, propName); // e.g. (labelWidth, source) => sourceLabelWidth + } + + return obj[propName]; +}; + +util.setPrefixedProperty = function (obj, propName, prefix, value) { + if (prefix) { + propName = this.prependCamel(prefix, propName); // e.g. (labelWidth, source) => sourceLabelWidth + } + + obj[propName] = value; +}; + +[__webpack_require__(21), __webpack_require__(22), { memoize: __webpack_require__(13) }, __webpack_require__(23), __webpack_require__(24), __webpack_require__(25), __webpack_require__(27)].forEach(function (req) { + util.extend(util, req); +}); + +module.exports = util; + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var math = {}; + +math.arePositionsSame = function (p1, p2) { + return p1.x === p2.x && p1.y === p2.y; +}; + +math.copyPosition = function (p) { + return { x: p.x, y: p.y }; +}; + +math.modelToRenderedPosition = function (p, zoom, pan) { + return { + x: p.x * zoom + pan.x, + y: p.y * zoom + pan.y + }; +}; + +math.renderedToModelPosition = function (p, zoom, pan) { + return { + x: (p.x - pan.x) / zoom, + y: (p.y - pan.y) / zoom + }; +}; + +math.array2point = function (arr) { + return { + x: arr[0], + y: arr[1] + }; +}; + +math.deg2rad = function (deg) { + return Math.PI * deg / 180; +}; + +math.getAngleFromDisp = function (dispX, dispY) { + return Math.atan2(dispY, dispX) - Math.PI / 2; +}; + +math.log2 = Math.log2 || function (n) { + return Math.log(n) / Math.log(2); +}; + +math.signum = function (x) { + if (x > 0) { + return 1; + } else if (x < 0) { + return -1; + } else { + return 0; + } +}; + +math.dist = function (p1, p2) { + return Math.sqrt(math.sqdist(p1, p2)); +}; + +math.sqdist = function (p1, p2) { + var dx = p2.x - p1.x; + var dy = p2.y - p1.y; + + return dx * dx + dy * dy; +}; + +// from http://en.wikipedia.org/wiki/Bézier_curve#Quadratic_curves +math.qbezierAt = function (p0, p1, p2, t) { + return (1 - t) * (1 - t) * p0 + 2 * (1 - t) * t * p1 + t * t * p2; +}; + +math.qbezierPtAt = function (p0, p1, p2, t) { + return { + x: math.qbezierAt(p0.x, p1.x, p2.x, t), + y: math.qbezierAt(p0.y, p1.y, p2.y, t) + }; +}; + +math.lineAt = function (p0, p1, t, d) { + var vec = { + x: p1.x - p0.x, + y: p1.y - p0.y + }; + + var vecDist = math.dist(p0, p1); + + var normVec = { + x: vec.x / vecDist, + y: vec.y / vecDist + }; + + t = t == null ? 0 : t; + + d = d != null ? d : t * vecDist; + + return { + x: p0.x + normVec.x * d, + y: p0.y + normVec.y * d + }; +}; + +math.lineAtDist = function (p0, p1, d) { + return math.lineAt(p0, p1, undefined, d); +}; + +// get angle at A via cosine law +math.triangleAngle = function (A, B, C) { + var a = math.dist(B, C); + var b = math.dist(A, C); + var c = math.dist(A, B); + + return Math.acos((a * a + b * b - c * c) / (2 * a * b)); +}; + +math.bound = function (min, val, max) { + return Math.max(min, Math.min(max, val)); +}; + +// makes a full bb (x1, y1, x2, y2, w, h) from implicit params +math.makeBoundingBox = function (bb) { + if (bb == null) { + return { + x1: Infinity, + y1: Infinity, + x2: -Infinity, + y2: -Infinity, + w: 0, + h: 0 + }; + } else if (bb.x1 != null && bb.y1 != null) { + if (bb.x2 != null && bb.y2 != null && bb.x2 >= bb.x1 && bb.y2 >= bb.y1) { + return { + x1: bb.x1, + y1: bb.y1, + x2: bb.x2, + y2: bb.y2, + w: bb.x2 - bb.x1, + h: bb.y2 - bb.y1 + }; + } else if (bb.w != null && bb.h != null && bb.w >= 0 && bb.h >= 0) { + return { + x1: bb.x1, + y1: bb.y1, + x2: bb.x1 + bb.w, + y2: bb.y1 + bb.h, + w: bb.w, + h: bb.h + }; + } + } +}; + +math.updateBoundingBox = function (bb1, bb2) { + // update bb1 with bb2 bounds + + bb1.x1 = Math.min(bb1.x1, bb2.x1); + bb1.x2 = Math.max(bb1.x2, bb2.x2); + bb1.w = bb1.x2 - bb1.x1; + + bb1.y1 = Math.min(bb1.y1, bb2.y1); + bb1.y2 = Math.max(bb1.y2, bb2.y2); + bb1.h = bb1.y2 - bb1.y1; +}; + +math.expandBoundingBoxByPoint = function (bb, x, y) { + bb.x1 = Math.min(bb.x1, x); + bb.x2 = Math.max(bb.x2, x); + bb.w = bb.x2 - bb.x1; + + bb.y1 = Math.min(bb.y1, y); + bb.y2 = Math.max(bb.y2, y); + bb.h = bb.y2 - bb.y1; +}; + +math.expandBoundingBox = function (bb, padding) { + bb.x1 -= padding; + bb.x2 += padding; + bb.y1 -= padding; + bb.y2 += padding; + bb.w = bb.x2 - bb.x1; + bb.h = bb.y2 - bb.y1; + + return bb; +}; + +math.boundingBoxesIntersect = function (bb1, bb2) { + // case: one bb to right of other + if (bb1.x1 > bb2.x2) { + return false; + } + if (bb2.x1 > bb1.x2) { + return false; + } + + // case: one bb to left of other + if (bb1.x2 < bb2.x1) { + return false; + } + if (bb2.x2 < bb1.x1) { + return false; + } + + // case: one bb above other + if (bb1.y2 < bb2.y1) { + return false; + } + if (bb2.y2 < bb1.y1) { + return false; + } + + // case: one bb below other + if (bb1.y1 > bb2.y2) { + return false; + } + if (bb2.y1 > bb1.y2) { + return false; + } + + // otherwise, must have some overlap + return true; +}; + +math.inBoundingBox = function (bb, x, y) { + return bb.x1 <= x && x <= bb.x2 && bb.y1 <= y && y <= bb.y2; +}; + +math.pointInBoundingBox = function (bb, pt) { + return this.inBoundingBox(bb, pt.x, pt.y); +}; + +math.boundingBoxInBoundingBox = function (bb1, bb2) { + return math.inBoundingBox(bb1, bb2.x1, bb2.y1) && math.inBoundingBox(bb1, bb2.x2, bb2.y2); +}; + +math.roundRectangleIntersectLine = function (x, y, nodeX, nodeY, width, height, padding) { + + var cornerRadius = this.getRoundRectangleRadius(width, height); + + var halfWidth = width / 2; + var halfHeight = height / 2; + + // Check intersections with straight line segments + var straightLineIntersections = void 0; + + // Top segment, left to right + { + var topStartX = nodeX - halfWidth + cornerRadius - padding; + var topStartY = nodeY - halfHeight - padding; + var topEndX = nodeX + halfWidth - cornerRadius + padding; + var topEndY = topStartY; + + straightLineIntersections = this.finiteLinesIntersect(x, y, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false); + + if (straightLineIntersections.length > 0) { + return straightLineIntersections; + } + } + + // Right segment, top to bottom + { + var rightStartX = nodeX + halfWidth + padding; + var rightStartY = nodeY - halfHeight + cornerRadius - padding; + var rightEndX = rightStartX; + var rightEndY = nodeY + halfHeight - cornerRadius + padding; + + straightLineIntersections = this.finiteLinesIntersect(x, y, nodeX, nodeY, rightStartX, rightStartY, rightEndX, rightEndY, false); + + if (straightLineIntersections.length > 0) { + return straightLineIntersections; + } + } + + // Bottom segment, left to right + { + var bottomStartX = nodeX - halfWidth + cornerRadius - padding; + var bottomStartY = nodeY + halfHeight + padding; + var bottomEndX = nodeX + halfWidth - cornerRadius + padding; + var bottomEndY = bottomStartY; + + straightLineIntersections = this.finiteLinesIntersect(x, y, nodeX, nodeY, bottomStartX, bottomStartY, bottomEndX, bottomEndY, false); + + if (straightLineIntersections.length > 0) { + return straightLineIntersections; + } + } + + // Left segment, top to bottom + { + var leftStartX = nodeX - halfWidth - padding; + var leftStartY = nodeY - halfHeight + cornerRadius - padding; + var leftEndX = leftStartX; + var leftEndY = nodeY + halfHeight - cornerRadius + padding; + + straightLineIntersections = this.finiteLinesIntersect(x, y, nodeX, nodeY, leftStartX, leftStartY, leftEndX, leftEndY, false); + + if (straightLineIntersections.length > 0) { + return straightLineIntersections; + } + } + + // Check intersections with arc segments + var arcIntersections = void 0; + + // Top Left + { + var topLeftCenterX = nodeX - halfWidth + cornerRadius; + var topLeftCenterY = nodeY - halfHeight + cornerRadius; + arcIntersections = this.intersectLineCircle(x, y, nodeX, nodeY, topLeftCenterX, topLeftCenterY, cornerRadius + padding); + + // Ensure the intersection is on the desired quarter of the circle + if (arcIntersections.length > 0 && arcIntersections[0] <= topLeftCenterX && arcIntersections[1] <= topLeftCenterY) { + return [arcIntersections[0], arcIntersections[1]]; + } + } + + // Top Right + { + var topRightCenterX = nodeX + halfWidth - cornerRadius; + var topRightCenterY = nodeY - halfHeight + cornerRadius; + arcIntersections = this.intersectLineCircle(x, y, nodeX, nodeY, topRightCenterX, topRightCenterY, cornerRadius + padding); + + // Ensure the intersection is on the desired quarter of the circle + if (arcIntersections.length > 0 && arcIntersections[0] >= topRightCenterX && arcIntersections[1] <= topRightCenterY) { + return [arcIntersections[0], arcIntersections[1]]; + } + } + + // Bottom Right + { + var bottomRightCenterX = nodeX + halfWidth - cornerRadius; + var bottomRightCenterY = nodeY + halfHeight - cornerRadius; + arcIntersections = this.intersectLineCircle(x, y, nodeX, nodeY, bottomRightCenterX, bottomRightCenterY, cornerRadius + padding); + + // Ensure the intersection is on the desired quarter of the circle + if (arcIntersections.length > 0 && arcIntersections[0] >= bottomRightCenterX && arcIntersections[1] >= bottomRightCenterY) { + return [arcIntersections[0], arcIntersections[1]]; + } + } + + // Bottom Left + { + var bottomLeftCenterX = nodeX - halfWidth + cornerRadius; + var bottomLeftCenterY = nodeY + halfHeight - cornerRadius; + arcIntersections = this.intersectLineCircle(x, y, nodeX, nodeY, bottomLeftCenterX, bottomLeftCenterY, cornerRadius + padding); + + // Ensure the intersection is on the desired quarter of the circle + if (arcIntersections.length > 0 && arcIntersections[0] <= bottomLeftCenterX && arcIntersections[1] >= bottomLeftCenterY) { + return [arcIntersections[0], arcIntersections[1]]; + } + } + + return []; // if nothing +}; + +math.inLineVicinity = function (x, y, lx1, ly1, lx2, ly2, tolerance) { + var t = tolerance; + + var x1 = Math.min(lx1, lx2); + var x2 = Math.max(lx1, lx2); + var y1 = Math.min(ly1, ly2); + var y2 = Math.max(ly1, ly2); + + return x1 - t <= x && x <= x2 + t && y1 - t <= y && y <= y2 + t; +}; + +math.inBezierVicinity = function (x, y, x1, y1, x2, y2, x3, y3, tolerance) { + + var bb = { + x1: Math.min(x1, x3, x2) - tolerance, + x2: Math.max(x1, x3, x2) + tolerance, + y1: Math.min(y1, y3, y2) - tolerance, + y2: Math.max(y1, y3, y2) + tolerance + }; + + // if outside the rough bounding box for the bezier, then it can't be a hit + if (x < bb.x1 || x > bb.x2 || y < bb.y1 || y > bb.y2) { + // console.log('bezier out of rough bb') + return false; + } else { + // console.log('do more expensive check'); + return true; + } +}; +math.solveQuadratic = function (a, b, c, val) { + c -= val; + + var r = b * b - 4 * a * c; + + if (r < 0) { + return []; + } + + var sqrtR = Math.sqrt(r); + var denom = 2 * a; + var root1 = (-b + sqrtR) / denom; + var root2 = (-b - sqrtR) / denom; + + return [root1, root2]; +}; + +math.solveCubic = function (a, b, c, d, result) { + + // Solves a cubic function, returns root in form [r1, i1, r2, i2, r3, i3], where + // r is the real component, i is the imaginary component + + // An implementation of the Cardano method from the year 1545 + // http://en.wikipedia.org/wiki/Cubic_function#The_nature_of_the_roots + + b /= a; + c /= a; + d /= a; + + var discriminant = void 0, + q = void 0, + r = void 0, + dum1 = void 0, + s = void 0, + t = void 0, + term1 = void 0, + r13 = void 0; + + q = (3.0 * c - b * b) / 9.0; + r = -(27.0 * d) + b * (9.0 * c - 2.0 * (b * b)); + r /= 54.0; + + discriminant = q * q * q + r * r; + result[1] = 0; + term1 = b / 3.0; + + if (discriminant > 0) { + s = r + Math.sqrt(discriminant); + s = s < 0 ? -Math.pow(-s, 1.0 / 3.0) : Math.pow(s, 1.0 / 3.0); + t = r - Math.sqrt(discriminant); + t = t < 0 ? -Math.pow(-t, 1.0 / 3.0) : Math.pow(t, 1.0 / 3.0); + result[0] = -term1 + s + t; + term1 += (s + t) / 2.0; + result[4] = result[2] = -term1; + term1 = Math.sqrt(3.0) * (-t + s) / 2; + result[3] = term1; + result[5] = -term1; + return; + } + + result[5] = result[3] = 0; + + if (discriminant === 0) { + r13 = r < 0 ? -Math.pow(-r, 1.0 / 3.0) : Math.pow(r, 1.0 / 3.0); + result[0] = -term1 + 2.0 * r13; + result[4] = result[2] = -(r13 + term1); + return; + } + + q = -q; + dum1 = q * q * q; + dum1 = Math.acos(r / Math.sqrt(dum1)); + r13 = 2.0 * Math.sqrt(q); + result[0] = -term1 + r13 * Math.cos(dum1 / 3.0); + result[2] = -term1 + r13 * Math.cos((dum1 + 2.0 * Math.PI) / 3.0); + result[4] = -term1 + r13 * Math.cos((dum1 + 4.0 * Math.PI) / 3.0); + + return; +}; + +math.sqdistToQuadraticBezier = function (x, y, x1, y1, x2, y2, x3, y3) { + + // Find minimum distance by using the minimum of the distance + // function between the given point and the curve + + // This gives the coefficients of the resulting cubic equation + // whose roots tell us where a possible minimum is + // (Coefficients are divided by 4) + + var a = 1.0 * x1 * x1 - 4 * x1 * x2 + 2 * x1 * x3 + 4 * x2 * x2 - 4 * x2 * x3 + x3 * x3 + y1 * y1 - 4 * y1 * y2 + 2 * y1 * y3 + 4 * y2 * y2 - 4 * y2 * y3 + y3 * y3; + + var b = 1.0 * 9 * x1 * x2 - 3 * x1 * x1 - 3 * x1 * x3 - 6 * x2 * x2 + 3 * x2 * x3 + 9 * y1 * y2 - 3 * y1 * y1 - 3 * y1 * y3 - 6 * y2 * y2 + 3 * y2 * y3; + + var c = 1.0 * 3 * x1 * x1 - 6 * x1 * x2 + x1 * x3 - x1 * x + 2 * x2 * x2 + 2 * x2 * x - x3 * x + 3 * y1 * y1 - 6 * y1 * y2 + y1 * y3 - y1 * y + 2 * y2 * y2 + 2 * y2 * y - y3 * y; + + var d = 1.0 * x1 * x2 - x1 * x1 + x1 * x - x2 * x + y1 * y2 - y1 * y1 + y1 * y - y2 * y; + + // debug("coefficients: " + a / a + ", " + b / a + ", " + c / a + ", " + d / a); + + var roots = []; + + // Use the cubic solving algorithm + this.solveCubic(a, b, c, d, roots); + + var zeroThreshold = 0.0000001; + + var params = []; + + for (var index = 0; index < 6; index += 2) { + if (Math.abs(roots[index + 1]) < zeroThreshold && roots[index] >= 0 && roots[index] <= 1.0) { + params.push(roots[index]); + } + } + + params.push(1.0); + params.push(0.0); + + var minDistanceSquared = -1; + + var curX = void 0, + curY = void 0, + distSquared = void 0; + for (var i = 0; i < params.length; i++) { + curX = Math.pow(1.0 - params[i], 2.0) * x1 + 2.0 * (1 - params[i]) * params[i] * x2 + params[i] * params[i] * x3; + + curY = Math.pow(1 - params[i], 2.0) * y1 + 2 * (1.0 - params[i]) * params[i] * y2 + params[i] * params[i] * y3; + + distSquared = Math.pow(curX - x, 2) + Math.pow(curY - y, 2); + // debug('distance for param ' + params[i] + ": " + Math.sqrt(distSquared)); + if (minDistanceSquared >= 0) { + if (distSquared < minDistanceSquared) { + minDistanceSquared = distSquared; + } + } else { + minDistanceSquared = distSquared; + } + } + + return minDistanceSquared; +}; + +math.sqdistToFiniteLine = function (x, y, x1, y1, x2, y2) { + var offset = [x - x1, y - y1]; + var line = [x2 - x1, y2 - y1]; + + var lineSq = line[0] * line[0] + line[1] * line[1]; + var hypSq = offset[0] * offset[0] + offset[1] * offset[1]; + + var dotProduct = offset[0] * line[0] + offset[1] * line[1]; + var adjSq = dotProduct * dotProduct / lineSq; + + if (dotProduct < 0) { + return hypSq; + } + + if (adjSq > lineSq) { + return (x - x2) * (x - x2) + (y - y2) * (y - y2); + } + + return hypSq - adjSq; +}; + +math.pointInsidePolygonPoints = function (x, y, points) { + var x1 = void 0, + y1 = void 0, + x2 = void 0, + y2 = void 0; + var y3 = void 0; + + // Intersect with vertical line through (x, y) + var up = 0; + // let down = 0; + for (var i = 0; i < points.length / 2; i++) { + x1 = points[i * 2]; + y1 = points[i * 2 + 1]; + + if (i + 1 < points.length / 2) { + x2 = points[(i + 1) * 2]; + y2 = points[(i + 1) * 2 + 1]; + } else { + x2 = points[(i + 1 - points.length / 2) * 2]; + y2 = points[(i + 1 - points.length / 2) * 2 + 1]; + } + + if (x1 == x && x2 == x) { + // then ignore + } else if (x1 >= x && x >= x2 || x1 <= x && x <= x2) { + + y3 = (x - x1) / (x2 - x1) * (y2 - y1) + y1; + + if (y3 > y) { + up++; + } + + // if( y3 < y ){ + // down++; + // } + } else { + continue; + } + } + + if (up % 2 === 0) { + return false; + } else { + return true; + } +}; + +math.pointInsidePolygon = function (x, y, basePoints, centerX, centerY, width, height, direction, padding) { + + //let direction = arguments[6]; + var transformedPoints = new Array(basePoints.length); + + // Gives negative angle + var angle = void 0; + + if (direction[0] != null) { + angle = Math.atan(direction[1] / direction[0]); + + if (direction[0] < 0) { + angle = angle + Math.PI / 2; + } else { + angle = -angle - Math.PI / 2; + } + } else { + angle = direction; + } + + var cos = Math.cos(-angle); + var sin = Math.sin(-angle); + + // console.log("base: " + basePoints); + for (var i = 0; i < transformedPoints.length / 2; i++) { + transformedPoints[i * 2] = width / 2 * (basePoints[i * 2] * cos - basePoints[i * 2 + 1] * sin); + + transformedPoints[i * 2 + 1] = height / 2 * (basePoints[i * 2 + 1] * cos + basePoints[i * 2] * sin); + + transformedPoints[i * 2] += centerX; + transformedPoints[i * 2 + 1] += centerY; + } + + var points = void 0; + + if (padding > 0) { + var expandedLineSet = this.expandPolygon(transformedPoints, -padding); + + points = this.joinLines(expandedLineSet); + } else { + points = transformedPoints; + } + + return math.pointInsidePolygonPoints(x, y, points); +}; + +math.joinLines = function (lineSet) { + + var vertices = new Array(lineSet.length / 2); + + var currentLineStartX = void 0, + currentLineStartY = void 0, + currentLineEndX = void 0, + currentLineEndY = void 0; + var nextLineStartX = void 0, + nextLineStartY = void 0, + nextLineEndX = void 0, + nextLineEndY = void 0; + + for (var i = 0; i < lineSet.length / 4; i++) { + currentLineStartX = lineSet[i * 4]; + currentLineStartY = lineSet[i * 4 + 1]; + currentLineEndX = lineSet[i * 4 + 2]; + currentLineEndY = lineSet[i * 4 + 3]; + + if (i < lineSet.length / 4 - 1) { + nextLineStartX = lineSet[(i + 1) * 4]; + nextLineStartY = lineSet[(i + 1) * 4 + 1]; + nextLineEndX = lineSet[(i + 1) * 4 + 2]; + nextLineEndY = lineSet[(i + 1) * 4 + 3]; + } else { + nextLineStartX = lineSet[0]; + nextLineStartY = lineSet[1]; + nextLineEndX = lineSet[2]; + nextLineEndY = lineSet[3]; + } + + var intersection = this.finiteLinesIntersect(currentLineStartX, currentLineStartY, currentLineEndX, currentLineEndY, nextLineStartX, nextLineStartY, nextLineEndX, nextLineEndY, true); + + vertices[i * 2] = intersection[0]; + vertices[i * 2 + 1] = intersection[1]; + } + + return vertices; +}; + +math.expandPolygon = function (points, pad) { + + var expandedLineSet = new Array(points.length * 2); + + var currentPointX = void 0, + currentPointY = void 0, + nextPointX = void 0, + nextPointY = void 0; + + for (var i = 0; i < points.length / 2; i++) { + currentPointX = points[i * 2]; + currentPointY = points[i * 2 + 1]; + + if (i < points.length / 2 - 1) { + nextPointX = points[(i + 1) * 2]; + nextPointY = points[(i + 1) * 2 + 1]; + } else { + nextPointX = points[0]; + nextPointY = points[1]; + } + + // Current line: [currentPointX, currentPointY] to [nextPointX, nextPointY] + + // Assume CCW polygon winding + + var offsetX = nextPointY - currentPointY; + var offsetY = -(nextPointX - currentPointX); + + // Normalize + var offsetLength = Math.sqrt(offsetX * offsetX + offsetY * offsetY); + var normalizedOffsetX = offsetX / offsetLength; + var normalizedOffsetY = offsetY / offsetLength; + + expandedLineSet[i * 4] = currentPointX + normalizedOffsetX * pad; + expandedLineSet[i * 4 + 1] = currentPointY + normalizedOffsetY * pad; + expandedLineSet[i * 4 + 2] = nextPointX + normalizedOffsetX * pad; + expandedLineSet[i * 4 + 3] = nextPointY + normalizedOffsetY * pad; + } + + return expandedLineSet; +}; + +math.intersectLineEllipse = function (x, y, centerX, centerY, ellipseWradius, ellipseHradius) { + + var dispX = centerX - x; + var dispY = centerY - y; + + dispX /= ellipseWradius; + dispY /= ellipseHradius; + + var len = Math.sqrt(dispX * dispX + dispY * dispY); + + var newLength = len - 1; + + if (newLength < 0) { + return []; + } + + var lenProportion = newLength / len; + + return [(centerX - x) * lenProportion + x, (centerY - y) * lenProportion + y]; +}; + +math.checkInEllipse = function (x, y, width, height, centerX, centerY, padding) { + x -= centerX; + y -= centerY; + + x /= width / 2 + padding; + y /= height / 2 + padding; + + return x * x + y * y <= 1; +}; + +// Returns intersections of increasing distance from line's start point +math.intersectLineCircle = function (x1, y1, x2, y2, centerX, centerY, radius) { + + // Calculate d, direction vector of line + var d = [x2 - x1, y2 - y1]; // Direction vector of line + var f = [x1 - centerX, y1 - centerY]; + + var a = d[0] * d[0] + d[1] * d[1]; + var b = 2 * (f[0] * d[0] + f[1] * d[1]); + var c = f[0] * f[0] + f[1] * f[1] - radius * radius; + + var discriminant = b * b - 4 * a * c; + + if (discriminant < 0) { + return []; + } + + var t1 = (-b + Math.sqrt(discriminant)) / (2 * a); + var t2 = (-b - Math.sqrt(discriminant)) / (2 * a); + + var tMin = Math.min(t1, t2); + var tMax = Math.max(t1, t2); + var inRangeParams = []; + + if (tMin >= 0 && tMin <= 1) { + inRangeParams.push(tMin); + } + + if (tMax >= 0 && tMax <= 1) { + inRangeParams.push(tMax); + } + + if (inRangeParams.length === 0) { + return []; + } + + var nearIntersectionX = inRangeParams[0] * d[0] + x1; + var nearIntersectionY = inRangeParams[0] * d[1] + y1; + + if (inRangeParams.length > 1) { + + if (inRangeParams[0] == inRangeParams[1]) { + return [nearIntersectionX, nearIntersectionY]; + } else { + + var farIntersectionX = inRangeParams[1] * d[0] + x1; + var farIntersectionY = inRangeParams[1] * d[1] + y1; + + return [nearIntersectionX, nearIntersectionY, farIntersectionX, farIntersectionY]; + } + } else { + return [nearIntersectionX, nearIntersectionY]; + } +}; + +math.findCircleNearPoint = function (centerX, centerY, radius, farX, farY) { + + var displacementX = farX - centerX; + var displacementY = farY - centerY; + var distance = Math.sqrt(displacementX * displacementX + displacementY * displacementY); + + var unitDisplacementX = displacementX / distance; + var unitDisplacementY = displacementY / distance; + + return [centerX + unitDisplacementX * radius, centerY + unitDisplacementY * radius]; +}; + +math.findMaxSqDistanceToOrigin = function (points) { + var maxSqDistance = 0.000001; + var sqDistance = void 0; + + for (var i = 0; i < points.length / 2; i++) { + + sqDistance = points[i * 2] * points[i * 2] + points[i * 2 + 1] * points[i * 2 + 1]; + + if (sqDistance > maxSqDistance) { + maxSqDistance = sqDistance; + } + } + + return maxSqDistance; +}; + +math.midOfThree = function (a, b, c) { + if (b <= a && a <= c || c <= a && a <= b) { + return a; + } else if (a <= b && b <= c || c <= b && b <= a) { + return b; + } else { + return c; + } +}; + +// (x1,y1)=>(x2,y2) intersect with (x3,y3)=>(x4,y4) +math.finiteLinesIntersect = function (x1, y1, x2, y2, x3, y3, x4, y4, infiniteLines) { + + var dx13 = x1 - x3; + var dx21 = x2 - x1; + var dx43 = x4 - x3; + + var dy13 = y1 - y3; + var dy21 = y2 - y1; + var dy43 = y4 - y3; + + var ua_t = dx43 * dy13 - dy43 * dx13; + var ub_t = dx21 * dy13 - dy21 * dx13; + var u_b = dy43 * dx21 - dx43 * dy21; + + if (u_b !== 0) { + var ua = ua_t / u_b; + var ub = ub_t / u_b; + + var flptThreshold = 0.001; + var min = 0 - flptThreshold; + var max = 1 + flptThreshold; + + if (min <= ua && ua <= max && min <= ub && ub <= max) { + return [x1 + ua * dx21, y1 + ua * dy21]; + } else { + if (!infiniteLines) { + return []; + } else { + return [x1 + ua * dx21, y1 + ua * dy21]; + } + } + } else { + if (ua_t === 0 || ub_t === 0) { + + // Parallel, coincident lines. Check if overlap + + // Check endpoint of second line + if (this.midOfThree(x1, x2, x4) === x4) { + return [x4, y4]; + } + + // Check start point of second line + if (this.midOfThree(x1, x2, x3) === x3) { + return [x3, y3]; + } + + // Endpoint of first line + if (this.midOfThree(x3, x4, x2) === x2) { + return [x2, y2]; + } + + return []; + } else { + + // Parallel, non-coincident + return []; + } + } +}; + +// math.polygonIntersectLine( x, y, basePoints, centerX, centerY, width, height, padding ) +// intersect a node polygon (pts transformed) +// +// math.polygonIntersectLine( x, y, basePoints, centerX, centerY ) +// intersect the points (no transform) +math.polygonIntersectLine = function (x, y, basePoints, centerX, centerY, width, height, padding) { + + var intersections = []; + var intersection = void 0; + + var transformedPoints = new Array(basePoints.length); + + var doTransform = true; + if (arguments.length === 5) { + doTransform = false; + } + + var points = void 0; + + if (doTransform) { + for (var i = 0; i < transformedPoints.length / 2; i++) { + transformedPoints[i * 2] = basePoints[i * 2] * width + centerX; + transformedPoints[i * 2 + 1] = basePoints[i * 2 + 1] * height + centerY; + } + + if (padding > 0) { + var expandedLineSet = math.expandPolygon(transformedPoints, -padding); + + points = math.joinLines(expandedLineSet); + } else { + points = transformedPoints; + } + } else { + points = basePoints; + } + + var currentX = void 0, + currentY = void 0, + nextX = void 0, + nextY = void 0; + + for (var _i = 0; _i < points.length / 2; _i++) { + + currentX = points[_i * 2]; + currentY = points[_i * 2 + 1]; + + if (_i < points.length / 2 - 1) { + nextX = points[(_i + 1) * 2]; + nextY = points[(_i + 1) * 2 + 1]; + } else { + nextX = points[0]; + nextY = points[1]; + } + + intersection = this.finiteLinesIntersect(x, y, centerX, centerY, currentX, currentY, nextX, nextY); + + if (intersection.length !== 0) { + intersections.push(intersection[0], intersection[1]); + } + } + + return intersections; +}; + +math.shortenIntersection = function (intersection, offset, amount) { + + var disp = [intersection[0] - offset[0], intersection[1] - offset[1]]; + + var length = Math.sqrt(disp[0] * disp[0] + disp[1] * disp[1]); + + var lenRatio = (length - amount) / length; + + if (lenRatio < 0) { + lenRatio = 0.00001; + } + + return [offset[0] + lenRatio * disp[0], offset[1] + lenRatio * disp[1]]; +}; + +math.generateUnitNgonPointsFitToSquare = function (sides, rotationRadians) { + var points = math.generateUnitNgonPoints(sides, rotationRadians); + points = math.fitPolygonToSquare(points); + + return points; +}; + +math.fitPolygonToSquare = function (points) { + var x = void 0, + y = void 0; + var sides = points.length / 2; + var minX = Infinity, + minY = Infinity, + maxX = -Infinity, + maxY = -Infinity; + + for (var i = 0; i < sides; i++) { + x = points[2 * i]; + y = points[2 * i + 1]; + + minX = Math.min(minX, x); + maxX = Math.max(maxX, x); + minY = Math.min(minY, y); + maxY = Math.max(maxY, y); + } + + // stretch factors + var sx = 2 / (maxX - minX); + var sy = 2 / (maxY - minY); + + for (var _i2 = 0; _i2 < sides; _i2++) { + x = points[2 * _i2] = points[2 * _i2] * sx; + y = points[2 * _i2 + 1] = points[2 * _i2 + 1] * sy; + + minX = Math.min(minX, x); + maxX = Math.max(maxX, x); + minY = Math.min(minY, y); + maxY = Math.max(maxY, y); + } + + if (minY < -1) { + for (var _i3 = 0; _i3 < sides; _i3++) { + y = points[2 * _i3 + 1] = points[2 * _i3 + 1] + (-1 - minY); + } + } + + return points; +}; + +math.generateUnitNgonPoints = function (sides, rotationRadians) { + + var increment = 1.0 / sides * 2 * Math.PI; + var startAngle = sides % 2 === 0 ? Math.PI / 2.0 + increment / 2.0 : Math.PI / 2.0; + + startAngle += rotationRadians; + + var points = new Array(sides * 2); + + var currentAngle = void 0; + for (var i = 0; i < sides; i++) { + currentAngle = i * increment + startAngle; + + points[2 * i] = Math.cos(currentAngle); // x + points[2 * i + 1] = Math.sin(-currentAngle); // y + } + + return points; +}; + +math.getRoundRectangleRadius = function (width, height) { + + // Set the default radius, unless half of width or height is smaller than default + return Math.min(width / 4, height / 4, 8); +}; + +math.getCutRectangleCornerLength = function () { + return 8; +}; + +math.bezierPtsToQuadCoeff = function (p0, p1, p2) { + return [p0 - 2 * p1 + p2, 2 * (p1 - p0), p0]; +}; + +math.getBarrelCurveConstants = function (width, height) { + // get curve width, height, and control point position offsets as a percentage of node height / width + return { + heightOffset: Math.min(15, 0.05 * height), + widthOffset: Math.min(100, 0.25 * width), + ctrlPtOffsetPct: 0.05 + }; +}; + +module.exports = math; + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = typeof window === 'undefined' ? null : window; // eslint-disable-line no-undef + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// use this module to cherry pick functions into your prototype +// (useful for functions shared between the core and collections, for example) + +// e.g. +// let foo = define.foo({ /* params... */ }) + +var util = __webpack_require__(1); + +var define = {}; + +[__webpack_require__(43), __webpack_require__(45), __webpack_require__(46)].forEach(function (m) { + util.assign(define, m); +}); + +module.exports = define; + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +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; }; + +/*! +Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable +Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) +Licensed under The MIT License (http://opensource.org/licenses/MIT) +*/ + +/* promise states [Promises/A+ 2.1] */ +var STATE_PENDING = 0; /* [Promises/A+ 2.1.1] */ +var STATE_FULFILLED = 1; /* [Promises/A+ 2.1.2] */ +var STATE_REJECTED = 2; /* [Promises/A+ 2.1.3] */ + +/* promise object constructor */ +var api = function api(executor) { + /* optionally support non-constructor/plain-function call */ + if (!(this instanceof api)) return new api(executor); + + /* initialize object */ + this.id = 'Thenable/1.0.7'; + this.state = STATE_PENDING; /* initial state */ + this.fulfillValue = undefined; /* initial value */ /* [Promises/A+ 1.3, 2.1.2.2] */ + this.rejectReason = undefined; /* initial reason */ /* [Promises/A+ 1.5, 2.1.3.2] */ + this.onFulfilled = []; /* initial handlers */ + this.onRejected = []; /* initial handlers */ + + /* provide optional information-hiding proxy */ + this.proxy = { + then: this.then.bind(this) + }; + + /* support optional executor function */ + if (typeof executor === 'function') executor.call(this, this.fulfill.bind(this), this.reject.bind(this)); +}; + +/* promise API methods */ +api.prototype = { + /* promise resolving methods */ + fulfill: function fulfill(value) { + return deliver(this, STATE_FULFILLED, 'fulfillValue', value); + }, + reject: function reject(value) { + return deliver(this, STATE_REJECTED, 'rejectReason', value); + }, + + /* "The then Method" [Promises/A+ 1.1, 1.2, 2.2] */ + then: function then(onFulfilled, onRejected) { + var curr = this; + var next = new api(); /* [Promises/A+ 2.2.7] */ + curr.onFulfilled.push(resolver(onFulfilled, next, 'fulfill')); /* [Promises/A+ 2.2.2/2.2.6] */ + curr.onRejected.push(resolver(onRejected, next, 'reject')); /* [Promises/A+ 2.2.3/2.2.6] */ + execute(curr); + return next.proxy; /* [Promises/A+ 2.2.7, 3.3] */ + } +}; + +/* deliver an action */ +var deliver = function deliver(curr, state, name, value) { + if (curr.state === STATE_PENDING) { + curr.state = state; /* [Promises/A+ 2.1.2.1, 2.1.3.1] */ + curr[name] = value; /* [Promises/A+ 2.1.2.2, 2.1.3.2] */ + execute(curr); + } + return curr; +}; + +/* execute all handlers */ +var execute = function execute(curr) { + if (curr.state === STATE_FULFILLED) execute_handlers(curr, 'onFulfilled', curr.fulfillValue);else if (curr.state === STATE_REJECTED) execute_handlers(curr, 'onRejected', curr.rejectReason); +}; + +/* execute particular set of handlers */ +var execute_handlers = function execute_handlers(curr, name, value) { + /* global setImmediate: true */ + /* global setTimeout: true */ + + /* short-circuit processing */ + if (curr[name].length === 0) return; + + /* iterate over all handlers, exactly once */ + var handlers = curr[name]; + curr[name] = []; /* [Promises/A+ 2.2.2.3, 2.2.3.3] */ + var func = function func() { + for (var i = 0; i < handlers.length; i++) { + handlers[i](value); + } /* [Promises/A+ 2.2.5] */ + }; + + /* execute procedure asynchronously */ /* [Promises/A+ 2.2.4, 3.1] */ + if (typeof setImmediate === 'function') setImmediate(func);else setTimeout(func, 0); +}; + +/* generate a resolver function */ +var resolver = function resolver(cb, next, method) { + return function (value) { + if (typeof cb !== 'function') /* [Promises/A+ 2.2.1, 2.2.7.3, 2.2.7.4] */ + next[method].call(next, value); /* [Promises/A+ 2.2.7.3, 2.2.7.4] */ + else { + var result; + try { + result = cb(value); + } /* [Promises/A+ 2.2.2.1, 2.2.3.1, 2.2.5, 3.2] */ + catch (e) { + next.reject(e); /* [Promises/A+ 2.2.7.2] */ + return; + } + resolve(next, result); /* [Promises/A+ 2.2.7.1] */ + } + }; +}; + +/* "Promise Resolution Procedure" */ /* [Promises/A+ 2.3] */ +var resolve = function resolve(promise, x) { + /* sanity check arguments */ /* [Promises/A+ 2.3.1] */ + if (promise === x || promise.proxy === x) { + promise.reject(new TypeError('cannot resolve promise with itself')); + return; + } + + /* surgically check for a "then" method + (mainly to just call the "getter" of "then" only once) */ + var then; + if ((typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object' && x !== null || typeof x === 'function') { + try { + then = x.then; + } /* [Promises/A+ 2.3.3.1, 3.5] */ + catch (e) { + promise.reject(e); /* [Promises/A+ 2.3.3.2] */ + return; + } + } + + /* handle own Thenables [Promises/A+ 2.3.2] + and similar "thenables" [Promises/A+ 2.3.3] */ + if (typeof then === 'function') { + var resolved = false; + try { + /* call retrieved "then" method */ /* [Promises/A+ 2.3.3.3] */ + then.call(x, + /* resolvePromise */ /* [Promises/A+ 2.3.3.3.1] */ + function (y) { + if (resolved) return;resolved = true; /* [Promises/A+ 2.3.3.3.3] */ + if (y === x) /* [Promises/A+ 3.6] */ + promise.reject(new TypeError('circular thenable chain'));else resolve(promise, y); + }, + + /* rejectPromise */ /* [Promises/A+ 2.3.3.3.2] */ + function (r) { + if (resolved) return;resolved = true; /* [Promises/A+ 2.3.3.3.3] */ + promise.reject(r); + }); + } catch (e) { + if (!resolved) /* [Promises/A+ 2.3.3.3.3] */ + promise.reject(e); /* [Promises/A+ 2.3.3.3.4] */ + } + return; + } + + /* handle other values */ + promise.fulfill(x); /* [Promises/A+ 2.3.4, 2.3.3.4] */ +}; + +// so we always have Promise.all() +api.all = function (ps) { + return new api(function (resolveAll, rejectAll) { + var vals = new Array(ps.length); + var doneCount = 0; + + var fulfill = function fulfill(i, val) { + vals[i] = val; + doneCount++; + + if (doneCount === ps.length) { + resolveAll(vals); + } + }; + + for (var i = 0; i < ps.length; i++) { + (function (i) { + var p = ps[i]; + var isPromise = p != null && p.then != null; + + if (isPromise) { + p.then(function (val) { + fulfill(i, val); + }, function (err) { + rejectAll(err); + }); + } else { + var val = p; + fulfill(i, val); + } + })(i); + } + }); +}; + +api.resolve = function (val) { + return new api(function (resolve, reject) { + resolve(val); + }); +}; + +api.reject = function (val) { + return new api(function (resolve, reject) { + reject(val); + }); +}; + +module.exports = typeof Promise !== 'undefined' ? Promise : api; // eslint-disable-line no-undef + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var util = __webpack_require__(1); +var newQuery = __webpack_require__(10); + +var Selector = function Selector(selector) { + var self = this; + + self._private = { + selectorText: selector, + invalid: true + }; + + if (selector == null || is.string(selector) && selector.match(/^\s*$/)) { + + self.length = 0; + } else if (selector === '*' || selector === 'edge' || selector === 'node') { + + // make single, group-only selectors cheap to make and cheap to filter + + self[0] = newQuery(); + self[0].group = selector === '*' ? selector : selector + 's'; + self[0].groupOnly = true; + self[0].length = 1; + self._private.invalid = false; + self.length = 1; + } else if (is.elementOrCollection(selector)) { + + var collection = selector.collection(); + + self[0] = newQuery(); + self[0].collection = collection; + self[0].length = 1; + self.length = 1; + } else if (is.fn(selector)) { + + self[0] = newQuery(); + self[0].filter = selector; + self[0].length = 1; + self.length = 1; + } else if (is.string(selector)) { + if (!self.parse(selector)) { + return; + } + } else { + util.error('A selector must be created from a string; found ', selector); + return; + } + + self._private.invalid = false; +}; + +var selfn = Selector.prototype; + +selfn.valid = function () { + return !this._private.invalid; +}; + +selfn.invalid = function () { + return this._private.invalid; +}; + +selfn.text = function () { + return this._private.selectorText; +}; + +selfn.size = function () { + return this.length; +}; + +selfn.eq = function (i) { + return this[i]; +}; + +selfn.sameText = function (otherSel) { + return this.text() === otherSel.text(); +}; + +selfn.toString = selfn.selector = function () { + + if (this._private.toStringCache != null) { + return this._private.toStringCache; + } + + var i = void 0; + var str = ''; + + var clean = function clean(obj) { + if (obj == null) { + return ''; + } else { + return obj; + } + }; + + var cleanVal = function cleanVal(val) { + if (is.string(val)) { + return '"' + val + '"'; + } else { + return clean(val); + } + }; + + var space = function space(val) { + return ' ' + val + ' '; + }; + + var queryToString = function queryToString(query) { + var str = ''; + var j = void 0, + sel = void 0; + + if (query.subject === query) { + str += '$'; + } + + var group = clean(query.group); + str += group.substring(0, group.length - 1); + + for (j = 0; j < query.data.length; j++) { + var data = query.data[j]; + + if (data.value) { + str += '[' + data.field + space(clean(data.operator)) + cleanVal(data.value) + ']'; + } else { + str += '[' + clean(data.operator) + data.field + ']'; + } + } + + for (j = 0; j < query.meta.length; j++) { + var meta = query.meta[j]; + str += '[[' + meta.field + space(clean(meta.operator)) + cleanVal(meta.value) + ']]'; + } + + for (j = 0; j < query.colonSelectors.length; j++) { + sel = query.colonSelectors[i]; + str += sel; + } + + for (j = 0; j < query.ids.length; j++) { + sel = '#' + query.ids[i]; + str += sel; + } + + for (j = 0; j < query.classes.length; j++) { + sel = '.' + query.classes[j]; + str += sel; + } + + if (query.source != null && query.target != null) { + str = queryToString(query.source) + ' -> ' + queryToString(query.target); + } + + if (query.connectedNodes != null) { + var n = query.connectedNodes; + + str = queryToString(n[0]) + ' <-> ' + queryToString(n[1]); + } + + if (query.parent != null) { + str = queryToString(query.parent) + ' > ' + str; + } + + if (query.ancestor != null) { + str = queryToString(query.ancestor) + ' ' + str; + } + + if (query.child != null) { + str += ' > ' + queryToString(query.child); + } + + if (query.descendant != null) { + str += ' ' + queryToString(query.descendant); + } + + return str; + }; + + for (i = 0; i < this.length; i++) { + var query = this[i]; + + str += queryToString(query); + + if (this.length > 1 && i < this.length - 1) { + str += ', '; + } + } + + this._private.toStringCache = str; + + return str; +}; + +[__webpack_require__(49), __webpack_require__(52)].forEach(function (p) { + return util.assign(selfn, p); +}); + +module.exports = Selector; + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var is = __webpack_require__(0); +var Map = __webpack_require__(28); +var Set = __webpack_require__(8); + +var Element = __webpack_require__(14); + +// factory for generating edge ids when no id is specified for a new element +var idFactory = { + generate: function generate(cy, element, tryThisId) { + var id = tryThisId != null ? tryThisId : util.uuid(); + + while (cy.hasElementWithId(id)) { + id = util.uuid(); + } + + return id; + } +}; + +// represents a set of nodes, edges, or both together +var Collection = function Collection(cy, elements, options) { + if (cy === undefined || !is.core(cy)) { + util.error('A collection must have a reference to the core'); + return; + } + + var map = new Map(); + var createdElements = false; + + if (!elements) { + elements = []; + } else if (elements.length > 0 && is.plainObject(elements[0]) && !is.element(elements[0])) { + createdElements = true; + + // make elements from json and restore all at once later + var eles = []; + var elesIds = new Set(); + + for (var i = 0, l = elements.length; i < l; i++) { + var json = elements[i]; + + if (json.data == null) { + json.data = {}; + } + + var data = json.data; + + // make sure newly created elements have valid ids + if (data.id == null) { + data.id = idFactory.generate(cy, json); + } else if (cy.hasElementWithId(data.id) || elesIds.has(data.id)) { + continue; // can't create element if prior id already exists + } + + var ele = new Element(cy, json, false); + eles.push(ele); + elesIds.add(data.id); + } + + elements = eles; + } + + this.length = 0; + + for (var _i = 0, _l = elements.length; _i < _l; _i++) { + var element = elements[_i]; + if (element == null) { + continue; + } + + var id = element._private.data.id; + + if (options == null || options.unique && !map.has(id)) { + map.set(id, { + index: this.length, + ele: element + }); + + this[this.length] = element; + this.length++; + } + } + + this._private = { + cy: cy, + map: map + }; + + // restore the elements if we created them from json + if (createdElements) { + this.restore(); + } +}; + +// Functions +//////////////////////////////////////////////////////////////////////////////////////////////////// + +// keep the prototypes in sync (an element has the same functions as a collection) +// and use elefn and elesfn as shorthands to the prototypes +var elesfn = Element.prototype = Collection.prototype; + +elesfn.instanceString = function () { + return 'collection'; +}; + +elesfn.spawn = function (cy, eles, opts) { + if (!is.core(cy)) { + // cy is optional + opts = eles; + eles = cy; + cy = this.cy(); + } + + return new Collection(cy, eles, opts); +}; + +elesfn.spawnSelf = function () { + return this.spawn(this); +}; + +elesfn.cy = function () { + return this._private.cy; +}; + +elesfn.renderer = function () { + return this._private.cy.renderer(); +}; + +elesfn.element = function () { + return this[0]; +}; + +elesfn.collection = function () { + if (is.collection(this)) { + return this; + } else { + // an element + return new Collection(this._private.cy, [this]); + } +}; + +elesfn.unique = function () { + return new Collection(this._private.cy, this, { unique: true }); +}; + +elesfn.hasElementWithId = function (id) { + return this._private.map.has(id); +}; + +elesfn.getElementById = function (id) { + var cy = this._private.cy; + var entry = this._private.map.get(id); + + return entry ? entry.ele : new Collection(cy); // get ele or empty collection +}; + +elesfn.$id = elesfn.getElementById; + +elesfn.poolIndex = function () { + var cy = this._private.cy; + var eles = cy._private.elements; + var id = this._private.data.id; + + return eles._private.map.get(id).index; +}; + +elesfn.json = function (obj) { + var ele = this.element(); + var cy = this.cy(); + + if (ele == null && obj) { + return this; + } // can't set to no eles + + if (ele == null) { + return undefined; + } // can't get from no eles + + var p = ele._private; + + if (is.plainObject(obj)) { + // set + + cy.startBatch(); + + if (obj.data) { + ele.data(obj.data); + } + + if (obj.position) { + ele.position(obj.position); + } + + // ignore group -- immutable + + var checkSwitch = function checkSwitch(k, trueFnName, falseFnName) { + var obj_k = obj[k]; + + if (obj_k != null && obj_k !== p[k]) { + if (obj_k) { + ele[trueFnName](); + } else { + ele[falseFnName](); + } + } + }; + + checkSwitch('removed', 'remove', 'restore'); + + checkSwitch('selected', 'select', 'unselect'); + + checkSwitch('selectable', 'selectify', 'unselectify'); + + checkSwitch('locked', 'lock', 'unlock'); + + checkSwitch('grabbable', 'grabify', 'ungrabify'); + + if (obj.classes != null) { + ele.classes(obj.classes); + } + + cy.endBatch(); + + return this; + } else if (obj === undefined) { + // get + + var json = { + data: util.copy(p.data), + position: util.copy(p.position), + group: p.group, + removed: p.removed, + selected: p.selected, + selectable: p.selectable, + locked: p.locked, + grabbable: p.grabbable, + classes: null + }; + + json.classes = ''; + + var i = 0; + p.classes.forEach(function (cls) { + return json.classes += i++ === 0 ? cls : ' ' + cls; + }); + + return json; + } +}; + +elesfn.jsons = function () { + var jsons = []; + + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + var json = ele.json(); + + jsons.push(json); + } + + return jsons; +}; + +elesfn.clone = function () { + var cy = this.cy(); + var elesArr = []; + + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + var json = ele.json(); + var clone = new Element(cy, json, false); // NB no restore + + elesArr.push(clone); + } + + return new Collection(cy, elesArr); +}; +elesfn.copy = elesfn.clone; + +elesfn.restore = function (notifyRenderer) { + var self = this; + var cy = self.cy(); + var cy_p = cy._private; + + if (notifyRenderer === undefined) { + notifyRenderer = true; + } + + // create arrays of nodes and edges, since we need to + // restore the nodes first + var nodes = []; + var edges = []; + var elements = void 0; + for (var _i2 = 0, l = self.length; _i2 < l; _i2++) { + var ele = self[_i2]; + + if (!ele.removed()) { + // don't need to handle this ele + continue; + } + + // keep nodes first in the array and edges after + if (ele.isNode()) { + // put to front of array if node + nodes.push(ele); + } else { + // put to end of array if edge + edges.push(ele); + } + } + + elements = nodes.concat(edges); + + var i = void 0; + var removeFromElements = function removeFromElements() { + elements.splice(i, 1); + i--; + }; + + // now, restore each element + for (i = 0; i < elements.length; i++) { + var _ele = elements[i]; + + var _private = _ele._private; + var data = _private.data; + + // the traversal cache should start fresh when ele is added + _ele.clearTraversalCache(); + + // set id and validate + if (data.id === undefined) { + data.id = idFactory.generate(cy, _ele); + } else if (is.number(data.id)) { + data.id = '' + data.id; // now it's a string + } else if (is.emptyString(data.id) || !is.string(data.id)) { + util.error('Can not create element with invalid string ID `' + data.id + '`'); + + // can't create element if it has empty string as id or non-string id + removeFromElements(); + continue; + } else if (cy.hasElementWithId(data.id)) { + util.error('Can not create second element with ID `' + data.id + '`'); + + // can't create element if one already has that id + removeFromElements(); + continue; + } + + var id = data.id; // id is finalised, now let's keep a ref + + if (_ele.isNode()) { + // extra checks for nodes + var pos = _private.position; + + // make sure the nodes have a defined position + + if (pos.x == null) { + pos.x = 0; + } + + if (pos.y == null) { + pos.y = 0; + } + } + + if (_ele.isEdge()) { + // extra checks for edges + + var edge = _ele; + var fields = ['source', 'target']; + var fieldsLength = fields.length; + var badSourceOrTarget = false; + for (var j = 0; j < fieldsLength; j++) { + + var field = fields[j]; + var val = data[field]; + + if (is.number(val)) { + val = data[field] = '' + data[field]; // now string + } + + if (val == null || val === '') { + // can't create if source or target is not defined properly + util.error('Can not create edge `' + id + '` with unspecified ' + field); + badSourceOrTarget = true; + } else if (!cy.hasElementWithId(val)) { + // can't create edge if one of its nodes doesn't exist + util.error('Can not create edge `' + id + '` with nonexistant ' + field + ' `' + val + '`'); + badSourceOrTarget = true; + } + } + + if (badSourceOrTarget) { + removeFromElements();continue; + } // can't create this + + var src = cy.getElementById(data.source); + var tgt = cy.getElementById(data.target); + + src._private.edges.push(edge); + tgt._private.edges.push(edge); + + edge._private.source = src; + edge._private.target = tgt; + } // if is edge + + // create mock ids / indexes maps for element so it can be used like collections + _private.map = new Map(); + _private.map.set(id, { ele: _ele, index: 0 }); + + _private.removed = false; + cy.addToPool(_ele); + } // for each element + + // do compound node sanity checks + for (var _i3 = 0; _i3 < nodes.length; _i3++) { + // each node + var node = nodes[_i3]; + var _data = node._private.data; + + if (is.number(_data.parent)) { + // then automake string + _data.parent = '' + _data.parent; + } + + var parentId = _data.parent; + + var specifiedParent = parentId != null; + + if (specifiedParent) { + var parent = cy.getElementById(parentId); + + if (parent.empty()) { + // non-existant parent; just remove it + _data.parent = undefined; + } else { + var selfAsParent = false; + var ancestor = parent; + while (!ancestor.empty()) { + if (node.same(ancestor)) { + // mark self as parent and remove from data + selfAsParent = true; + _data.parent = undefined; // remove parent reference + + // exit or we loop forever + break; + } + + ancestor = ancestor.parent(); + } + + if (!selfAsParent) { + // connect with children + parent[0]._private.children.push(node); + node._private.parent = parent[0]; + + // let the core know we have a compound graph + cy_p.hasCompoundNodes = true; + } + } // else + } // if specified parent + } // for each node + + if (elements.length > 0) { + var restored = new Collection(cy, elements); + + for (var _i4 = 0; _i4 < restored.length; _i4++) { + var _ele2 = restored[_i4]; + + if (_ele2.isNode()) { + continue; + } + + // adding an edge invalidates the traversal caches for the parallel edges + _ele2.parallelEdges().clearTraversalCache(); + + // adding an edge invalidates the traversal cache for the connected nodes + _ele2.source().clearTraversalCache(); + _ele2.target().clearTraversalCache(); + } + + var toUpdateStyle = void 0; + + if (cy_p.hasCompoundNodes) { + toUpdateStyle = cy.collection().merge(restored).merge(restored.connectedNodes()).merge(restored.parent()); + } else { + toUpdateStyle = restored; + } + + toUpdateStyle.dirtyCompoundBoundsCache().updateStyle(notifyRenderer); + + if (notifyRenderer) { + restored.emitAndNotify('add'); + } else { + restored.emit('add'); + } + } + + return self; // chainability +}; + +elesfn.removed = function () { + var ele = this[0]; + return ele && ele._private.removed; +}; + +elesfn.inside = function () { + var ele = this[0]; + return ele && !ele._private.removed; +}; + +elesfn.remove = function (notifyRenderer) { + var self = this; + var removed = []; + var elesToRemove = []; + var elesToRemoveIds = {}; + var cy = self._private.cy; + + if (notifyRenderer === undefined) { + notifyRenderer = true; + } + + // add connected edges + function addConnectedEdges(node) { + var edges = node._private.edges; + for (var i = 0; i < edges.length; i++) { + add(edges[i]); + } + } + + // add descendant nodes + function addChildren(node) { + var children = node._private.children; + + for (var i = 0; i < children.length; i++) { + add(children[i]); + } + } + + function add(ele) { + var alreadyAdded = elesToRemoveIds[ele.id()]; + if (ele.removed() || alreadyAdded) { + return; + } else { + elesToRemoveIds[ele.id()] = true; + } + + if (ele.isNode()) { + elesToRemove.push(ele); // nodes are removed last + + addConnectedEdges(ele); + addChildren(ele); + } else { + elesToRemove.unshift(ele); // edges are removed first + } + } + + // make the list of elements to remove + // (may be removing more than specified due to connected edges etc) + + for (var i = 0, l = self.length; i < l; i++) { + var ele = self[i]; + + add(ele); + } + + function removeEdgeRef(node, edge) { + var connectedEdges = node._private.edges; + + util.removeFromArray(connectedEdges, edge); + + // removing an edges invalidates the traversal cache for its nodes + node.clearTraversalCache(); + } + + function removeParallelRefs(edge) { + // removing an edge invalidates the traversal caches for the parallel edges + edge.parallelEdges().clearTraversalCache(); + } + + var alteredParents = []; + alteredParents.ids = {}; + + function removeChildRef(parent, ele) { + ele = ele[0]; + parent = parent[0]; + + var children = parent._private.children; + var pid = parent.id(); + + util.removeFromArray(children, ele); + + if (!alteredParents.ids[pid]) { + alteredParents.ids[pid] = true; + alteredParents.push(parent); + } + } + + self.dirtyCompoundBoundsCache(); + + cy.removeFromPool(elesToRemove); // remove from core pool + + for (var _i5 = 0; _i5 < elesToRemove.length; _i5++) { + var _ele3 = elesToRemove[_i5]; + + // mark as removed + _ele3._private.removed = true; + + // add to list of removed elements + removed.push(_ele3); + + if (_ele3.isEdge()) { + // remove references to this edge in its connected nodes + var src = _ele3.source()[0]; + var tgt = _ele3.target()[0]; + + removeEdgeRef(src, _ele3); + removeEdgeRef(tgt, _ele3); + removeParallelRefs(_ele3); + } else { + // remove reference to parent + var parent = _ele3.parent(); + + if (parent.length !== 0) { + removeChildRef(parent, _ele3); + } + } + } + + // check to see if we have a compound graph or not + var elesStillInside = cy._private.elements; + cy._private.hasCompoundNodes = false; + for (var _i6 = 0; _i6 < elesStillInside.length; _i6++) { + var _ele4 = elesStillInside[_i6]; + + if (_ele4.isParent()) { + cy._private.hasCompoundNodes = true; + break; + } + } + + var removedElements = new Collection(this.cy(), removed); + if (removedElements.size() > 0) { + // must manually notify since trigger won't do this automatically once removed + + if (notifyRenderer) { + this.cy().notify({ + type: 'remove', + eles: removedElements + }); + } + + removedElements.emit('remove'); + } + + // the parents who were modified by the removal need their style updated + for (var _i7 = 0; _i7 < alteredParents.length; _i7++) { + var _ele5 = alteredParents[_i7]; + + if (!_ele5.removed()) { + _ele5.updateStyle(); + } + } + + return new Collection(cy, removed); +}; + +elesfn.move = function (struct) { + var cy = this._private.cy; + + if (struct.source !== undefined || struct.target !== undefined) { + var srcId = struct.source; + var tgtId = struct.target; + var srcExists = cy.hasElementWithId(srcId); + var tgtExists = cy.hasElementWithId(tgtId); + + if (srcExists || tgtExists) { + var jsons = this.jsons(); + + this.remove(); + + for (var i = 0; i < jsons.length; i++) { + var json = jsons[i]; + var ele = this[i]; + + if (json.group === 'edges') { + if (srcExists) { + json.data.source = srcId; + } + + if (tgtExists) { + json.data.target = tgtId; + } + + json.scratch = ele._private.scratch; + } + } + + return cy.add(jsons); + } + } else if (struct.parent !== undefined) { + // move node to new parent + var parentId = struct.parent; + var parentExists = parentId === null || cy.hasElementWithId(parentId); + + if (parentExists) { + var _jsons = this.jsons(); + var descs = this.descendants(); + var descsEtcJsons = descs.union(descs.union(this).connectedEdges()).jsons(); + + this.remove(); // NB: also removes descendants and their connected edges + + for (var _i8 = 0; _i8 < _jsons.length; _i8++) { + var _json = _jsons[_i8]; + var _ele6 = this[_i8]; + + if (_json.group === 'nodes') { + _json.data.parent = parentId === null ? undefined : parentId; + + _json.scratch = _ele6._private.scratch; + } + } + + return cy.add(_jsons.concat(descsEtcJsons)); + } + } + + return this; // if nothing done +}; + +[__webpack_require__(29), __webpack_require__(42), __webpack_require__(47), __webpack_require__(48), __webpack_require__(53), __webpack_require__(54), __webpack_require__(55), __webpack_require__(56), __webpack_require__(61), __webpack_require__(62), __webpack_require__(63), __webpack_require__(7), __webpack_require__(64), __webpack_require__(65), __webpack_require__(66), __webpack_require__(67), __webpack_require__(68)].forEach(function (props) { + util.extend(elesfn, props); +}); + +module.exports = Collection; + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +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 _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; }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/* global Set */ + +var undef = true ? 'undefined' : _typeof(undefined); + +var ObjectSet = function () { + function ObjectSet(arrayOrObjectSet) { + _classCallCheck(this, ObjectSet); + + this._obj = Object.create(null); + + if (arrayOrObjectSet != null) { + var arr = void 0; + + if (arrayOrObjectSet.instanceString != null && arrayOrObjectSet.instanceString() === this.instanceString()) { + arr = arrayOrObjectSet.toArray(); + } else { + arr = arrayOrObjectSet; + } + + for (var i = 0; i < arr.length; i++) { + this.add(arr[i]); + } + } + } + + _createClass(ObjectSet, [{ + key: 'instanceString', + value: function instanceString() { + return 'set'; + } + }, { + key: 'add', + value: function add(val) { + this._obj[val] = 1; + } + }, { + key: 'delete', + value: function _delete(val) { + this._obj[val] = 0; + } + }, { + key: 'clear', + value: function clear() { + this._obj = Object.create(null); + } + }, { + key: 'has', + value: function has(val) { + return this._obj[val] === 1; + } + }, { + key: 'toArray', + value: function toArray() { + var _this = this; + + return Object.keys(this._obj).filter(function (key) { + return _this.has(key); + }); + } + }, { + key: 'forEach', + value: function forEach(callback, thisArg) { + return this.toArray().forEach(callback, thisArg); + } + }, { + key: 'size', + get: function get() { + return this.toArray().length; + } + }]); + + return ObjectSet; +}(); + +// TODO use the stdlib Set in future... +// module.exports = typeof Set !== undef ? Set : ObjectSet; + + +module.exports = ObjectSet; + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = __webpack_require__(32); + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// storage for parsed queries +var newQuery = function newQuery() { + return { + classes: [], + colonSelectors: [], + data: [], + group: null, + ids: [], + meta: [], + + // fake selectors + collection: null, // a collection to match against + filter: null, // filter function + + // these are defined in the upward direction rather than down (e.g. child) + // because we need to go up in Selector.filter() + parent: null, // parent query obj + ancestor: null, // ancestor query obj + subject: null, // defines subject in compound query (subject query obj; points to self if subject) + + // use these only when subject has been defined + child: null, + descendant: null + }; +}; + +module.exports = newQuery; + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var is = __webpack_require__(0); +var Event = __webpack_require__(16); + +var eventRegex = /^([^.]+)(\.(?:[^.]+))?$/; // regex for matching event strings (e.g. "click.namespace") +var universalNamespace = '.*'; // matches as if no namespace specified and prevents users from unbinding accidentally + +var defaults = { + qualifierCompare: function qualifierCompare(q1, q2) { + return q1 === q2; + }, + eventMatches: function eventMatches() /*context, listener, eventObj*/{ + return true; + }, + eventFields: function eventFields() /*context*/{ + return {}; + }, + callbackContext: function callbackContext(context /*, listener, eventObj*/) { + return context; + }, + beforeEmit: function beforeEmit() /* context, listener, eventObj */{}, + afterEmit: function afterEmit() /* context, listener, eventObj */{}, + bubble: function bubble() /*context*/{ + return false; + }, + parent: function parent() /*context*/{ + return null; + }, + context: undefined +}; + +function Emitter(opts) { + util.assign(this, defaults, opts); + + this.listeners = []; + this.emitting = 0; +} + +var p = Emitter.prototype; + +var forEachEvent = function forEachEvent(self, handler, events, qualifier, callback, conf, confOverrides) { + if (is.fn(qualifier)) { + callback = qualifier; + qualifier = null; + } + + if (confOverrides) { + if (conf == null) { + conf = confOverrides; + } else { + conf = util.assign({}, conf, confOverrides); + } + } + + var eventList = events.split(/\s+/); + + for (var i = 0; i < eventList.length; i++) { + var evt = eventList[i]; + + if (is.emptyString(evt)) { + continue; + } + + var match = evt.match(eventRegex); // type[.namespace] + + if (match) { + var type = match[1]; + var namespace = match[2] ? match[2] : null; + var ret = handler(self, evt, type, namespace, qualifier, callback, conf); + + if (ret === false) { + break; + } // allow exiting early + } + } +}; + +var makeEventObj = function makeEventObj(self, obj) { + return new Event(obj.type, util.assign(obj, self.eventFields(self.context))); +}; + +var forEachEventObj = function forEachEventObj(self, handler, events) { + if (is.event(events)) { + handler(self, events); + + return; + } else if (is.plainObject(events)) { + handler(self, makeEventObj(self, events)); + + return; + } + + var eventList = events.split(/\s+/); + + for (var i = 0; i < eventList.length; i++) { + var evt = eventList[i]; + + if (is.emptyString(evt)) { + continue; + } + + var match = evt.match(eventRegex); // type[.namespace] + + if (match) { + var type = match[1]; + var namespace = match[2] ? match[2] : null; + var eventObj = makeEventObj(self, { + type: type, + namespace: namespace, + target: self.context + }); + + handler(self, eventObj); + } + } +}; + +p.on = p.addListener = function (events, qualifier, callback, conf, confOverrides) { + forEachEvent(this, function (self, event, type, namespace, qualifier, callback, conf) { + if (is.fn(callback)) { + self.listeners.push({ + event: event, // full event string + callback: callback, // callback to run + type: type, // the event type (e.g. 'click') + namespace: namespace, // the event namespace (e.g. ".foo") + qualifier: qualifier, // a restriction on whether to match this emitter + conf: conf // additional configuration + }); + } + }, events, qualifier, callback, conf, confOverrides); + + return this; +}; + +p.one = function (events, qualifier, callback, conf) { + return this.on(events, qualifier, callback, conf, { one: true }); +}; + +p.removeListener = p.off = function (events, qualifier, callback, conf) { + var _this = this; + + if (this.emitting !== 0) { + this.listeners = util.copyArray(this.listeners); + } + + var listeners = this.listeners; + + var _loop = function _loop(i) { + var listener = listeners[i]; + + forEachEvent(_this, function (self, event, type, namespace, qualifier, callback /*, conf*/) { + if (listener.type === type && (!namespace || listener.namespace === namespace) && (!qualifier || self.qualifierCompare(listener.qualifier, qualifier)) && (!callback || listener.callback === callback)) { + listeners.splice(i, 1); + + return false; + } + }, events, qualifier, callback, conf); + }; + + for (var i = listeners.length - 1; i >= 0; i--) { + _loop(i); + } + + return this; +}; + +p.emit = p.trigger = function (events, extraParams, manualCallback) { + var listeners = this.listeners; + var numListenersBeforeEmit = listeners.length; + + this.emitting++; + + if (!is.array(extraParams)) { + extraParams = [extraParams]; + } + + forEachEventObj(this, function (self, eventObj) { + if (manualCallback != null) { + listeners = [{ + event: eventObj.event, + type: eventObj.type, + namespace: eventObj.namespace, + callback: manualCallback + }]; + + numListenersBeforeEmit = listeners.length; + } + + var _loop2 = function _loop2(i) { + var listener = listeners[i]; + + if (listener.type === eventObj.type && (!listener.namespace || listener.namespace === eventObj.namespace || listener.namespace === universalNamespace) && self.eventMatches(self.context, listener, eventObj)) { + var args = [eventObj]; + + if (extraParams != null) { + util.push(args, extraParams); + } + + self.beforeEmit(self.context, listener, eventObj); + + if (listener.conf && listener.conf.one) { + self.listeners = self.listeners.filter(function (l) { + return l !== listener; + }); + } + + var context = self.callbackContext(self.context, listener, eventObj); + var ret = listener.callback.apply(context, args); + + self.afterEmit(self.context, listener, eventObj); + + if (ret === false) { + eventObj.stopPropagation(); + eventObj.preventDefault(); + } + } // if listener matches + }; + + for (var i = 0; i < numListenersBeforeEmit; i++) { + _loop2(i); + } // for listener + + if (self.bubble(self.context) && !eventObj.isPropagationStopped()) { + self.parent(self.context).emit(eventObj, extraParams); + } + }, events); + + this.emitting--; + + return this; +}; + +module.exports = Emitter; + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var window = __webpack_require__(3); +var util = __webpack_require__(1); +var Collection = __webpack_require__(7); +var is = __webpack_require__(0); +var Promise = __webpack_require__(5); +var define = __webpack_require__(4); + +var Core = function Core(opts) { + var cy = this; + + opts = util.extend({}, opts); + + var container = opts.container; + + // allow for passing a wrapped jquery object + // e.g. cytoscape({ container: $('#cy') }) + if (container && !is.htmlElement(container) && is.htmlElement(container[0])) { + container = container[0]; + } + + var reg = container ? container._cyreg : null; // e.g. already registered some info (e.g. readies) via jquery + reg = reg || {}; + + if (reg && reg.cy) { + reg.cy.destroy(); + + reg = {}; // old instance => replace reg completely + } + + var readies = reg.readies = reg.readies || []; + + if (container) { + container._cyreg = reg; + } // make sure container assoc'd reg points to this cy + reg.cy = cy; + + var head = window !== undefined && container !== undefined && !opts.headless; + var options = opts; + options.layout = util.extend({ name: head ? 'grid' : 'null' }, options.layout); + options.renderer = util.extend({ name: head ? 'canvas' : 'null' }, options.renderer); + + var defVal = function defVal(def, val, altVal) { + if (val !== undefined) { + return val; + } else if (altVal !== undefined) { + return altVal; + } else { + return def; + } + }; + + var _p = this._private = { + container: container, // html dom ele container + ready: false, // whether ready has been triggered + options: options, // cached options + elements: new Collection(this), // elements in the graph + listeners: [], // list of listeners + aniEles: new Collection(this), // elements being animated + scratch: {}, // scratch object for core + layout: null, + renderer: null, + destroyed: false, // whether destroy was called + notificationsEnabled: true, // whether notifications are sent to the renderer + minZoom: 1e-50, + maxZoom: 1e50, + zoomingEnabled: defVal(true, options.zoomingEnabled), + userZoomingEnabled: defVal(true, options.userZoomingEnabled), + panningEnabled: defVal(true, options.panningEnabled), + userPanningEnabled: defVal(true, options.userPanningEnabled), + boxSelectionEnabled: defVal(true, options.boxSelectionEnabled), + autolock: defVal(false, options.autolock, options.autolockNodes), + autoungrabify: defVal(false, options.autoungrabify, options.autoungrabifyNodes), + autounselectify: defVal(false, options.autounselectify), + styleEnabled: options.styleEnabled === undefined ? head : options.styleEnabled, + zoom: is.number(options.zoom) ? options.zoom : 1, + pan: { + x: is.plainObject(options.pan) && is.number(options.pan.x) ? options.pan.x : 0, + y: is.plainObject(options.pan) && is.number(options.pan.y) ? options.pan.y : 0 + }, + animation: { // object for currently-running animations + current: [], + queue: [] + }, + hasCompoundNodes: false + }; + + this.createEmitter(); + + // set selection type + var selType = options.selectionType; + if (selType === undefined || selType !== 'additive' && selType !== 'single') { + // then set default + + _p.selectionType = 'single'; + } else { + _p.selectionType = selType; + } + + // init zoom bounds + if (is.number(options.minZoom) && is.number(options.maxZoom) && options.minZoom < options.maxZoom) { + _p.minZoom = options.minZoom; + _p.maxZoom = options.maxZoom; + } else if (is.number(options.minZoom) && options.maxZoom === undefined) { + _p.minZoom = options.minZoom; + } else if (is.number(options.maxZoom) && options.minZoom === undefined) { + _p.maxZoom = options.maxZoom; + } + + var loadExtData = function loadExtData(extData, next) { + var anyIsPromise = extData.some(is.promise); + + if (anyIsPromise) { + return Promise.all(extData).then(next); // load all data asynchronously, then exec rest of init + } else { + next(extData); // exec synchronously for convenience + } + }; + + // start with the default stylesheet so we have something before loading an external stylesheet + if (_p.styleEnabled) { + cy.setStyle([]); + } + + // create the renderer + cy.initRenderer(util.extend({ + hideEdgesOnViewport: options.hideEdgesOnViewport, + textureOnViewport: options.textureOnViewport, + wheelSensitivity: is.number(options.wheelSensitivity) && options.wheelSensitivity > 0 ? options.wheelSensitivity : 1, + motionBlur: options.motionBlur === undefined ? false : options.motionBlur, // off by default + motionBlurOpacity: options.motionBlurOpacity === undefined ? 0.05 : options.motionBlurOpacity, + pixelRatio: is.number(options.pixelRatio) && options.pixelRatio > 0 ? options.pixelRatio : undefined, + desktopTapThreshold: options.desktopTapThreshold === undefined ? 4 : options.desktopTapThreshold, + touchTapThreshold: options.touchTapThreshold === undefined ? 8 : options.touchTapThreshold + }, options.renderer)); + + var setElesAndLayout = function setElesAndLayout(elements, onload, ondone) { + cy.notifications(false); + + // remove old elements + var oldEles = cy.mutableElements(); + if (oldEles.length > 0) { + oldEles.remove(); + } + + if (elements != null) { + if (is.plainObject(elements) || is.array(elements)) { + cy.add(elements); + } + } + + cy.one('layoutready', function (e) { + cy.notifications(true); + cy.emit(e); // we missed this event by turning notifications off, so pass it on + + cy.notify({ + type: 'load', + eles: cy.mutableElements() + }); + + cy.one('load', onload); + cy.emit('load'); + }).one('layoutstop', function () { + cy.one('done', ondone); + cy.emit('done'); + }); + + var layoutOpts = util.extend({}, cy._private.options.layout); + layoutOpts.eles = cy.elements(); + + cy.layout(layoutOpts).run(); + }; + + loadExtData([options.style, options.elements], function (thens) { + var initStyle = thens[0]; + var initEles = thens[1]; + + // init style + if (_p.styleEnabled) { + cy.style().append(initStyle); + } + + // initial load + setElesAndLayout(initEles, function () { + // onready + cy.startAnimationLoop(); + _p.ready = true; + + // if a ready callback is specified as an option, the bind it + if (is.fn(options.ready)) { + cy.on('ready', options.ready); + } + + // bind all the ready handlers registered before creating this instance + for (var i = 0; i < readies.length; i++) { + var fn = readies[i]; + cy.on('ready', fn); + } + if (reg) { + reg.readies = []; + } // clear b/c we've bound them all and don't want to keep it around in case a new core uses the same div etc + + cy.emit('ready'); + }, options.done); + }); +}; + +var corefn = Core.prototype; // short alias + +util.extend(corefn, { + instanceString: function instanceString() { + return 'core'; + }, + + isReady: function isReady() { + return this._private.ready; + }, + + isDestroyed: function isDestroyed() { + return this._private.destroyed; + }, + + ready: function ready(fn) { + if (this.isReady()) { + this.emitter().emit('ready', [], fn); // just calls fn as though triggered via ready event + } else { + this.on('ready', fn); + } + + return this; + }, + + destroy: function destroy() { + var cy = this; + if (cy.isDestroyed()) return; + + cy.stopAnimationLoop(); + + cy.destroyRenderer(); + + this.emit('destroy'); + + cy._private.destroyed = true; + + return cy; + }, + + hasElementWithId: function hasElementWithId(id) { + return this._private.elements.hasElementWithId(id); + }, + + getElementById: function getElementById(id) { + return this._private.elements.getElementById(id); + }, + + selectionType: function selectionType() { + return this._private.selectionType; + }, + + hasCompoundNodes: function hasCompoundNodes() { + return this._private.hasCompoundNodes; + }, + + headless: function headless() { + return this._private.options.renderer.name === 'null'; + }, + + styleEnabled: function styleEnabled() { + return this._private.styleEnabled; + }, + + addToPool: function addToPool(eles) { + this._private.elements.merge(eles); + + return this; // chaining + }, + + removeFromPool: function removeFromPool(eles) { + this._private.elements.unmerge(eles); + + return this; + }, + + container: function container() { + return this._private.container; + }, + + options: function options() { + return util.copy(this._private.options); + }, + + json: function json(obj) { + var cy = this; + var _p = cy._private; + var eles = cy.mutableElements(); + + if (is.plainObject(obj)) { + // set + + cy.startBatch(); + + if (obj.elements) { + var idInJson = {}; + + var updateEles = function updateEles(jsons, gr) { + for (var i = 0; i < jsons.length; i++) { + var json = jsons[i]; + var id = json.data.id; + var ele = cy.getElementById(id); + + idInJson[id] = true; + + if (ele.length !== 0) { + // existing element should be updated + ele.json(json); + } else { + // otherwise should be added + if (gr) { + cy.add(util.extend({ group: gr }, json)); + } else { + cy.add(json); + } + } + } + }; + + if (is.array(obj.elements)) { + // elements: [] + updateEles(obj.elements); + } else { + // elements: { nodes: [], edges: [] } + var grs = ['nodes', 'edges']; + for (var i = 0; i < grs.length; i++) { + var gr = grs[i]; + var elements = obj.elements[gr]; + + if (is.array(elements)) { + updateEles(elements, gr); + } + } + } + + // elements not specified in json should be removed + eles.stdFilter(function (ele) { + return !idInJson[ele.id()]; + }).remove(); + } + + if (obj.style) { + cy.style(obj.style); + } + + if (obj.zoom != null && obj.zoom !== _p.zoom) { + cy.zoom(obj.zoom); + } + + if (obj.pan) { + if (obj.pan.x !== _p.pan.x || obj.pan.y !== _p.pan.y) { + cy.pan(obj.pan); + } + } + + var fields = ['minZoom', 'maxZoom', 'zoomingEnabled', 'userZoomingEnabled', 'panningEnabled', 'userPanningEnabled', 'boxSelectionEnabled', 'autolock', 'autoungrabify', 'autounselectify']; + + for (var _i = 0; _i < fields.length; _i++) { + var f = fields[_i]; + + if (obj[f] != null) { + cy[f](obj[f]); + } + } + + cy.endBatch(); + + return this; // chaining + } else if (obj === undefined) { + // get + var json = {}; + + json.elements = {}; + eles.forEach(function (ele) { + var group = ele.group(); + + if (!json.elements[group]) { + json.elements[group] = []; + } + + json.elements[group].push(ele.json()); + }); + + if (this._private.styleEnabled) { + json.style = cy.style().json(); + } + + json.zoomingEnabled = cy._private.zoomingEnabled; + json.userZoomingEnabled = cy._private.userZoomingEnabled; + json.zoom = cy._private.zoom; + json.minZoom = cy._private.minZoom; + json.maxZoom = cy._private.maxZoom; + json.panningEnabled = cy._private.panningEnabled; + json.userPanningEnabled = cy._private.userPanningEnabled; + json.pan = util.copy(cy._private.pan); + json.boxSelectionEnabled = cy._private.boxSelectionEnabled; + json.renderer = util.copy(cy._private.options.renderer); + json.hideEdgesOnViewport = cy._private.options.hideEdgesOnViewport; + json.textureOnViewport = cy._private.options.textureOnViewport; + json.wheelSensitivity = cy._private.options.wheelSensitivity; + json.motionBlur = cy._private.options.motionBlur; + + return json; + } + }, + + scratch: define.data({ + field: 'scratch', + bindingEvent: 'scratch', + allowBinding: true, + allowSetting: true, + settingEvent: 'scratch', + settingTriggersEvent: true, + triggerFnName: 'trigger', + allowGetting: true + }), + + removeScratch: define.removeData({ + field: 'scratch', + event: 'scratch', + triggerFnName: 'trigger', + triggerEvent: true + }) + +}); + +corefn.$id = corefn.getElementById; + +[__webpack_require__(69), __webpack_require__(70), __webpack_require__(78), __webpack_require__(79), __webpack_require__(80), __webpack_require__(81), __webpack_require__(82), __webpack_require__(83), __webpack_require__(84), __webpack_require__(93)].forEach(function (props) { + util.extend(corefn, props); +}); + +module.exports = Core; + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function memoize(fn, keyFn) { + if (!keyFn) { + keyFn = function keyFn() { + if (arguments.length === 1) { + return arguments[0]; + } else if (arguments.length === 0) { + return 'undefined'; + } + + var args = []; + + for (var i = 0; i < arguments.length; i++) { + args.push(arguments[i]); + } + + return args.join('$'); + }; + } + + var memoizedFn = function memoizedFn() { + var self = this; + var args = arguments; + var ret = void 0; + var k = keyFn.apply(self, args); + var cache = memoizedFn.cache; + + if (!(ret = cache[k])) { + ret = cache[k] = fn.apply(self, args); + } + + return ret; + }; + + memoizedFn.cache = {}; + + return memoizedFn; +}; + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var is = __webpack_require__(0); +var Set = __webpack_require__(8); + +// represents a node or an edge +var Element = function Element(cy, params, restore) { + restore = restore === undefined || restore ? true : false; + + if (cy === undefined || params === undefined || !is.core(cy)) { + util.error('An element must have a core reference and parameters set'); + return; + } + + var group = params.group; + + // try to automatically infer the group if unspecified + if (group == null) { + if (params.data && params.data.source != null && params.data.target != null) { + group = 'edges'; + } else { + group = 'nodes'; + } + } + + // validate group + if (group !== 'nodes' && group !== 'edges') { + util.error('An element must be of type `nodes` or `edges`; you specified `' + group + '`'); + return; + } + + // make the element array-like, just like a collection + this.length = 1; + this[0] = this; + + // NOTE: when something is added here, add also to ele.json() + var _p = this._private = { + cy: cy, + single: true, // indicates this is an element + data: params.data || {}, // data object + position: params.position || {}, // (x, y) position pair + autoWidth: undefined, // width and height of nodes calculated by the renderer when set to special 'auto' value + autoHeight: undefined, + autoPadding: undefined, + compoundBoundsClean: false, // whether the compound dimensions need to be recalculated the next time dimensions are read + listeners: [], // array of bound listeners + group: group, // string; 'nodes' or 'edges' + style: {}, // properties as set by the style + rstyle: {}, // properties for style sent from the renderer to the core + styleCxts: [], // applied style contexts from the styler + removed: true, // whether it's inside the vis; true if removed (set true here since we call restore) + selected: params.selected ? true : false, // whether it's selected + selectable: params.selectable === undefined ? true : params.selectable ? true : false, // whether it's selectable + locked: params.locked ? true : false, // whether the element is locked (cannot be moved) + grabbed: false, // whether the element is grabbed by the mouse; renderer sets this privately + grabbable: params.grabbable === undefined ? true : params.grabbable ? true : false, // whether the element can be grabbed + active: false, // whether the element is active from user interaction + classes: new Set(), // map ( className => true ) + animation: { // object for currently-running animations + current: [], + queue: [] + }, + rscratch: {}, // object in which the renderer can store information + scratch: params.scratch || {}, // scratch objects + edges: [], // array of connected edges + children: [], // array of children + parent: null, // parent ref + traversalCache: {}, // cache of output of traversal functions + backgrounding: false // whether background images are loading + }; + + // renderedPosition overrides if specified + if (params.renderedPosition) { + var rpos = params.renderedPosition; + var pan = cy.pan(); + var zoom = cy.zoom(); + + _p.position = { + x: (rpos.x - pan.x) / zoom, + y: (rpos.y - pan.y) / zoom + }; + } + + if (is.string(params.classes)) { + var classes = params.classes.split(/\s+/); + for (var i = 0, l = classes.length; i < l; i++) { + var cls = classes[i]; + if (!cls || cls === '') { + continue; + } + + _p.classes.add(cls); + } + } + + if (params.style || params.css) { + cy.style().applyBypass(this, params.style || params.css); + } + + this.createEmitter(); + + if (restore === undefined || restore) { + this.restore(); + } +}; + +module.exports = Element; + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); + +var stateSelectors = [{ + selector: ':selected', + matches: function matches(ele) { + return ele.selected(); + } +}, { + selector: ':unselected', + matches: function matches(ele) { + return !ele.selected(); + } +}, { + selector: ':selectable', + matches: function matches(ele) { + return ele.selectable(); + } +}, { + selector: ':unselectable', + matches: function matches(ele) { + return !ele.selectable(); + } +}, { + selector: ':locked', + matches: function matches(ele) { + return ele.locked(); + } +}, { + selector: ':unlocked', + matches: function matches(ele) { + return !ele.locked(); + } +}, { + selector: ':visible', + matches: function matches(ele) { + return ele.visible(); + } +}, { + selector: ':hidden', + matches: function matches(ele) { + return !ele.visible(); + } +}, { + selector: ':transparent', + matches: function matches(ele) { + return ele.transparent(); + } +}, { + selector: ':grabbed', + matches: function matches(ele) { + return ele.grabbed(); + } +}, { + selector: ':free', + matches: function matches(ele) { + return !ele.grabbed(); + } +}, { + selector: ':removed', + matches: function matches(ele) { + return ele.removed(); + } +}, { + selector: ':inside', + matches: function matches(ele) { + return !ele.removed(); + } +}, { + selector: ':grabbable', + matches: function matches(ele) { + return ele.grabbable(); + } +}, { + selector: ':ungrabbable', + matches: function matches(ele) { + return !ele.grabbable(); + } +}, { + selector: ':animated', + matches: function matches(ele) { + return ele.animated(); + } +}, { + selector: ':unanimated', + matches: function matches(ele) { + return !ele.animated(); + } +}, { + selector: ':parent', + matches: function matches(ele) { + return ele.isParent(); + } +}, { + selector: ':childless', + matches: function matches(ele) { + return ele.isChildless(); + } +}, { + selector: ':child', + matches: function matches(ele) { + return ele.isChild(); + } +}, { + selector: ':orphan', + matches: function matches(ele) { + return ele.isOrphan(); + } +}, { + selector: ':nonorphan', + matches: function matches(ele) { + return ele.isChild(); + } +}, { + selector: ':loop', + matches: function matches(ele) { + return ele.isLoop(); + } +}, { + selector: ':simple', + matches: function matches(ele) { + return ele.isSimple(); + } +}, { + selector: ':active', + matches: function matches(ele) { + return ele.active(); + } +}, { + selector: ':inactive', + matches: function matches(ele) { + return !ele.active(); + } +}, { + selector: ':backgrounding', + matches: function matches(ele) { + return ele.backgrounding(); + } +}, { + selector: ':nonbackgrounding', + matches: function matches(ele) { + return !ele.backgrounding(); + } +}].sort(function (a, b) { + // n.b. selectors that are starting substrings of others must have the longer ones first + return util.sort.descending(a.selector, b.selector); +}); + +var stateSelectorMatches = function stateSelectorMatches(sel, ele) { + var lookup = stateSelectorMatches.lookup = stateSelectorMatches.lookup || function () { + var selToFn = {}; + var s = void 0; + + for (var i = 0; i < stateSelectors.length; i++) { + s = stateSelectors[i]; + + selToFn[s.selector] = s.matches; + } + + return selToFn; + }(); + + return lookup[sel](ele); +}; + +var stateSelectorRegex = '(' + stateSelectors.map(function (s) { + return s.selector; +}).join('|') + ')'; + +module.exports = { stateSelectors: stateSelectors, stateSelectorMatches: stateSelectorMatches, stateSelectorRegex: stateSelectorRegex }; + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/*! +Event object based on jQuery events, MIT license + +https://jquery.org/license/ +https://tldrlegal.com/license/mit-license +https://github.com/jquery/jquery/blob/master/src/event.js +*/ + +var Event = function Event(src, props) { + this.recycle(src, props); +}; + +function returnFalse() { + return false; +} + +function returnTrue() { + return true; +} + +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +Event.prototype = { + instanceString: function instanceString() { + return 'event'; + }, + + recycle: function recycle(src, props) { + this.isImmediatePropagationStopped = this.isPropagationStopped = this.isDefaultPrevented = returnFalse; + + if (src != null && src.preventDefault) { + // Browser Event object + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented ? returnTrue : returnFalse; + } else if (src != null && src.type) { + // Plain object containing all event details + props = src; + } else { + // Event string + this.type = src; + } + + // Put explicitly provided properties onto the event object + if (props != null) { + // more efficient to manually copy fields we use + this.originalEvent = props.originalEvent; + this.type = props.type != null ? props.type : this.type; + this.cy = props.cy; + this.target = props.target; + this.position = props.position; + this.renderedPosition = props.renderedPosition; + this.namespace = props.namespace; + this.layout = props.layout; + } + + if (this.cy != null && this.position != null && this.renderedPosition == null) { + // create a rendered position based on the passed position + var pos = this.position; + var zoom = this.cy.zoom(); + var pan = this.cy.pan(); + + this.renderedPosition = { + x: pos.x * zoom + pan.x, + y: pos.y * zoom + pan.y + }; + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || Date.now(); + }, + + preventDefault: function preventDefault() { + this.isDefaultPrevented = returnTrue; + + var e = this.originalEvent; + if (!e) { + return; + } + + // if preventDefault exists run it on the original event + if (e.preventDefault) { + e.preventDefault(); + } + }, + + stopPropagation: function stopPropagation() { + this.isPropagationStopped = returnTrue; + + var e = this.originalEvent; + if (!e) { + return; + } + + // if stopPropagation exists run it on the original event + if (e.stopPropagation) { + e.stopPropagation(); + } + }, + + stopImmediatePropagation: function stopImmediatePropagation() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; + +module.exports = Event; + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Elements are drawn in a specific order based on compound depth (low to high), the element type (nodes above edges), + * and z-index (low to high). These styles affect how this applies: + * + * z-compound-depth: May be `bottom | orphan | auto | top`. The first drawn is `bottom`, then `orphan` which is the + * same depth as the root of the compound graph, followed by the default value `auto` which draws in order from + * root to leaves of the compound graph. The last drawn is `top`. + * z-index-compare: May be `auto | manual`. The default value is `auto` which always draws edges under nodes. + * `manual` ignores this convention and draws based on the `z-index` value setting. + * z-index: An integer value that affects the relative draw order of elements. In general, an element with a higher + * `z-index` will be drawn on top of an element with a lower `z-index`. + */ +var util = __webpack_require__(1); + +var zIndexSort = function zIndexSort(a, b) { + var cy = a.cy(); + var hasCompoundNodes = cy.hasCompoundNodes(); + + function getDepth(ele) { + var style = ele.pstyle('z-compound-depth'); + if (style.value === 'auto') { + return hasCompoundNodes ? ele.zDepth() : 0; + } else if (style.value === 'bottom') { + return -1; + } else if (style.value === 'top') { + return util.MAX_INT; + } + // 'orphan' + return 0; + } + var depthDiff = getDepth(a) - getDepth(b); + if (depthDiff !== 0) { + return depthDiff; + } + + function getEleDepth(ele) { + var style = ele.pstyle('z-index-compare'); + if (style.value === 'auto') { + return ele.isNode() ? 1 : 0; + } + // 'manual' + return 0; + } + var eleDiff = getEleDepth(a) - getEleDepth(b); + if (eleDiff !== 0) { + return eleDiff; + } + + var zDiff = a.pstyle('z-index').value - b.pstyle('z-index').value; + if (zDiff !== 0) { + return zDiff; + } + // compare indices in the core (order added to graph w/ last on top) + return a.poolIndex() - b.poolIndex(); +}; + +module.exports = zIndexSort; + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var util = __webpack_require__(1); +var Selector = __webpack_require__(6); + +var Style = function Style(cy) { + + if (!(this instanceof Style)) { + return new Style(cy); + } + + if (!is.core(cy)) { + util.error('A style must have a core reference'); + return; + } + + this._private = { + cy: cy, + coreStyle: {} + }; + + this.length = 0; + + this.resetToDefault(); +}; + +var styfn = Style.prototype; + +styfn.instanceString = function () { + return 'style'; +}; + +// remove all contexts +styfn.clear = function () { + for (var i = 0; i < this.length; i++) { + this[i] = undefined; + } + this.length = 0; + + var _p = this._private; + + _p.newStyle = true; + + return this; // chaining +}; + +styfn.resetToDefault = function () { + this.clear(); + this.addDefaultStylesheet(); + + return this; +}; + +// builds a style object for the 'core' selector +styfn.core = function () { + return this._private.coreStyle; +}; + +// create a new context from the specified selector string and switch to that context +styfn.selector = function (selectorStr) { + // 'core' is a special case and does not need a selector + var selector = selectorStr === 'core' ? null : new Selector(selectorStr); + + var i = this.length++; // new context means new index + this[i] = { + selector: selector, + properties: [], + mappedProperties: [], + index: i + }; + + return this; // chaining +}; + +// add one or many css rules to the current context +styfn.css = function () { + var self = this; + var args = arguments; + + switch (args.length) { + case 1: + var map = args[0]; + + for (var i = 0; i < self.properties.length; i++) { + var prop = self.properties[i]; + var mapVal = map[prop.name]; + + if (mapVal === undefined) { + mapVal = map[util.dash2camel(prop.name)]; + } + + if (mapVal !== undefined) { + this.cssRule(prop.name, mapVal); + } + } + + break; + + case 2: + this.cssRule(args[0], args[1]); + break; + + default: + break; // do nothing if args are invalid + } + + return this; // chaining +}; +styfn.style = styfn.css; + +// add a single css rule to the current context +styfn.cssRule = function (name, value) { + // name-value pair + var property = this.parse(name, value); + + // add property to current context if valid + if (property) { + var i = this.length - 1; + this[i].properties.push(property); + this[i].properties[property.name] = property; // allow access by name as well + + if (property.name.match(/pie-(\d+)-background-size/) && property.value) { + this._private.hasPie = true; + } + + if (property.mapped) { + this[i].mappedProperties.push(property); + } + + // add to core style if necessary + var currentSelectorIsCore = !this[i].selector; + if (currentSelectorIsCore) { + this._private.coreStyle[property.name] = property; + } + } + + return this; // chaining +}; + +styfn.append = function (style) { + if (is.stylesheet(style)) { + style.appendToStyle(this); + } else if (is.array(style)) { + this.appendFromJson(style); + } else if (is.string(style)) { + this.appendFromString(style); + } // you probably wouldn't want to append a Style, since you'd duplicate the default parts + + return this; +}; + +// static function +Style.fromJson = function (cy, json) { + var style = new Style(cy); + + style.fromJson(json); + + return style; +}; + +Style.fromString = function (cy, string) { + return new Style(cy).fromString(string); +}; + +[__webpack_require__(85), __webpack_require__(86), __webpack_require__(87), __webpack_require__(88), __webpack_require__(89), __webpack_require__(90), __webpack_require__(91), __webpack_require__(92)].forEach(function (props) { + util.extend(styfn, props); +}); + +Style.types = styfn.types; +Style.properties = styfn.properties; + +module.exports = Style; + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); + +var fullFpsTime = 1000 / 60; // assume 60 frames per second + +module.exports = { + setupDequeueing: function setupDequeueing(opts) { + return function setupDequeueingImpl() { + var self = this; + var r = this.renderer; + + if (self.dequeueingSetup) { + return; + } else { + self.dequeueingSetup = true; + } + + var queueRedraw = util.debounce(function () { + r.redrawHint('eles', true); + r.redrawHint('drag', true); + + r.redraw(); + }, opts.deqRedrawThreshold); + + var dequeue = function dequeue(willDraw, frameStartTime) { + var startTime = util.performanceNow(); + var avgRenderTime = r.averageRedrawTime; + var renderTime = r.lastRedrawTime; + var deqd = []; + var extent = r.cy.extent(); + var pixelRatio = r.getPixelRatio(); + + while (true) { + var now = util.performanceNow(); + var duration = now - startTime; + var frameDuration = now - frameStartTime; + + if (renderTime < fullFpsTime) { + // if we're rendering faster than the ideal fps, then do dequeueing + // during all of the remaining frame time + + var timeAvailable = fullFpsTime - (willDraw ? avgRenderTime : 0); + + if (frameDuration >= opts.deqFastCost * timeAvailable) { + break; + } + } else { + if (willDraw) { + if (duration >= opts.deqCost * renderTime || duration >= opts.deqAvgCost * avgRenderTime) { + break; + } + } else if (frameDuration >= opts.deqNoDrawCost * fullFpsTime) { + break; + } + } + + var thisDeqd = opts.deq(self, pixelRatio, extent); + + if (thisDeqd.length > 0) { + for (var i = 0; i < thisDeqd.length; i++) { + deqd.push(thisDeqd[i]); + } + } else { + break; + } + } + + // callbacks on dequeue + if (deqd.length > 0) { + opts.onDeqd(self, deqd); + + if (!willDraw && opts.shouldRedraw(self, deqd, pixelRatio, extent)) { + queueRedraw(); + } + } + }; + + var priority = opts.priority || util.noop; + + r.beforeRender(dequeue, priority(self)); + }; + } +}; + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var Core = __webpack_require__(12); +var extension = __webpack_require__(94); +var Stylesheet = __webpack_require__(136); + +var cytoscape = function cytoscape(options) { + // jshint ignore:line + // if no options specified, use default + if (options === undefined) { + options = {}; + } + + // create instance + if (is.plainObject(options)) { + return new Core(options); + } + + // allow for registration of extensions + else if (is.string(options)) { + return extension.apply(extension, arguments); + } +}; + +// e.g. cytoscape.use( require('cytoscape-foo'), bar ) +cytoscape.use = function (ext) { + var args = Array.prototype.slice.call(arguments, 1); // args to pass to ext + + args.unshift(cytoscape); // cytoscape is first arg to ext + + ext.apply(null, args); + + return this; +}; + +// replaced by build system +cytoscape.version = __webpack_require__(137); + +// expose public apis (mostly for extensions) +cytoscape.stylesheet = cytoscape.Stylesheet = Stylesheet; + +module.exports = cytoscape; + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); + +module.exports = { + // get [r, g, b] from #abc or #aabbcc + hex2tuple: function hex2tuple(hex) { + if (!(hex.length === 4 || hex.length === 7) || hex[0] !== '#') { + return; + } + + var shortHex = hex.length === 4; + var r = void 0, + g = void 0, + b = void 0; + var base = 16; + + if (shortHex) { + r = parseInt(hex[1] + hex[1], base); + g = parseInt(hex[2] + hex[2], base); + b = parseInt(hex[3] + hex[3], base); + } else { + r = parseInt(hex[1] + hex[2], base); + g = parseInt(hex[3] + hex[4], base); + b = parseInt(hex[5] + hex[6], base); + } + + return [r, g, b]; + }, + + // get [r, g, b, a] from hsl(0, 0, 0) or hsla(0, 0, 0, 0) + hsl2tuple: function hsl2tuple(hsl) { + var ret = void 0; + var h = void 0, + s = void 0, + l = void 0, + a = void 0, + r = void 0, + g = void 0, + b = void 0; + function hue2rgb(p, q, t) { + if (t < 0) t += 1; + if (t > 1) t -= 1; + if (t < 1 / 6) return p + (q - p) * 6 * t; + if (t < 1 / 2) return q; + if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6; + return p; + } + + var m = new RegExp('^' + this.regex.hsla + '$').exec(hsl); + if (m) { + + // get hue + h = parseInt(m[1]); + if (h < 0) { + h = (360 - -1 * h % 360) % 360; + } else if (h > 360) { + h = h % 360; + } + h /= 360; // normalise on [0, 1] + + s = parseFloat(m[2]); + if (s < 0 || s > 100) { + return; + } // saturation is [0, 100] + s = s / 100; // normalise on [0, 1] + + l = parseFloat(m[3]); + if (l < 0 || l > 100) { + return; + } // lightness is [0, 100] + l = l / 100; // normalise on [0, 1] + + a = m[4]; + if (a !== undefined) { + a = parseFloat(a); + + if (a < 0 || a > 1) { + return; + } // alpha is [0, 1] + } + + // now, convert to rgb + // code from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript + if (s === 0) { + r = g = b = Math.round(l * 255); // achromatic + } else { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + r = Math.round(255 * hue2rgb(p, q, h + 1 / 3)); + g = Math.round(255 * hue2rgb(p, q, h)); + b = Math.round(255 * hue2rgb(p, q, h - 1 / 3)); + } + + ret = [r, g, b, a]; + } + + return ret; + }, + + // get [r, g, b, a] from rgb(0, 0, 0) or rgba(0, 0, 0, 0) + rgb2tuple: function rgb2tuple(rgb) { + var ret = void 0; + + var m = new RegExp('^' + this.regex.rgba + '$').exec(rgb); + if (m) { + ret = []; + + var isPct = []; + for (var i = 1; i <= 3; i++) { + var channel = m[i]; + + if (channel[channel.length - 1] === '%') { + isPct[i] = true; + } + channel = parseFloat(channel); + + if (isPct[i]) { + channel = channel / 100 * 255; // normalise to [0, 255] + } + + if (channel < 0 || channel > 255) { + return; + } // invalid channel value + + ret.push(Math.floor(channel)); + } + + var atLeastOneIsPct = isPct[1] || isPct[2] || isPct[3]; + var allArePct = isPct[1] && isPct[2] && isPct[3]; + if (atLeastOneIsPct && !allArePct) { + return; + } // must all be percent values if one is + + var alpha = m[4]; + if (alpha !== undefined) { + alpha = parseFloat(alpha); + + if (alpha < 0 || alpha > 1) { + return; + } // invalid alpha value + + ret.push(alpha); + } + } + + return ret; + }, + + colorname2tuple: function colorname2tuple(color) { + return this.colors[color.toLowerCase()]; + }, + + color2tuple: function color2tuple(color) { + return (is.array(color) ? color : null) || this.colorname2tuple(color) || this.hex2tuple(color) || this.rgb2tuple(color) || this.hsl2tuple(color); + }, + + colors: { + // special colour names + transparent: [0, 0, 0, 0], // NB alpha === 0 + + // regular colours + aliceblue: [240, 248, 255], + antiquewhite: [250, 235, 215], + aqua: [0, 255, 255], + aquamarine: [127, 255, 212], + azure: [240, 255, 255], + beige: [245, 245, 220], + bisque: [255, 228, 196], + black: [0, 0, 0], + blanchedalmond: [255, 235, 205], + blue: [0, 0, 255], + blueviolet: [138, 43, 226], + brown: [165, 42, 42], + burlywood: [222, 184, 135], + cadetblue: [95, 158, 160], + chartreuse: [127, 255, 0], + chocolate: [210, 105, 30], + coral: [255, 127, 80], + cornflowerblue: [100, 149, 237], + cornsilk: [255, 248, 220], + crimson: [220, 20, 60], + cyan: [0, 255, 255], + darkblue: [0, 0, 139], + darkcyan: [0, 139, 139], + darkgoldenrod: [184, 134, 11], + darkgray: [169, 169, 169], + darkgreen: [0, 100, 0], + darkgrey: [169, 169, 169], + darkkhaki: [189, 183, 107], + darkmagenta: [139, 0, 139], + darkolivegreen: [85, 107, 47], + darkorange: [255, 140, 0], + darkorchid: [153, 50, 204], + darkred: [139, 0, 0], + darksalmon: [233, 150, 122], + darkseagreen: [143, 188, 143], + darkslateblue: [72, 61, 139], + darkslategray: [47, 79, 79], + darkslategrey: [47, 79, 79], + darkturquoise: [0, 206, 209], + darkviolet: [148, 0, 211], + deeppink: [255, 20, 147], + deepskyblue: [0, 191, 255], + dimgray: [105, 105, 105], + dimgrey: [105, 105, 105], + dodgerblue: [30, 144, 255], + firebrick: [178, 34, 34], + floralwhite: [255, 250, 240], + forestgreen: [34, 139, 34], + fuchsia: [255, 0, 255], + gainsboro: [220, 220, 220], + ghostwhite: [248, 248, 255], + gold: [255, 215, 0], + goldenrod: [218, 165, 32], + gray: [128, 128, 128], + grey: [128, 128, 128], + green: [0, 128, 0], + greenyellow: [173, 255, 47], + honeydew: [240, 255, 240], + hotpink: [255, 105, 180], + indianred: [205, 92, 92], + indigo: [75, 0, 130], + ivory: [255, 255, 240], + khaki: [240, 230, 140], + lavender: [230, 230, 250], + lavenderblush: [255, 240, 245], + lawngreen: [124, 252, 0], + lemonchiffon: [255, 250, 205], + lightblue: [173, 216, 230], + lightcoral: [240, 128, 128], + lightcyan: [224, 255, 255], + lightgoldenrodyellow: [250, 250, 210], + lightgray: [211, 211, 211], + lightgreen: [144, 238, 144], + lightgrey: [211, 211, 211], + lightpink: [255, 182, 193], + lightsalmon: [255, 160, 122], + lightseagreen: [32, 178, 170], + lightskyblue: [135, 206, 250], + lightslategray: [119, 136, 153], + lightslategrey: [119, 136, 153], + lightsteelblue: [176, 196, 222], + lightyellow: [255, 255, 224], + lime: [0, 255, 0], + limegreen: [50, 205, 50], + linen: [250, 240, 230], + magenta: [255, 0, 255], + maroon: [128, 0, 0], + mediumaquamarine: [102, 205, 170], + mediumblue: [0, 0, 205], + mediumorchid: [186, 85, 211], + mediumpurple: [147, 112, 219], + mediumseagreen: [60, 179, 113], + mediumslateblue: [123, 104, 238], + mediumspringgreen: [0, 250, 154], + mediumturquoise: [72, 209, 204], + mediumvioletred: [199, 21, 133], + midnightblue: [25, 25, 112], + mintcream: [245, 255, 250], + mistyrose: [255, 228, 225], + moccasin: [255, 228, 181], + navajowhite: [255, 222, 173], + navy: [0, 0, 128], + oldlace: [253, 245, 230], + olive: [128, 128, 0], + olivedrab: [107, 142, 35], + orange: [255, 165, 0], + orangered: [255, 69, 0], + orchid: [218, 112, 214], + palegoldenrod: [238, 232, 170], + palegreen: [152, 251, 152], + paleturquoise: [175, 238, 238], + palevioletred: [219, 112, 147], + papayawhip: [255, 239, 213], + peachpuff: [255, 218, 185], + peru: [205, 133, 63], + pink: [255, 192, 203], + plum: [221, 160, 221], + powderblue: [176, 224, 230], + purple: [128, 0, 128], + red: [255, 0, 0], + rosybrown: [188, 143, 143], + royalblue: [65, 105, 225], + saddlebrown: [139, 69, 19], + salmon: [250, 128, 114], + sandybrown: [244, 164, 96], + seagreen: [46, 139, 87], + seashell: [255, 245, 238], + sienna: [160, 82, 45], + silver: [192, 192, 192], + skyblue: [135, 206, 235], + slateblue: [106, 90, 205], + slategray: [112, 128, 144], + slategrey: [112, 128, 144], + snow: [255, 250, 250], + springgreen: [0, 255, 127], + steelblue: [70, 130, 180], + tan: [210, 180, 140], + teal: [0, 128, 128], + thistle: [216, 191, 216], + tomato: [255, 99, 71], + turquoise: [64, 224, 208], + violet: [238, 130, 238], + wheat: [245, 222, 179], + white: [255, 255, 255], + whitesmoke: [245, 245, 245], + yellow: [255, 255, 0], + yellowgreen: [154, 205, 50] + } +}; + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); + +module.exports = { + // has anything been set in the map + mapEmpty: function mapEmpty(map) { + var empty = true; + + if (map != null) { + return Object.keys(map).length === 0; + } + + return empty; + }, + + // pushes to the array at the end of a map (map may not be built) + pushMap: function pushMap(options) { + var array = this.getMap(options); + + if (array == null) { + // if empty, put initial array + this.setMap(this.extend({}, options, { + value: [options.value] + })); + } else { + array.push(options.value); + } + }, + + // sets the value in a map (map may not be built) + setMap: function setMap(options) { + var obj = options.map; + var key = void 0; + var keys = options.keys; + var l = keys.length; + + for (var i = 0; i < l; i++) { + var _key = keys[i]; + + if (is.plainObject(_key)) { + this.error('Tried to set map with object key'); + } + + if (i < keys.length - 1) { + + // extend the map if necessary + if (obj[_key] == null) { + obj[_key] = {}; + } + + obj = obj[_key]; + } else { + // set the value + obj[_key] = options.value; + } + } + }, + + // gets the value in a map even if it's not built in places + getMap: function getMap(options) { + var obj = options.map; + var keys = options.keys; + var l = keys.length; + + for (var i = 0; i < l; i++) { + var key = keys[i]; + + if (is.plainObject(key)) { + this.error('Tried to get map with object key'); + } + + obj = obj[key]; + + if (obj == null) { + return obj; + } + } + + return obj; + }, + + // deletes the entry in the map + deleteMap: function deleteMap(options) { + var obj = options.map; + var keys = options.keys; + var l = keys.length; + var keepChildren = options.keepChildren; + + for (var i = 0; i < l; i++) { + var key = keys[i]; + + if (is.plainObject(key)) { + this.error('Tried to delete map with object key'); + } + + var lastKey = i === options.keys.length - 1; + if (lastKey) { + + if (keepChildren) { + // then only delete child fields not in keepChildren + var children = Object.keys(obj); + + for (var j = 0; j < children.length; j++) { + var child = children[j]; + + if (!keepChildren[child]) { + obj[child] = undefined; + } + } + } else { + obj[key] = undefined; + } + } else { + obj = obj[key]; + } + } + } +}; + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var number = '(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))'; + +var rgba = 'rgb[a]?\\((' + number + '[%]?)\\s*,\\s*(' + number + '[%]?)\\s*,\\s*(' + number + '[%]?)(?:\\s*,\\s*(' + number + '))?\\)'; +var rgbaNoBackRefs = 'rgb[a]?\\((?:' + number + '[%]?)\\s*,\\s*(?:' + number + '[%]?)\\s*,\\s*(?:' + number + '[%]?)(?:\\s*,\\s*(?:' + number + '))?\\)'; + +var hsla = 'hsl[a]?\\((' + number + ')\\s*,\\s*(' + number + '[%])\\s*,\\s*(' + number + '[%])(?:\\s*,\\s*(' + number + '))?\\)'; +var hslaNoBackRefs = 'hsl[a]?\\((?:' + number + ')\\s*,\\s*(?:' + number + '[%])\\s*,\\s*(?:' + number + '[%])(?:\\s*,\\s*(?:' + number + '))?\\)'; + +var hex3 = '\\#[0-9a-fA-F]{3}'; +var hex6 = '\\#[0-9a-fA-F]{6}'; + +module.exports = { + regex: { + number: number, + rgba: rgba, + rgbaNoBackRefs: rgbaNoBackRefs, + hsla: hsla, + hslaNoBackRefs: hslaNoBackRefs, + hex3: hex3, + hex6: hex6 + } +}; + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var memoize = __webpack_require__(13); +var is = __webpack_require__(0); + +module.exports = { + + camel2dash: memoize(function (str) { + return str.replace(/([A-Z])/g, function (v) { + return '-' + v.toLowerCase(); + }); + }), + + dash2camel: memoize(function (str) { + return str.replace(/(-\w)/g, function (v) { + return v[1].toUpperCase(); + }); + }), + + prependCamel: memoize(function (prefix, str) { + return prefix + str[0].toUpperCase() + str.substring(1); + }, function (prefix, str) { + return prefix + '$' + str; + }), + + capitalize: function capitalize(str) { + if (is.emptyString(str)) { + return str; + } + + return str.charAt(0).toUpperCase() + str.substring(1); + } + +}; + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var window = __webpack_require__(3); +var performance = window ? window.performance : null; + +var util = {}; + +var pnow = performance && performance.now ? function () { + return performance.now(); +} : function () { + return Date.now(); +}; + +var raf = function () { + if (window) { + if (window.requestAnimationFrame) { + return function (fn) { + window.requestAnimationFrame(fn); + }; + } else if (window.mozRequestAnimationFrame) { + return function (fn) { + window.mozRequestAnimationFrame(fn); + }; + } else if (window.webkitRequestAnimationFrame) { + return function (fn) { + window.webkitRequestAnimationFrame(fn); + }; + } else if (window.msRequestAnimationFrame) { + return function (fn) { + window.msRequestAnimationFrame(fn); + }; + } + } + + return function (fn) { + if (fn) { + setTimeout(function () { + fn(pnow()); + }, 1000 / 60); + } + }; +}(); + +util.requestAnimationFrame = function (fn) { + raf(fn); +}; + +util.performanceNow = pnow; + +util.debounce = __webpack_require__(26); + +util.now = function () { + return Date.now(); +}; + +module.exports = util; + +/***/ }), +/* 26 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE_26__; + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function ascending(a, b) { + if (a < b) { + return -1; + } else if (a > b) { + return 1; + } else { + return 0; + } +} + +function descending(a, b) { + return -1 * ascending(a, b); +} + +module.exports = { + sort: { + ascending: ascending, + descending: descending + } +}; + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function ObjectMap() { + this._obj = {}; +} + +var p = ObjectMap.prototype; + +p.set = function (key, val) { + this._obj[key] = val; +}; + +p.delete = function (key) { + this._obj[key] = null; +}; + +p.has = function (key) { + return this._obj[key] != null; +}; + +p.get = function (key) { + return this._obj[key]; +}; + +// TODO use the stdlib Map in future... +// module.exports = typeof Map !== 'undefined' ? Map : ObjectMap; +module.exports = ObjectMap; + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); + +var elesfn = {}; + +[__webpack_require__(30), __webpack_require__(31), __webpack_require__(33), __webpack_require__(34), __webpack_require__(35), __webpack_require__(36), __webpack_require__(37), __webpack_require__(38), __webpack_require__(39), __webpack_require__(40), __webpack_require__(41)].forEach(function (props) { + util.extend(elesfn, props); +}); + +module.exports = elesfn; + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); + +var defineSearch = function defineSearch(params) { + params = { + bfs: params.bfs || !params.dfs, + dfs: params.dfs || !params.bfs + }; + + // from pseudocode on wikipedia + return function searchFn(roots, fn, directed) { + var options; + if (is.plainObject(roots) && !is.elementOrCollection(roots)) { + options = roots; + roots = options.roots || options.root; + fn = options.visit; + directed = options.directed; + } + + directed = arguments.length === 2 && !is.fn(fn) ? fn : directed; + fn = is.fn(fn) ? fn : function () {}; + + var cy = this._private.cy; + var v = roots = is.string(roots) ? this.filter(roots) : roots; + var Q = []; + var connectedNodes = []; + var connectedBy = {}; + var id2depth = {}; + var V = {}; + var j = 0; + var found; + var nodes = this.nodes(); + var edges = this.edges(); + + // enqueue v + for (var i = 0; i < v.length; i++) { + if (v[i].isNode()) { + Q.unshift(v[i]); + + if (params.bfs) { + V[v[i].id()] = true; + + connectedNodes.push(v[i]); + } + + id2depth[v[i].id()] = 0; + } + } + + while (Q.length !== 0) { + var v = params.bfs ? Q.shift() : Q.pop(); + + if (params.dfs) { + if (V[v.id()]) { + continue; + } + + V[v.id()] = true; + + connectedNodes.push(v); + } + + var depth = id2depth[v.id()]; + var prevEdge = connectedBy[v.id()]; + var prevNode = prevEdge == null ? undefined : prevEdge.connectedNodes().not(v)[0]; + var ret; + + ret = fn(v, prevEdge, prevNode, j++, depth); + + if (ret === true) { + found = v; + break; + } + + if (ret === false) { + break; + } + + var vwEdges = v.connectedEdges(directed ? function (ele) { + return ele.data('source') === v.id(); + } : undefined).intersect(edges); + for (var i = 0; i < vwEdges.length; i++) { + var e = vwEdges[i]; + var w = e.connectedNodes(function (n) { + return n.id() !== v.id(); + }).intersect(nodes); + + if (w.length !== 0 && !V[w.id()]) { + w = w[0]; + + Q.push(w); + + if (params.bfs) { + V[w.id()] = true; + + connectedNodes.push(w); + } + + connectedBy[w.id()] = e; + + id2depth[w.id()] = id2depth[v.id()] + 1; + } + } + } + + var connectedEles = []; + + for (var i = 0; i < connectedNodes.length; i++) { + var node = connectedNodes[i]; + var edge = connectedBy[node.id()]; + + if (edge) { + connectedEles.push(edge); + } + + connectedEles.push(node); + } + + return { + path: cy.collection(connectedEles, { unique: true }), + found: cy.collection(found) + }; + }; +}; + +// search, spanning trees, etc +var elesfn = { + breadthFirstSearch: defineSearch({ bfs: true }), + depthFirstSearch: defineSearch({ dfs: true }) +}; + +// nice, short mathemathical alias +elesfn.bfs = elesfn.breadthFirstSearch; +elesfn.dfs = elesfn.depthFirstSearch; + +module.exports = elesfn; + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var Heap = __webpack_require__(9); + +var elesfn = { + + dijkstra: function dijkstra(root, weightFn, directed) { + var options; + if (is.plainObject(root) && !is.elementOrCollection(root)) { + options = root; + root = options.root; + weightFn = options.weight; + directed = options.directed; + } + + var cy = this._private.cy; + weightFn = is.fn(weightFn) ? weightFn : function () { + return 1; + }; // if not specified, assume each edge has equal weight (1) + + var source = is.string(root) ? this.filter(root)[0] : root[0]; + var dist = {}; + var prev = {}; + var knownDist = {}; + + var edges = this.edges().filter(function (ele) { + return !ele.isLoop(); + }); + var nodes = this.nodes(); + + var getDist = function getDist(node) { + return dist[node.id()]; + }; + + var setDist = function setDist(node, d) { + dist[node.id()] = d; + + Q.updateItem(node); + }; + + var Q = new Heap(function (a, b) { + return getDist(a) - getDist(b); + }); + + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + + dist[node.id()] = node.same(source) ? 0 : Infinity; + Q.push(node); + } + + var distBetween = function distBetween(u, v) { + var uvs = (directed ? u.edgesTo(v) : u.edgesWith(v)).intersect(edges); + var smallestDistance = Infinity; + var smallestEdge; + + for (var i = 0; i < uvs.length; i++) { + var edge = uvs[i]; + var weight = weightFn(edge); + + if (weight < smallestDistance || !smallestEdge) { + smallestDistance = weight; + smallestEdge = edge; + } + } + + return { + edge: smallestEdge, + dist: smallestDistance + }; + }; + + while (Q.size() > 0) { + var u = Q.pop(); + var smalletsDist = getDist(u); + var uid = u.id(); + + knownDist[uid] = smalletsDist; + + if (smalletsDist === Infinity) { + continue; + } + + var neighbors = u.neighborhood().intersect(nodes); + for (var i = 0; i < neighbors.length; i++) { + var v = neighbors[i]; + var vid = v.id(); + var vDist = distBetween(u, v); + + var alt = smalletsDist + vDist.dist; + + if (alt < getDist(v)) { + setDist(v, alt); + + prev[vid] = { + node: u, + edge: vDist.edge + }; + } + } // for + } // while + + return { + distanceTo: function distanceTo(node) { + var target = is.string(node) ? nodes.filter(node)[0] : node[0]; + + return knownDist[target.id()]; + }, + + pathTo: function pathTo(node) { + var target = is.string(node) ? nodes.filter(node)[0] : node[0]; + var S = []; + var u = target; + + if (target.length > 0) { + S.unshift(target); + + while (prev[u.id()]) { + var p = prev[u.id()]; + + S.unshift(p.edge); + S.unshift(p.node); + + u = p.node; + } + } + + return cy.collection(S); + } + }; + } +}; + +module.exports = elesfn; + +/***/ }), +/* 32 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE_32__; + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); + +// search, spanning trees, etc +var elesfn = { + + // kruskal's algorithm (finds min spanning tree, assuming undirected graph) + // implemented from pseudocode from wikipedia + kruskal: function kruskal(weightFn) { + var cy = this.cy(); + + weightFn = is.fn(weightFn) ? weightFn : function () { + return 1; + }; // if not specified, assume each edge has equal weight (1) + + function findSet(ele) { + for (var i = 0; i < forest.length; i++) { + var eles = forest[i]; + + if (eles.anySame(ele)) { + return { + eles: eles, + index: i + }; + } + } + } + + var A = cy.collection(cy, []); + var forest = []; + var nodes = this.nodes(); + + for (var i = 0; i < nodes.length; i++) { + forest.push(nodes[i].collection()); + } + + var edges = this.edges(); + var S = edges.toArray().sort(function (a, b) { + var weightA = weightFn(a); + var weightB = weightFn(b); + + return weightA - weightB; + }); + + for (var i = 0; i < S.length; i++) { + var edge = S[i]; + var u = edge.source()[0]; + var v = edge.target()[0]; + var setU = findSet(u); + var setV = findSet(v); + + if (setU.index !== setV.index) { + A = A.add(edge); + + // combine forests for u and v + forest[setU.index] = setU.eles.add(setV.eles); + forest.splice(setV.index, 1); + } + } + + return nodes.add(A); + } +}; + +module.exports = elesfn; + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); + +var elesfn = { + + // Implemented from pseudocode from wikipedia + aStar: function aStar(options) { + var eles = this; + + options = options || {}; + + // Reconstructs the path from Start to End, acumulating the result in pathAcum + var reconstructPath = function reconstructPath(start, end, cameFromMap, pathAcum) { + // Base case + if (start == end) { + pathAcum.unshift(cy.getElementById(end)); + return pathAcum; + } + + if (end in cameFromMap) { + // We know which node is before the last one + var previous = cameFromMap[end]; + var previousEdge = cameFromEdge[end]; + + pathAcum.unshift(cy.getElementById(previousEdge)); + pathAcum.unshift(cy.getElementById(end)); + + return reconstructPath(start, previous, cameFromMap, pathAcum); + } + + // We should not reach here! + return undefined; + }; + + // Returns the index of the element in openSet which has minimum fScore + var findMin = function findMin(openSet, fScore) { + if (openSet.length === 0) { + // Should never be the case + return undefined; + } + var minPos = 0; + var tempScore = fScore[openSet[0]]; + for (var i = 1; i < openSet.length; i++) { + var s = fScore[openSet[i]]; + if (s < tempScore) { + tempScore = s; + minPos = i; + } + } + return minPos; + }; + + var cy = this._private.cy; + + // root - mandatory! + if (options != null && options.root != null) { + var source = is.string(options.root) ? + // use it as a selector, e.g. "#rootID + this.filter(options.root)[0] : options.root[0]; + } else { + return undefined; + } + + // goal - mandatory! + if (options.goal != null) { + var target = is.string(options.goal) ? + // use it as a selector, e.g. "#goalID + this.filter(options.goal)[0] : options.goal[0]; + } else { + return undefined; + } + + // Heuristic function - optional + if (options.heuristic != null && is.fn(options.heuristic)) { + var heuristic = options.heuristic; + } else { + var heuristic = function heuristic() { + return 0; + }; // use constant if unspecified + } + + // Weight function - optional + if (options.weight != null && is.fn(options.weight)) { + var weightFn = options.weight; + } else { + // If not specified, assume each edge has equal weight (1) + var weightFn = function weightFn(e) { + return 1; + }; + } + + // directed - optional + if (options.directed != null) { + var directed = options.directed; + } else { + var directed = false; + } + + var sid = source.id(); + var tid = target.id(); + + var closedSet = []; + var openSet = [sid]; + var cameFrom = {}; + var cameFromEdge = {}; + var gScore = {}; + var fScore = {}; + + gScore[sid] = 0; + fScore[sid] = heuristic(source); + + // Counter + var steps = 0; + + // Main loop + while (openSet.length > 0) { + var minPos = findMin(openSet, fScore); + var cMin = cy.getElementById(openSet[minPos]); + var cMinId = cMin.id(); + steps++; + + // If we've found our goal, then we are done + if (cMinId == tid) { + var rPath = reconstructPath(sid, tid, cameFrom, []); + + return { + found: true, + distance: gScore[cMinId], + path: eles.spawn(rPath), + steps: steps + }; + } + + // Add cMin to processed nodes + closedSet.push(cMinId); + // Remove cMin from boundary nodes + openSet.splice(minPos, 1); + + // Update scores for neighbors of cMin + // Take into account if graph is directed or not + var vwEdges = cMin._private.edges; + + for (var i = 0; i < vwEdges.length; i++) { + var e = vwEdges[i]; + + // edge must be in set of calling eles + if (!this.hasElementWithId(e.id())) { + continue; + } + + // cMin must be the source of edge if directed + if (directed && e.data('source') !== cMinId) { + continue; + } + + var wSrc = e.source(); + var wTgt = e.target(); + + var w = wSrc.id() !== cMinId ? wSrc : wTgt; + var wid = w.id(); + + // node must be in set of calling eles + if (!this.hasElementWithId(wid)) { + continue; + } + + // if node is in closedSet, ignore it + if (closedSet.indexOf(wid) != -1) { + continue; + } + + // New tentative score for node w + var tempScore = gScore[cMinId] + weightFn(e); + + // Update gScore for node w if: + // w not present in openSet + // OR + // tentative gScore is less than previous value + + // w not in openSet + if (openSet.indexOf(wid) == -1) { + gScore[wid] = tempScore; + fScore[wid] = tempScore + heuristic(w); + openSet.push(wid); // Add node to openSet + cameFrom[wid] = cMinId; + cameFromEdge[wid] = e.id(); + continue; + } + // w already in openSet, but with greater gScore + if (tempScore < gScore[wid]) { + gScore[wid] = tempScore; + fScore[wid] = tempScore + heuristic(w); + cameFrom[wid] = cMinId; + } + } // End of neighbors update + } // End of main loop + + // If we've reached here, then we've not reached our goal + return { + found: false, + distance: undefined, + path: undefined, + steps: steps + }; + } + +}; // elesfn + + +module.exports = elesfn; + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); + +var elesfn = { + + // Implemented from pseudocode from wikipedia + floydWarshall: function floydWarshall(options) { + options = options || {}; + + var cy = this.cy(); + + // Weight function - optional + if (options.weight != null && is.fn(options.weight)) { + var weightFn = options.weight; + } else { + // If not specified, assume each edge has equal weight (1) + var weightFn = function weightFn(e) { + return 1; + }; + } + + // directed - optional + if (options.directed != null) { + var directed = options.directed; + } else { + var directed = false; + } + + var edges = this.edges().stdFilter(function (e) { + return !e.isLoop(); + }); + var nodes = this.nodes(); + var numNodes = nodes.length; + + // mapping: node id -> position in nodes array + var id2position = {}; + for (var i = 0; i < numNodes; i++) { + id2position[nodes[i].id()] = i; + } + + // Initialize distance matrix + var dist = []; + for (var i = 0; i < numNodes; i++) { + var newRow = new Array(numNodes); + for (var j = 0; j < numNodes; j++) { + if (i == j) { + newRow[j] = 0; + } else { + newRow[j] = Infinity; + } + } + dist.push(newRow); + } + + // Initialize matrix used for path reconstruction + // Initialize distance matrix + var next = []; + var edgeNext = []; + + var initMatrix = function initMatrix(next) { + for (var i = 0; i < numNodes; i++) { + var newRow = new Array(numNodes); + for (var j = 0; j < numNodes; j++) { + newRow[j] = undefined; + } + next.push(newRow); + } + }; + + initMatrix(next); + initMatrix(edgeNext); + + // Process edges + for (var i = 0; i < edges.length; i++) { + var sourceIndex = id2position[edges[i].source().id()]; + var targetIndex = id2position[edges[i].target().id()]; + var weight = weightFn(edges[i]); + + // Check if already process another edge between same 2 nodes + if (dist[sourceIndex][targetIndex] > weight) { + dist[sourceIndex][targetIndex] = weight; + next[sourceIndex][targetIndex] = targetIndex; + edgeNext[sourceIndex][targetIndex] = edges[i]; + } + } + + // If undirected graph, process 'reversed' edges + if (!directed) { + for (var i = 0; i < edges.length; i++) { + var sourceIndex = id2position[edges[i].target().id()]; + var targetIndex = id2position[edges[i].source().id()]; + var weight = weightFn(edges[i]); + + // Check if already process another edge between same 2 nodes + if (dist[sourceIndex][targetIndex] > weight) { + dist[sourceIndex][targetIndex] = weight; + next[sourceIndex][targetIndex] = targetIndex; + edgeNext[sourceIndex][targetIndex] = edges[i]; + } + } + } + + // Main loop + for (var k = 0; k < numNodes; k++) { + for (var i = 0; i < numNodes; i++) { + for (var j = 0; j < numNodes; j++) { + if (dist[i][k] + dist[k][j] < dist[i][j]) { + dist[i][j] = dist[i][k] + dist[k][j]; + next[i][j] = next[i][k]; + } + } + } + } + + // Build result object + var position2id = []; + for (var i = 0; i < numNodes; i++) { + position2id.push(nodes[i].id()); + } + + var res = { + distance: function distance(from, to) { + if (is.string(from)) { + // from is a selector string + var fromId = cy.filter(from)[0].id(); + } else { + // from is a node + var fromId = from.id(); + } + + if (is.string(to)) { + // to is a selector string + var toId = cy.filter(to)[0].id(); + } else { + // to is a node + var toId = to.id(); + } + + return dist[id2position[fromId]][id2position[toId]]; + }, + + path: function path(from, to) { + var reconstructPathAux = function reconstructPathAux(from, to, next, position2id, edgeNext) { + if (from === to) { + return cy.getElementById(position2id[from]); + } + if (next[from][to] === undefined) { + return undefined; + } + + var path = [cy.getElementById(position2id[from])]; + var prev = from; + while (from !== to) { + prev = from; + from = next[from][to]; + + var edge = edgeNext[prev][from]; + path.push(edge); + + path.push(cy.getElementById(position2id[from])); + } + return path; + }; + + if (is.string(from)) { + // from is a selector string + var fromId = cy.filter(from)[0].id(); + } else { + // from is a node + var fromId = from.id(); + } + + if (is.string(to)) { + // to is a selector string + var toId = cy.filter(to)[0].id(); + } else { + // to is a node + var toId = to.id(); + } + + var pathArr = reconstructPathAux(id2position[fromId], id2position[toId], next, position2id, edgeNext); + + return cy.collection(pathArr); + } + }; + + return res; + } // floydWarshall + +}; // elesfn + +module.exports = elesfn; + +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var util = __webpack_require__(1); + +var elesfn = { + + // Implemented from pseudocode from wikipedia + bellmanFord: function bellmanFord(options) { + var eles = this; + + options = options || {}; + + // Weight function - optional + if (options.weight != null && is.fn(options.weight)) { + var weightFn = options.weight; + } else { + // If not specified, assume each edge has equal weight (1) + var weightFn = function weightFn(e) { + return 1; + }; + } + + // directed - optional + if (options.directed != null) { + var directed = options.directed; + } else { + var directed = false; + } + + // root - mandatory! + if (options.root != null) { + if (is.string(options.root)) { + // use it as a selector, e.g. "#rootID + var source = this.filter(options.root)[0]; + } else { + var source = options.root[0]; + } + } else { + return undefined; + } + + var cy = this._private.cy; + var edges = this.edges().stdFilter(function (e) { + return !e.isLoop(); + }); + var nodes = this.nodes(); + var numNodes = nodes.length; + + // mapping: node id -> position in nodes array + var id2position = {}; + for (var i = 0; i < numNodes; i++) { + id2position[nodes[i].id()] = i; + } + + // Initializations + var cost = []; + var predecessor = []; + var predEdge = []; + + for (var i = 0; i < numNodes; i++) { + if (nodes[i].id() === source.id()) { + cost[i] = 0; + } else { + cost[i] = Infinity; + } + predecessor[i] = undefined; + } + + // Edges relaxation + var flag = false; + for (var i = 1; i < numNodes; i++) { + flag = false; + for (var e = 0; e < edges.length; e++) { + var sourceIndex = id2position[edges[e].source().id()]; + var targetIndex = id2position[edges[e].target().id()]; + var weight = weightFn(edges[e]); + + var temp = cost[sourceIndex] + weight; + if (temp < cost[targetIndex]) { + cost[targetIndex] = temp; + predecessor[targetIndex] = sourceIndex; + predEdge[targetIndex] = edges[e]; + flag = true; + } + + // If undirected graph, we need to take into account the 'reverse' edge + if (!directed) { + var temp = cost[targetIndex] + weight; + if (temp < cost[sourceIndex]) { + cost[sourceIndex] = temp; + predecessor[sourceIndex] = targetIndex; + predEdge[sourceIndex] = edges[e]; + flag = true; + } + } + } + + if (!flag) { + break; + } + } + + if (flag) { + // Check for negative weight cycles + for (var e = 0; e < edges.length; e++) { + var sourceIndex = id2position[edges[e].source().id()]; + var targetIndex = id2position[edges[e].target().id()]; + var weight = weightFn(edges[e]); + + if (cost[sourceIndex] + weight < cost[targetIndex]) { + util.error('Graph contains a negative weight cycle for Bellman-Ford'); + return { pathTo: undefined, + distanceTo: undefined, + hasNegativeWeightCycle: true }; + } + } + } + + // Build result object + var position2id = []; + for (var i = 0; i < numNodes; i++) { + position2id.push(nodes[i].id()); + } + + var res = { + distanceTo: function distanceTo(to) { + if (is.string(to)) { + // to is a selector string + var toId = cy.filter(to)[0].id(); + } else { + // to is a node + var toId = to.id(); + } + + return cost[id2position[toId]]; + }, + + pathTo: function pathTo(to) { + + var reconstructPathAux = function reconstructPathAux(predecessor, fromPos, toPos, position2id, acumPath, predEdge) { + for (;;) { + // Add toId to path + acumPath.push(cy.getElementById(position2id[toPos])); + acumPath.push(predEdge[toPos]); + + if (fromPos === toPos) { + // reached starting node + return acumPath; + } + + // If no path exists, discart acumulated path and return undefined + var predPos = predecessor[toPos]; + if (typeof predPos === 'undefined') { + return undefined; + } + + toPos = predPos; + } + }; + + if (is.string(to)) { + // to is a selector string + var toId = cy.filter(to)[0].id(); + } else { + // to is a node + var toId = to.id(); + } + var path = []; + + // This returns a reversed path + var res = reconstructPathAux(predecessor, id2position[source.id()], id2position[toId], position2id, path, predEdge); + + // Get it in the correct order and return it + if (res != null) { + res.reverse(); + } + + return eles.spawn(res); + }, + + hasNegativeWeightCycle: false + }; + + return res; + } // bellmanFord + +}; // elesfn + +module.exports = elesfn; + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); + +var elesfn = { + + // Computes the minimum cut of an undirected graph + // Returns the correct answer with high probability + kargerStein: function kargerStein(options) { + var eles = this; + + options = options || {}; + + // Function which colapses 2 (meta) nodes into one + // Updates the remaining edge lists + // Receives as a paramater the edge which causes the collapse + var colapse = function colapse(edgeIndex, nodeMap, remainingEdges) { + var edgeInfo = remainingEdges[edgeIndex]; + var sourceIn = edgeInfo[1]; + var targetIn = edgeInfo[2]; + var partition1 = nodeMap[sourceIn]; + var partition2 = nodeMap[targetIn]; + + // Delete all edges between partition1 and partition2 + var newEdges = remainingEdges.filter(function (edge) { + if (nodeMap[edge[1]] === partition1 && nodeMap[edge[2]] === partition2) { + return false; + } + if (nodeMap[edge[1]] === partition2 && nodeMap[edge[2]] === partition1) { + return false; + } + return true; + }); + + // All edges pointing to partition2 should now point to partition1 + for (var i = 0; i < newEdges.length; i++) { + var edge = newEdges[i]; + if (edge[1] === partition2) { + // Check source + newEdges[i] = edge.slice(0); + newEdges[i][1] = partition1; + } else if (edge[2] === partition2) { + // Check target + newEdges[i] = edge.slice(0); + newEdges[i][2] = partition1; + } + } + + // Move all nodes from partition2 to partition1 + for (var i = 0; i < nodeMap.length; i++) { + if (nodeMap[i] === partition2) { + nodeMap[i] = partition1; + } + } + + return newEdges; + }; + + // Contracts a graph until we reach a certain number of meta nodes + var contractUntil = function contractUntil(metaNodeMap, remainingEdges, size, sizeLimit) { + // Stop condition + if (size <= sizeLimit) { + return remainingEdges; + } + + // Choose an edge randomly + var edgeIndex = Math.floor(Math.random() * remainingEdges.length); + + // Colapse graph based on edge + var newEdges = colapse(edgeIndex, metaNodeMap, remainingEdges); + + return contractUntil(metaNodeMap, newEdges, size - 1, sizeLimit); + }; + + var cy = this._private.cy; + var edges = this.edges().stdFilter(function (e) { + return !e.isLoop(); + }); + var nodes = this.nodes(); + var numNodes = nodes.length; + var numEdges = edges.length; + var numIter = Math.ceil(Math.pow(Math.log(numNodes) / Math.LN2, 2)); + var stopSize = Math.floor(numNodes / Math.sqrt(2)); + + if (numNodes < 2) { + util.error('At least 2 nodes are required for Karger-Stein algorithm'); + return undefined; + } + + // Create numerical identifiers for each node + // mapping: node id -> position in nodes array + // for reverse mapping, simply use nodes array + var id2position = {}; + for (var i = 0; i < numNodes; i++) { + id2position[nodes[i].id()] = i; + } + + // Now store edge destination as indexes + // Format for each edge (edge index, source node index, target node index) + var edgeIndexes = []; + for (var i = 0; i < numEdges; i++) { + var e = edges[i]; + edgeIndexes.push([i, id2position[e.source().id()], id2position[e.target().id()]]); + } + + // We will store the best cut found here + var minCutSize = Infinity; + var minCut; + + // Initial meta node partition + var originalMetaNode = []; + for (var i = 0; i < numNodes; i++) { + originalMetaNode.push(i); + } + + // Main loop + for (var iter = 0; iter <= numIter; iter++) { + // Create new meta node partition + var metaNodeMap = originalMetaNode.slice(0); + + // Contract until stop point (stopSize nodes) + var edgesState = contractUntil(metaNodeMap, edgeIndexes, numNodes, stopSize); + + // Create a copy of the colapsed nodes state + var metaNodeMap2 = metaNodeMap.slice(0); + + // Run 2 iterations starting in the stop state + var res1 = contractUntil(metaNodeMap, edgesState, stopSize, 2); + var res2 = contractUntil(metaNodeMap2, edgesState, stopSize, 2); + + // Is any of the 2 results the best cut so far? + if (res1.length <= res2.length && res1.length < minCutSize) { + minCutSize = res1.length; + minCut = [res1, metaNodeMap]; + } else if (res2.length <= res1.length && res2.length < minCutSize) { + minCutSize = res2.length; + minCut = [res2, metaNodeMap2]; + } + } // end of main loop + + + // Construct result + var resEdges = minCut[0].map(function (e) { + return edges[e[0]]; + }); + var partition1 = []; + var partition2 = []; + + // traverse metaNodeMap for best cut + var witnessNodePartition = minCut[1][0]; + for (var i = 0; i < minCut[1].length; i++) { + var partitionId = minCut[1][i]; + if (partitionId === witnessNodePartition) { + partition1.push(nodes[i]); + } else { + partition2.push(nodes[i]); + } + } + + var ret = { + cut: eles.spawn(cy, resEdges), + partition1: eles.spawn(partition1), + partition2: eles.spawn(partition2) + }; + + return ret; + } +}; // elesfn + + +module.exports = elesfn; + +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); + +var elesfn = { + + pageRank: function pageRank(options) { + options = options || {}; + + var normalizeVector = function normalizeVector(vector) { + var length = vector.length; + + // First, get sum of all elements + var total = 0; + for (var i = 0; i < length; i++) { + total += vector[i]; + } + + // Now, divide each by the sum of all elements + for (var i = 0; i < length; i++) { + vector[i] = vector[i] / total; + } + }; + + // dampingFactor - optional + if (options != null && options.dampingFactor != null) { + var dampingFactor = options.dampingFactor; + } else { + var dampingFactor = 0.8; // Default damping factor + } + + // desired precision - optional + if (options != null && options.precision != null) { + var epsilon = options.precision; + } else { + var epsilon = 0.000001; // Default precision + } + + // Max number of iterations - optional + if (options != null && options.iterations != null) { + var numIter = options.iterations; + } else { + var numIter = 200; // Default number of iterations + } + + // Weight function - optional + if (options != null && options.weight != null && is.fn(options.weight)) { + var weightFn = options.weight; + } else { + // If not specified, assume each edge has equal weight (1) + var weightFn = function weightFn(e) { + return 1; + }; + } + + var cy = this._private.cy; + var edges = this.edges().stdFilter(function (e) { + return !e.isLoop(); + }); + var nodes = this.nodes(); + var numNodes = nodes.length; + var numEdges = edges.length; + + // Create numerical identifiers for each node + // mapping: node id -> position in nodes array + // for reverse mapping, simply use nodes array + var id2position = {}; + for (var i = 0; i < numNodes; i++) { + id2position[nodes[i].id()] = i; + } + + // Construct transposed adjacency matrix + // First lets have a zeroed matrix of the right size + // We'll also keep track of the sum of each column + var matrix = []; + var columnSum = []; + var additionalProb = (1 - dampingFactor) / numNodes; + + // Create null matric + for (var i = 0; i < numNodes; i++) { + var newRow = []; + for (var j = 0; j < numNodes; j++) { + newRow.push(0.0); + } + matrix.push(newRow); + columnSum.push(0.0); + } + + // Now, process edges + for (var i = 0; i < numEdges; i++) { + var edge = edges[i]; + var s = id2position[edge.source().id()]; + var t = id2position[edge.target().id()]; + var w = weightFn(edge); + + // Update matrix + matrix[t][s] += w; + + // Update column sum + columnSum[s] += w; + } + + // Add additional probability based on damping factor + // Also, take into account columns that have sum = 0 + var p = 1.0 / numNodes + additionalProb; // Shorthand + // Traverse matrix, column by column + for (var j = 0; j < numNodes; j++) { + if (columnSum[j] === 0) { + // No 'links' out from node jth, assume equal probability for each possible node + for (var i = 0; i < numNodes; i++) { + matrix[i][j] = p; + } + } else { + // Node jth has outgoing link, compute normalized probabilities + for (var i = 0; i < numNodes; i++) { + matrix[i][j] = matrix[i][j] / columnSum[j] + additionalProb; + } + } + } + + // Compute dominant eigenvector using power method + var eigenvector = []; + var nullVector = []; + var previous; + + // Start with a vector of all 1's + // Also, initialize a null vector which will be used as shorthand + for (var i = 0; i < numNodes; i++) { + eigenvector.push(1.0); + nullVector.push(0.0); + } + + for (var iter = 0; iter < numIter; iter++) { + // New array with all 0's + var temp = nullVector.slice(0); + + // Multiply matrix with previous result + for (var i = 0; i < numNodes; i++) { + for (var j = 0; j < numNodes; j++) { + temp[i] += matrix[i][j] * eigenvector[j]; + } + } + + normalizeVector(temp); + previous = eigenvector; + eigenvector = temp; + + var diff = 0; + // Compute difference (squared module) of both vectors + for (var i = 0; i < numNodes; i++) { + diff += Math.pow(previous[i] - eigenvector[i], 2); + } + + // If difference is less than the desired threshold, stop iterating + if (diff < epsilon) { + break; + } + } + + // Construct result + var res = { + rank: function rank(node) { + if (is.string(node)) { + // is a selector string + var nodeId = cy.filter(node)[0].id(); + } else { + // is a node object + var nodeId = node.id(); + } + return eigenvector[id2position[nodeId]]; + } + }; + + return res; + } // pageRank + +}; // elesfn + +module.exports = elesfn; + +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var util = __webpack_require__(1); + +var elesfn = { + + degreeCentralityNormalized: function degreeCentralityNormalized(options) { + options = options || {}; + + var cy = this.cy(); + + // directed - optional + if (options.directed != null) { + var directed = options.directed; + } else { + var directed = false; + } + + var nodes = this.nodes(); + var numNodes = nodes.length; + + if (!directed) { + var degrees = {}; + var maxDegree = 0; + + for (var i = 0; i < numNodes; i++) { + var node = nodes[i]; + // add current node to the current options object and call degreeCentrality + var currDegree = this.degreeCentrality(util.extend({}, options, { root: node })); + if (maxDegree < currDegree.degree) maxDegree = currDegree.degree; + + degrees[node.id()] = currDegree.degree; + } + + return { + degree: function degree(node) { + if (maxDegree == 0) return 0; + + if (is.string(node)) { + // from is a selector string + var node = cy.filter(node)[0].id(); + } else { + // from is a node + var node = node.id(); + } + + return degrees[node] / maxDegree; + } + }; + } else { + var indegrees = {}; + var outdegrees = {}; + var maxIndegree = 0; + var maxOutdegree = 0; + + for (var i = 0; i < numNodes; i++) { + var node = nodes[i]; + // add current node to the current options object and call degreeCentrality + var currDegree = this.degreeCentrality(util.extend({}, options, { root: node })); + + if (maxIndegree < currDegree.indegree) maxIndegree = currDegree.indegree; + + if (maxOutdegree < currDegree.outdegree) maxOutdegree = currDegree.outdegree; + + indegrees[node.id()] = currDegree.indegree; + outdegrees[node.id()] = currDegree.outdegree; + } + + return { + indegree: function indegree(node) { + if (maxIndegree == 0) return 0; + + if (is.string(node)) { + // from is a selector string + var node = cy.filter(node)[0].id(); + } else { + // from is a node + var node = node.id(); + } + + return indegrees[node] / maxIndegree; + }, + outdegree: function outdegree(node) { + if (maxOutdegree == 0) return 0; + + if (is.string(node)) { + // from is a selector string + var node = cy.filter(node)[0].id(); + } else { + // from is a node + var node = node.id(); + } + + return outdegrees[node] / maxOutdegree; + } + + }; + } + }, // degreeCentralityNormalized + + // Implemented from the algorithm in Opsahl's paper + // "Node centrality in weighted networks: Generalizing degree and shortest paths" + // check the heading 2 "Degree" + degreeCentrality: function degreeCentrality(options) { + options = options || {}; + + var callingEles = this; + + // root - mandatory! + if (options != null && options.root != null) { + var root = is.string(options.root) ? this.filter(options.root)[0] : options.root[0]; + } else { + return undefined; + } + + // weight - optional + if (options.weight != null && is.fn(options.weight)) { + var weightFn = options.weight; + } else { + // If not specified, assume each edge has equal weight (1) + var weightFn = function weightFn(e) { + return 1; + }; + } + + // directed - optional + if (options.directed != null) { + var directed = options.directed; + } else { + var directed = false; + } + + // alpha - optional + if (options.alpha != null && is.number(options.alpha)) { + var alpha = options.alpha; + } else { + alpha = 0; + } + + if (!directed) { + var connEdges = root.connectedEdges().intersection(callingEles); + var k = connEdges.length; + var s = 0; + + // Now, sum edge weights + for (var i = 0; i < connEdges.length; i++) { + var edge = connEdges[i]; + s += weightFn(edge); + } + + return { + degree: Math.pow(k, 1 - alpha) * Math.pow(s, alpha) + }; + } else { + var incoming = root.connectedEdges('edge[target = "' + root.id() + '"]').intersection(callingEles); + var outgoing = root.connectedEdges('edge[source = "' + root.id() + '"]').intersection(callingEles); + var k_in = incoming.length; + var k_out = outgoing.length; + var s_in = 0; + var s_out = 0; + + // Now, sum incoming edge weights + for (var i = 0; i < incoming.length; i++) { + var edge = incoming[i]; + s_in += weightFn(edge); + } + + // Now, sum outgoing edge weights + for (var i = 0; i < outgoing.length; i++) { + var edge = outgoing[i]; + s_out += weightFn(edge); + } + + return { + indegree: Math.pow(k_in, 1 - alpha) * Math.pow(s_in, alpha), + outdegree: Math.pow(k_out, 1 - alpha) * Math.pow(s_out, alpha) + }; + } + } // degreeCentrality + +}; // elesfn + +// nice, short mathemathical alias +elesfn.dc = elesfn.degreeCentrality; +elesfn.dcn = elesfn.degreeCentralityNormalised = elesfn.degreeCentralityNormalized; + +module.exports = elesfn; + +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); + +var elesfn = { + + closenessCentralityNormalized: function closenessCentralityNormalized(options) { + options = options || {}; + + var cy = this.cy(); + + var harmonic = options.harmonic; + if (harmonic === undefined) { + harmonic = true; + } + + var closenesses = {}; + var maxCloseness = 0; + var nodes = this.nodes(); + var fw = this.floydWarshall({ weight: options.weight, directed: options.directed }); + + // Compute closeness for every node and find the maximum closeness + for (var i = 0; i < nodes.length; i++) { + var currCloseness = 0; + for (var j = 0; j < nodes.length; j++) { + if (i != j) { + var d = fw.distance(nodes[i], nodes[j]); + + if (harmonic) { + currCloseness += 1 / d; + } else { + currCloseness += d; + } + } + } + + if (!harmonic) { + currCloseness = 1 / currCloseness; + } + + if (maxCloseness < currCloseness) { + maxCloseness = currCloseness; + } + + closenesses[nodes[i].id()] = currCloseness; + } + + return { + closeness: function closeness(node) { + if (maxCloseness == 0) { + return 0; + } + + if (is.string(node)) { + // from is a selector string + var node = cy.filter(node)[0].id(); + } else { + // from is a node + var node = node.id(); + } + + return closenesses[node] / maxCloseness; + } + }; + }, + + // Implemented from pseudocode from wikipedia + closenessCentrality: function closenessCentrality(options) { + options = options || {}; + + // root - mandatory! + if (options.root != null) { + if (is.string(options.root)) { + // use it as a selector, e.g. "#rootID + var root = this.filter(options.root)[0]; + } else { + var root = options.root[0]; + } + } else { + return undefined; + } + + // weight - optional + if (options.weight != null && is.fn(options.weight)) { + var weight = options.weight; + } else { + var weight = function weight() { + return 1; + }; + } + + // directed - optional + if (options.directed != null && is.bool(options.directed)) { + var directed = options.directed; + } else { + var directed = false; + } + + var harmonic = options.harmonic; + if (harmonic === undefined) { + harmonic = true; + } + + // we need distance from this node to every other node + var dijkstra = this.dijkstra({ + root: root, + weight: weight, + directed: directed + }); + var totalDistance = 0; + + var nodes = this.nodes(); + for (var i = 0; i < nodes.length; i++) { + if (nodes[i].id() != root.id()) { + var d = dijkstra.distanceTo(nodes[i]); + + if (harmonic) { + totalDistance += 1 / d; + } else { + totalDistance += d; + } + } + } + + return harmonic ? totalDistance : 1 / totalDistance; + } // closenessCentrality + +}; // elesfn + +// nice, short mathemathical alias +elesfn.cc = elesfn.closenessCentrality; +elesfn.ccn = elesfn.closenessCentralityNormalised = elesfn.closenessCentralityNormalized; + +module.exports = elesfn; + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var Heap = __webpack_require__(9); + +var elesfn = { + + // Implemented from the algorithm in the paper "On Variants of Shortest-Path Betweenness Centrality and their Generic Computation" by Ulrik Brandes + betweennessCentrality: function betweennessCentrality(options) { + options = options || {}; + + // Weight - optional + var weighted, weightFn; + if (is.fn(options.weight)) { + weightFn = options.weight; + weighted = true; + } else { + weighted = false; + } + + // Directed - default false + var directed = options.directed != null ? options.directed : false; + + var cy = this._private.cy; + + // starting + var V = this.nodes(); + var A = {}; + var _C = {}; + var max = 0; + var C = { + set: function set(key, val) { + _C[key] = val; + + if (val > max) { + max = val; + } + }, + + get: function get(key) { + return _C[key]; + } + }; + + // A contains the neighborhoods of every node + for (var i = 0; i < V.length; i++) { + var v = V[i]; + var vid = v.id(); + + if (directed) { + A[vid] = v.outgoers().nodes(); // get outgoers of every node + } else { + A[vid] = v.openNeighborhood().nodes(); // get neighbors of every node + } + + C.set(vid, 0); + } + + for (var s = 0; s < V.length; s++) { + var sid = V[s].id(); + var S = []; // stack + var P = {}; + var g = {}; + var d = {}; + var Q = new Heap(function (a, b) { + return d[a] - d[b]; + }); // queue + + // init dictionaries + for (var i = 0; i < V.length; i++) { + var vid = V[i].id(); + + P[vid] = []; + g[vid] = 0; + d[vid] = Infinity; + } + + g[sid] = 1; // sigma + d[sid] = 0; // distance to s + + Q.push(sid); + + while (!Q.empty()) { + var v = Q.pop(); + + S.push(v); + + if (weighted) { + for (var j = 0; j < A[v].length; j++) { + var w = A[v][j]; + var vEle = cy.getElementById(v); + + var edge; + if (vEle.edgesTo(w).length > 0) { + edge = vEle.edgesTo(w)[0]; + } else { + edge = w.edgesTo(vEle)[0]; + } + + var edgeWeight = weightFn(edge); + + w = w.id(); + + if (d[w] > d[v] + edgeWeight) { + d[w] = d[v] + edgeWeight; + + if (Q.nodes.indexOf(w) < 0) { + //if w is not in Q + Q.push(w); + } else { + // update position if w is in Q + Q.updateItem(w); + } + + g[w] = 0; + P[w] = []; + } + + if (d[w] == d[v] + edgeWeight) { + g[w] = g[w] + g[v]; + P[w].push(v); + } + } + } else { + for (var j = 0; j < A[v].length; j++) { + var w = A[v][j].id(); + + if (d[w] == Infinity) { + Q.push(w); + + d[w] = d[v] + 1; + } + + if (d[w] == d[v] + 1) { + g[w] = g[w] + g[v]; + P[w].push(v); + } + } + } + } + + var e = {}; + for (var i = 0; i < V.length; i++) { + e[V[i].id()] = 0; + } + + while (S.length > 0) { + var w = S.pop(); + + for (var j = 0; j < P[w].length; j++) { + var v = P[w][j]; + + e[v] = e[v] + g[v] / g[w] * (1 + e[w]); + + if (w != V[s].id()) { + C.set(w, C.get(w) + e[w]); + } + } + } + } + + var ret = { + betweenness: function betweenness(node) { + if (is.string(node)) { + var node = cy.filter(node).id(); + } else { + var node = node.id(); + } + + return C.get(node); + }, + + betweennessNormalized: function betweennessNormalized(node) { + if (max == 0) return 0; + + if (is.string(node)) { + var node = cy.filter(node).id(); + } else { + var node = node.id(); + } + + return C.get(node) / max; + } + }; + + // alias + ret.betweennessNormalised = ret.betweennessNormalized; + + return ret; + } // betweennessCentrality + +}; // elesfn + +// nice, short mathemathical alias +elesfn.bc = elesfn.betweennessCentrality; + +module.exports = elesfn; + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var define = __webpack_require__(4); + +var elesfn = { + animate: define.animate(), + animation: define.animation(), + animated: define.animated(), + clearQueue: define.clearQueue(), + delay: define.delay(), + delayAnimation: define.delayAnimation(), + stop: define.stop() +}; + +module.exports = elesfn; + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var Animation = __webpack_require__(44); +var math = __webpack_require__(2); +var is = __webpack_require__(0); + +var define = { + + animated: function animated() { + return function animatedImpl() { + var self = this; + var selfIsArrayLike = self.length !== undefined; + var all = selfIsArrayLike ? self : [self]; // put in array if not array-like + var cy = this._private.cy || this; + + if (!cy.styleEnabled()) { + return false; + } + + var ele = all[0]; + + if (ele) { + return ele._private.animation.current.length > 0; + } + }; + }, // animated + + clearQueue: function clearQueue() { + return function clearQueueImpl() { + var self = this; + var selfIsArrayLike = self.length !== undefined; + var all = selfIsArrayLike ? self : [self]; // put in array if not array-like + var cy = this._private.cy || this; + + if (!cy.styleEnabled()) { + return this; + } + + for (var i = 0; i < all.length; i++) { + var ele = all[i]; + ele._private.animation.queue = []; + } + + return this; + }; + }, // clearQueue + + delay: function delay() { + return function delayImpl(time, complete) { + var cy = this._private.cy || this; + + if (!cy.styleEnabled()) { + return this; + } + + return this.animate({ + delay: time, + duration: time, + complete: complete + }); + }; + }, // delay + + delayAnimation: function delayAnimation() { + return function delayAnimationImpl(time, complete) { + var cy = this._private.cy || this; + + if (!cy.styleEnabled()) { + return this; + } + + return this.animation({ + delay: time, + duration: time, + complete: complete + }); + }; + }, // delay + + animation: function animation() { + return function animationImpl(properties, params) { + var self = this; + var selfIsArrayLike = self.length !== undefined; + var all = selfIsArrayLike ? self : [self]; // put in array if not array-like + var cy = this._private.cy || this; + var isCore = !selfIsArrayLike; + var isEles = !isCore; + + if (!cy.styleEnabled()) { + return this; + } + + var style = cy.style(); + + properties = util.assign({}, properties, params); + + var propertiesEmpty = Object.keys(properties).length === 0; + + if (propertiesEmpty) { + return new Animation(all[0], properties); // nothing to animate + } + + if (properties.duration === undefined) { + properties.duration = 400; + } + + switch (properties.duration) { + case 'slow': + properties.duration = 600; + break; + case 'fast': + properties.duration = 200; + break; + } + + if (isEles) { + properties.style = style.getPropsList(properties.style || properties.css); + + properties.css = undefined; + } + + if (isEles && properties.renderedPosition != null) { + var rpos = properties.renderedPosition; + var pan = cy.pan(); + var zoom = cy.zoom(); + + properties.position = math.renderedToModelPosition(rpos, zoom, pan); + } + + // override pan w/ panBy if set + if (isCore && properties.panBy != null) { + var panBy = properties.panBy; + var cyPan = cy.pan(); + + properties.pan = { + x: cyPan.x + panBy.x, + y: cyPan.y + panBy.y + }; + } + + // override pan w/ center if set + var center = properties.center || properties.centre; + if (isCore && center != null) { + var centerPan = cy.getCenterPan(center.eles, properties.zoom); + + if (centerPan != null) { + properties.pan = centerPan; + } + } + + // override pan & zoom w/ fit if set + if (isCore && properties.fit != null) { + var fit = properties.fit; + var fitVp = cy.getFitViewport(fit.eles || fit.boundingBox, fit.padding); + + if (fitVp != null) { + properties.pan = fitVp.pan; + properties.zoom = fitVp.zoom; + } + } + + // override zoom (& potentially pan) w/ zoom obj if set + if (isCore && is.plainObject(properties.zoom)) { + var vp = cy.getZoomedViewport(properties.zoom); + + if (vp != null) { + if (vp.zoomed) { + properties.zoom = vp.zoom; + } + + if (vp.panned) { + properties.pan = vp.pan; + } + } + } + + return new Animation(all[0], properties); + }; + }, // animate + + animate: function animate() { + return function animateImpl(properties, params) { + var self = this; + var selfIsArrayLike = self.length !== undefined; + var all = selfIsArrayLike ? self : [self]; // put in array if not array-like + var cy = this._private.cy || this; + + if (!cy.styleEnabled()) { + return this; + } + + if (params) { + properties = util.extend({}, properties, params); + } + + // manually hook and run the animation + for (var i = 0; i < all.length; i++) { + var ele = all[i]; + var queue = ele.animated() && (properties.queue === undefined || properties.queue); + + var ani = ele.animation(properties, queue ? { queue: true } : undefined); + + ani.play(); + } + + return this; // chaining + }; + }, // animate + + stop: function stop() { + return function stopImpl(clearQueue, jumpToEnd) { + var self = this; + var selfIsArrayLike = self.length !== undefined; + var all = selfIsArrayLike ? self : [self]; // put in array if not array-like + var cy = this._private.cy || this; + + if (!cy.styleEnabled()) { + return this; + } + + for (var i = 0; i < all.length; i++) { + var ele = all[i]; + var _p = ele._private; + var anis = _p.animation.current; + + for (var j = 0; j < anis.length; j++) { + var ani = anis[j]; + var ani_p = ani._private; + + if (jumpToEnd) { + // next iteration of the animation loop, the animation + // will go straight to the end and be removed + ani_p.duration = 0; + } + } + + // clear the queue of future animations + if (clearQueue) { + _p.animation.queue = []; + } + + if (!jumpToEnd) { + _p.animation.current = []; + } + } + + // we have to notify (the animation loop doesn't do it for us on `stop`) + cy.notify({ + eles: this, + type: 'draw' + }); + + return this; + }; + } // stop + +}; // define + +module.exports = define; + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var is = __webpack_require__(0); +var Promise = __webpack_require__(5); + +var Animation = function Animation(target, opts, opts2) { + var _p = this._private = util.extend({ + duration: 1000 + }, opts, opts2); + + _p.target = target; + _p.style = _p.style || _p.css; + _p.started = false; + _p.playing = false; + _p.hooked = false; + _p.applying = false; + _p.progress = 0; + _p.completes = []; + _p.frames = []; + + if (_p.complete && is.fn(_p.complete)) { + _p.completes.push(_p.complete); + } + + // for future timeline/animations impl + this.length = 1; + this[0] = this; +}; + +var anifn = Animation.prototype; + +util.extend(anifn, { + + instanceString: function instanceString() { + return 'animation'; + }, + + hook: function hook() { + var _p = this._private; + + if (!_p.hooked) { + // add to target's animation queue + var q = void 0; + var tAni = _p.target._private.animation; + if (_p.queue) { + q = tAni.queue; + } else { + q = tAni.current; + } + q.push(this); + + // add to the animation loop pool + if (is.elementOrCollection(_p.target)) { + _p.target.cy().addToAnimationPool(_p.target); + } + + _p.hooked = true; + } + + return this; + }, + + play: function play() { + var _p = this._private; + + // autorewind + if (_p.progress === 1) { + _p.progress = 0; + } + + _p.playing = true; + _p.started = false; // needs to be started by animation loop + _p.stopped = false; + + this.hook(); + + // the animation loop will start the animation... + + return this; + }, + + playing: function playing() { + return this._private.playing; + }, + + apply: function apply() { + var _p = this._private; + + _p.applying = true; + _p.started = false; // needs to be started by animation loop + _p.stopped = false; + + this.hook(); + + // the animation loop will apply the animation at this progress + + return this; + }, + + applying: function applying() { + return this._private.applying; + }, + + pause: function pause() { + var _p = this._private; + + _p.playing = false; + _p.started = false; + + return this; + }, + + stop: function stop() { + var _p = this._private; + + _p.playing = false; + _p.started = false; + _p.stopped = true; // to be removed from animation queues + + return this; + }, + + rewind: function rewind() { + return this.progress(0); + }, + + fastforward: function fastforward() { + return this.progress(1); + }, + + time: function time(t) { + var _p = this._private; + + if (t === undefined) { + return _p.progress * _p.duration; + } else { + return this.progress(t / _p.duration); + } + }, + + progress: function progress(p) { + var _p = this._private; + var wasPlaying = _p.playing; + + if (p === undefined) { + return _p.progress; + } else { + if (wasPlaying) { + this.pause(); + } + + _p.progress = p; + _p.started = false; + + if (wasPlaying) { + this.play(); + } + } + + return this; + }, + + completed: function completed() { + return this._private.progress === 1; + }, + + reverse: function reverse() { + var _p = this._private; + var wasPlaying = _p.playing; + + if (wasPlaying) { + this.pause(); + } + + _p.progress = 1 - _p.progress; + _p.started = false; + + var swap = function swap(a, b) { + var _pa = _p[a]; + + if (_pa == null) { + return; + } + + _p[a] = _p[b]; + _p[b] = _pa; + }; + + swap('zoom', 'startZoom'); + swap('pan', 'startPan'); + swap('position', 'startPosition'); + + // swap styles + if (_p.style) { + for (var i = 0; i < _p.style.length; i++) { + var prop = _p.style[i]; + var name = prop.name; + var startStyleProp = _p.startStyle[name]; + + _p.startStyle[name] = prop; + _p.style[i] = startStyleProp; + } + } + + if (wasPlaying) { + this.play(); + } + + return this; + }, + + promise: function promise(type) { + var _p = this._private; + + var arr = void 0; + + switch (type) { + case 'frame': + arr = _p.frames; + break; + default: + case 'complete': + case 'completed': + arr = _p.completes; + } + + return new Promise(function (resolve, reject) { + arr.push(function () { + resolve(); + }); + }); + } + +}); + +anifn.complete = anifn.completed; + +module.exports = Animation; + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +var util = __webpack_require__(1); +var is = __webpack_require__(0); + +var define = { + + // access data field + data: function data(params) { + var defaults = { + field: 'data', + bindingEvent: 'data', + allowBinding: false, + allowSetting: false, + allowGetting: false, + settingEvent: 'data', + settingTriggersEvent: false, + triggerFnName: 'trigger', + immutableKeys: {}, // key => true if immutable + updateStyle: false, + beforeGet: function beforeGet(self) {}, + beforeSet: function beforeSet(self, obj) {}, + onSet: function onSet(self) {}, + canSet: function canSet(self) { + return true; + } + }; + params = util.extend({}, defaults, params); + + return function dataImpl(name, value) { + var p = params; + var self = this; + var selfIsArrayLike = self.length !== undefined; + var all = selfIsArrayLike ? self : [self]; // put in array if not array-like + var single = selfIsArrayLike ? self[0] : self; + + // .data('foo', ...) + if (is.string(name)) { + // set or get property + + // .data('foo') + if (p.allowGetting && value === undefined) { + // get + + var ret = void 0; + if (single) { + p.beforeGet(single); + + ret = single._private[p.field][name]; + } + return ret; + + // .data('foo', 'bar') + } else if (p.allowSetting && value !== undefined) { + // set + var valid = !p.immutableKeys[name]; + if (valid) { + var change = _defineProperty({}, name, value); + + p.beforeSet(self, change); + + for (var i = 0, l = all.length; i < l; i++) { + var ele = all[i]; + + if (p.canSet(ele)) { + ele._private[p.field][name] = value; + } + } + + // update mappers if asked + if (p.updateStyle) { + self.updateStyle(); + } + + // call onSet callback + p.onSet(self); + + if (p.settingTriggersEvent) { + self[p.triggerFnName](p.settingEvent); + } + } + } + + // .data({ 'foo': 'bar' }) + } else if (p.allowSetting && is.plainObject(name)) { + // extend + var obj = name; + var k = void 0, + v = void 0; + var keys = Object.keys(obj); + + p.beforeSet(self, obj); + + for (var _i = 0; _i < keys.length; _i++) { + k = keys[_i]; + v = obj[k]; + + var _valid = !p.immutableKeys[k]; + if (_valid) { + for (var j = 0; j < all.length; j++) { + var _ele = all[j]; + + if (p.canSet(_ele)) { + _ele._private[p.field][k] = v; + } + } + } + } + + // update mappers if asked + if (p.updateStyle) { + self.updateStyle(); + } + + // call onSet callback + p.onSet(self); + + if (p.settingTriggersEvent) { + self[p.triggerFnName](p.settingEvent); + } + + // .data(function(){ ... }) + } else if (p.allowBinding && is.fn(name)) { + // bind to event + var fn = name; + self.on(p.bindingEvent, fn); + + // .data() + } else if (p.allowGetting && name === undefined) { + // get whole object + var _ret = void 0; + if (single) { + p.beforeGet(single); + + _ret = single._private[p.field]; + } + return _ret; + } + + return self; // maintain chainability + }; // function + }, // data + + // remove data field + removeData: function removeData(params) { + var defaults = { + field: 'data', + event: 'data', + triggerFnName: 'trigger', + triggerEvent: false, + immutableKeys: {} // key => true if immutable + }; + params = util.extend({}, defaults, params); + + return function removeDataImpl(names) { + var p = params; + var self = this; + var selfIsArrayLike = self.length !== undefined; + var all = selfIsArrayLike ? self : [self]; // put in array if not array-like + + // .removeData('foo bar') + if (is.string(names)) { + // then get the list of keys, and delete them + var keys = names.split(/\s+/); + var l = keys.length; + + for (var i = 0; i < l; i++) { + // delete each non-empty key + var key = keys[i]; + if (is.emptyString(key)) { + continue; + } + + var valid = !p.immutableKeys[key]; // not valid if immutable + if (valid) { + for (var i_a = 0, l_a = all.length; i_a < l_a; i_a++) { + all[i_a]._private[p.field][key] = undefined; + } + } + } + + if (p.triggerEvent) { + self[p.triggerFnName](p.event); + } + + // .removeData() + } else if (names === undefined) { + // then delete all keys + + for (var _i_a = 0, _l_a = all.length; _i_a < _l_a; _i_a++) { + var _privateFields = all[_i_a]._private[p.field]; + var _keys = Object.keys(_privateFields); + + for (var _i2 = 0; _i2 < _keys.length; _i2++) { + var _key = _keys[_i2]; + var validKeyToDelete = !p.immutableKeys[_key]; + + if (validKeyToDelete) { + _privateFields[_key] = undefined; + } + } + } + + if (p.triggerEvent) { + self[p.triggerFnName](p.event); + } + } + + return self; // maintain chaining + }; // function + } // removeData +}; // define + +module.exports = define; + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Promise = __webpack_require__(5); + +var define = { + + eventAliasesOn: function eventAliasesOn(proto) { + var p = proto; + + p.addListener = p.listen = p.bind = p.on; + p.unlisten = p.unbind = p.off = p.removeListener; + p.trigger = p.emit; + + // this is just a wrapper alias of .on() + p.pon = p.promiseOn = function (events, selector) { + var self = this; + var args = Array.prototype.slice.call(arguments, 0); + + return new Promise(function (resolve, reject) { + var callback = function callback(e) { + self.off.apply(self, offArgs); + + resolve(e); + }; + + var onArgs = args.concat([callback]); + var offArgs = onArgs.concat([]); + + self.on.apply(self, onArgs); + }); + }; + } + +}; // define + +module.exports = define; + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Set = __webpack_require__(8); + +var elesfn = { + classes: function classes(_classes) { + _classes = (_classes || '').match(/\S+/g) || []; + var self = this; + var changed = []; + var classesMap = new Set(_classes); + + // check and update each ele + + var _loop = function _loop(j) { + var ele = self[j]; + var _p = ele._private; + var eleClasses = _p.classes; + var changedEle = false; + + // check if ele has all of the passed classes + classesMap.forEach(function (cls) { + var eleHasClass = eleClasses.has(cls); + + if (!eleHasClass) { + changedEle = true; + } + }); + + // check if ele has classes outside of those passed + if (!changedEle) { + eleClasses.forEach(function (eleCls) { + var specdClass = classesMap.has(eleCls); + + if (!specdClass) { + changedEle = true; + } + }); + } + + if (changedEle) { + _p.classes = new Set(classesMap); + + changed.push(ele); + } + }; + + for (var j = 0; j < self.length; j++) { + _loop(j); + } + + // trigger update style on those eles that had class changes + if (changed.length > 0) { + this.spawn(changed).updateStyle().emit('class'); + } + + return self; + }, + + addClass: function addClass(classes) { + return this.toggleClass(classes, true); + }, + + hasClass: function hasClass(className) { + var ele = this[0]; + return ele != null && ele._private.classes.has(className); + }, + + toggleClass: function toggleClass(classesStr, toggle) { + var classes = classesStr.match(/\S+/g) || []; + var self = this; + var changed = []; // eles who had classes changed + + for (var i = 0, il = self.length; i < il; i++) { + var _ele = self[i]; + var _changedEle = false; + + for (var j = 0; j < classes.length; j++) { + var cls = classes[j]; + var _eleClasses = _ele._private.classes; + var hasClass = _eleClasses.has(cls); + var shouldAdd = toggle || toggle === undefined && !hasClass; + + if (shouldAdd) { + _eleClasses.add(cls); + + if (!hasClass && !_changedEle) { + changed.push(_ele); + _changedEle = true; + } + } else { + // then remove + _eleClasses.delete(cls); + + if (hasClass && !_changedEle) { + changed.push(_ele); + _changedEle = true; + } + } + } // for j classes + } // for i eles + + // trigger update style on those eles that had class changes + if (changed.length > 0) { + this.spawn(changed).updateStyle().emit('class'); + } + + return self; + }, + + removeClass: function removeClass(classes) { + return this.toggleClass(classes, false); + }, + + flashClass: function flashClass(classes, duration) { + var self = this; + + if (duration == null) { + duration = 250; + } else if (duration === 0) { + return self; // nothing to do really + } + + self.addClass(classes); + setTimeout(function () { + self.removeClass(classes); + }, duration); + + return self; + } +}; + +module.exports = elesfn; + +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var Selector = __webpack_require__(6); + +var elesfn = { + allAre: function allAre(selector) { + var selObj = new Selector(selector); + + return this.every(function (ele) { + return selObj.matches(ele); + }); + }, + + is: function is(selector) { + var selObj = new Selector(selector); + + return this.some(function (ele) { + return selObj.matches(ele); + }); + }, + + some: function some(fn, thisArg) { + for (var i = 0; i < this.length; i++) { + var ret = !thisArg ? fn(this[i], i, this) : fn.apply(thisArg, [this[i], i, this]); + + if (ret) { + return true; + } + } + + return false; + }, + + every: function every(fn, thisArg) { + for (var i = 0; i < this.length; i++) { + var ret = !thisArg ? fn(this[i], i, this) : fn.apply(thisArg, [this[i], i, this]); + + if (!ret) { + return false; + } + } + + return true; + }, + + same: function same(collection) { + collection = this.cy().collection(collection); + + // cheap extra check + if (this.length !== collection.length) { + return false; + } + + return this.every(function (ele) { + return collection.hasElementWithId(ele.id()); + }); + }, + + anySame: function anySame(collection) { + collection = this.cy().collection(collection); + + return this.some(function (ele) { + return collection.hasElementWithId(ele.id()); + }); + }, + + allAreNeighbors: function allAreNeighbors(collection) { + collection = this.cy().collection(collection); + + var nhood = this.neighborhood(); + + return collection.every(function (ele) { + return nhood.hasElementWithId(ele.id()); + }); + }, + + contains: function contains(collection) { + collection = this.cy().collection(collection); + + var self = this; + + return collection.every(function (ele) { + return self.hasElementWithId(ele.id()); + }); + } +}; + +elesfn.allAreNeighbours = elesfn.allAreNeighbors; +elesfn.has = elesfn.contains; + +module.exports = elesfn; + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var exprs = __webpack_require__(50); +var newQuery = __webpack_require__(10); + +// of all the expressions, find the first match in the remaining text +var consumeExpr = function consumeExpr(remaining) { + var expr = void 0; + var match = void 0; + var name = void 0; + + for (var j = 0; j < exprs.length; j++) { + var e = exprs[j]; + var n = e.name; + + var m = remaining.match(e.regexObj); + + if (m != null) { + match = m; + expr = e; + name = n; + + var consumed = m[0]; + remaining = remaining.substring(consumed.length); + + break; // we've consumed one expr, so we can return now + } + } + + return { + expr: expr, + match: match, + name: name, + remaining: remaining + }; +}; + +// consume all leading whitespace +var consumeWhitespace = function consumeWhitespace(remaining) { + var match = remaining.match(/^\s+/); + + if (match) { + var consumed = match[0]; + remaining = remaining.substring(consumed.length); + } + + return remaining; +}; + +var parse = function parse(selector) { + var self = this; + + var remaining = self._private.selectorText = selector; + + var currentQuery = self[0] = newQuery(); + self.length = 1; + + remaining = consumeWhitespace(remaining); // get rid of leading whitespace + + for (;;) { + var check = consumeExpr(remaining); + + if (check.expr == null) { + util.error('The selector `' + selector + '`is invalid'); + return false; + } else { + var args = check.match.slice(1); + + // let the token populate the selector object in currentQuery + var ret = check.expr.populate(self, currentQuery, args); + + if (ret === false) { + return false; // exit if population failed + } else if (ret != null) { + currentQuery = ret; // change the current query to be filled if the expr specifies + } + } + + remaining = check.remaining; + + // we're done when there's nothing left to parse + if (remaining.match(/^\s*$/)) { + break; + } + } + + // adjust references for subject + for (var j = 0; j < self.length; j++) { + var query = self[j]; + + if (query.subject != null) { + // go up the tree until we reach the subject + for (;;) { + if (query.subject === query) { + break; + } // done if subject is self + + if (query.parent != null) { + // swap parent/child reference + var parent = query.parent; + var child = query; + + child.parent = null; + parent.child = child; + + query = parent; // go up the tree + } else if (query.ancestor != null) { + // swap ancestor/descendant + var ancestor = query.ancestor; + var descendant = query; + + descendant.ancestor = null; + ancestor.descendant = descendant; + + query = ancestor; // go up the tree + } else if (query.source || query.target || query.connectedNodes) { + util.error('The selector `' + self.text() + '` can not contain a subject selector that applies to the source or target of an edge selector'); + return false; + } else { + util.error('When adjusting references for the selector `' + self.text() + '`, neither parent nor ancestor was found'); + return false; + } + } // for + + self[j] = query.subject; // subject should be the root query + } // if + } // for + + return true; // success +}; + +module.exports = { parse: parse }; + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _slicedToArray = function () { function sliceIterator(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"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _require = __webpack_require__(15), + stateSelectorRegex = _require.stateSelectorRegex; + +var tokens = __webpack_require__(51); +var util = __webpack_require__(1); +var newQuery = __webpack_require__(10); + +// when a token like a variable has escaped meta characters, we need to clean the backslashes out +// so that values get compared properly in Selector.filter() +var cleanMetaChars = function cleanMetaChars(str) { + return str.replace(new RegExp('\\\\(' + tokens.metaChar + ')', 'g'), function (match, $1) { + return $1; + }); +}; + +var replaceLastQuery = function replaceLastQuery(selector, examiningQuery, replacementQuery) { + if (examiningQuery === selector[selector.length - 1]) { + selector[selector.length - 1] = replacementQuery; + } +}; + +// NOTE: add new expression syntax here to have it recognised by the parser; +// - a query contains all adjacent (i.e. no separator in between) expressions; +// - the current query is stored in selector[i] --- you can use the reference to `this` in the populate function; +// - you need to check the query objects in Selector.filter() for it actually filter properly, but that's pretty straight forward +// - when you add something here, also add to Selector.toString() +var exprs = [{ + name: 'group', + query: true, + regex: '(' + tokens.group + ')', + populate: function populate(selector, query, _ref) { + var _ref2 = _slicedToArray(_ref, 1), + group = _ref2[0]; + + query.group = group === '*' ? group : group + 's'; + } +}, { + name: 'state', + query: true, + regex: stateSelectorRegex, + populate: function populate(selector, query, _ref3) { + var _ref4 = _slicedToArray(_ref3, 1), + state = _ref4[0]; + + query.colonSelectors.push(state); + } +}, { + name: 'id', + query: true, + regex: '\\#(' + tokens.id + ')', + populate: function populate(selector, query, _ref5) { + var _ref6 = _slicedToArray(_ref5, 1), + id = _ref6[0]; + + query.ids.push(cleanMetaChars(id)); + } +}, { + name: 'className', + query: true, + regex: '\\.(' + tokens.className + ')', + populate: function populate(selector, query, _ref7) { + var _ref8 = _slicedToArray(_ref7, 1), + className = _ref8[0]; + + query.classes.push(cleanMetaChars(className)); + } +}, { + name: 'dataExists', + query: true, + regex: '\\[\\s*(' + tokens.variable + ')\\s*\\]', + populate: function populate(selector, query, _ref9) { + var _ref10 = _slicedToArray(_ref9, 1), + variable = _ref10[0]; + + query.data.push({ + field: cleanMetaChars(variable) + }); + } +}, { + name: 'dataCompare', + query: true, + regex: '\\[\\s*(' + tokens.variable + ')\\s*(' + tokens.comparatorOp + ')\\s*(' + tokens.value + ')\\s*\\]', + populate: function populate(selector, query, _ref11) { + var _ref12 = _slicedToArray(_ref11, 3), + variable = _ref12[0], + comparatorOp = _ref12[1], + value = _ref12[2]; + + var valueIsString = new RegExp('^' + tokens.string + '$').exec(value) != null; + + if (valueIsString) { + value = value.substring(1, value.length - 1); + } else { + value = parseFloat(value); + } + + query.data.push({ + field: cleanMetaChars(variable), + operator: comparatorOp, + value: value + }); + } +}, { + name: 'dataBool', + query: true, + regex: '\\[\\s*(' + tokens.boolOp + ')\\s*(' + tokens.variable + ')\\s*\\]', + populate: function populate(selector, query, _ref13) { + var _ref14 = _slicedToArray(_ref13, 2), + boolOp = _ref14[0], + variable = _ref14[1]; + + query.data.push({ + field: cleanMetaChars(variable), + operator: boolOp + }); + } +}, { + name: 'metaCompare', + query: true, + regex: '\\[\\[\\s*(' + tokens.meta + ')\\s*(' + tokens.comparatorOp + ')\\s*(' + tokens.number + ')\\s*\\]\\]', + populate: function populate(selector, query, _ref15) { + var _ref16 = _slicedToArray(_ref15, 3), + meta = _ref16[0], + comparatorOp = _ref16[1], + number = _ref16[2]; + + query.meta.push({ + field: cleanMetaChars(meta), + operator: comparatorOp, + value: parseFloat(number) + }); + } +}, { + name: 'nextQuery', + separator: true, + regex: tokens.separator, + populate: function populate(selector) { + // go on to next query + var nextQuery = selector[selector.length++] = newQuery(); + selector.currentSubject = null; + + return nextQuery; + } +}, { + name: 'directedEdge', + separator: true, + regex: tokens.directedEdge, + populate: function populate(selector, query) { + var edgeQuery = newQuery(); + var source = query; + var target = newQuery(); + + edgeQuery.group = 'edges'; + edgeQuery.target = target; + edgeQuery.source = source; + edgeQuery.subject = selector.currentSubject; + + // the query in the selector should be the edge rather than the source + replaceLastQuery(selector, query, edgeQuery); + + // we're now populating the target query with expressions that follow + return target; + } +}, { + name: 'undirectedEdge', + separator: true, + regex: tokens.undirectedEdge, + populate: function populate(selector, query) { + var edgeQuery = newQuery(); + var source = query; + var target = newQuery(); + + edgeQuery.group = 'edges'; + edgeQuery.connectedNodes = [source, target]; + edgeQuery.subject = selector.currentSubject; + + // the query in the selector should be the edge rather than the source + replaceLastQuery(selector, query, edgeQuery); + + // we're now populating the target query with expressions that follow + return target; + } +}, { + name: 'child', + separator: true, + regex: tokens.child, + populate: function populate(selector, query) { + // this query is the parent of the following query + var childQuery = newQuery(); + childQuery.parent = query; + childQuery.subject = selector.currentSubject; + + // it's cheaper to compare children first and go up so replace the parent + replaceLastQuery(selector, query, childQuery); + + // we're now populating the child query with expressions that follow + return childQuery; + } +}, { + name: 'descendant', + separator: true, + regex: tokens.descendant, + populate: function populate(selector, query) { + // this query is the ancestor of the following query + var descendantQuery = newQuery(); + descendantQuery.ancestor = query; + descendantQuery.subject = selector.currentSubject; + + // it's cheaper to compare descendants first and go up so replace the ancestor + replaceLastQuery(selector, query, descendantQuery); + + // we're now populating the descendant query with expressions that follow + return descendantQuery; + } +}, { + name: 'subject', + modifier: true, + regex: tokens.subject, + populate: function populate(selector, query) { + if (selector.currentSubject != null && query.subject != query) { + util.error('Redefinition of subject in selector `' + selector.toString() + '`'); + return false; + } + + selector.currentSubject = query; + query.subject = query; + selector[selector.length - 1].subject = query; + } +}]; + +exprs.forEach(function (e) { + return e.regexObj = new RegExp('^' + e.regex); +}); + +module.exports = exprs; + +/***/ }), +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); + +// tokens in the query language +var tokens = { + metaChar: '[\\!\\"\\#\\$\\%\\&\\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]', // chars we need to escape in let names, etc + comparatorOp: '=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=', // binary comparison op (used in data selectors) + boolOp: '\\?|\\!|\\^', // boolean (unary) operators (used in data selectors) + string: '"(?:\\\\"|[^"])*"' + '|' + "'(?:\\\\'|[^'])*'", // string literals (used in data selectors) -- doublequotes | singlequotes + number: util.regex.number, // number literal (used in data selectors) --- e.g. 0.1234, 1234, 12e123 + meta: 'degree|indegree|outdegree', // allowed metadata fields (i.e. allowed functions to use from Collection) + separator: '\\s*,\\s*', // queries are separated by commas, e.g. edge[foo = 'bar'], node.someClass + descendant: '\\s+', + child: '\\s+>\\s+', + subject: '\\$', + group: 'node|edge|\\*', + directedEdge: '\\s+->\\s+', + undirectedEdge: '\\s+<->\\s+' +}; +tokens.variable = '(?:[\\w-]|(?:\\\\' + tokens.metaChar + '))+'; // a variable name +tokens.value = tokens.string + '|' + tokens.number; // a value literal, either a string or number +tokens.className = tokens.variable; // a class name (follows variable conventions) +tokens.id = tokens.variable; // an element id (follows variable conventions) + +(function () { + var ops = void 0, + op = void 0, + i = void 0; + + // add @ variants to comparatorOp + ops = tokens.comparatorOp.split('|'); + for (i = 0; i < ops.length; i++) { + op = ops[i]; + tokens.comparatorOp += '|@' + op; + } + + // add ! variants to comparatorOp + ops = tokens.comparatorOp.split('|'); + for (i = 0; i < ops.length; i++) { + op = ops[i]; + + if (op.indexOf('!') >= 0) { + continue; + } // skip ops that explicitly contain ! + if (op === '=') { + continue; + } // skip = b/c != is explicitly defined + + tokens.comparatorOp += '|\\!' + op; + } +})(); + +module.exports = tokens; + +/***/ }), +/* 52 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _require = __webpack_require__(15), + stateSelectorMatches = _require.stateSelectorMatches; + +var is = __webpack_require__(0); + +// generic checking for data/metadata +var operandsMatch = function operandsMatch(query, params) { + var allDataMatches = true; + for (var k = 0; k < query[params.name].length; k++) { + var data = query[params.name][k]; + var operator = data.operator; + var value = data.value; + var field = data.field; + var _matches = void 0; + var fieldVal = params.fieldValue(field); + + if (operator != null && value != null) { + var fieldStr = !is.string(fieldVal) && !is.number(fieldVal) ? '' : '' + fieldVal; + var valStr = '' + value; + + var caseInsensitive = false; + if (operator.indexOf('@') >= 0) { + fieldStr = fieldStr.toLowerCase(); + valStr = valStr.toLowerCase(); + + operator = operator.replace('@', ''); + caseInsensitive = true; + } + + var notExpr = false; + if (operator.indexOf('!') >= 0) { + operator = operator.replace('!', ''); + notExpr = true; + } + + // if we're doing a case insensitive comparison, then we're using a STRING comparison + // even if we're comparing numbers + if (caseInsensitive) { + value = valStr.toLowerCase(); + fieldVal = fieldStr.toLowerCase(); + } + + var isIneqCmp = false; + + switch (operator) { + case '*=': + _matches = fieldStr.indexOf(valStr) >= 0; + break; + case '$=': + _matches = fieldStr.indexOf(valStr, fieldStr.length - valStr.length) >= 0; + break; + case '^=': + _matches = fieldStr.indexOf(valStr) === 0; + break; + case '=': + _matches = fieldVal === value; + break; + case '>': + isIneqCmp = true; + _matches = fieldVal > value; + break; + case '>=': + isIneqCmp = true; + _matches = fieldVal >= value; + break; + case '<': + isIneqCmp = true; + _matches = fieldVal < value; + break; + case '<=': + isIneqCmp = true; + _matches = fieldVal <= value; + break; + default: + _matches = false; + break; + } + + // apply the not op, but null vals for inequalities should always stay non-matching + if (notExpr && (fieldVal != null || !isIneqCmp)) { + _matches = !_matches; + } + } else if (operator != null) { + switch (operator) { + case '?': + _matches = fieldVal ? true : false; + break; + case '!': + _matches = fieldVal ? false : true; + break; + case '^': + _matches = fieldVal === undefined; + break; + } + } else { + _matches = fieldVal !== undefined; + } + + if (!_matches) { + allDataMatches = false; + break; + } + } // for + + return allDataMatches; +}; // operandsMatch + +// check parent/child relations +var confirmRelations = function confirmRelations(query, isNecessary, eles) { + if (query != null) { + var _matches2 = false; + + if (!isNecessary) { + return false; + } + + eles = eles(); // save cycles if query == null + + // query must match for at least one element (may be recursive) + for (var i = 0; i < eles.length; i++) { + if (queryMatches(query, eles[i])) { + _matches2 = true; + break; + } + } + + return _matches2; + } else { + return true; + } +}; + +var queryMatches = function queryMatches(query, ele) { + // make single group-only selectors really cheap to check since they're the most common ones + if (query.groupOnly) { + return query.group === '*' || query.group === ele.group(); + } + + // check group + if (query.group != null && query.group != '*' && query.group != ele.group()) { + return false; + } + + var cy = ele.cy(); + var k = void 0; + + // check colon selectors + var allColonSelectorsMatch = true; + for (k = 0; k < query.colonSelectors.length; k++) { + var sel = query.colonSelectors[k]; + + allColonSelectorsMatch = stateSelectorMatches(sel, ele); + + if (!allColonSelectorsMatch) break; + } + if (!allColonSelectorsMatch) return false; + + // check id + var allIdsMatch = true; + for (k = 0; k < query.ids.length; k++) { + var id = query.ids[k]; + var actualId = ele.id(); + + allIdsMatch = allIdsMatch && id == actualId; + + if (!allIdsMatch) break; + } + if (!allIdsMatch) return false; + + // check classes + var allClassesMatch = true; + for (k = 0; k < query.classes.length; k++) { + var cls = query.classes[k]; + + allClassesMatch = allClassesMatch && ele.hasClass(cls); + + if (!allClassesMatch) break; + } + if (!allClassesMatch) return false; + + // check data matches + var allDataMatches = operandsMatch(query, { + name: 'data', + fieldValue: function fieldValue(field) { + return ele.data(field); + } + }); + + if (!allDataMatches) { + return false; + } + + // check metadata matches + var allMetaMatches = operandsMatch(query, { + name: 'meta', + fieldValue: function fieldValue(field) { + return ele[field](); + } + }); + + if (!allMetaMatches) { + return false; + } + + // check collection + if (query.collection != null) { + var matchesAny = query.collection.hasElementWithId(ele.id()); + + if (!matchesAny) { + return false; + } + } + + // check filter function + if (query.filter != null && ele.collection().some(query.filter)) { + return false; + } + + var isCompound = cy.hasCompoundNodes(); + var getSource = function getSource() { + return ele.source(); + }; + var getTarget = function getTarget() { + return ele.target(); + }; + + if (!confirmRelations(query.parent, isCompound, function () { + return ele.parent(); + })) { + return false; + } + + if (!confirmRelations(query.ancestor, isCompound, function () { + return ele.parents(); + })) { + return false; + } + + if (!confirmRelations(query.child, isCompound, function () { + return ele.children(); + })) { + return false; + } + + if (!confirmRelations(query.descendant, isCompound, function () { + return ele.descendants(); + })) { + return false; + } + + if (!confirmRelations(query.source, true, getSource)) { + return false; + } + + if (!confirmRelations(query.target, true, getTarget)) { + return false; + } + + if (query.connectedNodes) { + var q0 = query.connectedNodes[0]; + var q1 = query.connectedNodes[1]; + + if (confirmRelations(q0, true, getSource) && confirmRelations(q1, true, getTarget)) { + // match + } else if (confirmRelations(q0, true, getTarget) && confirmRelations(q1, true, getSource)) { + // match + } else { + return false; + } + } + + // we've reached the end, so we've matched everything for this query + return true; +}; // queryMatches + +// filter an existing collection +var filter = function filter(collection) { + var self = this; + var cy = collection.cy(); + + // don't bother trying if it's invalid + if (self.invalid()) { + return cy.collection(); + } + + // for 1 id #foo queries, just get the element + if (self.length === 1 && self[0].length === 1 && self[0].ids.length === 1) { + return collection.getElementById(self[0].ids[0]).collection(); + } + + var selectorFunction = function selectorFunction(element) { + for (var j = 0; j < self.length; j++) { + var query = self[j]; + + if (queryMatches(query, element)) { + return true; + } + } + + return false; + }; + + if (self.text() == null) { + selectorFunction = function selectorFunction() { + return true; + }; + } + + var filteredCollection = collection.filter(selectorFunction); + + return filteredCollection; +}; // filter + +// does selector match a single element? +var matches = function matches(ele) { + var self = this; + + // don't bother trying if it's invalid + if (self.invalid()) { + return false; + } + + for (var j = 0; j < self.length; j++) { + var query = self[j]; + + if (queryMatches(query, ele)) { + return true; + } + } + + return false; +}; // filter + +module.exports = { matches: matches, filter: filter }; + +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Set = __webpack_require__(8); + +var elesfn = { + parent: function parent(selector) { + var parents = []; + + // optimisation for single ele call + if (this.length === 1) { + var parent = this[0]._private.parent; + + if (parent) { + return parent; + } + } + + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + var _parent = ele._private.parent; + + if (_parent) { + parents.push(_parent); + } + } + + return this.spawn(parents, { unique: true }).filter(selector); + }, + + parents: function parents(selector) { + var parents = []; + + var eles = this.parent(); + while (eles.nonempty()) { + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + parents.push(ele); + } + + eles = eles.parent(); + } + + return this.spawn(parents, { unique: true }).filter(selector); + }, + + commonAncestors: function commonAncestors(selector) { + var ancestors = void 0; + + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + var parents = ele.parents(); + + ancestors = ancestors || parents; + + ancestors = ancestors.intersect(parents); // current list must be common with current ele parents set + } + + return ancestors.filter(selector); + }, + + orphans: function orphans(selector) { + return this.stdFilter(function (ele) { + return ele.isOrphan(); + }).filter(selector); + }, + + nonorphans: function nonorphans(selector) { + return this.stdFilter(function (ele) { + return ele.isChild(); + }).filter(selector); + }, + + children: function children(selector) { + var children = []; + + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + children = children.concat(ele._private.children); + } + + return this.spawn(children, { unique: true }).filter(selector); + }, + + siblings: function siblings(selector) { + return this.parent().children().not(this).filter(selector); + }, + + isParent: function isParent() { + var ele = this[0]; + + if (ele) { + return ele.isNode() && ele._private.children.length !== 0; + } + }, + + isChildless: function isChildless() { + var ele = this[0]; + + if (ele) { + return ele.isNode() && ele._private.children.length === 0; + } + }, + + isChild: function isChild() { + var ele = this[0]; + + if (ele) { + return ele.isNode() && ele._private.parent != null; + } + }, + + isOrphan: function isOrphan() { + var ele = this[0]; + + if (ele) { + return ele.isNode() && ele._private.parent == null; + } + }, + + descendants: function descendants(selector) { + var elements = []; + + function add(eles) { + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + + elements.push(ele); + + if (ele.children().nonempty()) { + add(ele.children()); + } + } + } + + add(this.children()); + + return this.spawn(elements, { unique: true }).filter(selector); + } +}; + +function forEachCompound(eles, fn, includeSelf, recursiveStep) { + var q = []; + var did = new Set(); + var cy = eles.cy(); + var hasCompounds = cy.hasCompoundNodes(); + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + + if (includeSelf) { + q.push(ele); + } else if (hasCompounds) { + recursiveStep(q, did, ele); + } + } + + while (q.length > 0) { + var _ele = q.shift(); + + fn(_ele); + + did.add(_ele.id()); + + if (hasCompounds) { + recursiveStep(q, did, _ele); + } + } + + return eles; +} + +function addChildren(q, did, ele) { + if (ele.isParent()) { + var children = ele._private.children; + + for (var i = 0; i < children.length; i++) { + var child = children[i]; + + if (!did.has(child.id())) { + q.push(child); + } + } + } +} + +// very efficient version of eles.add( eles.descendants() ).forEach() +// for internal use +elesfn.forEachDown = function (fn) { + var includeSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + return forEachCompound(this, fn, includeSelf, addChildren); +}; + +function addParent(q, did, ele) { + if (ele.isChild()) { + var parent = ele._private.parent; + + if (!did.has(parent.id())) { + q.push(parent); + } + } +} + +elesfn.forEachUp = function (fn) { + var includeSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + return forEachCompound(this, fn, includeSelf, addParent); +}; + +function addParentAndChildren(q, did, ele) { + addParent(q, did, ele); + addChildren(q, did, ele); +} + +elesfn.forEachUpAndDown = function (fn) { + var includeSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + return forEachCompound(this, fn, includeSelf, addParentAndChildren); +}; + +// aliases +elesfn.ancestors = elesfn.parents; + +module.exports = elesfn; + +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var define = __webpack_require__(4); +var fn = void 0, + elesfn = void 0; + +fn = elesfn = { + + data: define.data({ + field: 'data', + bindingEvent: 'data', + allowBinding: true, + allowSetting: true, + settingEvent: 'data', + settingTriggersEvent: true, + triggerFnName: 'trigger', + allowGetting: true, + immutableKeys: { + 'id': true, + 'source': true, + 'target': true, + 'parent': true + }, + updateStyle: true + }), + + removeData: define.removeData({ + field: 'data', + event: 'data', + triggerFnName: 'trigger', + triggerEvent: true, + immutableKeys: { + 'id': true, + 'source': true, + 'target': true, + 'parent': true + }, + updateStyle: true + }), + + scratch: define.data({ + field: 'scratch', + bindingEvent: 'scratch', + allowBinding: true, + allowSetting: true, + settingEvent: 'scratch', + settingTriggersEvent: true, + triggerFnName: 'trigger', + allowGetting: true, + updateStyle: true + }), + + removeScratch: define.removeData({ + field: 'scratch', + event: 'scratch', + triggerFnName: 'trigger', + triggerEvent: true, + updateStyle: true + }), + + rscratch: define.data({ + field: 'rscratch', + allowBinding: false, + allowSetting: true, + settingTriggersEvent: false, + allowGetting: true + }), + + removeRscratch: define.removeData({ + field: 'rscratch', + triggerEvent: false + }), + + id: function id() { + var ele = this[0]; + + if (ele) { + return ele._private.data.id; + } + } + +}; + +// aliases +fn.attr = fn.data; +fn.removeAttr = fn.removeData; + +module.exports = elesfn; + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); + +var elesfn = {}; + +function defineDegreeFunction(callback) { + return function (includeLoops) { + var self = this; + + if (includeLoops === undefined) { + includeLoops = true; + } + + if (self.length === 0) { + return; + } + + if (self.isNode() && !self.removed()) { + var degree = 0; + var node = self[0]; + var connectedEdges = node._private.edges; + + for (var i = 0; i < connectedEdges.length; i++) { + var edge = connectedEdges[i]; + + if (!includeLoops && edge.isLoop()) { + continue; + } + + degree += callback(node, edge); + } + + return degree; + } else { + return; + } + }; +} + +util.extend(elesfn, { + degree: defineDegreeFunction(function (node, edge) { + if (edge.source().same(edge.target())) { + return 2; + } else { + return 1; + } + }), + + indegree: defineDegreeFunction(function (node, edge) { + if (edge.target().same(node)) { + return 1; + } else { + return 0; + } + }), + + outdegree: defineDegreeFunction(function (node, edge) { + if (edge.source().same(node)) { + return 1; + } else { + return 0; + } + }) +}); + +function defineDegreeBoundsFunction(degreeFn, callback) { + return function (includeLoops) { + var ret = void 0; + var nodes = this.nodes(); + + for (var i = 0; i < nodes.length; i++) { + var ele = nodes[i]; + var degree = ele[degreeFn](includeLoops); + if (degree !== undefined && (ret === undefined || callback(degree, ret))) { + ret = degree; + } + } + + return ret; + }; +} + +util.extend(elesfn, { + minDegree: defineDegreeBoundsFunction('degree', function (degree, min) { + return degree < min; + }), + + maxDegree: defineDegreeBoundsFunction('degree', function (degree, max) { + return degree > max; + }), + + minIndegree: defineDegreeBoundsFunction('indegree', function (degree, min) { + return degree < min; + }), + + maxIndegree: defineDegreeBoundsFunction('indegree', function (degree, max) { + return degree > max; + }), + + minOutdegree: defineDegreeBoundsFunction('outdegree', function (degree, min) { + return degree < min; + }), + + maxOutdegree: defineDegreeBoundsFunction('outdegree', function (degree, max) { + return degree > max; + }) +}); + +util.extend(elesfn, { + totalDegree: function totalDegree(includeLoops) { + var total = 0; + var nodes = this.nodes(); + + for (var i = 0; i < nodes.length; i++) { + total += nodes[i].degree(includeLoops); + } + + return total; + } +}); + +module.exports = elesfn; + +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var position = __webpack_require__(57); +var bounds = __webpack_require__(58); +var widthHeight = __webpack_require__(59); +var edgePoints = __webpack_require__(60); + +module.exports = util.assign({}, position, bounds, widthHeight, edgePoints); + +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var define = __webpack_require__(4); +var is = __webpack_require__(0); +var math = __webpack_require__(2); +var fn = void 0, + elesfn = void 0; + +var beforePositionSet = function beforePositionSet(eles, newPos) { + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + + if (ele.isParent() && !ele.locked()) { + var oldPos = ele._private.position; + var delta = { + x: newPos.x - oldPos.x, + y: newPos.y - oldPos.y + }; + + eles.children().shift(delta); + } + } +}; + +fn = elesfn = { + + position: define.data({ + field: 'position', + bindingEvent: 'position', + allowBinding: true, + allowSetting: true, + settingEvent: 'position', + settingTriggersEvent: true, + triggerFnName: 'emitAndNotify', + allowGetting: true, + validKeys: ['x', 'y'], + beforeGet: function beforeGet(ele) { + ele.updateCompoundBounds(); + }, + beforeSet: beforePositionSet, + onSet: function onSet(eles) { + eles.dirtyCompoundBoundsCache(); + }, + canSet: function canSet(ele) { + return !ele.locked(); + } + }), + + // position but no notification to renderer + silentPosition: define.data({ + field: 'position', + bindingEvent: 'position', + allowBinding: false, + allowSetting: true, + settingEvent: 'position', + settingTriggersEvent: false, + triggerFnName: 'trigger', + allowGetting: false, + validKeys: ['x', 'y'], + beforeSet: beforePositionSet, + onSet: function onSet(eles) { + eles.dirtyCompoundBoundsCache(); + }, + canSet: function canSet(ele) { + return !ele.locked(); + } + }), + + positions: function positions(pos, silent) { + if (is.plainObject(pos)) { + if (silent) { + this.silentPosition(pos); + } else { + this.position(pos); + } + } else if (is.fn(pos)) { + var _fn = pos; + var cy = this.cy(); + + cy.startBatch(); + + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + var _pos = void 0; + + if (_pos = _fn(ele, i)) { + if (silent) { + ele.silentPosition(_pos); + } else { + ele.position(_pos); + } + } + } + + cy.endBatch(); + } + + return this; // chaining + }, + + silentPositions: function silentPositions(pos) { + return this.positions(pos, true); + }, + + shift: function shift(dim, val) { + var delta = void 0; + + if (is.plainObject(dim)) { + delta = dim; + } else if (is.string(dim) && is.number(val)) { + delta = { x: 0, y: 0 }; + + delta[dim] = val; + } + + if (delta != null) { + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + var pos = ele.position(); + + ele.position({ + x: pos.x + delta.x, + y: pos.y + delta.y + }); + } + } + + return this; + }, + + // get/set the rendered (i.e. on screen) positon of the element + renderedPosition: function renderedPosition(dim, val) { + var ele = this[0]; + var cy = this.cy(); + var zoom = cy.zoom(); + var pan = cy.pan(); + var rpos = is.plainObject(dim) ? dim : undefined; + var setting = rpos !== undefined || val !== undefined && is.string(dim); + + if (ele && ele.isNode()) { + // must have an element and must be a node to return position + if (setting) { + for (var i = 0; i < this.length; i++) { + var _ele = this[i]; + + if (val !== undefined) { + // set one dimension + _ele.position(dim, (val - pan[dim]) / zoom); + } else if (rpos !== undefined) { + // set whole position + _ele.position(math.renderedToModelPosition(rpos, zoom, pan)); + } + } + } else { + // getting + var pos = ele.position(); + rpos = math.modelToRenderedPosition(pos, zoom, pan); + + if (dim === undefined) { + // then return the whole rendered position + return rpos; + } else { + // then return the specified dimension + return rpos[dim]; + } + } + } else if (!setting) { + return undefined; // for empty collection case + } + + return this; // chaining + }, + + // get/set the position relative to the parent + relativePosition: function relativePosition(dim, val) { + var ele = this[0]; + var cy = this.cy(); + var ppos = is.plainObject(dim) ? dim : undefined; + var setting = ppos !== undefined || val !== undefined && is.string(dim); + var hasCompoundNodes = cy.hasCompoundNodes(); + + if (ele && ele.isNode()) { + // must have an element and must be a node to return position + if (setting) { + for (var i = 0; i < this.length; i++) { + var _ele2 = this[i]; + var parent = hasCompoundNodes ? _ele2.parent() : null; + var hasParent = parent && parent.length > 0; + var relativeToParent = hasParent; + + if (hasParent) { + parent = parent[0]; + } + + var origin = relativeToParent ? parent.position() : { x: 0, y: 0 }; + + if (val !== undefined) { + // set one dimension + _ele2.position(dim, val + origin[dim]); + } else if (ppos !== undefined) { + // set whole position + _ele2.position({ + x: ppos.x + origin.x, + y: ppos.y + origin.y + }); + } + } + } else { + // getting + var pos = ele.position(); + var _parent = hasCompoundNodes ? ele.parent() : null; + var _hasParent = _parent && _parent.length > 0; + var _relativeToParent = _hasParent; + + if (_hasParent) { + _parent = _parent[0]; + } + + var _origin = _relativeToParent ? _parent.position() : { x: 0, y: 0 }; + + ppos = { + x: pos.x - _origin.x, + y: pos.y - _origin.y + }; + + if (dim === undefined) { + // then return the whole rendered position + return ppos; + } else { + // then return the specified dimension + return ppos[dim]; + } + } + } else if (!setting) { + return undefined; // for empty collection case + } + + return this; // chaining + } +}; + +// aliases +fn.modelPosition = fn.point = fn.position; +fn.modelPositions = fn.points = fn.positions; +fn.renderedPoint = fn.renderedPosition; +fn.relativePoint = fn.relativePosition; + +module.exports = elesfn; + +/***/ }), +/* 58 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var util = __webpack_require__(1); +var math = __webpack_require__(2); +var fn = void 0, + elesfn = void 0; + +fn = elesfn = {}; + +elesfn.renderedBoundingBox = function (options) { + var bb = this.boundingBox(options); + var cy = this.cy(); + var zoom = cy.zoom(); + var pan = cy.pan(); + + var x1 = bb.x1 * zoom + pan.x; + var x2 = bb.x2 * zoom + pan.x; + var y1 = bb.y1 * zoom + pan.y; + var y2 = bb.y2 * zoom + pan.y; + + return { + x1: x1, + x2: x2, + y1: y1, + y2: y2, + w: x2 - x1, + h: y2 - y1 + }; +}; + +elesfn.dirtyCompoundBoundsCache = function () { + var cy = this.cy(); + + if (!cy.styleEnabled() || !cy.hasCompoundNodes()) { + return this; + } + + this.forEachUp(function (ele) { + ele._private.compoundBoundsClean = false; + + if (ele.isParent()) { + ele.emit('bounds'); + } + }); + + return this; +}; + +elesfn.updateCompoundBounds = function () { + var cy = this.cy(); + + // save cycles for non compound graphs or when style disabled + if (!cy.styleEnabled() || !cy.hasCompoundNodes()) { + return this; + } + + // save cycles when batching -- but bounds will be stale (or not exist yet) + if (cy.batching()) { + return this; + } + + var updated = []; + + function update(parent) { + if (!parent.isParent()) { + return; + } + + var _p = parent._private; + var children = parent.children(); + var includeLabels = parent.pstyle('compound-sizing-wrt-labels').value === 'include'; + + var min = { + width: { + val: parent.pstyle('min-width').pfValue, + left: parent.pstyle('min-width-bias-left'), + right: parent.pstyle('min-width-bias-right') + }, + height: { + val: parent.pstyle('min-height').pfValue, + top: parent.pstyle('min-height-bias-top'), + bottom: parent.pstyle('min-height-bias-bottom') + } + }; + + var bb = children.boundingBox({ + includeLabels: includeLabels, + includeOverlays: false, + + // updating the compound bounds happens outside of the regular + // cache cycle (i.e. before fired events) + useCache: false + }); + var pos = _p.position; + + // if children take up zero area then keep position and fall back on stylesheet w/h + if (bb.w === 0 || bb.h === 0) { + bb = { + w: parent.pstyle('width').pfValue, + h: parent.pstyle('height').pfValue + }; + + bb.x1 = pos.x - bb.w / 2; + bb.x2 = pos.x + bb.w / 2; + bb.y1 = pos.y - bb.h / 2; + bb.y2 = pos.y + bb.h / 2; + } + + function computeBiasValues(propDiff, propBias, propBiasComplement) { + var biasDiff = 0; + var biasComplementDiff = 0; + var biasTotal = propBias + propBiasComplement; + + if (propDiff > 0 && biasTotal > 0) { + biasDiff = propBias / biasTotal * propDiff; + biasComplementDiff = propBiasComplement / biasTotal * propDiff; + } + return { + biasDiff: biasDiff, + biasComplementDiff: biasComplementDiff + }; + } + + function computePaddingValues(width, height, paddingObject, relativeTo) { + // Assuming percentage is number from 0 to 1 + if (paddingObject.units === '%') { + switch (relativeTo) { + case 'width': + return width > 0 ? paddingObject.pfValue * width : 0; + case 'height': + return height > 0 ? paddingObject.pfValue * height : 0; + case 'average': + return width > 0 && height > 0 ? paddingObject.pfValue * (width + height) / 2 : 0; + case 'min': + return width > 0 && height > 0 ? width > height ? paddingObject.pfValue * height : paddingObject.pfValue * width : 0; + case 'max': + return width > 0 && height > 0 ? width > height ? paddingObject.pfValue * width : paddingObject.pfValue * height : 0; + default: + return 0; + } + } else if (paddingObject.units === 'px') { + return paddingObject.pfValue; + } else { + return 0; + } + } + + var leftVal = min.width.left.value; + if (min.width.left.units === 'px' && min.width.val > 0) { + leftVal = leftVal * 100 / min.width.val; + } + var rightVal = min.width.right.value; + if (min.width.right.units === 'px' && min.width.val > 0) { + rightVal = rightVal * 100 / min.width.val; + } + + var topVal = min.height.top.value; + if (min.height.top.units === 'px' && min.height.val > 0) { + topVal = topVal * 100 / min.height.val; + } + + var bottomVal = min.height.bottom.value; + if (min.height.bottom.units === 'px' && min.height.val > 0) { + bottomVal = bottomVal * 100 / min.height.val; + } + + var widthBiasDiffs = computeBiasValues(min.width.val - bb.w, leftVal, rightVal); + var diffLeft = widthBiasDiffs.biasDiff; + var diffRight = widthBiasDiffs.biasComplementDiff; + + var heightBiasDiffs = computeBiasValues(min.height.val - bb.h, topVal, bottomVal); + var diffTop = heightBiasDiffs.biasDiff; + var diffBottom = heightBiasDiffs.biasComplementDiff; + + _p.autoPadding = computePaddingValues(bb.w, bb.h, parent.pstyle('padding'), parent.pstyle('padding-relative-to').value); + + _p.autoWidth = Math.max(bb.w, min.width.val); + pos.x = (-diffLeft + bb.x1 + bb.x2 + diffRight) / 2; + + _p.autoHeight = Math.max(bb.h, min.height.val); + pos.y = (-diffTop + bb.y1 + bb.y2 + diffBottom) / 2; + + updated.push(parent); + } + + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + var _p = ele._private; + + if (!_p.compoundBoundsClean) { + update(ele); + + if (!cy._private.batchingStyle) { + _p.compoundBoundsClean = true; + } + } + } + + return this; +}; + +var noninf = function noninf(x) { + if (x === Infinity || x === -Infinity) { + return 0; + } + + return x; +}; + +var updateBounds = function updateBounds(b, x1, y1, x2, y2) { + // don't update with zero area boxes + if (x2 - x1 === 0 || y2 - y1 === 0) { + return; + } + + // don't update with null dim + if (x1 == null || y1 == null || x2 == null || y2 == null) { + return; + } + + b.x1 = x1 < b.x1 ? x1 : b.x1; + b.x2 = x2 > b.x2 ? x2 : b.x2; + b.y1 = y1 < b.y1 ? y1 : b.y1; + b.y2 = y2 > b.y2 ? y2 : b.y2; +}; + +var updateBoundsFromBox = function updateBoundsFromBox(b, b2) { + return updateBounds(b, b2.x1, b2.y1, b2.x2, b2.y2); +}; + +var prefixedProperty = function prefixedProperty(obj, field, prefix) { + return util.getPrefixedProperty(obj, field, prefix); +}; + +var updateBoundsFromArrow = function updateBoundsFromArrow(bounds, ele, prefix) { + if (ele.cy().headless()) { + return; + } + + var _p = ele._private; + var rstyle = _p.rstyle; + var halfArW = rstyle.arrowWidth / 2; + var arrowType = ele.pstyle(prefix + '-arrow-shape').value; + var x = void 0; + var y = void 0; + + if (arrowType !== 'none') { + if (prefix === 'source') { + x = rstyle.srcX; + y = rstyle.srcY; + } else if (prefix === 'target') { + x = rstyle.tgtX; + y = rstyle.tgtY; + } else { + x = rstyle.midX; + y = rstyle.midY; + } + + updateBounds(bounds, x - halfArW, y - halfArW, x + halfArW, y + halfArW); + } +}; + +var updateBoundsFromLabel = function updateBoundsFromLabel(bounds, ele, prefix) { + if (ele.cy().headless()) { + return; + } + + var prefixDash = void 0; + + if (prefix) { + prefixDash = prefix + '-'; + } else { + prefixDash = ''; + } + + var _p = ele._private; + var rstyle = _p.rstyle; + var label = ele.pstyle(prefixDash + 'label').strValue; + + if (label) { + var halign = ele.pstyle('text-halign'); + var valign = ele.pstyle('text-valign'); + var labelWidth = prefixedProperty(rstyle, 'labelWidth', prefix); + var labelHeight = prefixedProperty(rstyle, 'labelHeight', prefix); + var labelX = prefixedProperty(rstyle, 'labelX', prefix); + var labelY = prefixedProperty(rstyle, 'labelY', prefix); + var marginX = ele.pstyle(prefixDash + 'text-margin-x').pfValue; + var marginY = ele.pstyle(prefixDash + 'text-margin-y').pfValue; + var isEdge = ele.isEdge(); + var rotation = ele.pstyle(prefixDash + 'text-rotation'); + var outlineWidth = ele.pstyle('text-outline-width').pfValue; + var borderWidth = ele.pstyle('text-border-width').pfValue; + var halfBorderWidth = borderWidth / 2; + var padding = ele.pstyle('text-background-padding').pfValue; + + var lh = labelHeight + 2 * padding; + var lw = labelWidth + 2 * padding; + var lw_2 = lw / 2; + var lh_2 = lh / 2; + var lx1 = void 0, + lx2 = void 0, + ly1 = void 0, + ly2 = void 0; + + if (isEdge) { + lx1 = labelX - lw_2; + lx2 = labelX + lw_2; + ly1 = labelY - lh_2; + ly2 = labelY + lh_2; + } else { + switch (halign.value) { + case 'left': + lx1 = labelX - lw; + lx2 = labelX; + break; + + case 'center': + lx1 = labelX - lw_2; + lx2 = labelX + lw_2; + break; + + case 'right': + lx1 = labelX; + lx2 = labelX + lw; + break; + } + + switch (valign.value) { + case 'top': + ly1 = labelY - lh; + ly2 = labelY; + break; + + case 'center': + ly1 = labelY - lh_2; + ly2 = labelY + lh_2; + break; + + case 'bottom': + ly1 = labelY; + ly2 = labelY + lh; + break; + } + } + + var isAutorotate = isEdge && rotation.strValue === 'autorotate'; + var isPfValue = rotation.pfValue != null && rotation.pfValue !== 0; + + if (isAutorotate || isPfValue) { + var theta = isAutorotate ? prefixedProperty(_p.rstyle, 'labelAngle', prefix) : rotation.pfValue; + var cos = Math.cos(theta); + var sin = Math.sin(theta); + + var rotate = function rotate(x, y) { + x = x - labelX; + y = y - labelY; + + return { + x: x * cos - y * sin + labelX, + y: x * sin + y * cos + labelY + }; + }; + + var px1y1 = rotate(lx1, ly1); + var px1y2 = rotate(lx1, ly2); + var px2y1 = rotate(lx2, ly1); + var px2y2 = rotate(lx2, ly2); + + lx1 = Math.min(px1y1.x, px1y2.x, px2y1.x, px2y2.x); + lx2 = Math.max(px1y1.x, px1y2.x, px2y1.x, px2y2.x); + ly1 = Math.min(px1y1.y, px1y2.y, px2y1.y, px2y2.y); + ly2 = Math.max(px1y1.y, px1y2.y, px2y1.y, px2y2.y); + } + + lx1 += marginX - Math.max(outlineWidth, halfBorderWidth); + lx2 += marginX + Math.max(outlineWidth, halfBorderWidth); + ly1 += marginY - Math.max(outlineWidth, halfBorderWidth); + ly2 += marginY + Math.max(outlineWidth, halfBorderWidth); + + updateBounds(bounds, lx1, ly1, lx2, ly2); + } + + return bounds; +}; + +// get the bounding box of the elements (in raw model position) +var boundingBoxImpl = function boundingBoxImpl(ele, options) { + var cy = ele._private.cy; + var styleEnabled = cy.styleEnabled(); + var headless = cy.headless(); + + var bounds = { + x1: Infinity, + y1: Infinity, + x2: -Infinity, + y2: -Infinity + }; + + var _p = ele._private; + var display = styleEnabled ? ele.pstyle('display').value : 'element'; + var isNode = ele.isNode(); + var isEdge = ele.isEdge(); + var ex1 = void 0, + ex2 = void 0, + ey1 = void 0, + ey2 = void 0; // extrema of body / lines + var x = void 0, + y = void 0; // node pos + var displayed = display !== 'none'; + + if (displayed) { + var overlayOpacity = 0; + var overlayPadding = 0; + + if (styleEnabled && options.includeOverlays) { + overlayOpacity = ele.pstyle('overlay-opacity').value; + + if (overlayOpacity !== 0) { + overlayPadding = ele.pstyle('overlay-padding').value; + } + } + + var w = 0; + var wHalf = 0; + + if (styleEnabled) { + w = ele.pstyle('width').pfValue; + wHalf = w / 2; + } + + if (isNode && options.includeNodes) { + var pos = ele.position(); + x = pos.x; + y = pos.y; + var _w = ele.outerWidth(); + var halfW = _w / 2; + var h = ele.outerHeight(); + var halfH = h / 2; + + // handle node dimensions + ///////////////////////// + + ex1 = x - halfW - overlayPadding; + ex2 = x + halfW + overlayPadding; + ey1 = y - halfH - overlayPadding; + ey2 = y + halfH + overlayPadding; + + updateBounds(bounds, ex1, ey1, ex2, ey2); + } else if (isEdge && options.includeEdges) { + var rstyle = _p.rstyle || {}; + + // handle edge dimensions (rough box estimate) + ////////////////////////////////////////////// + if (styleEnabled && !headless) { + ex1 = Math.min(rstyle.srcX, rstyle.midX, rstyle.tgtX); + ex2 = Math.max(rstyle.srcX, rstyle.midX, rstyle.tgtX); + ey1 = Math.min(rstyle.srcY, rstyle.midY, rstyle.tgtY); + ey2 = Math.max(rstyle.srcY, rstyle.midY, rstyle.tgtY); + + // take into account edge width + ex1 -= wHalf; + ex2 += wHalf; + ey1 -= wHalf; + ey2 += wHalf; + + updateBounds(bounds, ex1, ey1, ex2, ey2); + } + + // precise haystacks + //////////////////// + if (styleEnabled && !headless && ele.pstyle('curve-style').strValue === 'haystack') { + var hpts = rstyle.haystackPts || []; + + ex1 = hpts[0].x; + ey1 = hpts[0].y; + ex2 = hpts[1].x; + ey2 = hpts[1].y; + + if (ex1 > ex2) { + var temp = ex1; + ex1 = ex2; + ex2 = temp; + } + + if (ey1 > ey2) { + var _temp = ey1; + ey1 = ey2; + ey2 = _temp; + } + + updateBounds(bounds, ex1 - wHalf, ey1 - wHalf, ex2 + wHalf, ey2 + wHalf); + + // handle points along edge + /////////////////////////// + } else { + var pts = rstyle.bezierPts || rstyle.linePts || []; + + for (var j = 0; j < pts.length; j++) { + var pt = pts[j]; + + ex1 = pt.x - wHalf; + ex2 = pt.x + wHalf; + ey1 = pt.y - wHalf; + ey2 = pt.y + wHalf; + + updateBounds(bounds, ex1, ey1, ex2, ey2); + } + + // fallback on source and target positions + ////////////////////////////////////////// + if (pts.length === 0) { + var n1 = ele.source(); + var n1pos = n1.position(); + + var n2 = ele.target(); + var n2pos = n2.position(); + + ex1 = n1pos.x; + ex2 = n2pos.x; + ey1 = n1pos.y; + ey2 = n2pos.y; + + if (ex1 > ex2) { + var _temp2 = ex1; + ex1 = ex2; + ex2 = _temp2; + } + + if (ey1 > ey2) { + var _temp3 = ey1; + ey1 = ey2; + ey2 = _temp3; + } + + // take into account edge width + ex1 -= wHalf; + ex2 += wHalf; + ey1 -= wHalf; + ey2 += wHalf; + + updateBounds(bounds, ex1, ey1, ex2, ey2); + } + } + } // edges + + + // handle edge arrow size + ///////////////////////// + + if (styleEnabled && options.includeEdges && isEdge) { + updateBoundsFromArrow(bounds, ele, 'mid-source', options); + updateBoundsFromArrow(bounds, ele, 'mid-target', options); + updateBoundsFromArrow(bounds, ele, 'source', options); + updateBoundsFromArrow(bounds, ele, 'target', options); + } + + // ghost + //////// + + if (styleEnabled) { + var ghost = ele.pstyle('ghost').value === 'yes'; + + if (ghost) { + var gx = ele.pstyle('ghost-offset-x').pfValue; + var gy = ele.pstyle('ghost-offset-y').pfValue; + + updateBounds(bounds, bounds.x1 + gx, bounds.y1 + gy, bounds.x2 + gx, bounds.y2 + gy); + } + } + + // overlay + ////////// + + if (styleEnabled) { + + ex1 = bounds.x1; + ex2 = bounds.x2; + ey1 = bounds.y1; + ey2 = bounds.y2; + + updateBounds(bounds, ex1 - overlayPadding, ey1 - overlayPadding, ex2 + overlayPadding, ey2 + overlayPadding); + } + + // handle label dimensions + ////////////////////////// + + if (styleEnabled && options.includeLabels) { + updateBoundsFromLabel(bounds, ele, null, options); + + if (isEdge) { + updateBoundsFromLabel(bounds, ele, 'source', options); + updateBoundsFromLabel(bounds, ele, 'target', options); + } + } // style enabled for labels + } // if displayed + + bounds.x1 = noninf(bounds.x1); + bounds.y1 = noninf(bounds.y1); + bounds.x2 = noninf(bounds.x2); + bounds.y2 = noninf(bounds.y2); + bounds.w = noninf(bounds.x2 - bounds.x1); + bounds.h = noninf(bounds.y2 - bounds.y1); + + // expand bounds by 1 because antialiasing can increase the visual/effective size by 1 on all sides + if (bounds.w > 0 && bounds.h > 0 && displayed) { + math.expandBoundingBox(bounds, 1); + } + + return bounds; +}; + +var tf = function tf(val) { + if (val) { + return 't'; + } else { + return 'f'; + } +}; + +var getKey = function getKey(opts) { + var key = ''; + + key += tf(opts.incudeNodes); + key += tf(opts.includeEdges); + key += tf(opts.includeLabels); + key += tf(opts.includeOverlays); + + return key; +}; + +var cachedBoundingBoxImpl = function cachedBoundingBoxImpl(ele, opts) { + var _p = ele._private; + var bb = void 0; + var headless = ele.cy().headless(); + var key = opts === defBbOpts ? defBbOptsKey : getKey(opts); + + if (!opts.useCache || headless || !_p.bbCache || !_p.bbCache[key]) { + bb = boundingBoxImpl(ele, opts); + + if (!headless) { + _p.bbCache = _p.bbCache || {}; + _p.bbCache[key] = bb; + } + } else { + bb = _p.bbCache[key]; + } + + return bb; +}; + +var defBbOpts = { + includeNodes: true, + includeEdges: true, + includeLabels: true, + includeOverlays: true, + useCache: true +}; + +var defBbOptsKey = getKey(defBbOpts); + +function filledBbOpts(options) { + return { + includeNodes: util.default(options.includeNodes, defBbOpts.includeNodes), + includeEdges: util.default(options.includeEdges, defBbOpts.includeEdges), + includeLabels: util.default(options.includeLabels, defBbOpts.includeLabels), + includeOverlays: util.default(options.includeOverlays, defBbOpts.includeOverlays), + useCache: util.default(options.useCache, defBbOpts.useCache) + }; +} + +elesfn.boundingBox = function (options) { + // the main usecase is ele.boundingBox() for a single element with no/def options + // specified s.t. the cache is used, so check for this case to make it faster by + // avoiding the overhead of the rest of the function + if (this.length === 1 && this[0]._private.bbCache && (options === undefined || options.useCache === undefined || options.useCache === true)) { + if (options === undefined) { + options = defBbOpts; + } else { + options = filledBbOpts(options); + } + + return cachedBoundingBoxImpl(this[0], options); + } + + var bounds = { + x1: Infinity, + y1: Infinity, + x2: -Infinity, + y2: -Infinity + }; + + options = options || util.staticEmptyObject(); + + var opts = filledBbOpts(options); + + var eles = this; + var cy = eles.cy(); + var styleEnabled = cy.styleEnabled(); + + if (styleEnabled) { + this.recalculateRenderedStyle(opts.useCache); + } + + this.updateCompoundBounds(); + + var updatedEdge = {}; // use to avoid duplicated edge updates + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + + if (styleEnabled && ele.isEdge() && ele.pstyle('curve-style').strValue === 'bezier' && !updatedEdge[ele.id()]) { + var edges = ele.parallelEdges(); + + for (var j = 0; j < edges.length; j++) { + // make all as updated + updatedEdge[edges[j].id()] = true; + } + + edges.recalculateRenderedStyle(opts.useCache); // n.b. ele.parallelEdges() single is cached + } + + updateBoundsFromBox(bounds, cachedBoundingBoxImpl(ele, opts)); + } + + bounds.x1 = noninf(bounds.x1); + bounds.y1 = noninf(bounds.y1); + bounds.x2 = noninf(bounds.x2); + bounds.y2 = noninf(bounds.y2); + bounds.w = noninf(bounds.x2 - bounds.x1); + bounds.h = noninf(bounds.y2 - bounds.y1); + + return bounds; +}; + +// private helper to get bounding box for custom node positions +// - good for perf in certain cases but currently requires dirtying the rendered style +// - would be better to not modify the nodes but the nodes are read directly everywhere in the renderer... +// - try to use for only things like discrete layouts where the node position would change anyway +elesfn.boundingBoxAt = function (fn) { + var nodes = this.nodes(); + + if (is.plainObject(fn)) { + var obj = fn; + + fn = function fn() { + return obj; + }; + } + + // save the current position and set the new one, per node + for (var i = 0; i < nodes.length; i++) { + var n = nodes[i]; + var _p = n._private; + var pos = _p.position; + var newPos = fn.call(n, n, i); + + _p.bbAtOldPos = { x: pos.x, y: pos.y }; + + if (newPos) { + pos.x = newPos.x; + pos.y = newPos.y; + } + } + + this.emit('dirty'); // let the renderer know we've manually dirtied rendered dim calcs + + nodes.dirtyCompoundBoundsCache().updateCompoundBounds(); + + var bb = this.boundingBox({ useCache: false }); + + // restore the original position, per node + for (var _i = 0; _i < nodes.length; _i++) { + var _n = nodes[_i]; + var _p2 = _n._private; + var _pos = _n._private.position; + var old = _p2.bbAtOldPos; + + _pos.x = old.x; + _pos.y = old.y; + } + + nodes.dirtyCompoundBoundsCache(); + + this.emit('dirty'); // let the renderer know we've manually dirtied rendered dim calcs + + return bb; +}; + +fn.boundingbox = fn.boundingBox; +fn.renderedBoundingbox = fn.renderedBoundingBox; + +module.exports = elesfn; + +/***/ }), +/* 59 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var fn = void 0, + elesfn = void 0; + +fn = elesfn = {}; + +var defineDimFns = function defineDimFns(opts) { + opts.uppercaseName = util.capitalize(opts.name); + opts.autoName = 'auto' + opts.uppercaseName; + opts.labelName = 'label' + opts.uppercaseName; + opts.outerName = 'outer' + opts.uppercaseName; + opts.uppercaseOuterName = util.capitalize(opts.outerName); + + fn[opts.name] = function dimImpl() { + var ele = this[0]; + var _p = ele._private; + var cy = _p.cy; + var styleEnabled = cy._private.styleEnabled; + + if (ele) { + if (styleEnabled) { + if (ele.isParent()) { + ele.updateCompoundBounds(); + + return _p[opts.autoName] || 0; + } + + var d = ele.pstyle(opts.name); + + switch (d.strValue) { + case 'label': + ele.recalculateRenderedStyle(); + + return _p.rstyle[opts.labelName] || 0; + + default: + return d.pfValue; + } + } else { + return 1; + } + } + }; + + fn['outer' + opts.uppercaseName] = function outerDimImpl() { + var ele = this[0]; + var _p = ele._private; + var cy = _p.cy; + var styleEnabled = cy._private.styleEnabled; + + if (ele) { + if (styleEnabled) { + var dim = ele[opts.name](); + var border = ele.pstyle('border-width').pfValue; // n.b. 1/2 each side + var padding = 2 * ele.padding(); + + return dim + border + padding; + } else { + return 1; + } + } + }; + + fn['rendered' + opts.uppercaseName] = function renderedDimImpl() { + var ele = this[0]; + + if (ele) { + var d = ele[opts.name](); + return d * this.cy().zoom(); + } + }; + + fn['rendered' + opts.uppercaseOuterName] = function renderedOuterDimImpl() { + var ele = this[0]; + + if (ele) { + var od = ele[opts.outerName](); + return od * this.cy().zoom(); + } + }; +}; + +defineDimFns({ + name: 'width' +}); + +defineDimFns({ + name: 'height' +}); + +elesfn.padding = function () { + var ele = this[0]; + var _p = ele._private; + if (ele.isParent()) { + ele.updateCompoundBounds(); + + if (_p.autoPadding !== undefined) { + return _p.autoPadding; + } else { + return ele.pstyle('padding').pfValue; + } + } else { + return ele.pstyle('padding').pfValue; + } +}; + +module.exports = elesfn; + +/***/ }), +/* 60 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var ifEdge = function ifEdge(self, then) { + if (self.isEdge()) { + return then(self.renderer()); + } +}; + +module.exports = { + controlPoints: function controlPoints() { + var _this = this; + + return ifEdge(this, function (renderer) { + return renderer.getControlPoints(_this); + }); + }, + segmentPoints: function segmentPoints() { + var _this2 = this; + + return ifEdge(this, function (renderer) { + return renderer.getSegmentPoints(_this2); + }); + }, + sourceEndpoint: function sourceEndpoint() { + var _this3 = this; + + return ifEdge(this, function (renderer) { + return renderer.getSourceEndpoint(_this3); + }); + }, + targetEndpoint: function targetEndpoint() { + var _this4 = this; + + return ifEdge(this, function (renderer) { + return renderer.getTargetEndpoint(_this4); + }); + }, + midpoint: function midpoint() { + var _this5 = this; + + return ifEdge(this, function (renderer) { + return renderer.getEdgeMidpoint(_this5); + }); + } +}; + +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Emitter = __webpack_require__(11); +var define = __webpack_require__(4); +var is = __webpack_require__(0); +var util = __webpack_require__(1); +var Selector = __webpack_require__(6); + +var emitterOptions = { + qualifierCompare: function qualifierCompare(selector1, selector2) { + if (selector1 == null || selector2 == null) { + return selector1 == null && selector2 == null; + } else { + return selector1.sameText(selector2); + } + }, + eventMatches: function eventMatches(ele, listener, eventObj) { + var selector = listener.qualifier; + + if (selector != null) { + return ele !== eventObj.target && is.element(eventObj.target) && selector.matches(eventObj.target); + } + + return true; + }, + eventFields: function eventFields(ele) { + return { + cy: ele.cy(), + target: ele + }; + }, + callbackContext: function callbackContext(ele, listener, eventObj) { + return listener.qualifier != null ? eventObj.target : ele; + }, + beforeEmit: function beforeEmit(context, listener /*, eventObj*/) { + if (listener.conf && listener.conf.once) { + listener.conf.onceCollection.removeListener(listener.event, listener.qualifier, listener.callback); + } + }, + bubble: function bubble() { + return true; + }, + parent: function parent(ele) { + return ele.isChild() ? ele.parent() : ele.cy(); + } +}; + +var argSelector = function argSelector(arg) { + if (is.string(arg)) { + return new Selector(arg); + } else { + return arg; + } +}; + +var elesfn = { + createEmitter: function createEmitter() { + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + var _p = ele._private; + + if (!_p.emitter) { + _p.emitter = new Emitter(util.assign({ + context: ele + }, emitterOptions)); + } + } + + return this; + }, + + emitter: function emitter() { + return this._private.emitter; + }, + + on: function on(events, selector, callback) { + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + + ele.emitter().on(events, argSelector(selector), callback); + } + + return this; + }, + + removeListener: function removeListener(events, selector, callback) { + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + + ele.emitter().removeListener(events, argSelector(selector), callback); + } + + return this; + }, + + one: function one(events, selector, callback) { + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + + ele.emitter().one(events, argSelector(selector), callback); + } + + return this; + }, + + once: function once(events, selector, callback) { + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + + ele.emitter().on(events, argSelector(selector), callback, { + once: true, + onceCollection: this + }); + } + }, + + emit: function emit(events, extraParams) { + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + + ele.emitter().emit(events, extraParams); + } + + return this; + }, + + emitAndNotify: function emitAndNotify(event, extraParams) { + // for internal use only + if (this.length === 0) { + return; + } // empty collections don't need to notify anything + + // notify renderer + this.cy().notify({ + type: event, + eles: this + }); + + this.emit(event, extraParams); + + return this; + } +}; + +define.eventAliasesOn(elesfn); + +module.exports = elesfn; + +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var Selector = __webpack_require__(6); + +var elesfn = { + nodes: function nodes(selector) { + return this.filter(function (ele) { + return ele.isNode(); + }).filter(selector); + }, + + edges: function edges(selector) { + return this.filter(function (ele) { + return ele.isEdge(); + }).filter(selector); + }, + + filter: function filter(_filter, thisArg) { + if (_filter === undefined) { + // check this first b/c it's the most common/performant case + return this; + } else if (is.string(_filter) || is.elementOrCollection(_filter)) { + return new Selector(_filter).filter(this); + } else if (is.fn(_filter)) { + var filterEles = this.spawn(); + var eles = this; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + var include = thisArg ? _filter.apply(thisArg, [ele, i, eles]) : _filter(ele, i, eles); + + if (include) { + filterEles.merge(ele); + } + } + + return filterEles; + } + + return this.spawn(); // if not handled by above, give 'em an empty collection + }, + + not: function not(toRemove) { + if (!toRemove) { + return this; + } else { + + if (is.string(toRemove)) { + toRemove = this.filter(toRemove); + } + + var elements = []; + var rMap = toRemove._private.map; + + for (var i = 0; i < this.length; i++) { + var element = this[i]; + + var remove = rMap.has(element.id()); + if (!remove) { + elements.push(element); + } + } + + return this.spawn(elements); + } + }, + + absoluteComplement: function absoluteComplement() { + var cy = this.cy(); + + return cy.mutableElements().not(this); + }, + + intersect: function intersect(other) { + // if a selector is specified, then filter by it instead + if (is.string(other)) { + var selector = other; + return this.filter(selector); + } + + var elements = []; + var col1 = this; + var col2 = other; + var col1Smaller = this.length < other.length; + var map2 = col1Smaller ? col2._private.map : col1._private.map; + var col = col1Smaller ? col1 : col2; + + for (var i = 0; i < col.length; i++) { + var id = col[i]._private.data.id; + var entry = map2.get(id); + + if (entry) { + elements.push(entry.ele); + } + } + + return this.spawn(elements); + }, + + xor: function xor(other) { + var cy = this._private.cy; + + if (is.string(other)) { + other = cy.$(other); + } + + var elements = []; + var col1 = this; + var col2 = other; + + var add = function add(col, other) { + for (var i = 0; i < col.length; i++) { + var ele = col[i]; + var id = ele._private.data.id; + var inOther = other.hasElementWithId(id); + + if (!inOther) { + elements.push(ele); + } + } + }; + + add(col1, col2); + add(col2, col1); + + return this.spawn(elements); + }, + + diff: function diff(other) { + var cy = this._private.cy; + + if (is.string(other)) { + other = cy.$(other); + } + + var left = []; + var right = []; + var both = []; + var col1 = this; + var col2 = other; + + var add = function add(col, other, retEles) { + + for (var i = 0; i < col.length; i++) { + var ele = col[i]; + var id = ele._private.data.id; + var inOther = other.hasElementWithId(id); + + if (inOther) { + both.push(ele); + } else { + retEles.push(ele); + } + } + }; + + add(col1, col2, left); + add(col2, col1, right); + + return { + left: this.spawn(left, { unique: true }), + right: this.spawn(right, { unique: true }), + both: this.spawn(both, { unique: true }) + }; + }, + + add: function add(toAdd) { + var cy = this._private.cy; + + if (!toAdd) { + return this; + } + + if (is.string(toAdd)) { + var selector = toAdd; + toAdd = cy.mutableElements().filter(selector); + } + + var elements = []; + + for (var i = 0; i < this.length; i++) { + elements.push(this[i]); + } + + var map = this._private.map; + + for (var _i = 0; _i < toAdd.length; _i++) { + + var add = !map.has(toAdd[_i].id()); + if (add) { + elements.push(toAdd[_i]); + } + } + + return this.spawn(elements); + }, + + // in place merge on calling collection + merge: function merge(toAdd) { + var _p = this._private; + var cy = _p.cy; + + if (!toAdd) { + return this; + } + + if (toAdd && is.string(toAdd)) { + var selector = toAdd; + toAdd = cy.mutableElements().filter(selector); + } + + var map = _p.map; + + for (var i = 0; i < toAdd.length; i++) { + var toAddEle = toAdd[i]; + var id = toAddEle._private.data.id; + var add = !map.has(id); + + if (add) { + var index = this.length++; + + this[index] = toAddEle; + + map.set(id, { ele: toAddEle, index: index }); + } else { + // replace + var _index = map.get(id).index; + + this[_index] = toAddEle; + map.set(id, { ele: toAddEle, index: _index }); + } + } + + return this; // chaining + }, + + // remove single ele in place in calling collection + unmergeOne: function unmergeOne(ele) { + ele = ele[0]; + + var _p = this._private; + var id = ele._private.data.id; + var map = _p.map; + var entry = map.get(id); + + if (!entry) { + return this; // no need to remove + } + + var i = entry.index; + + // remove ele + this[i] = undefined; + map.delete(id); + + var unmergedLastEle = i === this.length - 1; + + // replace empty spot with last ele in collection + if (this.length > 1 && !unmergedLastEle) { + var lastEleI = this.length - 1; + var lastEle = this[lastEleI]; + var lastEleId = lastEle._private.data.id; + + this[lastEleI] = undefined; + this[i] = lastEle; + map.set(lastEleId, { ele: lastEle, index: i }); + } + + // the collection is now 1 ele smaller + this.length--; + + return this; + }, + + // remove eles in place on calling collection + unmerge: function unmerge(toRemove) { + var cy = this._private.cy; + + if (!toRemove) { + return this; + } + + if (toRemove && is.string(toRemove)) { + var selector = toRemove; + toRemove = cy.mutableElements().filter(selector); + } + + for (var i = 0; i < toRemove.length; i++) { + this.unmergeOne(toRemove[i]); + } + + return this; // chaining + }, + + map: function map(mapFn, thisArg) { + var arr = []; + var eles = this; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + var ret = thisArg ? mapFn.apply(thisArg, [ele, i, eles]) : mapFn(ele, i, eles); + + arr.push(ret); + } + + return arr; + }, + + reduce: function reduce(fn, initialValue) { + var val = initialValue; + var eles = this; + + for (var i = 0; i < eles.length; i++) { + val = fn(val, eles[i], i, eles); + } + + return val; + }, + + max: function max(valFn, thisArg) { + var max = -Infinity; + var maxEle = void 0; + var eles = this; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + var val = thisArg ? valFn.apply(thisArg, [ele, i, eles]) : valFn(ele, i, eles); + + if (val > max) { + max = val; + maxEle = ele; + } + } + + return { + value: max, + ele: maxEle + }; + }, + + min: function min(valFn, thisArg) { + var min = Infinity; + var minEle = void 0; + var eles = this; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + var val = thisArg ? valFn.apply(thisArg, [ele, i, eles]) : valFn(ele, i, eles); + + if (val < min) { + min = val; + minEle = ele; + } + } + + return { + value: min, + ele: minEle + }; + } +}; + +// aliases +var fn = elesfn; +fn['u'] = fn['|'] = fn['+'] = fn.union = fn.or = fn.add; +fn['\\'] = fn['!'] = fn['-'] = fn.difference = fn.relativeComplement = fn.subtract = fn.not; +fn['n'] = fn['&'] = fn['.'] = fn.and = fn.intersection = fn.intersect; +fn['^'] = fn['(+)'] = fn['(-)'] = fn.symmetricDifference = fn.symdiff = fn.xor; +fn.fnFilter = fn.filterFn = fn.stdFilter = fn.filter; +fn.complement = fn.abscomp = fn.absoluteComplement; + +module.exports = elesfn; + +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var elesfn = { + isNode: function isNode() { + return this.group() === 'nodes'; + }, + + isEdge: function isEdge() { + return this.group() === 'edges'; + }, + + isLoop: function isLoop() { + return this.isEdge() && this.source().id() === this.target().id(); + }, + + isSimple: function isSimple() { + return this.isEdge() && this.source().id() !== this.target().id(); + }, + + group: function group() { + var ele = this[0]; + + if (ele) { + return ele._private.group; + } + } +}; + +module.exports = elesfn; + +/***/ }), +/* 64 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var zIndexSort = __webpack_require__(17); +var util = __webpack_require__(1); + +var elesfn = { + forEach: function forEach(fn, thisArg) { + if (is.fn(fn)) { + + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + var ret = thisArg ? fn.apply(thisArg, [ele, i, this]) : fn(ele, i, this); + + if (ret === false) { + break; + } // exit each early on return false + } + } + + return this; + }, + + toArray: function toArray() { + var array = []; + + for (var i = 0; i < this.length; i++) { + array.push(this[i]); + } + + return array; + }, + + slice: function slice(start, end) { + var array = []; + var thisSize = this.length; + + if (end == null) { + end = thisSize; + } + + if (start == null) { + start = 0; + } + + if (start < 0) { + start = thisSize + start; + } + + if (end < 0) { + end = thisSize + end; + } + + for (var i = start; i >= 0 && i < end && i < thisSize; i++) { + array.push(this[i]); + } + + return this.spawn(array); + }, + + size: function size() { + return this.length; + }, + + eq: function eq(i) { + return this[i] || this.spawn(); + }, + + first: function first() { + return this[0] || this.spawn(); + }, + + last: function last() { + return this[this.length - 1] || this.spawn(); + }, + + empty: function empty() { + return this.length === 0; + }, + + nonempty: function nonempty() { + return !this.empty(); + }, + + sort: function sort(sortFn) { + if (!is.fn(sortFn)) { + return this; + } + + var sorted = this.toArray().sort(sortFn); + + return this.spawn(sorted); + }, + + sortByZIndex: function sortByZIndex() { + return this.sort(zIndexSort); + }, + + zDepth: function zDepth() { + var ele = this[0]; + if (!ele) { + return undefined; + } + + // let cy = ele.cy(); + var _p = ele._private; + var group = _p.group; + + if (group === 'nodes') { + var depth = _p.data.parent ? ele.parents().size() : 0; + + if (!ele.isParent()) { + return util.MAX_INT - 1; // childless nodes always on top + } + + return depth; + } else { + var src = _p.source; + var tgt = _p.target; + var srcDepth = src.zDepth(); + var tgtDepth = tgt.zDepth(); + + return Math.max(srcDepth, tgtDepth, 0); // depth of deepest parent + } + } +}; + +elesfn.each = elesfn.forEach; + +module.exports = elesfn; + +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var util = __webpack_require__(1); +var Promise = __webpack_require__(5); +var math = __webpack_require__(2); + +var elesfn = { + // Calculates and returns node dimensions { x, y } based on options given + layoutDimensions: function layoutDimensions(options) { + options = util.assign({ + nodeDimensionsIncludeLabels: true + }, options); + + if (options.nodeDimensionsIncludeLabels) { + var bbDim = this.boundingBox(); + return { + w: bbDim.w, + h: bbDim.h + }; + } else { + return { + w: this.outerWidth(), + h: this.outerHeight() + }; + } + }, + + // using standard layout options, apply position function (w/ or w/o animation) + layoutPositions: function layoutPositions(layout, options, fn) { + var nodes = this.nodes(); + var cy = this.cy(); + var layoutEles = options.eles; // nodes & edges + var getMemoizeKey = function getMemoizeKey(node, i) { + return node.id() + '$' + i; + }; + var fnMem = util.memoize(fn, getMemoizeKey); // memoized version of position function + + layout.emit({ type: 'layoutstart', layout: layout }); + + layout.animations = []; + + var calculateSpacing = function calculateSpacing(spacing, nodesBb, pos) { + var center = { + x: nodesBb.x1 + nodesBb.w / 2, + y: nodesBb.y1 + nodesBb.h / 2 + }; + + var spacingVector = { // scale from center of bounding box (not necessarily 0,0) + x: (pos.x - center.x) * spacing, + y: (pos.y - center.y) * spacing + }; + + return { + x: center.x + spacingVector.x, + y: center.y + spacingVector.y + }; + }; + + var useSpacingFactor = options.spacingFactor && options.spacingFactor !== 1; + + var spacingBb = function spacingBb() { + if (!useSpacingFactor) { + return null; + } + + var bb = math.makeBoundingBox(); + + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + var pos = fnMem(node, i); + + math.expandBoundingBoxByPoint(bb, pos.x, pos.y); + } + + return bb; + }; + + var bb = spacingBb(); + + var getFinalPos = util.memoize(function (node, i) { + var newPos = fnMem(node, i); + var pos = node.position(); + + if (!is.number(pos.x) || !is.number(pos.y)) { + node.silentPosition({ x: 0, y: 0 }); + } + + if (useSpacingFactor) { + var spacing = Math.abs(options.spacingFactor); + + newPos = calculateSpacing(spacing, bb, newPos); + } + + if (options.transform != null) { + newPos = options.transform(node, newPos); + } + + return newPos; + }, getMemoizeKey); + + if (options.animate) { + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + var newPos = getFinalPos(node, i); + var animateNode = options.animateFilter == null || options.animateFilter(node, i); + + if (animateNode) { + var ani = node.animation({ + position: newPos, + duration: options.animationDuration, + easing: options.animationEasing + }); + + layout.animations.push(ani); + + ani.play(); + } else { + node.position(newPos); + } + } + + if (options.fit) { + var fitAni = cy.animation({ + fit: { + boundingBox: layoutEles.boundingBoxAt(getFinalPos), + padding: options.padding + }, + duration: options.animationDuration, + easing: options.animationEasing + }); + + layout.animations.push(fitAni); + + fitAni.play(); + } else if (options.zoom !== undefined && options.pan !== undefined) { + var zoomPanAni = cy.animation({ + zoom: options.zoom, + pan: options.pan, + duration: options.animationDuration, + easing: options.animationEasing + }); + + layout.animations.push(zoomPanAni); + + zoomPanAni.play(); + } + + layout.one('layoutready', options.ready); + layout.emit({ type: 'layoutready', layout: layout }); + + Promise.all(layout.animations.map(function (ani) { + return ani.promise(); + })).then(function () { + layout.one('layoutstop', options.stop); + layout.emit({ type: 'layoutstop', layout: layout }); + }); + } else { + + nodes.positions(getFinalPos); + + if (options.fit) { + cy.fit(options.eles, options.padding); + } + + if (options.zoom != null) { + cy.zoom(options.zoom); + } + + if (options.pan) { + cy.pan(options.pan); + } + + layout.one('layoutready', options.ready); + layout.emit({ type: 'layoutready', layout: layout }); + + layout.one('layoutstop', options.stop); + layout.emit({ type: 'layoutstop', layout: layout }); + } + + return this; // chaining + }, + + layout: function layout(options) { + var cy = this.cy(); + + return cy.makeLayout(util.extend({}, options, { + eles: this + })); + } + +}; + +// aliases: +elesfn.createLayout = elesfn.makeLayout = elesfn.layout; + +module.exports = elesfn; + +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); + +function styleCache(key, fn, ele) { + var _p = ele._private; + var cache = _p.styleCache = _p.styleCache || {}; + var val; + + if ((val = cache[key]) != null) { + return val; + } else { + val = cache[key] = fn(ele); + + return val; + } +} + +function cacheStyleFunction(key, fn) { + return function cachedStyleFunction(ele) { + return styleCache(key, fn, ele); + }; +} + +function cachePrototypeStyleFunction(key, fn) { + var selfFn = function selfFn(ele) { + return fn.call(ele); + }; + + return function cachedPrototypeStyleFunction() { + var ele = this[0]; + + if (ele) { + return styleCache(key, selfFn, ele); + } + }; +} + +var elesfn = { + + recalculateRenderedStyle: function recalculateRenderedStyle(useCache) { + var cy = this.cy(); + var renderer = cy.renderer(); + var styleEnabled = cy.styleEnabled(); + + if (renderer && styleEnabled) { + renderer.recalculateRenderedStyle(this, useCache); + } + + return this; + }, + + dirtyStyleCache: function dirtyStyleCache() { + var cy = this.cy(); + var dirty = function dirty(ele) { + return ele._private.styleCache = {}; + }; + + if (cy.hasCompoundNodes()) { + var eles = void 0; + + eles = this.spawnSelf().merge(this.descendants()).merge(this.parents()); + + eles.merge(eles.connectedEdges()); + + eles.forEach(dirty); + } else { + this.forEach(function (ele) { + dirty(ele); + + ele.connectedEdges().forEach(dirty); + }); + } + + return this; + }, + + // fully updates (recalculates) the style for the elements + updateStyle: function updateStyle(notifyRenderer) { + var cy = this._private.cy; + + if (!cy.styleEnabled()) { + return this; + } + + if (cy._private.batchingStyle) { + var bEles = cy._private.batchStyleEles; + + bEles.merge(this); + + return this; // chaining and exit early when batching + } + + var hasCompounds = cy.hasCompoundNodes(); + var style = cy.style(); + var updatedEles = this; + + notifyRenderer = notifyRenderer || notifyRenderer === undefined ? true : false; + + if (hasCompounds) { + // then add everything up and down for compound selector checks + updatedEles = this.spawnSelf().merge(this.descendants()).merge(this.parents()); + } + + var changedEles = style.apply(updatedEles); + + changedEles.dirtyStyleCache(); + changedEles.dirtyCompoundBoundsCache(); + + if (notifyRenderer) { + changedEles.emitAndNotify('style'); // let renderer know we changed style + } else { + changedEles.emit('style'); // just fire the event + } + + return this; // chaining + }, + + // just update the mappers in the elements' styles; cheaper than eles.updateStyle() + updateMappers: function updateMappers(notifyRenderer) { + var cy = this._private.cy; + var style = cy.style(); + notifyRenderer = notifyRenderer || notifyRenderer === undefined ? true : false; + + if (!cy.styleEnabled()) { + return this; + } + + var changedEles = style.updateMappers(this); + + changedEles.dirtyStyleCache(); + changedEles.dirtyCompoundBoundsCache(); + + if (notifyRenderer) { + changedEles.emitAndNotify('style'); // let renderer know we changed style + } else { + changedEles.emit('style'); // just fire the event + } + return this; // chaining + }, + + // get the internal parsed style object for the specified property + parsedStyle: function parsedStyle(property) { + var ele = this[0]; + var cy = ele.cy(); + + if (!cy.styleEnabled()) { + return; + } + + if (ele) { + return ele._private.style[property] || cy.style().getDefaultProperty(property); + } + }, + + numericStyle: function numericStyle(property) { + var ele = this[0]; + + if (!ele.cy().styleEnabled()) { + return; + } + + if (ele) { + var pstyle = ele.pstyle(property); + + return pstyle.pfValue !== undefined ? pstyle.pfValue : pstyle.value; + } + }, + + numericStyleUnits: function numericStyleUnits(property) { + var ele = this[0]; + + if (!ele.cy().styleEnabled()) { + return; + } + + if (ele) { + return ele.pstyle(property).units; + } + }, + + // get the specified css property as a rendered value (i.e. on-screen value) + // or get the whole rendered style if no property specified (NB doesn't allow setting) + renderedStyle: function renderedStyle(property) { + var cy = this.cy(); + if (!cy.styleEnabled()) { + return this; + } + + var ele = this[0]; + + if (ele) { + return cy.style().getRenderedStyle(ele, property); + } + }, + + // read the calculated css style of the element or override the style (via a bypass) + style: function style(name, value) { + var cy = this.cy(); + + if (!cy.styleEnabled()) { + return this; + } + + var updateTransitions = false; + var style = cy.style(); + + if (is.plainObject(name)) { + // then extend the bypass + var props = name; + style.applyBypass(this, props, updateTransitions); + + this.dirtyStyleCache(); + this.dirtyCompoundBoundsCache(); + + this.emitAndNotify('style'); // let the renderer know we've updated style + } else if (is.string(name)) { + + if (value === undefined) { + // then get the property from the style + var ele = this[0]; + + if (ele) { + return style.getStylePropertyValue(ele, name); + } else { + // empty collection => can't get any value + return; + } + } else { + // then set the bypass with the property value + style.applyBypass(this, name, value, updateTransitions); + + this.dirtyStyleCache(); + this.dirtyCompoundBoundsCache(); + + this.emitAndNotify('style'); // let the renderer know we've updated style + } + } else if (name === undefined) { + var _ele = this[0]; + + if (_ele) { + return style.getRawStyle(_ele); + } else { + // empty collection => can't get any value + return; + } + } + + return this; // chaining + }, + + removeStyle: function removeStyle(names) { + var cy = this.cy(); + + if (!cy.styleEnabled()) { + return this; + } + + var updateTransitions = false; + var style = cy.style(); + var eles = this; + + if (names === undefined) { + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + + style.removeAllBypasses(ele, updateTransitions); + } + } else { + names = names.split(/\s+/); + + for (var _i = 0; _i < eles.length; _i++) { + var _ele2 = eles[_i]; + + style.removeBypasses(_ele2, names, updateTransitions); + } + } + + this.dirtyStyleCache(); + this.dirtyCompoundBoundsCache(); + + this.emitAndNotify('style'); // let the renderer know we've updated style + + return this; // chaining + }, + + show: function show() { + this.css('display', 'element'); + return this; // chaining + }, + + hide: function hide() { + this.css('display', 'none'); + return this; // chaining + }, + + effectiveOpacity: function effectiveOpacity() { + var cy = this.cy(); + if (!cy.styleEnabled()) { + return 1; + } + + var hasCompoundNodes = cy.hasCompoundNodes(); + var ele = this[0]; + + if (ele) { + var _p = ele._private; + var parentOpacity = ele.pstyle('opacity').value; + + if (!hasCompoundNodes) { + return parentOpacity; + } + + var parents = !_p.data.parent ? null : ele.parents(); + + if (parents) { + for (var i = 0; i < parents.length; i++) { + var parent = parents[i]; + var opacity = parent.pstyle('opacity').value; + + parentOpacity = opacity * parentOpacity; + } + } + + return parentOpacity; + } + }, + + transparent: function transparent() { + var cy = this.cy(); + if (!cy.styleEnabled()) { + return false; + } + + var ele = this[0]; + var hasCompoundNodes = ele.cy().hasCompoundNodes(); + + if (ele) { + if (!hasCompoundNodes) { + return ele.pstyle('opacity').value === 0; + } else { + return ele.effectiveOpacity() === 0; + } + } + }, + + backgrounding: function backgrounding() { + var cy = this.cy(); + if (!cy.styleEnabled()) { + return false; + } + + var ele = this[0]; + + return ele._private.backgrounding ? true : false; + } + +}; + +function checkCompound(ele, parentOk) { + var _p = ele._private; + var parents = _p.data.parent ? ele.parents() : null; + + if (parents) { + for (var i = 0; i < parents.length; i++) { + var parent = parents[i]; + + if (!parentOk(parent)) { + return false; + } + } + } + + return true; +} + +function defineDerivedStateFunction(specs) { + var ok = specs.ok; + var edgeOkViaNode = specs.edgeOkViaNode || specs.ok; + var parentOk = specs.parentOk || specs.ok; + + return function () { + var cy = this.cy(); + if (!cy.styleEnabled()) { + return true; + } + + var ele = this[0]; + var hasCompoundNodes = cy.hasCompoundNodes(); + + if (ele) { + var _p = ele._private; + + if (!ok(ele)) { + return false; + } + + if (ele.isNode()) { + return !hasCompoundNodes || checkCompound(ele, parentOk); + } else { + var src = _p.source; + var tgt = _p.target; + + return edgeOkViaNode(src) && (!hasCompoundNodes || checkCompound(src, edgeOkViaNode)) && (src === tgt || edgeOkViaNode(tgt) && (!hasCompoundNodes || checkCompound(tgt, edgeOkViaNode))); + } + } + }; +} + +var eleTakesUpSpace = cacheStyleFunction('eleTakesUpSpace', function (ele) { + return ele.pstyle('display').value === 'element' && ele.width() !== 0 && (ele.isNode() ? ele.height() !== 0 : true); +}); + +elesfn.takesUpSpace = cachePrototypeStyleFunction('takesUpSpace', defineDerivedStateFunction({ + ok: eleTakesUpSpace +})); + +var eleInteractive = cacheStyleFunction('eleInteractive', function (ele) { + return ele.pstyle('events').value === 'yes' && ele.pstyle('visibility').value === 'visible' && eleTakesUpSpace(ele); +}); + +var parentInteractive = cacheStyleFunction('parentInteractive', function (parent) { + return parent.pstyle('visibility').value === 'visible' && eleTakesUpSpace(parent); +}); + +elesfn.interactive = cachePrototypeStyleFunction('interactive', defineDerivedStateFunction({ + ok: eleInteractive, + parentOk: parentInteractive, + edgeOkViaNode: eleTakesUpSpace +})); + +elesfn.noninteractive = function () { + var ele = this[0]; + + if (ele) { + return !ele.interactive(); + } +}; + +var eleVisible = cacheStyleFunction('eleVisible', function (ele) { + return ele.pstyle('visibility').value === 'visible' && ele.pstyle('opacity').pfValue !== 0 && eleTakesUpSpace(ele); +}); + +var edgeVisibleViaNode = eleTakesUpSpace; + +elesfn.visible = cachePrototypeStyleFunction('visible', defineDerivedStateFunction({ + ok: eleVisible, + edgeOkViaNode: edgeVisibleViaNode +})); + +elesfn.hidden = function () { + var ele = this[0]; + + if (ele) { + return !ele.visible(); + } +}; + +elesfn.bypass = elesfn.css = elesfn.style; +elesfn.renderedCss = elesfn.renderedStyle; +elesfn.removeBypass = elesfn.removeCss = elesfn.removeStyle; +elesfn.pstyle = elesfn.parsedStyle; + +module.exports = elesfn; + +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var elesfn = {}; + +function defineSwitchFunction(params) { + return function () { + var args = arguments; + var changedEles = []; + + // e.g. cy.nodes().select( data, handler ) + if (args.length === 2) { + var data = args[0]; + var handler = args[1]; + this.on(params.event, data, handler); + } + + // e.g. cy.nodes().select( handler ) + else if (args.length === 1) { + var _handler = args[0]; + this.on(params.event, _handler); + } + + // e.g. cy.nodes().select() + else if (args.length === 0) { + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + var able = !params.ableField || ele._private[params.ableField]; + var changed = ele._private[params.field] != params.value; + + if (params.overrideAble) { + var overrideAble = params.overrideAble(ele); + + if (overrideAble !== undefined) { + able = overrideAble; + + if (!overrideAble) { + return this; + } // to save cycles assume not able for all on override + } + } + + if (able) { + ele._private[params.field] = params.value; + + if (changed) { + changedEles.push(ele); + } + } + } + + var changedColl = this.spawn(changedEles); + changedColl.updateStyle(); // change of state => possible change of style + changedColl.emit(params.event); + } + + return this; + }; +} + +function defineSwitchSet(params) { + elesfn[params.field] = function () { + var ele = this[0]; + + if (ele) { + if (params.overrideField) { + var val = params.overrideField(ele); + + if (val !== undefined) { + return val; + } + } + + return ele._private[params.field]; + } + }; + + elesfn[params.on] = defineSwitchFunction({ + event: params.on, + field: params.field, + ableField: params.ableField, + overrideAble: params.overrideAble, + value: true + }); + + elesfn[params.off] = defineSwitchFunction({ + event: params.off, + field: params.field, + ableField: params.ableField, + overrideAble: params.overrideAble, + value: false + }); +} + +defineSwitchSet({ + field: 'locked', + overrideField: function overrideField(ele) { + return ele.cy().autolock() ? true : undefined; + }, + on: 'lock', + off: 'unlock' +}); + +defineSwitchSet({ + field: 'grabbable', + overrideField: function overrideField(ele) { + return ele.cy().autoungrabify() ? false : undefined; + }, + on: 'grabify', + off: 'ungrabify' +}); + +defineSwitchSet({ + field: 'selected', + ableField: 'selectable', + overrideAble: function overrideAble(ele) { + return ele.cy().autounselectify() ? false : undefined; + }, + on: 'select', + off: 'unselect' +}); + +defineSwitchSet({ + field: 'selectable', + overrideField: function overrideField(ele) { + return ele.cy().autounselectify() ? false : undefined; + }, + on: 'selectify', + off: 'unselectify' +}); + +elesfn.deselect = elesfn.unselect; + +elesfn.grabbed = function () { + var ele = this[0]; + if (ele) { + return ele._private.grabbed; + } +}; + +defineSwitchSet({ + field: 'active', + on: 'activate', + off: 'unactivate' +}); + +elesfn.inactive = function () { + var ele = this[0]; + if (ele) { + return !ele._private.active; + } +}; + +module.exports = elesfn; + +/***/ }), +/* 68 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var is = __webpack_require__(0); + +var elesfn = {}; + +var cache = function cache(fn, name) { + return function traversalCache(arg1, arg2, arg3, arg4) { + var selectorOrEles = arg1; + var eles = this; + var key = void 0; + + if (selectorOrEles == null) { + key = 'null'; + } else if (is.elementOrCollection(selectorOrEles) && selectorOrEles.length === 1) { + key = '#' + selectorOrEles.id(); + } + + if (eles.length === 1 && key) { + var _p = eles[0]._private; + var tch = _p.traversalCache = _p.traversalCache || {}; + var ch = tch[name] = tch[name] || {}; + var cacheHit = ch[key]; + + if (cacheHit) { + return cacheHit; + } else { + return ch[key] = fn.call(eles, arg1, arg2, arg3, arg4); + } + } else { + return fn.call(eles, arg1, arg2, arg3, arg4); + } + }; +}; + +// DAG functions +//////////////// + +var defineDagExtremity = function defineDagExtremity(params) { + return function dagExtremityImpl(selector) { + var eles = this; + var ret = []; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + if (!ele.isNode()) { + continue; + } + + var disqualified = false; + var edges = ele.connectedEdges(); + + for (var j = 0; j < edges.length; j++) { + var edge = edges[j]; + var src = edge.source(); + var tgt = edge.target(); + + if (params.noIncomingEdges && tgt === ele && src !== ele || params.noOutgoingEdges && src === ele && tgt !== ele) { + disqualified = true; + break; + } + } + + if (!disqualified) { + ret.push(ele); + } + } + + return this.spawn(ret, { unique: true }).filter(selector); + }; +}; + +var defineDagOneHop = function defineDagOneHop(params) { + return function (selector) { + var eles = this; + var oEles = []; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + + if (!ele.isNode()) { + continue; + } + + var edges = ele.connectedEdges(); + for (var j = 0; j < edges.length; j++) { + var edge = edges[j]; + var src = edge.source(); + var tgt = edge.target(); + + if (params.outgoing && src === ele) { + oEles.push(edge); + oEles.push(tgt); + } else if (params.incoming && tgt === ele) { + oEles.push(edge); + oEles.push(src); + } + } + } + + return this.spawn(oEles, { unique: true }).filter(selector); + }; +}; + +var defineDagAllHops = function defineDagAllHops(params) { + return function (selector) { + var eles = this; + var sEles = []; + var sElesIds = {}; + + for (;;) { + var next = params.outgoing ? eles.outgoers() : eles.incomers(); + + if (next.length === 0) { + break; + } // done if none left + + var newNext = false; + for (var i = 0; i < next.length; i++) { + var n = next[i]; + var nid = n.id(); + + if (!sElesIds[nid]) { + sElesIds[nid] = true; + sEles.push(n); + newNext = true; + } + } + + if (!newNext) { + break; + } // done if touched all outgoers already + + eles = next; + } + + return this.spawn(sEles, { unique: true }).filter(selector); + }; +}; + +elesfn.clearTraversalCache = function () { + for (var i = 0; i < this.length; i++) { + this[i]._private.traversalCache = null; + } +}; + +util.extend(elesfn, { + // get the root nodes in the DAG + roots: defineDagExtremity({ noIncomingEdges: true }), + + // get the leaf nodes in the DAG + leaves: defineDagExtremity({ noOutgoingEdges: true }), + + // normally called children in graph theory + // these nodes =edges=> outgoing nodes + outgoers: cache(defineDagOneHop({ outgoing: true }), 'outgoers'), + + // aka DAG descendants + successors: defineDagAllHops({ outgoing: true }), + + // normally called parents in graph theory + // these nodes <=edges= incoming nodes + incomers: cache(defineDagOneHop({ incoming: true }), 'incomers'), + + // aka DAG ancestors + predecessors: defineDagAllHops({ incoming: true }) +}); + +// Neighbourhood functions +////////////////////////// + +util.extend(elesfn, { + neighborhood: cache(function (selector) { + var elements = []; + var nodes = this.nodes(); + + for (var i = 0; i < nodes.length; i++) { + // for all nodes + var node = nodes[i]; + var connectedEdges = node.connectedEdges(); + + // for each connected edge, add the edge and the other node + for (var j = 0; j < connectedEdges.length; j++) { + var edge = connectedEdges[j]; + var src = edge.source(); + var tgt = edge.target(); + var otherNode = node === src ? tgt : src; + + // need check in case of loop + if (otherNode.length > 0) { + elements.push(otherNode[0]); // add node 1 hop away + } + + // add connected edge + elements.push(edge[0]); + } + } + + return this.spawn(elements, { unique: true }).filter(selector); + }, 'neighborhood'), + + closedNeighborhood: function closedNeighborhood(selector) { + return this.neighborhood().add(this).filter(selector); + }, + + openNeighborhood: function openNeighborhood(selector) { + return this.neighborhood(selector); + } +}); + +// aliases +elesfn.neighbourhood = elesfn.neighborhood; +elesfn.closedNeighbourhood = elesfn.closedNeighborhood; +elesfn.openNeighbourhood = elesfn.openNeighborhood; + +// Edge functions +///////////////// + +util.extend(elesfn, { + source: cache(function sourceImpl(selector) { + var ele = this[0]; + var src = void 0; + + if (ele) { + src = ele._private.source || ele.cy().collection(); + } + + return src && selector ? src.filter(selector) : src; + }, 'source'), + + target: cache(function targetImpl(selector) { + var ele = this[0]; + var tgt = void 0; + + if (ele) { + tgt = ele._private.target || ele.cy().collection(); + } + + return tgt && selector ? tgt.filter(selector) : tgt; + }, 'target'), + + sources: defineSourceFunction({ + attr: 'source' + }), + + targets: defineSourceFunction({ + attr: 'target' + }) +}); + +function defineSourceFunction(params) { + return function sourceImpl(selector) { + var sources = []; + + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + var src = ele._private[params.attr]; + + if (src) { + sources.push(src); + } + } + + return this.spawn(sources, { unique: true }).filter(selector); + }; +} + +util.extend(elesfn, { + edgesWith: cache(defineEdgesWithFunction(), 'edgesWith'), + + edgesTo: cache(defineEdgesWithFunction({ + thisIsSrc: true + }), 'edgesTo') +}); + +function defineEdgesWithFunction(params) { + + return function edgesWithImpl(otherNodes) { + var elements = []; + var cy = this._private.cy; + var p = params || {}; + + // get elements if a selector is specified + if (is.string(otherNodes)) { + otherNodes = cy.$(otherNodes); + } + + for (var h = 0; h < otherNodes.length; h++) { + var edges = otherNodes[h]._private.edges; + + for (var i = 0; i < edges.length; i++) { + var edge = edges[i]; + var edgeData = edge._private.data; + var thisToOther = this.hasElementWithId(edgeData.source) && otherNodes.hasElementWithId(edgeData.target); + var otherToThis = otherNodes.hasElementWithId(edgeData.source) && this.hasElementWithId(edgeData.target); + var edgeConnectsThisAndOther = thisToOther || otherToThis; + + if (!edgeConnectsThisAndOther) { + continue; + } + + if (p.thisIsSrc || p.thisIsTgt) { + if (p.thisIsSrc && !thisToOther) { + continue; + } + + if (p.thisIsTgt && !otherToThis) { + continue; + } + } + + elements.push(edge); + } + } + + return this.spawn(elements, { unique: true }); + }; +} + +util.extend(elesfn, { + connectedEdges: cache(function (selector) { + var retEles = []; + + var eles = this; + for (var i = 0; i < eles.length; i++) { + var node = eles[i]; + if (!node.isNode()) { + continue; + } + + var edges = node._private.edges; + + for (var j = 0; j < edges.length; j++) { + var edge = edges[j]; + retEles.push(edge); + } + } + + return this.spawn(retEles, { unique: true }).filter(selector); + }, 'connectedEdges'), + + connectedNodes: cache(function (selector) { + var retEles = []; + + var eles = this; + for (var i = 0; i < eles.length; i++) { + var edge = eles[i]; + if (!edge.isEdge()) { + continue; + } + + retEles.push(edge.source()[0]); + retEles.push(edge.target()[0]); + } + + return this.spawn(retEles, { unique: true }).filter(selector); + }, 'connectedNodes'), + + parallelEdges: cache(defineParallelEdgesFunction(), 'parallelEdges'), + + codirectedEdges: cache(defineParallelEdgesFunction({ + codirected: true + }), 'codirectedEdges') +}); + +function defineParallelEdgesFunction(params) { + var defaults = { + codirected: false + }; + params = util.extend({}, defaults, params); + + return function parallelEdgesImpl(selector) { + // micro-optimised for renderer + var elements = []; + var edges = this.edges(); + var p = params; + + // look at all the edges in the collection + for (var i = 0; i < edges.length; i++) { + var edge1 = edges[i]; + var edge1_p = edge1._private; + var src1 = edge1_p.source; + var srcid1 = src1._private.data.id; + var tgtid1 = edge1_p.data.target; + var srcEdges1 = src1._private.edges; + + // look at edges connected to the src node of this edge + for (var j = 0; j < srcEdges1.length; j++) { + var edge2 = srcEdges1[j]; + var edge2data = edge2._private.data; + var tgtid2 = edge2data.target; + var srcid2 = edge2data.source; + + var codirected = tgtid2 === tgtid1 && srcid2 === srcid1; + var oppdirected = srcid1 === tgtid2 && tgtid1 === srcid2; + + if (p.codirected && codirected || !p.codirected && (codirected || oppdirected)) { + elements.push(edge2); + } + } + } + + return this.spawn(elements, { unique: true }).filter(selector); + }; +} + +// Misc functions +///////////////// + +util.extend(elesfn, { + components: function components() { + var self = this; + var cy = self.cy(); + var visited = self.spawn(); + var unvisited = self.nodes().spawnSelf(); + var components = []; + + var visitInComponent = function visitInComponent(node, component) { + visited.merge(node); + unvisited.unmerge(node); + component.merge(node); + }; + + if (unvisited.empty()) { + return self.spawn(); + } + + var _loop = function _loop() { + var component = cy.collection(); + components.push(component); + + var root = unvisited[0]; + visitInComponent(root, component); + + self.bfs({ + directed: false, + roots: root, + visit: function visit(v, e, u, i, depth) { + visitInComponent(v, component); + } + }); + }; + + do { + _loop(); + } while (unvisited.length > 0); + + return components.map(function (component) { + var connectedEdges = component.connectedEdges().stdFilter(function (edge) { + return component.anySame(edge.source()) && component.anySame(edge.target()); + }); + + return component.union(connectedEdges); + }); + } +}); + +module.exports = elesfn; + +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var util = __webpack_require__(1); +var Collection = __webpack_require__(7); +var Element = __webpack_require__(14); + +var corefn = { + add: function add(opts) { + + var elements = void 0; + var cy = this; + + // add the elements + if (is.elementOrCollection(opts)) { + var eles = opts; + + if (eles._private.cy === cy) { + // same instance => just restore + elements = eles.restore(); + } else { + // otherwise, copy from json + var jsons = []; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + jsons.push(ele.json()); + } + + elements = new Collection(cy, jsons); + } + } + + // specify an array of options + else if (is.array(opts)) { + var _jsons = opts; + + elements = new Collection(cy, _jsons); + } + + // specify via opts.nodes and opts.edges + else if (is.plainObject(opts) && (is.array(opts.nodes) || is.array(opts.edges))) { + var elesByGroup = opts; + var _jsons2 = []; + + var grs = ['nodes', 'edges']; + for (var _i = 0, il = grs.length; _i < il; _i++) { + var group = grs[_i]; + var elesArray = elesByGroup[group]; + + if (is.array(elesArray)) { + + for (var j = 0, jl = elesArray.length; j < jl; j++) { + var json = util.extend({ group: group }, elesArray[j]); + + _jsons2.push(json); + } + } + } + + elements = new Collection(cy, _jsons2); + } + + // specify options for one element + else { + var _json = opts; + elements = new Element(cy, _json).collection(); + } + + return elements; + }, + + remove: function remove(collection) { + if (is.elementOrCollection(collection)) { + // already have right ref + } else if (is.string(collection)) { + var selector = collection; + collection = this.$(selector); + } + + return collection.remove(); + } +}; + +module.exports = corefn; + +/***/ }), +/* 70 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var define = __webpack_require__(4); +var util = __webpack_require__(1); +var stepAll = __webpack_require__(71); + +var corefn = { + + // pull in animation functions + animate: define.animate(), + animation: define.animation(), + animated: define.animated(), + clearQueue: define.clearQueue(), + delay: define.delay(), + delayAnimation: define.delayAnimation(), + stop: define.stop(), + + addToAnimationPool: function addToAnimationPool(eles) { + var cy = this; + + if (!cy.styleEnabled()) { + return; + } // save cycles when no style used + + cy._private.aniEles.merge(eles); + }, + + stopAnimationLoop: function stopAnimationLoop() { + this._private.animationsRunning = false; + }, + + startAnimationLoop: function startAnimationLoop() { + var cy = this; + + cy._private.animationsRunning = true; + + if (!cy.styleEnabled()) { + return; + } // save cycles when no style used + + // NB the animation loop will exec in headless environments if style enabled + // and explicit cy.destroy() is necessary to stop the loop + + function headlessStep() { + if (!cy._private.animationsRunning) { + return; + } + + util.requestAnimationFrame(function animationStep(now) { + stepAll(now, cy); + headlessStep(); + }); + } + + var renderer = cy.renderer(); + + if (renderer && renderer.beforeRender) { + // let the renderer schedule animations + renderer.beforeRender(function rendererAnimationStep(willDraw, now) { + stepAll(now, cy); + }, renderer.beforeRenderPriorities.animations); + } else { + // manage the animation loop ourselves + headlessStep(); // first call + } + } + +}; + +module.exports = corefn; + +/***/ }), +/* 71 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var step = __webpack_require__(72); +var startAnimation = __webpack_require__(77); + +function stepAll(now, cy) { + var eles = cy._private.aniEles; + var doneEles = []; + + function stepOne(ele, isCore) { + var _p = ele._private; + var current = _p.animation.current; + var queue = _p.animation.queue; + var ranAnis = false; + + // cancel all animations on display:none ele + if (!isCore && ele.pstyle('display').value === 'none') { + // put all current and queue animations in this tick's current list + // and empty the lists for the element + current = current.splice(0, current.length).concat(queue.splice(0, queue.length)); + + // stop all animations + for (var i = 0; i < current.length; i++) { + current[i].stop(); + } + } + + // if nothing currently animating, get something from the queue + if (current.length === 0) { + var next = queue.shift(); + + if (next) { + current.push(next); + } + } + + var callbacks = function callbacks(_callbacks) { + for (var j = _callbacks.length - 1; j >= 0; j--) { + var cb = _callbacks[j]; + + cb(); + } + + _callbacks.splice(0, _callbacks.length); + }; + + // step and remove if done + for (var _i = current.length - 1; _i >= 0; _i--) { + var ani = current[_i]; + var ani_p = ani._private; + + if (ani_p.stopped) { + current.splice(_i, 1); + + ani_p.hooked = false; + ani_p.playing = false; + ani_p.started = false; + + callbacks(ani_p.frames); + + continue; + } + + if (!ani_p.playing && !ani_p.applying) { + continue; + } + + // an apply() while playing shouldn't do anything + if (ani_p.playing && ani_p.applying) { + ani_p.applying = false; + } + + if (!ani_p.started) { + startAnimation(ele, ani, now, isCore); + } + + step(ele, ani, now, isCore); + + if (ani_p.applying) { + ani_p.applying = false; + } + + callbacks(ani_p.frames); + + if (ani.completed()) { + current.splice(_i, 1); + + ani_p.hooked = false; + ani_p.playing = false; + ani_p.started = false; + + callbacks(ani_p.completes); + } + + ranAnis = true; + } + + if (!isCore && current.length === 0 && queue.length === 0) { + doneEles.push(ele); + } + + return ranAnis; + } // stepElement + + // handle all eles + var ranEleAni = false; + for (var e = 0; e < eles.length; e++) { + var ele = eles[e]; + var handledThisEle = stepOne(ele); + + ranEleAni = ranEleAni || handledThisEle; + } // each element + + var ranCoreAni = stepOne(cy, true); + + // notify renderer + if (ranEleAni || ranCoreAni) { + if (eles.length > 0) { + eles.dirtyCompoundBoundsCache(); + + cy.notify({ + type: 'draw', + eles: eles + }); + } else { + cy.notify({ + type: 'draw' + }); + } + } + + // remove elements from list of currently animating if its queues are empty + eles.unmerge(doneEles); + + cy.emit('step'); +} // stepAll + +module.exports = stepAll; + +/***/ }), +/* 72 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var easings = __webpack_require__(73); +var ease = __webpack_require__(76); +var is = __webpack_require__(0); + +function step(self, ani, now, isCore) { + var isEles = !isCore; + var _p = self._private; + var ani_p = ani._private; + var pEasing = ani_p.easing; + var startTime = ani_p.startTime; + var cy = isCore ? self : self.cy(); + var style = cy.style(); + + if (!ani_p.easingImpl) { + + if (pEasing == null) { + // use default + ani_p.easingImpl = easings['linear']; + } else { + // then define w/ name + var easingVals = void 0; + + if (is.string(pEasing)) { + var easingProp = style.parse('transition-timing-function', pEasing); + + easingVals = easingProp.value; + } else { + // then assume preparsed array + easingVals = pEasing; + } + + var name = void 0, + args = void 0; + + if (is.string(easingVals)) { + name = easingVals; + args = []; + } else { + name = easingVals[1]; + args = easingVals.slice(2).map(function (n) { + return +n; + }); + } + + if (args.length > 0) { + // create with args + if (name === 'spring') { + args.push(ani_p.duration); // need duration to generate spring + } + + ani_p.easingImpl = easings[name].apply(null, args); + } else { + // static impl by name + ani_p.easingImpl = easings[name]; + } + } + } + + var easing = ani_p.easingImpl; + var percent = void 0; + + if (ani_p.duration === 0) { + percent = 1; + } else { + percent = (now - startTime) / ani_p.duration; + } + + if (ani_p.applying) { + percent = ani_p.progress; + } + + if (percent < 0) { + percent = 0; + } else if (percent > 1) { + percent = 1; + } + + if (ani_p.delay == null) { + // then update + + var startPos = ani_p.startPosition; + var endPos = ani_p.position; + + if (endPos && isEles && !self.locked()) { + var pos = self.position(); + + if (valid(startPos.x, endPos.x)) { + pos.x = ease(startPos.x, endPos.x, percent, easing); + } + + if (valid(startPos.y, endPos.y)) { + pos.y = ease(startPos.y, endPos.y, percent, easing); + } + + self.emit('position'); + } + + var startPan = ani_p.startPan; + var endPan = ani_p.pan; + var pan = _p.pan; + var animatingPan = endPan != null && isCore; + if (animatingPan) { + if (valid(startPan.x, endPan.x)) { + pan.x = ease(startPan.x, endPan.x, percent, easing); + } + + if (valid(startPan.y, endPan.y)) { + pan.y = ease(startPan.y, endPan.y, percent, easing); + } + + self.emit('pan'); + } + + var startZoom = ani_p.startZoom; + var endZoom = ani_p.zoom; + var animatingZoom = endZoom != null && isCore; + if (animatingZoom) { + if (valid(startZoom, endZoom)) { + _p.zoom = ease(startZoom, endZoom, percent, easing); + } + + self.emit('zoom'); + } + + if (animatingPan || animatingZoom) { + self.emit('viewport'); + } + + var props = ani_p.style; + if (props && props.length > 0 && isEles) { + for (var i = 0; i < props.length; i++) { + var prop = props[i]; + var _name = prop.name; + var end = prop; + var start = ani_p.startStyle[_name]; + var propSpec = style.properties[start.name]; + var easedVal = ease(start, end, percent, easing, propSpec); + + style.overrideBypass(self, _name, easedVal); + } // for props + + self.emit('style'); + } // if + } + + ani_p.progress = percent; + + return percent; +} + +function valid(start, end) { + if (start == null || end == null) { + return false; + } + + if (is.number(start) && is.number(end)) { + return true; + } else if (start && end) { + return true; + } + + return false; +} + +module.exports = step; + +/***/ }), +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var generateCubicBezier = __webpack_require__(74); +var generateSpringRK4 = __webpack_require__(75); + +var cubicBezier = function cubicBezier(t1, p1, t2, p2) { + var bezier = generateCubicBezier(t1, p1, t2, p2); + + return function (start, end, percent) { + return start + (end - start) * bezier(percent); + }; +}; + +var easings = { + 'linear': function linear(start, end, percent) { + return start + (end - start) * percent; + }, + + // default easings + 'ease': cubicBezier(0.25, 0.1, 0.25, 1), + 'ease-in': cubicBezier(0.42, 0, 1, 1), + 'ease-out': cubicBezier(0, 0, 0.58, 1), + 'ease-in-out': cubicBezier(0.42, 0, 0.58, 1), + + // sine + 'ease-in-sine': cubicBezier(0.47, 0, 0.745, 0.715), + 'ease-out-sine': cubicBezier(0.39, 0.575, 0.565, 1), + 'ease-in-out-sine': cubicBezier(0.445, 0.05, 0.55, 0.95), + + // quad + 'ease-in-quad': cubicBezier(0.55, 0.085, 0.68, 0.53), + 'ease-out-quad': cubicBezier(0.25, 0.46, 0.45, 0.94), + 'ease-in-out-quad': cubicBezier(0.455, 0.03, 0.515, 0.955), + + // cubic + 'ease-in-cubic': cubicBezier(0.55, 0.055, 0.675, 0.19), + 'ease-out-cubic': cubicBezier(0.215, 0.61, 0.355, 1), + 'ease-in-out-cubic': cubicBezier(0.645, 0.045, 0.355, 1), + + // quart + 'ease-in-quart': cubicBezier(0.895, 0.03, 0.685, 0.22), + 'ease-out-quart': cubicBezier(0.165, 0.84, 0.44, 1), + 'ease-in-out-quart': cubicBezier(0.77, 0, 0.175, 1), + + // quint + 'ease-in-quint': cubicBezier(0.755, 0.05, 0.855, 0.06), + 'ease-out-quint': cubicBezier(0.23, 1, 0.32, 1), + 'ease-in-out-quint': cubicBezier(0.86, 0, 0.07, 1), + + // expo + 'ease-in-expo': cubicBezier(0.95, 0.05, 0.795, 0.035), + 'ease-out-expo': cubicBezier(0.19, 1, 0.22, 1), + 'ease-in-out-expo': cubicBezier(1, 0, 0, 1), + + // circ + 'ease-in-circ': cubicBezier(0.6, 0.04, 0.98, 0.335), + 'ease-out-circ': cubicBezier(0.075, 0.82, 0.165, 1), + 'ease-in-out-circ': cubicBezier(0.785, 0.135, 0.15, 0.86), + + // user param easings... + + 'spring': function spring(tension, friction, duration) { + if (duration === 0) { + // can't get a spring w/ duration 0 + return easings.linear; // duration 0 => jump to end so impl doesn't matter + } + + var spring = generateSpringRK4(tension, friction, duration); + + return function (start, end, percent) { + return start + (end - start) * spring(percent); + }; + }, + + 'cubic-bezier': cubicBezier +}; + +module.exports = easings; + +/***/ }), +/* 74 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* global Float32Array */ + +/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */ +function generateCubicBezier(mX1, mY1, mX2, mY2) { + var NEWTON_ITERATIONS = 4, + NEWTON_MIN_SLOPE = 0.001, + SUBDIVISION_PRECISION = 0.0000001, + SUBDIVISION_MAX_ITERATIONS = 10, + kSplineTableSize = 11, + kSampleStepSize = 1.0 / (kSplineTableSize - 1.0), + float32ArraySupported = typeof Float32Array !== 'undefined'; + + /* Must contain four arguments. */ + if (arguments.length !== 4) { + return false; + } + + /* Arguments must be numbers. */ + for (var i = 0; i < 4; ++i) { + if (typeof arguments[i] !== "number" || isNaN(arguments[i]) || !isFinite(arguments[i])) { + return false; + } + } + + /* X values must be in the [0, 1] range. */ + mX1 = Math.min(mX1, 1); + mX2 = Math.min(mX2, 1); + mX1 = Math.max(mX1, 0); + mX2 = Math.max(mX2, 0); + + var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize); + + function A(aA1, aA2) { + return 1.0 - 3.0 * aA2 + 3.0 * aA1; + } + + function B(aA1, aA2) { + return 3.0 * aA2 - 6.0 * aA1; + } + + function C(aA1) { + return 3.0 * aA1; + } + + function calcBezier(aT, aA1, aA2) { + return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; + } + + function getSlope(aT, aA1, aA2) { + return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); + } + + function newtonRaphsonIterate(aX, aGuessT) { + for (var _i = 0; _i < NEWTON_ITERATIONS; ++_i) { + var currentSlope = getSlope(aGuessT, mX1, mX2); + + if (currentSlope === 0.0) { + return aGuessT; + } + + var currentX = calcBezier(aGuessT, mX1, mX2) - aX; + aGuessT -= currentX / currentSlope; + } + + return aGuessT; + } + + function calcSampleValues() { + for (var _i2 = 0; _i2 < kSplineTableSize; ++_i2) { + mSampleValues[_i2] = calcBezier(_i2 * kSampleStepSize, mX1, mX2); + } + } + + function binarySubdivide(aX, aA, aB) { + var currentX = void 0, + currentT = void 0, + i = 0; + + do { + currentT = aA + (aB - aA) / 2.0; + currentX = calcBezier(currentT, mX1, mX2) - aX; + if (currentX > 0.0) { + aB = currentT; + } else { + aA = currentT; + } + } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS); + + return currentT; + } + + function getTForX(aX) { + var intervalStart = 0.0, + currentSample = 1, + lastSample = kSplineTableSize - 1; + + for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) { + intervalStart += kSampleStepSize; + } + + --currentSample; + + var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]), + guessForT = intervalStart + dist * kSampleStepSize, + initialSlope = getSlope(guessForT, mX1, mX2); + + if (initialSlope >= NEWTON_MIN_SLOPE) { + return newtonRaphsonIterate(aX, guessForT); + } else if (initialSlope === 0.0) { + return guessForT; + } else { + return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize); + } + } + + var _precomputed = false; + + function precompute() { + _precomputed = true; + if (mX1 !== mY1 || mX2 !== mY2) { + calcSampleValues(); + } + } + + var f = function f(aX) { + if (!_precomputed) { + precompute(); + } + if (mX1 === mY1 && mX2 === mY2) { + return aX; + } + if (aX === 0) { + return 0; + } + if (aX === 1) { + return 1; + } + + return calcBezier(getTForX(aX), mY1, mY2); + }; + + f.getControlPoints = function () { + return [{ + x: mX1, + y: mY1 + }, { + x: mX2, + y: mY2 + }]; + }; + + var str = "generateBezier(" + [mX1, mY1, mX2, mY2] + ")"; + f.toString = function () { + return str; + }; + + return f; +} + +module.exports = generateCubicBezier; + +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */ +/* Given a tension, friction, and duration, a simulation at 60FPS will first run without a defined duration in order to calculate the full path. A second pass + then adjusts the time delta -- using the relation between actual time and duration -- to calculate the path for the duration-constrained animation. */ +var generateSpringRK4 = function () { + function springAccelerationForState(state) { + return -state.tension * state.x - state.friction * state.v; + } + + function springEvaluateStateWithDerivative(initialState, dt, derivative) { + var state = { + x: initialState.x + derivative.dx * dt, + v: initialState.v + derivative.dv * dt, + tension: initialState.tension, + friction: initialState.friction + }; + + return { dx: state.v, dv: springAccelerationForState(state) }; + } + + function springIntegrateState(state, dt) { + var a = { + dx: state.v, + dv: springAccelerationForState(state) + }, + b = springEvaluateStateWithDerivative(state, dt * 0.5, a), + c = springEvaluateStateWithDerivative(state, dt * 0.5, b), + d = springEvaluateStateWithDerivative(state, dt, c), + dxdt = 1.0 / 6.0 * (a.dx + 2.0 * (b.dx + c.dx) + d.dx), + dvdt = 1.0 / 6.0 * (a.dv + 2.0 * (b.dv + c.dv) + d.dv); + + state.x = state.x + dxdt * dt; + state.v = state.v + dvdt * dt; + + return state; + } + + return function springRK4Factory(tension, friction, duration) { + + var initState = { + x: -1, + v: 0, + tension: null, + friction: null + }, + path = [0], + time_lapsed = 0, + tolerance = 1 / 10000, + DT = 16 / 1000, + have_duration = void 0, + dt = void 0, + last_state = void 0; + + tension = parseFloat(tension) || 500; + friction = parseFloat(friction) || 20; + duration = duration || null; + + initState.tension = tension; + initState.friction = friction; + + have_duration = duration !== null; + + /* Calculate the actual time it takes for this animation to complete with the provided conditions. */ + if (have_duration) { + /* Run the simulation without a duration. */ + time_lapsed = springRK4Factory(tension, friction); + /* Compute the adjusted time delta. */ + dt = time_lapsed / duration * DT; + } else { + dt = DT; + } + + for (;;) { + /* Next/step function .*/ + last_state = springIntegrateState(last_state || initState, dt); + /* Store the position. */ + path.push(1 + last_state.x); + time_lapsed += 16; + /* If the change threshold is reached, break. */ + if (!(Math.abs(last_state.x) > tolerance && Math.abs(last_state.v) > tolerance)) { + break; + } + } + + /* If duration is not defined, return the actual time required for completing this animation. Otherwise, return a closure that holds the + computed path and returns a snapshot of the position according to a given percentComplete. */ + return !have_duration ? time_lapsed : function (percentComplete) { + return path[percentComplete * (path.length - 1) | 0]; + }; + }; +}(); + +module.exports = generateSpringRK4; + +/***/ }), +/* 76 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); + +function getEasedValue(type, start, end, percent, easingFn) { + if (percent === 1) { + return end; + } + + var val = easingFn(start, end, percent); + + if (type == null) { + return val; + } + + if (type.roundValue || type.color) { + val = Math.round(val); + } + + if (type.min !== undefined) { + val = Math.max(val, type.min); + } + + if (type.max !== undefined) { + val = Math.min(val, type.max); + } + + return val; +} + +function getValue(prop, spec) { + if (prop.pfValue != null || prop.value != null) { + if (prop.pfValue != null && (spec == null || spec.type.units !== '%')) { + return prop.pfValue; + } else { + return prop.value; + } + } else { + return prop; + } +} + +function ease(startProp, endProp, percent, easingFn, propSpec) { + var type = propSpec != null ? propSpec.type : null; + + if (percent < 0) { + percent = 0; + } else if (percent > 1) { + percent = 1; + } + + var start = getValue(startProp, propSpec); + var end = getValue(endProp, propSpec); + + if (is.number(start) && is.number(end)) { + return getEasedValue(type, start, end, percent, easingFn); + } else if (is.array(start) && is.array(end)) { + var easedArr = []; + + for (var i = 0; i < end.length; i++) { + var si = start[i]; + var ei = end[i]; + + if (si != null && ei != null) { + var val = getEasedValue(type, si, ei, percent, easingFn); + + easedArr.push(val); + } else { + easedArr.push(ei); + } + } + + return easedArr; + } + + return undefined; +} + +module.exports = ease; + +/***/ }), +/* 77 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function startAnimation(self, ani, now, isCore) { + var isEles = !isCore; + var ele = self; + var ani_p = ani._private; + var cy = isCore ? self : self.cy(); + var style = cy.style(); + + if (isEles) { + var pos = ele.position(); + + ani_p.startPosition = ani_p.startPosition || { + x: pos.x, + y: pos.y + }; + + ani_p.startStyle = ani_p.startStyle || style.getAnimationStartStyle(ele, ani_p.style); + } + + if (isCore) { + var pan = cy._private.pan; + + ani_p.startPan = ani_p.startPan || { + x: pan.x, + y: pan.y + }; + + ani_p.startZoom = ani_p.startZoom != null ? ani_p.startZoom : cy._private.zoom; + } + + ani_p.started = true; + ani_p.startTime = now - ani_p.progress * ani_p.duration; +} + +module.exports = startAnimation; + +/***/ }), +/* 78 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Emitter = __webpack_require__(11); +var define = __webpack_require__(4); +var is = __webpack_require__(0); +var util = __webpack_require__(1); +var Selector = __webpack_require__(6); + +var emitterOptions = { + qualifierCompare: function qualifierCompare(selector1, selector2) { + if (selector1 == null || selector2 == null) { + return selector1 == null && selector2 == null; + } else { + return selector1.sameText(selector2); + } + }, + eventMatches: function eventMatches(cy, listener, eventObj) { + var selector = listener.qualifier; + + if (selector != null) { + return cy !== eventObj.target && is.element(eventObj.target) && selector.matches(eventObj.target); + } + + return true; + }, + eventFields: function eventFields(cy) { + return { + cy: cy, + target: cy + }; + }, + callbackContext: function callbackContext(cy, listener, eventObj) { + return listener.qualifier != null ? eventObj.target : cy; + } +}; + +var argSelector = function argSelector(arg) { + if (is.string(arg)) { + return new Selector(arg); + } else { + return arg; + } +}; + +var elesfn = { + createEmitter: function createEmitter() { + var _p = this._private; + + if (!_p.emitter) { + _p.emitter = new Emitter(util.assign({ + context: this + }, emitterOptions)); + } + + return this; + }, + + emitter: function emitter() { + return this._private.emitter; + }, + + on: function on(events, selector, callback) { + this.emitter().on(events, argSelector(selector), callback); + + return this; + }, + + removeListener: function removeListener(events, selector, callback) { + this.emitter().removeListener(events, argSelector(selector), callback); + + return this; + }, + + one: function one(events, selector, callback) { + this.emitter().one(events, argSelector(selector), callback); + + return this; + }, + + once: function once(events, selector, callback) { + this.emitter().one(events, argSelector(selector), callback); + + return this; + }, + + emit: function emit(events, extraParams) { + this.emitter().emit(events, extraParams); + + return this; + } +}; + +define.eventAliasesOn(elesfn); + +module.exports = elesfn; + +/***/ }), +/* 79 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var corefn = { + + png: function png(options) { + var renderer = this._private.renderer; + options = options || {}; + + return renderer.png(options); + }, + + jpg: function jpg(options) { + var renderer = this._private.renderer; + options = options || {}; + + options.bg = options.bg || '#fff'; + + return renderer.jpg(options); + } + +}; + +corefn.jpeg = corefn.jpg; + +module.exports = corefn; + +/***/ }), +/* 80 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var is = __webpack_require__(0); + +var corefn = { + + layout: function layout(options) { + var cy = this; + + if (options == null) { + util.error('Layout options must be specified to make a layout'); + return; + } + + if (options.name == null) { + util.error('A `name` must be specified to make a layout'); + return; + } + + var name = options.name; + var Layout = cy.extension('layout', name); + + if (Layout == null) { + util.error('Can not apply layout: No such layout `' + name + '` found; did you include its JS file?'); + return; + } + + var eles = void 0; + if (is.string(options.eles)) { + eles = cy.$(options.eles); + } else { + eles = options.eles != null ? options.eles : cy.$(); + } + + var layout = new Layout(util.extend({}, options, { + cy: cy, + eles: eles + })); + + return layout; + } + +}; + +corefn.createLayout = corefn.makeLayout = corefn.layout; + +module.exports = corefn; + +/***/ }), +/* 81 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var corefn = { + notify: function notify(params) { + var _p = this._private; + + if (_p.batchingNotify) { + var bEles = _p.batchNotifyEles; + var bTypes = _p.batchNotifyTypes; + + if (params.eles) { + bEles.merge(params.eles); + } + + if (!bTypes.ids[params.type]) { + bTypes.push(params.type); + bTypes.ids[params.type] = true; + } + + return; // notifications are disabled during batching + } + + if (!_p.notificationsEnabled) { + return; + } // exit on disabled + + var renderer = this.renderer(); + + // exit if destroy() called on core or renderer in between frames #1499 #1528 + if (this.isDestroyed() || !renderer) { + return; + } + + renderer.notify(params); + }, + + notifications: function notifications(bool) { + var p = this._private; + + if (bool === undefined) { + return p.notificationsEnabled; + } else { + p.notificationsEnabled = bool ? true : false; + } + }, + + noNotifications: function noNotifications(callback) { + this.notifications(false); + callback(); + this.notifications(true); + }, + + batching: function batching() { + return this._private.batchCount > 0; + }, + + startBatch: function startBatch() { + var _p = this._private; + + if (_p.batchCount == null) { + _p.batchCount = 0; + } + + if (_p.batchCount === 0) { + _p.batchingStyle = _p.batchingNotify = true; + _p.batchStyleEles = this.collection(); + _p.batchNotifyEles = this.collection(); + _p.batchNotifyTypes = []; + _p.batchNotifyTypes.ids = {}; + } + + _p.batchCount++; + + return this; + }, + + endBatch: function endBatch() { + var _p = this._private; + + _p.batchCount--; + + if (_p.batchCount === 0) { + // update style for dirty eles + _p.batchingStyle = false; + _p.batchStyleEles.updateStyle(); + + // notify the renderer of queued eles and event types + _p.batchingNotify = false; + this.notify({ + type: _p.batchNotifyTypes, + eles: _p.batchNotifyEles + }); + } + + return this; + }, + + batch: function batch(callback) { + this.startBatch(); + callback(); + this.endBatch(); + + return this; + }, + + // for backwards compatibility + batchData: function batchData(map) { + var cy = this; + + return this.batch(function () { + var ids = Object.keys(map); + + for (var i = 0; i < ids.length; i++) { + var id = ids[i]; + var data = map[id]; + var ele = cy.getElementById(id); + + ele.data(data); + } + }); + } +}; + +module.exports = corefn; + +/***/ }), +/* 82 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); + +var corefn = { + + renderTo: function renderTo(context, zoom, pan, pxRatio) { + var r = this._private.renderer; + + r.renderTo(context, zoom, pan, pxRatio); + return this; + }, + + renderer: function renderer() { + return this._private.renderer; + }, + + forceRender: function forceRender() { + this.notify({ + type: 'draw' + }); + + return this; + }, + + resize: function resize() { + this.invalidateSize(); + + this.notify({ + type: 'resize' + }); + + this.emit('resize'); + + return this; + }, + + initRenderer: function initRenderer(options) { + var cy = this; + + var RendererProto = cy.extension('renderer', options.name); + if (RendererProto == null) { + util.error('Can not initialise: No such renderer `%s` found; did you include its JS file?', options.name); + return; + } + + cy._private.renderer = new RendererProto(util.extend({}, options, { cy: cy })); + + this.notify({ type: 'init' }); + }, + + destroyRenderer: function destroyRenderer() { + var cy = this; + + cy.notify({ type: 'destroy' }); // destroy the renderer + + var domEle = cy.container(); + if (domEle) { + domEle._cyreg = null; + + while (domEle.childNodes.length > 0) { + domEle.removeChild(domEle.childNodes[0]); + } + } + + cy._private.renderer = null; // to be extra safe, remove the ref + }, + + onRender: function onRender(fn) { + return this.on('render', fn); + }, + + offRender: function offRender(fn) { + return this.off('render', fn); + } + +}; + +corefn.invalidateDimensions = corefn.resize; + +module.exports = corefn; + +/***/ }), +/* 83 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var Collection = __webpack_require__(7); + +var corefn = { + + // get a collection + // - empty collection on no args + // - collection of elements in the graph on selector arg + // - guarantee a returned collection when elements or collection specified + collection: function collection(eles, opts) { + + if (is.string(eles)) { + return this.$(eles); + } else if (is.elementOrCollection(eles)) { + return eles.collection(); + } else if (is.array(eles)) { + return new Collection(this, eles, opts); + } + + return new Collection(this); + }, + + nodes: function nodes(selector) { + var nodes = this.$(function (ele) { + return ele.isNode(); + }); + + if (selector) { + return nodes.filter(selector); + } + + return nodes; + }, + + edges: function edges(selector) { + var edges = this.$(function (ele) { + return ele.isEdge(); + }); + + if (selector) { + return edges.filter(selector); + } + + return edges; + }, + + // search the graph like jQuery + $: function $(selector) { + var eles = this._private.elements; + + if (selector) { + return eles.filter(selector); + } else { + return eles.spawnSelf(); + } + }, + + mutableElements: function mutableElements() { + return this._private.elements; + } + +}; + +// aliases +corefn.elements = corefn.filter = corefn.$; + +module.exports = corefn; + +/***/ }), +/* 84 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var Style = __webpack_require__(18); + +var corefn = { + + style: function style(newStyle) { + if (newStyle) { + var s = this.setStyle(newStyle); + + s.update(); + } + + return this._private.style; + }, + + setStyle: function setStyle(style) { + var _p = this._private; + + if (is.stylesheet(style)) { + _p.style = style.generateStyle(this); + } else if (is.array(style)) { + _p.style = Style.fromJson(this, style); + } else if (is.string(style)) { + _p.style = Style.fromString(this, style); + } else { + _p.style = Style(this); + } + + return _p.style; + } +}; + +module.exports = corefn; + +/***/ }), +/* 85 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var is = __webpack_require__(0); +var Promise = __webpack_require__(5); + +var styfn = {}; + +// (potentially expensive calculation) +// apply the style to the element based on +// - its bypass +// - what selectors match it +styfn.apply = function (eles) { + var self = this; + var _p = self._private; + var cy = _p.cy; + var updatedEles = cy.collection(); + + if (_p.newStyle) { + // clear style caches + _p.contextStyles = {}; + _p.propDiffs = {}; + + self.cleanElements(eles, true); + } + + for (var ie = 0; ie < eles.length; ie++) { + var ele = eles[ie]; + + var cxtMeta = self.getContextMeta(ele); + + if (cxtMeta.empty) { + continue; + } else { + updatedEles.merge(ele); + } + + var cxtStyle = self.getContextStyle(cxtMeta); + var app = self.applyContextStyle(cxtMeta, cxtStyle, ele); + + if (!_p.newStyle) { + self.updateTransitions(ele, app.diffProps); + } + + self.updateStyleHints(ele); + } // for elements + + _p.newStyle = false; + + return updatedEles; +}; + +styfn.getPropertiesDiff = function (oldCxtKey, newCxtKey) { + var self = this; + var cache = self._private.propDiffs = self._private.propDiffs || {}; + var dualCxtKey = oldCxtKey + '-' + newCxtKey; + var cachedVal = cache[dualCxtKey]; + + if (cachedVal) { + return cachedVal; + } + + var diffProps = []; + var addedProp = {}; + + for (var i = 0; i < self.length; i++) { + var cxt = self[i]; + var oldHasCxt = oldCxtKey[i] === 't'; + var newHasCxt = newCxtKey[i] === 't'; + var cxtHasDiffed = oldHasCxt !== newHasCxt; + var cxtHasMappedProps = cxt.mappedProperties.length > 0; + + if (cxtHasDiffed || cxtHasMappedProps) { + var props = void 0; + + if (cxtHasDiffed && cxtHasMappedProps) { + props = cxt.properties; // suffices b/c mappedProperties is a subset of properties + } else if (cxtHasDiffed) { + props = cxt.properties; // need to check them all + } else if (cxtHasMappedProps) { + props = cxt.mappedProperties; // only need to check mapped + } + + for (var j = 0; j < props.length; j++) { + var prop = props[j]; + var name = prop.name; + + // if a later context overrides this property, then the fact that this context has switched/diffed doesn't matter + // (semi expensive check since it makes this function O(n^2) on context length, but worth it since overall result + // is cached) + var laterCxtOverrides = false; + for (var k = i + 1; k < self.length; k++) { + var laterCxt = self[k]; + var hasLaterCxt = newCxtKey[k] === 't'; + + if (!hasLaterCxt) { + continue; + } // can't override unless the context is active + + laterCxtOverrides = laterCxt.properties[prop.name] != null; + + if (laterCxtOverrides) { + break; + } // exit early as long as one later context overrides + } + + if (!addedProp[name] && !laterCxtOverrides) { + addedProp[name] = true; + diffProps.push(name); + } + } // for props + } // if + } // for contexts + + cache[dualCxtKey] = diffProps; + return diffProps; +}; + +styfn.getContextMeta = function (ele) { + var self = this; + var cxtKey = ''; + var diffProps = void 0; + var prevKey = ele._private.styleCxtKey || ''; + + if (self._private.newStyle) { + prevKey = ''; // since we need to apply all style if a fresh stylesheet + } + + // get the cxt key + for (var i = 0; i < self.length; i++) { + var context = self[i]; + var contextSelectorMatches = context.selector && context.selector.matches(ele); // NB: context.selector may be null for 'core' + + if (contextSelectorMatches) { + cxtKey += 't'; + } else { + cxtKey += 'f'; + } + } // for context + + diffProps = self.getPropertiesDiff(prevKey, cxtKey); + + ele._private.styleCxtKey = cxtKey; + + return { + key: cxtKey, + diffPropNames: diffProps, + empty: diffProps.length === 0 + }; +}; + +// gets a computed ele style object based on matched contexts +styfn.getContextStyle = function (cxtMeta) { + var cxtKey = cxtMeta.key; + var self = this; + var cxtStyles = this._private.contextStyles = this._private.contextStyles || {}; + + // if already computed style, returned cached copy + if (cxtStyles[cxtKey]) { + return cxtStyles[cxtKey]; + } + + var style = { + _private: { + key: cxtKey + } + }; + + for (var i = 0; i < self.length; i++) { + var cxt = self[i]; + var hasCxt = cxtKey[i] === 't'; + + if (!hasCxt) { + continue; + } + + for (var j = 0; j < cxt.properties.length; j++) { + var prop = cxt.properties[j]; + + style[prop.name] = prop; + } + } + + cxtStyles[cxtKey] = style; + return style; +}; + +styfn.applyContextStyle = function (cxtMeta, cxtStyle, ele) { + var self = this; + var diffProps = cxtMeta.diffPropNames; + var retDiffProps = {}; + + for (var i = 0; i < diffProps.length; i++) { + var diffPropName = diffProps[i]; + var cxtProp = cxtStyle[diffPropName]; + var eleProp = ele.pstyle(diffPropName); + + if (!cxtProp) { + // no context prop means delete + if (!eleProp) { + continue; // no existing prop means nothing needs to be removed + // nb affects initial application on mapped values like control-point-distances + } else if (eleProp.bypass) { + cxtProp = { name: diffPropName, deleteBypassed: true }; + } else { + cxtProp = { name: diffPropName, delete: true }; + } + } + + // save cycles when the context prop doesn't need to be applied + if (eleProp === cxtProp) { + continue; + } + + var retDiffProp = retDiffProps[diffPropName] = { + prev: eleProp + }; + + self.applyParsedProperty(ele, cxtProp); + + retDiffProp.next = ele.pstyle(diffPropName); + + if (retDiffProp.next && retDiffProp.next.bypass) { + retDiffProp.next = retDiffProp.next.bypassed; + } + } + + return { + diffProps: retDiffProps + }; +}; + +styfn.updateStyleHints = function (ele) { + var _p = ele._private; + var self = this; + + if (ele.removed()) { + return; + } + + // set whether has pie or not; for greater efficiency + var hasPie = false; + if (_p.group === 'nodes') { + for (var i = 1; i <= self.pieBackgroundN; i++) { + // 1..N + var _size = ele.pstyle('pie-' + i + '-background-size').value; + + if (_size > 0) { + hasPie = true; + break; + } + } + } + + _p.hasPie = hasPie; + + var transform = ele.pstyle('text-transform').strValue; + var content = ele.pstyle('label').strValue; + var srcContent = ele.pstyle('source-label').strValue; + var tgtContent = ele.pstyle('target-label').strValue; + var fStyle = ele.pstyle('font-style').strValue; + var size = ele.pstyle('font-size').pfValue + 'px'; + var family = ele.pstyle('font-family').strValue; + // let letiant = style['font-letiant'].strValue; + var weight = ele.pstyle('font-weight').strValue; + var valign = ele.pstyle('text-valign').strValue; + var halign = ele.pstyle('text-valign').strValue; + var oWidth = ele.pstyle('text-outline-width').pfValue; + var wrap = ele.pstyle('text-wrap').strValue; + var wrapW = ele.pstyle('text-max-width').pfValue; + var labelStyleKey = fStyle + '$' + size + '$' + family + '$' + weight + '$' + transform + '$' + valign + '$' + halign + '$' + oWidth + '$' + wrap + '$' + wrapW; + _p.labelStyleKey = labelStyleKey; + _p.sourceLabelKey = labelStyleKey + '$' + srcContent; + _p.targetLabelKey = labelStyleKey + '$' + tgtContent; + _p.labelKey = labelStyleKey + '$' + content; + _p.fontKey = fStyle + '$' + weight + '$' + size + '$' + family; + + _p.styleKey = Date.now(); +}; + +// apply a property to the style (for internal use) +// returns whether application was successful +// +// now, this function flattens the property, and here's how: +// +// for parsedProp:{ bypass: true, deleteBypass: true } +// no property is generated, instead the bypass property in the +// element's style is replaced by what's pointed to by the `bypassed` +// field in the bypass property (i.e. restoring the property the +// bypass was overriding) +// +// for parsedProp:{ mapped: truthy } +// the generated flattenedProp:{ mapping: prop } +// +// for parsedProp:{ bypass: true } +// the generated flattenedProp:{ bypassed: parsedProp } +styfn.applyParsedProperty = function (ele, parsedProp) { + var self = this; + var prop = parsedProp; + var style = ele._private.style; + var fieldVal = void 0, + flatProp = void 0; + var types = self.types; + var type = self.properties[prop.name].type; + var propIsBypass = prop.bypass; + var origProp = style[prop.name]; + var origPropIsBypass = origProp && origProp.bypass; + var _p = ele._private; + var flatPropMapping = 'mapping'; + + var checkZOrder = function checkZOrder() { + self.checkZOrderTrigger(ele, prop.name, origProp ? origProp.value : null, prop.value); + }; + + // edges connected to compound nodes can not be haystacks + if (parsedProp.name === 'curve-style' && parsedProp.value === 'haystack' && ele.isEdge() && (ele.isLoop() || ele.source().isParent() || ele.target().isParent())) { + prop = parsedProp = this.parse(parsedProp.name, 'bezier', propIsBypass); + } + + if (prop.delete) { + // delete the property and use the default value on falsey value + style[prop.name] = undefined; + + checkZOrder(); + + return true; + } + + if (prop.deleteBypassed) { + // delete the property that the + if (!origProp) { + checkZOrder(); + + return true; // can't delete if no prop + } else if (origProp.bypass) { + // delete bypassed + origProp.bypassed = undefined; + + checkZOrder(); + + return true; + } else { + return false; // we're unsuccessful deleting the bypassed + } + } + + // check if we need to delete the current bypass + if (prop.deleteBypass) { + // then this property is just here to indicate we need to delete + if (!origProp) { + checkZOrder(); + + return true; // property is already not defined + } else if (origProp.bypass) { + // then replace the bypass property with the original + // because the bypassed property was already applied (and therefore parsed), we can just replace it (no reapplying necessary) + style[prop.name] = origProp.bypassed; + + checkZOrder(); + + return true; + } else { + return false; // we're unsuccessful deleting the bypass + } + } + + var printMappingErr = function printMappingErr() { + util.error('Do not assign mappings to elements without corresponding data (e.g. ele `' + ele.id() + '` for property `' + prop.name + '` with data field `' + prop.field + '`); try a `[' + prop.field + ']` selector to limit scope to elements with `' + prop.field + '` defined'); + }; + + // put the property in the style objects + switch (prop.mapped) {// flatten the property if mapped + case types.mapData: + { + // flatten the field (e.g. data.foo.bar) + var fields = prop.field.split('.'); + var _fieldVal = _p.data; + + for (var i = 0; i < fields.length && _fieldVal; i++) { + var field = fields[i]; + _fieldVal = _fieldVal[field]; + } + + var percent = void 0; + if (!is.number(_fieldVal)) { + // then keep the mapping but assume 0% for now + percent = 0; + } else { + percent = (_fieldVal - prop.fieldMin) / (prop.fieldMax - prop.fieldMin); + } + + // make sure to bound percent value + if (percent < 0) { + percent = 0; + } else if (percent > 1) { + percent = 1; + } + + if (type.color) { + var r1 = prop.valueMin[0]; + var r2 = prop.valueMax[0]; + var g1 = prop.valueMin[1]; + var g2 = prop.valueMax[1]; + var b1 = prop.valueMin[2]; + var b2 = prop.valueMax[2]; + var a1 = prop.valueMin[3] == null ? 1 : prop.valueMin[3]; + var a2 = prop.valueMax[3] == null ? 1 : prop.valueMax[3]; + + var clr = [Math.round(r1 + (r2 - r1) * percent), Math.round(g1 + (g2 - g1) * percent), Math.round(b1 + (b2 - b1) * percent), Math.round(a1 + (a2 - a1) * percent)]; + + flatProp = { // colours are simple, so just create the flat property instead of expensive string parsing + bypass: prop.bypass, // we're a bypass if the mapping property is a bypass + name: prop.name, + value: clr, + strValue: 'rgb(' + clr[0] + ', ' + clr[1] + ', ' + clr[2] + ')' + }; + } else if (type.number) { + var calcValue = prop.valueMin + (prop.valueMax - prop.valueMin) * percent; + flatProp = this.parse(prop.name, calcValue, prop.bypass, flatPropMapping); + } else { + return false; // can only map to colours and numbers + } + + if (!flatProp) { + // if we can't flatten the property, then use the origProp so we still keep the mapping itself + flatProp = this.parse(prop.name, origProp.strValue, prop.bypass, flatPropMapping); + } + + if (!flatProp) { + printMappingErr(); + } + flatProp.mapping = prop; // keep a reference to the mapping + prop = flatProp; // the flattened (mapped) property is the one we want + + break; + } + + // direct mapping + case types.data: + { + // flatten the field (e.g. data.foo.bar) + var _fields = prop.field.split('.'); + var _fieldVal2 = _p.data; + + if (_fieldVal2) { + for (var _i = 0; _i < _fields.length; _i++) { + var _field = _fields[_i]; + _fieldVal2 = _fieldVal2[_field]; + } + } + + flatProp = this.parse(prop.name, _fieldVal2, prop.bypass, flatPropMapping); + + if (!flatProp) { + // if we can't flatten the property, then use the origProp so we still keep the mapping itself + var flatPropVal = origProp ? origProp.strValue : ''; + + flatProp = this.parse(prop.name, flatPropVal, prop.bypass, flatPropMapping); + } + + if (!flatProp) { + printMappingErr(); + } + flatProp.mapping = prop; // keep a reference to the mapping + prop = flatProp; // the flattened (mapped) property is the one we want + + break; + } + + case types.fn: + { + var fn = prop.value; + var fnRetVal = fn(ele); + + flatProp = this.parse(prop.name, fnRetVal, prop.bypass, flatPropMapping); + flatProp.mapping = prop; // keep a reference to the mapping + prop = flatProp; // the flattened (mapped) property is the one we want + + break; + } + + case undefined: + break; // just set the property + + default: + return false; // not a valid mapping + } + + // if the property is a bypass property, then link the resultant property to the original one + if (propIsBypass) { + if (origPropIsBypass) { + // then this bypass overrides the existing one + prop.bypassed = origProp.bypassed; // steal bypassed prop from old bypass + } else { + // then link the orig prop to the new bypass + prop.bypassed = origProp; + } + + style[prop.name] = prop; // and set + } else { + // prop is not bypass + if (origPropIsBypass) { + // then keep the orig prop (since it's a bypass) and link to the new prop + origProp.bypassed = prop; + } else { + // then just replace the old prop with the new one + style[prop.name] = prop; + } + } + + checkZOrder(); + + return true; +}; + +styfn.cleanElements = function (eles, keepBypasses) { + var self = this; + var props = self.properties; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + + if (!keepBypasses) { + ele._private.style = {}; + } else { + var style = ele._private.style; + + for (var j = 0; j < props.length; j++) { + var prop = props[j]; + var eleProp = style[prop.name]; + + if (eleProp) { + if (eleProp.bypass) { + eleProp.bypassed = null; + } else { + style[prop.name] = null; + } + } + } + } + } +}; + +// updates the visual style for all elements (useful for manual style modification after init) +styfn.update = function () { + var cy = this._private.cy; + var eles = cy.mutableElements(); + + eles.updateStyle(); +}; + +// just update the functional properties (i.e. mappings) in the elements' +// styles (less expensive than recalculation) +styfn.updateMappers = function (eles) { + var self = this; + var cy = this._private.cy; + var updatedEles = cy.collection(); + + for (var i = 0; i < eles.length; i++) { + // for each ele + var ele = eles[i]; + var style = ele._private.style; + var updatedEle = false; + + for (var j = 0; j < self.properties.length; j++) { + // for each prop + var prop = self.properties[j]; + var propInStyle = style[prop.name]; + + if (propInStyle && propInStyle.mapping) { + var mapping = propInStyle.mapping; + + this.applyParsedProperty(ele, mapping); // reapply the mapping property + + updatedEle = true; + } + } + + if (updatedEle) { + this.updateStyleHints(ele); + + updatedEles.merge(ele); + } + } + + return updatedEles; +}; + +// diffProps : { name => { prev, next } } +styfn.updateTransitions = function (ele, diffProps, isBypass) { + var self = this; + var _p = ele._private; + var props = ele.pstyle('transition-property').value; + var duration = ele.pstyle('transition-duration').pfValue; + var delay = ele.pstyle('transition-delay').pfValue; + + if (props.length > 0 && duration > 0) { + + var style = {}; + + // build up the style to animate towards + var anyPrev = false; + for (var i = 0; i < props.length; i++) { + var prop = props[i]; + var styProp = ele.pstyle(prop); + var diffProp = diffProps[prop]; + + if (!diffProp) { + continue; + } + + var prevProp = diffProp.prev; + var fromProp = prevProp; + var toProp = diffProp.next != null ? diffProp.next : styProp; + var diff = false; + var initVal = void 0; + var initDt = 0.000001; // delta time % value for initVal (allows animating out of init zero opacity) + + if (!fromProp) { + continue; + } + + // consider px values + if (is.number(fromProp.pfValue) && is.number(toProp.pfValue)) { + diff = toProp.pfValue - fromProp.pfValue; // nonzero is truthy + initVal = fromProp.pfValue + initDt * diff; + + // consider numerical values + } else if (is.number(fromProp.value) && is.number(toProp.value)) { + diff = toProp.value - fromProp.value; // nonzero is truthy + initVal = fromProp.value + initDt * diff; + + // consider colour values + } else if (is.array(fromProp.value) && is.array(toProp.value)) { + diff = fromProp.value[0] !== toProp.value[0] || fromProp.value[1] !== toProp.value[1] || fromProp.value[2] !== toProp.value[2]; + + initVal = fromProp.strValue; + } + + // the previous value is good for an animation only if it's different + if (diff) { + style[prop] = toProp.strValue; // to val + this.applyBypass(ele, prop, initVal); // from val + anyPrev = true; + } + } // end if props allow ani + + // can't transition if there's nothing previous to transition from + if (!anyPrev) { + return; + } + + _p.transitioning = true; + + new Promise(function (resolve) { + if (delay > 0) { + ele.delayAnimation(delay).play().promise().then(resolve); + } else { + resolve(); + } + }).then(function () { + return ele.animation({ + style: style, + duration: duration, + easing: ele.pstyle('transition-timing-function').value, + queue: false + }).play().promise(); + }).then(function () { + // if( !isBypass ){ + self.removeBypasses(ele, props); + ele.emitAndNotify('style'); + // } + + _p.transitioning = false; + }); + } else if (_p.transitioning) { + this.removeBypasses(ele, props); + ele.emitAndNotify('style'); + + _p.transitioning = false; + } +}; + +styfn.checkZOrderTrigger = function (ele, name, fromValue, toValue) { + var prop = this.properties[name]; + + if (prop.triggersZOrder != null && (fromValue == null || prop.triggersZOrder(fromValue, toValue))) { + this._private.cy.notify({ + type: 'zorder', + eles: ele + }); + } +}; + +module.exports = styfn; + +/***/ }), +/* 86 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var util = __webpack_require__(1); + +var styfn = {}; + +// bypasses are applied to an existing style on an element, and just tacked on temporarily +// returns true iff application was successful for at least 1 specified property +styfn.applyBypass = function (eles, name, value, updateTransitions) { + var self = this; + var props = []; + var isBypass = true; + + // put all the properties (can specify one or many) in an array after parsing them + if (name === '*' || name === '**') { + // apply to all property names + + if (value !== undefined) { + for (var i = 0; i < self.properties.length; i++) { + var prop = self.properties[i]; + var _name = prop.name; + + var parsedProp = this.parse(_name, value, true); + + if (parsedProp) { + props.push(parsedProp); + } + } + } + } else if (is.string(name)) { + // then parse the single property + var _parsedProp = this.parse(name, value, true); + + if (_parsedProp) { + props.push(_parsedProp); + } + } else if (is.plainObject(name)) { + // then parse each property + var specifiedProps = name; + updateTransitions = value; + + var names = Object.keys(specifiedProps); + + for (var _i = 0; _i < names.length; _i++) { + var _name2 = names[_i]; + var _prop = self.properties[_name2]; + var _value = specifiedProps[_name2]; + + if (_value === undefined) { + // try camel case name too + _value = specifiedProps[util.dash2camel(_name2)]; + } + + if (_value !== undefined) { + var _parsedProp2 = this.parse(_name2, _value, true); + + if (_parsedProp2) { + props.push(_parsedProp2); + } + } + } + } else { + // can't do anything without well defined properties + return false; + } + + // we've failed if there are no valid properties + if (props.length === 0) { + return false; + } + + // now, apply the bypass properties on the elements + var ret = false; // return true if at least one succesful bypass applied + for (var _i2 = 0; _i2 < eles.length; _i2++) { + // for each ele + var ele = eles[_i2]; + var diffProps = {}; + var diffProp = void 0; + + for (var j = 0; j < props.length; j++) { + // for each prop + var _prop2 = props[j]; + + if (updateTransitions) { + var prevProp = ele.pstyle(_prop2.name); + diffProp = diffProps[_prop2.name] = { prev: prevProp }; + } + + ret = this.applyParsedProperty(ele, _prop2) || ret; + + if (updateTransitions) { + diffProp.next = ele.pstyle(_prop2.name); + } + } // for props + + if (ret) { + this.updateStyleHints(ele); + } + + if (updateTransitions) { + this.updateTransitions(ele, diffProps, isBypass); + } + } // for eles + + return ret; +}; + +// only useful in specific cases like animation +styfn.overrideBypass = function (eles, name, value) { + name = util.camel2dash(name); + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + var prop = ele._private.style[name]; + var type = this.properties[name].type; + var isColor = type.color; + var isMulti = type.mutiple; + + if (!prop || !prop.bypass) { + // need a bypass if one doesn't exist + this.applyBypass(ele, name, value); + continue; + } + + var oldValue = prop.pfValue != null ? prop.pfValue : prop.value; + + prop.value = value; + + if (prop.pfValue != null) { + prop.pfValue = value; + } + + if (isColor) { + prop.strValue = 'rgb(' + value.join(',') + ')'; + } else if (isMulti) { + prop.strValue = value.join(' '); + } else { + prop.strValue = '' + value; + } + + this.checkZOrderTrigger(ele, name, oldValue, value); + } +}; + +styfn.removeAllBypasses = function (eles, updateTransitions) { + return this.removeBypasses(eles, this.propertyNames, updateTransitions); +}; + +styfn.removeBypasses = function (eles, props, updateTransitions) { + var isBypass = true; + + for (var j = 0; j < eles.length; j++) { + var ele = eles[j]; + var diffProps = {}; + + for (var i = 0; i < props.length; i++) { + var name = props[i]; + var prop = this.properties[name]; + var prevProp = ele.pstyle(prop.name); + + if (!prevProp || !prevProp.bypass) { + // if a bypass doesn't exist for the prop, nothing needs to be removed + continue; + } + + var value = ''; // empty => remove bypass + var parsedProp = this.parse(name, value, true); + var diffProp = diffProps[prop.name] = { prev: prevProp }; + + this.applyParsedProperty(ele, parsedProp); + + diffProp.next = ele.pstyle(prop.name); + } // for props + + this.updateStyleHints(ele); + + if (updateTransitions) { + this.updateTransitions(ele, diffProps, isBypass); + } + } // for eles +}; + +module.exports = styfn; + +/***/ }), +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var window = __webpack_require__(3); + +var styfn = {}; + +// gets what an em size corresponds to in pixels relative to a dom element +styfn.getEmSizeInPixels = function () { + var px = this.containerCss('font-size'); + + if (px != null) { + return parseFloat(px); + } else { + return 1; // for headless + } +}; + +// gets css property from the core container +styfn.containerCss = function (propName) { + var cy = this._private.cy; + var domElement = cy.container(); + + if (window && domElement && window.getComputedStyle) { + return window.getComputedStyle(domElement).getPropertyValue(propName); + } +}; + +module.exports = styfn; + +/***/ }), +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var is = __webpack_require__(0); + +var styfn = {}; + +// gets the rendered style for an element +styfn.getRenderedStyle = function (ele, prop) { + if (prop) { + return this.getStylePropertyValue(ele, prop, true); + } else { + return this.getRawStyle(ele, true); + } +}; + +// gets the raw style for an element +styfn.getRawStyle = function (ele, isRenderedVal) { + var self = this; + + ele = ele[0]; // insure it's an element + + if (ele) { + var rstyle = {}; + + for (var i = 0; i < self.properties.length; i++) { + var prop = self.properties[i]; + var val = self.getStylePropertyValue(ele, prop.name, isRenderedVal); + + if (val != null) { + rstyle[prop.name] = val; + rstyle[util.dash2camel(prop.name)] = val; + } + } + + return rstyle; + } +}; + +styfn.getIndexedStyle = function (ele, property, subproperty, index) { + var pstyle = ele.pstyle(property)[subproperty][index]; + return pstyle != null ? pstyle : ele.cy().style().getDefaultProperty(property)[subproperty][0]; +}; + +styfn.getStylePropertyValue = function (ele, propName, isRenderedVal) { + var self = this; + + ele = ele[0]; // insure it's an element + + if (ele) { + var prop = self.properties[propName]; + + if (prop.alias) { + prop = prop.pointsTo; + } + + var type = prop.type; + var styleProp = ele.pstyle(prop.name); + var zoom = ele.cy().zoom(); + + if (styleProp) { + var units = styleProp.units ? type.implicitUnits || 'px' : null; + var val = units ? [].concat(styleProp.pfValue).map(function (pfValue) { + return pfValue * (isRenderedVal ? zoom : 1) + units; + }).join(' ') : styleProp.strValue; + + return val; + } + } +}; + +styfn.getAnimationStartStyle = function (ele, aniProps) { + var rstyle = {}; + + for (var i = 0; i < aniProps.length; i++) { + var aniProp = aniProps[i]; + var name = aniProp.name; + + var styleProp = ele.pstyle(name); + + if (styleProp !== undefined) { + // then make a prop of it + if (is.plainObject(styleProp)) { + styleProp = this.parse(name, styleProp.strValue); + } else { + styleProp = this.parse(name, styleProp); + } + } + + if (styleProp) { + rstyle[name] = styleProp; + } + } + + return rstyle; +}; + +styfn.getPropsList = function (propsObj) { + var self = this; + var rstyle = []; + var style = propsObj; + var props = self.properties; + + if (style) { + var names = Object.keys(style); + + for (var i = 0; i < names.length; i++) { + var name = names[i]; + var val = style[name]; + var prop = props[name] || props[util.camel2dash(name)]; + var styleProp = this.parse(prop.name, val); + + if (styleProp) { + rstyle.push(styleProp); + } + } + } + + return rstyle; +}; + +module.exports = styfn; + +/***/ }), +/* 89 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var styfn = {}; + +styfn.appendFromJson = function (json) { + var style = this; + + for (var i = 0; i < json.length; i++) { + var context = json[i]; + var selector = context.selector; + var props = context.style || context.css; + var names = Object.keys(props); + + style.selector(selector); // apply selector + + for (var j = 0; j < names.length; j++) { + var name = names[j]; + var value = props[name]; + + style.css(name, value); // apply property + } + } + + return style; +}; + +// accessible cy.style() function +styfn.fromJson = function (json) { + var style = this; + + style.resetToDefault(); + style.appendFromJson(json); + + return style; +}; + +// get json from cy.style() api +styfn.json = function () { + var json = []; + + for (var i = this.defaultLength; i < this.length; i++) { + var cxt = this[i]; + var selector = cxt.selector; + var props = cxt.properties; + var css = {}; + + for (var j = 0; j < props.length; j++) { + var prop = props[j]; + css[prop.name] = prop.strValue; + } + + json.push({ + selector: !selector ? 'core' : selector.toString(), + style: css + }); + } + + return json; +}; + +module.exports = styfn; + +/***/ }), +/* 90 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var Selector = __webpack_require__(6); + +var styfn = {}; + +styfn.appendFromString = function (string) { + var self = this; + var style = this; + var remaining = '' + string; + var selAndBlockStr = void 0; + var blockRem = void 0; + var propAndValStr = void 0; + + // remove comments from the style string + remaining = remaining.replace(/[/][*](\s|.)+?[*][/]/g, ''); + + function removeSelAndBlockFromRemaining() { + // remove the parsed selector and block from the remaining text to parse + if (remaining.length > selAndBlockStr.length) { + remaining = remaining.substr(selAndBlockStr.length); + } else { + remaining = ''; + } + } + + function removePropAndValFromRem() { + // remove the parsed property and value from the remaining block text to parse + if (blockRem.length > propAndValStr.length) { + blockRem = blockRem.substr(propAndValStr.length); + } else { + blockRem = ''; + } + } + + while (true) { + var nothingLeftToParse = remaining.match(/^\s*$/); + if (nothingLeftToParse) { + break; + } + + var selAndBlock = remaining.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/); + + if (!selAndBlock) { + util.error('Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: ' + remaining); + break; + } + + selAndBlockStr = selAndBlock[0]; + + // parse the selector + var selectorStr = selAndBlock[1]; + if (selectorStr !== 'core') { + var selector = new Selector(selectorStr); + if (selector._private.invalid) { + util.error('Skipping parsing of block: Invalid selector found in string stylesheet: ' + selectorStr); + + // skip this selector and block + removeSelAndBlockFromRemaining(); + continue; + } + } + + // parse the block of properties and values + var blockStr = selAndBlock[2]; + var invalidBlock = false; + blockRem = blockStr; + var props = []; + + while (true) { + var _nothingLeftToParse = blockRem.match(/^\s*$/); + if (_nothingLeftToParse) { + break; + } + + var propAndVal = blockRem.match(/^\s*(.+?)\s*:\s*(.+?)\s*;/); + + if (!propAndVal) { + util.error('Skipping parsing of block: Invalid formatting of style property and value definitions found in:' + blockStr); + invalidBlock = true; + break; + } + + propAndValStr = propAndVal[0]; + var propStr = propAndVal[1]; + var valStr = propAndVal[2]; + + var prop = self.properties[propStr]; + if (!prop) { + util.error('Skipping property: Invalid property name in: ' + propAndValStr); + + // skip this property in the block + removePropAndValFromRem(); + continue; + } + + var parsedProp = style.parse(propStr, valStr); + + if (!parsedProp) { + util.error('Skipping property: Invalid property definition in: ' + propAndValStr); + + // skip this property in the block + removePropAndValFromRem(); + continue; + } + + props.push({ + name: propStr, + val: valStr + }); + removePropAndValFromRem(); + } + + if (invalidBlock) { + removeSelAndBlockFromRemaining(); + break; + } + + // put the parsed block in the style + style.selector(selectorStr); + for (var i = 0; i < props.length; i++) { + var _prop = props[i]; + style.css(_prop.name, _prop.val); + } + + removeSelAndBlockFromRemaining(); + } + + return style; +}; + +styfn.fromString = function (string) { + var style = this; + + style.resetToDefault(); + style.appendFromString(string); + + return style; +}; + +module.exports = styfn; + +/***/ }), +/* 91 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var is = __webpack_require__(0); + +var styfn = {}; + +(function () { + var number = util.regex.number; + var rgba = util.regex.rgbaNoBackRefs; + var hsla = util.regex.hslaNoBackRefs; + var hex3 = util.regex.hex3; + var hex6 = util.regex.hex6; + var data = function data(prefix) { + return '^' + prefix + '\\s*\\(\\s*([\\w\\.]+)\\s*\\)$'; + }; + var mapData = function mapData(prefix) { + var mapArg = number + '|\\w+|' + rgba + '|' + hsla + '|' + hex3 + '|' + hex6; + return '^' + prefix + '\\s*\\(([\\w\\.]+)\\s*\\,\\s*(' + number + ')\\s*\\,\\s*(' + number + ')\\s*,\\s*(' + mapArg + ')\\s*\\,\\s*(' + mapArg + ')\\)$'; + }; + var urlRegexes = ['^url\\s*\\(\\s*[\'"]?(.+?)[\'"]?\\s*\\)$', '^(none)$', '^(.+)$']; + + // each visual style property has a type and needs to be validated according to it + styfn.types = { + time: { number: true, min: 0, units: 's|ms', implicitUnits: 'ms' }, + percent: { number: true, min: 0, max: 100, units: '%', implicitUnits: '%' }, + zeroOneNumber: { number: true, min: 0, max: 1, unitless: true }, + zeroOneNumbers: { number: true, min: 0, max: 1, unitless: true, multiple: true }, + nOneOneNumber: { number: true, min: -1, max: 1, unitless: true }, + nonNegativeInt: { number: true, min: 0, integer: true, unitless: true }, + position: { enums: ['parent', 'origin'] }, + nodeSize: { number: true, min: 0, enums: ['label'] }, + number: { number: true, unitless: true }, + numbers: { number: true, unitless: true, multiple: true }, + positiveNumber: { number: true, unitless: true, min: 0, strictMin: true }, + size: { number: true, min: 0 }, + bidirectionalSize: { number: true }, // allows negative + bidirectionalSizes: { number: true, multiple: true }, // allows negative + sizeMaybePercent: { number: true, min: 0, allowPercent: true }, + paddingRelativeTo: { enums: ['width', 'height', 'average', 'min', 'max'] }, + bgWH: { number: true, min: 0, allowPercent: true, enums: ['auto'], multiple: true }, + bgPos: { number: true, allowPercent: true, multiple: true }, + bgRelativeTo: { enums: ['inner', 'include-padding'], multiple: true }, + bgRepeat: { enums: ['repeat', 'repeat-x', 'repeat-y', 'no-repeat'], multiple: true }, + bgFit: { enums: ['none', 'contain', 'cover'], multiple: true }, + bgCrossOrigin: { enums: ['anonymous', 'use-credentials'], multiple: true }, + bgClip: { enums: ['none', 'node'] }, + color: { color: true }, + bool: { enums: ['yes', 'no'] }, + lineStyle: { enums: ['solid', 'dotted', 'dashed'] }, + borderStyle: { enums: ['solid', 'dotted', 'dashed', 'double'] }, + curveStyle: { enums: ['bezier', 'unbundled-bezier', 'haystack', 'segments'] }, + fontFamily: { regex: '^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$' }, + fontletiant: { enums: ['small-caps', 'normal'] }, + fontStyle: { enums: ['italic', 'normal', 'oblique'] }, + fontWeight: { enums: ['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '800', '900', 100, 200, 300, 400, 500, 600, 700, 800, 900] }, + textDecoration: { enums: ['none', 'underline', 'overline', 'line-through'] }, + textTransform: { enums: ['none', 'uppercase', 'lowercase'] }, + textWrap: { enums: ['none', 'wrap', 'ellipsis'] }, + textBackgroundShape: { enums: ['rectangle', 'roundrectangle'] }, + nodeShape: { enums: ['rectangle', 'roundrectangle', 'cutrectangle', 'bottomroundrectangle', 'barrel', 'ellipse', 'triangle', 'square', 'pentagon', 'hexagon', 'concavehexagon', 'heptagon', 'octagon', 'tag', 'star', 'diamond', 'vee', 'rhomboid', 'polygon'] }, + compoundIncludeLabels: { enums: ['include', 'exclude'] }, + arrowShape: { enums: ['tee', 'triangle', 'triangle-tee', 'triangle-cross', 'triangle-backcurve', 'half-triangle-overshot', 'vee', 'square', 'circle', 'diamond', 'none'] }, + arrowFill: { enums: ['filled', 'hollow'] }, + display: { enums: ['element', 'none'] }, + visibility: { enums: ['hidden', 'visible'] }, + zCompoundDepth: { enums: ['bottom', 'orphan', 'auto', 'top'] }, + zIndexCompare: { enums: ['auto', 'manual'] }, + valign: { enums: ['top', 'center', 'bottom'] }, + halign: { enums: ['left', 'center', 'right'] }, + text: { string: true }, + data: { mapping: true, regex: data('data') }, + layoutData: { mapping: true, regex: data('layoutData') }, + scratch: { mapping: true, regex: data('scratch') }, + mapData: { mapping: true, regex: mapData('mapData') }, + mapLayoutData: { mapping: true, regex: mapData('mapLayoutData') }, + mapScratch: { mapping: true, regex: mapData('mapScratch') }, + fn: { mapping: true, fn: true }, + url: { regexes: urlRegexes, singleRegexMatchValue: true }, + urls: { regexes: urlRegexes, singleRegexMatchValue: true, multiple: true }, + propList: { propList: true }, + angle: { number: true, units: 'deg|rad', implicitUnits: 'rad' }, + textRotation: { number: true, units: 'deg|rad', implicitUnits: 'rad', enums: ['none', 'autorotate'] }, + polygonPointList: { number: true, multiple: true, evenMultiple: true, min: -1, max: 1, unitless: true }, + edgeDistances: { enums: ['intersection', 'node-position'] }, + edgeEndpoint: { + number: true, multiple: true, units: '%|px|em|deg|rad', implicitUnits: 'px', + enums: ['inside-to-node', 'outside-to-node', 'outside-to-line'], singleEnum: true, + validate: function validate(valArr, unitsArr) { + switch (valArr.length) { + case 2: + // can be % or px only + return unitsArr[0] !== 'deg' && unitsArr[0] !== 'rad' && unitsArr[1] !== 'deg' && unitsArr[1] !== 'rad'; + case 1: + // can be enum, deg, or rad only + return is.string(valArr[0]) || unitsArr[0] === 'deg' || unitsArr[0] === 'rad'; + default: + return false; + } + } + }, + easing: { + regexes: ['^(spring)\\s*\\(\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*\\)$', '^(cubic-bezier)\\s*\\(\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*\\)$'], + enums: ['linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out', 'ease-in-sine', 'ease-out-sine', 'ease-in-out-sine', 'ease-in-quad', 'ease-out-quad', 'ease-in-out-quad', 'ease-in-cubic', 'ease-out-cubic', 'ease-in-out-cubic', 'ease-in-quart', 'ease-out-quart', 'ease-in-out-quart', 'ease-in-quint', 'ease-out-quint', 'ease-in-out-quint', 'ease-in-expo', 'ease-out-expo', 'ease-in-out-expo', 'ease-in-circ', 'ease-out-circ', 'ease-in-out-circ'] + } + }; + + var zOrderDiff = { + zeroNonZero: function zeroNonZero(val1, val2) { + if (val1 === 0 && val2 !== 0) { + return true; + } else if (val1 !== 0 && val2 === 0) { + return true; + } else { + return false; + } + }, + anyDiff: function anyDiff(val1, val2) { + return val1 !== val2; + } + }; + + var zd = zOrderDiff; + + // define visual style properties + var t = styfn.types; + var props = styfn.properties = [ + // main label + { name: 'label', type: t.text }, { name: 'text-rotation', type: t.textRotation }, { name: 'text-margin-x', type: t.bidirectionalSize }, { name: 'text-margin-y', type: t.bidirectionalSize }, + + // source label + { name: 'source-label', type: t.text }, { name: 'source-text-rotation', type: t.textRotation }, { name: 'source-text-margin-x', type: t.bidirectionalSize }, { name: 'source-text-margin-y', type: t.bidirectionalSize }, { name: 'source-text-offset', type: t.size }, + + // target label + { name: 'target-label', type: t.text }, { name: 'target-text-rotation', type: t.textRotation }, { name: 'target-text-margin-x', type: t.bidirectionalSize }, { name: 'target-text-margin-y', type: t.bidirectionalSize }, { name: 'target-text-offset', type: t.size }, + + // common label style + { name: 'text-valign', type: t.valign }, { name: 'text-halign', type: t.halign }, { name: 'color', type: t.color }, { name: 'text-outline-color', type: t.color }, { name: 'text-outline-width', type: t.size }, { name: 'text-outline-opacity', type: t.zeroOneNumber }, { name: 'text-opacity', type: t.zeroOneNumber }, { name: 'text-background-color', type: t.color }, { name: 'text-background-opacity', type: t.zeroOneNumber }, { name: 'text-background-padding', type: t.size }, { name: 'text-border-opacity', type: t.zeroOneNumber }, { name: 'text-border-color', type: t.color }, { name: 'text-border-width', type: t.size }, { name: 'text-border-style', type: t.borderStyle }, { name: 'text-background-shape', type: t.textBackgroundShape }, + // { name: 'text-decoration', type: t.textDecoration }, // not supported in canvas + { name: 'text-transform', type: t.textTransform }, { name: 'text-wrap', type: t.textWrap }, { name: 'text-max-width', type: t.size }, { name: 'text-events', type: t.bool }, { name: 'font-family', type: t.fontFamily }, { name: 'font-style', type: t.fontStyle }, + // { name: 'font-letiant', type: t.fontletiant }, // not useful + { name: 'font-weight', type: t.fontWeight }, { name: 'font-size', type: t.size }, { name: 'min-zoomed-font-size', type: t.size }, + + // behaviour + { name: 'events', type: t.bool }, + + // visibility + { name: 'display', type: t.display, triggersZOrder: zd.anyDiff }, { name: 'visibility', type: t.visibility, triggersZOrder: zd.anyDiff }, { name: 'opacity', type: t.zeroOneNumber, triggersZOrder: zd.zeroNonZero }, { name: 'z-compound-depth', type: t.zCompoundDepth, triggersZOrder: zd.anyDiff }, { name: 'z-index-compare', type: t.zIndexCompare, triggersZOrder: zd.anyDiff }, { name: 'z-index', type: t.nonNegativeInt, triggersZOrder: zd.anyDiff }, + + // overlays + { name: 'overlay-padding', type: t.size }, { name: 'overlay-color', type: t.color }, { name: 'overlay-opacity', type: t.zeroOneNumber }, + + // transition anis + { name: 'transition-property', type: t.propList }, { name: 'transition-duration', type: t.time }, { name: 'transition-delay', type: t.time }, { name: 'transition-timing-function', type: t.easing }, + + // node body + { name: 'height', type: t.nodeSize }, { name: 'width', type: t.nodeSize }, { name: 'shape', type: t.nodeShape }, { name: 'shape-polygon-points', type: t.polygonPointList }, { name: 'background-color', type: t.color }, { name: 'background-opacity', type: t.zeroOneNumber }, { name: 'background-blacken', type: t.nOneOneNumber }, { name: 'padding', type: t.sizeMaybePercent }, { name: 'padding-relative-to', type: t.paddingRelativeTo }, + + // node border + { name: 'border-color', type: t.color }, { name: 'border-opacity', type: t.zeroOneNumber }, { name: 'border-width', type: t.size }, { name: 'border-style', type: t.borderStyle }, + + // node background images + { name: 'background-image', type: t.urls }, { name: 'background-image-crossorigin', type: t.bgCrossOrigin }, { name: 'background-image-opacity', type: t.zeroOneNumbers }, { name: 'background-position-x', type: t.bgPos }, { name: 'background-position-y', type: t.bgPos }, { name: 'background-width-relative-to', type: t.bgRelativeTo }, { name: 'background-height-relative-to', type: t.bgRelativeTo }, { name: 'background-repeat', type: t.bgRepeat }, { name: 'background-fit', type: t.bgFit }, { name: 'background-clip', type: t.bgClip }, { name: 'background-width', type: t.bgWH }, { name: 'background-height', type: t.bgWH }, + + // compound props + { name: 'position', type: t.position }, { name: 'compound-sizing-wrt-labels', type: t.compoundIncludeLabels }, { name: 'min-width', type: t.size }, { name: 'min-width-bias-left', type: t.sizeMaybePercent }, { name: 'min-width-bias-right', type: t.sizeMaybePercent }, { name: 'min-height', type: t.size }, { name: 'min-height-bias-top', type: t.sizeMaybePercent }, { name: 'min-height-bias-bottom', type: t.sizeMaybePercent }, + + // edge line + { name: 'line-style', type: t.lineStyle }, { name: 'line-color', type: t.color }, { name: 'curve-style', type: t.curveStyle }, { name: 'haystack-radius', type: t.zeroOneNumber }, { name: 'source-endpoint', type: t.edgeEndpoint }, { name: 'target-endpoint', type: t.edgeEndpoint }, { name: 'control-point-step-size', type: t.size }, { name: 'control-point-distances', type: t.bidirectionalSizes }, { name: 'control-point-weights', type: t.numbers }, { name: 'segment-distances', type: t.bidirectionalSizes }, { name: 'segment-weights', type: t.numbers }, { name: 'edge-distances', type: t.edgeDistances }, { name: 'arrow-scale', type: t.positiveNumber }, { name: 'loop-direction', type: t.angle }, { name: 'loop-sweep', type: t.angle }, { name: 'source-distance-from-node', type: t.size }, { name: 'target-distance-from-node', type: t.size }, + + // ghost properties + { name: 'ghost', type: t.bool }, { name: 'ghost-offset-x', type: t.bidirectionalSize }, { name: 'ghost-offset-y', type: t.bidirectionalSize }, { name: 'ghost-opacity', type: t.zeroOneNumber }, + + // these are just for the core + { name: 'selection-box-color', type: t.color }, { name: 'selection-box-opacity', type: t.zeroOneNumber }, { name: 'selection-box-border-color', type: t.color }, { name: 'selection-box-border-width', type: t.size }, { name: 'active-bg-color', type: t.color }, { name: 'active-bg-opacity', type: t.zeroOneNumber }, { name: 'active-bg-size', type: t.size }, { name: 'outside-texture-bg-color', type: t.color }, { name: 'outside-texture-bg-opacity', type: t.zeroOneNumber }]; + + // define aliases + var aliases = styfn.aliases = [{ name: 'content', pointsTo: 'label' }, { name: 'control-point-distance', pointsTo: 'control-point-distances' }, { name: 'control-point-weight', pointsTo: 'control-point-weights' }, { name: 'edge-text-rotation', pointsTo: 'text-rotation' }, { name: 'padding-left', pointsTo: 'padding' }, { name: 'padding-right', pointsTo: 'padding' }, { name: 'padding-top', pointsTo: 'padding' }, { name: 'padding-bottom', pointsTo: 'padding' }]; + + // pie backgrounds for nodes + styfn.pieBackgroundN = 16; // because the pie properties are numbered, give access to a constant N (for renderer use) + props.push({ name: 'pie-size', type: t.sizeMaybePercent }); + for (var i = 1; i <= styfn.pieBackgroundN; i++) { + props.push({ name: 'pie-' + i + '-background-color', type: t.color }); + props.push({ name: 'pie-' + i + '-background-size', type: t.percent }); + props.push({ name: 'pie-' + i + '-background-opacity', type: t.zeroOneNumber }); + } + + // edge arrows + var arrowPrefixes = styfn.arrowPrefixes = ['source', 'mid-source', 'target', 'mid-target']; + [{ name: 'arrow-shape', type: t.arrowShape }, { name: 'arrow-color', type: t.color }, { name: 'arrow-fill', type: t.arrowFill }].forEach(function (prop) { + arrowPrefixes.forEach(function (prefix) { + var name = prefix + '-' + prop.name; + var type = prop.type; + + props.push({ name: name, type: type }); + }); + }, {}); + + // list of property names + styfn.propertyNames = props.map(function (p) { + return p.name; + }); + + // allow access of properties by name ( e.g. style.properties.height ) + for (var _i = 0; _i < props.length; _i++) { + var prop = props[_i]; + + props[prop.name] = prop; // allow lookup by name + } + + // map aliases + for (var _i2 = 0; _i2 < aliases.length; _i2++) { + var alias = aliases[_i2]; + var pointsToProp = props[alias.pointsTo]; + var aliasProp = { + name: alias.name, + alias: true, + pointsTo: pointsToProp + }; + + // add alias prop for parsing + props.push(aliasProp); + + props[alias.name] = aliasProp; // allow lookup by name + } +})(); + +styfn.getDefaultProperty = function (name) { + return this.getDefaultProperties()[name]; +}; + +styfn.getDefaultProperties = util.memoize(function () { + var rawProps = util.extend({ + // common node/edge props + 'events': 'yes', + 'text-events': 'no', + 'text-valign': 'top', + 'text-halign': 'center', + 'color': '#000', + 'text-outline-color': '#000', + 'text-outline-width': 0, + 'text-outline-opacity': 1, + 'text-opacity': 1, + 'text-decoration': 'none', + 'text-transform': 'none', + 'text-wrap': 'none', + 'text-max-width': 9999, + 'text-background-color': '#000', + 'text-background-opacity': 0, + 'text-background-shape': 'rectangle', + 'text-background-padding': 0, + 'text-border-opacity': 0, + 'text-border-width': 0, + 'text-border-style': 'solid', + 'text-border-color': '#000', + 'font-family': 'Helvetica Neue, Helvetica, sans-serif', + 'font-style': 'normal', + // 'font-letiant': fontletiant, + 'font-weight': 'normal', + 'font-size': 16, + 'min-zoomed-font-size': 0, + 'text-rotation': 'none', + 'source-text-rotation': 'none', + 'target-text-rotation': 'none', + 'visibility': 'visible', + 'display': 'element', + 'opacity': 1, + 'z-compound-depth': 'auto', + 'z-index-compare': 'auto', + 'z-index': 0, + 'label': '', + 'text-margin-x': 0, + 'text-margin-y': 0, + 'source-label': '', + 'source-text-offset': 0, + 'source-text-margin-x': 0, + 'source-text-margin-y': 0, + 'target-label': '', + 'target-text-offset': 0, + 'target-text-margin-x': 0, + 'target-text-margin-y': 0, + 'overlay-opacity': 0, + 'overlay-color': '#000', + 'overlay-padding': 10, + 'transition-property': 'none', + 'transition-duration': 0, + 'transition-delay': 0, + 'transition-timing-function': 'linear', + + // node props + 'background-blacken': 0, + 'background-color': '#999', + 'background-opacity': 1, + 'background-image': 'none', + 'background-image-crossorigin': 'anonymous', + 'background-image-opacity': 1, + 'background-position-x': '50%', + 'background-position-y': '50%', + 'background-width-relative-to': 'include-padding', + 'background-height-relative-to': 'include-padding', + 'background-repeat': 'no-repeat', + 'background-fit': 'none', + 'background-clip': 'node', + 'background-width': 'auto', + 'background-height': 'auto', + 'border-color': '#000', + 'border-opacity': 1, + 'border-width': 0, + 'border-style': 'solid', + 'height': 30, + 'width': 30, + 'shape': 'ellipse', + 'shape-polygon-points': '-1, -1, 1, -1, 1, 1, -1, 1', + + // ghost props + 'ghost': 'no', + 'ghost-offset-y': 0, + 'ghost-offset-x': 0, + 'ghost-opacity': 0, + + // compound props + 'padding': 0, + 'padding-relative-to': 'width', + 'position': 'origin', + 'compound-sizing-wrt-labels': 'include', + 'min-width': 0, + 'min-width-bias-left': 0, + 'min-width-bias-right': 0, + 'min-height': 0, + 'min-height-bias-top': 0, + 'min-height-bias-bottom': 0 + }, { + // node pie bg + 'pie-size': '100%' + }, [{ name: 'pie-{{i}}-background-color', value: 'black' }, { name: 'pie-{{i}}-background-size', value: '0%' }, { name: 'pie-{{i}}-background-opacity', value: 1 }].reduce(function (css, prop) { + for (var i = 1; i <= styfn.pieBackgroundN; i++) { + var name = prop.name.replace('{{i}}', i); + var val = prop.value; + + css[name] = val; + } + + return css; + }, {}), { + // edge props + 'line-style': 'solid', + 'line-color': '#999', + 'control-point-step-size': 40, + 'control-point-weights': 0.5, + 'segment-weights': 0.5, + 'segment-distances': 20, + 'edge-distances': 'intersection', + 'curve-style': 'bezier', + 'haystack-radius': 0, + 'arrow-scale': 1, + 'loop-direction': '-45deg', + 'loop-sweep': '-90deg', + 'source-distance-from-node': 0, + 'target-distance-from-node': 0, + 'source-endpoint': 'outside-to-node', + 'target-endpoint': 'outside-to-node' + }, [{ name: 'arrow-shape', value: 'none' }, { name: 'arrow-color', value: '#999' }, { name: 'arrow-fill', value: 'filled' }].reduce(function (css, prop) { + styfn.arrowPrefixes.forEach(function (prefix) { + var name = prefix + '-' + prop.name; + var val = prop.value; + + css[name] = val; + }); + + return css; + }, {})); + + var parsedProps = {}; + + for (var i = 0; i < this.properties.length; i++) { + var prop = this.properties[i]; + + if (prop.pointsTo) { + continue; + } + + var name = prop.name; + var val = rawProps[name]; + var parsedProp = this.parse(name, val); + + parsedProps[name] = parsedProp; + } + + return parsedProps; +}); + +styfn.addDefaultStylesheet = function () { + this.selector('$node > node') // compound (parent) node properties + .css({ + 'shape': 'rectangle', + 'padding': 10, + 'background-color': '#eee', + 'border-color': '#ccc', + 'border-width': 1 + }).selector('edge') // just edge properties + .css({ + 'width': 3, + 'curve-style': 'haystack' + }).selector(':parent <-> node').css({ + 'curve-style': 'bezier', + 'source-endpoint': 'outside-to-line', + 'target-endpoint': 'outside-to-line' + }).selector(':selected').css({ + 'background-color': '#0169D9', + 'line-color': '#0169D9', + 'source-arrow-color': '#0169D9', + 'target-arrow-color': '#0169D9', + 'mid-source-arrow-color': '#0169D9', + 'mid-target-arrow-color': '#0169D9' + }).selector('node:parent:selected').css({ + 'background-color': '#CCE1F9', + 'border-color': '#aec8e5' + }).selector(':active').css({ + 'overlay-color': 'black', + 'overlay-padding': 10, + 'overlay-opacity': 0.25 + }).selector('core') // just core properties + .css({ + 'selection-box-color': '#ddd', + 'selection-box-opacity': 0.65, + 'selection-box-border-color': '#aaa', + 'selection-box-border-width': 1, + 'active-bg-color': 'black', + 'active-bg-opacity': 0.15, + 'active-bg-size': 30, + 'outside-texture-bg-color': '#000', + 'outside-texture-bg-opacity': 0.125 + }); + + this.defaultLength = this.length; +}; + +module.exports = styfn; + +/***/ }), +/* 92 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var is = __webpack_require__(0); +var math = __webpack_require__(2); + +var styfn = {}; + +// a caching layer for property parsing +styfn.parse = function (name, value, propIsBypass, propIsFlat) { + var self = this; + + // function values can't be cached in all cases, and there isn't much benefit of caching them anyway + if (is.fn(value)) { + return self.parseImplWarn(name, value, propIsBypass, propIsFlat); + } + + var flatKey = propIsFlat === 'mapping' || propIsFlat === true || propIsFlat === false || propIsFlat == null ? 'dontcare' : propIsFlat; + var argHash = [name, value, propIsBypass, flatKey].join('$'); + var propCache = self.propCache = self.propCache || {}; + var ret = void 0; + + if (!(ret = propCache[argHash])) { + ret = propCache[argHash] = self.parseImplWarn(name, value, propIsBypass, propIsFlat); + } + + // - bypasses can't be shared b/c the value can be changed by animations or otherwise overridden + // - mappings can't be shared b/c mappings are per-element + if (propIsBypass || propIsFlat === 'mapping') { + // need a copy since props are mutated later in their lifecycles + ret = util.copy(ret); + + if (ret) { + ret.value = util.copy(ret.value); // because it could be an array, e.g. colour + } + } + + return ret; +}; + +styfn.parseImplWarn = function (name, value, propIsBypass, propIsFlat) { + var prop = this.parseImpl(name, value, propIsBypass, propIsFlat); + + if (!prop && value != null) { + util.error('The style property `%s: %s` is invalid', name, value); + } + + return prop; +}; + +// parse a property; return null on invalid; return parsed property otherwise +// fields : +// - name : the name of the property +// - value : the parsed, native-typed value of the property +// - strValue : a string value that represents the property value in valid css +// - bypass : true iff the property is a bypass property +styfn.parseImpl = function (name, value, propIsBypass, propIsFlat) { + var self = this; + + name = util.camel2dash(name); // make sure the property name is in dash form (e.g. 'property-name' not 'propertyName') + + var property = self.properties[name]; + var passedValue = value; + var types = self.types; + + if (!property) { + return null; + } // return null on property of unknown name + if (value === undefined) { + return null; + } // can't assign undefined + + // the property may be an alias + if (property.alias) { + property = property.pointsTo; + name = property.name; + } + + var valueIsString = is.string(value); + if (valueIsString) { + // trim the value to make parsing easier + value = value.trim(); + } + + var type = property.type; + if (!type) { + return null; + } // no type, no luck + + // check if bypass is null or empty string (i.e. indication to delete bypass property) + if (propIsBypass && (value === '' || value === null)) { + return { + name: name, + value: value, + bypass: true, + deleteBypass: true + }; + } + + // check if value is a function used as a mapper + if (is.fn(value)) { + return { + name: name, + value: value, + strValue: 'fn', + mapped: types.fn, + bypass: propIsBypass + }; + } + + // check if value is mapped + var data = void 0, + mapData = void 0; + if (!valueIsString || propIsFlat) { + // then don't bother to do the expensive regex checks + + } else if (data = new RegExp(types.data.regex).exec(value)) { + if (propIsBypass) { + return false; + } // mappers not allowed in bypass + + var mapped = types.data; + + return { + name: name, + value: data, + strValue: '' + value, + mapped: mapped, + field: data[1], + bypass: propIsBypass + }; + } else if (mapData = new RegExp(types.mapData.regex).exec(value)) { + if (propIsBypass) { + return false; + } // mappers not allowed in bypass + if (type.multiple) { + return false; + } // impossible to map to num + + var _mapped = types.mapData; + + // we can map only if the type is a colour or a number + if (!(type.color || type.number)) { + return false; + } + + var valueMin = this.parse(name, mapData[4]); // parse to validate + if (!valueMin || valueMin.mapped) { + return false; + } // can't be invalid or mapped + + var valueMax = this.parse(name, mapData[5]); // parse to validate + if (!valueMax || valueMax.mapped) { + return false; + } // can't be invalid or mapped + + // check if valueMin and valueMax are the same + if (valueMin.value === valueMax.value) { + return false; // can't make much of a mapper without a range + } else if (type.color) { + var c1 = valueMin.value; + var c2 = valueMax.value; + + var same = c1[0] === c2[0] // red + && c1[1] === c2[1] // green + && c1[2] === c2[2] // blue + && ( // optional alpha + c1[3] === c2[3] // same alpha outright + || (c1[3] == null || c1[3] === 1) && ( // full opacity for colour 1? + c2[3] == null || c2[3] === 1) // full opacity for colour 2? + ); + + if (same) { + return false; + } // can't make a mapper without a range + } + + return { + name: name, + value: mapData, + strValue: '' + value, + mapped: _mapped, + field: mapData[1], + fieldMin: parseFloat(mapData[2]), // min & max are numeric + fieldMax: parseFloat(mapData[3]), + valueMin: valueMin.value, + valueMax: valueMax.value, + bypass: propIsBypass + }; + } + + if (type.multiple && propIsFlat !== 'multiple') { + var vals = void 0; + + if (valueIsString) { + vals = value.split(/\s+/); + } else if (is.array(value)) { + vals = value; + } else { + vals = [value]; + } + + if (type.evenMultiple && vals.length % 2 !== 0) { + return null; + } + + var valArr = []; + var unitsArr = []; + var pfValArr = []; + var hasEnum = false; + + for (var i = 0; i < vals.length; i++) { + var p = self.parse(name, vals[i], propIsBypass, 'multiple'); + + hasEnum = hasEnum || is.string(p.value); + + valArr.push(p.value); + pfValArr.push(p.pfValue != null ? p.pfValue : p.value); + unitsArr.push(p.units); + } + + if (type.validate && !type.validate(valArr, unitsArr)) { + return null; + } + + if (type.singleEnum && hasEnum) { + if (valArr.length === 1 && is.string(valArr[0])) { + return { + name: name, + value: valArr[0], + strValue: valArr[0], + bypass: propIsBypass + }; + } else { + return null; + } + } + + return { + name: name, + value: valArr, + pfValue: pfValArr, + strValue: valArr.map(function (val, i) { + return val + (unitsArr[i] || ''); + }).join(' '), + bypass: propIsBypass, + units: unitsArr + }; + } + + // several types also allow enums + var checkEnums = function checkEnums() { + for (var _i = 0; _i < type.enums.length; _i++) { + var en = type.enums[_i]; + + if (en === value) { + return { + name: name, + value: value, + strValue: '' + value, + bypass: propIsBypass + }; + } + } + + return null; + }; + + // check the type and return the appropriate object + if (type.number) { + var units = void 0; + var implicitUnits = 'px'; // not set => px + + if (type.units) { + // use specified units if set + units = type.units; + } + + if (type.implicitUnits) { + implicitUnits = type.implicitUnits; + } + + if (!type.unitless) { + if (valueIsString) { + var unitsRegex = 'px|em' + (type.allowPercent ? '|\\%' : ''); + if (units) { + unitsRegex = units; + } // only allow explicit units if so set + var match = value.match('^(' + util.regex.number + ')(' + unitsRegex + ')?' + '$'); + + if (match) { + value = match[1]; + units = match[2] || implicitUnits; + } + } else if (!units || type.implicitUnits) { + units = implicitUnits; // implicitly px if unspecified + } + } + + value = parseFloat(value); + + // if not a number and enums not allowed, then the value is invalid + if (isNaN(value) && type.enums === undefined) { + return null; + } + + // check if this number type also accepts special keywords in place of numbers + // (i.e. `left`, `auto`, etc) + if (isNaN(value) && type.enums !== undefined) { + value = passedValue; + + return checkEnums(); + } + + // check if value must be an integer + if (type.integer && !is.integer(value)) { + return null; + } + + // check value is within range + if (type.min !== undefined && (value < type.min || type.strictMin && value === type.min) || type.max !== undefined && (value > type.max || type.strictMax && value === type.max)) { + return null; + } + + var ret = { + name: name, + value: value, + strValue: '' + value + (units ? units : ''), + units: units, + bypass: propIsBypass + }; + + // normalise value in pixels + if (type.unitless || units !== 'px' && units !== 'em') { + ret.pfValue = value; + } else { + ret.pfValue = units === 'px' || !units ? value : this.getEmSizeInPixels() * value; + } + + // normalise value in ms + if (units === 'ms' || units === 's') { + ret.pfValue = units === 'ms' ? value : 1000 * value; + } + + // normalise value in rad + if (units === 'deg' || units === 'rad') { + ret.pfValue = units === 'rad' ? value : math.deg2rad(value); + } + + // normalize value in % + if (units === '%') { + ret.pfValue = value / 100; + } + + return ret; + } else if (type.propList) { + + var props = []; + var propsStr = '' + value; + + if (propsStr === 'none') { + // leave empty + + } else { + // go over each prop + + var propsSplit = propsStr.split(','); + for (var _i2 = 0; _i2 < propsSplit.length; _i2++) { + var propName = propsSplit[_i2].trim(); + + if (self.properties[propName]) { + props.push(propName); + } + } + + if (props.length === 0) { + return null; + } + } + + return { + name: name, + value: props, + strValue: props.length === 0 ? 'none' : props.join(', '), + bypass: propIsBypass + }; + } else if (type.color) { + var tuple = util.color2tuple(value); + + if (!tuple) { + return null; + } + + return { + name: name, + value: tuple, + pfValue: tuple, + strValue: '' + value, + bypass: propIsBypass + }; + } else if (type.regex || type.regexes) { + + // first check enums + if (type.enums) { + var enumProp = checkEnums(); + + if (enumProp) { + return enumProp; + } + } + + var regexes = type.regexes ? type.regexes : [type.regex]; + + for (var _i3 = 0; _i3 < regexes.length; _i3++) { + var regex = new RegExp(regexes[_i3]); // make a regex from the type string + var m = regex.exec(value); + + if (m) { + // regex matches + return { + name: name, + value: type.singleRegexMatchValue ? m[1] : m, + strValue: '' + value, + bypass: propIsBypass + }; + } + } + + return null; // didn't match any + } else if (type.string) { + // just return + return { + name: name, + value: '' + value, + strValue: '' + value, + bypass: propIsBypass + }; + } else if (type.enums) { + // check enums last because it's a combo type in others + return checkEnums(); + } else { + return null; // not a type we can handle + } +}; + +module.exports = styfn; + +/***/ }), +/* 93 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var window = __webpack_require__(3); +var math = __webpack_require__(2); + +var corefn = { + + autolock: function autolock(bool) { + if (bool !== undefined) { + this._private.autolock = bool ? true : false; + } else { + return this._private.autolock; + } + + return this; // chaining + }, + + autoungrabify: function autoungrabify(bool) { + if (bool !== undefined) { + this._private.autoungrabify = bool ? true : false; + } else { + return this._private.autoungrabify; + } + + return this; // chaining + }, + + autounselectify: function autounselectify(bool) { + if (bool !== undefined) { + this._private.autounselectify = bool ? true : false; + } else { + return this._private.autounselectify; + } + + return this; // chaining + }, + + panningEnabled: function panningEnabled(bool) { + if (bool !== undefined) { + this._private.panningEnabled = bool ? true : false; + } else { + return this._private.panningEnabled; + } + + return this; // chaining + }, + + userPanningEnabled: function userPanningEnabled(bool) { + if (bool !== undefined) { + this._private.userPanningEnabled = bool ? true : false; + } else { + return this._private.userPanningEnabled; + } + + return this; // chaining + }, + + zoomingEnabled: function zoomingEnabled(bool) { + if (bool !== undefined) { + this._private.zoomingEnabled = bool ? true : false; + } else { + return this._private.zoomingEnabled; + } + + return this; // chaining + }, + + userZoomingEnabled: function userZoomingEnabled(bool) { + if (bool !== undefined) { + this._private.userZoomingEnabled = bool ? true : false; + } else { + return this._private.userZoomingEnabled; + } + + return this; // chaining + }, + + boxSelectionEnabled: function boxSelectionEnabled(bool) { + if (bool !== undefined) { + this._private.boxSelectionEnabled = bool ? true : false; + } else { + return this._private.boxSelectionEnabled; + } + + return this; // chaining + }, + + pan: function pan() { + var args = arguments; + var pan = this._private.pan; + var dim = void 0, + val = void 0, + dims = void 0, + x = void 0, + y = void 0; + + switch (args.length) { + case 0: + // .pan() + return pan; + + case 1: + + if (is.string(args[0])) { + // .pan('x') + dim = args[0]; + return pan[dim]; + } else if (is.plainObject(args[0])) { + // .pan({ x: 0, y: 100 }) + if (!this._private.panningEnabled) { + return this; + } + + dims = args[0]; + x = dims.x; + y = dims.y; + + if (is.number(x)) { + pan.x = x; + } + + if (is.number(y)) { + pan.y = y; + } + + this.emit('pan viewport'); + } + break; + + case 2: + // .pan('x', 100) + if (!this._private.panningEnabled) { + return this; + } + + dim = args[0]; + val = args[1]; + + if ((dim === 'x' || dim === 'y') && is.number(val)) { + pan[dim] = val; + } + + this.emit('pan viewport'); + break; + + default: + break; // invalid + } + + this.notify({ // notify the renderer that the viewport changed + type: 'viewport' + }); + + return this; // chaining + }, + + panBy: function panBy(arg0, arg1) { + var args = arguments; + var pan = this._private.pan; + var dim = void 0, + val = void 0, + dims = void 0, + x = void 0, + y = void 0; + + if (!this._private.panningEnabled) { + return this; + } + + switch (args.length) { + case 1: + + if (is.plainObject(arg0)) { + // .panBy({ x: 0, y: 100 }) + dims = args[0]; + x = dims.x; + y = dims.y; + + if (is.number(x)) { + pan.x += x; + } + + if (is.number(y)) { + pan.y += y; + } + + this.emit('pan viewport'); + } + break; + + case 2: + // .panBy('x', 100) + dim = arg0; + val = arg1; + + if ((dim === 'x' || dim === 'y') && is.number(val)) { + pan[dim] += val; + } + + this.emit('pan viewport'); + break; + + default: + break; // invalid + } + + this.notify({ // notify the renderer that the viewport changed + type: 'viewport' + }); + + return this; // chaining + }, + + fit: function fit(elements, padding) { + var viewportState = this.getFitViewport(elements, padding); + + if (viewportState) { + var _p = this._private; + _p.zoom = viewportState.zoom; + _p.pan = viewportState.pan; + + this.emit('pan zoom viewport'); + + this.notify({ // notify the renderer that the viewport changed + type: 'viewport' + }); + } + + return this; // chaining + }, + + getFitViewport: function getFitViewport(elements, padding) { + if (is.number(elements) && padding === undefined) { + // elements is optional + padding = elements; + elements = undefined; + } + + if (!this._private.panningEnabled || !this._private.zoomingEnabled) { + return; + } + + var bb = void 0; + + if (is.string(elements)) { + var sel = elements; + elements = this.$(sel); + } else if (is.boundingBox(elements)) { + // assume bb + var bbe = elements; + bb = { + x1: bbe.x1, + y1: bbe.y1, + x2: bbe.x2, + y2: bbe.y2 + }; + + bb.w = bb.x2 - bb.x1; + bb.h = bb.y2 - bb.y1; + } else if (!is.elementOrCollection(elements)) { + elements = this.mutableElements(); + } + + if (is.elementOrCollection(elements) && elements.empty()) { + return; + } // can't fit to nothing + + bb = bb || elements.boundingBox(); + + var w = this.width(); + var h = this.height(); + var zoom = void 0; + padding = is.number(padding) ? padding : 0; + + if (!isNaN(w) && !isNaN(h) && w > 0 && h > 0 && !isNaN(bb.w) && !isNaN(bb.h) && bb.w > 0 && bb.h > 0) { + zoom = Math.min((w - 2 * padding) / bb.w, (h - 2 * padding) / bb.h); + + // crop zoom + zoom = zoom > this._private.maxZoom ? this._private.maxZoom : zoom; + zoom = zoom < this._private.minZoom ? this._private.minZoom : zoom; + + var pan = { // now pan to middle + x: (w - zoom * (bb.x1 + bb.x2)) / 2, + y: (h - zoom * (bb.y1 + bb.y2)) / 2 + }; + + return { + zoom: zoom, + pan: pan + }; + } + + return; + }, + + minZoom: function minZoom(zoom) { + if (zoom === undefined) { + return this._private.minZoom; + } else if (is.number(zoom)) { + this._private.minZoom = zoom; + } + + return this; + }, + + maxZoom: function maxZoom(zoom) { + if (zoom === undefined) { + return this._private.maxZoom; + } else if (is.number(zoom)) { + this._private.maxZoom = zoom; + } + + return this; + }, + + getZoomedViewport: function getZoomedViewport(params) { + var _p = this._private; + var currentPan = _p.pan; + var currentZoom = _p.zoom; + var pos = void 0; // in rendered px + var zoom = void 0; + var bail = false; + + if (!_p.zoomingEnabled) { + // zooming disabled + bail = true; + } + + if (is.number(params)) { + // then set the zoom + zoom = params; + } else if (is.plainObject(params)) { + // then zoom about a point + zoom = params.level; + + if (params.position != null) { + pos = math.modelToRenderedPosition(params.position, currentZoom, currentPan); + } else if (params.renderedPosition != null) { + pos = params.renderedPosition; + } + + if (pos != null && !_p.panningEnabled) { + // panning disabled + bail = true; + } + } + + // crop zoom + zoom = zoom > _p.maxZoom ? _p.maxZoom : zoom; + zoom = zoom < _p.minZoom ? _p.minZoom : zoom; + + // can't zoom with invalid params + if (bail || !is.number(zoom) || zoom === currentZoom || pos != null && (!is.number(pos.x) || !is.number(pos.y))) { + return null; + } + + if (pos != null) { + // set zoom about position + var pan1 = currentPan; + var zoom1 = currentZoom; + var zoom2 = zoom; + + var pan2 = { + x: -zoom2 / zoom1 * (pos.x - pan1.x) + pos.x, + y: -zoom2 / zoom1 * (pos.y - pan1.y) + pos.y + }; + + return { + zoomed: true, + panned: true, + zoom: zoom2, + pan: pan2 + }; + } else { + // just set the zoom + return { + zoomed: true, + panned: false, + zoom: zoom, + pan: currentPan + }; + } + }, + + zoom: function zoom(params) { + if (params === undefined) { + // get + return this._private.zoom; + } else { + // set + var vp = this.getZoomedViewport(params); + var _p = this._private; + + if (vp == null || !vp.zoomed) { + return this; + } + + _p.zoom = vp.zoom; + + if (vp.panned) { + _p.pan.x = vp.pan.x; + _p.pan.y = vp.pan.y; + } + + this.emit('zoom' + (vp.panned ? ' pan' : '') + ' viewport'); + + this.notify({ // notify the renderer that the viewport changed + type: 'viewport' + }); + + return this; // chaining + } + }, + + viewport: function viewport(opts) { + var _p = this._private; + var zoomDefd = true; + var panDefd = true; + var events = []; // to trigger + var zoomFailed = false; + var panFailed = false; + + if (!opts) { + return this; + } + if (!is.number(opts.zoom)) { + zoomDefd = false; + } + if (!is.plainObject(opts.pan)) { + panDefd = false; + } + if (!zoomDefd && !panDefd) { + return this; + } + + if (zoomDefd) { + var z = opts.zoom; + + if (z < _p.minZoom || z > _p.maxZoom || !_p.zoomingEnabled) { + zoomFailed = true; + } else { + _p.zoom = z; + + events.push('zoom'); + } + } + + if (panDefd && (!zoomFailed || !opts.cancelOnFailedZoom) && _p.panningEnabled) { + var p = opts.pan; + + if (is.number(p.x)) { + _p.pan.x = p.x; + panFailed = false; + } + + if (is.number(p.y)) { + _p.pan.y = p.y; + panFailed = false; + } + + if (!panFailed) { + events.push('pan'); + } + } + + if (events.length > 0) { + events.push('viewport'); + this.emit(events.join(' ')); + + this.notify({ + type: 'viewport' + }); + } + + return this; // chaining + }, + + center: function center(elements) { + var pan = this.getCenterPan(elements); + + if (pan) { + this._private.pan = pan; + + this.emit('pan viewport'); + + this.notify({ // notify the renderer that the viewport changed + type: 'viewport' + }); + } + + return this; // chaining + }, + + getCenterPan: function getCenterPan(elements, zoom) { + if (!this._private.panningEnabled) { + return; + } + + if (is.string(elements)) { + var selector = elements; + elements = this.mutableElements().filter(selector); + } else if (!is.elementOrCollection(elements)) { + elements = this.mutableElements(); + } + + if (elements.length === 0) { + return; + } // can't centre pan to nothing + + var bb = elements.boundingBox(); + var w = this.width(); + var h = this.height(); + zoom = zoom === undefined ? this._private.zoom : zoom; + + var pan = { // middle + x: (w - zoom * (bb.x1 + bb.x2)) / 2, + y: (h - zoom * (bb.y1 + bb.y2)) / 2 + }; + + return pan; + }, + + reset: function reset() { + if (!this._private.panningEnabled || !this._private.zoomingEnabled) { + return this; + } + + this.viewport({ + pan: { x: 0, y: 0 }, + zoom: 1 + }); + + return this; // chaining + }, + + invalidateSize: function invalidateSize() { + this._private.sizeCache = null; + }, + + size: function size() { + var _p = this._private; + var container = _p.container; + + return _p.sizeCache = _p.sizeCache || (container ? function () { + var style = window.getComputedStyle(container); + var val = function val(name) { + return parseFloat(style.getPropertyValue(name)); + }; + + return { + width: container.clientWidth - val('padding-left') - val('padding-right'), + height: container.clientHeight - val('padding-top') - val('padding-bottom') + }; + }() : { // fallback if no container (not 0 b/c can be used for dividing etc) + width: 1, + height: 1 + }); + }, + + width: function width() { + return this.size().width; + }, + + height: function height() { + return this.size().height; + }, + + extent: function extent() { + var pan = this._private.pan; + var zoom = this._private.zoom; + var rb = this.renderedExtent(); + + var b = { + x1: (rb.x1 - pan.x) / zoom, + x2: (rb.x2 - pan.x) / zoom, + y1: (rb.y1 - pan.y) / zoom, + y2: (rb.y2 - pan.y) / zoom + }; + + b.w = b.x2 - b.x1; + b.h = b.y2 - b.y1; + + return b; + }, + + renderedExtent: function renderedExtent() { + var width = this.width(); + var height = this.height(); + + return { + x1: 0, + y1: 0, + x2: width, + y2: height, + w: width, + h: height + }; + } +}; + +// aliases +corefn.centre = corefn.center; + +// backwards compatibility +corefn.autolockNodes = corefn.autolock; +corefn.autoungrabifyNodes = corefn.autoungrabify; + +module.exports = corefn; + +/***/ }), +/* 94 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var define = __webpack_require__(4); +var Collection = __webpack_require__(7); +var Core = __webpack_require__(12); +var incExts = __webpack_require__(95); +var is = __webpack_require__(0); +var Emitter = __webpack_require__(11); + +// registered extensions to cytoscape, indexed by name +var extensions = {}; + +// registered modules for extensions, indexed by name +var modules = {}; + +function setExtension(type, name, registrant) { + + var ext = registrant; + + var overrideErr = function overrideErr(field) { + util.error('Can not register `' + name + '` for `' + type + '` since `' + field + '` already exists in the prototype and can not be overridden'); + }; + + if (type === 'core') { + if (Core.prototype[name]) { + return overrideErr(name); + } else { + Core.prototype[name] = registrant; + } + } else if (type === 'collection') { + if (Collection.prototype[name]) { + return overrideErr(name); + } else { + Collection.prototype[name] = registrant; + } + } else if (type === 'layout') { + // fill in missing layout functions in the prototype + + var Layout = function Layout(options) { + this.options = options; + + registrant.call(this, options); + + // make sure layout has _private for use w/ std apis like .on() + if (!is.plainObject(this._private)) { + this._private = {}; + } + + this._private.cy = options.cy; + this._private.listeners = []; + + this.createEmitter(); + }; + + var layoutProto = Layout.prototype = Object.create(registrant.prototype); + + var optLayoutFns = []; + + for (var i = 0; i < optLayoutFns.length; i++) { + var fnName = optLayoutFns[i]; + + layoutProto[fnName] = layoutProto[fnName] || function () { + return this; + }; + } + + // either .start() or .run() is defined, so autogen the other + if (layoutProto.start && !layoutProto.run) { + layoutProto.run = function () { + this.start();return this; + }; + } else if (!layoutProto.start && layoutProto.run) { + layoutProto.start = function () { + this.run();return this; + }; + } + + var regStop = registrant.prototype.stop; + layoutProto.stop = function () { + var opts = this.options; + + if (opts && opts.animate) { + var anis = this.animations; + + if (anis) { + for (var _i = 0; _i < anis.length; _i++) { + anis[_i].stop(); + } + } + } + + if (regStop) { + regStop.call(this); + } else { + this.emit('layoutstop'); + } + + return this; + }; + + if (!layoutProto.destroy) { + layoutProto.destroy = function () { + return this; + }; + } + + layoutProto.cy = function () { + return this._private.cy; + }; + + var getCy = function getCy(layout) { + return layout._private.cy; + }; + + util.assign(layoutProto, { + createEmitter: function createEmitter() { + this._private.emitter = new Emitter({ + eventFields: function eventFields(layout) { + return { + layout: layout, + cy: getCy(layout), + target: layout + }; + }, + bubble: function bubble() { + return true; + }, + parent: function parent(layout) { + return getCy(layout); + }, + context: this + }); + + return this; + }, + emitter: function emitter() { + return this._private.emitter; + }, + on: function on(evt, cb) { + this.emitter().on(evt, cb);return this; + }, + one: function one(evt, cb) { + this.emitter().one(evt, cb);return this; + }, + once: function once(evt, cb) { + this.emitter().one(evt, cb);return this; + }, + removeListener: function removeListener(evt, cb) { + this.emitter().removeListener(evt, cb);return this; + }, + emit: function emit(evt, params) { + this.emitter().emit(evt, params);return this; + } + }); + + define.eventAliasesOn(layoutProto); + + ext = Layout; // replace with our wrapped layout + } else if (type === 'renderer' && name !== 'null' && name !== 'base') { + // user registered renderers inherit from base + + var BaseRenderer = getExtension('renderer', 'base'); + var bProto = BaseRenderer.prototype; + var RegistrantRenderer = registrant; + var rProto = registrant.prototype; + + var Renderer = function Renderer() { + BaseRenderer.apply(this, arguments); + RegistrantRenderer.apply(this, arguments); + }; + + var proto = Renderer.prototype; + + for (var pName in bProto) { + var pVal = bProto[pName]; + var existsInR = rProto[pName] != null; + + if (existsInR) { + return overrideErr(pName); + } + + proto[pName] = pVal; // take impl from base + } + + for (var _pName in rProto) { + proto[_pName] = rProto[_pName]; // take impl from registrant + } + + bProto.clientFunctions.forEach(function (name) { + proto[name] = proto[name] || function () { + util.error('Renderer does not implement `renderer.' + name + '()` on its prototype'); + }; + }); + + ext = Renderer; + } + + return util.setMap({ + map: extensions, + keys: [type, name], + value: ext + }); +} + +function getExtension(type, name) { + return util.getMap({ + map: extensions, + keys: [type, name] + }); +} + +function setModule(type, name, moduleType, moduleName, registrant) { + return util.setMap({ + map: modules, + keys: [type, name, moduleType, moduleName], + value: registrant + }); +} + +function getModule(type, name, moduleType, moduleName) { + return util.getMap({ + map: modules, + keys: [type, name, moduleType, moduleName] + }); +} + +var extension = function extension() { + // e.g. extension('renderer', 'svg') + if (arguments.length === 2) { + return getExtension.apply(null, arguments); + } + + // e.g. extension('renderer', 'svg', { ... }) + else if (arguments.length === 3) { + return setExtension.apply(null, arguments); + } + + // e.g. extension('renderer', 'svg', 'nodeShape', 'ellipse') + else if (arguments.length === 4) { + return getModule.apply(null, arguments); + } + + // e.g. extension('renderer', 'svg', 'nodeShape', 'ellipse', { ... }) + else if (arguments.length === 5) { + return setModule.apply(null, arguments); + } else { + util.error('Invalid extension access syntax'); + } +}; + +// allows a core instance to access extensions internally +Core.prototype.extension = extension; + +// included extensions +incExts.forEach(function (group) { + group.extensions.forEach(function (ext) { + setExtension(group.type, ext.name, ext.impl); + }); +}); + +module.exports = extension; + +/***/ }), +/* 95 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = [{ + type: 'layout', + extensions: __webpack_require__(96) +}, { + type: 'renderer', + extensions: __webpack_require__(105) +}]; + +/***/ }), +/* 96 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = [{ name: 'breadthfirst', impl: __webpack_require__(97) }, { name: 'circle', impl: __webpack_require__(98) }, { name: 'concentric', impl: __webpack_require__(99) }, { name: 'cose', impl: __webpack_require__(100) }, { name: 'grid', impl: __webpack_require__(101) }, { name: 'null', impl: __webpack_require__(102) }, { name: 'preset', impl: __webpack_require__(103) }, { name: 'random', impl: __webpack_require__(104) }]; + +/***/ }), +/* 97 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var math = __webpack_require__(2); +var is = __webpack_require__(0); + +var defaults = { + fit: true, // whether to fit the viewport to the graph + directed: false, // whether the tree is directed downwards (or edges can point in any direction if false) + padding: 30, // padding on fit + circle: false, // put depths in concentric circles if true, put depths top down if false + spacingFactor: 1.75, // positive spacing factor, larger => more space between nodes (N.B. n/a if causes overlap) + boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space + nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm + roots: undefined, // the roots of the trees + maximalAdjustments: 0, // how many times to try to position the nodes in a maximal way (i.e. no backtracking) + animate: false, // whether to transition the node positions + animationDuration: 500, // duration of animation in ms if enabled + animationEasing: undefined, // easing of animation if enabled, + animateFilter: function animateFilter(node, i) { + return true; + }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts + ready: undefined, // callback on layoutready + stop: undefined, // callback on layoutstop + transform: function transform(node, position) { + return position; + } // transform a given node position. Useful for changing flow direction in discrete layouts +}; + +function BreadthFirstLayout(options) { + this.options = util.extend({}, defaults, options); +} + +BreadthFirstLayout.prototype.run = function () { + var params = this.options; + var options = params; + + var cy = params.cy; + var eles = options.eles; + var nodes = eles.nodes().not(':parent'); + var graph = eles; + + var bb = math.makeBoundingBox(options.boundingBox ? options.boundingBox : { + x1: 0, y1: 0, w: cy.width(), h: cy.height() + }); + + var roots = void 0; + if (is.elementOrCollection(options.roots)) { + roots = options.roots; + } else if (is.array(options.roots)) { + var rootsArray = []; + + for (var i = 0; i < options.roots.length; i++) { + var id = options.roots[i]; + var ele = cy.getElementById(id); + rootsArray.push(ele); + } + + roots = cy.collection(rootsArray); + } else if (is.string(options.roots)) { + roots = cy.$(options.roots); + } else { + if (options.directed) { + roots = nodes.roots(); + } else { + var components = []; + var unhandledNodes = nodes; + + var _loop = function _loop() { + var currComp = cy.collection(); + + eles.bfs({ + roots: unhandledNodes[0], + visit: function visit(node, edge, pNode, i, depth) { + currComp = currComp.add(node); + }, + directed: false + }); + + unhandledNodes = unhandledNodes.not(currComp); + components.push(currComp); + }; + + while (unhandledNodes.length > 0) { + _loop(); + } + + roots = cy.collection(); + + var _loop2 = function _loop2(_i) { + var comp = components[_i]; + var maxDegree = comp.maxDegree(false); + var compRoots = comp.filter(function (ele) { + return ele.degree(false) === maxDegree; + }); + + roots = roots.add(compRoots); + }; + + for (var _i = 0; _i < components.length; _i++) { + _loop2(_i); + } + } + } + + var depths = []; + var foundByBfs = {}; + var id2depth = {}; + var prevNode = {}; + var prevEdge = {}; + var successors = {}; + + // find the depths of the nodes + graph.bfs({ + roots: roots, + directed: options.directed, + visit: function visit(node, edge, pNode, i, depth) { + var ele = node[0]; + var id = ele.id(); + + if (!depths[depth]) { + depths[depth] = []; + } + + depths[depth].push(ele); + foundByBfs[id] = true; + id2depth[id] = depth; + prevNode[id] = pNode; + prevEdge[id] = edge; + + if (pNode) { + var prevId = pNode.id(); + var succ = successors[prevId] = successors[prevId] || []; + + succ.push(node); + } + } + }); + + // check for nodes not found by bfs + var orphanNodes = []; + for (var _i2 = 0; _i2 < nodes.length; _i2++) { + var _ele = nodes[_i2]; + + if (foundByBfs[_ele.id()]) { + continue; + } else { + orphanNodes.push(_ele); + } + } + + // assign orphan nodes a depth from their neighborhood + var maxChecks = orphanNodes.length * 3; + var checks = 0; + while (orphanNodes.length !== 0 && checks < maxChecks) { + var node = orphanNodes.shift(); + var neighbors = node.neighborhood().nodes(); + var assignedDepth = false; + + for (var _i3 = 0; _i3 < neighbors.length; _i3++) { + var depth = id2depth[neighbors[_i3].id()]; + + if (depth !== undefined) { + depths[depth].push(node); + assignedDepth = true; + break; + } + } + + if (!assignedDepth) { + orphanNodes.push(node); + } + + checks++; + } + + // assign orphan nodes that are still left to the depth of their subgraph + while (orphanNodes.length !== 0) { + var _node = orphanNodes.shift(); + //let subgraph = graph.bfs( node ).path; + var _assignedDepth = false; + + // for( let i = 0; i < subgraph.length; i++ ){ + // let depth = id2depth[ subgraph[i].id() ]; + + // if( depth !== undefined ){ + // depths[depth].push( node ); + // assignedDepth = true; + // break; + // } + // } + + if (!_assignedDepth) { + // worst case if the graph really isn't tree friendly, then just dump it in 0 + if (depths.length === 0) { + depths.push([]); + } + + depths[0].push(_node); + } + } + + // assign the nodes a depth and index + var assignDepthsToEles = function assignDepthsToEles() { + for (var _i4 = 0; _i4 < depths.length; _i4++) { + var _eles = depths[_i4]; + + for (var j = 0; j < _eles.length; j++) { + var _ele2 = _eles[j]; + + if (_ele2 == null) { + _eles.splice(j, 1); + j--; + continue; + } + + _ele2._private.scratch.breadthfirst = { + depth: _i4, + index: j + }; + } + } + }; + assignDepthsToEles(); + + var intersectsDepth = function intersectsDepth(node) { + // returns true if has edges pointing in from a higher depth + var edges = node.connectedEdges(function (ele) { + return ele.data('target') === node.id(); + }); + var thisInfo = node._private.scratch.breadthfirst; + var highestDepthOfOther = 0; + var highestOther = void 0; + for (var _i5 = 0; _i5 < edges.length; _i5++) { + var edge = edges[_i5]; + var otherNode = edge.source()[0]; + var otherInfo = otherNode._private.scratch.breadthfirst; + + if (thisInfo.depth <= otherInfo.depth && highestDepthOfOther < otherInfo.depth) { + highestDepthOfOther = otherInfo.depth; + highestOther = otherNode; + } + } + + return highestOther; + }; + + // make maximal if so set by adjusting depths + for (var adj = 0; adj < options.maximalAdjustments; adj++) { + + var nDepths = depths.length; + var elesToMove = []; + for (var _i6 = 0; _i6 < nDepths; _i6++) { + var _depth = depths[_i6]; + + var nDepth = _depth.length; + for (var j = 0; j < nDepth; j++) { + var _ele3 = _depth[j]; + var info = _ele3._private.scratch.breadthfirst; + var intEle = intersectsDepth(_ele3); + + if (intEle) { + info.intEle = intEle; + elesToMove.push(_ele3); + } + } + } + + for (var _i7 = 0; _i7 < elesToMove.length; _i7++) { + var _ele4 = elesToMove[_i7]; + var _info = _ele4._private.scratch.breadthfirst; + var _intEle = _info.intEle; + var intInfo = _intEle._private.scratch.breadthfirst; + + depths[_info.depth][_info.index] = null; // remove from old depth & index (create hole to be cleaned) + + // add to end of new depth + var newDepth = intInfo.depth + 1; + while (newDepth > depths.length - 1) { + depths.push([]); + } + depths[newDepth].push(_ele4); + + _info.depth = newDepth; + _info.index = depths[newDepth].length - 1; + } + + assignDepthsToEles(); + } + + // find min distance we need to leave between nodes + var minDistance = 0; + if (options.avoidOverlap) { + for (var _i8 = 0; _i8 < nodes.length; _i8++) { + var n = nodes[_i8]; + var nbb = n.layoutDimensions(options); + var w = nbb.w; + var h = nbb.h; + + minDistance = Math.max(minDistance, w, h); + } + } + + // get the weighted percent for an element based on its connectivity to other levels + var cachedWeightedPercent = {}; + var getWeightedPercent = function getWeightedPercent(ele) { + if (cachedWeightedPercent[ele.id()]) { + return cachedWeightedPercent[ele.id()]; + } + + var eleDepth = ele._private.scratch.breadthfirst.depth; + var neighbors = ele.neighborhood().nodes().not(':parent').intersection(nodes); + var percent = 0; + var samples = 0; + + for (var _i9 = 0; _i9 < neighbors.length; _i9++) { + var neighbor = neighbors[_i9]; + var bf = neighbor._private.scratch.breadthfirst; + var index = bf.index; + var _depth2 = bf.depth; + var _nDepth = depths[_depth2].length; + + if (eleDepth > _depth2 || eleDepth === 0) { + // only get influenced by elements above + percent += index / _nDepth; + samples++; + } + } + + samples = Math.max(1, samples); + percent = percent / samples; + + if (samples === 0) { + // so lone nodes have a "don't care" state in sorting + percent = undefined; + } + + cachedWeightedPercent[ele.id()] = percent; + return percent; + }; + + // rearrange the indices in each depth level based on connectivity + + var sortFn = function sortFn(a, b) { + var apct = getWeightedPercent(a); + var bpct = getWeightedPercent(b); + + return apct - bpct; + }; + + for (var times = 0; times < 3; times++) { + // do it a few times b/c the depths are dynamic and we want a more stable result + + for (var _i10 = 0; _i10 < depths.length; _i10++) { + depths[_i10] = depths[_i10].sort(sortFn); + } + assignDepthsToEles(); // and update + } + + var biggestDepthSize = 0; + for (var _i11 = 0; _i11 < depths.length; _i11++) { + biggestDepthSize = Math.max(depths[_i11].length, biggestDepthSize); + } + + var center = { + x: bb.x1 + bb.w / 2, + y: bb.x1 + bb.h / 2 + }; + + var getPosition = function getPosition(ele, isBottomDepth) { + var info = ele._private.scratch.breadthfirst; + var depth = info.depth; + var index = info.index; + var depthSize = depths[depth].length; + + var distanceX = Math.max(bb.w / (depthSize + 1), minDistance); + var distanceY = Math.max(bb.h / (depths.length + 1), minDistance); + var radiusStepSize = Math.min(bb.w / 2 / depths.length, bb.h / 2 / depths.length); + radiusStepSize = Math.max(radiusStepSize, minDistance); + + if (!options.circle) { + + var epos = { + x: center.x + (index + 1 - (depthSize + 1) / 2) * distanceX, + y: (depth + 1) * distanceY + }; + + if (isBottomDepth) { + return epos; + } + + // let succs = successors[ ele.id() ]; + // if( succs ){ + // epos.x = 0; + // + // for( let i = 0 ; i < succs.length; i++ ){ + // let spos = pos[ succs[i].id() ]; + // + // epos.x += spos.x; + // } + // + // epos.x /= succs.length; + // } else { + // //debugger; + // } + + return epos; + } else { + if (options.circle) { + var radius = radiusStepSize * depth + radiusStepSize - (depths.length > 0 && depths[0].length <= 3 ? radiusStepSize / 2 : 0); + var theta = 2 * Math.PI / depths[depth].length * index; + + if (depth === 0 && depths[0].length === 1) { + radius = 1; + } + + return { + x: center.x + radius * Math.cos(theta), + y: center.y + radius * Math.sin(theta) + }; + } else { + return { + x: center.x + (index + 1 - (depthSize + 1) / 2) * distanceX, + y: (depth + 1) * distanceY + }; + } + } + }; + + // get positions in reverse depth order + var pos = {}; + for (var _i12 = depths.length - 1; _i12 >= 0; _i12--) { + var _depth3 = depths[_i12]; + + for (var _j = 0; _j < _depth3.length; _j++) { + var _node2 = _depth3[_j]; + + pos[_node2.id()] = getPosition(_node2, _i12 === depths.length - 1); + } + } + + nodes.layoutPositions(this, options, function (node) { + return pos[node.id()]; + }); + + return this; // chaining +}; + +module.exports = BreadthFirstLayout; + +/***/ }), +/* 98 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var math = __webpack_require__(2); +var is = __webpack_require__(0); + +var defaults = { + fit: true, // whether to fit the viewport to the graph + padding: 30, // the padding on fit + boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + avoidOverlap: true, // prevents node overlap, may overflow boundingBox and radius if not enough space + nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm + spacingFactor: undefined, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up + radius: undefined, // the radius of the circle + startAngle: 3 / 2 * Math.PI, // where nodes start in radians + sweep: undefined, // how many radians should be between the first and last node (defaults to full circle) + clockwise: true, // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) + sort: undefined, // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } + animate: false, // whether to transition the node positions + animationDuration: 500, // duration of animation in ms if enabled + animationEasing: undefined, // easing of animation if enabled + animateFilter: function animateFilter(node, i) { + return true; + }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts + ready: undefined, // callback on layoutready + stop: undefined, // callback on layoutstop + transform: function transform(node, position) { + return position; + } // transform a given node position. Useful for changing flow direction in discrete layouts + +}; + +function CircleLayout(options) { + this.options = util.extend({}, defaults, options); +} + +CircleLayout.prototype.run = function () { + var params = this.options; + var options = params; + + var cy = params.cy; + var eles = options.eles; + + var clockwise = options.counterclockwise !== undefined ? !options.counterclockwise : options.clockwise; + + var nodes = eles.nodes().not(':parent'); + + if (options.sort) { + nodes = nodes.sort(options.sort); + } + + var bb = math.makeBoundingBox(options.boundingBox ? options.boundingBox : { + x1: 0, y1: 0, w: cy.width(), h: cy.height() + }); + + var center = { + x: bb.x1 + bb.w / 2, + y: bb.y1 + bb.h / 2 + }; + + var sweep = options.sweep === undefined ? 2 * Math.PI - 2 * Math.PI / nodes.length : options.sweep; + var dTheta = sweep / Math.max(1, nodes.length - 1); + var r = void 0; + + var minDistance = 0; + for (var i = 0; i < nodes.length; i++) { + var n = nodes[i]; + var nbb = n.layoutDimensions(options); + var w = nbb.w; + var h = nbb.h; + + minDistance = Math.max(minDistance, w, h); + } + + if (is.number(options.radius)) { + r = options.radius; + } else if (nodes.length <= 1) { + r = 0; + } else { + r = Math.min(bb.h, bb.w) / 2 - minDistance; + } + + // calculate the radius + if (nodes.length > 1 && options.avoidOverlap) { + // but only if more than one node (can't overlap) + minDistance *= 1.75; // just to have some nice spacing + + var dcos = Math.cos(dTheta) - Math.cos(0); + var dsin = Math.sin(dTheta) - Math.sin(0); + var rMin = Math.sqrt(minDistance * minDistance / (dcos * dcos + dsin * dsin)); // s.t. no nodes overlapping + r = Math.max(rMin, r); + } + + var getPos = function getPos(ele, i) { + var theta = options.startAngle + i * dTheta * (clockwise ? 1 : -1); + + var rx = r * Math.cos(theta); + var ry = r * Math.sin(theta); + var pos = { + x: center.x + rx, + y: center.y + ry + }; + + return pos; + }; + + nodes.layoutPositions(this, options, getPos); + + return this; // chaining +}; + +module.exports = CircleLayout; + +/***/ }), +/* 99 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var math = __webpack_require__(2); + +var defaults = { + fit: true, // whether to fit the viewport to the graph + padding: 30, // the padding on fit + startAngle: 3 / 2 * Math.PI, // where nodes start in radians + sweep: undefined, // how many radians should be between the first and last node (defaults to full circle) + clockwise: true, // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) + equidistant: false, // whether levels have an equal radial distance betwen them, may cause bounding box overflow + minNodeSpacing: 10, // min spacing between outside of nodes (used for radius adjustment) + boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space + nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm + height: undefined, // height of layout area (overrides container height) + width: undefined, // width of layout area (overrides container width) + spacingFactor: undefined, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up + concentric: function concentric(node) { + // returns numeric value for each node, placing higher nodes in levels towards the centre + return node.degree(); + }, + levelWidth: function levelWidth(nodes) { + // the letiation of concentric values in each level + return nodes.maxDegree() / 4; + }, + animate: false, // whether to transition the node positions + animationDuration: 500, // duration of animation in ms if enabled + animationEasing: undefined, // easing of animation if enabled + animateFilter: function animateFilter(node, i) { + return true; + }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts + ready: undefined, // callback on layoutready + stop: undefined, // callback on layoutstop + transform: function transform(node, position) { + return position; + } // transform a given node position. Useful for changing flow direction in discrete layouts +}; + +function ConcentricLayout(options) { + this.options = util.extend({}, defaults, options); +} + +ConcentricLayout.prototype.run = function () { + var params = this.options; + var options = params; + + var clockwise = options.counterclockwise !== undefined ? !options.counterclockwise : options.clockwise; + + var cy = params.cy; + + var eles = options.eles; + var nodes = eles.nodes().not(':parent'); + + var bb = math.makeBoundingBox(options.boundingBox ? options.boundingBox : { + x1: 0, y1: 0, w: cy.width(), h: cy.height() + }); + + var center = { + x: bb.x1 + bb.w / 2, + y: bb.y1 + bb.h / 2 + }; + + var nodeValues = []; // { node, value } + var theta = options.startAngle; + var maxNodeSize = 0; + + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + var value = void 0; + + // calculate the node value + value = options.concentric(node); + nodeValues.push({ + value: value, + node: node + }); + + // for style mapping + node._private.scratch.concentric = value; + } + + // in case we used the `concentric` in style + nodes.updateStyle(); + + // calculate max size now based on potentially updated mappers + for (var _i = 0; _i < nodes.length; _i++) { + var _node = nodes[_i]; + var nbb = _node.layoutDimensions(options); + + maxNodeSize = Math.max(maxNodeSize, nbb.w, nbb.h); + } + + // sort node values in descreasing order + nodeValues.sort(function (a, b) { + return b.value - a.value; + }); + + var levelWidth = options.levelWidth(nodes); + + // put the values into levels + var levels = [[]]; + var currentLevel = levels[0]; + for (var _i2 = 0; _i2 < nodeValues.length; _i2++) { + var val = nodeValues[_i2]; + + if (currentLevel.length > 0) { + var diff = Math.abs(currentLevel[0].value - val.value); + + if (diff >= levelWidth) { + currentLevel = []; + levels.push(currentLevel); + } + } + + currentLevel.push(val); + } + + // create positions from levels + + var minDist = maxNodeSize + options.minNodeSpacing; // min dist between nodes + + if (!options.avoidOverlap) { + // then strictly constrain to bb + var firstLvlHasMulti = levels.length > 0 && levels[0].length > 1; + var maxR = Math.min(bb.w, bb.h) / 2 - minDist; + var rStep = maxR / (levels.length + firstLvlHasMulti ? 1 : 0); + + minDist = Math.min(minDist, rStep); + } + + // find the metrics for each level + var r = 0; + for (var _i3 = 0; _i3 < levels.length; _i3++) { + var level = levels[_i3]; + var sweep = options.sweep === undefined ? 2 * Math.PI - 2 * Math.PI / level.length : options.sweep; + var dTheta = level.dTheta = sweep / Math.max(1, level.length - 1); + + // calculate the radius + if (level.length > 1 && options.avoidOverlap) { + // but only if more than one node (can't overlap) + var dcos = Math.cos(dTheta) - Math.cos(0); + var dsin = Math.sin(dTheta) - Math.sin(0); + var rMin = Math.sqrt(minDist * minDist / (dcos * dcos + dsin * dsin)); // s.t. no nodes overlapping + + r = Math.max(rMin, r); + } + + level.r = r; + + r += minDist; + } + + if (options.equidistant) { + var rDeltaMax = 0; + var _r = 0; + + for (var _i4 = 0; _i4 < levels.length; _i4++) { + var _level = levels[_i4]; + var rDelta = _level.r - _r; + + rDeltaMax = Math.max(rDeltaMax, rDelta); + } + + _r = 0; + for (var _i5 = 0; _i5 < levels.length; _i5++) { + var _level2 = levels[_i5]; + + if (_i5 === 0) { + _r = _level2.r; + } + + _level2.r = _r; + + _r += rDeltaMax; + } + } + + // calculate the node positions + var pos = {}; // id => position + for (var _i6 = 0; _i6 < levels.length; _i6++) { + var _level3 = levels[_i6]; + var _dTheta = _level3.dTheta; + var _r2 = _level3.r; + + for (var j = 0; j < _level3.length; j++) { + var _val = _level3[j]; + var _theta = options.startAngle + (clockwise ? 1 : -1) * _dTheta * j; + + var p = { + x: center.x + _r2 * Math.cos(_theta), + y: center.y + _r2 * Math.sin(_theta) + }; + + pos[_val.node.id()] = p; + } + } + + // position the nodes + nodes.layoutPositions(this, options, function (ele) { + var id = ele.id(); + + return pos[id]; + }); + + return this; // chaining +}; + +module.exports = ConcentricLayout; + +/***/ }), +/* 100 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* +The CoSE layout was written by Gerardo Huck. +https://www.linkedin.com/in/gerardohuck/ + +Based on the following article: +http://dl.acm.org/citation.cfm?id=1498047 + +Modifications tracked on Github. +*/ + +var util = __webpack_require__(1); +var math = __webpack_require__(2); +var is = __webpack_require__(0); +var Promise = __webpack_require__(5); + +var DEBUG; + +/** + * @brief : default layout options + */ +var defaults = { + // Called on `layoutready` + ready: function ready() {}, + + // Called on `layoutstop` + stop: function stop() {}, + + // Whether to animate while running the layout + // true : Animate continuously as the layout is running + // false : Just show the end result + // 'end' : Animate with the end result, from the initial positions to the end positions + animate: true, + + // Easing of the animation for animate:'end' + animationEasing: undefined, + + // The duration of the animation for animate:'end' + animationDuration: undefined, + + // A function that determines whether the node should be animated + // All nodes animated by default on animate enabled + // Non-animated nodes are positioned immediately when the layout starts + animateFilter: function animateFilter(node, i) { + return true; + }, + + // The layout animates only after this many milliseconds for animate:true + // (prevents flashing on fast runs) + animationThreshold: 250, + + // Number of iterations between consecutive screen positions update + // (0 -> only updated on the end) + refresh: 20, + + // Whether to fit the network view after when done + fit: true, + + // Padding on fit + padding: 30, + + // Constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + boundingBox: undefined, + + // Excludes the label when calculating node bounding boxes for the layout algorithm + nodeDimensionsIncludeLabels: false, + + // Randomize the initial positions of the nodes (true) or use existing positions (false) + randomize: false, + + // Extra spacing between components in non-compound graphs + componentSpacing: 40, + + // Node repulsion (non overlapping) multiplier + nodeRepulsion: function nodeRepulsion(node) { + return 2048; + }, + + // Node repulsion (overlapping) multiplier + nodeOverlap: 4, + + // Ideal edge (non nested) length + idealEdgeLength: function idealEdgeLength(edge) { + return 32; + }, + + // Divisor to compute edge forces + edgeElasticity: function edgeElasticity(edge) { + return 32; + }, + + // Nesting factor (multiplier) to compute ideal edge length for nested edges + nestingFactor: 1.2, + + // Gravity force (constant) + gravity: 1, + + // Maximum number of iterations to perform + numIter: 1000, + + // Initial temperature (maximum node displacement) + initialTemp: 1000, + + // Cooling factor (how the temperature is reduced between consecutive iterations + coolingFactor: 0.99, + + // Lower temperature threshold (below this point the layout will end) + minTemp: 1.0, + + // Pass a reference to weaver to use threads for calculations + weaver: false +}; + +/** + * @brief : constructor + * @arg options : object containing layout options + */ +function CoseLayout(options) { + this.options = util.extend({}, defaults, options); + + this.options.layout = this; +} + +/** + * @brief : runs the layout + */ +CoseLayout.prototype.run = function () { + var options = this.options; + var cy = options.cy; + var layout = this; + var thread = this.thread; + var Thread = options.weaver ? options.weaver.Thread : null; + + var falseThread = { // use false thread as polyfill + listeners: [], + on: function on(e, cb) { + this.listeners.push({ event: e, callback: cb }); + + return this; + }, + trigger: function trigger(e) { + if (is.string(e)) { + e = { type: e }; + } + + var matchesEvent = function matchesEvent(l) { + return l.event === e.type; + }; + var trigger = function trigger(l) { + l.callback(e); + }; + + this.listeners.filter(matchesEvent).forEach(trigger); + + return this; + }, + pass: function pass(data) { + this.pass = data; + + return this; + }, + run: function run(cb) { + var pass = this.pass; + + return new Promise(function (resolve) { + resolve(cb(pass)); + }); + }, + stop: function stop() { + return this; + }, + stopped: function stopped() { + return true; + } + }; + + function broadcast(message) { + // for false thread + var e = { type: 'message', message: message }; + + falseThread.trigger(e); + } + + if (!thread || thread.stopped()) { + thread = this.thread = Thread ? new Thread() : falseThread; + } + + layout.stopped = false; + + if (options.animate === true || options.animate === false) { + layout.emit({ type: 'layoutstart', layout: layout }); + } + + // Set DEBUG - Global variable + if (true === options.debug) { + DEBUG = true; + } else { + DEBUG = false; + } + + // Initialize layout info + var layoutInfo = createLayoutInfo(cy, layout, options); + + // Show LayoutInfo contents if debugging + if (DEBUG) { + printLayoutInfo(layoutInfo); + } + + // If required, randomize node positions + if (options.randomize) { + randomizePositions(layoutInfo, cy); + } + + var startTime = Date.now(); + var refreshRequested = false; + var refresh = function refresh(rOpts) { + rOpts = rOpts || {}; + + if (refreshRequested && !rOpts.next) { + return; + } + + if (!rOpts.force && Date.now() - startTime < options.animationThreshold) { + return; + } + + refreshRequested = true; + + util.requestAnimationFrame(function () { + refreshPositions(layoutInfo, cy, options); + + // Fit the graph if necessary + if (true === options.fit) { + cy.fit(options.padding); + } + + refreshRequested = false; + + if (rOpts.next) { + rOpts.next(); + } + }); + }; + + thread.on('message', function (e) { + var layoutNodes = e.message; + + layoutInfo.layoutNodes = layoutNodes; + refresh(); + }); + + thread.pass({ + layoutInfo: layoutInfo, + options: { + animate: options.animate, + refresh: options.refresh, + componentSpacing: options.componentSpacing, + nodeOverlap: options.nodeOverlap, + nestingFactor: options.nestingFactor, + gravity: options.gravity, + numIter: options.numIter, + initialTemp: options.initialTemp, + coolingFactor: options.coolingFactor, + minTemp: options.minTemp + } + }).run(function (pass) { + var layoutInfo = pass.layoutInfo; + var options = pass.options; + var stopped = false; + + /** + * @brief : Performs one iteration of the physical simulation + * @arg layoutInfo : LayoutInfo object already initialized + * @arg cy : Cytoscape object + * @arg options : Layout options + */ + var step = function step(layoutInfo, options, _step) { + // var s = "\n\n###############################"; + // s += "\nSTEP: " + step; + // s += "\n###############################\n"; + // logDebug(s); + + // Calculate node repulsions + calculateNodeForces(layoutInfo, options); + // Calculate edge forces + calculateEdgeForces(layoutInfo, options); + // Calculate gravity forces + calculateGravityForces(layoutInfo, options); + // Propagate forces from parent to child + propagateForces(layoutInfo, options); + // Update positions based on calculated forces + updatePositions(layoutInfo, options); + }; + + /** + * @brief : Computes the node repulsion forces + */ + var calculateNodeForces = function calculateNodeForces(layoutInfo, options) { + // Go through each of the graphs in graphSet + // Nodes only repel each other if they belong to the same graph + // var s = 'calculateNodeForces'; + // logDebug(s); + for (var i = 0; i < layoutInfo.graphSet.length; i++) { + var graph = layoutInfo.graphSet[i]; + var numNodes = graph.length; + + // s = "Set: " + graph.toString(); + // logDebug(s); + + // Now get all the pairs of nodes + // Only get each pair once, (A, B) = (B, A) + for (var j = 0; j < numNodes; j++) { + var node1 = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[j]]]; + + for (var k = j + 1; k < numNodes; k++) { + var node2 = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[k]]]; + + nodeRepulsion(node1, node2, layoutInfo, options); + } + } + } + }; + + var randomDistance = function randomDistance(max) { + return -max + 2 * max * Math.random(); + }; + + /** + * @brief : Compute the node repulsion forces between a pair of nodes + */ + var nodeRepulsion = function nodeRepulsion(node1, node2, layoutInfo, options) { + // var s = "Node repulsion. Node1: " + node1.id + " Node2: " + node2.id; + + var cmptId1 = node1.cmptId; + var cmptId2 = node2.cmptId; + + if (cmptId1 !== cmptId2 && !layoutInfo.isCompound) { + return; + } + + // Get direction of line connecting both node centers + var directionX = node2.positionX - node1.positionX; + var directionY = node2.positionY - node1.positionY; + var maxRandDist = 1; + // s += "\ndirectionX: " + directionX + ", directionY: " + directionY; + + // If both centers are the same, apply a random force + if (0 === directionX && 0 === directionY) { + directionX = randomDistance(maxRandDist); + directionY = randomDistance(maxRandDist); + } + + var overlap = nodesOverlap(node1, node2, directionX, directionY); + + if (overlap > 0) { + // s += "\nNodes DO overlap."; + // s += "\nOverlap: " + overlap; + // If nodes overlap, repulsion force is proportional + // to the overlap + var force = options.nodeOverlap * overlap; + + // Compute the module and components of the force vector + var distance = Math.sqrt(directionX * directionX + directionY * directionY); + // s += "\nDistance: " + distance; + var forceX = force * directionX / distance; + var forceY = force * directionY / distance; + } else { + // s += "\nNodes do NOT overlap."; + // If there's no overlap, force is inversely proportional + // to squared distance + + // Get clipping points for both nodes + var point1 = findClippingPoint(node1, directionX, directionY); + var point2 = findClippingPoint(node2, -1 * directionX, -1 * directionY); + + // Use clipping points to compute distance + var distanceX = point2.x - point1.x; + var distanceY = point2.y - point1.y; + var distanceSqr = distanceX * distanceX + distanceY * distanceY; + var distance = Math.sqrt(distanceSqr); + // s += "\nDistance: " + distance; + + // Compute the module and components of the force vector + var force = (node1.nodeRepulsion + node2.nodeRepulsion) / distanceSqr; + var forceX = force * distanceX / distance; + var forceY = force * distanceY / distance; + } + + // Apply force + if (!node1.isLocked) { + node1.offsetX -= forceX; + node1.offsetY -= forceY; + } + + if (!node2.isLocked) { + node2.offsetX += forceX; + node2.offsetY += forceY; + } + + // s += "\nForceX: " + forceX + " ForceY: " + forceY; + // logDebug(s); + + return; + }; + + /** + * @brief : Determines whether two nodes overlap or not + * @return : Amount of overlapping (0 => no overlap) + */ + var nodesOverlap = function nodesOverlap(node1, node2, dX, dY) { + + if (dX > 0) { + var overlapX = node1.maxX - node2.minX; + } else { + var overlapX = node2.maxX - node1.minX; + } + + if (dY > 0) { + var overlapY = node1.maxY - node2.minY; + } else { + var overlapY = node2.maxY - node1.minY; + } + + if (overlapX >= 0 && overlapY >= 0) { + return Math.sqrt(overlapX * overlapX + overlapY * overlapY); + } else { + return 0; + } + }; + + /** + * @brief : Finds the point in which an edge (direction dX, dY) intersects + * the rectangular bounding box of it's source/target node + */ + var findClippingPoint = function findClippingPoint(node, dX, dY) { + + // Shorcuts + var X = node.positionX; + var Y = node.positionY; + var H = node.height || 1; + var W = node.width || 1; + var dirSlope = dY / dX; + var nodeSlope = H / W; + + // var s = 'Computing clipping point of node ' + node.id + + // " . Height: " + H + ", Width: " + W + + // "\nDirection " + dX + ", " + dY; + // + // Compute intersection + var res = {}; + + // Case: Vertical direction (up) + if (0 === dX && 0 < dY) { + res.x = X; + // s += "\nUp direction"; + res.y = Y + H / 2; + + return res; + } + + // Case: Vertical direction (down) + if (0 === dX && 0 > dY) { + res.x = X; + res.y = Y + H / 2; + // s += "\nDown direction"; + + return res; + } + + // Case: Intersects the right border + if (0 < dX && -1 * nodeSlope <= dirSlope && dirSlope <= nodeSlope) { + res.x = X + W / 2; + res.y = Y + W * dY / 2 / dX; + // s += "\nRightborder"; + + return res; + } + + // Case: Intersects the left border + if (0 > dX && -1 * nodeSlope <= dirSlope && dirSlope <= nodeSlope) { + res.x = X - W / 2; + res.y = Y - W * dY / 2 / dX; + // s += "\nLeftborder"; + + return res; + } + + // Case: Intersects the top border + if (0 < dY && (dirSlope <= -1 * nodeSlope || dirSlope >= nodeSlope)) { + res.x = X + H * dX / 2 / dY; + res.y = Y + H / 2; + // s += "\nTop border"; + + return res; + } + + // Case: Intersects the bottom border + if (0 > dY && (dirSlope <= -1 * nodeSlope || dirSlope >= nodeSlope)) { + res.x = X - H * dX / 2 / dY; + res.y = Y - H / 2; + // s += "\nBottom border"; + + return res; + } + + // s += "\nClipping point found at " + res.x + ", " + res.y; + // logDebug(s); + return res; + }; + + /** + * @brief : Calculates all edge forces + */ + var calculateEdgeForces = function calculateEdgeForces(layoutInfo, options) { + // Iterate over all edges + for (var i = 0; i < layoutInfo.edgeSize; i++) { + // Get edge, source & target nodes + var edge = layoutInfo.layoutEdges[i]; + var sourceIx = layoutInfo.idToIndex[edge.sourceId]; + var source = layoutInfo.layoutNodes[sourceIx]; + var targetIx = layoutInfo.idToIndex[edge.targetId]; + var target = layoutInfo.layoutNodes[targetIx]; + + // Get direction of line connecting both node centers + var directionX = target.positionX - source.positionX; + var directionY = target.positionY - source.positionY; + + // If both centers are the same, do nothing. + // A random force has already been applied as node repulsion + if (0 === directionX && 0 === directionY) { + continue; + } + + // Get clipping points for both nodes + var point1 = findClippingPoint(source, directionX, directionY); + var point2 = findClippingPoint(target, -1 * directionX, -1 * directionY); + + var lx = point2.x - point1.x; + var ly = point2.y - point1.y; + var l = Math.sqrt(lx * lx + ly * ly); + + var force = Math.pow(edge.idealLength - l, 2) / edge.elasticity; + + if (0 !== l) { + var forceX = force * lx / l; + var forceY = force * ly / l; + } else { + var forceX = 0; + var forceY = 0; + } + + // Add this force to target and source nodes + if (!source.isLocked) { + source.offsetX += forceX; + source.offsetY += forceY; + } + + if (!target.isLocked) { + target.offsetX -= forceX; + target.offsetY -= forceY; + } + + // var s = 'Edge force between nodes ' + source.id + ' and ' + target.id; + // s += "\nDistance: " + l + " Force: (" + forceX + ", " + forceY + ")"; + // logDebug(s); + } + }; + + /** + * @brief : Computes gravity forces for all nodes + */ + var calculateGravityForces = function calculateGravityForces(layoutInfo, options) { + var distThreshold = 1; + + // var s = 'calculateGravityForces'; + // logDebug(s); + for (var i = 0; i < layoutInfo.graphSet.length; i++) { + var graph = layoutInfo.graphSet[i]; + var numNodes = graph.length; + + // s = "Set: " + graph.toString(); + // logDebug(s); + + // Compute graph center + if (0 === i) { + var centerX = layoutInfo.clientHeight / 2; + var centerY = layoutInfo.clientWidth / 2; + } else { + // Get Parent node for this graph, and use its position as center + var temp = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[0]]]; + var parent = layoutInfo.layoutNodes[layoutInfo.idToIndex[temp.parentId]]; + var centerX = parent.positionX; + var centerY = parent.positionY; + } + // s = "Center found at: " + centerX + ", " + centerY; + // logDebug(s); + + // Apply force to all nodes in graph + for (var j = 0; j < numNodes; j++) { + var node = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[j]]]; + // s = "Node: " + node.id; + + if (node.isLocked) { + continue; + } + + var dx = centerX - node.positionX; + var dy = centerY - node.positionY; + var d = Math.sqrt(dx * dx + dy * dy); + if (d > distThreshold) { + var fx = options.gravity * dx / d; + var fy = options.gravity * dy / d; + node.offsetX += fx; + node.offsetY += fy; + // s += ": Applied force: " + fx + ", " + fy; + } else {} + // s += ": skypped since it's too close to center"; + + // logDebug(s); + } + } + }; + + /** + * @brief : This function propagates the existing offsets from + * parent nodes to its descendents. + * @arg layoutInfo : layoutInfo Object + * @arg cy : cytoscape Object + * @arg options : Layout options + */ + var propagateForces = function propagateForces(layoutInfo, options) { + // Inline implementation of a queue, used for traversing the graph in BFS order + var queue = []; + var start = 0; // Points to the start the queue + var end = -1; // Points to the end of the queue + + // logDebug('propagateForces'); + + // Start by visiting the nodes in the root graph + queue.push.apply(queue, layoutInfo.graphSet[0]); + end += layoutInfo.graphSet[0].length; + + // Traverse the graph, level by level, + while (start <= end) { + // Get the node to visit and remove it from queue + var nodeId = queue[start++]; + var nodeIndex = layoutInfo.idToIndex[nodeId]; + var node = layoutInfo.layoutNodes[nodeIndex]; + var children = node.children; + + // We only need to process the node if it's compound + if (0 < children.length && !node.isLocked) { + var offX = node.offsetX; + var offY = node.offsetY; + + // var s = "Propagating offset from parent node : " + node.id + + // ". OffsetX: " + offX + ". OffsetY: " + offY; + // s += "\n Children: " + children.toString(); + // logDebug(s); + + for (var i = 0; i < children.length; i++) { + var childNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[children[i]]]; + // Propagate offset + childNode.offsetX += offX; + childNode.offsetY += offY; + // Add children to queue to be visited + queue[++end] = children[i]; + } + + // Reset parent offsets + node.offsetX = 0; + node.offsetY = 0; + } + } + }; + + /** + * @brief : Updates the layout model positions, based on + * the accumulated forces + */ + var updatePositions = function updatePositions(layoutInfo, options) { + // var s = 'Updating positions'; + // logDebug(s); + + // Reset boundaries for compound nodes + for (var i = 0; i < layoutInfo.nodeSize; i++) { + var n = layoutInfo.layoutNodes[i]; + if (0 < n.children.length) { + // logDebug("Resetting boundaries of compound node: " + n.id); + n.maxX = undefined; + n.minX = undefined; + n.maxY = undefined; + n.minY = undefined; + } + } + + for (var i = 0; i < layoutInfo.nodeSize; i++) { + var n = layoutInfo.layoutNodes[i]; + if (0 < n.children.length || n.isLocked) { + // No need to set compound or locked node position + // logDebug("Skipping position update of node: " + n.id); + continue; + } + // s = "Node: " + n.id + " Previous position: (" + + // n.positionX + ", " + n.positionY + ")."; + + // Limit displacement in order to improve stability + var tempForce = limitForce(n.offsetX, n.offsetY, layoutInfo.temperature); + n.positionX += tempForce.x; + n.positionY += tempForce.y; + n.offsetX = 0; + n.offsetY = 0; + n.minX = n.positionX - n.width; + n.maxX = n.positionX + n.width; + n.minY = n.positionY - n.height; + n.maxY = n.positionY + n.height; + // s += " New Position: (" + n.positionX + ", " + n.positionY + ")."; + // logDebug(s); + + // Update ancestry boudaries + updateAncestryBoundaries(n, layoutInfo); + } + + // Update size, position of compund nodes + for (var i = 0; i < layoutInfo.nodeSize; i++) { + var n = layoutInfo.layoutNodes[i]; + if (0 < n.children.length && !n.isLocked) { + n.positionX = (n.maxX + n.minX) / 2; + n.positionY = (n.maxY + n.minY) / 2; + n.width = n.maxX - n.minX; + n.height = n.maxY - n.minY; + // s = "Updating position, size of compound node " + n.id; + // s += "\nPositionX: " + n.positionX + ", PositionY: " + n.positionY; + // s += "\nWidth: " + n.width + ", Height: " + n.height; + // logDebug(s); + } + } + }; + + /** + * @brief : Limits a force (forceX, forceY) to be not + * greater (in modulo) than max. + 8 Preserves force direction. + */ + var limitForce = function limitForce(forceX, forceY, max) { + // var s = "Limiting force: (" + forceX + ", " + forceY + "). Max: " + max; + var force = Math.sqrt(forceX * forceX + forceY * forceY); + + if (force > max) { + var res = { + x: max * forceX / force, + y: max * forceY / force + }; + } else { + var res = { + x: forceX, + y: forceY + }; + } + + // s += ".\nResult: (" + res.x + ", " + res.y + ")"; + // logDebug(s); + + return res; + }; + + /** + * @brief : Function used for keeping track of compound node + * sizes, since they should bound all their subnodes. + */ + var updateAncestryBoundaries = function updateAncestryBoundaries(node, layoutInfo) { + // var s = "Propagating new position/size of node " + node.id; + var parentId = node.parentId; + if (null == parentId) { + // If there's no parent, we are done + // s += ". No parent node."; + // logDebug(s); + return; + } + + // Get Parent Node + var p = layoutInfo.layoutNodes[layoutInfo.idToIndex[parentId]]; + var flag = false; + + // MaxX + if (null == p.maxX || node.maxX + p.padRight > p.maxX) { + p.maxX = node.maxX + p.padRight; + flag = true; + // s += "\nNew maxX for parent node " + p.id + ": " + p.maxX; + } + + // MinX + if (null == p.minX || node.minX - p.padLeft < p.minX) { + p.minX = node.minX - p.padLeft; + flag = true; + // s += "\nNew minX for parent node " + p.id + ": " + p.minX; + } + + // MaxY + if (null == p.maxY || node.maxY + p.padBottom > p.maxY) { + p.maxY = node.maxY + p.padBottom; + flag = true; + // s += "\nNew maxY for parent node " + p.id + ": " + p.maxY; + } + + // MinY + if (null == p.minY || node.minY - p.padTop < p.minY) { + p.minY = node.minY - p.padTop; + flag = true; + // s += "\nNew minY for parent node " + p.id + ": " + p.minY; + } + + // If updated boundaries, propagate changes upward + if (flag) { + // logDebug(s); + return updateAncestryBoundaries(p, layoutInfo); + } + + // s += ". No changes in boundaries/position of parent node " + p.id; + // logDebug(s); + return; + }; + + var separateComponents = function separateComponents(layutInfo, options) { + var nodes = layoutInfo.layoutNodes; + var components = []; + + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + var cid = node.cmptId; + var component = components[cid] = components[cid] || []; + + component.push(node); + } + + var totalA = 0; + + for (var i = 0; i < components.length; i++) { + var c = components[i]; + + if (!c) { + continue; + } + + c.x1 = Infinity; + c.x2 = -Infinity; + c.y1 = Infinity; + c.y2 = -Infinity; + + for (var j = 0; j < c.length; j++) { + var n = c[j]; + + c.x1 = Math.min(c.x1, n.positionX - n.width / 2); + c.x2 = Math.max(c.x2, n.positionX + n.width / 2); + c.y1 = Math.min(c.y1, n.positionY - n.height / 2); + c.y2 = Math.max(c.y2, n.positionY + n.height / 2); + } + + c.w = c.x2 - c.x1; + c.h = c.y2 - c.y1; + + totalA += c.w * c.h; + } + + components.sort(function (c1, c2) { + return c2.w * c2.h - c1.w * c1.h; + }); + + var x = 0; + var y = 0; + var usedW = 0; + var rowH = 0; + var maxRowW = Math.sqrt(totalA) * layoutInfo.clientWidth / layoutInfo.clientHeight; + + for (var i = 0; i < components.length; i++) { + var c = components[i]; + + if (!c) { + continue; + } + + for (var j = 0; j < c.length; j++) { + var n = c[j]; + + if (!n.isLocked) { + n.positionX += x; + n.positionY += y; + } + } + + x += c.w + options.componentSpacing; + usedW += c.w + options.componentSpacing; + rowH = Math.max(rowH, c.h); + + if (usedW > maxRowW) { + y += rowH + options.componentSpacing; + x = 0; + usedW = 0; + rowH = 0; + } + } + }; + + var mainLoop = function mainLoop(i) { + if (stopped) { + // logDebug("Layout manually stopped. Stopping computation in step " + i); + return false; + } + + // Do one step in the phisical simulation + step(layoutInfo, options, i); + + // Update temperature + layoutInfo.temperature = layoutInfo.temperature * options.coolingFactor; + // logDebug("New temperature: " + layoutInfo.temperature); + + if (layoutInfo.temperature < options.minTemp) { + // logDebug("Temperature drop below minimum threshold. Stopping computation in step " + i); + return false; + } + + return true; + }; + + var i = 0; + var loopRet; + + do { + var f = 0; + + while (f < options.refresh && i < options.numIter) { + var loopRet = mainLoop(i); + if (!loopRet) { + break; + } + + f++; + i++; + } + + if (options.animate === true) { + broadcast(layoutInfo.layoutNodes); // eslint-disable-line no-undef + } + } while (loopRet && i + 1 < options.numIter); + + separateComponents(layoutInfo, options); + + return layoutInfo; + }).then(function (layoutInfoUpdated) { + layoutInfo.layoutNodes = layoutInfoUpdated.layoutNodes; // get the positions + + thread.stop(); + done(); + }); + + var done = function done() { + if (options.animate === true || options.animate === false) { + refresh({ + force: true, + next: function next() { + // Layout has finished + layout.one('layoutstop', options.stop); + layout.emit({ type: 'layoutstop', layout: layout }); + } + }); + } else { + options.eles.nodes().layoutPositions(layout, options, function (node) { + var lnode = layoutInfo.layoutNodes[layoutInfo.idToIndex[node.data('id')]]; + + return { x: lnode.positionX, y: lnode.positionY }; + }); + } + }; + + return this; // chaining +}; + +/** + * @brief : called on continuous layouts to stop them before they finish + */ +CoseLayout.prototype.stop = function () { + this.stopped = true; + + if (this.thread) { + this.thread.stop(); + } + + this.emit('layoutstop'); + + return this; // chaining +}; + +CoseLayout.prototype.destroy = function () { + if (this.thread) { + this.thread.stop(); + } + + return this; // chaining +}; + +/** + * @brief : Creates an object which is contains all the data + * used in the layout process + * @arg cy : cytoscape.js object + * @return : layoutInfo object initialized + */ +var createLayoutInfo = function createLayoutInfo(cy, layout, options) { + // Shortcut + var edges = options.eles.edges(); + var nodes = options.eles.nodes(); + + var layoutInfo = { + isCompound: cy.hasCompoundNodes(), + layoutNodes: [], + idToIndex: {}, + nodeSize: nodes.size(), + graphSet: [], + indexToGraph: [], + layoutEdges: [], + edgeSize: edges.size(), + temperature: options.initialTemp, + clientWidth: cy.width(), + clientHeight: cy.width(), + boundingBox: math.makeBoundingBox(options.boundingBox ? options.boundingBox : { + x1: 0, y1: 0, w: cy.width(), h: cy.height() + }) + }; + + var components = options.eles.components(); + var id2cmptId = {}; + + for (var i = 0; i < components.length; i++) { + var component = components[i]; + + for (var j = 0; j < component.length; j++) { + var node = component[j]; + + id2cmptId[node.id()] = i; + } + } + + // Iterate over all nodes, creating layout nodes + for (var i = 0; i < layoutInfo.nodeSize; i++) { + var n = nodes[i]; + var nbb = n.layoutDimensions(options); + + var tempNode = {}; + tempNode.isLocked = n.locked(); + tempNode.id = n.data('id'); + tempNode.parentId = n.data('parent'); + tempNode.cmptId = id2cmptId[n.id()]; + tempNode.children = []; + tempNode.positionX = n.position('x'); + tempNode.positionY = n.position('y'); + tempNode.offsetX = 0; + tempNode.offsetY = 0; + tempNode.height = nbb.w; + tempNode.width = nbb.h; + tempNode.maxX = tempNode.positionX + tempNode.width / 2; + tempNode.minX = tempNode.positionX - tempNode.width / 2; + tempNode.maxY = tempNode.positionY + tempNode.height / 2; + tempNode.minY = tempNode.positionY - tempNode.height / 2; + tempNode.padLeft = parseFloat(n.style('padding')); + tempNode.padRight = parseFloat(n.style('padding')); + tempNode.padTop = parseFloat(n.style('padding')); + tempNode.padBottom = parseFloat(n.style('padding')); + + // forces + tempNode.nodeRepulsion = is.fn(options.nodeRepulsion) ? options.nodeRepulsion(n) : options.nodeRepulsion; + + // Add new node + layoutInfo.layoutNodes.push(tempNode); + // Add entry to id-index map + layoutInfo.idToIndex[tempNode.id] = i; + } + + // Inline implementation of a queue, used for traversing the graph in BFS order + var queue = []; + var start = 0; // Points to the start the queue + var end = -1; // Points to the end of the queue + + var tempGraph = []; + + // Second pass to add child information and + // initialize queue for hierarchical traversal + for (var i = 0; i < layoutInfo.nodeSize; i++) { + var n = layoutInfo.layoutNodes[i]; + var p_id = n.parentId; + // Check if node n has a parent node + if (null != p_id) { + // Add node Id to parent's list of children + layoutInfo.layoutNodes[layoutInfo.idToIndex[p_id]].children.push(n.id); + } else { + // If a node doesn't have a parent, then it's in the root graph + queue[++end] = n.id; + tempGraph.push(n.id); + } + } + + // Add root graph to graphSet + layoutInfo.graphSet.push(tempGraph); + + // Traverse the graph, level by level, + while (start <= end) { + // Get the node to visit and remove it from queue + var node_id = queue[start++]; + var node_ix = layoutInfo.idToIndex[node_id]; + var node = layoutInfo.layoutNodes[node_ix]; + var children = node.children; + if (children.length > 0) { + // Add children nodes as a new graph to graph set + layoutInfo.graphSet.push(children); + // Add children to que queue to be visited + for (var i = 0; i < children.length; i++) { + queue[++end] = children[i]; + } + } + } + + // Create indexToGraph map + for (var i = 0; i < layoutInfo.graphSet.length; i++) { + var graph = layoutInfo.graphSet[i]; + for (var j = 0; j < graph.length; j++) { + var index = layoutInfo.idToIndex[graph[j]]; + layoutInfo.indexToGraph[index] = i; + } + } + + // Iterate over all edges, creating Layout Edges + for (var i = 0; i < layoutInfo.edgeSize; i++) { + var e = edges[i]; + var tempEdge = {}; + tempEdge.id = e.data('id'); + tempEdge.sourceId = e.data('source'); + tempEdge.targetId = e.data('target'); + + // Compute ideal length + var idealLength = is.fn(options.idealEdgeLength) ? options.idealEdgeLength(e) : options.idealEdgeLength; + var elasticity = is.fn(options.edgeElasticity) ? options.edgeElasticity(e) : options.edgeElasticity; + + // Check if it's an inter graph edge + var sourceIx = layoutInfo.idToIndex[tempEdge.sourceId]; + var targetIx = layoutInfo.idToIndex[tempEdge.targetId]; + var sourceGraph = layoutInfo.indexToGraph[sourceIx]; + var targetGraph = layoutInfo.indexToGraph[targetIx]; + + if (sourceGraph != targetGraph) { + // Find lowest common graph ancestor + var lca = findLCA(tempEdge.sourceId, tempEdge.targetId, layoutInfo); + + // Compute sum of node depths, relative to lca graph + var lcaGraph = layoutInfo.graphSet[lca]; + var depth = 0; + + // Source depth + var tempNode = layoutInfo.layoutNodes[sourceIx]; + while (-1 === lcaGraph.indexOf(tempNode.id)) { + tempNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[tempNode.parentId]]; + depth++; + } + + // Target depth + tempNode = layoutInfo.layoutNodes[targetIx]; + while (-1 === lcaGraph.indexOf(tempNode.id)) { + tempNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[tempNode.parentId]]; + depth++; + } + + // logDebug('LCA of nodes ' + tempEdge.sourceId + ' and ' + tempEdge.targetId + + // ". Index: " + lca + " Contents: " + lcaGraph.toString() + + // ". Depth: " + depth); + + // Update idealLength + idealLength *= depth * options.nestingFactor; + } + + tempEdge.idealLength = idealLength; + tempEdge.elasticity = elasticity; + + layoutInfo.layoutEdges.push(tempEdge); + } + + // Finally, return layoutInfo object + return layoutInfo; +}; + +/** + * @brief : This function finds the index of the lowest common + * graph ancestor between 2 nodes in the subtree + * (from the graph hierarchy induced tree) whose + * root is graphIx + * + * @arg node1: node1's ID + * @arg node2: node2's ID + * @arg layoutInfo: layoutInfo object + * + */ +var findLCA = function findLCA(node1, node2, layoutInfo) { + // Find their common ancester, starting from the root graph + var res = findLCA_aux(node1, node2, 0, layoutInfo); + if (2 > res.count) { + // If aux function couldn't find the common ancester, + // then it is the root graph + return 0; + } else { + return res.graph; + } +}; + +/** + * @brief : Auxiliary function used for LCA computation + * + * @arg node1 : node1's ID + * @arg node2 : node2's ID + * @arg graphIx : subgraph index + * @arg layoutInfo : layoutInfo object + * + * @return : object of the form {count: X, graph: Y}, where: + * X is the number of ancesters (max: 2) found in + * graphIx (and it's subgraphs), + * Y is the graph index of the lowest graph containing + * all X nodes + */ +var findLCA_aux = function findLCA_aux(node1, node2, graphIx, layoutInfo) { + var graph = layoutInfo.graphSet[graphIx]; + // If both nodes belongs to graphIx + if (-1 < graph.indexOf(node1) && -1 < graph.indexOf(node2)) { + return { count: 2, graph: graphIx }; + } + + // Make recursive calls for all subgraphs + var c = 0; + for (var i = 0; i < graph.length; i++) { + var nodeId = graph[i]; + var nodeIx = layoutInfo.idToIndex[nodeId]; + var children = layoutInfo.layoutNodes[nodeIx].children; + + // If the node has no child, skip it + if (0 === children.length) { + continue; + } + + var childGraphIx = layoutInfo.indexToGraph[layoutInfo.idToIndex[children[0]]]; + var result = findLCA_aux(node1, node2, childGraphIx, layoutInfo); + if (0 === result.count) { + // Neither node1 nor node2 are present in this subgraph + continue; + } else if (1 === result.count) { + // One of (node1, node2) is present in this subgraph + c++; + if (2 === c) { + // We've already found both nodes, no need to keep searching + break; + } + } else { + // Both nodes are present in this subgraph + return result; + } + } + + return { count: c, graph: graphIx }; +}; + +/** + * @brief: printsLayoutInfo into js console + * Only used for debbuging + */ +var printLayoutInfo = function printLayoutInfo(layoutInfo) { + /* eslint-disable */ + + if (!DEBUG) { + return; + } + console.debug('layoutNodes:'); + for (var i = 0; i < layoutInfo.nodeSize; i++) { + var n = layoutInfo.layoutNodes[i]; + var s = '\nindex: ' + i + '\nId: ' + n.id + '\nChildren: ' + n.children.toString() + '\nparentId: ' + n.parentId + '\npositionX: ' + n.positionX + '\npositionY: ' + n.positionY + '\nOffsetX: ' + n.offsetX + '\nOffsetY: ' + n.offsetY + '\npadLeft: ' + n.padLeft + '\npadRight: ' + n.padRight + '\npadTop: ' + n.padTop + '\npadBottom: ' + n.padBottom; + + console.debug(s); + } + + console.debug('idToIndex'); + for (var i in layoutInfo.idToIndex) { + console.debug('Id: ' + i + '\nIndex: ' + layoutInfo.idToIndex[i]); + } + + console.debug('Graph Set'); + var set = layoutInfo.graphSet; + for (var i = 0; i < set.length; i++) { + console.debug('Set : ' + i + ': ' + set[i].toString()); + } + + var s = 'IndexToGraph'; + for (var i = 0; i < layoutInfo.indexToGraph.length; i++) { + s += '\nIndex : ' + i + ' Graph: ' + layoutInfo.indexToGraph[i]; + } + console.debug(s); + + s = 'Layout Edges'; + for (var i = 0; i < layoutInfo.layoutEdges.length; i++) { + var e = layoutInfo.layoutEdges[i]; + s += '\nEdge Index: ' + i + ' ID: ' + e.id + ' SouceID: ' + e.sourceId + ' TargetId: ' + e.targetId + ' Ideal Length: ' + e.idealLength; + } + console.debug(s); + + s = 'nodeSize: ' + layoutInfo.nodeSize; + s += '\nedgeSize: ' + layoutInfo.edgeSize; + s += '\ntemperature: ' + layoutInfo.temperature; + console.debug(s); + + return; + /* eslint-enable */ +}; + +/** + * @brief : Randomizes the position of all nodes + */ +var randomizePositions = function randomizePositions(layoutInfo, cy) { + var width = layoutInfo.clientWidth; + var height = layoutInfo.clientHeight; + + for (var i = 0; i < layoutInfo.nodeSize; i++) { + var n = layoutInfo.layoutNodes[i]; + + // No need to randomize compound nodes or locked nodes + if (0 === n.children.length && !n.isLocked) { + n.positionX = Math.random() * width; + n.positionY = Math.random() * height; + } + } +}; + +/** + * @brief : Updates the positions of nodes in the network + * @arg layoutInfo : LayoutInfo object + * @arg cy : Cytoscape object + * @arg options : Layout options + */ +var refreshPositions = function refreshPositions(layoutInfo, cy, options) { + // var s = 'Refreshing positions'; + // logDebug(s); + + var layout = options.layout; + var nodes = options.eles.nodes(); + var bb = layoutInfo.boundingBox; + var coseBB = { x1: Infinity, x2: -Infinity, y1: Infinity, y2: -Infinity }; + + if (options.boundingBox) { + nodes.forEach(function (node) { + var lnode = layoutInfo.layoutNodes[layoutInfo.idToIndex[node.data('id')]]; + + coseBB.x1 = Math.min(coseBB.x1, lnode.positionX); + coseBB.x2 = Math.max(coseBB.x2, lnode.positionX); + + coseBB.y1 = Math.min(coseBB.y1, lnode.positionY); + coseBB.y2 = Math.max(coseBB.y2, lnode.positionY); + }); + + coseBB.w = coseBB.x2 - coseBB.x1; + coseBB.h = coseBB.y2 - coseBB.y1; + } + + nodes.positions(function (ele, i) { + var lnode = layoutInfo.layoutNodes[layoutInfo.idToIndex[ele.data('id')]]; + // s = "Node: " + lnode.id + ". Refreshed position: (" + + // lnode.positionX + ", " + lnode.positionY + ")."; + // logDebug(s); + + if (options.boundingBox) { + // then add extra bounding box constraint + var pctX = (lnode.positionX - coseBB.x1) / coseBB.w; + var pctY = (lnode.positionY - coseBB.y1) / coseBB.h; + + return { + x: bb.x1 + pctX * bb.w, + y: bb.y1 + pctY * bb.h + }; + } else { + return { + x: lnode.positionX, + y: lnode.positionY + }; + } + }); + + // Trigger layoutReady only on first call + if (true !== layoutInfo.ready) { + // s = 'Triggering layoutready'; + // logDebug(s); + layoutInfo.ready = true; + layout.one('layoutready', options.ready); + layout.emit({ type: 'layoutready', layout: this }); + } +}; + +/** + * @brief : Logs a debug message in JS console, if DEBUG is ON + */ +// var logDebug = function(text) { +// if (DEBUG) { +// console.debug(text); +// } +// }; + +module.exports = CoseLayout; + +/***/ }), +/* 101 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var math = __webpack_require__(2); + +var defaults = { + fit: true, // whether to fit the viewport to the graph + padding: 30, // padding used on fit + boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space + avoidOverlapPadding: 10, // extra spacing around nodes when avoidOverlap: true + nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm + spacingFactor: undefined, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up + condense: false, // uses all available space on false, uses minimal space on true + rows: undefined, // force num of rows in the grid + cols: undefined, // force num of columns in the grid + position: function position(node) {}, // returns { row, col } for element + sort: undefined, // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } + animate: false, // whether to transition the node positions + animationDuration: 500, // duration of animation in ms if enabled + animationEasing: undefined, // easing of animation if enabled + animateFilter: function animateFilter(node, i) { + return true; + }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts + ready: undefined, // callback on layoutready + stop: undefined, // callback on layoutstop + transform: function transform(node, position) { + return position; + } // transform a given node position. Useful for changing flow direction in discrete layouts +}; + +function GridLayout(options) { + this.options = util.extend({}, defaults, options); +} + +GridLayout.prototype.run = function () { + var params = this.options; + var options = params; + + var cy = params.cy; + var eles = options.eles; + var nodes = eles.nodes().not(':parent'); + + if (options.sort) { + nodes = nodes.sort(options.sort); + } + + var bb = math.makeBoundingBox(options.boundingBox ? options.boundingBox : { + x1: 0, y1: 0, w: cy.width(), h: cy.height() + }); + + if (bb.h === 0 || bb.w === 0) { + nodes.layoutPositions(this, options, function (ele) { + return { x: bb.x1, y: bb.y1 }; + }); + } else { + + // width/height * splits^2 = cells where splits is number of times to split width + var cells = nodes.size(); + var splits = Math.sqrt(cells * bb.h / bb.w); + var rows = Math.round(splits); + var cols = Math.round(bb.w / bb.h * splits); + + var small = function small(val) { + if (val == null) { + return Math.min(rows, cols); + } else { + var min = Math.min(rows, cols); + if (min == rows) { + rows = val; + } else { + cols = val; + } + } + }; + + var large = function large(val) { + if (val == null) { + return Math.max(rows, cols); + } else { + var max = Math.max(rows, cols); + if (max == rows) { + rows = val; + } else { + cols = val; + } + } + }; + + var oRows = options.rows; + var oCols = options.cols != null ? options.cols : options.columns; + + // if rows or columns were set in options, use those values + if (oRows != null && oCols != null) { + rows = oRows; + cols = oCols; + } else if (oRows != null && oCols == null) { + rows = oRows; + cols = Math.ceil(cells / rows); + } else if (oRows == null && oCols != null) { + cols = oCols; + rows = Math.ceil(cells / cols); + } + + // otherwise use the automatic values and adjust accordingly + + // if rounding was up, see if we can reduce rows or columns + else if (cols * rows > cells) { + var sm = small(); + var lg = large(); + + // reducing the small side takes away the most cells, so try it first + if ((sm - 1) * lg >= cells) { + small(sm - 1); + } else if ((lg - 1) * sm >= cells) { + large(lg - 1); + } + } else { + + // if rounding was too low, add rows or columns + while (cols * rows < cells) { + var _sm = small(); + var _lg = large(); + + // try to add to larger side first (adds less in multiplication) + if ((_lg + 1) * _sm >= cells) { + large(_lg + 1); + } else { + small(_sm + 1); + } + } + } + + var cellWidth = bb.w / cols; + var cellHeight = bb.h / rows; + + if (options.condense) { + cellWidth = 0; + cellHeight = 0; + } + + if (options.avoidOverlap) { + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + var pos = node._private.position; + + if (pos.x == null || pos.y == null) { + // for bb + pos.x = 0; + pos.y = 0; + } + + var nbb = node.layoutDimensions(options); + var p = options.avoidOverlapPadding; + + var w = nbb.w + p; + var h = nbb.h + p; + + cellWidth = Math.max(cellWidth, w); + cellHeight = Math.max(cellHeight, h); + } + } + + var cellUsed = {}; // e.g. 'c-0-2' => true + + var used = function used(row, col) { + return cellUsed['c-' + row + '-' + col] ? true : false; + }; + + var use = function use(row, col) { + cellUsed['c-' + row + '-' + col] = true; + }; + + // to keep track of current cell position + var row = 0; + var col = 0; + var moveToNextCell = function moveToNextCell() { + col++; + if (col >= cols) { + col = 0; + row++; + } + }; + + // get a cache of all the manual positions + var id2manPos = {}; + for (var _i = 0; _i < nodes.length; _i++) { + var _node = nodes[_i]; + var rcPos = options.position(_node); + + if (rcPos && (rcPos.row !== undefined || rcPos.col !== undefined)) { + // must have at least row or col def'd + var _pos = { + row: rcPos.row, + col: rcPos.col + }; + + if (_pos.col === undefined) { + // find unused col + _pos.col = 0; + + while (used(_pos.row, _pos.col)) { + _pos.col++; + } + } else if (_pos.row === undefined) { + // find unused row + _pos.row = 0; + + while (used(_pos.row, _pos.col)) { + _pos.row++; + } + } + + id2manPos[_node.id()] = _pos; + use(_pos.row, _pos.col); + } + } + + var getPos = function getPos(element, i) { + var x = void 0, + y = void 0; + + if (element.locked() || element.isParent()) { + return false; + } + + // see if we have a manual position set + var rcPos = id2manPos[element.id()]; + if (rcPos) { + x = rcPos.col * cellWidth + cellWidth / 2 + bb.x1; + y = rcPos.row * cellHeight + cellHeight / 2 + bb.y1; + } else { + // otherwise set automatically + + while (used(row, col)) { + moveToNextCell(); + } + + x = col * cellWidth + cellWidth / 2 + bb.x1; + y = row * cellHeight + cellHeight / 2 + bb.y1; + use(row, col); + + moveToNextCell(); + } + + return { x: x, y: y }; + }; + + nodes.layoutPositions(this, options, getPos); + } + + return this; // chaining +}; + +module.exports = GridLayout; + +/***/ }), +/* 102 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); + +// default layout options +var defaults = { + ready: function ready() {}, // on layoutready + stop: function stop() {} // on layoutstop +}; + +// constructor +// options : object containing layout options +function NullLayout(options) { + this.options = util.extend({}, defaults, options); +} + +// runs the layout +NullLayout.prototype.run = function () { + var options = this.options; + var eles = options.eles; // elements to consider in the layout + var layout = this; + + // cy is automatically populated for us in the constructor + var cy = options.cy; // jshint ignore:line + + layout.emit('layoutstart'); + + // puts all nodes at (0, 0) + eles.nodes().positions(function () { + return { + x: 0, + y: 0 + }; + }); + + // trigger layoutready when each node has had its position set at least once + layout.one('layoutready', options.ready); + layout.emit('layoutready'); + + // trigger layoutstop when the layout stops (e.g. finishes) + layout.one('layoutstop', options.stop); + layout.emit('layoutstop'); + + return this; // chaining +}; + +// called on continuous layouts to stop them before they finish +NullLayout.prototype.stop = function () { + return this; // chaining +}; + +module.exports = NullLayout; + +/***/ }), +/* 103 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var is = __webpack_require__(0); + +var defaults = { + positions: undefined, // map of (node id) => (position obj); or function(node){ return somPos; } + zoom: undefined, // the zoom level to set (prob want fit = false if set) + pan: undefined, // the pan level to set (prob want fit = false if set) + fit: true, // whether to fit to viewport + padding: 30, // padding on fit + animate: false, // whether to transition the node positions + animationDuration: 500, // duration of animation in ms if enabled + animationEasing: undefined, // easing of animation if enabled + animateFilter: function animateFilter(node, i) { + return true; + }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts + ready: undefined, // callback on layoutready + stop: undefined, // callback on layoutstop + transform: function transform(node, position) { + return position; + } // transform a given node position. Useful for changing flow direction in discrete layouts +}; + +function PresetLayout(options) { + this.options = util.extend({}, defaults, options); +} + +PresetLayout.prototype.run = function () { + var options = this.options; + var eles = options.eles; + + var nodes = eles.nodes(); + var posIsFn = is.fn(options.positions); + + function getPosition(node) { + if (options.positions == null) { + return null; + } + + if (posIsFn) { + return options.positions(node); + } + + var pos = options.positions[node._private.data.id]; + + if (pos == null) { + return null; + } + + return pos; + } + + nodes.layoutPositions(this, options, function (node, i) { + var position = getPosition(node); + + if (node.locked() || position == null) { + return false; + } + + return position; + }); + + return this; // chaining +}; + +module.exports = PresetLayout; + +/***/ }), +/* 104 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var math = __webpack_require__(2); + +var defaults = { + fit: true, // whether to fit to viewport + padding: 30, // fit padding + boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + animate: false, // whether to transition the node positions + animationDuration: 500, // duration of animation in ms if enabled + animationEasing: undefined, // easing of animation if enabled + animateFilter: function animateFilter(node, i) { + return true; + }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts + ready: undefined, // callback on layoutready + stop: undefined, // callback on layoutstop + transform: function transform(node, position) { + return position; + } // transform a given node position. Useful for changing flow direction in discrete layouts +}; + +function RandomLayout(options) { + this.options = util.extend({}, defaults, options); +} + +RandomLayout.prototype.run = function () { + var options = this.options; + var cy = options.cy; + var eles = options.eles; + var nodes = eles.nodes().not(':parent'); + + var bb = math.makeBoundingBox(options.boundingBox ? options.boundingBox : { + x1: 0, y1: 0, w: cy.width(), h: cy.height() + }); + + var getPos = function getPos(node, i) { + return { + x: bb.x1 + Math.round(Math.random() * bb.w), + y: bb.y1 + Math.round(Math.random() * bb.h) + }; + }; + + nodes.layoutPositions(this, options, getPos); + + return this; // chaining +}; + +module.exports = RandomLayout; + +/***/ }), +/* 105 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = [{ name: 'null', impl: __webpack_require__(106) }, { name: 'base', impl: __webpack_require__(107) }, { name: 'canvas', impl: __webpack_require__(123) }]; + +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function NullRenderer(options) { + this.options = options; + this.notifications = 0; // for testing +} + +var noop = function noop() {}; + +NullRenderer.prototype = { + recalculateRenderedStyle: noop, + notify: function notify() { + this.notifications++; + }, + init: noop +}; + +module.exports = NullRenderer; + +/***/ }), +/* 107 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var util = __webpack_require__(1); +var window = __webpack_require__(3); + +var BaseRenderer = function BaseRenderer(options) { + this.init(options); +}; +var BR = BaseRenderer; +var BRp = BR.prototype; + +BRp.clientFunctions = ['redrawHint', 'render', 'renderTo', 'matchCanvasSize', 'nodeShapeImpl', 'arrowShapeImpl']; + +BRp.init = function (options) { + var r = this; + + r.options = options; + + r.cy = options.cy; + + var ctr = r.container = options.cy.container(); + + // prepend a stylesheet in the head such that + if (window) { + var document = window.document; + var head = document.head; + var stylesheetId = '__________cytoscape_stylesheet'; + var className = '__________cytoscape_container'; + var stylesheetAlreadyExists = document.getElementById(stylesheetId) != null; + + if (ctr.className.indexOf(className) < 0) { + ctr.className = (ctr.className || '') + ' ' + className; + } + + if (!stylesheetAlreadyExists) { + var stylesheet = document.createElement('style'); + + stylesheet.id = stylesheetId; + stylesheet.innerHTML = '.' + className + ' { position: relative; }'; + + head.insertBefore(stylesheet, head.children[0]); // first so lowest priority + } + + var computedStyle = window.getComputedStyle(ctr); + var position = computedStyle.getPropertyValue('position'); + + if (position === 'static') { + util.error('A Cytoscape container has style position:static and so can not use UI extensions properly'); + } + } + + r.selection = [undefined, undefined, undefined, undefined, 0]; // Coordinates for selection box, plus enabled flag + + r.bezierProjPcts = [0.05, 0.225, 0.4, 0.5, 0.6, 0.775, 0.95]; + + //--Pointer-related data + r.hoverData = { down: null, last: null, + downTime: null, triggerMode: null, + dragging: false, + initialPan: [null, null], capture: false }; + + r.dragData = { possibleDragElements: [] }; + + r.touchData = { + start: null, capture: false, + + // These 3 fields related to tap, taphold events + startPosition: [null, null, null, null, null, null], + singleTouchStartTime: null, + singleTouchMoved: true, + + now: [null, null, null, null, null, null], + earlier: [null, null, null, null, null, null] + }; + + r.redraws = 0; + r.showFps = options.showFps; + r.debug = options.debug; + + r.hideEdgesOnViewport = options.hideEdgesOnViewport; + r.hideLabelsOnViewport = options.hideLabelsOnViewport; + r.textureOnViewport = options.textureOnViewport; + r.wheelSensitivity = options.wheelSensitivity; + r.motionBlurEnabled = options.motionBlur; // on by default + r.forcedPixelRatio = options.pixelRatio; + r.motionBlur = options.motionBlur; // for initial kick off + r.motionBlurOpacity = options.motionBlurOpacity; + r.motionBlurTransparency = 1 - r.motionBlurOpacity; + r.motionBlurPxRatio = 1; + r.mbPxRBlurry = 1; //0.8; + r.minMbLowQualFrames = 4; + r.fullQualityMb = false; + r.clearedForMotionBlur = []; + r.desktopTapThreshold = options.desktopTapThreshold; + r.desktopTapThreshold2 = options.desktopTapThreshold * options.desktopTapThreshold; + r.touchTapThreshold = options.touchTapThreshold; + r.touchTapThreshold2 = options.touchTapThreshold * options.touchTapThreshold; + r.tapholdDuration = 500; + + r.bindings = []; + r.beforeRenderCallbacks = []; + r.beforeRenderPriorities = { // higher priority execs before lower one + animations: 400, + eleCalcs: 300, + eleTxrDeq: 200, + lyrTxrDeq: 100 + }; + + r.registerNodeShapes(); + r.registerArrowShapes(); + r.registerCalculationListeners(); +}; + +BRp.notify = function (params) { + var types; + var r = this; + + // the renderer can't be notified after it's destroyed + if (this.destroyed) { + return; + } + + if (is.array(params.type)) { + types = params.type; + } else { + types = [params.type]; + } + + var has = {}; + for (var i = 0; i < types.length; i++) { + var type = types[i]; + + has[type] = true; + } // for + + if (has['init']) { + r.load(); + return; + } + + if (has['destroy']) { + r.destroy(); + return; + } + + if (has['add'] || has['remove'] || has['load'] || has['zorder']) { + r.invalidateCachedZSortedEles(); + } + + if (has['viewport']) { + r.redrawHint('select', true); + } + + if (has['load'] || has['resize']) { + r.invalidateContainerClientCoordsCache(); + r.matchCanvasSize(r.container); + } + + r.redrawHint('eles', true); + r.redrawHint('drag', true); + + this.startRenderLoop(); + + this.redraw(); +}; + +BRp.destroy = function () { + var r = this; + + r.destroyed = true; + + r.cy.stopAnimationLoop(); + + for (var i = 0; i < r.bindings.length; i++) { + var binding = r.bindings[i]; + var b = binding; + var tgt = b.target; + + (tgt.off || tgt.removeEventListener).apply(tgt, b.args); + } + + r.bindings = []; + r.beforeRenderCallbacks = []; + r.onUpdateEleCalcsFns = []; + + if (r.removeObserver) { + r.removeObserver.disconnect(); + } + + if (r.styleObserver) { + r.styleObserver.disconnect(); + } + + if (r.labelCalcDiv) { + try { + document.body.removeChild(r.labelCalcDiv); // eslint-disable-line no-undef + } catch (e) { + // ie10 issue #1014 + } + } +}; + +[__webpack_require__(108), __webpack_require__(109), __webpack_require__(119), __webpack_require__(120), __webpack_require__(121), __webpack_require__(122)].forEach(function (props) { + util.extend(BRp, props); +}); + +module.exports = BR; + +/***/ }), +/* 108 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var math = __webpack_require__(2); +var is = __webpack_require__(0); +var util = __webpack_require__(1); + +var BRp = {}; + +BRp.arrowShapeWidth = 0.3; + +BRp.registerArrowShapes = function () { + var arrowShapes = this.arrowShapes = {}; + var renderer = this; + + // Contract for arrow shapes: + // 0, 0 is arrow tip + // (0, 1) is direction towards node + // (1, 0) is right + // + // functional api: + // collide: check x, y in shape + // roughCollide: called before collide, no false negatives + // draw: draw + // spacing: dist(arrowTip, nodeBoundary) + // gap: dist(edgeTip, nodeBoundary), edgeTip may != arrowTip + + var bbCollide = function bbCollide(x, y, size, angle, translation, edgeWidth, padding) { + var x1 = translation.x - size / 2 - padding; + var x2 = translation.x + size / 2 + padding; + var y1 = translation.y - size / 2 - padding; + var y2 = translation.y + size / 2 + padding; + + var inside = x1 <= x && x <= x2 && y1 <= y && y <= y2; + + return inside; + }; + + var transform = function transform(x, y, size, angle, translation) { + var xRotated = x * Math.cos(angle) - y * Math.sin(angle); + var yRotated = x * Math.sin(angle) + y * Math.cos(angle); + + var xScaled = xRotated * size; + var yScaled = yRotated * size; + + var xTranslated = xScaled + translation.x; + var yTranslated = yScaled + translation.y; + + return { + x: xTranslated, + y: yTranslated + }; + }; + + var transformPoints = function transformPoints(pts, size, angle, translation) { + var retPts = []; + + for (var i = 0; i < pts.length; i += 2) { + var x = pts[i]; + var y = pts[i + 1]; + + retPts.push(transform(x, y, size, angle, translation)); + } + + return retPts; + }; + + var pointsToArr = function pointsToArr(pts) { + var ret = []; + + for (var i = 0; i < pts.length; i++) { + var p = pts[i]; + + ret.push(p.x, p.y); + } + + return ret; + }; + + var standardGap = function standardGap(edge) { + return edge.pstyle('width').pfValue * edge.pstyle('arrow-scale').pfValue * 2; + }; + + var defineArrowShape = function defineArrowShape(name, defn) { + if (is.string(defn)) { + defn = arrowShapes[defn]; + } + + arrowShapes[name] = util.extend({ + name: name, + + points: [-0.15, -0.3, 0.15, -0.3, 0.15, 0.3, -0.15, 0.3], + + collide: function collide(x, y, size, angle, translation, padding) { + var points = pointsToArr(transformPoints(this.points, size + 2 * padding, angle, translation)); + var inside = math.pointInsidePolygonPoints(x, y, points); + + return inside; + }, + + roughCollide: bbCollide, + + draw: function draw(context, size, angle, translation) { + var points = transformPoints(this.points, size, angle, translation); + + renderer.arrowShapeImpl('polygon')(context, points); + }, + + spacing: function spacing(edge) { + return 0; + }, + + gap: standardGap + }, defn); + }; + + defineArrowShape('none', { + collide: util.falsify, + + roughCollide: util.falsify, + + draw: util.noop, + + spacing: util.zeroify, + + gap: util.zeroify + }); + + defineArrowShape('triangle', { + points: [-0.15, -0.3, 0, 0, 0.15, -0.3] + }); + + defineArrowShape('arrow', 'triangle'); + + defineArrowShape('triangle-backcurve', { + points: arrowShapes['triangle'].points, + + controlPoint: [0, -0.15], + + roughCollide: bbCollide, + + draw: function draw(context, size, angle, translation, edgeWidth) { + var ptsTrans = transformPoints(this.points, size, angle, translation); + var ctrlPt = this.controlPoint; + var ctrlPtTrans = transform(ctrlPt[0], ctrlPt[1], size, angle, translation); + + renderer.arrowShapeImpl(this.name)(context, ptsTrans, ctrlPtTrans); + }, + + gap: function gap(edge) { + return standardGap(edge) * 0.8; + } + }); + + defineArrowShape('triangle-tee', { + points: [-0.15, -0.3, 0, 0, 0.15, -0.3, -0.15, -0.3], + + pointsTee: [-0.15, -0.4, -0.15, -0.5, 0.15, -0.5, 0.15, -0.4], + + collide: function collide(x, y, size, angle, translation, edgeWidth, padding) { + var triPts = pointsToArr(transformPoints(this.points, size + 2 * padding, angle, translation)); + var teePts = pointsToArr(transformPoints(this.pointsTee, size + 2 * padding, angle, translation)); + + var inside = math.pointInsidePolygonPoints(x, y, triPts) || math.pointInsidePolygonPoints(x, y, teePts); + + return inside; + }, + + draw: function draw(context, size, angle, translation, edgeWidth) { + var triPts = transformPoints(this.points, size, angle, translation); + var teePts = transformPoints(this.pointsTee, size, angle, translation); + + renderer.arrowShapeImpl(this.name)(context, triPts, teePts); + } + }); + + defineArrowShape('triangle-cross', { + points: [-0.15, -0.3, 0, 0, 0.15, -0.3, -0.15, -0.3], + + baseCrossLinePts: [-0.15, -0.4, // first half of the rectangle + -0.15, -0.4, 0.15, -0.4, // second half of the rectangle + 0.15, -0.4], + + crossLinePts: function crossLinePts(size, edgeWidth) { + // shift points so that the distance between the cross points matches edge width + var p = this.baseCrossLinePts.slice(); + var shiftFactor = edgeWidth / size; + var y0 = 3; + var y1 = 5; + + p[y0] = p[y0] - shiftFactor; + p[y1] = p[y1] - shiftFactor; + + return p; + }, + + collide: function collide(x, y, size, angle, translation, edgeWidth, padding) { + var triPts = pointsToArr(transformPoints(this.points, size + 2 * padding, angle, translation)); + var teePts = pointsToArr(transformPoints(this.crossLinePts(size, edgeWidth), size + 2 * padding, angle, translation)); + var inside = math.pointInsidePolygonPoints(x, y, triPts) || math.pointInsidePolygonPoints(x, y, teePts); + + return inside; + }, + + draw: function draw(context, size, angle, translation, edgeWidth) { + var triPts = transformPoints(this.points, size, angle, translation); + var crossLinePts = transformPoints(this.crossLinePts(size, edgeWidth), size, angle, translation); + + renderer.arrowShapeImpl(this.name)(context, triPts, crossLinePts); + } + }); + + defineArrowShape('vee', { + points: [-0.15, -0.3, 0, 0, 0.15, -0.3, 0, -0.15], + + gap: function gap(edge) { + return standardGap(edge) * 0.525; + } + }); + + defineArrowShape('circle', { + radius: 0.15, + + collide: function collide(x, y, size, angle, translation, edgeWidth, padding) { + var t = translation; + var inside = Math.pow(t.x - x, 2) + Math.pow(t.y - y, 2) <= Math.pow((size + 2 * padding) * this.radius, 2); + + return inside; + }, + + draw: function draw(context, size, angle, translation, edgeWidth) { + renderer.arrowShapeImpl(this.name)(context, translation.x, translation.y, this.radius * size); + }, + + spacing: function spacing(edge) { + return renderer.getArrowWidth(edge.pstyle('width').pfValue, edge.pstyle('arrow-scale').value) * this.radius; + } + }); + + defineArrowShape('tee', { + points: [-0.15, 0, -0.15, -0.1, 0.15, -0.1, 0.15, 0], + + spacing: function spacing(edge) { + return 1; + }, + + gap: function gap(edge) { + return 1; + } + }); + + defineArrowShape('square', { + points: [-0.15, 0.00, 0.15, 0.00, 0.15, -0.3, -0.15, -0.3] + }); + + defineArrowShape('diamond', { + points: [-0.15, -0.15, 0, -0.3, 0.15, -0.15, 0, 0], + + gap: function gap(edge) { + return edge.pstyle('width').pfValue * edge.pstyle('arrow-scale').value; + } + }); +}; + +module.exports = BRp; + +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); + +var BRp = {}; + +[__webpack_require__(110), __webpack_require__(111), __webpack_require__(112), __webpack_require__(113), __webpack_require__(114), __webpack_require__(115), __webpack_require__(116), __webpack_require__(117), __webpack_require__(118)].forEach(function (props) { + util.extend(BRp, props); +}); + +module.exports = BRp; + +/***/ }), +/* 110 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var window = __webpack_require__(3); +var math = __webpack_require__(2); +var util = __webpack_require__(1); +var window = __webpack_require__(3); + +var BRp = {}; + +// Project mouse +BRp.projectIntoViewport = function (clientX, clientY) { + var cy = this.cy; + var offsets = this.findContainerClientCoords(); + var offsetLeft = offsets[0]; + var offsetTop = offsets[1]; + var scale = offsets[4]; + var pan = cy.pan(); + var zoom = cy.zoom(); + + var x = ((clientX - offsetLeft) / scale - pan.x) / zoom; + var y = ((clientY - offsetTop) / scale - pan.y) / zoom; + + return [x, y]; +}; + +BRp.findContainerClientCoords = function () { + if (this.containerBB) { + return this.containerBB; + } + + var container = this.container; + var rect = container.getBoundingClientRect(); + var style = window.getComputedStyle(container); + var styleValue = function styleValue(name) { + return parseFloat(style.getPropertyValue(name)); + }; + + var padding = { + left: styleValue('padding-left'), + right: styleValue('padding-right'), + top: styleValue('padding-top'), + bottom: styleValue('padding-bottom') + }; + + var border = { + left: styleValue('border-left-width'), + right: styleValue('border-right-width'), + top: styleValue('border-top-width'), + bottom: styleValue('border-bottom-width') + }; + + var clientWidth = container.clientWidth; + var clientHeight = container.clientHeight; + + var paddingHor = padding.left + padding.right; + var paddingVer = padding.top + padding.bottom; + + var borderHor = border.left + border.right; + var borderVer = border.top + border.bottom; + + var scale = rect.width / (clientWidth + borderHor); + + var unscaledW = clientWidth - paddingHor; + var unscaledH = clientHeight - paddingVer; + + var scaledW = rect.width - (paddingHor + borderHor) * scale; + var scaledH = rect.height - (paddingVer + borderVer) * scale; + + var left = rect.left + padding.left + border.left; + var top = rect.top + padding.top + border.top; + + return this.containerBB = [left, top, unscaledW, unscaledH, scale]; +}; + +BRp.invalidateContainerClientCoordsCache = function () { + this.containerBB = null; +}; + +BRp.findNearestElement = function (x, y, interactiveElementsOnly, isTouch) { + return this.findNearestElements(x, y, interactiveElementsOnly, isTouch)[0]; +}; + +BRp.findNearestElements = function (x, y, interactiveElementsOnly, isTouch) { + var self = this; + var r = this; + var eles = r.getCachedZSortedEles(); + var near = []; // 1 node max, 1 edge max + var zoom = r.cy.zoom(); + var hasCompounds = r.cy.hasCompoundNodes(); + var edgeThreshold = (isTouch ? 24 : 8) / zoom; + var nodeThreshold = (isTouch ? 8 : 2) / zoom; + var labelThreshold = (isTouch ? 8 : 2) / zoom; + var minSqDist = Infinity; + var nearEdge; + var nearNode; + + if (interactiveElementsOnly) { + eles = eles.interactive; + } + + function addEle(ele, sqDist) { + if (ele.isNode()) { + if (nearNode) { + return; // can't replace node + } else { + nearNode = ele; + near.push(ele); + } + } + + if (ele.isEdge() && (sqDist == null || sqDist < minSqDist)) { + if (nearEdge) { + // then replace existing edge + // can replace only if same z-index + if (nearEdge.pstyle('z-index').value === ele.pstyle('z-index').value) { + for (var i = 0; i < near.length; i++) { + if (near[i].isEdge()) { + near[i] = ele; + nearEdge = ele; + minSqDist = sqDist != null ? sqDist : minSqDist; + break; + } + } + } + } else { + near.push(ele); + nearEdge = ele; + minSqDist = sqDist != null ? sqDist : minSqDist; + } + } + } + + function checkNode(node) { + var width = node.outerWidth() + 2 * nodeThreshold; + var height = node.outerHeight() + 2 * nodeThreshold; + var hw = width / 2; + var hh = height / 2; + var pos = node.position(); + + if (pos.x - hw <= x && x <= pos.x + hw // bb check x + && pos.y - hh <= y && y <= pos.y + hh // bb check y + ) { + var shape = r.nodeShapes[self.getNodeShape(node)]; + + if (shape.checkPoint(x, y, 0, width, height, pos.x, pos.y)) { + addEle(node, 0); + return true; + } + } + } + + function checkEdge(edge) { + var _p = edge._private; + + var rs = _p.rscratch; + var styleWidth = edge.pstyle('width').pfValue; + var scale = edge.pstyle('arrow-scale').value; + var width = styleWidth / 2 + edgeThreshold; // more like a distance radius from centre + var widthSq = width * width; + var width2 = width * 2; + var src = _p.source; + var tgt = _p.target; + var inEdgeBB = false; + var sqDist; + + if (rs.edgeType === 'segments' || rs.edgeType === 'straight' || rs.edgeType === 'haystack') { + var pts = rs.allpts; + + for (var i = 0; i + 3 < pts.length; i += 2) { + if ((inEdgeBB = math.inLineVicinity(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3], width2)) && widthSq > (sqDist = math.sqdistToFiniteLine(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3]))) { + addEle(edge, sqDist); + return true; + } + } + } else if (rs.edgeType === 'bezier' || rs.edgeType === 'multibezier' || rs.edgeType === 'self' || rs.edgeType === 'compound') { + var pts = rs.allpts; + for (var i = 0; i + 5 < rs.allpts.length; i += 4) { + if ((inEdgeBB = math.inBezierVicinity(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3], pts[i + 4], pts[i + 5], width2)) && widthSq > (sqDist = math.sqdistToQuadraticBezier(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3], pts[i + 4], pts[i + 5]))) { + addEle(edge, sqDist); + return true; + } + } + } + + // if we're close to the edge but didn't hit it, maybe we hit its arrows + + var src = src || _p.source; + var tgt = tgt || _p.target; + + var arSize = self.getArrowWidth(styleWidth, scale); + + var arrows = [{ name: 'source', x: rs.arrowStartX, y: rs.arrowStartY, angle: rs.srcArrowAngle }, { name: 'target', x: rs.arrowEndX, y: rs.arrowEndY, angle: rs.tgtArrowAngle }, { name: 'mid-source', x: rs.midX, y: rs.midY, angle: rs.midsrcArrowAngle }, { name: 'mid-target', x: rs.midX, y: rs.midY, angle: rs.midtgtArrowAngle }]; + + for (var i = 0; i < arrows.length; i++) { + var ar = arrows[i]; + var shape = r.arrowShapes[edge.pstyle(ar.name + '-arrow-shape').value]; + var edgeWidth = edge.pstyle('width').pfValue; + if (shape.roughCollide(x, y, arSize, ar.angle, { x: ar.x, y: ar.y }, edgeWidth, edgeThreshold) && shape.collide(x, y, arSize, ar.angle, { x: ar.x, y: ar.y }, edgeWidth, edgeThreshold)) { + addEle(edge); + return true; + } + } + + // for compound graphs, hitting edge may actually want a connected node instead (b/c edge may have greater z-index precedence) + if (hasCompounds && near.length > 0) { + checkNode(src); + checkNode(tgt); + } + } + + function preprop(obj, name, pre) { + return util.getPrefixedProperty(obj, name, pre); + } + + function checkLabel(ele, prefix) { + var _p = ele._private; + var th = labelThreshold; + + var prefixDash; + if (prefix) { + prefixDash = prefix + '-'; + } else { + prefixDash = ''; + } + + var text = ele.pstyle(prefixDash + 'label').value; + var eventsEnabled = ele.pstyle('text-events').strValue === 'yes'; + + if (!eventsEnabled || !text) { + return; + } + + var rstyle = _p.rstyle; + var bw = ele.pstyle('text-border-width').pfValue; + var pw = ele.pstyle('text-background-padding').pfValue; + var lw = preprop(rstyle, 'labelWidth', prefix) + bw + 2 * th + 2 * pw; + var lh = preprop(rstyle, 'labelHeight', prefix) + bw + 2 * th + 2 * pw; + var lx = preprop(rstyle, 'labelX', prefix); + var ly = preprop(rstyle, 'labelY', prefix); + + var theta = preprop(_p.rscratch, 'labelAngle', prefix); + + var lx1 = lx - lw / 2; + var lx2 = lx + lw / 2; + var ly1 = ly - lh / 2; + var ly2 = ly + lh / 2; + + if (theta) { + var cos = Math.cos(theta); + var sin = Math.sin(theta); + + var rotate = function rotate(x, y) { + x = x - lx; + y = y - ly; + + return { + x: x * cos - y * sin + lx, + y: x * sin + y * cos + ly + }; + }; + + var px1y1 = rotate(lx1, ly1); + var px1y2 = rotate(lx1, ly2); + var px2y1 = rotate(lx2, ly1); + var px2y2 = rotate(lx2, ly2); + + var points = [px1y1.x, px1y1.y, px2y1.x, px2y1.y, px2y2.x, px2y2.y, px1y2.x, px1y2.y]; + + if (math.pointInsidePolygonPoints(x, y, points)) { + addEle(ele); + return true; + } + } else { + // do a cheaper bb check + var bb = { + w: lw, + h: lh, + x1: lx1, + x2: lx2, + y1: ly1, + y2: ly2 + }; + + if (math.inBoundingBox(bb, x, y)) { + addEle(ele); + return true; + } + } + } + + for (var i = eles.length - 1; i >= 0; i--) { + // reverse order for precedence + var ele = eles[i]; + + if (ele.isNode()) { + checkNode(ele) || checkLabel(ele); + } else { + // then edge + checkEdge(ele) || checkLabel(ele) || checkLabel(ele, 'source') || checkLabel(ele, 'target'); + } + } + + return near; +}; + +// 'Give me everything from this box' +BRp.getAllInBox = function (x1, y1, x2, y2) { + var eles = this.getCachedZSortedEles().interactive; + var box = []; + + var x1c = Math.min(x1, x2); + var x2c = Math.max(x1, x2); + var y1c = Math.min(y1, y2); + var y2c = Math.max(y1, y2); + + x1 = x1c; + x2 = x2c; + y1 = y1c; + y2 = y2c; + + var boxBb = math.makeBoundingBox({ + x1: x1, y1: y1, + x2: x2, y2: y2 + }); + + for (var e = 0; e < eles.length; e++) { + var ele = eles[e]; + + if (ele.isNode()) { + var node = ele; + var nodeBb = node.boundingBox({ + includeNodes: true, + includeEdges: false, + includeLabels: false + }); + + if (math.boundingBoxesIntersect(boxBb, nodeBb) && !math.boundingBoxInBoundingBox(nodeBb, boxBb)) { + box.push(node); + } + } else { + var edge = ele; + var _p = edge._private; + var rs = _p.rscratch; + + if (rs.startX != null && rs.startY != null && !math.inBoundingBox(boxBb, rs.startX, rs.startY)) { + continue; + } + if (rs.endX != null && rs.endY != null && !math.inBoundingBox(boxBb, rs.endX, rs.endY)) { + continue; + } + + if (rs.edgeType === 'bezier' || rs.edgeType === 'multibezier' || rs.edgeType === 'self' || rs.edgeType === 'compound' || rs.edgeType === 'segments' || rs.edgeType === 'haystack') { + + var pts = _p.rstyle.bezierPts || _p.rstyle.linePts || _p.rstyle.haystackPts; + var allInside = true; + + for (var i = 0; i < pts.length; i++) { + if (!math.pointInBoundingBox(boxBb, pts[i])) { + allInside = false; + break; + } + } + + if (allInside) { + box.push(edge); + } + } else if (rs.edgeType === 'haystack' || rs.edgeType === 'straight') { + box.push(edge); + } + } + } + + return box; +}; + +module.exports = BRp; + +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var math = __webpack_require__(2); + +var BRp = {}; + +BRp.calculateArrowAngles = function (edge) { + var rs = edge._private.rscratch; + var isHaystack = rs.edgeType === 'haystack'; + var isBezier = rs.edgeType === 'bezier'; + var isMultibezier = rs.edgeType === 'multibezier'; + var isSegments = rs.edgeType === 'segments'; + var isCompound = rs.edgeType === 'compound'; + var isSelf = rs.edgeType === 'self'; + + // Displacement gives direction for arrowhead orientation + var dispX, dispY; + var startX, startY, endX, endY, midX, midY; + + if (isHaystack) { + startX = rs.haystackPts[0]; + startY = rs.haystackPts[1]; + endX = rs.haystackPts[2]; + endY = rs.haystackPts[3]; + } else { + startX = rs.arrowStartX; + startY = rs.arrowStartY; + endX = rs.arrowEndX; + endY = rs.arrowEndY; + } + + midX = rs.midX; + midY = rs.midY; + + // source + // + + if (isSegments) { + dispX = startX - rs.segpts[0]; + dispY = startY - rs.segpts[1]; + } else if (isMultibezier || isCompound || isSelf || isBezier) { + var pts = rs.allpts; + var bX = math.qbezierAt(pts[0], pts[2], pts[4], 0.1); + var bY = math.qbezierAt(pts[1], pts[3], pts[5], 0.1); + + dispX = startX - bX; + dispY = startY - bY; + } else { + dispX = startX - midX; + dispY = startY - midY; + } + + rs.srcArrowAngle = math.getAngleFromDisp(dispX, dispY); + + // mid target + // + + var midX = rs.midX; + var midY = rs.midY; + + if (isHaystack) { + midX = (startX + endX) / 2; + midY = (startY + endY) / 2; + } + + dispX = endX - startX; + dispY = endY - startY; + + if (isSegments) { + var pts = rs.allpts; + + if (pts.length / 2 % 2 === 0) { + var i2 = pts.length / 2; + var i1 = i2 - 2; + + dispX = pts[i2] - pts[i1]; + dispY = pts[i2 + 1] - pts[i1 + 1]; + } else { + var i2 = pts.length / 2 - 1; + var i1 = i2 - 2; + var i3 = i2 + 2; + + dispX = pts[i2] - pts[i1]; + dispY = pts[i2 + 1] - pts[i1 + 1]; + } + } else if (isMultibezier || isCompound || isSelf) { + var pts = rs.allpts; + var cpts = rs.ctrlpts; + var bp0x, bp0y; + var bp1x, bp1y; + + if (cpts.length / 2 % 2 === 0) { + var p0 = pts.length / 2 - 1; // startpt + var ic = p0 + 2; + var p1 = ic + 2; + + bp0x = math.qbezierAt(pts[p0], pts[ic], pts[p1], 0.0); + bp0y = math.qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.0); + + bp1x = math.qbezierAt(pts[p0], pts[ic], pts[p1], 0.0001); + bp1y = math.qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.0001); + } else { + var ic = pts.length / 2 - 1; // ctrpt + var p0 = ic - 2; // startpt + var p1 = ic + 2; // endpt + + bp0x = math.qbezierAt(pts[p0], pts[ic], pts[p1], 0.4999); + bp0y = math.qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.4999); + + bp1x = math.qbezierAt(pts[p0], pts[ic], pts[p1], 0.5); + bp1y = math.qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.5); + } + + dispX = bp1x - bp0x; + dispY = bp1y - bp0y; + } + + rs.midtgtArrowAngle = math.getAngleFromDisp(dispX, dispY); + + rs.midDispX = dispX; + rs.midDispY = dispY; + + // mid source + // + + dispX *= -1; + dispY *= -1; + + if (isSegments) { + var pts = rs.allpts; + + if (pts.length / 2 % 2 === 0) { + // already ok + } else { + var i2 = pts.length / 2 - 1; + var i3 = i2 + 2; + + dispX = -(pts[i3] - pts[i2]); + dispY = -(pts[i3 + 1] - pts[i2 + 1]); + } + } + + rs.midsrcArrowAngle = math.getAngleFromDisp(dispX, dispY); + + // target + // + + if (isSegments) { + dispX = endX - rs.segpts[rs.segpts.length - 2]; + dispY = endY - rs.segpts[rs.segpts.length - 1]; + } else if (isMultibezier || isCompound || isSelf || isBezier) { + var pts = rs.allpts; + var l = pts.length; + var bX = math.qbezierAt(pts[l - 6], pts[l - 4], pts[l - 2], 0.9); + var bY = math.qbezierAt(pts[l - 5], pts[l - 3], pts[l - 1], 0.9); + + dispX = endX - bX; + dispY = endY - bY; + } else { + dispX = endX - midX; + dispY = endY - midY; + } + + rs.tgtArrowAngle = math.getAngleFromDisp(dispX, dispY); +}; + +BRp.getArrowWidth = BRp.getArrowHeight = function (edgeWidth, scale) { + var cache = this.arrowWidthCache = this.arrowWidthCache || {}; + + var cachedVal = cache[edgeWidth + ', ' + scale]; + if (cachedVal) { + return cachedVal; + } + + cachedVal = Math.max(Math.pow(edgeWidth * 13.37, 0.9), 29) * scale; + cache[edgeWidth + ', ' + scale] = cachedVal; + + return cachedVal; +}; + +module.exports = BRp; + +/***/ }), +/* 112 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var math = __webpack_require__(2); +var is = __webpack_require__(0); + +var BRp = {}; + +BRp.findEdgeControlPoints = function (edges) { + if (!edges || edges.length === 0) { + return; + } + + var r = this; + var cy = r.cy; + var hasCompounds = cy.hasCompoundNodes(); + var hashTable = {}; + var pairIds = []; + var haystackEdges = []; + + // create a table of edge (src, tgt) => list of edges between them + var pairId; + for (var i = 0; i < edges.length; i++) { + var edge = edges[i]; + var _p = edge._private; + var data = _p.data; + var curveStyle = edge.pstyle('curve-style').value; + var edgeIsUnbundled = curveStyle === 'unbundled-bezier' || curveStyle === 'segments'; + var edgeIsBezier = curveStyle === 'unbundled-bezier' || curveStyle === 'bezier'; + + // ignore edges who are not to be displayed + // they shouldn't take up space + if (edge.pstyle('display').value === 'none') { + continue; + } + + if (curveStyle === 'haystack') { + haystackEdges.push(edge); + continue; + } + + var srcId = data.source; + var tgtId = data.target; + + pairId = srcId > tgtId ? tgtId + '$-$' + srcId : srcId + '$-$' + tgtId; + + if (edgeIsUnbundled) { + pairId = 'unbundled' + '$-$' + data.id; + } + + var tableEntry = hashTable[pairId]; + + if (tableEntry == null) { + tableEntry = hashTable[pairId] = []; + pairIds.push(pairId); + } + + tableEntry.push(edge); + + if (edgeIsUnbundled) { + tableEntry.hasUnbundled = true; + } + + if (edgeIsBezier) { + tableEntry.hasBezier = true; + } + } + + var src, tgt, srcPos, tgtPos, srcW, srcH, tgtW, tgtH, srcShape, tgtShape; + var vectorNormInverse; + var badBezier; + + // for each pair (src, tgt), create the ctrl pts + // Nested for loop is OK; total number of iterations for both loops = edgeCount + for (var p = 0; p < pairIds.length; p++) { + pairId = pairIds[p]; + var pairEdges = hashTable[pairId]; + + // for each pair id, the edges should be sorted by index + pairEdges.sort(function (edge1, edge2) { + return edge1.poolIndex() - edge2.poolIndex(); + }); + + src = pairEdges[0]._private.source; + tgt = pairEdges[0]._private.target; + + // make sure src/tgt distinction is consistent for bundled edges + if (!pairEdges.hasUnbundled && src.id() > tgt.id()) { + var temp = src; + src = tgt; + tgt = temp; + } + + srcPos = src.position(); + tgtPos = tgt.position(); + + srcW = src.outerWidth(); + srcH = src.outerHeight(); + + tgtW = tgt.outerWidth(); + tgtH = tgt.outerHeight(); + + srcShape = r.nodeShapes[this.getNodeShape(src)]; + tgtShape = r.nodeShapes[this.getNodeShape(tgt)]; + + badBezier = false; + + var edge; + var edge_p; + var rs; + + var dirCounts = { + 'north': 0, + 'west': 0, + 'south': 0, + 'east': 0, + 'northwest': 0, + 'southwest': 0, + 'northeast': 0, + 'southeast': 0 + }; + + var srcX2 = srcPos.x; + var srcY2 = srcPos.y; + var srcW2 = srcW; + var srcH2 = srcH; + + var tgtX2 = tgtPos.x; + var tgtY2 = tgtPos.y; + var tgtW2 = tgtW; + var tgtH2 = tgtH; + + var numEdges2 = pairEdges.length; + + for (var i = 0; i < pairEdges.length; i++) { + edge = pairEdges[i]; + edge_p = edge._private; + rs = edge_p.rscratch; + + var edgeIndex1 = rs.lastEdgeIndex; + var edgeIndex2 = i; + + var numEdges1 = rs.lastNumEdges; + + var curveStyle = edge.pstyle('curve-style').value; + + var edgeIsUnbundled = curveStyle === 'unbundled-bezier' || curveStyle === 'segments'; + + // whether the normalised pair order is the reverse of the edge's src-tgt order + var edgeIsSwapped = src.id() !== edge.source().id(); + + var ctrlptDists = edge.pstyle('control-point-distances'); + var loopDir = edge.pstyle('loop-direction').pfValue; + var loopSwp = edge.pstyle('loop-sweep').pfValue; + var ctrlptWs = edge.pstyle('control-point-weights'); + var bezierN = ctrlptDists && ctrlptWs ? Math.min(ctrlptDists.value.length, ctrlptWs.value.length) : 1; + var stepSize = edge.pstyle('control-point-step-size').pfValue; + var ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[0] : undefined; + var ctrlptWeight = ctrlptWs.value[0]; + var edgeDistances = edge.pstyle('edge-distances').value; + var srcDistFNode = edge.pstyle('source-distance-from-node').pfValue; + var tgtDistFNode = edge.pstyle('target-distance-from-node').pfValue; + var segmentWs = edge.pstyle('segment-weights'); + var segmentDs = edge.pstyle('segment-distances'); + var segmentsN = Math.min(segmentWs.pfValue.length, segmentDs.pfValue.length); + var srcEndpt = edge.pstyle('source-endpoint').value; + var tgtEndpt = edge.pstyle('target-endpoint').value; + var srcArrShape = edge.pstyle('source-arrow-shape').value; + var tgtArrShape = edge.pstyle('target-arrow-shape').value; + var arrowScale = edge.pstyle('arrow-scale').value; + var lineWidth = edge.pstyle('width').pfValue; + + var srcX1 = rs.lastSrcCtlPtX; + var srcY1 = rs.lastSrcCtlPtY; + var srcW1 = rs.lastSrcCtlPtW; + var srcH1 = rs.lastSrcCtlPtH; + + var tgtX1 = rs.lastTgtCtlPtX; + var tgtY1 = rs.lastTgtCtlPtY; + var tgtW1 = rs.lastTgtCtlPtW; + var tgtH1 = rs.lastTgtCtlPtH; + + var curveStyle1 = rs.lastCurveStyle; + var curveStyle2 = curveStyle; + + var ctrlptDists1 = rs.lastCtrlptDists; + var ctrlptDists2 = ctrlptDists ? ctrlptDists.strValue : null; + + var ctrlptWs1 = rs.lastCtrlptWs; + var ctrlptWs2 = ctrlptWs.strValue; + + var segmentWs1 = rs.lastSegmentWs; + var segmentWs2 = segmentWs.strValue; + + var segmentDs1 = rs.lastSegmentDs; + var segmentDs2 = segmentDs.strValue; + + var stepSize1 = rs.lastStepSize; + var stepSize2 = stepSize; + + var loopDir1 = rs.lastLoopDir; + var loopDir2 = loopDir; + + var loopSwp1 = rs.lastLoopSwp; + var loopSwp2 = loopSwp; + + var edgeDistances1 = rs.lastEdgeDistances; + var edgeDistances2 = edgeDistances; + + var srcDistFNode1 = rs.lastSrcDistFNode; + var srcDistFNode2 = srcDistFNode; + + var tgtDistFNode1 = rs.lastTgtDistFNode; + var tgtDistFNode2 = tgtDistFNode; + + var srcEndpt1 = rs.lastSrcEndpt; + var srcEndpt2 = srcEndpt; + + var tgtEndpt1 = rs.lastTgtEndpt; + var tgtEndpt2 = tgtEndpt; + + var srcArr1 = rs.lastSrcArr; + var srcArr2 = srcArrShape; + + var tgtArr1 = rs.lastTgtArr; + var tgtArr2 = tgtArrShape; + + var lineW1 = rs.lastLineW; + var lineW2 = lineWidth; + + var arrScl1 = rs.lastArrScl; + var arrScl2 = arrowScale; + + if (badBezier) { + rs.badBezier = true; + } else { + rs.badBezier = false; + } + + var ptCacheHit; + + if (srcX1 === srcX2 && srcY1 === srcY2 && srcW1 === srcW2 && srcH1 === srcH2 && tgtX1 === tgtX2 && tgtY1 === tgtY2 && tgtW1 === tgtW2 && tgtH1 === tgtH2 && curveStyle1 === curveStyle2 && ctrlptDists1 === ctrlptDists2 && ctrlptWs1 === ctrlptWs2 && segmentWs1 === segmentWs2 && segmentDs1 === segmentDs2 && stepSize1 === stepSize2 && loopDir1 === loopDir2 && loopSwp1 === loopSwp2 && edgeDistances1 === edgeDistances2 && srcDistFNode1 === srcDistFNode2 && tgtDistFNode1 === tgtDistFNode2 && srcEndpt1 === srcEndpt2 && tgtEndpt1 === tgtEndpt2 && srcArr1 === srcArr2 && tgtArr1 === tgtArr2 && lineW1 === lineW2 && arrScl1 === arrScl2 && (edgeIndex1 === edgeIndex2 && numEdges1 === numEdges2 || edgeIsUnbundled)) { + ptCacheHit = true; // then the control points haven't changed and we can skip calculating them + } else { + ptCacheHit = false; + + rs.lastSrcCtlPtX = srcX2; + rs.lastSrcCtlPtY = srcY2; + rs.lastSrcCtlPtW = srcW2; + rs.lastSrcCtlPtH = srcH2; + rs.lastTgtCtlPtX = tgtX2; + rs.lastTgtCtlPtY = tgtY2; + rs.lastTgtCtlPtW = tgtW2; + rs.lastTgtCtlPtH = tgtH2; + rs.lastEdgeIndex = edgeIndex2; + rs.lastNumEdges = numEdges2; + rs.lastCurveStyle = curveStyle2; + rs.lastCtrlptDists = ctrlptDists2; + rs.lastCtrlptWs = ctrlptWs2; + rs.lastSegmentDs = segmentDs2; + rs.lastSegmentWs = segmentWs2; + rs.lastStepSize = stepSize2; + rs.lastLoopDir = loopDir2; + rs.lastLoopSwp = loopSwp2; + rs.lastEdgeDistances = edgeDistances2; + rs.lastSrcDistFNode = srcDistFNode2; + rs.lastTgtDistFNode = tgtDistFNode2; + rs.lastSrcEndpt = srcEndpt2; + rs.lastTgtEndpt = tgtEndpt2; + rs.lastSrcArr = srcArr2; + rs.lastTgtArr = tgtArr2; + rs.lastLineW = lineW2; + rs.lastArrScl = arrScl2; + } + + if (!ptCacheHit) { + + if (!pairEdges.calculatedIntersection && src !== tgt && (pairEdges.hasBezier || pairEdges.hasUnbundled)) { + + pairEdges.calculatedIntersection = true; + + // pt outside src shape to calc distance/displacement from src to tgt + var srcOutside = srcShape.intersectLine(srcPos.x, srcPos.y, srcW, srcH, tgtPos.x, tgtPos.y, 0); + + pairEdges.srcIntn = srcOutside; + + // pt outside tgt shape to calc distance/displacement from src to tgt + var tgtOutside = tgtShape.intersectLine(tgtPos.x, tgtPos.y, tgtW, tgtH, srcPos.x, srcPos.y, 0); + + pairEdges.tgtIntn = tgtOutside; + + var midptSrcPts = { + x1: srcOutside[0], + x2: tgtOutside[0], + y1: srcOutside[1], + y2: tgtOutside[1] + }; + + var posPts = { + x1: srcPos.x, + x2: tgtPos.x, + y1: srcPos.y, + y2: tgtPos.y + }; + + var dy = tgtOutside[1] - srcOutside[1]; + var dx = tgtOutside[0] - srcOutside[0]; + var l = Math.sqrt(dx * dx + dy * dy); + + var vector = { + x: dx, + y: dy + }; + + var vectorNorm = { + x: vector.x / l, + y: vector.y / l + }; + vectorNormInverse = { + x: -vectorNorm.y, + y: vectorNorm.x + }; + + // if node shapes overlap, then no ctrl pts to draw + if (tgtShape.checkPoint(srcOutside[0], srcOutside[1], 0, tgtW, tgtH, tgtPos.x, tgtPos.y) && srcShape.checkPoint(tgtOutside[0], tgtOutside[1], 0, srcW, srcH, srcPos.x, srcPos.y)) { + vectorNormInverse = {}; + badBezier = true; + } + } + + if (!edgeIsSwapped) { + rs.srcIntn = pairEdges.srcIntn; + rs.tgtIntn = pairEdges.tgtIntn; + } else { + // ensure that the per-edge cached value for intersections are correct for swapped bundled edges + rs.srcIntn = pairEdges.tgtIntn; + rs.tgtIntn = pairEdges.srcIntn; + } + + if (src === tgt) { + // Self-edge + + rs.edgeType = 'self'; + + var j = i; + var loopDist = stepSize; + + if (edgeIsUnbundled) { + j = 0; + loopDist = ctrlptDist; + } + + var loopAngle = loopDir - Math.PI / 2; + var outAngle = loopAngle - loopSwp / 2; + var inAngle = loopAngle + loopSwp / 2; + + // increase by step size for overlapping loops, keyed on direction and sweep values + var dc = String(loopDir + '_' + loopSwp); + j = dirCounts[dc] === undefined ? dirCounts[dc] = 0 : ++dirCounts[dc]; + + rs.ctrlpts = [srcPos.x + Math.cos(outAngle) * 1.4 * loopDist * (j / 3 + 1), srcPos.y + Math.sin(outAngle) * 1.4 * loopDist * (j / 3 + 1), srcPos.x + Math.cos(inAngle) * 1.4 * loopDist * (j / 3 + 1), srcPos.y + Math.sin(inAngle) * 1.4 * loopDist * (j / 3 + 1)]; + } else if (hasCompounds && (src.isParent() || src.isChild() || tgt.isParent() || tgt.isChild()) && (src.parents().anySame(tgt) || tgt.parents().anySame(src))) { + // Compound edge + + rs.edgeType = 'compound'; + + // because the line approximation doesn't apply for compound beziers + // (loop/self edges are already elided b/c of cheap src==tgt check) + rs.badBezier = false; + + var j = i; + var loopDist = stepSize; + + if (edgeIsUnbundled) { + j = 0; + loopDist = ctrlptDist; + } + + var loopW = 50; + + var loopaPos = { + x: srcPos.x - srcW / 2, + y: srcPos.y - srcH / 2 + }; + + var loopbPos = { + x: tgtPos.x - tgtW / 2, + y: tgtPos.y - tgtH / 2 + }; + + var loopPos = { + x: Math.min(loopaPos.x, loopbPos.x), + y: Math.min(loopaPos.y, loopbPos.y) + }; + + // avoids cases with impossible beziers + var minCompoundStretch = 0.5; + var compoundStretchA = Math.max(minCompoundStretch, Math.log(srcW * 0.01)); + var compoundStretchB = Math.max(minCompoundStretch, Math.log(tgtW * 0.01)); + + rs.ctrlpts = [loopPos.x, loopPos.y - (1 + Math.pow(loopW, 1.12) / 100) * loopDist * (j / 3 + 1) * compoundStretchA, loopPos.x - (1 + Math.pow(loopW, 1.12) / 100) * loopDist * (j / 3 + 1) * compoundStretchB, loopPos.y]; + } else if (curveStyle === 'segments') { + // Segments (multiple straight lines) + + rs.edgeType = 'segments'; + rs.segpts = []; + + for (var s = 0; s < segmentsN; s++) { + var w = segmentWs.pfValue[s]; + var d = segmentDs.pfValue[s]; + + var w1 = 1 - w; + var w2 = w; + + var midptPts = edgeDistances === 'node-position' ? posPts : midptSrcPts; + + var adjustedMidpt = { + x: midptPts.x1 * w1 + midptPts.x2 * w2, + y: midptPts.y1 * w1 + midptPts.y2 * w2 + }; + + rs.segpts.push(adjustedMidpt.x + vectorNormInverse.x * d, adjustedMidpt.y + vectorNormInverse.y * d); + } + + // Straight edge + } else if (pairEdges.length % 2 === 1 && i === Math.floor(pairEdges.length / 2) && !edgeIsUnbundled) { + + rs.edgeType = 'straight'; + } else { + // (Multi)bezier + + var multi = edgeIsUnbundled; + + rs.edgeType = multi ? 'multibezier' : 'bezier'; + rs.ctrlpts = []; + + for (var b = 0; b < bezierN; b++) { + var normctrlptDist = (0.5 - pairEdges.length / 2 + i) * stepSize; + var manctrlptDist; + var sign = math.signum(normctrlptDist); + + if (multi) { + ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[b] : stepSize; // fall back on step size + ctrlptWeight = ctrlptWs.value[b]; + } + + if (edgeIsUnbundled) { + // multi or single unbundled + manctrlptDist = ctrlptDist; + } else { + manctrlptDist = ctrlptDist !== undefined ? sign * ctrlptDist : undefined; + } + + var distanceFromMidpoint = manctrlptDist !== undefined ? manctrlptDist : normctrlptDist; + + var w1 = 1 - ctrlptWeight; + var w2 = ctrlptWeight; + + if (edgeIsSwapped) { + var temp = w1; + w1 = w2; + w2 = temp; + } + + var midptPts = edgeDistances === 'node-position' ? posPts : midptSrcPts; + + var adjustedMidpt = { + x: midptPts.x1 * w1 + midptPts.x2 * w2, + y: midptPts.y1 * w1 + midptPts.y2 * w2 + }; + + rs.ctrlpts.push(adjustedMidpt.x + vectorNormInverse.x * distanceFromMidpoint, adjustedMidpt.y + vectorNormInverse.y * distanceFromMidpoint); + } + } + + // find endpts for edge + this.findEndpoints(edge); + + var badStart = !is.number(rs.startX) || !is.number(rs.startY); + var badAStart = !is.number(rs.arrowStartX) || !is.number(rs.arrowStartY); + var badEnd = !is.number(rs.endX) || !is.number(rs.endY); + var badAEnd = !is.number(rs.arrowEndX) || !is.number(rs.arrowEndY); + + var minCpADistFactor = 3; + var arrowW = this.getArrowWidth(edge.pstyle('width').pfValue, edge.pstyle('arrow-scale').value) * this.arrowShapeWidth; + var minCpADist = minCpADistFactor * arrowW; + + if (rs.edgeType === 'bezier') { + var startACpDist = math.dist({ x: rs.ctrlpts[0], y: rs.ctrlpts[1] }, { x: rs.startX, y: rs.startY }); + var closeStartACp = startACpDist < minCpADist; + var endACpDist = math.dist({ x: rs.ctrlpts[0], y: rs.ctrlpts[1] }, { x: rs.endX, y: rs.endY }); + var closeEndACp = endACpDist < minCpADist; + + var overlapping = false; + + if (badStart || badAStart || closeStartACp) { + overlapping = true; + + // project control point along line from src centre to outside the src shape + // (otherwise intersection will yield nothing) + var cpD = { // delta + x: rs.ctrlpts[0] - srcPos.x, + y: rs.ctrlpts[1] - srcPos.y + }; + var cpL = Math.sqrt(cpD.x * cpD.x + cpD.y * cpD.y); // length of line + var cpM = { // normalised delta + x: cpD.x / cpL, + y: cpD.y / cpL + }; + var radius = Math.max(srcW, srcH); + var cpProj = { // *2 radius guarantees outside shape + x: rs.ctrlpts[0] + cpM.x * 2 * radius, + y: rs.ctrlpts[1] + cpM.y * 2 * radius + }; + + var srcCtrlPtIntn = srcShape.intersectLine(srcPos.x, srcPos.y, srcW, srcH, cpProj.x, cpProj.y, 0); + + if (closeStartACp) { + rs.ctrlpts[0] = rs.ctrlpts[0] + cpM.x * (minCpADist - startACpDist); + rs.ctrlpts[1] = rs.ctrlpts[1] + cpM.y * (minCpADist - startACpDist); + } else { + rs.ctrlpts[0] = srcCtrlPtIntn[0] + cpM.x * minCpADist; + rs.ctrlpts[1] = srcCtrlPtIntn[1] + cpM.y * minCpADist; + } + } + + if (badEnd || badAEnd || closeEndACp) { + overlapping = true; + + // project control point along line from tgt centre to outside the tgt shape + // (otherwise intersection will yield nothing) + var cpD = { // delta + x: rs.ctrlpts[0] - tgtPos.x, + y: rs.ctrlpts[1] - tgtPos.y + }; + var cpL = Math.sqrt(cpD.x * cpD.x + cpD.y * cpD.y); // length of line + var cpM = { // normalised delta + x: cpD.x / cpL, + y: cpD.y / cpL + }; + var radius = Math.max(srcW, srcH); + var cpProj = { // *2 radius guarantees outside shape + x: rs.ctrlpts[0] + cpM.x * 2 * radius, + y: rs.ctrlpts[1] + cpM.y * 2 * radius + }; + + var tgtCtrlPtIntn = tgtShape.intersectLine(tgtPos.x, tgtPos.y, tgtW, tgtH, cpProj.x, cpProj.y, 0); + + if (closeEndACp) { + rs.ctrlpts[0] = rs.ctrlpts[0] + cpM.x * (minCpADist - endACpDist); + rs.ctrlpts[1] = rs.ctrlpts[1] + cpM.y * (minCpADist - endACpDist); + } else { + rs.ctrlpts[0] = tgtCtrlPtIntn[0] + cpM.x * minCpADist; + rs.ctrlpts[1] = tgtCtrlPtIntn[1] + cpM.y * minCpADist; + } + } + + if (overlapping) { + // recalc endpts + this.findEndpoints(edge); + } + } + + if (rs.edgeType === 'multibezier' || rs.edgeType === 'bezier' || rs.edgeType === 'self' || rs.edgeType === 'compound') { + rs.allpts = []; + + rs.allpts.push(rs.startX, rs.startY); + + for (var b = 0; b + 1 < rs.ctrlpts.length; b += 2) { + // ctrl pt itself + rs.allpts.push(rs.ctrlpts[b], rs.ctrlpts[b + 1]); + + // the midpt between ctrlpts as intermediate destination pts + if (b + 3 < rs.ctrlpts.length) { + rs.allpts.push((rs.ctrlpts[b] + rs.ctrlpts[b + 2]) / 2, (rs.ctrlpts[b + 1] + rs.ctrlpts[b + 3]) / 2); + } + } + + rs.allpts.push(rs.endX, rs.endY); + + var m, mt; + if (rs.ctrlpts.length / 2 % 2 === 0) { + m = rs.allpts.length / 2 - 1; + + rs.midX = rs.allpts[m]; + rs.midY = rs.allpts[m + 1]; + } else { + m = rs.allpts.length / 2 - 3; + mt = 0.5; + + rs.midX = math.qbezierAt(rs.allpts[m], rs.allpts[m + 2], rs.allpts[m + 4], mt); + rs.midY = math.qbezierAt(rs.allpts[m + 1], rs.allpts[m + 3], rs.allpts[m + 5], mt); + } + } else if (rs.edgeType === 'straight') { + // need to calc these after endpts + rs.allpts = [rs.startX, rs.startY, rs.endX, rs.endY]; + + // default midpt for labels etc + rs.midX = (rs.startX + rs.endX + rs.arrowStartX + rs.arrowEndX) / 4; + rs.midY = (rs.startY + rs.endY + rs.arrowStartY + rs.arrowEndY) / 4; + } else if (rs.edgeType === 'segments') { + rs.allpts = []; + rs.allpts.push(rs.startX, rs.startY); + rs.allpts.push.apply(rs.allpts, rs.segpts); + rs.allpts.push(rs.endX, rs.endY); + + if (rs.segpts.length % 4 === 0) { + var i2 = rs.segpts.length / 2; + var i1 = i2 - 2; + + rs.midX = (rs.segpts[i1] + rs.segpts[i2]) / 2; + rs.midY = (rs.segpts[i1 + 1] + rs.segpts[i2 + 1]) / 2; + } else { + var i1 = rs.segpts.length / 2 - 1; + + rs.midX = rs.segpts[i1]; + rs.midY = rs.segpts[i1 + 1]; + } + } + + this.storeEdgeProjections(edge); + this.calculateArrowAngles(edge); + } // if point cache miss + + this.recalculateEdgeLabelProjections(edge); + this.calculateLabelAngles(edge); + } // for pair edges + } // for pair ids + + for (var i = 0; i < haystackEdges.length; i++) { + var edge = haystackEdges[i]; + var _p = edge._private; + var rscratch = _p.rscratch; + var rs = rscratch; + + if (!rscratch.haystack) { + var angle = Math.random() * 2 * Math.PI; + + rscratch.source = { + x: Math.cos(angle), + y: Math.sin(angle) + }; + + var angle = Math.random() * 2 * Math.PI; + + rscratch.target = { + x: Math.cos(angle), + y: Math.sin(angle) + }; + } + + var src = _p.source; + var tgt = _p.target; + var srcPos = src.position(); + var tgtPos = tgt.position(); + var srcW = src.width(); + var tgtW = tgt.width(); + var srcH = src.height(); + var tgtH = tgt.height(); + var radius = edge.pstyle('haystack-radius').value; + var halfRadius = radius / 2; // b/c have to half width/height + + rs.haystackPts = rs.allpts = [rs.source.x * srcW * halfRadius + srcPos.x, rs.source.y * srcH * halfRadius + srcPos.y, rs.target.x * tgtW * halfRadius + tgtPos.x, rs.target.y * tgtH * halfRadius + tgtPos.y]; + + rs.midX = (rs.allpts[0] + rs.allpts[2]) / 2; + rs.midY = (rs.allpts[1] + rs.allpts[3]) / 2; + + // always override as haystack in case set to different type previously + rscratch.edgeType = rscratch.lastCurveStyle = 'haystack'; + rscratch.haystack = true; + + this.storeEdgeProjections(edge); + this.calculateArrowAngles(edge); + this.recalculateEdgeLabelProjections(edge); + this.calculateLabelAngles(edge); + } +}; + +function getPts(pts) { + var retPts = []; + + if (pts == null) { + return; + } + + for (var i = 0; i < pts.length; i += 2) { + var x = pts[i]; + var y = pts[i + 1]; + + retPts.push({ x: x, y: y }); + } + + return retPts; +} + +BRp.getSegmentPoints = function (edge) { + var rs = edge[0]._private.rscratch; + var type = rs.edgeType; + + if (type === 'segments') { + return getPts(rs.segpts); + } +}; + +BRp.getControlPoints = function (edge) { + var rs = edge[0]._private.rscratch; + var type = rs.edgeType; + + if (type === 'bezier' || type === 'multibezier' || type === 'self' || type === 'compound') { + return getPts(rs.ctrlpts); + } +}; + +BRp.getEdgeMidpoint = function (edge) { + var rs = edge[0]._private.rscratch; + + return { + x: rs.midX, + y: rs.midY + }; +}; + +module.exports = BRp; + +/***/ }), +/* 113 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var math = __webpack_require__(2); +var is = __webpack_require__(0); + +var BRp = {}; + +BRp.manualEndptToPx = function (node, prop) { + var r = this; + var npos = node.position(); + var w = node.outerWidth(); + var h = node.outerHeight(); + + if (prop.value.length === 2) { + var p = [prop.pfValue[0], prop.pfValue[1]]; + + if (prop.units[0] === '%') { + p[0] = p[0] * w; + } + + if (prop.units[1] === '%') { + p[1] = p[1] * h; + } + + p[0] += npos.x; + p[1] += npos.y; + + return p; + } else { + var angle = prop.pfValue[0]; + + angle = -Math.PI / 2 + angle; // start at 12 o'clock + + var l = 2 * Math.max(w, h); + + var _p = [npos.x + Math.cos(angle) * l, npos.y + Math.sin(angle) * l]; + + return r.nodeShapes[this.getNodeShape(node)].intersectLine(npos.x, npos.y, w, h, _p[0], _p[1], 0); + } +}; + +BRp.findEndpoints = function (edge) { + var r = this; + var intersect = void 0; + + var source = edge.source()[0]; + var target = edge.target()[0]; + + var srcPos = source.position(); + var tgtPos = target.position(); + + var tgtArShape = edge.pstyle('target-arrow-shape').value; + var srcArShape = edge.pstyle('source-arrow-shape').value; + + var tgtDist = edge.pstyle('target-distance-from-node').pfValue; + var srcDist = edge.pstyle('source-distance-from-node').pfValue; + + var rs = edge._private.rscratch; + + var et = rs.edgeType; + var self = et === 'self' || et === 'compound'; + var bezier = et === 'bezier' || et === 'multibezier' || self; + var multi = et !== 'bezier'; + var lines = et === 'straight' || et === 'segments'; + var segments = et === 'segments'; + var hasEndpts = bezier || multi || lines; + var srcManEndpt = edge.pstyle('source-endpoint'); + var srcManEndptVal = self ? 'outside-to-node' : srcManEndpt.value; + var tgtManEndpt = edge.pstyle('target-endpoint'); + var tgtManEndptVal = self ? 'outside-to-node' : tgtManEndpt.value; + + rs.srcManEndpt = srcManEndpt; + rs.tgtManEndpt = tgtManEndpt; + + var p1 = void 0; // last known point of edge on target side + var p2 = void 0; // last known point of edge on source side + + var p1_i = void 0; // point to intersect with target shape + var p2_i = void 0; // point to intersect with source shape + + if (bezier) { + var cpStart = [rs.ctrlpts[0], rs.ctrlpts[1]]; + var cpEnd = multi ? [rs.ctrlpts[rs.ctrlpts.length - 2], rs.ctrlpts[rs.ctrlpts.length - 1]] : cpStart; + + p1 = cpEnd; + p2 = cpStart; + } else if (lines) { + var srcArrowFromPt = !segments ? [tgtPos.x, tgtPos.y] : rs.segpts.slice(0, 2); + var tgtArrowFromPt = !segments ? [srcPos.x, srcPos.y] : rs.segpts.slice(rs.segpts.length - 2); + + p1 = tgtArrowFromPt; + p2 = srcArrowFromPt; + } + + if (tgtManEndptVal === 'inside-to-node') { + intersect = [tgtPos.x, tgtPos.y]; + } else if (tgtManEndpt.units) { + intersect = this.manualEndptToPx(target, tgtManEndpt); + } else if (tgtManEndptVal === 'outside-to-line') { + intersect = rs.tgtIntn; // use cached value from ctrlpt calc + } else { + if (tgtManEndptVal === 'outside-to-node') { + p1_i = p1; + } else if (tgtManEndptVal === 'outside-to-line') { + p1_i = [srcPos.x, srcPos.y]; + } + + intersect = r.nodeShapes[this.getNodeShape(target)].intersectLine(tgtPos.x, tgtPos.y, target.outerWidth(), target.outerHeight(), p1_i[0], p1_i[1], 0); + } + + var arrowEnd = math.shortenIntersection(intersect, p1, r.arrowShapes[tgtArShape].spacing(edge) + tgtDist); + var edgeEnd = math.shortenIntersection(intersect, p1, r.arrowShapes[tgtArShape].gap(edge) + tgtDist); + + rs.endX = edgeEnd[0]; + rs.endY = edgeEnd[1]; + + rs.arrowEndX = arrowEnd[0]; + rs.arrowEndY = arrowEnd[1]; + + if (srcManEndptVal === 'inside-to-node') { + intersect = [srcPos.x, srcPos.y]; + } else if (srcManEndpt.units) { + intersect = this.manualEndptToPx(source, srcManEndpt); + } else if (srcManEndptVal === 'outside-to-line') { + intersect = rs.srcIntn; // use cached value from ctrlpt calc + } else { + if (srcManEndptVal === 'outside-to-node') { + p2_i = p2; + } else if (srcManEndptVal === 'outside-to-line') { + p2_i = [tgtPos.x, tgtPos.y]; + } + + intersect = r.nodeShapes[this.getNodeShape(source)].intersectLine(srcPos.x, srcPos.y, source.outerWidth(), source.outerHeight(), p2_i[0], p2_i[1], 0); + } + + var arrowStart = math.shortenIntersection(intersect, p2, r.arrowShapes[srcArShape].spacing(edge) + srcDist); + var edgeStart = math.shortenIntersection(intersect, p2, r.arrowShapes[srcArShape].gap(edge) + srcDist); + + rs.startX = edgeStart[0]; + rs.startY = edgeStart[1]; + + rs.arrowStartX = arrowStart[0]; + rs.arrowStartY = arrowStart[1]; + + if (hasEndpts) { + if (!is.number(rs.startX) || !is.number(rs.startY) || !is.number(rs.endX) || !is.number(rs.endY)) { + rs.badLine = true; + } else { + rs.badLine = false; + } + } +}; + +BRp.getSourceEndpoint = function (edge) { + var rs = edge[0]._private.rscratch; + + switch (rs.edgeType) { + case 'haystack': + return { + x: rs.haystackPts[0], + y: rs.haystackPts[1] + }; + default: + return { + x: rs.arrowStartX, + y: rs.arrowStartY + }; + } +}; + +BRp.getTargetEndpoint = function (edge) { + var rs = edge[0]._private.rscratch; + + switch (rs.edgeType) { + case 'haystack': + return { + x: rs.haystackPts[2], + y: rs.haystackPts[3] + }; + default: + return { + x: rs.arrowEndX, + y: rs.arrowEndY + }; + } +}; + +module.exports = BRp; + +/***/ }), +/* 114 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var math = __webpack_require__(2); + +var BRp = {}; + +function pushBezierPts(r, edge, pts) { + var qbezierAt = function qbezierAt(p1, p2, p3, t) { + return math.qbezierAt(p1, p2, p3, t); + }; + var _p = edge._private; + var bpts = _p.rstyle.bezierPts; + + for (var i = 0; i < r.bezierProjPcts.length; i++) { + var p = r.bezierProjPcts[i]; + + bpts.push({ + x: qbezierAt(pts[0], pts[2], pts[4], p), + y: qbezierAt(pts[1], pts[3], pts[5], p) + }); + } +} + +BRp.storeEdgeProjections = function (edge) { + var _p = edge._private; + var rs = _p.rscratch; + var et = rs.edgeType; + + // clear the cached points state + _p.rstyle.bezierPts = null; + _p.rstyle.linePts = null; + _p.rstyle.haystackPts = null; + + if (et === 'multibezier' || et === 'bezier' || et === 'self' || et === 'compound') { + var bpts = _p.rstyle.bezierPts = []; // jshint ignore:line + + for (var i = 0; i + 5 < rs.allpts.length; i += 4) { + pushBezierPts(this, edge, rs.allpts.slice(i, i + 6)); + } + } else if (et === 'segments') { + var lpts = _p.rstyle.linePts = []; + + for (var i = 0; i + 1 < rs.allpts.length; i += 2) { + lpts.push({ + x: rs.allpts[i], + y: rs.allpts[i + 1] + }); + } + } else if (et === 'haystack') { + var hpts = rs.haystackPts; + + _p.rstyle.haystackPts = [{ x: hpts[0], y: hpts[1] }, { x: hpts[2], y: hpts[3] }]; + } + + _p.rstyle.arrowWidth = this.getArrowWidth(edge.pstyle('width').pfValue, edge.pstyle('arrow-scale').value) * this.arrowShapeWidth; +}; + +BRp.recalculateEdgeProjections = function (edges) { + this.findEdgeControlPoints(edges); +}; + +module.exports = BRp; + +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var math = __webpack_require__(2); +var is = __webpack_require__(0); +var util = __webpack_require__(1); + +var BRp = {}; + +BRp.recalculateNodeLabelProjection = function (node) { + var content = node.pstyle('label').strValue; + + if (is.emptyString(content)) { + return; + } + + var textX, textY; + var _p = node._private; + var nodeWidth = node.width(); + var nodeHeight = node.height(); + var padding = node.padding(); + var nodePos = node.position(); + var textHalign = node.pstyle('text-halign').strValue; + var textValign = node.pstyle('text-valign').strValue; + var rs = _p.rscratch; + var rstyle = _p.rstyle; + + switch (textHalign) { + case 'left': + textX = nodePos.x - nodeWidth / 2 - padding; + break; + + case 'right': + textX = nodePos.x + nodeWidth / 2 + padding; + break; + + default: + // e.g. center + textX = nodePos.x; + } + + switch (textValign) { + case 'top': + textY = nodePos.y - nodeHeight / 2 - padding; + break; + + case 'bottom': + textY = nodePos.y + nodeHeight / 2 + padding; + break; + + default: + // e.g. middle + textY = nodePos.y; + } + + rs.labelX = textX; + rs.labelY = textY; + rstyle.labelX = textX; + rstyle.labelY = textY; + + this.applyLabelDimensions(node); +}; + +var lineAngleFromDelta = function lineAngleFromDelta(dx, dy) { + var angle = Math.atan(dy / dx); + + if (dx === 0 && angle < 0) { + angle = angle * -1; + } + + return angle; +}; + +var lineAngle = function lineAngle(p0, p1) { + var dx = p1.x - p0.x; + var dy = p1.y - p0.y; + + return lineAngleFromDelta(dx, dy); +}; + +var bezierAngle = function bezierAngle(p0, p1, p2, t) { + var t0 = math.bound(0, t - 0.001, 1); + var t1 = math.bound(0, t + 0.001, 1); + + var lp0 = math.qbezierPtAt(p0, p1, p2, t0); + var lp1 = math.qbezierPtAt(p0, p1, p2, t1); + + return lineAngle(lp0, lp1); +}; + +BRp.recalculateEdgeLabelProjections = function (edge) { + var p; + var _p = edge._private; + var rs = _p.rscratch; + var r = this; + var content = { + mid: edge.pstyle('label').strValue, + source: edge.pstyle('source-label').strValue, + target: edge.pstyle('target-label').strValue + }; + + if (content.mid || content.source || content.target) { + // then we have to calculate... + } else { + return; // no labels => no calcs + } + + // add center point to style so bounding box calculations can use it + // + p = { + x: rs.midX, + y: rs.midY + }; + + var setRs = function setRs(propName, prefix, value) { + util.setPrefixedProperty(_p.rscratch, propName, prefix, value); + util.setPrefixedProperty(_p.rstyle, propName, prefix, value); + }; + + setRs('labelX', null, p.x); + setRs('labelY', null, p.y); + + var midAngle = lineAngleFromDelta(rs.midDispX, rs.midDispY); + setRs('labelAutoAngle', null, midAngle); + + var createControlPointInfo = function createControlPointInfo() { + if (createControlPointInfo.cache) { + return createControlPointInfo.cache; + } // use cache so only 1x per edge + + var ctrlpts = []; + + // store each ctrlpt info init + for (var i = 0; i + 5 < rs.allpts.length; i += 4) { + var p0 = { x: rs.allpts[i], y: rs.allpts[i + 1] }; + var p1 = { x: rs.allpts[i + 2], y: rs.allpts[i + 3] }; // ctrlpt + var p2 = { x: rs.allpts[i + 4], y: rs.allpts[i + 5] }; + + ctrlpts.push({ + p0: p0, + p1: p1, + p2: p2, + startDist: 0, + length: 0, + segments: [] + }); + } + + var bpts = _p.rstyle.bezierPts; + var nProjs = r.bezierProjPcts.length; + + function addSegment(cp, p0, p1, t0, t1) { + var length = math.dist(p0, p1); + var prevSegment = cp.segments[cp.segments.length - 1]; + var segment = { + p0: p0, + p1: p1, + t0: t0, + t1: t1, + startDist: prevSegment ? prevSegment.startDist + prevSegment.length : 0, + length: length + }; + + cp.segments.push(segment); + + cp.length += length; + } + + // update each ctrlpt with segment info + for (var i = 0; i < ctrlpts.length; i++) { + var cp = ctrlpts[i]; + var prevCp = ctrlpts[i - 1]; + + if (prevCp) { + cp.startDist = prevCp.startDist + prevCp.length; + } + + addSegment(cp, cp.p0, bpts[i * nProjs], 0, r.bezierProjPcts[0]); // first + + for (var j = 0; j < nProjs - 1; j++) { + addSegment(cp, bpts[i * nProjs + j], bpts[i * nProjs + j + 1], r.bezierProjPcts[j], r.bezierProjPcts[j + 1]); + } + + addSegment(cp, bpts[i * nProjs + nProjs - 1], cp.p2, r.bezierProjPcts[nProjs - 1], 1); // last + } + + return createControlPointInfo.cache = ctrlpts; + }; + + var calculateEndProjection = function calculateEndProjection(prefix) { + var angle; + var isSrc = prefix === 'source'; + + if (!content[prefix]) { + return; + } + + var offset = edge.pstyle(prefix + '-text-offset').pfValue; + + switch (rs.edgeType) { + case 'self': + case 'compound': + case 'bezier': + case 'multibezier': + var cps = createControlPointInfo(); + var selected; + var startDist = 0; + var totalDist = 0; + + // find the segment we're on + for (var i = 0; i < cps.length; i++) { + var cp = cps[isSrc ? i : cps.length - 1 - i]; + + for (var j = 0; j < cp.segments.length; j++) { + var seg = cp.segments[isSrc ? j : cp.segments.length - 1 - j]; + var lastSeg = i === cps.length - 1 && j === cp.segments.length - 1; + + startDist = totalDist; + totalDist += seg.length; + + if (totalDist >= offset || lastSeg) { + selected = { cp: cp, segment: seg }; + break; + } + } + + if (selected) { + break; + } + } + + var cp = selected.cp; + var seg = selected.segment; + var tSegment = (offset - startDist) / seg.length; + var segDt = seg.t1 - seg.t0; + var t = isSrc ? seg.t0 + segDt * tSegment : seg.t1 - segDt * tSegment; + + t = math.bound(0, t, 1); + p = math.qbezierPtAt(cp.p0, cp.p1, cp.p2, t); + angle = bezierAngle(cp.p0, cp.p1, cp.p2, t, p); + + break; + + case 'straight': + case 'segments': + case 'haystack': + var d = 0, + di, + d0; + var p0, p1; + var l = rs.allpts.length; + + for (var i = 0; i + 3 < l; i += 2) { + if (isSrc) { + p0 = { x: rs.allpts[i], y: rs.allpts[i + 1] }; + p1 = { x: rs.allpts[i + 2], y: rs.allpts[i + 3] }; + } else { + p0 = { x: rs.allpts[l - 2 - i], y: rs.allpts[l - 1 - i] }; + p1 = { x: rs.allpts[l - 4 - i], y: rs.allpts[l - 3 - i] }; + } + + di = math.dist(p0, p1); + d0 = d; + d += di; + + if (d >= offset) { + break; + } + } + + var pD = offset - d0; + var t = pD / di; + + t = math.bound(0, t, 1); + p = math.lineAt(p0, p1, t); + angle = lineAngle(p0, p1); + + break; + } + + setRs('labelX', prefix, p.x); + setRs('labelY', prefix, p.y); + setRs('labelAutoAngle', prefix, angle); + }; + + calculateEndProjection('source'); + calculateEndProjection('target'); + + this.applyLabelDimensions(edge); +}; + +BRp.applyLabelDimensions = function (ele) { + this.applyPrefixedLabelDimensions(ele); + + if (ele.isEdge()) { + this.applyPrefixedLabelDimensions(ele, 'source'); + this.applyPrefixedLabelDimensions(ele, 'target'); + } +}; + +BRp.applyPrefixedLabelDimensions = function (ele, prefix) { + var _p = ele._private; + + var text = this.getLabelText(ele, prefix); + var labelDims = this.calculateLabelDimensions(ele, text); + + util.setPrefixedProperty(_p.rstyle, 'labelWidth', prefix, labelDims.width); + util.setPrefixedProperty(_p.rscratch, 'labelWidth', prefix, labelDims.width); + + util.setPrefixedProperty(_p.rstyle, 'labelHeight', prefix, labelDims.height); + util.setPrefixedProperty(_p.rscratch, 'labelHeight', prefix, labelDims.height); +}; + +BRp.getLabelText = function (ele, prefix) { + var _p = ele._private; + var pfd = prefix ? prefix + '-' : ''; + var text = ele.pstyle(pfd + 'label').strValue; + var textTransform = ele.pstyle('text-transform').value; + var rscratch = function rscratch(propName, value) { + if (value) { + util.setPrefixedProperty(_p.rscratch, propName, prefix, value); + return value; + } else { + return util.getPrefixedProperty(_p.rscratch, propName, prefix); + } + }; + + // for empty text, skip all processing + if (!text) { + return ''; + } + + if (textTransform == 'none') { + // passthrough + } else if (textTransform == 'uppercase') { + text = text.toUpperCase(); + } else if (textTransform == 'lowercase') { + text = text.toLowerCase(); + } + + var wrapStyle = ele.pstyle('text-wrap').value; + + if (wrapStyle === 'wrap') { + //console.log('wrap'); + + var labelKey = rscratch('labelKey'); + + // save recalc if the label is the same as before + if (labelKey && rscratch('labelWrapKey') === labelKey) { + // console.log('wrap cache hit'); + return rscratch('labelWrapCachedText'); + } + // console.log('wrap cache miss'); + + var lines = text.split('\n'); + var maxW = ele.pstyle('text-max-width').pfValue; + var wrappedLines = []; + + for (var l = 0; l < lines.length; l++) { + var line = lines[l]; + var lineDims = this.calculateLabelDimensions(ele, line, 'line=' + line); + var lineW = lineDims.width; + + if (lineW > maxW) { + // line is too long + var words = line.split(/\s+/); // NB: assume collapsed whitespace into single space + var subline = ''; + + for (var w = 0; w < words.length; w++) { + var word = words[w]; + var testLine = subline.length === 0 ? word : subline + ' ' + word; + var testDims = this.calculateLabelDimensions(ele, testLine, 'testLine=' + testLine); + var testW = testDims.width; + + if (testW <= maxW) { + // word fits on current line + subline += word + ' '; + } else { + // word starts new line + wrappedLines.push(subline); + subline = word + ' '; + } + } + + // if there's remaining text, put it in a wrapped line + if (!subline.match(/^\s+$/)) { + wrappedLines.push(subline); + } + } else { + // line is already short enough + wrappedLines.push(line); + } + } // for + + rscratch('labelWrapCachedLines', wrappedLines); + text = rscratch('labelWrapCachedText', wrappedLines.join('\n')); + rscratch('labelWrapKey', labelKey); + + // console.log(text) + } else if (wrapStyle === 'ellipsis') { + var maxW = ele.pstyle('text-max-width').pfValue; + var ellipsized = ''; + var ellipsis = '\u2026'; + var incLastCh = false; + + for (var i = 0; i < text.length; i++) { + var widthWithNextCh = this.calculateLabelDimensions(ele, ellipsized + text[i] + ellipsis).width; + + if (widthWithNextCh > maxW) { + break; + } + + ellipsized += text[i]; + + if (i === text.length - 1) { + incLastCh = true; + } + } + + if (!incLastCh) { + ellipsized += ellipsis; + } + + return ellipsized; + } // if ellipsize + + return text; +}; + +BRp.calculateLabelDimensions = function (ele, text, extraKey) { + var r = this; + + var cacheKey = ele._private.labelStyleKey + '$@$' + text; + + if (extraKey) { + cacheKey += '$@$' + extraKey; + } + + var cache = r.labelDimCache || (r.labelDimCache = {}); + + if (cache[cacheKey]) { + return cache[cacheKey]; + } + + var sizeMult = 1; // increase the scale to increase accuracy w.r.t. zoomed text + var fStyle = ele.pstyle('font-style').strValue; + var size = sizeMult * ele.pstyle('font-size').pfValue + 'px'; + var family = ele.pstyle('font-family').strValue; + var weight = ele.pstyle('font-weight').strValue; + + var div = this.labelCalcDiv; + + if (!div) { + div = this.labelCalcDiv = document.createElement('div'); // eslint-disable-line no-undef + document.body.appendChild(div); // eslint-disable-line no-undef + } + + var ds = div.style; + + // from ele style + ds.fontFamily = family; + ds.fontStyle = fStyle; + ds.fontSize = size; + ds.fontWeight = weight; + + // forced style + ds.position = 'absolute'; + ds.left = '-9999px'; + ds.top = '-9999px'; + ds.zIndex = '-1'; + ds.visibility = 'hidden'; + ds.pointerEvents = 'none'; + ds.padding = '0'; + ds.lineHeight = '1'; + + if (ele.pstyle('text-wrap').value === 'wrap') { + ds.whiteSpace = 'pre'; // so newlines are taken into account + } else { + ds.whiteSpace = 'normal'; + } + + // put label content in div + div.textContent = text; + + cache[cacheKey] = { + width: Math.ceil(div.clientWidth / sizeMult), + height: Math.ceil(div.clientHeight / sizeMult) + }; + + return cache[cacheKey]; +}; + +BRp.calculateLabelAngles = function (ele) { + var _p = ele._private; + var rs = _p.rscratch; + var isEdge = ele.isEdge(); + var rot = ele.pstyle('text-rotation'); + var rotStr = rot.strValue; + + if (rotStr === 'none') { + rs.labelAngle = rs.sourceLabelAngle = rs.targetLabelAngle = 0; + } else if (isEdge && rotStr === 'autorotate') { + rs.labelAngle = rs.labelAutoAngle; + rs.sourceLabelAngle = rs.sourceLabelAutoAngle; + rs.targetLabelAngle = rs.targetLabelAutoAngle; + } else if (rotStr === 'autorotate') { + rs.labelAngle = rs.sourceLabelAngle = rs.targetLabelAngle = 0; + } else { + rs.labelAngle = rs.sourceLabelAngle = rs.targetLabelAngle = rot.pfValue; + } +}; + +module.exports = BRp; + +/***/ }), +/* 116 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var BRp = {}; + +BRp.getNodeShape = function (node) { + var r = this; + var shape = node.pstyle('shape').value; + + if (node.isParent()) { + if (shape === 'rectangle' || shape === 'roundrectangle' || shape === 'cutrectangle' || shape === 'barrel') { + return shape; + } else { + return 'rectangle'; + } + } + + if (shape === 'polygon') { + var points = node.pstyle('shape-polygon-points').value; + + return r.nodeShapes.makePolygon(points).name; + } + + return shape; +}; + +module.exports = BRp; + +/***/ }), +/* 117 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var BRp = {}; + +BRp.registerCalculationListeners = function () { + var cy = this.cy; + var elesToUpdate = cy.collection(); + var r = this; + + var enqueue = function enqueue(eles, e) { + var dirtyStyleCaches = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + + elesToUpdate.merge(eles); + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + var _p = ele._private; + var rstyle = _p.rstyle; + + if (dirtyStyleCaches) { + rstyle.clean = false; + _p.bbCache = null; + } + + var evts = rstyle.dirtyEvents = rstyle.dirtyEvents || { length: 0 }; + + if (!evts[e.type]) { + evts[e.type] = true; + evts.length++; + } + } + }; + + r.binder(cy) + // nodes + + .on('position.* style.* free.* bounds.*', 'node', function onDirtyModNode(e) { + var node = e.target; + + enqueue(node, e); + enqueue(node.connectedEdges(), e); + }).on('add.*', 'node', function onDirtyAddNode(e) { + var ele = e.target; + + enqueue(ele, e); + }).on('background.*', 'node', function onDirtyBgNode(e) { + var ele = e.target; + + enqueue(ele, e, false); + }) + + // edges + + .on('add.* style.*', 'edge', function onDirtyEdge(e) { + var edge = e.target; + + enqueue(edge, e); + enqueue(edge.parallelEdges(), e); + }).on('remove.*', 'edge', function onDirtyRemoveEdge(e) { + var edge = e.target; + var pEdges = edge.parallelEdges(); + + for (var i = 0; i < pEdges.length; i++) { + var pEdge = pEdges[i]; + + if (!pEdge.removed()) { + enqueue(pEdge, e); + } + } + }) + + // manual dirtying + + .on('dirty.*', 'node', function onDirtyEle(e) { + var ele = e.target; + + enqueue(ele, e); + }); + + var updateEleCalcs = function updateEleCalcs(willDraw) { + if (willDraw) { + var fns = r.onUpdateEleCalcsFns; + + if (fns) { + for (var i = 0; i < fns.length; i++) { + var fn = fns[i]; + + fn(willDraw, elesToUpdate); + } + } + + r.recalculateRenderedStyle(elesToUpdate, false); + + for (var i = 0; i < elesToUpdate.length; i++) { + elesToUpdate[i]._private.rstyle.dirtyEvents = null; + } + + elesToUpdate = cy.collection(); + } + }; + + r.beforeRender(updateEleCalcs, r.beforeRenderPriorities.eleCalcs); +}; + +BRp.onUpdateEleCalcs = function (fn) { + var fns = this.onUpdateEleCalcsFns = this.onUpdateEleCalcsFns || []; + + fns.push(fn); +}; + +BRp.recalculateRenderedStyle = function (eles, useCache) { + var edges = []; + var nodes = []; + + // the renderer can't be used for calcs when destroyed, e.g. ele.boundingBox() + if (this.destroyed) { + return; + } + + // use cache by default for perf + if (useCache === undefined) { + useCache = true; + } + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + var _p = ele._private; + var rstyle = _p.rstyle; + + // only update if dirty and in graph + if (useCache && rstyle.clean || ele.removed()) { + continue; + } + + // only update if not display: none + if (ele.pstyle('display').value === 'none') { + continue; + } + + if (_p.group === 'nodes') { + nodes.push(ele); + } else { + // edges + edges.push(ele); + } + + rstyle.clean = true; + // rstyle.dirtyEvents = null; + } + + // update node data from projections + for (var i = 0; i < nodes.length; i++) { + var ele = nodes[i]; + var _p = ele._private; + var rstyle = _p.rstyle; + var pos = ele.position(); + + this.recalculateNodeLabelProjection(ele); + + rstyle.nodeX = pos.x; + rstyle.nodeY = pos.y; + rstyle.nodeW = ele.pstyle('width').pfValue; + rstyle.nodeH = ele.pstyle('height').pfValue; + } + + this.recalculateEdgeProjections(edges); + + // update edge data from projections + for (var i = 0; i < edges.length; i++) { + var ele = edges[i]; + var _p = ele._private; + var rstyle = _p.rstyle; + var rs = _p.rscratch; + + this.recalculateEdgeLabelProjections(ele); + + // update rstyle positions + rstyle.srcX = rs.arrowStartX; + rstyle.srcY = rs.arrowStartY; + rstyle.tgtX = rs.arrowEndX; + rstyle.tgtY = rs.arrowEndY; + rstyle.midX = rs.midX; + rstyle.midY = rs.midY; + rstyle.labelAngle = rs.labelAngle; + rstyle.sourceLabelAngle = rs.sourceLabelAngle; + rstyle.targetLabelAngle = rs.targetLabelAngle; + } +}; + +module.exports = BRp; + +/***/ }), +/* 118 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var zIndexSort = __webpack_require__(17); + +var BRp = {}; + +BRp.updateCachedGrabbedEles = function () { + var eles = this.cachedZSortedEles; + + if (!eles) { + // just let this be recalculated on the next z sort tick + return; + } + + eles.drag = []; + eles.nondrag = []; + + var grabTargets = []; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + var rs = ele._private.rscratch; + + if (ele.grabbed() && !ele.isParent()) { + grabTargets.push(ele); + } else if (rs.inDragLayer) { + eles.drag.push(ele); + } else { + eles.nondrag.push(ele); + } + } + + // put the grab target nodes last so it's on top of its neighbourhood + for (var i = 0; i < grabTargets.length; i++) { + var ele = grabTargets[i]; + + eles.drag.push(ele); + } +}; + +BRp.invalidateCachedZSortedEles = function () { + this.cachedZSortedEles = null; +}; + +BRp.getCachedZSortedEles = function (forceRecalc) { + if (forceRecalc || !this.cachedZSortedEles) { + //console.time('cachezorder') + + var eles = this.cy.mutableElements().toArray(); + + eles.sort(zIndexSort); + + eles.interactive = eles.filter(function (ele) { + return ele.interactive(); + }); + + this.cachedZSortedEles = eles; + + this.updateCachedGrabbedEles(); + } else { + eles = this.cachedZSortedEles; + } + + return eles; +}; + +module.exports = BRp; + +/***/ }), +/* 119 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var BRp = {}; + +BRp.getCachedImage = function (url, crossOrigin, onLoad) { + var r = this; + var imageCache = r.imageCache = r.imageCache || {}; + var cache = imageCache[url]; + + if (cache) { + if (!cache.image.complete) { + cache.image.addEventListener('load', onLoad); + } + + return cache.image; + } else { + cache = imageCache[url] = imageCache[url] || {}; + + var image = cache.image = new Image(); // eslint-disable-line no-undef + + image.addEventListener('load', onLoad); + image.addEventListener('error', function () { + image.error = true; + }); + + // #1582 safari doesn't load data uris with crossOrigin properly + // https://bugs.webkit.org/show_bug.cgi?id=123978 + var dataUriPrefix = 'data:'; + var isDataUri = url.substring(0, dataUriPrefix.length).toLowerCase() === dataUriPrefix; + if (!isDataUri) { + image.crossOrigin = crossOrigin; // prevent tainted canvas + } + + image.src = url; + + return image; + } +}; + +module.exports = BRp; + +/***/ }), +/* 120 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var util = __webpack_require__(1); +var math = __webpack_require__(2); +var Event = __webpack_require__(16); + +var BRp = {}; + +BRp.registerBinding = function (target, event, handler, useCapture) { + var args = Array.prototype.slice.apply(arguments, [1]); // copy + var b = this.binder(target); + + return b.on.apply(b, args); +}; + +BRp.binder = function (tgt) { + var r = this; + + var tgtIsDom = tgt === window || tgt === document || tgt === document.body || is.domElement(tgt); + + if (r.supportsPassiveEvents == null) { + + // from https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection + var supportsPassive = false; + try { + var opts = Object.defineProperty({}, 'passive', { + get: function get() { + supportsPassive = true; + } + }); + + window.addEventListener('test', null, opts); + } catch (err) {} + + r.supportsPassiveEvents = supportsPassive; + } + + var on = function on(event, handler, useCapture) { + var args = Array.prototype.slice.call(arguments); + + if (tgtIsDom && r.supportsPassiveEvents) { + // replace useCapture w/ opts obj + args[2] = { + capture: useCapture != null ? useCapture : false, + passive: false, + once: false + }; + } + + r.bindings.push({ + target: tgt, + args: args + }); + + (tgt.addEventListener || tgt.on).apply(tgt, args); + + return this; + }; + + return { + on: on, + addEventListener: on, + addListener: on, + bind: on + }; +}; + +BRp.nodeIsDraggable = function (node) { + return node && node.isNode() && !node.locked() && node.grabbable(); +}; + +BRp.nodeIsGrabbable = function (node) { + return this.nodeIsDraggable(node) && node.interactive(); +}; + +BRp.load = function () { + var r = this; + + var triggerEvents = function triggerEvents(target, names, e, props) { + if (target == null) { + target = r.cy; + } + + for (var i = 0; i < names.length; i++) { + var name = names[i]; + + target.emit(util.extend({ originalEvent: e, type: name }, props)); + } + }; + + var isMultSelKeyDown = function isMultSelKeyDown(e) { + return e.shiftKey || e.metaKey || e.ctrlKey; // maybe e.altKey + }; + + var allowPanningPassthrough = function allowPanningPassthrough(down, downs) { + var allowPassthrough = true; + + if (r.cy.hasCompoundNodes() && down && down.isEdge()) { + // a compound node below the edge => no passthrough panning + for (var i = 0; downs && i < downs.length; i++) { + var down = downs[i]; + + if (down.isNode() && down.isParent()) { + allowPassthrough = false; + break; + } + } + } else { + allowPassthrough = true; + } + + return allowPassthrough; + }; + + var getDragListIds = function getDragListIds(opts) { + var listHasId; + + if (opts.addToList && r.cy.hasCompoundNodes()) { + // only needed for compound graphs + if (!opts.addToList.hasId) { + // build ids lookup if doesn't already exist + opts.addToList.hasId = {}; + + for (var i = 0; i < opts.addToList.length; i++) { + var ele = opts.addToList[i]; + + opts.addToList.hasId[ele.id()] = true; + } + } + + listHasId = opts.addToList.hasId; + } + + return listHasId || {}; + }; + + var setGrabbed = function setGrabbed(ele) { + ele[0]._private.grabbed = true; + }; + + var setFreed = function setFreed(ele) { + ele[0]._private.grabbed = false; + }; + + var setInDragLayer = function setInDragLayer(ele) { + ele[0]._private.rscratch.inDragLayer = true; + }; + + var setOutDragLayer = function setOutDragLayer(ele) { + ele[0]._private.rscratch.inDragLayer = false; + }; + + var setGrabTarget = function setGrabTarget(ele) { + ele[0]._private.rscratch.isGrabTarget = true; + }; + + var removeGrabTarget = function removeGrabTarget(ele) { + ele[0]._private.rscratch.isGrabTarget = false; + }; + + var addToDragList = function addToDragList(ele, opts) { + var listHasId = getDragListIds(opts); + + if (!listHasId[ele.id()]) { + opts.addToList.push(ele); + listHasId[ele.id()] = true; + + setGrabbed(ele); + } + }; + + // helper function to determine which child nodes and inner edges + // of a compound node to be dragged as well as the grabbed and selected nodes + var addDescendantsToDrag = function addDescendantsToDrag(node, opts) { + if (!node.cy().hasCompoundNodes()) { + return; + } + + if (opts.inDragLayer == null && opts.addToList == null) { + return; + } // nothing to do + + var innerNodes = node.descendants(); + + if (opts.inDragLayer) { + innerNodes.forEach(setInDragLayer); + innerNodes.connectedEdges().forEach(setInDragLayer); + } + + if (opts.addToList) { + innerNodes.forEach(function (ele) { + addToDragList(ele, opts); + }); + } + }; + + // adds the given nodes and its neighbourhood to the drag layer + var addNodesToDrag = function addNodesToDrag(nodes, opts) { + opts = opts || {}; + + var hasCompoundNodes = nodes.cy().hasCompoundNodes(); + + if (opts.inDragLayer) { + nodes.forEach(setInDragLayer); + + nodes.neighborhood().stdFilter(function (ele) { + return !hasCompoundNodes || ele.isEdge(); + }).forEach(setInDragLayer); + } + + if (opts.addToList) { + nodes.forEach(function (ele) { + addToDragList(ele, opts); + }); + } + + addDescendantsToDrag(nodes, opts); // always add to drag + + // also add nodes and edges related to the topmost ancestor + updateAncestorsInDragLayer(nodes, { + inDragLayer: opts.inDragLayer + }); + + r.updateCachedGrabbedEles(); + }; + + var addNodeToDrag = addNodesToDrag; + + var freeDraggedElements = function freeDraggedElements(grabbedEles) { + if (!grabbedEles) { + return; + } + + grabbedEles.hasId = {}; // clear the id list + + // just go over all elements rather than doing a bunch of (possibly expensive) traversals + r.getCachedZSortedEles().forEach(function (ele) { + setFreed(ele); + setOutDragLayer(ele); + removeGrabTarget(ele); + }); + + r.updateCachedGrabbedEles(); + }; + + // helper function to determine which ancestor nodes and edges should go + // to the drag layer (or should be removed from drag layer). + var updateAncestorsInDragLayer = function updateAncestorsInDragLayer(node, opts) { + + if (opts.inDragLayer == null && opts.addToList == null) { + return; + } // nothing to do + + if (!node.cy().hasCompoundNodes()) { + return; + } + + // find top-level parent + var parent = node.ancestors().orphans(); + + // no parent node: no nodes to add to the drag layer + if (parent.same(node)) { + return; + } + + var nodes = parent.descendants().spawnSelf().merge(parent).unmerge(node).unmerge(node.descendants()); + + var edges = nodes.connectedEdges(); + + if (opts.inDragLayer) { + edges.forEach(setInDragLayer); + nodes.forEach(setInDragLayer); + } + + if (opts.addToList) { + nodes.forEach(function (ele) { + addToDragList(ele, opts); + }); + } + }; + + var blurActiveDomElement = function blurActiveDomElement() { + if (document.activeElement != null && document.activeElement.blur != null) { + document.activeElement.blur(); + } + }; + + var haveMutationsApi = typeof MutationObserver !== 'undefined'; + + // watch for when the cy container is removed from the dom + if (haveMutationsApi) { + r.removeObserver = new MutationObserver(function (mutns) { + // eslint-disable-line no-undef + for (var i = 0; i < mutns.length; i++) { + var mutn = mutns[i]; + var rNodes = mutn.removedNodes; + + if (rNodes) { + for (var j = 0; j < rNodes.length; j++) { + var rNode = rNodes[j]; + + if (rNode === r.container) { + r.destroy(); + break; + } + } + } + } + }); + + if (r.container.parentNode) { + r.removeObserver.observe(r.container.parentNode, { childList: true }); + } + } else { + r.registerBinding(r.container, 'DOMNodeRemoved', function (e) { + r.destroy(); + }); + } + + var onResize = util.debounce(function () { + r.cy.resize(); + }, 100); + + if (haveMutationsApi) { + r.styleObserver = new MutationObserver(onResize); // eslint-disable-line no-undef + + r.styleObserver.observe(r.container, { attributes: true }); + } + + // auto resize + r.registerBinding(window, 'resize', onResize); // eslint-disable-line no-undef + + var forEachUp = function forEachUp(domEle, fn) { + while (domEle != null) { + fn(domEle); + + domEle = domEle.parentNode; + } + }; + + var invalidateCoords = function invalidateCoords() { + r.invalidateContainerClientCoordsCache(); + }; + + forEachUp(r.container, function (domEle) { + r.registerBinding(domEle, 'transitionend', invalidateCoords); + r.registerBinding(domEle, 'animationend', invalidateCoords); + r.registerBinding(domEle, 'scroll', invalidateCoords); + }); + + // stop right click menu from appearing on cy + r.registerBinding(r.container, 'contextmenu', function (e) { + e.preventDefault(); + }); + + var inBoxSelection = function inBoxSelection() { + return r.selection[4] !== 0; + }; + + var eventInContainer = function eventInContainer(e) { + // save cycles if mouse events aren't to be captured + var containerPageCoords = r.findContainerClientCoords(); + var x = containerPageCoords[0]; + var y = containerPageCoords[1]; + var width = containerPageCoords[2]; + var height = containerPageCoords[3]; + + var positions = e.touches ? e.touches : [e]; + var atLeastOnePosInside = false; + + for (var i = 0; i < positions.length; i++) { + var p = positions[i]; + + if (x <= p.clientX && p.clientX <= x + width && y <= p.clientY && p.clientY <= y + height) { + atLeastOnePosInside = true; + break; + } + } + + if (!atLeastOnePosInside) { + return false; + } + + var container = r.container; + var target = e.target; + var tParent = target.parentNode; + var containerIsTarget = false; + + while (tParent) { + if (tParent === container) { + containerIsTarget = true; + break; + } + + tParent = tParent.parentNode; + } + + if (!containerIsTarget) { + return false; + } // if target is outisde cy container, then this event is not for us + + return true; + }; + + // Primary key + r.registerBinding(r.container, 'mousedown', function mousedownHandler(e) { + if (!eventInContainer(e)) { + return; + } + + e.preventDefault(); + + blurActiveDomElement(); + + r.hoverData.capture = true; + r.hoverData.which = e.which; + + var cy = r.cy; + var gpos = [e.clientX, e.clientY]; + var pos = r.projectIntoViewport(gpos[0], gpos[1]); + var select = r.selection; + var nears = r.findNearestElements(pos[0], pos[1], true, false); + var near = nears[0]; + var draggedElements = r.dragData.possibleDragElements; + + r.hoverData.mdownPos = pos; + r.hoverData.mdownGPos = gpos; + + var checkForTaphold = function checkForTaphold() { + r.hoverData.tapholdCancelled = false; + + clearTimeout(r.hoverData.tapholdTimeout); + + r.hoverData.tapholdTimeout = setTimeout(function () { + + if (r.hoverData.tapholdCancelled) { + return; + } else { + var ele = r.hoverData.down; + + if (ele) { + ele.emit({ + originalEvent: e, + type: 'taphold', + position: { x: pos[0], y: pos[1] } + }); + } else { + cy.emit({ + originalEvent: e, + type: 'taphold', + position: { x: pos[0], y: pos[1] } + }); + } + } + }, r.tapholdDuration); + }; + + // Right click button + if (e.which == 3) { + + r.hoverData.cxtStarted = true; + + var cxtEvt = { + originalEvent: e, + type: 'cxttapstart', + position: { x: pos[0], y: pos[1] } + }; + + if (near) { + near.activate(); + near.emit(cxtEvt); + + r.hoverData.down = near; + } else { + cy.emit(cxtEvt); + } + + r.hoverData.downTime = new Date().getTime(); + r.hoverData.cxtDragged = false; + + // Primary button + } else if (e.which == 1) { + + if (near) { + near.activate(); + } + + // Element dragging + { + // If something is under the cursor and it is draggable, prepare to grab it + if (near != null) { + + if (r.nodeIsGrabbable(near)) { + + var makeEvent = function makeEvent(type) { + return { + originalEvent: e, + type: type, + position: { x: pos[0], y: pos[1] } + }; + }; + + var triggerGrab = function triggerGrab(ele) { + ele.emit(makeEvent('grab')); + }; + + setGrabTarget(near); + + if (!near.selected()) { + + draggedElements = r.dragData.possibleDragElements = []; + addNodeToDrag(near, { addToList: draggedElements }); + + near.emit(makeEvent('grabon')).emit(makeEvent('grab')); + } else { + draggedElements = r.dragData.possibleDragElements = []; + + var selectedNodes = cy.$(function (ele) { + return ele.isNode() && ele.selected() && r.nodeIsGrabbable(ele); + }); + + addNodesToDrag(selectedNodes, { addToList: draggedElements }); + + near.emit(makeEvent('grabon')); + + selectedNodes.forEach(triggerGrab); + } + + r.redrawHint('eles', true); + r.redrawHint('drag', true); + } + } + + r.hoverData.down = near; + r.hoverData.downs = nears; + r.hoverData.downTime = new Date().getTime(); + } + + triggerEvents(near, ['mousedown', 'tapstart', 'vmousedown'], e, { + position: { x: pos[0], y: pos[1] } + }); + + if (near == null) { + select[4] = 1; + + r.data.bgActivePosistion = { + x: pos[0], + y: pos[1] + }; + + r.redrawHint('select', true); + + r.redraw(); + } else if (near.isEdge()) { + select[4] = 1; // for future pan + } + + checkForTaphold(); + } + + // Initialize selection box coordinates + select[0] = select[2] = pos[0]; + select[1] = select[3] = pos[1]; + }, false); + + r.registerBinding(window, 'mousemove', function mousemoveHandler(e) { + // eslint-disable-line no-undef + var capture = r.hoverData.capture; + + if (!capture && !eventInContainer(e)) { + return; + } + + var preventDefault = false; + var cy = r.cy; + var zoom = cy.zoom(); + var gpos = [e.clientX, e.clientY]; + var pos = r.projectIntoViewport(gpos[0], gpos[1]); + var mdownPos = r.hoverData.mdownPos; + var mdownGPos = r.hoverData.mdownGPos; + var select = r.selection; + + var near = null; + if (!r.hoverData.draggingEles && !r.hoverData.dragging && !r.hoverData.selecting) { + near = r.findNearestElement(pos[0], pos[1], true, false); + } + var last = r.hoverData.last; + var down = r.hoverData.down; + + var disp = [pos[0] - select[2], pos[1] - select[3]]; + + var draggedElements = r.dragData.possibleDragElements; + + var isOverThresholdDrag; + + if (mdownGPos) { + var dx = gpos[0] - mdownGPos[0]; + var dx2 = dx * dx; + var dy = gpos[1] - mdownGPos[1]; + var dy2 = dy * dy; + var dist2 = dx2 + dy2; + + r.hoverData.isOverThresholdDrag = isOverThresholdDrag = dist2 >= r.desktopTapThreshold2; + } + + var multSelKeyDown = isMultSelKeyDown(e); + + if (isOverThresholdDrag) { + r.hoverData.tapholdCancelled = true; + } + + var updateDragDelta = function updateDragDelta() { + var dragDelta = r.hoverData.dragDelta = r.hoverData.dragDelta || []; + + if (dragDelta.length === 0) { + dragDelta.push(disp[0]); + dragDelta.push(disp[1]); + } else { + dragDelta[0] += disp[0]; + dragDelta[1] += disp[1]; + } + }; + + preventDefault = true; + + triggerEvents(near, ['mousemove', 'vmousemove', 'tapdrag'], e, { + position: { x: pos[0], y: pos[1] } + }); + + var goIntoBoxMode = function goIntoBoxMode() { + r.data.bgActivePosistion = undefined; + + if (!r.hoverData.selecting) { + cy.emit('boxstart'); + } + + select[4] = 1; + r.hoverData.selecting = true; + + r.redrawHint('select', true); + r.redraw(); + }; + + // trigger context drag if rmouse down + if (r.hoverData.which === 3) { + // but only if over threshold + if (isOverThresholdDrag) { + var cxtEvt = { + originalEvent: e, + type: 'cxtdrag', + position: { x: pos[0], y: pos[1] } + }; + + if (down) { + down.emit(cxtEvt); + } else { + cy.emit(cxtEvt); + } + + r.hoverData.cxtDragged = true; + + if (!r.hoverData.cxtOver || near !== r.hoverData.cxtOver) { + + if (r.hoverData.cxtOver) { + r.hoverData.cxtOver.emit({ + originalEvent: e, + type: 'cxtdragout', + position: { x: pos[0], y: pos[1] } + }); + } + + r.hoverData.cxtOver = near; + + if (near) { + near.emit({ + originalEvent: e, + type: 'cxtdragover', + position: { x: pos[0], y: pos[1] } + }); + } + } + } + + // Check if we are drag panning the entire graph + } else if (r.hoverData.dragging) { + preventDefault = true; + + if (cy.panningEnabled() && cy.userPanningEnabled()) { + var deltaP; + + if (r.hoverData.justStartedPan) { + var mdPos = r.hoverData.mdownPos; + + deltaP = { + x: (pos[0] - mdPos[0]) * zoom, + y: (pos[1] - mdPos[1]) * zoom + }; + + r.hoverData.justStartedPan = false; + } else { + deltaP = { + x: disp[0] * zoom, + y: disp[1] * zoom + }; + } + + cy.panBy(deltaP); + + r.hoverData.dragged = true; + } + + // Needs reproject due to pan changing viewport + pos = r.projectIntoViewport(e.clientX, e.clientY); + + // Checks primary button down & out of time & mouse not moved much + } else if (select[4] == 1 && (down == null || down.isEdge())) { + + if (isOverThresholdDrag) { + + if (!r.hoverData.dragging && cy.boxSelectionEnabled() && (multSelKeyDown || !cy.panningEnabled() || !cy.userPanningEnabled())) { + goIntoBoxMode(); + } else if (!r.hoverData.selecting && cy.panningEnabled() && cy.userPanningEnabled()) { + var allowPassthrough = allowPanningPassthrough(down, r.hoverData.downs); + + if (allowPassthrough) { + r.hoverData.dragging = true; + r.hoverData.justStartedPan = true; + select[4] = 0; + + r.data.bgActivePosistion = math.array2point(mdownPos); + + r.redrawHint('select', true); + r.redraw(); + } + } + + if (down && down.isEdge() && down.active()) { + down.unactivate(); + } + } + } else { + if (down && down.isEdge() && down.active()) { + down.unactivate(); + } + + if ((!down || !down.grabbed()) && near != last) { + + if (last) { + triggerEvents(last, ['mouseout', 'tapdragout'], e, { + position: { x: pos[0], y: pos[1] } + }); + } + + if (near) { + triggerEvents(near, ['mouseover', 'tapdragover'], e, { + position: { x: pos[0], y: pos[1] } + }); + } + + r.hoverData.last = near; + } + + if (down) { + + if (isOverThresholdDrag) { + // then we can take action + + if (cy.boxSelectionEnabled() && multSelKeyDown) { + // then selection overrides + if (down && down.grabbed()) { + freeDraggedElements(draggedElements); + + down.emit('free'); + } + + goIntoBoxMode(); + } else if (down && down.grabbed() && r.nodeIsDraggable(down)) { + // drag node + var justStartedDrag = !r.dragData.didDrag; + + if (justStartedDrag) { + r.redrawHint('eles', true); + } + + r.dragData.didDrag = true; // indicate that we actually did drag the node + + var toTrigger = []; + + // now, add the elements to the drag layer if not done already + if (!r.hoverData.draggingEles) { + addNodesToDrag(cy.collection(draggedElements), { inDragLayer: true }); + } + + for (var i = 0; i < draggedElements.length; i++) { + var dEle = draggedElements[i]; + + // Locked nodes not draggable, as well as non-visible nodes + if (r.nodeIsDraggable(dEle) && dEle.grabbed()) { + var dPos = dEle.position(); + + toTrigger.push(dEle); + + if (is.number(disp[0]) && is.number(disp[1])) { + dPos.x += disp[0]; + dPos.y += disp[1]; + + if (justStartedDrag) { + var dragDelta = r.hoverData.dragDelta; + + if (dragDelta && is.number(dragDelta[0]) && is.number(dragDelta[1])) { + dPos.x += dragDelta[0]; + dPos.y += dragDelta[1]; + } + } + } + } + } + + r.hoverData.draggingEles = true; + + var tcol = cy.collection(toTrigger); + + tcol.dirtyCompoundBoundsCache(); + tcol.emit('position drag'); + + r.redrawHint('drag', true); + r.redraw(); + } + } else { + // otherwise save drag delta for when we actually start dragging so the relative grab pos is constant + updateDragDelta(); + } + } + + // prevent the dragging from triggering text selection on the page + preventDefault = true; + } + + select[2] = pos[0];select[3] = pos[1]; + + if (preventDefault) { + if (e.stopPropagation) e.stopPropagation(); + if (e.preventDefault) e.preventDefault(); + return false; + } + }, false); + + r.registerBinding(window, 'mouseup', function mouseupHandler(e) { + // eslint-disable-line no-undef + var capture = r.hoverData.capture; + if (!capture) { + return; + } + r.hoverData.capture = false; + + var cy = r.cy;var pos = r.projectIntoViewport(e.clientX, e.clientY);var select = r.selection; + var near = r.findNearestElement(pos[0], pos[1], true, false); + var draggedElements = r.dragData.possibleDragElements;var down = r.hoverData.down; + var multSelKeyDown = isMultSelKeyDown(e); + + if (r.data.bgActivePosistion) { + r.redrawHint('select', true); + r.redraw(); + } + + r.hoverData.tapholdCancelled = true; + + r.data.bgActivePosistion = undefined; // not active bg now + + if (down) { + down.unactivate(); + } + + if (r.hoverData.which === 3) { + var cxtEvt = { + originalEvent: e, + type: 'cxttapend', + position: { x: pos[0], y: pos[1] } + }; + + if (down) { + down.emit(cxtEvt); + } else { + cy.emit(cxtEvt); + } + + if (!r.hoverData.cxtDragged) { + var cxtTap = { + originalEvent: e, + type: 'cxttap', + position: { x: pos[0], y: pos[1] } + }; + + if (down) { + down.emit(cxtTap); + } else { + cy.emit(cxtTap); + } + } + + r.hoverData.cxtDragged = false; + r.hoverData.which = null; + } else if (r.hoverData.which === 1) { + + // Deselect all elements if nothing is currently under the mouse cursor and we aren't dragging something + if (down == null && // not mousedown on node + !r.dragData.didDrag // didn't move the node around + && !r.hoverData.selecting // not box selection + && !r.hoverData.dragged // didn't pan + && !isMultSelKeyDown(e)) { + + cy.$(function (ele) { + return ele.selected(); + }).unselect(); + + if (draggedElements.length > 0) { + r.redrawHint('eles', true); + } + + r.dragData.possibleDragElements = draggedElements = []; + } + + triggerEvents(near, ['mouseup', 'tapend', 'vmouseup'], e, { + position: { x: pos[0], y: pos[1] } + }); + + if (!r.dragData.didDrag // didn't move a node around + && !r.hoverData.dragged // didn't pan + && !r.hoverData.selecting // not box selection + && !r.hoverData.isOverThresholdDrag // didn't move too much + ) { + triggerEvents(down, ['click', 'tap', 'vclick'], e, { + position: { x: pos[0], y: pos[1] } + }); + } + + // Single selection + if (near == down && !r.dragData.didDrag && !r.hoverData.selecting) { + if (near != null && near._private.selectable) { + + if (r.hoverData.dragging) { + // if panning, don't change selection state + } else if (cy.selectionType() === 'additive' || multSelKeyDown) { + if (near.selected()) { + near.unselect(); + } else { + near.select(); + } + } else { + if (!multSelKeyDown) { + cy.$(':selected').unmerge(near).unselect(); + near.select(); + } + } + + r.redrawHint('eles', true); + } + } + + if (r.hoverData.selecting) { + var box = cy.collection(r.getAllInBox(select[0], select[1], select[2], select[3])); + + r.redrawHint('select', true); + + if (box.length > 0) { + r.redrawHint('eles', true); + } + + cy.emit('boxend'); + + var eleWouldBeSelected = function eleWouldBeSelected(ele) { + return ele.selectable() && !ele.selected(); + }; + + if (cy.selectionType() === 'additive') { + box.emit('box').stdFilter(eleWouldBeSelected).select().emit('boxselect'); + } else { + if (!multSelKeyDown) { + cy.$(':selected').unmerge(box).unselect(); + } + + box.emit('box').stdFilter(eleWouldBeSelected).select().emit('boxselect'); + } + + // always need redraw in case eles unselectable + r.redraw(); + } + + // Cancel drag pan + if (r.hoverData.dragging) { + r.hoverData.dragging = false; + + r.redrawHint('select', true); + r.redrawHint('eles', true); + + r.redraw(); + } + + if (!select[4]) { + r.redrawHint('drag', true); + r.redrawHint('eles', true); + + var downWasGrabbed = down && down.grabbed(); + + freeDraggedElements(draggedElements); + + if (downWasGrabbed) { + down.emit('free'); + } + } + } // else not right mouse + + select[4] = 0;r.hoverData.down = null; + + r.hoverData.cxtStarted = false; + r.hoverData.draggingEles = false; + r.hoverData.selecting = false; + r.hoverData.isOverThresholdDrag = false; + r.dragData.didDrag = false; + r.hoverData.dragged = false; + r.hoverData.dragDelta = []; + r.hoverData.mdownPos = null; + r.hoverData.mdownGPos = null; + }, false); + + var wheelHandler = function wheelHandler(e) { + + if (r.scrollingPage) { + return; + } // while scrolling, ignore wheel-to-zoom + + var cy = r.cy; + var pos = r.projectIntoViewport(e.clientX, e.clientY); + var rpos = [pos[0] * cy.zoom() + cy.pan().x, pos[1] * cy.zoom() + cy.pan().y]; + + if (r.hoverData.draggingEles || r.hoverData.dragging || r.hoverData.cxtStarted || inBoxSelection()) { + // if pan dragging or cxt dragging, wheel movements make no zoom + e.preventDefault(); + return; + } + + if (cy.panningEnabled() && cy.userPanningEnabled() && cy.zoomingEnabled() && cy.userZoomingEnabled()) { + e.preventDefault(); + + r.data.wheelZooming = true; + clearTimeout(r.data.wheelTimeout); + r.data.wheelTimeout = setTimeout(function () { + r.data.wheelZooming = false; + + r.redrawHint('eles', true); + r.redraw(); + }, 150); + + var diff; + + if (e.deltaY != null) { + diff = e.deltaY / -250; + } else if (e.wheelDeltaY != null) { + diff = e.wheelDeltaY / 1000; + } else { + diff = e.wheelDelta / 1000; + } + + diff = diff * r.wheelSensitivity; + + var needsWheelFix = e.deltaMode === 1; + if (needsWheelFix) { + // fixes slow wheel events on ff/linux and ff/windows + diff *= 33; + } + + cy.zoom({ + level: cy.zoom() * Math.pow(10, diff), + renderedPosition: { x: rpos[0], y: rpos[1] } + }); + } + }; + + // Functions to help with whether mouse wheel should trigger zooming + // -- + r.registerBinding(r.container, 'wheel', wheelHandler, true); + + // disable nonstandard wheel events + // r.registerBinding(r.container, 'mousewheel', wheelHandler, true); + // r.registerBinding(r.container, 'DOMMouseScroll', wheelHandler, true); + // r.registerBinding(r.container, 'MozMousePixelScroll', wheelHandler, true); // older firefox + + r.registerBinding(window, 'scroll', function scrollHandler(e) { + // eslint-disable-line no-undef + r.scrollingPage = true; + + clearTimeout(r.scrollingPageTimeout); + r.scrollingPageTimeout = setTimeout(function () { + r.scrollingPage = false; + }, 250); + }, true); + + // Functions to help with handling mouseout/mouseover on the Cytoscape container + // Handle mouseout on Cytoscape container + r.registerBinding(r.container, 'mouseout', function mouseOutHandler(e) { + var pos = r.projectIntoViewport(e.clientX, e.clientY); + + r.cy.emit({ + originalEvent: e, + type: 'mouseout', + position: { x: pos[0], y: pos[1] } + }); + }, false); + + r.registerBinding(r.container, 'mouseover', function mouseOverHandler(e) { + var pos = r.projectIntoViewport(e.clientX, e.clientY); + + r.cy.emit({ + originalEvent: e, + type: 'mouseover', + position: { x: pos[0], y: pos[1] } + }); + }, false); + + var f1x1, f1y1, f2x1, f2y1; // starting points for pinch-to-zoom + var distance1, distance1Sq; // initial distance between finger 1 and finger 2 for pinch-to-zoom + var center1, modelCenter1; // center point on start pinch to zoom + var offsetLeft, offsetTop; + var containerWidth, containerHeight; + var twoFingersStartInside; + + var distance = function distance(x1, y1, x2, y2) { + return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); + }; + + var distanceSq = function distanceSq(x1, y1, x2, y2) { + return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1); + }; + + var touchstartHandler; + r.registerBinding(r.container, 'touchstart', touchstartHandler = function touchstartHandler(e) { + if (!eventInContainer(e)) { + return; + } + + blurActiveDomElement(); + + r.touchData.capture = true; + r.data.bgActivePosistion = undefined; + + var cy = r.cy; + var now = r.touchData.now; + var earlier = r.touchData.earlier; + + if (e.touches[0]) { + var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);now[0] = pos[0];now[1] = pos[1]; + } + if (e.touches[1]) { + var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);now[2] = pos[0];now[3] = pos[1]; + } + if (e.touches[2]) { + var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);now[4] = pos[0];now[5] = pos[1]; + } + + // record starting points for pinch-to-zoom + if (e.touches[1]) { + + freeDraggedElements(r.dragData.touchDragEles); + + var offsets = r.findContainerClientCoords(); + offsetLeft = offsets[0]; + offsetTop = offsets[1]; + containerWidth = offsets[2]; + containerHeight = offsets[3]; + + f1x1 = e.touches[0].clientX - offsetLeft; + f1y1 = e.touches[0].clientY - offsetTop; + + f2x1 = e.touches[1].clientX - offsetLeft; + f2y1 = e.touches[1].clientY - offsetTop; + + twoFingersStartInside = 0 <= f1x1 && f1x1 <= containerWidth && 0 <= f2x1 && f2x1 <= containerWidth && 0 <= f1y1 && f1y1 <= containerHeight && 0 <= f2y1 && f2y1 <= containerHeight; + + var pan = cy.pan(); + var zoom = cy.zoom(); + + distance1 = distance(f1x1, f1y1, f2x1, f2y1); + distance1Sq = distanceSq(f1x1, f1y1, f2x1, f2y1); + center1 = [(f1x1 + f2x1) / 2, (f1y1 + f2y1) / 2]; + modelCenter1 = [(center1[0] - pan.x) / zoom, (center1[1] - pan.y) / zoom]; + + // consider context tap + var cxtDistThreshold = 200; + var cxtDistThresholdSq = cxtDistThreshold * cxtDistThreshold; + if (distance1Sq < cxtDistThresholdSq && !e.touches[2]) { + + var near1 = r.findNearestElement(now[0], now[1], true, true); + var near2 = r.findNearestElement(now[2], now[3], true, true); + + if (near1 && near1.isNode()) { + near1.activate().emit({ + originalEvent: e, + type: 'cxttapstart', + position: { x: now[0], y: now[1] } + }); + r.touchData.start = near1; + } else if (near2 && near2.isNode()) { + near2.activate().emit({ + originalEvent: e, + type: 'cxttapstart', + position: { x: now[0], y: now[1] } + }); + r.touchData.start = near2; + } else { + cy.emit({ + originalEvent: e, + type: 'cxttapstart', + position: { x: now[0], y: now[1] } + }); + } + + if (r.touchData.start) { + r.touchData.start._private.grabbed = false; + } + r.touchData.cxt = true; + r.touchData.cxtDragged = false; + r.data.bgActivePosistion = undefined; + + r.redraw(); + return; + } + } + + if (e.touches[2]) { + // ignore + } else if (e.touches[1]) { + // ignore + } else if (e.touches[0]) { + var nears = r.findNearestElements(now[0], now[1], true, true); + var near = nears[0]; + + if (near != null) { + near.activate(); + + r.touchData.start = near; + r.touchData.starts = nears; + + if (r.nodeIsGrabbable(near)) { + + var draggedEles = r.dragData.touchDragEles = []; + var selectedNodes = null; + + r.redrawHint('eles', true); + r.redrawHint('drag', true); + + if (near.selected()) { + // reset drag elements, since near will be added again + + selectedNodes = cy.$(function (ele) { + return ele.selected() && r.nodeIsGrabbable(ele); + }); + + addNodesToDrag(selectedNodes, { addToList: draggedEles }); + } else { + addNodeToDrag(near, { addToList: draggedEles }); + } + + setGrabTarget(near); + + var makeEvent = function makeEvent(type) { + return { + originalEvent: e, + type: type, + position: { x: now[0], y: now[1] } + }; + }; + + near.emit(makeEvent('grabon')); + + if (selectedNodes) { + selectedNodes.forEach(function (n) { + n.emit(makeEvent('grab')); + }); + } else { + near.emit(makeEvent('grab')); + } + } + } + + triggerEvents(near, ['touchstart', 'tapstart', 'vmousedown'], e, { + position: { x: now[0], y: now[1] } + }); + + if (near == null) { + r.data.bgActivePosistion = { + x: pos[0], + y: pos[1] + }; + + r.redrawHint('select', true); + r.redraw(); + } + + // Tap, taphold + // ----- + + r.touchData.singleTouchMoved = false; + r.touchData.singleTouchStartTime = +new Date(); + + clearTimeout(r.touchData.tapholdTimeout); + r.touchData.tapholdTimeout = setTimeout(function () { + if (r.touchData.singleTouchMoved === false && !r.pinching // if pinching, then taphold unselect shouldn't take effect + && !r.touchData.selecting // box selection shouldn't allow taphold through + ) { + triggerEvents(r.touchData.start, ['taphold'], e, { + position: { x: now[0], y: now[1] } + }); + + if (!r.touchData.start) { + cy.$(':selected').unselect(); + } + } + }, r.tapholdDuration); + } + + if (e.touches.length >= 1) { + var sPos = r.touchData.startPosition = []; + + for (var i = 0; i < now.length; i++) { + sPos[i] = earlier[i] = now[i]; + } + + var touch0 = e.touches[0]; + + r.touchData.startGPosition = [touch0.clientX, touch0.clientY]; + } + }, false); + + var touchmoveHandler; + r.registerBinding(window, 'touchmove', touchmoveHandler = function touchmoveHandler(e) { + // eslint-disable-line no-undef + var capture = r.touchData.capture; + + if (!capture && !eventInContainer(e)) { + return; + } + + var select = r.selection; + var cy = r.cy; + var now = r.touchData.now; + var earlier = r.touchData.earlier; + var zoom = cy.zoom(); + + if (e.touches[0]) { + var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);now[0] = pos[0];now[1] = pos[1]; + } + if (e.touches[1]) { + var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);now[2] = pos[0];now[3] = pos[1]; + } + if (e.touches[2]) { + var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);now[4] = pos[0];now[5] = pos[1]; + } + + var startGPos = r.touchData.startGPosition; + var isOverThresholdDrag; + + if (capture && e.touches[0] && startGPos) { + var disp = [];for (var j = 0; j < now.length; j++) { + disp[j] = now[j] - earlier[j]; + } + var dx = e.touches[0].clientX - startGPos[0]; + var dx2 = dx * dx; + var dy = e.touches[0].clientY - startGPos[1]; + var dy2 = dy * dy; + var dist2 = dx2 + dy2; + + isOverThresholdDrag = dist2 >= r.touchTapThreshold2; + } + + // context swipe cancelling + if (capture && r.touchData.cxt) { + e.preventDefault(); + + var f1x2 = e.touches[0].clientX - offsetLeft, + f1y2 = e.touches[0].clientY - offsetTop; + var f2x2 = e.touches[1].clientX - offsetLeft, + f2y2 = e.touches[1].clientY - offsetTop; + // var distance2 = distance( f1x2, f1y2, f2x2, f2y2 ); + var distance2Sq = distanceSq(f1x2, f1y2, f2x2, f2y2); + var factorSq = distance2Sq / distance1Sq; + + var distThreshold = 150; + var distThresholdSq = distThreshold * distThreshold; + var factorThreshold = 1.5; + var factorThresholdSq = factorThreshold * factorThreshold; + + // cancel ctx gestures if the distance b/t the fingers increases + if (factorSq >= factorThresholdSq || distance2Sq >= distThresholdSq) { + r.touchData.cxt = false; + + r.data.bgActivePosistion = undefined; + + r.redrawHint('select', true); + + var cxtEvt = { + originalEvent: e, + type: 'cxttapend', + position: { x: now[0], y: now[1] } + }; + + if (r.touchData.start) { + r.touchData.start.unactivate().emit(cxtEvt); + + r.touchData.start = null; + } else { + cy.emit(cxtEvt); + } + } + } + + // context swipe + if (capture && r.touchData.cxt) { + var cxtEvt = { + originalEvent: e, + type: 'cxtdrag', + position: { x: now[0], y: now[1] } + }; + r.data.bgActivePosistion = undefined; + r.redrawHint('select', true); + + if (r.touchData.start) { + r.touchData.start.emit(cxtEvt); + } else { + cy.emit(cxtEvt); + } + + if (r.touchData.start) { + r.touchData.start._private.grabbed = false; + } + r.touchData.cxtDragged = true; + + var near = r.findNearestElement(now[0], now[1], true, true); + + if (!r.touchData.cxtOver || near !== r.touchData.cxtOver) { + + if (r.touchData.cxtOver) { + r.touchData.cxtOver.emit({ + originalEvent: e, + type: 'cxtdragout', + position: { x: now[0], y: now[1] } + }); + } + + r.touchData.cxtOver = near; + + if (near) { + near.emit({ + originalEvent: e, + type: 'cxtdragover', + position: { x: now[0], y: now[1] } + }); + } + } + + // box selection + } else if (capture && e.touches[2] && cy.boxSelectionEnabled()) { + e.preventDefault(); + + r.data.bgActivePosistion = undefined; + + this.lastThreeTouch = +new Date(); + + if (!r.touchData.selecting) { + cy.emit('boxstart'); + } + + r.touchData.selecting = true; + + r.redrawHint('select', true); + + if (!select || select.length === 0 || select[0] === undefined) { + select[0] = (now[0] + now[2] + now[4]) / 3; + select[1] = (now[1] + now[3] + now[5]) / 3; + select[2] = (now[0] + now[2] + now[4]) / 3 + 1; + select[3] = (now[1] + now[3] + now[5]) / 3 + 1; + } else { + select[2] = (now[0] + now[2] + now[4]) / 3; + select[3] = (now[1] + now[3] + now[5]) / 3; + } + + select[4] = 1; + r.touchData.selecting = true; + + r.redraw(); + + // pinch to zoom + } else if (capture && e.touches[1] && cy.zoomingEnabled() && cy.panningEnabled() && cy.userZoomingEnabled() && cy.userPanningEnabled()) { + // two fingers => pinch to zoom + e.preventDefault(); + + r.data.bgActivePosistion = undefined; + r.redrawHint('select', true); + + var draggedEles = r.dragData.touchDragEles; + if (draggedEles) { + r.redrawHint('drag', true); + + for (var i = 0; i < draggedEles.length; i++) { + var de_p = draggedEles[i]._private; + + de_p.grabbed = false; + de_p.rscratch.inDragLayer = false; + } + } + + // (x2, y2) for fingers 1 and 2 + var f1x2 = e.touches[0].clientX - offsetLeft, + f1y2 = e.touches[0].clientY - offsetTop; + var f2x2 = e.touches[1].clientX - offsetLeft, + f2y2 = e.touches[1].clientY - offsetTop; + + var distance2 = distance(f1x2, f1y2, f2x2, f2y2); + // var distance2Sq = distanceSq( f1x2, f1y2, f2x2, f2y2 ); + // var factor = Math.sqrt( distance2Sq ) / Math.sqrt( distance1Sq ); + var factor = distance2 / distance1; + + if (twoFingersStartInside) { + // delta finger1 + var df1x = f1x2 - f1x1; + var df1y = f1y2 - f1y1; + + // delta finger 2 + var df2x = f2x2 - f2x1; + var df2y = f2y2 - f2y1; + + // translation is the normalised vector of the two fingers movement + // i.e. so pinching cancels out and moving together pans + var tx = (df1x + df2x) / 2; + var ty = (df1y + df2y) / 2; + + // adjust factor by the speed multiplier + // var speed = 1.5; + // if( factor > 1 ){ + // factor = (factor - 1) * speed + 1; + // } else { + // factor = 1 - (1 - factor) * speed; + // } + + // now calculate the zoom + var zoom1 = cy.zoom(); + var zoom2 = zoom1 * factor; + var pan1 = cy.pan(); + + // the model center point converted to the current rendered pos + var ctrx = modelCenter1[0] * zoom1 + pan1.x; + var ctry = modelCenter1[1] * zoom1 + pan1.y; + + var pan2 = { + x: -zoom2 / zoom1 * (ctrx - pan1.x - tx) + ctrx, + y: -zoom2 / zoom1 * (ctry - pan1.y - ty) + ctry + }; + + // remove dragged eles + if (r.touchData.start && r.touchData.start.active()) { + var draggedEles = r.dragData.touchDragEles; + + freeDraggedElements(draggedEles); + + r.redrawHint('drag', true); + r.redrawHint('eles', true); + + r.touchData.start.unactivate().emit('free'); + } + + cy.viewport({ + zoom: zoom2, + pan: pan2, + cancelOnFailedZoom: true + }); + + distance1 = distance2; + f1x1 = f1x2; + f1y1 = f1y2; + f2x1 = f2x2; + f2y1 = f2y2; + + r.pinching = true; + } + + // Re-project + if (e.touches[0]) { + var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);now[0] = pos[0];now[1] = pos[1]; + } + if (e.touches[1]) { + var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);now[2] = pos[0];now[3] = pos[1]; + } + if (e.touches[2]) { + var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);now[4] = pos[0];now[5] = pos[1]; + } + } else if (e.touches[0]) { + var start = r.touchData.start; + var last = r.touchData.last; + var near; + + if (!r.hoverData.draggingEles && !r.swipePanning) { + near = r.findNearestElement(now[0], now[1], true, true); + } + + if (capture && start != null) { + e.preventDefault(); + } + + // dragging nodes + if (capture && start != null && r.nodeIsDraggable(start)) { + + if (isOverThresholdDrag) { + // then dragging can happen + var draggedEles = r.dragData.touchDragEles; + var justStartedDrag = !r.dragData.didDrag; + + if (justStartedDrag) { + addNodesToDrag(cy.collection(draggedEles), { inDragLayer: true }); + } + + for (var k = 0; k < draggedEles.length; k++) { + var draggedEle = draggedEles[k]; + + if (r.nodeIsDraggable(draggedEle) && draggedEle.grabbed()) { + r.dragData.didDrag = true; + var dPos = draggedEle.position(); + + if (is.number(disp[0]) && is.number(disp[1])) { + dPos.x += disp[0]; + dPos.y += disp[1]; + } + + if (justStartedDrag) { + r.redrawHint('eles', true); + + var dragDelta = r.touchData.dragDelta; + + if (dragDelta && is.number(dragDelta[0]) && is.number(dragDelta[1])) { + dPos.x += dragDelta[0]; + dPos.y += dragDelta[1]; + } + } + } + } + + var tcol = cy.collection(draggedEles); + + tcol.dirtyCompoundBoundsCache(); + tcol.emit('position drag'); + + r.hoverData.draggingEles = true; + + r.redrawHint('drag', true); + + if (r.touchData.startPosition[0] == earlier[0] && r.touchData.startPosition[1] == earlier[1]) { + + r.redrawHint('eles', true); + } + + r.redraw(); + } else { + // otherise keep track of drag delta for later + var dragDelta = r.touchData.dragDelta = r.touchData.dragDelta || []; + + if (dragDelta.length === 0) { + dragDelta.push(disp[0]); + dragDelta.push(disp[1]); + } else { + dragDelta[0] += disp[0]; + dragDelta[1] += disp[1]; + } + } + } + + // touchmove + { + triggerEvents(start || near, ['touchmove', 'tapdrag', 'vmousemove'], e, { + position: { x: now[0], y: now[1] } + }); + + if ((!start || !start.grabbed()) && near != last) { + if (last) { + last.emit({ originalEvent: e, type: 'tapdragout', position: { x: now[0], y: now[1] } }); + } + if (near) { + near.emit({ originalEvent: e, type: 'tapdragover', position: { x: now[0], y: now[1] } }); + } + } + + r.touchData.last = near; + } + + // check to cancel taphold + if (capture) { + for (var i = 0; i < now.length; i++) { + if (now[i] && r.touchData.startPosition[i] && isOverThresholdDrag) { + + r.touchData.singleTouchMoved = true; + } + } + } + + // panning + if (capture && (start == null || start.isEdge()) && cy.panningEnabled() && cy.userPanningEnabled()) { + + var allowPassthrough = allowPanningPassthrough(start, r.touchData.starts); + + if (allowPassthrough) { + e.preventDefault(); + + if (r.swipePanning) { + cy.panBy({ + x: disp[0] * zoom, + y: disp[1] * zoom + }); + } else if (isOverThresholdDrag) { + r.swipePanning = true; + + cy.panBy({ + x: dx * zoom, + y: dy * zoom + }); + + if (start) { + start.unactivate(); + + if (!r.data.bgActivePosistion) { + r.data.bgActivePosistion = math.array2point(r.touchData.startPosition); + } + + r.redrawHint('select', true); + + r.touchData.start = null; + } + } + } + + // Re-project + var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY); + now[0] = pos[0];now[1] = pos[1]; + } + } + + for (var j = 0; j < now.length; j++) { + earlier[j] = now[j]; + } + //r.redraw(); + + // the active bg indicator should be removed when making a swipe that is neither for dragging nodes or panning + if (capture && e.touches.length > 0 && !r.hoverData.draggingEles && !r.swipePanning && r.data.bgActivePosistion != null) { + r.data.bgActivePosistion = undefined; + r.redrawHint('select', true); + r.redraw(); + } + }, false); + var touchcancelHandler; + r.registerBinding(window, 'touchcancel', touchcancelHandler = function touchcancelHandler(e) { + // eslint-disable-line no-undef + var start = r.touchData.start; + + r.touchData.capture = false; + + if (start) { + start.unactivate(); + } + }); + + var touchendHandler; + r.registerBinding(window, 'touchend', touchendHandler = function touchendHandler(e) { + // eslint-disable-line no-undef + var start = r.touchData.start; + + var capture = r.touchData.capture; + + if (capture) { + if (e.touches.length === 0) { + r.touchData.capture = false; + } + + e.preventDefault(); + } else { + return; + } + + var select = r.selection; + + r.swipePanning = false; + r.hoverData.draggingEles = false; + + var cy = r.cy; + var zoom = cy.zoom(); + var now = r.touchData.now; + var earlier = r.touchData.earlier; + + if (e.touches[0]) { + var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);now[0] = pos[0];now[1] = pos[1]; + } + if (e.touches[1]) { + var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);now[2] = pos[0];now[3] = pos[1]; + } + if (e.touches[2]) { + var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);now[4] = pos[0];now[5] = pos[1]; + } + + if (start) { + start.unactivate(); + } + + var ctxTapend; + if (r.touchData.cxt) { + ctxTapend = { + originalEvent: e, + type: 'cxttapend', + position: { x: now[0], y: now[1] } + }; + + if (start) { + start.emit(ctxTapend); + } else { + cy.emit(ctxTapend); + } + + if (!r.touchData.cxtDragged) { + var ctxTap = { + originalEvent: e, + type: 'cxttap', + position: { x: now[0], y: now[1] } + }; + + if (start) { + start.emit(ctxTap); + } else { + cy.emit(ctxTap); + } + } + + if (r.touchData.start) { + r.touchData.start._private.grabbed = false; + } + r.touchData.cxt = false; + r.touchData.start = null; + + r.redraw(); + return; + } + + // no more box selection if we don't have three fingers + if (!e.touches[2] && cy.boxSelectionEnabled() && r.touchData.selecting) { + r.touchData.selecting = false; + + var box = cy.collection(r.getAllInBox(select[0], select[1], select[2], select[3])); + + select[0] = undefined; + select[1] = undefined; + select[2] = undefined; + select[3] = undefined; + select[4] = 0; + + r.redrawHint('select', true); + + cy.emit('boxend'); + + var eleWouldBeSelected = function eleWouldBeSelected(ele) { + return ele.selectable() && !ele.selected(); + }; + + box.emit('box').stdFilter(eleWouldBeSelected).select().emit('boxselect'); + + if (box.nonempty()) { + r.redrawHint('eles', true); + } + + r.redraw(); + } + + if (start != null) { + start.unactivate(); + } + + if (e.touches[2]) { + r.data.bgActivePosistion = undefined; + r.redrawHint('select', true); + } else if (e.touches[1]) { + // ignore + } else if (e.touches[0]) { + // ignore + + // Last touch released + } else if (!e.touches[0]) { + + r.data.bgActivePosistion = undefined; + r.redrawHint('select', true); + + var draggedEles = r.dragData.touchDragEles; + + if (start != null) { + + var startWasGrabbed = start._private.grabbed; + + freeDraggedElements(draggedEles); + + r.redrawHint('drag', true); + r.redrawHint('eles', true); + + if (startWasGrabbed) { + start.emit('free'); + } + + triggerEvents(start, ['touchend', 'tapend', 'vmouseup', 'tapdragout'], e, { + position: { x: now[0], y: now[1] } + }); + + start.unactivate(); + + r.touchData.start = null; + } else { + var near = r.findNearestElement(now[0], now[1], true, true); + + triggerEvents(near, ['touchend', 'tapend', 'vmouseup', 'tapdragout'], e, { + position: { x: now[0], y: now[1] } + }); + } + + var dx = r.touchData.startPosition[0] - now[0]; + var dx2 = dx * dx; + var dy = r.touchData.startPosition[1] - now[1]; + var dy2 = dy * dy; + var dist2 = dx2 + dy2; + var rdist2 = dist2 * zoom * zoom; + + // Prepare to select the currently touched node, only if it hasn't been dragged past a certain distance + if (start != null && !r.dragData.didDrag // didn't drag nodes around + && start._private.selectable && rdist2 < r.touchTapThreshold2 && !r.pinching // pinch to zoom should not affect selection + ) { + + if (cy.selectionType() === 'single') { + cy.$(':selected').unmerge(start).unselect(); + start.select(); + } else { + if (start.selected()) { + start.unselect(); + } else { + start.select(); + } + } + + r.redrawHint('eles', true); + } + + // Tap event, roughly same as mouse click event for touch + if (!r.touchData.singleTouchMoved) { + triggerEvents(start, ['tap', 'vclick'], e, { + position: { x: now[0], y: now[1] } + }); + } + + r.touchData.singleTouchMoved = true; + } + + for (var j = 0; j < now.length; j++) { + earlier[j] = now[j]; + } + + r.dragData.didDrag = false; // reset for next mousedown + + if (e.touches.length === 0) { + r.touchData.dragDelta = []; + r.touchData.startPosition = null; + r.touchData.startGPosition = null; + } + + if (e.touches.length < 2) { + r.pinching = false; + r.redrawHint('eles', true); + r.redraw(); + } + + //r.redraw(); + }, false); + + // fallback compatibility layer for ms pointer events + if (typeof TouchEvent === 'undefined') { + + var pointers = []; + + var makeTouch = function makeTouch(e) { + return { + clientX: e.clientX, + clientY: e.clientY, + force: 1, + identifier: e.pointerId, + pageX: e.pageX, + pageY: e.pageY, + radiusX: e.width / 2, + radiusY: e.height / 2, + screenX: e.screenX, + screenY: e.screenY, + target: e.target + }; + }; + + var makePointer = function makePointer(e) { + return { + event: e, + touch: makeTouch(e) + }; + }; + + var addPointer = function addPointer(e) { + pointers.push(makePointer(e)); + }; + + var removePointer = function removePointer(e) { + for (var i = 0; i < pointers.length; i++) { + var p = pointers[i]; + + if (p.event.pointerId === e.pointerId) { + pointers.splice(i, 1); + return; + } + } + }; + + var updatePointer = function updatePointer(e) { + var p = pointers.filter(function (p) { + return p.event.pointerId === e.pointerId; + })[0]; + + p.event = e; + p.touch = makeTouch(e); + }; + + var addTouchesToEvent = function addTouchesToEvent(e) { + e.touches = pointers.map(function (p) { + return p.touch; + }); + }; + + var pointerIsMouse = function pointerIsMouse(e) { + return e.pointerType === 'mouse' || e.pointerType === 4; + }; + + r.registerBinding(r.container, 'pointerdown', function (e) { + if (pointerIsMouse(e)) { + return; + } // mouse already handled + + e.preventDefault(); + + addPointer(e); + + addTouchesToEvent(e); + touchstartHandler(e); + }); + + r.registerBinding(r.container, 'pointerup', function (e) { + if (pointerIsMouse(e)) { + return; + } // mouse already handled + + removePointer(e); + + addTouchesToEvent(e); + touchendHandler(e); + }); + + r.registerBinding(r.container, 'pointercancel', function (e) { + if (pointerIsMouse(e)) { + return; + } // mouse already handled + + removePointer(e); + + addTouchesToEvent(e); + touchcancelHandler(e); + }); + + r.registerBinding(r.container, 'pointermove', function (e) { + if (pointerIsMouse(e)) { + return; + } // mouse already handled + + e.preventDefault(); + + updatePointer(e); + + addTouchesToEvent(e); + touchmoveHandler(e); + }); + } +}; + +module.exports = BRp; + +/***/ }), +/* 121 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var math = __webpack_require__(2); + +var BRp = {}; + +BRp.generatePolygon = function (name, points) { + return this.nodeShapes[name] = { + renderer: this, + + name: name, + + points: points, + + draw: function draw(context, centerX, centerY, width, height) { + this.renderer.nodeShapeImpl('polygon', context, centerX, centerY, width, height, this.points); + }, + + intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { + return math.polygonIntersectLine(x, y, this.points, nodeX, nodeY, width / 2, height / 2, padding); + }, + + checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { + return math.pointInsidePolygon(x, y, this.points, centerX, centerY, width, height, [0, -1], padding); + } + }; +}; + +BRp.generateEllipse = function () { + return this.nodeShapes['ellipse'] = { + renderer: this, + + name: 'ellipse', + + draw: function draw(context, centerX, centerY, width, height) { + this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height); + }, + + intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { + return math.intersectLineEllipse(x, y, nodeX, nodeY, width / 2 + padding, height / 2 + padding); + }, + + checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { + return math.checkInEllipse(x, y, width, height, centerX, centerY, padding); + } + }; +}; + +BRp.generateRoundRectangle = function () { + return this.nodeShapes['roundrectangle'] = { + renderer: this, + + name: 'roundrectangle', + + points: math.generateUnitNgonPointsFitToSquare(4, 0), + + draw: function draw(context, centerX, centerY, width, height) { + this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height); + }, + + intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { + return math.roundRectangleIntersectLine(x, y, nodeX, nodeY, width, height, padding); + }, + + checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { + + var cornerRadius = math.getRoundRectangleRadius(width, height); + var diam = cornerRadius * 2; + + // Check hBox + if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - diam, [0, -1], padding)) { + return true; + } + + // Check vBox + if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width - diam, height, [0, -1], padding)) { + return true; + } + + // Check top left quarter circle + if (math.checkInEllipse(x, y, diam, diam, centerX - width / 2 + cornerRadius, centerY - height / 2 + cornerRadius, padding)) { + + return true; + } + + // Check top right quarter circle + if (math.checkInEllipse(x, y, diam, diam, centerX + width / 2 - cornerRadius, centerY - height / 2 + cornerRadius, padding)) { + + return true; + } + + // Check bottom right quarter circle + if (math.checkInEllipse(x, y, diam, diam, centerX + width / 2 - cornerRadius, centerY + height / 2 - cornerRadius, padding)) { + + return true; + } + + // Check bottom left quarter circle + if (math.checkInEllipse(x, y, diam, diam, centerX - width / 2 + cornerRadius, centerY + height / 2 - cornerRadius, padding)) { + + return true; + } + + return false; + } + }; +}; + +BRp.generateCutRectangle = function () { + return this.nodeShapes['cutrectangle'] = { + renderer: this, + + name: 'cutrectangle', + + cornerLength: math.getCutRectangleCornerLength(), + + points: math.generateUnitNgonPointsFitToSquare(4, 0), + + draw: function draw(context, centerX, centerY, width, height) { + this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height); + }, + + generateCutTrianglePts: function generateCutTrianglePts(width, height, centerX, centerY) { + var cl = this.cornerLength; + var hh = height / 2; + var hw = width / 2; + var xBegin = centerX - hw; + var xEnd = centerX + hw; + var yBegin = centerY - hh; + var yEnd = centerY + hh; + + // points are in clockwise order, inner (imaginary) triangle pt on [4, 5] + return { + topLeft: [xBegin, yBegin + cl, xBegin + cl, yBegin, xBegin + cl, yBegin + cl], + topRight: [xEnd - cl, yBegin, xEnd, yBegin + cl, xEnd - cl, yBegin + cl], + bottomRight: [xEnd, yEnd - cl, xEnd - cl, yEnd, xEnd - cl, yEnd - cl], + bottomLeft: [xBegin + cl, yEnd, xBegin, yEnd - cl, xBegin + cl, yEnd - cl] + }; + }, + + intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { + var cPts = this.generateCutTrianglePts(width + 2 * padding, height + 2 * padding, nodeX, nodeY); + var pts = [].concat.apply([], [cPts.topLeft.splice(0, 4), cPts.topRight.splice(0, 4), cPts.bottomRight.splice(0, 4), cPts.bottomLeft.splice(0, 4)]); + + return math.polygonIntersectLine(x, y, pts, nodeX, nodeY); + }, + + checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { + // Check hBox + if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - 2 * this.cornerLength, [0, -1], padding)) { + return true; + } + + // Check vBox + if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width - 2 * this.cornerLength, height, [0, -1], padding)) { + return true; + } + var cutTrianglePts = this.generateCutTrianglePts(width, height, centerX, centerY); + return math.pointInsidePolygonPoints(x, y, cutTrianglePts.topLeft) || math.pointInsidePolygonPoints(x, y, cutTrianglePts.topRight) || math.pointInsidePolygonPoints(x, y, cutTrianglePts.bottomRight) || math.pointInsidePolygonPoints(x, y, cutTrianglePts.bottomLeft); + } + + }; +}; + +BRp.generateBarrel = function () { + return this.nodeShapes['barrel'] = { + renderer: this, + + name: 'barrel', + + points: math.generateUnitNgonPointsFitToSquare(4, 0), + + draw: function draw(context, centerX, centerY, width, height) { + this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height); + }, + + intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { + // use two fixed t values for the bezier curve approximation + + var t0 = 0.15; + var t1 = 0.5; + var t2 = 0.85; + + var bPts = this.generateBarrelBezierPts(width + 2 * padding, height + 2 * padding, nodeX, nodeY); + + var approximateBarrelCurvePts = function approximateBarrelCurvePts(pts) { + // approximate curve pts based on the two t values + var m0 = math.qbezierPtAt({ x: pts[0], y: pts[1] }, { x: pts[2], y: pts[3] }, { x: pts[4], y: pts[5] }, t0); + var m1 = math.qbezierPtAt({ x: pts[0], y: pts[1] }, { x: pts[2], y: pts[3] }, { x: pts[4], y: pts[5] }, t1); + var m2 = math.qbezierPtAt({ x: pts[0], y: pts[1] }, { x: pts[2], y: pts[3] }, { x: pts[4], y: pts[5] }, t2); + + return [pts[0], pts[1], m0.x, m0.y, m1.x, m1.y, m2.x, m2.y, pts[4], pts[5]]; + }; + + var pts = [].concat(approximateBarrelCurvePts(bPts.topLeft), approximateBarrelCurvePts(bPts.topRight), approximateBarrelCurvePts(bPts.bottomRight), approximateBarrelCurvePts(bPts.bottomLeft)); + + return math.polygonIntersectLine(x, y, pts, nodeX, nodeY); + }, + + generateBarrelBezierPts: function generateBarrelBezierPts(width, height, centerX, centerY) { + var hh = height / 2; + var hw = width / 2; + var xBegin = centerX - hw; + var xEnd = centerX + hw; + var yBegin = centerY - hh; + var yEnd = centerY + hh; + + var curveConstants = math.getBarrelCurveConstants(width, height); + var hOffset = curveConstants.heightOffset; + var wOffset = curveConstants.widthOffset; + var ctrlPtXOffset = curveConstants.ctrlPtOffsetPct * width; + + // points are in clockwise order, inner (imaginary) control pt on [4, 5] + var pts = { + topLeft: [xBegin, yBegin + hOffset, xBegin + ctrlPtXOffset, yBegin, xBegin + wOffset, yBegin], + topRight: [xEnd - wOffset, yBegin, xEnd - ctrlPtXOffset, yBegin, xEnd, yBegin + hOffset], + bottomRight: [xEnd, yEnd - hOffset, xEnd - ctrlPtXOffset, yEnd, xEnd - wOffset, yEnd], + bottomLeft: [xBegin + wOffset, yEnd, xBegin + ctrlPtXOffset, yEnd, xBegin, yEnd - hOffset] + }; + + pts.topLeft.isTop = true; + pts.topRight.isTop = true; + pts.bottomLeft.isBottom = true; + pts.bottomRight.isBottom = true; + + return pts; + }, + + checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { + + var curveConstants = math.getBarrelCurveConstants(width, height); + var hOffset = curveConstants.heightOffset; + var wOffset = curveConstants.widthOffset; + + // Check hBox + if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - 2 * hOffset, [0, -1], padding)) { + return true; + } + + // Check vBox + if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width - 2 * wOffset, height, [0, -1], padding)) { + return true; + } + + var barrelCurvePts = this.generateBarrelBezierPts(width, height, centerX, centerY); + + var getCurveT = function getCurveT(x, y, curvePts) { + var x0 = curvePts[4]; + var x1 = curvePts[2]; + var x2 = curvePts[0]; + var y0 = curvePts[5]; + // var y1 = curvePts[ 3 ]; + var y2 = curvePts[1]; + + var xMin = Math.min(x0, x2); + var xMax = Math.max(x0, x2); + var yMin = Math.min(y0, y2); + var yMax = Math.max(y0, y2); + + if (xMin <= x && x <= xMax && yMin <= y && y <= yMax) { + var coeff = math.bezierPtsToQuadCoeff(x0, x1, x2); + var roots = math.solveQuadratic(coeff[0], coeff[1], coeff[2], x); + + var validRoots = roots.filter(function (r) { + return 0 <= r && r <= 1; + }); + + if (validRoots.length > 0) { + return validRoots[0]; + } + } + return null; + }; + + var curveRegions = Object.keys(barrelCurvePts); + for (var i = 0; i < curveRegions.length; i++) { + var corner = curveRegions[i]; + var cornerPts = barrelCurvePts[corner]; + var t = getCurveT(x, y, cornerPts); + + if (t == null) { + continue; + } + + var y0 = cornerPts[5]; + var y1 = cornerPts[3]; + var y2 = cornerPts[1]; + var bezY = math.qbezierAt(y0, y1, y2, t); + + if (cornerPts.isTop && bezY <= y) { + return true; + } + if (cornerPts.isBottom && y <= bezY) { + return true; + } + } + return false; + } + }; +}; + +BRp.generateBottomRoundrectangle = function () { + return this.nodeShapes['bottomroundrectangle'] = { + renderer: this, + + name: 'bottomroundrectangle', + + points: math.generateUnitNgonPointsFitToSquare(4, 0), + + draw: function draw(context, centerX, centerY, width, height) { + this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height); + }, + + intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { + var topStartX = nodeX - (width / 2 + padding); + var topStartY = nodeY - (height / 2 + padding); + var topEndY = topStartY; + var topEndX = nodeX + (width / 2 + padding); + + var topIntersections = math.finiteLinesIntersect(x, y, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false); + if (topIntersections.length > 0) { + return topIntersections; + } + + return math.roundRectangleIntersectLine(x, y, nodeX, nodeY, width, height, padding); + }, + + checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { + + var cornerRadius = math.getRoundRectangleRadius(width, height); + var diam = 2 * cornerRadius; + + // Check hBox + if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - diam, [0, -1], padding)) { + return true; + } + + // Check vBox + if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width - diam, height, [0, -1], padding)) { + return true; + } + + // check non-rounded top side + var outerWidth = width / 2 + 2 * padding; + var outerHeight = height / 2 + 2 * padding; + var points = [centerX - outerWidth, centerY - outerHeight, centerX - outerWidth, centerY, centerX + outerWidth, centerY, centerX + outerWidth, centerY - outerHeight]; + if (math.pointInsidePolygonPoints(x, y, points)) { + return true; + } + + // Check bottom right quarter circle + if (math.checkInEllipse(x, y, diam, diam, centerX + width / 2 - cornerRadius, centerY + height / 2 - cornerRadius, padding)) { + + return true; + } + + // Check bottom left quarter circle + if (math.checkInEllipse(x, y, diam, diam, centerX - width / 2 + cornerRadius, centerY + height / 2 - cornerRadius, padding)) { + + return true; + } + + return false; + } + }; +}; + +BRp.registerNodeShapes = function () { + var nodeShapes = this.nodeShapes = {}; + var renderer = this; + + this.generateEllipse(); + + this.generatePolygon('triangle', math.generateUnitNgonPointsFitToSquare(3, 0)); + + this.generatePolygon('rectangle', math.generateUnitNgonPointsFitToSquare(4, 0)); + nodeShapes['square'] = nodeShapes['rectangle']; + + this.generateRoundRectangle(); + + this.generateCutRectangle(); + + this.generateBarrel(); + + this.generateBottomRoundrectangle(); + + this.generatePolygon('diamond', [0, 1, 1, 0, 0, -1, -1, 0]); + + this.generatePolygon('pentagon', math.generateUnitNgonPointsFitToSquare(5, 0)); + + this.generatePolygon('hexagon', math.generateUnitNgonPointsFitToSquare(6, 0)); + + this.generatePolygon('heptagon', math.generateUnitNgonPointsFitToSquare(7, 0)); + + this.generatePolygon('octagon', math.generateUnitNgonPointsFitToSquare(8, 0)); + + var star5Points = new Array(20); + { + var outerPoints = math.generateUnitNgonPoints(5, 0); + var innerPoints = math.generateUnitNgonPoints(5, Math.PI / 5); + + // Outer radius is 1; inner radius of star is smaller + var innerRadius = 0.5 * (3 - Math.sqrt(5)); + innerRadius *= 1.57; + + for (var i = 0; i < innerPoints.length / 2; i++) { + innerPoints[i * 2] *= innerRadius; + innerPoints[i * 2 + 1] *= innerRadius; + } + + for (var i = 0; i < 20 / 4; i++) { + star5Points[i * 4] = outerPoints[i * 2]; + star5Points[i * 4 + 1] = outerPoints[i * 2 + 1]; + + star5Points[i * 4 + 2] = innerPoints[i * 2]; + star5Points[i * 4 + 3] = innerPoints[i * 2 + 1]; + } + } + + star5Points = math.fitPolygonToSquare(star5Points); + + this.generatePolygon('star', star5Points); + + this.generatePolygon('vee', [-1, -1, 0, -0.333, 1, -1, 0, 1]); + + this.generatePolygon('rhomboid', [-1, -1, 0.333, -1, 1, 1, -0.333, 1]); + + this.generatePolygon('concavehexagon', [-1, -0.95, -0.75, 0, -1, 0.95, 1, 0.95, 0.75, 0, 1, -0.95]); + + this.generatePolygon('tag', [-1, -1, 0.25, -1, 1, 0, 0.25, 1, -1, 1]); + + nodeShapes.makePolygon = function (points) { + + // use caching on user-specified polygons so they are as fast as native shapes + + var key = points.join('$'); + var name = 'polygon-' + key; + var shape; + + if (shape = this[name]) { + // got cached shape + return shape; + } + + // create and cache new shape + return renderer.generatePolygon(name, points); + }; +}; + +module.exports = BRp; + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); + +var BRp = {}; + +BRp.timeToRender = function () { + return this.redrawTotalTime / this.redrawCount; +}; + +BRp.redraw = function (options) { + options = options || util.staticEmptyObject(); + + var r = this; + + if (r.averageRedrawTime === undefined) { + r.averageRedrawTime = 0; + } + if (r.lastRedrawTime === undefined) { + r.lastRedrawTime = 0; + } + if (r.lastDrawTime === undefined) { + r.lastDrawTime = 0; + } + + r.requestedFrame = true; + r.renderOptions = options; +}; + +BRp.beforeRender = function (fn, priority) { + // the renderer can't add tick callbacks when destroyed + if (this.destroyed) { + return; + } + + priority = priority || 0; + + var cbs = this.beforeRenderCallbacks; + + cbs.push({ fn: fn, priority: priority }); + + // higher priority callbacks executed first + cbs.sort(function (a, b) { + return b.priority - a.priority; + }); +}; + +var beforeRenderCallbacks = function beforeRenderCallbacks(r, willDraw, startTime) { + var cbs = r.beforeRenderCallbacks; + + for (var i = 0; i < cbs.length; i++) { + cbs[i].fn(willDraw, startTime); + } +}; + +BRp.startRenderLoop = function () { + var r = this; + + if (r.renderLoopStarted) { + return; + } else { + r.renderLoopStarted = true; + } + + var renderFn = function renderFn(requestTime) { + if (r.destroyed) { + return; + } + + if (r.requestedFrame && !r.skipFrame) { + beforeRenderCallbacks(r, true, requestTime); + + var startTime = util.performanceNow(); + + r.render(r.renderOptions); + + var endTime = r.lastDrawTime = util.performanceNow(); + + if (r.averageRedrawTime === undefined) { + r.averageRedrawTime = endTime - startTime; + } + + if (r.redrawCount === undefined) { + r.redrawCount = 0; + } + + r.redrawCount++; + + if (r.redrawTotalTime === undefined) { + r.redrawTotalTime = 0; + } + + var duration = endTime - startTime; + + r.redrawTotalTime += duration; + r.lastRedrawTime = duration; + + // use a weighted average with a bias from the previous average so we don't spike so easily + r.averageRedrawTime = r.averageRedrawTime / 2 + duration / 2; + + r.requestedFrame = false; + } else { + beforeRenderCallbacks(r, false, requestTime); + } + + r.skipFrame = false; + + util.requestAnimationFrame(renderFn); + }; + + util.requestAnimationFrame(renderFn); +}; + +module.exports = BRp; + +/***/ }), +/* 123 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* +The canvas renderer was written by Yue Dong. + +Modifications tracked on Github. +*/ + +var util = __webpack_require__(1); +var is = __webpack_require__(0); +var ElementTextureCache = __webpack_require__(124); +var LayeredTextureCache = __webpack_require__(125); + +var CR = CanvasRenderer; +var CRp = CanvasRenderer.prototype; + +CRp.CANVAS_LAYERS = 3; +// +CRp.SELECT_BOX = 0; +CRp.DRAG = 1; +CRp.NODE = 2; + +CRp.BUFFER_COUNT = 3; +// +CRp.TEXTURE_BUFFER = 0; +CRp.MOTIONBLUR_BUFFER_NODE = 1; +CRp.MOTIONBLUR_BUFFER_DRAG = 2; + +function CanvasRenderer(options) { + var r = this; + + r.data = { + canvases: new Array(CRp.CANVAS_LAYERS), + contexts: new Array(CRp.CANVAS_LAYERS), + canvasNeedsRedraw: new Array(CRp.CANVAS_LAYERS), + + bufferCanvases: new Array(CRp.BUFFER_COUNT), + bufferContexts: new Array(CRp.CANVAS_LAYERS) + }; + + var tapHlOff = '-webkit-tap-highlight-color: rgba(0,0,0,0);'; + + r.data.canvasContainer = document.createElement('div'); // eslint-disable-line no-undef + var containerStyle = r.data.canvasContainer.style; + r.data.canvasContainer.setAttribute('style', tapHlOff); + containerStyle.position = 'relative'; + containerStyle.zIndex = '0'; + containerStyle.overflow = 'hidden'; + + var container = options.cy.container(); + container.appendChild(r.data.canvasContainer); + + if ((container.getAttribute('style') || '').indexOf(tapHlOff) < 0) { + container.setAttribute('style', (container.getAttribute('style') || '') + tapHlOff); + } + + for (var i = 0; i < CRp.CANVAS_LAYERS; i++) { + var canvas = r.data.canvases[i] = document.createElement('canvas'); // eslint-disable-line no-undef + r.data.contexts[i] = canvas.getContext('2d'); + canvas.setAttribute('style', '-webkit-user-select: none; -moz-user-select: -moz-none; user-select: none; -webkit-tap-highlight-color: rgba(0,0,0,0); outline-style: none;' + (is.ms() ? ' -ms-touch-action: none; touch-action: none; ' : '')); + canvas.style.position = 'absolute'; + canvas.setAttribute('data-id', 'layer' + i); + canvas.style.zIndex = String(CRp.CANVAS_LAYERS - i); + r.data.canvasContainer.appendChild(canvas); + + r.data.canvasNeedsRedraw[i] = false; + } + r.data.topCanvas = r.data.canvases[0]; + + r.data.canvases[CRp.NODE].setAttribute('data-id', 'layer' + CRp.NODE + '-node'); + r.data.canvases[CRp.SELECT_BOX].setAttribute('data-id', 'layer' + CRp.SELECT_BOX + '-selectbox'); + r.data.canvases[CRp.DRAG].setAttribute('data-id', 'layer' + CRp.DRAG + '-drag'); + + for (var i = 0; i < CRp.BUFFER_COUNT; i++) { + r.data.bufferCanvases[i] = document.createElement('canvas'); // eslint-disable-line no-undef + r.data.bufferContexts[i] = r.data.bufferCanvases[i].getContext('2d'); + r.data.bufferCanvases[i].style.position = 'absolute'; + r.data.bufferCanvases[i].setAttribute('data-id', 'buffer' + i); + r.data.bufferCanvases[i].style.zIndex = String(-i - 1); + r.data.bufferCanvases[i].style.visibility = 'hidden'; + //r.data.canvasContainer.appendChild(r.data.bufferCanvases[i]); + } + + r.pathsEnabled = true; + + r.data.eleTxrCache = new ElementTextureCache(r); + r.data.lyrTxrCache = new LayeredTextureCache(r, r.data.eleTxrCache); + + r.onUpdateEleCalcs(function invalidateTextureCaches(willDraw, eles) { + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + var rs = ele._private.rstyle; + var de = rs.dirtyEvents; + + if (ele.isNode() && de && de.length === 1 && de['position']) { + // then keep cached ele texture + } else { + r.data.eleTxrCache.invalidateElement(ele); + + // NB this block of code should not be ported to 3.3 (unstable branch). + // - This check is unneccesary in 3.3 as caches will be stored without respect to opacity. + // - This fix may result in lowered performance for compound graphs. + // - Ref : Opacity of child node is not updated for certain zoom levels after parent opacity is overriden #2078 + if (ele.isParent() && de['style']) { + var op1 = rs.prevParentOpacity; + var op2 = ele.pstyle('opacity').pfValue; + + rs.prevParentOpacity = op2; + + if (op1 !== op2) { + var descs = ele.descendants(); + + for (var j = 0; j < descs.length; j++) { + r.data.eleTxrCache.invalidateElement(descs[j]); + } + } + } + } + } + + if (eles.length > 0) { + r.data.lyrTxrCache.invalidateElements(eles); + } + }); +} + +CRp.redrawHint = function (group, bool) { + var r = this; + + switch (group) { + case 'eles': + r.data.canvasNeedsRedraw[CRp.NODE] = bool; + break; + case 'drag': + r.data.canvasNeedsRedraw[CRp.DRAG] = bool; + break; + case 'select': + r.data.canvasNeedsRedraw[CRp.SELECT_BOX] = bool; + break; + } +}; + +// whether to use Path2D caching for drawing +var pathsImpld = typeof Path2D !== 'undefined'; + +CRp.path2dEnabled = function (on) { + if (on === undefined) { + return this.pathsEnabled; + } + + this.pathsEnabled = on ? true : false; +}; + +CRp.usePaths = function () { + return pathsImpld && this.pathsEnabled; +}; + +[__webpack_require__(126), __webpack_require__(127), __webpack_require__(128), __webpack_require__(129), __webpack_require__(130), __webpack_require__(131), __webpack_require__(132), __webpack_require__(133), __webpack_require__(134), __webpack_require__(135)].forEach(function (props) { + util.extend(CRp, props); +}); + +module.exports = CR; + +/***/ }), +/* 124 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var math = __webpack_require__(2); +var util = __webpack_require__(1); +var Heap = __webpack_require__(9); +var defs = __webpack_require__(19); + +var minTxrH = 25; // the size of the texture cache for small height eles (special case) +var txrStepH = 50; // the min size of the regular cache, and the size it increases with each step up +var minLvl = -4; // when scaling smaller than that we don't need to re-render +var maxLvl = 2; // when larger than this scale just render directly (caching is not helpful) +var maxZoom = 3.99; // beyond this zoom level, layered textures are not used +var eleTxrSpacing = 8; // spacing between elements on textures to avoid blitting overlaps +var defTxrWidth = 1024; // default/minimum texture width +var maxTxrW = 1024; // the maximum width of a texture +var maxTxrH = 1024; // the maximum height of a texture +var minUtility = 0.5; // if usage of texture is less than this, it is retired +var maxFullness = 0.8; // fullness of texture after which queue removal is checked +var maxFullnessChecks = 10; // dequeued after this many checks +var allowEdgeTxrCaching = false; // whether edges can be cached as textures (TODO maybe better on if webgl supported?) +var allowParentTxrCaching = false; // whether parent nodes can be cached as textures (TODO maybe better on if webgl supported?) +var deqCost = 0.15; // % of add'l rendering cost allowed for dequeuing ele caches each frame +var deqAvgCost = 0.1; // % of add'l rendering cost compared to average overall redraw time +var deqNoDrawCost = 0.9; // % of avg frame time that can be used for dequeueing when not drawing +var deqFastCost = 0.9; // % of frame time to be used when >60fps +var deqRedrawThreshold = 100; // time to batch redraws together from dequeueing to allow more dequeueing calcs to happen in the meanwhile +var maxDeqSize = 1; // number of eles to dequeue and render at higher texture in each batch + +var getTxrReasons = { + dequeue: 'dequeue', + downscale: 'downscale', + highQuality: 'highQuality' +}; + +var ElementTextureCache = function ElementTextureCache(renderer) { + var self = this; + + self.renderer = renderer; + self.onDequeues = []; + + self.setupDequeueing(); +}; + +var ETCp = ElementTextureCache.prototype; + +ETCp.reasons = getTxrReasons; + +// the list of textures in which new subtextures for elements can be placed +ETCp.getTextureQueue = function (txrH) { + var self = this; + self.eleImgCaches = self.eleImgCaches || {}; + + return self.eleImgCaches[txrH] = self.eleImgCaches[txrH] || []; +}; + +// the list of usused textures which can be recycled (in use in texture queue) +ETCp.getRetiredTextureQueue = function (txrH) { + var self = this; + + var rtxtrQs = self.eleImgCaches.retired = self.eleImgCaches.retired || {}; + var rtxtrQ = rtxtrQs[txrH] = rtxtrQs[txrH] || []; + + return rtxtrQ; +}; + +// queue of element draw requests at different scale levels +ETCp.getElementQueue = function () { + var self = this; + + var q = self.eleCacheQueue = self.eleCacheQueue || new Heap(function (a, b) { + return b.reqs - a.reqs; + }); + + return q; +}; + +// queue of element draw requests at different scale levels (element id lookup) +ETCp.getElementIdToQueue = function () { + var self = this; + + var id2q = self.eleIdToCacheQueue = self.eleIdToCacheQueue || {}; + + return id2q; +}; + +ETCp.getElement = function (ele, bb, pxRatio, lvl, reason) { + var self = this; + var r = this.renderer; + var rs = ele._private.rscratch; + var zoom = r.cy.zoom(); + + if (bb.w === 0 || bb.h === 0 || !ele.visible()) { + return null; + } + + if (lvl == null) { + lvl = Math.ceil(math.log2(zoom * pxRatio)); + } + + if (lvl < minLvl) { + lvl = minLvl; + } else if (zoom >= maxZoom || lvl > maxLvl) { + return null; + } + + var scale = Math.pow(2, lvl); + var eleScaledH = bb.h * scale; + var eleScaledW = bb.w * scale; + var caches = rs.imgCaches = rs.imgCaches || {}; + var eleCache = caches[lvl]; + + if (eleCache) { + return eleCache; + } + + var txrH; // which texture height this ele belongs to + + if (eleScaledH <= minTxrH) { + txrH = minTxrH; + } else if (eleScaledH <= txrStepH) { + txrH = txrStepH; + } else { + txrH = Math.ceil(eleScaledH / txrStepH) * txrStepH; + } + + if (eleScaledH > maxTxrH || eleScaledW > maxTxrW || !allowEdgeTxrCaching && ele.isEdge() || !allowParentTxrCaching && ele.isParent()) { + return null; // caching large elements is not efficient + } + + var txrQ = self.getTextureQueue(txrH); + + // first try the second last one in case it has space at the end + var txr = txrQ[txrQ.length - 2]; + + var addNewTxr = function addNewTxr() { + return self.recycleTexture(txrH, eleScaledW) || self.addTexture(txrH, eleScaledW); + }; + + // try the last one if there is no second last one + if (!txr) { + txr = txrQ[txrQ.length - 1]; + } + + // if the last one doesn't exist, we need a first one + if (!txr) { + txr = addNewTxr(); + } + + // if there's no room in the current texture, we need a new one + if (txr.width - txr.usedWidth < eleScaledW) { + txr = addNewTxr(); + } + + var scaledLabelShown = r.eleTextBiggerThanMin(ele, scale); + var scalableFrom = function scalableFrom(otherCache) { + return otherCache && otherCache.scaledLabelShown === scaledLabelShown; + }; + + var deqing = reason && reason === getTxrReasons.dequeue; + var highQualityReq = reason && reason === getTxrReasons.highQuality; + var downscaleReq = reason && reason === getTxrReasons.downscale; + + var higherCache; // the nearest cache with a higher level + for (var l = lvl + 1; l <= maxLvl; l++) { + var c = caches[l]; + + if (c) { + higherCache = c;break; + } + } + + var oneUpCache = higherCache && higherCache.level === lvl + 1 ? higherCache : null; + + var downscale = function downscale() { + txr.context.drawImage(oneUpCache.texture.canvas, oneUpCache.x, 0, oneUpCache.width, oneUpCache.height, txr.usedWidth, 0, eleScaledW, eleScaledH); + }; + + // reset ele area in texture + txr.context.setTransform(1, 0, 0, 1, 0, 0); + txr.context.clearRect(txr.usedWidth, 0, eleScaledW, txrH); + + if (scalableFrom(oneUpCache)) { + // then we can relatively cheaply rescale the existing image w/o rerendering + downscale(); + } else if (scalableFrom(higherCache)) { + // then use the higher cache for now and queue the next level down + // to cheaply scale towards the smaller level + + if (highQualityReq) { + for (var l = higherCache.level; l > lvl; l--) { + oneUpCache = self.getElement(ele, bb, pxRatio, l, getTxrReasons.downscale); + } + + downscale(); + } else { + self.queueElement(ele, higherCache.level - 1); + + return higherCache; + } + } else { + + var lowerCache; // the nearest cache with a lower level + if (!deqing && !highQualityReq && !downscaleReq) { + for (var l = lvl - 1; l >= minLvl; l--) { + var c = caches[l]; + + if (c) { + lowerCache = c;break; + } + } + } + + if (scalableFrom(lowerCache)) { + // then use the lower quality cache for now and queue the better one for later + + self.queueElement(ele, lvl); + + return lowerCache; + } + + txr.context.translate(txr.usedWidth, 0); + txr.context.scale(scale, scale); + + r.drawElement(txr.context, ele, bb, scaledLabelShown); + + txr.context.scale(1 / scale, 1 / scale); + txr.context.translate(-txr.usedWidth, 0); + } + + eleCache = caches[lvl] = { + ele: ele, + x: txr.usedWidth, + texture: txr, + level: lvl, + scale: scale, + width: eleScaledW, + height: eleScaledH, + scaledLabelShown: scaledLabelShown + }; + + txr.usedWidth += Math.ceil(eleScaledW + eleTxrSpacing); + + txr.eleCaches.push(eleCache); + + self.checkTextureFullness(txr); + + return eleCache; +}; + +ETCp.invalidateElement = function (ele) { + var self = this; + var caches = ele._private.rscratch.imgCaches; + + if (caches) { + for (var lvl = minLvl; lvl <= maxLvl; lvl++) { + var cache = caches[lvl]; + + if (cache) { + var txr = cache.texture; + + // remove space from the texture it belongs to + txr.invalidatedWidth += cache.width; + + // remove refs with the element + caches[lvl] = null; + util.removeFromArray(txr.eleCaches, cache); + + // remove from queue since the old req was for the old state + self.removeFromQueue(ele); + + // might have to remove the entire texture if it's not efficiently using its space + self.checkTextureUtility(txr); + } + } + } +}; + +ETCp.checkTextureUtility = function (txr) { + // invalidate all entries in the cache if the cache size is small + if (txr.invalidatedWidth >= minUtility * txr.width) { + this.retireTexture(txr); + } +}; + +ETCp.checkTextureFullness = function (txr) { + // if texture has been mostly filled and passed over several times, remove + // it from the queue so we don't need to waste time looking at it to put new things + + var self = this; + var txrQ = self.getTextureQueue(txr.height); + + if (txr.usedWidth / txr.width > maxFullness && txr.fullnessChecks >= maxFullnessChecks) { + util.removeFromArray(txrQ, txr); + } else { + txr.fullnessChecks++; + } +}; + +ETCp.retireTexture = function (txr) { + var self = this; + var txrH = txr.height; + var txrQ = self.getTextureQueue(txrH); + + // retire the texture from the active / searchable queue: + + util.removeFromArray(txrQ, txr); + + txr.retired = true; + + // remove the refs from the eles to the caches: + + var eleCaches = txr.eleCaches; + + for (var i = 0; i < eleCaches.length; i++) { + var eleCache = eleCaches[i]; + var ele = eleCache.ele; + var lvl = eleCache.level; + var imgCaches = ele._private.rscratch.imgCaches; + + if (imgCaches) { + imgCaches[lvl] = null; + } + } + + util.clearArray(eleCaches); + + // add the texture to a retired queue so it can be recycled in future: + + var rtxtrQ = self.getRetiredTextureQueue(txrH); + + rtxtrQ.push(txr); +}; + +ETCp.addTexture = function (txrH, minW) { + var self = this; + var txrQ = self.getTextureQueue(txrH); + var txr = {}; + + txrQ.push(txr); + + txr.eleCaches = []; + + txr.height = txrH; + txr.width = Math.max(defTxrWidth, minW); + txr.usedWidth = 0; + txr.invalidatedWidth = 0; + txr.fullnessChecks = 0; + + txr.canvas = document.createElement('canvas'); // eslint-disable-line no-undef + txr.canvas.width = txr.width; + txr.canvas.height = txr.height; + + txr.context = txr.canvas.getContext('2d'); + + return txr; +}; + +ETCp.recycleTexture = function (txrH, minW) { + var self = this; + var txrQ = self.getTextureQueue(txrH); + var rtxtrQ = self.getRetiredTextureQueue(txrH); + + for (var i = 0; i < rtxtrQ.length; i++) { + var txr = rtxtrQ[i]; + + if (txr.width >= minW) { + txr.retired = false; + + txr.usedWidth = 0; + txr.invalidatedWidth = 0; + txr.fullnessChecks = 0; + + util.clearArray(txr.eleCaches); + + txr.context.setTransform(1, 0, 0, 1, 0, 0); + txr.context.clearRect(0, 0, txr.width, txr.height); + + util.removeFromArray(rtxtrQ, txr); + txrQ.push(txr); + + return txr; + } + } +}; + +ETCp.queueElement = function (ele, lvl) { + var self = this; + var q = self.getElementQueue(); + var id2q = self.getElementIdToQueue(); + var id = ele.id(); + var existingReq = id2q[id]; + + if (existingReq) { + // use the max lvl b/c in between lvls are cheap to make + existingReq.level = Math.max(existingReq.level, lvl); + existingReq.reqs++; + + q.updateItem(existingReq); + } else { + var req = { + ele: ele, + level: lvl, + reqs: 1 + }; + + q.push(req); + + id2q[id] = req; + } +}; + +ETCp.dequeue = function (pxRatio /*, extent*/) { + var self = this; + var q = self.getElementQueue(); + var id2q = self.getElementIdToQueue(); + var dequeued = []; + + for (var i = 0; i < maxDeqSize; i++) { + if (q.size() > 0) { + var req = q.pop(); + var ele = req.ele; + var caches = ele._private.rscratch.imgCaches; + + // dequeueing isn't necessary when an existing cache exists + if (caches[req.level] != null) { + continue; + } + + id2q[ele.id()] = null; + + dequeued.push(req); + + var bb = ele.boundingBox(); + + self.getElement(ele, bb, pxRatio, req.level, getTxrReasons.dequeue); + } else { + break; + } + } + + return dequeued; +}; + +ETCp.removeFromQueue = function (ele) { + var self = this; + var q = self.getElementQueue(); + var id2q = self.getElementIdToQueue(); + var req = id2q[ele.id()]; + + if (req != null) { + // bring to front of queue + req.reqs = util.MAX_INT; + q.updateItem(req); + + q.pop(); // remove from queue + + id2q[ele.id()] = null; // remove from lookup map + } +}; + +ETCp.onDequeue = function (fn) { + this.onDequeues.push(fn); +}; +ETCp.offDequeue = function (fn) { + util.removeFromArray(this.onDequeues, fn); +}; + +ETCp.setupDequeueing = defs.setupDequeueing({ + deqRedrawThreshold: deqRedrawThreshold, + deqCost: deqCost, + deqAvgCost: deqAvgCost, + deqNoDrawCost: deqNoDrawCost, + deqFastCost: deqFastCost, + deq: function deq(self, pxRatio, extent) { + return self.dequeue(pxRatio, extent); + }, + onDeqd: function onDeqd(self, deqd) { + for (var i = 0; i < self.onDequeues.length; i++) { + var fn = self.onDequeues[i]; + + fn(deqd); + } + }, + shouldRedraw: function shouldRedraw(self, deqd, pxRatio, extent) { + for (var i = 0; i < deqd.length; i++) { + var bb = deqd[i].ele.boundingBox(); + + if (math.boundingBoxesIntersect(bb, extent)) { + return true; + } + } + + return false; + }, + priority: function priority(self) { + return self.renderer.beforeRenderPriorities.eleTxrDeq; + } +}); + +module.exports = ElementTextureCache; + +/***/ }), +/* 125 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var math = __webpack_require__(2); +var Heap = __webpack_require__(9); +var is = __webpack_require__(0); +var defs = __webpack_require__(19); + +var defNumLayers = 1; // default number of layers to use +var minLvl = -4; // when scaling smaller than that we don't need to re-render +var maxLvl = 2; // when larger than this scale just render directly (caching is not helpful) +var maxZoom = 3.99; // beyond this zoom level, layered textures are not used +var deqRedrawThreshold = 50; // time to batch redraws together from dequeueing to allow more dequeueing calcs to happen in the meanwhile +var refineEleDebounceTime = 50; // time to debounce sharper ele texture updates +var disableEleImgSmoothing = true; // when drawing eles on layers from an ele cache ; crisper and more performant when true +var deqCost = 0.15; // % of add'l rendering cost allowed for dequeuing ele caches each frame +var deqAvgCost = 0.1; // % of add'l rendering cost compared to average overall redraw time +var deqNoDrawCost = 0.9; // % of avg frame time that can be used for dequeueing when not drawing +var deqFastCost = 0.9; // % of frame time to be used when >60fps +var maxDeqSize = 1; // number of eles to dequeue and render at higher texture in each batch +var invalidThreshold = 250; // time threshold for disabling b/c of invalidations +var maxLayerArea = 4000 * 4000; // layers can't be bigger than this +var alwaysQueue = true; // never draw all the layers in a level on a frame; draw directly until all dequeued +var useHighQualityEleTxrReqs = true; // whether to use high quality ele txr requests (generally faster and cheaper in the longterm) + +var useEleTxrCaching = true; // whether to use individual ele texture caching underneath this cache + +// var log = function(){ console.log.apply( console, arguments ); }; + +var LayeredTextureCache = function LayeredTextureCache(renderer, eleTxrCache) { + var self = this; + + var r = self.renderer = renderer; + + self.layersByLevel = {}; // e.g. 2 => [ layer1, layer2, ..., layerN ] + + self.firstGet = true; + + self.lastInvalidationTime = util.performanceNow() - 2 * invalidThreshold; + + self.skipping = false; + + r.beforeRender(function (willDraw, now) { + if (now - self.lastInvalidationTime <= invalidThreshold) { + self.skipping = true; + } else { + self.skipping = false; + } + }); + + var qSort = function qSort(a, b) { + return b.reqs - a.reqs; + }; + + self.layersQueue = new Heap(qSort); + + self.eleTxrCache = eleTxrCache; + + self.setupEleCacheInvalidation(); + + self.setupDequeueing(); +}; + +var LTCp = LayeredTextureCache.prototype; + +var layerIdPool = 0; +var MAX_INT = Math.pow(2, 53) - 1; + +LTCp.makeLayer = function (bb, lvl) { + var scale = Math.pow(2, lvl); + + var w = Math.ceil(bb.w * scale); + var h = Math.ceil(bb.h * scale); + + var canvas = document.createElement('canvas'); // eslint-disable-line no-undef + + canvas.width = w; + canvas.height = h; + + var layer = { + id: layerIdPool = ++layerIdPool % MAX_INT, + bb: bb, + level: lvl, + width: w, + height: h, + canvas: canvas, + context: canvas.getContext('2d'), + eles: [], + elesQueue: [], + reqs: 0 + }; + + // log('make layer %s with w %s and h %s and lvl %s', layer.id, layer.width, layer.height, layer.level); + + var cxt = layer.context; + var dx = -layer.bb.x1; + var dy = -layer.bb.y1; + + // do the transform on creation to save cycles (it's the same for all eles) + cxt.scale(scale, scale); + cxt.translate(dx, dy); + + return layer; +}; + +LTCp.getLayers = function (eles, pxRatio, lvl) { + var self = this; + var r = self.renderer; + var cy = r.cy; + var zoom = cy.zoom(); + var firstGet = self.firstGet; + + self.firstGet = false; + + // log('--\nget layers with %s eles', eles.length); + //log eles.map(function(ele){ return ele.id() }) ); + + if (lvl == null) { + lvl = Math.ceil(math.log2(zoom * pxRatio)); + + if (lvl < minLvl) { + lvl = minLvl; + } else if (zoom >= maxZoom || lvl > maxLvl) { + return null; + } + } + + self.validateLayersElesOrdering(lvl, eles); + + var layersByLvl = self.layersByLevel; + var scale = Math.pow(2, lvl); + var layers = layersByLvl[lvl] = layersByLvl[lvl] || []; + var bb; + + var lvlComplete = self.levelIsComplete(lvl, eles); + var tmpLayers; + + var checkTempLevels = function checkTempLevels() { + var canUseAsTmpLvl = function canUseAsTmpLvl(l) { + self.validateLayersElesOrdering(l, eles); + + if (self.levelIsComplete(l, eles)) { + tmpLayers = layersByLvl[l]; + return true; + } + }; + + var checkLvls = function checkLvls(dir) { + if (tmpLayers) { + return; + } + + for (var l = lvl + dir; minLvl <= l && l <= maxLvl; l += dir) { + if (canUseAsTmpLvl(l)) { + break; + } + } + }; + + checkLvls(+1); + checkLvls(-1); + + // remove the invalid layers; they will be replaced as needed later in this function + for (var i = layers.length - 1; i >= 0; i--) { + var layer = layers[i]; + + if (layer.invalid) { + util.removeFromArray(layers, layer); + } + } + }; + + if (!lvlComplete) { + // if the current level is incomplete, then use the closest, best quality layerset temporarily + // and later queue the current layerset so we can get the proper quality level soon + + checkTempLevels(); + } else { + // log('level complete, using existing layers\n--'); + return layers; + } + + var getBb = function getBb() { + if (!bb) { + bb = math.makeBoundingBox(); + + for (var i = 0; i < eles.length; i++) { + math.updateBoundingBox(bb, eles[i].boundingBox()); + } + } + + return bb; + }; + + var makeLayer = function makeLayer(opts) { + opts = opts || {}; + + var after = opts.after; + + getBb(); + + var area = bb.w * scale * (bb.h * scale); + + if (area > maxLayerArea) { + return null; + } + + var layer = self.makeLayer(bb, lvl); + + if (after != null) { + var index = layers.indexOf(after) + 1; + + layers.splice(index, 0, layer); + } else if (opts.insert === undefined || opts.insert) { + // no after specified => first layer made so put at start + layers.unshift(layer); + } + + // if( tmpLayers ){ + //self.queueLayer( layer ); + // } + + return layer; + }; + + if (self.skipping && !firstGet) { + // log('skip layers'); + return null; + } + + // log('do layers'); + + var layer = null; + var maxElesPerLayer = eles.length / defNumLayers; + var allowLazyQueueing = alwaysQueue && !firstGet; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + var rs = ele._private.rscratch; + var caches = rs.imgLayerCaches = rs.imgLayerCaches || {}; + + // log('look at ele', ele.id()); + + var existingLayer = caches[lvl]; + + if (existingLayer) { + // reuse layer for later eles + // log('reuse layer for', ele.id()); + layer = existingLayer; + continue; + } + + if (!layer || layer.eles.length >= maxElesPerLayer || !math.boundingBoxInBoundingBox(layer.bb, ele.boundingBox())) { + // log('make new layer for ele %s', ele.id()); + + layer = makeLayer({ insert: true, after: layer }); + + // if now layer can be built then we can't use layers at this level + if (!layer) { + return null; + } + + // log('new layer with id %s', layer.id); + } + + if (tmpLayers || allowLazyQueueing) { + // log('queue ele %s in layer %s', ele.id(), layer.id); + self.queueLayer(layer, ele); + } else { + // log('draw ele %s in layer %s', ele.id(), layer.id); + self.drawEleInLayer(layer, ele, lvl, pxRatio); + } + + layer.eles.push(ele); + + caches[lvl] = layer; + } + + // log('--'); + + if (tmpLayers) { + // then we only queued the current layerset and can't draw it yet + return tmpLayers; + } + + if (allowLazyQueueing) { + // log('lazy queue level', lvl); + return null; + } + + return layers; +}; + +// a layer may want to use an ele cache of a higher level to avoid blurriness +// so the layer level might not equal the ele level +LTCp.getEleLevelForLayerLevel = function (lvl, pxRatio) { + return lvl; +}; + +function imgSmoothing(context, bool) { + if (context.imageSmoothingEnabled != null) { + context.imageSmoothingEnabled = bool; + } else { + context.webkitImageSmoothingEnabled = bool; + context.mozImageSmoothingEnabled = bool; + context.msImageSmoothingEnabled = bool; + } +} + +LTCp.drawEleInLayer = function (layer, ele, lvl, pxRatio) { + var self = this; + var r = this.renderer; + var context = layer.context; + var bb = ele.boundingBox(); + + if (bb.w === 0 || bb.h === 0 || !ele.visible()) { + return; + } + + var eleCache = self.eleTxrCache; + var reason = useHighQualityEleTxrReqs ? eleCache.reasons.highQuality : undefined; + + lvl = self.getEleLevelForLayerLevel(lvl, pxRatio); + + var cache = useEleTxrCaching ? eleCache.getElement(ele, bb, null, lvl, reason) : null; + + if (cache) { + if (disableEleImgSmoothing) { + imgSmoothing(context, false); + } + + context.drawImage(cache.texture.canvas, cache.x, 0, cache.width, cache.height, bb.x1, bb.y1, bb.w, bb.h); + + if (disableEleImgSmoothing) { + imgSmoothing(context, true); + } + } else { + // if the element is not cacheable, then draw directly + r.drawElement(context, ele); + } +}; + +LTCp.levelIsComplete = function (lvl, eles) { + var self = this; + var layers = self.layersByLevel[lvl]; + + if (!layers || layers.length === 0) { + return false; + } + + var numElesInLayers = 0; + + for (var i = 0; i < layers.length; i++) { + var layer = layers[i]; + + // if there are any eles needed to be drawn yet, the level is not complete + if (layer.reqs > 0) { + return false; + } + + // if the layer is invalid, the level is not complete + if (layer.invalid) { + return false; + } + + numElesInLayers += layer.eles.length; + } + + // we should have exactly the number of eles passed in to be complete + if (numElesInLayers !== eles.length) { + return false; + } + + return true; +}; + +LTCp.validateLayersElesOrdering = function (lvl, eles) { + var layers = this.layersByLevel[lvl]; + + if (!layers) { + return; + } + + // if in a layer the eles are not in the same order, then the layer is invalid + // (i.e. there is an ele in between the eles in the layer) + + for (var i = 0; i < layers.length; i++) { + var layer = layers[i]; + var offset = -1; + + // find the offset + for (var j = 0; j < eles.length; j++) { + if (layer.eles[0] === eles[j]) { + offset = j; + break; + } + } + + if (offset < 0) { + // then the layer has nonexistant elements and is invalid + this.invalidateLayer(layer); + continue; + } + + // the eles in the layer must be in the same continuous order, else the layer is invalid + + var o = offset; + + for (var j = 0; j < layer.eles.length; j++) { + if (layer.eles[j] !== eles[o + j]) { + // log('invalidate based on ordering', layer.id); + + this.invalidateLayer(layer); + break; + } + } + } +}; + +LTCp.updateElementsInLayers = function (eles, update) { + var self = this; + var isEles = is.element(eles[0]); + + // collect udpated elements (cascaded from the layers) and update each + // layer itself along the way + for (var i = 0; i < eles.length; i++) { + var req = isEles ? null : eles[i]; + var ele = isEles ? eles[i] : eles[i].ele; + var rs = ele._private.rscratch; + var caches = rs.imgLayerCaches = rs.imgLayerCaches || {}; + + for (var l = minLvl; l <= maxLvl; l++) { + var layer = caches[l]; + + if (!layer) { + continue; + } + + // if update is a request from the ele cache, then it affects only + // the matching level + if (req && self.getEleLevelForLayerLevel(layer.level) !== req.level) { + continue; + } + + update(layer, ele, req); + } + } +}; + +LTCp.haveLayers = function () { + var self = this; + var haveLayers = false; + + for (var l = minLvl; l <= maxLvl; l++) { + var layers = self.layersByLevel[l]; + + if (layers && layers.length > 0) { + haveLayers = true; + break; + } + } + + return haveLayers; +}; + +LTCp.invalidateElements = function (eles) { + var self = this; + + self.lastInvalidationTime = util.performanceNow(); + + // log('update invalidate layer time from eles'); + + if (eles.length === 0 || !self.haveLayers()) { + return; + } + + self.updateElementsInLayers(eles, function invalAssocLayers(layer, ele, req) { + self.invalidateLayer(layer); + }); +}; + +LTCp.invalidateLayer = function (layer) { + // log('update invalidate layer time'); + + this.lastInvalidationTime = util.performanceNow(); + + if (layer.invalid) { + return; + } // save cycles + + var lvl = layer.level; + var eles = layer.eles; + var layers = this.layersByLevel[lvl]; + + // log('invalidate layer', layer.id ); + + util.removeFromArray(layers, layer); + // layer.eles = []; + + layer.elesQueue = []; + + layer.invalid = true; + + if (layer.replacement) { + layer.replacement.invalid = true; + } + + for (var i = 0; i < eles.length; i++) { + var caches = eles[i]._private.rscratch.imgLayerCaches; + + if (caches) { + caches[lvl] = null; + } + } +}; + +LTCp.refineElementTextures = function (eles) { + var self = this; + + // log('refine', eles.length); + + self.updateElementsInLayers(eles, function refineEachEle(layer, ele, req) { + var rLyr = layer.replacement; + + if (!rLyr) { + rLyr = layer.replacement = self.makeLayer(layer.bb, layer.level); + rLyr.replaces = layer; + rLyr.eles = layer.eles; + + // log('make replacement layer %s for %s with level %s', rLyr.id, layer.id, rLyr.level); + } + + if (!rLyr.reqs) { + for (var i = 0; i < rLyr.eles.length; i++) { + self.queueLayer(rLyr, rLyr.eles[i]); + } + + // log('queue replacement layer refinement', rLyr.id); + } + }); +}; + +LTCp.setupEleCacheInvalidation = function () { + var self = this; + var eleDeqs = []; + + if (!useEleTxrCaching) { + return; + } + + var updatedElesInLayers = util.debounce(function () { + self.refineElementTextures(eleDeqs); + + eleDeqs = []; + }, refineEleDebounceTime); + + self.eleTxrCache.onDequeue(function (reqs) { + for (var i = 0; i < reqs.length; i++) { + eleDeqs.push(reqs[i]); + } + + updatedElesInLayers(); + }); +}; + +LTCp.queueLayer = function (layer, ele) { + var self = this; + var q = self.layersQueue; + var elesQ = layer.elesQueue; + var hasId = elesQ.hasId = elesQ.hasId || {}; + + // if a layer is going to be replaced, queuing is a waste of time + if (layer.replacement) { + return; + } + + if (ele) { + if (hasId[ele.id()]) { + return; + } + + elesQ.push(ele); + hasId[ele.id()] = true; + } + + if (layer.reqs) { + layer.reqs++; + + q.updateItem(layer); + } else { + layer.reqs = 1; + + q.push(layer); + } +}; + +LTCp.dequeue = function (pxRatio) { + var self = this; + var q = self.layersQueue; + var deqd = []; + var eleDeqs = 0; + + while (eleDeqs < maxDeqSize) { + if (q.size() === 0) { + break; + } + + var layer = q.peek(); + + // if a layer has been or will be replaced, then don't waste time with it + if (layer.replacement) { + // log('layer %s in queue skipped b/c it already has a replacement', layer.id); + q.pop(); + continue; + } + + // if this is a replacement layer that has been superceded, then forget it + if (layer.replaces && layer !== layer.replaces.replacement) { + // log('layer is no longer the most uptodate replacement; dequeued', layer.id) + q.pop(); + continue; + } + + if (layer.invalid) { + // log('replacement layer %s is invalid; dequeued', layer.id); + q.pop(); + continue; + } + + var ele = layer.elesQueue.shift(); + + if (ele) { + // log('dequeue layer %s', layer.id); + + self.drawEleInLayer(layer, ele, layer.level, pxRatio); + + eleDeqs++; + } + + if (deqd.length === 0) { + // we need only one entry in deqd to queue redrawing etc + deqd.push(true); + } + + // if the layer has all its eles done, then remove from the queue + if (layer.elesQueue.length === 0) { + q.pop(); + + layer.reqs = 0; + + // log('dequeue of layer %s complete', layer.id); + + // when a replacement layer is dequeued, it replaces the old layer in the level + if (layer.replaces) { + self.applyLayerReplacement(layer); + } + + self.requestRedraw(); + } + } + + return deqd; +}; + +LTCp.applyLayerReplacement = function (layer) { + var self = this; + var layersInLevel = self.layersByLevel[layer.level]; + var replaced = layer.replaces; + var index = layersInLevel.indexOf(replaced); + + // if the replaced layer is not in the active list for the level, then replacing + // refs would be a mistake (i.e. overwriting the true active layer) + if (index < 0 || replaced.invalid) { + // log('replacement layer would have no effect', layer.id); + return; + } + + layersInLevel[index] = layer; // replace level ref + + // replace refs in eles + for (var i = 0; i < layer.eles.length; i++) { + var _p = layer.eles[i]._private; + var cache = _p.imgLayerCaches = _p.imgLayerCaches || {}; + + if (cache) { + cache[layer.level] = layer; + } + } + + // log('apply replacement layer %s over %s', layer.id, replaced.id); + + self.requestRedraw(); +}; + +LTCp.requestRedraw = util.debounce(function () { + var r = this.renderer; + + r.redrawHint('eles', true); + r.redrawHint('drag', true); + r.redraw(); +}, 100); + +LTCp.setupDequeueing = defs.setupDequeueing({ + deqRedrawThreshold: deqRedrawThreshold, + deqCost: deqCost, + deqAvgCost: deqAvgCost, + deqNoDrawCost: deqNoDrawCost, + deqFastCost: deqFastCost, + deq: function deq(self, pxRatio) { + return self.dequeue(pxRatio); + }, + onDeqd: util.noop, + shouldRedraw: util.trueify, + priority: function priority(self) { + return self.renderer.beforeRenderPriorities.lyrTxrDeq; + } +}); + +module.exports = LayeredTextureCache; + +/***/ }), +/* 126 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var CRp = {}; + +var impl; + +CRp.arrowShapeImpl = function (name) { + return (impl || (impl = { + 'polygon': function polygon(context, points) { + for (var i = 0; i < points.length; i++) { + var pt = points[i]; + + context.lineTo(pt.x, pt.y); + } + }, + + 'triangle-backcurve': function triangleBackcurve(context, points, controlPoint) { + var firstPt; + + for (var i = 0; i < points.length; i++) { + var pt = points[i]; + + if (i === 0) { + firstPt = pt; + } + + context.lineTo(pt.x, pt.y); + } + + context.quadraticCurveTo(controlPoint.x, controlPoint.y, firstPt.x, firstPt.y); + }, + + 'triangle-tee': function triangleTee(context, trianglePoints, teePoints) { + if (context.beginPath) { + context.beginPath(); + } + + var triPts = trianglePoints; + for (var i = 0; i < triPts.length; i++) { + var pt = triPts[i]; + + context.lineTo(pt.x, pt.y); + } + + if (context.closePath) { + context.closePath(); + } + + if (context.beginPath) { + context.beginPath(); + } + + var teePts = teePoints; + var firstTeePt = teePoints[0]; + context.moveTo(firstTeePt.x, firstTeePt.y); + + for (var i = 0; i < teePts.length; i++) { + var pt = teePts[i]; + + context.lineTo(pt.x, pt.y); + } + if (context.closePath) { + context.closePath(); + } + }, + + 'triangle-cross': function triangleCross(context, trianglePoints, crossLinePoints) { + if (context.beginPath) { + context.beginPath(); + } + + var triPts = trianglePoints; + for (var i = 0; i < triPts.length; i++) { + var pt = triPts[i]; + + context.lineTo(pt.x, pt.y); + } + + if (context.closePath) { + context.closePath(); + } + + if (context.beginPath) { + context.beginPath(); + } + + var teePts = crossLinePoints; + var firstTeePt = crossLinePoints[0]; + context.moveTo(firstTeePt.x, firstTeePt.y); + + for (var i = 0; i < teePts.length; i++) { + var pt = teePts[i]; + + context.lineTo(pt.x, pt.y); + } + if (context.closePath) { + context.closePath(); + } + }, + + 'circle': function circle(context, rx, ry, r) { + context.arc(rx, ry, r, 0, Math.PI * 2, false); + } + }))[name]; +}; + +module.exports = CRp; + +/***/ }), +/* 127 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var math = __webpack_require__(2); + +var CRp = {}; + +CRp.drawElement = function (context, ele, shiftToOriginWithBb, showLabel) { + var r = this; + + if (ele.isNode()) { + r.drawNode(context, ele, shiftToOriginWithBb, showLabel); + } else { + r.drawEdge(context, ele, shiftToOriginWithBb, showLabel); + } +}; + +CRp.drawCachedElement = function (context, ele, pxRatio, extent) { + var r = this; + var bb = ele.boundingBox(); + + if (bb.w === 0 || bb.h === 0) { + return; + } + + if (!extent || math.boundingBoxesIntersect(bb, extent)) { + var cache = r.data.eleTxrCache.getElement(ele, bb, pxRatio); + + if (cache != null) { + context.drawImage(cache.texture.canvas, cache.x, 0, cache.width, cache.height, bb.x1, bb.y1, bb.w, bb.h); + } else { + // if the element is not cacheable, then draw directly + r.drawElement(context, ele); + } + } +}; + +CRp.drawElements = function (context, eles) { + var r = this; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + + r.drawElement(context, ele); + } +}; + +CRp.drawCachedElements = function (context, eles, pxRatio, extent) { + var r = this; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + + r.drawCachedElement(context, ele, pxRatio, extent); + } +}; + +CRp.drawCachedNodes = function (context, eles, pxRatio, extent) { + var r = this; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + + if (!ele.isNode()) { + continue; + } + + r.drawCachedElement(context, ele, pxRatio, extent); + } +}; + +CRp.drawLayeredElements = function (context, eles, pxRatio, extent) { + var r = this; + + var layers = r.data.lyrTxrCache.getLayers(eles, pxRatio); + + if (layers) { + for (var i = 0; i < layers.length; i++) { + var layer = layers[i]; + var bb = layer.bb; + + if (bb.w === 0 || bb.h === 0) { + continue; + } + + context.drawImage(layer.canvas, bb.x1, bb.y1, bb.w, bb.h); + } + } else { + // fall back on plain caching if no layers + r.drawCachedElements(context, eles, pxRatio, extent); + } +}; + +CRp.drawDebugPoints = function (context, eles) { + var draw = function draw(x, y, color) { + context.fillStyle = color; + context.fillRect(x - 1, y - 1, 3, 3); + }; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + var rs = ele._private.rscratch; + + if (ele.isNode()) { + var p = ele.position(); + + draw(p.x, p.y, 'magenta'); + } else { + var pts = rs.allpts; + + for (var j = 0; j + 1 < pts.length; j += 2) { + var x = pts[j]; + var y = pts[j + 1]; + + draw(x, y, 'cyan'); + } + + draw(rs.midX, rs.midY, 'yellow'); + } + } +}; + +module.exports = CRp; + +/***/ }), +/* 128 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var CRp = {}; + +CRp.drawEdge = function (context, edge, shiftToOriginWithBb, drawLabel) { + var r = this; + var rs = edge._private.rscratch; + var usePaths = r.usePaths(); + + if (!edge.visible()) { + return; + } + + // if bezier ctrl pts can not be calculated, then die + if (rs.badLine || rs.allpts == null || isNaN(rs.allpts[0])) { + // isNaN in case edge is impossible and browser bugs (e.g. safari) + return; + } + + var bb = void 0; + if (shiftToOriginWithBb) { + bb = shiftToOriginWithBb; + + context.translate(-bb.x1, -bb.y1); + } + + var overlayPadding = edge.pstyle('overlay-padding').pfValue; + var overlayWidth = 2 * overlayPadding; + var overlayOpacity = edge.pstyle('overlay-opacity').value; + var overlayColor = edge.pstyle('overlay-color').value; + var lineColor = edge.pstyle('line-color').value; + var opacity = edge.pstyle('opacity').value; + var lineStyle = edge.pstyle('line-style').value; + var edgeWidth = edge.pstyle('width').pfValue; + + var drawLine = function drawLine() { + var strokeOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : opacity; + + context.lineWidth = edgeWidth; + context.lineCap = 'butt'; + + r.strokeStyle(context, lineColor[0], lineColor[1], lineColor[2], strokeOpacity); + + r.drawEdgePath(edge, context, rs.allpts, lineStyle); + }; + + var drawOverlay = function drawOverlay() { + var strokeOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : overlayOpacity; + + context.lineWidth = overlayWidth; + + if (rs.edgeType === 'self' && !usePaths) { + context.lineCap = 'butt'; + } else { + context.lineCap = 'round'; + } + + r.strokeStyle(context, overlayColor[0], overlayColor[1], overlayColor[2], strokeOpacity); + + r.drawEdgePath(edge, context, rs.allpts, 'solid'); + }; + + var drawArrows = function drawArrows() { + var arrowOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : opacity; + + r.drawArrowheads(context, edge, arrowOpacity); + }; + + var drawText = function drawText() { + r.drawElementText(context, edge, drawLabel); + }; + + context.lineJoin = 'round'; + + var ghost = edge.pstyle('ghost').value === 'yes'; + + if (ghost) { + var gx = edge.pstyle('ghost-offset-x').pfValue; + var gy = edge.pstyle('ghost-offset-y').pfValue; + var ghostOpacity = edge.pstyle('ghost-opacity').value; + var effectiveGhostOpacity = opacity * ghostOpacity; + + context.translate(gx, gy); + + drawLine(effectiveGhostOpacity); + drawArrows(effectiveGhostOpacity); + + context.translate(-gx, -gy); + } + + drawLine(); + drawArrows(); + drawOverlay(); + drawText(); + + if (shiftToOriginWithBb) { + context.translate(bb.x1, bb.y1); + } +}; + +CRp.drawEdgePath = function (edge, context, pts, type) { + var rs = edge._private.rscratch; + var canvasCxt = context; + var path = void 0; + var pathCacheHit = false; + var usePaths = this.usePaths(); + + if (usePaths) { + var pathCacheKey = pts.join('$'); + var keyMatches = rs.pathCacheKey && rs.pathCacheKey === pathCacheKey; + + if (keyMatches) { + path = context = rs.pathCache; + pathCacheHit = true; + } else { + path = context = new Path2D(); // eslint-disable-line no-undef + rs.pathCacheKey = pathCacheKey; + rs.pathCache = path; + } + } + + if (canvasCxt.setLineDash) { + // for very outofdate browsers + switch (type) { + case 'dotted': + canvasCxt.setLineDash([1, 1]); + break; + + case 'dashed': + canvasCxt.setLineDash([6, 3]); + break; + + case 'solid': + canvasCxt.setLineDash([]); + break; + } + } + + if (!pathCacheHit && !rs.badLine) { + if (context.beginPath) { + context.beginPath(); + } + context.moveTo(pts[0], pts[1]); + + switch (rs.edgeType) { + case 'bezier': + case 'self': + case 'compound': + case 'multibezier': + for (var i = 2; i + 3 < pts.length; i += 4) { + context.quadraticCurveTo(pts[i], pts[i + 1], pts[i + 2], pts[i + 3]); + } + break; + + case 'straight': + case 'segments': + case 'haystack': + for (var _i = 2; _i + 1 < pts.length; _i += 2) { + context.lineTo(pts[_i], pts[_i + 1]); + } + break; + } + } + + context = canvasCxt; + if (usePaths) { + context.stroke(path); + } else { + context.stroke(); + } + + // reset any line dashes + if (context.setLineDash) { + // for very outofdate browsers + context.setLineDash([]); + } +}; + +CRp.drawArrowheads = function (context, edge, opacity) { + var rs = edge._private.rscratch; + var isHaystack = rs.edgeType === 'haystack'; + + if (!isHaystack) { + this.drawArrowhead(context, edge, 'source', rs.arrowStartX, rs.arrowStartY, rs.srcArrowAngle, opacity); + } + + this.drawArrowhead(context, edge, 'mid-target', rs.midX, rs.midY, rs.midtgtArrowAngle, opacity); + + this.drawArrowhead(context, edge, 'mid-source', rs.midX, rs.midY, rs.midsrcArrowAngle, opacity); + + if (!isHaystack) { + this.drawArrowhead(context, edge, 'target', rs.arrowEndX, rs.arrowEndY, rs.tgtArrowAngle, opacity); + } +}; + +CRp.drawArrowhead = function (context, edge, prefix, x, y, angle, opacity) { + if (isNaN(x) || x == null || isNaN(y) || y == null || isNaN(angle) || angle == null) { + return; + } + + var self = this; + var arrowShape = edge.pstyle(prefix + '-arrow-shape').value; + if (arrowShape === 'none') { + return; + } + + var arrowClearFill = edge.pstyle(prefix + '-arrow-fill').value === 'hollow' ? 'both' : 'filled'; + var arrowFill = edge.pstyle(prefix + '-arrow-fill').value; + var edgeWidth = edge.pstyle('width').pfValue; + var edgeOpacity = edge.pstyle('opacity').value; + + if (opacity === undefined) { + opacity = edgeOpacity; + } + + var gco = context.globalCompositeOperation; + + if (opacity !== 1 || arrowFill === 'hollow') { + // then extra clear is needed + context.globalCompositeOperation = 'destination-out'; + + self.fillStyle(context, 255, 255, 255, 1); + self.strokeStyle(context, 255, 255, 255, 1); + + self.drawArrowShape(edge, prefix, context, arrowClearFill, edgeWidth, arrowShape, x, y, angle); + + context.globalCompositeOperation = gco; + } // otherwise, the opaque arrow clears it for free :) + + var color = edge.pstyle(prefix + '-arrow-color').value; + self.fillStyle(context, color[0], color[1], color[2], opacity); + self.strokeStyle(context, color[0], color[1], color[2], opacity); + + self.drawArrowShape(edge, prefix, context, arrowFill, edgeWidth, arrowShape, x, y, angle); +}; + +CRp.drawArrowShape = function (edge, arrowType, context, fill, edgeWidth, shape, x, y, angle) { + var r = this; + var usePaths = this.usePaths(); + var rs = edge._private.rscratch; + var pathCacheHit = false; + var path = void 0; + var canvasContext = context; + var translation = { x: x, y: y }; + var scale = edge.pstyle('arrow-scale').value; + var size = this.getArrowWidth(edgeWidth, scale); + var shapeImpl = r.arrowShapes[shape]; + + if (usePaths) { + var pathCacheKey = size + '$' + shape + '$' + angle + '$' + x + '$' + y; + rs.arrowPathCacheKey = rs.arrowPathCacheKey || {}; + rs.arrowPathCache = rs.arrowPathCache || {}; + + var alreadyCached = rs.arrowPathCacheKey[arrowType] === pathCacheKey; + if (alreadyCached) { + path = context = rs.arrowPathCache[arrowType]; + pathCacheHit = true; + } else { + path = context = new Path2D(); // eslint-disable-line no-undef + rs.arrowPathCacheKey[arrowType] = pathCacheKey; + rs.arrowPathCache[arrowType] = path; + } + } + + if (context.beginPath) { + context.beginPath(); + } + + if (!pathCacheHit) { + shapeImpl.draw(context, size, angle, translation, edgeWidth); + } + + if (!shapeImpl.leavePathOpen && context.closePath) { + context.closePath(); + } + + context = canvasContext; + + if (fill === 'filled' || fill === 'both') { + if (usePaths) { + context.fill(path); + } else { + context.fill(); + } + } + + if (fill === 'hollow' || fill === 'both') { + context.lineWidth = shapeImpl.matchEdgeWidth ? edgeWidth : 1; + context.lineJoin = 'miter'; + + if (usePaths) { + context.stroke(path); + } else { + context.stroke(); + } + } +}; + +module.exports = CRp; + +/***/ }), +/* 129 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var CRp = {}; + +CRp.safeDrawImage = function (context, img, ix, iy, iw, ih, x, y, w, h) { + var r = this; + + // detect problematic cases for old browsers with bad images (cheaper than try-catch) + if (iw <= 0 || ih <= 0 || w <= 0 || h <= 0) { + return; + } + + context.drawImage(img, ix, iy, iw, ih, x, y, w, h); +}; + +CRp.drawInscribedImage = function (context, img, node, index, nodeOpacity) { + var r = this; + var pos = node.position(); + var nodeX = pos.x; + var nodeY = pos.y; + var styleObj = node.cy().style(); + var getIndexedStyle = styleObj.getIndexedStyle.bind(styleObj); + var fit = getIndexedStyle(node, 'background-fit', 'value', index); + var repeat = getIndexedStyle(node, 'background-repeat', 'value', index); + var nodeW = node.width(); + var nodeH = node.height(); + var paddingX2 = node.padding() * 2; + var nodeTW = nodeW + (getIndexedStyle(node, 'background-width-relative-to', 'value', index) === 'inner' ? 0 : paddingX2); + var nodeTH = nodeH + (getIndexedStyle(node, 'background-height-relative-to', 'value', index) === 'inner' ? 0 : paddingX2); + var rs = node._private.rscratch; + var clip = node.pstyle('background-clip').value; + var shouldClip = clip === 'node'; + var imgOpacity = getIndexedStyle(node, 'background-image-opacity', 'value', index) * nodeOpacity; + + var imgW = img.width || img.cachedW; + var imgH = img.height || img.cachedH; + + // workaround for broken browsers like ie + if (null == imgW || null == imgH) { + document.body.appendChild(img); // eslint-disable-line no-undef + + imgW = img.cachedW = img.width || img.offsetWidth; + imgH = img.cachedH = img.height || img.offsetHeight; + + document.body.removeChild(img); // eslint-disable-line no-undef + } + + var w = imgW; + var h = imgH; + + if (getIndexedStyle(node, 'background-width', 'value', index) !== 'auto') { + if (getIndexedStyle(node, 'background-width', 'units', index) === '%') { + w = getIndexedStyle(node, 'background-width', 'pfValue', index) * nodeTW; + } else { + w = getIndexedStyle(node, 'background-width', 'pfValue', index); + } + } + + if (getIndexedStyle(node, 'background-height', 'value', index) !== 'auto') { + if (getIndexedStyle(node, 'background-height', 'units', index) === '%') { + h = getIndexedStyle(node, 'background-height', 'pfValue', index) * nodeTH; + } else { + h = getIndexedStyle(node, 'background-height', 'pfValue', index); + } + } + + if (w === 0 || h === 0) { + return; // no point in drawing empty image (and chrome is broken in this case) + } + + if (fit === 'contain') { + var scale = Math.min(nodeTW / w, nodeTH / h); + + w *= scale; + h *= scale; + } else if (fit === 'cover') { + var scale = Math.max(nodeTW / w, nodeTH / h); + + w *= scale; + h *= scale; + } + + var x = nodeX - nodeTW / 2; // left + if (getIndexedStyle(node, 'background-position-x', 'units', index) === '%') { + x += (nodeTW - w) * getIndexedStyle(node, 'background-position-x', 'pfValue', index); + } else { + x += getIndexedStyle(node, 'background-position-x', 'pfValue', index); + } + + var y = nodeY - nodeTH / 2; // top + if (getIndexedStyle(node, 'background-position-y', 'units', index) === '%') { + y += (nodeTH - h) * getIndexedStyle(node, 'background-position-y', 'pfValue', index); + } else { + y += getIndexedStyle(node, 'background-position-y', 'pfValue', index); + } + + if (rs.pathCache) { + x -= nodeX; + y -= nodeY; + + nodeX = 0; + nodeY = 0; + } + + var gAlpha = context.globalAlpha; + + context.globalAlpha = imgOpacity; + + if (repeat === 'no-repeat') { + + if (shouldClip) { + context.save(); + + if (rs.pathCache) { + context.clip(rs.pathCache); + } else { + r.nodeShapes[r.getNodeShape(node)].draw(context, nodeX, nodeY, nodeTW, nodeTH); + + context.clip(); + } + } + + r.safeDrawImage(context, img, 0, 0, imgW, imgH, x, y, w, h); + + if (shouldClip) { + context.restore(); + } + } else { + var pattern = context.createPattern(img, repeat); + context.fillStyle = pattern; + + r.nodeShapes[r.getNodeShape(node)].draw(context, nodeX, nodeY, nodeTW, nodeTH); + + context.translate(x, y); + context.fill(); + context.translate(-x, -y); + } + + context.globalAlpha = gAlpha; +}; + +module.exports = CRp; + +/***/ }), +/* 130 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var math = __webpack_require__(2); + +var CRp = {}; + +CRp.eleTextBiggerThanMin = function (ele, scale) { + if (!scale) { + var zoom = ele.cy().zoom(); + var pxRatio = this.getPixelRatio(); + var lvl = Math.ceil(math.log2(zoom * pxRatio)); // the effective texture level + + scale = Math.pow(2, lvl); + } + + var computedSize = ele.pstyle('font-size').pfValue * scale; + var minSize = ele.pstyle('min-zoomed-font-size').pfValue; + + if (computedSize < minSize) { + return false; + } + + return true; +}; + +CRp.drawElementText = function (context, ele, force) { + var r = this; + + if (force === undefined) { + if (!r.eleTextBiggerThanMin(ele)) { + return; + } + } else { + if (!force) { + return; + } + } + + if (ele.isNode()) { + var label = ele.pstyle('label'); + + if (!label || !label.value) { + return; + } + + var textHalign = ele.pstyle('text-halign').strValue; + var textValign = ele.pstyle('text-valign').strValue; + + switch (textHalign) { + case 'left': + context.textAlign = 'right'; + break; + + case 'right': + context.textAlign = 'left'; + break; + + default: + // e.g. center + context.textAlign = 'center'; + } + + context.textBaseline = 'bottom'; + } else { + var label = ele.pstyle('label'); + var srcLabel = ele.pstyle('source-label'); + var tgtLabel = ele.pstyle('target-label'); + + if ((!label || !label.value) && (!srcLabel || !srcLabel.value) && (!tgtLabel || !tgtLabel.value)) { + return; + } + + context.textAlign = 'center'; + context.textBaseline = 'bottom'; + } + + r.drawText(context, ele); + + if (ele.isEdge()) { + r.drawText(context, ele, 'source'); + + r.drawText(context, ele, 'target'); + } +}; + +CRp.drawNodeText = CRp.drawEdgeText = CRp.drawElementText; + +CRp.getFontCache = function (context) { + var cache; + + this.fontCaches = this.fontCaches || []; + + for (var i = 0; i < this.fontCaches.length; i++) { + cache = this.fontCaches[i]; + + if (cache.context === context) { + return cache; + } + } + + cache = { + context: context + }; + this.fontCaches.push(cache); + + return cache; +}; + +// set up canvas context with font +// returns transformed text string +CRp.setupTextStyle = function (context, ele) { + // Font style + var parentOpacity = ele.effectiveOpacity(); + var labelStyle = ele.pstyle('font-style').strValue; + var labelSize = ele.pstyle('font-size').pfValue + 'px'; + var labelFamily = ele.pstyle('font-family').strValue; + var labelWeight = ele.pstyle('font-weight').strValue; + var opacity = ele.pstyle('text-opacity').value * ele.pstyle('opacity').value * parentOpacity; + var outlineOpacity = ele.pstyle('text-outline-opacity').value * opacity; + var color = ele.pstyle('color').value; + var outlineColor = ele.pstyle('text-outline-color').value; + + var fontCacheKey = ele._private.fontKey; + var cache = this.getFontCache(context); + + if (cache.key !== fontCacheKey) { + context.font = labelStyle + ' ' + labelWeight + ' ' + labelSize + ' ' + labelFamily; + + cache.key = fontCacheKey; + } + + // Calculate text draw position based on text alignment + + // so text outlines aren't jagged + context.lineJoin = 'round'; + + this.fillStyle(context, color[0], color[1], color[2], opacity); + + this.strokeStyle(context, outlineColor[0], outlineColor[1], outlineColor[2], outlineOpacity); +}; + +function roundRect(ctx, x, y, width, height, radius) { + var radius = radius || 5; + ctx.beginPath(); + ctx.moveTo(x + radius, y); + ctx.lineTo(x + width - radius, y); + ctx.quadraticCurveTo(x + width, y, x + width, y + radius); + ctx.lineTo(x + width, y + height - radius); + ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height); + ctx.lineTo(x + radius, y + height); + ctx.quadraticCurveTo(x, y + height, x, y + height - radius); + ctx.lineTo(x, y + radius); + ctx.quadraticCurveTo(x, y, x + radius, y); + ctx.closePath(); + ctx.fill(); +} + +// Draw text +CRp.drawText = function (context, ele, prefix) { + var _p = ele._private; + var rscratch = _p.rscratch; + var parentOpacity = ele.effectiveOpacity(); + if (parentOpacity === 0 || ele.pstyle('text-opacity').value === 0) { + return; + } + + var textX = util.getPrefixedProperty(rscratch, 'labelX', prefix); + var textY = util.getPrefixedProperty(rscratch, 'labelY', prefix); + var text = this.getLabelText(ele, prefix); + + if (text != null && text !== '' && !isNaN(textX) && !isNaN(textY)) { + this.setupTextStyle(context, ele); + + var pdash = prefix ? prefix + '-' : ''; + var textW = util.getPrefixedProperty(rscratch, 'labelWidth', prefix); + var textH = util.getPrefixedProperty(rscratch, 'labelHeight', prefix); + var textAngle = util.getPrefixedProperty(rscratch, 'labelAngle', prefix); + var marginX = ele.pstyle(pdash + 'text-margin-x').pfValue; + var marginY = ele.pstyle(pdash + 'text-margin-y').pfValue; + + var isEdge = ele.isEdge(); + var isNode = ele.isNode(); + + var halign = ele.pstyle('text-halign').value; + var valign = ele.pstyle('text-valign').value; + + if (isEdge) { + halign = 'center'; + valign = 'center'; + } + + textX += marginX; + textY += marginY; + + var rotation = ele.pstyle(pdash + 'text-rotation'); + var theta; + + if (rotation.strValue === 'autorotate') { + theta = isEdge ? textAngle : 0; + } else if (rotation.strValue === 'none') { + theta = 0; + } else { + theta = rotation.pfValue; + } + + if (theta !== 0) { + var orgTextX = textX; + var orgTextY = textY; + + context.translate(orgTextX, orgTextY); + context.rotate(theta); + + textX = 0; + textY = 0; + } + + switch (valign) { + case 'top': + break; + case 'center': + textY += textH / 2; + break; + case 'bottom': + textY += textH; + break; + } + + var backgroundOpacity = ele.pstyle('text-background-opacity').value; + var borderOpacity = ele.pstyle('text-border-opacity').value; + var textBorderWidth = ele.pstyle('text-border-width').pfValue; + var backgroundPadding = ele.pstyle('text-background-padding').pfValue; + + if (backgroundOpacity > 0 || textBorderWidth > 0 && borderOpacity > 0) { + var bgX = textX - backgroundPadding; + + switch (halign) { + case 'left': + bgX -= textW; + break; + case 'center': + bgX -= textW / 2; + break; + case 'right': + break; + } + + var bgY = textY - textH - backgroundPadding; + var bgW = textW + 2 * backgroundPadding; + var bgH = textH + 2 * backgroundPadding; + + if (backgroundOpacity > 0) { + var textFill = context.fillStyle; + var textBackgroundColor = ele.pstyle('text-background-color').value; + + context.fillStyle = 'rgba(' + textBackgroundColor[0] + ',' + textBackgroundColor[1] + ',' + textBackgroundColor[2] + ',' + backgroundOpacity * parentOpacity + ')'; + var styleShape = ele.pstyle('text-background-shape').strValue; + if (styleShape == 'roundrectangle') { + roundRect(context, bgX, bgY, bgW, bgH, 2); + } else { + context.fillRect(bgX, bgY, bgW, bgH); + } + context.fillStyle = textFill; + } + + if (textBorderWidth > 0 && borderOpacity > 0) { + var textStroke = context.strokeStyle; + var textLineWidth = context.lineWidth; + var textBorderColor = ele.pstyle('text-border-color').value; + var textBorderStyle = ele.pstyle('text-border-style').value; + + context.strokeStyle = 'rgba(' + textBorderColor[0] + ',' + textBorderColor[1] + ',' + textBorderColor[2] + ',' + borderOpacity * parentOpacity + ')'; + context.lineWidth = textBorderWidth; + + if (context.setLineDash) { + // for very outofdate browsers + switch (textBorderStyle) { + case 'dotted': + context.setLineDash([1, 1]); + break; + case 'dashed': + context.setLineDash([4, 2]); + break; + case 'double': + context.lineWidth = textBorderWidth / 4; // 50% reserved for white between the two borders + context.setLineDash([]); + break; + case 'solid': + context.setLineDash([]); + break; + } + } + + context.strokeRect(bgX, bgY, bgW, bgH); + + if (textBorderStyle === 'double') { + var whiteWidth = textBorderWidth / 2; + + context.strokeRect(bgX + whiteWidth, bgY + whiteWidth, bgW - whiteWidth * 2, bgH - whiteWidth * 2); + } + + if (context.setLineDash) { + // for very outofdate browsers + context.setLineDash([]); + } + context.lineWidth = textLineWidth; + context.strokeStyle = textStroke; + } + } + + var lineWidth = 2 * ele.pstyle('text-outline-width').pfValue; // *2 b/c the stroke is drawn centred on the middle + + if (lineWidth > 0) { + context.lineWidth = lineWidth; + } + + if (ele.pstyle('text-wrap').value === 'wrap') { + var lines = util.getPrefixedProperty(rscratch, 'labelWrapCachedLines', prefix); + var lineHeight = textH / lines.length; + + switch (valign) { + case 'top': + textY -= (lines.length - 1) * lineHeight; + break; + case 'center': + case 'bottom': + textY -= (lines.length - 1) * lineHeight; + break; + } + + for (var l = 0; l < lines.length; l++) { + if (lineWidth > 0) { + context.strokeText(lines[l], textX, textY); + } + + context.fillText(lines[l], textX, textY); + + textY += lineHeight; + } + } else { + if (lineWidth > 0) { + context.strokeText(text, textX, textY); + } + + context.fillText(text, textX, textY); + } + + if (theta !== 0) { + context.rotate(-theta); + context.translate(-orgTextX, -orgTextY); + } + } +}; + +module.exports = CRp; + +/***/ }), +/* 131 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* global Path2D */ + +var is = __webpack_require__(0); + +var CRp = {}; + +CRp.drawNode = function (context, node, shiftToOriginWithBb, drawLabel) { + var r = this; + var nodeWidth = void 0, + nodeHeight = void 0; + var _p = node._private; + var rs = _p.rscratch; + var pos = node.position(); + + if (!is.number(pos.x) || !is.number(pos.y)) { + return; // can't draw node with undefined position + } + + if (!node.visible()) { + return; + } + + var parentOpacity = node.effectiveOpacity(); + + var usePaths = r.usePaths(); + var path = void 0; + var pathCacheHit = false; + + var padding = node.padding(); + + nodeWidth = node.width() + 2 * padding; + nodeHeight = node.height() + 2 * padding; + + // + // setup shift + + var bb = void 0; + if (shiftToOriginWithBb) { + bb = shiftToOriginWithBb; + + context.translate(-bb.x1, -bb.y1); + } + + // + // load bg image + + var bgImgProp = node.pstyle('background-image'); + var urls = bgImgProp.value; + var urlDefined = new Array(urls.length); + var image = new Array(urls.length); + var numImages = 0; + for (var i = 0; i < urls.length; i++) { + var url = urls[i]; + var defd = urlDefined[i] = url != null && url !== 'none'; + + if (defd) { + var bgImgCrossOrigin = node.cy().style().getIndexedStyle(node, 'background-image-crossorigin', 'value', i); + + numImages++; + + // get image, and if not loaded then ask to redraw when later loaded + image[i] = r.getCachedImage(url, bgImgCrossOrigin, function () { + node.emitAndNotify('background'); + }); + } + } + + // + // setup styles + + var darkness = node.pstyle('background-blacken').value; + var borderWidth = node.pstyle('border-width').pfValue; + var bgColor = node.pstyle('background-color').value; + var bgOpacity = node.pstyle('background-opacity').value * parentOpacity; + var borderColor = node.pstyle('border-color').value; + var borderStyle = node.pstyle('border-style').value; + var borderOpacity = node.pstyle('border-opacity').value * parentOpacity; + + context.lineJoin = 'miter'; // so borders are square with the node shape + + var setupShapeColor = function setupShapeColor() { + var bgOpy = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : bgOpacity; + + r.fillStyle(context, bgColor[0], bgColor[1], bgColor[2], bgOpy); + }; + + var setupBorderColor = function setupBorderColor() { + var bdrOpy = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : borderOpacity; + + r.strokeStyle(context, borderColor[0], borderColor[1], borderColor[2], bdrOpy); + }; + + // + // setup shape + + var styleShape = node.pstyle('shape').strValue; + var shapePts = node.pstyle('shape-polygon-points').pfValue; + + if (usePaths) { + var pathCacheKey = styleShape + '$' + nodeWidth + '$' + nodeHeight + (styleShape === 'polygon' ? '$' + shapePts.join('$') : ''); + + context.translate(pos.x, pos.y); + + if (rs.pathCacheKey === pathCacheKey) { + path = rs.pathCache; + pathCacheHit = true; + } else { + path = new Path2D(); + rs.pathCacheKey = pathCacheKey; + rs.pathCache = path; + } + } + + var drawShape = function drawShape() { + if (!pathCacheHit) { + + var npos = pos; + + if (usePaths) { + npos = { + x: 0, + y: 0 + }; + } + + r.nodeShapes[r.getNodeShape(node)].draw(path || context, npos.x, npos.y, nodeWidth, nodeHeight); + } + + if (usePaths) { + context.fill(path); + } else { + context.fill(); + } + }; + + var drawImages = function drawImages() { + var nodeOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : parentOpacity; + + var prevBging = _p.backgrounding; + var totalCompleted = 0; + + for (var _i = 0; _i < image.length; _i++) { + if (urlDefined[_i] && image[_i].complete && !image[_i].error) { + totalCompleted++; + r.drawInscribedImage(context, image[_i], node, _i, nodeOpacity); + } + } + + _p.backgrounding = !(totalCompleted === numImages); + if (prevBging !== _p.backgrounding) { + // update style b/c :backgrounding state changed + node.updateStyle(false); + } + }; + + var drawPie = function drawPie() { + var redrawShape = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + var pieOpacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : parentOpacity; + + if (r.hasPie(node)) { + r.drawPie(context, node, pieOpacity); + + // redraw/restore path if steps after pie need it + if (redrawShape) { + + if (!usePaths) { + r.nodeShapes[r.getNodeShape(node)].draw(context, pos.x, pos.y, nodeWidth, nodeHeight); + } + } + } + }; + + var darken = function darken() { + var darkenOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : parentOpacity; + + var opacity = (darkness > 0 ? darkness : -darkness) * darkenOpacity; + var c = darkness > 0 ? 0 : 255; + + if (darkness !== 0) { + r.fillStyle(context, c, c, c, opacity); + + if (usePaths) { + context.fill(path); + } else { + context.fill(); + } + } + }; + + var drawBorder = function drawBorder() { + if (borderWidth > 0) { + + context.lineWidth = borderWidth; + context.lineCap = 'butt'; + + if (context.setLineDash) { + // for very outofdate browsers + switch (borderStyle) { + case 'dotted': + context.setLineDash([1, 1]); + break; + + case 'dashed': + context.setLineDash([4, 2]); + break; + + case 'solid': + case 'double': + context.setLineDash([]); + break; + } + } + + if (usePaths) { + context.stroke(path); + } else { + context.stroke(); + } + + if (borderStyle === 'double') { + context.lineWidth = borderWidth / 3; + + var gco = context.globalCompositeOperation; + context.globalCompositeOperation = 'destination-out'; + + if (usePaths) { + context.stroke(path); + } else { + context.stroke(); + } + + context.globalCompositeOperation = gco; + } + + // reset in case we changed the border style + if (context.setLineDash) { + // for very outofdate browsers + context.setLineDash([]); + } + } + }; + + var drawOverlay = function drawOverlay() { + var overlayPadding = node.pstyle('overlay-padding').pfValue; + var overlayOpacity = node.pstyle('overlay-opacity').value; + var overlayColor = node.pstyle('overlay-color').value; + + if (overlayOpacity > 0) { + r.fillStyle(context, overlayColor[0], overlayColor[1], overlayColor[2], overlayOpacity); + + r.nodeShapes['roundrectangle'].draw(context, pos.x, pos.y, nodeWidth + overlayPadding * 2, nodeHeight + overlayPadding * 2); + + context.fill(); + } + }; + + var drawText = function drawText() { + r.drawElementText(context, node, drawLabel); + }; + + var ghost = node.pstyle('ghost').value === 'yes'; + + if (ghost) { + var gx = node.pstyle('ghost-offset-x').pfValue; + var gy = node.pstyle('ghost-offset-y').pfValue; + var ghostOpacity = node.pstyle('ghost-opacity').value; + var effGhostOpacity = ghostOpacity * parentOpacity; + + context.translate(gx, gy); + + setupShapeColor(ghostOpacity * bgOpacity); + drawShape(); + drawImages(effGhostOpacity); + drawPie(darkness !== 0 || borderWidth !== 0); + darken(effGhostOpacity); + setupBorderColor(ghostOpacity * borderOpacity); + drawBorder(); + + context.translate(-gx, -gy); + } + + setupShapeColor(); + drawShape(); + drawImages(); + drawPie(darkness !== 0 || borderWidth !== 0); + darken(); + setupBorderColor(); + drawBorder(); + + if (usePaths) { + context.translate(-pos.x, -pos.y); + } + + drawText(); + drawOverlay(); + + // + // clean up shift + + if (shiftToOriginWithBb) { + context.translate(bb.x1, bb.y1); + } +}; + +// does the node have at least one pie piece? +CRp.hasPie = function (node) { + node = node[0]; // ensure ele ref + + return node._private.hasPie; +}; + +CRp.drawPie = function (context, node, nodeOpacity, pos) { + node = node[0]; // ensure ele ref + pos = pos || node.position(); + + var cyStyle = node.cy().style(); + var pieSize = node.pstyle('pie-size'); + var x = pos.x; + var y = pos.y; + var nodeW = node.width(); + var nodeH = node.height(); + var radius = Math.min(nodeW, nodeH) / 2; // must fit in node + var lastPercent = 0; // what % to continue drawing pie slices from on [0, 1] + var usePaths = this.usePaths(); + + if (usePaths) { + x = 0; + y = 0; + } + + if (pieSize.units === '%') { + radius = radius * pieSize.pfValue; + } else if (pieSize.pfValue !== undefined) { + radius = pieSize.pfValue / 2; + } + + for (var i = 1; i <= cyStyle.pieBackgroundN; i++) { + // 1..N + var size = node.pstyle('pie-' + i + '-background-size').value; + var color = node.pstyle('pie-' + i + '-background-color').value; + var opacity = node.pstyle('pie-' + i + '-background-opacity').value * nodeOpacity; + var percent = size / 100; // map integer range [0, 100] to [0, 1] + + // percent can't push beyond 1 + if (percent + lastPercent > 1) { + percent = 1 - lastPercent; + } + + var angleStart = 1.5 * Math.PI + 2 * Math.PI * lastPercent; // start at 12 o'clock and go clockwise + var angleDelta = 2 * Math.PI * percent; + var angleEnd = angleStart + angleDelta; + + // ignore if + // - zero size + // - we're already beyond the full circle + // - adding the current slice would go beyond the full circle + if (size === 0 || lastPercent >= 1 || lastPercent + percent > 1) { + continue; + } + + context.beginPath(); + context.moveTo(x, y); + context.arc(x, y, radius, angleStart, angleEnd); + context.closePath(); + + this.fillStyle(context, color[0], color[1], color[2], opacity); + + context.fill(); + + lastPercent += percent; + } +}; + +module.exports = CRp; + +/***/ }), +/* 132 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var CRp = {}; + +var util = __webpack_require__(1); + +var motionBlurDelay = 100; + +// var isFirefox = typeof InstallTrigger !== 'undefined'; + +CRp.getPixelRatio = function () { + var context = this.data.contexts[0]; + + if (this.forcedPixelRatio != null) { + return this.forcedPixelRatio; + } + + var backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1; + + return (window.devicePixelRatio || 1) / backingStore; // eslint-disable-line no-undef +}; + +CRp.paintCache = function (context) { + var caches = this.paintCaches = this.paintCaches || []; + var needToCreateCache = true; + var cache; + + for (var i = 0; i < caches.length; i++) { + cache = caches[i]; + + if (cache.context === context) { + needToCreateCache = false; + break; + } + } + + if (needToCreateCache) { + cache = { + context: context + }; + caches.push(cache); + } + + return cache; +}; + +CRp.fillStyle = function (context, r, g, b, a) { + context.fillStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; + + // turn off for now, seems context does its own caching + + // var cache = this.paintCache(context); + + // var fillStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; + + // if( cache.fillStyle !== fillStyle ){ + // context.fillStyle = cache.fillStyle = fillStyle; + // } +}; + +CRp.strokeStyle = function (context, r, g, b, a) { + context.strokeStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; + + // turn off for now, seems context does its own caching + + // var cache = this.paintCache(context); + + // var strokeStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; + + // if( cache.strokeStyle !== strokeStyle ){ + // context.strokeStyle = cache.strokeStyle = strokeStyle; + // } +}; + +// Resize canvas +CRp.matchCanvasSize = function (container) { + var r = this; + var data = r.data; + var bb = r.findContainerClientCoords(); + var width = bb[2]; + var height = bb[3]; + var pixelRatio = r.getPixelRatio(); + var mbPxRatio = r.motionBlurPxRatio; + + if (container === r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_NODE] || container === r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_DRAG]) { + pixelRatio = mbPxRatio; + } + + var canvasWidth = width * pixelRatio; + var canvasHeight = height * pixelRatio; + var canvas; + + if (canvasWidth === r.canvasWidth && canvasHeight === r.canvasHeight) { + return; // save cycles if same + } + + r.fontCaches = null; // resizing resets the style + + var canvasContainer = data.canvasContainer; + canvasContainer.style.width = width + 'px'; + canvasContainer.style.height = height + 'px'; + + for (var i = 0; i < r.CANVAS_LAYERS; i++) { + canvas = data.canvases[i]; + + canvas.width = canvasWidth; + canvas.height = canvasHeight; + + canvas.style.width = width + 'px'; + canvas.style.height = height + 'px'; + } + + for (var i = 0; i < r.BUFFER_COUNT; i++) { + canvas = data.bufferCanvases[i]; + + canvas.width = canvasWidth; + canvas.height = canvasHeight; + + canvas.style.width = width + 'px'; + canvas.style.height = height + 'px'; + } + + r.textureMult = 1; + if (pixelRatio <= 1) { + canvas = data.bufferCanvases[r.TEXTURE_BUFFER]; + + r.textureMult = 2; + canvas.width = canvasWidth * r.textureMult; + canvas.height = canvasHeight * r.textureMult; + } + + r.canvasWidth = canvasWidth; + r.canvasHeight = canvasHeight; +}; + +CRp.renderTo = function (cxt, zoom, pan, pxRatio) { + this.render({ + forcedContext: cxt, + forcedZoom: zoom, + forcedPan: pan, + drawAllLayers: true, + forcedPxRatio: pxRatio + }); +}; + +CRp.render = function (options) { + options = options || util.staticEmptyObject(); + + var forcedContext = options.forcedContext; + var drawAllLayers = options.drawAllLayers; + var drawOnlyNodeLayer = options.drawOnlyNodeLayer; + var forcedZoom = options.forcedZoom; + var forcedPan = options.forcedPan; + var r = this; + var pixelRatio = options.forcedPxRatio === undefined ? this.getPixelRatio() : options.forcedPxRatio; + var cy = r.cy;var data = r.data; + var needDraw = data.canvasNeedsRedraw; + var textureDraw = r.textureOnViewport && !forcedContext && (r.pinching || r.hoverData.dragging || r.swipePanning || r.data.wheelZooming); + var motionBlur = options.motionBlur !== undefined ? options.motionBlur : r.motionBlur; + var mbPxRatio = r.motionBlurPxRatio; + var hasCompoundNodes = cy.hasCompoundNodes(); + var inNodeDragGesture = r.hoverData.draggingEles; + var inBoxSelection = r.hoverData.selecting || r.touchData.selecting ? true : false; + motionBlur = motionBlur && !forcedContext && r.motionBlurEnabled && !inBoxSelection; + var motionBlurFadeEffect = motionBlur; + + if (!forcedContext) { + if (r.prevPxRatio !== pixelRatio) { + r.invalidateContainerClientCoordsCache(); + r.matchCanvasSize(r.container); + + r.redrawHint('eles', true); + r.redrawHint('drag', true); + } + + r.prevPxRatio = pixelRatio; + } + + if (!forcedContext && r.motionBlurTimeout) { + clearTimeout(r.motionBlurTimeout); + } + + if (motionBlur) { + if (r.mbFrames == null) { + r.mbFrames = 0; + } + + r.mbFrames++; + + if (r.mbFrames < 3) { + // need several frames before even high quality motionblur + motionBlurFadeEffect = false; + } + + // go to lower quality blurry frames when several m/b frames have been rendered (avoids flashing) + if (r.mbFrames > r.minMbLowQualFrames) { + //r.fullQualityMb = false; + r.motionBlurPxRatio = r.mbPxRBlurry; + } + } + + if (r.clearingMotionBlur) { + r.motionBlurPxRatio = 1; + } + + // b/c drawToContext() may be async w.r.t. redraw(), keep track of last texture frame + // because a rogue async texture frame would clear needDraw + if (r.textureDrawLastFrame && !textureDraw) { + needDraw[r.NODE] = true; + needDraw[r.SELECT_BOX] = true; + } + + var coreStyle = cy.style()._private.coreStyle; + + var zoom = cy.zoom(); + var effectiveZoom = forcedZoom !== undefined ? forcedZoom : zoom; + var pan = cy.pan(); + var effectivePan = { + x: pan.x, + y: pan.y + }; + + var vp = { + zoom: zoom, + pan: { + x: pan.x, + y: pan.y + } + }; + var prevVp = r.prevViewport; + var viewportIsDiff = prevVp === undefined || vp.zoom !== prevVp.zoom || vp.pan.x !== prevVp.pan.x || vp.pan.y !== prevVp.pan.y; + + // we want the low quality motionblur only when the viewport is being manipulated etc (where it's not noticed) + if (!viewportIsDiff && !(inNodeDragGesture && !hasCompoundNodes)) { + r.motionBlurPxRatio = 1; + } + + if (forcedPan) { + effectivePan = forcedPan; + } + + // apply pixel ratio + + effectiveZoom *= pixelRatio; + effectivePan.x *= pixelRatio; + effectivePan.y *= pixelRatio; + + var eles = r.getCachedZSortedEles(); + + function mbclear(context, x, y, w, h) { + var gco = context.globalCompositeOperation; + + context.globalCompositeOperation = 'destination-out'; + r.fillStyle(context, 255, 255, 255, r.motionBlurTransparency); + context.fillRect(x, y, w, h); + + context.globalCompositeOperation = gco; + } + + function setContextTransform(context, clear) { + var ePan, eZoom, w, h; + + if (!r.clearingMotionBlur && (context === data.bufferContexts[r.MOTIONBLUR_BUFFER_NODE] || context === data.bufferContexts[r.MOTIONBLUR_BUFFER_DRAG])) { + ePan = { + x: pan.x * mbPxRatio, + y: pan.y * mbPxRatio + }; + + eZoom = zoom * mbPxRatio; + + w = r.canvasWidth * mbPxRatio; + h = r.canvasHeight * mbPxRatio; + } else { + ePan = effectivePan; + eZoom = effectiveZoom; + + w = r.canvasWidth; + h = r.canvasHeight; + } + + context.setTransform(1, 0, 0, 1, 0, 0); + + if (clear === 'motionBlur') { + mbclear(context, 0, 0, w, h); + } else if (!forcedContext && (clear === undefined || clear)) { + context.clearRect(0, 0, w, h); + } + + if (!drawAllLayers) { + context.translate(ePan.x, ePan.y); + context.scale(eZoom, eZoom); + } + if (forcedPan) { + context.translate(forcedPan.x, forcedPan.y); + } + if (forcedZoom) { + context.scale(forcedZoom, forcedZoom); + } + } + + if (!textureDraw) { + r.textureDrawLastFrame = false; + } + + if (textureDraw) { + r.textureDrawLastFrame = true; + + var bb; + + if (!r.textureCache) { + r.textureCache = {}; + + bb = r.textureCache.bb = cy.mutableElements().boundingBox(); + + r.textureCache.texture = r.data.bufferCanvases[r.TEXTURE_BUFFER]; + + var cxt = r.data.bufferContexts[r.TEXTURE_BUFFER]; + + cxt.setTransform(1, 0, 0, 1, 0, 0); + cxt.clearRect(0, 0, r.canvasWidth * r.textureMult, r.canvasHeight * r.textureMult); + + r.render({ + forcedContext: cxt, + drawOnlyNodeLayer: true, + forcedPxRatio: pixelRatio * r.textureMult + }); + + var vp = r.textureCache.viewport = { + zoom: cy.zoom(), + pan: cy.pan(), + width: r.canvasWidth, + height: r.canvasHeight + }; + + vp.mpan = { + x: (0 - vp.pan.x) / vp.zoom, + y: (0 - vp.pan.y) / vp.zoom + }; + } + + needDraw[r.DRAG] = false; + needDraw[r.NODE] = false; + + var context = data.contexts[r.NODE]; + + var texture = r.textureCache.texture; + var vp = r.textureCache.viewport; + bb = r.textureCache.bb; + + context.setTransform(1, 0, 0, 1, 0, 0); + + if (motionBlur) { + mbclear(context, 0, 0, vp.width, vp.height); + } else { + context.clearRect(0, 0, vp.width, vp.height); + } + + var outsideBgColor = coreStyle['outside-texture-bg-color'].value; + var outsideBgOpacity = coreStyle['outside-texture-bg-opacity'].value; + r.fillStyle(context, outsideBgColor[0], outsideBgColor[1], outsideBgColor[2], outsideBgOpacity); + context.fillRect(0, 0, vp.width, vp.height); + + var zoom = cy.zoom(); + + setContextTransform(context, false); + + context.clearRect(vp.mpan.x, vp.mpan.y, vp.width / vp.zoom / pixelRatio, vp.height / vp.zoom / pixelRatio); + context.drawImage(texture, vp.mpan.x, vp.mpan.y, vp.width / vp.zoom / pixelRatio, vp.height / vp.zoom / pixelRatio); + } else if (r.textureOnViewport && !forcedContext) { + // clear the cache since we don't need it + r.textureCache = null; + } + + var extent = cy.extent(); + var vpManip = r.pinching || r.hoverData.dragging || r.swipePanning || r.data.wheelZooming || r.hoverData.draggingEles; + var hideEdges = r.hideEdgesOnViewport && vpManip; + + var needMbClear = []; + + needMbClear[r.NODE] = !needDraw[r.NODE] && motionBlur && !r.clearedForMotionBlur[r.NODE] || r.clearingMotionBlur; + if (needMbClear[r.NODE]) { + r.clearedForMotionBlur[r.NODE] = true; + } + + needMbClear[r.DRAG] = !needDraw[r.DRAG] && motionBlur && !r.clearedForMotionBlur[r.DRAG] || r.clearingMotionBlur; + if (needMbClear[r.DRAG]) { + r.clearedForMotionBlur[r.DRAG] = true; + } + + if (needDraw[r.NODE] || drawAllLayers || drawOnlyNodeLayer || needMbClear[r.NODE]) { + var useBuffer = motionBlur && !needMbClear[r.NODE] && mbPxRatio !== 1; + var context = forcedContext || (useBuffer ? r.data.bufferContexts[r.MOTIONBLUR_BUFFER_NODE] : data.contexts[r.NODE]); + var clear = motionBlur && !useBuffer ? 'motionBlur' : undefined; + + setContextTransform(context, clear); + + if (hideEdges) { + r.drawCachedNodes(context, eles.nondrag, pixelRatio, extent); + } else { + r.drawLayeredElements(context, eles.nondrag, pixelRatio, extent); + } + + if (r.debug) { + r.drawDebugPoints(context, eles.nondrag); + } + + if (!drawAllLayers && !motionBlur) { + needDraw[r.NODE] = false; + } + } + + if (!drawOnlyNodeLayer && (needDraw[r.DRAG] || drawAllLayers || needMbClear[r.DRAG])) { + var useBuffer = motionBlur && !needMbClear[r.DRAG] && mbPxRatio !== 1; + var context = forcedContext || (useBuffer ? r.data.bufferContexts[r.MOTIONBLUR_BUFFER_DRAG] : data.contexts[r.DRAG]); + + setContextTransform(context, motionBlur && !useBuffer ? 'motionBlur' : undefined); + + if (hideEdges) { + r.drawCachedNodes(context, eles.drag, pixelRatio, extent); + } else { + r.drawCachedElements(context, eles.drag, pixelRatio, extent); + } + + if (r.debug) { + r.drawDebugPoints(context, eles.drag); + } + + if (!drawAllLayers && !motionBlur) { + needDraw[r.DRAG] = false; + } + } + + if (r.showFps || !drawOnlyNodeLayer && needDraw[r.SELECT_BOX] && !drawAllLayers) { + var context = forcedContext || data.contexts[r.SELECT_BOX]; + + setContextTransform(context); + + if (r.selection[4] == 1 && (r.hoverData.selecting || r.touchData.selecting)) { + var zoom = r.cy.zoom(); + var borderWidth = coreStyle['selection-box-border-width'].value / zoom; + + context.lineWidth = borderWidth; + context.fillStyle = 'rgba(' + coreStyle['selection-box-color'].value[0] + ',' + coreStyle['selection-box-color'].value[1] + ',' + coreStyle['selection-box-color'].value[2] + ',' + coreStyle['selection-box-opacity'].value + ')'; + + context.fillRect(r.selection[0], r.selection[1], r.selection[2] - r.selection[0], r.selection[3] - r.selection[1]); + + if (borderWidth > 0) { + context.strokeStyle = 'rgba(' + coreStyle['selection-box-border-color'].value[0] + ',' + coreStyle['selection-box-border-color'].value[1] + ',' + coreStyle['selection-box-border-color'].value[2] + ',' + coreStyle['selection-box-opacity'].value + ')'; + + context.strokeRect(r.selection[0], r.selection[1], r.selection[2] - r.selection[0], r.selection[3] - r.selection[1]); + } + } + + if (data.bgActivePosistion && !r.hoverData.selecting) { + var zoom = r.cy.zoom(); + var pos = data.bgActivePosistion; + + context.fillStyle = 'rgba(' + coreStyle['active-bg-color'].value[0] + ',' + coreStyle['active-bg-color'].value[1] + ',' + coreStyle['active-bg-color'].value[2] + ',' + coreStyle['active-bg-opacity'].value + ')'; + + context.beginPath(); + context.arc(pos.x, pos.y, coreStyle['active-bg-size'].pfValue / zoom, 0, 2 * Math.PI); + context.fill(); + } + + var timeToRender = r.lastRedrawTime; + if (r.showFps && timeToRender) { + timeToRender = Math.round(timeToRender); + var fps = Math.round(1000 / timeToRender); + + context.setTransform(1, 0, 0, 1, 0, 0); + + context.fillStyle = 'rgba(255, 0, 0, 0.75)'; + context.strokeStyle = 'rgba(255, 0, 0, 0.75)'; + context.lineWidth = 1; + context.fillText('1 frame = ' + timeToRender + ' ms = ' + fps + ' fps', 0, 20); + + var maxFps = 60; + context.strokeRect(0, 30, 250, 20); + context.fillRect(0, 30, 250 * Math.min(fps / maxFps, 1), 20); + } + + if (!drawAllLayers) { + needDraw[r.SELECT_BOX] = false; + } + } + + // motionblur: blit rendered blurry frames + if (motionBlur && mbPxRatio !== 1) { + var cxtNode = data.contexts[r.NODE]; + var txtNode = r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_NODE]; + + var cxtDrag = data.contexts[r.DRAG]; + var txtDrag = r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_DRAG]; + + var drawMotionBlur = function drawMotionBlur(cxt, txt, needClear) { + cxt.setTransform(1, 0, 0, 1, 0, 0); + + if (needClear || !motionBlurFadeEffect) { + cxt.clearRect(0, 0, r.canvasWidth, r.canvasHeight); + } else { + mbclear(cxt, 0, 0, r.canvasWidth, r.canvasHeight); + } + + var pxr = mbPxRatio; + + cxt.drawImage(txt, // img + 0, 0, // sx, sy + r.canvasWidth * pxr, r.canvasHeight * pxr, // sw, sh + 0, 0, // x, y + r.canvasWidth, r.canvasHeight // w, h + ); + }; + + if (needDraw[r.NODE] || needMbClear[r.NODE]) { + drawMotionBlur(cxtNode, txtNode, needMbClear[r.NODE]); + needDraw[r.NODE] = false; + } + + if (needDraw[r.DRAG] || needMbClear[r.DRAG]) { + drawMotionBlur(cxtDrag, txtDrag, needMbClear[r.DRAG]); + needDraw[r.DRAG] = false; + } + } + + r.prevViewport = vp; + + if (r.clearingMotionBlur) { + r.clearingMotionBlur = false; + r.motionBlurCleared = true; + r.motionBlur = true; + } + + if (motionBlur) { + r.motionBlurTimeout = setTimeout(function () { + r.motionBlurTimeout = null; + + r.clearedForMotionBlur[r.NODE] = false; + r.clearedForMotionBlur[r.DRAG] = false; + r.motionBlur = false; + r.clearingMotionBlur = !textureDraw; + r.mbFrames = 0; + + needDraw[r.NODE] = true; + needDraw[r.DRAG] = true; + + r.redraw(); + }, motionBlurDelay); + } + + if (!forcedContext) { + cy.emit('render'); + } +}; + +module.exports = CRp; + +/***/ }), +/* 133 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var math = __webpack_require__(2); + +var CRp = {}; + +// @O Polygon drawing +CRp.drawPolygonPath = function (context, x, y, width, height, points) { + + var halfW = width / 2; + var halfH = height / 2; + + if (context.beginPath) { + context.beginPath(); + } + + context.moveTo(x + halfW * points[0], y + halfH * points[1]); + + for (var i = 1; i < points.length / 2; i++) { + context.lineTo(x + halfW * points[i * 2], y + halfH * points[i * 2 + 1]); + } + + context.closePath(); +}; + +// Round rectangle drawing +CRp.drawRoundRectanglePath = function (context, x, y, width, height) { + + var halfWidth = width / 2; + var halfHeight = height / 2; + var cornerRadius = math.getRoundRectangleRadius(width, height); + + if (context.beginPath) { + context.beginPath(); + } + + // Start at top middle + context.moveTo(x, y - halfHeight); + // Arc from middle top to right side + context.arcTo(x + halfWidth, y - halfHeight, x + halfWidth, y, cornerRadius); + // Arc from right side to bottom + context.arcTo(x + halfWidth, y + halfHeight, x, y + halfHeight, cornerRadius); + // Arc from bottom to left side + context.arcTo(x - halfWidth, y + halfHeight, x - halfWidth, y, cornerRadius); + // Arc from left side to topBorder + context.arcTo(x - halfWidth, y - halfHeight, x, y - halfHeight, cornerRadius); + // Join line + context.lineTo(x, y - halfHeight); + + context.closePath(); +}; + +CRp.drawBottomRoundRectanglePath = function (context, x, y, width, height) { + + var halfWidth = width / 2; + var halfHeight = height / 2; + var cornerRadius = math.getRoundRectangleRadius(width, height); + + if (context.beginPath) { + context.beginPath(); + } + + // Start at top middle + context.moveTo(x, y - halfHeight); + context.lineTo(x + halfWidth, y - halfHeight); + context.lineTo(x + halfWidth, y); + + context.arcTo(x + halfWidth, y + halfHeight, x, y + halfHeight, cornerRadius); + context.arcTo(x - halfWidth, y + halfHeight, x - halfWidth, y, cornerRadius); + + context.lineTo(x - halfWidth, y - halfHeight); + context.lineTo(x, y - halfHeight); + + context.closePath(); +}; + +CRp.drawCutRectanglePath = function (context, x, y, width, height) { + + var halfWidth = width / 2; + var halfHeight = height / 2; + var cornerLength = math.getCutRectangleCornerLength(); + + if (context.beginPath) { + context.beginPath(); + } + + context.moveTo(x - halfWidth + cornerLength, y - halfHeight); + + context.lineTo(x + halfWidth - cornerLength, y - halfHeight); + context.lineTo(x + halfWidth, y - halfHeight + cornerLength); + context.lineTo(x + halfWidth, y + halfHeight - cornerLength); + context.lineTo(x + halfWidth - cornerLength, y + halfHeight); + context.lineTo(x - halfWidth + cornerLength, y + halfHeight); + context.lineTo(x - halfWidth, y + halfHeight - cornerLength); + context.lineTo(x - halfWidth, y - halfHeight + cornerLength); + + context.closePath(); +}; + +CRp.drawBarrelPath = function (context, x, y, width, height) { + + var halfWidth = width / 2; + var halfHeight = height / 2; + + var xBegin = x - halfWidth; + var xEnd = x + halfWidth; + var yBegin = y - halfHeight; + var yEnd = y + halfHeight; + + var barrelCurveConstants = math.getBarrelCurveConstants(width, height); + var wOffset = barrelCurveConstants.widthOffset; + var hOffset = barrelCurveConstants.heightOffset; + var ctrlPtXOffset = barrelCurveConstants.ctrlPtOffsetPct * wOffset; + + if (context.beginPath) { + context.beginPath(); + } + + context.moveTo(xBegin, yBegin + hOffset); + + context.lineTo(xBegin, yEnd - hOffset); + context.quadraticCurveTo(xBegin + ctrlPtXOffset, yEnd, xBegin + wOffset, yEnd); + + context.lineTo(xEnd - wOffset, yEnd); + context.quadraticCurveTo(xEnd - ctrlPtXOffset, yEnd, xEnd, yEnd - hOffset); + + context.lineTo(xEnd, yBegin + hOffset); + context.quadraticCurveTo(xEnd - ctrlPtXOffset, yBegin, xEnd - wOffset, yBegin); + + context.lineTo(xBegin + wOffset, yBegin); + context.quadraticCurveTo(xBegin + ctrlPtXOffset, yBegin, xBegin, yBegin + hOffset); + + context.closePath(); +}; + +var sin0 = Math.sin(0); +var cos0 = Math.cos(0); + +var sin = {}; +var cos = {}; + +var ellipseStepSize = Math.PI / 40; + +for (var i = 0 * Math.PI; i < 2 * Math.PI; i += ellipseStepSize) { + sin[i] = Math.sin(i); + cos[i] = Math.cos(i); +} + +CRp.drawEllipsePath = function (context, centerX, centerY, width, height) { + if (context.beginPath) { + context.beginPath(); + } + + if (context.ellipse) { + context.ellipse(centerX, centerY, width / 2, height / 2, 0, 0, 2 * Math.PI); + } else { + var xPos, yPos; + var rw = width / 2; + var rh = height / 2; + for (var i = 0 * Math.PI; i < 2 * Math.PI; i += ellipseStepSize) { + xPos = centerX - rw * sin[i] * sin0 + rw * cos[i] * cos0; + yPos = centerY + rh * cos[i] * sin0 + rh * sin[i] * cos0; + + if (i === 0) { + context.moveTo(xPos, yPos); + } else { + context.lineTo(xPos, yPos); + } + } + } + + context.closePath(); +}; + +module.exports = CRp; + +/***/ }), +/* 134 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); + +var CRp = {}; + +CRp.createBuffer = function (w, h) { + var buffer = document.createElement('canvas'); // eslint-disable-line no-undef + buffer.width = w; + buffer.height = h; + + return [buffer, buffer.getContext('2d')]; +}; + +CRp.bufferCanvasImage = function (options) { + var cy = this.cy; + var eles = cy.mutableElements(); + var bb = eles.boundingBox(); + var ctrRect = this.findContainerClientCoords(); + var width = options.full ? Math.ceil(bb.w) : ctrRect[2]; + var height = options.full ? Math.ceil(bb.h) : ctrRect[3]; + var specdMaxDims = is.number(options.maxWidth) || is.number(options.maxHeight); + var pxRatio = this.getPixelRatio(); + var scale = 1; + + if (options.scale !== undefined) { + width *= options.scale; + height *= options.scale; + + scale = options.scale; + } else if (specdMaxDims) { + var maxScaleW = Infinity; + var maxScaleH = Infinity; + + if (is.number(options.maxWidth)) { + maxScaleW = scale * options.maxWidth / width; + } + + if (is.number(options.maxHeight)) { + maxScaleH = scale * options.maxHeight / height; + } + + scale = Math.min(maxScaleW, maxScaleH); + + width *= scale; + height *= scale; + } + + if (!specdMaxDims) { + width *= pxRatio; + height *= pxRatio; + scale *= pxRatio; + } + + var buffCanvas = document.createElement('canvas'); // eslint-disable-line no-undef + + buffCanvas.width = width; + buffCanvas.height = height; + + buffCanvas.style.width = width + 'px'; + buffCanvas.style.height = height + 'px'; + + var buffCxt = buffCanvas.getContext('2d'); + + // Rasterize the layers, but only if container has nonzero size + if (width > 0 && height > 0) { + + buffCxt.clearRect(0, 0, width, height); + + buffCxt.globalCompositeOperation = 'source-over'; + + var zsortedEles = this.getCachedZSortedEles(); + + if (options.full) { + // draw the full bounds of the graph + buffCxt.translate(-bb.x1 * scale, -bb.y1 * scale); + buffCxt.scale(scale, scale); + + this.drawElements(buffCxt, zsortedEles); + + buffCxt.scale(1 / scale, 1 / scale); + buffCxt.translate(bb.x1 * scale, bb.y1 * scale); + } else { + // draw the current view + var pan = cy.pan(); + + var translation = { + x: pan.x * scale, + y: pan.y * scale + }; + + scale *= cy.zoom(); + + buffCxt.translate(translation.x, translation.y); + buffCxt.scale(scale, scale); + + this.drawElements(buffCxt, zsortedEles); + + buffCxt.scale(1 / scale, 1 / scale); + buffCxt.translate(-translation.x, -translation.y); + } + + // need to fill bg at end like this in order to fill cleared transparent pixels in jpgs + if (options.bg) { + buffCxt.globalCompositeOperation = 'destination-over'; + + buffCxt.fillStyle = options.bg; + buffCxt.rect(0, 0, width, height); + buffCxt.fill(); + } + } + + return buffCanvas; +}; + +function b64ToBlob(b64, mimeType) { + var bytes = atob(b64); + var buff = new ArrayBuffer(bytes.length); + var buffUint8 = new Uint8Array(buff); + + for (var i = 0; i < bytes.length; i++) { + buffUint8[i] = bytes.charCodeAt(i); + } + + return new Blob([buff], { type: mimeType }); +} + +function b64UriToB64(b64uri) { + var i = b64uri.indexOf(','); + + return b64uri.substr(i + 1); +}; + +function output(options, canvas, mimeType) { + var b64Uri = canvas.toDataURL(mimeType, options.quality); + + switch (options.output) { + case 'blob': + return b64ToBlob(b64UriToB64(b64Uri), mimeType); + + case 'base64': + return b64UriToB64(b64Uri); + + case 'base64uri': + default: + return b64Uri; + } +} + +CRp.png = function (options) { + return output(options, this.bufferCanvasImage(options), 'image/png'); +}; + +CRp.jpg = function (options) { + return output(options, this.bufferCanvasImage(options), 'image/jpeg'); +}; + +module.exports = CRp; + +/***/ }), +/* 135 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var CRp = {}; + +CRp.nodeShapeImpl = function (name, context, centerX, centerY, width, height, points) { + switch (name) { + case 'ellipse': + return this.drawEllipsePath(context, centerX, centerY, width, height); + case 'polygon': + return this.drawPolygonPath(context, centerX, centerY, width, height, points); + case 'roundrectangle': + return this.drawRoundRectanglePath(context, centerX, centerY, width, height); + case 'cutrectangle': + return this.drawCutRectanglePath(context, centerX, centerY, width, height); + case 'bottomroundrectangle': + return this.drawBottomRoundRectanglePath(context, centerX, centerY, width, height); + case 'barrel': + return this.drawBarrelPath(context, centerX, centerY, width, height); + } +}; + +module.exports = CRp; + +/***/ }), +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var util = __webpack_require__(1); +var Style = __webpack_require__(18); + +// a dummy stylesheet object that doesn't need a reference to the core +// (useful for init) +var Stylesheet = function Stylesheet() { + if (!(this instanceof Stylesheet)) { + return new Stylesheet(); + } + + this.length = 0; +}; + +var sheetfn = Stylesheet.prototype; + +sheetfn.instanceString = function () { + return 'stylesheet'; +}; + +// just store the selector to be parsed later +sheetfn.selector = function (selector) { + var i = this.length++; + + this[i] = { + selector: selector, + properties: [] + }; + + return this; // chaining +}; + +// just store the property to be parsed later +sheetfn.css = function (name, value) { + var i = this.length - 1; + + if (is.string(name)) { + this[i].properties.push({ + name: name, + value: value + }); + } else if (is.plainObject(name)) { + var map = name; + + for (var j = 0; j < Style.properties.length; j++) { + var prop = Style.properties[j]; + var mapVal = map[prop.name]; + + if (mapVal === undefined) { + // also try camel case name + mapVal = map[util.dash2camel(prop.name)]; + } + + if (mapVal !== undefined) { + var _name = prop.name; + var _value = mapVal; + + this[i].properties.push({ + name: _name, + value: _value + }); + } + } + } + + return this; // chaining +}; + +sheetfn.style = sheetfn.css; + +// generate a real style object from the dummy stylesheet +sheetfn.generateStyle = function (cy) { + var style = new Style(cy); + + return this.appendToStyle(style); +}; + +// append a dummy stylesheet object on a real style object +sheetfn.appendToStyle = function (style) { + for (var i = 0; i < this.length; i++) { + var context = this[i]; + var selector = context.selector; + var props = context.properties; + + style.selector(selector); // apply selector + + for (var j = 0; j < props.length; j++) { + var prop = props[j]; + + style.css(prop.name, prop.value); // apply property + } + } + + return style; +}; + +module.exports = Stylesheet; + +/***/ }), +/* 137 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = "3.2.18"; + +/***/ }) +/******/ ]); +}); \ No newline at end of file diff --git a/node_modules/cytoscape/dist/cytoscape.js b/node_modules/cytoscape/dist/cytoscape.js new file mode 100644 index 000000000..801d4feed --- /dev/null +++ b/node_modules/cytoscape/dist/cytoscape.js @@ -0,0 +1,29906 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["cytoscape"] = factory(); + else + root["cytoscape"] = factory(); +})(typeof self !== 'undefined' ? self : this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 20); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +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; }; + +/*global HTMLElement DocumentTouch */ + +var window = __webpack_require__(3); +var navigator = window ? window.navigator : null; +var document = window ? window.document : null; + +var typeofstr = _typeof(''); +var typeofobj = _typeof({}); +var typeoffn = _typeof(function () {}); +var typeofhtmlele = typeof HTMLElement === 'undefined' ? 'undefined' : _typeof(HTMLElement); + +var instanceStr = function instanceStr(obj) { + return obj && obj.instanceString && is.fn(obj.instanceString) ? obj.instanceString() : null; +}; + +var is = { + defined: function defined(obj) { + return obj != null; // not undefined or null + }, + + string: function string(obj) { + return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) == typeofstr; + }, + + fn: function fn(obj) { + return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === typeoffn; + }, + + array: function array(obj) { + return Array.isArray ? Array.isArray(obj) : obj != null && obj instanceof Array; + }, + + plainObject: function plainObject(obj) { + return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === typeofobj && !is.array(obj) && obj.constructor === Object; + }, + + object: function object(obj) { + return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === typeofobj; + }, + + number: function number(obj) { + return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === _typeof(1) && !isNaN(obj); + }, + + integer: function integer(obj) { + return is.number(obj) && Math.floor(obj) === obj; + }, + + bool: function bool(obj) { + return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === _typeof(true); + }, + + htmlElement: function htmlElement(obj) { + if ('undefined' === typeofhtmlele) { + return undefined; + } else { + return null != obj && obj instanceof HTMLElement; + } + }, + + elementOrCollection: function elementOrCollection(obj) { + return is.element(obj) || is.collection(obj); + }, + + element: function element(obj) { + return instanceStr(obj) === 'collection' && obj._private.single; + }, + + collection: function collection(obj) { + return instanceStr(obj) === 'collection' && !obj._private.single; + }, + + core: function core(obj) { + return instanceStr(obj) === 'core'; + }, + + style: function style(obj) { + return instanceStr(obj) === 'style'; + }, + + stylesheet: function stylesheet(obj) { + return instanceStr(obj) === 'stylesheet'; + }, + + event: function event(obj) { + return instanceStr(obj) === 'event'; + }, + + thread: function thread(obj) { + return instanceStr(obj) === 'thread'; + }, + + fabric: function fabric(obj) { + return instanceStr(obj) === 'fabric'; + }, + + emptyString: function emptyString(obj) { + if (obj === undefined || obj === null) { + // null is empty + return true; + } else if (obj === '' || obj.match(/^\s+$/)) { + return true; // empty string is empty + } + + return false; // otherwise, we don't know what we've got + }, + + nonemptyString: function nonemptyString(obj) { + if (obj && is.string(obj) && obj !== '' && !obj.match(/^\s+$/)) { + return true; + } + + return false; + }, + + domElement: function domElement(obj) { + if (typeof HTMLElement === 'undefined') { + return false; // we're not in a browser so it doesn't matter + } else { + return obj instanceof HTMLElement; + } + }, + + boundingBox: function boundingBox(obj) { + return is.plainObject(obj) && is.number(obj.x1) && is.number(obj.x2) && is.number(obj.y1) && is.number(obj.y2); + }, + + promise: function promise(obj) { + return is.object(obj) && is.fn(obj.then); + }, + + touch: function touch() { + return window && ('ontouchstart' in window || window.DocumentTouch && document instanceof DocumentTouch); + }, + + gecko: function gecko() { + return window && (typeof InstallTrigger !== 'undefined' || 'MozAppearance' in document.documentElement.style); + }, + + webkit: function webkit() { + return window && (typeof webkitURL !== 'undefined' || 'WebkitAppearance' in document.documentElement.style); + }, + + chromium: function chromium() { + return window && typeof chrome !== 'undefined'; + }, + + khtml: function khtml() { + return navigator && navigator.vendor.match(/kde/i); // probably a better way to detect this... + }, + + khtmlEtc: function khtmlEtc() { + return is.khtml() || is.webkit() || is.chromium(); + }, + + ms: function ms() { + return navigator && navigator.userAgent.match(/msie|trident|edge/i); // probably a better way to detect this... + }, + + windows: function windows() { + return navigator && navigator.appVersion.match(/Win/i); + }, + + mac: function mac() { + return navigator && navigator.appVersion.match(/Mac/i); + }, + + linux: function linux() { + return navigator && navigator.appVersion.match(/Linux/i); + }, + + unix: function unix() { + return navigator && navigator.appVersion.match(/X11/i); + } +}; + +module.exports = is; + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/*global console */ + +var is = __webpack_require__(0); +var math = __webpack_require__(2); + +var util = { + + MAX_INT: Number.MAX_SAFE_INTEGER || 9007199254740991, + + trueify: function trueify() { + return true; + }, + + falsify: function falsify() { + return false; + }, + + zeroify: function zeroify() { + return 0; + }, + + noop: function noop() {}, + + error: function error(msg) { + /* eslint-disable */ + if (console.error) { + console.error.apply(console, arguments); + + if (console.trace) { + console.trace(); + } + } else { + console.log.apply(console, arguments); + + if (console.trace) { + console.trace(); + } + } + /* eslint-enable */ + }, + + clone: function clone(obj) { + return this.extend({}, obj); + }, + + // gets a shallow copy of the argument + copy: function copy(obj) { + if (obj == null) { + return obj; + }if (is.array(obj)) { + return obj.slice(); + } else if (is.plainObject(obj)) { + return this.clone(obj); + } else { + return obj; + } + }, + + copyArray: function copyArray(arr) { + return arr.slice(); + }, + + clonePosition: function clonePosition(pos) { + return { x: pos.x, y: pos.y }; + }, + + uuid: function uuid(a, b // placeholders + ) { + for ( // loop :) + b = a = ''; // b - result , a - numeric letiable + a++ < 36; // + b += a * 51 & 52 // if "a" is not 9 or 14 or 19 or 24 + ? // return a random number or 4 + (a ^ 15 // if "a" is not 15 + ? // genetate a random number from 0 to 15 + 8 ^ Math.random() * (a ^ 20 ? 16 : 4) // unless "a" is 20, in which case a random number from 8 to 11 + : 4 // otherwise 4 + ).toString(16) : '-' // in other cases (if "a" is 9,14,19,24) insert "-" + ) {} + return b; + } + +}; + +util.makeBoundingBox = math.makeBoundingBox.bind(math); + +util._staticEmptyObject = {}; + +util.staticEmptyObject = function () { + return util._staticEmptyObject; +}; + +util.extend = Object.assign != null ? Object.assign.bind(Object) : function (tgt) { + var args = arguments; + + for (var i = 1; i < args.length; i++) { + var obj = args[i]; + + if (obj == null) { + continue; + } + + var keys = Object.keys(obj); + + for (var j = 0; j < keys.length; j++) { + var k = keys[j]; + + tgt[k] = obj[k]; + } + } + + return tgt; +}; + +util.assign = util.extend; + +util.default = function (val, def) { + if (val === undefined) { + return def; + } else { + return val; + } +}; + +util.removeFromArray = function (arr, ele, manyCopies) { + for (var i = arr.length; i >= 0; i--) { + if (arr[i] === ele) { + arr.splice(i, 1); + + if (!manyCopies) { + break; + } + } + } +}; + +util.clearArray = function (arr) { + arr.splice(0, arr.length); +}; + +util.push = function (arr, otherArr) { + for (var i = 0; i < otherArr.length; i++) { + var el = otherArr[i]; + + arr.push(el); + } +}; + +util.getPrefixedProperty = function (obj, propName, prefix) { + if (prefix) { + propName = this.prependCamel(prefix, propName); // e.g. (labelWidth, source) => sourceLabelWidth + } + + return obj[propName]; +}; + +util.setPrefixedProperty = function (obj, propName, prefix, value) { + if (prefix) { + propName = this.prependCamel(prefix, propName); // e.g. (labelWidth, source) => sourceLabelWidth + } + + obj[propName] = value; +}; + +[__webpack_require__(21), __webpack_require__(22), { memoize: __webpack_require__(13) }, __webpack_require__(23), __webpack_require__(24), __webpack_require__(25), __webpack_require__(27)].forEach(function (req) { + util.extend(util, req); +}); + +module.exports = util; + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var math = {}; + +math.arePositionsSame = function (p1, p2) { + return p1.x === p2.x && p1.y === p2.y; +}; + +math.copyPosition = function (p) { + return { x: p.x, y: p.y }; +}; + +math.modelToRenderedPosition = function (p, zoom, pan) { + return { + x: p.x * zoom + pan.x, + y: p.y * zoom + pan.y + }; +}; + +math.renderedToModelPosition = function (p, zoom, pan) { + return { + x: (p.x - pan.x) / zoom, + y: (p.y - pan.y) / zoom + }; +}; + +math.array2point = function (arr) { + return { + x: arr[0], + y: arr[1] + }; +}; + +math.deg2rad = function (deg) { + return Math.PI * deg / 180; +}; + +math.getAngleFromDisp = function (dispX, dispY) { + return Math.atan2(dispY, dispX) - Math.PI / 2; +}; + +math.log2 = Math.log2 || function (n) { + return Math.log(n) / Math.log(2); +}; + +math.signum = function (x) { + if (x > 0) { + return 1; + } else if (x < 0) { + return -1; + } else { + return 0; + } +}; + +math.dist = function (p1, p2) { + return Math.sqrt(math.sqdist(p1, p2)); +}; + +math.sqdist = function (p1, p2) { + var dx = p2.x - p1.x; + var dy = p2.y - p1.y; + + return dx * dx + dy * dy; +}; + +// from http://en.wikipedia.org/wiki/Bézier_curve#Quadratic_curves +math.qbezierAt = function (p0, p1, p2, t) { + return (1 - t) * (1 - t) * p0 + 2 * (1 - t) * t * p1 + t * t * p2; +}; + +math.qbezierPtAt = function (p0, p1, p2, t) { + return { + x: math.qbezierAt(p0.x, p1.x, p2.x, t), + y: math.qbezierAt(p0.y, p1.y, p2.y, t) + }; +}; + +math.lineAt = function (p0, p1, t, d) { + var vec = { + x: p1.x - p0.x, + y: p1.y - p0.y + }; + + var vecDist = math.dist(p0, p1); + + var normVec = { + x: vec.x / vecDist, + y: vec.y / vecDist + }; + + t = t == null ? 0 : t; + + d = d != null ? d : t * vecDist; + + return { + x: p0.x + normVec.x * d, + y: p0.y + normVec.y * d + }; +}; + +math.lineAtDist = function (p0, p1, d) { + return math.lineAt(p0, p1, undefined, d); +}; + +// get angle at A via cosine law +math.triangleAngle = function (A, B, C) { + var a = math.dist(B, C); + var b = math.dist(A, C); + var c = math.dist(A, B); + + return Math.acos((a * a + b * b - c * c) / (2 * a * b)); +}; + +math.bound = function (min, val, max) { + return Math.max(min, Math.min(max, val)); +}; + +// makes a full bb (x1, y1, x2, y2, w, h) from implicit params +math.makeBoundingBox = function (bb) { + if (bb == null) { + return { + x1: Infinity, + y1: Infinity, + x2: -Infinity, + y2: -Infinity, + w: 0, + h: 0 + }; + } else if (bb.x1 != null && bb.y1 != null) { + if (bb.x2 != null && bb.y2 != null && bb.x2 >= bb.x1 && bb.y2 >= bb.y1) { + return { + x1: bb.x1, + y1: bb.y1, + x2: bb.x2, + y2: bb.y2, + w: bb.x2 - bb.x1, + h: bb.y2 - bb.y1 + }; + } else if (bb.w != null && bb.h != null && bb.w >= 0 && bb.h >= 0) { + return { + x1: bb.x1, + y1: bb.y1, + x2: bb.x1 + bb.w, + y2: bb.y1 + bb.h, + w: bb.w, + h: bb.h + }; + } + } +}; + +math.updateBoundingBox = function (bb1, bb2) { + // update bb1 with bb2 bounds + + bb1.x1 = Math.min(bb1.x1, bb2.x1); + bb1.x2 = Math.max(bb1.x2, bb2.x2); + bb1.w = bb1.x2 - bb1.x1; + + bb1.y1 = Math.min(bb1.y1, bb2.y1); + bb1.y2 = Math.max(bb1.y2, bb2.y2); + bb1.h = bb1.y2 - bb1.y1; +}; + +math.expandBoundingBoxByPoint = function (bb, x, y) { + bb.x1 = Math.min(bb.x1, x); + bb.x2 = Math.max(bb.x2, x); + bb.w = bb.x2 - bb.x1; + + bb.y1 = Math.min(bb.y1, y); + bb.y2 = Math.max(bb.y2, y); + bb.h = bb.y2 - bb.y1; +}; + +math.expandBoundingBox = function (bb, padding) { + bb.x1 -= padding; + bb.x2 += padding; + bb.y1 -= padding; + bb.y2 += padding; + bb.w = bb.x2 - bb.x1; + bb.h = bb.y2 - bb.y1; + + return bb; +}; + +math.boundingBoxesIntersect = function (bb1, bb2) { + // case: one bb to right of other + if (bb1.x1 > bb2.x2) { + return false; + } + if (bb2.x1 > bb1.x2) { + return false; + } + + // case: one bb to left of other + if (bb1.x2 < bb2.x1) { + return false; + } + if (bb2.x2 < bb1.x1) { + return false; + } + + // case: one bb above other + if (bb1.y2 < bb2.y1) { + return false; + } + if (bb2.y2 < bb1.y1) { + return false; + } + + // case: one bb below other + if (bb1.y1 > bb2.y2) { + return false; + } + if (bb2.y1 > bb1.y2) { + return false; + } + + // otherwise, must have some overlap + return true; +}; + +math.inBoundingBox = function (bb, x, y) { + return bb.x1 <= x && x <= bb.x2 && bb.y1 <= y && y <= bb.y2; +}; + +math.pointInBoundingBox = function (bb, pt) { + return this.inBoundingBox(bb, pt.x, pt.y); +}; + +math.boundingBoxInBoundingBox = function (bb1, bb2) { + return math.inBoundingBox(bb1, bb2.x1, bb2.y1) && math.inBoundingBox(bb1, bb2.x2, bb2.y2); +}; + +math.roundRectangleIntersectLine = function (x, y, nodeX, nodeY, width, height, padding) { + + var cornerRadius = this.getRoundRectangleRadius(width, height); + + var halfWidth = width / 2; + var halfHeight = height / 2; + + // Check intersections with straight line segments + var straightLineIntersections = void 0; + + // Top segment, left to right + { + var topStartX = nodeX - halfWidth + cornerRadius - padding; + var topStartY = nodeY - halfHeight - padding; + var topEndX = nodeX + halfWidth - cornerRadius + padding; + var topEndY = topStartY; + + straightLineIntersections = this.finiteLinesIntersect(x, y, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false); + + if (straightLineIntersections.length > 0) { + return straightLineIntersections; + } + } + + // Right segment, top to bottom + { + var rightStartX = nodeX + halfWidth + padding; + var rightStartY = nodeY - halfHeight + cornerRadius - padding; + var rightEndX = rightStartX; + var rightEndY = nodeY + halfHeight - cornerRadius + padding; + + straightLineIntersections = this.finiteLinesIntersect(x, y, nodeX, nodeY, rightStartX, rightStartY, rightEndX, rightEndY, false); + + if (straightLineIntersections.length > 0) { + return straightLineIntersections; + } + } + + // Bottom segment, left to right + { + var bottomStartX = nodeX - halfWidth + cornerRadius - padding; + var bottomStartY = nodeY + halfHeight + padding; + var bottomEndX = nodeX + halfWidth - cornerRadius + padding; + var bottomEndY = bottomStartY; + + straightLineIntersections = this.finiteLinesIntersect(x, y, nodeX, nodeY, bottomStartX, bottomStartY, bottomEndX, bottomEndY, false); + + if (straightLineIntersections.length > 0) { + return straightLineIntersections; + } + } + + // Left segment, top to bottom + { + var leftStartX = nodeX - halfWidth - padding; + var leftStartY = nodeY - halfHeight + cornerRadius - padding; + var leftEndX = leftStartX; + var leftEndY = nodeY + halfHeight - cornerRadius + padding; + + straightLineIntersections = this.finiteLinesIntersect(x, y, nodeX, nodeY, leftStartX, leftStartY, leftEndX, leftEndY, false); + + if (straightLineIntersections.length > 0) { + return straightLineIntersections; + } + } + + // Check intersections with arc segments + var arcIntersections = void 0; + + // Top Left + { + var topLeftCenterX = nodeX - halfWidth + cornerRadius; + var topLeftCenterY = nodeY - halfHeight + cornerRadius; + arcIntersections = this.intersectLineCircle(x, y, nodeX, nodeY, topLeftCenterX, topLeftCenterY, cornerRadius + padding); + + // Ensure the intersection is on the desired quarter of the circle + if (arcIntersections.length > 0 && arcIntersections[0] <= topLeftCenterX && arcIntersections[1] <= topLeftCenterY) { + return [arcIntersections[0], arcIntersections[1]]; + } + } + + // Top Right + { + var topRightCenterX = nodeX + halfWidth - cornerRadius; + var topRightCenterY = nodeY - halfHeight + cornerRadius; + arcIntersections = this.intersectLineCircle(x, y, nodeX, nodeY, topRightCenterX, topRightCenterY, cornerRadius + padding); + + // Ensure the intersection is on the desired quarter of the circle + if (arcIntersections.length > 0 && arcIntersections[0] >= topRightCenterX && arcIntersections[1] <= topRightCenterY) { + return [arcIntersections[0], arcIntersections[1]]; + } + } + + // Bottom Right + { + var bottomRightCenterX = nodeX + halfWidth - cornerRadius; + var bottomRightCenterY = nodeY + halfHeight - cornerRadius; + arcIntersections = this.intersectLineCircle(x, y, nodeX, nodeY, bottomRightCenterX, bottomRightCenterY, cornerRadius + padding); + + // Ensure the intersection is on the desired quarter of the circle + if (arcIntersections.length > 0 && arcIntersections[0] >= bottomRightCenterX && arcIntersections[1] >= bottomRightCenterY) { + return [arcIntersections[0], arcIntersections[1]]; + } + } + + // Bottom Left + { + var bottomLeftCenterX = nodeX - halfWidth + cornerRadius; + var bottomLeftCenterY = nodeY + halfHeight - cornerRadius; + arcIntersections = this.intersectLineCircle(x, y, nodeX, nodeY, bottomLeftCenterX, bottomLeftCenterY, cornerRadius + padding); + + // Ensure the intersection is on the desired quarter of the circle + if (arcIntersections.length > 0 && arcIntersections[0] <= bottomLeftCenterX && arcIntersections[1] >= bottomLeftCenterY) { + return [arcIntersections[0], arcIntersections[1]]; + } + } + + return []; // if nothing +}; + +math.inLineVicinity = function (x, y, lx1, ly1, lx2, ly2, tolerance) { + var t = tolerance; + + var x1 = Math.min(lx1, lx2); + var x2 = Math.max(lx1, lx2); + var y1 = Math.min(ly1, ly2); + var y2 = Math.max(ly1, ly2); + + return x1 - t <= x && x <= x2 + t && y1 - t <= y && y <= y2 + t; +}; + +math.inBezierVicinity = function (x, y, x1, y1, x2, y2, x3, y3, tolerance) { + + var bb = { + x1: Math.min(x1, x3, x2) - tolerance, + x2: Math.max(x1, x3, x2) + tolerance, + y1: Math.min(y1, y3, y2) - tolerance, + y2: Math.max(y1, y3, y2) + tolerance + }; + + // if outside the rough bounding box for the bezier, then it can't be a hit + if (x < bb.x1 || x > bb.x2 || y < bb.y1 || y > bb.y2) { + // console.log('bezier out of rough bb') + return false; + } else { + // console.log('do more expensive check'); + return true; + } +}; +math.solveQuadratic = function (a, b, c, val) { + c -= val; + + var r = b * b - 4 * a * c; + + if (r < 0) { + return []; + } + + var sqrtR = Math.sqrt(r); + var denom = 2 * a; + var root1 = (-b + sqrtR) / denom; + var root2 = (-b - sqrtR) / denom; + + return [root1, root2]; +}; + +math.solveCubic = function (a, b, c, d, result) { + + // Solves a cubic function, returns root in form [r1, i1, r2, i2, r3, i3], where + // r is the real component, i is the imaginary component + + // An implementation of the Cardano method from the year 1545 + // http://en.wikipedia.org/wiki/Cubic_function#The_nature_of_the_roots + + b /= a; + c /= a; + d /= a; + + var discriminant = void 0, + q = void 0, + r = void 0, + dum1 = void 0, + s = void 0, + t = void 0, + term1 = void 0, + r13 = void 0; + + q = (3.0 * c - b * b) / 9.0; + r = -(27.0 * d) + b * (9.0 * c - 2.0 * (b * b)); + r /= 54.0; + + discriminant = q * q * q + r * r; + result[1] = 0; + term1 = b / 3.0; + + if (discriminant > 0) { + s = r + Math.sqrt(discriminant); + s = s < 0 ? -Math.pow(-s, 1.0 / 3.0) : Math.pow(s, 1.0 / 3.0); + t = r - Math.sqrt(discriminant); + t = t < 0 ? -Math.pow(-t, 1.0 / 3.0) : Math.pow(t, 1.0 / 3.0); + result[0] = -term1 + s + t; + term1 += (s + t) / 2.0; + result[4] = result[2] = -term1; + term1 = Math.sqrt(3.0) * (-t + s) / 2; + result[3] = term1; + result[5] = -term1; + return; + } + + result[5] = result[3] = 0; + + if (discriminant === 0) { + r13 = r < 0 ? -Math.pow(-r, 1.0 / 3.0) : Math.pow(r, 1.0 / 3.0); + result[0] = -term1 + 2.0 * r13; + result[4] = result[2] = -(r13 + term1); + return; + } + + q = -q; + dum1 = q * q * q; + dum1 = Math.acos(r / Math.sqrt(dum1)); + r13 = 2.0 * Math.sqrt(q); + result[0] = -term1 + r13 * Math.cos(dum1 / 3.0); + result[2] = -term1 + r13 * Math.cos((dum1 + 2.0 * Math.PI) / 3.0); + result[4] = -term1 + r13 * Math.cos((dum1 + 4.0 * Math.PI) / 3.0); + + return; +}; + +math.sqdistToQuadraticBezier = function (x, y, x1, y1, x2, y2, x3, y3) { + + // Find minimum distance by using the minimum of the distance + // function between the given point and the curve + + // This gives the coefficients of the resulting cubic equation + // whose roots tell us where a possible minimum is + // (Coefficients are divided by 4) + + var a = 1.0 * x1 * x1 - 4 * x1 * x2 + 2 * x1 * x3 + 4 * x2 * x2 - 4 * x2 * x3 + x3 * x3 + y1 * y1 - 4 * y1 * y2 + 2 * y1 * y3 + 4 * y2 * y2 - 4 * y2 * y3 + y3 * y3; + + var b = 1.0 * 9 * x1 * x2 - 3 * x1 * x1 - 3 * x1 * x3 - 6 * x2 * x2 + 3 * x2 * x3 + 9 * y1 * y2 - 3 * y1 * y1 - 3 * y1 * y3 - 6 * y2 * y2 + 3 * y2 * y3; + + var c = 1.0 * 3 * x1 * x1 - 6 * x1 * x2 + x1 * x3 - x1 * x + 2 * x2 * x2 + 2 * x2 * x - x3 * x + 3 * y1 * y1 - 6 * y1 * y2 + y1 * y3 - y1 * y + 2 * y2 * y2 + 2 * y2 * y - y3 * y; + + var d = 1.0 * x1 * x2 - x1 * x1 + x1 * x - x2 * x + y1 * y2 - y1 * y1 + y1 * y - y2 * y; + + // debug("coefficients: " + a / a + ", " + b / a + ", " + c / a + ", " + d / a); + + var roots = []; + + // Use the cubic solving algorithm + this.solveCubic(a, b, c, d, roots); + + var zeroThreshold = 0.0000001; + + var params = []; + + for (var index = 0; index < 6; index += 2) { + if (Math.abs(roots[index + 1]) < zeroThreshold && roots[index] >= 0 && roots[index] <= 1.0) { + params.push(roots[index]); + } + } + + params.push(1.0); + params.push(0.0); + + var minDistanceSquared = -1; + + var curX = void 0, + curY = void 0, + distSquared = void 0; + for (var i = 0; i < params.length; i++) { + curX = Math.pow(1.0 - params[i], 2.0) * x1 + 2.0 * (1 - params[i]) * params[i] * x2 + params[i] * params[i] * x3; + + curY = Math.pow(1 - params[i], 2.0) * y1 + 2 * (1.0 - params[i]) * params[i] * y2 + params[i] * params[i] * y3; + + distSquared = Math.pow(curX - x, 2) + Math.pow(curY - y, 2); + // debug('distance for param ' + params[i] + ": " + Math.sqrt(distSquared)); + if (minDistanceSquared >= 0) { + if (distSquared < minDistanceSquared) { + minDistanceSquared = distSquared; + } + } else { + minDistanceSquared = distSquared; + } + } + + return minDistanceSquared; +}; + +math.sqdistToFiniteLine = function (x, y, x1, y1, x2, y2) { + var offset = [x - x1, y - y1]; + var line = [x2 - x1, y2 - y1]; + + var lineSq = line[0] * line[0] + line[1] * line[1]; + var hypSq = offset[0] * offset[0] + offset[1] * offset[1]; + + var dotProduct = offset[0] * line[0] + offset[1] * line[1]; + var adjSq = dotProduct * dotProduct / lineSq; + + if (dotProduct < 0) { + return hypSq; + } + + if (adjSq > lineSq) { + return (x - x2) * (x - x2) + (y - y2) * (y - y2); + } + + return hypSq - adjSq; +}; + +math.pointInsidePolygonPoints = function (x, y, points) { + var x1 = void 0, + y1 = void 0, + x2 = void 0, + y2 = void 0; + var y3 = void 0; + + // Intersect with vertical line through (x, y) + var up = 0; + // let down = 0; + for (var i = 0; i < points.length / 2; i++) { + x1 = points[i * 2]; + y1 = points[i * 2 + 1]; + + if (i + 1 < points.length / 2) { + x2 = points[(i + 1) * 2]; + y2 = points[(i + 1) * 2 + 1]; + } else { + x2 = points[(i + 1 - points.length / 2) * 2]; + y2 = points[(i + 1 - points.length / 2) * 2 + 1]; + } + + if (x1 == x && x2 == x) { + // then ignore + } else if (x1 >= x && x >= x2 || x1 <= x && x <= x2) { + + y3 = (x - x1) / (x2 - x1) * (y2 - y1) + y1; + + if (y3 > y) { + up++; + } + + // if( y3 < y ){ + // down++; + // } + } else { + continue; + } + } + + if (up % 2 === 0) { + return false; + } else { + return true; + } +}; + +math.pointInsidePolygon = function (x, y, basePoints, centerX, centerY, width, height, direction, padding) { + + //let direction = arguments[6]; + var transformedPoints = new Array(basePoints.length); + + // Gives negative angle + var angle = void 0; + + if (direction[0] != null) { + angle = Math.atan(direction[1] / direction[0]); + + if (direction[0] < 0) { + angle = angle + Math.PI / 2; + } else { + angle = -angle - Math.PI / 2; + } + } else { + angle = direction; + } + + var cos = Math.cos(-angle); + var sin = Math.sin(-angle); + + // console.log("base: " + basePoints); + for (var i = 0; i < transformedPoints.length / 2; i++) { + transformedPoints[i * 2] = width / 2 * (basePoints[i * 2] * cos - basePoints[i * 2 + 1] * sin); + + transformedPoints[i * 2 + 1] = height / 2 * (basePoints[i * 2 + 1] * cos + basePoints[i * 2] * sin); + + transformedPoints[i * 2] += centerX; + transformedPoints[i * 2 + 1] += centerY; + } + + var points = void 0; + + if (padding > 0) { + var expandedLineSet = this.expandPolygon(transformedPoints, -padding); + + points = this.joinLines(expandedLineSet); + } else { + points = transformedPoints; + } + + return math.pointInsidePolygonPoints(x, y, points); +}; + +math.joinLines = function (lineSet) { + + var vertices = new Array(lineSet.length / 2); + + var currentLineStartX = void 0, + currentLineStartY = void 0, + currentLineEndX = void 0, + currentLineEndY = void 0; + var nextLineStartX = void 0, + nextLineStartY = void 0, + nextLineEndX = void 0, + nextLineEndY = void 0; + + for (var i = 0; i < lineSet.length / 4; i++) { + currentLineStartX = lineSet[i * 4]; + currentLineStartY = lineSet[i * 4 + 1]; + currentLineEndX = lineSet[i * 4 + 2]; + currentLineEndY = lineSet[i * 4 + 3]; + + if (i < lineSet.length / 4 - 1) { + nextLineStartX = lineSet[(i + 1) * 4]; + nextLineStartY = lineSet[(i + 1) * 4 + 1]; + nextLineEndX = lineSet[(i + 1) * 4 + 2]; + nextLineEndY = lineSet[(i + 1) * 4 + 3]; + } else { + nextLineStartX = lineSet[0]; + nextLineStartY = lineSet[1]; + nextLineEndX = lineSet[2]; + nextLineEndY = lineSet[3]; + } + + var intersection = this.finiteLinesIntersect(currentLineStartX, currentLineStartY, currentLineEndX, currentLineEndY, nextLineStartX, nextLineStartY, nextLineEndX, nextLineEndY, true); + + vertices[i * 2] = intersection[0]; + vertices[i * 2 + 1] = intersection[1]; + } + + return vertices; +}; + +math.expandPolygon = function (points, pad) { + + var expandedLineSet = new Array(points.length * 2); + + var currentPointX = void 0, + currentPointY = void 0, + nextPointX = void 0, + nextPointY = void 0; + + for (var i = 0; i < points.length / 2; i++) { + currentPointX = points[i * 2]; + currentPointY = points[i * 2 + 1]; + + if (i < points.length / 2 - 1) { + nextPointX = points[(i + 1) * 2]; + nextPointY = points[(i + 1) * 2 + 1]; + } else { + nextPointX = points[0]; + nextPointY = points[1]; + } + + // Current line: [currentPointX, currentPointY] to [nextPointX, nextPointY] + + // Assume CCW polygon winding + + var offsetX = nextPointY - currentPointY; + var offsetY = -(nextPointX - currentPointX); + + // Normalize + var offsetLength = Math.sqrt(offsetX * offsetX + offsetY * offsetY); + var normalizedOffsetX = offsetX / offsetLength; + var normalizedOffsetY = offsetY / offsetLength; + + expandedLineSet[i * 4] = currentPointX + normalizedOffsetX * pad; + expandedLineSet[i * 4 + 1] = currentPointY + normalizedOffsetY * pad; + expandedLineSet[i * 4 + 2] = nextPointX + normalizedOffsetX * pad; + expandedLineSet[i * 4 + 3] = nextPointY + normalizedOffsetY * pad; + } + + return expandedLineSet; +}; + +math.intersectLineEllipse = function (x, y, centerX, centerY, ellipseWradius, ellipseHradius) { + + var dispX = centerX - x; + var dispY = centerY - y; + + dispX /= ellipseWradius; + dispY /= ellipseHradius; + + var len = Math.sqrt(dispX * dispX + dispY * dispY); + + var newLength = len - 1; + + if (newLength < 0) { + return []; + } + + var lenProportion = newLength / len; + + return [(centerX - x) * lenProportion + x, (centerY - y) * lenProportion + y]; +}; + +math.checkInEllipse = function (x, y, width, height, centerX, centerY, padding) { + x -= centerX; + y -= centerY; + + x /= width / 2 + padding; + y /= height / 2 + padding; + + return x * x + y * y <= 1; +}; + +// Returns intersections of increasing distance from line's start point +math.intersectLineCircle = function (x1, y1, x2, y2, centerX, centerY, radius) { + + // Calculate d, direction vector of line + var d = [x2 - x1, y2 - y1]; // Direction vector of line + var f = [x1 - centerX, y1 - centerY]; + + var a = d[0] * d[0] + d[1] * d[1]; + var b = 2 * (f[0] * d[0] + f[1] * d[1]); + var c = f[0] * f[0] + f[1] * f[1] - radius * radius; + + var discriminant = b * b - 4 * a * c; + + if (discriminant < 0) { + return []; + } + + var t1 = (-b + Math.sqrt(discriminant)) / (2 * a); + var t2 = (-b - Math.sqrt(discriminant)) / (2 * a); + + var tMin = Math.min(t1, t2); + var tMax = Math.max(t1, t2); + var inRangeParams = []; + + if (tMin >= 0 && tMin <= 1) { + inRangeParams.push(tMin); + } + + if (tMax >= 0 && tMax <= 1) { + inRangeParams.push(tMax); + } + + if (inRangeParams.length === 0) { + return []; + } + + var nearIntersectionX = inRangeParams[0] * d[0] + x1; + var nearIntersectionY = inRangeParams[0] * d[1] + y1; + + if (inRangeParams.length > 1) { + + if (inRangeParams[0] == inRangeParams[1]) { + return [nearIntersectionX, nearIntersectionY]; + } else { + + var farIntersectionX = inRangeParams[1] * d[0] + x1; + var farIntersectionY = inRangeParams[1] * d[1] + y1; + + return [nearIntersectionX, nearIntersectionY, farIntersectionX, farIntersectionY]; + } + } else { + return [nearIntersectionX, nearIntersectionY]; + } +}; + +math.findCircleNearPoint = function (centerX, centerY, radius, farX, farY) { + + var displacementX = farX - centerX; + var displacementY = farY - centerY; + var distance = Math.sqrt(displacementX * displacementX + displacementY * displacementY); + + var unitDisplacementX = displacementX / distance; + var unitDisplacementY = displacementY / distance; + + return [centerX + unitDisplacementX * radius, centerY + unitDisplacementY * radius]; +}; + +math.findMaxSqDistanceToOrigin = function (points) { + var maxSqDistance = 0.000001; + var sqDistance = void 0; + + for (var i = 0; i < points.length / 2; i++) { + + sqDistance = points[i * 2] * points[i * 2] + points[i * 2 + 1] * points[i * 2 + 1]; + + if (sqDistance > maxSqDistance) { + maxSqDistance = sqDistance; + } + } + + return maxSqDistance; +}; + +math.midOfThree = function (a, b, c) { + if (b <= a && a <= c || c <= a && a <= b) { + return a; + } else if (a <= b && b <= c || c <= b && b <= a) { + return b; + } else { + return c; + } +}; + +// (x1,y1)=>(x2,y2) intersect with (x3,y3)=>(x4,y4) +math.finiteLinesIntersect = function (x1, y1, x2, y2, x3, y3, x4, y4, infiniteLines) { + + var dx13 = x1 - x3; + var dx21 = x2 - x1; + var dx43 = x4 - x3; + + var dy13 = y1 - y3; + var dy21 = y2 - y1; + var dy43 = y4 - y3; + + var ua_t = dx43 * dy13 - dy43 * dx13; + var ub_t = dx21 * dy13 - dy21 * dx13; + var u_b = dy43 * dx21 - dx43 * dy21; + + if (u_b !== 0) { + var ua = ua_t / u_b; + var ub = ub_t / u_b; + + var flptThreshold = 0.001; + var min = 0 - flptThreshold; + var max = 1 + flptThreshold; + + if (min <= ua && ua <= max && min <= ub && ub <= max) { + return [x1 + ua * dx21, y1 + ua * dy21]; + } else { + if (!infiniteLines) { + return []; + } else { + return [x1 + ua * dx21, y1 + ua * dy21]; + } + } + } else { + if (ua_t === 0 || ub_t === 0) { + + // Parallel, coincident lines. Check if overlap + + // Check endpoint of second line + if (this.midOfThree(x1, x2, x4) === x4) { + return [x4, y4]; + } + + // Check start point of second line + if (this.midOfThree(x1, x2, x3) === x3) { + return [x3, y3]; + } + + // Endpoint of first line + if (this.midOfThree(x3, x4, x2) === x2) { + return [x2, y2]; + } + + return []; + } else { + + // Parallel, non-coincident + return []; + } + } +}; + +// math.polygonIntersectLine( x, y, basePoints, centerX, centerY, width, height, padding ) +// intersect a node polygon (pts transformed) +// +// math.polygonIntersectLine( x, y, basePoints, centerX, centerY ) +// intersect the points (no transform) +math.polygonIntersectLine = function (x, y, basePoints, centerX, centerY, width, height, padding) { + + var intersections = []; + var intersection = void 0; + + var transformedPoints = new Array(basePoints.length); + + var doTransform = true; + if (arguments.length === 5) { + doTransform = false; + } + + var points = void 0; + + if (doTransform) { + for (var i = 0; i < transformedPoints.length / 2; i++) { + transformedPoints[i * 2] = basePoints[i * 2] * width + centerX; + transformedPoints[i * 2 + 1] = basePoints[i * 2 + 1] * height + centerY; + } + + if (padding > 0) { + var expandedLineSet = math.expandPolygon(transformedPoints, -padding); + + points = math.joinLines(expandedLineSet); + } else { + points = transformedPoints; + } + } else { + points = basePoints; + } + + var currentX = void 0, + currentY = void 0, + nextX = void 0, + nextY = void 0; + + for (var _i = 0; _i < points.length / 2; _i++) { + + currentX = points[_i * 2]; + currentY = points[_i * 2 + 1]; + + if (_i < points.length / 2 - 1) { + nextX = points[(_i + 1) * 2]; + nextY = points[(_i + 1) * 2 + 1]; + } else { + nextX = points[0]; + nextY = points[1]; + } + + intersection = this.finiteLinesIntersect(x, y, centerX, centerY, currentX, currentY, nextX, nextY); + + if (intersection.length !== 0) { + intersections.push(intersection[0], intersection[1]); + } + } + + return intersections; +}; + +math.shortenIntersection = function (intersection, offset, amount) { + + var disp = [intersection[0] - offset[0], intersection[1] - offset[1]]; + + var length = Math.sqrt(disp[0] * disp[0] + disp[1] * disp[1]); + + var lenRatio = (length - amount) / length; + + if (lenRatio < 0) { + lenRatio = 0.00001; + } + + return [offset[0] + lenRatio * disp[0], offset[1] + lenRatio * disp[1]]; +}; + +math.generateUnitNgonPointsFitToSquare = function (sides, rotationRadians) { + var points = math.generateUnitNgonPoints(sides, rotationRadians); + points = math.fitPolygonToSquare(points); + + return points; +}; + +math.fitPolygonToSquare = function (points) { + var x = void 0, + y = void 0; + var sides = points.length / 2; + var minX = Infinity, + minY = Infinity, + maxX = -Infinity, + maxY = -Infinity; + + for (var i = 0; i < sides; i++) { + x = points[2 * i]; + y = points[2 * i + 1]; + + minX = Math.min(minX, x); + maxX = Math.max(maxX, x); + minY = Math.min(minY, y); + maxY = Math.max(maxY, y); + } + + // stretch factors + var sx = 2 / (maxX - minX); + var sy = 2 / (maxY - minY); + + for (var _i2 = 0; _i2 < sides; _i2++) { + x = points[2 * _i2] = points[2 * _i2] * sx; + y = points[2 * _i2 + 1] = points[2 * _i2 + 1] * sy; + + minX = Math.min(minX, x); + maxX = Math.max(maxX, x); + minY = Math.min(minY, y); + maxY = Math.max(maxY, y); + } + + if (minY < -1) { + for (var _i3 = 0; _i3 < sides; _i3++) { + y = points[2 * _i3 + 1] = points[2 * _i3 + 1] + (-1 - minY); + } + } + + return points; +}; + +math.generateUnitNgonPoints = function (sides, rotationRadians) { + + var increment = 1.0 / sides * 2 * Math.PI; + var startAngle = sides % 2 === 0 ? Math.PI / 2.0 + increment / 2.0 : Math.PI / 2.0; + + startAngle += rotationRadians; + + var points = new Array(sides * 2); + + var currentAngle = void 0; + for (var i = 0; i < sides; i++) { + currentAngle = i * increment + startAngle; + + points[2 * i] = Math.cos(currentAngle); // x + points[2 * i + 1] = Math.sin(-currentAngle); // y + } + + return points; +}; + +math.getRoundRectangleRadius = function (width, height) { + + // Set the default radius, unless half of width or height is smaller than default + return Math.min(width / 4, height / 4, 8); +}; + +math.getCutRectangleCornerLength = function () { + return 8; +}; + +math.bezierPtsToQuadCoeff = function (p0, p1, p2) { + return [p0 - 2 * p1 + p2, 2 * (p1 - p0), p0]; +}; + +math.getBarrelCurveConstants = function (width, height) { + // get curve width, height, and control point position offsets as a percentage of node height / width + return { + heightOffset: Math.min(15, 0.05 * height), + widthOffset: Math.min(100, 0.25 * width), + ctrlPtOffsetPct: 0.05 + }; +}; + +module.exports = math; + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = typeof window === 'undefined' ? null : window; // eslint-disable-line no-undef + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// use this module to cherry pick functions into your prototype +// (useful for functions shared between the core and collections, for example) + +// e.g. +// let foo = define.foo({ /* params... */ }) + +var util = __webpack_require__(1); + +var define = {}; + +[__webpack_require__(44), __webpack_require__(46), __webpack_require__(47)].forEach(function (m) { + util.assign(define, m); +}); + +module.exports = define; + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +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; }; + +/*! +Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable +Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) +Licensed under The MIT License (http://opensource.org/licenses/MIT) +*/ + +/* promise states [Promises/A+ 2.1] */ +var STATE_PENDING = 0; /* [Promises/A+ 2.1.1] */ +var STATE_FULFILLED = 1; /* [Promises/A+ 2.1.2] */ +var STATE_REJECTED = 2; /* [Promises/A+ 2.1.3] */ + +/* promise object constructor */ +var api = function api(executor) { + /* optionally support non-constructor/plain-function call */ + if (!(this instanceof api)) return new api(executor); + + /* initialize object */ + this.id = 'Thenable/1.0.7'; + this.state = STATE_PENDING; /* initial state */ + this.fulfillValue = undefined; /* initial value */ /* [Promises/A+ 1.3, 2.1.2.2] */ + this.rejectReason = undefined; /* initial reason */ /* [Promises/A+ 1.5, 2.1.3.2] */ + this.onFulfilled = []; /* initial handlers */ + this.onRejected = []; /* initial handlers */ + + /* provide optional information-hiding proxy */ + this.proxy = { + then: this.then.bind(this) + }; + + /* support optional executor function */ + if (typeof executor === 'function') executor.call(this, this.fulfill.bind(this), this.reject.bind(this)); +}; + +/* promise API methods */ +api.prototype = { + /* promise resolving methods */ + fulfill: function fulfill(value) { + return deliver(this, STATE_FULFILLED, 'fulfillValue', value); + }, + reject: function reject(value) { + return deliver(this, STATE_REJECTED, 'rejectReason', value); + }, + + /* "The then Method" [Promises/A+ 1.1, 1.2, 2.2] */ + then: function then(onFulfilled, onRejected) { + var curr = this; + var next = new api(); /* [Promises/A+ 2.2.7] */ + curr.onFulfilled.push(resolver(onFulfilled, next, 'fulfill')); /* [Promises/A+ 2.2.2/2.2.6] */ + curr.onRejected.push(resolver(onRejected, next, 'reject')); /* [Promises/A+ 2.2.3/2.2.6] */ + execute(curr); + return next.proxy; /* [Promises/A+ 2.2.7, 3.3] */ + } +}; + +/* deliver an action */ +var deliver = function deliver(curr, state, name, value) { + if (curr.state === STATE_PENDING) { + curr.state = state; /* [Promises/A+ 2.1.2.1, 2.1.3.1] */ + curr[name] = value; /* [Promises/A+ 2.1.2.2, 2.1.3.2] */ + execute(curr); + } + return curr; +}; + +/* execute all handlers */ +var execute = function execute(curr) { + if (curr.state === STATE_FULFILLED) execute_handlers(curr, 'onFulfilled', curr.fulfillValue);else if (curr.state === STATE_REJECTED) execute_handlers(curr, 'onRejected', curr.rejectReason); +}; + +/* execute particular set of handlers */ +var execute_handlers = function execute_handlers(curr, name, value) { + /* global setImmediate: true */ + /* global setTimeout: true */ + + /* short-circuit processing */ + if (curr[name].length === 0) return; + + /* iterate over all handlers, exactly once */ + var handlers = curr[name]; + curr[name] = []; /* [Promises/A+ 2.2.2.3, 2.2.3.3] */ + var func = function func() { + for (var i = 0; i < handlers.length; i++) { + handlers[i](value); + } /* [Promises/A+ 2.2.5] */ + }; + + /* execute procedure asynchronously */ /* [Promises/A+ 2.2.4, 3.1] */ + if (typeof setImmediate === 'function') setImmediate(func);else setTimeout(func, 0); +}; + +/* generate a resolver function */ +var resolver = function resolver(cb, next, method) { + return function (value) { + if (typeof cb !== 'function') /* [Promises/A+ 2.2.1, 2.2.7.3, 2.2.7.4] */ + next[method].call(next, value); /* [Promises/A+ 2.2.7.3, 2.2.7.4] */ + else { + var result; + try { + result = cb(value); + } /* [Promises/A+ 2.2.2.1, 2.2.3.1, 2.2.5, 3.2] */ + catch (e) { + next.reject(e); /* [Promises/A+ 2.2.7.2] */ + return; + } + resolve(next, result); /* [Promises/A+ 2.2.7.1] */ + } + }; +}; + +/* "Promise Resolution Procedure" */ /* [Promises/A+ 2.3] */ +var resolve = function resolve(promise, x) { + /* sanity check arguments */ /* [Promises/A+ 2.3.1] */ + if (promise === x || promise.proxy === x) { + promise.reject(new TypeError('cannot resolve promise with itself')); + return; + } + + /* surgically check for a "then" method + (mainly to just call the "getter" of "then" only once) */ + var then; + if ((typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object' && x !== null || typeof x === 'function') { + try { + then = x.then; + } /* [Promises/A+ 2.3.3.1, 3.5] */ + catch (e) { + promise.reject(e); /* [Promises/A+ 2.3.3.2] */ + return; + } + } + + /* handle own Thenables [Promises/A+ 2.3.2] + and similar "thenables" [Promises/A+ 2.3.3] */ + if (typeof then === 'function') { + var resolved = false; + try { + /* call retrieved "then" method */ /* [Promises/A+ 2.3.3.3] */ + then.call(x, + /* resolvePromise */ /* [Promises/A+ 2.3.3.3.1] */ + function (y) { + if (resolved) return;resolved = true; /* [Promises/A+ 2.3.3.3.3] */ + if (y === x) /* [Promises/A+ 3.6] */ + promise.reject(new TypeError('circular thenable chain'));else resolve(promise, y); + }, + + /* rejectPromise */ /* [Promises/A+ 2.3.3.3.2] */ + function (r) { + if (resolved) return;resolved = true; /* [Promises/A+ 2.3.3.3.3] */ + promise.reject(r); + }); + } catch (e) { + if (!resolved) /* [Promises/A+ 2.3.3.3.3] */ + promise.reject(e); /* [Promises/A+ 2.3.3.3.4] */ + } + return; + } + + /* handle other values */ + promise.fulfill(x); /* [Promises/A+ 2.3.4, 2.3.3.4] */ +}; + +// so we always have Promise.all() +api.all = function (ps) { + return new api(function (resolveAll, rejectAll) { + var vals = new Array(ps.length); + var doneCount = 0; + + var fulfill = function fulfill(i, val) { + vals[i] = val; + doneCount++; + + if (doneCount === ps.length) { + resolveAll(vals); + } + }; + + for (var i = 0; i < ps.length; i++) { + (function (i) { + var p = ps[i]; + var isPromise = p != null && p.then != null; + + if (isPromise) { + p.then(function (val) { + fulfill(i, val); + }, function (err) { + rejectAll(err); + }); + } else { + var val = p; + fulfill(i, val); + } + })(i); + } + }); +}; + +api.resolve = function (val) { + return new api(function (resolve, reject) { + resolve(val); + }); +}; + +api.reject = function (val) { + return new api(function (resolve, reject) { + reject(val); + }); +}; + +module.exports = typeof Promise !== 'undefined' ? Promise : api; // eslint-disable-line no-undef + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var util = __webpack_require__(1); +var newQuery = __webpack_require__(10); + +var Selector = function Selector(selector) { + var self = this; + + self._private = { + selectorText: selector, + invalid: true + }; + + if (selector == null || is.string(selector) && selector.match(/^\s*$/)) { + + self.length = 0; + } else if (selector === '*' || selector === 'edge' || selector === 'node') { + + // make single, group-only selectors cheap to make and cheap to filter + + self[0] = newQuery(); + self[0].group = selector === '*' ? selector : selector + 's'; + self[0].groupOnly = true; + self[0].length = 1; + self._private.invalid = false; + self.length = 1; + } else if (is.elementOrCollection(selector)) { + + var collection = selector.collection(); + + self[0] = newQuery(); + self[0].collection = collection; + self[0].length = 1; + self.length = 1; + } else if (is.fn(selector)) { + + self[0] = newQuery(); + self[0].filter = selector; + self[0].length = 1; + self.length = 1; + } else if (is.string(selector)) { + if (!self.parse(selector)) { + return; + } + } else { + util.error('A selector must be created from a string; found ', selector); + return; + } + + self._private.invalid = false; +}; + +var selfn = Selector.prototype; + +selfn.valid = function () { + return !this._private.invalid; +}; + +selfn.invalid = function () { + return this._private.invalid; +}; + +selfn.text = function () { + return this._private.selectorText; +}; + +selfn.size = function () { + return this.length; +}; + +selfn.eq = function (i) { + return this[i]; +}; + +selfn.sameText = function (otherSel) { + return this.text() === otherSel.text(); +}; + +selfn.toString = selfn.selector = function () { + + if (this._private.toStringCache != null) { + return this._private.toStringCache; + } + + var i = void 0; + var str = ''; + + var clean = function clean(obj) { + if (obj == null) { + return ''; + } else { + return obj; + } + }; + + var cleanVal = function cleanVal(val) { + if (is.string(val)) { + return '"' + val + '"'; + } else { + return clean(val); + } + }; + + var space = function space(val) { + return ' ' + val + ' '; + }; + + var queryToString = function queryToString(query) { + var str = ''; + var j = void 0, + sel = void 0; + + if (query.subject === query) { + str += '$'; + } + + var group = clean(query.group); + str += group.substring(0, group.length - 1); + + for (j = 0; j < query.data.length; j++) { + var data = query.data[j]; + + if (data.value) { + str += '[' + data.field + space(clean(data.operator)) + cleanVal(data.value) + ']'; + } else { + str += '[' + clean(data.operator) + data.field + ']'; + } + } + + for (j = 0; j < query.meta.length; j++) { + var meta = query.meta[j]; + str += '[[' + meta.field + space(clean(meta.operator)) + cleanVal(meta.value) + ']]'; + } + + for (j = 0; j < query.colonSelectors.length; j++) { + sel = query.colonSelectors[i]; + str += sel; + } + + for (j = 0; j < query.ids.length; j++) { + sel = '#' + query.ids[i]; + str += sel; + } + + for (j = 0; j < query.classes.length; j++) { + sel = '.' + query.classes[j]; + str += sel; + } + + if (query.source != null && query.target != null) { + str = queryToString(query.source) + ' -> ' + queryToString(query.target); + } + + if (query.connectedNodes != null) { + var n = query.connectedNodes; + + str = queryToString(n[0]) + ' <-> ' + queryToString(n[1]); + } + + if (query.parent != null) { + str = queryToString(query.parent) + ' > ' + str; + } + + if (query.ancestor != null) { + str = queryToString(query.ancestor) + ' ' + str; + } + + if (query.child != null) { + str += ' > ' + queryToString(query.child); + } + + if (query.descendant != null) { + str += ' ' + queryToString(query.descendant); + } + + return str; + }; + + for (i = 0; i < this.length; i++) { + var query = this[i]; + + str += queryToString(query); + + if (this.length > 1 && i < this.length - 1) { + str += ', '; + } + } + + this._private.toStringCache = str; + + return str; +}; + +[__webpack_require__(50), __webpack_require__(53)].forEach(function (p) { + return util.assign(selfn, p); +}); + +module.exports = Selector; + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var is = __webpack_require__(0); +var Map = __webpack_require__(28); +var Set = __webpack_require__(8); + +var Element = __webpack_require__(14); + +// factory for generating edge ids when no id is specified for a new element +var idFactory = { + generate: function generate(cy, element, tryThisId) { + var id = tryThisId != null ? tryThisId : util.uuid(); + + while (cy.hasElementWithId(id)) { + id = util.uuid(); + } + + return id; + } +}; + +// represents a set of nodes, edges, or both together +var Collection = function Collection(cy, elements, options) { + if (cy === undefined || !is.core(cy)) { + util.error('A collection must have a reference to the core'); + return; + } + + var map = new Map(); + var createdElements = false; + + if (!elements) { + elements = []; + } else if (elements.length > 0 && is.plainObject(elements[0]) && !is.element(elements[0])) { + createdElements = true; + + // make elements from json and restore all at once later + var eles = []; + var elesIds = new Set(); + + for (var i = 0, l = elements.length; i < l; i++) { + var json = elements[i]; + + if (json.data == null) { + json.data = {}; + } + + var data = json.data; + + // make sure newly created elements have valid ids + if (data.id == null) { + data.id = idFactory.generate(cy, json); + } else if (cy.hasElementWithId(data.id) || elesIds.has(data.id)) { + continue; // can't create element if prior id already exists + } + + var ele = new Element(cy, json, false); + eles.push(ele); + elesIds.add(data.id); + } + + elements = eles; + } + + this.length = 0; + + for (var _i = 0, _l = elements.length; _i < _l; _i++) { + var element = elements[_i]; + if (element == null) { + continue; + } + + var id = element._private.data.id; + + if (options == null || options.unique && !map.has(id)) { + map.set(id, { + index: this.length, + ele: element + }); + + this[this.length] = element; + this.length++; + } + } + + this._private = { + cy: cy, + map: map + }; + + // restore the elements if we created them from json + if (createdElements) { + this.restore(); + } +}; + +// Functions +//////////////////////////////////////////////////////////////////////////////////////////////////// + +// keep the prototypes in sync (an element has the same functions as a collection) +// and use elefn and elesfn as shorthands to the prototypes +var elesfn = Element.prototype = Collection.prototype; + +elesfn.instanceString = function () { + return 'collection'; +}; + +elesfn.spawn = function (cy, eles, opts) { + if (!is.core(cy)) { + // cy is optional + opts = eles; + eles = cy; + cy = this.cy(); + } + + return new Collection(cy, eles, opts); +}; + +elesfn.spawnSelf = function () { + return this.spawn(this); +}; + +elesfn.cy = function () { + return this._private.cy; +}; + +elesfn.renderer = function () { + return this._private.cy.renderer(); +}; + +elesfn.element = function () { + return this[0]; +}; + +elesfn.collection = function () { + if (is.collection(this)) { + return this; + } else { + // an element + return new Collection(this._private.cy, [this]); + } +}; + +elesfn.unique = function () { + return new Collection(this._private.cy, this, { unique: true }); +}; + +elesfn.hasElementWithId = function (id) { + return this._private.map.has(id); +}; + +elesfn.getElementById = function (id) { + var cy = this._private.cy; + var entry = this._private.map.get(id); + + return entry ? entry.ele : new Collection(cy); // get ele or empty collection +}; + +elesfn.$id = elesfn.getElementById; + +elesfn.poolIndex = function () { + var cy = this._private.cy; + var eles = cy._private.elements; + var id = this._private.data.id; + + return eles._private.map.get(id).index; +}; + +elesfn.json = function (obj) { + var ele = this.element(); + var cy = this.cy(); + + if (ele == null && obj) { + return this; + } // can't set to no eles + + if (ele == null) { + return undefined; + } // can't get from no eles + + var p = ele._private; + + if (is.plainObject(obj)) { + // set + + cy.startBatch(); + + if (obj.data) { + ele.data(obj.data); + } + + if (obj.position) { + ele.position(obj.position); + } + + // ignore group -- immutable + + var checkSwitch = function checkSwitch(k, trueFnName, falseFnName) { + var obj_k = obj[k]; + + if (obj_k != null && obj_k !== p[k]) { + if (obj_k) { + ele[trueFnName](); + } else { + ele[falseFnName](); + } + } + }; + + checkSwitch('removed', 'remove', 'restore'); + + checkSwitch('selected', 'select', 'unselect'); + + checkSwitch('selectable', 'selectify', 'unselectify'); + + checkSwitch('locked', 'lock', 'unlock'); + + checkSwitch('grabbable', 'grabify', 'ungrabify'); + + if (obj.classes != null) { + ele.classes(obj.classes); + } + + cy.endBatch(); + + return this; + } else if (obj === undefined) { + // get + + var json = { + data: util.copy(p.data), + position: util.copy(p.position), + group: p.group, + removed: p.removed, + selected: p.selected, + selectable: p.selectable, + locked: p.locked, + grabbable: p.grabbable, + classes: null + }; + + json.classes = ''; + + var i = 0; + p.classes.forEach(function (cls) { + return json.classes += i++ === 0 ? cls : ' ' + cls; + }); + + return json; + } +}; + +elesfn.jsons = function () { + var jsons = []; + + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + var json = ele.json(); + + jsons.push(json); + } + + return jsons; +}; + +elesfn.clone = function () { + var cy = this.cy(); + var elesArr = []; + + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + var json = ele.json(); + var clone = new Element(cy, json, false); // NB no restore + + elesArr.push(clone); + } + + return new Collection(cy, elesArr); +}; +elesfn.copy = elesfn.clone; + +elesfn.restore = function (notifyRenderer) { + var self = this; + var cy = self.cy(); + var cy_p = cy._private; + + if (notifyRenderer === undefined) { + notifyRenderer = true; + } + + // create arrays of nodes and edges, since we need to + // restore the nodes first + var nodes = []; + var edges = []; + var elements = void 0; + for (var _i2 = 0, l = self.length; _i2 < l; _i2++) { + var ele = self[_i2]; + + if (!ele.removed()) { + // don't need to handle this ele + continue; + } + + // keep nodes first in the array and edges after + if (ele.isNode()) { + // put to front of array if node + nodes.push(ele); + } else { + // put to end of array if edge + edges.push(ele); + } + } + + elements = nodes.concat(edges); + + var i = void 0; + var removeFromElements = function removeFromElements() { + elements.splice(i, 1); + i--; + }; + + // now, restore each element + for (i = 0; i < elements.length; i++) { + var _ele = elements[i]; + + var _private = _ele._private; + var data = _private.data; + + // the traversal cache should start fresh when ele is added + _ele.clearTraversalCache(); + + // set id and validate + if (data.id === undefined) { + data.id = idFactory.generate(cy, _ele); + } else if (is.number(data.id)) { + data.id = '' + data.id; // now it's a string + } else if (is.emptyString(data.id) || !is.string(data.id)) { + util.error('Can not create element with invalid string ID `' + data.id + '`'); + + // can't create element if it has empty string as id or non-string id + removeFromElements(); + continue; + } else if (cy.hasElementWithId(data.id)) { + util.error('Can not create second element with ID `' + data.id + '`'); + + // can't create element if one already has that id + removeFromElements(); + continue; + } + + var id = data.id; // id is finalised, now let's keep a ref + + if (_ele.isNode()) { + // extra checks for nodes + var pos = _private.position; + + // make sure the nodes have a defined position + + if (pos.x == null) { + pos.x = 0; + } + + if (pos.y == null) { + pos.y = 0; + } + } + + if (_ele.isEdge()) { + // extra checks for edges + + var edge = _ele; + var fields = ['source', 'target']; + var fieldsLength = fields.length; + var badSourceOrTarget = false; + for (var j = 0; j < fieldsLength; j++) { + + var field = fields[j]; + var val = data[field]; + + if (is.number(val)) { + val = data[field] = '' + data[field]; // now string + } + + if (val == null || val === '') { + // can't create if source or target is not defined properly + util.error('Can not create edge `' + id + '` with unspecified ' + field); + badSourceOrTarget = true; + } else if (!cy.hasElementWithId(val)) { + // can't create edge if one of its nodes doesn't exist + util.error('Can not create edge `' + id + '` with nonexistant ' + field + ' `' + val + '`'); + badSourceOrTarget = true; + } + } + + if (badSourceOrTarget) { + removeFromElements();continue; + } // can't create this + + var src = cy.getElementById(data.source); + var tgt = cy.getElementById(data.target); + + src._private.edges.push(edge); + tgt._private.edges.push(edge); + + edge._private.source = src; + edge._private.target = tgt; + } // if is edge + + // create mock ids / indexes maps for element so it can be used like collections + _private.map = new Map(); + _private.map.set(id, { ele: _ele, index: 0 }); + + _private.removed = false; + cy.addToPool(_ele); + } // for each element + + // do compound node sanity checks + for (var _i3 = 0; _i3 < nodes.length; _i3++) { + // each node + var node = nodes[_i3]; + var _data = node._private.data; + + if (is.number(_data.parent)) { + // then automake string + _data.parent = '' + _data.parent; + } + + var parentId = _data.parent; + + var specifiedParent = parentId != null; + + if (specifiedParent) { + var parent = cy.getElementById(parentId); + + if (parent.empty()) { + // non-existant parent; just remove it + _data.parent = undefined; + } else { + var selfAsParent = false; + var ancestor = parent; + while (!ancestor.empty()) { + if (node.same(ancestor)) { + // mark self as parent and remove from data + selfAsParent = true; + _data.parent = undefined; // remove parent reference + + // exit or we loop forever + break; + } + + ancestor = ancestor.parent(); + } + + if (!selfAsParent) { + // connect with children + parent[0]._private.children.push(node); + node._private.parent = parent[0]; + + // let the core know we have a compound graph + cy_p.hasCompoundNodes = true; + } + } // else + } // if specified parent + } // for each node + + if (elements.length > 0) { + var restored = new Collection(cy, elements); + + for (var _i4 = 0; _i4 < restored.length; _i4++) { + var _ele2 = restored[_i4]; + + if (_ele2.isNode()) { + continue; + } + + // adding an edge invalidates the traversal caches for the parallel edges + _ele2.parallelEdges().clearTraversalCache(); + + // adding an edge invalidates the traversal cache for the connected nodes + _ele2.source().clearTraversalCache(); + _ele2.target().clearTraversalCache(); + } + + var toUpdateStyle = void 0; + + if (cy_p.hasCompoundNodes) { + toUpdateStyle = cy.collection().merge(restored).merge(restored.connectedNodes()).merge(restored.parent()); + } else { + toUpdateStyle = restored; + } + + toUpdateStyle.dirtyCompoundBoundsCache().updateStyle(notifyRenderer); + + if (notifyRenderer) { + restored.emitAndNotify('add'); + } else { + restored.emit('add'); + } + } + + return self; // chainability +}; + +elesfn.removed = function () { + var ele = this[0]; + return ele && ele._private.removed; +}; + +elesfn.inside = function () { + var ele = this[0]; + return ele && !ele._private.removed; +}; + +elesfn.remove = function (notifyRenderer) { + var self = this; + var removed = []; + var elesToRemove = []; + var elesToRemoveIds = {}; + var cy = self._private.cy; + + if (notifyRenderer === undefined) { + notifyRenderer = true; + } + + // add connected edges + function addConnectedEdges(node) { + var edges = node._private.edges; + for (var i = 0; i < edges.length; i++) { + add(edges[i]); + } + } + + // add descendant nodes + function addChildren(node) { + var children = node._private.children; + + for (var i = 0; i < children.length; i++) { + add(children[i]); + } + } + + function add(ele) { + var alreadyAdded = elesToRemoveIds[ele.id()]; + if (ele.removed() || alreadyAdded) { + return; + } else { + elesToRemoveIds[ele.id()] = true; + } + + if (ele.isNode()) { + elesToRemove.push(ele); // nodes are removed last + + addConnectedEdges(ele); + addChildren(ele); + } else { + elesToRemove.unshift(ele); // edges are removed first + } + } + + // make the list of elements to remove + // (may be removing more than specified due to connected edges etc) + + for (var i = 0, l = self.length; i < l; i++) { + var ele = self[i]; + + add(ele); + } + + function removeEdgeRef(node, edge) { + var connectedEdges = node._private.edges; + + util.removeFromArray(connectedEdges, edge); + + // removing an edges invalidates the traversal cache for its nodes + node.clearTraversalCache(); + } + + function removeParallelRefs(edge) { + // removing an edge invalidates the traversal caches for the parallel edges + edge.parallelEdges().clearTraversalCache(); + } + + var alteredParents = []; + alteredParents.ids = {}; + + function removeChildRef(parent, ele) { + ele = ele[0]; + parent = parent[0]; + + var children = parent._private.children; + var pid = parent.id(); + + util.removeFromArray(children, ele); + + if (!alteredParents.ids[pid]) { + alteredParents.ids[pid] = true; + alteredParents.push(parent); + } + } + + self.dirtyCompoundBoundsCache(); + + cy.removeFromPool(elesToRemove); // remove from core pool + + for (var _i5 = 0; _i5 < elesToRemove.length; _i5++) { + var _ele3 = elesToRemove[_i5]; + + // mark as removed + _ele3._private.removed = true; + + // add to list of removed elements + removed.push(_ele3); + + if (_ele3.isEdge()) { + // remove references to this edge in its connected nodes + var src = _ele3.source()[0]; + var tgt = _ele3.target()[0]; + + removeEdgeRef(src, _ele3); + removeEdgeRef(tgt, _ele3); + removeParallelRefs(_ele3); + } else { + // remove reference to parent + var parent = _ele3.parent(); + + if (parent.length !== 0) { + removeChildRef(parent, _ele3); + } + } + } + + // check to see if we have a compound graph or not + var elesStillInside = cy._private.elements; + cy._private.hasCompoundNodes = false; + for (var _i6 = 0; _i6 < elesStillInside.length; _i6++) { + var _ele4 = elesStillInside[_i6]; + + if (_ele4.isParent()) { + cy._private.hasCompoundNodes = true; + break; + } + } + + var removedElements = new Collection(this.cy(), removed); + if (removedElements.size() > 0) { + // must manually notify since trigger won't do this automatically once removed + + if (notifyRenderer) { + this.cy().notify({ + type: 'remove', + eles: removedElements + }); + } + + removedElements.emit('remove'); + } + + // the parents who were modified by the removal need their style updated + for (var _i7 = 0; _i7 < alteredParents.length; _i7++) { + var _ele5 = alteredParents[_i7]; + + if (!_ele5.removed()) { + _ele5.updateStyle(); + } + } + + return new Collection(cy, removed); +}; + +elesfn.move = function (struct) { + var cy = this._private.cy; + + if (struct.source !== undefined || struct.target !== undefined) { + var srcId = struct.source; + var tgtId = struct.target; + var srcExists = cy.hasElementWithId(srcId); + var tgtExists = cy.hasElementWithId(tgtId); + + if (srcExists || tgtExists) { + var jsons = this.jsons(); + + this.remove(); + + for (var i = 0; i < jsons.length; i++) { + var json = jsons[i]; + var ele = this[i]; + + if (json.group === 'edges') { + if (srcExists) { + json.data.source = srcId; + } + + if (tgtExists) { + json.data.target = tgtId; + } + + json.scratch = ele._private.scratch; + } + } + + return cy.add(jsons); + } + } else if (struct.parent !== undefined) { + // move node to new parent + var parentId = struct.parent; + var parentExists = parentId === null || cy.hasElementWithId(parentId); + + if (parentExists) { + var _jsons = this.jsons(); + var descs = this.descendants(); + var descsEtcJsons = descs.union(descs.union(this).connectedEdges()).jsons(); + + this.remove(); // NB: also removes descendants and their connected edges + + for (var _i8 = 0; _i8 < _jsons.length; _i8++) { + var _json = _jsons[_i8]; + var _ele6 = this[_i8]; + + if (_json.group === 'nodes') { + _json.data.parent = parentId === null ? undefined : parentId; + + _json.scratch = _ele6._private.scratch; + } + } + + return cy.add(_jsons.concat(descsEtcJsons)); + } + } + + return this; // if nothing done +}; + +[__webpack_require__(29), __webpack_require__(43), __webpack_require__(48), __webpack_require__(49), __webpack_require__(54), __webpack_require__(55), __webpack_require__(56), __webpack_require__(57), __webpack_require__(62), __webpack_require__(63), __webpack_require__(64), __webpack_require__(7), __webpack_require__(65), __webpack_require__(66), __webpack_require__(67), __webpack_require__(68), __webpack_require__(69)].forEach(function (props) { + util.extend(elesfn, props); +}); + +module.exports = Collection; + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +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 _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; }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/* global Set */ + +var undef = true ? 'undefined' : _typeof(undefined); + +var ObjectSet = function () { + function ObjectSet(arrayOrObjectSet) { + _classCallCheck(this, ObjectSet); + + this._obj = Object.create(null); + + if (arrayOrObjectSet != null) { + var arr = void 0; + + if (arrayOrObjectSet.instanceString != null && arrayOrObjectSet.instanceString() === this.instanceString()) { + arr = arrayOrObjectSet.toArray(); + } else { + arr = arrayOrObjectSet; + } + + for (var i = 0; i < arr.length; i++) { + this.add(arr[i]); + } + } + } + + _createClass(ObjectSet, [{ + key: 'instanceString', + value: function instanceString() { + return 'set'; + } + }, { + key: 'add', + value: function add(val) { + this._obj[val] = 1; + } + }, { + key: 'delete', + value: function _delete(val) { + this._obj[val] = 0; + } + }, { + key: 'clear', + value: function clear() { + this._obj = Object.create(null); + } + }, { + key: 'has', + value: function has(val) { + return this._obj[val] === 1; + } + }, { + key: 'toArray', + value: function toArray() { + var _this = this; + + return Object.keys(this._obj).filter(function (key) { + return _this.has(key); + }); + } + }, { + key: 'forEach', + value: function forEach(callback, thisArg) { + return this.toArray().forEach(callback, thisArg); + } + }, { + key: 'size', + get: function get() { + return this.toArray().length; + } + }]); + + return ObjectSet; +}(); + +// TODO use the stdlib Set in future... +// module.exports = typeof Set !== undef ? Set : ObjectSet; + + +module.exports = ObjectSet; + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = __webpack_require__(32); + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// storage for parsed queries +var newQuery = function newQuery() { + return { + classes: [], + colonSelectors: [], + data: [], + group: null, + ids: [], + meta: [], + + // fake selectors + collection: null, // a collection to match against + filter: null, // filter function + + // these are defined in the upward direction rather than down (e.g. child) + // because we need to go up in Selector.filter() + parent: null, // parent query obj + ancestor: null, // ancestor query obj + subject: null, // defines subject in compound query (subject query obj; points to self if subject) + + // use these only when subject has been defined + child: null, + descendant: null + }; +}; + +module.exports = newQuery; + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var is = __webpack_require__(0); +var Event = __webpack_require__(16); + +var eventRegex = /^([^.]+)(\.(?:[^.]+))?$/; // regex for matching event strings (e.g. "click.namespace") +var universalNamespace = '.*'; // matches as if no namespace specified and prevents users from unbinding accidentally + +var defaults = { + qualifierCompare: function qualifierCompare(q1, q2) { + return q1 === q2; + }, + eventMatches: function eventMatches() /*context, listener, eventObj*/{ + return true; + }, + eventFields: function eventFields() /*context*/{ + return {}; + }, + callbackContext: function callbackContext(context /*, listener, eventObj*/) { + return context; + }, + beforeEmit: function beforeEmit() /* context, listener, eventObj */{}, + afterEmit: function afterEmit() /* context, listener, eventObj */{}, + bubble: function bubble() /*context*/{ + return false; + }, + parent: function parent() /*context*/{ + return null; + }, + context: undefined +}; + +function Emitter(opts) { + util.assign(this, defaults, opts); + + this.listeners = []; + this.emitting = 0; +} + +var p = Emitter.prototype; + +var forEachEvent = function forEachEvent(self, handler, events, qualifier, callback, conf, confOverrides) { + if (is.fn(qualifier)) { + callback = qualifier; + qualifier = null; + } + + if (confOverrides) { + if (conf == null) { + conf = confOverrides; + } else { + conf = util.assign({}, conf, confOverrides); + } + } + + var eventList = events.split(/\s+/); + + for (var i = 0; i < eventList.length; i++) { + var evt = eventList[i]; + + if (is.emptyString(evt)) { + continue; + } + + var match = evt.match(eventRegex); // type[.namespace] + + if (match) { + var type = match[1]; + var namespace = match[2] ? match[2] : null; + var ret = handler(self, evt, type, namespace, qualifier, callback, conf); + + if (ret === false) { + break; + } // allow exiting early + } + } +}; + +var makeEventObj = function makeEventObj(self, obj) { + return new Event(obj.type, util.assign(obj, self.eventFields(self.context))); +}; + +var forEachEventObj = function forEachEventObj(self, handler, events) { + if (is.event(events)) { + handler(self, events); + + return; + } else if (is.plainObject(events)) { + handler(self, makeEventObj(self, events)); + + return; + } + + var eventList = events.split(/\s+/); + + for (var i = 0; i < eventList.length; i++) { + var evt = eventList[i]; + + if (is.emptyString(evt)) { + continue; + } + + var match = evt.match(eventRegex); // type[.namespace] + + if (match) { + var type = match[1]; + var namespace = match[2] ? match[2] : null; + var eventObj = makeEventObj(self, { + type: type, + namespace: namespace, + target: self.context + }); + + handler(self, eventObj); + } + } +}; + +p.on = p.addListener = function (events, qualifier, callback, conf, confOverrides) { + forEachEvent(this, function (self, event, type, namespace, qualifier, callback, conf) { + if (is.fn(callback)) { + self.listeners.push({ + event: event, // full event string + callback: callback, // callback to run + type: type, // the event type (e.g. 'click') + namespace: namespace, // the event namespace (e.g. ".foo") + qualifier: qualifier, // a restriction on whether to match this emitter + conf: conf // additional configuration + }); + } + }, events, qualifier, callback, conf, confOverrides); + + return this; +}; + +p.one = function (events, qualifier, callback, conf) { + return this.on(events, qualifier, callback, conf, { one: true }); +}; + +p.removeListener = p.off = function (events, qualifier, callback, conf) { + var _this = this; + + if (this.emitting !== 0) { + this.listeners = util.copyArray(this.listeners); + } + + var listeners = this.listeners; + + var _loop = function _loop(i) { + var listener = listeners[i]; + + forEachEvent(_this, function (self, event, type, namespace, qualifier, callback /*, conf*/) { + if (listener.type === type && (!namespace || listener.namespace === namespace) && (!qualifier || self.qualifierCompare(listener.qualifier, qualifier)) && (!callback || listener.callback === callback)) { + listeners.splice(i, 1); + + return false; + } + }, events, qualifier, callback, conf); + }; + + for (var i = listeners.length - 1; i >= 0; i--) { + _loop(i); + } + + return this; +}; + +p.emit = p.trigger = function (events, extraParams, manualCallback) { + var listeners = this.listeners; + var numListenersBeforeEmit = listeners.length; + + this.emitting++; + + if (!is.array(extraParams)) { + extraParams = [extraParams]; + } + + forEachEventObj(this, function (self, eventObj) { + if (manualCallback != null) { + listeners = [{ + event: eventObj.event, + type: eventObj.type, + namespace: eventObj.namespace, + callback: manualCallback + }]; + + numListenersBeforeEmit = listeners.length; + } + + var _loop2 = function _loop2(i) { + var listener = listeners[i]; + + if (listener.type === eventObj.type && (!listener.namespace || listener.namespace === eventObj.namespace || listener.namespace === universalNamespace) && self.eventMatches(self.context, listener, eventObj)) { + var args = [eventObj]; + + if (extraParams != null) { + util.push(args, extraParams); + } + + self.beforeEmit(self.context, listener, eventObj); + + if (listener.conf && listener.conf.one) { + self.listeners = self.listeners.filter(function (l) { + return l !== listener; + }); + } + + var context = self.callbackContext(self.context, listener, eventObj); + var ret = listener.callback.apply(context, args); + + self.afterEmit(self.context, listener, eventObj); + + if (ret === false) { + eventObj.stopPropagation(); + eventObj.preventDefault(); + } + } // if listener matches + }; + + for (var i = 0; i < numListenersBeforeEmit; i++) { + _loop2(i); + } // for listener + + if (self.bubble(self.context) && !eventObj.isPropagationStopped()) { + self.parent(self.context).emit(eventObj, extraParams); + } + }, events); + + this.emitting--; + + return this; +}; + +module.exports = Emitter; + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var window = __webpack_require__(3); +var util = __webpack_require__(1); +var Collection = __webpack_require__(7); +var is = __webpack_require__(0); +var Promise = __webpack_require__(5); +var define = __webpack_require__(4); + +var Core = function Core(opts) { + var cy = this; + + opts = util.extend({}, opts); + + var container = opts.container; + + // allow for passing a wrapped jquery object + // e.g. cytoscape({ container: $('#cy') }) + if (container && !is.htmlElement(container) && is.htmlElement(container[0])) { + container = container[0]; + } + + var reg = container ? container._cyreg : null; // e.g. already registered some info (e.g. readies) via jquery + reg = reg || {}; + + if (reg && reg.cy) { + reg.cy.destroy(); + + reg = {}; // old instance => replace reg completely + } + + var readies = reg.readies = reg.readies || []; + + if (container) { + container._cyreg = reg; + } // make sure container assoc'd reg points to this cy + reg.cy = cy; + + var head = window !== undefined && container !== undefined && !opts.headless; + var options = opts; + options.layout = util.extend({ name: head ? 'grid' : 'null' }, options.layout); + options.renderer = util.extend({ name: head ? 'canvas' : 'null' }, options.renderer); + + var defVal = function defVal(def, val, altVal) { + if (val !== undefined) { + return val; + } else if (altVal !== undefined) { + return altVal; + } else { + return def; + } + }; + + var _p = this._private = { + container: container, // html dom ele container + ready: false, // whether ready has been triggered + options: options, // cached options + elements: new Collection(this), // elements in the graph + listeners: [], // list of listeners + aniEles: new Collection(this), // elements being animated + scratch: {}, // scratch object for core + layout: null, + renderer: null, + destroyed: false, // whether destroy was called + notificationsEnabled: true, // whether notifications are sent to the renderer + minZoom: 1e-50, + maxZoom: 1e50, + zoomingEnabled: defVal(true, options.zoomingEnabled), + userZoomingEnabled: defVal(true, options.userZoomingEnabled), + panningEnabled: defVal(true, options.panningEnabled), + userPanningEnabled: defVal(true, options.userPanningEnabled), + boxSelectionEnabled: defVal(true, options.boxSelectionEnabled), + autolock: defVal(false, options.autolock, options.autolockNodes), + autoungrabify: defVal(false, options.autoungrabify, options.autoungrabifyNodes), + autounselectify: defVal(false, options.autounselectify), + styleEnabled: options.styleEnabled === undefined ? head : options.styleEnabled, + zoom: is.number(options.zoom) ? options.zoom : 1, + pan: { + x: is.plainObject(options.pan) && is.number(options.pan.x) ? options.pan.x : 0, + y: is.plainObject(options.pan) && is.number(options.pan.y) ? options.pan.y : 0 + }, + animation: { // object for currently-running animations + current: [], + queue: [] + }, + hasCompoundNodes: false + }; + + this.createEmitter(); + + // set selection type + var selType = options.selectionType; + if (selType === undefined || selType !== 'additive' && selType !== 'single') { + // then set default + + _p.selectionType = 'single'; + } else { + _p.selectionType = selType; + } + + // init zoom bounds + if (is.number(options.minZoom) && is.number(options.maxZoom) && options.minZoom < options.maxZoom) { + _p.minZoom = options.minZoom; + _p.maxZoom = options.maxZoom; + } else if (is.number(options.minZoom) && options.maxZoom === undefined) { + _p.minZoom = options.minZoom; + } else if (is.number(options.maxZoom) && options.minZoom === undefined) { + _p.maxZoom = options.maxZoom; + } + + var loadExtData = function loadExtData(extData, next) { + var anyIsPromise = extData.some(is.promise); + + if (anyIsPromise) { + return Promise.all(extData).then(next); // load all data asynchronously, then exec rest of init + } else { + next(extData); // exec synchronously for convenience + } + }; + + // start with the default stylesheet so we have something before loading an external stylesheet + if (_p.styleEnabled) { + cy.setStyle([]); + } + + // create the renderer + cy.initRenderer(util.extend({ + hideEdgesOnViewport: options.hideEdgesOnViewport, + textureOnViewport: options.textureOnViewport, + wheelSensitivity: is.number(options.wheelSensitivity) && options.wheelSensitivity > 0 ? options.wheelSensitivity : 1, + motionBlur: options.motionBlur === undefined ? false : options.motionBlur, // off by default + motionBlurOpacity: options.motionBlurOpacity === undefined ? 0.05 : options.motionBlurOpacity, + pixelRatio: is.number(options.pixelRatio) && options.pixelRatio > 0 ? options.pixelRatio : undefined, + desktopTapThreshold: options.desktopTapThreshold === undefined ? 4 : options.desktopTapThreshold, + touchTapThreshold: options.touchTapThreshold === undefined ? 8 : options.touchTapThreshold + }, options.renderer)); + + var setElesAndLayout = function setElesAndLayout(elements, onload, ondone) { + cy.notifications(false); + + // remove old elements + var oldEles = cy.mutableElements(); + if (oldEles.length > 0) { + oldEles.remove(); + } + + if (elements != null) { + if (is.plainObject(elements) || is.array(elements)) { + cy.add(elements); + } + } + + cy.one('layoutready', function (e) { + cy.notifications(true); + cy.emit(e); // we missed this event by turning notifications off, so pass it on + + cy.notify({ + type: 'load', + eles: cy.mutableElements() + }); + + cy.one('load', onload); + cy.emit('load'); + }).one('layoutstop', function () { + cy.one('done', ondone); + cy.emit('done'); + }); + + var layoutOpts = util.extend({}, cy._private.options.layout); + layoutOpts.eles = cy.elements(); + + cy.layout(layoutOpts).run(); + }; + + loadExtData([options.style, options.elements], function (thens) { + var initStyle = thens[0]; + var initEles = thens[1]; + + // init style + if (_p.styleEnabled) { + cy.style().append(initStyle); + } + + // initial load + setElesAndLayout(initEles, function () { + // onready + cy.startAnimationLoop(); + _p.ready = true; + + // if a ready callback is specified as an option, the bind it + if (is.fn(options.ready)) { + cy.on('ready', options.ready); + } + + // bind all the ready handlers registered before creating this instance + for (var i = 0; i < readies.length; i++) { + var fn = readies[i]; + cy.on('ready', fn); + } + if (reg) { + reg.readies = []; + } // clear b/c we've bound them all and don't want to keep it around in case a new core uses the same div etc + + cy.emit('ready'); + }, options.done); + }); +}; + +var corefn = Core.prototype; // short alias + +util.extend(corefn, { + instanceString: function instanceString() { + return 'core'; + }, + + isReady: function isReady() { + return this._private.ready; + }, + + isDestroyed: function isDestroyed() { + return this._private.destroyed; + }, + + ready: function ready(fn) { + if (this.isReady()) { + this.emitter().emit('ready', [], fn); // just calls fn as though triggered via ready event + } else { + this.on('ready', fn); + } + + return this; + }, + + destroy: function destroy() { + var cy = this; + if (cy.isDestroyed()) return; + + cy.stopAnimationLoop(); + + cy.destroyRenderer(); + + this.emit('destroy'); + + cy._private.destroyed = true; + + return cy; + }, + + hasElementWithId: function hasElementWithId(id) { + return this._private.elements.hasElementWithId(id); + }, + + getElementById: function getElementById(id) { + return this._private.elements.getElementById(id); + }, + + selectionType: function selectionType() { + return this._private.selectionType; + }, + + hasCompoundNodes: function hasCompoundNodes() { + return this._private.hasCompoundNodes; + }, + + headless: function headless() { + return this._private.options.renderer.name === 'null'; + }, + + styleEnabled: function styleEnabled() { + return this._private.styleEnabled; + }, + + addToPool: function addToPool(eles) { + this._private.elements.merge(eles); + + return this; // chaining + }, + + removeFromPool: function removeFromPool(eles) { + this._private.elements.unmerge(eles); + + return this; + }, + + container: function container() { + return this._private.container; + }, + + options: function options() { + return util.copy(this._private.options); + }, + + json: function json(obj) { + var cy = this; + var _p = cy._private; + var eles = cy.mutableElements(); + + if (is.plainObject(obj)) { + // set + + cy.startBatch(); + + if (obj.elements) { + var idInJson = {}; + + var updateEles = function updateEles(jsons, gr) { + for (var i = 0; i < jsons.length; i++) { + var json = jsons[i]; + var id = json.data.id; + var ele = cy.getElementById(id); + + idInJson[id] = true; + + if (ele.length !== 0) { + // existing element should be updated + ele.json(json); + } else { + // otherwise should be added + if (gr) { + cy.add(util.extend({ group: gr }, json)); + } else { + cy.add(json); + } + } + } + }; + + if (is.array(obj.elements)) { + // elements: [] + updateEles(obj.elements); + } else { + // elements: { nodes: [], edges: [] } + var grs = ['nodes', 'edges']; + for (var i = 0; i < grs.length; i++) { + var gr = grs[i]; + var elements = obj.elements[gr]; + + if (is.array(elements)) { + updateEles(elements, gr); + } + } + } + + // elements not specified in json should be removed + eles.stdFilter(function (ele) { + return !idInJson[ele.id()]; + }).remove(); + } + + if (obj.style) { + cy.style(obj.style); + } + + if (obj.zoom != null && obj.zoom !== _p.zoom) { + cy.zoom(obj.zoom); + } + + if (obj.pan) { + if (obj.pan.x !== _p.pan.x || obj.pan.y !== _p.pan.y) { + cy.pan(obj.pan); + } + } + + var fields = ['minZoom', 'maxZoom', 'zoomingEnabled', 'userZoomingEnabled', 'panningEnabled', 'userPanningEnabled', 'boxSelectionEnabled', 'autolock', 'autoungrabify', 'autounselectify']; + + for (var _i = 0; _i < fields.length; _i++) { + var f = fields[_i]; + + if (obj[f] != null) { + cy[f](obj[f]); + } + } + + cy.endBatch(); + + return this; // chaining + } else if (obj === undefined) { + // get + var json = {}; + + json.elements = {}; + eles.forEach(function (ele) { + var group = ele.group(); + + if (!json.elements[group]) { + json.elements[group] = []; + } + + json.elements[group].push(ele.json()); + }); + + if (this._private.styleEnabled) { + json.style = cy.style().json(); + } + + json.zoomingEnabled = cy._private.zoomingEnabled; + json.userZoomingEnabled = cy._private.userZoomingEnabled; + json.zoom = cy._private.zoom; + json.minZoom = cy._private.minZoom; + json.maxZoom = cy._private.maxZoom; + json.panningEnabled = cy._private.panningEnabled; + json.userPanningEnabled = cy._private.userPanningEnabled; + json.pan = util.copy(cy._private.pan); + json.boxSelectionEnabled = cy._private.boxSelectionEnabled; + json.renderer = util.copy(cy._private.options.renderer); + json.hideEdgesOnViewport = cy._private.options.hideEdgesOnViewport; + json.textureOnViewport = cy._private.options.textureOnViewport; + json.wheelSensitivity = cy._private.options.wheelSensitivity; + json.motionBlur = cy._private.options.motionBlur; + + return json; + } + }, + + scratch: define.data({ + field: 'scratch', + bindingEvent: 'scratch', + allowBinding: true, + allowSetting: true, + settingEvent: 'scratch', + settingTriggersEvent: true, + triggerFnName: 'trigger', + allowGetting: true + }), + + removeScratch: define.removeData({ + field: 'scratch', + event: 'scratch', + triggerFnName: 'trigger', + triggerEvent: true + }) + +}); + +corefn.$id = corefn.getElementById; + +[__webpack_require__(70), __webpack_require__(71), __webpack_require__(79), __webpack_require__(80), __webpack_require__(81), __webpack_require__(82), __webpack_require__(83), __webpack_require__(84), __webpack_require__(85), __webpack_require__(94)].forEach(function (props) { + util.extend(corefn, props); +}); + +module.exports = Core; + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function memoize(fn, keyFn) { + if (!keyFn) { + keyFn = function keyFn() { + if (arguments.length === 1) { + return arguments[0]; + } else if (arguments.length === 0) { + return 'undefined'; + } + + var args = []; + + for (var i = 0; i < arguments.length; i++) { + args.push(arguments[i]); + } + + return args.join('$'); + }; + } + + var memoizedFn = function memoizedFn() { + var self = this; + var args = arguments; + var ret = void 0; + var k = keyFn.apply(self, args); + var cache = memoizedFn.cache; + + if (!(ret = cache[k])) { + ret = cache[k] = fn.apply(self, args); + } + + return ret; + }; + + memoizedFn.cache = {}; + + return memoizedFn; +}; + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var is = __webpack_require__(0); +var Set = __webpack_require__(8); + +// represents a node or an edge +var Element = function Element(cy, params, restore) { + restore = restore === undefined || restore ? true : false; + + if (cy === undefined || params === undefined || !is.core(cy)) { + util.error('An element must have a core reference and parameters set'); + return; + } + + var group = params.group; + + // try to automatically infer the group if unspecified + if (group == null) { + if (params.data && params.data.source != null && params.data.target != null) { + group = 'edges'; + } else { + group = 'nodes'; + } + } + + // validate group + if (group !== 'nodes' && group !== 'edges') { + util.error('An element must be of type `nodes` or `edges`; you specified `' + group + '`'); + return; + } + + // make the element array-like, just like a collection + this.length = 1; + this[0] = this; + + // NOTE: when something is added here, add also to ele.json() + var _p = this._private = { + cy: cy, + single: true, // indicates this is an element + data: params.data || {}, // data object + position: params.position || {}, // (x, y) position pair + autoWidth: undefined, // width and height of nodes calculated by the renderer when set to special 'auto' value + autoHeight: undefined, + autoPadding: undefined, + compoundBoundsClean: false, // whether the compound dimensions need to be recalculated the next time dimensions are read + listeners: [], // array of bound listeners + group: group, // string; 'nodes' or 'edges' + style: {}, // properties as set by the style + rstyle: {}, // properties for style sent from the renderer to the core + styleCxts: [], // applied style contexts from the styler + removed: true, // whether it's inside the vis; true if removed (set true here since we call restore) + selected: params.selected ? true : false, // whether it's selected + selectable: params.selectable === undefined ? true : params.selectable ? true : false, // whether it's selectable + locked: params.locked ? true : false, // whether the element is locked (cannot be moved) + grabbed: false, // whether the element is grabbed by the mouse; renderer sets this privately + grabbable: params.grabbable === undefined ? true : params.grabbable ? true : false, // whether the element can be grabbed + active: false, // whether the element is active from user interaction + classes: new Set(), // map ( className => true ) + animation: { // object for currently-running animations + current: [], + queue: [] + }, + rscratch: {}, // object in which the renderer can store information + scratch: params.scratch || {}, // scratch objects + edges: [], // array of connected edges + children: [], // array of children + parent: null, // parent ref + traversalCache: {}, // cache of output of traversal functions + backgrounding: false // whether background images are loading + }; + + // renderedPosition overrides if specified + if (params.renderedPosition) { + var rpos = params.renderedPosition; + var pan = cy.pan(); + var zoom = cy.zoom(); + + _p.position = { + x: (rpos.x - pan.x) / zoom, + y: (rpos.y - pan.y) / zoom + }; + } + + if (is.string(params.classes)) { + var classes = params.classes.split(/\s+/); + for (var i = 0, l = classes.length; i < l; i++) { + var cls = classes[i]; + if (!cls || cls === '') { + continue; + } + + _p.classes.add(cls); + } + } + + if (params.style || params.css) { + cy.style().applyBypass(this, params.style || params.css); + } + + this.createEmitter(); + + if (restore === undefined || restore) { + this.restore(); + } +}; + +module.exports = Element; + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); + +var stateSelectors = [{ + selector: ':selected', + matches: function matches(ele) { + return ele.selected(); + } +}, { + selector: ':unselected', + matches: function matches(ele) { + return !ele.selected(); + } +}, { + selector: ':selectable', + matches: function matches(ele) { + return ele.selectable(); + } +}, { + selector: ':unselectable', + matches: function matches(ele) { + return !ele.selectable(); + } +}, { + selector: ':locked', + matches: function matches(ele) { + return ele.locked(); + } +}, { + selector: ':unlocked', + matches: function matches(ele) { + return !ele.locked(); + } +}, { + selector: ':visible', + matches: function matches(ele) { + return ele.visible(); + } +}, { + selector: ':hidden', + matches: function matches(ele) { + return !ele.visible(); + } +}, { + selector: ':transparent', + matches: function matches(ele) { + return ele.transparent(); + } +}, { + selector: ':grabbed', + matches: function matches(ele) { + return ele.grabbed(); + } +}, { + selector: ':free', + matches: function matches(ele) { + return !ele.grabbed(); + } +}, { + selector: ':removed', + matches: function matches(ele) { + return ele.removed(); + } +}, { + selector: ':inside', + matches: function matches(ele) { + return !ele.removed(); + } +}, { + selector: ':grabbable', + matches: function matches(ele) { + return ele.grabbable(); + } +}, { + selector: ':ungrabbable', + matches: function matches(ele) { + return !ele.grabbable(); + } +}, { + selector: ':animated', + matches: function matches(ele) { + return ele.animated(); + } +}, { + selector: ':unanimated', + matches: function matches(ele) { + return !ele.animated(); + } +}, { + selector: ':parent', + matches: function matches(ele) { + return ele.isParent(); + } +}, { + selector: ':childless', + matches: function matches(ele) { + return ele.isChildless(); + } +}, { + selector: ':child', + matches: function matches(ele) { + return ele.isChild(); + } +}, { + selector: ':orphan', + matches: function matches(ele) { + return ele.isOrphan(); + } +}, { + selector: ':nonorphan', + matches: function matches(ele) { + return ele.isChild(); + } +}, { + selector: ':loop', + matches: function matches(ele) { + return ele.isLoop(); + } +}, { + selector: ':simple', + matches: function matches(ele) { + return ele.isSimple(); + } +}, { + selector: ':active', + matches: function matches(ele) { + return ele.active(); + } +}, { + selector: ':inactive', + matches: function matches(ele) { + return !ele.active(); + } +}, { + selector: ':backgrounding', + matches: function matches(ele) { + return ele.backgrounding(); + } +}, { + selector: ':nonbackgrounding', + matches: function matches(ele) { + return !ele.backgrounding(); + } +}].sort(function (a, b) { + // n.b. selectors that are starting substrings of others must have the longer ones first + return util.sort.descending(a.selector, b.selector); +}); + +var stateSelectorMatches = function stateSelectorMatches(sel, ele) { + var lookup = stateSelectorMatches.lookup = stateSelectorMatches.lookup || function () { + var selToFn = {}; + var s = void 0; + + for (var i = 0; i < stateSelectors.length; i++) { + s = stateSelectors[i]; + + selToFn[s.selector] = s.matches; + } + + return selToFn; + }(); + + return lookup[sel](ele); +}; + +var stateSelectorRegex = '(' + stateSelectors.map(function (s) { + return s.selector; +}).join('|') + ')'; + +module.exports = { stateSelectors: stateSelectors, stateSelectorMatches: stateSelectorMatches, stateSelectorRegex: stateSelectorRegex }; + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/*! +Event object based on jQuery events, MIT license + +https://jquery.org/license/ +https://tldrlegal.com/license/mit-license +https://github.com/jquery/jquery/blob/master/src/event.js +*/ + +var Event = function Event(src, props) { + this.recycle(src, props); +}; + +function returnFalse() { + return false; +} + +function returnTrue() { + return true; +} + +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +Event.prototype = { + instanceString: function instanceString() { + return 'event'; + }, + + recycle: function recycle(src, props) { + this.isImmediatePropagationStopped = this.isPropagationStopped = this.isDefaultPrevented = returnFalse; + + if (src != null && src.preventDefault) { + // Browser Event object + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented ? returnTrue : returnFalse; + } else if (src != null && src.type) { + // Plain object containing all event details + props = src; + } else { + // Event string + this.type = src; + } + + // Put explicitly provided properties onto the event object + if (props != null) { + // more efficient to manually copy fields we use + this.originalEvent = props.originalEvent; + this.type = props.type != null ? props.type : this.type; + this.cy = props.cy; + this.target = props.target; + this.position = props.position; + this.renderedPosition = props.renderedPosition; + this.namespace = props.namespace; + this.layout = props.layout; + } + + if (this.cy != null && this.position != null && this.renderedPosition == null) { + // create a rendered position based on the passed position + var pos = this.position; + var zoom = this.cy.zoom(); + var pan = this.cy.pan(); + + this.renderedPosition = { + x: pos.x * zoom + pan.x, + y: pos.y * zoom + pan.y + }; + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || Date.now(); + }, + + preventDefault: function preventDefault() { + this.isDefaultPrevented = returnTrue; + + var e = this.originalEvent; + if (!e) { + return; + } + + // if preventDefault exists run it on the original event + if (e.preventDefault) { + e.preventDefault(); + } + }, + + stopPropagation: function stopPropagation() { + this.isPropagationStopped = returnTrue; + + var e = this.originalEvent; + if (!e) { + return; + } + + // if stopPropagation exists run it on the original event + if (e.stopPropagation) { + e.stopPropagation(); + } + }, + + stopImmediatePropagation: function stopImmediatePropagation() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; + +module.exports = Event; + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Elements are drawn in a specific order based on compound depth (low to high), the element type (nodes above edges), + * and z-index (low to high). These styles affect how this applies: + * + * z-compound-depth: May be `bottom | orphan | auto | top`. The first drawn is `bottom`, then `orphan` which is the + * same depth as the root of the compound graph, followed by the default value `auto` which draws in order from + * root to leaves of the compound graph. The last drawn is `top`. + * z-index-compare: May be `auto | manual`. The default value is `auto` which always draws edges under nodes. + * `manual` ignores this convention and draws based on the `z-index` value setting. + * z-index: An integer value that affects the relative draw order of elements. In general, an element with a higher + * `z-index` will be drawn on top of an element with a lower `z-index`. + */ +var util = __webpack_require__(1); + +var zIndexSort = function zIndexSort(a, b) { + var cy = a.cy(); + var hasCompoundNodes = cy.hasCompoundNodes(); + + function getDepth(ele) { + var style = ele.pstyle('z-compound-depth'); + if (style.value === 'auto') { + return hasCompoundNodes ? ele.zDepth() : 0; + } else if (style.value === 'bottom') { + return -1; + } else if (style.value === 'top') { + return util.MAX_INT; + } + // 'orphan' + return 0; + } + var depthDiff = getDepth(a) - getDepth(b); + if (depthDiff !== 0) { + return depthDiff; + } + + function getEleDepth(ele) { + var style = ele.pstyle('z-index-compare'); + if (style.value === 'auto') { + return ele.isNode() ? 1 : 0; + } + // 'manual' + return 0; + } + var eleDiff = getEleDepth(a) - getEleDepth(b); + if (eleDiff !== 0) { + return eleDiff; + } + + var zDiff = a.pstyle('z-index').value - b.pstyle('z-index').value; + if (zDiff !== 0) { + return zDiff; + } + // compare indices in the core (order added to graph w/ last on top) + return a.poolIndex() - b.poolIndex(); +}; + +module.exports = zIndexSort; + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var util = __webpack_require__(1); +var Selector = __webpack_require__(6); + +var Style = function Style(cy) { + + if (!(this instanceof Style)) { + return new Style(cy); + } + + if (!is.core(cy)) { + util.error('A style must have a core reference'); + return; + } + + this._private = { + cy: cy, + coreStyle: {} + }; + + this.length = 0; + + this.resetToDefault(); +}; + +var styfn = Style.prototype; + +styfn.instanceString = function () { + return 'style'; +}; + +// remove all contexts +styfn.clear = function () { + for (var i = 0; i < this.length; i++) { + this[i] = undefined; + } + this.length = 0; + + var _p = this._private; + + _p.newStyle = true; + + return this; // chaining +}; + +styfn.resetToDefault = function () { + this.clear(); + this.addDefaultStylesheet(); + + return this; +}; + +// builds a style object for the 'core' selector +styfn.core = function () { + return this._private.coreStyle; +}; + +// create a new context from the specified selector string and switch to that context +styfn.selector = function (selectorStr) { + // 'core' is a special case and does not need a selector + var selector = selectorStr === 'core' ? null : new Selector(selectorStr); + + var i = this.length++; // new context means new index + this[i] = { + selector: selector, + properties: [], + mappedProperties: [], + index: i + }; + + return this; // chaining +}; + +// add one or many css rules to the current context +styfn.css = function () { + var self = this; + var args = arguments; + + switch (args.length) { + case 1: + var map = args[0]; + + for (var i = 0; i < self.properties.length; i++) { + var prop = self.properties[i]; + var mapVal = map[prop.name]; + + if (mapVal === undefined) { + mapVal = map[util.dash2camel(prop.name)]; + } + + if (mapVal !== undefined) { + this.cssRule(prop.name, mapVal); + } + } + + break; + + case 2: + this.cssRule(args[0], args[1]); + break; + + default: + break; // do nothing if args are invalid + } + + return this; // chaining +}; +styfn.style = styfn.css; + +// add a single css rule to the current context +styfn.cssRule = function (name, value) { + // name-value pair + var property = this.parse(name, value); + + // add property to current context if valid + if (property) { + var i = this.length - 1; + this[i].properties.push(property); + this[i].properties[property.name] = property; // allow access by name as well + + if (property.name.match(/pie-(\d+)-background-size/) && property.value) { + this._private.hasPie = true; + } + + if (property.mapped) { + this[i].mappedProperties.push(property); + } + + // add to core style if necessary + var currentSelectorIsCore = !this[i].selector; + if (currentSelectorIsCore) { + this._private.coreStyle[property.name] = property; + } + } + + return this; // chaining +}; + +styfn.append = function (style) { + if (is.stylesheet(style)) { + style.appendToStyle(this); + } else if (is.array(style)) { + this.appendFromJson(style); + } else if (is.string(style)) { + this.appendFromString(style); + } // you probably wouldn't want to append a Style, since you'd duplicate the default parts + + return this; +}; + +// static function +Style.fromJson = function (cy, json) { + var style = new Style(cy); + + style.fromJson(json); + + return style; +}; + +Style.fromString = function (cy, string) { + return new Style(cy).fromString(string); +}; + +[__webpack_require__(86), __webpack_require__(87), __webpack_require__(88), __webpack_require__(89), __webpack_require__(90), __webpack_require__(91), __webpack_require__(92), __webpack_require__(93)].forEach(function (props) { + util.extend(styfn, props); +}); + +Style.types = styfn.types; +Style.properties = styfn.properties; + +module.exports = Style; + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); + +var fullFpsTime = 1000 / 60; // assume 60 frames per second + +module.exports = { + setupDequeueing: function setupDequeueing(opts) { + return function setupDequeueingImpl() { + var self = this; + var r = this.renderer; + + if (self.dequeueingSetup) { + return; + } else { + self.dequeueingSetup = true; + } + + var queueRedraw = util.debounce(function () { + r.redrawHint('eles', true); + r.redrawHint('drag', true); + + r.redraw(); + }, opts.deqRedrawThreshold); + + var dequeue = function dequeue(willDraw, frameStartTime) { + var startTime = util.performanceNow(); + var avgRenderTime = r.averageRedrawTime; + var renderTime = r.lastRedrawTime; + var deqd = []; + var extent = r.cy.extent(); + var pixelRatio = r.getPixelRatio(); + + while (true) { + var now = util.performanceNow(); + var duration = now - startTime; + var frameDuration = now - frameStartTime; + + if (renderTime < fullFpsTime) { + // if we're rendering faster than the ideal fps, then do dequeueing + // during all of the remaining frame time + + var timeAvailable = fullFpsTime - (willDraw ? avgRenderTime : 0); + + if (frameDuration >= opts.deqFastCost * timeAvailable) { + break; + } + } else { + if (willDraw) { + if (duration >= opts.deqCost * renderTime || duration >= opts.deqAvgCost * avgRenderTime) { + break; + } + } else if (frameDuration >= opts.deqNoDrawCost * fullFpsTime) { + break; + } + } + + var thisDeqd = opts.deq(self, pixelRatio, extent); + + if (thisDeqd.length > 0) { + for (var i = 0; i < thisDeqd.length; i++) { + deqd.push(thisDeqd[i]); + } + } else { + break; + } + } + + // callbacks on dequeue + if (deqd.length > 0) { + opts.onDeqd(self, deqd); + + if (!willDraw && opts.shouldRedraw(self, deqd, pixelRatio, extent)) { + queueRedraw(); + } + } + }; + + var priority = opts.priority || util.noop; + + r.beforeRender(dequeue, priority(self)); + }; + } +}; + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var Core = __webpack_require__(12); +var extension = __webpack_require__(95); +var Stylesheet = __webpack_require__(137); + +var cytoscape = function cytoscape(options) { + // jshint ignore:line + // if no options specified, use default + if (options === undefined) { + options = {}; + } + + // create instance + if (is.plainObject(options)) { + return new Core(options); + } + + // allow for registration of extensions + else if (is.string(options)) { + return extension.apply(extension, arguments); + } +}; + +// e.g. cytoscape.use( require('cytoscape-foo'), bar ) +cytoscape.use = function (ext) { + var args = Array.prototype.slice.call(arguments, 1); // args to pass to ext + + args.unshift(cytoscape); // cytoscape is first arg to ext + + ext.apply(null, args); + + return this; +}; + +// replaced by build system +cytoscape.version = __webpack_require__(138); + +// expose public apis (mostly for extensions) +cytoscape.stylesheet = cytoscape.Stylesheet = Stylesheet; + +module.exports = cytoscape; + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); + +module.exports = { + // get [r, g, b] from #abc or #aabbcc + hex2tuple: function hex2tuple(hex) { + if (!(hex.length === 4 || hex.length === 7) || hex[0] !== '#') { + return; + } + + var shortHex = hex.length === 4; + var r = void 0, + g = void 0, + b = void 0; + var base = 16; + + if (shortHex) { + r = parseInt(hex[1] + hex[1], base); + g = parseInt(hex[2] + hex[2], base); + b = parseInt(hex[3] + hex[3], base); + } else { + r = parseInt(hex[1] + hex[2], base); + g = parseInt(hex[3] + hex[4], base); + b = parseInt(hex[5] + hex[6], base); + } + + return [r, g, b]; + }, + + // get [r, g, b, a] from hsl(0, 0, 0) or hsla(0, 0, 0, 0) + hsl2tuple: function hsl2tuple(hsl) { + var ret = void 0; + var h = void 0, + s = void 0, + l = void 0, + a = void 0, + r = void 0, + g = void 0, + b = void 0; + function hue2rgb(p, q, t) { + if (t < 0) t += 1; + if (t > 1) t -= 1; + if (t < 1 / 6) return p + (q - p) * 6 * t; + if (t < 1 / 2) return q; + if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6; + return p; + } + + var m = new RegExp('^' + this.regex.hsla + '$').exec(hsl); + if (m) { + + // get hue + h = parseInt(m[1]); + if (h < 0) { + h = (360 - -1 * h % 360) % 360; + } else if (h > 360) { + h = h % 360; + } + h /= 360; // normalise on [0, 1] + + s = parseFloat(m[2]); + if (s < 0 || s > 100) { + return; + } // saturation is [0, 100] + s = s / 100; // normalise on [0, 1] + + l = parseFloat(m[3]); + if (l < 0 || l > 100) { + return; + } // lightness is [0, 100] + l = l / 100; // normalise on [0, 1] + + a = m[4]; + if (a !== undefined) { + a = parseFloat(a); + + if (a < 0 || a > 1) { + return; + } // alpha is [0, 1] + } + + // now, convert to rgb + // code from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript + if (s === 0) { + r = g = b = Math.round(l * 255); // achromatic + } else { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + r = Math.round(255 * hue2rgb(p, q, h + 1 / 3)); + g = Math.round(255 * hue2rgb(p, q, h)); + b = Math.round(255 * hue2rgb(p, q, h - 1 / 3)); + } + + ret = [r, g, b, a]; + } + + return ret; + }, + + // get [r, g, b, a] from rgb(0, 0, 0) or rgba(0, 0, 0, 0) + rgb2tuple: function rgb2tuple(rgb) { + var ret = void 0; + + var m = new RegExp('^' + this.regex.rgba + '$').exec(rgb); + if (m) { + ret = []; + + var isPct = []; + for (var i = 1; i <= 3; i++) { + var channel = m[i]; + + if (channel[channel.length - 1] === '%') { + isPct[i] = true; + } + channel = parseFloat(channel); + + if (isPct[i]) { + channel = channel / 100 * 255; // normalise to [0, 255] + } + + if (channel < 0 || channel > 255) { + return; + } // invalid channel value + + ret.push(Math.floor(channel)); + } + + var atLeastOneIsPct = isPct[1] || isPct[2] || isPct[3]; + var allArePct = isPct[1] && isPct[2] && isPct[3]; + if (atLeastOneIsPct && !allArePct) { + return; + } // must all be percent values if one is + + var alpha = m[4]; + if (alpha !== undefined) { + alpha = parseFloat(alpha); + + if (alpha < 0 || alpha > 1) { + return; + } // invalid alpha value + + ret.push(alpha); + } + } + + return ret; + }, + + colorname2tuple: function colorname2tuple(color) { + return this.colors[color.toLowerCase()]; + }, + + color2tuple: function color2tuple(color) { + return (is.array(color) ? color : null) || this.colorname2tuple(color) || this.hex2tuple(color) || this.rgb2tuple(color) || this.hsl2tuple(color); + }, + + colors: { + // special colour names + transparent: [0, 0, 0, 0], // NB alpha === 0 + + // regular colours + aliceblue: [240, 248, 255], + antiquewhite: [250, 235, 215], + aqua: [0, 255, 255], + aquamarine: [127, 255, 212], + azure: [240, 255, 255], + beige: [245, 245, 220], + bisque: [255, 228, 196], + black: [0, 0, 0], + blanchedalmond: [255, 235, 205], + blue: [0, 0, 255], + blueviolet: [138, 43, 226], + brown: [165, 42, 42], + burlywood: [222, 184, 135], + cadetblue: [95, 158, 160], + chartreuse: [127, 255, 0], + chocolate: [210, 105, 30], + coral: [255, 127, 80], + cornflowerblue: [100, 149, 237], + cornsilk: [255, 248, 220], + crimson: [220, 20, 60], + cyan: [0, 255, 255], + darkblue: [0, 0, 139], + darkcyan: [0, 139, 139], + darkgoldenrod: [184, 134, 11], + darkgray: [169, 169, 169], + darkgreen: [0, 100, 0], + darkgrey: [169, 169, 169], + darkkhaki: [189, 183, 107], + darkmagenta: [139, 0, 139], + darkolivegreen: [85, 107, 47], + darkorange: [255, 140, 0], + darkorchid: [153, 50, 204], + darkred: [139, 0, 0], + darksalmon: [233, 150, 122], + darkseagreen: [143, 188, 143], + darkslateblue: [72, 61, 139], + darkslategray: [47, 79, 79], + darkslategrey: [47, 79, 79], + darkturquoise: [0, 206, 209], + darkviolet: [148, 0, 211], + deeppink: [255, 20, 147], + deepskyblue: [0, 191, 255], + dimgray: [105, 105, 105], + dimgrey: [105, 105, 105], + dodgerblue: [30, 144, 255], + firebrick: [178, 34, 34], + floralwhite: [255, 250, 240], + forestgreen: [34, 139, 34], + fuchsia: [255, 0, 255], + gainsboro: [220, 220, 220], + ghostwhite: [248, 248, 255], + gold: [255, 215, 0], + goldenrod: [218, 165, 32], + gray: [128, 128, 128], + grey: [128, 128, 128], + green: [0, 128, 0], + greenyellow: [173, 255, 47], + honeydew: [240, 255, 240], + hotpink: [255, 105, 180], + indianred: [205, 92, 92], + indigo: [75, 0, 130], + ivory: [255, 255, 240], + khaki: [240, 230, 140], + lavender: [230, 230, 250], + lavenderblush: [255, 240, 245], + lawngreen: [124, 252, 0], + lemonchiffon: [255, 250, 205], + lightblue: [173, 216, 230], + lightcoral: [240, 128, 128], + lightcyan: [224, 255, 255], + lightgoldenrodyellow: [250, 250, 210], + lightgray: [211, 211, 211], + lightgreen: [144, 238, 144], + lightgrey: [211, 211, 211], + lightpink: [255, 182, 193], + lightsalmon: [255, 160, 122], + lightseagreen: [32, 178, 170], + lightskyblue: [135, 206, 250], + lightslategray: [119, 136, 153], + lightslategrey: [119, 136, 153], + lightsteelblue: [176, 196, 222], + lightyellow: [255, 255, 224], + lime: [0, 255, 0], + limegreen: [50, 205, 50], + linen: [250, 240, 230], + magenta: [255, 0, 255], + maroon: [128, 0, 0], + mediumaquamarine: [102, 205, 170], + mediumblue: [0, 0, 205], + mediumorchid: [186, 85, 211], + mediumpurple: [147, 112, 219], + mediumseagreen: [60, 179, 113], + mediumslateblue: [123, 104, 238], + mediumspringgreen: [0, 250, 154], + mediumturquoise: [72, 209, 204], + mediumvioletred: [199, 21, 133], + midnightblue: [25, 25, 112], + mintcream: [245, 255, 250], + mistyrose: [255, 228, 225], + moccasin: [255, 228, 181], + navajowhite: [255, 222, 173], + navy: [0, 0, 128], + oldlace: [253, 245, 230], + olive: [128, 128, 0], + olivedrab: [107, 142, 35], + orange: [255, 165, 0], + orangered: [255, 69, 0], + orchid: [218, 112, 214], + palegoldenrod: [238, 232, 170], + palegreen: [152, 251, 152], + paleturquoise: [175, 238, 238], + palevioletred: [219, 112, 147], + papayawhip: [255, 239, 213], + peachpuff: [255, 218, 185], + peru: [205, 133, 63], + pink: [255, 192, 203], + plum: [221, 160, 221], + powderblue: [176, 224, 230], + purple: [128, 0, 128], + red: [255, 0, 0], + rosybrown: [188, 143, 143], + royalblue: [65, 105, 225], + saddlebrown: [139, 69, 19], + salmon: [250, 128, 114], + sandybrown: [244, 164, 96], + seagreen: [46, 139, 87], + seashell: [255, 245, 238], + sienna: [160, 82, 45], + silver: [192, 192, 192], + skyblue: [135, 206, 235], + slateblue: [106, 90, 205], + slategray: [112, 128, 144], + slategrey: [112, 128, 144], + snow: [255, 250, 250], + springgreen: [0, 255, 127], + steelblue: [70, 130, 180], + tan: [210, 180, 140], + teal: [0, 128, 128], + thistle: [216, 191, 216], + tomato: [255, 99, 71], + turquoise: [64, 224, 208], + violet: [238, 130, 238], + wheat: [245, 222, 179], + white: [255, 255, 255], + whitesmoke: [245, 245, 245], + yellow: [255, 255, 0], + yellowgreen: [154, 205, 50] + } +}; + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); + +module.exports = { + // has anything been set in the map + mapEmpty: function mapEmpty(map) { + var empty = true; + + if (map != null) { + return Object.keys(map).length === 0; + } + + return empty; + }, + + // pushes to the array at the end of a map (map may not be built) + pushMap: function pushMap(options) { + var array = this.getMap(options); + + if (array == null) { + // if empty, put initial array + this.setMap(this.extend({}, options, { + value: [options.value] + })); + } else { + array.push(options.value); + } + }, + + // sets the value in a map (map may not be built) + setMap: function setMap(options) { + var obj = options.map; + var key = void 0; + var keys = options.keys; + var l = keys.length; + + for (var i = 0; i < l; i++) { + var _key = keys[i]; + + if (is.plainObject(_key)) { + this.error('Tried to set map with object key'); + } + + if (i < keys.length - 1) { + + // extend the map if necessary + if (obj[_key] == null) { + obj[_key] = {}; + } + + obj = obj[_key]; + } else { + // set the value + obj[_key] = options.value; + } + } + }, + + // gets the value in a map even if it's not built in places + getMap: function getMap(options) { + var obj = options.map; + var keys = options.keys; + var l = keys.length; + + for (var i = 0; i < l; i++) { + var key = keys[i]; + + if (is.plainObject(key)) { + this.error('Tried to get map with object key'); + } + + obj = obj[key]; + + if (obj == null) { + return obj; + } + } + + return obj; + }, + + // deletes the entry in the map + deleteMap: function deleteMap(options) { + var obj = options.map; + var keys = options.keys; + var l = keys.length; + var keepChildren = options.keepChildren; + + for (var i = 0; i < l; i++) { + var key = keys[i]; + + if (is.plainObject(key)) { + this.error('Tried to delete map with object key'); + } + + var lastKey = i === options.keys.length - 1; + if (lastKey) { + + if (keepChildren) { + // then only delete child fields not in keepChildren + var children = Object.keys(obj); + + for (var j = 0; j < children.length; j++) { + var child = children[j]; + + if (!keepChildren[child]) { + obj[child] = undefined; + } + } + } else { + obj[key] = undefined; + } + } else { + obj = obj[key]; + } + } + } +}; + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var number = '(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))'; + +var rgba = 'rgb[a]?\\((' + number + '[%]?)\\s*,\\s*(' + number + '[%]?)\\s*,\\s*(' + number + '[%]?)(?:\\s*,\\s*(' + number + '))?\\)'; +var rgbaNoBackRefs = 'rgb[a]?\\((?:' + number + '[%]?)\\s*,\\s*(?:' + number + '[%]?)\\s*,\\s*(?:' + number + '[%]?)(?:\\s*,\\s*(?:' + number + '))?\\)'; + +var hsla = 'hsl[a]?\\((' + number + ')\\s*,\\s*(' + number + '[%])\\s*,\\s*(' + number + '[%])(?:\\s*,\\s*(' + number + '))?\\)'; +var hslaNoBackRefs = 'hsl[a]?\\((?:' + number + ')\\s*,\\s*(?:' + number + '[%])\\s*,\\s*(?:' + number + '[%])(?:\\s*,\\s*(?:' + number + '))?\\)'; + +var hex3 = '\\#[0-9a-fA-F]{3}'; +var hex6 = '\\#[0-9a-fA-F]{6}'; + +module.exports = { + regex: { + number: number, + rgba: rgba, + rgbaNoBackRefs: rgbaNoBackRefs, + hsla: hsla, + hslaNoBackRefs: hslaNoBackRefs, + hex3: hex3, + hex6: hex6 + } +}; + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var memoize = __webpack_require__(13); +var is = __webpack_require__(0); + +module.exports = { + + camel2dash: memoize(function (str) { + return str.replace(/([A-Z])/g, function (v) { + return '-' + v.toLowerCase(); + }); + }), + + dash2camel: memoize(function (str) { + return str.replace(/(-\w)/g, function (v) { + return v[1].toUpperCase(); + }); + }), + + prependCamel: memoize(function (prefix, str) { + return prefix + str[0].toUpperCase() + str.substring(1); + }, function (prefix, str) { + return prefix + '$' + str; + }), + + capitalize: function capitalize(str) { + if (is.emptyString(str)) { + return str; + } + + return str.charAt(0).toUpperCase() + str.substring(1); + } + +}; + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var window = __webpack_require__(3); +var performance = window ? window.performance : null; + +var util = {}; + +var pnow = performance && performance.now ? function () { + return performance.now(); +} : function () { + return Date.now(); +}; + +var raf = function () { + if (window) { + if (window.requestAnimationFrame) { + return function (fn) { + window.requestAnimationFrame(fn); + }; + } else if (window.mozRequestAnimationFrame) { + return function (fn) { + window.mozRequestAnimationFrame(fn); + }; + } else if (window.webkitRequestAnimationFrame) { + return function (fn) { + window.webkitRequestAnimationFrame(fn); + }; + } else if (window.msRequestAnimationFrame) { + return function (fn) { + window.msRequestAnimationFrame(fn); + }; + } + } + + return function (fn) { + if (fn) { + setTimeout(function () { + fn(pnow()); + }, 1000 / 60); + } + }; +}(); + +util.requestAnimationFrame = function (fn) { + raf(fn); +}; + +util.performanceNow = pnow; + +util.debounce = __webpack_require__(26); + +util.now = function () { + return Date.now(); +}; + +module.exports = util; + +/***/ }), +/* 26 */ +/***/ (function(module, exports) { + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */ +var now = function() { + return root.Date.now(); +}; + +/** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ +function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + result = wait - timeSinceLastCall; + + return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ +function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +module.exports = debounce; + + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function ascending(a, b) { + if (a < b) { + return -1; + } else if (a > b) { + return 1; + } else { + return 0; + } +} + +function descending(a, b) { + return -1 * ascending(a, b); +} + +module.exports = { + sort: { + ascending: ascending, + descending: descending + } +}; + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function ObjectMap() { + this._obj = {}; +} + +var p = ObjectMap.prototype; + +p.set = function (key, val) { + this._obj[key] = val; +}; + +p.delete = function (key) { + this._obj[key] = null; +}; + +p.has = function (key) { + return this._obj[key] != null; +}; + +p.get = function (key) { + return this._obj[key]; +}; + +// TODO use the stdlib Map in future... +// module.exports = typeof Map !== 'undefined' ? Map : ObjectMap; +module.exports = ObjectMap; + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); + +var elesfn = {}; + +[__webpack_require__(30), __webpack_require__(31), __webpack_require__(34), __webpack_require__(35), __webpack_require__(36), __webpack_require__(37), __webpack_require__(38), __webpack_require__(39), __webpack_require__(40), __webpack_require__(41), __webpack_require__(42)].forEach(function (props) { + util.extend(elesfn, props); +}); + +module.exports = elesfn; + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); + +var defineSearch = function defineSearch(params) { + params = { + bfs: params.bfs || !params.dfs, + dfs: params.dfs || !params.bfs + }; + + // from pseudocode on wikipedia + return function searchFn(roots, fn, directed) { + var options; + if (is.plainObject(roots) && !is.elementOrCollection(roots)) { + options = roots; + roots = options.roots || options.root; + fn = options.visit; + directed = options.directed; + } + + directed = arguments.length === 2 && !is.fn(fn) ? fn : directed; + fn = is.fn(fn) ? fn : function () {}; + + var cy = this._private.cy; + var v = roots = is.string(roots) ? this.filter(roots) : roots; + var Q = []; + var connectedNodes = []; + var connectedBy = {}; + var id2depth = {}; + var V = {}; + var j = 0; + var found; + var nodes = this.nodes(); + var edges = this.edges(); + + // enqueue v + for (var i = 0; i < v.length; i++) { + if (v[i].isNode()) { + Q.unshift(v[i]); + + if (params.bfs) { + V[v[i].id()] = true; + + connectedNodes.push(v[i]); + } + + id2depth[v[i].id()] = 0; + } + } + + while (Q.length !== 0) { + var v = params.bfs ? Q.shift() : Q.pop(); + + if (params.dfs) { + if (V[v.id()]) { + continue; + } + + V[v.id()] = true; + + connectedNodes.push(v); + } + + var depth = id2depth[v.id()]; + var prevEdge = connectedBy[v.id()]; + var prevNode = prevEdge == null ? undefined : prevEdge.connectedNodes().not(v)[0]; + var ret; + + ret = fn(v, prevEdge, prevNode, j++, depth); + + if (ret === true) { + found = v; + break; + } + + if (ret === false) { + break; + } + + var vwEdges = v.connectedEdges(directed ? function (ele) { + return ele.data('source') === v.id(); + } : undefined).intersect(edges); + for (var i = 0; i < vwEdges.length; i++) { + var e = vwEdges[i]; + var w = e.connectedNodes(function (n) { + return n.id() !== v.id(); + }).intersect(nodes); + + if (w.length !== 0 && !V[w.id()]) { + w = w[0]; + + Q.push(w); + + if (params.bfs) { + V[w.id()] = true; + + connectedNodes.push(w); + } + + connectedBy[w.id()] = e; + + id2depth[w.id()] = id2depth[v.id()] + 1; + } + } + } + + var connectedEles = []; + + for (var i = 0; i < connectedNodes.length; i++) { + var node = connectedNodes[i]; + var edge = connectedBy[node.id()]; + + if (edge) { + connectedEles.push(edge); + } + + connectedEles.push(node); + } + + return { + path: cy.collection(connectedEles, { unique: true }), + found: cy.collection(found) + }; + }; +}; + +// search, spanning trees, etc +var elesfn = { + breadthFirstSearch: defineSearch({ bfs: true }), + depthFirstSearch: defineSearch({ dfs: true }) +}; + +// nice, short mathemathical alias +elesfn.bfs = elesfn.breadthFirstSearch; +elesfn.dfs = elesfn.depthFirstSearch; + +module.exports = elesfn; + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var Heap = __webpack_require__(9); + +var elesfn = { + + dijkstra: function dijkstra(root, weightFn, directed) { + var options; + if (is.plainObject(root) && !is.elementOrCollection(root)) { + options = root; + root = options.root; + weightFn = options.weight; + directed = options.directed; + } + + var cy = this._private.cy; + weightFn = is.fn(weightFn) ? weightFn : function () { + return 1; + }; // if not specified, assume each edge has equal weight (1) + + var source = is.string(root) ? this.filter(root)[0] : root[0]; + var dist = {}; + var prev = {}; + var knownDist = {}; + + var edges = this.edges().filter(function (ele) { + return !ele.isLoop(); + }); + var nodes = this.nodes(); + + var getDist = function getDist(node) { + return dist[node.id()]; + }; + + var setDist = function setDist(node, d) { + dist[node.id()] = d; + + Q.updateItem(node); + }; + + var Q = new Heap(function (a, b) { + return getDist(a) - getDist(b); + }); + + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + + dist[node.id()] = node.same(source) ? 0 : Infinity; + Q.push(node); + } + + var distBetween = function distBetween(u, v) { + var uvs = (directed ? u.edgesTo(v) : u.edgesWith(v)).intersect(edges); + var smallestDistance = Infinity; + var smallestEdge; + + for (var i = 0; i < uvs.length; i++) { + var edge = uvs[i]; + var weight = weightFn(edge); + + if (weight < smallestDistance || !smallestEdge) { + smallestDistance = weight; + smallestEdge = edge; + } + } + + return { + edge: smallestEdge, + dist: smallestDistance + }; + }; + + while (Q.size() > 0) { + var u = Q.pop(); + var smalletsDist = getDist(u); + var uid = u.id(); + + knownDist[uid] = smalletsDist; + + if (smalletsDist === Infinity) { + continue; + } + + var neighbors = u.neighborhood().intersect(nodes); + for (var i = 0; i < neighbors.length; i++) { + var v = neighbors[i]; + var vid = v.id(); + var vDist = distBetween(u, v); + + var alt = smalletsDist + vDist.dist; + + if (alt < getDist(v)) { + setDist(v, alt); + + prev[vid] = { + node: u, + edge: vDist.edge + }; + } + } // for + } // while + + return { + distanceTo: function distanceTo(node) { + var target = is.string(node) ? nodes.filter(node)[0] : node[0]; + + return knownDist[target.id()]; + }, + + pathTo: function pathTo(node) { + var target = is.string(node) ? nodes.filter(node)[0] : node[0]; + var S = []; + var u = target; + + if (target.length > 0) { + S.unshift(target); + + while (prev[u.id()]) { + var p = prev[u.id()]; + + S.unshift(p.edge); + S.unshift(p.node); + + u = p.node; + } + } + + return cy.collection(S); + } + }; + } +}; + +module.exports = elesfn; + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(33); + + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Generated by CoffeeScript 1.8.0 +(function() { + var Heap, defaultCmp, floor, heapify, heappop, heappush, heappushpop, heapreplace, insort, min, nlargest, nsmallest, updateItem, _siftdown, _siftup; + + floor = Math.floor, min = Math.min; + + + /* + Default comparison function to be used + */ + + defaultCmp = function(x, y) { + if (x < y) { + return -1; + } + if (x > y) { + return 1; + } + return 0; + }; + + + /* + Insert item x in list a, and keep it sorted assuming a is sorted. + + If x is already in a, insert it to the right of the rightmost x. + + Optional args lo (default 0) and hi (default a.length) bound the slice + of a to be searched. + */ + + insort = function(a, x, lo, hi, cmp) { + var mid; + if (lo == null) { + lo = 0; + } + if (cmp == null) { + cmp = defaultCmp; + } + if (lo < 0) { + throw new Error('lo must be non-negative'); + } + if (hi == null) { + hi = a.length; + } + while (lo < hi) { + mid = floor((lo + hi) / 2); + if (cmp(x, a[mid]) < 0) { + hi = mid; + } else { + lo = mid + 1; + } + } + return ([].splice.apply(a, [lo, lo - lo].concat(x)), x); + }; + + + /* + Push item onto heap, maintaining the heap invariant. + */ + + heappush = function(array, item, cmp) { + if (cmp == null) { + cmp = defaultCmp; + } + array.push(item); + return _siftdown(array, 0, array.length - 1, cmp); + }; + + + /* + Pop the smallest item off the heap, maintaining the heap invariant. + */ + + heappop = function(array, cmp) { + var lastelt, returnitem; + if (cmp == null) { + cmp = defaultCmp; + } + lastelt = array.pop(); + if (array.length) { + returnitem = array[0]; + array[0] = lastelt; + _siftup(array, 0, cmp); + } else { + returnitem = lastelt; + } + return returnitem; + }; + + + /* + Pop and return the current smallest value, and add the new item. + + This is more efficient than heappop() followed by heappush(), and can be + more appropriate when using a fixed size heap. Note that the value + returned may be larger than item! That constrains reasonable use of + this routine unless written as part of a conditional replacement: + if item > array[0] + item = heapreplace(array, item) + */ + + heapreplace = function(array, item, cmp) { + var returnitem; + if (cmp == null) { + cmp = defaultCmp; + } + returnitem = array[0]; + array[0] = item; + _siftup(array, 0, cmp); + return returnitem; + }; + + + /* + Fast version of a heappush followed by a heappop. + */ + + heappushpop = function(array, item, cmp) { + var _ref; + if (cmp == null) { + cmp = defaultCmp; + } + if (array.length && cmp(array[0], item) < 0) { + _ref = [array[0], item], item = _ref[0], array[0] = _ref[1]; + _siftup(array, 0, cmp); + } + return item; + }; + + + /* + Transform list into a heap, in-place, in O(array.length) time. + */ + + heapify = function(array, cmp) { + var i, _i, _j, _len, _ref, _ref1, _results, _results1; + if (cmp == null) { + cmp = defaultCmp; + } + _ref1 = (function() { + _results1 = []; + for (var _j = 0, _ref = floor(array.length / 2); 0 <= _ref ? _j < _ref : _j > _ref; 0 <= _ref ? _j++ : _j--){ _results1.push(_j); } + return _results1; + }).apply(this).reverse(); + _results = []; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + i = _ref1[_i]; + _results.push(_siftup(array, i, cmp)); + } + return _results; + }; + + + /* + Update the position of the given item in the heap. + This function should be called every time the item is being modified. + */ + + updateItem = function(array, item, cmp) { + var pos; + if (cmp == null) { + cmp = defaultCmp; + } + pos = array.indexOf(item); + if (pos === -1) { + return; + } + _siftdown(array, 0, pos, cmp); + return _siftup(array, pos, cmp); + }; + + + /* + Find the n largest elements in a dataset. + */ + + nlargest = function(array, n, cmp) { + var elem, result, _i, _len, _ref; + if (cmp == null) { + cmp = defaultCmp; + } + result = array.slice(0, n); + if (!result.length) { + return result; + } + heapify(result, cmp); + _ref = array.slice(n); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + elem = _ref[_i]; + heappushpop(result, elem, cmp); + } + return result.sort(cmp).reverse(); + }; + + + /* + Find the n smallest elements in a dataset. + */ + + nsmallest = function(array, n, cmp) { + var elem, i, los, result, _i, _j, _len, _ref, _ref1, _results; + if (cmp == null) { + cmp = defaultCmp; + } + if (n * 10 <= array.length) { + result = array.slice(0, n).sort(cmp); + if (!result.length) { + return result; + } + los = result[result.length - 1]; + _ref = array.slice(n); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + elem = _ref[_i]; + if (cmp(elem, los) < 0) { + insort(result, elem, 0, null, cmp); + result.pop(); + los = result[result.length - 1]; + } + } + return result; + } + heapify(array, cmp); + _results = []; + for (i = _j = 0, _ref1 = min(n, array.length); 0 <= _ref1 ? _j < _ref1 : _j > _ref1; i = 0 <= _ref1 ? ++_j : --_j) { + _results.push(heappop(array, cmp)); + } + return _results; + }; + + _siftdown = function(array, startpos, pos, cmp) { + var newitem, parent, parentpos; + if (cmp == null) { + cmp = defaultCmp; + } + newitem = array[pos]; + while (pos > startpos) { + parentpos = (pos - 1) >> 1; + parent = array[parentpos]; + if (cmp(newitem, parent) < 0) { + array[pos] = parent; + pos = parentpos; + continue; + } + break; + } + return array[pos] = newitem; + }; + + _siftup = function(array, pos, cmp) { + var childpos, endpos, newitem, rightpos, startpos; + if (cmp == null) { + cmp = defaultCmp; + } + endpos = array.length; + startpos = pos; + newitem = array[pos]; + childpos = 2 * pos + 1; + while (childpos < endpos) { + rightpos = childpos + 1; + if (rightpos < endpos && !(cmp(array[childpos], array[rightpos]) < 0)) { + childpos = rightpos; + } + array[pos] = array[childpos]; + pos = childpos; + childpos = 2 * pos + 1; + } + array[pos] = newitem; + return _siftdown(array, startpos, pos, cmp); + }; + + Heap = (function() { + Heap.push = heappush; + + Heap.pop = heappop; + + Heap.replace = heapreplace; + + Heap.pushpop = heappushpop; + + Heap.heapify = heapify; + + Heap.updateItem = updateItem; + + Heap.nlargest = nlargest; + + Heap.nsmallest = nsmallest; + + function Heap(cmp) { + this.cmp = cmp != null ? cmp : defaultCmp; + this.nodes = []; + } + + Heap.prototype.push = function(x) { + return heappush(this.nodes, x, this.cmp); + }; + + Heap.prototype.pop = function() { + return heappop(this.nodes, this.cmp); + }; + + Heap.prototype.peek = function() { + return this.nodes[0]; + }; + + Heap.prototype.contains = function(x) { + return this.nodes.indexOf(x) !== -1; + }; + + Heap.prototype.replace = function(x) { + return heapreplace(this.nodes, x, this.cmp); + }; + + Heap.prototype.pushpop = function(x) { + return heappushpop(this.nodes, x, this.cmp); + }; + + Heap.prototype.heapify = function() { + return heapify(this.nodes, this.cmp); + }; + + Heap.prototype.updateItem = function(x) { + return updateItem(this.nodes, x, this.cmp); + }; + + Heap.prototype.clear = function() { + return this.nodes = []; + }; + + Heap.prototype.empty = function() { + return this.nodes.length === 0; + }; + + Heap.prototype.size = function() { + return this.nodes.length; + }; + + Heap.prototype.clone = function() { + var heap; + heap = new Heap(); + heap.nodes = this.nodes.slice(0); + return heap; + }; + + Heap.prototype.toArray = function() { + return this.nodes.slice(0); + }; + + Heap.prototype.insert = Heap.prototype.push; + + Heap.prototype.top = Heap.prototype.peek; + + Heap.prototype.front = Heap.prototype.peek; + + Heap.prototype.has = Heap.prototype.contains; + + Heap.prototype.copy = Heap.prototype.clone; + + return Heap; + + })(); + + (function(root, factory) { + if (true) { + return !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (typeof exports === 'object') { + return module.exports = factory(); + } else { + return root.Heap = factory(); + } + })(this, function() { + return Heap; + }); + +}).call(this); + + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); + +// search, spanning trees, etc +var elesfn = { + + // kruskal's algorithm (finds min spanning tree, assuming undirected graph) + // implemented from pseudocode from wikipedia + kruskal: function kruskal(weightFn) { + var cy = this.cy(); + + weightFn = is.fn(weightFn) ? weightFn : function () { + return 1; + }; // if not specified, assume each edge has equal weight (1) + + function findSet(ele) { + for (var i = 0; i < forest.length; i++) { + var eles = forest[i]; + + if (eles.anySame(ele)) { + return { + eles: eles, + index: i + }; + } + } + } + + var A = cy.collection(cy, []); + var forest = []; + var nodes = this.nodes(); + + for (var i = 0; i < nodes.length; i++) { + forest.push(nodes[i].collection()); + } + + var edges = this.edges(); + var S = edges.toArray().sort(function (a, b) { + var weightA = weightFn(a); + var weightB = weightFn(b); + + return weightA - weightB; + }); + + for (var i = 0; i < S.length; i++) { + var edge = S[i]; + var u = edge.source()[0]; + var v = edge.target()[0]; + var setU = findSet(u); + var setV = findSet(v); + + if (setU.index !== setV.index) { + A = A.add(edge); + + // combine forests for u and v + forest[setU.index] = setU.eles.add(setV.eles); + forest.splice(setV.index, 1); + } + } + + return nodes.add(A); + } +}; + +module.exports = elesfn; + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); + +var elesfn = { + + // Implemented from pseudocode from wikipedia + aStar: function aStar(options) { + var eles = this; + + options = options || {}; + + // Reconstructs the path from Start to End, acumulating the result in pathAcum + var reconstructPath = function reconstructPath(start, end, cameFromMap, pathAcum) { + // Base case + if (start == end) { + pathAcum.unshift(cy.getElementById(end)); + return pathAcum; + } + + if (end in cameFromMap) { + // We know which node is before the last one + var previous = cameFromMap[end]; + var previousEdge = cameFromEdge[end]; + + pathAcum.unshift(cy.getElementById(previousEdge)); + pathAcum.unshift(cy.getElementById(end)); + + return reconstructPath(start, previous, cameFromMap, pathAcum); + } + + // We should not reach here! + return undefined; + }; + + // Returns the index of the element in openSet which has minimum fScore + var findMin = function findMin(openSet, fScore) { + if (openSet.length === 0) { + // Should never be the case + return undefined; + } + var minPos = 0; + var tempScore = fScore[openSet[0]]; + for (var i = 1; i < openSet.length; i++) { + var s = fScore[openSet[i]]; + if (s < tempScore) { + tempScore = s; + minPos = i; + } + } + return minPos; + }; + + var cy = this._private.cy; + + // root - mandatory! + if (options != null && options.root != null) { + var source = is.string(options.root) ? + // use it as a selector, e.g. "#rootID + this.filter(options.root)[0] : options.root[0]; + } else { + return undefined; + } + + // goal - mandatory! + if (options.goal != null) { + var target = is.string(options.goal) ? + // use it as a selector, e.g. "#goalID + this.filter(options.goal)[0] : options.goal[0]; + } else { + return undefined; + } + + // Heuristic function - optional + if (options.heuristic != null && is.fn(options.heuristic)) { + var heuristic = options.heuristic; + } else { + var heuristic = function heuristic() { + return 0; + }; // use constant if unspecified + } + + // Weight function - optional + if (options.weight != null && is.fn(options.weight)) { + var weightFn = options.weight; + } else { + // If not specified, assume each edge has equal weight (1) + var weightFn = function weightFn(e) { + return 1; + }; + } + + // directed - optional + if (options.directed != null) { + var directed = options.directed; + } else { + var directed = false; + } + + var sid = source.id(); + var tid = target.id(); + + var closedSet = []; + var openSet = [sid]; + var cameFrom = {}; + var cameFromEdge = {}; + var gScore = {}; + var fScore = {}; + + gScore[sid] = 0; + fScore[sid] = heuristic(source); + + // Counter + var steps = 0; + + // Main loop + while (openSet.length > 0) { + var minPos = findMin(openSet, fScore); + var cMin = cy.getElementById(openSet[minPos]); + var cMinId = cMin.id(); + steps++; + + // If we've found our goal, then we are done + if (cMinId == tid) { + var rPath = reconstructPath(sid, tid, cameFrom, []); + + return { + found: true, + distance: gScore[cMinId], + path: eles.spawn(rPath), + steps: steps + }; + } + + // Add cMin to processed nodes + closedSet.push(cMinId); + // Remove cMin from boundary nodes + openSet.splice(minPos, 1); + + // Update scores for neighbors of cMin + // Take into account if graph is directed or not + var vwEdges = cMin._private.edges; + + for (var i = 0; i < vwEdges.length; i++) { + var e = vwEdges[i]; + + // edge must be in set of calling eles + if (!this.hasElementWithId(e.id())) { + continue; + } + + // cMin must be the source of edge if directed + if (directed && e.data('source') !== cMinId) { + continue; + } + + var wSrc = e.source(); + var wTgt = e.target(); + + var w = wSrc.id() !== cMinId ? wSrc : wTgt; + var wid = w.id(); + + // node must be in set of calling eles + if (!this.hasElementWithId(wid)) { + continue; + } + + // if node is in closedSet, ignore it + if (closedSet.indexOf(wid) != -1) { + continue; + } + + // New tentative score for node w + var tempScore = gScore[cMinId] + weightFn(e); + + // Update gScore for node w if: + // w not present in openSet + // OR + // tentative gScore is less than previous value + + // w not in openSet + if (openSet.indexOf(wid) == -1) { + gScore[wid] = tempScore; + fScore[wid] = tempScore + heuristic(w); + openSet.push(wid); // Add node to openSet + cameFrom[wid] = cMinId; + cameFromEdge[wid] = e.id(); + continue; + } + // w already in openSet, but with greater gScore + if (tempScore < gScore[wid]) { + gScore[wid] = tempScore; + fScore[wid] = tempScore + heuristic(w); + cameFrom[wid] = cMinId; + } + } // End of neighbors update + } // End of main loop + + // If we've reached here, then we've not reached our goal + return { + found: false, + distance: undefined, + path: undefined, + steps: steps + }; + } + +}; // elesfn + + +module.exports = elesfn; + +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); + +var elesfn = { + + // Implemented from pseudocode from wikipedia + floydWarshall: function floydWarshall(options) { + options = options || {}; + + var cy = this.cy(); + + // Weight function - optional + if (options.weight != null && is.fn(options.weight)) { + var weightFn = options.weight; + } else { + // If not specified, assume each edge has equal weight (1) + var weightFn = function weightFn(e) { + return 1; + }; + } + + // directed - optional + if (options.directed != null) { + var directed = options.directed; + } else { + var directed = false; + } + + var edges = this.edges().stdFilter(function (e) { + return !e.isLoop(); + }); + var nodes = this.nodes(); + var numNodes = nodes.length; + + // mapping: node id -> position in nodes array + var id2position = {}; + for (var i = 0; i < numNodes; i++) { + id2position[nodes[i].id()] = i; + } + + // Initialize distance matrix + var dist = []; + for (var i = 0; i < numNodes; i++) { + var newRow = new Array(numNodes); + for (var j = 0; j < numNodes; j++) { + if (i == j) { + newRow[j] = 0; + } else { + newRow[j] = Infinity; + } + } + dist.push(newRow); + } + + // Initialize matrix used for path reconstruction + // Initialize distance matrix + var next = []; + var edgeNext = []; + + var initMatrix = function initMatrix(next) { + for (var i = 0; i < numNodes; i++) { + var newRow = new Array(numNodes); + for (var j = 0; j < numNodes; j++) { + newRow[j] = undefined; + } + next.push(newRow); + } + }; + + initMatrix(next); + initMatrix(edgeNext); + + // Process edges + for (var i = 0; i < edges.length; i++) { + var sourceIndex = id2position[edges[i].source().id()]; + var targetIndex = id2position[edges[i].target().id()]; + var weight = weightFn(edges[i]); + + // Check if already process another edge between same 2 nodes + if (dist[sourceIndex][targetIndex] > weight) { + dist[sourceIndex][targetIndex] = weight; + next[sourceIndex][targetIndex] = targetIndex; + edgeNext[sourceIndex][targetIndex] = edges[i]; + } + } + + // If undirected graph, process 'reversed' edges + if (!directed) { + for (var i = 0; i < edges.length; i++) { + var sourceIndex = id2position[edges[i].target().id()]; + var targetIndex = id2position[edges[i].source().id()]; + var weight = weightFn(edges[i]); + + // Check if already process another edge between same 2 nodes + if (dist[sourceIndex][targetIndex] > weight) { + dist[sourceIndex][targetIndex] = weight; + next[sourceIndex][targetIndex] = targetIndex; + edgeNext[sourceIndex][targetIndex] = edges[i]; + } + } + } + + // Main loop + for (var k = 0; k < numNodes; k++) { + for (var i = 0; i < numNodes; i++) { + for (var j = 0; j < numNodes; j++) { + if (dist[i][k] + dist[k][j] < dist[i][j]) { + dist[i][j] = dist[i][k] + dist[k][j]; + next[i][j] = next[i][k]; + } + } + } + } + + // Build result object + var position2id = []; + for (var i = 0; i < numNodes; i++) { + position2id.push(nodes[i].id()); + } + + var res = { + distance: function distance(from, to) { + if (is.string(from)) { + // from is a selector string + var fromId = cy.filter(from)[0].id(); + } else { + // from is a node + var fromId = from.id(); + } + + if (is.string(to)) { + // to is a selector string + var toId = cy.filter(to)[0].id(); + } else { + // to is a node + var toId = to.id(); + } + + return dist[id2position[fromId]][id2position[toId]]; + }, + + path: function path(from, to) { + var reconstructPathAux = function reconstructPathAux(from, to, next, position2id, edgeNext) { + if (from === to) { + return cy.getElementById(position2id[from]); + } + if (next[from][to] === undefined) { + return undefined; + } + + var path = [cy.getElementById(position2id[from])]; + var prev = from; + while (from !== to) { + prev = from; + from = next[from][to]; + + var edge = edgeNext[prev][from]; + path.push(edge); + + path.push(cy.getElementById(position2id[from])); + } + return path; + }; + + if (is.string(from)) { + // from is a selector string + var fromId = cy.filter(from)[0].id(); + } else { + // from is a node + var fromId = from.id(); + } + + if (is.string(to)) { + // to is a selector string + var toId = cy.filter(to)[0].id(); + } else { + // to is a node + var toId = to.id(); + } + + var pathArr = reconstructPathAux(id2position[fromId], id2position[toId], next, position2id, edgeNext); + + return cy.collection(pathArr); + } + }; + + return res; + } // floydWarshall + +}; // elesfn + +module.exports = elesfn; + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var util = __webpack_require__(1); + +var elesfn = { + + // Implemented from pseudocode from wikipedia + bellmanFord: function bellmanFord(options) { + var eles = this; + + options = options || {}; + + // Weight function - optional + if (options.weight != null && is.fn(options.weight)) { + var weightFn = options.weight; + } else { + // If not specified, assume each edge has equal weight (1) + var weightFn = function weightFn(e) { + return 1; + }; + } + + // directed - optional + if (options.directed != null) { + var directed = options.directed; + } else { + var directed = false; + } + + // root - mandatory! + if (options.root != null) { + if (is.string(options.root)) { + // use it as a selector, e.g. "#rootID + var source = this.filter(options.root)[0]; + } else { + var source = options.root[0]; + } + } else { + return undefined; + } + + var cy = this._private.cy; + var edges = this.edges().stdFilter(function (e) { + return !e.isLoop(); + }); + var nodes = this.nodes(); + var numNodes = nodes.length; + + // mapping: node id -> position in nodes array + var id2position = {}; + for (var i = 0; i < numNodes; i++) { + id2position[nodes[i].id()] = i; + } + + // Initializations + var cost = []; + var predecessor = []; + var predEdge = []; + + for (var i = 0; i < numNodes; i++) { + if (nodes[i].id() === source.id()) { + cost[i] = 0; + } else { + cost[i] = Infinity; + } + predecessor[i] = undefined; + } + + // Edges relaxation + var flag = false; + for (var i = 1; i < numNodes; i++) { + flag = false; + for (var e = 0; e < edges.length; e++) { + var sourceIndex = id2position[edges[e].source().id()]; + var targetIndex = id2position[edges[e].target().id()]; + var weight = weightFn(edges[e]); + + var temp = cost[sourceIndex] + weight; + if (temp < cost[targetIndex]) { + cost[targetIndex] = temp; + predecessor[targetIndex] = sourceIndex; + predEdge[targetIndex] = edges[e]; + flag = true; + } + + // If undirected graph, we need to take into account the 'reverse' edge + if (!directed) { + var temp = cost[targetIndex] + weight; + if (temp < cost[sourceIndex]) { + cost[sourceIndex] = temp; + predecessor[sourceIndex] = targetIndex; + predEdge[sourceIndex] = edges[e]; + flag = true; + } + } + } + + if (!flag) { + break; + } + } + + if (flag) { + // Check for negative weight cycles + for (var e = 0; e < edges.length; e++) { + var sourceIndex = id2position[edges[e].source().id()]; + var targetIndex = id2position[edges[e].target().id()]; + var weight = weightFn(edges[e]); + + if (cost[sourceIndex] + weight < cost[targetIndex]) { + util.error('Graph contains a negative weight cycle for Bellman-Ford'); + return { pathTo: undefined, + distanceTo: undefined, + hasNegativeWeightCycle: true }; + } + } + } + + // Build result object + var position2id = []; + for (var i = 0; i < numNodes; i++) { + position2id.push(nodes[i].id()); + } + + var res = { + distanceTo: function distanceTo(to) { + if (is.string(to)) { + // to is a selector string + var toId = cy.filter(to)[0].id(); + } else { + // to is a node + var toId = to.id(); + } + + return cost[id2position[toId]]; + }, + + pathTo: function pathTo(to) { + + var reconstructPathAux = function reconstructPathAux(predecessor, fromPos, toPos, position2id, acumPath, predEdge) { + for (;;) { + // Add toId to path + acumPath.push(cy.getElementById(position2id[toPos])); + acumPath.push(predEdge[toPos]); + + if (fromPos === toPos) { + // reached starting node + return acumPath; + } + + // If no path exists, discart acumulated path and return undefined + var predPos = predecessor[toPos]; + if (typeof predPos === 'undefined') { + return undefined; + } + + toPos = predPos; + } + }; + + if (is.string(to)) { + // to is a selector string + var toId = cy.filter(to)[0].id(); + } else { + // to is a node + var toId = to.id(); + } + var path = []; + + // This returns a reversed path + var res = reconstructPathAux(predecessor, id2position[source.id()], id2position[toId], position2id, path, predEdge); + + // Get it in the correct order and return it + if (res != null) { + res.reverse(); + } + + return eles.spawn(res); + }, + + hasNegativeWeightCycle: false + }; + + return res; + } // bellmanFord + +}; // elesfn + +module.exports = elesfn; + +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); + +var elesfn = { + + // Computes the minimum cut of an undirected graph + // Returns the correct answer with high probability + kargerStein: function kargerStein(options) { + var eles = this; + + options = options || {}; + + // Function which colapses 2 (meta) nodes into one + // Updates the remaining edge lists + // Receives as a paramater the edge which causes the collapse + var colapse = function colapse(edgeIndex, nodeMap, remainingEdges) { + var edgeInfo = remainingEdges[edgeIndex]; + var sourceIn = edgeInfo[1]; + var targetIn = edgeInfo[2]; + var partition1 = nodeMap[sourceIn]; + var partition2 = nodeMap[targetIn]; + + // Delete all edges between partition1 and partition2 + var newEdges = remainingEdges.filter(function (edge) { + if (nodeMap[edge[1]] === partition1 && nodeMap[edge[2]] === partition2) { + return false; + } + if (nodeMap[edge[1]] === partition2 && nodeMap[edge[2]] === partition1) { + return false; + } + return true; + }); + + // All edges pointing to partition2 should now point to partition1 + for (var i = 0; i < newEdges.length; i++) { + var edge = newEdges[i]; + if (edge[1] === partition2) { + // Check source + newEdges[i] = edge.slice(0); + newEdges[i][1] = partition1; + } else if (edge[2] === partition2) { + // Check target + newEdges[i] = edge.slice(0); + newEdges[i][2] = partition1; + } + } + + // Move all nodes from partition2 to partition1 + for (var i = 0; i < nodeMap.length; i++) { + if (nodeMap[i] === partition2) { + nodeMap[i] = partition1; + } + } + + return newEdges; + }; + + // Contracts a graph until we reach a certain number of meta nodes + var contractUntil = function contractUntil(metaNodeMap, remainingEdges, size, sizeLimit) { + // Stop condition + if (size <= sizeLimit) { + return remainingEdges; + } + + // Choose an edge randomly + var edgeIndex = Math.floor(Math.random() * remainingEdges.length); + + // Colapse graph based on edge + var newEdges = colapse(edgeIndex, metaNodeMap, remainingEdges); + + return contractUntil(metaNodeMap, newEdges, size - 1, sizeLimit); + }; + + var cy = this._private.cy; + var edges = this.edges().stdFilter(function (e) { + return !e.isLoop(); + }); + var nodes = this.nodes(); + var numNodes = nodes.length; + var numEdges = edges.length; + var numIter = Math.ceil(Math.pow(Math.log(numNodes) / Math.LN2, 2)); + var stopSize = Math.floor(numNodes / Math.sqrt(2)); + + if (numNodes < 2) { + util.error('At least 2 nodes are required for Karger-Stein algorithm'); + return undefined; + } + + // Create numerical identifiers for each node + // mapping: node id -> position in nodes array + // for reverse mapping, simply use nodes array + var id2position = {}; + for (var i = 0; i < numNodes; i++) { + id2position[nodes[i].id()] = i; + } + + // Now store edge destination as indexes + // Format for each edge (edge index, source node index, target node index) + var edgeIndexes = []; + for (var i = 0; i < numEdges; i++) { + var e = edges[i]; + edgeIndexes.push([i, id2position[e.source().id()], id2position[e.target().id()]]); + } + + // We will store the best cut found here + var minCutSize = Infinity; + var minCut; + + // Initial meta node partition + var originalMetaNode = []; + for (var i = 0; i < numNodes; i++) { + originalMetaNode.push(i); + } + + // Main loop + for (var iter = 0; iter <= numIter; iter++) { + // Create new meta node partition + var metaNodeMap = originalMetaNode.slice(0); + + // Contract until stop point (stopSize nodes) + var edgesState = contractUntil(metaNodeMap, edgeIndexes, numNodes, stopSize); + + // Create a copy of the colapsed nodes state + var metaNodeMap2 = metaNodeMap.slice(0); + + // Run 2 iterations starting in the stop state + var res1 = contractUntil(metaNodeMap, edgesState, stopSize, 2); + var res2 = contractUntil(metaNodeMap2, edgesState, stopSize, 2); + + // Is any of the 2 results the best cut so far? + if (res1.length <= res2.length && res1.length < minCutSize) { + minCutSize = res1.length; + minCut = [res1, metaNodeMap]; + } else if (res2.length <= res1.length && res2.length < minCutSize) { + minCutSize = res2.length; + minCut = [res2, metaNodeMap2]; + } + } // end of main loop + + + // Construct result + var resEdges = minCut[0].map(function (e) { + return edges[e[0]]; + }); + var partition1 = []; + var partition2 = []; + + // traverse metaNodeMap for best cut + var witnessNodePartition = minCut[1][0]; + for (var i = 0; i < minCut[1].length; i++) { + var partitionId = minCut[1][i]; + if (partitionId === witnessNodePartition) { + partition1.push(nodes[i]); + } else { + partition2.push(nodes[i]); + } + } + + var ret = { + cut: eles.spawn(cy, resEdges), + partition1: eles.spawn(partition1), + partition2: eles.spawn(partition2) + }; + + return ret; + } +}; // elesfn + + +module.exports = elesfn; + +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); + +var elesfn = { + + pageRank: function pageRank(options) { + options = options || {}; + + var normalizeVector = function normalizeVector(vector) { + var length = vector.length; + + // First, get sum of all elements + var total = 0; + for (var i = 0; i < length; i++) { + total += vector[i]; + } + + // Now, divide each by the sum of all elements + for (var i = 0; i < length; i++) { + vector[i] = vector[i] / total; + } + }; + + // dampingFactor - optional + if (options != null && options.dampingFactor != null) { + var dampingFactor = options.dampingFactor; + } else { + var dampingFactor = 0.8; // Default damping factor + } + + // desired precision - optional + if (options != null && options.precision != null) { + var epsilon = options.precision; + } else { + var epsilon = 0.000001; // Default precision + } + + // Max number of iterations - optional + if (options != null && options.iterations != null) { + var numIter = options.iterations; + } else { + var numIter = 200; // Default number of iterations + } + + // Weight function - optional + if (options != null && options.weight != null && is.fn(options.weight)) { + var weightFn = options.weight; + } else { + // If not specified, assume each edge has equal weight (1) + var weightFn = function weightFn(e) { + return 1; + }; + } + + var cy = this._private.cy; + var edges = this.edges().stdFilter(function (e) { + return !e.isLoop(); + }); + var nodes = this.nodes(); + var numNodes = nodes.length; + var numEdges = edges.length; + + // Create numerical identifiers for each node + // mapping: node id -> position in nodes array + // for reverse mapping, simply use nodes array + var id2position = {}; + for (var i = 0; i < numNodes; i++) { + id2position[nodes[i].id()] = i; + } + + // Construct transposed adjacency matrix + // First lets have a zeroed matrix of the right size + // We'll also keep track of the sum of each column + var matrix = []; + var columnSum = []; + var additionalProb = (1 - dampingFactor) / numNodes; + + // Create null matric + for (var i = 0; i < numNodes; i++) { + var newRow = []; + for (var j = 0; j < numNodes; j++) { + newRow.push(0.0); + } + matrix.push(newRow); + columnSum.push(0.0); + } + + // Now, process edges + for (var i = 0; i < numEdges; i++) { + var edge = edges[i]; + var s = id2position[edge.source().id()]; + var t = id2position[edge.target().id()]; + var w = weightFn(edge); + + // Update matrix + matrix[t][s] += w; + + // Update column sum + columnSum[s] += w; + } + + // Add additional probability based on damping factor + // Also, take into account columns that have sum = 0 + var p = 1.0 / numNodes + additionalProb; // Shorthand + // Traverse matrix, column by column + for (var j = 0; j < numNodes; j++) { + if (columnSum[j] === 0) { + // No 'links' out from node jth, assume equal probability for each possible node + for (var i = 0; i < numNodes; i++) { + matrix[i][j] = p; + } + } else { + // Node jth has outgoing link, compute normalized probabilities + for (var i = 0; i < numNodes; i++) { + matrix[i][j] = matrix[i][j] / columnSum[j] + additionalProb; + } + } + } + + // Compute dominant eigenvector using power method + var eigenvector = []; + var nullVector = []; + var previous; + + // Start with a vector of all 1's + // Also, initialize a null vector which will be used as shorthand + for (var i = 0; i < numNodes; i++) { + eigenvector.push(1.0); + nullVector.push(0.0); + } + + for (var iter = 0; iter < numIter; iter++) { + // New array with all 0's + var temp = nullVector.slice(0); + + // Multiply matrix with previous result + for (var i = 0; i < numNodes; i++) { + for (var j = 0; j < numNodes; j++) { + temp[i] += matrix[i][j] * eigenvector[j]; + } + } + + normalizeVector(temp); + previous = eigenvector; + eigenvector = temp; + + var diff = 0; + // Compute difference (squared module) of both vectors + for (var i = 0; i < numNodes; i++) { + diff += Math.pow(previous[i] - eigenvector[i], 2); + } + + // If difference is less than the desired threshold, stop iterating + if (diff < epsilon) { + break; + } + } + + // Construct result + var res = { + rank: function rank(node) { + if (is.string(node)) { + // is a selector string + var nodeId = cy.filter(node)[0].id(); + } else { + // is a node object + var nodeId = node.id(); + } + return eigenvector[id2position[nodeId]]; + } + }; + + return res; + } // pageRank + +}; // elesfn + +module.exports = elesfn; + +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var util = __webpack_require__(1); + +var elesfn = { + + degreeCentralityNormalized: function degreeCentralityNormalized(options) { + options = options || {}; + + var cy = this.cy(); + + // directed - optional + if (options.directed != null) { + var directed = options.directed; + } else { + var directed = false; + } + + var nodes = this.nodes(); + var numNodes = nodes.length; + + if (!directed) { + var degrees = {}; + var maxDegree = 0; + + for (var i = 0; i < numNodes; i++) { + var node = nodes[i]; + // add current node to the current options object and call degreeCentrality + var currDegree = this.degreeCentrality(util.extend({}, options, { root: node })); + if (maxDegree < currDegree.degree) maxDegree = currDegree.degree; + + degrees[node.id()] = currDegree.degree; + } + + return { + degree: function degree(node) { + if (maxDegree == 0) return 0; + + if (is.string(node)) { + // from is a selector string + var node = cy.filter(node)[0].id(); + } else { + // from is a node + var node = node.id(); + } + + return degrees[node] / maxDegree; + } + }; + } else { + var indegrees = {}; + var outdegrees = {}; + var maxIndegree = 0; + var maxOutdegree = 0; + + for (var i = 0; i < numNodes; i++) { + var node = nodes[i]; + // add current node to the current options object and call degreeCentrality + var currDegree = this.degreeCentrality(util.extend({}, options, { root: node })); + + if (maxIndegree < currDegree.indegree) maxIndegree = currDegree.indegree; + + if (maxOutdegree < currDegree.outdegree) maxOutdegree = currDegree.outdegree; + + indegrees[node.id()] = currDegree.indegree; + outdegrees[node.id()] = currDegree.outdegree; + } + + return { + indegree: function indegree(node) { + if (maxIndegree == 0) return 0; + + if (is.string(node)) { + // from is a selector string + var node = cy.filter(node)[0].id(); + } else { + // from is a node + var node = node.id(); + } + + return indegrees[node] / maxIndegree; + }, + outdegree: function outdegree(node) { + if (maxOutdegree == 0) return 0; + + if (is.string(node)) { + // from is a selector string + var node = cy.filter(node)[0].id(); + } else { + // from is a node + var node = node.id(); + } + + return outdegrees[node] / maxOutdegree; + } + + }; + } + }, // degreeCentralityNormalized + + // Implemented from the algorithm in Opsahl's paper + // "Node centrality in weighted networks: Generalizing degree and shortest paths" + // check the heading 2 "Degree" + degreeCentrality: function degreeCentrality(options) { + options = options || {}; + + var callingEles = this; + + // root - mandatory! + if (options != null && options.root != null) { + var root = is.string(options.root) ? this.filter(options.root)[0] : options.root[0]; + } else { + return undefined; + } + + // weight - optional + if (options.weight != null && is.fn(options.weight)) { + var weightFn = options.weight; + } else { + // If not specified, assume each edge has equal weight (1) + var weightFn = function weightFn(e) { + return 1; + }; + } + + // directed - optional + if (options.directed != null) { + var directed = options.directed; + } else { + var directed = false; + } + + // alpha - optional + if (options.alpha != null && is.number(options.alpha)) { + var alpha = options.alpha; + } else { + alpha = 0; + } + + if (!directed) { + var connEdges = root.connectedEdges().intersection(callingEles); + var k = connEdges.length; + var s = 0; + + // Now, sum edge weights + for (var i = 0; i < connEdges.length; i++) { + var edge = connEdges[i]; + s += weightFn(edge); + } + + return { + degree: Math.pow(k, 1 - alpha) * Math.pow(s, alpha) + }; + } else { + var incoming = root.connectedEdges('edge[target = "' + root.id() + '"]').intersection(callingEles); + var outgoing = root.connectedEdges('edge[source = "' + root.id() + '"]').intersection(callingEles); + var k_in = incoming.length; + var k_out = outgoing.length; + var s_in = 0; + var s_out = 0; + + // Now, sum incoming edge weights + for (var i = 0; i < incoming.length; i++) { + var edge = incoming[i]; + s_in += weightFn(edge); + } + + // Now, sum outgoing edge weights + for (var i = 0; i < outgoing.length; i++) { + var edge = outgoing[i]; + s_out += weightFn(edge); + } + + return { + indegree: Math.pow(k_in, 1 - alpha) * Math.pow(s_in, alpha), + outdegree: Math.pow(k_out, 1 - alpha) * Math.pow(s_out, alpha) + }; + } + } // degreeCentrality + +}; // elesfn + +// nice, short mathemathical alias +elesfn.dc = elesfn.degreeCentrality; +elesfn.dcn = elesfn.degreeCentralityNormalised = elesfn.degreeCentralityNormalized; + +module.exports = elesfn; + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); + +var elesfn = { + + closenessCentralityNormalized: function closenessCentralityNormalized(options) { + options = options || {}; + + var cy = this.cy(); + + var harmonic = options.harmonic; + if (harmonic === undefined) { + harmonic = true; + } + + var closenesses = {}; + var maxCloseness = 0; + var nodes = this.nodes(); + var fw = this.floydWarshall({ weight: options.weight, directed: options.directed }); + + // Compute closeness for every node and find the maximum closeness + for (var i = 0; i < nodes.length; i++) { + var currCloseness = 0; + for (var j = 0; j < nodes.length; j++) { + if (i != j) { + var d = fw.distance(nodes[i], nodes[j]); + + if (harmonic) { + currCloseness += 1 / d; + } else { + currCloseness += d; + } + } + } + + if (!harmonic) { + currCloseness = 1 / currCloseness; + } + + if (maxCloseness < currCloseness) { + maxCloseness = currCloseness; + } + + closenesses[nodes[i].id()] = currCloseness; + } + + return { + closeness: function closeness(node) { + if (maxCloseness == 0) { + return 0; + } + + if (is.string(node)) { + // from is a selector string + var node = cy.filter(node)[0].id(); + } else { + // from is a node + var node = node.id(); + } + + return closenesses[node] / maxCloseness; + } + }; + }, + + // Implemented from pseudocode from wikipedia + closenessCentrality: function closenessCentrality(options) { + options = options || {}; + + // root - mandatory! + if (options.root != null) { + if (is.string(options.root)) { + // use it as a selector, e.g. "#rootID + var root = this.filter(options.root)[0]; + } else { + var root = options.root[0]; + } + } else { + return undefined; + } + + // weight - optional + if (options.weight != null && is.fn(options.weight)) { + var weight = options.weight; + } else { + var weight = function weight() { + return 1; + }; + } + + // directed - optional + if (options.directed != null && is.bool(options.directed)) { + var directed = options.directed; + } else { + var directed = false; + } + + var harmonic = options.harmonic; + if (harmonic === undefined) { + harmonic = true; + } + + // we need distance from this node to every other node + var dijkstra = this.dijkstra({ + root: root, + weight: weight, + directed: directed + }); + var totalDistance = 0; + + var nodes = this.nodes(); + for (var i = 0; i < nodes.length; i++) { + if (nodes[i].id() != root.id()) { + var d = dijkstra.distanceTo(nodes[i]); + + if (harmonic) { + totalDistance += 1 / d; + } else { + totalDistance += d; + } + } + } + + return harmonic ? totalDistance : 1 / totalDistance; + } // closenessCentrality + +}; // elesfn + +// nice, short mathemathical alias +elesfn.cc = elesfn.closenessCentrality; +elesfn.ccn = elesfn.closenessCentralityNormalised = elesfn.closenessCentralityNormalized; + +module.exports = elesfn; + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var Heap = __webpack_require__(9); + +var elesfn = { + + // Implemented from the algorithm in the paper "On Variants of Shortest-Path Betweenness Centrality and their Generic Computation" by Ulrik Brandes + betweennessCentrality: function betweennessCentrality(options) { + options = options || {}; + + // Weight - optional + var weighted, weightFn; + if (is.fn(options.weight)) { + weightFn = options.weight; + weighted = true; + } else { + weighted = false; + } + + // Directed - default false + var directed = options.directed != null ? options.directed : false; + + var cy = this._private.cy; + + // starting + var V = this.nodes(); + var A = {}; + var _C = {}; + var max = 0; + var C = { + set: function set(key, val) { + _C[key] = val; + + if (val > max) { + max = val; + } + }, + + get: function get(key) { + return _C[key]; + } + }; + + // A contains the neighborhoods of every node + for (var i = 0; i < V.length; i++) { + var v = V[i]; + var vid = v.id(); + + if (directed) { + A[vid] = v.outgoers().nodes(); // get outgoers of every node + } else { + A[vid] = v.openNeighborhood().nodes(); // get neighbors of every node + } + + C.set(vid, 0); + } + + for (var s = 0; s < V.length; s++) { + var sid = V[s].id(); + var S = []; // stack + var P = {}; + var g = {}; + var d = {}; + var Q = new Heap(function (a, b) { + return d[a] - d[b]; + }); // queue + + // init dictionaries + for (var i = 0; i < V.length; i++) { + var vid = V[i].id(); + + P[vid] = []; + g[vid] = 0; + d[vid] = Infinity; + } + + g[sid] = 1; // sigma + d[sid] = 0; // distance to s + + Q.push(sid); + + while (!Q.empty()) { + var v = Q.pop(); + + S.push(v); + + if (weighted) { + for (var j = 0; j < A[v].length; j++) { + var w = A[v][j]; + var vEle = cy.getElementById(v); + + var edge; + if (vEle.edgesTo(w).length > 0) { + edge = vEle.edgesTo(w)[0]; + } else { + edge = w.edgesTo(vEle)[0]; + } + + var edgeWeight = weightFn(edge); + + w = w.id(); + + if (d[w] > d[v] + edgeWeight) { + d[w] = d[v] + edgeWeight; + + if (Q.nodes.indexOf(w) < 0) { + //if w is not in Q + Q.push(w); + } else { + // update position if w is in Q + Q.updateItem(w); + } + + g[w] = 0; + P[w] = []; + } + + if (d[w] == d[v] + edgeWeight) { + g[w] = g[w] + g[v]; + P[w].push(v); + } + } + } else { + for (var j = 0; j < A[v].length; j++) { + var w = A[v][j].id(); + + if (d[w] == Infinity) { + Q.push(w); + + d[w] = d[v] + 1; + } + + if (d[w] == d[v] + 1) { + g[w] = g[w] + g[v]; + P[w].push(v); + } + } + } + } + + var e = {}; + for (var i = 0; i < V.length; i++) { + e[V[i].id()] = 0; + } + + while (S.length > 0) { + var w = S.pop(); + + for (var j = 0; j < P[w].length; j++) { + var v = P[w][j]; + + e[v] = e[v] + g[v] / g[w] * (1 + e[w]); + + if (w != V[s].id()) { + C.set(w, C.get(w) + e[w]); + } + } + } + } + + var ret = { + betweenness: function betweenness(node) { + if (is.string(node)) { + var node = cy.filter(node).id(); + } else { + var node = node.id(); + } + + return C.get(node); + }, + + betweennessNormalized: function betweennessNormalized(node) { + if (max == 0) return 0; + + if (is.string(node)) { + var node = cy.filter(node).id(); + } else { + var node = node.id(); + } + + return C.get(node) / max; + } + }; + + // alias + ret.betweennessNormalised = ret.betweennessNormalized; + + return ret; + } // betweennessCentrality + +}; // elesfn + +// nice, short mathemathical alias +elesfn.bc = elesfn.betweennessCentrality; + +module.exports = elesfn; + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var define = __webpack_require__(4); + +var elesfn = { + animate: define.animate(), + animation: define.animation(), + animated: define.animated(), + clearQueue: define.clearQueue(), + delay: define.delay(), + delayAnimation: define.delayAnimation(), + stop: define.stop() +}; + +module.exports = elesfn; + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var Animation = __webpack_require__(45); +var math = __webpack_require__(2); +var is = __webpack_require__(0); + +var define = { + + animated: function animated() { + return function animatedImpl() { + var self = this; + var selfIsArrayLike = self.length !== undefined; + var all = selfIsArrayLike ? self : [self]; // put in array if not array-like + var cy = this._private.cy || this; + + if (!cy.styleEnabled()) { + return false; + } + + var ele = all[0]; + + if (ele) { + return ele._private.animation.current.length > 0; + } + }; + }, // animated + + clearQueue: function clearQueue() { + return function clearQueueImpl() { + var self = this; + var selfIsArrayLike = self.length !== undefined; + var all = selfIsArrayLike ? self : [self]; // put in array if not array-like + var cy = this._private.cy || this; + + if (!cy.styleEnabled()) { + return this; + } + + for (var i = 0; i < all.length; i++) { + var ele = all[i]; + ele._private.animation.queue = []; + } + + return this; + }; + }, // clearQueue + + delay: function delay() { + return function delayImpl(time, complete) { + var cy = this._private.cy || this; + + if (!cy.styleEnabled()) { + return this; + } + + return this.animate({ + delay: time, + duration: time, + complete: complete + }); + }; + }, // delay + + delayAnimation: function delayAnimation() { + return function delayAnimationImpl(time, complete) { + var cy = this._private.cy || this; + + if (!cy.styleEnabled()) { + return this; + } + + return this.animation({ + delay: time, + duration: time, + complete: complete + }); + }; + }, // delay + + animation: function animation() { + return function animationImpl(properties, params) { + var self = this; + var selfIsArrayLike = self.length !== undefined; + var all = selfIsArrayLike ? self : [self]; // put in array if not array-like + var cy = this._private.cy || this; + var isCore = !selfIsArrayLike; + var isEles = !isCore; + + if (!cy.styleEnabled()) { + return this; + } + + var style = cy.style(); + + properties = util.assign({}, properties, params); + + var propertiesEmpty = Object.keys(properties).length === 0; + + if (propertiesEmpty) { + return new Animation(all[0], properties); // nothing to animate + } + + if (properties.duration === undefined) { + properties.duration = 400; + } + + switch (properties.duration) { + case 'slow': + properties.duration = 600; + break; + case 'fast': + properties.duration = 200; + break; + } + + if (isEles) { + properties.style = style.getPropsList(properties.style || properties.css); + + properties.css = undefined; + } + + if (isEles && properties.renderedPosition != null) { + var rpos = properties.renderedPosition; + var pan = cy.pan(); + var zoom = cy.zoom(); + + properties.position = math.renderedToModelPosition(rpos, zoom, pan); + } + + // override pan w/ panBy if set + if (isCore && properties.panBy != null) { + var panBy = properties.panBy; + var cyPan = cy.pan(); + + properties.pan = { + x: cyPan.x + panBy.x, + y: cyPan.y + panBy.y + }; + } + + // override pan w/ center if set + var center = properties.center || properties.centre; + if (isCore && center != null) { + var centerPan = cy.getCenterPan(center.eles, properties.zoom); + + if (centerPan != null) { + properties.pan = centerPan; + } + } + + // override pan & zoom w/ fit if set + if (isCore && properties.fit != null) { + var fit = properties.fit; + var fitVp = cy.getFitViewport(fit.eles || fit.boundingBox, fit.padding); + + if (fitVp != null) { + properties.pan = fitVp.pan; + properties.zoom = fitVp.zoom; + } + } + + // override zoom (& potentially pan) w/ zoom obj if set + if (isCore && is.plainObject(properties.zoom)) { + var vp = cy.getZoomedViewport(properties.zoom); + + if (vp != null) { + if (vp.zoomed) { + properties.zoom = vp.zoom; + } + + if (vp.panned) { + properties.pan = vp.pan; + } + } + } + + return new Animation(all[0], properties); + }; + }, // animate + + animate: function animate() { + return function animateImpl(properties, params) { + var self = this; + var selfIsArrayLike = self.length !== undefined; + var all = selfIsArrayLike ? self : [self]; // put in array if not array-like + var cy = this._private.cy || this; + + if (!cy.styleEnabled()) { + return this; + } + + if (params) { + properties = util.extend({}, properties, params); + } + + // manually hook and run the animation + for (var i = 0; i < all.length; i++) { + var ele = all[i]; + var queue = ele.animated() && (properties.queue === undefined || properties.queue); + + var ani = ele.animation(properties, queue ? { queue: true } : undefined); + + ani.play(); + } + + return this; // chaining + }; + }, // animate + + stop: function stop() { + return function stopImpl(clearQueue, jumpToEnd) { + var self = this; + var selfIsArrayLike = self.length !== undefined; + var all = selfIsArrayLike ? self : [self]; // put in array if not array-like + var cy = this._private.cy || this; + + if (!cy.styleEnabled()) { + return this; + } + + for (var i = 0; i < all.length; i++) { + var ele = all[i]; + var _p = ele._private; + var anis = _p.animation.current; + + for (var j = 0; j < anis.length; j++) { + var ani = anis[j]; + var ani_p = ani._private; + + if (jumpToEnd) { + // next iteration of the animation loop, the animation + // will go straight to the end and be removed + ani_p.duration = 0; + } + } + + // clear the queue of future animations + if (clearQueue) { + _p.animation.queue = []; + } + + if (!jumpToEnd) { + _p.animation.current = []; + } + } + + // we have to notify (the animation loop doesn't do it for us on `stop`) + cy.notify({ + eles: this, + type: 'draw' + }); + + return this; + }; + } // stop + +}; // define + +module.exports = define; + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var is = __webpack_require__(0); +var Promise = __webpack_require__(5); + +var Animation = function Animation(target, opts, opts2) { + var _p = this._private = util.extend({ + duration: 1000 + }, opts, opts2); + + _p.target = target; + _p.style = _p.style || _p.css; + _p.started = false; + _p.playing = false; + _p.hooked = false; + _p.applying = false; + _p.progress = 0; + _p.completes = []; + _p.frames = []; + + if (_p.complete && is.fn(_p.complete)) { + _p.completes.push(_p.complete); + } + + // for future timeline/animations impl + this.length = 1; + this[0] = this; +}; + +var anifn = Animation.prototype; + +util.extend(anifn, { + + instanceString: function instanceString() { + return 'animation'; + }, + + hook: function hook() { + var _p = this._private; + + if (!_p.hooked) { + // add to target's animation queue + var q = void 0; + var tAni = _p.target._private.animation; + if (_p.queue) { + q = tAni.queue; + } else { + q = tAni.current; + } + q.push(this); + + // add to the animation loop pool + if (is.elementOrCollection(_p.target)) { + _p.target.cy().addToAnimationPool(_p.target); + } + + _p.hooked = true; + } + + return this; + }, + + play: function play() { + var _p = this._private; + + // autorewind + if (_p.progress === 1) { + _p.progress = 0; + } + + _p.playing = true; + _p.started = false; // needs to be started by animation loop + _p.stopped = false; + + this.hook(); + + // the animation loop will start the animation... + + return this; + }, + + playing: function playing() { + return this._private.playing; + }, + + apply: function apply() { + var _p = this._private; + + _p.applying = true; + _p.started = false; // needs to be started by animation loop + _p.stopped = false; + + this.hook(); + + // the animation loop will apply the animation at this progress + + return this; + }, + + applying: function applying() { + return this._private.applying; + }, + + pause: function pause() { + var _p = this._private; + + _p.playing = false; + _p.started = false; + + return this; + }, + + stop: function stop() { + var _p = this._private; + + _p.playing = false; + _p.started = false; + _p.stopped = true; // to be removed from animation queues + + return this; + }, + + rewind: function rewind() { + return this.progress(0); + }, + + fastforward: function fastforward() { + return this.progress(1); + }, + + time: function time(t) { + var _p = this._private; + + if (t === undefined) { + return _p.progress * _p.duration; + } else { + return this.progress(t / _p.duration); + } + }, + + progress: function progress(p) { + var _p = this._private; + var wasPlaying = _p.playing; + + if (p === undefined) { + return _p.progress; + } else { + if (wasPlaying) { + this.pause(); + } + + _p.progress = p; + _p.started = false; + + if (wasPlaying) { + this.play(); + } + } + + return this; + }, + + completed: function completed() { + return this._private.progress === 1; + }, + + reverse: function reverse() { + var _p = this._private; + var wasPlaying = _p.playing; + + if (wasPlaying) { + this.pause(); + } + + _p.progress = 1 - _p.progress; + _p.started = false; + + var swap = function swap(a, b) { + var _pa = _p[a]; + + if (_pa == null) { + return; + } + + _p[a] = _p[b]; + _p[b] = _pa; + }; + + swap('zoom', 'startZoom'); + swap('pan', 'startPan'); + swap('position', 'startPosition'); + + // swap styles + if (_p.style) { + for (var i = 0; i < _p.style.length; i++) { + var prop = _p.style[i]; + var name = prop.name; + var startStyleProp = _p.startStyle[name]; + + _p.startStyle[name] = prop; + _p.style[i] = startStyleProp; + } + } + + if (wasPlaying) { + this.play(); + } + + return this; + }, + + promise: function promise(type) { + var _p = this._private; + + var arr = void 0; + + switch (type) { + case 'frame': + arr = _p.frames; + break; + default: + case 'complete': + case 'completed': + arr = _p.completes; + } + + return new Promise(function (resolve, reject) { + arr.push(function () { + resolve(); + }); + }); + } + +}); + +anifn.complete = anifn.completed; + +module.exports = Animation; + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +var util = __webpack_require__(1); +var is = __webpack_require__(0); + +var define = { + + // access data field + data: function data(params) { + var defaults = { + field: 'data', + bindingEvent: 'data', + allowBinding: false, + allowSetting: false, + allowGetting: false, + settingEvent: 'data', + settingTriggersEvent: false, + triggerFnName: 'trigger', + immutableKeys: {}, // key => true if immutable + updateStyle: false, + beforeGet: function beforeGet(self) {}, + beforeSet: function beforeSet(self, obj) {}, + onSet: function onSet(self) {}, + canSet: function canSet(self) { + return true; + } + }; + params = util.extend({}, defaults, params); + + return function dataImpl(name, value) { + var p = params; + var self = this; + var selfIsArrayLike = self.length !== undefined; + var all = selfIsArrayLike ? self : [self]; // put in array if not array-like + var single = selfIsArrayLike ? self[0] : self; + + // .data('foo', ...) + if (is.string(name)) { + // set or get property + + // .data('foo') + if (p.allowGetting && value === undefined) { + // get + + var ret = void 0; + if (single) { + p.beforeGet(single); + + ret = single._private[p.field][name]; + } + return ret; + + // .data('foo', 'bar') + } else if (p.allowSetting && value !== undefined) { + // set + var valid = !p.immutableKeys[name]; + if (valid) { + var change = _defineProperty({}, name, value); + + p.beforeSet(self, change); + + for (var i = 0, l = all.length; i < l; i++) { + var ele = all[i]; + + if (p.canSet(ele)) { + ele._private[p.field][name] = value; + } + } + + // update mappers if asked + if (p.updateStyle) { + self.updateStyle(); + } + + // call onSet callback + p.onSet(self); + + if (p.settingTriggersEvent) { + self[p.triggerFnName](p.settingEvent); + } + } + } + + // .data({ 'foo': 'bar' }) + } else if (p.allowSetting && is.plainObject(name)) { + // extend + var obj = name; + var k = void 0, + v = void 0; + var keys = Object.keys(obj); + + p.beforeSet(self, obj); + + for (var _i = 0; _i < keys.length; _i++) { + k = keys[_i]; + v = obj[k]; + + var _valid = !p.immutableKeys[k]; + if (_valid) { + for (var j = 0; j < all.length; j++) { + var _ele = all[j]; + + if (p.canSet(_ele)) { + _ele._private[p.field][k] = v; + } + } + } + } + + // update mappers if asked + if (p.updateStyle) { + self.updateStyle(); + } + + // call onSet callback + p.onSet(self); + + if (p.settingTriggersEvent) { + self[p.triggerFnName](p.settingEvent); + } + + // .data(function(){ ... }) + } else if (p.allowBinding && is.fn(name)) { + // bind to event + var fn = name; + self.on(p.bindingEvent, fn); + + // .data() + } else if (p.allowGetting && name === undefined) { + // get whole object + var _ret = void 0; + if (single) { + p.beforeGet(single); + + _ret = single._private[p.field]; + } + return _ret; + } + + return self; // maintain chainability + }; // function + }, // data + + // remove data field + removeData: function removeData(params) { + var defaults = { + field: 'data', + event: 'data', + triggerFnName: 'trigger', + triggerEvent: false, + immutableKeys: {} // key => true if immutable + }; + params = util.extend({}, defaults, params); + + return function removeDataImpl(names) { + var p = params; + var self = this; + var selfIsArrayLike = self.length !== undefined; + var all = selfIsArrayLike ? self : [self]; // put in array if not array-like + + // .removeData('foo bar') + if (is.string(names)) { + // then get the list of keys, and delete them + var keys = names.split(/\s+/); + var l = keys.length; + + for (var i = 0; i < l; i++) { + // delete each non-empty key + var key = keys[i]; + if (is.emptyString(key)) { + continue; + } + + var valid = !p.immutableKeys[key]; // not valid if immutable + if (valid) { + for (var i_a = 0, l_a = all.length; i_a < l_a; i_a++) { + all[i_a]._private[p.field][key] = undefined; + } + } + } + + if (p.triggerEvent) { + self[p.triggerFnName](p.event); + } + + // .removeData() + } else if (names === undefined) { + // then delete all keys + + for (var _i_a = 0, _l_a = all.length; _i_a < _l_a; _i_a++) { + var _privateFields = all[_i_a]._private[p.field]; + var _keys = Object.keys(_privateFields); + + for (var _i2 = 0; _i2 < _keys.length; _i2++) { + var _key = _keys[_i2]; + var validKeyToDelete = !p.immutableKeys[_key]; + + if (validKeyToDelete) { + _privateFields[_key] = undefined; + } + } + } + + if (p.triggerEvent) { + self[p.triggerFnName](p.event); + } + } + + return self; // maintain chaining + }; // function + } // removeData +}; // define + +module.exports = define; + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Promise = __webpack_require__(5); + +var define = { + + eventAliasesOn: function eventAliasesOn(proto) { + var p = proto; + + p.addListener = p.listen = p.bind = p.on; + p.unlisten = p.unbind = p.off = p.removeListener; + p.trigger = p.emit; + + // this is just a wrapper alias of .on() + p.pon = p.promiseOn = function (events, selector) { + var self = this; + var args = Array.prototype.slice.call(arguments, 0); + + return new Promise(function (resolve, reject) { + var callback = function callback(e) { + self.off.apply(self, offArgs); + + resolve(e); + }; + + var onArgs = args.concat([callback]); + var offArgs = onArgs.concat([]); + + self.on.apply(self, onArgs); + }); + }; + } + +}; // define + +module.exports = define; + +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Set = __webpack_require__(8); + +var elesfn = { + classes: function classes(_classes) { + _classes = (_classes || '').match(/\S+/g) || []; + var self = this; + var changed = []; + var classesMap = new Set(_classes); + + // check and update each ele + + var _loop = function _loop(j) { + var ele = self[j]; + var _p = ele._private; + var eleClasses = _p.classes; + var changedEle = false; + + // check if ele has all of the passed classes + classesMap.forEach(function (cls) { + var eleHasClass = eleClasses.has(cls); + + if (!eleHasClass) { + changedEle = true; + } + }); + + // check if ele has classes outside of those passed + if (!changedEle) { + eleClasses.forEach(function (eleCls) { + var specdClass = classesMap.has(eleCls); + + if (!specdClass) { + changedEle = true; + } + }); + } + + if (changedEle) { + _p.classes = new Set(classesMap); + + changed.push(ele); + } + }; + + for (var j = 0; j < self.length; j++) { + _loop(j); + } + + // trigger update style on those eles that had class changes + if (changed.length > 0) { + this.spawn(changed).updateStyle().emit('class'); + } + + return self; + }, + + addClass: function addClass(classes) { + return this.toggleClass(classes, true); + }, + + hasClass: function hasClass(className) { + var ele = this[0]; + return ele != null && ele._private.classes.has(className); + }, + + toggleClass: function toggleClass(classesStr, toggle) { + var classes = classesStr.match(/\S+/g) || []; + var self = this; + var changed = []; // eles who had classes changed + + for (var i = 0, il = self.length; i < il; i++) { + var _ele = self[i]; + var _changedEle = false; + + for (var j = 0; j < classes.length; j++) { + var cls = classes[j]; + var _eleClasses = _ele._private.classes; + var hasClass = _eleClasses.has(cls); + var shouldAdd = toggle || toggle === undefined && !hasClass; + + if (shouldAdd) { + _eleClasses.add(cls); + + if (!hasClass && !_changedEle) { + changed.push(_ele); + _changedEle = true; + } + } else { + // then remove + _eleClasses.delete(cls); + + if (hasClass && !_changedEle) { + changed.push(_ele); + _changedEle = true; + } + } + } // for j classes + } // for i eles + + // trigger update style on those eles that had class changes + if (changed.length > 0) { + this.spawn(changed).updateStyle().emit('class'); + } + + return self; + }, + + removeClass: function removeClass(classes) { + return this.toggleClass(classes, false); + }, + + flashClass: function flashClass(classes, duration) { + var self = this; + + if (duration == null) { + duration = 250; + } else if (duration === 0) { + return self; // nothing to do really + } + + self.addClass(classes); + setTimeout(function () { + self.removeClass(classes); + }, duration); + + return self; + } +}; + +module.exports = elesfn; + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var Selector = __webpack_require__(6); + +var elesfn = { + allAre: function allAre(selector) { + var selObj = new Selector(selector); + + return this.every(function (ele) { + return selObj.matches(ele); + }); + }, + + is: function is(selector) { + var selObj = new Selector(selector); + + return this.some(function (ele) { + return selObj.matches(ele); + }); + }, + + some: function some(fn, thisArg) { + for (var i = 0; i < this.length; i++) { + var ret = !thisArg ? fn(this[i], i, this) : fn.apply(thisArg, [this[i], i, this]); + + if (ret) { + return true; + } + } + + return false; + }, + + every: function every(fn, thisArg) { + for (var i = 0; i < this.length; i++) { + var ret = !thisArg ? fn(this[i], i, this) : fn.apply(thisArg, [this[i], i, this]); + + if (!ret) { + return false; + } + } + + return true; + }, + + same: function same(collection) { + collection = this.cy().collection(collection); + + // cheap extra check + if (this.length !== collection.length) { + return false; + } + + return this.every(function (ele) { + return collection.hasElementWithId(ele.id()); + }); + }, + + anySame: function anySame(collection) { + collection = this.cy().collection(collection); + + return this.some(function (ele) { + return collection.hasElementWithId(ele.id()); + }); + }, + + allAreNeighbors: function allAreNeighbors(collection) { + collection = this.cy().collection(collection); + + var nhood = this.neighborhood(); + + return collection.every(function (ele) { + return nhood.hasElementWithId(ele.id()); + }); + }, + + contains: function contains(collection) { + collection = this.cy().collection(collection); + + var self = this; + + return collection.every(function (ele) { + return self.hasElementWithId(ele.id()); + }); + } +}; + +elesfn.allAreNeighbours = elesfn.allAreNeighbors; +elesfn.has = elesfn.contains; + +module.exports = elesfn; + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var exprs = __webpack_require__(51); +var newQuery = __webpack_require__(10); + +// of all the expressions, find the first match in the remaining text +var consumeExpr = function consumeExpr(remaining) { + var expr = void 0; + var match = void 0; + var name = void 0; + + for (var j = 0; j < exprs.length; j++) { + var e = exprs[j]; + var n = e.name; + + var m = remaining.match(e.regexObj); + + if (m != null) { + match = m; + expr = e; + name = n; + + var consumed = m[0]; + remaining = remaining.substring(consumed.length); + + break; // we've consumed one expr, so we can return now + } + } + + return { + expr: expr, + match: match, + name: name, + remaining: remaining + }; +}; + +// consume all leading whitespace +var consumeWhitespace = function consumeWhitespace(remaining) { + var match = remaining.match(/^\s+/); + + if (match) { + var consumed = match[0]; + remaining = remaining.substring(consumed.length); + } + + return remaining; +}; + +var parse = function parse(selector) { + var self = this; + + var remaining = self._private.selectorText = selector; + + var currentQuery = self[0] = newQuery(); + self.length = 1; + + remaining = consumeWhitespace(remaining); // get rid of leading whitespace + + for (;;) { + var check = consumeExpr(remaining); + + if (check.expr == null) { + util.error('The selector `' + selector + '`is invalid'); + return false; + } else { + var args = check.match.slice(1); + + // let the token populate the selector object in currentQuery + var ret = check.expr.populate(self, currentQuery, args); + + if (ret === false) { + return false; // exit if population failed + } else if (ret != null) { + currentQuery = ret; // change the current query to be filled if the expr specifies + } + } + + remaining = check.remaining; + + // we're done when there's nothing left to parse + if (remaining.match(/^\s*$/)) { + break; + } + } + + // adjust references for subject + for (var j = 0; j < self.length; j++) { + var query = self[j]; + + if (query.subject != null) { + // go up the tree until we reach the subject + for (;;) { + if (query.subject === query) { + break; + } // done if subject is self + + if (query.parent != null) { + // swap parent/child reference + var parent = query.parent; + var child = query; + + child.parent = null; + parent.child = child; + + query = parent; // go up the tree + } else if (query.ancestor != null) { + // swap ancestor/descendant + var ancestor = query.ancestor; + var descendant = query; + + descendant.ancestor = null; + ancestor.descendant = descendant; + + query = ancestor; // go up the tree + } else if (query.source || query.target || query.connectedNodes) { + util.error('The selector `' + self.text() + '` can not contain a subject selector that applies to the source or target of an edge selector'); + return false; + } else { + util.error('When adjusting references for the selector `' + self.text() + '`, neither parent nor ancestor was found'); + return false; + } + } // for + + self[j] = query.subject; // subject should be the root query + } // if + } // for + + return true; // success +}; + +module.exports = { parse: parse }; + +/***/ }), +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _slicedToArray = function () { function sliceIterator(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"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _require = __webpack_require__(15), + stateSelectorRegex = _require.stateSelectorRegex; + +var tokens = __webpack_require__(52); +var util = __webpack_require__(1); +var newQuery = __webpack_require__(10); + +// when a token like a variable has escaped meta characters, we need to clean the backslashes out +// so that values get compared properly in Selector.filter() +var cleanMetaChars = function cleanMetaChars(str) { + return str.replace(new RegExp('\\\\(' + tokens.metaChar + ')', 'g'), function (match, $1) { + return $1; + }); +}; + +var replaceLastQuery = function replaceLastQuery(selector, examiningQuery, replacementQuery) { + if (examiningQuery === selector[selector.length - 1]) { + selector[selector.length - 1] = replacementQuery; + } +}; + +// NOTE: add new expression syntax here to have it recognised by the parser; +// - a query contains all adjacent (i.e. no separator in between) expressions; +// - the current query is stored in selector[i] --- you can use the reference to `this` in the populate function; +// - you need to check the query objects in Selector.filter() for it actually filter properly, but that's pretty straight forward +// - when you add something here, also add to Selector.toString() +var exprs = [{ + name: 'group', + query: true, + regex: '(' + tokens.group + ')', + populate: function populate(selector, query, _ref) { + var _ref2 = _slicedToArray(_ref, 1), + group = _ref2[0]; + + query.group = group === '*' ? group : group + 's'; + } +}, { + name: 'state', + query: true, + regex: stateSelectorRegex, + populate: function populate(selector, query, _ref3) { + var _ref4 = _slicedToArray(_ref3, 1), + state = _ref4[0]; + + query.colonSelectors.push(state); + } +}, { + name: 'id', + query: true, + regex: '\\#(' + tokens.id + ')', + populate: function populate(selector, query, _ref5) { + var _ref6 = _slicedToArray(_ref5, 1), + id = _ref6[0]; + + query.ids.push(cleanMetaChars(id)); + } +}, { + name: 'className', + query: true, + regex: '\\.(' + tokens.className + ')', + populate: function populate(selector, query, _ref7) { + var _ref8 = _slicedToArray(_ref7, 1), + className = _ref8[0]; + + query.classes.push(cleanMetaChars(className)); + } +}, { + name: 'dataExists', + query: true, + regex: '\\[\\s*(' + tokens.variable + ')\\s*\\]', + populate: function populate(selector, query, _ref9) { + var _ref10 = _slicedToArray(_ref9, 1), + variable = _ref10[0]; + + query.data.push({ + field: cleanMetaChars(variable) + }); + } +}, { + name: 'dataCompare', + query: true, + regex: '\\[\\s*(' + tokens.variable + ')\\s*(' + tokens.comparatorOp + ')\\s*(' + tokens.value + ')\\s*\\]', + populate: function populate(selector, query, _ref11) { + var _ref12 = _slicedToArray(_ref11, 3), + variable = _ref12[0], + comparatorOp = _ref12[1], + value = _ref12[2]; + + var valueIsString = new RegExp('^' + tokens.string + '$').exec(value) != null; + + if (valueIsString) { + value = value.substring(1, value.length - 1); + } else { + value = parseFloat(value); + } + + query.data.push({ + field: cleanMetaChars(variable), + operator: comparatorOp, + value: value + }); + } +}, { + name: 'dataBool', + query: true, + regex: '\\[\\s*(' + tokens.boolOp + ')\\s*(' + tokens.variable + ')\\s*\\]', + populate: function populate(selector, query, _ref13) { + var _ref14 = _slicedToArray(_ref13, 2), + boolOp = _ref14[0], + variable = _ref14[1]; + + query.data.push({ + field: cleanMetaChars(variable), + operator: boolOp + }); + } +}, { + name: 'metaCompare', + query: true, + regex: '\\[\\[\\s*(' + tokens.meta + ')\\s*(' + tokens.comparatorOp + ')\\s*(' + tokens.number + ')\\s*\\]\\]', + populate: function populate(selector, query, _ref15) { + var _ref16 = _slicedToArray(_ref15, 3), + meta = _ref16[0], + comparatorOp = _ref16[1], + number = _ref16[2]; + + query.meta.push({ + field: cleanMetaChars(meta), + operator: comparatorOp, + value: parseFloat(number) + }); + } +}, { + name: 'nextQuery', + separator: true, + regex: tokens.separator, + populate: function populate(selector) { + // go on to next query + var nextQuery = selector[selector.length++] = newQuery(); + selector.currentSubject = null; + + return nextQuery; + } +}, { + name: 'directedEdge', + separator: true, + regex: tokens.directedEdge, + populate: function populate(selector, query) { + var edgeQuery = newQuery(); + var source = query; + var target = newQuery(); + + edgeQuery.group = 'edges'; + edgeQuery.target = target; + edgeQuery.source = source; + edgeQuery.subject = selector.currentSubject; + + // the query in the selector should be the edge rather than the source + replaceLastQuery(selector, query, edgeQuery); + + // we're now populating the target query with expressions that follow + return target; + } +}, { + name: 'undirectedEdge', + separator: true, + regex: tokens.undirectedEdge, + populate: function populate(selector, query) { + var edgeQuery = newQuery(); + var source = query; + var target = newQuery(); + + edgeQuery.group = 'edges'; + edgeQuery.connectedNodes = [source, target]; + edgeQuery.subject = selector.currentSubject; + + // the query in the selector should be the edge rather than the source + replaceLastQuery(selector, query, edgeQuery); + + // we're now populating the target query with expressions that follow + return target; + } +}, { + name: 'child', + separator: true, + regex: tokens.child, + populate: function populate(selector, query) { + // this query is the parent of the following query + var childQuery = newQuery(); + childQuery.parent = query; + childQuery.subject = selector.currentSubject; + + // it's cheaper to compare children first and go up so replace the parent + replaceLastQuery(selector, query, childQuery); + + // we're now populating the child query with expressions that follow + return childQuery; + } +}, { + name: 'descendant', + separator: true, + regex: tokens.descendant, + populate: function populate(selector, query) { + // this query is the ancestor of the following query + var descendantQuery = newQuery(); + descendantQuery.ancestor = query; + descendantQuery.subject = selector.currentSubject; + + // it's cheaper to compare descendants first and go up so replace the ancestor + replaceLastQuery(selector, query, descendantQuery); + + // we're now populating the descendant query with expressions that follow + return descendantQuery; + } +}, { + name: 'subject', + modifier: true, + regex: tokens.subject, + populate: function populate(selector, query) { + if (selector.currentSubject != null && query.subject != query) { + util.error('Redefinition of subject in selector `' + selector.toString() + '`'); + return false; + } + + selector.currentSubject = query; + query.subject = query; + selector[selector.length - 1].subject = query; + } +}]; + +exprs.forEach(function (e) { + return e.regexObj = new RegExp('^' + e.regex); +}); + +module.exports = exprs; + +/***/ }), +/* 52 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); + +// tokens in the query language +var tokens = { + metaChar: '[\\!\\"\\#\\$\\%\\&\\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]', // chars we need to escape in let names, etc + comparatorOp: '=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=', // binary comparison op (used in data selectors) + boolOp: '\\?|\\!|\\^', // boolean (unary) operators (used in data selectors) + string: '"(?:\\\\"|[^"])*"' + '|' + "'(?:\\\\'|[^'])*'", // string literals (used in data selectors) -- doublequotes | singlequotes + number: util.regex.number, // number literal (used in data selectors) --- e.g. 0.1234, 1234, 12e123 + meta: 'degree|indegree|outdegree', // allowed metadata fields (i.e. allowed functions to use from Collection) + separator: '\\s*,\\s*', // queries are separated by commas, e.g. edge[foo = 'bar'], node.someClass + descendant: '\\s+', + child: '\\s+>\\s+', + subject: '\\$', + group: 'node|edge|\\*', + directedEdge: '\\s+->\\s+', + undirectedEdge: '\\s+<->\\s+' +}; +tokens.variable = '(?:[\\w-]|(?:\\\\' + tokens.metaChar + '))+'; // a variable name +tokens.value = tokens.string + '|' + tokens.number; // a value literal, either a string or number +tokens.className = tokens.variable; // a class name (follows variable conventions) +tokens.id = tokens.variable; // an element id (follows variable conventions) + +(function () { + var ops = void 0, + op = void 0, + i = void 0; + + // add @ variants to comparatorOp + ops = tokens.comparatorOp.split('|'); + for (i = 0; i < ops.length; i++) { + op = ops[i]; + tokens.comparatorOp += '|@' + op; + } + + // add ! variants to comparatorOp + ops = tokens.comparatorOp.split('|'); + for (i = 0; i < ops.length; i++) { + op = ops[i]; + + if (op.indexOf('!') >= 0) { + continue; + } // skip ops that explicitly contain ! + if (op === '=') { + continue; + } // skip = b/c != is explicitly defined + + tokens.comparatorOp += '|\\!' + op; + } +})(); + +module.exports = tokens; + +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _require = __webpack_require__(15), + stateSelectorMatches = _require.stateSelectorMatches; + +var is = __webpack_require__(0); + +// generic checking for data/metadata +var operandsMatch = function operandsMatch(query, params) { + var allDataMatches = true; + for (var k = 0; k < query[params.name].length; k++) { + var data = query[params.name][k]; + var operator = data.operator; + var value = data.value; + var field = data.field; + var _matches = void 0; + var fieldVal = params.fieldValue(field); + + if (operator != null && value != null) { + var fieldStr = !is.string(fieldVal) && !is.number(fieldVal) ? '' : '' + fieldVal; + var valStr = '' + value; + + var caseInsensitive = false; + if (operator.indexOf('@') >= 0) { + fieldStr = fieldStr.toLowerCase(); + valStr = valStr.toLowerCase(); + + operator = operator.replace('@', ''); + caseInsensitive = true; + } + + var notExpr = false; + if (operator.indexOf('!') >= 0) { + operator = operator.replace('!', ''); + notExpr = true; + } + + // if we're doing a case insensitive comparison, then we're using a STRING comparison + // even if we're comparing numbers + if (caseInsensitive) { + value = valStr.toLowerCase(); + fieldVal = fieldStr.toLowerCase(); + } + + var isIneqCmp = false; + + switch (operator) { + case '*=': + _matches = fieldStr.indexOf(valStr) >= 0; + break; + case '$=': + _matches = fieldStr.indexOf(valStr, fieldStr.length - valStr.length) >= 0; + break; + case '^=': + _matches = fieldStr.indexOf(valStr) === 0; + break; + case '=': + _matches = fieldVal === value; + break; + case '>': + isIneqCmp = true; + _matches = fieldVal > value; + break; + case '>=': + isIneqCmp = true; + _matches = fieldVal >= value; + break; + case '<': + isIneqCmp = true; + _matches = fieldVal < value; + break; + case '<=': + isIneqCmp = true; + _matches = fieldVal <= value; + break; + default: + _matches = false; + break; + } + + // apply the not op, but null vals for inequalities should always stay non-matching + if (notExpr && (fieldVal != null || !isIneqCmp)) { + _matches = !_matches; + } + } else if (operator != null) { + switch (operator) { + case '?': + _matches = fieldVal ? true : false; + break; + case '!': + _matches = fieldVal ? false : true; + break; + case '^': + _matches = fieldVal === undefined; + break; + } + } else { + _matches = fieldVal !== undefined; + } + + if (!_matches) { + allDataMatches = false; + break; + } + } // for + + return allDataMatches; +}; // operandsMatch + +// check parent/child relations +var confirmRelations = function confirmRelations(query, isNecessary, eles) { + if (query != null) { + var _matches2 = false; + + if (!isNecessary) { + return false; + } + + eles = eles(); // save cycles if query == null + + // query must match for at least one element (may be recursive) + for (var i = 0; i < eles.length; i++) { + if (queryMatches(query, eles[i])) { + _matches2 = true; + break; + } + } + + return _matches2; + } else { + return true; + } +}; + +var queryMatches = function queryMatches(query, ele) { + // make single group-only selectors really cheap to check since they're the most common ones + if (query.groupOnly) { + return query.group === '*' || query.group === ele.group(); + } + + // check group + if (query.group != null && query.group != '*' && query.group != ele.group()) { + return false; + } + + var cy = ele.cy(); + var k = void 0; + + // check colon selectors + var allColonSelectorsMatch = true; + for (k = 0; k < query.colonSelectors.length; k++) { + var sel = query.colonSelectors[k]; + + allColonSelectorsMatch = stateSelectorMatches(sel, ele); + + if (!allColonSelectorsMatch) break; + } + if (!allColonSelectorsMatch) return false; + + // check id + var allIdsMatch = true; + for (k = 0; k < query.ids.length; k++) { + var id = query.ids[k]; + var actualId = ele.id(); + + allIdsMatch = allIdsMatch && id == actualId; + + if (!allIdsMatch) break; + } + if (!allIdsMatch) return false; + + // check classes + var allClassesMatch = true; + for (k = 0; k < query.classes.length; k++) { + var cls = query.classes[k]; + + allClassesMatch = allClassesMatch && ele.hasClass(cls); + + if (!allClassesMatch) break; + } + if (!allClassesMatch) return false; + + // check data matches + var allDataMatches = operandsMatch(query, { + name: 'data', + fieldValue: function fieldValue(field) { + return ele.data(field); + } + }); + + if (!allDataMatches) { + return false; + } + + // check metadata matches + var allMetaMatches = operandsMatch(query, { + name: 'meta', + fieldValue: function fieldValue(field) { + return ele[field](); + } + }); + + if (!allMetaMatches) { + return false; + } + + // check collection + if (query.collection != null) { + var matchesAny = query.collection.hasElementWithId(ele.id()); + + if (!matchesAny) { + return false; + } + } + + // check filter function + if (query.filter != null && ele.collection().some(query.filter)) { + return false; + } + + var isCompound = cy.hasCompoundNodes(); + var getSource = function getSource() { + return ele.source(); + }; + var getTarget = function getTarget() { + return ele.target(); + }; + + if (!confirmRelations(query.parent, isCompound, function () { + return ele.parent(); + })) { + return false; + } + + if (!confirmRelations(query.ancestor, isCompound, function () { + return ele.parents(); + })) { + return false; + } + + if (!confirmRelations(query.child, isCompound, function () { + return ele.children(); + })) { + return false; + } + + if (!confirmRelations(query.descendant, isCompound, function () { + return ele.descendants(); + })) { + return false; + } + + if (!confirmRelations(query.source, true, getSource)) { + return false; + } + + if (!confirmRelations(query.target, true, getTarget)) { + return false; + } + + if (query.connectedNodes) { + var q0 = query.connectedNodes[0]; + var q1 = query.connectedNodes[1]; + + if (confirmRelations(q0, true, getSource) && confirmRelations(q1, true, getTarget)) { + // match + } else if (confirmRelations(q0, true, getTarget) && confirmRelations(q1, true, getSource)) { + // match + } else { + return false; + } + } + + // we've reached the end, so we've matched everything for this query + return true; +}; // queryMatches + +// filter an existing collection +var filter = function filter(collection) { + var self = this; + var cy = collection.cy(); + + // don't bother trying if it's invalid + if (self.invalid()) { + return cy.collection(); + } + + // for 1 id #foo queries, just get the element + if (self.length === 1 && self[0].length === 1 && self[0].ids.length === 1) { + return collection.getElementById(self[0].ids[0]).collection(); + } + + var selectorFunction = function selectorFunction(element) { + for (var j = 0; j < self.length; j++) { + var query = self[j]; + + if (queryMatches(query, element)) { + return true; + } + } + + return false; + }; + + if (self.text() == null) { + selectorFunction = function selectorFunction() { + return true; + }; + } + + var filteredCollection = collection.filter(selectorFunction); + + return filteredCollection; +}; // filter + +// does selector match a single element? +var matches = function matches(ele) { + var self = this; + + // don't bother trying if it's invalid + if (self.invalid()) { + return false; + } + + for (var j = 0; j < self.length; j++) { + var query = self[j]; + + if (queryMatches(query, ele)) { + return true; + } + } + + return false; +}; // filter + +module.exports = { matches: matches, filter: filter }; + +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Set = __webpack_require__(8); + +var elesfn = { + parent: function parent(selector) { + var parents = []; + + // optimisation for single ele call + if (this.length === 1) { + var parent = this[0]._private.parent; + + if (parent) { + return parent; + } + } + + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + var _parent = ele._private.parent; + + if (_parent) { + parents.push(_parent); + } + } + + return this.spawn(parents, { unique: true }).filter(selector); + }, + + parents: function parents(selector) { + var parents = []; + + var eles = this.parent(); + while (eles.nonempty()) { + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + parents.push(ele); + } + + eles = eles.parent(); + } + + return this.spawn(parents, { unique: true }).filter(selector); + }, + + commonAncestors: function commonAncestors(selector) { + var ancestors = void 0; + + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + var parents = ele.parents(); + + ancestors = ancestors || parents; + + ancestors = ancestors.intersect(parents); // current list must be common with current ele parents set + } + + return ancestors.filter(selector); + }, + + orphans: function orphans(selector) { + return this.stdFilter(function (ele) { + return ele.isOrphan(); + }).filter(selector); + }, + + nonorphans: function nonorphans(selector) { + return this.stdFilter(function (ele) { + return ele.isChild(); + }).filter(selector); + }, + + children: function children(selector) { + var children = []; + + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + children = children.concat(ele._private.children); + } + + return this.spawn(children, { unique: true }).filter(selector); + }, + + siblings: function siblings(selector) { + return this.parent().children().not(this).filter(selector); + }, + + isParent: function isParent() { + var ele = this[0]; + + if (ele) { + return ele.isNode() && ele._private.children.length !== 0; + } + }, + + isChildless: function isChildless() { + var ele = this[0]; + + if (ele) { + return ele.isNode() && ele._private.children.length === 0; + } + }, + + isChild: function isChild() { + var ele = this[0]; + + if (ele) { + return ele.isNode() && ele._private.parent != null; + } + }, + + isOrphan: function isOrphan() { + var ele = this[0]; + + if (ele) { + return ele.isNode() && ele._private.parent == null; + } + }, + + descendants: function descendants(selector) { + var elements = []; + + function add(eles) { + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + + elements.push(ele); + + if (ele.children().nonempty()) { + add(ele.children()); + } + } + } + + add(this.children()); + + return this.spawn(elements, { unique: true }).filter(selector); + } +}; + +function forEachCompound(eles, fn, includeSelf, recursiveStep) { + var q = []; + var did = new Set(); + var cy = eles.cy(); + var hasCompounds = cy.hasCompoundNodes(); + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + + if (includeSelf) { + q.push(ele); + } else if (hasCompounds) { + recursiveStep(q, did, ele); + } + } + + while (q.length > 0) { + var _ele = q.shift(); + + fn(_ele); + + did.add(_ele.id()); + + if (hasCompounds) { + recursiveStep(q, did, _ele); + } + } + + return eles; +} + +function addChildren(q, did, ele) { + if (ele.isParent()) { + var children = ele._private.children; + + for (var i = 0; i < children.length; i++) { + var child = children[i]; + + if (!did.has(child.id())) { + q.push(child); + } + } + } +} + +// very efficient version of eles.add( eles.descendants() ).forEach() +// for internal use +elesfn.forEachDown = function (fn) { + var includeSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + return forEachCompound(this, fn, includeSelf, addChildren); +}; + +function addParent(q, did, ele) { + if (ele.isChild()) { + var parent = ele._private.parent; + + if (!did.has(parent.id())) { + q.push(parent); + } + } +} + +elesfn.forEachUp = function (fn) { + var includeSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + return forEachCompound(this, fn, includeSelf, addParent); +}; + +function addParentAndChildren(q, did, ele) { + addParent(q, did, ele); + addChildren(q, did, ele); +} + +elesfn.forEachUpAndDown = function (fn) { + var includeSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + return forEachCompound(this, fn, includeSelf, addParentAndChildren); +}; + +// aliases +elesfn.ancestors = elesfn.parents; + +module.exports = elesfn; + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var define = __webpack_require__(4); +var fn = void 0, + elesfn = void 0; + +fn = elesfn = { + + data: define.data({ + field: 'data', + bindingEvent: 'data', + allowBinding: true, + allowSetting: true, + settingEvent: 'data', + settingTriggersEvent: true, + triggerFnName: 'trigger', + allowGetting: true, + immutableKeys: { + 'id': true, + 'source': true, + 'target': true, + 'parent': true + }, + updateStyle: true + }), + + removeData: define.removeData({ + field: 'data', + event: 'data', + triggerFnName: 'trigger', + triggerEvent: true, + immutableKeys: { + 'id': true, + 'source': true, + 'target': true, + 'parent': true + }, + updateStyle: true + }), + + scratch: define.data({ + field: 'scratch', + bindingEvent: 'scratch', + allowBinding: true, + allowSetting: true, + settingEvent: 'scratch', + settingTriggersEvent: true, + triggerFnName: 'trigger', + allowGetting: true, + updateStyle: true + }), + + removeScratch: define.removeData({ + field: 'scratch', + event: 'scratch', + triggerFnName: 'trigger', + triggerEvent: true, + updateStyle: true + }), + + rscratch: define.data({ + field: 'rscratch', + allowBinding: false, + allowSetting: true, + settingTriggersEvent: false, + allowGetting: true + }), + + removeRscratch: define.removeData({ + field: 'rscratch', + triggerEvent: false + }), + + id: function id() { + var ele = this[0]; + + if (ele) { + return ele._private.data.id; + } + } + +}; + +// aliases +fn.attr = fn.data; +fn.removeAttr = fn.removeData; + +module.exports = elesfn; + +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); + +var elesfn = {}; + +function defineDegreeFunction(callback) { + return function (includeLoops) { + var self = this; + + if (includeLoops === undefined) { + includeLoops = true; + } + + if (self.length === 0) { + return; + } + + if (self.isNode() && !self.removed()) { + var degree = 0; + var node = self[0]; + var connectedEdges = node._private.edges; + + for (var i = 0; i < connectedEdges.length; i++) { + var edge = connectedEdges[i]; + + if (!includeLoops && edge.isLoop()) { + continue; + } + + degree += callback(node, edge); + } + + return degree; + } else { + return; + } + }; +} + +util.extend(elesfn, { + degree: defineDegreeFunction(function (node, edge) { + if (edge.source().same(edge.target())) { + return 2; + } else { + return 1; + } + }), + + indegree: defineDegreeFunction(function (node, edge) { + if (edge.target().same(node)) { + return 1; + } else { + return 0; + } + }), + + outdegree: defineDegreeFunction(function (node, edge) { + if (edge.source().same(node)) { + return 1; + } else { + return 0; + } + }) +}); + +function defineDegreeBoundsFunction(degreeFn, callback) { + return function (includeLoops) { + var ret = void 0; + var nodes = this.nodes(); + + for (var i = 0; i < nodes.length; i++) { + var ele = nodes[i]; + var degree = ele[degreeFn](includeLoops); + if (degree !== undefined && (ret === undefined || callback(degree, ret))) { + ret = degree; + } + } + + return ret; + }; +} + +util.extend(elesfn, { + minDegree: defineDegreeBoundsFunction('degree', function (degree, min) { + return degree < min; + }), + + maxDegree: defineDegreeBoundsFunction('degree', function (degree, max) { + return degree > max; + }), + + minIndegree: defineDegreeBoundsFunction('indegree', function (degree, min) { + return degree < min; + }), + + maxIndegree: defineDegreeBoundsFunction('indegree', function (degree, max) { + return degree > max; + }), + + minOutdegree: defineDegreeBoundsFunction('outdegree', function (degree, min) { + return degree < min; + }), + + maxOutdegree: defineDegreeBoundsFunction('outdegree', function (degree, max) { + return degree > max; + }) +}); + +util.extend(elesfn, { + totalDegree: function totalDegree(includeLoops) { + var total = 0; + var nodes = this.nodes(); + + for (var i = 0; i < nodes.length; i++) { + total += nodes[i].degree(includeLoops); + } + + return total; + } +}); + +module.exports = elesfn; + +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var position = __webpack_require__(58); +var bounds = __webpack_require__(59); +var widthHeight = __webpack_require__(60); +var edgePoints = __webpack_require__(61); + +module.exports = util.assign({}, position, bounds, widthHeight, edgePoints); + +/***/ }), +/* 58 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var define = __webpack_require__(4); +var is = __webpack_require__(0); +var math = __webpack_require__(2); +var fn = void 0, + elesfn = void 0; + +var beforePositionSet = function beforePositionSet(eles, newPos) { + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + + if (ele.isParent() && !ele.locked()) { + var oldPos = ele._private.position; + var delta = { + x: newPos.x - oldPos.x, + y: newPos.y - oldPos.y + }; + + eles.children().shift(delta); + } + } +}; + +fn = elesfn = { + + position: define.data({ + field: 'position', + bindingEvent: 'position', + allowBinding: true, + allowSetting: true, + settingEvent: 'position', + settingTriggersEvent: true, + triggerFnName: 'emitAndNotify', + allowGetting: true, + validKeys: ['x', 'y'], + beforeGet: function beforeGet(ele) { + ele.updateCompoundBounds(); + }, + beforeSet: beforePositionSet, + onSet: function onSet(eles) { + eles.dirtyCompoundBoundsCache(); + }, + canSet: function canSet(ele) { + return !ele.locked(); + } + }), + + // position but no notification to renderer + silentPosition: define.data({ + field: 'position', + bindingEvent: 'position', + allowBinding: false, + allowSetting: true, + settingEvent: 'position', + settingTriggersEvent: false, + triggerFnName: 'trigger', + allowGetting: false, + validKeys: ['x', 'y'], + beforeSet: beforePositionSet, + onSet: function onSet(eles) { + eles.dirtyCompoundBoundsCache(); + }, + canSet: function canSet(ele) { + return !ele.locked(); + } + }), + + positions: function positions(pos, silent) { + if (is.plainObject(pos)) { + if (silent) { + this.silentPosition(pos); + } else { + this.position(pos); + } + } else if (is.fn(pos)) { + var _fn = pos; + var cy = this.cy(); + + cy.startBatch(); + + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + var _pos = void 0; + + if (_pos = _fn(ele, i)) { + if (silent) { + ele.silentPosition(_pos); + } else { + ele.position(_pos); + } + } + } + + cy.endBatch(); + } + + return this; // chaining + }, + + silentPositions: function silentPositions(pos) { + return this.positions(pos, true); + }, + + shift: function shift(dim, val) { + var delta = void 0; + + if (is.plainObject(dim)) { + delta = dim; + } else if (is.string(dim) && is.number(val)) { + delta = { x: 0, y: 0 }; + + delta[dim] = val; + } + + if (delta != null) { + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + var pos = ele.position(); + + ele.position({ + x: pos.x + delta.x, + y: pos.y + delta.y + }); + } + } + + return this; + }, + + // get/set the rendered (i.e. on screen) positon of the element + renderedPosition: function renderedPosition(dim, val) { + var ele = this[0]; + var cy = this.cy(); + var zoom = cy.zoom(); + var pan = cy.pan(); + var rpos = is.plainObject(dim) ? dim : undefined; + var setting = rpos !== undefined || val !== undefined && is.string(dim); + + if (ele && ele.isNode()) { + // must have an element and must be a node to return position + if (setting) { + for (var i = 0; i < this.length; i++) { + var _ele = this[i]; + + if (val !== undefined) { + // set one dimension + _ele.position(dim, (val - pan[dim]) / zoom); + } else if (rpos !== undefined) { + // set whole position + _ele.position(math.renderedToModelPosition(rpos, zoom, pan)); + } + } + } else { + // getting + var pos = ele.position(); + rpos = math.modelToRenderedPosition(pos, zoom, pan); + + if (dim === undefined) { + // then return the whole rendered position + return rpos; + } else { + // then return the specified dimension + return rpos[dim]; + } + } + } else if (!setting) { + return undefined; // for empty collection case + } + + return this; // chaining + }, + + // get/set the position relative to the parent + relativePosition: function relativePosition(dim, val) { + var ele = this[0]; + var cy = this.cy(); + var ppos = is.plainObject(dim) ? dim : undefined; + var setting = ppos !== undefined || val !== undefined && is.string(dim); + var hasCompoundNodes = cy.hasCompoundNodes(); + + if (ele && ele.isNode()) { + // must have an element and must be a node to return position + if (setting) { + for (var i = 0; i < this.length; i++) { + var _ele2 = this[i]; + var parent = hasCompoundNodes ? _ele2.parent() : null; + var hasParent = parent && parent.length > 0; + var relativeToParent = hasParent; + + if (hasParent) { + parent = parent[0]; + } + + var origin = relativeToParent ? parent.position() : { x: 0, y: 0 }; + + if (val !== undefined) { + // set one dimension + _ele2.position(dim, val + origin[dim]); + } else if (ppos !== undefined) { + // set whole position + _ele2.position({ + x: ppos.x + origin.x, + y: ppos.y + origin.y + }); + } + } + } else { + // getting + var pos = ele.position(); + var _parent = hasCompoundNodes ? ele.parent() : null; + var _hasParent = _parent && _parent.length > 0; + var _relativeToParent = _hasParent; + + if (_hasParent) { + _parent = _parent[0]; + } + + var _origin = _relativeToParent ? _parent.position() : { x: 0, y: 0 }; + + ppos = { + x: pos.x - _origin.x, + y: pos.y - _origin.y + }; + + if (dim === undefined) { + // then return the whole rendered position + return ppos; + } else { + // then return the specified dimension + return ppos[dim]; + } + } + } else if (!setting) { + return undefined; // for empty collection case + } + + return this; // chaining + } +}; + +// aliases +fn.modelPosition = fn.point = fn.position; +fn.modelPositions = fn.points = fn.positions; +fn.renderedPoint = fn.renderedPosition; +fn.relativePoint = fn.relativePosition; + +module.exports = elesfn; + +/***/ }), +/* 59 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var util = __webpack_require__(1); +var math = __webpack_require__(2); +var fn = void 0, + elesfn = void 0; + +fn = elesfn = {}; + +elesfn.renderedBoundingBox = function (options) { + var bb = this.boundingBox(options); + var cy = this.cy(); + var zoom = cy.zoom(); + var pan = cy.pan(); + + var x1 = bb.x1 * zoom + pan.x; + var x2 = bb.x2 * zoom + pan.x; + var y1 = bb.y1 * zoom + pan.y; + var y2 = bb.y2 * zoom + pan.y; + + return { + x1: x1, + x2: x2, + y1: y1, + y2: y2, + w: x2 - x1, + h: y2 - y1 + }; +}; + +elesfn.dirtyCompoundBoundsCache = function () { + var cy = this.cy(); + + if (!cy.styleEnabled() || !cy.hasCompoundNodes()) { + return this; + } + + this.forEachUp(function (ele) { + ele._private.compoundBoundsClean = false; + + if (ele.isParent()) { + ele.emit('bounds'); + } + }); + + return this; +}; + +elesfn.updateCompoundBounds = function () { + var cy = this.cy(); + + // save cycles for non compound graphs or when style disabled + if (!cy.styleEnabled() || !cy.hasCompoundNodes()) { + return this; + } + + // save cycles when batching -- but bounds will be stale (or not exist yet) + if (cy.batching()) { + return this; + } + + var updated = []; + + function update(parent) { + if (!parent.isParent()) { + return; + } + + var _p = parent._private; + var children = parent.children(); + var includeLabels = parent.pstyle('compound-sizing-wrt-labels').value === 'include'; + + var min = { + width: { + val: parent.pstyle('min-width').pfValue, + left: parent.pstyle('min-width-bias-left'), + right: parent.pstyle('min-width-bias-right') + }, + height: { + val: parent.pstyle('min-height').pfValue, + top: parent.pstyle('min-height-bias-top'), + bottom: parent.pstyle('min-height-bias-bottom') + } + }; + + var bb = children.boundingBox({ + includeLabels: includeLabels, + includeOverlays: false, + + // updating the compound bounds happens outside of the regular + // cache cycle (i.e. before fired events) + useCache: false + }); + var pos = _p.position; + + // if children take up zero area then keep position and fall back on stylesheet w/h + if (bb.w === 0 || bb.h === 0) { + bb = { + w: parent.pstyle('width').pfValue, + h: parent.pstyle('height').pfValue + }; + + bb.x1 = pos.x - bb.w / 2; + bb.x2 = pos.x + bb.w / 2; + bb.y1 = pos.y - bb.h / 2; + bb.y2 = pos.y + bb.h / 2; + } + + function computeBiasValues(propDiff, propBias, propBiasComplement) { + var biasDiff = 0; + var biasComplementDiff = 0; + var biasTotal = propBias + propBiasComplement; + + if (propDiff > 0 && biasTotal > 0) { + biasDiff = propBias / biasTotal * propDiff; + biasComplementDiff = propBiasComplement / biasTotal * propDiff; + } + return { + biasDiff: biasDiff, + biasComplementDiff: biasComplementDiff + }; + } + + function computePaddingValues(width, height, paddingObject, relativeTo) { + // Assuming percentage is number from 0 to 1 + if (paddingObject.units === '%') { + switch (relativeTo) { + case 'width': + return width > 0 ? paddingObject.pfValue * width : 0; + case 'height': + return height > 0 ? paddingObject.pfValue * height : 0; + case 'average': + return width > 0 && height > 0 ? paddingObject.pfValue * (width + height) / 2 : 0; + case 'min': + return width > 0 && height > 0 ? width > height ? paddingObject.pfValue * height : paddingObject.pfValue * width : 0; + case 'max': + return width > 0 && height > 0 ? width > height ? paddingObject.pfValue * width : paddingObject.pfValue * height : 0; + default: + return 0; + } + } else if (paddingObject.units === 'px') { + return paddingObject.pfValue; + } else { + return 0; + } + } + + var leftVal = min.width.left.value; + if (min.width.left.units === 'px' && min.width.val > 0) { + leftVal = leftVal * 100 / min.width.val; + } + var rightVal = min.width.right.value; + if (min.width.right.units === 'px' && min.width.val > 0) { + rightVal = rightVal * 100 / min.width.val; + } + + var topVal = min.height.top.value; + if (min.height.top.units === 'px' && min.height.val > 0) { + topVal = topVal * 100 / min.height.val; + } + + var bottomVal = min.height.bottom.value; + if (min.height.bottom.units === 'px' && min.height.val > 0) { + bottomVal = bottomVal * 100 / min.height.val; + } + + var widthBiasDiffs = computeBiasValues(min.width.val - bb.w, leftVal, rightVal); + var diffLeft = widthBiasDiffs.biasDiff; + var diffRight = widthBiasDiffs.biasComplementDiff; + + var heightBiasDiffs = computeBiasValues(min.height.val - bb.h, topVal, bottomVal); + var diffTop = heightBiasDiffs.biasDiff; + var diffBottom = heightBiasDiffs.biasComplementDiff; + + _p.autoPadding = computePaddingValues(bb.w, bb.h, parent.pstyle('padding'), parent.pstyle('padding-relative-to').value); + + _p.autoWidth = Math.max(bb.w, min.width.val); + pos.x = (-diffLeft + bb.x1 + bb.x2 + diffRight) / 2; + + _p.autoHeight = Math.max(bb.h, min.height.val); + pos.y = (-diffTop + bb.y1 + bb.y2 + diffBottom) / 2; + + updated.push(parent); + } + + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + var _p = ele._private; + + if (!_p.compoundBoundsClean) { + update(ele); + + if (!cy._private.batchingStyle) { + _p.compoundBoundsClean = true; + } + } + } + + return this; +}; + +var noninf = function noninf(x) { + if (x === Infinity || x === -Infinity) { + return 0; + } + + return x; +}; + +var updateBounds = function updateBounds(b, x1, y1, x2, y2) { + // don't update with zero area boxes + if (x2 - x1 === 0 || y2 - y1 === 0) { + return; + } + + // don't update with null dim + if (x1 == null || y1 == null || x2 == null || y2 == null) { + return; + } + + b.x1 = x1 < b.x1 ? x1 : b.x1; + b.x2 = x2 > b.x2 ? x2 : b.x2; + b.y1 = y1 < b.y1 ? y1 : b.y1; + b.y2 = y2 > b.y2 ? y2 : b.y2; +}; + +var updateBoundsFromBox = function updateBoundsFromBox(b, b2) { + return updateBounds(b, b2.x1, b2.y1, b2.x2, b2.y2); +}; + +var prefixedProperty = function prefixedProperty(obj, field, prefix) { + return util.getPrefixedProperty(obj, field, prefix); +}; + +var updateBoundsFromArrow = function updateBoundsFromArrow(bounds, ele, prefix) { + if (ele.cy().headless()) { + return; + } + + var _p = ele._private; + var rstyle = _p.rstyle; + var halfArW = rstyle.arrowWidth / 2; + var arrowType = ele.pstyle(prefix + '-arrow-shape').value; + var x = void 0; + var y = void 0; + + if (arrowType !== 'none') { + if (prefix === 'source') { + x = rstyle.srcX; + y = rstyle.srcY; + } else if (prefix === 'target') { + x = rstyle.tgtX; + y = rstyle.tgtY; + } else { + x = rstyle.midX; + y = rstyle.midY; + } + + updateBounds(bounds, x - halfArW, y - halfArW, x + halfArW, y + halfArW); + } +}; + +var updateBoundsFromLabel = function updateBoundsFromLabel(bounds, ele, prefix) { + if (ele.cy().headless()) { + return; + } + + var prefixDash = void 0; + + if (prefix) { + prefixDash = prefix + '-'; + } else { + prefixDash = ''; + } + + var _p = ele._private; + var rstyle = _p.rstyle; + var label = ele.pstyle(prefixDash + 'label').strValue; + + if (label) { + var halign = ele.pstyle('text-halign'); + var valign = ele.pstyle('text-valign'); + var labelWidth = prefixedProperty(rstyle, 'labelWidth', prefix); + var labelHeight = prefixedProperty(rstyle, 'labelHeight', prefix); + var labelX = prefixedProperty(rstyle, 'labelX', prefix); + var labelY = prefixedProperty(rstyle, 'labelY', prefix); + var marginX = ele.pstyle(prefixDash + 'text-margin-x').pfValue; + var marginY = ele.pstyle(prefixDash + 'text-margin-y').pfValue; + var isEdge = ele.isEdge(); + var rotation = ele.pstyle(prefixDash + 'text-rotation'); + var outlineWidth = ele.pstyle('text-outline-width').pfValue; + var borderWidth = ele.pstyle('text-border-width').pfValue; + var halfBorderWidth = borderWidth / 2; + var padding = ele.pstyle('text-background-padding').pfValue; + + var lh = labelHeight + 2 * padding; + var lw = labelWidth + 2 * padding; + var lw_2 = lw / 2; + var lh_2 = lh / 2; + var lx1 = void 0, + lx2 = void 0, + ly1 = void 0, + ly2 = void 0; + + if (isEdge) { + lx1 = labelX - lw_2; + lx2 = labelX + lw_2; + ly1 = labelY - lh_2; + ly2 = labelY + lh_2; + } else { + switch (halign.value) { + case 'left': + lx1 = labelX - lw; + lx2 = labelX; + break; + + case 'center': + lx1 = labelX - lw_2; + lx2 = labelX + lw_2; + break; + + case 'right': + lx1 = labelX; + lx2 = labelX + lw; + break; + } + + switch (valign.value) { + case 'top': + ly1 = labelY - lh; + ly2 = labelY; + break; + + case 'center': + ly1 = labelY - lh_2; + ly2 = labelY + lh_2; + break; + + case 'bottom': + ly1 = labelY; + ly2 = labelY + lh; + break; + } + } + + var isAutorotate = isEdge && rotation.strValue === 'autorotate'; + var isPfValue = rotation.pfValue != null && rotation.pfValue !== 0; + + if (isAutorotate || isPfValue) { + var theta = isAutorotate ? prefixedProperty(_p.rstyle, 'labelAngle', prefix) : rotation.pfValue; + var cos = Math.cos(theta); + var sin = Math.sin(theta); + + var rotate = function rotate(x, y) { + x = x - labelX; + y = y - labelY; + + return { + x: x * cos - y * sin + labelX, + y: x * sin + y * cos + labelY + }; + }; + + var px1y1 = rotate(lx1, ly1); + var px1y2 = rotate(lx1, ly2); + var px2y1 = rotate(lx2, ly1); + var px2y2 = rotate(lx2, ly2); + + lx1 = Math.min(px1y1.x, px1y2.x, px2y1.x, px2y2.x); + lx2 = Math.max(px1y1.x, px1y2.x, px2y1.x, px2y2.x); + ly1 = Math.min(px1y1.y, px1y2.y, px2y1.y, px2y2.y); + ly2 = Math.max(px1y1.y, px1y2.y, px2y1.y, px2y2.y); + } + + lx1 += marginX - Math.max(outlineWidth, halfBorderWidth); + lx2 += marginX + Math.max(outlineWidth, halfBorderWidth); + ly1 += marginY - Math.max(outlineWidth, halfBorderWidth); + ly2 += marginY + Math.max(outlineWidth, halfBorderWidth); + + updateBounds(bounds, lx1, ly1, lx2, ly2); + } + + return bounds; +}; + +// get the bounding box of the elements (in raw model position) +var boundingBoxImpl = function boundingBoxImpl(ele, options) { + var cy = ele._private.cy; + var styleEnabled = cy.styleEnabled(); + var headless = cy.headless(); + + var bounds = { + x1: Infinity, + y1: Infinity, + x2: -Infinity, + y2: -Infinity + }; + + var _p = ele._private; + var display = styleEnabled ? ele.pstyle('display').value : 'element'; + var isNode = ele.isNode(); + var isEdge = ele.isEdge(); + var ex1 = void 0, + ex2 = void 0, + ey1 = void 0, + ey2 = void 0; // extrema of body / lines + var x = void 0, + y = void 0; // node pos + var displayed = display !== 'none'; + + if (displayed) { + var overlayOpacity = 0; + var overlayPadding = 0; + + if (styleEnabled && options.includeOverlays) { + overlayOpacity = ele.pstyle('overlay-opacity').value; + + if (overlayOpacity !== 0) { + overlayPadding = ele.pstyle('overlay-padding').value; + } + } + + var w = 0; + var wHalf = 0; + + if (styleEnabled) { + w = ele.pstyle('width').pfValue; + wHalf = w / 2; + } + + if (isNode && options.includeNodes) { + var pos = ele.position(); + x = pos.x; + y = pos.y; + var _w = ele.outerWidth(); + var halfW = _w / 2; + var h = ele.outerHeight(); + var halfH = h / 2; + + // handle node dimensions + ///////////////////////// + + ex1 = x - halfW - overlayPadding; + ex2 = x + halfW + overlayPadding; + ey1 = y - halfH - overlayPadding; + ey2 = y + halfH + overlayPadding; + + updateBounds(bounds, ex1, ey1, ex2, ey2); + } else if (isEdge && options.includeEdges) { + var rstyle = _p.rstyle || {}; + + // handle edge dimensions (rough box estimate) + ////////////////////////////////////////////// + if (styleEnabled && !headless) { + ex1 = Math.min(rstyle.srcX, rstyle.midX, rstyle.tgtX); + ex2 = Math.max(rstyle.srcX, rstyle.midX, rstyle.tgtX); + ey1 = Math.min(rstyle.srcY, rstyle.midY, rstyle.tgtY); + ey2 = Math.max(rstyle.srcY, rstyle.midY, rstyle.tgtY); + + // take into account edge width + ex1 -= wHalf; + ex2 += wHalf; + ey1 -= wHalf; + ey2 += wHalf; + + updateBounds(bounds, ex1, ey1, ex2, ey2); + } + + // precise haystacks + //////////////////// + if (styleEnabled && !headless && ele.pstyle('curve-style').strValue === 'haystack') { + var hpts = rstyle.haystackPts || []; + + ex1 = hpts[0].x; + ey1 = hpts[0].y; + ex2 = hpts[1].x; + ey2 = hpts[1].y; + + if (ex1 > ex2) { + var temp = ex1; + ex1 = ex2; + ex2 = temp; + } + + if (ey1 > ey2) { + var _temp = ey1; + ey1 = ey2; + ey2 = _temp; + } + + updateBounds(bounds, ex1 - wHalf, ey1 - wHalf, ex2 + wHalf, ey2 + wHalf); + + // handle points along edge + /////////////////////////// + } else { + var pts = rstyle.bezierPts || rstyle.linePts || []; + + for (var j = 0; j < pts.length; j++) { + var pt = pts[j]; + + ex1 = pt.x - wHalf; + ex2 = pt.x + wHalf; + ey1 = pt.y - wHalf; + ey2 = pt.y + wHalf; + + updateBounds(bounds, ex1, ey1, ex2, ey2); + } + + // fallback on source and target positions + ////////////////////////////////////////// + if (pts.length === 0) { + var n1 = ele.source(); + var n1pos = n1.position(); + + var n2 = ele.target(); + var n2pos = n2.position(); + + ex1 = n1pos.x; + ex2 = n2pos.x; + ey1 = n1pos.y; + ey2 = n2pos.y; + + if (ex1 > ex2) { + var _temp2 = ex1; + ex1 = ex2; + ex2 = _temp2; + } + + if (ey1 > ey2) { + var _temp3 = ey1; + ey1 = ey2; + ey2 = _temp3; + } + + // take into account edge width + ex1 -= wHalf; + ex2 += wHalf; + ey1 -= wHalf; + ey2 += wHalf; + + updateBounds(bounds, ex1, ey1, ex2, ey2); + } + } + } // edges + + + // handle edge arrow size + ///////////////////////// + + if (styleEnabled && options.includeEdges && isEdge) { + updateBoundsFromArrow(bounds, ele, 'mid-source', options); + updateBoundsFromArrow(bounds, ele, 'mid-target', options); + updateBoundsFromArrow(bounds, ele, 'source', options); + updateBoundsFromArrow(bounds, ele, 'target', options); + } + + // ghost + //////// + + if (styleEnabled) { + var ghost = ele.pstyle('ghost').value === 'yes'; + + if (ghost) { + var gx = ele.pstyle('ghost-offset-x').pfValue; + var gy = ele.pstyle('ghost-offset-y').pfValue; + + updateBounds(bounds, bounds.x1 + gx, bounds.y1 + gy, bounds.x2 + gx, bounds.y2 + gy); + } + } + + // overlay + ////////// + + if (styleEnabled) { + + ex1 = bounds.x1; + ex2 = bounds.x2; + ey1 = bounds.y1; + ey2 = bounds.y2; + + updateBounds(bounds, ex1 - overlayPadding, ey1 - overlayPadding, ex2 + overlayPadding, ey2 + overlayPadding); + } + + // handle label dimensions + ////////////////////////// + + if (styleEnabled && options.includeLabels) { + updateBoundsFromLabel(bounds, ele, null, options); + + if (isEdge) { + updateBoundsFromLabel(bounds, ele, 'source', options); + updateBoundsFromLabel(bounds, ele, 'target', options); + } + } // style enabled for labels + } // if displayed + + bounds.x1 = noninf(bounds.x1); + bounds.y1 = noninf(bounds.y1); + bounds.x2 = noninf(bounds.x2); + bounds.y2 = noninf(bounds.y2); + bounds.w = noninf(bounds.x2 - bounds.x1); + bounds.h = noninf(bounds.y2 - bounds.y1); + + // expand bounds by 1 because antialiasing can increase the visual/effective size by 1 on all sides + if (bounds.w > 0 && bounds.h > 0 && displayed) { + math.expandBoundingBox(bounds, 1); + } + + return bounds; +}; + +var tf = function tf(val) { + if (val) { + return 't'; + } else { + return 'f'; + } +}; + +var getKey = function getKey(opts) { + var key = ''; + + key += tf(opts.incudeNodes); + key += tf(opts.includeEdges); + key += tf(opts.includeLabels); + key += tf(opts.includeOverlays); + + return key; +}; + +var cachedBoundingBoxImpl = function cachedBoundingBoxImpl(ele, opts) { + var _p = ele._private; + var bb = void 0; + var headless = ele.cy().headless(); + var key = opts === defBbOpts ? defBbOptsKey : getKey(opts); + + if (!opts.useCache || headless || !_p.bbCache || !_p.bbCache[key]) { + bb = boundingBoxImpl(ele, opts); + + if (!headless) { + _p.bbCache = _p.bbCache || {}; + _p.bbCache[key] = bb; + } + } else { + bb = _p.bbCache[key]; + } + + return bb; +}; + +var defBbOpts = { + includeNodes: true, + includeEdges: true, + includeLabels: true, + includeOverlays: true, + useCache: true +}; + +var defBbOptsKey = getKey(defBbOpts); + +function filledBbOpts(options) { + return { + includeNodes: util.default(options.includeNodes, defBbOpts.includeNodes), + includeEdges: util.default(options.includeEdges, defBbOpts.includeEdges), + includeLabels: util.default(options.includeLabels, defBbOpts.includeLabels), + includeOverlays: util.default(options.includeOverlays, defBbOpts.includeOverlays), + useCache: util.default(options.useCache, defBbOpts.useCache) + }; +} + +elesfn.boundingBox = function (options) { + // the main usecase is ele.boundingBox() for a single element with no/def options + // specified s.t. the cache is used, so check for this case to make it faster by + // avoiding the overhead of the rest of the function + if (this.length === 1 && this[0]._private.bbCache && (options === undefined || options.useCache === undefined || options.useCache === true)) { + if (options === undefined) { + options = defBbOpts; + } else { + options = filledBbOpts(options); + } + + return cachedBoundingBoxImpl(this[0], options); + } + + var bounds = { + x1: Infinity, + y1: Infinity, + x2: -Infinity, + y2: -Infinity + }; + + options = options || util.staticEmptyObject(); + + var opts = filledBbOpts(options); + + var eles = this; + var cy = eles.cy(); + var styleEnabled = cy.styleEnabled(); + + if (styleEnabled) { + this.recalculateRenderedStyle(opts.useCache); + } + + this.updateCompoundBounds(); + + var updatedEdge = {}; // use to avoid duplicated edge updates + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + + if (styleEnabled && ele.isEdge() && ele.pstyle('curve-style').strValue === 'bezier' && !updatedEdge[ele.id()]) { + var edges = ele.parallelEdges(); + + for (var j = 0; j < edges.length; j++) { + // make all as updated + updatedEdge[edges[j].id()] = true; + } + + edges.recalculateRenderedStyle(opts.useCache); // n.b. ele.parallelEdges() single is cached + } + + updateBoundsFromBox(bounds, cachedBoundingBoxImpl(ele, opts)); + } + + bounds.x1 = noninf(bounds.x1); + bounds.y1 = noninf(bounds.y1); + bounds.x2 = noninf(bounds.x2); + bounds.y2 = noninf(bounds.y2); + bounds.w = noninf(bounds.x2 - bounds.x1); + bounds.h = noninf(bounds.y2 - bounds.y1); + + return bounds; +}; + +// private helper to get bounding box for custom node positions +// - good for perf in certain cases but currently requires dirtying the rendered style +// - would be better to not modify the nodes but the nodes are read directly everywhere in the renderer... +// - try to use for only things like discrete layouts where the node position would change anyway +elesfn.boundingBoxAt = function (fn) { + var nodes = this.nodes(); + + if (is.plainObject(fn)) { + var obj = fn; + + fn = function fn() { + return obj; + }; + } + + // save the current position and set the new one, per node + for (var i = 0; i < nodes.length; i++) { + var n = nodes[i]; + var _p = n._private; + var pos = _p.position; + var newPos = fn.call(n, n, i); + + _p.bbAtOldPos = { x: pos.x, y: pos.y }; + + if (newPos) { + pos.x = newPos.x; + pos.y = newPos.y; + } + } + + this.emit('dirty'); // let the renderer know we've manually dirtied rendered dim calcs + + nodes.dirtyCompoundBoundsCache().updateCompoundBounds(); + + var bb = this.boundingBox({ useCache: false }); + + // restore the original position, per node + for (var _i = 0; _i < nodes.length; _i++) { + var _n = nodes[_i]; + var _p2 = _n._private; + var _pos = _n._private.position; + var old = _p2.bbAtOldPos; + + _pos.x = old.x; + _pos.y = old.y; + } + + nodes.dirtyCompoundBoundsCache(); + + this.emit('dirty'); // let the renderer know we've manually dirtied rendered dim calcs + + return bb; +}; + +fn.boundingbox = fn.boundingBox; +fn.renderedBoundingbox = fn.renderedBoundingBox; + +module.exports = elesfn; + +/***/ }), +/* 60 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var fn = void 0, + elesfn = void 0; + +fn = elesfn = {}; + +var defineDimFns = function defineDimFns(opts) { + opts.uppercaseName = util.capitalize(opts.name); + opts.autoName = 'auto' + opts.uppercaseName; + opts.labelName = 'label' + opts.uppercaseName; + opts.outerName = 'outer' + opts.uppercaseName; + opts.uppercaseOuterName = util.capitalize(opts.outerName); + + fn[opts.name] = function dimImpl() { + var ele = this[0]; + var _p = ele._private; + var cy = _p.cy; + var styleEnabled = cy._private.styleEnabled; + + if (ele) { + if (styleEnabled) { + if (ele.isParent()) { + ele.updateCompoundBounds(); + + return _p[opts.autoName] || 0; + } + + var d = ele.pstyle(opts.name); + + switch (d.strValue) { + case 'label': + ele.recalculateRenderedStyle(); + + return _p.rstyle[opts.labelName] || 0; + + default: + return d.pfValue; + } + } else { + return 1; + } + } + }; + + fn['outer' + opts.uppercaseName] = function outerDimImpl() { + var ele = this[0]; + var _p = ele._private; + var cy = _p.cy; + var styleEnabled = cy._private.styleEnabled; + + if (ele) { + if (styleEnabled) { + var dim = ele[opts.name](); + var border = ele.pstyle('border-width').pfValue; // n.b. 1/2 each side + var padding = 2 * ele.padding(); + + return dim + border + padding; + } else { + return 1; + } + } + }; + + fn['rendered' + opts.uppercaseName] = function renderedDimImpl() { + var ele = this[0]; + + if (ele) { + var d = ele[opts.name](); + return d * this.cy().zoom(); + } + }; + + fn['rendered' + opts.uppercaseOuterName] = function renderedOuterDimImpl() { + var ele = this[0]; + + if (ele) { + var od = ele[opts.outerName](); + return od * this.cy().zoom(); + } + }; +}; + +defineDimFns({ + name: 'width' +}); + +defineDimFns({ + name: 'height' +}); + +elesfn.padding = function () { + var ele = this[0]; + var _p = ele._private; + if (ele.isParent()) { + ele.updateCompoundBounds(); + + if (_p.autoPadding !== undefined) { + return _p.autoPadding; + } else { + return ele.pstyle('padding').pfValue; + } + } else { + return ele.pstyle('padding').pfValue; + } +}; + +module.exports = elesfn; + +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var ifEdge = function ifEdge(self, then) { + if (self.isEdge()) { + return then(self.renderer()); + } +}; + +module.exports = { + controlPoints: function controlPoints() { + var _this = this; + + return ifEdge(this, function (renderer) { + return renderer.getControlPoints(_this); + }); + }, + segmentPoints: function segmentPoints() { + var _this2 = this; + + return ifEdge(this, function (renderer) { + return renderer.getSegmentPoints(_this2); + }); + }, + sourceEndpoint: function sourceEndpoint() { + var _this3 = this; + + return ifEdge(this, function (renderer) { + return renderer.getSourceEndpoint(_this3); + }); + }, + targetEndpoint: function targetEndpoint() { + var _this4 = this; + + return ifEdge(this, function (renderer) { + return renderer.getTargetEndpoint(_this4); + }); + }, + midpoint: function midpoint() { + var _this5 = this; + + return ifEdge(this, function (renderer) { + return renderer.getEdgeMidpoint(_this5); + }); + } +}; + +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Emitter = __webpack_require__(11); +var define = __webpack_require__(4); +var is = __webpack_require__(0); +var util = __webpack_require__(1); +var Selector = __webpack_require__(6); + +var emitterOptions = { + qualifierCompare: function qualifierCompare(selector1, selector2) { + if (selector1 == null || selector2 == null) { + return selector1 == null && selector2 == null; + } else { + return selector1.sameText(selector2); + } + }, + eventMatches: function eventMatches(ele, listener, eventObj) { + var selector = listener.qualifier; + + if (selector != null) { + return ele !== eventObj.target && is.element(eventObj.target) && selector.matches(eventObj.target); + } + + return true; + }, + eventFields: function eventFields(ele) { + return { + cy: ele.cy(), + target: ele + }; + }, + callbackContext: function callbackContext(ele, listener, eventObj) { + return listener.qualifier != null ? eventObj.target : ele; + }, + beforeEmit: function beforeEmit(context, listener /*, eventObj*/) { + if (listener.conf && listener.conf.once) { + listener.conf.onceCollection.removeListener(listener.event, listener.qualifier, listener.callback); + } + }, + bubble: function bubble() { + return true; + }, + parent: function parent(ele) { + return ele.isChild() ? ele.parent() : ele.cy(); + } +}; + +var argSelector = function argSelector(arg) { + if (is.string(arg)) { + return new Selector(arg); + } else { + return arg; + } +}; + +var elesfn = { + createEmitter: function createEmitter() { + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + var _p = ele._private; + + if (!_p.emitter) { + _p.emitter = new Emitter(util.assign({ + context: ele + }, emitterOptions)); + } + } + + return this; + }, + + emitter: function emitter() { + return this._private.emitter; + }, + + on: function on(events, selector, callback) { + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + + ele.emitter().on(events, argSelector(selector), callback); + } + + return this; + }, + + removeListener: function removeListener(events, selector, callback) { + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + + ele.emitter().removeListener(events, argSelector(selector), callback); + } + + return this; + }, + + one: function one(events, selector, callback) { + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + + ele.emitter().one(events, argSelector(selector), callback); + } + + return this; + }, + + once: function once(events, selector, callback) { + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + + ele.emitter().on(events, argSelector(selector), callback, { + once: true, + onceCollection: this + }); + } + }, + + emit: function emit(events, extraParams) { + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + + ele.emitter().emit(events, extraParams); + } + + return this; + }, + + emitAndNotify: function emitAndNotify(event, extraParams) { + // for internal use only + if (this.length === 0) { + return; + } // empty collections don't need to notify anything + + // notify renderer + this.cy().notify({ + type: event, + eles: this + }); + + this.emit(event, extraParams); + + return this; + } +}; + +define.eventAliasesOn(elesfn); + +module.exports = elesfn; + +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var Selector = __webpack_require__(6); + +var elesfn = { + nodes: function nodes(selector) { + return this.filter(function (ele) { + return ele.isNode(); + }).filter(selector); + }, + + edges: function edges(selector) { + return this.filter(function (ele) { + return ele.isEdge(); + }).filter(selector); + }, + + filter: function filter(_filter, thisArg) { + if (_filter === undefined) { + // check this first b/c it's the most common/performant case + return this; + } else if (is.string(_filter) || is.elementOrCollection(_filter)) { + return new Selector(_filter).filter(this); + } else if (is.fn(_filter)) { + var filterEles = this.spawn(); + var eles = this; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + var include = thisArg ? _filter.apply(thisArg, [ele, i, eles]) : _filter(ele, i, eles); + + if (include) { + filterEles.merge(ele); + } + } + + return filterEles; + } + + return this.spawn(); // if not handled by above, give 'em an empty collection + }, + + not: function not(toRemove) { + if (!toRemove) { + return this; + } else { + + if (is.string(toRemove)) { + toRemove = this.filter(toRemove); + } + + var elements = []; + var rMap = toRemove._private.map; + + for (var i = 0; i < this.length; i++) { + var element = this[i]; + + var remove = rMap.has(element.id()); + if (!remove) { + elements.push(element); + } + } + + return this.spawn(elements); + } + }, + + absoluteComplement: function absoluteComplement() { + var cy = this.cy(); + + return cy.mutableElements().not(this); + }, + + intersect: function intersect(other) { + // if a selector is specified, then filter by it instead + if (is.string(other)) { + var selector = other; + return this.filter(selector); + } + + var elements = []; + var col1 = this; + var col2 = other; + var col1Smaller = this.length < other.length; + var map2 = col1Smaller ? col2._private.map : col1._private.map; + var col = col1Smaller ? col1 : col2; + + for (var i = 0; i < col.length; i++) { + var id = col[i]._private.data.id; + var entry = map2.get(id); + + if (entry) { + elements.push(entry.ele); + } + } + + return this.spawn(elements); + }, + + xor: function xor(other) { + var cy = this._private.cy; + + if (is.string(other)) { + other = cy.$(other); + } + + var elements = []; + var col1 = this; + var col2 = other; + + var add = function add(col, other) { + for (var i = 0; i < col.length; i++) { + var ele = col[i]; + var id = ele._private.data.id; + var inOther = other.hasElementWithId(id); + + if (!inOther) { + elements.push(ele); + } + } + }; + + add(col1, col2); + add(col2, col1); + + return this.spawn(elements); + }, + + diff: function diff(other) { + var cy = this._private.cy; + + if (is.string(other)) { + other = cy.$(other); + } + + var left = []; + var right = []; + var both = []; + var col1 = this; + var col2 = other; + + var add = function add(col, other, retEles) { + + for (var i = 0; i < col.length; i++) { + var ele = col[i]; + var id = ele._private.data.id; + var inOther = other.hasElementWithId(id); + + if (inOther) { + both.push(ele); + } else { + retEles.push(ele); + } + } + }; + + add(col1, col2, left); + add(col2, col1, right); + + return { + left: this.spawn(left, { unique: true }), + right: this.spawn(right, { unique: true }), + both: this.spawn(both, { unique: true }) + }; + }, + + add: function add(toAdd) { + var cy = this._private.cy; + + if (!toAdd) { + return this; + } + + if (is.string(toAdd)) { + var selector = toAdd; + toAdd = cy.mutableElements().filter(selector); + } + + var elements = []; + + for (var i = 0; i < this.length; i++) { + elements.push(this[i]); + } + + var map = this._private.map; + + for (var _i = 0; _i < toAdd.length; _i++) { + + var add = !map.has(toAdd[_i].id()); + if (add) { + elements.push(toAdd[_i]); + } + } + + return this.spawn(elements); + }, + + // in place merge on calling collection + merge: function merge(toAdd) { + var _p = this._private; + var cy = _p.cy; + + if (!toAdd) { + return this; + } + + if (toAdd && is.string(toAdd)) { + var selector = toAdd; + toAdd = cy.mutableElements().filter(selector); + } + + var map = _p.map; + + for (var i = 0; i < toAdd.length; i++) { + var toAddEle = toAdd[i]; + var id = toAddEle._private.data.id; + var add = !map.has(id); + + if (add) { + var index = this.length++; + + this[index] = toAddEle; + + map.set(id, { ele: toAddEle, index: index }); + } else { + // replace + var _index = map.get(id).index; + + this[_index] = toAddEle; + map.set(id, { ele: toAddEle, index: _index }); + } + } + + return this; // chaining + }, + + // remove single ele in place in calling collection + unmergeOne: function unmergeOne(ele) { + ele = ele[0]; + + var _p = this._private; + var id = ele._private.data.id; + var map = _p.map; + var entry = map.get(id); + + if (!entry) { + return this; // no need to remove + } + + var i = entry.index; + + // remove ele + this[i] = undefined; + map.delete(id); + + var unmergedLastEle = i === this.length - 1; + + // replace empty spot with last ele in collection + if (this.length > 1 && !unmergedLastEle) { + var lastEleI = this.length - 1; + var lastEle = this[lastEleI]; + var lastEleId = lastEle._private.data.id; + + this[lastEleI] = undefined; + this[i] = lastEle; + map.set(lastEleId, { ele: lastEle, index: i }); + } + + // the collection is now 1 ele smaller + this.length--; + + return this; + }, + + // remove eles in place on calling collection + unmerge: function unmerge(toRemove) { + var cy = this._private.cy; + + if (!toRemove) { + return this; + } + + if (toRemove && is.string(toRemove)) { + var selector = toRemove; + toRemove = cy.mutableElements().filter(selector); + } + + for (var i = 0; i < toRemove.length; i++) { + this.unmergeOne(toRemove[i]); + } + + return this; // chaining + }, + + map: function map(mapFn, thisArg) { + var arr = []; + var eles = this; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + var ret = thisArg ? mapFn.apply(thisArg, [ele, i, eles]) : mapFn(ele, i, eles); + + arr.push(ret); + } + + return arr; + }, + + reduce: function reduce(fn, initialValue) { + var val = initialValue; + var eles = this; + + for (var i = 0; i < eles.length; i++) { + val = fn(val, eles[i], i, eles); + } + + return val; + }, + + max: function max(valFn, thisArg) { + var max = -Infinity; + var maxEle = void 0; + var eles = this; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + var val = thisArg ? valFn.apply(thisArg, [ele, i, eles]) : valFn(ele, i, eles); + + if (val > max) { + max = val; + maxEle = ele; + } + } + + return { + value: max, + ele: maxEle + }; + }, + + min: function min(valFn, thisArg) { + var min = Infinity; + var minEle = void 0; + var eles = this; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + var val = thisArg ? valFn.apply(thisArg, [ele, i, eles]) : valFn(ele, i, eles); + + if (val < min) { + min = val; + minEle = ele; + } + } + + return { + value: min, + ele: minEle + }; + } +}; + +// aliases +var fn = elesfn; +fn['u'] = fn['|'] = fn['+'] = fn.union = fn.or = fn.add; +fn['\\'] = fn['!'] = fn['-'] = fn.difference = fn.relativeComplement = fn.subtract = fn.not; +fn['n'] = fn['&'] = fn['.'] = fn.and = fn.intersection = fn.intersect; +fn['^'] = fn['(+)'] = fn['(-)'] = fn.symmetricDifference = fn.symdiff = fn.xor; +fn.fnFilter = fn.filterFn = fn.stdFilter = fn.filter; +fn.complement = fn.abscomp = fn.absoluteComplement; + +module.exports = elesfn; + +/***/ }), +/* 64 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var elesfn = { + isNode: function isNode() { + return this.group() === 'nodes'; + }, + + isEdge: function isEdge() { + return this.group() === 'edges'; + }, + + isLoop: function isLoop() { + return this.isEdge() && this.source().id() === this.target().id(); + }, + + isSimple: function isSimple() { + return this.isEdge() && this.source().id() !== this.target().id(); + }, + + group: function group() { + var ele = this[0]; + + if (ele) { + return ele._private.group; + } + } +}; + +module.exports = elesfn; + +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var zIndexSort = __webpack_require__(17); +var util = __webpack_require__(1); + +var elesfn = { + forEach: function forEach(fn, thisArg) { + if (is.fn(fn)) { + + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + var ret = thisArg ? fn.apply(thisArg, [ele, i, this]) : fn(ele, i, this); + + if (ret === false) { + break; + } // exit each early on return false + } + } + + return this; + }, + + toArray: function toArray() { + var array = []; + + for (var i = 0; i < this.length; i++) { + array.push(this[i]); + } + + return array; + }, + + slice: function slice(start, end) { + var array = []; + var thisSize = this.length; + + if (end == null) { + end = thisSize; + } + + if (start == null) { + start = 0; + } + + if (start < 0) { + start = thisSize + start; + } + + if (end < 0) { + end = thisSize + end; + } + + for (var i = start; i >= 0 && i < end && i < thisSize; i++) { + array.push(this[i]); + } + + return this.spawn(array); + }, + + size: function size() { + return this.length; + }, + + eq: function eq(i) { + return this[i] || this.spawn(); + }, + + first: function first() { + return this[0] || this.spawn(); + }, + + last: function last() { + return this[this.length - 1] || this.spawn(); + }, + + empty: function empty() { + return this.length === 0; + }, + + nonempty: function nonempty() { + return !this.empty(); + }, + + sort: function sort(sortFn) { + if (!is.fn(sortFn)) { + return this; + } + + var sorted = this.toArray().sort(sortFn); + + return this.spawn(sorted); + }, + + sortByZIndex: function sortByZIndex() { + return this.sort(zIndexSort); + }, + + zDepth: function zDepth() { + var ele = this[0]; + if (!ele) { + return undefined; + } + + // let cy = ele.cy(); + var _p = ele._private; + var group = _p.group; + + if (group === 'nodes') { + var depth = _p.data.parent ? ele.parents().size() : 0; + + if (!ele.isParent()) { + return util.MAX_INT - 1; // childless nodes always on top + } + + return depth; + } else { + var src = _p.source; + var tgt = _p.target; + var srcDepth = src.zDepth(); + var tgtDepth = tgt.zDepth(); + + return Math.max(srcDepth, tgtDepth, 0); // depth of deepest parent + } + } +}; + +elesfn.each = elesfn.forEach; + +module.exports = elesfn; + +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var util = __webpack_require__(1); +var Promise = __webpack_require__(5); +var math = __webpack_require__(2); + +var elesfn = { + // Calculates and returns node dimensions { x, y } based on options given + layoutDimensions: function layoutDimensions(options) { + options = util.assign({ + nodeDimensionsIncludeLabels: true + }, options); + + if (options.nodeDimensionsIncludeLabels) { + var bbDim = this.boundingBox(); + return { + w: bbDim.w, + h: bbDim.h + }; + } else { + return { + w: this.outerWidth(), + h: this.outerHeight() + }; + } + }, + + // using standard layout options, apply position function (w/ or w/o animation) + layoutPositions: function layoutPositions(layout, options, fn) { + var nodes = this.nodes(); + var cy = this.cy(); + var layoutEles = options.eles; // nodes & edges + var getMemoizeKey = function getMemoizeKey(node, i) { + return node.id() + '$' + i; + }; + var fnMem = util.memoize(fn, getMemoizeKey); // memoized version of position function + + layout.emit({ type: 'layoutstart', layout: layout }); + + layout.animations = []; + + var calculateSpacing = function calculateSpacing(spacing, nodesBb, pos) { + var center = { + x: nodesBb.x1 + nodesBb.w / 2, + y: nodesBb.y1 + nodesBb.h / 2 + }; + + var spacingVector = { // scale from center of bounding box (not necessarily 0,0) + x: (pos.x - center.x) * spacing, + y: (pos.y - center.y) * spacing + }; + + return { + x: center.x + spacingVector.x, + y: center.y + spacingVector.y + }; + }; + + var useSpacingFactor = options.spacingFactor && options.spacingFactor !== 1; + + var spacingBb = function spacingBb() { + if (!useSpacingFactor) { + return null; + } + + var bb = math.makeBoundingBox(); + + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + var pos = fnMem(node, i); + + math.expandBoundingBoxByPoint(bb, pos.x, pos.y); + } + + return bb; + }; + + var bb = spacingBb(); + + var getFinalPos = util.memoize(function (node, i) { + var newPos = fnMem(node, i); + var pos = node.position(); + + if (!is.number(pos.x) || !is.number(pos.y)) { + node.silentPosition({ x: 0, y: 0 }); + } + + if (useSpacingFactor) { + var spacing = Math.abs(options.spacingFactor); + + newPos = calculateSpacing(spacing, bb, newPos); + } + + if (options.transform != null) { + newPos = options.transform(node, newPos); + } + + return newPos; + }, getMemoizeKey); + + if (options.animate) { + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + var newPos = getFinalPos(node, i); + var animateNode = options.animateFilter == null || options.animateFilter(node, i); + + if (animateNode) { + var ani = node.animation({ + position: newPos, + duration: options.animationDuration, + easing: options.animationEasing + }); + + layout.animations.push(ani); + + ani.play(); + } else { + node.position(newPos); + } + } + + if (options.fit) { + var fitAni = cy.animation({ + fit: { + boundingBox: layoutEles.boundingBoxAt(getFinalPos), + padding: options.padding + }, + duration: options.animationDuration, + easing: options.animationEasing + }); + + layout.animations.push(fitAni); + + fitAni.play(); + } else if (options.zoom !== undefined && options.pan !== undefined) { + var zoomPanAni = cy.animation({ + zoom: options.zoom, + pan: options.pan, + duration: options.animationDuration, + easing: options.animationEasing + }); + + layout.animations.push(zoomPanAni); + + zoomPanAni.play(); + } + + layout.one('layoutready', options.ready); + layout.emit({ type: 'layoutready', layout: layout }); + + Promise.all(layout.animations.map(function (ani) { + return ani.promise(); + })).then(function () { + layout.one('layoutstop', options.stop); + layout.emit({ type: 'layoutstop', layout: layout }); + }); + } else { + + nodes.positions(getFinalPos); + + if (options.fit) { + cy.fit(options.eles, options.padding); + } + + if (options.zoom != null) { + cy.zoom(options.zoom); + } + + if (options.pan) { + cy.pan(options.pan); + } + + layout.one('layoutready', options.ready); + layout.emit({ type: 'layoutready', layout: layout }); + + layout.one('layoutstop', options.stop); + layout.emit({ type: 'layoutstop', layout: layout }); + } + + return this; // chaining + }, + + layout: function layout(options) { + var cy = this.cy(); + + return cy.makeLayout(util.extend({}, options, { + eles: this + })); + } + +}; + +// aliases: +elesfn.createLayout = elesfn.makeLayout = elesfn.layout; + +module.exports = elesfn; + +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); + +function styleCache(key, fn, ele) { + var _p = ele._private; + var cache = _p.styleCache = _p.styleCache || {}; + var val; + + if ((val = cache[key]) != null) { + return val; + } else { + val = cache[key] = fn(ele); + + return val; + } +} + +function cacheStyleFunction(key, fn) { + return function cachedStyleFunction(ele) { + return styleCache(key, fn, ele); + }; +} + +function cachePrototypeStyleFunction(key, fn) { + var selfFn = function selfFn(ele) { + return fn.call(ele); + }; + + return function cachedPrototypeStyleFunction() { + var ele = this[0]; + + if (ele) { + return styleCache(key, selfFn, ele); + } + }; +} + +var elesfn = { + + recalculateRenderedStyle: function recalculateRenderedStyle(useCache) { + var cy = this.cy(); + var renderer = cy.renderer(); + var styleEnabled = cy.styleEnabled(); + + if (renderer && styleEnabled) { + renderer.recalculateRenderedStyle(this, useCache); + } + + return this; + }, + + dirtyStyleCache: function dirtyStyleCache() { + var cy = this.cy(); + var dirty = function dirty(ele) { + return ele._private.styleCache = {}; + }; + + if (cy.hasCompoundNodes()) { + var eles = void 0; + + eles = this.spawnSelf().merge(this.descendants()).merge(this.parents()); + + eles.merge(eles.connectedEdges()); + + eles.forEach(dirty); + } else { + this.forEach(function (ele) { + dirty(ele); + + ele.connectedEdges().forEach(dirty); + }); + } + + return this; + }, + + // fully updates (recalculates) the style for the elements + updateStyle: function updateStyle(notifyRenderer) { + var cy = this._private.cy; + + if (!cy.styleEnabled()) { + return this; + } + + if (cy._private.batchingStyle) { + var bEles = cy._private.batchStyleEles; + + bEles.merge(this); + + return this; // chaining and exit early when batching + } + + var hasCompounds = cy.hasCompoundNodes(); + var style = cy.style(); + var updatedEles = this; + + notifyRenderer = notifyRenderer || notifyRenderer === undefined ? true : false; + + if (hasCompounds) { + // then add everything up and down for compound selector checks + updatedEles = this.spawnSelf().merge(this.descendants()).merge(this.parents()); + } + + var changedEles = style.apply(updatedEles); + + changedEles.dirtyStyleCache(); + changedEles.dirtyCompoundBoundsCache(); + + if (notifyRenderer) { + changedEles.emitAndNotify('style'); // let renderer know we changed style + } else { + changedEles.emit('style'); // just fire the event + } + + return this; // chaining + }, + + // just update the mappers in the elements' styles; cheaper than eles.updateStyle() + updateMappers: function updateMappers(notifyRenderer) { + var cy = this._private.cy; + var style = cy.style(); + notifyRenderer = notifyRenderer || notifyRenderer === undefined ? true : false; + + if (!cy.styleEnabled()) { + return this; + } + + var changedEles = style.updateMappers(this); + + changedEles.dirtyStyleCache(); + changedEles.dirtyCompoundBoundsCache(); + + if (notifyRenderer) { + changedEles.emitAndNotify('style'); // let renderer know we changed style + } else { + changedEles.emit('style'); // just fire the event + } + return this; // chaining + }, + + // get the internal parsed style object for the specified property + parsedStyle: function parsedStyle(property) { + var ele = this[0]; + var cy = ele.cy(); + + if (!cy.styleEnabled()) { + return; + } + + if (ele) { + return ele._private.style[property] || cy.style().getDefaultProperty(property); + } + }, + + numericStyle: function numericStyle(property) { + var ele = this[0]; + + if (!ele.cy().styleEnabled()) { + return; + } + + if (ele) { + var pstyle = ele.pstyle(property); + + return pstyle.pfValue !== undefined ? pstyle.pfValue : pstyle.value; + } + }, + + numericStyleUnits: function numericStyleUnits(property) { + var ele = this[0]; + + if (!ele.cy().styleEnabled()) { + return; + } + + if (ele) { + return ele.pstyle(property).units; + } + }, + + // get the specified css property as a rendered value (i.e. on-screen value) + // or get the whole rendered style if no property specified (NB doesn't allow setting) + renderedStyle: function renderedStyle(property) { + var cy = this.cy(); + if (!cy.styleEnabled()) { + return this; + } + + var ele = this[0]; + + if (ele) { + return cy.style().getRenderedStyle(ele, property); + } + }, + + // read the calculated css style of the element or override the style (via a bypass) + style: function style(name, value) { + var cy = this.cy(); + + if (!cy.styleEnabled()) { + return this; + } + + var updateTransitions = false; + var style = cy.style(); + + if (is.plainObject(name)) { + // then extend the bypass + var props = name; + style.applyBypass(this, props, updateTransitions); + + this.dirtyStyleCache(); + this.dirtyCompoundBoundsCache(); + + this.emitAndNotify('style'); // let the renderer know we've updated style + } else if (is.string(name)) { + + if (value === undefined) { + // then get the property from the style + var ele = this[0]; + + if (ele) { + return style.getStylePropertyValue(ele, name); + } else { + // empty collection => can't get any value + return; + } + } else { + // then set the bypass with the property value + style.applyBypass(this, name, value, updateTransitions); + + this.dirtyStyleCache(); + this.dirtyCompoundBoundsCache(); + + this.emitAndNotify('style'); // let the renderer know we've updated style + } + } else if (name === undefined) { + var _ele = this[0]; + + if (_ele) { + return style.getRawStyle(_ele); + } else { + // empty collection => can't get any value + return; + } + } + + return this; // chaining + }, + + removeStyle: function removeStyle(names) { + var cy = this.cy(); + + if (!cy.styleEnabled()) { + return this; + } + + var updateTransitions = false; + var style = cy.style(); + var eles = this; + + if (names === undefined) { + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + + style.removeAllBypasses(ele, updateTransitions); + } + } else { + names = names.split(/\s+/); + + for (var _i = 0; _i < eles.length; _i++) { + var _ele2 = eles[_i]; + + style.removeBypasses(_ele2, names, updateTransitions); + } + } + + this.dirtyStyleCache(); + this.dirtyCompoundBoundsCache(); + + this.emitAndNotify('style'); // let the renderer know we've updated style + + return this; // chaining + }, + + show: function show() { + this.css('display', 'element'); + return this; // chaining + }, + + hide: function hide() { + this.css('display', 'none'); + return this; // chaining + }, + + effectiveOpacity: function effectiveOpacity() { + var cy = this.cy(); + if (!cy.styleEnabled()) { + return 1; + } + + var hasCompoundNodes = cy.hasCompoundNodes(); + var ele = this[0]; + + if (ele) { + var _p = ele._private; + var parentOpacity = ele.pstyle('opacity').value; + + if (!hasCompoundNodes) { + return parentOpacity; + } + + var parents = !_p.data.parent ? null : ele.parents(); + + if (parents) { + for (var i = 0; i < parents.length; i++) { + var parent = parents[i]; + var opacity = parent.pstyle('opacity').value; + + parentOpacity = opacity * parentOpacity; + } + } + + return parentOpacity; + } + }, + + transparent: function transparent() { + var cy = this.cy(); + if (!cy.styleEnabled()) { + return false; + } + + var ele = this[0]; + var hasCompoundNodes = ele.cy().hasCompoundNodes(); + + if (ele) { + if (!hasCompoundNodes) { + return ele.pstyle('opacity').value === 0; + } else { + return ele.effectiveOpacity() === 0; + } + } + }, + + backgrounding: function backgrounding() { + var cy = this.cy(); + if (!cy.styleEnabled()) { + return false; + } + + var ele = this[0]; + + return ele._private.backgrounding ? true : false; + } + +}; + +function checkCompound(ele, parentOk) { + var _p = ele._private; + var parents = _p.data.parent ? ele.parents() : null; + + if (parents) { + for (var i = 0; i < parents.length; i++) { + var parent = parents[i]; + + if (!parentOk(parent)) { + return false; + } + } + } + + return true; +} + +function defineDerivedStateFunction(specs) { + var ok = specs.ok; + var edgeOkViaNode = specs.edgeOkViaNode || specs.ok; + var parentOk = specs.parentOk || specs.ok; + + return function () { + var cy = this.cy(); + if (!cy.styleEnabled()) { + return true; + } + + var ele = this[0]; + var hasCompoundNodes = cy.hasCompoundNodes(); + + if (ele) { + var _p = ele._private; + + if (!ok(ele)) { + return false; + } + + if (ele.isNode()) { + return !hasCompoundNodes || checkCompound(ele, parentOk); + } else { + var src = _p.source; + var tgt = _p.target; + + return edgeOkViaNode(src) && (!hasCompoundNodes || checkCompound(src, edgeOkViaNode)) && (src === tgt || edgeOkViaNode(tgt) && (!hasCompoundNodes || checkCompound(tgt, edgeOkViaNode))); + } + } + }; +} + +var eleTakesUpSpace = cacheStyleFunction('eleTakesUpSpace', function (ele) { + return ele.pstyle('display').value === 'element' && ele.width() !== 0 && (ele.isNode() ? ele.height() !== 0 : true); +}); + +elesfn.takesUpSpace = cachePrototypeStyleFunction('takesUpSpace', defineDerivedStateFunction({ + ok: eleTakesUpSpace +})); + +var eleInteractive = cacheStyleFunction('eleInteractive', function (ele) { + return ele.pstyle('events').value === 'yes' && ele.pstyle('visibility').value === 'visible' && eleTakesUpSpace(ele); +}); + +var parentInteractive = cacheStyleFunction('parentInteractive', function (parent) { + return parent.pstyle('visibility').value === 'visible' && eleTakesUpSpace(parent); +}); + +elesfn.interactive = cachePrototypeStyleFunction('interactive', defineDerivedStateFunction({ + ok: eleInteractive, + parentOk: parentInteractive, + edgeOkViaNode: eleTakesUpSpace +})); + +elesfn.noninteractive = function () { + var ele = this[0]; + + if (ele) { + return !ele.interactive(); + } +}; + +var eleVisible = cacheStyleFunction('eleVisible', function (ele) { + return ele.pstyle('visibility').value === 'visible' && ele.pstyle('opacity').pfValue !== 0 && eleTakesUpSpace(ele); +}); + +var edgeVisibleViaNode = eleTakesUpSpace; + +elesfn.visible = cachePrototypeStyleFunction('visible', defineDerivedStateFunction({ + ok: eleVisible, + edgeOkViaNode: edgeVisibleViaNode +})); + +elesfn.hidden = function () { + var ele = this[0]; + + if (ele) { + return !ele.visible(); + } +}; + +elesfn.bypass = elesfn.css = elesfn.style; +elesfn.renderedCss = elesfn.renderedStyle; +elesfn.removeBypass = elesfn.removeCss = elesfn.removeStyle; +elesfn.pstyle = elesfn.parsedStyle; + +module.exports = elesfn; + +/***/ }), +/* 68 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var elesfn = {}; + +function defineSwitchFunction(params) { + return function () { + var args = arguments; + var changedEles = []; + + // e.g. cy.nodes().select( data, handler ) + if (args.length === 2) { + var data = args[0]; + var handler = args[1]; + this.on(params.event, data, handler); + } + + // e.g. cy.nodes().select( handler ) + else if (args.length === 1) { + var _handler = args[0]; + this.on(params.event, _handler); + } + + // e.g. cy.nodes().select() + else if (args.length === 0) { + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + var able = !params.ableField || ele._private[params.ableField]; + var changed = ele._private[params.field] != params.value; + + if (params.overrideAble) { + var overrideAble = params.overrideAble(ele); + + if (overrideAble !== undefined) { + able = overrideAble; + + if (!overrideAble) { + return this; + } // to save cycles assume not able for all on override + } + } + + if (able) { + ele._private[params.field] = params.value; + + if (changed) { + changedEles.push(ele); + } + } + } + + var changedColl = this.spawn(changedEles); + changedColl.updateStyle(); // change of state => possible change of style + changedColl.emit(params.event); + } + + return this; + }; +} + +function defineSwitchSet(params) { + elesfn[params.field] = function () { + var ele = this[0]; + + if (ele) { + if (params.overrideField) { + var val = params.overrideField(ele); + + if (val !== undefined) { + return val; + } + } + + return ele._private[params.field]; + } + }; + + elesfn[params.on] = defineSwitchFunction({ + event: params.on, + field: params.field, + ableField: params.ableField, + overrideAble: params.overrideAble, + value: true + }); + + elesfn[params.off] = defineSwitchFunction({ + event: params.off, + field: params.field, + ableField: params.ableField, + overrideAble: params.overrideAble, + value: false + }); +} + +defineSwitchSet({ + field: 'locked', + overrideField: function overrideField(ele) { + return ele.cy().autolock() ? true : undefined; + }, + on: 'lock', + off: 'unlock' +}); + +defineSwitchSet({ + field: 'grabbable', + overrideField: function overrideField(ele) { + return ele.cy().autoungrabify() ? false : undefined; + }, + on: 'grabify', + off: 'ungrabify' +}); + +defineSwitchSet({ + field: 'selected', + ableField: 'selectable', + overrideAble: function overrideAble(ele) { + return ele.cy().autounselectify() ? false : undefined; + }, + on: 'select', + off: 'unselect' +}); + +defineSwitchSet({ + field: 'selectable', + overrideField: function overrideField(ele) { + return ele.cy().autounselectify() ? false : undefined; + }, + on: 'selectify', + off: 'unselectify' +}); + +elesfn.deselect = elesfn.unselect; + +elesfn.grabbed = function () { + var ele = this[0]; + if (ele) { + return ele._private.grabbed; + } +}; + +defineSwitchSet({ + field: 'active', + on: 'activate', + off: 'unactivate' +}); + +elesfn.inactive = function () { + var ele = this[0]; + if (ele) { + return !ele._private.active; + } +}; + +module.exports = elesfn; + +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var is = __webpack_require__(0); + +var elesfn = {}; + +var cache = function cache(fn, name) { + return function traversalCache(arg1, arg2, arg3, arg4) { + var selectorOrEles = arg1; + var eles = this; + var key = void 0; + + if (selectorOrEles == null) { + key = 'null'; + } else if (is.elementOrCollection(selectorOrEles) && selectorOrEles.length === 1) { + key = '#' + selectorOrEles.id(); + } + + if (eles.length === 1 && key) { + var _p = eles[0]._private; + var tch = _p.traversalCache = _p.traversalCache || {}; + var ch = tch[name] = tch[name] || {}; + var cacheHit = ch[key]; + + if (cacheHit) { + return cacheHit; + } else { + return ch[key] = fn.call(eles, arg1, arg2, arg3, arg4); + } + } else { + return fn.call(eles, arg1, arg2, arg3, arg4); + } + }; +}; + +// DAG functions +//////////////// + +var defineDagExtremity = function defineDagExtremity(params) { + return function dagExtremityImpl(selector) { + var eles = this; + var ret = []; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + if (!ele.isNode()) { + continue; + } + + var disqualified = false; + var edges = ele.connectedEdges(); + + for (var j = 0; j < edges.length; j++) { + var edge = edges[j]; + var src = edge.source(); + var tgt = edge.target(); + + if (params.noIncomingEdges && tgt === ele && src !== ele || params.noOutgoingEdges && src === ele && tgt !== ele) { + disqualified = true; + break; + } + } + + if (!disqualified) { + ret.push(ele); + } + } + + return this.spawn(ret, { unique: true }).filter(selector); + }; +}; + +var defineDagOneHop = function defineDagOneHop(params) { + return function (selector) { + var eles = this; + var oEles = []; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + + if (!ele.isNode()) { + continue; + } + + var edges = ele.connectedEdges(); + for (var j = 0; j < edges.length; j++) { + var edge = edges[j]; + var src = edge.source(); + var tgt = edge.target(); + + if (params.outgoing && src === ele) { + oEles.push(edge); + oEles.push(tgt); + } else if (params.incoming && tgt === ele) { + oEles.push(edge); + oEles.push(src); + } + } + } + + return this.spawn(oEles, { unique: true }).filter(selector); + }; +}; + +var defineDagAllHops = function defineDagAllHops(params) { + return function (selector) { + var eles = this; + var sEles = []; + var sElesIds = {}; + + for (;;) { + var next = params.outgoing ? eles.outgoers() : eles.incomers(); + + if (next.length === 0) { + break; + } // done if none left + + var newNext = false; + for (var i = 0; i < next.length; i++) { + var n = next[i]; + var nid = n.id(); + + if (!sElesIds[nid]) { + sElesIds[nid] = true; + sEles.push(n); + newNext = true; + } + } + + if (!newNext) { + break; + } // done if touched all outgoers already + + eles = next; + } + + return this.spawn(sEles, { unique: true }).filter(selector); + }; +}; + +elesfn.clearTraversalCache = function () { + for (var i = 0; i < this.length; i++) { + this[i]._private.traversalCache = null; + } +}; + +util.extend(elesfn, { + // get the root nodes in the DAG + roots: defineDagExtremity({ noIncomingEdges: true }), + + // get the leaf nodes in the DAG + leaves: defineDagExtremity({ noOutgoingEdges: true }), + + // normally called children in graph theory + // these nodes =edges=> outgoing nodes + outgoers: cache(defineDagOneHop({ outgoing: true }), 'outgoers'), + + // aka DAG descendants + successors: defineDagAllHops({ outgoing: true }), + + // normally called parents in graph theory + // these nodes <=edges= incoming nodes + incomers: cache(defineDagOneHop({ incoming: true }), 'incomers'), + + // aka DAG ancestors + predecessors: defineDagAllHops({ incoming: true }) +}); + +// Neighbourhood functions +////////////////////////// + +util.extend(elesfn, { + neighborhood: cache(function (selector) { + var elements = []; + var nodes = this.nodes(); + + for (var i = 0; i < nodes.length; i++) { + // for all nodes + var node = nodes[i]; + var connectedEdges = node.connectedEdges(); + + // for each connected edge, add the edge and the other node + for (var j = 0; j < connectedEdges.length; j++) { + var edge = connectedEdges[j]; + var src = edge.source(); + var tgt = edge.target(); + var otherNode = node === src ? tgt : src; + + // need check in case of loop + if (otherNode.length > 0) { + elements.push(otherNode[0]); // add node 1 hop away + } + + // add connected edge + elements.push(edge[0]); + } + } + + return this.spawn(elements, { unique: true }).filter(selector); + }, 'neighborhood'), + + closedNeighborhood: function closedNeighborhood(selector) { + return this.neighborhood().add(this).filter(selector); + }, + + openNeighborhood: function openNeighborhood(selector) { + return this.neighborhood(selector); + } +}); + +// aliases +elesfn.neighbourhood = elesfn.neighborhood; +elesfn.closedNeighbourhood = elesfn.closedNeighborhood; +elesfn.openNeighbourhood = elesfn.openNeighborhood; + +// Edge functions +///////////////// + +util.extend(elesfn, { + source: cache(function sourceImpl(selector) { + var ele = this[0]; + var src = void 0; + + if (ele) { + src = ele._private.source || ele.cy().collection(); + } + + return src && selector ? src.filter(selector) : src; + }, 'source'), + + target: cache(function targetImpl(selector) { + var ele = this[0]; + var tgt = void 0; + + if (ele) { + tgt = ele._private.target || ele.cy().collection(); + } + + return tgt && selector ? tgt.filter(selector) : tgt; + }, 'target'), + + sources: defineSourceFunction({ + attr: 'source' + }), + + targets: defineSourceFunction({ + attr: 'target' + }) +}); + +function defineSourceFunction(params) { + return function sourceImpl(selector) { + var sources = []; + + for (var i = 0; i < this.length; i++) { + var ele = this[i]; + var src = ele._private[params.attr]; + + if (src) { + sources.push(src); + } + } + + return this.spawn(sources, { unique: true }).filter(selector); + }; +} + +util.extend(elesfn, { + edgesWith: cache(defineEdgesWithFunction(), 'edgesWith'), + + edgesTo: cache(defineEdgesWithFunction({ + thisIsSrc: true + }), 'edgesTo') +}); + +function defineEdgesWithFunction(params) { + + return function edgesWithImpl(otherNodes) { + var elements = []; + var cy = this._private.cy; + var p = params || {}; + + // get elements if a selector is specified + if (is.string(otherNodes)) { + otherNodes = cy.$(otherNodes); + } + + for (var h = 0; h < otherNodes.length; h++) { + var edges = otherNodes[h]._private.edges; + + for (var i = 0; i < edges.length; i++) { + var edge = edges[i]; + var edgeData = edge._private.data; + var thisToOther = this.hasElementWithId(edgeData.source) && otherNodes.hasElementWithId(edgeData.target); + var otherToThis = otherNodes.hasElementWithId(edgeData.source) && this.hasElementWithId(edgeData.target); + var edgeConnectsThisAndOther = thisToOther || otherToThis; + + if (!edgeConnectsThisAndOther) { + continue; + } + + if (p.thisIsSrc || p.thisIsTgt) { + if (p.thisIsSrc && !thisToOther) { + continue; + } + + if (p.thisIsTgt && !otherToThis) { + continue; + } + } + + elements.push(edge); + } + } + + return this.spawn(elements, { unique: true }); + }; +} + +util.extend(elesfn, { + connectedEdges: cache(function (selector) { + var retEles = []; + + var eles = this; + for (var i = 0; i < eles.length; i++) { + var node = eles[i]; + if (!node.isNode()) { + continue; + } + + var edges = node._private.edges; + + for (var j = 0; j < edges.length; j++) { + var edge = edges[j]; + retEles.push(edge); + } + } + + return this.spawn(retEles, { unique: true }).filter(selector); + }, 'connectedEdges'), + + connectedNodes: cache(function (selector) { + var retEles = []; + + var eles = this; + for (var i = 0; i < eles.length; i++) { + var edge = eles[i]; + if (!edge.isEdge()) { + continue; + } + + retEles.push(edge.source()[0]); + retEles.push(edge.target()[0]); + } + + return this.spawn(retEles, { unique: true }).filter(selector); + }, 'connectedNodes'), + + parallelEdges: cache(defineParallelEdgesFunction(), 'parallelEdges'), + + codirectedEdges: cache(defineParallelEdgesFunction({ + codirected: true + }), 'codirectedEdges') +}); + +function defineParallelEdgesFunction(params) { + var defaults = { + codirected: false + }; + params = util.extend({}, defaults, params); + + return function parallelEdgesImpl(selector) { + // micro-optimised for renderer + var elements = []; + var edges = this.edges(); + var p = params; + + // look at all the edges in the collection + for (var i = 0; i < edges.length; i++) { + var edge1 = edges[i]; + var edge1_p = edge1._private; + var src1 = edge1_p.source; + var srcid1 = src1._private.data.id; + var tgtid1 = edge1_p.data.target; + var srcEdges1 = src1._private.edges; + + // look at edges connected to the src node of this edge + for (var j = 0; j < srcEdges1.length; j++) { + var edge2 = srcEdges1[j]; + var edge2data = edge2._private.data; + var tgtid2 = edge2data.target; + var srcid2 = edge2data.source; + + var codirected = tgtid2 === tgtid1 && srcid2 === srcid1; + var oppdirected = srcid1 === tgtid2 && tgtid1 === srcid2; + + if (p.codirected && codirected || !p.codirected && (codirected || oppdirected)) { + elements.push(edge2); + } + } + } + + return this.spawn(elements, { unique: true }).filter(selector); + }; +} + +// Misc functions +///////////////// + +util.extend(elesfn, { + components: function components() { + var self = this; + var cy = self.cy(); + var visited = self.spawn(); + var unvisited = self.nodes().spawnSelf(); + var components = []; + + var visitInComponent = function visitInComponent(node, component) { + visited.merge(node); + unvisited.unmerge(node); + component.merge(node); + }; + + if (unvisited.empty()) { + return self.spawn(); + } + + var _loop = function _loop() { + var component = cy.collection(); + components.push(component); + + var root = unvisited[0]; + visitInComponent(root, component); + + self.bfs({ + directed: false, + roots: root, + visit: function visit(v, e, u, i, depth) { + visitInComponent(v, component); + } + }); + }; + + do { + _loop(); + } while (unvisited.length > 0); + + return components.map(function (component) { + var connectedEdges = component.connectedEdges().stdFilter(function (edge) { + return component.anySame(edge.source()) && component.anySame(edge.target()); + }); + + return component.union(connectedEdges); + }); + } +}); + +module.exports = elesfn; + +/***/ }), +/* 70 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var util = __webpack_require__(1); +var Collection = __webpack_require__(7); +var Element = __webpack_require__(14); + +var corefn = { + add: function add(opts) { + + var elements = void 0; + var cy = this; + + // add the elements + if (is.elementOrCollection(opts)) { + var eles = opts; + + if (eles._private.cy === cy) { + // same instance => just restore + elements = eles.restore(); + } else { + // otherwise, copy from json + var jsons = []; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + jsons.push(ele.json()); + } + + elements = new Collection(cy, jsons); + } + } + + // specify an array of options + else if (is.array(opts)) { + var _jsons = opts; + + elements = new Collection(cy, _jsons); + } + + // specify via opts.nodes and opts.edges + else if (is.plainObject(opts) && (is.array(opts.nodes) || is.array(opts.edges))) { + var elesByGroup = opts; + var _jsons2 = []; + + var grs = ['nodes', 'edges']; + for (var _i = 0, il = grs.length; _i < il; _i++) { + var group = grs[_i]; + var elesArray = elesByGroup[group]; + + if (is.array(elesArray)) { + + for (var j = 0, jl = elesArray.length; j < jl; j++) { + var json = util.extend({ group: group }, elesArray[j]); + + _jsons2.push(json); + } + } + } + + elements = new Collection(cy, _jsons2); + } + + // specify options for one element + else { + var _json = opts; + elements = new Element(cy, _json).collection(); + } + + return elements; + }, + + remove: function remove(collection) { + if (is.elementOrCollection(collection)) { + // already have right ref + } else if (is.string(collection)) { + var selector = collection; + collection = this.$(selector); + } + + return collection.remove(); + } +}; + +module.exports = corefn; + +/***/ }), +/* 71 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var define = __webpack_require__(4); +var util = __webpack_require__(1); +var stepAll = __webpack_require__(72); + +var corefn = { + + // pull in animation functions + animate: define.animate(), + animation: define.animation(), + animated: define.animated(), + clearQueue: define.clearQueue(), + delay: define.delay(), + delayAnimation: define.delayAnimation(), + stop: define.stop(), + + addToAnimationPool: function addToAnimationPool(eles) { + var cy = this; + + if (!cy.styleEnabled()) { + return; + } // save cycles when no style used + + cy._private.aniEles.merge(eles); + }, + + stopAnimationLoop: function stopAnimationLoop() { + this._private.animationsRunning = false; + }, + + startAnimationLoop: function startAnimationLoop() { + var cy = this; + + cy._private.animationsRunning = true; + + if (!cy.styleEnabled()) { + return; + } // save cycles when no style used + + // NB the animation loop will exec in headless environments if style enabled + // and explicit cy.destroy() is necessary to stop the loop + + function headlessStep() { + if (!cy._private.animationsRunning) { + return; + } + + util.requestAnimationFrame(function animationStep(now) { + stepAll(now, cy); + headlessStep(); + }); + } + + var renderer = cy.renderer(); + + if (renderer && renderer.beforeRender) { + // let the renderer schedule animations + renderer.beforeRender(function rendererAnimationStep(willDraw, now) { + stepAll(now, cy); + }, renderer.beforeRenderPriorities.animations); + } else { + // manage the animation loop ourselves + headlessStep(); // first call + } + } + +}; + +module.exports = corefn; + +/***/ }), +/* 72 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var step = __webpack_require__(73); +var startAnimation = __webpack_require__(78); + +function stepAll(now, cy) { + var eles = cy._private.aniEles; + var doneEles = []; + + function stepOne(ele, isCore) { + var _p = ele._private; + var current = _p.animation.current; + var queue = _p.animation.queue; + var ranAnis = false; + + // cancel all animations on display:none ele + if (!isCore && ele.pstyle('display').value === 'none') { + // put all current and queue animations in this tick's current list + // and empty the lists for the element + current = current.splice(0, current.length).concat(queue.splice(0, queue.length)); + + // stop all animations + for (var i = 0; i < current.length; i++) { + current[i].stop(); + } + } + + // if nothing currently animating, get something from the queue + if (current.length === 0) { + var next = queue.shift(); + + if (next) { + current.push(next); + } + } + + var callbacks = function callbacks(_callbacks) { + for (var j = _callbacks.length - 1; j >= 0; j--) { + var cb = _callbacks[j]; + + cb(); + } + + _callbacks.splice(0, _callbacks.length); + }; + + // step and remove if done + for (var _i = current.length - 1; _i >= 0; _i--) { + var ani = current[_i]; + var ani_p = ani._private; + + if (ani_p.stopped) { + current.splice(_i, 1); + + ani_p.hooked = false; + ani_p.playing = false; + ani_p.started = false; + + callbacks(ani_p.frames); + + continue; + } + + if (!ani_p.playing && !ani_p.applying) { + continue; + } + + // an apply() while playing shouldn't do anything + if (ani_p.playing && ani_p.applying) { + ani_p.applying = false; + } + + if (!ani_p.started) { + startAnimation(ele, ani, now, isCore); + } + + step(ele, ani, now, isCore); + + if (ani_p.applying) { + ani_p.applying = false; + } + + callbacks(ani_p.frames); + + if (ani.completed()) { + current.splice(_i, 1); + + ani_p.hooked = false; + ani_p.playing = false; + ani_p.started = false; + + callbacks(ani_p.completes); + } + + ranAnis = true; + } + + if (!isCore && current.length === 0 && queue.length === 0) { + doneEles.push(ele); + } + + return ranAnis; + } // stepElement + + // handle all eles + var ranEleAni = false; + for (var e = 0; e < eles.length; e++) { + var ele = eles[e]; + var handledThisEle = stepOne(ele); + + ranEleAni = ranEleAni || handledThisEle; + } // each element + + var ranCoreAni = stepOne(cy, true); + + // notify renderer + if (ranEleAni || ranCoreAni) { + if (eles.length > 0) { + eles.dirtyCompoundBoundsCache(); + + cy.notify({ + type: 'draw', + eles: eles + }); + } else { + cy.notify({ + type: 'draw' + }); + } + } + + // remove elements from list of currently animating if its queues are empty + eles.unmerge(doneEles); + + cy.emit('step'); +} // stepAll + +module.exports = stepAll; + +/***/ }), +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var easings = __webpack_require__(74); +var ease = __webpack_require__(77); +var is = __webpack_require__(0); + +function step(self, ani, now, isCore) { + var isEles = !isCore; + var _p = self._private; + var ani_p = ani._private; + var pEasing = ani_p.easing; + var startTime = ani_p.startTime; + var cy = isCore ? self : self.cy(); + var style = cy.style(); + + if (!ani_p.easingImpl) { + + if (pEasing == null) { + // use default + ani_p.easingImpl = easings['linear']; + } else { + // then define w/ name + var easingVals = void 0; + + if (is.string(pEasing)) { + var easingProp = style.parse('transition-timing-function', pEasing); + + easingVals = easingProp.value; + } else { + // then assume preparsed array + easingVals = pEasing; + } + + var name = void 0, + args = void 0; + + if (is.string(easingVals)) { + name = easingVals; + args = []; + } else { + name = easingVals[1]; + args = easingVals.slice(2).map(function (n) { + return +n; + }); + } + + if (args.length > 0) { + // create with args + if (name === 'spring') { + args.push(ani_p.duration); // need duration to generate spring + } + + ani_p.easingImpl = easings[name].apply(null, args); + } else { + // static impl by name + ani_p.easingImpl = easings[name]; + } + } + } + + var easing = ani_p.easingImpl; + var percent = void 0; + + if (ani_p.duration === 0) { + percent = 1; + } else { + percent = (now - startTime) / ani_p.duration; + } + + if (ani_p.applying) { + percent = ani_p.progress; + } + + if (percent < 0) { + percent = 0; + } else if (percent > 1) { + percent = 1; + } + + if (ani_p.delay == null) { + // then update + + var startPos = ani_p.startPosition; + var endPos = ani_p.position; + + if (endPos && isEles && !self.locked()) { + var pos = self.position(); + + if (valid(startPos.x, endPos.x)) { + pos.x = ease(startPos.x, endPos.x, percent, easing); + } + + if (valid(startPos.y, endPos.y)) { + pos.y = ease(startPos.y, endPos.y, percent, easing); + } + + self.emit('position'); + } + + var startPan = ani_p.startPan; + var endPan = ani_p.pan; + var pan = _p.pan; + var animatingPan = endPan != null && isCore; + if (animatingPan) { + if (valid(startPan.x, endPan.x)) { + pan.x = ease(startPan.x, endPan.x, percent, easing); + } + + if (valid(startPan.y, endPan.y)) { + pan.y = ease(startPan.y, endPan.y, percent, easing); + } + + self.emit('pan'); + } + + var startZoom = ani_p.startZoom; + var endZoom = ani_p.zoom; + var animatingZoom = endZoom != null && isCore; + if (animatingZoom) { + if (valid(startZoom, endZoom)) { + _p.zoom = ease(startZoom, endZoom, percent, easing); + } + + self.emit('zoom'); + } + + if (animatingPan || animatingZoom) { + self.emit('viewport'); + } + + var props = ani_p.style; + if (props && props.length > 0 && isEles) { + for (var i = 0; i < props.length; i++) { + var prop = props[i]; + var _name = prop.name; + var end = prop; + var start = ani_p.startStyle[_name]; + var propSpec = style.properties[start.name]; + var easedVal = ease(start, end, percent, easing, propSpec); + + style.overrideBypass(self, _name, easedVal); + } // for props + + self.emit('style'); + } // if + } + + ani_p.progress = percent; + + return percent; +} + +function valid(start, end) { + if (start == null || end == null) { + return false; + } + + if (is.number(start) && is.number(end)) { + return true; + } else if (start && end) { + return true; + } + + return false; +} + +module.exports = step; + +/***/ }), +/* 74 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var generateCubicBezier = __webpack_require__(75); +var generateSpringRK4 = __webpack_require__(76); + +var cubicBezier = function cubicBezier(t1, p1, t2, p2) { + var bezier = generateCubicBezier(t1, p1, t2, p2); + + return function (start, end, percent) { + return start + (end - start) * bezier(percent); + }; +}; + +var easings = { + 'linear': function linear(start, end, percent) { + return start + (end - start) * percent; + }, + + // default easings + 'ease': cubicBezier(0.25, 0.1, 0.25, 1), + 'ease-in': cubicBezier(0.42, 0, 1, 1), + 'ease-out': cubicBezier(0, 0, 0.58, 1), + 'ease-in-out': cubicBezier(0.42, 0, 0.58, 1), + + // sine + 'ease-in-sine': cubicBezier(0.47, 0, 0.745, 0.715), + 'ease-out-sine': cubicBezier(0.39, 0.575, 0.565, 1), + 'ease-in-out-sine': cubicBezier(0.445, 0.05, 0.55, 0.95), + + // quad + 'ease-in-quad': cubicBezier(0.55, 0.085, 0.68, 0.53), + 'ease-out-quad': cubicBezier(0.25, 0.46, 0.45, 0.94), + 'ease-in-out-quad': cubicBezier(0.455, 0.03, 0.515, 0.955), + + // cubic + 'ease-in-cubic': cubicBezier(0.55, 0.055, 0.675, 0.19), + 'ease-out-cubic': cubicBezier(0.215, 0.61, 0.355, 1), + 'ease-in-out-cubic': cubicBezier(0.645, 0.045, 0.355, 1), + + // quart + 'ease-in-quart': cubicBezier(0.895, 0.03, 0.685, 0.22), + 'ease-out-quart': cubicBezier(0.165, 0.84, 0.44, 1), + 'ease-in-out-quart': cubicBezier(0.77, 0, 0.175, 1), + + // quint + 'ease-in-quint': cubicBezier(0.755, 0.05, 0.855, 0.06), + 'ease-out-quint': cubicBezier(0.23, 1, 0.32, 1), + 'ease-in-out-quint': cubicBezier(0.86, 0, 0.07, 1), + + // expo + 'ease-in-expo': cubicBezier(0.95, 0.05, 0.795, 0.035), + 'ease-out-expo': cubicBezier(0.19, 1, 0.22, 1), + 'ease-in-out-expo': cubicBezier(1, 0, 0, 1), + + // circ + 'ease-in-circ': cubicBezier(0.6, 0.04, 0.98, 0.335), + 'ease-out-circ': cubicBezier(0.075, 0.82, 0.165, 1), + 'ease-in-out-circ': cubicBezier(0.785, 0.135, 0.15, 0.86), + + // user param easings... + + 'spring': function spring(tension, friction, duration) { + if (duration === 0) { + // can't get a spring w/ duration 0 + return easings.linear; // duration 0 => jump to end so impl doesn't matter + } + + var spring = generateSpringRK4(tension, friction, duration); + + return function (start, end, percent) { + return start + (end - start) * spring(percent); + }; + }, + + 'cubic-bezier': cubicBezier +}; + +module.exports = easings; + +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* global Float32Array */ + +/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */ +function generateCubicBezier(mX1, mY1, mX2, mY2) { + var NEWTON_ITERATIONS = 4, + NEWTON_MIN_SLOPE = 0.001, + SUBDIVISION_PRECISION = 0.0000001, + SUBDIVISION_MAX_ITERATIONS = 10, + kSplineTableSize = 11, + kSampleStepSize = 1.0 / (kSplineTableSize - 1.0), + float32ArraySupported = typeof Float32Array !== 'undefined'; + + /* Must contain four arguments. */ + if (arguments.length !== 4) { + return false; + } + + /* Arguments must be numbers. */ + for (var i = 0; i < 4; ++i) { + if (typeof arguments[i] !== "number" || isNaN(arguments[i]) || !isFinite(arguments[i])) { + return false; + } + } + + /* X values must be in the [0, 1] range. */ + mX1 = Math.min(mX1, 1); + mX2 = Math.min(mX2, 1); + mX1 = Math.max(mX1, 0); + mX2 = Math.max(mX2, 0); + + var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize); + + function A(aA1, aA2) { + return 1.0 - 3.0 * aA2 + 3.0 * aA1; + } + + function B(aA1, aA2) { + return 3.0 * aA2 - 6.0 * aA1; + } + + function C(aA1) { + return 3.0 * aA1; + } + + function calcBezier(aT, aA1, aA2) { + return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; + } + + function getSlope(aT, aA1, aA2) { + return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); + } + + function newtonRaphsonIterate(aX, aGuessT) { + for (var _i = 0; _i < NEWTON_ITERATIONS; ++_i) { + var currentSlope = getSlope(aGuessT, mX1, mX2); + + if (currentSlope === 0.0) { + return aGuessT; + } + + var currentX = calcBezier(aGuessT, mX1, mX2) - aX; + aGuessT -= currentX / currentSlope; + } + + return aGuessT; + } + + function calcSampleValues() { + for (var _i2 = 0; _i2 < kSplineTableSize; ++_i2) { + mSampleValues[_i2] = calcBezier(_i2 * kSampleStepSize, mX1, mX2); + } + } + + function binarySubdivide(aX, aA, aB) { + var currentX = void 0, + currentT = void 0, + i = 0; + + do { + currentT = aA + (aB - aA) / 2.0; + currentX = calcBezier(currentT, mX1, mX2) - aX; + if (currentX > 0.0) { + aB = currentT; + } else { + aA = currentT; + } + } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS); + + return currentT; + } + + function getTForX(aX) { + var intervalStart = 0.0, + currentSample = 1, + lastSample = kSplineTableSize - 1; + + for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) { + intervalStart += kSampleStepSize; + } + + --currentSample; + + var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]), + guessForT = intervalStart + dist * kSampleStepSize, + initialSlope = getSlope(guessForT, mX1, mX2); + + if (initialSlope >= NEWTON_MIN_SLOPE) { + return newtonRaphsonIterate(aX, guessForT); + } else if (initialSlope === 0.0) { + return guessForT; + } else { + return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize); + } + } + + var _precomputed = false; + + function precompute() { + _precomputed = true; + if (mX1 !== mY1 || mX2 !== mY2) { + calcSampleValues(); + } + } + + var f = function f(aX) { + if (!_precomputed) { + precompute(); + } + if (mX1 === mY1 && mX2 === mY2) { + return aX; + } + if (aX === 0) { + return 0; + } + if (aX === 1) { + return 1; + } + + return calcBezier(getTForX(aX), mY1, mY2); + }; + + f.getControlPoints = function () { + return [{ + x: mX1, + y: mY1 + }, { + x: mX2, + y: mY2 + }]; + }; + + var str = "generateBezier(" + [mX1, mY1, mX2, mY2] + ")"; + f.toString = function () { + return str; + }; + + return f; +} + +module.exports = generateCubicBezier; + +/***/ }), +/* 76 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */ +/* Given a tension, friction, and duration, a simulation at 60FPS will first run without a defined duration in order to calculate the full path. A second pass + then adjusts the time delta -- using the relation between actual time and duration -- to calculate the path for the duration-constrained animation. */ +var generateSpringRK4 = function () { + function springAccelerationForState(state) { + return -state.tension * state.x - state.friction * state.v; + } + + function springEvaluateStateWithDerivative(initialState, dt, derivative) { + var state = { + x: initialState.x + derivative.dx * dt, + v: initialState.v + derivative.dv * dt, + tension: initialState.tension, + friction: initialState.friction + }; + + return { dx: state.v, dv: springAccelerationForState(state) }; + } + + function springIntegrateState(state, dt) { + var a = { + dx: state.v, + dv: springAccelerationForState(state) + }, + b = springEvaluateStateWithDerivative(state, dt * 0.5, a), + c = springEvaluateStateWithDerivative(state, dt * 0.5, b), + d = springEvaluateStateWithDerivative(state, dt, c), + dxdt = 1.0 / 6.0 * (a.dx + 2.0 * (b.dx + c.dx) + d.dx), + dvdt = 1.0 / 6.0 * (a.dv + 2.0 * (b.dv + c.dv) + d.dv); + + state.x = state.x + dxdt * dt; + state.v = state.v + dvdt * dt; + + return state; + } + + return function springRK4Factory(tension, friction, duration) { + + var initState = { + x: -1, + v: 0, + tension: null, + friction: null + }, + path = [0], + time_lapsed = 0, + tolerance = 1 / 10000, + DT = 16 / 1000, + have_duration = void 0, + dt = void 0, + last_state = void 0; + + tension = parseFloat(tension) || 500; + friction = parseFloat(friction) || 20; + duration = duration || null; + + initState.tension = tension; + initState.friction = friction; + + have_duration = duration !== null; + + /* Calculate the actual time it takes for this animation to complete with the provided conditions. */ + if (have_duration) { + /* Run the simulation without a duration. */ + time_lapsed = springRK4Factory(tension, friction); + /* Compute the adjusted time delta. */ + dt = time_lapsed / duration * DT; + } else { + dt = DT; + } + + for (;;) { + /* Next/step function .*/ + last_state = springIntegrateState(last_state || initState, dt); + /* Store the position. */ + path.push(1 + last_state.x); + time_lapsed += 16; + /* If the change threshold is reached, break. */ + if (!(Math.abs(last_state.x) > tolerance && Math.abs(last_state.v) > tolerance)) { + break; + } + } + + /* If duration is not defined, return the actual time required for completing this animation. Otherwise, return a closure that holds the + computed path and returns a snapshot of the position according to a given percentComplete. */ + return !have_duration ? time_lapsed : function (percentComplete) { + return path[percentComplete * (path.length - 1) | 0]; + }; + }; +}(); + +module.exports = generateSpringRK4; + +/***/ }), +/* 77 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); + +function getEasedValue(type, start, end, percent, easingFn) { + if (percent === 1) { + return end; + } + + var val = easingFn(start, end, percent); + + if (type == null) { + return val; + } + + if (type.roundValue || type.color) { + val = Math.round(val); + } + + if (type.min !== undefined) { + val = Math.max(val, type.min); + } + + if (type.max !== undefined) { + val = Math.min(val, type.max); + } + + return val; +} + +function getValue(prop, spec) { + if (prop.pfValue != null || prop.value != null) { + if (prop.pfValue != null && (spec == null || spec.type.units !== '%')) { + return prop.pfValue; + } else { + return prop.value; + } + } else { + return prop; + } +} + +function ease(startProp, endProp, percent, easingFn, propSpec) { + var type = propSpec != null ? propSpec.type : null; + + if (percent < 0) { + percent = 0; + } else if (percent > 1) { + percent = 1; + } + + var start = getValue(startProp, propSpec); + var end = getValue(endProp, propSpec); + + if (is.number(start) && is.number(end)) { + return getEasedValue(type, start, end, percent, easingFn); + } else if (is.array(start) && is.array(end)) { + var easedArr = []; + + for (var i = 0; i < end.length; i++) { + var si = start[i]; + var ei = end[i]; + + if (si != null && ei != null) { + var val = getEasedValue(type, si, ei, percent, easingFn); + + easedArr.push(val); + } else { + easedArr.push(ei); + } + } + + return easedArr; + } + + return undefined; +} + +module.exports = ease; + +/***/ }), +/* 78 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function startAnimation(self, ani, now, isCore) { + var isEles = !isCore; + var ele = self; + var ani_p = ani._private; + var cy = isCore ? self : self.cy(); + var style = cy.style(); + + if (isEles) { + var pos = ele.position(); + + ani_p.startPosition = ani_p.startPosition || { + x: pos.x, + y: pos.y + }; + + ani_p.startStyle = ani_p.startStyle || style.getAnimationStartStyle(ele, ani_p.style); + } + + if (isCore) { + var pan = cy._private.pan; + + ani_p.startPan = ani_p.startPan || { + x: pan.x, + y: pan.y + }; + + ani_p.startZoom = ani_p.startZoom != null ? ani_p.startZoom : cy._private.zoom; + } + + ani_p.started = true; + ani_p.startTime = now - ani_p.progress * ani_p.duration; +} + +module.exports = startAnimation; + +/***/ }), +/* 79 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Emitter = __webpack_require__(11); +var define = __webpack_require__(4); +var is = __webpack_require__(0); +var util = __webpack_require__(1); +var Selector = __webpack_require__(6); + +var emitterOptions = { + qualifierCompare: function qualifierCompare(selector1, selector2) { + if (selector1 == null || selector2 == null) { + return selector1 == null && selector2 == null; + } else { + return selector1.sameText(selector2); + } + }, + eventMatches: function eventMatches(cy, listener, eventObj) { + var selector = listener.qualifier; + + if (selector != null) { + return cy !== eventObj.target && is.element(eventObj.target) && selector.matches(eventObj.target); + } + + return true; + }, + eventFields: function eventFields(cy) { + return { + cy: cy, + target: cy + }; + }, + callbackContext: function callbackContext(cy, listener, eventObj) { + return listener.qualifier != null ? eventObj.target : cy; + } +}; + +var argSelector = function argSelector(arg) { + if (is.string(arg)) { + return new Selector(arg); + } else { + return arg; + } +}; + +var elesfn = { + createEmitter: function createEmitter() { + var _p = this._private; + + if (!_p.emitter) { + _p.emitter = new Emitter(util.assign({ + context: this + }, emitterOptions)); + } + + return this; + }, + + emitter: function emitter() { + return this._private.emitter; + }, + + on: function on(events, selector, callback) { + this.emitter().on(events, argSelector(selector), callback); + + return this; + }, + + removeListener: function removeListener(events, selector, callback) { + this.emitter().removeListener(events, argSelector(selector), callback); + + return this; + }, + + one: function one(events, selector, callback) { + this.emitter().one(events, argSelector(selector), callback); + + return this; + }, + + once: function once(events, selector, callback) { + this.emitter().one(events, argSelector(selector), callback); + + return this; + }, + + emit: function emit(events, extraParams) { + this.emitter().emit(events, extraParams); + + return this; + } +}; + +define.eventAliasesOn(elesfn); + +module.exports = elesfn; + +/***/ }), +/* 80 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var corefn = { + + png: function png(options) { + var renderer = this._private.renderer; + options = options || {}; + + return renderer.png(options); + }, + + jpg: function jpg(options) { + var renderer = this._private.renderer; + options = options || {}; + + options.bg = options.bg || '#fff'; + + return renderer.jpg(options); + } + +}; + +corefn.jpeg = corefn.jpg; + +module.exports = corefn; + +/***/ }), +/* 81 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var is = __webpack_require__(0); + +var corefn = { + + layout: function layout(options) { + var cy = this; + + if (options == null) { + util.error('Layout options must be specified to make a layout'); + return; + } + + if (options.name == null) { + util.error('A `name` must be specified to make a layout'); + return; + } + + var name = options.name; + var Layout = cy.extension('layout', name); + + if (Layout == null) { + util.error('Can not apply layout: No such layout `' + name + '` found; did you include its JS file?'); + return; + } + + var eles = void 0; + if (is.string(options.eles)) { + eles = cy.$(options.eles); + } else { + eles = options.eles != null ? options.eles : cy.$(); + } + + var layout = new Layout(util.extend({}, options, { + cy: cy, + eles: eles + })); + + return layout; + } + +}; + +corefn.createLayout = corefn.makeLayout = corefn.layout; + +module.exports = corefn; + +/***/ }), +/* 82 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var corefn = { + notify: function notify(params) { + var _p = this._private; + + if (_p.batchingNotify) { + var bEles = _p.batchNotifyEles; + var bTypes = _p.batchNotifyTypes; + + if (params.eles) { + bEles.merge(params.eles); + } + + if (!bTypes.ids[params.type]) { + bTypes.push(params.type); + bTypes.ids[params.type] = true; + } + + return; // notifications are disabled during batching + } + + if (!_p.notificationsEnabled) { + return; + } // exit on disabled + + var renderer = this.renderer(); + + // exit if destroy() called on core or renderer in between frames #1499 #1528 + if (this.isDestroyed() || !renderer) { + return; + } + + renderer.notify(params); + }, + + notifications: function notifications(bool) { + var p = this._private; + + if (bool === undefined) { + return p.notificationsEnabled; + } else { + p.notificationsEnabled = bool ? true : false; + } + }, + + noNotifications: function noNotifications(callback) { + this.notifications(false); + callback(); + this.notifications(true); + }, + + batching: function batching() { + return this._private.batchCount > 0; + }, + + startBatch: function startBatch() { + var _p = this._private; + + if (_p.batchCount == null) { + _p.batchCount = 0; + } + + if (_p.batchCount === 0) { + _p.batchingStyle = _p.batchingNotify = true; + _p.batchStyleEles = this.collection(); + _p.batchNotifyEles = this.collection(); + _p.batchNotifyTypes = []; + _p.batchNotifyTypes.ids = {}; + } + + _p.batchCount++; + + return this; + }, + + endBatch: function endBatch() { + var _p = this._private; + + _p.batchCount--; + + if (_p.batchCount === 0) { + // update style for dirty eles + _p.batchingStyle = false; + _p.batchStyleEles.updateStyle(); + + // notify the renderer of queued eles and event types + _p.batchingNotify = false; + this.notify({ + type: _p.batchNotifyTypes, + eles: _p.batchNotifyEles + }); + } + + return this; + }, + + batch: function batch(callback) { + this.startBatch(); + callback(); + this.endBatch(); + + return this; + }, + + // for backwards compatibility + batchData: function batchData(map) { + var cy = this; + + return this.batch(function () { + var ids = Object.keys(map); + + for (var i = 0; i < ids.length; i++) { + var id = ids[i]; + var data = map[id]; + var ele = cy.getElementById(id); + + ele.data(data); + } + }); + } +}; + +module.exports = corefn; + +/***/ }), +/* 83 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); + +var corefn = { + + renderTo: function renderTo(context, zoom, pan, pxRatio) { + var r = this._private.renderer; + + r.renderTo(context, zoom, pan, pxRatio); + return this; + }, + + renderer: function renderer() { + return this._private.renderer; + }, + + forceRender: function forceRender() { + this.notify({ + type: 'draw' + }); + + return this; + }, + + resize: function resize() { + this.invalidateSize(); + + this.notify({ + type: 'resize' + }); + + this.emit('resize'); + + return this; + }, + + initRenderer: function initRenderer(options) { + var cy = this; + + var RendererProto = cy.extension('renderer', options.name); + if (RendererProto == null) { + util.error('Can not initialise: No such renderer `%s` found; did you include its JS file?', options.name); + return; + } + + cy._private.renderer = new RendererProto(util.extend({}, options, { cy: cy })); + + this.notify({ type: 'init' }); + }, + + destroyRenderer: function destroyRenderer() { + var cy = this; + + cy.notify({ type: 'destroy' }); // destroy the renderer + + var domEle = cy.container(); + if (domEle) { + domEle._cyreg = null; + + while (domEle.childNodes.length > 0) { + domEle.removeChild(domEle.childNodes[0]); + } + } + + cy._private.renderer = null; // to be extra safe, remove the ref + }, + + onRender: function onRender(fn) { + return this.on('render', fn); + }, + + offRender: function offRender(fn) { + return this.off('render', fn); + } + +}; + +corefn.invalidateDimensions = corefn.resize; + +module.exports = corefn; + +/***/ }), +/* 84 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var Collection = __webpack_require__(7); + +var corefn = { + + // get a collection + // - empty collection on no args + // - collection of elements in the graph on selector arg + // - guarantee a returned collection when elements or collection specified + collection: function collection(eles, opts) { + + if (is.string(eles)) { + return this.$(eles); + } else if (is.elementOrCollection(eles)) { + return eles.collection(); + } else if (is.array(eles)) { + return new Collection(this, eles, opts); + } + + return new Collection(this); + }, + + nodes: function nodes(selector) { + var nodes = this.$(function (ele) { + return ele.isNode(); + }); + + if (selector) { + return nodes.filter(selector); + } + + return nodes; + }, + + edges: function edges(selector) { + var edges = this.$(function (ele) { + return ele.isEdge(); + }); + + if (selector) { + return edges.filter(selector); + } + + return edges; + }, + + // search the graph like jQuery + $: function $(selector) { + var eles = this._private.elements; + + if (selector) { + return eles.filter(selector); + } else { + return eles.spawnSelf(); + } + }, + + mutableElements: function mutableElements() { + return this._private.elements; + } + +}; + +// aliases +corefn.elements = corefn.filter = corefn.$; + +module.exports = corefn; + +/***/ }), +/* 85 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var Style = __webpack_require__(18); + +var corefn = { + + style: function style(newStyle) { + if (newStyle) { + var s = this.setStyle(newStyle); + + s.update(); + } + + return this._private.style; + }, + + setStyle: function setStyle(style) { + var _p = this._private; + + if (is.stylesheet(style)) { + _p.style = style.generateStyle(this); + } else if (is.array(style)) { + _p.style = Style.fromJson(this, style); + } else if (is.string(style)) { + _p.style = Style.fromString(this, style); + } else { + _p.style = Style(this); + } + + return _p.style; + } +}; + +module.exports = corefn; + +/***/ }), +/* 86 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var is = __webpack_require__(0); +var Promise = __webpack_require__(5); + +var styfn = {}; + +// (potentially expensive calculation) +// apply the style to the element based on +// - its bypass +// - what selectors match it +styfn.apply = function (eles) { + var self = this; + var _p = self._private; + var cy = _p.cy; + var updatedEles = cy.collection(); + + if (_p.newStyle) { + // clear style caches + _p.contextStyles = {}; + _p.propDiffs = {}; + + self.cleanElements(eles, true); + } + + for (var ie = 0; ie < eles.length; ie++) { + var ele = eles[ie]; + + var cxtMeta = self.getContextMeta(ele); + + if (cxtMeta.empty) { + continue; + } else { + updatedEles.merge(ele); + } + + var cxtStyle = self.getContextStyle(cxtMeta); + var app = self.applyContextStyle(cxtMeta, cxtStyle, ele); + + if (!_p.newStyle) { + self.updateTransitions(ele, app.diffProps); + } + + self.updateStyleHints(ele); + } // for elements + + _p.newStyle = false; + + return updatedEles; +}; + +styfn.getPropertiesDiff = function (oldCxtKey, newCxtKey) { + var self = this; + var cache = self._private.propDiffs = self._private.propDiffs || {}; + var dualCxtKey = oldCxtKey + '-' + newCxtKey; + var cachedVal = cache[dualCxtKey]; + + if (cachedVal) { + return cachedVal; + } + + var diffProps = []; + var addedProp = {}; + + for (var i = 0; i < self.length; i++) { + var cxt = self[i]; + var oldHasCxt = oldCxtKey[i] === 't'; + var newHasCxt = newCxtKey[i] === 't'; + var cxtHasDiffed = oldHasCxt !== newHasCxt; + var cxtHasMappedProps = cxt.mappedProperties.length > 0; + + if (cxtHasDiffed || cxtHasMappedProps) { + var props = void 0; + + if (cxtHasDiffed && cxtHasMappedProps) { + props = cxt.properties; // suffices b/c mappedProperties is a subset of properties + } else if (cxtHasDiffed) { + props = cxt.properties; // need to check them all + } else if (cxtHasMappedProps) { + props = cxt.mappedProperties; // only need to check mapped + } + + for (var j = 0; j < props.length; j++) { + var prop = props[j]; + var name = prop.name; + + // if a later context overrides this property, then the fact that this context has switched/diffed doesn't matter + // (semi expensive check since it makes this function O(n^2) on context length, but worth it since overall result + // is cached) + var laterCxtOverrides = false; + for (var k = i + 1; k < self.length; k++) { + var laterCxt = self[k]; + var hasLaterCxt = newCxtKey[k] === 't'; + + if (!hasLaterCxt) { + continue; + } // can't override unless the context is active + + laterCxtOverrides = laterCxt.properties[prop.name] != null; + + if (laterCxtOverrides) { + break; + } // exit early as long as one later context overrides + } + + if (!addedProp[name] && !laterCxtOverrides) { + addedProp[name] = true; + diffProps.push(name); + } + } // for props + } // if + } // for contexts + + cache[dualCxtKey] = diffProps; + return diffProps; +}; + +styfn.getContextMeta = function (ele) { + var self = this; + var cxtKey = ''; + var diffProps = void 0; + var prevKey = ele._private.styleCxtKey || ''; + + if (self._private.newStyle) { + prevKey = ''; // since we need to apply all style if a fresh stylesheet + } + + // get the cxt key + for (var i = 0; i < self.length; i++) { + var context = self[i]; + var contextSelectorMatches = context.selector && context.selector.matches(ele); // NB: context.selector may be null for 'core' + + if (contextSelectorMatches) { + cxtKey += 't'; + } else { + cxtKey += 'f'; + } + } // for context + + diffProps = self.getPropertiesDiff(prevKey, cxtKey); + + ele._private.styleCxtKey = cxtKey; + + return { + key: cxtKey, + diffPropNames: diffProps, + empty: diffProps.length === 0 + }; +}; + +// gets a computed ele style object based on matched contexts +styfn.getContextStyle = function (cxtMeta) { + var cxtKey = cxtMeta.key; + var self = this; + var cxtStyles = this._private.contextStyles = this._private.contextStyles || {}; + + // if already computed style, returned cached copy + if (cxtStyles[cxtKey]) { + return cxtStyles[cxtKey]; + } + + var style = { + _private: { + key: cxtKey + } + }; + + for (var i = 0; i < self.length; i++) { + var cxt = self[i]; + var hasCxt = cxtKey[i] === 't'; + + if (!hasCxt) { + continue; + } + + for (var j = 0; j < cxt.properties.length; j++) { + var prop = cxt.properties[j]; + + style[prop.name] = prop; + } + } + + cxtStyles[cxtKey] = style; + return style; +}; + +styfn.applyContextStyle = function (cxtMeta, cxtStyle, ele) { + var self = this; + var diffProps = cxtMeta.diffPropNames; + var retDiffProps = {}; + + for (var i = 0; i < diffProps.length; i++) { + var diffPropName = diffProps[i]; + var cxtProp = cxtStyle[diffPropName]; + var eleProp = ele.pstyle(diffPropName); + + if (!cxtProp) { + // no context prop means delete + if (!eleProp) { + continue; // no existing prop means nothing needs to be removed + // nb affects initial application on mapped values like control-point-distances + } else if (eleProp.bypass) { + cxtProp = { name: diffPropName, deleteBypassed: true }; + } else { + cxtProp = { name: diffPropName, delete: true }; + } + } + + // save cycles when the context prop doesn't need to be applied + if (eleProp === cxtProp) { + continue; + } + + var retDiffProp = retDiffProps[diffPropName] = { + prev: eleProp + }; + + self.applyParsedProperty(ele, cxtProp); + + retDiffProp.next = ele.pstyle(diffPropName); + + if (retDiffProp.next && retDiffProp.next.bypass) { + retDiffProp.next = retDiffProp.next.bypassed; + } + } + + return { + diffProps: retDiffProps + }; +}; + +styfn.updateStyleHints = function (ele) { + var _p = ele._private; + var self = this; + + if (ele.removed()) { + return; + } + + // set whether has pie or not; for greater efficiency + var hasPie = false; + if (_p.group === 'nodes') { + for (var i = 1; i <= self.pieBackgroundN; i++) { + // 1..N + var _size = ele.pstyle('pie-' + i + '-background-size').value; + + if (_size > 0) { + hasPie = true; + break; + } + } + } + + _p.hasPie = hasPie; + + var transform = ele.pstyle('text-transform').strValue; + var content = ele.pstyle('label').strValue; + var srcContent = ele.pstyle('source-label').strValue; + var tgtContent = ele.pstyle('target-label').strValue; + var fStyle = ele.pstyle('font-style').strValue; + var size = ele.pstyle('font-size').pfValue + 'px'; + var family = ele.pstyle('font-family').strValue; + // let letiant = style['font-letiant'].strValue; + var weight = ele.pstyle('font-weight').strValue; + var valign = ele.pstyle('text-valign').strValue; + var halign = ele.pstyle('text-valign').strValue; + var oWidth = ele.pstyle('text-outline-width').pfValue; + var wrap = ele.pstyle('text-wrap').strValue; + var wrapW = ele.pstyle('text-max-width').pfValue; + var labelStyleKey = fStyle + '$' + size + '$' + family + '$' + weight + '$' + transform + '$' + valign + '$' + halign + '$' + oWidth + '$' + wrap + '$' + wrapW; + _p.labelStyleKey = labelStyleKey; + _p.sourceLabelKey = labelStyleKey + '$' + srcContent; + _p.targetLabelKey = labelStyleKey + '$' + tgtContent; + _p.labelKey = labelStyleKey + '$' + content; + _p.fontKey = fStyle + '$' + weight + '$' + size + '$' + family; + + _p.styleKey = Date.now(); +}; + +// apply a property to the style (for internal use) +// returns whether application was successful +// +// now, this function flattens the property, and here's how: +// +// for parsedProp:{ bypass: true, deleteBypass: true } +// no property is generated, instead the bypass property in the +// element's style is replaced by what's pointed to by the `bypassed` +// field in the bypass property (i.e. restoring the property the +// bypass was overriding) +// +// for parsedProp:{ mapped: truthy } +// the generated flattenedProp:{ mapping: prop } +// +// for parsedProp:{ bypass: true } +// the generated flattenedProp:{ bypassed: parsedProp } +styfn.applyParsedProperty = function (ele, parsedProp) { + var self = this; + var prop = parsedProp; + var style = ele._private.style; + var fieldVal = void 0, + flatProp = void 0; + var types = self.types; + var type = self.properties[prop.name].type; + var propIsBypass = prop.bypass; + var origProp = style[prop.name]; + var origPropIsBypass = origProp && origProp.bypass; + var _p = ele._private; + var flatPropMapping = 'mapping'; + + var checkZOrder = function checkZOrder() { + self.checkZOrderTrigger(ele, prop.name, origProp ? origProp.value : null, prop.value); + }; + + // edges connected to compound nodes can not be haystacks + if (parsedProp.name === 'curve-style' && parsedProp.value === 'haystack' && ele.isEdge() && (ele.isLoop() || ele.source().isParent() || ele.target().isParent())) { + prop = parsedProp = this.parse(parsedProp.name, 'bezier', propIsBypass); + } + + if (prop.delete) { + // delete the property and use the default value on falsey value + style[prop.name] = undefined; + + checkZOrder(); + + return true; + } + + if (prop.deleteBypassed) { + // delete the property that the + if (!origProp) { + checkZOrder(); + + return true; // can't delete if no prop + } else if (origProp.bypass) { + // delete bypassed + origProp.bypassed = undefined; + + checkZOrder(); + + return true; + } else { + return false; // we're unsuccessful deleting the bypassed + } + } + + // check if we need to delete the current bypass + if (prop.deleteBypass) { + // then this property is just here to indicate we need to delete + if (!origProp) { + checkZOrder(); + + return true; // property is already not defined + } else if (origProp.bypass) { + // then replace the bypass property with the original + // because the bypassed property was already applied (and therefore parsed), we can just replace it (no reapplying necessary) + style[prop.name] = origProp.bypassed; + + checkZOrder(); + + return true; + } else { + return false; // we're unsuccessful deleting the bypass + } + } + + var printMappingErr = function printMappingErr() { + util.error('Do not assign mappings to elements without corresponding data (e.g. ele `' + ele.id() + '` for property `' + prop.name + '` with data field `' + prop.field + '`); try a `[' + prop.field + ']` selector to limit scope to elements with `' + prop.field + '` defined'); + }; + + // put the property in the style objects + switch (prop.mapped) {// flatten the property if mapped + case types.mapData: + { + // flatten the field (e.g. data.foo.bar) + var fields = prop.field.split('.'); + var _fieldVal = _p.data; + + for (var i = 0; i < fields.length && _fieldVal; i++) { + var field = fields[i]; + _fieldVal = _fieldVal[field]; + } + + var percent = void 0; + if (!is.number(_fieldVal)) { + // then keep the mapping but assume 0% for now + percent = 0; + } else { + percent = (_fieldVal - prop.fieldMin) / (prop.fieldMax - prop.fieldMin); + } + + // make sure to bound percent value + if (percent < 0) { + percent = 0; + } else if (percent > 1) { + percent = 1; + } + + if (type.color) { + var r1 = prop.valueMin[0]; + var r2 = prop.valueMax[0]; + var g1 = prop.valueMin[1]; + var g2 = prop.valueMax[1]; + var b1 = prop.valueMin[2]; + var b2 = prop.valueMax[2]; + var a1 = prop.valueMin[3] == null ? 1 : prop.valueMin[3]; + var a2 = prop.valueMax[3] == null ? 1 : prop.valueMax[3]; + + var clr = [Math.round(r1 + (r2 - r1) * percent), Math.round(g1 + (g2 - g1) * percent), Math.round(b1 + (b2 - b1) * percent), Math.round(a1 + (a2 - a1) * percent)]; + + flatProp = { // colours are simple, so just create the flat property instead of expensive string parsing + bypass: prop.bypass, // we're a bypass if the mapping property is a bypass + name: prop.name, + value: clr, + strValue: 'rgb(' + clr[0] + ', ' + clr[1] + ', ' + clr[2] + ')' + }; + } else if (type.number) { + var calcValue = prop.valueMin + (prop.valueMax - prop.valueMin) * percent; + flatProp = this.parse(prop.name, calcValue, prop.bypass, flatPropMapping); + } else { + return false; // can only map to colours and numbers + } + + if (!flatProp) { + // if we can't flatten the property, then use the origProp so we still keep the mapping itself + flatProp = this.parse(prop.name, origProp.strValue, prop.bypass, flatPropMapping); + } + + if (!flatProp) { + printMappingErr(); + } + flatProp.mapping = prop; // keep a reference to the mapping + prop = flatProp; // the flattened (mapped) property is the one we want + + break; + } + + // direct mapping + case types.data: + { + // flatten the field (e.g. data.foo.bar) + var _fields = prop.field.split('.'); + var _fieldVal2 = _p.data; + + if (_fieldVal2) { + for (var _i = 0; _i < _fields.length; _i++) { + var _field = _fields[_i]; + _fieldVal2 = _fieldVal2[_field]; + } + } + + flatProp = this.parse(prop.name, _fieldVal2, prop.bypass, flatPropMapping); + + if (!flatProp) { + // if we can't flatten the property, then use the origProp so we still keep the mapping itself + var flatPropVal = origProp ? origProp.strValue : ''; + + flatProp = this.parse(prop.name, flatPropVal, prop.bypass, flatPropMapping); + } + + if (!flatProp) { + printMappingErr(); + } + flatProp.mapping = prop; // keep a reference to the mapping + prop = flatProp; // the flattened (mapped) property is the one we want + + break; + } + + case types.fn: + { + var fn = prop.value; + var fnRetVal = fn(ele); + + flatProp = this.parse(prop.name, fnRetVal, prop.bypass, flatPropMapping); + flatProp.mapping = prop; // keep a reference to the mapping + prop = flatProp; // the flattened (mapped) property is the one we want + + break; + } + + case undefined: + break; // just set the property + + default: + return false; // not a valid mapping + } + + // if the property is a bypass property, then link the resultant property to the original one + if (propIsBypass) { + if (origPropIsBypass) { + // then this bypass overrides the existing one + prop.bypassed = origProp.bypassed; // steal bypassed prop from old bypass + } else { + // then link the orig prop to the new bypass + prop.bypassed = origProp; + } + + style[prop.name] = prop; // and set + } else { + // prop is not bypass + if (origPropIsBypass) { + // then keep the orig prop (since it's a bypass) and link to the new prop + origProp.bypassed = prop; + } else { + // then just replace the old prop with the new one + style[prop.name] = prop; + } + } + + checkZOrder(); + + return true; +}; + +styfn.cleanElements = function (eles, keepBypasses) { + var self = this; + var props = self.properties; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + + if (!keepBypasses) { + ele._private.style = {}; + } else { + var style = ele._private.style; + + for (var j = 0; j < props.length; j++) { + var prop = props[j]; + var eleProp = style[prop.name]; + + if (eleProp) { + if (eleProp.bypass) { + eleProp.bypassed = null; + } else { + style[prop.name] = null; + } + } + } + } + } +}; + +// updates the visual style for all elements (useful for manual style modification after init) +styfn.update = function () { + var cy = this._private.cy; + var eles = cy.mutableElements(); + + eles.updateStyle(); +}; + +// just update the functional properties (i.e. mappings) in the elements' +// styles (less expensive than recalculation) +styfn.updateMappers = function (eles) { + var self = this; + var cy = this._private.cy; + var updatedEles = cy.collection(); + + for (var i = 0; i < eles.length; i++) { + // for each ele + var ele = eles[i]; + var style = ele._private.style; + var updatedEle = false; + + for (var j = 0; j < self.properties.length; j++) { + // for each prop + var prop = self.properties[j]; + var propInStyle = style[prop.name]; + + if (propInStyle && propInStyle.mapping) { + var mapping = propInStyle.mapping; + + this.applyParsedProperty(ele, mapping); // reapply the mapping property + + updatedEle = true; + } + } + + if (updatedEle) { + this.updateStyleHints(ele); + + updatedEles.merge(ele); + } + } + + return updatedEles; +}; + +// diffProps : { name => { prev, next } } +styfn.updateTransitions = function (ele, diffProps, isBypass) { + var self = this; + var _p = ele._private; + var props = ele.pstyle('transition-property').value; + var duration = ele.pstyle('transition-duration').pfValue; + var delay = ele.pstyle('transition-delay').pfValue; + + if (props.length > 0 && duration > 0) { + + var style = {}; + + // build up the style to animate towards + var anyPrev = false; + for (var i = 0; i < props.length; i++) { + var prop = props[i]; + var styProp = ele.pstyle(prop); + var diffProp = diffProps[prop]; + + if (!diffProp) { + continue; + } + + var prevProp = diffProp.prev; + var fromProp = prevProp; + var toProp = diffProp.next != null ? diffProp.next : styProp; + var diff = false; + var initVal = void 0; + var initDt = 0.000001; // delta time % value for initVal (allows animating out of init zero opacity) + + if (!fromProp) { + continue; + } + + // consider px values + if (is.number(fromProp.pfValue) && is.number(toProp.pfValue)) { + diff = toProp.pfValue - fromProp.pfValue; // nonzero is truthy + initVal = fromProp.pfValue + initDt * diff; + + // consider numerical values + } else if (is.number(fromProp.value) && is.number(toProp.value)) { + diff = toProp.value - fromProp.value; // nonzero is truthy + initVal = fromProp.value + initDt * diff; + + // consider colour values + } else if (is.array(fromProp.value) && is.array(toProp.value)) { + diff = fromProp.value[0] !== toProp.value[0] || fromProp.value[1] !== toProp.value[1] || fromProp.value[2] !== toProp.value[2]; + + initVal = fromProp.strValue; + } + + // the previous value is good for an animation only if it's different + if (diff) { + style[prop] = toProp.strValue; // to val + this.applyBypass(ele, prop, initVal); // from val + anyPrev = true; + } + } // end if props allow ani + + // can't transition if there's nothing previous to transition from + if (!anyPrev) { + return; + } + + _p.transitioning = true; + + new Promise(function (resolve) { + if (delay > 0) { + ele.delayAnimation(delay).play().promise().then(resolve); + } else { + resolve(); + } + }).then(function () { + return ele.animation({ + style: style, + duration: duration, + easing: ele.pstyle('transition-timing-function').value, + queue: false + }).play().promise(); + }).then(function () { + // if( !isBypass ){ + self.removeBypasses(ele, props); + ele.emitAndNotify('style'); + // } + + _p.transitioning = false; + }); + } else if (_p.transitioning) { + this.removeBypasses(ele, props); + ele.emitAndNotify('style'); + + _p.transitioning = false; + } +}; + +styfn.checkZOrderTrigger = function (ele, name, fromValue, toValue) { + var prop = this.properties[name]; + + if (prop.triggersZOrder != null && (fromValue == null || prop.triggersZOrder(fromValue, toValue))) { + this._private.cy.notify({ + type: 'zorder', + eles: ele + }); + } +}; + +module.exports = styfn; + +/***/ }), +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var util = __webpack_require__(1); + +var styfn = {}; + +// bypasses are applied to an existing style on an element, and just tacked on temporarily +// returns true iff application was successful for at least 1 specified property +styfn.applyBypass = function (eles, name, value, updateTransitions) { + var self = this; + var props = []; + var isBypass = true; + + // put all the properties (can specify one or many) in an array after parsing them + if (name === '*' || name === '**') { + // apply to all property names + + if (value !== undefined) { + for (var i = 0; i < self.properties.length; i++) { + var prop = self.properties[i]; + var _name = prop.name; + + var parsedProp = this.parse(_name, value, true); + + if (parsedProp) { + props.push(parsedProp); + } + } + } + } else if (is.string(name)) { + // then parse the single property + var _parsedProp = this.parse(name, value, true); + + if (_parsedProp) { + props.push(_parsedProp); + } + } else if (is.plainObject(name)) { + // then parse each property + var specifiedProps = name; + updateTransitions = value; + + var names = Object.keys(specifiedProps); + + for (var _i = 0; _i < names.length; _i++) { + var _name2 = names[_i]; + var _prop = self.properties[_name2]; + var _value = specifiedProps[_name2]; + + if (_value === undefined) { + // try camel case name too + _value = specifiedProps[util.dash2camel(_name2)]; + } + + if (_value !== undefined) { + var _parsedProp2 = this.parse(_name2, _value, true); + + if (_parsedProp2) { + props.push(_parsedProp2); + } + } + } + } else { + // can't do anything without well defined properties + return false; + } + + // we've failed if there are no valid properties + if (props.length === 0) { + return false; + } + + // now, apply the bypass properties on the elements + var ret = false; // return true if at least one succesful bypass applied + for (var _i2 = 0; _i2 < eles.length; _i2++) { + // for each ele + var ele = eles[_i2]; + var diffProps = {}; + var diffProp = void 0; + + for (var j = 0; j < props.length; j++) { + // for each prop + var _prop2 = props[j]; + + if (updateTransitions) { + var prevProp = ele.pstyle(_prop2.name); + diffProp = diffProps[_prop2.name] = { prev: prevProp }; + } + + ret = this.applyParsedProperty(ele, _prop2) || ret; + + if (updateTransitions) { + diffProp.next = ele.pstyle(_prop2.name); + } + } // for props + + if (ret) { + this.updateStyleHints(ele); + } + + if (updateTransitions) { + this.updateTransitions(ele, diffProps, isBypass); + } + } // for eles + + return ret; +}; + +// only useful in specific cases like animation +styfn.overrideBypass = function (eles, name, value) { + name = util.camel2dash(name); + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + var prop = ele._private.style[name]; + var type = this.properties[name].type; + var isColor = type.color; + var isMulti = type.mutiple; + + if (!prop || !prop.bypass) { + // need a bypass if one doesn't exist + this.applyBypass(ele, name, value); + continue; + } + + var oldValue = prop.pfValue != null ? prop.pfValue : prop.value; + + prop.value = value; + + if (prop.pfValue != null) { + prop.pfValue = value; + } + + if (isColor) { + prop.strValue = 'rgb(' + value.join(',') + ')'; + } else if (isMulti) { + prop.strValue = value.join(' '); + } else { + prop.strValue = '' + value; + } + + this.checkZOrderTrigger(ele, name, oldValue, value); + } +}; + +styfn.removeAllBypasses = function (eles, updateTransitions) { + return this.removeBypasses(eles, this.propertyNames, updateTransitions); +}; + +styfn.removeBypasses = function (eles, props, updateTransitions) { + var isBypass = true; + + for (var j = 0; j < eles.length; j++) { + var ele = eles[j]; + var diffProps = {}; + + for (var i = 0; i < props.length; i++) { + var name = props[i]; + var prop = this.properties[name]; + var prevProp = ele.pstyle(prop.name); + + if (!prevProp || !prevProp.bypass) { + // if a bypass doesn't exist for the prop, nothing needs to be removed + continue; + } + + var value = ''; // empty => remove bypass + var parsedProp = this.parse(name, value, true); + var diffProp = diffProps[prop.name] = { prev: prevProp }; + + this.applyParsedProperty(ele, parsedProp); + + diffProp.next = ele.pstyle(prop.name); + } // for props + + this.updateStyleHints(ele); + + if (updateTransitions) { + this.updateTransitions(ele, diffProps, isBypass); + } + } // for eles +}; + +module.exports = styfn; + +/***/ }), +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var window = __webpack_require__(3); + +var styfn = {}; + +// gets what an em size corresponds to in pixels relative to a dom element +styfn.getEmSizeInPixels = function () { + var px = this.containerCss('font-size'); + + if (px != null) { + return parseFloat(px); + } else { + return 1; // for headless + } +}; + +// gets css property from the core container +styfn.containerCss = function (propName) { + var cy = this._private.cy; + var domElement = cy.container(); + + if (window && domElement && window.getComputedStyle) { + return window.getComputedStyle(domElement).getPropertyValue(propName); + } +}; + +module.exports = styfn; + +/***/ }), +/* 89 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var is = __webpack_require__(0); + +var styfn = {}; + +// gets the rendered style for an element +styfn.getRenderedStyle = function (ele, prop) { + if (prop) { + return this.getStylePropertyValue(ele, prop, true); + } else { + return this.getRawStyle(ele, true); + } +}; + +// gets the raw style for an element +styfn.getRawStyle = function (ele, isRenderedVal) { + var self = this; + + ele = ele[0]; // insure it's an element + + if (ele) { + var rstyle = {}; + + for (var i = 0; i < self.properties.length; i++) { + var prop = self.properties[i]; + var val = self.getStylePropertyValue(ele, prop.name, isRenderedVal); + + if (val != null) { + rstyle[prop.name] = val; + rstyle[util.dash2camel(prop.name)] = val; + } + } + + return rstyle; + } +}; + +styfn.getIndexedStyle = function (ele, property, subproperty, index) { + var pstyle = ele.pstyle(property)[subproperty][index]; + return pstyle != null ? pstyle : ele.cy().style().getDefaultProperty(property)[subproperty][0]; +}; + +styfn.getStylePropertyValue = function (ele, propName, isRenderedVal) { + var self = this; + + ele = ele[0]; // insure it's an element + + if (ele) { + var prop = self.properties[propName]; + + if (prop.alias) { + prop = prop.pointsTo; + } + + var type = prop.type; + var styleProp = ele.pstyle(prop.name); + var zoom = ele.cy().zoom(); + + if (styleProp) { + var units = styleProp.units ? type.implicitUnits || 'px' : null; + var val = units ? [].concat(styleProp.pfValue).map(function (pfValue) { + return pfValue * (isRenderedVal ? zoom : 1) + units; + }).join(' ') : styleProp.strValue; + + return val; + } + } +}; + +styfn.getAnimationStartStyle = function (ele, aniProps) { + var rstyle = {}; + + for (var i = 0; i < aniProps.length; i++) { + var aniProp = aniProps[i]; + var name = aniProp.name; + + var styleProp = ele.pstyle(name); + + if (styleProp !== undefined) { + // then make a prop of it + if (is.plainObject(styleProp)) { + styleProp = this.parse(name, styleProp.strValue); + } else { + styleProp = this.parse(name, styleProp); + } + } + + if (styleProp) { + rstyle[name] = styleProp; + } + } + + return rstyle; +}; + +styfn.getPropsList = function (propsObj) { + var self = this; + var rstyle = []; + var style = propsObj; + var props = self.properties; + + if (style) { + var names = Object.keys(style); + + for (var i = 0; i < names.length; i++) { + var name = names[i]; + var val = style[name]; + var prop = props[name] || props[util.camel2dash(name)]; + var styleProp = this.parse(prop.name, val); + + if (styleProp) { + rstyle.push(styleProp); + } + } + } + + return rstyle; +}; + +module.exports = styfn; + +/***/ }), +/* 90 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var styfn = {}; + +styfn.appendFromJson = function (json) { + var style = this; + + for (var i = 0; i < json.length; i++) { + var context = json[i]; + var selector = context.selector; + var props = context.style || context.css; + var names = Object.keys(props); + + style.selector(selector); // apply selector + + for (var j = 0; j < names.length; j++) { + var name = names[j]; + var value = props[name]; + + style.css(name, value); // apply property + } + } + + return style; +}; + +// accessible cy.style() function +styfn.fromJson = function (json) { + var style = this; + + style.resetToDefault(); + style.appendFromJson(json); + + return style; +}; + +// get json from cy.style() api +styfn.json = function () { + var json = []; + + for (var i = this.defaultLength; i < this.length; i++) { + var cxt = this[i]; + var selector = cxt.selector; + var props = cxt.properties; + var css = {}; + + for (var j = 0; j < props.length; j++) { + var prop = props[j]; + css[prop.name] = prop.strValue; + } + + json.push({ + selector: !selector ? 'core' : selector.toString(), + style: css + }); + } + + return json; +}; + +module.exports = styfn; + +/***/ }), +/* 91 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var Selector = __webpack_require__(6); + +var styfn = {}; + +styfn.appendFromString = function (string) { + var self = this; + var style = this; + var remaining = '' + string; + var selAndBlockStr = void 0; + var blockRem = void 0; + var propAndValStr = void 0; + + // remove comments from the style string + remaining = remaining.replace(/[/][*](\s|.)+?[*][/]/g, ''); + + function removeSelAndBlockFromRemaining() { + // remove the parsed selector and block from the remaining text to parse + if (remaining.length > selAndBlockStr.length) { + remaining = remaining.substr(selAndBlockStr.length); + } else { + remaining = ''; + } + } + + function removePropAndValFromRem() { + // remove the parsed property and value from the remaining block text to parse + if (blockRem.length > propAndValStr.length) { + blockRem = blockRem.substr(propAndValStr.length); + } else { + blockRem = ''; + } + } + + while (true) { + var nothingLeftToParse = remaining.match(/^\s*$/); + if (nothingLeftToParse) { + break; + } + + var selAndBlock = remaining.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/); + + if (!selAndBlock) { + util.error('Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: ' + remaining); + break; + } + + selAndBlockStr = selAndBlock[0]; + + // parse the selector + var selectorStr = selAndBlock[1]; + if (selectorStr !== 'core') { + var selector = new Selector(selectorStr); + if (selector._private.invalid) { + util.error('Skipping parsing of block: Invalid selector found in string stylesheet: ' + selectorStr); + + // skip this selector and block + removeSelAndBlockFromRemaining(); + continue; + } + } + + // parse the block of properties and values + var blockStr = selAndBlock[2]; + var invalidBlock = false; + blockRem = blockStr; + var props = []; + + while (true) { + var _nothingLeftToParse = blockRem.match(/^\s*$/); + if (_nothingLeftToParse) { + break; + } + + var propAndVal = blockRem.match(/^\s*(.+?)\s*:\s*(.+?)\s*;/); + + if (!propAndVal) { + util.error('Skipping parsing of block: Invalid formatting of style property and value definitions found in:' + blockStr); + invalidBlock = true; + break; + } + + propAndValStr = propAndVal[0]; + var propStr = propAndVal[1]; + var valStr = propAndVal[2]; + + var prop = self.properties[propStr]; + if (!prop) { + util.error('Skipping property: Invalid property name in: ' + propAndValStr); + + // skip this property in the block + removePropAndValFromRem(); + continue; + } + + var parsedProp = style.parse(propStr, valStr); + + if (!parsedProp) { + util.error('Skipping property: Invalid property definition in: ' + propAndValStr); + + // skip this property in the block + removePropAndValFromRem(); + continue; + } + + props.push({ + name: propStr, + val: valStr + }); + removePropAndValFromRem(); + } + + if (invalidBlock) { + removeSelAndBlockFromRemaining(); + break; + } + + // put the parsed block in the style + style.selector(selectorStr); + for (var i = 0; i < props.length; i++) { + var _prop = props[i]; + style.css(_prop.name, _prop.val); + } + + removeSelAndBlockFromRemaining(); + } + + return style; +}; + +styfn.fromString = function (string) { + var style = this; + + style.resetToDefault(); + style.appendFromString(string); + + return style; +}; + +module.exports = styfn; + +/***/ }), +/* 92 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var is = __webpack_require__(0); + +var styfn = {}; + +(function () { + var number = util.regex.number; + var rgba = util.regex.rgbaNoBackRefs; + var hsla = util.regex.hslaNoBackRefs; + var hex3 = util.regex.hex3; + var hex6 = util.regex.hex6; + var data = function data(prefix) { + return '^' + prefix + '\\s*\\(\\s*([\\w\\.]+)\\s*\\)$'; + }; + var mapData = function mapData(prefix) { + var mapArg = number + '|\\w+|' + rgba + '|' + hsla + '|' + hex3 + '|' + hex6; + return '^' + prefix + '\\s*\\(([\\w\\.]+)\\s*\\,\\s*(' + number + ')\\s*\\,\\s*(' + number + ')\\s*,\\s*(' + mapArg + ')\\s*\\,\\s*(' + mapArg + ')\\)$'; + }; + var urlRegexes = ['^url\\s*\\(\\s*[\'"]?(.+?)[\'"]?\\s*\\)$', '^(none)$', '^(.+)$']; + + // each visual style property has a type and needs to be validated according to it + styfn.types = { + time: { number: true, min: 0, units: 's|ms', implicitUnits: 'ms' }, + percent: { number: true, min: 0, max: 100, units: '%', implicitUnits: '%' }, + zeroOneNumber: { number: true, min: 0, max: 1, unitless: true }, + zeroOneNumbers: { number: true, min: 0, max: 1, unitless: true, multiple: true }, + nOneOneNumber: { number: true, min: -1, max: 1, unitless: true }, + nonNegativeInt: { number: true, min: 0, integer: true, unitless: true }, + position: { enums: ['parent', 'origin'] }, + nodeSize: { number: true, min: 0, enums: ['label'] }, + number: { number: true, unitless: true }, + numbers: { number: true, unitless: true, multiple: true }, + positiveNumber: { number: true, unitless: true, min: 0, strictMin: true }, + size: { number: true, min: 0 }, + bidirectionalSize: { number: true }, // allows negative + bidirectionalSizes: { number: true, multiple: true }, // allows negative + sizeMaybePercent: { number: true, min: 0, allowPercent: true }, + paddingRelativeTo: { enums: ['width', 'height', 'average', 'min', 'max'] }, + bgWH: { number: true, min: 0, allowPercent: true, enums: ['auto'], multiple: true }, + bgPos: { number: true, allowPercent: true, multiple: true }, + bgRelativeTo: { enums: ['inner', 'include-padding'], multiple: true }, + bgRepeat: { enums: ['repeat', 'repeat-x', 'repeat-y', 'no-repeat'], multiple: true }, + bgFit: { enums: ['none', 'contain', 'cover'], multiple: true }, + bgCrossOrigin: { enums: ['anonymous', 'use-credentials'], multiple: true }, + bgClip: { enums: ['none', 'node'] }, + color: { color: true }, + bool: { enums: ['yes', 'no'] }, + lineStyle: { enums: ['solid', 'dotted', 'dashed'] }, + borderStyle: { enums: ['solid', 'dotted', 'dashed', 'double'] }, + curveStyle: { enums: ['bezier', 'unbundled-bezier', 'haystack', 'segments'] }, + fontFamily: { regex: '^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$' }, + fontletiant: { enums: ['small-caps', 'normal'] }, + fontStyle: { enums: ['italic', 'normal', 'oblique'] }, + fontWeight: { enums: ['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '800', '900', 100, 200, 300, 400, 500, 600, 700, 800, 900] }, + textDecoration: { enums: ['none', 'underline', 'overline', 'line-through'] }, + textTransform: { enums: ['none', 'uppercase', 'lowercase'] }, + textWrap: { enums: ['none', 'wrap', 'ellipsis'] }, + textBackgroundShape: { enums: ['rectangle', 'roundrectangle'] }, + nodeShape: { enums: ['rectangle', 'roundrectangle', 'cutrectangle', 'bottomroundrectangle', 'barrel', 'ellipse', 'triangle', 'square', 'pentagon', 'hexagon', 'concavehexagon', 'heptagon', 'octagon', 'tag', 'star', 'diamond', 'vee', 'rhomboid', 'polygon'] }, + compoundIncludeLabels: { enums: ['include', 'exclude'] }, + arrowShape: { enums: ['tee', 'triangle', 'triangle-tee', 'triangle-cross', 'triangle-backcurve', 'half-triangle-overshot', 'vee', 'square', 'circle', 'diamond', 'none'] }, + arrowFill: { enums: ['filled', 'hollow'] }, + display: { enums: ['element', 'none'] }, + visibility: { enums: ['hidden', 'visible'] }, + zCompoundDepth: { enums: ['bottom', 'orphan', 'auto', 'top'] }, + zIndexCompare: { enums: ['auto', 'manual'] }, + valign: { enums: ['top', 'center', 'bottom'] }, + halign: { enums: ['left', 'center', 'right'] }, + text: { string: true }, + data: { mapping: true, regex: data('data') }, + layoutData: { mapping: true, regex: data('layoutData') }, + scratch: { mapping: true, regex: data('scratch') }, + mapData: { mapping: true, regex: mapData('mapData') }, + mapLayoutData: { mapping: true, regex: mapData('mapLayoutData') }, + mapScratch: { mapping: true, regex: mapData('mapScratch') }, + fn: { mapping: true, fn: true }, + url: { regexes: urlRegexes, singleRegexMatchValue: true }, + urls: { regexes: urlRegexes, singleRegexMatchValue: true, multiple: true }, + propList: { propList: true }, + angle: { number: true, units: 'deg|rad', implicitUnits: 'rad' }, + textRotation: { number: true, units: 'deg|rad', implicitUnits: 'rad', enums: ['none', 'autorotate'] }, + polygonPointList: { number: true, multiple: true, evenMultiple: true, min: -1, max: 1, unitless: true }, + edgeDistances: { enums: ['intersection', 'node-position'] }, + edgeEndpoint: { + number: true, multiple: true, units: '%|px|em|deg|rad', implicitUnits: 'px', + enums: ['inside-to-node', 'outside-to-node', 'outside-to-line'], singleEnum: true, + validate: function validate(valArr, unitsArr) { + switch (valArr.length) { + case 2: + // can be % or px only + return unitsArr[0] !== 'deg' && unitsArr[0] !== 'rad' && unitsArr[1] !== 'deg' && unitsArr[1] !== 'rad'; + case 1: + // can be enum, deg, or rad only + return is.string(valArr[0]) || unitsArr[0] === 'deg' || unitsArr[0] === 'rad'; + default: + return false; + } + } + }, + easing: { + regexes: ['^(spring)\\s*\\(\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*\\)$', '^(cubic-bezier)\\s*\\(\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*\\)$'], + enums: ['linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out', 'ease-in-sine', 'ease-out-sine', 'ease-in-out-sine', 'ease-in-quad', 'ease-out-quad', 'ease-in-out-quad', 'ease-in-cubic', 'ease-out-cubic', 'ease-in-out-cubic', 'ease-in-quart', 'ease-out-quart', 'ease-in-out-quart', 'ease-in-quint', 'ease-out-quint', 'ease-in-out-quint', 'ease-in-expo', 'ease-out-expo', 'ease-in-out-expo', 'ease-in-circ', 'ease-out-circ', 'ease-in-out-circ'] + } + }; + + var zOrderDiff = { + zeroNonZero: function zeroNonZero(val1, val2) { + if (val1 === 0 && val2 !== 0) { + return true; + } else if (val1 !== 0 && val2 === 0) { + return true; + } else { + return false; + } + }, + anyDiff: function anyDiff(val1, val2) { + return val1 !== val2; + } + }; + + var zd = zOrderDiff; + + // define visual style properties + var t = styfn.types; + var props = styfn.properties = [ + // main label + { name: 'label', type: t.text }, { name: 'text-rotation', type: t.textRotation }, { name: 'text-margin-x', type: t.bidirectionalSize }, { name: 'text-margin-y', type: t.bidirectionalSize }, + + // source label + { name: 'source-label', type: t.text }, { name: 'source-text-rotation', type: t.textRotation }, { name: 'source-text-margin-x', type: t.bidirectionalSize }, { name: 'source-text-margin-y', type: t.bidirectionalSize }, { name: 'source-text-offset', type: t.size }, + + // target label + { name: 'target-label', type: t.text }, { name: 'target-text-rotation', type: t.textRotation }, { name: 'target-text-margin-x', type: t.bidirectionalSize }, { name: 'target-text-margin-y', type: t.bidirectionalSize }, { name: 'target-text-offset', type: t.size }, + + // common label style + { name: 'text-valign', type: t.valign }, { name: 'text-halign', type: t.halign }, { name: 'color', type: t.color }, { name: 'text-outline-color', type: t.color }, { name: 'text-outline-width', type: t.size }, { name: 'text-outline-opacity', type: t.zeroOneNumber }, { name: 'text-opacity', type: t.zeroOneNumber }, { name: 'text-background-color', type: t.color }, { name: 'text-background-opacity', type: t.zeroOneNumber }, { name: 'text-background-padding', type: t.size }, { name: 'text-border-opacity', type: t.zeroOneNumber }, { name: 'text-border-color', type: t.color }, { name: 'text-border-width', type: t.size }, { name: 'text-border-style', type: t.borderStyle }, { name: 'text-background-shape', type: t.textBackgroundShape }, + // { name: 'text-decoration', type: t.textDecoration }, // not supported in canvas + { name: 'text-transform', type: t.textTransform }, { name: 'text-wrap', type: t.textWrap }, { name: 'text-max-width', type: t.size }, { name: 'text-events', type: t.bool }, { name: 'font-family', type: t.fontFamily }, { name: 'font-style', type: t.fontStyle }, + // { name: 'font-letiant', type: t.fontletiant }, // not useful + { name: 'font-weight', type: t.fontWeight }, { name: 'font-size', type: t.size }, { name: 'min-zoomed-font-size', type: t.size }, + + // behaviour + { name: 'events', type: t.bool }, + + // visibility + { name: 'display', type: t.display, triggersZOrder: zd.anyDiff }, { name: 'visibility', type: t.visibility, triggersZOrder: zd.anyDiff }, { name: 'opacity', type: t.zeroOneNumber, triggersZOrder: zd.zeroNonZero }, { name: 'z-compound-depth', type: t.zCompoundDepth, triggersZOrder: zd.anyDiff }, { name: 'z-index-compare', type: t.zIndexCompare, triggersZOrder: zd.anyDiff }, { name: 'z-index', type: t.nonNegativeInt, triggersZOrder: zd.anyDiff }, + + // overlays + { name: 'overlay-padding', type: t.size }, { name: 'overlay-color', type: t.color }, { name: 'overlay-opacity', type: t.zeroOneNumber }, + + // transition anis + { name: 'transition-property', type: t.propList }, { name: 'transition-duration', type: t.time }, { name: 'transition-delay', type: t.time }, { name: 'transition-timing-function', type: t.easing }, + + // node body + { name: 'height', type: t.nodeSize }, { name: 'width', type: t.nodeSize }, { name: 'shape', type: t.nodeShape }, { name: 'shape-polygon-points', type: t.polygonPointList }, { name: 'background-color', type: t.color }, { name: 'background-opacity', type: t.zeroOneNumber }, { name: 'background-blacken', type: t.nOneOneNumber }, { name: 'padding', type: t.sizeMaybePercent }, { name: 'padding-relative-to', type: t.paddingRelativeTo }, + + // node border + { name: 'border-color', type: t.color }, { name: 'border-opacity', type: t.zeroOneNumber }, { name: 'border-width', type: t.size }, { name: 'border-style', type: t.borderStyle }, + + // node background images + { name: 'background-image', type: t.urls }, { name: 'background-image-crossorigin', type: t.bgCrossOrigin }, { name: 'background-image-opacity', type: t.zeroOneNumbers }, { name: 'background-position-x', type: t.bgPos }, { name: 'background-position-y', type: t.bgPos }, { name: 'background-width-relative-to', type: t.bgRelativeTo }, { name: 'background-height-relative-to', type: t.bgRelativeTo }, { name: 'background-repeat', type: t.bgRepeat }, { name: 'background-fit', type: t.bgFit }, { name: 'background-clip', type: t.bgClip }, { name: 'background-width', type: t.bgWH }, { name: 'background-height', type: t.bgWH }, + + // compound props + { name: 'position', type: t.position }, { name: 'compound-sizing-wrt-labels', type: t.compoundIncludeLabels }, { name: 'min-width', type: t.size }, { name: 'min-width-bias-left', type: t.sizeMaybePercent }, { name: 'min-width-bias-right', type: t.sizeMaybePercent }, { name: 'min-height', type: t.size }, { name: 'min-height-bias-top', type: t.sizeMaybePercent }, { name: 'min-height-bias-bottom', type: t.sizeMaybePercent }, + + // edge line + { name: 'line-style', type: t.lineStyle }, { name: 'line-color', type: t.color }, { name: 'curve-style', type: t.curveStyle }, { name: 'haystack-radius', type: t.zeroOneNumber }, { name: 'source-endpoint', type: t.edgeEndpoint }, { name: 'target-endpoint', type: t.edgeEndpoint }, { name: 'control-point-step-size', type: t.size }, { name: 'control-point-distances', type: t.bidirectionalSizes }, { name: 'control-point-weights', type: t.numbers }, { name: 'segment-distances', type: t.bidirectionalSizes }, { name: 'segment-weights', type: t.numbers }, { name: 'edge-distances', type: t.edgeDistances }, { name: 'arrow-scale', type: t.positiveNumber }, { name: 'loop-direction', type: t.angle }, { name: 'loop-sweep', type: t.angle }, { name: 'source-distance-from-node', type: t.size }, { name: 'target-distance-from-node', type: t.size }, + + // ghost properties + { name: 'ghost', type: t.bool }, { name: 'ghost-offset-x', type: t.bidirectionalSize }, { name: 'ghost-offset-y', type: t.bidirectionalSize }, { name: 'ghost-opacity', type: t.zeroOneNumber }, + + // these are just for the core + { name: 'selection-box-color', type: t.color }, { name: 'selection-box-opacity', type: t.zeroOneNumber }, { name: 'selection-box-border-color', type: t.color }, { name: 'selection-box-border-width', type: t.size }, { name: 'active-bg-color', type: t.color }, { name: 'active-bg-opacity', type: t.zeroOneNumber }, { name: 'active-bg-size', type: t.size }, { name: 'outside-texture-bg-color', type: t.color }, { name: 'outside-texture-bg-opacity', type: t.zeroOneNumber }]; + + // define aliases + var aliases = styfn.aliases = [{ name: 'content', pointsTo: 'label' }, { name: 'control-point-distance', pointsTo: 'control-point-distances' }, { name: 'control-point-weight', pointsTo: 'control-point-weights' }, { name: 'edge-text-rotation', pointsTo: 'text-rotation' }, { name: 'padding-left', pointsTo: 'padding' }, { name: 'padding-right', pointsTo: 'padding' }, { name: 'padding-top', pointsTo: 'padding' }, { name: 'padding-bottom', pointsTo: 'padding' }]; + + // pie backgrounds for nodes + styfn.pieBackgroundN = 16; // because the pie properties are numbered, give access to a constant N (for renderer use) + props.push({ name: 'pie-size', type: t.sizeMaybePercent }); + for (var i = 1; i <= styfn.pieBackgroundN; i++) { + props.push({ name: 'pie-' + i + '-background-color', type: t.color }); + props.push({ name: 'pie-' + i + '-background-size', type: t.percent }); + props.push({ name: 'pie-' + i + '-background-opacity', type: t.zeroOneNumber }); + } + + // edge arrows + var arrowPrefixes = styfn.arrowPrefixes = ['source', 'mid-source', 'target', 'mid-target']; + [{ name: 'arrow-shape', type: t.arrowShape }, { name: 'arrow-color', type: t.color }, { name: 'arrow-fill', type: t.arrowFill }].forEach(function (prop) { + arrowPrefixes.forEach(function (prefix) { + var name = prefix + '-' + prop.name; + var type = prop.type; + + props.push({ name: name, type: type }); + }); + }, {}); + + // list of property names + styfn.propertyNames = props.map(function (p) { + return p.name; + }); + + // allow access of properties by name ( e.g. style.properties.height ) + for (var _i = 0; _i < props.length; _i++) { + var prop = props[_i]; + + props[prop.name] = prop; // allow lookup by name + } + + // map aliases + for (var _i2 = 0; _i2 < aliases.length; _i2++) { + var alias = aliases[_i2]; + var pointsToProp = props[alias.pointsTo]; + var aliasProp = { + name: alias.name, + alias: true, + pointsTo: pointsToProp + }; + + // add alias prop for parsing + props.push(aliasProp); + + props[alias.name] = aliasProp; // allow lookup by name + } +})(); + +styfn.getDefaultProperty = function (name) { + return this.getDefaultProperties()[name]; +}; + +styfn.getDefaultProperties = util.memoize(function () { + var rawProps = util.extend({ + // common node/edge props + 'events': 'yes', + 'text-events': 'no', + 'text-valign': 'top', + 'text-halign': 'center', + 'color': '#000', + 'text-outline-color': '#000', + 'text-outline-width': 0, + 'text-outline-opacity': 1, + 'text-opacity': 1, + 'text-decoration': 'none', + 'text-transform': 'none', + 'text-wrap': 'none', + 'text-max-width': 9999, + 'text-background-color': '#000', + 'text-background-opacity': 0, + 'text-background-shape': 'rectangle', + 'text-background-padding': 0, + 'text-border-opacity': 0, + 'text-border-width': 0, + 'text-border-style': 'solid', + 'text-border-color': '#000', + 'font-family': 'Helvetica Neue, Helvetica, sans-serif', + 'font-style': 'normal', + // 'font-letiant': fontletiant, + 'font-weight': 'normal', + 'font-size': 16, + 'min-zoomed-font-size': 0, + 'text-rotation': 'none', + 'source-text-rotation': 'none', + 'target-text-rotation': 'none', + 'visibility': 'visible', + 'display': 'element', + 'opacity': 1, + 'z-compound-depth': 'auto', + 'z-index-compare': 'auto', + 'z-index': 0, + 'label': '', + 'text-margin-x': 0, + 'text-margin-y': 0, + 'source-label': '', + 'source-text-offset': 0, + 'source-text-margin-x': 0, + 'source-text-margin-y': 0, + 'target-label': '', + 'target-text-offset': 0, + 'target-text-margin-x': 0, + 'target-text-margin-y': 0, + 'overlay-opacity': 0, + 'overlay-color': '#000', + 'overlay-padding': 10, + 'transition-property': 'none', + 'transition-duration': 0, + 'transition-delay': 0, + 'transition-timing-function': 'linear', + + // node props + 'background-blacken': 0, + 'background-color': '#999', + 'background-opacity': 1, + 'background-image': 'none', + 'background-image-crossorigin': 'anonymous', + 'background-image-opacity': 1, + 'background-position-x': '50%', + 'background-position-y': '50%', + 'background-width-relative-to': 'include-padding', + 'background-height-relative-to': 'include-padding', + 'background-repeat': 'no-repeat', + 'background-fit': 'none', + 'background-clip': 'node', + 'background-width': 'auto', + 'background-height': 'auto', + 'border-color': '#000', + 'border-opacity': 1, + 'border-width': 0, + 'border-style': 'solid', + 'height': 30, + 'width': 30, + 'shape': 'ellipse', + 'shape-polygon-points': '-1, -1, 1, -1, 1, 1, -1, 1', + + // ghost props + 'ghost': 'no', + 'ghost-offset-y': 0, + 'ghost-offset-x': 0, + 'ghost-opacity': 0, + + // compound props + 'padding': 0, + 'padding-relative-to': 'width', + 'position': 'origin', + 'compound-sizing-wrt-labels': 'include', + 'min-width': 0, + 'min-width-bias-left': 0, + 'min-width-bias-right': 0, + 'min-height': 0, + 'min-height-bias-top': 0, + 'min-height-bias-bottom': 0 + }, { + // node pie bg + 'pie-size': '100%' + }, [{ name: 'pie-{{i}}-background-color', value: 'black' }, { name: 'pie-{{i}}-background-size', value: '0%' }, { name: 'pie-{{i}}-background-opacity', value: 1 }].reduce(function (css, prop) { + for (var i = 1; i <= styfn.pieBackgroundN; i++) { + var name = prop.name.replace('{{i}}', i); + var val = prop.value; + + css[name] = val; + } + + return css; + }, {}), { + // edge props + 'line-style': 'solid', + 'line-color': '#999', + 'control-point-step-size': 40, + 'control-point-weights': 0.5, + 'segment-weights': 0.5, + 'segment-distances': 20, + 'edge-distances': 'intersection', + 'curve-style': 'bezier', + 'haystack-radius': 0, + 'arrow-scale': 1, + 'loop-direction': '-45deg', + 'loop-sweep': '-90deg', + 'source-distance-from-node': 0, + 'target-distance-from-node': 0, + 'source-endpoint': 'outside-to-node', + 'target-endpoint': 'outside-to-node' + }, [{ name: 'arrow-shape', value: 'none' }, { name: 'arrow-color', value: '#999' }, { name: 'arrow-fill', value: 'filled' }].reduce(function (css, prop) { + styfn.arrowPrefixes.forEach(function (prefix) { + var name = prefix + '-' + prop.name; + var val = prop.value; + + css[name] = val; + }); + + return css; + }, {})); + + var parsedProps = {}; + + for (var i = 0; i < this.properties.length; i++) { + var prop = this.properties[i]; + + if (prop.pointsTo) { + continue; + } + + var name = prop.name; + var val = rawProps[name]; + var parsedProp = this.parse(name, val); + + parsedProps[name] = parsedProp; + } + + return parsedProps; +}); + +styfn.addDefaultStylesheet = function () { + this.selector('$node > node') // compound (parent) node properties + .css({ + 'shape': 'rectangle', + 'padding': 10, + 'background-color': '#eee', + 'border-color': '#ccc', + 'border-width': 1 + }).selector('edge') // just edge properties + .css({ + 'width': 3, + 'curve-style': 'haystack' + }).selector(':parent <-> node').css({ + 'curve-style': 'bezier', + 'source-endpoint': 'outside-to-line', + 'target-endpoint': 'outside-to-line' + }).selector(':selected').css({ + 'background-color': '#0169D9', + 'line-color': '#0169D9', + 'source-arrow-color': '#0169D9', + 'target-arrow-color': '#0169D9', + 'mid-source-arrow-color': '#0169D9', + 'mid-target-arrow-color': '#0169D9' + }).selector('node:parent:selected').css({ + 'background-color': '#CCE1F9', + 'border-color': '#aec8e5' + }).selector(':active').css({ + 'overlay-color': 'black', + 'overlay-padding': 10, + 'overlay-opacity': 0.25 + }).selector('core') // just core properties + .css({ + 'selection-box-color': '#ddd', + 'selection-box-opacity': 0.65, + 'selection-box-border-color': '#aaa', + 'selection-box-border-width': 1, + 'active-bg-color': 'black', + 'active-bg-opacity': 0.15, + 'active-bg-size': 30, + 'outside-texture-bg-color': '#000', + 'outside-texture-bg-opacity': 0.125 + }); + + this.defaultLength = this.length; +}; + +module.exports = styfn; + +/***/ }), +/* 93 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var is = __webpack_require__(0); +var math = __webpack_require__(2); + +var styfn = {}; + +// a caching layer for property parsing +styfn.parse = function (name, value, propIsBypass, propIsFlat) { + var self = this; + + // function values can't be cached in all cases, and there isn't much benefit of caching them anyway + if (is.fn(value)) { + return self.parseImplWarn(name, value, propIsBypass, propIsFlat); + } + + var flatKey = propIsFlat === 'mapping' || propIsFlat === true || propIsFlat === false || propIsFlat == null ? 'dontcare' : propIsFlat; + var argHash = [name, value, propIsBypass, flatKey].join('$'); + var propCache = self.propCache = self.propCache || {}; + var ret = void 0; + + if (!(ret = propCache[argHash])) { + ret = propCache[argHash] = self.parseImplWarn(name, value, propIsBypass, propIsFlat); + } + + // - bypasses can't be shared b/c the value can be changed by animations or otherwise overridden + // - mappings can't be shared b/c mappings are per-element + if (propIsBypass || propIsFlat === 'mapping') { + // need a copy since props are mutated later in their lifecycles + ret = util.copy(ret); + + if (ret) { + ret.value = util.copy(ret.value); // because it could be an array, e.g. colour + } + } + + return ret; +}; + +styfn.parseImplWarn = function (name, value, propIsBypass, propIsFlat) { + var prop = this.parseImpl(name, value, propIsBypass, propIsFlat); + + if (!prop && value != null) { + util.error('The style property `%s: %s` is invalid', name, value); + } + + return prop; +}; + +// parse a property; return null on invalid; return parsed property otherwise +// fields : +// - name : the name of the property +// - value : the parsed, native-typed value of the property +// - strValue : a string value that represents the property value in valid css +// - bypass : true iff the property is a bypass property +styfn.parseImpl = function (name, value, propIsBypass, propIsFlat) { + var self = this; + + name = util.camel2dash(name); // make sure the property name is in dash form (e.g. 'property-name' not 'propertyName') + + var property = self.properties[name]; + var passedValue = value; + var types = self.types; + + if (!property) { + return null; + } // return null on property of unknown name + if (value === undefined) { + return null; + } // can't assign undefined + + // the property may be an alias + if (property.alias) { + property = property.pointsTo; + name = property.name; + } + + var valueIsString = is.string(value); + if (valueIsString) { + // trim the value to make parsing easier + value = value.trim(); + } + + var type = property.type; + if (!type) { + return null; + } // no type, no luck + + // check if bypass is null or empty string (i.e. indication to delete bypass property) + if (propIsBypass && (value === '' || value === null)) { + return { + name: name, + value: value, + bypass: true, + deleteBypass: true + }; + } + + // check if value is a function used as a mapper + if (is.fn(value)) { + return { + name: name, + value: value, + strValue: 'fn', + mapped: types.fn, + bypass: propIsBypass + }; + } + + // check if value is mapped + var data = void 0, + mapData = void 0; + if (!valueIsString || propIsFlat) { + // then don't bother to do the expensive regex checks + + } else if (data = new RegExp(types.data.regex).exec(value)) { + if (propIsBypass) { + return false; + } // mappers not allowed in bypass + + var mapped = types.data; + + return { + name: name, + value: data, + strValue: '' + value, + mapped: mapped, + field: data[1], + bypass: propIsBypass + }; + } else if (mapData = new RegExp(types.mapData.regex).exec(value)) { + if (propIsBypass) { + return false; + } // mappers not allowed in bypass + if (type.multiple) { + return false; + } // impossible to map to num + + var _mapped = types.mapData; + + // we can map only if the type is a colour or a number + if (!(type.color || type.number)) { + return false; + } + + var valueMin = this.parse(name, mapData[4]); // parse to validate + if (!valueMin || valueMin.mapped) { + return false; + } // can't be invalid or mapped + + var valueMax = this.parse(name, mapData[5]); // parse to validate + if (!valueMax || valueMax.mapped) { + return false; + } // can't be invalid or mapped + + // check if valueMin and valueMax are the same + if (valueMin.value === valueMax.value) { + return false; // can't make much of a mapper without a range + } else if (type.color) { + var c1 = valueMin.value; + var c2 = valueMax.value; + + var same = c1[0] === c2[0] // red + && c1[1] === c2[1] // green + && c1[2] === c2[2] // blue + && ( // optional alpha + c1[3] === c2[3] // same alpha outright + || (c1[3] == null || c1[3] === 1) && ( // full opacity for colour 1? + c2[3] == null || c2[3] === 1) // full opacity for colour 2? + ); + + if (same) { + return false; + } // can't make a mapper without a range + } + + return { + name: name, + value: mapData, + strValue: '' + value, + mapped: _mapped, + field: mapData[1], + fieldMin: parseFloat(mapData[2]), // min & max are numeric + fieldMax: parseFloat(mapData[3]), + valueMin: valueMin.value, + valueMax: valueMax.value, + bypass: propIsBypass + }; + } + + if (type.multiple && propIsFlat !== 'multiple') { + var vals = void 0; + + if (valueIsString) { + vals = value.split(/\s+/); + } else if (is.array(value)) { + vals = value; + } else { + vals = [value]; + } + + if (type.evenMultiple && vals.length % 2 !== 0) { + return null; + } + + var valArr = []; + var unitsArr = []; + var pfValArr = []; + var hasEnum = false; + + for (var i = 0; i < vals.length; i++) { + var p = self.parse(name, vals[i], propIsBypass, 'multiple'); + + hasEnum = hasEnum || is.string(p.value); + + valArr.push(p.value); + pfValArr.push(p.pfValue != null ? p.pfValue : p.value); + unitsArr.push(p.units); + } + + if (type.validate && !type.validate(valArr, unitsArr)) { + return null; + } + + if (type.singleEnum && hasEnum) { + if (valArr.length === 1 && is.string(valArr[0])) { + return { + name: name, + value: valArr[0], + strValue: valArr[0], + bypass: propIsBypass + }; + } else { + return null; + } + } + + return { + name: name, + value: valArr, + pfValue: pfValArr, + strValue: valArr.map(function (val, i) { + return val + (unitsArr[i] || ''); + }).join(' '), + bypass: propIsBypass, + units: unitsArr + }; + } + + // several types also allow enums + var checkEnums = function checkEnums() { + for (var _i = 0; _i < type.enums.length; _i++) { + var en = type.enums[_i]; + + if (en === value) { + return { + name: name, + value: value, + strValue: '' + value, + bypass: propIsBypass + }; + } + } + + return null; + }; + + // check the type and return the appropriate object + if (type.number) { + var units = void 0; + var implicitUnits = 'px'; // not set => px + + if (type.units) { + // use specified units if set + units = type.units; + } + + if (type.implicitUnits) { + implicitUnits = type.implicitUnits; + } + + if (!type.unitless) { + if (valueIsString) { + var unitsRegex = 'px|em' + (type.allowPercent ? '|\\%' : ''); + if (units) { + unitsRegex = units; + } // only allow explicit units if so set + var match = value.match('^(' + util.regex.number + ')(' + unitsRegex + ')?' + '$'); + + if (match) { + value = match[1]; + units = match[2] || implicitUnits; + } + } else if (!units || type.implicitUnits) { + units = implicitUnits; // implicitly px if unspecified + } + } + + value = parseFloat(value); + + // if not a number and enums not allowed, then the value is invalid + if (isNaN(value) && type.enums === undefined) { + return null; + } + + // check if this number type also accepts special keywords in place of numbers + // (i.e. `left`, `auto`, etc) + if (isNaN(value) && type.enums !== undefined) { + value = passedValue; + + return checkEnums(); + } + + // check if value must be an integer + if (type.integer && !is.integer(value)) { + return null; + } + + // check value is within range + if (type.min !== undefined && (value < type.min || type.strictMin && value === type.min) || type.max !== undefined && (value > type.max || type.strictMax && value === type.max)) { + return null; + } + + var ret = { + name: name, + value: value, + strValue: '' + value + (units ? units : ''), + units: units, + bypass: propIsBypass + }; + + // normalise value in pixels + if (type.unitless || units !== 'px' && units !== 'em') { + ret.pfValue = value; + } else { + ret.pfValue = units === 'px' || !units ? value : this.getEmSizeInPixels() * value; + } + + // normalise value in ms + if (units === 'ms' || units === 's') { + ret.pfValue = units === 'ms' ? value : 1000 * value; + } + + // normalise value in rad + if (units === 'deg' || units === 'rad') { + ret.pfValue = units === 'rad' ? value : math.deg2rad(value); + } + + // normalize value in % + if (units === '%') { + ret.pfValue = value / 100; + } + + return ret; + } else if (type.propList) { + + var props = []; + var propsStr = '' + value; + + if (propsStr === 'none') { + // leave empty + + } else { + // go over each prop + + var propsSplit = propsStr.split(','); + for (var _i2 = 0; _i2 < propsSplit.length; _i2++) { + var propName = propsSplit[_i2].trim(); + + if (self.properties[propName]) { + props.push(propName); + } + } + + if (props.length === 0) { + return null; + } + } + + return { + name: name, + value: props, + strValue: props.length === 0 ? 'none' : props.join(', '), + bypass: propIsBypass + }; + } else if (type.color) { + var tuple = util.color2tuple(value); + + if (!tuple) { + return null; + } + + return { + name: name, + value: tuple, + pfValue: tuple, + strValue: '' + value, + bypass: propIsBypass + }; + } else if (type.regex || type.regexes) { + + // first check enums + if (type.enums) { + var enumProp = checkEnums(); + + if (enumProp) { + return enumProp; + } + } + + var regexes = type.regexes ? type.regexes : [type.regex]; + + for (var _i3 = 0; _i3 < regexes.length; _i3++) { + var regex = new RegExp(regexes[_i3]); // make a regex from the type string + var m = regex.exec(value); + + if (m) { + // regex matches + return { + name: name, + value: type.singleRegexMatchValue ? m[1] : m, + strValue: '' + value, + bypass: propIsBypass + }; + } + } + + return null; // didn't match any + } else if (type.string) { + // just return + return { + name: name, + value: '' + value, + strValue: '' + value, + bypass: propIsBypass + }; + } else if (type.enums) { + // check enums last because it's a combo type in others + return checkEnums(); + } else { + return null; // not a type we can handle + } +}; + +module.exports = styfn; + +/***/ }), +/* 94 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var window = __webpack_require__(3); +var math = __webpack_require__(2); + +var corefn = { + + autolock: function autolock(bool) { + if (bool !== undefined) { + this._private.autolock = bool ? true : false; + } else { + return this._private.autolock; + } + + return this; // chaining + }, + + autoungrabify: function autoungrabify(bool) { + if (bool !== undefined) { + this._private.autoungrabify = bool ? true : false; + } else { + return this._private.autoungrabify; + } + + return this; // chaining + }, + + autounselectify: function autounselectify(bool) { + if (bool !== undefined) { + this._private.autounselectify = bool ? true : false; + } else { + return this._private.autounselectify; + } + + return this; // chaining + }, + + panningEnabled: function panningEnabled(bool) { + if (bool !== undefined) { + this._private.panningEnabled = bool ? true : false; + } else { + return this._private.panningEnabled; + } + + return this; // chaining + }, + + userPanningEnabled: function userPanningEnabled(bool) { + if (bool !== undefined) { + this._private.userPanningEnabled = bool ? true : false; + } else { + return this._private.userPanningEnabled; + } + + return this; // chaining + }, + + zoomingEnabled: function zoomingEnabled(bool) { + if (bool !== undefined) { + this._private.zoomingEnabled = bool ? true : false; + } else { + return this._private.zoomingEnabled; + } + + return this; // chaining + }, + + userZoomingEnabled: function userZoomingEnabled(bool) { + if (bool !== undefined) { + this._private.userZoomingEnabled = bool ? true : false; + } else { + return this._private.userZoomingEnabled; + } + + return this; // chaining + }, + + boxSelectionEnabled: function boxSelectionEnabled(bool) { + if (bool !== undefined) { + this._private.boxSelectionEnabled = bool ? true : false; + } else { + return this._private.boxSelectionEnabled; + } + + return this; // chaining + }, + + pan: function pan() { + var args = arguments; + var pan = this._private.pan; + var dim = void 0, + val = void 0, + dims = void 0, + x = void 0, + y = void 0; + + switch (args.length) { + case 0: + // .pan() + return pan; + + case 1: + + if (is.string(args[0])) { + // .pan('x') + dim = args[0]; + return pan[dim]; + } else if (is.plainObject(args[0])) { + // .pan({ x: 0, y: 100 }) + if (!this._private.panningEnabled) { + return this; + } + + dims = args[0]; + x = dims.x; + y = dims.y; + + if (is.number(x)) { + pan.x = x; + } + + if (is.number(y)) { + pan.y = y; + } + + this.emit('pan viewport'); + } + break; + + case 2: + // .pan('x', 100) + if (!this._private.panningEnabled) { + return this; + } + + dim = args[0]; + val = args[1]; + + if ((dim === 'x' || dim === 'y') && is.number(val)) { + pan[dim] = val; + } + + this.emit('pan viewport'); + break; + + default: + break; // invalid + } + + this.notify({ // notify the renderer that the viewport changed + type: 'viewport' + }); + + return this; // chaining + }, + + panBy: function panBy(arg0, arg1) { + var args = arguments; + var pan = this._private.pan; + var dim = void 0, + val = void 0, + dims = void 0, + x = void 0, + y = void 0; + + if (!this._private.panningEnabled) { + return this; + } + + switch (args.length) { + case 1: + + if (is.plainObject(arg0)) { + // .panBy({ x: 0, y: 100 }) + dims = args[0]; + x = dims.x; + y = dims.y; + + if (is.number(x)) { + pan.x += x; + } + + if (is.number(y)) { + pan.y += y; + } + + this.emit('pan viewport'); + } + break; + + case 2: + // .panBy('x', 100) + dim = arg0; + val = arg1; + + if ((dim === 'x' || dim === 'y') && is.number(val)) { + pan[dim] += val; + } + + this.emit('pan viewport'); + break; + + default: + break; // invalid + } + + this.notify({ // notify the renderer that the viewport changed + type: 'viewport' + }); + + return this; // chaining + }, + + fit: function fit(elements, padding) { + var viewportState = this.getFitViewport(elements, padding); + + if (viewportState) { + var _p = this._private; + _p.zoom = viewportState.zoom; + _p.pan = viewportState.pan; + + this.emit('pan zoom viewport'); + + this.notify({ // notify the renderer that the viewport changed + type: 'viewport' + }); + } + + return this; // chaining + }, + + getFitViewport: function getFitViewport(elements, padding) { + if (is.number(elements) && padding === undefined) { + // elements is optional + padding = elements; + elements = undefined; + } + + if (!this._private.panningEnabled || !this._private.zoomingEnabled) { + return; + } + + var bb = void 0; + + if (is.string(elements)) { + var sel = elements; + elements = this.$(sel); + } else if (is.boundingBox(elements)) { + // assume bb + var bbe = elements; + bb = { + x1: bbe.x1, + y1: bbe.y1, + x2: bbe.x2, + y2: bbe.y2 + }; + + bb.w = bb.x2 - bb.x1; + bb.h = bb.y2 - bb.y1; + } else if (!is.elementOrCollection(elements)) { + elements = this.mutableElements(); + } + + if (is.elementOrCollection(elements) && elements.empty()) { + return; + } // can't fit to nothing + + bb = bb || elements.boundingBox(); + + var w = this.width(); + var h = this.height(); + var zoom = void 0; + padding = is.number(padding) ? padding : 0; + + if (!isNaN(w) && !isNaN(h) && w > 0 && h > 0 && !isNaN(bb.w) && !isNaN(bb.h) && bb.w > 0 && bb.h > 0) { + zoom = Math.min((w - 2 * padding) / bb.w, (h - 2 * padding) / bb.h); + + // crop zoom + zoom = zoom > this._private.maxZoom ? this._private.maxZoom : zoom; + zoom = zoom < this._private.minZoom ? this._private.minZoom : zoom; + + var pan = { // now pan to middle + x: (w - zoom * (bb.x1 + bb.x2)) / 2, + y: (h - zoom * (bb.y1 + bb.y2)) / 2 + }; + + return { + zoom: zoom, + pan: pan + }; + } + + return; + }, + + minZoom: function minZoom(zoom) { + if (zoom === undefined) { + return this._private.minZoom; + } else if (is.number(zoom)) { + this._private.minZoom = zoom; + } + + return this; + }, + + maxZoom: function maxZoom(zoom) { + if (zoom === undefined) { + return this._private.maxZoom; + } else if (is.number(zoom)) { + this._private.maxZoom = zoom; + } + + return this; + }, + + getZoomedViewport: function getZoomedViewport(params) { + var _p = this._private; + var currentPan = _p.pan; + var currentZoom = _p.zoom; + var pos = void 0; // in rendered px + var zoom = void 0; + var bail = false; + + if (!_p.zoomingEnabled) { + // zooming disabled + bail = true; + } + + if (is.number(params)) { + // then set the zoom + zoom = params; + } else if (is.plainObject(params)) { + // then zoom about a point + zoom = params.level; + + if (params.position != null) { + pos = math.modelToRenderedPosition(params.position, currentZoom, currentPan); + } else if (params.renderedPosition != null) { + pos = params.renderedPosition; + } + + if (pos != null && !_p.panningEnabled) { + // panning disabled + bail = true; + } + } + + // crop zoom + zoom = zoom > _p.maxZoom ? _p.maxZoom : zoom; + zoom = zoom < _p.minZoom ? _p.minZoom : zoom; + + // can't zoom with invalid params + if (bail || !is.number(zoom) || zoom === currentZoom || pos != null && (!is.number(pos.x) || !is.number(pos.y))) { + return null; + } + + if (pos != null) { + // set zoom about position + var pan1 = currentPan; + var zoom1 = currentZoom; + var zoom2 = zoom; + + var pan2 = { + x: -zoom2 / zoom1 * (pos.x - pan1.x) + pos.x, + y: -zoom2 / zoom1 * (pos.y - pan1.y) + pos.y + }; + + return { + zoomed: true, + panned: true, + zoom: zoom2, + pan: pan2 + }; + } else { + // just set the zoom + return { + zoomed: true, + panned: false, + zoom: zoom, + pan: currentPan + }; + } + }, + + zoom: function zoom(params) { + if (params === undefined) { + // get + return this._private.zoom; + } else { + // set + var vp = this.getZoomedViewport(params); + var _p = this._private; + + if (vp == null || !vp.zoomed) { + return this; + } + + _p.zoom = vp.zoom; + + if (vp.panned) { + _p.pan.x = vp.pan.x; + _p.pan.y = vp.pan.y; + } + + this.emit('zoom' + (vp.panned ? ' pan' : '') + ' viewport'); + + this.notify({ // notify the renderer that the viewport changed + type: 'viewport' + }); + + return this; // chaining + } + }, + + viewport: function viewport(opts) { + var _p = this._private; + var zoomDefd = true; + var panDefd = true; + var events = []; // to trigger + var zoomFailed = false; + var panFailed = false; + + if (!opts) { + return this; + } + if (!is.number(opts.zoom)) { + zoomDefd = false; + } + if (!is.plainObject(opts.pan)) { + panDefd = false; + } + if (!zoomDefd && !panDefd) { + return this; + } + + if (zoomDefd) { + var z = opts.zoom; + + if (z < _p.minZoom || z > _p.maxZoom || !_p.zoomingEnabled) { + zoomFailed = true; + } else { + _p.zoom = z; + + events.push('zoom'); + } + } + + if (panDefd && (!zoomFailed || !opts.cancelOnFailedZoom) && _p.panningEnabled) { + var p = opts.pan; + + if (is.number(p.x)) { + _p.pan.x = p.x; + panFailed = false; + } + + if (is.number(p.y)) { + _p.pan.y = p.y; + panFailed = false; + } + + if (!panFailed) { + events.push('pan'); + } + } + + if (events.length > 0) { + events.push('viewport'); + this.emit(events.join(' ')); + + this.notify({ + type: 'viewport' + }); + } + + return this; // chaining + }, + + center: function center(elements) { + var pan = this.getCenterPan(elements); + + if (pan) { + this._private.pan = pan; + + this.emit('pan viewport'); + + this.notify({ // notify the renderer that the viewport changed + type: 'viewport' + }); + } + + return this; // chaining + }, + + getCenterPan: function getCenterPan(elements, zoom) { + if (!this._private.panningEnabled) { + return; + } + + if (is.string(elements)) { + var selector = elements; + elements = this.mutableElements().filter(selector); + } else if (!is.elementOrCollection(elements)) { + elements = this.mutableElements(); + } + + if (elements.length === 0) { + return; + } // can't centre pan to nothing + + var bb = elements.boundingBox(); + var w = this.width(); + var h = this.height(); + zoom = zoom === undefined ? this._private.zoom : zoom; + + var pan = { // middle + x: (w - zoom * (bb.x1 + bb.x2)) / 2, + y: (h - zoom * (bb.y1 + bb.y2)) / 2 + }; + + return pan; + }, + + reset: function reset() { + if (!this._private.panningEnabled || !this._private.zoomingEnabled) { + return this; + } + + this.viewport({ + pan: { x: 0, y: 0 }, + zoom: 1 + }); + + return this; // chaining + }, + + invalidateSize: function invalidateSize() { + this._private.sizeCache = null; + }, + + size: function size() { + var _p = this._private; + var container = _p.container; + + return _p.sizeCache = _p.sizeCache || (container ? function () { + var style = window.getComputedStyle(container); + var val = function val(name) { + return parseFloat(style.getPropertyValue(name)); + }; + + return { + width: container.clientWidth - val('padding-left') - val('padding-right'), + height: container.clientHeight - val('padding-top') - val('padding-bottom') + }; + }() : { // fallback if no container (not 0 b/c can be used for dividing etc) + width: 1, + height: 1 + }); + }, + + width: function width() { + return this.size().width; + }, + + height: function height() { + return this.size().height; + }, + + extent: function extent() { + var pan = this._private.pan; + var zoom = this._private.zoom; + var rb = this.renderedExtent(); + + var b = { + x1: (rb.x1 - pan.x) / zoom, + x2: (rb.x2 - pan.x) / zoom, + y1: (rb.y1 - pan.y) / zoom, + y2: (rb.y2 - pan.y) / zoom + }; + + b.w = b.x2 - b.x1; + b.h = b.y2 - b.y1; + + return b; + }, + + renderedExtent: function renderedExtent() { + var width = this.width(); + var height = this.height(); + + return { + x1: 0, + y1: 0, + x2: width, + y2: height, + w: width, + h: height + }; + } +}; + +// aliases +corefn.centre = corefn.center; + +// backwards compatibility +corefn.autolockNodes = corefn.autolock; +corefn.autoungrabifyNodes = corefn.autoungrabify; + +module.exports = corefn; + +/***/ }), +/* 95 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var define = __webpack_require__(4); +var Collection = __webpack_require__(7); +var Core = __webpack_require__(12); +var incExts = __webpack_require__(96); +var is = __webpack_require__(0); +var Emitter = __webpack_require__(11); + +// registered extensions to cytoscape, indexed by name +var extensions = {}; + +// registered modules for extensions, indexed by name +var modules = {}; + +function setExtension(type, name, registrant) { + + var ext = registrant; + + var overrideErr = function overrideErr(field) { + util.error('Can not register `' + name + '` for `' + type + '` since `' + field + '` already exists in the prototype and can not be overridden'); + }; + + if (type === 'core') { + if (Core.prototype[name]) { + return overrideErr(name); + } else { + Core.prototype[name] = registrant; + } + } else if (type === 'collection') { + if (Collection.prototype[name]) { + return overrideErr(name); + } else { + Collection.prototype[name] = registrant; + } + } else if (type === 'layout') { + // fill in missing layout functions in the prototype + + var Layout = function Layout(options) { + this.options = options; + + registrant.call(this, options); + + // make sure layout has _private for use w/ std apis like .on() + if (!is.plainObject(this._private)) { + this._private = {}; + } + + this._private.cy = options.cy; + this._private.listeners = []; + + this.createEmitter(); + }; + + var layoutProto = Layout.prototype = Object.create(registrant.prototype); + + var optLayoutFns = []; + + for (var i = 0; i < optLayoutFns.length; i++) { + var fnName = optLayoutFns[i]; + + layoutProto[fnName] = layoutProto[fnName] || function () { + return this; + }; + } + + // either .start() or .run() is defined, so autogen the other + if (layoutProto.start && !layoutProto.run) { + layoutProto.run = function () { + this.start();return this; + }; + } else if (!layoutProto.start && layoutProto.run) { + layoutProto.start = function () { + this.run();return this; + }; + } + + var regStop = registrant.prototype.stop; + layoutProto.stop = function () { + var opts = this.options; + + if (opts && opts.animate) { + var anis = this.animations; + + if (anis) { + for (var _i = 0; _i < anis.length; _i++) { + anis[_i].stop(); + } + } + } + + if (regStop) { + regStop.call(this); + } else { + this.emit('layoutstop'); + } + + return this; + }; + + if (!layoutProto.destroy) { + layoutProto.destroy = function () { + return this; + }; + } + + layoutProto.cy = function () { + return this._private.cy; + }; + + var getCy = function getCy(layout) { + return layout._private.cy; + }; + + util.assign(layoutProto, { + createEmitter: function createEmitter() { + this._private.emitter = new Emitter({ + eventFields: function eventFields(layout) { + return { + layout: layout, + cy: getCy(layout), + target: layout + }; + }, + bubble: function bubble() { + return true; + }, + parent: function parent(layout) { + return getCy(layout); + }, + context: this + }); + + return this; + }, + emitter: function emitter() { + return this._private.emitter; + }, + on: function on(evt, cb) { + this.emitter().on(evt, cb);return this; + }, + one: function one(evt, cb) { + this.emitter().one(evt, cb);return this; + }, + once: function once(evt, cb) { + this.emitter().one(evt, cb);return this; + }, + removeListener: function removeListener(evt, cb) { + this.emitter().removeListener(evt, cb);return this; + }, + emit: function emit(evt, params) { + this.emitter().emit(evt, params);return this; + } + }); + + define.eventAliasesOn(layoutProto); + + ext = Layout; // replace with our wrapped layout + } else if (type === 'renderer' && name !== 'null' && name !== 'base') { + // user registered renderers inherit from base + + var BaseRenderer = getExtension('renderer', 'base'); + var bProto = BaseRenderer.prototype; + var RegistrantRenderer = registrant; + var rProto = registrant.prototype; + + var Renderer = function Renderer() { + BaseRenderer.apply(this, arguments); + RegistrantRenderer.apply(this, arguments); + }; + + var proto = Renderer.prototype; + + for (var pName in bProto) { + var pVal = bProto[pName]; + var existsInR = rProto[pName] != null; + + if (existsInR) { + return overrideErr(pName); + } + + proto[pName] = pVal; // take impl from base + } + + for (var _pName in rProto) { + proto[_pName] = rProto[_pName]; // take impl from registrant + } + + bProto.clientFunctions.forEach(function (name) { + proto[name] = proto[name] || function () { + util.error('Renderer does not implement `renderer.' + name + '()` on its prototype'); + }; + }); + + ext = Renderer; + } + + return util.setMap({ + map: extensions, + keys: [type, name], + value: ext + }); +} + +function getExtension(type, name) { + return util.getMap({ + map: extensions, + keys: [type, name] + }); +} + +function setModule(type, name, moduleType, moduleName, registrant) { + return util.setMap({ + map: modules, + keys: [type, name, moduleType, moduleName], + value: registrant + }); +} + +function getModule(type, name, moduleType, moduleName) { + return util.getMap({ + map: modules, + keys: [type, name, moduleType, moduleName] + }); +} + +var extension = function extension() { + // e.g. extension('renderer', 'svg') + if (arguments.length === 2) { + return getExtension.apply(null, arguments); + } + + // e.g. extension('renderer', 'svg', { ... }) + else if (arguments.length === 3) { + return setExtension.apply(null, arguments); + } + + // e.g. extension('renderer', 'svg', 'nodeShape', 'ellipse') + else if (arguments.length === 4) { + return getModule.apply(null, arguments); + } + + // e.g. extension('renderer', 'svg', 'nodeShape', 'ellipse', { ... }) + else if (arguments.length === 5) { + return setModule.apply(null, arguments); + } else { + util.error('Invalid extension access syntax'); + } +}; + +// allows a core instance to access extensions internally +Core.prototype.extension = extension; + +// included extensions +incExts.forEach(function (group) { + group.extensions.forEach(function (ext) { + setExtension(group.type, ext.name, ext.impl); + }); +}); + +module.exports = extension; + +/***/ }), +/* 96 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = [{ + type: 'layout', + extensions: __webpack_require__(97) +}, { + type: 'renderer', + extensions: __webpack_require__(106) +}]; + +/***/ }), +/* 97 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = [{ name: 'breadthfirst', impl: __webpack_require__(98) }, { name: 'circle', impl: __webpack_require__(99) }, { name: 'concentric', impl: __webpack_require__(100) }, { name: 'cose', impl: __webpack_require__(101) }, { name: 'grid', impl: __webpack_require__(102) }, { name: 'null', impl: __webpack_require__(103) }, { name: 'preset', impl: __webpack_require__(104) }, { name: 'random', impl: __webpack_require__(105) }]; + +/***/ }), +/* 98 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var math = __webpack_require__(2); +var is = __webpack_require__(0); + +var defaults = { + fit: true, // whether to fit the viewport to the graph + directed: false, // whether the tree is directed downwards (or edges can point in any direction if false) + padding: 30, // padding on fit + circle: false, // put depths in concentric circles if true, put depths top down if false + spacingFactor: 1.75, // positive spacing factor, larger => more space between nodes (N.B. n/a if causes overlap) + boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space + nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm + roots: undefined, // the roots of the trees + maximalAdjustments: 0, // how many times to try to position the nodes in a maximal way (i.e. no backtracking) + animate: false, // whether to transition the node positions + animationDuration: 500, // duration of animation in ms if enabled + animationEasing: undefined, // easing of animation if enabled, + animateFilter: function animateFilter(node, i) { + return true; + }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts + ready: undefined, // callback on layoutready + stop: undefined, // callback on layoutstop + transform: function transform(node, position) { + return position; + } // transform a given node position. Useful for changing flow direction in discrete layouts +}; + +function BreadthFirstLayout(options) { + this.options = util.extend({}, defaults, options); +} + +BreadthFirstLayout.prototype.run = function () { + var params = this.options; + var options = params; + + var cy = params.cy; + var eles = options.eles; + var nodes = eles.nodes().not(':parent'); + var graph = eles; + + var bb = math.makeBoundingBox(options.boundingBox ? options.boundingBox : { + x1: 0, y1: 0, w: cy.width(), h: cy.height() + }); + + var roots = void 0; + if (is.elementOrCollection(options.roots)) { + roots = options.roots; + } else if (is.array(options.roots)) { + var rootsArray = []; + + for (var i = 0; i < options.roots.length; i++) { + var id = options.roots[i]; + var ele = cy.getElementById(id); + rootsArray.push(ele); + } + + roots = cy.collection(rootsArray); + } else if (is.string(options.roots)) { + roots = cy.$(options.roots); + } else { + if (options.directed) { + roots = nodes.roots(); + } else { + var components = []; + var unhandledNodes = nodes; + + var _loop = function _loop() { + var currComp = cy.collection(); + + eles.bfs({ + roots: unhandledNodes[0], + visit: function visit(node, edge, pNode, i, depth) { + currComp = currComp.add(node); + }, + directed: false + }); + + unhandledNodes = unhandledNodes.not(currComp); + components.push(currComp); + }; + + while (unhandledNodes.length > 0) { + _loop(); + } + + roots = cy.collection(); + + var _loop2 = function _loop2(_i) { + var comp = components[_i]; + var maxDegree = comp.maxDegree(false); + var compRoots = comp.filter(function (ele) { + return ele.degree(false) === maxDegree; + }); + + roots = roots.add(compRoots); + }; + + for (var _i = 0; _i < components.length; _i++) { + _loop2(_i); + } + } + } + + var depths = []; + var foundByBfs = {}; + var id2depth = {}; + var prevNode = {}; + var prevEdge = {}; + var successors = {}; + + // find the depths of the nodes + graph.bfs({ + roots: roots, + directed: options.directed, + visit: function visit(node, edge, pNode, i, depth) { + var ele = node[0]; + var id = ele.id(); + + if (!depths[depth]) { + depths[depth] = []; + } + + depths[depth].push(ele); + foundByBfs[id] = true; + id2depth[id] = depth; + prevNode[id] = pNode; + prevEdge[id] = edge; + + if (pNode) { + var prevId = pNode.id(); + var succ = successors[prevId] = successors[prevId] || []; + + succ.push(node); + } + } + }); + + // check for nodes not found by bfs + var orphanNodes = []; + for (var _i2 = 0; _i2 < nodes.length; _i2++) { + var _ele = nodes[_i2]; + + if (foundByBfs[_ele.id()]) { + continue; + } else { + orphanNodes.push(_ele); + } + } + + // assign orphan nodes a depth from their neighborhood + var maxChecks = orphanNodes.length * 3; + var checks = 0; + while (orphanNodes.length !== 0 && checks < maxChecks) { + var node = orphanNodes.shift(); + var neighbors = node.neighborhood().nodes(); + var assignedDepth = false; + + for (var _i3 = 0; _i3 < neighbors.length; _i3++) { + var depth = id2depth[neighbors[_i3].id()]; + + if (depth !== undefined) { + depths[depth].push(node); + assignedDepth = true; + break; + } + } + + if (!assignedDepth) { + orphanNodes.push(node); + } + + checks++; + } + + // assign orphan nodes that are still left to the depth of their subgraph + while (orphanNodes.length !== 0) { + var _node = orphanNodes.shift(); + //let subgraph = graph.bfs( node ).path; + var _assignedDepth = false; + + // for( let i = 0; i < subgraph.length; i++ ){ + // let depth = id2depth[ subgraph[i].id() ]; + + // if( depth !== undefined ){ + // depths[depth].push( node ); + // assignedDepth = true; + // break; + // } + // } + + if (!_assignedDepth) { + // worst case if the graph really isn't tree friendly, then just dump it in 0 + if (depths.length === 0) { + depths.push([]); + } + + depths[0].push(_node); + } + } + + // assign the nodes a depth and index + var assignDepthsToEles = function assignDepthsToEles() { + for (var _i4 = 0; _i4 < depths.length; _i4++) { + var _eles = depths[_i4]; + + for (var j = 0; j < _eles.length; j++) { + var _ele2 = _eles[j]; + + if (_ele2 == null) { + _eles.splice(j, 1); + j--; + continue; + } + + _ele2._private.scratch.breadthfirst = { + depth: _i4, + index: j + }; + } + } + }; + assignDepthsToEles(); + + var intersectsDepth = function intersectsDepth(node) { + // returns true if has edges pointing in from a higher depth + var edges = node.connectedEdges(function (ele) { + return ele.data('target') === node.id(); + }); + var thisInfo = node._private.scratch.breadthfirst; + var highestDepthOfOther = 0; + var highestOther = void 0; + for (var _i5 = 0; _i5 < edges.length; _i5++) { + var edge = edges[_i5]; + var otherNode = edge.source()[0]; + var otherInfo = otherNode._private.scratch.breadthfirst; + + if (thisInfo.depth <= otherInfo.depth && highestDepthOfOther < otherInfo.depth) { + highestDepthOfOther = otherInfo.depth; + highestOther = otherNode; + } + } + + return highestOther; + }; + + // make maximal if so set by adjusting depths + for (var adj = 0; adj < options.maximalAdjustments; adj++) { + + var nDepths = depths.length; + var elesToMove = []; + for (var _i6 = 0; _i6 < nDepths; _i6++) { + var _depth = depths[_i6]; + + var nDepth = _depth.length; + for (var j = 0; j < nDepth; j++) { + var _ele3 = _depth[j]; + var info = _ele3._private.scratch.breadthfirst; + var intEle = intersectsDepth(_ele3); + + if (intEle) { + info.intEle = intEle; + elesToMove.push(_ele3); + } + } + } + + for (var _i7 = 0; _i7 < elesToMove.length; _i7++) { + var _ele4 = elesToMove[_i7]; + var _info = _ele4._private.scratch.breadthfirst; + var _intEle = _info.intEle; + var intInfo = _intEle._private.scratch.breadthfirst; + + depths[_info.depth][_info.index] = null; // remove from old depth & index (create hole to be cleaned) + + // add to end of new depth + var newDepth = intInfo.depth + 1; + while (newDepth > depths.length - 1) { + depths.push([]); + } + depths[newDepth].push(_ele4); + + _info.depth = newDepth; + _info.index = depths[newDepth].length - 1; + } + + assignDepthsToEles(); + } + + // find min distance we need to leave between nodes + var minDistance = 0; + if (options.avoidOverlap) { + for (var _i8 = 0; _i8 < nodes.length; _i8++) { + var n = nodes[_i8]; + var nbb = n.layoutDimensions(options); + var w = nbb.w; + var h = nbb.h; + + minDistance = Math.max(minDistance, w, h); + } + } + + // get the weighted percent for an element based on its connectivity to other levels + var cachedWeightedPercent = {}; + var getWeightedPercent = function getWeightedPercent(ele) { + if (cachedWeightedPercent[ele.id()]) { + return cachedWeightedPercent[ele.id()]; + } + + var eleDepth = ele._private.scratch.breadthfirst.depth; + var neighbors = ele.neighborhood().nodes().not(':parent').intersection(nodes); + var percent = 0; + var samples = 0; + + for (var _i9 = 0; _i9 < neighbors.length; _i9++) { + var neighbor = neighbors[_i9]; + var bf = neighbor._private.scratch.breadthfirst; + var index = bf.index; + var _depth2 = bf.depth; + var _nDepth = depths[_depth2].length; + + if (eleDepth > _depth2 || eleDepth === 0) { + // only get influenced by elements above + percent += index / _nDepth; + samples++; + } + } + + samples = Math.max(1, samples); + percent = percent / samples; + + if (samples === 0) { + // so lone nodes have a "don't care" state in sorting + percent = undefined; + } + + cachedWeightedPercent[ele.id()] = percent; + return percent; + }; + + // rearrange the indices in each depth level based on connectivity + + var sortFn = function sortFn(a, b) { + var apct = getWeightedPercent(a); + var bpct = getWeightedPercent(b); + + return apct - bpct; + }; + + for (var times = 0; times < 3; times++) { + // do it a few times b/c the depths are dynamic and we want a more stable result + + for (var _i10 = 0; _i10 < depths.length; _i10++) { + depths[_i10] = depths[_i10].sort(sortFn); + } + assignDepthsToEles(); // and update + } + + var biggestDepthSize = 0; + for (var _i11 = 0; _i11 < depths.length; _i11++) { + biggestDepthSize = Math.max(depths[_i11].length, biggestDepthSize); + } + + var center = { + x: bb.x1 + bb.w / 2, + y: bb.x1 + bb.h / 2 + }; + + var getPosition = function getPosition(ele, isBottomDepth) { + var info = ele._private.scratch.breadthfirst; + var depth = info.depth; + var index = info.index; + var depthSize = depths[depth].length; + + var distanceX = Math.max(bb.w / (depthSize + 1), minDistance); + var distanceY = Math.max(bb.h / (depths.length + 1), minDistance); + var radiusStepSize = Math.min(bb.w / 2 / depths.length, bb.h / 2 / depths.length); + radiusStepSize = Math.max(radiusStepSize, minDistance); + + if (!options.circle) { + + var epos = { + x: center.x + (index + 1 - (depthSize + 1) / 2) * distanceX, + y: (depth + 1) * distanceY + }; + + if (isBottomDepth) { + return epos; + } + + // let succs = successors[ ele.id() ]; + // if( succs ){ + // epos.x = 0; + // + // for( let i = 0 ; i < succs.length; i++ ){ + // let spos = pos[ succs[i].id() ]; + // + // epos.x += spos.x; + // } + // + // epos.x /= succs.length; + // } else { + // //debugger; + // } + + return epos; + } else { + if (options.circle) { + var radius = radiusStepSize * depth + radiusStepSize - (depths.length > 0 && depths[0].length <= 3 ? radiusStepSize / 2 : 0); + var theta = 2 * Math.PI / depths[depth].length * index; + + if (depth === 0 && depths[0].length === 1) { + radius = 1; + } + + return { + x: center.x + radius * Math.cos(theta), + y: center.y + radius * Math.sin(theta) + }; + } else { + return { + x: center.x + (index + 1 - (depthSize + 1) / 2) * distanceX, + y: (depth + 1) * distanceY + }; + } + } + }; + + // get positions in reverse depth order + var pos = {}; + for (var _i12 = depths.length - 1; _i12 >= 0; _i12--) { + var _depth3 = depths[_i12]; + + for (var _j = 0; _j < _depth3.length; _j++) { + var _node2 = _depth3[_j]; + + pos[_node2.id()] = getPosition(_node2, _i12 === depths.length - 1); + } + } + + nodes.layoutPositions(this, options, function (node) { + return pos[node.id()]; + }); + + return this; // chaining +}; + +module.exports = BreadthFirstLayout; + +/***/ }), +/* 99 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var math = __webpack_require__(2); +var is = __webpack_require__(0); + +var defaults = { + fit: true, // whether to fit the viewport to the graph + padding: 30, // the padding on fit + boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + avoidOverlap: true, // prevents node overlap, may overflow boundingBox and radius if not enough space + nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm + spacingFactor: undefined, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up + radius: undefined, // the radius of the circle + startAngle: 3 / 2 * Math.PI, // where nodes start in radians + sweep: undefined, // how many radians should be between the first and last node (defaults to full circle) + clockwise: true, // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) + sort: undefined, // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } + animate: false, // whether to transition the node positions + animationDuration: 500, // duration of animation in ms if enabled + animationEasing: undefined, // easing of animation if enabled + animateFilter: function animateFilter(node, i) { + return true; + }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts + ready: undefined, // callback on layoutready + stop: undefined, // callback on layoutstop + transform: function transform(node, position) { + return position; + } // transform a given node position. Useful for changing flow direction in discrete layouts + +}; + +function CircleLayout(options) { + this.options = util.extend({}, defaults, options); +} + +CircleLayout.prototype.run = function () { + var params = this.options; + var options = params; + + var cy = params.cy; + var eles = options.eles; + + var clockwise = options.counterclockwise !== undefined ? !options.counterclockwise : options.clockwise; + + var nodes = eles.nodes().not(':parent'); + + if (options.sort) { + nodes = nodes.sort(options.sort); + } + + var bb = math.makeBoundingBox(options.boundingBox ? options.boundingBox : { + x1: 0, y1: 0, w: cy.width(), h: cy.height() + }); + + var center = { + x: bb.x1 + bb.w / 2, + y: bb.y1 + bb.h / 2 + }; + + var sweep = options.sweep === undefined ? 2 * Math.PI - 2 * Math.PI / nodes.length : options.sweep; + var dTheta = sweep / Math.max(1, nodes.length - 1); + var r = void 0; + + var minDistance = 0; + for (var i = 0; i < nodes.length; i++) { + var n = nodes[i]; + var nbb = n.layoutDimensions(options); + var w = nbb.w; + var h = nbb.h; + + minDistance = Math.max(minDistance, w, h); + } + + if (is.number(options.radius)) { + r = options.radius; + } else if (nodes.length <= 1) { + r = 0; + } else { + r = Math.min(bb.h, bb.w) / 2 - minDistance; + } + + // calculate the radius + if (nodes.length > 1 && options.avoidOverlap) { + // but only if more than one node (can't overlap) + minDistance *= 1.75; // just to have some nice spacing + + var dcos = Math.cos(dTheta) - Math.cos(0); + var dsin = Math.sin(dTheta) - Math.sin(0); + var rMin = Math.sqrt(minDistance * minDistance / (dcos * dcos + dsin * dsin)); // s.t. no nodes overlapping + r = Math.max(rMin, r); + } + + var getPos = function getPos(ele, i) { + var theta = options.startAngle + i * dTheta * (clockwise ? 1 : -1); + + var rx = r * Math.cos(theta); + var ry = r * Math.sin(theta); + var pos = { + x: center.x + rx, + y: center.y + ry + }; + + return pos; + }; + + nodes.layoutPositions(this, options, getPos); + + return this; // chaining +}; + +module.exports = CircleLayout; + +/***/ }), +/* 100 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var math = __webpack_require__(2); + +var defaults = { + fit: true, // whether to fit the viewport to the graph + padding: 30, // the padding on fit + startAngle: 3 / 2 * Math.PI, // where nodes start in radians + sweep: undefined, // how many radians should be between the first and last node (defaults to full circle) + clockwise: true, // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) + equidistant: false, // whether levels have an equal radial distance betwen them, may cause bounding box overflow + minNodeSpacing: 10, // min spacing between outside of nodes (used for radius adjustment) + boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space + nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm + height: undefined, // height of layout area (overrides container height) + width: undefined, // width of layout area (overrides container width) + spacingFactor: undefined, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up + concentric: function concentric(node) { + // returns numeric value for each node, placing higher nodes in levels towards the centre + return node.degree(); + }, + levelWidth: function levelWidth(nodes) { + // the letiation of concentric values in each level + return nodes.maxDegree() / 4; + }, + animate: false, // whether to transition the node positions + animationDuration: 500, // duration of animation in ms if enabled + animationEasing: undefined, // easing of animation if enabled + animateFilter: function animateFilter(node, i) { + return true; + }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts + ready: undefined, // callback on layoutready + stop: undefined, // callback on layoutstop + transform: function transform(node, position) { + return position; + } // transform a given node position. Useful for changing flow direction in discrete layouts +}; + +function ConcentricLayout(options) { + this.options = util.extend({}, defaults, options); +} + +ConcentricLayout.prototype.run = function () { + var params = this.options; + var options = params; + + var clockwise = options.counterclockwise !== undefined ? !options.counterclockwise : options.clockwise; + + var cy = params.cy; + + var eles = options.eles; + var nodes = eles.nodes().not(':parent'); + + var bb = math.makeBoundingBox(options.boundingBox ? options.boundingBox : { + x1: 0, y1: 0, w: cy.width(), h: cy.height() + }); + + var center = { + x: bb.x1 + bb.w / 2, + y: bb.y1 + bb.h / 2 + }; + + var nodeValues = []; // { node, value } + var theta = options.startAngle; + var maxNodeSize = 0; + + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + var value = void 0; + + // calculate the node value + value = options.concentric(node); + nodeValues.push({ + value: value, + node: node + }); + + // for style mapping + node._private.scratch.concentric = value; + } + + // in case we used the `concentric` in style + nodes.updateStyle(); + + // calculate max size now based on potentially updated mappers + for (var _i = 0; _i < nodes.length; _i++) { + var _node = nodes[_i]; + var nbb = _node.layoutDimensions(options); + + maxNodeSize = Math.max(maxNodeSize, nbb.w, nbb.h); + } + + // sort node values in descreasing order + nodeValues.sort(function (a, b) { + return b.value - a.value; + }); + + var levelWidth = options.levelWidth(nodes); + + // put the values into levels + var levels = [[]]; + var currentLevel = levels[0]; + for (var _i2 = 0; _i2 < nodeValues.length; _i2++) { + var val = nodeValues[_i2]; + + if (currentLevel.length > 0) { + var diff = Math.abs(currentLevel[0].value - val.value); + + if (diff >= levelWidth) { + currentLevel = []; + levels.push(currentLevel); + } + } + + currentLevel.push(val); + } + + // create positions from levels + + var minDist = maxNodeSize + options.minNodeSpacing; // min dist between nodes + + if (!options.avoidOverlap) { + // then strictly constrain to bb + var firstLvlHasMulti = levels.length > 0 && levels[0].length > 1; + var maxR = Math.min(bb.w, bb.h) / 2 - minDist; + var rStep = maxR / (levels.length + firstLvlHasMulti ? 1 : 0); + + minDist = Math.min(minDist, rStep); + } + + // find the metrics for each level + var r = 0; + for (var _i3 = 0; _i3 < levels.length; _i3++) { + var level = levels[_i3]; + var sweep = options.sweep === undefined ? 2 * Math.PI - 2 * Math.PI / level.length : options.sweep; + var dTheta = level.dTheta = sweep / Math.max(1, level.length - 1); + + // calculate the radius + if (level.length > 1 && options.avoidOverlap) { + // but only if more than one node (can't overlap) + var dcos = Math.cos(dTheta) - Math.cos(0); + var dsin = Math.sin(dTheta) - Math.sin(0); + var rMin = Math.sqrt(minDist * minDist / (dcos * dcos + dsin * dsin)); // s.t. no nodes overlapping + + r = Math.max(rMin, r); + } + + level.r = r; + + r += minDist; + } + + if (options.equidistant) { + var rDeltaMax = 0; + var _r = 0; + + for (var _i4 = 0; _i4 < levels.length; _i4++) { + var _level = levels[_i4]; + var rDelta = _level.r - _r; + + rDeltaMax = Math.max(rDeltaMax, rDelta); + } + + _r = 0; + for (var _i5 = 0; _i5 < levels.length; _i5++) { + var _level2 = levels[_i5]; + + if (_i5 === 0) { + _r = _level2.r; + } + + _level2.r = _r; + + _r += rDeltaMax; + } + } + + // calculate the node positions + var pos = {}; // id => position + for (var _i6 = 0; _i6 < levels.length; _i6++) { + var _level3 = levels[_i6]; + var _dTheta = _level3.dTheta; + var _r2 = _level3.r; + + for (var j = 0; j < _level3.length; j++) { + var _val = _level3[j]; + var _theta = options.startAngle + (clockwise ? 1 : -1) * _dTheta * j; + + var p = { + x: center.x + _r2 * Math.cos(_theta), + y: center.y + _r2 * Math.sin(_theta) + }; + + pos[_val.node.id()] = p; + } + } + + // position the nodes + nodes.layoutPositions(this, options, function (ele) { + var id = ele.id(); + + return pos[id]; + }); + + return this; // chaining +}; + +module.exports = ConcentricLayout; + +/***/ }), +/* 101 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* +The CoSE layout was written by Gerardo Huck. +https://www.linkedin.com/in/gerardohuck/ + +Based on the following article: +http://dl.acm.org/citation.cfm?id=1498047 + +Modifications tracked on Github. +*/ + +var util = __webpack_require__(1); +var math = __webpack_require__(2); +var is = __webpack_require__(0); +var Promise = __webpack_require__(5); + +var DEBUG; + +/** + * @brief : default layout options + */ +var defaults = { + // Called on `layoutready` + ready: function ready() {}, + + // Called on `layoutstop` + stop: function stop() {}, + + // Whether to animate while running the layout + // true : Animate continuously as the layout is running + // false : Just show the end result + // 'end' : Animate with the end result, from the initial positions to the end positions + animate: true, + + // Easing of the animation for animate:'end' + animationEasing: undefined, + + // The duration of the animation for animate:'end' + animationDuration: undefined, + + // A function that determines whether the node should be animated + // All nodes animated by default on animate enabled + // Non-animated nodes are positioned immediately when the layout starts + animateFilter: function animateFilter(node, i) { + return true; + }, + + // The layout animates only after this many milliseconds for animate:true + // (prevents flashing on fast runs) + animationThreshold: 250, + + // Number of iterations between consecutive screen positions update + // (0 -> only updated on the end) + refresh: 20, + + // Whether to fit the network view after when done + fit: true, + + // Padding on fit + padding: 30, + + // Constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + boundingBox: undefined, + + // Excludes the label when calculating node bounding boxes for the layout algorithm + nodeDimensionsIncludeLabels: false, + + // Randomize the initial positions of the nodes (true) or use existing positions (false) + randomize: false, + + // Extra spacing between components in non-compound graphs + componentSpacing: 40, + + // Node repulsion (non overlapping) multiplier + nodeRepulsion: function nodeRepulsion(node) { + return 2048; + }, + + // Node repulsion (overlapping) multiplier + nodeOverlap: 4, + + // Ideal edge (non nested) length + idealEdgeLength: function idealEdgeLength(edge) { + return 32; + }, + + // Divisor to compute edge forces + edgeElasticity: function edgeElasticity(edge) { + return 32; + }, + + // Nesting factor (multiplier) to compute ideal edge length for nested edges + nestingFactor: 1.2, + + // Gravity force (constant) + gravity: 1, + + // Maximum number of iterations to perform + numIter: 1000, + + // Initial temperature (maximum node displacement) + initialTemp: 1000, + + // Cooling factor (how the temperature is reduced between consecutive iterations + coolingFactor: 0.99, + + // Lower temperature threshold (below this point the layout will end) + minTemp: 1.0, + + // Pass a reference to weaver to use threads for calculations + weaver: false +}; + +/** + * @brief : constructor + * @arg options : object containing layout options + */ +function CoseLayout(options) { + this.options = util.extend({}, defaults, options); + + this.options.layout = this; +} + +/** + * @brief : runs the layout + */ +CoseLayout.prototype.run = function () { + var options = this.options; + var cy = options.cy; + var layout = this; + var thread = this.thread; + var Thread = options.weaver ? options.weaver.Thread : null; + + var falseThread = { // use false thread as polyfill + listeners: [], + on: function on(e, cb) { + this.listeners.push({ event: e, callback: cb }); + + return this; + }, + trigger: function trigger(e) { + if (is.string(e)) { + e = { type: e }; + } + + var matchesEvent = function matchesEvent(l) { + return l.event === e.type; + }; + var trigger = function trigger(l) { + l.callback(e); + }; + + this.listeners.filter(matchesEvent).forEach(trigger); + + return this; + }, + pass: function pass(data) { + this.pass = data; + + return this; + }, + run: function run(cb) { + var pass = this.pass; + + return new Promise(function (resolve) { + resolve(cb(pass)); + }); + }, + stop: function stop() { + return this; + }, + stopped: function stopped() { + return true; + } + }; + + function broadcast(message) { + // for false thread + var e = { type: 'message', message: message }; + + falseThread.trigger(e); + } + + if (!thread || thread.stopped()) { + thread = this.thread = Thread ? new Thread() : falseThread; + } + + layout.stopped = false; + + if (options.animate === true || options.animate === false) { + layout.emit({ type: 'layoutstart', layout: layout }); + } + + // Set DEBUG - Global variable + if (true === options.debug) { + DEBUG = true; + } else { + DEBUG = false; + } + + // Initialize layout info + var layoutInfo = createLayoutInfo(cy, layout, options); + + // Show LayoutInfo contents if debugging + if (DEBUG) { + printLayoutInfo(layoutInfo); + } + + // If required, randomize node positions + if (options.randomize) { + randomizePositions(layoutInfo, cy); + } + + var startTime = Date.now(); + var refreshRequested = false; + var refresh = function refresh(rOpts) { + rOpts = rOpts || {}; + + if (refreshRequested && !rOpts.next) { + return; + } + + if (!rOpts.force && Date.now() - startTime < options.animationThreshold) { + return; + } + + refreshRequested = true; + + util.requestAnimationFrame(function () { + refreshPositions(layoutInfo, cy, options); + + // Fit the graph if necessary + if (true === options.fit) { + cy.fit(options.padding); + } + + refreshRequested = false; + + if (rOpts.next) { + rOpts.next(); + } + }); + }; + + thread.on('message', function (e) { + var layoutNodes = e.message; + + layoutInfo.layoutNodes = layoutNodes; + refresh(); + }); + + thread.pass({ + layoutInfo: layoutInfo, + options: { + animate: options.animate, + refresh: options.refresh, + componentSpacing: options.componentSpacing, + nodeOverlap: options.nodeOverlap, + nestingFactor: options.nestingFactor, + gravity: options.gravity, + numIter: options.numIter, + initialTemp: options.initialTemp, + coolingFactor: options.coolingFactor, + minTemp: options.minTemp + } + }).run(function (pass) { + var layoutInfo = pass.layoutInfo; + var options = pass.options; + var stopped = false; + + /** + * @brief : Performs one iteration of the physical simulation + * @arg layoutInfo : LayoutInfo object already initialized + * @arg cy : Cytoscape object + * @arg options : Layout options + */ + var step = function step(layoutInfo, options, _step) { + // var s = "\n\n###############################"; + // s += "\nSTEP: " + step; + // s += "\n###############################\n"; + // logDebug(s); + + // Calculate node repulsions + calculateNodeForces(layoutInfo, options); + // Calculate edge forces + calculateEdgeForces(layoutInfo, options); + // Calculate gravity forces + calculateGravityForces(layoutInfo, options); + // Propagate forces from parent to child + propagateForces(layoutInfo, options); + // Update positions based on calculated forces + updatePositions(layoutInfo, options); + }; + + /** + * @brief : Computes the node repulsion forces + */ + var calculateNodeForces = function calculateNodeForces(layoutInfo, options) { + // Go through each of the graphs in graphSet + // Nodes only repel each other if they belong to the same graph + // var s = 'calculateNodeForces'; + // logDebug(s); + for (var i = 0; i < layoutInfo.graphSet.length; i++) { + var graph = layoutInfo.graphSet[i]; + var numNodes = graph.length; + + // s = "Set: " + graph.toString(); + // logDebug(s); + + // Now get all the pairs of nodes + // Only get each pair once, (A, B) = (B, A) + for (var j = 0; j < numNodes; j++) { + var node1 = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[j]]]; + + for (var k = j + 1; k < numNodes; k++) { + var node2 = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[k]]]; + + nodeRepulsion(node1, node2, layoutInfo, options); + } + } + } + }; + + var randomDistance = function randomDistance(max) { + return -max + 2 * max * Math.random(); + }; + + /** + * @brief : Compute the node repulsion forces between a pair of nodes + */ + var nodeRepulsion = function nodeRepulsion(node1, node2, layoutInfo, options) { + // var s = "Node repulsion. Node1: " + node1.id + " Node2: " + node2.id; + + var cmptId1 = node1.cmptId; + var cmptId2 = node2.cmptId; + + if (cmptId1 !== cmptId2 && !layoutInfo.isCompound) { + return; + } + + // Get direction of line connecting both node centers + var directionX = node2.positionX - node1.positionX; + var directionY = node2.positionY - node1.positionY; + var maxRandDist = 1; + // s += "\ndirectionX: " + directionX + ", directionY: " + directionY; + + // If both centers are the same, apply a random force + if (0 === directionX && 0 === directionY) { + directionX = randomDistance(maxRandDist); + directionY = randomDistance(maxRandDist); + } + + var overlap = nodesOverlap(node1, node2, directionX, directionY); + + if (overlap > 0) { + // s += "\nNodes DO overlap."; + // s += "\nOverlap: " + overlap; + // If nodes overlap, repulsion force is proportional + // to the overlap + var force = options.nodeOverlap * overlap; + + // Compute the module and components of the force vector + var distance = Math.sqrt(directionX * directionX + directionY * directionY); + // s += "\nDistance: " + distance; + var forceX = force * directionX / distance; + var forceY = force * directionY / distance; + } else { + // s += "\nNodes do NOT overlap."; + // If there's no overlap, force is inversely proportional + // to squared distance + + // Get clipping points for both nodes + var point1 = findClippingPoint(node1, directionX, directionY); + var point2 = findClippingPoint(node2, -1 * directionX, -1 * directionY); + + // Use clipping points to compute distance + var distanceX = point2.x - point1.x; + var distanceY = point2.y - point1.y; + var distanceSqr = distanceX * distanceX + distanceY * distanceY; + var distance = Math.sqrt(distanceSqr); + // s += "\nDistance: " + distance; + + // Compute the module and components of the force vector + var force = (node1.nodeRepulsion + node2.nodeRepulsion) / distanceSqr; + var forceX = force * distanceX / distance; + var forceY = force * distanceY / distance; + } + + // Apply force + if (!node1.isLocked) { + node1.offsetX -= forceX; + node1.offsetY -= forceY; + } + + if (!node2.isLocked) { + node2.offsetX += forceX; + node2.offsetY += forceY; + } + + // s += "\nForceX: " + forceX + " ForceY: " + forceY; + // logDebug(s); + + return; + }; + + /** + * @brief : Determines whether two nodes overlap or not + * @return : Amount of overlapping (0 => no overlap) + */ + var nodesOverlap = function nodesOverlap(node1, node2, dX, dY) { + + if (dX > 0) { + var overlapX = node1.maxX - node2.minX; + } else { + var overlapX = node2.maxX - node1.minX; + } + + if (dY > 0) { + var overlapY = node1.maxY - node2.minY; + } else { + var overlapY = node2.maxY - node1.minY; + } + + if (overlapX >= 0 && overlapY >= 0) { + return Math.sqrt(overlapX * overlapX + overlapY * overlapY); + } else { + return 0; + } + }; + + /** + * @brief : Finds the point in which an edge (direction dX, dY) intersects + * the rectangular bounding box of it's source/target node + */ + var findClippingPoint = function findClippingPoint(node, dX, dY) { + + // Shorcuts + var X = node.positionX; + var Y = node.positionY; + var H = node.height || 1; + var W = node.width || 1; + var dirSlope = dY / dX; + var nodeSlope = H / W; + + // var s = 'Computing clipping point of node ' + node.id + + // " . Height: " + H + ", Width: " + W + + // "\nDirection " + dX + ", " + dY; + // + // Compute intersection + var res = {}; + + // Case: Vertical direction (up) + if (0 === dX && 0 < dY) { + res.x = X; + // s += "\nUp direction"; + res.y = Y + H / 2; + + return res; + } + + // Case: Vertical direction (down) + if (0 === dX && 0 > dY) { + res.x = X; + res.y = Y + H / 2; + // s += "\nDown direction"; + + return res; + } + + // Case: Intersects the right border + if (0 < dX && -1 * nodeSlope <= dirSlope && dirSlope <= nodeSlope) { + res.x = X + W / 2; + res.y = Y + W * dY / 2 / dX; + // s += "\nRightborder"; + + return res; + } + + // Case: Intersects the left border + if (0 > dX && -1 * nodeSlope <= dirSlope && dirSlope <= nodeSlope) { + res.x = X - W / 2; + res.y = Y - W * dY / 2 / dX; + // s += "\nLeftborder"; + + return res; + } + + // Case: Intersects the top border + if (0 < dY && (dirSlope <= -1 * nodeSlope || dirSlope >= nodeSlope)) { + res.x = X + H * dX / 2 / dY; + res.y = Y + H / 2; + // s += "\nTop border"; + + return res; + } + + // Case: Intersects the bottom border + if (0 > dY && (dirSlope <= -1 * nodeSlope || dirSlope >= nodeSlope)) { + res.x = X - H * dX / 2 / dY; + res.y = Y - H / 2; + // s += "\nBottom border"; + + return res; + } + + // s += "\nClipping point found at " + res.x + ", " + res.y; + // logDebug(s); + return res; + }; + + /** + * @brief : Calculates all edge forces + */ + var calculateEdgeForces = function calculateEdgeForces(layoutInfo, options) { + // Iterate over all edges + for (var i = 0; i < layoutInfo.edgeSize; i++) { + // Get edge, source & target nodes + var edge = layoutInfo.layoutEdges[i]; + var sourceIx = layoutInfo.idToIndex[edge.sourceId]; + var source = layoutInfo.layoutNodes[sourceIx]; + var targetIx = layoutInfo.idToIndex[edge.targetId]; + var target = layoutInfo.layoutNodes[targetIx]; + + // Get direction of line connecting both node centers + var directionX = target.positionX - source.positionX; + var directionY = target.positionY - source.positionY; + + // If both centers are the same, do nothing. + // A random force has already been applied as node repulsion + if (0 === directionX && 0 === directionY) { + continue; + } + + // Get clipping points for both nodes + var point1 = findClippingPoint(source, directionX, directionY); + var point2 = findClippingPoint(target, -1 * directionX, -1 * directionY); + + var lx = point2.x - point1.x; + var ly = point2.y - point1.y; + var l = Math.sqrt(lx * lx + ly * ly); + + var force = Math.pow(edge.idealLength - l, 2) / edge.elasticity; + + if (0 !== l) { + var forceX = force * lx / l; + var forceY = force * ly / l; + } else { + var forceX = 0; + var forceY = 0; + } + + // Add this force to target and source nodes + if (!source.isLocked) { + source.offsetX += forceX; + source.offsetY += forceY; + } + + if (!target.isLocked) { + target.offsetX -= forceX; + target.offsetY -= forceY; + } + + // var s = 'Edge force between nodes ' + source.id + ' and ' + target.id; + // s += "\nDistance: " + l + " Force: (" + forceX + ", " + forceY + ")"; + // logDebug(s); + } + }; + + /** + * @brief : Computes gravity forces for all nodes + */ + var calculateGravityForces = function calculateGravityForces(layoutInfo, options) { + var distThreshold = 1; + + // var s = 'calculateGravityForces'; + // logDebug(s); + for (var i = 0; i < layoutInfo.graphSet.length; i++) { + var graph = layoutInfo.graphSet[i]; + var numNodes = graph.length; + + // s = "Set: " + graph.toString(); + // logDebug(s); + + // Compute graph center + if (0 === i) { + var centerX = layoutInfo.clientHeight / 2; + var centerY = layoutInfo.clientWidth / 2; + } else { + // Get Parent node for this graph, and use its position as center + var temp = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[0]]]; + var parent = layoutInfo.layoutNodes[layoutInfo.idToIndex[temp.parentId]]; + var centerX = parent.positionX; + var centerY = parent.positionY; + } + // s = "Center found at: " + centerX + ", " + centerY; + // logDebug(s); + + // Apply force to all nodes in graph + for (var j = 0; j < numNodes; j++) { + var node = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[j]]]; + // s = "Node: " + node.id; + + if (node.isLocked) { + continue; + } + + var dx = centerX - node.positionX; + var dy = centerY - node.positionY; + var d = Math.sqrt(dx * dx + dy * dy); + if (d > distThreshold) { + var fx = options.gravity * dx / d; + var fy = options.gravity * dy / d; + node.offsetX += fx; + node.offsetY += fy; + // s += ": Applied force: " + fx + ", " + fy; + } else {} + // s += ": skypped since it's too close to center"; + + // logDebug(s); + } + } + }; + + /** + * @brief : This function propagates the existing offsets from + * parent nodes to its descendents. + * @arg layoutInfo : layoutInfo Object + * @arg cy : cytoscape Object + * @arg options : Layout options + */ + var propagateForces = function propagateForces(layoutInfo, options) { + // Inline implementation of a queue, used for traversing the graph in BFS order + var queue = []; + var start = 0; // Points to the start the queue + var end = -1; // Points to the end of the queue + + // logDebug('propagateForces'); + + // Start by visiting the nodes in the root graph + queue.push.apply(queue, layoutInfo.graphSet[0]); + end += layoutInfo.graphSet[0].length; + + // Traverse the graph, level by level, + while (start <= end) { + // Get the node to visit and remove it from queue + var nodeId = queue[start++]; + var nodeIndex = layoutInfo.idToIndex[nodeId]; + var node = layoutInfo.layoutNodes[nodeIndex]; + var children = node.children; + + // We only need to process the node if it's compound + if (0 < children.length && !node.isLocked) { + var offX = node.offsetX; + var offY = node.offsetY; + + // var s = "Propagating offset from parent node : " + node.id + + // ". OffsetX: " + offX + ". OffsetY: " + offY; + // s += "\n Children: " + children.toString(); + // logDebug(s); + + for (var i = 0; i < children.length; i++) { + var childNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[children[i]]]; + // Propagate offset + childNode.offsetX += offX; + childNode.offsetY += offY; + // Add children to queue to be visited + queue[++end] = children[i]; + } + + // Reset parent offsets + node.offsetX = 0; + node.offsetY = 0; + } + } + }; + + /** + * @brief : Updates the layout model positions, based on + * the accumulated forces + */ + var updatePositions = function updatePositions(layoutInfo, options) { + // var s = 'Updating positions'; + // logDebug(s); + + // Reset boundaries for compound nodes + for (var i = 0; i < layoutInfo.nodeSize; i++) { + var n = layoutInfo.layoutNodes[i]; + if (0 < n.children.length) { + // logDebug("Resetting boundaries of compound node: " + n.id); + n.maxX = undefined; + n.minX = undefined; + n.maxY = undefined; + n.minY = undefined; + } + } + + for (var i = 0; i < layoutInfo.nodeSize; i++) { + var n = layoutInfo.layoutNodes[i]; + if (0 < n.children.length || n.isLocked) { + // No need to set compound or locked node position + // logDebug("Skipping position update of node: " + n.id); + continue; + } + // s = "Node: " + n.id + " Previous position: (" + + // n.positionX + ", " + n.positionY + ")."; + + // Limit displacement in order to improve stability + var tempForce = limitForce(n.offsetX, n.offsetY, layoutInfo.temperature); + n.positionX += tempForce.x; + n.positionY += tempForce.y; + n.offsetX = 0; + n.offsetY = 0; + n.minX = n.positionX - n.width; + n.maxX = n.positionX + n.width; + n.minY = n.positionY - n.height; + n.maxY = n.positionY + n.height; + // s += " New Position: (" + n.positionX + ", " + n.positionY + ")."; + // logDebug(s); + + // Update ancestry boudaries + updateAncestryBoundaries(n, layoutInfo); + } + + // Update size, position of compund nodes + for (var i = 0; i < layoutInfo.nodeSize; i++) { + var n = layoutInfo.layoutNodes[i]; + if (0 < n.children.length && !n.isLocked) { + n.positionX = (n.maxX + n.minX) / 2; + n.positionY = (n.maxY + n.minY) / 2; + n.width = n.maxX - n.minX; + n.height = n.maxY - n.minY; + // s = "Updating position, size of compound node " + n.id; + // s += "\nPositionX: " + n.positionX + ", PositionY: " + n.positionY; + // s += "\nWidth: " + n.width + ", Height: " + n.height; + // logDebug(s); + } + } + }; + + /** + * @brief : Limits a force (forceX, forceY) to be not + * greater (in modulo) than max. + 8 Preserves force direction. + */ + var limitForce = function limitForce(forceX, forceY, max) { + // var s = "Limiting force: (" + forceX + ", " + forceY + "). Max: " + max; + var force = Math.sqrt(forceX * forceX + forceY * forceY); + + if (force > max) { + var res = { + x: max * forceX / force, + y: max * forceY / force + }; + } else { + var res = { + x: forceX, + y: forceY + }; + } + + // s += ".\nResult: (" + res.x + ", " + res.y + ")"; + // logDebug(s); + + return res; + }; + + /** + * @brief : Function used for keeping track of compound node + * sizes, since they should bound all their subnodes. + */ + var updateAncestryBoundaries = function updateAncestryBoundaries(node, layoutInfo) { + // var s = "Propagating new position/size of node " + node.id; + var parentId = node.parentId; + if (null == parentId) { + // If there's no parent, we are done + // s += ". No parent node."; + // logDebug(s); + return; + } + + // Get Parent Node + var p = layoutInfo.layoutNodes[layoutInfo.idToIndex[parentId]]; + var flag = false; + + // MaxX + if (null == p.maxX || node.maxX + p.padRight > p.maxX) { + p.maxX = node.maxX + p.padRight; + flag = true; + // s += "\nNew maxX for parent node " + p.id + ": " + p.maxX; + } + + // MinX + if (null == p.minX || node.minX - p.padLeft < p.minX) { + p.minX = node.minX - p.padLeft; + flag = true; + // s += "\nNew minX for parent node " + p.id + ": " + p.minX; + } + + // MaxY + if (null == p.maxY || node.maxY + p.padBottom > p.maxY) { + p.maxY = node.maxY + p.padBottom; + flag = true; + // s += "\nNew maxY for parent node " + p.id + ": " + p.maxY; + } + + // MinY + if (null == p.minY || node.minY - p.padTop < p.minY) { + p.minY = node.minY - p.padTop; + flag = true; + // s += "\nNew minY for parent node " + p.id + ": " + p.minY; + } + + // If updated boundaries, propagate changes upward + if (flag) { + // logDebug(s); + return updateAncestryBoundaries(p, layoutInfo); + } + + // s += ". No changes in boundaries/position of parent node " + p.id; + // logDebug(s); + return; + }; + + var separateComponents = function separateComponents(layutInfo, options) { + var nodes = layoutInfo.layoutNodes; + var components = []; + + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + var cid = node.cmptId; + var component = components[cid] = components[cid] || []; + + component.push(node); + } + + var totalA = 0; + + for (var i = 0; i < components.length; i++) { + var c = components[i]; + + if (!c) { + continue; + } + + c.x1 = Infinity; + c.x2 = -Infinity; + c.y1 = Infinity; + c.y2 = -Infinity; + + for (var j = 0; j < c.length; j++) { + var n = c[j]; + + c.x1 = Math.min(c.x1, n.positionX - n.width / 2); + c.x2 = Math.max(c.x2, n.positionX + n.width / 2); + c.y1 = Math.min(c.y1, n.positionY - n.height / 2); + c.y2 = Math.max(c.y2, n.positionY + n.height / 2); + } + + c.w = c.x2 - c.x1; + c.h = c.y2 - c.y1; + + totalA += c.w * c.h; + } + + components.sort(function (c1, c2) { + return c2.w * c2.h - c1.w * c1.h; + }); + + var x = 0; + var y = 0; + var usedW = 0; + var rowH = 0; + var maxRowW = Math.sqrt(totalA) * layoutInfo.clientWidth / layoutInfo.clientHeight; + + for (var i = 0; i < components.length; i++) { + var c = components[i]; + + if (!c) { + continue; + } + + for (var j = 0; j < c.length; j++) { + var n = c[j]; + + if (!n.isLocked) { + n.positionX += x; + n.positionY += y; + } + } + + x += c.w + options.componentSpacing; + usedW += c.w + options.componentSpacing; + rowH = Math.max(rowH, c.h); + + if (usedW > maxRowW) { + y += rowH + options.componentSpacing; + x = 0; + usedW = 0; + rowH = 0; + } + } + }; + + var mainLoop = function mainLoop(i) { + if (stopped) { + // logDebug("Layout manually stopped. Stopping computation in step " + i); + return false; + } + + // Do one step in the phisical simulation + step(layoutInfo, options, i); + + // Update temperature + layoutInfo.temperature = layoutInfo.temperature * options.coolingFactor; + // logDebug("New temperature: " + layoutInfo.temperature); + + if (layoutInfo.temperature < options.minTemp) { + // logDebug("Temperature drop below minimum threshold. Stopping computation in step " + i); + return false; + } + + return true; + }; + + var i = 0; + var loopRet; + + do { + var f = 0; + + while (f < options.refresh && i < options.numIter) { + var loopRet = mainLoop(i); + if (!loopRet) { + break; + } + + f++; + i++; + } + + if (options.animate === true) { + broadcast(layoutInfo.layoutNodes); // eslint-disable-line no-undef + } + } while (loopRet && i + 1 < options.numIter); + + separateComponents(layoutInfo, options); + + return layoutInfo; + }).then(function (layoutInfoUpdated) { + layoutInfo.layoutNodes = layoutInfoUpdated.layoutNodes; // get the positions + + thread.stop(); + done(); + }); + + var done = function done() { + if (options.animate === true || options.animate === false) { + refresh({ + force: true, + next: function next() { + // Layout has finished + layout.one('layoutstop', options.stop); + layout.emit({ type: 'layoutstop', layout: layout }); + } + }); + } else { + options.eles.nodes().layoutPositions(layout, options, function (node) { + var lnode = layoutInfo.layoutNodes[layoutInfo.idToIndex[node.data('id')]]; + + return { x: lnode.positionX, y: lnode.positionY }; + }); + } + }; + + return this; // chaining +}; + +/** + * @brief : called on continuous layouts to stop them before they finish + */ +CoseLayout.prototype.stop = function () { + this.stopped = true; + + if (this.thread) { + this.thread.stop(); + } + + this.emit('layoutstop'); + + return this; // chaining +}; + +CoseLayout.prototype.destroy = function () { + if (this.thread) { + this.thread.stop(); + } + + return this; // chaining +}; + +/** + * @brief : Creates an object which is contains all the data + * used in the layout process + * @arg cy : cytoscape.js object + * @return : layoutInfo object initialized + */ +var createLayoutInfo = function createLayoutInfo(cy, layout, options) { + // Shortcut + var edges = options.eles.edges(); + var nodes = options.eles.nodes(); + + var layoutInfo = { + isCompound: cy.hasCompoundNodes(), + layoutNodes: [], + idToIndex: {}, + nodeSize: nodes.size(), + graphSet: [], + indexToGraph: [], + layoutEdges: [], + edgeSize: edges.size(), + temperature: options.initialTemp, + clientWidth: cy.width(), + clientHeight: cy.width(), + boundingBox: math.makeBoundingBox(options.boundingBox ? options.boundingBox : { + x1: 0, y1: 0, w: cy.width(), h: cy.height() + }) + }; + + var components = options.eles.components(); + var id2cmptId = {}; + + for (var i = 0; i < components.length; i++) { + var component = components[i]; + + for (var j = 0; j < component.length; j++) { + var node = component[j]; + + id2cmptId[node.id()] = i; + } + } + + // Iterate over all nodes, creating layout nodes + for (var i = 0; i < layoutInfo.nodeSize; i++) { + var n = nodes[i]; + var nbb = n.layoutDimensions(options); + + var tempNode = {}; + tempNode.isLocked = n.locked(); + tempNode.id = n.data('id'); + tempNode.parentId = n.data('parent'); + tempNode.cmptId = id2cmptId[n.id()]; + tempNode.children = []; + tempNode.positionX = n.position('x'); + tempNode.positionY = n.position('y'); + tempNode.offsetX = 0; + tempNode.offsetY = 0; + tempNode.height = nbb.w; + tempNode.width = nbb.h; + tempNode.maxX = tempNode.positionX + tempNode.width / 2; + tempNode.minX = tempNode.positionX - tempNode.width / 2; + tempNode.maxY = tempNode.positionY + tempNode.height / 2; + tempNode.minY = tempNode.positionY - tempNode.height / 2; + tempNode.padLeft = parseFloat(n.style('padding')); + tempNode.padRight = parseFloat(n.style('padding')); + tempNode.padTop = parseFloat(n.style('padding')); + tempNode.padBottom = parseFloat(n.style('padding')); + + // forces + tempNode.nodeRepulsion = is.fn(options.nodeRepulsion) ? options.nodeRepulsion(n) : options.nodeRepulsion; + + // Add new node + layoutInfo.layoutNodes.push(tempNode); + // Add entry to id-index map + layoutInfo.idToIndex[tempNode.id] = i; + } + + // Inline implementation of a queue, used for traversing the graph in BFS order + var queue = []; + var start = 0; // Points to the start the queue + var end = -1; // Points to the end of the queue + + var tempGraph = []; + + // Second pass to add child information and + // initialize queue for hierarchical traversal + for (var i = 0; i < layoutInfo.nodeSize; i++) { + var n = layoutInfo.layoutNodes[i]; + var p_id = n.parentId; + // Check if node n has a parent node + if (null != p_id) { + // Add node Id to parent's list of children + layoutInfo.layoutNodes[layoutInfo.idToIndex[p_id]].children.push(n.id); + } else { + // If a node doesn't have a parent, then it's in the root graph + queue[++end] = n.id; + tempGraph.push(n.id); + } + } + + // Add root graph to graphSet + layoutInfo.graphSet.push(tempGraph); + + // Traverse the graph, level by level, + while (start <= end) { + // Get the node to visit and remove it from queue + var node_id = queue[start++]; + var node_ix = layoutInfo.idToIndex[node_id]; + var node = layoutInfo.layoutNodes[node_ix]; + var children = node.children; + if (children.length > 0) { + // Add children nodes as a new graph to graph set + layoutInfo.graphSet.push(children); + // Add children to que queue to be visited + for (var i = 0; i < children.length; i++) { + queue[++end] = children[i]; + } + } + } + + // Create indexToGraph map + for (var i = 0; i < layoutInfo.graphSet.length; i++) { + var graph = layoutInfo.graphSet[i]; + for (var j = 0; j < graph.length; j++) { + var index = layoutInfo.idToIndex[graph[j]]; + layoutInfo.indexToGraph[index] = i; + } + } + + // Iterate over all edges, creating Layout Edges + for (var i = 0; i < layoutInfo.edgeSize; i++) { + var e = edges[i]; + var tempEdge = {}; + tempEdge.id = e.data('id'); + tempEdge.sourceId = e.data('source'); + tempEdge.targetId = e.data('target'); + + // Compute ideal length + var idealLength = is.fn(options.idealEdgeLength) ? options.idealEdgeLength(e) : options.idealEdgeLength; + var elasticity = is.fn(options.edgeElasticity) ? options.edgeElasticity(e) : options.edgeElasticity; + + // Check if it's an inter graph edge + var sourceIx = layoutInfo.idToIndex[tempEdge.sourceId]; + var targetIx = layoutInfo.idToIndex[tempEdge.targetId]; + var sourceGraph = layoutInfo.indexToGraph[sourceIx]; + var targetGraph = layoutInfo.indexToGraph[targetIx]; + + if (sourceGraph != targetGraph) { + // Find lowest common graph ancestor + var lca = findLCA(tempEdge.sourceId, tempEdge.targetId, layoutInfo); + + // Compute sum of node depths, relative to lca graph + var lcaGraph = layoutInfo.graphSet[lca]; + var depth = 0; + + // Source depth + var tempNode = layoutInfo.layoutNodes[sourceIx]; + while (-1 === lcaGraph.indexOf(tempNode.id)) { + tempNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[tempNode.parentId]]; + depth++; + } + + // Target depth + tempNode = layoutInfo.layoutNodes[targetIx]; + while (-1 === lcaGraph.indexOf(tempNode.id)) { + tempNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[tempNode.parentId]]; + depth++; + } + + // logDebug('LCA of nodes ' + tempEdge.sourceId + ' and ' + tempEdge.targetId + + // ". Index: " + lca + " Contents: " + lcaGraph.toString() + + // ". Depth: " + depth); + + // Update idealLength + idealLength *= depth * options.nestingFactor; + } + + tempEdge.idealLength = idealLength; + tempEdge.elasticity = elasticity; + + layoutInfo.layoutEdges.push(tempEdge); + } + + // Finally, return layoutInfo object + return layoutInfo; +}; + +/** + * @brief : This function finds the index of the lowest common + * graph ancestor between 2 nodes in the subtree + * (from the graph hierarchy induced tree) whose + * root is graphIx + * + * @arg node1: node1's ID + * @arg node2: node2's ID + * @arg layoutInfo: layoutInfo object + * + */ +var findLCA = function findLCA(node1, node2, layoutInfo) { + // Find their common ancester, starting from the root graph + var res = findLCA_aux(node1, node2, 0, layoutInfo); + if (2 > res.count) { + // If aux function couldn't find the common ancester, + // then it is the root graph + return 0; + } else { + return res.graph; + } +}; + +/** + * @brief : Auxiliary function used for LCA computation + * + * @arg node1 : node1's ID + * @arg node2 : node2's ID + * @arg graphIx : subgraph index + * @arg layoutInfo : layoutInfo object + * + * @return : object of the form {count: X, graph: Y}, where: + * X is the number of ancesters (max: 2) found in + * graphIx (and it's subgraphs), + * Y is the graph index of the lowest graph containing + * all X nodes + */ +var findLCA_aux = function findLCA_aux(node1, node2, graphIx, layoutInfo) { + var graph = layoutInfo.graphSet[graphIx]; + // If both nodes belongs to graphIx + if (-1 < graph.indexOf(node1) && -1 < graph.indexOf(node2)) { + return { count: 2, graph: graphIx }; + } + + // Make recursive calls for all subgraphs + var c = 0; + for (var i = 0; i < graph.length; i++) { + var nodeId = graph[i]; + var nodeIx = layoutInfo.idToIndex[nodeId]; + var children = layoutInfo.layoutNodes[nodeIx].children; + + // If the node has no child, skip it + if (0 === children.length) { + continue; + } + + var childGraphIx = layoutInfo.indexToGraph[layoutInfo.idToIndex[children[0]]]; + var result = findLCA_aux(node1, node2, childGraphIx, layoutInfo); + if (0 === result.count) { + // Neither node1 nor node2 are present in this subgraph + continue; + } else if (1 === result.count) { + // One of (node1, node2) is present in this subgraph + c++; + if (2 === c) { + // We've already found both nodes, no need to keep searching + break; + } + } else { + // Both nodes are present in this subgraph + return result; + } + } + + return { count: c, graph: graphIx }; +}; + +/** + * @brief: printsLayoutInfo into js console + * Only used for debbuging + */ +var printLayoutInfo = function printLayoutInfo(layoutInfo) { + /* eslint-disable */ + + if (!DEBUG) { + return; + } + console.debug('layoutNodes:'); + for (var i = 0; i < layoutInfo.nodeSize; i++) { + var n = layoutInfo.layoutNodes[i]; + var s = '\nindex: ' + i + '\nId: ' + n.id + '\nChildren: ' + n.children.toString() + '\nparentId: ' + n.parentId + '\npositionX: ' + n.positionX + '\npositionY: ' + n.positionY + '\nOffsetX: ' + n.offsetX + '\nOffsetY: ' + n.offsetY + '\npadLeft: ' + n.padLeft + '\npadRight: ' + n.padRight + '\npadTop: ' + n.padTop + '\npadBottom: ' + n.padBottom; + + console.debug(s); + } + + console.debug('idToIndex'); + for (var i in layoutInfo.idToIndex) { + console.debug('Id: ' + i + '\nIndex: ' + layoutInfo.idToIndex[i]); + } + + console.debug('Graph Set'); + var set = layoutInfo.graphSet; + for (var i = 0; i < set.length; i++) { + console.debug('Set : ' + i + ': ' + set[i].toString()); + } + + var s = 'IndexToGraph'; + for (var i = 0; i < layoutInfo.indexToGraph.length; i++) { + s += '\nIndex : ' + i + ' Graph: ' + layoutInfo.indexToGraph[i]; + } + console.debug(s); + + s = 'Layout Edges'; + for (var i = 0; i < layoutInfo.layoutEdges.length; i++) { + var e = layoutInfo.layoutEdges[i]; + s += '\nEdge Index: ' + i + ' ID: ' + e.id + ' SouceID: ' + e.sourceId + ' TargetId: ' + e.targetId + ' Ideal Length: ' + e.idealLength; + } + console.debug(s); + + s = 'nodeSize: ' + layoutInfo.nodeSize; + s += '\nedgeSize: ' + layoutInfo.edgeSize; + s += '\ntemperature: ' + layoutInfo.temperature; + console.debug(s); + + return; + /* eslint-enable */ +}; + +/** + * @brief : Randomizes the position of all nodes + */ +var randomizePositions = function randomizePositions(layoutInfo, cy) { + var width = layoutInfo.clientWidth; + var height = layoutInfo.clientHeight; + + for (var i = 0; i < layoutInfo.nodeSize; i++) { + var n = layoutInfo.layoutNodes[i]; + + // No need to randomize compound nodes or locked nodes + if (0 === n.children.length && !n.isLocked) { + n.positionX = Math.random() * width; + n.positionY = Math.random() * height; + } + } +}; + +/** + * @brief : Updates the positions of nodes in the network + * @arg layoutInfo : LayoutInfo object + * @arg cy : Cytoscape object + * @arg options : Layout options + */ +var refreshPositions = function refreshPositions(layoutInfo, cy, options) { + // var s = 'Refreshing positions'; + // logDebug(s); + + var layout = options.layout; + var nodes = options.eles.nodes(); + var bb = layoutInfo.boundingBox; + var coseBB = { x1: Infinity, x2: -Infinity, y1: Infinity, y2: -Infinity }; + + if (options.boundingBox) { + nodes.forEach(function (node) { + var lnode = layoutInfo.layoutNodes[layoutInfo.idToIndex[node.data('id')]]; + + coseBB.x1 = Math.min(coseBB.x1, lnode.positionX); + coseBB.x2 = Math.max(coseBB.x2, lnode.positionX); + + coseBB.y1 = Math.min(coseBB.y1, lnode.positionY); + coseBB.y2 = Math.max(coseBB.y2, lnode.positionY); + }); + + coseBB.w = coseBB.x2 - coseBB.x1; + coseBB.h = coseBB.y2 - coseBB.y1; + } + + nodes.positions(function (ele, i) { + var lnode = layoutInfo.layoutNodes[layoutInfo.idToIndex[ele.data('id')]]; + // s = "Node: " + lnode.id + ". Refreshed position: (" + + // lnode.positionX + ", " + lnode.positionY + ")."; + // logDebug(s); + + if (options.boundingBox) { + // then add extra bounding box constraint + var pctX = (lnode.positionX - coseBB.x1) / coseBB.w; + var pctY = (lnode.positionY - coseBB.y1) / coseBB.h; + + return { + x: bb.x1 + pctX * bb.w, + y: bb.y1 + pctY * bb.h + }; + } else { + return { + x: lnode.positionX, + y: lnode.positionY + }; + } + }); + + // Trigger layoutReady only on first call + if (true !== layoutInfo.ready) { + // s = 'Triggering layoutready'; + // logDebug(s); + layoutInfo.ready = true; + layout.one('layoutready', options.ready); + layout.emit({ type: 'layoutready', layout: this }); + } +}; + +/** + * @brief : Logs a debug message in JS console, if DEBUG is ON + */ +// var logDebug = function(text) { +// if (DEBUG) { +// console.debug(text); +// } +// }; + +module.exports = CoseLayout; + +/***/ }), +/* 102 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var math = __webpack_require__(2); + +var defaults = { + fit: true, // whether to fit the viewport to the graph + padding: 30, // padding used on fit + boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space + avoidOverlapPadding: 10, // extra spacing around nodes when avoidOverlap: true + nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm + spacingFactor: undefined, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up + condense: false, // uses all available space on false, uses minimal space on true + rows: undefined, // force num of rows in the grid + cols: undefined, // force num of columns in the grid + position: function position(node) {}, // returns { row, col } for element + sort: undefined, // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } + animate: false, // whether to transition the node positions + animationDuration: 500, // duration of animation in ms if enabled + animationEasing: undefined, // easing of animation if enabled + animateFilter: function animateFilter(node, i) { + return true; + }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts + ready: undefined, // callback on layoutready + stop: undefined, // callback on layoutstop + transform: function transform(node, position) { + return position; + } // transform a given node position. Useful for changing flow direction in discrete layouts +}; + +function GridLayout(options) { + this.options = util.extend({}, defaults, options); +} + +GridLayout.prototype.run = function () { + var params = this.options; + var options = params; + + var cy = params.cy; + var eles = options.eles; + var nodes = eles.nodes().not(':parent'); + + if (options.sort) { + nodes = nodes.sort(options.sort); + } + + var bb = math.makeBoundingBox(options.boundingBox ? options.boundingBox : { + x1: 0, y1: 0, w: cy.width(), h: cy.height() + }); + + if (bb.h === 0 || bb.w === 0) { + nodes.layoutPositions(this, options, function (ele) { + return { x: bb.x1, y: bb.y1 }; + }); + } else { + + // width/height * splits^2 = cells where splits is number of times to split width + var cells = nodes.size(); + var splits = Math.sqrt(cells * bb.h / bb.w); + var rows = Math.round(splits); + var cols = Math.round(bb.w / bb.h * splits); + + var small = function small(val) { + if (val == null) { + return Math.min(rows, cols); + } else { + var min = Math.min(rows, cols); + if (min == rows) { + rows = val; + } else { + cols = val; + } + } + }; + + var large = function large(val) { + if (val == null) { + return Math.max(rows, cols); + } else { + var max = Math.max(rows, cols); + if (max == rows) { + rows = val; + } else { + cols = val; + } + } + }; + + var oRows = options.rows; + var oCols = options.cols != null ? options.cols : options.columns; + + // if rows or columns were set in options, use those values + if (oRows != null && oCols != null) { + rows = oRows; + cols = oCols; + } else if (oRows != null && oCols == null) { + rows = oRows; + cols = Math.ceil(cells / rows); + } else if (oRows == null && oCols != null) { + cols = oCols; + rows = Math.ceil(cells / cols); + } + + // otherwise use the automatic values and adjust accordingly + + // if rounding was up, see if we can reduce rows or columns + else if (cols * rows > cells) { + var sm = small(); + var lg = large(); + + // reducing the small side takes away the most cells, so try it first + if ((sm - 1) * lg >= cells) { + small(sm - 1); + } else if ((lg - 1) * sm >= cells) { + large(lg - 1); + } + } else { + + // if rounding was too low, add rows or columns + while (cols * rows < cells) { + var _sm = small(); + var _lg = large(); + + // try to add to larger side first (adds less in multiplication) + if ((_lg + 1) * _sm >= cells) { + large(_lg + 1); + } else { + small(_sm + 1); + } + } + } + + var cellWidth = bb.w / cols; + var cellHeight = bb.h / rows; + + if (options.condense) { + cellWidth = 0; + cellHeight = 0; + } + + if (options.avoidOverlap) { + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + var pos = node._private.position; + + if (pos.x == null || pos.y == null) { + // for bb + pos.x = 0; + pos.y = 0; + } + + var nbb = node.layoutDimensions(options); + var p = options.avoidOverlapPadding; + + var w = nbb.w + p; + var h = nbb.h + p; + + cellWidth = Math.max(cellWidth, w); + cellHeight = Math.max(cellHeight, h); + } + } + + var cellUsed = {}; // e.g. 'c-0-2' => true + + var used = function used(row, col) { + return cellUsed['c-' + row + '-' + col] ? true : false; + }; + + var use = function use(row, col) { + cellUsed['c-' + row + '-' + col] = true; + }; + + // to keep track of current cell position + var row = 0; + var col = 0; + var moveToNextCell = function moveToNextCell() { + col++; + if (col >= cols) { + col = 0; + row++; + } + }; + + // get a cache of all the manual positions + var id2manPos = {}; + for (var _i = 0; _i < nodes.length; _i++) { + var _node = nodes[_i]; + var rcPos = options.position(_node); + + if (rcPos && (rcPos.row !== undefined || rcPos.col !== undefined)) { + // must have at least row or col def'd + var _pos = { + row: rcPos.row, + col: rcPos.col + }; + + if (_pos.col === undefined) { + // find unused col + _pos.col = 0; + + while (used(_pos.row, _pos.col)) { + _pos.col++; + } + } else if (_pos.row === undefined) { + // find unused row + _pos.row = 0; + + while (used(_pos.row, _pos.col)) { + _pos.row++; + } + } + + id2manPos[_node.id()] = _pos; + use(_pos.row, _pos.col); + } + } + + var getPos = function getPos(element, i) { + var x = void 0, + y = void 0; + + if (element.locked() || element.isParent()) { + return false; + } + + // see if we have a manual position set + var rcPos = id2manPos[element.id()]; + if (rcPos) { + x = rcPos.col * cellWidth + cellWidth / 2 + bb.x1; + y = rcPos.row * cellHeight + cellHeight / 2 + bb.y1; + } else { + // otherwise set automatically + + while (used(row, col)) { + moveToNextCell(); + } + + x = col * cellWidth + cellWidth / 2 + bb.x1; + y = row * cellHeight + cellHeight / 2 + bb.y1; + use(row, col); + + moveToNextCell(); + } + + return { x: x, y: y }; + }; + + nodes.layoutPositions(this, options, getPos); + } + + return this; // chaining +}; + +module.exports = GridLayout; + +/***/ }), +/* 103 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); + +// default layout options +var defaults = { + ready: function ready() {}, // on layoutready + stop: function stop() {} // on layoutstop +}; + +// constructor +// options : object containing layout options +function NullLayout(options) { + this.options = util.extend({}, defaults, options); +} + +// runs the layout +NullLayout.prototype.run = function () { + var options = this.options; + var eles = options.eles; // elements to consider in the layout + var layout = this; + + // cy is automatically populated for us in the constructor + var cy = options.cy; // jshint ignore:line + + layout.emit('layoutstart'); + + // puts all nodes at (0, 0) + eles.nodes().positions(function () { + return { + x: 0, + y: 0 + }; + }); + + // trigger layoutready when each node has had its position set at least once + layout.one('layoutready', options.ready); + layout.emit('layoutready'); + + // trigger layoutstop when the layout stops (e.g. finishes) + layout.one('layoutstop', options.stop); + layout.emit('layoutstop'); + + return this; // chaining +}; + +// called on continuous layouts to stop them before they finish +NullLayout.prototype.stop = function () { + return this; // chaining +}; + +module.exports = NullLayout; + +/***/ }), +/* 104 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var is = __webpack_require__(0); + +var defaults = { + positions: undefined, // map of (node id) => (position obj); or function(node){ return somPos; } + zoom: undefined, // the zoom level to set (prob want fit = false if set) + pan: undefined, // the pan level to set (prob want fit = false if set) + fit: true, // whether to fit to viewport + padding: 30, // padding on fit + animate: false, // whether to transition the node positions + animationDuration: 500, // duration of animation in ms if enabled + animationEasing: undefined, // easing of animation if enabled + animateFilter: function animateFilter(node, i) { + return true; + }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts + ready: undefined, // callback on layoutready + stop: undefined, // callback on layoutstop + transform: function transform(node, position) { + return position; + } // transform a given node position. Useful for changing flow direction in discrete layouts +}; + +function PresetLayout(options) { + this.options = util.extend({}, defaults, options); +} + +PresetLayout.prototype.run = function () { + var options = this.options; + var eles = options.eles; + + var nodes = eles.nodes(); + var posIsFn = is.fn(options.positions); + + function getPosition(node) { + if (options.positions == null) { + return null; + } + + if (posIsFn) { + return options.positions(node); + } + + var pos = options.positions[node._private.data.id]; + + if (pos == null) { + return null; + } + + return pos; + } + + nodes.layoutPositions(this, options, function (node, i) { + var position = getPosition(node); + + if (node.locked() || position == null) { + return false; + } + + return position; + }); + + return this; // chaining +}; + +module.exports = PresetLayout; + +/***/ }), +/* 105 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var math = __webpack_require__(2); + +var defaults = { + fit: true, // whether to fit to viewport + padding: 30, // fit padding + boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + animate: false, // whether to transition the node positions + animationDuration: 500, // duration of animation in ms if enabled + animationEasing: undefined, // easing of animation if enabled + animateFilter: function animateFilter(node, i) { + return true; + }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts + ready: undefined, // callback on layoutready + stop: undefined, // callback on layoutstop + transform: function transform(node, position) { + return position; + } // transform a given node position. Useful for changing flow direction in discrete layouts +}; + +function RandomLayout(options) { + this.options = util.extend({}, defaults, options); +} + +RandomLayout.prototype.run = function () { + var options = this.options; + var cy = options.cy; + var eles = options.eles; + var nodes = eles.nodes().not(':parent'); + + var bb = math.makeBoundingBox(options.boundingBox ? options.boundingBox : { + x1: 0, y1: 0, w: cy.width(), h: cy.height() + }); + + var getPos = function getPos(node, i) { + return { + x: bb.x1 + Math.round(Math.random() * bb.w), + y: bb.y1 + Math.round(Math.random() * bb.h) + }; + }; + + nodes.layoutPositions(this, options, getPos); + + return this; // chaining +}; + +module.exports = RandomLayout; + +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = [{ name: 'null', impl: __webpack_require__(107) }, { name: 'base', impl: __webpack_require__(108) }, { name: 'canvas', impl: __webpack_require__(124) }]; + +/***/ }), +/* 107 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function NullRenderer(options) { + this.options = options; + this.notifications = 0; // for testing +} + +var noop = function noop() {}; + +NullRenderer.prototype = { + recalculateRenderedStyle: noop, + notify: function notify() { + this.notifications++; + }, + init: noop +}; + +module.exports = NullRenderer; + +/***/ }), +/* 108 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var util = __webpack_require__(1); +var window = __webpack_require__(3); + +var BaseRenderer = function BaseRenderer(options) { + this.init(options); +}; +var BR = BaseRenderer; +var BRp = BR.prototype; + +BRp.clientFunctions = ['redrawHint', 'render', 'renderTo', 'matchCanvasSize', 'nodeShapeImpl', 'arrowShapeImpl']; + +BRp.init = function (options) { + var r = this; + + r.options = options; + + r.cy = options.cy; + + var ctr = r.container = options.cy.container(); + + // prepend a stylesheet in the head such that + if (window) { + var document = window.document; + var head = document.head; + var stylesheetId = '__________cytoscape_stylesheet'; + var className = '__________cytoscape_container'; + var stylesheetAlreadyExists = document.getElementById(stylesheetId) != null; + + if (ctr.className.indexOf(className) < 0) { + ctr.className = (ctr.className || '') + ' ' + className; + } + + if (!stylesheetAlreadyExists) { + var stylesheet = document.createElement('style'); + + stylesheet.id = stylesheetId; + stylesheet.innerHTML = '.' + className + ' { position: relative; }'; + + head.insertBefore(stylesheet, head.children[0]); // first so lowest priority + } + + var computedStyle = window.getComputedStyle(ctr); + var position = computedStyle.getPropertyValue('position'); + + if (position === 'static') { + util.error('A Cytoscape container has style position:static and so can not use UI extensions properly'); + } + } + + r.selection = [undefined, undefined, undefined, undefined, 0]; // Coordinates for selection box, plus enabled flag + + r.bezierProjPcts = [0.05, 0.225, 0.4, 0.5, 0.6, 0.775, 0.95]; + + //--Pointer-related data + r.hoverData = { down: null, last: null, + downTime: null, triggerMode: null, + dragging: false, + initialPan: [null, null], capture: false }; + + r.dragData = { possibleDragElements: [] }; + + r.touchData = { + start: null, capture: false, + + // These 3 fields related to tap, taphold events + startPosition: [null, null, null, null, null, null], + singleTouchStartTime: null, + singleTouchMoved: true, + + now: [null, null, null, null, null, null], + earlier: [null, null, null, null, null, null] + }; + + r.redraws = 0; + r.showFps = options.showFps; + r.debug = options.debug; + + r.hideEdgesOnViewport = options.hideEdgesOnViewport; + r.hideLabelsOnViewport = options.hideLabelsOnViewport; + r.textureOnViewport = options.textureOnViewport; + r.wheelSensitivity = options.wheelSensitivity; + r.motionBlurEnabled = options.motionBlur; // on by default + r.forcedPixelRatio = options.pixelRatio; + r.motionBlur = options.motionBlur; // for initial kick off + r.motionBlurOpacity = options.motionBlurOpacity; + r.motionBlurTransparency = 1 - r.motionBlurOpacity; + r.motionBlurPxRatio = 1; + r.mbPxRBlurry = 1; //0.8; + r.minMbLowQualFrames = 4; + r.fullQualityMb = false; + r.clearedForMotionBlur = []; + r.desktopTapThreshold = options.desktopTapThreshold; + r.desktopTapThreshold2 = options.desktopTapThreshold * options.desktopTapThreshold; + r.touchTapThreshold = options.touchTapThreshold; + r.touchTapThreshold2 = options.touchTapThreshold * options.touchTapThreshold; + r.tapholdDuration = 500; + + r.bindings = []; + r.beforeRenderCallbacks = []; + r.beforeRenderPriorities = { // higher priority execs before lower one + animations: 400, + eleCalcs: 300, + eleTxrDeq: 200, + lyrTxrDeq: 100 + }; + + r.registerNodeShapes(); + r.registerArrowShapes(); + r.registerCalculationListeners(); +}; + +BRp.notify = function (params) { + var types; + var r = this; + + // the renderer can't be notified after it's destroyed + if (this.destroyed) { + return; + } + + if (is.array(params.type)) { + types = params.type; + } else { + types = [params.type]; + } + + var has = {}; + for (var i = 0; i < types.length; i++) { + var type = types[i]; + + has[type] = true; + } // for + + if (has['init']) { + r.load(); + return; + } + + if (has['destroy']) { + r.destroy(); + return; + } + + if (has['add'] || has['remove'] || has['load'] || has['zorder']) { + r.invalidateCachedZSortedEles(); + } + + if (has['viewport']) { + r.redrawHint('select', true); + } + + if (has['load'] || has['resize']) { + r.invalidateContainerClientCoordsCache(); + r.matchCanvasSize(r.container); + } + + r.redrawHint('eles', true); + r.redrawHint('drag', true); + + this.startRenderLoop(); + + this.redraw(); +}; + +BRp.destroy = function () { + var r = this; + + r.destroyed = true; + + r.cy.stopAnimationLoop(); + + for (var i = 0; i < r.bindings.length; i++) { + var binding = r.bindings[i]; + var b = binding; + var tgt = b.target; + + (tgt.off || tgt.removeEventListener).apply(tgt, b.args); + } + + r.bindings = []; + r.beforeRenderCallbacks = []; + r.onUpdateEleCalcsFns = []; + + if (r.removeObserver) { + r.removeObserver.disconnect(); + } + + if (r.styleObserver) { + r.styleObserver.disconnect(); + } + + if (r.labelCalcDiv) { + try { + document.body.removeChild(r.labelCalcDiv); // eslint-disable-line no-undef + } catch (e) { + // ie10 issue #1014 + } + } +}; + +[__webpack_require__(109), __webpack_require__(110), __webpack_require__(120), __webpack_require__(121), __webpack_require__(122), __webpack_require__(123)].forEach(function (props) { + util.extend(BRp, props); +}); + +module.exports = BR; + +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var math = __webpack_require__(2); +var is = __webpack_require__(0); +var util = __webpack_require__(1); + +var BRp = {}; + +BRp.arrowShapeWidth = 0.3; + +BRp.registerArrowShapes = function () { + var arrowShapes = this.arrowShapes = {}; + var renderer = this; + + // Contract for arrow shapes: + // 0, 0 is arrow tip + // (0, 1) is direction towards node + // (1, 0) is right + // + // functional api: + // collide: check x, y in shape + // roughCollide: called before collide, no false negatives + // draw: draw + // spacing: dist(arrowTip, nodeBoundary) + // gap: dist(edgeTip, nodeBoundary), edgeTip may != arrowTip + + var bbCollide = function bbCollide(x, y, size, angle, translation, edgeWidth, padding) { + var x1 = translation.x - size / 2 - padding; + var x2 = translation.x + size / 2 + padding; + var y1 = translation.y - size / 2 - padding; + var y2 = translation.y + size / 2 + padding; + + var inside = x1 <= x && x <= x2 && y1 <= y && y <= y2; + + return inside; + }; + + var transform = function transform(x, y, size, angle, translation) { + var xRotated = x * Math.cos(angle) - y * Math.sin(angle); + var yRotated = x * Math.sin(angle) + y * Math.cos(angle); + + var xScaled = xRotated * size; + var yScaled = yRotated * size; + + var xTranslated = xScaled + translation.x; + var yTranslated = yScaled + translation.y; + + return { + x: xTranslated, + y: yTranslated + }; + }; + + var transformPoints = function transformPoints(pts, size, angle, translation) { + var retPts = []; + + for (var i = 0; i < pts.length; i += 2) { + var x = pts[i]; + var y = pts[i + 1]; + + retPts.push(transform(x, y, size, angle, translation)); + } + + return retPts; + }; + + var pointsToArr = function pointsToArr(pts) { + var ret = []; + + for (var i = 0; i < pts.length; i++) { + var p = pts[i]; + + ret.push(p.x, p.y); + } + + return ret; + }; + + var standardGap = function standardGap(edge) { + return edge.pstyle('width').pfValue * edge.pstyle('arrow-scale').pfValue * 2; + }; + + var defineArrowShape = function defineArrowShape(name, defn) { + if (is.string(defn)) { + defn = arrowShapes[defn]; + } + + arrowShapes[name] = util.extend({ + name: name, + + points: [-0.15, -0.3, 0.15, -0.3, 0.15, 0.3, -0.15, 0.3], + + collide: function collide(x, y, size, angle, translation, padding) { + var points = pointsToArr(transformPoints(this.points, size + 2 * padding, angle, translation)); + var inside = math.pointInsidePolygonPoints(x, y, points); + + return inside; + }, + + roughCollide: bbCollide, + + draw: function draw(context, size, angle, translation) { + var points = transformPoints(this.points, size, angle, translation); + + renderer.arrowShapeImpl('polygon')(context, points); + }, + + spacing: function spacing(edge) { + return 0; + }, + + gap: standardGap + }, defn); + }; + + defineArrowShape('none', { + collide: util.falsify, + + roughCollide: util.falsify, + + draw: util.noop, + + spacing: util.zeroify, + + gap: util.zeroify + }); + + defineArrowShape('triangle', { + points: [-0.15, -0.3, 0, 0, 0.15, -0.3] + }); + + defineArrowShape('arrow', 'triangle'); + + defineArrowShape('triangle-backcurve', { + points: arrowShapes['triangle'].points, + + controlPoint: [0, -0.15], + + roughCollide: bbCollide, + + draw: function draw(context, size, angle, translation, edgeWidth) { + var ptsTrans = transformPoints(this.points, size, angle, translation); + var ctrlPt = this.controlPoint; + var ctrlPtTrans = transform(ctrlPt[0], ctrlPt[1], size, angle, translation); + + renderer.arrowShapeImpl(this.name)(context, ptsTrans, ctrlPtTrans); + }, + + gap: function gap(edge) { + return standardGap(edge) * 0.8; + } + }); + + defineArrowShape('triangle-tee', { + points: [-0.15, -0.3, 0, 0, 0.15, -0.3, -0.15, -0.3], + + pointsTee: [-0.15, -0.4, -0.15, -0.5, 0.15, -0.5, 0.15, -0.4], + + collide: function collide(x, y, size, angle, translation, edgeWidth, padding) { + var triPts = pointsToArr(transformPoints(this.points, size + 2 * padding, angle, translation)); + var teePts = pointsToArr(transformPoints(this.pointsTee, size + 2 * padding, angle, translation)); + + var inside = math.pointInsidePolygonPoints(x, y, triPts) || math.pointInsidePolygonPoints(x, y, teePts); + + return inside; + }, + + draw: function draw(context, size, angle, translation, edgeWidth) { + var triPts = transformPoints(this.points, size, angle, translation); + var teePts = transformPoints(this.pointsTee, size, angle, translation); + + renderer.arrowShapeImpl(this.name)(context, triPts, teePts); + } + }); + + defineArrowShape('triangle-cross', { + points: [-0.15, -0.3, 0, 0, 0.15, -0.3, -0.15, -0.3], + + baseCrossLinePts: [-0.15, -0.4, // first half of the rectangle + -0.15, -0.4, 0.15, -0.4, // second half of the rectangle + 0.15, -0.4], + + crossLinePts: function crossLinePts(size, edgeWidth) { + // shift points so that the distance between the cross points matches edge width + var p = this.baseCrossLinePts.slice(); + var shiftFactor = edgeWidth / size; + var y0 = 3; + var y1 = 5; + + p[y0] = p[y0] - shiftFactor; + p[y1] = p[y1] - shiftFactor; + + return p; + }, + + collide: function collide(x, y, size, angle, translation, edgeWidth, padding) { + var triPts = pointsToArr(transformPoints(this.points, size + 2 * padding, angle, translation)); + var teePts = pointsToArr(transformPoints(this.crossLinePts(size, edgeWidth), size + 2 * padding, angle, translation)); + var inside = math.pointInsidePolygonPoints(x, y, triPts) || math.pointInsidePolygonPoints(x, y, teePts); + + return inside; + }, + + draw: function draw(context, size, angle, translation, edgeWidth) { + var triPts = transformPoints(this.points, size, angle, translation); + var crossLinePts = transformPoints(this.crossLinePts(size, edgeWidth), size, angle, translation); + + renderer.arrowShapeImpl(this.name)(context, triPts, crossLinePts); + } + }); + + defineArrowShape('vee', { + points: [-0.15, -0.3, 0, 0, 0.15, -0.3, 0, -0.15], + + gap: function gap(edge) { + return standardGap(edge) * 0.525; + } + }); + + defineArrowShape('circle', { + radius: 0.15, + + collide: function collide(x, y, size, angle, translation, edgeWidth, padding) { + var t = translation; + var inside = Math.pow(t.x - x, 2) + Math.pow(t.y - y, 2) <= Math.pow((size + 2 * padding) * this.radius, 2); + + return inside; + }, + + draw: function draw(context, size, angle, translation, edgeWidth) { + renderer.arrowShapeImpl(this.name)(context, translation.x, translation.y, this.radius * size); + }, + + spacing: function spacing(edge) { + return renderer.getArrowWidth(edge.pstyle('width').pfValue, edge.pstyle('arrow-scale').value) * this.radius; + } + }); + + defineArrowShape('tee', { + points: [-0.15, 0, -0.15, -0.1, 0.15, -0.1, 0.15, 0], + + spacing: function spacing(edge) { + return 1; + }, + + gap: function gap(edge) { + return 1; + } + }); + + defineArrowShape('square', { + points: [-0.15, 0.00, 0.15, 0.00, 0.15, -0.3, -0.15, -0.3] + }); + + defineArrowShape('diamond', { + points: [-0.15, -0.15, 0, -0.3, 0.15, -0.15, 0, 0], + + gap: function gap(edge) { + return edge.pstyle('width').pfValue * edge.pstyle('arrow-scale').value; + } + }); +}; + +module.exports = BRp; + +/***/ }), +/* 110 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); + +var BRp = {}; + +[__webpack_require__(111), __webpack_require__(112), __webpack_require__(113), __webpack_require__(114), __webpack_require__(115), __webpack_require__(116), __webpack_require__(117), __webpack_require__(118), __webpack_require__(119)].forEach(function (props) { + util.extend(BRp, props); +}); + +module.exports = BRp; + +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var window = __webpack_require__(3); +var math = __webpack_require__(2); +var util = __webpack_require__(1); +var window = __webpack_require__(3); + +var BRp = {}; + +// Project mouse +BRp.projectIntoViewport = function (clientX, clientY) { + var cy = this.cy; + var offsets = this.findContainerClientCoords(); + var offsetLeft = offsets[0]; + var offsetTop = offsets[1]; + var scale = offsets[4]; + var pan = cy.pan(); + var zoom = cy.zoom(); + + var x = ((clientX - offsetLeft) / scale - pan.x) / zoom; + var y = ((clientY - offsetTop) / scale - pan.y) / zoom; + + return [x, y]; +}; + +BRp.findContainerClientCoords = function () { + if (this.containerBB) { + return this.containerBB; + } + + var container = this.container; + var rect = container.getBoundingClientRect(); + var style = window.getComputedStyle(container); + var styleValue = function styleValue(name) { + return parseFloat(style.getPropertyValue(name)); + }; + + var padding = { + left: styleValue('padding-left'), + right: styleValue('padding-right'), + top: styleValue('padding-top'), + bottom: styleValue('padding-bottom') + }; + + var border = { + left: styleValue('border-left-width'), + right: styleValue('border-right-width'), + top: styleValue('border-top-width'), + bottom: styleValue('border-bottom-width') + }; + + var clientWidth = container.clientWidth; + var clientHeight = container.clientHeight; + + var paddingHor = padding.left + padding.right; + var paddingVer = padding.top + padding.bottom; + + var borderHor = border.left + border.right; + var borderVer = border.top + border.bottom; + + var scale = rect.width / (clientWidth + borderHor); + + var unscaledW = clientWidth - paddingHor; + var unscaledH = clientHeight - paddingVer; + + var scaledW = rect.width - (paddingHor + borderHor) * scale; + var scaledH = rect.height - (paddingVer + borderVer) * scale; + + var left = rect.left + padding.left + border.left; + var top = rect.top + padding.top + border.top; + + return this.containerBB = [left, top, unscaledW, unscaledH, scale]; +}; + +BRp.invalidateContainerClientCoordsCache = function () { + this.containerBB = null; +}; + +BRp.findNearestElement = function (x, y, interactiveElementsOnly, isTouch) { + return this.findNearestElements(x, y, interactiveElementsOnly, isTouch)[0]; +}; + +BRp.findNearestElements = function (x, y, interactiveElementsOnly, isTouch) { + var self = this; + var r = this; + var eles = r.getCachedZSortedEles(); + var near = []; // 1 node max, 1 edge max + var zoom = r.cy.zoom(); + var hasCompounds = r.cy.hasCompoundNodes(); + var edgeThreshold = (isTouch ? 24 : 8) / zoom; + var nodeThreshold = (isTouch ? 8 : 2) / zoom; + var labelThreshold = (isTouch ? 8 : 2) / zoom; + var minSqDist = Infinity; + var nearEdge; + var nearNode; + + if (interactiveElementsOnly) { + eles = eles.interactive; + } + + function addEle(ele, sqDist) { + if (ele.isNode()) { + if (nearNode) { + return; // can't replace node + } else { + nearNode = ele; + near.push(ele); + } + } + + if (ele.isEdge() && (sqDist == null || sqDist < minSqDist)) { + if (nearEdge) { + // then replace existing edge + // can replace only if same z-index + if (nearEdge.pstyle('z-index').value === ele.pstyle('z-index').value) { + for (var i = 0; i < near.length; i++) { + if (near[i].isEdge()) { + near[i] = ele; + nearEdge = ele; + minSqDist = sqDist != null ? sqDist : minSqDist; + break; + } + } + } + } else { + near.push(ele); + nearEdge = ele; + minSqDist = sqDist != null ? sqDist : minSqDist; + } + } + } + + function checkNode(node) { + var width = node.outerWidth() + 2 * nodeThreshold; + var height = node.outerHeight() + 2 * nodeThreshold; + var hw = width / 2; + var hh = height / 2; + var pos = node.position(); + + if (pos.x - hw <= x && x <= pos.x + hw // bb check x + && pos.y - hh <= y && y <= pos.y + hh // bb check y + ) { + var shape = r.nodeShapes[self.getNodeShape(node)]; + + if (shape.checkPoint(x, y, 0, width, height, pos.x, pos.y)) { + addEle(node, 0); + return true; + } + } + } + + function checkEdge(edge) { + var _p = edge._private; + + var rs = _p.rscratch; + var styleWidth = edge.pstyle('width').pfValue; + var scale = edge.pstyle('arrow-scale').value; + var width = styleWidth / 2 + edgeThreshold; // more like a distance radius from centre + var widthSq = width * width; + var width2 = width * 2; + var src = _p.source; + var tgt = _p.target; + var inEdgeBB = false; + var sqDist; + + if (rs.edgeType === 'segments' || rs.edgeType === 'straight' || rs.edgeType === 'haystack') { + var pts = rs.allpts; + + for (var i = 0; i + 3 < pts.length; i += 2) { + if ((inEdgeBB = math.inLineVicinity(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3], width2)) && widthSq > (sqDist = math.sqdistToFiniteLine(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3]))) { + addEle(edge, sqDist); + return true; + } + } + } else if (rs.edgeType === 'bezier' || rs.edgeType === 'multibezier' || rs.edgeType === 'self' || rs.edgeType === 'compound') { + var pts = rs.allpts; + for (var i = 0; i + 5 < rs.allpts.length; i += 4) { + if ((inEdgeBB = math.inBezierVicinity(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3], pts[i + 4], pts[i + 5], width2)) && widthSq > (sqDist = math.sqdistToQuadraticBezier(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3], pts[i + 4], pts[i + 5]))) { + addEle(edge, sqDist); + return true; + } + } + } + + // if we're close to the edge but didn't hit it, maybe we hit its arrows + + var src = src || _p.source; + var tgt = tgt || _p.target; + + var arSize = self.getArrowWidth(styleWidth, scale); + + var arrows = [{ name: 'source', x: rs.arrowStartX, y: rs.arrowStartY, angle: rs.srcArrowAngle }, { name: 'target', x: rs.arrowEndX, y: rs.arrowEndY, angle: rs.tgtArrowAngle }, { name: 'mid-source', x: rs.midX, y: rs.midY, angle: rs.midsrcArrowAngle }, { name: 'mid-target', x: rs.midX, y: rs.midY, angle: rs.midtgtArrowAngle }]; + + for (var i = 0; i < arrows.length; i++) { + var ar = arrows[i]; + var shape = r.arrowShapes[edge.pstyle(ar.name + '-arrow-shape').value]; + var edgeWidth = edge.pstyle('width').pfValue; + if (shape.roughCollide(x, y, arSize, ar.angle, { x: ar.x, y: ar.y }, edgeWidth, edgeThreshold) && shape.collide(x, y, arSize, ar.angle, { x: ar.x, y: ar.y }, edgeWidth, edgeThreshold)) { + addEle(edge); + return true; + } + } + + // for compound graphs, hitting edge may actually want a connected node instead (b/c edge may have greater z-index precedence) + if (hasCompounds && near.length > 0) { + checkNode(src); + checkNode(tgt); + } + } + + function preprop(obj, name, pre) { + return util.getPrefixedProperty(obj, name, pre); + } + + function checkLabel(ele, prefix) { + var _p = ele._private; + var th = labelThreshold; + + var prefixDash; + if (prefix) { + prefixDash = prefix + '-'; + } else { + prefixDash = ''; + } + + var text = ele.pstyle(prefixDash + 'label').value; + var eventsEnabled = ele.pstyle('text-events').strValue === 'yes'; + + if (!eventsEnabled || !text) { + return; + } + + var rstyle = _p.rstyle; + var bw = ele.pstyle('text-border-width').pfValue; + var pw = ele.pstyle('text-background-padding').pfValue; + var lw = preprop(rstyle, 'labelWidth', prefix) + bw + 2 * th + 2 * pw; + var lh = preprop(rstyle, 'labelHeight', prefix) + bw + 2 * th + 2 * pw; + var lx = preprop(rstyle, 'labelX', prefix); + var ly = preprop(rstyle, 'labelY', prefix); + + var theta = preprop(_p.rscratch, 'labelAngle', prefix); + + var lx1 = lx - lw / 2; + var lx2 = lx + lw / 2; + var ly1 = ly - lh / 2; + var ly2 = ly + lh / 2; + + if (theta) { + var cos = Math.cos(theta); + var sin = Math.sin(theta); + + var rotate = function rotate(x, y) { + x = x - lx; + y = y - ly; + + return { + x: x * cos - y * sin + lx, + y: x * sin + y * cos + ly + }; + }; + + var px1y1 = rotate(lx1, ly1); + var px1y2 = rotate(lx1, ly2); + var px2y1 = rotate(lx2, ly1); + var px2y2 = rotate(lx2, ly2); + + var points = [px1y1.x, px1y1.y, px2y1.x, px2y1.y, px2y2.x, px2y2.y, px1y2.x, px1y2.y]; + + if (math.pointInsidePolygonPoints(x, y, points)) { + addEle(ele); + return true; + } + } else { + // do a cheaper bb check + var bb = { + w: lw, + h: lh, + x1: lx1, + x2: lx2, + y1: ly1, + y2: ly2 + }; + + if (math.inBoundingBox(bb, x, y)) { + addEle(ele); + return true; + } + } + } + + for (var i = eles.length - 1; i >= 0; i--) { + // reverse order for precedence + var ele = eles[i]; + + if (ele.isNode()) { + checkNode(ele) || checkLabel(ele); + } else { + // then edge + checkEdge(ele) || checkLabel(ele) || checkLabel(ele, 'source') || checkLabel(ele, 'target'); + } + } + + return near; +}; + +// 'Give me everything from this box' +BRp.getAllInBox = function (x1, y1, x2, y2) { + var eles = this.getCachedZSortedEles().interactive; + var box = []; + + var x1c = Math.min(x1, x2); + var x2c = Math.max(x1, x2); + var y1c = Math.min(y1, y2); + var y2c = Math.max(y1, y2); + + x1 = x1c; + x2 = x2c; + y1 = y1c; + y2 = y2c; + + var boxBb = math.makeBoundingBox({ + x1: x1, y1: y1, + x2: x2, y2: y2 + }); + + for (var e = 0; e < eles.length; e++) { + var ele = eles[e]; + + if (ele.isNode()) { + var node = ele; + var nodeBb = node.boundingBox({ + includeNodes: true, + includeEdges: false, + includeLabels: false + }); + + if (math.boundingBoxesIntersect(boxBb, nodeBb) && !math.boundingBoxInBoundingBox(nodeBb, boxBb)) { + box.push(node); + } + } else { + var edge = ele; + var _p = edge._private; + var rs = _p.rscratch; + + if (rs.startX != null && rs.startY != null && !math.inBoundingBox(boxBb, rs.startX, rs.startY)) { + continue; + } + if (rs.endX != null && rs.endY != null && !math.inBoundingBox(boxBb, rs.endX, rs.endY)) { + continue; + } + + if (rs.edgeType === 'bezier' || rs.edgeType === 'multibezier' || rs.edgeType === 'self' || rs.edgeType === 'compound' || rs.edgeType === 'segments' || rs.edgeType === 'haystack') { + + var pts = _p.rstyle.bezierPts || _p.rstyle.linePts || _p.rstyle.haystackPts; + var allInside = true; + + for (var i = 0; i < pts.length; i++) { + if (!math.pointInBoundingBox(boxBb, pts[i])) { + allInside = false; + break; + } + } + + if (allInside) { + box.push(edge); + } + } else if (rs.edgeType === 'haystack' || rs.edgeType === 'straight') { + box.push(edge); + } + } + } + + return box; +}; + +module.exports = BRp; + +/***/ }), +/* 112 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var math = __webpack_require__(2); + +var BRp = {}; + +BRp.calculateArrowAngles = function (edge) { + var rs = edge._private.rscratch; + var isHaystack = rs.edgeType === 'haystack'; + var isBezier = rs.edgeType === 'bezier'; + var isMultibezier = rs.edgeType === 'multibezier'; + var isSegments = rs.edgeType === 'segments'; + var isCompound = rs.edgeType === 'compound'; + var isSelf = rs.edgeType === 'self'; + + // Displacement gives direction for arrowhead orientation + var dispX, dispY; + var startX, startY, endX, endY, midX, midY; + + if (isHaystack) { + startX = rs.haystackPts[0]; + startY = rs.haystackPts[1]; + endX = rs.haystackPts[2]; + endY = rs.haystackPts[3]; + } else { + startX = rs.arrowStartX; + startY = rs.arrowStartY; + endX = rs.arrowEndX; + endY = rs.arrowEndY; + } + + midX = rs.midX; + midY = rs.midY; + + // source + // + + if (isSegments) { + dispX = startX - rs.segpts[0]; + dispY = startY - rs.segpts[1]; + } else if (isMultibezier || isCompound || isSelf || isBezier) { + var pts = rs.allpts; + var bX = math.qbezierAt(pts[0], pts[2], pts[4], 0.1); + var bY = math.qbezierAt(pts[1], pts[3], pts[5], 0.1); + + dispX = startX - bX; + dispY = startY - bY; + } else { + dispX = startX - midX; + dispY = startY - midY; + } + + rs.srcArrowAngle = math.getAngleFromDisp(dispX, dispY); + + // mid target + // + + var midX = rs.midX; + var midY = rs.midY; + + if (isHaystack) { + midX = (startX + endX) / 2; + midY = (startY + endY) / 2; + } + + dispX = endX - startX; + dispY = endY - startY; + + if (isSegments) { + var pts = rs.allpts; + + if (pts.length / 2 % 2 === 0) { + var i2 = pts.length / 2; + var i1 = i2 - 2; + + dispX = pts[i2] - pts[i1]; + dispY = pts[i2 + 1] - pts[i1 + 1]; + } else { + var i2 = pts.length / 2 - 1; + var i1 = i2 - 2; + var i3 = i2 + 2; + + dispX = pts[i2] - pts[i1]; + dispY = pts[i2 + 1] - pts[i1 + 1]; + } + } else if (isMultibezier || isCompound || isSelf) { + var pts = rs.allpts; + var cpts = rs.ctrlpts; + var bp0x, bp0y; + var bp1x, bp1y; + + if (cpts.length / 2 % 2 === 0) { + var p0 = pts.length / 2 - 1; // startpt + var ic = p0 + 2; + var p1 = ic + 2; + + bp0x = math.qbezierAt(pts[p0], pts[ic], pts[p1], 0.0); + bp0y = math.qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.0); + + bp1x = math.qbezierAt(pts[p0], pts[ic], pts[p1], 0.0001); + bp1y = math.qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.0001); + } else { + var ic = pts.length / 2 - 1; // ctrpt + var p0 = ic - 2; // startpt + var p1 = ic + 2; // endpt + + bp0x = math.qbezierAt(pts[p0], pts[ic], pts[p1], 0.4999); + bp0y = math.qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.4999); + + bp1x = math.qbezierAt(pts[p0], pts[ic], pts[p1], 0.5); + bp1y = math.qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.5); + } + + dispX = bp1x - bp0x; + dispY = bp1y - bp0y; + } + + rs.midtgtArrowAngle = math.getAngleFromDisp(dispX, dispY); + + rs.midDispX = dispX; + rs.midDispY = dispY; + + // mid source + // + + dispX *= -1; + dispY *= -1; + + if (isSegments) { + var pts = rs.allpts; + + if (pts.length / 2 % 2 === 0) { + // already ok + } else { + var i2 = pts.length / 2 - 1; + var i3 = i2 + 2; + + dispX = -(pts[i3] - pts[i2]); + dispY = -(pts[i3 + 1] - pts[i2 + 1]); + } + } + + rs.midsrcArrowAngle = math.getAngleFromDisp(dispX, dispY); + + // target + // + + if (isSegments) { + dispX = endX - rs.segpts[rs.segpts.length - 2]; + dispY = endY - rs.segpts[rs.segpts.length - 1]; + } else if (isMultibezier || isCompound || isSelf || isBezier) { + var pts = rs.allpts; + var l = pts.length; + var bX = math.qbezierAt(pts[l - 6], pts[l - 4], pts[l - 2], 0.9); + var bY = math.qbezierAt(pts[l - 5], pts[l - 3], pts[l - 1], 0.9); + + dispX = endX - bX; + dispY = endY - bY; + } else { + dispX = endX - midX; + dispY = endY - midY; + } + + rs.tgtArrowAngle = math.getAngleFromDisp(dispX, dispY); +}; + +BRp.getArrowWidth = BRp.getArrowHeight = function (edgeWidth, scale) { + var cache = this.arrowWidthCache = this.arrowWidthCache || {}; + + var cachedVal = cache[edgeWidth + ', ' + scale]; + if (cachedVal) { + return cachedVal; + } + + cachedVal = Math.max(Math.pow(edgeWidth * 13.37, 0.9), 29) * scale; + cache[edgeWidth + ', ' + scale] = cachedVal; + + return cachedVal; +}; + +module.exports = BRp; + +/***/ }), +/* 113 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var math = __webpack_require__(2); +var is = __webpack_require__(0); + +var BRp = {}; + +BRp.findEdgeControlPoints = function (edges) { + if (!edges || edges.length === 0) { + return; + } + + var r = this; + var cy = r.cy; + var hasCompounds = cy.hasCompoundNodes(); + var hashTable = {}; + var pairIds = []; + var haystackEdges = []; + + // create a table of edge (src, tgt) => list of edges between them + var pairId; + for (var i = 0; i < edges.length; i++) { + var edge = edges[i]; + var _p = edge._private; + var data = _p.data; + var curveStyle = edge.pstyle('curve-style').value; + var edgeIsUnbundled = curveStyle === 'unbundled-bezier' || curveStyle === 'segments'; + var edgeIsBezier = curveStyle === 'unbundled-bezier' || curveStyle === 'bezier'; + + // ignore edges who are not to be displayed + // they shouldn't take up space + if (edge.pstyle('display').value === 'none') { + continue; + } + + if (curveStyle === 'haystack') { + haystackEdges.push(edge); + continue; + } + + var srcId = data.source; + var tgtId = data.target; + + pairId = srcId > tgtId ? tgtId + '$-$' + srcId : srcId + '$-$' + tgtId; + + if (edgeIsUnbundled) { + pairId = 'unbundled' + '$-$' + data.id; + } + + var tableEntry = hashTable[pairId]; + + if (tableEntry == null) { + tableEntry = hashTable[pairId] = []; + pairIds.push(pairId); + } + + tableEntry.push(edge); + + if (edgeIsUnbundled) { + tableEntry.hasUnbundled = true; + } + + if (edgeIsBezier) { + tableEntry.hasBezier = true; + } + } + + var src, tgt, srcPos, tgtPos, srcW, srcH, tgtW, tgtH, srcShape, tgtShape; + var vectorNormInverse; + var badBezier; + + // for each pair (src, tgt), create the ctrl pts + // Nested for loop is OK; total number of iterations for both loops = edgeCount + for (var p = 0; p < pairIds.length; p++) { + pairId = pairIds[p]; + var pairEdges = hashTable[pairId]; + + // for each pair id, the edges should be sorted by index + pairEdges.sort(function (edge1, edge2) { + return edge1.poolIndex() - edge2.poolIndex(); + }); + + src = pairEdges[0]._private.source; + tgt = pairEdges[0]._private.target; + + // make sure src/tgt distinction is consistent for bundled edges + if (!pairEdges.hasUnbundled && src.id() > tgt.id()) { + var temp = src; + src = tgt; + tgt = temp; + } + + srcPos = src.position(); + tgtPos = tgt.position(); + + srcW = src.outerWidth(); + srcH = src.outerHeight(); + + tgtW = tgt.outerWidth(); + tgtH = tgt.outerHeight(); + + srcShape = r.nodeShapes[this.getNodeShape(src)]; + tgtShape = r.nodeShapes[this.getNodeShape(tgt)]; + + badBezier = false; + + var edge; + var edge_p; + var rs; + + var dirCounts = { + 'north': 0, + 'west': 0, + 'south': 0, + 'east': 0, + 'northwest': 0, + 'southwest': 0, + 'northeast': 0, + 'southeast': 0 + }; + + var srcX2 = srcPos.x; + var srcY2 = srcPos.y; + var srcW2 = srcW; + var srcH2 = srcH; + + var tgtX2 = tgtPos.x; + var tgtY2 = tgtPos.y; + var tgtW2 = tgtW; + var tgtH2 = tgtH; + + var numEdges2 = pairEdges.length; + + for (var i = 0; i < pairEdges.length; i++) { + edge = pairEdges[i]; + edge_p = edge._private; + rs = edge_p.rscratch; + + var edgeIndex1 = rs.lastEdgeIndex; + var edgeIndex2 = i; + + var numEdges1 = rs.lastNumEdges; + + var curveStyle = edge.pstyle('curve-style').value; + + var edgeIsUnbundled = curveStyle === 'unbundled-bezier' || curveStyle === 'segments'; + + // whether the normalised pair order is the reverse of the edge's src-tgt order + var edgeIsSwapped = src.id() !== edge.source().id(); + + var ctrlptDists = edge.pstyle('control-point-distances'); + var loopDir = edge.pstyle('loop-direction').pfValue; + var loopSwp = edge.pstyle('loop-sweep').pfValue; + var ctrlptWs = edge.pstyle('control-point-weights'); + var bezierN = ctrlptDists && ctrlptWs ? Math.min(ctrlptDists.value.length, ctrlptWs.value.length) : 1; + var stepSize = edge.pstyle('control-point-step-size').pfValue; + var ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[0] : undefined; + var ctrlptWeight = ctrlptWs.value[0]; + var edgeDistances = edge.pstyle('edge-distances').value; + var srcDistFNode = edge.pstyle('source-distance-from-node').pfValue; + var tgtDistFNode = edge.pstyle('target-distance-from-node').pfValue; + var segmentWs = edge.pstyle('segment-weights'); + var segmentDs = edge.pstyle('segment-distances'); + var segmentsN = Math.min(segmentWs.pfValue.length, segmentDs.pfValue.length); + var srcEndpt = edge.pstyle('source-endpoint').value; + var tgtEndpt = edge.pstyle('target-endpoint').value; + var srcArrShape = edge.pstyle('source-arrow-shape').value; + var tgtArrShape = edge.pstyle('target-arrow-shape').value; + var arrowScale = edge.pstyle('arrow-scale').value; + var lineWidth = edge.pstyle('width').pfValue; + + var srcX1 = rs.lastSrcCtlPtX; + var srcY1 = rs.lastSrcCtlPtY; + var srcW1 = rs.lastSrcCtlPtW; + var srcH1 = rs.lastSrcCtlPtH; + + var tgtX1 = rs.lastTgtCtlPtX; + var tgtY1 = rs.lastTgtCtlPtY; + var tgtW1 = rs.lastTgtCtlPtW; + var tgtH1 = rs.lastTgtCtlPtH; + + var curveStyle1 = rs.lastCurveStyle; + var curveStyle2 = curveStyle; + + var ctrlptDists1 = rs.lastCtrlptDists; + var ctrlptDists2 = ctrlptDists ? ctrlptDists.strValue : null; + + var ctrlptWs1 = rs.lastCtrlptWs; + var ctrlptWs2 = ctrlptWs.strValue; + + var segmentWs1 = rs.lastSegmentWs; + var segmentWs2 = segmentWs.strValue; + + var segmentDs1 = rs.lastSegmentDs; + var segmentDs2 = segmentDs.strValue; + + var stepSize1 = rs.lastStepSize; + var stepSize2 = stepSize; + + var loopDir1 = rs.lastLoopDir; + var loopDir2 = loopDir; + + var loopSwp1 = rs.lastLoopSwp; + var loopSwp2 = loopSwp; + + var edgeDistances1 = rs.lastEdgeDistances; + var edgeDistances2 = edgeDistances; + + var srcDistFNode1 = rs.lastSrcDistFNode; + var srcDistFNode2 = srcDistFNode; + + var tgtDistFNode1 = rs.lastTgtDistFNode; + var tgtDistFNode2 = tgtDistFNode; + + var srcEndpt1 = rs.lastSrcEndpt; + var srcEndpt2 = srcEndpt; + + var tgtEndpt1 = rs.lastTgtEndpt; + var tgtEndpt2 = tgtEndpt; + + var srcArr1 = rs.lastSrcArr; + var srcArr2 = srcArrShape; + + var tgtArr1 = rs.lastTgtArr; + var tgtArr2 = tgtArrShape; + + var lineW1 = rs.lastLineW; + var lineW2 = lineWidth; + + var arrScl1 = rs.lastArrScl; + var arrScl2 = arrowScale; + + if (badBezier) { + rs.badBezier = true; + } else { + rs.badBezier = false; + } + + var ptCacheHit; + + if (srcX1 === srcX2 && srcY1 === srcY2 && srcW1 === srcW2 && srcH1 === srcH2 && tgtX1 === tgtX2 && tgtY1 === tgtY2 && tgtW1 === tgtW2 && tgtH1 === tgtH2 && curveStyle1 === curveStyle2 && ctrlptDists1 === ctrlptDists2 && ctrlptWs1 === ctrlptWs2 && segmentWs1 === segmentWs2 && segmentDs1 === segmentDs2 && stepSize1 === stepSize2 && loopDir1 === loopDir2 && loopSwp1 === loopSwp2 && edgeDistances1 === edgeDistances2 && srcDistFNode1 === srcDistFNode2 && tgtDistFNode1 === tgtDistFNode2 && srcEndpt1 === srcEndpt2 && tgtEndpt1 === tgtEndpt2 && srcArr1 === srcArr2 && tgtArr1 === tgtArr2 && lineW1 === lineW2 && arrScl1 === arrScl2 && (edgeIndex1 === edgeIndex2 && numEdges1 === numEdges2 || edgeIsUnbundled)) { + ptCacheHit = true; // then the control points haven't changed and we can skip calculating them + } else { + ptCacheHit = false; + + rs.lastSrcCtlPtX = srcX2; + rs.lastSrcCtlPtY = srcY2; + rs.lastSrcCtlPtW = srcW2; + rs.lastSrcCtlPtH = srcH2; + rs.lastTgtCtlPtX = tgtX2; + rs.lastTgtCtlPtY = tgtY2; + rs.lastTgtCtlPtW = tgtW2; + rs.lastTgtCtlPtH = tgtH2; + rs.lastEdgeIndex = edgeIndex2; + rs.lastNumEdges = numEdges2; + rs.lastCurveStyle = curveStyle2; + rs.lastCtrlptDists = ctrlptDists2; + rs.lastCtrlptWs = ctrlptWs2; + rs.lastSegmentDs = segmentDs2; + rs.lastSegmentWs = segmentWs2; + rs.lastStepSize = stepSize2; + rs.lastLoopDir = loopDir2; + rs.lastLoopSwp = loopSwp2; + rs.lastEdgeDistances = edgeDistances2; + rs.lastSrcDistFNode = srcDistFNode2; + rs.lastTgtDistFNode = tgtDistFNode2; + rs.lastSrcEndpt = srcEndpt2; + rs.lastTgtEndpt = tgtEndpt2; + rs.lastSrcArr = srcArr2; + rs.lastTgtArr = tgtArr2; + rs.lastLineW = lineW2; + rs.lastArrScl = arrScl2; + } + + if (!ptCacheHit) { + + if (!pairEdges.calculatedIntersection && src !== tgt && (pairEdges.hasBezier || pairEdges.hasUnbundled)) { + + pairEdges.calculatedIntersection = true; + + // pt outside src shape to calc distance/displacement from src to tgt + var srcOutside = srcShape.intersectLine(srcPos.x, srcPos.y, srcW, srcH, tgtPos.x, tgtPos.y, 0); + + pairEdges.srcIntn = srcOutside; + + // pt outside tgt shape to calc distance/displacement from src to tgt + var tgtOutside = tgtShape.intersectLine(tgtPos.x, tgtPos.y, tgtW, tgtH, srcPos.x, srcPos.y, 0); + + pairEdges.tgtIntn = tgtOutside; + + var midptSrcPts = { + x1: srcOutside[0], + x2: tgtOutside[0], + y1: srcOutside[1], + y2: tgtOutside[1] + }; + + var posPts = { + x1: srcPos.x, + x2: tgtPos.x, + y1: srcPos.y, + y2: tgtPos.y + }; + + var dy = tgtOutside[1] - srcOutside[1]; + var dx = tgtOutside[0] - srcOutside[0]; + var l = Math.sqrt(dx * dx + dy * dy); + + var vector = { + x: dx, + y: dy + }; + + var vectorNorm = { + x: vector.x / l, + y: vector.y / l + }; + vectorNormInverse = { + x: -vectorNorm.y, + y: vectorNorm.x + }; + + // if node shapes overlap, then no ctrl pts to draw + if (tgtShape.checkPoint(srcOutside[0], srcOutside[1], 0, tgtW, tgtH, tgtPos.x, tgtPos.y) && srcShape.checkPoint(tgtOutside[0], tgtOutside[1], 0, srcW, srcH, srcPos.x, srcPos.y)) { + vectorNormInverse = {}; + badBezier = true; + } + } + + if (!edgeIsSwapped) { + rs.srcIntn = pairEdges.srcIntn; + rs.tgtIntn = pairEdges.tgtIntn; + } else { + // ensure that the per-edge cached value for intersections are correct for swapped bundled edges + rs.srcIntn = pairEdges.tgtIntn; + rs.tgtIntn = pairEdges.srcIntn; + } + + if (src === tgt) { + // Self-edge + + rs.edgeType = 'self'; + + var j = i; + var loopDist = stepSize; + + if (edgeIsUnbundled) { + j = 0; + loopDist = ctrlptDist; + } + + var loopAngle = loopDir - Math.PI / 2; + var outAngle = loopAngle - loopSwp / 2; + var inAngle = loopAngle + loopSwp / 2; + + // increase by step size for overlapping loops, keyed on direction and sweep values + var dc = String(loopDir + '_' + loopSwp); + j = dirCounts[dc] === undefined ? dirCounts[dc] = 0 : ++dirCounts[dc]; + + rs.ctrlpts = [srcPos.x + Math.cos(outAngle) * 1.4 * loopDist * (j / 3 + 1), srcPos.y + Math.sin(outAngle) * 1.4 * loopDist * (j / 3 + 1), srcPos.x + Math.cos(inAngle) * 1.4 * loopDist * (j / 3 + 1), srcPos.y + Math.sin(inAngle) * 1.4 * loopDist * (j / 3 + 1)]; + } else if (hasCompounds && (src.isParent() || src.isChild() || tgt.isParent() || tgt.isChild()) && (src.parents().anySame(tgt) || tgt.parents().anySame(src))) { + // Compound edge + + rs.edgeType = 'compound'; + + // because the line approximation doesn't apply for compound beziers + // (loop/self edges are already elided b/c of cheap src==tgt check) + rs.badBezier = false; + + var j = i; + var loopDist = stepSize; + + if (edgeIsUnbundled) { + j = 0; + loopDist = ctrlptDist; + } + + var loopW = 50; + + var loopaPos = { + x: srcPos.x - srcW / 2, + y: srcPos.y - srcH / 2 + }; + + var loopbPos = { + x: tgtPos.x - tgtW / 2, + y: tgtPos.y - tgtH / 2 + }; + + var loopPos = { + x: Math.min(loopaPos.x, loopbPos.x), + y: Math.min(loopaPos.y, loopbPos.y) + }; + + // avoids cases with impossible beziers + var minCompoundStretch = 0.5; + var compoundStretchA = Math.max(minCompoundStretch, Math.log(srcW * 0.01)); + var compoundStretchB = Math.max(minCompoundStretch, Math.log(tgtW * 0.01)); + + rs.ctrlpts = [loopPos.x, loopPos.y - (1 + Math.pow(loopW, 1.12) / 100) * loopDist * (j / 3 + 1) * compoundStretchA, loopPos.x - (1 + Math.pow(loopW, 1.12) / 100) * loopDist * (j / 3 + 1) * compoundStretchB, loopPos.y]; + } else if (curveStyle === 'segments') { + // Segments (multiple straight lines) + + rs.edgeType = 'segments'; + rs.segpts = []; + + for (var s = 0; s < segmentsN; s++) { + var w = segmentWs.pfValue[s]; + var d = segmentDs.pfValue[s]; + + var w1 = 1 - w; + var w2 = w; + + var midptPts = edgeDistances === 'node-position' ? posPts : midptSrcPts; + + var adjustedMidpt = { + x: midptPts.x1 * w1 + midptPts.x2 * w2, + y: midptPts.y1 * w1 + midptPts.y2 * w2 + }; + + rs.segpts.push(adjustedMidpt.x + vectorNormInverse.x * d, adjustedMidpt.y + vectorNormInverse.y * d); + } + + // Straight edge + } else if (pairEdges.length % 2 === 1 && i === Math.floor(pairEdges.length / 2) && !edgeIsUnbundled) { + + rs.edgeType = 'straight'; + } else { + // (Multi)bezier + + var multi = edgeIsUnbundled; + + rs.edgeType = multi ? 'multibezier' : 'bezier'; + rs.ctrlpts = []; + + for (var b = 0; b < bezierN; b++) { + var normctrlptDist = (0.5 - pairEdges.length / 2 + i) * stepSize; + var manctrlptDist; + var sign = math.signum(normctrlptDist); + + if (multi) { + ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[b] : stepSize; // fall back on step size + ctrlptWeight = ctrlptWs.value[b]; + } + + if (edgeIsUnbundled) { + // multi or single unbundled + manctrlptDist = ctrlptDist; + } else { + manctrlptDist = ctrlptDist !== undefined ? sign * ctrlptDist : undefined; + } + + var distanceFromMidpoint = manctrlptDist !== undefined ? manctrlptDist : normctrlptDist; + + var w1 = 1 - ctrlptWeight; + var w2 = ctrlptWeight; + + if (edgeIsSwapped) { + var temp = w1; + w1 = w2; + w2 = temp; + } + + var midptPts = edgeDistances === 'node-position' ? posPts : midptSrcPts; + + var adjustedMidpt = { + x: midptPts.x1 * w1 + midptPts.x2 * w2, + y: midptPts.y1 * w1 + midptPts.y2 * w2 + }; + + rs.ctrlpts.push(adjustedMidpt.x + vectorNormInverse.x * distanceFromMidpoint, adjustedMidpt.y + vectorNormInverse.y * distanceFromMidpoint); + } + } + + // find endpts for edge + this.findEndpoints(edge); + + var badStart = !is.number(rs.startX) || !is.number(rs.startY); + var badAStart = !is.number(rs.arrowStartX) || !is.number(rs.arrowStartY); + var badEnd = !is.number(rs.endX) || !is.number(rs.endY); + var badAEnd = !is.number(rs.arrowEndX) || !is.number(rs.arrowEndY); + + var minCpADistFactor = 3; + var arrowW = this.getArrowWidth(edge.pstyle('width').pfValue, edge.pstyle('arrow-scale').value) * this.arrowShapeWidth; + var minCpADist = minCpADistFactor * arrowW; + + if (rs.edgeType === 'bezier') { + var startACpDist = math.dist({ x: rs.ctrlpts[0], y: rs.ctrlpts[1] }, { x: rs.startX, y: rs.startY }); + var closeStartACp = startACpDist < minCpADist; + var endACpDist = math.dist({ x: rs.ctrlpts[0], y: rs.ctrlpts[1] }, { x: rs.endX, y: rs.endY }); + var closeEndACp = endACpDist < minCpADist; + + var overlapping = false; + + if (badStart || badAStart || closeStartACp) { + overlapping = true; + + // project control point along line from src centre to outside the src shape + // (otherwise intersection will yield nothing) + var cpD = { // delta + x: rs.ctrlpts[0] - srcPos.x, + y: rs.ctrlpts[1] - srcPos.y + }; + var cpL = Math.sqrt(cpD.x * cpD.x + cpD.y * cpD.y); // length of line + var cpM = { // normalised delta + x: cpD.x / cpL, + y: cpD.y / cpL + }; + var radius = Math.max(srcW, srcH); + var cpProj = { // *2 radius guarantees outside shape + x: rs.ctrlpts[0] + cpM.x * 2 * radius, + y: rs.ctrlpts[1] + cpM.y * 2 * radius + }; + + var srcCtrlPtIntn = srcShape.intersectLine(srcPos.x, srcPos.y, srcW, srcH, cpProj.x, cpProj.y, 0); + + if (closeStartACp) { + rs.ctrlpts[0] = rs.ctrlpts[0] + cpM.x * (minCpADist - startACpDist); + rs.ctrlpts[1] = rs.ctrlpts[1] + cpM.y * (minCpADist - startACpDist); + } else { + rs.ctrlpts[0] = srcCtrlPtIntn[0] + cpM.x * minCpADist; + rs.ctrlpts[1] = srcCtrlPtIntn[1] + cpM.y * minCpADist; + } + } + + if (badEnd || badAEnd || closeEndACp) { + overlapping = true; + + // project control point along line from tgt centre to outside the tgt shape + // (otherwise intersection will yield nothing) + var cpD = { // delta + x: rs.ctrlpts[0] - tgtPos.x, + y: rs.ctrlpts[1] - tgtPos.y + }; + var cpL = Math.sqrt(cpD.x * cpD.x + cpD.y * cpD.y); // length of line + var cpM = { // normalised delta + x: cpD.x / cpL, + y: cpD.y / cpL + }; + var radius = Math.max(srcW, srcH); + var cpProj = { // *2 radius guarantees outside shape + x: rs.ctrlpts[0] + cpM.x * 2 * radius, + y: rs.ctrlpts[1] + cpM.y * 2 * radius + }; + + var tgtCtrlPtIntn = tgtShape.intersectLine(tgtPos.x, tgtPos.y, tgtW, tgtH, cpProj.x, cpProj.y, 0); + + if (closeEndACp) { + rs.ctrlpts[0] = rs.ctrlpts[0] + cpM.x * (minCpADist - endACpDist); + rs.ctrlpts[1] = rs.ctrlpts[1] + cpM.y * (minCpADist - endACpDist); + } else { + rs.ctrlpts[0] = tgtCtrlPtIntn[0] + cpM.x * minCpADist; + rs.ctrlpts[1] = tgtCtrlPtIntn[1] + cpM.y * minCpADist; + } + } + + if (overlapping) { + // recalc endpts + this.findEndpoints(edge); + } + } + + if (rs.edgeType === 'multibezier' || rs.edgeType === 'bezier' || rs.edgeType === 'self' || rs.edgeType === 'compound') { + rs.allpts = []; + + rs.allpts.push(rs.startX, rs.startY); + + for (var b = 0; b + 1 < rs.ctrlpts.length; b += 2) { + // ctrl pt itself + rs.allpts.push(rs.ctrlpts[b], rs.ctrlpts[b + 1]); + + // the midpt between ctrlpts as intermediate destination pts + if (b + 3 < rs.ctrlpts.length) { + rs.allpts.push((rs.ctrlpts[b] + rs.ctrlpts[b + 2]) / 2, (rs.ctrlpts[b + 1] + rs.ctrlpts[b + 3]) / 2); + } + } + + rs.allpts.push(rs.endX, rs.endY); + + var m, mt; + if (rs.ctrlpts.length / 2 % 2 === 0) { + m = rs.allpts.length / 2 - 1; + + rs.midX = rs.allpts[m]; + rs.midY = rs.allpts[m + 1]; + } else { + m = rs.allpts.length / 2 - 3; + mt = 0.5; + + rs.midX = math.qbezierAt(rs.allpts[m], rs.allpts[m + 2], rs.allpts[m + 4], mt); + rs.midY = math.qbezierAt(rs.allpts[m + 1], rs.allpts[m + 3], rs.allpts[m + 5], mt); + } + } else if (rs.edgeType === 'straight') { + // need to calc these after endpts + rs.allpts = [rs.startX, rs.startY, rs.endX, rs.endY]; + + // default midpt for labels etc + rs.midX = (rs.startX + rs.endX + rs.arrowStartX + rs.arrowEndX) / 4; + rs.midY = (rs.startY + rs.endY + rs.arrowStartY + rs.arrowEndY) / 4; + } else if (rs.edgeType === 'segments') { + rs.allpts = []; + rs.allpts.push(rs.startX, rs.startY); + rs.allpts.push.apply(rs.allpts, rs.segpts); + rs.allpts.push(rs.endX, rs.endY); + + if (rs.segpts.length % 4 === 0) { + var i2 = rs.segpts.length / 2; + var i1 = i2 - 2; + + rs.midX = (rs.segpts[i1] + rs.segpts[i2]) / 2; + rs.midY = (rs.segpts[i1 + 1] + rs.segpts[i2 + 1]) / 2; + } else { + var i1 = rs.segpts.length / 2 - 1; + + rs.midX = rs.segpts[i1]; + rs.midY = rs.segpts[i1 + 1]; + } + } + + this.storeEdgeProjections(edge); + this.calculateArrowAngles(edge); + } // if point cache miss + + this.recalculateEdgeLabelProjections(edge); + this.calculateLabelAngles(edge); + } // for pair edges + } // for pair ids + + for (var i = 0; i < haystackEdges.length; i++) { + var edge = haystackEdges[i]; + var _p = edge._private; + var rscratch = _p.rscratch; + var rs = rscratch; + + if (!rscratch.haystack) { + var angle = Math.random() * 2 * Math.PI; + + rscratch.source = { + x: Math.cos(angle), + y: Math.sin(angle) + }; + + var angle = Math.random() * 2 * Math.PI; + + rscratch.target = { + x: Math.cos(angle), + y: Math.sin(angle) + }; + } + + var src = _p.source; + var tgt = _p.target; + var srcPos = src.position(); + var tgtPos = tgt.position(); + var srcW = src.width(); + var tgtW = tgt.width(); + var srcH = src.height(); + var tgtH = tgt.height(); + var radius = edge.pstyle('haystack-radius').value; + var halfRadius = radius / 2; // b/c have to half width/height + + rs.haystackPts = rs.allpts = [rs.source.x * srcW * halfRadius + srcPos.x, rs.source.y * srcH * halfRadius + srcPos.y, rs.target.x * tgtW * halfRadius + tgtPos.x, rs.target.y * tgtH * halfRadius + tgtPos.y]; + + rs.midX = (rs.allpts[0] + rs.allpts[2]) / 2; + rs.midY = (rs.allpts[1] + rs.allpts[3]) / 2; + + // always override as haystack in case set to different type previously + rscratch.edgeType = rscratch.lastCurveStyle = 'haystack'; + rscratch.haystack = true; + + this.storeEdgeProjections(edge); + this.calculateArrowAngles(edge); + this.recalculateEdgeLabelProjections(edge); + this.calculateLabelAngles(edge); + } +}; + +function getPts(pts) { + var retPts = []; + + if (pts == null) { + return; + } + + for (var i = 0; i < pts.length; i += 2) { + var x = pts[i]; + var y = pts[i + 1]; + + retPts.push({ x: x, y: y }); + } + + return retPts; +} + +BRp.getSegmentPoints = function (edge) { + var rs = edge[0]._private.rscratch; + var type = rs.edgeType; + + if (type === 'segments') { + return getPts(rs.segpts); + } +}; + +BRp.getControlPoints = function (edge) { + var rs = edge[0]._private.rscratch; + var type = rs.edgeType; + + if (type === 'bezier' || type === 'multibezier' || type === 'self' || type === 'compound') { + return getPts(rs.ctrlpts); + } +}; + +BRp.getEdgeMidpoint = function (edge) { + var rs = edge[0]._private.rscratch; + + return { + x: rs.midX, + y: rs.midY + }; +}; + +module.exports = BRp; + +/***/ }), +/* 114 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var math = __webpack_require__(2); +var is = __webpack_require__(0); + +var BRp = {}; + +BRp.manualEndptToPx = function (node, prop) { + var r = this; + var npos = node.position(); + var w = node.outerWidth(); + var h = node.outerHeight(); + + if (prop.value.length === 2) { + var p = [prop.pfValue[0], prop.pfValue[1]]; + + if (prop.units[0] === '%') { + p[0] = p[0] * w; + } + + if (prop.units[1] === '%') { + p[1] = p[1] * h; + } + + p[0] += npos.x; + p[1] += npos.y; + + return p; + } else { + var angle = prop.pfValue[0]; + + angle = -Math.PI / 2 + angle; // start at 12 o'clock + + var l = 2 * Math.max(w, h); + + var _p = [npos.x + Math.cos(angle) * l, npos.y + Math.sin(angle) * l]; + + return r.nodeShapes[this.getNodeShape(node)].intersectLine(npos.x, npos.y, w, h, _p[0], _p[1], 0); + } +}; + +BRp.findEndpoints = function (edge) { + var r = this; + var intersect = void 0; + + var source = edge.source()[0]; + var target = edge.target()[0]; + + var srcPos = source.position(); + var tgtPos = target.position(); + + var tgtArShape = edge.pstyle('target-arrow-shape').value; + var srcArShape = edge.pstyle('source-arrow-shape').value; + + var tgtDist = edge.pstyle('target-distance-from-node').pfValue; + var srcDist = edge.pstyle('source-distance-from-node').pfValue; + + var rs = edge._private.rscratch; + + var et = rs.edgeType; + var self = et === 'self' || et === 'compound'; + var bezier = et === 'bezier' || et === 'multibezier' || self; + var multi = et !== 'bezier'; + var lines = et === 'straight' || et === 'segments'; + var segments = et === 'segments'; + var hasEndpts = bezier || multi || lines; + var srcManEndpt = edge.pstyle('source-endpoint'); + var srcManEndptVal = self ? 'outside-to-node' : srcManEndpt.value; + var tgtManEndpt = edge.pstyle('target-endpoint'); + var tgtManEndptVal = self ? 'outside-to-node' : tgtManEndpt.value; + + rs.srcManEndpt = srcManEndpt; + rs.tgtManEndpt = tgtManEndpt; + + var p1 = void 0; // last known point of edge on target side + var p2 = void 0; // last known point of edge on source side + + var p1_i = void 0; // point to intersect with target shape + var p2_i = void 0; // point to intersect with source shape + + if (bezier) { + var cpStart = [rs.ctrlpts[0], rs.ctrlpts[1]]; + var cpEnd = multi ? [rs.ctrlpts[rs.ctrlpts.length - 2], rs.ctrlpts[rs.ctrlpts.length - 1]] : cpStart; + + p1 = cpEnd; + p2 = cpStart; + } else if (lines) { + var srcArrowFromPt = !segments ? [tgtPos.x, tgtPos.y] : rs.segpts.slice(0, 2); + var tgtArrowFromPt = !segments ? [srcPos.x, srcPos.y] : rs.segpts.slice(rs.segpts.length - 2); + + p1 = tgtArrowFromPt; + p2 = srcArrowFromPt; + } + + if (tgtManEndptVal === 'inside-to-node') { + intersect = [tgtPos.x, tgtPos.y]; + } else if (tgtManEndpt.units) { + intersect = this.manualEndptToPx(target, tgtManEndpt); + } else if (tgtManEndptVal === 'outside-to-line') { + intersect = rs.tgtIntn; // use cached value from ctrlpt calc + } else { + if (tgtManEndptVal === 'outside-to-node') { + p1_i = p1; + } else if (tgtManEndptVal === 'outside-to-line') { + p1_i = [srcPos.x, srcPos.y]; + } + + intersect = r.nodeShapes[this.getNodeShape(target)].intersectLine(tgtPos.x, tgtPos.y, target.outerWidth(), target.outerHeight(), p1_i[0], p1_i[1], 0); + } + + var arrowEnd = math.shortenIntersection(intersect, p1, r.arrowShapes[tgtArShape].spacing(edge) + tgtDist); + var edgeEnd = math.shortenIntersection(intersect, p1, r.arrowShapes[tgtArShape].gap(edge) + tgtDist); + + rs.endX = edgeEnd[0]; + rs.endY = edgeEnd[1]; + + rs.arrowEndX = arrowEnd[0]; + rs.arrowEndY = arrowEnd[1]; + + if (srcManEndptVal === 'inside-to-node') { + intersect = [srcPos.x, srcPos.y]; + } else if (srcManEndpt.units) { + intersect = this.manualEndptToPx(source, srcManEndpt); + } else if (srcManEndptVal === 'outside-to-line') { + intersect = rs.srcIntn; // use cached value from ctrlpt calc + } else { + if (srcManEndptVal === 'outside-to-node') { + p2_i = p2; + } else if (srcManEndptVal === 'outside-to-line') { + p2_i = [tgtPos.x, tgtPos.y]; + } + + intersect = r.nodeShapes[this.getNodeShape(source)].intersectLine(srcPos.x, srcPos.y, source.outerWidth(), source.outerHeight(), p2_i[0], p2_i[1], 0); + } + + var arrowStart = math.shortenIntersection(intersect, p2, r.arrowShapes[srcArShape].spacing(edge) + srcDist); + var edgeStart = math.shortenIntersection(intersect, p2, r.arrowShapes[srcArShape].gap(edge) + srcDist); + + rs.startX = edgeStart[0]; + rs.startY = edgeStart[1]; + + rs.arrowStartX = arrowStart[0]; + rs.arrowStartY = arrowStart[1]; + + if (hasEndpts) { + if (!is.number(rs.startX) || !is.number(rs.startY) || !is.number(rs.endX) || !is.number(rs.endY)) { + rs.badLine = true; + } else { + rs.badLine = false; + } + } +}; + +BRp.getSourceEndpoint = function (edge) { + var rs = edge[0]._private.rscratch; + + switch (rs.edgeType) { + case 'haystack': + return { + x: rs.haystackPts[0], + y: rs.haystackPts[1] + }; + default: + return { + x: rs.arrowStartX, + y: rs.arrowStartY + }; + } +}; + +BRp.getTargetEndpoint = function (edge) { + var rs = edge[0]._private.rscratch; + + switch (rs.edgeType) { + case 'haystack': + return { + x: rs.haystackPts[2], + y: rs.haystackPts[3] + }; + default: + return { + x: rs.arrowEndX, + y: rs.arrowEndY + }; + } +}; + +module.exports = BRp; + +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var math = __webpack_require__(2); + +var BRp = {}; + +function pushBezierPts(r, edge, pts) { + var qbezierAt = function qbezierAt(p1, p2, p3, t) { + return math.qbezierAt(p1, p2, p3, t); + }; + var _p = edge._private; + var bpts = _p.rstyle.bezierPts; + + for (var i = 0; i < r.bezierProjPcts.length; i++) { + var p = r.bezierProjPcts[i]; + + bpts.push({ + x: qbezierAt(pts[0], pts[2], pts[4], p), + y: qbezierAt(pts[1], pts[3], pts[5], p) + }); + } +} + +BRp.storeEdgeProjections = function (edge) { + var _p = edge._private; + var rs = _p.rscratch; + var et = rs.edgeType; + + // clear the cached points state + _p.rstyle.bezierPts = null; + _p.rstyle.linePts = null; + _p.rstyle.haystackPts = null; + + if (et === 'multibezier' || et === 'bezier' || et === 'self' || et === 'compound') { + var bpts = _p.rstyle.bezierPts = []; // jshint ignore:line + + for (var i = 0; i + 5 < rs.allpts.length; i += 4) { + pushBezierPts(this, edge, rs.allpts.slice(i, i + 6)); + } + } else if (et === 'segments') { + var lpts = _p.rstyle.linePts = []; + + for (var i = 0; i + 1 < rs.allpts.length; i += 2) { + lpts.push({ + x: rs.allpts[i], + y: rs.allpts[i + 1] + }); + } + } else if (et === 'haystack') { + var hpts = rs.haystackPts; + + _p.rstyle.haystackPts = [{ x: hpts[0], y: hpts[1] }, { x: hpts[2], y: hpts[3] }]; + } + + _p.rstyle.arrowWidth = this.getArrowWidth(edge.pstyle('width').pfValue, edge.pstyle('arrow-scale').value) * this.arrowShapeWidth; +}; + +BRp.recalculateEdgeProjections = function (edges) { + this.findEdgeControlPoints(edges); +}; + +module.exports = BRp; + +/***/ }), +/* 116 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var math = __webpack_require__(2); +var is = __webpack_require__(0); +var util = __webpack_require__(1); + +var BRp = {}; + +BRp.recalculateNodeLabelProjection = function (node) { + var content = node.pstyle('label').strValue; + + if (is.emptyString(content)) { + return; + } + + var textX, textY; + var _p = node._private; + var nodeWidth = node.width(); + var nodeHeight = node.height(); + var padding = node.padding(); + var nodePos = node.position(); + var textHalign = node.pstyle('text-halign').strValue; + var textValign = node.pstyle('text-valign').strValue; + var rs = _p.rscratch; + var rstyle = _p.rstyle; + + switch (textHalign) { + case 'left': + textX = nodePos.x - nodeWidth / 2 - padding; + break; + + case 'right': + textX = nodePos.x + nodeWidth / 2 + padding; + break; + + default: + // e.g. center + textX = nodePos.x; + } + + switch (textValign) { + case 'top': + textY = nodePos.y - nodeHeight / 2 - padding; + break; + + case 'bottom': + textY = nodePos.y + nodeHeight / 2 + padding; + break; + + default: + // e.g. middle + textY = nodePos.y; + } + + rs.labelX = textX; + rs.labelY = textY; + rstyle.labelX = textX; + rstyle.labelY = textY; + + this.applyLabelDimensions(node); +}; + +var lineAngleFromDelta = function lineAngleFromDelta(dx, dy) { + var angle = Math.atan(dy / dx); + + if (dx === 0 && angle < 0) { + angle = angle * -1; + } + + return angle; +}; + +var lineAngle = function lineAngle(p0, p1) { + var dx = p1.x - p0.x; + var dy = p1.y - p0.y; + + return lineAngleFromDelta(dx, dy); +}; + +var bezierAngle = function bezierAngle(p0, p1, p2, t) { + var t0 = math.bound(0, t - 0.001, 1); + var t1 = math.bound(0, t + 0.001, 1); + + var lp0 = math.qbezierPtAt(p0, p1, p2, t0); + var lp1 = math.qbezierPtAt(p0, p1, p2, t1); + + return lineAngle(lp0, lp1); +}; + +BRp.recalculateEdgeLabelProjections = function (edge) { + var p; + var _p = edge._private; + var rs = _p.rscratch; + var r = this; + var content = { + mid: edge.pstyle('label').strValue, + source: edge.pstyle('source-label').strValue, + target: edge.pstyle('target-label').strValue + }; + + if (content.mid || content.source || content.target) { + // then we have to calculate... + } else { + return; // no labels => no calcs + } + + // add center point to style so bounding box calculations can use it + // + p = { + x: rs.midX, + y: rs.midY + }; + + var setRs = function setRs(propName, prefix, value) { + util.setPrefixedProperty(_p.rscratch, propName, prefix, value); + util.setPrefixedProperty(_p.rstyle, propName, prefix, value); + }; + + setRs('labelX', null, p.x); + setRs('labelY', null, p.y); + + var midAngle = lineAngleFromDelta(rs.midDispX, rs.midDispY); + setRs('labelAutoAngle', null, midAngle); + + var createControlPointInfo = function createControlPointInfo() { + if (createControlPointInfo.cache) { + return createControlPointInfo.cache; + } // use cache so only 1x per edge + + var ctrlpts = []; + + // store each ctrlpt info init + for (var i = 0; i + 5 < rs.allpts.length; i += 4) { + var p0 = { x: rs.allpts[i], y: rs.allpts[i + 1] }; + var p1 = { x: rs.allpts[i + 2], y: rs.allpts[i + 3] }; // ctrlpt + var p2 = { x: rs.allpts[i + 4], y: rs.allpts[i + 5] }; + + ctrlpts.push({ + p0: p0, + p1: p1, + p2: p2, + startDist: 0, + length: 0, + segments: [] + }); + } + + var bpts = _p.rstyle.bezierPts; + var nProjs = r.bezierProjPcts.length; + + function addSegment(cp, p0, p1, t0, t1) { + var length = math.dist(p0, p1); + var prevSegment = cp.segments[cp.segments.length - 1]; + var segment = { + p0: p0, + p1: p1, + t0: t0, + t1: t1, + startDist: prevSegment ? prevSegment.startDist + prevSegment.length : 0, + length: length + }; + + cp.segments.push(segment); + + cp.length += length; + } + + // update each ctrlpt with segment info + for (var i = 0; i < ctrlpts.length; i++) { + var cp = ctrlpts[i]; + var prevCp = ctrlpts[i - 1]; + + if (prevCp) { + cp.startDist = prevCp.startDist + prevCp.length; + } + + addSegment(cp, cp.p0, bpts[i * nProjs], 0, r.bezierProjPcts[0]); // first + + for (var j = 0; j < nProjs - 1; j++) { + addSegment(cp, bpts[i * nProjs + j], bpts[i * nProjs + j + 1], r.bezierProjPcts[j], r.bezierProjPcts[j + 1]); + } + + addSegment(cp, bpts[i * nProjs + nProjs - 1], cp.p2, r.bezierProjPcts[nProjs - 1], 1); // last + } + + return createControlPointInfo.cache = ctrlpts; + }; + + var calculateEndProjection = function calculateEndProjection(prefix) { + var angle; + var isSrc = prefix === 'source'; + + if (!content[prefix]) { + return; + } + + var offset = edge.pstyle(prefix + '-text-offset').pfValue; + + switch (rs.edgeType) { + case 'self': + case 'compound': + case 'bezier': + case 'multibezier': + var cps = createControlPointInfo(); + var selected; + var startDist = 0; + var totalDist = 0; + + // find the segment we're on + for (var i = 0; i < cps.length; i++) { + var cp = cps[isSrc ? i : cps.length - 1 - i]; + + for (var j = 0; j < cp.segments.length; j++) { + var seg = cp.segments[isSrc ? j : cp.segments.length - 1 - j]; + var lastSeg = i === cps.length - 1 && j === cp.segments.length - 1; + + startDist = totalDist; + totalDist += seg.length; + + if (totalDist >= offset || lastSeg) { + selected = { cp: cp, segment: seg }; + break; + } + } + + if (selected) { + break; + } + } + + var cp = selected.cp; + var seg = selected.segment; + var tSegment = (offset - startDist) / seg.length; + var segDt = seg.t1 - seg.t0; + var t = isSrc ? seg.t0 + segDt * tSegment : seg.t1 - segDt * tSegment; + + t = math.bound(0, t, 1); + p = math.qbezierPtAt(cp.p0, cp.p1, cp.p2, t); + angle = bezierAngle(cp.p0, cp.p1, cp.p2, t, p); + + break; + + case 'straight': + case 'segments': + case 'haystack': + var d = 0, + di, + d0; + var p0, p1; + var l = rs.allpts.length; + + for (var i = 0; i + 3 < l; i += 2) { + if (isSrc) { + p0 = { x: rs.allpts[i], y: rs.allpts[i + 1] }; + p1 = { x: rs.allpts[i + 2], y: rs.allpts[i + 3] }; + } else { + p0 = { x: rs.allpts[l - 2 - i], y: rs.allpts[l - 1 - i] }; + p1 = { x: rs.allpts[l - 4 - i], y: rs.allpts[l - 3 - i] }; + } + + di = math.dist(p0, p1); + d0 = d; + d += di; + + if (d >= offset) { + break; + } + } + + var pD = offset - d0; + var t = pD / di; + + t = math.bound(0, t, 1); + p = math.lineAt(p0, p1, t); + angle = lineAngle(p0, p1); + + break; + } + + setRs('labelX', prefix, p.x); + setRs('labelY', prefix, p.y); + setRs('labelAutoAngle', prefix, angle); + }; + + calculateEndProjection('source'); + calculateEndProjection('target'); + + this.applyLabelDimensions(edge); +}; + +BRp.applyLabelDimensions = function (ele) { + this.applyPrefixedLabelDimensions(ele); + + if (ele.isEdge()) { + this.applyPrefixedLabelDimensions(ele, 'source'); + this.applyPrefixedLabelDimensions(ele, 'target'); + } +}; + +BRp.applyPrefixedLabelDimensions = function (ele, prefix) { + var _p = ele._private; + + var text = this.getLabelText(ele, prefix); + var labelDims = this.calculateLabelDimensions(ele, text); + + util.setPrefixedProperty(_p.rstyle, 'labelWidth', prefix, labelDims.width); + util.setPrefixedProperty(_p.rscratch, 'labelWidth', prefix, labelDims.width); + + util.setPrefixedProperty(_p.rstyle, 'labelHeight', prefix, labelDims.height); + util.setPrefixedProperty(_p.rscratch, 'labelHeight', prefix, labelDims.height); +}; + +BRp.getLabelText = function (ele, prefix) { + var _p = ele._private; + var pfd = prefix ? prefix + '-' : ''; + var text = ele.pstyle(pfd + 'label').strValue; + var textTransform = ele.pstyle('text-transform').value; + var rscratch = function rscratch(propName, value) { + if (value) { + util.setPrefixedProperty(_p.rscratch, propName, prefix, value); + return value; + } else { + return util.getPrefixedProperty(_p.rscratch, propName, prefix); + } + }; + + // for empty text, skip all processing + if (!text) { + return ''; + } + + if (textTransform == 'none') { + // passthrough + } else if (textTransform == 'uppercase') { + text = text.toUpperCase(); + } else if (textTransform == 'lowercase') { + text = text.toLowerCase(); + } + + var wrapStyle = ele.pstyle('text-wrap').value; + + if (wrapStyle === 'wrap') { + //console.log('wrap'); + + var labelKey = rscratch('labelKey'); + + // save recalc if the label is the same as before + if (labelKey && rscratch('labelWrapKey') === labelKey) { + // console.log('wrap cache hit'); + return rscratch('labelWrapCachedText'); + } + // console.log('wrap cache miss'); + + var lines = text.split('\n'); + var maxW = ele.pstyle('text-max-width').pfValue; + var wrappedLines = []; + + for (var l = 0; l < lines.length; l++) { + var line = lines[l]; + var lineDims = this.calculateLabelDimensions(ele, line, 'line=' + line); + var lineW = lineDims.width; + + if (lineW > maxW) { + // line is too long + var words = line.split(/\s+/); // NB: assume collapsed whitespace into single space + var subline = ''; + + for (var w = 0; w < words.length; w++) { + var word = words[w]; + var testLine = subline.length === 0 ? word : subline + ' ' + word; + var testDims = this.calculateLabelDimensions(ele, testLine, 'testLine=' + testLine); + var testW = testDims.width; + + if (testW <= maxW) { + // word fits on current line + subline += word + ' '; + } else { + // word starts new line + wrappedLines.push(subline); + subline = word + ' '; + } + } + + // if there's remaining text, put it in a wrapped line + if (!subline.match(/^\s+$/)) { + wrappedLines.push(subline); + } + } else { + // line is already short enough + wrappedLines.push(line); + } + } // for + + rscratch('labelWrapCachedLines', wrappedLines); + text = rscratch('labelWrapCachedText', wrappedLines.join('\n')); + rscratch('labelWrapKey', labelKey); + + // console.log(text) + } else if (wrapStyle === 'ellipsis') { + var maxW = ele.pstyle('text-max-width').pfValue; + var ellipsized = ''; + var ellipsis = '\u2026'; + var incLastCh = false; + + for (var i = 0; i < text.length; i++) { + var widthWithNextCh = this.calculateLabelDimensions(ele, ellipsized + text[i] + ellipsis).width; + + if (widthWithNextCh > maxW) { + break; + } + + ellipsized += text[i]; + + if (i === text.length - 1) { + incLastCh = true; + } + } + + if (!incLastCh) { + ellipsized += ellipsis; + } + + return ellipsized; + } // if ellipsize + + return text; +}; + +BRp.calculateLabelDimensions = function (ele, text, extraKey) { + var r = this; + + var cacheKey = ele._private.labelStyleKey + '$@$' + text; + + if (extraKey) { + cacheKey += '$@$' + extraKey; + } + + var cache = r.labelDimCache || (r.labelDimCache = {}); + + if (cache[cacheKey]) { + return cache[cacheKey]; + } + + var sizeMult = 1; // increase the scale to increase accuracy w.r.t. zoomed text + var fStyle = ele.pstyle('font-style').strValue; + var size = sizeMult * ele.pstyle('font-size').pfValue + 'px'; + var family = ele.pstyle('font-family').strValue; + var weight = ele.pstyle('font-weight').strValue; + + var div = this.labelCalcDiv; + + if (!div) { + div = this.labelCalcDiv = document.createElement('div'); // eslint-disable-line no-undef + document.body.appendChild(div); // eslint-disable-line no-undef + } + + var ds = div.style; + + // from ele style + ds.fontFamily = family; + ds.fontStyle = fStyle; + ds.fontSize = size; + ds.fontWeight = weight; + + // forced style + ds.position = 'absolute'; + ds.left = '-9999px'; + ds.top = '-9999px'; + ds.zIndex = '-1'; + ds.visibility = 'hidden'; + ds.pointerEvents = 'none'; + ds.padding = '0'; + ds.lineHeight = '1'; + + if (ele.pstyle('text-wrap').value === 'wrap') { + ds.whiteSpace = 'pre'; // so newlines are taken into account + } else { + ds.whiteSpace = 'normal'; + } + + // put label content in div + div.textContent = text; + + cache[cacheKey] = { + width: Math.ceil(div.clientWidth / sizeMult), + height: Math.ceil(div.clientHeight / sizeMult) + }; + + return cache[cacheKey]; +}; + +BRp.calculateLabelAngles = function (ele) { + var _p = ele._private; + var rs = _p.rscratch; + var isEdge = ele.isEdge(); + var rot = ele.pstyle('text-rotation'); + var rotStr = rot.strValue; + + if (rotStr === 'none') { + rs.labelAngle = rs.sourceLabelAngle = rs.targetLabelAngle = 0; + } else if (isEdge && rotStr === 'autorotate') { + rs.labelAngle = rs.labelAutoAngle; + rs.sourceLabelAngle = rs.sourceLabelAutoAngle; + rs.targetLabelAngle = rs.targetLabelAutoAngle; + } else if (rotStr === 'autorotate') { + rs.labelAngle = rs.sourceLabelAngle = rs.targetLabelAngle = 0; + } else { + rs.labelAngle = rs.sourceLabelAngle = rs.targetLabelAngle = rot.pfValue; + } +}; + +module.exports = BRp; + +/***/ }), +/* 117 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var BRp = {}; + +BRp.getNodeShape = function (node) { + var r = this; + var shape = node.pstyle('shape').value; + + if (node.isParent()) { + if (shape === 'rectangle' || shape === 'roundrectangle' || shape === 'cutrectangle' || shape === 'barrel') { + return shape; + } else { + return 'rectangle'; + } + } + + if (shape === 'polygon') { + var points = node.pstyle('shape-polygon-points').value; + + return r.nodeShapes.makePolygon(points).name; + } + + return shape; +}; + +module.exports = BRp; + +/***/ }), +/* 118 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var BRp = {}; + +BRp.registerCalculationListeners = function () { + var cy = this.cy; + var elesToUpdate = cy.collection(); + var r = this; + + var enqueue = function enqueue(eles, e) { + var dirtyStyleCaches = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + + elesToUpdate.merge(eles); + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + var _p = ele._private; + var rstyle = _p.rstyle; + + if (dirtyStyleCaches) { + rstyle.clean = false; + _p.bbCache = null; + } + + var evts = rstyle.dirtyEvents = rstyle.dirtyEvents || { length: 0 }; + + if (!evts[e.type]) { + evts[e.type] = true; + evts.length++; + } + } + }; + + r.binder(cy) + // nodes + + .on('position.* style.* free.* bounds.*', 'node', function onDirtyModNode(e) { + var node = e.target; + + enqueue(node, e); + enqueue(node.connectedEdges(), e); + }).on('add.*', 'node', function onDirtyAddNode(e) { + var ele = e.target; + + enqueue(ele, e); + }).on('background.*', 'node', function onDirtyBgNode(e) { + var ele = e.target; + + enqueue(ele, e, false); + }) + + // edges + + .on('add.* style.*', 'edge', function onDirtyEdge(e) { + var edge = e.target; + + enqueue(edge, e); + enqueue(edge.parallelEdges(), e); + }).on('remove.*', 'edge', function onDirtyRemoveEdge(e) { + var edge = e.target; + var pEdges = edge.parallelEdges(); + + for (var i = 0; i < pEdges.length; i++) { + var pEdge = pEdges[i]; + + if (!pEdge.removed()) { + enqueue(pEdge, e); + } + } + }) + + // manual dirtying + + .on('dirty.*', 'node', function onDirtyEle(e) { + var ele = e.target; + + enqueue(ele, e); + }); + + var updateEleCalcs = function updateEleCalcs(willDraw) { + if (willDraw) { + var fns = r.onUpdateEleCalcsFns; + + if (fns) { + for (var i = 0; i < fns.length; i++) { + var fn = fns[i]; + + fn(willDraw, elesToUpdate); + } + } + + r.recalculateRenderedStyle(elesToUpdate, false); + + for (var i = 0; i < elesToUpdate.length; i++) { + elesToUpdate[i]._private.rstyle.dirtyEvents = null; + } + + elesToUpdate = cy.collection(); + } + }; + + r.beforeRender(updateEleCalcs, r.beforeRenderPriorities.eleCalcs); +}; + +BRp.onUpdateEleCalcs = function (fn) { + var fns = this.onUpdateEleCalcsFns = this.onUpdateEleCalcsFns || []; + + fns.push(fn); +}; + +BRp.recalculateRenderedStyle = function (eles, useCache) { + var edges = []; + var nodes = []; + + // the renderer can't be used for calcs when destroyed, e.g. ele.boundingBox() + if (this.destroyed) { + return; + } + + // use cache by default for perf + if (useCache === undefined) { + useCache = true; + } + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + var _p = ele._private; + var rstyle = _p.rstyle; + + // only update if dirty and in graph + if (useCache && rstyle.clean || ele.removed()) { + continue; + } + + // only update if not display: none + if (ele.pstyle('display').value === 'none') { + continue; + } + + if (_p.group === 'nodes') { + nodes.push(ele); + } else { + // edges + edges.push(ele); + } + + rstyle.clean = true; + // rstyle.dirtyEvents = null; + } + + // update node data from projections + for (var i = 0; i < nodes.length; i++) { + var ele = nodes[i]; + var _p = ele._private; + var rstyle = _p.rstyle; + var pos = ele.position(); + + this.recalculateNodeLabelProjection(ele); + + rstyle.nodeX = pos.x; + rstyle.nodeY = pos.y; + rstyle.nodeW = ele.pstyle('width').pfValue; + rstyle.nodeH = ele.pstyle('height').pfValue; + } + + this.recalculateEdgeProjections(edges); + + // update edge data from projections + for (var i = 0; i < edges.length; i++) { + var ele = edges[i]; + var _p = ele._private; + var rstyle = _p.rstyle; + var rs = _p.rscratch; + + this.recalculateEdgeLabelProjections(ele); + + // update rstyle positions + rstyle.srcX = rs.arrowStartX; + rstyle.srcY = rs.arrowStartY; + rstyle.tgtX = rs.arrowEndX; + rstyle.tgtY = rs.arrowEndY; + rstyle.midX = rs.midX; + rstyle.midY = rs.midY; + rstyle.labelAngle = rs.labelAngle; + rstyle.sourceLabelAngle = rs.sourceLabelAngle; + rstyle.targetLabelAngle = rs.targetLabelAngle; + } +}; + +module.exports = BRp; + +/***/ }), +/* 119 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var zIndexSort = __webpack_require__(17); + +var BRp = {}; + +BRp.updateCachedGrabbedEles = function () { + var eles = this.cachedZSortedEles; + + if (!eles) { + // just let this be recalculated on the next z sort tick + return; + } + + eles.drag = []; + eles.nondrag = []; + + var grabTargets = []; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + var rs = ele._private.rscratch; + + if (ele.grabbed() && !ele.isParent()) { + grabTargets.push(ele); + } else if (rs.inDragLayer) { + eles.drag.push(ele); + } else { + eles.nondrag.push(ele); + } + } + + // put the grab target nodes last so it's on top of its neighbourhood + for (var i = 0; i < grabTargets.length; i++) { + var ele = grabTargets[i]; + + eles.drag.push(ele); + } +}; + +BRp.invalidateCachedZSortedEles = function () { + this.cachedZSortedEles = null; +}; + +BRp.getCachedZSortedEles = function (forceRecalc) { + if (forceRecalc || !this.cachedZSortedEles) { + //console.time('cachezorder') + + var eles = this.cy.mutableElements().toArray(); + + eles.sort(zIndexSort); + + eles.interactive = eles.filter(function (ele) { + return ele.interactive(); + }); + + this.cachedZSortedEles = eles; + + this.updateCachedGrabbedEles(); + } else { + eles = this.cachedZSortedEles; + } + + return eles; +}; + +module.exports = BRp; + +/***/ }), +/* 120 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var BRp = {}; + +BRp.getCachedImage = function (url, crossOrigin, onLoad) { + var r = this; + var imageCache = r.imageCache = r.imageCache || {}; + var cache = imageCache[url]; + + if (cache) { + if (!cache.image.complete) { + cache.image.addEventListener('load', onLoad); + } + + return cache.image; + } else { + cache = imageCache[url] = imageCache[url] || {}; + + var image = cache.image = new Image(); // eslint-disable-line no-undef + + image.addEventListener('load', onLoad); + image.addEventListener('error', function () { + image.error = true; + }); + + // #1582 safari doesn't load data uris with crossOrigin properly + // https://bugs.webkit.org/show_bug.cgi?id=123978 + var dataUriPrefix = 'data:'; + var isDataUri = url.substring(0, dataUriPrefix.length).toLowerCase() === dataUriPrefix; + if (!isDataUri) { + image.crossOrigin = crossOrigin; // prevent tainted canvas + } + + image.src = url; + + return image; + } +}; + +module.exports = BRp; + +/***/ }), +/* 121 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var util = __webpack_require__(1); +var math = __webpack_require__(2); +var Event = __webpack_require__(16); + +var BRp = {}; + +BRp.registerBinding = function (target, event, handler, useCapture) { + var args = Array.prototype.slice.apply(arguments, [1]); // copy + var b = this.binder(target); + + return b.on.apply(b, args); +}; + +BRp.binder = function (tgt) { + var r = this; + + var tgtIsDom = tgt === window || tgt === document || tgt === document.body || is.domElement(tgt); + + if (r.supportsPassiveEvents == null) { + + // from https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection + var supportsPassive = false; + try { + var opts = Object.defineProperty({}, 'passive', { + get: function get() { + supportsPassive = true; + } + }); + + window.addEventListener('test', null, opts); + } catch (err) {} + + r.supportsPassiveEvents = supportsPassive; + } + + var on = function on(event, handler, useCapture) { + var args = Array.prototype.slice.call(arguments); + + if (tgtIsDom && r.supportsPassiveEvents) { + // replace useCapture w/ opts obj + args[2] = { + capture: useCapture != null ? useCapture : false, + passive: false, + once: false + }; + } + + r.bindings.push({ + target: tgt, + args: args + }); + + (tgt.addEventListener || tgt.on).apply(tgt, args); + + return this; + }; + + return { + on: on, + addEventListener: on, + addListener: on, + bind: on + }; +}; + +BRp.nodeIsDraggable = function (node) { + return node && node.isNode() && !node.locked() && node.grabbable(); +}; + +BRp.nodeIsGrabbable = function (node) { + return this.nodeIsDraggable(node) && node.interactive(); +}; + +BRp.load = function () { + var r = this; + + var triggerEvents = function triggerEvents(target, names, e, props) { + if (target == null) { + target = r.cy; + } + + for (var i = 0; i < names.length; i++) { + var name = names[i]; + + target.emit(util.extend({ originalEvent: e, type: name }, props)); + } + }; + + var isMultSelKeyDown = function isMultSelKeyDown(e) { + return e.shiftKey || e.metaKey || e.ctrlKey; // maybe e.altKey + }; + + var allowPanningPassthrough = function allowPanningPassthrough(down, downs) { + var allowPassthrough = true; + + if (r.cy.hasCompoundNodes() && down && down.isEdge()) { + // a compound node below the edge => no passthrough panning + for (var i = 0; downs && i < downs.length; i++) { + var down = downs[i]; + + if (down.isNode() && down.isParent()) { + allowPassthrough = false; + break; + } + } + } else { + allowPassthrough = true; + } + + return allowPassthrough; + }; + + var getDragListIds = function getDragListIds(opts) { + var listHasId; + + if (opts.addToList && r.cy.hasCompoundNodes()) { + // only needed for compound graphs + if (!opts.addToList.hasId) { + // build ids lookup if doesn't already exist + opts.addToList.hasId = {}; + + for (var i = 0; i < opts.addToList.length; i++) { + var ele = opts.addToList[i]; + + opts.addToList.hasId[ele.id()] = true; + } + } + + listHasId = opts.addToList.hasId; + } + + return listHasId || {}; + }; + + var setGrabbed = function setGrabbed(ele) { + ele[0]._private.grabbed = true; + }; + + var setFreed = function setFreed(ele) { + ele[0]._private.grabbed = false; + }; + + var setInDragLayer = function setInDragLayer(ele) { + ele[0]._private.rscratch.inDragLayer = true; + }; + + var setOutDragLayer = function setOutDragLayer(ele) { + ele[0]._private.rscratch.inDragLayer = false; + }; + + var setGrabTarget = function setGrabTarget(ele) { + ele[0]._private.rscratch.isGrabTarget = true; + }; + + var removeGrabTarget = function removeGrabTarget(ele) { + ele[0]._private.rscratch.isGrabTarget = false; + }; + + var addToDragList = function addToDragList(ele, opts) { + var listHasId = getDragListIds(opts); + + if (!listHasId[ele.id()]) { + opts.addToList.push(ele); + listHasId[ele.id()] = true; + + setGrabbed(ele); + } + }; + + // helper function to determine which child nodes and inner edges + // of a compound node to be dragged as well as the grabbed and selected nodes + var addDescendantsToDrag = function addDescendantsToDrag(node, opts) { + if (!node.cy().hasCompoundNodes()) { + return; + } + + if (opts.inDragLayer == null && opts.addToList == null) { + return; + } // nothing to do + + var innerNodes = node.descendants(); + + if (opts.inDragLayer) { + innerNodes.forEach(setInDragLayer); + innerNodes.connectedEdges().forEach(setInDragLayer); + } + + if (opts.addToList) { + innerNodes.forEach(function (ele) { + addToDragList(ele, opts); + }); + } + }; + + // adds the given nodes and its neighbourhood to the drag layer + var addNodesToDrag = function addNodesToDrag(nodes, opts) { + opts = opts || {}; + + var hasCompoundNodes = nodes.cy().hasCompoundNodes(); + + if (opts.inDragLayer) { + nodes.forEach(setInDragLayer); + + nodes.neighborhood().stdFilter(function (ele) { + return !hasCompoundNodes || ele.isEdge(); + }).forEach(setInDragLayer); + } + + if (opts.addToList) { + nodes.forEach(function (ele) { + addToDragList(ele, opts); + }); + } + + addDescendantsToDrag(nodes, opts); // always add to drag + + // also add nodes and edges related to the topmost ancestor + updateAncestorsInDragLayer(nodes, { + inDragLayer: opts.inDragLayer + }); + + r.updateCachedGrabbedEles(); + }; + + var addNodeToDrag = addNodesToDrag; + + var freeDraggedElements = function freeDraggedElements(grabbedEles) { + if (!grabbedEles) { + return; + } + + grabbedEles.hasId = {}; // clear the id list + + // just go over all elements rather than doing a bunch of (possibly expensive) traversals + r.getCachedZSortedEles().forEach(function (ele) { + setFreed(ele); + setOutDragLayer(ele); + removeGrabTarget(ele); + }); + + r.updateCachedGrabbedEles(); + }; + + // helper function to determine which ancestor nodes and edges should go + // to the drag layer (or should be removed from drag layer). + var updateAncestorsInDragLayer = function updateAncestorsInDragLayer(node, opts) { + + if (opts.inDragLayer == null && opts.addToList == null) { + return; + } // nothing to do + + if (!node.cy().hasCompoundNodes()) { + return; + } + + // find top-level parent + var parent = node.ancestors().orphans(); + + // no parent node: no nodes to add to the drag layer + if (parent.same(node)) { + return; + } + + var nodes = parent.descendants().spawnSelf().merge(parent).unmerge(node).unmerge(node.descendants()); + + var edges = nodes.connectedEdges(); + + if (opts.inDragLayer) { + edges.forEach(setInDragLayer); + nodes.forEach(setInDragLayer); + } + + if (opts.addToList) { + nodes.forEach(function (ele) { + addToDragList(ele, opts); + }); + } + }; + + var blurActiveDomElement = function blurActiveDomElement() { + if (document.activeElement != null && document.activeElement.blur != null) { + document.activeElement.blur(); + } + }; + + var haveMutationsApi = typeof MutationObserver !== 'undefined'; + + // watch for when the cy container is removed from the dom + if (haveMutationsApi) { + r.removeObserver = new MutationObserver(function (mutns) { + // eslint-disable-line no-undef + for (var i = 0; i < mutns.length; i++) { + var mutn = mutns[i]; + var rNodes = mutn.removedNodes; + + if (rNodes) { + for (var j = 0; j < rNodes.length; j++) { + var rNode = rNodes[j]; + + if (rNode === r.container) { + r.destroy(); + break; + } + } + } + } + }); + + if (r.container.parentNode) { + r.removeObserver.observe(r.container.parentNode, { childList: true }); + } + } else { + r.registerBinding(r.container, 'DOMNodeRemoved', function (e) { + r.destroy(); + }); + } + + var onResize = util.debounce(function () { + r.cy.resize(); + }, 100); + + if (haveMutationsApi) { + r.styleObserver = new MutationObserver(onResize); // eslint-disable-line no-undef + + r.styleObserver.observe(r.container, { attributes: true }); + } + + // auto resize + r.registerBinding(window, 'resize', onResize); // eslint-disable-line no-undef + + var forEachUp = function forEachUp(domEle, fn) { + while (domEle != null) { + fn(domEle); + + domEle = domEle.parentNode; + } + }; + + var invalidateCoords = function invalidateCoords() { + r.invalidateContainerClientCoordsCache(); + }; + + forEachUp(r.container, function (domEle) { + r.registerBinding(domEle, 'transitionend', invalidateCoords); + r.registerBinding(domEle, 'animationend', invalidateCoords); + r.registerBinding(domEle, 'scroll', invalidateCoords); + }); + + // stop right click menu from appearing on cy + r.registerBinding(r.container, 'contextmenu', function (e) { + e.preventDefault(); + }); + + var inBoxSelection = function inBoxSelection() { + return r.selection[4] !== 0; + }; + + var eventInContainer = function eventInContainer(e) { + // save cycles if mouse events aren't to be captured + var containerPageCoords = r.findContainerClientCoords(); + var x = containerPageCoords[0]; + var y = containerPageCoords[1]; + var width = containerPageCoords[2]; + var height = containerPageCoords[3]; + + var positions = e.touches ? e.touches : [e]; + var atLeastOnePosInside = false; + + for (var i = 0; i < positions.length; i++) { + var p = positions[i]; + + if (x <= p.clientX && p.clientX <= x + width && y <= p.clientY && p.clientY <= y + height) { + atLeastOnePosInside = true; + break; + } + } + + if (!atLeastOnePosInside) { + return false; + } + + var container = r.container; + var target = e.target; + var tParent = target.parentNode; + var containerIsTarget = false; + + while (tParent) { + if (tParent === container) { + containerIsTarget = true; + break; + } + + tParent = tParent.parentNode; + } + + if (!containerIsTarget) { + return false; + } // if target is outisde cy container, then this event is not for us + + return true; + }; + + // Primary key + r.registerBinding(r.container, 'mousedown', function mousedownHandler(e) { + if (!eventInContainer(e)) { + return; + } + + e.preventDefault(); + + blurActiveDomElement(); + + r.hoverData.capture = true; + r.hoverData.which = e.which; + + var cy = r.cy; + var gpos = [e.clientX, e.clientY]; + var pos = r.projectIntoViewport(gpos[0], gpos[1]); + var select = r.selection; + var nears = r.findNearestElements(pos[0], pos[1], true, false); + var near = nears[0]; + var draggedElements = r.dragData.possibleDragElements; + + r.hoverData.mdownPos = pos; + r.hoverData.mdownGPos = gpos; + + var checkForTaphold = function checkForTaphold() { + r.hoverData.tapholdCancelled = false; + + clearTimeout(r.hoverData.tapholdTimeout); + + r.hoverData.tapholdTimeout = setTimeout(function () { + + if (r.hoverData.tapholdCancelled) { + return; + } else { + var ele = r.hoverData.down; + + if (ele) { + ele.emit({ + originalEvent: e, + type: 'taphold', + position: { x: pos[0], y: pos[1] } + }); + } else { + cy.emit({ + originalEvent: e, + type: 'taphold', + position: { x: pos[0], y: pos[1] } + }); + } + } + }, r.tapholdDuration); + }; + + // Right click button + if (e.which == 3) { + + r.hoverData.cxtStarted = true; + + var cxtEvt = { + originalEvent: e, + type: 'cxttapstart', + position: { x: pos[0], y: pos[1] } + }; + + if (near) { + near.activate(); + near.emit(cxtEvt); + + r.hoverData.down = near; + } else { + cy.emit(cxtEvt); + } + + r.hoverData.downTime = new Date().getTime(); + r.hoverData.cxtDragged = false; + + // Primary button + } else if (e.which == 1) { + + if (near) { + near.activate(); + } + + // Element dragging + { + // If something is under the cursor and it is draggable, prepare to grab it + if (near != null) { + + if (r.nodeIsGrabbable(near)) { + + var makeEvent = function makeEvent(type) { + return { + originalEvent: e, + type: type, + position: { x: pos[0], y: pos[1] } + }; + }; + + var triggerGrab = function triggerGrab(ele) { + ele.emit(makeEvent('grab')); + }; + + setGrabTarget(near); + + if (!near.selected()) { + + draggedElements = r.dragData.possibleDragElements = []; + addNodeToDrag(near, { addToList: draggedElements }); + + near.emit(makeEvent('grabon')).emit(makeEvent('grab')); + } else { + draggedElements = r.dragData.possibleDragElements = []; + + var selectedNodes = cy.$(function (ele) { + return ele.isNode() && ele.selected() && r.nodeIsGrabbable(ele); + }); + + addNodesToDrag(selectedNodes, { addToList: draggedElements }); + + near.emit(makeEvent('grabon')); + + selectedNodes.forEach(triggerGrab); + } + + r.redrawHint('eles', true); + r.redrawHint('drag', true); + } + } + + r.hoverData.down = near; + r.hoverData.downs = nears; + r.hoverData.downTime = new Date().getTime(); + } + + triggerEvents(near, ['mousedown', 'tapstart', 'vmousedown'], e, { + position: { x: pos[0], y: pos[1] } + }); + + if (near == null) { + select[4] = 1; + + r.data.bgActivePosistion = { + x: pos[0], + y: pos[1] + }; + + r.redrawHint('select', true); + + r.redraw(); + } else if (near.isEdge()) { + select[4] = 1; // for future pan + } + + checkForTaphold(); + } + + // Initialize selection box coordinates + select[0] = select[2] = pos[0]; + select[1] = select[3] = pos[1]; + }, false); + + r.registerBinding(window, 'mousemove', function mousemoveHandler(e) { + // eslint-disable-line no-undef + var capture = r.hoverData.capture; + + if (!capture && !eventInContainer(e)) { + return; + } + + var preventDefault = false; + var cy = r.cy; + var zoom = cy.zoom(); + var gpos = [e.clientX, e.clientY]; + var pos = r.projectIntoViewport(gpos[0], gpos[1]); + var mdownPos = r.hoverData.mdownPos; + var mdownGPos = r.hoverData.mdownGPos; + var select = r.selection; + + var near = null; + if (!r.hoverData.draggingEles && !r.hoverData.dragging && !r.hoverData.selecting) { + near = r.findNearestElement(pos[0], pos[1], true, false); + } + var last = r.hoverData.last; + var down = r.hoverData.down; + + var disp = [pos[0] - select[2], pos[1] - select[3]]; + + var draggedElements = r.dragData.possibleDragElements; + + var isOverThresholdDrag; + + if (mdownGPos) { + var dx = gpos[0] - mdownGPos[0]; + var dx2 = dx * dx; + var dy = gpos[1] - mdownGPos[1]; + var dy2 = dy * dy; + var dist2 = dx2 + dy2; + + r.hoverData.isOverThresholdDrag = isOverThresholdDrag = dist2 >= r.desktopTapThreshold2; + } + + var multSelKeyDown = isMultSelKeyDown(e); + + if (isOverThresholdDrag) { + r.hoverData.tapholdCancelled = true; + } + + var updateDragDelta = function updateDragDelta() { + var dragDelta = r.hoverData.dragDelta = r.hoverData.dragDelta || []; + + if (dragDelta.length === 0) { + dragDelta.push(disp[0]); + dragDelta.push(disp[1]); + } else { + dragDelta[0] += disp[0]; + dragDelta[1] += disp[1]; + } + }; + + preventDefault = true; + + triggerEvents(near, ['mousemove', 'vmousemove', 'tapdrag'], e, { + position: { x: pos[0], y: pos[1] } + }); + + var goIntoBoxMode = function goIntoBoxMode() { + r.data.bgActivePosistion = undefined; + + if (!r.hoverData.selecting) { + cy.emit('boxstart'); + } + + select[4] = 1; + r.hoverData.selecting = true; + + r.redrawHint('select', true); + r.redraw(); + }; + + // trigger context drag if rmouse down + if (r.hoverData.which === 3) { + // but only if over threshold + if (isOverThresholdDrag) { + var cxtEvt = { + originalEvent: e, + type: 'cxtdrag', + position: { x: pos[0], y: pos[1] } + }; + + if (down) { + down.emit(cxtEvt); + } else { + cy.emit(cxtEvt); + } + + r.hoverData.cxtDragged = true; + + if (!r.hoverData.cxtOver || near !== r.hoverData.cxtOver) { + + if (r.hoverData.cxtOver) { + r.hoverData.cxtOver.emit({ + originalEvent: e, + type: 'cxtdragout', + position: { x: pos[0], y: pos[1] } + }); + } + + r.hoverData.cxtOver = near; + + if (near) { + near.emit({ + originalEvent: e, + type: 'cxtdragover', + position: { x: pos[0], y: pos[1] } + }); + } + } + } + + // Check if we are drag panning the entire graph + } else if (r.hoverData.dragging) { + preventDefault = true; + + if (cy.panningEnabled() && cy.userPanningEnabled()) { + var deltaP; + + if (r.hoverData.justStartedPan) { + var mdPos = r.hoverData.mdownPos; + + deltaP = { + x: (pos[0] - mdPos[0]) * zoom, + y: (pos[1] - mdPos[1]) * zoom + }; + + r.hoverData.justStartedPan = false; + } else { + deltaP = { + x: disp[0] * zoom, + y: disp[1] * zoom + }; + } + + cy.panBy(deltaP); + + r.hoverData.dragged = true; + } + + // Needs reproject due to pan changing viewport + pos = r.projectIntoViewport(e.clientX, e.clientY); + + // Checks primary button down & out of time & mouse not moved much + } else if (select[4] == 1 && (down == null || down.isEdge())) { + + if (isOverThresholdDrag) { + + if (!r.hoverData.dragging && cy.boxSelectionEnabled() && (multSelKeyDown || !cy.panningEnabled() || !cy.userPanningEnabled())) { + goIntoBoxMode(); + } else if (!r.hoverData.selecting && cy.panningEnabled() && cy.userPanningEnabled()) { + var allowPassthrough = allowPanningPassthrough(down, r.hoverData.downs); + + if (allowPassthrough) { + r.hoverData.dragging = true; + r.hoverData.justStartedPan = true; + select[4] = 0; + + r.data.bgActivePosistion = math.array2point(mdownPos); + + r.redrawHint('select', true); + r.redraw(); + } + } + + if (down && down.isEdge() && down.active()) { + down.unactivate(); + } + } + } else { + if (down && down.isEdge() && down.active()) { + down.unactivate(); + } + + if ((!down || !down.grabbed()) && near != last) { + + if (last) { + triggerEvents(last, ['mouseout', 'tapdragout'], e, { + position: { x: pos[0], y: pos[1] } + }); + } + + if (near) { + triggerEvents(near, ['mouseover', 'tapdragover'], e, { + position: { x: pos[0], y: pos[1] } + }); + } + + r.hoverData.last = near; + } + + if (down) { + + if (isOverThresholdDrag) { + // then we can take action + + if (cy.boxSelectionEnabled() && multSelKeyDown) { + // then selection overrides + if (down && down.grabbed()) { + freeDraggedElements(draggedElements); + + down.emit('free'); + } + + goIntoBoxMode(); + } else if (down && down.grabbed() && r.nodeIsDraggable(down)) { + // drag node + var justStartedDrag = !r.dragData.didDrag; + + if (justStartedDrag) { + r.redrawHint('eles', true); + } + + r.dragData.didDrag = true; // indicate that we actually did drag the node + + var toTrigger = []; + + // now, add the elements to the drag layer if not done already + if (!r.hoverData.draggingEles) { + addNodesToDrag(cy.collection(draggedElements), { inDragLayer: true }); + } + + for (var i = 0; i < draggedElements.length; i++) { + var dEle = draggedElements[i]; + + // Locked nodes not draggable, as well as non-visible nodes + if (r.nodeIsDraggable(dEle) && dEle.grabbed()) { + var dPos = dEle.position(); + + toTrigger.push(dEle); + + if (is.number(disp[0]) && is.number(disp[1])) { + dPos.x += disp[0]; + dPos.y += disp[1]; + + if (justStartedDrag) { + var dragDelta = r.hoverData.dragDelta; + + if (dragDelta && is.number(dragDelta[0]) && is.number(dragDelta[1])) { + dPos.x += dragDelta[0]; + dPos.y += dragDelta[1]; + } + } + } + } + } + + r.hoverData.draggingEles = true; + + var tcol = cy.collection(toTrigger); + + tcol.dirtyCompoundBoundsCache(); + tcol.emit('position drag'); + + r.redrawHint('drag', true); + r.redraw(); + } + } else { + // otherwise save drag delta for when we actually start dragging so the relative grab pos is constant + updateDragDelta(); + } + } + + // prevent the dragging from triggering text selection on the page + preventDefault = true; + } + + select[2] = pos[0];select[3] = pos[1]; + + if (preventDefault) { + if (e.stopPropagation) e.stopPropagation(); + if (e.preventDefault) e.preventDefault(); + return false; + } + }, false); + + r.registerBinding(window, 'mouseup', function mouseupHandler(e) { + // eslint-disable-line no-undef + var capture = r.hoverData.capture; + if (!capture) { + return; + } + r.hoverData.capture = false; + + var cy = r.cy;var pos = r.projectIntoViewport(e.clientX, e.clientY);var select = r.selection; + var near = r.findNearestElement(pos[0], pos[1], true, false); + var draggedElements = r.dragData.possibleDragElements;var down = r.hoverData.down; + var multSelKeyDown = isMultSelKeyDown(e); + + if (r.data.bgActivePosistion) { + r.redrawHint('select', true); + r.redraw(); + } + + r.hoverData.tapholdCancelled = true; + + r.data.bgActivePosistion = undefined; // not active bg now + + if (down) { + down.unactivate(); + } + + if (r.hoverData.which === 3) { + var cxtEvt = { + originalEvent: e, + type: 'cxttapend', + position: { x: pos[0], y: pos[1] } + }; + + if (down) { + down.emit(cxtEvt); + } else { + cy.emit(cxtEvt); + } + + if (!r.hoverData.cxtDragged) { + var cxtTap = { + originalEvent: e, + type: 'cxttap', + position: { x: pos[0], y: pos[1] } + }; + + if (down) { + down.emit(cxtTap); + } else { + cy.emit(cxtTap); + } + } + + r.hoverData.cxtDragged = false; + r.hoverData.which = null; + } else if (r.hoverData.which === 1) { + + // Deselect all elements if nothing is currently under the mouse cursor and we aren't dragging something + if (down == null && // not mousedown on node + !r.dragData.didDrag // didn't move the node around + && !r.hoverData.selecting // not box selection + && !r.hoverData.dragged // didn't pan + && !isMultSelKeyDown(e)) { + + cy.$(function (ele) { + return ele.selected(); + }).unselect(); + + if (draggedElements.length > 0) { + r.redrawHint('eles', true); + } + + r.dragData.possibleDragElements = draggedElements = []; + } + + triggerEvents(near, ['mouseup', 'tapend', 'vmouseup'], e, { + position: { x: pos[0], y: pos[1] } + }); + + if (!r.dragData.didDrag // didn't move a node around + && !r.hoverData.dragged // didn't pan + && !r.hoverData.selecting // not box selection + && !r.hoverData.isOverThresholdDrag // didn't move too much + ) { + triggerEvents(down, ['click', 'tap', 'vclick'], e, { + position: { x: pos[0], y: pos[1] } + }); + } + + // Single selection + if (near == down && !r.dragData.didDrag && !r.hoverData.selecting) { + if (near != null && near._private.selectable) { + + if (r.hoverData.dragging) { + // if panning, don't change selection state + } else if (cy.selectionType() === 'additive' || multSelKeyDown) { + if (near.selected()) { + near.unselect(); + } else { + near.select(); + } + } else { + if (!multSelKeyDown) { + cy.$(':selected').unmerge(near).unselect(); + near.select(); + } + } + + r.redrawHint('eles', true); + } + } + + if (r.hoverData.selecting) { + var box = cy.collection(r.getAllInBox(select[0], select[1], select[2], select[3])); + + r.redrawHint('select', true); + + if (box.length > 0) { + r.redrawHint('eles', true); + } + + cy.emit('boxend'); + + var eleWouldBeSelected = function eleWouldBeSelected(ele) { + return ele.selectable() && !ele.selected(); + }; + + if (cy.selectionType() === 'additive') { + box.emit('box').stdFilter(eleWouldBeSelected).select().emit('boxselect'); + } else { + if (!multSelKeyDown) { + cy.$(':selected').unmerge(box).unselect(); + } + + box.emit('box').stdFilter(eleWouldBeSelected).select().emit('boxselect'); + } + + // always need redraw in case eles unselectable + r.redraw(); + } + + // Cancel drag pan + if (r.hoverData.dragging) { + r.hoverData.dragging = false; + + r.redrawHint('select', true); + r.redrawHint('eles', true); + + r.redraw(); + } + + if (!select[4]) { + r.redrawHint('drag', true); + r.redrawHint('eles', true); + + var downWasGrabbed = down && down.grabbed(); + + freeDraggedElements(draggedElements); + + if (downWasGrabbed) { + down.emit('free'); + } + } + } // else not right mouse + + select[4] = 0;r.hoverData.down = null; + + r.hoverData.cxtStarted = false; + r.hoverData.draggingEles = false; + r.hoverData.selecting = false; + r.hoverData.isOverThresholdDrag = false; + r.dragData.didDrag = false; + r.hoverData.dragged = false; + r.hoverData.dragDelta = []; + r.hoverData.mdownPos = null; + r.hoverData.mdownGPos = null; + }, false); + + var wheelHandler = function wheelHandler(e) { + + if (r.scrollingPage) { + return; + } // while scrolling, ignore wheel-to-zoom + + var cy = r.cy; + var pos = r.projectIntoViewport(e.clientX, e.clientY); + var rpos = [pos[0] * cy.zoom() + cy.pan().x, pos[1] * cy.zoom() + cy.pan().y]; + + if (r.hoverData.draggingEles || r.hoverData.dragging || r.hoverData.cxtStarted || inBoxSelection()) { + // if pan dragging or cxt dragging, wheel movements make no zoom + e.preventDefault(); + return; + } + + if (cy.panningEnabled() && cy.userPanningEnabled() && cy.zoomingEnabled() && cy.userZoomingEnabled()) { + e.preventDefault(); + + r.data.wheelZooming = true; + clearTimeout(r.data.wheelTimeout); + r.data.wheelTimeout = setTimeout(function () { + r.data.wheelZooming = false; + + r.redrawHint('eles', true); + r.redraw(); + }, 150); + + var diff; + + if (e.deltaY != null) { + diff = e.deltaY / -250; + } else if (e.wheelDeltaY != null) { + diff = e.wheelDeltaY / 1000; + } else { + diff = e.wheelDelta / 1000; + } + + diff = diff * r.wheelSensitivity; + + var needsWheelFix = e.deltaMode === 1; + if (needsWheelFix) { + // fixes slow wheel events on ff/linux and ff/windows + diff *= 33; + } + + cy.zoom({ + level: cy.zoom() * Math.pow(10, diff), + renderedPosition: { x: rpos[0], y: rpos[1] } + }); + } + }; + + // Functions to help with whether mouse wheel should trigger zooming + // -- + r.registerBinding(r.container, 'wheel', wheelHandler, true); + + // disable nonstandard wheel events + // r.registerBinding(r.container, 'mousewheel', wheelHandler, true); + // r.registerBinding(r.container, 'DOMMouseScroll', wheelHandler, true); + // r.registerBinding(r.container, 'MozMousePixelScroll', wheelHandler, true); // older firefox + + r.registerBinding(window, 'scroll', function scrollHandler(e) { + // eslint-disable-line no-undef + r.scrollingPage = true; + + clearTimeout(r.scrollingPageTimeout); + r.scrollingPageTimeout = setTimeout(function () { + r.scrollingPage = false; + }, 250); + }, true); + + // Functions to help with handling mouseout/mouseover on the Cytoscape container + // Handle mouseout on Cytoscape container + r.registerBinding(r.container, 'mouseout', function mouseOutHandler(e) { + var pos = r.projectIntoViewport(e.clientX, e.clientY); + + r.cy.emit({ + originalEvent: e, + type: 'mouseout', + position: { x: pos[0], y: pos[1] } + }); + }, false); + + r.registerBinding(r.container, 'mouseover', function mouseOverHandler(e) { + var pos = r.projectIntoViewport(e.clientX, e.clientY); + + r.cy.emit({ + originalEvent: e, + type: 'mouseover', + position: { x: pos[0], y: pos[1] } + }); + }, false); + + var f1x1, f1y1, f2x1, f2y1; // starting points for pinch-to-zoom + var distance1, distance1Sq; // initial distance between finger 1 and finger 2 for pinch-to-zoom + var center1, modelCenter1; // center point on start pinch to zoom + var offsetLeft, offsetTop; + var containerWidth, containerHeight; + var twoFingersStartInside; + + var distance = function distance(x1, y1, x2, y2) { + return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); + }; + + var distanceSq = function distanceSq(x1, y1, x2, y2) { + return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1); + }; + + var touchstartHandler; + r.registerBinding(r.container, 'touchstart', touchstartHandler = function touchstartHandler(e) { + if (!eventInContainer(e)) { + return; + } + + blurActiveDomElement(); + + r.touchData.capture = true; + r.data.bgActivePosistion = undefined; + + var cy = r.cy; + var now = r.touchData.now; + var earlier = r.touchData.earlier; + + if (e.touches[0]) { + var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);now[0] = pos[0];now[1] = pos[1]; + } + if (e.touches[1]) { + var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);now[2] = pos[0];now[3] = pos[1]; + } + if (e.touches[2]) { + var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);now[4] = pos[0];now[5] = pos[1]; + } + + // record starting points for pinch-to-zoom + if (e.touches[1]) { + + freeDraggedElements(r.dragData.touchDragEles); + + var offsets = r.findContainerClientCoords(); + offsetLeft = offsets[0]; + offsetTop = offsets[1]; + containerWidth = offsets[2]; + containerHeight = offsets[3]; + + f1x1 = e.touches[0].clientX - offsetLeft; + f1y1 = e.touches[0].clientY - offsetTop; + + f2x1 = e.touches[1].clientX - offsetLeft; + f2y1 = e.touches[1].clientY - offsetTop; + + twoFingersStartInside = 0 <= f1x1 && f1x1 <= containerWidth && 0 <= f2x1 && f2x1 <= containerWidth && 0 <= f1y1 && f1y1 <= containerHeight && 0 <= f2y1 && f2y1 <= containerHeight; + + var pan = cy.pan(); + var zoom = cy.zoom(); + + distance1 = distance(f1x1, f1y1, f2x1, f2y1); + distance1Sq = distanceSq(f1x1, f1y1, f2x1, f2y1); + center1 = [(f1x1 + f2x1) / 2, (f1y1 + f2y1) / 2]; + modelCenter1 = [(center1[0] - pan.x) / zoom, (center1[1] - pan.y) / zoom]; + + // consider context tap + var cxtDistThreshold = 200; + var cxtDistThresholdSq = cxtDistThreshold * cxtDistThreshold; + if (distance1Sq < cxtDistThresholdSq && !e.touches[2]) { + + var near1 = r.findNearestElement(now[0], now[1], true, true); + var near2 = r.findNearestElement(now[2], now[3], true, true); + + if (near1 && near1.isNode()) { + near1.activate().emit({ + originalEvent: e, + type: 'cxttapstart', + position: { x: now[0], y: now[1] } + }); + r.touchData.start = near1; + } else if (near2 && near2.isNode()) { + near2.activate().emit({ + originalEvent: e, + type: 'cxttapstart', + position: { x: now[0], y: now[1] } + }); + r.touchData.start = near2; + } else { + cy.emit({ + originalEvent: e, + type: 'cxttapstart', + position: { x: now[0], y: now[1] } + }); + } + + if (r.touchData.start) { + r.touchData.start._private.grabbed = false; + } + r.touchData.cxt = true; + r.touchData.cxtDragged = false; + r.data.bgActivePosistion = undefined; + + r.redraw(); + return; + } + } + + if (e.touches[2]) { + // ignore + } else if (e.touches[1]) { + // ignore + } else if (e.touches[0]) { + var nears = r.findNearestElements(now[0], now[1], true, true); + var near = nears[0]; + + if (near != null) { + near.activate(); + + r.touchData.start = near; + r.touchData.starts = nears; + + if (r.nodeIsGrabbable(near)) { + + var draggedEles = r.dragData.touchDragEles = []; + var selectedNodes = null; + + r.redrawHint('eles', true); + r.redrawHint('drag', true); + + if (near.selected()) { + // reset drag elements, since near will be added again + + selectedNodes = cy.$(function (ele) { + return ele.selected() && r.nodeIsGrabbable(ele); + }); + + addNodesToDrag(selectedNodes, { addToList: draggedEles }); + } else { + addNodeToDrag(near, { addToList: draggedEles }); + } + + setGrabTarget(near); + + var makeEvent = function makeEvent(type) { + return { + originalEvent: e, + type: type, + position: { x: now[0], y: now[1] } + }; + }; + + near.emit(makeEvent('grabon')); + + if (selectedNodes) { + selectedNodes.forEach(function (n) { + n.emit(makeEvent('grab')); + }); + } else { + near.emit(makeEvent('grab')); + } + } + } + + triggerEvents(near, ['touchstart', 'tapstart', 'vmousedown'], e, { + position: { x: now[0], y: now[1] } + }); + + if (near == null) { + r.data.bgActivePosistion = { + x: pos[0], + y: pos[1] + }; + + r.redrawHint('select', true); + r.redraw(); + } + + // Tap, taphold + // ----- + + r.touchData.singleTouchMoved = false; + r.touchData.singleTouchStartTime = +new Date(); + + clearTimeout(r.touchData.tapholdTimeout); + r.touchData.tapholdTimeout = setTimeout(function () { + if (r.touchData.singleTouchMoved === false && !r.pinching // if pinching, then taphold unselect shouldn't take effect + && !r.touchData.selecting // box selection shouldn't allow taphold through + ) { + triggerEvents(r.touchData.start, ['taphold'], e, { + position: { x: now[0], y: now[1] } + }); + + if (!r.touchData.start) { + cy.$(':selected').unselect(); + } + } + }, r.tapholdDuration); + } + + if (e.touches.length >= 1) { + var sPos = r.touchData.startPosition = []; + + for (var i = 0; i < now.length; i++) { + sPos[i] = earlier[i] = now[i]; + } + + var touch0 = e.touches[0]; + + r.touchData.startGPosition = [touch0.clientX, touch0.clientY]; + } + }, false); + + var touchmoveHandler; + r.registerBinding(window, 'touchmove', touchmoveHandler = function touchmoveHandler(e) { + // eslint-disable-line no-undef + var capture = r.touchData.capture; + + if (!capture && !eventInContainer(e)) { + return; + } + + var select = r.selection; + var cy = r.cy; + var now = r.touchData.now; + var earlier = r.touchData.earlier; + var zoom = cy.zoom(); + + if (e.touches[0]) { + var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);now[0] = pos[0];now[1] = pos[1]; + } + if (e.touches[1]) { + var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);now[2] = pos[0];now[3] = pos[1]; + } + if (e.touches[2]) { + var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);now[4] = pos[0];now[5] = pos[1]; + } + + var startGPos = r.touchData.startGPosition; + var isOverThresholdDrag; + + if (capture && e.touches[0] && startGPos) { + var disp = [];for (var j = 0; j < now.length; j++) { + disp[j] = now[j] - earlier[j]; + } + var dx = e.touches[0].clientX - startGPos[0]; + var dx2 = dx * dx; + var dy = e.touches[0].clientY - startGPos[1]; + var dy2 = dy * dy; + var dist2 = dx2 + dy2; + + isOverThresholdDrag = dist2 >= r.touchTapThreshold2; + } + + // context swipe cancelling + if (capture && r.touchData.cxt) { + e.preventDefault(); + + var f1x2 = e.touches[0].clientX - offsetLeft, + f1y2 = e.touches[0].clientY - offsetTop; + var f2x2 = e.touches[1].clientX - offsetLeft, + f2y2 = e.touches[1].clientY - offsetTop; + // var distance2 = distance( f1x2, f1y2, f2x2, f2y2 ); + var distance2Sq = distanceSq(f1x2, f1y2, f2x2, f2y2); + var factorSq = distance2Sq / distance1Sq; + + var distThreshold = 150; + var distThresholdSq = distThreshold * distThreshold; + var factorThreshold = 1.5; + var factorThresholdSq = factorThreshold * factorThreshold; + + // cancel ctx gestures if the distance b/t the fingers increases + if (factorSq >= factorThresholdSq || distance2Sq >= distThresholdSq) { + r.touchData.cxt = false; + + r.data.bgActivePosistion = undefined; + + r.redrawHint('select', true); + + var cxtEvt = { + originalEvent: e, + type: 'cxttapend', + position: { x: now[0], y: now[1] } + }; + + if (r.touchData.start) { + r.touchData.start.unactivate().emit(cxtEvt); + + r.touchData.start = null; + } else { + cy.emit(cxtEvt); + } + } + } + + // context swipe + if (capture && r.touchData.cxt) { + var cxtEvt = { + originalEvent: e, + type: 'cxtdrag', + position: { x: now[0], y: now[1] } + }; + r.data.bgActivePosistion = undefined; + r.redrawHint('select', true); + + if (r.touchData.start) { + r.touchData.start.emit(cxtEvt); + } else { + cy.emit(cxtEvt); + } + + if (r.touchData.start) { + r.touchData.start._private.grabbed = false; + } + r.touchData.cxtDragged = true; + + var near = r.findNearestElement(now[0], now[1], true, true); + + if (!r.touchData.cxtOver || near !== r.touchData.cxtOver) { + + if (r.touchData.cxtOver) { + r.touchData.cxtOver.emit({ + originalEvent: e, + type: 'cxtdragout', + position: { x: now[0], y: now[1] } + }); + } + + r.touchData.cxtOver = near; + + if (near) { + near.emit({ + originalEvent: e, + type: 'cxtdragover', + position: { x: now[0], y: now[1] } + }); + } + } + + // box selection + } else if (capture && e.touches[2] && cy.boxSelectionEnabled()) { + e.preventDefault(); + + r.data.bgActivePosistion = undefined; + + this.lastThreeTouch = +new Date(); + + if (!r.touchData.selecting) { + cy.emit('boxstart'); + } + + r.touchData.selecting = true; + + r.redrawHint('select', true); + + if (!select || select.length === 0 || select[0] === undefined) { + select[0] = (now[0] + now[2] + now[4]) / 3; + select[1] = (now[1] + now[3] + now[5]) / 3; + select[2] = (now[0] + now[2] + now[4]) / 3 + 1; + select[3] = (now[1] + now[3] + now[5]) / 3 + 1; + } else { + select[2] = (now[0] + now[2] + now[4]) / 3; + select[3] = (now[1] + now[3] + now[5]) / 3; + } + + select[4] = 1; + r.touchData.selecting = true; + + r.redraw(); + + // pinch to zoom + } else if (capture && e.touches[1] && cy.zoomingEnabled() && cy.panningEnabled() && cy.userZoomingEnabled() && cy.userPanningEnabled()) { + // two fingers => pinch to zoom + e.preventDefault(); + + r.data.bgActivePosistion = undefined; + r.redrawHint('select', true); + + var draggedEles = r.dragData.touchDragEles; + if (draggedEles) { + r.redrawHint('drag', true); + + for (var i = 0; i < draggedEles.length; i++) { + var de_p = draggedEles[i]._private; + + de_p.grabbed = false; + de_p.rscratch.inDragLayer = false; + } + } + + // (x2, y2) for fingers 1 and 2 + var f1x2 = e.touches[0].clientX - offsetLeft, + f1y2 = e.touches[0].clientY - offsetTop; + var f2x2 = e.touches[1].clientX - offsetLeft, + f2y2 = e.touches[1].clientY - offsetTop; + + var distance2 = distance(f1x2, f1y2, f2x2, f2y2); + // var distance2Sq = distanceSq( f1x2, f1y2, f2x2, f2y2 ); + // var factor = Math.sqrt( distance2Sq ) / Math.sqrt( distance1Sq ); + var factor = distance2 / distance1; + + if (twoFingersStartInside) { + // delta finger1 + var df1x = f1x2 - f1x1; + var df1y = f1y2 - f1y1; + + // delta finger 2 + var df2x = f2x2 - f2x1; + var df2y = f2y2 - f2y1; + + // translation is the normalised vector of the two fingers movement + // i.e. so pinching cancels out and moving together pans + var tx = (df1x + df2x) / 2; + var ty = (df1y + df2y) / 2; + + // adjust factor by the speed multiplier + // var speed = 1.5; + // if( factor > 1 ){ + // factor = (factor - 1) * speed + 1; + // } else { + // factor = 1 - (1 - factor) * speed; + // } + + // now calculate the zoom + var zoom1 = cy.zoom(); + var zoom2 = zoom1 * factor; + var pan1 = cy.pan(); + + // the model center point converted to the current rendered pos + var ctrx = modelCenter1[0] * zoom1 + pan1.x; + var ctry = modelCenter1[1] * zoom1 + pan1.y; + + var pan2 = { + x: -zoom2 / zoom1 * (ctrx - pan1.x - tx) + ctrx, + y: -zoom2 / zoom1 * (ctry - pan1.y - ty) + ctry + }; + + // remove dragged eles + if (r.touchData.start && r.touchData.start.active()) { + var draggedEles = r.dragData.touchDragEles; + + freeDraggedElements(draggedEles); + + r.redrawHint('drag', true); + r.redrawHint('eles', true); + + r.touchData.start.unactivate().emit('free'); + } + + cy.viewport({ + zoom: zoom2, + pan: pan2, + cancelOnFailedZoom: true + }); + + distance1 = distance2; + f1x1 = f1x2; + f1y1 = f1y2; + f2x1 = f2x2; + f2y1 = f2y2; + + r.pinching = true; + } + + // Re-project + if (e.touches[0]) { + var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);now[0] = pos[0];now[1] = pos[1]; + } + if (e.touches[1]) { + var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);now[2] = pos[0];now[3] = pos[1]; + } + if (e.touches[2]) { + var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);now[4] = pos[0];now[5] = pos[1]; + } + } else if (e.touches[0]) { + var start = r.touchData.start; + var last = r.touchData.last; + var near; + + if (!r.hoverData.draggingEles && !r.swipePanning) { + near = r.findNearestElement(now[0], now[1], true, true); + } + + if (capture && start != null) { + e.preventDefault(); + } + + // dragging nodes + if (capture && start != null && r.nodeIsDraggable(start)) { + + if (isOverThresholdDrag) { + // then dragging can happen + var draggedEles = r.dragData.touchDragEles; + var justStartedDrag = !r.dragData.didDrag; + + if (justStartedDrag) { + addNodesToDrag(cy.collection(draggedEles), { inDragLayer: true }); + } + + for (var k = 0; k < draggedEles.length; k++) { + var draggedEle = draggedEles[k]; + + if (r.nodeIsDraggable(draggedEle) && draggedEle.grabbed()) { + r.dragData.didDrag = true; + var dPos = draggedEle.position(); + + if (is.number(disp[0]) && is.number(disp[1])) { + dPos.x += disp[0]; + dPos.y += disp[1]; + } + + if (justStartedDrag) { + r.redrawHint('eles', true); + + var dragDelta = r.touchData.dragDelta; + + if (dragDelta && is.number(dragDelta[0]) && is.number(dragDelta[1])) { + dPos.x += dragDelta[0]; + dPos.y += dragDelta[1]; + } + } + } + } + + var tcol = cy.collection(draggedEles); + + tcol.dirtyCompoundBoundsCache(); + tcol.emit('position drag'); + + r.hoverData.draggingEles = true; + + r.redrawHint('drag', true); + + if (r.touchData.startPosition[0] == earlier[0] && r.touchData.startPosition[1] == earlier[1]) { + + r.redrawHint('eles', true); + } + + r.redraw(); + } else { + // otherise keep track of drag delta for later + var dragDelta = r.touchData.dragDelta = r.touchData.dragDelta || []; + + if (dragDelta.length === 0) { + dragDelta.push(disp[0]); + dragDelta.push(disp[1]); + } else { + dragDelta[0] += disp[0]; + dragDelta[1] += disp[1]; + } + } + } + + // touchmove + { + triggerEvents(start || near, ['touchmove', 'tapdrag', 'vmousemove'], e, { + position: { x: now[0], y: now[1] } + }); + + if ((!start || !start.grabbed()) && near != last) { + if (last) { + last.emit({ originalEvent: e, type: 'tapdragout', position: { x: now[0], y: now[1] } }); + } + if (near) { + near.emit({ originalEvent: e, type: 'tapdragover', position: { x: now[0], y: now[1] } }); + } + } + + r.touchData.last = near; + } + + // check to cancel taphold + if (capture) { + for (var i = 0; i < now.length; i++) { + if (now[i] && r.touchData.startPosition[i] && isOverThresholdDrag) { + + r.touchData.singleTouchMoved = true; + } + } + } + + // panning + if (capture && (start == null || start.isEdge()) && cy.panningEnabled() && cy.userPanningEnabled()) { + + var allowPassthrough = allowPanningPassthrough(start, r.touchData.starts); + + if (allowPassthrough) { + e.preventDefault(); + + if (r.swipePanning) { + cy.panBy({ + x: disp[0] * zoom, + y: disp[1] * zoom + }); + } else if (isOverThresholdDrag) { + r.swipePanning = true; + + cy.panBy({ + x: dx * zoom, + y: dy * zoom + }); + + if (start) { + start.unactivate(); + + if (!r.data.bgActivePosistion) { + r.data.bgActivePosistion = math.array2point(r.touchData.startPosition); + } + + r.redrawHint('select', true); + + r.touchData.start = null; + } + } + } + + // Re-project + var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY); + now[0] = pos[0];now[1] = pos[1]; + } + } + + for (var j = 0; j < now.length; j++) { + earlier[j] = now[j]; + } + //r.redraw(); + + // the active bg indicator should be removed when making a swipe that is neither for dragging nodes or panning + if (capture && e.touches.length > 0 && !r.hoverData.draggingEles && !r.swipePanning && r.data.bgActivePosistion != null) { + r.data.bgActivePosistion = undefined; + r.redrawHint('select', true); + r.redraw(); + } + }, false); + var touchcancelHandler; + r.registerBinding(window, 'touchcancel', touchcancelHandler = function touchcancelHandler(e) { + // eslint-disable-line no-undef + var start = r.touchData.start; + + r.touchData.capture = false; + + if (start) { + start.unactivate(); + } + }); + + var touchendHandler; + r.registerBinding(window, 'touchend', touchendHandler = function touchendHandler(e) { + // eslint-disable-line no-undef + var start = r.touchData.start; + + var capture = r.touchData.capture; + + if (capture) { + if (e.touches.length === 0) { + r.touchData.capture = false; + } + + e.preventDefault(); + } else { + return; + } + + var select = r.selection; + + r.swipePanning = false; + r.hoverData.draggingEles = false; + + var cy = r.cy; + var zoom = cy.zoom(); + var now = r.touchData.now; + var earlier = r.touchData.earlier; + + if (e.touches[0]) { + var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);now[0] = pos[0];now[1] = pos[1]; + } + if (e.touches[1]) { + var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);now[2] = pos[0];now[3] = pos[1]; + } + if (e.touches[2]) { + var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);now[4] = pos[0];now[5] = pos[1]; + } + + if (start) { + start.unactivate(); + } + + var ctxTapend; + if (r.touchData.cxt) { + ctxTapend = { + originalEvent: e, + type: 'cxttapend', + position: { x: now[0], y: now[1] } + }; + + if (start) { + start.emit(ctxTapend); + } else { + cy.emit(ctxTapend); + } + + if (!r.touchData.cxtDragged) { + var ctxTap = { + originalEvent: e, + type: 'cxttap', + position: { x: now[0], y: now[1] } + }; + + if (start) { + start.emit(ctxTap); + } else { + cy.emit(ctxTap); + } + } + + if (r.touchData.start) { + r.touchData.start._private.grabbed = false; + } + r.touchData.cxt = false; + r.touchData.start = null; + + r.redraw(); + return; + } + + // no more box selection if we don't have three fingers + if (!e.touches[2] && cy.boxSelectionEnabled() && r.touchData.selecting) { + r.touchData.selecting = false; + + var box = cy.collection(r.getAllInBox(select[0], select[1], select[2], select[3])); + + select[0] = undefined; + select[1] = undefined; + select[2] = undefined; + select[3] = undefined; + select[4] = 0; + + r.redrawHint('select', true); + + cy.emit('boxend'); + + var eleWouldBeSelected = function eleWouldBeSelected(ele) { + return ele.selectable() && !ele.selected(); + }; + + box.emit('box').stdFilter(eleWouldBeSelected).select().emit('boxselect'); + + if (box.nonempty()) { + r.redrawHint('eles', true); + } + + r.redraw(); + } + + if (start != null) { + start.unactivate(); + } + + if (e.touches[2]) { + r.data.bgActivePosistion = undefined; + r.redrawHint('select', true); + } else if (e.touches[1]) { + // ignore + } else if (e.touches[0]) { + // ignore + + // Last touch released + } else if (!e.touches[0]) { + + r.data.bgActivePosistion = undefined; + r.redrawHint('select', true); + + var draggedEles = r.dragData.touchDragEles; + + if (start != null) { + + var startWasGrabbed = start._private.grabbed; + + freeDraggedElements(draggedEles); + + r.redrawHint('drag', true); + r.redrawHint('eles', true); + + if (startWasGrabbed) { + start.emit('free'); + } + + triggerEvents(start, ['touchend', 'tapend', 'vmouseup', 'tapdragout'], e, { + position: { x: now[0], y: now[1] } + }); + + start.unactivate(); + + r.touchData.start = null; + } else { + var near = r.findNearestElement(now[0], now[1], true, true); + + triggerEvents(near, ['touchend', 'tapend', 'vmouseup', 'tapdragout'], e, { + position: { x: now[0], y: now[1] } + }); + } + + var dx = r.touchData.startPosition[0] - now[0]; + var dx2 = dx * dx; + var dy = r.touchData.startPosition[1] - now[1]; + var dy2 = dy * dy; + var dist2 = dx2 + dy2; + var rdist2 = dist2 * zoom * zoom; + + // Prepare to select the currently touched node, only if it hasn't been dragged past a certain distance + if (start != null && !r.dragData.didDrag // didn't drag nodes around + && start._private.selectable && rdist2 < r.touchTapThreshold2 && !r.pinching // pinch to zoom should not affect selection + ) { + + if (cy.selectionType() === 'single') { + cy.$(':selected').unmerge(start).unselect(); + start.select(); + } else { + if (start.selected()) { + start.unselect(); + } else { + start.select(); + } + } + + r.redrawHint('eles', true); + } + + // Tap event, roughly same as mouse click event for touch + if (!r.touchData.singleTouchMoved) { + triggerEvents(start, ['tap', 'vclick'], e, { + position: { x: now[0], y: now[1] } + }); + } + + r.touchData.singleTouchMoved = true; + } + + for (var j = 0; j < now.length; j++) { + earlier[j] = now[j]; + } + + r.dragData.didDrag = false; // reset for next mousedown + + if (e.touches.length === 0) { + r.touchData.dragDelta = []; + r.touchData.startPosition = null; + r.touchData.startGPosition = null; + } + + if (e.touches.length < 2) { + r.pinching = false; + r.redrawHint('eles', true); + r.redraw(); + } + + //r.redraw(); + }, false); + + // fallback compatibility layer for ms pointer events + if (typeof TouchEvent === 'undefined') { + + var pointers = []; + + var makeTouch = function makeTouch(e) { + return { + clientX: e.clientX, + clientY: e.clientY, + force: 1, + identifier: e.pointerId, + pageX: e.pageX, + pageY: e.pageY, + radiusX: e.width / 2, + radiusY: e.height / 2, + screenX: e.screenX, + screenY: e.screenY, + target: e.target + }; + }; + + var makePointer = function makePointer(e) { + return { + event: e, + touch: makeTouch(e) + }; + }; + + var addPointer = function addPointer(e) { + pointers.push(makePointer(e)); + }; + + var removePointer = function removePointer(e) { + for (var i = 0; i < pointers.length; i++) { + var p = pointers[i]; + + if (p.event.pointerId === e.pointerId) { + pointers.splice(i, 1); + return; + } + } + }; + + var updatePointer = function updatePointer(e) { + var p = pointers.filter(function (p) { + return p.event.pointerId === e.pointerId; + })[0]; + + p.event = e; + p.touch = makeTouch(e); + }; + + var addTouchesToEvent = function addTouchesToEvent(e) { + e.touches = pointers.map(function (p) { + return p.touch; + }); + }; + + var pointerIsMouse = function pointerIsMouse(e) { + return e.pointerType === 'mouse' || e.pointerType === 4; + }; + + r.registerBinding(r.container, 'pointerdown', function (e) { + if (pointerIsMouse(e)) { + return; + } // mouse already handled + + e.preventDefault(); + + addPointer(e); + + addTouchesToEvent(e); + touchstartHandler(e); + }); + + r.registerBinding(r.container, 'pointerup', function (e) { + if (pointerIsMouse(e)) { + return; + } // mouse already handled + + removePointer(e); + + addTouchesToEvent(e); + touchendHandler(e); + }); + + r.registerBinding(r.container, 'pointercancel', function (e) { + if (pointerIsMouse(e)) { + return; + } // mouse already handled + + removePointer(e); + + addTouchesToEvent(e); + touchcancelHandler(e); + }); + + r.registerBinding(r.container, 'pointermove', function (e) { + if (pointerIsMouse(e)) { + return; + } // mouse already handled + + e.preventDefault(); + + updatePointer(e); + + addTouchesToEvent(e); + touchmoveHandler(e); + }); + } +}; + +module.exports = BRp; + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var math = __webpack_require__(2); + +var BRp = {}; + +BRp.generatePolygon = function (name, points) { + return this.nodeShapes[name] = { + renderer: this, + + name: name, + + points: points, + + draw: function draw(context, centerX, centerY, width, height) { + this.renderer.nodeShapeImpl('polygon', context, centerX, centerY, width, height, this.points); + }, + + intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { + return math.polygonIntersectLine(x, y, this.points, nodeX, nodeY, width / 2, height / 2, padding); + }, + + checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { + return math.pointInsidePolygon(x, y, this.points, centerX, centerY, width, height, [0, -1], padding); + } + }; +}; + +BRp.generateEllipse = function () { + return this.nodeShapes['ellipse'] = { + renderer: this, + + name: 'ellipse', + + draw: function draw(context, centerX, centerY, width, height) { + this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height); + }, + + intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { + return math.intersectLineEllipse(x, y, nodeX, nodeY, width / 2 + padding, height / 2 + padding); + }, + + checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { + return math.checkInEllipse(x, y, width, height, centerX, centerY, padding); + } + }; +}; + +BRp.generateRoundRectangle = function () { + return this.nodeShapes['roundrectangle'] = { + renderer: this, + + name: 'roundrectangle', + + points: math.generateUnitNgonPointsFitToSquare(4, 0), + + draw: function draw(context, centerX, centerY, width, height) { + this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height); + }, + + intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { + return math.roundRectangleIntersectLine(x, y, nodeX, nodeY, width, height, padding); + }, + + checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { + + var cornerRadius = math.getRoundRectangleRadius(width, height); + var diam = cornerRadius * 2; + + // Check hBox + if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - diam, [0, -1], padding)) { + return true; + } + + // Check vBox + if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width - diam, height, [0, -1], padding)) { + return true; + } + + // Check top left quarter circle + if (math.checkInEllipse(x, y, diam, diam, centerX - width / 2 + cornerRadius, centerY - height / 2 + cornerRadius, padding)) { + + return true; + } + + // Check top right quarter circle + if (math.checkInEllipse(x, y, diam, diam, centerX + width / 2 - cornerRadius, centerY - height / 2 + cornerRadius, padding)) { + + return true; + } + + // Check bottom right quarter circle + if (math.checkInEllipse(x, y, diam, diam, centerX + width / 2 - cornerRadius, centerY + height / 2 - cornerRadius, padding)) { + + return true; + } + + // Check bottom left quarter circle + if (math.checkInEllipse(x, y, diam, diam, centerX - width / 2 + cornerRadius, centerY + height / 2 - cornerRadius, padding)) { + + return true; + } + + return false; + } + }; +}; + +BRp.generateCutRectangle = function () { + return this.nodeShapes['cutrectangle'] = { + renderer: this, + + name: 'cutrectangle', + + cornerLength: math.getCutRectangleCornerLength(), + + points: math.generateUnitNgonPointsFitToSquare(4, 0), + + draw: function draw(context, centerX, centerY, width, height) { + this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height); + }, + + generateCutTrianglePts: function generateCutTrianglePts(width, height, centerX, centerY) { + var cl = this.cornerLength; + var hh = height / 2; + var hw = width / 2; + var xBegin = centerX - hw; + var xEnd = centerX + hw; + var yBegin = centerY - hh; + var yEnd = centerY + hh; + + // points are in clockwise order, inner (imaginary) triangle pt on [4, 5] + return { + topLeft: [xBegin, yBegin + cl, xBegin + cl, yBegin, xBegin + cl, yBegin + cl], + topRight: [xEnd - cl, yBegin, xEnd, yBegin + cl, xEnd - cl, yBegin + cl], + bottomRight: [xEnd, yEnd - cl, xEnd - cl, yEnd, xEnd - cl, yEnd - cl], + bottomLeft: [xBegin + cl, yEnd, xBegin, yEnd - cl, xBegin + cl, yEnd - cl] + }; + }, + + intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { + var cPts = this.generateCutTrianglePts(width + 2 * padding, height + 2 * padding, nodeX, nodeY); + var pts = [].concat.apply([], [cPts.topLeft.splice(0, 4), cPts.topRight.splice(0, 4), cPts.bottomRight.splice(0, 4), cPts.bottomLeft.splice(0, 4)]); + + return math.polygonIntersectLine(x, y, pts, nodeX, nodeY); + }, + + checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { + // Check hBox + if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - 2 * this.cornerLength, [0, -1], padding)) { + return true; + } + + // Check vBox + if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width - 2 * this.cornerLength, height, [0, -1], padding)) { + return true; + } + var cutTrianglePts = this.generateCutTrianglePts(width, height, centerX, centerY); + return math.pointInsidePolygonPoints(x, y, cutTrianglePts.topLeft) || math.pointInsidePolygonPoints(x, y, cutTrianglePts.topRight) || math.pointInsidePolygonPoints(x, y, cutTrianglePts.bottomRight) || math.pointInsidePolygonPoints(x, y, cutTrianglePts.bottomLeft); + } + + }; +}; + +BRp.generateBarrel = function () { + return this.nodeShapes['barrel'] = { + renderer: this, + + name: 'barrel', + + points: math.generateUnitNgonPointsFitToSquare(4, 0), + + draw: function draw(context, centerX, centerY, width, height) { + this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height); + }, + + intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { + // use two fixed t values for the bezier curve approximation + + var t0 = 0.15; + var t1 = 0.5; + var t2 = 0.85; + + var bPts = this.generateBarrelBezierPts(width + 2 * padding, height + 2 * padding, nodeX, nodeY); + + var approximateBarrelCurvePts = function approximateBarrelCurvePts(pts) { + // approximate curve pts based on the two t values + var m0 = math.qbezierPtAt({ x: pts[0], y: pts[1] }, { x: pts[2], y: pts[3] }, { x: pts[4], y: pts[5] }, t0); + var m1 = math.qbezierPtAt({ x: pts[0], y: pts[1] }, { x: pts[2], y: pts[3] }, { x: pts[4], y: pts[5] }, t1); + var m2 = math.qbezierPtAt({ x: pts[0], y: pts[1] }, { x: pts[2], y: pts[3] }, { x: pts[4], y: pts[5] }, t2); + + return [pts[0], pts[1], m0.x, m0.y, m1.x, m1.y, m2.x, m2.y, pts[4], pts[5]]; + }; + + var pts = [].concat(approximateBarrelCurvePts(bPts.topLeft), approximateBarrelCurvePts(bPts.topRight), approximateBarrelCurvePts(bPts.bottomRight), approximateBarrelCurvePts(bPts.bottomLeft)); + + return math.polygonIntersectLine(x, y, pts, nodeX, nodeY); + }, + + generateBarrelBezierPts: function generateBarrelBezierPts(width, height, centerX, centerY) { + var hh = height / 2; + var hw = width / 2; + var xBegin = centerX - hw; + var xEnd = centerX + hw; + var yBegin = centerY - hh; + var yEnd = centerY + hh; + + var curveConstants = math.getBarrelCurveConstants(width, height); + var hOffset = curveConstants.heightOffset; + var wOffset = curveConstants.widthOffset; + var ctrlPtXOffset = curveConstants.ctrlPtOffsetPct * width; + + // points are in clockwise order, inner (imaginary) control pt on [4, 5] + var pts = { + topLeft: [xBegin, yBegin + hOffset, xBegin + ctrlPtXOffset, yBegin, xBegin + wOffset, yBegin], + topRight: [xEnd - wOffset, yBegin, xEnd - ctrlPtXOffset, yBegin, xEnd, yBegin + hOffset], + bottomRight: [xEnd, yEnd - hOffset, xEnd - ctrlPtXOffset, yEnd, xEnd - wOffset, yEnd], + bottomLeft: [xBegin + wOffset, yEnd, xBegin + ctrlPtXOffset, yEnd, xBegin, yEnd - hOffset] + }; + + pts.topLeft.isTop = true; + pts.topRight.isTop = true; + pts.bottomLeft.isBottom = true; + pts.bottomRight.isBottom = true; + + return pts; + }, + + checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { + + var curveConstants = math.getBarrelCurveConstants(width, height); + var hOffset = curveConstants.heightOffset; + var wOffset = curveConstants.widthOffset; + + // Check hBox + if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - 2 * hOffset, [0, -1], padding)) { + return true; + } + + // Check vBox + if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width - 2 * wOffset, height, [0, -1], padding)) { + return true; + } + + var barrelCurvePts = this.generateBarrelBezierPts(width, height, centerX, centerY); + + var getCurveT = function getCurveT(x, y, curvePts) { + var x0 = curvePts[4]; + var x1 = curvePts[2]; + var x2 = curvePts[0]; + var y0 = curvePts[5]; + // var y1 = curvePts[ 3 ]; + var y2 = curvePts[1]; + + var xMin = Math.min(x0, x2); + var xMax = Math.max(x0, x2); + var yMin = Math.min(y0, y2); + var yMax = Math.max(y0, y2); + + if (xMin <= x && x <= xMax && yMin <= y && y <= yMax) { + var coeff = math.bezierPtsToQuadCoeff(x0, x1, x2); + var roots = math.solveQuadratic(coeff[0], coeff[1], coeff[2], x); + + var validRoots = roots.filter(function (r) { + return 0 <= r && r <= 1; + }); + + if (validRoots.length > 0) { + return validRoots[0]; + } + } + return null; + }; + + var curveRegions = Object.keys(barrelCurvePts); + for (var i = 0; i < curveRegions.length; i++) { + var corner = curveRegions[i]; + var cornerPts = barrelCurvePts[corner]; + var t = getCurveT(x, y, cornerPts); + + if (t == null) { + continue; + } + + var y0 = cornerPts[5]; + var y1 = cornerPts[3]; + var y2 = cornerPts[1]; + var bezY = math.qbezierAt(y0, y1, y2, t); + + if (cornerPts.isTop && bezY <= y) { + return true; + } + if (cornerPts.isBottom && y <= bezY) { + return true; + } + } + return false; + } + }; +}; + +BRp.generateBottomRoundrectangle = function () { + return this.nodeShapes['bottomroundrectangle'] = { + renderer: this, + + name: 'bottomroundrectangle', + + points: math.generateUnitNgonPointsFitToSquare(4, 0), + + draw: function draw(context, centerX, centerY, width, height) { + this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height); + }, + + intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { + var topStartX = nodeX - (width / 2 + padding); + var topStartY = nodeY - (height / 2 + padding); + var topEndY = topStartY; + var topEndX = nodeX + (width / 2 + padding); + + var topIntersections = math.finiteLinesIntersect(x, y, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false); + if (topIntersections.length > 0) { + return topIntersections; + } + + return math.roundRectangleIntersectLine(x, y, nodeX, nodeY, width, height, padding); + }, + + checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { + + var cornerRadius = math.getRoundRectangleRadius(width, height); + var diam = 2 * cornerRadius; + + // Check hBox + if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - diam, [0, -1], padding)) { + return true; + } + + // Check vBox + if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width - diam, height, [0, -1], padding)) { + return true; + } + + // check non-rounded top side + var outerWidth = width / 2 + 2 * padding; + var outerHeight = height / 2 + 2 * padding; + var points = [centerX - outerWidth, centerY - outerHeight, centerX - outerWidth, centerY, centerX + outerWidth, centerY, centerX + outerWidth, centerY - outerHeight]; + if (math.pointInsidePolygonPoints(x, y, points)) { + return true; + } + + // Check bottom right quarter circle + if (math.checkInEllipse(x, y, diam, diam, centerX + width / 2 - cornerRadius, centerY + height / 2 - cornerRadius, padding)) { + + return true; + } + + // Check bottom left quarter circle + if (math.checkInEllipse(x, y, diam, diam, centerX - width / 2 + cornerRadius, centerY + height / 2 - cornerRadius, padding)) { + + return true; + } + + return false; + } + }; +}; + +BRp.registerNodeShapes = function () { + var nodeShapes = this.nodeShapes = {}; + var renderer = this; + + this.generateEllipse(); + + this.generatePolygon('triangle', math.generateUnitNgonPointsFitToSquare(3, 0)); + + this.generatePolygon('rectangle', math.generateUnitNgonPointsFitToSquare(4, 0)); + nodeShapes['square'] = nodeShapes['rectangle']; + + this.generateRoundRectangle(); + + this.generateCutRectangle(); + + this.generateBarrel(); + + this.generateBottomRoundrectangle(); + + this.generatePolygon('diamond', [0, 1, 1, 0, 0, -1, -1, 0]); + + this.generatePolygon('pentagon', math.generateUnitNgonPointsFitToSquare(5, 0)); + + this.generatePolygon('hexagon', math.generateUnitNgonPointsFitToSquare(6, 0)); + + this.generatePolygon('heptagon', math.generateUnitNgonPointsFitToSquare(7, 0)); + + this.generatePolygon('octagon', math.generateUnitNgonPointsFitToSquare(8, 0)); + + var star5Points = new Array(20); + { + var outerPoints = math.generateUnitNgonPoints(5, 0); + var innerPoints = math.generateUnitNgonPoints(5, Math.PI / 5); + + // Outer radius is 1; inner radius of star is smaller + var innerRadius = 0.5 * (3 - Math.sqrt(5)); + innerRadius *= 1.57; + + for (var i = 0; i < innerPoints.length / 2; i++) { + innerPoints[i * 2] *= innerRadius; + innerPoints[i * 2 + 1] *= innerRadius; + } + + for (var i = 0; i < 20 / 4; i++) { + star5Points[i * 4] = outerPoints[i * 2]; + star5Points[i * 4 + 1] = outerPoints[i * 2 + 1]; + + star5Points[i * 4 + 2] = innerPoints[i * 2]; + star5Points[i * 4 + 3] = innerPoints[i * 2 + 1]; + } + } + + star5Points = math.fitPolygonToSquare(star5Points); + + this.generatePolygon('star', star5Points); + + this.generatePolygon('vee', [-1, -1, 0, -0.333, 1, -1, 0, 1]); + + this.generatePolygon('rhomboid', [-1, -1, 0.333, -1, 1, 1, -0.333, 1]); + + this.generatePolygon('concavehexagon', [-1, -0.95, -0.75, 0, -1, 0.95, 1, 0.95, 0.75, 0, 1, -0.95]); + + this.generatePolygon('tag', [-1, -1, 0.25, -1, 1, 0, 0.25, 1, -1, 1]); + + nodeShapes.makePolygon = function (points) { + + // use caching on user-specified polygons so they are as fast as native shapes + + var key = points.join('$'); + var name = 'polygon-' + key; + var shape; + + if (shape = this[name]) { + // got cached shape + return shape; + } + + // create and cache new shape + return renderer.generatePolygon(name, points); + }; +}; + +module.exports = BRp; + +/***/ }), +/* 123 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); + +var BRp = {}; + +BRp.timeToRender = function () { + return this.redrawTotalTime / this.redrawCount; +}; + +BRp.redraw = function (options) { + options = options || util.staticEmptyObject(); + + var r = this; + + if (r.averageRedrawTime === undefined) { + r.averageRedrawTime = 0; + } + if (r.lastRedrawTime === undefined) { + r.lastRedrawTime = 0; + } + if (r.lastDrawTime === undefined) { + r.lastDrawTime = 0; + } + + r.requestedFrame = true; + r.renderOptions = options; +}; + +BRp.beforeRender = function (fn, priority) { + // the renderer can't add tick callbacks when destroyed + if (this.destroyed) { + return; + } + + priority = priority || 0; + + var cbs = this.beforeRenderCallbacks; + + cbs.push({ fn: fn, priority: priority }); + + // higher priority callbacks executed first + cbs.sort(function (a, b) { + return b.priority - a.priority; + }); +}; + +var beforeRenderCallbacks = function beforeRenderCallbacks(r, willDraw, startTime) { + var cbs = r.beforeRenderCallbacks; + + for (var i = 0; i < cbs.length; i++) { + cbs[i].fn(willDraw, startTime); + } +}; + +BRp.startRenderLoop = function () { + var r = this; + + if (r.renderLoopStarted) { + return; + } else { + r.renderLoopStarted = true; + } + + var renderFn = function renderFn(requestTime) { + if (r.destroyed) { + return; + } + + if (r.requestedFrame && !r.skipFrame) { + beforeRenderCallbacks(r, true, requestTime); + + var startTime = util.performanceNow(); + + r.render(r.renderOptions); + + var endTime = r.lastDrawTime = util.performanceNow(); + + if (r.averageRedrawTime === undefined) { + r.averageRedrawTime = endTime - startTime; + } + + if (r.redrawCount === undefined) { + r.redrawCount = 0; + } + + r.redrawCount++; + + if (r.redrawTotalTime === undefined) { + r.redrawTotalTime = 0; + } + + var duration = endTime - startTime; + + r.redrawTotalTime += duration; + r.lastRedrawTime = duration; + + // use a weighted average with a bias from the previous average so we don't spike so easily + r.averageRedrawTime = r.averageRedrawTime / 2 + duration / 2; + + r.requestedFrame = false; + } else { + beforeRenderCallbacks(r, false, requestTime); + } + + r.skipFrame = false; + + util.requestAnimationFrame(renderFn); + }; + + util.requestAnimationFrame(renderFn); +}; + +module.exports = BRp; + +/***/ }), +/* 124 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* +The canvas renderer was written by Yue Dong. + +Modifications tracked on Github. +*/ + +var util = __webpack_require__(1); +var is = __webpack_require__(0); +var ElementTextureCache = __webpack_require__(125); +var LayeredTextureCache = __webpack_require__(126); + +var CR = CanvasRenderer; +var CRp = CanvasRenderer.prototype; + +CRp.CANVAS_LAYERS = 3; +// +CRp.SELECT_BOX = 0; +CRp.DRAG = 1; +CRp.NODE = 2; + +CRp.BUFFER_COUNT = 3; +// +CRp.TEXTURE_BUFFER = 0; +CRp.MOTIONBLUR_BUFFER_NODE = 1; +CRp.MOTIONBLUR_BUFFER_DRAG = 2; + +function CanvasRenderer(options) { + var r = this; + + r.data = { + canvases: new Array(CRp.CANVAS_LAYERS), + contexts: new Array(CRp.CANVAS_LAYERS), + canvasNeedsRedraw: new Array(CRp.CANVAS_LAYERS), + + bufferCanvases: new Array(CRp.BUFFER_COUNT), + bufferContexts: new Array(CRp.CANVAS_LAYERS) + }; + + var tapHlOff = '-webkit-tap-highlight-color: rgba(0,0,0,0);'; + + r.data.canvasContainer = document.createElement('div'); // eslint-disable-line no-undef + var containerStyle = r.data.canvasContainer.style; + r.data.canvasContainer.setAttribute('style', tapHlOff); + containerStyle.position = 'relative'; + containerStyle.zIndex = '0'; + containerStyle.overflow = 'hidden'; + + var container = options.cy.container(); + container.appendChild(r.data.canvasContainer); + + if ((container.getAttribute('style') || '').indexOf(tapHlOff) < 0) { + container.setAttribute('style', (container.getAttribute('style') || '') + tapHlOff); + } + + for (var i = 0; i < CRp.CANVAS_LAYERS; i++) { + var canvas = r.data.canvases[i] = document.createElement('canvas'); // eslint-disable-line no-undef + r.data.contexts[i] = canvas.getContext('2d'); + canvas.setAttribute('style', '-webkit-user-select: none; -moz-user-select: -moz-none; user-select: none; -webkit-tap-highlight-color: rgba(0,0,0,0); outline-style: none;' + (is.ms() ? ' -ms-touch-action: none; touch-action: none; ' : '')); + canvas.style.position = 'absolute'; + canvas.setAttribute('data-id', 'layer' + i); + canvas.style.zIndex = String(CRp.CANVAS_LAYERS - i); + r.data.canvasContainer.appendChild(canvas); + + r.data.canvasNeedsRedraw[i] = false; + } + r.data.topCanvas = r.data.canvases[0]; + + r.data.canvases[CRp.NODE].setAttribute('data-id', 'layer' + CRp.NODE + '-node'); + r.data.canvases[CRp.SELECT_BOX].setAttribute('data-id', 'layer' + CRp.SELECT_BOX + '-selectbox'); + r.data.canvases[CRp.DRAG].setAttribute('data-id', 'layer' + CRp.DRAG + '-drag'); + + for (var i = 0; i < CRp.BUFFER_COUNT; i++) { + r.data.bufferCanvases[i] = document.createElement('canvas'); // eslint-disable-line no-undef + r.data.bufferContexts[i] = r.data.bufferCanvases[i].getContext('2d'); + r.data.bufferCanvases[i].style.position = 'absolute'; + r.data.bufferCanvases[i].setAttribute('data-id', 'buffer' + i); + r.data.bufferCanvases[i].style.zIndex = String(-i - 1); + r.data.bufferCanvases[i].style.visibility = 'hidden'; + //r.data.canvasContainer.appendChild(r.data.bufferCanvases[i]); + } + + r.pathsEnabled = true; + + r.data.eleTxrCache = new ElementTextureCache(r); + r.data.lyrTxrCache = new LayeredTextureCache(r, r.data.eleTxrCache); + + r.onUpdateEleCalcs(function invalidateTextureCaches(willDraw, eles) { + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + var rs = ele._private.rstyle; + var de = rs.dirtyEvents; + + if (ele.isNode() && de && de.length === 1 && de['position']) { + // then keep cached ele texture + } else { + r.data.eleTxrCache.invalidateElement(ele); + + // NB this block of code should not be ported to 3.3 (unstable branch). + // - This check is unneccesary in 3.3 as caches will be stored without respect to opacity. + // - This fix may result in lowered performance for compound graphs. + // - Ref : Opacity of child node is not updated for certain zoom levels after parent opacity is overriden #2078 + if (ele.isParent() && de['style']) { + var op1 = rs.prevParentOpacity; + var op2 = ele.pstyle('opacity').pfValue; + + rs.prevParentOpacity = op2; + + if (op1 !== op2) { + var descs = ele.descendants(); + + for (var j = 0; j < descs.length; j++) { + r.data.eleTxrCache.invalidateElement(descs[j]); + } + } + } + } + } + + if (eles.length > 0) { + r.data.lyrTxrCache.invalidateElements(eles); + } + }); +} + +CRp.redrawHint = function (group, bool) { + var r = this; + + switch (group) { + case 'eles': + r.data.canvasNeedsRedraw[CRp.NODE] = bool; + break; + case 'drag': + r.data.canvasNeedsRedraw[CRp.DRAG] = bool; + break; + case 'select': + r.data.canvasNeedsRedraw[CRp.SELECT_BOX] = bool; + break; + } +}; + +// whether to use Path2D caching for drawing +var pathsImpld = typeof Path2D !== 'undefined'; + +CRp.path2dEnabled = function (on) { + if (on === undefined) { + return this.pathsEnabled; + } + + this.pathsEnabled = on ? true : false; +}; + +CRp.usePaths = function () { + return pathsImpld && this.pathsEnabled; +}; + +[__webpack_require__(127), __webpack_require__(128), __webpack_require__(129), __webpack_require__(130), __webpack_require__(131), __webpack_require__(132), __webpack_require__(133), __webpack_require__(134), __webpack_require__(135), __webpack_require__(136)].forEach(function (props) { + util.extend(CRp, props); +}); + +module.exports = CR; + +/***/ }), +/* 125 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var math = __webpack_require__(2); +var util = __webpack_require__(1); +var Heap = __webpack_require__(9); +var defs = __webpack_require__(19); + +var minTxrH = 25; // the size of the texture cache for small height eles (special case) +var txrStepH = 50; // the min size of the regular cache, and the size it increases with each step up +var minLvl = -4; // when scaling smaller than that we don't need to re-render +var maxLvl = 2; // when larger than this scale just render directly (caching is not helpful) +var maxZoom = 3.99; // beyond this zoom level, layered textures are not used +var eleTxrSpacing = 8; // spacing between elements on textures to avoid blitting overlaps +var defTxrWidth = 1024; // default/minimum texture width +var maxTxrW = 1024; // the maximum width of a texture +var maxTxrH = 1024; // the maximum height of a texture +var minUtility = 0.5; // if usage of texture is less than this, it is retired +var maxFullness = 0.8; // fullness of texture after which queue removal is checked +var maxFullnessChecks = 10; // dequeued after this many checks +var allowEdgeTxrCaching = false; // whether edges can be cached as textures (TODO maybe better on if webgl supported?) +var allowParentTxrCaching = false; // whether parent nodes can be cached as textures (TODO maybe better on if webgl supported?) +var deqCost = 0.15; // % of add'l rendering cost allowed for dequeuing ele caches each frame +var deqAvgCost = 0.1; // % of add'l rendering cost compared to average overall redraw time +var deqNoDrawCost = 0.9; // % of avg frame time that can be used for dequeueing when not drawing +var deqFastCost = 0.9; // % of frame time to be used when >60fps +var deqRedrawThreshold = 100; // time to batch redraws together from dequeueing to allow more dequeueing calcs to happen in the meanwhile +var maxDeqSize = 1; // number of eles to dequeue and render at higher texture in each batch + +var getTxrReasons = { + dequeue: 'dequeue', + downscale: 'downscale', + highQuality: 'highQuality' +}; + +var ElementTextureCache = function ElementTextureCache(renderer) { + var self = this; + + self.renderer = renderer; + self.onDequeues = []; + + self.setupDequeueing(); +}; + +var ETCp = ElementTextureCache.prototype; + +ETCp.reasons = getTxrReasons; + +// the list of textures in which new subtextures for elements can be placed +ETCp.getTextureQueue = function (txrH) { + var self = this; + self.eleImgCaches = self.eleImgCaches || {}; + + return self.eleImgCaches[txrH] = self.eleImgCaches[txrH] || []; +}; + +// the list of usused textures which can be recycled (in use in texture queue) +ETCp.getRetiredTextureQueue = function (txrH) { + var self = this; + + var rtxtrQs = self.eleImgCaches.retired = self.eleImgCaches.retired || {}; + var rtxtrQ = rtxtrQs[txrH] = rtxtrQs[txrH] || []; + + return rtxtrQ; +}; + +// queue of element draw requests at different scale levels +ETCp.getElementQueue = function () { + var self = this; + + var q = self.eleCacheQueue = self.eleCacheQueue || new Heap(function (a, b) { + return b.reqs - a.reqs; + }); + + return q; +}; + +// queue of element draw requests at different scale levels (element id lookup) +ETCp.getElementIdToQueue = function () { + var self = this; + + var id2q = self.eleIdToCacheQueue = self.eleIdToCacheQueue || {}; + + return id2q; +}; + +ETCp.getElement = function (ele, bb, pxRatio, lvl, reason) { + var self = this; + var r = this.renderer; + var rs = ele._private.rscratch; + var zoom = r.cy.zoom(); + + if (bb.w === 0 || bb.h === 0 || !ele.visible()) { + return null; + } + + if (lvl == null) { + lvl = Math.ceil(math.log2(zoom * pxRatio)); + } + + if (lvl < minLvl) { + lvl = minLvl; + } else if (zoom >= maxZoom || lvl > maxLvl) { + return null; + } + + var scale = Math.pow(2, lvl); + var eleScaledH = bb.h * scale; + var eleScaledW = bb.w * scale; + var caches = rs.imgCaches = rs.imgCaches || {}; + var eleCache = caches[lvl]; + + if (eleCache) { + return eleCache; + } + + var txrH; // which texture height this ele belongs to + + if (eleScaledH <= minTxrH) { + txrH = minTxrH; + } else if (eleScaledH <= txrStepH) { + txrH = txrStepH; + } else { + txrH = Math.ceil(eleScaledH / txrStepH) * txrStepH; + } + + if (eleScaledH > maxTxrH || eleScaledW > maxTxrW || !allowEdgeTxrCaching && ele.isEdge() || !allowParentTxrCaching && ele.isParent()) { + return null; // caching large elements is not efficient + } + + var txrQ = self.getTextureQueue(txrH); + + // first try the second last one in case it has space at the end + var txr = txrQ[txrQ.length - 2]; + + var addNewTxr = function addNewTxr() { + return self.recycleTexture(txrH, eleScaledW) || self.addTexture(txrH, eleScaledW); + }; + + // try the last one if there is no second last one + if (!txr) { + txr = txrQ[txrQ.length - 1]; + } + + // if the last one doesn't exist, we need a first one + if (!txr) { + txr = addNewTxr(); + } + + // if there's no room in the current texture, we need a new one + if (txr.width - txr.usedWidth < eleScaledW) { + txr = addNewTxr(); + } + + var scaledLabelShown = r.eleTextBiggerThanMin(ele, scale); + var scalableFrom = function scalableFrom(otherCache) { + return otherCache && otherCache.scaledLabelShown === scaledLabelShown; + }; + + var deqing = reason && reason === getTxrReasons.dequeue; + var highQualityReq = reason && reason === getTxrReasons.highQuality; + var downscaleReq = reason && reason === getTxrReasons.downscale; + + var higherCache; // the nearest cache with a higher level + for (var l = lvl + 1; l <= maxLvl; l++) { + var c = caches[l]; + + if (c) { + higherCache = c;break; + } + } + + var oneUpCache = higherCache && higherCache.level === lvl + 1 ? higherCache : null; + + var downscale = function downscale() { + txr.context.drawImage(oneUpCache.texture.canvas, oneUpCache.x, 0, oneUpCache.width, oneUpCache.height, txr.usedWidth, 0, eleScaledW, eleScaledH); + }; + + // reset ele area in texture + txr.context.setTransform(1, 0, 0, 1, 0, 0); + txr.context.clearRect(txr.usedWidth, 0, eleScaledW, txrH); + + if (scalableFrom(oneUpCache)) { + // then we can relatively cheaply rescale the existing image w/o rerendering + downscale(); + } else if (scalableFrom(higherCache)) { + // then use the higher cache for now and queue the next level down + // to cheaply scale towards the smaller level + + if (highQualityReq) { + for (var l = higherCache.level; l > lvl; l--) { + oneUpCache = self.getElement(ele, bb, pxRatio, l, getTxrReasons.downscale); + } + + downscale(); + } else { + self.queueElement(ele, higherCache.level - 1); + + return higherCache; + } + } else { + + var lowerCache; // the nearest cache with a lower level + if (!deqing && !highQualityReq && !downscaleReq) { + for (var l = lvl - 1; l >= minLvl; l--) { + var c = caches[l]; + + if (c) { + lowerCache = c;break; + } + } + } + + if (scalableFrom(lowerCache)) { + // then use the lower quality cache for now and queue the better one for later + + self.queueElement(ele, lvl); + + return lowerCache; + } + + txr.context.translate(txr.usedWidth, 0); + txr.context.scale(scale, scale); + + r.drawElement(txr.context, ele, bb, scaledLabelShown); + + txr.context.scale(1 / scale, 1 / scale); + txr.context.translate(-txr.usedWidth, 0); + } + + eleCache = caches[lvl] = { + ele: ele, + x: txr.usedWidth, + texture: txr, + level: lvl, + scale: scale, + width: eleScaledW, + height: eleScaledH, + scaledLabelShown: scaledLabelShown + }; + + txr.usedWidth += Math.ceil(eleScaledW + eleTxrSpacing); + + txr.eleCaches.push(eleCache); + + self.checkTextureFullness(txr); + + return eleCache; +}; + +ETCp.invalidateElement = function (ele) { + var self = this; + var caches = ele._private.rscratch.imgCaches; + + if (caches) { + for (var lvl = minLvl; lvl <= maxLvl; lvl++) { + var cache = caches[lvl]; + + if (cache) { + var txr = cache.texture; + + // remove space from the texture it belongs to + txr.invalidatedWidth += cache.width; + + // remove refs with the element + caches[lvl] = null; + util.removeFromArray(txr.eleCaches, cache); + + // remove from queue since the old req was for the old state + self.removeFromQueue(ele); + + // might have to remove the entire texture if it's not efficiently using its space + self.checkTextureUtility(txr); + } + } + } +}; + +ETCp.checkTextureUtility = function (txr) { + // invalidate all entries in the cache if the cache size is small + if (txr.invalidatedWidth >= minUtility * txr.width) { + this.retireTexture(txr); + } +}; + +ETCp.checkTextureFullness = function (txr) { + // if texture has been mostly filled and passed over several times, remove + // it from the queue so we don't need to waste time looking at it to put new things + + var self = this; + var txrQ = self.getTextureQueue(txr.height); + + if (txr.usedWidth / txr.width > maxFullness && txr.fullnessChecks >= maxFullnessChecks) { + util.removeFromArray(txrQ, txr); + } else { + txr.fullnessChecks++; + } +}; + +ETCp.retireTexture = function (txr) { + var self = this; + var txrH = txr.height; + var txrQ = self.getTextureQueue(txrH); + + // retire the texture from the active / searchable queue: + + util.removeFromArray(txrQ, txr); + + txr.retired = true; + + // remove the refs from the eles to the caches: + + var eleCaches = txr.eleCaches; + + for (var i = 0; i < eleCaches.length; i++) { + var eleCache = eleCaches[i]; + var ele = eleCache.ele; + var lvl = eleCache.level; + var imgCaches = ele._private.rscratch.imgCaches; + + if (imgCaches) { + imgCaches[lvl] = null; + } + } + + util.clearArray(eleCaches); + + // add the texture to a retired queue so it can be recycled in future: + + var rtxtrQ = self.getRetiredTextureQueue(txrH); + + rtxtrQ.push(txr); +}; + +ETCp.addTexture = function (txrH, minW) { + var self = this; + var txrQ = self.getTextureQueue(txrH); + var txr = {}; + + txrQ.push(txr); + + txr.eleCaches = []; + + txr.height = txrH; + txr.width = Math.max(defTxrWidth, minW); + txr.usedWidth = 0; + txr.invalidatedWidth = 0; + txr.fullnessChecks = 0; + + txr.canvas = document.createElement('canvas'); // eslint-disable-line no-undef + txr.canvas.width = txr.width; + txr.canvas.height = txr.height; + + txr.context = txr.canvas.getContext('2d'); + + return txr; +}; + +ETCp.recycleTexture = function (txrH, minW) { + var self = this; + var txrQ = self.getTextureQueue(txrH); + var rtxtrQ = self.getRetiredTextureQueue(txrH); + + for (var i = 0; i < rtxtrQ.length; i++) { + var txr = rtxtrQ[i]; + + if (txr.width >= minW) { + txr.retired = false; + + txr.usedWidth = 0; + txr.invalidatedWidth = 0; + txr.fullnessChecks = 0; + + util.clearArray(txr.eleCaches); + + txr.context.setTransform(1, 0, 0, 1, 0, 0); + txr.context.clearRect(0, 0, txr.width, txr.height); + + util.removeFromArray(rtxtrQ, txr); + txrQ.push(txr); + + return txr; + } + } +}; + +ETCp.queueElement = function (ele, lvl) { + var self = this; + var q = self.getElementQueue(); + var id2q = self.getElementIdToQueue(); + var id = ele.id(); + var existingReq = id2q[id]; + + if (existingReq) { + // use the max lvl b/c in between lvls are cheap to make + existingReq.level = Math.max(existingReq.level, lvl); + existingReq.reqs++; + + q.updateItem(existingReq); + } else { + var req = { + ele: ele, + level: lvl, + reqs: 1 + }; + + q.push(req); + + id2q[id] = req; + } +}; + +ETCp.dequeue = function (pxRatio /*, extent*/) { + var self = this; + var q = self.getElementQueue(); + var id2q = self.getElementIdToQueue(); + var dequeued = []; + + for (var i = 0; i < maxDeqSize; i++) { + if (q.size() > 0) { + var req = q.pop(); + var ele = req.ele; + var caches = ele._private.rscratch.imgCaches; + + // dequeueing isn't necessary when an existing cache exists + if (caches[req.level] != null) { + continue; + } + + id2q[ele.id()] = null; + + dequeued.push(req); + + var bb = ele.boundingBox(); + + self.getElement(ele, bb, pxRatio, req.level, getTxrReasons.dequeue); + } else { + break; + } + } + + return dequeued; +}; + +ETCp.removeFromQueue = function (ele) { + var self = this; + var q = self.getElementQueue(); + var id2q = self.getElementIdToQueue(); + var req = id2q[ele.id()]; + + if (req != null) { + // bring to front of queue + req.reqs = util.MAX_INT; + q.updateItem(req); + + q.pop(); // remove from queue + + id2q[ele.id()] = null; // remove from lookup map + } +}; + +ETCp.onDequeue = function (fn) { + this.onDequeues.push(fn); +}; +ETCp.offDequeue = function (fn) { + util.removeFromArray(this.onDequeues, fn); +}; + +ETCp.setupDequeueing = defs.setupDequeueing({ + deqRedrawThreshold: deqRedrawThreshold, + deqCost: deqCost, + deqAvgCost: deqAvgCost, + deqNoDrawCost: deqNoDrawCost, + deqFastCost: deqFastCost, + deq: function deq(self, pxRatio, extent) { + return self.dequeue(pxRatio, extent); + }, + onDeqd: function onDeqd(self, deqd) { + for (var i = 0; i < self.onDequeues.length; i++) { + var fn = self.onDequeues[i]; + + fn(deqd); + } + }, + shouldRedraw: function shouldRedraw(self, deqd, pxRatio, extent) { + for (var i = 0; i < deqd.length; i++) { + var bb = deqd[i].ele.boundingBox(); + + if (math.boundingBoxesIntersect(bb, extent)) { + return true; + } + } + + return false; + }, + priority: function priority(self) { + return self.renderer.beforeRenderPriorities.eleTxrDeq; + } +}); + +module.exports = ElementTextureCache; + +/***/ }), +/* 126 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var math = __webpack_require__(2); +var Heap = __webpack_require__(9); +var is = __webpack_require__(0); +var defs = __webpack_require__(19); + +var defNumLayers = 1; // default number of layers to use +var minLvl = -4; // when scaling smaller than that we don't need to re-render +var maxLvl = 2; // when larger than this scale just render directly (caching is not helpful) +var maxZoom = 3.99; // beyond this zoom level, layered textures are not used +var deqRedrawThreshold = 50; // time to batch redraws together from dequeueing to allow more dequeueing calcs to happen in the meanwhile +var refineEleDebounceTime = 50; // time to debounce sharper ele texture updates +var disableEleImgSmoothing = true; // when drawing eles on layers from an ele cache ; crisper and more performant when true +var deqCost = 0.15; // % of add'l rendering cost allowed for dequeuing ele caches each frame +var deqAvgCost = 0.1; // % of add'l rendering cost compared to average overall redraw time +var deqNoDrawCost = 0.9; // % of avg frame time that can be used for dequeueing when not drawing +var deqFastCost = 0.9; // % of frame time to be used when >60fps +var maxDeqSize = 1; // number of eles to dequeue and render at higher texture in each batch +var invalidThreshold = 250; // time threshold for disabling b/c of invalidations +var maxLayerArea = 4000 * 4000; // layers can't be bigger than this +var alwaysQueue = true; // never draw all the layers in a level on a frame; draw directly until all dequeued +var useHighQualityEleTxrReqs = true; // whether to use high quality ele txr requests (generally faster and cheaper in the longterm) + +var useEleTxrCaching = true; // whether to use individual ele texture caching underneath this cache + +// var log = function(){ console.log.apply( console, arguments ); }; + +var LayeredTextureCache = function LayeredTextureCache(renderer, eleTxrCache) { + var self = this; + + var r = self.renderer = renderer; + + self.layersByLevel = {}; // e.g. 2 => [ layer1, layer2, ..., layerN ] + + self.firstGet = true; + + self.lastInvalidationTime = util.performanceNow() - 2 * invalidThreshold; + + self.skipping = false; + + r.beforeRender(function (willDraw, now) { + if (now - self.lastInvalidationTime <= invalidThreshold) { + self.skipping = true; + } else { + self.skipping = false; + } + }); + + var qSort = function qSort(a, b) { + return b.reqs - a.reqs; + }; + + self.layersQueue = new Heap(qSort); + + self.eleTxrCache = eleTxrCache; + + self.setupEleCacheInvalidation(); + + self.setupDequeueing(); +}; + +var LTCp = LayeredTextureCache.prototype; + +var layerIdPool = 0; +var MAX_INT = Math.pow(2, 53) - 1; + +LTCp.makeLayer = function (bb, lvl) { + var scale = Math.pow(2, lvl); + + var w = Math.ceil(bb.w * scale); + var h = Math.ceil(bb.h * scale); + + var canvas = document.createElement('canvas'); // eslint-disable-line no-undef + + canvas.width = w; + canvas.height = h; + + var layer = { + id: layerIdPool = ++layerIdPool % MAX_INT, + bb: bb, + level: lvl, + width: w, + height: h, + canvas: canvas, + context: canvas.getContext('2d'), + eles: [], + elesQueue: [], + reqs: 0 + }; + + // log('make layer %s with w %s and h %s and lvl %s', layer.id, layer.width, layer.height, layer.level); + + var cxt = layer.context; + var dx = -layer.bb.x1; + var dy = -layer.bb.y1; + + // do the transform on creation to save cycles (it's the same for all eles) + cxt.scale(scale, scale); + cxt.translate(dx, dy); + + return layer; +}; + +LTCp.getLayers = function (eles, pxRatio, lvl) { + var self = this; + var r = self.renderer; + var cy = r.cy; + var zoom = cy.zoom(); + var firstGet = self.firstGet; + + self.firstGet = false; + + // log('--\nget layers with %s eles', eles.length); + //log eles.map(function(ele){ return ele.id() }) ); + + if (lvl == null) { + lvl = Math.ceil(math.log2(zoom * pxRatio)); + + if (lvl < minLvl) { + lvl = minLvl; + } else if (zoom >= maxZoom || lvl > maxLvl) { + return null; + } + } + + self.validateLayersElesOrdering(lvl, eles); + + var layersByLvl = self.layersByLevel; + var scale = Math.pow(2, lvl); + var layers = layersByLvl[lvl] = layersByLvl[lvl] || []; + var bb; + + var lvlComplete = self.levelIsComplete(lvl, eles); + var tmpLayers; + + var checkTempLevels = function checkTempLevels() { + var canUseAsTmpLvl = function canUseAsTmpLvl(l) { + self.validateLayersElesOrdering(l, eles); + + if (self.levelIsComplete(l, eles)) { + tmpLayers = layersByLvl[l]; + return true; + } + }; + + var checkLvls = function checkLvls(dir) { + if (tmpLayers) { + return; + } + + for (var l = lvl + dir; minLvl <= l && l <= maxLvl; l += dir) { + if (canUseAsTmpLvl(l)) { + break; + } + } + }; + + checkLvls(+1); + checkLvls(-1); + + // remove the invalid layers; they will be replaced as needed later in this function + for (var i = layers.length - 1; i >= 0; i--) { + var layer = layers[i]; + + if (layer.invalid) { + util.removeFromArray(layers, layer); + } + } + }; + + if (!lvlComplete) { + // if the current level is incomplete, then use the closest, best quality layerset temporarily + // and later queue the current layerset so we can get the proper quality level soon + + checkTempLevels(); + } else { + // log('level complete, using existing layers\n--'); + return layers; + } + + var getBb = function getBb() { + if (!bb) { + bb = math.makeBoundingBox(); + + for (var i = 0; i < eles.length; i++) { + math.updateBoundingBox(bb, eles[i].boundingBox()); + } + } + + return bb; + }; + + var makeLayer = function makeLayer(opts) { + opts = opts || {}; + + var after = opts.after; + + getBb(); + + var area = bb.w * scale * (bb.h * scale); + + if (area > maxLayerArea) { + return null; + } + + var layer = self.makeLayer(bb, lvl); + + if (after != null) { + var index = layers.indexOf(after) + 1; + + layers.splice(index, 0, layer); + } else if (opts.insert === undefined || opts.insert) { + // no after specified => first layer made so put at start + layers.unshift(layer); + } + + // if( tmpLayers ){ + //self.queueLayer( layer ); + // } + + return layer; + }; + + if (self.skipping && !firstGet) { + // log('skip layers'); + return null; + } + + // log('do layers'); + + var layer = null; + var maxElesPerLayer = eles.length / defNumLayers; + var allowLazyQueueing = alwaysQueue && !firstGet; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + var rs = ele._private.rscratch; + var caches = rs.imgLayerCaches = rs.imgLayerCaches || {}; + + // log('look at ele', ele.id()); + + var existingLayer = caches[lvl]; + + if (existingLayer) { + // reuse layer for later eles + // log('reuse layer for', ele.id()); + layer = existingLayer; + continue; + } + + if (!layer || layer.eles.length >= maxElesPerLayer || !math.boundingBoxInBoundingBox(layer.bb, ele.boundingBox())) { + // log('make new layer for ele %s', ele.id()); + + layer = makeLayer({ insert: true, after: layer }); + + // if now layer can be built then we can't use layers at this level + if (!layer) { + return null; + } + + // log('new layer with id %s', layer.id); + } + + if (tmpLayers || allowLazyQueueing) { + // log('queue ele %s in layer %s', ele.id(), layer.id); + self.queueLayer(layer, ele); + } else { + // log('draw ele %s in layer %s', ele.id(), layer.id); + self.drawEleInLayer(layer, ele, lvl, pxRatio); + } + + layer.eles.push(ele); + + caches[lvl] = layer; + } + + // log('--'); + + if (tmpLayers) { + // then we only queued the current layerset and can't draw it yet + return tmpLayers; + } + + if (allowLazyQueueing) { + // log('lazy queue level', lvl); + return null; + } + + return layers; +}; + +// a layer may want to use an ele cache of a higher level to avoid blurriness +// so the layer level might not equal the ele level +LTCp.getEleLevelForLayerLevel = function (lvl, pxRatio) { + return lvl; +}; + +function imgSmoothing(context, bool) { + if (context.imageSmoothingEnabled != null) { + context.imageSmoothingEnabled = bool; + } else { + context.webkitImageSmoothingEnabled = bool; + context.mozImageSmoothingEnabled = bool; + context.msImageSmoothingEnabled = bool; + } +} + +LTCp.drawEleInLayer = function (layer, ele, lvl, pxRatio) { + var self = this; + var r = this.renderer; + var context = layer.context; + var bb = ele.boundingBox(); + + if (bb.w === 0 || bb.h === 0 || !ele.visible()) { + return; + } + + var eleCache = self.eleTxrCache; + var reason = useHighQualityEleTxrReqs ? eleCache.reasons.highQuality : undefined; + + lvl = self.getEleLevelForLayerLevel(lvl, pxRatio); + + var cache = useEleTxrCaching ? eleCache.getElement(ele, bb, null, lvl, reason) : null; + + if (cache) { + if (disableEleImgSmoothing) { + imgSmoothing(context, false); + } + + context.drawImage(cache.texture.canvas, cache.x, 0, cache.width, cache.height, bb.x1, bb.y1, bb.w, bb.h); + + if (disableEleImgSmoothing) { + imgSmoothing(context, true); + } + } else { + // if the element is not cacheable, then draw directly + r.drawElement(context, ele); + } +}; + +LTCp.levelIsComplete = function (lvl, eles) { + var self = this; + var layers = self.layersByLevel[lvl]; + + if (!layers || layers.length === 0) { + return false; + } + + var numElesInLayers = 0; + + for (var i = 0; i < layers.length; i++) { + var layer = layers[i]; + + // if there are any eles needed to be drawn yet, the level is not complete + if (layer.reqs > 0) { + return false; + } + + // if the layer is invalid, the level is not complete + if (layer.invalid) { + return false; + } + + numElesInLayers += layer.eles.length; + } + + // we should have exactly the number of eles passed in to be complete + if (numElesInLayers !== eles.length) { + return false; + } + + return true; +}; + +LTCp.validateLayersElesOrdering = function (lvl, eles) { + var layers = this.layersByLevel[lvl]; + + if (!layers) { + return; + } + + // if in a layer the eles are not in the same order, then the layer is invalid + // (i.e. there is an ele in between the eles in the layer) + + for (var i = 0; i < layers.length; i++) { + var layer = layers[i]; + var offset = -1; + + // find the offset + for (var j = 0; j < eles.length; j++) { + if (layer.eles[0] === eles[j]) { + offset = j; + break; + } + } + + if (offset < 0) { + // then the layer has nonexistant elements and is invalid + this.invalidateLayer(layer); + continue; + } + + // the eles in the layer must be in the same continuous order, else the layer is invalid + + var o = offset; + + for (var j = 0; j < layer.eles.length; j++) { + if (layer.eles[j] !== eles[o + j]) { + // log('invalidate based on ordering', layer.id); + + this.invalidateLayer(layer); + break; + } + } + } +}; + +LTCp.updateElementsInLayers = function (eles, update) { + var self = this; + var isEles = is.element(eles[0]); + + // collect udpated elements (cascaded from the layers) and update each + // layer itself along the way + for (var i = 0; i < eles.length; i++) { + var req = isEles ? null : eles[i]; + var ele = isEles ? eles[i] : eles[i].ele; + var rs = ele._private.rscratch; + var caches = rs.imgLayerCaches = rs.imgLayerCaches || {}; + + for (var l = minLvl; l <= maxLvl; l++) { + var layer = caches[l]; + + if (!layer) { + continue; + } + + // if update is a request from the ele cache, then it affects only + // the matching level + if (req && self.getEleLevelForLayerLevel(layer.level) !== req.level) { + continue; + } + + update(layer, ele, req); + } + } +}; + +LTCp.haveLayers = function () { + var self = this; + var haveLayers = false; + + for (var l = minLvl; l <= maxLvl; l++) { + var layers = self.layersByLevel[l]; + + if (layers && layers.length > 0) { + haveLayers = true; + break; + } + } + + return haveLayers; +}; + +LTCp.invalidateElements = function (eles) { + var self = this; + + self.lastInvalidationTime = util.performanceNow(); + + // log('update invalidate layer time from eles'); + + if (eles.length === 0 || !self.haveLayers()) { + return; + } + + self.updateElementsInLayers(eles, function invalAssocLayers(layer, ele, req) { + self.invalidateLayer(layer); + }); +}; + +LTCp.invalidateLayer = function (layer) { + // log('update invalidate layer time'); + + this.lastInvalidationTime = util.performanceNow(); + + if (layer.invalid) { + return; + } // save cycles + + var lvl = layer.level; + var eles = layer.eles; + var layers = this.layersByLevel[lvl]; + + // log('invalidate layer', layer.id ); + + util.removeFromArray(layers, layer); + // layer.eles = []; + + layer.elesQueue = []; + + layer.invalid = true; + + if (layer.replacement) { + layer.replacement.invalid = true; + } + + for (var i = 0; i < eles.length; i++) { + var caches = eles[i]._private.rscratch.imgLayerCaches; + + if (caches) { + caches[lvl] = null; + } + } +}; + +LTCp.refineElementTextures = function (eles) { + var self = this; + + // log('refine', eles.length); + + self.updateElementsInLayers(eles, function refineEachEle(layer, ele, req) { + var rLyr = layer.replacement; + + if (!rLyr) { + rLyr = layer.replacement = self.makeLayer(layer.bb, layer.level); + rLyr.replaces = layer; + rLyr.eles = layer.eles; + + // log('make replacement layer %s for %s with level %s', rLyr.id, layer.id, rLyr.level); + } + + if (!rLyr.reqs) { + for (var i = 0; i < rLyr.eles.length; i++) { + self.queueLayer(rLyr, rLyr.eles[i]); + } + + // log('queue replacement layer refinement', rLyr.id); + } + }); +}; + +LTCp.setupEleCacheInvalidation = function () { + var self = this; + var eleDeqs = []; + + if (!useEleTxrCaching) { + return; + } + + var updatedElesInLayers = util.debounce(function () { + self.refineElementTextures(eleDeqs); + + eleDeqs = []; + }, refineEleDebounceTime); + + self.eleTxrCache.onDequeue(function (reqs) { + for (var i = 0; i < reqs.length; i++) { + eleDeqs.push(reqs[i]); + } + + updatedElesInLayers(); + }); +}; + +LTCp.queueLayer = function (layer, ele) { + var self = this; + var q = self.layersQueue; + var elesQ = layer.elesQueue; + var hasId = elesQ.hasId = elesQ.hasId || {}; + + // if a layer is going to be replaced, queuing is a waste of time + if (layer.replacement) { + return; + } + + if (ele) { + if (hasId[ele.id()]) { + return; + } + + elesQ.push(ele); + hasId[ele.id()] = true; + } + + if (layer.reqs) { + layer.reqs++; + + q.updateItem(layer); + } else { + layer.reqs = 1; + + q.push(layer); + } +}; + +LTCp.dequeue = function (pxRatio) { + var self = this; + var q = self.layersQueue; + var deqd = []; + var eleDeqs = 0; + + while (eleDeqs < maxDeqSize) { + if (q.size() === 0) { + break; + } + + var layer = q.peek(); + + // if a layer has been or will be replaced, then don't waste time with it + if (layer.replacement) { + // log('layer %s in queue skipped b/c it already has a replacement', layer.id); + q.pop(); + continue; + } + + // if this is a replacement layer that has been superceded, then forget it + if (layer.replaces && layer !== layer.replaces.replacement) { + // log('layer is no longer the most uptodate replacement; dequeued', layer.id) + q.pop(); + continue; + } + + if (layer.invalid) { + // log('replacement layer %s is invalid; dequeued', layer.id); + q.pop(); + continue; + } + + var ele = layer.elesQueue.shift(); + + if (ele) { + // log('dequeue layer %s', layer.id); + + self.drawEleInLayer(layer, ele, layer.level, pxRatio); + + eleDeqs++; + } + + if (deqd.length === 0) { + // we need only one entry in deqd to queue redrawing etc + deqd.push(true); + } + + // if the layer has all its eles done, then remove from the queue + if (layer.elesQueue.length === 0) { + q.pop(); + + layer.reqs = 0; + + // log('dequeue of layer %s complete', layer.id); + + // when a replacement layer is dequeued, it replaces the old layer in the level + if (layer.replaces) { + self.applyLayerReplacement(layer); + } + + self.requestRedraw(); + } + } + + return deqd; +}; + +LTCp.applyLayerReplacement = function (layer) { + var self = this; + var layersInLevel = self.layersByLevel[layer.level]; + var replaced = layer.replaces; + var index = layersInLevel.indexOf(replaced); + + // if the replaced layer is not in the active list for the level, then replacing + // refs would be a mistake (i.e. overwriting the true active layer) + if (index < 0 || replaced.invalid) { + // log('replacement layer would have no effect', layer.id); + return; + } + + layersInLevel[index] = layer; // replace level ref + + // replace refs in eles + for (var i = 0; i < layer.eles.length; i++) { + var _p = layer.eles[i]._private; + var cache = _p.imgLayerCaches = _p.imgLayerCaches || {}; + + if (cache) { + cache[layer.level] = layer; + } + } + + // log('apply replacement layer %s over %s', layer.id, replaced.id); + + self.requestRedraw(); +}; + +LTCp.requestRedraw = util.debounce(function () { + var r = this.renderer; + + r.redrawHint('eles', true); + r.redrawHint('drag', true); + r.redraw(); +}, 100); + +LTCp.setupDequeueing = defs.setupDequeueing({ + deqRedrawThreshold: deqRedrawThreshold, + deqCost: deqCost, + deqAvgCost: deqAvgCost, + deqNoDrawCost: deqNoDrawCost, + deqFastCost: deqFastCost, + deq: function deq(self, pxRatio) { + return self.dequeue(pxRatio); + }, + onDeqd: util.noop, + shouldRedraw: util.trueify, + priority: function priority(self) { + return self.renderer.beforeRenderPriorities.lyrTxrDeq; + } +}); + +module.exports = LayeredTextureCache; + +/***/ }), +/* 127 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var CRp = {}; + +var impl; + +CRp.arrowShapeImpl = function (name) { + return (impl || (impl = { + 'polygon': function polygon(context, points) { + for (var i = 0; i < points.length; i++) { + var pt = points[i]; + + context.lineTo(pt.x, pt.y); + } + }, + + 'triangle-backcurve': function triangleBackcurve(context, points, controlPoint) { + var firstPt; + + for (var i = 0; i < points.length; i++) { + var pt = points[i]; + + if (i === 0) { + firstPt = pt; + } + + context.lineTo(pt.x, pt.y); + } + + context.quadraticCurveTo(controlPoint.x, controlPoint.y, firstPt.x, firstPt.y); + }, + + 'triangle-tee': function triangleTee(context, trianglePoints, teePoints) { + if (context.beginPath) { + context.beginPath(); + } + + var triPts = trianglePoints; + for (var i = 0; i < triPts.length; i++) { + var pt = triPts[i]; + + context.lineTo(pt.x, pt.y); + } + + if (context.closePath) { + context.closePath(); + } + + if (context.beginPath) { + context.beginPath(); + } + + var teePts = teePoints; + var firstTeePt = teePoints[0]; + context.moveTo(firstTeePt.x, firstTeePt.y); + + for (var i = 0; i < teePts.length; i++) { + var pt = teePts[i]; + + context.lineTo(pt.x, pt.y); + } + if (context.closePath) { + context.closePath(); + } + }, + + 'triangle-cross': function triangleCross(context, trianglePoints, crossLinePoints) { + if (context.beginPath) { + context.beginPath(); + } + + var triPts = trianglePoints; + for (var i = 0; i < triPts.length; i++) { + var pt = triPts[i]; + + context.lineTo(pt.x, pt.y); + } + + if (context.closePath) { + context.closePath(); + } + + if (context.beginPath) { + context.beginPath(); + } + + var teePts = crossLinePoints; + var firstTeePt = crossLinePoints[0]; + context.moveTo(firstTeePt.x, firstTeePt.y); + + for (var i = 0; i < teePts.length; i++) { + var pt = teePts[i]; + + context.lineTo(pt.x, pt.y); + } + if (context.closePath) { + context.closePath(); + } + }, + + 'circle': function circle(context, rx, ry, r) { + context.arc(rx, ry, r, 0, Math.PI * 2, false); + } + }))[name]; +}; + +module.exports = CRp; + +/***/ }), +/* 128 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var math = __webpack_require__(2); + +var CRp = {}; + +CRp.drawElement = function (context, ele, shiftToOriginWithBb, showLabel) { + var r = this; + + if (ele.isNode()) { + r.drawNode(context, ele, shiftToOriginWithBb, showLabel); + } else { + r.drawEdge(context, ele, shiftToOriginWithBb, showLabel); + } +}; + +CRp.drawCachedElement = function (context, ele, pxRatio, extent) { + var r = this; + var bb = ele.boundingBox(); + + if (bb.w === 0 || bb.h === 0) { + return; + } + + if (!extent || math.boundingBoxesIntersect(bb, extent)) { + var cache = r.data.eleTxrCache.getElement(ele, bb, pxRatio); + + if (cache != null) { + context.drawImage(cache.texture.canvas, cache.x, 0, cache.width, cache.height, bb.x1, bb.y1, bb.w, bb.h); + } else { + // if the element is not cacheable, then draw directly + r.drawElement(context, ele); + } + } +}; + +CRp.drawElements = function (context, eles) { + var r = this; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + + r.drawElement(context, ele); + } +}; + +CRp.drawCachedElements = function (context, eles, pxRatio, extent) { + var r = this; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + + r.drawCachedElement(context, ele, pxRatio, extent); + } +}; + +CRp.drawCachedNodes = function (context, eles, pxRatio, extent) { + var r = this; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + + if (!ele.isNode()) { + continue; + } + + r.drawCachedElement(context, ele, pxRatio, extent); + } +}; + +CRp.drawLayeredElements = function (context, eles, pxRatio, extent) { + var r = this; + + var layers = r.data.lyrTxrCache.getLayers(eles, pxRatio); + + if (layers) { + for (var i = 0; i < layers.length; i++) { + var layer = layers[i]; + var bb = layer.bb; + + if (bb.w === 0 || bb.h === 0) { + continue; + } + + context.drawImage(layer.canvas, bb.x1, bb.y1, bb.w, bb.h); + } + } else { + // fall back on plain caching if no layers + r.drawCachedElements(context, eles, pxRatio, extent); + } +}; + +CRp.drawDebugPoints = function (context, eles) { + var draw = function draw(x, y, color) { + context.fillStyle = color; + context.fillRect(x - 1, y - 1, 3, 3); + }; + + for (var i = 0; i < eles.length; i++) { + var ele = eles[i]; + var rs = ele._private.rscratch; + + if (ele.isNode()) { + var p = ele.position(); + + draw(p.x, p.y, 'magenta'); + } else { + var pts = rs.allpts; + + for (var j = 0; j + 1 < pts.length; j += 2) { + var x = pts[j]; + var y = pts[j + 1]; + + draw(x, y, 'cyan'); + } + + draw(rs.midX, rs.midY, 'yellow'); + } + } +}; + +module.exports = CRp; + +/***/ }), +/* 129 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var CRp = {}; + +CRp.drawEdge = function (context, edge, shiftToOriginWithBb, drawLabel) { + var r = this; + var rs = edge._private.rscratch; + var usePaths = r.usePaths(); + + if (!edge.visible()) { + return; + } + + // if bezier ctrl pts can not be calculated, then die + if (rs.badLine || rs.allpts == null || isNaN(rs.allpts[0])) { + // isNaN in case edge is impossible and browser bugs (e.g. safari) + return; + } + + var bb = void 0; + if (shiftToOriginWithBb) { + bb = shiftToOriginWithBb; + + context.translate(-bb.x1, -bb.y1); + } + + var overlayPadding = edge.pstyle('overlay-padding').pfValue; + var overlayWidth = 2 * overlayPadding; + var overlayOpacity = edge.pstyle('overlay-opacity').value; + var overlayColor = edge.pstyle('overlay-color').value; + var lineColor = edge.pstyle('line-color').value; + var opacity = edge.pstyle('opacity').value; + var lineStyle = edge.pstyle('line-style').value; + var edgeWidth = edge.pstyle('width').pfValue; + + var drawLine = function drawLine() { + var strokeOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : opacity; + + context.lineWidth = edgeWidth; + context.lineCap = 'butt'; + + r.strokeStyle(context, lineColor[0], lineColor[1], lineColor[2], strokeOpacity); + + r.drawEdgePath(edge, context, rs.allpts, lineStyle); + }; + + var drawOverlay = function drawOverlay() { + var strokeOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : overlayOpacity; + + context.lineWidth = overlayWidth; + + if (rs.edgeType === 'self' && !usePaths) { + context.lineCap = 'butt'; + } else { + context.lineCap = 'round'; + } + + r.strokeStyle(context, overlayColor[0], overlayColor[1], overlayColor[2], strokeOpacity); + + r.drawEdgePath(edge, context, rs.allpts, 'solid'); + }; + + var drawArrows = function drawArrows() { + var arrowOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : opacity; + + r.drawArrowheads(context, edge, arrowOpacity); + }; + + var drawText = function drawText() { + r.drawElementText(context, edge, drawLabel); + }; + + context.lineJoin = 'round'; + + var ghost = edge.pstyle('ghost').value === 'yes'; + + if (ghost) { + var gx = edge.pstyle('ghost-offset-x').pfValue; + var gy = edge.pstyle('ghost-offset-y').pfValue; + var ghostOpacity = edge.pstyle('ghost-opacity').value; + var effectiveGhostOpacity = opacity * ghostOpacity; + + context.translate(gx, gy); + + drawLine(effectiveGhostOpacity); + drawArrows(effectiveGhostOpacity); + + context.translate(-gx, -gy); + } + + drawLine(); + drawArrows(); + drawOverlay(); + drawText(); + + if (shiftToOriginWithBb) { + context.translate(bb.x1, bb.y1); + } +}; + +CRp.drawEdgePath = function (edge, context, pts, type) { + var rs = edge._private.rscratch; + var canvasCxt = context; + var path = void 0; + var pathCacheHit = false; + var usePaths = this.usePaths(); + + if (usePaths) { + var pathCacheKey = pts.join('$'); + var keyMatches = rs.pathCacheKey && rs.pathCacheKey === pathCacheKey; + + if (keyMatches) { + path = context = rs.pathCache; + pathCacheHit = true; + } else { + path = context = new Path2D(); // eslint-disable-line no-undef + rs.pathCacheKey = pathCacheKey; + rs.pathCache = path; + } + } + + if (canvasCxt.setLineDash) { + // for very outofdate browsers + switch (type) { + case 'dotted': + canvasCxt.setLineDash([1, 1]); + break; + + case 'dashed': + canvasCxt.setLineDash([6, 3]); + break; + + case 'solid': + canvasCxt.setLineDash([]); + break; + } + } + + if (!pathCacheHit && !rs.badLine) { + if (context.beginPath) { + context.beginPath(); + } + context.moveTo(pts[0], pts[1]); + + switch (rs.edgeType) { + case 'bezier': + case 'self': + case 'compound': + case 'multibezier': + for (var i = 2; i + 3 < pts.length; i += 4) { + context.quadraticCurveTo(pts[i], pts[i + 1], pts[i + 2], pts[i + 3]); + } + break; + + case 'straight': + case 'segments': + case 'haystack': + for (var _i = 2; _i + 1 < pts.length; _i += 2) { + context.lineTo(pts[_i], pts[_i + 1]); + } + break; + } + } + + context = canvasCxt; + if (usePaths) { + context.stroke(path); + } else { + context.stroke(); + } + + // reset any line dashes + if (context.setLineDash) { + // for very outofdate browsers + context.setLineDash([]); + } +}; + +CRp.drawArrowheads = function (context, edge, opacity) { + var rs = edge._private.rscratch; + var isHaystack = rs.edgeType === 'haystack'; + + if (!isHaystack) { + this.drawArrowhead(context, edge, 'source', rs.arrowStartX, rs.arrowStartY, rs.srcArrowAngle, opacity); + } + + this.drawArrowhead(context, edge, 'mid-target', rs.midX, rs.midY, rs.midtgtArrowAngle, opacity); + + this.drawArrowhead(context, edge, 'mid-source', rs.midX, rs.midY, rs.midsrcArrowAngle, opacity); + + if (!isHaystack) { + this.drawArrowhead(context, edge, 'target', rs.arrowEndX, rs.arrowEndY, rs.tgtArrowAngle, opacity); + } +}; + +CRp.drawArrowhead = function (context, edge, prefix, x, y, angle, opacity) { + if (isNaN(x) || x == null || isNaN(y) || y == null || isNaN(angle) || angle == null) { + return; + } + + var self = this; + var arrowShape = edge.pstyle(prefix + '-arrow-shape').value; + if (arrowShape === 'none') { + return; + } + + var arrowClearFill = edge.pstyle(prefix + '-arrow-fill').value === 'hollow' ? 'both' : 'filled'; + var arrowFill = edge.pstyle(prefix + '-arrow-fill').value; + var edgeWidth = edge.pstyle('width').pfValue; + var edgeOpacity = edge.pstyle('opacity').value; + + if (opacity === undefined) { + opacity = edgeOpacity; + } + + var gco = context.globalCompositeOperation; + + if (opacity !== 1 || arrowFill === 'hollow') { + // then extra clear is needed + context.globalCompositeOperation = 'destination-out'; + + self.fillStyle(context, 255, 255, 255, 1); + self.strokeStyle(context, 255, 255, 255, 1); + + self.drawArrowShape(edge, prefix, context, arrowClearFill, edgeWidth, arrowShape, x, y, angle); + + context.globalCompositeOperation = gco; + } // otherwise, the opaque arrow clears it for free :) + + var color = edge.pstyle(prefix + '-arrow-color').value; + self.fillStyle(context, color[0], color[1], color[2], opacity); + self.strokeStyle(context, color[0], color[1], color[2], opacity); + + self.drawArrowShape(edge, prefix, context, arrowFill, edgeWidth, arrowShape, x, y, angle); +}; + +CRp.drawArrowShape = function (edge, arrowType, context, fill, edgeWidth, shape, x, y, angle) { + var r = this; + var usePaths = this.usePaths(); + var rs = edge._private.rscratch; + var pathCacheHit = false; + var path = void 0; + var canvasContext = context; + var translation = { x: x, y: y }; + var scale = edge.pstyle('arrow-scale').value; + var size = this.getArrowWidth(edgeWidth, scale); + var shapeImpl = r.arrowShapes[shape]; + + if (usePaths) { + var pathCacheKey = size + '$' + shape + '$' + angle + '$' + x + '$' + y; + rs.arrowPathCacheKey = rs.arrowPathCacheKey || {}; + rs.arrowPathCache = rs.arrowPathCache || {}; + + var alreadyCached = rs.arrowPathCacheKey[arrowType] === pathCacheKey; + if (alreadyCached) { + path = context = rs.arrowPathCache[arrowType]; + pathCacheHit = true; + } else { + path = context = new Path2D(); // eslint-disable-line no-undef + rs.arrowPathCacheKey[arrowType] = pathCacheKey; + rs.arrowPathCache[arrowType] = path; + } + } + + if (context.beginPath) { + context.beginPath(); + } + + if (!pathCacheHit) { + shapeImpl.draw(context, size, angle, translation, edgeWidth); + } + + if (!shapeImpl.leavePathOpen && context.closePath) { + context.closePath(); + } + + context = canvasContext; + + if (fill === 'filled' || fill === 'both') { + if (usePaths) { + context.fill(path); + } else { + context.fill(); + } + } + + if (fill === 'hollow' || fill === 'both') { + context.lineWidth = shapeImpl.matchEdgeWidth ? edgeWidth : 1; + context.lineJoin = 'miter'; + + if (usePaths) { + context.stroke(path); + } else { + context.stroke(); + } + } +}; + +module.exports = CRp; + +/***/ }), +/* 130 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var CRp = {}; + +CRp.safeDrawImage = function (context, img, ix, iy, iw, ih, x, y, w, h) { + var r = this; + + // detect problematic cases for old browsers with bad images (cheaper than try-catch) + if (iw <= 0 || ih <= 0 || w <= 0 || h <= 0) { + return; + } + + context.drawImage(img, ix, iy, iw, ih, x, y, w, h); +}; + +CRp.drawInscribedImage = function (context, img, node, index, nodeOpacity) { + var r = this; + var pos = node.position(); + var nodeX = pos.x; + var nodeY = pos.y; + var styleObj = node.cy().style(); + var getIndexedStyle = styleObj.getIndexedStyle.bind(styleObj); + var fit = getIndexedStyle(node, 'background-fit', 'value', index); + var repeat = getIndexedStyle(node, 'background-repeat', 'value', index); + var nodeW = node.width(); + var nodeH = node.height(); + var paddingX2 = node.padding() * 2; + var nodeTW = nodeW + (getIndexedStyle(node, 'background-width-relative-to', 'value', index) === 'inner' ? 0 : paddingX2); + var nodeTH = nodeH + (getIndexedStyle(node, 'background-height-relative-to', 'value', index) === 'inner' ? 0 : paddingX2); + var rs = node._private.rscratch; + var clip = node.pstyle('background-clip').value; + var shouldClip = clip === 'node'; + var imgOpacity = getIndexedStyle(node, 'background-image-opacity', 'value', index) * nodeOpacity; + + var imgW = img.width || img.cachedW; + var imgH = img.height || img.cachedH; + + // workaround for broken browsers like ie + if (null == imgW || null == imgH) { + document.body.appendChild(img); // eslint-disable-line no-undef + + imgW = img.cachedW = img.width || img.offsetWidth; + imgH = img.cachedH = img.height || img.offsetHeight; + + document.body.removeChild(img); // eslint-disable-line no-undef + } + + var w = imgW; + var h = imgH; + + if (getIndexedStyle(node, 'background-width', 'value', index) !== 'auto') { + if (getIndexedStyle(node, 'background-width', 'units', index) === '%') { + w = getIndexedStyle(node, 'background-width', 'pfValue', index) * nodeTW; + } else { + w = getIndexedStyle(node, 'background-width', 'pfValue', index); + } + } + + if (getIndexedStyle(node, 'background-height', 'value', index) !== 'auto') { + if (getIndexedStyle(node, 'background-height', 'units', index) === '%') { + h = getIndexedStyle(node, 'background-height', 'pfValue', index) * nodeTH; + } else { + h = getIndexedStyle(node, 'background-height', 'pfValue', index); + } + } + + if (w === 0 || h === 0) { + return; // no point in drawing empty image (and chrome is broken in this case) + } + + if (fit === 'contain') { + var scale = Math.min(nodeTW / w, nodeTH / h); + + w *= scale; + h *= scale; + } else if (fit === 'cover') { + var scale = Math.max(nodeTW / w, nodeTH / h); + + w *= scale; + h *= scale; + } + + var x = nodeX - nodeTW / 2; // left + if (getIndexedStyle(node, 'background-position-x', 'units', index) === '%') { + x += (nodeTW - w) * getIndexedStyle(node, 'background-position-x', 'pfValue', index); + } else { + x += getIndexedStyle(node, 'background-position-x', 'pfValue', index); + } + + var y = nodeY - nodeTH / 2; // top + if (getIndexedStyle(node, 'background-position-y', 'units', index) === '%') { + y += (nodeTH - h) * getIndexedStyle(node, 'background-position-y', 'pfValue', index); + } else { + y += getIndexedStyle(node, 'background-position-y', 'pfValue', index); + } + + if (rs.pathCache) { + x -= nodeX; + y -= nodeY; + + nodeX = 0; + nodeY = 0; + } + + var gAlpha = context.globalAlpha; + + context.globalAlpha = imgOpacity; + + if (repeat === 'no-repeat') { + + if (shouldClip) { + context.save(); + + if (rs.pathCache) { + context.clip(rs.pathCache); + } else { + r.nodeShapes[r.getNodeShape(node)].draw(context, nodeX, nodeY, nodeTW, nodeTH); + + context.clip(); + } + } + + r.safeDrawImage(context, img, 0, 0, imgW, imgH, x, y, w, h); + + if (shouldClip) { + context.restore(); + } + } else { + var pattern = context.createPattern(img, repeat); + context.fillStyle = pattern; + + r.nodeShapes[r.getNodeShape(node)].draw(context, nodeX, nodeY, nodeTW, nodeTH); + + context.translate(x, y); + context.fill(); + context.translate(-x, -y); + } + + context.globalAlpha = gAlpha; +}; + +module.exports = CRp; + +/***/ }), +/* 131 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(1); +var math = __webpack_require__(2); + +var CRp = {}; + +CRp.eleTextBiggerThanMin = function (ele, scale) { + if (!scale) { + var zoom = ele.cy().zoom(); + var pxRatio = this.getPixelRatio(); + var lvl = Math.ceil(math.log2(zoom * pxRatio)); // the effective texture level + + scale = Math.pow(2, lvl); + } + + var computedSize = ele.pstyle('font-size').pfValue * scale; + var minSize = ele.pstyle('min-zoomed-font-size').pfValue; + + if (computedSize < minSize) { + return false; + } + + return true; +}; + +CRp.drawElementText = function (context, ele, force) { + var r = this; + + if (force === undefined) { + if (!r.eleTextBiggerThanMin(ele)) { + return; + } + } else { + if (!force) { + return; + } + } + + if (ele.isNode()) { + var label = ele.pstyle('label'); + + if (!label || !label.value) { + return; + } + + var textHalign = ele.pstyle('text-halign').strValue; + var textValign = ele.pstyle('text-valign').strValue; + + switch (textHalign) { + case 'left': + context.textAlign = 'right'; + break; + + case 'right': + context.textAlign = 'left'; + break; + + default: + // e.g. center + context.textAlign = 'center'; + } + + context.textBaseline = 'bottom'; + } else { + var label = ele.pstyle('label'); + var srcLabel = ele.pstyle('source-label'); + var tgtLabel = ele.pstyle('target-label'); + + if ((!label || !label.value) && (!srcLabel || !srcLabel.value) && (!tgtLabel || !tgtLabel.value)) { + return; + } + + context.textAlign = 'center'; + context.textBaseline = 'bottom'; + } + + r.drawText(context, ele); + + if (ele.isEdge()) { + r.drawText(context, ele, 'source'); + + r.drawText(context, ele, 'target'); + } +}; + +CRp.drawNodeText = CRp.drawEdgeText = CRp.drawElementText; + +CRp.getFontCache = function (context) { + var cache; + + this.fontCaches = this.fontCaches || []; + + for (var i = 0; i < this.fontCaches.length; i++) { + cache = this.fontCaches[i]; + + if (cache.context === context) { + return cache; + } + } + + cache = { + context: context + }; + this.fontCaches.push(cache); + + return cache; +}; + +// set up canvas context with font +// returns transformed text string +CRp.setupTextStyle = function (context, ele) { + // Font style + var parentOpacity = ele.effectiveOpacity(); + var labelStyle = ele.pstyle('font-style').strValue; + var labelSize = ele.pstyle('font-size').pfValue + 'px'; + var labelFamily = ele.pstyle('font-family').strValue; + var labelWeight = ele.pstyle('font-weight').strValue; + var opacity = ele.pstyle('text-opacity').value * ele.pstyle('opacity').value * parentOpacity; + var outlineOpacity = ele.pstyle('text-outline-opacity').value * opacity; + var color = ele.pstyle('color').value; + var outlineColor = ele.pstyle('text-outline-color').value; + + var fontCacheKey = ele._private.fontKey; + var cache = this.getFontCache(context); + + if (cache.key !== fontCacheKey) { + context.font = labelStyle + ' ' + labelWeight + ' ' + labelSize + ' ' + labelFamily; + + cache.key = fontCacheKey; + } + + // Calculate text draw position based on text alignment + + // so text outlines aren't jagged + context.lineJoin = 'round'; + + this.fillStyle(context, color[0], color[1], color[2], opacity); + + this.strokeStyle(context, outlineColor[0], outlineColor[1], outlineColor[2], outlineOpacity); +}; + +function roundRect(ctx, x, y, width, height, radius) { + var radius = radius || 5; + ctx.beginPath(); + ctx.moveTo(x + radius, y); + ctx.lineTo(x + width - radius, y); + ctx.quadraticCurveTo(x + width, y, x + width, y + radius); + ctx.lineTo(x + width, y + height - radius); + ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height); + ctx.lineTo(x + radius, y + height); + ctx.quadraticCurveTo(x, y + height, x, y + height - radius); + ctx.lineTo(x, y + radius); + ctx.quadraticCurveTo(x, y, x + radius, y); + ctx.closePath(); + ctx.fill(); +} + +// Draw text +CRp.drawText = function (context, ele, prefix) { + var _p = ele._private; + var rscratch = _p.rscratch; + var parentOpacity = ele.effectiveOpacity(); + if (parentOpacity === 0 || ele.pstyle('text-opacity').value === 0) { + return; + } + + var textX = util.getPrefixedProperty(rscratch, 'labelX', prefix); + var textY = util.getPrefixedProperty(rscratch, 'labelY', prefix); + var text = this.getLabelText(ele, prefix); + + if (text != null && text !== '' && !isNaN(textX) && !isNaN(textY)) { + this.setupTextStyle(context, ele); + + var pdash = prefix ? prefix + '-' : ''; + var textW = util.getPrefixedProperty(rscratch, 'labelWidth', prefix); + var textH = util.getPrefixedProperty(rscratch, 'labelHeight', prefix); + var textAngle = util.getPrefixedProperty(rscratch, 'labelAngle', prefix); + var marginX = ele.pstyle(pdash + 'text-margin-x').pfValue; + var marginY = ele.pstyle(pdash + 'text-margin-y').pfValue; + + var isEdge = ele.isEdge(); + var isNode = ele.isNode(); + + var halign = ele.pstyle('text-halign').value; + var valign = ele.pstyle('text-valign').value; + + if (isEdge) { + halign = 'center'; + valign = 'center'; + } + + textX += marginX; + textY += marginY; + + var rotation = ele.pstyle(pdash + 'text-rotation'); + var theta; + + if (rotation.strValue === 'autorotate') { + theta = isEdge ? textAngle : 0; + } else if (rotation.strValue === 'none') { + theta = 0; + } else { + theta = rotation.pfValue; + } + + if (theta !== 0) { + var orgTextX = textX; + var orgTextY = textY; + + context.translate(orgTextX, orgTextY); + context.rotate(theta); + + textX = 0; + textY = 0; + } + + switch (valign) { + case 'top': + break; + case 'center': + textY += textH / 2; + break; + case 'bottom': + textY += textH; + break; + } + + var backgroundOpacity = ele.pstyle('text-background-opacity').value; + var borderOpacity = ele.pstyle('text-border-opacity').value; + var textBorderWidth = ele.pstyle('text-border-width').pfValue; + var backgroundPadding = ele.pstyle('text-background-padding').pfValue; + + if (backgroundOpacity > 0 || textBorderWidth > 0 && borderOpacity > 0) { + var bgX = textX - backgroundPadding; + + switch (halign) { + case 'left': + bgX -= textW; + break; + case 'center': + bgX -= textW / 2; + break; + case 'right': + break; + } + + var bgY = textY - textH - backgroundPadding; + var bgW = textW + 2 * backgroundPadding; + var bgH = textH + 2 * backgroundPadding; + + if (backgroundOpacity > 0) { + var textFill = context.fillStyle; + var textBackgroundColor = ele.pstyle('text-background-color').value; + + context.fillStyle = 'rgba(' + textBackgroundColor[0] + ',' + textBackgroundColor[1] + ',' + textBackgroundColor[2] + ',' + backgroundOpacity * parentOpacity + ')'; + var styleShape = ele.pstyle('text-background-shape').strValue; + if (styleShape == 'roundrectangle') { + roundRect(context, bgX, bgY, bgW, bgH, 2); + } else { + context.fillRect(bgX, bgY, bgW, bgH); + } + context.fillStyle = textFill; + } + + if (textBorderWidth > 0 && borderOpacity > 0) { + var textStroke = context.strokeStyle; + var textLineWidth = context.lineWidth; + var textBorderColor = ele.pstyle('text-border-color').value; + var textBorderStyle = ele.pstyle('text-border-style').value; + + context.strokeStyle = 'rgba(' + textBorderColor[0] + ',' + textBorderColor[1] + ',' + textBorderColor[2] + ',' + borderOpacity * parentOpacity + ')'; + context.lineWidth = textBorderWidth; + + if (context.setLineDash) { + // for very outofdate browsers + switch (textBorderStyle) { + case 'dotted': + context.setLineDash([1, 1]); + break; + case 'dashed': + context.setLineDash([4, 2]); + break; + case 'double': + context.lineWidth = textBorderWidth / 4; // 50% reserved for white between the two borders + context.setLineDash([]); + break; + case 'solid': + context.setLineDash([]); + break; + } + } + + context.strokeRect(bgX, bgY, bgW, bgH); + + if (textBorderStyle === 'double') { + var whiteWidth = textBorderWidth / 2; + + context.strokeRect(bgX + whiteWidth, bgY + whiteWidth, bgW - whiteWidth * 2, bgH - whiteWidth * 2); + } + + if (context.setLineDash) { + // for very outofdate browsers + context.setLineDash([]); + } + context.lineWidth = textLineWidth; + context.strokeStyle = textStroke; + } + } + + var lineWidth = 2 * ele.pstyle('text-outline-width').pfValue; // *2 b/c the stroke is drawn centred on the middle + + if (lineWidth > 0) { + context.lineWidth = lineWidth; + } + + if (ele.pstyle('text-wrap').value === 'wrap') { + var lines = util.getPrefixedProperty(rscratch, 'labelWrapCachedLines', prefix); + var lineHeight = textH / lines.length; + + switch (valign) { + case 'top': + textY -= (lines.length - 1) * lineHeight; + break; + case 'center': + case 'bottom': + textY -= (lines.length - 1) * lineHeight; + break; + } + + for (var l = 0; l < lines.length; l++) { + if (lineWidth > 0) { + context.strokeText(lines[l], textX, textY); + } + + context.fillText(lines[l], textX, textY); + + textY += lineHeight; + } + } else { + if (lineWidth > 0) { + context.strokeText(text, textX, textY); + } + + context.fillText(text, textX, textY); + } + + if (theta !== 0) { + context.rotate(-theta); + context.translate(-orgTextX, -orgTextY); + } + } +}; + +module.exports = CRp; + +/***/ }), +/* 132 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* global Path2D */ + +var is = __webpack_require__(0); + +var CRp = {}; + +CRp.drawNode = function (context, node, shiftToOriginWithBb, drawLabel) { + var r = this; + var nodeWidth = void 0, + nodeHeight = void 0; + var _p = node._private; + var rs = _p.rscratch; + var pos = node.position(); + + if (!is.number(pos.x) || !is.number(pos.y)) { + return; // can't draw node with undefined position + } + + if (!node.visible()) { + return; + } + + var parentOpacity = node.effectiveOpacity(); + + var usePaths = r.usePaths(); + var path = void 0; + var pathCacheHit = false; + + var padding = node.padding(); + + nodeWidth = node.width() + 2 * padding; + nodeHeight = node.height() + 2 * padding; + + // + // setup shift + + var bb = void 0; + if (shiftToOriginWithBb) { + bb = shiftToOriginWithBb; + + context.translate(-bb.x1, -bb.y1); + } + + // + // load bg image + + var bgImgProp = node.pstyle('background-image'); + var urls = bgImgProp.value; + var urlDefined = new Array(urls.length); + var image = new Array(urls.length); + var numImages = 0; + for (var i = 0; i < urls.length; i++) { + var url = urls[i]; + var defd = urlDefined[i] = url != null && url !== 'none'; + + if (defd) { + var bgImgCrossOrigin = node.cy().style().getIndexedStyle(node, 'background-image-crossorigin', 'value', i); + + numImages++; + + // get image, and if not loaded then ask to redraw when later loaded + image[i] = r.getCachedImage(url, bgImgCrossOrigin, function () { + node.emitAndNotify('background'); + }); + } + } + + // + // setup styles + + var darkness = node.pstyle('background-blacken').value; + var borderWidth = node.pstyle('border-width').pfValue; + var bgColor = node.pstyle('background-color').value; + var bgOpacity = node.pstyle('background-opacity').value * parentOpacity; + var borderColor = node.pstyle('border-color').value; + var borderStyle = node.pstyle('border-style').value; + var borderOpacity = node.pstyle('border-opacity').value * parentOpacity; + + context.lineJoin = 'miter'; // so borders are square with the node shape + + var setupShapeColor = function setupShapeColor() { + var bgOpy = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : bgOpacity; + + r.fillStyle(context, bgColor[0], bgColor[1], bgColor[2], bgOpy); + }; + + var setupBorderColor = function setupBorderColor() { + var bdrOpy = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : borderOpacity; + + r.strokeStyle(context, borderColor[0], borderColor[1], borderColor[2], bdrOpy); + }; + + // + // setup shape + + var styleShape = node.pstyle('shape').strValue; + var shapePts = node.pstyle('shape-polygon-points').pfValue; + + if (usePaths) { + var pathCacheKey = styleShape + '$' + nodeWidth + '$' + nodeHeight + (styleShape === 'polygon' ? '$' + shapePts.join('$') : ''); + + context.translate(pos.x, pos.y); + + if (rs.pathCacheKey === pathCacheKey) { + path = rs.pathCache; + pathCacheHit = true; + } else { + path = new Path2D(); + rs.pathCacheKey = pathCacheKey; + rs.pathCache = path; + } + } + + var drawShape = function drawShape() { + if (!pathCacheHit) { + + var npos = pos; + + if (usePaths) { + npos = { + x: 0, + y: 0 + }; + } + + r.nodeShapes[r.getNodeShape(node)].draw(path || context, npos.x, npos.y, nodeWidth, nodeHeight); + } + + if (usePaths) { + context.fill(path); + } else { + context.fill(); + } + }; + + var drawImages = function drawImages() { + var nodeOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : parentOpacity; + + var prevBging = _p.backgrounding; + var totalCompleted = 0; + + for (var _i = 0; _i < image.length; _i++) { + if (urlDefined[_i] && image[_i].complete && !image[_i].error) { + totalCompleted++; + r.drawInscribedImage(context, image[_i], node, _i, nodeOpacity); + } + } + + _p.backgrounding = !(totalCompleted === numImages); + if (prevBging !== _p.backgrounding) { + // update style b/c :backgrounding state changed + node.updateStyle(false); + } + }; + + var drawPie = function drawPie() { + var redrawShape = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + var pieOpacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : parentOpacity; + + if (r.hasPie(node)) { + r.drawPie(context, node, pieOpacity); + + // redraw/restore path if steps after pie need it + if (redrawShape) { + + if (!usePaths) { + r.nodeShapes[r.getNodeShape(node)].draw(context, pos.x, pos.y, nodeWidth, nodeHeight); + } + } + } + }; + + var darken = function darken() { + var darkenOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : parentOpacity; + + var opacity = (darkness > 0 ? darkness : -darkness) * darkenOpacity; + var c = darkness > 0 ? 0 : 255; + + if (darkness !== 0) { + r.fillStyle(context, c, c, c, opacity); + + if (usePaths) { + context.fill(path); + } else { + context.fill(); + } + } + }; + + var drawBorder = function drawBorder() { + if (borderWidth > 0) { + + context.lineWidth = borderWidth; + context.lineCap = 'butt'; + + if (context.setLineDash) { + // for very outofdate browsers + switch (borderStyle) { + case 'dotted': + context.setLineDash([1, 1]); + break; + + case 'dashed': + context.setLineDash([4, 2]); + break; + + case 'solid': + case 'double': + context.setLineDash([]); + break; + } + } + + if (usePaths) { + context.stroke(path); + } else { + context.stroke(); + } + + if (borderStyle === 'double') { + context.lineWidth = borderWidth / 3; + + var gco = context.globalCompositeOperation; + context.globalCompositeOperation = 'destination-out'; + + if (usePaths) { + context.stroke(path); + } else { + context.stroke(); + } + + context.globalCompositeOperation = gco; + } + + // reset in case we changed the border style + if (context.setLineDash) { + // for very outofdate browsers + context.setLineDash([]); + } + } + }; + + var drawOverlay = function drawOverlay() { + var overlayPadding = node.pstyle('overlay-padding').pfValue; + var overlayOpacity = node.pstyle('overlay-opacity').value; + var overlayColor = node.pstyle('overlay-color').value; + + if (overlayOpacity > 0) { + r.fillStyle(context, overlayColor[0], overlayColor[1], overlayColor[2], overlayOpacity); + + r.nodeShapes['roundrectangle'].draw(context, pos.x, pos.y, nodeWidth + overlayPadding * 2, nodeHeight + overlayPadding * 2); + + context.fill(); + } + }; + + var drawText = function drawText() { + r.drawElementText(context, node, drawLabel); + }; + + var ghost = node.pstyle('ghost').value === 'yes'; + + if (ghost) { + var gx = node.pstyle('ghost-offset-x').pfValue; + var gy = node.pstyle('ghost-offset-y').pfValue; + var ghostOpacity = node.pstyle('ghost-opacity').value; + var effGhostOpacity = ghostOpacity * parentOpacity; + + context.translate(gx, gy); + + setupShapeColor(ghostOpacity * bgOpacity); + drawShape(); + drawImages(effGhostOpacity); + drawPie(darkness !== 0 || borderWidth !== 0); + darken(effGhostOpacity); + setupBorderColor(ghostOpacity * borderOpacity); + drawBorder(); + + context.translate(-gx, -gy); + } + + setupShapeColor(); + drawShape(); + drawImages(); + drawPie(darkness !== 0 || borderWidth !== 0); + darken(); + setupBorderColor(); + drawBorder(); + + if (usePaths) { + context.translate(-pos.x, -pos.y); + } + + drawText(); + drawOverlay(); + + // + // clean up shift + + if (shiftToOriginWithBb) { + context.translate(bb.x1, bb.y1); + } +}; + +// does the node have at least one pie piece? +CRp.hasPie = function (node) { + node = node[0]; // ensure ele ref + + return node._private.hasPie; +}; + +CRp.drawPie = function (context, node, nodeOpacity, pos) { + node = node[0]; // ensure ele ref + pos = pos || node.position(); + + var cyStyle = node.cy().style(); + var pieSize = node.pstyle('pie-size'); + var x = pos.x; + var y = pos.y; + var nodeW = node.width(); + var nodeH = node.height(); + var radius = Math.min(nodeW, nodeH) / 2; // must fit in node + var lastPercent = 0; // what % to continue drawing pie slices from on [0, 1] + var usePaths = this.usePaths(); + + if (usePaths) { + x = 0; + y = 0; + } + + if (pieSize.units === '%') { + radius = radius * pieSize.pfValue; + } else if (pieSize.pfValue !== undefined) { + radius = pieSize.pfValue / 2; + } + + for (var i = 1; i <= cyStyle.pieBackgroundN; i++) { + // 1..N + var size = node.pstyle('pie-' + i + '-background-size').value; + var color = node.pstyle('pie-' + i + '-background-color').value; + var opacity = node.pstyle('pie-' + i + '-background-opacity').value * nodeOpacity; + var percent = size / 100; // map integer range [0, 100] to [0, 1] + + // percent can't push beyond 1 + if (percent + lastPercent > 1) { + percent = 1 - lastPercent; + } + + var angleStart = 1.5 * Math.PI + 2 * Math.PI * lastPercent; // start at 12 o'clock and go clockwise + var angleDelta = 2 * Math.PI * percent; + var angleEnd = angleStart + angleDelta; + + // ignore if + // - zero size + // - we're already beyond the full circle + // - adding the current slice would go beyond the full circle + if (size === 0 || lastPercent >= 1 || lastPercent + percent > 1) { + continue; + } + + context.beginPath(); + context.moveTo(x, y); + context.arc(x, y, radius, angleStart, angleEnd); + context.closePath(); + + this.fillStyle(context, color[0], color[1], color[2], opacity); + + context.fill(); + + lastPercent += percent; + } +}; + +module.exports = CRp; + +/***/ }), +/* 133 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var CRp = {}; + +var util = __webpack_require__(1); + +var motionBlurDelay = 100; + +// var isFirefox = typeof InstallTrigger !== 'undefined'; + +CRp.getPixelRatio = function () { + var context = this.data.contexts[0]; + + if (this.forcedPixelRatio != null) { + return this.forcedPixelRatio; + } + + var backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1; + + return (window.devicePixelRatio || 1) / backingStore; // eslint-disable-line no-undef +}; + +CRp.paintCache = function (context) { + var caches = this.paintCaches = this.paintCaches || []; + var needToCreateCache = true; + var cache; + + for (var i = 0; i < caches.length; i++) { + cache = caches[i]; + + if (cache.context === context) { + needToCreateCache = false; + break; + } + } + + if (needToCreateCache) { + cache = { + context: context + }; + caches.push(cache); + } + + return cache; +}; + +CRp.fillStyle = function (context, r, g, b, a) { + context.fillStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; + + // turn off for now, seems context does its own caching + + // var cache = this.paintCache(context); + + // var fillStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; + + // if( cache.fillStyle !== fillStyle ){ + // context.fillStyle = cache.fillStyle = fillStyle; + // } +}; + +CRp.strokeStyle = function (context, r, g, b, a) { + context.strokeStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; + + // turn off for now, seems context does its own caching + + // var cache = this.paintCache(context); + + // var strokeStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; + + // if( cache.strokeStyle !== strokeStyle ){ + // context.strokeStyle = cache.strokeStyle = strokeStyle; + // } +}; + +// Resize canvas +CRp.matchCanvasSize = function (container) { + var r = this; + var data = r.data; + var bb = r.findContainerClientCoords(); + var width = bb[2]; + var height = bb[3]; + var pixelRatio = r.getPixelRatio(); + var mbPxRatio = r.motionBlurPxRatio; + + if (container === r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_NODE] || container === r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_DRAG]) { + pixelRatio = mbPxRatio; + } + + var canvasWidth = width * pixelRatio; + var canvasHeight = height * pixelRatio; + var canvas; + + if (canvasWidth === r.canvasWidth && canvasHeight === r.canvasHeight) { + return; // save cycles if same + } + + r.fontCaches = null; // resizing resets the style + + var canvasContainer = data.canvasContainer; + canvasContainer.style.width = width + 'px'; + canvasContainer.style.height = height + 'px'; + + for (var i = 0; i < r.CANVAS_LAYERS; i++) { + canvas = data.canvases[i]; + + canvas.width = canvasWidth; + canvas.height = canvasHeight; + + canvas.style.width = width + 'px'; + canvas.style.height = height + 'px'; + } + + for (var i = 0; i < r.BUFFER_COUNT; i++) { + canvas = data.bufferCanvases[i]; + + canvas.width = canvasWidth; + canvas.height = canvasHeight; + + canvas.style.width = width + 'px'; + canvas.style.height = height + 'px'; + } + + r.textureMult = 1; + if (pixelRatio <= 1) { + canvas = data.bufferCanvases[r.TEXTURE_BUFFER]; + + r.textureMult = 2; + canvas.width = canvasWidth * r.textureMult; + canvas.height = canvasHeight * r.textureMult; + } + + r.canvasWidth = canvasWidth; + r.canvasHeight = canvasHeight; +}; + +CRp.renderTo = function (cxt, zoom, pan, pxRatio) { + this.render({ + forcedContext: cxt, + forcedZoom: zoom, + forcedPan: pan, + drawAllLayers: true, + forcedPxRatio: pxRatio + }); +}; + +CRp.render = function (options) { + options = options || util.staticEmptyObject(); + + var forcedContext = options.forcedContext; + var drawAllLayers = options.drawAllLayers; + var drawOnlyNodeLayer = options.drawOnlyNodeLayer; + var forcedZoom = options.forcedZoom; + var forcedPan = options.forcedPan; + var r = this; + var pixelRatio = options.forcedPxRatio === undefined ? this.getPixelRatio() : options.forcedPxRatio; + var cy = r.cy;var data = r.data; + var needDraw = data.canvasNeedsRedraw; + var textureDraw = r.textureOnViewport && !forcedContext && (r.pinching || r.hoverData.dragging || r.swipePanning || r.data.wheelZooming); + var motionBlur = options.motionBlur !== undefined ? options.motionBlur : r.motionBlur; + var mbPxRatio = r.motionBlurPxRatio; + var hasCompoundNodes = cy.hasCompoundNodes(); + var inNodeDragGesture = r.hoverData.draggingEles; + var inBoxSelection = r.hoverData.selecting || r.touchData.selecting ? true : false; + motionBlur = motionBlur && !forcedContext && r.motionBlurEnabled && !inBoxSelection; + var motionBlurFadeEffect = motionBlur; + + if (!forcedContext) { + if (r.prevPxRatio !== pixelRatio) { + r.invalidateContainerClientCoordsCache(); + r.matchCanvasSize(r.container); + + r.redrawHint('eles', true); + r.redrawHint('drag', true); + } + + r.prevPxRatio = pixelRatio; + } + + if (!forcedContext && r.motionBlurTimeout) { + clearTimeout(r.motionBlurTimeout); + } + + if (motionBlur) { + if (r.mbFrames == null) { + r.mbFrames = 0; + } + + r.mbFrames++; + + if (r.mbFrames < 3) { + // need several frames before even high quality motionblur + motionBlurFadeEffect = false; + } + + // go to lower quality blurry frames when several m/b frames have been rendered (avoids flashing) + if (r.mbFrames > r.minMbLowQualFrames) { + //r.fullQualityMb = false; + r.motionBlurPxRatio = r.mbPxRBlurry; + } + } + + if (r.clearingMotionBlur) { + r.motionBlurPxRatio = 1; + } + + // b/c drawToContext() may be async w.r.t. redraw(), keep track of last texture frame + // because a rogue async texture frame would clear needDraw + if (r.textureDrawLastFrame && !textureDraw) { + needDraw[r.NODE] = true; + needDraw[r.SELECT_BOX] = true; + } + + var coreStyle = cy.style()._private.coreStyle; + + var zoom = cy.zoom(); + var effectiveZoom = forcedZoom !== undefined ? forcedZoom : zoom; + var pan = cy.pan(); + var effectivePan = { + x: pan.x, + y: pan.y + }; + + var vp = { + zoom: zoom, + pan: { + x: pan.x, + y: pan.y + } + }; + var prevVp = r.prevViewport; + var viewportIsDiff = prevVp === undefined || vp.zoom !== prevVp.zoom || vp.pan.x !== prevVp.pan.x || vp.pan.y !== prevVp.pan.y; + + // we want the low quality motionblur only when the viewport is being manipulated etc (where it's not noticed) + if (!viewportIsDiff && !(inNodeDragGesture && !hasCompoundNodes)) { + r.motionBlurPxRatio = 1; + } + + if (forcedPan) { + effectivePan = forcedPan; + } + + // apply pixel ratio + + effectiveZoom *= pixelRatio; + effectivePan.x *= pixelRatio; + effectivePan.y *= pixelRatio; + + var eles = r.getCachedZSortedEles(); + + function mbclear(context, x, y, w, h) { + var gco = context.globalCompositeOperation; + + context.globalCompositeOperation = 'destination-out'; + r.fillStyle(context, 255, 255, 255, r.motionBlurTransparency); + context.fillRect(x, y, w, h); + + context.globalCompositeOperation = gco; + } + + function setContextTransform(context, clear) { + var ePan, eZoom, w, h; + + if (!r.clearingMotionBlur && (context === data.bufferContexts[r.MOTIONBLUR_BUFFER_NODE] || context === data.bufferContexts[r.MOTIONBLUR_BUFFER_DRAG])) { + ePan = { + x: pan.x * mbPxRatio, + y: pan.y * mbPxRatio + }; + + eZoom = zoom * mbPxRatio; + + w = r.canvasWidth * mbPxRatio; + h = r.canvasHeight * mbPxRatio; + } else { + ePan = effectivePan; + eZoom = effectiveZoom; + + w = r.canvasWidth; + h = r.canvasHeight; + } + + context.setTransform(1, 0, 0, 1, 0, 0); + + if (clear === 'motionBlur') { + mbclear(context, 0, 0, w, h); + } else if (!forcedContext && (clear === undefined || clear)) { + context.clearRect(0, 0, w, h); + } + + if (!drawAllLayers) { + context.translate(ePan.x, ePan.y); + context.scale(eZoom, eZoom); + } + if (forcedPan) { + context.translate(forcedPan.x, forcedPan.y); + } + if (forcedZoom) { + context.scale(forcedZoom, forcedZoom); + } + } + + if (!textureDraw) { + r.textureDrawLastFrame = false; + } + + if (textureDraw) { + r.textureDrawLastFrame = true; + + var bb; + + if (!r.textureCache) { + r.textureCache = {}; + + bb = r.textureCache.bb = cy.mutableElements().boundingBox(); + + r.textureCache.texture = r.data.bufferCanvases[r.TEXTURE_BUFFER]; + + var cxt = r.data.bufferContexts[r.TEXTURE_BUFFER]; + + cxt.setTransform(1, 0, 0, 1, 0, 0); + cxt.clearRect(0, 0, r.canvasWidth * r.textureMult, r.canvasHeight * r.textureMult); + + r.render({ + forcedContext: cxt, + drawOnlyNodeLayer: true, + forcedPxRatio: pixelRatio * r.textureMult + }); + + var vp = r.textureCache.viewport = { + zoom: cy.zoom(), + pan: cy.pan(), + width: r.canvasWidth, + height: r.canvasHeight + }; + + vp.mpan = { + x: (0 - vp.pan.x) / vp.zoom, + y: (0 - vp.pan.y) / vp.zoom + }; + } + + needDraw[r.DRAG] = false; + needDraw[r.NODE] = false; + + var context = data.contexts[r.NODE]; + + var texture = r.textureCache.texture; + var vp = r.textureCache.viewport; + bb = r.textureCache.bb; + + context.setTransform(1, 0, 0, 1, 0, 0); + + if (motionBlur) { + mbclear(context, 0, 0, vp.width, vp.height); + } else { + context.clearRect(0, 0, vp.width, vp.height); + } + + var outsideBgColor = coreStyle['outside-texture-bg-color'].value; + var outsideBgOpacity = coreStyle['outside-texture-bg-opacity'].value; + r.fillStyle(context, outsideBgColor[0], outsideBgColor[1], outsideBgColor[2], outsideBgOpacity); + context.fillRect(0, 0, vp.width, vp.height); + + var zoom = cy.zoom(); + + setContextTransform(context, false); + + context.clearRect(vp.mpan.x, vp.mpan.y, vp.width / vp.zoom / pixelRatio, vp.height / vp.zoom / pixelRatio); + context.drawImage(texture, vp.mpan.x, vp.mpan.y, vp.width / vp.zoom / pixelRatio, vp.height / vp.zoom / pixelRatio); + } else if (r.textureOnViewport && !forcedContext) { + // clear the cache since we don't need it + r.textureCache = null; + } + + var extent = cy.extent(); + var vpManip = r.pinching || r.hoverData.dragging || r.swipePanning || r.data.wheelZooming || r.hoverData.draggingEles; + var hideEdges = r.hideEdgesOnViewport && vpManip; + + var needMbClear = []; + + needMbClear[r.NODE] = !needDraw[r.NODE] && motionBlur && !r.clearedForMotionBlur[r.NODE] || r.clearingMotionBlur; + if (needMbClear[r.NODE]) { + r.clearedForMotionBlur[r.NODE] = true; + } + + needMbClear[r.DRAG] = !needDraw[r.DRAG] && motionBlur && !r.clearedForMotionBlur[r.DRAG] || r.clearingMotionBlur; + if (needMbClear[r.DRAG]) { + r.clearedForMotionBlur[r.DRAG] = true; + } + + if (needDraw[r.NODE] || drawAllLayers || drawOnlyNodeLayer || needMbClear[r.NODE]) { + var useBuffer = motionBlur && !needMbClear[r.NODE] && mbPxRatio !== 1; + var context = forcedContext || (useBuffer ? r.data.bufferContexts[r.MOTIONBLUR_BUFFER_NODE] : data.contexts[r.NODE]); + var clear = motionBlur && !useBuffer ? 'motionBlur' : undefined; + + setContextTransform(context, clear); + + if (hideEdges) { + r.drawCachedNodes(context, eles.nondrag, pixelRatio, extent); + } else { + r.drawLayeredElements(context, eles.nondrag, pixelRatio, extent); + } + + if (r.debug) { + r.drawDebugPoints(context, eles.nondrag); + } + + if (!drawAllLayers && !motionBlur) { + needDraw[r.NODE] = false; + } + } + + if (!drawOnlyNodeLayer && (needDraw[r.DRAG] || drawAllLayers || needMbClear[r.DRAG])) { + var useBuffer = motionBlur && !needMbClear[r.DRAG] && mbPxRatio !== 1; + var context = forcedContext || (useBuffer ? r.data.bufferContexts[r.MOTIONBLUR_BUFFER_DRAG] : data.contexts[r.DRAG]); + + setContextTransform(context, motionBlur && !useBuffer ? 'motionBlur' : undefined); + + if (hideEdges) { + r.drawCachedNodes(context, eles.drag, pixelRatio, extent); + } else { + r.drawCachedElements(context, eles.drag, pixelRatio, extent); + } + + if (r.debug) { + r.drawDebugPoints(context, eles.drag); + } + + if (!drawAllLayers && !motionBlur) { + needDraw[r.DRAG] = false; + } + } + + if (r.showFps || !drawOnlyNodeLayer && needDraw[r.SELECT_BOX] && !drawAllLayers) { + var context = forcedContext || data.contexts[r.SELECT_BOX]; + + setContextTransform(context); + + if (r.selection[4] == 1 && (r.hoverData.selecting || r.touchData.selecting)) { + var zoom = r.cy.zoom(); + var borderWidth = coreStyle['selection-box-border-width'].value / zoom; + + context.lineWidth = borderWidth; + context.fillStyle = 'rgba(' + coreStyle['selection-box-color'].value[0] + ',' + coreStyle['selection-box-color'].value[1] + ',' + coreStyle['selection-box-color'].value[2] + ',' + coreStyle['selection-box-opacity'].value + ')'; + + context.fillRect(r.selection[0], r.selection[1], r.selection[2] - r.selection[0], r.selection[3] - r.selection[1]); + + if (borderWidth > 0) { + context.strokeStyle = 'rgba(' + coreStyle['selection-box-border-color'].value[0] + ',' + coreStyle['selection-box-border-color'].value[1] + ',' + coreStyle['selection-box-border-color'].value[2] + ',' + coreStyle['selection-box-opacity'].value + ')'; + + context.strokeRect(r.selection[0], r.selection[1], r.selection[2] - r.selection[0], r.selection[3] - r.selection[1]); + } + } + + if (data.bgActivePosistion && !r.hoverData.selecting) { + var zoom = r.cy.zoom(); + var pos = data.bgActivePosistion; + + context.fillStyle = 'rgba(' + coreStyle['active-bg-color'].value[0] + ',' + coreStyle['active-bg-color'].value[1] + ',' + coreStyle['active-bg-color'].value[2] + ',' + coreStyle['active-bg-opacity'].value + ')'; + + context.beginPath(); + context.arc(pos.x, pos.y, coreStyle['active-bg-size'].pfValue / zoom, 0, 2 * Math.PI); + context.fill(); + } + + var timeToRender = r.lastRedrawTime; + if (r.showFps && timeToRender) { + timeToRender = Math.round(timeToRender); + var fps = Math.round(1000 / timeToRender); + + context.setTransform(1, 0, 0, 1, 0, 0); + + context.fillStyle = 'rgba(255, 0, 0, 0.75)'; + context.strokeStyle = 'rgba(255, 0, 0, 0.75)'; + context.lineWidth = 1; + context.fillText('1 frame = ' + timeToRender + ' ms = ' + fps + ' fps', 0, 20); + + var maxFps = 60; + context.strokeRect(0, 30, 250, 20); + context.fillRect(0, 30, 250 * Math.min(fps / maxFps, 1), 20); + } + + if (!drawAllLayers) { + needDraw[r.SELECT_BOX] = false; + } + } + + // motionblur: blit rendered blurry frames + if (motionBlur && mbPxRatio !== 1) { + var cxtNode = data.contexts[r.NODE]; + var txtNode = r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_NODE]; + + var cxtDrag = data.contexts[r.DRAG]; + var txtDrag = r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_DRAG]; + + var drawMotionBlur = function drawMotionBlur(cxt, txt, needClear) { + cxt.setTransform(1, 0, 0, 1, 0, 0); + + if (needClear || !motionBlurFadeEffect) { + cxt.clearRect(0, 0, r.canvasWidth, r.canvasHeight); + } else { + mbclear(cxt, 0, 0, r.canvasWidth, r.canvasHeight); + } + + var pxr = mbPxRatio; + + cxt.drawImage(txt, // img + 0, 0, // sx, sy + r.canvasWidth * pxr, r.canvasHeight * pxr, // sw, sh + 0, 0, // x, y + r.canvasWidth, r.canvasHeight // w, h + ); + }; + + if (needDraw[r.NODE] || needMbClear[r.NODE]) { + drawMotionBlur(cxtNode, txtNode, needMbClear[r.NODE]); + needDraw[r.NODE] = false; + } + + if (needDraw[r.DRAG] || needMbClear[r.DRAG]) { + drawMotionBlur(cxtDrag, txtDrag, needMbClear[r.DRAG]); + needDraw[r.DRAG] = false; + } + } + + r.prevViewport = vp; + + if (r.clearingMotionBlur) { + r.clearingMotionBlur = false; + r.motionBlurCleared = true; + r.motionBlur = true; + } + + if (motionBlur) { + r.motionBlurTimeout = setTimeout(function () { + r.motionBlurTimeout = null; + + r.clearedForMotionBlur[r.NODE] = false; + r.clearedForMotionBlur[r.DRAG] = false; + r.motionBlur = false; + r.clearingMotionBlur = !textureDraw; + r.mbFrames = 0; + + needDraw[r.NODE] = true; + needDraw[r.DRAG] = true; + + r.redraw(); + }, motionBlurDelay); + } + + if (!forcedContext) { + cy.emit('render'); + } +}; + +module.exports = CRp; + +/***/ }), +/* 134 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var math = __webpack_require__(2); + +var CRp = {}; + +// @O Polygon drawing +CRp.drawPolygonPath = function (context, x, y, width, height, points) { + + var halfW = width / 2; + var halfH = height / 2; + + if (context.beginPath) { + context.beginPath(); + } + + context.moveTo(x + halfW * points[0], y + halfH * points[1]); + + for (var i = 1; i < points.length / 2; i++) { + context.lineTo(x + halfW * points[i * 2], y + halfH * points[i * 2 + 1]); + } + + context.closePath(); +}; + +// Round rectangle drawing +CRp.drawRoundRectanglePath = function (context, x, y, width, height) { + + var halfWidth = width / 2; + var halfHeight = height / 2; + var cornerRadius = math.getRoundRectangleRadius(width, height); + + if (context.beginPath) { + context.beginPath(); + } + + // Start at top middle + context.moveTo(x, y - halfHeight); + // Arc from middle top to right side + context.arcTo(x + halfWidth, y - halfHeight, x + halfWidth, y, cornerRadius); + // Arc from right side to bottom + context.arcTo(x + halfWidth, y + halfHeight, x, y + halfHeight, cornerRadius); + // Arc from bottom to left side + context.arcTo(x - halfWidth, y + halfHeight, x - halfWidth, y, cornerRadius); + // Arc from left side to topBorder + context.arcTo(x - halfWidth, y - halfHeight, x, y - halfHeight, cornerRadius); + // Join line + context.lineTo(x, y - halfHeight); + + context.closePath(); +}; + +CRp.drawBottomRoundRectanglePath = function (context, x, y, width, height) { + + var halfWidth = width / 2; + var halfHeight = height / 2; + var cornerRadius = math.getRoundRectangleRadius(width, height); + + if (context.beginPath) { + context.beginPath(); + } + + // Start at top middle + context.moveTo(x, y - halfHeight); + context.lineTo(x + halfWidth, y - halfHeight); + context.lineTo(x + halfWidth, y); + + context.arcTo(x + halfWidth, y + halfHeight, x, y + halfHeight, cornerRadius); + context.arcTo(x - halfWidth, y + halfHeight, x - halfWidth, y, cornerRadius); + + context.lineTo(x - halfWidth, y - halfHeight); + context.lineTo(x, y - halfHeight); + + context.closePath(); +}; + +CRp.drawCutRectanglePath = function (context, x, y, width, height) { + + var halfWidth = width / 2; + var halfHeight = height / 2; + var cornerLength = math.getCutRectangleCornerLength(); + + if (context.beginPath) { + context.beginPath(); + } + + context.moveTo(x - halfWidth + cornerLength, y - halfHeight); + + context.lineTo(x + halfWidth - cornerLength, y - halfHeight); + context.lineTo(x + halfWidth, y - halfHeight + cornerLength); + context.lineTo(x + halfWidth, y + halfHeight - cornerLength); + context.lineTo(x + halfWidth - cornerLength, y + halfHeight); + context.lineTo(x - halfWidth + cornerLength, y + halfHeight); + context.lineTo(x - halfWidth, y + halfHeight - cornerLength); + context.lineTo(x - halfWidth, y - halfHeight + cornerLength); + + context.closePath(); +}; + +CRp.drawBarrelPath = function (context, x, y, width, height) { + + var halfWidth = width / 2; + var halfHeight = height / 2; + + var xBegin = x - halfWidth; + var xEnd = x + halfWidth; + var yBegin = y - halfHeight; + var yEnd = y + halfHeight; + + var barrelCurveConstants = math.getBarrelCurveConstants(width, height); + var wOffset = barrelCurveConstants.widthOffset; + var hOffset = barrelCurveConstants.heightOffset; + var ctrlPtXOffset = barrelCurveConstants.ctrlPtOffsetPct * wOffset; + + if (context.beginPath) { + context.beginPath(); + } + + context.moveTo(xBegin, yBegin + hOffset); + + context.lineTo(xBegin, yEnd - hOffset); + context.quadraticCurveTo(xBegin + ctrlPtXOffset, yEnd, xBegin + wOffset, yEnd); + + context.lineTo(xEnd - wOffset, yEnd); + context.quadraticCurveTo(xEnd - ctrlPtXOffset, yEnd, xEnd, yEnd - hOffset); + + context.lineTo(xEnd, yBegin + hOffset); + context.quadraticCurveTo(xEnd - ctrlPtXOffset, yBegin, xEnd - wOffset, yBegin); + + context.lineTo(xBegin + wOffset, yBegin); + context.quadraticCurveTo(xBegin + ctrlPtXOffset, yBegin, xBegin, yBegin + hOffset); + + context.closePath(); +}; + +var sin0 = Math.sin(0); +var cos0 = Math.cos(0); + +var sin = {}; +var cos = {}; + +var ellipseStepSize = Math.PI / 40; + +for (var i = 0 * Math.PI; i < 2 * Math.PI; i += ellipseStepSize) { + sin[i] = Math.sin(i); + cos[i] = Math.cos(i); +} + +CRp.drawEllipsePath = function (context, centerX, centerY, width, height) { + if (context.beginPath) { + context.beginPath(); + } + + if (context.ellipse) { + context.ellipse(centerX, centerY, width / 2, height / 2, 0, 0, 2 * Math.PI); + } else { + var xPos, yPos; + var rw = width / 2; + var rh = height / 2; + for (var i = 0 * Math.PI; i < 2 * Math.PI; i += ellipseStepSize) { + xPos = centerX - rw * sin[i] * sin0 + rw * cos[i] * cos0; + yPos = centerY + rh * cos[i] * sin0 + rh * sin[i] * cos0; + + if (i === 0) { + context.moveTo(xPos, yPos); + } else { + context.lineTo(xPos, yPos); + } + } + } + + context.closePath(); +}; + +module.exports = CRp; + +/***/ }), +/* 135 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); + +var CRp = {}; + +CRp.createBuffer = function (w, h) { + var buffer = document.createElement('canvas'); // eslint-disable-line no-undef + buffer.width = w; + buffer.height = h; + + return [buffer, buffer.getContext('2d')]; +}; + +CRp.bufferCanvasImage = function (options) { + var cy = this.cy; + var eles = cy.mutableElements(); + var bb = eles.boundingBox(); + var ctrRect = this.findContainerClientCoords(); + var width = options.full ? Math.ceil(bb.w) : ctrRect[2]; + var height = options.full ? Math.ceil(bb.h) : ctrRect[3]; + var specdMaxDims = is.number(options.maxWidth) || is.number(options.maxHeight); + var pxRatio = this.getPixelRatio(); + var scale = 1; + + if (options.scale !== undefined) { + width *= options.scale; + height *= options.scale; + + scale = options.scale; + } else if (specdMaxDims) { + var maxScaleW = Infinity; + var maxScaleH = Infinity; + + if (is.number(options.maxWidth)) { + maxScaleW = scale * options.maxWidth / width; + } + + if (is.number(options.maxHeight)) { + maxScaleH = scale * options.maxHeight / height; + } + + scale = Math.min(maxScaleW, maxScaleH); + + width *= scale; + height *= scale; + } + + if (!specdMaxDims) { + width *= pxRatio; + height *= pxRatio; + scale *= pxRatio; + } + + var buffCanvas = document.createElement('canvas'); // eslint-disable-line no-undef + + buffCanvas.width = width; + buffCanvas.height = height; + + buffCanvas.style.width = width + 'px'; + buffCanvas.style.height = height + 'px'; + + var buffCxt = buffCanvas.getContext('2d'); + + // Rasterize the layers, but only if container has nonzero size + if (width > 0 && height > 0) { + + buffCxt.clearRect(0, 0, width, height); + + buffCxt.globalCompositeOperation = 'source-over'; + + var zsortedEles = this.getCachedZSortedEles(); + + if (options.full) { + // draw the full bounds of the graph + buffCxt.translate(-bb.x1 * scale, -bb.y1 * scale); + buffCxt.scale(scale, scale); + + this.drawElements(buffCxt, zsortedEles); + + buffCxt.scale(1 / scale, 1 / scale); + buffCxt.translate(bb.x1 * scale, bb.y1 * scale); + } else { + // draw the current view + var pan = cy.pan(); + + var translation = { + x: pan.x * scale, + y: pan.y * scale + }; + + scale *= cy.zoom(); + + buffCxt.translate(translation.x, translation.y); + buffCxt.scale(scale, scale); + + this.drawElements(buffCxt, zsortedEles); + + buffCxt.scale(1 / scale, 1 / scale); + buffCxt.translate(-translation.x, -translation.y); + } + + // need to fill bg at end like this in order to fill cleared transparent pixels in jpgs + if (options.bg) { + buffCxt.globalCompositeOperation = 'destination-over'; + + buffCxt.fillStyle = options.bg; + buffCxt.rect(0, 0, width, height); + buffCxt.fill(); + } + } + + return buffCanvas; +}; + +function b64ToBlob(b64, mimeType) { + var bytes = atob(b64); + var buff = new ArrayBuffer(bytes.length); + var buffUint8 = new Uint8Array(buff); + + for (var i = 0; i < bytes.length; i++) { + buffUint8[i] = bytes.charCodeAt(i); + } + + return new Blob([buff], { type: mimeType }); +} + +function b64UriToB64(b64uri) { + var i = b64uri.indexOf(','); + + return b64uri.substr(i + 1); +}; + +function output(options, canvas, mimeType) { + var b64Uri = canvas.toDataURL(mimeType, options.quality); + + switch (options.output) { + case 'blob': + return b64ToBlob(b64UriToB64(b64Uri), mimeType); + + case 'base64': + return b64UriToB64(b64Uri); + + case 'base64uri': + default: + return b64Uri; + } +} + +CRp.png = function (options) { + return output(options, this.bufferCanvasImage(options), 'image/png'); +}; + +CRp.jpg = function (options) { + return output(options, this.bufferCanvasImage(options), 'image/jpeg'); +}; + +module.exports = CRp; + +/***/ }), +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var CRp = {}; + +CRp.nodeShapeImpl = function (name, context, centerX, centerY, width, height, points) { + switch (name) { + case 'ellipse': + return this.drawEllipsePath(context, centerX, centerY, width, height); + case 'polygon': + return this.drawPolygonPath(context, centerX, centerY, width, height, points); + case 'roundrectangle': + return this.drawRoundRectanglePath(context, centerX, centerY, width, height); + case 'cutrectangle': + return this.drawCutRectanglePath(context, centerX, centerY, width, height); + case 'bottomroundrectangle': + return this.drawBottomRoundRectanglePath(context, centerX, centerY, width, height); + case 'barrel': + return this.drawBarrelPath(context, centerX, centerY, width, height); + } +}; + +module.exports = CRp; + +/***/ }), +/* 137 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var is = __webpack_require__(0); +var util = __webpack_require__(1); +var Style = __webpack_require__(18); + +// a dummy stylesheet object that doesn't need a reference to the core +// (useful for init) +var Stylesheet = function Stylesheet() { + if (!(this instanceof Stylesheet)) { + return new Stylesheet(); + } + + this.length = 0; +}; + +var sheetfn = Stylesheet.prototype; + +sheetfn.instanceString = function () { + return 'stylesheet'; +}; + +// just store the selector to be parsed later +sheetfn.selector = function (selector) { + var i = this.length++; + + this[i] = { + selector: selector, + properties: [] + }; + + return this; // chaining +}; + +// just store the property to be parsed later +sheetfn.css = function (name, value) { + var i = this.length - 1; + + if (is.string(name)) { + this[i].properties.push({ + name: name, + value: value + }); + } else if (is.plainObject(name)) { + var map = name; + + for (var j = 0; j < Style.properties.length; j++) { + var prop = Style.properties[j]; + var mapVal = map[prop.name]; + + if (mapVal === undefined) { + // also try camel case name + mapVal = map[util.dash2camel(prop.name)]; + } + + if (mapVal !== undefined) { + var _name = prop.name; + var _value = mapVal; + + this[i].properties.push({ + name: _name, + value: _value + }); + } + } + } + + return this; // chaining +}; + +sheetfn.style = sheetfn.css; + +// generate a real style object from the dummy stylesheet +sheetfn.generateStyle = function (cy) { + var style = new Style(cy); + + return this.appendToStyle(style); +}; + +// append a dummy stylesheet object on a real style object +sheetfn.appendToStyle = function (style) { + for (var i = 0; i < this.length; i++) { + var context = this[i]; + var selector = context.selector; + var props = context.properties; + + style.selector(selector); // apply selector + + for (var j = 0; j < props.length; j++) { + var prop = props[j]; + + style.css(prop.name, prop.value); // apply property + } + } + + return style; +}; + +module.exports = Stylesheet; + +/***/ }), +/* 138 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = "3.2.18"; + +/***/ }) +/******/ ]); +}); \ No newline at end of file diff --git a/node_modules/cytoscape/dist/cytoscape.min.js b/node_modules/cytoscape/dist/cytoscape.min.js new file mode 100644 index 000000000..8e7257c14 --- /dev/null +++ b/node_modules/cytoscape/dist/cytoscape.min.js @@ -0,0 +1,10 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.cytoscape=t():e.cytoscape=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=20)}([function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=n(3),a=i?i.navigator:null,o=i?i.document:null,s=r(""),l=r({}),u=r(function(){}),c="undefined"==typeof HTMLElement?"undefined":r(HTMLElement),d=function(e){return e&&e.instanceString&&h.fn(e.instanceString)?e.instanceString():null},h={defined:function(e){return null!=e},string:function(e){return null!=e&&(void 0===e?"undefined":r(e))==s},fn:function(e){return null!=e&&(void 0===e?"undefined":r(e))===u},array:function(e){return Array.isArray?Array.isArray(e):null!=e&&e instanceof Array},plainObject:function(e){return null!=e&&(void 0===e?"undefined":r(e))===l&&!h.array(e)&&e.constructor===Object},object:function(e){return null!=e&&(void 0===e?"undefined":r(e))===l},number:function(e){return null!=e&&(void 0===e?"undefined":r(e))===r(1)&&!isNaN(e)},integer:function(e){return h.number(e)&&Math.floor(e)===e},bool:function(e){return null!=e&&(void 0===e?"undefined":r(e))===r(!0)},htmlElement:function(e){return"undefined"===c?void 0:null!=e&&e instanceof HTMLElement},elementOrCollection:function(e){return h.element(e)||h.collection(e)},element:function(e){return"collection"===d(e)&&e._private.single},collection:function(e){return"collection"===d(e)&&!e._private.single},core:function(e){return"core"===d(e)},style:function(e){return"style"===d(e)},stylesheet:function(e){return"stylesheet"===d(e)},event:function(e){return"event"===d(e)},thread:function(e){return"thread"===d(e)},fabric:function(e){return"fabric"===d(e)},emptyString:function(e){return void 0===e||null===e||!(""!==e&&!e.match(/^\s+$/))},nonemptyString:function(e){return!(!e||!h.string(e)||""===e||e.match(/^\s+$/))},domElement:function(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement},boundingBox:function(e){return h.plainObject(e)&&h.number(e.x1)&&h.number(e.x2)&&h.number(e.y1)&&h.number(e.y2)},promise:function(e){return h.object(e)&&h.fn(e.then)},touch:function(){return i&&("ontouchstart"in i||i.DocumentTouch&&o instanceof DocumentTouch)},gecko:function(){return i&&("undefined"!=typeof InstallTrigger||"MozAppearance"in o.documentElement.style)},webkit:function(){return i&&("undefined"!=typeof webkitURL||"WebkitAppearance"in o.documentElement.style)},chromium:function(){return i&&"undefined"!=typeof chrome},khtml:function(){return a&&a.vendor.match(/kde/i)},khtmlEtc:function(){return h.khtml()||h.webkit()||h.chromium()},ms:function(){return a&&a.userAgent.match(/msie|trident|edge/i)},windows:function(){return a&&a.appVersion.match(/Win/i)},mac:function(){return a&&a.appVersion.match(/Mac/i)},linux:function(){return a&&a.appVersion.match(/Linux/i)},unix:function(){return a&&a.appVersion.match(/X11/i)}};e.exports=h},function(e,t,n){"use strict";var r=n(0),i=n(2),a={MAX_INT:Number.MAX_SAFE_INTEGER||9007199254740991,trueify:function(){return!0},falsify:function(){return!1},zeroify:function(){return 0},noop:function(){},error:function(e){console.error?(console.error.apply(console,arguments),console.trace&&console.trace()):(console.log.apply(console,arguments),console.trace&&console.trace())},clone:function(e){return this.extend({},e)},copy:function(e){return null==e?e:r.array(e)?e.slice():r.plainObject(e)?this.clone(e):e},copyArray:function(e){return e.slice()},clonePosition:function(e){return{x:e.x,y:e.y}},uuid:function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t}};a.makeBoundingBox=i.makeBoundingBox.bind(i),a._staticEmptyObject={},a.staticEmptyObject=function(){return a._staticEmptyObject},a.extend=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n=0&&(e[r]!==t||(e.splice(r,1),n));r--);},a.clearArray=function(e){e.splice(0,e.length)},a.push=function(e,t){for(var n=0;n0?1:e<0?-1:0},r.dist=function(e,t){return Math.sqrt(r.sqdist(e,t))},r.sqdist=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},r.qbezierAt=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},r.qbezierPtAt=function(e,t,n,i){return{x:r.qbezierAt(e.x,t.x,n.x,i),y:r.qbezierAt(e.y,t.y,n.y,i)}},r.lineAt=function(e,t,n,i){var a={x:t.x-e.x,y:t.y-e.y},o=r.dist(e,t),s={x:a.x/o,y:a.y/o};return n=null==n?0:n,i=null!=i?i:n*o,{x:e.x+s.x*i,y:e.y+s.y*i}},r.lineAtDist=function(e,t,n){return r.lineAt(e,t,void 0,n)},r.triangleAngle=function(e,t,n){var i=r.dist(t,n),a=r.dist(e,n),o=r.dist(e,t);return Math.acos((i*i+a*a-o*o)/(2*i*a))},r.bound=function(e,t,n){return Math.max(e,Math.min(n,t))},r.makeBoundingBox=function(e){if(null==e)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(null!=e.x1&&null!=e.y1){if(null!=e.x2&&null!=e.y2&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},r.updateBoundingBox=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},r.expandBoundingBoxByPoint=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},r.expandBoundingBox=function(e,t){return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},r.boundingBoxesIntersect=function(e,t){return!(e.x1>t.x2)&&(!(t.x1>e.x2)&&(!(e.x2t.y2)&&!(t.y1>e.y2)))))))},r.inBoundingBox=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},r.pointInBoundingBox=function(e,t){return this.inBoundingBox(e,t.x,t.y)},r.boundingBoxInBoundingBox=function(e,t){return r.inBoundingBox(e,t.x1,t.y1)&&r.inBoundingBox(e,t.x2,t.y2)},r.roundRectangleIntersectLine=function(e,t,n,r,i,a,o){var s=this.getRoundRectangleRadius(i,a),l=i/2,u=a/2,c=void 0,d=n-l+s-o,h=r-u-o,p=n+l-s+o,f=h;if(c=this.finiteLinesIntersect(e,t,n,r,d,h,p,f,!1),c.length>0)return c;var v=n+l+o,g=r-u+s-o,y=v,m=r+u-s+o;if(c=this.finiteLinesIntersect(e,t,n,r,v,g,y,m,!1),c.length>0)return c;var b=n-l+s-o,x=r+u+o,w=n+l-s+o,E=x;if(c=this.finiteLinesIntersect(e,t,n,r,b,x,w,E,!1),c.length>0)return c;var P=n-l-o,C=r-u+s-o,S=P,T=r+u-s+o;if(c=this.finiteLinesIntersect(e,t,n,r,P,C,S,T,!1),c.length>0)return c;var D=void 0,k=n-l+s,_=r-u+s;if(D=this.intersectLineCircle(e,t,n,r,k,_,s+o),D.length>0&&D[0]<=k&&D[1]<=_)return[D[0],D[1]];var M=n+l-s,I=r-u+s;if(D=this.intersectLineCircle(e,t,n,r,M,I,s+o),D.length>0&&D[0]>=M&&D[1]<=I)return[D[0],D[1]];var N=n+l-s,B=r+u-s;if(D=this.intersectLineCircle(e,t,n,r,N,B,s+o),D.length>0&&D[0]>=N&&D[1]>=B)return[D[0],D[1]];var z=n-l+s,L=r+u-s;return D=this.intersectLineCircle(e,t,n,r,z,L,s+o),D.length>0&&D[0]<=z&&D[1]>=L?[D[0],D[1]]:[]},r.inLineVicinity=function(e,t,n,r,i,a,o){var s=o,l=Math.min(n,i),u=Math.max(n,i),c=Math.min(r,a),d=Math.max(r,a);return l-s<=e&&e<=u+s&&c-s<=t&&t<=d+s},r.inBezierVicinity=function(e,t,n,r,i,a,o,s,l){var u={x1:Math.min(n,o,i)-l,x2:Math.max(n,o,i)+l,y1:Math.min(r,s,a)-l,y2:Math.max(r,s,a)+l};return!(eu.x2||tu.y2)},r.solveQuadratic=function(e,t,n,r){n-=r;var i=t*t-4*e*n;if(i<0)return[];var a=Math.sqrt(i),o=2*e;return[(-t+a)/o,(-t-a)/o]},r.solveCubic=function(e,t,n,r,i){t/=e,n/=e,r/=e;var a=void 0,o=void 0,s=void 0,l=void 0,u=void 0,c=void 0,d=void 0,h=void 0;return o=(3*n-t*t)/9,s=-27*r+t*(9*n-t*t*2),s/=54,a=o*o*o+s*s,i[1]=0,d=t/3,a>0?(u=s+Math.sqrt(a),u=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),c=s-Math.sqrt(a),c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-d+u+c,d+=(u+c)/2,i[4]=i[2]=-d,d=Math.sqrt(3)*(-c+u)/2,i[3]=d,void(i[5]=-d)):(i[5]=i[3]=0,0===a?(h=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),i[0]=2*h-d,void(i[4]=i[2]=-(h+d))):(o=-o,l=o*o*o,l=Math.acos(s/Math.sqrt(l)),h=2*Math.sqrt(o),i[0]=-d+h*Math.cos(l/3),i[2]=-d+h*Math.cos((l+2*Math.PI)/3),void(i[4]=-d+h*Math.cos((l+4*Math.PI)/3))))},r.sqdistToQuadraticBezier=function(e,t,n,r,i,a,o,s){var l=1*n*n-4*n*i+2*n*o+4*i*i-4*i*o+o*o+r*r-4*r*a+2*r*s+4*a*a-4*a*s+s*s,u=9*n*i-3*n*n-3*n*o-6*i*i+3*i*o+9*r*a-3*r*r-3*r*s-6*a*a+3*a*s,c=3*n*n-6*n*i+n*o-n*e+2*i*i+2*i*e-o*e+3*r*r-6*r*a+r*s-r*t+2*a*a+2*a*t-s*t,d=1*n*i-n*n+n*e-i*e+r*a-r*r+r*t-a*t,h=[];this.solveCubic(l,u,c,d,h);for(var p=[],f=0;f<6;f+=2)Math.abs(h[f+1])<1e-7&&h[f]>=0&&h[f]<=1&&p.push(h[f]);p.push(1),p.push(0);for(var v=-1,g=void 0,y=void 0,m=void 0,b=0;b=0?ml?(e-i)*(e-i)+(t-a)*(t-a):u-d},r.pointInsidePolygonPoints=function(e,t,n){for(var r=void 0,i=void 0,a=void 0,o=void 0,s=0,l=0;l=e&&e>=a||r<=e&&e<=a))continue;(e-r)/(a-r)*(o-i)+i>t&&s++}return s%2!=0},r.pointInsidePolygon=function(e,t,n,i,a,o,s,l,u){var c=new Array(n.length),d=void 0;null!=l[0]?(d=Math.atan(l[1]/l[0]),l[0]<0?d+=Math.PI/2:d=-d-Math.PI/2):d=l;for(var h=Math.cos(-d),p=Math.sin(-d),f=0;f0){var g=this.expandPolygon(c,-u);v=this.joinLines(g)}else v=c;return r.pointInsidePolygonPoints(e,t,v)},r.joinLines=function(e){for(var t=new Array(e.length/2),n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,l=void 0,u=void 0,c=0;c=0&&v<=1&&y.push(v),g>=0&&g<=1&&y.push(g),0===y.length)return[];var m=y[0]*s[0]+e,b=y[0]*s[1]+t;if(y.length>1){if(y[0]==y[1])return[m,b];return[m,b,y[1]*s[0]+e,y[1]*s[1]+t]}return[m,b]},r.findCircleNearPoint=function(e,t,n,r,i){var a=r-e,o=i-t,s=Math.sqrt(a*a+o*o);return[e+a/s*n,t+o/s*n]},r.findMaxSqDistanceToOrigin=function(e){for(var t=1e-6,n=void 0,r=0;rt&&(t=n);return t},r.midOfThree=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},r.finiteLinesIntersect=function(e,t,n,r,i,a,o,s,l){var u=e-i,c=n-e,d=o-i,h=t-a,p=r-t,f=s-a,v=d*h-f*u,g=c*h-p*u,y=f*c-d*p;if(0!==y){var m=v/y,b=g/y;return-.001<=m&&m<=1.001&&-.001<=b&&b<=1.001?[e+m*c,t+m*p]:l?[e+m*c,t+m*p]:[]}return 0===v||0===g?this.midOfThree(e,n,o)===o?[o,s]:this.midOfThree(e,n,i)===i?[i,a]:this.midOfThree(i,o,n)===n?[n,r]:[]:[]},r.polygonIntersectLine=function(e,t,n,i,a,o,s,l){var u=[],c=void 0,d=new Array(n.length),h=!0;5===arguments.length&&(h=!1);var p=void 0;if(h){for(var f=0;f0){var v=r.expandPolygon(d,-l);p=r.joinLines(v)}else p=d}else p=n;for(var g=void 0,y=void 0,m=void 0,b=void 0,x=0;x "+t(r.target)),null!=r.connectedNodes){var h=r.connectedNodes;o=t(h[0])+" <-> "+t(h[1])}return null!=r.parent&&(o=t(r.parent)+" > "+o),null!=r.ancestor&&(o=t(r.ancestor)+" "+o),null!=r.child&&(o+=" > "+t(r.child)),null!=r.descendant&&(o+=" "+t(r.descendant)),o}(o),this.length>1&&e0&&i.plainObject(t[0])&&!i.element(t[0])){c=!0;for(var d=[],h=new o,p=0,f=t.length;p0){for(var R=new u(n,d),V=0;V0&&(e&&this.cy().notify({type:"remove",eles:E}),E.emit("remove"));for(var P=0;P=0;s--)!function(i){var s=o[i];c(a,function(e,t,n,r,a,l){if(s.type===n&&(!r||s.namespace===r)&&(!a||e.qualifierCompare(s.qualifier,a))&&(!l||s.callback===l))return o.splice(i,1),!1},e,t,n,r)}(s);return this},u.emit=u.trigger=function(e,t,n){var r=this.listeners,o=r.length;return this.emitting++,a.array(t)||(t=[t]),h(this,function(e,a){null!=n&&(r=[{event:a.event,type:a.type,namespace:a.namespace,callback:n}],o=r.length);for(var s=0;s0?d.wheelSensitivity:1,motionBlur:void 0!==d.motionBlur&&d.motionBlur,motionBlurOpacity:void 0===d.motionBlurOpacity?.05:d.motionBlurOpacity,pixelRatio:o.number(d.pixelRatio)&&d.pixelRatio>0?d.pixelRatio:void 0,desktopTapThreshold:void 0===d.desktopTapThreshold?4:d.desktopTapThreshold,touchTapThreshold:void 0===d.touchTapThreshold?8:d.touchTapThreshold},d.renderer));var v=function(e,n,r){t.notifications(!1);var a=t.mutableElements();a.length>0&&a.remove(),null!=e&&(o.plainObject(e)||o.array(e))&&t.add(e),t.one("layoutready",function(e){t.notifications(!0),t.emit(e),t.notify({type:"load",eles:t.mutableElements()}),t.one("load",n),t.emit("load")}).one("layoutstop",function(){t.one("done",r),t.emit("done")});var s=i.extend({},t._private.options.layout);s.eles=t.elements(),t.layout(s).run()};!function(e,t){if(e.some(o.promise))return s.all(e).then(t);t(e)}([d.style,d.elements],function(e){var n=e[0],r=e[1];p.styleEnabled&&t.style().append(n),v(r,function(){t.startAnimationLoop(),p.ready=!0,o.fn(d.ready)&&t.on("ready",d.ready);for(var e=0;e=e.deqFastCost*g)break}else if(a){if(f>=e.deqCost*u||f>=e.deqAvgCost*l)break}else if(v>=e.deqNoDrawCost*(1e3/60))break;var y=e.deq(t,h,d);if(!(y.length>0))break;for(var m=0;m0&&(e.onDeqd(t,c),!a&&e.shouldRedraw(t,c,h,d)&&i())},o=e.priority||r.noop;n.beforeRender(a,o(t))}}}}},function(e,t,n){"use strict";var r=n(0),i=n(12),a=n(95),o=n(137),s=function(e){return void 0===e&&(e={}),r.plainObject(e)?new i(e):r.string(e)?a.apply(a,arguments):void 0};s.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(s),e.apply(null,t),this},s.version=n(138),s.stylesheet=s.Stylesheet=o,e.exports=s},function(e,t,n){"use strict";var r=n(0);e.exports={hex2tuple:function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var t=4===e.length,n=void 0,r=void 0,i=void 0;return t?(n=parseInt(e[1]+e[1],16),r=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16)):(n=parseInt(e[1]+e[2],16),r=parseInt(e[3]+e[4],16),i=parseInt(e[5]+e[6],16)),[n,r,i]}},hsl2tuple:function(e){function t(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,l=void 0,u=void 0,c=new RegExp("^"+this.regex.hsla+"$").exec(e);if(c){if(r=parseInt(c[1]),r<0?r=(360- -1*r%360)%360:r>360&&(r%=360),r/=360,(i=parseFloat(c[2]))<0||i>100)return;if(i/=100,(a=parseFloat(c[3]))<0||a>100)return;if(a/=100,void 0!==(o=c[4])&&((o=parseFloat(o))<0||o>1))return;if(0===i)s=l=u=Math.round(255*a);else{var d=a<.5?a*(1+i):a+i-a*i,h=2*a-d;s=Math.round(255*t(h,d,r+1/3)),l=Math.round(255*t(h,d,r)),u=Math.round(255*t(h,d,r-1/3))}n=[s,l,u,o]}return n},rgb2tuple:function(e){var t=void 0,n=new RegExp("^"+this.regex.rgba+"$").exec(e);if(n){t=[];for(var r=[],i=1;i<=3;i++){var a=n[i];if("%"===a[a.length-1]&&(r[i]=!0),a=parseFloat(a),r[i]&&(a=a/100*255),a<0||a>255)return;t.push(Math.floor(a))}var o=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(o&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t},colorname2tuple:function(e){return this.colors[e.toLowerCase()]},color2tuple:function(e){return(r.array(e)?e:null)||this.colorname2tuple(e)||this.hex2tuple(e)||this.rgb2tuple(e)||this.hsl2tuple(e)},colors:{transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}},function(e,t,n){"use strict";var r=n(0);e.exports={mapEmpty:function(e){return null==e||0===Object.keys(e).length},pushMap:function(e){var t=this.getMap(e);null==t?this.setMap(this.extend({},e,{value:[e.value]})):t.push(e.value)},setMap:function(e){for(var t=e.map,n=e.keys,i=n.length,a=0;a=t||n<0||T&&r>=y}function c(){var e=E();if(u(e))return d(e);b=setTimeout(c,l(e))}function d(e){return b=void 0,D&&v?i(e):(v=g=void 0,m)}function h(){void 0!==b&&clearTimeout(b),C=0,v=P=g=b=void 0}function p(){return void 0===b?m:d(E())}function f(){var e=E(),n=u(e);if(v=arguments,g=this,P=e,n){if(void 0===b)return a(P);if(T)return b=setTimeout(c,t),i(P)}return void 0===b&&(b=setTimeout(c,t)),m}var v,g,y,m,b,P,C=0,S=!1,T=!1,D=!0;if("function"!=typeof e)throw new TypeError(s);return t=o(t)||0,r(n)&&(S=!!n.leading,T="maxWait"in n,y=T?x(o(n.maxWait)||0,t):y,D="trailing"in n?!!n.trailing:D),f.cancel=h,f.flush=p,f}function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==typeof e}function a(e){return"symbol"==typeof e||i(e)&&b.call(e)==u}function o(e){if("number"==typeof e)return e;if(a(e))return l;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(c,"");var n=h.test(e);return n||p.test(e)?f(e.slice(2),n?2:8):d.test(e)?l:+e}var s="Expected a function",l=NaN,u="[object Symbol]",c=/^\s+|\s+$/g,d=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,p=/^0o[0-7]+$/i,f=parseInt,v="object"==typeof global&&global&&global.Object===Object&&global,g="object"==typeof self&&self&&self.Object===Object&&self,y=v||g||Function("return this")(),m=Object.prototype,b=m.toString,x=Math.max,w=Math.min,E=function(){return y.Date.now()};e.exports=n},function(e,t,n){"use strict";function r(e,t){return et?1:0}function i(e,t){return-1*r(e,t)}e.exports={sort:{ascending:r,descending:i}}},function(e,t,n){"use strict";function r(){this._obj={}}var i=r.prototype;i.set=function(e,t){this._obj[e]=t},i.delete=function(e){this._obj[e]=null},i.has=function(e){return null!=this._obj[e]},i.get=function(e){return this._obj[e]},e.exports=r},function(e,t,n){"use strict";var r=n(1),i={};[n(30),n(31),n(34),n(35),n(36),n(37),n(38),n(39),n(40),n(41),n(42)].forEach(function(e){r.extend(i,e)}),e.exports=i},function(e,t,n){"use strict";var r=n(0),i=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,i){var a;r.plainObject(t)&&!r.elementOrCollection(t)&&(a=t,t=a.roots||a.root,n=a.visit,i=a.directed),i=2!==arguments.length||r.fn(n)?i:n,n=r.fn(n)?n:function(){};for(var o,s=this._private.cy,l=t=r.string(t)?this.filter(t):t,u=[],c=[],d={},h={},p={},f=0,v=this.nodes(),g=this.edges(),y=0;y0;){var y=f.pop(),m=p(y),b=y.id();if(c[b]=m,m!==1/0)for(var x=y.neighborhood().intersect(h),v=0;v0)for(n.unshift(t);u[i.id()];){var a=u[i.id()];n.unshift(a.edge),n.unshift(a.node),i=a.node}return o.collection(n)}}}};e.exports=a},function(e,t,n){e.exports=n(33)},function(e,t,n){var r,i,a;(function(){var n,o,s,l,u,c,d,h,p,f,v,g,y,m,b;s=Math.floor,f=Math.min,o=function(e,t){return et?1:0},p=function(e,t,n,r,i){var a;if(null==n&&(n=0),null==i&&(i=o),n<0)throw new Error("lo must be non-negative");for(null==r&&(r=e.length);nn;0<=n?t++:t--)u.push(t);return u}.apply(this).reverse(),l=[],r=0,i=a.length;rv;0<=v?++c:--c)g.push(u(e,n));return g},m=function(e,t,n,r){var i,a,s;for(null==r&&(r=o),i=e[n];n>t&&(s=n-1>>1,a=e[s],r(i,a)<0);)e[n]=a,n=s;return e[n]=i},b=function(e,t,n){var r,i,a,s,l;for(null==n&&(n=o),i=e.length,l=t,a=e[t],r=2*t+1;r0;){var m=function(e,t){if(0!==e.length){for(var n=0,r=t[e[0]],i=1;im&&(c[g][y]=m,p[g][y]=y,f[g][y]=a[u])}if(!i)for(var u=0;um&&(c[g][y]=m,p[g][y]=y,f[g][y]=a[u])}for(var b=0;bc&&(c=t)},get:function(e){return u[e]}},h=0;h0?S.edgesTo(C)[0]:C.edgesTo(S)[0];var T=n(P);C=C.id(),x[C]>x[p]+T&&(x[C]=x[p]+T,w.nodes.indexOf(C)<0?w.push(C):w.updateItem(C),b[C]=0,m[C]=[]),x[C]==x[p]+T&&(b[C]=b[C]+b[p],m[C].push(p))}else for(var E=0;E0;)for(var C=y.pop(),E=0;E0:void 0}},clearQueue:function(){return function(){var e=this,t=void 0!==e.length,n=t?e:[e];if(!(this._private.cy||this).styleEnabled())return this;for(var r=0;r0&&this.spawn(n).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){for(var n=e.match(/\S+/g)||[],r=this,i=[],a=0,o=r.length;a0&&this.spawn(i).updateStyle().emit("class"),r},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},t),n}};e.exports=i},function(e,t,n){"use strict";var r=(n(0),n(6)),i={allAre:function(e){var t=new r(e);return this.every(function(e){return t.matches(e)})},is:function(e){var t=new r(e);return this.some(function(e){return t.matches(e)})},some:function(e,t){for(var n=0;n\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:'"(?:\\\\"|[^"])*"|'+"'(?:\\\\'|[^'])*'",number:r.regex.number,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};i.variable="(?:[\\w-]|(?:\\\\"+i.metaChar+"))+",i.value=i.string+"|"+i.number,i.className=i.variable,i.id=i.variable,function(){var e=void 0,t=void 0,n=void 0;for(e=i.comparatorOp.split("|"),n=0;n=0||"="!==t&&(i.comparatorOp+="|\\!"+t)}(),e.exports=i},function(e,t,n){"use strict";var r=n(15),i=r.stateSelectorMatches,a=n(0),o=function(e,t){for(var n=!0,r=0;r=0&&(d=d.toLowerCase(),h=h.toLowerCase(),o=o.replace("@",""),p=!0);var f=!1;o.indexOf("!")>=0&&(o=o.replace("!",""),f=!0),p&&(s=h.toLowerCase(),c=d.toLowerCase());var v=!1;switch(o){case"*=":u=d.indexOf(h)>=0;break;case"$=":u=d.indexOf(h,d.length-h.length)>=0;break;case"^=":u=0===d.indexOf(h);break;case"=":u=c===s;break;case">":v=!0,u=c>s;break;case">=":v=!0,u=c>=s;break;case"<":v=!0,u=c0;){var d=i.shift();t(d),a.add(d.id()),l&&r(i,a,d)}return e}function i(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i1&&void 0!==arguments[1])||arguments[1],i)},l.forEachUp=function(e){return r(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a)},l.forEachUpAndDown=function(e){return r(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o)},l.ancestors=l.parents,e.exports=l},function(e,t,n){"use strict";var r=n(4),i=void 0,a=void 0;i=a={data:r.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:r.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:r.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:r.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:r.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:r.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},i.attr=i.data,i.removeAttr=i.removeData,e.exports=a},function(e,t,n){"use strict";function r(e){return function(t){var n=this;if(void 0===t&&(t=!0),0!==n.length&&n.isNode()&&!n.removed()){for(var r=0,i=n[0],a=i._private.edges,o=0;ot}),minIndegree:i("indegree",function(e,t){return et}),minOutdegree:i("outdegree",function(e,t){return et})}),a.extend(o,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r0,d=c;c&&(u=u[0]);var h=d?u.position():{x:0,y:0};return a={x:l.x-h.x,y:l.y-h.y},void 0===e?a:a[e]}for(var p=0;p0,y=g;g&&(v=v[0]);var m=y?v.position():{x:0,y:0};void 0!==t?f.position(e,t+m[e]):void 0!==a&&f.position({x:a.x+m.x,y:a.y+m.y})}}else if(!o)return;return this}},o.modelPosition=o.point=o.position,o.modelPositions=o.points=o.positions,o.renderedPoint=o.renderedPosition,o.relativePoint=o.relativePosition,e.exports=s},function(e,t,n){"use strict";function r(e){return{includeNodes:a.default(e.includeNodes,b.includeNodes),includeEdges:a.default(e.includeEdges,b.includeEdges),includeLabels:a.default(e.includeLabels,b.includeLabels),includeOverlays:a.default(e.includeOverlays,b.includeOverlays),useCache:a.default(e.useCache,b.useCache)}}var i=n(0),a=n(1),o=n(2),s=void 0,l=void 0;s=l={},l.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),a=t.x1*r+i.x,o=t.x2*r+i.x,s=t.y1*r+i.y,l=t.y2*r+i.y;return{x1:a,x2:o,y1:s,y2:l,w:o-a,h:l-s}},l.dirtyCompoundBoundsCache=function(){var e=this.cy();return e.styleEnabled()&&e.hasCompoundNodes()?(this.forEachUp(function(e){e._private.compoundBoundsClean=!1,e.isParent()&&e.emit("bounds")}),this):this},l.updateCompoundBounds=function(){var e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(e.batching())return this;for(var t=[],n=0;n0&&a>0&&(r=t/a*e,i=n/a*e),{biasDiff:r,biasComplementDiff:i}}if(e.isParent()){var r=e._private,i=e.children(),a="include"===e.pstyle("compound-sizing-wrt-labels").value,o={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}},s=i.boundingBox({includeLabels:a,includeOverlays:!1,useCache:!1}),l=r.position;0!==s.w&&0!==s.h||(s={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue},s.x1=l.x-s.w/2,s.x2=l.x+s.w/2,s.y1=l.y-s.h/2,s.y2=l.y+s.h/2);var u=o.width.left.value;"px"===o.width.left.units&&o.width.val>0&&(u=100*u/o.width.val);var c=o.width.right.value;"px"===o.width.right.units&&o.width.val>0&&(c=100*c/o.width.val);var d=o.height.top.value;"px"===o.height.top.units&&o.height.val>0&&(d=100*d/o.height.val);var h=o.height.bottom.value;"px"===o.height.bottom.units&&o.height.val>0&&(h=100*h/o.height.val);var p=n(o.width.val-s.w,u,c),f=p.biasDiff,v=p.biasComplementDiff,g=n(o.height.val-s.h,d,h),y=g.biasDiff,m=g.biasComplementDiff;r.autoPadding=function(e,t,n,r){if("%"!==n.units)return"px"===n.units?n.pfValue:0;switch(r){case"width":return e>0?n.pfValue*e:0;case"height":return t>0?n.pfValue*t:0;case"average":return e>0&&t>0?n.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case"max":return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}}(s.w,s.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),r.autoWidth=Math.max(s.w,o.width.val),l.x=(-f+s.x1+s.x2+v)/2,r.autoHeight=Math.max(s.h,o.height.val),l.y=(-y+s.y1+s.y2+m)/2,t.push(e)}}(r),e._private.batchingStyle||(i.compoundBoundsClean=!0))}return this};var u=function(e){return e===1/0||e===-1/0?0:e},c=function(e,t,n,r,i){r-t!=0&&i-n!=0&&null!=t&&null!=n&&null!=r&&null!=i&&(e.x1=te.x2?r:e.x2,e.y1=ne.y2?i:e.y2)},d=function(e,t){return c(e,t.x1,t.y1,t.x2,t.y2)},h=function(e,t,n){return a.getPrefixedProperty(e,t,n)},p=function(e,t,n){if(!t.cy().headless()){var r=t._private,i=r.rstyle,a=i.arrowWidth/2,o=t.pstyle(n+"-arrow-shape").value,s=void 0,l=void 0;"none"!==o&&("source"===n?(s=i.srcX,l=i.srcY):"target"===n?(s=i.tgtX,l=i.tgtY):(s=i.midX,l=i.midY),c(e,s-a,l-a,s+a,l+a))}},f=function(e,t,n){if(!t.cy().headless()){var r=void 0;r=n?n+"-":"";var i=t._private,a=i.rstyle;if(t.pstyle(r+"label").strValue){var o=t.pstyle("text-halign"),s=t.pstyle("text-valign"),l=h(a,"labelWidth",n),u=h(a,"labelHeight",n),d=h(a,"labelX",n),p=h(a,"labelY",n),f=t.pstyle(r+"text-margin-x").pfValue,v=t.pstyle(r+"text-margin-y").pfValue,g=t.isEdge(),y=t.pstyle(r+"text-rotation"),m=t.pstyle("text-outline-width").pfValue,b=t.pstyle("text-border-width").pfValue,x=b/2,w=t.pstyle("text-background-padding").pfValue,E=u+2*w,P=l+2*w,C=P/2,S=E/2,T=void 0,D=void 0,k=void 0,_=void 0;if(g)T=d-C,D=d+C,k=p-S,_=p+S;else{switch(o.value){case"left":T=d-P,D=d;break;case"center":T=d-C,D=d+C;break;case"right":T=d,D=d+P}switch(s.value){case"top":k=p-E,_=p;break;case"center":k=p-S,_=p+S;break;case"bottom":k=p,_=p+E}}var M=g&&"autorotate"===y.strValue,I=null!=y.pfValue&&0!==y.pfValue;if(M||I){var N=M?h(i.rstyle,"labelAngle",n):y.pfValue,B=Math.cos(N),z=Math.sin(N),L=function(e,t){return e-=d,t-=p,{x:e*B-t*z+d,y:e*z+t*B+p}},A=L(T,k),O=L(T,_),R=L(D,k),V=L(D,_);T=Math.min(A.x,O.x,R.x,V.x),D=Math.max(A.x,O.x,R.x,V.x),k=Math.min(A.y,O.y,R.y,V.y),_=Math.max(A.y,O.y,R.y,V.y)}T+=f-Math.max(m,x),D+=f+Math.max(m,x),k+=v-Math.max(m,x),_+=v+Math.max(m,x),c(e,T,k,D,_)}return e}},v=function(e,t){var n=e._private.cy,r=n.styleEnabled(),i=n.headless(),a={x1:1/0,y1:1/0,x2:-1/0,y2:-1/0},s=e._private,l=r?e.pstyle("display").value:"element",d=e.isNode(),h=e.isEdge(),v=void 0,g=void 0,y=void 0,m=void 0,b=void 0,x=void 0,w="none"!==l;if(w){var E=0;r&&t.includeOverlays&&0!==e.pstyle("overlay-opacity").value&&(E=e.pstyle("overlay-padding").value);var P=0,C=0;if(r&&(P=e.pstyle("width").pfValue,C=P/2),d&&t.includeNodes){var S=e.position();b=S.x,x=S.y;var T=e.outerWidth(),D=T/2,k=e.outerHeight(),_=k/2;v=b-D-E,g=b+D+E,y=x-_-E,m=x+_+E,c(a,v,y,g,m)}else if(h&&t.includeEdges){var M=s.rstyle||{};if(r&&!i&&(v=Math.min(M.srcX,M.midX,M.tgtX),g=Math.max(M.srcX,M.midX,M.tgtX),y=Math.min(M.srcY,M.midY,M.tgtY),m=Math.max(M.srcY,M.midY,M.tgtY),v-=C,g+=C,y-=C,m+=C,c(a,v,y,g,m)),r&&!i&&"haystack"===e.pstyle("curve-style").strValue){var I=M.haystackPts||[];if(v=I[0].x,y=I[0].y,g=I[1].x,m=I[1].y,v>g){var N=v;v=g,g=N}if(y>m){var B=y;y=m,m=B}c(a,v-C,y-C,g+C,m+C)}else{for(var z=M.bezierPts||M.linePts||[],L=0;Lg){var F=v;v=g,g=F}if(y>m){var j=y;y=m,m=j}v-=C,g+=C,y-=C,m+=C,c(a,v,y,g,m)}}}if(r&&t.includeEdges&&h&&(p(a,e,"mid-source"),p(a,e,"mid-target"),p(a,e,"source"),p(a,e,"target")),r){if("yes"===e.pstyle("ghost").value){var X=e.pstyle("ghost-offset-x").pfValue,Y=e.pstyle("ghost-offset-y").pfValue;c(a,a.x1+X,a.y1+Y,a.x2+X,a.y2+Y)}}r&&(v=a.x1,g=a.x2,y=a.y1,m=a.y2,c(a,v-E,y-E,g+E,m+E)),r&&t.includeLabels&&(f(a,e,null),h&&(f(a,e,"source"),f(a,e,"target")))}return a.x1=u(a.x1),a.y1=u(a.y1),a.x2=u(a.x2),a.y2=u(a.y2),a.w=u(a.x2-a.x1),a.h=u(a.y2-a.y1),a.w>0&&a.h>0&&w&&o.expandBoundingBox(a,1),a},g=function(e){return e?"t":"f"},y=function(e){var t="";return t+=g(e.incudeNodes),t+=g(e.includeEdges),t+=g(e.includeLabels),t+=g(e.includeOverlays)},m=function(e,t){var n=e._private,r=void 0,i=e.cy().headless(),a=t===b?x:y(t);return t.useCache&&!i&&n.bbCache&&n.bbCache[a]?r=n.bbCache[a]:(r=v(e,t),i||(n.bbCache=n.bbCache||{},n.bbCache[a]=r)),r},b={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeOverlays:!0,useCache:!0},x=y(b);l.boundingBox=function(e){if(1===this.length&&this[0]._private.bbCache&&(void 0===e||void 0===e.useCache||!0===e.useCache))return e=void 0===e?b:r(e),m(this[0],e);var t={x1:1/0,y1:1/0,x2:-1/0,y2:-1/0};e=e||a.staticEmptyObject();var n=r(e),i=this,o=i.cy(),s=o.styleEnabled();s&&this.recalculateRenderedStyle(n.useCache),this.updateCompoundBounds();for(var l={},c=0;c1&&!o){var s=this.length-1,l=this[s],u=l._private.data.id;this[s]=void 0,this[a]=l,r.set(u,{ele:l,index:a})}return this.length--,this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&r.string(e)){var n=e;e=t.mutableElements().filter(n)}for(var i=0;in&&(n=s,r=o)}return{value:n,ele:r}},min:function(e,t){for(var n=1/0,r=void 0,i=this,a=0;a=0&&i0&&t.push(c[0]),t.push(s[0])}return this.spawn(t,{unique:!0}).filter(e)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),l.neighbourhood=l.neighborhood,l.closedNeighbourhood=l.closedNeighborhood,l.openNeighbourhood=l.openNeighborhood,o.extend(l,{source:u(function(e){var t=this[0],n=void 0;return t&&(n=t._private.source||t.cy().collection()),n&&e?n.filter(e):n},"source"),target:u(function(e){var t=this[0],n=void 0;return t&&(n=t._private.target||t.cy().collection()),n&&e?n.filter(e):n},"target"),sources:r({attr:"source"}),targets:r({attr:"target"})}),o.extend(l,{edgesWith:u(i(),"edgesWith"),edgesTo:u(i({thisIsSrc:!0}),"edgesTo")}),o.extend(l,{connectedEdges:u(function(e){for(var t=[],n=this,r=0;r0);return i.map(function(e){var t=e.connectedEdges().stdFilter(function(t){return e.anySame(t.source())&&e.anySame(t.target())});return e.union(t)})}}),e.exports=l},function(e,t,n){"use strict";var r=n(0),i=n(1),a=n(7),o=n(14),s={add:function(e){var t=void 0,n=this;if(r.elementOrCollection(e)){var s=e;if(s._private.cy===n)t=s.restore();else{for(var l=[],u=0;u=0;t--){(0,e[t])()}e.splice(0,e.length)},p=s.length-1;p>=0;p--){var f=s[p],v=f._private;v.stopped?(s.splice(p,1),v.hooked=!1,v.playing=!1,v.started=!1,h(v.frames)):(v.playing||v.applying)&&(v.playing&&v.applying&&(v.applying=!1),v.started||a(t,f,e,n),i(t,f,e,n),v.applying&&(v.applying=!1),h(v.frames),f.completed()&&(s.splice(p,1),v.hooked=!1,v.playing=!1,v.started=!1,h(v.completes)),u=!0)}return n||0!==s.length||0!==l.length||o.push(t),u}for(var r=t._private.aniEles,o=[],s=!1,l=0;l0?(r.dirtyCompoundBoundsCache(),t.notify({type:"draw",eles:r})):t.notify({type:"draw"})),r.unmerge(o),t.emit("step")}var i=n(73),a=n(78);e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){var l=!r,u=e._private,c=t._private,d=c.easing,h=c.startTime,p=r?e:e.cy(),f=p.style();if(!c.easingImpl)if(null==d)c.easingImpl=a.linear;else{var v=void 0;if(s.string(d)){var g=f.parse("transition-timing-function",d);v=g.value}else v=d;var y=void 0,m=void 0;s.string(v)?(y=v,m=[]):(y=v[1],m=v.slice(2).map(function(e){return+e})),m.length>0?("spring"===y&&m.push(c.duration),c.easingImpl=a[y].apply(null,m)):c.easingImpl=a[y]}var b=c.easingImpl,x=void 0;if(x=0===c.duration?1:(n-h)/c.duration,c.applying&&(x=c.progress),x<0?x=0:x>1&&(x=1),null==c.delay){var w=c.startPosition,E=c.position;if(E&&l&&!e.locked()){var P=e.position();i(w.x,E.x)&&(P.x=o(w.x,E.x,x,b)),i(w.y,E.y)&&(P.y=o(w.y,E.y,x,b)),e.emit("position")}var C=c.startPan,S=c.pan,T=u.pan,D=null!=S&&r;D&&(i(C.x,S.x)&&(T.x=o(C.x,S.x,x,b)),i(C.y,S.y)&&(T.y=o(C.y,S.y,x,b)),e.emit("pan"));var k=c.startZoom,_=c.zoom,M=null!=_&&r;M&&(i(k,_)&&(u.zoom=o(k,_,x,b)),e.emit("zoom")),(D||M)&&e.emit("viewport");var I=c.style;if(I&&I.length>0&&l){for(var N=0;N0?i=o:r=o}while(Math.abs(a)>g&&++l=v?u(t,s):0===c?s:d(t,r,r+b)}function p(){P=!0,e===t&&n===r||c()}var f=4,v=.001,g=1e-7,y=10,m=11,b=1/(m-1),x="undefined"!=typeof Float32Array;if(4!==arguments.length)return!1;for(var w=0;w<4;++w)if("number"!=typeof arguments[w]||isNaN(arguments[w])||!isFinite(arguments[w]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var E=x?new Float32Array(m):new Array(m),P=!1,C=function(i){return P||p(),e===t&&n===r?i:0===i?0:1===i?1:s(h(i),t,r)};C.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var S="generateBezier("+[e,t,n,r]+")";return C.toString=function(){return S},C}e.exports=r},function(e,t,n){"use strict";/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */ +var r=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},a=t(n,.5*r,i),o=t(n,.5*r,a),s=t(n,r,o),l=1/6*(i.dx+2*(a.dx+o.dx)+s.dx),u=1/6*(i.dv+2*(a.dv+o.dv)+s.dv);return n.x=n.x+l*r,n.v=n.v+u*r,n}return function e(t,r,i){var a={x:-1,v:0,tension:null,friction:null},o=[0],s=0,l=void 0,u=void 0,c=void 0;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i=i||null,a.tension=t,a.friction=r,l=null!==i,l?(s=e(t,r),u=s/i*.016):u=.016;c=n(c||a,u),o.push(1+c.x),s+=16,Math.abs(c.x)>1e-4&&Math.abs(c.v)>1e-4;);return l?function(e){return o[e*(o.length-1)|0]}:s}}();e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r,i){if(1===r)return n;var a=i(t,n,r);return null==e?a:((e.roundValue||e.color)&&(a=Math.round(a)),void 0!==e.min&&(a=Math.max(a,e.min)),void 0!==e.max&&(a=Math.min(a,e.max)),a)}function i(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function a(e,t,n,a,s){var l=null!=s?s.type:null;n<0?n=0:n>1&&(n=1);var u=i(e,s),c=i(t,s);if(o.number(u)&&o.number(c))return r(l,u,c,n,a);if(o.array(u)&&o.array(c)){for(var d=[],h=0;h0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchingStyle=e.batchingNotify=!0,e.batchStyleEles=this.collection(),e.batchNotifyEles=this.collection(),e.batchNotifyTypes=[],e.batchNotifyTypes.ids={}),e.batchCount++,this},endBatch:function(){var e=this._private;return e.batchCount--,0===e.batchCount&&(e.batchingStyle=!1,e.batchStyleEles.updateStyle(),e.batchingNotify=!1,this.notify({type:e.batchNotifyTypes,eles:e.batchNotifyEles})),this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var n=Object.keys(e),r=0;r0;)t.removeChild(t.childNodes[0]);e._private.renderer=null},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};i.invalidateDimensions=i.resize,e.exports=i},function(e,t,n){"use strict";var r=n(0),i=n(7),a={collection:function(e,t){return r.string(e)?this.$(e):r.elementOrCollection(e)?e.collection():r.array(e)?new i(this,e,t):new i(this)},nodes:function(e){var t=this.$(function(e){return e.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(e){return e.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};a.elements=a.filter=a.$,e.exports=a},function(e,t,n){"use strict";var r=n(0),i=n(18),a={style:function(e){if(e){this.setStyle(e).update()}return this._private.style},setStyle:function(e){var t=this._private;return r.stylesheet(e)?t.style=e.generateStyle(this):r.array(e)?t.style=i.fromJson(this,e):r.string(e)?t.style=i.fromString(this,e):t.style=i(this),t.style}};e.exports=a},function(e,t,n){"use strict";var r=n(1),i=n(0),a=n(5),o={};o.apply=function(e){var t=this,n=t._private,r=n.cy,i=r.collection();n.newStyle&&(n.contextStyles={},n.propDiffs={},t.cleanElements(e,!0));for(var a=0;a0;if(h||p){var f=void 0;h&&p?f=u.properties:h?f=u.properties:p&&(f=u.mappedProperties);for(var v=0;v0){r=!0;break}}t.hasPie=r;var o=e.pstyle("text-transform").strValue,s=e.pstyle("label").strValue,l=e.pstyle("source-label").strValue,u=e.pstyle("target-label").strValue,c=e.pstyle("font-style").strValue,d=e.pstyle("font-size").pfValue+"px",h=e.pstyle("font-family").strValue,p=e.pstyle("font-weight").strValue,f=e.pstyle("text-valign").strValue,v=e.pstyle("text-valign").strValue,g=e.pstyle("text-outline-width").pfValue,y=e.pstyle("text-wrap").strValue,m=e.pstyle("text-max-width").pfValue,b=c+"$"+d+"$"+h+"$"+p+"$"+o+"$"+f+"$"+v+"$"+g+"$"+y+"$"+m;t.labelStyleKey=b,t.sourceLabelKey=b+"$"+l,t.targetLabelKey=b+"$"+u,t.labelKey=b+"$"+s,t.fontKey=c+"$"+p+"$"+d+"$"+h,t.styleKey=Date.now()}},o.applyParsedProperty=function(e,t){var n=this,a=t,o=e._private.style,s=void 0,l=n.types,u=n.properties[a.name].type,c=a.bypass,d=o[a.name],h=d&&d.bypass,p=e._private,f=function(){n.checkZOrderTrigger(e,a.name,d?d.value:null,a.value)};if("curve-style"===t.name&&"haystack"===t.value&&e.isEdge()&&(e.isLoop()||e.source().isParent()||e.target().isParent())&&(a=t=this.parse(t.name,"bezier",c)),a.delete)return o[a.name]=void 0,f(),!0;if(a.deleteBypassed)return d?!!d.bypass&&(d.bypassed=void 0,f(),!0):(f(),!0);if(a.deleteBypass)return d?!!d.bypass&&(o[a.name]=d.bypassed,f(),!0):(f(),!0);var v=function(){r.error("Do not assign mappings to elements without corresponding data (e.g. ele `"+e.id()+"` for property `"+a.name+"` with data field `"+a.field+"`); try a `["+a.field+"]` selector to limit scope to elements with `"+a.field+"` defined")};switch(a.mapped){case l.mapData:for(var g=a.field.split("."),y=p.data,m=0;m1&&(b=1),u.color){var x=a.valueMin[0],w=a.valueMax[0],E=a.valueMin[1],P=a.valueMax[1],C=a.valueMin[2],S=a.valueMax[2],T=null==a.valueMin[3]?1:a.valueMin[3],D=null==a.valueMax[3]?1:a.valueMax[3],k=[Math.round(x+(w-x)*b),Math.round(E+(P-E)*b),Math.round(C+(S-C)*b),Math.round(T+(D-T)*b)];s={bypass:a.bypass,name:a.name,value:k,strValue:"rgb("+k[0]+", "+k[1]+", "+k[2]+")"}}else{if(!u.number)return!1;var _=a.valueMin+(a.valueMax-a.valueMin)*b;s=this.parse(a.name,_,a.bypass,"mapping")}s||(s=this.parse(a.name,d.strValue,a.bypass,"mapping")),s||v(),s.mapping=a,a=s;break;case l.data:var M=a.field.split("."),I=p.data;if(I)for(var N=0;N0&&l>0){for(var c={},d=!1,h=0;h0?e.delayAnimation(u).play().promise().then(t):t()}).then(function(){return e.animation({style:c,duration:l,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(e,s),e.emitAndNotify("style"),o.transitioning=!1})}else o.transitioning&&(this.removeBypasses(e,s),e.emitAndNotify("style"),o.transitioning=!1)},o.checkZOrderTrigger=function(e,t,n,r){var i=this.properties[t];null==i.triggersZOrder||null!=n&&!i.triggersZOrder(n,r)||this._private.cy.notify({type:"zorder",eles:e})},e.exports=o},function(e,t,n){"use strict";var r=n(0),i=n(1),a={};a.applyBypass=function(e,t,n,a){var o=this,s=[];if("*"===t||"**"===t){if(void 0!==n)for(var l=0;ll.length?s.substr(l.length):""}function n(){u=u.length>c.length?u.substr(c.length):""}var a=this,o=this,s=""+e,l=void 0,u=void 0,c=void 0;for(s=s.replace(/[\/][*](\s|.)+?[*][\/]/g,"");;){if(s.match(/^\s*$/))break;var d=s.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!d){r.error("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+s);break}l=d[0];var h=d[1];if("core"!==h){if(new i(h)._private.invalid){r.error("Skipping parsing of block: Invalid selector found in string stylesheet: "+h),t();continue}}var p=d[2],f=!1;u=p;for(var v=[];;){if(u.match(/^\s*$/))break;var g=u.match(/^\s*(.+?)\s*:\s*(.+?)\s*;/);if(!g){r.error("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),f=!0;break}c=g[0];var y=g[1],m=g[2];if(a.properties[y]){o.parse(y,m)?(v.push({name:y,val:m}),n()):(r.error("Skipping property: Invalid property definition in: "+c),n())}else r.error("Skipping property: Invalid property name in: "+c),n()}if(f){t();break}o.selector(h);for(var b=0;b node").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3,"curve-style":"haystack"}).selector(":parent <-> node").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector("node:parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}).selector("core").css({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125}),this.defaultLength=this.length},e.exports=a},function(e,t,n){"use strict";var r=n(1),i=n(0),a=n(2),o={};o.parse=function(e,t,n,a){var o=this;if(i.fn(t))return o.parseImplWarn(e,t,n,a);var s="mapping"===a||!0===a||!1===a||null==a?"dontcare":a,l=[e,t,n,s].join("$"),u=o.propCache=o.propCache||{},c=void 0;return(c=u[l])||(c=u[l]=o.parseImplWarn(e,t,n,a)),(n||"mapping"===a)&&(c=r.copy(c))&&(c.value=r.copy(c.value)),c},o.parseImplWarn=function(e,t,n,i){var a=this.parseImpl(e,t,n,i);return a||null==t||r.error("The style property `%s: %s` is invalid",e,t),a},o.parseImpl=function(e,t,n,o){var s=this;e=r.camel2dash(e);var l=s.properties[e],u=t,c=s.types;if(!l)return null;if(void 0===t)return null;l.alias&&(l=l.pointsTo,e=l.name);var d=i.string(t);d&&(t=t.trim());var h=l.type;if(!h)return null;if(n&&(""===t||null===t))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(i.fn(t))return{name:e,value:t,strValue:"fn",mapped:c.fn,bypass:n};var p=void 0,f=void 0;if(!d||o);else{if(p=new RegExp(c.data.regex).exec(t)){if(n)return!1;var v=c.data;return{name:e,value:p,strValue:""+t,mapped:v,field:p[1],bypass:n}}if(f=new RegExp(c.mapData.regex).exec(t)){if(n)return!1;if(h.multiple)return!1;var g=c.mapData;if(!h.color&&!h.number)return!1;var y=this.parse(e,f[4]);if(!y||y.mapped)return!1;var m=this.parse(e,f[5]);if(!m||m.mapped)return!1;if(y.value===m.value)return!1;if(h.color){var b=y.value,x=m.value;if(!(b[0]!==x[0]||b[1]!==x[1]||b[2]!==x[2]||b[3]!==x[3]&&(null!=b[3]&&1!==b[3]||null!=x[3]&&1!==x[3])))return!1}return{name:e,value:f,strValue:""+t,mapped:g,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:y.value,valueMax:m.value,bypass:n}}}if(h.multiple&&"multiple"!==o){var w=void 0;if(w=d?t.split(/\s+/):i.array(t)?t:[t],h.evenMultiple&&w.length%2!=0)return null;for(var E=[],P=[],C=[],S=!1,T=0;Th.max||h.strictMax&&t===h.max))return null;var B={name:e,value:t,strValue:""+t+(_||""),units:_,bypass:n};return h.unitless||"px"!==_&&"em"!==_?B.pfValue=t:B.pfValue="px"!==_&&_?this.getEmSizeInPixels()*t:t,"ms"!==_&&"s"!==_||(B.pfValue="ms"===_?t:1e3*t),"deg"!==_&&"rad"!==_||(B.pfValue="rad"===_?t:a.deg2rad(t)),"%"===_&&(B.pfValue=t/100),B}if(h.propList){var z=[],L=""+t;if("none"===L);else{for(var A=L.split(","),O=0;O0&&s>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((o-2*t)/n.w,(s-2*t)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=lt.maxZoom?t.maxZoom:s,s=st.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=l,a.push("zoom"))}if(i&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var u=e.pan;r.number(u.x)&&(t.pan.x=u.x,s=!1),r.number(u.y)&&(t.pan.y=u.y,s=!1),s||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify({type:"viewport"})),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify({type:"viewport"})),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(r.string(e)){var n=e;e=this.mutableElements().filter(n)}else r.elementOrCollection(e)||(e=this.mutableElements());if(0!==e.length){var i=e.boundingBox(),a=this.width(),o=this.height();t=void 0===t?this._private.zoom:t;return{x:(a-t*(i.x1+i.x2))/2,y:(o-t*(i.y1+i.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,t=e.container;return e.sizeCache=e.sizeCache||(t?function(){var e=i.getComputedStyle(t),n=function(t){return parseFloat(e.getPropertyValue(t))};return{width:t.clientWidth-n("padding-left")-n("padding-right"),height:t.clientHeight-n("padding-top")-n("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}}};o.centre=o.center,o.autolockNodes=o.autolock,o.autoungrabifyNodes=o.autoungrabify,e.exports=o},function(e,t,n){"use strict";function r(e,t,n){var r=n,a=function(n){s.error("Can not register `"+t+"` for `"+e+"` since `"+n+"` already exists in the prototype and can not be overridden")};if("core"===e){if(c.prototype[t])return a(t);c.prototype[t]=n}else if("collection"===e){if(u.prototype[t])return a(t);u.prototype[t]=n}else if("layout"===e){for(var o=function(e){this.options=e,n.call(this,e),h.plainObject(this._private)||(this._private={}),this._private.cy=e.cy,this._private.listeners=[],this.createEmitter()},d=o.prototype=Object.create(n.prototype),v=[],g=0;g0;)!function(){var e=n.collection();r.bfs({roots:v[0],visit:function(t,n,r,i,a){e=e.add(t)},directed:!1}),v=v.not(e),f.push(e)}();u=n.collection();for(var g=0;gy.length-1;)y.push([]);y[G].push(H),Z.depth=G,Z.index=y[G].length-1}z()}var Q=0;if(t.avoidOverlap)for(var K=0;Kc||0===t)&&(r+=u/d,a++)}return a=Math.max(1,a),r/=a,0===a&&(r=void 0),re[e.id()]=r,r},ae=function(e,t){return ie(e)-ie(t)},oe=0;oe<3;oe++){for(var se=0;se=0;he--)for(var pe=y[he],fe=0;fe0&&y[0].length<=3?c/2:0),h=2*Math.PI/y[i].length*a;return 0===i&&1===y[0].length&&(d=1),{x:ce.x+d*Math.cos(h),y:ce.y+d*Math.sin(h)}}return{x:ce.x+(a+1-(o+1)/2)*s,y:(i+1)*u}}var p={x:ce.x+(a+1-(o+1)/2)*s,y:(i+1)*u};return p}(ve,y.length)}return i.layoutPositions(this,t,function(e){return de[e.id()]}),this},e.exports=r},function(e,t,n){"use strict";function r(e){this.options=i.extend({},s,e)}var i=n(1),a=n(2),o=n(0),s={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};r.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,s=r.nodes().not(":parent");t.sort&&(s=s.sort(t.sort));for(var l=a.makeBoundingBox(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),u={x:l.x1+l.w/2,y:l.y1+l.h/2},c=void 0===t.sweep?2*Math.PI-2*Math.PI/s.length:t.sweep,d=c/Math.max(1,s.length-1),h=void 0,p=0,f=0;f1&&t.avoidOverlap){p*=1.75;var b=Math.cos(d)-Math.cos(0),x=Math.sin(d)-Math.sin(0),w=Math.sqrt(p*p/(b*b+x*x));h=Math.max(w,h)}var E=function(e,n){var r=t.startAngle+n*d*(i?1:-1),a=h*Math.cos(r),o=h*Math.sin(r);return{x:u.x+a,y:u.y+o}};return s.layoutPositions(this,t,E),this},e.exports=r},function(e,t,n){"use strict";function r(e){this.options=i.extend({},o,e)}var i=n(1),a=n(2),o={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};r.prototype.run=function(){for(var e=this.options,t=e,n=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,r=e.cy,i=t.eles,o=i.nodes().not(":parent"),s=a.makeBoundingBox(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),l={x:s.x1+s.w/2,y:s.y1+s.h/2},u=[],c=(t.startAngle,0),d=0;d0){Math.abs(b[0].value-w.value)>=y&&(b=[],m.push(b))}b.push(w)}var E=c+t.minNodeSpacing;if(!t.avoidOverlap){var P=m.length>0&&m[0].length>1,C=Math.min(s.w,s.h)/2-E,S=C/(m.length+P?1:0);E=Math.min(E,S)}for(var T=0,D=0;D1&&t.avoidOverlap){var I=Math.cos(M)-Math.cos(0),N=Math.sin(M)-Math.sin(0),B=Math.sqrt(E*E/(I*I+N*N));T=Math.max(B,T)}k.r=T,T+=E}if(t.equidistant){for(var z=0,L=0,A=0;A0)var l=r.nodeOverlap*o,d=Math.sqrt(i*i+a*a),h=l*i/d,p=l*a/d;else var f=c(e,i,a),v=c(t,-1*i,-1*a),g=v.x-f.x,y=v.y-f.y,m=g*g+y*y,d=Math.sqrt(m),l=(e.nodeRepulsion+t.nodeRepulsion)/m,h=l*g/d,p=l*y/d;e.isLocked||(e.offsetX-=h,e.offsetY-=p),t.isLocked||(t.offsetX+=h,t.offsetY+=p)}},u=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else var i=t.maxX-e.minX;if(r>0)var a=e.maxY-t.minY;else var a=t.maxY-e.minY;return i>=0&&a>=0?Math.sqrt(i*i+a*a):0},c=function(e,t,n){var r=e.positionX,i=e.positionY,a=e.height||1,o=e.width||1,s=n/t,l=a/o,u={};return 0===t&&0n?(u.x=r,u.y=i+a/2,u):0t&&-1*l<=s&&s<=l?(u.x=r-o/2,u.y=i-o*n/2/t,u):0=l)?(u.x=r+a*t/2/n,u.y=i+a/2,u):0>n&&(s<=-1*l||s>=l)?(u.x=r-a*t/2/n,u.y=i-a/2,u):u},d=function(e,t){for(var n=0;n1){var f=t.gravity*d/p,v=t.gravity*h/p;c.offsetX+=f,c.offsetY+=v}}}}},p=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var a=n[r++],o=e.idToIndex[a],s=e.layoutNodes[o],l=s.children;if(0n)var i={x:n*e/r,y:n*t/r};else var i={x:e,y:t};return i},g=function e(t,n){var r=t.parentId;if(null!=r){var i=n.layoutNodes[n.idToIndex[r]],a=!1;return(null==i.maxX||t.maxX+i.padRight>i.maxX)&&(i.maxX=t.maxX+i.padRight,a=!0),(null==i.minX||t.minX-i.padLefti.maxY)&&(i.maxY=t.maxY+i.padBottom,a=!0),(null==i.minY||t.minY-i.padTopg&&(p+=v+t.componentSpacing,h=0,f=0,v=0)}}}(0,i),r}).then(function(e){h.layoutNodes=e.layoutNodes,o.stop(),b()});var b=function(){!0===t.animate||!1===t.animate?m({force:!0,next:function(){r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r})}}):t.eles.nodes().layoutPositions(r,t,function(e){var t=h.layoutNodes[h.idToIndex[e.data("id")]];return{x:t.positionX,y:t.positionY}})};return this},r.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},r.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var c=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),a={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:e.width(),clientHeight:e.width(),boundingBox:o.makeBoundingBox(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()})},l=n.eles.components(),u={},c=0;c0){a.graphSet.push(S);for(var c=0;cr.count?0:r.graph},h=function e(t,n,r,i){var a=i.graphSet[r];if(-1s){var v=d(),g=h();(v-1)*g>=s?d(v-1):(g-1)*v>=s&&h(g-1)}else for(;c*u=s?h(m+1):d(y+1)}var b=o.w/c,x=o.h/u;if(t.condense&&(b=0,x=0),t.avoidOverlap)for(var w=0;w=c&&(N=0,I++)},z={},L=0;L=0;E--){var P=f[E];P.isNode()?s(P)||u(P):function(n){var r,a=n._private,l=a.rscratch,u=n.pstyle("width").pfValue,c=n.pstyle("arrow-scale").value,d=u/2+m,f=d*d,g=2*d,b=a.source,x=a.target;if("segments"===l.edgeType||"straight"===l.edgeType||"haystack"===l.edgeType){for(var w=l.allpts,E=0;E+3(r=i.sqdistToFiniteLine(e,t,w[E],w[E+1],w[E+2],w[E+3])))return o(n,r),!0}else if("bezier"===l.edgeType||"multibezier"===l.edgeType||"self"===l.edgeType||"compound"===l.edgeType)for(var w=l.allpts,E=0;E+5(r=i.sqdistToQuadraticBezier(e,t,w[E],w[E+1],w[E+2],w[E+3],w[E+4],w[E+5])))return o(n,r),!0;for(var b=b||a.source,x=x||a.target,P=h.getArrowWidth(u,c),C=[{name:"source",x:l.arrowStartX,y:l.arrowStartY,angle:l.srcArrowAngle},{name:"target",x:l.arrowEndX,y:l.arrowEndY,angle:l.tgtArrowAngle},{name:"mid-source",x:l.midX,y:l.midY,angle:l.midsrcArrowAngle},{name:"mid-target",x:l.midX,y:l.midY,angle:l.midtgtArrowAngle}],E=0;E0&&(s(b),s(x))}(P)||u(P)||u(P,"source")||u(P,"target")}return v},o.getAllInBox=function(e,t,n,r){var a=this.getCachedZSortedEles().interactive,o=[],s=Math.min(e,n),l=Math.max(e,n),u=Math.min(t,r),c=Math.max(t,r);e=s,n=l,t=u,r=c;for(var d=i.makeBoundingBox({x1:e,y1:t,x2:n,y2:r}),h=0;hm?m+"$-$"+y:y+"$-$"+m,v&&(t="unbundled$-$"+p.id);var b=s[t];null==b&&(b=s[t]=[],l.push(t)),b.push(d),v&&(b.hasUnbundled=!0),g&&(b.hasBezier=!0)}else u.push(d)}for(var x,w,E,P,C,S,T,D,k,_,M,I,N=0;Nw.id()){var z=x;x=w,w=z}E=x.position(),P=w.position(),C=x.outerWidth(),S=x.outerHeight(),T=w.outerWidth(),D=w.outerHeight(),k=n.nodeShapes[this.getNodeShape(x)],_=n.nodeShapes[this.getNodeShape(w)],I=!1;for(var d,L,A,O={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0},R=E.x,V=E.y,q=C,F=S,j=P.x,X=P.y,Y=T,W=D,H=B.length,c=0;c=s||w){h={cp:m,segment:x};break}}if(h)break}var m=h.cp,x=h.segment,E=(s-v)/x.length,P=x.t1-x.t0,C=o?x.t0+P*E:x.t1-P*E;C=r.bound(0,C,1),t=r.qbezierPtAt(m.p0,m.p1,m.p2,C),a=u(m.p0,m.p1,m.p2,C);break;case"straight":case"segments":case"haystack":for(var S,T,D,k,_=0,M=i.allpts.length,y=0;y+3=s));y+=2);var I=s-T,C=I/S;C=r.bound(0,C,1),t=r.lineAt(D,k,C),a=l(D,k)}d("labelX",n,t.x),d("labelY",n,t.y),d("labelAutoAngle",n,a)}};f("source"),f("target"),this.applyLabelDimensions(e)}},o.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},o.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=this.calculateLabelDimensions(e,r);a.setPrefixedProperty(n.rstyle,"labelWidth",t,i.width),a.setPrefixedProperty(n.rscratch,"labelWidth",t,i.width),a.setPrefixedProperty(n.rstyle,"labelHeight",t,i.height),a.setPrefixedProperty(n.rscratch,"labelHeight",t,i.height)},o.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,o=e.pstyle("text-transform").value,s=function(e,r){return r?(a.setPrefixedProperty(n.rscratch,e,t,r),r):a.getPrefixedProperty(n.rscratch,e,t)};if(!i)return"";"none"==o||("uppercase"==o?i=i.toUpperCase():"lowercase"==o&&(i=i.toLowerCase()));var l=e.pstyle("text-wrap").value;if("wrap"===l){var u=s("labelKey");if(u&&s("labelWrapKey")===u)return s("labelWrapCachedText");for(var c=i.split("\n"),d=e.pstyle("text-max-width").pfValue,h=[],p=0;pd){for(var v=f.split(/\s+/),g="",y=0;yd)break;x+=i[E],E===i.length-1&&(w=!0)}return w||(x+="…"),x}return i},o.calculateLabelDimensions=function(e,t,n){var r=this,i=e._private.labelStyleKey+"$@$"+t;n&&(i+="$@$"+n);var a=r.labelDimCache||(r.labelDimCache={});if(a[i])return a[i];var o=e.pstyle("font-style").strValue,s=1*e.pstyle("font-size").pfValue+"px",l=e.pstyle("font-family").strValue,u=e.pstyle("font-weight").strValue,c=this.labelCalcDiv;c||(c=this.labelCalcDiv=document.createElement("div"),document.body.appendChild(c));var d=c.style;return d.fontFamily=l,d.fontStyle=o,d.fontSize=s,d.fontWeight=u,d.position="absolute",d.left="-9999px",d.top="-9999px",d.zIndex="-1",d.visibility="hidden",d.pointerEvents="none",d.padding="0",d.lineHeight="1","wrap"===e.pstyle("text-wrap").value?d.whiteSpace="pre":d.whiteSpace="normal",c.textContent=t,a[i]={width:Math.ceil(c.clientWidth/1),height:Math.ceil(c.clientHeight/1)},a[i]},o.calculateLabelAngles=function(e){var t=e._private,n=t.rscratch,r=e.isEdge(),i=e.pstyle("text-rotation"),a=i.strValue;"none"===a?n.labelAngle=n.sourceLabelAngle=n.targetLabelAngle=0:r&&"autorotate"===a?(n.labelAngle=n.labelAutoAngle,n.sourceLabelAngle=n.sourceLabelAutoAngle,n.targetLabelAngle=n.targetLabelAutoAngle):n.labelAngle=n.sourceLabelAngle=n.targetLabelAngle="autorotate"===a?0:i.pfValue},e.exports=o},function(e,t,n){"use strict";var r={};r.getNodeShape=function(e){var t=this,n=e.pstyle("shape").value;if(e.isParent())return"rectangle"===n||"roundrectangle"===n||"cutrectangle"===n||"barrel"===n?n:"rectangle";if("polygon"===n){var r=e.pstyle("shape-polygon-points").value;return t.nodeShapes.makePolygon(r).name}return n},e.exports=r},function(e,t,n){"use strict";var r={};r.registerCalculationListeners=function(){var e=this.cy,t=e.collection(),n=this,r=function(e,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t.merge(e);for(var i=0;i=e.desktopTapThreshold2}var _=n(i);y&&(e.hoverData.tapholdCancelled=!0),s=!0,t(v,["mousemove","vmousemove","tapdrag"],i,{position:{x:d[0],y:d[1]}});var M=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||l.emit("boxstart"),f[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(y){var I={originalEvent:i,type:"cxtdrag",position:{x:d[0],y:d[1]}};x?x.emit(I):l.emit(I),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&v===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:i,type:"cxtdragout",position:{x:d[0],y:d[1]}}),e.hoverData.cxtOver=v,v&&v.emit({originalEvent:i,type:"cxtdragover",position:{x:d[0],y:d[1]}}))}}else if(e.hoverData.dragging){if(s=!0,l.panningEnabled()&&l.userPanningEnabled()){var N;if(e.hoverData.justStartedPan){var B=e.hoverData.mdownPos;N={x:(d[0]-B[0])*u,y:(d[1]-B[1])*u},e.hoverData.justStartedPan=!1}else N={x:w[0]*u,y:w[1]*u};l.panBy(N),e.hoverData.dragged=!0}d=e.projectIntoViewport(i.clientX,i.clientY)}else if(1!=f[4]||null!=x&&!x.isEdge()){if(x&&x.isEdge()&&x.active()&&x.unactivate(),x&&x.grabbed()||v==b||(b&&t(b,["mouseout","tapdragout"],i,{position:{x:d[0],y:d[1]}}),v&&t(v,["mouseover","tapdragover"],i,{position:{x:d[0],y:d[1]}}),e.hoverData.last=v),x)if(y){if(l.boxSelectionEnabled()&&_)x&&x.grabbed()&&(m(E),x.emit("free")),M();else if(x&&x.grabbed()&&e.nodeIsDraggable(x)){var z=!e.dragData.didDrag;z&&e.redrawHint("eles",!0),e.dragData.didDrag=!0;var L=[];e.hoverData.draggingEles||g(l.collection(E),{inDragLayer:!0});for(var A=0;A0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=l=[]),t(s,["mouseup","tapend","vmouseup"],r,{position:{x:a[0],y:a[1]}}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||t(u,["click","tap","vclick"],r,{position:{x:a[0],y:a[1]}}),s!=u||e.dragData.didDrag||e.hoverData.selecting||null!=s&&s._private.selectable&&(e.hoverData.dragging||("additive"===i.selectionType()||c?s.selected()?s.unselect():s.select():c||(i.$(":selected").unmerge(s).unselect(),s.select())),e.redrawHint("eles",!0)),e.hoverData.selecting){var p=i.collection(e.getAllInBox(o[0],o[1],o[2],o[3]));e.redrawHint("select",!0),p.length>0&&e.redrawHint("eles",!0),i.emit("boxend");var f=function(e){return e.selectable()&&!e.selected()};"additive"===i.selectionType()?p.emit("box").stdFilter(f).select().emit("boxselect"):(c||i.$(":selected").unmerge(p).unselect(),p.emit("box").stdFilter(f).select().emit("boxselect")),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!o[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var v=u&&u.grabbed();m(l),v&&u.emit("free")}}o[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null}},!1);var T=function(t){if(!e.scrollingPage){var n=e.cy,r=e.projectIntoViewport(t.clientX,t.clientY),i=[r[0]*n.zoom()+n.pan().x,r[1]*n.zoom()+n.pan().y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||C())return void t.preventDefault();if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){t.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout(function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()},150);var a;a=null!=t.deltaY?t.deltaY/-250:null!=t.wheelDeltaY?t.wheelDeltaY/1e3:t.wheelDelta/1e3,a*=e.wheelSensitivity;1===t.deltaMode&&(a*=33),n.zoom({level:n.zoom()*Math.pow(10,a),renderedPosition:{x:i[0],y:i[1]}})}}};e.registerBinding(e.container,"wheel",T,!0),e.registerBinding(window,"scroll",function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout(function(){e.scrollingPage=!1},250)},!0),e.registerBinding(e.container,"mouseout",function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseout",position:{x:n[0],y:n[1]}})},!1),e.registerBinding(e.container,"mouseover",function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseover",position:{x:n[0],y:n[1]}})},!1);var D,k,_,M,I,N,B,z,L,A,O,R,V,q,F=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},j=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};e.registerBinding(e.container,"touchstart",q=function(n){if(S(n)){x(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var r=e.cy,i=e.touchData.now,a=e.touchData.earlier;if(n.touches[0]){var o=e.projectIntoViewport(n.touches[0].clientX,n.touches[0].clientY);i[0]=o[0],i[1]=o[1]}if(n.touches[1]){var o=e.projectIntoViewport(n.touches[1].clientX,n.touches[1].clientY);i[2]=o[0],i[3]=o[1]}if(n.touches[2]){var o=e.projectIntoViewport(n.touches[2].clientX,n.touches[2].clientY);i[4]=o[0],i[5]=o[1]}if(n.touches[1]){m(e.dragData.touchDragEles);var s=e.findContainerClientCoords();L=s[0],A=s[1],O=s[2],R=s[3],D=n.touches[0].clientX-L,k=n.touches[0].clientY-A,_=n.touches[1].clientX-L,M=n.touches[1].clientY-A,V=0<=D&&D<=O&&0<=_&&_<=O&&0<=k&&k<=R&&0<=M&&M<=R;var l=r.pan(),u=r.zoom();I=F(D,k,_,M),N=j(D,k,_,M),B=[(D+_)/2,(k+M)/2],z=[(B[0]-l.x)/u,(B[1]-l.y)/u];if(N<4e4&&!n.touches[2]){var c=e.findNearestElement(i[0],i[1],!0,!0),d=e.findNearestElement(i[2],i[3],!0,!0);return c&&c.isNode()?(c.activate().emit({originalEvent:n,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=c):d&&d.isNode()?(d.activate().emit({originalEvent:n,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=d):r.emit({originalEvent:n,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,void e.redraw()}}if(n.touches[2]);else if(n.touches[1]);else if(n.touches[0]){var p=e.findNearestElements(i[0],i[1],!0,!0),f=p[0];if(null!=f&&(f.activate(),e.touchData.start=f,e.touchData.starts=p,e.nodeIsGrabbable(f))){var v=e.dragData.touchDragEles=[],b=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),f.selected()?(b=r.$(function(t){return t.selected()&&e.nodeIsGrabbable(t)}),g(b,{addToList:v})):y(f,{addToList:v}),h(f);var w=function(e){return{originalEvent:n,type:e,position:{x:i[0],y:i[1]}}};f.emit(w("grabon")),b?b.forEach(function(e){e.emit(w("grab"))}):f.emit(w("grab"))}t(f,["touchstart","tapstart","vmousedown"],n,{position:{x:i[0],y:i[1]}}),null==f&&(e.data.bgActivePosistion={x:o[0],y:o[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout(function(){!1!==e.touchData.singleTouchMoved||e.pinching||e.touchData.selecting||(t(e.touchData.start,["taphold"],n,{position:{x:i[0],y:i[1]}}),e.touchData.start||r.$(":selected").unselect())},e.tapholdDuration)}if(n.touches.length>=1){for(var E=e.touchData.startPosition=[],P=0;P=e.touchTapThreshold2}if(i&&e.touchData.cxt){n.preventDefault();var E=n.touches[0].clientX-L,P=n.touches[0].clientY-A,C=n.touches[1].clientX-L,T=n.touches[1].clientY-A,B=j(E,P,C,T),O=B/N;if(O>=2.25||B>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var R={originalEvent:n,type:"cxttapend",position:{x:u[0],y:u[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(R),e.touchData.start=null):l.emit(R)}}if(i&&e.touchData.cxt){var R={originalEvent:n,type:"cxtdrag",position:{x:u[0],y:u[1]}};e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(R):l.emit(R),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var q=e.findNearestElement(u[0],u[1],!0,!0);e.touchData.cxtOver&&q===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:n,type:"cxtdragout",position:{x:u[0],y:u[1]}}),e.touchData.cxtOver=q,q&&q.emit({originalEvent:n,type:"cxtdragover",position:{x:u[0],y:u[1]}}))}else if(i&&n.touches[2]&&l.boxSelectionEnabled())n.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||l.emit("boxstart"),e.touchData.selecting=!0,e.redrawHint("select",!0),s&&0!==s.length&&void 0!==s[0]?(s[2]=(u[0]+u[2]+u[4])/3,s[3]=(u[1]+u[3]+u[5])/3):(s[0]=(u[0]+u[2]+u[4])/3,s[1]=(u[1]+u[3]+u[5])/3,s[2]=(u[0]+u[2]+u[4])/3+1,s[3]=(u[1]+u[3]+u[5])/3+1),s[4]=1,e.touchData.selecting=!0,e.redraw();else if(i&&n.touches[1]&&l.zoomingEnabled()&&l.panningEnabled()&&l.userZoomingEnabled()&&l.userPanningEnabled()){n.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var X=e.dragData.touchDragEles;if(X){e.redrawHint("drag",!0);for(var Y=0;Y0&&!e.hoverData.draggingEles&&!e.swipePanning&&null!=e.data.bgActivePosistion&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1);var Y;e.registerBinding(window,"touchcancel",Y=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()});var W;if(e.registerBinding(window,"touchend",W=function(n){var r=e.touchData.start;if(e.touchData.capture){0===n.touches.length&&(e.touchData.capture=!1),n.preventDefault();var i=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var a=e.cy,o=a.zoom(),s=e.touchData.now,l=e.touchData.earlier;if(n.touches[0]){var u=e.projectIntoViewport(n.touches[0].clientX,n.touches[0].clientY);s[0]=u[0],s[1]=u[1]}if(n.touches[1]){var u=e.projectIntoViewport(n.touches[1].clientX,n.touches[1].clientY);s[2]=u[0],s[3]=u[1]}if(n.touches[2]){var u=e.projectIntoViewport(n.touches[2].clientX,n.touches[2].clientY);s[4]=u[0],s[5]=u[1]}r&&r.unactivate();var c;if(e.touchData.cxt){if(c={originalEvent:n,type:"cxttapend",position:{x:s[0],y:s[1]}},r?r.emit(c):a.emit(c),!e.touchData.cxtDragged){var d={originalEvent:n,type:"cxttap",position:{x:s[0],y:s[1]}};r?r.emit(d):a.emit(d)}return e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,void e.redraw()}if(!n.touches[2]&&a.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var h=a.collection(e.getAllInBox(i[0],i[1],i[2],i[3]));i[0]=void 0,i[1]=void 0,i[2]=void 0,i[3]=void 0,i[4]=0,e.redrawHint("select",!0),a.emit("boxend");var p=function(e){return e.selectable()&&!e.selected()};h.emit("box").stdFilter(p).select().emit("boxselect"),h.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(null!=r&&r.unactivate(),n.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(n.touches[1]);else if(n.touches[0]);else if(!n.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var f=e.dragData.touchDragEles;if(null!=r){var v=r._private.grabbed;m(f),e.redrawHint("drag",!0),e.redrawHint("eles",!0),v&&r.emit("free"),t(r,["touchend","tapend","vmouseup","tapdragout"],n,{position:{x:s[0],y:s[1]}}),r.unactivate(),e.touchData.start=null}else{var g=e.findNearestElement(s[0],s[1],!0,!0);t(g,["touchend","tapend","vmouseup","tapdragout"],n,{position:{x:s[0],y:s[1]}})}var y=e.touchData.startPosition[0]-s[0],b=y*y,x=e.touchData.startPosition[1]-s[1],w=x*x,E=b+w,P=E*o*o;null!=r&&!e.dragData.didDrag&&r._private.selectable&&P0)return v[0]}return null}(e,t,v);if(null!=g){var y=v[5],m=v[3],b=v[1],x=r.qbezierAt(y,m,b,g);if(v.isTop&&x<=t)return!0;if(v.isBottom&&t<=x)return!0}}return!1}}},i.generateBottomRoundrectangle=function(){return this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottomroundrectangle",points:r.generateUnitNgonPointsFitToSquare(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,i,a,o,s){var l=e-(n/2+s),u=t-(i/2+s),c=u,d=e+(n/2+s),h=r.finiteLinesIntersect(a,o,e,t,l,u,d,c,!1);return h.length>0?h:r.roundRectangleIntersectLine(a,o,e,t,n,i,s)},checkPoint:function(e,t,n,i,a,o,s){var l=r.getRoundRectangleRadius(i,a),u=2*l;if(r.pointInsidePolygon(e,t,this.points,o,s,i,a-u,[0,-1],n))return!0;if(r.pointInsidePolygon(e,t,this.points,o,s,i-u,a,[0,-1],n))return!0;var c=i/2+2*n,d=a/2+2*n,h=[o-c,s-d,o-c,s,o+c,s,o+c,s-d];return!!r.pointInsidePolygonPoints(e,t,h)||(!!r.checkInEllipse(e,t,u,u,o+i/2-l,s+a/2-l,n)||!!r.checkInEllipse(e,t,u,u,o-i/2+l,s+a/2-l,n))}}},i.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",r.generateUnitNgonPointsFitToSquare(3,0)),this.generatePolygon("rectangle",r.generateUnitNgonPointsFitToSquare(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle(),this.generatePolygon("diamond",[0,1,1,0,0,-1,-1,0]),this.generatePolygon("pentagon",r.generateUnitNgonPointsFitToSquare(5,0)),this.generatePolygon("hexagon",r.generateUnitNgonPointsFitToSquare(6,0)),this.generatePolygon("heptagon",r.generateUnitNgonPointsFitToSquare(7,0)),this.generatePolygon("octagon",r.generateUnitNgonPointsFitToSquare(8,0));var n=new Array(20),i=r.generateUnitNgonPoints(5,0),a=r.generateUnitNgonPoints(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s0&&t.data.lyrTxrCache.invalidateElements(n)})}var i=n(1),a=n(0),o=n(125),s=n(126),l=r,u=r.prototype;u.CANVAS_LAYERS=3,u.SELECT_BOX=0,u.DRAG=1,u.NODE=2,u.BUFFER_COUNT=3,u.TEXTURE_BUFFER=0,u.MOTIONBLUR_BUFFER_NODE=1,u.MOTIONBLUR_BUFFER_DRAG=2,u.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[u.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[u.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[u.SELECT_BOX]=t}};var c="undefined"!=typeof Path2D;u.path2dEnabled=function(e){if(void 0===e)return this.pathsEnabled;this.pathsEnabled=!!e},u.usePaths=function(){return c&&this.pathsEnabled},[n(127),n(128),n(129),n(130),n(131),n(132),n(133),n(134),n(135),n(136)].forEach(function(e){i.extend(u,e)}),e.exports=l},function(e,t,n){"use strict";var r=n(2),i=n(1),a=n(9),o=n(19),s={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},l=function(e){var t=this;t.renderer=e,t.onDequeues=[],t.setupDequeueing()},u=l.prototype;u.reasons=s,u.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},u.getRetiredTextureQueue=function(e){var t=this,n=t.eleImgCaches.retired=t.eleImgCaches.retired||{};return n[e]=n[e]||[]},u.getElementQueue=function(){var e=this;return e.eleCacheQueue=e.eleCacheQueue||new a(function(e,t){return t.reqs-e.reqs})},u.getElementIdToQueue=function(){var e=this;return e.eleIdToCacheQueue=e.eleIdToCacheQueue||{}},u.getElement=function(e,t,n,i,a){var o=this,l=this.renderer,u=e._private.rscratch,c=l.cy.zoom();if(0===t.w||0===t.h||!e.visible())return null;if(null==i&&(i=Math.ceil(r.log2(c*n))),i<-4)i=-4;else if(c>=3.99||i>2)return null;var d=Math.pow(2,i),h=t.h*d,p=t.w*d,f=u.imgCaches=u.imgCaches||{},v=f[i];if(v)return v;var g;if(g=h<=25?25:h<=50?50:50*Math.ceil(h/50),h>1024||p>1024||e.isEdge()||e.isParent())return null;var y=o.getTextureQueue(g),m=y[y.length-2],b=function(){return o.recycleTexture(g,p)||o.addTexture(g,p)};m||(m=y[y.length-1]),m||(m=b()),m.width-m.usedWidthi;T--)k=o.getElement(e,t,n,T,s.downscale);_()}else{var M;if(!P&&!C&&!S)for(var T=i-1;T>=-4;T--){var D=f[T];if(D){M=D;break}}if(E(M))return o.queueElement(e,i),M;m.context.translate(m.usedWidth,0),m.context.scale(d,d),l.drawElement(m.context,e,t,w),m.context.scale(1/d,1/d),m.context.translate(-m.usedWidth,0)}return v=f[i]={ele:e,x:m.usedWidth,texture:m,level:i,scale:d,width:p,height:h,scaledLabelShown:w},m.usedWidth+=Math.ceil(p+8),m.eleCaches.push(v),o.checkTextureFullness(m),v},u.invalidateElement=function(e){var t=this,n=e._private.rscratch.imgCaches;if(n)for(var r=-4;r<=2;r++){var a=n[r];if(a){var o=a.texture;o.invalidatedWidth+=a.width,n[r]=null,i.removeFromArray(o.eleCaches,a),t.removeFromQueue(e),t.checkTextureUtility(o)}}},u.checkTextureUtility=function(e){e.invalidatedWidth>=.5*e.width&&this.retireTexture(e)},u.checkTextureFullness=function(e){var t=this,n=t.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?i.removeFromArray(n,e):e.fullnessChecks++},u.retireTexture=function(e){var t=this,n=e.height,r=t.getTextureQueue(n);i.removeFromArray(r,e),e.retired=!0;for(var a=e.eleCaches,o=0;o=t)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,i.clearArray(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),i.removeFromArray(a,s),r.push(s),s}},u.queueElement=function(e,t){var n=this,r=n.getElementQueue(),i=n.getElementIdToQueue(),a=e.id(),o=i[a];if(o)o.level=Math.max(o.level,t),o.reqs++,r.updateItem(o);else{var s={ele:e,level:t,reqs:1};r.push(s),i[a]=s}},u.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementIdToQueue(),i=[],a=0;a<1&&n.size()>0;a++){var o=n.pop(),l=o.ele;if(null==l._private.rscratch.imgCaches[o.level]){r[l.id()]=null,i.push(o);var u=l.boundingBox();t.getElement(l,u,e,o.level,s.dequeue)}}return i},u.removeFromQueue=function(e){var t=this,n=t.getElementQueue(),r=t.getElementIdToQueue(),a=r[e.id()];null!=a&&(a.reqs=i.MAX_INT,n.updateItem(a),n.pop(),r[e.id()]=null)},u.onDequeue=function(e){this.onDequeues.push(e)},u.offDequeue=function(e){i.removeFromArray(this.onDequeues,e)},u.setupDequeueing=o.setupDequeueing({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n=3.99||n>2)return null;r.validateLayersElesOrdering(n,e);var c,d,h=r.layersByLevel,p=Math.pow(2,n),f=h[n]=h[n]||[],v=r.levelIsComplete(n,e);if(v)return f;!function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return d=h[t],!0},a=function(e){if(!d)for(var r=n+e;-4<=r&&r<=2&&!t(r);r+=e);};a(1),a(-1);for(var o=f.length-1;o>=0;o--){var s=f[o];s.invalid&&i.removeFromArray(f,s)}}();var g=function(){if(!c){c=a.makeBoundingBox();for(var t=0;t=m||!a.boundingBoxInBoundingBox(y.bb,w.boundingBox()))&&!(y=function(e){e=e||{};var t=e.after;if(g(),c.w*p*(c.h*p)>16e6)return null;var i=r.makeLayer(c,n);if(null!=t){var a=f.indexOf(t)+1;f.splice(a,0,i)}else(void 0===e.insert||e.insert)&&f.unshift(i);return i}({insert:!0,after:y})))return null;d||b?r.queueLayer(y,w):r.drawEleInLayer(y,w,n,t),y.eles.push(w),P[n]=y}}return d||(b?null:f)},c.getEleLevelForLayerLevel=function(e,t){return e},c.drawEleInLayer=function(e,t,n,i){var a=this,o=this.renderer,s=e.context,l=t.boundingBox();if(0!==l.w&&0!==l.h&&t.visible()){var u=a.eleTxrCache,c=u.reasons.highQuality;n=a.getEleLevelForLayerLevel(n,i);var d=u.getElement(t,l,null,n,c);d?(r(s,!1),s.drawImage(d.texture.canvas,d.x,0,d.width,d.height,l.x1,l.y1,l.w,l.h),r(s,!0)):o.drawElement(s,t)}},c.levelIsComplete=function(e,t){var n=this,r=n.layersByLevel[e];if(!r||0===r.length)return!1;for(var i=0,a=0;a0)return!1;if(o.invalid)return!1;i+=o.eles.length}return i===t.length},c.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r0){t=!0;break}}return t},c.invalidateElements=function(e){var t=this;t.lastInvalidationTime=i.performanceNow(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,function(e,n,r){t.invalidateLayer(e)})},c.invalidateLayer=function(e){if(this.lastInvalidationTime=i.performanceNow(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];i.removeFromArray(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:p;e.lineWidth=v,e.lineCap="butt",i.strokeStyle(e,h[0],h[1],h[2],n),i.drawEdgePath(t,e,a.allpts,f)},y=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p;i.drawArrowheads(e,t,n)};e.lineJoin="round";if("yes"===t.pstyle("ghost").value){var m=t.pstyle("ghost-offset-x").pfValue,b=t.pstyle("ghost-offset-y").pfValue,x=t.pstyle("ghost-opacity").value,w=p*x;e.translate(m,b),g(w),y(w),e.translate(-m,-b)}g(),y(),function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c;e.lineWidth=u,"self"!==a.edgeType||o?e.lineCap="round":e.lineCap="butt",i.strokeStyle(e,d[0],d[1],d[2],n),i.drawEdgePath(t,e,a.allpts,"solid")}(),function(){i.drawElementText(e,t,r)}(),n&&e.translate(s.x1,s.y1)}},r.drawEdgePath=function(e,t,n,r){var i=e._private.rscratch,a=t,o=void 0,s=!1,l=this.usePaths();if(l){var u=n.join("$");i.pathCacheKey&&i.pathCacheKey===u?(o=t=i.pathCache,s=!0):(o=t=new Path2D,i.pathCacheKey=u,i.pathCache=o)}if(a.setLineDash)switch(r){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash([6,3]);break;case"solid":a.setLineDash([])}if(!s&&!i.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var c=2;c+30||T>0&&S>0){var k=l-D;switch(m){case"left":k-=h;break;case"center":k-=h/2}var _=u-p-D,M=h+2*D,I=p+2*D;if(C>0){var N=e.fillStyle,B=t.pstyle("text-background-color").value;e.fillStyle="rgba("+B[0]+","+B[1]+","+B[2]+","+C*s+")";"roundrectangle"==t.pstyle("text-background-shape").strValue?r(e,k,_,M,I,2):e.fillRect(k,_,M,I),e.fillStyle=N}if(T>0&&S>0){var z=e.strokeStyle,L=e.lineWidth,A=t.pstyle("text-border-color").value,O=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+A[0]+","+A[1]+","+A[2]+","+S*s+")",e.lineWidth=T,e.setLineDash)switch(O){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=T/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(e.strokeRect(k,_,M,I),"double"===O){var R=T/2;e.strokeRect(k+R,_+R,M-2*R,I-2*R)}e.setLineDash&&e.setLineDash([]),e.lineWidth=L,e.strokeStyle=z}}var V=2*t.pstyle("text-outline-width").pfValue;if(V>0&&(e.lineWidth=V),"wrap"===t.pstyle("text-wrap").value){var q=i.getPrefixedProperty(o,"labelWrapCachedLines",n),F=p/q.length;switch(b){case"top":u-=(q.length-1)*F;break;case"center":case"bottom":u-=(q.length-1)*F}for(var j=0;j0&&e.strokeText(q[j],l,u),e.fillText(q[j],l,u),u+=F}else V>0&&e.strokeText(c,l,u),e.fillText(c,l,u);0!==x&&(e.rotate(-x),e.translate(-E,-P))}}},e.exports=o},function(e,t,n){"use strict";var r=n(0),i={};i.drawNode=function(e,t,n,i){var a=this,o=void 0,s=void 0,l=t._private,u=l.rscratch,c=t.position();if(r.number(c.x)&&r.number(c.y)&&t.visible()){var d=t.effectiveOpacity(),h=a.usePaths(),p=void 0,f=!1,v=t.padding();o=t.width()+2*v,s=t.height()+2*v;var g=void 0;n&&(g=n,e.translate(-g.x1,-g.y1));for(var y=t.pstyle("background-image"),m=y.value,b=new Array(m.length),x=new Array(m.length),w=0,E=0;E0&&void 0!==arguments[0]?arguments[0]:k;a.fillStyle(e,D[0],D[1],D[2],t)},B=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:I;a.strokeStyle(e,_[0],_[1],_[2],t)},z=t.pstyle("shape").strValue,L=t.pstyle("shape-polygon-points").pfValue;if(h){var A=z+"$"+o+"$"+s+("polygon"===z?"$"+L.join("$"):"");e.translate(c.x,c.y),u.pathCacheKey===A?(p=u.pathCache,f=!0):(p=new Path2D,u.pathCacheKey=A,u.pathCache=p)}var O=function(){if(!f){var n=c;h&&(n={x:0,y:0}),a.nodeShapes[a.getNodeShape(t)].draw(p||e,n.x,n.y,o,s)}h?e.fill(p):e.fill()},R=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,r=l.backgrounding,i=0,o=0;o0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;a.hasPie(t)&&(a.drawPie(e,t,r),n&&(h||a.nodeShapes[a.getNodeShape(t)].draw(e,c.x,c.y,o,s)))},q=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,n=(S>0?S:-S)*t,r=S>0?0:255;0!==S&&(a.fillStyle(e,r,r,r,n),h?e.fill(p):e.fill())},F=function(){if(T>0){if(e.lineWidth=T,e.lineCap="butt",e.setLineDash)switch(M){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}if(h?e.stroke(p):e.stroke(),"double"===M){e.lineWidth=T/3;var t=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",h?e.stroke(p):e.stroke(),e.globalCompositeOperation=t}e.setLineDash&&e.setLineDash([])}};if("yes"===t.pstyle("ghost").value){var j=t.pstyle("ghost-offset-x").pfValue,X=t.pstyle("ghost-offset-y").pfValue,Y=t.pstyle("ghost-opacity").value,W=Y*d;e.translate(j,X),N(Y*k),O(),R(W),V(0!==S||0!==T),q(W),B(Y*I),F(),e.translate(-j,-X)}N(),O(),R(),V(0!==S||0!==T),q(),B(),F(),h&&e.translate(-c.x,-c.y),function(){a.drawElementText(e,t,i)}(),function(){var n=t.pstyle("overlay-padding").pfValue,r=t.pstyle("overlay-opacity").value,i=t.pstyle("overlay-color").value;r>0&&(a.fillStyle(e,i[0],i[1],i[2],r),a.nodeShapes.roundrectangle.draw(e,c.x,c.y,o+2*n,s+2*n),e.fill())}(),n&&e.translate(g.x1,g.y1)}},i.hasPie=function(e){return e=e[0],e._private.hasPie},i.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var i=t.cy().style(),a=t.pstyle("pie-size"),o=r.x,s=r.y,l=t.width(),u=t.height(),c=Math.min(l,u)/2,d=0;this.usePaths()&&(o=0,s=0),"%"===a.units?c*=a.pfValue:void 0!==a.pfValue&&(c=a.pfValue/2);for(var h=1;h<=i.pieBackgroundN;h++){var p=t.pstyle("pie-"+h+"-background-size").value,f=t.pstyle("pie-"+h+"-background-color").value,v=t.pstyle("pie-"+h+"-background-opacity").value*n,g=p/100;g+d>1&&(g=1-d);var y=1.5*Math.PI+2*Math.PI*d,m=2*Math.PI*g,b=y+m;0===p||d>=1||d+g>1||(e.beginPath(),e.moveTo(o,s),e.arc(o,s,c,y,b),e.closePath(),this.fillStyle(e,f[0],f[1],f[2],v),e.fill(),d+=g)}},e.exports=i},function(e,t,n){"use strict";var r={},i=n(1);r.getPixelRatio=function(){var e=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t},r.paintCache=function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;iu.minMbLowQualFrames&&(u.motionBlurPxRatio=u.mbPxRBlurry)),u.clearingMotionBlur&&(u.motionBlurPxRatio=1),u.textureDrawLastFrame&&!f&&(p[u.NODE]=!0,p[u.SELECT_BOX]=!0);var w=d.style()._private.coreStyle,E=d.zoom(),P=void 0!==s?s:E,C=d.pan(),S={x:C.x,y:C.y},T={zoom:E,pan:{x:C.x,y:C.y}},D=u.prevViewport;void 0===D||T.zoom!==D.zoom||T.pan.x!==D.pan.x||T.pan.y!==D.pan.y||m&&!y||(u.motionBlurPxRatio=1),l&&(S=l),P*=c,S.x*=c,S.y*=c;var k=u.getCachedZSortedEles();if(f||(u.textureDrawLastFrame=!1),f){u.textureDrawLastFrame=!0;if(!u.textureCache){u.textureCache={},u.textureCache.bb=d.mutableElements().boundingBox(),u.textureCache.texture=u.data.bufferCanvases[u.TEXTURE_BUFFER];var _=u.data.bufferContexts[u.TEXTURE_BUFFER];_.setTransform(1,0,0,1,0,0),_.clearRect(0,0,u.canvasWidth*u.textureMult,u.canvasHeight*u.textureMult),u.render({forcedContext:_,drawOnlyNodeLayer:!0,forcedPxRatio:c*u.textureMult});var T=u.textureCache.viewport={zoom:d.zoom(),pan:d.pan(),width:u.canvasWidth,height:u.canvasHeight};T.mpan={x:(0-T.pan.x)/T.zoom,y:(0-T.pan.y)/T.zoom}}p[u.DRAG]=!1,p[u.NODE]=!1;var M=h.contexts[u.NODE],I=u.textureCache.texture,T=u.textureCache.viewport;u.textureCache.bb,M.setTransform(1,0,0,1,0,0),v?t(M,0,0,T.width,T.height):M.clearRect(0,0,T.width,T.height);var N=w["outside-texture-bg-color"].value,B=w["outside-texture-bg-opacity"].value;u.fillStyle(M,N[0],N[1],N[2],B),M.fillRect(0,0,T.width,T.height);var E=d.zoom();n(M,!1),M.clearRect(T.mpan.x,T.mpan.y,T.width/T.zoom/c,T.height/T.zoom/c),M.drawImage(I,T.mpan.x,T.mpan.y,T.width/T.zoom/c,T.height/T.zoom/c)}else u.textureOnViewport&&!r&&(u.textureCache=null);var z=d.extent(),L=u.pinching||u.hoverData.dragging||u.swipePanning||u.data.wheelZooming||u.hoverData.draggingEles,A=u.hideEdgesOnViewport&&L,O=[];if(O[u.NODE]=!p[u.NODE]&&v&&!u.clearedForMotionBlur[u.NODE]||u.clearingMotionBlur,O[u.NODE]&&(u.clearedForMotionBlur[u.NODE]=!0),O[u.DRAG]=!p[u.DRAG]&&v&&!u.clearedForMotionBlur[u.DRAG]||u.clearingMotionBlur,O[u.DRAG]&&(u.clearedForMotionBlur[u.DRAG]=!0),p[u.NODE]||a||o||O[u.NODE]){var R=v&&!O[u.NODE]&&1!==g,M=r||(R?u.data.bufferContexts[u.MOTIONBLUR_BUFFER_NODE]:h.contexts[u.NODE]);n(M,v&&!R?"motionBlur":void 0),A?u.drawCachedNodes(M,k.nondrag,c,z):u.drawLayeredElements(M,k.nondrag,c,z),u.debug&&u.drawDebugPoints(M,k.nondrag),a||v||(p[u.NODE]=!1)}if(!o&&(p[u.DRAG]||a||O[u.DRAG])){var R=v&&!O[u.DRAG]&&1!==g,M=r||(R?u.data.bufferContexts[u.MOTIONBLUR_BUFFER_DRAG]:h.contexts[u.DRAG]);n(M,v&&!R?"motionBlur":void 0),A?u.drawCachedNodes(M,k.drag,c,z):u.drawCachedElements(M,k.drag,c,z),u.debug&&u.drawDebugPoints(M,k.drag),a||v||(p[u.DRAG]=!1)}if(u.showFps||!o&&p[u.SELECT_BOX]&&!a){var M=r||h.contexts[u.SELECT_BOX];if(n(M),1==u.selection[4]&&(u.hoverData.selecting||u.touchData.selecting)){var E=u.cy.zoom(),V=w["selection-box-border-width"].value/E;M.lineWidth=V,M.fillStyle="rgba("+w["selection-box-color"].value[0]+","+w["selection-box-color"].value[1]+","+w["selection-box-color"].value[2]+","+w["selection-box-opacity"].value+")",M.fillRect(u.selection[0],u.selection[1],u.selection[2]-u.selection[0],u.selection[3]-u.selection[1]),V>0&&(M.strokeStyle="rgba("+w["selection-box-border-color"].value[0]+","+w["selection-box-border-color"].value[1]+","+w["selection-box-border-color"].value[2]+","+w["selection-box-opacity"].value+")",M.strokeRect(u.selection[0],u.selection[1],u.selection[2]-u.selection[0],u.selection[3]-u.selection[1]))}if(h.bgActivePosistion&&!u.hoverData.selecting){var E=u.cy.zoom(),q=h.bgActivePosistion;M.fillStyle="rgba("+w["active-bg-color"].value[0]+","+w["active-bg-color"].value[1]+","+w["active-bg-color"].value[2]+","+w["active-bg-opacity"].value+")",M.beginPath(),M.arc(q.x,q.y,w["active-bg-size"].pfValue/E,0,2*Math.PI),M.fill()}var F=u.lastRedrawTime;if(u.showFps&&F){F=Math.round(F);var j=Math.round(1e3/F);M.setTransform(1,0,0,1,0,0),M.fillStyle="rgba(255, 0, 0, 0.75)",M.strokeStyle="rgba(255, 0, 0, 0.75)",M.lineWidth=1,M.fillText("1 frame = "+F+" ms = "+j+" fps",0,20);M.strokeRect(0,30,250,20),M.fillRect(0,30,250*Math.min(j/60,1),20)}a||(p[u.SELECT_BOX]=!1)}if(v&&1!==g){var X=h.contexts[u.NODE],Y=u.data.bufferCanvases[u.MOTIONBLUR_BUFFER_NODE],W=h.contexts[u.DRAG],H=u.data.bufferCanvases[u.MOTIONBLUR_BUFFER_DRAG],Z=function(e,n,r){e.setTransform(1,0,0,1,0,0),r||!x?e.clearRect(0,0,u.canvasWidth,u.canvasHeight):t(e,0,0,u.canvasWidth,u.canvasHeight);var i=g;e.drawImage(n,0,0,u.canvasWidth*i,u.canvasHeight*i,0,0,u.canvasWidth,u.canvasHeight)};(p[u.NODE]||O[u.NODE])&&(Z(X,Y,O[u.NODE]),p[u.NODE]=!1),(p[u.DRAG]||O[u.DRAG])&&(Z(W,H,O[u.DRAG]),p[u.DRAG]=!1)}u.prevViewport=T,u.clearingMotionBlur&&(u.clearingMotionBlur=!1,u.motionBlurCleared=!0,u.motionBlur=!0),v&&(u.motionBlurTimeout=setTimeout(function(){u.motionBlurTimeout=null,u.clearedForMotionBlur[u.NODE]=!1,u.clearedForMotionBlur[u.DRAG]=!1,u.motionBlur=!1,u.clearingMotionBlur=!f,u.mbFrames=0,p[u.NODE]=!0,p[u.DRAG]=!0,u.redraw()},100)),r||d.emit("render")},e.exports=r},function(e,t,n){"use strict";var r=n(2),i={};i.drawPolygonPath=function(e,t,n,r,i,a){var o=r/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+o*a[0],n+s*a[1]);for(var l=1;l0&&s>0){f.clearRect(0,0,a,s),f.globalCompositeOperation="source-over";var v=this.getCachedZSortedEles();if(e.full)f.translate(-r.x1*c,-r.y1*c),f.scale(c,c),this.drawElements(f,v),f.scale(1/c,1/c),f.translate(r.x1*c,r.y1*c);else{var g=t.pan(),y={x:g.x*c,y:g.y*c};c*=t.zoom(),f.translate(y.x,y.y),f.scale(c,c),this.drawElements(f,v),f.scale(1/c,1/c),f.translate(-y.x,-y.y)}e.bg&&(f.globalCompositeOperation="destination-over",f.fillStyle=e.bg,f.rect(0,0,a,s),f.fill())}return p},s.png=function(e){return a(e,this.bufferCanvasImage(e),"image/png")},s.jpg=function(e){return a(e,this.bufferCanvasImage(e),"image/jpeg")},e.exports=s},function(e,t,n){"use strict";var r={};r.nodeShapeImpl=function(e,t,n,r,i,a,o){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,i,a);case"polygon":return this.drawPolygonPath(t,n,r,i,a,o);case"roundrectangle":return this.drawRoundRectanglePath(t,n,r,i,a);case"cutrectangle":return this.drawCutRectanglePath(t,n,r,i,a);case"bottomroundrectangle":return this.drawBottomRoundRectanglePath(t,n,r,i,a);case"barrel":return this.drawBarrelPath(t,n,r,i,a)}},e.exports=r},function(e,t,n){"use strict";var r=n(0),i=n(1),a=n(18),o=function e(){if(!(this instanceof e))return new e;this.length=0},s=o.prototype;s.instanceString=function(){return"stylesheet"},s.selector=function(e){return this[this.length++]={selector:e,properties:[]},this},s.css=function(e,t){var n=this.length-1;if(r.string(e))this[n].properties.push({name:e,value:t});else if(r.plainObject(e))for(var o=e,s=0;s=0.10" + }, + "homepage": "http://js.cytoscape.org", + "keywords": [ + "graph", + "graph-theory", + "network", + "node", + "edge", + "vertex", + "link", + "analysis", + "visualisation", + "visualization", + "draw", + "render", + "biojs", + "cytoscape" + ], + "license": "MIT", + "main": "dist/cytoscape.cjs.js", + "name": "cytoscape", + "repository": { + "type": "git", + "url": "git+https://github.com/cytoscape/cytoscape.js.git" + }, + "scripts": { + "benchmark": "gulp benchmark", + "benchmark-single": "gulp benchmark-single", + "build": "gulp build", + "build-cjs": "gulp build-cjs", + "build-min": "gulp build-min", + "build-unmin": "gulp build-unmin", + "copyright": "update license", + "dist": "gulp dist", + "docs": "gulp docs", + "docs-min": "gulp docs-min", + "docs-pub": "gulp docs-pub", + "docs-push": "gulp docs-push", + "docs-push-unstable": "gulp docs-push-unstable", + "lint": "gulp lint", + "sniper": "sniper .", + "test": "gulp test", + "test-build": "gulp test-build", + "test-travis": "gulp build-cjs && gulp test-build", + "watch": "gulp watch", + "watch-babel": "gulp watch-babel", + "zip": "gulp zip" + }, + "sniper": { + "js": [ + "https://cdnjs.cloudflare.com/ajax/libs/fetch/2.0.3/fetch.min.js", + "/build/cytoscape.js" + ], + "first": "images" + }, + "version": "3.2.18" +} diff --git a/node_modules/cytoscape/src/animation.js b/node_modules/cytoscape/src/animation.js new file mode 100644 index 000000000..2c18e635b --- /dev/null +++ b/node_modules/cytoscape/src/animation.js @@ -0,0 +1,233 @@ +let util = require( './util' ); +let is = require( './is' ); +let Promise = require( './promise' ); + +let Animation = function( target, opts, opts2 ){ + let _p = this._private = util.extend( { + duration: 1000 + }, opts, opts2 ); + + _p.target = target; + _p.style = _p.style || _p.css; + _p.started = false; + _p.playing = false; + _p.hooked = false; + _p.applying = false; + _p.progress = 0; + _p.completes = []; + _p.frames = []; + + if( _p.complete && is.fn( _p.complete ) ){ + _p.completes.push( _p.complete ); + } + + // for future timeline/animations impl + this.length = 1; + this[0] = this; +}; + +let anifn = Animation.prototype; + +util.extend( anifn, { + + instanceString: function(){ return 'animation'; }, + + hook: function(){ + let _p = this._private; + + if( !_p.hooked ){ + // add to target's animation queue + let q; + let tAni = _p.target._private.animation; + if( _p.queue ){ + q = tAni.queue; + } else { + q = tAni.current; + } + q.push( this ); + + // add to the animation loop pool + if( is.elementOrCollection( _p.target ) ){ + _p.target.cy().addToAnimationPool( _p.target ); + } + + _p.hooked = true; + } + + return this; + }, + + play: function(){ + let _p = this._private; + + // autorewind + if( _p.progress === 1 ){ + _p.progress = 0; + } + + _p.playing = true; + _p.started = false; // needs to be started by animation loop + _p.stopped = false; + + this.hook(); + + // the animation loop will start the animation... + + return this; + }, + + playing: function(){ + return this._private.playing; + }, + + apply: function(){ + let _p = this._private; + + _p.applying = true; + _p.started = false; // needs to be started by animation loop + _p.stopped = false; + + this.hook(); + + // the animation loop will apply the animation at this progress + + return this; + }, + + applying: function(){ + return this._private.applying; + }, + + pause: function(){ + let _p = this._private; + + _p.playing = false; + _p.started = false; + + return this; + }, + + stop: function(){ + let _p = this._private; + + _p.playing = false; + _p.started = false; + _p.stopped = true; // to be removed from animation queues + + return this; + }, + + rewind: function(){ + return this.progress( 0 ); + }, + + fastforward: function(){ + return this.progress( 1 ); + }, + + time: function( t ){ + let _p = this._private; + + if( t === undefined ){ + return _p.progress * _p.duration; + } else { + return this.progress( t / _p.duration ); + } + }, + + progress: function( p ){ + let _p = this._private; + let wasPlaying = _p.playing; + + if( p === undefined ){ + return _p.progress; + } else { + if( wasPlaying ){ + this.pause(); + } + + _p.progress = p; + _p.started = false; + + if( wasPlaying ){ + this.play(); + } + } + + return this; + }, + + completed: function(){ + return this._private.progress === 1; + }, + + reverse: function(){ + let _p = this._private; + let wasPlaying = _p.playing; + + if( wasPlaying ){ + this.pause(); + } + + _p.progress = 1 - _p.progress; + _p.started = false; + + let swap = function( a, b ){ + let _pa = _p[ a ]; + + if( _pa == null ){ return; } + + _p[ a ] = _p[ b ]; + _p[ b ] = _pa; + }; + + swap( 'zoom', 'startZoom' ); + swap( 'pan', 'startPan' ); + swap( 'position', 'startPosition' ); + + // swap styles + if( _p.style ){ + for( let i = 0; i < _p.style.length; i++ ){ + let prop = _p.style[ i ]; + let name = prop.name; + let startStyleProp = _p.startStyle[ name ]; + + _p.startStyle[ name ] = prop; + _p.style[ i ] = startStyleProp; + } + } + + if( wasPlaying ){ + this.play(); + } + + return this; + }, + + promise: function( type ){ + let _p = this._private; + + let arr; + + switch( type ){ + case 'frame': + arr = _p.frames; + break; + default: + case 'complete': + case 'completed': + arr = _p.completes; + } + + return new Promise( function( resolve, reject ){ + arr.push( function(){ + resolve(); + } ); + } ); + } + +} ); + +anifn.complete = anifn.completed; + +module.exports = Animation; diff --git a/node_modules/cytoscape/src/collection/algorithms/a-star.js b/node_modules/cytoscape/src/collection/algorithms/a-star.js new file mode 100644 index 000000000..dd3f81df8 --- /dev/null +++ b/node_modules/cytoscape/src/collection/algorithms/a-star.js @@ -0,0 +1,206 @@ +var is = require( '../../is' ); + +var elesfn = ({ + + // Implemented from pseudocode from wikipedia + aStar: function( options ){ + var eles = this; + + options = options || {}; + + // Reconstructs the path from Start to End, acumulating the result in pathAcum + var reconstructPath = function( start, end, cameFromMap, pathAcum ){ + // Base case + if( start == end ){ + pathAcum.unshift( cy.getElementById( end ) ); + return pathAcum; + } + + if( end in cameFromMap ){ + // We know which node is before the last one + var previous = cameFromMap[ end ]; + var previousEdge = cameFromEdge[ end ]; + + pathAcum.unshift( cy.getElementById( previousEdge ) ); + pathAcum.unshift( cy.getElementById( end ) ); + + return reconstructPath( start, + previous, + cameFromMap, + pathAcum ); + } + + // We should not reach here! + return undefined; + }; + + // Returns the index of the element in openSet which has minimum fScore + var findMin = function( openSet, fScore ){ + if( openSet.length === 0 ){ + // Should never be the case + return undefined; + } + var minPos = 0; + var tempScore = fScore[ openSet[0] ]; + for( var i = 1; i < openSet.length; i++ ){ + var s = fScore[ openSet[ i ] ]; + if( s < tempScore ){ + tempScore = s; + minPos = i; + } + } + return minPos; + }; + + var cy = this._private.cy; + + // root - mandatory! + if( options != null && options.root != null ){ + var source = is.string( options.root ) ? + // use it as a selector, e.g. "#rootID + this.filter( options.root )[0] : + options.root[0]; + } else { + return undefined; + } + + // goal - mandatory! + if( options.goal != null ){ + var target = is.string( options.goal ) ? + // use it as a selector, e.g. "#goalID + this.filter( options.goal )[0] : + options.goal[0]; + } else { + return undefined; + } + + // Heuristic function - optional + if( options.heuristic != null && is.fn( options.heuristic ) ){ + var heuristic = options.heuristic; + } else { + var heuristic = function(){ return 0; }; // use constant if unspecified + } + + // Weight function - optional + if( options.weight != null && is.fn( options.weight ) ){ + var weightFn = options.weight; + } else { + // If not specified, assume each edge has equal weight (1) + var weightFn = function( e ){return 1;}; + } + + // directed - optional + if( options.directed != null ){ + var directed = options.directed; + } else { + var directed = false; + } + + var sid = source.id(); + var tid = target.id(); + + var closedSet = []; + var openSet = [ sid ]; + var cameFrom = {}; + var cameFromEdge = {}; + var gScore = {}; + var fScore = {}; + + gScore[ sid ] = 0; + fScore[ sid ] = heuristic( source ); + + // Counter + var steps = 0; + + // Main loop + while( openSet.length > 0 ){ + var minPos = findMin( openSet, fScore ); + var cMin = cy.getElementById( openSet[ minPos ] ); + var cMinId = cMin.id(); + steps++; + + // If we've found our goal, then we are done + if( cMinId == tid ){ + var rPath = reconstructPath( sid, tid, cameFrom, [] ); + + return { + found: true, + distance: gScore[ cMinId ], + path: eles.spawn( rPath ), + steps: steps + }; + } + + // Add cMin to processed nodes + closedSet.push( cMinId ); + // Remove cMin from boundary nodes + openSet.splice( minPos, 1 ); + + // Update scores for neighbors of cMin + // Take into account if graph is directed or not + var vwEdges = cMin._private.edges; + + for( var i = 0; i < vwEdges.length; i++ ){ + var e = vwEdges[ i ]; + + // edge must be in set of calling eles + if( !this.hasElementWithId( e.id() ) ){ continue; } + + // cMin must be the source of edge if directed + if( directed && e.data('source') !== cMinId ){ continue; } + + var wSrc = e.source(); + var wTgt = e.target(); + + var w = wSrc.id() !== cMinId ? wSrc : wTgt; + var wid = w.id(); + + // node must be in set of calling eles + if( !this.hasElementWithId( wid ) ){ continue; } + + // if node is in closedSet, ignore it + if( closedSet.indexOf( wid ) != -1 ){ + continue; + } + + // New tentative score for node w + var tempScore = gScore[ cMinId ] + weightFn( e ); + + // Update gScore for node w if: + // w not present in openSet + // OR + // tentative gScore is less than previous value + + // w not in openSet + if( openSet.indexOf( wid ) == -1 ){ + gScore[ wid ] = tempScore; + fScore[ wid ] = tempScore + heuristic( w ); + openSet.push( wid ); // Add node to openSet + cameFrom[ wid ] = cMinId; + cameFromEdge[ wid ] = e.id(); + continue; + } + // w already in openSet, but with greater gScore + if( tempScore < gScore[ wid ] ){ + gScore[ wid ] = tempScore; + fScore[ wid ] = tempScore + heuristic( w ); + cameFrom[ wid ] = cMinId; + } + + } // End of neighbors update + + } // End of main loop + + // If we've reached here, then we've not reached our goal + return { + found: false, + distance: undefined, + path: undefined, + steps: steps + }; + } + +}); // elesfn + + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/algorithms/bellman-ford.js b/node_modules/cytoscape/src/collection/algorithms/bellman-ford.js new file mode 100644 index 000000000..36ce4f747 --- /dev/null +++ b/node_modules/cytoscape/src/collection/algorithms/bellman-ford.js @@ -0,0 +1,192 @@ +var is = require( '../../is' ); +var util = require( '../../util' ); + +var elesfn = ({ + + // Implemented from pseudocode from wikipedia + bellmanFord: function( options ){ + var eles = this; + + options = options || {}; + + // Weight function - optional + if( options.weight != null && is.fn( options.weight ) ){ + var weightFn = options.weight; + } else { + // If not specified, assume each edge has equal weight (1) + var weightFn = function( e ){return 1;}; + } + + // directed - optional + if( options.directed != null ){ + var directed = options.directed; + } else { + var directed = false; + } + + // root - mandatory! + if( options.root != null ){ + if( is.string( options.root ) ){ + // use it as a selector, e.g. "#rootID + var source = this.filter( options.root )[0]; + } else { + var source = options.root[0]; + } + } else { + return undefined; + } + + var cy = this._private.cy; + var edges = this.edges().stdFilter( function( e ){ return !e.isLoop(); } ); + var nodes = this.nodes(); + var numNodes = nodes.length; + + // mapping: node id -> position in nodes array + var id2position = {}; + for( var i = 0; i < numNodes; i++ ){ + id2position[ nodes[ i ].id() ] = i; + } + + // Initializations + var cost = []; + var predecessor = []; + var predEdge = []; + + for( var i = 0; i < numNodes; i++ ){ + if( nodes[ i ].id() === source.id() ){ + cost[ i ] = 0; + } else { + cost[ i ] = Infinity; + } + predecessor[ i ] = undefined; + } + + // Edges relaxation + var flag = false; + for( var i = 1; i < numNodes; i++ ){ + flag = false; + for( var e = 0; e < edges.length; e++ ){ + var sourceIndex = id2position[ edges[ e ].source().id() ]; + var targetIndex = id2position[ edges[ e ].target().id() ]; + var weight = weightFn( edges[ e ] ); + + var temp = cost[ sourceIndex ] + weight; + if( temp < cost[ targetIndex ] ){ + cost[ targetIndex ] = temp; + predecessor[ targetIndex ] = sourceIndex; + predEdge[ targetIndex ] = edges[ e ]; + flag = true; + } + + // If undirected graph, we need to take into account the 'reverse' edge + if( !directed ){ + var temp = cost[ targetIndex ] + weight; + if( temp < cost[ sourceIndex ] ){ + cost[ sourceIndex ] = temp; + predecessor[ sourceIndex ] = targetIndex; + predEdge[ sourceIndex ] = edges[ e ]; + flag = true; + } + } + } + + if( !flag ){ + break; + } + } + + if( flag ){ + // Check for negative weight cycles + for( var e = 0; e < edges.length; e++ ){ + var sourceIndex = id2position[ edges[ e ].source().id() ]; + var targetIndex = id2position[ edges[ e ].target().id() ]; + var weight = weightFn( edges[ e ] ); + + if( cost[ sourceIndex ] + weight < cost[ targetIndex ] ){ + util.error( 'Graph contains a negative weight cycle for Bellman-Ford' ); + return { pathTo: undefined, + distanceTo: undefined, + hasNegativeWeightCycle: true}; + } + } + } + + // Build result object + var position2id = []; + for( var i = 0; i < numNodes; i++ ){ + position2id.push( nodes[ i ].id() ); + } + + + var res = { + distanceTo: function( to ){ + if( is.string( to ) ){ + // to is a selector string + var toId = (cy.filter( to )[0]).id(); + } else { + // to is a node + var toId = to.id(); + } + + return cost[ id2position[ toId ] ]; + }, + + pathTo: function( to ){ + + var reconstructPathAux = function( predecessor, fromPos, toPos, position2id, acumPath, predEdge ){ + for( ;; ){ + // Add toId to path + acumPath.push( cy.getElementById( position2id[ toPos ] ) ); + acumPath.push( predEdge[ toPos ] ); + + if( fromPos === toPos ){ + // reached starting node + return acumPath; + } + + // If no path exists, discart acumulated path and return undefined + var predPos = predecessor[ toPos ]; + if( typeof predPos === 'undefined' ){ + return undefined; + } + + toPos = predPos; + } + + }; + + if( is.string( to ) ){ + // to is a selector string + var toId = (cy.filter( to )[0]).id(); + } else { + // to is a node + var toId = to.id(); + } + var path = []; + + // This returns a reversed path + var res = reconstructPathAux( predecessor, + id2position[ source.id() ], + id2position[ toId ], + position2id, + path, + predEdge ); + + // Get it in the correct order and return it + if( res != null ){ + res.reverse(); + } + + return eles.spawn( res ); + }, + + hasNegativeWeightCycle: false + }; + + return res; + + } // bellmanFord + +}); // elesfn + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/algorithms/betweenness-centrality.js b/node_modules/cytoscape/src/collection/algorithms/betweenness-centrality.js new file mode 100644 index 000000000..d01d23029 --- /dev/null +++ b/node_modules/cytoscape/src/collection/algorithms/betweenness-centrality.js @@ -0,0 +1,190 @@ +var is = require( '../../is' ); +var Heap = require( '../../heap' ); + +var elesfn = ({ + + // Implemented from the algorithm in the paper "On Variants of Shortest-Path Betweenness Centrality and their Generic Computation" by Ulrik Brandes + betweennessCentrality: function( options ){ + options = options || {}; + + // Weight - optional + var weighted, weightFn; + if( is.fn( options.weight ) ){ + weightFn = options.weight; + weighted = true; + } else { + weighted = false; + } + + // Directed - default false + var directed = options.directed != null ? options.directed : false; + + var cy = this._private.cy; + + // starting + var V = this.nodes(); + var A = {}; + var _C = {}; + var max = 0; + var C = { + set: function( key, val ){ + _C[ key ] = val; + + if( val > max ){ max = val; } + }, + + get: function( key ){ return _C[ key ]; } + }; + + // A contains the neighborhoods of every node + for( var i = 0; i < V.length; i++ ){ + var v = V[ i ]; + var vid = v.id(); + + if( directed ){ + A[ vid ] = v.outgoers().nodes(); // get outgoers of every node + } else { + A[ vid ] = v.openNeighborhood().nodes(); // get neighbors of every node + } + + C.set( vid, 0 ); + } + + for( var s = 0; s < V.length; s++ ){ + var sid = V[s].id(); + var S = []; // stack + var P = {}; + var g = {}; + var d = {}; + var Q = new Heap(function( a, b ){ + return d[a] - d[b]; + }); // queue + + // init dictionaries + for( var i = 0; i < V.length; i++ ){ + var vid = V[ i ].id(); + + P[ vid ] = []; + g[ vid ] = 0; + d[ vid ] = Infinity; + } + + g[ sid ] = 1; // sigma + d[ sid ] = 0; // distance to s + + Q.push( sid ); + + while( !Q.empty() ){ + var v = Q.pop(); + + S.push( v ); + + if( weighted ){ + for( var j = 0; j < A[v].length; j++ ){ + var w = A[v][j]; + var vEle = cy.getElementById( v ); + + var edge; + if( vEle.edgesTo( w ).length > 0 ){ + edge = vEle.edgesTo( w )[0]; + } else { + edge = w.edgesTo( vEle )[0]; + } + + var edgeWeight = weightFn( edge ); + + w = w.id(); + + if( d[w] > d[v] + edgeWeight ){ + d[w] = d[v] + edgeWeight; + + if( Q.nodes.indexOf( w ) < 0 ){ //if w is not in Q + Q.push( w ); + } else { // update position if w is in Q + Q.updateItem( w ); + } + + g[w] = 0; + P[w] = []; + } + + if( d[w] == d[v] + edgeWeight ){ + g[w] = g[w] + g[v]; + P[w].push( v ); + } + } + } else { + for( var j = 0; j < A[v].length; j++ ){ + var w = A[v][j].id(); + + if( d[w] == Infinity ){ + Q.push( w ); + + d[w] = d[v] + 1; + } + + if( d[w] == d[v] + 1 ){ + g[w] = g[w] + g[v]; + P[w].push( v ); + } + } + } + } + + var e = {}; + for( var i = 0; i < V.length; i++ ){ + e[ V[ i ].id() ] = 0; + } + + while( S.length > 0 ){ + var w = S.pop(); + + for( var j = 0; j < P[w].length; j++ ){ + var v = P[w][j]; + + e[v] = e[v] + (g[v] / g[w]) * (1 + e[w]); + + if( w != V[s].id() ){ + C.set( w, C.get( w ) + e[w] ); + } + } + } + } + + var ret = { + betweenness: function( node ){ + if( is.string( node ) ){ + var node = cy.filter( node ).id(); + } else { + var node = node.id(); + } + + return C.get( node ); + }, + + betweennessNormalized: function( node ){ + if ( max == 0 ) + return 0; + + if( is.string( node ) ){ + var node = cy.filter( node ).id(); + } else { + var node = node.id(); + } + + return C.get( node ) / max; + } + }; + + // alias + ret.betweennessNormalised = ret.betweennessNormalized; + + return ret; + } // betweennessCentrality + +}); // elesfn + +// nice, short mathemathical alias +elesfn.bc = elesfn.betweennessCentrality; + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/algorithms/bfs-dfs.js b/node_modules/cytoscape/src/collection/algorithms/bfs-dfs.js new file mode 100644 index 000000000..7d0ea51ab --- /dev/null +++ b/node_modules/cytoscape/src/collection/algorithms/bfs-dfs.js @@ -0,0 +1,130 @@ +var is = require( '../../is' ); + +var defineSearch = function( params ){ + params = { + bfs: params.bfs || !params.dfs, + dfs: params.dfs || !params.bfs + }; + + // from pseudocode on wikipedia + return function searchFn( roots, fn, directed ){ + var options; + if( is.plainObject( roots ) && !is.elementOrCollection( roots ) ){ + options = roots; + roots = options.roots || options.root; + fn = options.visit; + directed = options.directed; + } + + directed = arguments.length === 2 && !is.fn( fn ) ? fn : directed; + fn = is.fn( fn ) ? fn : function(){}; + + var cy = this._private.cy; + var v = roots = is.string( roots ) ? this.filter( roots ) : roots; + var Q = []; + var connectedNodes = []; + var connectedBy = {}; + var id2depth = {}; + var V = {}; + var j = 0; + var found; + var nodes = this.nodes(); + var edges = this.edges(); + + // enqueue v + for( var i = 0; i < v.length; i++ ){ + if( v[ i ].isNode() ){ + Q.unshift( v[ i ] ); + + if( params.bfs ){ + V[ v[ i ].id() ] = true; + + connectedNodes.push( v[ i ] ); + } + + id2depth[ v[ i ].id() ] = 0; + } + } + + while( Q.length !== 0 ){ + var v = params.bfs ? Q.shift() : Q.pop(); + + if( params.dfs ){ + if( V[ v.id() ] ){ continue; } + + V[ v.id() ] = true; + + connectedNodes.push( v ); + } + + var depth = id2depth[ v.id() ]; + var prevEdge = connectedBy[ v.id() ]; + var prevNode = prevEdge == null ? undefined : prevEdge.connectedNodes().not( v )[0]; + var ret; + + ret = fn( v, prevEdge, prevNode, j++, depth ); + + if( ret === true ){ + found = v; + break; + } + + if( ret === false ){ + break; + } + + var vwEdges = v.connectedEdges( directed ? function( ele ){ return ele.data( 'source' ) === v.id(); } : undefined ).intersect( edges ); + for( var i = 0; i < vwEdges.length; i++ ){ + var e = vwEdges[ i ]; + var w = e.connectedNodes( function( n ){ return n.id() !== v.id(); } ).intersect( nodes ); + + if( w.length !== 0 && !V[ w.id() ] ){ + w = w[0]; + + Q.push( w ); + + if( params.bfs ){ + V[ w.id() ] = true; + + connectedNodes.push( w ); + } + + connectedBy[ w.id() ] = e; + + id2depth[ w.id() ] = id2depth[ v.id() ] + 1; + } + } + + } + + var connectedEles = []; + + for( var i = 0; i < connectedNodes.length; i++ ){ + var node = connectedNodes[ i ]; + var edge = connectedBy[ node.id() ]; + + if( edge ){ + connectedEles.push( edge ); + } + + connectedEles.push( node ); + } + + return { + path: cy.collection( connectedEles, { unique: true } ), + found: cy.collection( found ) + }; + }; +}; + +// search, spanning trees, etc +var elesfn = ({ + breadthFirstSearch: defineSearch( { bfs: true } ), + depthFirstSearch: defineSearch( { dfs: true } ) +}); + +// nice, short mathemathical alias +elesfn.bfs = elesfn.breadthFirstSearch; +elesfn.dfs = elesfn.depthFirstSearch; + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/algorithms/closeness-centrality.js b/node_modules/cytoscape/src/collection/algorithms/closeness-centrality.js new file mode 100644 index 000000000..09de61be7 --- /dev/null +++ b/node_modules/cytoscape/src/collection/algorithms/closeness-centrality.js @@ -0,0 +1,128 @@ +var is = require( '../../is' ); + +var elesfn = ({ + + closenessCentralityNormalized: function( options ){ + options = options || {}; + + var cy = this.cy(); + + var harmonic = options.harmonic; + if( harmonic === undefined ){ + harmonic = true; + } + + var closenesses = {}; + var maxCloseness = 0; + var nodes = this.nodes(); + var fw = this.floydWarshall( { weight: options.weight, directed: options.directed } ); + + // Compute closeness for every node and find the maximum closeness + for( var i = 0; i < nodes.length; i++ ){ + var currCloseness = 0; + for( var j = 0; j < nodes.length; j++ ){ + if( i != j ){ + var d = fw.distance( nodes[ i ], nodes[ j ] ); + + if( harmonic ){ + currCloseness += 1 / d; + } else { + currCloseness += d; + } + } + } + + if( !harmonic ){ + currCloseness = 1 / currCloseness; + } + + if( maxCloseness < currCloseness ){ + maxCloseness = currCloseness; + } + + closenesses[ nodes[ i ].id() ] = currCloseness; + } + + return { + closeness: function( node ){ + if( maxCloseness == 0 ){ return 0; } + + if( is.string( node ) ){ + // from is a selector string + var node = (cy.filter( node )[0]).id(); + } else { + // from is a node + var node = node.id(); + } + + return closenesses[ node ] / maxCloseness; + } + }; + }, + + // Implemented from pseudocode from wikipedia + closenessCentrality: function( options ){ + options = options || {}; + + // root - mandatory! + if( options.root != null ){ + if( is.string( options.root ) ){ + // use it as a selector, e.g. "#rootID + var root = this.filter( options.root )[0]; + } else { + var root = options.root[0]; + } + } else { + return undefined; + } + + // weight - optional + if( options.weight != null && is.fn( options.weight ) ){ + var weight = options.weight; + } else { + var weight = function(){return 1;}; + } + + // directed - optional + if( options.directed != null && is.bool( options.directed ) ){ + var directed = options.directed; + } else { + var directed = false; + } + + var harmonic = options.harmonic; + if( harmonic === undefined ){ + harmonic = true; + } + + // we need distance from this node to every other node + var dijkstra = this.dijkstra( { + root: root, + weight: weight, + directed: directed + } ); + var totalDistance = 0; + + var nodes = this.nodes(); + for( var i = 0; i < nodes.length; i++ ){ + if( nodes[ i ].id() != root.id() ){ + var d = dijkstra.distanceTo( nodes[ i ] ); + + if( harmonic ){ + totalDistance += 1 / d; + } else { + totalDistance += d; + } + } + } + + return harmonic ? totalDistance : 1 / totalDistance; + } // closenessCentrality + +}); // elesfn + +// nice, short mathemathical alias +elesfn.cc = elesfn.closenessCentrality; +elesfn.ccn = elesfn.closenessCentralityNormalised = elesfn.closenessCentralityNormalized; + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/algorithms/degree-centrality.js b/node_modules/cytoscape/src/collection/algorithms/degree-centrality.js new file mode 100644 index 000000000..aec826b3b --- /dev/null +++ b/node_modules/cytoscape/src/collection/algorithms/degree-centrality.js @@ -0,0 +1,194 @@ +var is = require( '../../is' ); +var util = require( '../../util' ); + +var elesfn = ({ + + degreeCentralityNormalized: function( options ){ + options = options || {}; + + var cy = this.cy(); + + // directed - optional + if( options.directed != null ){ + var directed = options.directed; + } else { + var directed = false; + } + + var nodes = this.nodes(); + var numNodes = nodes.length; + + if( !directed ){ + var degrees = {}; + var maxDegree = 0; + + for( var i = 0; i < numNodes; i++ ){ + var node = nodes[ i ]; + // add current node to the current options object and call degreeCentrality + var currDegree = this.degreeCentrality( util.extend( {}, options, {root: node} ) ); + if( maxDegree < currDegree.degree ) + maxDegree = currDegree.degree; + + degrees[ node.id() ] = currDegree.degree; + } + + return { + degree: function( node ){ + if( maxDegree == 0 ) + return 0; + + if( is.string( node ) ){ + // from is a selector string + var node = (cy.filter( node )[0]).id(); + } else { + // from is a node + var node = node.id(); + } + + return degrees[ node ] / maxDegree; + } + }; + } else { + var indegrees = {}; + var outdegrees = {}; + var maxIndegree = 0; + var maxOutdegree = 0; + + for( var i = 0; i < numNodes; i++ ){ + var node = nodes[ i ]; + // add current node to the current options object and call degreeCentrality + var currDegree = this.degreeCentrality( util.extend( {}, options, {root: node} ) ); + + if( maxIndegree < currDegree.indegree ) + maxIndegree = currDegree.indegree; + + if( maxOutdegree < currDegree.outdegree ) + maxOutdegree = currDegree.outdegree; + + indegrees[ node.id() ] = currDegree.indegree; + outdegrees[ node.id() ] = currDegree.outdegree; + } + + return { + indegree: function( node ){ + if ( maxIndegree == 0 ) + return 0; + + if( is.string( node ) ){ + // from is a selector string + var node = (cy.filter( node )[0]).id(); + } else { + // from is a node + var node = node.id(); + } + + return indegrees[ node ] / maxIndegree; + }, + outdegree: function( node ){ + if ( maxOutdegree == 0 ) + return 0; + + if( is.string( node ) ){ + // from is a selector string + var node = (cy.filter( node )[0]).id(); + } else { + // from is a node + var node = node.id(); + } + + return outdegrees[ node ] / maxOutdegree; + } + + }; + } + + }, // degreeCentralityNormalized + + // Implemented from the algorithm in Opsahl's paper + // "Node centrality in weighted networks: Generalizing degree and shortest paths" + // check the heading 2 "Degree" + degreeCentrality: function( options ){ + options = options || {}; + + var callingEles = this; + + // root - mandatory! + if( options != null && options.root != null ){ + var root = is.string( options.root ) ? this.filter( options.root )[0] : options.root[0]; + } else { + return undefined; + } + + // weight - optional + if( options.weight != null && is.fn( options.weight ) ){ + var weightFn = options.weight; + } else { + // If not specified, assume each edge has equal weight (1) + var weightFn = function( e ){ + return 1; + }; + } + + // directed - optional + if( options.directed != null ){ + var directed = options.directed; + } else { + var directed = false; + } + + // alpha - optional + if( options.alpha != null && is.number( options.alpha ) ){ + var alpha = options.alpha; + } else { + alpha = 0; + } + + + if( !directed ){ + var connEdges = root.connectedEdges().intersection( callingEles ); + var k = connEdges.length; + var s = 0; + + // Now, sum edge weights + for( var i = 0; i < connEdges.length; i++ ){ + var edge = connEdges[ i ]; + s += weightFn( edge ); + } + + return { + degree: Math.pow( k, 1 - alpha ) * Math.pow( s, alpha ) + }; + } else { + var incoming = root.connectedEdges( 'edge[target = "' + root.id() + '"]' ).intersection( callingEles ); + var outgoing = root.connectedEdges( 'edge[source = "' + root.id() + '"]' ).intersection( callingEles ); + var k_in = incoming.length; + var k_out = outgoing.length; + var s_in = 0; + var s_out = 0; + + // Now, sum incoming edge weights + for( var i = 0; i < incoming.length; i++ ){ + var edge = incoming[ i ]; + s_in += weightFn( edge ); + } + + // Now, sum outgoing edge weights + for( var i = 0; i < outgoing.length; i++ ){ + var edge = outgoing[ i ]; + s_out += weightFn( edge ); + } + + return { + indegree: Math.pow( k_in, 1 - alpha ) * Math.pow( s_in, alpha ), + outdegree: Math.pow( k_out, 1 - alpha ) * Math.pow( s_out, alpha ) + }; + } + } // degreeCentrality + +}); // elesfn + +// nice, short mathemathical alias +elesfn.dc = elesfn.degreeCentrality; +elesfn.dcn = elesfn.degreeCentralityNormalised = elesfn.degreeCentralityNormalized; + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/algorithms/dijkstra.js b/node_modules/cytoscape/src/collection/algorithms/dijkstra.js new file mode 100644 index 000000000..c45a3771f --- /dev/null +++ b/node_modules/cytoscape/src/collection/algorithms/dijkstra.js @@ -0,0 +1,129 @@ +var is = require( '../../is' ); +var Heap = require( '../../heap' ); + +var elesfn = ({ + + dijkstra: function( root, weightFn, directed ){ + var options; + if( is.plainObject( root ) && !is.elementOrCollection( root ) ){ + options = root; + root = options.root; + weightFn = options.weight; + directed = options.directed; + } + + var cy = this._private.cy; + weightFn = is.fn( weightFn ) ? weightFn : function(){ return 1; }; // if not specified, assume each edge has equal weight (1) + + var source = is.string( root ) ? this.filter( root )[0] : root[0]; + var dist = {}; + var prev = {}; + var knownDist = {}; + + var edges = this.edges().filter( function( ele ){ return !ele.isLoop(); } ); + var nodes = this.nodes(); + + var getDist = function( node ){ + return dist[ node.id() ]; + }; + + var setDist = function( node, d ){ + dist[ node.id() ] = d; + + Q.updateItem( node ); + }; + + var Q = new Heap( function( a, b ){ + return getDist( a ) - getDist( b ); + } ); + + for( var i = 0; i < nodes.length; i++ ){ + var node = nodes[ i ]; + + dist[ node.id() ] = node.same( source ) ? 0 : Infinity; + Q.push( node ); + } + + var distBetween = function( u, v ){ + var uvs = ( directed ? u.edgesTo( v ) : u.edgesWith( v ) ).intersect( edges ); + var smallestDistance = Infinity; + var smallestEdge; + + for( var i = 0; i < uvs.length; i++ ){ + var edge = uvs[ i ]; + var weight = weightFn( edge ); + + if( weight < smallestDistance || !smallestEdge ){ + smallestDistance = weight; + smallestEdge = edge; + } + } + + return { + edge: smallestEdge, + dist: smallestDistance + }; + }; + + while( Q.size() > 0 ){ + var u = Q.pop(); + var smalletsDist = getDist( u ); + var uid = u.id(); + + knownDist[ uid ] = smalletsDist; + + if( smalletsDist === Infinity ){ + continue; + } + + var neighbors = u.neighborhood().intersect( nodes ); + for( var i = 0; i < neighbors.length; i++ ){ + var v = neighbors[ i ]; + var vid = v.id(); + var vDist = distBetween( u, v ); + + var alt = smalletsDist + vDist.dist; + + if( alt < getDist( v ) ){ + setDist( v, alt ); + + prev[ vid ] = { + node: u, + edge: vDist.edge + }; + } + } // for + } // while + + return { + distanceTo: function( node ){ + var target = is.string( node ) ? nodes.filter( node )[0] : node[0]; + + return knownDist[ target.id() ]; + }, + + pathTo: function( node ){ + var target = is.string( node ) ? nodes.filter( node )[0] : node[0]; + var S = []; + var u = target; + + if( target.length > 0 ){ + S.unshift( target ); + + while( prev[ u.id() ] ){ + var p = prev[ u.id() ]; + + S.unshift( p.edge ); + S.unshift( p.node ); + + u = p.node; + } + } + + return cy.collection( S ); + } + }; + } +}); + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/algorithms/floyd-warshall.js b/node_modules/cytoscape/src/collection/algorithms/floyd-warshall.js new file mode 100644 index 000000000..f056adced --- /dev/null +++ b/node_modules/cytoscape/src/collection/algorithms/floyd-warshall.js @@ -0,0 +1,192 @@ +var is = require( '../../is' ); + +var elesfn = ({ + + // Implemented from pseudocode from wikipedia + floydWarshall: function( options ){ + options = options || {}; + + var cy = this.cy(); + + // Weight function - optional + if( options.weight != null && is.fn( options.weight ) ){ + var weightFn = options.weight; + } else { + // If not specified, assume each edge has equal weight (1) + var weightFn = function( e ){return 1;}; + } + + // directed - optional + if( options.directed != null ){ + var directed = options.directed; + } else { + var directed = false; + } + + var edges = this.edges().stdFilter( function( e ){ return !e.isLoop(); } ); + var nodes = this.nodes(); + var numNodes = nodes.length; + + // mapping: node id -> position in nodes array + var id2position = {}; + for( var i = 0; i < numNodes; i++ ){ + id2position[ nodes[ i ].id() ] = i; + } + + // Initialize distance matrix + var dist = []; + for( var i = 0; i < numNodes; i++ ){ + var newRow = new Array( numNodes ); + for( var j = 0; j < numNodes; j++ ){ + if( i == j ){ + newRow[ j ] = 0; + } else { + newRow[ j ] = Infinity; + } + } + dist.push( newRow ); + } + + // Initialize matrix used for path reconstruction + // Initialize distance matrix + var next = []; + var edgeNext = []; + + var initMatrix = function( next ){ + for( var i = 0; i < numNodes; i++ ){ + var newRow = new Array( numNodes ); + for( var j = 0; j < numNodes; j++ ){ + newRow[ j ] = undefined; + } + next.push( newRow ); + } + }; + + initMatrix( next ); + initMatrix( edgeNext ); + + // Process edges + for( var i = 0; i < edges.length ; i++ ){ + var sourceIndex = id2position[ edges[ i ].source().id() ]; + var targetIndex = id2position[ edges[ i ].target().id() ]; + var weight = weightFn( edges[ i ] ); + + // Check if already process another edge between same 2 nodes + if( dist[ sourceIndex ][ targetIndex ] > weight ){ + dist[ sourceIndex ][ targetIndex ] = weight; + next[ sourceIndex ][ targetIndex ] = targetIndex; + edgeNext[ sourceIndex ][ targetIndex ] = edges[ i ]; + } + } + + // If undirected graph, process 'reversed' edges + if( !directed ){ + for( var i = 0; i < edges.length ; i++ ){ + var sourceIndex = id2position[ edges[ i ].target().id() ]; + var targetIndex = id2position[ edges[ i ].source().id() ]; + var weight = weightFn( edges[ i ] ); + + // Check if already process another edge between same 2 nodes + if( dist[ sourceIndex ][ targetIndex ] > weight ){ + dist[ sourceIndex ][ targetIndex ] = weight; + next[ sourceIndex ][ targetIndex ] = targetIndex; + edgeNext[ sourceIndex ][ targetIndex ] = edges[ i ]; + } + } + } + + // Main loop + for( var k = 0; k < numNodes; k++ ){ + for( var i = 0; i < numNodes; i++ ){ + for( var j = 0; j < numNodes; j++ ){ + if( dist[ i ][ k ] + dist[ k ][ j ] < dist[ i ][ j ] ){ + dist[ i ][ j ] = dist[ i ][ k ] + dist[ k ][ j ]; + next[ i ][ j ] = next[ i ][ k ]; + } + } + } + } + + // Build result object + var position2id = []; + for( var i = 0; i < numNodes; i++ ){ + position2id.push( nodes[ i ].id() ); + } + + var res = { + distance: function( from, to ){ + if( is.string( from ) ){ + // from is a selector string + var fromId = (cy.filter( from )[0]).id(); + } else { + // from is a node + var fromId = from.id(); + } + + if( is.string( to ) ){ + // to is a selector string + var toId = (cy.filter( to )[0]).id(); + } else { + // to is a node + var toId = to.id(); + } + + return dist[ id2position[ fromId ] ][ id2position[ toId ] ]; + }, + + path: function( from, to ){ + var reconstructPathAux = function( from, to, next, position2id, edgeNext ){ + if( from === to ){ + return cy.getElementById( position2id[ from ] ); + } + if( next[ from ][ to ] === undefined ){ + return undefined; + } + + var path = [ cy.getElementById( position2id[ from ] ) ]; + var prev = from; + while( from !== to ){ + prev = from; + from = next[ from ][ to ]; + + var edge = edgeNext[ prev ][ from ]; + path.push( edge ); + + path.push( cy.getElementById( position2id[ from ] ) ); + } + return path; + }; + + if( is.string( from ) ){ + // from is a selector string + var fromId = (cy.filter( from )[0]).id(); + } else { + // from is a node + var fromId = from.id(); + } + + if( is.string( to ) ){ + // to is a selector string + var toId = (cy.filter( to )[0]).id(); + } else { + // to is a node + var toId = to.id(); + } + + var pathArr = reconstructPathAux( id2position[ fromId ], + id2position[ toId ], + next, + position2id, + edgeNext ); + + return cy.collection( pathArr ); + } + }; + + return res; + + } // floydWarshall + +}); // elesfn + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/algorithms/index.js b/node_modules/cytoscape/src/collection/algorithms/index.js new file mode 100644 index 000000000..f0149fea9 --- /dev/null +++ b/node_modules/cytoscape/src/collection/algorithms/index.js @@ -0,0 +1,21 @@ +var util = require( '../../util' ); + +var elesfn = {}; + +[ + require( './bfs-dfs' ), + require( './dijkstra' ), + require( './kruskal' ), + require( './a-star' ), + require( './floyd-warshall' ), + require( './bellman-ford' ), + require( './kerger-stein' ), + require( './page-rank' ), + require( './degree-centrality' ), + require( './closeness-centrality' ), + require( './betweenness-centrality' ) +].forEach( function( props ){ + util.extend( elesfn, props ); +} ); + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/algorithms/kerger-stein.js b/node_modules/cytoscape/src/collection/algorithms/kerger-stein.js new file mode 100644 index 000000000..290bc0224 --- /dev/null +++ b/node_modules/cytoscape/src/collection/algorithms/kerger-stein.js @@ -0,0 +1,170 @@ +var util = require( '../../util' ); + +var elesfn = ({ + + // Computes the minimum cut of an undirected graph + // Returns the correct answer with high probability + kargerStein: function( options ){ + var eles = this; + + options = options || {}; + + // Function which colapses 2 (meta) nodes into one + // Updates the remaining edge lists + // Receives as a paramater the edge which causes the collapse + var colapse = function( edgeIndex, nodeMap, remainingEdges ){ + var edgeInfo = remainingEdges[ edgeIndex ]; + var sourceIn = edgeInfo[1]; + var targetIn = edgeInfo[2]; + var partition1 = nodeMap[ sourceIn ]; + var partition2 = nodeMap[ targetIn ]; + + // Delete all edges between partition1 and partition2 + var newEdges = remainingEdges.filter( function( edge ){ + if( nodeMap[ edge[1] ] === partition1 && nodeMap[ edge[2] ] === partition2 ){ + return false; + } + if( nodeMap[ edge[1] ] === partition2 && nodeMap[ edge[2] ] === partition1 ){ + return false; + } + return true; + } ); + + // All edges pointing to partition2 should now point to partition1 + for( var i = 0; i < newEdges.length; i++ ){ + var edge = newEdges[ i ]; + if( edge[1] === partition2 ){ // Check source + newEdges[ i ] = edge.slice( 0 ); + newEdges[ i ][1] = partition1; + } else if( edge[2] === partition2 ){ // Check target + newEdges[ i ] = edge.slice( 0 ); + newEdges[ i ][2] = partition1; + } + } + + // Move all nodes from partition2 to partition1 + for( var i = 0; i < nodeMap.length; i++ ){ + if( nodeMap[ i ] === partition2 ){ + nodeMap[ i ] = partition1; + } + } + + return newEdges; + }; + + + // Contracts a graph until we reach a certain number of meta nodes + var contractUntil = function( metaNodeMap, + remainingEdges, + size, + sizeLimit ){ + // Stop condition + if( size <= sizeLimit ){ + return remainingEdges; + } + + // Choose an edge randomly + var edgeIndex = Math.floor( (Math.random() * remainingEdges.length) ); + + // Colapse graph based on edge + var newEdges = colapse( edgeIndex, metaNodeMap, remainingEdges ); + + return contractUntil( metaNodeMap, + newEdges, + size - 1, + sizeLimit ); + }; + + var cy = this._private.cy; + var edges = this.edges().stdFilter( function( e ){ return !e.isLoop(); } ); + var nodes = this.nodes(); + var numNodes = nodes.length; + var numEdges = edges.length; + var numIter = Math.ceil( Math.pow( Math.log( numNodes ) / Math.LN2, 2 ) ); + var stopSize = Math.floor( numNodes / Math.sqrt( 2 ) ); + + if( numNodes < 2 ){ + util.error( 'At least 2 nodes are required for Karger-Stein algorithm' ); + return undefined; + } + + // Create numerical identifiers for each node + // mapping: node id -> position in nodes array + // for reverse mapping, simply use nodes array + var id2position = {}; + for( var i = 0; i < numNodes; i++ ){ + id2position[ nodes[ i ].id() ] = i; + } + + // Now store edge destination as indexes + // Format for each edge (edge index, source node index, target node index) + var edgeIndexes = []; + for( var i = 0; i < numEdges; i++ ){ + var e = edges[ i ]; + edgeIndexes.push( [ i, id2position[ e.source().id() ], id2position[ e.target().id() ] ] ); + } + + // We will store the best cut found here + var minCutSize = Infinity; + var minCut; + + // Initial meta node partition + var originalMetaNode = []; + for( var i = 0; i < numNodes; i++ ){ + originalMetaNode.push( i ); + } + + // Main loop + for( var iter = 0; iter <= numIter; iter++ ){ + // Create new meta node partition + var metaNodeMap = originalMetaNode.slice( 0 ); + + // Contract until stop point (stopSize nodes) + var edgesState = contractUntil( metaNodeMap, edgeIndexes, numNodes, stopSize ); + + // Create a copy of the colapsed nodes state + var metaNodeMap2 = metaNodeMap.slice( 0 ); + + // Run 2 iterations starting in the stop state + var res1 = contractUntil( metaNodeMap, edgesState, stopSize, 2 ); + var res2 = contractUntil( metaNodeMap2, edgesState, stopSize, 2 ); + + // Is any of the 2 results the best cut so far? + if( res1.length <= res2.length && res1.length < minCutSize ){ + minCutSize = res1.length; + minCut = [ res1, metaNodeMap ]; + } else if( res2.length <= res1.length && res2.length < minCutSize ){ + minCutSize = res2.length; + minCut = [ res2, metaNodeMap2 ]; + } + } // end of main loop + + + // Construct result + var resEdges = (minCut[0]).map( function( e ){ return edges[ e[0] ]; } ); + var partition1 = []; + var partition2 = []; + + // traverse metaNodeMap for best cut + var witnessNodePartition = minCut[1][0]; + for( var i = 0; i < minCut[1].length; i++ ){ + var partitionId = minCut[1][ i ]; + if( partitionId === witnessNodePartition ){ + partition1.push( nodes[ i ] ); + } else { + partition2.push( nodes[ i ] ); + } + } + + var ret = { + cut: eles.spawn( cy, resEdges ), + partition1: eles.spawn( partition1 ), + partition2: eles.spawn( partition2 ) + }; + + return ret; + } +}); // elesfn + + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/algorithms/kruskal.js b/node_modules/cytoscape/src/collection/algorithms/kruskal.js new file mode 100644 index 000000000..3b471f1a1 --- /dev/null +++ b/node_modules/cytoscape/src/collection/algorithms/kruskal.js @@ -0,0 +1,62 @@ +var is = require( '../../is' ); + +// search, spanning trees, etc +var elesfn = ({ + + // kruskal's algorithm (finds min spanning tree, assuming undirected graph) + // implemented from pseudocode from wikipedia + kruskal: function( weightFn ){ + var cy = this.cy(); + + weightFn = is.fn( weightFn ) ? weightFn : function(){ return 1; }; // if not specified, assume each edge has equal weight (1) + + function findSet( ele ){ + for( var i = 0; i < forest.length; i++ ){ + var eles = forest[ i ]; + + if( eles.anySame( ele ) ){ + return { + eles: eles, + index: i + }; + } + } + } + + var A = cy.collection( cy, [] ); + var forest = []; + var nodes = this.nodes(); + + for( var i = 0; i < nodes.length; i++ ){ + forest.push( nodes[ i ].collection() ); + } + + var edges = this.edges(); + var S = edges.toArray().sort( function( a, b ){ + var weightA = weightFn( a ); + var weightB = weightFn( b ); + + return weightA - weightB; + } ); + + for( var i = 0; i < S.length; i++ ){ + var edge = S[ i ]; + var u = edge.source()[0]; + var v = edge.target()[0]; + var setU = findSet( u ); + var setV = findSet( v ); + + if( setU.index !== setV.index ){ + A = A.add( edge ); + + // combine forests for u and v + forest[ setU.index ] = setU.eles.add( setV.eles ); + forest.splice( setV.index, 1 ); + } + } + + return nodes.add( A ); + } +}); + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/algorithms/page-rank.js b/node_modules/cytoscape/src/collection/algorithms/page-rank.js new file mode 100644 index 000000000..a29cdc59c --- /dev/null +++ b/node_modules/cytoscape/src/collection/algorithms/page-rank.js @@ -0,0 +1,179 @@ +var is = require( '../../is' ); + +var elesfn = ({ + + pageRank: function( options ){ + options = options || {}; + + var normalizeVector = function( vector ){ + var length = vector.length; + + // First, get sum of all elements + var total = 0; + for( var i = 0; i < length; i++ ){ + total += vector[ i ]; + } + + // Now, divide each by the sum of all elements + for( var i = 0; i < length; i++ ){ + vector[ i ] = vector[ i ] / total; + } + }; + + // dampingFactor - optional + if( options != null && + options.dampingFactor != null ){ + var dampingFactor = options.dampingFactor; + } else { + var dampingFactor = 0.8; // Default damping factor + } + + // desired precision - optional + if( options != null && + options.precision != null ){ + var epsilon = options.precision; + } else { + var epsilon = 0.000001; // Default precision + } + + // Max number of iterations - optional + if( options != null && + options.iterations != null ){ + var numIter = options.iterations; + } else { + var numIter = 200; // Default number of iterations + } + + // Weight function - optional + if( options != null && + options.weight != null && + is.fn( options.weight ) ){ + var weightFn = options.weight; + } else { + // If not specified, assume each edge has equal weight (1) + var weightFn = function( e ){return 1;}; + } + + var cy = this._private.cy; + var edges = this.edges().stdFilter( function( e ){ return !e.isLoop(); } ); + var nodes = this.nodes(); + var numNodes = nodes.length; + var numEdges = edges.length; + + // Create numerical identifiers for each node + // mapping: node id -> position in nodes array + // for reverse mapping, simply use nodes array + var id2position = {}; + for( var i = 0; i < numNodes; i++ ){ + id2position[ nodes[ i ].id() ] = i; + } + + // Construct transposed adjacency matrix + // First lets have a zeroed matrix of the right size + // We'll also keep track of the sum of each column + var matrix = []; + var columnSum = []; + var additionalProb = (1 - dampingFactor) / numNodes; + + // Create null matric + for( var i = 0; i < numNodes; i++ ){ + var newRow = []; + for( var j = 0; j < numNodes; j++ ){ + newRow.push( 0.0 ); + } + matrix.push( newRow ); + columnSum.push( 0.0 ); + } + + // Now, process edges + for( var i = 0; i < numEdges; i++ ){ + var edge = edges[ i ]; + var s = id2position[ edge.source().id() ]; + var t = id2position[ edge.target().id() ]; + var w = weightFn( edge ); + + // Update matrix + matrix[ t ][ s ] += w; + + // Update column sum + columnSum[ s ] += w; + } + + // Add additional probability based on damping factor + // Also, take into account columns that have sum = 0 + var p = 1.0 / numNodes + additionalProb; // Shorthand + // Traverse matrix, column by column + for( var j = 0; j < numNodes; j++ ){ + if( columnSum[ j ] === 0 ){ + // No 'links' out from node jth, assume equal probability for each possible node + for( var i = 0; i < numNodes; i++ ){ + matrix[ i ][ j ] = p; + } + } else { + // Node jth has outgoing link, compute normalized probabilities + for( var i = 0; i < numNodes; i++ ){ + matrix[ i ][ j ] = matrix[ i ][ j ] / columnSum[ j ] + additionalProb; + } + } + } + + // Compute dominant eigenvector using power method + var eigenvector = []; + var nullVector = []; + var previous; + + // Start with a vector of all 1's + // Also, initialize a null vector which will be used as shorthand + for( var i = 0; i < numNodes; i++ ){ + eigenvector.push( 1.0 ); + nullVector.push( 0.0 ); + } + + for( var iter = 0; iter < numIter; iter++ ){ + // New array with all 0's + var temp = nullVector.slice( 0 ); + + // Multiply matrix with previous result + for( var i = 0; i < numNodes; i++ ){ + for( var j = 0; j < numNodes; j++ ){ + temp[ i ] += matrix[ i ][ j ] * eigenvector[ j ]; + } + } + + normalizeVector( temp ); + previous = eigenvector; + eigenvector = temp; + + var diff = 0; + // Compute difference (squared module) of both vectors + for( var i = 0; i < numNodes; i++ ){ + diff += Math.pow( previous[ i ] - eigenvector[ i ], 2 ); + } + + // If difference is less than the desired threshold, stop iterating + if( diff < epsilon ){ + break; + } + } + + // Construct result + var res = { + rank: function( node ){ + if( is.string( node ) ){ + // is a selector string + var nodeId = (cy.filter( node )[0]).id(); + } else { + // is a node object + var nodeId = node.id(); + } + return eigenvector[ id2position[ nodeId ] ]; + } + }; + + + return res; + } // pageRank + +}); // elesfn + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/animation.js b/node_modules/cytoscape/src/collection/animation.js new file mode 100644 index 000000000..e2035902e --- /dev/null +++ b/node_modules/cytoscape/src/collection/animation.js @@ -0,0 +1,13 @@ +let define = require( '../define' ); + +let elesfn = ({ + animate: define.animate(), + animation: define.animation(), + animated: define.animated(), + clearQueue: define.clearQueue(), + delay: define.delay(), + delayAnimation: define.delayAnimation(), + stop: define.stop() +}); + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/class.js b/node_modules/cytoscape/src/collection/class.js new file mode 100644 index 000000000..8672a699c --- /dev/null +++ b/node_modules/cytoscape/src/collection/class.js @@ -0,0 +1,131 @@ +let Set = require('../set'); + +let elesfn = ({ + classes: function( classes ){ + classes = ( classes || '' ).match( /\S+/g ) || []; + let self = this; + let changed = []; + let classesMap = new Set( classes ); + + // check and update each ele + for( let j = 0; j < self.length; j++ ){ + let ele = self[ j ]; + let _p = ele._private; + let eleClasses = _p.classes; + let changedEle = false; + + // check if ele has all of the passed classes + classesMap.forEach( cls => { + let eleHasClass = eleClasses.has(cls); + + if( !eleHasClass ){ + changedEle = true; + } + }); + + // check if ele has classes outside of those passed + if( !changedEle ){ + eleClasses.forEach( eleCls => { + let specdClass = classesMap.has(eleCls); + + if( !specdClass ){ + changedEle = true; + } + }); + } + + if( changedEle ){ + _p.classes = new Set( classesMap ); + + changed.push( ele ); + } + } + + // trigger update style on those eles that had class changes + if( changed.length > 0 ){ + this.spawn( changed ) + .updateStyle() + .emit( 'class' ) + ; + } + + return self; + }, + + addClass: function( classes ){ + return this.toggleClass( classes, true ); + }, + + hasClass: function( className ){ + let ele = this[0]; + return ( ele != null && ele._private.classes.has(className) ); + }, + + toggleClass: function( classesStr, toggle ){ + let classes = classesStr.match( /\S+/g ) || []; + let self = this; + let changed = []; // eles who had classes changed + + for( let i = 0, il = self.length; i < il; i++ ){ + let ele = self[ i ]; + let changedEle = false; + + for( let j = 0; j < classes.length; j++ ){ + let cls = classes[ j ]; + let eleClasses = ele._private.classes; + let hasClass = eleClasses.has(cls); + let shouldAdd = toggle || (toggle === undefined && !hasClass); + + if( shouldAdd ){ + eleClasses.add(cls); + + if( !hasClass && !changedEle ){ + changed.push( ele ); + changedEle = true; + } + } else { // then remove + eleClasses.delete(cls); + + if( hasClass && !changedEle ){ + changed.push( ele ); + changedEle = true; + } + } + + } // for j classes + } // for i eles + + // trigger update style on those eles that had class changes + if( changed.length > 0 ){ + this.spawn( changed ) + .updateStyle() + .emit( 'class' ) + ; + } + + return self; + }, + + removeClass: function( classes ){ + return this.toggleClass( classes, false ); + }, + + flashClass: function( classes, duration ){ + let self = this; + + if( duration == null ){ + duration = 250; + } else if( duration === 0 ){ + return self; // nothing to do really + } + + self.addClass( classes ); + setTimeout( function(){ + self.removeClass( classes ); + }, duration ); + + return self; + } +}); + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/comparators.js b/node_modules/cytoscape/src/collection/comparators.js new file mode 100644 index 000000000..964ee203f --- /dev/null +++ b/node_modules/cytoscape/src/collection/comparators.js @@ -0,0 +1,90 @@ +let is = require('../is'); +let Selector = require('../selector'); + +let elesfn = ({ + allAre: function( selector ){ + let selObj = new Selector( selector ); + + return this.every(function( ele ){ + return selObj.matches( ele ); + }); + }, + + is: function( selector ){ + let selObj = new Selector( selector ); + + return this.some(function( ele ){ + return selObj.matches( ele ); + }); + }, + + some: function( fn, thisArg ){ + for( let i = 0; i < this.length; i++ ){ + let ret = !thisArg ? fn( this[ i ], i, this ) : fn.apply( thisArg, [ this[ i ], i, this ] ); + + if( ret ){ + return true; + } + } + + return false; + }, + + every: function( fn, thisArg ){ + for( let i = 0; i < this.length; i++ ){ + let ret = !thisArg ? fn( this[ i ], i, this ) : fn.apply( thisArg, [ this[ i ], i, this ] ); + + if( !ret ){ + return false; + } + } + + return true; + }, + + same: function( collection ){ + collection = this.cy().collection( collection ); + + // cheap extra check + if( this.length !== collection.length ){ + return false; + } + + return this.every(function( ele ){ + return collection.hasElementWithId( ele.id() ); + }); + }, + + anySame: function( collection ){ + collection = this.cy().collection( collection ); + + return this.some(function( ele ){ + return collection.hasElementWithId( ele.id() ); + }); + }, + + allAreNeighbors: function( collection ){ + collection = this.cy().collection( collection ); + + let nhood = this.neighborhood(); + + return collection.every(function( ele ){ + return nhood.hasElementWithId( ele.id() ); + }); + }, + + contains: function( collection ){ + collection = this.cy().collection( collection ); + + let self = this; + + return collection.every(function( ele ){ + return self.hasElementWithId( ele.id() ); + }); + } +}); + +elesfn.allAreNeighbours = elesfn.allAreNeighbors; +elesfn.has = elesfn.contains; + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/compounds.js b/node_modules/cytoscape/src/collection/compounds.js new file mode 100644 index 000000000..4e5793b7e --- /dev/null +++ b/node_modules/cytoscape/src/collection/compounds.js @@ -0,0 +1,214 @@ +let Set = require('../set'); + +let elesfn = ({ + parent: function( selector ){ + let parents = []; + + // optimisation for single ele call + if( this.length === 1 ){ + let parent = this[0]._private.parent; + + if( parent ){ return parent; } + } + + for( let i = 0; i < this.length; i++ ){ + let ele = this[ i ]; + let parent = ele._private.parent; + + if( parent ){ + parents.push( parent ); + } + } + + return this.spawn( parents, { unique: true } ).filter( selector ); + }, + + parents: function( selector ){ + let parents = []; + + let eles = this.parent(); + while( eles.nonempty() ){ + for( let i = 0; i < eles.length; i++ ){ + let ele = eles[ i ]; + parents.push( ele ); + } + + eles = eles.parent(); + } + + return this.spawn( parents, { unique: true } ).filter( selector ); + }, + + commonAncestors: function( selector ){ + let ancestors; + + for( let i = 0; i < this.length; i++ ){ + let ele = this[ i ]; + let parents = ele.parents(); + + ancestors = ancestors || parents; + + ancestors = ancestors.intersect( parents ); // current list must be common with current ele parents set + } + + return ancestors.filter( selector ); + }, + + orphans: function( selector ){ + return this.stdFilter( function( ele ){ + return ele.isOrphan(); + } ).filter( selector ); + }, + + nonorphans: function( selector ){ + return this.stdFilter( function( ele ){ + return ele.isChild(); + } ).filter( selector ); + }, + + children: function( selector ){ + let children = []; + + for( let i = 0; i < this.length; i++ ){ + let ele = this[ i ]; + children = children.concat( ele._private.children ); + } + + return this.spawn( children, { unique: true } ).filter( selector ); + }, + + siblings: function( selector ){ + return this.parent().children().not( this ).filter( selector ); + }, + + isParent: function(){ + let ele = this[0]; + + if( ele ){ + return ele.isNode() && ele._private.children.length !== 0; + } + }, + + isChildless: function(){ + let ele = this[0]; + + if( ele ){ + return ele.isNode() && ele._private.children.length === 0; + } + }, + + isChild: function(){ + let ele = this[0]; + + if( ele ){ + return ele.isNode() && ele._private.parent != null; + } + }, + + isOrphan: function(){ + let ele = this[0]; + + if( ele ){ + return ele.isNode() && ele._private.parent == null; + } + }, + + descendants: function( selector ){ + let elements = []; + + function add( eles ){ + for( let i = 0; i < eles.length; i++ ){ + let ele = eles[ i ]; + + elements.push( ele ); + + if( ele.children().nonempty() ){ + add( ele.children() ); + } + } + } + + add( this.children() ); + + return this.spawn( elements, { unique: true } ).filter( selector ); + } +}); + +function forEachCompound( eles, fn, includeSelf, recursiveStep ){ + let q = []; + let did = new Set(); + let cy = eles.cy(); + let hasCompounds = cy.hasCompoundNodes(); + + for( let i = 0; i < eles.length; i++ ){ + let ele = eles[i]; + + if( includeSelf ){ + q.push( ele ); + } else if( hasCompounds ){ + recursiveStep( q, did, ele ); + } + } + + while( q.length > 0 ){ + let ele = q.shift(); + + fn( ele ); + + did.add( ele.id() ); + + if( hasCompounds ){ + recursiveStep( q, did, ele ); + } + } + + return eles; +} + +function addChildren( q, did, ele ){ + if( ele.isParent() ){ + let children = ele._private.children; + + for( let i = 0; i < children.length; i++ ){ + let child = children[i]; + + if( !did.has( child.id() ) ){ + q.push( child ); + } + } + } +} + +// very efficient version of eles.add( eles.descendants() ).forEach() +// for internal use +elesfn.forEachDown = function( fn, includeSelf = true ){ + return forEachCompound( this, fn, includeSelf, addChildren ); +}; + +function addParent( q, did, ele ){ + if( ele.isChild() ){ + let parent = ele._private.parent; + + if( !did.has( parent.id() ) ){ + q.push( parent ); + } + } +} + +elesfn.forEachUp = function( fn, includeSelf = true ){ + return forEachCompound( this, fn, includeSelf, addParent ); +}; + +function addParentAndChildren( q, did, ele ){ + addParent( q, did, ele ); + addChildren( q, did, ele ); +} + +elesfn.forEachUpAndDown = function( fn, includeSelf = true ){ + return forEachCompound( this, fn, includeSelf, addParentAndChildren ); +}; + +// aliases +elesfn.ancestors = elesfn.parents; + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/data.js b/node_modules/cytoscape/src/collection/data.js new file mode 100644 index 000000000..f73d43b3e --- /dev/null +++ b/node_modules/cytoscape/src/collection/data.js @@ -0,0 +1,85 @@ +let define = require( '../define' ); +let fn, elesfn; + +fn = elesfn = ({ + + data: define.data( { + field: 'data', + bindingEvent: 'data', + allowBinding: true, + allowSetting: true, + settingEvent: 'data', + settingTriggersEvent: true, + triggerFnName: 'trigger', + allowGetting: true, + immutableKeys: { + 'id': true, + 'source': true, + 'target': true, + 'parent': true + }, + updateStyle: true + } ), + + removeData: define.removeData( { + field: 'data', + event: 'data', + triggerFnName: 'trigger', + triggerEvent: true, + immutableKeys: { + 'id': true, + 'source': true, + 'target': true, + 'parent': true + }, + updateStyle: true + } ), + + scratch: define.data( { + field: 'scratch', + bindingEvent: 'scratch', + allowBinding: true, + allowSetting: true, + settingEvent: 'scratch', + settingTriggersEvent: true, + triggerFnName: 'trigger', + allowGetting: true, + updateStyle: true + } ), + + removeScratch: define.removeData( { + field: 'scratch', + event: 'scratch', + triggerFnName: 'trigger', + triggerEvent: true, + updateStyle: true + } ), + + rscratch: define.data( { + field: 'rscratch', + allowBinding: false, + allowSetting: true, + settingTriggersEvent: false, + allowGetting: true + } ), + + removeRscratch: define.removeData( { + field: 'rscratch', + triggerEvent: false + } ), + + id: function(){ + let ele = this[0]; + + if( ele ){ + return ele._private.data.id; + } + } + +}); + +// aliases +fn.attr = fn.data; +fn.removeAttr = fn.removeData; + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/degree.js b/node_modules/cytoscape/src/collection/degree.js new file mode 100644 index 000000000..4eabd31a2 --- /dev/null +++ b/node_modules/cytoscape/src/collection/degree.js @@ -0,0 +1,119 @@ +let util = require( '../util' ); + +let elesfn = {}; + +function defineDegreeFunction( callback ){ + return function( includeLoops ){ + let self = this; + + if( includeLoops === undefined ){ + includeLoops = true; + } + + if( self.length === 0 ){ return; } + + if( self.isNode() && !self.removed() ){ + let degree = 0; + let node = self[0]; + let connectedEdges = node._private.edges; + + for( let i = 0; i < connectedEdges.length; i++ ){ + let edge = connectedEdges[ i ]; + + if( !includeLoops && edge.isLoop() ){ + continue; + } + + degree += callback( node, edge ); + } + + return degree; + } else { + return; + } + }; +} + +util.extend( elesfn, { + degree: defineDegreeFunction( function( node, edge ){ + if( edge.source().same( edge.target() ) ){ + return 2; + } else { + return 1; + } + } ), + + indegree: defineDegreeFunction( function( node, edge ){ + if( edge.target().same( node ) ){ + return 1; + } else { + return 0; + } + } ), + + outdegree: defineDegreeFunction( function( node, edge ){ + if( edge.source().same( node ) ){ + return 1; + } else { + return 0; + } + } ) +} ); + +function defineDegreeBoundsFunction( degreeFn, callback ){ + return function( includeLoops ){ + let ret; + let nodes = this.nodes(); + + for( let i = 0; i < nodes.length; i++ ){ + let ele = nodes[ i ]; + let degree = ele[ degreeFn ]( includeLoops ); + if( degree !== undefined && (ret === undefined || callback( degree, ret )) ){ + ret = degree; + } + } + + return ret; + }; +} + +util.extend( elesfn, { + minDegree: defineDegreeBoundsFunction( 'degree', function( degree, min ){ + return degree < min; + } ), + + maxDegree: defineDegreeBoundsFunction( 'degree', function( degree, max ){ + return degree > max; + } ), + + minIndegree: defineDegreeBoundsFunction( 'indegree', function( degree, min ){ + return degree < min; + } ), + + maxIndegree: defineDegreeBoundsFunction( 'indegree', function( degree, max ){ + return degree > max; + } ), + + minOutdegree: defineDegreeBoundsFunction( 'outdegree', function( degree, min ){ + return degree < min; + } ), + + maxOutdegree: defineDegreeBoundsFunction( 'outdegree', function( degree, max ){ + return degree > max; + } ) +} ); + +util.extend( elesfn, { + totalDegree: function( includeLoops ){ + let total = 0; + let nodes = this.nodes(); + + for( let i = 0; i < nodes.length; i++ ){ + total += nodes[ i ].degree( includeLoops ); + } + + return total; + } +} ); + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/dimensions/bounds.js b/node_modules/cytoscape/src/collection/dimensions/bounds.js new file mode 100644 index 000000000..e46982658 --- /dev/null +++ b/node_modules/cytoscape/src/collection/dimensions/bounds.js @@ -0,0 +1,766 @@ +let is = require('../../is'); +let util = require('../../util'); +let math = require('../../math'); +let fn, elesfn; + +fn = elesfn = {}; + +elesfn.renderedBoundingBox = function( options ){ + let bb = this.boundingBox( options ); + let cy = this.cy(); + let zoom = cy.zoom(); + let pan = cy.pan(); + + let x1 = bb.x1 * zoom + pan.x; + let x2 = bb.x2 * zoom + pan.x; + let y1 = bb.y1 * zoom + pan.y; + let y2 = bb.y2 * zoom + pan.y; + + return { + x1: x1, + x2: x2, + y1: y1, + y2: y2, + w: x2 - x1, + h: y2 - y1 + }; +}; + +elesfn.dirtyCompoundBoundsCache = function(){ + let cy = this.cy(); + + if( !cy.styleEnabled() || !cy.hasCompoundNodes() ){ return this; } + + this.forEachUp( ele => { + ele._private.compoundBoundsClean = false; + + if( ele.isParent() ){ + ele.emit('bounds'); + } + } ); + + return this; +}; + +elesfn.updateCompoundBounds = function(){ + let cy = this.cy(); + + // save cycles for non compound graphs or when style disabled + if( !cy.styleEnabled() || !cy.hasCompoundNodes() ){ return this; } + + // save cycles when batching -- but bounds will be stale (or not exist yet) + if( cy.batching() ){ return this; } + + let updated = []; + + function update( parent ){ + if( !parent.isParent() ){ return; } + + let _p = parent._private; + let children = parent.children(); + let includeLabels = parent.pstyle( 'compound-sizing-wrt-labels' ).value === 'include'; + + let min = { + width: { + val: parent.pstyle( 'min-width' ).pfValue, + left: parent.pstyle( 'min-width-bias-left' ), + right: parent.pstyle( 'min-width-bias-right' ) + }, + height: { + val: parent.pstyle( 'min-height' ).pfValue, + top: parent.pstyle( 'min-height-bias-top' ), + bottom: parent.pstyle( 'min-height-bias-bottom' ) + } + }; + + let bb = children.boundingBox( { + includeLabels: includeLabels, + includeOverlays: false, + + // updating the compound bounds happens outside of the regular + // cache cycle (i.e. before fired events) + useCache: false + } ); + let pos = _p.position; + + // if children take up zero area then keep position and fall back on stylesheet w/h + if( bb.w === 0 || bb.h === 0 ){ + bb = { + w: parent.pstyle('width').pfValue, + h: parent.pstyle('height').pfValue + }; + + bb.x1 = pos.x - bb.w/2; + bb.x2 = pos.x + bb.w/2; + bb.y1 = pos.y - bb.h/2; + bb.y2 = pos.y + bb.h/2; + } + + function computeBiasValues( propDiff, propBias, propBiasComplement ){ + let biasDiff = 0; + let biasComplementDiff = 0; + let biasTotal = propBias + propBiasComplement; + + if( propDiff > 0 && biasTotal > 0 ){ + biasDiff = ( propBias / biasTotal ) * propDiff; + biasComplementDiff = ( propBiasComplement / biasTotal ) * propDiff; + } + return { + biasDiff: biasDiff, + biasComplementDiff: biasComplementDiff + }; + } + + function computePaddingValues( width, height, paddingObject, relativeTo ) { + // Assuming percentage is number from 0 to 1 + if(paddingObject.units === '%') { + switch(relativeTo) { + case 'width': + return width > 0 ? paddingObject.pfValue * width : 0; + case 'height': + return height > 0 ? paddingObject.pfValue * height : 0; + case 'average': + return ( width > 0 ) && ( height > 0 ) ? paddingObject.pfValue * ( width + height ) / 2 : 0; + case 'min': + return ( width > 0 ) && ( height > 0 ) ? ( ( width > height ) ? paddingObject.pfValue * height : paddingObject.pfValue * width ) : 0; + case 'max': + return ( width > 0 ) && ( height > 0 ) ? ( ( width > height ) ? paddingObject.pfValue * width : paddingObject.pfValue * height ) : 0; + default: + return 0; + } + } else if(paddingObject.units === 'px') { + return paddingObject.pfValue; + } else { + return 0; + } + } + + let leftVal = min.width.left.value; + if( min.width.left.units === 'px' && min.width.val > 0 ){ + leftVal = ( leftVal * 100 ) / min.width.val; + } + let rightVal = min.width.right.value; + if( min.width.right.units === 'px' && min.width.val > 0 ){ + rightVal = ( rightVal * 100 ) / min.width.val; + } + + let topVal = min.height.top.value; + if( min.height.top.units === 'px' && min.height.val > 0 ){ + topVal = ( topVal * 100 ) / min.height.val; + } + + let bottomVal = min.height.bottom.value; + if( min.height.bottom.units === 'px' && min.height.val > 0 ){ + bottomVal = ( bottomVal * 100 ) / min.height.val; + } + + let widthBiasDiffs = computeBiasValues( min.width.val - bb.w, leftVal, rightVal ); + let diffLeft = widthBiasDiffs.biasDiff; + let diffRight = widthBiasDiffs.biasComplementDiff; + + let heightBiasDiffs = computeBiasValues( min.height.val - bb.h, topVal, bottomVal ); + let diffTop = heightBiasDiffs.biasDiff; + let diffBottom = heightBiasDiffs.biasComplementDiff; + + _p.autoPadding = computePaddingValues( bb.w, bb.h, parent.pstyle( 'padding' ), parent.pstyle( 'padding-relative-to' ).value ); + + _p.autoWidth = Math.max(bb.w, min.width.val); + pos.x = (- diffLeft + bb.x1 + bb.x2 + diffRight) / 2; + + _p.autoHeight = Math.max(bb.h, min.height.val); + pos.y = (- diffTop + bb.y1 + bb.y2 + diffBottom) / 2; + + updated.push( parent ); + } + + for( let i = 0; i < this.length; i++ ){ + let ele = this[i]; + let _p = ele._private; + + if( !_p.compoundBoundsClean ){ + update( ele ); + + if( !cy._private.batchingStyle ){ + _p.compoundBoundsClean = true; + } + } + } + + return this; +}; + +let noninf = function( x ){ + if( x === Infinity || x === -Infinity ){ + return 0; + } + + return x; +}; + +let updateBounds = function( b, x1, y1, x2, y2 ){ + // don't update with zero area boxes + if( x2 - x1 === 0 || y2 - y1 === 0 ){ return; } + + // don't update with null dim + if( x1 == null || y1 == null || x2 == null || y2 == null ){ return; } + + b.x1 = x1 < b.x1 ? x1 : b.x1; + b.x2 = x2 > b.x2 ? x2 : b.x2; + b.y1 = y1 < b.y1 ? y1 : b.y1; + b.y2 = y2 > b.y2 ? y2 : b.y2; +}; + +let updateBoundsFromBox = function( b, b2 ){ + return updateBounds( b, b2.x1, b2.y1, b2.x2, b2.y2 ); +}; + +let prefixedProperty = function( obj, field, prefix ){ + return util.getPrefixedProperty( obj, field, prefix ); +}; + +let updateBoundsFromArrow = function( bounds, ele, prefix ){ + if( ele.cy().headless() ){ return; } + + let _p = ele._private; + let rstyle = _p.rstyle; + let halfArW = rstyle.arrowWidth / 2; + let arrowType = ele.pstyle( prefix + '-arrow-shape' ).value; + let x; + let y; + + if( arrowType !== 'none' ){ + if( prefix === 'source' ){ + x = rstyle.srcX; + y = rstyle.srcY; + } else if( prefix === 'target' ){ + x = rstyle.tgtX; + y = rstyle.tgtY; + } else { + x = rstyle.midX; + y = rstyle.midY; + } + + updateBounds( bounds, x - halfArW, y - halfArW, x + halfArW, y + halfArW ); + } +}; + +let updateBoundsFromLabel = function( bounds, ele, prefix ){ + if( ele.cy().headless() ){ return; } + + let prefixDash; + + if( prefix ){ + prefixDash = prefix + '-'; + } else { + prefixDash = ''; + } + + let _p = ele._private; + let rstyle = _p.rstyle; + let label = ele.pstyle( prefixDash + 'label' ).strValue; + + if( label ){ + let halign = ele.pstyle( 'text-halign' ); + let valign = ele.pstyle( 'text-valign' ); + let labelWidth = prefixedProperty( rstyle, 'labelWidth', prefix ); + let labelHeight = prefixedProperty( rstyle, 'labelHeight', prefix ); + let labelX = prefixedProperty( rstyle, 'labelX', prefix ); + let labelY = prefixedProperty( rstyle, 'labelY', prefix ); + let marginX = ele.pstyle( prefixDash + 'text-margin-x' ).pfValue; + let marginY = ele.pstyle( prefixDash + 'text-margin-y' ).pfValue; + let isEdge = ele.isEdge(); + let rotation = ele.pstyle( prefixDash + 'text-rotation' ); + let outlineWidth = ele.pstyle( 'text-outline-width' ).pfValue; + let borderWidth = ele.pstyle( 'text-border-width' ).pfValue; + let halfBorderWidth = borderWidth / 2; + let padding = ele.pstyle( 'text-background-padding' ).pfValue; + + let lh = labelHeight + 2 * padding; + let lw = labelWidth + 2 * padding; + let lw_2 = lw / 2; + let lh_2 = lh / 2; + let lx1, lx2, ly1, ly2; + + if( isEdge ){ + lx1 = labelX - lw_2; + lx2 = labelX + lw_2; + ly1 = labelY - lh_2; + ly2 = labelY + lh_2; + } else { + switch( halign.value ){ + case 'left': + lx1 = labelX - lw; + lx2 = labelX; + break; + + case 'center': + lx1 = labelX - lw_2; + lx2 = labelX + lw_2; + break; + + case 'right': + lx1 = labelX; + lx2 = labelX + lw; + break; + } + + switch( valign.value ){ + case 'top': + ly1 = labelY - lh; + ly2 = labelY; + break; + + case 'center': + ly1 = labelY - lh_2; + ly2 = labelY + lh_2; + break; + + case 'bottom': + ly1 = labelY; + ly2 = labelY + lh; + break; + } + } + + let isAutorotate = ( isEdge && rotation.strValue === 'autorotate' ); + let isPfValue = ( rotation.pfValue != null && rotation.pfValue !== 0 ); + + if( isAutorotate || isPfValue ){ + let theta = isAutorotate ? prefixedProperty( _p.rstyle, 'labelAngle', prefix ) : rotation.pfValue; + let cos = Math.cos( theta ); + let sin = Math.sin( theta ); + + let rotate = function( x, y ){ + x = x - labelX; + y = y - labelY; + + return { + x: x * cos - y * sin + labelX, + y: x * sin + y * cos + labelY + }; + }; + + let px1y1 = rotate( lx1, ly1 ); + let px1y2 = rotate( lx1, ly2 ); + let px2y1 = rotate( lx2, ly1 ); + let px2y2 = rotate( lx2, ly2 ); + + lx1 = Math.min( px1y1.x, px1y2.x, px2y1.x, px2y2.x ); + lx2 = Math.max( px1y1.x, px1y2.x, px2y1.x, px2y2.x ); + ly1 = Math.min( px1y1.y, px1y2.y, px2y1.y, px2y2.y ); + ly2 = Math.max( px1y1.y, px1y2.y, px2y1.y, px2y2.y ); + } + + lx1 += marginX - Math.max( outlineWidth, halfBorderWidth ); + lx2 += marginX + Math.max( outlineWidth, halfBorderWidth ); + ly1 += marginY - Math.max( outlineWidth, halfBorderWidth ); + ly2 += marginY + Math.max( outlineWidth, halfBorderWidth ); + + updateBounds( bounds, lx1, ly1, lx2, ly2 ); + } + + return bounds; +}; + +// get the bounding box of the elements (in raw model position) +let boundingBoxImpl = function( ele, options ){ + let cy = ele._private.cy; + let styleEnabled = cy.styleEnabled(); + let headless = cy.headless(); + + let bounds = { + x1: Infinity, + y1: Infinity, + x2: -Infinity, + y2: -Infinity + }; + + let _p = ele._private; + let display = styleEnabled ? ele.pstyle( 'display' ).value : 'element'; + let isNode = ele.isNode(); + let isEdge = ele.isEdge(); + let ex1, ex2, ey1, ey2; // extrema of body / lines + let x, y; // node pos + let displayed = display !== 'none'; + + if( displayed ){ + let overlayOpacity = 0; + let overlayPadding = 0; + + if( styleEnabled && options.includeOverlays ){ + overlayOpacity = ele.pstyle( 'overlay-opacity' ).value; + + if( overlayOpacity !== 0 ){ + overlayPadding = ele.pstyle( 'overlay-padding' ).value; + } + } + + let w = 0; + let wHalf = 0; + + if( styleEnabled ){ + w = ele.pstyle( 'width' ).pfValue; + wHalf = w / 2; + } + + if( isNode && options.includeNodes ){ + let pos = ele.position(); + x = pos.x; + y = pos.y; + let w = ele.outerWidth(); + let halfW = w / 2; + let h = ele.outerHeight(); + let halfH = h / 2; + + // handle node dimensions + ///////////////////////// + + ex1 = x - halfW - overlayPadding; + ex2 = x + halfW + overlayPadding; + ey1 = y - halfH - overlayPadding; + ey2 = y + halfH + overlayPadding; + + updateBounds( bounds, ex1, ey1, ex2, ey2 ); + + } else if( isEdge && options.includeEdges ){ + let rstyle = _p.rstyle || {}; + + // handle edge dimensions (rough box estimate) + ////////////////////////////////////////////// + if( styleEnabled && !headless ){ + ex1 = Math.min( rstyle.srcX, rstyle.midX, rstyle.tgtX ); + ex2 = Math.max( rstyle.srcX, rstyle.midX, rstyle.tgtX ); + ey1 = Math.min( rstyle.srcY, rstyle.midY, rstyle.tgtY ); + ey2 = Math.max( rstyle.srcY, rstyle.midY, rstyle.tgtY ); + + // take into account edge width + ex1 -= wHalf; + ex2 += wHalf; + ey1 -= wHalf; + ey2 += wHalf; + + updateBounds( bounds, ex1, ey1, ex2, ey2 ); + } + + // precise haystacks + //////////////////// + if( styleEnabled && !headless && ele.pstyle( 'curve-style' ).strValue === 'haystack' ){ + let hpts = rstyle.haystackPts || []; + + ex1 = hpts[0].x; + ey1 = hpts[0].y; + ex2 = hpts[1].x; + ey2 = hpts[1].y; + + if( ex1 > ex2 ){ + let temp = ex1; + ex1 = ex2; + ex2 = temp; + } + + if( ey1 > ey2 ){ + let temp = ey1; + ey1 = ey2; + ey2 = temp; + } + + updateBounds( bounds, ex1 - wHalf, ey1 - wHalf, ex2 + wHalf, ey2 + wHalf ); + + // handle points along edge + /////////////////////////// + } else { + let pts = rstyle.bezierPts || rstyle.linePts || []; + + for( let j = 0; j < pts.length; j++ ){ + let pt = pts[ j ]; + + ex1 = pt.x - wHalf; + ex2 = pt.x + wHalf; + ey1 = pt.y - wHalf; + ey2 = pt.y + wHalf; + + updateBounds( bounds, ex1, ey1, ex2, ey2 ); + } + + // fallback on source and target positions + ////////////////////////////////////////// + if( pts.length === 0 ){ + let n1 = ele.source(); + let n1pos = n1.position(); + + let n2 = ele.target(); + let n2pos = n2.position(); + + ex1 = n1pos.x; + ex2 = n2pos.x; + ey1 = n1pos.y; + ey2 = n2pos.y; + + if( ex1 > ex2 ){ + let temp = ex1; + ex1 = ex2; + ex2 = temp; + } + + if( ey1 > ey2 ){ + let temp = ey1; + ey1 = ey2; + ey2 = temp; + } + + // take into account edge width + ex1 -= wHalf; + ex2 += wHalf; + ey1 -= wHalf; + ey2 += wHalf; + + updateBounds( bounds, ex1, ey1, ex2, ey2 ); + } + } + + } // edges + + + // handle edge arrow size + ///////////////////////// + + if( styleEnabled && options.includeEdges && isEdge ){ + updateBoundsFromArrow( bounds, ele, 'mid-source', options ); + updateBoundsFromArrow( bounds, ele, 'mid-target', options ); + updateBoundsFromArrow( bounds, ele, 'source', options ); + updateBoundsFromArrow( bounds, ele, 'target', options ); + } + + // ghost + //////// + + if( styleEnabled ){ + let ghost = ele.pstyle('ghost').value === 'yes'; + + if( ghost ){ + let gx = ele.pstyle('ghost-offset-x').pfValue; + let gy = ele.pstyle('ghost-offset-y').pfValue; + + updateBounds( bounds, bounds.x1 + gx, bounds.y1 + gy, bounds.x2 + gx, bounds.y2 + gy ); + } + } + + // overlay + ////////// + + if( styleEnabled ){ + + ex1 = bounds.x1; + ex2 = bounds.x2; + ey1 = bounds.y1; + ey2 = bounds.y2; + + updateBounds( bounds, ex1 - overlayPadding, ey1 - overlayPadding, ex2 + overlayPadding, ey2 + overlayPadding ); + } + + // handle label dimensions + ////////////////////////// + + if( styleEnabled && options.includeLabels ){ + updateBoundsFromLabel( bounds, ele, null, options ); + + if( isEdge ){ + updateBoundsFromLabel( bounds, ele, 'source', options ); + updateBoundsFromLabel( bounds, ele, 'target', options ); + } + } // style enabled for labels + } // if displayed + + bounds.x1 = noninf( bounds.x1 ); + bounds.y1 = noninf( bounds.y1 ); + bounds.x2 = noninf( bounds.x2 ); + bounds.y2 = noninf( bounds.y2 ); + bounds.w = noninf( bounds.x2 - bounds.x1 ); + bounds.h = noninf( bounds.y2 - bounds.y1 ); + + // expand bounds by 1 because antialiasing can increase the visual/effective size by 1 on all sides + if( bounds.w > 0 && bounds.h > 0 && displayed ){ + math.expandBoundingBox( bounds, 1 ); + } + + return bounds; +}; + +let tf = function( val ){ + if( val ){ + return 't'; + } else { + return 'f'; + } +}; + +let getKey = function( opts ){ + let key = ''; + + key += tf( opts.incudeNodes ); + key += tf( opts.includeEdges ); + key += tf( opts.includeLabels ); + key += tf( opts.includeOverlays ); + + return key; +}; + +let cachedBoundingBoxImpl = function( ele, opts ){ + let _p = ele._private; + let bb; + let headless = ele.cy().headless(); + let key = opts === defBbOpts ? defBbOptsKey : getKey( opts ); + + if( !opts.useCache || headless || !_p.bbCache || !_p.bbCache[key] ){ + bb = boundingBoxImpl( ele, opts ); + + if( !headless ){ + _p.bbCache = _p.bbCache || {}; + _p.bbCache[key] = bb; + } + } else { + bb = _p.bbCache[key]; + } + + return bb; +}; + +let defBbOpts = { + includeNodes: true, + includeEdges: true, + includeLabels: true, + includeOverlays: true, + useCache: true +}; + +let defBbOptsKey = getKey( defBbOpts ); + +function filledBbOpts( options ){ + return { + includeNodes: util.default( options.includeNodes, defBbOpts.includeNodes ), + includeEdges: util.default( options.includeEdges, defBbOpts.includeEdges ), + includeLabels: util.default( options.includeLabels, defBbOpts.includeLabels ), + includeOverlays: util.default( options.includeOverlays, defBbOpts.includeOverlays ), + useCache: util.default( options.useCache, defBbOpts.useCache ) + }; +} + +elesfn.boundingBox = function( options ){ + // the main usecase is ele.boundingBox() for a single element with no/def options + // specified s.t. the cache is used, so check for this case to make it faster by + // avoiding the overhead of the rest of the function + if( this.length === 1 && this[0]._private.bbCache && (options === undefined || options.useCache === undefined || options.useCache === true) ){ + if( options === undefined ){ + options = defBbOpts; + } else { + options = filledBbOpts( options ); + } + + return cachedBoundingBoxImpl( this[0], options ); + } + + let bounds = { + x1: Infinity, + y1: Infinity, + x2: -Infinity, + y2: -Infinity + }; + + options = options || util.staticEmptyObject(); + + let opts = filledBbOpts( options ); + + let eles = this; + let cy = eles.cy(); + let styleEnabled = cy.styleEnabled(); + + if( styleEnabled ){ + this.recalculateRenderedStyle( opts.useCache ); + } + + this.updateCompoundBounds(); + + let updatedEdge = {}; // use to avoid duplicated edge updates + + for( let i = 0; i < eles.length; i++ ){ + let ele = eles[i]; + + if( styleEnabled && ele.isEdge() && ele.pstyle('curve-style').strValue === 'bezier' && !updatedEdge[ ele.id() ] ){ + let edges = ele.parallelEdges(); + + for( let j = 0; j < edges.length; j++ ){ // make all as updated + updatedEdge[ edges[j].id() ] = true; + } + + edges.recalculateRenderedStyle( opts.useCache ); // n.b. ele.parallelEdges() single is cached + } + + updateBoundsFromBox( bounds, cachedBoundingBoxImpl( ele, opts ) ); + } + + bounds.x1 = noninf( bounds.x1 ); + bounds.y1 = noninf( bounds.y1 ); + bounds.x2 = noninf( bounds.x2 ); + bounds.y2 = noninf( bounds.y2 ); + bounds.w = noninf( bounds.x2 - bounds.x1 ); + bounds.h = noninf( bounds.y2 - bounds.y1 ); + + return bounds; +}; + +// private helper to get bounding box for custom node positions +// - good for perf in certain cases but currently requires dirtying the rendered style +// - would be better to not modify the nodes but the nodes are read directly everywhere in the renderer... +// - try to use for only things like discrete layouts where the node position would change anyway +elesfn.boundingBoxAt = function( fn ){ + let nodes = this.nodes(); + + if( is.plainObject( fn ) ){ + let obj = fn; + + fn = function(){ return obj; }; + } + + // save the current position and set the new one, per node + for( let i = 0; i < nodes.length; i++ ){ + let n = nodes[i]; + let _p = n._private; + let pos = _p.position; + let newPos = fn.call( n, n, i ); + + _p.bbAtOldPos = { x: pos.x, y: pos.y }; + + if( newPos ){ + pos.x = newPos.x; + pos.y = newPos.y; + } + } + + this.emit('dirty'); // let the renderer know we've manually dirtied rendered dim calcs + + nodes.dirtyCompoundBoundsCache().updateCompoundBounds(); + + let bb = this.boundingBox({ useCache: false }); + + // restore the original position, per node + for( let i = 0; i < nodes.length; i++ ){ + let n = nodes[i]; + let _p = n._private; + let pos = n._private.position; + let old = _p.bbAtOldPos; + + pos.x = old.x; + pos.y = old.y; + } + + nodes.dirtyCompoundBoundsCache(); + + this.emit('dirty'); // let the renderer know we've manually dirtied rendered dim calcs + + return bb; +}; + +fn.boundingbox = fn.boundingBox; +fn.renderedBoundingbox = fn.renderedBoundingBox; + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/dimensions/edge-points.js b/node_modules/cytoscape/src/collection/dimensions/edge-points.js new file mode 100644 index 000000000..33a427445 --- /dev/null +++ b/node_modules/cytoscape/src/collection/dimensions/edge-points.js @@ -0,0 +1,23 @@ +let ifEdge = (self, then) => { + if( self.isEdge() ){ + return then( self.renderer() ); + } +}; + +module.exports = { + controlPoints: function(){ + return ifEdge( this, renderer => renderer.getControlPoints( this ) ); + }, + segmentPoints: function(){ + return ifEdge( this, renderer => renderer.getSegmentPoints( this ) ); + }, + sourceEndpoint: function(){ + return ifEdge( this, renderer => renderer.getSourceEndpoint( this ) ); + }, + targetEndpoint: function(){ + return ifEdge( this, renderer => renderer.getTargetEndpoint( this ) ); + }, + midpoint: function(){ + return ifEdge( this, renderer => renderer.getEdgeMidpoint( this ) ); + } +}; diff --git a/node_modules/cytoscape/src/collection/dimensions/index.js b/node_modules/cytoscape/src/collection/dimensions/index.js new file mode 100644 index 000000000..71b8f86e3 --- /dev/null +++ b/node_modules/cytoscape/src/collection/dimensions/index.js @@ -0,0 +1,7 @@ +let util = require('../../util'); +let position = require('./position'); +let bounds = require('./bounds'); +let widthHeight = require('./width-height'); +let edgePoints = require('./edge-points'); + +module.exports = util.assign( {}, position, bounds, widthHeight, edgePoints ); diff --git a/node_modules/cytoscape/src/collection/dimensions/position.js b/node_modules/cytoscape/src/collection/dimensions/position.js new file mode 100644 index 000000000..a09323bc2 --- /dev/null +++ b/node_modules/cytoscape/src/collection/dimensions/position.js @@ -0,0 +1,235 @@ +let define = require('../../define'); +let is = require('../../is'); +let math = require('../../math'); +let fn, elesfn; + +let beforePositionSet = function( eles, newPos ){ + for( let i = 0; i < eles.length; i++ ){ + let ele = eles[i]; + + if( ele.isParent() && !ele.locked() ){ + let oldPos = ele._private.position; + let delta = { + x: newPos.x - oldPos.x, + y: newPos.y - oldPos.y + }; + + eles.children().shift( delta ); + } + } +}; + +fn = elesfn = ({ + + position: define.data( { + field: 'position', + bindingEvent: 'position', + allowBinding: true, + allowSetting: true, + settingEvent: 'position', + settingTriggersEvent: true, + triggerFnName: 'emitAndNotify', + allowGetting: true, + validKeys: [ 'x', 'y' ], + beforeGet: function( ele ){ + ele.updateCompoundBounds(); + }, + beforeSet: beforePositionSet, + onSet: function( eles ){ + eles.dirtyCompoundBoundsCache(); + }, + canSet: function( ele ){ + return !ele.locked(); + } + } ), + + // position but no notification to renderer + silentPosition: define.data( { + field: 'position', + bindingEvent: 'position', + allowBinding: false, + allowSetting: true, + settingEvent: 'position', + settingTriggersEvent: false, + triggerFnName: 'trigger', + allowGetting: false, + validKeys: [ 'x', 'y' ], + beforeSet: beforePositionSet, + onSet: function( eles ){ + eles.dirtyCompoundBoundsCache(); + }, + canSet: function( ele ){ + return !ele.locked(); + } + } ), + + positions: function( pos, silent ){ + if( is.plainObject( pos ) ){ + if( silent ){ + this.silentPosition( pos ); + } else { + this.position( pos ); + } + + } else if( is.fn( pos ) ){ + let fn = pos; + let cy = this.cy(); + + cy.startBatch(); + + for( let i = 0; i < this.length; i++ ){ + let ele = this[ i ]; + let pos; + + if( ( pos = fn(ele, i) ) ){ + if( silent ){ + ele.silentPosition( pos ); + } else { + ele.position( pos ); + } + } + } + + cy.endBatch(); + } + + return this; // chaining + }, + + silentPositions: function( pos ){ + return this.positions( pos, true ); + }, + + shift: function( dim, val ){ + let delta; + + if( is.plainObject( dim ) ){ + delta = dim; + } else if( is.string( dim ) && is.number( val ) ){ + delta = { x: 0, y: 0 }; + + delta[ dim ] = val; + } + + if( delta != null ){ + for( let i = 0; i < this.length; i++ ){ + let ele = this[i]; + let pos = ele.position(); + + ele.position({ + x: pos.x + delta.x, + y: pos.y + delta.y + }); + } + } + + return this; + }, + + // get/set the rendered (i.e. on screen) positon of the element + renderedPosition: function( dim, val ){ + let ele = this[0]; + let cy = this.cy(); + let zoom = cy.zoom(); + let pan = cy.pan(); + let rpos = is.plainObject( dim ) ? dim : undefined; + let setting = rpos !== undefined || ( val !== undefined && is.string( dim ) ); + + if( ele && ele.isNode() ){ // must have an element and must be a node to return position + if( setting ){ + for( let i = 0; i < this.length; i++ ){ + let ele = this[ i ]; + + if( val !== undefined ){ // set one dimension + ele.position( dim, ( val - pan[ dim ] ) / zoom ); + } else if( rpos !== undefined ){ // set whole position + ele.position( math.renderedToModelPosition( rpos, zoom, pan ) ); + } + } + } else { // getting + let pos = ele.position(); + rpos = math.modelToRenderedPosition( pos, zoom, pan ); + + if( dim === undefined ){ // then return the whole rendered position + return rpos; + } else { // then return the specified dimension + return rpos[ dim ]; + } + } + } else if( !setting ){ + return undefined; // for empty collection case + } + + return this; // chaining + }, + + // get/set the position relative to the parent + relativePosition: function( dim, val ){ + let ele = this[0]; + let cy = this.cy(); + let ppos = is.plainObject( dim ) ? dim : undefined; + let setting = ppos !== undefined || ( val !== undefined && is.string( dim ) ); + let hasCompoundNodes = cy.hasCompoundNodes(); + + if( ele && ele.isNode() ){ // must have an element and must be a node to return position + if( setting ){ + for( let i = 0; i < this.length; i++ ){ + let ele = this[ i ]; + let parent = hasCompoundNodes ? ele.parent() : null; + let hasParent = parent && parent.length > 0; + let relativeToParent = hasParent; + + if( hasParent ){ + parent = parent[0]; + } + + let origin = relativeToParent ? parent.position() : { x: 0, y: 0 }; + + if( val !== undefined ){ // set one dimension + ele.position( dim, val + origin[ dim ] ); + } else if( ppos !== undefined ){ // set whole position + ele.position({ + x: ppos.x + origin.x, + y: ppos.y + origin.y + }); + } + } + + } else { // getting + let pos = ele.position(); + let parent = hasCompoundNodes ? ele.parent() : null; + let hasParent = parent && parent.length > 0; + let relativeToParent = hasParent; + + if( hasParent ){ + parent = parent[0]; + } + + let origin = relativeToParent ? parent.position() : { x: 0, y: 0 }; + + ppos = { + x: pos.x - origin.x, + y: pos.y - origin.y + }; + + if( dim === undefined ){ // then return the whole rendered position + return ppos; + } else { // then return the specified dimension + return ppos[ dim ]; + } + } + } else if( !setting ){ + return undefined; // for empty collection case + } + + return this; // chaining + } +}); + +// aliases +fn.modelPosition = fn.point = fn.position; +fn.modelPositions = fn.points = fn.positions; +fn.renderedPoint = fn.renderedPosition; +fn.relativePoint = fn.relativePosition; + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/dimensions/width-height.js b/node_modules/cytoscape/src/collection/dimensions/width-height.js new file mode 100644 index 000000000..1c89f6021 --- /dev/null +++ b/node_modules/cytoscape/src/collection/dimensions/width-height.js @@ -0,0 +1,106 @@ +let util = require('../../util'); +let fn, elesfn; + +fn = elesfn = {}; + +let defineDimFns = function( opts ){ + opts.uppercaseName = util.capitalize( opts.name ); + opts.autoName = 'auto' + opts.uppercaseName; + opts.labelName = 'label' + opts.uppercaseName; + opts.outerName = 'outer' + opts.uppercaseName; + opts.uppercaseOuterName = util.capitalize( opts.outerName ); + + fn[ opts.name ] = function dimImpl(){ + let ele = this[0]; + let _p = ele._private; + let cy = _p.cy; + let styleEnabled = cy._private.styleEnabled; + + if( ele ){ + if( styleEnabled ){ + if( ele.isParent() ){ + ele.updateCompoundBounds(); + + return _p[ opts.autoName ] || 0; + } + + let d = ele.pstyle( opts.name ); + + switch( d.strValue ){ + case 'label': + ele.recalculateRenderedStyle(); + + return _p.rstyle[ opts.labelName ] || 0; + + default: + return d.pfValue; + } + } else { + return 1; + } + } + }; + + fn[ 'outer' + opts.uppercaseName ] = function outerDimImpl(){ + let ele = this[0]; + let _p = ele._private; + let cy = _p.cy; + let styleEnabled = cy._private.styleEnabled; + + if( ele ){ + if( styleEnabled ){ + let dim = ele[ opts.name ](); + let border = ele.pstyle( 'border-width' ).pfValue; // n.b. 1/2 each side + let padding = 2 * ele.padding(); + + return dim + border + padding; + } else { + return 1; + } + } + }; + + fn[ 'rendered' + opts.uppercaseName ] = function renderedDimImpl(){ + let ele = this[0]; + + if( ele ){ + let d = ele[ opts.name ](); + return d * this.cy().zoom(); + } + }; + + fn[ 'rendered' + opts.uppercaseOuterName ] = function renderedOuterDimImpl(){ + let ele = this[0]; + + if( ele ){ + let od = ele[ opts.outerName ](); + return od * this.cy().zoom(); + } + }; +}; + +defineDimFns( { + name: 'width' +} ); + +defineDimFns( { + name: 'height' +} ); + +elesfn.padding = function(){ + let ele = this[0]; + let _p = ele._private; + if( ele.isParent() ){ + ele.updateCompoundBounds(); + + if( _p.autoPadding !== undefined ){ + return _p.autoPadding; + } else { + return ele.pstyle('padding').pfValue; + } + } else { + return ele.pstyle('padding').pfValue; + } +}; + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/element.js b/node_modules/cytoscape/src/collection/element.js new file mode 100644 index 000000000..9f2e4314e --- /dev/null +++ b/node_modules/cytoscape/src/collection/element.js @@ -0,0 +1,105 @@ +let util = require('../util'); +let is = require('../is'); +let Set = require('../set'); + +// represents a node or an edge +let Element = function( cy, params, restore ){ + restore = (restore === undefined || restore ? true : false); + + if( cy === undefined || params === undefined || !is.core( cy ) ){ + util.error( 'An element must have a core reference and parameters set' ); + return; + } + + let group = params.group; + + // try to automatically infer the group if unspecified + if( group == null ){ + if( params.data && params.data.source != null && params.data.target != null ){ + group = 'edges'; + } else { + group = 'nodes'; + } + } + + // validate group + if( group !== 'nodes' && group !== 'edges' ){ + util.error( 'An element must be of type `nodes` or `edges`; you specified `' + group + '`' ); + return; + } + + // make the element array-like, just like a collection + this.length = 1; + this[0] = this; + + // NOTE: when something is added here, add also to ele.json() + let _p = this._private = { + cy: cy, + single: true, // indicates this is an element + data: params.data || {}, // data object + position: params.position || {}, // (x, y) position pair + autoWidth: undefined, // width and height of nodes calculated by the renderer when set to special 'auto' value + autoHeight: undefined, + autoPadding: undefined, + compoundBoundsClean: false, // whether the compound dimensions need to be recalculated the next time dimensions are read + listeners: [], // array of bound listeners + group: group, // string; 'nodes' or 'edges' + style: {}, // properties as set by the style + rstyle: {}, // properties for style sent from the renderer to the core + styleCxts: [], // applied style contexts from the styler + removed: true, // whether it's inside the vis; true if removed (set true here since we call restore) + selected: params.selected ? true : false, // whether it's selected + selectable: params.selectable === undefined ? true : ( params.selectable ? true : false ), // whether it's selectable + locked: params.locked ? true : false, // whether the element is locked (cannot be moved) + grabbed: false, // whether the element is grabbed by the mouse; renderer sets this privately + grabbable: params.grabbable === undefined ? true : ( params.grabbable ? true : false ), // whether the element can be grabbed + active: false, // whether the element is active from user interaction + classes: new Set(), // map ( className => true ) + animation: { // object for currently-running animations + current: [], + queue: [] + }, + rscratch: {}, // object in which the renderer can store information + scratch: params.scratch || {}, // scratch objects + edges: [], // array of connected edges + children: [], // array of children + parent: null, // parent ref + traversalCache: {}, // cache of output of traversal functions + backgrounding: false // whether background images are loading + }; + + // renderedPosition overrides if specified + if( params.renderedPosition ){ + let rpos = params.renderedPosition; + let pan = cy.pan(); + let zoom = cy.zoom(); + + _p.position = { + x: (rpos.x - pan.x) / zoom, + y: (rpos.y - pan.y) / zoom + }; + } + + if( is.string( params.classes ) ){ + let classes = params.classes.split( /\s+/ ); + for( let i = 0, l = classes.length; i < l; i++ ){ + let cls = classes[ i ]; + if( !cls || cls === '' ){ continue; } + + _p.classes.add(cls); + } + } + + if( params.style || params.css ){ + cy.style().applyBypass( this, params.style || params.css ); + } + + this.createEmitter(); + + if( restore === undefined || restore ){ + this.restore(); + } + +}; + +module.exports = Element; diff --git a/node_modules/cytoscape/src/collection/events.js b/node_modules/cytoscape/src/collection/events.js new file mode 100644 index 000000000..8c70f53b1 --- /dev/null +++ b/node_modules/cytoscape/src/collection/events.js @@ -0,0 +1,142 @@ +let Emitter = require('../emitter'); +let define = require('../define'); +let is = require('../is'); +let util = require('../util'); +let Selector = require('../selector'); + +let emitterOptions = { + qualifierCompare: function( selector1, selector2 ){ + if( selector1 == null || selector2 == null ){ + return selector1 == null && selector2 == null; + } else { + return selector1.sameText( selector2 ); + } + }, + eventMatches: function( ele, listener, eventObj ){ + let selector = listener.qualifier; + + if( selector != null ){ + return ele !== eventObj.target && is.element( eventObj.target ) && selector.matches( eventObj.target ); + } + + return true; + }, + eventFields: function( ele ){ + return { + cy: ele.cy(), + target: ele + }; + }, + callbackContext: function( ele, listener, eventObj ){ + return listener.qualifier != null ? eventObj.target : ele; + }, + beforeEmit: function( context, listener/*, eventObj*/ ){ + if( listener.conf && listener.conf.once ){ + listener.conf.onceCollection.removeListener( listener.event, listener.qualifier, listener.callback ); + } + }, + bubble: function(){ + return true; + }, + parent: function( ele ){ + return ele.isChild() ? ele.parent() : ele.cy(); + } +}; + +let argSelector = function( arg ){ + if( is.string(arg) ){ + return new Selector( arg ); + } else { + return arg; + } +}; + +let elesfn = ({ + createEmitter: function(){ + for( let i = 0; i < this.length; i++ ){ + let ele = this[i]; + let _p = ele._private; + + if( !_p.emitter ){ + _p.emitter = new Emitter( util.assign( { + context: ele + }, emitterOptions ) ); + } + } + + return this; + }, + + emitter: function(){ + return this._private.emitter; + }, + + on: function( events, selector, callback ){ + for( let i = 0; i < this.length; i++ ){ + let ele = this[i]; + + ele.emitter().on( events, argSelector(selector), callback ); + } + + return this; + }, + + removeListener: function( events, selector, callback ){ + for( let i = 0; i < this.length; i++ ){ + let ele = this[i]; + + ele.emitter().removeListener( events, argSelector(selector), callback ); + } + + return this; + }, + + one: function( events, selector, callback ){ + for( let i = 0; i < this.length; i++ ){ + let ele = this[i]; + + ele.emitter().one( events, argSelector(selector), callback ); + } + + return this; + }, + + once: function( events, selector, callback ){ + for( let i = 0; i < this.length; i++ ){ + let ele = this[i]; + + ele.emitter().on( events, argSelector(selector), callback, { + once: true, + onceCollection: this + } ); + } + }, + + emit: function( events, extraParams ){ + for( let i = 0; i < this.length; i++ ){ + let ele = this[i]; + + ele.emitter().emit( events, extraParams ); + } + + return this; + }, + + emitAndNotify: function( event, extraParams ){ // for internal use only + if( this.length === 0 ){ return; } // empty collections don't need to notify anything + + // notify renderer + this.cy().notify( { + type: event, + eles: this + } ); + + this.emit( event, extraParams ); + + return this; + } +}); + +define.eventAliasesOn( elesfn ); + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/filter.js b/node_modules/cytoscape/src/collection/filter.js new file mode 100644 index 000000000..a9d00e012 --- /dev/null +++ b/node_modules/cytoscape/src/collection/filter.js @@ -0,0 +1,368 @@ +let is = require( '../is' ); +let Selector = require( '../selector' ); + +let elesfn = ({ + nodes: function( selector ){ + return this.filter( ele => ele.isNode() ).filter( selector ); + }, + + edges: function( selector ){ + return this.filter( ele => ele.isEdge() ).filter( selector ); + }, + + filter: function( filter, thisArg ){ + if( filter === undefined ){ // check this first b/c it's the most common/performant case + return this; + } else if( is.string( filter ) || is.elementOrCollection( filter ) ){ + return new Selector( filter ).filter( this ); + } else if( is.fn( filter ) ){ + let filterEles = this.spawn(); + let eles = this; + + for( let i = 0; i < eles.length; i++ ){ + let ele = eles[ i ]; + let include = thisArg ? filter.apply( thisArg, [ ele, i, eles ] ) : filter( ele, i, eles ); + + if( include ){ + filterEles.merge( ele ); + } + } + + return filterEles; + } + + return this.spawn(); // if not handled by above, give 'em an empty collection + }, + + not: function( toRemove ){ + if( !toRemove ){ + return this; + } else { + + if( is.string( toRemove ) ){ + toRemove = this.filter( toRemove ); + } + + let elements = []; + let rMap = toRemove._private.map; + + for( let i = 0; i < this.length; i++ ){ + let element = this[ i ]; + + let remove = rMap.has( element.id() ); + if( !remove ){ + elements.push( element ); + } + } + + return this.spawn( elements ); + } + + }, + + absoluteComplement: function(){ + let cy = this.cy(); + + return cy.mutableElements().not( this ); + }, + + intersect: function( other ){ + // if a selector is specified, then filter by it instead + if( is.string( other ) ){ + let selector = other; + return this.filter( selector ); + } + + let elements = []; + let col1 = this; + let col2 = other; + let col1Smaller = this.length < other.length; + let map2 = col1Smaller ? col2._private.map : col1._private.map; + let col = col1Smaller ? col1 : col2; + + for( let i = 0; i < col.length; i++ ){ + let id = col[ i ]._private.data.id; + let entry = map2.get( id ); + + if( entry ){ + elements.push( entry.ele ); + } + } + + return this.spawn( elements ); + }, + + xor: function( other ){ + let cy = this._private.cy; + + if( is.string( other ) ){ + other = cy.$( other ); + } + + let elements = []; + let col1 = this; + let col2 = other; + + let add = function( col, other ){ + for( let i = 0; i < col.length; i++ ){ + let ele = col[ i ]; + let id = ele._private.data.id; + let inOther = other.hasElementWithId( id ); + + if( !inOther ){ + elements.push( ele ); + } + } + + }; + + add( col1, col2 ); + add( col2, col1 ); + + return this.spawn( elements ); + }, + + diff: function( other ){ + let cy = this._private.cy; + + if( is.string( other ) ){ + other = cy.$( other ); + } + + let left = []; + let right = []; + let both = []; + let col1 = this; + let col2 = other; + + let add = function( col, other, retEles ){ + + for( let i = 0; i < col.length; i++ ){ + let ele = col[ i ]; + let id = ele._private.data.id; + let inOther = other.hasElementWithId( id ); + + if( inOther ){ + both.push( ele ); + } else { + retEles.push( ele ); + } + } + + }; + + add( col1, col2, left ); + add( col2, col1, right ); + + return { + left: this.spawn( left, { unique: true } ), + right: this.spawn( right, { unique: true } ), + both: this.spawn( both, { unique: true } ) + }; + }, + + add: function( toAdd ){ + let cy = this._private.cy; + + if( !toAdd ){ + return this; + } + + if( is.string( toAdd ) ){ + let selector = toAdd; + toAdd = cy.mutableElements().filter( selector ); + } + + let elements = []; + + for( let i = 0; i < this.length; i++ ){ + elements.push( this[ i ] ); + } + + let map = this._private.map; + + for( let i = 0; i < toAdd.length; i++ ){ + + let add = !map.has( toAdd[ i ].id() ); + if( add ){ + elements.push( toAdd[ i ] ); + } + } + + return this.spawn( elements ); + }, + + // in place merge on calling collection + merge: function( toAdd ){ + let _p = this._private; + let cy = _p.cy; + + if( !toAdd ){ + return this; + } + + if( toAdd && is.string( toAdd ) ){ + let selector = toAdd; + toAdd = cy.mutableElements().filter( selector ); + } + + let map = _p.map; + + for( let i = 0; i < toAdd.length; i++ ){ + let toAddEle = toAdd[ i ]; + let id = toAddEle._private.data.id; + let add = !map.has( id ); + + if( add ){ + let index = this.length++; + + this[ index ] = toAddEle; + + map.set( id, { ele: toAddEle, index: index } ); + } else { // replace + let index = map.get( id ).index; + + this[ index ] = toAddEle; + map.set( id, { ele: toAddEle, index: index } ); + } + } + + return this; // chaining + }, + + // remove single ele in place in calling collection + unmergeOne: function( ele ){ + ele = ele[0]; + + let _p = this._private; + let id = ele._private.data.id; + let map = _p.map; + let entry = map.get( id ); + + if( !entry ){ + return this; // no need to remove + } + + let i = entry.index; + + // remove ele + this[ i ] = undefined; + map.delete( id ); + + let unmergedLastEle = i === this.length - 1; + + // replace empty spot with last ele in collection + if( this.length > 1 && !unmergedLastEle ){ + let lastEleI = this.length - 1; + let lastEle = this[ lastEleI ]; + let lastEleId = lastEle._private.data.id; + + this[ lastEleI ] = undefined; + this[ i ] = lastEle; + map.set( lastEleId, { ele: lastEle, index: i } ); + } + + // the collection is now 1 ele smaller + this.length--; + + return this; + }, + + // remove eles in place on calling collection + unmerge: function( toRemove ){ + let cy = this._private.cy; + + if( !toRemove ){ + return this; + } + + if( toRemove && is.string( toRemove ) ){ + let selector = toRemove; + toRemove = cy.mutableElements().filter( selector ); + } + + for( let i = 0; i < toRemove.length; i++ ){ + this.unmergeOne( toRemove[ i ] ); + } + + return this; // chaining + }, + + map: function( mapFn, thisArg ){ + let arr = []; + let eles = this; + + for( let i = 0; i < eles.length; i++ ){ + let ele = eles[ i ]; + let ret = thisArg ? mapFn.apply( thisArg, [ ele, i, eles ] ) : mapFn( ele, i, eles ); + + arr.push( ret ); + } + + return arr; + }, + + reduce: function( fn, initialValue ){ + let val = initialValue; + let eles = this; + + for( let i = 0; i < eles.length; i++ ){ + val = fn( val, eles[i], i, eles ); + } + + return val; + }, + + max: function( valFn, thisArg ){ + let max = -Infinity; + let maxEle; + let eles = this; + + for( let i = 0; i < eles.length; i++ ){ + let ele = eles[ i ]; + let val = thisArg ? valFn.apply( thisArg, [ ele, i, eles ] ) : valFn( ele, i, eles ); + + if( val > max ){ + max = val; + maxEle = ele; + } + } + + return { + value: max, + ele: maxEle + }; + }, + + min: function( valFn, thisArg ){ + let min = Infinity; + let minEle; + let eles = this; + + for( let i = 0; i < eles.length; i++ ){ + let ele = eles[ i ]; + let val = thisArg ? valFn.apply( thisArg, [ ele, i, eles ] ) : valFn( ele, i, eles ); + + if( val < min ){ + min = val; + minEle = ele; + } + } + + return { + value: min, + ele: minEle + }; + } +}); + +// aliases +let fn = elesfn; +fn[ 'u' ] = fn[ '|' ] = fn[ '+' ] = fn.union = fn.or = fn.add; +fn[ '\\' ] = fn[ '!' ] = fn[ '-' ] = fn.difference = fn.relativeComplement = fn.subtract = fn.not; +fn[ 'n' ] = fn[ '&' ] = fn[ '.' ] = fn.and = fn.intersection = fn.intersect; +fn[ '^' ] = fn[ '(+)' ] = fn[ '(-)' ] = fn.symmetricDifference = fn.symdiff = fn.xor; +fn.fnFilter = fn.filterFn = fn.stdFilter = fn.filter; +fn.complement = fn.abscomp = fn.absoluteComplement; + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/group.js b/node_modules/cytoscape/src/collection/group.js new file mode 100644 index 000000000..5e6c87235 --- /dev/null +++ b/node_modules/cytoscape/src/collection/group.js @@ -0,0 +1,28 @@ +let elesfn = ({ + isNode: function(){ + return this.group() === 'nodes'; + }, + + isEdge: function(){ + return this.group() === 'edges'; + }, + + isLoop: function(){ + return this.isEdge() && this.source().id() === this.target().id(); + }, + + isSimple: function(){ + return this.isEdge() && this.source().id() !== this.target().id(); + }, + + group: function(){ + let ele = this[0]; + + if( ele ){ + return ele._private.group; + } + } +}); + + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/index.js b/node_modules/cytoscape/src/collection/index.js new file mode 100644 index 000000000..13bdc4f11 --- /dev/null +++ b/node_modules/cytoscape/src/collection/index.js @@ -0,0 +1,731 @@ +let util = require('../util'); +let is = require('../is'); +let Map = require('../map'); +let Set = require('../set'); + +let Element = require('./element'); + +// factory for generating edge ids when no id is specified for a new element +let idFactory = { + generate: function( cy, element, tryThisId ){ + let id = tryThisId != null ? tryThisId : util.uuid(); + + while( cy.hasElementWithId( id ) ){ + id = util.uuid(); + } + + return id; + } +}; + +// represents a set of nodes, edges, or both together +let Collection = function( cy, elements, options ){ + if( cy === undefined || !is.core( cy ) ){ + util.error( 'A collection must have a reference to the core' ); + return; + } + + let map = new Map(); + let createdElements = false; + + if( !elements ){ + elements = []; + } else if( elements.length > 0 && is.plainObject( elements[0] ) && !is.element( elements[0] ) ){ + createdElements = true; + + // make elements from json and restore all at once later + let eles = []; + let elesIds = new Set(); + + for( let i = 0, l = elements.length; i < l; i++ ){ + let json = elements[ i ]; + + if( json.data == null ){ + json.data = {}; + } + + let data = json.data; + + // make sure newly created elements have valid ids + if( data.id == null ){ + data.id = idFactory.generate( cy, json ); + } else if( cy.hasElementWithId( data.id ) || elesIds.has( data.id ) ){ + continue; // can't create element if prior id already exists + } + + let ele = new Element( cy, json, false ); + eles.push( ele ); + elesIds.add( data.id ); + } + + elements = eles; + } + + this.length = 0; + + for( let i = 0, l = elements.length; i < l; i++ ){ + let element = elements[ i ]; + if( element == null ){ continue; } + + let id = element._private.data.id; + + if( options == null || ( options.unique && !map.has(id) ) ){ + map.set( id, { + index: this.length, + ele: element + } ); + + this[ this.length ] = element; + this.length++; + } + } + + this._private = { + cy: cy, + map: map + }; + + // restore the elements if we created them from json + if( createdElements ){ + this.restore(); + } +}; + +// Functions +//////////////////////////////////////////////////////////////////////////////////////////////////// + +// keep the prototypes in sync (an element has the same functions as a collection) +// and use elefn and elesfn as shorthands to the prototypes +let elesfn = Element.prototype = Collection.prototype; + +elesfn.instanceString = function(){ + return 'collection'; +}; + +elesfn.spawn = function( cy, eles, opts ){ + if( !is.core( cy ) ){ // cy is optional + opts = eles; + eles = cy; + cy = this.cy(); + } + + return new Collection( cy, eles, opts ); +}; + +elesfn.spawnSelf = function(){ + return this.spawn( this ); +}; + +elesfn.cy = function(){ + return this._private.cy; +}; + +elesfn.renderer = function(){ + return this._private.cy.renderer(); +}; + +elesfn.element = function(){ + return this[0]; +}; + +elesfn.collection = function(){ + if( is.collection( this ) ){ + return this; + } else { // an element + return new Collection( this._private.cy, [ this ] ); + } +}; + +elesfn.unique = function(){ + return new Collection( this._private.cy, this, { unique: true } ); +}; + +elesfn.hasElementWithId = function( id ){ + return this._private.map.has( id ); +}; + +elesfn.getElementById = function( id ){ + let cy = this._private.cy; + let entry = this._private.map.get( id ); + + return entry ? entry.ele : new Collection( cy ); // get ele or empty collection +}; + +elesfn.$id = elesfn.getElementById; + +elesfn.poolIndex = function(){ + let cy = this._private.cy; + let eles = cy._private.elements; + let id = this._private.data.id; + + return eles._private.map.get( id ).index; +}; + +elesfn.json = function( obj ){ + let ele = this.element(); + let cy = this.cy(); + + if( ele == null && obj ){ return this; } // can't set to no eles + + if( ele == null ){ return undefined; } // can't get from no eles + + let p = ele._private; + + if( is.plainObject( obj ) ){ // set + + cy.startBatch(); + + if( obj.data ){ + ele.data( obj.data ); + } + + if( obj.position ){ + ele.position( obj.position ); + } + + // ignore group -- immutable + + let checkSwitch = function( k, trueFnName, falseFnName ){ + let obj_k = obj[ k ]; + + if( obj_k != null && obj_k !== p[ k ] ){ + if( obj_k ){ + ele[ trueFnName ](); + } else { + ele[ falseFnName ](); + } + } + }; + + checkSwitch( 'removed', 'remove', 'restore' ); + + checkSwitch( 'selected', 'select', 'unselect' ); + + checkSwitch( 'selectable', 'selectify', 'unselectify' ); + + checkSwitch( 'locked', 'lock', 'unlock' ); + + checkSwitch( 'grabbable', 'grabify', 'ungrabify' ); + + if( obj.classes != null ){ + ele.classes( obj.classes ); + } + + cy.endBatch(); + + return this; + + } else if( obj === undefined ){ // get + + let json = { + data: util.copy( p.data ), + position: util.copy( p.position ), + group: p.group, + removed: p.removed, + selected: p.selected, + selectable: p.selectable, + locked: p.locked, + grabbable: p.grabbable, + classes: null + }; + + json.classes = ''; + + let i = 0; + p.classes.forEach( cls => json.classes += ( i++ === 0 ? cls : ' ' + cls ) ); + + return json; + } +}; + +elesfn.jsons = function(){ + let jsons = []; + + for( let i = 0; i < this.length; i++ ){ + let ele = this[ i ]; + let json = ele.json(); + + jsons.push( json ); + } + + return jsons; +}; + +elesfn.clone = function(){ + let cy = this.cy(); + let elesArr = []; + + for( let i = 0; i < this.length; i++ ){ + let ele = this[ i ]; + let json = ele.json(); + let clone = new Element( cy, json, false ); // NB no restore + + elesArr.push( clone ); + } + + return new Collection( cy, elesArr ); +}; +elesfn.copy = elesfn.clone; + +elesfn.restore = function( notifyRenderer ){ + let self = this; + let cy = self.cy(); + let cy_p = cy._private; + + if( notifyRenderer === undefined ){ + notifyRenderer = true; + } + + // create arrays of nodes and edges, since we need to + // restore the nodes first + let nodes = []; + let edges = []; + let elements; + for( let i = 0, l = self.length; i < l; i++ ){ + let ele = self[ i ]; + + if( !ele.removed() ){ + // don't need to handle this ele + continue; + } + + // keep nodes first in the array and edges after + if( ele.isNode() ){ // put to front of array if node + nodes.push( ele ); + } else { // put to end of array if edge + edges.push( ele ); + } + } + + elements = nodes.concat( edges ); + + let i; + let removeFromElements = function(){ + elements.splice( i, 1 ); + i--; + }; + + // now, restore each element + for( i = 0; i < elements.length; i++ ){ + let ele = elements[ i ]; + + let _private = ele._private; + let data = _private.data; + + // the traversal cache should start fresh when ele is added + ele.clearTraversalCache(); + + // set id and validate + if( data.id === undefined ){ + data.id = idFactory.generate( cy, ele ); + + } else if( is.number( data.id ) ){ + data.id = '' + data.id; // now it's a string + + } else if( is.emptyString( data.id ) || !is.string( data.id ) ){ + util.error( 'Can not create element with invalid string ID `' + data.id + '`' ); + + // can't create element if it has empty string as id or non-string id + removeFromElements(); + continue; + } else if( cy.hasElementWithId( data.id ) ){ + util.error( 'Can not create second element with ID `' + data.id + '`' ); + + // can't create element if one already has that id + removeFromElements(); + continue; + } + + let id = data.id; // id is finalised, now let's keep a ref + + if( ele.isNode() ){ // extra checks for nodes + let pos = _private.position; + + // make sure the nodes have a defined position + + if( pos.x == null ){ + pos.x = 0; + } + + if( pos.y == null ){ + pos.y = 0; + } + } + + if( ele.isEdge() ){ // extra checks for edges + + let edge = ele; + let fields = [ 'source', 'target' ]; + let fieldsLength = fields.length; + let badSourceOrTarget = false; + for( let j = 0; j < fieldsLength; j++ ){ + + let field = fields[ j ]; + let val = data[ field ]; + + if( is.number( val ) ){ + val = data[ field ] = '' + data[ field ]; // now string + } + + if( val == null || val === '' ){ + // can't create if source or target is not defined properly + util.error( 'Can not create edge `' + id + '` with unspecified ' + field ); + badSourceOrTarget = true; + } else if( !cy.hasElementWithId( val ) ){ + // can't create edge if one of its nodes doesn't exist + util.error( 'Can not create edge `' + id + '` with nonexistant ' + field + ' `' + val + '`' ); + badSourceOrTarget = true; + } + } + + if( badSourceOrTarget ){ removeFromElements(); continue; } // can't create this + + let src = cy.getElementById( data.source ); + let tgt = cy.getElementById( data.target ); + + src._private.edges.push( edge ); + tgt._private.edges.push( edge ); + + edge._private.source = src; + edge._private.target = tgt; + } // if is edge + + // create mock ids / indexes maps for element so it can be used like collections + _private.map = new Map(); + _private.map.set( id, { ele: ele, index: 0 } ); + + _private.removed = false; + cy.addToPool( ele ); + } // for each element + + // do compound node sanity checks + for( let i = 0; i < nodes.length; i++ ){ // each node + let node = nodes[ i ]; + let data = node._private.data; + + if( is.number( data.parent ) ){ // then automake string + data.parent = '' + data.parent; + } + + let parentId = data.parent; + + let specifiedParent = parentId != null; + + if( specifiedParent ){ + let parent = cy.getElementById( parentId ); + + if( parent.empty() ){ + // non-existant parent; just remove it + data.parent = undefined; + } else { + let selfAsParent = false; + let ancestor = parent; + while( !ancestor.empty() ){ + if( node.same( ancestor ) ){ + // mark self as parent and remove from data + selfAsParent = true; + data.parent = undefined; // remove parent reference + + // exit or we loop forever + break; + } + + ancestor = ancestor.parent(); + } + + if( !selfAsParent ){ + // connect with children + parent[0]._private.children.push( node ); + node._private.parent = parent[0]; + + // let the core know we have a compound graph + cy_p.hasCompoundNodes = true; + } + } // else + } // if specified parent + } // for each node + + if( elements.length > 0 ){ + let restored = new Collection( cy, elements ); + + for( let i = 0; i < restored.length; i++ ){ + let ele = restored[i]; + + if( ele.isNode() ){ continue; } + + // adding an edge invalidates the traversal caches for the parallel edges + ele.parallelEdges().clearTraversalCache(); + + // adding an edge invalidates the traversal cache for the connected nodes + ele.source().clearTraversalCache(); + ele.target().clearTraversalCache(); + } + + let toUpdateStyle; + + if( cy_p.hasCompoundNodes ){ + toUpdateStyle = cy.collection().merge( restored ).merge( restored.connectedNodes() ).merge( restored.parent() ); + } else { + toUpdateStyle = restored; + } + + toUpdateStyle.dirtyCompoundBoundsCache().updateStyle( notifyRenderer ); + + if( notifyRenderer ){ + restored.emitAndNotify( 'add' ); + } else { + restored.emit( 'add' ); + } + } + + return self; // chainability +}; + +elesfn.removed = function(){ + let ele = this[0]; + return ele && ele._private.removed; +}; + +elesfn.inside = function(){ + let ele = this[0]; + return ele && !ele._private.removed; +}; + +elesfn.remove = function( notifyRenderer ){ + let self = this; + let removed = []; + let elesToRemove = []; + let elesToRemoveIds = {}; + let cy = self._private.cy; + + if( notifyRenderer === undefined ){ + notifyRenderer = true; + } + + // add connected edges + function addConnectedEdges( node ){ + let edges = node._private.edges; + for( let i = 0; i < edges.length; i++ ){ + add( edges[ i ] ); + } + } + + + // add descendant nodes + function addChildren( node ){ + let children = node._private.children; + + for( let i = 0; i < children.length; i++ ){ + add( children[ i ] ); + } + } + + function add( ele ){ + let alreadyAdded = elesToRemoveIds[ ele.id() ]; + if( ele.removed() || alreadyAdded ){ + return; + } else { + elesToRemoveIds[ ele.id() ] = true; + } + + if( ele.isNode() ){ + elesToRemove.push( ele ); // nodes are removed last + + addConnectedEdges( ele ); + addChildren( ele ); + } else { + elesToRemove.unshift( ele ); // edges are removed first + } + } + + // make the list of elements to remove + // (may be removing more than specified due to connected edges etc) + + for( let i = 0, l = self.length; i < l; i++ ){ + let ele = self[ i ]; + + add( ele ); + } + + function removeEdgeRef( node, edge ){ + let connectedEdges = node._private.edges; + + util.removeFromArray( connectedEdges, edge ); + + // removing an edges invalidates the traversal cache for its nodes + node.clearTraversalCache(); + } + + function removeParallelRefs( edge ){ + // removing an edge invalidates the traversal caches for the parallel edges + edge.parallelEdges().clearTraversalCache(); + } + + let alteredParents = []; + alteredParents.ids = {}; + + function removeChildRef( parent, ele ){ + ele = ele[0]; + parent = parent[0]; + + let children = parent._private.children; + let pid = parent.id(); + + util.removeFromArray( children, ele ); + + if( !alteredParents.ids[ pid ] ){ + alteredParents.ids[ pid ] = true; + alteredParents.push( parent ); + } + } + + self.dirtyCompoundBoundsCache(); + + cy.removeFromPool( elesToRemove ); // remove from core pool + + for( let i = 0; i < elesToRemove.length; i++ ){ + let ele = elesToRemove[ i ]; + + // mark as removed + ele._private.removed = true; + + // add to list of removed elements + removed.push( ele ); + + if( ele.isEdge() ){ // remove references to this edge in its connected nodes + let src = ele.source()[0]; + let tgt = ele.target()[0]; + + removeEdgeRef( src, ele ); + removeEdgeRef( tgt, ele ); + removeParallelRefs( ele ); + + } else { // remove reference to parent + let parent = ele.parent(); + + if( parent.length !== 0 ){ + removeChildRef( parent, ele ); + } + } + } + + // check to see if we have a compound graph or not + let elesStillInside = cy._private.elements; + cy._private.hasCompoundNodes = false; + for( let i = 0; i < elesStillInside.length; i++ ){ + let ele = elesStillInside[ i ]; + + if( ele.isParent() ){ + cy._private.hasCompoundNodes = true; + break; + } + } + + let removedElements = new Collection( this.cy(), removed ); + if( removedElements.size() > 0 ){ + // must manually notify since trigger won't do this automatically once removed + + if( notifyRenderer ){ + this.cy().notify( { + type: 'remove', + eles: removedElements + } ); + } + + removedElements.emit( 'remove' ); + } + + // the parents who were modified by the removal need their style updated + for( let i = 0; i < alteredParents.length; i++ ){ + let ele = alteredParents[ i ]; + + if( !ele.removed() ){ + ele.updateStyle(); + } + } + + return new Collection( cy, removed ); +}; + +elesfn.move = function( struct ){ + let cy = this._private.cy; + + if( struct.source !== undefined || struct.target !== undefined ){ + let srcId = struct.source; + let tgtId = struct.target; + let srcExists = cy.hasElementWithId( srcId ); + let tgtExists = cy.hasElementWithId( tgtId ); + + if( srcExists || tgtExists ){ + let jsons = this.jsons(); + + this.remove(); + + for( let i = 0; i < jsons.length; i++ ){ + let json = jsons[i]; + let ele = this[i]; + + if( json.group === 'edges' ){ + if( srcExists ){ json.data.source = srcId; } + + if( tgtExists ){ json.data.target = tgtId; } + + json.scratch = ele._private.scratch; + } + } + + return cy.add( jsons ); + } + + } else if( struct.parent !== undefined ){ // move node to new parent + let parentId = struct.parent; + let parentExists = parentId === null || cy.hasElementWithId( parentId ); + + if( parentExists ){ + let jsons = this.jsons(); + let descs = this.descendants(); + let descsEtcJsons = descs.union( descs.union( this ).connectedEdges() ).jsons(); + + this.remove(); // NB: also removes descendants and their connected edges + + for( let i = 0; i < jsons.length; i++ ){ + let json = jsons[i]; + let ele = this[i]; + + if( json.group === 'nodes' ){ + json.data.parent = parentId === null ? undefined : parentId; + + json.scratch = ele._private.scratch; + } + } + + return cy.add( jsons.concat( descsEtcJsons ) ); + } + } + + return this; // if nothing done +}; + +[ + require( './algorithms' ), + require( './animation' ), + require( './class' ), + require( './comparators' ), + require( './compounds' ), + require( './data' ), + require( './degree' ), + require( './dimensions' ), + require( './events' ), + require( './filter' ), + require( './group' ), + require( './index' ), + require( './iteration' ), + require( './layout' ), + require( './style' ), + require( './switch-functions' ), + require( './traversing' ) +].forEach( function( props ){ + util.extend( elesfn, props ); +} ); + +module.exports = Collection; diff --git a/node_modules/cytoscape/src/collection/iteration.js b/node_modules/cytoscape/src/collection/iteration.js new file mode 100644 index 000000000..a240f0d1d --- /dev/null +++ b/node_modules/cytoscape/src/collection/iteration.js @@ -0,0 +1,124 @@ +let is = require( '../is' ); +let zIndexSort = require( './zsort' ); +let util = require('../util'); + +let elesfn = ({ + forEach: function( fn, thisArg ){ + if( is.fn( fn ) ){ + + for( let i = 0; i < this.length; i++ ){ + let ele = this[ i ]; + let ret = thisArg ? fn.apply( thisArg, [ ele, i, this ] ) : fn( ele, i, this ); + + if( ret === false ){ break; } // exit each early on return false + } + } + + return this; + }, + + toArray: function(){ + let array = []; + + for( let i = 0; i < this.length; i++ ){ + array.push( this[ i ] ); + } + + return array; + }, + + slice: function( start, end ){ + let array = []; + let thisSize = this.length; + + if( end == null ){ + end = thisSize; + } + + if( start == null ){ + start = 0; + } + + if( start < 0 ){ + start = thisSize + start; + } + + if( end < 0 ){ + end = thisSize + end; + } + + for( let i = start; i >= 0 && i < end && i < thisSize; i++ ){ + array.push( this[ i ] ); + } + + return this.spawn( array ); + }, + + size: function(){ + return this.length; + }, + + eq: function( i ){ + return this[ i ] || this.spawn(); + }, + + first: function(){ + return this[0] || this.spawn(); + }, + + last: function(){ + return this[ this.length - 1 ] || this.spawn(); + }, + + empty: function(){ + return this.length === 0; + }, + + nonempty: function(){ + return !this.empty(); + }, + + sort: function( sortFn ){ + if( !is.fn( sortFn ) ){ + return this; + } + + let sorted = this.toArray().sort( sortFn ); + + return this.spawn( sorted ); + }, + + sortByZIndex: function(){ + return this.sort( zIndexSort ); + }, + + zDepth: function(){ + let ele = this[0]; + if( !ele ){ return undefined; } + + // let cy = ele.cy(); + let _p = ele._private; + let group = _p.group; + + if( group === 'nodes' ){ + let depth = _p.data.parent ? ele.parents().size() : 0; + + if( !ele.isParent() ){ + return util.MAX_INT - 1; // childless nodes always on top + } + + return depth; + } else { + let src = _p.source; + let tgt = _p.target; + let srcDepth = src.zDepth(); + let tgtDepth = tgt.zDepth(); + + return Math.max( srcDepth, tgtDepth, 0 ); // depth of deepest parent + } + } +}); + +elesfn.each = elesfn.forEach; + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/layout.js b/node_modules/cytoscape/src/collection/layout.js new file mode 100644 index 000000000..95d1b8e43 --- /dev/null +++ b/node_modules/cytoscape/src/collection/layout.js @@ -0,0 +1,193 @@ +let is = require( '../is' ); +let util = require( '../util' ); +let Promise = require('../promise'); +let math = require('../math'); + +let elesfn = ({ + // Calculates and returns node dimensions { x, y } based on options given + layoutDimensions: function( options ){ + options = util.assign( { + nodeDimensionsIncludeLabels: true + }, options ); + + if( options.nodeDimensionsIncludeLabels ){ + let bbDim = this.boundingBox(); + return { + w: bbDim.w, + h: bbDim.h + }; + } + else { + return { + w: this.outerWidth(), + h: this.outerHeight() + }; + } + }, + + // using standard layout options, apply position function (w/ or w/o animation) + layoutPositions: function( layout, options, fn ){ + let nodes = this.nodes(); + let cy = this.cy(); + let layoutEles = options.eles; // nodes & edges + let getMemoizeKey = ( node, i ) => node.id() + '$' + i; + let fnMem = util.memoize( fn, getMemoizeKey ); // memoized version of position function + + layout.emit( { type: 'layoutstart', layout: layout } ); + + layout.animations = []; + + let calculateSpacing = function( spacing, nodesBb, pos ){ + let center = { + x: nodesBb.x1 + nodesBb.w / 2, + y: nodesBb.y1 + nodesBb.h / 2 + }; + + let spacingVector = { // scale from center of bounding box (not necessarily 0,0) + x: (pos.x - center.x) * spacing, + y: (pos.y - center.y) * spacing + }; + + return { + x: center.x + spacingVector.x, + y: center.y + spacingVector.y + }; + }; + + let useSpacingFactor = options.spacingFactor && options.spacingFactor !== 1; + + let spacingBb = function(){ + if( !useSpacingFactor ){ return null; } + + let bb = math.makeBoundingBox(); + + for( let i = 0; i < nodes.length; i++ ){ + let node = nodes[i]; + let pos = fnMem( node, i ); + + math.expandBoundingBoxByPoint( bb, pos.x, pos.y ); + } + + return bb; + }; + + let bb = spacingBb(); + + let getFinalPos = util.memoize( function( node, i ){ + let newPos = fnMem( node, i ); + let pos = node.position(); + + if( !is.number( pos.x ) || !is.number( pos.y ) ){ + node.silentPosition( { x: 0, y: 0 } ); + } + + if( useSpacingFactor ){ + let spacing = Math.abs( options.spacingFactor ); + + newPos = calculateSpacing( spacing, bb, newPos ); + } + + if( options.transform != null ){ + newPos = options.transform( node, newPos ); + } + + return newPos; + }, getMemoizeKey ); + + if( options.animate ){ + for( let i = 0; i < nodes.length; i++ ){ + let node = nodes[ i ]; + let newPos = getFinalPos( node, i ); + let animateNode = options.animateFilter == null || options.animateFilter( node, i ); + + if( animateNode ){ + let ani = node.animation( { + position: newPos, + duration: options.animationDuration, + easing: options.animationEasing + } ); + + layout.animations.push( ani ); + + ani.play(); + } else { + node.position( newPos ); + } + + } + + if( options.fit ){ + let fitAni = cy.animation({ + fit: { + boundingBox: layoutEles.boundingBoxAt( getFinalPos ), + padding: options.padding + }, + duration: options.animationDuration, + easing: options.animationEasing + }); + + layout.animations.push( fitAni ); + + fitAni.play(); + } else if( options.zoom !== undefined && options.pan !== undefined ){ + let zoomPanAni = cy.animation({ + zoom: options.zoom, + pan: options.pan, + duration: options.animationDuration, + easing: options.animationEasing + }); + + layout.animations.push( zoomPanAni ); + + zoomPanAni.play(); + } + + layout.one( 'layoutready', options.ready ); + layout.emit( { type: 'layoutready', layout: layout } ); + + Promise.all( layout.animations.map(function( ani ){ + return ani.promise(); + }) ).then(function(){ + layout.one( 'layoutstop', options.stop ); + layout.emit( { type: 'layoutstop', layout: layout } ); + }); + } else { + + nodes.positions( getFinalPos ); + + if( options.fit ){ + cy.fit( options.eles, options.padding ); + } + + if( options.zoom != null ){ + cy.zoom( options.zoom ); + } + + if( options.pan ){ + cy.pan( options.pan ); + } + + layout.one( 'layoutready', options.ready ); + layout.emit( { type: 'layoutready', layout: layout } ); + + layout.one( 'layoutstop', options.stop ); + layout.emit( { type: 'layoutstop', layout: layout } ); + } + + return this; // chaining + }, + + layout: function( options ){ + let cy = this.cy(); + + return cy.makeLayout( util.extend( {}, options, { + eles: this + } ) ); + } + +}); + +// aliases: +elesfn.createLayout = elesfn.makeLayout = elesfn.layout; + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/style.js b/node_modules/cytoscape/src/collection/style.js new file mode 100644 index 000000000..e5a811f9d --- /dev/null +++ b/node_modules/cytoscape/src/collection/style.js @@ -0,0 +1,443 @@ +let is = require( '../is' ); + +function styleCache( key, fn, ele ){ + var _p = ele._private; + var cache = _p.styleCache = _p.styleCache || {}; + var val; + + if( (val = cache[key]) != null ){ + return val; + } else { + val = cache[key] = fn( ele ); + + return val; + } +} + +function cacheStyleFunction( key, fn ){ + return function cachedStyleFunction( ele ){ + return styleCache( key, fn, ele ); + }; +} + +function cachePrototypeStyleFunction( key, fn ){ + let selfFn = ele => fn.call( ele ); + + return function cachedPrototypeStyleFunction(){ + var ele = this[0]; + + if( ele ){ + return styleCache( key, selfFn, ele ); + } + }; +} + +let elesfn = ({ + + recalculateRenderedStyle: function( useCache ){ + let cy = this.cy(); + let renderer = cy.renderer(); + let styleEnabled = cy.styleEnabled(); + + if( renderer && styleEnabled ){ + renderer.recalculateRenderedStyle( this, useCache ); + } + + return this; + }, + + dirtyStyleCache: function(){ + let cy = this.cy(); + let dirty = ele => ele._private.styleCache = {}; + + if( cy.hasCompoundNodes() ){ + let eles; + + eles = this.spawnSelf() + .merge( this.descendants() ) + .merge( this.parents() ) + ; + + eles.merge( eles.connectedEdges() ); + + eles.forEach( dirty ); + } else { + this.forEach( ele => { + dirty( ele ); + + ele.connectedEdges().forEach( dirty ); + } ); + } + + return this; + }, + + // fully updates (recalculates) the style for the elements + updateStyle: function( notifyRenderer ){ + let cy = this._private.cy; + + if( !cy.styleEnabled() ){ return this; } + + if( cy._private.batchingStyle ){ + let bEles = cy._private.batchStyleEles; + + bEles.merge( this ); + + return this; // chaining and exit early when batching + } + + let hasCompounds = cy.hasCompoundNodes(); + let style = cy.style(); + let updatedEles = this; + + notifyRenderer = notifyRenderer || notifyRenderer === undefined ? true : false; + + if( hasCompounds ){ // then add everything up and down for compound selector checks + updatedEles = this.spawnSelf().merge( this.descendants() ).merge( this.parents() ); + } + + let changedEles = style.apply( updatedEles ); + + changedEles.dirtyStyleCache(); + changedEles.dirtyCompoundBoundsCache(); + + if( notifyRenderer ){ + changedEles.emitAndNotify( 'style' ); // let renderer know we changed style + } else { + changedEles.emit( 'style' ); // just fire the event + } + + return this; // chaining + }, + + // just update the mappers in the elements' styles; cheaper than eles.updateStyle() + updateMappers: function( notifyRenderer ){ + let cy = this._private.cy; + let style = cy.style(); + notifyRenderer = notifyRenderer || notifyRenderer === undefined ? true : false; + + if( !cy.styleEnabled() ){ return this; } + + let changedEles = style.updateMappers( this ); + + changedEles.dirtyStyleCache(); + changedEles.dirtyCompoundBoundsCache(); + + if( notifyRenderer ){ + changedEles.emitAndNotify( 'style' ); // let renderer know we changed style + } else { + changedEles.emit( 'style' ); // just fire the event + } + return this; // chaining + }, + + // get the internal parsed style object for the specified property + parsedStyle: function( property ){ + let ele = this[0]; + let cy = ele.cy(); + + if( !cy.styleEnabled() ){ return; } + + if( ele ){ + return ele._private.style[ property ] || cy.style().getDefaultProperty( property ); + } + }, + + numericStyle: function( property ){ + let ele = this[0]; + + if( !ele.cy().styleEnabled() ){ return; } + + if( ele ){ + let pstyle = ele.pstyle( property ); + + return pstyle.pfValue !== undefined ? pstyle.pfValue : pstyle.value; + } + }, + + numericStyleUnits: function( property ){ + let ele = this[0]; + + if( !ele.cy().styleEnabled() ){ return; } + + if( ele ){ + return ele.pstyle( property ).units; + } + }, + + // get the specified css property as a rendered value (i.e. on-screen value) + // or get the whole rendered style if no property specified (NB doesn't allow setting) + renderedStyle: function( property ){ + let cy = this.cy(); + if( !cy.styleEnabled() ){ return this; } + + let ele = this[0]; + + if( ele ){ + return cy.style().getRenderedStyle( ele, property ); + } + }, + + // read the calculated css style of the element or override the style (via a bypass) + style: function( name, value ){ + let cy = this.cy(); + + if( !cy.styleEnabled() ){ return this; } + + let updateTransitions = false; + let style = cy.style(); + + if( is.plainObject( name ) ){ // then extend the bypass + let props = name; + style.applyBypass( this, props, updateTransitions ); + + this.dirtyStyleCache(); + this.dirtyCompoundBoundsCache(); + + this.emitAndNotify( 'style' ); // let the renderer know we've updated style + + } else if( is.string( name ) ){ + + if( value === undefined ){ // then get the property from the style + let ele = this[0]; + + if( ele ){ + return style.getStylePropertyValue( ele, name ); + } else { // empty collection => can't get any value + return; + } + + } else { // then set the bypass with the property value + style.applyBypass( this, name, value, updateTransitions ); + + this.dirtyStyleCache(); + this.dirtyCompoundBoundsCache(); + + this.emitAndNotify( 'style' ); // let the renderer know we've updated style + } + + } else if( name === undefined ){ + let ele = this[0]; + + if( ele ){ + return style.getRawStyle( ele ); + } else { // empty collection => can't get any value + return; + } + } + + return this; // chaining + }, + + removeStyle: function( names ){ + let cy = this.cy(); + + if( !cy.styleEnabled() ){ return this; } + + let updateTransitions = false; + let style = cy.style(); + let eles = this; + + if( names === undefined ){ + for( let i = 0; i < eles.length; i++ ){ + let ele = eles[ i ]; + + style.removeAllBypasses( ele, updateTransitions ); + } + } else { + names = names.split( /\s+/ ); + + for( let i = 0; i < eles.length; i++ ){ + let ele = eles[ i ]; + + style.removeBypasses( ele, names, updateTransitions ); + } + } + + this.dirtyStyleCache(); + this.dirtyCompoundBoundsCache(); + + this.emitAndNotify( 'style' ); // let the renderer know we've updated style + + return this; // chaining + }, + + show: function(){ + this.css( 'display', 'element' ); + return this; // chaining + }, + + hide: function(){ + this.css( 'display', 'none' ); + return this; // chaining + }, + + effectiveOpacity: function(){ + let cy = this.cy(); + if( !cy.styleEnabled() ){ return 1; } + + let hasCompoundNodes = cy.hasCompoundNodes(); + let ele = this[0]; + + if( ele ){ + let _p = ele._private; + let parentOpacity = ele.pstyle( 'opacity' ).value; + + if( !hasCompoundNodes ){ return parentOpacity; } + + let parents = !_p.data.parent ? null : ele.parents(); + + if( parents ){ + for( let i = 0; i < parents.length; i++ ){ + let parent = parents[ i ]; + let opacity = parent.pstyle( 'opacity' ).value; + + parentOpacity = opacity * parentOpacity; + } + } + + return parentOpacity; + } + }, + + transparent: function(){ + let cy = this.cy(); + if( !cy.styleEnabled() ){ return false; } + + let ele = this[0]; + let hasCompoundNodes = ele.cy().hasCompoundNodes(); + + if( ele ){ + if( !hasCompoundNodes ){ + return ele.pstyle( 'opacity' ).value === 0; + } else { + return ele.effectiveOpacity() === 0; + } + } + }, + + backgrounding: function(){ + let cy = this.cy(); + if( !cy.styleEnabled() ){ return false; } + + let ele = this[0]; + + return ele._private.backgrounding ? true : false; + } + +}); + +function checkCompound( ele, parentOk ){ + let _p = ele._private; + let parents = _p.data.parent ? ele.parents() : null; + + if( parents ){ for( let i = 0; i < parents.length; i++ ){ + let parent = parents[ i ]; + + if( !parentOk( parent ) ){ return false; } + } } + + return true; +} + +function defineDerivedStateFunction( specs ){ + let ok = specs.ok; + let edgeOkViaNode = specs.edgeOkViaNode || specs.ok; + let parentOk = specs.parentOk || specs.ok; + + return function(){ + let cy = this.cy(); + if( !cy.styleEnabled() ){ return true; } + + let ele = this[0]; + let hasCompoundNodes = cy.hasCompoundNodes(); + + if( ele ){ + let _p = ele._private; + + if( !ok( ele ) ){ return false; } + + if( ele.isNode() ){ + return !hasCompoundNodes || checkCompound( ele, parentOk ); + } else { + let src = _p.source; + let tgt = _p.target; + + return ( edgeOkViaNode(src) && (!hasCompoundNodes || checkCompound(src, edgeOkViaNode)) ) && + ( src === tgt || ( edgeOkViaNode(tgt) && (!hasCompoundNodes || checkCompound(tgt, edgeOkViaNode)) ) ); + } + } + }; +} + +let eleTakesUpSpace = cacheStyleFunction( 'eleTakesUpSpace', function( ele ){ + return ( + ele.pstyle( 'display' ).value === 'element' + && ele.width() !== 0 + && ( ele.isNode() ? ele.height() !== 0 : true ) + ); +} ); + +elesfn.takesUpSpace = cachePrototypeStyleFunction( 'takesUpSpace', defineDerivedStateFunction({ + ok: eleTakesUpSpace +}) ); + +let eleInteractive = cacheStyleFunction( 'eleInteractive', function( ele ){ + return ( + ele.pstyle('events').value === 'yes' + && ele.pstyle('visibility').value === 'visible' + && eleTakesUpSpace( ele ) + ); +} ); + +let parentInteractive = cacheStyleFunction( 'parentInteractive', function( parent ){ + return ( + parent.pstyle('visibility').value === 'visible' + && eleTakesUpSpace( parent ) + ); +} ); + +elesfn.interactive = cachePrototypeStyleFunction( 'interactive', defineDerivedStateFunction({ + ok: eleInteractive, + parentOk: parentInteractive, + edgeOkViaNode: eleTakesUpSpace +}) ); + +elesfn.noninteractive = function(){ + let ele = this[0]; + + if( ele ){ + return !ele.interactive(); + } +}; + +let eleVisible = cacheStyleFunction( 'eleVisible', function( ele ){ + return ( + ele.pstyle( 'visibility' ).value === 'visible' + && ele.pstyle( 'opacity' ).pfValue !== 0 + && eleTakesUpSpace( ele ) + ); +} ); + +let edgeVisibleViaNode = eleTakesUpSpace; + +elesfn.visible = cachePrototypeStyleFunction( 'visible', defineDerivedStateFunction({ + ok: eleVisible, + edgeOkViaNode: edgeVisibleViaNode +}) ); + +elesfn.hidden = function(){ + let ele = this[0]; + + if( ele ){ + return !ele.visible(); + } +}; + + +elesfn.bypass = elesfn.css = elesfn.style; +elesfn.renderedCss = elesfn.renderedStyle; +elesfn.removeBypass = elesfn.removeCss = elesfn.removeStyle; +elesfn.pstyle = elesfn.parsedStyle; + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/switch-functions.js b/node_modules/cytoscape/src/collection/switch-functions.js new file mode 100644 index 000000000..e48e23249 --- /dev/null +++ b/node_modules/cytoscape/src/collection/switch-functions.js @@ -0,0 +1,149 @@ +let elesfn = {}; + +function defineSwitchFunction( params ){ + return function(){ + let args = arguments; + let changedEles = []; + + // e.g. cy.nodes().select( data, handler ) + if( args.length === 2 ){ + let data = args[0]; + let handler = args[1]; + this.on( params.event, data, handler ); + } + + // e.g. cy.nodes().select( handler ) + else if( args.length === 1 ){ + let handler = args[0]; + this.on( params.event, handler ); + } + + // e.g. cy.nodes().select() + else if( args.length === 0 ){ + for( let i = 0; i < this.length; i++ ){ + let ele = this[ i ]; + let able = !params.ableField || ele._private[ params.ableField ]; + let changed = ele._private[ params.field ] != params.value; + + if( params.overrideAble ){ + let overrideAble = params.overrideAble( ele ); + + if( overrideAble !== undefined ){ + able = overrideAble; + + if( !overrideAble ){ return this; } // to save cycles assume not able for all on override + } + } + + if( able ){ + ele._private[ params.field ] = params.value; + + if( changed ){ + changedEles.push( ele ); + } + } + } + + let changedColl = this.spawn( changedEles ); + changedColl.updateStyle(); // change of state => possible change of style + changedColl.emit( params.event ); + } + + return this; + }; +} + +function defineSwitchSet( params ){ + elesfn[ params.field ] = function(){ + let ele = this[0]; + + if( ele ){ + if( params.overrideField ){ + let val = params.overrideField( ele ); + + if( val !== undefined ){ + return val; + } + } + + return ele._private[ params.field ]; + } + }; + + elesfn[ params.on ] = defineSwitchFunction( { + event: params.on, + field: params.field, + ableField: params.ableField, + overrideAble: params.overrideAble, + value: true + } ); + + elesfn[ params.off ] = defineSwitchFunction( { + event: params.off, + field: params.field, + ableField: params.ableField, + overrideAble: params.overrideAble, + value: false + } ); +} + +defineSwitchSet( { + field: 'locked', + overrideField: function( ele ){ + return ele.cy().autolock() ? true : undefined; + }, + on: 'lock', + off: 'unlock' +} ); + +defineSwitchSet( { + field: 'grabbable', + overrideField: function( ele ){ + return ele.cy().autoungrabify() ? false : undefined; + }, + on: 'grabify', + off: 'ungrabify' +} ); + +defineSwitchSet( { + field: 'selected', + ableField: 'selectable', + overrideAble: function( ele ){ + return ele.cy().autounselectify() ? false : undefined; + }, + on: 'select', + off: 'unselect' +} ); + +defineSwitchSet( { + field: 'selectable', + overrideField: function( ele ){ + return ele.cy().autounselectify() ? false : undefined; + }, + on: 'selectify', + off: 'unselectify' +} ); + +elesfn.deselect = elesfn.unselect; + +elesfn.grabbed = function(){ + let ele = this[0]; + if( ele ){ + return ele._private.grabbed; + } +}; + +defineSwitchSet( { + field: 'active', + on: 'activate', + off: 'unactivate' +} ); + +elesfn.inactive = function(){ + let ele = this[0]; + if( ele ){ + return !ele._private.active; + } +}; + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/traversing.js b/node_modules/cytoscape/src/collection/traversing.js new file mode 100644 index 000000000..de34a72dd --- /dev/null +++ b/node_modules/cytoscape/src/collection/traversing.js @@ -0,0 +1,440 @@ +let util = require( '../util' ); +let is = require( '../is' ); + +let elesfn = {}; + +let cache = function( fn, name ){ + return function traversalCache( arg1, arg2, arg3, arg4 ){ + let selectorOrEles = arg1; + let eles = this; + let key; + + if( selectorOrEles == null ){ + key = 'null'; + } else if( is.elementOrCollection( selectorOrEles ) && selectorOrEles.length === 1 ){ + key = '#' + selectorOrEles.id(); + } + + if( eles.length === 1 && key ){ + let _p = eles[0]._private; + let tch = _p.traversalCache = _p.traversalCache || {}; + let ch = tch[ name ] = tch[ name ] || {}; + let cacheHit = ch[ key ]; + + if( cacheHit ){ + return cacheHit; + } else { + return ( ch[ key ] = fn.call( eles, arg1, arg2, arg3, arg4 ) ); + } + } else { + return fn.call( eles, arg1, arg2, arg3, arg4 ); + } + }; +}; + +// DAG functions +//////////////// + +let defineDagExtremity = function( params ){ + return function dagExtremityImpl( selector ){ + let eles = this; + let ret = []; + + for( let i = 0; i < eles.length; i++ ){ + let ele = eles[ i ]; + if( !ele.isNode() ){ + continue; + } + + let disqualified = false; + let edges = ele.connectedEdges(); + + for( let j = 0; j < edges.length; j++ ){ + let edge = edges[j]; + let src = edge.source(); + let tgt = edge.target(); + + if( + ( params.noIncomingEdges && tgt === ele && src !== ele ) + || ( params.noOutgoingEdges && src === ele && tgt !== ele ) + ){ + disqualified = true; + break; + } + } + + if( !disqualified ){ + ret.push( ele ); + } + } + + return this.spawn( ret, { unique: true } ).filter( selector ); + }; +}; + +let defineDagOneHop = function( params ){ + return function( selector ){ + let eles = this; + let oEles = []; + + for( let i = 0; i < eles.length; i++ ){ + let ele = eles[ i ]; + + if( !ele.isNode() ){ continue; } + + let edges = ele.connectedEdges(); + for( let j = 0; j < edges.length; j++ ){ + let edge = edges[ j ]; + let src = edge.source(); + let tgt = edge.target(); + + if( params.outgoing && src === ele ){ + oEles.push( edge ); + oEles.push( tgt ); + } else if( params.incoming && tgt === ele ){ + oEles.push( edge ); + oEles.push( src ); + } + } + } + + return this.spawn( oEles, { unique: true } ).filter( selector ); + }; +}; + +let defineDagAllHops = function( params ){ + return function( selector ){ + let eles = this; + let sEles = []; + let sElesIds = {}; + + for( ;; ){ + let next = params.outgoing ? eles.outgoers() : eles.incomers(); + + if( next.length === 0 ){ break; } // done if none left + + let newNext = false; + for( let i = 0; i < next.length; i++ ){ + let n = next[ i ]; + let nid = n.id(); + + if( !sElesIds[ nid ] ){ + sElesIds[ nid ] = true; + sEles.push( n ); + newNext = true; + } + } + + if( !newNext ){ break; } // done if touched all outgoers already + + eles = next; + } + + return this.spawn( sEles, { unique: true } ).filter( selector ); + }; +}; + +elesfn.clearTraversalCache = function( ){ + for( let i = 0; i < this.length; i++ ){ + this[i]._private.traversalCache = null; + } +}; + +util.extend( elesfn, { + // get the root nodes in the DAG + roots: defineDagExtremity({ noIncomingEdges: true }), + + // get the leaf nodes in the DAG + leaves: defineDagExtremity({ noOutgoingEdges: true }), + + // normally called children in graph theory + // these nodes =edges=> outgoing nodes + outgoers: cache( defineDagOneHop({ outgoing: true }) , 'outgoers' ), + + // aka DAG descendants + successors: defineDagAllHops({ outgoing: true }), + + // normally called parents in graph theory + // these nodes <=edges= incoming nodes + incomers: cache( defineDagOneHop({ incoming: true }), 'incomers' ), + + // aka DAG ancestors + predecessors: defineDagAllHops({ incoming: true }) +} ); + + +// Neighbourhood functions +////////////////////////// + +util.extend( elesfn, { + neighborhood: cache(function( selector ){ + let elements = []; + let nodes = this.nodes(); + + for( let i = 0; i < nodes.length; i++ ){ // for all nodes + let node = nodes[ i ]; + let connectedEdges = node.connectedEdges(); + + // for each connected edge, add the edge and the other node + for( let j = 0; j < connectedEdges.length; j++ ){ + let edge = connectedEdges[ j ]; + let src = edge.source(); + let tgt = edge.target(); + let otherNode = node === src ? tgt : src; + + // need check in case of loop + if( otherNode.length > 0 ){ + elements.push( otherNode[0] ); // add node 1 hop away + } + + // add connected edge + elements.push( edge[0] ); + } + + } + + return ( this.spawn( elements, { unique: true } ) ).filter( selector ); + }, 'neighborhood'), + + closedNeighborhood: function( selector ){ + return this.neighborhood().add( this ).filter( selector ); + }, + + openNeighborhood: function( selector ){ + return this.neighborhood( selector ); + } +} ); + +// aliases +elesfn.neighbourhood = elesfn.neighborhood; +elesfn.closedNeighbourhood = elesfn.closedNeighborhood; +elesfn.openNeighbourhood = elesfn.openNeighborhood; + +// Edge functions +///////////////// + +util.extend( elesfn, { + source: cache(function sourceImpl( selector ){ + let ele = this[0]; + let src; + + if( ele ){ + src = ele._private.source || ele.cy().collection(); + } + + return src && selector ? src.filter( selector ) : src; + }, 'source'), + + target: cache(function targetImpl( selector ){ + let ele = this[0]; + let tgt; + + if( ele ){ + tgt = ele._private.target || ele.cy().collection(); + } + + return tgt && selector ? tgt.filter( selector ) : tgt; + }, 'target'), + + sources: defineSourceFunction( { + attr: 'source' + } ), + + targets: defineSourceFunction( { + attr: 'target' + } ) +} ); + +function defineSourceFunction( params ){ + return function sourceImpl( selector ){ + let sources = []; + + for( let i = 0; i < this.length; i++ ){ + let ele = this[ i ]; + let src = ele._private[ params.attr ]; + + if( src ){ + sources.push( src ); + } + } + + return this.spawn( sources, { unique: true } ).filter( selector ); + }; +} + +util.extend( elesfn, { + edgesWith: cache( defineEdgesWithFunction(), 'edgesWith' ), + + edgesTo: cache( defineEdgesWithFunction( { + thisIsSrc: true + } ), 'edgesTo' ) +} ); + +function defineEdgesWithFunction( params ){ + + return function edgesWithImpl( otherNodes ){ + let elements = []; + let cy = this._private.cy; + let p = params || {}; + + // get elements if a selector is specified + if( is.string( otherNodes ) ){ + otherNodes = cy.$( otherNodes ); + } + + for( let h = 0; h < otherNodes.length; h++ ){ + let edges = otherNodes[ h ]._private.edges; + + for( let i = 0; i < edges.length; i++ ){ + let edge = edges[ i ]; + let edgeData = edge._private.data; + let thisToOther = this.hasElementWithId( edgeData.source ) && otherNodes.hasElementWithId( edgeData.target ); + let otherToThis = otherNodes.hasElementWithId( edgeData.source ) && this.hasElementWithId( edgeData.target ); + let edgeConnectsThisAndOther = thisToOther || otherToThis; + + if( !edgeConnectsThisAndOther ){ continue; } + + if( p.thisIsSrc || p.thisIsTgt ){ + if( p.thisIsSrc && !thisToOther ){ continue; } + + if( p.thisIsTgt && !otherToThis ){ continue; } + } + + elements.push( edge ); + } + } + + return this.spawn( elements, { unique: true } ); + }; +} + +util.extend( elesfn, { + connectedEdges: cache(function( selector ){ + let retEles = []; + + let eles = this; + for( let i = 0; i < eles.length; i++ ){ + let node = eles[ i ]; + if( !node.isNode() ){ continue; } + + let edges = node._private.edges; + + for( let j = 0; j < edges.length; j++ ){ + let edge = edges[ j ]; + retEles.push( edge ); + } + } + + return this.spawn( retEles, { unique: true } ).filter( selector ); + }, 'connectedEdges'), + + connectedNodes: cache(function( selector ){ + let retEles = []; + + let eles = this; + for( let i = 0; i < eles.length; i++ ){ + let edge = eles[ i ]; + if( !edge.isEdge() ){ continue; } + + retEles.push( edge.source()[0] ); + retEles.push( edge.target()[0] ); + } + + return this.spawn( retEles, { unique: true } ).filter( selector ); + }, 'connectedNodes'), + + parallelEdges: cache( defineParallelEdgesFunction(), 'parallelEdges' ), + + codirectedEdges: cache( defineParallelEdgesFunction( { + codirected: true + } ), 'codirectedEdges' ) +} ); + +function defineParallelEdgesFunction( params ){ + let defaults = { + codirected: false + }; + params = util.extend( {}, defaults, params ); + + return function parallelEdgesImpl( selector ){ // micro-optimised for renderer + let elements = []; + let edges = this.edges(); + let p = params; + + // look at all the edges in the collection + for( let i = 0; i < edges.length; i++ ){ + let edge1 = edges[ i ]; + let edge1_p = edge1._private; + let src1 = edge1_p.source; + let srcid1 = src1._private.data.id; + let tgtid1 = edge1_p.data.target; + let srcEdges1 = src1._private.edges; + + // look at edges connected to the src node of this edge + for( let j = 0; j < srcEdges1.length; j++ ){ + let edge2 = srcEdges1[ j ]; + let edge2data = edge2._private.data; + let tgtid2 = edge2data.target; + let srcid2 = edge2data.source; + + let codirected = tgtid2 === tgtid1 && srcid2 === srcid1; + let oppdirected = srcid1 === tgtid2 && tgtid1 === srcid2; + + if( (p.codirected && codirected) || (!p.codirected && (codirected || oppdirected)) ){ + elements.push( edge2 ); + } + } + } + + return this.spawn( elements, { unique: true } ).filter( selector ); + }; + +} + +// Misc functions +///////////////// + +util.extend( elesfn, { + components: function(){ + let self = this; + let cy = self.cy(); + let visited = self.spawn(); + let unvisited = self.nodes().spawnSelf(); + let components = []; + + let visitInComponent = function( node, component ){ + visited.merge( node ); + unvisited.unmerge( node ); + component.merge( node ); + }; + + if( unvisited.empty() ){ return self.spawn(); } + + do { + let component = cy.collection(); + components.push( component ); + + let root = unvisited[0]; + visitInComponent( root, component ); + + self.bfs({ + directed: false, + roots: root, + visit: function( v, e, u, i, depth ){ + visitInComponent( v, component ); + } + } ); + + } while( unvisited.length > 0 ); + + return components.map(function( component ){ + let connectedEdges = component.connectedEdges().stdFilter(function( edge ){ + return component.anySame( edge.source() ) && component.anySame( edge.target() ); + }); + + return component.union( connectedEdges ); + }); + } +} ); + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/zsort.js b/node_modules/cytoscape/src/collection/zsort.js new file mode 100644 index 000000000..7676b4e80 --- /dev/null +++ b/node_modules/cytoscape/src/collection/zsort.js @@ -0,0 +1,57 @@ +/** + * Elements are drawn in a specific order based on compound depth (low to high), the element type (nodes above edges), + * and z-index (low to high). These styles affect how this applies: + * + * z-compound-depth: May be `bottom | orphan | auto | top`. The first drawn is `bottom`, then `orphan` which is the + * same depth as the root of the compound graph, followed by the default value `auto` which draws in order from + * root to leaves of the compound graph. The last drawn is `top`. + * z-index-compare: May be `auto | manual`. The default value is `auto` which always draws edges under nodes. + * `manual` ignores this convention and draws based on the `z-index` value setting. + * z-index: An integer value that affects the relative draw order of elements. In general, an element with a higher + * `z-index` will be drawn on top of an element with a lower `z-index`. + */ +let util = require('../util'); + +let zIndexSort = function( a, b ){ + let cy = a.cy(); + let hasCompoundNodes = cy.hasCompoundNodes(); + + function getDepth(ele){ + let style = ele.pstyle( 'z-compound-depth' ); + if ( style.value === 'auto' ){ + return hasCompoundNodes ? ele.zDepth() : 0; + } else if ( style.value === 'bottom' ){ + return -1; + } else if ( style.value === 'top' ){ + return util.MAX_INT; + } + // 'orphan' + return 0; + } + let depthDiff = getDepth(a) - getDepth(b); + if ( depthDiff !== 0 ){ + return depthDiff; + } + + function getEleDepth(ele){ + let style = ele.pstyle( 'z-index-compare' ); + if ( style.value === 'auto' ){ + return ele.isNode() ? 1 : 0; + } + // 'manual' + return 0; + } + let eleDiff = getEleDepth(a) - getEleDepth(b); + if ( eleDiff !== 0 ){ + return eleDiff; + } + + let zDiff = a.pstyle( 'z-index' ).value - b.pstyle( 'z-index' ).value; + if ( zDiff !== 0 ){ + return zDiff; + } + // compare indices in the core (order added to graph w/ last on top) + return a.poolIndex() - b.poolIndex(); +}; + +module.exports = zIndexSort; diff --git a/node_modules/cytoscape/src/core/add-remove.js b/node_modules/cytoscape/src/core/add-remove.js new file mode 100644 index 000000000..d8876f1d6 --- /dev/null +++ b/node_modules/cytoscape/src/core/add-remove.js @@ -0,0 +1,82 @@ +let is = require( '../is' ); +let util = require( '../util' ); +let Collection = require( '../collection' ); +let Element = require( '../collection/element' ); + +let corefn = { + add: function( opts ){ + + let elements; + let cy = this; + + // add the elements + if( is.elementOrCollection( opts ) ){ + let eles = opts; + + if( eles._private.cy === cy ){ // same instance => just restore + elements = eles.restore(); + + } else { // otherwise, copy from json + let jsons = []; + + for( let i = 0; i < eles.length; i++ ){ + let ele = eles[ i ]; + jsons.push( ele.json() ); + } + + elements = new Collection( cy, jsons ); + } + } + + // specify an array of options + else if( is.array( opts ) ){ + let jsons = opts; + + elements = new Collection( cy, jsons ); + } + + // specify via opts.nodes and opts.edges + else if( is.plainObject( opts ) && (is.array( opts.nodes ) || is.array( opts.edges )) ){ + let elesByGroup = opts; + let jsons = []; + + let grs = [ 'nodes', 'edges' ]; + for( let i = 0, il = grs.length; i < il; i++ ){ + let group = grs[ i ]; + let elesArray = elesByGroup[ group ]; + + if( is.array( elesArray ) ){ + + for( let j = 0, jl = elesArray.length; j < jl; j++ ){ + let json = util.extend( { group: group }, elesArray[ j ] ); + + jsons.push( json ); + } + } + } + + elements = new Collection( cy, jsons ); + } + + // specify options for one element + else { + let json = opts; + elements = (new Element( cy, json )).collection(); + } + + return elements; + }, + + remove: function( collection ){ + if( is.elementOrCollection( collection ) ){ + // already have right ref + } else if( is.string( collection ) ){ + let selector = collection; + collection = this.$( selector ); + } + + return collection.remove(); + } +}; + +module.exports = corefn; diff --git a/node_modules/cytoscape/src/core/animation/cubic-bezier.js b/node_modules/cytoscape/src/core/animation/cubic-bezier.js new file mode 100644 index 000000000..c733e5373 --- /dev/null +++ b/node_modules/cytoscape/src/core/animation/cubic-bezier.js @@ -0,0 +1,158 @@ +/* global Float32Array */ + +/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */ +function generateCubicBezier(mX1, mY1, mX2, mY2) { + let NEWTON_ITERATIONS = 4, + NEWTON_MIN_SLOPE = 0.001, + SUBDIVISION_PRECISION = 0.0000001, + SUBDIVISION_MAX_ITERATIONS = 10, + kSplineTableSize = 11, + kSampleStepSize = 1.0 / (kSplineTableSize - 1.0), + float32ArraySupported = typeof Float32Array !== 'undefined'; + + /* Must contain four arguments. */ + if (arguments.length !== 4) { + return false; + } + + /* Arguments must be numbers. */ + for (let i = 0; i < 4; ++i) { + if (typeof arguments[i] !== "number" || isNaN(arguments[i]) || !isFinite(arguments[i])) { + return false; + } + } + + /* X values must be in the [0, 1] range. */ + mX1 = Math.min(mX1, 1); + mX2 = Math.min(mX2, 1); + mX1 = Math.max(mX1, 0); + mX2 = Math.max(mX2, 0); + + let mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize); + + function A(aA1, aA2) { + return 1.0 - 3.0 * aA2 + 3.0 * aA1; + } + + function B(aA1, aA2) { + return 3.0 * aA2 - 6.0 * aA1; + } + + function C(aA1) { + return 3.0 * aA1; + } + + function calcBezier(aT, aA1, aA2) { + return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; + } + + function getSlope(aT, aA1, aA2) { + return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); + } + + function newtonRaphsonIterate(aX, aGuessT) { + for (let i = 0; i < NEWTON_ITERATIONS; ++i) { + let currentSlope = getSlope(aGuessT, mX1, mX2); + + if (currentSlope === 0.0) { + return aGuessT; + } + + let currentX = calcBezier(aGuessT, mX1, mX2) - aX; + aGuessT -= currentX / currentSlope; + } + + return aGuessT; + } + + function calcSampleValues() { + for (let i = 0; i < kSplineTableSize; ++i) { + mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2); + } + } + + function binarySubdivide(aX, aA, aB) { + let currentX, currentT, i = 0; + + do { + currentT = aA + (aB - aA) / 2.0; + currentX = calcBezier(currentT, mX1, mX2) - aX; + if (currentX > 0.0) { + aB = currentT; + } else { + aA = currentT; + } + } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS); + + return currentT; + } + + function getTForX(aX) { + let intervalStart = 0.0, + currentSample = 1, + lastSample = kSplineTableSize - 1; + + for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) { + intervalStart += kSampleStepSize; + } + + --currentSample; + + let dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]), + guessForT = intervalStart + dist * kSampleStepSize, + initialSlope = getSlope(guessForT, mX1, mX2); + + if (initialSlope >= NEWTON_MIN_SLOPE) { + return newtonRaphsonIterate(aX, guessForT); + } else if (initialSlope === 0.0) { + return guessForT; + } else { + return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize); + } + } + + let _precomputed = false; + + function precompute() { + _precomputed = true; + if (mX1 !== mY1 || mX2 !== mY2) { + calcSampleValues(); + } + } + + let f = function(aX) { + if (!_precomputed) { + precompute(); + } + if (mX1 === mY1 && mX2 === mY2) { + return aX; + } + if (aX === 0) { + return 0; + } + if (aX === 1) { + return 1; + } + + return calcBezier(getTForX(aX), mY1, mY2); + }; + + f.getControlPoints = function() { + return [{ + x: mX1, + y: mY1 + }, { + x: mX2, + y: mY2 + }]; + }; + + let str = "generateBezier(" + [mX1, mY1, mX2, mY2] + ")"; + f.toString = function() { + return str; + }; + + return f; +} + +module.exports = generateCubicBezier; diff --git a/node_modules/cytoscape/src/core/animation/ease.js b/node_modules/cytoscape/src/core/animation/ease.js new file mode 100644 index 000000000..ad731fc18 --- /dev/null +++ b/node_modules/cytoscape/src/core/animation/ease.js @@ -0,0 +1,78 @@ +let is = require('../../is'); + +function getEasedValue( type, start, end, percent, easingFn ){ + if( percent === 1 ){ + return end; + } + + let val = easingFn( start, end, percent ); + + if( type == null ){ + return val; + } + + if( type.roundValue || type.color ){ + val = Math.round( val ); + } + + if( type.min !== undefined ){ + val = Math.max( val, type.min ); + } + + if( type.max !== undefined ){ + val = Math.min( val, type.max ); + } + + return val; +} + +function getValue( prop, spec ){ + if( prop.pfValue != null || prop.value != null ){ + if( prop.pfValue != null && (spec == null || spec.type.units !== '%') ){ + return prop.pfValue; + } else { + return prop.value; + } + } else { + return prop; + } +} + +function ease( startProp, endProp, percent, easingFn, propSpec ){ + let type = propSpec != null ? propSpec.type : null; + + if( percent < 0 ){ + percent = 0; + } else if( percent > 1 ){ + percent = 1; + } + + let start = getValue( startProp, propSpec ); + let end = getValue( endProp, propSpec ); + + if( is.number( start ) && is.number( end ) ){ + return getEasedValue( type, start, end, percent, easingFn ); + + } else if( is.array( start ) && is.array( end ) ){ + let easedArr = []; + + for( let i = 0; i < end.length; i++ ){ + let si = start[ i ]; + let ei = end[ i ]; + + if( si != null && ei != null ){ + let val = getEasedValue( type, si, ei, percent, easingFn ); + + easedArr.push( val ); + } else { + easedArr.push( ei ); + } + } + + return easedArr; + } + + return undefined; +} + +module.exports = ease; diff --git a/node_modules/cytoscape/src/core/animation/easings.js b/node_modules/cytoscape/src/core/animation/easings.js new file mode 100644 index 000000000..1a7156b16 --- /dev/null +++ b/node_modules/cytoscape/src/core/animation/easings.js @@ -0,0 +1,76 @@ +let generateCubicBezier = require('./cubic-bezier'); +let generateSpringRK4 = require('./spring'); + +let cubicBezier = function( t1, p1, t2, p2 ){ + let bezier = generateCubicBezier( t1, p1, t2, p2 ); + + return function( start, end, percent ){ + return start + ( end - start ) * bezier( percent ); + }; +}; + +let easings = { + 'linear': function( start, end, percent ){ + return start + (end - start) * percent; + }, + + // default easings + 'ease': cubicBezier( 0.25, 0.1, 0.25, 1 ), + 'ease-in': cubicBezier( 0.42, 0, 1, 1 ), + 'ease-out': cubicBezier( 0, 0, 0.58, 1 ), + 'ease-in-out': cubicBezier( 0.42, 0, 0.58, 1 ), + + // sine + 'ease-in-sine': cubicBezier( 0.47, 0, 0.745, 0.715 ), + 'ease-out-sine': cubicBezier( 0.39, 0.575, 0.565, 1 ), + 'ease-in-out-sine': cubicBezier( 0.445, 0.05, 0.55, 0.95 ), + + // quad + 'ease-in-quad': cubicBezier( 0.55, 0.085, 0.68, 0.53 ), + 'ease-out-quad': cubicBezier( 0.25, 0.46, 0.45, 0.94 ), + 'ease-in-out-quad': cubicBezier( 0.455, 0.03, 0.515, 0.955 ), + + // cubic + 'ease-in-cubic': cubicBezier( 0.55, 0.055, 0.675, 0.19 ), + 'ease-out-cubic': cubicBezier( 0.215, 0.61, 0.355, 1 ), + 'ease-in-out-cubic': cubicBezier( 0.645, 0.045, 0.355, 1 ), + + // quart + 'ease-in-quart': cubicBezier( 0.895, 0.03, 0.685, 0.22 ), + 'ease-out-quart': cubicBezier( 0.165, 0.84, 0.44, 1 ), + 'ease-in-out-quart': cubicBezier( 0.77, 0, 0.175, 1 ), + + // quint + 'ease-in-quint': cubicBezier( 0.755, 0.05, 0.855, 0.06 ), + 'ease-out-quint': cubicBezier( 0.23, 1, 0.32, 1 ), + 'ease-in-out-quint': cubicBezier( 0.86, 0, 0.07, 1 ), + + // expo + 'ease-in-expo': cubicBezier( 0.95, 0.05, 0.795, 0.035 ), + 'ease-out-expo': cubicBezier( 0.19, 1, 0.22, 1 ), + 'ease-in-out-expo': cubicBezier( 1, 0, 0, 1 ), + + // circ + 'ease-in-circ': cubicBezier( 0.6, 0.04, 0.98, 0.335 ), + 'ease-out-circ': cubicBezier( 0.075, 0.82, 0.165, 1 ), + 'ease-in-out-circ': cubicBezier( 0.785, 0.135, 0.15, 0.86 ), + + + // user param easings... + + 'spring': function( tension, friction, duration ){ + if( duration === 0 ){ // can't get a spring w/ duration 0 + return easings.linear; // duration 0 => jump to end so impl doesn't matter + } + + let spring = generateSpringRK4( tension, friction, duration ); + + return function( start, end, percent ){ + return start + (end - start) * spring( percent ); + }; + }, + + 'cubic-bezier': cubicBezier +}; + +module.exports = easings; diff --git a/node_modules/cytoscape/src/core/animation/index.js b/node_modules/cytoscape/src/core/animation/index.js new file mode 100644 index 000000000..4035ff58a --- /dev/null +++ b/node_modules/cytoscape/src/core/animation/index.js @@ -0,0 +1,60 @@ +let define = require('../../define'); +let util = require('../../util'); +let stepAll = require('./step-all'); + +let corefn = ({ + + // pull in animation functions + animate: define.animate(), + animation: define.animation(), + animated: define.animated(), + clearQueue: define.clearQueue(), + delay: define.delay(), + delayAnimation: define.delayAnimation(), + stop: define.stop(), + + addToAnimationPool: function( eles ){ + let cy = this; + + if( !cy.styleEnabled() ){ return; } // save cycles when no style used + + cy._private.aniEles.merge( eles ); + }, + + stopAnimationLoop: function(){ + this._private.animationsRunning = false; + }, + + startAnimationLoop: function(){ + let cy = this; + + cy._private.animationsRunning = true; + + if( !cy.styleEnabled() ){ return; } // save cycles when no style used + + // NB the animation loop will exec in headless environments if style enabled + // and explicit cy.destroy() is necessary to stop the loop + + function headlessStep(){ + if( !cy._private.animationsRunning ){ return; } + + util.requestAnimationFrame( function animationStep( now ){ + stepAll( now, cy ); + headlessStep(); + } ); + } + + let renderer = cy.renderer(); + + if( renderer && renderer.beforeRender ){ // let the renderer schedule animations + renderer.beforeRender( function rendererAnimationStep( willDraw, now ){ + stepAll( now, cy ); + }, renderer.beforeRenderPriorities.animations ); + } else { // manage the animation loop ourselves + headlessStep(); // first call + } + } + +}); + +module.exports = corefn; diff --git a/node_modules/cytoscape/src/core/animation/spring.js b/node_modules/cytoscape/src/core/animation/spring.js new file mode 100644 index 000000000..04fcc8268 --- /dev/null +++ b/node_modules/cytoscape/src/core/animation/spring.js @@ -0,0 +1,88 @@ +/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */ +/* Given a tension, friction, and duration, a simulation at 60FPS will first run without a defined duration in order to calculate the full path. A second pass + then adjusts the time delta -- using the relation between actual time and duration -- to calculate the path for the duration-constrained animation. */ +let generateSpringRK4 = (function(){ + function springAccelerationForState( state ){ + return (-state.tension * state.x) - (state.friction * state.v); + } + + function springEvaluateStateWithDerivative( initialState, dt, derivative ){ + let state = { + x: initialState.x + derivative.dx * dt, + v: initialState.v + derivative.dv * dt, + tension: initialState.tension, + friction: initialState.friction + }; + + return { dx: state.v, dv: springAccelerationForState( state ) }; + } + + function springIntegrateState( state, dt ){ + let a = { + dx: state.v, + dv: springAccelerationForState( state ) + }, + b = springEvaluateStateWithDerivative( state, dt * 0.5, a ), + c = springEvaluateStateWithDerivative( state, dt * 0.5, b ), + d = springEvaluateStateWithDerivative( state, dt, c ), + dxdt = 1.0 / 6.0 * (a.dx + 2.0 * (b.dx + c.dx) + d.dx), + dvdt = 1.0 / 6.0 * (a.dv + 2.0 * (b.dv + c.dv) + d.dv); + + state.x = state.x + dxdt * dt; + state.v = state.v + dvdt * dt; + + return state; + } + + return function springRK4Factory( tension, friction, duration ){ + + let initState = { + x: -1, + v: 0, + tension: null, + friction: null + }, + path = [0], + time_lapsed = 0, + tolerance = 1 / 10000, + DT = 16 / 1000, + have_duration, dt, last_state; + + tension = parseFloat( tension ) || 500; + friction = parseFloat( friction ) || 20; + duration = duration || null; + + initState.tension = tension; + initState.friction = friction; + + have_duration = duration !== null; + + /* Calculate the actual time it takes for this animation to complete with the provided conditions. */ + if( have_duration ){ + /* Run the simulation without a duration. */ + time_lapsed = springRK4Factory( tension, friction ); + /* Compute the adjusted time delta. */ + dt = time_lapsed / duration * DT; + } else { + dt = DT; + } + + for(;;){ + /* Next/step function .*/ + last_state = springIntegrateState( last_state || initState, dt ); + /* Store the position. */ + path.push( 1 + last_state.x ); + time_lapsed += 16; + /* If the change threshold is reached, break. */ + if( !(Math.abs( last_state.x ) > tolerance && Math.abs( last_state.v ) > tolerance) ){ + break; + } + } + + /* If duration is not defined, return the actual time required for completing this animation. Otherwise, return a closure that holds the + computed path and returns a snapshot of the position according to a given percentComplete. */ + return !have_duration ? time_lapsed : function( percentComplete ){ return path[ (percentComplete * (path.length - 1)) | 0 ]; }; + }; +}()); + +module.exports = generateSpringRK4; diff --git a/node_modules/cytoscape/src/core/animation/start.js b/node_modules/cytoscape/src/core/animation/start.js new file mode 100644 index 000000000..69689c66e --- /dev/null +++ b/node_modules/cytoscape/src/core/animation/start.js @@ -0,0 +1,34 @@ +function startAnimation( self, ani, now, isCore ){ + let isEles = !isCore; + let ele = self; + let ani_p = ani._private; + let cy = isCore ? self : self.cy(); + let style = cy.style(); + + if( isEles ){ + let pos = ele.position(); + + ani_p.startPosition = ani_p.startPosition || { + x: pos.x, + y: pos.y + }; + + ani_p.startStyle = ani_p.startStyle || style.getAnimationStartStyle( ele, ani_p.style ); + } + + if( isCore ){ + let pan = cy._private.pan; + + ani_p.startPan = ani_p.startPan || { + x: pan.x, + y: pan.y + }; + + ani_p.startZoom = ani_p.startZoom != null ? ani_p.startZoom : cy._private.zoom; + } + + ani_p.started = true; + ani_p.startTime = now - ani_p.progress * ani_p.duration; +} + +module.exports = startAnimation; diff --git a/node_modules/cytoscape/src/core/animation/step-all.js b/node_modules/cytoscape/src/core/animation/step-all.js new file mode 100644 index 000000000..543de7ced --- /dev/null +++ b/node_modules/cytoscape/src/core/animation/step-all.js @@ -0,0 +1,133 @@ +let step = require('./step'); +let startAnimation = require('./start'); + +function stepAll( now, cy ){ + let eles = cy._private.aniEles; + let doneEles = []; + + function stepOne( ele, isCore ){ + let _p = ele._private; + let current = _p.animation.current; + let queue = _p.animation.queue; + let ranAnis = false; + + // cancel all animations on display:none ele + if( !isCore && ele.pstyle('display').value === 'none' ){ + // put all current and queue animations in this tick's current list + // and empty the lists for the element + current = current.splice( 0, current.length ).concat( queue.splice( 0, queue.length ) ); + + // stop all animations + for( let i = 0; i < current.length; i++ ){ current[i].stop(); } + } + + // if nothing currently animating, get something from the queue + if( current.length === 0 ){ + let next = queue.shift(); + + if( next ){ + current.push( next ); + } + } + + let callbacks = function( callbacks ){ + for( let j = callbacks.length - 1; j >= 0; j-- ){ + let cb = callbacks[ j ]; + + cb(); + } + + callbacks.splice( 0, callbacks.length ); + }; + + // step and remove if done + for( let i = current.length - 1; i >= 0; i-- ){ + let ani = current[ i ]; + let ani_p = ani._private; + + if( ani_p.stopped ){ + current.splice( i, 1 ); + + ani_p.hooked = false; + ani_p.playing = false; + ani_p.started = false; + + callbacks( ani_p.frames ); + + continue; + } + + if( !ani_p.playing && !ani_p.applying ){ continue; } + + // an apply() while playing shouldn't do anything + if( ani_p.playing && ani_p.applying ){ + ani_p.applying = false; + } + + if( !ani_p.started ){ + startAnimation( ele, ani, now, isCore ); + } + + step( ele, ani, now, isCore ); + + if( ani_p.applying ){ + ani_p.applying = false; + } + + callbacks( ani_p.frames ); + + if( ani.completed() ){ + current.splice( i, 1 ); + + ani_p.hooked = false; + ani_p.playing = false; + ani_p.started = false; + + callbacks( ani_p.completes ); + } + + ranAnis = true; + } + + if( !isCore && current.length === 0 && queue.length === 0 ){ + doneEles.push( ele ); + } + + return ranAnis; + } // stepElement + + // handle all eles + let ranEleAni = false; + for( let e = 0; e < eles.length; e++ ){ + let ele = eles[ e ]; + let handledThisEle = stepOne( ele ); + + ranEleAni = ranEleAni || handledThisEle; + } // each element + + let ranCoreAni = stepOne( cy, true ); + + // notify renderer + if( ranEleAni || ranCoreAni ){ + if( eles.length > 0 ){ + eles.dirtyCompoundBoundsCache(); + + cy.notify({ + type: 'draw', + eles: eles + }); + } else { + cy.notify({ + type: 'draw' + }); + } + } + + // remove elements from list of currently animating if its queues are empty + eles.unmerge( doneEles ); + + cy.emit('step'); + +} // stepAll + +module.exports = stepAll; diff --git a/node_modules/cytoscape/src/core/animation/step.js b/node_modules/cytoscape/src/core/animation/step.js new file mode 100644 index 000000000..fbe8cfc27 --- /dev/null +++ b/node_modules/cytoscape/src/core/animation/step.js @@ -0,0 +1,161 @@ +let easings = require('./easings'); +let ease = require('./ease'); +let is = require('../../is'); + +function step( self, ani, now, isCore ){ + let isEles = !isCore; + let _p = self._private; + let ani_p = ani._private; + let pEasing = ani_p.easing; + let startTime = ani_p.startTime; + let cy = isCore ? self : self.cy(); + let style = cy.style(); + + if( !ani_p.easingImpl ){ + + if( pEasing == null ){ // use default + ani_p.easingImpl = easings[ 'linear' ]; + + } else { // then define w/ name + let easingVals; + + if( is.string( pEasing ) ){ + let easingProp = style.parse( 'transition-timing-function', pEasing ); + + easingVals = easingProp.value; + + } else { // then assume preparsed array + easingVals = pEasing; + } + + let name, args; + + if( is.string( easingVals ) ){ + name = easingVals; + args = []; + } else { + name = easingVals[1]; + args = easingVals.slice( 2 ).map( function( n ){ return +n; } ); + } + + if( args.length > 0 ){ // create with args + if( name === 'spring' ){ + args.push( ani_p.duration ); // need duration to generate spring + } + + ani_p.easingImpl = easings[ name ].apply( null, args ); + } else { // static impl by name + ani_p.easingImpl = easings[ name ]; + } + } + + } + + let easing = ani_p.easingImpl; + let percent; + + if( ani_p.duration === 0 ){ + percent = 1; + } else { + percent = (now - startTime) / ani_p.duration; + } + + if( ani_p.applying ){ + percent = ani_p.progress; + } + + if( percent < 0 ){ + percent = 0; + } else if( percent > 1 ){ + percent = 1; + } + + if( ani_p.delay == null ){ // then update + + let startPos = ani_p.startPosition; + let endPos = ani_p.position; + + if( endPos && isEles && !self.locked() ){ + let pos = self.position(); + + if( valid( startPos.x, endPos.x ) ){ + pos.x = ease( startPos.x, endPos.x, percent, easing ); + } + + if( valid( startPos.y, endPos.y ) ){ + pos.y = ease( startPos.y, endPos.y, percent, easing ); + } + + self.emit('position'); + } + + let startPan = ani_p.startPan; + let endPan = ani_p.pan; + let pan = _p.pan; + let animatingPan = endPan != null && isCore; + if( animatingPan ){ + if( valid( startPan.x, endPan.x ) ){ + pan.x = ease( startPan.x, endPan.x, percent, easing ); + } + + if( valid( startPan.y, endPan.y ) ){ + pan.y = ease( startPan.y, endPan.y, percent, easing ); + } + + self.emit( 'pan' ); + } + + let startZoom = ani_p.startZoom; + let endZoom = ani_p.zoom; + let animatingZoom = endZoom != null && isCore; + if( animatingZoom ){ + if( valid( startZoom, endZoom ) ){ + _p.zoom = ease( startZoom, endZoom, percent, easing ); + } + + self.emit( 'zoom' ); + } + + if( animatingPan || animatingZoom ){ + self.emit( 'viewport' ); + } + + let props = ani_p.style; + if( props && props.length > 0 && isEles ){ + for( let i = 0; i < props.length; i++ ){ + let prop = props[ i ]; + let name = prop.name; + let end = prop; + let start = ani_p.startStyle[ name ]; + let propSpec = style.properties[ start.name ]; + let easedVal = ease( start, end, percent, easing, propSpec ); + + style.overrideBypass( self, name, easedVal ); + } // for props + + self.emit('style'); + + } // if + + } + + ani_p.progress = percent; + + return percent; +} + +function valid( start, end ){ + if( start == null || end == null ){ + return false; + } + + if( is.number( start ) && is.number( end ) ){ + return true; + } else if( (start) && (end) ){ + return true; + } + + return false; +} + +module.exports = step; diff --git a/node_modules/cytoscape/src/core/events.js b/node_modules/cytoscape/src/core/events.js new file mode 100644 index 000000000..6d941665e --- /dev/null +++ b/node_modules/cytoscape/src/core/events.js @@ -0,0 +1,93 @@ +let Emitter = require('../emitter'); +let define = require('../define'); +let is = require('../is'); +let util = require('../util'); +let Selector = require('../selector'); + +let emitterOptions = { + qualifierCompare: function( selector1, selector2 ){ + if( selector1 == null || selector2 == null ){ + return selector1 == null && selector2 == null; + } else { + return selector1.sameText( selector2 ); + } + }, + eventMatches: function( cy, listener, eventObj ){ + let selector = listener.qualifier; + + if( selector != null ){ + return cy !== eventObj.target && is.element( eventObj.target ) && selector.matches( eventObj.target ); + } + + return true; + }, + eventFields: function( cy ){ + return { + cy: cy, + target: cy + }; + }, + callbackContext: function( cy, listener, eventObj ){ + return listener.qualifier != null ? eventObj.target : cy; + } +}; + +let argSelector = function( arg ){ + if( is.string(arg) ){ + return new Selector( arg ); + } else { + return arg; + } +}; + +let elesfn = ({ + createEmitter: function(){ + let _p = this._private; + + if( !_p.emitter ){ + _p.emitter = new Emitter( util.assign( { + context: this + }, emitterOptions ) ); + } + + return this; + }, + + emitter: function(){ + return this._private.emitter; + }, + + on: function( events, selector, callback ){ + this.emitter().on( events, argSelector(selector), callback ); + + return this; + }, + + removeListener: function( events, selector, callback ){ + this.emitter().removeListener( events, argSelector(selector), callback ); + + return this; + }, + + one: function( events, selector, callback ){ + this.emitter().one( events, argSelector(selector), callback ); + + return this; + }, + + once: function( events, selector, callback ){ + this.emitter().one( events, argSelector(selector), callback ); + + return this; + }, + + emit: function( events, extraParams ){ + this.emitter().emit( events, extraParams ); + + return this; + } +}); + +define.eventAliasesOn( elesfn ); + +module.exports = elesfn; diff --git a/node_modules/cytoscape/src/core/export.js b/node_modules/cytoscape/src/core/export.js new file mode 100644 index 000000000..5d1156ded --- /dev/null +++ b/node_modules/cytoscape/src/core/export.js @@ -0,0 +1,23 @@ +let corefn = ({ + + png: function( options ){ + let renderer = this._private.renderer; + options = options || {}; + + return renderer.png( options ); + }, + + jpg: function( options ){ + let renderer = this._private.renderer; + options = options || {}; + + options.bg = options.bg || '#fff'; + + return renderer.jpg( options ); + } + +}); + +corefn.jpeg = corefn.jpg; + +module.exports = corefn; diff --git a/node_modules/cytoscape/src/core/index.js b/node_modules/cytoscape/src/core/index.js new file mode 100644 index 000000000..7b5f19b2e --- /dev/null +++ b/node_modules/cytoscape/src/core/index.js @@ -0,0 +1,446 @@ +let window = require( '../window' ); +let util = require( '../util' ); +let Collection = require( '../collection' ); +let is = require( '../is' ); +let Promise = require( '../promise' ); +let define = require( '../define' ); + +let Core = function( opts ){ + let cy = this; + + opts = util.extend( {}, opts ); + + let container = opts.container; + + // allow for passing a wrapped jquery object + // e.g. cytoscape({ container: $('#cy') }) + if( container && !is.htmlElement( container ) && is.htmlElement( container[0] ) ){ + container = container[0]; + } + + let reg = container ? container._cyreg : null; // e.g. already registered some info (e.g. readies) via jquery + reg = reg || {}; + + if( reg && reg.cy ){ + reg.cy.destroy(); + + reg = {}; // old instance => replace reg completely + } + + let readies = reg.readies = reg.readies || []; + + if( container ){ container._cyreg = reg; } // make sure container assoc'd reg points to this cy + reg.cy = cy; + + let head = window !== undefined && container !== undefined && !opts.headless; + let options = opts; + options.layout = util.extend( { name: head ? 'grid' : 'null' }, options.layout ); + options.renderer = util.extend( { name: head ? 'canvas' : 'null' }, options.renderer ); + + let defVal = function( def, val, altVal ){ + if( val !== undefined ){ + return val; + } else if( altVal !== undefined ){ + return altVal; + } else { + return def; + } + }; + + let _p = this._private = { + container: container, // html dom ele container + ready: false, // whether ready has been triggered + options: options, // cached options + elements: new Collection( this ), // elements in the graph + listeners: [], // list of listeners + aniEles: new Collection( this ), // elements being animated + scratch: {}, // scratch object for core + layout: null, + renderer: null, + destroyed: false, // whether destroy was called + notificationsEnabled: true, // whether notifications are sent to the renderer + minZoom: 1e-50, + maxZoom: 1e50, + zoomingEnabled: defVal( true, options.zoomingEnabled ), + userZoomingEnabled: defVal( true, options.userZoomingEnabled ), + panningEnabled: defVal( true, options.panningEnabled ), + userPanningEnabled: defVal( true, options.userPanningEnabled ), + boxSelectionEnabled: defVal( true, options.boxSelectionEnabled ), + autolock: defVal( false, options.autolock, options.autolockNodes ), + autoungrabify: defVal( false, options.autoungrabify, options.autoungrabifyNodes ), + autounselectify: defVal( false, options.autounselectify ), + styleEnabled: options.styleEnabled === undefined ? head : options.styleEnabled, + zoom: is.number( options.zoom ) ? options.zoom : 1, + pan: { + x: is.plainObject( options.pan ) && is.number( options.pan.x ) ? options.pan.x : 0, + y: is.plainObject( options.pan ) && is.number( options.pan.y ) ? options.pan.y : 0 + }, + animation: { // object for currently-running animations + current: [], + queue: [] + }, + hasCompoundNodes: false + }; + + this.createEmitter(); + + // set selection type + let selType = options.selectionType; + if( selType === undefined || (selType !== 'additive' && selType !== 'single') ){ + // then set default + + _p.selectionType = 'single'; + } else { + _p.selectionType = selType; + } + + // init zoom bounds + if( is.number( options.minZoom ) && is.number( options.maxZoom ) && options.minZoom < options.maxZoom ){ + _p.minZoom = options.minZoom; + _p.maxZoom = options.maxZoom; + } else if( is.number( options.minZoom ) && options.maxZoom === undefined ){ + _p.minZoom = options.minZoom; + } else if( is.number( options.maxZoom ) && options.minZoom === undefined ){ + _p.maxZoom = options.maxZoom; + } + + let loadExtData = function( extData, next ){ + let anyIsPromise = extData.some( is.promise ); + + if( anyIsPromise ){ + return Promise.all( extData ).then( next ); // load all data asynchronously, then exec rest of init + } else { + next( extData ); // exec synchronously for convenience + } + }; + + // start with the default stylesheet so we have something before loading an external stylesheet + if( _p.styleEnabled ){ + cy.setStyle([]); + } + + // create the renderer + cy.initRenderer( util.extend( { + hideEdgesOnViewport: options.hideEdgesOnViewport, + textureOnViewport: options.textureOnViewport, + wheelSensitivity: is.number( options.wheelSensitivity ) && options.wheelSensitivity > 0 ? options.wheelSensitivity : 1, + motionBlur: options.motionBlur === undefined ? false : options.motionBlur, // off by default + motionBlurOpacity: options.motionBlurOpacity === undefined ? 0.05 : options.motionBlurOpacity, + pixelRatio: is.number( options.pixelRatio ) && options.pixelRatio > 0 ? options.pixelRatio : undefined, + desktopTapThreshold: options.desktopTapThreshold === undefined ? 4 : options.desktopTapThreshold, + touchTapThreshold: options.touchTapThreshold === undefined ? 8 : options.touchTapThreshold + }, options.renderer ) ); + + let setElesAndLayout = function( elements, onload, ondone ){ + cy.notifications( false ); + + // remove old elements + let oldEles = cy.mutableElements(); + if( oldEles.length > 0 ){ + oldEles.remove(); + } + + if( elements != null ){ + if( is.plainObject( elements ) || is.array( elements ) ){ + cy.add( elements ); + } + } + + cy.one( 'layoutready', function( e ){ + cy.notifications( true ); + cy.emit( e ); // we missed this event by turning notifications off, so pass it on + + cy.notify( { + type: 'load', + eles: cy.mutableElements() + } ); + + cy.one( 'load', onload ); + cy.emit( 'load' ); + } ).one( 'layoutstop', function(){ + cy.one( 'done', ondone ); + cy.emit( 'done' ); + } ); + + let layoutOpts = util.extend( {}, cy._private.options.layout ); + layoutOpts.eles = cy.elements(); + + cy.layout( layoutOpts ).run(); + }; + + loadExtData([ options.style, options.elements ], function( thens ){ + let initStyle = thens[0]; + let initEles = thens[1]; + + // init style + if( _p.styleEnabled ){ + cy.style().append( initStyle ); + } + + // initial load + setElesAndLayout( initEles, function(){ // onready + cy.startAnimationLoop(); + _p.ready = true; + + // if a ready callback is specified as an option, the bind it + if( is.fn( options.ready ) ){ + cy.on( 'ready', options.ready ); + } + + // bind all the ready handlers registered before creating this instance + for( let i = 0; i < readies.length; i++ ){ + let fn = readies[ i ]; + cy.on( 'ready', fn ); + } + if( reg ){ reg.readies = []; } // clear b/c we've bound them all and don't want to keep it around in case a new core uses the same div etc + + cy.emit( 'ready' ); + }, options.done ); + + } ); +}; + +let corefn = Core.prototype; // short alias + +util.extend( corefn, { + instanceString: function(){ + return 'core'; + }, + + isReady: function(){ + return this._private.ready; + }, + + isDestroyed: function(){ + return this._private.destroyed; + }, + + ready: function( fn ){ + if( this.isReady() ){ + this.emitter().emit( 'ready', [], fn ); // just calls fn as though triggered via ready event + } else { + this.on( 'ready', fn ); + } + + return this; + }, + + destroy: function(){ + let cy = this; + if( cy.isDestroyed() ) return; + + cy.stopAnimationLoop(); + + cy.destroyRenderer(); + + this.emit( 'destroy' ); + + cy._private.destroyed = true; + + return cy; + }, + + hasElementWithId: function( id ){ + return this._private.elements.hasElementWithId( id ); + }, + + getElementById: function( id ){ + return this._private.elements.getElementById( id ); + }, + + selectionType: function(){ + return this._private.selectionType; + }, + + hasCompoundNodes: function(){ + return this._private.hasCompoundNodes; + }, + + headless: function(){ + return this._private.options.renderer.name === 'null'; + }, + + styleEnabled: function(){ + return this._private.styleEnabled; + }, + + addToPool: function( eles ){ + this._private.elements.merge( eles ); + + return this; // chaining + }, + + removeFromPool: function( eles ){ + this._private.elements.unmerge( eles ); + + return this; + }, + + container: function(){ + return this._private.container; + }, + + options: function(){ + return util.copy( this._private.options ); + }, + + json: function( obj ){ + let cy = this; + let _p = cy._private; + let eles = cy.mutableElements(); + + if( is.plainObject( obj ) ){ // set + + cy.startBatch(); + + if( obj.elements ){ + let idInJson = {}; + + let updateEles = function( jsons, gr ){ + for( let i = 0; i < jsons.length; i++ ){ + let json = jsons[ i ]; + let id = json.data.id; + let ele = cy.getElementById( id ); + + idInJson[ id ] = true; + + if( ele.length !== 0 ){ // existing element should be updated + ele.json( json ); + } else { // otherwise should be added + if( gr ){ + cy.add( util.extend( { group: gr }, json ) ); + } else { + cy.add( json ); + } + } + } + }; + + if( is.array( obj.elements ) ){ // elements: [] + updateEles( obj.elements ); + + } else { // elements: { nodes: [], edges: [] } + let grs = [ 'nodes', 'edges' ]; + for( let i = 0; i < grs.length; i++ ){ + let gr = grs[ i ]; + let elements = obj.elements[ gr ]; + + if( is.array( elements ) ){ + updateEles( elements, gr ); + } + } + } + + // elements not specified in json should be removed + eles.stdFilter( function( ele ){ + return !idInJson[ ele.id() ]; + } ).remove(); + } + + if( obj.style ){ + cy.style( obj.style ); + } + + if( obj.zoom != null && obj.zoom !== _p.zoom ){ + cy.zoom( obj.zoom ); + } + + if( obj.pan ){ + if( obj.pan.x !== _p.pan.x || obj.pan.y !== _p.pan.y ){ + cy.pan( obj.pan ); + } + } + + let fields = [ + 'minZoom', 'maxZoom', 'zoomingEnabled', 'userZoomingEnabled', + 'panningEnabled', 'userPanningEnabled', + 'boxSelectionEnabled', + 'autolock', 'autoungrabify', 'autounselectify' + ]; + + for( let i = 0; i < fields.length; i++ ){ + let f = fields[ i ]; + + if( obj[ f ] != null ){ + cy[ f ]( obj[ f ] ); + } + } + + cy.endBatch(); + + return this; // chaining + } else if( obj === undefined ){ // get + let json = {}; + + json.elements = {}; + eles.forEach( function( ele ){ + let group = ele.group(); + + if( !json.elements[ group ] ){ + json.elements[ group ] = []; + } + + json.elements[ group ].push( ele.json() ); + } ); + + if( this._private.styleEnabled ){ + json.style = cy.style().json(); + } + + json.zoomingEnabled = cy._private.zoomingEnabled; + json.userZoomingEnabled = cy._private.userZoomingEnabled; + json.zoom = cy._private.zoom; + json.minZoom = cy._private.minZoom; + json.maxZoom = cy._private.maxZoom; + json.panningEnabled = cy._private.panningEnabled; + json.userPanningEnabled = cy._private.userPanningEnabled; + json.pan = util.copy( cy._private.pan ); + json.boxSelectionEnabled = cy._private.boxSelectionEnabled; + json.renderer = util.copy( cy._private.options.renderer ); + json.hideEdgesOnViewport = cy._private.options.hideEdgesOnViewport; + json.textureOnViewport = cy._private.options.textureOnViewport; + json.wheelSensitivity = cy._private.options.wheelSensitivity; + json.motionBlur = cy._private.options.motionBlur; + + return json; + } + }, + + scratch: define.data( { + field: 'scratch', + bindingEvent: 'scratch', + allowBinding: true, + allowSetting: true, + settingEvent: 'scratch', + settingTriggersEvent: true, + triggerFnName: 'trigger', + allowGetting: true + } ), + + removeScratch: define.removeData( { + field: 'scratch', + event: 'scratch', + triggerFnName: 'trigger', + triggerEvent: true + } ) + +} ); + +corefn.$id = corefn.getElementById; + +[ + require( './add-remove' ), + require( './animation' ), + require( './events' ), + require( './export' ), + require( './layout' ), + require( './notification' ), + require( './renderer' ), + require( './search' ), + require( './style' ), + require( './viewport' ) +].forEach( function( props ){ + util.extend( corefn, props ); +} ); + +module.exports = Core; diff --git a/node_modules/cytoscape/src/core/layout.js b/node_modules/cytoscape/src/core/layout.js new file mode 100644 index 000000000..49cd9103a --- /dev/null +++ b/node_modules/cytoscape/src/core/layout.js @@ -0,0 +1,46 @@ +let util = require( '../util' ); +let is = require( '../is' ); + +let corefn = ({ + + layout: function( options ){ + let cy = this; + + if( options == null ){ + util.error( 'Layout options must be specified to make a layout' ); + return; + } + + if( options.name == null ){ + util.error( 'A `name` must be specified to make a layout' ); + return; + } + + let name = options.name; + let Layout = cy.extension( 'layout', name ); + + if( Layout == null ){ + util.error( 'Can not apply layout: No such layout `' + name + '` found; did you include its JS file?' ); + return; + } + + let eles; + if( is.string( options.eles ) ){ + eles = cy.$( options.eles ); + } else { + eles = options.eles != null ? options.eles : cy.$(); + } + + let layout = new Layout( util.extend( {}, options, { + cy: cy, + eles: eles + } ) ); + + return layout; + } + +}); + +corefn.createLayout = corefn.makeLayout = corefn.layout; + +module.exports = corefn; diff --git a/node_modules/cytoscape/src/core/notification.js b/node_modules/cytoscape/src/core/notification.js new file mode 100644 index 000000000..112d05460 --- /dev/null +++ b/node_modules/cytoscape/src/core/notification.js @@ -0,0 +1,118 @@ +let corefn = ({ + notify: function( params ){ + let _p = this._private; + + if( _p.batchingNotify ){ + let bEles = _p.batchNotifyEles; + let bTypes = _p.batchNotifyTypes; + + if( params.eles ){ + bEles.merge( params.eles ); + } + + if( !bTypes.ids[ params.type ] ){ + bTypes.push( params.type ); + bTypes.ids[ params.type ] = true; + } + + return; // notifications are disabled during batching + } + + if( !_p.notificationsEnabled ){ return; } // exit on disabled + + let renderer = this.renderer(); + + // exit if destroy() called on core or renderer in between frames #1499 #1528 + if( this.isDestroyed() || !renderer ){ return; } + + renderer.notify( params ); + }, + + notifications: function( bool ){ + let p = this._private; + + if( bool === undefined ){ + return p.notificationsEnabled; + } else { + p.notificationsEnabled = bool ? true : false; + } + }, + + noNotifications: function( callback ){ + this.notifications( false ); + callback(); + this.notifications( true ); + }, + + batching: function(){ + return this._private.batchCount > 0; + }, + + startBatch: function(){ + let _p = this._private; + + if( _p.batchCount == null ){ + _p.batchCount = 0; + } + + if( _p.batchCount === 0 ){ + _p.batchingStyle = _p.batchingNotify = true; + _p.batchStyleEles = this.collection(); + _p.batchNotifyEles = this.collection(); + _p.batchNotifyTypes = []; + _p.batchNotifyTypes.ids = {}; + } + + _p.batchCount++; + + return this; + }, + + endBatch: function(){ + let _p = this._private; + + _p.batchCount--; + + if( _p.batchCount === 0 ){ + // update style for dirty eles + _p.batchingStyle = false; + _p.batchStyleEles.updateStyle(); + + // notify the renderer of queued eles and event types + _p.batchingNotify = false; + this.notify( { + type: _p.batchNotifyTypes, + eles: _p.batchNotifyEles + } ); + } + + return this; + }, + + batch: function( callback ){ + this.startBatch(); + callback(); + this.endBatch(); + + return this; + }, + + // for backwards compatibility + batchData: function( map ){ + let cy = this; + + return this.batch( function(){ + let ids = Object.keys( map ); + + for( let i = 0; i < ids.length; i++ ){ + let id = ids[i]; + let data = map[ id ]; + let ele = cy.getElementById( id ); + + ele.data( data ); + } + } ); + } +}); + +module.exports = corefn; diff --git a/node_modules/cytoscape/src/core/renderer.js b/node_modules/cytoscape/src/core/renderer.js new file mode 100644 index 000000000..7d9c40966 --- /dev/null +++ b/node_modules/cytoscape/src/core/renderer.js @@ -0,0 +1,79 @@ +let util = require( '../util' ); + +let corefn = ({ + + renderTo: function( context, zoom, pan, pxRatio ){ + let r = this._private.renderer; + + r.renderTo( context, zoom, pan, pxRatio ); + return this; + }, + + renderer: function(){ + return this._private.renderer; + }, + + forceRender: function(){ + this.notify( { + type: 'draw' + } ); + + return this; + }, + + resize: function(){ + this.invalidateSize(); + + this.notify( { + type: 'resize' + } ); + + this.emit( 'resize' ); + + return this; + }, + + initRenderer: function( options ){ + let cy = this; + + let RendererProto = cy.extension( 'renderer', options.name ); + if( RendererProto == null ){ + util.error( 'Can not initialise: No such renderer `%s` found; did you include its JS file?', options.name ); + return; + } + + cy._private.renderer = new RendererProto( util.extend( {}, options, { cy } ) ); + + this.notify({ type: 'init' }); + }, + + destroyRenderer: function(){ + let cy = this; + + cy.notify( { type: 'destroy' } ); // destroy the renderer + + let domEle = cy.container(); + if( domEle ){ + domEle._cyreg = null; + + while( domEle.childNodes.length > 0 ){ + domEle.removeChild( domEle.childNodes[0] ); + } + } + + cy._private.renderer = null; // to be extra safe, remove the ref + }, + + onRender: function( fn ){ + return this.on('render', fn); + }, + + offRender: function( fn ){ + return this.off('render', fn); + } + +}); + +corefn.invalidateDimensions = corefn.resize; + +module.exports = corefn; diff --git a/node_modules/cytoscape/src/core/search.js b/node_modules/cytoscape/src/core/search.js new file mode 100644 index 000000000..9839ab949 --- /dev/null +++ b/node_modules/cytoscape/src/core/search.js @@ -0,0 +1,69 @@ +let is = require( '../is' ); +let Collection = require( '../collection' ); + +let corefn = ({ + + // get a collection + // - empty collection on no args + // - collection of elements in the graph on selector arg + // - guarantee a returned collection when elements or collection specified + collection: function( eles, opts ){ + + if( is.string( eles ) ){ + return this.$( eles ); + + } else if( is.elementOrCollection( eles ) ){ + return eles.collection(); + + } else if( is.array( eles ) ){ + return new Collection( this, eles, opts ); + } + + return new Collection( this ); + }, + + nodes: function( selector ){ + let nodes = this.$( function( ele ){ + return ele.isNode(); + } ); + + if( selector ){ + return nodes.filter( selector ); + } + + return nodes; + }, + + edges: function( selector ){ + let edges = this.$( function( ele ){ + return ele.isEdge(); + } ); + + if( selector ){ + return edges.filter( selector ); + } + + return edges; + }, + + // search the graph like jQuery + $: function( selector ){ + let eles = this._private.elements; + + if( selector ){ + return eles.filter( selector ); + } else { + return eles.spawnSelf(); + } + }, + + mutableElements: function(){ + return this._private.elements; + } + +}); + +// aliases +corefn.elements = corefn.filter = corefn.$; + +module.exports = corefn; diff --git a/node_modules/cytoscape/src/core/style.js b/node_modules/cytoscape/src/core/style.js new file mode 100644 index 000000000..679093edb --- /dev/null +++ b/node_modules/cytoscape/src/core/style.js @@ -0,0 +1,36 @@ +let is = require( '../is' ); +let Style = require( '../style' ); + +let corefn = ({ + + style: function( newStyle ){ + if( newStyle ){ + let s = this.setStyle( newStyle ); + + s.update(); + } + + return this._private.style; + }, + + setStyle: function( style ){ + let _p = this._private; + + if( is.stylesheet( style ) ){ + _p.style = style.generateStyle( this ); + + } else if( is.array( style ) ){ + _p.style = Style.fromJson( this, style ); + + } else if( is.string( style ) ){ + _p.style = Style.fromString( this, style ); + + } else { + _p.style = Style( this ); + } + + return _p.style; + } +}); + +module.exports = corefn; diff --git a/node_modules/cytoscape/src/core/viewport.js b/node_modules/cytoscape/src/core/viewport.js new file mode 100644 index 000000000..67789ef55 --- /dev/null +++ b/node_modules/cytoscape/src/core/viewport.js @@ -0,0 +1,573 @@ +let is = require('../is'); +let window = require('../window'); +let math = require('../math'); + +let corefn = ({ + + autolock: function( bool ){ + if( bool !== undefined ){ + this._private.autolock = bool ? true : false; + } else { + return this._private.autolock; + } + + return this; // chaining + }, + + autoungrabify: function( bool ){ + if( bool !== undefined ){ + this._private.autoungrabify = bool ? true : false; + } else { + return this._private.autoungrabify; + } + + return this; // chaining + }, + + autounselectify: function( bool ){ + if( bool !== undefined ){ + this._private.autounselectify = bool ? true : false; + } else { + return this._private.autounselectify; + } + + return this; // chaining + }, + + panningEnabled: function( bool ){ + if( bool !== undefined ){ + this._private.panningEnabled = bool ? true : false; + } else { + return this._private.panningEnabled; + } + + return this; // chaining + }, + + userPanningEnabled: function( bool ){ + if( bool !== undefined ){ + this._private.userPanningEnabled = bool ? true : false; + } else { + return this._private.userPanningEnabled; + } + + return this; // chaining + }, + + zoomingEnabled: function( bool ){ + if( bool !== undefined ){ + this._private.zoomingEnabled = bool ? true : false; + } else { + return this._private.zoomingEnabled; + } + + return this; // chaining + }, + + userZoomingEnabled: function( bool ){ + if( bool !== undefined ){ + this._private.userZoomingEnabled = bool ? true : false; + } else { + return this._private.userZoomingEnabled; + } + + return this; // chaining + }, + + boxSelectionEnabled: function( bool ){ + if( bool !== undefined ){ + this._private.boxSelectionEnabled = bool ? true : false; + } else { + return this._private.boxSelectionEnabled; + } + + return this; // chaining + }, + + pan: function(){ + let args = arguments; + let pan = this._private.pan; + let dim, val, dims, x, y; + + switch( args.length ){ + case 0: // .pan() + return pan; + + case 1: + + if( is.string( args[0] ) ){ // .pan('x') + dim = args[0]; + return pan[ dim ]; + + } else if( is.plainObject( args[0] ) ){ // .pan({ x: 0, y: 100 }) + if( !this._private.panningEnabled ){ + return this; + } + + dims = args[0]; + x = dims.x; + y = dims.y; + + if( is.number( x ) ){ + pan.x = x; + } + + if( is.number( y ) ){ + pan.y = y; + } + + this.emit( 'pan viewport' ); + } + break; + + case 2: // .pan('x', 100) + if( !this._private.panningEnabled ){ + return this; + } + + dim = args[0]; + val = args[1]; + + if( (dim === 'x' || dim === 'y') && is.number( val ) ){ + pan[ dim ] = val; + } + + this.emit( 'pan viewport' ); + break; + + default: + break; // invalid + } + + this.notify( { // notify the renderer that the viewport changed + type: 'viewport' + } ); + + return this; // chaining + }, + + panBy: function( arg0, arg1 ){ + let args = arguments; + let pan = this._private.pan; + let dim, val, dims, x, y; + + if( !this._private.panningEnabled ){ + return this; + } + + switch( args.length ){ + case 1: + + if( is.plainObject( arg0 ) ){ // .panBy({ x: 0, y: 100 }) + dims = args[0]; + x = dims.x; + y = dims.y; + + if( is.number( x ) ){ + pan.x += x; + } + + if( is.number( y ) ){ + pan.y += y; + } + + this.emit( 'pan viewport' ); + } + break; + + case 2: // .panBy('x', 100) + dim = arg0; + val = arg1; + + if( (dim === 'x' || dim === 'y') && is.number( val ) ){ + pan[ dim ] += val; + } + + this.emit( 'pan viewport' ); + break; + + default: + break; // invalid + } + + this.notify( { // notify the renderer that the viewport changed + type: 'viewport' + } ); + + return this; // chaining + }, + + fit: function( elements, padding ){ + let viewportState = this.getFitViewport( elements, padding ); + + if( viewportState ){ + let _p = this._private; + _p.zoom = viewportState.zoom; + _p.pan = viewportState.pan; + + this.emit( 'pan zoom viewport' ); + + this.notify( { // notify the renderer that the viewport changed + type: 'viewport' + } ); + } + + return this; // chaining + }, + + getFitViewport: function( elements, padding ){ + if( is.number( elements ) && padding === undefined ){ // elements is optional + padding = elements; + elements = undefined; + } + + if( !this._private.panningEnabled || !this._private.zoomingEnabled ){ + return; + } + + let bb; + + if( is.string( elements ) ){ + let sel = elements; + elements = this.$( sel ); + + } else if( is.boundingBox( elements ) ){ // assume bb + let bbe = elements; + bb = { + x1: bbe.x1, + y1: bbe.y1, + x2: bbe.x2, + y2: bbe.y2 + }; + + bb.w = bb.x2 - bb.x1; + bb.h = bb.y2 - bb.y1; + + } else if( !is.elementOrCollection( elements ) ){ + elements = this.mutableElements(); + } + + if( is.elementOrCollection( elements ) && elements.empty() ){ return; } // can't fit to nothing + + bb = bb || elements.boundingBox(); + + let w = this.width(); + let h = this.height(); + let zoom; + padding = is.number( padding ) ? padding : 0; + + if( !isNaN( w ) && !isNaN( h ) && w > 0 && h > 0 && !isNaN( bb.w ) && !isNaN( bb.h ) && bb.w > 0 && bb.h > 0 ){ + zoom = Math.min( (w - 2 * padding) / bb.w, (h - 2 * padding) / bb.h ); + + // crop zoom + zoom = zoom > this._private.maxZoom ? this._private.maxZoom : zoom; + zoom = zoom < this._private.minZoom ? this._private.minZoom : zoom; + + let pan = { // now pan to middle + x: (w - zoom * ( bb.x1 + bb.x2 )) / 2, + y: (h - zoom * ( bb.y1 + bb.y2 )) / 2 + }; + + return { + zoom: zoom, + pan: pan + }; + } + + return; + }, + + minZoom: function( zoom ){ + if( zoom === undefined ){ + return this._private.minZoom; + } else if( is.number( zoom ) ){ + this._private.minZoom = zoom; + } + + return this; + }, + + maxZoom: function( zoom ){ + if( zoom === undefined ){ + return this._private.maxZoom; + } else if( is.number( zoom ) ){ + this._private.maxZoom = zoom; + } + + return this; + }, + + getZoomedViewport: function( params ){ + let _p = this._private; + let currentPan = _p.pan; + let currentZoom = _p.zoom; + let pos; // in rendered px + let zoom; + let bail = false; + + if( !_p.zoomingEnabled ){ // zooming disabled + bail = true; + } + + if( is.number( params ) ){ // then set the zoom + zoom = params; + + } else if( is.plainObject( params ) ){ // then zoom about a point + zoom = params.level; + + if( params.position != null ){ + pos = math.modelToRenderedPosition( params.position, currentZoom, currentPan ); + } else if( params.renderedPosition != null ){ + pos = params.renderedPosition; + } + + if( pos != null && !_p.panningEnabled ){ // panning disabled + bail = true; + } + } + + // crop zoom + zoom = zoom > _p.maxZoom ? _p.maxZoom : zoom; + zoom = zoom < _p.minZoom ? _p.minZoom : zoom; + + // can't zoom with invalid params + if( bail || !is.number( zoom ) || zoom === currentZoom || ( pos != null && (!is.number( pos.x ) || !is.number( pos.y )) ) ){ + return null; + } + + if( pos != null ){ // set zoom about position + let pan1 = currentPan; + let zoom1 = currentZoom; + let zoom2 = zoom; + + let pan2 = { + x: -zoom2 / zoom1 * (pos.x - pan1.x) + pos.x, + y: -zoom2 / zoom1 * (pos.y - pan1.y) + pos.y + }; + + return { + zoomed: true, + panned: true, + zoom: zoom2, + pan: pan2 + }; + + } else { // just set the zoom + return { + zoomed: true, + panned: false, + zoom: zoom, + pan: currentPan + }; + } + }, + + zoom: function( params ){ + if( params === undefined ){ // get + return this._private.zoom; + } else { // set + let vp = this.getZoomedViewport( params ); + let _p = this._private; + + if( vp == null || !vp.zoomed ){ return this; } + + _p.zoom = vp.zoom; + + if( vp.panned ){ + _p.pan.x = vp.pan.x; + _p.pan.y = vp.pan.y; + } + + this.emit( 'zoom' + ( vp.panned ? ' pan' : '' ) + ' viewport' ); + + this.notify( { // notify the renderer that the viewport changed + type: 'viewport' + } ); + + return this; // chaining + } + }, + + viewport: function( opts ){ + let _p = this._private; + let zoomDefd = true; + let panDefd = true; + let events = []; // to trigger + let zoomFailed = false; + let panFailed = false; + + if( !opts ){ return this; } + if( !is.number( opts.zoom ) ){ zoomDefd = false; } + if( !is.plainObject( opts.pan ) ){ panDefd = false; } + if( !zoomDefd && !panDefd ){ return this; } + + if( zoomDefd ){ + let z = opts.zoom; + + if( z < _p.minZoom || z > _p.maxZoom || !_p.zoomingEnabled ){ + zoomFailed = true; + + } else { + _p.zoom = z; + + events.push( 'zoom' ); + } + } + + if( panDefd && (!zoomFailed || !opts.cancelOnFailedZoom) && _p.panningEnabled ){ + let p = opts.pan; + + if( is.number( p.x ) ){ + _p.pan.x = p.x; + panFailed = false; + } + + if( is.number( p.y ) ){ + _p.pan.y = p.y; + panFailed = false; + } + + if( !panFailed ){ + events.push( 'pan' ); + } + } + + if( events.length > 0 ){ + events.push( 'viewport' ); + this.emit( events.join( ' ' ) ); + + this.notify( { + type: 'viewport' + } ); + } + + return this; // chaining + }, + + center: function( elements ){ + let pan = this.getCenterPan( elements ); + + if( pan ){ + this._private.pan = pan; + + this.emit( 'pan viewport' ); + + this.notify( { // notify the renderer that the viewport changed + type: 'viewport' + } ); + } + + return this; // chaining + }, + + getCenterPan: function( elements, zoom ){ + if( !this._private.panningEnabled ){ + return; + } + + if( is.string( elements ) ){ + let selector = elements; + elements = this.mutableElements().filter( selector ); + } else if( !is.elementOrCollection( elements ) ){ + elements = this.mutableElements(); + } + + if( elements.length === 0 ){ return; } // can't centre pan to nothing + + let bb = elements.boundingBox(); + let w = this.width(); + let h = this.height(); + zoom = zoom === undefined ? this._private.zoom : zoom; + + let pan = { // middle + x: (w - zoom * ( bb.x1 + bb.x2 )) / 2, + y: (h - zoom * ( bb.y1 + bb.y2 )) / 2 + }; + + return pan; + }, + + reset: function(){ + if( !this._private.panningEnabled || !this._private.zoomingEnabled ){ + return this; + } + + this.viewport( { + pan: { x: 0, y: 0 }, + zoom: 1 + } ); + + return this; // chaining + }, + + invalidateSize: function(){ + this._private.sizeCache = null; + }, + + size: function(){ + let _p = this._private; + let container = _p.container; + + return ( _p.sizeCache = _p.sizeCache || ( container ? (function(){ + let style = window.getComputedStyle( container ); + let val = function( name ){ return parseFloat( style.getPropertyValue( name ) ); }; + + return { + width: container.clientWidth - val('padding-left') - val('padding-right'), + height: container.clientHeight - val('padding-top') - val('padding-bottom') + }; + })() : { // fallback if no container (not 0 b/c can be used for dividing etc) + width: 1, + height: 1 + } ) ); + }, + + width: function(){ + return this.size().width; + }, + + height: function(){ + return this.size().height; + }, + + extent: function(){ + let pan = this._private.pan; + let zoom = this._private.zoom; + let rb = this.renderedExtent(); + + let b = { + x1: ( rb.x1 - pan.x ) / zoom, + x2: ( rb.x2 - pan.x ) / zoom, + y1: ( rb.y1 - pan.y ) / zoom, + y2: ( rb.y2 - pan.y ) / zoom + }; + + b.w = b.x2 - b.x1; + b.h = b.y2 - b.y1; + + return b; + }, + + renderedExtent: function(){ + let width = this.width(); + let height = this.height(); + + return { + x1: 0, + y1: 0, + x2: width, + y2: height, + w: width, + h: height + }; + } +}); + +// aliases +corefn.centre = corefn.center; + +// backwards compatibility +corefn.autolockNodes = corefn.autolock; +corefn.autoungrabifyNodes = corefn.autoungrabify; + +module.exports = corefn; diff --git a/node_modules/cytoscape/src/define/animation.js b/node_modules/cytoscape/src/define/animation.js new file mode 100644 index 000000000..13c47d440 --- /dev/null +++ b/node_modules/cytoscape/src/define/animation.js @@ -0,0 +1,240 @@ +let util = require( '../util' ); +let Animation = require( '../animation' ); +let math = require('../math'); +let is = require('../is'); + +let define = { + + animated: function(){ + return function animatedImpl(){ + let self = this; + let selfIsArrayLike = self.length !== undefined; + let all = selfIsArrayLike ? self : [ self ]; // put in array if not array-like + let cy = this._private.cy || this; + + if( !cy.styleEnabled() ){ return false; } + + let ele = all[0]; + + if( ele ){ + return ele._private.animation.current.length > 0; + } + }; + }, // animated + + clearQueue: function(){ + return function clearQueueImpl(){ + let self = this; + let selfIsArrayLike = self.length !== undefined; + let all = selfIsArrayLike ? self : [ self ]; // put in array if not array-like + let cy = this._private.cy || this; + + if( !cy.styleEnabled() ){ return this; } + + for( let i = 0; i < all.length; i++ ){ + let ele = all[ i ]; + ele._private.animation.queue = []; + } + + return this; + }; + }, // clearQueue + + delay: function(){ + return function delayImpl( time, complete ){ + let cy = this._private.cy || this; + + if( !cy.styleEnabled() ){ return this; } + + return this.animate( { + delay: time, + duration: time, + complete: complete + } ); + }; + }, // delay + + delayAnimation: function(){ + return function delayAnimationImpl( time, complete ){ + let cy = this._private.cy || this; + + if( !cy.styleEnabled() ){ return this; } + + return this.animation( { + delay: time, + duration: time, + complete: complete + } ); + }; + }, // delay + + animation: function(){ + return function animationImpl( properties, params ){ + let self = this; + let selfIsArrayLike = self.length !== undefined; + let all = selfIsArrayLike ? self : [ self ]; // put in array if not array-like + let cy = this._private.cy || this; + let isCore = !selfIsArrayLike; + let isEles = !isCore; + + if( !cy.styleEnabled() ){ return this; } + + let style = cy.style(); + + properties = util.assign( {}, properties, params ); + + let propertiesEmpty = Object.keys( properties ).length === 0; + + if( propertiesEmpty ){ + return new Animation( all[0], properties ); // nothing to animate + } + + if( properties.duration === undefined ){ + properties.duration = 400; + } + + switch( properties.duration ){ + case 'slow': + properties.duration = 600; + break; + case 'fast': + properties.duration = 200; + break; + } + + if( isEles ){ + properties.style = style.getPropsList( properties.style || properties.css ); + + properties.css = undefined; + } + + if( isEles && properties.renderedPosition != null ){ + let rpos = properties.renderedPosition; + let pan = cy.pan(); + let zoom = cy.zoom(); + + properties.position = math.renderedToModelPosition( rpos, zoom, pan ); + } + + // override pan w/ panBy if set + if( isCore && properties.panBy != null ){ + let panBy = properties.panBy; + let cyPan = cy.pan(); + + properties.pan = { + x: cyPan.x + panBy.x, + y: cyPan.y + panBy.y + }; + } + + // override pan w/ center if set + let center = properties.center || properties.centre; + if( isCore && center != null ){ + let centerPan = cy.getCenterPan( center.eles, properties.zoom ); + + if( centerPan != null ){ + properties.pan = centerPan; + } + } + + // override pan & zoom w/ fit if set + if( isCore && properties.fit != null ){ + let fit = properties.fit; + let fitVp = cy.getFitViewport( fit.eles || fit.boundingBox, fit.padding ); + + if( fitVp != null ){ + properties.pan = fitVp.pan; + properties.zoom = fitVp.zoom; + } + } + + // override zoom (& potentially pan) w/ zoom obj if set + if( isCore && is.plainObject( properties.zoom ) ){ + let vp = cy.getZoomedViewport( properties.zoom ); + + if( vp != null ){ + if( vp.zoomed ){ properties.zoom = vp.zoom; } + + if( vp.panned ){ properties.pan = vp.pan; } + } + } + + return new Animation( all[0], properties ); + }; + }, // animate + + animate: function(){ + return function animateImpl( properties, params ){ + let self = this; + let selfIsArrayLike = self.length !== undefined; + let all = selfIsArrayLike ? self : [ self ]; // put in array if not array-like + let cy = this._private.cy || this; + + if( !cy.styleEnabled() ){ return this; } + + if( params ){ + properties = util.extend( {}, properties, params ); + } + + // manually hook and run the animation + for( let i = 0; i < all.length; i++ ){ + let ele = all[ i ]; + let queue = ele.animated() && (properties.queue === undefined || properties.queue); + + let ani = ele.animation( properties, (queue ? { queue: true } : undefined) ); + + ani.play(); + } + + return this; // chaining + }; + }, // animate + + stop: function(){ + return function stopImpl( clearQueue, jumpToEnd ){ + let self = this; + let selfIsArrayLike = self.length !== undefined; + let all = selfIsArrayLike ? self : [ self ]; // put in array if not array-like + let cy = this._private.cy || this; + + if( !cy.styleEnabled() ){ return this; } + + for( let i = 0; i < all.length; i++ ){ + let ele = all[ i ]; + let _p = ele._private; + let anis = _p.animation.current; + + for( let j = 0; j < anis.length; j++ ){ + let ani = anis[ j ]; + let ani_p = ani._private; + + if( jumpToEnd ){ + // next iteration of the animation loop, the animation + // will go straight to the end and be removed + ani_p.duration = 0; + } + } + + // clear the queue of future animations + if( clearQueue ){ + _p.animation.queue = []; + } + + if( !jumpToEnd ){ + _p.animation.current = []; + } + } + + // we have to notify (the animation loop doesn't do it for us on `stop`) + cy.notify( { + eles: this, + type: 'draw' + } ); + + return this; + }; + } // stop + +}; // define + +module.exports = define; diff --git a/node_modules/cytoscape/src/define/data.js b/node_modules/cytoscape/src/define/data.js new file mode 100644 index 000000000..bbdc4b0c1 --- /dev/null +++ b/node_modules/cytoscape/src/define/data.js @@ -0,0 +1,194 @@ +let util = require( '../util' ); +let is = require( '../is' ); + +let define = { + + // access data field + data: function( params ){ + let defaults = { + field: 'data', + bindingEvent: 'data', + allowBinding: false, + allowSetting: false, + allowGetting: false, + settingEvent: 'data', + settingTriggersEvent: false, + triggerFnName: 'trigger', + immutableKeys: {}, // key => true if immutable + updateStyle: false, + beforeGet: function( self ){}, + beforeSet: function( self, obj ){}, + onSet: function( self ){}, + canSet: function( self ){ return true; } + }; + params = util.extend( {}, defaults, params ); + + return function dataImpl( name, value ){ + let p = params; + let self = this; + let selfIsArrayLike = self.length !== undefined; + let all = selfIsArrayLike ? self : [ self ]; // put in array if not array-like + let single = selfIsArrayLike ? self[0] : self; + + // .data('foo', ...) + if( is.string( name ) ){ // set or get property + + // .data('foo') + if( p.allowGetting && value === undefined ){ // get + + let ret; + if( single ){ + p.beforeGet( single ); + + ret = single._private[ p.field ][ name ]; + } + return ret; + + // .data('foo', 'bar') + } else if( p.allowSetting && value !== undefined ){ // set + let valid = !p.immutableKeys[ name ]; + if( valid ){ + let change = { [name]: value }; + + p.beforeSet( self, change ); + + for( let i = 0, l = all.length; i < l; i++ ){ + let ele = all[i]; + + if( p.canSet( ele ) ){ + ele._private[ p.field ][ name ] = value; + } + } + + // update mappers if asked + if( p.updateStyle ){ self.updateStyle(); } + + // call onSet callback + p.onSet( self ); + + if( p.settingTriggersEvent ){ + self[ p.triggerFnName ]( p.settingEvent ); + } + } + } + + // .data({ 'foo': 'bar' }) + } else if( p.allowSetting && is.plainObject( name ) ){ // extend + let obj = name; + let k, v; + let keys = Object.keys( obj ); + + p.beforeSet( self, obj ); + + for( let i = 0; i < keys.length; i++ ){ + k = keys[ i ]; + v = obj[ k ]; + + let valid = !p.immutableKeys[ k ]; + if( valid ){ + for( let j = 0; j < all.length; j++ ){ + let ele = all[j]; + + if( p.canSet( ele ) ){ + ele._private[ p.field ][ k ] = v; + } + } + } + } + + // update mappers if asked + if( p.updateStyle ){ self.updateStyle(); } + + // call onSet callback + p.onSet( self ); + + if( p.settingTriggersEvent ){ + self[ p.triggerFnName ]( p.settingEvent ); + } + + // .data(function(){ ... }) + } else if( p.allowBinding && is.fn( name ) ){ // bind to event + let fn = name; + self.on( p.bindingEvent, fn ); + + // .data() + } else if( p.allowGetting && name === undefined ){ // get whole object + let ret; + if( single ){ + p.beforeGet( single ); + + ret = single._private[ p.field ]; + } + return ret; + } + + return self; // maintain chainability + }; // function + }, // data + + // remove data field + removeData: function( params ){ + let defaults = { + field: 'data', + event: 'data', + triggerFnName: 'trigger', + triggerEvent: false, + immutableKeys: {} // key => true if immutable + }; + params = util.extend( {}, defaults, params ); + + return function removeDataImpl( names ){ + let p = params; + let self = this; + let selfIsArrayLike = self.length !== undefined; + let all = selfIsArrayLike ? self : [ self ]; // put in array if not array-like + + // .removeData('foo bar') + if( is.string( names ) ){ // then get the list of keys, and delete them + let keys = names.split( /\s+/ ); + let l = keys.length; + + for( let i = 0; i < l; i++ ){ // delete each non-empty key + let key = keys[ i ]; + if( is.emptyString( key ) ){ continue; } + + let valid = !p.immutableKeys[ key ]; // not valid if immutable + if( valid ){ + for( let i_a = 0, l_a = all.length; i_a < l_a; i_a++ ){ + all[ i_a ]._private[ p.field ][ key ] = undefined; + } + } + } + + if( p.triggerEvent ){ + self[ p.triggerFnName ]( p.event ); + } + + // .removeData() + } else if( names === undefined ){ // then delete all keys + + for( let i_a = 0, l_a = all.length; i_a < l_a; i_a++ ){ + let _privateFields = all[ i_a ]._private[ p.field ]; + let keys = Object.keys( _privateFields ); + + for( let i = 0; i < keys.length; i++ ){ + let key = keys[i]; + let validKeyToDelete = !p.immutableKeys[ key ]; + + if( validKeyToDelete ){ + _privateFields[ key ] = undefined; + } + } + } + + if( p.triggerEvent ){ + self[ p.triggerFnName ]( p.event ); + } + } + + return self; // maintain chaining + }; // function + }, // removeData +}; // define + +module.exports = define; diff --git a/node_modules/cytoscape/src/define/events.js b/node_modules/cytoscape/src/define/events.js new file mode 100644 index 000000000..4d96b84f0 --- /dev/null +++ b/node_modules/cytoscape/src/define/events.js @@ -0,0 +1,34 @@ +let Promise = require( '../promise' ); + +let define = { + + eventAliasesOn: function( proto ){ + let p = proto; + + p.addListener = p.listen = p.bind = p.on; + p.unlisten = p.unbind = p.off = p.removeListener; + p.trigger = p.emit; + + // this is just a wrapper alias of .on() + p.pon = p.promiseOn = function( events, selector ){ + let self = this; + let args = Array.prototype.slice.call( arguments, 0 ); + + return new Promise( function( resolve, reject ){ + let callback = function( e ){ + self.off.apply( self, offArgs ); + + resolve( e ); + }; + + let onArgs = args.concat( [ callback ] ); + let offArgs = onArgs.concat( [] ); + + self.on.apply( self, onArgs ); + } ); + }; + }, + +}; // define + +module.exports = define; diff --git a/node_modules/cytoscape/src/define/index.js b/node_modules/cytoscape/src/define/index.js new file mode 100644 index 000000000..24404a225 --- /dev/null +++ b/node_modules/cytoscape/src/define/index.js @@ -0,0 +1,19 @@ +// use this module to cherry pick functions into your prototype +// (useful for functions shared between the core and collections, for example) + +// e.g. +// let foo = define.foo({ /* params... */ }) + +let util = require('../util'); + +let define = {}; + +[ + require('./animation'), + require('./data'), + require('./events') +].forEach(function( m ){ + util.assign( define, m ); +}); + +module.exports = define; diff --git a/node_modules/cytoscape/src/emitter.js b/node_modules/cytoscape/src/emitter.js new file mode 100644 index 000000000..8ee108269 --- /dev/null +++ b/node_modules/cytoscape/src/emitter.js @@ -0,0 +1,226 @@ +const util = require('./util'); +const is = require('./is'); +const Event = require('./event'); + +const eventRegex = /^([^.]+)(\.(?:[^.]+))?$/; // regex for matching event strings (e.g. "click.namespace") +const universalNamespace = '.*'; // matches as if no namespace specified and prevents users from unbinding accidentally + +const defaults = { + qualifierCompare: function( q1, q2 ){ + return q1 === q2; + }, + eventMatches: function( /*context, listener, eventObj*/ ){ + return true; + }, + eventFields: function( /*context*/ ){ + return {}; + }, + callbackContext: function( context/*, listener, eventObj*/ ){ + return context; + }, + beforeEmit: function(/* context, listener, eventObj */){ + }, + afterEmit: function(/* context, listener, eventObj */){ + }, + bubble: function( /*context*/ ){ + return false; + }, + parent: function( /*context*/ ){ + return null; + }, + context: this +}; + +function Emitter( opts ){ + util.assign( this, defaults, opts ); + + this.listeners = []; + this.emitting = 0; +} + +let p = Emitter.prototype; + +let forEachEvent = function( self, handler, events, qualifier, callback, conf, confOverrides ){ + if( is.fn( qualifier ) ){ + callback = qualifier; + qualifier = null; + } + + if( confOverrides ){ + if( conf == null ){ + conf = confOverrides; + } else { + conf = util.assign( {}, conf, confOverrides ); + } + } + + let eventList = events.split(/\s+/); + + for( let i = 0; i < eventList.length; i++ ){ + let evt = eventList[i]; + + if( is.emptyString( evt ) ){ continue; } + + let match = evt.match( eventRegex ); // type[.namespace] + + if( match ){ + let type = match[1]; + let namespace = match[2] ? match[2] : null; + let ret = handler( self, evt, type, namespace, qualifier, callback, conf ); + + if( ret === false ){ break; } // allow exiting early + } + } +}; + +let makeEventObj = function( self, obj ){ + return new Event( obj.type, util.assign( obj, self.eventFields( self.context ) ) ); +}; + +let forEachEventObj = function( self, handler, events ){ + if( is.event( events ) ){ + handler( self, events ); + + return; + } else if( is.plainObject( events ) ){ + handler( self, makeEventObj( self, events ) ); + + return; + } + + let eventList = events.split(/\s+/); + + for( let i = 0; i < eventList.length; i++ ){ + let evt = eventList[i]; + + if( is.emptyString( evt ) ){ continue; } + + let match = evt.match( eventRegex ); // type[.namespace] + + if( match ){ + let type = match[1]; + let namespace = match[2] ? match[2] : null; + let eventObj = makeEventObj( self, { + type: type, + namespace: namespace, + target: self.context + } ); + + handler( self, eventObj ); + } + } +}; + +p.on = p.addListener = function( events, qualifier, callback, conf, confOverrides ){ + forEachEvent( this, function( self, event, type, namespace, qualifier, callback, conf ){ + if( is.fn( callback ) ){ + self.listeners.push( { + event: event, // full event string + callback: callback, // callback to run + type: type, // the event type (e.g. 'click') + namespace: namespace, // the event namespace (e.g. ".foo") + qualifier: qualifier, // a restriction on whether to match this emitter + conf: conf // additional configuration + } ); + } + }, events, qualifier, callback, conf, confOverrides ); + + return this; +}; + +p.one = function( events, qualifier, callback, conf ){ + return this.on( events, qualifier, callback, conf, { one: true } ); +}; + +p.removeListener = p.off = function( events, qualifier, callback, conf ){ + if( this.emitting !== 0 ){ + this.listeners = util.copyArray( this.listeners ); + } + + let listeners = this.listeners; + + for( let i = listeners.length - 1; i >= 0; i-- ){ + let listener = listeners[i]; + + forEachEvent( this, function( self, event, type, namespace, qualifier, callback/*, conf*/ ){ + if( + ( listener.type === type ) && + ( !namespace || listener.namespace === namespace ) && + ( !qualifier || self.qualifierCompare( listener.qualifier, qualifier ) ) && + ( !callback || listener.callback === callback ) + ){ + listeners.splice( i, 1 ); + + return false; + } + }, events, qualifier, callback, conf ); + } + + return this; +}; + +p.emit = p.trigger = function( events, extraParams, manualCallback ){ + let listeners = this.listeners; + let numListenersBeforeEmit = listeners.length; + + this.emitting++; + + if( !is.array( extraParams ) ){ + extraParams = [ extraParams ]; + } + + forEachEventObj( this, function( self, eventObj ){ + if( manualCallback != null ){ + listeners = [{ + event: eventObj.event, + type: eventObj.type, + namespace: eventObj.namespace, + callback: manualCallback + }]; + + numListenersBeforeEmit = listeners.length; + } + + for( let i = 0; i < numListenersBeforeEmit; i++ ){ + let listener = listeners[i]; + + if( + ( listener.type === eventObj.type ) && + ( !listener.namespace || listener.namespace === eventObj.namespace || listener.namespace === universalNamespace ) && + ( self.eventMatches( self.context, listener, eventObj ) ) + ){ + let args = [ eventObj ]; + + if( extraParams != null ){ + util.push( args, extraParams ); + } + + self.beforeEmit( self.context, listener, eventObj ); + + if( listener.conf && listener.conf.one ){ + self.listeners = self.listeners.filter( l => l !== listener ); + } + + let context = self.callbackContext( self.context, listener, eventObj ); + let ret = listener.callback.apply( context, args ); + + self.afterEmit( self.context, listener, eventObj ); + + if( ret === false ){ + eventObj.stopPropagation(); + eventObj.preventDefault(); + } + } // if listener matches + } // for listener + + if( self.bubble( self.context ) && !eventObj.isPropagationStopped() ){ + self.parent( self.context ).emit( eventObj, extraParams ); + } + }, events ); + + this.emitting--; + + return this; +}; + +module.exports = Emitter; diff --git a/node_modules/cytoscape/src/event.js b/node_modules/cytoscape/src/event.js new file mode 100644 index 000000000..9853c7a98 --- /dev/null +++ b/node_modules/cytoscape/src/event.js @@ -0,0 +1,111 @@ +/*! +Event object based on jQuery events, MIT license + +https://jquery.org/license/ +https://tldrlegal.com/license/mit-license +https://github.com/jquery/jquery/blob/master/src/event.js +*/ + +let Event = function( src, props ){ + this.recycle( src, props ); +}; + +function returnFalse(){ + return false; +} + +function returnTrue(){ + return true; +} + +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +Event.prototype = { + instanceString: function(){ + return 'event'; + }, + + recycle: function( src, props ){ + this.isImmediatePropagationStopped = this.isPropagationStopped = this.isDefaultPrevented = returnFalse; + + if( src != null && src.preventDefault ){ // Browser Event object + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = ( src.defaultPrevented ) ? returnTrue : returnFalse; + + } else if( src != null && src.type ){ // Plain object containing all event details + props = src; + + } else { // Event string + this.type = src; + } + + // Put explicitly provided properties onto the event object + if( props != null ){ + // more efficient to manually copy fields we use + this.originalEvent = props.originalEvent; + this.type = props.type != null ? props.type : this.type; + this.cy = props.cy; + this.target = props.target; + this.position = props.position; + this.renderedPosition = props.renderedPosition; + this.namespace = props.namespace; + this.layout = props.layout; + } + + if( this.cy != null && this.position != null && this.renderedPosition == null ){ + // create a rendered position based on the passed position + let pos = this.position; + let zoom = this.cy.zoom(); + let pan = this.cy.pan(); + + this.renderedPosition = { + x: pos.x * zoom + pan.x, + y: pos.y * zoom + pan.y + }; + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || Date.now(); + }, + + preventDefault: function(){ + this.isDefaultPrevented = returnTrue; + + let e = this.originalEvent; + if( !e ){ + return; + } + + // if preventDefault exists run it on the original event + if( e.preventDefault ){ + e.preventDefault(); + } + }, + + stopPropagation: function(){ + this.isPropagationStopped = returnTrue; + + let e = this.originalEvent; + if( !e ){ + return; + } + + // if stopPropagation exists run it on the original event + if( e.stopPropagation ){ + e.stopPropagation(); + } + }, + + stopImmediatePropagation: function(){ + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; + +module.exports = Event; diff --git a/node_modules/cytoscape/src/extension.js b/node_modules/cytoscape/src/extension.js new file mode 100644 index 000000000..cd426b3ba --- /dev/null +++ b/node_modules/cytoscape/src/extension.js @@ -0,0 +1,243 @@ +let util = require('./util'); +let define = require('./define'); +let Collection = require('./collection'); +let Core = require('./core'); +let incExts = require('./extensions'); +let is = require('./is'); +let Emitter = require('./emitter'); + +// registered extensions to cytoscape, indexed by name +let extensions = {}; + +// registered modules for extensions, indexed by name +let modules = {}; + +function setExtension( type, name, registrant ){ + + let ext = registrant; + + let overrideErr = function( field ){ + util.error( 'Can not register `' + name + '` for `' + type + '` since `' + field + '` already exists in the prototype and can not be overridden' ); + }; + + if( type === 'core' ){ + if( Core.prototype[ name ] ){ + return overrideErr( name ); + } else { + Core.prototype[ name ] = registrant; + } + + } else if( type === 'collection' ){ + if( Collection.prototype[ name ] ){ + return overrideErr( name ); + } else { + Collection.prototype[ name ] = registrant; + } + + } else if( type === 'layout' ){ + // fill in missing layout functions in the prototype + + let Layout = function( options ){ + this.options = options; + + registrant.call( this, options ); + + // make sure layout has _private for use w/ std apis like .on() + if( !is.plainObject( this._private ) ){ + this._private = {}; + } + + this._private.cy = options.cy; + this._private.listeners = []; + + this.createEmitter(); + }; + + let layoutProto = Layout.prototype = Object.create( registrant.prototype ); + + let optLayoutFns = []; + + for( let i = 0; i < optLayoutFns.length; i++ ){ + let fnName = optLayoutFns[ i ]; + + layoutProto[ fnName ] = layoutProto[ fnName ] || function(){ return this; }; + } + + // either .start() or .run() is defined, so autogen the other + if( layoutProto.start && !layoutProto.run ){ + layoutProto.run = function(){ this.start(); return this; }; + } else if( !layoutProto.start && layoutProto.run ){ + layoutProto.start = function(){ this.run(); return this; }; + } + + let regStop = registrant.prototype.stop; + layoutProto.stop = function(){ + let opts = this.options; + + if( opts && opts.animate ){ + let anis = this.animations; + + if( anis ){ + for( let i = 0; i < anis.length; i++ ){ + anis[ i ].stop(); + } + } + } + + if( regStop ){ + regStop.call( this ); + } else { + this.emit( 'layoutstop' ); + } + + return this; + }; + + if( !layoutProto.destroy ){ + layoutProto.destroy = function(){ + return this; + }; + } + + layoutProto.cy = function(){ + return this._private.cy; + }; + + let getCy = layout => layout._private.cy; + + util.assign( layoutProto, { + createEmitter: function(){ + this._private.emitter = new Emitter({ + eventFields: function( layout ){ + return { + layout: layout, + cy: getCy(layout), + target: layout + }; + }, + bubble: function(){ return true; }, + parent: function( layout ){ return getCy(layout); }, + context: this + }); + + return this; + }, + emitter: function(){ return this._private.emitter; }, + on: function( evt, cb ){ this.emitter().on( evt, cb ); return this; }, + one: function( evt, cb ){ this.emitter().one( evt, cb ); return this; }, + once: function( evt, cb ){ this.emitter().one( evt, cb ); return this; }, + removeListener: function( evt, cb ){ this.emitter().removeListener( evt, cb ); return this; }, + emit: function( evt, params ){ this.emitter().emit( evt, params ); return this; } + } ); + + define.eventAliasesOn( layoutProto ); + + ext = Layout; // replace with our wrapped layout + + } else if( type === 'renderer' && name !== 'null' && name !== 'base' ){ + // user registered renderers inherit from base + + let BaseRenderer = getExtension( 'renderer', 'base' ); + let bProto = BaseRenderer.prototype; + let RegistrantRenderer = registrant; + let rProto = registrant.prototype; + + let Renderer = function(){ + BaseRenderer.apply( this, arguments ); + RegistrantRenderer.apply( this, arguments ); + }; + + let proto = Renderer.prototype; + + for( let pName in bProto ){ + let pVal = bProto[ pName ]; + let existsInR = rProto[ pName ] != null; + + if( existsInR ){ + return overrideErr( pName ); + } + + proto[ pName ] = pVal; // take impl from base + } + + for( let pName in rProto ){ + proto[ pName ] = rProto[ pName ]; // take impl from registrant + } + + bProto.clientFunctions.forEach( function( name ){ + proto[ name ] = proto[ name ] || function(){ + util.error( 'Renderer does not implement `renderer.' + name + '()` on its prototype' ); + }; + } ); + + ext = Renderer; + + } + + return util.setMap( { + map: extensions, + keys: [ type, name ], + value: ext + } ); +} + +function getExtension( type, name ){ + return util.getMap( { + map: extensions, + keys: [ type, name ] + } ); +} + +function setModule( type, name, moduleType, moduleName, registrant ){ + return util.setMap( { + map: modules, + keys: [ type, name, moduleType, moduleName ], + value: registrant + } ); +} + +function getModule( type, name, moduleType, moduleName ){ + return util.getMap( { + map: modules, + keys: [ type, name, moduleType, moduleName ] + } ); +} + +let extension = function(){ + // e.g. extension('renderer', 'svg') + if( arguments.length === 2 ){ + return getExtension.apply( null, arguments ); + } + + // e.g. extension('renderer', 'svg', { ... }) + else if( arguments.length === 3 ){ + return setExtension.apply( null, arguments ); + } + + // e.g. extension('renderer', 'svg', 'nodeShape', 'ellipse') + else if( arguments.length === 4 ){ + return getModule.apply( null, arguments ); + } + + // e.g. extension('renderer', 'svg', 'nodeShape', 'ellipse', { ... }) + else if( arguments.length === 5 ){ + return setModule.apply( null, arguments ); + } + + else { + util.error( 'Invalid extension access syntax' ); + } + +}; + +// allows a core instance to access extensions internally +Core.prototype.extension = extension; + +// included extensions +incExts.forEach( function( group ){ + group.extensions.forEach( function( ext ){ + setExtension( group.type, ext.name, ext.impl ); + } ); +} ); + +module.exports = extension; diff --git a/node_modules/cytoscape/src/extensions/index.js b/node_modules/cytoscape/src/extensions/index.js new file mode 100644 index 000000000..ed9c7128b --- /dev/null +++ b/node_modules/cytoscape/src/extensions/index.js @@ -0,0 +1,11 @@ +module.exports = [ + { + type: 'layout', + extensions: require( './layout' ) + }, + + { + type: 'renderer', + extensions: require( './renderer' ) + } +]; diff --git a/node_modules/cytoscape/src/extensions/layout/breadthfirst.js b/node_modules/cytoscape/src/extensions/layout/breadthfirst.js new file mode 100644 index 000000000..8227a1349 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/layout/breadthfirst.js @@ -0,0 +1,439 @@ +let util = require( '../../util' ); +let math = require( '../../math' ); +let is = require( '../../is' ); + +let defaults = { + fit: true, // whether to fit the viewport to the graph + directed: false, // whether the tree is directed downwards (or edges can point in any direction if false) + padding: 30, // padding on fit + circle: false, // put depths in concentric circles if true, put depths top down if false + spacingFactor: 1.75, // positive spacing factor, larger => more space between nodes (N.B. n/a if causes overlap) + boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space + nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm + roots: undefined, // the roots of the trees + maximalAdjustments: 0, // how many times to try to position the nodes in a maximal way (i.e. no backtracking) + animate: false, // whether to transition the node positions + animationDuration: 500, // duration of animation in ms if enabled + animationEasing: undefined, // easing of animation if enabled, + animateFilter: function ( node, i ){ return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts + ready: undefined, // callback on layoutready + stop: undefined, // callback on layoutstop + transform: function (node, position ){ return position; } // transform a given node position. Useful for changing flow direction in discrete layouts +}; + +function BreadthFirstLayout( options ){ + this.options = util.extend( {}, defaults, options ); +} + +BreadthFirstLayout.prototype.run = function(){ + let params = this.options; + let options = params; + + let cy = params.cy; + let eles = options.eles; + let nodes = eles.nodes().not( ':parent' ); + let graph = eles; + + let bb = math.makeBoundingBox( options.boundingBox ? options.boundingBox : { + x1: 0, y1: 0, w: cy.width(), h: cy.height() + } ); + + let roots; + if( is.elementOrCollection( options.roots ) ){ + roots = options.roots; + } else if( is.array( options.roots ) ){ + let rootsArray = []; + + for( let i = 0; i < options.roots.length; i++ ){ + let id = options.roots[ i ]; + let ele = cy.getElementById( id ); + rootsArray.push( ele ); + } + + roots = cy.collection( rootsArray ); + } else if( is.string( options.roots ) ){ + roots = cy.$( options.roots ); + + } else { + if( options.directed ){ + roots = nodes.roots(); + } else { + let components = []; + let unhandledNodes = nodes; + + while( unhandledNodes.length > 0 ){ + let currComp = cy.collection(); + + eles.bfs( { + roots: unhandledNodes[0], + visit: function( node, edge, pNode, i, depth ){ + currComp = currComp.add( node ); + }, + directed: false + } ); + + unhandledNodes = unhandledNodes.not( currComp ); + components.push( currComp ); + } + + roots = cy.collection(); + for( let i = 0; i < components.length; i++ ){ + let comp = components[ i ]; + let maxDegree = comp.maxDegree( false ); + let compRoots = comp.filter( function( ele ){ + return ele.degree( false ) === maxDegree; + } ); + + roots = roots.add( compRoots ); + } + + } + } + + + let depths = []; + let foundByBfs = {}; + let id2depth = {}; + let prevNode = {}; + let prevEdge = {}; + let successors = {}; + + // find the depths of the nodes + graph.bfs( { + roots: roots, + directed: options.directed, + visit: function( node, edge, pNode, i, depth ){ + let ele = node[0]; + let id = ele.id(); + + if( !depths[ depth ] ){ + depths[ depth ] = []; + } + + depths[ depth ].push( ele ); + foundByBfs[ id ] = true; + id2depth[ id ] = depth; + prevNode[ id ] = pNode; + prevEdge[ id ] = edge; + + if( pNode ){ + let prevId = pNode.id(); + let succ = successors[ prevId ] = successors[ prevId ] || []; + + succ.push( node ); + } + } + } ); + + // check for nodes not found by bfs + let orphanNodes = []; + for( let i = 0; i < nodes.length; i++ ){ + let ele = nodes[ i ]; + + if( foundByBfs[ ele.id() ] ){ + continue; + } else { + orphanNodes.push( ele ); + } + } + + // assign orphan nodes a depth from their neighborhood + let maxChecks = orphanNodes.length * 3; + let checks = 0; + while( orphanNodes.length !== 0 && checks < maxChecks ){ + let node = orphanNodes.shift(); + let neighbors = node.neighborhood().nodes(); + let assignedDepth = false; + + for( let i = 0; i < neighbors.length; i++ ){ + let depth = id2depth[ neighbors[ i ].id() ]; + + if( depth !== undefined ){ + depths[ depth ].push( node ); + assignedDepth = true; + break; + } + } + + if( !assignedDepth ){ + orphanNodes.push( node ); + } + + checks++; + } + + // assign orphan nodes that are still left to the depth of their subgraph + while( orphanNodes.length !== 0 ){ + let node = orphanNodes.shift(); + //let subgraph = graph.bfs( node ).path; + let assignedDepth = false; + + // for( let i = 0; i < subgraph.length; i++ ){ + // let depth = id2depth[ subgraph[i].id() ]; + + // if( depth !== undefined ){ + // depths[depth].push( node ); + // assignedDepth = true; + // break; + // } + // } + + if( !assignedDepth ){ // worst case if the graph really isn't tree friendly, then just dump it in 0 + if( depths.length === 0 ){ + depths.push( [] ); + } + + depths[0].push( node ); + } + } + + // assign the nodes a depth and index + let assignDepthsToEles = function(){ + for( let i = 0; i < depths.length; i++ ){ + let eles = depths[ i ]; + + for( let j = 0; j < eles.length; j++ ){ + let ele = eles[ j ]; + + if( ele == null ){ + eles.splice( j, 1 ); + j--; + continue; + } + + ele._private.scratch.breadthfirst = { + depth: i, + index: j + }; + } + } + }; + assignDepthsToEles(); + + + let intersectsDepth = function( node ){ // returns true if has edges pointing in from a higher depth + let edges = node.connectedEdges( function( ele ){ + return ele.data( 'target' ) === node.id(); + } ); + let thisInfo = node._private.scratch.breadthfirst; + let highestDepthOfOther = 0; + let highestOther; + for( let i = 0; i < edges.length; i++ ){ + let edge = edges[ i ]; + let otherNode = edge.source()[0]; + let otherInfo = otherNode._private.scratch.breadthfirst; + + if( thisInfo.depth <= otherInfo.depth && highestDepthOfOther < otherInfo.depth ){ + highestDepthOfOther = otherInfo.depth; + highestOther = otherNode; + } + } + + return highestOther; + }; + + // make maximal if so set by adjusting depths + for( let adj = 0; adj < options.maximalAdjustments; adj++ ){ + + let nDepths = depths.length; + let elesToMove = []; + for( let i = 0; i < nDepths; i++ ){ + let depth = depths[ i ]; + + let nDepth = depth.length; + for( let j = 0; j < nDepth; j++ ){ + let ele = depth[ j ]; + let info = ele._private.scratch.breadthfirst; + let intEle = intersectsDepth( ele ); + + if( intEle ){ + info.intEle = intEle; + elesToMove.push( ele ); + } + } + } + + for( let i = 0; i < elesToMove.length; i++ ){ + let ele = elesToMove[ i ]; + let info = ele._private.scratch.breadthfirst; + let intEle = info.intEle; + let intInfo = intEle._private.scratch.breadthfirst; + + depths[ info.depth ][ info.index ] = null; // remove from old depth & index (create hole to be cleaned) + + // add to end of new depth + let newDepth = intInfo.depth + 1; + while( newDepth > depths.length - 1 ){ + depths.push( [] ); + } + depths[ newDepth ].push( ele ); + + info.depth = newDepth; + info.index = depths[ newDepth ].length - 1; + } + + assignDepthsToEles(); + } + + // find min distance we need to leave between nodes + let minDistance = 0; + if( options.avoidOverlap ){ + for( let i = 0; i < nodes.length; i++ ){ + let n = nodes[ i ]; + let nbb = n.layoutDimensions( options ); + let w = nbb.w; + let h = nbb.h; + + minDistance = Math.max( minDistance, w, h ); + } + } + + // get the weighted percent for an element based on its connectivity to other levels + let cachedWeightedPercent = {}; + let getWeightedPercent = function( ele ){ + if( cachedWeightedPercent[ ele.id() ] ){ + return cachedWeightedPercent[ ele.id() ]; + } + + let eleDepth = ele._private.scratch.breadthfirst.depth; + let neighbors = ele.neighborhood().nodes().not( ':parent' ).intersection(nodes); + let percent = 0; + let samples = 0; + + for( let i = 0; i < neighbors.length; i++ ){ + let neighbor = neighbors[ i ]; + let bf = neighbor._private.scratch.breadthfirst; + let index = bf.index; + let depth = bf.depth; + let nDepth = depths[ depth ].length; + + if( eleDepth > depth || eleDepth === 0 ){ // only get influenced by elements above + percent += index / nDepth; + samples++; + } + } + + samples = Math.max( 1, samples ); + percent = percent / samples; + + if( samples === 0 ){ // so lone nodes have a "don't care" state in sorting + percent = undefined; + } + + cachedWeightedPercent[ ele.id() ] = percent; + return percent; + }; + + + // rearrange the indices in each depth level based on connectivity + + let sortFn = function( a, b ){ + let apct = getWeightedPercent( a ); + let bpct = getWeightedPercent( b ); + + return apct - bpct; + }; + + for( let times = 0; times < 3; times++ ){ // do it a few times b/c the depths are dynamic and we want a more stable result + + for( let i = 0; i < depths.length; i++ ){ + depths[ i ] = depths[ i ].sort( sortFn ); + } + assignDepthsToEles(); // and update + + } + + let biggestDepthSize = 0; + for( let i = 0; i < depths.length; i++ ){ + biggestDepthSize = Math.max( depths[ i ].length, biggestDepthSize ); + } + + let center = { + x: bb.x1 + bb.w / 2, + y: bb.x1 + bb.h / 2 + }; + + let getPosition = function( ele, isBottomDepth ){ + let info = ele._private.scratch.breadthfirst; + let depth = info.depth; + let index = info.index; + let depthSize = depths[ depth ].length; + + let distanceX = Math.max( bb.w / (depthSize + 1), minDistance ); + let distanceY = Math.max( bb.h / (depths.length + 1), minDistance ); + let radiusStepSize = Math.min( bb.w / 2 / depths.length, bb.h / 2 / depths.length ); + radiusStepSize = Math.max( radiusStepSize, minDistance ); + + if( !options.circle ){ + + let epos = { + x: center.x + (index + 1 - (depthSize + 1) / 2) * distanceX, + y: (depth + 1) * distanceY + }; + + if( isBottomDepth ){ + return epos; + } + + // let succs = successors[ ele.id() ]; + // if( succs ){ + // epos.x = 0; + // + // for( let i = 0 ; i < succs.length; i++ ){ + // let spos = pos[ succs[i].id() ]; + // + // epos.x += spos.x; + // } + // + // epos.x /= succs.length; + // } else { + // //debugger; + // } + + return epos; + + } else { + if( options.circle ){ + let radius = radiusStepSize * depth + radiusStepSize - (depths.length > 0 && depths[0].length <= 3 ? radiusStepSize / 2 : 0); + let theta = 2 * Math.PI / depths[ depth ].length * index; + + if( depth === 0 && depths[0].length === 1 ){ + radius = 1; + } + + return { + x: center.x + radius * Math.cos( theta ), + y: center.y + radius * Math.sin( theta ) + }; + + } else { + return { + x: center.x + (index + 1 - (depthSize + 1) / 2) * distanceX, + y: (depth + 1) * distanceY + }; + } + } + + }; + + // get positions in reverse depth order + let pos = {}; + for( let i = depths.length - 1; i >= 0; i-- ){ + let depth = depths[ i ]; + + for( let j = 0; j < depth.length; j++ ){ + let node = depth[ j ]; + + pos[ node.id() ] = getPosition( node, i === depths.length - 1 ); + } + } + + nodes.layoutPositions( this, options, function( node ){ + return pos[ node.id() ]; + } ); + + return this; // chaining +}; + +module.exports = BreadthFirstLayout; diff --git a/node_modules/cytoscape/src/extensions/layout/circle.js b/node_modules/cytoscape/src/extensions/layout/circle.js new file mode 100644 index 000000000..8983057cb --- /dev/null +++ b/node_modules/cytoscape/src/extensions/layout/circle.js @@ -0,0 +1,105 @@ +let util = require( '../../util' ); +let math = require( '../../math' ); +let is = require( '../../is' ); + +let defaults = { + fit: true, // whether to fit the viewport to the graph + padding: 30, // the padding on fit + boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + avoidOverlap: true, // prevents node overlap, may overflow boundingBox and radius if not enough space + nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm + spacingFactor: undefined, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up + radius: undefined, // the radius of the circle + startAngle: 3 / 2 * Math.PI, // where nodes start in radians + sweep: undefined, // how many radians should be between the first and last node (defaults to full circle) + clockwise: true, // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) + sort: undefined, // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } + animate: false, // whether to transition the node positions + animationDuration: 500, // duration of animation in ms if enabled + animationEasing: undefined, // easing of animation if enabled + animateFilter: function ( node, i ){ return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts + ready: undefined, // callback on layoutready + stop: undefined, // callback on layoutstop + transform: function (node, position ){ return position; } // transform a given node position. Useful for changing flow direction in discrete layouts + +}; + +function CircleLayout( options ){ + this.options = util.extend( {}, defaults, options ); +} + +CircleLayout.prototype.run = function(){ + let params = this.options; + let options = params; + + let cy = params.cy; + let eles = options.eles; + + let clockwise = options.counterclockwise !== undefined ? !options.counterclockwise : options.clockwise; + + let nodes = eles.nodes().not( ':parent' ); + + if( options.sort ){ + nodes = nodes.sort( options.sort ); + } + + let bb = math.makeBoundingBox( options.boundingBox ? options.boundingBox : { + x1: 0, y1: 0, w: cy.width(), h: cy.height() + } ); + + let center = { + x: bb.x1 + bb.w / 2, + y: bb.y1 + bb.h / 2 + }; + + let sweep = options.sweep === undefined ? 2 * Math.PI - 2 * Math.PI / nodes.length : options.sweep; + let dTheta = sweep / ( Math.max( 1, nodes.length - 1 ) ); + let r; + + let minDistance = 0; + for( let i = 0; i < nodes.length; i++ ){ + let n = nodes[ i ]; + let nbb = n.layoutDimensions( options ); + let w = nbb.w; + let h = nbb.h; + + minDistance = Math.max( minDistance, w, h ); + } + + if( is.number( options.radius ) ){ + r = options.radius; + } else if( nodes.length <= 1 ){ + r = 0; + } else { + r = Math.min( bb.h, bb.w ) / 2 - minDistance; + } + + // calculate the radius + if( nodes.length > 1 && options.avoidOverlap ){ // but only if more than one node (can't overlap) + minDistance *= 1.75; // just to have some nice spacing + + let dcos = Math.cos( dTheta ) - Math.cos( 0 ); + let dsin = Math.sin( dTheta ) - Math.sin( 0 ); + let rMin = Math.sqrt( minDistance * minDistance / ( dcos * dcos + dsin * dsin ) ); // s.t. no nodes overlapping + r = Math.max( rMin, r ); + } + + let getPos = function( ele, i ){ + let theta = options.startAngle + i * dTheta * ( clockwise ? 1 : -1 ); + + let rx = r * Math.cos( theta ); + let ry = r * Math.sin( theta ); + let pos = { + x: center.x + rx, + y: center.y + ry + }; + + return pos; + }; + + nodes.layoutPositions( this, options, getPos ); + + return this; // chaining +}; + +module.exports = CircleLayout; diff --git a/node_modules/cytoscape/src/extensions/layout/concentric.js b/node_modules/cytoscape/src/extensions/layout/concentric.js new file mode 100644 index 000000000..bc827280d --- /dev/null +++ b/node_modules/cytoscape/src/extensions/layout/concentric.js @@ -0,0 +1,200 @@ +let util = require( '../../util' ); +let math = require( '../../math' ); + +let defaults = { + fit: true, // whether to fit the viewport to the graph + padding: 30, // the padding on fit + startAngle: 3 / 2 * Math.PI, // where nodes start in radians + sweep: undefined, // how many radians should be between the first and last node (defaults to full circle) + clockwise: true, // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) + equidistant: false, // whether levels have an equal radial distance betwen them, may cause bounding box overflow + minNodeSpacing: 10, // min spacing between outside of nodes (used for radius adjustment) + boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space + nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm + height: undefined, // height of layout area (overrides container height) + width: undefined, // width of layout area (overrides container width) + spacingFactor: undefined, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up + concentric: function( node ){ // returns numeric value for each node, placing higher nodes in levels towards the centre + return node.degree(); + }, + levelWidth: function( nodes ){ // the letiation of concentric values in each level + return nodes.maxDegree() / 4; + }, + animate: false, // whether to transition the node positions + animationDuration: 500, // duration of animation in ms if enabled + animationEasing: undefined, // easing of animation if enabled + animateFilter: function ( node, i ){ return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts + ready: undefined, // callback on layoutready + stop: undefined, // callback on layoutstop + transform: function (node, position ){ return position; } // transform a given node position. Useful for changing flow direction in discrete layouts +}; + +function ConcentricLayout( options ){ + this.options = util.extend( {}, defaults, options ); +} + +ConcentricLayout.prototype.run = function(){ + let params = this.options; + let options = params; + + let clockwise = options.counterclockwise !== undefined ? !options.counterclockwise : options.clockwise; + + let cy = params.cy; + + let eles = options.eles; + let nodes = eles.nodes().not( ':parent' ); + + let bb = math.makeBoundingBox( options.boundingBox ? options.boundingBox : { + x1: 0, y1: 0, w: cy.width(), h: cy.height() + } ); + + let center = { + x: bb.x1 + bb.w / 2, + y: bb.y1 + bb.h / 2 + }; + + let nodeValues = []; // { node, value } + let theta = options.startAngle; + let maxNodeSize = 0; + + for( let i = 0; i < nodes.length; i++ ){ + let node = nodes[ i ]; + let value; + + // calculate the node value + value = options.concentric( node ); + nodeValues.push( { + value: value, + node: node + } ); + + // for style mapping + node._private.scratch.concentric = value; + } + + // in case we used the `concentric` in style + nodes.updateStyle(); + + // calculate max size now based on potentially updated mappers + for( let i = 0; i < nodes.length; i++ ){ + let node = nodes[ i ]; + let nbb = node.layoutDimensions( options ); + + maxNodeSize = Math.max( maxNodeSize, nbb.w, nbb.h ); + } + + // sort node values in descreasing order + nodeValues.sort( function( a, b ){ + return b.value - a.value; + } ); + + let levelWidth = options.levelWidth( nodes ); + + // put the values into levels + let levels = [ [] ]; + let currentLevel = levels[0]; + for( let i = 0; i < nodeValues.length; i++ ){ + let val = nodeValues[ i ]; + + if( currentLevel.length > 0 ){ + let diff = Math.abs( currentLevel[0].value - val.value ); + + if( diff >= levelWidth ){ + currentLevel = []; + levels.push( currentLevel ); + } + } + + currentLevel.push( val ); + } + + // create positions from levels + + let minDist = maxNodeSize + options.minNodeSpacing; // min dist between nodes + + if( !options.avoidOverlap ){ // then strictly constrain to bb + let firstLvlHasMulti = levels.length > 0 && levels[0].length > 1; + let maxR = ( Math.min( bb.w, bb.h ) / 2 - minDist ); + let rStep = maxR / ( levels.length + firstLvlHasMulti ? 1 : 0 ); + + minDist = Math.min( minDist, rStep ); + } + + // find the metrics for each level + let r = 0; + for( let i = 0; i < levels.length; i++ ){ + let level = levels[ i ]; + let sweep = options.sweep === undefined ? 2 * Math.PI - 2 * Math.PI / level.length : options.sweep; + let dTheta = level.dTheta = sweep / ( Math.max( 1, level.length - 1 ) ); + + // calculate the radius + if( level.length > 1 && options.avoidOverlap ){ // but only if more than one node (can't overlap) + let dcos = Math.cos( dTheta ) - Math.cos( 0 ); + let dsin = Math.sin( dTheta ) - Math.sin( 0 ); + let rMin = Math.sqrt( minDist * minDist / ( dcos * dcos + dsin * dsin ) ); // s.t. no nodes overlapping + + r = Math.max( rMin, r ); + } + + level.r = r; + + r += minDist; + } + + if( options.equidistant ){ + let rDeltaMax = 0; + let r = 0; + + for( let i = 0; i < levels.length; i++ ){ + let level = levels[ i ]; + let rDelta = level.r - r; + + rDeltaMax = Math.max( rDeltaMax, rDelta ); + } + + r = 0; + for( let i = 0; i < levels.length; i++ ){ + let level = levels[ i ]; + + if( i === 0 ){ + r = level.r; + } + + level.r = r; + + r += rDeltaMax; + } + } + + // calculate the node positions + let pos = {}; // id => position + for( let i = 0; i < levels.length; i++ ){ + let level = levels[ i ]; + let dTheta = level.dTheta; + let r = level.r; + + for( let j = 0; j < level.length; j++ ){ + let val = level[ j ]; + let theta = options.startAngle + (clockwise ? 1 : -1) * dTheta * j; + + let p = { + x: center.x + r * Math.cos( theta ), + y: center.y + r * Math.sin( theta ) + }; + + pos[ val.node.id() ] = p; + } + } + + // position the nodes + nodes.layoutPositions( this, options, function( ele ){ + let id = ele.id(); + + return pos[ id ]; + } ); + + return this; // chaining +}; + +module.exports = ConcentricLayout; diff --git a/node_modules/cytoscape/src/extensions/layout/cose.js b/node_modules/cytoscape/src/extensions/layout/cose.js new file mode 100644 index 000000000..d62f632e8 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/layout/cose.js @@ -0,0 +1,1414 @@ +/* +The CoSE layout was written by Gerardo Huck. +https://www.linkedin.com/in/gerardohuck/ + +Based on the following article: +http://dl.acm.org/citation.cfm?id=1498047 + +Modifications tracked on Github. +*/ + +var util = require( '../../util' ); +var math = require( '../../math' ); +var is = require( '../../is' ); +var Promise = require('../../promise'); + +var DEBUG; + +/** + * @brief : default layout options + */ +var defaults = { + // Called on `layoutready` + ready: function(){}, + + // Called on `layoutstop` + stop: function(){}, + + // Whether to animate while running the layout + // true : Animate continuously as the layout is running + // false : Just show the end result + // 'end' : Animate with the end result, from the initial positions to the end positions + animate: true, + + // Easing of the animation for animate:'end' + animationEasing: undefined, + + // The duration of the animation for animate:'end' + animationDuration: undefined, + + // A function that determines whether the node should be animated + // All nodes animated by default on animate enabled + // Non-animated nodes are positioned immediately when the layout starts + animateFilter: function ( node, i ){ return true; }, + + + // The layout animates only after this many milliseconds for animate:true + // (prevents flashing on fast runs) + animationThreshold: 250, + + // Number of iterations between consecutive screen positions update + // (0 -> only updated on the end) + refresh: 20, + + // Whether to fit the network view after when done + fit: true, + + // Padding on fit + padding: 30, + + // Constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + boundingBox: undefined, + + // Excludes the label when calculating node bounding boxes for the layout algorithm + nodeDimensionsIncludeLabels: false, + + // Randomize the initial positions of the nodes (true) or use existing positions (false) + randomize: false, + + // Extra spacing between components in non-compound graphs + componentSpacing: 40, + + // Node repulsion (non overlapping) multiplier + nodeRepulsion: function( node ){ return 2048; }, + + // Node repulsion (overlapping) multiplier + nodeOverlap: 4, + + // Ideal edge (non nested) length + idealEdgeLength: function( edge ){ return 32; }, + + // Divisor to compute edge forces + edgeElasticity: function( edge ){ return 32; }, + + // Nesting factor (multiplier) to compute ideal edge length for nested edges + nestingFactor: 1.2, + + // Gravity force (constant) + gravity: 1, + + // Maximum number of iterations to perform + numIter: 1000, + + // Initial temperature (maximum node displacement) + initialTemp: 1000, + + // Cooling factor (how the temperature is reduced between consecutive iterations + coolingFactor: 0.99, + + // Lower temperature threshold (below this point the layout will end) + minTemp: 1.0, + + // Pass a reference to weaver to use threads for calculations + weaver: false +}; + + +/** + * @brief : constructor + * @arg options : object containing layout options + */ +function CoseLayout( options ){ + this.options = util.extend( {}, defaults, options ); + + this.options.layout = this; +} + +/** + * @brief : runs the layout + */ +CoseLayout.prototype.run = function(){ + var options = this.options; + var cy = options.cy; + var layout = this; + var thread = this.thread; + var Thread = options.weaver ? options.weaver.Thread : null; + + var falseThread = { // use false thread as polyfill + listeners: [], + on: function(e, cb){ + this.listeners.push({ event: e, callback: cb }); + + return this; + }, + trigger: function(e){ + if( is.string(e) ){ + e = { type: e }; + } + + var matchesEvent = function( l ){ return l.event === e.type; }; + var trigger = function( l ){ l.callback(e); }; + + this.listeners.filter( matchesEvent ).forEach( trigger ); + + return this; + }, + pass: function( data ){ + this.pass = data; + + return this; + }, + run: function( cb ){ + var pass = this.pass; + + return new Promise(function( resolve ){ + resolve( cb( pass ) ); + }); + }, + stop: function(){ + return this; + }, + stopped: function(){ + return true; + }, + }; + + function broadcast( message ){ // for false thread + var e = { type: 'message', message: message }; + + falseThread.trigger( e ); + } + + if( !thread || thread.stopped() ){ + thread = this.thread = Thread ? new Thread() : falseThread; + } + + layout.stopped = false; + + if( options.animate === true || options.animate === false ){ + layout.emit( { type: 'layoutstart', layout: layout } ); + } + + // Set DEBUG - Global variable + if( true === options.debug ){ + DEBUG = true; + } else { + DEBUG = false; + } + + // Initialize layout info + var layoutInfo = createLayoutInfo( cy, layout, options ); + + // Show LayoutInfo contents if debugging + if( DEBUG ){ + printLayoutInfo( layoutInfo ); + } + + // If required, randomize node positions + if (options.randomize) { + randomizePositions( layoutInfo, cy ); + } + + var startTime = Date.now(); + var refreshRequested = false; + var refresh = function( rOpts ){ + rOpts = rOpts || {}; + + if( refreshRequested && !rOpts.next ){ + return; + } + + if( !rOpts.force && Date.now() - startTime < options.animationThreshold ){ + return; + } + + refreshRequested = true; + + util.requestAnimationFrame( function(){ + refreshPositions( layoutInfo, cy, options ); + + // Fit the graph if necessary + if( true === options.fit ){ + cy.fit( options.padding ); + } + + refreshRequested = false; + + if( rOpts.next ){ rOpts.next(); } + }); + }; + + thread.on( 'message', function( e ){ + var layoutNodes = e.message; + + layoutInfo.layoutNodes = layoutNodes; + refresh(); + } ); + + thread.pass( { + layoutInfo: layoutInfo, + options: { + animate: options.animate, + refresh: options.refresh, + componentSpacing: options.componentSpacing, + nodeOverlap: options.nodeOverlap, + nestingFactor: options.nestingFactor, + gravity: options.gravity, + numIter: options.numIter, + initialTemp: options.initialTemp, + coolingFactor: options.coolingFactor, + minTemp: options.minTemp + } + } ).run( function( pass ){ + var layoutInfo = pass.layoutInfo; + var options = pass.options; + var stopped = false; + + /** + * @brief : Performs one iteration of the physical simulation + * @arg layoutInfo : LayoutInfo object already initialized + * @arg cy : Cytoscape object + * @arg options : Layout options + */ + var step = function( layoutInfo, options, step ){ + // var s = "\n\n###############################"; + // s += "\nSTEP: " + step; + // s += "\n###############################\n"; + // logDebug(s); + + // Calculate node repulsions + calculateNodeForces( layoutInfo, options ); + // Calculate edge forces + calculateEdgeForces( layoutInfo, options ); + // Calculate gravity forces + calculateGravityForces( layoutInfo, options ); + // Propagate forces from parent to child + propagateForces( layoutInfo, options ); + // Update positions based on calculated forces + updatePositions( layoutInfo, options ); + }; + + /** + * @brief : Computes the node repulsion forces + */ + var calculateNodeForces = function( layoutInfo, options ){ + // Go through each of the graphs in graphSet + // Nodes only repel each other if they belong to the same graph + // var s = 'calculateNodeForces'; + // logDebug(s); + for( var i = 0; i < layoutInfo.graphSet.length; i ++ ){ + var graph = layoutInfo.graphSet[ i ]; + var numNodes = graph.length; + + // s = "Set: " + graph.toString(); + // logDebug(s); + + // Now get all the pairs of nodes + // Only get each pair once, (A, B) = (B, A) + for( var j = 0; j < numNodes; j++ ){ + var node1 = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ graph[ j ] ] ]; + + for( var k = j + 1; k < numNodes; k++ ){ + var node2 = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ graph[ k ] ] ]; + + nodeRepulsion( node1, node2, layoutInfo, options ); + } + } + } + }; + + var randomDistance = function( max ){ + return -max + 2 * max * Math.random(); + }; + + /** + * @brief : Compute the node repulsion forces between a pair of nodes + */ + var nodeRepulsion = function( node1, node2, layoutInfo, options ){ + // var s = "Node repulsion. Node1: " + node1.id + " Node2: " + node2.id; + + var cmptId1 = node1.cmptId; + var cmptId2 = node2.cmptId; + + if( cmptId1 !== cmptId2 && !layoutInfo.isCompound ){ return; } + + // Get direction of line connecting both node centers + var directionX = node2.positionX - node1.positionX; + var directionY = node2.positionY - node1.positionY; + var maxRandDist = 1; + // s += "\ndirectionX: " + directionX + ", directionY: " + directionY; + + // If both centers are the same, apply a random force + if( 0 === directionX && 0 === directionY ){ + directionX = randomDistance( maxRandDist ); + directionY = randomDistance( maxRandDist ); + } + + var overlap = nodesOverlap( node1, node2, directionX, directionY ); + + if( overlap > 0 ){ + // s += "\nNodes DO overlap."; + // s += "\nOverlap: " + overlap; + // If nodes overlap, repulsion force is proportional + // to the overlap + var force = options.nodeOverlap * overlap; + + // Compute the module and components of the force vector + var distance = Math.sqrt( directionX * directionX + directionY * directionY ); + // s += "\nDistance: " + distance; + var forceX = force * directionX / distance; + var forceY = force * directionY / distance; + + } else { + // s += "\nNodes do NOT overlap."; + // If there's no overlap, force is inversely proportional + // to squared distance + + // Get clipping points for both nodes + var point1 = findClippingPoint( node1, directionX, directionY ); + var point2 = findClippingPoint( node2, -1 * directionX, -1 * directionY ); + + // Use clipping points to compute distance + var distanceX = point2.x - point1.x; + var distanceY = point2.y - point1.y; + var distanceSqr = distanceX * distanceX + distanceY * distanceY; + var distance = Math.sqrt( distanceSqr ); + // s += "\nDistance: " + distance; + + // Compute the module and components of the force vector + var force = ( node1.nodeRepulsion + node2.nodeRepulsion ) / distanceSqr; + var forceX = force * distanceX / distance; + var forceY = force * distanceY / distance; + } + + // Apply force + if( !node1.isLocked ){ + node1.offsetX -= forceX; + node1.offsetY -= forceY; + } + + if( !node2.isLocked ){ + node2.offsetX += forceX; + node2.offsetY += forceY; + } + + // s += "\nForceX: " + forceX + " ForceY: " + forceY; + // logDebug(s); + + return; + }; + + /** + * @brief : Determines whether two nodes overlap or not + * @return : Amount of overlapping (0 => no overlap) + */ + var nodesOverlap = function( node1, node2, dX, dY ){ + + if( dX > 0 ){ + var overlapX = node1.maxX - node2.minX; + } else { + var overlapX = node2.maxX - node1.minX; + } + + if( dY > 0 ){ + var overlapY = node1.maxY - node2.minY; + } else { + var overlapY = node2.maxY - node1.minY; + } + + if( overlapX >= 0 && overlapY >= 0 ){ + return Math.sqrt( overlapX * overlapX + overlapY * overlapY ); + } else { + return 0; + } + }; + + /** + * @brief : Finds the point in which an edge (direction dX, dY) intersects + * the rectangular bounding box of it's source/target node + */ + var findClippingPoint = function( node, dX, dY ){ + + // Shorcuts + var X = node.positionX; + var Y = node.positionY; + var H = node.height || 1; + var W = node.width || 1; + var dirSlope = dY / dX; + var nodeSlope = H / W; + + // var s = 'Computing clipping point of node ' + node.id + + // " . Height: " + H + ", Width: " + W + + // "\nDirection " + dX + ", " + dY; + // + // Compute intersection + var res = {}; + + // Case: Vertical direction (up) + if( 0 === dX && 0 < dY ){ + res.x = X; + // s += "\nUp direction"; + res.y = Y + H / 2; + + return res; + } + + // Case: Vertical direction (down) + if( 0 === dX && 0 > dY ){ + res.x = X; + res.y = Y + H / 2; + // s += "\nDown direction"; + + return res; + } + + // Case: Intersects the right border + if( 0 < dX && + -1 * nodeSlope <= dirSlope && + dirSlope <= nodeSlope ){ + res.x = X + W / 2; + res.y = Y + (W * dY / 2 / dX); + // s += "\nRightborder"; + + return res; + } + + // Case: Intersects the left border + if( 0 > dX && + -1 * nodeSlope <= dirSlope && + dirSlope <= nodeSlope ){ + res.x = X - W / 2; + res.y = Y - (W * dY / 2 / dX); + // s += "\nLeftborder"; + + return res; + } + + // Case: Intersects the top border + if( 0 < dY && + ( dirSlope <= -1 * nodeSlope || + dirSlope >= nodeSlope ) ){ + res.x = X + (H * dX / 2 / dY); + res.y = Y + H / 2; + // s += "\nTop border"; + + return res; + } + + // Case: Intersects the bottom border + if( 0 > dY && + ( dirSlope <= -1 * nodeSlope || + dirSlope >= nodeSlope ) ){ + res.x = X - (H * dX / 2 / dY); + res.y = Y - H / 2; + // s += "\nBottom border"; + + return res; + } + + // s += "\nClipping point found at " + res.x + ", " + res.y; + // logDebug(s); + return res; + }; + + /** + * @brief : Calculates all edge forces + */ + var calculateEdgeForces = function( layoutInfo, options ){ + // Iterate over all edges + for( var i = 0; i < layoutInfo.edgeSize; i++ ){ + // Get edge, source & target nodes + var edge = layoutInfo.layoutEdges[ i ]; + var sourceIx = layoutInfo.idToIndex[ edge.sourceId ]; + var source = layoutInfo.layoutNodes[ sourceIx ]; + var targetIx = layoutInfo.idToIndex[ edge.targetId ]; + var target = layoutInfo.layoutNodes[ targetIx ]; + + // Get direction of line connecting both node centers + var directionX = target.positionX - source.positionX; + var directionY = target.positionY - source.positionY; + + // If both centers are the same, do nothing. + // A random force has already been applied as node repulsion + if( 0 === directionX && 0 === directionY ){ + continue; + } + + // Get clipping points for both nodes + var point1 = findClippingPoint( source, directionX, directionY ); + var point2 = findClippingPoint( target, -1 * directionX, -1 * directionY ); + + + var lx = point2.x - point1.x; + var ly = point2.y - point1.y; + var l = Math.sqrt( lx * lx + ly * ly ); + + var force = Math.pow( edge.idealLength - l, 2 ) / edge.elasticity; + + if( 0 !== l ){ + var forceX = force * lx / l; + var forceY = force * ly / l; + } else { + var forceX = 0; + var forceY = 0; + } + + // Add this force to target and source nodes + if( !source.isLocked ){ + source.offsetX += forceX; + source.offsetY += forceY; + } + + if( !target.isLocked ){ + target.offsetX -= forceX; + target.offsetY -= forceY; + } + + // var s = 'Edge force between nodes ' + source.id + ' and ' + target.id; + // s += "\nDistance: " + l + " Force: (" + forceX + ", " + forceY + ")"; + // logDebug(s); + } + }; + + /** + * @brief : Computes gravity forces for all nodes + */ + var calculateGravityForces = function( layoutInfo, options ){ + var distThreshold = 1; + + // var s = 'calculateGravityForces'; + // logDebug(s); + for( var i = 0; i < layoutInfo.graphSet.length; i ++ ){ + var graph = layoutInfo.graphSet[ i ]; + var numNodes = graph.length; + + // s = "Set: " + graph.toString(); + // logDebug(s); + + // Compute graph center + if( 0 === i ){ + var centerX = layoutInfo.clientHeight / 2; + var centerY = layoutInfo.clientWidth / 2; + } else { + // Get Parent node for this graph, and use its position as center + var temp = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ graph[0] ] ]; + var parent = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ temp.parentId ] ]; + var centerX = parent.positionX; + var centerY = parent.positionY; + } + // s = "Center found at: " + centerX + ", " + centerY; + // logDebug(s); + + // Apply force to all nodes in graph + for( var j = 0; j < numNodes; j++ ){ + var node = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ graph[ j ] ] ]; + // s = "Node: " + node.id; + + if( node.isLocked ){ continue; } + + var dx = centerX - node.positionX; + var dy = centerY - node.positionY; + var d = Math.sqrt( dx * dx + dy * dy ); + if( d > distThreshold ){ + var fx = options.gravity * dx / d; + var fy = options.gravity * dy / d; + node.offsetX += fx; + node.offsetY += fy; + // s += ": Applied force: " + fx + ", " + fy; + } else { + // s += ": skypped since it's too close to center"; + } + // logDebug(s); + } + } + }; + + /** + * @brief : This function propagates the existing offsets from + * parent nodes to its descendents. + * @arg layoutInfo : layoutInfo Object + * @arg cy : cytoscape Object + * @arg options : Layout options + */ + var propagateForces = function( layoutInfo, options ){ + // Inline implementation of a queue, used for traversing the graph in BFS order + var queue = []; + var start = 0; // Points to the start the queue + var end = -1; // Points to the end of the queue + + // logDebug('propagateForces'); + + // Start by visiting the nodes in the root graph + queue.push.apply( queue, layoutInfo.graphSet[0] ); + end += layoutInfo.graphSet[0].length; + + // Traverse the graph, level by level, + while( start <= end ){ + // Get the node to visit and remove it from queue + var nodeId = queue[ start++ ]; + var nodeIndex = layoutInfo.idToIndex[ nodeId ]; + var node = layoutInfo.layoutNodes[ nodeIndex ]; + var children = node.children; + + // We only need to process the node if it's compound + if( 0 < children.length && !node.isLocked ){ + var offX = node.offsetX; + var offY = node.offsetY; + + // var s = "Propagating offset from parent node : " + node.id + + // ". OffsetX: " + offX + ". OffsetY: " + offY; + // s += "\n Children: " + children.toString(); + // logDebug(s); + + for( var i = 0; i < children.length; i++ ){ + var childNode = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ children[ i ] ] ]; + // Propagate offset + childNode.offsetX += offX; + childNode.offsetY += offY; + // Add children to queue to be visited + queue[ ++end ] = children[ i ]; + } + + // Reset parent offsets + node.offsetX = 0; + node.offsetY = 0; + } + + } + }; + + /** + * @brief : Updates the layout model positions, based on + * the accumulated forces + */ + var updatePositions = function( layoutInfo, options ){ + // var s = 'Updating positions'; + // logDebug(s); + + // Reset boundaries for compound nodes + for( var i = 0; i < layoutInfo.nodeSize; i++ ){ + var n = layoutInfo.layoutNodes[ i ]; + if( 0 < n.children.length ){ + // logDebug("Resetting boundaries of compound node: " + n.id); + n.maxX = undefined; + n.minX = undefined; + n.maxY = undefined; + n.minY = undefined; + } + } + + for( var i = 0; i < layoutInfo.nodeSize; i++ ){ + var n = layoutInfo.layoutNodes[ i ]; + if( 0 < n.children.length || n.isLocked ){ + // No need to set compound or locked node position + // logDebug("Skipping position update of node: " + n.id); + continue; + } + // s = "Node: " + n.id + " Previous position: (" + + // n.positionX + ", " + n.positionY + ")."; + + // Limit displacement in order to improve stability + var tempForce = limitForce( n.offsetX, n.offsetY, layoutInfo.temperature ); + n.positionX += tempForce.x; + n.positionY += tempForce.y; + n.offsetX = 0; + n.offsetY = 0; + n.minX = n.positionX - n.width; + n.maxX = n.positionX + n.width; + n.minY = n.positionY - n.height; + n.maxY = n.positionY + n.height; + // s += " New Position: (" + n.positionX + ", " + n.positionY + ")."; + // logDebug(s); + + // Update ancestry boudaries + updateAncestryBoundaries( n, layoutInfo ); + } + + // Update size, position of compund nodes + for( var i = 0; i < layoutInfo.nodeSize; i++ ){ + var n = layoutInfo.layoutNodes[ i ]; + if( 0 < n.children.length && !n.isLocked ){ + n.positionX = (n.maxX + n.minX) / 2; + n.positionY = (n.maxY + n.minY) / 2; + n.width = n.maxX - n.minX; + n.height = n.maxY - n.minY; + // s = "Updating position, size of compound node " + n.id; + // s += "\nPositionX: " + n.positionX + ", PositionY: " + n.positionY; + // s += "\nWidth: " + n.width + ", Height: " + n.height; + // logDebug(s); + } + } + }; + + /** + * @brief : Limits a force (forceX, forceY) to be not + * greater (in modulo) than max. + 8 Preserves force direction. + */ + var limitForce = function( forceX, forceY, max ){ + // var s = "Limiting force: (" + forceX + ", " + forceY + "). Max: " + max; + var force = Math.sqrt( forceX * forceX + forceY * forceY ); + + if( force > max ){ + var res = { + x: max * forceX / force, + y: max * forceY / force + }; + + } else { + var res = { + x: forceX, + y: forceY + }; + } + + // s += ".\nResult: (" + res.x + ", " + res.y + ")"; + // logDebug(s); + + return res; + }; + + /** + * @brief : Function used for keeping track of compound node + * sizes, since they should bound all their subnodes. + */ + var updateAncestryBoundaries = function( node, layoutInfo ){ + // var s = "Propagating new position/size of node " + node.id; + var parentId = node.parentId; + if( null == parentId ){ + // If there's no parent, we are done + // s += ". No parent node."; + // logDebug(s); + return; + } + + // Get Parent Node + var p = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ parentId ] ]; + var flag = false; + + // MaxX + if( null == p.maxX || node.maxX + p.padRight > p.maxX ){ + p.maxX = node.maxX + p.padRight; + flag = true; + // s += "\nNew maxX for parent node " + p.id + ": " + p.maxX; + } + + // MinX + if( null == p.minX || node.minX - p.padLeft < p.minX ){ + p.minX = node.minX - p.padLeft; + flag = true; + // s += "\nNew minX for parent node " + p.id + ": " + p.minX; + } + + // MaxY + if( null == p.maxY || node.maxY + p.padBottom > p.maxY ){ + p.maxY = node.maxY + p.padBottom; + flag = true; + // s += "\nNew maxY for parent node " + p.id + ": " + p.maxY; + } + + // MinY + if( null == p.minY || node.minY - p.padTop < p.minY ){ + p.minY = node.minY - p.padTop; + flag = true; + // s += "\nNew minY for parent node " + p.id + ": " + p.minY; + } + + // If updated boundaries, propagate changes upward + if( flag ){ + // logDebug(s); + return updateAncestryBoundaries( p, layoutInfo ); + } + + // s += ". No changes in boundaries/position of parent node " + p.id; + // logDebug(s); + return; + }; + + var separateComponents = function( layutInfo, options ){ + var nodes = layoutInfo.layoutNodes; + var components = []; + + for( var i = 0; i < nodes.length; i++ ){ + var node = nodes[ i ]; + var cid = node.cmptId; + var component = components[ cid ] = components[ cid ] || []; + + component.push( node ); + } + + var totalA = 0; + + for( var i = 0; i < components.length; i++ ){ + var c = components[ i ]; + + if( !c ){ continue; } + + c.x1 = Infinity; + c.x2 = -Infinity; + c.y1 = Infinity; + c.y2 = -Infinity; + + for( var j = 0; j < c.length; j++ ){ + var n = c[ j ]; + + c.x1 = Math.min( c.x1, n.positionX - n.width / 2 ); + c.x2 = Math.max( c.x2, n.positionX + n.width / 2 ); + c.y1 = Math.min( c.y1, n.positionY - n.height / 2 ); + c.y2 = Math.max( c.y2, n.positionY + n.height / 2 ); + } + + c.w = c.x2 - c.x1; + c.h = c.y2 - c.y1; + + totalA += c.w * c.h; + } + + components.sort( function( c1, c2 ){ + return c2.w * c2.h - c1.w * c1.h; + } ); + + var x = 0; + var y = 0; + var usedW = 0; + var rowH = 0; + var maxRowW = Math.sqrt( totalA ) * layoutInfo.clientWidth / layoutInfo.clientHeight; + + for( var i = 0; i < components.length; i++ ){ + var c = components[ i ]; + + if( !c ){ continue; } + + for( var j = 0; j < c.length; j++ ){ + var n = c[ j ]; + + if( !n.isLocked ){ + n.positionX += x; + n.positionY += y; + } + } + + x += c.w + options.componentSpacing; + usedW += c.w + options.componentSpacing; + rowH = Math.max( rowH, c.h ); + + if( usedW > maxRowW ){ + y += rowH + options.componentSpacing; + x = 0; + usedW = 0; + rowH = 0; + } + } + }; + + var mainLoop = function( i ){ + if( stopped ){ + // logDebug("Layout manually stopped. Stopping computation in step " + i); + return false; + } + + // Do one step in the phisical simulation + step( layoutInfo, options, i ); + + // Update temperature + layoutInfo.temperature = layoutInfo.temperature * options.coolingFactor; + // logDebug("New temperature: " + layoutInfo.temperature); + + if( layoutInfo.temperature < options.minTemp ){ + // logDebug("Temperature drop below minimum threshold. Stopping computation in step " + i); + return false; + } + + return true; + }; + + var i = 0; + var loopRet; + + do { + var f = 0; + + while( f < options.refresh && i < options.numIter ){ + var loopRet = mainLoop( i ); + if( !loopRet ){ break; } + + f++; + i++; + } + + if( options.animate === true ){ + broadcast( layoutInfo.layoutNodes ); // eslint-disable-line no-undef + } + + } while( loopRet && i + 1 < options.numIter ); + + separateComponents( layoutInfo, options ); + + return layoutInfo; + } ).then( function( layoutInfoUpdated ){ + layoutInfo.layoutNodes = layoutInfoUpdated.layoutNodes; // get the positions + + thread.stop(); + done(); + } ); + + var done = function(){ + if( options.animate === true || options.animate === false ){ + refresh({ + force: true, + next: function(){ + // Layout has finished + layout.one('layoutstop', options.stop); + layout.emit({ type: 'layoutstop', layout: layout }); + } + }); + } else { + options.eles.nodes().layoutPositions( layout, options, function( node ){ + var lnode = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ node.data( 'id' ) ] ]; + + return { x: lnode.positionX, y: lnode.positionY }; + } ); + } + }; + + return this; // chaining +}; + + +/** + * @brief : called on continuous layouts to stop them before they finish + */ +CoseLayout.prototype.stop = function(){ + this.stopped = true; + + if( this.thread ){ + this.thread.stop(); + } + + this.emit( 'layoutstop' ); + + return this; // chaining +}; + +CoseLayout.prototype.destroy = function(){ + if( this.thread ){ + this.thread.stop(); + } + + return this; // chaining +}; + + +/** + * @brief : Creates an object which is contains all the data + * used in the layout process + * @arg cy : cytoscape.js object + * @return : layoutInfo object initialized + */ +var createLayoutInfo = function( cy, layout, options ){ + // Shortcut + var edges = options.eles.edges(); + var nodes = options.eles.nodes(); + + var layoutInfo = { + isCompound: cy.hasCompoundNodes(), + layoutNodes: [], + idToIndex: {}, + nodeSize: nodes.size(), + graphSet: [], + indexToGraph: [], + layoutEdges: [], + edgeSize: edges.size(), + temperature: options.initialTemp, + clientWidth: cy.width(), + clientHeight: cy.width(), + boundingBox: math.makeBoundingBox( options.boundingBox ? options.boundingBox : { + x1: 0, y1: 0, w: cy.width(), h: cy.height() + } ) + }; + + var components = options.eles.components(); + var id2cmptId = {}; + + for( var i = 0; i < components.length; i++ ){ + var component = components[ i ]; + + for( var j = 0; j < component.length; j++ ){ + var node = component[ j ]; + + id2cmptId[ node.id() ] = i; + } + } + + // Iterate over all nodes, creating layout nodes + for( var i = 0; i < layoutInfo.nodeSize; i++ ){ + var n = nodes[ i ]; + var nbb = n.layoutDimensions( options ); + + var tempNode = {}; + tempNode.isLocked = n.locked(); + tempNode.id = n.data( 'id' ); + tempNode.parentId = n.data( 'parent' ); + tempNode.cmptId = id2cmptId[ n.id() ]; + tempNode.children = []; + tempNode.positionX = n.position( 'x' ); + tempNode.positionY = n.position( 'y' ); + tempNode.offsetX = 0; + tempNode.offsetY = 0; + tempNode.height = nbb.w; + tempNode.width = nbb.h; + tempNode.maxX = tempNode.positionX + tempNode.width / 2; + tempNode.minX = tempNode.positionX - tempNode.width / 2; + tempNode.maxY = tempNode.positionY + tempNode.height / 2; + tempNode.minY = tempNode.positionY - tempNode.height / 2; + tempNode.padLeft = parseFloat( n.style( 'padding' ) ); + tempNode.padRight = parseFloat( n.style( 'padding' ) ); + tempNode.padTop = parseFloat( n.style( 'padding' ) ); + tempNode.padBottom = parseFloat( n.style( 'padding' ) ); + + // forces + tempNode.nodeRepulsion = is.fn( options.nodeRepulsion ) ? options.nodeRepulsion(n) : options.nodeRepulsion; + + // Add new node + layoutInfo.layoutNodes.push( tempNode ); + // Add entry to id-index map + layoutInfo.idToIndex[ tempNode.id ] = i; + } + + // Inline implementation of a queue, used for traversing the graph in BFS order + var queue = []; + var start = 0; // Points to the start the queue + var end = -1; // Points to the end of the queue + + var tempGraph = []; + + // Second pass to add child information and + // initialize queue for hierarchical traversal + for( var i = 0; i < layoutInfo.nodeSize; i++ ){ + var n = layoutInfo.layoutNodes[ i ]; + var p_id = n.parentId; + // Check if node n has a parent node + if( null != p_id ){ + // Add node Id to parent's list of children + layoutInfo.layoutNodes[ layoutInfo.idToIndex[ p_id ] ].children.push( n.id ); + } else { + // If a node doesn't have a parent, then it's in the root graph + queue[ ++end ] = n.id; + tempGraph.push( n.id ); + } + } + + // Add root graph to graphSet + layoutInfo.graphSet.push( tempGraph ); + + // Traverse the graph, level by level, + while( start <= end ){ + // Get the node to visit and remove it from queue + var node_id = queue[ start++ ]; + var node_ix = layoutInfo.idToIndex[ node_id ]; + var node = layoutInfo.layoutNodes[ node_ix ]; + var children = node.children; + if( children.length > 0 ){ + // Add children nodes as a new graph to graph set + layoutInfo.graphSet.push( children ); + // Add children to que queue to be visited + for( var i = 0; i < children.length; i++ ){ + queue[ ++end ] = children[ i ]; + } + } + } + + // Create indexToGraph map + for( var i = 0; i < layoutInfo.graphSet.length; i++ ){ + var graph = layoutInfo.graphSet[ i ]; + for( var j = 0; j < graph.length; j++ ){ + var index = layoutInfo.idToIndex[ graph[ j ] ]; + layoutInfo.indexToGraph[ index ] = i; + } + } + + // Iterate over all edges, creating Layout Edges + for( var i = 0; i < layoutInfo.edgeSize; i++ ){ + var e = edges[ i ]; + var tempEdge = {}; + tempEdge.id = e.data( 'id' ); + tempEdge.sourceId = e.data( 'source' ); + tempEdge.targetId = e.data( 'target' ); + + // Compute ideal length + var idealLength = is.fn( options.idealEdgeLength ) ? options.idealEdgeLength(e) : options.idealEdgeLength; + var elasticity = is.fn( options.edgeElasticity ) ? options.edgeElasticity(e) : options.edgeElasticity; + + // Check if it's an inter graph edge + var sourceIx = layoutInfo.idToIndex[ tempEdge.sourceId ]; + var targetIx = layoutInfo.idToIndex[ tempEdge.targetId ]; + var sourceGraph = layoutInfo.indexToGraph[ sourceIx ]; + var targetGraph = layoutInfo.indexToGraph[ targetIx ]; + + if( sourceGraph != targetGraph ){ + // Find lowest common graph ancestor + var lca = findLCA( tempEdge.sourceId, tempEdge.targetId, layoutInfo ); + + // Compute sum of node depths, relative to lca graph + var lcaGraph = layoutInfo.graphSet[ lca ]; + var depth = 0; + + // Source depth + var tempNode = layoutInfo.layoutNodes[ sourceIx ]; + while( -1 === lcaGraph.indexOf( tempNode.id ) ){ + tempNode = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ tempNode.parentId ] ]; + depth++; + } + + // Target depth + tempNode = layoutInfo.layoutNodes[ targetIx ]; + while( -1 === lcaGraph.indexOf( tempNode.id ) ){ + tempNode = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ tempNode.parentId ] ]; + depth++; + } + + // logDebug('LCA of nodes ' + tempEdge.sourceId + ' and ' + tempEdge.targetId + + // ". Index: " + lca + " Contents: " + lcaGraph.toString() + + // ". Depth: " + depth); + + // Update idealLength + idealLength *= depth * options.nestingFactor; + } + + tempEdge.idealLength = idealLength; + tempEdge.elasticity = elasticity; + + layoutInfo.layoutEdges.push( tempEdge ); + } + + // Finally, return layoutInfo object + return layoutInfo; +}; + + +/** + * @brief : This function finds the index of the lowest common + * graph ancestor between 2 nodes in the subtree + * (from the graph hierarchy induced tree) whose + * root is graphIx + * + * @arg node1: node1's ID + * @arg node2: node2's ID + * @arg layoutInfo: layoutInfo object + * + */ +var findLCA = function( node1, node2, layoutInfo ){ + // Find their common ancester, starting from the root graph + var res = findLCA_aux( node1, node2, 0, layoutInfo ); + if( 2 > res.count ){ + // If aux function couldn't find the common ancester, + // then it is the root graph + return 0; + } else { + return res.graph; + } +}; + + +/** + * @brief : Auxiliary function used for LCA computation + * + * @arg node1 : node1's ID + * @arg node2 : node2's ID + * @arg graphIx : subgraph index + * @arg layoutInfo : layoutInfo object + * + * @return : object of the form {count: X, graph: Y}, where: + * X is the number of ancesters (max: 2) found in + * graphIx (and it's subgraphs), + * Y is the graph index of the lowest graph containing + * all X nodes + */ +var findLCA_aux = function( node1, node2, graphIx, layoutInfo ){ + var graph = layoutInfo.graphSet[ graphIx ]; + // If both nodes belongs to graphIx + if( -1 < graph.indexOf( node1 ) && -1 < graph.indexOf( node2 ) ){ + return {count: 2, graph: graphIx}; + } + + // Make recursive calls for all subgraphs + var c = 0; + for( var i = 0; i < graph.length; i++ ){ + var nodeId = graph[ i ]; + var nodeIx = layoutInfo.idToIndex[ nodeId ]; + var children = layoutInfo.layoutNodes[ nodeIx ].children; + + // If the node has no child, skip it + if( 0 === children.length ){ + continue; + } + + var childGraphIx = layoutInfo.indexToGraph[ layoutInfo.idToIndex[ children[0] ] ]; + var result = findLCA_aux( node1, node2, childGraphIx, layoutInfo ); + if( 0 === result.count ){ + // Neither node1 nor node2 are present in this subgraph + continue; + } else if( 1 === result.count ){ + // One of (node1, node2) is present in this subgraph + c++; + if( 2 === c ){ + // We've already found both nodes, no need to keep searching + break; + } + } else { + // Both nodes are present in this subgraph + return result; + } + } + + return {count: c, graph: graphIx}; +}; + + +/** + * @brief: printsLayoutInfo into js console + * Only used for debbuging + */ +var printLayoutInfo = function( layoutInfo ){ + /* eslint-disable */ + + if( !DEBUG ){ + return; + } + console.debug( 'layoutNodes:' ); + for( var i = 0; i < layoutInfo.nodeSize; i++ ){ + var n = layoutInfo.layoutNodes[ i ]; + var s = + '\nindex: ' + i + + '\nId: ' + n.id + + '\nChildren: ' + n.children.toString() + + '\nparentId: ' + n.parentId + + '\npositionX: ' + n.positionX + + '\npositionY: ' + n.positionY + + '\nOffsetX: ' + n.offsetX + + '\nOffsetY: ' + n.offsetY + + '\npadLeft: ' + n.padLeft + + '\npadRight: ' + n.padRight + + '\npadTop: ' + n.padTop + + '\npadBottom: ' + n.padBottom; + + console.debug( s ); + } + + console.debug( 'idToIndex' ); + for( var i in layoutInfo.idToIndex ){ + console.debug( 'Id: ' + i + '\nIndex: ' + layoutInfo.idToIndex[ i ] ); + } + + console.debug( 'Graph Set' ); + var set = layoutInfo.graphSet; + for( var i = 0; i < set.length; i ++ ){ + console.debug( 'Set : ' + i + ': ' + set[ i ].toString() ); + } + + var s = 'IndexToGraph'; + for( var i = 0; i < layoutInfo.indexToGraph.length; i ++ ){ + s += '\nIndex : ' + i + ' Graph: ' + layoutInfo.indexToGraph[ i ]; + } + console.debug( s ); + + s = 'Layout Edges'; + for( var i = 0; i < layoutInfo.layoutEdges.length; i++ ){ + var e = layoutInfo.layoutEdges[ i ]; + s += '\nEdge Index: ' + i + ' ID: ' + e.id + + ' SouceID: ' + e.sourceId + ' TargetId: ' + e.targetId + + ' Ideal Length: ' + e.idealLength; + } + console.debug( s ); + + s = 'nodeSize: ' + layoutInfo.nodeSize; + s += '\nedgeSize: ' + layoutInfo.edgeSize; + s += '\ntemperature: ' + layoutInfo.temperature; + console.debug( s ); + + return; + /* eslint-enable */ +}; + + +/** + * @brief : Randomizes the position of all nodes + */ +var randomizePositions = function( layoutInfo, cy ){ + var width = layoutInfo.clientWidth; + var height = layoutInfo.clientHeight; + + for( var i = 0; i < layoutInfo.nodeSize; i++ ){ + var n = layoutInfo.layoutNodes[ i ]; + + // No need to randomize compound nodes or locked nodes + if( 0 === n.children.length && !n.isLocked ){ + n.positionX = Math.random() * width; + n.positionY = Math.random() * height; + } + } +}; + + +/** + * @brief : Updates the positions of nodes in the network + * @arg layoutInfo : LayoutInfo object + * @arg cy : Cytoscape object + * @arg options : Layout options + */ +var refreshPositions = function( layoutInfo, cy, options ){ + // var s = 'Refreshing positions'; + // logDebug(s); + + var layout = options.layout; + var nodes = options.eles.nodes(); + var bb = layoutInfo.boundingBox; + var coseBB = { x1: Infinity, x2: -Infinity, y1: Infinity, y2: -Infinity }; + + if( options.boundingBox ){ + nodes.forEach( function( node ){ + var lnode = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ node.data( 'id' ) ] ]; + + coseBB.x1 = Math.min( coseBB.x1, lnode.positionX ); + coseBB.x2 = Math.max( coseBB.x2, lnode.positionX ); + + coseBB.y1 = Math.min( coseBB.y1, lnode.positionY ); + coseBB.y2 = Math.max( coseBB.y2, lnode.positionY ); + } ); + + coseBB.w = coseBB.x2 - coseBB.x1; + coseBB.h = coseBB.y2 - coseBB.y1; + } + + nodes.positions( function( ele, i ){ + var lnode = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ ele.data( 'id' ) ] ]; + // s = "Node: " + lnode.id + ". Refreshed position: (" + + // lnode.positionX + ", " + lnode.positionY + ")."; + // logDebug(s); + + if( options.boundingBox ){ // then add extra bounding box constraint + var pctX = (lnode.positionX - coseBB.x1) / coseBB.w; + var pctY = (lnode.positionY - coseBB.y1) / coseBB.h; + + return { + x: bb.x1 + pctX * bb.w, + y: bb.y1 + pctY * bb.h + }; + } else { + return { + x: lnode.positionX, + y: lnode.positionY + }; + } + } ); + + // Trigger layoutReady only on first call + if( true !== layoutInfo.ready ){ + // s = 'Triggering layoutready'; + // logDebug(s); + layoutInfo.ready = true; + layout.one( 'layoutready', options.ready ); + layout.emit( { type: 'layoutready', layout: this } ); + } +}; + +/** + * @brief : Logs a debug message in JS console, if DEBUG is ON + */ +// var logDebug = function(text) { +// if (DEBUG) { +// console.debug(text); +// } +// }; + +module.exports = CoseLayout; diff --git a/node_modules/cytoscape/src/extensions/layout/grid.js b/node_modules/cytoscape/src/extensions/layout/grid.js new file mode 100644 index 000000000..70753b9ae --- /dev/null +++ b/node_modules/cytoscape/src/extensions/layout/grid.js @@ -0,0 +1,247 @@ +let util = require( '../../util' ); +let math = require( '../../math' ); + +let defaults = { + fit: true, // whether to fit the viewport to the graph + padding: 30, // padding used on fit + boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space + avoidOverlapPadding: 10, // extra spacing around nodes when avoidOverlap: true + nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm + spacingFactor: undefined, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up + condense: false, // uses all available space on false, uses minimal space on true + rows: undefined, // force num of rows in the grid + cols: undefined, // force num of columns in the grid + position: function( node ){}, // returns { row, col } for element + sort: undefined, // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } + animate: false, // whether to transition the node positions + animationDuration: 500, // duration of animation in ms if enabled + animationEasing: undefined, // easing of animation if enabled + animateFilter: function ( node, i ){ return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts + ready: undefined, // callback on layoutready + stop: undefined, // callback on layoutstop + transform: function (node, position ){ return position; } // transform a given node position. Useful for changing flow direction in discrete layouts +}; + +function GridLayout( options ){ + this.options = util.extend( {}, defaults, options ); +} + +GridLayout.prototype.run = function(){ + let params = this.options; + let options = params; + + let cy = params.cy; + let eles = options.eles; + let nodes = eles.nodes().not( ':parent' ); + + if( options.sort ){ + nodes = nodes.sort( options.sort ); + } + + let bb = math.makeBoundingBox( options.boundingBox ? options.boundingBox : { + x1: 0, y1: 0, w: cy.width(), h: cy.height() + } ); + + if( bb.h === 0 || bb.w === 0 ){ + nodes.layoutPositions( this, options, function( ele ){ + return { x: bb.x1, y: bb.y1 }; + } ); + + } else { + + // width/height * splits^2 = cells where splits is number of times to split width + let cells = nodes.size(); + let splits = Math.sqrt( cells * bb.h / bb.w ); + let rows = Math.round( splits ); + let cols = Math.round( bb.w / bb.h * splits ); + + let small = function( val ){ + if( val == null ){ + return Math.min( rows, cols ); + } else { + let min = Math.min( rows, cols ); + if( min == rows ){ + rows = val; + } else { + cols = val; + } + } + }; + + let large = function( val ){ + if( val == null ){ + return Math.max( rows, cols ); + } else { + let max = Math.max( rows, cols ); + if( max == rows ){ + rows = val; + } else { + cols = val; + } + } + }; + + let oRows = options.rows; + let oCols = options.cols != null ? options.cols : options.columns; + + // if rows or columns were set in options, use those values + if( oRows != null && oCols != null ){ + rows = oRows; + cols = oCols; + } else if( oRows != null && oCols == null ){ + rows = oRows; + cols = Math.ceil( cells / rows ); + } else if( oRows == null && oCols != null ){ + cols = oCols; + rows = Math.ceil( cells / cols ); + } + + // otherwise use the automatic values and adjust accordingly + + // if rounding was up, see if we can reduce rows or columns + else if( cols * rows > cells ){ + let sm = small(); + let lg = large(); + + // reducing the small side takes away the most cells, so try it first + if( (sm - 1) * lg >= cells ){ + small( sm - 1 ); + } else if( (lg - 1) * sm >= cells ){ + large( lg - 1 ); + } + } else { + + // if rounding was too low, add rows or columns + while( cols * rows < cells ){ + let sm = small(); + let lg = large(); + + // try to add to larger side first (adds less in multiplication) + if( (lg + 1) * sm >= cells ){ + large( lg + 1 ); + } else { + small( sm + 1 ); + } + } + } + + let cellWidth = bb.w / cols; + let cellHeight = bb.h / rows; + + if( options.condense ){ + cellWidth = 0; + cellHeight = 0; + } + + if( options.avoidOverlap ){ + for( let i = 0; i < nodes.length; i++ ){ + let node = nodes[ i ]; + let pos = node._private.position; + + if( pos.x == null || pos.y == null ){ // for bb + pos.x = 0; + pos.y = 0; + } + + let nbb = node.layoutDimensions( options ); + let p = options.avoidOverlapPadding; + + let w = nbb.w + p; + let h = nbb.h + p; + + cellWidth = Math.max( cellWidth, w ); + cellHeight = Math.max( cellHeight, h ); + } + } + + let cellUsed = {}; // e.g. 'c-0-2' => true + + let used = function( row, col ){ + return cellUsed[ 'c-' + row + '-' + col ] ? true : false; + }; + + let use = function( row, col ){ + cellUsed[ 'c-' + row + '-' + col ] = true; + }; + + // to keep track of current cell position + let row = 0; + let col = 0; + let moveToNextCell = function(){ + col++; + if( col >= cols ){ + col = 0; + row++; + } + }; + + // get a cache of all the manual positions + let id2manPos = {}; + for( let i = 0; i < nodes.length; i++ ){ + let node = nodes[ i ]; + let rcPos = options.position( node ); + + if( rcPos && (rcPos.row !== undefined || rcPos.col !== undefined) ){ // must have at least row or col def'd + let pos = { + row: rcPos.row, + col: rcPos.col + }; + + if( pos.col === undefined ){ // find unused col + pos.col = 0; + + while( used( pos.row, pos.col ) ){ + pos.col++; + } + } else if( pos.row === undefined ){ // find unused row + pos.row = 0; + + while( used( pos.row, pos.col ) ){ + pos.row++; + } + } + + id2manPos[ node.id() ] = pos; + use( pos.row, pos.col ); + } + } + + let getPos = function( element, i ){ + let x, y; + + if( element.locked() || element.isParent() ){ + return false; + } + + // see if we have a manual position set + let rcPos = id2manPos[ element.id() ]; + if( rcPos ){ + x = rcPos.col * cellWidth + cellWidth / 2 + bb.x1; + y = rcPos.row * cellHeight + cellHeight / 2 + bb.y1; + + } else { // otherwise set automatically + + while( used( row, col ) ){ + moveToNextCell(); + } + + x = col * cellWidth + cellWidth / 2 + bb.x1; + y = row * cellHeight + cellHeight / 2 + bb.y1; + use( row, col ); + + moveToNextCell(); + } + + return { x: x, y: y }; + + }; + + nodes.layoutPositions( this, options, getPos ); + } + + return this; // chaining + +}; + +module.exports = GridLayout; diff --git a/node_modules/cytoscape/src/extensions/layout/index.js b/node_modules/cytoscape/src/extensions/layout/index.js new file mode 100644 index 000000000..075dce771 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/layout/index.js @@ -0,0 +1,10 @@ +module.exports = [ + { name: 'breadthfirst', impl: require( './breadthfirst' ) }, + { name: 'circle', impl: require( './circle' ) }, + { name: 'concentric',impl: require( './concentric' ) }, + { name: 'cose', impl: require( './cose' ) }, + { name: 'grid', impl: require( './grid' ) }, + { name: 'null', impl: require( './null' ) }, + { name: 'preset', impl: require( './preset' ) }, + { name: 'random', impl: require( './random' ) } +]; diff --git a/node_modules/cytoscape/src/extensions/layout/null.js b/node_modules/cytoscape/src/extensions/layout/null.js new file mode 100644 index 000000000..0a738c922 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/layout/null.js @@ -0,0 +1,50 @@ +let util = require( '../../util' ); + +// default layout options +let defaults = { + ready: function(){}, // on layoutready + stop: function(){} // on layoutstop +}; + +// constructor +// options : object containing layout options +function NullLayout( options ){ + this.options = util.extend( {}, defaults, options ); +} + +// runs the layout +NullLayout.prototype.run = function(){ + let options = this.options; + let eles = options.eles; // elements to consider in the layout + let layout = this; + + // cy is automatically populated for us in the constructor + let cy = options.cy; // jshint ignore:line + + layout.emit( 'layoutstart' ); + + // puts all nodes at (0, 0) + eles.nodes().positions( function(){ + return { + x: 0, + y: 0 + }; + } ); + + // trigger layoutready when each node has had its position set at least once + layout.one( 'layoutready', options.ready ); + layout.emit( 'layoutready' ); + + // trigger layoutstop when the layout stops (e.g. finishes) + layout.one( 'layoutstop', options.stop ); + layout.emit( 'layoutstop' ); + + return this; // chaining +}; + +// called on continuous layouts to stop them before they finish +NullLayout.prototype.stop = function(){ + return this; // chaining +}; + +module.exports = NullLayout; diff --git a/node_modules/cytoscape/src/extensions/layout/preset.js b/node_modules/cytoscape/src/extensions/layout/preset.js new file mode 100644 index 000000000..b4fd57338 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/layout/preset.js @@ -0,0 +1,61 @@ +let util = require( '../../util' ); +let is = require( '../../is' ); + +let defaults = { + positions: undefined, // map of (node id) => (position obj); or function(node){ return somPos; } + zoom: undefined, // the zoom level to set (prob want fit = false if set) + pan: undefined, // the pan level to set (prob want fit = false if set) + fit: true, // whether to fit to viewport + padding: 30, // padding on fit + animate: false, // whether to transition the node positions + animationDuration: 500, // duration of animation in ms if enabled + animationEasing: undefined, // easing of animation if enabled + animateFilter: function ( node, i ){ return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts + ready: undefined, // callback on layoutready + stop: undefined, // callback on layoutstop + transform: function (node, position ){ return position; } // transform a given node position. Useful for changing flow direction in discrete layouts +}; + +function PresetLayout( options ){ + this.options = util.extend( {}, defaults, options ); +} + +PresetLayout.prototype.run = function(){ + let options = this.options; + let eles = options.eles; + + let nodes = eles.nodes(); + let posIsFn = is.fn( options.positions ); + + function getPosition( node ){ + if( options.positions == null ){ + return null; + } + + if( posIsFn ){ + return options.positions( node ); + } + + let pos = options.positions[ node._private.data.id ]; + + if( pos == null ){ + return null; + } + + return pos; + } + + nodes.layoutPositions( this, options, function( node, i ){ + let position = getPosition( node ); + + if( node.locked() || position == null ){ + return false; + } + + return position; + } ); + + return this; // chaining +}; + +module.exports = PresetLayout; diff --git a/node_modules/cytoscape/src/extensions/layout/random.js b/node_modules/cytoscape/src/extensions/layout/random.js new file mode 100644 index 000000000..dd86871fb --- /dev/null +++ b/node_modules/cytoscape/src/extensions/layout/random.js @@ -0,0 +1,43 @@ +let util = require( '../../util' ); +let math = require( '../../math' ); + +let defaults = { + fit: true, // whether to fit to viewport + padding: 30, // fit padding + boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } + animate: false, // whether to transition the node positions + animationDuration: 500, // duration of animation in ms if enabled + animationEasing: undefined, // easing of animation if enabled + animateFilter: function ( node, i ){ return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts + ready: undefined, // callback on layoutready + stop: undefined, // callback on layoutstop + transform: function (node, position ){ return position; } // transform a given node position. Useful for changing flow direction in discrete layouts +}; + +function RandomLayout( options ){ + this.options = util.extend( {}, defaults, options ); +} + +RandomLayout.prototype.run = function(){ + let options = this.options; + let cy = options.cy; + let eles = options.eles; + let nodes = eles.nodes().not( ':parent' ); + + let bb = math.makeBoundingBox( options.boundingBox ? options.boundingBox : { + x1: 0, y1: 0, w: cy.width(), h: cy.height() + } ); + + let getPos = function( node, i ){ + return { + x: bb.x1 + Math.round( Math.random() * bb.w ), + y: bb.y1 + Math.round( Math.random() * bb.h ) + }; + }; + + nodes.layoutPositions( this, options, getPos ); + + return this; // chaining +}; + +module.exports = RandomLayout; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/arrow-shapes.js b/node_modules/cytoscape/src/extensions/renderer/base/arrow-shapes.js new file mode 100644 index 000000000..999f93984 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/base/arrow-shapes.js @@ -0,0 +1,312 @@ +var math = require( '../../../math' ); +var is = require( '../../../is' ); +var util = require( '../../../util' ); + +var BRp = {}; + +BRp.arrowShapeWidth = 0.3; + +BRp.registerArrowShapes = function(){ + var arrowShapes = this.arrowShapes = {}; + var renderer = this; + + // Contract for arrow shapes: + // 0, 0 is arrow tip + // (0, 1) is direction towards node + // (1, 0) is right + // + // functional api: + // collide: check x, y in shape + // roughCollide: called before collide, no false negatives + // draw: draw + // spacing: dist(arrowTip, nodeBoundary) + // gap: dist(edgeTip, nodeBoundary), edgeTip may != arrowTip + + var bbCollide = function( x, y, size, angle, translation, edgeWidth, padding ){ + var x1 = translation.x - size / 2 - padding; + var x2 = translation.x + size / 2 + padding; + var y1 = translation.y - size / 2 - padding; + var y2 = translation.y + size / 2 + padding; + + var inside = (x1 <= x && x <= x2) && (y1 <= y && y <= y2); + + return inside; + }; + + var transform = function( x, y, size, angle, translation ){ + var xRotated = x * Math.cos( angle ) - y * Math.sin( angle ); + var yRotated = x * Math.sin( angle ) + y * Math.cos( angle ); + + var xScaled = xRotated * size; + var yScaled = yRotated * size; + + var xTranslated = xScaled + translation.x; + var yTranslated = yScaled + translation.y; + + return { + x: xTranslated, + y: yTranslated + }; + }; + + var transformPoints = function( pts, size, angle, translation ){ + var retPts = []; + + for( var i = 0; i < pts.length; i += 2 ){ + var x = pts[ i ]; + var y = pts[ i + 1]; + + retPts.push( transform( x, y, size, angle, translation ) ); + } + + return retPts; + }; + + var pointsToArr = function( pts ){ + var ret = []; + + for( var i = 0; i < pts.length; i++ ){ + var p = pts[ i ]; + + ret.push( p.x, p.y ); + } + + return ret; + }; + + var standardGap = function( edge ) { + return edge.pstyle( 'width' ).pfValue * edge.pstyle( 'arrow-scale' ).pfValue * 2; + }; + + var defineArrowShape = function( name, defn ){ + if( is.string( defn ) ){ + defn = arrowShapes[ defn ]; + } + + arrowShapes[ name ] = util.extend( { + name: name, + + points: [ + -0.15, -0.3, + 0.15, -0.3, + 0.15, 0.3, + -0.15, 0.3 + ], + + collide: function( x, y, size, angle, translation, padding ){ + var points = pointsToArr( transformPoints( this.points, size + 2 * padding, angle, translation ) ); + var inside = math.pointInsidePolygonPoints( x, y, points ); + + return inside; + }, + + roughCollide: bbCollide, + + draw: function( context, size, angle, translation ){ + var points = transformPoints( this.points, size, angle, translation ); + + renderer.arrowShapeImpl( 'polygon' )( context, points ); + }, + + spacing: function( edge ){ + return 0; + }, + + gap: standardGap + }, defn ); + }; + + defineArrowShape( 'none', { + collide: util.falsify, + + roughCollide: util.falsify, + + draw: util.noop, + + spacing: util.zeroify, + + gap: util.zeroify + } ); + + defineArrowShape( 'triangle', { + points: [ + -0.15, -0.3, + 0, 0, + 0.15, -0.3 + ] + } ); + + defineArrowShape( 'arrow', 'triangle' ); + + defineArrowShape( 'triangle-backcurve', { + points: arrowShapes[ 'triangle' ].points, + + controlPoint: [ 0, -0.15 ], + + roughCollide: bbCollide, + + draw: function( context, size, angle, translation, edgeWidth ){ + var ptsTrans = transformPoints( this.points, size, angle, translation ); + var ctrlPt = this.controlPoint; + var ctrlPtTrans = transform( ctrlPt[0], ctrlPt[1], size, angle, translation ); + + renderer.arrowShapeImpl( this.name )( context, ptsTrans, ctrlPtTrans ); + }, + + gap: function( edge ) { + return standardGap(edge) * 0.8; + } + } ); + + + defineArrowShape( 'triangle-tee', { + points: [ + -0.15, -0.3, + 0, 0, + 0.15, -0.3, + -0.15, -0.3 + ], + + pointsTee: [ + -0.15, -0.4, + -0.15, -0.5, + 0.15, -0.5, + 0.15, -0.4 + ], + + collide: function( x, y, size, angle, translation, edgeWidth, padding ){ + var triPts = pointsToArr( transformPoints( this.points, size + 2 * padding, angle, translation ) ); + var teePts = pointsToArr( transformPoints( this.pointsTee, size + 2 * padding, angle, translation ) ); + + var inside = math.pointInsidePolygonPoints( x, y, triPts ) || math.pointInsidePolygonPoints( x, y, teePts ); + + return inside; + }, + + draw: function( context, size, angle, translation, edgeWidth ){ + var triPts = transformPoints( this.points, size, angle, translation ); + var teePts = transformPoints( this.pointsTee, size, angle, translation ); + + renderer.arrowShapeImpl( this.name )( context, triPts, teePts ); + } + } ); + + defineArrowShape( 'triangle-cross', { + points: [ + -0.15, -0.3, + 0, 0, + 0.15, -0.3, + -0.15, -0.3 + ], + + baseCrossLinePts: [ + -0.15, -0.4, // first half of the rectangle + -0.15, -0.4, + 0.15, -0.4, // second half of the rectangle + 0.15, -0.4 + ], + + crossLinePts: function( size, edgeWidth ){ + // shift points so that the distance between the cross points matches edge width + var p = this.baseCrossLinePts.slice(); + var shiftFactor = edgeWidth / size; + var y0 = 3; + var y1 = 5; + + p[y0] = p[y0] - shiftFactor; + p[y1] = p[y1] - shiftFactor; + + return p; + }, + + collide: function( x, y, size, angle, translation, edgeWidth, padding ){ + var triPts = pointsToArr( transformPoints( this.points, size + 2 * padding, angle, translation ) ); + var teePts = pointsToArr( transformPoints( this.crossLinePts( size, edgeWidth ), size + 2 * padding, angle, translation ) ); + var inside = math.pointInsidePolygonPoints( x, y, triPts ) || math.pointInsidePolygonPoints( x, y, teePts ); + + return inside; + }, + + draw: function( context, size, angle, translation, edgeWidth ){ + var triPts = transformPoints( this.points, size, angle, translation ); + var crossLinePts = transformPoints( this.crossLinePts( size, edgeWidth ), size, angle, translation ); + + renderer.arrowShapeImpl( this.name )( context, triPts, crossLinePts ); + } + } ); + + defineArrowShape( 'vee', { + points: [ + -0.15, -0.3, + 0, 0, + 0.15, -0.3, + 0, -0.15 + ], + + gap: function( edge ){ + return standardGap(edge) * 0.525; + } + } ); + + defineArrowShape( 'circle', { + radius: 0.15, + + collide: function( x, y, size, angle, translation, edgeWidth, padding ){ + var t = translation; + var inside = ( Math.pow( t.x - x, 2 ) + Math.pow( t.y - y, 2 ) <= Math.pow( (size + 2 * padding) * this.radius, 2 ) ); + + return inside; + }, + + draw: function( context, size, angle, translation, edgeWidth ){ + renderer.arrowShapeImpl( this.name )( context, translation.x, translation.y, this.radius * size ); + }, + + spacing: function( edge ){ + return renderer.getArrowWidth( edge.pstyle( 'width' ).pfValue, edge.pstyle( 'arrow-scale' ).value ) + * this.radius; + } + } ); + + defineArrowShape( 'tee', { + points: [ + -0.15, 0, + -0.15, -0.1, + 0.15, -0.1, + 0.15, 0 + ], + + spacing: function( edge ){ + return 1; + }, + + gap: function( edge ){ + return 1; + } + } ); + + defineArrowShape( 'square', { + points: [ + -0.15, 0.00, + 0.15, 0.00, + 0.15, -0.3, + -0.15, -0.3 + ] + } ); + + defineArrowShape( 'diamond', { + points: [ + -0.15, -0.15, + 0, -0.3, + 0.15, -0.15, + 0, 0 + ], + + gap: function( edge ){ + return edge.pstyle( 'width' ).pfValue * edge.pstyle( 'arrow-scale' ).value; + } + } ); + +}; + +module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/coords.js b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/coords.js new file mode 100644 index 000000000..7d7606c03 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/coords.js @@ -0,0 +1,400 @@ +var window = require( '../../../../window' ); +var math = require( '../../../../math' ); +var util = require( '../../../../util' ); +var window = require( '../../../../window' ); + + +var BRp = {}; + +// Project mouse +BRp.projectIntoViewport = function( clientX, clientY ){ + var cy = this.cy; + var offsets = this.findContainerClientCoords(); + var offsetLeft = offsets[0]; + var offsetTop = offsets[1]; + var scale = offsets[4]; + var pan = cy.pan(); + var zoom = cy.zoom(); + + var x = ( (clientX - offsetLeft)/scale - pan.x ) / zoom; + var y = ( (clientY - offsetTop)/scale - pan.y ) / zoom; + + return [ x, y ]; +}; + +BRp.findContainerClientCoords = function(){ + if( this.containerBB ){ + return this.containerBB; + } + + var container = this.container; + var rect = container.getBoundingClientRect(); + var style = window.getComputedStyle( container ); + var styleValue = function( name ){ return parseFloat( style.getPropertyValue( name ) ); }; + + var padding = { + left: styleValue('padding-left'), + right: styleValue('padding-right'), + top: styleValue('padding-top'), + bottom: styleValue('padding-bottom') + }; + + var border = { + left: styleValue('border-left-width'), + right: styleValue('border-right-width'), + top: styleValue('border-top-width'), + bottom: styleValue('border-bottom-width') + }; + + var clientWidth = container.clientWidth; + var clientHeight = container.clientHeight; + + var paddingHor = padding.left + padding.right; + var paddingVer = padding.top + padding.bottom; + + var borderHor = border.left + border.right; + var borderVer = border.top + border.bottom; + + var scale = rect.width / ( clientWidth + borderHor ); + + var unscaledW = clientWidth - paddingHor; + var unscaledH = clientHeight - paddingVer; + + var scaledW = rect.width - (paddingHor + borderHor) * scale; + var scaledH = rect.height - (paddingVer + borderVer) * scale; + + var left = rect.left + padding.left + border.left; + var top = rect.top + padding.top + border.top; + + return ( this.containerBB = [ + left, + top, + unscaledW, + unscaledH, + scale + ] ); +}; + +BRp.invalidateContainerClientCoordsCache = function(){ + this.containerBB = null; +}; + +BRp.findNearestElement = function( x, y, interactiveElementsOnly, isTouch ){ + return this.findNearestElements( x, y, interactiveElementsOnly, isTouch )[0]; +}; + +BRp.findNearestElements = function( x, y, interactiveElementsOnly, isTouch ){ + var self = this; + var r = this; + var eles = r.getCachedZSortedEles(); + var near = []; // 1 node max, 1 edge max + var zoom = r.cy.zoom(); + var hasCompounds = r.cy.hasCompoundNodes(); + var edgeThreshold = (isTouch ? 24 : 8) / zoom; + var nodeThreshold = (isTouch ? 8 : 2) / zoom; + var labelThreshold = (isTouch ? 8 : 2) / zoom; + var minSqDist = Infinity; + var nearEdge; + var nearNode; + + if( interactiveElementsOnly ){ + eles = eles.interactive; + } + + function addEle( ele, sqDist ){ + if( ele.isNode() ){ + if( nearNode ){ + return; // can't replace node + } else { + nearNode = ele; + near.push( ele ); + } + } + + if( ele.isEdge() && ( sqDist == null || sqDist < minSqDist ) ){ + if( nearEdge ){ // then replace existing edge + // can replace only if same z-index + if( nearEdge.pstyle( 'z-index' ).value === ele.pstyle('z-index').value ){ + for( var i = 0; i < near.length; i++ ){ + if( near[i].isEdge() ){ + near[i] = ele; + nearEdge = ele; + minSqDist = sqDist != null ? sqDist : minSqDist; + break; + } + } + } + } else { + near.push( ele ); + nearEdge = ele; + minSqDist = sqDist != null ? sqDist : minSqDist; + } + } + } + + function checkNode( node ){ + var width = node.outerWidth() + 2 * nodeThreshold; + var height = node.outerHeight() + 2 * nodeThreshold; + var hw = width / 2; + var hh = height / 2; + var pos = node.position(); + + if( + pos.x - hw <= x && x <= pos.x + hw // bb check x + && + pos.y - hh <= y && y <= pos.y + hh // bb check y + ){ + var shape = r.nodeShapes[ self.getNodeShape( node ) ]; + + if( + shape.checkPoint( x, y, 0, width, height, pos.x, pos.y ) + ){ + addEle( node, 0 ); + return true; + } + + } + } + + function checkEdge( edge ){ + var _p = edge._private; + + var rs = _p.rscratch; + var styleWidth = edge.pstyle( 'width' ).pfValue; + var scale = edge.pstyle( 'arrow-scale' ).value; + var width = styleWidth / 2 + edgeThreshold; // more like a distance radius from centre + var widthSq = width * width; + var width2 = width * 2; + var src = _p.source; + var tgt = _p.target; + var inEdgeBB = false; + var sqDist; + + if( rs.edgeType === 'segments' || rs.edgeType === 'straight' || rs.edgeType === 'haystack' ){ + var pts = rs.allpts; + + for( var i = 0; i + 3 < pts.length; i += 2 ){ + if( + (inEdgeBB = math.inLineVicinity( x, y, pts[ i ], pts[ i + 1], pts[ i + 2], pts[ i + 3], width2 )) + && + widthSq > ( sqDist = math.sqdistToFiniteLine( x, y, pts[ i ], pts[ i + 1], pts[ i + 2], pts[ i + 3] ) ) + ){ + addEle( edge, sqDist ); + return true; + } + } + + } else if( rs.edgeType === 'bezier' || rs.edgeType === 'multibezier' || rs.edgeType === 'self' || rs.edgeType === 'compound' ){ + var pts = rs.allpts; + for( var i = 0; i + 5 < rs.allpts.length; i += 4 ){ + if( + (inEdgeBB = math.inBezierVicinity( x, y, pts[ i ], pts[ i + 1], pts[ i + 2], pts[ i + 3], pts[ i + 4], pts[ i + 5], width2 )) + && + (widthSq > (sqDist = math.sqdistToQuadraticBezier( x, y, pts[ i ], pts[ i + 1], pts[ i + 2], pts[ i + 3], pts[ i + 4], pts[ i + 5] )) ) + ){ + addEle( edge, sqDist ); + return true; + } + } + } + + // if we're close to the edge but didn't hit it, maybe we hit its arrows + + var src = src || _p.source; + var tgt = tgt || _p.target; + + var arSize = self.getArrowWidth( styleWidth, scale ); + + var arrows = [ + { name: 'source', x: rs.arrowStartX, y: rs.arrowStartY, angle: rs.srcArrowAngle }, + { name: 'target', x: rs.arrowEndX, y: rs.arrowEndY, angle: rs.tgtArrowAngle }, + { name: 'mid-source', x: rs.midX, y: rs.midY, angle: rs.midsrcArrowAngle }, + { name: 'mid-target', x: rs.midX, y: rs.midY, angle: rs.midtgtArrowAngle } + ]; + + for( var i = 0; i < arrows.length; i++ ){ + var ar = arrows[ i ]; + var shape = r.arrowShapes[ edge.pstyle( ar.name + '-arrow-shape' ).value ]; + var edgeWidth = edge.pstyle('width').pfValue; + if( + shape.roughCollide( x, y, arSize, ar.angle, { x: ar.x, y: ar.y }, edgeWidth, edgeThreshold ) + && + shape.collide( x, y, arSize, ar.angle, { x: ar.x, y: ar.y }, edgeWidth, edgeThreshold ) + ){ + addEle( edge ); + return true; + } + } + + // for compound graphs, hitting edge may actually want a connected node instead (b/c edge may have greater z-index precedence) + if( hasCompounds && near.length > 0 ){ + checkNode( src ); + checkNode( tgt ); + } + } + + function preprop( obj, name, pre ){ + return util.getPrefixedProperty( obj, name, pre ); + } + + function checkLabel( ele, prefix ){ + var _p = ele._private; + var th = labelThreshold; + + var prefixDash; + if( prefix ){ + prefixDash = prefix + '-'; + } else { + prefixDash = ''; + } + + var text = ele.pstyle( prefixDash + 'label' ).value; + var eventsEnabled = ele.pstyle( 'text-events' ).strValue === 'yes'; + + if( !eventsEnabled || !text ){ return; } + + var rstyle = _p.rstyle; + var bw = ele.pstyle('text-border-width').pfValue; + var pw = ele.pstyle('text-background-padding').pfValue; + var lw = preprop( rstyle, 'labelWidth', prefix ) + bw + 2*th + 2*pw; + var lh = preprop( rstyle, 'labelHeight', prefix ) + bw + 2*th + 2*pw; + var lx = preprop( rstyle, 'labelX', prefix ); + var ly = preprop( rstyle, 'labelY', prefix ); + + var theta = preprop( _p.rscratch, 'labelAngle', prefix ); + + var lx1 = lx - lw / 2; + var lx2 = lx + lw / 2; + var ly1 = ly - lh / 2; + var ly2 = ly + lh / 2; + + if( theta ){ + var cos = Math.cos( theta ); + var sin = Math.sin( theta ); + + var rotate = function( x, y ){ + x = x - lx; + y = y - ly; + + return { + x: x * cos - y * sin + lx, + y: x * sin + y * cos + ly + }; + }; + + var px1y1 = rotate( lx1, ly1 ); + var px1y2 = rotate( lx1, ly2 ); + var px2y1 = rotate( lx2, ly1 ); + var px2y2 = rotate( lx2, ly2 ); + + var points = [ + px1y1.x, px1y1.y, + px2y1.x, px2y1.y, + px2y2.x, px2y2.y, + px1y2.x, px1y2.y + ]; + + if( math.pointInsidePolygonPoints( x, y, points ) ){ + addEle( ele ); + return true; + } + } else { // do a cheaper bb check + var bb = { + w: lw, + h: lh, + x1: lx1, + x2: lx2, + y1: ly1, + y2: ly2 + }; + + if( math.inBoundingBox( bb, x, y ) ){ + addEle( ele ); + return true; + } + } + + } + + for( var i = eles.length - 1; i >= 0; i-- ){ // reverse order for precedence + var ele = eles[ i ]; + + if( ele.isNode() ){ + checkNode( ele ) || checkLabel( ele ); + + } else { // then edge + checkEdge( ele ) || checkLabel( ele ) || checkLabel( ele, 'source' ) || checkLabel( ele, 'target' ); + } + } + + return near; +}; + +// 'Give me everything from this box' +BRp.getAllInBox = function( x1, y1, x2, y2 ){ + var eles = this.getCachedZSortedEles().interactive; + var box = []; + + var x1c = Math.min( x1, x2 ); + var x2c = Math.max( x1, x2 ); + var y1c = Math.min( y1, y2 ); + var y2c = Math.max( y1, y2 ); + + x1 = x1c; + x2 = x2c; + y1 = y1c; + y2 = y2c; + + var boxBb = math.makeBoundingBox( { + x1: x1, y1: y1, + x2: x2, y2: y2 + } ); + + for( var e = 0; e < eles.length; e++ ){ + var ele = eles[e]; + + if( ele.isNode() ){ + var node = ele; + var nodeBb = node.boundingBox( { + includeNodes: true, + includeEdges: false, + includeLabels: false + } ); + + if( math.boundingBoxesIntersect( boxBb, nodeBb ) && !math.boundingBoxInBoundingBox( nodeBb, boxBb ) ){ + box.push( node ); + } + } else { + var edge = ele; + var _p = edge._private; + var rs = _p.rscratch; + + if( rs.startX != null && rs.startY != null && !math.inBoundingBox( boxBb, rs.startX, rs.startY ) ){ continue; } + if( rs.endX != null && rs.endY != null && !math.inBoundingBox( boxBb, rs.endX, rs.endY ) ){ continue; } + + if( rs.edgeType === 'bezier' || rs.edgeType === 'multibezier' || rs.edgeType === 'self' || rs.edgeType === 'compound' || rs.edgeType === 'segments' || rs.edgeType === 'haystack' ){ + + var pts = _p.rstyle.bezierPts || _p.rstyle.linePts || _p.rstyle.haystackPts; + var allInside = true; + + for( var i = 0; i < pts.length; i++ ){ + if( !math.pointInBoundingBox( boxBb, pts[ i ] ) ){ + allInside = false; + break; + } + } + + if( allInside ){ + box.push( edge ); + } + + } else if( rs.edgeType === 'haystack' || rs.edgeType === 'straight' ){ + box.push( edge ); + } + } + } + + return box; +}; + +module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-arrows.js b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-arrows.js new file mode 100644 index 000000000..58b66e13a --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-arrows.js @@ -0,0 +1,179 @@ +var math = require( '../../../../math' ); + +var BRp = {}; + +BRp.calculateArrowAngles = function( edge ){ + var rs = edge._private.rscratch; + var isHaystack = rs.edgeType === 'haystack'; + var isBezier = rs.edgeType === 'bezier'; + var isMultibezier = rs.edgeType === 'multibezier'; + var isSegments = rs.edgeType === 'segments'; + var isCompound = rs.edgeType === 'compound'; + var isSelf = rs.edgeType === 'self'; + + // Displacement gives direction for arrowhead orientation + var dispX, dispY; + var startX, startY, endX, endY, midX, midY; + + if( isHaystack ){ + startX = rs.haystackPts[0]; + startY = rs.haystackPts[1]; + endX = rs.haystackPts[2]; + endY = rs.haystackPts[3]; + } else { + startX = rs.arrowStartX; + startY = rs.arrowStartY; + endX = rs.arrowEndX; + endY = rs.arrowEndY; + } + + midX = rs.midX; + midY = rs.midY; + + // source + // + + if( isSegments ){ + dispX = startX - rs.segpts[0]; + dispY = startY - rs.segpts[1]; + } else if( isMultibezier || isCompound || isSelf || isBezier ){ + var pts = rs.allpts; + var bX = math.qbezierAt( pts[0], pts[2], pts[4], 0.1 ); + var bY = math.qbezierAt( pts[1], pts[3], pts[5], 0.1 ); + + dispX = startX - bX; + dispY = startY - bY; + } else { + dispX = startX - midX; + dispY = startY - midY; + } + + rs.srcArrowAngle = math.getAngleFromDisp( dispX, dispY ); + + // mid target + // + + var midX = rs.midX; + var midY = rs.midY; + + if( isHaystack ){ + midX = ( startX + endX ) / 2; + midY = ( startY + endY ) / 2; + } + + dispX = endX - startX; + dispY = endY - startY; + + if( isSegments ){ + var pts = rs.allpts; + + if( pts.length / 2 % 2 === 0 ){ + var i2 = pts.length / 2; + var i1 = i2 - 2; + + dispX = ( pts[ i2 ] - pts[ i1 ] ); + dispY = ( pts[ i2 + 1] - pts[ i1 + 1] ); + } else { + var i2 = pts.length / 2 - 1; + var i1 = i2 - 2; + var i3 = i2 + 2; + + dispX = ( pts[ i2 ] - pts[ i1 ] ); + dispY = ( pts[ i2 + 1] - pts[ i1 + 1] ); + } + } else if( isMultibezier || isCompound || isSelf ){ + var pts = rs.allpts; + var cpts = rs.ctrlpts; + var bp0x, bp0y; + var bp1x, bp1y; + + if( cpts.length / 2 % 2 === 0 ){ + var p0 = pts.length / 2 - 1; // startpt + var ic = p0 + 2; + var p1 = ic + 2; + + bp0x = math.qbezierAt( pts[ p0 ], pts[ ic ], pts[ p1 ], 0.0 ); + bp0y = math.qbezierAt( pts[ p0 + 1], pts[ ic + 1], pts[ p1 + 1], 0.0 ); + + bp1x = math.qbezierAt( pts[ p0 ], pts[ ic ], pts[ p1 ], 0.0001 ); + bp1y = math.qbezierAt( pts[ p0 + 1], pts[ ic + 1], pts[ p1 + 1], 0.0001 ); + } else { + var ic = pts.length / 2 - 1; // ctrpt + var p0 = ic - 2; // startpt + var p1 = ic + 2; // endpt + + bp0x = math.qbezierAt( pts[ p0 ], pts[ ic ], pts[ p1 ], 0.4999 ); + bp0y = math.qbezierAt( pts[ p0 + 1], pts[ ic + 1], pts[ p1 + 1], 0.4999 ); + + bp1x = math.qbezierAt( pts[ p0 ], pts[ ic ], pts[ p1 ], 0.5 ); + bp1y = math.qbezierAt( pts[ p0 + 1], pts[ ic + 1], pts[ p1 + 1], 0.5 ); + } + + dispX = ( bp1x - bp0x ); + dispY = ( bp1y - bp0y ); + } + + rs.midtgtArrowAngle = math.getAngleFromDisp( dispX, dispY ); + + rs.midDispX = dispX; + rs.midDispY = dispY; + + // mid source + // + + dispX *= -1; + dispY *= -1; + + if( isSegments ){ + var pts = rs.allpts; + + if( pts.length / 2 % 2 === 0 ){ + // already ok + } else { + var i2 = pts.length / 2 - 1; + var i3 = i2 + 2; + + dispX = -( pts[ i3 ] - pts[ i2 ] ); + dispY = -( pts[ i3 + 1] - pts[ i2 + 1] ); + } + } + + rs.midsrcArrowAngle = math.getAngleFromDisp( dispX, dispY ); + + // target + // + + if( isSegments ){ + dispX = endX - rs.segpts[ rs.segpts.length - 2 ]; + dispY = endY - rs.segpts[ rs.segpts.length - 1 ]; + } else if( isMultibezier || isCompound || isSelf || isBezier ){ + var pts = rs.allpts; + var l = pts.length; + var bX = math.qbezierAt( pts[l-6], pts[l-4], pts[l-2], 0.9 ); + var bY = math.qbezierAt( pts[l-5], pts[l-3], pts[l-1], 0.9 ); + + dispX = endX - bX; + dispY = endY - bY; + } else { + dispX = endX - midX; + dispY = endY - midY; + } + + rs.tgtArrowAngle = math.getAngleFromDisp( dispX, dispY ); +}; + +BRp.getArrowWidth = BRp.getArrowHeight = function( edgeWidth, scale ){ + var cache = this.arrowWidthCache = this.arrowWidthCache || {}; + + var cachedVal = cache[ edgeWidth + ', ' + scale ]; + if( cachedVal ){ + return cachedVal; + } + + cachedVal = Math.max( Math.pow( edgeWidth * 13.37, 0.9 ), 29 ) * scale; + cache[ edgeWidth + ', ' + scale ] = cachedVal; + + return cachedVal; +}; + +module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-control-points.js b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-control-points.js new file mode 100644 index 000000000..120aa860a --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-control-points.js @@ -0,0 +1,815 @@ +var math = require( '../../../../math' ); +var is = require( '../../../../is' ); + +var BRp = {}; + +BRp.findEdgeControlPoints = function( edges ){ + if( !edges || edges.length === 0 ){ return; } + + var r = this; + var cy = r.cy; + var hasCompounds = cy.hasCompoundNodes(); + var hashTable = {}; + var pairIds = []; + var haystackEdges = []; + + // create a table of edge (src, tgt) => list of edges between them + var pairId; + for( var i = 0; i < edges.length; i++ ){ + var edge = edges[ i ]; + var _p = edge._private; + var data = _p.data; + var curveStyle = edge.pstyle( 'curve-style' ).value; + var edgeIsUnbundled = curveStyle === 'unbundled-bezier' || curveStyle === 'segments'; + var edgeIsBezier = curveStyle === 'unbundled-bezier' || curveStyle === 'bezier'; + + // ignore edges who are not to be displayed + // they shouldn't take up space + if( edge.pstyle( 'display').value === 'none' ){ + continue; + } + + if( curveStyle === 'haystack' ){ + haystackEdges.push( edge ); + continue; + } + + var srcId = data.source; + var tgtId = data.target; + + pairId = srcId > tgtId ? + tgtId + '$-$' + srcId : + srcId + '$-$' + tgtId ; + + if( edgeIsUnbundled ){ + pairId = 'unbundled' + '$-$' + data.id; + } + + var tableEntry = hashTable[ pairId ]; + + if( tableEntry == null ){ + tableEntry = hashTable[ pairId ] = []; + pairIds.push( pairId ); + } + + tableEntry.push( edge ); + + if( edgeIsUnbundled ){ + tableEntry.hasUnbundled = true; + } + + if( edgeIsBezier ){ + tableEntry.hasBezier = true; + } + } + + var src, tgt, srcPos, tgtPos, srcW, srcH, tgtW, tgtH, srcShape, tgtShape; + var vectorNormInverse; + var badBezier; + + // for each pair (src, tgt), create the ctrl pts + // Nested for loop is OK; total number of iterations for both loops = edgeCount + for( var p = 0; p < pairIds.length; p++ ){ + pairId = pairIds[ p ]; + var pairEdges = hashTable[ pairId ]; + + // for each pair id, the edges should be sorted by index + pairEdges.sort( function( edge1, edge2 ){ + return edge1.poolIndex() - edge2.poolIndex(); + } ); + + src = pairEdges[0]._private.source; + tgt = pairEdges[0]._private.target; + + // make sure src/tgt distinction is consistent for bundled edges + if( !pairEdges.hasUnbundled && src.id() > tgt.id() ){ + var temp = src; + src = tgt; + tgt = temp; + } + + srcPos = src.position(); + tgtPos = tgt.position(); + + srcW = src.outerWidth(); + srcH = src.outerHeight(); + + tgtW = tgt.outerWidth(); + tgtH = tgt.outerHeight(); + + srcShape = r.nodeShapes[ this.getNodeShape( src ) ]; + tgtShape = r.nodeShapes[ this.getNodeShape( tgt ) ]; + + badBezier = false; + + var edge; + var edge_p; + var rs; + + var dirCounts = { + 'north': 0, + 'west': 0, + 'south': 0, + 'east': 0, + 'northwest': 0, + 'southwest': 0, + 'northeast': 0, + 'southeast': 0 + }; + + var srcX2 = srcPos.x; + var srcY2 = srcPos.y; + var srcW2 = srcW; + var srcH2 = srcH; + + var tgtX2 = tgtPos.x; + var tgtY2 = tgtPos.y; + var tgtW2 = tgtW; + var tgtH2 = tgtH; + + var numEdges2 = pairEdges.length; + + for( var i = 0; i < pairEdges.length; i++ ){ + edge = pairEdges[ i ]; + edge_p = edge._private; + rs = edge_p.rscratch; + + var edgeIndex1 = rs.lastEdgeIndex; + var edgeIndex2 = i; + + var numEdges1 = rs.lastNumEdges; + + var curveStyle = edge.pstyle( 'curve-style' ).value; + + var edgeIsUnbundled = curveStyle === 'unbundled-bezier' || curveStyle === 'segments'; + + // whether the normalised pair order is the reverse of the edge's src-tgt order + var edgeIsSwapped = src.id() !== edge.source().id(); + + var ctrlptDists = edge.pstyle( 'control-point-distances' ); + var loopDir = edge.pstyle('loop-direction').pfValue; + var loopSwp = edge.pstyle('loop-sweep').pfValue; + var ctrlptWs = edge.pstyle( 'control-point-weights' ); + var bezierN = ctrlptDists && ctrlptWs ? Math.min( ctrlptDists.value.length, ctrlptWs.value.length ) : 1; + var stepSize = edge.pstyle( 'control-point-step-size' ).pfValue; + var ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[0] : undefined; + var ctrlptWeight = ctrlptWs.value[0]; + var edgeDistances = edge.pstyle('edge-distances').value; + var srcDistFNode = edge.pstyle('source-distance-from-node').pfValue; + var tgtDistFNode = edge.pstyle('target-distance-from-node').pfValue; + var segmentWs = edge.pstyle( 'segment-weights' ); + var segmentDs = edge.pstyle( 'segment-distances' ); + var segmentsN = Math.min( segmentWs.pfValue.length, segmentDs.pfValue.length ); + var srcEndpt = edge.pstyle('source-endpoint').value; + var tgtEndpt = edge.pstyle('target-endpoint').value; + var srcArrShape = edge.pstyle('source-arrow-shape').value; + var tgtArrShape = edge.pstyle('target-arrow-shape').value; + var arrowScale = edge.pstyle('arrow-scale').value; + var lineWidth = edge.pstyle('width').pfValue; + + var srcX1 = rs.lastSrcCtlPtX; + var srcY1 = rs.lastSrcCtlPtY; + var srcW1 = rs.lastSrcCtlPtW; + var srcH1 = rs.lastSrcCtlPtH; + + var tgtX1 = rs.lastTgtCtlPtX; + var tgtY1 = rs.lastTgtCtlPtY; + var tgtW1 = rs.lastTgtCtlPtW; + var tgtH1 = rs.lastTgtCtlPtH; + + var curveStyle1 = rs.lastCurveStyle; + var curveStyle2 = curveStyle; + + var ctrlptDists1 = rs.lastCtrlptDists; + var ctrlptDists2 = ctrlptDists ? ctrlptDists.strValue : null; + + var ctrlptWs1 = rs.lastCtrlptWs; + var ctrlptWs2 = ctrlptWs.strValue; + + var segmentWs1 = rs.lastSegmentWs; + var segmentWs2 = segmentWs.strValue; + + var segmentDs1 = rs.lastSegmentDs; + var segmentDs2 = segmentDs.strValue; + + var stepSize1 = rs.lastStepSize; + var stepSize2 = stepSize; + + var loopDir1 = rs.lastLoopDir; + var loopDir2 = loopDir; + + var loopSwp1 = rs.lastLoopSwp; + var loopSwp2 = loopSwp; + + var edgeDistances1 = rs.lastEdgeDistances; + var edgeDistances2 = edgeDistances; + + var srcDistFNode1 = rs.lastSrcDistFNode; + var srcDistFNode2 = srcDistFNode; + + var tgtDistFNode1 = rs.lastTgtDistFNode; + var tgtDistFNode2 = tgtDistFNode; + + var srcEndpt1 = rs.lastSrcEndpt; + var srcEndpt2 = srcEndpt; + + var tgtEndpt1 = rs.lastTgtEndpt; + var tgtEndpt2 = tgtEndpt; + + var srcArr1 = rs.lastSrcArr; + var srcArr2 = srcArrShape; + + var tgtArr1 = rs.lastTgtArr; + var tgtArr2 = tgtArrShape; + + var lineW1 = rs.lastLineW; + var lineW2 = lineWidth; + + var arrScl1 = rs.lastArrScl; + var arrScl2 = arrowScale; + + if( badBezier ){ + rs.badBezier = true; + } else { + rs.badBezier = false; + } + + var ptCacheHit; + + if( srcX1 === srcX2 && srcY1 === srcY2 && srcW1 === srcW2 && srcH1 === srcH2 + && tgtX1 === tgtX2 && tgtY1 === tgtY2 && tgtW1 === tgtW2 && tgtH1 === tgtH2 + && curveStyle1 === curveStyle2 + && ctrlptDists1 === ctrlptDists2 + && ctrlptWs1 === ctrlptWs2 + && segmentWs1 === segmentWs2 + && segmentDs1 === segmentDs2 + && stepSize1 === stepSize2 + && loopDir1 === loopDir2 + && loopSwp1 === loopSwp2 + && edgeDistances1 === edgeDistances2 + && srcDistFNode1 === srcDistFNode2 + && tgtDistFNode1 === tgtDistFNode2 + && srcEndpt1 === srcEndpt2 + && tgtEndpt1 === tgtEndpt2 + && srcArr1 === srcArr2 + && tgtArr1 === tgtArr2 + && lineW1 === lineW2 + && arrScl1 === arrScl2 + && ((edgeIndex1 === edgeIndex2 && numEdges1 === numEdges2) || edgeIsUnbundled) ){ + ptCacheHit = true; // then the control points haven't changed and we can skip calculating them + } else { + ptCacheHit = false; + + rs.lastSrcCtlPtX = srcX2; + rs.lastSrcCtlPtY = srcY2; + rs.lastSrcCtlPtW = srcW2; + rs.lastSrcCtlPtH = srcH2; + rs.lastTgtCtlPtX = tgtX2; + rs.lastTgtCtlPtY = tgtY2; + rs.lastTgtCtlPtW = tgtW2; + rs.lastTgtCtlPtH = tgtH2; + rs.lastEdgeIndex = edgeIndex2; + rs.lastNumEdges = numEdges2; + rs.lastCurveStyle = curveStyle2; + rs.lastCtrlptDists = ctrlptDists2; + rs.lastCtrlptWs = ctrlptWs2; + rs.lastSegmentDs = segmentDs2; + rs.lastSegmentWs = segmentWs2; + rs.lastStepSize = stepSize2; + rs.lastLoopDir = loopDir2; + rs.lastLoopSwp = loopSwp2; + rs.lastEdgeDistances = edgeDistances2; + rs.lastSrcDistFNode = srcDistFNode2; + rs.lastTgtDistFNode = tgtDistFNode2; + rs.lastSrcEndpt = srcEndpt2; + rs.lastTgtEndpt = tgtEndpt2; + rs.lastSrcArr = srcArr2; + rs.lastTgtArr = tgtArr2; + rs.lastLineW = lineW2; + rs.lastArrScl = arrScl2; + } + + if( !ptCacheHit ){ + + if( !pairEdges.calculatedIntersection && src !== tgt && ( pairEdges.hasBezier || pairEdges.hasUnbundled ) ){ + + pairEdges.calculatedIntersection = true; + + // pt outside src shape to calc distance/displacement from src to tgt + var srcOutside = srcShape.intersectLine( + srcPos.x, + srcPos.y, + srcW, + srcH, + tgtPos.x, + tgtPos.y, + 0 + ); + + pairEdges.srcIntn = srcOutside; + + // pt outside tgt shape to calc distance/displacement from src to tgt + var tgtOutside = tgtShape.intersectLine( + tgtPos.x, + tgtPos.y, + tgtW, + tgtH, + srcPos.x, + srcPos.y, + 0 + ); + + pairEdges.tgtIntn = tgtOutside; + + var midptSrcPts = { + x1: srcOutside[0], + x2: tgtOutside[0], + y1: srcOutside[1], + y2: tgtOutside[1] + }; + + var posPts = { + x1: srcPos.x, + x2: tgtPos.x, + y1: srcPos.y, + y2: tgtPos.y + }; + + var dy = ( tgtOutside[1] - srcOutside[1] ); + var dx = ( tgtOutside[0] - srcOutside[0] ); + var l = Math.sqrt( dx * dx + dy * dy ); + + var vector = { + x: dx, + y: dy + }; + + var vectorNorm = { + x: vector.x / l, + y: vector.y / l + }; + vectorNormInverse = { + x: -vectorNorm.y, + y: vectorNorm.x + }; + + + // if node shapes overlap, then no ctrl pts to draw + if( + tgtShape.checkPoint( srcOutside[0], srcOutside[1], 0, tgtW, tgtH, tgtPos.x, tgtPos.y ) && + srcShape.checkPoint( tgtOutside[0], tgtOutside[1], 0, srcW, srcH, srcPos.x, srcPos.y ) + ){ + vectorNormInverse = {}; + badBezier = true; + } + + } + + if( !edgeIsSwapped ){ + rs.srcIntn = pairEdges.srcIntn; + rs.tgtIntn = pairEdges.tgtIntn; + } else { // ensure that the per-edge cached value for intersections are correct for swapped bundled edges + rs.srcIntn = pairEdges.tgtIntn; + rs.tgtIntn = pairEdges.srcIntn; + } + + if( src === tgt ){ + // Self-edge + + rs.edgeType = 'self'; + + var j = i; + var loopDist = stepSize; + + if( edgeIsUnbundled ){ + j = 0; + loopDist = ctrlptDist; + } + + var loopAngle = loopDir - Math.PI / 2; + var outAngle = loopAngle - loopSwp / 2; + var inAngle = loopAngle + loopSwp / 2; + + // increase by step size for overlapping loops, keyed on direction and sweep values + var dc = String(loopDir + '_' + loopSwp); + j = dirCounts[dc] === undefined ? dirCounts[dc] = 0 : ++dirCounts[dc]; + + rs.ctrlpts = [ + srcPos.x + Math.cos(outAngle) * 1.4 * loopDist * (j / 3 + 1), + srcPos.y + Math.sin(outAngle) * 1.4 * loopDist * (j / 3 + 1), + srcPos.x + Math.cos(inAngle) * 1.4 * loopDist * (j / 3 + 1), + srcPos.y + Math.sin(inAngle) * 1.4 * loopDist * (j / 3 + 1) + ]; + + } else if( + hasCompounds && + ( src.isParent() || src.isChild() || tgt.isParent() || tgt.isChild() ) && + ( src.parents().anySame( tgt ) || tgt.parents().anySame( src ) ) + ){ + // Compound edge + + rs.edgeType = 'compound'; + + // because the line approximation doesn't apply for compound beziers + // (loop/self edges are already elided b/c of cheap src==tgt check) + rs.badBezier = false; + + var j = i; + var loopDist = stepSize; + + if( edgeIsUnbundled ){ + j = 0; + loopDist = ctrlptDist; + } + + var loopW = 50; + + var loopaPos = { + x: srcPos.x - srcW / 2, + y: srcPos.y - srcH / 2 + }; + + var loopbPos = { + x: tgtPos.x - tgtW / 2, + y: tgtPos.y - tgtH / 2 + }; + + var loopPos = { + x: Math.min( loopaPos.x, loopbPos.x ), + y: Math.min( loopaPos.y, loopbPos.y ) + }; + + // avoids cases with impossible beziers + var minCompoundStretch = 0.5; + var compoundStretchA = Math.max( minCompoundStretch, Math.log( srcW * 0.01 ) ); + var compoundStretchB = Math.max( minCompoundStretch, Math.log( tgtW * 0.01 ) ); + + rs.ctrlpts = [ + loopPos.x, + loopPos.y - (1 + Math.pow( loopW, 1.12 ) / 100) * loopDist * (j / 3 + 1) * compoundStretchA, + + loopPos.x - (1 + Math.pow( loopW, 1.12 ) / 100) * loopDist * (j / 3 + 1) * compoundStretchB, + loopPos.y + ]; + + } else if( curveStyle === 'segments' ){ + // Segments (multiple straight lines) + + rs.edgeType = 'segments'; + rs.segpts = []; + + for( var s = 0; s < segmentsN; s++ ){ + var w = segmentWs.pfValue[ s ]; + var d = segmentDs.pfValue[ s ]; + + var w1 = 1 - w; + var w2 = w; + + var midptPts = edgeDistances === 'node-position' ? posPts : midptSrcPts; + + var adjustedMidpt = { + x: midptPts.x1 * w1 + midptPts.x2 * w2, + y: midptPts.y1 * w1 + midptPts.y2 * w2 + }; + + rs.segpts.push( + adjustedMidpt.x + vectorNormInverse.x * d, + adjustedMidpt.y + vectorNormInverse.y * d + ); + } + + // Straight edge + } else if( + pairEdges.length % 2 === 1 + && i === Math.floor( pairEdges.length / 2 ) + && !edgeIsUnbundled + ){ + + rs.edgeType = 'straight'; + + } else { + // (Multi)bezier + + var multi = edgeIsUnbundled; + + rs.edgeType = multi ? 'multibezier' : 'bezier'; + rs.ctrlpts = []; + + for( var b = 0; b < bezierN; b++ ){ + var normctrlptDist = (0.5 - pairEdges.length / 2 + i) * stepSize; + var manctrlptDist; + var sign = math.signum( normctrlptDist ); + + if( multi ){ + ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[ b ] : stepSize; // fall back on step size + ctrlptWeight = ctrlptWs.value[ b ]; + } + + if( edgeIsUnbundled ){ // multi or single unbundled + manctrlptDist = ctrlptDist; + } else { + manctrlptDist = ctrlptDist !== undefined ? sign * ctrlptDist : undefined; + } + + var distanceFromMidpoint = manctrlptDist !== undefined ? manctrlptDist : normctrlptDist; + + var w1 = 1 - ctrlptWeight; + var w2 = ctrlptWeight; + + if( edgeIsSwapped ){ + var temp = w1; + w1 = w2; + w2 = temp; + } + + var midptPts = edgeDistances === 'node-position' ? posPts : midptSrcPts; + + var adjustedMidpt = { + x: midptPts.x1 * w1 + midptPts.x2 * w2, + y: midptPts.y1 * w1 + midptPts.y2 * w2 + }; + + rs.ctrlpts.push( + adjustedMidpt.x + vectorNormInverse.x * distanceFromMidpoint, + adjustedMidpt.y + vectorNormInverse.y * distanceFromMidpoint + ); + } + + } + + // find endpts for edge + this.findEndpoints( edge ); + + var badStart = !is.number( rs.startX ) || !is.number( rs.startY ); + var badAStart = !is.number( rs.arrowStartX ) || !is.number( rs.arrowStartY ); + var badEnd = !is.number( rs.endX ) || !is.number( rs.endY ); + var badAEnd = !is.number( rs.arrowEndX ) || !is.number( rs.arrowEndY ); + + var minCpADistFactor = 3; + var arrowW = this.getArrowWidth( edge.pstyle( 'width' ).pfValue, edge.pstyle( 'arrow-scale' ).value ) + * this.arrowShapeWidth; + var minCpADist = minCpADistFactor * arrowW; + + if( rs.edgeType === 'bezier' ){ + var startACpDist = math.dist( { x: rs.ctrlpts[0], y: rs.ctrlpts[1] }, { x: rs.startX, y: rs.startY } ); + var closeStartACp = startACpDist < minCpADist; + var endACpDist = math.dist( { x: rs.ctrlpts[0], y: rs.ctrlpts[1] }, { x: rs.endX, y: rs.endY } ); + var closeEndACp = endACpDist < minCpADist; + + var overlapping = false; + + if( badStart || badAStart || closeStartACp ){ + overlapping = true; + + // project control point along line from src centre to outside the src shape + // (otherwise intersection will yield nothing) + var cpD = { // delta + x: rs.ctrlpts[0] - srcPos.x, + y: rs.ctrlpts[1] - srcPos.y + }; + var cpL = Math.sqrt( cpD.x * cpD.x + cpD.y * cpD.y ); // length of line + var cpM = { // normalised delta + x: cpD.x / cpL, + y: cpD.y / cpL + }; + var radius = Math.max( srcW, srcH ); + var cpProj = { // *2 radius guarantees outside shape + x: rs.ctrlpts[0] + cpM.x * 2 * radius, + y: rs.ctrlpts[1] + cpM.y * 2 * radius + }; + + var srcCtrlPtIntn = srcShape.intersectLine( + srcPos.x, + srcPos.y, + srcW, + srcH, + cpProj.x, + cpProj.y, + 0 + ); + + if( closeStartACp ){ + rs.ctrlpts[0] = rs.ctrlpts[0] + cpM.x * (minCpADist - startACpDist); + rs.ctrlpts[1] = rs.ctrlpts[1] + cpM.y * (minCpADist - startACpDist); + } else { + rs.ctrlpts[0] = srcCtrlPtIntn[0] + cpM.x * minCpADist; + rs.ctrlpts[1] = srcCtrlPtIntn[1] + cpM.y * minCpADist; + } + } + + if( badEnd || badAEnd || closeEndACp ){ + overlapping = true; + + // project control point along line from tgt centre to outside the tgt shape + // (otherwise intersection will yield nothing) + var cpD = { // delta + x: rs.ctrlpts[0] - tgtPos.x, + y: rs.ctrlpts[1] - tgtPos.y + }; + var cpL = Math.sqrt( cpD.x * cpD.x + cpD.y * cpD.y ); // length of line + var cpM = { // normalised delta + x: cpD.x / cpL, + y: cpD.y / cpL + }; + var radius = Math.max( srcW, srcH ); + var cpProj = { // *2 radius guarantees outside shape + x: rs.ctrlpts[0] + cpM.x * 2 * radius, + y: rs.ctrlpts[1] + cpM.y * 2 * radius + }; + + var tgtCtrlPtIntn = tgtShape.intersectLine( + tgtPos.x, + tgtPos.y, + tgtW, + tgtH, + cpProj.x, + cpProj.y, + 0 + ); + + if( closeEndACp ){ + rs.ctrlpts[0] = rs.ctrlpts[0] + cpM.x * (minCpADist - endACpDist); + rs.ctrlpts[1] = rs.ctrlpts[1] + cpM.y * (minCpADist - endACpDist); + } else { + rs.ctrlpts[0] = tgtCtrlPtIntn[0] + cpM.x * minCpADist; + rs.ctrlpts[1] = tgtCtrlPtIntn[1] + cpM.y * minCpADist; + } + + } + + if( overlapping ){ + // recalc endpts + this.findEndpoints( edge ); + } + + } + + if( rs.edgeType === 'multibezier' || rs.edgeType === 'bezier' || rs.edgeType === 'self' || rs.edgeType === 'compound' ){ + rs.allpts = []; + + rs.allpts.push( rs.startX, rs.startY ); + + for( var b = 0; b + 1 < rs.ctrlpts.length; b += 2 ){ + // ctrl pt itself + rs.allpts.push( rs.ctrlpts[ b ], rs.ctrlpts[ b + 1] ); + + // the midpt between ctrlpts as intermediate destination pts + if( b + 3 < rs.ctrlpts.length ){ + rs.allpts.push( (rs.ctrlpts[ b ] + rs.ctrlpts[ b + 2]) / 2, (rs.ctrlpts[ b + 1] + rs.ctrlpts[ b + 3]) / 2 ); + } + } + + rs.allpts.push( rs.endX, rs.endY ); + + var m, mt; + if( rs.ctrlpts.length / 2 % 2 === 0 ){ + m = rs.allpts.length / 2 - 1; + + rs.midX = rs.allpts[ m ]; + rs.midY = rs.allpts[ m + 1]; + } else { + m = rs.allpts.length / 2 - 3; + mt = 0.5; + + rs.midX = math.qbezierAt( rs.allpts[ m ], rs.allpts[ m + 2], rs.allpts[ m + 4], mt ); + rs.midY = math.qbezierAt( rs.allpts[ m + 1], rs.allpts[ m + 3], rs.allpts[ m + 5], mt ); + } + + } else if( rs.edgeType === 'straight' ){ + // need to calc these after endpts + rs.allpts = [ rs.startX, rs.startY, rs.endX, rs.endY ]; + + // default midpt for labels etc + rs.midX = ( rs.startX + rs.endX + rs.arrowStartX + rs.arrowEndX ) / 4; + rs.midY = ( rs.startY + rs.endY + rs.arrowStartY + rs.arrowEndY ) / 4; + + } else if( rs.edgeType === 'segments' ){ + rs.allpts = []; + rs.allpts.push( rs.startX, rs.startY ); + rs.allpts.push.apply( rs.allpts, rs.segpts ); + rs.allpts.push( rs.endX, rs.endY ); + + if( rs.segpts.length % 4 === 0 ){ + var i2 = rs.segpts.length / 2; + var i1 = i2 - 2; + + rs.midX = ( rs.segpts[ i1 ] + rs.segpts[ i2 ] ) / 2; + rs.midY = ( rs.segpts[ i1 + 1] + rs.segpts[ i2 + 1] ) / 2; + } else { + var i1 = rs.segpts.length / 2 - 1; + + rs.midX = rs.segpts[ i1 ]; + rs.midY = rs.segpts[ i1 + 1]; + } + + + } + + this.storeEdgeProjections( edge ); + this.calculateArrowAngles( edge ); + } // if point cache miss + + this.recalculateEdgeLabelProjections( edge ); + this.calculateLabelAngles( edge ); + + } // for pair edges + } // for pair ids + + for( var i = 0; i < haystackEdges.length; i++ ){ + var edge = haystackEdges[ i ]; + var _p = edge._private; + var rscratch = _p.rscratch; + var rs = rscratch; + + if( !rscratch.haystack ){ + var angle = Math.random() * 2 * Math.PI; + + rscratch.source = { + x: Math.cos( angle ), + y: Math.sin( angle ) + }; + + var angle = Math.random() * 2 * Math.PI; + + rscratch.target = { + x: Math.cos( angle ), + y: Math.sin( angle ) + }; + + } + + var src = _p.source; + var tgt = _p.target; + var srcPos = src.position(); + var tgtPos = tgt.position(); + var srcW = src.width(); + var tgtW = tgt.width(); + var srcH = src.height(); + var tgtH = tgt.height(); + var radius = edge.pstyle( 'haystack-radius' ).value; + var halfRadius = radius / 2; // b/c have to half width/height + + rs.haystackPts = rs.allpts = [ + rs.source.x * srcW * halfRadius + srcPos.x, + rs.source.y * srcH * halfRadius + srcPos.y, + rs.target.x * tgtW * halfRadius + tgtPos.x, + rs.target.y * tgtH * halfRadius + tgtPos.y + ]; + + rs.midX = (rs.allpts[0] + rs.allpts[2]) / 2; + rs.midY = (rs.allpts[1] + rs.allpts[3]) / 2; + + // always override as haystack in case set to different type previously + rscratch.edgeType = rscratch.lastCurveStyle = 'haystack'; + rscratch.haystack = true; + + this.storeEdgeProjections( edge ); + this.calculateArrowAngles( edge ); + this.recalculateEdgeLabelProjections( edge ); + this.calculateLabelAngles( edge ); + } +}; + +function getPts( pts ){ + let retPts = []; + + if( pts == null ){ return; } + + for( let i = 0; i < pts.length; i += 2 ){ + let x = pts[i]; + let y = pts[i+1]; + + retPts.push({ x, y }); + } + + return retPts; +} + +BRp.getSegmentPoints = function( edge ){ + let rs = edge[0]._private.rscratch; + let type = rs.edgeType; + + if( type === 'segments' ){ + return getPts( rs.segpts ); + } +}; + +BRp.getControlPoints = function( edge ){ + let rs = edge[0]._private.rscratch; + let type = rs.edgeType; + + if( type === 'bezier' || type === 'multibezier' || type === 'self' || type === 'compound' ){ + return getPts( rs.ctrlpts ); + } +}; + +BRp.getEdgeMidpoint = function( edge ){ + let rs = edge[0]._private.rscratch; + + return { + x: rs.midX, + y: rs.midY + }; +}; + +module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-endpoints.js b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-endpoints.js new file mode 100644 index 000000000..32a21f4e8 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-endpoints.js @@ -0,0 +1,229 @@ +let math = require( '../../../../math' ); +let is = require( '../../../../is' ); + +let BRp = {}; + +BRp.manualEndptToPx = function( node, prop ){ + let r = this; + let npos = node.position(); + let w = node.outerWidth(); + let h = node.outerHeight(); + + if( prop.value.length === 2 ){ + let p = [ + prop.pfValue[0], + prop.pfValue[1] + ]; + + if( prop.units[0] === '%' ){ + p[0] = p[0] * w; + } + + if( prop.units[1] === '%' ){ + p[1] = p[1] * h; + } + + p[0] += npos.x; + p[1] += npos.y; + + return p; + } else { + let angle = prop.pfValue[0]; + + angle = -Math.PI / 2 + angle; // start at 12 o'clock + + let l = 2 * Math.max( w, h ); + + let p = [ + npos.x + Math.cos( angle ) * l, + npos.y + Math.sin( angle ) * l + ]; + + return r.nodeShapes[ this.getNodeShape( node ) ].intersectLine( + npos.x, npos.y, + w, h, + p[0], p[1], + 0 + ); + } +}; + +BRp.findEndpoints = function( edge ){ + let r = this; + let intersect; + + let source = edge.source()[0]; + let target = edge.target()[0]; + + let srcPos = source.position(); + let tgtPos = target.position(); + + let tgtArShape = edge.pstyle( 'target-arrow-shape' ).value; + let srcArShape = edge.pstyle( 'source-arrow-shape' ).value; + + let tgtDist = edge.pstyle( 'target-distance-from-node' ).pfValue; + let srcDist = edge.pstyle( 'source-distance-from-node' ).pfValue; + + let rs = edge._private.rscratch; + + let et = rs.edgeType; + let self = et === 'self' || et === 'compound'; + let bezier = et === 'bezier' || et === 'multibezier' || self; + let multi = et !== 'bezier'; + let lines = et === 'straight' || et === 'segments'; + let segments = et === 'segments'; + let hasEndpts = bezier || multi || lines; + let srcManEndpt = edge.pstyle('source-endpoint'); + let srcManEndptVal = self ? 'outside-to-node' : srcManEndpt.value; + let tgtManEndpt = edge.pstyle('target-endpoint'); + let tgtManEndptVal = self ? 'outside-to-node' : tgtManEndpt.value; + + rs.srcManEndpt = srcManEndpt; + rs.tgtManEndpt = tgtManEndpt; + + let p1; // last known point of edge on target side + let p2; // last known point of edge on source side + + let p1_i; // point to intersect with target shape + let p2_i; // point to intersect with source shape + + if( bezier ){ + let cpStart = [ rs.ctrlpts[0], rs.ctrlpts[1] ]; + let cpEnd = multi ? [ rs.ctrlpts[ rs.ctrlpts.length - 2], rs.ctrlpts[ rs.ctrlpts.length - 1] ] : cpStart; + + p1 = cpEnd; + p2 = cpStart; + } else if( lines ){ + let srcArrowFromPt = !segments ? [ tgtPos.x, tgtPos.y ] : rs.segpts.slice( 0, 2 ); + let tgtArrowFromPt = !segments ? [ srcPos.x, srcPos.y ] : rs.segpts.slice( rs.segpts.length - 2 ); + + p1 = tgtArrowFromPt; + p2 = srcArrowFromPt; + } + + if( tgtManEndptVal === 'inside-to-node' ){ + intersect = [ tgtPos.x, tgtPos.y ]; + } else if( tgtManEndpt.units ){ + intersect = this.manualEndptToPx( target, tgtManEndpt ); + } else if( tgtManEndptVal === 'outside-to-line' ){ + intersect = rs.tgtIntn; // use cached value from ctrlpt calc + } else { + if( tgtManEndptVal === 'outside-to-node' ){ + p1_i = p1; + } else if( tgtManEndptVal === 'outside-to-line' ){ + p1_i = [ srcPos.x, srcPos.y ]; + } + + intersect = r.nodeShapes[ this.getNodeShape( target ) ].intersectLine( + tgtPos.x, + tgtPos.y, + target.outerWidth(), + target.outerHeight(), + p1_i[0], + p1_i[1], + 0 + ); + } + + let arrowEnd = math.shortenIntersection( + intersect, + p1, + r.arrowShapes[ tgtArShape ].spacing( edge ) + tgtDist + ); + let edgeEnd = math.shortenIntersection( + intersect, + p1, + r.arrowShapes[ tgtArShape ].gap( edge ) + tgtDist + ); + + rs.endX = edgeEnd[0]; + rs.endY = edgeEnd[1]; + + rs.arrowEndX = arrowEnd[0]; + rs.arrowEndY = arrowEnd[1]; + + if( srcManEndptVal === 'inside-to-node' ){ + intersect = [ srcPos.x, srcPos.y ]; + } else if( srcManEndpt.units ){ + intersect = this.manualEndptToPx( source, srcManEndpt ); + } else if( srcManEndptVal === 'outside-to-line' ){ + intersect = rs.srcIntn; // use cached value from ctrlpt calc + } else { + if( srcManEndptVal === 'outside-to-node' ){ + p2_i = p2; + } else if( srcManEndptVal === 'outside-to-line' ){ + p2_i = [ tgtPos.x, tgtPos.y ]; + } + + intersect = r.nodeShapes[ this.getNodeShape( source ) ].intersectLine( + srcPos.x, + srcPos.y, + source.outerWidth(), + source.outerHeight(), + p2_i[0], + p2_i[1], + 0 + ); + } + + let arrowStart = math.shortenIntersection( + intersect, + p2, + r.arrowShapes[ srcArShape ].spacing( edge ) + srcDist + ); + let edgeStart = math.shortenIntersection( + intersect, + p2, + r.arrowShapes[ srcArShape ].gap( edge ) + srcDist + ); + + rs.startX = edgeStart[0]; + rs.startY = edgeStart[1]; + + rs.arrowStartX = arrowStart[0]; + rs.arrowStartY = arrowStart[1]; + + if( hasEndpts ){ + if( !is.number( rs.startX ) || !is.number( rs.startY ) || !is.number( rs.endX ) || !is.number( rs.endY ) ){ + rs.badLine = true; + } else { + rs.badLine = false; + } + } +}; + +BRp.getSourceEndpoint = function( edge ){ + let rs = edge[0]._private.rscratch; + + switch( rs.edgeType ){ + case 'haystack': + return { + x: rs.haystackPts[0], + y: rs.haystackPts[1] + }; + default: + return { + x: rs.arrowStartX, + y: rs.arrowStartY + }; + } +}; + +BRp.getTargetEndpoint = function( edge ){ + let rs = edge[0]._private.rscratch; + + switch( rs.edgeType ){ + case 'haystack': + return { + x: rs.haystackPts[2], + y: rs.haystackPts[3] + }; + default: + return { + x: rs.arrowEndX, + y: rs.arrowEndY + }; + } +}; + +module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-projection.js b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-projection.js new file mode 100644 index 000000000..2f4e4ed7e --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-projection.js @@ -0,0 +1,62 @@ +var math = require( '../../../../math' ); + +var BRp = {}; + +function pushBezierPts( r, edge, pts ){ + var qbezierAt = function( p1, p2, p3, t ){ return math.qbezierAt( p1, p2, p3, t ); }; + var _p = edge._private; + var bpts = _p.rstyle.bezierPts; + + for( var i = 0; i < r.bezierProjPcts.length; i++ ){ + var p = r.bezierProjPcts[i]; + + bpts.push( { + x: qbezierAt( pts[0], pts[2], pts[4], p ), + y: qbezierAt( pts[1], pts[3], pts[5], p ) + } ); + } +} + +BRp.storeEdgeProjections = function( edge ){ + var _p = edge._private; + var rs = _p.rscratch; + var et = rs.edgeType; + + // clear the cached points state + _p.rstyle.bezierPts = null; + _p.rstyle.linePts = null; + _p.rstyle.haystackPts = null; + + if( et === 'multibezier' || et === 'bezier' || et === 'self' || et === 'compound' ){ + var bpts = _p.rstyle.bezierPts = []; // jshint ignore:line + + for( var i = 0; i + 5 < rs.allpts.length; i += 4 ){ + pushBezierPts( this, edge, rs.allpts.slice( i, i + 6 ) ); + } + } else if( et === 'segments' ){ + var lpts = _p.rstyle.linePts = []; + + for( var i = 0; i + 1 < rs.allpts.length; i += 2 ){ + lpts.push( { + x: rs.allpts[ i ], + y: rs.allpts[ i + 1] + } ); + } + } else if( et === 'haystack' ){ + var hpts = rs.haystackPts; + + _p.rstyle.haystackPts = [ + { x: hpts[0], y: hpts[1] }, + { x: hpts[2], y: hpts[3] } + ]; + } + + _p.rstyle.arrowWidth = this.getArrowWidth( edge.pstyle('width').pfValue, edge.pstyle( 'arrow-scale' ).value ) + * this.arrowShapeWidth; +}; + +BRp.recalculateEdgeProjections = function( edges ){ + this.findEdgeControlPoints( edges ); +}; + +module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/index.js b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/index.js new file mode 100644 index 000000000..71e535885 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/index.js @@ -0,0 +1,19 @@ +var util = require('../../../../util'); + +var BRp = {}; + +[ + require('./coords'), + require('./edge-arrows'), + require('./edge-control-points'), + require('./edge-endpoints'), + require('./edge-projection'), + require('./labels'), + require('./nodes'), + require('./rendered-style'), + require('./z-ordering') +].forEach(function( props ){ + util.extend( BRp, props ); +}); + +module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/labels.js b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/labels.js new file mode 100644 index 000000000..39818ad9e --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/labels.js @@ -0,0 +1,499 @@ +var math = require( '../../../../math' ); +var is = require( '../../../../is' ); +var util = require( '../../../../util' ); + +var BRp = {}; + +BRp.recalculateNodeLabelProjection = function( node ){ + var content = node.pstyle( 'label' ).strValue; + + if( is.emptyString(content) ){ return; } + + var textX, textY; + var _p = node._private; + var nodeWidth = node.width(); + var nodeHeight = node.height(); + var padding = node.padding(); + var nodePos = node.position(); + var textHalign = node.pstyle( 'text-halign' ).strValue; + var textValign = node.pstyle( 'text-valign' ).strValue; + var rs = _p.rscratch; + var rstyle = _p.rstyle; + + switch( textHalign ){ + case 'left': + textX = nodePos.x - nodeWidth / 2 - padding; + break; + + case 'right': + textX = nodePos.x + nodeWidth / 2 + padding; + break; + + default: // e.g. center + textX = nodePos.x; + } + + switch( textValign ){ + case 'top': + textY = nodePos.y - nodeHeight / 2 - padding; + break; + + case 'bottom': + textY = nodePos.y + nodeHeight / 2 + padding; + break; + + default: // e.g. middle + textY = nodePos.y; + } + + rs.labelX = textX; + rs.labelY = textY; + rstyle.labelX = textX; + rstyle.labelY = textY; + + this.applyLabelDimensions( node ); +}; + +var lineAngleFromDelta = function( dx, dy ){ + var angle = Math.atan( dy / dx ); + + if( dx === 0 && angle < 0 ){ + angle = angle * -1; + } + + return angle; +}; + +var lineAngle = function( p0, p1 ){ + var dx = p1.x - p0.x; + var dy = p1.y - p0.y; + + return lineAngleFromDelta( dx, dy ); +}; + +var bezierAngle = function( p0, p1, p2, t ){ + var t0 = math.bound( 0, t - 0.001, 1 ); + var t1 = math.bound( 0, t + 0.001, 1 ); + + var lp0 = math.qbezierPtAt( p0, p1, p2, t0 ); + var lp1 = math.qbezierPtAt( p0, p1, p2, t1 ); + + return lineAngle( lp0, lp1 ); +}; + +BRp.recalculateEdgeLabelProjections = function( edge ){ + var p; + var _p = edge._private; + var rs = _p.rscratch; + var r = this; + var content = { + mid: edge.pstyle('label').strValue, + source: edge.pstyle('source-label').strValue, + target: edge.pstyle('target-label').strValue + }; + + if( content.mid || content.source || content.target ){ + // then we have to calculate... + } else { + return; // no labels => no calcs + } + + // add center point to style so bounding box calculations can use it + // + p = { + x: rs.midX, + y: rs.midY + }; + + var setRs = function( propName, prefix, value ){ + util.setPrefixedProperty( _p.rscratch, propName, prefix, value ); + util.setPrefixedProperty( _p.rstyle, propName, prefix, value ); + }; + + setRs( 'labelX', null, p.x ); + setRs( 'labelY', null, p.y ); + + var midAngle = lineAngleFromDelta(rs.midDispX, rs.midDispY); + setRs( 'labelAutoAngle', null, midAngle ); + + var createControlPointInfo = function(){ + if( createControlPointInfo.cache ){ return createControlPointInfo.cache; } // use cache so only 1x per edge + + var ctrlpts = []; + + // store each ctrlpt info init + for( var i = 0; i + 5 < rs.allpts.length; i += 4 ){ + var p0 = { x: rs.allpts[i], y: rs.allpts[i+1] }; + var p1 = { x: rs.allpts[i+2], y: rs.allpts[i+3] }; // ctrlpt + var p2 = { x: rs.allpts[i+4], y: rs.allpts[i+5] }; + + ctrlpts.push({ + p0: p0, + p1: p1, + p2: p2, + startDist: 0, + length: 0, + segments: [] + }); + } + + var bpts = _p.rstyle.bezierPts; + var nProjs = r.bezierProjPcts.length; + + function addSegment( cp, p0, p1, t0, t1 ){ + var length = math.dist( p0, p1 ); + var prevSegment = cp.segments[ cp.segments.length - 1 ]; + var segment = { + p0: p0, + p1: p1, + t0: t0, + t1: t1, + startDist: prevSegment ? prevSegment.startDist + prevSegment.length : 0, + length: length + }; + + cp.segments.push( segment ); + + cp.length += length; + } + + // update each ctrlpt with segment info + for( var i = 0; i < ctrlpts.length; i++ ){ + var cp = ctrlpts[i]; + var prevCp = ctrlpts[i - 1]; + + if( prevCp ){ + cp.startDist = prevCp.startDist + prevCp.length; + } + + addSegment( + cp, + cp.p0, bpts[ i * nProjs ], + 0, r.bezierProjPcts[ 0 ] + ); // first + + for( var j = 0; j < nProjs - 1; j++ ){ + addSegment( + cp, + bpts[ i * nProjs + j ], bpts[ i * nProjs + j + 1 ], + r.bezierProjPcts[ j ], r.bezierProjPcts[ j + 1 ] + ); + } + + addSegment( + cp, + bpts[ i * nProjs + nProjs - 1 ], cp.p2, + r.bezierProjPcts[ nProjs - 1 ], 1 + ); // last + } + + return ( createControlPointInfo.cache = ctrlpts ); + }; + + var calculateEndProjection = function( prefix ){ + var angle; + var isSrc = prefix === 'source'; + + if( !content[ prefix ] ){ return; } + + var offset = edge.pstyle(prefix+'-text-offset').pfValue; + + switch( rs.edgeType ){ + case 'self': + case 'compound': + case 'bezier': + case 'multibezier': + var cps = createControlPointInfo(); + var selected; + var startDist = 0; + var totalDist = 0; + + // find the segment we're on + for( var i = 0; i < cps.length; i++ ){ + var cp = cps[ isSrc ? i : cps.length - 1 - i ]; + + for( var j = 0; j < cp.segments.length; j++ ){ + var seg = cp.segments[ isSrc ? j : cp.segments.length - 1 - j ]; + var lastSeg = i === cps.length - 1 && j === cp.segments.length - 1; + + startDist = totalDist; + totalDist += seg.length; + + if( totalDist >= offset || lastSeg ){ + selected = { cp: cp, segment: seg }; + break; + } + } + + if( selected ){ break; } + } + + var cp = selected.cp; + var seg = selected.segment; + var tSegment = ( offset - startDist ) / ( seg.length ); + var segDt = seg.t1 - seg.t0; + var t = isSrc ? seg.t0 + segDt * tSegment : seg.t1 - segDt * tSegment; + + t = math.bound( 0, t, 1 ); + p = math.qbezierPtAt( cp.p0, cp.p1, cp.p2, t ); + angle = bezierAngle( cp.p0, cp.p1, cp.p2, t, p ); + + break; + + case 'straight': + case 'segments': + case 'haystack': + var d = 0, di, d0; + var p0, p1; + var l = rs.allpts.length; + + for( var i = 0; i + 3 < l; i += 2 ){ + if( isSrc ){ + p0 = { x: rs.allpts[i], y: rs.allpts[i+1] }; + p1 = { x: rs.allpts[i+2], y: rs.allpts[i+3] }; + } else { + p0 = { x: rs.allpts[l-2-i], y: rs.allpts[l-1-i] }; + p1 = { x: rs.allpts[l-4-i], y: rs.allpts[l-3-i] }; + } + + di = math.dist( p0, p1 ); + d0 = d; + d += di; + + if( d >= offset ){ break; } + } + + var pD = offset - d0; + var t = pD / di; + + t = math.bound( 0, t, 1 ); + p = math.lineAt( p0, p1, t ); + angle = lineAngle( p0, p1 ); + + break; + } + + setRs( 'labelX', prefix, p.x ); + setRs( 'labelY', prefix, p.y ); + setRs( 'labelAutoAngle', prefix, angle ); + }; + + calculateEndProjection( 'source' ); + calculateEndProjection( 'target' ); + + this.applyLabelDimensions( edge ); +}; + +BRp.applyLabelDimensions = function( ele ){ + this.applyPrefixedLabelDimensions( ele ); + + if( ele.isEdge() ){ + this.applyPrefixedLabelDimensions( ele, 'source' ); + this.applyPrefixedLabelDimensions( ele, 'target' ); + } +}; + +BRp.applyPrefixedLabelDimensions = function( ele, prefix ){ + var _p = ele._private; + + var text = this.getLabelText( ele, prefix ); + var labelDims = this.calculateLabelDimensions( ele, text ); + + util.setPrefixedProperty( _p.rstyle, 'labelWidth', prefix, labelDims.width ); + util.setPrefixedProperty( _p.rscratch, 'labelWidth', prefix, labelDims.width ); + + util.setPrefixedProperty( _p.rstyle, 'labelHeight', prefix, labelDims.height ); + util.setPrefixedProperty( _p.rscratch, 'labelHeight', prefix, labelDims.height ); +}; + +BRp.getLabelText = function( ele, prefix ){ + var _p = ele._private; + var pfd = prefix ? prefix + '-' : ''; + var text = ele.pstyle( pfd + 'label' ).strValue; + var textTransform = ele.pstyle( 'text-transform' ).value; + var rscratch = function( propName, value ){ + if( value ){ + util.setPrefixedProperty( _p.rscratch, propName, prefix, value ); + return value; + } else { + return util.getPrefixedProperty( _p.rscratch, propName, prefix ); + } + }; + + // for empty text, skip all processing + if( !text ){ return ''; } + + if( textTransform == 'none' ){ + // passthrough + } else if( textTransform == 'uppercase' ){ + text = text.toUpperCase(); + } else if( textTransform == 'lowercase' ){ + text = text.toLowerCase(); + } + + var wrapStyle = ele.pstyle( 'text-wrap' ).value; + + if( wrapStyle === 'wrap' ){ + //console.log('wrap'); + + var labelKey = rscratch( 'labelKey' ); + + // save recalc if the label is the same as before + if( labelKey && rscratch( 'labelWrapKey' ) === labelKey ){ + // console.log('wrap cache hit'); + return rscratch( 'labelWrapCachedText' ); + } + // console.log('wrap cache miss'); + + var lines = text.split( '\n' ); + var maxW = ele.pstyle( 'text-max-width' ).pfValue; + var wrappedLines = []; + + for( var l = 0; l < lines.length; l++ ){ + var line = lines[ l ]; + var lineDims = this.calculateLabelDimensions( ele, line, 'line=' + line ); + var lineW = lineDims.width; + + if( lineW > maxW ){ // line is too long + var words = line.split( /\s+/ ); // NB: assume collapsed whitespace into single space + var subline = ''; + + for( var w = 0; w < words.length; w++ ){ + var word = words[ w ]; + var testLine = subline.length === 0 ? word : subline + ' ' + word; + var testDims = this.calculateLabelDimensions( ele, testLine, 'testLine=' + testLine ); + var testW = testDims.width; + + if( testW <= maxW ){ // word fits on current line + subline += word + ' '; + } else { // word starts new line + wrappedLines.push( subline ); + subline = word + ' '; + } + } + + // if there's remaining text, put it in a wrapped line + if( !subline.match( /^\s+$/ ) ){ + wrappedLines.push( subline ); + } + } else { // line is already short enough + wrappedLines.push( line ); + } + } // for + + rscratch( 'labelWrapCachedLines', wrappedLines ); + text = rscratch( 'labelWrapCachedText', wrappedLines.join( '\n' ) ); + rscratch( 'labelWrapKey', labelKey ); + + // console.log(text) + } else if( wrapStyle === 'ellipsis' ){ + var maxW = ele.pstyle( 'text-max-width' ).pfValue; + var ellipsized = ''; + var ellipsis = '\u2026'; + var incLastCh = false; + + for( var i = 0; i < text.length; i++ ){ + var widthWithNextCh = this.calculateLabelDimensions( ele, ellipsized + text[i] + ellipsis ).width; + + if( widthWithNextCh > maxW ){ break; } + + ellipsized += text[i]; + + if( i === text.length - 1 ){ incLastCh = true; } + } + + if( !incLastCh ){ + ellipsized += ellipsis; + } + + return ellipsized; + } // if ellipsize + + return text; +}; + +BRp.calculateLabelDimensions = function( ele, text, extraKey ){ + var r = this; + + var cacheKey = ele._private.labelStyleKey + '$@$' + text; + + if( extraKey ){ + cacheKey += '$@$' + extraKey; + } + + var cache = r.labelDimCache || (r.labelDimCache = {}); + + if( cache[ cacheKey ] ){ + return cache[ cacheKey ]; + } + + var sizeMult = 1; // increase the scale to increase accuracy w.r.t. zoomed text + var fStyle = ele.pstyle( 'font-style' ).strValue; + var size = ( sizeMult * ele.pstyle( 'font-size' ).pfValue ) + 'px'; + var family = ele.pstyle( 'font-family' ).strValue; + var weight = ele.pstyle( 'font-weight' ).strValue; + + var div = this.labelCalcDiv; + + if( !div ){ + div = this.labelCalcDiv = document.createElement( 'div' ); // eslint-disable-line no-undef + document.body.appendChild( div ); // eslint-disable-line no-undef + } + + var ds = div.style; + + // from ele style + ds.fontFamily = family; + ds.fontStyle = fStyle; + ds.fontSize = size; + ds.fontWeight = weight; + + // forced style + ds.position = 'absolute'; + ds.left = '-9999px'; + ds.top = '-9999px'; + ds.zIndex = '-1'; + ds.visibility = 'hidden'; + ds.pointerEvents = 'none'; + ds.padding = '0'; + ds.lineHeight = '1'; + + if( ele.pstyle( 'text-wrap' ).value === 'wrap' ){ + ds.whiteSpace = 'pre'; // so newlines are taken into account + } else { + ds.whiteSpace = 'normal'; + } + + // put label content in div + div.textContent = text; + + cache[ cacheKey ] = { + width: Math.ceil( div.clientWidth / sizeMult ), + height: Math.ceil( div.clientHeight / sizeMult ) + }; + + return cache[ cacheKey ]; +}; + + +BRp.calculateLabelAngles = function( ele ){ + var _p = ele._private; + var rs = _p.rscratch; + var isEdge = ele.isEdge(); + var rot = ele.pstyle( 'text-rotation' ); + var rotStr = rot.strValue; + + if( rotStr === 'none' ){ + rs.labelAngle = rs.sourceLabelAngle = rs.targetLabelAngle = 0; + } else if( isEdge && rotStr === 'autorotate' ){ + rs.labelAngle = rs.labelAutoAngle; + rs.sourceLabelAngle = rs.sourceLabelAutoAngle; + rs.targetLabelAngle = rs.targetLabelAutoAngle; + } else if( rotStr === 'autorotate' ){ + rs.labelAngle = rs.sourceLabelAngle = rs.targetLabelAngle = 0; + } else { + rs.labelAngle = rs.sourceLabelAngle = rs.targetLabelAngle = rot.pfValue; + } +}; + +module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/nodes.js b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/nodes.js new file mode 100644 index 000000000..046598c24 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/nodes.js @@ -0,0 +1,27 @@ +var BRp = {}; + +BRp.getNodeShape = function( node ){ + var r = this; + var shape = node.pstyle( 'shape' ).value; + + if( node.isParent() ){ + if( shape === 'rectangle' + || shape === 'roundrectangle' + || shape === 'cutrectangle' + || shape === 'barrel' ){ + return shape; + } else { + return 'rectangle'; + } + } + + if( shape === 'polygon' ){ + var points = node.pstyle( 'shape-polygon-points' ).value; + + return r.nodeShapes.makePolygon( points ).name; + } + + return shape; +}; + +module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/rendered-style.js b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/rendered-style.js new file mode 100644 index 000000000..870edef8b --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/rendered-style.js @@ -0,0 +1,182 @@ +var BRp = {}; + +BRp.registerCalculationListeners = function(){ + var cy = this.cy; + var elesToUpdate = cy.collection(); + var r = this; + + var enqueue = function( eles, e, dirtyStyleCaches = true ){ + elesToUpdate.merge( eles ); + + for( var i = 0; i < eles.length; i++ ){ + var ele = eles[i]; + var _p = ele._private; + var rstyle = _p.rstyle; + + if( dirtyStyleCaches ){ + rstyle.clean = false; + _p.bbCache = null; + } + + var evts = rstyle.dirtyEvents = rstyle.dirtyEvents || { length: 0 }; + + if( !evts[ e.type ] ){ + evts[ e.type ] = true; + evts.length++; + } + } + }; + + r.binder( cy ) + // nodes + + .on('position.* style.* free.* bounds.*', 'node', function onDirtyModNode( e ){ + var node = e.target; + + enqueue( node, e ); + enqueue( node.connectedEdges(), e ); + }) + + .on('add.*', 'node', function onDirtyAddNode( e ){ + var ele = e.target; + + enqueue( ele, e ); + }) + + .on('background.*', 'node', function onDirtyBgNode( e ){ + var ele = e.target; + + enqueue( ele, e, false ); + }) + + // edges + + .on('add.* style.*', 'edge', function onDirtyEdge( e ){ + var edge = e.target; + + enqueue( edge, e ); + enqueue( edge.parallelEdges(), e ); + }) + + .on('remove.*', 'edge', function onDirtyRemoveEdge( e ){ + var edge = e.target; + var pEdges = edge.parallelEdges(); + + for( var i = 0; i < pEdges.length; i++ ){ + var pEdge = pEdges[i]; + + if( !pEdge.removed() ){ + enqueue( pEdge, e ); + } + } + }) + + // manual dirtying + + .on('dirty.*', 'node', function onDirtyEle( e ){ + var ele = e.target; + + enqueue( ele, e ); + }) + ; + + var updateEleCalcs = function( willDraw ){ + if( willDraw ){ + var fns = r.onUpdateEleCalcsFns; + + if( fns ){ for( var i = 0; i < fns.length; i++ ){ + var fn = fns[i]; + + fn( willDraw, elesToUpdate ); + } } + + r.recalculateRenderedStyle( elesToUpdate, false ); + + for( var i = 0; i < elesToUpdate.length; i++ ){ + elesToUpdate[i]._private.rstyle.dirtyEvents = null; + } + + elesToUpdate = cy.collection(); + } + }; + + r.beforeRender( updateEleCalcs, r.beforeRenderPriorities.eleCalcs ); +}; + +BRp.onUpdateEleCalcs = function( fn ){ + var fns = this.onUpdateEleCalcsFns = this.onUpdateEleCalcsFns || []; + + fns.push( fn ); +}; + +BRp.recalculateRenderedStyle = function( eles, useCache ){ + var edges = []; + var nodes = []; + + // the renderer can't be used for calcs when destroyed, e.g. ele.boundingBox() + if( this.destroyed ){ return; } + + // use cache by default for perf + if( useCache === undefined ){ useCache = true; } + + for( var i = 0; i < eles.length; i++ ){ + var ele = eles[ i ]; + var _p = ele._private; + var rstyle = _p.rstyle; + + // only update if dirty and in graph + if( (useCache && rstyle.clean) || ele.removed() ){ continue; } + + // only update if not display: none + if( ele.pstyle('display').value === 'none' ){ continue; } + + if( _p.group === 'nodes' ){ + nodes.push( ele ); + } else { // edges + edges.push( ele ); + } + + rstyle.clean = true; + // rstyle.dirtyEvents = null; + } + + // update node data from projections + for( var i = 0; i < nodes.length; i++ ){ + var ele = nodes[i]; + var _p = ele._private; + var rstyle = _p.rstyle; + var pos = ele.position(); + + this.recalculateNodeLabelProjection( ele ); + + rstyle.nodeX = pos.x; + rstyle.nodeY = pos.y; + rstyle.nodeW = ele.pstyle( 'width' ).pfValue; + rstyle.nodeH = ele.pstyle( 'height' ).pfValue; + } + + this.recalculateEdgeProjections( edges ); + + // update edge data from projections + for( var i = 0; i < edges.length; i++ ){ + var ele = edges[ i ]; + var _p = ele._private; + var rstyle = _p.rstyle; + var rs = _p.rscratch; + + this.recalculateEdgeLabelProjections( ele ); + + // update rstyle positions + rstyle.srcX = rs.arrowStartX; + rstyle.srcY = rs.arrowStartY; + rstyle.tgtX = rs.arrowEndX; + rstyle.tgtY = rs.arrowEndY; + rstyle.midX = rs.midX; + rstyle.midY = rs.midY; + rstyle.labelAngle = rs.labelAngle; + rstyle.sourceLabelAngle = rs.sourceLabelAngle; + rstyle.targetLabelAngle = rs.targetLabelAngle; + } +}; + +module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/z-ordering.js b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/z-ordering.js new file mode 100644 index 000000000..9c66bceaa --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/z-ordering.js @@ -0,0 +1,65 @@ +var zIndexSort = require( '../../../../collection/zsort' ); + +var BRp = {}; + +BRp.updateCachedGrabbedEles = function(){ + var eles = this.cachedZSortedEles; + + if( !eles ){ + // just let this be recalculated on the next z sort tick + return; + } + + eles.drag = []; + eles.nondrag = []; + + var grabTargets = []; + + for( var i = 0; i < eles.length; i++ ){ + var ele = eles[i]; + var rs = ele._private.rscratch; + + if( ele.grabbed() && !ele.isParent() ){ + grabTargets.push( ele ); + } else if( rs.inDragLayer ){ + eles.drag.push( ele ); + } else { + eles.nondrag.push( ele ); + } + } + + // put the grab target nodes last so it's on top of its neighbourhood + for( var i = 0; i < grabTargets.length; i++ ){ + var ele = grabTargets[i]; + + eles.drag.push( ele ); + } +}; + +BRp.invalidateCachedZSortedEles = function(){ + this.cachedZSortedEles = null; +}; + +BRp.getCachedZSortedEles = function( forceRecalc ){ + if( forceRecalc || !this.cachedZSortedEles ){ + //console.time('cachezorder') + + var eles = this.cy.mutableElements().toArray(); + + eles.sort( zIndexSort ); + + eles.interactive = eles.filter(function( ele ){ + return ele.interactive(); + }); + + this.cachedZSortedEles = eles; + + this.updateCachedGrabbedEles(); + } else { + eles = this.cachedZSortedEles; + } + + return eles; +}; + +module.exports = BRp diff --git a/node_modules/cytoscape/src/extensions/renderer/base/images.js b/node_modules/cytoscape/src/extensions/renderer/base/images.js new file mode 100644 index 000000000..f1e2b5691 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/base/images.js @@ -0,0 +1,36 @@ +var BRp = {}; + +BRp.getCachedImage = function( url, crossOrigin, onLoad ){ + var r = this; + var imageCache = r.imageCache = r.imageCache || {}; + var cache = imageCache[ url ]; + + if( cache ){ + if( !cache.image.complete ){ + cache.image.addEventListener('load', onLoad); + } + + return cache.image; + } else { + cache = imageCache[ url ] = imageCache[ url ] || {}; + + var image = cache.image = new Image(); // eslint-disable-line no-undef + + image.addEventListener('load', onLoad); + image.addEventListener('error', function(){ image.error = true; }); + + // #1582 safari doesn't load data uris with crossOrigin properly + // https://bugs.webkit.org/show_bug.cgi?id=123978 + var dataUriPrefix = 'data:'; + var isDataUri = url.substring( 0, dataUriPrefix.length ).toLowerCase() === dataUriPrefix; + if( !isDataUri ){ + image.crossOrigin = crossOrigin; // prevent tainted canvas + } + + image.src = url; + + return image; + } +}; + +module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/index.js b/node_modules/cytoscape/src/extensions/renderer/base/index.js new file mode 100644 index 000000000..84e261ac1 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/base/index.js @@ -0,0 +1,210 @@ +var is = require('../../../is'); +var util = require('../../../util'); +var window = require('../../../window'); + +var BaseRenderer = function( options ){ this.init( options ); }; +var BR = BaseRenderer; +var BRp = BR.prototype; + +BRp.clientFunctions = [ 'redrawHint', 'render', 'renderTo', 'matchCanvasSize', 'nodeShapeImpl', 'arrowShapeImpl' ]; + +BRp.init = function( options ){ + var r = this; + + r.options = options; + + r.cy = options.cy; + + var ctr = r.container = options.cy.container(); + + // prepend a stylesheet in the head such that + if( window ){ + var document = window.document; + var head = document.head; + var stylesheetId = '__________cytoscape_stylesheet'; + var className = '__________cytoscape_container'; + var stylesheetAlreadyExists = document.getElementById( stylesheetId ) != null; + + if( ctr.className.indexOf( className ) < 0 ){ + ctr.className = ( ctr.className || '' ) + ' ' + className; + } + + if( !stylesheetAlreadyExists ){ + var stylesheet = document.createElement('style'); + + stylesheet.id = stylesheetId; + stylesheet.innerHTML = '.'+className+' { position: relative; }'; + + head.insertBefore( stylesheet, head.children[0] ); // first so lowest priority + } + + var computedStyle = window.getComputedStyle( ctr ); + var position = computedStyle.getPropertyValue('position'); + + if( position === 'static' ){ + util.error('A Cytoscape container has style position:static and so can not use UI extensions properly'); + } + } + + r.selection = [ undefined, undefined, undefined, undefined, 0]; // Coordinates for selection box, plus enabled flag + + r.bezierProjPcts = [ 0.05, 0.225, 0.4, 0.5, 0.6, 0.775, 0.95 ]; + + //--Pointer-related data + r.hoverData = {down: null, last: null, + downTime: null, triggerMode: null, + dragging: false, + initialPan: [ null, null ], capture: false}; + + r.dragData = {possibleDragElements: []}; + + r.touchData = { + start: null, capture: false, + + // These 3 fields related to tap, taphold events + startPosition: [ null, null, null, null, null, null ], + singleTouchStartTime: null, + singleTouchMoved: true, + + now: [ null, null, null, null, null, null ], + earlier: [ null, null, null, null, null, null ] + }; + + r.redraws = 0; + r.showFps = options.showFps; + r.debug = options.debug; + + r.hideEdgesOnViewport = options.hideEdgesOnViewport; + r.hideLabelsOnViewport = options.hideLabelsOnViewport; + r.textureOnViewport = options.textureOnViewport; + r.wheelSensitivity = options.wheelSensitivity; + r.motionBlurEnabled = options.motionBlur; // on by default + r.forcedPixelRatio = options.pixelRatio; + r.motionBlur = options.motionBlur; // for initial kick off + r.motionBlurOpacity = options.motionBlurOpacity; + r.motionBlurTransparency = 1 - r.motionBlurOpacity; + r.motionBlurPxRatio = 1; + r.mbPxRBlurry = 1; //0.8; + r.minMbLowQualFrames = 4; + r.fullQualityMb = false; + r.clearedForMotionBlur = []; + r.desktopTapThreshold = options.desktopTapThreshold; + r.desktopTapThreshold2 = options.desktopTapThreshold * options.desktopTapThreshold; + r.touchTapThreshold = options.touchTapThreshold; + r.touchTapThreshold2 = options.touchTapThreshold * options.touchTapThreshold; + r.tapholdDuration = 500; + + r.bindings = []; + r.beforeRenderCallbacks = []; + r.beforeRenderPriorities = { // higher priority execs before lower one + animations: 400, + eleCalcs: 300, + eleTxrDeq: 200, + lyrTxrDeq: 100 + }; + + r.registerNodeShapes(); + r.registerArrowShapes(); + r.registerCalculationListeners(); +}; + +BRp.notify = function( params ){ + var types; + var r = this; + + // the renderer can't be notified after it's destroyed + if( this.destroyed ){ return; } + + if( is.array( params.type ) ){ + types = params.type; + + } else { + types = [ params.type ]; + } + + var has = {}; + for( var i = 0; i < types.length; i++ ){ + var type = types[ i ]; + + has[ type ] = true; + } // for + + if( has['init'] ){ + r.load(); + return; + } + + if( has['destroy'] ){ + r.destroy(); + return; + } + + if( has['add'] || has['remove'] || has['load'] || has['zorder'] ){ + r.invalidateCachedZSortedEles(); + } + + if( has['viewport'] ){ + r.redrawHint( 'select', true ); + } + + if( has['load'] || has['resize'] ){ + r.invalidateContainerClientCoordsCache(); + r.matchCanvasSize( r.container ); + } + + r.redrawHint( 'eles', true ); + r.redrawHint( 'drag', true ); + + this.startRenderLoop(); + + this.redraw(); +}; + +BRp.destroy = function(){ + var r = this; + + r.destroyed = true; + + r.cy.stopAnimationLoop(); + + for( var i = 0; i < r.bindings.length; i++ ){ + var binding = r.bindings[ i ]; + var b = binding; + var tgt = b.target; + + ( tgt.off || tgt.removeEventListener ).apply( tgt, b.args ); + } + + r.bindings = []; + r.beforeRenderCallbacks = []; + r.onUpdateEleCalcsFns = []; + + if( r.removeObserver ){ + r.removeObserver.disconnect(); + } + + if( r.styleObserver ){ + r.styleObserver.disconnect(); + } + + if( r.labelCalcDiv ){ + try { + document.body.removeChild( r.labelCalcDiv ); // eslint-disable-line no-undef + } catch( e ){ + // ie10 issue #1014 + } + } +}; + +[ + require( './arrow-shapes' ), + require( './coord-ele-math' ), + require( './images' ), + require( './load-listeners' ), + require( './node-shapes' ), + require( './redraw' ) +].forEach( function( props ){ + util.extend( BRp, props ); +} ); + +module.exports = BR; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/load-listeners.js b/node_modules/cytoscape/src/extensions/renderer/base/load-listeners.js new file mode 100644 index 000000000..ac545c93b --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/base/load-listeners.js @@ -0,0 +1,2085 @@ +var is = require( '../../../is' ); +var util = require( '../../../util' ); +var math = require( '../../../math' ); +var Event = require( '../../../event' ); + +var BRp = {}; + +BRp.registerBinding = function( target, event, handler, useCapture ){ + var args = Array.prototype.slice.apply( arguments, [1] ); // copy + var b = this.binder( target ); + + return b.on.apply( b, args ); +}; + +BRp.binder = function( tgt ){ + var r = this; + + var tgtIsDom = tgt === window || tgt === document || tgt === document.body || is.domElement( tgt ); + + if( r.supportsPassiveEvents == null ){ + + // from https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection + var supportsPassive = false; + try { + var opts = Object.defineProperty( {}, 'passive', { + get: function(){ + supportsPassive = true; + } + } ); + + window.addEventListener( 'test', null, opts ); + } catch( err ){} + + r.supportsPassiveEvents = supportsPassive; + } + + var on = function( event, handler, useCapture ){ + var args = Array.prototype.slice.call( arguments ); + + if( tgtIsDom && r.supportsPassiveEvents ){ // replace useCapture w/ opts obj + args[2] = { + capture: useCapture != null ? useCapture : false, + passive: false, + once: false + }; + } + + r.bindings.push({ + target: tgt, + args: args + }); + + ( tgt.addEventListener || tgt.on ).apply( tgt, args ); + + return this; + }; + + return { + on: on, + addEventListener: on, + addListener: on, + bind: on + }; +}; + +BRp.nodeIsDraggable = function( node ){ + return ( + node + && node.isNode() + && !node.locked() + && node.grabbable() + ); +}; + +BRp.nodeIsGrabbable = function( node ){ + return ( + this.nodeIsDraggable( node ) + && node.interactive() + ); +}; + +BRp.load = function(){ + var r = this; + + var triggerEvents = function( target, names, e, props ){ + if( target == null ){ + target = r.cy; + } + + for( var i = 0; i < names.length; i++ ){ + var name = names[ i ]; + + target.emit( util.extend( { originalEvent: e, type: name }, props ) ); + } + }; + + var isMultSelKeyDown = function( e ){ + return e.shiftKey || e.metaKey || e.ctrlKey; // maybe e.altKey + }; + + var allowPanningPassthrough = function( down, downs ){ + var allowPassthrough = true; + + if( r.cy.hasCompoundNodes() && down && down.isEdge() ){ + // a compound node below the edge => no passthrough panning + for( var i = 0; downs && i < downs.length; i++ ){ + var down = downs[i]; + + if( down.isNode() && down.isParent() ){ + allowPassthrough = false; + break; + } + } + } else { + allowPassthrough = true; + } + + return allowPassthrough; + }; + + var getDragListIds = function( opts ){ + var listHasId; + + if( opts.addToList && r.cy.hasCompoundNodes() ){ // only needed for compound graphs + if( !opts.addToList.hasId ){ // build ids lookup if doesn't already exist + opts.addToList.hasId = {}; + + for( var i = 0; i < opts.addToList.length; i++ ){ + var ele = opts.addToList[ i ]; + + opts.addToList.hasId[ ele.id() ] = true; + } + } + + listHasId = opts.addToList.hasId; + } + + return listHasId || {}; + }; + + var setGrabbed = function( ele ){ + ele[0]._private.grabbed = true; + }; + + var setFreed = function( ele ){ + ele[0]._private.grabbed = false; + }; + + var setInDragLayer = function( ele ){ + ele[0]._private.rscratch.inDragLayer = true; + }; + + var setOutDragLayer = function( ele ){ + ele[0]._private.rscratch.inDragLayer = false; + }; + + var setGrabTarget = function( ele ){ + ele[0]._private.rscratch.isGrabTarget = true; + }; + + var removeGrabTarget = function( ele ){ + ele[0]._private.rscratch.isGrabTarget = false; + }; + + var addToDragList = function( ele, opts ){ + var listHasId = getDragListIds( opts ); + + if( !listHasId[ ele.id() ] ){ + opts.addToList.push( ele ); + listHasId[ ele.id() ] = true; + + setGrabbed( ele ); + } + }; + + // helper function to determine which child nodes and inner edges + // of a compound node to be dragged as well as the grabbed and selected nodes + var addDescendantsToDrag = function( node, opts ){ + if( !node.cy().hasCompoundNodes() ){ + return; + } + + if( opts.inDragLayer == null && opts.addToList == null ){ return; } // nothing to do + + var innerNodes = node.descendants(); + + if( opts.inDragLayer ){ + innerNodes.forEach( setInDragLayer ); + innerNodes.connectedEdges().forEach( setInDragLayer ); + } + + if( opts.addToList ){ + innerNodes.forEach(function( ele ){ + addToDragList( ele, opts ); + }); + } + }; + + // adds the given nodes and its neighbourhood to the drag layer + var addNodesToDrag = function( nodes, opts ){ + opts = opts || {}; + + var hasCompoundNodes = nodes.cy().hasCompoundNodes(); + + if( opts.inDragLayer ){ + nodes.forEach( setInDragLayer ); + + nodes.neighborhood().stdFilter(function( ele ){ + return !hasCompoundNodes || ele.isEdge(); + }).forEach( setInDragLayer ); + } + + if( opts.addToList ){ + nodes.forEach(function( ele ){ + addToDragList( ele, opts ); + }); + } + + addDescendantsToDrag( nodes, opts ); // always add to drag + + // also add nodes and edges related to the topmost ancestor + updateAncestorsInDragLayer( nodes, { + inDragLayer: opts.inDragLayer + } ); + + r.updateCachedGrabbedEles(); + }; + + var addNodeToDrag = addNodesToDrag; + + var freeDraggedElements = function( grabbedEles ){ + if( !grabbedEles ){ return; } + + grabbedEles.hasId = {}; // clear the id list + + // just go over all elements rather than doing a bunch of (possibly expensive) traversals + r.getCachedZSortedEles().forEach(function( ele ){ + setFreed( ele ); + setOutDragLayer( ele ); + removeGrabTarget( ele ); + }); + + r.updateCachedGrabbedEles(); + }; + + // helper function to determine which ancestor nodes and edges should go + // to the drag layer (or should be removed from drag layer). + var updateAncestorsInDragLayer = function( node, opts ){ + + if( opts.inDragLayer == null && opts.addToList == null ){ return; } // nothing to do + + if( !node.cy().hasCompoundNodes() ){ + return; + } + + // find top-level parent + var parent = node.ancestors().orphans(); + + // no parent node: no nodes to add to the drag layer + if( parent.same( node ) ){ + return; + } + + var nodes = parent.descendants().spawnSelf() + .merge( parent ) + .unmerge( node ) + .unmerge( node.descendants() ) + ; + + var edges = nodes.connectedEdges(); + + if( opts.inDragLayer ){ + edges.forEach( setInDragLayer ); + nodes.forEach( setInDragLayer ); + } + + if( opts.addToList ){ + nodes.forEach(function( ele ){ + addToDragList( ele, opts ); + }); + } + }; + + var blurActiveDomElement = function(){ + if( document.activeElement != null && document.activeElement.blur != null ){ + document.activeElement.blur(); + } + }; + + var haveMutationsApi = typeof MutationObserver !== 'undefined'; + + // watch for when the cy container is removed from the dom + if( haveMutationsApi ){ + r.removeObserver = new MutationObserver( function( mutns ){ // eslint-disable-line no-undef + for( var i = 0; i < mutns.length; i++ ){ + var mutn = mutns[ i ]; + var rNodes = mutn.removedNodes; + + if( rNodes ){ for( var j = 0; j < rNodes.length; j++ ){ + var rNode = rNodes[ j ]; + + if( rNode === r.container ){ + r.destroy(); + break; + } + } } + } + } ); + + if( r.container.parentNode ){ + r.removeObserver.observe( r.container.parentNode, { childList: true } ); + } + } else { + r.registerBinding( r.container, 'DOMNodeRemoved', function( e ){ + r.destroy(); + } ); + } + + var onResize = util.debounce( function(){ + r.cy.resize(); + }, 100 ); + + if( haveMutationsApi ){ + r.styleObserver = new MutationObserver( onResize ); // eslint-disable-line no-undef + + r.styleObserver.observe( r.container, { attributes: true } ); + } + + // auto resize + r.registerBinding( window, 'resize', onResize ); // eslint-disable-line no-undef + + var forEachUp = function( domEle, fn ){ + while( domEle != null ){ + fn( domEle ); + + domEle = domEle.parentNode + } + }; + + var invalidateCoords = function(){ + r.invalidateContainerClientCoordsCache(); + }; + + forEachUp( r.container, function( domEle ){ + r.registerBinding( domEle, 'transitionend', invalidateCoords ); + r.registerBinding( domEle, 'animationend', invalidateCoords ); + r.registerBinding( domEle, 'scroll', invalidateCoords ); + } ); + + // stop right click menu from appearing on cy + r.registerBinding( r.container, 'contextmenu', function( e ){ + e.preventDefault(); + } ); + + var inBoxSelection = function(){ + return r.selection[4] !== 0; + }; + + var eventInContainer = function( e ){ + // save cycles if mouse events aren't to be captured + var containerPageCoords = r.findContainerClientCoords(); + var x = containerPageCoords[0]; + var y = containerPageCoords[1]; + var width = containerPageCoords[2]; + var height = containerPageCoords[3]; + + var positions = e.touches ? e.touches : [ e ]; + var atLeastOnePosInside = false; + + for( var i = 0; i < positions.length; i++ ){ + var p = positions[i]; + + if( x <= p.clientX && p.clientX <= x + width + && y <= p.clientY && p.clientY <= y + height + ){ + atLeastOnePosInside = true; + break; + } + } + + if( !atLeastOnePosInside ){ return false; } + + var container = r.container; + var target = e.target; + var tParent = target.parentNode; + var containerIsTarget = false; + + while( tParent ){ + if( tParent === container ){ + containerIsTarget = true; + break; + } + + tParent = tParent.parentNode; + } + + if( !containerIsTarget ){ return false; } // if target is outisde cy container, then this event is not for us + + return true; + }; + + // Primary key + r.registerBinding( r.container, 'mousedown', function mousedownHandler( e ){ + if( !eventInContainer(e) ){ return; } + + e.preventDefault(); + + blurActiveDomElement(); + + r.hoverData.capture = true; + r.hoverData.which = e.which; + + var cy = r.cy; + var gpos = [ e.clientX, e.clientY ]; + var pos = r.projectIntoViewport( gpos[0], gpos[1] ); + var select = r.selection; + var nears = r.findNearestElements( pos[0], pos[1], true, false ); + var near = nears[0]; + var draggedElements = r.dragData.possibleDragElements; + + r.hoverData.mdownPos = pos; + r.hoverData.mdownGPos = gpos; + + var checkForTaphold = function(){ + r.hoverData.tapholdCancelled = false; + + clearTimeout( r.hoverData.tapholdTimeout ); + + r.hoverData.tapholdTimeout = setTimeout( function(){ + + if( r.hoverData.tapholdCancelled ){ + return; + } else { + var ele = r.hoverData.down; + + if( ele ){ + ele.emit( { + originalEvent: e, + type: 'taphold', + position: { x: pos[0], y: pos[1] } + } ); + } else { + cy.emit( { + originalEvent: e, + type: 'taphold', + position: { x: pos[0], y: pos[1] } + } ); + } + } + + }, r.tapholdDuration ); + }; + + // Right click button + if( e.which == 3 ){ + + r.hoverData.cxtStarted = true; + + var cxtEvt = { + originalEvent: e, + type: 'cxttapstart', + position: { x: pos[0], y: pos[1] } + }; + + if( near ){ + near.activate(); + near.emit( cxtEvt ); + + r.hoverData.down = near; + } else { + cy.emit( cxtEvt ); + } + + r.hoverData.downTime = (new Date()).getTime(); + r.hoverData.cxtDragged = false; + + // Primary button + } else if( e.which == 1 ){ + + if( near ){ + near.activate(); + } + + // Element dragging + { + // If something is under the cursor and it is draggable, prepare to grab it + if( near != null ){ + + if( r.nodeIsGrabbable( near ) ){ + + var makeEvent = function( type ){ + return { + originalEvent: e, + type: type, + position: { x: pos[0], y: pos[1] } + }; + }; + + var triggerGrab = function( ele ){ + ele.emit( makeEvent('grab') ); + }; + + setGrabTarget( near ); + + if( !near.selected() ){ + + draggedElements = r.dragData.possibleDragElements = []; + addNodeToDrag( near, { addToList: draggedElements } ); + + near.emit( makeEvent('grabon') ).emit( makeEvent('grab') ); + + } else { + draggedElements = r.dragData.possibleDragElements = [ ]; + + var selectedNodes = cy.$( function( ele ){ return ele.isNode() && ele.selected() && r.nodeIsGrabbable( ele ); } ); + + addNodesToDrag( selectedNodes, { addToList: draggedElements } ); + + near.emit( makeEvent('grabon') ); + + selectedNodes.forEach( triggerGrab ); + } + + r.redrawHint( 'eles', true ); + r.redrawHint( 'drag', true ); + + } + + } + + r.hoverData.down = near; + r.hoverData.downs = nears; + r.hoverData.downTime = (new Date()).getTime(); + } + + triggerEvents( near, [ 'mousedown', 'tapstart', 'vmousedown' ], e, { + position: { x: pos[0], y: pos[1] } + } ); + + if( near == null ){ + select[4] = 1; + + r.data.bgActivePosistion = { + x: pos[0], + y: pos[1] + }; + + r.redrawHint( 'select', true ); + + r.redraw(); + } else if( near.isEdge() ){ + select[4] = 1; // for future pan + } + + checkForTaphold(); + + } + + // Initialize selection box coordinates + select[0] = select[2] = pos[0]; + select[1] = select[3] = pos[1]; + + }, false ); + + r.registerBinding( window, 'mousemove', function mousemoveHandler( e ){ // eslint-disable-line no-undef + var capture = r.hoverData.capture; + + if( !capture && !eventInContainer(e) ){ return; } + + var preventDefault = false; + var cy = r.cy; + var zoom = cy.zoom(); + var gpos = [ e.clientX, e.clientY ]; + var pos = r.projectIntoViewport( gpos[0], gpos[1] ); + var mdownPos = r.hoverData.mdownPos; + var mdownGPos = r.hoverData.mdownGPos; + var select = r.selection; + + var near = null; + if( !r.hoverData.draggingEles && !r.hoverData.dragging && !r.hoverData.selecting ){ + near = r.findNearestElement( pos[0], pos[1], true, false ); + } + var last = r.hoverData.last; + var down = r.hoverData.down; + + var disp = [ pos[0] - select[2], pos[1] - select[3] ]; + + var draggedElements = r.dragData.possibleDragElements; + + var isOverThresholdDrag; + + if( mdownGPos ){ + var dx = gpos[0] - mdownGPos[0]; + var dx2 = dx * dx; + var dy = gpos[1] - mdownGPos[1]; + var dy2 = dy * dy; + var dist2 = dx2 + dy2; + + r.hoverData.isOverThresholdDrag = isOverThresholdDrag = dist2 >= r.desktopTapThreshold2; + } + + var multSelKeyDown = isMultSelKeyDown( e ); + + if (isOverThresholdDrag) { + r.hoverData.tapholdCancelled = true; + } + + var updateDragDelta = function(){ + var dragDelta = r.hoverData.dragDelta = r.hoverData.dragDelta || []; + + if( dragDelta.length === 0 ){ + dragDelta.push( disp[0] ); + dragDelta.push( disp[1] ); + } else { + dragDelta[0] += disp[0]; + dragDelta[1] += disp[1]; + } + }; + + + preventDefault = true; + + triggerEvents( near, [ 'mousemove', 'vmousemove', 'tapdrag' ], e, { + position: { x: pos[0], y: pos[1] } + } ); + + var goIntoBoxMode = function(){ + r.data.bgActivePosistion = undefined; + + if( !r.hoverData.selecting ){ + cy.emit('boxstart'); + } + + select[4] = 1; + r.hoverData.selecting = true; + + r.redrawHint( 'select', true ); + r.redraw(); + }; + + // trigger context drag if rmouse down + if( r.hoverData.which === 3 ){ + // but only if over threshold + if( isOverThresholdDrag ){ + var cxtEvt = ( { + originalEvent: e, + type: 'cxtdrag', + position: { x: pos[0], y: pos[1] } + } ); + + if( down ){ + down.emit( cxtEvt ); + } else { + cy.emit( cxtEvt ); + } + + r.hoverData.cxtDragged = true; + + if( !r.hoverData.cxtOver || near !== r.hoverData.cxtOver ){ + + if( r.hoverData.cxtOver ){ + r.hoverData.cxtOver.emit( ( { + originalEvent: e, + type: 'cxtdragout', + position: { x: pos[0], y: pos[1] } + } ) ); + } + + r.hoverData.cxtOver = near; + + if( near ){ + near.emit( ( { + originalEvent: e, + type: 'cxtdragover', + position: { x: pos[0], y: pos[1] } + } ) ); + } + + } + } + + // Check if we are drag panning the entire graph + } else if( r.hoverData.dragging ){ + preventDefault = true; + + if( cy.panningEnabled() && cy.userPanningEnabled() ){ + var deltaP; + + if( r.hoverData.justStartedPan ){ + var mdPos = r.hoverData.mdownPos; + + deltaP = { + x: ( pos[0] - mdPos[0] ) * zoom, + y: ( pos[1] - mdPos[1] ) * zoom + }; + + r.hoverData.justStartedPan = false; + + } else { + deltaP = { + x: disp[0] * zoom, + y: disp[1] * zoom + }; + + } + + cy.panBy( deltaP ); + + r.hoverData.dragged = true; + } + + // Needs reproject due to pan changing viewport + pos = r.projectIntoViewport( e.clientX, e.clientY ); + + // Checks primary button down & out of time & mouse not moved much + } else if( + select[4] == 1 && (down == null || down.isEdge()) + ){ + + if( isOverThresholdDrag ){ + + if( !r.hoverData.dragging && cy.boxSelectionEnabled() && ( multSelKeyDown || !cy.panningEnabled() || !cy.userPanningEnabled() ) ){ + goIntoBoxMode(); + + } else if( !r.hoverData.selecting && cy.panningEnabled() && cy.userPanningEnabled() ){ + var allowPassthrough = allowPanningPassthrough( down, r.hoverData.downs ); + + if( allowPassthrough ){ + r.hoverData.dragging = true; + r.hoverData.justStartedPan = true; + select[4] = 0; + + r.data.bgActivePosistion = math.array2point( mdownPos ); + + r.redrawHint( 'select', true ); + r.redraw(); + } + } + + if( down && down.isEdge() && down.active() ){ down.unactivate(); } + + } + + } else { + if( down && down.isEdge() && down.active() ){ down.unactivate(); } + + if( ( !down || !down.grabbed() ) && near != last ){ + + if( last ){ + triggerEvents( last, [ 'mouseout', 'tapdragout' ], e, { + position: { x: pos[0], y: pos[1] } + } ); + } + + if( near ){ + triggerEvents( near, [ 'mouseover', 'tapdragover' ], e, { + position: { x: pos[0], y: pos[1] } + } ); + } + + r.hoverData.last = near; + } + + if( down ){ + + if( isOverThresholdDrag ){ // then we can take action + + if( cy.boxSelectionEnabled() && multSelKeyDown ){ // then selection overrides + if( down && down.grabbed() ){ + freeDraggedElements( draggedElements ); + + down.emit('free'); + } + + goIntoBoxMode(); + + } else if( down && down.grabbed() && r.nodeIsDraggable( down ) ){ // drag node + var justStartedDrag = !r.dragData.didDrag; + + if( justStartedDrag ){ + r.redrawHint( 'eles', true ); + } + + r.dragData.didDrag = true; // indicate that we actually did drag the node + + var toTrigger = []; + + // now, add the elements to the drag layer if not done already + if( !r.hoverData.draggingEles ){ + addNodesToDrag( cy.collection( draggedElements ), { inDragLayer: true } ); + } + + for( var i = 0; i < draggedElements.length; i++ ){ + var dEle = draggedElements[ i ]; + + // Locked nodes not draggable, as well as non-visible nodes + if( r.nodeIsDraggable( dEle ) && dEle.grabbed() ){ + var dPos = dEle.position(); + + toTrigger.push( dEle ); + + if( is.number( disp[0] ) && is.number( disp[1] ) ){ + dPos.x += disp[0]; + dPos.y += disp[1]; + + if( justStartedDrag ){ + var dragDelta = r.hoverData.dragDelta; + + if( dragDelta && is.number( dragDelta[0] ) && is.number( dragDelta[1] ) ){ + dPos.x += dragDelta[0]; + dPos.y += dragDelta[1]; + } + } + } + + } + } + + r.hoverData.draggingEles = true; + + var tcol = cy.collection( toTrigger ); + + tcol.dirtyCompoundBoundsCache(); + tcol.emit( 'position drag' ); + + r.redrawHint( 'drag', true ); + r.redraw(); + } + + } else { // otherwise save drag delta for when we actually start dragging so the relative grab pos is constant + updateDragDelta(); + } + } + + // prevent the dragging from triggering text selection on the page + preventDefault = true; + } + + select[2] = pos[0]; select[3] = pos[1]; + + if( preventDefault ){ + if( e.stopPropagation ) e.stopPropagation(); + if( e.preventDefault ) e.preventDefault(); + return false; + } + }, false ); + + r.registerBinding( window, 'mouseup', function mouseupHandler( e ){ // eslint-disable-line no-undef + var capture = r.hoverData.capture; + if( !capture ){ return; } + r.hoverData.capture = false; + + var cy = r.cy; var pos = r.projectIntoViewport( e.clientX, e.clientY ); var select = r.selection; + var near = r.findNearestElement( pos[0], pos[1], true, false ); + var draggedElements = r.dragData.possibleDragElements; var down = r.hoverData.down; + var multSelKeyDown = isMultSelKeyDown( e ); + + if( r.data.bgActivePosistion ){ + r.redrawHint( 'select', true ); + r.redraw(); + } + + r.hoverData.tapholdCancelled = true; + + r.data.bgActivePosistion = undefined; // not active bg now + + if( down ){ + down.unactivate(); + } + + if( r.hoverData.which === 3 ){ + var cxtEvt = ( { + originalEvent: e, + type: 'cxttapend', + position: { x: pos[0], y: pos[1] } + } ); + + if( down ){ + down.emit( cxtEvt ); + } else { + cy.emit( cxtEvt ); + } + + if( !r.hoverData.cxtDragged ){ + var cxtTap = ( { + originalEvent: e, + type: 'cxttap', + position: { x: pos[0], y: pos[1] } + } ); + + if( down ){ + down.emit( cxtTap ); + } else { + cy.emit( cxtTap ); + } + } + + r.hoverData.cxtDragged = false; + r.hoverData.which = null; + + } else if( r.hoverData.which === 1 ){ + + // Deselect all elements if nothing is currently under the mouse cursor and we aren't dragging something + if( (down == null) // not mousedown on node + && !r.dragData.didDrag // didn't move the node around + && !r.hoverData.selecting // not box selection + && !r.hoverData.dragged // didn't pan + && !isMultSelKeyDown( e ) + ){ + + cy.$( function( ele ){ return ele.selected(); } ).unselect(); + + if( draggedElements.length > 0 ){ + r.redrawHint( 'eles', true ); + } + + r.dragData.possibleDragElements = draggedElements = []; + } + + triggerEvents( near, [ 'mouseup', 'tapend', 'vmouseup' ], e, { + position: { x: pos[0], y: pos[1] } + } ); + + if( + !r.dragData.didDrag // didn't move a node around + && !r.hoverData.dragged // didn't pan + && !r.hoverData.selecting // not box selection + && !r.hoverData.isOverThresholdDrag // didn't move too much + ){ + triggerEvents( down, ['click', 'tap', 'vclick'], e, { + position: { x: pos[0], y: pos[1] } + } ); + } + + // Single selection + if( near == down && !r.dragData.didDrag && !r.hoverData.selecting ){ + if( near != null && near._private.selectable ){ + + if( r.hoverData.dragging ){ + // if panning, don't change selection state + } else if( cy.selectionType() === 'additive' || multSelKeyDown ){ + if( near.selected() ){ + near.unselect(); + } else { + near.select(); + } + } else { + if( !multSelKeyDown ){ + cy.$( ':selected' ).unmerge( near ).unselect(); + near.select(); + } + } + + r.redrawHint( 'eles', true ); + } + } + + if( r.hoverData.selecting ){ + var box = cy.collection( r.getAllInBox( select[0], select[1], select[2], select[3] ) ); + + r.redrawHint( 'select', true ); + + if( box.length > 0 ){ + r.redrawHint( 'eles', true ); + } + + cy.emit('boxend'); + + var eleWouldBeSelected = function( ele ){ return ele.selectable() && !ele.selected(); }; + + if( cy.selectionType() === 'additive' ){ + box + .emit('box') + .stdFilter( eleWouldBeSelected ) + .select() + .emit('boxselect') + ; + } else { + if( !multSelKeyDown ){ + cy.$( ':selected' ).unmerge( box ).unselect(); + } + + box + .emit('box') + .stdFilter( eleWouldBeSelected ) + .select() + .emit('boxselect') + ; + } + + // always need redraw in case eles unselectable + r.redraw(); + + } + + // Cancel drag pan + if( r.hoverData.dragging ){ + r.hoverData.dragging = false; + + r.redrawHint( 'select', true ); + r.redrawHint( 'eles', true ); + + r.redraw(); + } + + if( !select[4] ) { + r.redrawHint('drag', true); + r.redrawHint('eles', true); + + var downWasGrabbed = down && down.grabbed(); + + freeDraggedElements( draggedElements ); + + if( downWasGrabbed ){ down.emit('free'); } + } + + } // else not right mouse + + select[4] = 0; r.hoverData.down = null; + + r.hoverData.cxtStarted = false; + r.hoverData.draggingEles = false; + r.hoverData.selecting = false; + r.hoverData.isOverThresholdDrag = false; + r.dragData.didDrag = false; + r.hoverData.dragged = false; + r.hoverData.dragDelta = []; + r.hoverData.mdownPos = null; + r.hoverData.mdownGPos = null; + + }, false ); + + var wheelHandler = function( e ){ + + + if( r.scrollingPage ){ return; } // while scrolling, ignore wheel-to-zoom + + var cy = r.cy; + var pos = r.projectIntoViewport( e.clientX, e.clientY ); + var rpos = [ pos[0] * cy.zoom() + cy.pan().x, + pos[1] * cy.zoom() + cy.pan().y ]; + + if( r.hoverData.draggingEles || r.hoverData.dragging || r.hoverData.cxtStarted || inBoxSelection() ){ // if pan dragging or cxt dragging, wheel movements make no zoom + e.preventDefault(); + return; + } + + if( cy.panningEnabled() && cy.userPanningEnabled() && cy.zoomingEnabled() && cy.userZoomingEnabled() ){ + e.preventDefault(); + + r.data.wheelZooming = true; + clearTimeout( r.data.wheelTimeout ); + r.data.wheelTimeout = setTimeout( function(){ + r.data.wheelZooming = false; + + r.redrawHint( 'eles', true ); + r.redraw(); + }, 150 ); + + var diff; + + if( e.deltaY != null ){ + diff = e.deltaY / -250; + } else if( e.wheelDeltaY != null ){ + diff = e.wheelDeltaY / 1000; + } else { + diff = e.wheelDelta / 1000; + } + + diff = diff * r.wheelSensitivity; + + var needsWheelFix = e.deltaMode === 1; + if( needsWheelFix ){ // fixes slow wheel events on ff/linux and ff/windows + diff *= 33; + } + + cy.zoom( { + level: cy.zoom() * Math.pow( 10, diff ), + renderedPosition: { x: rpos[0], y: rpos[1] } + } ); + } + + }; + + // Functions to help with whether mouse wheel should trigger zooming + // -- + r.registerBinding( r.container, 'wheel', wheelHandler, true ); + + // disable nonstandard wheel events + // r.registerBinding(r.container, 'mousewheel', wheelHandler, true); + // r.registerBinding(r.container, 'DOMMouseScroll', wheelHandler, true); + // r.registerBinding(r.container, 'MozMousePixelScroll', wheelHandler, true); // older firefox + + r.registerBinding( window, 'scroll', function scrollHandler( e ){ // eslint-disable-line no-undef + r.scrollingPage = true; + + clearTimeout( r.scrollingPageTimeout ); + r.scrollingPageTimeout = setTimeout( function(){ + r.scrollingPage = false; + }, 250 ); + }, true ); + + // Functions to help with handling mouseout/mouseover on the Cytoscape container + // Handle mouseout on Cytoscape container + r.registerBinding( r.container, 'mouseout', function mouseOutHandler( e ){ + var pos = r.projectIntoViewport( e.clientX, e.clientY ); + + r.cy.emit( ( { + originalEvent: e, + type: 'mouseout', + position: { x: pos[0], y: pos[1] } + } ) ); + }, false ); + + r.registerBinding( r.container, 'mouseover', function mouseOverHandler( e ){ + var pos = r.projectIntoViewport( e.clientX, e.clientY ); + + r.cy.emit( ( { + originalEvent: e, + type: 'mouseover', + position: { x: pos[0], y: pos[1] } + } ) ); + }, false ); + + var f1x1, f1y1, f2x1, f2y1; // starting points for pinch-to-zoom + var distance1, distance1Sq; // initial distance between finger 1 and finger 2 for pinch-to-zoom + var center1, modelCenter1; // center point on start pinch to zoom + var offsetLeft, offsetTop; + var containerWidth, containerHeight; + var twoFingersStartInside; + + var distance = function( x1, y1, x2, y2 ){ + return Math.sqrt( (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1) ); + }; + + var distanceSq = function( x1, y1, x2, y2 ){ + return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1); + }; + + var touchstartHandler; + r.registerBinding( r.container, 'touchstart', touchstartHandler = function( e ){ + if( !eventInContainer(e) ){ return; } + + blurActiveDomElement(); + + r.touchData.capture = true; + r.data.bgActivePosistion = undefined; + + var cy = r.cy; + var now = r.touchData.now; + var earlier = r.touchData.earlier; + + if( e.touches[0] ){ var pos = r.projectIntoViewport( e.touches[0].clientX, e.touches[0].clientY ); now[0] = pos[0]; now[1] = pos[1]; } + if( e.touches[1] ){ var pos = r.projectIntoViewport( e.touches[1].clientX, e.touches[1].clientY ); now[2] = pos[0]; now[3] = pos[1]; } + if( e.touches[2] ){ var pos = r.projectIntoViewport( e.touches[2].clientX, e.touches[2].clientY ); now[4] = pos[0]; now[5] = pos[1]; } + + // record starting points for pinch-to-zoom + if( e.touches[1] ){ + + freeDraggedElements( r.dragData.touchDragEles ); + + var offsets = r.findContainerClientCoords(); + offsetLeft = offsets[0]; + offsetTop = offsets[1]; + containerWidth = offsets[2]; + containerHeight = offsets[3]; + + f1x1 = e.touches[0].clientX - offsetLeft; + f1y1 = e.touches[0].clientY - offsetTop; + + f2x1 = e.touches[1].clientX - offsetLeft; + f2y1 = e.touches[1].clientY - offsetTop; + + twoFingersStartInside = + 0 <= f1x1 && f1x1 <= containerWidth + && 0 <= f2x1 && f2x1 <= containerWidth + && 0 <= f1y1 && f1y1 <= containerHeight + && 0 <= f2y1 && f2y1 <= containerHeight + ; + + var pan = cy.pan(); + var zoom = cy.zoom(); + + distance1 = distance( f1x1, f1y1, f2x1, f2y1 ); + distance1Sq = distanceSq( f1x1, f1y1, f2x1, f2y1 ); + center1 = [ (f1x1 + f2x1) / 2, (f1y1 + f2y1) / 2 ]; + modelCenter1 = [ + (center1[0] - pan.x) / zoom, + (center1[1] - pan.y) / zoom + ]; + + // consider context tap + var cxtDistThreshold = 200; + var cxtDistThresholdSq = cxtDistThreshold * cxtDistThreshold; + if( distance1Sq < cxtDistThresholdSq && !e.touches[2] ){ + + var near1 = r.findNearestElement( now[0], now[1], true, true ); + var near2 = r.findNearestElement( now[2], now[3], true, true ); + + if( near1 && near1.isNode() ){ + near1.activate().emit( ( { + originalEvent: e, + type: 'cxttapstart', + position: { x: now[0], y: now[1] } + } ) ); + r.touchData.start = near1; + + } else if( near2 && near2.isNode() ){ + near2.activate().emit( ( { + originalEvent: e, + type: 'cxttapstart', + position: { x: now[0], y: now[1] } + } ) ); + r.touchData.start = near2; + + } else { + cy.emit( ( { + originalEvent: e, + type: 'cxttapstart', + position: { x: now[0], y: now[1] } + } ) ); + } + + if( r.touchData.start ){ r.touchData.start._private.grabbed = false; } + r.touchData.cxt = true; + r.touchData.cxtDragged = false; + r.data.bgActivePosistion = undefined; + + r.redraw(); + return; + + } + + } + + if( e.touches[2] ){ + // ignore + } else if( e.touches[1] ){ + // ignore + } else if( e.touches[0] ){ + var nears = r.findNearestElements( now[0], now[1], true, true ); + var near = nears[0]; + + if( near != null ){ + near.activate(); + + r.touchData.start = near; + r.touchData.starts = nears; + + if( r.nodeIsGrabbable( near ) ){ + + var draggedEles = r.dragData.touchDragEles = []; + var selectedNodes = null; + + r.redrawHint( 'eles', true ); + r.redrawHint( 'drag', true ); + + if( near.selected() ){ + // reset drag elements, since near will be added again + + selectedNodes = cy.$( function( ele ){ + return ele.selected() && r.nodeIsGrabbable( ele ); + } ); + + addNodesToDrag( selectedNodes, { addToList: draggedEles } ); + } else { + addNodeToDrag( near, { addToList: draggedEles } ); + } + + setGrabTarget( near ); + + var makeEvent = function( type ){ + return ( { + originalEvent: e, + type: type, + position: { x: now[0], y: now[1] } + } ); + }; + + near.emit( makeEvent('grabon') ) + + if( selectedNodes ){ + selectedNodes.forEach(function( n ){ n.emit( makeEvent('grab') ); }); + } else { + near.emit( makeEvent('grab') ); + } + } + } + + triggerEvents( near, [ 'touchstart', 'tapstart', 'vmousedown' ], e, { + position: { x: now[0], y: now[1] } + } ); + + if( near == null ){ + r.data.bgActivePosistion = { + x: pos[0], + y: pos[1] + }; + + r.redrawHint( 'select', true ); + r.redraw(); + } + + + // Tap, taphold + // ----- + + r.touchData.singleTouchMoved = false; + r.touchData.singleTouchStartTime = +new Date(); + + clearTimeout( r.touchData.tapholdTimeout ); + r.touchData.tapholdTimeout = setTimeout( function(){ + if( + r.touchData.singleTouchMoved === false + && !r.pinching // if pinching, then taphold unselect shouldn't take effect + && !r.touchData.selecting // box selection shouldn't allow taphold through + ){ + triggerEvents( r.touchData.start, [ 'taphold' ], e, { + position: { x: now[0], y: now[1] } + } ); + + if( !r.touchData.start ){ + cy.$( ':selected' ).unselect(); + } + + } + }, r.tapholdDuration ); + } + + if( e.touches.length >= 1 ){ + var sPos = r.touchData.startPosition = []; + + for( var i = 0; i < now.length; i++ ){ + sPos[i] = earlier[i] = now[i]; + } + + var touch0 = e.touches[0]; + + r.touchData.startGPosition = [ touch0.clientX, touch0.clientY ]; + } + + }, false ); + + var touchmoveHandler; + r.registerBinding(window, 'touchmove', touchmoveHandler = function(e) { // eslint-disable-line no-undef + var capture = r.touchData.capture; + + if( !capture && !eventInContainer(e) ){ return; } + + var select = r.selection; + var cy = r.cy; + var now = r.touchData.now; + var earlier = r.touchData.earlier; + var zoom = cy.zoom(); + + if( e.touches[0] ){ var pos = r.projectIntoViewport( e.touches[0].clientX, e.touches[0].clientY ); now[0] = pos[0]; now[1] = pos[1]; } + if( e.touches[1] ){ var pos = r.projectIntoViewport( e.touches[1].clientX, e.touches[1].clientY ); now[2] = pos[0]; now[3] = pos[1]; } + if( e.touches[2] ){ var pos = r.projectIntoViewport( e.touches[2].clientX, e.touches[2].clientY ); now[4] = pos[0]; now[5] = pos[1]; } + + var startGPos = r.touchData.startGPosition; + var isOverThresholdDrag; + + if( capture && e.touches[0] && startGPos ){ + var disp = []; for (var j=0;j= r.touchTapThreshold2; + } + + // context swipe cancelling + if( capture && r.touchData.cxt ){ + e.preventDefault(); + + var f1x2 = e.touches[0].clientX - offsetLeft, f1y2 = e.touches[0].clientY - offsetTop; + var f2x2 = e.touches[1].clientX - offsetLeft, f2y2 = e.touches[1].clientY - offsetTop; + // var distance2 = distance( f1x2, f1y2, f2x2, f2y2 ); + var distance2Sq = distanceSq( f1x2, f1y2, f2x2, f2y2 ); + var factorSq = distance2Sq / distance1Sq; + + var distThreshold = 150; + var distThresholdSq = distThreshold * distThreshold; + var factorThreshold = 1.5; + var factorThresholdSq = factorThreshold * factorThreshold; + + // cancel ctx gestures if the distance b/t the fingers increases + if( factorSq >= factorThresholdSq || distance2Sq >= distThresholdSq ){ + r.touchData.cxt = false; + + r.data.bgActivePosistion = undefined; + + r.redrawHint( 'select', true ); + + var cxtEvt = ( { + originalEvent: e, + type: 'cxttapend', + position: { x: now[0], y: now[1] } + } ); + + if( r.touchData.start ){ + r.touchData.start + .unactivate() + .emit( cxtEvt ) + ; + + r.touchData.start = null; + } else { + cy.emit( cxtEvt ); + } + } + + } + + // context swipe + if( capture && r.touchData.cxt ){ + var cxtEvt = ( { + originalEvent: e, + type: 'cxtdrag', + position: { x: now[0], y: now[1] } + } ); + r.data.bgActivePosistion = undefined; + r.redrawHint( 'select', true ); + + if( r.touchData.start ){ + r.touchData.start.emit( cxtEvt ); + } else { + cy.emit( cxtEvt ); + } + + if( r.touchData.start ){ r.touchData.start._private.grabbed = false; } + r.touchData.cxtDragged = true; + + var near = r.findNearestElement( now[0], now[1], true, true ); + + if( !r.touchData.cxtOver || near !== r.touchData.cxtOver ){ + + if( r.touchData.cxtOver ){ + r.touchData.cxtOver.emit( ( { + originalEvent: e, + type: 'cxtdragout', + position: { x: now[0], y: now[1] } + } ) ); + } + + r.touchData.cxtOver = near; + + if( near ){ + near.emit( ( { + originalEvent: e, + type: 'cxtdragover', + position: { x: now[0], y: now[1] } + } ) ); + + } + + } + + // box selection + } else if( capture && e.touches[2] && cy.boxSelectionEnabled() ){ + e.preventDefault(); + + r.data.bgActivePosistion = undefined; + + this.lastThreeTouch = +new Date(); + + if( !r.touchData.selecting ){ + cy.emit('boxstart'); + } + + r.touchData.selecting = true; + + r.redrawHint( 'select', true ); + + if( !select || select.length === 0 || select[0] === undefined ){ + select[0] = (now[0] + now[2] + now[4]) / 3; + select[1] = (now[1] + now[3] + now[5]) / 3; + select[2] = (now[0] + now[2] + now[4]) / 3 + 1; + select[3] = (now[1] + now[3] + now[5]) / 3 + 1; + } else { + select[2] = (now[0] + now[2] + now[4]) / 3; + select[3] = (now[1] + now[3] + now[5]) / 3; + } + + select[4] = 1; + r.touchData.selecting = true; + + r.redraw(); + + // pinch to zoom + } else if( capture && e.touches[1] && cy.zoomingEnabled() && cy.panningEnabled() && cy.userZoomingEnabled() && cy.userPanningEnabled() ){ // two fingers => pinch to zoom + e.preventDefault(); + + r.data.bgActivePosistion = undefined; + r.redrawHint( 'select', true ); + + var draggedEles = r.dragData.touchDragEles; + if( draggedEles ){ + r.redrawHint( 'drag', true ); + + for( var i = 0; i < draggedEles.length; i++ ){ + var de_p = draggedEles[i]._private; + + de_p.grabbed = false; + de_p.rscratch.inDragLayer = false; + } + } + + // (x2, y2) for fingers 1 and 2 + var f1x2 = e.touches[0].clientX - offsetLeft, f1y2 = e.touches[0].clientY - offsetTop; + var f2x2 = e.touches[1].clientX - offsetLeft, f2y2 = e.touches[1].clientY - offsetTop; + + + var distance2 = distance( f1x2, f1y2, f2x2, f2y2 ); + // var distance2Sq = distanceSq( f1x2, f1y2, f2x2, f2y2 ); + // var factor = Math.sqrt( distance2Sq ) / Math.sqrt( distance1Sq ); + var factor = distance2 / distance1; + + if( twoFingersStartInside ){ + // delta finger1 + var df1x = f1x2 - f1x1; + var df1y = f1y2 - f1y1; + + // delta finger 2 + var df2x = f2x2 - f2x1; + var df2y = f2y2 - f2y1; + + // translation is the normalised vector of the two fingers movement + // i.e. so pinching cancels out and moving together pans + var tx = (df1x + df2x) / 2; + var ty = (df1y + df2y) / 2; + + // adjust factor by the speed multiplier + // var speed = 1.5; + // if( factor > 1 ){ + // factor = (factor - 1) * speed + 1; + // } else { + // factor = 1 - (1 - factor) * speed; + // } + + // now calculate the zoom + var zoom1 = cy.zoom(); + var zoom2 = zoom1 * factor; + var pan1 = cy.pan(); + + // the model center point converted to the current rendered pos + var ctrx = modelCenter1[0] * zoom1 + pan1.x; + var ctry = modelCenter1[1] * zoom1 + pan1.y; + + var pan2 = { + x: -zoom2 / zoom1 * (ctrx - pan1.x - tx) + ctrx, + y: -zoom2 / zoom1 * (ctry - pan1.y - ty) + ctry + }; + + // remove dragged eles + if( r.touchData.start && r.touchData.start.active() ){ + var draggedEles = r.dragData.touchDragEles; + + freeDraggedElements( draggedEles ); + + r.redrawHint( 'drag', true ); + r.redrawHint( 'eles', true ); + + r.touchData.start + .unactivate() + .emit( 'free' ) + ; + } + + cy.viewport( { + zoom: zoom2, + pan: pan2, + cancelOnFailedZoom: true + } ); + + distance1 = distance2; + f1x1 = f1x2; + f1y1 = f1y2; + f2x1 = f2x2; + f2y1 = f2y2; + + r.pinching = true; + } + + // Re-project + if( e.touches[0] ){ var pos = r.projectIntoViewport( e.touches[0].clientX, e.touches[0].clientY ); now[0] = pos[0]; now[1] = pos[1]; } + if( e.touches[1] ){ var pos = r.projectIntoViewport( e.touches[1].clientX, e.touches[1].clientY ); now[2] = pos[0]; now[3] = pos[1]; } + if( e.touches[2] ){ var pos = r.projectIntoViewport( e.touches[2].clientX, e.touches[2].clientY ); now[4] = pos[0]; now[5] = pos[1]; } + + } else if( e.touches[0] ){ + var start = r.touchData.start; + var last = r.touchData.last; + var near; + + if( !r.hoverData.draggingEles && !r.swipePanning ){ + near = r.findNearestElement( now[0], now[1], true, true ); + } + + if( capture && start != null ){ + e.preventDefault(); + } + + // dragging nodes + if( capture && start != null && r.nodeIsDraggable( start ) ){ + + if( isOverThresholdDrag ){ // then dragging can happen + var draggedEles = r.dragData.touchDragEles; + var justStartedDrag = !r.dragData.didDrag; + + if( justStartedDrag ){ + addNodesToDrag( cy.collection( draggedEles ), { inDragLayer: true } ); + } + + for( var k = 0; k < draggedEles.length; k++ ){ + var draggedEle = draggedEles[ k ]; + + if( r.nodeIsDraggable( draggedEle ) && draggedEle.grabbed() ){ + r.dragData.didDrag = true; + var dPos = draggedEle.position(); + + if( is.number( disp[0] ) && is.number( disp[1] ) ){ + dPos.x += disp[0]; + dPos.y += disp[1]; + } + + if( justStartedDrag ){ + r.redrawHint( 'eles', true ); + + var dragDelta = r.touchData.dragDelta; + + if( dragDelta && is.number( dragDelta[0] ) && is.number( dragDelta[1] ) ){ + dPos.x += dragDelta[0]; + dPos.y += dragDelta[1]; + } + + } + } + } + + var tcol = cy.collection( draggedEles ); + + tcol.dirtyCompoundBoundsCache(); + tcol.emit( 'position drag' ); + + r.hoverData.draggingEles = true; + + r.redrawHint( 'drag', true ); + + if( + r.touchData.startPosition[0] == earlier[0] + && r.touchData.startPosition[1] == earlier[1] + ){ + + r.redrawHint( 'eles', true ); + } + + r.redraw(); + } else { // otherise keep track of drag delta for later + var dragDelta = r.touchData.dragDelta = r.touchData.dragDelta || []; + + if( dragDelta.length === 0 ){ + dragDelta.push( disp[0] ); + dragDelta.push( disp[1] ); + } else { + dragDelta[0] += disp[0]; + dragDelta[1] += disp[1]; + } + } + } + + // touchmove + { + triggerEvents( (start || near), [ 'touchmove', 'tapdrag', 'vmousemove' ], e, { + position: { x: now[0], y: now[1] } + } ); + + if( ( !start || !start.grabbed() ) && near != last ){ + if( last ){ last.emit( ( { originalEvent: e, type: 'tapdragout', position: { x: now[0], y: now[1] } } ) ); } + if( near ){ near.emit( ( { originalEvent: e, type: 'tapdragover', position: { x: now[0], y: now[1] } } ) ); } + } + + r.touchData.last = near; + } + + // check to cancel taphold + if( capture ){ + for( var i = 0; i < now.length; i++ ){ + if( now[ i ] + && r.touchData.startPosition[ i ] + && isOverThresholdDrag ){ + + r.touchData.singleTouchMoved = true; + } + } + } + + // panning + if( + capture + && ( start == null || start.isEdge() ) + && cy.panningEnabled() && cy.userPanningEnabled() + ){ + + var allowPassthrough = allowPanningPassthrough( start, r.touchData.starts ); + + if( allowPassthrough ){ + e.preventDefault(); + + if( r.swipePanning ){ + cy.panBy( { + x: disp[0] * zoom, + y: disp[1] * zoom + } ); + + } else if( isOverThresholdDrag ){ + r.swipePanning = true; + + cy.panBy( { + x: dx * zoom, + y: dy * zoom + } ); + + if( start ){ + start.unactivate(); + + if( !r.data.bgActivePosistion ){ + r.data.bgActivePosistion = math.array2point( r.touchData.startPosition ); + } + + r.redrawHint( 'select', true ); + + r.touchData.start = null; + } + } + + } + + // Re-project + var pos = r.projectIntoViewport( e.touches[0].clientX, e.touches[0].clientY ); + now[0] = pos[0]; now[1] = pos[1]; + } + } + + for( var j = 0; j < now.length; j++ ){ earlier[ j ] = now[ j ]; } + //r.redraw(); + + // the active bg indicator should be removed when making a swipe that is neither for dragging nodes or panning + if( capture && e.touches.length > 0 && !r.hoverData.draggingEles && !r.swipePanning && r.data.bgActivePosistion != null ){ + r.data.bgActivePosistion = undefined; + r.redrawHint( 'select', true ); + r.redraw(); + } + + }, false ); + var touchcancelHandler; + r.registerBinding( window, 'touchcancel', touchcancelHandler = function( e ){ // eslint-disable-line no-undef + var start = r.touchData.start; + + r.touchData.capture = false; + + if( start ){ + start.unactivate(); + } + } ); + + var touchendHandler; + r.registerBinding( window, 'touchend', touchendHandler = function( e ){ // eslint-disable-line no-undef + var start = r.touchData.start; + + var capture = r.touchData.capture; + + if( capture ){ + if( e.touches.length === 0 ){ + r.touchData.capture = false; + } + + e.preventDefault(); + } else { + return; + } + + var select = r.selection; + + r.swipePanning = false; + r.hoverData.draggingEles = false; + + var cy = r.cy; + var zoom = cy.zoom(); + var now = r.touchData.now; + var earlier = r.touchData.earlier; + + if( e.touches[0] ){ var pos = r.projectIntoViewport( e.touches[0].clientX, e.touches[0].clientY ); now[0] = pos[0]; now[1] = pos[1]; } + if( e.touches[1] ){ var pos = r.projectIntoViewport( e.touches[1].clientX, e.touches[1].clientY ); now[2] = pos[0]; now[3] = pos[1]; } + if( e.touches[2] ){ var pos = r.projectIntoViewport( e.touches[2].clientX, e.touches[2].clientY ); now[4] = pos[0]; now[5] = pos[1]; } + + if( start ){ + start.unactivate(); + } + + var ctxTapend; + if( r.touchData.cxt ){ + ctxTapend = ( { + originalEvent: e, + type: 'cxttapend', + position: { x: now[0], y: now[1] } + } ); + + if( start ){ + start.emit( ctxTapend ); + } else { + cy.emit( ctxTapend ); + } + + if( !r.touchData.cxtDragged ){ + var ctxTap = ( { + originalEvent: e, + type: 'cxttap', + position: { x: now[0], y: now[1] } + } ); + + if( start ){ + start.emit( ctxTap ); + } else { + cy.emit( ctxTap ); + } + + } + + if( r.touchData.start ){ r.touchData.start._private.grabbed = false; } + r.touchData.cxt = false; + r.touchData.start = null; + + r.redraw(); + return; + } + + // no more box selection if we don't have three fingers + if( !e.touches[2] && cy.boxSelectionEnabled() && r.touchData.selecting ){ + r.touchData.selecting = false; + + var box = cy.collection( r.getAllInBox( select[0], select[1], select[2], select[3] ) ); + + select[0] = undefined; + select[1] = undefined; + select[2] = undefined; + select[3] = undefined; + select[4] = 0; + + r.redrawHint( 'select', true ); + + cy.emit('boxend'); + + var eleWouldBeSelected = function( ele ){ return ele.selectable() && !ele.selected(); }; + + box + .emit('box') + .stdFilter( eleWouldBeSelected ) + .select() + .emit('boxselect') + ; + + if( box.nonempty() ){ + r.redrawHint( 'eles', true ); + } + + r.redraw(); + } + + if( start != null ){ + start.unactivate(); + } + + if( e.touches[2] ){ + r.data.bgActivePosistion = undefined; + r.redrawHint( 'select', true ); + } else if( e.touches[1] ){ + // ignore + } else if( e.touches[0] ){ + // ignore + + // Last touch released + } else if( !e.touches[0] ){ + + r.data.bgActivePosistion = undefined; + r.redrawHint( 'select', true ); + + var draggedEles = r.dragData.touchDragEles; + + if( start != null ){ + + var startWasGrabbed = start._private.grabbed; + + freeDraggedElements( draggedEles ); + + r.redrawHint( 'drag', true ); + r.redrawHint( 'eles', true ); + + if( startWasGrabbed ){ + start.emit( 'free' ); + } + + triggerEvents( start, [ 'touchend', 'tapend', 'vmouseup', 'tapdragout' ], e, { + position: { x: now[0], y: now[1] } + } ); + + start.unactivate(); + + r.touchData.start = null; + + } else { + var near = r.findNearestElement( now[0], now[1], true, true ); + + triggerEvents( near, [ 'touchend', 'tapend', 'vmouseup', 'tapdragout' ], e, { + position: { x: now[0], y: now[1] } + } ); + + } + + var dx = r.touchData.startPosition[0] - now[0]; + var dx2 = dx * dx; + var dy = r.touchData.startPosition[1] - now[1]; + var dy2 = dy * dy; + var dist2 = dx2 + dy2; + var rdist2 = dist2 * zoom * zoom; + + // Prepare to select the currently touched node, only if it hasn't been dragged past a certain distance + if( start != null + && !r.dragData.didDrag // didn't drag nodes around + && start._private.selectable + && rdist2 < r.touchTapThreshold2 + && !r.pinching // pinch to zoom should not affect selection + ){ + + if( cy.selectionType() === 'single' ){ + cy.$( ':selected' ).unmerge( start ).unselect(); + start.select(); + } else { + if( start.selected() ){ + start.unselect(); + } else { + start.select(); + } + } + + r.redrawHint( 'eles', true ); + } + + // Tap event, roughly same as mouse click event for touch + if( !r.touchData.singleTouchMoved ){ + triggerEvents( start, [ 'tap', 'vclick' ], e, { + position: { x: now[0], y: now[1] } + } ); + } + + r.touchData.singleTouchMoved = true; + } + + for( var j = 0; j < now.length; j++ ){ earlier[ j ] = now[ j ]; } + + r.dragData.didDrag = false; // reset for next mousedown + + if( e.touches.length === 0 ){ + r.touchData.dragDelta = []; + r.touchData.startPosition = null; + r.touchData.startGPosition = null; + } + + if( e.touches.length < 2 ){ + r.pinching = false; + r.redrawHint( 'eles', true ); + r.redraw(); + } + + //r.redraw(); + + }, false ); + + // fallback compatibility layer for ms pointer events + if( typeof TouchEvent === 'undefined' ){ + + var pointers = []; + + var makeTouch = function( e ){ + return { + clientX: e.clientX, + clientY: e.clientY, + force: 1, + identifier: e.pointerId, + pageX: e.pageX, + pageY: e.pageY, + radiusX: e.width / 2, + radiusY: e.height / 2, + screenX: e.screenX, + screenY: e.screenY, + target: e.target + }; + }; + + var makePointer = function( e ){ + return { + event: e, + touch: makeTouch( e ) + }; + }; + + var addPointer = function( e ){ + pointers.push( makePointer( e ) ); + }; + + var removePointer = function( e ){ + for( var i = 0; i < pointers.length; i++ ){ + var p = pointers[ i ]; + + if( p.event.pointerId === e.pointerId ){ + pointers.splice( i, 1 ); + return; + } + } + }; + + var updatePointer = function( e ){ + var p = pointers.filter( function( p ){ + return p.event.pointerId === e.pointerId; + } )[0]; + + p.event = e; + p.touch = makeTouch( e ); + }; + + var addTouchesToEvent = function( e ){ + e.touches = pointers.map( function( p ){ + return p.touch; + } ); + }; + + var pointerIsMouse = function( e ){ + return e.pointerType === 'mouse' || e.pointerType === 4; + }; + + r.registerBinding( r.container, 'pointerdown', function( e ){ + if( pointerIsMouse(e) ){ return; } // mouse already handled + + e.preventDefault(); + + addPointer( e ); + + addTouchesToEvent( e ); + touchstartHandler( e ); + } ); + + r.registerBinding( r.container, 'pointerup', function( e ){ + if( pointerIsMouse(e) ){ return; } // mouse already handled + + removePointer( e ); + + addTouchesToEvent( e ); + touchendHandler( e ); + } ); + + r.registerBinding( r.container, 'pointercancel', function( e ){ + if( pointerIsMouse(e) ){ return; } // mouse already handled + + removePointer( e ); + + addTouchesToEvent( e ); + touchcancelHandler( e ); + } ); + + r.registerBinding( r.container, 'pointermove', function( e ){ + if( pointerIsMouse(e) ){ return; } // mouse already handled + + e.preventDefault(); + + updatePointer( e ); + + addTouchesToEvent( e ); + touchmoveHandler( e ); + } ); + + } +}; + +module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/node-shapes.js b/node_modules/cytoscape/src/extensions/renderer/base/node-shapes.js new file mode 100644 index 000000000..ce716c69f --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/base/node-shapes.js @@ -0,0 +1,560 @@ +var math = require('../../../math'); + +var BRp = {}; + +BRp.generatePolygon = function( name, points ){ + return ( this.nodeShapes[ name ] = { + renderer: this, + + name: name, + + points: points, + + draw: function( context, centerX, centerY, width, height ){ + this.renderer.nodeShapeImpl( 'polygon', context, centerX, centerY, width, height, this.points ); + }, + + intersectLine: function( nodeX, nodeY, width, height, x, y, padding ){ + return math.polygonIntersectLine( + x, y, + this.points, + nodeX, + nodeY, + width / 2, height / 2, + padding ) + ; + }, + + checkPoint: function( x, y, padding, width, height, centerX, centerY ){ + return math.pointInsidePolygon( x, y, this.points, + centerX, centerY, width, height, [0, -1], padding ) + ; + } + } ); +}; + +BRp.generateEllipse = function(){ + return ( this.nodeShapes['ellipse'] = { + renderer: this, + + name: 'ellipse', + + draw: function( context, centerX, centerY, width, height ){ + this.renderer.nodeShapeImpl( this.name, context, centerX, centerY, width, height ); + }, + + intersectLine: function( nodeX, nodeY, width, height, x, y, padding ){ + return math.intersectLineEllipse( + x, y, + nodeX, + nodeY, + width / 2 + padding, + height / 2 + padding ) + ; + }, + + checkPoint: function( x, y, padding, width, height, centerX, centerY ){ + return math.checkInEllipse( x, y, width, height, centerX, centerY, padding ); + } + } ); +}; + +BRp.generateRoundRectangle = function(){ + return ( this.nodeShapes['roundrectangle'] = { + renderer: this, + + name: 'roundrectangle', + + points: math.generateUnitNgonPointsFitToSquare( 4, 0 ), + + draw: function( context, centerX, centerY, width, height ){ + this.renderer.nodeShapeImpl( this.name, context, centerX, centerY, width, height ); + }, + + intersectLine: function( nodeX, nodeY, width, height, x, y, padding ){ + return math.roundRectangleIntersectLine( + x, y, + nodeX, + nodeY, + width, height, + padding ) + ; + }, + + checkPoint: function( + x, y, padding, width, height, centerX, centerY ){ + + var cornerRadius = math.getRoundRectangleRadius( width, height ); + var diam = cornerRadius * 2; + + // Check hBox + if( math.pointInsidePolygon( x, y, this.points, + centerX, centerY, width, height - diam, [0, -1], padding ) ){ + return true; + } + + // Check vBox + if( math.pointInsidePolygon( x, y, this.points, + centerX, centerY, width - diam, height, [0, -1], padding ) ){ + return true; + } + + // Check top left quarter circle + if( math.checkInEllipse( x, y, + diam, diam, + centerX - width / 2 + cornerRadius, + centerY - height / 2 + cornerRadius, + padding ) ){ + + return true; + } + + // Check top right quarter circle + if( math.checkInEllipse( x, y, + diam, diam, + centerX + width / 2 - cornerRadius, + centerY - height / 2 + cornerRadius, + padding ) ){ + + return true; + } + + // Check bottom right quarter circle + if( math.checkInEllipse( x, y, + diam, diam, + centerX + width / 2 - cornerRadius, + centerY + height / 2 - cornerRadius, + padding ) ){ + + return true; + } + + // Check bottom left quarter circle + if( math.checkInEllipse( x, y, + diam, diam, + centerX - width / 2 + cornerRadius, + centerY + height / 2 - cornerRadius, + padding ) ){ + + return true; + } + + return false; + } + } ); +}; + +BRp.generateCutRectangle = function(){ + return ( this.nodeShapes['cutrectangle'] = { + renderer: this, + + name: 'cutrectangle', + + cornerLength: math.getCutRectangleCornerLength(), + + points: math.generateUnitNgonPointsFitToSquare( 4, 0 ), + + draw: function( context, centerX, centerY, width, height ){ + this.renderer.nodeShapeImpl( this.name, context, centerX, centerY, width, height ); + }, + + generateCutTrianglePts: function( width, height, centerX, centerY ){ + var cl = this.cornerLength; + var hh = height / 2; + var hw = width / 2; + var xBegin = centerX - hw; + var xEnd = centerX + hw; + var yBegin = centerY - hh; + var yEnd = centerY + hh; + + // points are in clockwise order, inner (imaginary) triangle pt on [4, 5] + return { + topLeft: [ xBegin, yBegin + cl, xBegin + cl, yBegin, xBegin + cl, yBegin + cl ], + topRight: [ xEnd - cl, yBegin, xEnd, yBegin + cl, xEnd - cl, yBegin + cl ], + bottomRight: [ xEnd, yEnd - cl, xEnd - cl, yEnd, xEnd - cl, yEnd - cl ], + bottomLeft: [ xBegin + cl, yEnd, xBegin, yEnd - cl, xBegin + cl, yEnd - cl ] + }; + }, + + intersectLine: function( nodeX, nodeY, width, height, x, y, padding ){ + var cPts = this.generateCutTrianglePts( width + 2*padding, height+2*padding, nodeX, nodeY ); + var pts = [].concat.apply([], + [cPts.topLeft.splice(0, 4), cPts.topRight.splice(0, 4), + cPts.bottomRight.splice(0, 4), cPts.bottomLeft.splice(0, 4) + ]); + + return math.polygonIntersectLine( x, y, pts, nodeX, nodeY ); + }, + + checkPoint: function( x, y, padding, width, height, centerX, centerY ){ + // Check hBox + if( math.pointInsidePolygon( x, y, this.points, + centerX, centerY, width, height - 2 * this.cornerLength, [0, -1], padding ) ){ + return true; + } + + // Check vBox + if( math.pointInsidePolygon( x, y, this.points, + centerX, centerY, width - 2 * this.cornerLength, height, [0, -1], padding ) ){ + return true; + } + var cutTrianglePts = this.generateCutTrianglePts(width, height, centerX, centerY); + return math.pointInsidePolygonPoints( x, y, cutTrianglePts.topLeft) + || math.pointInsidePolygonPoints( x, y, cutTrianglePts.topRight ) + || math.pointInsidePolygonPoints( x, y, cutTrianglePts.bottomRight ) + || math.pointInsidePolygonPoints( x, y, cutTrianglePts.bottomLeft ); + } + + } ); +}; + +BRp.generateBarrel = function(){ + return ( this.nodeShapes['barrel'] = { + renderer: this, + + name: 'barrel', + + points: math.generateUnitNgonPointsFitToSquare( 4, 0 ), + + draw: function( context, centerX, centerY, width, height ){ + this.renderer.nodeShapeImpl( this.name, context, centerX, centerY, width, height ); + }, + + intersectLine: function( nodeX, nodeY, width, height, x, y, padding ){ + // use two fixed t values for the bezier curve approximation + + var t0 = 0.15; + var t1 = 0.5; + var t2 = 0.85; + + var bPts = this.generateBarrelBezierPts( width + 2*padding, height + 2*padding, nodeX, nodeY ); + + var approximateBarrelCurvePts = pts => { + // approximate curve pts based on the two t values + var m0 = math.qbezierPtAt({x: pts[0], y: pts[1]}, {x: pts[2], y: pts[3]}, {x: pts[4], y: pts[5]}, t0); + var m1 = math.qbezierPtAt({x: pts[0], y: pts[1]}, {x: pts[2], y: pts[3]}, {x: pts[4], y: pts[5]}, t1); + var m2 = math.qbezierPtAt({x: pts[0], y: pts[1]}, {x: pts[2], y: pts[3]}, {x: pts[4], y: pts[5]}, t2); + + return [ + pts[0],pts[1], + m0.x, m0.y, + m1.x, m1.y, + m2.x, m2.y, + pts[4], pts[5] + ]; + }; + + var pts = [].concat( + approximateBarrelCurvePts(bPts.topLeft), + approximateBarrelCurvePts(bPts.topRight), + approximateBarrelCurvePts(bPts.bottomRight), + approximateBarrelCurvePts(bPts.bottomLeft) + ); + + return math.polygonIntersectLine( x, y, pts, nodeX, nodeY ); + }, + + generateBarrelBezierPts: function( width, height, centerX, centerY ){ + var hh = height / 2; + var hw = width / 2; + var xBegin = centerX - hw; + var xEnd = centerX + hw; + var yBegin = centerY - hh; + var yEnd = centerY + hh; + + var curveConstants = math.getBarrelCurveConstants( width, height ); + var hOffset = curveConstants.heightOffset; + var wOffset = curveConstants.widthOffset; + var ctrlPtXOffset = curveConstants.ctrlPtOffsetPct * width; + + // points are in clockwise order, inner (imaginary) control pt on [4, 5] + var pts = { + topLeft: [ xBegin, yBegin + hOffset, xBegin + ctrlPtXOffset, yBegin, xBegin + wOffset, yBegin ], + topRight: [ xEnd - wOffset, yBegin, xEnd - ctrlPtXOffset, yBegin, xEnd, yBegin + hOffset ], + bottomRight: [ xEnd, yEnd - hOffset, xEnd - ctrlPtXOffset, yEnd, xEnd - wOffset, yEnd ], + bottomLeft: [ xBegin + wOffset, yEnd, xBegin + ctrlPtXOffset, yEnd, xBegin, yEnd - hOffset ] + }; + + pts.topLeft.isTop = true; + pts.topRight.isTop = true; + pts.bottomLeft.isBottom = true; + pts.bottomRight.isBottom = true; + + return pts; + }, + + checkPoint: function( + x, y, padding, width, height, centerX, centerY ){ + + var curveConstants = math.getBarrelCurveConstants( width, height ); + var hOffset = curveConstants.heightOffset; + var wOffset = curveConstants.widthOffset; + + // Check hBox + if( math.pointInsidePolygon( x, y, this.points, + centerX, centerY, width, height - 2 * hOffset, [0, -1], padding ) ){ + return true; + } + + // Check vBox + if( math.pointInsidePolygon( x, y, this.points, + centerX, centerY, width - 2 * wOffset, height, [0, -1], padding ) ){ + return true; + } + + var barrelCurvePts = this.generateBarrelBezierPts( width, height, centerX, centerY ); + + var getCurveT = function (x, y, curvePts) { + var x0 = curvePts[ 4 ]; + var x1 = curvePts[ 2 ]; + var x2 = curvePts[ 0 ]; + var y0 = curvePts[ 5 ]; + // var y1 = curvePts[ 3 ]; + var y2 = curvePts[ 1 ]; + + var xMin = Math.min( x0, x2 ); + var xMax = Math.max( x0, x2 ); + var yMin = Math.min( y0, y2 ); + var yMax = Math.max( y0, y2 ); + + if( xMin <= x && x <= xMax && yMin <= y && y <= yMax ){ + var coeff = math.bezierPtsToQuadCoeff( x0, x1, x2 ); + var roots = math.solveQuadratic( coeff[0], coeff[1], coeff[2], x ); + + var validRoots = roots.filter(function( r ){ + return 0 <= r && r <= 1; + }); + + if( validRoots.length > 0 ){ + return validRoots[ 0 ]; + } + } + return null; + }; + + var curveRegions = Object.keys( barrelCurvePts ); + for( var i = 0; i < curveRegions.length; i++ ){ + var corner = curveRegions[ i ]; + var cornerPts = barrelCurvePts[ corner ]; + var t = getCurveT( x, y, cornerPts ); + + if( t == null ){ continue; } + + var y0 = cornerPts[ 5 ]; + var y1 = cornerPts[ 3 ]; + var y2 = cornerPts[ 1 ]; + var bezY = math.qbezierAt( y0, y1, y2, t ); + + if( cornerPts.isTop && bezY <= y ){ + return true; + } + if( cornerPts.isBottom && y <= bezY ){ + return true; + } + } + return false; + } + } ); +}; + +BRp.generateBottomRoundrectangle = function(){ + return ( this.nodeShapes['bottomroundrectangle'] = { + renderer: this, + + name: 'bottomroundrectangle', + + points: math.generateUnitNgonPointsFitToSquare( 4, 0 ), + + draw: function( context, centerX, centerY, width, height ){ + this.renderer.nodeShapeImpl( this.name, context, centerX, centerY, width, height ); + }, + + intersectLine: function( nodeX, nodeY, width, height, x, y, padding ){ + var topStartX = nodeX - ( width / 2 + padding ); + var topStartY = nodeY - ( height / 2 + padding ); + var topEndY = topStartY; + var topEndX = nodeX + ( width / 2 + padding ); + + var topIntersections = math.finiteLinesIntersect( + x, y, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false ); + if( topIntersections.length > 0 ){ + return topIntersections; + } + + return math.roundRectangleIntersectLine( + x, y, + nodeX, + nodeY, + width, height, + padding ) + ; + }, + + checkPoint: function( + x, y, padding, width, height, centerX, centerY ){ + + var cornerRadius = math.getRoundRectangleRadius( width, height ); + var diam = 2 * cornerRadius; + + // Check hBox + if( math.pointInsidePolygon( x, y, this.points, + centerX, centerY, width, height - diam, [0, -1], padding ) ){ + return true; + } + + // Check vBox + if( math.pointInsidePolygon( x, y, this.points, + centerX, centerY, width - diam, height, [0, -1], padding ) ){ + return true; + } + + // check non-rounded top side + var outerWidth = ( ( width / 2 ) + 2 * padding ); + var outerHeight = ( ( height / 2 ) + 2 * padding ); + var points = [ + centerX - outerWidth, centerY - outerHeight, + centerX - outerWidth, centerY, + centerX + outerWidth, centerY, + centerX + outerWidth, centerY - outerHeight + ]; + if( math.pointInsidePolygonPoints( x, y, points) ){ + return true; + } + + // Check bottom right quarter circle + if( math.checkInEllipse( x, y, + diam, diam, + centerX + width / 2 - cornerRadius, + centerY + height / 2 - cornerRadius, + padding ) ){ + + return true; + } + + // Check bottom left quarter circle + if( math.checkInEllipse( x, y, + diam, diam, + centerX - width / 2 + cornerRadius, + centerY + height / 2 - cornerRadius, + padding ) ){ + + return true; + } + + return false; + } + } ); +}; + + +BRp.registerNodeShapes = function(){ + var nodeShapes = this.nodeShapes = {}; + var renderer = this; + + this.generateEllipse(); + + this.generatePolygon( 'triangle', math.generateUnitNgonPointsFitToSquare( 3, 0 ) ); + + this.generatePolygon( 'rectangle', math.generateUnitNgonPointsFitToSquare( 4, 0 ) ); + nodeShapes[ 'square' ] = nodeShapes[ 'rectangle' ]; + + this.generateRoundRectangle(); + + this.generateCutRectangle(); + + this.generateBarrel(); + + this.generateBottomRoundrectangle(); + + this.generatePolygon( 'diamond', [ + 0, 1, + 1, 0, + 0, -1, + -1, 0 + ] ); + + this.generatePolygon( 'pentagon', math.generateUnitNgonPointsFitToSquare( 5, 0 ) ); + + this.generatePolygon( 'hexagon', math.generateUnitNgonPointsFitToSquare( 6, 0 ) ); + + this.generatePolygon( 'heptagon', math.generateUnitNgonPointsFitToSquare( 7, 0 ) ); + + this.generatePolygon( 'octagon', math.generateUnitNgonPointsFitToSquare( 8, 0 ) ); + + var star5Points = new Array( 20 ); + { + var outerPoints = math.generateUnitNgonPoints( 5, 0 ); + var innerPoints = math.generateUnitNgonPoints( 5, Math.PI / 5 ); + + // Outer radius is 1; inner radius of star is smaller + var innerRadius = 0.5 * (3 - Math.sqrt( 5 )); + innerRadius *= 1.57; + + for( var i = 0;i < innerPoints.length / 2;i++ ){ + innerPoints[ i * 2] *= innerRadius; + innerPoints[ i * 2 + 1] *= innerRadius; + } + + for( var i = 0;i < 20 / 4;i++ ){ + star5Points[ i * 4] = outerPoints[ i * 2]; + star5Points[ i * 4 + 1] = outerPoints[ i * 2 + 1]; + + star5Points[ i * 4 + 2] = innerPoints[ i * 2]; + star5Points[ i * 4 + 3] = innerPoints[ i * 2 + 1]; + } + } + + star5Points = math.fitPolygonToSquare( star5Points ); + + this.generatePolygon( 'star', star5Points ); + + this.generatePolygon( 'vee', [ + -1, -1, + 0, -0.333, + 1, -1, + 0, 1 + ] ); + + this.generatePolygon( 'rhomboid', [ + -1, -1, + 0.333, -1, + 1, 1, + -0.333, 1 + ] ); + + this.generatePolygon( 'concavehexagon', [ + -1, -0.95, + -0.75, 0, + -1, 0.95, + 1, 0.95, + 0.75, 0, + 1, -0.95 + ] ); + + this.generatePolygon( 'tag', [ + -1, -1, + 0.25, -1, + 1, 0, + 0.25,1, + -1, 1 + ]); + + nodeShapes.makePolygon = function( points ){ + + // use caching on user-specified polygons so they are as fast as native shapes + + var key = points.join( '$' ); + var name = 'polygon-' + key; + var shape; + + if( (shape = this[ name ]) ){ // got cached shape + return shape; + } + + // create and cache new shape + return renderer.generatePolygon( name, points ); + }; + +}; + +module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/redraw.js b/node_modules/cytoscape/src/extensions/renderer/base/redraw.js new file mode 100644 index 000000000..7be88fc31 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/base/redraw.js @@ -0,0 +1,101 @@ +var util = require( '../../../util' ); + +var BRp = {}; + +BRp.timeToRender = function(){ + return this.redrawTotalTime / this.redrawCount; +}; + +BRp.redraw = function( options ){ + options = options || util.staticEmptyObject(); + + var r = this; + + if( r.averageRedrawTime === undefined ){ r.averageRedrawTime = 0; } + if( r.lastRedrawTime === undefined ){ r.lastRedrawTime = 0; } + if( r.lastDrawTime === undefined ){ r.lastDrawTime = 0; } + + r.requestedFrame = true; + r.renderOptions = options; +}; + +BRp.beforeRender = function( fn, priority ){ + // the renderer can't add tick callbacks when destroyed + if( this.destroyed ){ return; } + + priority = priority || 0; + + var cbs = this.beforeRenderCallbacks; + + cbs.push({ fn: fn, priority: priority }); + + // higher priority callbacks executed first + cbs.sort(function( a, b ){ return b.priority - a.priority; }); +}; + +var beforeRenderCallbacks = function( r, willDraw, startTime ){ + var cbs = r.beforeRenderCallbacks; + + for( var i = 0; i < cbs.length; i++ ){ + cbs[i].fn( willDraw, startTime ); + } +}; + +BRp.startRenderLoop = function(){ + var r = this; + + if( r.renderLoopStarted ){ + return; + } else { + r.renderLoopStarted = true; + } + + var renderFn = function( requestTime ){ + if( r.destroyed ){ return; } + + if( r.requestedFrame && !r.skipFrame ){ + beforeRenderCallbacks( r, true, requestTime ); + + var startTime = util.performanceNow(); + + r.render( r.renderOptions ); + + var endTime = r.lastDrawTime = util.performanceNow(); + + if( r.averageRedrawTime === undefined ){ + r.averageRedrawTime = endTime - startTime; + } + + if( r.redrawCount === undefined ){ + r.redrawCount = 0; + } + + r.redrawCount++; + + if( r.redrawTotalTime === undefined ){ + r.redrawTotalTime = 0; + } + + var duration = endTime - startTime; + + r.redrawTotalTime += duration; + r.lastRedrawTime = duration; + + // use a weighted average with a bias from the previous average so we don't spike so easily + r.averageRedrawTime = r.averageRedrawTime / 2 + duration / 2; + + r.requestedFrame = false; + } else { + beforeRenderCallbacks( r, false, requestTime ); + } + + r.skipFrame = false; + + util.requestAnimationFrame( renderFn ); + }; + + util.requestAnimationFrame( renderFn ); + +}; + +module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/arrow-shapes.js b/node_modules/cytoscape/src/extensions/renderer/canvas/arrow-shapes.js new file mode 100644 index 000000000..d47e76743 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/canvas/arrow-shapes.js @@ -0,0 +1,89 @@ +var CRp = {}; + +var impl; + +CRp.arrowShapeImpl = function( name ){ + return ( impl || (impl = { + 'polygon': function( context, points ){ + for( var i = 0; i < points.length; i++ ){ + var pt = points[ i ]; + + context.lineTo( pt.x, pt.y ); + } + }, + + 'triangle-backcurve': function( context, points, controlPoint ){ + var firstPt; + + for( var i = 0; i < points.length; i++ ){ + var pt = points[ i ]; + + if( i === 0 ){ + firstPt = pt; + } + + context.lineTo( pt.x, pt.y ); + } + + context.quadraticCurveTo( controlPoint.x, controlPoint.y, firstPt.x, firstPt.y ); + }, + + 'triangle-tee': function( context, trianglePoints, teePoints ){ + if( context.beginPath ){ context.beginPath(); } + + var triPts = trianglePoints; + for( var i = 0; i < triPts.length; i++ ){ + var pt = triPts[ i ]; + + context.lineTo( pt.x, pt.y ); + } + + if( context.closePath ){ context.closePath(); } + + if( context.beginPath ){ context.beginPath(); } + + var teePts = teePoints; + var firstTeePt = teePoints[0]; + context.moveTo( firstTeePt.x, firstTeePt.y ); + + for( var i = 0; i < teePts.length; i++ ){ + var pt = teePts[ i ]; + + context.lineTo( pt.x, pt.y ); + } + if( context.closePath ){ context.closePath(); } + }, + + 'triangle-cross': function( context, trianglePoints, crossLinePoints ){ + if( context.beginPath ){ context.beginPath(); } + + var triPts = trianglePoints; + for( var i = 0; i < triPts.length; i++ ){ + var pt = triPts[ i ]; + + context.lineTo( pt.x, pt.y ); + } + + if( context.closePath ){ context.closePath(); } + + if( context.beginPath ){ context.beginPath(); } + + var teePts = crossLinePoints; + var firstTeePt = crossLinePoints[0]; + context.moveTo( firstTeePt.x, firstTeePt.y ); + + for( var i = 0; i < teePts.length; i++ ){ + var pt = teePts[ i ]; + + context.lineTo( pt.x, pt.y ); + } + if( context.closePath ){ context.closePath(); } + }, + + 'circle': function( context, rx, ry, r ){ + context.arc( rx, ry, r, 0, Math.PI * 2, false ); + } + }) )[ name ]; +}; + +module.exports = CRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-edges.js b/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-edges.js new file mode 100644 index 000000000..ed33fbcd4 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-edges.js @@ -0,0 +1,293 @@ +let CRp = {}; + +CRp.drawEdge = function( context, edge, shiftToOriginWithBb, drawLabel ){ + let r = this; + let rs = edge._private.rscratch; + let usePaths = r.usePaths(); + + if( !edge.visible() ){ return; } + + // if bezier ctrl pts can not be calculated, then die + if( rs.badLine || rs.allpts == null || isNaN(rs.allpts[0]) ){ // isNaN in case edge is impossible and browser bugs (e.g. safari) + return; + } + + let bb; + if( shiftToOriginWithBb ){ + bb = shiftToOriginWithBb; + + context.translate( -bb.x1, -bb.y1 ); + } + + let overlayPadding = edge.pstyle('overlay-padding').pfValue; + let overlayWidth = 2 * overlayPadding; + let overlayOpacity = edge.pstyle('overlay-opacity').value; + let overlayColor = edge.pstyle('overlay-color').value; + let lineColor = edge.pstyle('line-color').value; + let opacity = edge.pstyle('opacity').value; + let lineStyle = edge.pstyle('line-style').value; + let edgeWidth = edge.pstyle('width').pfValue; + + let drawLine = ( strokeOpacity = opacity ) => { + context.lineWidth = edgeWidth; + context.lineCap = 'butt'; + + r.strokeStyle( context, lineColor[0], lineColor[1], lineColor[2], strokeOpacity ); + + r.drawEdgePath( + edge, + context, + rs.allpts, + lineStyle + ); + }; + + let drawOverlay = ( strokeOpacity = overlayOpacity ) => { + context.lineWidth = overlayWidth; + + if( rs.edgeType === 'self' && !usePaths ){ + context.lineCap = 'butt'; + } else { + context.lineCap = 'round'; + } + + r.strokeStyle( context, overlayColor[0], overlayColor[1], overlayColor[2], strokeOpacity ); + + r.drawEdgePath( + edge, + context, + rs.allpts, + 'solid' + ); + }; + + let drawArrows = ( arrowOpacity = opacity ) => { + r.drawArrowheads( context, edge, arrowOpacity ); + }; + + let drawText = () => { + r.drawElementText( context, edge, drawLabel ); + }; + + context.lineJoin = 'round'; + + let ghost = edge.pstyle('ghost').value === 'yes'; + + if( ghost ){ + let gx = edge.pstyle('ghost-offset-x').pfValue; + let gy = edge.pstyle('ghost-offset-y').pfValue; + let ghostOpacity = edge.pstyle('ghost-opacity').value; + let effectiveGhostOpacity = opacity * ghostOpacity; + + context.translate( gx, gy ); + + drawLine( effectiveGhostOpacity ); + drawArrows( effectiveGhostOpacity ); + + context.translate( -gx, -gy ); + } + + drawLine(); + drawArrows(); + drawOverlay(); + drawText(); + + if( shiftToOriginWithBb ){ + context.translate( bb.x1, bb.y1 ); + } +}; + + +CRp.drawEdgePath = function( edge, context, pts, type ){ + let rs = edge._private.rscratch; + let canvasCxt = context; + let path; + let pathCacheHit = false; + let usePaths = this.usePaths(); + + if( usePaths ){ + let pathCacheKey = pts.join( '$' ); + let keyMatches = rs.pathCacheKey && rs.pathCacheKey === pathCacheKey; + + if( keyMatches ){ + path = context = rs.pathCache; + pathCacheHit = true; + } else { + path = context = new Path2D(); // eslint-disable-line no-undef + rs.pathCacheKey = pathCacheKey; + rs.pathCache = path; + } + } + + if( canvasCxt.setLineDash ){ // for very outofdate browsers + switch( type ){ + case 'dotted': + canvasCxt.setLineDash( [ 1, 1 ] ); + break; + + case 'dashed': + canvasCxt.setLineDash( [ 6, 3 ] ); + break; + + case 'solid': + canvasCxt.setLineDash( [ ] ); + break; + } + } + + if( !pathCacheHit && !rs.badLine ){ + if( context.beginPath ){ context.beginPath(); } + context.moveTo( pts[0], pts[1] ); + + switch( rs.edgeType ){ + case 'bezier': + case 'self': + case 'compound': + case 'multibezier': + for( let i = 2; i + 3 < pts.length; i += 4 ){ + context.quadraticCurveTo( pts[ i ], pts[ i + 1], pts[ i + 2], pts[ i + 3] ); + } + break; + + case 'straight': + case 'segments': + case 'haystack': + for( let i = 2; i + 1 < pts.length; i += 2 ){ + context.lineTo( pts[ i ], pts[ i + 1] ); + } + break; + } + } + + context = canvasCxt; + if( usePaths ){ + context.stroke( path ); + } else { + context.stroke(); + } + + // reset any line dashes + if( context.setLineDash ){ // for very outofdate browsers + context.setLineDash( [ ] ); + } + +}; + +CRp.drawArrowheads = function( context, edge, opacity ){ + let rs = edge._private.rscratch; + let isHaystack = rs.edgeType === 'haystack'; + + if( !isHaystack ){ + this.drawArrowhead( context, edge, 'source', rs.arrowStartX, rs.arrowStartY, rs.srcArrowAngle, opacity ); + } + + this.drawArrowhead( context, edge, 'mid-target', rs.midX, rs.midY, rs.midtgtArrowAngle, opacity ); + + this.drawArrowhead( context, edge, 'mid-source', rs.midX, rs.midY, rs.midsrcArrowAngle, opacity ); + + if( !isHaystack ){ + this.drawArrowhead( context, edge, 'target', rs.arrowEndX, rs.arrowEndY, rs.tgtArrowAngle, opacity ); + } +}; + +CRp.drawArrowhead = function( context, edge, prefix, x, y, angle, opacity ){ + if( isNaN( x ) || x == null || isNaN( y ) || y == null || isNaN( angle ) || angle == null ){ return; } + + let self = this; + let arrowShape = edge.pstyle( prefix + '-arrow-shape' ).value; + if( arrowShape === 'none' ) { return; } + + let arrowClearFill = edge.pstyle( prefix + '-arrow-fill' ).value === 'hollow' ? 'both' : 'filled'; + let arrowFill = edge.pstyle( prefix + '-arrow-fill' ).value; + let edgeWidth = edge.pstyle( 'width' ).pfValue; + let edgeOpacity = edge.pstyle( 'opacity' ).value; + + if( opacity === undefined ){ + opacity = edgeOpacity; + } + + let gco = context.globalCompositeOperation; + + if( opacity !== 1 || arrowFill === 'hollow' ){ // then extra clear is needed + context.globalCompositeOperation = 'destination-out'; + + self.fillStyle( context, 255, 255, 255, 1 ); + self.strokeStyle( context, 255, 255, 255, 1 ); + + self.drawArrowShape( edge, prefix, context, + arrowClearFill, edgeWidth, arrowShape, x, y, angle + ); + + context.globalCompositeOperation = gco; + } // otherwise, the opaque arrow clears it for free :) + + let color = edge.pstyle( prefix + '-arrow-color' ).value; + self.fillStyle( context, color[0], color[1], color[2], opacity ); + self.strokeStyle( context, color[0], color[1], color[2], opacity ); + + self.drawArrowShape( edge, prefix, context, + arrowFill, edgeWidth, arrowShape, x, y, angle + ); +}; + +CRp.drawArrowShape = function( edge, arrowType, context, fill, edgeWidth, shape, x, y, angle ){ + let r = this; + let usePaths = this.usePaths(); + let rs = edge._private.rscratch; + let pathCacheHit = false; + let path; + let canvasContext = context; + let translation = { x: x, y: y }; + let scale = edge.pstyle( 'arrow-scale' ).value; + let size = this.getArrowWidth( edgeWidth, scale ); + let shapeImpl = r.arrowShapes[ shape ]; + + if( usePaths ){ + let pathCacheKey = size + '$' + shape + '$' + angle + '$' + x + '$' + y; + rs.arrowPathCacheKey = rs.arrowPathCacheKey || {}; + rs.arrowPathCache = rs.arrowPathCache || {}; + + let alreadyCached = rs.arrowPathCacheKey[ arrowType ] === pathCacheKey; + if( alreadyCached ){ + path = context = rs.arrowPathCache[ arrowType ]; + pathCacheHit = true; + } else { + path = context = new Path2D(); // eslint-disable-line no-undef + rs.arrowPathCacheKey[ arrowType ] = pathCacheKey; + rs.arrowPathCache[ arrowType ] = path; + } + } + + if( context.beginPath ){ context.beginPath(); } + + if( !pathCacheHit ){ + shapeImpl.draw( context, size, angle, translation, edgeWidth ); + } + + if( !shapeImpl.leavePathOpen && context.closePath ){ + context.closePath(); + } + + context = canvasContext; + + if( fill === 'filled' || fill === 'both' ){ + if( usePaths ){ + context.fill( path ); + } else { + context.fill(); + } + } + + if( fill === 'hollow' || fill === 'both' ){ + context.lineWidth = ( shapeImpl.matchEdgeWidth ? edgeWidth : 1 ); + context.lineJoin = 'miter'; + + if( usePaths ){ + context.stroke( path ); + } else { + context.stroke(); + } + } +}; + +module.exports = CRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-elements.js b/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-elements.js new file mode 100644 index 000000000..b15634135 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-elements.js @@ -0,0 +1,112 @@ +let math = require( '../../../math' ); + +let CRp = {}; + +CRp.drawElement = function( context, ele, shiftToOriginWithBb, showLabel ){ + let r = this; + + if( ele.isNode() ){ + r.drawNode( context, ele, shiftToOriginWithBb, showLabel ); + } else { + r.drawEdge( context, ele, shiftToOriginWithBb, showLabel ); + } +}; + +CRp.drawCachedElement = function( context, ele, pxRatio, extent ){ + let r = this; + let bb = ele.boundingBox(); + + if( bb.w === 0 || bb.h === 0 ){ return; } + + if( !extent || math.boundingBoxesIntersect( bb, extent ) ){ + let cache = r.data.eleTxrCache.getElement( ele, bb, pxRatio ); + + if( cache != null ){ + context.drawImage( cache.texture.canvas, cache.x, 0, cache.width, cache.height, bb.x1, bb.y1, bb.w, bb.h ); + } else { // if the element is not cacheable, then draw directly + r.drawElement( context, ele ); + } + } +}; + +CRp.drawElements = function( context, eles ){ + let r = this; + + for( let i = 0; i < eles.length; i++ ){ + let ele = eles[ i ]; + + r.drawElement( context, ele ); + } +}; + +CRp.drawCachedElements = function( context, eles, pxRatio, extent ){ + let r = this; + + for( let i = 0; i < eles.length; i++ ){ + let ele = eles[ i ]; + + r.drawCachedElement( context, ele, pxRatio, extent ); + } +}; + +CRp.drawCachedNodes = function( context, eles, pxRatio, extent ){ + let r = this; + + for( let i = 0; i < eles.length; i++ ){ + let ele = eles[ i ]; + + if( !ele.isNode() ){ continue; } + + r.drawCachedElement( context, ele, pxRatio, extent ); + } +}; + +CRp.drawLayeredElements = function( context, eles, pxRatio, extent ){ + let r = this; + + let layers = r.data.lyrTxrCache.getLayers( eles, pxRatio ); + + if( layers ){ + for( let i = 0; i < layers.length; i++ ){ + let layer = layers[i]; + let bb = layer.bb; + + if( bb.w === 0 || bb.h === 0 ){ continue; } + + context.drawImage( layer.canvas, bb.x1, bb.y1, bb.w, bb.h ); + } + } else { // fall back on plain caching if no layers + r.drawCachedElements( context, eles, pxRatio, extent ); + } +}; + +CRp.drawDebugPoints = function( context, eles ){ + let draw = function( x, y, color ){ + context.fillStyle = color; + context.fillRect( x - 1, y - 1, 3, 3 ); + }; + + for( let i = 0; i < eles.length; i++ ){ + let ele = eles[i]; + let rs = ele._private.rscratch; + + if( ele.isNode() ){ + let p = ele.position(); + + draw( p.x, p.y, 'magenta' ); + } else { + let pts = rs.allpts; + + for( let j = 0; j + 1 < pts.length; j += 2 ){ + let x = pts[ j ]; + let y = pts[ j + 1 ]; + + draw( x, y, 'cyan' ); + } + + draw( rs.midX, rs.midY, 'yellow' ); + } + } +}; + +module.exports = CRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-images.js b/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-images.js new file mode 100644 index 000000000..42fcfd27d --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-images.js @@ -0,0 +1,148 @@ +var CRp = {}; + +CRp.safeDrawImage = function( context, img, ix, iy, iw, ih, x, y, w, h ){ + var r = this; + + // detect problematic cases for old browsers with bad images (cheaper than try-catch) + if( iw <= 0 || ih <= 0 || w <= 0 || h <= 0 ){ + return; + } + + context.drawImage( img, ix, iy, iw, ih, x, y, w, h ); +}; + +CRp.drawInscribedImage = function( context, img, node, index, nodeOpacity ){ + var r = this; + var pos = node.position(); + var nodeX = pos.x; + var nodeY = pos.y; + var styleObj = node.cy().style(); + var getIndexedStyle = styleObj.getIndexedStyle.bind( styleObj ); + var fit = getIndexedStyle( node, 'background-fit', 'value', index ); + var repeat = getIndexedStyle( node, 'background-repeat', 'value', index ); + var nodeW = node.width(); + var nodeH = node.height(); + var paddingX2 = node.padding() * 2; + var nodeTW = nodeW + ( getIndexedStyle( node, 'background-width-relative-to', 'value', index ) === 'inner' ? 0 : paddingX2 ); + var nodeTH = nodeH + ( getIndexedStyle( node, 'background-height-relative-to', 'value', index ) === 'inner' ? 0 : paddingX2 ); + var rs = node._private.rscratch; + var clip = node.pstyle( 'background-clip' ).value; + var shouldClip = clip === 'node'; + var imgOpacity = getIndexedStyle( node, 'background-image-opacity', 'value', index ) * nodeOpacity; + + var imgW = img.width || img.cachedW; + var imgH = img.height || img.cachedH; + + // workaround for broken browsers like ie + if( null == imgW || null == imgH ){ + document.body.appendChild( img ); // eslint-disable-line no-undef + + imgW = img.cachedW = img.width || img.offsetWidth; + imgH = img.cachedH = img.height || img.offsetHeight; + + document.body.removeChild( img ); // eslint-disable-line no-undef + } + + var w = imgW; + var h = imgH; + + if( getIndexedStyle( node, 'background-width', 'value', index ) !== 'auto' ){ + if( getIndexedStyle( node, 'background-width', 'units', index ) === '%' ){ + w = getIndexedStyle( node, 'background-width', 'pfValue', index ) * nodeTW; + } else { + w = getIndexedStyle( node, 'background-width', 'pfValue', index ); + } + } + + if( getIndexedStyle( node, 'background-height', 'value', index ) !== 'auto' ){ + if( getIndexedStyle( node, 'background-height', 'units', index ) === '%' ){ + h = getIndexedStyle( node, 'background-height', 'pfValue', index ) * nodeTH; + } else { + h = getIndexedStyle( node, 'background-height', 'pfValue', index ); + } + } + + if( w === 0 || h === 0 ){ + return; // no point in drawing empty image (and chrome is broken in this case) + } + + if( fit === 'contain' ){ + var scale = Math.min( nodeTW / w, nodeTH / h ); + + w *= scale; + h *= scale; + + } else if( fit === 'cover' ){ + var scale = Math.max( nodeTW / w, nodeTH / h ); + + w *= scale; + h *= scale; + } + + var x = (nodeX - nodeTW / 2); // left + if( getIndexedStyle( node, 'background-position-x', 'units', index ) === '%' ){ + x += (nodeTW - w) * getIndexedStyle( node, 'background-position-x', 'pfValue', index ); + } else { + x += getIndexedStyle( node, 'background-position-x', 'pfValue', index ); + } + + var y = (nodeY - nodeTH / 2); // top + if( getIndexedStyle( node, 'background-position-y', 'units', index ) === '%' ){ + y += (nodeTH - h) * getIndexedStyle( node, 'background-position-y', 'pfValue', index ); + } else { + y += getIndexedStyle( node, 'background-position-y', 'pfValue', index ); + } + + if( rs.pathCache ){ + x -= nodeX; + y -= nodeY; + + nodeX = 0; + nodeY = 0; + } + + var gAlpha = context.globalAlpha; + + context.globalAlpha = imgOpacity; + + if( repeat === 'no-repeat' ){ + + if( shouldClip ){ + context.save(); + + if( rs.pathCache ){ + context.clip( rs.pathCache ); + } else { + r.nodeShapes[ r.getNodeShape( node ) ].draw( + context, + nodeX, nodeY, + nodeTW, nodeTH ); + + context.clip(); + } + } + + r.safeDrawImage( context, img, 0, 0, imgW, imgH, x, y, w, h ); + + if( shouldClip ){ + context.restore(); + } + } else { + var pattern = context.createPattern( img, repeat ); + context.fillStyle = pattern; + + r.nodeShapes[ r.getNodeShape( node ) ].draw( + context, + nodeX, nodeY, + nodeTW, nodeTH ); + + context.translate( x, y ); + context.fill(); + context.translate( -x, -y ); + } + + context.globalAlpha = gAlpha; + +}; + +module.exports = CRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-label-text.js b/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-label-text.js new file mode 100644 index 000000000..3c7cd8a3c --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-label-text.js @@ -0,0 +1,351 @@ +var util = require( '../../../util' ); +var math = require( '../../../math' ); + +var CRp = {}; + +CRp.eleTextBiggerThanMin = function( ele, scale ){ + if( !scale ){ + var zoom = ele.cy().zoom(); + var pxRatio = this.getPixelRatio(); + var lvl = Math.ceil( math.log2( zoom * pxRatio ) ); // the effective texture level + + scale = Math.pow( 2, lvl ); + } + + var computedSize = ele.pstyle( 'font-size' ).pfValue * scale; + var minSize = ele.pstyle( 'min-zoomed-font-size' ).pfValue; + + if( computedSize < minSize ){ + return false; + } + + return true; +}; + +CRp.drawElementText = function( context, ele, force ){ + var r = this; + + if( force === undefined ){ + if( !r.eleTextBiggerThanMin( ele ) ){ return; } + } else { + if( !force ){ return; } + } + + if( ele.isNode() ){ + var label = ele.pstyle( 'label' ); + + if( !label || !label.value ){ return; } + + var textHalign = ele.pstyle( 'text-halign' ).strValue; + var textValign = ele.pstyle( 'text-valign' ).strValue; + + switch( textHalign ){ + case 'left': + context.textAlign = 'right'; + break; + + case 'right': + context.textAlign = 'left'; + break; + + default: // e.g. center + context.textAlign = 'center'; + } + + context.textBaseline = 'bottom'; + } else { + var label = ele.pstyle( 'label' ); + var srcLabel = ele.pstyle( 'source-label' ); + var tgtLabel = ele.pstyle( 'target-label' ); + + if( + ( !label || !label.value ) + && ( !srcLabel || !srcLabel.value ) + && ( !tgtLabel || !tgtLabel.value ) + ){ + return; + } + + context.textAlign = 'center'; + context.textBaseline = 'bottom'; + } + + + r.drawText( context, ele ); + + if( ele.isEdge() ){ + r.drawText( context, ele, 'source' ); + + r.drawText( context, ele, 'target' ); + } +}; + +CRp.drawNodeText = CRp.drawEdgeText = CRp.drawElementText; + +CRp.getFontCache = function( context ){ + var cache; + + this.fontCaches = this.fontCaches || []; + + for( var i = 0; i < this.fontCaches.length; i++ ){ + cache = this.fontCaches[ i ]; + + if( cache.context === context ){ + return cache; + } + } + + cache = { + context: context + }; + this.fontCaches.push( cache ); + + return cache; +}; + +// set up canvas context with font +// returns transformed text string +CRp.setupTextStyle = function( context, ele ){ + // Font style + var parentOpacity = ele.effectiveOpacity(); + var labelStyle = ele.pstyle( 'font-style' ).strValue; + var labelSize = ele.pstyle( 'font-size' ).pfValue + 'px'; + var labelFamily = ele.pstyle( 'font-family' ).strValue; + var labelWeight = ele.pstyle( 'font-weight' ).strValue; + var opacity = ele.pstyle( 'text-opacity' ).value * ele.pstyle( 'opacity' ).value * parentOpacity; + var outlineOpacity = ele.pstyle( 'text-outline-opacity' ).value * opacity; + var color = ele.pstyle( 'color' ).value; + var outlineColor = ele.pstyle( 'text-outline-color' ).value; + + var fontCacheKey = ele._private.fontKey; + var cache = this.getFontCache( context ); + + if( cache.key !== fontCacheKey ){ + context.font = labelStyle + ' ' + labelWeight + ' ' + labelSize + ' ' + labelFamily; + + cache.key = fontCacheKey; + } + + // Calculate text draw position based on text alignment + + // so text outlines aren't jagged + context.lineJoin = 'round'; + + this.fillStyle( context, color[ 0 ], color[ 1 ], color[ 2 ], opacity ); + + this.strokeStyle( context, outlineColor[ 0 ], outlineColor[ 1 ], outlineColor[ 2 ], outlineOpacity ); +}; + +function roundRect( ctx, x, y, width, height, radius ){ + var radius = radius || 5; + ctx.beginPath(); + ctx.moveTo( x + radius, y ); + ctx.lineTo( x + width - radius, y ); + ctx.quadraticCurveTo( x + width, y, x + width, y + radius ); + ctx.lineTo( x + width, y + height - radius ); + ctx.quadraticCurveTo( x + width, y + height, x + width - radius, y + height ); + ctx.lineTo( x + radius, y + height ); + ctx.quadraticCurveTo( x, y + height, x, y + height - radius ); + ctx.lineTo( x, y + radius ); + ctx.quadraticCurveTo( x, y, x + radius, y ); + ctx.closePath(); + ctx.fill(); +} + +// Draw text +CRp.drawText = function( context, ele, prefix ){ + var _p = ele._private; + var rscratch = _p.rscratch; + var parentOpacity = ele.effectiveOpacity(); + if( parentOpacity === 0 || ele.pstyle( 'text-opacity' ).value === 0 ){ + return; + } + + var textX = util.getPrefixedProperty( rscratch, 'labelX', prefix ); + var textY = util.getPrefixedProperty( rscratch, 'labelY', prefix ); + var text = this.getLabelText( ele, prefix ); + + if( text != null && text !== '' && !isNaN( textX ) && !isNaN( textY ) ){ + this.setupTextStyle( context, ele ); + + var pdash = prefix ? prefix + '-' : ''; + var textW = util.getPrefixedProperty( rscratch, 'labelWidth', prefix ); + var textH = util.getPrefixedProperty( rscratch, 'labelHeight', prefix ); + var textAngle = util.getPrefixedProperty( rscratch, 'labelAngle', prefix ); + var marginX = ele.pstyle( pdash + 'text-margin-x' ).pfValue; + var marginY = ele.pstyle( pdash + 'text-margin-y' ).pfValue; + + var isEdge = ele.isEdge(); + var isNode = ele.isNode(); + + var halign = ele.pstyle( 'text-halign' ).value; + var valign = ele.pstyle( 'text-valign' ).value; + + if( isEdge ){ + halign = 'center'; + valign = 'center'; + } + + textX += marginX; + textY += marginY; + + var rotation = ele.pstyle( pdash + 'text-rotation' ); + var theta; + + if( rotation.strValue === 'autorotate' ){ + theta = isEdge ? textAngle : 0; + } else if( rotation.strValue === 'none' ){ + theta = 0; + } else { + theta = rotation.pfValue; + } + + if( theta !== 0 ){ + var orgTextX = textX; + var orgTextY = textY; + + context.translate( orgTextX, orgTextY ); + context.rotate( theta ); + + textX = 0; + textY = 0; + } + + switch( valign ){ + case 'top': + break; + case 'center': + textY += textH / 2; + break; + case 'bottom': + textY += textH; + break; + } + + var backgroundOpacity = ele.pstyle( 'text-background-opacity' ).value; + var borderOpacity = ele.pstyle( 'text-border-opacity' ).value; + var textBorderWidth = ele.pstyle( 'text-border-width' ).pfValue; + var backgroundPadding = ele.pstyle( 'text-background-padding' ).pfValue; + + if( backgroundOpacity > 0 || ( textBorderWidth > 0 && borderOpacity > 0 ) ){ + var bgX = textX - backgroundPadding; + + switch( halign ){ + case 'left': + bgX -= textW; + break; + case 'center': + bgX -= textW / 2; + break; + case 'right': + break; + } + + var bgY = textY - textH - backgroundPadding; + var bgW = textW + 2*backgroundPadding; + var bgH = textH + 2*backgroundPadding; + + if( backgroundOpacity > 0 ){ + var textFill = context.fillStyle; + var textBackgroundColor = ele.pstyle( 'text-background-color' ).value; + + context.fillStyle = 'rgba(' + textBackgroundColor[ 0 ] + ',' + textBackgroundColor[ 1 ] + ',' + textBackgroundColor[ 2 ] + ',' + backgroundOpacity * parentOpacity + ')'; + var styleShape = ele.pstyle( 'text-background-shape' ).strValue; + if( styleShape == 'roundrectangle' ){ + roundRect( context, bgX, bgY, bgW, bgH, 2 ); + } else { + context.fillRect( bgX, bgY, bgW, bgH ); + } + context.fillStyle = textFill; + } + + if( textBorderWidth > 0 && borderOpacity > 0 ){ + var textStroke = context.strokeStyle; + var textLineWidth = context.lineWidth; + var textBorderColor = ele.pstyle( 'text-border-color' ).value; + var textBorderStyle = ele.pstyle( 'text-border-style' ).value; + + context.strokeStyle = 'rgba(' + textBorderColor[ 0 ] + ',' + textBorderColor[ 1 ] + ',' + textBorderColor[ 2 ] + ',' + borderOpacity * parentOpacity + ')'; + context.lineWidth = textBorderWidth; + + if( context.setLineDash ){ // for very outofdate browsers + switch( textBorderStyle ){ + case 'dotted': + context.setLineDash( [ 1, 1 ] ); + break; + case 'dashed': + context.setLineDash( [ 4, 2 ] ); + break; + case 'double': + context.lineWidth = textBorderWidth / 4; // 50% reserved for white between the two borders + context.setLineDash( [] ); + break; + case 'solid': + context.setLineDash( [] ); + break; + } + } + + context.strokeRect( bgX, bgY, bgW, bgH ); + + if( textBorderStyle === 'double' ){ + var whiteWidth = textBorderWidth / 2; + + context.strokeRect( bgX + whiteWidth, bgY + whiteWidth, bgW - whiteWidth * 2, bgH - whiteWidth * 2 ); + } + + if( context.setLineDash ){ // for very outofdate browsers + context.setLineDash( [] ); + } + context.lineWidth = textLineWidth; + context.strokeStyle = textStroke; + } + + } + + var lineWidth = 2 * ele.pstyle( 'text-outline-width' ).pfValue; // *2 b/c the stroke is drawn centred on the middle + + if( lineWidth > 0 ){ + context.lineWidth = lineWidth; + } + + if( ele.pstyle( 'text-wrap' ).value === 'wrap' ){ + var lines = util.getPrefixedProperty( rscratch, 'labelWrapCachedLines', prefix ); + var lineHeight = textH / lines.length; + + switch( valign ){ + case 'top': + textY -= ( lines.length - 1 ) * lineHeight; + break; + case 'center': + case 'bottom': + textY -= ( lines.length - 1 ) * lineHeight; + break; + } + + for( var l = 0; l < lines.length; l++ ){ + if( lineWidth > 0 ){ + context.strokeText( lines[ l ], textX, textY ); + } + + context.fillText( lines[ l ], textX, textY ); + + textY += lineHeight; + } + + } else { + if( lineWidth > 0 ){ + context.strokeText( text, textX, textY ); + } + + context.fillText( text, textX, textY ); + } + + if( theta !== 0 ){ + context.rotate( -theta ); + context.translate( -orgTextX, -orgTextY ); + } + } +}; + +module.exports = CRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-nodes.js b/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-nodes.js new file mode 100644 index 000000000..d69831b29 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-nodes.js @@ -0,0 +1,377 @@ +/* global Path2D */ + +let is = require( '../../../is' ); + +let CRp = {}; + +CRp.drawNode = function( context, node, shiftToOriginWithBb, drawLabel ){ + let r = this; + let nodeWidth, nodeHeight; + let _p = node._private; + let rs = _p.rscratch; + let pos = node.position(); + + if( !is.number( pos.x ) || !is.number( pos.y ) ){ + return; // can't draw node with undefined position + } + + if( !node.visible() ){ return; } + + let parentOpacity = node.effectiveOpacity(); + + let usePaths = r.usePaths(); + let path; + let pathCacheHit = false; + + let padding = node.padding(); + + nodeWidth = node.width() + 2 * padding; + nodeHeight = node.height() + 2 * padding; + + // + // setup shift + + let bb; + if( shiftToOriginWithBb ){ + bb = shiftToOriginWithBb; + + context.translate( -bb.x1, -bb.y1 ); + } + + // + // load bg image + + let bgImgProp = node.pstyle( 'background-image' ); + let urls = bgImgProp.value; + let urlDefined = new Array( urls.length ); + let image = new Array( urls.length ); + let numImages = 0; + for( let i = 0; i < urls.length; i++ ){ + let url = urls[i]; + let defd = urlDefined[i] = url != null && url !== 'none'; + + if( defd ){ + let bgImgCrossOrigin = node.cy().style().getIndexedStyle(node, 'background-image-crossorigin', 'value', i); + + numImages++; + + // get image, and if not loaded then ask to redraw when later loaded + image[i] = r.getCachedImage( url, bgImgCrossOrigin, function(){ + node.emitAndNotify('background'); + } ); + } + } + + // + // setup styles + + let darkness = node.pstyle('background-blacken').value; + let borderWidth = node.pstyle('border-width').pfValue; + let bgColor = node.pstyle('background-color').value; + let bgOpacity = node.pstyle('background-opacity').value * parentOpacity; + let borderColor = node.pstyle('border-color').value; + let borderStyle = node.pstyle('border-style').value; + let borderOpacity = node.pstyle('border-opacity').value * parentOpacity; + + context.lineJoin = 'miter'; // so borders are square with the node shape + + let setupShapeColor = ( bgOpy = bgOpacity ) => { + r.fillStyle( context, bgColor[0], bgColor[1], bgColor[2], bgOpy ); + }; + + let setupBorderColor = ( bdrOpy = borderOpacity ) => { + r.strokeStyle( context, borderColor[0], borderColor[1], borderColor[2], bdrOpy ); + }; + + + // + // setup shape + + let styleShape = node.pstyle('shape').strValue; + let shapePts = node.pstyle('shape-polygon-points').pfValue; + + if( usePaths ){ + let pathCacheKey = styleShape + '$' + nodeWidth + '$' + nodeHeight + ( styleShape === 'polygon' ? '$' + shapePts.join('$') : '' ); + + context.translate( pos.x, pos.y ); + + if( rs.pathCacheKey === pathCacheKey ){ + path = rs.pathCache; + pathCacheHit = true; + } else { + path = new Path2D(); + rs.pathCacheKey = pathCacheKey; + rs.pathCache = path; + } + } + + let drawShape = () => { + if( !pathCacheHit ){ + + let npos = pos; + + if( usePaths ){ + npos = { + x: 0, + y: 0 + }; + } + + r.nodeShapes[ r.getNodeShape( node ) ].draw( + ( path || context ), + npos.x, + npos.y, + nodeWidth, + nodeHeight ); + } + + if( usePaths ){ + context.fill( path ); + } else { + context.fill(); + } + }; + + let drawImages = ( nodeOpacity = parentOpacity ) => { + let prevBging = _p.backgrounding; + let totalCompleted = 0; + + for( let i = 0; i < image.length; i++ ){ + if( urlDefined[i] && image[i].complete && !image[i].error ){ + totalCompleted++; + r.drawInscribedImage( context, image[i], node, i, nodeOpacity ); + } + } + + _p.backgrounding = !(totalCompleted === numImages); + if( prevBging !== _p.backgrounding ){ // update style b/c :backgrounding state changed + node.updateStyle( false ); + } + }; + + let drawPie = ( redrawShape = false, pieOpacity = parentOpacity ) => { + if( r.hasPie( node ) ){ + r.drawPie( context, node, pieOpacity ); + + // redraw/restore path if steps after pie need it + if( redrawShape ){ + + if( !usePaths ){ + r.nodeShapes[ r.getNodeShape( node ) ].draw( + context, + pos.x, + pos.y, + nodeWidth, + nodeHeight ); + } + } + } + }; + + let darken = ( darkenOpacity = parentOpacity ) => { + let opacity = ( darkness > 0 ? darkness : -darkness ) * darkenOpacity; + let c = darkness > 0 ? 0 : 255; + + if( darkness !== 0 ){ + r.fillStyle( context, c, c, c, opacity ); + + if( usePaths ){ + context.fill( path ); + } else { + context.fill(); + } + } + }; + + let drawBorder = () => { + if( borderWidth > 0 ){ + + context.lineWidth = borderWidth; + context.lineCap = 'butt'; + + if( context.setLineDash ){ // for very outofdate browsers + switch( borderStyle ){ + case 'dotted': + context.setLineDash( [ 1, 1 ] ); + break; + + case 'dashed': + context.setLineDash( [ 4, 2 ] ); + break; + + case 'solid': + case 'double': + context.setLineDash( [ ] ); + break; + } + } + + if( usePaths ){ + context.stroke( path ); + } else { + context.stroke(); + } + + if( borderStyle === 'double' ){ + context.lineWidth = borderWidth / 3; + + let gco = context.globalCompositeOperation; + context.globalCompositeOperation = 'destination-out'; + + if( usePaths ){ + context.stroke( path ); + } else { + context.stroke(); + } + + context.globalCompositeOperation = gco; + } + + // reset in case we changed the border style + if( context.setLineDash ){ // for very outofdate browsers + context.setLineDash( [ ] ); + } + + } + }; + + let drawOverlay = () => { + let overlayPadding = node.pstyle( 'overlay-padding' ).pfValue; + let overlayOpacity = node.pstyle( 'overlay-opacity' ).value; + let overlayColor = node.pstyle( 'overlay-color' ).value; + + if( overlayOpacity > 0 ){ + r.fillStyle( context, overlayColor[0], overlayColor[1], overlayColor[2], overlayOpacity ); + + r.nodeShapes[ 'roundrectangle' ].draw( + context, + pos.x, + pos.y, + nodeWidth + overlayPadding * 2, + nodeHeight + overlayPadding * 2 + ); + + context.fill(); + } + }; + + let drawText = () => { + r.drawElementText( context, node, drawLabel ); + }; + + let ghost = node.pstyle('ghost').value === 'yes'; + + if( ghost ){ + let gx = node.pstyle('ghost-offset-x').pfValue; + let gy = node.pstyle('ghost-offset-y').pfValue; + let ghostOpacity = node.pstyle('ghost-opacity').value; + let effGhostOpacity = ghostOpacity * parentOpacity; + + context.translate( gx, gy ); + + setupShapeColor( ghostOpacity * bgOpacity ); + drawShape(); + drawImages( effGhostOpacity ); + drawPie( darkness !== 0 || borderWidth !== 0 ); + darken( effGhostOpacity ); + setupBorderColor( ghostOpacity * borderOpacity ); + drawBorder(); + + context.translate( -gx, -gy ); + } + + setupShapeColor(); + drawShape(); + drawImages(); + drawPie( darkness !== 0 || borderWidth !== 0 ); + darken(); + setupBorderColor(); + drawBorder(); + + if( usePaths ){ + context.translate( -pos.x, -pos.y ); + } + + drawText(); + drawOverlay(); + + // + // clean up shift + + if( shiftToOriginWithBb ){ + context.translate( bb.x1, bb.y1 ); + } + +}; + +// does the node have at least one pie piece? +CRp.hasPie = function( node ){ + node = node[0]; // ensure ele ref + + return node._private.hasPie; +}; + +CRp.drawPie = function( context, node, nodeOpacity, pos ){ + node = node[0]; // ensure ele ref + pos = pos || node.position(); + + let cyStyle = node.cy().style(); + let pieSize = node.pstyle( 'pie-size' ); + let x = pos.x; + let y = pos.y; + let nodeW = node.width(); + let nodeH = node.height(); + let radius = Math.min( nodeW, nodeH ) / 2; // must fit in node + let lastPercent = 0; // what % to continue drawing pie slices from on [0, 1] + let usePaths = this.usePaths(); + + if( usePaths ){ + x = 0; + y = 0; + } + + if( pieSize.units === '%' ){ + radius = radius * pieSize.pfValue; + } else if( pieSize.pfValue !== undefined ){ + radius = pieSize.pfValue / 2; + } + + for( let i = 1; i <= cyStyle.pieBackgroundN; i++ ){ // 1..N + let size = node.pstyle( 'pie-' + i + '-background-size' ).value; + let color = node.pstyle( 'pie-' + i + '-background-color' ).value; + let opacity = node.pstyle( 'pie-' + i + '-background-opacity' ).value * nodeOpacity; + let percent = size / 100; // map integer range [0, 100] to [0, 1] + + // percent can't push beyond 1 + if( percent + lastPercent > 1 ){ + percent = 1 - lastPercent; + } + + let angleStart = 1.5 * Math.PI + 2 * Math.PI * lastPercent; // start at 12 o'clock and go clockwise + let angleDelta = 2 * Math.PI * percent; + let angleEnd = angleStart + angleDelta; + + // ignore if + // - zero size + // - we're already beyond the full circle + // - adding the current slice would go beyond the full circle + if( size === 0 || lastPercent >= 1 || lastPercent + percent > 1 ){ + continue; + } + + context.beginPath(); + context.moveTo( x, y ); + context.arc( x, y, radius, angleStart, angleEnd ); + context.closePath(); + + this.fillStyle( context, color[0], color[1], color[2], opacity ); + + context.fill(); + + lastPercent += percent; + } + +}; + + +module.exports = CRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-redraw.js b/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-redraw.js new file mode 100644 index 000000000..fe34835b6 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-redraw.js @@ -0,0 +1,579 @@ +var CRp = {}; + +var util = require( '../../../util' ); + +var motionBlurDelay = 100; + +// var isFirefox = typeof InstallTrigger !== 'undefined'; + +CRp.getPixelRatio = function(){ + var context = this.data.contexts[0]; + + if( this.forcedPixelRatio != null ){ + return this.forcedPixelRatio; + } + + var backingStore = context.backingStorePixelRatio || + context.webkitBackingStorePixelRatio || + context.mozBackingStorePixelRatio || + context.msBackingStorePixelRatio || + context.oBackingStorePixelRatio || + context.backingStorePixelRatio || 1; + + return (window.devicePixelRatio || 1) / backingStore; // eslint-disable-line no-undef +}; + +CRp.paintCache = function( context ){ + var caches = this.paintCaches = this.paintCaches || []; + var needToCreateCache = true; + var cache; + + for( var i = 0; i < caches.length; i++ ){ + cache = caches[ i ]; + + if( cache.context === context ){ + needToCreateCache = false; + break; + } + } + + if( needToCreateCache ){ + cache = { + context: context + }; + caches.push( cache ); + } + + return cache; +}; + +CRp.fillStyle = function( context, r, g, b, a ){ + context.fillStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; + + // turn off for now, seems context does its own caching + + // var cache = this.paintCache(context); + + // var fillStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; + + // if( cache.fillStyle !== fillStyle ){ + // context.fillStyle = cache.fillStyle = fillStyle; + // } +}; + +CRp.strokeStyle = function( context, r, g, b, a ){ + context.strokeStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; + + // turn off for now, seems context does its own caching + + // var cache = this.paintCache(context); + + // var strokeStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; + + // if( cache.strokeStyle !== strokeStyle ){ + // context.strokeStyle = cache.strokeStyle = strokeStyle; + // } +}; + +// Resize canvas +CRp.matchCanvasSize = function( container ){ + var r = this; + var data = r.data; + var bb = r.findContainerClientCoords(); + var width = bb[2]; + var height = bb[3]; + var pixelRatio = r.getPixelRatio(); + var mbPxRatio = r.motionBlurPxRatio; + + if( + container === r.data.bufferCanvases[ r.MOTIONBLUR_BUFFER_NODE ] || + container === r.data.bufferCanvases[ r.MOTIONBLUR_BUFFER_DRAG ] + ){ + pixelRatio = mbPxRatio; + } + + var canvasWidth = width * pixelRatio; + var canvasHeight = height * pixelRatio; + var canvas; + + if( canvasWidth === r.canvasWidth && canvasHeight === r.canvasHeight ){ + return; // save cycles if same + } + + r.fontCaches = null; // resizing resets the style + + var canvasContainer = data.canvasContainer; + canvasContainer.style.width = width + 'px'; + canvasContainer.style.height = height + 'px'; + + for( var i = 0; i < r.CANVAS_LAYERS; i++ ){ + canvas = data.canvases[ i ]; + + canvas.width = canvasWidth; + canvas.height = canvasHeight; + + canvas.style.width = width + 'px'; + canvas.style.height = height + 'px'; + } + + for( var i = 0; i < r.BUFFER_COUNT; i++ ){ + canvas = data.bufferCanvases[ i ]; + + canvas.width = canvasWidth; + canvas.height = canvasHeight; + + canvas.style.width = width + 'px'; + canvas.style.height = height + 'px'; + } + + r.textureMult = 1; + if( pixelRatio <= 1 ){ + canvas = data.bufferCanvases[ r.TEXTURE_BUFFER ]; + + r.textureMult = 2; + canvas.width = canvasWidth * r.textureMult; + canvas.height = canvasHeight * r.textureMult; + } + + r.canvasWidth = canvasWidth; + r.canvasHeight = canvasHeight; + +}; + +CRp.renderTo = function( cxt, zoom, pan, pxRatio ){ + this.render( { + forcedContext: cxt, + forcedZoom: zoom, + forcedPan: pan, + drawAllLayers: true, + forcedPxRatio: pxRatio + } ); +}; + +CRp.render = function( options ){ + options = options || util.staticEmptyObject(); + + var forcedContext = options.forcedContext; + var drawAllLayers = options.drawAllLayers; + var drawOnlyNodeLayer = options.drawOnlyNodeLayer; + var forcedZoom = options.forcedZoom; + var forcedPan = options.forcedPan; + var r = this; + var pixelRatio = options.forcedPxRatio === undefined ? this.getPixelRatio() : options.forcedPxRatio; + var cy = r.cy; var data = r.data; + var needDraw = data.canvasNeedsRedraw; + var textureDraw = r.textureOnViewport && !forcedContext && (r.pinching || r.hoverData.dragging || r.swipePanning || r.data.wheelZooming); + var motionBlur = options.motionBlur !== undefined ? options.motionBlur : r.motionBlur; + var mbPxRatio = r.motionBlurPxRatio; + var hasCompoundNodes = cy.hasCompoundNodes(); + var inNodeDragGesture = r.hoverData.draggingEles; + var inBoxSelection = r.hoverData.selecting || r.touchData.selecting ? true : false; + motionBlur = motionBlur && !forcedContext && r.motionBlurEnabled && !inBoxSelection; + var motionBlurFadeEffect = motionBlur; + + if( !forcedContext ){ + if( r.prevPxRatio !== pixelRatio ){ + r.invalidateContainerClientCoordsCache(); + r.matchCanvasSize( r.container ); + + r.redrawHint('eles', true); + r.redrawHint('drag', true); + } + + r.prevPxRatio = pixelRatio; + } + + if( !forcedContext && r.motionBlurTimeout ){ + clearTimeout( r.motionBlurTimeout ); + } + + if( motionBlur ){ + if( r.mbFrames == null ){ + r.mbFrames = 0; + } + + r.mbFrames++; + + if( r.mbFrames < 3 ){ // need several frames before even high quality motionblur + motionBlurFadeEffect = false; + } + + // go to lower quality blurry frames when several m/b frames have been rendered (avoids flashing) + if( r.mbFrames > r.minMbLowQualFrames ){ + //r.fullQualityMb = false; + r.motionBlurPxRatio = r.mbPxRBlurry; + } + } + + if( r.clearingMotionBlur ){ + r.motionBlurPxRatio = 1; + } + + // b/c drawToContext() may be async w.r.t. redraw(), keep track of last texture frame + // because a rogue async texture frame would clear needDraw + if( r.textureDrawLastFrame && !textureDraw ){ + needDraw[ r.NODE ] = true; + needDraw[ r.SELECT_BOX ] = true; + } + + var coreStyle = cy.style()._private.coreStyle; + + var zoom = cy.zoom(); + var effectiveZoom = forcedZoom !== undefined ? forcedZoom : zoom; + var pan = cy.pan(); + var effectivePan = { + x: pan.x, + y: pan.y + }; + + var vp = { + zoom: zoom, + pan: { + x: pan.x, + y: pan.y + } + }; + var prevVp = r.prevViewport; + var viewportIsDiff = prevVp === undefined || vp.zoom !== prevVp.zoom || vp.pan.x !== prevVp.pan.x || vp.pan.y !== prevVp.pan.y; + + // we want the low quality motionblur only when the viewport is being manipulated etc (where it's not noticed) + if( !viewportIsDiff && !(inNodeDragGesture && !hasCompoundNodes) ){ + r.motionBlurPxRatio = 1; + } + + if( forcedPan ){ + effectivePan = forcedPan; + } + + // apply pixel ratio + + effectiveZoom *= pixelRatio; + effectivePan.x *= pixelRatio; + effectivePan.y *= pixelRatio; + + var eles = r.getCachedZSortedEles(); + + function mbclear( context, x, y, w, h ){ + var gco = context.globalCompositeOperation; + + context.globalCompositeOperation = 'destination-out'; + r.fillStyle( context, 255, 255, 255, r.motionBlurTransparency ); + context.fillRect( x, y, w, h ); + + context.globalCompositeOperation = gco; + } + + function setContextTransform( context, clear ){ + var ePan, eZoom, w, h; + + if( !r.clearingMotionBlur && (context === data.bufferContexts[ r.MOTIONBLUR_BUFFER_NODE ] || context === data.bufferContexts[ r.MOTIONBLUR_BUFFER_DRAG ]) ){ + ePan = { + x: pan.x * mbPxRatio, + y: pan.y * mbPxRatio + }; + + eZoom = zoom * mbPxRatio; + + w = r.canvasWidth * mbPxRatio; + h = r.canvasHeight * mbPxRatio; + } else { + ePan = effectivePan; + eZoom = effectiveZoom; + + w = r.canvasWidth; + h = r.canvasHeight; + } + + context.setTransform( 1, 0, 0, 1, 0, 0 ); + + if( clear === 'motionBlur' ){ + mbclear( context, 0, 0, w, h ); + } else if( !forcedContext && (clear === undefined || clear) ){ + context.clearRect( 0, 0, w, h ); + } + + if( !drawAllLayers ){ + context.translate( ePan.x, ePan.y ); + context.scale( eZoom, eZoom ); + } + if( forcedPan ){ + context.translate( forcedPan.x, forcedPan.y ); + } + if( forcedZoom ){ + context.scale( forcedZoom, forcedZoom ); + } + } + + if( !textureDraw ){ + r.textureDrawLastFrame = false; + } + + if( textureDraw ){ + r.textureDrawLastFrame = true; + + var bb; + + if( !r.textureCache ){ + r.textureCache = {}; + + bb = r.textureCache.bb = cy.mutableElements().boundingBox(); + + r.textureCache.texture = r.data.bufferCanvases[ r.TEXTURE_BUFFER ]; + + var cxt = r.data.bufferContexts[ r.TEXTURE_BUFFER ]; + + cxt.setTransform( 1, 0, 0, 1, 0, 0 ); + cxt.clearRect( 0, 0, r.canvasWidth * r.textureMult, r.canvasHeight * r.textureMult ); + + r.render( { + forcedContext: cxt, + drawOnlyNodeLayer: true, + forcedPxRatio: pixelRatio * r.textureMult + } ); + + var vp = r.textureCache.viewport = { + zoom: cy.zoom(), + pan: cy.pan(), + width: r.canvasWidth, + height: r.canvasHeight + }; + + vp.mpan = { + x: (0 - vp.pan.x) / vp.zoom, + y: (0 - vp.pan.y) / vp.zoom + }; + } + + needDraw[ r.DRAG ] = false; + needDraw[ r.NODE ] = false; + + var context = data.contexts[ r.NODE ]; + + var texture = r.textureCache.texture; + var vp = r.textureCache.viewport; + bb = r.textureCache.bb; + + context.setTransform( 1, 0, 0, 1, 0, 0 ); + + if( motionBlur ){ + mbclear( context, 0, 0, vp.width, vp.height ); + } else { + context.clearRect( 0, 0, vp.width, vp.height ); + } + + var outsideBgColor = coreStyle[ 'outside-texture-bg-color' ].value; + var outsideBgOpacity = coreStyle[ 'outside-texture-bg-opacity' ].value; + r.fillStyle( context, outsideBgColor[0], outsideBgColor[1], outsideBgColor[2], outsideBgOpacity ); + context.fillRect( 0, 0, vp.width, vp.height ); + + var zoom = cy.zoom(); + + setContextTransform( context, false ); + + context.clearRect( vp.mpan.x, vp.mpan.y, vp.width / vp.zoom / pixelRatio, vp.height / vp.zoom / pixelRatio ); + context.drawImage( texture, vp.mpan.x, vp.mpan.y, vp.width / vp.zoom / pixelRatio, vp.height / vp.zoom / pixelRatio ); + + } else if( r.textureOnViewport && !forcedContext ){ // clear the cache since we don't need it + r.textureCache = null; + } + + var extent = cy.extent(); + var vpManip = (r.pinching || r.hoverData.dragging || r.swipePanning || r.data.wheelZooming || r.hoverData.draggingEles); + var hideEdges = r.hideEdgesOnViewport && vpManip; + + var needMbClear = []; + + needMbClear[ r.NODE ] = !needDraw[ r.NODE ] && motionBlur && !r.clearedForMotionBlur[ r.NODE ] || r.clearingMotionBlur; + if( needMbClear[ r.NODE ] ){ r.clearedForMotionBlur[ r.NODE ] = true; } + + needMbClear[ r.DRAG ] = !needDraw[ r.DRAG ] && motionBlur && !r.clearedForMotionBlur[ r.DRAG ] || r.clearingMotionBlur; + if( needMbClear[ r.DRAG ] ){ r.clearedForMotionBlur[ r.DRAG ] = true; } + + if( needDraw[ r.NODE ] || drawAllLayers || drawOnlyNodeLayer || needMbClear[ r.NODE ] ){ + var useBuffer = motionBlur && !needMbClear[ r.NODE ] && mbPxRatio !== 1; + var context = forcedContext || ( useBuffer ? r.data.bufferContexts[ r.MOTIONBLUR_BUFFER_NODE ] : data.contexts[ r.NODE ] ); + var clear = motionBlur && !useBuffer ? 'motionBlur' : undefined; + + setContextTransform( context, clear ); + + if( hideEdges ){ + r.drawCachedNodes( context, eles.nondrag, pixelRatio, extent ); + } else { + r.drawLayeredElements( context, eles.nondrag, pixelRatio, extent ); + } + + if( r.debug ){ + r.drawDebugPoints( context, eles.nondrag ); + } + + if( !drawAllLayers && !motionBlur ){ + needDraw[ r.NODE ] = false; + } + } + + if( !drawOnlyNodeLayer && (needDraw[ r.DRAG ] || drawAllLayers || needMbClear[ r.DRAG ]) ){ + var useBuffer = motionBlur && !needMbClear[ r.DRAG ] && mbPxRatio !== 1; + var context = forcedContext || ( useBuffer ? r.data.bufferContexts[ r.MOTIONBLUR_BUFFER_DRAG ] : data.contexts[ r.DRAG ] ); + + setContextTransform( context, motionBlur && !useBuffer ? 'motionBlur' : undefined ); + + if( hideEdges ){ + r.drawCachedNodes( context, eles.drag, pixelRatio, extent ); + } else { + r.drawCachedElements( context, eles.drag, pixelRatio, extent ); + } + + if( r.debug ){ + r.drawDebugPoints( context, eles.drag ); + } + + if( !drawAllLayers && !motionBlur ){ + needDraw[ r.DRAG ] = false; + } + } + + if( r.showFps || (!drawOnlyNodeLayer && (needDraw[ r.SELECT_BOX ] && !drawAllLayers)) ){ + var context = forcedContext || data.contexts[ r.SELECT_BOX ]; + + setContextTransform( context ); + + if( r.selection[4] == 1 && ( r.hoverData.selecting || r.touchData.selecting ) ){ + var zoom = r.cy.zoom(); + var borderWidth = coreStyle[ 'selection-box-border-width' ].value / zoom; + + context.lineWidth = borderWidth; + context.fillStyle = 'rgba(' + + coreStyle[ 'selection-box-color' ].value[0] + ',' + + coreStyle[ 'selection-box-color' ].value[1] + ',' + + coreStyle[ 'selection-box-color' ].value[2] + ',' + + coreStyle[ 'selection-box-opacity' ].value + ')'; + + context.fillRect( + r.selection[0], + r.selection[1], + r.selection[2] - r.selection[0], + r.selection[3] - r.selection[1] ); + + if( borderWidth > 0 ){ + context.strokeStyle = 'rgba(' + + coreStyle[ 'selection-box-border-color' ].value[0] + ',' + + coreStyle[ 'selection-box-border-color' ].value[1] + ',' + + coreStyle[ 'selection-box-border-color' ].value[2] + ',' + + coreStyle[ 'selection-box-opacity' ].value + ')'; + + context.strokeRect( + r.selection[0], + r.selection[1], + r.selection[2] - r.selection[0], + r.selection[3] - r.selection[1] ); + } + } + + if( data.bgActivePosistion && !r.hoverData.selecting ){ + var zoom = r.cy.zoom(); + var pos = data.bgActivePosistion; + + context.fillStyle = 'rgba(' + + coreStyle[ 'active-bg-color' ].value[0] + ',' + + coreStyle[ 'active-bg-color' ].value[1] + ',' + + coreStyle[ 'active-bg-color' ].value[2] + ',' + + coreStyle[ 'active-bg-opacity' ].value + ')'; + + context.beginPath(); + context.arc( pos.x, pos.y, coreStyle[ 'active-bg-size' ].pfValue / zoom, 0, 2 * Math.PI ); + context.fill(); + } + + var timeToRender = r.lastRedrawTime; + if( r.showFps && timeToRender ){ + timeToRender = Math.round( timeToRender ); + var fps = Math.round( 1000 / timeToRender ); + + context.setTransform( 1, 0, 0, 1, 0, 0 ); + + context.fillStyle = 'rgba(255, 0, 0, 0.75)'; + context.strokeStyle = 'rgba(255, 0, 0, 0.75)'; + context.lineWidth = 1; + context.fillText( '1 frame = ' + timeToRender + ' ms = ' + fps + ' fps', 0, 20 ); + + var maxFps = 60; + context.strokeRect( 0, 30, 250, 20 ); + context.fillRect( 0, 30, 250 * Math.min( fps / maxFps, 1 ), 20 ); + } + + if( !drawAllLayers ){ + needDraw[ r.SELECT_BOX ] = false; + } + } + + // motionblur: blit rendered blurry frames + if( motionBlur && mbPxRatio !== 1 ){ + var cxtNode = data.contexts[ r.NODE ]; + var txtNode = r.data.bufferCanvases[ r.MOTIONBLUR_BUFFER_NODE ]; + + var cxtDrag = data.contexts[ r.DRAG ]; + var txtDrag = r.data.bufferCanvases[ r.MOTIONBLUR_BUFFER_DRAG ]; + + var drawMotionBlur = function( cxt, txt, needClear ){ + cxt.setTransform( 1, 0, 0, 1, 0, 0 ); + + if( needClear || !motionBlurFadeEffect ){ + cxt.clearRect( 0, 0, r.canvasWidth, r.canvasHeight ); + } else { + mbclear( cxt, 0, 0, r.canvasWidth, r.canvasHeight ); + } + + var pxr = mbPxRatio; + + cxt.drawImage( + txt, // img + 0, 0, // sx, sy + r.canvasWidth * pxr, r.canvasHeight * pxr, // sw, sh + 0, 0, // x, y + r.canvasWidth, r.canvasHeight // w, h + ); + }; + + if( needDraw[ r.NODE ] || needMbClear[ r.NODE ] ){ + drawMotionBlur( cxtNode, txtNode, needMbClear[ r.NODE ] ); + needDraw[ r.NODE ] = false; + } + + if( needDraw[ r.DRAG ] || needMbClear[ r.DRAG ] ){ + drawMotionBlur( cxtDrag, txtDrag, needMbClear[ r.DRAG ] ); + needDraw[ r.DRAG ] = false; + } + } + + r.prevViewport = vp; + + if( r.clearingMotionBlur ){ + r.clearingMotionBlur = false; + r.motionBlurCleared = true; + r.motionBlur = true; + } + + if( motionBlur ){ + r.motionBlurTimeout = setTimeout( function(){ + r.motionBlurTimeout = null; + + r.clearedForMotionBlur[ r.NODE ] = false; + r.clearedForMotionBlur[ r.DRAG ] = false; + r.motionBlur = false; + r.clearingMotionBlur = !textureDraw; + r.mbFrames = 0; + + needDraw[ r.NODE ] = true; + needDraw[ r.DRAG ] = true; + + r.redraw(); + }, motionBlurDelay ); + } + + if( !forcedContext ){ + cy.emit('render'); + } + +}; + +module.exports = CRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-shapes.js b/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-shapes.js new file mode 100644 index 000000000..ad1bed1f6 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-shapes.js @@ -0,0 +1,168 @@ +var math = require( '../../../math' ); + +var CRp = {}; + +// @O Polygon drawing +CRp.drawPolygonPath = function( + context, x, y, width, height, points ){ + + var halfW = width / 2; + var halfH = height / 2; + + if( context.beginPath ){ context.beginPath(); } + + context.moveTo( x + halfW * points[0], y + halfH * points[1] ); + + for( var i = 1; i < points.length / 2; i++ ){ + context.lineTo( x + halfW * points[ i * 2], y + halfH * points[ i * 2 + 1] ); + } + + context.closePath(); +}; + +// Round rectangle drawing +CRp.drawRoundRectanglePath = function( + context, x, y, width, height ){ + + var halfWidth = width / 2; + var halfHeight = height / 2; + var cornerRadius = math.getRoundRectangleRadius( width, height ); + + if( context.beginPath ){ context.beginPath(); } + + // Start at top middle + context.moveTo( x, y - halfHeight ); + // Arc from middle top to right side + context.arcTo( x + halfWidth, y - halfHeight, x + halfWidth, y, cornerRadius ); + // Arc from right side to bottom + context.arcTo( x + halfWidth, y + halfHeight, x, y + halfHeight, cornerRadius ); + // Arc from bottom to left side + context.arcTo( x - halfWidth, y + halfHeight, x - halfWidth, y, cornerRadius ); + // Arc from left side to topBorder + context.arcTo( x - halfWidth, y - halfHeight, x, y - halfHeight, cornerRadius ); + // Join line + context.lineTo( x, y - halfHeight ); + + + context.closePath(); +}; + +CRp.drawBottomRoundRectanglePath = function( + context, x, y, width, height ){ + + var halfWidth = width / 2; + var halfHeight = height / 2; + var cornerRadius = math.getRoundRectangleRadius( width, height ); + + if( context.beginPath ){ context.beginPath(); } + + // Start at top middle + context.moveTo( x, y - halfHeight ); + context.lineTo( x + halfWidth, y - halfHeight ); + context.lineTo( x + halfWidth, y ); + + context.arcTo( x + halfWidth, y + halfHeight, x, y + halfHeight, cornerRadius); + context.arcTo( x - halfWidth, y + halfHeight, x - halfWidth, y, cornerRadius ); + + context.lineTo( x - halfWidth, y - halfHeight ); + context.lineTo( x, y - halfHeight ); + + context.closePath(); +}; + +CRp.drawCutRectanglePath = function( + context, x, y, width, height ){ + + var halfWidth = width / 2; + var halfHeight = height / 2; + var cornerLength = math.getCutRectangleCornerLength(); + + if( context.beginPath ){ context.beginPath(); } + + context.moveTo( x - halfWidth + cornerLength, y - halfHeight ); + + context.lineTo( x + halfWidth - cornerLength, y - halfHeight ); + context.lineTo( x + halfWidth, y - halfHeight + cornerLength ); + context.lineTo( x + halfWidth, y + halfHeight - cornerLength ); + context.lineTo( x + halfWidth - cornerLength, y + halfHeight ); + context.lineTo( x - halfWidth + cornerLength, y + halfHeight ); + context.lineTo( x - halfWidth, y + halfHeight - cornerLength ); + context.lineTo( x - halfWidth, y - halfHeight + cornerLength ); + + context.closePath(); +}; + +CRp.drawBarrelPath = function( + context, x, y, width, height ){ + + var halfWidth = width / 2; + var halfHeight = height / 2; + + var xBegin = x - halfWidth; + var xEnd = x + halfWidth; + var yBegin = y - halfHeight; + var yEnd = y + halfHeight; + + var barrelCurveConstants = math.getBarrelCurveConstants( width, height ); + var wOffset = barrelCurveConstants.widthOffset; + var hOffset = barrelCurveConstants.heightOffset; + var ctrlPtXOffset = barrelCurveConstants.ctrlPtOffsetPct * wOffset; + + if( context.beginPath ){ context.beginPath(); } + + context.moveTo( xBegin, yBegin + hOffset ); + + context.lineTo( xBegin, yEnd - hOffset ); + context.quadraticCurveTo( xBegin + ctrlPtXOffset, yEnd, xBegin + wOffset, yEnd ); + + context.lineTo( xEnd - wOffset, yEnd ); + context.quadraticCurveTo( xEnd - ctrlPtXOffset, yEnd, xEnd, yEnd - hOffset ); + + context.lineTo( xEnd, yBegin + hOffset ); + context.quadraticCurveTo( xEnd - ctrlPtXOffset, yBegin, xEnd - wOffset, yBegin ); + + context.lineTo( xBegin + wOffset, yBegin ); + context.quadraticCurveTo( xBegin + ctrlPtXOffset, yBegin, xBegin, yBegin + hOffset ); + + context.closePath(); +}; + + +var sin0 = Math.sin( 0 ); +var cos0 = Math.cos( 0 ); + +var sin = {}; +var cos = {}; + +var ellipseStepSize = Math.PI / 40; + +for( var i = 0 * Math.PI; i < 2 * Math.PI; i += ellipseStepSize ){ + sin[ i ] = Math.sin( i ); + cos[ i ] = Math.cos( i ); +} + +CRp.drawEllipsePath = function( context, centerX, centerY, width, height ){ + if( context.beginPath ){ context.beginPath(); } + + if( context.ellipse ){ + context.ellipse( centerX, centerY, width / 2, height / 2, 0, 0, 2 * Math.PI ); + } else { + var xPos, yPos; + var rw = width / 2; + var rh = height / 2; + for( var i = 0 * Math.PI; i < 2 * Math.PI; i += ellipseStepSize ){ + xPos = centerX - (rw * sin[ i ]) * sin0 + (rw * cos[ i ]) * cos0; + yPos = centerY + (rh * cos[ i ]) * sin0 + (rh * sin[ i ]) * cos0; + + if( i === 0 ){ + context.moveTo( xPos, yPos ); + } else { + context.lineTo( xPos, yPos ); + } + } + } + + context.closePath(); + }; + +module.exports = CRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/ele-texture-cache.js b/node_modules/cytoscape/src/extensions/renderer/canvas/ele-texture-cache.js new file mode 100644 index 000000000..6ee1ee662 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/canvas/ele-texture-cache.js @@ -0,0 +1,500 @@ +var math = require( '../../../math' ); +var util = require( '../../../util' ); +var Heap = require( '../../../heap' ); +var defs = require( './texture-cache-defs' ); + +var minTxrH = 25; // the size of the texture cache for small height eles (special case) +var txrStepH = 50; // the min size of the regular cache, and the size it increases with each step up +var minLvl = -4; // when scaling smaller than that we don't need to re-render +var maxLvl = 2; // when larger than this scale just render directly (caching is not helpful) +var maxZoom = 3.99; // beyond this zoom level, layered textures are not used +var eleTxrSpacing = 8; // spacing between elements on textures to avoid blitting overlaps +var defTxrWidth = 1024; // default/minimum texture width +var maxTxrW = 1024; // the maximum width of a texture +var maxTxrH = 1024; // the maximum height of a texture +var minUtility = 0.5; // if usage of texture is less than this, it is retired +var maxFullness = 0.8; // fullness of texture after which queue removal is checked +var maxFullnessChecks = 10; // dequeued after this many checks +var allowEdgeTxrCaching = false; // whether edges can be cached as textures (TODO maybe better on if webgl supported?) +var allowParentTxrCaching = false; // whether parent nodes can be cached as textures (TODO maybe better on if webgl supported?) +var deqCost = 0.15; // % of add'l rendering cost allowed for dequeuing ele caches each frame +var deqAvgCost = 0.1; // % of add'l rendering cost compared to average overall redraw time +var deqNoDrawCost = 0.9; // % of avg frame time that can be used for dequeueing when not drawing +var deqFastCost = 0.9; // % of frame time to be used when >60fps +var deqRedrawThreshold = 100; // time to batch redraws together from dequeueing to allow more dequeueing calcs to happen in the meanwhile +var maxDeqSize = 1; // number of eles to dequeue and render at higher texture in each batch + +var getTxrReasons = { + dequeue: 'dequeue', + downscale: 'downscale', + highQuality: 'highQuality' +}; + +var ElementTextureCache = function( renderer ){ + var self = this; + + self.renderer = renderer; + self.onDequeues = []; + + self.setupDequeueing(); +}; + +var ETCp = ElementTextureCache.prototype; + +ETCp.reasons = getTxrReasons; + +// the list of textures in which new subtextures for elements can be placed +ETCp.getTextureQueue = function( txrH ){ + var self = this; + self.eleImgCaches = self.eleImgCaches || {}; + + return ( self.eleImgCaches[ txrH ] = self.eleImgCaches[ txrH ] || [] ); +}; + +// the list of usused textures which can be recycled (in use in texture queue) +ETCp.getRetiredTextureQueue = function( txrH ){ + var self = this; + + var rtxtrQs = self.eleImgCaches.retired = self.eleImgCaches.retired || {}; + var rtxtrQ = rtxtrQs[ txrH ] = rtxtrQs[ txrH ] || []; + + return rtxtrQ; +}; + +// queue of element draw requests at different scale levels +ETCp.getElementQueue = function(){ + var self = this; + + var q = self.eleCacheQueue = self.eleCacheQueue || new Heap(function( a, b ){ + return b.reqs - a.reqs; + }); + + return q; +}; + +// queue of element draw requests at different scale levels (element id lookup) +ETCp.getElementIdToQueue = function(){ + var self = this; + + var id2q = self.eleIdToCacheQueue = self.eleIdToCacheQueue || {}; + + return id2q; +}; + +ETCp.getElement = function( ele, bb, pxRatio, lvl, reason ){ + var self = this; + var r = this.renderer; + var rs = ele._private.rscratch; + var zoom = r.cy.zoom(); + + if( bb.w === 0 || bb.h === 0 || !ele.visible() ){ return null; } + + if( lvl == null ){ + lvl = Math.ceil( math.log2( zoom * pxRatio ) ); + } + + if( lvl < minLvl ){ + lvl = minLvl; + } else if( zoom >= maxZoom || lvl > maxLvl ){ + return null; + } + + var scale = Math.pow( 2, lvl ); + var eleScaledH = bb.h * scale; + var eleScaledW = bb.w * scale; + var caches = rs.imgCaches = rs.imgCaches || {}; + var eleCache = caches[lvl]; + + if( eleCache ){ + return eleCache; + } + + var txrH; // which texture height this ele belongs to + + if( eleScaledH <= minTxrH ){ + txrH = minTxrH; + } else if( eleScaledH <= txrStepH ){ + txrH = txrStepH; + } else { + txrH = Math.ceil( eleScaledH / txrStepH ) * txrStepH; + } + + if( + eleScaledH > maxTxrH + || eleScaledW > maxTxrW + || ( !allowEdgeTxrCaching && ele.isEdge() ) + || ( !allowParentTxrCaching && ele.isParent() ) + ){ + return null; // caching large elements is not efficient + } + + var txrQ = self.getTextureQueue( txrH ); + + // first try the second last one in case it has space at the end + var txr = txrQ[ txrQ.length - 2 ]; + + var addNewTxr = function(){ + return self.recycleTexture( txrH, eleScaledW ) || self.addTexture( txrH, eleScaledW ); + }; + + // try the last one if there is no second last one + if( !txr ){ + txr = txrQ[ txrQ.length - 1 ]; + } + + // if the last one doesn't exist, we need a first one + if( !txr ){ + txr = addNewTxr(); + } + + // if there's no room in the current texture, we need a new one + if( txr.width - txr.usedWidth < eleScaledW ){ + txr = addNewTxr(); + } + + var scaledLabelShown = r.eleTextBiggerThanMin( ele, scale ); + var scalableFrom = function( otherCache ){ + return otherCache && otherCache.scaledLabelShown === scaledLabelShown; + }; + + var deqing = reason && reason === getTxrReasons.dequeue; + var highQualityReq = reason && reason === getTxrReasons.highQuality; + var downscaleReq = reason && reason === getTxrReasons.downscale; + + var higherCache; // the nearest cache with a higher level + for( var l = lvl + 1; l <= maxLvl; l++ ){ + var c = caches[l]; + + if( c ){ higherCache = c; break; } + } + + var oneUpCache = higherCache && higherCache.level === lvl + 1 ? higherCache : null; + + var downscale = function(){ + txr.context.drawImage( + oneUpCache.texture.canvas, + oneUpCache.x, 0, + oneUpCache.width, oneUpCache.height, + txr.usedWidth, 0, + eleScaledW, eleScaledH + ); + }; + + // reset ele area in texture + txr.context.setTransform( 1, 0, 0, 1, 0, 0 ); + txr.context.clearRect( txr.usedWidth, 0, eleScaledW, txrH ); + + if( scalableFrom(oneUpCache) ){ + // then we can relatively cheaply rescale the existing image w/o rerendering + downscale(); + + } else if( scalableFrom(higherCache) ){ + // then use the higher cache for now and queue the next level down + // to cheaply scale towards the smaller level + + if( highQualityReq ){ + for( var l = higherCache.level; l > lvl; l-- ){ + oneUpCache = self.getElement( ele, bb, pxRatio, l, getTxrReasons.downscale ); + } + + downscale(); + + } else { + self.queueElement( ele, higherCache.level - 1 ); + + return higherCache; + } + } else { + + var lowerCache; // the nearest cache with a lower level + if( !deqing && !highQualityReq && !downscaleReq ){ + for( var l = lvl - 1; l >= minLvl; l-- ){ + var c = caches[l]; + + if( c ){ lowerCache = c; break; } + } + } + + if( scalableFrom(lowerCache) ){ + // then use the lower quality cache for now and queue the better one for later + + self.queueElement( ele, lvl ); + + return lowerCache; + } + + txr.context.translate( txr.usedWidth, 0 ); + txr.context.scale( scale, scale ); + + r.drawElement( txr.context, ele, bb, scaledLabelShown ); + + txr.context.scale( 1/scale, 1/scale ); + txr.context.translate( -txr.usedWidth, 0 ); + } + + eleCache = caches[lvl] = { + ele: ele, + x: txr.usedWidth, + texture: txr, + level: lvl, + scale: scale, + width: eleScaledW, + height: eleScaledH, + scaledLabelShown: scaledLabelShown + }; + + txr.usedWidth += Math.ceil( eleScaledW + eleTxrSpacing ); + + txr.eleCaches.push( eleCache ); + + self.checkTextureFullness( txr ); + + return eleCache; +}; + +ETCp.invalidateElement = function( ele ){ + var self = this; + var caches = ele._private.rscratch.imgCaches; + + if( caches ){ + for( var lvl = minLvl; lvl <= maxLvl; lvl++ ){ + var cache = caches[ lvl ]; + + if( cache ){ + var txr = cache.texture; + + // remove space from the texture it belongs to + txr.invalidatedWidth += cache.width; + + // remove refs with the element + caches[ lvl ] = null; + util.removeFromArray( txr.eleCaches, cache ); + + // remove from queue since the old req was for the old state + self.removeFromQueue( ele ); + + // might have to remove the entire texture if it's not efficiently using its space + self.checkTextureUtility( txr ); + } + } + } +}; + +ETCp.checkTextureUtility = function( txr ){ + // invalidate all entries in the cache if the cache size is small + if( txr.invalidatedWidth >= minUtility * txr.width ){ + this.retireTexture( txr ); + } +}; + +ETCp.checkTextureFullness = function( txr ){ + // if texture has been mostly filled and passed over several times, remove + // it from the queue so we don't need to waste time looking at it to put new things + + var self = this; + var txrQ = self.getTextureQueue( txr.height ); + + if( txr.usedWidth / txr.width > maxFullness && txr.fullnessChecks >= maxFullnessChecks ){ + util.removeFromArray( txrQ, txr ); + } else { + txr.fullnessChecks++; + } +}; + +ETCp.retireTexture = function( txr ){ + var self = this; + var txrH = txr.height; + var txrQ = self.getTextureQueue( txrH ); + + // retire the texture from the active / searchable queue: + + util.removeFromArray( txrQ, txr ); + + txr.retired = true; + + // remove the refs from the eles to the caches: + + var eleCaches = txr.eleCaches; + + for( var i = 0; i < eleCaches.length; i++ ){ + var eleCache = eleCaches[i]; + var ele = eleCache.ele; + var lvl = eleCache.level; + var imgCaches = ele._private.rscratch.imgCaches; + + if( imgCaches ){ + imgCaches[ lvl ] = null; + } + } + + util.clearArray( eleCaches ); + + // add the texture to a retired queue so it can be recycled in future: + + var rtxtrQ = self.getRetiredTextureQueue( txrH ); + + rtxtrQ.push( txr ); +}; + +ETCp.addTexture = function( txrH, minW ){ + var self = this; + var txrQ = self.getTextureQueue( txrH ); + var txr = {}; + + txrQ.push( txr ); + + txr.eleCaches = []; + + txr.height = txrH; + txr.width = Math.max( defTxrWidth, minW ); + txr.usedWidth = 0; + txr.invalidatedWidth = 0; + txr.fullnessChecks = 0; + + txr.canvas = document.createElement('canvas'); // eslint-disable-line no-undef + txr.canvas.width = txr.width; + txr.canvas.height = txr.height; + + txr.context = txr.canvas.getContext('2d'); + + return txr; +}; + +ETCp.recycleTexture = function( txrH, minW ){ + var self = this; + var txrQ = self.getTextureQueue( txrH ); + var rtxtrQ = self.getRetiredTextureQueue( txrH ); + + for( var i = 0; i < rtxtrQ.length; i++ ){ + var txr = rtxtrQ[i]; + + if( txr.width >= minW ){ + txr.retired = false; + + txr.usedWidth = 0; + txr.invalidatedWidth = 0; + txr.fullnessChecks = 0; + + util.clearArray( txr.eleCaches ); + + txr.context.setTransform( 1, 0, 0, 1, 0, 0 ); + txr.context.clearRect( 0, 0, txr.width, txr.height ); + + util.removeFromArray( rtxtrQ, txr ); + txrQ.push( txr ); + + return txr; + } + } +}; + +ETCp.queueElement = function( ele, lvl ){ + var self = this; + var q = self.getElementQueue(); + var id2q = self.getElementIdToQueue(); + var id = ele.id(); + var existingReq = id2q[ id ]; + + if( existingReq ){ // use the max lvl b/c in between lvls are cheap to make + existingReq.level = Math.max( existingReq.level, lvl ); + existingReq.reqs++; + + q.updateItem( existingReq ); + } else { + var req = { + ele: ele, + level: lvl, + reqs: 1 + }; + + q.push( req ); + + id2q[ id ] = req; + } +}; + +ETCp.dequeue = function( pxRatio /*, extent*/ ){ + var self = this; + var q = self.getElementQueue(); + var id2q = self.getElementIdToQueue(); + var dequeued = []; + + for( var i = 0; i < maxDeqSize; i++ ){ + if( q.size() > 0 ){ + var req = q.pop(); + var ele = req.ele; + var caches = ele._private.rscratch.imgCaches; + + // dequeueing isn't necessary when an existing cache exists + if( caches[ req.level ] != null ){ + continue; + } + + id2q[ ele.id() ] = null; + + dequeued.push( req ); + + var bb = ele.boundingBox(); + + self.getElement( ele, bb, pxRatio, req.level, getTxrReasons.dequeue ); + } else { + break; + } + } + + return dequeued; +}; + +ETCp.removeFromQueue = function( ele ){ + var self = this; + var q = self.getElementQueue(); + var id2q = self.getElementIdToQueue(); + var req = id2q[ ele.id() ]; + + if( req != null ){ + // bring to front of queue + req.reqs = util.MAX_INT; + q.updateItem( req ); + + q.pop(); // remove from queue + + id2q[ ele.id() ] = null; // remove from lookup map + } +}; + +ETCp.onDequeue = function( fn ){ this.onDequeues.push( fn ); }; +ETCp.offDequeue = function( fn ){ util.removeFromArray( this.onDequeues, fn ); }; + +ETCp.setupDequeueing = defs.setupDequeueing({ + deqRedrawThreshold: deqRedrawThreshold, + deqCost: deqCost, + deqAvgCost: deqAvgCost, + deqNoDrawCost: deqNoDrawCost, + deqFastCost: deqFastCost, + deq: function( self, pxRatio, extent ){ + return self.dequeue( pxRatio, extent ); + }, + onDeqd: function( self, deqd ){ + for( var i = 0; i < self.onDequeues.length; i++ ){ + var fn = self.onDequeues[i]; + + fn( deqd ); + } + }, + shouldRedraw: function( self, deqd, pxRatio, extent ){ + for( var i = 0; i < deqd.length; i++ ){ + var bb = deqd[i].ele.boundingBox(); + + if( math.boundingBoxesIntersect( bb, extent ) ){ + return true; + } + } + + return false; + }, + priority: function( self ){ + return self.renderer.beforeRenderPriorities.eleTxrDeq; + } +}); + +module.exports = ElementTextureCache; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/export-image.js b/node_modules/cytoscape/src/extensions/renderer/canvas/export-image.js new file mode 100644 index 000000000..64763e557 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/canvas/export-image.js @@ -0,0 +1,154 @@ +var is = require( '../../../is' ); + +var CRp = {}; + +CRp.createBuffer = function( w, h ){ + var buffer = document.createElement( 'canvas' ); // eslint-disable-line no-undef + buffer.width = w; + buffer.height = h; + + return [ buffer, buffer.getContext( '2d' ) ]; +}; + +CRp.bufferCanvasImage = function( options ){ + var cy = this.cy; + var eles = cy.mutableElements(); + var bb = eles.boundingBox(); + var ctrRect = this.findContainerClientCoords(); + var width = options.full ? Math.ceil( bb.w ) : ctrRect[2]; + var height = options.full ? Math.ceil( bb.h ) : ctrRect[3]; + var specdMaxDims = is.number( options.maxWidth ) || is.number( options.maxHeight ); + var pxRatio = this.getPixelRatio(); + var scale = 1; + + if( options.scale !== undefined ){ + width *= options.scale; + height *= options.scale; + + scale = options.scale; + } else if( specdMaxDims ){ + var maxScaleW = Infinity; + var maxScaleH = Infinity; + + if( is.number( options.maxWidth ) ){ + maxScaleW = scale * options.maxWidth / width; + } + + if( is.number( options.maxHeight ) ){ + maxScaleH = scale * options.maxHeight / height; + } + + scale = Math.min( maxScaleW, maxScaleH ); + + width *= scale; + height *= scale; + } + + if( !specdMaxDims ){ + width *= pxRatio; + height *= pxRatio; + scale *= pxRatio; + } + + var buffCanvas = document.createElement( 'canvas' ); // eslint-disable-line no-undef + + buffCanvas.width = width; + buffCanvas.height = height; + + buffCanvas.style.width = width + 'px'; + buffCanvas.style.height = height + 'px'; + + var buffCxt = buffCanvas.getContext( '2d' ); + + // Rasterize the layers, but only if container has nonzero size + if( width > 0 && height > 0 ){ + + buffCxt.clearRect( 0, 0, width, height ); + + buffCxt.globalCompositeOperation = 'source-over'; + + var zsortedEles = this.getCachedZSortedEles(); + + if( options.full ){ // draw the full bounds of the graph + buffCxt.translate( -bb.x1 * scale, -bb.y1 * scale ); + buffCxt.scale( scale, scale ); + + this.drawElements( buffCxt, zsortedEles ); + + buffCxt.scale( 1/scale, 1/scale ); + buffCxt.translate( bb.x1 * scale, bb.y1 * scale ); + } else { // draw the current view + var pan = cy.pan(); + + var translation = { + x: pan.x * scale, + y: pan.y * scale + }; + + scale *= cy.zoom(); + + buffCxt.translate( translation.x, translation.y ); + buffCxt.scale( scale, scale ); + + this.drawElements( buffCxt, zsortedEles ); + + buffCxt.scale( 1/scale, 1/scale ); + buffCxt.translate( -translation.x, -translation.y ); + } + + // need to fill bg at end like this in order to fill cleared transparent pixels in jpgs + if( options.bg ){ + buffCxt.globalCompositeOperation = 'destination-over'; + + buffCxt.fillStyle = options.bg; + buffCxt.rect( 0, 0, width, height ); + buffCxt.fill(); + } + } + + return buffCanvas; +}; + +function b64ToBlob( b64, mimeType ){ + var bytes = atob( b64 ); + var buff = new ArrayBuffer( bytes.length ); + var buffUint8 = new Uint8Array( buff ); + + for( var i = 0; i < bytes.length; i++ ){ + buffUint8[i] = bytes.charCodeAt(i); + } + + return new Blob( [buff], { type: mimeType } ); +} + +function b64UriToB64( b64uri ){ + var i = b64uri.indexOf(','); + + return b64uri.substr( i + 1 ); +}; + +function output( options, canvas, mimeType ){ + var b64Uri = canvas.toDataURL( mimeType, options.quality ); + + switch( options.output ){ + case 'blob': + return b64ToBlob( b64UriToB64( b64Uri ), mimeType ); + + case 'base64': + return b64UriToB64( b64Uri ); + + case 'base64uri': + default: + return b64Uri; + } +} + +CRp.png = function( options ){ + return output( options, this.bufferCanvasImage( options ), 'image/png' ); +}; + +CRp.jpg = function( options ){ + return output( options, this.bufferCanvasImage( options ), 'image/jpeg' ); +}; + +module.exports = CRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/index.js b/node_modules/cytoscape/src/extensions/renderer/canvas/index.js new file mode 100644 index 000000000..509325d82 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/canvas/index.js @@ -0,0 +1,171 @@ +/* +The canvas renderer was written by Yue Dong. + +Modifications tracked on Github. +*/ + +var util = require( '../../../util' ); +var is = require( '../../../is' ); +var ElementTextureCache = require('./ele-texture-cache'); +var LayeredTextureCache = require('./layered-texture-cache'); + +var CR = CanvasRenderer; +var CRp = CanvasRenderer.prototype; + +CRp.CANVAS_LAYERS = 3; +// +CRp.SELECT_BOX = 0; +CRp.DRAG = 1; +CRp.NODE = 2; + +CRp.BUFFER_COUNT = 3; +// +CRp.TEXTURE_BUFFER = 0; +CRp.MOTIONBLUR_BUFFER_NODE = 1; +CRp.MOTIONBLUR_BUFFER_DRAG = 2; + +function CanvasRenderer( options ){ + var r = this; + + r.data = { + canvases: new Array( CRp.CANVAS_LAYERS ), + contexts: new Array( CRp.CANVAS_LAYERS ), + canvasNeedsRedraw: new Array( CRp.CANVAS_LAYERS ), + + bufferCanvases: new Array( CRp.BUFFER_COUNT ), + bufferContexts: new Array( CRp.CANVAS_LAYERS ), + }; + + var tapHlOff = '-webkit-tap-highlight-color: rgba(0,0,0,0);'; + + r.data.canvasContainer = document.createElement( 'div' ); // eslint-disable-line no-undef + var containerStyle = r.data.canvasContainer.style; + r.data.canvasContainer.setAttribute( 'style', tapHlOff ); + containerStyle.position = 'relative'; + containerStyle.zIndex = '0'; + containerStyle.overflow = 'hidden'; + + var container = options.cy.container(); + container.appendChild( r.data.canvasContainer ); + + if( (container.getAttribute('style') || '').indexOf(tapHlOff) < 0 ){ + container.setAttribute( 'style', ( container.getAttribute( 'style' ) || '' ) + tapHlOff ); + } + + for( var i = 0; i < CRp.CANVAS_LAYERS; i++ ){ + var canvas = r.data.canvases[ i ] = document.createElement( 'canvas' ); // eslint-disable-line no-undef + r.data.contexts[ i ] = canvas.getContext( '2d' ); + canvas.setAttribute( 'style', '-webkit-user-select: none; -moz-user-select: -moz-none; user-select: none; -webkit-tap-highlight-color: rgba(0,0,0,0); outline-style: none;' + ( is.ms() ? ' -ms-touch-action: none; touch-action: none; ' : '' ) ); + canvas.style.position = 'absolute'; + canvas.setAttribute( 'data-id', 'layer' + i ); + canvas.style.zIndex = String( CRp.CANVAS_LAYERS - i ); + r.data.canvasContainer.appendChild( canvas ); + + r.data.canvasNeedsRedraw[ i ] = false; + } + r.data.topCanvas = r.data.canvases[0]; + + r.data.canvases[ CRp.NODE ].setAttribute( 'data-id', 'layer' + CRp.NODE + '-node' ); + r.data.canvases[ CRp.SELECT_BOX ].setAttribute( 'data-id', 'layer' + CRp.SELECT_BOX + '-selectbox' ); + r.data.canvases[ CRp.DRAG ].setAttribute( 'data-id', 'layer' + CRp.DRAG + '-drag' ); + + for( var i = 0; i < CRp.BUFFER_COUNT; i++ ){ + r.data.bufferCanvases[ i ] = document.createElement( 'canvas' ); // eslint-disable-line no-undef + r.data.bufferContexts[ i ] = r.data.bufferCanvases[ i ].getContext( '2d' ); + r.data.bufferCanvases[ i ].style.position = 'absolute'; + r.data.bufferCanvases[ i ].setAttribute( 'data-id', 'buffer' + i ); + r.data.bufferCanvases[ i ].style.zIndex = String( -i - 1 ); + r.data.bufferCanvases[ i ].style.visibility = 'hidden'; + //r.data.canvasContainer.appendChild(r.data.bufferCanvases[i]); + } + + r.pathsEnabled = true; + + r.data.eleTxrCache = new ElementTextureCache( r ); + r.data.lyrTxrCache = new LayeredTextureCache( r, r.data.eleTxrCache ); + + r.onUpdateEleCalcs(function invalidateTextureCaches( willDraw, eles ){ + for( var i = 0; i < eles.length; i++ ){ + var ele = eles[i]; + var rs = ele._private.rstyle; + var de = rs.dirtyEvents; + + if( ele.isNode() && de && de.length === 1 && de['position'] ){ + // then keep cached ele texture + } else { + r.data.eleTxrCache.invalidateElement( ele ); + + // NB this block of code should not be ported to 3.3 (unstable branch). + // - This check is unneccesary in 3.3 as caches will be stored without respect to opacity. + // - This fix may result in lowered performance for compound graphs. + // - Ref : Opacity of child node is not updated for certain zoom levels after parent opacity is overriden #2078 + if( ele.isParent() && de['style'] ){ + var op1 = rs.prevParentOpacity; + var op2 = ele.pstyle('opacity').pfValue; + + rs.prevParentOpacity = op2; + + if( op1 !== op2 ){ + var descs = ele.descendants(); + + for( var j = 0; j < descs.length; j++ ){ + r.data.eleTxrCache.invalidateElement( descs[j] ); + } + } + } + } + } + + if( eles.length > 0 ){ + r.data.lyrTxrCache.invalidateElements( eles ); + } + }); +} + +CRp.redrawHint = function( group, bool ){ + var r = this; + + switch( group ){ + case 'eles': + r.data.canvasNeedsRedraw[ CRp.NODE ] = bool; + break; + case 'drag': + r.data.canvasNeedsRedraw[ CRp.DRAG ] = bool; + break; + case 'select': + r.data.canvasNeedsRedraw[ CRp.SELECT_BOX ] = bool; + break; + } +}; + +// whether to use Path2D caching for drawing +var pathsImpld = typeof Path2D !== 'undefined'; + +CRp.path2dEnabled = function( on ){ + if( on === undefined ){ + return this.pathsEnabled; + } + + this.pathsEnabled = on ? true : false; +}; + +CRp.usePaths = function(){ + return pathsImpld && this.pathsEnabled; +}; + +[ + require( './arrow-shapes' ), + require( './drawing-elements' ), + require( './drawing-edges' ), + require( './drawing-images' ), + require( './drawing-label-text' ), + require( './drawing-nodes' ), + require( './drawing-redraw' ), + require( './drawing-shapes' ), + require( './export-image' ), + require( './node-shapes' ) +].forEach( function( props ){ + util.extend( CRp, props ); +} ); + +module.exports = CR; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/layered-texture-cache.js b/node_modules/cytoscape/src/extensions/renderer/canvas/layered-texture-cache.js new file mode 100644 index 000000000..6d46b4075 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/canvas/layered-texture-cache.js @@ -0,0 +1,686 @@ +var util = require( '../../../util' ); +var math = require( '../../../math' ); +var Heap = require( '../../../heap' ); +var is = require( '../../../is' ); +var defs = require( './texture-cache-defs' ); + +var defNumLayers = 1; // default number of layers to use +var minLvl = -4; // when scaling smaller than that we don't need to re-render +var maxLvl = 2; // when larger than this scale just render directly (caching is not helpful) +var maxZoom = 3.99; // beyond this zoom level, layered textures are not used +var deqRedrawThreshold = 50; // time to batch redraws together from dequeueing to allow more dequeueing calcs to happen in the meanwhile +var refineEleDebounceTime = 50; // time to debounce sharper ele texture updates +var disableEleImgSmoothing = true; // when drawing eles on layers from an ele cache ; crisper and more performant when true +var deqCost = 0.15; // % of add'l rendering cost allowed for dequeuing ele caches each frame +var deqAvgCost = 0.1; // % of add'l rendering cost compared to average overall redraw time +var deqNoDrawCost = 0.9; // % of avg frame time that can be used for dequeueing when not drawing +var deqFastCost = 0.9; // % of frame time to be used when >60fps +var maxDeqSize = 1; // number of eles to dequeue and render at higher texture in each batch +var invalidThreshold = 250; // time threshold for disabling b/c of invalidations +var maxLayerArea = 4000 * 4000; // layers can't be bigger than this +var alwaysQueue = true; // never draw all the layers in a level on a frame; draw directly until all dequeued +var useHighQualityEleTxrReqs = true; // whether to use high quality ele txr requests (generally faster and cheaper in the longterm) + +var useEleTxrCaching = true; // whether to use individual ele texture caching underneath this cache + +// var log = function(){ console.log.apply( console, arguments ); }; + +var LayeredTextureCache = function( renderer, eleTxrCache ){ + var self = this; + + var r = self.renderer = renderer; + + self.layersByLevel = {}; // e.g. 2 => [ layer1, layer2, ..., layerN ] + + self.firstGet = true; + + self.lastInvalidationTime = util.performanceNow() - 2*invalidThreshold; + + self.skipping = false; + + r.beforeRender(function( willDraw, now ){ + if( now - self.lastInvalidationTime <= invalidThreshold ){ + self.skipping = true; + } else { + self.skipping = false; + } + }); + + var qSort = function(a, b){ + return b.reqs - a.reqs; + }; + + self.layersQueue = new Heap( qSort ); + + self.eleTxrCache = eleTxrCache; + + self.setupEleCacheInvalidation(); + + self.setupDequeueing(); +}; + +var LTCp = LayeredTextureCache.prototype; + +var layerIdPool = 0; +var MAX_INT = Math.pow(2, 53) - 1; + +LTCp.makeLayer = function( bb, lvl ){ + var scale = Math.pow( 2, lvl ); + + var w = Math.ceil( bb.w * scale ); + var h = Math.ceil( bb.h * scale ); + + var canvas = document.createElement('canvas'); // eslint-disable-line no-undef + + canvas.width = w; + canvas.height = h; + + var layer = { + id: (layerIdPool = ++layerIdPool % MAX_INT ), + bb: bb, + level: lvl, + width: w, + height: h, + canvas: canvas, + context: canvas.getContext('2d'), + eles: [], + elesQueue: [], + reqs: 0 + }; + + // log('make layer %s with w %s and h %s and lvl %s', layer.id, layer.width, layer.height, layer.level); + + var cxt = layer.context; + var dx = -layer.bb.x1; + var dy = -layer.bb.y1; + + // do the transform on creation to save cycles (it's the same for all eles) + cxt.scale( scale, scale ); + cxt.translate( dx, dy ); + + return layer; +}; + +LTCp.getLayers = function( eles, pxRatio, lvl ){ + var self = this; + var r = self.renderer; + var cy = r.cy; + var zoom = cy.zoom(); + var firstGet = self.firstGet; + + self.firstGet = false; + + // log('--\nget layers with %s eles', eles.length); + //log eles.map(function(ele){ return ele.id() }) ); + + if( lvl == null ){ + lvl = Math.ceil( math.log2( zoom * pxRatio ) ); + + if( lvl < minLvl ){ + lvl = minLvl; + } else if( zoom >= maxZoom || lvl > maxLvl ){ + return null; + } + } + + self.validateLayersElesOrdering( lvl, eles ); + + var layersByLvl = self.layersByLevel; + var scale = Math.pow( 2, lvl ); + var layers = layersByLvl[ lvl ] = layersByLvl[ lvl ] || []; + var bb; + + var lvlComplete = self.levelIsComplete( lvl, eles ); + var tmpLayers; + + var checkTempLevels = function(){ + var canUseAsTmpLvl = function( l ){ + self.validateLayersElesOrdering( l, eles ); + + if( self.levelIsComplete( l, eles ) ){ + tmpLayers = layersByLvl[l]; + return true; + } + }; + + var checkLvls = function( dir ){ + if( tmpLayers ){ return; } + + for( var l = lvl + dir; minLvl <= l && l <= maxLvl; l += dir ){ + if( canUseAsTmpLvl(l) ){ break; } + } + }; + + checkLvls( +1 ); + checkLvls( -1 ); + + // remove the invalid layers; they will be replaced as needed later in this function + for( var i = layers.length - 1; i >= 0; i-- ){ + var layer = layers[i]; + + if( layer.invalid ){ + util.removeFromArray( layers, layer ); + } + } + }; + + if( !lvlComplete ){ + // if the current level is incomplete, then use the closest, best quality layerset temporarily + // and later queue the current layerset so we can get the proper quality level soon + + checkTempLevels(); + + } else { + // log('level complete, using existing layers\n--'); + return layers; + } + + var getBb = function(){ + if( !bb ){ + bb = math.makeBoundingBox(); + + for( var i = 0; i < eles.length; i++ ){ + math.updateBoundingBox( bb, eles[i].boundingBox() ); + } + } + + return bb; + }; + + var makeLayer = function( opts ){ + opts = opts || {}; + + var after = opts.after; + + getBb(); + + var area = ( bb.w * scale ) * ( bb.h * scale ); + + if( area > maxLayerArea ){ + return null; + } + + var layer = self.makeLayer( bb, lvl ); + + if( after != null ){ + var index = layers.indexOf( after ) + 1; + + layers.splice( index, 0, layer ); + } else if( opts.insert === undefined || opts.insert ){ + // no after specified => first layer made so put at start + layers.unshift( layer ); + } + + // if( tmpLayers ){ + //self.queueLayer( layer ); + // } + + return layer; + }; + + if( self.skipping && !firstGet ){ + // log('skip layers'); + return null; + } + + // log('do layers'); + + var layer = null; + var maxElesPerLayer = eles.length / defNumLayers; + var allowLazyQueueing = alwaysQueue && !firstGet; + + for( var i = 0; i < eles.length; i++ ){ + var ele = eles[i]; + var rs = ele._private.rscratch; + var caches = rs.imgLayerCaches = rs.imgLayerCaches || {}; + + // log('look at ele', ele.id()); + + var existingLayer = caches[ lvl ]; + + if( existingLayer ){ + // reuse layer for later eles + // log('reuse layer for', ele.id()); + layer = existingLayer; + continue; + } + + if( + !layer + || layer.eles.length >= maxElesPerLayer + || !math.boundingBoxInBoundingBox( layer.bb, ele.boundingBox() ) + ){ + // log('make new layer for ele %s', ele.id()); + + layer = makeLayer({ insert: true, after: layer }); + + // if now layer can be built then we can't use layers at this level + if( !layer ){ return null; } + + // log('new layer with id %s', layer.id); + } + + if( tmpLayers || allowLazyQueueing ){ + // log('queue ele %s in layer %s', ele.id(), layer.id); + self.queueLayer( layer, ele ); + } else { + // log('draw ele %s in layer %s', ele.id(), layer.id); + self.drawEleInLayer( layer, ele, lvl, pxRatio ); + } + + layer.eles.push( ele ); + + caches[ lvl ] = layer; + } + + // log('--'); + + if( tmpLayers ){ // then we only queued the current layerset and can't draw it yet + return tmpLayers; + } + + if( allowLazyQueueing ){ + // log('lazy queue level', lvl); + return null; + } + + return layers; +}; + +// a layer may want to use an ele cache of a higher level to avoid blurriness +// so the layer level might not equal the ele level +LTCp.getEleLevelForLayerLevel = function( lvl, pxRatio ){ + return lvl; +}; + +function imgSmoothing( context, bool ){ + if( context.imageSmoothingEnabled != null ){ + context.imageSmoothingEnabled = bool; + } else { + context.webkitImageSmoothingEnabled = bool; + context.mozImageSmoothingEnabled = bool; + context.msImageSmoothingEnabled = bool; + } +} + +LTCp.drawEleInLayer = function( layer, ele, lvl, pxRatio ){ + var self = this; + var r = this.renderer; + var context = layer.context; + var bb = ele.boundingBox(); + + if( bb.w === 0 || bb.h === 0 || !ele.visible() ){ return; } + + var eleCache = self.eleTxrCache; + var reason = useHighQualityEleTxrReqs ? eleCache.reasons.highQuality : undefined; + + lvl = self.getEleLevelForLayerLevel( lvl, pxRatio ); + + var cache = useEleTxrCaching ? eleCache.getElement( ele, bb, null, lvl, reason ) : null; + + if( cache ){ + if( disableEleImgSmoothing ){ imgSmoothing( context, false ); } + + context.drawImage( cache.texture.canvas, cache.x, 0, cache.width, cache.height, bb.x1, bb.y1, bb.w, bb.h ); + + if( disableEleImgSmoothing ){ imgSmoothing( context, true ); } + } else { // if the element is not cacheable, then draw directly + r.drawElement( context, ele ); + } +}; + +LTCp.levelIsComplete = function( lvl, eles ){ + var self = this; + var layers = self.layersByLevel[ lvl ]; + + if( !layers || layers.length === 0 ){ return false; } + + var numElesInLayers = 0; + + for( var i = 0; i < layers.length; i++ ){ + var layer = layers[i]; + + // if there are any eles needed to be drawn yet, the level is not complete + if( layer.reqs > 0 ){ return false; } + + // if the layer is invalid, the level is not complete + if( layer.invalid ){ return false; } + + numElesInLayers += layer.eles.length; + } + + // we should have exactly the number of eles passed in to be complete + if( numElesInLayers !== eles.length ){ return false; } + + return true; +}; + +LTCp.validateLayersElesOrdering = function( lvl, eles ){ + var layers = this.layersByLevel[ lvl ]; + + if( !layers ){ return; } + + // if in a layer the eles are not in the same order, then the layer is invalid + // (i.e. there is an ele in between the eles in the layer) + + for( var i = 0; i < layers.length; i++ ){ + var layer = layers[i]; + var offset = -1; + + // find the offset + for( var j = 0; j < eles.length; j++ ){ + if( layer.eles[0] === eles[j] ){ + offset = j; + break; + } + } + + if( offset < 0 ){ + // then the layer has nonexistant elements and is invalid + this.invalidateLayer( layer ); + continue; + } + + // the eles in the layer must be in the same continuous order, else the layer is invalid + + var o = offset; + + for( var j = 0; j < layer.eles.length; j++ ){ + if( layer.eles[j] !== eles[o+j] ){ + // log('invalidate based on ordering', layer.id); + + this.invalidateLayer( layer ); + break; + } + } + } +}; + +LTCp.updateElementsInLayers = function( eles, update ){ + var self = this; + var isEles = is.element( eles[0] ); + + // collect udpated elements (cascaded from the layers) and update each + // layer itself along the way + for( var i = 0; i < eles.length; i++ ){ + var req = isEles ? null : eles[i]; + var ele = isEles ? eles[i] : eles[i].ele; + var rs = ele._private.rscratch; + var caches = rs.imgLayerCaches = rs.imgLayerCaches || {}; + + for( var l = minLvl; l <= maxLvl; l++ ){ + var layer = caches[l]; + + if( !layer ){ continue; } + + // if update is a request from the ele cache, then it affects only + // the matching level + if( req && self.getEleLevelForLayerLevel( layer.level ) !== req.level ){ + continue; + } + + update( layer, ele, req ); + } + } +}; + +LTCp.haveLayers = function(){ + var self = this; + var haveLayers = false; + + for( var l = minLvl; l <= maxLvl; l++ ){ + var layers = self.layersByLevel[l]; + + if( layers && layers.length > 0 ){ + haveLayers = true; + break; + } + } + + return haveLayers; +}; + +LTCp.invalidateElements = function( eles ){ + var self = this; + + self.lastInvalidationTime = util.performanceNow(); + + // log('update invalidate layer time from eles'); + + if( eles.length === 0 || !self.haveLayers() ){ return; } + + self.updateElementsInLayers( eles, function invalAssocLayers( layer, ele, req ){ + self.invalidateLayer( layer ); + } ); +}; + +LTCp.invalidateLayer = function( layer ){ + // log('update invalidate layer time'); + + this.lastInvalidationTime = util.performanceNow(); + + if( layer.invalid ){ return; } // save cycles + + var lvl = layer.level; + var eles = layer.eles; + var layers = this.layersByLevel[ lvl ]; + + // log('invalidate layer', layer.id ); + + util.removeFromArray( layers, layer ); + // layer.eles = []; + + layer.elesQueue = []; + + layer.invalid = true; + + if( layer.replacement ){ + layer.replacement.invalid = true; + } + + for( var i = 0; i < eles.length; i++ ){ + var caches = eles[i]._private.rscratch.imgLayerCaches; + + if( caches ){ + caches[ lvl ] = null; + } + } +}; + +LTCp.refineElementTextures = function( eles ){ + var self = this; + + // log('refine', eles.length); + + self.updateElementsInLayers( eles, function refineEachEle( layer, ele, req ){ + var rLyr = layer.replacement; + + if( !rLyr ){ + rLyr = layer.replacement = self.makeLayer( layer.bb, layer.level ); + rLyr.replaces = layer; + rLyr.eles = layer.eles; + + // log('make replacement layer %s for %s with level %s', rLyr.id, layer.id, rLyr.level); + } + + if( !rLyr.reqs ){ + for( var i = 0; i < rLyr.eles.length; i++ ){ + self.queueLayer( rLyr, rLyr.eles[i] ); + } + + // log('queue replacement layer refinement', rLyr.id); + } + } ); +}; + +LTCp.setupEleCacheInvalidation = function(){ + var self = this; + var eleDeqs = []; + + if( !useEleTxrCaching ){ return; } + + var updatedElesInLayers = util.debounce( function(){ + self.refineElementTextures( eleDeqs ); + + eleDeqs = []; + }, refineEleDebounceTime ); + + self.eleTxrCache.onDequeue(function( reqs ){ + for( var i = 0; i < reqs.length; i++ ){ + eleDeqs.push( reqs[i] ); + } + + updatedElesInLayers(); + }); +}; + +LTCp.queueLayer = function( layer, ele ){ + var self = this; + var q = self.layersQueue; + var elesQ = layer.elesQueue; + var hasId = elesQ.hasId = elesQ.hasId || {}; + + // if a layer is going to be replaced, queuing is a waste of time + if( layer.replacement ){ return; } + + if( ele ){ + if( hasId[ ele.id() ] ){ + return; + } + + elesQ.push( ele ); + hasId[ ele.id() ] = true; + } + + if( layer.reqs ){ + layer.reqs++; + + q.updateItem( layer ); + } else { + layer.reqs = 1; + + q.push( layer ); + } +}; + +LTCp.dequeue = function( pxRatio ){ + var self = this; + var q = self.layersQueue; + var deqd = []; + var eleDeqs = 0; + + while( eleDeqs < maxDeqSize ){ + if( q.size() === 0 ){ break; } + + var layer = q.peek(); + + // if a layer has been or will be replaced, then don't waste time with it + if( layer.replacement ){ + // log('layer %s in queue skipped b/c it already has a replacement', layer.id); + q.pop(); + continue; + } + + // if this is a replacement layer that has been superceded, then forget it + if( layer.replaces && layer !== layer.replaces.replacement ){ + // log('layer is no longer the most uptodate replacement; dequeued', layer.id) + q.pop(); + continue; + } + + if( layer.invalid ){ + // log('replacement layer %s is invalid; dequeued', layer.id); + q.pop(); + continue; + } + + var ele = layer.elesQueue.shift(); + + if( ele ){ + // log('dequeue layer %s', layer.id); + + self.drawEleInLayer( layer, ele, layer.level, pxRatio ); + + eleDeqs++; + } + + if( deqd.length === 0 ){ + // we need only one entry in deqd to queue redrawing etc + deqd.push( true ); + } + + // if the layer has all its eles done, then remove from the queue + if( layer.elesQueue.length === 0 ){ + q.pop(); + + layer.reqs = 0; + + // log('dequeue of layer %s complete', layer.id); + + // when a replacement layer is dequeued, it replaces the old layer in the level + if( layer.replaces ){ + self.applyLayerReplacement( layer ); + } + + self.requestRedraw(); + } + } + + return deqd; +}; + +LTCp.applyLayerReplacement = function( layer ){ + var self = this; + var layersInLevel = self.layersByLevel[ layer.level ]; + var replaced = layer.replaces; + var index = layersInLevel.indexOf( replaced ); + + // if the replaced layer is not in the active list for the level, then replacing + // refs would be a mistake (i.e. overwriting the true active layer) + if( index < 0 || replaced.invalid ){ + // log('replacement layer would have no effect', layer.id); + return; + } + + layersInLevel[ index ] = layer; // replace level ref + + // replace refs in eles + for( var i = 0; i < layer.eles.length; i++ ){ + var _p = layer.eles[i]._private; + var cache = _p.imgLayerCaches = _p.imgLayerCaches || {}; + + if( cache ){ + cache[ layer.level ] = layer; + } + } + + // log('apply replacement layer %s over %s', layer.id, replaced.id); + + self.requestRedraw(); +}; + +LTCp.requestRedraw = util.debounce( function(){ + var r = this.renderer; + + r.redrawHint( 'eles', true ); + r.redrawHint( 'drag', true ); + r.redraw(); +}, 100 ); + +LTCp.setupDequeueing = defs.setupDequeueing({ + deqRedrawThreshold: deqRedrawThreshold, + deqCost: deqCost, + deqAvgCost: deqAvgCost, + deqNoDrawCost: deqNoDrawCost, + deqFastCost: deqFastCost, + deq: function( self, pxRatio ){ + return self.dequeue( pxRatio ); + }, + onDeqd: util.noop, + shouldRedraw: util.trueify, + priority: function( self ){ + return self.renderer.beforeRenderPriorities.lyrTxrDeq; + } +}); + +module.exports = LayeredTextureCache; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/node-shapes.js b/node_modules/cytoscape/src/extensions/renderer/canvas/node-shapes.js new file mode 100644 index 000000000..e23fbfd2e --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/canvas/node-shapes.js @@ -0,0 +1,20 @@ +var CRp = {}; + +CRp.nodeShapeImpl = function( name, context, centerX, centerY, width, height, points ){ + switch( name ){ + case 'ellipse': + return this.drawEllipsePath( context, centerX, centerY, width, height ); + case 'polygon': + return this.drawPolygonPath( context, centerX, centerY, width, height, points ); + case 'roundrectangle': + return this.drawRoundRectanglePath( context, centerX, centerY, width, height ); + case 'cutrectangle': + return this.drawCutRectanglePath( context, centerX, centerY, width, height ); + case 'bottomroundrectangle': + return this.drawBottomRoundRectanglePath( context, centerX, centerY, width, height ); + case 'barrel': + return this.drawBarrelPath( context, centerX, centerY, width, height ); + } +}; + +module.exports = CRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/texture-cache-defs.js b/node_modules/cytoscape/src/extensions/renderer/canvas/texture-cache-defs.js new file mode 100644 index 000000000..aa0564648 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/canvas/texture-cache-defs.js @@ -0,0 +1,85 @@ +var util = require( '../../../util' ); + +var fullFpsTime = 1000/60; // assume 60 frames per second + +module.exports = { + setupDequeueing: function( opts ){ + return function setupDequeueingImpl(){ + var self = this; + var r = this.renderer; + + if( self.dequeueingSetup ){ + return; + } else { + self.dequeueingSetup = true; + } + + var queueRedraw = util.debounce( function(){ + r.redrawHint( 'eles', true ); + r.redrawHint( 'drag', true ); + + r.redraw(); + }, opts.deqRedrawThreshold ); + + var dequeue = function( willDraw, frameStartTime ){ + var startTime = util.performanceNow(); + var avgRenderTime = r.averageRedrawTime; + var renderTime = r.lastRedrawTime; + var deqd = []; + var extent = r.cy.extent(); + var pixelRatio = r.getPixelRatio(); + + while( true ){ + var now = util.performanceNow(); + var duration = now - startTime; + var frameDuration = now - frameStartTime; + + if( renderTime < fullFpsTime ){ + // if we're rendering faster than the ideal fps, then do dequeueing + // during all of the remaining frame time + + var timeAvailable = fullFpsTime - ( willDraw ? avgRenderTime : 0 ); + + if( frameDuration >= opts.deqFastCost * timeAvailable ){ + break; + } + } else { + if( willDraw ){ + if( + duration >= opts.deqCost * renderTime + || duration >= opts.deqAvgCost * avgRenderTime + ){ + break; + } + } else if( frameDuration >= opts.deqNoDrawCost * fullFpsTime ){ + break; + } + } + + var thisDeqd = opts.deq( self, pixelRatio, extent ); + + if( thisDeqd.length > 0 ){ + for( var i = 0; i < thisDeqd.length; i++ ){ + deqd.push( thisDeqd[i] ); + } + } else { + break; + } + } + + // callbacks on dequeue + if( deqd.length > 0 ){ + opts.onDeqd( self, deqd ); + + if( !willDraw && opts.shouldRedraw( self, deqd, pixelRatio, extent ) ){ + queueRedraw(); + } + } + }; + + var priority = opts.priority || util.noop; + + r.beforeRender( dequeue, priority( self ) ); + }; + } +}; diff --git a/node_modules/cytoscape/src/extensions/renderer/index.js b/node_modules/cytoscape/src/extensions/renderer/index.js new file mode 100644 index 000000000..9bdbe08b9 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/index.js @@ -0,0 +1,5 @@ +module.exports = [ + { name: 'null', impl: require( './null' ) }, + { name: 'base', impl: require( './base' ) }, + { name: 'canvas', impl: require( './canvas' ) } +]; diff --git a/node_modules/cytoscape/src/extensions/renderer/null/index.js b/node_modules/cytoscape/src/extensions/renderer/null/index.js new file mode 100644 index 000000000..6305e8168 --- /dev/null +++ b/node_modules/cytoscape/src/extensions/renderer/null/index.js @@ -0,0 +1,14 @@ +function NullRenderer( options ){ + this.options = options; + this.notifications = 0; // for testing +} + +let noop = function(){}; + +NullRenderer.prototype = { + recalculateRenderedStyle: noop, + notify: function(){ this.notifications++; }, + init: noop +}; + +module.exports = NullRenderer; diff --git a/node_modules/cytoscape/src/heap.js b/node_modules/cytoscape/src/heap.js new file mode 100644 index 000000000..f71231bba --- /dev/null +++ b/node_modules/cytoscape/src/heap.js @@ -0,0 +1 @@ +module.exports = require('heap'); diff --git a/node_modules/cytoscape/src/index.js b/node_modules/cytoscape/src/index.js new file mode 100644 index 000000000..89e5449a6 --- /dev/null +++ b/node_modules/cytoscape/src/index.js @@ -0,0 +1,40 @@ +let is = require( './is' ); +let Core = require( './core' ); +let extension = require( './extension' ); +let Stylesheet = require( './stylesheet' ); + +let cytoscape = function( options ){ // jshint ignore:line + // if no options specified, use default + if( options === undefined ){ + options = {}; + } + + // create instance + if( is.plainObject( options ) ){ + return new Core( options ); + } + + // allow for registration of extensions + else if( is.string( options ) ){ + return extension.apply( extension, arguments ); + } +}; + +// e.g. cytoscape.use( require('cytoscape-foo'), bar ) +cytoscape.use = function( ext ){ + let args = Array.prototype.slice.call( arguments, 1 ); // args to pass to ext + + args.unshift( cytoscape ); // cytoscape is first arg to ext + + ext.apply( null, args ); + + return this; +}; + +// replaced by build system +cytoscape.version = require('./version'); + +// expose public apis (mostly for extensions) +cytoscape.stylesheet = cytoscape.Stylesheet = Stylesheet; + +module.exports = cytoscape; diff --git a/node_modules/cytoscape/src/is.js b/node_modules/cytoscape/src/is.js new file mode 100644 index 000000000..9a2bfdc9f --- /dev/null +++ b/node_modules/cytoscape/src/is.js @@ -0,0 +1,179 @@ +/*global HTMLElement DocumentTouch */ + +let window = require( './window' ); +let navigator = window ? window.navigator : null; +let document = window ? window.document : null; + +let typeofstr = typeof ''; +let typeofobj = typeof {}; +let typeoffn = typeof function(){}; +let typeofhtmlele = typeof HTMLElement; + +let instanceStr = function( obj ){ + return obj && obj.instanceString && is.fn( obj.instanceString ) ? obj.instanceString() : null; +}; + +let is = { + defined: function( obj ){ + return obj != null; // not undefined or null + }, + + string: function( obj ){ + return obj != null && typeof obj == typeofstr; + }, + + fn: function( obj ){ + return obj != null && typeof obj === typeoffn; + }, + + array: function( obj ){ + return Array.isArray ? Array.isArray( obj ) : obj != null && obj instanceof Array; + }, + + plainObject: function( obj ){ + return obj != null && typeof obj === typeofobj && !is.array( obj ) && obj.constructor === Object; + }, + + object: function( obj ){ + return obj != null && typeof obj === typeofobj; + }, + + number: function( obj ){ + return obj != null && typeof obj === typeof 1 && !isNaN( obj ); + }, + + integer: function( obj ){ + return is.number( obj ) && Math.floor( obj ) === obj; + }, + + bool: function( obj ){ + return obj != null && typeof obj === typeof true; + }, + + htmlElement: function( obj ){ + if( 'undefined' === typeofhtmlele ){ + return undefined; + } else { + return null != obj && obj instanceof HTMLElement; + } + }, + + elementOrCollection: function( obj ){ + return is.element( obj ) || is.collection( obj ); + }, + + element: function( obj ){ + return instanceStr( obj ) === 'collection' && obj._private.single; + }, + + collection: function( obj ){ + return instanceStr( obj ) === 'collection' && !obj._private.single; + }, + + core: function( obj ){ + return instanceStr( obj ) === 'core'; + }, + + style: function( obj ){ + return instanceStr( obj ) === 'style'; + }, + + stylesheet: function( obj ){ + return instanceStr( obj ) === 'stylesheet'; + }, + + event: function( obj ){ + return instanceStr( obj ) === 'event'; + }, + + thread: function( obj ){ + return instanceStr( obj ) === 'thread'; + }, + + fabric: function( obj ){ + return instanceStr( obj ) === 'fabric'; + }, + + emptyString: function( obj ){ + if( obj === undefined || obj === null ){ // null is empty + return true; + } else if( obj === '' || obj.match( /^\s+$/ ) ){ + return true; // empty string is empty + } + + return false; // otherwise, we don't know what we've got + }, + + nonemptyString: function( obj ){ + if( obj && is.string( obj ) && obj !== '' && !obj.match( /^\s+$/ ) ){ + return true; + } + + return false; + }, + + domElement: function( obj ){ + if( typeof HTMLElement === 'undefined' ){ + return false; // we're not in a browser so it doesn't matter + } else { + return obj instanceof HTMLElement; + } + }, + + boundingBox: function( obj ){ + return is.plainObject( obj ) && + is.number( obj.x1 ) && is.number( obj.x2 ) && + is.number( obj.y1 ) && is.number( obj.y2 ) + ; + }, + + promise: function( obj ){ + return is.object( obj ) && is.fn( obj.then ); + }, + + touch: function(){ + return window && ( ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch ); + }, + + gecko: function(){ + return window && ( typeof InstallTrigger !== 'undefined' || ('MozAppearance' in document.documentElement.style) ); + }, + + webkit: function(){ + return window && ( typeof webkitURL !== 'undefined' || ('WebkitAppearance' in document.documentElement.style) ); + }, + + chromium: function(){ + return window && ( typeof chrome !== 'undefined' ); + }, + + khtml: function(){ + return navigator && navigator.vendor.match( /kde/i ); // probably a better way to detect this... + }, + + khtmlEtc: function(){ + return is.khtml() || is.webkit() || is.chromium(); + }, + + ms: function(){ + return navigator && navigator.userAgent.match( /msie|trident|edge/i ); // probably a better way to detect this... + }, + + windows: function(){ + return navigator && navigator.appVersion.match( /Win/i ); + }, + + mac: function(){ + return navigator && navigator.appVersion.match( /Mac/i ); + }, + + linux: function(){ + return navigator && navigator.appVersion.match( /Linux/i ); + }, + + unix: function(){ + return navigator && navigator.appVersion.match( /X11/i ); + } +}; + +module.exports = is; diff --git a/node_modules/cytoscape/src/map.js b/node_modules/cytoscape/src/map.js new file mode 100644 index 000000000..2693c8fa8 --- /dev/null +++ b/node_modules/cytoscape/src/map.js @@ -0,0 +1,25 @@ +function ObjectMap(){ + this._obj = {}; +} + +let p = ObjectMap.prototype; + +p.set = function( key, val ){ + this._obj[ key ] = val; +}; + +p.delete = function( key ){ + this._obj[ key ] = null; +}; + +p.has = function( key ){ + return this._obj[ key ] != null; +}; + +p.get = function( key ){ + return this._obj[ key ]; +}; + +// TODO use the stdlib Map in future... +// module.exports = typeof Map !== 'undefined' ? Map : ObjectMap; +module.exports = ObjectMap; diff --git a/node_modules/cytoscape/src/math.js b/node_modules/cytoscape/src/math.js new file mode 100644 index 000000000..51a758c2f --- /dev/null +++ b/node_modules/cytoscape/src/math.js @@ -0,0 +1,1109 @@ +let math = {}; + +math.arePositionsSame = function( p1, p2 ){ + return p1.x === p2.x && p1.y === p2.y; +}; + +math.copyPosition = function( p ){ + return { x: p.x, y: p.y }; +}; + +math.modelToRenderedPosition = function( p, zoom, pan ){ + return { + x: p.x * zoom + pan.x, + y: p.y * zoom + pan.y + }; +}; + +math.renderedToModelPosition = function( p, zoom, pan ){ + return { + x: ( p.x - pan.x ) / zoom, + y: ( p.y - pan.y ) / zoom + }; +}; + +math.array2point = function( arr ){ + return { + x: arr[0], + y: arr[1] + }; +}; + +math.deg2rad = function( deg ){ + return Math.PI * deg / 180; +}; + +math.getAngleFromDisp = function( dispX, dispY ){ + return Math.atan2( dispY, dispX ) - Math.PI / 2; +}; + +math.log2 = Math.log2 || function( n ){ + return Math.log( n ) / Math.log( 2 ); +}; + +math.signum = function( x ){ + if( x > 0 ){ + return 1; + } else if( x < 0 ){ + return -1; + } else { + return 0; + } +}; + +math.dist = function( p1, p2 ){ + return Math.sqrt( math.sqdist( p1, p2 ) ); +}; + +math.sqdist = function( p1, p2 ){ + let dx = p2.x - p1.x; + let dy = p2.y - p1.y; + + return dx * dx + dy * dy; +}; + +// from http://en.wikipedia.org/wiki/Bézier_curve#Quadratic_curves +math.qbezierAt = function( p0, p1, p2, t ){ + return (1 - t) * (1 - t) * p0 + 2 * (1 - t) * t * p1 + t * t * p2; +}; + +math.qbezierPtAt = function( p0, p1, p2, t ){ + return { + x: math.qbezierAt( p0.x, p1.x, p2.x, t ), + y: math.qbezierAt( p0.y, p1.y, p2.y, t ) + }; +}; + +math.lineAt = function( p0, p1, t, d ){ + let vec = { + x: p1.x - p0.x, + y: p1.y - p0.y + }; + + let vecDist = math.dist( p0, p1 ); + + let normVec = { + x: vec.x / vecDist, + y: vec.y / vecDist + }; + + t = t == null ? 0 : t; + + d = d != null ? d : t * vecDist; + + return { + x: p0.x + normVec.x * d, + y: p0.y + normVec.y * d + }; +}; + +math.lineAtDist = function( p0, p1, d ){ + return math.lineAt( p0, p1, undefined, d ); +}; + +// get angle at A via cosine law +math.triangleAngle = function( A, B, C ){ + let a = math.dist( B, C ); + let b = math.dist( A, C ); + let c = math.dist( A, B ); + + return Math.acos( (a*a + b*b - c*c)/(2*a*b) ); +}; + +math.bound = function( min, val, max ){ + return Math.max( min, Math.min( max, val ) ); +}; + +// makes a full bb (x1, y1, x2, y2, w, h) from implicit params +math.makeBoundingBox = function( bb ){ + if( bb == null ){ + return { + x1: Infinity, + y1: Infinity, + x2: -Infinity, + y2: -Infinity, + w: 0, + h: 0 + }; + } else if( bb.x1 != null && bb.y1 != null ){ + if( bb.x2 != null && bb.y2 != null && bb.x2 >= bb.x1 && bb.y2 >= bb.y1 ){ + return { + x1: bb.x1, + y1: bb.y1, + x2: bb.x2, + y2: bb.y2, + w: bb.x2 - bb.x1, + h: bb.y2 - bb.y1 + }; + } else if( bb.w != null && bb.h != null && bb.w >= 0 && bb.h >= 0 ){ + return { + x1: bb.x1, + y1: bb.y1, + x2: bb.x1 + bb.w, + y2: bb.y1 + bb.h, + w: bb.w, + h: bb.h + }; + } + } +}; + +math.updateBoundingBox = function( bb1, bb2 ){ + // update bb1 with bb2 bounds + + bb1.x1 = Math.min( bb1.x1, bb2.x1 ); + bb1.x2 = Math.max( bb1.x2, bb2.x2 ); + bb1.w = bb1.x2 - bb1.x1; + + bb1.y1 = Math.min( bb1.y1, bb2.y1 ); + bb1.y2 = Math.max( bb1.y2, bb2.y2 ); + bb1.h = bb1.y2 - bb1.y1; +}; + +math.expandBoundingBoxByPoint = function( bb, x, y ){ + bb.x1 = Math.min( bb.x1, x ); + bb.x2 = Math.max( bb.x2, x ); + bb.w = bb.x2 - bb.x1; + + bb.y1 = Math.min( bb.y1, y ); + bb.y2 = Math.max( bb.y2, y ); + bb.h = bb.y2 - bb.y1; +}; + +math.expandBoundingBox = function( bb, padding ){ + bb.x1 -= padding; + bb.x2 += padding; + bb.y1 -= padding; + bb.y2 += padding; + bb.w = bb.x2 - bb.x1; + bb.h = bb.y2 - bb.y1; + + return bb; +}; + +math.boundingBoxesIntersect = function( bb1, bb2 ){ + // case: one bb to right of other + if( bb1.x1 > bb2.x2 ){ return false; } + if( bb2.x1 > bb1.x2 ){ return false; } + + // case: one bb to left of other + if( bb1.x2 < bb2.x1 ){ return false; } + if( bb2.x2 < bb1.x1 ){ return false; } + + // case: one bb above other + if( bb1.y2 < bb2.y1 ){ return false; } + if( bb2.y2 < bb1.y1 ){ return false; } + + // case: one bb below other + if( bb1.y1 > bb2.y2 ){ return false; } + if( bb2.y1 > bb1.y2 ){ return false; } + + // otherwise, must have some overlap + return true; +}; + +math.inBoundingBox = function( bb, x, y ){ + return bb.x1 <= x && x <= bb.x2 && bb.y1 <= y && y <= bb.y2; +}; + +math.pointInBoundingBox = function( bb, pt ){ + return this.inBoundingBox( bb, pt.x, pt.y ); +}; + +math.boundingBoxInBoundingBox = function( bb1, bb2 ){ + return ( + math.inBoundingBox( bb1, bb2.x1, bb2.y1 ) + && math.inBoundingBox( bb1, bb2.x2, bb2.y2 ) + ); +}; + +math.roundRectangleIntersectLine = function( + x, y, nodeX, nodeY, width, height, padding ){ + + let cornerRadius = this.getRoundRectangleRadius( width, height ); + + let halfWidth = width / 2; + let halfHeight = height / 2; + + // Check intersections with straight line segments + let straightLineIntersections; + + // Top segment, left to right + { + let topStartX = nodeX - halfWidth + cornerRadius - padding; + let topStartY = nodeY - halfHeight - padding; + let topEndX = nodeX + halfWidth - cornerRadius + padding; + let topEndY = topStartY; + + straightLineIntersections = this.finiteLinesIntersect( + x, y, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false ); + + if( straightLineIntersections.length > 0 ){ + return straightLineIntersections; + } + } + + // Right segment, top to bottom + { + let rightStartX = nodeX + halfWidth + padding; + let rightStartY = nodeY - halfHeight + cornerRadius - padding; + let rightEndX = rightStartX; + let rightEndY = nodeY + halfHeight - cornerRadius + padding; + + straightLineIntersections = this.finiteLinesIntersect( + x, y, nodeX, nodeY, rightStartX, rightStartY, rightEndX, rightEndY, false ); + + if( straightLineIntersections.length > 0 ){ + return straightLineIntersections; + } + } + + // Bottom segment, left to right + { + let bottomStartX = nodeX - halfWidth + cornerRadius - padding; + let bottomStartY = nodeY + halfHeight + padding; + let bottomEndX = nodeX + halfWidth - cornerRadius + padding; + let bottomEndY = bottomStartY; + + straightLineIntersections = this.finiteLinesIntersect( + x, y, nodeX, nodeY, bottomStartX, bottomStartY, bottomEndX, bottomEndY, false ); + + if( straightLineIntersections.length > 0 ){ + return straightLineIntersections; + } + } + + // Left segment, top to bottom + { + let leftStartX = nodeX - halfWidth - padding; + let leftStartY = nodeY - halfHeight + cornerRadius - padding; + let leftEndX = leftStartX; + let leftEndY = nodeY + halfHeight - cornerRadius + padding; + + straightLineIntersections = this.finiteLinesIntersect( + x, y, nodeX, nodeY, leftStartX, leftStartY, leftEndX, leftEndY, false ); + + if( straightLineIntersections.length > 0 ){ + return straightLineIntersections; + } + } + + // Check intersections with arc segments + let arcIntersections; + + // Top Left + { + let topLeftCenterX = nodeX - halfWidth + cornerRadius; + let topLeftCenterY = nodeY - halfHeight + cornerRadius; + arcIntersections = this.intersectLineCircle( + x, y, nodeX, nodeY, + topLeftCenterX, topLeftCenterY, cornerRadius + padding ); + + // Ensure the intersection is on the desired quarter of the circle + if( arcIntersections.length > 0 + && arcIntersections[0] <= topLeftCenterX + && arcIntersections[1] <= topLeftCenterY ){ + return [ arcIntersections[0], arcIntersections[1] ]; + } + } + + // Top Right + { + let topRightCenterX = nodeX + halfWidth - cornerRadius; + let topRightCenterY = nodeY - halfHeight + cornerRadius; + arcIntersections = this.intersectLineCircle( + x, y, nodeX, nodeY, + topRightCenterX, topRightCenterY, cornerRadius + padding ); + + // Ensure the intersection is on the desired quarter of the circle + if( arcIntersections.length > 0 + && arcIntersections[0] >= topRightCenterX + && arcIntersections[1] <= topRightCenterY ){ + return [ arcIntersections[0], arcIntersections[1] ]; + } + } + + // Bottom Right + { + let bottomRightCenterX = nodeX + halfWidth - cornerRadius; + let bottomRightCenterY = nodeY + halfHeight - cornerRadius; + arcIntersections = this.intersectLineCircle( + x, y, nodeX, nodeY, + bottomRightCenterX, bottomRightCenterY, cornerRadius + padding ); + + // Ensure the intersection is on the desired quarter of the circle + if( arcIntersections.length > 0 + && arcIntersections[0] >= bottomRightCenterX + && arcIntersections[1] >= bottomRightCenterY ){ + return [ arcIntersections[0], arcIntersections[1] ]; + } + } + + // Bottom Left + { + let bottomLeftCenterX = nodeX - halfWidth + cornerRadius; + let bottomLeftCenterY = nodeY + halfHeight - cornerRadius; + arcIntersections = this.intersectLineCircle( + x, y, nodeX, nodeY, + bottomLeftCenterX, bottomLeftCenterY, cornerRadius + padding ); + + // Ensure the intersection is on the desired quarter of the circle + if( arcIntersections.length > 0 + && arcIntersections[0] <= bottomLeftCenterX + && arcIntersections[1] >= bottomLeftCenterY ){ + return [ arcIntersections[0], arcIntersections[1] ]; + } + } + + return []; // if nothing +}; + +math.inLineVicinity = function( x, y, lx1, ly1, lx2, ly2, tolerance ){ + let t = tolerance; + + let x1 = Math.min( lx1, lx2 ); + let x2 = Math.max( lx1, lx2 ); + let y1 = Math.min( ly1, ly2 ); + let y2 = Math.max( ly1, ly2 ); + + return x1 - t <= x && x <= x2 + t + && y1 - t <= y && y <= y2 + t; +}; + +math.inBezierVicinity = function( + x, y, x1, y1, x2, y2, x3, y3, tolerance ){ + + let bb = { + x1: Math.min( x1, x3, x2 ) - tolerance, + x2: Math.max( x1, x3, x2 ) + tolerance, + y1: Math.min( y1, y3, y2 ) - tolerance, + y2: Math.max( y1, y3, y2 ) + tolerance + }; + + // if outside the rough bounding box for the bezier, then it can't be a hit + if( x < bb.x1 || x > bb.x2 || y < bb.y1 || y > bb.y2 ){ + // console.log('bezier out of rough bb') + return false; + } else { + // console.log('do more expensive check'); + return true; + } + +}; +math.solveQuadratic = function( a, b, c, val ){ + c -= val; + + var r = b * b - 4 * a * c; + + if( r < 0 ){ return []; } + + var sqrtR = Math.sqrt( r ); + var denom = 2 * a; + var root1 = ( -b + sqrtR ) / denom; + var root2 = ( -b - sqrtR ) / denom; + + return [ root1, root2 ]; +}; + +math.solveCubic = function( a, b, c, d, result ){ + + // Solves a cubic function, returns root in form [r1, i1, r2, i2, r3, i3], where + // r is the real component, i is the imaginary component + + // An implementation of the Cardano method from the year 1545 + // http://en.wikipedia.org/wiki/Cubic_function#The_nature_of_the_roots + + b /= a; + c /= a; + d /= a; + + let discriminant, q, r, dum1, s, t, term1, r13; + + q = (3.0 * c - (b * b)) / 9.0; + r = -(27.0 * d) + b * (9.0 * c - 2.0 * (b * b)); + r /= 54.0; + + discriminant = q * q * q + r * r; + result[1] = 0; + term1 = (b / 3.0); + + if( discriminant > 0 ){ + s = r + Math.sqrt( discriminant ); + s = ((s < 0) ? -Math.pow( -s, (1.0 / 3.0) ) : Math.pow( s, (1.0 / 3.0) )); + t = r - Math.sqrt( discriminant ); + t = ((t < 0) ? -Math.pow( -t, (1.0 / 3.0) ) : Math.pow( t, (1.0 / 3.0) )); + result[0] = -term1 + s + t; + term1 += (s + t) / 2.0; + result[4] = result[2] = -term1; + term1 = Math.sqrt( 3.0 ) * (-t + s) / 2; + result[3] = term1; + result[5] = -term1; + return; + } + + result[5] = result[3] = 0; + + if( discriminant === 0 ){ + r13 = ((r < 0) ? -Math.pow( -r, (1.0 / 3.0) ) : Math.pow( r, (1.0 / 3.0) )); + result[0] = -term1 + 2.0 * r13; + result[4] = result[2] = -(r13 + term1); + return; + } + + q = -q; + dum1 = q * q * q; + dum1 = Math.acos( r / Math.sqrt( dum1 ) ); + r13 = 2.0 * Math.sqrt( q ); + result[0] = -term1 + r13 * Math.cos( dum1 / 3.0 ); + result[2] = -term1 + r13 * Math.cos( (dum1 + 2.0 * Math.PI) / 3.0 ); + result[4] = -term1 + r13 * Math.cos( (dum1 + 4.0 * Math.PI) / 3.0 ); + + return; +}; + +math.sqdistToQuadraticBezier = function( + x, y, x1, y1, x2, y2, x3, y3 ){ + + // Find minimum distance by using the minimum of the distance + // function between the given point and the curve + + // This gives the coefficients of the resulting cubic equation + // whose roots tell us where a possible minimum is + // (Coefficients are divided by 4) + + let a = 1.0 * x1 * x1 - 4 * x1 * x2 + 2 * x1 * x3 + 4 * x2 * x2 - 4 * x2 * x3 + x3 * x3 + + y1 * y1 - 4 * y1 * y2 + 2 * y1 * y3 + 4 * y2 * y2 - 4 * y2 * y3 + y3 * y3; + + let b = 1.0 * 9 * x1 * x2 - 3 * x1 * x1 - 3 * x1 * x3 - 6 * x2 * x2 + 3 * x2 * x3 + + 9 * y1 * y2 - 3 * y1 * y1 - 3 * y1 * y3 - 6 * y2 * y2 + 3 * y2 * y3; + + let c = 1.0 * 3 * x1 * x1 - 6 * x1 * x2 + x1 * x3 - x1 * x + 2 * x2 * x2 + 2 * x2 * x - x3 * x + + 3 * y1 * y1 - 6 * y1 * y2 + y1 * y3 - y1 * y + 2 * y2 * y2 + 2 * y2 * y - y3 * y; + + let d = 1.0 * x1 * x2 - x1 * x1 + x1 * x - x2 * x + + y1 * y2 - y1 * y1 + y1 * y - y2 * y; + + // debug("coefficients: " + a / a + ", " + b / a + ", " + c / a + ", " + d / a); + + let roots = []; + + // Use the cubic solving algorithm + this.solveCubic( a, b, c, d, roots ); + + let zeroThreshold = 0.0000001; + + let params = []; + + for( let index = 0; index < 6; index += 2 ){ + if( Math.abs( roots[ index + 1] ) < zeroThreshold + && roots[ index ] >= 0 + && roots[ index ] <= 1.0 ){ + params.push( roots[ index ] ); + } + } + + params.push( 1.0 ); + params.push( 0.0 ); + + let minDistanceSquared = -1; + + let curX, curY, distSquared; + for( let i = 0; i < params.length; i++ ){ + curX = Math.pow( 1.0 - params[ i ], 2.0 ) * x1 + + 2.0 * (1 - params[ i ]) * params[ i ] * x2 + + params[ i ] * params[ i ] * x3; + + curY = Math.pow( 1 - params[ i ], 2.0 ) * y1 + + 2 * (1.0 - params[ i ]) * params[ i ] * y2 + + params[ i ] * params[ i ] * y3; + + distSquared = Math.pow( curX - x, 2 ) + Math.pow( curY - y, 2 ); + // debug('distance for param ' + params[i] + ": " + Math.sqrt(distSquared)); + if( minDistanceSquared >= 0 ){ + if( distSquared < minDistanceSquared ){ + minDistanceSquared = distSquared; + } + } else { + minDistanceSquared = distSquared; + } + } + + return minDistanceSquared; +}; + +math.sqdistToFiniteLine = function( x, y, x1, y1, x2, y2 ){ + let offset = [ x - x1, y - y1 ]; + let line = [ x2 - x1, y2 - y1 ]; + + let lineSq = line[0] * line[0] + line[1] * line[1]; + let hypSq = offset[0] * offset[0] + offset[1] * offset[1]; + + let dotProduct = offset[0] * line[0] + offset[1] * line[1]; + let adjSq = dotProduct * dotProduct / lineSq; + + if( dotProduct < 0 ){ + return hypSq; + } + + if( adjSq > lineSq ){ + return (x - x2) * (x - x2) + (y - y2) * (y - y2); + } + + return hypSq - adjSq; +}; + +math.pointInsidePolygonPoints = function( x, y, points ){ + let x1, y1, x2, y2; + let y3; + + // Intersect with vertical line through (x, y) + let up = 0; + // let down = 0; + for( let i = 0; i < points.length / 2; i++ ){ + x1 = points[ i * 2]; + y1 = points[ i * 2 + 1]; + + if( i + 1 < points.length / 2 ){ + x2 = points[ (i + 1) * 2]; + y2 = points[ (i + 1) * 2 + 1]; + } else { + x2 = points[ (i + 1 - points.length / 2) * 2]; + y2 = points[ (i + 1 - points.length / 2) * 2 + 1]; + } + + if( x1 == x && x2 == x ){ + // then ignore + } else if( (x1 >= x && x >= x2) + || (x1 <= x && x <= x2) ){ + + y3 = (x - x1) / (x2 - x1) * (y2 - y1) + y1; + + if( y3 > y ){ + up++; + } + + // if( y3 < y ){ + // down++; + // } + + } else { + continue; + } + + } + + if( up % 2 === 0 ){ + return false; + } else { + return true; + } +}; + +math.pointInsidePolygon = function( + x, y, basePoints, centerX, centerY, width, height, direction, padding ){ + + //let direction = arguments[6]; + let transformedPoints = new Array( basePoints.length ); + + // Gives negative angle + let angle; + + if( direction[0] != null ){ + angle = Math.atan( direction[1] / direction[0] ); + + if( direction[0] < 0 ){ + angle = angle + Math.PI / 2; + } else { + angle = -angle - Math.PI / 2; + } + } else { + angle = direction; + } + + let cos = Math.cos( -angle ); + let sin = Math.sin( -angle ); + + // console.log("base: " + basePoints); + for( let i = 0; i < transformedPoints.length / 2; i++ ){ + transformedPoints[ i * 2] = + width / 2 * (basePoints[ i * 2] * cos + - basePoints[ i * 2 + 1] * sin); + + transformedPoints[ i * 2 + 1] = + height / 2 * (basePoints[ i * 2 + 1] * cos + + basePoints[ i * 2] * sin); + + transformedPoints[ i * 2] += centerX; + transformedPoints[ i * 2 + 1] += centerY; + } + + let points; + + if( padding > 0 ){ + let expandedLineSet = this.expandPolygon( + transformedPoints, + -padding ); + + points = this.joinLines( expandedLineSet ); + } else { + points = transformedPoints; + } + + return math.pointInsidePolygonPoints( x, y, points ); +}; + +math.joinLines = function( lineSet ){ + + let vertices = new Array( lineSet.length / 2 ); + + let currentLineStartX, currentLineStartY, currentLineEndX, currentLineEndY; + let nextLineStartX, nextLineStartY, nextLineEndX, nextLineEndY; + + for( let i = 0; i < lineSet.length / 4; i++ ){ + currentLineStartX = lineSet[ i * 4]; + currentLineStartY = lineSet[ i * 4 + 1]; + currentLineEndX = lineSet[ i * 4 + 2]; + currentLineEndY = lineSet[ i * 4 + 3]; + + if( i < lineSet.length / 4 - 1 ){ + nextLineStartX = lineSet[ (i + 1) * 4]; + nextLineStartY = lineSet[ (i + 1) * 4 + 1]; + nextLineEndX = lineSet[ (i + 1) * 4 + 2]; + nextLineEndY = lineSet[ (i + 1) * 4 + 3]; + } else { + nextLineStartX = lineSet[0]; + nextLineStartY = lineSet[1]; + nextLineEndX = lineSet[2]; + nextLineEndY = lineSet[3]; + } + + let intersection = this.finiteLinesIntersect( + currentLineStartX, currentLineStartY, + currentLineEndX, currentLineEndY, + nextLineStartX, nextLineStartY, + nextLineEndX, nextLineEndY, + true ); + + vertices[ i * 2] = intersection[0]; + vertices[ i * 2 + 1] = intersection[1]; + } + + return vertices; +}; + +math.expandPolygon = function( points, pad ){ + + let expandedLineSet = new Array( points.length * 2 ); + + let currentPointX, currentPointY, nextPointX, nextPointY; + + for( let i = 0; i < points.length / 2; i++ ){ + currentPointX = points[ i * 2]; + currentPointY = points[ i * 2 + 1]; + + if( i < points.length / 2 - 1 ){ + nextPointX = points[ (i + 1) * 2]; + nextPointY = points[ (i + 1) * 2 + 1]; + } else { + nextPointX = points[0]; + nextPointY = points[1]; + } + + // Current line: [currentPointX, currentPointY] to [nextPointX, nextPointY] + + // Assume CCW polygon winding + + let offsetX = (nextPointY - currentPointY); + let offsetY = -(nextPointX - currentPointX); + + // Normalize + let offsetLength = Math.sqrt( offsetX * offsetX + offsetY * offsetY ); + let normalizedOffsetX = offsetX / offsetLength; + let normalizedOffsetY = offsetY / offsetLength; + + expandedLineSet[ i * 4] = currentPointX + normalizedOffsetX * pad; + expandedLineSet[ i * 4 + 1] = currentPointY + normalizedOffsetY * pad; + expandedLineSet[ i * 4 + 2] = nextPointX + normalizedOffsetX * pad; + expandedLineSet[ i * 4 + 3] = nextPointY + normalizedOffsetY * pad; + } + + return expandedLineSet; +}; + +math.intersectLineEllipse = function( + x, y, centerX, centerY, ellipseWradius, ellipseHradius ){ + + let dispX = centerX - x; + let dispY = centerY - y; + + dispX /= ellipseWradius; + dispY /= ellipseHradius; + + let len = Math.sqrt( dispX * dispX + dispY * dispY ); + + let newLength = len - 1; + + if( newLength < 0 ){ + return []; + } + + let lenProportion = newLength / len; + + return [ (centerX - x) * lenProportion + x, (centerY - y) * lenProportion + y ]; +}; + +math.checkInEllipse = function( + x, y, width, height, centerX, centerY, padding ){ + x -= centerX; + y -= centerY; + + x /= (width / 2 + padding); + y /= (height / 2 + padding); + + return x * x + y * y <= 1; +}; + +// Returns intersections of increasing distance from line's start point +math.intersectLineCircle = function( + x1, y1, x2, y2, centerX, centerY, radius ){ + + // Calculate d, direction vector of line + let d = [ x2 - x1, y2 - y1 ]; // Direction vector of line + let f = [ x1 - centerX, y1 - centerY ]; + + let a = d[0] * d[0] + d[1] * d[1]; + let b = 2 * (f[0] * d[0] + f[1] * d[1]); + let c = (f[0] * f[0] + f[1] * f[1]) - radius * radius ; + + let discriminant = b * b - 4 * a * c; + + if( discriminant < 0 ){ + return []; + } + + let t1 = (-b + Math.sqrt( discriminant )) / (2 * a); + let t2 = (-b - Math.sqrt( discriminant )) / (2 * a); + + let tMin = Math.min( t1, t2 ); + let tMax = Math.max( t1, t2 ); + let inRangeParams = []; + + if( tMin >= 0 && tMin <= 1 ){ + inRangeParams.push( tMin ); + } + + if( tMax >= 0 && tMax <= 1 ){ + inRangeParams.push( tMax ); + } + + if( inRangeParams.length === 0 ){ + return []; + } + + let nearIntersectionX = inRangeParams[0] * d[0] + x1; + let nearIntersectionY = inRangeParams[0] * d[1] + y1; + + if( inRangeParams.length > 1 ){ + + if( inRangeParams[0] == inRangeParams[1] ){ + return [ nearIntersectionX, nearIntersectionY ]; + } else { + + let farIntersectionX = inRangeParams[1] * d[0] + x1; + let farIntersectionY = inRangeParams[1] * d[1] + y1; + + return [ nearIntersectionX, nearIntersectionY, farIntersectionX, farIntersectionY ]; + } + + } else { + return [ nearIntersectionX, nearIntersectionY ]; + } + +}; + +math.findCircleNearPoint = function( centerX, centerY, + radius, farX, farY ){ + + let displacementX = farX - centerX; + let displacementY = farY - centerY; + let distance = Math.sqrt( displacementX * displacementX + + displacementY * displacementY ); + + let unitDisplacementX = displacementX / distance; + let unitDisplacementY = displacementY / distance; + + return [ centerX + unitDisplacementX * radius, + centerY + unitDisplacementY * radius ]; +}; + +math.findMaxSqDistanceToOrigin = function( points ){ + let maxSqDistance = 0.000001; + let sqDistance; + + for( let i = 0; i < points.length / 2; i++ ){ + + sqDistance = points[ i * 2] * points[ i * 2] + + points[ i * 2 + 1] * points[ i * 2 + 1]; + + if( sqDistance > maxSqDistance ){ + maxSqDistance = sqDistance; + } + } + + return maxSqDistance; +}; + +math.midOfThree = function( a, b, c ){ + if( (b <= a && a <= c) || (c <= a && a <= b) ){ + return a; + } else if( (a <= b && b <= c) || (c <= b && b <= a) ){ + return b; + } else { + return c; + } +}; + +// (x1,y1)=>(x2,y2) intersect with (x3,y3)=>(x4,y4) +math.finiteLinesIntersect = function( + x1, y1, x2, y2, + x3, y3, x4, y4, + infiniteLines +){ + + let dx13 = x1 - x3; + let dx21 = x2 - x1; + let dx43 = x4 - x3; + + let dy13 = y1 - y3; + let dy21 = y2 - y1; + let dy43 = y4 - y3; + + let ua_t = dx43 * dy13 - dy43 * dx13; + let ub_t = dx21 * dy13 - dy21 * dx13; + let u_b = dy43 * dx21 - dx43 * dy21; + + if( u_b !== 0 ){ + let ua = ua_t / u_b; + let ub = ub_t / u_b; + + let flptThreshold = 0.001; + let min = 0 - flptThreshold; + let max = 1 + flptThreshold; + + if( min <= ua && ua <= max && min <= ub && ub <= max ){ + return [ x1 + ua * dx21, y1 + ua * dy21 ]; + + } else { + if( !infiniteLines ){ + return []; + } else { + return [ x1 + ua * dx21, y1 + ua * dy21 ]; + } + } + } else { + if( ua_t === 0 || ub_t === 0 ){ + + // Parallel, coincident lines. Check if overlap + + // Check endpoint of second line + if( this.midOfThree( x1, x2, x4 ) === x4 ){ + return [ x4, y4 ]; + } + + // Check start point of second line + if( this.midOfThree( x1, x2, x3 ) === x3 ){ + return [ x3, y3 ]; + } + + // Endpoint of first line + if( this.midOfThree( x3, x4, x2 ) === x2 ){ + return [ x2, y2 ]; + } + + return []; + } else { + + // Parallel, non-coincident + return []; + } + } +}; + +// math.polygonIntersectLine( x, y, basePoints, centerX, centerY, width, height, padding ) +// intersect a node polygon (pts transformed) +// +// math.polygonIntersectLine( x, y, basePoints, centerX, centerY ) +// intersect the points (no transform) +math.polygonIntersectLine = function( + x, y, basePoints, centerX, centerY, width, height, padding ){ + + let intersections = []; + let intersection; + + let transformedPoints = new Array( basePoints.length ); + + let doTransform = true; + if( arguments.length === 5 ){ + doTransform = false; + } + + let points; + + if( doTransform ){ + for( let i = 0; i < transformedPoints.length / 2; i++ ){ + transformedPoints[ i * 2] = basePoints[ i * 2] * width + centerX; + transformedPoints[ i * 2 + 1] = basePoints[ i * 2 + 1] * height + centerY; + } + + if( padding > 0 ){ + let expandedLineSet = math.expandPolygon( + transformedPoints, + -padding ); + + points = math.joinLines( expandedLineSet ); + } else { + points = transformedPoints; + } + } else { + points = basePoints; + } + + let currentX, currentY, nextX, nextY; + + for( let i = 0; i < points.length / 2; i++ ){ + + currentX = points[ i * 2]; + currentY = points[ i * 2 + 1]; + + if( i < points.length / 2 - 1 ){ + nextX = points[ (i + 1) * 2]; + nextY = points[ (i + 1) * 2 + 1]; + } else { + nextX = points[0]; + nextY = points[1]; + } + + intersection = this.finiteLinesIntersect( + x, y, centerX, centerY, + currentX, currentY, + nextX, nextY ); + + if( intersection.length !== 0 ){ + intersections.push( intersection[0], intersection[1] ); + } + } + + return intersections; +}; + +math.shortenIntersection = function( + intersection, offset, amount ){ + + let disp = [ intersection[0] - offset[0], intersection[1] - offset[1] ]; + + let length = Math.sqrt( disp[0] * disp[0] + disp[1] * disp[1] ); + + let lenRatio = (length - amount) / length; + + if( lenRatio < 0 ){ + lenRatio = 0.00001; + } + + return [ offset[0] + lenRatio * disp[0], offset[1] + lenRatio * disp[1] ]; +}; + +math.generateUnitNgonPointsFitToSquare = function( sides, rotationRadians ){ + let points = math.generateUnitNgonPoints( sides, rotationRadians ); + points = math.fitPolygonToSquare( points ); + + return points; +}; + +math.fitPolygonToSquare = function( points ){ + let x, y; + let sides = points.length / 2; + let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity; + + for( let i = 0; i < sides; i++ ){ + x = points[2 * i ]; + y = points[2 * i + 1]; + + minX = Math.min( minX, x ); + maxX = Math.max( maxX, x ); + minY = Math.min( minY, y ); + maxY = Math.max( maxY, y ); + } + + // stretch factors + let sx = 2 / (maxX - minX); + let sy = 2 / (maxY - minY); + + for( let i = 0; i < sides; i++ ){ + x = points[2 * i ] = points[2 * i ] * sx; + y = points[2 * i + 1] = points[2 * i + 1] * sy; + + minX = Math.min( minX, x ); + maxX = Math.max( maxX, x ); + minY = Math.min( minY, y ); + maxY = Math.max( maxY, y ); + } + + if( minY < -1 ){ + for( let i = 0; i < sides; i++ ){ + y = points[2 * i + 1] = points[2 * i + 1] + (-1 - minY); + } + } + + return points; +}; + +math.generateUnitNgonPoints = function( sides, rotationRadians ){ + + let increment = 1.0 / sides * 2 * Math.PI; + let startAngle = sides % 2 === 0 ? + Math.PI / 2.0 + increment / 2.0 : Math.PI / 2.0; + + startAngle += rotationRadians; + + let points = new Array( sides * 2 ); + + let currentAngle; + for( let i = 0; i < sides; i++ ){ + currentAngle = i * increment + startAngle; + + points[2 * i ] = Math.cos( currentAngle ); // x + points[2 * i + 1] = Math.sin( -currentAngle ); // y + } + + return points; +}; + +math.getRoundRectangleRadius = function( width, height ){ + + // Set the default radius, unless half of width or height is smaller than default + return Math.min( width / 4, height / 4, 8 ); +}; + +math.getCutRectangleCornerLength = function(){ + return 8; +}; + +math.bezierPtsToQuadCoeff = function( p0, p1, p2 ){ + return [ + p0 - 2 * p1 + p2, + 2 * ( p1 - p0 ), + p0 + ]; +}; + +math.getBarrelCurveConstants = function( width, height ){ + // get curve width, height, and control point position offsets as a percentage of node height / width + return { + heightOffset: Math.min(15, 0.05 * height), + widthOffset: Math.min(100, 0.25 * width), + ctrlPtOffsetPct: 0.05 + }; +}; + + +module.exports = math; diff --git a/node_modules/cytoscape/src/promise.js b/node_modules/cytoscape/src/promise.js new file mode 100644 index 000000000..d1bf47972 --- /dev/null +++ b/node_modules/cytoscape/src/promise.js @@ -0,0 +1,211 @@ +/*! +Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable +Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) +Licensed under The MIT License (http://opensource.org/licenses/MIT) +*/ + +/* promise states [Promises/A+ 2.1] */ +var STATE_PENDING = 0; /* [Promises/A+ 2.1.1] */ +var STATE_FULFILLED = 1; /* [Promises/A+ 2.1.2] */ +var STATE_REJECTED = 2; /* [Promises/A+ 2.1.3] */ + +/* promise object constructor */ +var api = function( executor ){ + /* optionally support non-constructor/plain-function call */ + if( !(this instanceof api) ) + return new api( executor ); + + /* initialize object */ + this.id = 'Thenable/1.0.7'; + this.state = STATE_PENDING; /* initial state */ + this.fulfillValue = undefined; /* initial value */ /* [Promises/A+ 1.3, 2.1.2.2] */ + this.rejectReason = undefined; /* initial reason */ /* [Promises/A+ 1.5, 2.1.3.2] */ + this.onFulfilled = []; /* initial handlers */ + this.onRejected = []; /* initial handlers */ + + /* provide optional information-hiding proxy */ + this.proxy = { + then: this.then.bind( this ) + }; + + /* support optional executor function */ + if( typeof executor === 'function' ) + executor.call( this, this.fulfill.bind( this ), this.reject.bind( this ) ); +}; + +/* promise API methods */ +api.prototype = { + /* promise resolving methods */ + fulfill: function( value ){ return deliver( this, STATE_FULFILLED, 'fulfillValue', value ); }, + reject: function( value ){ return deliver( this, STATE_REJECTED, 'rejectReason', value ); }, + + /* "The then Method" [Promises/A+ 1.1, 1.2, 2.2] */ + then: function( onFulfilled, onRejected ){ + var curr = this; + var next = new api(); /* [Promises/A+ 2.2.7] */ + curr.onFulfilled.push( + resolver( onFulfilled, next, 'fulfill' ) ); /* [Promises/A+ 2.2.2/2.2.6] */ + curr.onRejected.push( + resolver( onRejected, next, 'reject' ) ); /* [Promises/A+ 2.2.3/2.2.6] */ + execute( curr ); + return next.proxy; /* [Promises/A+ 2.2.7, 3.3] */ + } +}; + +/* deliver an action */ +var deliver = function( curr, state, name, value ){ + if( curr.state === STATE_PENDING ){ + curr.state = state; /* [Promises/A+ 2.1.2.1, 2.1.3.1] */ + curr[ name ] = value; /* [Promises/A+ 2.1.2.2, 2.1.3.2] */ + execute( curr ); + } + return curr; +}; + +/* execute all handlers */ +var execute = function( curr ){ + if( curr.state === STATE_FULFILLED ) + execute_handlers( curr, 'onFulfilled', curr.fulfillValue ); + else if( curr.state === STATE_REJECTED ) + execute_handlers( curr, 'onRejected', curr.rejectReason ); +}; + +/* execute particular set of handlers */ +var execute_handlers = function( curr, name, value ){ + /* global setImmediate: true */ + /* global setTimeout: true */ + + /* short-circuit processing */ + if( curr[ name ].length === 0 ) + return; + + /* iterate over all handlers, exactly once */ + var handlers = curr[ name ]; + curr[ name ] = []; /* [Promises/A+ 2.2.2.3, 2.2.3.3] */ + var func = function(){ + for( var i = 0; i < handlers.length; i++ ) + handlers[ i ]( value ); /* [Promises/A+ 2.2.5] */ + }; + + /* execute procedure asynchronously */ /* [Promises/A+ 2.2.4, 3.1] */ + if( typeof setImmediate === 'function' ) + setImmediate( func ); + else + setTimeout( func, 0 ); +}; + +/* generate a resolver function */ +var resolver = function( cb, next, method ){ + return function( value ){ + if( typeof cb !== 'function' ) /* [Promises/A+ 2.2.1, 2.2.7.3, 2.2.7.4] */ + next[ method ].call( next, value ); /* [Promises/A+ 2.2.7.3, 2.2.7.4] */ + else { + var result; + try { result = cb( value ); } /* [Promises/A+ 2.2.2.1, 2.2.3.1, 2.2.5, 3.2] */ + catch( e ){ + next.reject( e ); /* [Promises/A+ 2.2.7.2] */ + return; + } + resolve( next, result ); /* [Promises/A+ 2.2.7.1] */ + } + }; +}; + +/* "Promise Resolution Procedure" */ /* [Promises/A+ 2.3] */ +var resolve = function( promise, x ){ + /* sanity check arguments */ /* [Promises/A+ 2.3.1] */ + if( promise === x || promise.proxy === x ){ + promise.reject( new TypeError( 'cannot resolve promise with itself' ) ); + return; + } + + /* surgically check for a "then" method + (mainly to just call the "getter" of "then" only once) */ + var then; + if( (typeof x === 'object' && x !== null) || typeof x === 'function' ){ + try { then = x.then; } /* [Promises/A+ 2.3.3.1, 3.5] */ + catch( e ){ + promise.reject( e ); /* [Promises/A+ 2.3.3.2] */ + return; + } + } + + /* handle own Thenables [Promises/A+ 2.3.2] + and similar "thenables" [Promises/A+ 2.3.3] */ + if( typeof then === 'function' ){ + var resolved = false; + try { + /* call retrieved "then" method */ /* [Promises/A+ 2.3.3.3] */ + then.call( x, + /* resolvePromise */ /* [Promises/A+ 2.3.3.3.1] */ + function( y ){ + if( resolved ) return; resolved = true; /* [Promises/A+ 2.3.3.3.3] */ + if( y === x ) /* [Promises/A+ 3.6] */ + promise.reject( new TypeError( 'circular thenable chain' ) ); + else + resolve( promise, y ); + }, + + /* rejectPromise */ /* [Promises/A+ 2.3.3.3.2] */ + function( r ){ + if( resolved ) return; resolved = true; /* [Promises/A+ 2.3.3.3.3] */ + promise.reject( r ); + } + ); + } + catch( e ){ + if( !resolved ) /* [Promises/A+ 2.3.3.3.3] */ + promise.reject( e ); /* [Promises/A+ 2.3.3.3.4] */ + } + return; + } + + /* handle other values */ + promise.fulfill( x ); /* [Promises/A+ 2.3.4, 2.3.3.4] */ +}; + +// so we always have Promise.all() +api.all = function( ps ){ + return new api(function( resolveAll, rejectAll ){ + var vals = new Array( ps.length ); + var doneCount = 0; + + var fulfill = function( i, val ){ + vals[ i ] = val; + doneCount++; + + if( doneCount === ps.length ){ + resolveAll( vals ); + } + }; + + for( var i = 0; i < ps.length; i++ ){ + (function( i ){ + var p = ps[i]; + var isPromise = p != null && p.then != null; + + if( isPromise ){ + p.then( function( val ){ + fulfill( i, val ); + }, function( err ){ + rejectAll( err ); + } ); + } else { + var val = p; + fulfill( i, val ); + } + })( i ); + } + + } ); +}; + +api.resolve = function( val ){ + return new api(function( resolve, reject ){ resolve( val ); }); +}; + +api.reject = function( val ){ + return new api(function( resolve, reject ){ reject( val ); }); +}; + +module.exports = typeof Promise !== 'undefined' ? Promise : api; // eslint-disable-line no-undef diff --git a/node_modules/cytoscape/src/selector/expressions.js b/node_modules/cytoscape/src/selector/expressions.js new file mode 100644 index 000000000..183ec87f5 --- /dev/null +++ b/node_modules/cytoscape/src/selector/expressions.js @@ -0,0 +1,230 @@ +const { stateSelectorRegex } = require('./state'); +const tokens = require('./tokens'); +const util = require('../util'); +const newQuery = require('./new-query'); + +// when a token like a variable has escaped meta characters, we need to clean the backslashes out +// so that values get compared properly in Selector.filter() +const cleanMetaChars = function( str ){ + return str.replace( new RegExp( '\\\\(' + tokens.metaChar + ')', 'g' ), function( match, $1 ){ + return $1; + } ); +}; + +const replaceLastQuery = ( selector, examiningQuery, replacementQuery ) => { + if( examiningQuery === selector[ selector.length - 1 ] ){ + selector[ selector.length - 1 ] = replacementQuery; + } +}; + +// NOTE: add new expression syntax here to have it recognised by the parser; +// - a query contains all adjacent (i.e. no separator in between) expressions; +// - the current query is stored in selector[i] --- you can use the reference to `this` in the populate function; +// - you need to check the query objects in Selector.filter() for it actually filter properly, but that's pretty straight forward +// - when you add something here, also add to Selector.toString() +let exprs = [ + { + name: 'group', + query: true, + regex: '(' + tokens.group + ')', + populate: function( selector, query, [ group ] ){ + query.group = group === '*' ? group : group + 's'; + } + }, + + { + name: 'state', + query: true, + regex: stateSelectorRegex, + populate: function( selector, query, [ state ] ){ + query.colonSelectors.push( state ); + } + }, + + { + name: 'id', + query: true, + regex: '\\#(' + tokens.id + ')', + populate: function( selector, query,[ id ] ){ + query.ids.push( cleanMetaChars( id ) ); + } + }, + + { + name: 'className', + query: true, + regex: '\\.(' + tokens.className + ')', + populate: function( selector, query, [ className ] ){ + query.classes.push( cleanMetaChars( className ) ); + } + }, + + { + name: 'dataExists', + query: true, + regex: '\\[\\s*(' + tokens.variable + ')\\s*\\]', + populate: function( selector, query, [ variable ] ){ + query.data.push( { + field: cleanMetaChars( variable ) + } ); + } + }, + + { + name: 'dataCompare', + query: true, + regex: '\\[\\s*(' + tokens.variable + ')\\s*(' + tokens.comparatorOp + ')\\s*(' + tokens.value + ')\\s*\\]', + populate: function( selector, query, [ variable, comparatorOp, value ] ){ + let valueIsString = new RegExp( '^' + tokens.string + '$' ).exec( value ) != null; + + if( valueIsString ){ + value = value.substring( 1, value.length - 1 ); + } else { + value = parseFloat( value ); + } + + query.data.push( { + field: cleanMetaChars( variable ), + operator: comparatorOp, + value: value + } ); + } + }, + + { + name: 'dataBool', + query: true, + regex: '\\[\\s*(' + tokens.boolOp + ')\\s*(' + tokens.variable + ')\\s*\\]', + populate: function( selector, query, [ boolOp, variable ] ){ + query.data.push( { + field: cleanMetaChars( variable ), + operator: boolOp + } ); + } + }, + + { + name: 'metaCompare', + query: true, + regex: '\\[\\[\\s*(' + tokens.meta + ')\\s*(' + tokens.comparatorOp + ')\\s*(' + tokens.number + ')\\s*\\]\\]', + populate: function( selector, query, [ meta, comparatorOp, number ] ){ + query.meta.push( { + field: cleanMetaChars( meta ), + operator: comparatorOp, + value: parseFloat( number ) + } ); + } + }, + + { + name: 'nextQuery', + separator: true, + regex: tokens.separator, + populate: function( selector ){ + // go on to next query + let nextQuery = selector[ selector.length++ ] = newQuery(); + selector.currentSubject = null; + + return nextQuery; + } + }, + + { + name: 'directedEdge', + separator: true, + regex: tokens.directedEdge, + populate: function( selector, query ){ + let edgeQuery = newQuery(); + let source = query; + let target = newQuery(); + + edgeQuery.group = 'edges'; + edgeQuery.target = target; + edgeQuery.source = source; + edgeQuery.subject = selector.currentSubject; + + // the query in the selector should be the edge rather than the source + replaceLastQuery( selector, query, edgeQuery ); + + // we're now populating the target query with expressions that follow + return target; + } + }, + + { + name: 'undirectedEdge', + separator: true, + regex: tokens.undirectedEdge, + populate: function( selector, query ){ + let edgeQuery = newQuery(); + let source = query; + let target = newQuery(); + + edgeQuery.group = 'edges'; + edgeQuery.connectedNodes = [ source, target ]; + edgeQuery.subject = selector.currentSubject; + + // the query in the selector should be the edge rather than the source + replaceLastQuery( selector, query, edgeQuery ); + + // we're now populating the target query with expressions that follow + return target; + } + }, + + { + name: 'child', + separator: true, + regex: tokens.child, + populate: function( selector, query ){ + // this query is the parent of the following query + let childQuery = newQuery(); + childQuery.parent = query; + childQuery.subject = selector.currentSubject; + + // it's cheaper to compare children first and go up so replace the parent + replaceLastQuery( selector, query, childQuery ); + + // we're now populating the child query with expressions that follow + return childQuery; + } + }, + + { + name: 'descendant', + separator: true, + regex: tokens.descendant, + populate: function( selector, query ){ + // this query is the ancestor of the following query + let descendantQuery = newQuery(); + descendantQuery.ancestor = query; + descendantQuery.subject = selector.currentSubject; + + // it's cheaper to compare descendants first and go up so replace the ancestor + replaceLastQuery( selector, query, descendantQuery ); + + // we're now populating the descendant query with expressions that follow + return descendantQuery; + } + }, + + { + name: 'subject', + modifier: true, + regex: tokens.subject, + populate: function( selector, query ){ + if( selector.currentSubject != null && query.subject != query ){ + util.error( 'Redefinition of subject in selector `' + selector.toString() + '`' ); + return false; + } + + selector.currentSubject = query; + query.subject = query; + selector[ selector.length - 1 ].subject = query; + } + } +]; + +exprs.forEach( e => e.regexObj = new RegExp( '^' + e.regex ) ); + +module.exports = exprs; diff --git a/node_modules/cytoscape/src/selector/index.js b/node_modules/cytoscape/src/selector/index.js new file mode 100644 index 000000000..f7a203345 --- /dev/null +++ b/node_modules/cytoscape/src/selector/index.js @@ -0,0 +1,200 @@ +const is = require('../is'); +const util = require('../util'); +const newQuery = require('./new-query'); + +let Selector = function( selector ){ + let self = this; + + self._private = { + selectorText: selector, + invalid: true + }; + + if( selector == null || ( is.string( selector ) && selector.match( /^\s*$/ ) ) ){ + + self.length = 0; + + } else if( selector === '*' || selector === 'edge' || selector === 'node' ){ + + // make single, group-only selectors cheap to make and cheap to filter + + self[0] = newQuery(); + self[0].group = selector === '*' ? selector : selector + 's'; + self[0].groupOnly = true; + self[0].length = 1; + self._private.invalid = false; + self.length = 1; + + } else if( is.elementOrCollection( selector ) ){ + + let collection = selector.collection(); + + self[0] = newQuery(); + self[0].collection = collection; + self[0].length = 1; + self.length = 1; + + } else if( is.fn( selector ) ){ + + self[0] = newQuery(); + self[0].filter = selector; + self[0].length = 1; + self.length = 1; + + } else if( is.string( selector ) ){ + if( !self.parse( selector ) ){ return; } + + } else { + util.error( 'A selector must be created from a string; found ', selector ); + return; + } + + self._private.invalid = false; +}; + +let selfn = Selector.prototype; + +selfn.valid = function(){ + return !this._private.invalid; +}; + +selfn.invalid = function(){ + return this._private.invalid; +}; + +selfn.text = function(){ + return this._private.selectorText; +}; + +selfn.size = function(){ + return this.length; +}; + +selfn.eq = function( i ){ + return this[ i ]; +}; + +selfn.sameText = function( otherSel ){ + return this.text() === otherSel.text(); +}; + +selfn.toString = selfn.selector = function(){ + + if( this._private.toStringCache != null ){ + return this._private.toStringCache; + } + + let i; + let str = ''; + + let clean = function( obj ){ + if( obj == null ){ + return ''; + } else { + return obj; + } + }; + + let cleanVal = function( val ){ + if( is.string( val ) ){ + return '"' + val + '"'; + } else { + return clean( val ); + } + }; + + let space = function( val ){ + return ' ' + val + ' '; + }; + + let queryToString = function( query ){ + let str = ''; + let j, sel; + + if( query.subject === query ){ + str += '$'; + } + + let group = clean( query.group ); + str += group.substring( 0, group.length - 1 ); + + for( j = 0; j < query.data.length; j++ ){ + let data = query.data[ j ]; + + if( data.value ){ + str += '[' + data.field + space( clean( data.operator ) ) + cleanVal( data.value ) + ']'; + } else { + str += '[' + clean( data.operator ) + data.field + ']'; + } + } + + for( j = 0; j < query.meta.length; j++ ){ + let meta = query.meta[ j ]; + str += '[[' + meta.field + space( clean( meta.operator ) ) + cleanVal( meta.value ) + ']]'; + } + + for( j = 0; j < query.colonSelectors.length; j++ ){ + sel = query.colonSelectors[ i ]; + str += sel; + } + + for( j = 0; j < query.ids.length; j++ ){ + sel = '#' + query.ids[ i ]; + str += sel; + } + + for( j = 0; j < query.classes.length; j++ ){ + sel = '.' + query.classes[ j ]; + str += sel; + } + + if( query.source != null && query.target != null ){ + str = queryToString( query.source ) + ' -> ' + queryToString( query.target ); + } + + if( query.connectedNodes != null ){ + let n = query.connectedNodes; + + str = queryToString( n[0] ) + ' <-> ' + queryToString( n[1] ); + } + + if( query.parent != null ){ + str = queryToString( query.parent ) + ' > ' + str; + } + + if( query.ancestor != null ){ + str = queryToString( query.ancestor ) + ' ' + str; + } + + if( query.child != null ){ + str += ' > ' + queryToString( query.child ); + } + + if( query.descendant != null ){ + str += ' ' + queryToString( query.descendant ); + } + + return str; + }; + + for( i = 0; i < this.length; i++ ){ + let query = this[ i ]; + + str += queryToString( query ); + + if( this.length > 1 && i < this.length - 1 ){ + str += ', '; + } + } + + this._private.toStringCache = str; + + return str; +}; + +[ + require('./parse'), + require('./matching') +].forEach( p => util.assign( selfn, p ) ); + +module.exports = Selector; diff --git a/node_modules/cytoscape/src/selector/matching.js b/node_modules/cytoscape/src/selector/matching.js new file mode 100644 index 000000000..dbf8a5c42 --- /dev/null +++ b/node_modules/cytoscape/src/selector/matching.js @@ -0,0 +1,310 @@ +const { stateSelectorMatches } = require('./state'); +const is = require('../is'); + +// generic checking for data/metadata +let operandsMatch = function( query, params ){ + let allDataMatches = true; + for( let k = 0; k < query[ params.name ].length; k++ ){ + let data = query[ params.name ][ k ]; + let operator = data.operator; + let value = data.value; + let field = data.field; + let matches; + let fieldVal = params.fieldValue( field ); + + if( operator != null && value != null ){ + let fieldStr = !is.string( fieldVal ) && !is.number( fieldVal ) ? '' : '' + fieldVal; + let valStr = '' + value; + + let caseInsensitive = false; + if( operator.indexOf( '@' ) >= 0 ){ + fieldStr = fieldStr.toLowerCase(); + valStr = valStr.toLowerCase(); + + operator = operator.replace( '@', '' ); + caseInsensitive = true; + } + + let notExpr = false; + if( operator.indexOf( '!' ) >= 0 ){ + operator = operator.replace( '!', '' ); + notExpr = true; + } + + // if we're doing a case insensitive comparison, then we're using a STRING comparison + // even if we're comparing numbers + if( caseInsensitive ){ + value = valStr.toLowerCase(); + fieldVal = fieldStr.toLowerCase(); + } + + let isIneqCmp = false; + + switch( operator ){ + case '*=': + matches = fieldStr.indexOf( valStr ) >= 0; + break; + case '$=': + matches = fieldStr.indexOf( valStr, fieldStr.length - valStr.length ) >= 0; + break; + case '^=': + matches = fieldStr.indexOf( valStr ) === 0; + break; + case '=': + matches = fieldVal === value; + break; + case '>': + isIneqCmp = true; + matches = fieldVal > value; + break; + case '>=': + isIneqCmp = true; + matches = fieldVal >= value; + break; + case '<': + isIneqCmp = true; + matches = fieldVal < value; + break; + case '<=': + isIneqCmp = true; + matches = fieldVal <= value; + break; + default: + matches = false; + break; + } + + // apply the not op, but null vals for inequalities should always stay non-matching + if( notExpr && ( fieldVal != null || !isIneqCmp ) ){ + matches = !matches; + } + } else if( operator != null ){ + switch( operator ){ + case '?': + matches = fieldVal ? true : false; + break; + case '!': + matches = fieldVal ? false : true; + break; + case '^': + matches = fieldVal === undefined; + break; + } + } else { + matches = fieldVal !== undefined; + } + + if( !matches ){ + allDataMatches = false; + break; + } + } // for + + return allDataMatches; +}; // operandsMatch + +// check parent/child relations +let confirmRelations = function( query, isNecessary, eles ){ + if( query != null ){ + let matches = false; + + if( !isNecessary ){ return false; } + + eles = eles(); // save cycles if query == null + + // query must match for at least one element (may be recursive) + for( let i = 0; i < eles.length; i++ ){ + if( queryMatches( query, eles[ i ] ) ){ + matches = true; + break; + } + } + + return matches; + } else { + return true; + } +}; + +let queryMatches = function( query, ele ){ + // make single group-only selectors really cheap to check since they're the most common ones + if( query.groupOnly ){ + return query.group === '*' || query.group === ele.group(); + } + + // check group + if( query.group != null && query.group != '*' && query.group != ele.group() ){ + return false; + } + + let cy = ele.cy(); + let k; + + // check colon selectors + let allColonSelectorsMatch = true; + for( k = 0; k < query.colonSelectors.length; k++ ){ + let sel = query.colonSelectors[ k ]; + + allColonSelectorsMatch = stateSelectorMatches( sel, ele ); + + if( !allColonSelectorsMatch ) break; + } + if( !allColonSelectorsMatch ) return false; + + // check id + let allIdsMatch = true; + for( k = 0; k < query.ids.length; k++ ){ + let id = query.ids[ k ]; + let actualId = ele.id(); + + allIdsMatch = allIdsMatch && (id == actualId); + + if( !allIdsMatch ) break; + } + if( !allIdsMatch ) return false; + + // check classes + let allClassesMatch = true; + for( k = 0; k < query.classes.length; k++ ){ + let cls = query.classes[ k ]; + + allClassesMatch = allClassesMatch && ele.hasClass( cls ); + + if( !allClassesMatch ) break; + } + if( !allClassesMatch ) return false; + + // check data matches + let allDataMatches = operandsMatch( query, { + name: 'data', + fieldValue: function( field ){ + return ele.data( field ); + } + } ); + + if( !allDataMatches ){ + return false; + } + + // check metadata matches + let allMetaMatches = operandsMatch( query, { + name: 'meta', + fieldValue: function( field ){ + return ele[ field ](); + } + } ); + + if( !allMetaMatches ){ + return false; + } + + // check collection + if( query.collection != null ){ + let matchesAny = query.collection.hasElementWithId( ele.id() ); + + if( !matchesAny ){ + return false; + } + } + + // check filter function + if( query.filter != null && ele.collection().some( query.filter ) ){ + return false; + } + + let isCompound = cy.hasCompoundNodes(); + let getSource = () => ele.source(); + let getTarget = () => ele.target(); + + if( !confirmRelations( query.parent, isCompound, () => ele.parent() ) ){ return false; } + + if( !confirmRelations( query.ancestor, isCompound, () => ele.parents() ) ){ return false; } + + if( !confirmRelations( query.child, isCompound, () => ele.children() ) ){ return false; } + + if( !confirmRelations( query.descendant, isCompound, () => ele.descendants() ) ){ return false; } + + if( !confirmRelations( query.source, true, getSource ) ){ return false; } + + if( !confirmRelations( query.target, true, getTarget ) ){ return false; } + + if( query.connectedNodes ){ + let q0 = query.connectedNodes[0]; + let q1 = query.connectedNodes[1]; + + if( + confirmRelations( q0, true, getSource ) && + confirmRelations( q1, true, getTarget ) + ){ + // match + } else if( + confirmRelations( q0, true, getTarget ) && + confirmRelations( q1, true, getSource ) + ){ + // match + } else { + return false; + } + } + + // we've reached the end, so we've matched everything for this query + return true; +}; // queryMatches + +// filter an existing collection +let filter = function( collection ){ + let self = this; + let cy = collection.cy(); + + // don't bother trying if it's invalid + if( self.invalid() ){ + return cy.collection(); + } + + // for 1 id #foo queries, just get the element + if( self.length === 1 && self[0].length === 1 && self[0].ids.length === 1 ){ + return collection.getElementById( self[0].ids[0] ).collection(); + } + + let selectorFunction = function( element ){ + for( let j = 0; j < self.length; j++ ){ + let query = self[ j ]; + + if( queryMatches( query, element ) ){ + return true; + } + } + + return false; + }; + + if( self.text() == null ){ + selectorFunction = function(){ return true; }; + } + + let filteredCollection = collection.filter( selectorFunction ); + + return filteredCollection; +}; // filter + +// does selector match a single element? +let matches = function( ele ){ + let self = this; + + // don't bother trying if it's invalid + if( self.invalid() ){ + return false; + } + + for( let j = 0; j < self.length; j++ ){ + let query = self[ j ]; + + if( queryMatches( query, ele ) ){ + return true; + } + } + + return false; +}; // filter + +module.exports = { matches, filter }; diff --git a/node_modules/cytoscape/src/selector/new-query.js b/node_modules/cytoscape/src/selector/new-query.js new file mode 100644 index 000000000..f65f01411 --- /dev/null +++ b/node_modules/cytoscape/src/selector/new-query.js @@ -0,0 +1,27 @@ +// storage for parsed queries +let newQuery = function(){ + return { + classes: [], + colonSelectors: [], + data: [], + group: null, + ids: [], + meta: [], + + // fake selectors + collection: null, // a collection to match against + filter: null, // filter function + + // these are defined in the upward direction rather than down (e.g. child) + // because we need to go up in Selector.filter() + parent: null, // parent query obj + ancestor: null, // ancestor query obj + subject: null, // defines subject in compound query (subject query obj; points to self if subject) + + // use these only when subject has been defined + child: null, + descendant: null + }; +}; + +module.exports = newQuery; diff --git a/node_modules/cytoscape/src/selector/parse.js b/node_modules/cytoscape/src/selector/parse.js new file mode 100644 index 000000000..ff5e41a3c --- /dev/null +++ b/node_modules/cytoscape/src/selector/parse.js @@ -0,0 +1,128 @@ +const util = require('../util'); +const exprs = require('./expressions'); +const newQuery = require('./new-query'); + +// of all the expressions, find the first match in the remaining text +let consumeExpr = function( remaining ){ + let expr; + let match; + let name; + + for( let j = 0; j < exprs.length; j++ ){ + let e = exprs[ j ]; + let n = e.name; + + let m = remaining.match( e.regexObj ); + + if( m != null ){ + match = m; + expr = e; + name = n; + + let consumed = m[0]; + remaining = remaining.substring( consumed.length ); + + break; // we've consumed one expr, so we can return now + } + } + + return { + expr: expr, + match: match, + name: name, + remaining: remaining + }; +}; + + +// consume all leading whitespace +let consumeWhitespace = function( remaining ){ + let match = remaining.match( /^\s+/ ); + + if( match ){ + let consumed = match[0]; + remaining = remaining.substring( consumed.length ); + } + + return remaining; +}; + +let parse = function( selector ){ + let self = this; + + let remaining = self._private.selectorText = selector; + + let currentQuery = self[0] = newQuery(); + self.length = 1; + + remaining = consumeWhitespace( remaining ); // get rid of leading whitespace + + for( ;; ){ + let check = consumeExpr( remaining ); + + if( check.expr == null ){ + util.error( 'The selector `' + selector + '`is invalid' ); + return false; + } else { + let args = check.match.slice( 1 ); + + // let the token populate the selector object in currentQuery + let ret = check.expr.populate( self, currentQuery, args ); + + if( ret === false ){ + return false; // exit if population failed + } else if( ret != null ){ + currentQuery = ret; // change the current query to be filled if the expr specifies + } + } + + remaining = check.remaining; + + // we're done when there's nothing left to parse + if( remaining.match( /^\s*$/ ) ){ + break; + } + } + + // adjust references for subject + for( let j = 0; j < self.length; j++ ){ + let query = self[ j ]; + + if( query.subject != null ){ + // go up the tree until we reach the subject + for( ;; ){ + if( query.subject === query ){ break; } // done if subject is self + + if( query.parent != null ){ // swap parent/child reference + let parent = query.parent; + let child = query; + + child.parent = null; + parent.child = child; + + query = parent; // go up the tree + } else if( query.ancestor != null ){ // swap ancestor/descendant + let ancestor = query.ancestor; + let descendant = query; + + descendant.ancestor = null; + ancestor.descendant = descendant; + + query = ancestor; // go up the tree + } else if( query.source || query.target || query.connectedNodes ){ + util.error( 'The selector `' + self.text() + '` can not contain a subject selector that applies to the source or target of an edge selector' ); + return false; + } else { + util.error( 'When adjusting references for the selector `' + self.text() + '`, neither parent nor ancestor was found' ); + return false; + } + } // for + + self[ j ] = query.subject; // subject should be the root query + } // if + } // for + + return true; // success +}; + +module.exports = { parse }; diff --git a/node_modules/cytoscape/src/selector/state.js b/node_modules/cytoscape/src/selector/state.js new file mode 100644 index 000000000..52ef5c506 --- /dev/null +++ b/node_modules/cytoscape/src/selector/state.js @@ -0,0 +1,139 @@ +const util = require('../util'); + +let stateSelectors = [ + { + selector: ':selected', + matches: function( ele ){ return ele.selected(); } + }, + { + selector: ':unselected', + matches: function( ele ){ return !ele.selected(); } + }, + { + selector: ':selectable', + matches: function( ele ){ return ele.selectable(); } + }, + { + selector: ':unselectable', + matches: function( ele ){ return !ele.selectable(); } + }, + { + selector: ':locked', + matches: function( ele ){ return ele.locked(); } + }, + { + selector: ':unlocked', + matches: function( ele ){ return !ele.locked(); } + }, + { + selector: ':visible', + matches: function( ele ){ return ele.visible(); } + }, + { + selector: ':hidden', + matches: function( ele ){ return !ele.visible(); } + }, + { + selector: ':transparent', + matches: function( ele ){ return ele.transparent(); } + }, + { + selector: ':grabbed', + matches: function( ele ){ return ele.grabbed(); } + }, + { + selector: ':free', + matches: function( ele ){ return !ele.grabbed(); } + }, + { + selector: ':removed', + matches: function( ele ){ return ele.removed(); } + }, + { + selector: ':inside', + matches: function( ele ){ return !ele.removed(); } + }, + { + selector: ':grabbable', + matches: function( ele ){ return ele.grabbable(); } + }, + { + selector: ':ungrabbable', + matches: function( ele ){ return !ele.grabbable(); } + }, + { + selector: ':animated', + matches: function( ele ){ return ele.animated(); } + }, + { + selector: ':unanimated', + matches: function( ele ){ return !ele.animated(); } + }, + { + selector: ':parent', + matches: function( ele ){ return ele.isParent(); } + }, + { + selector: ':childless', + matches: function( ele ){ return ele.isChildless(); } + }, + { + selector: ':child', + matches: function( ele ){ return ele.isChild(); } + }, + { + selector: ':orphan', + matches: function( ele ){ return ele.isOrphan(); } + }, + { + selector: ':nonorphan', + matches: function( ele ){ return ele.isChild(); } + }, + { + selector: ':loop', + matches: function( ele ){ return ele.isLoop(); } + }, + { + selector: ':simple', + matches: function( ele ){ return ele.isSimple(); } + }, + { + selector: ':active', + matches: function( ele ){ return ele.active(); } + }, + { + selector: ':inactive', + matches: function( ele ){ return !ele.active(); } + }, + { + selector: ':backgrounding', + matches: function( ele ){ return ele.backgrounding(); } + }, + { + selector: ':nonbackgrounding', + matches: function( ele ){ return !ele.backgrounding(); } + } +].sort(function( a, b ){ // n.b. selectors that are starting substrings of others must have the longer ones first + return util.sort.descending( a.selector, b.selector ); +}); + +let stateSelectorMatches = function( sel, ele ){ + let lookup = stateSelectorMatches.lookup = stateSelectorMatches.lookup || (function(){ + let selToFn = {}; + let s; + + for( let i = 0; i < stateSelectors.length; i++ ){ + s = stateSelectors[i]; + + selToFn[ s.selector ] = s.matches; + } + + return selToFn; + })(); + + return lookup[ sel ]( ele ); +}; + +let stateSelectorRegex = '(' + stateSelectors.map(function( s ){ return s.selector; }).join('|') + ')'; + +module.exports = { stateSelectors, stateSelectorMatches, stateSelectorRegex }; diff --git a/node_modules/cytoscape/src/selector/tokens.js b/node_modules/cytoscape/src/selector/tokens.js new file mode 100644 index 000000000..f6922c095 --- /dev/null +++ b/node_modules/cytoscape/src/selector/tokens.js @@ -0,0 +1,46 @@ +const util = require('../util'); + +// tokens in the query language +const tokens = { + metaChar: '[\\!\\"\\#\\$\\%\\&\\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]', // chars we need to escape in let names, etc + comparatorOp: '=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=', // binary comparison op (used in data selectors) + boolOp: '\\?|\\!|\\^', // boolean (unary) operators (used in data selectors) + string: '"(?:\\\\"|[^"])*"' + '|' + "'(?:\\\\'|[^'])*'", // string literals (used in data selectors) -- doublequotes | singlequotes + number: util.regex.number, // number literal (used in data selectors) --- e.g. 0.1234, 1234, 12e123 + meta: 'degree|indegree|outdegree', // allowed metadata fields (i.e. allowed functions to use from Collection) + separator: '\\s*,\\s*', // queries are separated by commas, e.g. edge[foo = 'bar'], node.someClass + descendant: '\\s+', + child: '\\s+>\\s+', + subject: '\\$', + group: 'node|edge|\\*', + directedEdge: '\\s+->\\s+', + undirectedEdge: '\\s+<->\\s+' +}; +tokens.variable = '(?:[\\w-]|(?:\\\\' + tokens.metaChar + '))+'; // a variable name +tokens.value = tokens.string + '|' + tokens.number; // a value literal, either a string or number +tokens.className = tokens.variable; // a class name (follows variable conventions) +tokens.id = tokens.variable; // an element id (follows variable conventions) + +(function(){ + let ops, op, i; + + // add @ variants to comparatorOp + ops = tokens.comparatorOp.split( '|' ); + for( i = 0; i < ops.length; i++ ){ + op = ops[ i ]; + tokens.comparatorOp += '|@' + op; + } + + // add ! variants to comparatorOp + ops = tokens.comparatorOp.split( '|' ); + for( i = 0; i < ops.length; i++ ){ + op = ops[ i ]; + + if( op.indexOf( '!' ) >= 0 ){ continue; } // skip ops that explicitly contain ! + if( op === '=' ){ continue; } // skip = b/c != is explicitly defined + + tokens.comparatorOp += '|\\!' + op; + } +})(); + +module.exports = tokens; diff --git a/node_modules/cytoscape/src/set.js b/node_modules/cytoscape/src/set.js new file mode 100644 index 000000000..38c7510e6 --- /dev/null +++ b/node_modules/cytoscape/src/set.js @@ -0,0 +1,59 @@ +/* global Set */ + +const undef = typeof undefined; + +class ObjectSet { + constructor( arrayOrObjectSet ){ + this._obj = Object.create(null); + + if( arrayOrObjectSet != null ){ + let arr; + + if( arrayOrObjectSet.instanceString != null && arrayOrObjectSet.instanceString() === this.instanceString() ){ + arr = arrayOrObjectSet.toArray(); + } else { + arr = arrayOrObjectSet; + } + + for( let i = 0; i < arr.length; i++ ){ + this.add( arr[i] ); + } + } + } + + get size(){ + return this.toArray().length; + } + + instanceString(){ + return 'set'; + } + + add( val ){ + this._obj[ val ] = 1; + } + + delete( val ){ + this._obj[ val ] = 0; + } + + clear(){ + this._obj = Object.create(null); + } + + has( val ){ + return this._obj[ val ] === 1; + } + + toArray(){ + return Object.keys( this._obj ).filter( key => this.has(key) ); + } + + forEach( callback, thisArg ){ + return this.toArray().forEach( callback, thisArg ); + } +} + +// TODO use the stdlib Set in future... +// module.exports = typeof Set !== undef ? Set : ObjectSet; +module.exports = ObjectSet; diff --git a/node_modules/cytoscape/src/style/apply.js b/node_modules/cytoscape/src/style/apply.js new file mode 100644 index 000000000..bb80f92f9 --- /dev/null +++ b/node_modules/cytoscape/src/style/apply.js @@ -0,0 +1,671 @@ +let util = require('../util'); +let is = require('../is'); +let Promise = require('../promise'); + +let styfn = {}; + +// (potentially expensive calculation) +// apply the style to the element based on +// - its bypass +// - what selectors match it +styfn.apply = function( eles ){ + let self = this; + let _p = self._private; + let cy = _p.cy; + let updatedEles = cy.collection(); + + if( _p.newStyle ){ // clear style caches + _p.contextStyles = {}; + _p.propDiffs = {}; + + self.cleanElements( eles, true ); + } + + for( let ie = 0; ie < eles.length; ie++ ){ + let ele = eles[ ie ]; + + let cxtMeta = self.getContextMeta( ele ); + + if( cxtMeta.empty ){ + continue; + } else { + updatedEles.merge( ele ); + } + + let cxtStyle = self.getContextStyle( cxtMeta ); + let app = self.applyContextStyle( cxtMeta, cxtStyle, ele ); + + if( !_p.newStyle ){ + self.updateTransitions( ele, app.diffProps ); + } + + self.updateStyleHints( ele ); + + } // for elements + + _p.newStyle = false; + + return updatedEles; +}; + +styfn.getPropertiesDiff = function( oldCxtKey, newCxtKey ){ + let self = this; + let cache = self._private.propDiffs = self._private.propDiffs || {}; + let dualCxtKey = oldCxtKey + '-' + newCxtKey; + let cachedVal = cache[ dualCxtKey ]; + + if( cachedVal ){ + return cachedVal; + } + + let diffProps = []; + let addedProp = {}; + + for( let i = 0; i < self.length; i++ ){ + let cxt = self[ i ]; + let oldHasCxt = oldCxtKey[ i ] === 't'; + let newHasCxt = newCxtKey[ i ] === 't'; + let cxtHasDiffed = oldHasCxt !== newHasCxt; + let cxtHasMappedProps = cxt.mappedProperties.length > 0; + + if( cxtHasDiffed || cxtHasMappedProps ){ + let props; + + if( cxtHasDiffed && cxtHasMappedProps ){ + props = cxt.properties; // suffices b/c mappedProperties is a subset of properties + } else if( cxtHasDiffed ){ + props = cxt.properties; // need to check them all + } else if( cxtHasMappedProps ){ + props = cxt.mappedProperties; // only need to check mapped + } + + for( let j = 0; j < props.length; j++ ){ + let prop = props[ j ]; + let name = prop.name; + + // if a later context overrides this property, then the fact that this context has switched/diffed doesn't matter + // (semi expensive check since it makes this function O(n^2) on context length, but worth it since overall result + // is cached) + let laterCxtOverrides = false; + for( let k = i + 1; k < self.length; k++ ){ + let laterCxt = self[ k ]; + let hasLaterCxt = newCxtKey[ k ] === 't'; + + if( !hasLaterCxt ){ continue; } // can't override unless the context is active + + laterCxtOverrides = laterCxt.properties[ prop.name ] != null; + + if( laterCxtOverrides ){ break; } // exit early as long as one later context overrides + } + + if( !addedProp[ name ] && !laterCxtOverrides ){ + addedProp[ name ] = true; + diffProps.push( name ); + } + } // for props + } // if + + } // for contexts + + cache[ dualCxtKey ] = diffProps; + return diffProps; +}; + +styfn.getContextMeta = function( ele ){ + let self = this; + let cxtKey = ''; + let diffProps; + let prevKey = ele._private.styleCxtKey || ''; + + if( self._private.newStyle ){ + prevKey = ''; // since we need to apply all style if a fresh stylesheet + } + + // get the cxt key + for( let i = 0; i < self.length; i++ ){ + let context = self[ i ]; + let contextSelectorMatches = context.selector && context.selector.matches( ele ); // NB: context.selector may be null for 'core' + + if( contextSelectorMatches ){ + cxtKey += 't'; + } else { + cxtKey += 'f'; + } + } // for context + + diffProps = self.getPropertiesDiff( prevKey, cxtKey ); + + ele._private.styleCxtKey = cxtKey; + + return { + key: cxtKey, + diffPropNames: diffProps, + empty: diffProps.length === 0 + }; +}; + +// gets a computed ele style object based on matched contexts +styfn.getContextStyle = function( cxtMeta ){ + let cxtKey = cxtMeta.key; + let self = this; + let cxtStyles = this._private.contextStyles = this._private.contextStyles || {}; + + // if already computed style, returned cached copy + if( cxtStyles[ cxtKey ] ){ return cxtStyles[ cxtKey ]; } + + let style = { + _private: { + key: cxtKey + } + }; + + for( let i = 0; i < self.length; i++ ){ + let cxt = self[ i ]; + let hasCxt = cxtKey[ i ] === 't'; + + if( !hasCxt ){ continue; } + + for( let j = 0; j < cxt.properties.length; j++ ){ + let prop = cxt.properties[ j ]; + + style[ prop.name ] = prop; + } + } + + cxtStyles[ cxtKey ] = style; + return style; +}; + +styfn.applyContextStyle = function( cxtMeta, cxtStyle, ele ){ + let self = this; + let diffProps = cxtMeta.diffPropNames; + let retDiffProps = {}; + + for( let i = 0; i < diffProps.length; i++ ){ + let diffPropName = diffProps[ i ]; + let cxtProp = cxtStyle[ diffPropName ]; + let eleProp = ele.pstyle( diffPropName ); + + if( !cxtProp ){ // no context prop means delete + if( !eleProp ){ + continue; // no existing prop means nothing needs to be removed + // nb affects initial application on mapped values like control-point-distances + } else if( eleProp.bypass ){ + cxtProp = { name: diffPropName, deleteBypassed: true }; + } else { + cxtProp = { name: diffPropName, delete: true }; + } + } + + // save cycles when the context prop doesn't need to be applied + if( eleProp === cxtProp ){ continue; } + + let retDiffProp = retDiffProps[ diffPropName ] = { + prev: eleProp + }; + + self.applyParsedProperty( ele, cxtProp ); + + retDiffProp.next = ele.pstyle( diffPropName ); + + if( retDiffProp.next && retDiffProp.next.bypass ){ + retDiffProp.next = retDiffProp.next.bypassed; + } + } + + return { + diffProps: retDiffProps + }; +}; + +styfn.updateStyleHints = function(ele){ + let _p = ele._private; + let self = this; + + if( ele.removed() ){ return; } + + // set whether has pie or not; for greater efficiency + let hasPie = false; + if( _p.group === 'nodes' ){ + for( let i = 1; i <= self.pieBackgroundN; i++ ){ // 1..N + let size = ele.pstyle( 'pie-' + i + '-background-size' ).value; + + if( size > 0 ){ + hasPie = true; + break; + } + } + } + + _p.hasPie = hasPie; + + let transform = ele.pstyle( 'text-transform' ).strValue; + let content = ele.pstyle( 'label' ).strValue; + let srcContent = ele.pstyle( 'source-label' ).strValue; + let tgtContent = ele.pstyle( 'target-label' ).strValue; + let fStyle = ele.pstyle( 'font-style' ).strValue; + let size = ele.pstyle( 'font-size' ).pfValue + 'px'; + let family = ele.pstyle( 'font-family' ).strValue; + // let letiant = style['font-letiant'].strValue; + let weight = ele.pstyle( 'font-weight' ).strValue; + let valign = ele.pstyle( 'text-valign' ).strValue; + let halign = ele.pstyle( 'text-valign' ).strValue; + let oWidth = ele.pstyle( 'text-outline-width' ).pfValue; + let wrap = ele.pstyle( 'text-wrap' ).strValue; + let wrapW = ele.pstyle( 'text-max-width' ).pfValue; + let labelStyleKey = fStyle + '$' + size + '$' + family + '$' + weight + '$' + transform + '$' + valign + '$' + halign + '$' + oWidth + '$' + wrap + '$' + wrapW; + _p.labelStyleKey = labelStyleKey; + _p.sourceLabelKey = labelStyleKey + '$' + srcContent; + _p.targetLabelKey = labelStyleKey + '$' + tgtContent; + _p.labelKey = labelStyleKey + '$' + content; + _p.fontKey = fStyle + '$' + weight + '$' + size + '$' + family; + + _p.styleKey = Date.now(); +}; + +// apply a property to the style (for internal use) +// returns whether application was successful +// +// now, this function flattens the property, and here's how: +// +// for parsedProp:{ bypass: true, deleteBypass: true } +// no property is generated, instead the bypass property in the +// element's style is replaced by what's pointed to by the `bypassed` +// field in the bypass property (i.e. restoring the property the +// bypass was overriding) +// +// for parsedProp:{ mapped: truthy } +// the generated flattenedProp:{ mapping: prop } +// +// for parsedProp:{ bypass: true } +// the generated flattenedProp:{ bypassed: parsedProp } +styfn.applyParsedProperty = function( ele, parsedProp ){ + let self = this; + let prop = parsedProp; + let style = ele._private.style; + let fieldVal, flatProp; + let types = self.types; + let type = self.properties[ prop.name ].type; + let propIsBypass = prop.bypass; + let origProp = style[ prop.name ]; + let origPropIsBypass = origProp && origProp.bypass; + let _p = ele._private; + let flatPropMapping = 'mapping'; + + let checkZOrder = function(){ + self.checkZOrderTrigger( ele, prop.name, origProp ? origProp.value : null, prop.value ); + }; + + // edges connected to compound nodes can not be haystacks + if( + parsedProp.name === 'curve-style' + && parsedProp.value === 'haystack' + && ele.isEdge() + && ( ele.isLoop() || ele.source().isParent() || ele.target().isParent() ) + ){ + prop = parsedProp = this.parse( parsedProp.name, 'bezier', propIsBypass ); + } + + if( prop.delete ){ // delete the property and use the default value on falsey value + style[ prop.name ] = undefined; + + checkZOrder(); + + return true; + } + + if( prop.deleteBypassed ){ // delete the property that the + if( !origProp ){ + checkZOrder(); + + return true; // can't delete if no prop + + } else if( origProp.bypass ){ // delete bypassed + origProp.bypassed = undefined; + + checkZOrder(); + + return true; + + } else { + return false; // we're unsuccessful deleting the bypassed + } + } + + // check if we need to delete the current bypass + if( prop.deleteBypass ){ // then this property is just here to indicate we need to delete + if( !origProp ){ + checkZOrder(); + + return true; // property is already not defined + + } else if( origProp.bypass ){ // then replace the bypass property with the original + // because the bypassed property was already applied (and therefore parsed), we can just replace it (no reapplying necessary) + style[ prop.name ] = origProp.bypassed; + + checkZOrder(); + + return true; + + } else { + return false; // we're unsuccessful deleting the bypass + } + } + + let printMappingErr = function(){ + util.error( 'Do not assign mappings to elements without corresponding data (e.g. ele `' + ele.id() + '` for property `' + prop.name + '` with data field `' + prop.field + '`); try a `[' + prop.field + ']` selector to limit scope to elements with `' + prop.field + '` defined' ); + }; + + // put the property in the style objects + switch( prop.mapped ){ // flatten the property if mapped + case types.mapData: { + // flatten the field (e.g. data.foo.bar) + let fields = prop.field.split( '.' ); + let fieldVal = _p.data; + + for( let i = 0; i < fields.length && fieldVal; i++ ){ + let field = fields[ i ]; + fieldVal = fieldVal[ field ]; + } + + let percent; + if( !is.number( fieldVal ) ){ // then keep the mapping but assume 0% for now + percent = 0; + } else { + percent = (fieldVal - prop.fieldMin) / (prop.fieldMax - prop.fieldMin); + } + + // make sure to bound percent value + if( percent < 0 ){ + percent = 0; + } else if( percent > 1 ){ + percent = 1; + } + + if( type.color ){ + let r1 = prop.valueMin[0]; + let r2 = prop.valueMax[0]; + let g1 = prop.valueMin[1]; + let g2 = prop.valueMax[1]; + let b1 = prop.valueMin[2]; + let b2 = prop.valueMax[2]; + let a1 = prop.valueMin[3] == null ? 1 : prop.valueMin[3]; + let a2 = prop.valueMax[3] == null ? 1 : prop.valueMax[3]; + + let clr = [ + Math.round( r1 + (r2 - r1) * percent ), + Math.round( g1 + (g2 - g1) * percent ), + Math.round( b1 + (b2 - b1) * percent ), + Math.round( a1 + (a2 - a1) * percent ) + ]; + + flatProp = { // colours are simple, so just create the flat property instead of expensive string parsing + bypass: prop.bypass, // we're a bypass if the mapping property is a bypass + name: prop.name, + value: clr, + strValue: 'rgb(' + clr[0] + ', ' + clr[1] + ', ' + clr[2] + ')' + }; + + } else if( type.number ){ + let calcValue = prop.valueMin + (prop.valueMax - prop.valueMin) * percent; + flatProp = this.parse( prop.name, calcValue, prop.bypass, flatPropMapping ); + + } else { + return false; // can only map to colours and numbers + } + + if( !flatProp ){ // if we can't flatten the property, then use the origProp so we still keep the mapping itself + flatProp = this.parse( prop.name, origProp.strValue, prop.bypass, flatPropMapping ); + } + + if( !flatProp ){ printMappingErr(); } + flatProp.mapping = prop; // keep a reference to the mapping + prop = flatProp; // the flattened (mapped) property is the one we want + + break; + } + + // direct mapping + case types.data: { + // flatten the field (e.g. data.foo.bar) + let fields = prop.field.split( '.' ); + let fieldVal = _p.data; + + if( fieldVal ){ for( let i = 0; i < fields.length; i++ ){ + let field = fields[ i ]; + fieldVal = fieldVal[ field ]; + } } + + flatProp = this.parse( prop.name, fieldVal, prop.bypass, flatPropMapping ); + + if( !flatProp ){ // if we can't flatten the property, then use the origProp so we still keep the mapping itself + let flatPropVal = origProp ? origProp.strValue : ''; + + flatProp = this.parse( prop.name, flatPropVal, prop.bypass, flatPropMapping ); + } + + if( !flatProp ){ printMappingErr(); } + flatProp.mapping = prop; // keep a reference to the mapping + prop = flatProp; // the flattened (mapped) property is the one we want + + break; + } + + case types.fn: { + let fn = prop.value; + let fnRetVal = fn( ele ); + + flatProp = this.parse( prop.name, fnRetVal, prop.bypass, flatPropMapping ); + flatProp.mapping = prop; // keep a reference to the mapping + prop = flatProp; // the flattened (mapped) property is the one we want + + break; + } + + case undefined: + break; // just set the property + + default: + return false; // not a valid mapping + } + + // if the property is a bypass property, then link the resultant property to the original one + if( propIsBypass ){ + if( origPropIsBypass ){ // then this bypass overrides the existing one + prop.bypassed = origProp.bypassed; // steal bypassed prop from old bypass + } else { // then link the orig prop to the new bypass + prop.bypassed = origProp; + } + + style[ prop.name ] = prop; // and set + + } else { // prop is not bypass + if( origPropIsBypass ){ // then keep the orig prop (since it's a bypass) and link to the new prop + origProp.bypassed = prop; + } else { // then just replace the old prop with the new one + style[ prop.name ] = prop; + } + } + + checkZOrder(); + + return true; +}; + +styfn.cleanElements = function( eles, keepBypasses ){ + let self = this; + let props = self.properties; + + for( let i = 0; i < eles.length; i++ ){ + let ele = eles[i]; + + if( !keepBypasses ){ + ele._private.style = {}; + } else { + let style = ele._private.style; + + for( let j = 0; j < props.length; j++ ){ + let prop = props[j]; + let eleProp = style[ prop.name ]; + + if( eleProp ){ + if( eleProp.bypass ){ + eleProp.bypassed = null; + } else { + style[ prop.name ] = null; + } + } + } + } + } +}; + +// updates the visual style for all elements (useful for manual style modification after init) +styfn.update = function(){ + let cy = this._private.cy; + let eles = cy.mutableElements(); + + eles.updateStyle(); +}; + +// just update the functional properties (i.e. mappings) in the elements' +// styles (less expensive than recalculation) +styfn.updateMappers = function( eles ){ + let self = this; + let cy = this._private.cy; + let updatedEles = cy.collection(); + + for( let i = 0; i < eles.length; i++ ){ // for each ele + let ele = eles[ i ]; + let style = ele._private.style; + let updatedEle = false; + + for( let j = 0; j < self.properties.length; j++ ){ // for each prop + let prop = self.properties[ j ]; + let propInStyle = style[ prop.name ]; + + if( propInStyle && propInStyle.mapping ){ + let mapping = propInStyle.mapping; + + this.applyParsedProperty( ele, mapping ); // reapply the mapping property + + updatedEle = true; + } + } + + if( updatedEle ){ + this.updateStyleHints( ele ); + + updatedEles.merge( ele ); + } + } + + return updatedEles; +}; + +// diffProps : { name => { prev, next } } +styfn.updateTransitions = function( ele, diffProps, isBypass ){ + let self = this; + let _p = ele._private; + let props = ele.pstyle( 'transition-property' ).value; + let duration = ele.pstyle( 'transition-duration' ).pfValue; + let delay = ele.pstyle( 'transition-delay' ).pfValue; + + if( props.length > 0 && duration > 0 ){ + + let style = {}; + + // build up the style to animate towards + let anyPrev = false; + for( let i = 0; i < props.length; i++ ){ + let prop = props[ i ]; + let styProp = ele.pstyle( prop ); + let diffProp = diffProps[ prop ]; + + if( !diffProp ){ continue; } + + let prevProp = diffProp.prev; + let fromProp = prevProp; + let toProp = diffProp.next != null ? diffProp.next : styProp; + let diff = false; + let initVal; + let initDt = 0.000001; // delta time % value for initVal (allows animating out of init zero opacity) + + if( !fromProp ){ continue; } + + // consider px values + if( is.number( fromProp.pfValue ) && is.number( toProp.pfValue ) ){ + diff = toProp.pfValue - fromProp.pfValue; // nonzero is truthy + initVal = fromProp.pfValue + initDt * diff; + + // consider numerical values + } else if( is.number( fromProp.value ) && is.number( toProp.value ) ){ + diff = toProp.value - fromProp.value; // nonzero is truthy + initVal = fromProp.value + initDt * diff; + + // consider colour values + } else if( is.array( fromProp.value ) && is.array( toProp.value ) ){ + diff = fromProp.value[0] !== toProp.value[0] + || fromProp.value[1] !== toProp.value[1] + || fromProp.value[2] !== toProp.value[2] + ; + + initVal = fromProp.strValue; + } + + // the previous value is good for an animation only if it's different + if( diff ){ + style[ prop ] = toProp.strValue; // to val + this.applyBypass( ele, prop, initVal ); // from val + anyPrev = true; + } + + } // end if props allow ani + + // can't transition if there's nothing previous to transition from + if( !anyPrev ){ return; } + + _p.transitioning = true; + + ( new Promise(function( resolve ){ + if( delay > 0 ){ + ele.delayAnimation( delay ).play().promise().then( resolve ); + } else { + resolve(); + } + }) ).then(function(){ + return ele.animation( { + style: style, + duration: duration, + easing: ele.pstyle( 'transition-timing-function' ).value, + queue: false + } ).play().promise(); + }).then(function(){ + // if( !isBypass ){ + self.removeBypasses( ele, props ); + ele.emitAndNotify('style'); + // } + + _p.transitioning = false; + }); + + } else if( _p.transitioning ){ + this.removeBypasses( ele, props ); + ele.emitAndNotify('style'); + + _p.transitioning = false; + } +}; + +styfn.checkZOrderTrigger = function( ele, name, fromValue, toValue ){ + let prop = this.properties[ name ]; + + if( prop.triggersZOrder != null && ( fromValue == null || prop.triggersZOrder( fromValue, toValue ) ) ){ + this._private.cy.notify({ + type: 'zorder', + eles: ele + }); + } +}; + +module.exports = styfn; diff --git a/node_modules/cytoscape/src/style/bypass.js b/node_modules/cytoscape/src/style/bypass.js new file mode 100644 index 000000000..70a827936 --- /dev/null +++ b/node_modules/cytoscape/src/style/bypass.js @@ -0,0 +1,174 @@ +let is = require( '../is' ); +let util = require( '../util' ); + +let styfn = {}; + +// bypasses are applied to an existing style on an element, and just tacked on temporarily +// returns true iff application was successful for at least 1 specified property +styfn.applyBypass = function( eles, name, value, updateTransitions ){ + let self = this; + let props = []; + let isBypass = true; + + // put all the properties (can specify one or many) in an array after parsing them + if( name === '*' || name === '**' ){ // apply to all property names + + if( value !== undefined ){ + for( let i = 0; i < self.properties.length; i++ ){ + let prop = self.properties[ i ]; + let name = prop.name; + + let parsedProp = this.parse( name, value, true ); + + if( parsedProp ){ + props.push( parsedProp ); + } + } + } + + } else if( is.string( name ) ){ // then parse the single property + let parsedProp = this.parse( name, value, true ); + + if( parsedProp ){ + props.push( parsedProp ); + } + } else if( is.plainObject( name ) ){ // then parse each property + let specifiedProps = name; + updateTransitions = value; + + let names = Object.keys( specifiedProps ); + + for( let i = 0; i < names.length; i++ ){ + let name = names[i]; + let prop = self.properties[ name ]; + let value = specifiedProps[ name ]; + + if( value === undefined ){ // try camel case name too + value = specifiedProps[ util.dash2camel( name ) ]; + } + + if( value !== undefined ){ + let parsedProp = this.parse( name, value, true ); + + if( parsedProp ){ + props.push( parsedProp ); + } + } + } + } else { // can't do anything without well defined properties + return false; + } + + // we've failed if there are no valid properties + if( props.length === 0 ){ return false; } + + // now, apply the bypass properties on the elements + let ret = false; // return true if at least one succesful bypass applied + for( let i = 0; i < eles.length; i++ ){ // for each ele + let ele = eles[ i ]; + let diffProps = {}; + let diffProp; + + for( let j = 0; j < props.length; j++ ){ // for each prop + let prop = props[ j ]; + + if( updateTransitions ){ + let prevProp = ele.pstyle( prop.name ); + diffProp = diffProps[ prop.name ] = { prev: prevProp }; + } + + ret = this.applyParsedProperty( ele, prop ) || ret; + + if( updateTransitions ){ + diffProp.next = ele.pstyle( prop.name ); + } + + } // for props + + if( ret ){ + this.updateStyleHints( ele ); + } + + if( updateTransitions ){ + this.updateTransitions( ele, diffProps, isBypass ); + } + } // for eles + + return ret; +}; + +// only useful in specific cases like animation +styfn.overrideBypass = function( eles, name, value ){ + name = util.camel2dash( name ); + + for( let i = 0; i < eles.length; i++ ){ + let ele = eles[ i ]; + let prop = ele._private.style[ name ]; + let type = this.properties[ name ].type; + let isColor = type.color; + let isMulti = type.mutiple; + + if( !prop || !prop.bypass ){ // need a bypass if one doesn't exist + this.applyBypass( ele, name, value ); + continue; + } + + let oldValue = prop.pfValue != null ? prop.pfValue : prop.value; + + prop.value = value; + + if( prop.pfValue != null ){ + prop.pfValue = value; + } + + if( isColor ){ + prop.strValue = 'rgb(' + value.join( ',' ) + ')'; + } else if( isMulti ){ + prop.strValue = value.join( ' ' ); + } else { + prop.strValue = '' + value; + } + + this.checkZOrderTrigger( ele, name, oldValue, value ); + } +}; + +styfn.removeAllBypasses = function( eles, updateTransitions ){ + return this.removeBypasses( eles, this.propertyNames, updateTransitions ); +}; + +styfn.removeBypasses = function( eles, props, updateTransitions ){ + let isBypass = true; + + for( let j = 0; j < eles.length; j++ ){ + let ele = eles[ j ]; + let diffProps = {}; + + for( let i = 0; i < props.length; i++ ){ + let name = props[ i ]; + let prop = this.properties[ name ]; + let prevProp = ele.pstyle( prop.name ); + + if( !prevProp || !prevProp.bypass ){ + // if a bypass doesn't exist for the prop, nothing needs to be removed + continue; + } + + let value = ''; // empty => remove bypass + let parsedProp = this.parse( name, value, true ); + let diffProp = diffProps[ prop.name ] = { prev: prevProp }; + + this.applyParsedProperty( ele, parsedProp ); + + diffProp.next = ele.pstyle( prop.name ); + } // for props + + this.updateStyleHints( ele ); + + if( updateTransitions ){ + this.updateTransitions( ele, diffProps, isBypass ); + } + } // for eles +}; + +module.exports = styfn; diff --git a/node_modules/cytoscape/src/style/container.js b/node_modules/cytoscape/src/style/container.js new file mode 100644 index 000000000..bf21eb05d --- /dev/null +++ b/node_modules/cytoscape/src/style/container.js @@ -0,0 +1,26 @@ +let window = require( '../window' ); + +let styfn = {}; + +// gets what an em size corresponds to in pixels relative to a dom element +styfn.getEmSizeInPixels = function(){ + let px = this.containerCss( 'font-size' ); + + if( px != null ){ + return parseFloat( px ); + } else { + return 1; // for headless + } +}; + +// gets css property from the core container +styfn.containerCss = function( propName ){ + let cy = this._private.cy; + let domElement = cy.container(); + + if( window && domElement && window.getComputedStyle ){ + return window.getComputedStyle( domElement ).getPropertyValue( propName ); + } +}; + +module.exports = styfn; diff --git a/node_modules/cytoscape/src/style/get-for-ele.js b/node_modules/cytoscape/src/style/get-for-ele.js new file mode 100644 index 000000000..d9bbcbab8 --- /dev/null +++ b/node_modules/cytoscape/src/style/get-for-ele.js @@ -0,0 +1,119 @@ +let util = require( '../util' ); +let is = require( '../is' ); + +let styfn = {}; + +// gets the rendered style for an element +styfn.getRenderedStyle = function( ele, prop ){ + if( prop ){ + return this.getStylePropertyValue( ele, prop, true ); + } else { + return this.getRawStyle( ele, true ); + } +}; + +// gets the raw style for an element +styfn.getRawStyle = function( ele, isRenderedVal ){ + let self = this; + + ele = ele[0]; // insure it's an element + + if( ele ){ + let rstyle = {}; + + for( let i = 0; i < self.properties.length; i++ ){ + let prop = self.properties[ i ]; + let val = self.getStylePropertyValue( ele, prop.name, isRenderedVal ); + + if( val != null ){ + rstyle[ prop.name ] = val; + rstyle[ util.dash2camel( prop.name ) ] = val; + } + } + + return rstyle; + } +}; + +styfn.getIndexedStyle = function( ele, property, subproperty, index ){ + let pstyle = ele.pstyle( property )[subproperty][index]; + return pstyle != null ? pstyle : ele.cy().style().getDefaultProperty( property )[subproperty][0]; +}; + +styfn.getStylePropertyValue = function( ele, propName, isRenderedVal ){ + let self = this; + + ele = ele[0]; // insure it's an element + + if( ele ){ + let prop = self.properties[ propName ]; + + if( prop.alias ){ + prop = prop.pointsTo; + } + + let type = prop.type; + let styleProp = ele.pstyle( prop.name ); + let zoom = ele.cy().zoom(); + + if( styleProp ){ + let units = styleProp.units ? type.implicitUnits || 'px' : null; + let val = units ? [].concat( styleProp.pfValue ).map( function( pfValue ){ + return ( pfValue * (isRenderedVal ? zoom : 1) ) + units; + } ).join( ' ' ) : styleProp.strValue; + + return val; + } + } +}; + +styfn.getAnimationStartStyle = function( ele, aniProps ){ + let rstyle = {}; + + for( let i = 0; i < aniProps.length; i++ ){ + let aniProp = aniProps[ i ]; + let name = aniProp.name; + + let styleProp = ele.pstyle( name ); + + if( styleProp !== undefined ){ // then make a prop of it + if( is.plainObject( styleProp ) ){ + styleProp = this.parse( name, styleProp.strValue ); + } else { + styleProp = this.parse( name, styleProp ); + } + } + + if( styleProp ){ + rstyle[ name ] = styleProp; + } + } + + return rstyle; +}; + +styfn.getPropsList = function( propsObj ){ + let self = this; + let rstyle = []; + let style = propsObj; + let props = self.properties; + + if( style ){ + let names = Object.keys( style ); + + for( let i = 0; i < names.length; i++ ){ + let name = names[i]; + let val = style[ name ]; + let prop = props[ name ] || props[ util.camel2dash( name ) ]; + let styleProp = this.parse( prop.name, val ); + + if( styleProp ){ + rstyle.push( styleProp ); + } + } + } + + return rstyle; +}; + +module.exports = styfn; diff --git a/node_modules/cytoscape/src/style/index.js b/node_modules/cytoscape/src/style/index.js new file mode 100644 index 000000000..8a4605da6 --- /dev/null +++ b/node_modules/cytoscape/src/style/index.js @@ -0,0 +1,181 @@ +let is = require( '../is' ); +let util = require( '../util' ); +let Selector = require( '../selector' ); + +let Style = function( cy ){ + + if( !(this instanceof Style) ){ + return new Style( cy ); + } + + if( !is.core( cy ) ){ + util.error( 'A style must have a core reference' ); + return; + } + + this._private = { + cy: cy, + coreStyle: {} + }; + + this.length = 0; + + this.resetToDefault(); +}; + +let styfn = Style.prototype; + +styfn.instanceString = function(){ + return 'style'; +}; + +// remove all contexts +styfn.clear = function(){ + for( let i = 0; i < this.length; i++ ){ + this[ i ] = undefined; + } + this.length = 0; + + let _p = this._private; + + _p.newStyle = true; + + return this; // chaining +}; + +styfn.resetToDefault = function(){ + this.clear(); + this.addDefaultStylesheet(); + + return this; +}; + +// builds a style object for the 'core' selector +styfn.core = function(){ + return this._private.coreStyle; +}; + +// create a new context from the specified selector string and switch to that context +styfn.selector = function( selectorStr ){ + // 'core' is a special case and does not need a selector + let selector = selectorStr === 'core' ? null : new Selector( selectorStr ); + + let i = this.length++; // new context means new index + this[ i ] = { + selector: selector, + properties: [], + mappedProperties: [], + index: i + }; + + return this; // chaining +}; + +// add one or many css rules to the current context +styfn.css = function(){ + let self = this; + let args = arguments; + + switch( args.length ){ + case 1: + let map = args[0]; + + for( let i = 0; i < self.properties.length; i++ ){ + let prop = self.properties[ i ]; + let mapVal = map[ prop.name ]; + + if( mapVal === undefined ){ + mapVal = map[ util.dash2camel( prop.name ) ]; + } + + if( mapVal !== undefined ){ + this.cssRule( prop.name, mapVal ); + } + } + + break; + + case 2: + this.cssRule( args[0], args[1] ); + break; + + default: + break; // do nothing if args are invalid + } + + return this; // chaining +}; +styfn.style = styfn.css; + +// add a single css rule to the current context +styfn.cssRule = function( name, value ){ + // name-value pair + let property = this.parse( name, value ); + + // add property to current context if valid + if( property ){ + let i = this.length - 1; + this[ i ].properties.push( property ); + this[ i ].properties[ property.name ] = property; // allow access by name as well + + if( property.name.match( /pie-(\d+)-background-size/ ) && property.value ){ + this._private.hasPie = true; + } + + if( property.mapped ){ + this[ i ].mappedProperties.push( property ); + } + + // add to core style if necessary + let currentSelectorIsCore = !this[ i ].selector; + if( currentSelectorIsCore ){ + this._private.coreStyle[ property.name ] = property; + } + } + + return this; // chaining +}; + +styfn.append = function( style ){ + if( is.stylesheet( style ) ){ + style.appendToStyle( this ); + } else if( is.array( style ) ){ + this.appendFromJson( style ); + } else if( is.string( style ) ){ + this.appendFromString( style ); + } // you probably wouldn't want to append a Style, since you'd duplicate the default parts + + return this; +}; + +// static function +Style.fromJson = function( cy, json ){ + let style = new Style( cy ); + + style.fromJson( json ); + + return style; +}; + +Style.fromString = function( cy, string ){ + return new Style( cy ).fromString( string ); +}; + +[ + require( './apply' ), + require( './bypass' ), + require( './container' ), + require( './get-for-ele' ), + require( './json' ), + require( './string-sheet' ), + require( './properties' ), + require( './parse' ) +].forEach( function( props ){ + util.extend( styfn, props ); +} ); + + +Style.types = styfn.types; +Style.properties = styfn.properties; + +module.exports = Style; diff --git a/node_modules/cytoscape/src/style/json.js b/node_modules/cytoscape/src/style/json.js new file mode 100644 index 000000000..f269dd457 --- /dev/null +++ b/node_modules/cytoscape/src/style/json.js @@ -0,0 +1,59 @@ +let styfn = {}; + +styfn.appendFromJson = function( json ){ + let style = this; + + for( let i = 0; i < json.length; i++ ){ + let context = json[ i ]; + let selector = context.selector; + let props = context.style || context.css; + let names = Object.keys( props ); + + style.selector( selector ); // apply selector + + for( let j = 0; j < names.length; j++ ){ + let name = names[j]; + let value = props[ name ]; + + style.css( name, value ); // apply property + } + } + + return style; +}; + +// accessible cy.style() function +styfn.fromJson = function( json ){ + let style = this; + + style.resetToDefault(); + style.appendFromJson( json ); + + return style; +}; + +// get json from cy.style() api +styfn.json = function(){ + let json = []; + + for( let i = this.defaultLength; i < this.length; i++ ){ + let cxt = this[ i ]; + let selector = cxt.selector; + let props = cxt.properties; + let css = {}; + + for( let j = 0; j < props.length; j++ ){ + let prop = props[ j ]; + css[ prop.name ] = prop.strValue; + } + + json.push( { + selector: !selector ? 'core' : selector.toString(), + style: css + } ); + } + + return json; +}; + +module.exports = styfn; diff --git a/node_modules/cytoscape/src/style/parse.js b/node_modules/cytoscape/src/style/parse.js new file mode 100644 index 000000000..01b88dafb --- /dev/null +++ b/node_modules/cytoscape/src/style/parse.js @@ -0,0 +1,423 @@ +let util = require( '../util' ); +let is = require( '../is' ); +let math = require( '../math' ); + +let styfn = {}; + +// a caching layer for property parsing +styfn.parse = function( name, value, propIsBypass, propIsFlat ){ + let self = this; + + // function values can't be cached in all cases, and there isn't much benefit of caching them anyway + if( is.fn( value ) ){ + return self.parseImplWarn( name, value, propIsBypass, propIsFlat ); + } + + let flatKey = ( propIsFlat === 'mapping' || propIsFlat === true || propIsFlat === false || propIsFlat == null ) ? 'dontcare' : propIsFlat; + let argHash = [ name, value, propIsBypass, flatKey ].join( '$' ); + let propCache = self.propCache = self.propCache || {}; + let ret; + + if( !(ret = propCache[ argHash ]) ){ + ret = propCache[ argHash ] = self.parseImplWarn( name, value, propIsBypass, propIsFlat ); + } + + // - bypasses can't be shared b/c the value can be changed by animations or otherwise overridden + // - mappings can't be shared b/c mappings are per-element + if( propIsBypass || propIsFlat === 'mapping' ){ + // need a copy since props are mutated later in their lifecycles + ret = util.copy( ret ); + + if( ret ){ + ret.value = util.copy( ret.value ); // because it could be an array, e.g. colour + } + } + + return ret; +}; + +styfn.parseImplWarn = function( name, value, propIsBypass, propIsFlat ){ + let prop = this.parseImpl( name, value, propIsBypass, propIsFlat ); + + if( !prop && value != null ){ + util.error('The style property `%s: %s` is invalid', name, value); + } + + return prop; +}; + +// parse a property; return null on invalid; return parsed property otherwise +// fields : +// - name : the name of the property +// - value : the parsed, native-typed value of the property +// - strValue : a string value that represents the property value in valid css +// - bypass : true iff the property is a bypass property +styfn.parseImpl = function( name, value, propIsBypass, propIsFlat ){ + let self = this; + + name = util.camel2dash( name ); // make sure the property name is in dash form (e.g. 'property-name' not 'propertyName') + + let property = self.properties[ name ]; + let passedValue = value; + let types = self.types; + + if( !property ){ return null; } // return null on property of unknown name + if( value === undefined ){ return null; } // can't assign undefined + + // the property may be an alias + if( property.alias ){ + property = property.pointsTo; + name = property.name; + } + + let valueIsString = is.string( value ); + if( valueIsString ){ // trim the value to make parsing easier + value = value.trim(); + } + + let type = property.type; + if( !type ){ return null; } // no type, no luck + + // check if bypass is null or empty string (i.e. indication to delete bypass property) + if( propIsBypass && (value === '' || value === null) ){ + return { + name: name, + value: value, + bypass: true, + deleteBypass: true + }; + } + + // check if value is a function used as a mapper + if( is.fn( value ) ){ + return { + name: name, + value: value, + strValue: 'fn', + mapped: types.fn, + bypass: propIsBypass + }; + } + + // check if value is mapped + let data, mapData; + if( !valueIsString || propIsFlat ){ + // then don't bother to do the expensive regex checks + + } else if( data = new RegExp( types.data.regex ).exec( value ) ){ + if( propIsBypass ){ return false; } // mappers not allowed in bypass + + let mapped = types.data; + + return { + name: name, + value: data, + strValue: '' + value, + mapped: mapped, + field: data[1], + bypass: propIsBypass + }; + + } else if( mapData = new RegExp( types.mapData.regex ).exec( value ) ){ + if( propIsBypass ){ return false; } // mappers not allowed in bypass + if( type.multiple ){ return false; } // impossible to map to num + + let mapped = types.mapData; + + // we can map only if the type is a colour or a number + if( !(type.color || type.number) ){ return false; } + + let valueMin = this.parse( name, mapData[4] ); // parse to validate + if( !valueMin || valueMin.mapped ){ return false; } // can't be invalid or mapped + + let valueMax = this.parse( name, mapData[5] ); // parse to validate + if( !valueMax || valueMax.mapped ){ return false; } // can't be invalid or mapped + + // check if valueMin and valueMax are the same + if( valueMin.value === valueMax.value ){ + return false; // can't make much of a mapper without a range + + } else if( type.color ){ + let c1 = valueMin.value; + let c2 = valueMax.value; + + let same = c1[0] === c2[0] // red + && c1[1] === c2[1] // green + && c1[2] === c2[2] // blue + && ( // optional alpha + c1[3] === c2[3] // same alpha outright + || ( + (c1[3] == null || c1[3] === 1) // full opacity for colour 1? + && + (c2[3] == null || c2[3] === 1) // full opacity for colour 2? + ) + ) + ; + + if( same ){ return false; } // can't make a mapper without a range + } + + return { + name: name, + value: mapData, + strValue: '' + value, + mapped: mapped, + field: mapData[1], + fieldMin: parseFloat( mapData[2] ), // min & max are numeric + fieldMax: parseFloat( mapData[3] ), + valueMin: valueMin.value, + valueMax: valueMax.value, + bypass: propIsBypass + }; + } + + if( type.multiple && propIsFlat !== 'multiple' ){ + let vals; + + if( valueIsString ){ + vals = value.split( /\s+/ ); + } else if( is.array( value ) ){ + vals = value; + } else { + vals = [ value ]; + } + + if( type.evenMultiple && vals.length % 2 !== 0 ){ return null; } + + let valArr = []; + let unitsArr = []; + let pfValArr = []; + let hasEnum = false; + + for( let i = 0; i < vals.length; i++ ){ + let p = self.parse( name, vals[i], propIsBypass, 'multiple' ); + + hasEnum = hasEnum || is.string( p.value ); + + valArr.push( p.value ); + pfValArr.push( p.pfValue != null ? p.pfValue : p.value ); + unitsArr.push( p.units ); + } + + if( type.validate && !type.validate( valArr, unitsArr ) ){ + return null; + } + + if( type.singleEnum && hasEnum ){ + if( valArr.length === 1 && is.string( valArr[0] ) ){ + return { + name: name, + value: valArr[0], + strValue: valArr[0], + bypass: propIsBypass + }; + } else { + return null; + } + } + + return { + name: name, + value: valArr, + pfValue: pfValArr, + strValue: valArr.map( (val, i) => val + (unitsArr[i] || '') ).join(' '), + bypass: propIsBypass, + units: unitsArr + }; + } + + // several types also allow enums + let checkEnums = function(){ + for( let i = 0; i < type.enums.length; i++ ){ + let en = type.enums[ i ]; + + if( en === value ){ + return { + name: name, + value: value, + strValue: '' + value, + bypass: propIsBypass + }; + } + } + + return null; + }; + + // check the type and return the appropriate object + if( type.number ){ + let units; + let implicitUnits = 'px'; // not set => px + + if( type.units ){ // use specified units if set + units = type.units; + } + + if( type.implicitUnits ){ + implicitUnits = type.implicitUnits; + } + + if( !type.unitless ){ + if( valueIsString ){ + let unitsRegex = 'px|em' + (type.allowPercent ? '|\\%' : ''); + if( units ){ unitsRegex = units; } // only allow explicit units if so set + let match = value.match( '^(' + util.regex.number + ')(' + unitsRegex + ')?' + '$' ); + + if( match ){ + value = match[1]; + units = match[2] || implicitUnits; + } + + } else if( !units || type.implicitUnits ){ + units = implicitUnits; // implicitly px if unspecified + } + } + + value = parseFloat( value ); + + // if not a number and enums not allowed, then the value is invalid + if( isNaN( value ) && type.enums === undefined ){ + return null; + } + + // check if this number type also accepts special keywords in place of numbers + // (i.e. `left`, `auto`, etc) + if( isNaN( value ) && type.enums !== undefined ){ + value = passedValue; + + return checkEnums(); + } + + // check if value must be an integer + if( type.integer && !is.integer( value ) ){ + return null; + } + + // check value is within range + if( ( type.min !== undefined && ( value < type.min || (type.strictMin && value === type.min) ) ) + || ( type.max !== undefined && ( value > type.max || (type.strictMax && value === type.max) ) ) + ){ + return null; + } + + let ret = { + name: name, + value: value, + strValue: '' + value + (units ? units : ''), + units: units, + bypass: propIsBypass + }; + + // normalise value in pixels + if( type.unitless || (units !== 'px' && units !== 'em') ){ + ret.pfValue = value; + } else { + ret.pfValue = ( units === 'px' || !units ? (value) : (this.getEmSizeInPixels() * value) ); + } + + // normalise value in ms + if( units === 'ms' || units === 's' ){ + ret.pfValue = units === 'ms' ? value : 1000 * value; + } + + // normalise value in rad + if( units === 'deg' || units === 'rad' ){ + ret.pfValue = units === 'rad' ? value : math.deg2rad( value ); + } + + // normalize value in % + if( units === '%' ){ + ret.pfValue = value / 100; + } + + return ret; + + } else if( type.propList ){ + + let props = []; + let propsStr = '' + value; + + if( propsStr === 'none' ){ + // leave empty + + } else { // go over each prop + + let propsSplit = propsStr.split( ',' ); + for( let i = 0; i < propsSplit.length; i++ ){ + let propName = propsSplit[ i ].trim(); + + if( self.properties[ propName ] ){ + props.push( propName ); + } + } + + if( props.length === 0 ){ return null; } + } + + return { + name: name, + value: props, + strValue: props.length === 0 ? 'none' : props.join( ', ' ), + bypass: propIsBypass + }; + + } else if( type.color ){ + let tuple = util.color2tuple( value ); + + if( !tuple ){ return null; } + + return { + name: name, + value: tuple, + pfValue: tuple, + strValue: '' + value, + bypass: propIsBypass + }; + + } else if( type.regex || type.regexes ){ + + // first check enums + if( type.enums ){ + let enumProp = checkEnums(); + + if( enumProp ){ return enumProp; } + } + + let regexes = type.regexes ? type.regexes : [ type.regex ]; + + for( let i = 0; i < regexes.length; i++ ){ + let regex = new RegExp( regexes[ i ] ); // make a regex from the type string + let m = regex.exec( value ); + + if( m ){ // regex matches + return { + name: name, + value: type.singleRegexMatchValue ? m[1] : m, + strValue: '' + value, + bypass: propIsBypass + }; + + } + } + + return null; // didn't match any + + } else if( type.string ){ + // just return + return { + name: name, + value: '' + value, + strValue: '' + value, + bypass: propIsBypass + }; + + } else if( type.enums ){ // check enums last because it's a combo type in others + return checkEnums(); + + } else { + return null; // not a type we can handle + } + +}; + +module.exports = styfn; diff --git a/node_modules/cytoscape/src/style/properties.js b/node_modules/cytoscape/src/style/properties.js new file mode 100644 index 000000000..86137ad7e --- /dev/null +++ b/node_modules/cytoscape/src/style/properties.js @@ -0,0 +1,578 @@ +let util = require( '../util' ); +let is = require( '../is' ); + +let styfn = {}; + +(function(){ + let number = util.regex.number; + let rgba = util.regex.rgbaNoBackRefs; + let hsla = util.regex.hslaNoBackRefs; + let hex3 = util.regex.hex3; + let hex6 = util.regex.hex6; + let data = function( prefix ){ return '^' + prefix + '\\s*\\(\\s*([\\w\\.]+)\\s*\\)$'; }; + let mapData = function( prefix ){ + let mapArg = number + '|\\w+|' + rgba + '|' + hsla + '|' + hex3 + '|' + hex6; + return '^' + prefix + '\\s*\\(([\\w\\.]+)\\s*\\,\\s*(' + number + ')\\s*\\,\\s*(' + number + ')\\s*,\\s*(' + mapArg + ')\\s*\\,\\s*(' + mapArg + ')\\)$'; + }; + let urlRegexes = [ + '^url\\s*\\(\\s*[\'"]?(.+?)[\'"]?\\s*\\)$', + '^(none)$', + '^(.+)$' + ]; + + // each visual style property has a type and needs to be validated according to it + styfn.types = { + time: { number: true, min: 0, units: 's|ms', implicitUnits: 'ms' }, + percent: { number: true, min: 0, max: 100, units: '%', implicitUnits: '%' }, + zeroOneNumber: { number: true, min: 0, max: 1, unitless: true }, + zeroOneNumbers: { number: true, min: 0, max: 1, unitless: true, multiple: true }, + nOneOneNumber: { number: true, min: -1, max: 1, unitless: true }, + nonNegativeInt: { number: true, min: 0, integer: true, unitless: true }, + position: { enums: [ 'parent', 'origin' ] }, + nodeSize: { number: true, min: 0, enums: [ 'label' ] }, + number: { number: true, unitless: true }, + numbers: { number: true, unitless: true, multiple: true }, + positiveNumber: { number: true, unitless: true, min: 0, strictMin: true }, + size: { number: true, min: 0 }, + bidirectionalSize: { number: true }, // allows negative + bidirectionalSizes: { number: true, multiple: true }, // allows negative + sizeMaybePercent: { number: true, min: 0, allowPercent: true }, + paddingRelativeTo: { enums: [ 'width', 'height', 'average', 'min', 'max' ] }, + bgWH: { number: true, min: 0, allowPercent: true, enums: [ 'auto' ], multiple: true }, + bgPos: { number: true, allowPercent: true, multiple: true }, + bgRelativeTo: { enums: [ 'inner', 'include-padding' ], multiple: true }, + bgRepeat: { enums: [ 'repeat', 'repeat-x', 'repeat-y', 'no-repeat' ], multiple: true }, + bgFit: { enums: [ 'none', 'contain', 'cover' ], multiple: true }, + bgCrossOrigin: { enums: [ 'anonymous', 'use-credentials' ], multiple: true }, + bgClip: { enums: [ 'none', 'node' ] }, + color: { color: true }, + bool: { enums: [ 'yes', 'no' ] }, + lineStyle: { enums: [ 'solid', 'dotted', 'dashed' ] }, + borderStyle: { enums: [ 'solid', 'dotted', 'dashed', 'double' ] }, + curveStyle: { enums: [ 'bezier', 'unbundled-bezier', 'haystack', 'segments' ] }, + fontFamily: { regex: '^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$' }, + fontletiant: { enums: [ 'small-caps', 'normal' ] }, + fontStyle: { enums: [ 'italic', 'normal', 'oblique' ] }, + fontWeight: { enums: [ 'normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '800', '900', 100, 200, 300, 400, 500, 600, 700, 800, 900 ] }, + textDecoration: { enums: [ 'none', 'underline', 'overline', 'line-through' ] }, + textTransform: { enums: [ 'none', 'uppercase', 'lowercase' ] }, + textWrap: { enums: [ 'none', 'wrap', 'ellipsis' ] }, + textBackgroundShape: { enums: [ 'rectangle', 'roundrectangle' ]}, + nodeShape: { enums: [ 'rectangle', 'roundrectangle', 'cutrectangle', 'bottomroundrectangle', 'barrel', 'ellipse', 'triangle', 'square', 'pentagon', 'hexagon', 'concavehexagon', 'heptagon', 'octagon', 'tag', 'star', 'diamond', 'vee', 'rhomboid', 'polygon' ] }, + compoundIncludeLabels: { enums: [ 'include', 'exclude' ] }, + arrowShape: { enums: [ 'tee', 'triangle', 'triangle-tee', 'triangle-cross', 'triangle-backcurve', 'half-triangle-overshot', 'vee', 'square', 'circle', 'diamond', 'none' ] }, + arrowFill: { enums: [ 'filled', 'hollow' ] }, + display: { enums: [ 'element', 'none' ] }, + visibility: { enums: [ 'hidden', 'visible' ] }, + zCompoundDepth: { enums: [ 'bottom', 'orphan', 'auto', 'top' ] }, + zIndexCompare: { enums: [ 'auto', 'manual' ] }, + valign: { enums: [ 'top', 'center', 'bottom' ] }, + halign: { enums: [ 'left', 'center', 'right' ] }, + text: { string: true }, + data: { mapping: true, regex: data( 'data' ) }, + layoutData: { mapping: true, regex: data( 'layoutData' ) }, + scratch: { mapping: true, regex: data( 'scratch' ) }, + mapData: { mapping: true, regex: mapData( 'mapData' ) }, + mapLayoutData: { mapping: true, regex: mapData( 'mapLayoutData' ) }, + mapScratch: { mapping: true, regex: mapData( 'mapScratch' ) }, + fn: { mapping: true, fn: true }, + url: { regexes: urlRegexes, singleRegexMatchValue: true }, + urls: { regexes: urlRegexes, singleRegexMatchValue: true, multiple: true }, + propList: { propList: true }, + angle: { number: true, units: 'deg|rad', implicitUnits: 'rad' }, + textRotation: { number: true, units: 'deg|rad', implicitUnits: 'rad', enums: [ 'none', 'autorotate' ] }, + polygonPointList: { number: true, multiple: true, evenMultiple: true, min: -1, max: 1, unitless: true }, + edgeDistances: { enums: ['intersection', 'node-position'] }, + edgeEndpoint: { + number: true, multiple: true, units: '%|px|em|deg|rad', implicitUnits: 'px', + enums: [ 'inside-to-node', 'outside-to-node', 'outside-to-line' ], singleEnum: true, + validate: function( valArr, unitsArr ){ + switch( valArr.length ){ + case 2: // can be % or px only + return unitsArr[0] !== 'deg' && unitsArr[0] !== 'rad' && unitsArr[1] !== 'deg' && unitsArr[1] !== 'rad'; + case 1: // can be enum, deg, or rad only + return is.string( valArr[0] ) || unitsArr[0] === 'deg' || unitsArr[0] === 'rad'; + default: + return false; + } + } + }, + easing: { + regexes: [ + '^(spring)\\s*\\(\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*\\)$', + '^(cubic-bezier)\\s*\\(\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*\\)$' + ], + enums: [ + 'linear', + 'ease', 'ease-in', 'ease-out', 'ease-in-out', + 'ease-in-sine', 'ease-out-sine', 'ease-in-out-sine', + 'ease-in-quad', 'ease-out-quad', 'ease-in-out-quad', + 'ease-in-cubic', 'ease-out-cubic', 'ease-in-out-cubic', + 'ease-in-quart', 'ease-out-quart', 'ease-in-out-quart', + 'ease-in-quint', 'ease-out-quint', 'ease-in-out-quint', + 'ease-in-expo', 'ease-out-expo', 'ease-in-out-expo', + 'ease-in-circ', 'ease-out-circ', 'ease-in-out-circ' + ] + } + }; + + let zOrderDiff = { + zeroNonZero: function( val1, val2 ){ + if( val1 === 0 && val2 !== 0 ){ + return true; + } else if( val1 !== 0 && val2 === 0 ){ + return true; + } else { + return false; + } + }, + anyDiff: function( val1, val2 ){ + return val1 !== val2; + } + }; + + let zd = zOrderDiff; + + // define visual style properties + let t = styfn.types; + let props = styfn.properties = [ + // main label + { name: 'label', type: t.text }, + { name: 'text-rotation', type: t.textRotation }, + { name: 'text-margin-x', type: t.bidirectionalSize }, + { name: 'text-margin-y', type: t.bidirectionalSize }, + + // source label + { name: 'source-label', type: t.text }, + { name: 'source-text-rotation', type: t.textRotation }, + { name: 'source-text-margin-x', type: t.bidirectionalSize }, + { name: 'source-text-margin-y', type: t.bidirectionalSize }, + { name: 'source-text-offset', type: t.size }, + + // target label + { name: 'target-label', type: t.text }, + { name: 'target-text-rotation', type: t.textRotation }, + { name: 'target-text-margin-x', type: t.bidirectionalSize }, + { name: 'target-text-margin-y', type: t.bidirectionalSize }, + { name: 'target-text-offset', type: t.size }, + + // common label style + { name: 'text-valign', type: t.valign }, + { name: 'text-halign', type: t.halign }, + { name: 'color', type: t.color }, + { name: 'text-outline-color', type: t.color }, + { name: 'text-outline-width', type: t.size }, + { name: 'text-outline-opacity', type: t.zeroOneNumber }, + { name: 'text-opacity', type: t.zeroOneNumber }, + { name: 'text-background-color', type: t.color }, + { name: 'text-background-opacity', type: t.zeroOneNumber }, + { name: 'text-background-padding', type: t.size }, + { name: 'text-border-opacity', type: t.zeroOneNumber }, + { name: 'text-border-color', type: t.color }, + { name: 'text-border-width', type: t.size }, + { name: 'text-border-style', type: t.borderStyle }, + { name: 'text-background-shape', type: t.textBackgroundShape}, + // { name: 'text-decoration', type: t.textDecoration }, // not supported in canvas + { name: 'text-transform', type: t.textTransform }, + { name: 'text-wrap', type: t.textWrap }, + { name: 'text-max-width', type: t.size }, + { name: 'text-events', type: t.bool }, + { name: 'font-family', type: t.fontFamily }, + { name: 'font-style', type: t.fontStyle }, + // { name: 'font-letiant', type: t.fontletiant }, // not useful + { name: 'font-weight', type: t.fontWeight }, + { name: 'font-size', type: t.size }, + { name: 'min-zoomed-font-size', type: t.size }, + + // behaviour + { name: 'events', type: t.bool }, + + // visibility + { name: 'display', type: t.display, triggersZOrder: zd.anyDiff }, + { name: 'visibility', type: t.visibility, triggersZOrder: zd.anyDiff }, + { name: 'opacity', type: t.zeroOneNumber, triggersZOrder: zd.zeroNonZero }, + { name: 'z-compound-depth', type: t.zCompoundDepth, triggersZOrder: zd.anyDiff }, + { name: 'z-index-compare', type: t.zIndexCompare, triggersZOrder: zd.anyDiff }, + { name: 'z-index', type: t.nonNegativeInt, triggersZOrder: zd.anyDiff }, + + // overlays + { name: 'overlay-padding', type: t.size }, + { name: 'overlay-color', type: t.color }, + { name: 'overlay-opacity', type: t.zeroOneNumber }, + + // transition anis + { name: 'transition-property', type: t.propList }, + { name: 'transition-duration', type: t.time }, + { name: 'transition-delay', type: t.time }, + { name: 'transition-timing-function', type: t.easing }, + + // node body + { name: 'height', type: t.nodeSize }, + { name: 'width', type: t.nodeSize }, + { name: 'shape', type: t.nodeShape }, + { name: 'shape-polygon-points', type: t.polygonPointList }, + { name: 'background-color', type: t.color }, + { name: 'background-opacity', type: t.zeroOneNumber }, + { name: 'background-blacken', type: t.nOneOneNumber }, + { name: 'padding', type: t.sizeMaybePercent }, + { name: 'padding-relative-to', type: t.paddingRelativeTo }, + + // node border + { name: 'border-color', type: t.color }, + { name: 'border-opacity', type: t.zeroOneNumber }, + { name: 'border-width', type: t.size }, + { name: 'border-style', type: t.borderStyle }, + + // node background images + { name: 'background-image', type: t.urls }, + { name: 'background-image-crossorigin', type: t.bgCrossOrigin }, + { name: 'background-image-opacity', type: t.zeroOneNumbers }, + { name: 'background-position-x', type: t.bgPos }, + { name: 'background-position-y', type: t.bgPos }, + { name: 'background-width-relative-to', type: t.bgRelativeTo }, + { name: 'background-height-relative-to', type: t.bgRelativeTo }, + { name: 'background-repeat', type: t.bgRepeat }, + { name: 'background-fit', type: t.bgFit }, + { name: 'background-clip', type: t.bgClip }, + { name: 'background-width', type: t.bgWH }, + { name: 'background-height', type: t.bgWH }, + + // compound props + { name: 'position', type: t.position }, + { name: 'compound-sizing-wrt-labels', type: t.compoundIncludeLabels }, + { name: 'min-width', type: t.size }, + { name: 'min-width-bias-left', type: t.sizeMaybePercent }, + { name: 'min-width-bias-right', type: t.sizeMaybePercent }, + { name: 'min-height', type: t.size }, + { name: 'min-height-bias-top', type: t.sizeMaybePercent }, + { name: 'min-height-bias-bottom', type: t.sizeMaybePercent }, + + // edge line + { name: 'line-style', type: t.lineStyle }, + { name: 'line-color', type: t.color }, + { name: 'curve-style', type: t.curveStyle }, + { name: 'haystack-radius', type: t.zeroOneNumber }, + { name: 'source-endpoint', type: t.edgeEndpoint }, + { name: 'target-endpoint', type: t.edgeEndpoint }, + { name: 'control-point-step-size', type: t.size }, + { name: 'control-point-distances', type: t.bidirectionalSizes }, + { name: 'control-point-weights', type: t.numbers }, + { name: 'segment-distances', type: t.bidirectionalSizes }, + { name: 'segment-weights', type: t.numbers }, + { name: 'edge-distances', type: t.edgeDistances }, + { name: 'arrow-scale', type: t.positiveNumber }, + { name: 'loop-direction', type: t.angle }, + { name: 'loop-sweep', type: t.angle }, + { name: 'source-distance-from-node', type: t.size }, + { name: 'target-distance-from-node', type: t.size }, + + // ghost properties + { name: 'ghost', type: t.bool }, + { name: 'ghost-offset-x', type: t.bidirectionalSize }, + { name: 'ghost-offset-y', type: t.bidirectionalSize }, + { name: 'ghost-opacity', type: t.zeroOneNumber }, + + // these are just for the core + { name: 'selection-box-color', type: t.color }, + { name: 'selection-box-opacity', type: t.zeroOneNumber }, + { name: 'selection-box-border-color', type: t.color }, + { name: 'selection-box-border-width', type: t.size }, + { name: 'active-bg-color', type: t.color }, + { name: 'active-bg-opacity', type: t.zeroOneNumber }, + { name: 'active-bg-size', type: t.size }, + { name: 'outside-texture-bg-color', type: t.color }, + { name: 'outside-texture-bg-opacity', type: t.zeroOneNumber } + ]; + + // define aliases + let aliases = styfn.aliases = [ + { name: 'content', pointsTo: 'label' }, + { name: 'control-point-distance', pointsTo: 'control-point-distances' }, + { name: 'control-point-weight', pointsTo: 'control-point-weights' }, + { name: 'edge-text-rotation', pointsTo: 'text-rotation' }, + { name: 'padding-left', pointsTo: 'padding' }, + { name: 'padding-right', pointsTo: 'padding' }, + { name: 'padding-top', pointsTo: 'padding' }, + { name: 'padding-bottom', pointsTo: 'padding' } + ]; + + // pie backgrounds for nodes + styfn.pieBackgroundN = 16; // because the pie properties are numbered, give access to a constant N (for renderer use) + props.push( { name: 'pie-size', type: t.sizeMaybePercent } ); + for( let i = 1; i <= styfn.pieBackgroundN; i++ ){ + props.push( { name: 'pie-' + i + '-background-color', type: t.color } ); + props.push( { name: 'pie-' + i + '-background-size', type: t.percent } ); + props.push( { name: 'pie-' + i + '-background-opacity', type: t.zeroOneNumber } ); + } + + // edge arrows + let arrowPrefixes = styfn.arrowPrefixes = [ 'source', 'mid-source', 'target', 'mid-target' ]; + [ + { name: 'arrow-shape', type: t.arrowShape }, + { name: 'arrow-color', type: t.color }, + { name: 'arrow-fill', type: t.arrowFill } + ].forEach( function( prop ){ + arrowPrefixes.forEach( function( prefix ){ + let name = prefix + '-' + prop.name; + let type = prop.type; + + props.push( { name: name, type: type } ); + } ); + }, {} ); + + // list of property names + styfn.propertyNames = props.map( function( p ){ return p.name; } ); + + // allow access of properties by name ( e.g. style.properties.height ) + for( let i = 0; i < props.length; i++ ){ + let prop = props[ i ]; + + props[ prop.name ] = prop; // allow lookup by name + } + + // map aliases + for( let i = 0; i < aliases.length; i++ ){ + let alias = aliases[ i ]; + let pointsToProp = props[ alias.pointsTo ]; + let aliasProp = { + name: alias.name, + alias: true, + pointsTo: pointsToProp + }; + + // add alias prop for parsing + props.push( aliasProp ); + + props[ alias.name ] = aliasProp; // allow lookup by name + } +})(); + +styfn.getDefaultProperty = function( name ){ + return this.getDefaultProperties()[ name ]; +}; + +styfn.getDefaultProperties = util.memoize( function(){ + let rawProps = util.extend( { + // common node/edge props + 'events': 'yes', + 'text-events': 'no', + 'text-valign': 'top', + 'text-halign': 'center', + 'color': '#000', + 'text-outline-color': '#000', + 'text-outline-width': 0, + 'text-outline-opacity': 1, + 'text-opacity': 1, + 'text-decoration': 'none', + 'text-transform': 'none', + 'text-wrap': 'none', + 'text-max-width': 9999, + 'text-background-color': '#000', + 'text-background-opacity': 0, + 'text-background-shape': 'rectangle', + 'text-background-padding': 0, + 'text-border-opacity': 0, + 'text-border-width': 0, + 'text-border-style': 'solid', + 'text-border-color': '#000', + 'font-family': 'Helvetica Neue, Helvetica, sans-serif', + 'font-style': 'normal', + // 'font-letiant': fontletiant, + 'font-weight': 'normal', + 'font-size': 16, + 'min-zoomed-font-size': 0, + 'text-rotation': 'none', + 'source-text-rotation': 'none', + 'target-text-rotation': 'none', + 'visibility': 'visible', + 'display': 'element', + 'opacity': 1, + 'z-compound-depth': 'auto', + 'z-index-compare': 'auto', + 'z-index': 0, + 'label': '', + 'text-margin-x': 0, + 'text-margin-y': 0, + 'source-label': '', + 'source-text-offset': 0, + 'source-text-margin-x': 0, + 'source-text-margin-y': 0, + 'target-label': '', + 'target-text-offset': 0, + 'target-text-margin-x': 0, + 'target-text-margin-y': 0, + 'overlay-opacity': 0, + 'overlay-color': '#000', + 'overlay-padding': 10, + 'transition-property': 'none', + 'transition-duration': 0, + 'transition-delay': 0, + 'transition-timing-function': 'linear', + + // node props + 'background-blacken': 0, + 'background-color': '#999', + 'background-opacity': 1, + 'background-image': 'none', + 'background-image-crossorigin': 'anonymous', + 'background-image-opacity': 1, + 'background-position-x': '50%', + 'background-position-y': '50%', + 'background-width-relative-to': 'include-padding', + 'background-height-relative-to': 'include-padding', + 'background-repeat': 'no-repeat', + 'background-fit': 'none', + 'background-clip': 'node', + 'background-width': 'auto', + 'background-height': 'auto', + 'border-color': '#000', + 'border-opacity': 1, + 'border-width': 0, + 'border-style': 'solid', + 'height': 30, + 'width': 30, + 'shape': 'ellipse', + 'shape-polygon-points': '-1, -1, 1, -1, 1, 1, -1, 1', + + // ghost props + 'ghost': 'no', + 'ghost-offset-y': 0, + 'ghost-offset-x': 0, + 'ghost-opacity': 0, + + // compound props + 'padding': 0, + 'padding-relative-to': 'width', + 'position': 'origin', + 'compound-sizing-wrt-labels': 'include', + 'min-width': 0, + 'min-width-bias-left': 0, + 'min-width-bias-right': 0, + 'min-height': 0, + 'min-height-bias-top': 0, + 'min-height-bias-bottom': 0 + }, { + // node pie bg + 'pie-size': '100%' + }, [ + { name: 'pie-{{i}}-background-color', value: 'black' }, + { name: 'pie-{{i}}-background-size', value: '0%' }, + { name: 'pie-{{i}}-background-opacity', value: 1 } + ].reduce( function( css, prop ){ + for( let i = 1; i <= styfn.pieBackgroundN; i++ ){ + let name = prop.name.replace( '{{i}}', i ); + let val = prop.value; + + css[ name ] = val; + } + + return css; + }, {} ), { + // edge props + 'line-style': 'solid', + 'line-color': '#999', + 'control-point-step-size': 40, + 'control-point-weights': 0.5, + 'segment-weights': 0.5, + 'segment-distances': 20, + 'edge-distances': 'intersection', + 'curve-style': 'bezier', + 'haystack-radius': 0, + 'arrow-scale': 1, + 'loop-direction': '-45deg', + 'loop-sweep': '-90deg', + 'source-distance-from-node': 0, + 'target-distance-from-node': 0, + 'source-endpoint': 'outside-to-node', + 'target-endpoint': 'outside-to-node' + }, [ + { name: 'arrow-shape', value: 'none' }, + { name: 'arrow-color', value: '#999' }, + { name: 'arrow-fill', value: 'filled' } + ].reduce( function( css, prop ){ + styfn.arrowPrefixes.forEach( function( prefix ){ + let name = prefix + '-' + prop.name; + let val = prop.value; + + css[ name ] = val; + } ); + + return css; + }, {} ) ); + + let parsedProps = {}; + + for( let i = 0; i < this.properties.length; i++ ){ + let prop = this.properties[i]; + + if( prop.pointsTo ){ continue; } + + let name = prop.name; + let val = rawProps[ name ]; + let parsedProp = this.parse( name, val ); + + parsedProps[ name ] = parsedProp; + } + + return parsedProps; +} ); + +styfn.addDefaultStylesheet = function(){ + this + .selector( '$node > node' ) // compound (parent) node properties + .css( { + 'shape': 'rectangle', + 'padding': 10, + 'background-color': '#eee', + 'border-color': '#ccc', + 'border-width': 1 + } ) + .selector( 'edge' ) // just edge properties + .css( { + 'width': 3, + 'curve-style': 'haystack' + } ) + .selector( ':parent <-> node' ) + .css( { + 'curve-style': 'bezier', + 'source-endpoint': 'outside-to-line', + 'target-endpoint': 'outside-to-line' + } ) + .selector( ':selected' ) + .css( { + 'background-color': '#0169D9', + 'line-color': '#0169D9', + 'source-arrow-color': '#0169D9', + 'target-arrow-color': '#0169D9', + 'mid-source-arrow-color': '#0169D9', + 'mid-target-arrow-color': '#0169D9' + } ) + .selector( 'node:parent:selected' ) + .css( { + 'background-color': '#CCE1F9', + 'border-color': '#aec8e5' + } ) + .selector( ':active' ) + .css( { + 'overlay-color': 'black', + 'overlay-padding': 10, + 'overlay-opacity': 0.25 + } ) + .selector( 'core' ) // just core properties + .css( { + 'selection-box-color': '#ddd', + 'selection-box-opacity': 0.65, + 'selection-box-border-color': '#aaa', + 'selection-box-border-width': 1, + 'active-bg-color': 'black', + 'active-bg-opacity': 0.15, + 'active-bg-size': 30, + 'outside-texture-bg-color': '#000', + 'outside-texture-bg-opacity': 0.125 + } ) + ; + + this.defaultLength = this.length; +}; + +module.exports = styfn; diff --git a/node_modules/cytoscape/src/style/string-sheet.js b/node_modules/cytoscape/src/style/string-sheet.js new file mode 100644 index 000000000..35a476ccc --- /dev/null +++ b/node_modules/cytoscape/src/style/string-sheet.js @@ -0,0 +1,136 @@ +let util = require( '../util' ); +let Selector = require( '../selector' ); + +let styfn = {}; + +styfn.appendFromString = function( string ){ + let self = this; + let style = this; + let remaining = '' + string; + let selAndBlockStr; + let blockRem; + let propAndValStr; + + // remove comments from the style string + remaining = remaining.replace( /[/][*](\s|.)+?[*][/]/g, '' ); + + function removeSelAndBlockFromRemaining(){ + // remove the parsed selector and block from the remaining text to parse + if( remaining.length > selAndBlockStr.length ){ + remaining = remaining.substr( selAndBlockStr.length ); + } else { + remaining = ''; + } + } + + function removePropAndValFromRem(){ + // remove the parsed property and value from the remaining block text to parse + if( blockRem.length > propAndValStr.length ){ + blockRem = blockRem.substr( propAndValStr.length ); + } else { + blockRem = ''; + } + } + + while( true ){ + let nothingLeftToParse = remaining.match( /^\s*$/ ); + if( nothingLeftToParse ){ break; } + + let selAndBlock = remaining.match( /^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/ ); + + if( !selAndBlock ){ + util.error( 'Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: ' + remaining ); + break; + } + + selAndBlockStr = selAndBlock[0]; + + // parse the selector + let selectorStr = selAndBlock[1]; + if( selectorStr !== 'core' ){ + let selector = new Selector( selectorStr ); + if( selector._private.invalid ){ + util.error( 'Skipping parsing of block: Invalid selector found in string stylesheet: ' + selectorStr ); + + // skip this selector and block + removeSelAndBlockFromRemaining(); + continue; + } + } + + // parse the block of properties and values + let blockStr = selAndBlock[2]; + let invalidBlock = false; + blockRem = blockStr; + let props = []; + + while( true ){ + let nothingLeftToParse = blockRem.match( /^\s*$/ ); + if( nothingLeftToParse ){ break; } + + let propAndVal = blockRem.match( /^\s*(.+?)\s*:\s*(.+?)\s*;/ ); + + if( !propAndVal ){ + util.error( 'Skipping parsing of block: Invalid formatting of style property and value definitions found in:' + blockStr ); + invalidBlock = true; + break; + } + + propAndValStr = propAndVal[0]; + let propStr = propAndVal[1]; + let valStr = propAndVal[2]; + + let prop = self.properties[ propStr ]; + if( !prop ){ + util.error( 'Skipping property: Invalid property name in: ' + propAndValStr ); + + // skip this property in the block + removePropAndValFromRem(); + continue; + } + + let parsedProp = style.parse( propStr, valStr ); + + if( !parsedProp ){ + util.error( 'Skipping property: Invalid property definition in: ' + propAndValStr ); + + // skip this property in the block + removePropAndValFromRem(); + continue; + } + + props.push( { + name: propStr, + val: valStr + } ); + removePropAndValFromRem(); + } + + if( invalidBlock ){ + removeSelAndBlockFromRemaining(); + break; + } + + // put the parsed block in the style + style.selector( selectorStr ); + for( let i = 0; i < props.length; i++ ){ + let prop = props[ i ]; + style.css( prop.name, prop.val ); + } + + removeSelAndBlockFromRemaining(); + } + + return style; +}; + +styfn.fromString = function( string ){ + let style = this; + + style.resetToDefault(); + style.appendFromString( string ); + + return style; +}; + +module.exports = styfn; diff --git a/node_modules/cytoscape/src/stylesheet.js b/node_modules/cytoscape/src/stylesheet.js new file mode 100644 index 000000000..39788d020 --- /dev/null +++ b/node_modules/cytoscape/src/stylesheet.js @@ -0,0 +1,96 @@ +let is = require( './is' ); +let util = require( './util' ); +let Style = require( './style' ); + +// a dummy stylesheet object that doesn't need a reference to the core +// (useful for init) +let Stylesheet = function(){ + if( !(this instanceof Stylesheet) ){ + return new Stylesheet(); + } + + this.length = 0; +}; + +let sheetfn = Stylesheet.prototype; + +sheetfn.instanceString = function(){ + return 'stylesheet'; +}; + +// just store the selector to be parsed later +sheetfn.selector = function( selector ){ + let i = this.length++; + + this[ i ] = { + selector: selector, + properties: [] + }; + + return this; // chaining +}; + +// just store the property to be parsed later +sheetfn.css = function( name, value ){ + let i = this.length - 1; + + if( is.string( name ) ){ + this[ i ].properties.push( { + name: name, + value: value + } ); + } else if( is.plainObject( name ) ){ + let map = name; + + for( let j = 0; j < Style.properties.length; j++ ){ + let prop = Style.properties[ j ]; + let mapVal = map[ prop.name ]; + + if( mapVal === undefined ){ // also try camel case name + mapVal = map[ util.dash2camel( prop.name ) ]; + } + + if( mapVal !== undefined ){ + let name = prop.name; + let value = mapVal; + + this[ i ].properties.push( { + name: name, + value: value + } ); + } + } + } + + return this; // chaining +}; + +sheetfn.style = sheetfn.css; + +// generate a real style object from the dummy stylesheet +sheetfn.generateStyle = function( cy ){ + let style = new Style( cy ); + + return this.appendToStyle( style ); +}; + +// append a dummy stylesheet object on a real style object +sheetfn.appendToStyle = function( style ){ + for( let i = 0; i < this.length; i++ ){ + let context = this[ i ]; + let selector = context.selector; + let props = context.properties; + + style.selector( selector ); // apply selector + + for( let j = 0; j < props.length; j++ ){ + let prop = props[ j ]; + + style.css( prop.name, prop.value ); // apply property + } + } + + return style; +}; + +module.exports = Stylesheet; diff --git a/node_modules/cytoscape/src/test.js b/node_modules/cytoscape/src/test.js new file mode 100644 index 000000000..6555ebd71 --- /dev/null +++ b/node_modules/cytoscape/src/test.js @@ -0,0 +1,14 @@ +/* +This file tells the Mocha tests what build of Cytoscape to use. +*/ + +// For Travis or manual build tests, use the CJS build +// NB : Must do `gulp build-cjs` before `mocha` or `gulp-test` +if( process.env.TRAVIS || process.env.TEST_BUILD ){ + module.exports = require('../build/cytoscape.cjs.js'); + +// Otherwise use the unbundled, unbabelified, raw source +// NB : Must use a version of Node that natively supports all JS features used in the lib +} else { + module.exports = require('./index.js'); +} diff --git a/node_modules/cytoscape/src/util/colors.js b/node_modules/cytoscape/src/util/colors.js new file mode 100644 index 000000000..b6c1122e0 --- /dev/null +++ b/node_modules/cytoscape/src/util/colors.js @@ -0,0 +1,291 @@ +let is = require( '../is' ); + +module.exports = { + // get [r, g, b] from #abc or #aabbcc + hex2tuple: function( hex ){ + if( !(hex.length === 4 || hex.length === 7) || hex[0] !== '#' ){ return; } + + let shortHex = hex.length === 4; + let r, g, b; + let base = 16; + + if( shortHex ){ + r = parseInt( hex[1] + hex[1], base ); + g = parseInt( hex[2] + hex[2], base ); + b = parseInt( hex[3] + hex[3], base ); + } else { + r = parseInt( hex[1] + hex[2], base ); + g = parseInt( hex[3] + hex[4], base ); + b = parseInt( hex[5] + hex[6], base ); + } + + return [ r, g, b ]; + }, + + // get [r, g, b, a] from hsl(0, 0, 0) or hsla(0, 0, 0, 0) + hsl2tuple: function( hsl ){ + let ret; + let h, s, l, a, r, g, b; + function hue2rgb( p, q, t ){ + if( t < 0 ) t += 1; + if( t > 1 ) t -= 1; + if( t < 1 / 6 ) return p + (q - p) * 6 * t; + if( t < 1 / 2 ) return q; + if( t < 2 / 3 ) return p + (q - p) * (2 / 3 - t) * 6; + return p; + } + + let m = new RegExp( '^' + this.regex.hsla + '$' ).exec( hsl ); + if( m ){ + + // get hue + h = parseInt( m[1] ); + if( h < 0 ){ + h = ( 360 - (-1 * h % 360) ) % 360; + } else if( h > 360 ){ + h = h % 360; + } + h /= 360; // normalise on [0, 1] + + s = parseFloat( m[2] ); + if( s < 0 || s > 100 ){ return; } // saturation is [0, 100] + s = s / 100; // normalise on [0, 1] + + l = parseFloat( m[3] ); + if( l < 0 || l > 100 ){ return; } // lightness is [0, 100] + l = l / 100; // normalise on [0, 1] + + a = m[4]; + if( a !== undefined ){ + a = parseFloat( a ); + + if( a < 0 || a > 1 ){ return; } // alpha is [0, 1] + } + + // now, convert to rgb + // code from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript + if( s === 0 ){ + r = g = b = Math.round( l * 255 ); // achromatic + } else { + let q = l < 0.5 ? l * (1 + s) : l + s - l * s; + let p = 2 * l - q; + r = Math.round( 255 * hue2rgb( p, q, h + 1 / 3 ) ); + g = Math.round( 255 * hue2rgb( p, q, h ) ); + b = Math.round( 255 * hue2rgb( p, q, h - 1 / 3 ) ); + } + + ret = [ r, g, b, a ]; + } + + return ret; + }, + + // get [r, g, b, a] from rgb(0, 0, 0) or rgba(0, 0, 0, 0) + rgb2tuple: function( rgb ){ + let ret; + + let m = new RegExp( '^' + this.regex.rgba + '$' ).exec( rgb ); + if( m ){ + ret = []; + + let isPct = []; + for( let i = 1; i <= 3; i++ ){ + let channel = m[ i ]; + + if( channel[ channel.length - 1 ] === '%' ){ + isPct[ i ] = true; + } + channel = parseFloat( channel ); + + if( isPct[ i ] ){ + channel = channel / 100 * 255; // normalise to [0, 255] + } + + if( channel < 0 || channel > 255 ){ return; } // invalid channel value + + ret.push( Math.floor( channel ) ); + } + + let atLeastOneIsPct = isPct[1] || isPct[2] || isPct[3]; + let allArePct = isPct[1] && isPct[2] && isPct[3]; + if( atLeastOneIsPct && !allArePct ){ return; } // must all be percent values if one is + + let alpha = m[4]; + if( alpha !== undefined ){ + alpha = parseFloat( alpha ); + + if( alpha < 0 || alpha > 1 ){ return; } // invalid alpha value + + ret.push( alpha ); + } + } + + return ret; + }, + + colorname2tuple: function( color ){ + return this.colors[ color.toLowerCase() ]; + }, + + color2tuple: function( color ){ + return ( is.array( color ) ? color : null ) + || this.colorname2tuple( color ) + || this.hex2tuple( color ) + || this.rgb2tuple( color ) + || this.hsl2tuple( color ); + }, + + colors: { + // special colour names + transparent: [0, 0, 0, 0], // NB alpha === 0 + + // regular colours + aliceblue: [ 240, 248, 255 ], + antiquewhite: [ 250, 235, 215 ], + aqua: [0, 255, 255 ], + aquamarine: [ 127, 255, 212 ], + azure: [ 240, 255, 255 ], + beige: [ 245, 245, 220 ], + bisque: [ 255, 228, 196 ], + black: [0, 0, 0], + blanchedalmond: [ 255, 235, 205 ], + blue: [0, 0, 255 ], + blueviolet: [ 138, 43, 226 ], + brown: [ 165, 42, 42 ], + burlywood: [ 222, 184, 135 ], + cadetblue: [ 95, 158, 160 ], + chartreuse: [ 127, 255, 0], + chocolate: [ 210, 105, 30 ], + coral: [ 255, 127, 80 ], + cornflowerblue: [ 100, 149, 237 ], + cornsilk: [ 255, 248, 220 ], + crimson: [ 220, 20, 60 ], + cyan: [0, 255, 255 ], + darkblue: [0, 0, 139 ], + darkcyan: [0, 139, 139 ], + darkgoldenrod: [ 184, 134, 11 ], + darkgray: [ 169, 169, 169 ], + darkgreen: [0, 100, 0], + darkgrey: [ 169, 169, 169 ], + darkkhaki: [ 189, 183, 107 ], + darkmagenta: [ 139, 0, 139 ], + darkolivegreen: [ 85, 107, 47 ], + darkorange: [ 255, 140, 0], + darkorchid: [ 153, 50, 204 ], + darkred: [ 139, 0, 0], + darksalmon: [ 233, 150, 122 ], + darkseagreen: [ 143, 188, 143 ], + darkslateblue: [ 72, 61, 139 ], + darkslategray: [ 47, 79, 79 ], + darkslategrey: [ 47, 79, 79 ], + darkturquoise: [0, 206, 209 ], + darkviolet: [ 148, 0, 211 ], + deeppink: [ 255, 20, 147 ], + deepskyblue: [0, 191, 255 ], + dimgray: [ 105, 105, 105 ], + dimgrey: [ 105, 105, 105 ], + dodgerblue: [ 30, 144, 255 ], + firebrick: [ 178, 34, 34 ], + floralwhite: [ 255, 250, 240 ], + forestgreen: [ 34, 139, 34 ], + fuchsia: [ 255, 0, 255 ], + gainsboro: [ 220, 220, 220 ], + ghostwhite: [ 248, 248, 255 ], + gold: [ 255, 215, 0], + goldenrod: [ 218, 165, 32 ], + gray: [ 128, 128, 128 ], + grey: [ 128, 128, 128 ], + green: [0, 128, 0], + greenyellow: [ 173, 255, 47 ], + honeydew: [ 240, 255, 240 ], + hotpink: [ 255, 105, 180 ], + indianred: [ 205, 92, 92 ], + indigo: [ 75, 0, 130 ], + ivory: [ 255, 255, 240 ], + khaki: [ 240, 230, 140 ], + lavender: [ 230, 230, 250 ], + lavenderblush: [ 255, 240, 245 ], + lawngreen: [ 124, 252, 0], + lemonchiffon: [ 255, 250, 205 ], + lightblue: [ 173, 216, 230 ], + lightcoral: [ 240, 128, 128 ], + lightcyan: [ 224, 255, 255 ], + lightgoldenrodyellow: [ 250, 250, 210 ], + lightgray: [ 211, 211, 211 ], + lightgreen: [ 144, 238, 144 ], + lightgrey: [ 211, 211, 211 ], + lightpink: [ 255, 182, 193 ], + lightsalmon: [ 255, 160, 122 ], + lightseagreen: [ 32, 178, 170 ], + lightskyblue: [ 135, 206, 250 ], + lightslategray: [ 119, 136, 153 ], + lightslategrey: [ 119, 136, 153 ], + lightsteelblue: [ 176, 196, 222 ], + lightyellow: [ 255, 255, 224 ], + lime: [0, 255, 0], + limegreen: [ 50, 205, 50 ], + linen: [ 250, 240, 230 ], + magenta: [ 255, 0, 255 ], + maroon: [ 128, 0, 0], + mediumaquamarine: [ 102, 205, 170 ], + mediumblue: [0, 0, 205 ], + mediumorchid: [ 186, 85, 211 ], + mediumpurple: [ 147, 112, 219 ], + mediumseagreen: [ 60, 179, 113 ], + mediumslateblue: [ 123, 104, 238 ], + mediumspringgreen: [0, 250, 154 ], + mediumturquoise: [ 72, 209, 204 ], + mediumvioletred: [ 199, 21, 133 ], + midnightblue: [ 25, 25, 112 ], + mintcream: [ 245, 255, 250 ], + mistyrose: [ 255, 228, 225 ], + moccasin: [ 255, 228, 181 ], + navajowhite: [ 255, 222, 173 ], + navy: [0, 0, 128 ], + oldlace: [ 253, 245, 230 ], + olive: [ 128, 128, 0], + olivedrab: [ 107, 142, 35 ], + orange: [ 255, 165, 0], + orangered: [ 255, 69, 0], + orchid: [ 218, 112, 214 ], + palegoldenrod: [ 238, 232, 170 ], + palegreen: [ 152, 251, 152 ], + paleturquoise: [ 175, 238, 238 ], + palevioletred: [ 219, 112, 147 ], + papayawhip: [ 255, 239, 213 ], + peachpuff: [ 255, 218, 185 ], + peru: [ 205, 133, 63 ], + pink: [ 255, 192, 203 ], + plum: [ 221, 160, 221 ], + powderblue: [ 176, 224, 230 ], + purple: [ 128, 0, 128 ], + red: [ 255, 0, 0], + rosybrown: [ 188, 143, 143 ], + royalblue: [ 65, 105, 225 ], + saddlebrown: [ 139, 69, 19 ], + salmon: [ 250, 128, 114 ], + sandybrown: [ 244, 164, 96 ], + seagreen: [ 46, 139, 87 ], + seashell: [ 255, 245, 238 ], + sienna: [ 160, 82, 45 ], + silver: [ 192, 192, 192 ], + skyblue: [ 135, 206, 235 ], + slateblue: [ 106, 90, 205 ], + slategray: [ 112, 128, 144 ], + slategrey: [ 112, 128, 144 ], + snow: [ 255, 250, 250 ], + springgreen: [0, 255, 127 ], + steelblue: [ 70, 130, 180 ], + tan: [ 210, 180, 140 ], + teal: [0, 128, 128 ], + thistle: [ 216, 191, 216 ], + tomato: [ 255, 99, 71 ], + turquoise: [ 64, 224, 208 ], + violet: [ 238, 130, 238 ], + wheat: [ 245, 222, 179 ], + white: [ 255, 255, 255 ], + whitesmoke: [ 245, 245, 245 ], + yellow: [ 255, 255, 0], + yellowgreen: [ 154, 205, 50 ] + } +}; diff --git a/node_modules/cytoscape/src/util/index.js b/node_modules/cytoscape/src/util/index.js new file mode 100644 index 000000000..da5a1de6c --- /dev/null +++ b/node_modules/cytoscape/src/util/index.js @@ -0,0 +1,169 @@ +/*global console */ + +let is = require( '../is' ); +let math = require( '../math' ); + +let util = { + + MAX_INT: Number.MAX_SAFE_INTEGER || 9007199254740991, + + trueify: function(){ return true; }, + + falsify: function(){ return false; }, + + zeroify: function(){ return 0; }, + + noop: function(){}, + + error: function( msg ){ + /* eslint-disable */ + if( console.error ){ + console.error.apply( console, arguments ); + + if( console.trace ){ console.trace(); } + } else { + console.log.apply( console, arguments ); + + if( console.trace ){ console.trace(); } + } + /* eslint-enable */ + }, + + clone: function( obj ){ + return this.extend( {}, obj ); + }, + + // gets a shallow copy of the argument + copy: function( obj ){ + if( obj == null ){ + return obj; + } if( is.array( obj ) ){ + return obj.slice(); + } else if( is.plainObject( obj ) ){ + return this.clone( obj ); + } else { + return obj; + } + }, + + copyArray: function( arr ){ + return arr.slice(); + }, + + clonePosition: function( pos ){ + return { x: pos.x, y: pos.y }; + }, + + uuid: function( + a,b // placeholders + ){ + for( // loop :) + b=a=''; // b - result , a - numeric letiable + a++<36; // + b+=a*51&52 // if "a" is not 9 or 14 or 19 or 24 + ? // return a random number or 4 + ( + a^15 // if "a" is not 15 + ? // genetate a random number from 0 to 15 + 8^Math.random()* + (a^20?16:4) // unless "a" is 20, in which case a random number from 8 to 11 + : + 4 // otherwise 4 + ).toString(16) + : + '-' // in other cases (if "a" is 9,14,19,24) insert "-" + ); + return b; + } + +}; + +util.makeBoundingBox = math.makeBoundingBox.bind( math ); + +util._staticEmptyObject = {}; + +util.staticEmptyObject = function(){ + return util._staticEmptyObject; +}; + +util.extend = Object.assign != null ? Object.assign.bind( Object ) : function( tgt ){ + let args = arguments; + + for( let i = 1; i < args.length; i++ ){ + let obj = args[ i ]; + + if( obj == null ){ continue; } + + let keys = Object.keys( obj ); + + for( let j = 0; j < keys.length; j++ ){ + let k = keys[j]; + + tgt[ k ] = obj[ k ]; + } + } + + return tgt; +}; + +util.assign = util.extend; + +util.default = function( val, def ){ + if( val === undefined ){ + return def; + } else { + return val; + } +}; + +util.removeFromArray = function( arr, ele, manyCopies ){ + for( let i = arr.length; i >= 0; i-- ){ + if( arr[i] === ele ){ + arr.splice( i, 1 ); + + if( !manyCopies ){ break; } + } + } +}; + +util.clearArray = function( arr ){ + arr.splice( 0, arr.length ); +}; + +util.push = function( arr, otherArr ){ + for( let i = 0; i < otherArr.length; i++ ){ + let el = otherArr[i]; + + arr.push( el ); + } +}; + +util.getPrefixedProperty = function( obj, propName, prefix ){ + if( prefix ){ + propName = this.prependCamel( prefix, propName ); // e.g. (labelWidth, source) => sourceLabelWidth + } + + return obj[ propName ]; +}; + +util.setPrefixedProperty = function( obj, propName, prefix, value ){ + if( prefix ){ + propName = this.prependCamel( prefix, propName ); // e.g. (labelWidth, source) => sourceLabelWidth + } + + obj[ propName ] = value; +}; + +[ + require( './colors' ), + require( './maps' ), + { memoize: require( './memoize' ) }, + require( './regex' ), + require( './strings' ), + require( './timing' ), + require( './sort' ) +].forEach( function( req ){ + util.extend( util, req ); +} ); + +module.exports = util; diff --git a/node_modules/cytoscape/src/util/maps.js b/node_modules/cytoscape/src/util/maps.js new file mode 100644 index 000000000..80135b84d --- /dev/null +++ b/node_modules/cytoscape/src/util/maps.js @@ -0,0 +1,116 @@ +let is = require( '../is' ); + +module.exports = { + // has anything been set in the map + mapEmpty: function( map ){ + let empty = true; + + if( map != null ){ + return Object.keys( map ).length === 0; + } + + return empty; + }, + + // pushes to the array at the end of a map (map may not be built) + pushMap: function( options ){ + let array = this.getMap( options ); + + if( array == null ){ // if empty, put initial array + this.setMap( this.extend( {}, options, { + value: [ options.value ] + } ) ); + } else { + array.push( options.value ); + } + }, + + // sets the value in a map (map may not be built) + setMap: function( options ){ + let obj = options.map; + let key; + let keys = options.keys; + let l = keys.length; + + for( let i = 0; i < l; i++ ){ + let key = keys[ i ]; + + if( is.plainObject( key ) ){ + this.error( 'Tried to set map with object key' ); + } + + if( i < keys.length - 1 ){ + + // extend the map if necessary + if( obj[ key ] == null ){ + obj[ key ] = {}; + } + + obj = obj[ key ]; + } else { + // set the value + obj[ key ] = options.value; + } + } + }, + + // gets the value in a map even if it's not built in places + getMap: function( options ){ + let obj = options.map; + let keys = options.keys; + let l = keys.length; + + for( let i = 0; i < l; i++ ){ + let key = keys[ i ]; + + if( is.plainObject( key ) ){ + this.error( 'Tried to get map with object key' ); + } + + obj = obj[ key ]; + + if( obj == null ){ + return obj; + } + } + + return obj; + }, + + // deletes the entry in the map + deleteMap: function( options ){ + let obj = options.map; + let keys = options.keys; + let l = keys.length; + let keepChildren = options.keepChildren; + + for( let i = 0; i < l; i++ ){ + let key = keys[ i ]; + + if( is.plainObject( key ) ){ + this.error( 'Tried to delete map with object key' ); + } + + let lastKey = i === options.keys.length - 1; + if( lastKey ){ + + if( keepChildren ){ // then only delete child fields not in keepChildren + let children = Object.keys( obj ); + + for( let j = 0; j < children.length; j++ ){ + let child = children[j]; + + if( !keepChildren[ child ] ){ + obj[ child ] = undefined; + } + } + } else { + obj[ key ] = undefined; + } + + } else { + obj = obj[ key ]; + } + } + } +}; diff --git a/node_modules/cytoscape/src/util/memoize.js b/node_modules/cytoscape/src/util/memoize.js new file mode 100644 index 000000000..f1b5f0bcc --- /dev/null +++ b/node_modules/cytoscape/src/util/memoize.js @@ -0,0 +1,37 @@ +module.exports = function memoize( fn, keyFn ){ + if( !keyFn ){ + keyFn = function(){ + if( arguments.length === 1 ){ + return arguments[0]; + } else if( arguments.length === 0 ){ + return 'undefined'; + } + + let args = []; + + for( let i = 0; i < arguments.length; i++ ){ + args.push( arguments[ i ] ); + } + + return args.join( '$' ); + }; + } + + let memoizedFn = function(){ + let self = this; + let args = arguments; + let ret; + let k = keyFn.apply( self, args ); + let cache = memoizedFn.cache; + + if( !(ret = cache[ k ]) ){ + ret = cache[ k ] = fn.apply( self, args ); + } + + return ret; + }; + + memoizedFn.cache = {}; + + return memoizedFn; +}; diff --git a/node_modules/cytoscape/src/util/regex.js b/node_modules/cytoscape/src/util/regex.js new file mode 100644 index 000000000..203c03f8d --- /dev/null +++ b/node_modules/cytoscape/src/util/regex.js @@ -0,0 +1,22 @@ +let number = '(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))'; + +let rgba = 'rgb[a]?\\((' + number + '[%]?)\\s*,\\s*(' + number + '[%]?)\\s*,\\s*(' + number + '[%]?)(?:\\s*,\\s*(' + number + '))?\\)'; +let rgbaNoBackRefs = 'rgb[a]?\\((?:' + number + '[%]?)\\s*,\\s*(?:' + number + '[%]?)\\s*,\\s*(?:' + number + '[%]?)(?:\\s*,\\s*(?:' + number + '))?\\)'; + +let hsla = 'hsl[a]?\\((' + number + ')\\s*,\\s*(' + number + '[%])\\s*,\\s*(' + number + '[%])(?:\\s*,\\s*(' + number + '))?\\)'; +let hslaNoBackRefs = 'hsl[a]?\\((?:' + number + ')\\s*,\\s*(?:' + number + '[%])\\s*,\\s*(?:' + number + '[%])(?:\\s*,\\s*(?:' + number + '))?\\)'; + +let hex3 = '\\#[0-9a-fA-F]{3}'; +let hex6 = '\\#[0-9a-fA-F]{6}'; + +module.exports = { + regex: { + number: number, + rgba: rgba, + rgbaNoBackRefs: rgbaNoBackRefs, + hsla: hsla, + hslaNoBackRefs: hslaNoBackRefs, + hex3: hex3, + hex6: hex6 + } +}; diff --git a/node_modules/cytoscape/src/util/sort.js b/node_modules/cytoscape/src/util/sort.js new file mode 100644 index 000000000..c39614ac9 --- /dev/null +++ b/node_modules/cytoscape/src/util/sort.js @@ -0,0 +1,20 @@ +function ascending( a, b ){ + if( a < b ){ + return -1; + } else if( a > b ){ + return 1; + } else { + return 0; + } +} + +function descending( a, b ){ + return -1 * ascending( a, b ); +} + +module.exports = { + sort: { + ascending: ascending, + descending: descending + } +}; diff --git a/node_modules/cytoscape/src/util/strings.js b/node_modules/cytoscape/src/util/strings.js new file mode 100644 index 000000000..27fd6ec10 --- /dev/null +++ b/node_modules/cytoscape/src/util/strings.js @@ -0,0 +1,32 @@ +let memoize = require( './memoize' ); +let is = require( '../is' ); + +module.exports = { + + camel2dash: memoize( function( str ){ + return str.replace( /([A-Z])/g, function( v ){ + return '-' + v.toLowerCase(); + } ); + } ), + + dash2camel: memoize( function( str ){ + return str.replace( /(-\w)/g, function( v ){ + return v[1].toUpperCase(); + } ); + } ), + + prependCamel: memoize( function( prefix, str ){ + return prefix + str[0].toUpperCase() + str.substring(1); + }, function( prefix, str ){ + return prefix + '$' + str; + } ), + + capitalize: function( str ){ + if( is.emptyString( str ) ){ + return str; + } + + return str.charAt( 0 ).toUpperCase() + str.substring( 1 ); + } + +}; diff --git a/node_modules/cytoscape/src/util/timing.js b/node_modules/cytoscape/src/util/timing.js new file mode 100644 index 000000000..ca8c17448 --- /dev/null +++ b/node_modules/cytoscape/src/util/timing.js @@ -0,0 +1,42 @@ +var window = require( '../window' ); +var performance = window ? window.performance : null; + +var util = {}; + +var pnow = performance && performance.now ? function(){ return performance.now(); } : function(){ return Date.now(); }; + +var raf = (function(){ + if( window ) { + if( window.requestAnimationFrame ){ + return function( fn ){ window.requestAnimationFrame( fn ); }; + } else if( window.mozRequestAnimationFrame ){ + return function( fn ){ window.mozRequestAnimationFrame( fn ); }; + } else if( window.webkitRequestAnimationFrame ){ + return function( fn ){ window.webkitRequestAnimationFrame( fn ); }; + } else if( window.msRequestAnimationFrame ){ + return function( fn ){ window.msRequestAnimationFrame( fn ); }; + } + } + + return function( fn ){ + if( fn ){ + setTimeout( function(){ + fn( pnow() ); + }, 1000 / 60 ); + } + } +})(); + +util.requestAnimationFrame = function( fn ){ + raf( fn ); +}; + +util.performanceNow = pnow; + +util.debounce = require('lodash.debounce'); + +util.now = function(){ + return Date.now(); +}; + +module.exports = util; diff --git a/node_modules/cytoscape/src/version.js b/node_modules/cytoscape/src/version.js new file mode 100644 index 000000000..a61b268e9 --- /dev/null +++ b/node_modules/cytoscape/src/version.js @@ -0,0 +1 @@ +module.exports = "3.2.18"; diff --git a/node_modules/cytoscape/src/version.json b/node_modules/cytoscape/src/version.json new file mode 100644 index 000000000..276888df7 --- /dev/null +++ b/node_modules/cytoscape/src/version.json @@ -0,0 +1 @@ +"snapshot-5b8143d96d-1474401082113" \ No newline at end of file diff --git a/node_modules/cytoscape/src/window.js b/node_modules/cytoscape/src/window.js new file mode 100644 index 000000000..dad018123 --- /dev/null +++ b/node_modules/cytoscape/src/window.js @@ -0,0 +1 @@ +module.exports = ( typeof window === 'undefined' ? null : window ); // eslint-disable-line no-undef diff --git a/node_modules/cytoscape/webpack.config.js b/node_modules/cytoscape/webpack.config.js new file mode 100644 index 000000000..6e4dab6f6 --- /dev/null +++ b/node_modules/cytoscape/webpack.config.js @@ -0,0 +1,59 @@ +var env = function( name, def ){ + var val = process.env[ name ]; + + if( val === undefined || val === '' ){ + return def; + } else { + return val; + } +}; +var boolEnv = function( name, def ){ + return env( name, def ) == 'true'; +}; +var FILENAME = env('FILENAME', 'cytoscape.js'); +var NODE_ENV = env('NODE_ENV', ''); +var MINIFY = boolEnv('MINIFY', false); +var BABEL = boolEnv('BABEL', true); +var SOURCEMAPS = boolEnv('SOURCEMAPS', false); +var pkg = require('./package.json'); +var path = require('path'); +var webpack = require('webpack'); + +module.exports = { + entry: './src/index.js', + output: { + path: path.resolve(__dirname, 'build'), + filename: FILENAME, + library: 'cytoscape', + libraryTarget: 'umd' + }, + externals: NODE_ENV === 'production' ? Object.keys( pkg.dependencies || {} ) : [], + module: { + rules: [ // common rules + + ].concat( BABEL ? [ + { + loader: 'babel-loader', + test: /\.js$/, + include: [ + path.resolve(__dirname, 'src') + ], + exclude: [ + path.resolve(__dirname, 'node_modules') + ] + } + ] : []) + }, + plugins: [ // common plugins + + ].concat( MINIFY ? [ // minify plugins + new webpack.optimize.UglifyJsPlugin({ + compress: { + warnings: false, + drop_console: false, + } + }) + ] : [] ), + devtool: SOURCEMAPS ? 'inline-source-map' : false, + node: false +}; diff --git a/node_modules/date-now/.npmignore b/node_modules/date-now/.npmignore new file mode 100644 index 000000000..aa3fd4b85 --- /dev/null +++ b/node_modules/date-now/.npmignore @@ -0,0 +1,14 @@ +.DS_Store +.monitor +.*.swp +.nodemonignore +releases +*.log +*.err +fleet.json +public/browserify +bin/*.json +.bin +build +compile +.lock-wscript diff --git a/node_modules/date-now/.testem.json b/node_modules/date-now/.testem.json new file mode 100644 index 000000000..633c2ba84 --- /dev/null +++ b/node_modules/date-now/.testem.json @@ -0,0 +1,14 @@ +{ + "launchers": { + "node": { + "command": "npm test" + } + }, + "src_files": [ + "./**/*.js" + ], + "before_tests": "npm run build", + "on_exit": "rm test/static/bundle.js", + "test_page": "test/static/index.html", + "launch_in_dev": ["node", "phantomjs"] +} diff --git a/node_modules/date-now/.travis.yml b/node_modules/date-now/.travis.yml new file mode 100644 index 000000000..ed178f635 --- /dev/null +++ b/node_modules/date-now/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.8 + - 0.9 diff --git a/node_modules/date-now/LICENCE b/node_modules/date-now/LICENCE new file mode 100644 index 000000000..822d880b9 --- /dev/null +++ b/node_modules/date-now/LICENCE @@ -0,0 +1,19 @@ +Copyright (c) 2012 Colingo. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/date-now/README.md b/node_modules/date-now/README.md new file mode 100644 index 000000000..22d267536 --- /dev/null +++ b/node_modules/date-now/README.md @@ -0,0 +1,45 @@ +# date-now + +[![build status][1]][2] + +[![browser support][3]][4] + +A requirable version of Date.now() + +Use-case is to be able to mock out Date.now() using require interception. + +## Example + +```js +var now = require("date-now") + +var ts = now() +var ts2 = Date.now() +assert.equal(ts, ts2) +``` + +## example of seed + +``` +var now = require("date-now/seed")(timeStampFromServer) + +// ts is in "sync" with the seed value from the server +// useful if your users have their local time being a few minutes +// out of your server time. +var ts = now() +``` + +## Installation + +`npm install date-now` + +## Contributors + + - Raynos + +## MIT Licenced + + [1]: https://secure.travis-ci.org/Colingo/date-now.png + [2]: http://travis-ci.org/Colingo/date-now + [3]: http://ci.testling.com/Colingo/date-now.png + [4]: http://ci.testling.com/Colingo/date-now diff --git a/node_modules/date-now/index.js b/node_modules/date-now/index.js new file mode 100644 index 000000000..d5f143a84 --- /dev/null +++ b/node_modules/date-now/index.js @@ -0,0 +1,5 @@ +module.exports = now + +function now() { + return new Date().getTime() +} diff --git a/node_modules/date-now/package.json b/node_modules/date-now/package.json new file mode 100644 index 000000000..53470ad02 --- /dev/null +++ b/node_modules/date-now/package.json @@ -0,0 +1,94 @@ +{ + "_from": "date-now@^0.1.4", + "_id": "date-now@0.1.4", + "_inBundle": false, + "_integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "_location": "/date-now", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "date-now@^0.1.4", + "name": "date-now", + "escapedName": "date-now", + "rawSpec": "^0.1.4", + "saveSpec": null, + "fetchSpec": "^0.1.4" + }, + "_requiredBy": [ + "/console-browserify" + ], + "_resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "_shasum": "eaf439fd4d4848ad74e5cc7dbef200672b9e345b", + "_spec": "date-now@^0.1.4", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/console-browserify", + "author": { + "name": "Raynos", + "email": "raynos2@gmail.com" + }, + "bugs": { + "url": "https://github.com/Colingo/date-now/issues", + "email": "raynos2@gmail.com" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Artem Shoobovych" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "A requirable version of Date.now()", + "devDependencies": { + "browserify": "https://github.com/raynos/node-browserify/tarball/master", + "tape": "~0.2.2", + "testem": "~0.2.52" + }, + "homepage": "https://github.com/Colingo/date-now", + "keywords": [], + "licenses": [ + { + "type": "MIT", + "url": "http://github.com/Colingo/date-now/raw/master/LICENSE" + } + ], + "main": "index", + "name": "date-now", + "repository": { + "type": "git", + "url": "git://github.com/Colingo/date-now.git" + }, + "scripts": { + "build": "browserify test/index.js -o test/static/bundle.js", + "test": "node ./test", + "testem": "testem" + }, + "testling": { + "files": "test/*.js", + "browsers": { + "ie": [ + "8", + "9", + "10" + ], + "firefox": [ + "16", + "17", + "nightly" + ], + "chrome": [ + "22", + "23", + "canary" + ], + "opera": [ + "12", + "next" + ], + "safari": [ + "5.1" + ] + } + }, + "version": "0.1.4" +} diff --git a/node_modules/date-now/seed.js b/node_modules/date-now/seed.js new file mode 100644 index 000000000..b9727c5a3 --- /dev/null +++ b/node_modules/date-now/seed.js @@ -0,0 +1,16 @@ +var now = require("./index") + +module.exports = seeded + +/* Returns a Date.now() like function that's in sync with + the seed value +*/ +function seeded(seed) { + var current = now() + + return time + + function time() { + return seed + (now() - current) + } +} diff --git a/node_modules/date-now/test/index.js b/node_modules/date-now/test/index.js new file mode 100644 index 000000000..270584cab --- /dev/null +++ b/node_modules/date-now/test/index.js @@ -0,0 +1,28 @@ +var test = require("tape") +var setTimeout = require("timers").setTimeout + +var now = require("../index") +var seeded = require("../seed") + +test("date", function (assert) { + var ts = now() + var ts2 = Date.now() + assert.equal(ts, ts2) + assert.end() +}) + +test("seeded", function (assert) { + var time = seeded(40) + var ts = time() + + within(assert, time(), 40, 5) + setTimeout(function () { + within(assert, time(), 90, 10) + assert.end() + }, 50) +}) + +function within(assert, a, b, offset) { + assert.ok(a + offset > b) + assert.ok(a - offset < b) +} diff --git a/node_modules/date-now/test/static/index.html b/node_modules/date-now/test/static/index.html new file mode 100644 index 000000000..3d5384da8 --- /dev/null +++ b/node_modules/date-now/test/static/index.html @@ -0,0 +1,10 @@ + + + + TAPE Example + + + + + + diff --git a/node_modules/debounce/History.md b/node_modules/debounce/History.md new file mode 100644 index 000000000..88add89c0 --- /dev/null +++ b/node_modules/debounce/History.md @@ -0,0 +1,50 @@ + +1.2.0 / 2018-08-14 +================== + + * Added a .debounce member to debounce (#21) + +1.1.0 / 2017-10-30 +================== + + * Ability to force execution (#16) + +1.0.2 / 2017-04-21 +================== + + * Fixes #3 - Debounced function executing early? (#15) + * Merge pull request #13 from selbekk/master + * Remove date-now from package.json + * Remove date-now dependency from component.json + * Remove date-now usage + +1.0.1 / 2016-07-25 +================== + + * add ability to clear timer (#10) + +1.0.0 / 2014-06-21 +================== + + * Readme: attribute underscore.js in the License section + * index: rewrite to use underscore.js' implementation (#2, @TooTallNate) + * component, package: add "date-now" as a dependency + * test: fix test + * component, package: add "keywords" array + * package: adjust "description" + * package: added "repository" field (#1, @juliangruber) + +0.0.3 / 2013-08-21 +================== + + * immediate now defaults to `false` + +0.0.2 / 2013-07-27 +================== + + * consolidated with TJ's debounce + +0.0.1 / 2012-11-5 +================== + + * Initial release diff --git a/node_modules/debounce/Makefile b/node_modules/debounce/Makefile new file mode 100644 index 000000000..0f14dac30 --- /dev/null +++ b/node_modules/debounce/Makefile @@ -0,0 +1,11 @@ + +build: components index.js + @component build --dev + +components: component.json + @component install --dev + +clean: + rm -fr build components template.js + +.PHONY: clean diff --git a/node_modules/debounce/Readme.md b/node_modules/debounce/Readme.md new file mode 100644 index 000000000..8639f0bf4 --- /dev/null +++ b/node_modules/debounce/Readme.md @@ -0,0 +1,69 @@ + +# debounce + + Useful for implementing behavior that should only happen after a repeated + action has completed. + +## Installation + + $ component install component/debounce + + Or in node: + + $ npm install debounce + +## Example + +```js +var debounce = require('debounce'); +window.onresize = debounce(resize, 200); + +function resize(e) { + console.log('height', window.innerHeight); + console.log('width', window.innerWidth); +} +``` + +To later clear the timer and cancel currently scheduled executions: +``` +window.onresize.clear(); +``` + +To execute any pending invocations and reset the timer: +``` +window.onresize.flush(); +``` + +Alternately, if using newer syntax: + +```js +import { debounce } from "debounce"; +``` + +## API + +### debounce(fn, wait, [ immediate || false ]) + + Creates and returns a new debounced version of the passed function that + will postpone its execution until after wait milliseconds have elapsed + since the last time it was invoked. + + Pass `true` for the `immediate` parameter to cause debounce to trigger + the function on the leading edge instead of the trailing edge of the wait + interval. Useful in circumstances like preventing accidental double-clicks + on a "submit" button from firing a second time. + + The debounced function returned has a property 'clear' that is a + function that will clear any scheduled future executions of your function. + + The debounced function returned has a property 'flush' that is a + function that will immediately execute the function if and only if execution is scheduled, + and reset the execution timer for subsequent invocations of the debounced + function. + +## License + + MIT + + Original implementation is from [`underscore.js`](http://underscorejs.org/) + which also has an MIT license. diff --git a/node_modules/debounce/component.json b/node_modules/debounce/component.json new file mode 100644 index 000000000..ae489dfb3 --- /dev/null +++ b/node_modules/debounce/component.json @@ -0,0 +1,18 @@ +{ + "name": "debounce", + "repo": "component/debounce", + "description": "Creates and returns a new debounced version of the passed function that will postpone its execution until after wait milliseconds have elapsed since the last time it was invoked", + "version": "1.2.0", + "main": "index.js", + "scripts": [ + "index.js" + ], + "keywords": [ + "function", + "throttle", + "invoke" + ], + "dependencies": {}, + "development": {}, + "license": "MIT" +} diff --git a/node_modules/debounce/index.js b/node_modules/debounce/index.js new file mode 100644 index 000000000..4f35c12de --- /dev/null +++ b/node_modules/debounce/index.js @@ -0,0 +1,70 @@ +/** + * Returns a function, that, as long as it continues to be invoked, will not + * be triggered. The function will be called after it stops being called for + * N milliseconds. If `immediate` is passed, trigger the function on the + * leading edge, instead of the trailing. The function also has a property 'clear' + * that is a function which will clear the timer to prevent previously scheduled executions. + * + * @source underscore.js + * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/ + * @param {Function} function to wrap + * @param {Number} timeout in ms (`100`) + * @param {Boolean} whether to execute at the beginning (`false`) + * @api public + */ +function debounce(func, wait, immediate){ + var timeout, args, context, timestamp, result; + if (null == wait) wait = 100; + + function later() { + var last = Date.now() - timestamp; + + if (last < wait && last >= 0) { + timeout = setTimeout(later, wait - last); + } else { + timeout = null; + if (!immediate) { + result = func.apply(context, args); + context = args = null; + } + } + }; + + var debounced = function(){ + context = this; + args = arguments; + timestamp = Date.now(); + var callNow = immediate && !timeout; + if (!timeout) timeout = setTimeout(later, wait); + if (callNow) { + result = func.apply(context, args); + context = args = null; + } + + return result; + }; + + debounced.clear = function() { + if (timeout) { + clearTimeout(timeout); + timeout = null; + } + }; + + debounced.flush = function() { + if (timeout) { + result = func.apply(context, args); + context = args = null; + + clearTimeout(timeout); + timeout = null; + } + }; + + return debounced; +}; + +// Adds compatibility for ES modules +debounce.debounce = debounce; + +module.exports = debounce; diff --git a/node_modules/debounce/package.json b/node_modules/debounce/package.json new file mode 100644 index 000000000..eb63fc718 --- /dev/null +++ b/node_modules/debounce/package.json @@ -0,0 +1,59 @@ +{ + "_from": "debounce@^1.0.0", + "_id": "debounce@1.2.0", + "_inBundle": false, + "_integrity": "sha512-mYtLl1xfZLi1m4RtQYlZgJUNQjl4ZxVnHzIR8nLLgi4q1YT8o/WM+MK/f8yfcc9s5Ir5zRaPZyZU6xs1Syoocg==", + "_location": "/debounce", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "debounce@^1.0.0", + "name": "debounce", + "escapedName": "debounce", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/watchify-middleware" + ], + "_resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.0.tgz", + "_shasum": "44a540abc0ea9943018dc0eaa95cce87f65cd131", + "_spec": "debounce@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/watchify-middleware", + "bugs": { + "url": "https://github.com/component/debounce/issues" + }, + "bundleDependencies": false, + "component": { + "scripts": { + "debounce/index.js": "index.js" + } + }, + "deprecated": false, + "description": "Creates and returns a new debounced version of the passed function that will postpone its execution until after wait milliseconds have elapsed since the last time it was invoked", + "devDependencies": { + "minijasminenode": "^1.1.1", + "mocha": "*", + "should": "*", + "sinon": "^1.17.7" + }, + "homepage": "https://github.com/component/debounce#readme", + "keywords": [ + "function", + "throttle", + "invoke" + ], + "license": "MIT", + "main": "index.js", + "name": "debounce", + "repository": { + "type": "git", + "url": "git://github.com/component/debounce.git" + }, + "scripts": { + "test": "minijasminenode test.js" + }, + "version": "1.2.0" +} diff --git a/node_modules/debounce/test.html b/node_modules/debounce/test.html new file mode 100644 index 000000000..c5e268164 --- /dev/null +++ b/node_modules/debounce/test.html @@ -0,0 +1,32 @@ + + + Debounce Component + + + Resize the window! +
+ Cancel Print +
+ Print Now + + + + + diff --git a/node_modules/debounce/test.js b/node_modules/debounce/test.js new file mode 100644 index 000000000..f2890e887 --- /dev/null +++ b/node_modules/debounce/test.js @@ -0,0 +1,170 @@ +var debounce = require('.') +var sinon = require('sinon') + +describe('housekeeping', function() { + it('should be defined as a function', function() { + expect(typeof debounce).toEqual('function') + }) +}) + +describe('catch issue #3 - Debounced function executing early?', function() { + + // use sinon to control the clock + var clock + + beforeEach(function(){ + clock = sinon.useFakeTimers() + }) + + afterEach(function(){ + clock.restore() + }) + + it('should debounce with fast timeout', function() { + + var callback = sinon.spy() + + // set up debounced function with wait of 100 + var fn = debounce(callback, 100) + + // call debounced function at interval of 50 + setTimeout(fn, 100) + setTimeout(fn, 150) + setTimeout(fn, 200) + setTimeout(fn, 250) + + // set the clock to 100 (period of the wait) ticks after the last debounced call + clock.tick(350) + + // the callback should have been triggered once + expect(callback.callCount).toEqual(1) + + }) + +}) + +describe('forcing execution', function() { + + // use sinon to control the clock + var clock + + beforeEach(function(){ + clock = sinon.useFakeTimers() + }) + + afterEach(function(){ + clock.restore() + }) + + it('should not execute prior to timeout', function() { + + var callback = sinon.spy() + + // set up debounced function with wait of 100 + var fn = debounce(callback, 100) + + // call debounced function at interval of 50 + setTimeout(fn, 100) + setTimeout(fn, 150) + + // set the clock to 25 (period of the wait) ticks after the last debounced call + clock.tick(175) + + // the callback should not have been called yet + expect(callback.callCount).toEqual(0) + + }) + + it('should execute prior to timeout when flushed', function() { + + var callback = sinon.spy() + + // set up debounced function with wait of 100 + var fn = debounce(callback, 100) + + // call debounced function at interval of 50 + setTimeout(fn, 100) + setTimeout(fn, 150) + + // set the clock to 25 (period of the wait) ticks after the last debounced call + clock.tick(175) + + fn.flush() + + // the callback has been called + expect(callback.callCount).toEqual(1) + + }) + + it('should not execute again after timeout when flushed before the timeout', function() { + + var callback = sinon.spy() + + // set up debounced function with wait of 100 + var fn = debounce(callback, 100) + + // call debounced function at interval of 50 + setTimeout(fn, 100) + setTimeout(fn, 150) + + // set the clock to 25 (period of the wait) ticks after the last debounced call + clock.tick(175) + + fn.flush() + + // the callback has been called here + expect(callback.callCount).toEqual(1) + + // move to past the timeout + clock.tick(225) + + // the callback should have only been called once + expect(callback.callCount).toEqual(1) + + }) + + it('should not execute on a timer after being flushed', function() { + + var callback = sinon.spy() + + // set up debounced function with wait of 100 + var fn = debounce(callback, 100) + + // call debounced function at interval of 50 + setTimeout(fn, 100) + setTimeout(fn, 150) + + // set the clock to 25 (period of the wait) ticks after the last debounced call + clock.tick(175) + + fn.flush() + + // the callback has been called here + expect(callback.callCount).toEqual(1) + + // schedule again + setTimeout(fn, 250) + + // move to past the new timeout + clock.tick(400) + + // the callback should have been called again + expect(callback.callCount).toEqual(2) + + }) + + it('should not execute when flushed if nothing was scheduled', function() { + + var callback = sinon.spy() + + // set up debounced function with wait of 100 + var fn = debounce(callback, 100) + + fn.flush() + + // the callback should not have been called + expect(callback.callCount).toEqual(0) + + }) + +}) diff --git a/node_modules/debug/.coveralls.yml b/node_modules/debug/.coveralls.yml new file mode 100644 index 000000000..20a706858 --- /dev/null +++ b/node_modules/debug/.coveralls.yml @@ -0,0 +1 @@ +repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve diff --git a/node_modules/debug/.eslintrc b/node_modules/debug/.eslintrc new file mode 100644 index 000000000..8a37ae2c2 --- /dev/null +++ b/node_modules/debug/.eslintrc @@ -0,0 +1,11 @@ +{ + "env": { + "browser": true, + "node": true + }, + "rules": { + "no-console": 0, + "no-empty": [1, { "allowEmptyCatch": true }] + }, + "extends": "eslint:recommended" +} diff --git a/node_modules/debug/.npmignore b/node_modules/debug/.npmignore new file mode 100644 index 000000000..5f60eecc8 --- /dev/null +++ b/node_modules/debug/.npmignore @@ -0,0 +1,9 @@ +support +test +examples +example +*.sock +dist +yarn.lock +coverage +bower.json diff --git a/node_modules/debug/.travis.yml b/node_modules/debug/.travis.yml new file mode 100644 index 000000000..6c6090c3b --- /dev/null +++ b/node_modules/debug/.travis.yml @@ -0,0 +1,14 @@ + +language: node_js +node_js: + - "6" + - "5" + - "4" + +install: + - make node_modules + +script: + - make lint + - make test + - make coveralls diff --git a/node_modules/debug/CHANGELOG.md b/node_modules/debug/CHANGELOG.md new file mode 100644 index 000000000..eadaa1895 --- /dev/null +++ b/node_modules/debug/CHANGELOG.md @@ -0,0 +1,362 @@ + +2.6.9 / 2017-09-22 +================== + + * remove ReDoS regexp in %o formatter (#504) + +2.6.8 / 2017-05-18 +================== + + * Fix: Check for undefined on browser globals (#462, @marbemac) + +2.6.7 / 2017-05-16 +================== + + * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) + * Fix: Inline extend function in node implementation (#452, @dougwilson) + * Docs: Fix typo (#455, @msasad) + +2.6.5 / 2017-04-27 +================== + + * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek) + * Misc: clean up browser reference checks (#447, @thebigredgeek) + * Misc: add npm-debug.log to .gitignore (@thebigredgeek) + + +2.6.4 / 2017-04-20 +================== + + * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo) + * Chore: ignore bower.json in npm installations. (#437, @joaovieira) + * Misc: update "ms" to v0.7.3 (@tootallnate) + +2.6.3 / 2017-03-13 +================== + + * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts) + * Docs: Changelog fix (@thebigredgeek) + +2.6.2 / 2017-03-10 +================== + + * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) + * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) + * Docs: Add Slackin invite badge (@tootallnate) + +2.6.1 / 2017-02-10 +================== + + * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error + * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) + * Fix: IE8 "Expected identifier" error (#414, @vgoma) + * Fix: Namespaces would not disable once enabled (#409, @musikov) + +2.6.0 / 2016-12-28 +================== + + * Fix: added better null pointer checks for browser useColors (@thebigredgeek) + * Improvement: removed explicit `window.debug` export (#404, @tootallnate) + * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) + +2.5.2 / 2016-12-25 +================== + + * Fix: reference error on window within webworkers (#393, @KlausTrainer) + * Docs: fixed README typo (#391, @lurch) + * Docs: added notice about v3 api discussion (@thebigredgeek) + +2.5.1 / 2016-12-20 +================== + + * Fix: babel-core compatibility + +2.5.0 / 2016-12-20 +================== + + * Fix: wrong reference in bower file (@thebigredgeek) + * Fix: webworker compatibility (@thebigredgeek) + * Fix: output formatting issue (#388, @kribblo) + * Fix: babel-loader compatibility (#383, @escwald) + * Misc: removed built asset from repo and publications (@thebigredgeek) + * Misc: moved source files to /src (#378, @yamikuronue) + * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) + * Test: coveralls integration (#378, @yamikuronue) + * Docs: simplified language in the opening paragraph (#373, @yamikuronue) + +2.4.5 / 2016-12-17 +================== + + * Fix: `navigator` undefined in Rhino (#376, @jochenberger) + * Fix: custom log function (#379, @hsiliev) + * Improvement: bit of cleanup + linting fixes (@thebigredgeek) + * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) + * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) + +2.4.4 / 2016-12-14 +================== + + * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) + +2.4.3 / 2016-12-14 +================== + + * Fix: navigation.userAgent error for react native (#364, @escwald) + +2.4.2 / 2016-12-14 +================== + + * Fix: browser colors (#367, @tootallnate) + * Misc: travis ci integration (@thebigredgeek) + * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) + +2.4.1 / 2016-12-13 +================== + + * Fix: typo that broke the package (#356) + +2.4.0 / 2016-12-13 +================== + + * Fix: bower.json references unbuilt src entry point (#342, @justmatt) + * Fix: revert "handle regex special characters" (@tootallnate) + * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) + * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) + * Improvement: allow colors in workers (#335, @botverse) + * Improvement: use same color for same namespace. (#338, @lchenay) + +2.3.3 / 2016-11-09 +================== + + * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) + * Fix: Returning `localStorage` saved values (#331, Levi Thomason) + * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) + +2.3.2 / 2016-11-09 +================== + + * Fix: be super-safe in index.js as well (@TooTallNate) + * Fix: should check whether process exists (Tom Newby) + +2.3.1 / 2016-11-09 +================== + + * Fix: Added electron compatibility (#324, @paulcbetts) + * Improvement: Added performance optimizations (@tootallnate) + * Readme: Corrected PowerShell environment variable example (#252, @gimre) + * Misc: Removed yarn lock file from source control (#321, @fengmk2) + +2.3.0 / 2016-11-07 +================== + + * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) + * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) + * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) + * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) + * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) + * Package: Update "ms" to 0.7.2 (#315, @DevSide) + * Package: removed superfluous version property from bower.json (#207 @kkirsche) + * Readme: fix USE_COLORS to DEBUG_COLORS + * Readme: Doc fixes for format string sugar (#269, @mlucool) + * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) + * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) + * Readme: better docs for browser support (#224, @matthewmueller) + * Tooling: Added yarn integration for development (#317, @thebigredgeek) + * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) + * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) + * Misc: Updated contributors (@thebigredgeek) + +2.2.0 / 2015-05-09 +================== + + * package: update "ms" to v0.7.1 (#202, @dougwilson) + * README: add logging to file example (#193, @DanielOchoa) + * README: fixed a typo (#191, @amir-s) + * browser: expose `storage` (#190, @stephenmathieson) + * Makefile: add a `distclean` target (#189, @stephenmathieson) + +2.1.3 / 2015-03-13 +================== + + * Updated stdout/stderr example (#186) + * Updated example/stdout.js to match debug current behaviour + * Renamed example/stderr.js to stdout.js + * Update Readme.md (#184) + * replace high intensity foreground color for bold (#182, #183) + +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + +2.1.0 / 2014-10-15 +================== + + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) + +2.0.0 / 2014-09-01 +================== + + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/debug/LICENSE b/node_modules/debug/LICENSE new file mode 100644 index 000000000..658c933d2 --- /dev/null +++ b/node_modules/debug/LICENSE @@ -0,0 +1,19 @@ +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the 'Software'), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/debug/Makefile b/node_modules/debug/Makefile new file mode 100644 index 000000000..584da8bf9 --- /dev/null +++ b/node_modules/debug/Makefile @@ -0,0 +1,50 @@ +# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 +THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) + +# BIN directory +BIN := $(THIS_DIR)/node_modules/.bin + +# Path +PATH := node_modules/.bin:$(PATH) +SHELL := /bin/bash + +# applications +NODE ?= $(shell which node) +YARN ?= $(shell which yarn) +PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm)) +BROWSERIFY ?= $(NODE) $(BIN)/browserify + +.FORCE: + +install: node_modules + +node_modules: package.json + @NODE_ENV= $(PKG) install + @touch node_modules + +lint: .FORCE + eslint browser.js debug.js index.js node.js + +test-node: .FORCE + istanbul cover node_modules/mocha/bin/_mocha -- test/**.js + +test-browser: .FORCE + mkdir -p dist + + @$(BROWSERIFY) \ + --standalone debug \ + . > dist/debug.js + + karma start --single-run + rimraf dist + +test: .FORCE + concurrently \ + "make test-node" \ + "make test-browser" + +coveralls: + cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js + +.PHONY: all install clean distclean diff --git a/node_modules/debug/README.md b/node_modules/debug/README.md new file mode 100644 index 000000000..f67be6b31 --- /dev/null +++ b/node_modules/debug/README.md @@ -0,0 +1,312 @@ +# debug +[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) + + + +A tiny node.js debugging utility modelled after node core's debugging technique. + +**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)** + +## Installation + +```bash +$ npm install debug +``` + +## Usage + +`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. + +Example _app.js_: + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %s', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example _worker.js_: + +```js +var debug = require('debug')('worker'); + +setInterval(function(){ + debug('doing some work'); +}, 1000); +``` + + The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: + + ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) + + ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) + +#### Windows note + + On Windows the environment variable is set using the `set` command. + + ```cmd + set DEBUG=*,-not_this + ``` + + Note that PowerShell uses different syntax to set environment variables. + + ```cmd + $env:DEBUG = "*,-not_this" + ``` + +Then, run the program to be debugged as usual. + +## Millisecond diff + + When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) + + When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: + + ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) + +## Conventions + + If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". + +## Wildcards + + The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + + You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". + +## Environment Variables + + When running through Node.js, you can set a few environment variables that will + change the behavior of the debug logging: + +| Name | Purpose | +|-----------|-------------------------------------------------| +| `DEBUG` | Enables/disables specific debugging namespaces. | +| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | +| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | + + + __Note:__ The environment variables beginning with `DEBUG_` end up being + converted into an Options object that gets used with `%o`/`%O` formatters. + See the Node.js documentation for + [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) + for the complete list. + +## Formatters + + + Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters: + +| Formatter | Representation | +|-----------|----------------| +| `%O` | Pretty-print an Object on multiple lines. | +| `%o` | Pretty-print an Object all on a single line. | +| `%s` | String. | +| `%d` | Number (both integer and float). | +| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | +| `%%` | Single percent sign ('%'). This does not consume an argument. | + +### Custom formatters + + You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like: + +```js +const createDebug = require('debug') +createDebug.formatters.h = (v) => { + return v.toString('hex') +} + +// …elsewhere +const debug = createDebug('foo') +debug('this is hex: %h', new Buffer('hello world')) +// foo this is hex: 68656c6c6f20776f726c6421 +0ms +``` + +## Browser support + You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), + or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), + if you don't want to build it yourself. + + Debug's enable state is currently persisted by `localStorage`. + Consider the situation shown below where you have `worker:a` and `worker:b`, + and wish to debug both. You can enable this using `localStorage.debug`: + +```js +localStorage.debug = 'worker:*' +``` + +And then refresh the page. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + +#### Web Inspector Colors + + Colors are also enabled on "Web Inspectors" that understand the `%c` formatting + option. These are WebKit web inspectors, Firefox ([since version + 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) + and the Firebug plugin for Firefox (any version). + + Colored output looks something like: + + ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) + + +## Output streams + + By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: + +Example _stdout.js_: + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + - Andrew Rhyne + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## License + +(The MIT License) + +Copyright (c) 2014-2016 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/debug/component.json b/node_modules/debug/component.json new file mode 100644 index 000000000..9de26410f --- /dev/null +++ b/node_modules/debug/component.json @@ -0,0 +1,19 @@ +{ + "name": "debug", + "repo": "visionmedia/debug", + "description": "small debugging utility", + "version": "2.6.9", + "keywords": [ + "debug", + "log", + "debugger" + ], + "main": "src/browser.js", + "scripts": [ + "src/browser.js", + "src/debug.js" + ], + "dependencies": { + "rauchg/ms.js": "0.7.1" + } +} diff --git a/node_modules/debug/karma.conf.js b/node_modules/debug/karma.conf.js new file mode 100644 index 000000000..103a82d15 --- /dev/null +++ b/node_modules/debug/karma.conf.js @@ -0,0 +1,70 @@ +// Karma configuration +// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC) + +module.exports = function(config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: '', + + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['mocha', 'chai', 'sinon'], + + + // list of files / patterns to load in the browser + files: [ + 'dist/debug.js', + 'test/*spec.js' + ], + + + // list of files to exclude + exclude: [ + 'src/node.js' + ], + + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + }, + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['progress'], + + + // web server port + port: 9876, + + + // enable / disable colors in the output (reporters and logs) + colors: true, + + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['PhantomJS'], + + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: false, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: Infinity + }) +} diff --git a/node_modules/debug/node.js b/node_modules/debug/node.js new file mode 100644 index 000000000..7fc36fe6d --- /dev/null +++ b/node_modules/debug/node.js @@ -0,0 +1 @@ +module.exports = require('./src/node'); diff --git a/node_modules/debug/package.json b/node_modules/debug/package.json new file mode 100644 index 000000000..3563bd856 --- /dev/null +++ b/node_modules/debug/package.json @@ -0,0 +1,91 @@ +{ + "_from": "debug@^2.2.0", + "_id": "debug@2.6.9", + "_inBundle": false, + "_integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "_location": "/debug", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "debug@^2.2.0", + "name": "debug", + "escapedName": "debug", + "rawSpec": "^2.2.0", + "saveSpec": null, + "fetchSpec": "^2.2.0" + }, + "_requiredBy": [ + "/readdirp/expand-brackets", + "/resp-modifier", + "/send", + "/snapdragon" + ], + "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "_shasum": "5d128515df134ff327e90a4c93f4e077a536341f", + "_spec": "debug@^2.2.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/snapdragon", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "browser": "./src/browser.js", + "bugs": { + "url": "https://github.com/visionmedia/debug/issues" + }, + "bundleDependencies": false, + "component": { + "scripts": { + "debug/index.js": "browser.js", + "debug/debug.js": "debug.js" + } + }, + "contributors": [ + { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://n8.io" + }, + { + "name": "Andrew Rhyne", + "email": "rhyneandrew@gmail.com" + } + ], + "dependencies": { + "ms": "2.0.0" + }, + "deprecated": false, + "description": "small debugging utility", + "devDependencies": { + "browserify": "9.0.3", + "chai": "^3.5.0", + "concurrently": "^3.1.0", + "coveralls": "^2.11.15", + "eslint": "^3.12.1", + "istanbul": "^0.4.5", + "karma": "^1.3.0", + "karma-chai": "^0.1.0", + "karma-mocha": "^1.3.0", + "karma-phantomjs-launcher": "^1.0.2", + "karma-sinon": "^1.0.5", + "mocha": "^3.2.0", + "mocha-lcov-reporter": "^1.2.0", + "rimraf": "^2.5.4", + "sinon": "^1.17.6", + "sinon-chai": "^2.8.0" + }, + "homepage": "https://github.com/visionmedia/debug#readme", + "keywords": [ + "debug", + "log", + "debugger" + ], + "license": "MIT", + "main": "./src/index.js", + "name": "debug", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "version": "2.6.9" +} diff --git a/node_modules/debug/src/browser.js b/node_modules/debug/src/browser.js new file mode 100644 index 000000000..710692493 --- /dev/null +++ b/node_modules/debug/src/browser.js @@ -0,0 +1,185 @@ +/** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +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 = process.env.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) {} +} diff --git a/node_modules/debug/src/debug.js b/node_modules/debug/src/debug.js new file mode 100644 index 000000000..6a5e3fc94 --- /dev/null +++ b/node_modules/debug/src/debug.js @@ -0,0 +1,202 @@ + +/** + * 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 = require('ms'); + +/** + * 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; +} diff --git a/node_modules/debug/src/index.js b/node_modules/debug/src/index.js new file mode 100644 index 000000000..e12cf4d58 --- /dev/null +++ b/node_modules/debug/src/index.js @@ -0,0 +1,10 @@ +/** + * Detect Electron renderer process, which is node, but we should + * treat as a browser. + */ + +if (typeof process !== 'undefined' && process.type === 'renderer') { + module.exports = require('./browser.js'); +} else { + module.exports = require('./node.js'); +} diff --git a/node_modules/debug/src/inspector-log.js b/node_modules/debug/src/inspector-log.js new file mode 100644 index 000000000..60ea6c04a --- /dev/null +++ b/node_modules/debug/src/inspector-log.js @@ -0,0 +1,15 @@ +module.exports = inspectorLog; + +// black hole +const nullStream = new (require('stream').Writable)(); +nullStream._write = () => {}; + +/** + * Outputs a `console.log()` to the Node.js Inspector console *only*. + */ +function inspectorLog() { + const stdout = console._stdout; + console._stdout = nullStream; + console.log.apply(console, arguments); + console._stdout = stdout; +} diff --git a/node_modules/debug/src/node.js b/node_modules/debug/src/node.js new file mode 100644 index 000000000..b15109c90 --- /dev/null +++ b/node_modules/debug/src/node.js @@ -0,0 +1,248 @@ +/** + * Module dependencies. + */ + +var tty = require('tty'); +var util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +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(process.env).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 = process.env[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(process.env.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 process.env.DEBUG; + } else { + process.env.DEBUG = namespaces; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.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 = require('fs'); + stream = new fs.SyncWriteStream(fd, { autoClose: false }); + stream._type = 'fs'; + break; + + case 'PIPE': + case 'TCP': + var net = require('net'); + 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()); diff --git a/node_modules/decode-uri-component/index.js b/node_modules/decode-uri-component/index.js new file mode 100644 index 000000000..691499b0e --- /dev/null +++ b/node_modules/decode-uri-component/index.js @@ -0,0 +1,94 @@ +'use strict'; +var token = '%[a-f0-9]{2}'; +var singleMatcher = new RegExp(token, 'gi'); +var multiMatcher = new RegExp('(' + token + ')+', 'gi'); + +function decodeComponents(components, split) { + try { + // Try to decode the entire string first + return decodeURIComponent(components.join('')); + } catch (err) { + // Do nothing + } + + if (components.length === 1) { + return components; + } + + split = split || 1; + + // Split the array in 2 parts + var left = components.slice(0, split); + var right = components.slice(split); + + return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right)); +} + +function decode(input) { + try { + return decodeURIComponent(input); + } catch (err) { + var tokens = input.match(singleMatcher); + + for (var i = 1; i < tokens.length; i++) { + input = decodeComponents(tokens, i).join(''); + + tokens = input.match(singleMatcher); + } + + return input; + } +} + +function customDecodeURIComponent(input) { + // Keep track of all the replacements and prefill the map with the `BOM` + var replaceMap = { + '%FE%FF': '\uFFFD\uFFFD', + '%FF%FE': '\uFFFD\uFFFD' + }; + + var match = multiMatcher.exec(input); + while (match) { + try { + // Decode as big chunks as possible + replaceMap[match[0]] = decodeURIComponent(match[0]); + } catch (err) { + var result = decode(match[0]); + + if (result !== match[0]) { + replaceMap[match[0]] = result; + } + } + + match = multiMatcher.exec(input); + } + + // Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else + replaceMap['%C2'] = '\uFFFD'; + + var entries = Object.keys(replaceMap); + + for (var i = 0; i < entries.length; i++) { + // Replace all decoded components + var key = entries[i]; + input = input.replace(new RegExp(key, 'g'), replaceMap[key]); + } + + return input; +} + +module.exports = function (encodedURI) { + if (typeof encodedURI !== 'string') { + throw new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`'); + } + + try { + encodedURI = encodedURI.replace(/\+/g, ' '); + + // Try the built in decoder first + return decodeURIComponent(encodedURI); + } catch (err) { + // Fallback to a more advanced decoder + return customDecodeURIComponent(encodedURI); + } +}; diff --git a/node_modules/decode-uri-component/license b/node_modules/decode-uri-component/license new file mode 100644 index 000000000..78b08554a --- /dev/null +++ b/node_modules/decode-uri-component/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sam Verschueren (github.com/SamVerschueren) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/decode-uri-component/package.json b/node_modules/decode-uri-component/package.json new file mode 100644 index 000000000..b9cd4b574 --- /dev/null +++ b/node_modules/decode-uri-component/package.json @@ -0,0 +1,69 @@ +{ + "_from": "decode-uri-component@^0.2.0", + "_id": "decode-uri-component@0.2.0", + "_inBundle": false, + "_integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "_location": "/decode-uri-component", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "decode-uri-component@^0.2.0", + "name": "decode-uri-component", + "escapedName": "decode-uri-component", + "rawSpec": "^0.2.0", + "saveSpec": null, + "fetchSpec": "^0.2.0" + }, + "_requiredBy": [ + "/source-map-resolve" + ], + "_resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "_shasum": "eb3913333458775cb84cd1a1fae062106bb87545", + "_spec": "decode-uri-component@^0.2.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/source-map-resolve", + "author": { + "name": "Sam Verschueren", + "email": "sam.verschueren@gmail.com", + "url": "github.com/SamVerschueren" + }, + "bugs": { + "url": "https://github.com/SamVerschueren/decode-uri-component/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A better decodeURIComponent", + "devDependencies": { + "ava": "^0.17.0", + "coveralls": "^2.13.1", + "nyc": "^10.3.2", + "xo": "^0.16.0" + }, + "engines": { + "node": ">=0.10" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/SamVerschueren/decode-uri-component#readme", + "keywords": [ + "decode", + "uri", + "component", + "decodeuricomponent", + "components", + "decoder", + "url" + ], + "license": "MIT", + "name": "decode-uri-component", + "repository": { + "type": "git", + "url": "git+https://github.com/SamVerschueren/decode-uri-component.git" + }, + "scripts": { + "coveralls": "nyc report --reporter=text-lcov | coveralls", + "test": "xo && nyc ava" + }, + "version": "0.2.0" +} diff --git a/node_modules/decode-uri-component/readme.md b/node_modules/decode-uri-component/readme.md new file mode 100644 index 000000000..795c87ff7 --- /dev/null +++ b/node_modules/decode-uri-component/readme.md @@ -0,0 +1,70 @@ +# decode-uri-component + +[![Build Status](https://travis-ci.org/SamVerschueren/decode-uri-component.svg?branch=master)](https://travis-ci.org/SamVerschueren/decode-uri-component) [![Coverage Status](https://coveralls.io/repos/SamVerschueren/decode-uri-component/badge.svg?branch=master&service=github)](https://coveralls.io/github/SamVerschueren/decode-uri-component?branch=master) + +> A better [decodeURIComponent](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent) + + +## Why? + +- Decodes `+` to a space. +- Converts the [BOM](https://en.wikipedia.org/wiki/Byte_order_mark) to a [replacement character](https://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character) `�`. +- Does not throw with invalid encoded input. +- Decodes as much of the string as possible. + + +## Install + +``` +$ npm install --save decode-uri-component +``` + + +## Usage + +```js +const decodeUriComponent = require('decode-uri-component'); + +decodeUriComponent('%25'); +//=> '%' + +decodeUriComponent('%'); +//=> '%' + +decodeUriComponent('st%C3%A5le'); +//=> 'ståle' + +decodeUriComponent('%st%C3%A5le%'); +//=> '%ståle%' + +decodeUriComponent('%%7Bst%C3%A5le%7D%'); +//=> '%{ståle}%' + +decodeUriComponent('%7B%ab%%7C%de%%7D'); +//=> '{%ab%|%de%}' + +decodeUriComponent('%FE%FF'); +//=> '\uFFFD\uFFFD' + +decodeUriComponent('%C2'); +//=> '\uFFFD' + +decodeUriComponent('%C2%B5'); +//=> 'µ' +``` + + +## API + +### decodeUriComponent(encodedURI) + +#### encodedURI + +Type: `string` + +An encoded component of a Uniform Resource Identifier. + + +## License + +MIT © [Sam Verschueren](https://github.com/SamVerschueren) diff --git a/node_modules/default-gateway/LICENSE b/node_modules/default-gateway/LICENSE new file mode 100644 index 000000000..9669c20f8 --- /dev/null +++ b/node_modules/default-gateway/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) silverwind +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL 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. diff --git a/node_modules/default-gateway/README.md b/node_modules/default-gateway/README.md new file mode 100644 index 000000000..e7497a2ac --- /dev/null +++ b/node_modules/default-gateway/README.md @@ -0,0 +1,50 @@ +# default-gateway +[![](https://img.shields.io/npm/v/default-gateway.svg?style=flat)](https://www.npmjs.org/package/default-gateway) [![](https://img.shields.io/npm/dm/default-gateway.svg)](https://www.npmjs.org/package/default-gateway) [![](https://api.travis-ci.org/silverwind/default-gateway.svg?style=flat)](https://travis-ci.org/silverwind/default-gateway) + +> Get the default network gateway, cross-platform. + +Obtains the machine's default gateway through `exec` calls to OS routing interfaces. On Linux and Android, the `ip` command must be available (usually provided by the `iproute2` package). + +## Installation + +``` +$ npm install default-gateway +``` + +## Example + +```js +const defaultGateway = require('default-gateway'); + +defaultGateway.v4().then(result => { + // result = {gateway: '1.2.3.4', interface: 'en1'} +}); + +defaultGateway.v6().then(result => { + // result = {gateway: '2001:db8::1', interface: 'en2'} +}); + +const result = defaultGateway.v4.sync(); +// result = {gateway: '1.2.3.4', interface: 'en1'} + +const result = defaultGateway.v6.sync(); +// result = {gateway: '2001:db8::1', interface: 'en2'} +``` + +## API +### defaultGateway.v4() +### defaultGateway.v6() +### defaultGateway.v4.sync() +### defaultGateway.v6.sync() + +Returns: `result` *Object* + - `gateway`: The IP address of the default gateway. + - `interface`: The name of the interface. On Windows, this is the network adapter name. + +The `.v{4,6}()` methods return a Promise while the `.v{4,6}.sync()` variants will return the result synchronously. + +The `gateway` property will always be defined on success, while `interface` can be `null` if it cannot be determined. All methods reject/throw when the gateway cannot be determined or the `exec` call failed. + +## License + +© [silverwind](https://github.com/silverwind), distributed under BSD licence diff --git a/node_modules/default-gateway/android.js b/node_modules/default-gateway/android.js new file mode 100644 index 000000000..6d0ac1a07 --- /dev/null +++ b/node_modules/default-gateway/android.js @@ -0,0 +1,46 @@ +"use strict"; + +const net = require("net"); +const execa = require("execa"); + +const args = { + v4: ["-4", "r"], + v6: ["-6", "r"], +}; + +const parse = stdout => { + let result; + + (stdout || "").trim().split("\n").some(line => { + const results = /default via (.+?) dev (.+?)( |$)/.exec(line) || []; + const gateway = results[1]; + const iface = results[2]; + if (gateway && net.isIP(gateway)) { + result = {gateway: gateway, interface: (iface ? iface : null)}; + return true; + } + }); + + if (!result) { + throw new Error("Unable to determine default gateway"); + } + + return result; +}; + +const promise = family => { + return execa.stdout("ip", args[family]).then(stdout => { + return parse(stdout); + }); +}; + +const sync = family => { + const result = execa.sync("ip", args[family]); + return parse(result.stdout); +}; + +module.exports.v4 = () => promise("v4"); +module.exports.v6 = () => promise("v6"); + +module.exports.v4.sync = () => sync("v4"); +module.exports.v6.sync = () => sync("v6"); diff --git a/node_modules/default-gateway/darwin.js b/node_modules/default-gateway/darwin.js new file mode 100644 index 000000000..e7a190efd --- /dev/null +++ b/node_modules/default-gateway/darwin.js @@ -0,0 +1,48 @@ +"use strict"; + +const net = require("net"); +const execa = require("execa"); +const dests = ["default", "0.0.0.0", "0.0.0.0/0", "::", "::/0"]; + +const args = { + v4: ["-rn", "-f", "inet"], + v6: ["-rn", "-f", "inet6"], +}; + +const parse = (stdout, family) => { + let result; + + (stdout || "").trim().split("\n").some(line => { + const results = line.split(/ +/) || []; + const target = results[0]; + const gateway = results[1]; + const iface = results[family === "v4" ? 5 : 3]; + if (dests.indexOf(target) !== -1 && gateway && net.isIP(gateway)) { + result = {gateway: gateway, interface: (iface ? iface : null)}; + return true; + } + }); + + if (!result) { + throw new Error("Unable to determine default gateway"); + } + + return result; +}; + +const promise = family => { + return execa.stdout("netstat", args[family]).then(stdout => { + return parse(stdout, family); + }); +}; + +const sync = family => { + const result = execa.sync("netstat", args[family]); + return parse(result.stdout, family); +}; + +module.exports.v4 = () => promise("v4"); +module.exports.v6 = () => promise("v6"); + +module.exports.v4.sync = () => sync("v4"); +module.exports.v6.sync = () => sync("v6"); diff --git a/node_modules/default-gateway/freebsd.js b/node_modules/default-gateway/freebsd.js new file mode 100644 index 000000000..77c626f8d --- /dev/null +++ b/node_modules/default-gateway/freebsd.js @@ -0,0 +1,48 @@ +"use strict"; + +const net = require("net"); +const execa = require("execa"); +const dests = ["default", "0.0.0.0", "0.0.0.0/0", "::", "::/0"]; + +const args = { + v4: ["-rn", "-f", "inet"], + v6: ["-rn", "-f", "inet6"], +}; + +const parse = stdout => { + let result; + + (stdout || "").trim().split("\n").some(line => { + const results = line.split(/ +/) || []; + const target = results[0]; + const gateway = results[1]; + const iface = results[3]; + if (dests.indexOf(target) !== -1 && gateway && net.isIP(gateway)) { + result = {gateway: gateway, interface: (iface ? iface : null)}; + return true; + } + }); + + if (!result) { + throw new Error("Unable to determine default gateway"); + } + + return result; +}; + +const promise = family => { + return execa.stdout("netstat", args[family]).then(stdout => { + return parse(stdout); + }); +}; + +const sync = family => { + const result = execa.sync("netstat", args[family]); + return parse(result.stdout); +}; + +module.exports.v4 = () => promise("v4"); +module.exports.v6 = () => promise("v6"); + +module.exports.v4.sync = () => sync("v4"); +module.exports.v6.sync = () => sync("v6"); diff --git a/node_modules/default-gateway/index.js b/node_modules/default-gateway/index.js new file mode 100644 index 000000000..76da2b4b1 --- /dev/null +++ b/node_modules/default-gateway/index.js @@ -0,0 +1,25 @@ +"use strict"; + +const platform = require("os").platform(); + +if ([ + "android", + "darwin", + "freebsd", + "linux", + "openbsd", + "sunos", + "win32" +].indexOf(platform) !== -1) { + const families = require(`./${platform}`); + module.exports.v4 = () => families.v4(); + module.exports.v6 = () => families.v6(); + module.exports.v4.sync = () => families.v4.sync(); + module.exports.v6.sync = () => families.v6.sync(); +} else { + const noop = () => { throw new Error(`Unsupported Platform: ${platform}`); }; + module.exports.v4 = noop; + module.exports.v6 = noop; + module.exports.v4.sync = noop; + module.exports.v6.sync = noop; +} diff --git a/node_modules/default-gateway/linux.js b/node_modules/default-gateway/linux.js new file mode 100644 index 000000000..ed564abc8 --- /dev/null +++ b/node_modules/default-gateway/linux.js @@ -0,0 +1,58 @@ +"use strict"; + +const net = require("net"); +const os = require("os"); +const execa = require("execa"); + +const args = { + v4: ["-4", "r"], + v6: ["-6", "r"], +}; + +const parse = (stdout, family) => { + let result; + + (stdout || "").trim().split("\n").some(line => { + const results = /default( via .+?)?( dev .+?)( |$)/.exec(line) || []; + const gateway = (results[1] || "").substring(5); + const iface = (results[2] || "").substring(5); + if (gateway && net.isIP(gateway)) { // default via 1.2.3.4 dev en0 + result = {gateway: gateway, interface: (iface ? iface : null)}; + return true; + } else if (iface && !gateway) { // default via dev en0 + const interfaces = os.networkInterfaces(); + const addresses = interfaces[iface]; + if (!addresses || !addresses.length) return; + + addresses.some(addr => { + if (addr.family.substring(2) === family && net.isIP(addr.address)) { + result = {gateway: addr.address, interface: (iface ? iface : null)}; + return true; + } + }); + } + }); + + if (!result) { + throw new Error("Unable to determine default gateway"); + } + + return result; +}; + +const promise = family => { + return execa.stdout("ip", args[family]).then(stdout => { + return parse(stdout, family); + }); +}; + +const sync = family => { + const result = execa.sync("ip", args[family]); + return parse(result.stdout, family); +}; + +module.exports.v4 = () => promise("v4"); +module.exports.v6 = () => promise("v6"); + +module.exports.v4.sync = () => sync("v4"); +module.exports.v6.sync = () => sync("v6"); diff --git a/node_modules/default-gateway/openbsd.js b/node_modules/default-gateway/openbsd.js new file mode 100644 index 000000000..e03bca54f --- /dev/null +++ b/node_modules/default-gateway/openbsd.js @@ -0,0 +1,48 @@ +"use strict"; + +const net = require("net"); +const execa = require("execa"); +const dests = ["default", "0.0.0.0", "0.0.0.0/0", "::", "::/0"]; + +const args = { + v4: ["-rn", "-f", "inet"], + v6: ["-rn", "-f", "inet6"], +}; + +const parse = stdout => { + let result; + + (stdout || "").trim().split("\n").some(line => { + const results = line.split(/ +/) || []; + const target = results[0]; + const gateway = results[1]; + const iface = results[7]; + if (dests.indexOf(target) !== -1 && gateway && net.isIP(gateway)) { + result = {gateway: gateway, interface: (iface ? iface : null)}; + return true; + } + }); + + if (!result) { + throw new Error("Unable to determine default gateway"); + } + + return result; +}; + +const promise = family => { + return execa.stdout("netstat", args[family]).then(stdout => { + return parse(stdout); + }); +}; + +const sync = family => { + const result = execa.sync("netstat", args[family]); + return parse(result.stdout); +}; + +module.exports.v4 = () => promise("v4"); +module.exports.v6 = () => promise("v6"); + +module.exports.v4.sync = () => sync("v4"); +module.exports.v6.sync = () => sync("v6"); diff --git a/node_modules/default-gateway/package.json b/node_modules/default-gateway/package.json new file mode 100644 index 000000000..18a5b3fc6 --- /dev/null +++ b/node_modules/default-gateway/package.json @@ -0,0 +1,85 @@ +{ + "_from": "default-gateway@^2.6.0", + "_id": "default-gateway@2.7.2", + "_inBundle": false, + "_integrity": "sha512-lAc4i9QJR0YHSDFdzeBQKfZ1SRDG3hsJNEkrpcZa8QhBfidLAilT60BDEIVUUGqosFp425KOgB3uYqcnQrWafQ==", + "_location": "/default-gateway", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "default-gateway@^2.6.0", + "name": "default-gateway", + "escapedName": "default-gateway", + "rawSpec": "^2.6.0", + "saveSpec": null, + "fetchSpec": "^2.6.0" + }, + "_requiredBy": [ + "/internal-ip" + ], + "_resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-2.7.2.tgz", + "_shasum": "b7ef339e5e024b045467af403d50348db4642d0f", + "_spec": "default-gateway@^2.6.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/internal-ip", + "author": { + "name": "silverwind", + "email": "me@silverwind.io" + }, + "bugs": { + "url": "https://github.com/silverwind/default-gateway/issues" + }, + "bundleDependencies": false, + "dependencies": { + "execa": "^0.10.0", + "ip-regex": "^2.1.0" + }, + "deprecated": false, + "description": "Get the default network gateway, cross-platform.", + "devDependencies": { + "eslint": "^4.19.1", + "eslint-config-silverwind": "^1.0.42", + "updates": "^3.0.0" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js", + "android.js", + "darwin.js", + "freebsd.js", + "linux.js", + "openbsd.js", + "sunos.js", + "win32.js" + ], + "homepage": "https://github.com/silverwind/default-gateway#readme", + "keywords": [ + "default gateway", + "network", + "default", + "gateway", + "routing", + "route" + ], + "license": "BSD-2-Clause", + "name": "default-gateway", + "os": [ + "android", + "darwin", + "freebsd", + "linux", + "openbsd", + "sunos", + "win32" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/silverwind/default-gateway.git" + }, + "scripts": { + "test": "make test" + }, + "version": "2.7.2" +} diff --git a/node_modules/default-gateway/sunos.js b/node_modules/default-gateway/sunos.js new file mode 100644 index 000000000..f1d0ab77b --- /dev/null +++ b/node_modules/default-gateway/sunos.js @@ -0,0 +1,48 @@ +"use strict"; + +const net = require("net"); +const execa = require("execa"); +const dests = ["default", "0.0.0.0", "0.0.0.0/0", "::", "::/0"]; + +const args = { + v4: ["-rn", "-f", "inet"], + v6: ["-rn", "-f", "inet6"], +}; + +const parse = stdout => { + let result; + + (stdout || "").trim().split("\n").some(line => { + const results = line.split(/ +/) || []; + const target = results[0]; + const gateway = results[1]; + const iface = results[5]; + if (dests.indexOf(target) !== -1 && gateway && net.isIP(gateway)) { + result = {gateway: gateway, interface: (iface ? iface : null)}; + return true; + } + }); + + if (!result) { + throw new Error("Unable to determine default gateway"); + } + + return result; +}; + +const promise = family => { + return execa.stdout("netstat", args[family]).then(stdout => { + return parse(stdout); + }); +}; + +const sync = family => { + const result = execa.sync("netstat", args[family]); + return parse(result.stdout); +}; + +module.exports.v4 = () => promise("v4"); +module.exports.v6 = () => promise("v6"); + +module.exports.v4.sync = () => sync("v4"); +module.exports.v6.sync = () => sync("v6"); diff --git a/node_modules/default-gateway/win32.js b/node_modules/default-gateway/win32.js new file mode 100644 index 000000000..9172dd5d8 --- /dev/null +++ b/node_modules/default-gateway/win32.js @@ -0,0 +1,67 @@ +"use strict"; + +const execa = require("execa"); +const ipRegex = require("ip-regex"); + +const gwArgs = "path Win32_NetworkAdapterConfiguration where IPEnabled=true get DefaultIPGateway,Index /format:table".split(" "); +const ifArgs = "path Win32_NetworkAdapter get Index,NetConnectionID /format:table".split(" "); + +const parse = (gwTable, ifTable, family) => { + let gateway, gwid, result; + + (gwTable || "").trim().split("\n").splice(1).some(line => { + const results = line.trim().split(/} +/) || []; + const gw = results[0]; + const id = results[1]; + gateway = (ipRegex[family]().exec((gw || "").trim()) || [])[0]; + if (gateway) { + gwid = id; + return true; + } + }); + + (ifTable || "").trim().split("\n").splice(1).some(line => { + const i = line.indexOf(" "); + const id = line.substr(0, i).trim(); + const name = line.substr(i + 1).trim(); + if (id === gwid) { + result = {gateway: gateway, interface: name ? name : null}; + return true; + } + }); + + if (!result) { + throw new Error("Unable to determine default gateway"); + } + + return result; +}; + +const spawnOpts = { + windowsHide: true, +}; + +const promise = family => { + return Promise.all([ + execa.stdout("wmic", gwArgs, spawnOpts), + execa.stdout("wmic", ifArgs, spawnOpts), + ]).then(results => { + const gwTable = results[0]; + const ifTable = results[1]; + + return parse(gwTable, ifTable, family); + }); +}; + +const sync = family => { + const gwTable = execa.sync("wmic", gwArgs, spawnOpts).stdout; + const ifTable = execa.sync("wmic", ifArgs, spawnOpts).stdout; + + return parse(gwTable, ifTable, family); +}; + +module.exports.v4 = () => promise("v4"); +module.exports.v6 = () => promise("v6"); + +module.exports.v4.sync = () => sync("v4"); +module.exports.v6.sync = () => sync("v6"); diff --git a/node_modules/define-property/CHANGELOG.md b/node_modules/define-property/CHANGELOG.md new file mode 100644 index 000000000..901c8aaee --- /dev/null +++ b/node_modules/define-property/CHANGELOG.md @@ -0,0 +1,82 @@ +# Release history + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +
+ Guiding Principles + +- Changelogs are for humans, not machines. +- There should be an entry for every single version. +- The same types of changes should be grouped. +- Versions and sections should be linkable. +- The latest version comes first. +- The release date of each versions is displayed. +- Mention whether you follow Semantic Versioning. + +
+ +
+ Types of changes + +Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_): + +- `Added` for new features. +- `Changed` for changes in existing functionality. +- `Deprecated` for soon-to-be removed features. +- `Removed` for now removed features. +- `Fixed` for any bug fixes. +- `Security` in case of vulnerabilities. + +
+ +## [2.0.0] - 2017-04-20 + +### Changed + +- Now supports data descriptors in addition to accessor descriptors. +- Now uses [Reflect.defineProperty][reflect] when available, otherwise falls back to [Object.defineProperty][object]. + +## [1.0.0] - 2017-04-20 + +- stable release + +## [0.2.5] - 2015-08-31 + +- use is-descriptor + +## [0.2.3] - 2015-08-29 + +- check keys length + +## [0.2.2] - 2015-08-27 + +- ensure val is an object + +## [0.2.1] - 2015-08-27 + +- support functions + +## [0.2.0] - 2015-08-27 + +- support get/set +- update docs + +## [0.1.0] - 2015-08-12 + +- first commit + +[2.0.0]: https://github.com/jonschlinkert/define-property/compare/1.0.0...2.0.0 +[1.0.0]: https://github.com/jonschlinkert/define-property/compare/0.2.5...1.0.0 +[0.2.5]: https://github.com/jonschlinkert/define-property/compare/0.2.3...0.2.5 +[0.2.3]: https://github.com/jonschlinkert/define-property/compare/0.2.2...0.2.3 +[0.2.2]: https://github.com/jonschlinkert/define-property/compare/0.2.1...0.2.2 +[0.2.1]: https://github.com/jonschlinkert/define-property/compare/0.2.0...0.2.1 +[0.2.0]: https://github.com/jonschlinkert/define-property/compare/0.1.3...0.2.0 + +[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog + +[object]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty +[reflect]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect/defineProperty diff --git a/node_modules/define-property/LICENSE b/node_modules/define-property/LICENSE new file mode 100644 index 000000000..f8de06305 --- /dev/null +++ b/node_modules/define-property/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2018, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/define-property/README.md b/node_modules/define-property/README.md new file mode 100644 index 000000000..f1ee8f92e --- /dev/null +++ b/node_modules/define-property/README.md @@ -0,0 +1,117 @@ +# define-property [![NPM version](https://img.shields.io/npm/v/define-property.svg?style=flat)](https://www.npmjs.com/package/define-property) [![NPM monthly downloads](https://img.shields.io/npm/dm/define-property.svg?style=flat)](https://npmjs.org/package/define-property) [![NPM total downloads](https://img.shields.io/npm/dt/define-property.svg?style=flat)](https://npmjs.org/package/define-property) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/define-property.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/define-property) + +> Define a non-enumerable property on an object. Uses Reflect.defineProperty when available, otherwise Object.defineProperty. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save define-property +``` + +## Release history + +See [the CHANGELOG](changelog.md) for updates. + +## Usage + +**Params** + +* `object`: The object on which to define the property. +* `key`: The name of the property to be defined or modified. +* `value`: The value or descriptor of the property being defined or modified. + +```js +var define = require('define-property'); +var obj = {}; +define(obj, 'foo', function(val) { + return val.toUpperCase(); +}); + +// by default, defined properties are non-enumberable +console.log(obj); +//=> {} + +console.log(obj.foo('bar')); +//=> 'BAR' +``` + +**defining setters/getters** + +Pass the same properties you would if using [Object.defineProperty](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty) or [Reflect.defineProperty](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect/defineProperty). + +```js +define(obj, 'foo', { + set: function() {}, + get: function() {} +}); +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [assign-deep](https://www.npmjs.com/package/assign-deep): Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target… [more](https://github.com/jonschlinkert/assign-deep) | [homepage](https://github.com/jonschlinkert/assign-deep "Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target (first) object.") +* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") +* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") +* [mixin-deep](https://www.npmjs.com/package/mixin-deep): Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. | [homepage](https://github.com/jonschlinkert/mixin-deep "Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 28 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [doowb](https://github.com/doowb) | + +### Author + +**Jon Schlinkert** + +* Connect with me on [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) +* Follow me on [github/jonschlinkert](https://github.com/jonschlinkert) +* Follow me on [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on January 25, 2018._ \ No newline at end of file diff --git a/node_modules/define-property/index.js b/node_modules/define-property/index.js new file mode 100644 index 000000000..0efa0a9e6 --- /dev/null +++ b/node_modules/define-property/index.js @@ -0,0 +1,38 @@ +/*! + * define-property + * + * Copyright (c) 2015-2018, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var isobject = require('isobject'); +var isDescriptor = require('is-descriptor'); +var define = (typeof Reflect !== 'undefined' && Reflect.defineProperty) + ? Reflect.defineProperty + : Object.defineProperty; + +module.exports = function defineProperty(obj, key, val) { + if (!isobject(obj) && typeof obj !== 'function' && !Array.isArray(obj)) { + throw new TypeError('expected an object, function, or array'); + } + + if (typeof key !== 'string') { + throw new TypeError('expected "key" to be a string'); + } + + if (isDescriptor(val)) { + define(obj, key, val); + return obj; + } + + define(obj, key, { + configurable: true, + enumerable: false, + writable: true, + value: val + }); + + return obj; +}; diff --git a/node_modules/define-property/node_modules/is-accessor-descriptor/LICENSE b/node_modules/define-property/node_modules/is-accessor-descriptor/LICENSE new file mode 100644 index 000000000..e33d14b75 --- /dev/null +++ b/node_modules/define-property/node_modules/is-accessor-descriptor/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/define-property/node_modules/is-accessor-descriptor/README.md b/node_modules/define-property/node_modules/is-accessor-descriptor/README.md new file mode 100644 index 000000000..d198e1f05 --- /dev/null +++ b/node_modules/define-property/node_modules/is-accessor-descriptor/README.md @@ -0,0 +1,144 @@ +# is-accessor-descriptor [![NPM version](https://img.shields.io/npm/v/is-accessor-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-accessor-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-accessor-descriptor.svg?style=flat)](https://npmjs.org/package/is-accessor-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-accessor-descriptor.svg?style=flat)](https://npmjs.org/package/is-accessor-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-accessor-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-accessor-descriptor) + +> Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-accessor-descriptor +``` + +## Usage + +```js +var isAccessor = require('is-accessor-descriptor'); + +isAccessor({get: function() {}}); +//=> true +``` + +You may also pass an object and property name to check if the property is an accessor: + +```js +isAccessor(foo, 'bar'); +``` + +## Examples + +`false` when not an object + +```js +isAccessor('a') +isAccessor(null) +isAccessor([]) +//=> false +``` + +`true` when the object has valid properties + +and the properties all have the correct JavaScript types: + +```js +isAccessor({get: noop, set: noop}) +isAccessor({get: noop}) +isAccessor({set: noop}) +//=> true +``` + +`false` when the object has invalid properties + +```js +isAccessor({get: noop, set: noop, bar: 'baz'}) +isAccessor({get: noop, writable: true}) +isAccessor({get: noop, value: true}) +//=> false +``` + +`false` when an accessor is not a function + +```js +isAccessor({get: noop, set: 'baz'}) +isAccessor({get: 'foo', set: noop}) +isAccessor({get: 'foo', bar: 'baz'}) +isAccessor({get: 'foo', set: 'baz'}) +//=> false +``` + +`false` when a value is not the correct type + +```js +isAccessor({get: noop, set: noop, enumerable: 'foo'}) +isAccessor({set: noop, configurable: 'foo'}) +isAccessor({get: noop, configurable: 'foo'}) +//=> false +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.") +* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.") +* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.") +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 22 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [realityking](https://github.com/realityking) | + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on November 01, 2017._ \ No newline at end of file diff --git a/node_modules/define-property/node_modules/is-accessor-descriptor/index.js b/node_modules/define-property/node_modules/is-accessor-descriptor/index.js new file mode 100644 index 000000000..d2e6fe8b9 --- /dev/null +++ b/node_modules/define-property/node_modules/is-accessor-descriptor/index.js @@ -0,0 +1,69 @@ +/*! + * is-accessor-descriptor + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var typeOf = require('kind-of'); + +// accessor descriptor properties +var accessor = { + get: 'function', + set: 'function', + configurable: 'boolean', + enumerable: 'boolean' +}; + +function isAccessorDescriptor(obj, prop) { + if (typeof prop === 'string') { + var val = Object.getOwnPropertyDescriptor(obj, prop); + return typeof val !== 'undefined'; + } + + if (typeOf(obj) !== 'object') { + return false; + } + + if (has(obj, 'value') || has(obj, 'writable')) { + return false; + } + + if (!has(obj, 'get') || typeof obj.get !== 'function') { + return false; + } + + // tldr: it's valid to have "set" be undefined + // "set" might be undefined if `Object.getOwnPropertyDescriptor` + // was used to get the value, and only `get` was defined by the user + if (has(obj, 'set') && typeof obj[key] !== 'function' && typeof obj[key] !== 'undefined') { + return false; + } + + for (var key in obj) { + if (!accessor.hasOwnProperty(key)) { + continue; + } + + if (typeOf(obj[key]) === accessor[key]) { + continue; + } + + if (typeof obj[key] !== 'undefined') { + return false; + } + } + return true; +} + +function has(obj, key) { + return {}.hasOwnProperty.call(obj, key); +} + +/** + * Expose `isAccessorDescriptor` + */ + +module.exports = isAccessorDescriptor; diff --git a/node_modules/define-property/node_modules/is-accessor-descriptor/package.json b/node_modules/define-property/node_modules/is-accessor-descriptor/package.json new file mode 100644 index 000000000..8a06c3fa2 --- /dev/null +++ b/node_modules/define-property/node_modules/is-accessor-descriptor/package.json @@ -0,0 +1,110 @@ +{ + "_from": "is-accessor-descriptor@^1.0.0", + "_id": "is-accessor-descriptor@1.0.0", + "_inBundle": false, + "_integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "_location": "/define-property/is-accessor-descriptor", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-accessor-descriptor@^1.0.0", + "name": "is-accessor-descriptor", + "escapedName": "is-accessor-descriptor", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/define-property/is-descriptor" + ], + "_resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "_shasum": "169c2f6d3df1f992618072365c9b0ea1f6878656", + "_spec": "is-accessor-descriptor@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/define-property/node_modules/is-descriptor", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-accessor-descriptor/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Rouven Weßling", + "url": "www.rouvenwessling.de" + } + ], + "dependencies": { + "kind-of": "^6.0.0" + }, + "deprecated": false, + "description": "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.5.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-accessor-descriptor", + "keywords": [ + "accessor", + "check", + "data", + "descriptor", + "get", + "getter", + "is", + "keys", + "object", + "properties", + "property", + "set", + "setter", + "type", + "valid", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "is-accessor-descriptor", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-accessor-descriptor.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "is-accessor-descriptor", + "is-data-descriptor", + "is-descriptor", + "is-plain-object", + "isobject" + ] + }, + "lint": { + "reflinks": true + } + }, + "version": "1.0.0" +} diff --git a/node_modules/define-property/node_modules/is-data-descriptor/LICENSE b/node_modules/define-property/node_modules/is-data-descriptor/LICENSE new file mode 100644 index 000000000..e33d14b75 --- /dev/null +++ b/node_modules/define-property/node_modules/is-data-descriptor/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/define-property/node_modules/is-data-descriptor/README.md b/node_modules/define-property/node_modules/is-data-descriptor/README.md new file mode 100644 index 000000000..42b071446 --- /dev/null +++ b/node_modules/define-property/node_modules/is-data-descriptor/README.md @@ -0,0 +1,161 @@ +# is-data-descriptor [![NPM version](https://img.shields.io/npm/v/is-data-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-data-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-data-descriptor.svg?style=flat)](https://npmjs.org/package/is-data-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-data-descriptor.svg?style=flat)](https://npmjs.org/package/is-data-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-data-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-data-descriptor) + +> Returns true if a value has the characteristics of a valid JavaScript data descriptor. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-data-descriptor +``` + +## Usage + +```js +var isDataDesc = require('is-data-descriptor'); +``` + +## Examples + +`true` when the descriptor has valid properties with valid values. + +```js +// `value` can be anything +isDataDesc({value: 'foo'}) +isDataDesc({value: function() {}}) +isDataDesc({value: true}) +//=> true +``` + +`false` when not an object + +```js +isDataDesc('a') +//=> false +isDataDesc(null) +//=> false +isDataDesc([]) +//=> false +``` + +`false` when the object has invalid properties + +```js +isDataDesc({value: 'foo', bar: 'baz'}) +//=> false +isDataDesc({value: 'foo', bar: 'baz'}) +//=> false +isDataDesc({value: 'foo', get: function(){}}) +//=> false +isDataDesc({get: function(){}, value: 'foo'}) +//=> false +``` + +`false` when a value is not the correct type + +```js +isDataDesc({value: 'foo', enumerable: 'foo'}) +//=> false +isDataDesc({value: 'foo', configurable: 'foo'}) +//=> false +isDataDesc({value: 'foo', writable: 'foo'}) +//=> false +``` + +## Valid properties + +The only valid data descriptor properties are the following: + +* `configurable` (required) +* `enumerable` (required) +* `value` (optional) +* `writable` (optional) + +To be a valid data descriptor, either `value` or `writable` must be defined. + +**Invalid properties** + +A descriptor may have additional _invalid_ properties (an error will **not** be thrown). + +```js +var foo = {}; + +Object.defineProperty(foo, 'bar', { + enumerable: true, + whatever: 'blah', // invalid, but doesn't cause an error + get: function() { + return 'baz'; + } +}); + +console.log(foo.bar); +//=> 'baz' +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.") +* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.") +* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 21 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [realityking](https://github.com/realityking) | + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on November 01, 2017._ \ No newline at end of file diff --git a/node_modules/define-property/node_modules/is-data-descriptor/index.js b/node_modules/define-property/node_modules/is-data-descriptor/index.js new file mode 100644 index 000000000..cfeae3619 --- /dev/null +++ b/node_modules/define-property/node_modules/is-data-descriptor/index.js @@ -0,0 +1,49 @@ +/*! + * is-data-descriptor + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var typeOf = require('kind-of'); + +module.exports = function isDataDescriptor(obj, prop) { + // data descriptor properties + var data = { + configurable: 'boolean', + enumerable: 'boolean', + writable: 'boolean' + }; + + if (typeOf(obj) !== 'object') { + return false; + } + + if (typeof prop === 'string') { + var val = Object.getOwnPropertyDescriptor(obj, prop); + return typeof val !== 'undefined'; + } + + if (!('value' in obj) && !('writable' in obj)) { + return false; + } + + for (var key in obj) { + if (key === 'value') continue; + + if (!data.hasOwnProperty(key)) { + continue; + } + + if (typeOf(obj[key]) === data[key]) { + continue; + } + + if (typeof obj[key] !== 'undefined') { + return false; + } + } + return true; +}; diff --git a/node_modules/define-property/node_modules/is-data-descriptor/package.json b/node_modules/define-property/node_modules/is-data-descriptor/package.json new file mode 100644 index 000000000..a8da3347a --- /dev/null +++ b/node_modules/define-property/node_modules/is-data-descriptor/package.json @@ -0,0 +1,109 @@ +{ + "_from": "is-data-descriptor@^1.0.0", + "_id": "is-data-descriptor@1.0.0", + "_inBundle": false, + "_integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "_location": "/define-property/is-data-descriptor", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-data-descriptor@^1.0.0", + "name": "is-data-descriptor", + "escapedName": "is-data-descriptor", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/define-property/is-descriptor" + ], + "_resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "_shasum": "d84876321d0e7add03990406abbbbd36ba9268c7", + "_spec": "is-data-descriptor@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/define-property/node_modules/is-descriptor", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-data-descriptor/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Rouven Weßling", + "url": "www.rouvenwessling.de" + } + ], + "dependencies": { + "kind-of": "^6.0.0" + }, + "deprecated": false, + "description": "Returns true if a value has the characteristics of a valid JavaScript data descriptor.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.5.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-data-descriptor", + "keywords": [ + "accessor", + "check", + "data", + "descriptor", + "get", + "getter", + "is", + "keys", + "object", + "properties", + "property", + "set", + "setter", + "type", + "valid", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "is-data-descriptor", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-data-descriptor.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "is-accessor-descriptor", + "is-data-descriptor", + "is-descriptor", + "isobject" + ] + }, + "lint": { + "reflinks": true + } + }, + "version": "1.0.0" +} diff --git a/node_modules/define-property/node_modules/is-descriptor/LICENSE b/node_modules/define-property/node_modules/is-descriptor/LICENSE new file mode 100644 index 000000000..c0d7f1362 --- /dev/null +++ b/node_modules/define-property/node_modules/is-descriptor/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert. + +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. \ No newline at end of file diff --git a/node_modules/define-property/node_modules/is-descriptor/README.md b/node_modules/define-property/node_modules/is-descriptor/README.md new file mode 100644 index 000000000..658e53301 --- /dev/null +++ b/node_modules/define-property/node_modules/is-descriptor/README.md @@ -0,0 +1,193 @@ +# is-descriptor [![NPM version](https://img.shields.io/npm/v/is-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-descriptor) + +> Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-descriptor +``` + +## Usage + +```js +var isDescriptor = require('is-descriptor'); + +isDescriptor({value: 'foo'}) +//=> true +isDescriptor({get: function(){}, set: function(){}}) +//=> true +isDescriptor({get: 'foo', set: function(){}}) +//=> false +``` + +You may also check for a descriptor by passing an object as the first argument and property name (`string`) as the second argument. + +```js +var obj = {}; +obj.foo = 'abc'; + +Object.defineProperty(obj, 'bar', { + value: 'xyz' +}); + +isDescriptor(obj, 'foo'); +//=> true +isDescriptor(obj, 'bar'); +//=> true +``` + +## Examples + +### value type + +`false` when not an object + +```js +isDescriptor('a'); +//=> false +isDescriptor(null); +//=> false +isDescriptor([]); +//=> false +``` + +### data descriptor + +`true` when the object has valid properties with valid values. + +```js +isDescriptor({value: 'foo'}); +//=> true +isDescriptor({value: noop}); +//=> true +``` + +`false` when the object has invalid properties + +```js +isDescriptor({value: 'foo', bar: 'baz'}); +//=> false +isDescriptor({value: 'foo', bar: 'baz'}); +//=> false +isDescriptor({value: 'foo', get: noop}); +//=> false +isDescriptor({get: noop, value: noop}); +//=> false +``` + +`false` when a value is not the correct type + +```js +isDescriptor({value: 'foo', enumerable: 'foo'}); +//=> false +isDescriptor({value: 'foo', configurable: 'foo'}); +//=> false +isDescriptor({value: 'foo', writable: 'foo'}); +//=> false +``` + +### accessor descriptor + +`true` when the object has valid properties with valid values. + +```js +isDescriptor({get: noop, set: noop}); +//=> true +isDescriptor({get: noop}); +//=> true +isDescriptor({set: noop}); +//=> true +``` + +`false` when the object has invalid properties + +```js +isDescriptor({get: noop, set: noop, bar: 'baz'}); +//=> false +isDescriptor({get: noop, writable: true}); +//=> false +isDescriptor({get: noop, value: true}); +//=> false +``` + +`false` when an accessor is not a function + +```js +isDescriptor({get: noop, set: 'baz'}); +//=> false +isDescriptor({get: 'foo', set: noop}); +//=> false +isDescriptor({get: 'foo', bar: 'baz'}); +//=> false +isDescriptor({get: 'foo', set: 'baz'}); +//=> false +``` + +`false` when a value is not the correct type + +```js +isDescriptor({get: noop, set: noop, enumerable: 'foo'}); +//=> false +isDescriptor({set: noop, configurable: 'foo'}); +//=> false +isDescriptor({get: noop, configurable: 'foo'}); +//=> false +``` + +## About + +### Related projects + +* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.") +* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.") +* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 24 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [doowb](https://github.com/doowb) | +| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 22, 2017._ \ No newline at end of file diff --git a/node_modules/define-property/node_modules/is-descriptor/index.js b/node_modules/define-property/node_modules/is-descriptor/index.js new file mode 100644 index 000000000..c9b91d762 --- /dev/null +++ b/node_modules/define-property/node_modules/is-descriptor/index.js @@ -0,0 +1,22 @@ +/*! + * is-descriptor + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var typeOf = require('kind-of'); +var isAccessor = require('is-accessor-descriptor'); +var isData = require('is-data-descriptor'); + +module.exports = function isDescriptor(obj, key) { + if (typeOf(obj) !== 'object') { + return false; + } + if ('get' in obj) { + return isAccessor(obj, key); + } + return isData(obj, key); +}; diff --git a/node_modules/define-property/node_modules/is-descriptor/package.json b/node_modules/define-property/node_modules/is-descriptor/package.json new file mode 100644 index 000000000..a436bbb2f --- /dev/null +++ b/node_modules/define-property/node_modules/is-descriptor/package.json @@ -0,0 +1,114 @@ +{ + "_from": "is-descriptor@^1.0.2", + "_id": "is-descriptor@1.0.2", + "_inBundle": false, + "_integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "_location": "/define-property/is-descriptor", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-descriptor@^1.0.2", + "name": "is-descriptor", + "escapedName": "is-descriptor", + "rawSpec": "^1.0.2", + "saveSpec": null, + "fetchSpec": "^1.0.2" + }, + "_requiredBy": [ + "/define-property" + ], + "_resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "_shasum": "3b159746a66604b04f8c81524ba365c5f14d86ec", + "_spec": "is-descriptor@^1.0.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/define-property", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-descriptor/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "url": "https://github.com/wtgtybhertgeghgtwtg" + } + ], + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "deprecated": false, + "description": "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.5.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-descriptor", + "keywords": [ + "accessor", + "check", + "data", + "descriptor", + "get", + "getter", + "is", + "keys", + "object", + "properties", + "property", + "set", + "setter", + "type", + "valid", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "is-descriptor", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-descriptor.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "is-accessor-descriptor", + "is-data-descriptor", + "is-descriptor", + "isobject" + ] + }, + "plugins": [ + "gulp-format-md" + ], + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.2" +} diff --git a/node_modules/define-property/node_modules/isobject/LICENSE b/node_modules/define-property/node_modules/isobject/LICENSE new file mode 100644 index 000000000..943e71d05 --- /dev/null +++ b/node_modules/define-property/node_modules/isobject/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +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. \ No newline at end of file diff --git a/node_modules/define-property/node_modules/isobject/README.md b/node_modules/define-property/node_modules/isobject/README.md new file mode 100644 index 000000000..d01feaa40 --- /dev/null +++ b/node_modules/define-property/node_modules/isobject/README.md @@ -0,0 +1,122 @@ +# isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM monthly downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![NPM total downloads](https://img.shields.io/npm/dt/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/isobject) + +> Returns true if the value is an object and not an array or null. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save isobject +``` + +Install with [yarn](https://yarnpkg.com): + +```sh +$ yarn add isobject +``` + +Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install isobject +``` +Install with [bower](https://bower.io/) + +```sh +$ bower install isobject +``` + +## Usage + +```js +var isObject = require('isobject'); +``` + +**True** + +All of the following return `true`: + +```js +isObject({}); +isObject(Object.create({})); +isObject(Object.create(Object.prototype)); +isObject(Object.create(null)); +isObject({}); +isObject(new Foo); +isObject(/foo/); +``` + +**False** + +All of the following return `false`: + +```js +isObject(); +isObject(function () {}); +isObject(1); +isObject([]); +isObject(undefined); +isObject(null); +``` + +## About + +### Related projects + +* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") +* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 29 | [jonschlinkert](https://github.com/jonschlinkert) | +| 4 | [doowb](https://github.com/doowb) | +| 1 | [magnudae](https://github.com/magnudae) | +| 1 | [LeSuisse](https://github.com/LeSuisse) | +| 1 | [tmcw](https://github.com/tmcw) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 30, 2017._ \ No newline at end of file diff --git a/node_modules/define-property/node_modules/isobject/index.d.ts b/node_modules/define-property/node_modules/isobject/index.d.ts new file mode 100644 index 000000000..55f81c275 --- /dev/null +++ b/node_modules/define-property/node_modules/isobject/index.d.ts @@ -0,0 +1,5 @@ +export = isObject; + +declare function isObject(val: any): boolean; + +declare namespace isObject {} diff --git a/node_modules/define-property/node_modules/isobject/index.js b/node_modules/define-property/node_modules/isobject/index.js new file mode 100644 index 000000000..2d59958bf --- /dev/null +++ b/node_modules/define-property/node_modules/isobject/index.js @@ -0,0 +1,12 @@ +/*! + * isobject + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +module.exports = function isObject(val) { + return val != null && typeof val === 'object' && Array.isArray(val) === false; +}; diff --git a/node_modules/define-property/node_modules/isobject/package.json b/node_modules/define-property/node_modules/isobject/package.json new file mode 100644 index 000000000..316fef022 --- /dev/null +++ b/node_modules/define-property/node_modules/isobject/package.json @@ -0,0 +1,119 @@ +{ + "_from": "isobject@^3.0.1", + "_id": "isobject@3.0.1", + "_inBundle": false, + "_integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "_location": "/define-property/isobject", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "isobject@^3.0.1", + "name": "isobject", + "escapedName": "isobject", + "rawSpec": "^3.0.1", + "saveSpec": null, + "fetchSpec": "^3.0.1" + }, + "_requiredBy": [ + "/define-property" + ], + "_resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "_shasum": "4e431e92b11a9731636aa1f9c8d1ccbcfdab78df", + "_spec": "isobject@^3.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/define-property", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/isobject/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "url": "https://github.com/LeSuisse" + }, + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Magnús Dæhlen", + "url": "https://github.com/magnudae" + }, + { + "name": "Tom MacWright", + "url": "https://macwright.org" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Returns true if the value is an object and not an array or null.", + "devDependencies": { + "gulp-format-md": "^0.1.9", + "mocha": "^2.4.5" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.d.ts", + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/isobject", + "keywords": [ + "check", + "is", + "is-object", + "isobject", + "kind", + "kind-of", + "kindof", + "native", + "object", + "type", + "typeof", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "isobject", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/isobject.git" + }, + "scripts": { + "test": "mocha" + }, + "types": "index.d.ts", + "verb": { + "related": { + "list": [ + "extend-shallow", + "is-plain-object", + "kind-of", + "merge-deep" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb" + ] + }, + "version": "3.0.1" +} diff --git a/node_modules/define-property/node_modules/kind-of/CHANGELOG.md b/node_modules/define-property/node_modules/kind-of/CHANGELOG.md new file mode 100644 index 000000000..fb30b06df --- /dev/null +++ b/node_modules/define-property/node_modules/kind-of/CHANGELOG.md @@ -0,0 +1,157 @@ +# Release history + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +
+ Guiding Principles + +- Changelogs are for humans, not machines. +- There should be an entry for every single version. +- The same types of changes should be grouped. +- Versions and sections should be linkable. +- The latest version comes first. +- The release date of each versions is displayed. +- Mention whether you follow Semantic Versioning. + +
+ +
+ Types of changes + +Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_): + +- `Added` for new features. +- `Changed` for changes in existing functionality. +- `Deprecated` for soon-to-be removed features. +- `Removed` for now removed features. +- `Fixed` for any bug fixes. +- `Security` in case of vulnerabilities. + +
+ +## [6.0.0] - 2017-10-13 + +- refactor code to be more performant +- refactor benchmarks + +## [5.1.0] - 2017-10-13 + +**Added** + +- Merge pull request #15 from aretecode/patch-1 +- adds support and tests for string & array iterators + +**Changed** + +- updates benchmarks + +## [5.0.2] - 2017-08-02 + +- Merge pull request #14 from struct78/master +- Added `undefined` check + +## [5.0.0] - 2017-06-21 + +- Merge pull request #12 from aretecode/iterator +- Set Iterator + Map Iterator +- streamline `isbuffer`, minor edits + +## [4.0.0] - 2017-05-19 + +- Merge pull request #8 from tunnckoCore/master +- update deps + +## [3.2.2] - 2017-05-16 + +- fix version + +## [3.2.1] - 2017-05-16 + +- add browserify + +## [3.2.0] - 2017-04-25 + +- Merge pull request #10 from ksheedlo/unrequire-buffer +- add `promise` support and tests +- Remove unnecessary `Buffer` check + +## [3.1.0] - 2016-12-07 + +- Merge pull request #7 from laggingreflex/err +- add support for `error` and tests +- run update + +## [3.0.4] - 2016-07-29 + +- move tests +- run update + +## [3.0.3] - 2016-05-03 + +- fix prepublish script +- remove unused dep + +## [3.0.0] - 2015-11-17 + +- add typed array support +- Merge pull request #5 from miguelmota/typed-arrays +- adds new tests + +## [2.0.1] - 2015-08-21 + +- use `is-buffer` module + +## [2.0.0] - 2015-05-31 + +- Create fallback for `Array.isArray` if used as a browser package +- Merge pull request #2 from dtothefp/patch-1 +- Merge pull request #3 from pdehaan/patch-1 +- Merge branch 'master' of https://github.com/chorks/kind-of into chorks-master +- optimizations, mostly date and regex + +## [1.1.0] - 2015-02-09 + +- adds `buffer` support +- adds tests for `buffer` + +## [1.0.0] - 2015-01-19 + +- update benchmarks +- optimizations based on benchmarks + +## [0.1.2] - 2014-10-26 + +- return `typeof` value if it's not an object. very slight speed improvement +- use `.slice` +- adds benchmarks + +## [0.1.0] - 2014-9-26 + +- first commit + +[6.0.0]: https://github.com/jonschlinkert/kind-of/compare/5.1.0...6.0.0 +[5.1.0]: https://github.com/jonschlinkert/kind-of/compare/5.0.2...5.1.0 +[5.0.2]: https://github.com/jonschlinkert/kind-of/compare/5.0.1...5.0.2 +[5.0.1]: https://github.com/jonschlinkert/kind-of/compare/5.0.0...5.0.1 +[5.0.0]: https://github.com/jonschlinkert/kind-of/compare/4.0.0...5.0.0 +[4.0.0]: https://github.com/jonschlinkert/kind-of/compare/3.2.2...4.0.0 +[3.2.2]: https://github.com/jonschlinkert/kind-of/compare/3.2.1...3.2.2 +[3.2.1]: https://github.com/jonschlinkert/kind-of/compare/3.2.0...3.2.1 +[3.2.0]: https://github.com/jonschlinkert/kind-of/compare/3.1.0...3.2.0 +[3.1.0]: https://github.com/jonschlinkert/kind-of/compare/3.0.4...3.1.0 +[3.0.4]: https://github.com/jonschlinkert/kind-of/compare/3.0.3...3.0.4 +[3.0.3]: https://github.com/jonschlinkert/kind-of/compare/3.0.0...3.0.3 +[3.0.0]: https://github.com/jonschlinkert/kind-of/compare/2.0.1...3.0.0 +[2.0.1]: https://github.com/jonschlinkert/kind-of/compare/2.0.0...2.0.1 +[2.0.0]: https://github.com/jonschlinkert/kind-of/compare/1.1.0...2.0.0 +[1.1.0]: https://github.com/jonschlinkert/kind-of/compare/1.0.0...1.1.0 +[1.0.0]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...1.0.0 +[0.1.2]: https://github.com/jonschlinkert/kind-of/compare/0.1.0...0.1.2 +[0.1.0]: https://github.com/jonschlinkert/kind-of/commit/2fae09b0b19b1aadb558e9be39f0c3ef6034eb87 + +[Unreleased]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...HEAD +[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog + diff --git a/node_modules/define-property/node_modules/kind-of/LICENSE b/node_modules/define-property/node_modules/kind-of/LICENSE new file mode 100644 index 000000000..3f2eca18f --- /dev/null +++ b/node_modules/define-property/node_modules/kind-of/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/define-property/node_modules/kind-of/README.md b/node_modules/define-property/node_modules/kind-of/README.md new file mode 100644 index 000000000..4b0d4a818 --- /dev/null +++ b/node_modules/define-property/node_modules/kind-of/README.md @@ -0,0 +1,365 @@ +# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) + +> Get the native type of a value. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save kind-of +``` + +Install with [bower](https://bower.io/) + +```sh +$ bower install kind-of --save +``` + +## Why use this? + +1. [it's fast](#benchmarks) | [optimizations](#optimizations) +2. [better type checking](#better-type-checking) + +## Usage + +> es5, es6, and browser ready + +```js +var kindOf = require('kind-of'); + +kindOf(undefined); +//=> 'undefined' + +kindOf(null); +//=> 'null' + +kindOf(true); +//=> 'boolean' + +kindOf(false); +//=> 'boolean' + +kindOf(new Buffer('')); +//=> 'buffer' + +kindOf(42); +//=> 'number' + +kindOf('str'); +//=> 'string' + +kindOf(arguments); +//=> 'arguments' + +kindOf({}); +//=> 'object' + +kindOf(Object.create(null)); +//=> 'object' + +kindOf(new Test()); +//=> 'object' + +kindOf(new Date()); +//=> 'date' + +kindOf([1, 2, 3]); +//=> 'array' + +kindOf(/foo/); +//=> 'regexp' + +kindOf(new RegExp('foo')); +//=> 'regexp' + +kindOf(new Error('error')); +//=> 'error' + +kindOf(function () {}); +//=> 'function' + +kindOf(function * () {}); +//=> 'generatorfunction' + +kindOf(Symbol('str')); +//=> 'symbol' + +kindOf(new Map()); +//=> 'map' + +kindOf(new WeakMap()); +//=> 'weakmap' + +kindOf(new Set()); +//=> 'set' + +kindOf(new WeakSet()); +//=> 'weakset' + +kindOf(new Int8Array()); +//=> 'int8array' + +kindOf(new Uint8Array()); +//=> 'uint8array' + +kindOf(new Uint8ClampedArray()); +//=> 'uint8clampedarray' + +kindOf(new Int16Array()); +//=> 'int16array' + +kindOf(new Uint16Array()); +//=> 'uint16array' + +kindOf(new Int32Array()); +//=> 'int32array' + +kindOf(new Uint32Array()); +//=> 'uint32array' + +kindOf(new Float32Array()); +//=> 'float32array' + +kindOf(new Float64Array()); +//=> 'float64array' +``` + +## Benchmarks + +Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). + +```bash +# arguments (32 bytes) + kind-of x 17,024,098 ops/sec ±1.90% (86 runs sampled) + lib-type-of x 11,926,235 ops/sec ±1.34% (83 runs sampled) + lib-typeof x 9,245,257 ops/sec ±1.22% (87 runs sampled) + + fastest is kind-of (by 161% avg) + +# array (22 bytes) + kind-of x 17,196,492 ops/sec ±1.07% (88 runs sampled) + lib-type-of x 8,838,283 ops/sec ±1.02% (87 runs sampled) + lib-typeof x 8,677,848 ops/sec ±0.87% (87 runs sampled) + + fastest is kind-of (by 196% avg) + +# boolean (24 bytes) + kind-of x 16,841,600 ops/sec ±1.10% (86 runs sampled) + lib-type-of x 8,096,787 ops/sec ±0.95% (87 runs sampled) + lib-typeof x 8,423,345 ops/sec ±1.15% (86 runs sampled) + + fastest is kind-of (by 204% avg) + +# buffer (38 bytes) + kind-of x 14,848,060 ops/sec ±1.05% (86 runs sampled) + lib-type-of x 3,671,577 ops/sec ±1.49% (87 runs sampled) + lib-typeof x 8,360,236 ops/sec ±1.24% (86 runs sampled) + + fastest is kind-of (by 247% avg) + +# date (30 bytes) + kind-of x 16,067,761 ops/sec ±1.58% (86 runs sampled) + lib-type-of x 8,954,436 ops/sec ±1.40% (87 runs sampled) + lib-typeof x 8,488,307 ops/sec ±1.51% (84 runs sampled) + + fastest is kind-of (by 184% avg) + +# error (36 bytes) + kind-of x 9,634,090 ops/sec ±1.12% (89 runs sampled) + lib-type-of x 7,735,624 ops/sec ±1.32% (86 runs sampled) + lib-typeof x 7,442,160 ops/sec ±1.11% (90 runs sampled) + + fastest is kind-of (by 127% avg) + +# function (34 bytes) + kind-of x 10,031,494 ops/sec ±1.27% (86 runs sampled) + lib-type-of x 9,502,757 ops/sec ±1.17% (89 runs sampled) + lib-typeof x 8,278,985 ops/sec ±1.08% (88 runs sampled) + + fastest is kind-of (by 113% avg) + +# null (24 bytes) + kind-of x 18,159,808 ops/sec ±1.92% (86 runs sampled) + lib-type-of x 12,927,635 ops/sec ±1.01% (88 runs sampled) + lib-typeof x 7,958,234 ops/sec ±1.21% (89 runs sampled) + + fastest is kind-of (by 174% avg) + +# number (22 bytes) + kind-of x 17,846,779 ops/sec ±0.91% (85 runs sampled) + lib-type-of x 3,316,636 ops/sec ±1.19% (86 runs sampled) + lib-typeof x 2,329,477 ops/sec ±2.21% (85 runs sampled) + + fastest is kind-of (by 632% avg) + +# object-plain (47 bytes) + kind-of x 7,085,155 ops/sec ±1.05% (88 runs sampled) + lib-type-of x 8,870,930 ops/sec ±1.06% (83 runs sampled) + lib-typeof x 8,716,024 ops/sec ±1.05% (87 runs sampled) + + fastest is lib-type-of (by 112% avg) + +# regex (25 bytes) + kind-of x 14,196,052 ops/sec ±1.65% (84 runs sampled) + lib-type-of x 9,554,164 ops/sec ±1.25% (88 runs sampled) + lib-typeof x 8,359,691 ops/sec ±1.07% (87 runs sampled) + + fastest is kind-of (by 158% avg) + +# string (33 bytes) + kind-of x 16,131,428 ops/sec ±1.41% (85 runs sampled) + lib-type-of x 7,273,172 ops/sec ±1.05% (87 runs sampled) + lib-typeof x 7,382,635 ops/sec ±1.17% (85 runs sampled) + + fastest is kind-of (by 220% avg) + +# symbol (34 bytes) + kind-of x 17,011,537 ops/sec ±1.24% (86 runs sampled) + lib-type-of x 3,492,454 ops/sec ±1.23% (89 runs sampled) + lib-typeof x 7,471,235 ops/sec ±2.48% (87 runs sampled) + + fastest is kind-of (by 310% avg) + +# template-strings (36 bytes) + kind-of x 15,434,250 ops/sec ±1.46% (83 runs sampled) + lib-type-of x 7,157,907 ops/sec ±0.97% (87 runs sampled) + lib-typeof x 7,517,986 ops/sec ±0.92% (86 runs sampled) + + fastest is kind-of (by 210% avg) + +# undefined (29 bytes) + kind-of x 19,167,115 ops/sec ±1.71% (87 runs sampled) + lib-type-of x 15,477,740 ops/sec ±1.63% (85 runs sampled) + lib-typeof x 19,075,495 ops/sec ±1.17% (83 runs sampled) + + fastest is lib-typeof,kind-of + +``` + +## Optimizations + +In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: + +1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. +2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. +3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` +4. There is no reason to make the code in a microlib as terse as possible, just to win points for making it shorter. It's always better to favor performant code over terse code. You will always only be using a single `require()` statement to use the library anyway, regardless of how the code is written. + +## Better type checking + +kind-of seems to be more consistently "correct" than other type checking libs I've looked at. For example, here are some differing results from other popular libs: + +### [typeof](https://github.com/CodingFu/typeof) lib + +Incorrectly identifies instances of custom constructors (pretty common): + +```js +var typeOf = require('typeof'); +function Test() {} +console.log(typeOf(new Test())); +//=> 'test' +``` + +Returns `object` instead of `arguments`: + +```js +function foo() { + console.log(typeOf(arguments)) //=> 'object' +} +foo(); +``` + +### [type-of](https://github.com/ForbesLindesay/type-of) lib + +Incorrectly returns `object` for generator functions, buffers, `Map`, `Set`, `WeakMap` and `WeakSet`: + +```js +function * foo() {} +console.log(typeOf(foo)); +//=> 'object' +console.log(typeOf(new Buffer(''))); +//=> 'object' +console.log(typeOf(new Map())); +//=> 'object' +console.log(typeOf(new Set())); +//=> 'object' +console.log(typeOf(new WeakMap())); +//=> 'object' +console.log(typeOf(new WeakSet())); +//=> 'object' +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 98 | [jonschlinkert](https://github.com/jonschlinkert) | +| 3 | [aretecode](https://github.com/aretecode) | +| 2 | [miguelmota](https://github.com/miguelmota) | +| 1 | [dtothefp](https://github.com/dtothefp) | +| 1 | [ianstormtaylor](https://github.com/ianstormtaylor) | +| 1 | [ksheedlo](https://github.com/ksheedlo) | +| 1 | [pdehaan](https://github.com/pdehaan) | +| 1 | [laggingreflex](https://github.com/laggingreflex) | +| 1 | [charlike-old](https://github.com/charlike-old) | + +### Author + +**Jon Schlinkert** + +* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on December 01, 2017._ \ No newline at end of file diff --git a/node_modules/define-property/node_modules/kind-of/index.js b/node_modules/define-property/node_modules/kind-of/index.js new file mode 100644 index 000000000..aa2bb3944 --- /dev/null +++ b/node_modules/define-property/node_modules/kind-of/index.js @@ -0,0 +1,129 @@ +var toString = Object.prototype.toString; + +module.exports = function kindOf(val) { + if (val === void 0) return 'undefined'; + if (val === null) return 'null'; + + var type = typeof val; + if (type === 'boolean') return 'boolean'; + if (type === 'string') return 'string'; + if (type === 'number') return 'number'; + if (type === 'symbol') return 'symbol'; + if (type === 'function') { + return isGeneratorFn(val) ? 'generatorfunction' : 'function'; + } + + if (isArray(val)) return 'array'; + if (isBuffer(val)) return 'buffer'; + if (isArguments(val)) return 'arguments'; + if (isDate(val)) return 'date'; + if (isError(val)) return 'error'; + if (isRegexp(val)) return 'regexp'; + + switch (ctorName(val)) { + case 'Symbol': return 'symbol'; + case 'Promise': return 'promise'; + + // Set, Map, WeakSet, WeakMap + case 'WeakMap': return 'weakmap'; + case 'WeakSet': return 'weakset'; + case 'Map': return 'map'; + case 'Set': return 'set'; + + // 8-bit typed arrays + case 'Int8Array': return 'int8array'; + case 'Uint8Array': return 'uint8array'; + case 'Uint8ClampedArray': return 'uint8clampedarray'; + + // 16-bit typed arrays + case 'Int16Array': return 'int16array'; + case 'Uint16Array': return 'uint16array'; + + // 32-bit typed arrays + case 'Int32Array': return 'int32array'; + case 'Uint32Array': return 'uint32array'; + case 'Float32Array': return 'float32array'; + case 'Float64Array': return 'float64array'; + } + + if (isGeneratorObj(val)) { + return 'generator'; + } + + // Non-plain objects + type = toString.call(val); + switch (type) { + case '[object Object]': return 'object'; + // iterators + case '[object Map Iterator]': return 'mapiterator'; + case '[object Set Iterator]': return 'setiterator'; + case '[object String Iterator]': return 'stringiterator'; + case '[object Array Iterator]': return 'arrayiterator'; + } + + // other + return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); +}; + +function ctorName(val) { + return val.constructor ? val.constructor.name : null; +} + +function isArray(val) { + if (Array.isArray) return Array.isArray(val); + return val instanceof Array; +} + +function isError(val) { + return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'); +} + +function isDate(val) { + if (val instanceof Date) return true; + return typeof val.toDateString === 'function' + && typeof val.getDate === 'function' + && typeof val.setDate === 'function'; +} + +function isRegexp(val) { + if (val instanceof RegExp) return true; + return typeof val.flags === 'string' + && typeof val.ignoreCase === 'boolean' + && typeof val.multiline === 'boolean' + && typeof val.global === 'boolean'; +} + +function isGeneratorFn(name, val) { + return ctorName(name) === 'GeneratorFunction'; +} + +function isGeneratorObj(val) { + return typeof val.throw === 'function' + && typeof val.return === 'function' + && typeof val.next === 'function'; +} + +function isArguments(val) { + try { + if (typeof val.length === 'number' && typeof val.callee === 'function') { + return true; + } + } catch (err) { + if (err.message.indexOf('callee') !== -1) { + return true; + } + } + return false; +} + +/** + * If you need to support Safari 5-7 (8-10 yr-old browser), + * take a look at https://github.com/feross/is-buffer + */ + +function isBuffer(val) { + if (val.constructor && typeof val.constructor.isBuffer === 'function') { + return val.constructor.isBuffer(val); + } + return false; +} diff --git a/node_modules/define-property/node_modules/kind-of/package.json b/node_modules/define-property/node_modules/kind-of/package.json new file mode 100644 index 000000000..aa4e636fe --- /dev/null +++ b/node_modules/define-property/node_modules/kind-of/package.json @@ -0,0 +1,145 @@ +{ + "_from": "kind-of@^6.0.2", + "_id": "kind-of@6.0.2", + "_inBundle": false, + "_integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "_location": "/define-property/kind-of", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "kind-of@^6.0.2", + "name": "kind-of", + "escapedName": "kind-of", + "rawSpec": "^6.0.2", + "saveSpec": null, + "fetchSpec": "^6.0.2" + }, + "_requiredBy": [ + "/define-property/is-accessor-descriptor", + "/define-property/is-data-descriptor", + "/define-property/is-descriptor" + ], + "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "_shasum": "01146b36a6218e64e58f3a8d66de5d7fc6f6d051", + "_spec": "kind-of@^6.0.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/define-property/node_modules/is-descriptor", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/kind-of/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "David Fox-Powell", + "url": "https://dtothefp.github.io/me" + }, + { + "name": "James", + "url": "https://twitter.com/aretecode" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Ken Sheedlo", + "url": "kensheedlo.com" + }, + { + "name": "laggingreflex", + "url": "https://github.com/laggingreflex" + }, + { + "name": "Miguel Mota", + "url": "https://miguelmota.com" + }, + { + "name": "Peter deHaan", + "url": "http://about.me/peterdehaan" + }, + { + "name": "tunnckoCore", + "url": "https://i.am.charlike.online" + } + ], + "deprecated": false, + "description": "Get the native type of a value.", + "devDependencies": { + "benchmarked": "^2.0.0", + "browserify": "^14.4.0", + "gulp-format-md": "^1.0.0", + "mocha": "^4.0.1", + "write": "^1.0.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/kind-of", + "keywords": [ + "arguments", + "array", + "boolean", + "check", + "date", + "function", + "is", + "is-type", + "is-type-of", + "kind", + "kind-of", + "number", + "object", + "of", + "regexp", + "string", + "test", + "type", + "type-of", + "typeof", + "types" + ], + "license": "MIT", + "main": "index.js", + "name": "kind-of", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/kind-of.git" + }, + "scripts": { + "prepublish": "browserify -o browser.js -e index.js -s index --bare", + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "related": { + "list": [ + "is-glob", + "is-number", + "is-primitive" + ] + }, + "reflinks": [ + "type-of", + "typeof", + "verb" + ] + }, + "version": "6.0.2" +} diff --git a/node_modules/define-property/package.json b/node_modules/define-property/package.json new file mode 100644 index 000000000..f8ce95c7f --- /dev/null +++ b/node_modules/define-property/package.json @@ -0,0 +1,106 @@ +{ + "_from": "define-property@^2.0.2", + "_id": "define-property@2.0.2", + "_inBundle": false, + "_integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "_location": "/define-property", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "define-property@^2.0.2", + "name": "define-property", + "escapedName": "define-property", + "rawSpec": "^2.0.2", + "saveSpec": null, + "fetchSpec": "^2.0.2" + }, + "_requiredBy": [ + "/nanomatch", + "/readdirp/micromatch", + "/to-regex" + ], + "_resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "_shasum": "d459689e8d654ba77e02a817f8710d702cb16e9d", + "_spec": "define-property@^2.0.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/define-property/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + } + ], + "dependencies": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "deprecated": false, + "description": "Define a non-enumerable property on an object. Uses Reflect.defineProperty when available, otherwise Object.defineProperty.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.5.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/define-property", + "keywords": [ + "define", + "define-property", + "enumerable", + "key", + "non", + "non-enumerable", + "object", + "prop", + "property", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "define-property", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/define-property.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "assign-deep", + "extend-shallow", + "merge-deep", + "mixin-deep" + ] + }, + "lint": { + "reflinks": true + } + }, + "version": "2.0.2" +} diff --git a/node_modules/defined/.travis.yml b/node_modules/defined/.travis.yml new file mode 100644 index 000000000..895dbd362 --- /dev/null +++ b/node_modules/defined/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.6 + - 0.8 diff --git a/node_modules/defined/LICENSE b/node_modules/defined/LICENSE new file mode 100644 index 000000000..ee27ba4b4 --- /dev/null +++ b/node_modules/defined/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/defined/example/defined.js b/node_modules/defined/example/defined.js new file mode 100644 index 000000000..7b5d982f4 --- /dev/null +++ b/node_modules/defined/example/defined.js @@ -0,0 +1,4 @@ +var defined = require('../'); +var opts = { y : false, w : 4 }; +var x = defined(opts.x, opts.y, opts.w, 8); +console.log(x); diff --git a/node_modules/defined/index.js b/node_modules/defined/index.js new file mode 100644 index 000000000..f8a22198d --- /dev/null +++ b/node_modules/defined/index.js @@ -0,0 +1,5 @@ +module.exports = function () { + for (var i = 0; i < arguments.length; i++) { + if (arguments[i] !== undefined) return arguments[i]; + } +}; diff --git a/node_modules/defined/package.json b/node_modules/defined/package.json new file mode 100644 index 000000000..9716ece35 --- /dev/null +++ b/node_modules/defined/package.json @@ -0,0 +1,94 @@ +{ + "_from": "defined@^1.0.0", + "_id": "defined@1.0.0", + "_inBundle": false, + "_integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "_location": "/defined", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "defined@^1.0.0", + "name": "defined", + "escapedName": "defined", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/browser-pack", + "/browserify", + "/detective", + "/module-deps", + "/watchify" + ], + "_resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "_shasum": "c98d9bcef75674188e110969151199e39b1fa693", + "_spec": "defined@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/defined/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "return the first argument that is `!== undefined`", + "devDependencies": { + "tape": "~3.5.0" + }, + "directories": { + "example": "example", + "test": "test" + }, + "homepage": "https://github.com/substack/defined", + "keywords": [ + "undefined", + "short-circuit", + "||", + "or", + "//", + "defined-or" + ], + "license": "MIT", + "main": "index.js", + "name": "defined", + "repository": { + "type": "git", + "url": "git://github.com/substack/defined.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": { + "ie": [ + 6, + 7, + 8, + 9 + ], + "ff": [ + 3.5, + 10, + 15 + ], + "chrome": [ + 10, + 22 + ], + "safari": [ + 5.1 + ], + "opera": [ + 12 + ] + } + }, + "version": "1.0.0" +} diff --git a/node_modules/defined/readme.markdown b/node_modules/defined/readme.markdown new file mode 100644 index 000000000..9616195df --- /dev/null +++ b/node_modules/defined/readme.markdown @@ -0,0 +1,53 @@ +# defined + +return the first argument that is `!== undefined` + +[![browser support](http://ci.testling.com/substack/defined.png)](http://ci.testling.com/substack/defined) + +[![build status](https://secure.travis-ci.org/substack/defined.png)](http://travis-ci.org/substack/defined) + +Most of the time when I chain together `||`s, I actually just want the first +item that is not `undefined`, not the first non-falsy item. + +This module is like the defined-or (`//`) operator in perl 5.10+. + +# example + +``` js +var defined = require('defined'); +var opts = { y : false, w : 4 }; +var x = defined(opts.x, opts.y, opts.w, 100); +console.log(x); +``` + +``` +$ node example/defined.js +false +``` + +The return value is `false` because `false` is the first item that is +`!== undefined`. + +# methods + +``` js +var defined = require('defined') +``` + +## var x = defined(a, b, c...) + +Return the first item in the argument list `a, b, c...` that is `!== undefined`. + +If all the items are `=== undefined`, return undefined. + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install defined +``` + +# license + +MIT diff --git a/node_modules/defined/test/def.js b/node_modules/defined/test/def.js new file mode 100644 index 000000000..48da51710 --- /dev/null +++ b/node_modules/defined/test/def.js @@ -0,0 +1,22 @@ +var defined = require('../'); +var test = require('tape'); + +test('defined-or', function (t) { + var u = undefined; + + t.equal(defined(), u, 'empty arguments'); + t.equal(defined(u), u, '1 undefined'); + t.equal(defined(u, u), u, '2 undefined'); + t.equal(defined(u, u, u, u), u, '4 undefineds'); + + t.equal(defined(undefined, false, true), false, 'false[0]'); + t.equal(defined(false, true), false, 'false[1]'); + t.equal(defined(undefined, 0, true), 0, 'zero[0]'); + t.equal(defined(0, true), 0, 'zero[1]'); + + t.equal(defined(3, undefined, 4), 3, 'first arg'); + t.equal(defined(undefined, 3, 4), 3, 'second arg'); + t.equal(defined(undefined, undefined, 3), 3, 'third arg'); + + t.end(); +}); diff --git a/node_modules/defined/test/falsy.js b/node_modules/defined/test/falsy.js new file mode 100644 index 000000000..6b7d623f0 --- /dev/null +++ b/node_modules/defined/test/falsy.js @@ -0,0 +1,9 @@ +var test = require('tape'); +var defined = require('../'); + +test('falsy', function (t) { + t.plan(1); + var opts = { y : false, w : 4 }; + var x = defined(opts.x, opts.y, opts.w, 8); + t.equal(x, false); +}); diff --git a/node_modules/depd/History.md b/node_modules/depd/History.md new file mode 100644 index 000000000..507ecb8de --- /dev/null +++ b/node_modules/depd/History.md @@ -0,0 +1,96 @@ +1.1.2 / 2018-01-11 +================== + + * perf: remove argument reassignment + * Support Node.js 0.6 to 9.x + +1.1.1 / 2017-07-27 +================== + + * Remove unnecessary `Buffer` loading + * Support Node.js 0.6 to 8.x + +1.1.0 / 2015-09-14 +================== + + * Enable strict mode in more places + * Support io.js 3.x + * Support io.js 2.x + * Support web browser loading + - Requires bundler like Browserify or webpack + +1.0.1 / 2015-04-07 +================== + + * Fix `TypeError`s when under `'use strict'` code + * Fix useless type name on auto-generated messages + * Support io.js 1.x + * Support Node.js 0.12 + +1.0.0 / 2014-09-17 +================== + + * No changes + +0.4.5 / 2014-09-09 +================== + + * Improve call speed to functions using the function wrapper + * Support Node.js 0.6 + +0.4.4 / 2014-07-27 +================== + + * Work-around v8 generating empty stack traces + +0.4.3 / 2014-07-26 +================== + + * Fix exception when global `Error.stackTraceLimit` is too low + +0.4.2 / 2014-07-19 +================== + + * Correct call site for wrapped functions and properties + +0.4.1 / 2014-07-19 +================== + + * Improve automatic message generation for function properties + +0.4.0 / 2014-07-19 +================== + + * Add `TRACE_DEPRECATION` environment variable + * Remove non-standard grey color from color output + * Support `--no-deprecation` argument + * Support `--trace-deprecation` argument + * Support `deprecate.property(fn, prop, message)` + +0.3.0 / 2014-06-16 +================== + + * Add `NO_DEPRECATION` environment variable + +0.2.0 / 2014-06-15 +================== + + * Add `deprecate.property(obj, prop, message)` + * Remove `supports-color` dependency for node.js 0.8 + +0.1.0 / 2014-06-15 +================== + + * Add `deprecate.function(fn, message)` + * Add `process.on('deprecation', fn)` emitter + * Automatically generate message when omitted from `deprecate()` + +0.0.1 / 2014-06-15 +================== + + * Fix warning for dynamic calls at singe call site + +0.0.0 / 2014-06-15 +================== + + * Initial implementation diff --git a/node_modules/depd/LICENSE b/node_modules/depd/LICENSE new file mode 100644 index 000000000..84441fbb5 --- /dev/null +++ b/node_modules/depd/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2017 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/depd/Readme.md b/node_modules/depd/Readme.md new file mode 100644 index 000000000..779067020 --- /dev/null +++ b/node_modules/depd/Readme.md @@ -0,0 +1,280 @@ +# depd + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Linux Build][travis-image]][travis-url] +[![Windows Build][appveyor-image]][appveyor-url] +[![Coverage Status][coveralls-image]][coveralls-url] + +Deprecate all the things + +> With great modules comes great responsibility; mark things deprecated! + +## Install + +This module is installed directly using `npm`: + +```sh +$ npm install depd +``` + +This module can also be bundled with systems like +[Browserify](http://browserify.org/) or [webpack](https://webpack.github.io/), +though by default this module will alter it's API to no longer display or +track deprecations. + +## API + + + +```js +var deprecate = require('depd')('my-module') +``` + +This library allows you to display deprecation messages to your users. +This library goes above and beyond with deprecation warnings by +introspection of the call stack (but only the bits that it is interested +in). + +Instead of just warning on the first invocation of a deprecated +function and never again, this module will warn on the first invocation +of a deprecated function per unique call site, making it ideal to alert +users of all deprecated uses across the code base, rather than just +whatever happens to execute first. + +The deprecation warnings from this module also include the file and line +information for the call into the module that the deprecated function was +in. + +**NOTE** this library has a similar interface to the `debug` module, and +this module uses the calling file to get the boundary for the call stacks, +so you should always create a new `deprecate` object in each file and not +within some central file. + +### depd(namespace) + +Create a new deprecate function that uses the given namespace name in the +messages and will display the call site prior to the stack entering the +file this function was called from. It is highly suggested you use the +name of your module as the namespace. + +### deprecate(message) + +Call this function from deprecated code to display a deprecation message. +This message will appear once per unique caller site. Caller site is the +first call site in the stack in a different file from the caller of this +function. + +If the message is omitted, a message is generated for you based on the site +of the `deprecate()` call and will display the name of the function called, +similar to the name displayed in a stack trace. + +### deprecate.function(fn, message) + +Call this function to wrap a given function in a deprecation message on any +call to the function. An optional message can be supplied to provide a custom +message. + +### deprecate.property(obj, prop, message) + +Call this function to wrap a given property on object in a deprecation message +on any accessing or setting of the property. An optional message can be supplied +to provide a custom message. + +The method must be called on the object where the property belongs (not +inherited from the prototype). + +If the property is a data descriptor, it will be converted to an accessor +descriptor in order to display the deprecation message. + +### process.on('deprecation', fn) + +This module will allow easy capturing of deprecation errors by emitting the +errors as the type "deprecation" on the global `process`. If there are no +listeners for this type, the errors are written to STDERR as normal, but if +there are any listeners, nothing will be written to STDERR and instead only +emitted. From there, you can write the errors in a different format or to a +logging source. + +The error represents the deprecation and is emitted only once with the same +rules as writing to STDERR. The error has the following properties: + + - `message` - This is the message given by the library + - `name` - This is always `'DeprecationError'` + - `namespace` - This is the namespace the deprecation came from + - `stack` - This is the stack of the call to the deprecated thing + +Example `error.stack` output: + +``` +DeprecationError: my-cool-module deprecated oldfunction + at Object. ([eval]-wrapper:6:22) + at Module._compile (module.js:456:26) + at evalScript (node.js:532:25) + at startup (node.js:80:7) + at node.js:902:3 +``` + +### process.env.NO_DEPRECATION + +As a user of modules that are deprecated, the environment variable `NO_DEPRECATION` +is provided as a quick solution to silencing deprecation warnings from being +output. The format of this is similar to that of `DEBUG`: + +```sh +$ NO_DEPRECATION=my-module,othermod node app.js +``` + +This will suppress deprecations from being output for "my-module" and "othermod". +The value is a list of comma-separated namespaces. To suppress every warning +across all namespaces, use the value `*` for a namespace. + +Providing the argument `--no-deprecation` to the `node` executable will suppress +all deprecations (only available in Node.js 0.8 or higher). + +**NOTE** This will not suppress the deperecations given to any "deprecation" +event listeners, just the output to STDERR. + +### process.env.TRACE_DEPRECATION + +As a user of modules that are deprecated, the environment variable `TRACE_DEPRECATION` +is provided as a solution to getting more detailed location information in deprecation +warnings by including the entire stack trace. The format of this is the same as +`NO_DEPRECATION`: + +```sh +$ TRACE_DEPRECATION=my-module,othermod node app.js +``` + +This will include stack traces for deprecations being output for "my-module" and +"othermod". The value is a list of comma-separated namespaces. To trace every +warning across all namespaces, use the value `*` for a namespace. + +Providing the argument `--trace-deprecation` to the `node` executable will trace +all deprecations (only available in Node.js 0.8 or higher). + +**NOTE** This will not trace the deperecations silenced by `NO_DEPRECATION`. + +## Display + +![message](files/message.png) + +When a user calls a function in your library that you mark deprecated, they +will see the following written to STDERR (in the given colors, similar colors +and layout to the `debug` module): + +``` +bright cyan bright yellow +| | reset cyan +| | | | +▼ ▼ ▼ ▼ +my-cool-module deprecated oldfunction [eval]-wrapper:6:22 +▲ ▲ ▲ ▲ +| | | | +namespace | | location of mycoolmod.oldfunction() call + | deprecation message + the word "deprecated" +``` + +If the user redirects their STDERR to a file or somewhere that does not support +colors, they see (similar layout to the `debug` module): + +``` +Sun, 15 Jun 2014 05:21:37 GMT my-cool-module deprecated oldfunction at [eval]-wrapper:6:22 +▲ ▲ ▲ ▲ ▲ +| | | | | +timestamp of message namespace | | location of mycoolmod.oldfunction() call + | deprecation message + the word "deprecated" +``` + +## Examples + +### Deprecating all calls to a function + +This will display a deprecated message about "oldfunction" being deprecated +from "my-module" on STDERR. + +```js +var deprecate = require('depd')('my-cool-module') + +// message automatically derived from function name +// Object.oldfunction +exports.oldfunction = deprecate.function(function oldfunction () { + // all calls to function are deprecated +}) + +// specific message +exports.oldfunction = deprecate.function(function () { + // all calls to function are deprecated +}, 'oldfunction') +``` + +### Conditionally deprecating a function call + +This will display a deprecated message about "weirdfunction" being deprecated +from "my-module" on STDERR when called with less than 2 arguments. + +```js +var deprecate = require('depd')('my-cool-module') + +exports.weirdfunction = function () { + if (arguments.length < 2) { + // calls with 0 or 1 args are deprecated + deprecate('weirdfunction args < 2') + } +} +``` + +When calling `deprecate` as a function, the warning is counted per call site +within your own module, so you can display different deprecations depending +on different situations and the users will still get all the warnings: + +```js +var deprecate = require('depd')('my-cool-module') + +exports.weirdfunction = function () { + if (arguments.length < 2) { + // calls with 0 or 1 args are deprecated + deprecate('weirdfunction args < 2') + } else if (typeof arguments[0] !== 'string') { + // calls with non-string first argument are deprecated + deprecate('weirdfunction non-string first arg') + } +} +``` + +### Deprecating property access + +This will display a deprecated message about "oldprop" being deprecated +from "my-module" on STDERR when accessed. A deprecation will be displayed +when setting the value and when getting the value. + +```js +var deprecate = require('depd')('my-cool-module') + +exports.oldprop = 'something' + +// message automatically derives from property name +deprecate.property(exports, 'oldprop') + +// explicit message +deprecate.property(exports, 'oldprop', 'oldprop >= 0.10') +``` + +## License + +[MIT](LICENSE) + +[npm-version-image]: https://img.shields.io/npm/v/depd.svg +[npm-downloads-image]: https://img.shields.io/npm/dm/depd.svg +[npm-url]: https://npmjs.org/package/depd +[travis-image]: https://img.shields.io/travis/dougwilson/nodejs-depd/master.svg?label=linux +[travis-url]: https://travis-ci.org/dougwilson/nodejs-depd +[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/nodejs-depd/master.svg?label=windows +[appveyor-url]: https://ci.appveyor.com/project/dougwilson/nodejs-depd +[coveralls-image]: https://img.shields.io/coveralls/dougwilson/nodejs-depd/master.svg +[coveralls-url]: https://coveralls.io/r/dougwilson/nodejs-depd?branch=master +[node-image]: https://img.shields.io/node/v/depd.svg +[node-url]: https://nodejs.org/en/download/ diff --git a/node_modules/depd/index.js b/node_modules/depd/index.js new file mode 100644 index 000000000..d758d3c8f --- /dev/null +++ b/node_modules/depd/index.js @@ -0,0 +1,522 @@ +/*! + * depd + * Copyright(c) 2014-2017 Douglas Christopher Wilson + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var callSiteToString = require('./lib/compat').callSiteToString +var eventListenerCount = require('./lib/compat').eventListenerCount +var relative = require('path').relative + +/** + * Module exports. + */ + +module.exports = depd + +/** + * Get the path to base files on. + */ + +var basePath = process.cwd() + +/** + * Determine if namespace is contained in the string. + */ + +function containsNamespace (str, namespace) { + var vals = str.split(/[ ,]+/) + var ns = String(namespace).toLowerCase() + + for (var i = 0; i < vals.length; i++) { + var val = vals[i] + + // namespace contained + if (val && (val === '*' || val.toLowerCase() === ns)) { + return true + } + } + + return false +} + +/** + * Convert a data descriptor to accessor descriptor. + */ + +function convertDataDescriptorToAccessor (obj, prop, message) { + var descriptor = Object.getOwnPropertyDescriptor(obj, prop) + var value = descriptor.value + + descriptor.get = function getter () { return value } + + if (descriptor.writable) { + descriptor.set = function setter (val) { return (value = val) } + } + + delete descriptor.value + delete descriptor.writable + + Object.defineProperty(obj, prop, descriptor) + + return descriptor +} + +/** + * Create arguments string to keep arity. + */ + +function createArgumentsString (arity) { + var str = '' + + for (var i = 0; i < arity; i++) { + str += ', arg' + i + } + + return str.substr(2) +} + +/** + * Create stack string from stack. + */ + +function createStackString (stack) { + var str = this.name + ': ' + this.namespace + + if (this.message) { + str += ' deprecated ' + this.message + } + + for (var i = 0; i < stack.length; i++) { + str += '\n at ' + callSiteToString(stack[i]) + } + + return str +} + +/** + * Create deprecate for namespace in caller. + */ + +function depd (namespace) { + if (!namespace) { + throw new TypeError('argument namespace is required') + } + + var stack = getStack() + var site = callSiteLocation(stack[1]) + var file = site[0] + + function deprecate (message) { + // call to self as log + log.call(deprecate, message) + } + + deprecate._file = file + deprecate._ignored = isignored(namespace) + deprecate._namespace = namespace + deprecate._traced = istraced(namespace) + deprecate._warned = Object.create(null) + + deprecate.function = wrapfunction + deprecate.property = wrapproperty + + return deprecate +} + +/** + * Determine if namespace is ignored. + */ + +function isignored (namespace) { + /* istanbul ignore next: tested in a child processs */ + if (process.noDeprecation) { + // --no-deprecation support + return true + } + + var str = process.env.NO_DEPRECATION || '' + + // namespace ignored + return containsNamespace(str, namespace) +} + +/** + * Determine if namespace is traced. + */ + +function istraced (namespace) { + /* istanbul ignore next: tested in a child processs */ + if (process.traceDeprecation) { + // --trace-deprecation support + return true + } + + var str = process.env.TRACE_DEPRECATION || '' + + // namespace traced + return containsNamespace(str, namespace) +} + +/** + * Display deprecation message. + */ + +function log (message, site) { + var haslisteners = eventListenerCount(process, 'deprecation') !== 0 + + // abort early if no destination + if (!haslisteners && this._ignored) { + return + } + + var caller + var callFile + var callSite + var depSite + var i = 0 + var seen = false + var stack = getStack() + var file = this._file + + if (site) { + // provided site + depSite = site + callSite = callSiteLocation(stack[1]) + callSite.name = depSite.name + file = callSite[0] + } else { + // get call site + i = 2 + depSite = callSiteLocation(stack[i]) + callSite = depSite + } + + // get caller of deprecated thing in relation to file + for (; i < stack.length; i++) { + caller = callSiteLocation(stack[i]) + callFile = caller[0] + + if (callFile === file) { + seen = true + } else if (callFile === this._file) { + file = this._file + } else if (seen) { + break + } + } + + var key = caller + ? depSite.join(':') + '__' + caller.join(':') + : undefined + + if (key !== undefined && key in this._warned) { + // already warned + return + } + + this._warned[key] = true + + // generate automatic message from call site + var msg = message + if (!msg) { + msg = callSite === depSite || !callSite.name + ? defaultMessage(depSite) + : defaultMessage(callSite) + } + + // emit deprecation if listeners exist + if (haslisteners) { + var err = DeprecationError(this._namespace, msg, stack.slice(i)) + process.emit('deprecation', err) + return + } + + // format and write message + var format = process.stderr.isTTY + ? formatColor + : formatPlain + var output = format.call(this, msg, caller, stack.slice(i)) + process.stderr.write(output + '\n', 'utf8') +} + +/** + * Get call site location as array. + */ + +function callSiteLocation (callSite) { + var file = callSite.getFileName() || '' + var line = callSite.getLineNumber() + var colm = callSite.getColumnNumber() + + if (callSite.isEval()) { + file = callSite.getEvalOrigin() + ', ' + file + } + + var site = [file, line, colm] + + site.callSite = callSite + site.name = callSite.getFunctionName() + + return site +} + +/** + * Generate a default message from the site. + */ + +function defaultMessage (site) { + var callSite = site.callSite + var funcName = site.name + + // make useful anonymous name + if (!funcName) { + funcName = '' + } + + var context = callSite.getThis() + var typeName = context && callSite.getTypeName() + + // ignore useless type name + if (typeName === 'Object') { + typeName = undefined + } + + // make useful type name + if (typeName === 'Function') { + typeName = context.name || typeName + } + + return typeName && callSite.getMethodName() + ? typeName + '.' + funcName + : funcName +} + +/** + * Format deprecation message without color. + */ + +function formatPlain (msg, caller, stack) { + var timestamp = new Date().toUTCString() + + var formatted = timestamp + + ' ' + this._namespace + + ' deprecated ' + msg + + // add stack trace + if (this._traced) { + for (var i = 0; i < stack.length; i++) { + formatted += '\n at ' + callSiteToString(stack[i]) + } + + return formatted + } + + if (caller) { + formatted += ' at ' + formatLocation(caller) + } + + return formatted +} + +/** + * Format deprecation message with color. + */ + +function formatColor (msg, caller, stack) { + var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' + // bold cyan + ' \x1b[33;1mdeprecated\x1b[22;39m' + // bold yellow + ' \x1b[0m' + msg + '\x1b[39m' // reset + + // add stack trace + if (this._traced) { + for (var i = 0; i < stack.length; i++) { + formatted += '\n \x1b[36mat ' + callSiteToString(stack[i]) + '\x1b[39m' // cyan + } + + return formatted + } + + if (caller) { + formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m' // cyan + } + + return formatted +} + +/** + * Format call site location. + */ + +function formatLocation (callSite) { + return relative(basePath, callSite[0]) + + ':' + callSite[1] + + ':' + callSite[2] +} + +/** + * Get the stack as array of call sites. + */ + +function getStack () { + var limit = Error.stackTraceLimit + var obj = {} + var prep = Error.prepareStackTrace + + Error.prepareStackTrace = prepareObjectStackTrace + Error.stackTraceLimit = Math.max(10, limit) + + // capture the stack + Error.captureStackTrace(obj) + + // slice this function off the top + var stack = obj.stack.slice(1) + + Error.prepareStackTrace = prep + Error.stackTraceLimit = limit + + return stack +} + +/** + * Capture call site stack from v8. + */ + +function prepareObjectStackTrace (obj, stack) { + return stack +} + +/** + * Return a wrapped function in a deprecation message. + */ + +function wrapfunction (fn, message) { + if (typeof fn !== 'function') { + throw new TypeError('argument fn must be a function') + } + + var args = createArgumentsString(fn.length) + var deprecate = this // eslint-disable-line no-unused-vars + var stack = getStack() + var site = callSiteLocation(stack[1]) + + site.name = fn.name + + // eslint-disable-next-line no-eval + var deprecatedfn = eval('(function (' + args + ') {\n' + + '"use strict"\n' + + 'log.call(deprecate, message, site)\n' + + 'return fn.apply(this, arguments)\n' + + '})') + + return deprecatedfn +} + +/** + * Wrap property in a deprecation message. + */ + +function wrapproperty (obj, prop, message) { + if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { + throw new TypeError('argument obj must be object') + } + + var descriptor = Object.getOwnPropertyDescriptor(obj, prop) + + if (!descriptor) { + throw new TypeError('must call property on owner object') + } + + if (!descriptor.configurable) { + throw new TypeError('property must be configurable') + } + + var deprecate = this + var stack = getStack() + var site = callSiteLocation(stack[1]) + + // set site name + site.name = prop + + // convert data descriptor + if ('value' in descriptor) { + descriptor = convertDataDescriptorToAccessor(obj, prop, message) + } + + var get = descriptor.get + var set = descriptor.set + + // wrap getter + if (typeof get === 'function') { + descriptor.get = function getter () { + log.call(deprecate, message, site) + return get.apply(this, arguments) + } + } + + // wrap setter + if (typeof set === 'function') { + descriptor.set = function setter () { + log.call(deprecate, message, site) + return set.apply(this, arguments) + } + } + + Object.defineProperty(obj, prop, descriptor) +} + +/** + * Create DeprecationError for deprecation + */ + +function DeprecationError (namespace, message, stack) { + var error = new Error() + var stackString + + Object.defineProperty(error, 'constructor', { + value: DeprecationError + }) + + Object.defineProperty(error, 'message', { + configurable: true, + enumerable: false, + value: message, + writable: true + }) + + Object.defineProperty(error, 'name', { + enumerable: false, + configurable: true, + value: 'DeprecationError', + writable: true + }) + + Object.defineProperty(error, 'namespace', { + configurable: true, + enumerable: false, + value: namespace, + writable: true + }) + + Object.defineProperty(error, 'stack', { + configurable: true, + enumerable: false, + get: function () { + if (stackString !== undefined) { + return stackString + } + + // prepare stack trace + return (stackString = createStackString.call(this, stack)) + }, + set: function setter (val) { + stackString = val + } + }) + + return error +} diff --git a/node_modules/depd/lib/browser/index.js b/node_modules/depd/lib/browser/index.js new file mode 100644 index 000000000..6be45cc20 --- /dev/null +++ b/node_modules/depd/lib/browser/index.js @@ -0,0 +1,77 @@ +/*! + * depd + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = depd + +/** + * Create deprecate for namespace in caller. + */ + +function depd (namespace) { + if (!namespace) { + throw new TypeError('argument namespace is required') + } + + function deprecate (message) { + // no-op in browser + } + + deprecate._file = undefined + deprecate._ignored = true + deprecate._namespace = namespace + deprecate._traced = false + deprecate._warned = Object.create(null) + + deprecate.function = wrapfunction + deprecate.property = wrapproperty + + return deprecate +} + +/** + * Return a wrapped function in a deprecation message. + * + * This is a no-op version of the wrapper, which does nothing but call + * validation. + */ + +function wrapfunction (fn, message) { + if (typeof fn !== 'function') { + throw new TypeError('argument fn must be a function') + } + + return fn +} + +/** + * Wrap property in a deprecation message. + * + * This is a no-op version of the wrapper, which does nothing but call + * validation. + */ + +function wrapproperty (obj, prop, message) { + if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { + throw new TypeError('argument obj must be object') + } + + var descriptor = Object.getOwnPropertyDescriptor(obj, prop) + + if (!descriptor) { + throw new TypeError('must call property on owner object') + } + + if (!descriptor.configurable) { + throw new TypeError('property must be configurable') + } +} diff --git a/node_modules/depd/lib/compat/callsite-tostring.js b/node_modules/depd/lib/compat/callsite-tostring.js new file mode 100644 index 000000000..73186dc64 --- /dev/null +++ b/node_modules/depd/lib/compat/callsite-tostring.js @@ -0,0 +1,103 @@ +/*! + * depd + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + */ + +module.exports = callSiteToString + +/** + * Format a CallSite file location to a string. + */ + +function callSiteFileLocation (callSite) { + var fileName + var fileLocation = '' + + if (callSite.isNative()) { + fileLocation = 'native' + } else if (callSite.isEval()) { + fileName = callSite.getScriptNameOrSourceURL() + if (!fileName) { + fileLocation = callSite.getEvalOrigin() + } + } else { + fileName = callSite.getFileName() + } + + if (fileName) { + fileLocation += fileName + + var lineNumber = callSite.getLineNumber() + if (lineNumber != null) { + fileLocation += ':' + lineNumber + + var columnNumber = callSite.getColumnNumber() + if (columnNumber) { + fileLocation += ':' + columnNumber + } + } + } + + return fileLocation || 'unknown source' +} + +/** + * Format a CallSite to a string. + */ + +function callSiteToString (callSite) { + var addSuffix = true + var fileLocation = callSiteFileLocation(callSite) + var functionName = callSite.getFunctionName() + var isConstructor = callSite.isConstructor() + var isMethodCall = !(callSite.isToplevel() || isConstructor) + var line = '' + + if (isMethodCall) { + var methodName = callSite.getMethodName() + var typeName = getConstructorName(callSite) + + if (functionName) { + if (typeName && functionName.indexOf(typeName) !== 0) { + line += typeName + '.' + } + + line += functionName + + if (methodName && functionName.lastIndexOf('.' + methodName) !== functionName.length - methodName.length - 1) { + line += ' [as ' + methodName + ']' + } + } else { + line += typeName + '.' + (methodName || '') + } + } else if (isConstructor) { + line += 'new ' + (functionName || '') + } else if (functionName) { + line += functionName + } else { + addSuffix = false + line += fileLocation + } + + if (addSuffix) { + line += ' (' + fileLocation + ')' + } + + return line +} + +/** + * Get constructor name of reviver. + */ + +function getConstructorName (obj) { + var receiver = obj.receiver + return (receiver.constructor && receiver.constructor.name) || null +} diff --git a/node_modules/depd/lib/compat/event-listener-count.js b/node_modules/depd/lib/compat/event-listener-count.js new file mode 100644 index 000000000..3a8925d13 --- /dev/null +++ b/node_modules/depd/lib/compat/event-listener-count.js @@ -0,0 +1,22 @@ +/*! + * depd + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = eventListenerCount + +/** + * Get the count of listeners on an event emitter of a specific type. + */ + +function eventListenerCount (emitter, type) { + return emitter.listeners(type).length +} diff --git a/node_modules/depd/lib/compat/index.js b/node_modules/depd/lib/compat/index.js new file mode 100644 index 000000000..955b3336b --- /dev/null +++ b/node_modules/depd/lib/compat/index.js @@ -0,0 +1,79 @@ +/*! + * depd + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var EventEmitter = require('events').EventEmitter + +/** + * Module exports. + * @public + */ + +lazyProperty(module.exports, 'callSiteToString', function callSiteToString () { + var limit = Error.stackTraceLimit + var obj = {} + var prep = Error.prepareStackTrace + + function prepareObjectStackTrace (obj, stack) { + return stack + } + + Error.prepareStackTrace = prepareObjectStackTrace + Error.stackTraceLimit = 2 + + // capture the stack + Error.captureStackTrace(obj) + + // slice the stack + var stack = obj.stack.slice() + + Error.prepareStackTrace = prep + Error.stackTraceLimit = limit + + return stack[0].toString ? toString : require('./callsite-tostring') +}) + +lazyProperty(module.exports, 'eventListenerCount', function eventListenerCount () { + return EventEmitter.listenerCount || require('./event-listener-count') +}) + +/** + * Define a lazy property. + */ + +function lazyProperty (obj, prop, getter) { + function get () { + var val = getter() + + Object.defineProperty(obj, prop, { + configurable: true, + enumerable: true, + value: val + }) + + return val + } + + Object.defineProperty(obj, prop, { + configurable: true, + enumerable: true, + get: get + }) +} + +/** + * Call toString() on the obj + */ + +function toString (obj) { + return obj.toString() +} diff --git a/node_modules/depd/package.json b/node_modules/depd/package.json new file mode 100644 index 000000000..71138cef4 --- /dev/null +++ b/node_modules/depd/package.json @@ -0,0 +1,77 @@ +{ + "_from": "depd@~1.1.2", + "_id": "depd@1.1.2", + "_inBundle": false, + "_integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "_location": "/depd", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "depd@~1.1.2", + "name": "depd", + "escapedName": "depd", + "rawSpec": "~1.1.2", + "saveSpec": null, + "fetchSpec": "~1.1.2" + }, + "_requiredBy": [ + "/http-errors", + "/send" + ], + "_resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "_shasum": "9bcd52e14c097763e749b274c4346ed2e560b5a9", + "_spec": "depd@~1.1.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/send", + "author": { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + "browser": "lib/browser/index.js", + "bugs": { + "url": "https://github.com/dougwilson/nodejs-depd/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Deprecate all the things", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "2.1.4", + "eslint": "3.19.0", + "eslint-config-standard": "7.1.0", + "eslint-plugin-markdown": "1.0.0-beta.7", + "eslint-plugin-promise": "3.6.0", + "eslint-plugin-standard": "3.0.1", + "istanbul": "0.4.5", + "mocha": "~1.21.5" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "lib/", + "History.md", + "LICENSE", + "index.js", + "Readme.md" + ], + "homepage": "https://github.com/dougwilson/nodejs-depd#readme", + "keywords": [ + "deprecate", + "deprecated" + ], + "license": "MIT", + "name": "depd", + "repository": { + "type": "git", + "url": "git+https://github.com/dougwilson/nodejs-depd.git" + }, + "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --bail test/", + "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --no-exit test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/" + }, + "version": "1.1.2" +} diff --git a/node_modules/deps-sort/.travis.yml b/node_modules/deps-sort/.travis.yml new file mode 100644 index 000000000..4eaf0db4c --- /dev/null +++ b/node_modules/deps-sort/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.10" + - "0.12" + - node diff --git a/node_modules/deps-sort/LICENSE b/node_modules/deps-sort/LICENSE new file mode 100644 index 000000000..ee27ba4b4 --- /dev/null +++ b/node_modules/deps-sort/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/deps-sort/bin/cmd.js b/node_modules/deps-sort/bin/cmd.js new file mode 100755 index 000000000..e54613011 --- /dev/null +++ b/node_modules/deps-sort/bin/cmd.js @@ -0,0 +1,10 @@ +#!/usr/bin/env node + +var argv = require('subarg')(process.argv.slice(2)); +var JSONStream = require('JSONStream'); + +var sort = require('../')(argv); +var parse = JSONStream.parse([ true ]); +var stringify = JSONStream.stringify(); + +process.stdin.pipe(parse).pipe(sort).pipe(stringify).pipe(process.stdout); diff --git a/node_modules/deps-sort/example/sort.js b/node_modules/deps-sort/example/sort.js new file mode 100644 index 000000000..cfc007548 --- /dev/null +++ b/node_modules/deps-sort/example/sort.js @@ -0,0 +1,6 @@ +var sort = require('../')(); +var JSONStream = require('JSONStream'); +var parse = JSONStream.parse([ true ]); +var stringify = JSONStream.stringify(); + +process.stdin.pipe(parse).pipe(sort).pipe(stringify).pipe(process.stdout); diff --git a/node_modules/deps-sort/index.js b/node_modules/deps-sort/index.js new file mode 100644 index 000000000..32cead406 --- /dev/null +++ b/node_modules/deps-sort/index.js @@ -0,0 +1,122 @@ +var through = require('through2'); +var shasum = require('shasum'); + +module.exports = function (opts) { + if (!opts) opts = {}; + var rows = []; + return through.obj(write, end); + + function write (row, enc, next) { rows.push(row); next() } + + function end () { + var tr = this; + rows.sort(cmp); + sorter(rows, tr, opts); + } +}; + +function sorter (rows, tr, opts) { + var expose = opts.expose || {}; + if (Array.isArray(expose)) { + expose = expose.reduce(function (acc, key) { + acc[key] = true; + return acc; + }, {}); + } + + var hashes = {}, deduped = {}; + var sameDeps = depCmp(); + + if (opts.dedupe) { + rows.forEach(function (row) { + var h = shasum(row.source); + sameDeps.add(row, h); + if (hashes[h]) { + hashes[h].push(row); + } else { + hashes[h] = [row]; + } + }); + Object.keys(hashes).forEach(function (h) { + var rows = hashes[h]; + while (rows.length > 1) { + var row = rows.pop(); + row.dedupe = rows[0].id; + row.sameDeps = sameDeps.cmp(rows[0].deps, row.deps); + deduped[row.id] = rows[0].id; + } + }); + } + + if (opts.index) { + var index = {}; + var offset = 0; + rows.forEach(function (row, ix) { + if (has(expose, row.id)) { + row.index = row.id; + offset ++; + if (expose[row.id] !== true) { + index[expose[row.id]] = row.index; + } + } + else { + row.index = ix + 1 - offset; + } + index[row.id] = row.index; + }); + rows.forEach(function (row) { + row.indexDeps = {}; + Object.keys(row.deps).forEach(function (key) { + var id = row.deps[key]; + row.indexDeps[key] = index[id]; + }); + if (row.dedupe) { + row.dedupeIndex = index[row.dedupe]; + } + tr.push(row); + }); + } + else { + rows.forEach(function (row) { tr.push(row) }); + } + tr.push(null); +} + +function cmp (a, b) { + return a.id + a.hash < b.id + b.hash ? -1 : 1; +} + +function has (obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} + +function depCmp () { + var deps = {}, hashes = {}; + return { add: add, cmp: cmp } + + function add (row, hash) { + deps[row.id] = row.deps; + hashes[row.id] = hash; + } + function cmp (a, b, limit) { + if (!a && !b) return true; + if (!a || !b) return false; + + var keys = Object.keys(a); + if (keys.length !== Object.keys(b).length) return false; + + for (var i = 0; i < keys.length; i++) { + var k = keys[i], ka = a[k], kb = b[k]; + var ha = hashes[ka]; + var hb = hashes[kb]; + var da = deps[ka]; + var db = deps[kb]; + + if (ka === kb) continue; + if (ha !== hb || (!limit && !cmp(da, db, 1))) { + return false; + } + } + return true; + } +} diff --git a/node_modules/deps-sort/package.json b/node_modules/deps-sort/package.json new file mode 100644 index 000000000..670a0a09c --- /dev/null +++ b/node_modules/deps-sort/package.json @@ -0,0 +1,70 @@ +{ + "_from": "deps-sort@^2.0.0", + "_id": "deps-sort@2.0.0", + "_inBundle": false, + "_integrity": "sha1-CRckkC6EZYJg65EHSMzNGvbiH7U=", + "_location": "/deps-sort", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "deps-sort@^2.0.0", + "name": "deps-sort", + "escapedName": "deps-sort", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/browserify" + ], + "_resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", + "_shasum": "091724902e84658260eb910748cccd1af6e21fb5", + "_spec": "deps-sort@^2.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bin": { + "deps-sort": "bin/cmd.js" + }, + "bugs": { + "url": "https://github.com/substack/deps-sort/issues" + }, + "bundleDependencies": false, + "dependencies": { + "JSONStream": "^1.0.3", + "shasum": "^1.0.0", + "subarg": "^1.0.0", + "through2": "^2.0.0" + }, + "deprecated": false, + "description": "sort module-deps output for deterministic browserify bundles", + "devDependencies": { + "tap": "^2.2.0" + }, + "homepage": "https://github.com/substack/deps-sort", + "keywords": [ + "dependency", + "graph", + "browser", + "browserify", + "module-deps", + "browser-pack", + "sorted", + "determinism" + ], + "license": "MIT", + "main": "index.js", + "name": "deps-sort", + "repository": { + "type": "git", + "url": "git://github.com/substack/deps-sort.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "2.0.0" +} diff --git a/node_modules/deps-sort/readme.markdown b/node_modules/deps-sort/readme.markdown new file mode 100644 index 000000000..873210b8e --- /dev/null +++ b/node_modules/deps-sort/readme.markdown @@ -0,0 +1,83 @@ +# deps-sort + +sort [module-deps](https://npmjs.org/package/module-deps) output for deterministic +browserify bundles + +[![build status](https://secure.travis-ci.org/substack/deps-sort.png)](http://travis-ci.org/substack/deps-sort) + +# example + +## command-line + +``` +$ for((i=0;i<5;i++)); do module-deps main.js | deps-sort | browser-pack | md5sum; done +e9e630de2c62953140357db0444c3c3a - +e9e630de2c62953140357db0444c3c3a - +e9e630de2c62953140357db0444c3c3a - +e9e630de2c62953140357db0444c3c3a - +e9e630de2c62953140357db0444c3c3a - +``` + +or using `browserify --deps` on a [voxeljs](http://voxeljs.com/) project: + +``` +$ for((i=0;i<5;i++)); do browserify --deps browser.js | deps-sort | browser-pack | md5sum; done +fb418c74b53ba2e4cef7d01808b848e6 - +fb418c74b53ba2e4cef7d01808b848e6 - +fb418c74b53ba2e4cef7d01808b848e6 - +fb418c74b53ba2e4cef7d01808b848e6 - +fb418c74b53ba2e4cef7d01808b848e6 - +``` + +## api + +To use this module programmatically, write streaming object data and read +streaming object data: + +``` js +var sort = require('../')(); +var JSONStream = require('JSONStream'); +var parse = JSONStream.parse([ true ]); +var stringify = JSONStream.stringify(); + +process.stdin.pipe(parse).pipe(sort).pipe(stringify).pipe(process.stdout); +``` + +# methods + +``` js +var depsSort = require('deps-sort'); +``` + +## var stream = depsSort(opts) + +Return a new through `stream` that should get written +[module-deps](https://npmjs.org/package/module-deps) objects and will output +sorted objects. + +`opts` can be: + +* `opts.index` - when true, for each module-deps row, insert `row.index` with +the numeric index and `row.indexDeps` like `row.deps` but mapping require +strings to row indices + +* `opts.expose` - array of names or object mapping names to `true` not to mangle +with integer indexes when `opts.index` is turned on. If `opts.expose` maps names +to strings, those strings will be used to resolve the indexed references. + +* `opts.dedupe` - set `row.dedupe` for files that match existing contents. Sets +`row.dedupeIndex` when `opts.index` is enabled. When `row.dedupe` is set, +`row.sameDeps` will be set to a boolean of whether the dependencies at the +dedupe target match (true) or just the source content (false). + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install deps-sort +``` + +# license + +MIT diff --git a/node_modules/deps-sort/test/dedupe-deps-of-deps.js b/node_modules/deps-sort/test/dedupe-deps-of-deps.js new file mode 100644 index 000000000..f0849c59b --- /dev/null +++ b/node_modules/deps-sort/test/dedupe-deps-of-deps.js @@ -0,0 +1,71 @@ +var sort = require('../'); +var test = require('tap').test; +var through = require('through2'); + +test('dedupe-deps-of-deps', function (t) { + t.plan(1); + var s = sort({ dedupe: true }); + var rows = []; + function write (row, enc, next) { rows.push(row); next() } + function end () { + t.deepEqual(rows, [ + { + id: '/bar.js', + deps: { baz: '/bar/baz.js' }, + source: 'TWO' + }, + { + id: '/bar/baz.js', + deps: {}, + source: 'THREE' + }, + { + id: '/foo.js', + deps: { baz: '/foo/baz.js' }, + source: 'TWO', + dedupe: '/bar.js', + sameDeps: true + }, + { + id: '/foo/baz.js', + deps: {}, + source: 'THREE', + dedupe: '/bar/baz.js', + sameDeps: true + }, + { + id: '/main.js', + deps: { './foo': '/foo.js', './bar': '/bar.js' }, + source: 'ONE' + } + ]); + } + s.pipe(through.obj(write, end)); + + s.write({ + id: '/main.js', + deps: { './foo': '/foo.js', './bar': '/bar.js' }, + source: 'ONE' + }); + s.write({ + id: '/foo.js', + deps: { baz : '/foo/baz.js' }, + source: 'TWO' + }); + s.write({ + id: '/bar.js', + deps: { baz : '/bar/baz.js' }, + source: 'TWO' + }); + s.write({ + id: '/foo/baz.js', + deps: {}, + source: 'THREE' + }); + s.write({ + id: '/bar/baz.js', + deps: {}, + source: 'THREE' + }); + s.end(); +}); diff --git a/node_modules/deps-sort/test/dedupe.js b/node_modules/deps-sort/test/dedupe.js new file mode 100644 index 000000000..e5b0ef3c1 --- /dev/null +++ b/node_modules/deps-sort/test/dedupe.js @@ -0,0 +1,39 @@ +var sort = require('../'); +var test = require('tap').test; +var through = require('through2'); + +test('dedupe', function (t) { + t.plan(1); + var s = sort({ dedupe: true }); + var rows = []; + function write (row, enc, next) { rows.push(row); next() } + function end () { + t.deepEqual(rows, [ + { id: '/bar.js', deps: {}, source: 'TWO' }, + { id: '/foo.js', deps: {}, source: 'TWO', dedupe: '/bar.js', sameDeps: true }, + { + id: '/main.js', + deps: { './foo': '/foo.js', './bar': '/bar.js' }, + source: 'ONE' + } + ]); + } + s.pipe(through.obj(write, end)); + + s.write({ + id: '/main.js', + deps: { './foo': '/foo.js', './bar': '/bar.js' }, + source: 'ONE' + }); + s.write({ + id: '/foo.js', + deps: {}, + source: 'TWO' + }); + s.write({ + id: '/bar.js', + deps: {}, + source: 'TWO' + }); + s.end(); +}); diff --git a/node_modules/deps-sort/test/dedupe_index.js b/node_modules/deps-sort/test/dedupe_index.js new file mode 100644 index 000000000..313b7442e --- /dev/null +++ b/node_modules/deps-sort/test/dedupe_index.js @@ -0,0 +1,56 @@ +var sort = require('../'); +var test = require('tap').test; +var through = require('through2'); + +test('dedupe index', function (t) { + t.plan(1); + var s = sort({ dedupe: true, index: true }); + var rows = []; + function write (row, enc, next) { rows.push(row); next() } + function end () { + t.deepEqual(rows, [ + { + id: '/bar.js', + deps: {}, + source: 'TWO', + index: 1, + indexDeps: {} + }, + { + id: '/foo.js', + deps: {}, + source: 'TWO', + dedupe: '/bar.js', + index: 2, + indexDeps: {}, + dedupeIndex: 1, + sameDeps: true + }, + { + id: '/main.js', + deps: { './foo': '/foo.js', './bar': '/bar.js' }, + source: 'ONE', + index: 3, + indexDeps: { './foo': 2, './bar': 1 }, + } + ]); + } + s.pipe(through.obj(write, end)); + + s.write({ + id: '/main.js', + deps: { './foo': '/foo.js', './bar': '/bar.js' }, + source: 'ONE' + }); + s.write({ + id: '/foo.js', + deps: {}, + source: 'TWO' + }); + s.write({ + id: '/bar.js', + deps: {}, + source: 'TWO' + }); + s.end(); +}); diff --git a/node_modules/deps-sort/test/dedupe_undef.js b/node_modules/deps-sort/test/dedupe_undef.js new file mode 100644 index 000000000..3a9f987ec --- /dev/null +++ b/node_modules/deps-sort/test/dedupe_undef.js @@ -0,0 +1,37 @@ +var sort = require('../'); +var test = require('tap').test; +var through = require('through2'); + +test('dedupe undef', function (t) { + t.plan(1); + var s = sort({ dedupe: true }); + var rows = []; + function write (row, enc, next) { rows.push(row); next() } + function end () { + t.deepEqual(rows, [ + { id: '/bar.js', source: 'TWO' }, + { id: '/foo.js', source: 'TWO', dedupe: '/bar.js', sameDeps: true }, + { + id: '/main.js', + deps: { './foo': '/foo.js', './bar': '/bar.js' }, + source: 'ONE' + } + ]); + } + s.pipe(through.obj(write, end)); + + s.write({ + id: '/main.js', + deps: { './foo': '/foo.js', './bar': '/bar.js' }, + source: 'ONE' + }); + s.write({ + id: '/foo.js', + source: 'TWO' + }); + s.write({ + id: '/bar.js', + source: 'TWO' + }); + s.end(); +}); diff --git a/node_modules/deps-sort/test/expose.js b/node_modules/deps-sort/test/expose.js new file mode 100644 index 000000000..7beb90d82 --- /dev/null +++ b/node_modules/deps-sort/test/expose.js @@ -0,0 +1,38 @@ +var sort = require('../'); +var test = require('tap').test; +var through = require('through2'); + +test('expose true', function (t) { + t.plan(1); + var s = sort({ index: true, expose: [ '/foo.js', '/bar.js' ] }); + var rows = []; + function write (row, enc, next) { rows.push(row); next() } + function end () { + t.deepEqual(rows, [ + { + id: '/bar.js', + deps: {}, + index: '/bar.js', + indexDeps: {} + }, + { + id: '/foo.js', + deps: { './bar': '/bar.js' }, + index: '/foo.js', + indexDeps: { './bar': '/bar.js' } + }, + { + id: '/main.js', + deps: { './foo': '/foo.js' }, + index: 1, + indexDeps: { './foo': '/foo.js' } + }, + ]); + } + s.pipe(through.obj(write, end)); + + s.write({ id: '/main.js', deps: { './foo': '/foo.js' } }); + s.write({ id: '/foo.js', deps: { './bar': '/bar.js' } }); + s.write({ id: '/bar.js', deps: {} }); + s.end(); +}); diff --git a/node_modules/deps-sort/test/expose_str.js b/node_modules/deps-sort/test/expose_str.js new file mode 100644 index 000000000..9ba151ef4 --- /dev/null +++ b/node_modules/deps-sort/test/expose_str.js @@ -0,0 +1,44 @@ +var sort = require('../'); +var test = require('tap').test; +var through = require('through2'); + +test('expose string', function (t) { + t.plan(1); + var s = sort({ + index: true, + expose: { + 'f': '/foo.js', + 'b': '/bar.js' + } + }); + var rows = []; + function write (row, enc, next) { rows.push(row); next() } + function end () { + t.deepEqual(rows, [ + { + id: '/main.js', + deps: { './foo': '/foo.js' }, + index: 1, + indexDeps: { './foo': 'f' } + }, + { + id: 'b', + deps: {}, + index: 'b', + indexDeps: {} + }, + { + id: 'f', + deps: { './bar': '/bar.js' }, + index: 'f', + indexDeps: { './bar': 'b' } + } + ]); + } + s.pipe(through.obj(write, end)); + + s.write({ id: '/main.js', deps: { './foo': '/foo.js' } }); + s.write({ id: 'f', deps: { './bar': '/bar.js' } }); + s.write({ id: 'b', deps: {} }); + s.end(); +}); diff --git a/node_modules/deps-sort/test/indexed.js b/node_modules/deps-sort/test/indexed.js new file mode 100644 index 000000000..f47ea8c10 --- /dev/null +++ b/node_modules/deps-sort/test/indexed.js @@ -0,0 +1,38 @@ +var sort = require('../'); +var test = require('tap').test; +var through = require('through2'); + +test('indexed', function (t) { + t.plan(1); + var s = sort({ index: true }); + var rows = []; + function write (row, enc, next) { rows.push(row); next() } + function end () { + t.deepEqual(rows, [ + { + id: '/bar.js', + deps: {}, + index: 1, + indexDeps: {} + }, + { + id: '/foo.js', + deps: { './bar': '/bar.js' }, + index: 2, + indexDeps: { './bar': 1 } + }, + { + id: '/main.js', + deps: { './foo': '/foo.js' }, + index: 3, + indexDeps: { './foo': 2 } + }, + ]); + } + s.pipe(through.obj(write, end)); + + s.write({ id: '/main.js', deps: { './foo': '/foo.js' } }); + s.write({ id: '/foo.js', deps: { './bar': '/bar.js' } }); + s.write({ id: '/bar.js', deps: {} }); + s.end(); +}); diff --git a/node_modules/deps-sort/test/sort.js b/node_modules/deps-sort/test/sort.js new file mode 100644 index 000000000..7c600d4b8 --- /dev/null +++ b/node_modules/deps-sort/test/sort.js @@ -0,0 +1,23 @@ +var sort = require('../'); +var test = require('tap').test; +var through = require('through2'); + +test('sort', function (t) { + t.plan(1); + var s = sort(); + var rows = []; + function write (row, enc, next) { rows.push(row); next() } + function end () { + t.deepEqual(rows, [ + { id: '/bar.js', deps: {} }, + { id: '/foo.js', deps: { './bar': '/bar.js' } }, + { id: '/main.js', deps: { './foo': '/foo.js' } } + ]); + } + s.pipe(through.obj(write, end)); + + s.write({ id: '/main.js', deps: { './foo': '/foo.js' } }); + s.write({ id: '/foo.js', deps: { './bar': '/bar.js' } }); + s.write({ id: '/bar.js', deps: {} }); + s.end(); +}); diff --git a/node_modules/des.js/.jscsrc b/node_modules/des.js/.jscsrc new file mode 100644 index 000000000..dbaae2057 --- /dev/null +++ b/node_modules/des.js/.jscsrc @@ -0,0 +1,46 @@ +{ + "disallowKeywordsOnNewLine": [ "else" ], + "disallowMixedSpacesAndTabs": true, + "disallowMultipleLineStrings": true, + "disallowMultipleVarDecl": true, + "disallowNewlineBeforeBlockStatements": true, + "disallowQuotedKeysInObjects": true, + "disallowSpaceAfterObjectKeys": true, + "disallowSpaceAfterPrefixUnaryOperators": true, + "disallowSpaceBeforePostfixUnaryOperators": true, + "disallowSpacesInCallExpression": true, + "disallowTrailingComma": true, + "disallowTrailingWhitespace": true, + "disallowYodaConditions": true, + + "requireCommaBeforeLineBreak": true, + "requireOperatorBeforeLineBreak": true, + "requireSpaceAfterBinaryOperators": true, + "requireSpaceAfterKeywords": [ "if", "for", "while", "else", "try", "catch" ], + "requireSpaceAfterLineComment": true, + "requireSpaceBeforeBinaryOperators": true, + "requireSpaceBeforeBlockStatements": true, + "requireSpaceBeforeKeywords": [ "else", "catch" ], + "requireSpaceBeforeObjectValues": true, + "requireSpaceBetweenArguments": true, + "requireSpacesInAnonymousFunctionExpression": { + "beforeOpeningCurlyBrace": true + }, + "requireSpacesInFunctionDeclaration": { + "beforeOpeningCurlyBrace": true + }, + "requireSpacesInFunctionExpression": { + "beforeOpeningCurlyBrace": true + }, + "requireSpacesInConditionalExpression": true, + "requireSpacesInForStatement": true, + "requireSpacesInsideArrayBrackets": "all", + "requireSpacesInsideObjectBrackets": "all", + "requireDotNotation": true, + + "maximumLineLength": 80, + "validateIndentation": 2, + "validateLineBreaks": "LF", + "validateParameterSeparator": ", ", + "validateQuoteMarks": "'" +} diff --git a/node_modules/des.js/.jshintrc b/node_modules/des.js/.jshintrc new file mode 100644 index 000000000..7e9739029 --- /dev/null +++ b/node_modules/des.js/.jshintrc @@ -0,0 +1,89 @@ +{ + // JSHint Default Configuration File (as on JSHint website) + // See http://jshint.com/docs/ for more details + + "maxerr" : 50, // {int} Maximum error before stopping + + // Enforcing + "bitwise" : false, // true: Prohibit bitwise operators (&, |, ^, etc.) + "camelcase" : false, // true: Identifiers must be in camelCase + "curly" : false, // true: Require {} for every new block or scope + "eqeqeq" : true, // true: Require triple equals (===) for comparison + "forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty() + "freeze" : true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc. + "immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());` + "indent" : 2, // {int} Number of spaces to use for indentation + "latedef" : true, // true: Require variables/functions to be defined before being used + "newcap" : true, // true: Require capitalization of all constructor functions e.g. `new F()` + "noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee` + "noempty" : false, // true: Prohibit use of empty blocks + "nonbsp" : true, // true: Prohibit "non-breaking whitespace" characters. + "nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment) + "plusplus" : false, // true: Prohibit use of `++` & `--` + "quotmark" : "single", // Quotation mark consistency: + // false : do nothing (default) + // true : ensure whatever is used is consistent + // "single" : require single quotes + // "double" : require double quotes + "undef" : true, // true: Require all non-global variables to be declared (prevents global leaks) + "unused" : true, // true: Require all defined variables be used + "strict" : true, // true: Requires all functions run in ES5 Strict Mode + "maxparams" : false, // {int} Max number of formal params allowed per function + "maxdepth" : 3, // {int} Max depth of nested blocks (within functions) + "maxstatements" : false, // {int} Max number statements per function + "maxcomplexity" : false, // {int} Max cyclomatic complexity per function + "maxlen" : false, // {int} Max number of characters per line + + // Relaxing + "asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons) + "boss" : false, // true: Tolerate assignments where comparisons would be expected + "debug" : false, // true: Allow debugger statements e.g. browser breakpoints. + "eqnull" : false, // true: Tolerate use of `== null` + "es5" : false, // true: Allow ES5 syntax (ex: getters and setters) + "esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`) + "moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features) + // (ex: `for each`, multiple try/catch, function expression…) + "evil" : false, // true: Tolerate use of `eval` and `new Function()` + "expr" : false, // true: Tolerate `ExpressionStatement` as Programs + "funcscope" : false, // true: Tolerate defining variables inside control statements + "globalstrict" : false, // true: Allow global "use strict" (also enables 'strict') + "iterator" : false, // true: Tolerate using the `__iterator__` property + "lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block + "laxbreak" : false, // true: Tolerate possibly unsafe line breakings + "laxcomma" : false, // true: Tolerate comma-first style coding + "loopfunc" : false, // true: Tolerate functions being defined in loops + "multistr" : false, // true: Tolerate multi-line strings + "noyield" : false, // true: Tolerate generator functions with no yield statement in them. + "notypeof" : false, // true: Tolerate invalid typeof operator values + "proto" : false, // true: Tolerate using the `__proto__` property + "scripturl" : false, // true: Tolerate script-targeted URLs + "shadow" : true, // true: Allows re-define variables later in code e.g. `var x=1; x=2;` + "sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation + "supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;` + "validthis" : false, // true: Tolerate using this in a non-constructor function + + // Environments + "browser" : true, // Web Browser (window, document, etc) + "browserify" : true, // Browserify (node.js code in the browser) + "couch" : false, // CouchDB + "devel" : true, // Development/debugging (alert, confirm, etc) + "dojo" : false, // Dojo Toolkit + "jasmine" : false, // Jasmine + "jquery" : false, // jQuery + "mocha" : true, // Mocha + "mootools" : false, // MooTools + "node" : true, // Node.js + "nonstandard" : false, // Widely adopted globals (escape, unescape, etc) + "prototypejs" : false, // Prototype and Scriptaculous + "qunit" : false, // QUnit + "rhino" : false, // Rhino + "shelljs" : false, // ShellJS + "worker" : false, // Web Workers + "wsh" : false, // Windows Scripting Host + "yui" : false, // Yahoo User Interface + + // Custom Globals + "globals" : { + "module": true + } // additional predefined global variables +} diff --git a/node_modules/des.js/.npmignore b/node_modules/des.js/.npmignore new file mode 100644 index 000000000..1ca957177 --- /dev/null +++ b/node_modules/des.js/.npmignore @@ -0,0 +1,2 @@ +node_modules/ +npm-debug.log diff --git a/node_modules/des.js/README.md b/node_modules/des.js/README.md new file mode 100644 index 000000000..976de33bd --- /dev/null +++ b/node_modules/des.js/README.md @@ -0,0 +1,26 @@ +# DES.js + +## LICENSE + +This software is licensed under the MIT License. + +Copyright Fedor Indutny, 2015. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/des.js/lib/des.js b/node_modules/des.js/lib/des.js new file mode 100644 index 000000000..2fd04a6dc --- /dev/null +++ b/node_modules/des.js/lib/des.js @@ -0,0 +1,7 @@ +'use strict'; + +exports.utils = require('./des/utils'); +exports.Cipher = require('./des/cipher'); +exports.DES = require('./des/des'); +exports.CBC = require('./des/cbc'); +exports.EDE = require('./des/ede'); diff --git a/node_modules/des.js/lib/des/cbc.js b/node_modules/des.js/lib/des/cbc.js new file mode 100644 index 000000000..208ea3133 --- /dev/null +++ b/node_modules/des.js/lib/des/cbc.js @@ -0,0 +1,65 @@ +'use strict'; + +var assert = require('minimalistic-assert'); +var inherits = require('inherits'); + +var proto = {}; + +function CBCState(iv) { + assert.equal(iv.length, 8, 'Invalid IV length'); + + this.iv = new Array(8); + for (var i = 0; i < this.iv.length; i++) + this.iv[i] = iv[i]; +} + +function instantiate(Base) { + function CBC(options) { + Base.call(this, options); + this._cbcInit(); + } + inherits(CBC, Base); + + var keys = Object.keys(proto); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + CBC.prototype[key] = proto[key]; + } + + CBC.create = function create(options) { + return new CBC(options); + }; + + return CBC; +} + +exports.instantiate = instantiate; + +proto._cbcInit = function _cbcInit() { + var state = new CBCState(this.options.iv); + this._cbcState = state; +}; + +proto._update = function _update(inp, inOff, out, outOff) { + var state = this._cbcState; + var superProto = this.constructor.super_.prototype; + + var iv = state.iv; + if (this.type === 'encrypt') { + for (var i = 0; i < this.blockSize; i++) + iv[i] ^= inp[inOff + i]; + + superProto._update.call(this, iv, 0, out, outOff); + + for (var i = 0; i < this.blockSize; i++) + iv[i] = out[outOff + i]; + } else { + superProto._update.call(this, inp, inOff, out, outOff); + + for (var i = 0; i < this.blockSize; i++) + out[outOff + i] ^= iv[i]; + + for (var i = 0; i < this.blockSize; i++) + iv[i] = inp[inOff + i]; + } +}; diff --git a/node_modules/des.js/lib/des/cipher.js b/node_modules/des.js/lib/des/cipher.js new file mode 100644 index 000000000..d0090b4cd --- /dev/null +++ b/node_modules/des.js/lib/des/cipher.js @@ -0,0 +1,141 @@ +'use strict'; + +var assert = require('minimalistic-assert'); + +function Cipher(options) { + this.options = options; + + this.type = this.options.type; + this.blockSize = 8; + this._init(); + + this.buffer = new Array(this.blockSize); + this.bufferOff = 0; +} +module.exports = Cipher; + +Cipher.prototype._init = function _init() { + // Might be overrided +}; + +Cipher.prototype.update = function update(data) { + if (data.length === 0) + return []; + + if (this.type === 'decrypt') + return this._updateDecrypt(data); + else + return this._updateEncrypt(data); +}; + +Cipher.prototype._buffer = function _buffer(data, off) { + // Append data to buffer + var min = Math.min(this.buffer.length - this.bufferOff, data.length - off); + for (var i = 0; i < min; i++) + this.buffer[this.bufferOff + i] = data[off + i]; + this.bufferOff += min; + + // Shift next + return min; +}; + +Cipher.prototype._flushBuffer = function _flushBuffer(out, off) { + this._update(this.buffer, 0, out, off); + this.bufferOff = 0; + return this.blockSize; +}; + +Cipher.prototype._updateEncrypt = function _updateEncrypt(data) { + var inputOff = 0; + var outputOff = 0; + + var count = ((this.bufferOff + data.length) / this.blockSize) | 0; + var out = new Array(count * this.blockSize); + + if (this.bufferOff !== 0) { + inputOff += this._buffer(data, inputOff); + + if (this.bufferOff === this.buffer.length) + outputOff += this._flushBuffer(out, outputOff); + } + + // Write blocks + var max = data.length - ((data.length - inputOff) % this.blockSize); + for (; inputOff < max; inputOff += this.blockSize) { + this._update(data, inputOff, out, outputOff); + outputOff += this.blockSize; + } + + // Queue rest + for (; inputOff < data.length; inputOff++, this.bufferOff++) + this.buffer[this.bufferOff] = data[inputOff]; + + return out; +}; + +Cipher.prototype._updateDecrypt = function _updateDecrypt(data) { + var inputOff = 0; + var outputOff = 0; + + var count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1; + var out = new Array(count * this.blockSize); + + // TODO(indutny): optimize it, this is far from optimal + for (; count > 0; count--) { + inputOff += this._buffer(data, inputOff); + outputOff += this._flushBuffer(out, outputOff); + } + + // Buffer rest of the input + inputOff += this._buffer(data, inputOff); + + return out; +}; + +Cipher.prototype.final = function final(buffer) { + var first; + if (buffer) + first = this.update(buffer); + + var last; + if (this.type === 'encrypt') + last = this._finalEncrypt(); + else + last = this._finalDecrypt(); + + if (first) + return first.concat(last); + else + return last; +}; + +Cipher.prototype._pad = function _pad(buffer, off) { + if (off === 0) + return false; + + while (off < buffer.length) + buffer[off++] = 0; + + return true; +}; + +Cipher.prototype._finalEncrypt = function _finalEncrypt() { + if (!this._pad(this.buffer, this.bufferOff)) + return []; + + var out = new Array(this.blockSize); + this._update(this.buffer, 0, out, 0); + return out; +}; + +Cipher.prototype._unpad = function _unpad(buffer) { + return buffer; +}; + +Cipher.prototype._finalDecrypt = function _finalDecrypt() { + assert.equal(this.bufferOff, this.blockSize, 'Not enough data to decrypt'); + var out = new Array(this.blockSize); + this._flushBuffer(out, 0); + + return this._unpad(out); +}; diff --git a/node_modules/des.js/lib/des/des.js b/node_modules/des.js/lib/des/des.js new file mode 100644 index 000000000..b64a6d1b0 --- /dev/null +++ b/node_modules/des.js/lib/des/des.js @@ -0,0 +1,143 @@ +'use strict'; + +var assert = require('minimalistic-assert'); +var inherits = require('inherits'); + +var des = require('../des'); +var utils = des.utils; +var Cipher = des.Cipher; + +function DESState() { + this.tmp = new Array(2); + this.keys = null; +} + +function DES(options) { + Cipher.call(this, options); + + var state = new DESState(); + this._desState = state; + + this.deriveKeys(state, options.key); +} +inherits(DES, Cipher); +module.exports = DES; + +DES.create = function create(options) { + return new DES(options); +}; + +var shiftTable = [ + 1, 1, 2, 2, 2, 2, 2, 2, + 1, 2, 2, 2, 2, 2, 2, 1 +]; + +DES.prototype.deriveKeys = function deriveKeys(state, key) { + state.keys = new Array(16 * 2); + + assert.equal(key.length, this.blockSize, 'Invalid key length'); + + var kL = utils.readUInt32BE(key, 0); + var kR = utils.readUInt32BE(key, 4); + + utils.pc1(kL, kR, state.tmp, 0); + kL = state.tmp[0]; + kR = state.tmp[1]; + for (var i = 0; i < state.keys.length; i += 2) { + var shift = shiftTable[i >>> 1]; + kL = utils.r28shl(kL, shift); + kR = utils.r28shl(kR, shift); + utils.pc2(kL, kR, state.keys, i); + } +}; + +DES.prototype._update = function _update(inp, inOff, out, outOff) { + var state = this._desState; + + var l = utils.readUInt32BE(inp, inOff); + var r = utils.readUInt32BE(inp, inOff + 4); + + // Initial Permutation + utils.ip(l, r, state.tmp, 0); + l = state.tmp[0]; + r = state.tmp[1]; + + if (this.type === 'encrypt') + this._encrypt(state, l, r, state.tmp, 0); + else + this._decrypt(state, l, r, state.tmp, 0); + + l = state.tmp[0]; + r = state.tmp[1]; + + utils.writeUInt32BE(out, l, outOff); + utils.writeUInt32BE(out, r, outOff + 4); +}; + +DES.prototype._pad = function _pad(buffer, off) { + var value = buffer.length - off; + for (var i = off; i < buffer.length; i++) + buffer[i] = value; + + return true; +}; + +DES.prototype._unpad = function _unpad(buffer) { + var pad = buffer[buffer.length - 1]; + for (var i = buffer.length - pad; i < buffer.length; i++) + assert.equal(buffer[i], pad); + + return buffer.slice(0, buffer.length - pad); +}; + +DES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) { + var l = lStart; + var r = rStart; + + // Apply f() x16 times + for (var i = 0; i < state.keys.length; i += 2) { + var keyL = state.keys[i]; + var keyR = state.keys[i + 1]; + + // f(r, k) + utils.expand(r, state.tmp, 0); + + keyL ^= state.tmp[0]; + keyR ^= state.tmp[1]; + var s = utils.substitute(keyL, keyR); + var f = utils.permute(s); + + var t = r; + r = (l ^ f) >>> 0; + l = t; + } + + // Reverse Initial Permutation + utils.rip(r, l, out, off); +}; + +DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) { + var l = rStart; + var r = lStart; + + // Apply f() x16 times + for (var i = state.keys.length - 2; i >= 0; i -= 2) { + var keyL = state.keys[i]; + var keyR = state.keys[i + 1]; + + // f(r, k) + utils.expand(l, state.tmp, 0); + + keyL ^= state.tmp[0]; + keyR ^= state.tmp[1]; + var s = utils.substitute(keyL, keyR); + var f = utils.permute(s); + + var t = l; + l = (r ^ f) >>> 0; + r = t; + } + + // Reverse Initial Permutation + utils.rip(l, r, out, off); +}; diff --git a/node_modules/des.js/lib/des/ede.js b/node_modules/des.js/lib/des/ede.js new file mode 100644 index 000000000..cefc4a5c7 --- /dev/null +++ b/node_modules/des.js/lib/des/ede.js @@ -0,0 +1,55 @@ +'use strict'; + +var assert = require('minimalistic-assert'); +var inherits = require('inherits'); + +var des = require('../des'); +var Cipher = des.Cipher; +var DES = des.DES; + +function EDEState(type, key) { + assert.equal(key.length, 24, 'Invalid key length'); + + var k1 = key.slice(0, 8); + var k2 = key.slice(8, 16); + var k3 = key.slice(16, 24); + + if (type === 'encrypt') { + this.ciphers = [ + DES.create({ type: 'encrypt', key: k1 }), + DES.create({ type: 'decrypt', key: k2 }), + DES.create({ type: 'encrypt', key: k3 }) + ]; + } else { + this.ciphers = [ + DES.create({ type: 'decrypt', key: k3 }), + DES.create({ type: 'encrypt', key: k2 }), + DES.create({ type: 'decrypt', key: k1 }) + ]; + } +} + +function EDE(options) { + Cipher.call(this, options); + + var state = new EDEState(this.type, this.options.key); + this._edeState = state; +} +inherits(EDE, Cipher); + +module.exports = EDE; + +EDE.create = function create(options) { + return new EDE(options); +}; + +EDE.prototype._update = function _update(inp, inOff, out, outOff) { + var state = this._edeState; + + state.ciphers[0]._update(inp, inOff, out, outOff); + state.ciphers[1]._update(out, outOff, out, outOff); + state.ciphers[2]._update(out, outOff, out, outOff); +}; + +EDE.prototype._pad = DES.prototype._pad; +EDE.prototype._unpad = DES.prototype._unpad; diff --git a/node_modules/des.js/lib/des/utils.js b/node_modules/des.js/lib/des/utils.js new file mode 100644 index 000000000..08a5ccd9c --- /dev/null +++ b/node_modules/des.js/lib/des/utils.js @@ -0,0 +1,256 @@ +'use strict'; + +exports.readUInt32BE = function readUInt32BE(bytes, off) { + var res = (bytes[0 + off] << 24) | + (bytes[1 + off] << 16) | + (bytes[2 + off] << 8) | + bytes[3 + off]; + return res >>> 0; +}; + +exports.writeUInt32BE = function writeUInt32BE(bytes, value, off) { + bytes[0 + off] = value >>> 24; + bytes[1 + off] = (value >>> 16) & 0xff; + bytes[2 + off] = (value >>> 8) & 0xff; + bytes[3 + off] = value & 0xff; +}; + +exports.ip = function ip(inL, inR, out, off) { + var outL = 0; + var outR = 0; + + for (var i = 6; i >= 0; i -= 2) { + for (var j = 0; j <= 24; j += 8) { + outL <<= 1; + outL |= (inR >>> (j + i)) & 1; + } + for (var j = 0; j <= 24; j += 8) { + outL <<= 1; + outL |= (inL >>> (j + i)) & 1; + } + } + + for (var i = 6; i >= 0; i -= 2) { + for (var j = 1; j <= 25; j += 8) { + outR <<= 1; + outR |= (inR >>> (j + i)) & 1; + } + for (var j = 1; j <= 25; j += 8) { + outR <<= 1; + outR |= (inL >>> (j + i)) & 1; + } + } + + out[off + 0] = outL >>> 0; + out[off + 1] = outR >>> 0; +}; + +exports.rip = function rip(inL, inR, out, off) { + var outL = 0; + var outR = 0; + + for (var i = 0; i < 4; i++) { + for (var j = 24; j >= 0; j -= 8) { + outL <<= 1; + outL |= (inR >>> (j + i)) & 1; + outL <<= 1; + outL |= (inL >>> (j + i)) & 1; + } + } + for (var i = 4; i < 8; i++) { + for (var j = 24; j >= 0; j -= 8) { + outR <<= 1; + outR |= (inR >>> (j + i)) & 1; + outR <<= 1; + outR |= (inL >>> (j + i)) & 1; + } + } + + out[off + 0] = outL >>> 0; + out[off + 1] = outR >>> 0; +}; + +exports.pc1 = function pc1(inL, inR, out, off) { + var outL = 0; + var outR = 0; + + // 7, 15, 23, 31, 39, 47, 55, 63 + // 6, 14, 22, 30, 39, 47, 55, 63 + // 5, 13, 21, 29, 39, 47, 55, 63 + // 4, 12, 20, 28 + for (var i = 7; i >= 5; i--) { + for (var j = 0; j <= 24; j += 8) { + outL <<= 1; + outL |= (inR >> (j + i)) & 1; + } + for (var j = 0; j <= 24; j += 8) { + outL <<= 1; + outL |= (inL >> (j + i)) & 1; + } + } + for (var j = 0; j <= 24; j += 8) { + outL <<= 1; + outL |= (inR >> (j + i)) & 1; + } + + // 1, 9, 17, 25, 33, 41, 49, 57 + // 2, 10, 18, 26, 34, 42, 50, 58 + // 3, 11, 19, 27, 35, 43, 51, 59 + // 36, 44, 52, 60 + for (var i = 1; i <= 3; i++) { + for (var j = 0; j <= 24; j += 8) { + outR <<= 1; + outR |= (inR >> (j + i)) & 1; + } + for (var j = 0; j <= 24; j += 8) { + outR <<= 1; + outR |= (inL >> (j + i)) & 1; + } + } + for (var j = 0; j <= 24; j += 8) { + outR <<= 1; + outR |= (inL >> (j + i)) & 1; + } + + out[off + 0] = outL >>> 0; + out[off + 1] = outR >>> 0; +}; + +exports.r28shl = function r28shl(num, shift) { + return ((num << shift) & 0xfffffff) | (num >>> (28 - shift)); +}; + +var pc2table = [ + // inL => outL + 14, 11, 17, 4, 27, 23, 25, 0, + 13, 22, 7, 18, 5, 9, 16, 24, + 2, 20, 12, 21, 1, 8, 15, 26, + + // inR => outR + 15, 4, 25, 19, 9, 1, 26, 16, + 5, 11, 23, 8, 12, 7, 17, 0, + 22, 3, 10, 14, 6, 20, 27, 24 +]; + +exports.pc2 = function pc2(inL, inR, out, off) { + var outL = 0; + var outR = 0; + + var len = pc2table.length >>> 1; + for (var i = 0; i < len; i++) { + outL <<= 1; + outL |= (inL >>> pc2table[i]) & 0x1; + } + for (var i = len; i < pc2table.length; i++) { + outR <<= 1; + outR |= (inR >>> pc2table[i]) & 0x1; + } + + out[off + 0] = outL >>> 0; + out[off + 1] = outR >>> 0; +}; + +exports.expand = function expand(r, out, off) { + var outL = 0; + var outR = 0; + + outL = ((r & 1) << 5) | (r >>> 27); + for (var i = 23; i >= 15; i -= 4) { + outL <<= 6; + outL |= (r >>> i) & 0x3f; + } + for (var i = 11; i >= 3; i -= 4) { + outR |= (r >>> i) & 0x3f; + outR <<= 6; + } + outR |= ((r & 0x1f) << 1) | (r >>> 31); + + out[off + 0] = outL >>> 0; + out[off + 1] = outR >>> 0; +}; + +var sTable = [ + 14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1, + 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8, + 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7, + 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13, + + 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14, + 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5, + 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2, + 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9, + + 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10, + 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1, + 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7, + 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12, + + 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3, + 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9, + 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8, + 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14, + + 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1, + 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6, + 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13, + 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3, + + 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5, + 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8, + 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10, + 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13, + + 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10, + 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6, + 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7, + 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12, + + 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4, + 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2, + 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13, + 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11 +]; + +exports.substitute = function substitute(inL, inR) { + var out = 0; + for (var i = 0; i < 4; i++) { + var b = (inL >>> (18 - i * 6)) & 0x3f; + var sb = sTable[i * 0x40 + b]; + + out <<= 4; + out |= sb; + } + for (var i = 0; i < 4; i++) { + var b = (inR >>> (18 - i * 6)) & 0x3f; + var sb = sTable[4 * 0x40 + i * 0x40 + b]; + + out <<= 4; + out |= sb; + } + return out >>> 0; +}; + +var permuteTable = [ + 16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22, + 30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7 +]; + +exports.permute = function permute(num) { + var out = 0; + for (var i = 0; i < permuteTable.length; i++) { + out <<= 1; + out |= (num >>> permuteTable[i]) & 0x1; + } + return out >>> 0; +}; + +exports.padSplit = function padSplit(num, size, group) { + var str = num.toString(2); + while (str.length < size) + str = '0' + str; + + var out = []; + for (var i = 0; i < size; i += group) + out.push(str.slice(i, i + group)); + return out.join(' '); +}; diff --git a/node_modules/des.js/package.json b/node_modules/des.js/package.json new file mode 100644 index 000000000..14fca47a9 --- /dev/null +++ b/node_modules/des.js/package.json @@ -0,0 +1,62 @@ +{ + "_from": "des.js@^1.0.0", + "_id": "des.js@1.0.0", + "_inBundle": false, + "_integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "_location": "/des.js", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "des.js@^1.0.0", + "name": "des.js", + "escapedName": "des.js", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/browserify-des" + ], + "_resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "_shasum": "c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc", + "_spec": "des.js@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify-des", + "author": { + "name": "Fedor Indutny", + "email": "fedor@indutny.com" + }, + "bugs": { + "url": "https://github.com/indutny/des.js/issues" + }, + "bundleDependencies": false, + "dependencies": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + }, + "deprecated": false, + "description": "DES implementation", + "devDependencies": { + "jscs": "^2.1.1", + "jshint": "^2.8.0", + "mocha": "^2.3.0" + }, + "homepage": "https://github.com/indutny/des.js#readme", + "keywords": [ + "DES", + "3DES", + "EDE", + "CBC" + ], + "license": "MIT", + "main": "lib/des.js", + "name": "des.js", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/indutny/des.js.git" + }, + "scripts": { + "test": "mocha --reporter=spec test/*-test.js && jscs lib/*.js lib/**/*.js test/*.js && jshint lib/*.js lib/**/*.js" + }, + "version": "1.0.0" +} diff --git a/node_modules/des.js/test/cbc-test.js b/node_modules/des.js/test/cbc-test.js new file mode 100644 index 000000000..d07881c13 --- /dev/null +++ b/node_modules/des.js/test/cbc-test.js @@ -0,0 +1,73 @@ +'use strict'; + +var assert = require('assert'); +var crypto = require('crypto'); +var Buffer = require('buffer').Buffer; + +var des = require('../'); + +var fixtures = require('./fixtures'); +var bin = fixtures.bin; + +describe('DES-CBC', function() { + var CBC = des.CBC.instantiate(des.DES); + + describe('encryption/decryption', function() { + var vectors = [ + { + key: '133457799bbcdff1', + iv: '0102030405060708', + input: '0123456789abcdef' + }, + { + key: '0000000000000000', + iv: 'ffffffffffffffff', + input: '0000000000000000' + }, + { + key: 'a3a3a3a3b3b3b3b3', + iv: 'cdcdcdcdcdcdcdcd', + input: 'cccccccccccccccc' + }, + { + key: 'deadbeefabbadead', + iv: 'a0da0da0da0da0da', + input: '0102030405060708090a' + }, + { + key: 'aabbccddeeff0011', + iv: 'fefefefefefefefe', + input: '0102030405060708090a0102030405060708090a0102030405060708090a' + + '0102030405060708090a0102030405060607080a0102030405060708090a' + } + ]; + + vectors.forEach(function(vec, i) { + it('should encrypt vector ' + i, function() { + var key = new Buffer(vec.key, 'hex'); + var iv = new Buffer(vec.iv, 'hex'); + var input = new Buffer(vec.input, 'hex'); + + var enc = CBC.create({ + type: 'encrypt', + key: key, + iv: iv + }); + var out = new Buffer(enc.update(input).concat(enc.final())); + + var cipher = crypto.createCipheriv('des-cbc', key, iv); + var expected = Buffer.concat([ cipher.update(input), cipher.final() ]); + + assert.deepEqual(out, expected); + + var dec = CBC.create({ + type: 'decrypt', + key: key, + iv: iv + }); + assert.deepEqual(new Buffer(dec.update(out).concat(dec.final())), + input); + }); + }); + }); +}); diff --git a/node_modules/des.js/test/des-test.js b/node_modules/des.js/test/des-test.js new file mode 100644 index 000000000..b6a5ee84f --- /dev/null +++ b/node_modules/des.js/test/des-test.js @@ -0,0 +1,139 @@ +'use strict'; + +var assert = require('assert'); +var crypto = require('crypto'); +var Buffer = require('buffer').Buffer; + +var des = require('../'); + +var fixtures = require('./fixtures'); +var bin = fixtures.bin; + +describe('DES', function() { + describe('Key Derivation', function() { + it('should derive proper keys', function() { + var d = des.DES.create({ + type: 'encrypt', + key: [ 0x13, 0x34, 0x57, 0x79, 0x9B, 0xBC, 0xDF, 0xF1 ] + }); + + var expected = [ + '000110 110000 001011 101111', + '111111 000111 000001 110010', + '011110 011010 111011 011001', + '110110 111100 100111 100101', + '010101 011111 110010 001010', + '010000 101100 111110 011001', + '011100 101010 110111 010110', + '110110 110011 010100 011101', + '011111 001110 110000 000111', + '111010 110101 001110 101000', + '011000 111010 010100 111110', + '010100 000111 101100 101111', + '111011 001000 010010 110111', + '111101 100001 100010 111100', + '111101 111000 101000 111010', + '110000 010011 101111 111011', + '111000 001101 101111 101011', + '111011 011110 011110 000001', + '101100 011111 001101 000111', + '101110 100100 011001 001111', + '001000 010101 111111 010011', + '110111 101101 001110 000110', + '011101 010111 000111 110101', + '100101 000110 011111 101001', + '100101 111100 010111 010001', + '111110 101011 101001 000001', + '010111 110100 001110 110111', + '111100 101110 011100 111010', + '101111 111001 000110 001101', + '001111 010011 111100 001010', + '110010 110011 110110 001011', + '000011 100001 011111 110101' + ]; + + expected = expected.map(fixtures.bin); + assert.deepEqual(d._desState.keys, expected); + }); + }); + + describe('encryption/decryption', function() { + var vectors = [ + { + key: '133457799bbcdff1', + input: '0123456789abcdef' + }, + { + key: '0000000000000000', + input: '0000000000000000' + }, + { + key: 'a3a3a3a3b3b3b3b3', + input: 'cccccccccccccccc' + }, + { + key: 'deadbeefabbadead', + input: '0102030405060708090a' + }, + { + key: 'aabbccddeeff0011', + input: '0102030405060708090a0102030405060708090a0102030405060708090a' + + '0102030405060708090a0102030405060607080a0102030405060708090a' + } + ]; + + vectors.forEach(function(vec, i) { + it('should encrypt vector ' + i, function() { + var key = new Buffer(vec.key, 'hex'); + var input = new Buffer(vec.input, 'hex'); + + var enc = des.DES.create({ + type: 'encrypt', + key: key + }); + var dec = des.DES.create({ + type: 'decrypt', + key: key + }); + var out = new Buffer(enc.update(input).concat(enc.final())); + + var cipher = crypto.createCipheriv('des-ecb', key, new Buffer(0)); + var expected = Buffer.concat([ cipher.update(input), cipher.final() ]); + + assert.deepEqual(out, expected); + + assert.deepEqual(new Buffer(dec.update(out).concat(dec.final())), + input); + }); + }); + + it('should buffer during encryption/decryption', function() { + var key = new Buffer('0102030405060708', 'hex'); + var chunk = new Buffer('01020304050607', 'hex'); + var count = 257; + var expected = new Buffer( + new Array(count + 1).join('01020304050607'), 'hex'); + + var enc = des.DES.create({ + type: 'encrypt', + key: key + }); + var cipher = []; + for (var i = 0; i < count; i++) + cipher = cipher.concat(enc.update(chunk)); + cipher = cipher.concat(enc.final()); + + var dec = des.DES.create({ + type: 'decrypt', + key: key + }); + var out = []; + for (var i = 0; i < count; i++) + out = out.concat(dec.update(cipher.slice(i * 7, (i + 1) * 7))); + out = out.concat(dec.final(cipher.slice(i * 7))); + + out = new Buffer(out); + assert.deepEqual(out, expected); + }); + }); +}); diff --git a/node_modules/des.js/test/ede-test.js b/node_modules/des.js/test/ede-test.js new file mode 100644 index 000000000..116a76a82 --- /dev/null +++ b/node_modules/des.js/test/ede-test.js @@ -0,0 +1,73 @@ +'use strict'; + +var assert = require('assert'); +var crypto = require('crypto'); +var Buffer = require('buffer').Buffer; + +var des = require('../'); + +var fixtures = require('./fixtures'); +var bin = fixtures.bin; + +describe('DES-EDE-CBC', function() { + var CBC = des.CBC.instantiate(des.EDE); + + describe('encryption/decryption', function() { + var vectors = [ + { + key: new Array(4).join('133457799bbcdff1'), + iv: '0102030405060708', + input: '0123456789abcdef' + }, + { + key: new Array(4).join('0000000000000000'), + iv: 'ffffffffffffffff', + input: '0000000000000000' + }, + { + key: new Array(4).join('a3a3a3a3b3b3b3b3'), + iv: 'cdcdcdcdcdcdcdcd', + input: 'cccccccccccccccc' + }, + { + key: new Array(4).join('deadbeefabbadead'), + iv: 'a0da0da0da0da0da', + input: '0102030405060708090a' + }, + { + key: 'aabbccddeeff0011' + '1111222233334444' + 'ffffeeeeddddcccc', + iv: 'fefefefefefefefe', + input: '0102030405060708090a0102030405060708090a0102030405060708090a' + + '0102030405060708090a0102030405060607080a0102030405060708090a' + } + ]; + + vectors.forEach(function(vec, i) { + it('should encrypt vector ' + i, function() { + var key = new Buffer(vec.key, 'hex'); + var iv = new Buffer(vec.iv, 'hex'); + var input = new Buffer(vec.input, 'hex'); + + var enc = CBC.create({ + type: 'encrypt', + key: key, + iv: iv + }); + var out = new Buffer(enc.update(input).concat(enc.final())); + + var cipher = crypto.createCipheriv('des-ede3-cbc', key, iv); + var expected = Buffer.concat([ cipher.update(input), cipher.final() ]); + + assert.deepEqual(out, expected); + + var dec = CBC.create({ + type: 'decrypt', + key: key, + iv: iv + }); + assert.deepEqual(new Buffer(dec.update(out).concat(dec.final())), + input); + }); + }); + }); +}); diff --git a/node_modules/des.js/test/fixtures.js b/node_modules/des.js/test/fixtures.js new file mode 100644 index 000000000..fe8ccd8b6 --- /dev/null +++ b/node_modules/des.js/test/fixtures.js @@ -0,0 +1,5 @@ +'use strict'; + +exports.bin = function bin(str) { + return parseInt(str.replace(/[^01]/g, ''), 2); +} diff --git a/node_modules/des.js/test/utils-test.js b/node_modules/des.js/test/utils-test.js new file mode 100644 index 000000000..4c576de08 --- /dev/null +++ b/node_modules/des.js/test/utils-test.js @@ -0,0 +1,169 @@ +'use strict'; + +var assert = require('assert'); + +var des = require('../'); +var utils = des.utils; + +var fixtures = require('./fixtures'); +var bin = fixtures.bin; + +describe('utils', function() { + describe('IP', function() { + it('should permute properly', function() { + var out = new Array(2); + var inp = [ + bin('00000001 00100011 01000101 01100111'), + bin('10001001 10101011 11001101 11101111') + ]; + + utils.ip(inp[0], inp[1], out, 0); + + var expected = [ + bin('11001100 00000000 11001100 11111111'), + bin('11110000 10101010 11110000 10101010') + ]; + + assert.deepEqual(out, expected); + }); + + it('should rev-permute properly', function() { + var out = new Array(2); + var inp = [ + bin('11001100 00000000 11001100 11111111'), + bin('11110000 10101010 11110000 10101010') + ]; + + utils.rip(inp[0], inp[1], out, 0); + + var expected = [ + bin('00000001 00100011 01000101 01100111'), + bin('10001001 10101011 11001101 11101111') + ]; + + assert.deepEqual(out, expected); + }); + }); + + describe('PC1', function() { + it('should permute properly', function() { + var out = new Array(2); + var inp = [ + bin('00010011 00110100 01010111 01111001'), + bin('10011011 10111100 11011111 11110001') + ]; + + utils.pc1(inp[0], inp[1], out, 0); + + var expected = [ + bin('1111000 0110011 0010101 0101111'), + bin('0101010 1011001 1001111 0001111') + ]; + + assert.deepEqual(out, expected); + }); + }); + + describe('r28shl', function() { + it('should shl properly', function() { + assert.equal(utils.r28shl(bin('1111000011001100101010101111'), 1), + bin('1110000110011001010101011111')); + + assert.equal(utils.r28shl(bin('0101010101100110011110001111'), 1), + bin('1010101011001100111100011110')); + + assert.equal(utils.r28shl(bin('1111000011001100101010101111'), 4), + bin('0000110011001010101011111111')); + + assert.equal(utils.r28shl(bin('0101010101100110011110001111'), 4), + bin('0101011001100111100011110101')); + }); + }); + + describe('PC2', function() { + it('should permute properly', function() { + var out = new Array(2); + var inp = [ + bin('1110000 1100110 0101010 1011111'), + bin('1010101 0110011 0011110 0011110') + ]; + + utils.pc2(inp[0], inp[1], out, 0); + + var expected = [ + bin('000110 110000 001011 101111'), + bin('111111 000111 000001 110010') + ]; + + assert.deepEqual(out, expected); + }); + }); + + describe('readUInt32BE', function() { + it('should read number properly', function() { + var a = [ 0xde, 0xad, 0xbe, 0xef ]; + var o = utils.readUInt32BE(a, 0); + assert.equal(o, 0xdeadbeef); + }); + }); + + describe('writeUInt32BE', function() { + it('should read number properly', function() { + var a = [ 0, 0, 0, 0 ]; + utils.writeUInt32BE(a, 0xdeadbeef, 0); + var expected = [ 0xde, 0xad, 0xbe, 0xef ]; + assert.deepEqual(a, expected); + }); + }); + + describe('expand', function() { + it('should expand', function() { + var out = [ 0, 0 ]; + utils.expand(bin('1111 0000 1010 1010 1111 0000 1010 1010'), out, 0); + var expected = [ + bin('011110 100001 010101 010101'), + bin('011110 100001 010101 010101') + ]; + assert.deepEqual(out, expected); + }); + + it('should expand with low 1', function() { + var out = [ 0, 0 ]; + utils.expand(bin('1111 0000 1010 1010 1111 0000 1010 1011'), out, 0); + var expected = [ + bin('111110 100001 010101 010101'), + bin('011110 100001 010101 010111') + ]; + assert.deepEqual(out, expected); + }); + + it('should expand with low 1', function() { + var out = [ 0, 0 ]; + utils.expand(bin('10100010 01011100 00001011 11110100'), out, 0); + var expected = [ + bin('010100 000100 001011 111000'), + bin('000001 010111 111110 101001') + ]; + assert.deepEqual(out, expected); + }); + }); + + describe('substitute', function() { + it('should substitute', function() { + var input = [ + bin('011000 010001 011110 111010'), + bin('100001 100110 010100 100111') + ]; + var output = utils.substitute(input[0], input[1]); + assert.equal(output, bin('0101 1100 1000 0010 1011 0101 1001 0111')); + }); + }); + + describe('permute', function() { + it('should permute', function() { + var output = utils.permute( + bin('0101 1100 1000 0010 1011 0101 1001 0111')); + assert.equal(output, bin('0010 0011 0100 1010 1010 1001 1011 1011')); + }); + }); +}); diff --git a/node_modules/destroy/LICENSE b/node_modules/destroy/LICENSE new file mode 100644 index 000000000..a7ae8ee9b --- /dev/null +++ b/node_modules/destroy/LICENSE @@ -0,0 +1,22 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/destroy/README.md b/node_modules/destroy/README.md new file mode 100644 index 000000000..6474bc3ce --- /dev/null +++ b/node_modules/destroy/README.md @@ -0,0 +1,60 @@ +# Destroy + +[![NPM version][npm-image]][npm-url] +[![Build status][travis-image]][travis-url] +[![Test coverage][coveralls-image]][coveralls-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] +[![Gittip][gittip-image]][gittip-url] + +Destroy a stream. + +This module is meant to ensure a stream gets destroyed, handling different APIs +and Node.js bugs. + +## API + +```js +var destroy = require('destroy') +``` + +### destroy(stream) + +Destroy the given stream. In most cases, this is identical to a simple +`stream.destroy()` call. The rules are as follows for a given stream: + + 1. If the `stream` is an instance of `ReadStream`, then call `stream.destroy()` + and add a listener to the `open` event to call `stream.close()` if it is + fired. This is for a Node.js bug that will leak a file descriptor if + `.destroy()` is called before `open`. + 2. If the `stream` is not an instance of `Stream`, then nothing happens. + 3. If the `stream` has a `.destroy()` method, then call it. + +The function returns the `stream` passed in as the argument. + +## Example + +```js +var destroy = require('destroy') + +var fs = require('fs') +var stream = fs.createReadStream('package.json') + +// ... and later +destroy(stream) +``` + +[npm-image]: https://img.shields.io/npm/v/destroy.svg?style=flat-square +[npm-url]: https://npmjs.org/package/destroy +[github-tag]: http://img.shields.io/github/tag/stream-utils/destroy.svg?style=flat-square +[github-url]: https://github.com/stream-utils/destroy/tags +[travis-image]: https://img.shields.io/travis/stream-utils/destroy.svg?style=flat-square +[travis-url]: https://travis-ci.org/stream-utils/destroy +[coveralls-image]: https://img.shields.io/coveralls/stream-utils/destroy.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/stream-utils/destroy?branch=master +[license-image]: http://img.shields.io/npm/l/destroy.svg?style=flat-square +[license-url]: LICENSE.md +[downloads-image]: http://img.shields.io/npm/dm/destroy.svg?style=flat-square +[downloads-url]: https://npmjs.org/package/destroy +[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square +[gittip-url]: https://www.gittip.com/jonathanong/ diff --git a/node_modules/destroy/index.js b/node_modules/destroy/index.js new file mode 100644 index 000000000..6da2d26ee --- /dev/null +++ b/node_modules/destroy/index.js @@ -0,0 +1,75 @@ +/*! + * destroy + * Copyright(c) 2014 Jonathan Ong + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var ReadStream = require('fs').ReadStream +var Stream = require('stream') + +/** + * Module exports. + * @public + */ + +module.exports = destroy + +/** + * Destroy a stream. + * + * @param {object} stream + * @public + */ + +function destroy(stream) { + if (stream instanceof ReadStream) { + return destroyReadStream(stream) + } + + if (!(stream instanceof Stream)) { + return stream + } + + if (typeof stream.destroy === 'function') { + stream.destroy() + } + + return stream +} + +/** + * Destroy a ReadStream. + * + * @param {object} stream + * @private + */ + +function destroyReadStream(stream) { + stream.destroy() + + if (typeof stream.close === 'function') { + // node.js core bug work-around + stream.on('open', onOpenClose) + } + + return stream +} + +/** + * On open handler to close stream. + * @private + */ + +function onOpenClose() { + if (typeof this.fd === 'number') { + // actually close down the fd + this.close() + } +} diff --git a/node_modules/destroy/package.json b/node_modules/destroy/package.json new file mode 100644 index 000000000..9729d8038 --- /dev/null +++ b/node_modules/destroy/package.json @@ -0,0 +1,71 @@ +{ + "_from": "destroy@~1.0.4", + "_id": "destroy@1.0.4", + "_inBundle": false, + "_integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "_location": "/destroy", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "destroy@~1.0.4", + "name": "destroy", + "escapedName": "destroy", + "rawSpec": "~1.0.4", + "saveSpec": null, + "fetchSpec": "~1.0.4" + }, + "_requiredBy": [ + "/send" + ], + "_resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "_shasum": "978857442c44749e4206613e37946205826abd80", + "_spec": "destroy@~1.0.4", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/send", + "author": { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + }, + "bugs": { + "url": "https://github.com/stream-utils/destroy/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + } + ], + "deprecated": false, + "description": "destroy a stream if possible", + "devDependencies": { + "istanbul": "0.4.2", + "mocha": "2.3.4" + }, + "files": [ + "index.js", + "LICENSE" + ], + "homepage": "https://github.com/stream-utils/destroy#readme", + "keywords": [ + "stream", + "streams", + "destroy", + "cleanup", + "leak", + "fd" + ], + "license": "MIT", + "name": "destroy", + "repository": { + "type": "git", + "url": "git+https://github.com/stream-utils/destroy.git" + }, + "scripts": { + "test": "mocha --reporter spec", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" + }, + "version": "1.0.4" +} diff --git a/node_modules/detective/.travis.yml b/node_modules/detective/.travis.yml new file mode 100644 index 000000000..a2814bc4d --- /dev/null +++ b/node_modules/detective/.travis.yml @@ -0,0 +1,15 @@ +language: node_js +node_js: + - "9" + - "8" + - "6" + - "4" + - "iojs" + - "0.12" + - "0.10" + - "0.8" +sudo: false +before_install: + - 'nvm install-latest-npm' +matrix: + fast_finish: true \ No newline at end of file diff --git a/node_modules/detective/CHANGELOG.md b/node_modules/detective/CHANGELOG.md new file mode 100644 index 000000000..c9f4550d1 --- /dev/null +++ b/node_modules/detective/CHANGELOG.md @@ -0,0 +1,17 @@ +# detective Change Log +All notable changes to this project will be documented in this file. +This project adheres to [Semantic Versioning](http://semver.org/). + +## 5.1.0 - 2018-02-28 +* Use acorn-node parser, which matches latest Node syntax support (https://github.com/browserify/detective/pull/78) +* Add basic cli: `detective index.js` outputs dependency names (https://github.com/browserify/detective/pull/51) + +## 5.0.2 - 2018-01-06 +* Extend support back to 0.8 until we can determine a LTS plan. + +## 5.0.1 - 2018-01-02 +* Add engines field set to `>=4.0.0`. + +## 5.0.0 - 2018-01-02 +* Fix: Don't crash on files with the spread operator (https://github.com/browserify/detective/pull/75) +* Breaking: Drop support for node 0.12 (https://github.com/browserify/detective/pull/75) diff --git a/node_modules/detective/LICENSE b/node_modules/detective/LICENSE new file mode 100644 index 000000000..ee27ba4b4 --- /dev/null +++ b/node_modules/detective/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/detective/bench/detect.js b/node_modules/detective/bench/detect.js new file mode 100644 index 000000000..b7d0dd980 --- /dev/null +++ b/node_modules/detective/bench/detect.js @@ -0,0 +1,7 @@ +var detective = require('../'); +var fs = require('fs'); + +var src = fs.readFileSync(__dirname + '/src/jquery.js', 'utf8'); +var t0 = Date.now(); +var requires = detective(src); +console.log(Date.now() - t0); diff --git a/node_modules/detective/bench/esprima_v_acorn.txt b/node_modules/detective/bench/esprima_v_acorn.txt new file mode 100644 index 000000000..a2340fe73 --- /dev/null +++ b/node_modules/detective/bench/esprima_v_acorn.txt @@ -0,0 +1,18 @@ +esprima: + + $ for i in {1..5}; do node detect.js; done + 704 + 702 + 704 + 704 + 697 + +acorn: + + $ for i in {1..5}; do node detect.js; done + 555 + 552 + 585 + 549 + 583 + diff --git a/node_modules/detective/bin/detective.js b/node_modules/detective/bin/detective.js new file mode 100755 index 000000000..f3ff863e8 --- /dev/null +++ b/node_modules/detective/bin/detective.js @@ -0,0 +1,11 @@ +#!/usr/bin/env node + +var detective = require('../'); +var argv = require('minimist')(process.argv.slice(2)); +var fs = require('fs'); + +argv._.forEach(function(file) { + var src = fs.readFileSync(file, 'utf8'); + var requires = detective(src, argv); + console.log(requires.join('\n')); +}); diff --git a/node_modules/detective/example/strings.js b/node_modules/detective/example/strings.js new file mode 100644 index 000000000..b9cc58fb6 --- /dev/null +++ b/node_modules/detective/example/strings.js @@ -0,0 +1,6 @@ +var detective = require('../'); +var fs = require('fs'); + +var src = fs.readFileSync(__dirname + '/strings_src.js'); +var requires = detective(src); +console.dir(requires); diff --git a/node_modules/detective/example/strings_src.js b/node_modules/detective/example/strings_src.js new file mode 100644 index 000000000..88d083276 --- /dev/null +++ b/node_modules/detective/example/strings_src.js @@ -0,0 +1,3 @@ +var a = require('a'); +var b = require('b'); +var c = require('c'); diff --git a/node_modules/detective/index.js b/node_modules/detective/index.js new file mode 100644 index 000000000..382d701a9 --- /dev/null +++ b/node_modules/detective/index.js @@ -0,0 +1,80 @@ +var acorn = require('acorn-node'); +var walk = require('acorn-node/walk'); +var defined = require('defined'); + +var requireRe = /\brequire\b/; + +function parse (src, opts) { + if (!opts) opts = {}; + return acorn.parse(src, { + ecmaVersion: defined(opts.ecmaVersion, 9), + sourceType: defined(opts.sourceType, 'script'), + ranges: defined(opts.ranges, opts.range), + locations: defined(opts.locations, opts.loc), + allowReserved: defined(opts.allowReserved, true), + allowReturnOutsideFunction: defined( + opts.allowReturnOutsideFunction, true + ), + allowImportExportEverywhere: defined( + opts.allowImportExportEverywhere, true + ), + allowHashBang: defined(opts.allowHashBang, true) + }); +} + +var exports = module.exports = function (src, opts) { + return exports.find(src, opts).strings; +}; + +exports.find = function (src, opts) { + if (!opts) opts = {}; + + var word = opts.word === undefined ? 'require' : opts.word; + if (typeof src !== 'string') src = String(src); + + var isRequire = opts.isRequire || function (node) { + return node.callee.type === 'Identifier' + && node.callee.name === word + ; + }; + + var modules = { strings : [], expressions : [] }; + if (opts.nodes) modules.nodes = []; + + var wordRe = word === 'require' ? requireRe : RegExp('\\b' + word + '\\b'); + if (!wordRe.test(src)) return modules; + + var ast = parse(src, opts.parse); + + function visit(node, st, c) { + var hasRequire = wordRe.test(src.slice(node.start, node.end)); + if (!hasRequire) return; + walk.base[node.type](node, st, c); + if (node.type !== 'CallExpression') return; + if (isRequire(node)) { + if (node.arguments.length) { + var arg = node.arguments[0]; + if (arg.type === 'Literal') { + modules.strings.push(arg.value); + } + else if (arg.type === 'TemplateLiteral' + && arg.quasis.length === 1 + && arg.expressions.length === 0) { + + modules.strings.push(arg.quasis[0].value.raw); + } + else { + modules.expressions.push(src.slice(arg.start, arg.end)); + } + } + if (opts.nodes) modules.nodes.push(node); + } + } + + walk.recursive(ast, null, { + Statement: visit, + Expression: visit + }); + + return modules; +}; diff --git a/node_modules/detective/package.json b/node_modules/detective/package.json new file mode 100644 index 000000000..3da3ac960 --- /dev/null +++ b/node_modules/detective/package.json @@ -0,0 +1,68 @@ +{ + "_from": "detective@^5.0.2", + "_id": "detective@5.1.0", + "_inBundle": false, + "_integrity": "sha512-TFHMqfOvxlgrfVzTEkNBSh9SvSNX/HfF4OFI2QFGCyPm02EsyILqnUeb5P6q7JZ3SFNTBL5t2sePRgrN4epUWQ==", + "_location": "/detective", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "detective@^5.0.2", + "name": "detective", + "escapedName": "detective", + "rawSpec": "^5.0.2", + "saveSpec": null, + "fetchSpec": "^5.0.2" + }, + "_requiredBy": [ + "/module-deps" + ], + "_resolved": "https://registry.npmjs.org/detective/-/detective-5.1.0.tgz", + "_shasum": "7a20d89236d7b331ccea65832e7123b5551bb7cb", + "_spec": "detective@^5.0.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/module-deps", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bin": { + "detective": "bin/detective.js" + }, + "bugs": { + "url": "https://github.com/browserify/detective/issues" + }, + "bundleDependencies": false, + "dependencies": { + "acorn-node": "^1.3.0", + "defined": "^1.0.0", + "minimist": "^1.1.1" + }, + "deprecated": false, + "description": "find all require() calls by walking the AST", + "devDependencies": { + "tap": "^10.7.3" + }, + "engines": { + "node": ">=0.8.0" + }, + "homepage": "https://github.com/browserify/detective#readme", + "keywords": [ + "analyze", + "ast", + "require", + "source" + ], + "license": "MIT", + "main": "index.js", + "name": "detective", + "repository": { + "type": "git", + "url": "git://github.com/browserify/detective.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "5.1.0" +} diff --git a/node_modules/detective/readme.markdown b/node_modules/detective/readme.markdown new file mode 100644 index 000000000..34b0524fb --- /dev/null +++ b/node_modules/detective/readme.markdown @@ -0,0 +1,81 @@ +# detective + +find all calls to `require()` by walking the AST + +[![build status](https://secure.travis-ci.org/browserify/detective.png)](http://travis-ci.org/browserify/detective) + +# example + +## strings + +strings_src.js: + +``` js +var a = require('a'); +var b = require('b'); +var c = require('c'); +``` + +strings.js: + +``` js +var detective = require('detective'); +var fs = require('fs'); + +var src = fs.readFileSync(__dirname + '/strings_src.js'); +var requires = detective(src); +console.dir(requires); +``` + +output: + +``` +$ node examples/strings.js +[ 'a', 'b', 'c' ] +``` + +# methods + +``` js +var detective = require('detective'); +``` + +## detective(src, opts) + +Give some source body `src`, return an array of all the `require()` calls with +string arguments. + +The options parameter `opts` is passed along to `detective.find()`. + +## var found = detective.find(src, opts) + +Give some source body `src`, return `found` with: + +* `found.strings` - an array of each string found in a `require()` +* `found.expressions` - an array of each stringified expression found in a +`require()` call +* `found.nodes` (when `opts.nodes === true`) - an array of AST nodes for each +argument found in a `require()` call + +Optionally: + +* `opts.word` - specify a different function name instead of `"require"` +* `opts.nodes` - when `true`, populate `found.nodes` +* `opts.isRequire(node)` - a function returning whether an AST `CallExpression` +node is a require call +* `opts.parse` - supply options directly to +[acorn](https://npmjs.org/package/acorn) with some support for esprima-style +options `range` and `loc` +* `opts.ecmaVersion` - default: 9 + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install detective +``` + +# license + +MIT diff --git a/node_modules/detective/test/both.js b/node_modules/detective/test/both.js new file mode 100644 index 000000000..f09f1f854 --- /dev/null +++ b/node_modules/detective/test/both.js @@ -0,0 +1,26 @@ +var test = require('tap').test; +var detective = require('../'); +var fs = require('fs'); +var src = fs.readFileSync(__dirname + '/files/both.js'); + +test('both', function (t) { + var modules = detective.find(src); + t.deepEqual(modules.strings, [ 'a', 'b' ]); + t.deepEqual(modules.expressions, [ "'c' + x", "'d' + y" ]); + t.notOk(modules.nodes, 'has no nodes'); + t.end(); +}); + +test('both with nodes specified in opts', function (t) { + var modules = detective.find(src, { nodes: true }); + t.deepEqual(modules.strings, [ 'a', 'b' ]); + t.deepEqual(modules.expressions, [ "'c' + x", "'d' + y" ]); + t.deepEqual( + modules.nodes.map(function (n) { + var arg = n.arguments[0]; + return arg.value || arg.left.value; + }), + [ 'a', 'b', 'c', 'd' ], + 'has a node for each require'); + t.end(); +}); diff --git a/node_modules/detective/test/chained.js b/node_modules/detective/test/chained.js new file mode 100644 index 000000000..307c20150 --- /dev/null +++ b/node_modules/detective/test/chained.js @@ -0,0 +1,9 @@ +var test = require('tap').test; +var detective = require('../'); +var fs = require('fs'); +var src = fs.readFileSync(__dirname + '/files/chained.js'); + +test('chained', function (t) { + t.deepEqual(detective(src), [ 'c', 'b', 'a' ]); + t.end(); +}); diff --git a/node_modules/detective/test/complicated.js b/node_modules/detective/test/complicated.js new file mode 100644 index 000000000..af402e18c --- /dev/null +++ b/node_modules/detective/test/complicated.js @@ -0,0 +1,58 @@ +var test = require('tap').test; +var detective = require('../'); + +var sources = [ + 'require("a")', + "require('a')", + 'require(`a`)', + ';require("a")', + ' require("a")', + 'void require("a")', + '+require("a")', + '!require("a")', + '/*comments*/require("a")', + '(require("a"))', + + 'require/*comments*/("a")', + ';require/*comments*/("a")', + ' require/*comments*/("a")', + 'void require/*comments*/("a")', + '+require/*comments*/("a")', + '!require/*comments*/("a")', + '/*comments*/require/*comments*/("a")', + '(require/*comments*/("a"))', + + 'require /*comments*/ ("a")', + ';require /*comments*/ ("a")', + ' require /*comments*/ ("a")', + 'void require /*comments*/ ("a")', + '+require /*comments*/ ("a")', + '!require /*comments*/ ("a")', + ' /*comments*/ require /*comments*/ ("a")', + '(require /*comments*/ ("a"))', + + 'require /*comments*/ /*more comments*/ ("a")', + ';require /*comments*/ /*more comments*/ ("a")', + ' require /*comments*/ /*more comments*/ ("a")', + 'void require /*comments*/ /*more comments*/ ("a")', + '+require /*comments*/ /*more comments*/ ("a")', + '!require /*comments*/ /*more comments*/ ("a")', + ' /*comments*/ /*more comments*/ require /*comments*/ /*more comments*/ ("a")', + '(require /*comments*/ /*more comments*/ ("a"))', + + 'require//comments\n("a")', + ';require//comments\n("a")', + ' require//comments\n("a")', + 'void require//comments\n("a")', + '+require//comments\n("a")', + '!require//comments\n("a")', + ' require//comments\n("a")', + '(require//comments\n("a"))' +]; + +test('complicated', function (t) { + t.plan(sources.length); + sources.forEach(function(src) { + t.deepEqual(detective(src), [ 'a' ]); + }); +}); diff --git a/node_modules/detective/test/es6-module.js b/node_modules/detective/test/es6-module.js new file mode 100644 index 000000000..379c89cc3 --- /dev/null +++ b/node_modules/detective/test/es6-module.js @@ -0,0 +1,9 @@ +var test = require('tap').test; +var detective = require('../'); +var fs = require('fs'); +var src = fs.readFileSync(__dirname + '/files/es6-module.js'); + +test('es6-module', function (t) { + t.plan(1); + t.deepEqual(detective(src, {parse: {sourceType: 'module'}}), [ 'a', 'b' ]); +}); diff --git a/node_modules/detective/test/files/both.js b/node_modules/detective/test/files/both.js new file mode 100644 index 000000000..74bc521f5 --- /dev/null +++ b/node_modules/detective/test/files/both.js @@ -0,0 +1,4 @@ +require('a'); +require('b'); +require('c' + x); +var moo = require('d' + y).moo; diff --git a/node_modules/detective/test/files/chained.js b/node_modules/detective/test/files/chained.js new file mode 100644 index 000000000..63437cc1c --- /dev/null +++ b/node_modules/detective/test/files/chained.js @@ -0,0 +1,5 @@ + + +require('c').hello().goodbye() +require('b').hello() +require('a') diff --git a/node_modules/detective/test/files/es6-module.js b/node_modules/detective/test/files/es6-module.js new file mode 100644 index 000000000..e05c1a0be --- /dev/null +++ b/node_modules/detective/test/files/es6-module.js @@ -0,0 +1,5 @@ +var a = require('a'); + +export default function () { + var b = require('b'); +} diff --git a/node_modules/detective/test/files/generators.js b/node_modules/detective/test/files/generators.js new file mode 100644 index 000000000..1c1c2c9aa --- /dev/null +++ b/node_modules/detective/test/files/generators.js @@ -0,0 +1,5 @@ +var a = require('a'); + +function *gen() { + yield require('b'); +} \ No newline at end of file diff --git a/node_modules/detective/test/files/isrequire.js b/node_modules/detective/test/files/isrequire.js new file mode 100644 index 000000000..442100289 --- /dev/null +++ b/node_modules/detective/test/files/isrequire.js @@ -0,0 +1,14 @@ +var a = require.async('a'); +var b = require.async('b'); +var c = require.async('c'); +var abc = a.b(c); + +var EventEmitter = require.async('events').EventEmitter; + +var x = require.async('doom')(5,6,7); +x(8,9); +c.load('notthis'); +var y = require.async('y') * 100; + +var EventEmitter2 = require.async('events2').EventEmitter(); + diff --git a/node_modules/detective/test/files/nested.js b/node_modules/detective/test/files/nested.js new file mode 100644 index 000000000..646cf1335 --- /dev/null +++ b/node_modules/detective/test/files/nested.js @@ -0,0 +1,22 @@ + +if (true) { + (function () { + require('a'); + })(); +} +if (false) { + (function () { + var x = 10; + switch (x) { + case 1 : require('b'); break; + default : break; + } + })() +} + +function qqq () { + require + ( + "c" + ); +} diff --git a/node_modules/detective/test/files/rest-spread.js b/node_modules/detective/test/files/rest-spread.js new file mode 100644 index 000000000..de764cee1 --- /dev/null +++ b/node_modules/detective/test/files/rest-spread.js @@ -0,0 +1,9 @@ +var a = require('a'); +var b = require('b'); +var c = require('c'); + + +var obj = { foo: 'bar', bee: 'bop' } +var spread = { ...obj } +var { foo, ...rest } = obj + diff --git a/node_modules/detective/test/files/set-in-object-pattern.js b/node_modules/detective/test/files/set-in-object-pattern.js new file mode 100644 index 000000000..fa507b05a --- /dev/null +++ b/node_modules/detective/test/files/set-in-object-pattern.js @@ -0,0 +1,10 @@ +var a = load('a'); +var b = load('b'); +var c = load('c'); +var abc = a.b(c); + +function load2({set = 'hello'}) { + return load('tt'); +} + +var loadUse = load2(); diff --git a/node_modules/detective/test/files/shebang.js b/node_modules/detective/test/files/shebang.js new file mode 100644 index 000000000..96d2cfcee --- /dev/null +++ b/node_modules/detective/test/files/shebang.js @@ -0,0 +1,5 @@ +#!/usr/bin/env node + +var a = require('a'); +var b = require('b'); +var c = require('c'); diff --git a/node_modules/detective/test/files/sparse-array.js b/node_modules/detective/test/files/sparse-array.js new file mode 100644 index 000000000..fa0d23cf1 --- /dev/null +++ b/node_modules/detective/test/files/sparse-array.js @@ -0,0 +1,3 @@ +var o = [,,,,] + +require('./foo') diff --git a/node_modules/detective/test/files/strings.js b/node_modules/detective/test/files/strings.js new file mode 100644 index 000000000..1ed9381cf --- /dev/null +++ b/node_modules/detective/test/files/strings.js @@ -0,0 +1,13 @@ +var a = require('a'); +var b = require('b'); +var c = require('c'); +var abc = a.b(c); + +var EventEmitter = require('events').EventEmitter; + +var x = require('doom')(5,6,7); +x(8,9); +c.require('notthis'); +var y = require('y') * 100; + +var EventEmitter2 = require('events2').EventEmitter(); \ No newline at end of file diff --git a/node_modules/detective/test/files/word.js b/node_modules/detective/test/files/word.js new file mode 100644 index 000000000..fd074fe75 --- /dev/null +++ b/node_modules/detective/test/files/word.js @@ -0,0 +1,13 @@ +var a = load('a'); +var b = load('b'); +var c = load('c'); +var abc = a.b(c); + +var EventEmitter = load('events').EventEmitter; + +var x = load('doom')(5,6,7); +x(8,9); +c.load('notthis'); +var y = load('y') * 100; + +var EventEmitter2 = load('events2').EventEmitter(); diff --git a/node_modules/detective/test/files/yield.js b/node_modules/detective/test/files/yield.js new file mode 100644 index 000000000..36bd2b93b --- /dev/null +++ b/node_modules/detective/test/files/yield.js @@ -0,0 +1,4 @@ +(function * () { + var a = require('a'); + var b = yield require('c')(a); +})(); diff --git a/node_modules/detective/test/generators.js b/node_modules/detective/test/generators.js new file mode 100644 index 000000000..c16d53466 --- /dev/null +++ b/node_modules/detective/test/generators.js @@ -0,0 +1,9 @@ +var test = require('tap').test; +var detective = require('../'); +var fs = require('fs'); +var src = fs.readFileSync(__dirname + '/files/generators.js'); + +test('generators', function (t) { + t.plan(1); + t.deepEqual(detective(src), [ 'a', 'b' ]); +}); diff --git a/node_modules/detective/test/isrequire.js b/node_modules/detective/test/isrequire.js new file mode 100644 index 000000000..aa2ce361c --- /dev/null +++ b/node_modules/detective/test/isrequire.js @@ -0,0 +1,20 @@ +var test = require('tap').test; +var detective = require('../'); +var fs = require('fs'); +var src = fs.readFileSync(__dirname + '/files/isrequire.js'); + +test('word', function (t) { + t.deepEqual( + detective(src, { isRequire: function(node) { + return (node.type === 'CallExpression' && + node.callee.type === 'MemberExpression' && + node.callee.object.type == 'Identifier' && + node.callee.object.name == 'require' && + node.callee.property.type == 'Identifier' && + node.callee.property.name == 'async') + } }), + [ 'a', 'b', 'c', 'events', 'doom', 'y', 'events2' ] + ); + t.end(); +}); + diff --git a/node_modules/detective/test/nested.js b/node_modules/detective/test/nested.js new file mode 100644 index 000000000..d688c0f80 --- /dev/null +++ b/node_modules/detective/test/nested.js @@ -0,0 +1,9 @@ +var test = require('tap').test; +var detective = require('../'); +var fs = require('fs'); +var src = fs.readFileSync(__dirname + '/files/nested.js'); + +test('nested', function (t) { + t.deepEqual(detective(src), [ 'a', 'b', 'c' ]); + t.end(); +}); diff --git a/node_modules/detective/test/noargs.js b/node_modules/detective/test/noargs.js new file mode 100644 index 000000000..4871b60be --- /dev/null +++ b/node_modules/detective/test/noargs.js @@ -0,0 +1,26 @@ +var test = require('tap').test; +var detective = require('../'); +var fs = require('fs'); + +// in order to use detective to find any function +// it needs to properly handle functions called without args +var src = [ 'fn();', 'otherfn();', 'fn();' ].join('\n') + +test('noargs', function (t) { + t.plan(1); + t.deepEqual(detective(src, { word: 'fn' }).length, 0, 'finds no arg id'); +}); + +test('find noargs with nodes', function (t) { + t.plan(4); + var modules = detective.find(src, { word: 'fn', nodes: true }); + t.equal(modules.strings.length, 0, 'finds no arg id'); + t.equal(modules.expressions.length, 0, 'finds no expressions'); + t.equal(modules.nodes.length, 2, 'finds a node for each matching function call'); + t.equal( + modules.nodes.filter(function (x) { + return x.callee.name === 'fn' + }).length, 2, + 'all matches are correct' + ); +}); diff --git a/node_modules/detective/test/parseopts.js b/node_modules/detective/test/parseopts.js new file mode 100644 index 000000000..ec0da81d5 --- /dev/null +++ b/node_modules/detective/test/parseopts.js @@ -0,0 +1,62 @@ +var test = require('tap').test; +var detective = require('../'); +var fs = require('fs'); +var src = fs.readFileSync(__dirname + '/files/both.js'); + +test('nodes specified in opts and parseopts { range: true }', function (t) { + var modules = detective.find(src, { nodes: true, parse: { range: true } }); + t.deepEqual(modules.strings, [ 'a', 'b' ]); + t.deepEqual(modules.expressions, [ "'c' + x", "'d' + y" ]); + t.deepEqual( + modules.nodes.map(function (n) { + var arg = n.arguments[0]; + return arg.value || arg.left.value; + }), + [ 'a', 'b', 'c', 'd' ], + 'has a node for each require'); + + var range = modules.nodes[0].range; + t.equal(range[0], 0, 'includes range start'); + t.equal(range[1], 12, 'includes range end'); + t.end(); +}); + +test('nodes specified in opts and parseopts { range: false }', function (t) { + var modules = detective.find(src, { nodes: true, parse: { range: false } }); + t.deepEqual(modules.strings, [ 'a', 'b' ]); + t.deepEqual(modules.expressions, [ "'c' + x", "'d' + y" ]); + t.deepEqual( + modules.nodes.map(function (n) { + var arg = n.arguments[0]; + return arg.value || arg.left.value; + }), + [ 'a', 'b', 'c', 'd' ], + 'has a node for each require'); + + t.notOk(modules.nodes[0].range, 'includes no ranges'); + t.end(); +}); + +test('nodes specified in opts and parseopts { range: true, loc: true }', function (t) { + var modules = detective.find(src, { nodes: true, parse: { range: true, loc: true } }); + t.deepEqual(modules.strings, [ 'a', 'b' ]); + t.deepEqual(modules.expressions, [ "'c' + x", "'d' + y" ]); + t.deepEqual( + modules.nodes.map(function (n) { + var arg = n.arguments[0]; + return arg.value || arg.left.value; + }), + [ 'a', 'b', 'c', 'd' ], + 'has a node for each require'); + + var range = modules.nodes[0].range; + t.equal(range[0], 0, 'includes range start'); + t.equal(range[1], 12, 'includes range end'); + + var loc = modules.nodes[0].loc; + t.equal(loc.start.line, 1, 'includes start line'); + t.equal(loc.start.column, 0, 'includes start column'); + t.equal(loc.end.line, 1, 'includes end line'); + t.equal(loc.end.column, 12, 'includes end column'); + t.end(); +}); diff --git a/node_modules/detective/test/rest-spread.js b/node_modules/detective/test/rest-spread.js new file mode 100644 index 000000000..5da31e708 --- /dev/null +++ b/node_modules/detective/test/rest-spread.js @@ -0,0 +1,9 @@ +var test = require('tap').test; +var detective = require('../'); +var fs = require('fs'); +var src = fs.readFileSync(__dirname + '/files/rest-spread.js'); + +test('rest-spread', function (t) { + t.doesNotThrow(detective.bind(detective, src), 'Files with rest or spread do not throw') + t.end(); +}); diff --git a/node_modules/detective/test/return.js b/node_modules/detective/test/return.js new file mode 100644 index 000000000..c2da016bb --- /dev/null +++ b/node_modules/detective/test/return.js @@ -0,0 +1,9 @@ +var test = require('tap').test; +var detective = require('../'); +var fs = require('fs'); +var src = [ 'require("a")\nreturn' ]; + +test('return', function (t) { + t.plan(1); + t.deepEqual(detective(src), [ 'a' ]); +}); diff --git a/node_modules/detective/test/set-in-object-pattern.js b/node_modules/detective/test/set-in-object-pattern.js new file mode 100644 index 000000000..4787b1edb --- /dev/null +++ b/node_modules/detective/test/set-in-object-pattern.js @@ -0,0 +1,12 @@ +var test = require('tap').test; +var detective = require('../'); +var fs = require('fs'); +var src = fs.readFileSync(__dirname + '/files/set-in-object-pattern.js'); + +test('set in object pattern', function (t) { + t.deepEqual( + detective(src, { word : 'load' }), + [ 'a', 'b', 'c', 'tt' ] + ); + t.end(); +}); \ No newline at end of file diff --git a/node_modules/detective/test/shebang.js b/node_modules/detective/test/shebang.js new file mode 100644 index 000000000..b662ea241 --- /dev/null +++ b/node_modules/detective/test/shebang.js @@ -0,0 +1,9 @@ +var test = require('tap').test; +var detective = require('../'); +var fs = require('fs'); +var src = fs.readFileSync(__dirname + '/files/shebang.js'); + +test('shebang', function (t) { + t.plan(1); + t.deepEqual(detective(src), [ 'a', 'b', 'c' ]); +}); diff --git a/node_modules/detective/test/sparse-array.js b/node_modules/detective/test/sparse-array.js new file mode 100644 index 000000000..f64f3593c --- /dev/null +++ b/node_modules/detective/test/sparse-array.js @@ -0,0 +1,14 @@ +var test = require('tap').test; +var detective = require('../'); +var fs = require('fs'); +var src = fs.readFileSync(__dirname + '/files/sparse-array.js'); + +test('sparse-array', function (t) { + //just check that this does not crash. + t.doesNotThrow(function () { + detective(src) + }) + t.end(); +}); + + diff --git a/node_modules/detective/test/strings.js b/node_modules/detective/test/strings.js new file mode 100644 index 000000000..3b5e7d821 --- /dev/null +++ b/node_modules/detective/test/strings.js @@ -0,0 +1,9 @@ +var test = require('tap').test; +var detective = require('../'); +var fs = require('fs'); +var src = fs.readFileSync(__dirname + '/files/strings.js'); + +test('single', function (t) { + t.deepEqual(detective(src), [ 'a', 'b', 'c', 'events', 'doom', 'y', 'events2' ]); + t.end(); +}); diff --git a/node_modules/detective/test/word.js b/node_modules/detective/test/word.js new file mode 100644 index 000000000..cf5397d85 --- /dev/null +++ b/node_modules/detective/test/word.js @@ -0,0 +1,12 @@ +var test = require('tap').test; +var detective = require('../'); +var fs = require('fs'); +var src = fs.readFileSync(__dirname + '/files/word.js'); + +test('word', function (t) { + t.deepEqual( + detective(src, { word : 'load' }), + [ 'a', 'b', 'c', 'events', 'doom', 'y', 'events2' ] + ); + t.end(); +}); diff --git a/node_modules/detective/test/yield.js b/node_modules/detective/test/yield.js new file mode 100644 index 000000000..85560ab7a --- /dev/null +++ b/node_modules/detective/test/yield.js @@ -0,0 +1,9 @@ +var test = require('tap').test; +var detective = require('../'); +var fs = require('fs'); +var src = fs.readFileSync(__dirname + '/files/yield.js'); + +test('yield', function (t) { + t.plan(1); + t.deepEqual(detective(src), [ 'a', 'c' ]); +}); diff --git a/node_modules/diffie-hellman/.travis.yml b/node_modules/diffie-hellman/.travis.yml new file mode 100644 index 000000000..0dda27315 --- /dev/null +++ b/node_modules/diffie-hellman/.travis.yml @@ -0,0 +1,10 @@ +language: node_js +node_js: + - "0.11" + - "0.10" + - "0.12" + - "1" + - "2" + - "3" + - "4" +sudo: false diff --git a/node_modules/diffie-hellman/LICENSE b/node_modules/diffie-hellman/LICENSE new file mode 100644 index 000000000..c9ddc0feb --- /dev/null +++ b/node_modules/diffie-hellman/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2017 Calvin Metcalf + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/diffie-hellman/browser.js b/node_modules/diffie-hellman/browser.js new file mode 100644 index 000000000..d4be92bb6 --- /dev/null +++ b/node_modules/diffie-hellman/browser.js @@ -0,0 +1,42 @@ +var generatePrime = require('./lib/generatePrime') +var primes = require('./lib/primes.json') + +var DH = require('./lib/dh') + +function getDiffieHellman (mod) { + var prime = new Buffer(primes[mod].prime, 'hex') + var gen = new Buffer(primes[mod].gen, 'hex') + + return new DH(prime, gen) +} + +var ENCODINGS = { + 'binary': true, 'hex': true, 'base64': true +} + +function createDiffieHellman (prime, enc, generator, genc) { + if (Buffer.isBuffer(enc) || ENCODINGS[enc] === undefined) { + return createDiffieHellman(prime, 'binary', enc, generator) + } + + enc = enc || 'binary' + genc = genc || 'binary' + generator = generator || new Buffer([2]) + + if (!Buffer.isBuffer(generator)) { + generator = new Buffer(generator, genc) + } + + if (typeof prime === 'number') { + return new DH(generatePrime(prime, generator), generator, true) + } + + if (!Buffer.isBuffer(prime)) { + prime = new Buffer(prime, enc) + } + + return new DH(prime, generator, true) +} + +exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman +exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman diff --git a/node_modules/diffie-hellman/index.js b/node_modules/diffie-hellman/index.js new file mode 100644 index 000000000..ab7c40fec --- /dev/null +++ b/node_modules/diffie-hellman/index.js @@ -0,0 +1,10 @@ +var crypto = require('crypto') + +// getDiffieHellman +exports.DiffieHellmanGroup = crypto.DiffieHellmanGroup +exports.createDiffieHellmanGroup = crypto.createDiffieHellmanGroup +exports.getDiffieHellman = crypto.getDiffieHellman + +// createDiffieHellman +exports.createDiffieHellman = crypto.createDiffieHellman +exports.DiffieHellman = crypto.DiffieHellman diff --git a/node_modules/diffie-hellman/lib/dh.js b/node_modules/diffie-hellman/lib/dh.js new file mode 100644 index 000000000..0650f65d4 --- /dev/null +++ b/node_modules/diffie-hellman/lib/dh.js @@ -0,0 +1,164 @@ +var BN = require('bn.js'); +var MillerRabin = require('miller-rabin'); +var millerRabin = new MillerRabin(); +var TWENTYFOUR = new BN(24); +var ELEVEN = new BN(11); +var TEN = new BN(10); +var THREE = new BN(3); +var SEVEN = new BN(7); +var primes = require('./generatePrime'); +var randomBytes = require('randombytes'); +module.exports = DH; + +function setPublicKey(pub, enc) { + enc = enc || 'utf8'; + if (!Buffer.isBuffer(pub)) { + pub = new Buffer(pub, enc); + } + this._pub = new BN(pub); + return this; +} + +function setPrivateKey(priv, enc) { + enc = enc || 'utf8'; + if (!Buffer.isBuffer(priv)) { + priv = new Buffer(priv, enc); + } + this._priv = new BN(priv); + return this; +} + +var primeCache = {}; +function checkPrime(prime, generator) { + var gen = generator.toString('hex'); + var hex = [gen, prime.toString(16)].join('_'); + if (hex in primeCache) { + return primeCache[hex]; + } + var error = 0; + + if (prime.isEven() || + !primes.simpleSieve || + !primes.fermatTest(prime) || + !millerRabin.test(prime)) { + //not a prime so +1 + error += 1; + + if (gen === '02' || gen === '05') { + // we'd be able to check the generator + // it would fail so +8 + error += 8; + } else { + //we wouldn't be able to test the generator + // so +4 + error += 4; + } + primeCache[hex] = error; + return error; + } + if (!millerRabin.test(prime.shrn(1))) { + //not a safe prime + error += 2; + } + var rem; + switch (gen) { + case '02': + if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) { + // unsuidable generator + error += 8; + } + break; + case '05': + rem = prime.mod(TEN); + if (rem.cmp(THREE) && rem.cmp(SEVEN)) { + // prime mod 10 needs to equal 3 or 7 + error += 8; + } + break; + default: + error += 4; + } + primeCache[hex] = error; + return error; +} + +function DH(prime, generator, malleable) { + this.setGenerator(generator); + this.__prime = new BN(prime); + this._prime = BN.mont(this.__prime); + this._primeLen = prime.length; + this._pub = undefined; + this._priv = undefined; + this._primeCode = undefined; + if (malleable) { + this.setPublicKey = setPublicKey; + this.setPrivateKey = setPrivateKey; + } else { + this._primeCode = 8; + } +} +Object.defineProperty(DH.prototype, 'verifyError', { + enumerable: true, + get: function () { + if (typeof this._primeCode !== 'number') { + this._primeCode = checkPrime(this.__prime, this.__gen); + } + return this._primeCode; + } +}); +DH.prototype.generateKeys = function () { + if (!this._priv) { + this._priv = new BN(randomBytes(this._primeLen)); + } + this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed(); + return this.getPublicKey(); +}; + +DH.prototype.computeSecret = function (other) { + other = new BN(other); + other = other.toRed(this._prime); + var secret = other.redPow(this._priv).fromRed(); + var out = new Buffer(secret.toArray()); + var prime = this.getPrime(); + if (out.length < prime.length) { + var front = new Buffer(prime.length - out.length); + front.fill(0); + out = Buffer.concat([front, out]); + } + return out; +}; + +DH.prototype.getPublicKey = function getPublicKey(enc) { + return formatReturnValue(this._pub, enc); +}; + +DH.prototype.getPrivateKey = function getPrivateKey(enc) { + return formatReturnValue(this._priv, enc); +}; + +DH.prototype.getPrime = function (enc) { + return formatReturnValue(this.__prime, enc); +}; + +DH.prototype.getGenerator = function (enc) { + return formatReturnValue(this._gen, enc); +}; + +DH.prototype.setGenerator = function (gen, enc) { + enc = enc || 'utf8'; + if (!Buffer.isBuffer(gen)) { + gen = new Buffer(gen, enc); + } + this.__gen = gen; + this._gen = new BN(gen); + return this; +}; + +function formatReturnValue(bn, enc) { + var buf = new Buffer(bn.toArray()); + if (!enc) { + return buf; + } else { + return buf.toString(enc); + } +} diff --git a/node_modules/diffie-hellman/lib/generatePrime.js b/node_modules/diffie-hellman/lib/generatePrime.js new file mode 100644 index 000000000..32e053cf3 --- /dev/null +++ b/node_modules/diffie-hellman/lib/generatePrime.js @@ -0,0 +1,105 @@ +var randomBytes = require('randombytes'); +module.exports = findPrime; +findPrime.simpleSieve = simpleSieve; +findPrime.fermatTest = fermatTest; +var BN = require('bn.js'); +var TWENTYFOUR = new BN(24); +var MillerRabin = require('miller-rabin'); +var millerRabin = new MillerRabin(); +var ONE = new BN(1); +var TWO = new BN(2); +var FIVE = new BN(5); +var SIXTEEN = new BN(16); +var EIGHT = new BN(8); +var TEN = new BN(10); +var THREE = new BN(3); +var SEVEN = new BN(7); +var ELEVEN = new BN(11); +var FOUR = new BN(4); +var TWELVE = new BN(12); +var primes = null; + +function _getPrimes() { + if (primes !== null) + return primes; + + var limit = 0x100000; + var res = []; + res[0] = 2; + for (var i = 1, k = 3; k < limit; k += 2) { + var sqrt = Math.ceil(Math.sqrt(k)); + for (var j = 0; j < i && res[j] <= sqrt; j++) + if (k % res[j] === 0) + break; + + if (i !== j && res[j] <= sqrt) + continue; + + res[i++] = k; + } + primes = res; + return res; +} + +function simpleSieve(p) { + var primes = _getPrimes(); + + for (var i = 0; i < primes.length; i++) + if (p.modn(primes[i]) === 0) { + if (p.cmpn(primes[i]) === 0) { + return true; + } else { + return false; + } + } + + return true; +} + +function fermatTest(p) { + var red = BN.mont(p); + return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0; +} + +function findPrime(bits, gen) { + if (bits < 16) { + // this is what openssl does + if (gen === 2 || gen === 5) { + return new BN([0x8c, 0x7b]); + } else { + return new BN([0x8c, 0x27]); + } + } + gen = new BN(gen); + + var num, n2; + + while (true) { + num = new BN(randomBytes(Math.ceil(bits / 8))); + while (num.bitLength() > bits) { + num.ishrn(1); + } + if (num.isEven()) { + num.iadd(ONE); + } + if (!num.testn(1)) { + num.iadd(TWO); + } + if (!gen.cmp(TWO)) { + while (num.mod(TWENTYFOUR).cmp(ELEVEN)) { + num.iadd(FOUR); + } + } else if (!gen.cmp(FIVE)) { + while (num.mod(TEN).cmp(THREE)) { + num.iadd(FOUR); + } + } + n2 = num.shrn(1); + if (simpleSieve(n2) && simpleSieve(num) && + fermatTest(n2) && fermatTest(num) && + millerRabin.test(n2) && millerRabin.test(num)) { + return num; + } + } + +} diff --git a/node_modules/diffie-hellman/lib/primes.json b/node_modules/diffie-hellman/lib/primes.json new file mode 100644 index 000000000..9fef6c961 --- /dev/null +++ b/node_modules/diffie-hellman/lib/primes.json @@ -0,0 +1,34 @@ +{ + "modp1": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff" + }, + "modp2": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff" + }, + "modp5": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff" + }, + "modp14": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff" + }, + "modp15": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff" + }, + "modp16": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff" + }, + "modp17": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff" + }, + "modp18": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff" + } +} \ No newline at end of file diff --git a/node_modules/diffie-hellman/package.json b/node_modules/diffie-hellman/package.json new file mode 100644 index 000000000..187444b96 --- /dev/null +++ b/node_modules/diffie-hellman/package.json @@ -0,0 +1,62 @@ +{ + "_from": "diffie-hellman@^5.0.0", + "_id": "diffie-hellman@5.0.3", + "_inBundle": false, + "_integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "_location": "/diffie-hellman", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "diffie-hellman@^5.0.0", + "name": "diffie-hellman", + "escapedName": "diffie-hellman", + "rawSpec": "^5.0.0", + "saveSpec": null, + "fetchSpec": "^5.0.0" + }, + "_requiredBy": [ + "/crypto-browserify" + ], + "_resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "_shasum": "40e8ee98f55a2149607146921c63e1ae5f3d2875", + "_spec": "diffie-hellman@^5.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/crypto-browserify", + "author": { + "name": "Calvin Metcalf" + }, + "browser": "browser.js", + "bugs": { + "url": "https://github.com/crypto-browserify/diffie-hellman/issues" + }, + "bundleDependencies": false, + "dependencies": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + }, + "deprecated": false, + "description": "pure js diffie-hellman", + "devDependencies": { + "tap-spec": "^1.0.1", + "tape": "^3.0.1" + }, + "homepage": "https://github.com/crypto-browserify/diffie-hellman", + "keywords": [ + "diffie", + "hellman", + "diffiehellman", + "dh" + ], + "license": "MIT", + "main": "index.js", + "name": "diffie-hellman", + "repository": { + "type": "git", + "url": "git+https://github.com/crypto-browserify/diffie-hellman.git" + }, + "scripts": { + "test": "node test.js | tspec" + }, + "version": "5.0.3" +} diff --git a/node_modules/diffie-hellman/readme.md b/node_modules/diffie-hellman/readme.md new file mode 100644 index 000000000..afba499d9 --- /dev/null +++ b/node_modules/diffie-hellman/readme.md @@ -0,0 +1,4 @@ +diffie hellman [![Build Status](https://travis-ci.org/crypto-browserify/diffie-hellman.svg)](https://travis-ci.org/crypto-browserify/diffie-hellman) +==== + +pure js diffie-hellman, same api as node, most hard parts thanks to [bn.js](https://www.npmjs.org/package/bn.js) by [@indutny](https://github.com/indutny). In node just returns an object with `crypto.createDiffieHellman` and `crypto.getDiffieHellman` in the browser returns a shim. To require the pure JavaScript one in node `require('diffie-hellman/browser');`; \ No newline at end of file diff --git a/node_modules/domain-browser/HISTORY.md b/node_modules/domain-browser/HISTORY.md new file mode 100644 index 000000000..b4a285d45 --- /dev/null +++ b/node_modules/domain-browser/HISTORY.md @@ -0,0 +1,46 @@ +# History + +## v1.2.0 2018 January 26 +- `index.js` is now located at `source/index.js` +- Updated base files + +## v1.1.7 2015 December 12 +- Revert minimum node version from 0.12 back to 0.4 + - Thanks to [Alexander Sorokin](https://github.com/syrnick) for [this comment](https://github.com/bevry/domain-browser/commit/c66ee3445e87955e70d0d60d4515f2d26a81b9c4#commitcomment-14938325) + +## v1.1.6 2015 December 12 +- Fixed `assert-helpers` sneaking into `dependencies` + - Thanks to [Bogdan Chadkin](https://github.com/TrySound) for [Pull Request #8](https://github.com/bevry/domain-browser/pull/8) + +## v1.1.5 2015 December 9 +- Updated internal conventions +- Added better jspm support + - Thanks to [Guy Bedford](https://github.com/guybedford) for [Pull Request #7](https://github.com/bevry/domain-browser/pull/7) + +## v1.1.4 2015 February 3 +- Added + - `domain.enter()` + - `domain.exit()` + - `domain.bind()` + - `domain.intercept()` + +## v1.1.3 2014 October 10 +- Added + - `domain.add()` + - `domain.remove()` + +## v1.1.2 2014 June 8 +- Added `domain.createDomain()` alias + - Thanks to [James Halliday](https://github.com/substack) for [Pull Request #1](https://github.com/bevry/domain-browser/pull/1) + +## v1.1.1 2013 December 27 +- Fixed `domain.create()` not returning anything + +## v1.1.0 2013 November 1 +- Dropped component.io and bower support, just use ender or browserify + +## v1.0.1 2013 September 18 +- Now called `domain-browser` everywhere + +## v1.0.0 2013 September 18 +- Initial release diff --git a/node_modules/domain-browser/LICENSE.md b/node_modules/domain-browser/LICENSE.md new file mode 100644 index 000000000..08d8802ab --- /dev/null +++ b/node_modules/domain-browser/LICENSE.md @@ -0,0 +1,23 @@ + + +

License

+ +Unless stated otherwise all works are: + + + +and licensed under: + + + +

MIT License

+ +
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+ + diff --git a/node_modules/domain-browser/README.md b/node_modules/domain-browser/README.md new file mode 100644 index 000000000..68c936bb4 --- /dev/null +++ b/node_modules/domain-browser/README.md @@ -0,0 +1,121 @@ + + +

domain-browser

+ + + + + + +Travis CI Build Status +NPM version +NPM downloads +Dependency Status +Dev Dependency Status +
+Patreon donate button +Open Collective donate button +Gratipay donate button +Flattr donate button +PayPal donate button +Bitcoin donate button +Wishlist browse button +
+Slack community badge + + + + + + +Node's domain module for the web browser. This is merely an evented try...catch with the same API as node, nothing more. + + + + + + +

Install

+ +

NPM

    +
  • Install: npm install --save domain-browser
  • +
  • Module: require('domain-browser')
+ +

Browserify

    +
  • Install: npm install --save domain-browser
  • +
  • Module: require('domain-browser')
  • +
  • CDN URL: //wzrd.in/bundle/domain-browser@1.2.0
+ +

Ender

    +
  • Install: ender add domain-browser
  • +
  • Module: require('domain-browser')
+ +

Editions

+ +

This package is published with the following editions:

+ +
  • domain-browser aliases domain-browser/source/index.js
  • +
  • domain-browser/source/index.js is Source + ES5 + Require
+ + + + + + +

History

+ +Discover the release history by heading on over to the HISTORY.md file. + + + + + + +

Backers

+ +

Maintainers

+ +These amazing people are maintaining this project: + + + +

Sponsors

+ +No sponsors yet! Will you be the first? + +Patreon donate button +Open Collective donate button +Gratipay donate button +Flattr donate button +PayPal donate button +Bitcoin donate button +Wishlist browse button + +

Contributors

+ +These amazing people have contributed code to this project: + + + +Discover how you can contribute by heading on over to the CONTRIBUTING.md file. + + + + + + +

License

+ +Unless stated otherwise all works are: + + + +and licensed under: + + + + diff --git a/node_modules/domain-browser/package.json b/node_modules/domain-browser/package.json new file mode 100644 index 000000000..560677337 --- /dev/null +++ b/node_modules/domain-browser/package.json @@ -0,0 +1,172 @@ +{ + "_from": "domain-browser@^1.2.0", + "_id": "domain-browser@1.2.0", + "_inBundle": false, + "_integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "_location": "/domain-browser", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "domain-browser@^1.2.0", + "name": "domain-browser", + "escapedName": "domain-browser", + "rawSpec": "^1.2.0", + "saveSpec": null, + "fetchSpec": "^1.2.0" + }, + "_requiredBy": [ + "/browserify" + ], + "_resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "_shasum": "3d31f50191a6749dd1375a7f522e823d42e54eda", + "_spec": "domain-browser@^1.2.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "2013+ Bevry Pty Ltd", + "email": "us@bevry.me", + "url": "http://bevry.me" + }, + "badges": { + "list": [ + "travisci", + "npmversion", + "npmdownloads", + "daviddm", + "daviddmdev", + "---", + "patreon", + "opencollective", + "gratipay", + "flattr", + "paypal", + "bitcoin", + "wishlist", + "---", + "slackin" + ], + "config": { + "patreonUsername": "bevry", + "opencollectiveUsername": "bevry", + "gratipayUsername": "bevry", + "flattrUsername": "balupton", + "paypalURL": "https://bevry.me/paypal", + "bitcoinURL": "https://bevry.me/bitcoin", + "wishlistURL": "https://bevry.me/wishlist", + "slackinURL": "https://slack.bevry.me" + } + }, + "browser": "source/index.js", + "bugs": { + "url": "https://github.com/bevry/domain-browser/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Benjamin Lupton", + "email": "b@lupton.cc", + "url": "http://balupton.com" + }, + { + "name": "Evan Solomon", + "url": "http://evansolomon.me" + }, + { + "name": "James Halliday", + "email": "substack@gmail.com", + "url": "http://substack.neocities.org/" + }, + { + "name": "Guy Bedford", + "email": "guybedford@gmail.com", + "url": "twitter.com/guybedford" + }, + { + "name": "Bogdan Chadkin", + "email": "trysound@yandex.ru", + "url": "https://github.com/TrySound" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Node's domain module for the web browser. This is merely an evented try...catch with the same API as node, nothing more.", + "devDependencies": { + "assert-helpers": "^4.5.0", + "eslint": "^4.16.0", + "joe": "^2.0.2", + "joe-reporter-console": "^2.0.1", + "projectz": "^1.4.0" + }, + "editions": [ + { + "description": "Source + ES5 + Require", + "directory": "source", + "entry": "index.js", + "syntaxes": [ + "javascript", + "es5", + "require" + ] + } + ], + "engines": { + "node": ">=0.4", + "npm": ">=1.2" + }, + "homepage": "https://github.com/bevry/domain-browser", + "jspm": { + "map": { + "source/index.js": { + "node": "@node/domain" + } + } + }, + "keywords": [ + "domain", + "trycatch", + "try", + "catch", + "node-compat", + "ender.js", + "component", + "component.io", + "umd", + "amd", + "require.js", + "browser" + ], + "license": "MIT", + "main": "source/index.js", + "maintainers": [ + { + "name": "Benjamin Lupton", + "email": "b@lupton.cc", + "url": "http://balupton.com" + } + ], + "name": "domain-browser", + "repository": { + "type": "git", + "url": "git+https://github.com/bevry/domain-browser.git" + }, + "scripts": { + "our:clean": "rm -Rf ./docs ./es2015 ./es5 ./out", + "our:compile": "echo no need for this project", + "our:meta": "npm run our:meta:projectz", + "our:meta:projectz": "projectz compile", + "our:release": "npm run our:release:prepare && npm run our:release:check && npm run our:release:tag && npm run our:release:push", + "our:release:check": "npm run our:release:check:changelog && npm run our:release:check:dirty", + "our:release:check:changelog": "cat ./HISTORY.md | grep v$npm_package_version || (echo add a changelog entry for v$npm_package_version && exit -1)", + "our:release:check:dirty": "git diff --exit-code", + "our:release:prepare": "npm run our:clean && npm run our:compile && npm run our:test && npm run our:meta", + "our:release:push": "git push origin master && git push origin --tags", + "our:release:tag": "export MESSAGE=$(cat ./HISTORY.md | sed -n \"/## v$npm_package_version/,/##/p\" | sed 's/## //' | awk 'NR>1{print buf}{buf = $0}') && test \"$MESSAGE\" || (echo 'proper changelog entry not found' && exit -1) && git tag v$npm_package_version -am \"$MESSAGE\"", + "our:setup": "npm run our:setup:npm", + "our:setup:npm": "npm install", + "our:test": "npm run our:verify && npm test", + "our:verify": "npm run our:verify:eslint", + "our:verify:eslint": "eslint --fix ./source", + "test": "node --harmony source/test.js --joe-reporter=console" + }, + "version": "1.2.0" +} diff --git a/node_modules/domain-browser/source/index.js b/node_modules/domain-browser/source/index.js new file mode 100644 index 000000000..e06b3a175 --- /dev/null +++ b/node_modules/domain-browser/source/index.js @@ -0,0 +1,70 @@ +// This file should be ES5 compatible +/* eslint prefer-spread:0, no-var:0, prefer-reflect:0, no-magic-numbers:0 */ +'use strict' + +module.exports = (function () { + // Import Events + var events = require('events') + + // Export Domain + var domain = {} + domain.createDomain = domain.create = function () { + var d = new events.EventEmitter() + + function emitError (e) { + d.emit('error', e) + } + + d.add = function (emitter) { + emitter.on('error', emitError) + } + d.remove = function (emitter) { + emitter.removeListener('error', emitError) + } + d.bind = function (fn) { + return function () { + var args = Array.prototype.slice.call(arguments) + try { + fn.apply(null, args) + } + catch (err) { + emitError(err) + } + } + } + d.intercept = function (fn) { + return function (err) { + if ( err ) { + emitError(err) + } + else { + var args = Array.prototype.slice.call(arguments, 1) + try { + fn.apply(null, args) + } + catch (err) { + emitError(err) + } + } + } + } + d.run = function (fn) { + try { + fn() + } + catch (err) { + emitError(err) + } + return this + } + d.dispose = function () { + this.removeAllListeners() + return this + } + d.enter = d.exit = function () { + return this + } + return d + } + return domain +}).call(this) diff --git a/node_modules/duplexer2/LICENSE.md b/node_modules/duplexer2/LICENSE.md new file mode 100644 index 000000000..547189a6a --- /dev/null +++ b/node_modules/duplexer2/LICENSE.md @@ -0,0 +1,26 @@ +Copyright (c) 2013, Deoxxa Development +====================================== +All rights reserved. +-------------------- + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. 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. +3. Neither the name of Deoxxa Development 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 DEOXXA DEVELOPMENT ''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 DEOXXA DEVELOPMENT 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. diff --git a/node_modules/duplexer2/README.md b/node_modules/duplexer2/README.md new file mode 100644 index 000000000..f4a69573a --- /dev/null +++ b/node_modules/duplexer2/README.md @@ -0,0 +1,115 @@ +# duplexer2 [![Build Status](https://travis-ci.org/deoxxa/duplexer2.svg?branch=master)](https://travis-ci.org/deoxxa/duplexer2) [![Coverage Status](https://coveralls.io/repos/deoxxa/duplexer2/badge.svg?branch=master&service=github)](https://coveralls.io/github/deoxxa/duplexer2?branch=master) + +Like [duplexer](https://github.com/Raynos/duplexer) but using Streams3 + +```javascript +var stream = require("stream"); + +var duplexer2 = require("duplexer2"); + +var writable = new stream.Writable({objectMode: true}), + readable = new stream.Readable({objectMode: true}); + +writable._write = function _write(input, encoding, done) { + if (readable.push(input)) { + return done(); + } else { + readable.once("drain", done); + } +}; + +readable._read = function _read(n) { + // no-op +}; + +// simulate the readable thing closing after a bit +writable.once("finish", function() { + setTimeout(function() { + readable.push(null); + }, 500); +}); + +var duplex = duplexer2(writable, readable); + +duplex.on("data", function(e) { + console.log("got data", JSON.stringify(e)); +}); + +duplex.on("finish", function() { + console.log("got finish event"); +}); + +duplex.on("end", function() { + console.log("got end event"); +}); + +duplex.write("oh, hi there", function() { + console.log("finished writing"); +}); + +duplex.end(function() { + console.log("finished ending"); +}); +``` + +``` +got data "oh, hi there" +finished writing +got finish event +finished ending +got end event +``` + +## Overview + +This is a reimplementation of [duplexer](https://www.npmjs.com/package/duplexer) using the +Streams3 API which is standard in Node as of v4. Everything largely +works the same. + + + +## Installation + +[Available via `npm`](https://docs.npmjs.com/cli/install): + +``` +$ npm i duplexer2 +``` + +## API + +### duplexer2 + +Creates a new `DuplexWrapper` object, which is the actual class that implements +most of the fun stuff. All that fun stuff is hidden. DON'T LOOK. + +```javascript +duplexer2([options], writable, readable) +``` + +```javascript +const duplex = duplexer2(new stream.Writable(), new stream.Readable()); +``` + +Arguments + +* __options__ - an object specifying the regular `stream.Duplex` options, as + well as the properties described below. +* __writable__ - a writable stream +* __readable__ - a readable stream + +Options + +* __bubbleErrors__ - a boolean value that specifies whether to bubble errors + from the underlying readable/writable streams. Default is `true`. + + +## License + +3-clause BSD. [A copy](./LICENSE) is included with the source. + +## Contact + +* GitHub ([deoxxa](http://github.com/deoxxa)) +* Twitter ([@deoxxa](http://twitter.com/deoxxa)) +* Email ([deoxxa@fknsrs.biz](mailto:deoxxa@fknsrs.biz)) diff --git a/node_modules/duplexer2/index.js b/node_modules/duplexer2/index.js new file mode 100644 index 000000000..a40ece9ab --- /dev/null +++ b/node_modules/duplexer2/index.js @@ -0,0 +1,76 @@ +"use strict"; + +var stream = require("readable-stream"); + +function DuplexWrapper(options, writable, readable) { + if (typeof readable === "undefined") { + readable = writable; + writable = options; + options = null; + } + + stream.Duplex.call(this, options); + + if (typeof readable.read !== "function") { + readable = (new stream.Readable(options)).wrap(readable); + } + + this._writable = writable; + this._readable = readable; + this._waiting = false; + + var self = this; + + writable.once("finish", function() { + self.end(); + }); + + this.once("finish", function() { + writable.end(); + }); + + readable.on("readable", function() { + if (self._waiting) { + self._waiting = false; + self._read(); + } + }); + + readable.once("end", function() { + self.push(null); + }); + + if (!options || typeof options.bubbleErrors === "undefined" || options.bubbleErrors) { + writable.on("error", function(err) { + self.emit("error", err); + }); + + readable.on("error", function(err) { + self.emit("error", err); + }); + } +} + +DuplexWrapper.prototype = Object.create(stream.Duplex.prototype, {constructor: {value: DuplexWrapper}}); + +DuplexWrapper.prototype._write = function _write(input, encoding, done) { + this._writable.write(input, encoding, done); +}; + +DuplexWrapper.prototype._read = function _read() { + var buf; + var reads = 0; + while ((buf = this._readable.read()) !== null) { + this.push(buf); + reads++; + } + if (reads === 0) { + this._waiting = true; + } +}; + +module.exports = function duplex2(options, writable, readable) { + return new DuplexWrapper(options, writable, readable); +}; + +module.exports.DuplexWrapper = DuplexWrapper; diff --git a/node_modules/duplexer2/package.json b/node_modules/duplexer2/package.json new file mode 100644 index 000000000..04e7cef5d --- /dev/null +++ b/node_modules/duplexer2/package.json @@ -0,0 +1,66 @@ +{ + "_from": "duplexer2@~0.1.2", + "_id": "duplexer2@0.1.4", + "_inBundle": false, + "_integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", + "_location": "/duplexer2", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "duplexer2@~0.1.2", + "name": "duplexer2", + "escapedName": "duplexer2", + "rawSpec": "~0.1.2", + "saveSpec": null, + "fetchSpec": "~0.1.2" + }, + "_requiredBy": [ + "/browserify", + "/module-deps", + "/stream-combiner2" + ], + "_resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "_shasum": "8b12dab878c0d69e3e7891051662a32fc6bddcc1", + "_spec": "duplexer2@~0.1.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "Conrad Pankoff", + "email": "deoxxa@fknsrs.biz", + "url": "http://www.fknsrs.biz/" + }, + "bugs": { + "url": "https://github.com/deoxxa/duplexer2/issues" + }, + "bundleDependencies": false, + "dependencies": { + "readable-stream": "^2.0.2" + }, + "deprecated": false, + "description": "Like duplexer but using streams3", + "devDependencies": { + "mocha": "^2.2.5" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/deoxxa/duplexer2#readme", + "keywords": [ + "duplex", + "duplexer", + "stream", + "stream3", + "join", + "combine" + ], + "license": "BSD-3-Clause", + "name": "duplexer2", + "repository": { + "type": "git", + "url": "git+https://github.com/deoxxa/duplexer2.git" + }, + "scripts": { + "test": "mocha -R tap" + }, + "version": "0.1.4" +} diff --git a/node_modules/ee-first/LICENSE b/node_modules/ee-first/LICENSE new file mode 100644 index 000000000..a7ae8ee9b --- /dev/null +++ b/node_modules/ee-first/LICENSE @@ -0,0 +1,22 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/ee-first/README.md b/node_modules/ee-first/README.md new file mode 100644 index 000000000..cbd2478be --- /dev/null +++ b/node_modules/ee-first/README.md @@ -0,0 +1,80 @@ +# EE First + +[![NPM version][npm-image]][npm-url] +[![Build status][travis-image]][travis-url] +[![Test coverage][coveralls-image]][coveralls-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] +[![Gittip][gittip-image]][gittip-url] + +Get the first event in a set of event emitters and event pairs, +then clean up after itself. + +## Install + +```sh +$ npm install ee-first +``` + +## API + +```js +var first = require('ee-first') +``` + +### first(arr, listener) + +Invoke `listener` on the first event from the list specified in `arr`. `arr` is +an array of arrays, with each array in the format `[ee, ...event]`. `listener` +will be called only once, the first time any of the given events are emitted. If +`error` is one of the listened events, then if that fires first, the `listener` +will be given the `err` argument. + +The `listener` is invoked as `listener(err, ee, event, args)`, where `err` is the +first argument emitted from an `error` event, if applicable; `ee` is the event +emitter that fired; `event` is the string event name that fired; and `args` is an +array of the arguments that were emitted on the event. + +```js +var ee1 = new EventEmitter() +var ee2 = new EventEmitter() + +first([ + [ee1, 'close', 'end', 'error'], + [ee2, 'error'] +], function (err, ee, event, args) { + // listener invoked +}) +``` + +#### .cancel() + +The group of listeners can be cancelled before being invoked and have all the event +listeners removed from the underlying event emitters. + +```js +var thunk = first([ + [ee1, 'close', 'end', 'error'], + [ee2, 'error'] +], function (err, ee, event, args) { + // listener invoked +}) + +// cancel and clean up +thunk.cancel() +``` + +[npm-image]: https://img.shields.io/npm/v/ee-first.svg?style=flat-square +[npm-url]: https://npmjs.org/package/ee-first +[github-tag]: http://img.shields.io/github/tag/jonathanong/ee-first.svg?style=flat-square +[github-url]: https://github.com/jonathanong/ee-first/tags +[travis-image]: https://img.shields.io/travis/jonathanong/ee-first.svg?style=flat-square +[travis-url]: https://travis-ci.org/jonathanong/ee-first +[coveralls-image]: https://img.shields.io/coveralls/jonathanong/ee-first.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/jonathanong/ee-first?branch=master +[license-image]: http://img.shields.io/npm/l/ee-first.svg?style=flat-square +[license-url]: LICENSE.md +[downloads-image]: http://img.shields.io/npm/dm/ee-first.svg?style=flat-square +[downloads-url]: https://npmjs.org/package/ee-first +[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square +[gittip-url]: https://www.gittip.com/jonathanong/ diff --git a/node_modules/ee-first/index.js b/node_modules/ee-first/index.js new file mode 100644 index 000000000..501287cd3 --- /dev/null +++ b/node_modules/ee-first/index.js @@ -0,0 +1,95 @@ +/*! + * ee-first + * Copyright(c) 2014 Jonathan Ong + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = first + +/** + * Get the first event in a set of event emitters and event pairs. + * + * @param {array} stuff + * @param {function} done + * @public + */ + +function first(stuff, done) { + if (!Array.isArray(stuff)) + throw new TypeError('arg must be an array of [ee, events...] arrays') + + var cleanups = [] + + for (var i = 0; i < stuff.length; i++) { + var arr = stuff[i] + + if (!Array.isArray(arr) || arr.length < 2) + throw new TypeError('each array member must be [ee, events...]') + + var ee = arr[0] + + for (var j = 1; j < arr.length; j++) { + var event = arr[j] + var fn = listener(event, callback) + + // listen to the event + ee.on(event, fn) + // push this listener to the list of cleanups + cleanups.push({ + ee: ee, + event: event, + fn: fn, + }) + } + } + + function callback() { + cleanup() + done.apply(null, arguments) + } + + function cleanup() { + var x + for (var i = 0; i < cleanups.length; i++) { + x = cleanups[i] + x.ee.removeListener(x.event, x.fn) + } + } + + function thunk(fn) { + done = fn + } + + thunk.cancel = cleanup + + return thunk +} + +/** + * Create the event listener. + * @private + */ + +function listener(event, done) { + return function onevent(arg1) { + var args = new Array(arguments.length) + var ee = this + var err = event === 'error' + ? arg1 + : null + + // copy args to prevent arguments escaping scope + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + + done(err, ee, event, args) + } +} diff --git a/node_modules/ee-first/package.json b/node_modules/ee-first/package.json new file mode 100644 index 000000000..b836958c0 --- /dev/null +++ b/node_modules/ee-first/package.json @@ -0,0 +1,63 @@ +{ + "_from": "ee-first@1.1.1", + "_id": "ee-first@1.1.1", + "_inBundle": false, + "_integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "_location": "/ee-first", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "ee-first@1.1.1", + "name": "ee-first", + "escapedName": "ee-first", + "rawSpec": "1.1.1", + "saveSpec": null, + "fetchSpec": "1.1.1" + }, + "_requiredBy": [ + "/on-finished" + ], + "_resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "_shasum": "590c61156b0ae2f4f0255732a158b266bc56b21d", + "_spec": "ee-first@1.1.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/on-finished", + "author": { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + }, + "bugs": { + "url": "https://github.com/jonathanong/ee-first/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + } + ], + "deprecated": false, + "description": "return the first event in a set of ee/event pairs", + "devDependencies": { + "istanbul": "0.3.9", + "mocha": "2.2.5" + }, + "files": [ + "index.js", + "LICENSE" + ], + "homepage": "https://github.com/jonathanong/ee-first#readme", + "license": "MIT", + "name": "ee-first", + "repository": { + "type": "git", + "url": "git+https://github.com/jonathanong/ee-first.git" + }, + "scripts": { + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "version": "1.1.1" +} diff --git a/node_modules/elliptic/README.md b/node_modules/elliptic/README.md new file mode 100644 index 000000000..96219e55b --- /dev/null +++ b/node_modules/elliptic/README.md @@ -0,0 +1,238 @@ +# Elliptic [![Build Status](https://secure.travis-ci.org/indutny/elliptic.png)](http://travis-ci.org/indutny/elliptic) [![Coverage Status](https://coveralls.io/repos/indutny/elliptic/badge.svg?branch=master&service=github)](https://coveralls.io/github/indutny/elliptic?branch=master) [![Code Climate](https://codeclimate.com/github/indutny/elliptic/badges/gpa.svg)](https://codeclimate.com/github/indutny/elliptic) + +[![Saucelabs Test Status](https://saucelabs.com/browser-matrix/gh-indutny-elliptic.svg)](https://saucelabs.com/u/gh-indutny-elliptic) + +Fast elliptic-curve cryptography in a plain javascript implementation. + +NOTE: Please take a look at http://safecurves.cr.yp.to/ before choosing a curve +for your cryptography operations. + +## Incentive + +ECC is much slower than regular RSA cryptography, the JS implementations are +even more slower. + +## Benchmarks + +```bash +$ node benchmarks/index.js +Benchmarking: sign +elliptic#sign x 262 ops/sec ±0.51% (177 runs sampled) +eccjs#sign x 55.91 ops/sec ±0.90% (144 runs sampled) +------------------------ +Fastest is elliptic#sign +======================== +Benchmarking: verify +elliptic#verify x 113 ops/sec ±0.50% (166 runs sampled) +eccjs#verify x 48.56 ops/sec ±0.36% (125 runs sampled) +------------------------ +Fastest is elliptic#verify +======================== +Benchmarking: gen +elliptic#gen x 294 ops/sec ±0.43% (176 runs sampled) +eccjs#gen x 62.25 ops/sec ±0.63% (129 runs sampled) +------------------------ +Fastest is elliptic#gen +======================== +Benchmarking: ecdh +elliptic#ecdh x 136 ops/sec ±0.85% (156 runs sampled) +------------------------ +Fastest is elliptic#ecdh +======================== +``` + +## API + +### ECDSA + +```javascript +var EC = require('elliptic').ec; + +// Create and initialize EC context +// (better do it once and reuse it) +var ec = new EC('secp256k1'); + +// Generate keys +var key = ec.genKeyPair(); + +// Sign the message's hash (input must be an array, or a hex-string) +var msgHash = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]; +var signature = key.sign(msgHash); + +// Export DER encoded signature in Array +var derSign = signature.toDER(); + +// Verify signature +console.log(key.verify(msgHash, derSign)); + +// CHECK WITH NO PRIVATE KEY + +var pubPoint = key.getPublic(); +var x = pubPoint.getX(); +var y = pubPoint.getY(); + +// Public Key MUST be either: +// 1) '04' + hex string of x + hex string of y; or +// 2) object with two hex string properties (x and y); or +// 3) object with two buffer properties (x and y) +var pub = pubPoint.encode('hex'); // case 1 +var pub = { x: x.toString('hex'), y: y.toString('hex') }; // case 2 +var pub = { x: x.toBuffer(), y: y.toBuffer() }; // case 3 +var pub = { x: x.toArrayLike(Buffer), y: y.toArrayLike(Buffer) }; // case 3 + +// Import public key +var key = ec.keyFromPublic(pub, 'hex'); + +// Signature MUST be either: +// 1) DER-encoded signature as hex-string; or +// 2) DER-encoded signature as buffer; or +// 3) object with two hex-string properties (r and s); or +// 4) object with two buffer properties (r and s) + +var signature = '3046022100...'; // case 1 +var signature = new Buffer('...'); // case 2 +var signature = { r: 'b1fc...', s: '9c42...' }; // case 3 + +// Verify signature +console.log(key.verify(msgHash, signature)); +``` + +### EdDSA + +```javascript +var EdDSA = require('elliptic').eddsa; + +// Create and initialize EdDSA context +// (better do it once and reuse it) +var ec = new EdDSA('ed25519'); + +// Create key pair from secret +var key = ec.keyFromSecret('693e3c...'); // hex string, array or Buffer + +// Sign the message's hash (input must be an array, or a hex-string) +var msgHash = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]; +var signature = key.sign(msgHash).toHex(); + +// Verify signature +console.log(key.verify(msgHash, signature)); + +// CHECK WITH NO PRIVATE KEY + +// Import public key +var pub = '0a1af638...'; +var key = ec.keyFromPublic(pub, 'hex'); + +// Verify signature +var signature = '70bed1...'; +console.log(key.verify(msgHash, signature)); +``` + +### ECDH + +```javascript +var EC = require('elliptic').ec; +var ec = new EC('curve25519'); + +// Generate keys +var key1 = ec.genKeyPair(); +var key2 = ec.genKeyPair(); + +var shared1 = key1.derive(key2.getPublic()); +var shared2 = key2.derive(key1.getPublic()); + +console.log('Both shared secrets are BN instances'); +console.log(shared1.toString(16)); +console.log(shared2.toString(16)); +``` + +three and more members: +```javascript +var EC = require('elliptic').ec; +var ec = new EC('curve25519'); + +var A = ec.genKeyPair(); +var B = ec.genKeyPair(); +var C = ec.genKeyPair(); + +var AB = A.getPublic().mul(B.getPrivate()) +var BC = B.getPublic().mul(C.getPrivate()) +var CA = C.getPublic().mul(A.getPrivate()) + +var ABC = AB.mul(C.getPrivate()) +var BCA = BC.mul(A.getPrivate()) +var CAB = CA.mul(B.getPrivate()) + +console.log(ABC.getX().toString(16)) +console.log(BCA.getX().toString(16)) +console.log(CAB.getX().toString(16)) +``` + +NOTE: `.derive()` returns a [BN][1] instance. + +## Supported curves + +Elliptic.js support following curve types: + +* Short Weierstrass +* Montgomery +* Edwards +* Twisted Edwards + +Following curve 'presets' are embedded into the library: + +* `secp256k1` +* `p192` +* `p224` +* `p256` +* `p384` +* `p521` +* `curve25519` +* `ed25519` + +NOTE: That `curve25519` could not be used for ECDSA, use `ed25519` instead. + +### Implementation details + +ECDSA is using deterministic `k` value generation as per [RFC6979][0]. Most of +the curve operations are performed on non-affine coordinates (either projective +or extended), various windowing techniques are used for different cases. + +All operations are performed in reduction context using [bn.js][1], hashing is +provided by [hash.js][2] + +### Related projects + +* [eccrypto][3]: isomorphic implementation of ECDSA, ECDH and ECIES for both + browserify and node (uses `elliptic` for browser and [secp256k1-node][4] for + node) + +#### LICENSE + +This software is licensed under the MIT License. + +Copyright Fedor Indutny, 2014. + +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. + +[0]: http://tools.ietf.org/html/rfc6979 +[1]: https://github.com/indutny/bn.js +[2]: https://github.com/indutny/hash.js +[3]: https://github.com/bitchan/eccrypto +[4]: https://github.com/wanderer/secp256k1-node diff --git a/node_modules/elliptic/lib/elliptic.js b/node_modules/elliptic/lib/elliptic.js new file mode 100644 index 000000000..dfe2fe7d1 --- /dev/null +++ b/node_modules/elliptic/lib/elliptic.js @@ -0,0 +1,13 @@ +'use strict'; + +var elliptic = exports; + +elliptic.version = require('../package.json').version; +elliptic.utils = require('./elliptic/utils'); +elliptic.rand = require('brorand'); +elliptic.curve = require('./elliptic/curve'); +elliptic.curves = require('./elliptic/curves'); + +// Protocols +elliptic.ec = require('./elliptic/ec'); +elliptic.eddsa = require('./elliptic/eddsa'); diff --git a/node_modules/elliptic/lib/elliptic/curve/base.js b/node_modules/elliptic/lib/elliptic/curve/base.js new file mode 100644 index 000000000..3af82396a --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/curve/base.js @@ -0,0 +1,375 @@ +'use strict'; + +var BN = require('bn.js'); +var elliptic = require('../../elliptic'); +var utils = elliptic.utils; +var getNAF = utils.getNAF; +var getJSF = utils.getJSF; +var assert = utils.assert; + +function BaseCurve(type, conf) { + this.type = type; + this.p = new BN(conf.p, 16); + + // Use Montgomery, when there is no fast reduction for the prime + this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p); + + // Useful for many curves + this.zero = new BN(0).toRed(this.red); + this.one = new BN(1).toRed(this.red); + this.two = new BN(2).toRed(this.red); + + // Curve configuration, optional + this.n = conf.n && new BN(conf.n, 16); + this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed); + + // Temporary arrays + this._wnafT1 = new Array(4); + this._wnafT2 = new Array(4); + this._wnafT3 = new Array(4); + this._wnafT4 = new Array(4); + + // Generalized Greg Maxwell's trick + var adjustCount = this.n && this.p.div(this.n); + if (!adjustCount || adjustCount.cmpn(100) > 0) { + this.redN = null; + } else { + this._maxwellTrick = true; + this.redN = this.n.toRed(this.red); + } +} +module.exports = BaseCurve; + +BaseCurve.prototype.point = function point() { + throw new Error('Not implemented'); +}; + +BaseCurve.prototype.validate = function validate() { + throw new Error('Not implemented'); +}; + +BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) { + assert(p.precomputed); + var doubles = p._getDoubles(); + + var naf = getNAF(k, 1); + var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1); + I /= 3; + + // Translate into more windowed form + var repr = []; + for (var j = 0; j < naf.length; j += doubles.step) { + var nafW = 0; + for (var k = j + doubles.step - 1; k >= j; k--) + nafW = (nafW << 1) + naf[k]; + repr.push(nafW); + } + + var a = this.jpoint(null, null, null); + var b = this.jpoint(null, null, null); + for (var i = I; i > 0; i--) { + for (var j = 0; j < repr.length; j++) { + var nafW = repr[j]; + if (nafW === i) + b = b.mixedAdd(doubles.points[j]); + else if (nafW === -i) + b = b.mixedAdd(doubles.points[j].neg()); + } + a = a.add(b); + } + return a.toP(); +}; + +BaseCurve.prototype._wnafMul = function _wnafMul(p, k) { + var w = 4; + + // Precompute window + var nafPoints = p._getNAFPoints(w); + w = nafPoints.wnd; + var wnd = nafPoints.points; + + // Get NAF form + var naf = getNAF(k, w); + + // Add `this`*(N+1) for every w-NAF index + var acc = this.jpoint(null, null, null); + for (var i = naf.length - 1; i >= 0; i--) { + // Count zeroes + for (var k = 0; i >= 0 && naf[i] === 0; i--) + k++; + if (i >= 0) + k++; + acc = acc.dblp(k); + + if (i < 0) + break; + var z = naf[i]; + assert(z !== 0); + if (p.type === 'affine') { + // J +- P + if (z > 0) + acc = acc.mixedAdd(wnd[(z - 1) >> 1]); + else + acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg()); + } else { + // J +- J + if (z > 0) + acc = acc.add(wnd[(z - 1) >> 1]); + else + acc = acc.add(wnd[(-z - 1) >> 1].neg()); + } + } + return p.type === 'affine' ? acc.toP() : acc; +}; + +BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW, + points, + coeffs, + len, + jacobianResult) { + var wndWidth = this._wnafT1; + var wnd = this._wnafT2; + var naf = this._wnafT3; + + // Fill all arrays + var max = 0; + for (var i = 0; i < len; i++) { + var p = points[i]; + var nafPoints = p._getNAFPoints(defW); + wndWidth[i] = nafPoints.wnd; + wnd[i] = nafPoints.points; + } + + // Comb small window NAFs + for (var i = len - 1; i >= 1; i -= 2) { + var a = i - 1; + var b = i; + if (wndWidth[a] !== 1 || wndWidth[b] !== 1) { + naf[a] = getNAF(coeffs[a], wndWidth[a]); + naf[b] = getNAF(coeffs[b], wndWidth[b]); + max = Math.max(naf[a].length, max); + max = Math.max(naf[b].length, max); + continue; + } + + var comb = [ + points[a], /* 1 */ + null, /* 3 */ + null, /* 5 */ + points[b] /* 7 */ + ]; + + // Try to avoid Projective points, if possible + if (points[a].y.cmp(points[b].y) === 0) { + comb[1] = points[a].add(points[b]); + comb[2] = points[a].toJ().mixedAdd(points[b].neg()); + } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) { + comb[1] = points[a].toJ().mixedAdd(points[b]); + comb[2] = points[a].add(points[b].neg()); + } else { + comb[1] = points[a].toJ().mixedAdd(points[b]); + comb[2] = points[a].toJ().mixedAdd(points[b].neg()); + } + + var index = [ + -3, /* -1 -1 */ + -1, /* -1 0 */ + -5, /* -1 1 */ + -7, /* 0 -1 */ + 0, /* 0 0 */ + 7, /* 0 1 */ + 5, /* 1 -1 */ + 1, /* 1 0 */ + 3 /* 1 1 */ + ]; + + var jsf = getJSF(coeffs[a], coeffs[b]); + max = Math.max(jsf[0].length, max); + naf[a] = new Array(max); + naf[b] = new Array(max); + for (var j = 0; j < max; j++) { + var ja = jsf[0][j] | 0; + var jb = jsf[1][j] | 0; + + naf[a][j] = index[(ja + 1) * 3 + (jb + 1)]; + naf[b][j] = 0; + wnd[a] = comb; + } + } + + var acc = this.jpoint(null, null, null); + var tmp = this._wnafT4; + for (var i = max; i >= 0; i--) { + var k = 0; + + while (i >= 0) { + var zero = true; + for (var j = 0; j < len; j++) { + tmp[j] = naf[j][i] | 0; + if (tmp[j] !== 0) + zero = false; + } + if (!zero) + break; + k++; + i--; + } + if (i >= 0) + k++; + acc = acc.dblp(k); + if (i < 0) + break; + + for (var j = 0; j < len; j++) { + var z = tmp[j]; + var p; + if (z === 0) + continue; + else if (z > 0) + p = wnd[j][(z - 1) >> 1]; + else if (z < 0) + p = wnd[j][(-z - 1) >> 1].neg(); + + if (p.type === 'affine') + acc = acc.mixedAdd(p); + else + acc = acc.add(p); + } + } + // Zeroify references + for (var i = 0; i < len; i++) + wnd[i] = null; + + if (jacobianResult) + return acc; + else + return acc.toP(); +}; + +function BasePoint(curve, type) { + this.curve = curve; + this.type = type; + this.precomputed = null; +} +BaseCurve.BasePoint = BasePoint; + +BasePoint.prototype.eq = function eq(/*other*/) { + throw new Error('Not implemented'); +}; + +BasePoint.prototype.validate = function validate() { + return this.curve.validate(this); +}; + +BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) { + bytes = utils.toArray(bytes, enc); + + var len = this.p.byteLength(); + + // uncompressed, hybrid-odd, hybrid-even + if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) && + bytes.length - 1 === 2 * len) { + if (bytes[0] === 0x06) + assert(bytes[bytes.length - 1] % 2 === 0); + else if (bytes[0] === 0x07) + assert(bytes[bytes.length - 1] % 2 === 1); + + var res = this.point(bytes.slice(1, 1 + len), + bytes.slice(1 + len, 1 + 2 * len)); + + return res; + } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) && + bytes.length - 1 === len) { + return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03); + } + throw new Error('Unknown point format'); +}; + +BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) { + return this.encode(enc, true); +}; + +BasePoint.prototype._encode = function _encode(compact) { + var len = this.curve.p.byteLength(); + var x = this.getX().toArray('be', len); + + if (compact) + return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x); + + return [ 0x04 ].concat(x, this.getY().toArray('be', len)) ; +}; + +BasePoint.prototype.encode = function encode(enc, compact) { + return utils.encode(this._encode(compact), enc); +}; + +BasePoint.prototype.precompute = function precompute(power) { + if (this.precomputed) + return this; + + var precomputed = { + doubles: null, + naf: null, + beta: null + }; + precomputed.naf = this._getNAFPoints(8); + precomputed.doubles = this._getDoubles(4, power); + precomputed.beta = this._getBeta(); + this.precomputed = precomputed; + + return this; +}; + +BasePoint.prototype._hasDoubles = function _hasDoubles(k) { + if (!this.precomputed) + return false; + + var doubles = this.precomputed.doubles; + if (!doubles) + return false; + + return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step); +}; + +BasePoint.prototype._getDoubles = function _getDoubles(step, power) { + if (this.precomputed && this.precomputed.doubles) + return this.precomputed.doubles; + + var doubles = [ this ]; + var acc = this; + for (var i = 0; i < power; i += step) { + for (var j = 0; j < step; j++) + acc = acc.dbl(); + doubles.push(acc); + } + return { + step: step, + points: doubles + }; +}; + +BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) { + if (this.precomputed && this.precomputed.naf) + return this.precomputed.naf; + + var res = [ this ]; + var max = (1 << wnd) - 1; + var dbl = max === 1 ? null : this.dbl(); + for (var i = 1; i < max; i++) + res[i] = res[i - 1].add(dbl); + return { + wnd: wnd, + points: res + }; +}; + +BasePoint.prototype._getBeta = function _getBeta() { + return null; +}; + +BasePoint.prototype.dblp = function dblp(k) { + var r = this; + for (var i = 0; i < k; i++) + r = r.dbl(); + return r; +}; diff --git a/node_modules/elliptic/lib/elliptic/curve/edwards.js b/node_modules/elliptic/lib/elliptic/curve/edwards.js new file mode 100644 index 000000000..a8965eaec --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/curve/edwards.js @@ -0,0 +1,433 @@ +'use strict'; + +var curve = require('../curve'); +var elliptic = require('../../elliptic'); +var BN = require('bn.js'); +var inherits = require('inherits'); +var Base = curve.base; + +var assert = elliptic.utils.assert; + +function EdwardsCurve(conf) { + // NOTE: Important as we are creating point in Base.call() + this.twisted = (conf.a | 0) !== 1; + this.mOneA = this.twisted && (conf.a | 0) === -1; + this.extended = this.mOneA; + + Base.call(this, 'edwards', conf); + + this.a = new BN(conf.a, 16).umod(this.red.m); + this.a = this.a.toRed(this.red); + this.c = new BN(conf.c, 16).toRed(this.red); + this.c2 = this.c.redSqr(); + this.d = new BN(conf.d, 16).toRed(this.red); + this.dd = this.d.redAdd(this.d); + + assert(!this.twisted || this.c.fromRed().cmpn(1) === 0); + this.oneC = (conf.c | 0) === 1; +} +inherits(EdwardsCurve, Base); +module.exports = EdwardsCurve; + +EdwardsCurve.prototype._mulA = function _mulA(num) { + if (this.mOneA) + return num.redNeg(); + else + return this.a.redMul(num); +}; + +EdwardsCurve.prototype._mulC = function _mulC(num) { + if (this.oneC) + return num; + else + return this.c.redMul(num); +}; + +// Just for compatibility with Short curve +EdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) { + return this.point(x, y, z, t); +}; + +EdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) { + x = new BN(x, 16); + if (!x.red) + x = x.toRed(this.red); + + var x2 = x.redSqr(); + var rhs = this.c2.redSub(this.a.redMul(x2)); + var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2)); + + var y2 = rhs.redMul(lhs.redInvm()); + var y = y2.redSqrt(); + if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) + throw new Error('invalid point'); + + var isOdd = y.fromRed().isOdd(); + if (odd && !isOdd || !odd && isOdd) + y = y.redNeg(); + + return this.point(x, y); +}; + +EdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) { + y = new BN(y, 16); + if (!y.red) + y = y.toRed(this.red); + + // x^2 = (y^2 - c^2) / (c^2 d y^2 - a) + var y2 = y.redSqr(); + var lhs = y2.redSub(this.c2); + var rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a); + var x2 = lhs.redMul(rhs.redInvm()); + + if (x2.cmp(this.zero) === 0) { + if (odd) + throw new Error('invalid point'); + else + return this.point(this.zero, y); + } + + var x = x2.redSqrt(); + if (x.redSqr().redSub(x2).cmp(this.zero) !== 0) + throw new Error('invalid point'); + + if (x.fromRed().isOdd() !== odd) + x = x.redNeg(); + + return this.point(x, y); +}; + +EdwardsCurve.prototype.validate = function validate(point) { + if (point.isInfinity()) + return true; + + // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2) + point.normalize(); + + var x2 = point.x.redSqr(); + var y2 = point.y.redSqr(); + var lhs = x2.redMul(this.a).redAdd(y2); + var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2))); + + return lhs.cmp(rhs) === 0; +}; + +function Point(curve, x, y, z, t) { + Base.BasePoint.call(this, curve, 'projective'); + if (x === null && y === null && z === null) { + this.x = this.curve.zero; + this.y = this.curve.one; + this.z = this.curve.one; + this.t = this.curve.zero; + this.zOne = true; + } else { + this.x = new BN(x, 16); + this.y = new BN(y, 16); + this.z = z ? new BN(z, 16) : this.curve.one; + this.t = t && new BN(t, 16); + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + if (this.t && !this.t.red) + this.t = this.t.toRed(this.curve.red); + this.zOne = this.z === this.curve.one; + + // Use extended coordinates + if (this.curve.extended && !this.t) { + this.t = this.x.redMul(this.y); + if (!this.zOne) + this.t = this.t.redMul(this.z.redInvm()); + } + } +} +inherits(Point, Base.BasePoint); + +EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) { + return Point.fromJSON(this, obj); +}; + +EdwardsCurve.prototype.point = function point(x, y, z, t) { + return new Point(this, x, y, z, t); +}; + +Point.fromJSON = function fromJSON(curve, obj) { + return new Point(curve, obj[0], obj[1], obj[2]); +}; + +Point.prototype.inspect = function inspect() { + if (this.isInfinity()) + return ''; + return ''; +}; + +Point.prototype.isInfinity = function isInfinity() { + // XXX This code assumes that zero is always zero in red + return this.x.cmpn(0) === 0 && + (this.y.cmp(this.z) === 0 || + (this.zOne && this.y.cmp(this.curve.c) === 0)); +}; + +Point.prototype._extDbl = function _extDbl() { + // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html + // #doubling-dbl-2008-hwcd + // 4M + 4S + + // A = X1^2 + var a = this.x.redSqr(); + // B = Y1^2 + var b = this.y.redSqr(); + // C = 2 * Z1^2 + var c = this.z.redSqr(); + c = c.redIAdd(c); + // D = a * A + var d = this.curve._mulA(a); + // E = (X1 + Y1)^2 - A - B + var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b); + // G = D + B + var g = d.redAdd(b); + // F = G - C + var f = g.redSub(c); + // H = D - B + var h = d.redSub(b); + // X3 = E * F + var nx = e.redMul(f); + // Y3 = G * H + var ny = g.redMul(h); + // T3 = E * H + var nt = e.redMul(h); + // Z3 = F * G + var nz = f.redMul(g); + return this.curve.point(nx, ny, nz, nt); +}; + +Point.prototype._projDbl = function _projDbl() { + // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html + // #doubling-dbl-2008-bbjlp + // #doubling-dbl-2007-bl + // and others + // Generally 3M + 4S or 2M + 4S + + // B = (X1 + Y1)^2 + var b = this.x.redAdd(this.y).redSqr(); + // C = X1^2 + var c = this.x.redSqr(); + // D = Y1^2 + var d = this.y.redSqr(); + + var nx; + var ny; + var nz; + if (this.curve.twisted) { + // E = a * C + var e = this.curve._mulA(c); + // F = E + D + var f = e.redAdd(d); + if (this.zOne) { + // X3 = (B - C - D) * (F - 2) + nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two)); + // Y3 = F * (E - D) + ny = f.redMul(e.redSub(d)); + // Z3 = F^2 - 2 * F + nz = f.redSqr().redSub(f).redSub(f); + } else { + // H = Z1^2 + var h = this.z.redSqr(); + // J = F - 2 * H + var j = f.redSub(h).redISub(h); + // X3 = (B-C-D)*J + nx = b.redSub(c).redISub(d).redMul(j); + // Y3 = F * (E - D) + ny = f.redMul(e.redSub(d)); + // Z3 = F * J + nz = f.redMul(j); + } + } else { + // E = C + D + var e = c.redAdd(d); + // H = (c * Z1)^2 + var h = this.curve._mulC(this.z).redSqr(); + // J = E - 2 * H + var j = e.redSub(h).redSub(h); + // X3 = c * (B - E) * J + nx = this.curve._mulC(b.redISub(e)).redMul(j); + // Y3 = c * E * (C - D) + ny = this.curve._mulC(e).redMul(c.redISub(d)); + // Z3 = E * J + nz = e.redMul(j); + } + return this.curve.point(nx, ny, nz); +}; + +Point.prototype.dbl = function dbl() { + if (this.isInfinity()) + return this; + + // Double in extended coordinates + if (this.curve.extended) + return this._extDbl(); + else + return this._projDbl(); +}; + +Point.prototype._extAdd = function _extAdd(p) { + // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html + // #addition-add-2008-hwcd-3 + // 8M + + // A = (Y1 - X1) * (Y2 - X2) + var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x)); + // B = (Y1 + X1) * (Y2 + X2) + var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)); + // C = T1 * k * T2 + var c = this.t.redMul(this.curve.dd).redMul(p.t); + // D = Z1 * 2 * Z2 + var d = this.z.redMul(p.z.redAdd(p.z)); + // E = B - A + var e = b.redSub(a); + // F = D - C + var f = d.redSub(c); + // G = D + C + var g = d.redAdd(c); + // H = B + A + var h = b.redAdd(a); + // X3 = E * F + var nx = e.redMul(f); + // Y3 = G * H + var ny = g.redMul(h); + // T3 = E * H + var nt = e.redMul(h); + // Z3 = F * G + var nz = f.redMul(g); + return this.curve.point(nx, ny, nz, nt); +}; + +Point.prototype._projAdd = function _projAdd(p) { + // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html + // #addition-add-2008-bbjlp + // #addition-add-2007-bl + // 10M + 1S + + // A = Z1 * Z2 + var a = this.z.redMul(p.z); + // B = A^2 + var b = a.redSqr(); + // C = X1 * X2 + var c = this.x.redMul(p.x); + // D = Y1 * Y2 + var d = this.y.redMul(p.y); + // E = d * C * D + var e = this.curve.d.redMul(c).redMul(d); + // F = B - E + var f = b.redSub(e); + // G = B + E + var g = b.redAdd(e); + // X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D) + var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d); + var nx = a.redMul(f).redMul(tmp); + var ny; + var nz; + if (this.curve.twisted) { + // Y3 = A * G * (D - a * C) + ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c))); + // Z3 = F * G + nz = f.redMul(g); + } else { + // Y3 = A * G * (D - C) + ny = a.redMul(g).redMul(d.redSub(c)); + // Z3 = c * F * G + nz = this.curve._mulC(f).redMul(g); + } + return this.curve.point(nx, ny, nz); +}; + +Point.prototype.add = function add(p) { + if (this.isInfinity()) + return p; + if (p.isInfinity()) + return this; + + if (this.curve.extended) + return this._extAdd(p); + else + return this._projAdd(p); +}; + +Point.prototype.mul = function mul(k) { + if (this._hasDoubles(k)) + return this.curve._fixedNafMul(this, k); + else + return this.curve._wnafMul(this, k); +}; + +Point.prototype.mulAdd = function mulAdd(k1, p, k2) { + return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, false); +}; + +Point.prototype.jmulAdd = function jmulAdd(k1, p, k2) { + return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, true); +}; + +Point.prototype.normalize = function normalize() { + if (this.zOne) + return this; + + // Normalize coordinates + var zi = this.z.redInvm(); + this.x = this.x.redMul(zi); + this.y = this.y.redMul(zi); + if (this.t) + this.t = this.t.redMul(zi); + this.z = this.curve.one; + this.zOne = true; + return this; +}; + +Point.prototype.neg = function neg() { + return this.curve.point(this.x.redNeg(), + this.y, + this.z, + this.t && this.t.redNeg()); +}; + +Point.prototype.getX = function getX() { + this.normalize(); + return this.x.fromRed(); +}; + +Point.prototype.getY = function getY() { + this.normalize(); + return this.y.fromRed(); +}; + +Point.prototype.eq = function eq(other) { + return this === other || + this.getX().cmp(other.getX()) === 0 && + this.getY().cmp(other.getY()) === 0; +}; + +Point.prototype.eqXToP = function eqXToP(x) { + var rx = x.toRed(this.curve.red).redMul(this.z); + if (this.x.cmp(rx) === 0) + return true; + + var xc = x.clone(); + var t = this.curve.redN.redMul(this.z); + for (;;) { + xc.iadd(this.curve.n); + if (xc.cmp(this.curve.p) >= 0) + return false; + + rx.redIAdd(t); + if (this.x.cmp(rx) === 0) + return true; + } +}; + +// Compatibility with BaseCurve +Point.prototype.toP = Point.prototype.normalize; +Point.prototype.mixedAdd = Point.prototype.add; diff --git a/node_modules/elliptic/lib/elliptic/curve/index.js b/node_modules/elliptic/lib/elliptic/curve/index.js new file mode 100644 index 000000000..c589281df --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/curve/index.js @@ -0,0 +1,8 @@ +'use strict'; + +var curve = exports; + +curve.base = require('./base'); +curve.short = require('./short'); +curve.mont = require('./mont'); +curve.edwards = require('./edwards'); diff --git a/node_modules/elliptic/lib/elliptic/curve/mont.js b/node_modules/elliptic/lib/elliptic/curve/mont.js new file mode 100644 index 000000000..0ddea33e8 --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/curve/mont.js @@ -0,0 +1,180 @@ +'use strict'; + +var curve = require('../curve'); +var BN = require('bn.js'); +var inherits = require('inherits'); +var Base = curve.base; + +var elliptic = require('../../elliptic'); +var utils = elliptic.utils; + +function MontCurve(conf) { + Base.call(this, 'mont', conf); + + this.a = new BN(conf.a, 16).toRed(this.red); + this.b = new BN(conf.b, 16).toRed(this.red); + this.i4 = new BN(4).toRed(this.red).redInvm(); + this.two = new BN(2).toRed(this.red); + this.a24 = this.i4.redMul(this.a.redAdd(this.two)); +} +inherits(MontCurve, Base); +module.exports = MontCurve; + +MontCurve.prototype.validate = function validate(point) { + var x = point.normalize().x; + var x2 = x.redSqr(); + var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x); + var y = rhs.redSqrt(); + + return y.redSqr().cmp(rhs) === 0; +}; + +function Point(curve, x, z) { + Base.BasePoint.call(this, curve, 'projective'); + if (x === null && z === null) { + this.x = this.curve.one; + this.z = this.curve.zero; + } else { + this.x = new BN(x, 16); + this.z = new BN(z, 16); + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + } +} +inherits(Point, Base.BasePoint); + +MontCurve.prototype.decodePoint = function decodePoint(bytes, enc) { + return this.point(utils.toArray(bytes, enc), 1); +}; + +MontCurve.prototype.point = function point(x, z) { + return new Point(this, x, z); +}; + +MontCurve.prototype.pointFromJSON = function pointFromJSON(obj) { + return Point.fromJSON(this, obj); +}; + +Point.prototype.precompute = function precompute() { + // No-op +}; + +Point.prototype._encode = function _encode() { + return this.getX().toArray('be', this.curve.p.byteLength()); +}; + +Point.fromJSON = function fromJSON(curve, obj) { + return new Point(curve, obj[0], obj[1] || curve.one); +}; + +Point.prototype.inspect = function inspect() { + if (this.isInfinity()) + return ''; + return ''; +}; + +Point.prototype.isInfinity = function isInfinity() { + // XXX This code assumes that zero is always zero in red + return this.z.cmpn(0) === 0; +}; + +Point.prototype.dbl = function dbl() { + // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3 + // 2M + 2S + 4A + + // A = X1 + Z1 + var a = this.x.redAdd(this.z); + // AA = A^2 + var aa = a.redSqr(); + // B = X1 - Z1 + var b = this.x.redSub(this.z); + // BB = B^2 + var bb = b.redSqr(); + // C = AA - BB + var c = aa.redSub(bb); + // X3 = AA * BB + var nx = aa.redMul(bb); + // Z3 = C * (BB + A24 * C) + var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c))); + return this.curve.point(nx, nz); +}; + +Point.prototype.add = function add() { + throw new Error('Not supported on Montgomery curve'); +}; + +Point.prototype.diffAdd = function diffAdd(p, diff) { + // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3 + // 4M + 2S + 6A + + // A = X2 + Z2 + var a = this.x.redAdd(this.z); + // B = X2 - Z2 + var b = this.x.redSub(this.z); + // C = X3 + Z3 + var c = p.x.redAdd(p.z); + // D = X3 - Z3 + var d = p.x.redSub(p.z); + // DA = D * A + var da = d.redMul(a); + // CB = C * B + var cb = c.redMul(b); + // X5 = Z1 * (DA + CB)^2 + var nx = diff.z.redMul(da.redAdd(cb).redSqr()); + // Z5 = X1 * (DA - CB)^2 + var nz = diff.x.redMul(da.redISub(cb).redSqr()); + return this.curve.point(nx, nz); +}; + +Point.prototype.mul = function mul(k) { + var t = k.clone(); + var a = this; // (N / 2) * Q + Q + var b = this.curve.point(null, null); // (N / 2) * Q + var c = this; // Q + + for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1)) + bits.push(t.andln(1)); + + for (var i = bits.length - 1; i >= 0; i--) { + if (bits[i] === 0) { + // N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q + a = a.diffAdd(b, c); + // N * Q = 2 * ((N / 2) * Q + Q)) + b = b.dbl(); + } else { + // N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q) + b = a.diffAdd(b, c); + // N * Q + Q = 2 * ((N / 2) * Q + Q) + a = a.dbl(); + } + } + return b; +}; + +Point.prototype.mulAdd = function mulAdd() { + throw new Error('Not supported on Montgomery curve'); +}; + +Point.prototype.jumlAdd = function jumlAdd() { + throw new Error('Not supported on Montgomery curve'); +}; + +Point.prototype.eq = function eq(other) { + return this.getX().cmp(other.getX()) === 0; +}; + +Point.prototype.normalize = function normalize() { + this.x = this.x.redMul(this.z.redInvm()); + this.z = this.curve.one; + return this; +}; + +Point.prototype.getX = function getX() { + // Normalize coordinates + this.normalize(); + + return this.x.fromRed(); +}; diff --git a/node_modules/elliptic/lib/elliptic/curve/short.js b/node_modules/elliptic/lib/elliptic/curve/short.js new file mode 100644 index 000000000..5a0e86032 --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/curve/short.js @@ -0,0 +1,937 @@ +'use strict'; + +var curve = require('../curve'); +var elliptic = require('../../elliptic'); +var BN = require('bn.js'); +var inherits = require('inherits'); +var Base = curve.base; + +var assert = elliptic.utils.assert; + +function ShortCurve(conf) { + Base.call(this, 'short', conf); + + this.a = new BN(conf.a, 16).toRed(this.red); + this.b = new BN(conf.b, 16).toRed(this.red); + this.tinv = this.two.redInvm(); + + this.zeroA = this.a.fromRed().cmpn(0) === 0; + this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0; + + // If the curve is endomorphic, precalculate beta and lambda + this.endo = this._getEndomorphism(conf); + this._endoWnafT1 = new Array(4); + this._endoWnafT2 = new Array(4); +} +inherits(ShortCurve, Base); +module.exports = ShortCurve; + +ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) { + // No efficient endomorphism + if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1) + return; + + // Compute beta and lambda, that lambda * P = (beta * Px; Py) + var beta; + var lambda; + if (conf.beta) { + beta = new BN(conf.beta, 16).toRed(this.red); + } else { + var betas = this._getEndoRoots(this.p); + // Choose the smallest beta + beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1]; + beta = beta.toRed(this.red); + } + if (conf.lambda) { + lambda = new BN(conf.lambda, 16); + } else { + // Choose the lambda that is matching selected beta + var lambdas = this._getEndoRoots(this.n); + if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) { + lambda = lambdas[0]; + } else { + lambda = lambdas[1]; + assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0); + } + } + + // Get basis vectors, used for balanced length-two representation + var basis; + if (conf.basis) { + basis = conf.basis.map(function(vec) { + return { + a: new BN(vec.a, 16), + b: new BN(vec.b, 16) + }; + }); + } else { + basis = this._getEndoBasis(lambda); + } + + return { + beta: beta, + lambda: lambda, + basis: basis + }; +}; + +ShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) { + // Find roots of for x^2 + x + 1 in F + // Root = (-1 +- Sqrt(-3)) / 2 + // + var red = num === this.p ? this.red : BN.mont(num); + var tinv = new BN(2).toRed(red).redInvm(); + var ntinv = tinv.redNeg(); + + var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv); + + var l1 = ntinv.redAdd(s).fromRed(); + var l2 = ntinv.redSub(s).fromRed(); + return [ l1, l2 ]; +}; + +ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) { + // aprxSqrt >= sqrt(this.n) + var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2)); + + // 3.74 + // Run EGCD, until r(L + 1) < aprxSqrt + var u = lambda; + var v = this.n.clone(); + var x1 = new BN(1); + var y1 = new BN(0); + var x2 = new BN(0); + var y2 = new BN(1); + + // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n) + var a0; + var b0; + // First vector + var a1; + var b1; + // Second vector + var a2; + var b2; + + var prevR; + var i = 0; + var r; + var x; + while (u.cmpn(0) !== 0) { + var q = v.div(u); + r = v.sub(q.mul(u)); + x = x2.sub(q.mul(x1)); + var y = y2.sub(q.mul(y1)); + + if (!a1 && r.cmp(aprxSqrt) < 0) { + a0 = prevR.neg(); + b0 = x1; + a1 = r.neg(); + b1 = x; + } else if (a1 && ++i === 2) { + break; + } + prevR = r; + + v = u; + u = r; + x2 = x1; + x1 = x; + y2 = y1; + y1 = y; + } + a2 = r.neg(); + b2 = x; + + var len1 = a1.sqr().add(b1.sqr()); + var len2 = a2.sqr().add(b2.sqr()); + if (len2.cmp(len1) >= 0) { + a2 = a0; + b2 = b0; + } + + // Normalize signs + if (a1.negative) { + a1 = a1.neg(); + b1 = b1.neg(); + } + if (a2.negative) { + a2 = a2.neg(); + b2 = b2.neg(); + } + + return [ + { a: a1, b: b1 }, + { a: a2, b: b2 } + ]; +}; + +ShortCurve.prototype._endoSplit = function _endoSplit(k) { + var basis = this.endo.basis; + var v1 = basis[0]; + var v2 = basis[1]; + + var c1 = v2.b.mul(k).divRound(this.n); + var c2 = v1.b.neg().mul(k).divRound(this.n); + + var p1 = c1.mul(v1.a); + var p2 = c2.mul(v2.a); + var q1 = c1.mul(v1.b); + var q2 = c2.mul(v2.b); + + // Calculate answer + var k1 = k.sub(p1).sub(p2); + var k2 = q1.add(q2).neg(); + return { k1: k1, k2: k2 }; +}; + +ShortCurve.prototype.pointFromX = function pointFromX(x, odd) { + x = new BN(x, 16); + if (!x.red) + x = x.toRed(this.red); + + var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b); + var y = y2.redSqrt(); + if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) + throw new Error('invalid point'); + + // XXX Is there any way to tell if the number is odd without converting it + // to non-red form? + var isOdd = y.fromRed().isOdd(); + if (odd && !isOdd || !odd && isOdd) + y = y.redNeg(); + + return this.point(x, y); +}; + +ShortCurve.prototype.validate = function validate(point) { + if (point.inf) + return true; + + var x = point.x; + var y = point.y; + + var ax = this.a.redMul(x); + var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b); + return y.redSqr().redISub(rhs).cmpn(0) === 0; +}; + +ShortCurve.prototype._endoWnafMulAdd = + function _endoWnafMulAdd(points, coeffs, jacobianResult) { + var npoints = this._endoWnafT1; + var ncoeffs = this._endoWnafT2; + for (var i = 0; i < points.length; i++) { + var split = this._endoSplit(coeffs[i]); + var p = points[i]; + var beta = p._getBeta(); + + if (split.k1.negative) { + split.k1.ineg(); + p = p.neg(true); + } + if (split.k2.negative) { + split.k2.ineg(); + beta = beta.neg(true); + } + + npoints[i * 2] = p; + npoints[i * 2 + 1] = beta; + ncoeffs[i * 2] = split.k1; + ncoeffs[i * 2 + 1] = split.k2; + } + var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult); + + // Clean-up references to points and coefficients + for (var j = 0; j < i * 2; j++) { + npoints[j] = null; + ncoeffs[j] = null; + } + return res; +}; + +function Point(curve, x, y, isRed) { + Base.BasePoint.call(this, curve, 'affine'); + if (x === null && y === null) { + this.x = null; + this.y = null; + this.inf = true; + } else { + this.x = new BN(x, 16); + this.y = new BN(y, 16); + // Force redgomery representation when loading from JSON + if (isRed) { + this.x.forceRed(this.curve.red); + this.y.forceRed(this.curve.red); + } + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + this.inf = false; + } +} +inherits(Point, Base.BasePoint); + +ShortCurve.prototype.point = function point(x, y, isRed) { + return new Point(this, x, y, isRed); +}; + +ShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) { + return Point.fromJSON(this, obj, red); +}; + +Point.prototype._getBeta = function _getBeta() { + if (!this.curve.endo) + return; + + var pre = this.precomputed; + if (pre && pre.beta) + return pre.beta; + + var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y); + if (pre) { + var curve = this.curve; + var endoMul = function(p) { + return curve.point(p.x.redMul(curve.endo.beta), p.y); + }; + pre.beta = beta; + beta.precomputed = { + beta: null, + naf: pre.naf && { + wnd: pre.naf.wnd, + points: pre.naf.points.map(endoMul) + }, + doubles: pre.doubles && { + step: pre.doubles.step, + points: pre.doubles.points.map(endoMul) + } + }; + } + return beta; +}; + +Point.prototype.toJSON = function toJSON() { + if (!this.precomputed) + return [ this.x, this.y ]; + + return [ this.x, this.y, this.precomputed && { + doubles: this.precomputed.doubles && { + step: this.precomputed.doubles.step, + points: this.precomputed.doubles.points.slice(1) + }, + naf: this.precomputed.naf && { + wnd: this.precomputed.naf.wnd, + points: this.precomputed.naf.points.slice(1) + } + } ]; +}; + +Point.fromJSON = function fromJSON(curve, obj, red) { + if (typeof obj === 'string') + obj = JSON.parse(obj); + var res = curve.point(obj[0], obj[1], red); + if (!obj[2]) + return res; + + function obj2point(obj) { + return curve.point(obj[0], obj[1], red); + } + + var pre = obj[2]; + res.precomputed = { + beta: null, + doubles: pre.doubles && { + step: pre.doubles.step, + points: [ res ].concat(pre.doubles.points.map(obj2point)) + }, + naf: pre.naf && { + wnd: pre.naf.wnd, + points: [ res ].concat(pre.naf.points.map(obj2point)) + } + }; + return res; +}; + +Point.prototype.inspect = function inspect() { + if (this.isInfinity()) + return ''; + return ''; +}; + +Point.prototype.isInfinity = function isInfinity() { + return this.inf; +}; + +Point.prototype.add = function add(p) { + // O + P = P + if (this.inf) + return p; + + // P + O = P + if (p.inf) + return this; + + // P + P = 2P + if (this.eq(p)) + return this.dbl(); + + // P + (-P) = O + if (this.neg().eq(p)) + return this.curve.point(null, null); + + // P + Q = O + if (this.x.cmp(p.x) === 0) + return this.curve.point(null, null); + + var c = this.y.redSub(p.y); + if (c.cmpn(0) !== 0) + c = c.redMul(this.x.redSub(p.x).redInvm()); + var nx = c.redSqr().redISub(this.x).redISub(p.x); + var ny = c.redMul(this.x.redSub(nx)).redISub(this.y); + return this.curve.point(nx, ny); +}; + +Point.prototype.dbl = function dbl() { + if (this.inf) + return this; + + // 2P = O + var ys1 = this.y.redAdd(this.y); + if (ys1.cmpn(0) === 0) + return this.curve.point(null, null); + + var a = this.curve.a; + + var x2 = this.x.redSqr(); + var dyinv = ys1.redInvm(); + var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv); + + var nx = c.redSqr().redISub(this.x.redAdd(this.x)); + var ny = c.redMul(this.x.redSub(nx)).redISub(this.y); + return this.curve.point(nx, ny); +}; + +Point.prototype.getX = function getX() { + return this.x.fromRed(); +}; + +Point.prototype.getY = function getY() { + return this.y.fromRed(); +}; + +Point.prototype.mul = function mul(k) { + k = new BN(k, 16); + + if (this._hasDoubles(k)) + return this.curve._fixedNafMul(this, k); + else if (this.curve.endo) + return this.curve._endoWnafMulAdd([ this ], [ k ]); + else + return this.curve._wnafMul(this, k); +}; + +Point.prototype.mulAdd = function mulAdd(k1, p2, k2) { + var points = [ this, p2 ]; + var coeffs = [ k1, k2 ]; + if (this.curve.endo) + return this.curve._endoWnafMulAdd(points, coeffs); + else + return this.curve._wnafMulAdd(1, points, coeffs, 2); +}; + +Point.prototype.jmulAdd = function jmulAdd(k1, p2, k2) { + var points = [ this, p2 ]; + var coeffs = [ k1, k2 ]; + if (this.curve.endo) + return this.curve._endoWnafMulAdd(points, coeffs, true); + else + return this.curve._wnafMulAdd(1, points, coeffs, 2, true); +}; + +Point.prototype.eq = function eq(p) { + return this === p || + this.inf === p.inf && + (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0); +}; + +Point.prototype.neg = function neg(_precompute) { + if (this.inf) + return this; + + var res = this.curve.point(this.x, this.y.redNeg()); + if (_precompute && this.precomputed) { + var pre = this.precomputed; + var negate = function(p) { + return p.neg(); + }; + res.precomputed = { + naf: pre.naf && { + wnd: pre.naf.wnd, + points: pre.naf.points.map(negate) + }, + doubles: pre.doubles && { + step: pre.doubles.step, + points: pre.doubles.points.map(negate) + } + }; + } + return res; +}; + +Point.prototype.toJ = function toJ() { + if (this.inf) + return this.curve.jpoint(null, null, null); + + var res = this.curve.jpoint(this.x, this.y, this.curve.one); + return res; +}; + +function JPoint(curve, x, y, z) { + Base.BasePoint.call(this, curve, 'jacobian'); + if (x === null && y === null && z === null) { + this.x = this.curve.one; + this.y = this.curve.one; + this.z = new BN(0); + } else { + this.x = new BN(x, 16); + this.y = new BN(y, 16); + this.z = new BN(z, 16); + } + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + + this.zOne = this.z === this.curve.one; +} +inherits(JPoint, Base.BasePoint); + +ShortCurve.prototype.jpoint = function jpoint(x, y, z) { + return new JPoint(this, x, y, z); +}; + +JPoint.prototype.toP = function toP() { + if (this.isInfinity()) + return this.curve.point(null, null); + + var zinv = this.z.redInvm(); + var zinv2 = zinv.redSqr(); + var ax = this.x.redMul(zinv2); + var ay = this.y.redMul(zinv2).redMul(zinv); + + return this.curve.point(ax, ay); +}; + +JPoint.prototype.neg = function neg() { + return this.curve.jpoint(this.x, this.y.redNeg(), this.z); +}; + +JPoint.prototype.add = function add(p) { + // O + P = P + if (this.isInfinity()) + return p; + + // P + O = P + if (p.isInfinity()) + return this; + + // 12M + 4S + 7A + var pz2 = p.z.redSqr(); + var z2 = this.z.redSqr(); + var u1 = this.x.redMul(pz2); + var u2 = p.x.redMul(z2); + var s1 = this.y.redMul(pz2.redMul(p.z)); + var s2 = p.y.redMul(z2.redMul(this.z)); + + var h = u1.redSub(u2); + var r = s1.redSub(s2); + if (h.cmpn(0) === 0) { + if (r.cmpn(0) !== 0) + return this.curve.jpoint(null, null, null); + else + return this.dbl(); + } + + var h2 = h.redSqr(); + var h3 = h2.redMul(h); + var v = u1.redMul(h2); + + var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v); + var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)); + var nz = this.z.redMul(p.z).redMul(h); + + return this.curve.jpoint(nx, ny, nz); +}; + +JPoint.prototype.mixedAdd = function mixedAdd(p) { + // O + P = P + if (this.isInfinity()) + return p.toJ(); + + // P + O = P + if (p.isInfinity()) + return this; + + // 8M + 3S + 7A + var z2 = this.z.redSqr(); + var u1 = this.x; + var u2 = p.x.redMul(z2); + var s1 = this.y; + var s2 = p.y.redMul(z2).redMul(this.z); + + var h = u1.redSub(u2); + var r = s1.redSub(s2); + if (h.cmpn(0) === 0) { + if (r.cmpn(0) !== 0) + return this.curve.jpoint(null, null, null); + else + return this.dbl(); + } + + var h2 = h.redSqr(); + var h3 = h2.redMul(h); + var v = u1.redMul(h2); + + var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v); + var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)); + var nz = this.z.redMul(h); + + return this.curve.jpoint(nx, ny, nz); +}; + +JPoint.prototype.dblp = function dblp(pow) { + if (pow === 0) + return this; + if (this.isInfinity()) + return this; + if (!pow) + return this.dbl(); + + if (this.curve.zeroA || this.curve.threeA) { + var r = this; + for (var i = 0; i < pow; i++) + r = r.dbl(); + return r; + } + + // 1M + 2S + 1A + N * (4S + 5M + 8A) + // N = 1 => 6M + 6S + 9A + var a = this.curve.a; + var tinv = this.curve.tinv; + + var jx = this.x; + var jy = this.y; + var jz = this.z; + var jz4 = jz.redSqr().redSqr(); + + // Reuse results + var jyd = jy.redAdd(jy); + for (var i = 0; i < pow; i++) { + var jx2 = jx.redSqr(); + var jyd2 = jyd.redSqr(); + var jyd4 = jyd2.redSqr(); + var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)); + + var t1 = jx.redMul(jyd2); + var nx = c.redSqr().redISub(t1.redAdd(t1)); + var t2 = t1.redISub(nx); + var dny = c.redMul(t2); + dny = dny.redIAdd(dny).redISub(jyd4); + var nz = jyd.redMul(jz); + if (i + 1 < pow) + jz4 = jz4.redMul(jyd4); + + jx = nx; + jz = nz; + jyd = dny; + } + + return this.curve.jpoint(jx, jyd.redMul(tinv), jz); +}; + +JPoint.prototype.dbl = function dbl() { + if (this.isInfinity()) + return this; + + if (this.curve.zeroA) + return this._zeroDbl(); + else if (this.curve.threeA) + return this._threeDbl(); + else + return this._dbl(); +}; + +JPoint.prototype._zeroDbl = function _zeroDbl() { + var nx; + var ny; + var nz; + // Z = 1 + if (this.zOne) { + // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html + // #doubling-mdbl-2007-bl + // 1M + 5S + 14A + + // XX = X1^2 + var xx = this.x.redSqr(); + // YY = Y1^2 + var yy = this.y.redSqr(); + // YYYY = YY^2 + var yyyy = yy.redSqr(); + // S = 2 * ((X1 + YY)^2 - XX - YYYY) + var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + s = s.redIAdd(s); + // M = 3 * XX + a; a = 0 + var m = xx.redAdd(xx).redIAdd(xx); + // T = M ^ 2 - 2*S + var t = m.redSqr().redISub(s).redISub(s); + + // 8 * YYYY + var yyyy8 = yyyy.redIAdd(yyyy); + yyyy8 = yyyy8.redIAdd(yyyy8); + yyyy8 = yyyy8.redIAdd(yyyy8); + + // X3 = T + nx = t; + // Y3 = M * (S - T) - 8 * YYYY + ny = m.redMul(s.redISub(t)).redISub(yyyy8); + // Z3 = 2*Y1 + nz = this.y.redAdd(this.y); + } else { + // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html + // #doubling-dbl-2009-l + // 2M + 5S + 13A + + // A = X1^2 + var a = this.x.redSqr(); + // B = Y1^2 + var b = this.y.redSqr(); + // C = B^2 + var c = b.redSqr(); + // D = 2 * ((X1 + B)^2 - A - C) + var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c); + d = d.redIAdd(d); + // E = 3 * A + var e = a.redAdd(a).redIAdd(a); + // F = E^2 + var f = e.redSqr(); + + // 8 * C + var c8 = c.redIAdd(c); + c8 = c8.redIAdd(c8); + c8 = c8.redIAdd(c8); + + // X3 = F - 2 * D + nx = f.redISub(d).redISub(d); + // Y3 = E * (D - X3) - 8 * C + ny = e.redMul(d.redISub(nx)).redISub(c8); + // Z3 = 2 * Y1 * Z1 + nz = this.y.redMul(this.z); + nz = nz.redIAdd(nz); + } + + return this.curve.jpoint(nx, ny, nz); +}; + +JPoint.prototype._threeDbl = function _threeDbl() { + var nx; + var ny; + var nz; + // Z = 1 + if (this.zOne) { + // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html + // #doubling-mdbl-2007-bl + // 1M + 5S + 15A + + // XX = X1^2 + var xx = this.x.redSqr(); + // YY = Y1^2 + var yy = this.y.redSqr(); + // YYYY = YY^2 + var yyyy = yy.redSqr(); + // S = 2 * ((X1 + YY)^2 - XX - YYYY) + var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + s = s.redIAdd(s); + // M = 3 * XX + a + var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a); + // T = M^2 - 2 * S + var t = m.redSqr().redISub(s).redISub(s); + // X3 = T + nx = t; + // Y3 = M * (S - T) - 8 * YYYY + var yyyy8 = yyyy.redIAdd(yyyy); + yyyy8 = yyyy8.redIAdd(yyyy8); + yyyy8 = yyyy8.redIAdd(yyyy8); + ny = m.redMul(s.redISub(t)).redISub(yyyy8); + // Z3 = 2 * Y1 + nz = this.y.redAdd(this.y); + } else { + // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b + // 3M + 5S + + // delta = Z1^2 + var delta = this.z.redSqr(); + // gamma = Y1^2 + var gamma = this.y.redSqr(); + // beta = X1 * gamma + var beta = this.x.redMul(gamma); + // alpha = 3 * (X1 - delta) * (X1 + delta) + var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta)); + alpha = alpha.redAdd(alpha).redIAdd(alpha); + // X3 = alpha^2 - 8 * beta + var beta4 = beta.redIAdd(beta); + beta4 = beta4.redIAdd(beta4); + var beta8 = beta4.redAdd(beta4); + nx = alpha.redSqr().redISub(beta8); + // Z3 = (Y1 + Z1)^2 - gamma - delta + nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta); + // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2 + var ggamma8 = gamma.redSqr(); + ggamma8 = ggamma8.redIAdd(ggamma8); + ggamma8 = ggamma8.redIAdd(ggamma8); + ggamma8 = ggamma8.redIAdd(ggamma8); + ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8); + } + + return this.curve.jpoint(nx, ny, nz); +}; + +JPoint.prototype._dbl = function _dbl() { + var a = this.curve.a; + + // 4M + 6S + 10A + var jx = this.x; + var jy = this.y; + var jz = this.z; + var jz4 = jz.redSqr().redSqr(); + + var jx2 = jx.redSqr(); + var jy2 = jy.redSqr(); + + var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)); + + var jxd4 = jx.redAdd(jx); + jxd4 = jxd4.redIAdd(jxd4); + var t1 = jxd4.redMul(jy2); + var nx = c.redSqr().redISub(t1.redAdd(t1)); + var t2 = t1.redISub(nx); + + var jyd8 = jy2.redSqr(); + jyd8 = jyd8.redIAdd(jyd8); + jyd8 = jyd8.redIAdd(jyd8); + jyd8 = jyd8.redIAdd(jyd8); + var ny = c.redMul(t2).redISub(jyd8); + var nz = jy.redAdd(jy).redMul(jz); + + return this.curve.jpoint(nx, ny, nz); +}; + +JPoint.prototype.trpl = function trpl() { + if (!this.curve.zeroA) + return this.dbl().add(this); + + // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl + // 5M + 10S + ... + + // XX = X1^2 + var xx = this.x.redSqr(); + // YY = Y1^2 + var yy = this.y.redSqr(); + // ZZ = Z1^2 + var zz = this.z.redSqr(); + // YYYY = YY^2 + var yyyy = yy.redSqr(); + // M = 3 * XX + a * ZZ2; a = 0 + var m = xx.redAdd(xx).redIAdd(xx); + // MM = M^2 + var mm = m.redSqr(); + // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM + var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + e = e.redIAdd(e); + e = e.redAdd(e).redIAdd(e); + e = e.redISub(mm); + // EE = E^2 + var ee = e.redSqr(); + // T = 16*YYYY + var t = yyyy.redIAdd(yyyy); + t = t.redIAdd(t); + t = t.redIAdd(t); + t = t.redIAdd(t); + // U = (M + E)^2 - MM - EE - T + var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t); + // X3 = 4 * (X1 * EE - 4 * YY * U) + var yyu4 = yy.redMul(u); + yyu4 = yyu4.redIAdd(yyu4); + yyu4 = yyu4.redIAdd(yyu4); + var nx = this.x.redMul(ee).redISub(yyu4); + nx = nx.redIAdd(nx); + nx = nx.redIAdd(nx); + // Y3 = 8 * Y1 * (U * (T - U) - E * EE) + var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee))); + ny = ny.redIAdd(ny); + ny = ny.redIAdd(ny); + ny = ny.redIAdd(ny); + // Z3 = (Z1 + E)^2 - ZZ - EE + var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee); + + return this.curve.jpoint(nx, ny, nz); +}; + +JPoint.prototype.mul = function mul(k, kbase) { + k = new BN(k, kbase); + + return this.curve._wnafMul(this, k); +}; + +JPoint.prototype.eq = function eq(p) { + if (p.type === 'affine') + return this.eq(p.toJ()); + + if (this === p) + return true; + + // x1 * z2^2 == x2 * z1^2 + var z2 = this.z.redSqr(); + var pz2 = p.z.redSqr(); + if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0) + return false; + + // y1 * z2^3 == y2 * z1^3 + var z3 = z2.redMul(this.z); + var pz3 = pz2.redMul(p.z); + return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0; +}; + +JPoint.prototype.eqXToP = function eqXToP(x) { + var zs = this.z.redSqr(); + var rx = x.toRed(this.curve.red).redMul(zs); + if (this.x.cmp(rx) === 0) + return true; + + var xc = x.clone(); + var t = this.curve.redN.redMul(zs); + for (;;) { + xc.iadd(this.curve.n); + if (xc.cmp(this.curve.p) >= 0) + return false; + + rx.redIAdd(t); + if (this.x.cmp(rx) === 0) + return true; + } +}; + +JPoint.prototype.inspect = function inspect() { + if (this.isInfinity()) + return ''; + return ''; +}; + +JPoint.prototype.isInfinity = function isInfinity() { + // XXX This code assumes that zero is always zero in red + return this.z.cmpn(0) === 0; +}; diff --git a/node_modules/elliptic/lib/elliptic/curves.js b/node_modules/elliptic/lib/elliptic/curves.js new file mode 100644 index 000000000..0614c0073 --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/curves.js @@ -0,0 +1,205 @@ +'use strict'; + +var curves = exports; + +var hash = require('hash.js'); +var elliptic = require('../elliptic'); + +var assert = elliptic.utils.assert; + +function PresetCurve(options) { + if (options.type === 'short') + this.curve = new elliptic.curve.short(options); + else if (options.type === 'edwards') + this.curve = new elliptic.curve.edwards(options); + else + this.curve = new elliptic.curve.mont(options); + this.g = this.curve.g; + this.n = this.curve.n; + this.hash = options.hash; + + assert(this.g.validate(), 'Invalid curve'); + assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O'); +} +curves.PresetCurve = PresetCurve; + +function defineCurve(name, options) { + Object.defineProperty(curves, name, { + configurable: true, + enumerable: true, + get: function() { + var curve = new PresetCurve(options); + Object.defineProperty(curves, name, { + configurable: true, + enumerable: true, + value: curve + }); + return curve; + } + }); +} + +defineCurve('p192', { + type: 'short', + prime: 'p192', + p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff', + a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc', + b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1', + n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831', + hash: hash.sha256, + gRed: false, + g: [ + '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012', + '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811' + ] +}); + +defineCurve('p224', { + type: 'short', + prime: 'p224', + p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001', + a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe', + b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4', + n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d', + hash: hash.sha256, + gRed: false, + g: [ + 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21', + 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34' + ] +}); + +defineCurve('p256', { + type: 'short', + prime: null, + p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff', + a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc', + b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b', + n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551', + hash: hash.sha256, + gRed: false, + g: [ + '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296', + '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5' + ] +}); + +defineCurve('p384', { + type: 'short', + prime: null, + p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + + 'fffffffe ffffffff 00000000 00000000 ffffffff', + a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + + 'fffffffe ffffffff 00000000 00000000 fffffffc', + b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' + + '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef', + n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' + + 'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973', + hash: hash.sha384, + gRed: false, + g: [ + 'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' + + '5502f25d bf55296c 3a545e38 72760ab7', + '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' + + '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f' + ] +}); + +defineCurve('p521', { + type: 'short', + prime: null, + p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + + 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + + 'ffffffff ffffffff ffffffff ffffffff ffffffff', + a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + + 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + + 'ffffffff ffffffff ffffffff ffffffff fffffffc', + b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' + + '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' + + '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00', + n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + + 'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' + + 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409', + hash: hash.sha512, + gRed: false, + g: [ + '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' + + '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' + + 'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66', + '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' + + '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' + + '3fad0761 353c7086 a272c240 88be9476 9fd16650' + ] +}); + +defineCurve('curve25519', { + type: 'mont', + prime: 'p25519', + p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed', + a: '76d06', + b: '1', + n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed', + hash: hash.sha256, + gRed: false, + g: [ + '9' + ] +}); + +defineCurve('ed25519', { + type: 'edwards', + prime: 'p25519', + p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed', + a: '-1', + c: '1', + // -121665 * (121666^(-1)) (mod P) + d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3', + n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed', + hash: hash.sha256, + gRed: false, + g: [ + '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a', + + // 4/5 + '6666666666666666666666666666666666666666666666666666666666666658' + ] +}); + +var pre; +try { + pre = require('./precomputed/secp256k1'); +} catch (e) { + pre = undefined; +} + +defineCurve('secp256k1', { + type: 'short', + prime: 'k256', + p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f', + a: '0', + b: '7', + n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141', + h: '1', + hash: hash.sha256, + + // Precomputed endomorphism + beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee', + lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72', + basis: [ + { + a: '3086d221a7d46bcde86c90e49284eb15', + b: '-e4437ed6010e88286f547fa90abfe4c3' + }, + { + a: '114ca50f7a8e2f3f657c1108d9d44cfd8', + b: '3086d221a7d46bcde86c90e49284eb15' + } + ], + + gRed: false, + g: [ + '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', + '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8', + pre + ] +}); diff --git a/node_modules/elliptic/lib/elliptic/ec/index.js b/node_modules/elliptic/lib/elliptic/ec/index.js new file mode 100644 index 000000000..012fa771e --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/ec/index.js @@ -0,0 +1,240 @@ +'use strict'; + +var BN = require('bn.js'); +var HmacDRBG = require('hmac-drbg'); +var elliptic = require('../../elliptic'); +var utils = elliptic.utils; +var assert = utils.assert; + +var KeyPair = require('./key'); +var Signature = require('./signature'); + +function EC(options) { + if (!(this instanceof EC)) + return new EC(options); + + // Shortcut `elliptic.ec(curve-name)` + if (typeof options === 'string') { + assert(elliptic.curves.hasOwnProperty(options), 'Unknown curve ' + options); + + options = elliptic.curves[options]; + } + + // Shortcut for `elliptic.ec(elliptic.curves.curveName)` + if (options instanceof elliptic.curves.PresetCurve) + options = { curve: options }; + + this.curve = options.curve.curve; + this.n = this.curve.n; + this.nh = this.n.ushrn(1); + this.g = this.curve.g; + + // Point on curve + this.g = options.curve.g; + this.g.precompute(options.curve.n.bitLength() + 1); + + // Hash for function for DRBG + this.hash = options.hash || options.curve.hash; +} +module.exports = EC; + +EC.prototype.keyPair = function keyPair(options) { + return new KeyPair(this, options); +}; + +EC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) { + return KeyPair.fromPrivate(this, priv, enc); +}; + +EC.prototype.keyFromPublic = function keyFromPublic(pub, enc) { + return KeyPair.fromPublic(this, pub, enc); +}; + +EC.prototype.genKeyPair = function genKeyPair(options) { + if (!options) + options = {}; + + // Instantiate Hmac_DRBG + var drbg = new HmacDRBG({ + hash: this.hash, + pers: options.pers, + persEnc: options.persEnc || 'utf8', + entropy: options.entropy || elliptic.rand(this.hash.hmacStrength), + entropyEnc: options.entropy && options.entropyEnc || 'utf8', + nonce: this.n.toArray() + }); + + var bytes = this.n.byteLength(); + var ns2 = this.n.sub(new BN(2)); + do { + var priv = new BN(drbg.generate(bytes)); + if (priv.cmp(ns2) > 0) + continue; + + priv.iaddn(1); + return this.keyFromPrivate(priv); + } while (true); +}; + +EC.prototype._truncateToN = function truncateToN(msg, truncOnly) { + var delta = msg.byteLength() * 8 - this.n.bitLength(); + if (delta > 0) + msg = msg.ushrn(delta); + if (!truncOnly && msg.cmp(this.n) >= 0) + return msg.sub(this.n); + else + return msg; +}; + +EC.prototype.sign = function sign(msg, key, enc, options) { + if (typeof enc === 'object') { + options = enc; + enc = null; + } + if (!options) + options = {}; + + key = this.keyFromPrivate(key, enc); + msg = this._truncateToN(new BN(msg, 16)); + + // Zero-extend key to provide enough entropy + var bytes = this.n.byteLength(); + var bkey = key.getPrivate().toArray('be', bytes); + + // Zero-extend nonce to have the same byte size as N + var nonce = msg.toArray('be', bytes); + + // Instantiate Hmac_DRBG + var drbg = new HmacDRBG({ + hash: this.hash, + entropy: bkey, + nonce: nonce, + pers: options.pers, + persEnc: options.persEnc || 'utf8' + }); + + // Number of bytes to generate + var ns1 = this.n.sub(new BN(1)); + + for (var iter = 0; true; iter++) { + var k = options.k ? + options.k(iter) : + new BN(drbg.generate(this.n.byteLength())); + k = this._truncateToN(k, true); + if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0) + continue; + + var kp = this.g.mul(k); + if (kp.isInfinity()) + continue; + + var kpX = kp.getX(); + var r = kpX.umod(this.n); + if (r.cmpn(0) === 0) + continue; + + var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg)); + s = s.umod(this.n); + if (s.cmpn(0) === 0) + continue; + + var recoveryParam = (kp.getY().isOdd() ? 1 : 0) | + (kpX.cmp(r) !== 0 ? 2 : 0); + + // Use complement of `s`, if it is > `n / 2` + if (options.canonical && s.cmp(this.nh) > 0) { + s = this.n.sub(s); + recoveryParam ^= 1; + } + + return new Signature({ r: r, s: s, recoveryParam: recoveryParam }); + } +}; + +EC.prototype.verify = function verify(msg, signature, key, enc) { + msg = this._truncateToN(new BN(msg, 16)); + key = this.keyFromPublic(key, enc); + signature = new Signature(signature, 'hex'); + + // Perform primitive values validation + var r = signature.r; + var s = signature.s; + if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0) + return false; + if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0) + return false; + + // Validate signature + var sinv = s.invm(this.n); + var u1 = sinv.mul(msg).umod(this.n); + var u2 = sinv.mul(r).umod(this.n); + + if (!this.curve._maxwellTrick) { + var p = this.g.mulAdd(u1, key.getPublic(), u2); + if (p.isInfinity()) + return false; + + return p.getX().umod(this.n).cmp(r) === 0; + } + + // NOTE: Greg Maxwell's trick, inspired by: + // https://git.io/vad3K + + var p = this.g.jmulAdd(u1, key.getPublic(), u2); + if (p.isInfinity()) + return false; + + // Compare `p.x` of Jacobian point with `r`, + // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the + // inverse of `p.z^2` + return p.eqXToP(r); +}; + +EC.prototype.recoverPubKey = function(msg, signature, j, enc) { + assert((3 & j) === j, 'The recovery param is more than two bits'); + signature = new Signature(signature, enc); + + var n = this.n; + var e = new BN(msg); + var r = signature.r; + var s = signature.s; + + // A set LSB signifies that the y-coordinate is odd + var isYOdd = j & 1; + var isSecondKey = j >> 1; + if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey) + throw new Error('Unable to find sencond key candinate'); + + // 1.1. Let x = r + jn. + if (isSecondKey) + r = this.curve.pointFromX(r.add(this.curve.n), isYOdd); + else + r = this.curve.pointFromX(r, isYOdd); + + var rInv = signature.r.invm(n); + var s1 = n.sub(e).mul(rInv).umod(n); + var s2 = s.mul(rInv).umod(n); + + // 1.6.1 Compute Q = r^-1 (sR - eG) + // Q = r^-1 (sR + -eG) + return this.g.mulAdd(s1, r, s2); +}; + +EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) { + signature = new Signature(signature, enc); + if (signature.recoveryParam !== null) + return signature.recoveryParam; + + for (var i = 0; i < 4; i++) { + var Qprime; + try { + Qprime = this.recoverPubKey(e, signature, i); + } catch (e) { + continue; + } + + if (Qprime.eq(Q)) + return i; + } + throw new Error('Unable to find valid recovery factor'); +}; diff --git a/node_modules/elliptic/lib/elliptic/ec/key.js b/node_modules/elliptic/lib/elliptic/ec/key.js new file mode 100644 index 000000000..e0f448326 --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/ec/key.js @@ -0,0 +1,119 @@ +'use strict'; + +var BN = require('bn.js'); +var elliptic = require('../../elliptic'); +var utils = elliptic.utils; +var assert = utils.assert; + +function KeyPair(ec, options) { + this.ec = ec; + this.priv = null; + this.pub = null; + + // KeyPair(ec, { priv: ..., pub: ... }) + if (options.priv) + this._importPrivate(options.priv, options.privEnc); + if (options.pub) + this._importPublic(options.pub, options.pubEnc); +} +module.exports = KeyPair; + +KeyPair.fromPublic = function fromPublic(ec, pub, enc) { + if (pub instanceof KeyPair) + return pub; + + return new KeyPair(ec, { + pub: pub, + pubEnc: enc + }); +}; + +KeyPair.fromPrivate = function fromPrivate(ec, priv, enc) { + if (priv instanceof KeyPair) + return priv; + + return new KeyPair(ec, { + priv: priv, + privEnc: enc + }); +}; + +KeyPair.prototype.validate = function validate() { + var pub = this.getPublic(); + + if (pub.isInfinity()) + return { result: false, reason: 'Invalid public key' }; + if (!pub.validate()) + return { result: false, reason: 'Public key is not a point' }; + if (!pub.mul(this.ec.curve.n).isInfinity()) + return { result: false, reason: 'Public key * N != O' }; + + return { result: true, reason: null }; +}; + +KeyPair.prototype.getPublic = function getPublic(compact, enc) { + // compact is optional argument + if (typeof compact === 'string') { + enc = compact; + compact = null; + } + + if (!this.pub) + this.pub = this.ec.g.mul(this.priv); + + if (!enc) + return this.pub; + + return this.pub.encode(enc, compact); +}; + +KeyPair.prototype.getPrivate = function getPrivate(enc) { + if (enc === 'hex') + return this.priv.toString(16, 2); + else + return this.priv; +}; + +KeyPair.prototype._importPrivate = function _importPrivate(key, enc) { + this.priv = new BN(key, enc || 16); + + // Ensure that the priv won't be bigger than n, otherwise we may fail + // in fixed multiplication method + this.priv = this.priv.umod(this.ec.curve.n); +}; + +KeyPair.prototype._importPublic = function _importPublic(key, enc) { + if (key.x || key.y) { + // Montgomery points only have an `x` coordinate. + // Weierstrass/Edwards points on the other hand have both `x` and + // `y` coordinates. + if (this.ec.curve.type === 'mont') { + assert(key.x, 'Need x coordinate'); + } else if (this.ec.curve.type === 'short' || + this.ec.curve.type === 'edwards') { + assert(key.x && key.y, 'Need both x and y coordinate'); + } + this.pub = this.ec.curve.point(key.x, key.y); + return; + } + this.pub = this.ec.curve.decodePoint(key, enc); +}; + +// ECDH +KeyPair.prototype.derive = function derive(pub) { + return pub.mul(this.priv).getX(); +}; + +// ECDSA +KeyPair.prototype.sign = function sign(msg, enc, options) { + return this.ec.sign(msg, this, enc, options); +}; + +KeyPair.prototype.verify = function verify(msg, signature) { + return this.ec.verify(msg, signature, this); +}; + +KeyPair.prototype.inspect = function inspect() { + return ''; +}; diff --git a/node_modules/elliptic/lib/elliptic/ec/signature.js b/node_modules/elliptic/lib/elliptic/ec/signature.js new file mode 100644 index 000000000..165b179a8 --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/ec/signature.js @@ -0,0 +1,135 @@ +'use strict'; + +var BN = require('bn.js'); + +var elliptic = require('../../elliptic'); +var utils = elliptic.utils; +var assert = utils.assert; + +function Signature(options, enc) { + if (options instanceof Signature) + return options; + + if (this._importDER(options, enc)) + return; + + assert(options.r && options.s, 'Signature without r or s'); + this.r = new BN(options.r, 16); + this.s = new BN(options.s, 16); + if (options.recoveryParam === undefined) + this.recoveryParam = null; + else + this.recoveryParam = options.recoveryParam; +} +module.exports = Signature; + +function Position() { + this.place = 0; +} + +function getLength(buf, p) { + var initial = buf[p.place++]; + if (!(initial & 0x80)) { + return initial; + } + var octetLen = initial & 0xf; + var val = 0; + for (var i = 0, off = p.place; i < octetLen; i++, off++) { + val <<= 8; + val |= buf[off]; + } + p.place = off; + return val; +} + +function rmPadding(buf) { + var i = 0; + var len = buf.length - 1; + while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) { + i++; + } + if (i === 0) { + return buf; + } + return buf.slice(i); +} + +Signature.prototype._importDER = function _importDER(data, enc) { + data = utils.toArray(data, enc); + var p = new Position(); + if (data[p.place++] !== 0x30) { + return false; + } + var len = getLength(data, p); + if ((len + p.place) !== data.length) { + return false; + } + if (data[p.place++] !== 0x02) { + return false; + } + var rlen = getLength(data, p); + var r = data.slice(p.place, rlen + p.place); + p.place += rlen; + if (data[p.place++] !== 0x02) { + return false; + } + var slen = getLength(data, p); + if (data.length !== slen + p.place) { + return false; + } + var s = data.slice(p.place, slen + p.place); + if (r[0] === 0 && (r[1] & 0x80)) { + r = r.slice(1); + } + if (s[0] === 0 && (s[1] & 0x80)) { + s = s.slice(1); + } + + this.r = new BN(r); + this.s = new BN(s); + this.recoveryParam = null; + + return true; +}; + +function constructLength(arr, len) { + if (len < 0x80) { + arr.push(len); + return; + } + var octets = 1 + (Math.log(len) / Math.LN2 >>> 3); + arr.push(octets | 0x80); + while (--octets) { + arr.push((len >>> (octets << 3)) & 0xff); + } + arr.push(len); +} + +Signature.prototype.toDER = function toDER(enc) { + var r = this.r.toArray(); + var s = this.s.toArray(); + + // Pad values + if (r[0] & 0x80) + r = [ 0 ].concat(r); + // Pad values + if (s[0] & 0x80) + s = [ 0 ].concat(s); + + r = rmPadding(r); + s = rmPadding(s); + + while (!s[0] && !(s[1] & 0x80)) { + s = s.slice(1); + } + var arr = [ 0x02 ]; + constructLength(arr, r.length); + arr = arr.concat(r); + arr.push(0x02); + constructLength(arr, s.length); + var backHalf = arr.concat(s); + var res = [ 0x30 ]; + constructLength(res, backHalf.length); + res = res.concat(backHalf); + return utils.encode(res, enc); +}; diff --git a/node_modules/elliptic/lib/elliptic/eddsa/index.js b/node_modules/elliptic/lib/elliptic/eddsa/index.js new file mode 100644 index 000000000..b218a1607 --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/eddsa/index.js @@ -0,0 +1,118 @@ +'use strict'; + +var hash = require('hash.js'); +var elliptic = require('../../elliptic'); +var utils = elliptic.utils; +var assert = utils.assert; +var parseBytes = utils.parseBytes; +var KeyPair = require('./key'); +var Signature = require('./signature'); + +function EDDSA(curve) { + assert(curve === 'ed25519', 'only tested with ed25519 so far'); + + if (!(this instanceof EDDSA)) + return new EDDSA(curve); + + var curve = elliptic.curves[curve].curve; + this.curve = curve; + this.g = curve.g; + this.g.precompute(curve.n.bitLength() + 1); + + this.pointClass = curve.point().constructor; + this.encodingLength = Math.ceil(curve.n.bitLength() / 8); + this.hash = hash.sha512; +} + +module.exports = EDDSA; + +/** +* @param {Array|String} message - message bytes +* @param {Array|String|KeyPair} secret - secret bytes or a keypair +* @returns {Signature} - signature +*/ +EDDSA.prototype.sign = function sign(message, secret) { + message = parseBytes(message); + var key = this.keyFromSecret(secret); + var r = this.hashInt(key.messagePrefix(), message); + var R = this.g.mul(r); + var Rencoded = this.encodePoint(R); + var s_ = this.hashInt(Rencoded, key.pubBytes(), message) + .mul(key.priv()); + var S = r.add(s_).umod(this.curve.n); + return this.makeSignature({ R: R, S: S, Rencoded: Rencoded }); +}; + +/** +* @param {Array} message - message bytes +* @param {Array|String|Signature} sig - sig bytes +* @param {Array|String|Point|KeyPair} pub - public key +* @returns {Boolean} - true if public key matches sig of message +*/ +EDDSA.prototype.verify = function verify(message, sig, pub) { + message = parseBytes(message); + sig = this.makeSignature(sig); + var key = this.keyFromPublic(pub); + var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message); + var SG = this.g.mul(sig.S()); + var RplusAh = sig.R().add(key.pub().mul(h)); + return RplusAh.eq(SG); +}; + +EDDSA.prototype.hashInt = function hashInt() { + var hash = this.hash(); + for (var i = 0; i < arguments.length; i++) + hash.update(arguments[i]); + return utils.intFromLE(hash.digest()).umod(this.curve.n); +}; + +EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) { + return KeyPair.fromPublic(this, pub); +}; + +EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) { + return KeyPair.fromSecret(this, secret); +}; + +EDDSA.prototype.makeSignature = function makeSignature(sig) { + if (sig instanceof Signature) + return sig; + return new Signature(this, sig); +}; + +/** +* * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2 +* +* EDDSA defines methods for encoding and decoding points and integers. These are +* helper convenience methods, that pass along to utility functions implied +* parameters. +* +*/ +EDDSA.prototype.encodePoint = function encodePoint(point) { + var enc = point.getY().toArray('le', this.encodingLength); + enc[this.encodingLength - 1] |= point.getX().isOdd() ? 0x80 : 0; + return enc; +}; + +EDDSA.prototype.decodePoint = function decodePoint(bytes) { + bytes = utils.parseBytes(bytes); + + var lastIx = bytes.length - 1; + var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80); + var xIsOdd = (bytes[lastIx] & 0x80) !== 0; + + var y = utils.intFromLE(normed); + return this.curve.pointFromY(y, xIsOdd); +}; + +EDDSA.prototype.encodeInt = function encodeInt(num) { + return num.toArray('le', this.encodingLength); +}; + +EDDSA.prototype.decodeInt = function decodeInt(bytes) { + return utils.intFromLE(bytes); +}; + +EDDSA.prototype.isPoint = function isPoint(val) { + return val instanceof this.pointClass; +}; diff --git a/node_modules/elliptic/lib/elliptic/eddsa/key.js b/node_modules/elliptic/lib/elliptic/eddsa/key.js new file mode 100644 index 000000000..5d5e14274 --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/eddsa/key.js @@ -0,0 +1,96 @@ +'use strict'; + +var elliptic = require('../../elliptic'); +var utils = elliptic.utils; +var assert = utils.assert; +var parseBytes = utils.parseBytes; +var cachedProperty = utils.cachedProperty; + +/** +* @param {EDDSA} eddsa - instance +* @param {Object} params - public/private key parameters +* +* @param {Array} [params.secret] - secret seed bytes +* @param {Point} [params.pub] - public key point (aka `A` in eddsa terms) +* @param {Array} [params.pub] - public key point encoded as bytes +* +*/ +function KeyPair(eddsa, params) { + this.eddsa = eddsa; + this._secret = parseBytes(params.secret); + if (eddsa.isPoint(params.pub)) + this._pub = params.pub; + else + this._pubBytes = parseBytes(params.pub); +} + +KeyPair.fromPublic = function fromPublic(eddsa, pub) { + if (pub instanceof KeyPair) + return pub; + return new KeyPair(eddsa, { pub: pub }); +}; + +KeyPair.fromSecret = function fromSecret(eddsa, secret) { + if (secret instanceof KeyPair) + return secret; + return new KeyPair(eddsa, { secret: secret }); +}; + +KeyPair.prototype.secret = function secret() { + return this._secret; +}; + +cachedProperty(KeyPair, 'pubBytes', function pubBytes() { + return this.eddsa.encodePoint(this.pub()); +}); + +cachedProperty(KeyPair, 'pub', function pub() { + if (this._pubBytes) + return this.eddsa.decodePoint(this._pubBytes); + return this.eddsa.g.mul(this.priv()); +}); + +cachedProperty(KeyPair, 'privBytes', function privBytes() { + var eddsa = this.eddsa; + var hash = this.hash(); + var lastIx = eddsa.encodingLength - 1; + + var a = hash.slice(0, eddsa.encodingLength); + a[0] &= 248; + a[lastIx] &= 127; + a[lastIx] |= 64; + + return a; +}); + +cachedProperty(KeyPair, 'priv', function priv() { + return this.eddsa.decodeInt(this.privBytes()); +}); + +cachedProperty(KeyPair, 'hash', function hash() { + return this.eddsa.hash().update(this.secret()).digest(); +}); + +cachedProperty(KeyPair, 'messagePrefix', function messagePrefix() { + return this.hash().slice(this.eddsa.encodingLength); +}); + +KeyPair.prototype.sign = function sign(message) { + assert(this._secret, 'KeyPair can only verify'); + return this.eddsa.sign(message, this); +}; + +KeyPair.prototype.verify = function verify(message, sig) { + return this.eddsa.verify(message, sig, this); +}; + +KeyPair.prototype.getSecret = function getSecret(enc) { + assert(this._secret, 'KeyPair is public only'); + return utils.encode(this.secret(), enc); +}; + +KeyPair.prototype.getPublic = function getPublic(enc) { + return utils.encode(this.pubBytes(), enc); +}; + +module.exports = KeyPair; diff --git a/node_modules/elliptic/lib/elliptic/eddsa/signature.js b/node_modules/elliptic/lib/elliptic/eddsa/signature.js new file mode 100644 index 000000000..e944e8152 --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/eddsa/signature.js @@ -0,0 +1,66 @@ +'use strict'; + +var BN = require('bn.js'); +var elliptic = require('../../elliptic'); +var utils = elliptic.utils; +var assert = utils.assert; +var cachedProperty = utils.cachedProperty; +var parseBytes = utils.parseBytes; + +/** +* @param {EDDSA} eddsa - eddsa instance +* @param {Array|Object} sig - +* @param {Array|Point} [sig.R] - R point as Point or bytes +* @param {Array|bn} [sig.S] - S scalar as bn or bytes +* @param {Array} [sig.Rencoded] - R point encoded +* @param {Array} [sig.Sencoded] - S scalar encoded +*/ +function Signature(eddsa, sig) { + this.eddsa = eddsa; + + if (typeof sig !== 'object') + sig = parseBytes(sig); + + if (Array.isArray(sig)) { + sig = { + R: sig.slice(0, eddsa.encodingLength), + S: sig.slice(eddsa.encodingLength) + }; + } + + assert(sig.R && sig.S, 'Signature without R or S'); + + if (eddsa.isPoint(sig.R)) + this._R = sig.R; + if (sig.S instanceof BN) + this._S = sig.S; + + this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded; + this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded; +} + +cachedProperty(Signature, 'S', function S() { + return this.eddsa.decodeInt(this.Sencoded()); +}); + +cachedProperty(Signature, 'R', function R() { + return this.eddsa.decodePoint(this.Rencoded()); +}); + +cachedProperty(Signature, 'Rencoded', function Rencoded() { + return this.eddsa.encodePoint(this.R()); +}); + +cachedProperty(Signature, 'Sencoded', function Sencoded() { + return this.eddsa.encodeInt(this.S()); +}); + +Signature.prototype.toBytes = function toBytes() { + return this.Rencoded().concat(this.Sencoded()); +}; + +Signature.prototype.toHex = function toHex() { + return utils.encode(this.toBytes(), 'hex').toUpperCase(); +}; + +module.exports = Signature; diff --git a/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js b/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js new file mode 100644 index 000000000..e4c91e543 --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js @@ -0,0 +1,780 @@ +module.exports = { + doubles: { + step: 4, + points: [ + [ + 'e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a', + 'f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821' + ], + [ + '8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508', + '11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf' + ], + [ + '175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739', + 'd3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695' + ], + [ + '363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640', + '4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9' + ], + [ + '8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c', + '4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36' + ], + [ + '723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda', + '96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f' + ], + [ + 'eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa', + '5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999' + ], + [ + '100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0', + 'cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09' + ], + [ + 'e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d', + '9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d' + ], + [ + 'feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d', + 'e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088' + ], + [ + 'da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1', + '9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d' + ], + [ + '53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0', + '5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8' + ], + [ + '8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047', + '10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a' + ], + [ + '385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862', + '283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453' + ], + [ + '6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7', + '7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160' + ], + [ + '3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd', + '56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0' + ], + [ + '85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83', + '7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6' + ], + [ + '948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a', + '53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589' + ], + [ + '6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8', + 'bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17' + ], + [ + 'e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d', + '4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda' + ], + [ + 'e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725', + '7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd' + ], + [ + '213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754', + '4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2' + ], + [ + '4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c', + '17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6' + ], + [ + 'fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6', + '6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f' + ], + [ + '76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39', + 'c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01' + ], + [ + 'c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891', + '893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3' + ], + [ + 'd895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b', + 'febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f' + ], + [ + 'b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03', + '2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7' + ], + [ + 'e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d', + 'eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78' + ], + [ + 'a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070', + '7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1' + ], + [ + '90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4', + 'e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150' + ], + [ + '8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da', + '662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82' + ], + [ + 'e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11', + '1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc' + ], + [ + '8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e', + 'efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b' + ], + [ + 'e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41', + '2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51' + ], + [ + 'b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef', + '67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45' + ], + [ + 'd68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8', + 'db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120' + ], + [ + '324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d', + '648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84' + ], + [ + '4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96', + '35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d' + ], + [ + '9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd', + 'ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d' + ], + [ + '6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5', + '9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8' + ], + [ + 'a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266', + '40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8' + ], + [ + '7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71', + '34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac' + ], + [ + '928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac', + 'c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f' + ], + [ + '85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751', + '1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962' + ], + [ + 'ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e', + '493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907' + ], + [ + '827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241', + 'c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec' + ], + [ + 'eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3', + 'be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d' + ], + [ + 'e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f', + '4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414' + ], + [ + '1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19', + 'aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd' + ], + [ + '146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be', + 'b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0' + ], + [ + 'fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9', + '6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811' + ], + [ + 'da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2', + '8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1' + ], + [ + 'a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13', + '7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c' + ], + [ + '174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c', + 'ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73' + ], + [ + '959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba', + '2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd' + ], + [ + 'd2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151', + 'e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405' + ], + [ + '64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073', + 'd99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589' + ], + [ + '8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458', + '38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e' + ], + [ + '13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b', + '69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27' + ], + [ + 'bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366', + 'd3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1' + ], + [ + '8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa', + '40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482' + ], + [ + '8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0', + '620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945' + ], + [ + 'dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787', + '7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573' + ], + [ + 'f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e', + 'ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82' + ] + ] + }, + naf: { + wnd: 7, + points: [ + [ + 'f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9', + '388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672' + ], + [ + '2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4', + 'd8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6' + ], + [ + '5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc', + '6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da' + ], + [ + 'acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe', + 'cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37' + ], + [ + '774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb', + 'd984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b' + ], + [ + 'f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8', + 'ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81' + ], + [ + 'd7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e', + '581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58' + ], + [ + 'defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34', + '4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77' + ], + [ + '2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c', + '85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a' + ], + [ + '352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5', + '321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c' + ], + [ + '2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f', + '2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67' + ], + [ + '9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714', + '73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402' + ], + [ + 'daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729', + 'a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55' + ], + [ + 'c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db', + '2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482' + ], + [ + '6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4', + 'e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82' + ], + [ + '1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5', + 'b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396' + ], + [ + '605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479', + '2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49' + ], + [ + '62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d', + '80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf' + ], + [ + '80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f', + '1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a' + ], + [ + '7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb', + 'd0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7' + ], + [ + 'd528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9', + 'eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933' + ], + [ + '49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963', + '758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a' + ], + [ + '77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74', + '958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6' + ], + [ + 'f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530', + 'e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37' + ], + [ + '463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b', + '5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e' + ], + [ + 'f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247', + 'cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6' + ], + [ + 'caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1', + 'cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476' + ], + [ + '2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120', + '4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40' + ], + [ + '7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435', + '91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61' + ], + [ + '754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18', + '673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683' + ], + [ + 'e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8', + '59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5' + ], + [ + '186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb', + '3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b' + ], + [ + 'df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f', + '55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417' + ], + [ + '5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143', + 'efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868' + ], + [ + '290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba', + 'e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a' + ], + [ + 'af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45', + 'f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6' + ], + [ + '766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a', + '744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996' + ], + [ + '59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e', + 'c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e' + ], + [ + 'f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8', + 'e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d' + ], + [ + '7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c', + '30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2' + ], + [ + '948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519', + 'e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e' + ], + [ + '7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab', + '100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437' + ], + [ + '3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca', + 'ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311' + ], + [ + 'd3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf', + '8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4' + ], + [ + '1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610', + '68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575' + ], + [ + '733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4', + 'f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d' + ], + [ + '15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c', + 'd56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d' + ], + [ + 'a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940', + 'edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629' + ], + [ + 'e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980', + 'a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06' + ], + [ + '311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3', + '66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374' + ], + [ + '34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf', + '9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee' + ], + [ + 'f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63', + '4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1' + ], + [ + 'd7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448', + 'fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b' + ], + [ + '32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf', + '5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661' + ], + [ + '7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5', + '8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6' + ], + [ + 'ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6', + '8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e' + ], + [ + '16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5', + '5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d' + ], + [ + 'eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99', + 'f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc' + ], + [ + '78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51', + 'f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4' + ], + [ + '494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5', + '42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c' + ], + [ + 'a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5', + '204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b' + ], + [ + 'c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997', + '4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913' + ], + [ + '841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881', + '73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154' + ], + [ + '5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5', + '39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865' + ], + [ + '36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66', + 'd2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc' + ], + [ + '336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726', + 'ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224' + ], + [ + '8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede', + '6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e' + ], + [ + '1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94', + '60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6' + ], + [ + '85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31', + '3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511' + ], + [ + '29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51', + 'b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b' + ], + [ + 'a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252', + 'ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2' + ], + [ + '4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5', + 'cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c' + ], + [ + 'd24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b', + '6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3' + ], + [ + 'ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4', + '322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d' + ], + [ + 'af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f', + '6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700' + ], + [ + 'e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889', + '2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4' + ], + [ + '591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246', + 'b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196' + ], + [ + '11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984', + '998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4' + ], + [ + '3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a', + 'b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257' + ], + [ + 'cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030', + 'bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13' + ], + [ + 'c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197', + '6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096' + ], + [ + 'c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593', + 'c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38' + ], + [ + 'a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef', + '21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f' + ], + [ + '347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38', + '60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448' + ], + [ + 'da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a', + '49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a' + ], + [ + 'c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111', + '5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4' + ], + [ + '4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502', + '7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437' + ], + [ + '3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea', + 'be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7' + ], + [ + 'cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26', + '8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d' + ], + [ + 'b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986', + '39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a' + ], + [ + 'd4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e', + '62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54' + ], + [ + '48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4', + '25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77' + ], + [ + 'dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda', + 'ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517' + ], + [ + '6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859', + 'cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10' + ], + [ + 'e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f', + 'f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125' + ], + [ + 'eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c', + '6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e' + ], + [ + '13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942', + 'fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1' + ], + [ + 'ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a', + '1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2' + ], + [ + 'b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80', + '5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423' + ], + [ + 'ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d', + '438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8' + ], + [ + '8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1', + 'cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758' + ], + [ + '52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63', + 'c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375' + ], + [ + 'e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352', + '6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d' + ], + [ + '7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193', + 'ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec' + ], + [ + '5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00', + '9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0' + ], + [ + '32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58', + 'ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c' + ], + [ + 'e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7', + 'd3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4' + ], + [ + '8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8', + 'c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f' + ], + [ + '4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e', + '67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649' + ], + [ + '3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d', + 'cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826' + ], + [ + '674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b', + '299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5' + ], + [ + 'd32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f', + 'f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87' + ], + [ + '30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6', + '462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b' + ], + [ + 'be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297', + '62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc' + ], + [ + '93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a', + '7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c' + ], + [ + 'b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c', + 'ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f' + ], + [ + 'd5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52', + '4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a' + ], + [ + 'd3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb', + 'bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46' + ], + [ + '463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065', + 'bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f' + ], + [ + '7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917', + '603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03' + ], + [ + '74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9', + 'cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08' + ], + [ + '30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3', + '553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8' + ], + [ + '9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57', + '712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373' + ], + [ + '176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66', + 'ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3' + ], + [ + '75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8', + '9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8' + ], + [ + '809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721', + '9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1' + ], + [ + '1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180', + '4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9' + ] + ] + } +}; diff --git a/node_modules/elliptic/lib/elliptic/utils.js b/node_modules/elliptic/lib/elliptic/utils.js new file mode 100644 index 000000000..982738149 --- /dev/null +++ b/node_modules/elliptic/lib/elliptic/utils.js @@ -0,0 +1,120 @@ +'use strict'; + +var utils = exports; +var BN = require('bn.js'); +var minAssert = require('minimalistic-assert'); +var minUtils = require('minimalistic-crypto-utils'); + +utils.assert = minAssert; +utils.toArray = minUtils.toArray; +utils.zero2 = minUtils.zero2; +utils.toHex = minUtils.toHex; +utils.encode = minUtils.encode; + +// Represent num in a w-NAF form +function getNAF(num, w) { + var naf = []; + var ws = 1 << (w + 1); + var k = num.clone(); + while (k.cmpn(1) >= 0) { + var z; + if (k.isOdd()) { + var mod = k.andln(ws - 1); + if (mod > (ws >> 1) - 1) + z = (ws >> 1) - mod; + else + z = mod; + k.isubn(z); + } else { + z = 0; + } + naf.push(z); + + // Optimization, shift by word if possible + var shift = (k.cmpn(0) !== 0 && k.andln(ws - 1) === 0) ? (w + 1) : 1; + for (var i = 1; i < shift; i++) + naf.push(0); + k.iushrn(shift); + } + + return naf; +} +utils.getNAF = getNAF; + +// Represent k1, k2 in a Joint Sparse Form +function getJSF(k1, k2) { + var jsf = [ + [], + [] + ]; + + k1 = k1.clone(); + k2 = k2.clone(); + var d1 = 0; + var d2 = 0; + while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) { + + // First phase + var m14 = (k1.andln(3) + d1) & 3; + var m24 = (k2.andln(3) + d2) & 3; + if (m14 === 3) + m14 = -1; + if (m24 === 3) + m24 = -1; + var u1; + if ((m14 & 1) === 0) { + u1 = 0; + } else { + var m8 = (k1.andln(7) + d1) & 7; + if ((m8 === 3 || m8 === 5) && m24 === 2) + u1 = -m14; + else + u1 = m14; + } + jsf[0].push(u1); + + var u2; + if ((m24 & 1) === 0) { + u2 = 0; + } else { + var m8 = (k2.andln(7) + d2) & 7; + if ((m8 === 3 || m8 === 5) && m14 === 2) + u2 = -m24; + else + u2 = m24; + } + jsf[1].push(u2); + + // Second phase + if (2 * d1 === u1 + 1) + d1 = 1 - d1; + if (2 * d2 === u2 + 1) + d2 = 1 - d2; + k1.iushrn(1); + k2.iushrn(1); + } + + return jsf; +} +utils.getJSF = getJSF; + +function cachedProperty(obj, name, computer) { + var key = '_' + name; + obj.prototype[name] = function cachedProperty() { + return this[key] !== undefined ? this[key] : + this[key] = computer.call(this); + }; +} +utils.cachedProperty = cachedProperty; + +function parseBytes(bytes) { + return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') : + bytes; +} +utils.parseBytes = parseBytes; + +function intFromLE(bytes) { + return new BN(bytes, 'hex', 'le'); +} +utils.intFromLE = intFromLE; + diff --git a/node_modules/elliptic/package.json b/node_modules/elliptic/package.json new file mode 100644 index 000000000..884a24bec --- /dev/null +++ b/node_modules/elliptic/package.json @@ -0,0 +1,87 @@ +{ + "_from": "elliptic@^6.0.0", + "_id": "elliptic@6.4.1", + "_inBundle": false, + "_integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", + "_location": "/elliptic", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "elliptic@^6.0.0", + "name": "elliptic", + "escapedName": "elliptic", + "rawSpec": "^6.0.0", + "saveSpec": null, + "fetchSpec": "^6.0.0" + }, + "_requiredBy": [ + "/browserify-sign", + "/create-ecdh" + ], + "_resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", + "_shasum": "c2d0b7776911b86722c632c3c06c60f2f819939a", + "_spec": "elliptic@^6.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify-sign", + "author": { + "name": "Fedor Indutny", + "email": "fedor@indutny.com" + }, + "bugs": { + "url": "https://github.com/indutny/elliptic/issues" + }, + "bundleDependencies": false, + "dependencies": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + }, + "deprecated": false, + "description": "EC cryptography", + "devDependencies": { + "brfs": "^1.4.3", + "coveralls": "^2.11.3", + "grunt": "^0.4.5", + "grunt-browserify": "^5.0.0", + "grunt-cli": "^1.2.0", + "grunt-contrib-connect": "^1.0.0", + "grunt-contrib-copy": "^1.0.0", + "grunt-contrib-uglify": "^1.0.1", + "grunt-mocha-istanbul": "^3.0.1", + "grunt-saucelabs": "^8.6.2", + "istanbul": "^0.4.2", + "jscs": "^2.9.0", + "jshint": "^2.6.0", + "mocha": "^2.1.0" + }, + "files": [ + "lib" + ], + "homepage": "https://github.com/indutny/elliptic", + "keywords": [ + "EC", + "Elliptic", + "curve", + "Cryptography" + ], + "license": "MIT", + "main": "lib/elliptic.js", + "name": "elliptic", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/indutny/elliptic.git" + }, + "scripts": { + "jscs": "jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js", + "jshint": "jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js", + "lint": "npm run jscs && npm run jshint", + "test": "npm run lint && npm run unit", + "unit": "istanbul test _mocha --reporter=spec test/index.js", + "version": "grunt dist && git add dist/" + }, + "version": "6.4.1" +} diff --git a/node_modules/encodeurl/HISTORY.md b/node_modules/encodeurl/HISTORY.md new file mode 100644 index 000000000..41313b2b3 --- /dev/null +++ b/node_modules/encodeurl/HISTORY.md @@ -0,0 +1,14 @@ +1.0.2 / 2018-01-21 +================== + + * Fix encoding `%` as last character + +1.0.1 / 2016-06-09 +================== + + * Fix encoding unpaired surrogates at start/end of string + +1.0.0 / 2016-06-08 +================== + + * Initial release diff --git a/node_modules/encodeurl/LICENSE b/node_modules/encodeurl/LICENSE new file mode 100644 index 000000000..8812229bc --- /dev/null +++ b/node_modules/encodeurl/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/encodeurl/README.md b/node_modules/encodeurl/README.md new file mode 100644 index 000000000..127c5a0d4 --- /dev/null +++ b/node_modules/encodeurl/README.md @@ -0,0 +1,128 @@ +# encodeurl + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Encode a URL to a percent-encoded form, excluding already-encoded sequences + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install encodeurl +``` + +## API + +```js +var encodeUrl = require('encodeurl') +``` + +### encodeUrl(url) + +Encode a URL to a percent-encoded form, excluding already-encoded sequences. + +This function will take an already-encoded URL and encode all the non-URL +code points (as UTF-8 byte sequences). This function will not encode the +"%" character unless it is not part of a valid sequence (`%20` will be +left as-is, but `%foo` will be encoded as `%25foo`). + +This encode is meant to be "safe" and does not throw errors. It will try as +hard as it can to properly encode the given URL, including replacing any raw, +unpaired surrogate pairs with the Unicode replacement character prior to +encoding. + +This function is _similar_ to the intrinsic function `encodeURI`, except it +will not encode the `%` character if that is part of a valid sequence, will +not encode `[` and `]` (for IPv6 hostnames) and will replace raw, unpaired +surrogate pairs with the Unicode replacement character (instead of throwing). + +## Examples + +### Encode a URL containing user-controled data + +```js +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') + +http.createServer(function onRequest (req, res) { + // get encoded form of inbound url + var url = encodeUrl(req.url) + + // create html message + var body = '

Location ' + escapeHtml(url) + ' not found

' + + // send a 404 + res.statusCode = 404 + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8'))) + res.end(body, 'utf-8') +}) +``` + +### Encode a URL for use in a header field + +```js +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') +var url = require('url') + +http.createServer(function onRequest (req, res) { + // parse inbound url + var href = url.parse(req) + + // set new host for redirect + href.host = 'localhost' + href.protocol = 'https:' + href.slashes = true + + // create location header + var location = encodeUrl(url.format(href)) + + // create html message + var body = '

Redirecting to new site: ' + escapeHtml(location) + '

' + + // send a 301 + res.statusCode = 301 + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8'))) + res.setHeader('Location', location) + res.end(body, 'utf-8') +}) +``` + +## Testing + +```sh +$ npm test +$ npm run lint +``` + +## References + +- [RFC 3986: Uniform Resource Identifier (URI): Generic Syntax][rfc-3986] +- [WHATWG URL Living Standard][whatwg-url] + +[rfc-3986]: https://tools.ietf.org/html/rfc3986 +[whatwg-url]: https://url.spec.whatwg.org/ + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/encodeurl.svg +[npm-url]: https://npmjs.org/package/encodeurl +[node-version-image]: https://img.shields.io/node/v/encodeurl.svg +[node-version-url]: https://nodejs.org/en/download +[travis-image]: https://img.shields.io/travis/pillarjs/encodeurl.svg +[travis-url]: https://travis-ci.org/pillarjs/encodeurl +[coveralls-image]: https://img.shields.io/coveralls/pillarjs/encodeurl.svg +[coveralls-url]: https://coveralls.io/r/pillarjs/encodeurl?branch=master +[downloads-image]: https://img.shields.io/npm/dm/encodeurl.svg +[downloads-url]: https://npmjs.org/package/encodeurl diff --git a/node_modules/encodeurl/index.js b/node_modules/encodeurl/index.js new file mode 100644 index 000000000..fc4906c6c --- /dev/null +++ b/node_modules/encodeurl/index.js @@ -0,0 +1,60 @@ +/*! + * encodeurl + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = encodeUrl + +/** + * RegExp to match non-URL code points, *after* encoding (i.e. not including "%") + * and including invalid escape sequences. + * @private + */ + +var ENCODE_CHARS_REGEXP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g + +/** + * RegExp to match unmatched surrogate pair. + * @private + */ + +var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g + +/** + * String to replace unmatched surrogate pair with. + * @private + */ + +var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2' + +/** + * Encode a URL to a percent-encoded form, excluding already-encoded sequences. + * + * This function will take an already-encoded URL and encode all the non-URL + * code points. This function will not encode the "%" character unless it is + * not part of a valid sequence (`%20` will be left as-is, but `%foo` will + * be encoded as `%25foo`). + * + * This encode is meant to be "safe" and does not throw errors. It will try as + * hard as it can to properly encode the given URL, including replacing any raw, + * unpaired surrogate pairs with the Unicode replacement character prior to + * encoding. + * + * @param {string} url + * @return {string} + * @public + */ + +function encodeUrl (url) { + return String(url) + .replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE) + .replace(ENCODE_CHARS_REGEXP, encodeURI) +} diff --git a/node_modules/encodeurl/package.json b/node_modules/encodeurl/package.json new file mode 100644 index 000000000..835434f66 --- /dev/null +++ b/node_modules/encodeurl/package.json @@ -0,0 +1,76 @@ +{ + "_from": "encodeurl@~1.0.2", + "_id": "encodeurl@1.0.2", + "_inBundle": false, + "_integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "_location": "/encodeurl", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "encodeurl@~1.0.2", + "name": "encodeurl", + "escapedName": "encodeurl", + "rawSpec": "~1.0.2", + "saveSpec": null, + "fetchSpec": "~1.0.2" + }, + "_requiredBy": [ + "/send", + "/serve-static" + ], + "_resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "_shasum": "ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59", + "_spec": "encodeurl@~1.0.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/serve-static", + "bugs": { + "url": "https://github.com/pillarjs/encodeurl/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + } + ], + "deprecated": false, + "description": "Encode a URL to a percent-encoded form, excluding already-encoded sequences", + "devDependencies": { + "eslint": "3.19.0", + "eslint-config-standard": "10.2.1", + "eslint-plugin-import": "2.8.0", + "eslint-plugin-node": "5.2.1", + "eslint-plugin-promise": "3.6.0", + "eslint-plugin-standard": "3.0.1", + "istanbul": "0.4.5", + "mocha": "2.5.3" + }, + "engines": { + "node": ">= 0.8" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "homepage": "https://github.com/pillarjs/encodeurl#readme", + "keywords": [ + "encode", + "encodeurl", + "url" + ], + "license": "MIT", + "name": "encodeurl", + "repository": { + "type": "git", + "url": "git+https://github.com/pillarjs/encodeurl.git" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "version": "1.0.2" +} diff --git a/node_modules/es6-promisify/LICENSE b/node_modules/es6-promisify/LICENSE new file mode 100644 index 000000000..f1e854fca --- /dev/null +++ b/node_modules/es6-promisify/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014 Mike Hall / Digital Design Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/es6-promisify/README.md b/node_modules/es6-promisify/README.md new file mode 100644 index 000000000..40668a2a1 --- /dev/null +++ b/node_modules/es6-promisify/README.md @@ -0,0 +1,93 @@ +[![Travis CI](https://travis-ci.org/digitaldesignlabs/es6-promisify.svg)](https://travis-ci.org/digitaldesignlabs/es6-promisify) + +# es6-promisify +Converts callback-based functions to ES6/ES2015 Promises, using a boilerplate callback function. + +NOTE: All-new API for Version 6.0.0; please read carefully! +=========================================================== + +## Install +Install with [npm](https://npmjs.org/package/es6-promisify) + +```bash +npm install es6-promisify +``` + +## Example +```js +const {promisify} = require("es6-promisify"); + +// Convert the stat function +const fs = require("fs"); +const stat = promisify(fs.stat); + +// Now usable as a promise! +stat("example.txt").then(function (stats) { + console.log("Got stats", stats); +}).catch(function (err) { + console.error("Yikes!", err); +}); +``` + +## Promisify methods +```js +const {promisify} = require("es6-promisify"); + +// Create a promise-based version of send_command +const redis = require("redis").createClient(6379, "localhost"); +const client = promisify(redis.send_command.bind(redis)); + +// Send commands to redis and get a promise back +client("ping").then(function (pong) { + console.log("Got", pong); +}).catch(function (err) { + console.error("Unexpected error", err); +}).then(function () { + redis.quit(); +}); +``` + +## Handle multiple callback arguments, with named parameters +```js +const {promisify} = require("es6-promisify"); + +function test(cb) { + return cb(undefined, 1, 2, 3); +} + +// Create promise-based version of test +test[promisify.argumentNames] = ["one", "two", "three"]; +const multi = promisify(test); + +// Returns named arguments +multi().then(result => { + console.log(result); // {one: 1, two: 2, three: 3} +}); +``` + +## Provide your own Promise implementation +```js +const {promisify} = require("es6-promisify"); + +// Now uses Bluebird +promisify.Promise = require("bluebird"); + +const test = promisify(cb => cb(undefined, "test")); +test().then(result => { + console.log(result); // "test", resolved using Bluebird +}); +``` + +### Tests +Test with tape +```bash +$ npm test +``` + +### Changes from v5.0.0 +- Allow developer to specify a different implementations of `Promise` +- No longer ships with a polyfill for `Promise`. If your environment has no native `Promise` you must polyfill yourself, or set `promisify.Promise` to an A+ compatible `Promise` implementation. +- Removed support for `settings.thisArg`: use `.bind()` instead. +- Removed support for `settings.multiArgs`: use named arguments instead. + +Published under the [MIT License](http://opensource.org/licenses/MIT). diff --git a/node_modules/es6-promisify/dist/promisify.js b/node_modules/es6-promisify/dist/promisify.js new file mode 100644 index 000000000..32a5aaae9 --- /dev/null +++ b/node_modules/es6-promisify/dist/promisify.js @@ -0,0 +1,84 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +// Symbols is a better way to do this, but not all browsers have good support, +// so instead we'll just make do with a very unlikely string. +var customArgumentsToken = "__ES6-PROMISIFY--CUSTOM-ARGUMENTS__"; + +/** + * promisify() + * Transforms callback-based function -- func(arg1, arg2 .. argN, callback) -- into + * an ES6-compatible Promise. Promisify provides a default callback of the form (error, result) + * and rejects when `error` is truthy. + * + * @param {function} original - The function to promisify + * @return {function} A promisified version of `original` + */ +function promisify(original) { + + // Ensure the argument is a function + if (typeof original !== "function") { + throw new TypeError("Argument to promisify must be a function"); + } + + // If the user has asked us to decode argument names for them, honour that + var argumentNames = original[customArgumentsToken]; + + // If the user has supplied a custom Promise implementation, use it. Otherwise + // fall back to whatever we can find on the global object. + var ES6Promise = promisify.Promise || Promise; + + // If we can find no Promise implemention, then fail now. + if (typeof ES6Promise !== "function") { + throw new Error("No Promise implementation found; do you need a polyfill?"); + } + + return function () { + var _this = this; + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return new ES6Promise(function (resolve, reject) { + + // Append the callback bound to the context + args.push(function callback(err) { + + if (err) { + return reject(err); + } + + for (var _len2 = arguments.length, values = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + values[_key2 - 1] = arguments[_key2]; + } + + if (values.length === 1 || !argumentNames) { + return resolve(values[0]); + } + + var o = {}; + values.forEach(function (value, index) { + var name = argumentNames[index]; + if (name) { + o[name] = value; + } + }); + + resolve(o); + }); + + // Call the function. + original.call.apply(original, [_this].concat(args)); + }); + }; +} + +// Attach this symbol to the exported function, so users can use it +promisify.argumentNames = customArgumentsToken; +promisify.Promise = undefined; + +// Export the public API +exports.promisify = promisify; \ No newline at end of file diff --git a/node_modules/es6-promisify/package.json b/node_modules/es6-promisify/package.json new file mode 100644 index 000000000..5d5097935 --- /dev/null +++ b/node_modules/es6-promisify/package.json @@ -0,0 +1,73 @@ +{ + "_from": "es6-promisify@^6.0.0", + "_id": "es6-promisify@6.0.1", + "_inBundle": false, + "_integrity": "sha512-J3ZkwbEnnO+fGAKrjVpeUAnZshAdfZvbhQpqfIH9kSAspReRC4nJnu8ewm55b4y9ElyeuhCTzJD0XiH8Tsbhlw==", + "_location": "/es6-promisify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "es6-promisify@^6.0.0", + "name": "es6-promisify", + "escapedName": "es6-promisify", + "rawSpec": "^6.0.0", + "saveSpec": null, + "fetchSpec": "^6.0.0" + }, + "_requiredBy": [ + "/pem" + ], + "_resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-6.0.1.tgz", + "_shasum": "6edaa45f3bd570ffe08febce66f7116be4b1cdb6", + "_spec": "es6-promisify@^6.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/pem", + "author": { + "name": "Mike Hall", + "email": "mikehall314@gmail.com" + }, + "bugs": { + "url": "http://github.com/digitaldesignlabs/es6-promisify/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Converts callback-based functions to ES6 Promises", + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-preset-es2015": "^6.24.1", + "es6-promise": "^4.2.5", + "eslint": "^5.7.0", + "istanbul": "^0.4.5", + "sinon": "^7.0.0", + "tape": "^4.9.1" + }, + "files": [ + "dist/promisify.js" + ], + "greenkeeper": { + "ignore": [ + "eslint" + ] + }, + "homepage": "https://github.com/digitaldesignlabs/es6-promisify#readme", + "keywords": [ + "promises", + "es6", + "promisify" + ], + "license": "MIT", + "main": "dist/promisify.js", + "name": "es6-promisify", + "repository": { + "type": "git", + "url": "git+https://github.com/digitaldesignlabs/es6-promisify.git" + }, + "scripts": { + "build": "babel lib -d dist", + "pretest": "eslint lib/*.js test/*.js", + "test": "npm run build && ./node_modules/.bin/tape test", + "test:cover": "npm run build && ./node_modules/.bin/istanbul cover test" + }, + "version": "6.0.1" +} diff --git a/node_modules/escape-html/LICENSE b/node_modules/escape-html/LICENSE new file mode 100644 index 000000000..2e70de971 --- /dev/null +++ b/node_modules/escape-html/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2012-2013 TJ Holowaychuk +Copyright (c) 2015 Andreas Lubbe +Copyright (c) 2015 Tiancheng "Timothy" Gu + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/escape-html/Readme.md b/node_modules/escape-html/Readme.md new file mode 100644 index 000000000..653d9eaa7 --- /dev/null +++ b/node_modules/escape-html/Readme.md @@ -0,0 +1,43 @@ + +# escape-html + + Escape string for use in HTML + +## Example + +```js +var escape = require('escape-html'); +var html = escape('foo & bar'); +// -> foo & bar +``` + +## Benchmark + +``` +$ npm run-script bench + +> escape-html@1.0.3 bench nodejs-escape-html +> node benchmark/index.js + + + http_parser@1.0 + node@0.10.33 + v8@3.14.5.9 + ares@1.9.0-DEV + uv@0.10.29 + zlib@1.2.3 + modules@11 + openssl@1.0.1j + + 1 test completed. + 2 tests completed. + 3 tests completed. + + no special characters x 19,435,271 ops/sec ±0.85% (187 runs sampled) + single special character x 6,132,421 ops/sec ±0.67% (194 runs sampled) + many special characters x 3,175,826 ops/sec ±0.65% (193 runs sampled) +``` + +## License + + MIT \ No newline at end of file diff --git a/node_modules/escape-html/index.js b/node_modules/escape-html/index.js new file mode 100644 index 000000000..bf9e226f4 --- /dev/null +++ b/node_modules/escape-html/index.js @@ -0,0 +1,78 @@ +/*! + * escape-html + * Copyright(c) 2012-2013 TJ Holowaychuk + * Copyright(c) 2015 Andreas Lubbe + * Copyright(c) 2015 Tiancheng "Timothy" Gu + * MIT Licensed + */ + +'use strict'; + +/** + * Module variables. + * @private + */ + +var matchHtmlRegExp = /["'&<>]/; + +/** + * Module exports. + * @public + */ + +module.exports = escapeHtml; + +/** + * Escape special characters in the given string of html. + * + * @param {string} string The string to escape for inserting into HTML + * @return {string} + * @public + */ + +function escapeHtml(string) { + var str = '' + string; + var match = matchHtmlRegExp.exec(str); + + if (!match) { + return str; + } + + var escape; + var html = ''; + var index = 0; + var lastIndex = 0; + + for (index = match.index; index < str.length; index++) { + switch (str.charCodeAt(index)) { + case 34: // " + escape = '"'; + break; + case 38: // & + escape = '&'; + break; + case 39: // ' + escape = '''; + break; + case 60: // < + escape = '<'; + break; + case 62: // > + escape = '>'; + break; + default: + continue; + } + + if (lastIndex !== index) { + html += str.substring(lastIndex, index); + } + + lastIndex = index + 1; + html += escape; + } + + return lastIndex !== index + ? html + str.substring(lastIndex, index) + : html; +} diff --git a/node_modules/escape-html/package.json b/node_modules/escape-html/package.json new file mode 100644 index 000000000..e240b0d4b --- /dev/null +++ b/node_modules/escape-html/package.json @@ -0,0 +1,58 @@ +{ + "_from": "escape-html@^1.0.3", + "_id": "escape-html@1.0.3", + "_inBundle": false, + "_integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "_location": "/escape-html", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "escape-html@^1.0.3", + "name": "escape-html", + "escapedName": "escape-html", + "rawSpec": "^1.0.3", + "saveSpec": null, + "fetchSpec": "^1.0.3" + }, + "_requiredBy": [ + "/budo", + "/send", + "/serve-static" + ], + "_resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "_shasum": "0258eae4d3d0c0974de1c169188ef0051d1d1988", + "_spec": "escape-html@^1.0.3", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", + "bugs": { + "url": "https://github.com/component/escape-html/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Escape string for use in HTML", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "1.0.0" + }, + "files": [ + "LICENSE", + "Readme.md", + "index.js" + ], + "homepage": "https://github.com/component/escape-html#readme", + "keywords": [ + "escape", + "html", + "utility" + ], + "license": "MIT", + "name": "escape-html", + "repository": { + "type": "git", + "url": "git+https://github.com/component/escape-html.git" + }, + "scripts": { + "bench": "node benchmark/index.js" + }, + "version": "1.0.3" +} diff --git a/node_modules/escape-string-regexp/index.js b/node_modules/escape-string-regexp/index.js new file mode 100644 index 000000000..7834bf9b2 --- /dev/null +++ b/node_modules/escape-string-regexp/index.js @@ -0,0 +1,11 @@ +'use strict'; + +var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; + +module.exports = function (str) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + + return str.replace(matchOperatorsRe, '\\$&'); +}; diff --git a/node_modules/escape-string-regexp/license b/node_modules/escape-string-regexp/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/escape-string-regexp/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/escape-string-regexp/package.json b/node_modules/escape-string-regexp/package.json new file mode 100644 index 000000000..cfc9c476c --- /dev/null +++ b/node_modules/escape-string-regexp/package.json @@ -0,0 +1,81 @@ +{ + "_from": "escape-string-regexp@^1.0.0", + "_id": "escape-string-regexp@1.0.5", + "_inBundle": false, + "_integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "_location": "/escape-string-regexp", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "escape-string-regexp@^1.0.0", + "name": "escape-string-regexp", + "escapedName": "escape-string-regexp", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/chalk" + ], + "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "_shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4", + "_spec": "escape-string-regexp@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/chalk", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/escape-string-regexp/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Escape RegExp special characters", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=0.8.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/escape-string-regexp#readme", + "keywords": [ + "escape", + "regex", + "regexp", + "re", + "regular", + "expression", + "string", + "str", + "special", + "characters" + ], + "license": "MIT", + "maintainers": [ + { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + { + "name": "Joshua Boy Nicolai Appelman", + "email": "joshua@jbna.nl", + "url": "jbna.nl" + } + ], + "name": "escape-string-regexp", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/escape-string-regexp.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.5" +} diff --git a/node_modules/escape-string-regexp/readme.md b/node_modules/escape-string-regexp/readme.md new file mode 100644 index 000000000..87ac82d5e --- /dev/null +++ b/node_modules/escape-string-regexp/readme.md @@ -0,0 +1,27 @@ +# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp) + +> Escape RegExp special characters + + +## Install + +``` +$ npm install --save escape-string-regexp +``` + + +## Usage + +```js +const escapeStringRegexp = require('escape-string-regexp'); + +const escapedString = escapeStringRegexp('how much $ for a unicorn?'); +//=> 'how much \$ for a unicorn\?' + +new RegExp(escapedString); +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/etag/HISTORY.md b/node_modules/etag/HISTORY.md new file mode 100644 index 000000000..222b293de --- /dev/null +++ b/node_modules/etag/HISTORY.md @@ -0,0 +1,83 @@ +1.8.1 / 2017-09-12 +================== + + * perf: replace regular expression with substring + +1.8.0 / 2017-02-18 +================== + + * Use SHA1 instead of MD5 for ETag hashing + - Improves performance for larger entities + - Works with FIPS 140-2 OpenSSL configuration + +1.7.0 / 2015-06-08 +================== + + * Always include entity length in ETags for hash length extensions + * Generate non-Stats ETags using MD5 only (no longer CRC32) + * Improve stat performance by removing hashing + * Remove base64 padding in ETags to shorten + * Use MD5 instead of MD4 in weak ETags over 1KB + +1.6.0 / 2015-05-10 +================== + + * Improve support for JXcore + * Remove requirement of `atime` in the stats object + * Support "fake" stats objects in environments without `fs` + +1.5.1 / 2014-11-19 +================== + + * deps: crc@3.2.1 + - Minor fixes + +1.5.0 / 2014-10-14 +================== + + * Improve string performance + * Slightly improve speed for weak ETags over 1KB + +1.4.0 / 2014-09-21 +================== + + * Support "fake" stats objects + * Support Node.js 0.6 + +1.3.1 / 2014-09-14 +================== + + * Use the (new and improved) `crc` for crc32 + +1.3.0 / 2014-08-29 +================== + + * Default strings to strong ETags + * Improve speed for weak ETags over 1KB + +1.2.1 / 2014-08-29 +================== + + * Use the (much faster) `buffer-crc32` for crc32 + +1.2.0 / 2014-08-24 +================== + + * Add support for file stat objects + +1.1.0 / 2014-08-24 +================== + + * Add fast-path for empty entity + * Add weak ETag generation + * Shrink size of generated ETags + +1.0.1 / 2014-08-24 +================== + + * Fix behavior of string containing Unicode + +1.0.0 / 2014-05-18 +================== + + * Initial release diff --git a/node_modules/etag/LICENSE b/node_modules/etag/LICENSE new file mode 100644 index 000000000..cab251c2b --- /dev/null +++ b/node_modules/etag/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/etag/README.md b/node_modules/etag/README.md new file mode 100644 index 000000000..09c2169e7 --- /dev/null +++ b/node_modules/etag/README.md @@ -0,0 +1,159 @@ +# etag + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Create simple HTTP ETags + +This module generates HTTP ETags (as defined in RFC 7232) for use in +HTTP responses. + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install etag +``` + +## API + + + +```js +var etag = require('etag') +``` + +### etag(entity, [options]) + +Generate a strong ETag for the given entity. This should be the complete +body of the entity. Strings, `Buffer`s, and `fs.Stats` are accepted. By +default, a strong ETag is generated except for `fs.Stats`, which will +generate a weak ETag (this can be overwritten by `options.weak`). + + + +```js +res.setHeader('ETag', etag(body)) +``` + +#### Options + +`etag` accepts these properties in the options object. + +##### weak + +Specifies if the generated ETag will include the weak validator mark (that +is, the leading `W/`). The actual entity tag is the same. The default value +is `false`, unless the `entity` is `fs.Stats`, in which case it is `true`. + +## Testing + +```sh +$ npm test +``` + +## Benchmark + +```bash +$ npm run-script bench + +> etag@1.8.1 bench nodejs-etag +> node benchmark/index.js + + http_parser@2.7.0 + node@6.11.1 + v8@5.1.281.103 + uv@1.11.0 + zlib@1.2.11 + ares@1.10.1-DEV + icu@58.2 + modules@48 + openssl@1.0.2k + +> node benchmark/body0-100b.js + + 100B body + + 4 tests completed. + + buffer - strong x 258,647 ops/sec ±1.07% (180 runs sampled) + buffer - weak x 263,812 ops/sec ±0.61% (184 runs sampled) + string - strong x 259,955 ops/sec ±1.19% (185 runs sampled) + string - weak x 264,356 ops/sec ±1.09% (184 runs sampled) + +> node benchmark/body1-1kb.js + + 1KB body + + 4 tests completed. + + buffer - strong x 189,018 ops/sec ±1.12% (182 runs sampled) + buffer - weak x 190,586 ops/sec ±0.81% (186 runs sampled) + string - strong x 144,272 ops/sec ±0.96% (188 runs sampled) + string - weak x 145,380 ops/sec ±1.43% (187 runs sampled) + +> node benchmark/body2-5kb.js + + 5KB body + + 4 tests completed. + + buffer - strong x 92,435 ops/sec ±0.42% (188 runs sampled) + buffer - weak x 92,373 ops/sec ±0.58% (189 runs sampled) + string - strong x 48,850 ops/sec ±0.56% (186 runs sampled) + string - weak x 49,380 ops/sec ±0.56% (190 runs sampled) + +> node benchmark/body3-10kb.js + + 10KB body + + 4 tests completed. + + buffer - strong x 55,989 ops/sec ±0.93% (188 runs sampled) + buffer - weak x 56,148 ops/sec ±0.55% (190 runs sampled) + string - strong x 27,345 ops/sec ±0.43% (188 runs sampled) + string - weak x 27,496 ops/sec ±0.45% (190 runs sampled) + +> node benchmark/body4-100kb.js + + 100KB body + + 4 tests completed. + + buffer - strong x 7,083 ops/sec ±0.22% (190 runs sampled) + buffer - weak x 7,115 ops/sec ±0.26% (191 runs sampled) + string - strong x 3,068 ops/sec ±0.34% (190 runs sampled) + string - weak x 3,096 ops/sec ±0.35% (190 runs sampled) + +> node benchmark/stats.js + + stat + + 4 tests completed. + + real - strong x 871,642 ops/sec ±0.34% (189 runs sampled) + real - weak x 867,613 ops/sec ±0.39% (190 runs sampled) + fake - strong x 401,051 ops/sec ±0.40% (189 runs sampled) + fake - weak x 400,100 ops/sec ±0.47% (188 runs sampled) +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/etag.svg +[npm-url]: https://npmjs.org/package/etag +[node-version-image]: https://img.shields.io/node/v/etag.svg +[node-version-url]: https://nodejs.org/en/download/ +[travis-image]: https://img.shields.io/travis/jshttp/etag/master.svg +[travis-url]: https://travis-ci.org/jshttp/etag +[coveralls-image]: https://img.shields.io/coveralls/jshttp/etag/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/etag?branch=master +[downloads-image]: https://img.shields.io/npm/dm/etag.svg +[downloads-url]: https://npmjs.org/package/etag diff --git a/node_modules/etag/index.js b/node_modules/etag/index.js new file mode 100644 index 000000000..2a585c91f --- /dev/null +++ b/node_modules/etag/index.js @@ -0,0 +1,131 @@ +/*! + * etag + * Copyright(c) 2014-2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = etag + +/** + * Module dependencies. + * @private + */ + +var crypto = require('crypto') +var Stats = require('fs').Stats + +/** + * Module variables. + * @private + */ + +var toString = Object.prototype.toString + +/** + * Generate an entity tag. + * + * @param {Buffer|string} entity + * @return {string} + * @private + */ + +function entitytag (entity) { + if (entity.length === 0) { + // fast-path empty + return '"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"' + } + + // compute hash of entity + var hash = crypto + .createHash('sha1') + .update(entity, 'utf8') + .digest('base64') + .substring(0, 27) + + // compute length of entity + var len = typeof entity === 'string' + ? Buffer.byteLength(entity, 'utf8') + : entity.length + + return '"' + len.toString(16) + '-' + hash + '"' +} + +/** + * Create a simple ETag. + * + * @param {string|Buffer|Stats} entity + * @param {object} [options] + * @param {boolean} [options.weak] + * @return {String} + * @public + */ + +function etag (entity, options) { + if (entity == null) { + throw new TypeError('argument entity is required') + } + + // support fs.Stats object + var isStats = isstats(entity) + var weak = options && typeof options.weak === 'boolean' + ? options.weak + : isStats + + // validate argument + if (!isStats && typeof entity !== 'string' && !Buffer.isBuffer(entity)) { + throw new TypeError('argument entity must be string, Buffer, or fs.Stats') + } + + // generate entity tag + var tag = isStats + ? stattag(entity) + : entitytag(entity) + + return weak + ? 'W/' + tag + : tag +} + +/** + * Determine if object is a Stats object. + * + * @param {object} obj + * @return {boolean} + * @api private + */ + +function isstats (obj) { + // genuine fs.Stats + if (typeof Stats === 'function' && obj instanceof Stats) { + return true + } + + // quack quack + return obj && typeof obj === 'object' && + 'ctime' in obj && toString.call(obj.ctime) === '[object Date]' && + 'mtime' in obj && toString.call(obj.mtime) === '[object Date]' && + 'ino' in obj && typeof obj.ino === 'number' && + 'size' in obj && typeof obj.size === 'number' +} + +/** + * Generate a tag for a stat. + * + * @param {object} stat + * @return {string} + * @private + */ + +function stattag (stat) { + var mtime = stat.mtime.getTime().toString(16) + var size = stat.size.toString(16) + + return '"' + size + '-' + mtime + '"' +} diff --git a/node_modules/etag/package.json b/node_modules/etag/package.json new file mode 100644 index 000000000..09d9cb0aa --- /dev/null +++ b/node_modules/etag/package.json @@ -0,0 +1,85 @@ +{ + "_from": "etag@~1.8.1", + "_id": "etag@1.8.1", + "_inBundle": false, + "_integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "_location": "/etag", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "etag@~1.8.1", + "name": "etag", + "escapedName": "etag", + "rawSpec": "~1.8.1", + "saveSpec": null, + "fetchSpec": "~1.8.1" + }, + "_requiredBy": [ + "/send" + ], + "_resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "_shasum": "41ae2eeb65efa62268aebfea83ac7d79299b0887", + "_spec": "etag@~1.8.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/send", + "bugs": { + "url": "https://github.com/jshttp/etag/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "David Björklund", + "email": "david.bjorklund@gmail.com" + } + ], + "deprecated": false, + "description": "Create simple HTTP ETags", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "2.1.4", + "eslint": "3.19.0", + "eslint-config-standard": "10.2.1", + "eslint-plugin-import": "2.7.0", + "eslint-plugin-markdown": "1.0.0-beta.6", + "eslint-plugin-node": "5.1.1", + "eslint-plugin-promise": "3.5.0", + "eslint-plugin-standard": "3.0.1", + "istanbul": "0.4.5", + "mocha": "1.21.5", + "safe-buffer": "5.1.1", + "seedrandom": "2.4.3" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "homepage": "https://github.com/jshttp/etag#readme", + "keywords": [ + "etag", + "http", + "res" + ], + "license": "MIT", + "name": "etag", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/etag.git" + }, + "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "version": "1.8.1" +} diff --git a/node_modules/events/.npmignore b/node_modules/events/.npmignore new file mode 100644 index 000000000..3c3629e64 --- /dev/null +++ b/node_modules/events/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/events/.travis.yml b/node_modules/events/.travis.yml new file mode 100644 index 000000000..002b04229 --- /dev/null +++ b/node_modules/events/.travis.yml @@ -0,0 +1,8 @@ +sudo: false +language: node_js +node_js: +- '0.10' +env: + global: + - secure: XcBiD8yReflut9q7leKsigDZ0mI3qTKH+QrNVY8DaqlomJOZw8aOrVuX9Jz12l86ZJ41nbxmKnRNkFzcVr9mbP9YaeTb3DpeOBWmvaoSfud9Wnc16VfXtc1FCcwDhSVcSiM3UtnrmFU5cH+Dw1LPh5PbfylYOS/nJxUvG0FFLqI= + - secure: jNWtEbqhUdQ0xXDHvCYfUbKYeJCi6a7B4LsrcxYCyWWn4NIgncE5x2YbB+FSUUFVYfz0dsn5RKP1oHB99f0laUEo18HBNkrAS/rtyOdVzcpJjbQ6kgSILGjnJD/Ty1B57Rcz3iyev5Y7bLZ6Y1FbDnk/i9/l0faOGz8vTC3Vdkc= diff --git a/node_modules/events/.zuul.yml b/node_modules/events/.zuul.yml new file mode 100644 index 000000000..a8e35afd3 --- /dev/null +++ b/node_modules/events/.zuul.yml @@ -0,0 +1,12 @@ +ui: mocha-qunit +browsers: + - name: chrome + version: latest + - name: firefox + version: latest + - name: safari + version: 5..latest + - name: iphone + version: latest + - name: ie + version: 8..latest diff --git a/node_modules/events/History.md b/node_modules/events/History.md new file mode 100644 index 000000000..b345858e7 --- /dev/null +++ b/node_modules/events/History.md @@ -0,0 +1,42 @@ +# 1.1.1 (2016-06-22) + + - add more context to errors if they are not instanceof Error + +# 1.1.0 (2015-09-29) + + - add Emitter#listerCount (to match node v4 api) + +# 1.0.2 (2014-08-28) + + - remove un-reachable code + - update devDeps + +## 1.0.1 / 2014-05-11 + + - check for console.trace before using it + +## 1.0.0 / 2013-12-10 + + - Update to latest events code from node.js 0.10 + - copy tests from node.js + +## 0.4.0 / 2011-07-03 ## + + - Switching to graphquire@0.8.0 + +## 0.3.0 / 2011-07-03 ## + + - Switching to URL based module require. + +## 0.2.0 / 2011-06-10 ## + + - Simplified package structure. + - Graphquire for dependency management. + +## 0.1.1 / 2011-05-16 ## + + - Unhandled errors are logged via console.error + +## 0.1.0 / 2011-04-22 ## + + - Initial release diff --git a/node_modules/events/LICENSE b/node_modules/events/LICENSE new file mode 100644 index 000000000..52ed3b0a6 --- /dev/null +++ b/node_modules/events/LICENSE @@ -0,0 +1,22 @@ +MIT + +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. diff --git a/node_modules/events/Readme.md b/node_modules/events/Readme.md new file mode 100644 index 000000000..02694efa6 --- /dev/null +++ b/node_modules/events/Readme.md @@ -0,0 +1,19 @@ +# events [![Build Status](https://travis-ci.org/Gozala/events.png?branch=master)](https://travis-ci.org/Gozala/events) + +Node's event emitter for all engines. + +## Install ## + +``` +npm install events +``` + +## Require ## + +```javascript +var EventEmitter = require('events').EventEmitter +``` + +## Usage ## + +See the [node.js event emitter docs](http://nodejs.org/api/events.html) diff --git a/node_modules/events/events.js b/node_modules/events/events.js new file mode 100644 index 000000000..1619a623a --- /dev/null +++ b/node_modules/events/events.js @@ -0,0 +1,302 @@ +// 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. + +function EventEmitter() { + this._events = this._events || {}; + this._maxListeners = this._maxListeners || undefined; +} +module.exports = EventEmitter; + +// Backwards-compat with node 0.10.x +EventEmitter.EventEmitter = EventEmitter; + +EventEmitter.prototype._events = undefined; +EventEmitter.prototype._maxListeners = undefined; + +// By default EventEmitters will print a warning if more than 10 listeners are +// added to it. This is a useful default which helps finding memory leaks. +EventEmitter.defaultMaxListeners = 10; + +// Obviously not all Emitters should be limited to 10. This function allows +// that to be increased. Set to zero for unlimited. +EventEmitter.prototype.setMaxListeners = function(n) { + if (!isNumber(n) || n < 0 || isNaN(n)) + throw TypeError('n must be a positive number'); + this._maxListeners = n; + return this; +}; + +EventEmitter.prototype.emit = function(type) { + var er, handler, len, args, i, listeners; + + if (!this._events) + this._events = {}; + + // If there is no 'error' event listener then throw. + if (type === 'error') { + if (!this._events.error || + (isObject(this._events.error) && !this._events.error.length)) { + er = arguments[1]; + if (er instanceof Error) { + throw er; // Unhandled 'error' event + } else { + // At least give some kind of context to the user + var err = new Error('Uncaught, unspecified "error" event. (' + er + ')'); + err.context = er; + throw err; + } + } + } + + handler = this._events[type]; + + if (isUndefined(handler)) + return false; + + if (isFunction(handler)) { + switch (arguments.length) { + // fast cases + case 1: + handler.call(this); + break; + case 2: + handler.call(this, arguments[1]); + break; + case 3: + handler.call(this, arguments[1], arguments[2]); + break; + // slower + default: + args = Array.prototype.slice.call(arguments, 1); + handler.apply(this, args); + } + } else if (isObject(handler)) { + args = Array.prototype.slice.call(arguments, 1); + listeners = handler.slice(); + len = listeners.length; + for (i = 0; i < len; i++) + listeners[i].apply(this, args); + } + + return true; +}; + +EventEmitter.prototype.addListener = function(type, listener) { + var m; + + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events) + this._events = {}; + + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (this._events.newListener) + this.emit('newListener', type, + isFunction(listener.listener) ? + listener.listener : listener); + + if (!this._events[type]) + // Optimize the case of one listener. Don't need the extra array object. + this._events[type] = listener; + else if (isObject(this._events[type])) + // If we've already got an array, just append. + this._events[type].push(listener); + else + // Adding the second element, need to change to array. + this._events[type] = [this._events[type], listener]; + + // Check for listener leak + if (isObject(this._events[type]) && !this._events[type].warned) { + if (!isUndefined(this._maxListeners)) { + m = this._maxListeners; + } else { + m = EventEmitter.defaultMaxListeners; + } + + if (m && m > 0 && this._events[type].length > m) { + this._events[type].warned = true; + console.error('(node) warning: possible EventEmitter memory ' + + 'leak detected. %d listeners added. ' + + 'Use emitter.setMaxListeners() to increase limit.', + this._events[type].length); + if (typeof console.trace === 'function') { + // not supported in IE 10 + console.trace(); + } + } + } + + return this; +}; + +EventEmitter.prototype.on = EventEmitter.prototype.addListener; + +EventEmitter.prototype.once = function(type, listener) { + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + var fired = false; + + function g() { + this.removeListener(type, g); + + if (!fired) { + fired = true; + listener.apply(this, arguments); + } + } + + g.listener = listener; + this.on(type, g); + + return this; +}; + +// emits a 'removeListener' event iff the listener was removed +EventEmitter.prototype.removeListener = function(type, listener) { + var list, position, length, i; + + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events || !this._events[type]) + return this; + + list = this._events[type]; + length = list.length; + position = -1; + + if (list === listener || + (isFunction(list.listener) && list.listener === listener)) { + delete this._events[type]; + if (this._events.removeListener) + this.emit('removeListener', type, listener); + + } else if (isObject(list)) { + for (i = length; i-- > 0;) { + if (list[i] === listener || + (list[i].listener && list[i].listener === listener)) { + position = i; + break; + } + } + + if (position < 0) + return this; + + if (list.length === 1) { + list.length = 0; + delete this._events[type]; + } else { + list.splice(position, 1); + } + + if (this._events.removeListener) + this.emit('removeListener', type, listener); + } + + return this; +}; + +EventEmitter.prototype.removeAllListeners = function(type) { + var key, listeners; + + if (!this._events) + return this; + + // not listening for removeListener, no need to emit + if (!this._events.removeListener) { + if (arguments.length === 0) + this._events = {}; + else if (this._events[type]) + delete this._events[type]; + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + for (key in this._events) { + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = {}; + return this; + } + + listeners = this._events[type]; + + if (isFunction(listeners)) { + this.removeListener(type, listeners); + } else if (listeners) { + // LIFO order + while (listeners.length) + this.removeListener(type, listeners[listeners.length - 1]); + } + delete this._events[type]; + + return this; +}; + +EventEmitter.prototype.listeners = function(type) { + var ret; + if (!this._events || !this._events[type]) + ret = []; + else if (isFunction(this._events[type])) + ret = [this._events[type]]; + else + ret = this._events[type].slice(); + return ret; +}; + +EventEmitter.prototype.listenerCount = function(type) { + if (this._events) { + var evlistener = this._events[type]; + + if (isFunction(evlistener)) + return 1; + else if (evlistener) + return evlistener.length; + } + return 0; +}; + +EventEmitter.listenerCount = function(emitter, type) { + return emitter.listenerCount(type); +}; + +function isFunction(arg) { + return typeof arg === 'function'; +} + +function isNumber(arg) { + return typeof arg === 'number'; +} + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} + +function isUndefined(arg) { + return arg === void 0; +} diff --git a/node_modules/events/package.json b/node_modules/events/package.json new file mode 100644 index 000000000..4aeb621ea --- /dev/null +++ b/node_modules/events/package.json @@ -0,0 +1,64 @@ +{ + "_from": "events@^1.0.2", + "_id": "events@1.1.1", + "_inBundle": false, + "_integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", + "_location": "/events", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "events@^1.0.2", + "name": "events", + "escapedName": "events", + "rawSpec": "^1.0.2", + "saveSpec": null, + "fetchSpec": "^1.0.2" + }, + "_requiredBy": [ + "/budo", + "/watchify-middleware" + ], + "_resolved": "http://registry.npmjs.org/events/-/events-1.1.1.tgz", + "_shasum": "9ebdb7635ad099c70dcc4c2a1f5004288e8bd924", + "_spec": "events@^1.0.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", + "author": { + "name": "Irakli Gozalishvili", + "email": "rfobic@gmail.com", + "url": "http://jeditoolkit.com" + }, + "bugs": { + "url": "http://github.com/Gozala/events/issues/" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Node's event emitter for all engines.", + "devDependencies": { + "mocha": "~1.21.4", + "zuul": "~1.10.2" + }, + "engines": { + "node": ">=0.4.x" + }, + "homepage": "https://github.com/Gozala/events#readme", + "id": "events", + "keywords": [ + "events", + "eventEmitter", + "eventDispatcher", + "listeners" + ], + "license": "MIT", + "main": "./events.js", + "name": "events", + "repository": { + "type": "git", + "url": "git://github.com/Gozala/events.git", + "web": "https://github.com/Gozala/events" + }, + "scripts": { + "test": "mocha --ui qunit -- tests/index.js && zuul -- tests/index.js" + }, + "version": "1.1.1" +} diff --git a/node_modules/events/tests/add-listeners.js b/node_modules/events/tests/add-listeners.js new file mode 100644 index 000000000..5ab874cea --- /dev/null +++ b/node_modules/events/tests/add-listeners.js @@ -0,0 +1,63 @@ +// 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 assert = require('assert'); +var events = require('../'); + +var e = new events.EventEmitter(); + +var events_new_listener_emited = []; +var listeners_new_listener_emited = []; +var times_hello_emited = 0; + +// sanity check +assert.equal(e.addListener, e.on); + +e.on('newListener', function(event, listener) { + console.log('newListener: ' + event); + events_new_listener_emited.push(event); + listeners_new_listener_emited.push(listener); +}); + +function hello(a, b) { + console.log('hello'); + times_hello_emited += 1; + assert.equal('a', a); + assert.equal('b', b); +} +e.on('hello', hello); + +var foo = function() {}; +e.once('foo', foo); + +console.log('start'); + +e.emit('hello', 'a', 'b'); + + +// just make sure that this doesn't throw: +var f = new events.EventEmitter(); +f.setMaxListeners(0); + +assert.deepEqual(['hello', 'foo'], events_new_listener_emited); +assert.deepEqual([hello, foo], listeners_new_listener_emited); +assert.equal(1, times_hello_emited); + diff --git a/node_modules/events/tests/check-listener-leaks.js b/node_modules/events/tests/check-listener-leaks.js new file mode 100644 index 000000000..e07866a50 --- /dev/null +++ b/node_modules/events/tests/check-listener-leaks.js @@ -0,0 +1,86 @@ +// 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 assert = require('assert'); +var events = require('../'); + +var e = new events.EventEmitter(); + +// default +for (var i = 0; i < 10; i++) { + e.on('default', function() {}); +} +assert.ok(!e._events['default'].hasOwnProperty('warned')); +e.on('default', function() {}); +assert.ok(e._events['default'].warned); + +// specific +e.setMaxListeners(5); +for (var i = 0; i < 5; i++) { + e.on('specific', function() {}); +} +assert.ok(!e._events['specific'].hasOwnProperty('warned')); +e.on('specific', function() {}); +assert.ok(e._events['specific'].warned); + +// only one +e.setMaxListeners(1); +e.on('only one', function() {}); +assert.ok(!e._events['only one'].hasOwnProperty('warned')); +e.on('only one', function() {}); +assert.ok(e._events['only one'].hasOwnProperty('warned')); + +// unlimited +e.setMaxListeners(0); +for (var i = 0; i < 1000; i++) { + e.on('unlimited', function() {}); +} +assert.ok(!e._events['unlimited'].hasOwnProperty('warned')); + +// process-wide +events.EventEmitter.defaultMaxListeners = 42; +e = new events.EventEmitter(); + +for (var i = 0; i < 42; ++i) { + e.on('fortytwo', function() {}); +} +assert.ok(!e._events['fortytwo'].hasOwnProperty('warned')); +e.on('fortytwo', function() {}); +assert.ok(e._events['fortytwo'].hasOwnProperty('warned')); +delete e._events['fortytwo'].warned; + +events.EventEmitter.defaultMaxListeners = 44; +e.on('fortytwo', function() {}); +assert.ok(!e._events['fortytwo'].hasOwnProperty('warned')); +e.on('fortytwo', function() {}); +assert.ok(e._events['fortytwo'].hasOwnProperty('warned')); + +// but _maxListeners still has precedence over defaultMaxListeners +events.EventEmitter.defaultMaxListeners = 42; +e = new events.EventEmitter(); +e.setMaxListeners(1); +e.on('uno', function() {}); +assert.ok(!e._events['uno'].hasOwnProperty('warned')); +e.on('uno', function() {}); +assert.ok(e._events['uno'].hasOwnProperty('warned')); + +// chainable +assert.strictEqual(e, e.setMaxListeners(1)); diff --git a/node_modules/events/tests/common.js b/node_modules/events/tests/common.js new file mode 100644 index 000000000..66f70a390 --- /dev/null +++ b/node_modules/events/tests/common.js @@ -0,0 +1,42 @@ +var assert = require('assert'); + +var mustCallChecks = []; + +function runCallChecks() { + var failed_count = 0; + for (var i=0 ; i< mustCallChecks.length; ++i) { + var context = mustCallChecks[i]; + if (context.actual === context.expected) { + continue; + } + + failed_count++; + console.log('Mismatched %s function calls. Expected %d, actual %d.', + context.name, + context.expected, + context.actual); + console.log(context.stack.split('\n').slice(2).join('\n')); + } + + assert(failed_count === 0); +} + +after(runCallChecks); + +exports.mustCall = function(fn, expected) { + if (typeof expected !== 'number') expected = 1; + + var context = { + expected: expected, + actual: 0, + stack: (new Error).stack, + name: fn.name || '' + }; + + mustCallChecks.push(context); + + return function() { + context.actual++; + return fn.apply(this, arguments); + }; +}; diff --git a/node_modules/events/tests/index.js b/node_modules/events/tests/index.js new file mode 100644 index 000000000..f144530b9 --- /dev/null +++ b/node_modules/events/tests/index.js @@ -0,0 +1,25 @@ + +require('./legacy-compat'); + +// we do this to easily wrap each file in a mocha test +// and also have browserify be able to statically analyze this file +var orig_require = require; +var require = function(file) { + test(file, function() { + orig_require(file); + }); +} + +require('./add-listeners.js'); +require('./check-listener-leaks.js'); +require('./listener-count.js'); +require('./listeners-side-effects.js'); +require('./listeners.js'); +require('./max-listeners.js'); +require('./modify-in-emit.js'); +require('./num-args.js'); +require('./once.js'); +require('./set-max-listeners-side-effects.js'); +require('./subclass.js'); +require('./remove-all-listeners.js'); +require('./remove-listeners.js'); diff --git a/node_modules/events/tests/legacy-compat.js b/node_modules/events/tests/legacy-compat.js new file mode 100644 index 000000000..afbc0ab83 --- /dev/null +++ b/node_modules/events/tests/legacy-compat.js @@ -0,0 +1,18 @@ +// sigh... life is hard +if (!global.console) { + console = {} +} + +var fns = ['log', 'error', 'trace']; +for (var i=0 ; ifoo should not be emitted', '!'); +}; + +e.once('foo', remove); +e.removeListener('foo', remove); +e.emit('foo'); + +var times_recurse_emitted = 0; + +e.once('e', function() { + e.emit('e'); + times_recurse_emitted++; +}); + +e.once('e', function() { + times_recurse_emitted++; +}); + +e.emit('e'); + +assert.equal(1, times_hello_emited); +assert.equal(2, times_recurse_emitted); diff --git a/node_modules/events/tests/remove-all-listeners.js b/node_modules/events/tests/remove-all-listeners.js new file mode 100644 index 000000000..b3dc886e7 --- /dev/null +++ b/node_modules/events/tests/remove-all-listeners.js @@ -0,0 +1,80 @@ +// 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 common = require('./common'); +var assert = require('assert'); +var events = require('../'); + +var after_checks = []; +after(function() { + for (var i=0 ; i +// { key: , +// iv: } + +const cipher = crypto.createCipheriv('aes-256-cbc', result.key, result.iv) +``` + +## LICENSE [MIT](LICENSE) + +[1]: https://wiki.openssl.org/index.php/Manual:EVP_BytesToKey(3) +[2]: https://nodejs.org/api/crypto.html#crypto_class_hash diff --git a/node_modules/evp_bytestokey/index.js b/node_modules/evp_bytestokey/index.js new file mode 100644 index 000000000..f9d4757dd --- /dev/null +++ b/node_modules/evp_bytestokey/index.js @@ -0,0 +1,45 @@ +var Buffer = require('safe-buffer').Buffer +var MD5 = require('md5.js') + +/* eslint-disable camelcase */ +function EVP_BytesToKey (password, salt, keyBits, ivLen) { + if (!Buffer.isBuffer(password)) password = Buffer.from(password, 'binary') + if (salt) { + if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, 'binary') + if (salt.length !== 8) throw new RangeError('salt should be Buffer with 8 byte length') + } + + var keyLen = keyBits / 8 + var key = Buffer.alloc(keyLen) + var iv = Buffer.alloc(ivLen || 0) + var tmp = Buffer.alloc(0) + + while (keyLen > 0 || ivLen > 0) { + var hash = new MD5() + hash.update(tmp) + hash.update(password) + if (salt) hash.update(salt) + tmp = hash.digest() + + var used = 0 + + if (keyLen > 0) { + var keyStart = key.length - keyLen + used = Math.min(keyLen, tmp.length) + tmp.copy(key, keyStart, 0, used) + keyLen -= used + } + + if (used < tmp.length && ivLen > 0) { + var ivStart = iv.length - ivLen + var length = Math.min(ivLen, tmp.length - used) + tmp.copy(iv, ivStart, used, used + length) + ivLen -= length + } + } + + tmp.fill(0) + return { key: key, iv: iv } +} + +module.exports = EVP_BytesToKey diff --git a/node_modules/evp_bytestokey/package.json b/node_modules/evp_bytestokey/package.json new file mode 100644 index 000000000..7695543a3 --- /dev/null +++ b/node_modules/evp_bytestokey/package.json @@ -0,0 +1,78 @@ +{ + "_from": "evp_bytestokey@^1.0.0", + "_id": "evp_bytestokey@1.0.3", + "_inBundle": false, + "_integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "_location": "/evp_bytestokey", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "evp_bytestokey@^1.0.0", + "name": "evp_bytestokey", + "escapedName": "evp_bytestokey", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/browserify-aes", + "/browserify-cipher", + "/parse-asn1" + ], + "_resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "_shasum": "7fcbdb198dc71959432efe13842684e0525acb02", + "_spec": "evp_bytestokey@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify-cipher", + "author": { + "name": "Calvin Metcalf", + "email": "calvin.metcalf@gmail.com" + }, + "bugs": { + "url": "https://github.com/crypto-browserify/EVP_BytesToKey/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Kirill Fomichev", + "email": "fanatid@ya.ru" + } + ], + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + }, + "deprecated": false, + "description": "The insecure key derivation algorithm from OpenSSL", + "devDependencies": { + "bindings": "^1.2.1", + "nan": "^2.4.0", + "nyc": "^8.1.0", + "standard": "^8.0.0", + "tape": "^4.6.0" + }, + "files": [ + "index.js" + ], + "gypfile": false, + "homepage": "https://github.com/crypto-browserify/EVP_BytesToKey", + "keywords": [ + "crypto", + "openssl" + ], + "license": "MIT", + "main": "index.js", + "name": "evp_bytestokey", + "repository": { + "type": "git", + "url": "git+https://github.com/crypto-browserify/EVP_BytesToKey.git" + }, + "scripts": { + "coverage": "nyc tape test/*.js", + "lint": "standard", + "test": "npm run lint && npm run unit", + "test:prepare": "node-gyp rebuild", + "unit": "tape test/*.js" + }, + "version": "1.0.3" +} diff --git a/node_modules/execa/index.js b/node_modules/execa/index.js new file mode 100644 index 000000000..06f39697d --- /dev/null +++ b/node_modules/execa/index.js @@ -0,0 +1,366 @@ +'use strict'; +const path = require('path'); +const childProcess = require('child_process'); +const util = require('util'); +const crossSpawn = require('cross-spawn'); +const stripEof = require('strip-eof'); +const npmRunPath = require('npm-run-path'); +const isStream = require('is-stream'); +const _getStream = require('get-stream'); +const pFinally = require('p-finally'); +const onExit = require('signal-exit'); +const errname = require('./lib/errname'); +const stdio = require('./lib/stdio'); + +const TEN_MEGABYTES = 1000 * 1000 * 10; + +function handleArgs(cmd, args, opts) { + let parsed; + + opts = Object.assign({ + extendEnv: true, + env: {} + }, opts); + + if (opts.extendEnv) { + opts.env = Object.assign({}, process.env, opts.env); + } + + if (opts.__winShell === true) { + delete opts.__winShell; + parsed = { + command: cmd, + args, + options: opts, + file: cmd, + original: { + cmd, + args + } + }; + } else { + parsed = crossSpawn._parse(cmd, args, opts); + } + + opts = Object.assign({ + maxBuffer: TEN_MEGABYTES, + stripEof: true, + preferLocal: true, + localDir: parsed.options.cwd || process.cwd(), + encoding: 'utf8', + reject: true, + cleanup: true + }, parsed.options); + + opts.stdio = stdio(opts); + + if (opts.preferLocal) { + opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir})); + } + + if (opts.detached) { + // #115 + opts.cleanup = false; + } + + if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') { + // #116 + parsed.args.unshift('/q'); + } + + return { + cmd: parsed.command, + args: parsed.args, + opts, + parsed + }; +} + +function handleInput(spawned, opts) { + const input = opts.input; + + if (input === null || input === undefined) { + return; + } + + if (isStream(input)) { + input.pipe(spawned.stdin); + } else { + spawned.stdin.end(input); + } +} + +function handleOutput(opts, val) { + if (val && opts.stripEof) { + val = stripEof(val); + } + + return val; +} + +function handleShell(fn, cmd, opts) { + let file = '/bin/sh'; + let args = ['-c', cmd]; + + opts = Object.assign({}, opts); + + if (process.platform === 'win32') { + opts.__winShell = true; + file = process.env.comspec || 'cmd.exe'; + args = ['/s', '/c', `"${cmd}"`]; + opts.windowsVerbatimArguments = true; + } + + if (opts.shell) { + file = opts.shell; + delete opts.shell; + } + + return fn(file, args, opts); +} + +function getStream(process, stream, encoding, maxBuffer) { + if (!process[stream]) { + return null; + } + + let ret; + + if (encoding) { + ret = _getStream(process[stream], { + encoding, + maxBuffer + }); + } else { + ret = _getStream.buffer(process[stream], {maxBuffer}); + } + + return ret.catch(err => { + err.stream = stream; + err.message = `${stream} ${err.message}`; + throw err; + }); +} + +function makeError(result, options) { + const stdout = result.stdout; + const stderr = result.stderr; + + let err = result.error; + const code = result.code; + const signal = result.signal; + + const parsed = options.parsed; + const joinedCmd = options.joinedCmd; + const timedOut = options.timedOut || false; + + if (!err) { + let output = ''; + + if (Array.isArray(parsed.opts.stdio)) { + if (parsed.opts.stdio[2] !== 'inherit') { + output += output.length > 0 ? stderr : `\n${stderr}`; + } + + if (parsed.opts.stdio[1] !== 'inherit') { + output += `\n${stdout}`; + } + } else if (parsed.opts.stdio !== 'inherit') { + output = `\n${stderr}${stdout}`; + } + + err = new Error(`Command failed: ${joinedCmd}${output}`); + err.code = code < 0 ? errname(code) : code; + } + + err.stdout = stdout; + err.stderr = stderr; + err.failed = true; + err.signal = signal || null; + err.cmd = joinedCmd; + err.timedOut = timedOut; + + return err; +} + +function joinCmd(cmd, args) { + let joinedCmd = cmd; + + if (Array.isArray(args) && args.length > 0) { + joinedCmd += ' ' + args.join(' '); + } + + return joinedCmd; +} + +module.exports = (cmd, args, opts) => { + const parsed = handleArgs(cmd, args, opts); + const encoding = parsed.opts.encoding; + const maxBuffer = parsed.opts.maxBuffer; + const joinedCmd = joinCmd(cmd, args); + + let spawned; + try { + spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts); + } catch (err) { + return Promise.reject(err); + } + + let removeExitHandler; + if (parsed.opts.cleanup) { + removeExitHandler = onExit(() => { + spawned.kill(); + }); + } + + let timeoutId = null; + let timedOut = false; + + const cleanup = () => { + if (timeoutId) { + clearTimeout(timeoutId); + timeoutId = null; + } + + if (removeExitHandler) { + removeExitHandler(); + } + }; + + if (parsed.opts.timeout > 0) { + timeoutId = setTimeout(() => { + timeoutId = null; + timedOut = true; + spawned.kill(parsed.opts.killSignal); + }, parsed.opts.timeout); + } + + const processDone = new Promise(resolve => { + spawned.on('exit', (code, signal) => { + cleanup(); + resolve({code, signal}); + }); + + spawned.on('error', err => { + cleanup(); + resolve({error: err}); + }); + + if (spawned.stdin) { + spawned.stdin.on('error', err => { + cleanup(); + resolve({error: err}); + }); + } + }); + + function destroy() { + if (spawned.stdout) { + spawned.stdout.destroy(); + } + + if (spawned.stderr) { + spawned.stderr.destroy(); + } + } + + const handlePromise = () => pFinally(Promise.all([ + processDone, + getStream(spawned, 'stdout', encoding, maxBuffer), + getStream(spawned, 'stderr', encoding, maxBuffer) + ]).then(arr => { + const result = arr[0]; + result.stdout = arr[1]; + result.stderr = arr[2]; + + if (result.error || result.code !== 0 || result.signal !== null) { + const err = makeError(result, { + joinedCmd, + parsed, + timedOut + }); + + // TODO: missing some timeout logic for killed + // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203 + // err.killed = spawned.killed || killed; + err.killed = err.killed || spawned.killed; + + if (!parsed.opts.reject) { + return err; + } + + throw err; + } + + return { + stdout: handleOutput(parsed.opts, result.stdout), + stderr: handleOutput(parsed.opts, result.stderr), + code: 0, + failed: false, + killed: false, + signal: null, + cmd: joinedCmd, + timedOut: false + }; + }), destroy); + + crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed); + + handleInput(spawned, parsed.opts); + + spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected); + spawned.catch = onrejected => handlePromise().catch(onrejected); + + return spawned; +}; + +module.exports.stdout = function () { + // TODO: set `stderr: 'ignore'` when that option is implemented + return module.exports.apply(null, arguments).then(x => x.stdout); +}; + +module.exports.stderr = function () { + // TODO: set `stdout: 'ignore'` when that option is implemented + return module.exports.apply(null, arguments).then(x => x.stderr); +}; + +module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts); + +module.exports.sync = (cmd, args, opts) => { + const parsed = handleArgs(cmd, args, opts); + const joinedCmd = joinCmd(cmd, args); + + if (isStream(parsed.opts.input)) { + throw new TypeError('The `input` option cannot be a stream in sync mode'); + } + + const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts); + result.code = result.status; + + if (result.error || result.status !== 0 || result.signal !== null) { + const err = makeError(result, { + joinedCmd, + parsed + }); + + if (!parsed.opts.reject) { + return err; + } + + throw err; + } + + return { + stdout: handleOutput(parsed.opts, result.stdout), + stderr: handleOutput(parsed.opts, result.stderr), + code: 0, + failed: false, + signal: null, + cmd: joinedCmd, + timedOut: false + }; +}; + +module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts); + +module.exports.spawn = util.deprecate(module.exports, 'execa.spawn() is deprecated. Use execa() instead.'); diff --git a/node_modules/execa/lib/errname.js b/node_modules/execa/lib/errname.js new file mode 100644 index 000000000..5395e2e5a --- /dev/null +++ b/node_modules/execa/lib/errname.js @@ -0,0 +1,39 @@ +'use strict'; +// Older verions of Node might not have `util.getSystemErrorName()`. +// In that case, fall back to a deprecated internal. +const util = require('util'); + +let uv; + +if (typeof util.getSystemErrorName === 'function') { + module.exports = util.getSystemErrorName; +} else { + try { + uv = process.binding('uv'); + + if (typeof uv.errname !== 'function') { + throw new TypeError('uv.errname is not a function'); + } + } catch (err) { + console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err); + uv = null; + } + + module.exports = code => errname(uv, code); +} + +// Used for testing the fallback behavior +module.exports.__test__ = errname; + +function errname(uv, code) { + if (uv) { + return uv.errname(code); + } + + if (!(code < 0)) { + throw new Error('err >= 0'); + } + + return `Unknown system error ${code}`; +} + diff --git a/node_modules/execa/lib/stdio.js b/node_modules/execa/lib/stdio.js new file mode 100644 index 000000000..a82d46838 --- /dev/null +++ b/node_modules/execa/lib/stdio.js @@ -0,0 +1,41 @@ +'use strict'; +const alias = ['stdin', 'stdout', 'stderr']; + +const hasAlias = opts => alias.some(x => Boolean(opts[x])); + +module.exports = opts => { + if (!opts) { + return null; + } + + if (opts.stdio && hasAlias(opts)) { + throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`); + } + + if (typeof opts.stdio === 'string') { + return opts.stdio; + } + + const stdio = opts.stdio || []; + + if (!Array.isArray(stdio)) { + throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); + } + + const result = []; + const len = Math.max(stdio.length, alias.length); + + for (let i = 0; i < len; i++) { + let value = null; + + if (stdio[i] !== undefined) { + value = stdio[i]; + } else if (opts[alias[i]] !== undefined) { + value = opts[alias[i]]; + } + + result[i] = value; + } + + return result; +}; diff --git a/node_modules/execa/license b/node_modules/execa/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/execa/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/execa/package.json b/node_modules/execa/package.json new file mode 100644 index 000000000..eae81759f --- /dev/null +++ b/node_modules/execa/package.json @@ -0,0 +1,108 @@ +{ + "_from": "execa@^0.10.0", + "_id": "execa@0.10.0", + "_inBundle": false, + "_integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==", + "_location": "/execa", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "execa@^0.10.0", + "name": "execa", + "escapedName": "execa", + "rawSpec": "^0.10.0", + "saveSpec": null, + "fetchSpec": "^0.10.0" + }, + "_requiredBy": [ + "/default-gateway" + ], + "_resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz", + "_shasum": "ff456a8f53f90f8eccc71a96d11bdfc7f082cb50", + "_spec": "execa@^0.10.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/default-gateway", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/execa/issues" + }, + "bundleDependencies": false, + "dependencies": { + "cross-spawn": "^6.0.0", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "deprecated": false, + "description": "A better `child_process`", + "devDependencies": { + "ava": "*", + "cat-names": "^1.0.2", + "coveralls": "^2.11.9", + "delay": "^2.0.0", + "is-running": "^2.0.0", + "nyc": "^11.0.2", + "tempfile": "^2.0.0", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js", + "lib" + ], + "homepage": "https://github.com/sindresorhus/execa#readme", + "keywords": [ + "exec", + "child", + "process", + "execute", + "fork", + "execfile", + "spawn", + "file", + "shell", + "bin", + "binary", + "binaries", + "npm", + "path", + "local" + ], + "license": "MIT", + "maintainers": [ + { + "name": "James Talmage", + "email": "james@talmage.io", + "url": "github.com/jamestalmage" + } + ], + "name": "execa", + "nyc": { + "reporter": [ + "text", + "lcov" + ], + "exclude": [ + "**/fixtures/**", + "**/test.js", + "**/test/**" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/execa.git" + }, + "scripts": { + "test": "xo && nyc ava" + }, + "version": "0.10.0" +} diff --git a/node_modules/execa/readme.md b/node_modules/execa/readme.md new file mode 100644 index 000000000..110c0166d --- /dev/null +++ b/node_modules/execa/readme.md @@ -0,0 +1,304 @@ +# execa [![Build Status: Linux](https://travis-ci.org/sindresorhus/execa.svg?branch=master)](https://travis-ci.org/sindresorhus/execa) [![Build status: Windows](https://ci.appveyor.com/api/projects/status/x5ajamxtjtt93cqv/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/execa/branch/master) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/execa/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/execa?branch=master) + +> A better [`child_process`](https://nodejs.org/api/child_process.html) + + +## Why + +- Promise interface. +- [Strips EOF](https://github.com/sindresorhus/strip-eof) from the output so you don't have to `stdout.trim()`. +- Supports [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) binaries cross-platform. +- [Improved Windows support.](https://github.com/IndigoUnited/node-cross-spawn#why) +- Higher max buffer. 10 MB instead of 200 KB. +- [Executes locally installed binaries by name.](#preferlocal) +- [Cleans up spawned processes when the parent process dies.](#cleanup) + + +## Install + +``` +$ npm install --save execa +``` + + +## Usage + +```js +const execa = require('execa'); + +execa('echo', ['unicorns']).then(result => { + console.log(result.stdout); + //=> 'unicorns' +}); + +// pipe the child process stdout to the current stdout +execa('echo', ['unicorns']).stdout.pipe(process.stdout); + +execa.shell('echo unicorns').then(result => { + console.log(result.stdout); + //=> 'unicorns' +}); + +// example of catching an error +execa.shell('exit 3').catch(error => { + console.log(error); + /* + { + message: 'Command failed: /bin/sh -c exit 3' + killed: false, + code: 3, + signal: null, + cmd: '/bin/sh -c exit 3', + stdout: '', + stderr: '', + timedOut: false + } + */ +}); + +// example of catching an error with a sync method +try { + execa.shellSync('exit 3'); +} catch (err) { + console.log(err); + /* + { + message: 'Command failed: /bin/sh -c exit 3' + code: 3, + signal: null, + cmd: '/bin/sh -c exit 3', + stdout: '', + stderr: '', + timedOut: false + } + */ +} +``` + + +## API + +### execa(file, [arguments], [options]) + +Execute a file. + +Think of this as a mix of `child_process.execFile` and `child_process.spawn`. + +Returns a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess), which is enhanced to also be a `Promise` for a result `Object` with `stdout` and `stderr` properties. + +### execa.stdout(file, [arguments], [options]) + +Same as `execa()`, but returns only `stdout`. + +### execa.stderr(file, [arguments], [options]) + +Same as `execa()`, but returns only `stderr`. + +### execa.shell(command, [options]) + +Execute a command through the system shell. Prefer `execa()` whenever possible, as it's both faster and safer. + +Returns a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess). + +The `child_process` instance is enhanced to also be promise for a result object with `stdout` and `stderr` properties. + +### execa.sync(file, [arguments], [options]) + +Execute a file synchronously. + +Returns the same result object as [`child_process.spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options). + +This method throws an `Error` if the command fails. + +### execa.shellSync(file, [options]) + +Execute a command synchronously through the system shell. + +Returns the same result object as [`child_process.spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options). + +### options + +Type: `Object` + +#### cwd + +Type: `string`
+Default: `process.cwd()` + +Current working directory of the child process. + +#### env + +Type: `Object`
+Default: `process.env` + +Environment key-value pairs. Extends automatically from `process.env`. Set `extendEnv` to `false` if you don't want this. + +#### extendEnv + +Type: `boolean`
+Default: `true` + +Set to `false` if you don't want to extend the environment variables when providing the `env` property. + +#### argv0 + +Type: `string` + +Explicitly set the value of `argv[0]` sent to the child process. This will be set to `command` or `file` if not specified. + +#### stdio + +Type: `Array` `string`
+Default: `pipe` + +Child's [stdio](https://nodejs.org/api/child_process.html#child_process_options_stdio) configuration. + +#### detached + +Type: `boolean` + +Prepare child to run independently of its parent process. Specific behavior [depends on the platform](https://nodejs.org/api/child_process.html#child_process_options_detached). + +#### uid + +Type: `number` + +Sets the user identity of the process. + +#### gid + +Type: `number` + +Sets the group identity of the process. + +#### shell + +Type: `boolean` `string`
+Default: `false` + +If `true`, runs `command` inside of a shell. Uses `/bin/sh` on UNIX and `cmd.exe` on Windows. A different shell can be specified as a string. The shell should understand the `-c` switch on UNIX or `/d /s /c` on Windows. + +#### stripEof + +Type: `boolean`
+Default: `true` + +[Strip EOF](https://github.com/sindresorhus/strip-eof) (last newline) from the output. + +#### preferLocal + +Type: `boolean`
+Default: `true` + +Prefer locally installed binaries when looking for a binary to execute.
+If you `$ npm install foo`, you can then `execa('foo')`. + +#### localDir + +Type: `string`
+Default: `process.cwd()` + +Preferred path to find locally installed binaries in (use with `preferLocal`). + +#### input + +Type: `string` `Buffer` `stream.Readable` + +Write some input to the `stdin` of your binary.
+Streams are not allowed when using the synchronous methods. + +#### reject + +Type: `boolean`
+Default: `true` + +Setting this to `false` resolves the promise with the error instead of rejecting it. + +#### cleanup + +Type: `boolean`
+Default: `true` + +Keep track of the spawned process and `kill` it when the parent process exits. + +#### encoding + +Type: `string`
+Default: `utf8` + +Specify the character encoding used to decode the `stdout` and `stderr` output. + +#### timeout + +Type: `number`
+Default: `0` + +If timeout is greater than `0`, the parent will send the signal identified by the `killSignal` property (the default is `SIGTERM`) if the child runs longer than timeout milliseconds. + +#### maxBuffer + +Type: `number`
+Default: `10000000` (10MB) + +Largest amount of data in bytes allowed on `stdout` or `stderr`. + +#### killSignal + +Type: `string` `number`
+Default: `SIGTERM` + +Signal value to be used when the spawned process will be killed. + +#### stdin + +Type: `string` `number` `Stream` `undefined` `null`
+Default: `pipe` + +Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio). + +#### stdout + +Type: `string` `number` `Stream` `undefined` `null`
+Default: `pipe` + +Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio). + +#### stderr + +Type: `string` `number` `Stream` `undefined` `null`
+Default: `pipe` + +Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio). + +#### windowsVerbatimArguments + +Type: `boolean`
+Default: `false` + +If `true`, no quoting or escaping of arguments is done on Windows. Ignored on other platforms. This is set to `true` automatically when the `shell` option is `true`. + + +## Tips + +### Save and pipe output from a child process + +Let's say you want to show the output of a child process in real-time while also saving it to a variable. + +```js +const execa = require('execa'); +const getStream = require('get-stream'); + +const stream = execa('echo', ['foo']).stdout; + +stream.pipe(process.stdout); + +getStream(stream).then(value => { + console.log('child output:', value); +}); +``` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/expand-brackets/LICENSE b/node_modules/expand-brackets/LICENSE new file mode 100644 index 000000000..1e49edf81 --- /dev/null +++ b/node_modules/expand-brackets/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2016, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/expand-brackets/README.md b/node_modules/expand-brackets/README.md new file mode 100644 index 000000000..d3c913e7a --- /dev/null +++ b/node_modules/expand-brackets/README.md @@ -0,0 +1,107 @@ +# expand-brackets [![NPM version](https://img.shields.io/npm/v/expand-brackets.svg?style=flat)](https://www.npmjs.com/package/expand-brackets) [![NPM downloads](https://img.shields.io/npm/dm/expand-brackets.svg?style=flat)](https://npmjs.org/package/expand-brackets) [![Build Status](https://img.shields.io/travis/jonschlinkert/expand-brackets.svg?style=flat)](https://travis-ci.org/jonschlinkert/expand-brackets) + +> Expand POSIX bracket expressions (character classes) in glob patterns. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install expand-brackets --save +``` + +## Usage + +```js +var brackets = require('expand-brackets'); + +brackets('[![:lower:]]'); +//=> '[^a-z]' +``` + +## .isMatch + +Return true if the given string matches the bracket expression: + +```js +brackets.isMatch('A', '[![:lower:]]'); +//=> true + +brackets.isMatch('a', '[![:lower:]]'); +//=> false +``` + +## .makeRe + +Make a regular expression from a bracket expression: + +```js +brackets.makeRe('[![:lower:]]'); +//=> /[^a-z]/ +``` + +The following named POSIX bracket expressions are supported: + +* `[:alnum:]`: Alphanumeric characters (`a-zA-Z0-9]`) +* `[:alpha:]`: Alphabetic characters (`a-zA-Z]`) +* `[:blank:]`: Space and tab (`[ t]`) +* `[:digit:]`: Digits (`[0-9]`) +* `[:lower:]`: Lowercase letters (`[a-z]`) +* `[:punct:]`: Punctuation and symbols. (`[!"#$%&'()*+, -./:;<=>?@ [\]^_``{|}~]`) +* `[:upper:]`: Uppercase letters (`[A-Z]`) +* `[:word:]`: Word characters (letters, numbers and underscores) (`[A-Za-z0-9_]`) +* `[:xdigit:]`: Hexadecimal digits (`[A-Fa-f0-9]`) + +Collating sequences are not supported. + +## Related projects + +You might also be interested in these projects: + +* [extglob](https://www.npmjs.com/package/extglob): Convert extended globs to regex-compatible strings. Add (almost) the expressive power of regular expressions to… [more](https://www.npmjs.com/package/extglob) | [homepage](https://github.com/jonschlinkert/extglob) +* [is-extglob](https://www.npmjs.com/package/is-extglob): Returns true if a string has an extglob. | [homepage](https://github.com/jonschlinkert/is-extglob) +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern.… [more](https://www.npmjs.com/package/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob) +* [is-posix-bracket](https://www.npmjs.com/package/is-posix-bracket): Returns true if the given string is a POSIX bracket expression (POSIX character class). | [homepage](https://github.com/jonschlinkert/is-posix-bracket) +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just… [more](https://www.npmjs.com/package/micromatch) | [homepage](https://github.com/jonschlinkert/micromatch) + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/expand-brackets/issues/new). + +## Building docs + +Generate readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install verb && npm run docs +``` + +Or, if [verb](https://github.com/verbose/verb) is installed globally: + +```sh +$ verb +``` + +## Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +## Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +verb © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/expand-brackets/blob/master/LICENSE). + +*** + +_This file was generated by [verb](https://github.com/verbose/verb), v, on April 01, 2016._ \ No newline at end of file diff --git a/node_modules/expand-brackets/index.js b/node_modules/expand-brackets/index.js new file mode 100644 index 000000000..b843cc2b1 --- /dev/null +++ b/node_modules/expand-brackets/index.js @@ -0,0 +1,163 @@ +/*! + * expand-brackets + * + * Copyright (c) 2015 Jon Schlinkert. + * Licensed under the MIT license. + */ + +'use strict'; + +var isPosixBracket = require('is-posix-bracket'); + +/** + * POSIX character classes + */ + +var POSIX = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E', + punct: '-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9', +}; + +/** + * Expose `brackets` + */ + +module.exports = brackets; + +function brackets(str) { + if (!isPosixBracket(str)) { + return str; + } + + var negated = false; + if (str.indexOf('[^') !== -1) { + negated = true; + str = str.split('[^').join('['); + } + if (str.indexOf('[!') !== -1) { + negated = true; + str = str.split('[!').join('['); + } + + var a = str.split('['); + var b = str.split(']'); + var imbalanced = a.length !== b.length; + + var parts = str.split(/(?::\]\[:|\[?\[:|:\]\]?)/); + var len = parts.length, i = 0; + var end = '', beg = ''; + var res = []; + + // start at the end (innermost) first + while (len--) { + var inner = parts[i++]; + if (inner === '^[!' || inner === '[!') { + inner = ''; + negated = true; + } + + var prefix = negated ? '^' : ''; + var ch = POSIX[inner]; + + if (ch) { + res.push('[' + prefix + ch + ']'); + } else if (inner) { + if (/^\[?\w-\w\]?$/.test(inner)) { + if (i === parts.length) { + res.push('[' + prefix + inner); + } else if (i === 1) { + res.push(prefix + inner + ']'); + } else { + res.push(prefix + inner); + } + } else { + if (i === 1) { + beg += inner; + } else if (i === parts.length) { + end += inner; + } else { + res.push('[' + prefix + inner + ']'); + } + } + } + } + + var result = res.join('|'); + var rlen = res.length || 1; + if (rlen > 1) { + result = '(?:' + result + ')'; + rlen = 1; + } + if (beg) { + rlen++; + if (beg.charAt(0) === '[') { + if (imbalanced) { + beg = '\\[' + beg.slice(1); + } else { + beg += ']'; + } + } + result = beg + result; + } + if (end) { + rlen++; + if (end.slice(-1) === ']') { + if (imbalanced) { + end = end.slice(0, end.length - 1) + '\\]'; + } else { + end = '[' + end; + } + } + result += end; + } + + if (rlen > 1) { + result = result.split('][').join(']|['); + if (result.indexOf('|') !== -1 && !/\(\?/.test(result)) { + result = '(?:' + result + ')'; + } + } + + result = result.replace(/\[+=|=\]+/g, '\\b'); + return result; +} + +brackets.makeRe = function(pattern) { + try { + return new RegExp(brackets(pattern)); + } catch (err) {} +}; + +brackets.isMatch = function(str, pattern) { + try { + return brackets.makeRe(pattern).test(str); + } catch (err) { + return false; + } +}; + +brackets.match = function(arr, pattern) { + var len = arr.length, i = 0; + var res = arr.slice(); + + var re = brackets.makeRe(pattern); + while (i < len) { + var ele = arr[i++]; + if (!re.test(ele)) { + continue; + } + res.splice(i, 1); + } + return res; +}; diff --git a/node_modules/expand-brackets/package.json b/node_modules/expand-brackets/package.json new file mode 100644 index 000000000..f5f4fe80a --- /dev/null +++ b/node_modules/expand-brackets/package.json @@ -0,0 +1,93 @@ +{ + "_from": "expand-brackets@^0.1.4", + "_id": "expand-brackets@0.1.5", + "_inBundle": false, + "_integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "_location": "/expand-brackets", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "expand-brackets@^0.1.4", + "name": "expand-brackets", + "escapedName": "expand-brackets", + "rawSpec": "^0.1.4", + "saveSpec": null, + "fetchSpec": "^0.1.4" + }, + "_requiredBy": [ + "/micromatch" + ], + "_resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "_shasum": "df07284e342a807cd733ac5af72411e581d1177b", + "_spec": "expand-brackets@^0.1.4", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/expand-brackets/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-posix-bracket": "^0.1.0" + }, + "deprecated": false, + "description": "Expand POSIX bracket expressions (character classes) in glob patterns.", + "devDependencies": { + "gulp-format-md": "^0.1.7", + "mocha": "^2.2.5", + "should": "^7.0.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/expand-brackets", + "keywords": [ + "bracket", + "character class", + "expression", + "posix" + ], + "license": "MIT", + "main": "index.js", + "name": "expand-brackets", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/expand-brackets.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "extglob", + "is-extglob", + "is-glob", + "is-posix-bracket", + "micromatch" + ] + }, + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "0.1.5" +} diff --git a/node_modules/expand-range/LICENSE b/node_modules/expand-range/LICENSE new file mode 100644 index 000000000..b1e51ff71 --- /dev/null +++ b/node_modules/expand-range/LICENSE @@ -0,0 +1,24 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/expand-range/README.md b/node_modules/expand-range/README.md new file mode 100644 index 000000000..72c7e8c6c --- /dev/null +++ b/node_modules/expand-range/README.md @@ -0,0 +1,145 @@ +# expand-range [![NPM version](https://img.shields.io/npm/v/expand-range.svg?style=flat)](https://www.npmjs.com/package/expand-range) [![NPM downloads](https://img.shields.io/npm/dm/expand-range.svg?style=flat)](https://npmjs.org/package/expand-range) [![Build Status](https://img.shields.io/travis/jonschlinkert/expand-range.svg?style=flat)](https://travis-ci.org/jonschlinkert/expand-range) + +Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See the benchmarks. Used by micromatch. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install expand-range --save +``` + +Wraps [fill-range] to do range expansion using `..` separated strings. See [fill-range] for the full list of options and features. + +## Example usage + +```js +var expand = require('expand-range'); +``` + +**Params** + +```js +expand(start, stop, increment); +``` + +* `start`: the number or letter to start with +* `end`: the number or letter to end with +* `increment`: optionally pass the increment to use. works for letters or numbers + +**Examples** + +```js +expand('a..e') +//=> ['a', 'b', 'c', 'd', 'e'] + +expand('a..e..2') +//=> ['a', 'c', 'e'] + +expand('A..E..2') +//=> ['A', 'C', 'E'] + +expand('1..3') +//=> ['1', '2', '3'] + +expand('0..-5') +//=> [ '0', '-1', '-2', '-3', '-4', '-5' ] + +expand('-9..9..3') +//=> [ '-9', '-6', '-3', '0', '3', '6', '9' ]) + +expand('-1..-10..-2') +//=> [ '-1', '-3', '-5', '-7', '-9' ] + +expand('1..10..2') +//=> [ '1', '3', '5', '7', '9' ] +``` + +### Custom function + +Optionally pass a custom function as the second argument: + +```js +expand('a..e', function (val, isNumber, pad, i) { + if (!isNumber) { + return String.fromCharCode(val) + i; + } + return val; +}); +//=> ['a0', 'b1', 'c2', 'd3', 'e4'] +``` + +## Benchmarks + +```sh +# benchmark/fixtures/alpha-lower.js (29 bytes) + brace-expansion x 145,653 ops/sec ±0.89% (87 runs sampled) + expand-range x 453,213 ops/sec ±1.66% (85 runs sampled) + minimatch x 152,193 ops/sec ±1.17% (86 runs sampled) + +# benchmark/fixtures/alpha-upper.js (29 bytes) + brace-expansion x 149,975 ops/sec ±1.10% (88 runs sampled) + expand-range x 459,390 ops/sec ±1.27% (84 runs sampled) + minimatch x 155,253 ops/sec ±1.25% (88 runs sampled) + +# benchmark/fixtures/padded.js (33 bytes) + brace-expansion x 14,694 ops/sec ±1.37% (85 runs sampled) + expand-range x 169,393 ops/sec ±1.76% (80 runs sampled) + minimatch x 15,052 ops/sec ±1.15% (88 runs sampled) + +# benchmark/fixtures/range.js (29 bytes) + brace-expansion x 142,968 ops/sec ±1.35% (86 runs sampled) + expand-range x 465,579 ops/sec ±1.43% (86 runs sampled) + minimatch x 126,872 ops/sec ±1.18% (90 runs sampled) +``` + +## Related projects + +You might also be interested in these projects: + +* [braces](https://www.npmjs.com/package/braces): Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces… [more](https://www.npmjs.com/package/braces) | [homepage](https://github.com/jonschlinkert/braces) +* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or multiplier to… [more](https://www.npmjs.com/package/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range) +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch) + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/expand-range/issues/new). + +## Building docs + +Generate readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install verb && npm run docs +``` + +Or, if [verb](https://github.com/verbose/verb) is installed globally: + +```sh +$ verb +``` + +## Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +## Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/expand-range/blob/master/LICENSE). + +*** + +_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on May 05, 2016._ \ No newline at end of file diff --git a/node_modules/expand-range/index.js b/node_modules/expand-range/index.js new file mode 100644 index 000000000..369962a87 --- /dev/null +++ b/node_modules/expand-range/index.js @@ -0,0 +1,43 @@ +/*! + * expand-range + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT license. + */ + +'use strict'; + +var fill = require('fill-range'); + +module.exports = function expandRange(str, options, fn) { + if (typeof str !== 'string') { + throw new TypeError('expand-range expects a string.'); + } + + if (typeof options === 'function') { + fn = options; + options = {}; + } + + if (typeof options === 'boolean') { + options = {}; + options.makeRe = true; + } + + // create arguments to pass to fill-range + var opts = options || {}; + var args = str.split('..'); + var len = args.length; + if (len > 3) { return str; } + + // if only one argument, it can't expand so return it + if (len === 1) { return args; } + + // if `true`, tell fill-range to regexify the string + if (typeof fn === 'boolean' && fn === true) { + opts.makeRe = true; + } + + args.push(opts); + return fill.apply(null, args.concat(fn)); +}; diff --git a/node_modules/expand-range/package.json b/node_modules/expand-range/package.json new file mode 100644 index 000000000..97655e3b6 --- /dev/null +++ b/node_modules/expand-range/package.json @@ -0,0 +1,104 @@ +{ + "_from": "expand-range@^1.8.1", + "_id": "expand-range@1.8.2", + "_inBundle": false, + "_integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "_location": "/expand-range", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "expand-range@^1.8.1", + "name": "expand-range", + "escapedName": "expand-range", + "rawSpec": "^1.8.1", + "saveSpec": null, + "fetchSpec": "^1.8.1" + }, + "_requiredBy": [ + "/braces" + ], + "_resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "_shasum": "a299effd335fe2721ebae8e257ec79644fc85337", + "_spec": "expand-range@^1.8.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/braces", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/expand-range/issues" + }, + "bundleDependencies": false, + "dependencies": { + "fill-range": "^2.1.0" + }, + "deprecated": false, + "description": "Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See the benchmarks. Used by micromatch.", + "devDependencies": { + "benchmarked": "^0.2.4", + "brace-expansion": "^1.1.4", + "glob": "^7.0.3", + "gulp-format-md": "^0.1.9", + "minimatch": "^3.0.0", + "mocha": "^2.4.5" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/expand-range", + "keywords": [ + "alpha", + "alphabetical", + "bash", + "brace", + "expand", + "expansion", + "glob", + "match", + "matches", + "matching", + "number", + "numerical", + "range", + "ranges", + "sh" + ], + "license": "MIT", + "main": "index.js", + "name": "expand-range", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/expand-range.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "plugins": [ + "gulp-format-md" + ], + "reflinks": [ + "verb" + ], + "toc": false, + "layout": "default", + "lint": { + "reflinks": true + }, + "tasks": [ + "readme" + ], + "related": { + "list": [ + "micromatch", + "fill-range", + "braces" + ] + } + }, + "version": "1.8.2" +} diff --git a/node_modules/extend-shallow/LICENSE b/node_modules/extend-shallow/LICENSE new file mode 100644 index 000000000..99c936915 --- /dev/null +++ b/node_modules/extend-shallow/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, 2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/extend-shallow/README.md b/node_modules/extend-shallow/README.md new file mode 100644 index 000000000..dee226f45 --- /dev/null +++ b/node_modules/extend-shallow/README.md @@ -0,0 +1,97 @@ +# extend-shallow [![NPM version](https://img.shields.io/npm/v/extend-shallow.svg?style=flat)](https://www.npmjs.com/package/extend-shallow) [![NPM monthly downloads](https://img.shields.io/npm/dm/extend-shallow.svg?style=flat)](https://npmjs.org/package/extend-shallow) [![NPM total downloads](https://img.shields.io/npm/dt/extend-shallow.svg?style=flat)](https://npmjs.org/package/extend-shallow) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/extend-shallow.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/extend-shallow) + +> Extend an object with the properties of additional objects. node.js/javascript util. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save extend-shallow +``` + +## Usage + +```js +var extend = require('extend-shallow'); + +extend({a: 'b'}, {c: 'd'}) +//=> {a: 'b', c: 'd'} +``` + +Pass an empty object to shallow clone: + +```js +var obj = {}; +extend(obj, {a: 'b'}, {c: 'd'}) +//=> {a: 'b', c: 'd'} +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") +* [for-in](https://www.npmjs.com/package/for-in): Iterate over the own and inherited enumerable properties of an object, and return an object… [more](https://github.com/jonschlinkert/for-in) | [homepage](https://github.com/jonschlinkert/for-in "Iterate over the own and inherited enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js") +* [for-own](https://www.npmjs.com/package/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) | [homepage](https://github.com/jonschlinkert/for-own "Iterate over the own enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js.") +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 33 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [pdehaan](https://github.com/pdehaan) | + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on November 19, 2017._ \ No newline at end of file diff --git a/node_modules/extend-shallow/index.js b/node_modules/extend-shallow/index.js new file mode 100644 index 000000000..c9582f8f9 --- /dev/null +++ b/node_modules/extend-shallow/index.js @@ -0,0 +1,60 @@ +'use strict'; + +var isExtendable = require('is-extendable'); +var assignSymbols = require('assign-symbols'); + +module.exports = Object.assign || function(obj/*, objects*/) { + if (obj === null || typeof obj === 'undefined') { + throw new TypeError('Cannot convert undefined or null to object'); + } + if (!isObject(obj)) { + obj = {}; + } + for (var i = 1; i < arguments.length; i++) { + var val = arguments[i]; + if (isString(val)) { + val = toObject(val); + } + if (isObject(val)) { + assign(obj, val); + assignSymbols(obj, val); + } + } + return obj; +}; + +function assign(a, b) { + for (var key in b) { + if (hasOwn(b, key)) { + a[key] = b[key]; + } + } +} + +function isString(val) { + return (val && typeof val === 'string'); +} + +function toObject(str) { + var obj = {}; + for (var i in str) { + obj[i] = str[i]; + } + return obj; +} + +function isObject(val) { + return (val && typeof val === 'object') || isExtendable(val); +} + +/** + * Returns true if the given `key` is an own property of `obj`. + */ + +function hasOwn(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} + +function isEnum(obj, key) { + return Object.prototype.propertyIsEnumerable.call(obj, key); +} diff --git a/node_modules/extend-shallow/node_modules/is-extendable/LICENSE b/node_modules/extend-shallow/node_modules/is-extendable/LICENSE new file mode 100644 index 000000000..c0d7f1362 --- /dev/null +++ b/node_modules/extend-shallow/node_modules/is-extendable/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert. + +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. \ No newline at end of file diff --git a/node_modules/extend-shallow/node_modules/is-extendable/README.md b/node_modules/extend-shallow/node_modules/is-extendable/README.md new file mode 100644 index 000000000..875b56a73 --- /dev/null +++ b/node_modules/extend-shallow/node_modules/is-extendable/README.md @@ -0,0 +1,88 @@ +# is-extendable [![NPM version](https://img.shields.io/npm/v/is-extendable.svg?style=flat)](https://www.npmjs.com/package/is-extendable) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-extendable.svg?style=flat)](https://npmjs.org/package/is-extendable) [![NPM total downloads](https://img.shields.io/npm/dt/is-extendable.svg?style=flat)](https://npmjs.org/package/is-extendable) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-extendable.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-extendable) + +> Returns true if a value is a plain object, array or function. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-extendable +``` + +## Usage + +```js +var isExtendable = require('is-extendable'); +``` + +Returns true if the value is any of the following: + +* array +* plain object +* function + +## Notes + +All objects in JavaScript can have keys, but it's a pain to check for this, since we ether need to verify that the value is not `null` or `undefined` and: + +* the value is not a primitive, or +* that the object is a plain object, function or array + +Also note that an `extendable` object is not the same as an [extensible object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible), which is one that (in es6) is not sealed, frozen, or marked as non-extensible using `preventExtensions`. + +## Release history + +### v1.0.0 - 2017/07/20 + +**Breaking changes** + +* No longer considers date, regex or error objects to be extendable + +## About + +### Related projects + +* [assign-deep](https://www.npmjs.com/package/assign-deep): Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target… [more](https://github.com/jonschlinkert/assign-deep) | [homepage](https://github.com/jonschlinkert/assign-deep "Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target (first) object.") +* [is-equal-shallow](https://www.npmjs.com/package/is-equal-shallow): Does a shallow comparison of two objects, returning false if the keys or values differ. | [homepage](https://github.com/jonschlinkert/is-equal-shallow "Does a shallow comparison of two objects, returning false if the keys or values differ.") +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 20, 2017._ \ No newline at end of file diff --git a/node_modules/extend-shallow/node_modules/is-extendable/index.d.ts b/node_modules/extend-shallow/node_modules/is-extendable/index.d.ts new file mode 100644 index 000000000..b96d50754 --- /dev/null +++ b/node_modules/extend-shallow/node_modules/is-extendable/index.d.ts @@ -0,0 +1,5 @@ +export = isExtendable; + +declare function isExtendable(val: any): boolean; + +declare namespace isExtendable {} diff --git a/node_modules/extend-shallow/node_modules/is-extendable/index.js b/node_modules/extend-shallow/node_modules/is-extendable/index.js new file mode 100644 index 000000000..a8b26ad08 --- /dev/null +++ b/node_modules/extend-shallow/node_modules/is-extendable/index.js @@ -0,0 +1,14 @@ +/*! + * is-extendable + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var isPlainObject = require('is-plain-object'); + +module.exports = function isExtendable(val) { + return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); +}; diff --git a/node_modules/extend-shallow/node_modules/is-extendable/package.json b/node_modules/extend-shallow/node_modules/is-extendable/package.json new file mode 100644 index 000000000..8fa16aa9f --- /dev/null +++ b/node_modules/extend-shallow/node_modules/is-extendable/package.json @@ -0,0 +1,98 @@ +{ + "_from": "is-extendable@^1.0.1", + "_id": "is-extendable@1.0.1", + "_inBundle": false, + "_integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "_location": "/extend-shallow/is-extendable", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-extendable@^1.0.1", + "name": "is-extendable", + "escapedName": "is-extendable", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/extend-shallow" + ], + "_resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "_shasum": "a7470f9e426733d81bd81e1155264e3a3507cab4", + "_spec": "is-extendable@^1.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/extend-shallow", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-extendable/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "deprecated": false, + "description": "Returns true if a value is a plain object, array or function.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.4.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/jonschlinkert/is-extendable", + "keywords": [ + "array", + "assign", + "check", + "date", + "extend", + "extendable", + "extensible", + "function", + "is", + "object", + "regex", + "test" + ], + "license": "MIT", + "main": "index.js", + "name": "is-extendable", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-extendable.git" + }, + "scripts": { + "test": "mocha" + }, + "types": "index.d.ts", + "verb": { + "related": { + "list": [ + "assign-deep", + "is-equal-shallow", + "is-plain-object", + "isobject", + "kind-of" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.1" +} diff --git a/node_modules/extend-shallow/package.json b/node_modules/extend-shallow/package.json new file mode 100644 index 000000000..196dfa13b --- /dev/null +++ b/node_modules/extend-shallow/package.json @@ -0,0 +1,126 @@ +{ + "_from": "extend-shallow@^3.0.2", + "_id": "extend-shallow@3.0.2", + "_inBundle": false, + "_integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "_location": "/extend-shallow", + "_phantomChildren": { + "is-plain-object": "2.0.4" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "extend-shallow@^3.0.2", + "name": "extend-shallow", + "escapedName": "extend-shallow", + "rawSpec": "^3.0.2", + "saveSpec": null, + "fetchSpec": "^3.0.2" + }, + "_requiredBy": [ + "/nanomatch", + "/readdirp/micromatch", + "/regex-not", + "/split-string", + "/to-regex" + ], + "_resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "_shasum": "26a71aaf073b39fb2127172746131c2704028db8", + "_spec": "extend-shallow@^3.0.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/extend-shallow/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Peter deHaan", + "url": "http://about.me/peterdehaan" + } + ], + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "deprecated": false, + "description": "Extend an object with the properties of additional objects. node.js/javascript util.", + "devDependencies": { + "array-slice": "^1.0.0", + "benchmarked": "^2.0.0", + "for-own": "^1.0.0", + "gulp-format-md": "^1.0.0", + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.1", + "minimist": "^1.2.0", + "mocha": "^3.5.3", + "object-assign": "^4.1.1" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/extend-shallow", + "keywords": [ + "assign", + "clone", + "extend", + "merge", + "obj", + "object", + "object-assign", + "object.assign", + "prop", + "properties", + "property", + "props", + "shallow", + "util", + "utility", + "utils", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "extend-shallow", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/extend-shallow.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "related": { + "list": [ + "extend-shallow", + "for-in", + "for-own", + "is-plain-object", + "isobject", + "kind-of" + ] + }, + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + }, + "version": "3.0.2" +} diff --git a/node_modules/extglob/LICENSE b/node_modules/extglob/LICENSE new file mode 100644 index 000000000..65f90aca8 --- /dev/null +++ b/node_modules/extglob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/extglob/README.md b/node_modules/extglob/README.md new file mode 100644 index 000000000..666440669 --- /dev/null +++ b/node_modules/extglob/README.md @@ -0,0 +1,88 @@ +# extglob [![NPM version](https://badge.fury.io/js/extglob.svg)](http://badge.fury.io/js/extglob) [![Build Status](https://travis-ci.org/jonschlinkert/extglob.svg)](https://travis-ci.org/jonschlinkert/extglob) + +> Convert extended globs to regex-compatible strings. Add (almost) the expressive power of regular expressions to glob patterns. + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i extglob --save +``` + +Used by [micromatch](https://github.com/jonschlinkert/micromatch). + +**Features** + +* Convert an extglob string to a regex-compatible string. **Only converts extglobs**, to handle full globs use [micromatch](https://github.com/jonschlinkert/micromatch). +* Pass `{regex: true}` to return a regex +* Handles nested patterns +* More complete (and correct) support than [minimatch](https://github.com/isaacs/minimatch) + +## Usage + +```js +var extglob = require('extglob'); + +extglob('?(z)'); +//=> '(?:z)?' +extglob('*(z)'); +//=> '(?:z)*' +extglob('+(z)'); +//=> '(?:z)+' +extglob('@(z)'); +//=> '(?:z)' +extglob('!(z)'); +//=> '(?!^(?:(?!z)[^/]*?)).*$' +``` + +**Optionally return regex** + +```js +extglob('!(z)', {regex: true}); +//=> /(?!^(?:(?!z)[^/]*?)).*$/ +``` + +## Extglob patterns + +To learn more about how extglobs work, see the docs for [Bash pattern matching](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html): + +* `?(pattern)`: Match zero or one occurrence of the given pattern. +* `*(pattern)`: Match zero or more occurrences of the given pattern. +* `+(pattern)`: Match one or more occurrences of the given pattern. +* `@(pattern)`: Match one of the given pattern. +* `!(pattern)`: Match anything except one of the given pattern. + +## Related + +* [braces](https://github.com/jonschlinkert/braces): Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces… [more](https://github.com/jonschlinkert/braces) +* [expand-brackets](https://github.com/jonschlinkert/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. +* [expand-range](https://github.com/jonschlinkert/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See… [more](https://github.com/jonschlinkert/expand-range) +* [fill-range](https://github.com/jonschlinkert/fill-range): Fill in a range of numbers or letters, optionally passing an increment or multiplier to… [more](https://github.com/jonschlinkert/fill-range) +* [micromatch](https://github.com/jonschlinkert/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just… [more](https://github.com/jonschlinkert/micromatch) + +## Run tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/extglob/issues/new) + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 01, 2015._ \ No newline at end of file diff --git a/node_modules/extglob/index.js b/node_modules/extglob/index.js new file mode 100644 index 000000000..2e774d4aa --- /dev/null +++ b/node_modules/extglob/index.js @@ -0,0 +1,178 @@ +/*! + * extglob + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +/** + * Module dependencies + */ + +var isExtglob = require('is-extglob'); +var re, cache = {}; + +/** + * Expose `extglob` + */ + +module.exports = extglob; + +/** + * Convert the given extglob `string` to a regex-compatible + * string. + * + * ```js + * var extglob = require('extglob'); + * extglob('!(a?(b))'); + * //=> '(?!a(?:b)?)[^/]*?' + * ``` + * + * @param {String} `str` The string to convert. + * @param {Object} `options` + * @option {Boolean} [options] `esc` If `false` special characters will not be escaped. Defaults to `true`. + * @option {Boolean} [options] `regex` If `true` a regular expression is returned instead of a string. + * @return {String} + * @api public + */ + + +function extglob(str, opts) { + opts = opts || {}; + var o = {}, i = 0; + + // fix common character reversals + // '*!(.js)' => '*.!(js)' + str = str.replace(/!\(([^\w*()])/g, '$1!('); + + // support file extension negation + str = str.replace(/([*\/])\.!\([*]\)/g, function (m, ch) { + if (ch === '/') { + return escape('\\/[^.]+'); + } + return escape('[^.]+'); + }); + + // create a unique key for caching by + // combining the string and options + var key = str + + String(!!opts.regex) + + String(!!opts.contains) + + String(!!opts.escape); + + if (cache.hasOwnProperty(key)) { + return cache[key]; + } + + if (!(re instanceof RegExp)) { + re = regex(); + } + + opts.negate = false; + var m; + + while (m = re.exec(str)) { + var prefix = m[1]; + var inner = m[3]; + if (prefix === '!') { + opts.negate = true; + } + + var id = '__EXTGLOB_' + (i++) + '__'; + // use the prefix of the _last_ (outtermost) pattern + o[id] = wrap(inner, prefix, opts.escape); + str = str.split(m[0]).join(id); + } + + var keys = Object.keys(o); + var len = keys.length; + + // we have to loop again to allow us to convert + // patterns in reverse order (starting with the + // innermost/last pattern first) + while (len--) { + var prop = keys[len]; + str = str.split(prop).join(o[prop]); + } + + var result = opts.regex + ? toRegex(str, opts.contains, opts.negate) + : str; + + result = result.split('.').join('\\.'); + + // cache the result and return it + return (cache[key] = result); +} + +/** + * Convert `string` to a regex string. + * + * @param {String} `str` + * @param {String} `prefix` Character that determines how to wrap the string. + * @param {Boolean} `esc` If `false` special characters will not be escaped. Defaults to `true`. + * @return {String} + */ + +function wrap(inner, prefix, esc) { + if (esc) inner = escape(inner); + + switch (prefix) { + case '!': + return '(?!' + inner + ')[^/]' + (esc ? '%%%~' : '*?'); + case '@': + return '(?:' + inner + ')'; + case '+': + return '(?:' + inner + ')+'; + case '*': + return '(?:' + inner + ')' + (esc ? '%%' : '*') + case '?': + return '(?:' + inner + '|)'; + default: + return inner; + } +} + +function escape(str) { + str = str.split('*').join('[^/]%%%~'); + str = str.split('.').join('\\.'); + return str; +} + +/** + * extglob regex. + */ + +function regex() { + return /(\\?[@?!+*$]\\?)(\(([^()]*?)\))/; +} + +/** + * Negation regex + */ + +function negate(str) { + return '(?!^' + str + ').*$'; +} + +/** + * Create the regex to do the matching. If + * the leading character in the `pattern` is `!` + * a negation regex is returned. + * + * @param {String} `pattern` + * @param {Boolean} `contains` Allow loose matching. + * @param {Boolean} `isNegated` True if the pattern is a negation pattern. + */ + +function toRegex(pattern, contains, isNegated) { + var prefix = contains ? '^' : ''; + var after = contains ? '$' : ''; + pattern = ('(?:' + pattern + ')' + after); + if (isNegated) { + pattern = prefix + negate(pattern); + } + return new RegExp(prefix + pattern); +} diff --git a/node_modules/extglob/package.json b/node_modules/extglob/package.json new file mode 100644 index 000000000..e8ea71e8d --- /dev/null +++ b/node_modules/extglob/package.json @@ -0,0 +1,85 @@ +{ + "_from": "extglob@^0.3.1", + "_id": "extglob@0.3.2", + "_inBundle": false, + "_integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "_location": "/extglob", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "extglob@^0.3.1", + "name": "extglob", + "escapedName": "extglob", + "rawSpec": "^0.3.1", + "saveSpec": null, + "fetchSpec": "^0.3.1" + }, + "_requiredBy": [ + "/micromatch" + ], + "_resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "_shasum": "2e18ff3d2f49ab2765cec9023f011daa8d8349a1", + "_spec": "extglob@^0.3.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/extglob/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-extglob": "^1.0.0" + }, + "deprecated": false, + "description": "Convert extended globs to regex-compatible strings. Add (almost) the expressive power of regular expressions to glob patterns.", + "devDependencies": { + "ansi-green": "^0.1.1", + "micromatch": "^2.1.6", + "minimatch": "^2.0.1", + "minimist": "^1.1.0", + "mocha": "*", + "should": "*", + "success-symbol": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/extglob", + "keywords": [ + "bash", + "extended", + "extglob", + "glob", + "ksh", + "match", + "wildcard" + ], + "license": "MIT", + "main": "index.js", + "name": "extglob", + "repository": { + "type": "git", + "url": "git://github.com/jonschlinkert/extglob.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "micromatch", + "expand-brackets", + "braces", + "fill-range", + "expand-range" + ] + } + }, + "version": "0.3.2" +} diff --git a/node_modules/filename-regex/LICENSE b/node_modules/filename-regex/LICENSE new file mode 100644 index 000000000..d290fe00b --- /dev/null +++ b/node_modules/filename-regex/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, 2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/filename-regex/README.md b/node_modules/filename-regex/README.md new file mode 100644 index 000000000..2b6b06999 --- /dev/null +++ b/node_modules/filename-regex/README.md @@ -0,0 +1,63 @@ +# filename-regex [![NPM version](https://img.shields.io/npm/v/filename-regex.svg?style=flat)](https://www.npmjs.com/package/filename-regex) [![NPM monthly downloads](https://img.shields.io/npm/dm/filename-regex.svg?style=flat)](https://npmjs.org/package/filename-regex) [![NPM total downloads](https://img.shields.io/npm/dt/filename-regex.svg?style=flat)](https://npmjs.org/package/filename-regex) [![Linux Build Status](https://img.shields.io/travis/regexhq/filename-regex.svg?style=flat&label=Travis)](https://travis-ci.org/regexhq/filename-regex) + +> Regular expression for matching file names, with or without extension. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save filename-regex +``` + +## Usage + +```js +var regex = require('filename-regex'); + +'a/b/c/d.min.js'.match(regex()); +//=> match[0] = 'd.min.js' + +'a/b/c/.dotfile'.match(regex()); +//=> match[0] = '.dotfile' +``` + +## About + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.3, on April 28, 2017._ \ No newline at end of file diff --git a/node_modules/filename-regex/index.js b/node_modules/filename-regex/index.js new file mode 100644 index 000000000..bb1888b4a --- /dev/null +++ b/node_modules/filename-regex/index.js @@ -0,0 +1,10 @@ +/*! + * filename-regex + * + * Copyright (c) 2014-2015, Jon Schlinkert + * Licensed under the MIT license. + */ + +module.exports = function filenameRegex() { + return /([^\\\/]+)$/; +}; diff --git a/node_modules/filename-regex/package.json b/node_modules/filename-regex/package.json new file mode 100644 index 000000000..71e1794fd --- /dev/null +++ b/node_modules/filename-regex/package.json @@ -0,0 +1,81 @@ +{ + "_from": "filename-regex@^2.0.0", + "_id": "filename-regex@2.0.1", + "_inBundle": false, + "_integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "_location": "/filename-regex", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "filename-regex@^2.0.0", + "name": "filename-regex", + "escapedName": "filename-regex", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/micromatch" + ], + "_resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "_shasum": "c1c4b9bee3e09725ddb106b75c1e301fe2f18b26", + "_spec": "filename-regex@^2.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/regexhq/filename-regex/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Regular expression for matching file names, with or without extension.", + "devDependencies": { + "gulp-format-md": "^0.1.12" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/regexhq/filename-regex", + "keywords": [ + "basename", + "file", + "filename", + "filepath", + "match", + "name", + "path", + "regex", + "regexp", + "regular expression" + ], + "license": "MIT", + "main": "index.js", + "name": "filename-regex", + "repository": { + "type": "git", + "url": "git+https://github.com/regexhq/filename-regex.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + }, + "version": "2.0.1" +} diff --git a/node_modules/fill-range/LICENSE b/node_modules/fill-range/LICENSE new file mode 100644 index 000000000..d32ab4426 --- /dev/null +++ b/node_modules/fill-range/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2018, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/fill-range/README.md b/node_modules/fill-range/README.md new file mode 100644 index 000000000..b70015b98 --- /dev/null +++ b/node_modules/fill-range/README.md @@ -0,0 +1,317 @@ +# fill-range [![NPM version](https://img.shields.io/npm/v/fill-range.svg?style=flat)](https://www.npmjs.com/package/fill-range) [![NPM monthly downloads](https://img.shields.io/npm/dm/fill-range.svg?style=flat)](https://npmjs.org/package/fill-range) [![NPM total downloads](https://img.shields.io/npm/dt/fill-range.svg?style=flat)](https://npmjs.org/package/fill-range) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/fill-range.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/fill-range) + +> Fill in a range of numbers or letters, optionally passing an increment or multiplier to use. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +- [Install](#install) +- [Usage](#usage) + * [Invalid ranges](#invalid-ranges) + * [Custom function](#custom-function) + * [Special characters](#special-characters) + + [plus](#plus) + + [pipe and tilde](#pipe-and-tilde) + + [angle bracket](#angle-bracket) + + [question mark](#question-mark) +- [About](#about) + +_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save fill-range +``` + +## Usage + +```js +var range = require('fill-range'); + +range('a', 'e'); +//=> ['a', 'b', 'c', 'd', 'e'] +``` + +**Params** + +```js +range(start, stop, step, options, fn); +``` + +* `start`: **{String|Number}** the number or letter to start with +* `end`: **{String|Number}** the number or letter to end with +* `step`: **{String|Number}** optionally pass the step to use. works for letters or numbers. +* `options`: **{Object}**: + - `makeRe`: return a regex-compatible string (still returned as an array for consistency) + - `step`: pass the step on the options as an alternative to passing it as an argument + - `silent`: `true` by default, set to false to throw errors for invalid ranges. +* `fn`: **{Function}** optionally [pass a function](#custom-function) to modify each character + +**Examples** + +```js +range(1, 3) +//=> ['1', '2', '3'] + +range('1', '3') +//=> ['1', '2', '3'] + +range('0', '-5') +//=> [ '0', '-1', '-2', '-3', '-4', '-5' ] + +range(-9, 9, 3) +//=> [ '-9', '-6', '-3', '0', '3', '6', '9' ]) + +range('-1', '-10', '-2') +//=> [ '-1', '-3', '-5', '-7', '-9' ] + +range('1', '10', '2') +//=> [ '1', '3', '5', '7', '9' ] + +range('a', 'e') +//=> ['a', 'b', 'c', 'd', 'e'] + +range('a', 'e', 2) +//=> ['a', 'c', 'e'] + +range('A', 'E', 2) +//=> ['A', 'C', 'E'] +``` + +### Invalid ranges + +When an invalid range is passed, `null` is returned. + +```js +range('1.1', '2'); +//=> null + +range('a', '2'); +//=> null + +range(1, 10, 'foo'); +//=> null +``` + +If you want errors to be throw, pass `silent: false` on the options: + +### Custom function + +Optionally pass a custom function as the third or fourth argument: + +```js +range('a', 'e', function (val, isNumber, pad, i) { + if (!isNumber) { + return String.fromCharCode(val) + i; + } + return val; +}); +//=> ['a0', 'b1', 'c2', 'd3', 'e4'] +``` + +### Special characters + +A special character may be passed as the third arg instead of a step increment. These characters can be pretty useful for brace expansion, creating file paths, test fixtures and similar use case. + +```js +range('a', 'z', SPECIAL_CHARACTER_HERE); +``` + +**Supported characters** + +* `+`: repeat the given string `n` times +* `|`: create a regex-ready string, instead of an array +* `>`: join values to single array element +* `?`: randomize the given pattern using [randomatic] + +#### plus + +Character: _(`+`)_ + +Repeat the first argument the number of times passed on the second argument. + +**Examples:** + +```js +range('a', 3, '+'); +//=> ['a', 'a', 'a'] + +range('abc', 2, '+'); +//=> ['abc', 'abc'] +``` + +#### pipe and tilde + +Characters: _(`|` and `~`)_ + +Creates a regex-capable string (either a logical `or` or a character class) from the expanded arguments. + +**Examples:** + +```js +range('a', 'c', '|'); +//=> ['(a|b|c)' + +range('a', 'c', '~'); +//=> ['[a-c]' + +range('a', 'z', '|5'); +//=> ['(a|f|k|p|u|z)' +``` + +**Automatic separator correction** + +To avoid this error: + +> `Range out of order in character class` + +Fill-range detects invalid sequences and uses the correct syntax. For example: + +**invalid** (regex) + +If you pass these: + +```js +range('a', 'z', '~5'); +// which would result in this +//=> ['[a-f-k-p-u-z]'] + +range('10', '20', '~'); +// which would result in this +//=> ['[10-20]'] +``` + +**valid** (regex) + +fill-range corrects them to this: + +```js +range('a', 'z', '~5'); +//=> ['(a|f|k|p|u|z)' + +range('10', '20', '~'); +//=> ['(10-20)' +``` + +#### angle bracket + +Character: _(`>`)_ + +Joins all values in the returned array to a single value. + +**Examples:** + +```js +range('a', 'e', '>'); +//=> ['abcde'] + +range('5', '8', '>'); +//=> ['5678'] + +range('2', '20', '2>'); +//=> ['2468101214161820'] +``` + +#### question mark + +Character: _(`?`)_ + +Uses [randomatic] to generate randomized alpha, numeric, or alpha-numeric patterns based on the provided arguments. + +**Examples:** + +_(actual results would obviously be randomized)_ + +Generate a 5-character, uppercase, alphabetical string: + +```js +range('A', 5, '?'); +//=> ['NSHAK'] +``` + +Generate a 5-digit random number: + +```js +range('0', 5, '?'); +//=> ['36583'] +``` + +Generate a 10-character alpha-numeric string: + +```js +range('A0', 10, '?'); +//=> ['5YJD60VQNN'] +``` + +See the [randomatic] repo for all available options and or to create issues or feature requests related to randomization. + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [braces](https://www.npmjs.com/package/braces): Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support… [more](https://github.com/micromatch/braces) | [homepage](https://github.com/micromatch/braces "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.") +* [expand-range](https://www.npmjs.com/package/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. Used… [more](https://github.com/jonschlinkert/expand-range) | [homepage](https://github.com/jonschlinkert/expand-range "Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. Used by [micromatch].") +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/micromatch/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 111 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [paulmillr](https://github.com/paulmillr) | +| 1 | [edorivai](https://github.com/edorivai) | +| 1 | [realityking](https://github.com/realityking) | +| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | + +### Author + +**Jon Schlinkert** + +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 08, 2018._ \ No newline at end of file diff --git a/node_modules/fill-range/index.js b/node_modules/fill-range/index.js new file mode 100644 index 000000000..4c0fe8dd4 --- /dev/null +++ b/node_modules/fill-range/index.js @@ -0,0 +1,408 @@ +/*! + * fill-range + * + * Copyright (c) 2014-2018, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var isObject = require('isobject'); +var isNumber = require('is-number'); +var randomize = require('randomatic'); +var repeatStr = require('repeat-string'); +var repeat = require('repeat-element'); + +/** + * Expose `fillRange` + */ + +module.exports = fillRange; + +/** + * Return a range of numbers or letters. + * + * @param {String} `a` Start of the range + * @param {String} `b` End of the range + * @param {String} `step` Increment or decrement to use. + * @param {Function} `fn` Custom function to modify each element in the range. + * @return {Array} + */ + +function fillRange(a, b, step, options, fn) { + if (a == null || b == null) { + throw new Error('fill-range expects the first and second args to be strings.'); + } + + if (typeof step === 'function') { + fn = step; options = {}; step = null; + } + + if (typeof options === 'function') { + fn = options; options = {}; + } + + if (isObject(step)) { + options = step; step = ''; + } + + var expand, regex = false, sep = ''; + var opts = options || {}; + + if (typeof opts.silent === 'undefined') { + opts.silent = true; + } + + step = step || opts.step; + + // store a ref to unmodified arg + var origA = a, origB = b; + + b = (b.toString() === '-0') ? 0 : b; + + if (opts.optimize || opts.makeRe) { + step = step ? (step += '~') : step; + expand = true; + regex = true; + sep = '~'; + } + + // handle special step characters + if (typeof step === 'string') { + var match = stepRe().exec(step); + + if (match) { + var i = match.index; + var m = match[0]; + + // repeat string + if (m === '+') { + return repeat(a, b); + + // randomize a, `b` times + } else if (m === '?') { + return [randomize(a, b)]; + + // expand right, no regex reduction + } else if (m === '>') { + step = step.substr(0, i) + step.substr(i + 1); + expand = true; + + // expand to an array, or if valid create a reduced + // string for a regex logic `or` + } else if (m === '|') { + step = step.substr(0, i) + step.substr(i + 1); + expand = true; + regex = true; + sep = m; + + // expand to an array, or if valid create a reduced + // string for a regex range + } else if (m === '~') { + step = step.substr(0, i) + step.substr(i + 1); + expand = true; + regex = true; + sep = m; + } + } else if (!isNumber(step)) { + if (!opts.silent) { + throw new TypeError('fill-range: invalid step.'); + } + return null; + } + } + + if (/[.&*()[\]^%$#@!]/.test(a) || /[.&*()[\]^%$#@!]/.test(b)) { + if (!opts.silent) { + throw new RangeError('fill-range: invalid range arguments.'); + } + return null; + } + + // has neither a letter nor number, or has both letters and numbers + // this needs to be after the step logic + if (!noAlphaNum(a) || !noAlphaNum(b) || hasBoth(a) || hasBoth(b)) { + if (!opts.silent) { + throw new RangeError('fill-range: invalid range arguments.'); + } + return null; + } + + // validate arguments + var isNumA = isNumber(zeros(a)); + var isNumB = isNumber(zeros(b)); + + if ((!isNumA && isNumB) || (isNumA && !isNumB)) { + if (!opts.silent) { + throw new TypeError('fill-range: first range argument is incompatible with second.'); + } + return null; + } + + // by this point both are the same, so we + // can use A to check going forward. + var isNum = isNumA; + var num = formatStep(step); + + // is the range alphabetical? or numeric? + if (isNum) { + // if numeric, coerce to an integer + a = +a; b = +b; + } else { + // otherwise, get the charCode to expand alpha ranges + a = a.charCodeAt(0); + b = b.charCodeAt(0); + } + + // is the pattern descending? + var isDescending = a > b; + + // don't create a character class if the args are < 0 + if (a < 0 || b < 0) { + expand = false; + regex = false; + } + + // detect padding + var padding = isPadded(origA, origB); + var res, pad, arr = []; + var ii = 0; + + // character classes, ranges and logical `or` + if (regex) { + if (shouldExpand(a, b, num, isNum, padding, opts)) { + // make sure the correct separator is used + if (sep === '|' || sep === '~') { + sep = detectSeparator(a, b, num, isNum, isDescending); + } + return wrap([origA, origB], sep, opts); + } + } + + while (isDescending ? (a >= b) : (a <= b)) { + if (padding && isNum) { + pad = padding(a); + } + + // custom function + if (typeof fn === 'function') { + res = fn(a, isNum, pad, ii++); + + // letters + } else if (!isNum) { + if (regex && isInvalidChar(a)) { + res = null; + } else { + res = String.fromCharCode(a); + } + + // numbers + } else { + res = formatPadding(a, pad); + } + + // add result to the array, filtering any nulled values + if (res !== null) arr.push(res); + + // increment or decrement + if (isDescending) { + a -= num; + } else { + a += num; + } + } + + // now that the array is expanded, we need to handle regex + // character classes, ranges or logical `or` that wasn't + // already handled before the loop + if ((regex || expand) && !opts.noexpand) { + // make sure the correct separator is used + if (sep === '|' || sep === '~') { + sep = detectSeparator(a, b, num, isNum, isDescending); + } + if (arr.length === 1 || a < 0 || b < 0) { return arr; } + return wrap(arr, sep, opts); + } + + return arr; +} + +/** + * Wrap the string with the correct regex + * syntax. + */ + +function wrap(arr, sep, opts) { + if (sep === '~') { sep = '-'; } + var str = arr.join(sep); + var pre = opts && opts.regexPrefix; + + // regex logical `or` + if (sep === '|') { + str = pre ? pre + str : str; + str = '(' + str + ')'; + } + + // regex character class + if (sep === '-') { + str = (pre && pre === '^') + ? pre + str + : str; + str = '[' + str + ']'; + } + return [str]; +} + +/** + * Check for invalid characters + */ + +function isCharClass(a, b, step, isNum, isDescending) { + if (isDescending) { return false; } + if (isNum) { return a <= 9 && b <= 9; } + if (a < b) { return step === 1; } + return false; +} + +/** + * Detect the correct separator to use + */ + +function shouldExpand(a, b, num, isNum, padding, opts) { + if (isNum && (a > 9 || b > 9)) { return false; } + return !padding && num === 1 && a < b; +} + +/** + * Detect the correct separator to use + */ + +function detectSeparator(a, b, step, isNum, isDescending) { + var isChar = isCharClass(a, b, step, isNum, isDescending); + if (!isChar) { + return '|'; + } + return '~'; +} + +/** + * Correctly format the step based on type + */ + +function formatStep(step) { + return Math.abs(step >> 0) || 1; +} + +/** + * Format padding, taking leading `-` into account + */ + +function formatPadding(ch, pad) { + var res = pad ? pad + ch : ch; + if (pad && ch.toString().charAt(0) === '-') { + res = '-' + pad + ch.toString().substr(1); + } + return res.toString(); +} + +/** + * Check for invalid characters + */ + +function isInvalidChar(str) { + var ch = toStr(str); + return ch === '\\' + || ch === '[' + || ch === ']' + || ch === '^' + || ch === '(' + || ch === ')' + || ch === '`'; +} + +/** + * Convert to a string from a charCode + */ + +function toStr(ch) { + return String.fromCharCode(ch); +} + + +/** + * Step regex + */ + +function stepRe() { + return /\?|>|\||\+|\~/g; +} + +/** + * Return true if `val` has either a letter + * or a number + */ + +function noAlphaNum(val) { + return /[a-z0-9]/i.test(val); +} + +/** + * Return true if `val` has both a letter and + * a number (invalid) + */ + +function hasBoth(val) { + return /[a-z][0-9]|[0-9][a-z]/i.test(val); +} + +/** + * Normalize zeros for checks + */ + +function zeros(val) { + if (/^-*0+$/.test(val.toString())) { + return '0'; + } + return val; +} + +/** + * Return true if `val` has leading zeros, + * or a similar valid pattern. + */ + +function hasZeros(val) { + return /[^.]\.|^-*0+[0-9]/.test(val); +} + +/** + * If the string is padded, returns a curried function with + * the a cached padding string, or `false` if no padding. + * + * @param {*} `origA` String or number. + * @return {String|Boolean} + */ + +function isPadded(origA, origB) { + if (hasZeros(origA) || hasZeros(origB)) { + var alen = length(origA); + var blen = length(origB); + + var len = alen >= blen + ? alen + : blen; + + return function (a) { + return repeatStr('0', len - length(a)); + }; + } + return false; +} + +/** + * Get the string length of `val` + */ + +function length(val) { + return val.toString().length; +} diff --git a/node_modules/fill-range/package.json b/node_modules/fill-range/package.json new file mode 100644 index 000000000..5ad6918b9 --- /dev/null +++ b/node_modules/fill-range/package.json @@ -0,0 +1,109 @@ +{ + "_from": "fill-range@^2.1.0", + "_id": "fill-range@2.2.4", + "_inBundle": false, + "_integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "_location": "/fill-range", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "fill-range@^2.1.0", + "name": "fill-range", + "escapedName": "fill-range", + "rawSpec": "^2.1.0", + "saveSpec": null, + "fetchSpec": "^2.1.0" + }, + "_requiredBy": [ + "/expand-range" + ], + "_resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "_shasum": "eb1e773abb056dcd8df2bfdf6af59b8b3a936565", + "_spec": "fill-range@^2.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/expand-range", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/fill-range/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + }, + "deprecated": false, + "description": "Fill in a range of numbers or letters, optionally passing an increment or multiplier to use.", + "devDependencies": { + "benchmarked": "^0.1.3", + "chalk": "^0.5.1", + "gulp-format-md": "^1.0.0", + "should": "^13.2.1" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/fill-range", + "keywords": [ + "alpha", + "alphabetical", + "bash", + "brace", + "expand", + "expansion", + "fill", + "glob", + "match", + "matches", + "matching", + "number", + "numerical", + "range", + "ranges", + "sh" + ], + "license": "MIT", + "main": "index.js", + "name": "fill-range", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/fill-range.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": true, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "braces", + "expand-range", + "is-glob", + "micromatch" + ] + }, + "lint": { + "reflinks": true + }, + "reflinks": [ + "micromatch", + "randomatic" + ] + }, + "version": "2.2.4" +} diff --git a/node_modules/for-in/LICENSE b/node_modules/for-in/LICENSE new file mode 100644 index 000000000..d734237bd --- /dev/null +++ b/node_modules/for-in/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/for-in/README.md b/node_modules/for-in/README.md new file mode 100644 index 000000000..874e1895a --- /dev/null +++ b/node_modules/for-in/README.md @@ -0,0 +1,85 @@ +# for-in [![NPM version](https://img.shields.io/npm/v/for-in.svg?style=flat)](https://www.npmjs.com/package/for-in) [![NPM monthly downloads](https://img.shields.io/npm/dm/for-in.svg?style=flat)](https://npmjs.org/package/for-in) [![NPM total downloads](https://img.shields.io/npm/dt/for-in.svg?style=flat)](https://npmjs.org/package/for-in) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/for-in.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/for-in) + +> Iterate over the own and inherited enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save for-in +``` + +## Usage + +```js +var forIn = require('for-in'); + +var obj = {a: 'foo', b: 'bar', c: 'baz'}; +var values = []; +var keys = []; + +forIn(obj, function (value, key, o) { + keys.push(key); + values.push(value); +}); + +console.log(keys); +//=> ['a', 'b', 'c']; + +console.log(values); +//=> ['foo', 'bar', 'baz']; +``` + +## About + +### Related projects + +* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays. This is the fastest implementation of array flatten.") +* [collection-map](https://www.npmjs.com/package/collection-map): Returns an array of mapped values from an array or object. | [homepage](https://github.com/jonschlinkert/collection-map "Returns an array of mapped values from an array or object.") +* [for-own](https://www.npmjs.com/package/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) | [homepage](https://github.com/jonschlinkert/for-own "Iterate over the own enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 16 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [paulirish](https://github.com/paulirish) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 28, 2017._ \ No newline at end of file diff --git a/node_modules/for-in/index.js b/node_modules/for-in/index.js new file mode 100644 index 000000000..0b5f95f02 --- /dev/null +++ b/node_modules/for-in/index.js @@ -0,0 +1,16 @@ +/*! + * for-in + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +module.exports = function forIn(obj, fn, thisArg) { + for (var key in obj) { + if (fn.call(thisArg, obj[key], key, obj) === false) { + break; + } + } +}; diff --git a/node_modules/for-in/package.json b/node_modules/for-in/package.json new file mode 100644 index 000000000..872f1c0bd --- /dev/null +++ b/node_modules/for-in/package.json @@ -0,0 +1,107 @@ +{ + "_from": "for-in@^1.0.1", + "_id": "for-in@1.0.2", + "_inBundle": false, + "_integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "_location": "/for-in", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "for-in@^1.0.1", + "name": "for-in", + "escapedName": "for-in", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/for-own", + "/mixin-deep" + ], + "_resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "_shasum": "81068d295a8142ec0ac726c6e2200c30fb6d5e80", + "_spec": "for-in@^1.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/for-own", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/for-in/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Paul Irish", + "url": "http://paulirish.com" + } + ], + "deprecated": false, + "description": "Iterate over the own and inherited enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js", + "devDependencies": { + "gulp-format-md": "^0.1.11", + "mocha": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/for-in", + "keywords": [ + "for", + "for-in", + "for-own", + "has", + "has-own", + "hasOwn", + "in", + "key", + "keys", + "object", + "own", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "for-in", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/for-in.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "arr-flatten", + "collection-map", + "for-own" + ] + }, + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.2" +} diff --git a/node_modules/for-own/LICENSE b/node_modules/for-own/LICENSE new file mode 100644 index 000000000..d290fe00b --- /dev/null +++ b/node_modules/for-own/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, 2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/for-own/README.md b/node_modules/for-own/README.md new file mode 100644 index 000000000..fd56877ae --- /dev/null +++ b/node_modules/for-own/README.md @@ -0,0 +1,85 @@ +# for-own [![NPM version](https://img.shields.io/npm/v/for-own.svg?style=flat)](https://www.npmjs.com/package/for-own) [![NPM monthly downloads](https://img.shields.io/npm/dm/for-own.svg?style=flat)](https://npmjs.org/package/for-own) [![NPM total downloads](https://img.shields.io/npm/dt/for-own.svg?style=flat)](https://npmjs.org/package/for-own) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/for-own.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/for-own) + +> Iterate over the own enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save for-own +``` + +## Usage + +```js +var forOwn = require('for-own'); + +var obj = {a: 'foo', b: 'bar', c: 'baz'}; +var values = []; +var keys = []; + +forOwn(obj, function (value, key, o) { + keys.push(key); + values.push(value); +}); + +console.log(keys); +//=> ['a', 'b', 'c']; + +console.log(values); +//=> ['foo', 'bar', 'baz']; +``` + +## About + +### Related projects + +* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays. This is the fastest implementation of array flatten.") +* [collection-map](https://www.npmjs.com/package/collection-map): Returns an array of mapped values from an array or object. | [homepage](https://github.com/jonschlinkert/collection-map "Returns an array of mapped values from an array or object.") +* [for-in](https://www.npmjs.com/package/for-in): Iterate over the own and inherited enumerable properties of an object, and return an object… [more](https://github.com/jonschlinkert/for-in) | [homepage](https://github.com/jonschlinkert/for-in "Iterate over the own and inherited enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 10 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [javiercejudo](https://github.com/javiercejudo) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 26, 2017._ \ No newline at end of file diff --git a/node_modules/for-own/index.js b/node_modules/for-own/index.js new file mode 100644 index 000000000..74e2d7551 --- /dev/null +++ b/node_modules/for-own/index.js @@ -0,0 +1,19 @@ +/*! + * for-own + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var forIn = require('for-in'); +var hasOwn = Object.prototype.hasOwnProperty; + +module.exports = function forOwn(obj, fn, thisArg) { + forIn(obj, function(val, key) { + if (hasOwn.call(obj, key)) { + return fn.call(thisArg, obj[key], key, obj); + } + }); +}; diff --git a/node_modules/for-own/package.json b/node_modules/for-own/package.json new file mode 100644 index 000000000..c1a50ee5d --- /dev/null +++ b/node_modules/for-own/package.json @@ -0,0 +1,109 @@ +{ + "_from": "for-own@^0.1.4", + "_id": "for-own@0.1.5", + "_inBundle": false, + "_integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "_location": "/for-own", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "for-own@^0.1.4", + "name": "for-own", + "escapedName": "for-own", + "rawSpec": "^0.1.4", + "saveSpec": null, + "fetchSpec": "^0.1.4" + }, + "_requiredBy": [ + "/object.omit" + ], + "_resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "_shasum": "5265c681a4f294dabbf17c9509b6763aa84510ce", + "_spec": "for-own@^0.1.4", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/object.omit", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/for-own/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Javier Cejudo", + "email": "javier@javiercejudo.com", + "url": "https://www.javiercejudo.com" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + } + ], + "dependencies": { + "for-in": "^1.0.1" + }, + "deprecated": false, + "description": "Iterate over the own enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js.", + "devDependencies": { + "gulp-format-md": "^0.1.11", + "mocha": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/for-own", + "keywords": [ + "for", + "for-in", + "for-own", + "has", + "has-own", + "hasOwn", + "key", + "keys", + "object", + "own", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "for-own", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/for-own.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "arr-flatten", + "collection-map", + "for-in" + ] + }, + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "0.1.5" +} diff --git a/node_modules/fragment-cache/LICENSE b/node_modules/fragment-cache/LICENSE new file mode 100644 index 000000000..b11cb7968 --- /dev/null +++ b/node_modules/fragment-cache/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/fragment-cache/README.md b/node_modules/fragment-cache/README.md new file mode 100644 index 000000000..541ef0fb4 --- /dev/null +++ b/node_modules/fragment-cache/README.md @@ -0,0 +1,156 @@ +# fragment-cache [![NPM version](https://img.shields.io/npm/v/fragment-cache.svg?style=flat)](https://www.npmjs.com/package/fragment-cache) [![NPM downloads](https://img.shields.io/npm/dm/fragment-cache.svg?style=flat)](https://npmjs.org/package/fragment-cache) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/fragment-cache.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/fragment-cache) + +> A cache for managing namespaced sub-caches + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save fragment-cache +``` + +## Usage + +```js +var Fragment = require('fragment-cache'); +var fragment = new Fragment(); +``` + +## API + +### [FragmentCache](index.js#L24) + +Create a new `FragmentCache` with an optional object to use for `caches`. + +**Example** + +```js +var fragment = new FragmentCache(); +``` + +**Params** + +* `cacheName` **{String}** +* `returns` **{Object}**: Returns the [map-cache](https://github.com/jonschlinkert/map-cache) instance. + +### [.cache](index.js#L49) + +Get cache `name` from the `fragment.caches` object. Creates a new `MapCache` if it doesn't already exist. + +**Example** + +```js +var cache = fragment.cache('files'); +console.log(fragment.caches.hasOwnProperty('files')); +//=> true +``` + +**Params** + +* `cacheName` **{String}** +* `returns` **{Object}**: Returns the [map-cache](https://github.com/jonschlinkert/map-cache) instance. + +### [.set](index.js#L67) + +Set a value for property `key` on cache `name` + +**Example** + +```js +fragment.set('files', 'somefile.js', new File({path: 'somefile.js'})); +``` + +**Params** + +* `name` **{String}** +* `key` **{String}**: Property name to set +* `val` **{any}**: The value of `key` +* `returns` **{Object}**: The cache instance for chaining + +### [.has](index.js#L93) + +Returns true if a non-undefined value is set for `key` on fragment cache `name`. + +**Example** + +```js +var cache = fragment.cache('files'); +cache.set('somefile.js'); + +console.log(cache.has('somefile.js')); +//=> true + +console.log(cache.has('some-other-file.js')); +//=> false +``` + +**Params** + +* `name` **{String}**: Cache name +* `key` **{String}**: Optionally specify a property to check for on cache `name` +* `returns` **{Boolean}** + +### [.get](index.js#L115) + +Get `name`, or if specified, the value of `key`. Invokes the [cache](#cache) method, so that cache `name` will be created it doesn't already exist. If `key` is not passed, the entire cache (`name`) is returned. + +**Example** + +```js +var Vinyl = require('vinyl'); +var cache = fragment.cache('files'); +cache.set('somefile.js', new Vinyl({path: 'somefile.js'})); +console.log(cache.get('somefile.js')); +//=> +``` + +**Params** + +* `name` **{String}** +* `returns` **{Object}**: Returns cache `name`, or the value of `key` if specified + +## About + +### Related projects + +* [base](https://www.npmjs.com/package/base): base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… [more](https://github.com/node-base/base) | [homepage](https://github.com/node-base/base "base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting with a handful of common methods, like `set`, `get`, `del` and `use`.") +* [map-cache](https://www.npmjs.com/package/map-cache): Basic cache object for storing key-value pairs. | [homepage](https://github.com/jonschlinkert/map-cache "Basic cache object for storing key-value pairs.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/fragment-cache/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on October 17, 2016._ \ No newline at end of file diff --git a/node_modules/fragment-cache/index.js b/node_modules/fragment-cache/index.js new file mode 100644 index 000000000..8ce621680 --- /dev/null +++ b/node_modules/fragment-cache/index.js @@ -0,0 +1,128 @@ +/*! + * fragment-cache + * + * Copyright (c) 2016-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var MapCache = require('map-cache'); + +/** + * Create a new `FragmentCache` with an optional object to use for `caches`. + * + * ```js + * var fragment = new FragmentCache(); + * ``` + * @name FragmentCache + * @param {String} `cacheName` + * @return {Object} Returns the [map-cache][] instance. + * @api public + */ + +function FragmentCache(caches) { + this.caches = caches || {}; +} + +/** + * Prototype + */ + +FragmentCache.prototype = { + + /** + * Get cache `name` from the `fragment.caches` object. Creates a new + * `MapCache` if it doesn't already exist. + * + * ```js + * var cache = fragment.cache('files'); + * console.log(fragment.caches.hasOwnProperty('files')); + * //=> true + * ``` + * @name .cache + * @param {String} `cacheName` + * @return {Object} Returns the [map-cache][] instance. + * @api public + */ + + cache: function(cacheName) { + return this.caches[cacheName] || (this.caches[cacheName] = new MapCache()); + }, + + /** + * Set a value for property `key` on cache `name` + * + * ```js + * fragment.set('files', 'somefile.js', new File({path: 'somefile.js'})); + * ``` + * @name .set + * @param {String} `name` + * @param {String} `key` Property name to set + * @param {any} `val` The value of `key` + * @return {Object} The cache instance for chaining + * @api public + */ + + set: function(cacheName, key, val) { + var cache = this.cache(cacheName); + cache.set(key, val); + return cache; + }, + + /** + * Returns true if a non-undefined value is set for `key` on fragment cache `name`. + * + * ```js + * var cache = fragment.cache('files'); + * cache.set('somefile.js'); + * + * console.log(cache.has('somefile.js')); + * //=> true + * + * console.log(cache.has('some-other-file.js')); + * //=> false + * ``` + * @name .has + * @param {String} `name` Cache name + * @param {String} `key` Optionally specify a property to check for on cache `name` + * @return {Boolean} + * @api public + */ + + has: function(cacheName, key) { + return typeof this.get(cacheName, key) !== 'undefined'; + }, + + /** + * Get `name`, or if specified, the value of `key`. Invokes the [cache]() method, + * so that cache `name` will be created it doesn't already exist. If `key` is not passed, + * the entire cache (`name`) is returned. + * + * ```js + * var Vinyl = require('vinyl'); + * var cache = fragment.cache('files'); + * cache.set('somefile.js', new Vinyl({path: 'somefile.js'})); + * console.log(cache.get('somefile.js')); + * //=> + * ``` + * @name .get + * @param {String} `name` + * @return {Object} Returns cache `name`, or the value of `key` if specified + * @api public + */ + + get: function(name, key) { + var cache = this.cache(name); + if (typeof key === 'string') { + return cache.get(key); + } + return cache; + } +}; + +/** + * Expose `FragmentCache` + */ + +exports = module.exports = FragmentCache; diff --git a/node_modules/fragment-cache/package.json b/node_modules/fragment-cache/package.json new file mode 100644 index 000000000..657083d57 --- /dev/null +++ b/node_modules/fragment-cache/package.json @@ -0,0 +1,93 @@ +{ + "_from": "fragment-cache@^0.2.1", + "_id": "fragment-cache@0.2.1", + "_inBundle": false, + "_integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "_location": "/fragment-cache", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "fragment-cache@^0.2.1", + "name": "fragment-cache", + "escapedName": "fragment-cache", + "rawSpec": "^0.2.1", + "saveSpec": null, + "fetchSpec": "^0.2.1" + }, + "_requiredBy": [ + "/nanomatch", + "/readdirp/extglob", + "/readdirp/micromatch" + ], + "_resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "_shasum": "4290fad27f13e89be7f33799c6bc5a0abfff0d19", + "_spec": "fragment-cache@^0.2.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/fragment-cache/issues" + }, + "bundleDependencies": false, + "dependencies": { + "map-cache": "^0.2.2" + }, + "deprecated": false, + "description": "A cache for managing namespaced sub-caches", + "devDependencies": { + "gulp": "^3.9.1", + "gulp-eslint": "^3.0.1", + "gulp-format-md": "^0.1.11", + "gulp-istanbul": "^1.1.1", + "gulp-mocha": "^3.0.1", + "mocha": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/fragment-cache", + "keywords": [ + "cache", + "fragment" + ], + "license": "MIT", + "main": "index.js", + "name": "fragment-cache", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/fragment-cache.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "plugins": [ + "gulp-format-md" + ], + "reflinks": [ + "map-cache", + "verb" + ], + "related": { + "list": [ + "base", + "map-cache" + ] + }, + "layout": "default", + "toc": false, + "tasks": [ + "readme" + ], + "lint": { + "reflinks": true + } + }, + "version": "0.2.1" +} diff --git a/node_modules/fresh/HISTORY.md b/node_modules/fresh/HISTORY.md new file mode 100644 index 000000000..4586996a3 --- /dev/null +++ b/node_modules/fresh/HISTORY.md @@ -0,0 +1,70 @@ +0.5.2 / 2017-09-13 +================== + + * Fix regression matching multiple ETags in `If-None-Match` + * perf: improve `If-None-Match` token parsing + +0.5.1 / 2017-09-11 +================== + + * Fix handling of modified headers with invalid dates + * perf: improve ETag match loop + +0.5.0 / 2017-02-21 +================== + + * Fix incorrect result when `If-None-Match` has both `*` and ETags + * Fix weak `ETag` matching to match spec + * perf: delay reading header values until needed + * perf: skip checking modified time if ETag check failed + * perf: skip parsing `If-None-Match` when no `ETag` header + * perf: use `Date.parse` instead of `new Date` + +0.4.0 / 2017-02-05 +================== + + * Fix false detection of `no-cache` request directive + * perf: enable strict mode + * perf: hoist regular expressions + * perf: remove duplicate conditional + * perf: remove unnecessary boolean coercions + +0.3.0 / 2015-05-12 +================== + + * Add weak `ETag` matching support + +0.2.4 / 2014-09-07 +================== + + * Support Node.js 0.6 + +0.2.3 / 2014-09-07 +================== + + * Move repository to jshttp + +0.2.2 / 2014-02-19 +================== + + * Revert "Fix for blank page on Safari reload" + +0.2.1 / 2014-01-29 +================== + + * Fix for blank page on Safari reload + +0.2.0 / 2013-08-11 +================== + + * Return stale for `Cache-Control: no-cache` + +0.1.0 / 2012-06-15 +================== + + * Add `If-None-Match: *` support + +0.0.1 / 2012-06-10 +================== + + * Initial release diff --git a/node_modules/fresh/LICENSE b/node_modules/fresh/LICENSE new file mode 100644 index 000000000..1434ade75 --- /dev/null +++ b/node_modules/fresh/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2012 TJ Holowaychuk +Copyright (c) 2016-2017 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/fresh/README.md b/node_modules/fresh/README.md new file mode 100644 index 000000000..1c1c680d1 --- /dev/null +++ b/node_modules/fresh/README.md @@ -0,0 +1,119 @@ +# fresh + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +HTTP response freshness testing + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +``` +$ npm install fresh +``` + +## API + + + +```js +var fresh = require('fresh') +``` + +### fresh(reqHeaders, resHeaders) + +Check freshness of the response using request and response headers. + +When the response is still "fresh" in the client's cache `true` is +returned, otherwise `false` is returned to indicate that the client +cache is now stale and the full response should be sent. + +When a client sends the `Cache-Control: no-cache` request header to +indicate an end-to-end reload request, this module will return `false` +to make handling these requests transparent. + +## Known Issues + +This module is designed to only follow the HTTP specifications, not +to work-around all kinda of client bugs (especially since this module +typically does not recieve enough information to understand what the +client actually is). + +There is a known issue that in certain versions of Safari, Safari +will incorrectly make a request that allows this module to validate +freshness of the resource even when Safari does not have a +representation of the resource in the cache. The module +[jumanji](https://www.npmjs.com/package/jumanji) can be used in +an Express application to work-around this issue and also provides +links to further reading on this Safari bug. + +## Example + +### API usage + + + +```js +var reqHeaders = { 'if-none-match': '"foo"' } +var resHeaders = { 'etag': '"bar"' } +fresh(reqHeaders, resHeaders) +// => false + +var reqHeaders = { 'if-none-match': '"foo"' } +var resHeaders = { 'etag': '"foo"' } +fresh(reqHeaders, resHeaders) +// => true +``` + +### Using with Node.js http server + +```js +var fresh = require('fresh') +var http = require('http') + +var server = http.createServer(function (req, res) { + // perform server logic + // ... including adding ETag / Last-Modified response headers + + if (isFresh(req, res)) { + // client has a fresh copy of resource + res.statusCode = 304 + res.end() + return + } + + // send the resource + res.statusCode = 200 + res.end('hello, world!') +}) + +function isFresh (req, res) { + return fresh(req.headers, { + 'etag': res.getHeader('ETag'), + 'last-modified': res.getHeader('Last-Modified') + }) +} + +server.listen(3000) +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/fresh.svg +[npm-url]: https://npmjs.org/package/fresh +[node-version-image]: https://img.shields.io/node/v/fresh.svg +[node-version-url]: https://nodejs.org/en/ +[travis-image]: https://img.shields.io/travis/jshttp/fresh/master.svg +[travis-url]: https://travis-ci.org/jshttp/fresh +[coveralls-image]: https://img.shields.io/coveralls/jshttp/fresh/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/fresh?branch=master +[downloads-image]: https://img.shields.io/npm/dm/fresh.svg +[downloads-url]: https://npmjs.org/package/fresh diff --git a/node_modules/fresh/index.js b/node_modules/fresh/index.js new file mode 100644 index 000000000..d154f5a7d --- /dev/null +++ b/node_modules/fresh/index.js @@ -0,0 +1,137 @@ +/*! + * fresh + * Copyright(c) 2012 TJ Holowaychuk + * Copyright(c) 2016-2017 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * RegExp to check for no-cache token in Cache-Control. + * @private + */ + +var CACHE_CONTROL_NO_CACHE_REGEXP = /(?:^|,)\s*?no-cache\s*?(?:,|$)/ + +/** + * Module exports. + * @public + */ + +module.exports = fresh + +/** + * Check freshness of the response using request and response headers. + * + * @param {Object} reqHeaders + * @param {Object} resHeaders + * @return {Boolean} + * @public + */ + +function fresh (reqHeaders, resHeaders) { + // fields + var modifiedSince = reqHeaders['if-modified-since'] + var noneMatch = reqHeaders['if-none-match'] + + // unconditional request + if (!modifiedSince && !noneMatch) { + return false + } + + // Always return stale when Cache-Control: no-cache + // to support end-to-end reload requests + // https://tools.ietf.org/html/rfc2616#section-14.9.4 + var cacheControl = reqHeaders['cache-control'] + if (cacheControl && CACHE_CONTROL_NO_CACHE_REGEXP.test(cacheControl)) { + return false + } + + // if-none-match + if (noneMatch && noneMatch !== '*') { + var etag = resHeaders['etag'] + + if (!etag) { + return false + } + + var etagStale = true + var matches = parseTokenList(noneMatch) + for (var i = 0; i < matches.length; i++) { + var match = matches[i] + if (match === etag || match === 'W/' + etag || 'W/' + match === etag) { + etagStale = false + break + } + } + + if (etagStale) { + return false + } + } + + // if-modified-since + if (modifiedSince) { + var lastModified = resHeaders['last-modified'] + var modifiedStale = !lastModified || !(parseHttpDate(lastModified) <= parseHttpDate(modifiedSince)) + + if (modifiedStale) { + return false + } + } + + return true +} + +/** + * Parse an HTTP Date into a number. + * + * @param {string} date + * @private + */ + +function parseHttpDate (date) { + var timestamp = date && Date.parse(date) + + // istanbul ignore next: guard against date.js Date.parse patching + return typeof timestamp === 'number' + ? timestamp + : NaN +} + +/** + * Parse a HTTP token list. + * + * @param {string} str + * @private + */ + +function parseTokenList (str) { + var end = 0 + var list = [] + var start = 0 + + // gather tokens + for (var i = 0, len = str.length; i < len; i++) { + switch (str.charCodeAt(i)) { + case 0x20: /* */ + if (start === end) { + start = end = i + 1 + } + break + case 0x2c: /* , */ + list.push(str.substring(start, end)) + start = end = i + 1 + break + default: + end = i + 1 + break + } + } + + // final token + list.push(str.substring(start, end)) + + return list +} diff --git a/node_modules/fresh/package.json b/node_modules/fresh/package.json new file mode 100644 index 000000000..a8346eb30 --- /dev/null +++ b/node_modules/fresh/package.json @@ -0,0 +1,89 @@ +{ + "_from": "fresh@0.5.2", + "_id": "fresh@0.5.2", + "_inBundle": false, + "_integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "_location": "/fresh", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "fresh@0.5.2", + "name": "fresh", + "escapedName": "fresh", + "rawSpec": "0.5.2", + "saveSpec": null, + "fetchSpec": "0.5.2" + }, + "_requiredBy": [ + "/send" + ], + "_resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "_shasum": "3d8cadd90d976569fa835ab1f8e4b23a105605a7", + "_spec": "fresh@0.5.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/send", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca", + "url": "http://tjholowaychuk.com" + }, + "bugs": { + "url": "https://github.com/jshttp/fresh/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + } + ], + "deprecated": false, + "description": "HTTP response freshness testing", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "2.1.4", + "eslint": "3.19.0", + "eslint-config-standard": "10.2.1", + "eslint-plugin-import": "2.7.0", + "eslint-plugin-markdown": "1.0.0-beta.6", + "eslint-plugin-node": "5.1.1", + "eslint-plugin-promise": "3.5.0", + "eslint-plugin-standard": "3.0.1", + "istanbul": "0.4.5", + "mocha": "1.21.5" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "index.js" + ], + "homepage": "https://github.com/jshttp/fresh#readme", + "keywords": [ + "fresh", + "http", + "conditional", + "cache" + ], + "license": "MIT", + "name": "fresh", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/fresh.git" + }, + "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "version": "0.5.2" +} diff --git a/node_modules/from2-string/LICENSE b/node_modules/from2-string/LICENSE new file mode 100644 index 000000000..0fd68ad42 --- /dev/null +++ b/node_modules/from2-string/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 + +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. \ No newline at end of file diff --git a/node_modules/from2-string/README.md b/node_modules/from2-string/README.md new file mode 100644 index 000000000..de8b05108 --- /dev/null +++ b/node_modules/from2-string/README.md @@ -0,0 +1,44 @@ +# from2-string +[![NPM version][npm-image]][npm-url] +[![build status][travis-image]][travis-url] +[![Test coverage][coveralls-image]][coveralls-url] +[![Downloads][downloads-image]][downloads-url] +[![js-standard-style][standard-image]][standard-url] + +Create a stream from a string. Sugary wrapper around +[from2](https://github.com/hughsk/from2). + +## Installation +```bash +$ npm install from2-string +``` + +## Usage +```js +const fromString = require('from2-string') + +fromString('hello world').pipe(process.stdout) +``` + +## Why +In order to use `from2` with strings, you must write some boilerplate to +break the string in correctly sized chunks. This module handles that +boilerplate for you, so you can directly source from a string. + +## See Also +- [from2](https://github.com/hughsk/from2) - Convenience wrapper for ReadableStream, with an API lifted from "from" and "through2" +- [from2-array](https://github.com/binocarlos/from2-array) - Create a from2 stream based on an array of source values + +## License +[MIT](https://tldrlegal.com/license/mit-license) + +[npm-image]: https://img.shields.io/npm/v/from2-string.svg?style=flat-square +[npm-url]: https://npmjs.org/package/from2-string +[travis-image]: https://img.shields.io/travis/yoshuawuyts/from2-string.svg?style=flat-square +[travis-url]: https://travis-ci.org/yoshuawuyts/from2-string +[coveralls-image]: https://img.shields.io/coveralls/yoshuawuyts/from2-string.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/yoshuawuyts/from2-string?branch=master +[downloads-image]: http://img.shields.io/npm/dm/from2-string.svg?style=flat-square +[downloads-url]: https://npmjs.org/package/from2-string +[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square +[standard-url]: https://github.com/feross/standard diff --git a/node_modules/from2-string/index.js b/node_modules/from2-string/index.js new file mode 100644 index 000000000..c875b3dc5 --- /dev/null +++ b/node_modules/from2-string/index.js @@ -0,0 +1,19 @@ +const assert = require('assert') +const from = require('from2') + +module.exports = fromString + +// create a stream from a string +// str -> stream +function fromString (string) { + assert.equal(typeof string, 'string') + + return from(function (size, next) { + if (string.length <= 0) return this.push(null) + + const chunk = string.slice(0, size) + string = string.slice(size) + + next(null, chunk) + }) +} diff --git a/node_modules/from2-string/package.json b/node_modules/from2-string/package.json new file mode 100644 index 000000000..7014dc2ff --- /dev/null +++ b/node_modules/from2-string/package.json @@ -0,0 +1,68 @@ +{ + "_from": "from2-string@^1.1.0", + "_id": "from2-string@1.1.0", + "_inBundle": false, + "_integrity": "sha1-GCgrJ9CKJnyzAwzSuLSw8hKvdSo=", + "_location": "/from2-string", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "from2-string@^1.1.0", + "name": "from2-string", + "escapedName": "from2-string", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/simple-html-index" + ], + "_resolved": "https://registry.npmjs.org/from2-string/-/from2-string-1.1.0.tgz", + "_shasum": "18282b27d08a267cb3030cd2b8b4b0f212af752a", + "_spec": "from2-string@^1.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/simple-html-index", + "bugs": { + "url": "https://github.com/yoshuawuyts/from2-string/issues" + }, + "bundleDependencies": false, + "dependencies": { + "from2": "^2.0.3" + }, + "deprecated": false, + "description": "Create a stream from a string. Sugary wrapper around from2", + "devDependencies": { + "concat-stream": "^1.4.8", + "covert": "^1.0.1", + "standard": "^4.5.2", + "tape": "^4.0.0" + }, + "files": [ + "LICENSE", + "index.js", + "README.md" + ], + "homepage": "https://github.com/yoshuawuyts/from2-string#readme", + "keywords": [ + "stream", + "string", + "from", + "source", + "from2", + "stream2", + "streams2" + ], + "license": "MIT", + "main": "index.js", + "name": "from2-string", + "repository": { + "type": "git", + "url": "git+https://github.com/yoshuawuyts/from2-string.git" + }, + "scripts": { + "test": "standard && NODE_ENV=test node test", + "test-cov": "standard && NODE_ENV=test covert test", + "test-cov-ci": "NODE_ENV=test covert -q --json test 2>&1" + }, + "version": "1.1.0" +} diff --git a/node_modules/from2/.travis.yml b/node_modules/from2/.travis.yml new file mode 100644 index 000000000..b03ffabca --- /dev/null +++ b/node_modules/from2/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +before_install: + - npm install -g npm +node_js: + - "0.8" + - "0.10" + - "0.12" + - "iojs" diff --git a/node_modules/from2/LICENSE.md b/node_modules/from2/LICENSE.md new file mode 100644 index 000000000..146cb32a7 --- /dev/null +++ b/node_modules/from2/LICENSE.md @@ -0,0 +1,21 @@ +## The MIT License (MIT) ## + +Copyright (c) 2014 Hugh Kennedy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/from2/README.md b/node_modules/from2/README.md new file mode 100644 index 000000000..3e041a412 --- /dev/null +++ b/node_modules/from2/README.md @@ -0,0 +1,70 @@ +# from2 [![Flattr this!](https://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=hughskennedy&url=http://github.com/hughsk/from2&title=from2&description=hughsk/from2%20on%20GitHub&language=en_GB&tags=flattr,github,javascript&category=software)[![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges) # + +`from2` is a high-level module for creating readable streams that properly handle backpressure. + +Convience wrapper for +[readable-stream](http://github.com/isaacs/readable-stream)'s `ReadableStream` +base class, with an API lifted from +[from](http://github.com/dominictarr/from) and +[through2](http://github.com/rvagg/through2). + +## Usage ## + +[![from2](https://nodei.co/npm/from2.png?mini=true)](https://nodei.co/npm/from2) + +### `stream = from2([opts], read)` ### + +Where `opts` are the options to pass on to the `ReadableStream` constructor, +and `read(size, next)` is called when data is requested from the stream. + +* `size` is the recommended amount of data (in bytes) to retrieve. +* `next(err)` should be called when you're ready to emit more data. + +For example, here's a readable stream that emits the contents of a given +string: + +``` javascript +var from = require('from2') + +function fromString(string) { + return from(function(size, next) { + // if there's no more content + // left in the string, close the stream. + if (string.length <= 0) return next(null, null) + + // Pull in a new chunk of text, + // removing it from the string. + var chunk = string.slice(0, size) + string = string.slice(size) + + // Emit "chunk" from the stream. + next(null, chunk) + }) +} + +// pipe "hello world" out +// to stdout. +fromString('hello world').pipe(process.stdout) +``` + +### `stream = from2.obj([opts], read)` ### + +Shorthand for `from2({ objectMode: true }, read)`. + +### `createStream = from2.ctor([opts], read)` ### + +If you're creating similar streams in quick succession you can improve +performance by generating a stream **constructor** that you can reuse instead +of creating one-off streams on each call. + +Takes the same options as `from2`, instead returning a constructor which you +can use to create new streams. + +### See Also + +- [from2-array](https://github.com/binocarlos/from2-array) - Create a from2 stream based on an array of source values. +- [from2-string](https://github.com/yoshuawuyts/from2-string) - Create a stream from a string. Sugary wrapper around from2. + +## License ## + +MIT. See [LICENSE.md](http://github.com/hughsk/from2/blob/master/LICENSE.md) for details. diff --git a/node_modules/from2/index.js b/node_modules/from2/index.js new file mode 100644 index 000000000..cb200c610 --- /dev/null +++ b/node_modules/from2/index.js @@ -0,0 +1,103 @@ +var Readable = require('readable-stream').Readable +var inherits = require('inherits') + +module.exports = from2 + +from2.ctor = ctor +from2.obj = obj + +var Proto = ctor() + +function toFunction(list) { + list = list.slice() + return function (_, cb) { + var err = null + var item = list.length ? list.shift() : null + if (item instanceof Error) { + err = item + item = null + } + + cb(err, item) + } +} + +function from2(opts, read) { + if (typeof opts !== 'object' || Array.isArray(opts)) { + read = opts + opts = {} + } + + var rs = new Proto(opts) + rs._from = Array.isArray(read) ? toFunction(read) : (read || noop) + return rs +} + +function ctor(opts, read) { + if (typeof opts === 'function') { + read = opts + opts = {} + } + + opts = defaults(opts) + + inherits(Class, Readable) + function Class(override) { + if (!(this instanceof Class)) return new Class(override) + this._reading = false + this._callback = check + this.destroyed = false + Readable.call(this, override || opts) + + var self = this + var hwm = this._readableState.highWaterMark + + function check(err, data) { + if (self.destroyed) return + if (err) return self.destroy(err) + if (data === null) return self.push(null) + self._reading = false + if (self.push(data)) self._read(hwm) + } + } + + Class.prototype._from = read || noop + Class.prototype._read = function(size) { + if (this._reading || this.destroyed) return + this._reading = true + this._from(size, this._callback) + } + + Class.prototype.destroy = function(err) { + if (this.destroyed) return + this.destroyed = true + + var self = this + process.nextTick(function() { + if (err) self.emit('error', err) + self.emit('close') + }) + } + + return Class +} + +function obj(opts, read) { + if (typeof opts === 'function' || Array.isArray(opts)) { + read = opts + opts = {} + } + + opts = defaults(opts) + opts.objectMode = true + opts.highWaterMark = 16 + + return from2(opts, read) +} + +function noop () {} + +function defaults(opts) { + opts = opts || {} + return opts +} diff --git a/node_modules/from2/package.json b/node_modules/from2/package.json new file mode 100644 index 000000000..e03e72647 --- /dev/null +++ b/node_modules/from2/package.json @@ -0,0 +1,69 @@ +{ + "_from": "from2@^2.0.3", + "_id": "from2@2.3.0", + "_inBundle": false, + "_integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "_location": "/from2", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "from2@^2.0.3", + "name": "from2", + "escapedName": "from2", + "rawSpec": "^2.0.3", + "saveSpec": null, + "fetchSpec": "^2.0.3" + }, + "_requiredBy": [ + "/from2-string" + ], + "_resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "_shasum": "8bfb5502bde4a4d36cfdeea007fcca21d7e382af", + "_spec": "from2@^2.0.3", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/from2-string", + "author": { + "name": "Hugh Kennedy", + "email": "hughskennedy@gmail.com", + "url": "http://hughsk.io/" + }, + "bugs": { + "url": "https://github.com/hughsk/from2/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Mathias Buus", + "email": "mathiasbuus@gmail.com" + } + ], + "dependencies": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + }, + "deprecated": false, + "description": "Convenience wrapper for ReadableStream, with an API lifted from \"from\" and \"through2\"", + "devDependencies": { + "tape": "^4.0.0" + }, + "homepage": "https://github.com/hughsk/from2", + "keywords": [ + "from", + "stream", + "readable", + "pull", + "convenience", + "wrapper" + ], + "license": "MIT", + "main": "index.js", + "name": "from2", + "repository": { + "type": "git", + "url": "git://github.com/hughsk/from2.git" + }, + "scripts": { + "test": "node test" + }, + "version": "2.3.0" +} diff --git a/node_modules/from2/test.js b/node_modules/from2/test.js new file mode 100644 index 000000000..b11bd6cd8 --- /dev/null +++ b/node_modules/from2/test.js @@ -0,0 +1,123 @@ +var test = require('tape') +var path = require('path') +var from = require('./') +var fs = require('fs') + +var tmp = path.resolve( + __dirname, 'tmp.txt' +) + +function fromString(string) { + return from(function(size, next) { + if (string.length <= 0) return next(null, null) + var chunk = string.slice(0, size) + string = string.slice(size) + next(null, chunk) + }) +} + +test('from2', function(t) { + var contents = fs.readFileSync(__filename, 'utf8') + var stream = fromString(contents) + + stream + .pipe(fs.createWriteStream(tmp)) + .on('close', function() { + t.equal(fs.readFileSync(tmp, 'utf8'), contents) + fs.unlinkSync(tmp) + t.end() + }) +}) + +test('old mode', function(t) { + var contents = fs.readFileSync(__filename, 'utf8') + var stream = fromString(contents) + var buffer = '' + + stream.on('data', function(data) { + buffer += data + }).on('end', function() { + t.equal(buffer, contents) + t.end() + }) +}) + +test('destroy', function(t) { + var stream = from(function(size, next) { + process.nextTick(function() { + next(null, 'no') + }) + }) + + stream.on('data', function(data) { + t.ok(false) + }).on('close', function() { + t.ok(true) + t.end() + }) + + stream.destroy() +}) + +test('arrays', function (t) { + var input = ['a', 'b', 'c'] + var stream = from(input) + var output = [] + stream.on('data', function (letter) { + output.push(letter.toString()) + }) + stream.on('end', function () { + t.deepEqual(input, output) + t.end() + }) +}) + +test('obj arrays', function (t) { + var input = [{foo:'a'}, {foo:'b'}, {foo:'c'}] + var stream = from.obj(input) + var output = [] + stream.on('data', function (letter) { + output.push(letter) + }) + stream.on('end', function () { + t.deepEqual(input, output) + t.end() + }) +}) + + +test('arrays can emit errors', function (t) { + var input = ['a', 'b', new Error('ooops'), 'c'] + var stream = from(input) + var output = [] + stream.on('data', function (letter) { + output.push(letter.toString()) + }) + stream.on('error', function(e){ + t.deepEqual(['a', 'b'], output) + t.equal('ooops', e.message) + t.end() + }) + stream.on('end', function () { + t.fail('the stream should have errored') + }) +}) + +test('obj arrays can emit errors', function (t) { + var input = [{foo:'a'}, {foo:'b'}, new Error('ooops'), {foo:'c'}] + var stream = from.obj(input) + var output = [] + stream.on('data', function (letter) { + output.push(letter) + }) + stream.on('error', function(e){ + t.deepEqual([{foo:'a'}, {foo:'b'}], output) + t.equal('ooops', e.message) + t.end() + }) + stream.on('end', function () { + t.fail('the stream should have errored') + }) +}) + + diff --git a/node_modules/fs.realpath/LICENSE b/node_modules/fs.realpath/LICENSE new file mode 100644 index 000000000..5bd884c25 --- /dev/null +++ b/node_modules/fs.realpath/LICENSE @@ -0,0 +1,43 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---- + +This library bundles a version of the `fs.realpath` and `fs.realpathSync` +methods from Node.js v0.10 under the terms of the Node.js MIT license. + +Node's license follows, also included at the header of `old.js` which contains +the licensed code: + + 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. diff --git a/node_modules/fs.realpath/README.md b/node_modules/fs.realpath/README.md new file mode 100644 index 000000000..a42ceac62 --- /dev/null +++ b/node_modules/fs.realpath/README.md @@ -0,0 +1,33 @@ +# fs.realpath + +A backwards-compatible fs.realpath for Node v6 and above + +In Node v6, the JavaScript implementation of fs.realpath was replaced +with a faster (but less resilient) native implementation. That raises +new and platform-specific errors and cannot handle long or excessively +symlink-looping paths. + +This module handles those cases by detecting the new errors and +falling back to the JavaScript implementation. On versions of Node +prior to v6, it has no effect. + +## USAGE + +```js +var rp = require('fs.realpath') + +// async version +rp.realpath(someLongAndLoopingPath, function (er, real) { + // the ELOOP was handled, but it was a bit slower +}) + +// sync version +var real = rp.realpathSync(someLongAndLoopingPath) + +// monkeypatch at your own risk! +// This replaces the fs.realpath/fs.realpathSync builtins +rp.monkeypatch() + +// un-do the monkeypatching +rp.unmonkeypatch() +``` diff --git a/node_modules/fs.realpath/index.js b/node_modules/fs.realpath/index.js new file mode 100644 index 000000000..b09c7c7e6 --- /dev/null +++ b/node_modules/fs.realpath/index.js @@ -0,0 +1,66 @@ +module.exports = realpath +realpath.realpath = realpath +realpath.sync = realpathSync +realpath.realpathSync = realpathSync +realpath.monkeypatch = monkeypatch +realpath.unmonkeypatch = unmonkeypatch + +var fs = require('fs') +var origRealpath = fs.realpath +var origRealpathSync = fs.realpathSync + +var version = process.version +var ok = /^v[0-5]\./.test(version) +var old = require('./old.js') + +function newError (er) { + return er && er.syscall === 'realpath' && ( + er.code === 'ELOOP' || + er.code === 'ENOMEM' || + er.code === 'ENAMETOOLONG' + ) +} + +function realpath (p, cache, cb) { + if (ok) { + return origRealpath(p, cache, cb) + } + + if (typeof cache === 'function') { + cb = cache + cache = null + } + origRealpath(p, cache, function (er, result) { + if (newError(er)) { + old.realpath(p, cache, cb) + } else { + cb(er, result) + } + }) +} + +function realpathSync (p, cache) { + if (ok) { + return origRealpathSync(p, cache) + } + + try { + return origRealpathSync(p, cache) + } catch (er) { + if (newError(er)) { + return old.realpathSync(p, cache) + } else { + throw er + } + } +} + +function monkeypatch () { + fs.realpath = realpath + fs.realpathSync = realpathSync +} + +function unmonkeypatch () { + fs.realpath = origRealpath + fs.realpathSync = origRealpathSync +} diff --git a/node_modules/fs.realpath/old.js b/node_modules/fs.realpath/old.js new file mode 100644 index 000000000..b40305e73 --- /dev/null +++ b/node_modules/fs.realpath/old.js @@ -0,0 +1,303 @@ +// 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 pathModule = require('path'); +var isWindows = process.platform === 'win32'; +var fs = require('fs'); + +// JavaScript implementation of realpath, ported from node pre-v6 + +var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); + +function rethrow() { + // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and + // is fairly slow to generate. + var callback; + if (DEBUG) { + var backtrace = new Error; + callback = debugCallback; + } else + callback = missingCallback; + + return callback; + + function debugCallback(err) { + if (err) { + backtrace.message = err.message; + err = backtrace; + missingCallback(err); + } + } + + function missingCallback(err) { + if (err) { + if (process.throwDeprecation) + throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs + else if (!process.noDeprecation) { + var msg = 'fs: missing callback ' + (err.stack || err.message); + if (process.traceDeprecation) + console.trace(msg); + else + console.error(msg); + } + } + } +} + +function maybeCallback(cb) { + return typeof cb === 'function' ? cb : rethrow(); +} + +var normalize = pathModule.normalize; + +// Regexp that finds the next partion of a (partial) path +// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] +if (isWindows) { + var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; +} else { + var nextPartRe = /(.*?)(?:[\/]+|$)/g; +} + +// Regex to find the device root, including trailing slash. E.g. 'c:\\'. +if (isWindows) { + var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; +} else { + var splitRootRe = /^[\/]*/; +} + +exports.realpathSync = function realpathSync(p, cache) { + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return cache[p]; + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstatSync(base); + knownHard[base] = true; + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + // NB: p.length changes. + while (pos < p.length) { + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + continue; + } + + var resolvedLink; + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // some known symbolic link. no need to stat again. + resolvedLink = cache[base]; + } else { + var stat = fs.lstatSync(base); + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + continue; + } + + // read the link if it wasn't read before + // dev/ino always return 0 on windows, so skip the check. + var linkTarget = null; + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + linkTarget = seenLinks[id]; + } + } + if (linkTarget === null) { + fs.statSync(base); + linkTarget = fs.readlinkSync(base); + } + resolvedLink = pathModule.resolve(previous, linkTarget); + // track this, if given a cache. + if (cache) cache[base] = resolvedLink; + if (!isWindows) seenLinks[id] = linkTarget; + } + + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } + + if (cache) cache[original] = p; + + return p; +}; + + +exports.realpath = function realpath(p, cache, cb) { + if (typeof cb !== 'function') { + cb = maybeCallback(cache); + cache = null; + } + + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return process.nextTick(cb.bind(null, null, cache[p])); + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstat(base, function(err) { + if (err) return cb(err); + knownHard[base] = true; + LOOP(); + }); + } else { + process.nextTick(LOOP); + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + function LOOP() { + // stop if scanned past end of path + if (pos >= p.length) { + if (cache) cache[original] = p; + return cb(null, p); + } + + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + return process.nextTick(LOOP); + } + + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // known symbolic link. no need to stat again. + return gotResolvedLink(cache[base]); + } + + return fs.lstat(base, gotStat); + } + + function gotStat(err, stat) { + if (err) return cb(err); + + // if not a symlink, skip to the next path part + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + return process.nextTick(LOOP); + } + + // stat & read the link if not read before + // call gotTarget as soon as the link target is known + // dev/ino always return 0 on windows, so skip the check. + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + return gotTarget(null, seenLinks[id], base); + } + } + fs.stat(base, function(err) { + if (err) return cb(err); + + fs.readlink(base, function(err, target) { + if (!isWindows) seenLinks[id] = target; + gotTarget(err, target); + }); + }); + } + + function gotTarget(err, target, base) { + if (err) return cb(err); + + var resolvedLink = pathModule.resolve(previous, target); + if (cache) cache[base] = resolvedLink; + gotResolvedLink(resolvedLink); + } + + function gotResolvedLink(resolvedLink) { + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } +}; diff --git a/node_modules/fs.realpath/package.json b/node_modules/fs.realpath/package.json new file mode 100644 index 000000000..eeb78ba06 --- /dev/null +++ b/node_modules/fs.realpath/package.json @@ -0,0 +1,59 @@ +{ + "_from": "fs.realpath@^1.0.0", + "_id": "fs.realpath@1.0.0", + "_inBundle": false, + "_integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "_location": "/fs.realpath", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "fs.realpath@^1.0.0", + "name": "fs.realpath", + "escapedName": "fs.realpath", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/glob" + ], + "_resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "_shasum": "1504ad2523158caa40db4a2787cb01411994ea4f", + "_spec": "fs.realpath@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/glob", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/fs.realpath/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails", + "devDependencies": {}, + "files": [ + "old.js", + "index.js" + ], + "homepage": "https://github.com/isaacs/fs.realpath#readme", + "keywords": [ + "realpath", + "fs", + "polyfill" + ], + "license": "ISC", + "main": "index.js", + "name": "fs.realpath", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/fs.realpath.git" + }, + "scripts": { + "test": "tap test/*.js --cov" + }, + "version": "1.0.0" +} diff --git a/node_modules/function-bind/.editorconfig b/node_modules/function-bind/.editorconfig new file mode 100644 index 000000000..ac29adef0 --- /dev/null +++ b/node_modules/function-bind/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 120 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/node_modules/function-bind/.eslintrc b/node_modules/function-bind/.eslintrc new file mode 100644 index 000000000..9b33d8edf --- /dev/null +++ b/node_modules/function-bind/.eslintrc @@ -0,0 +1,15 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "func-name-matching": 0, + "indent": [2, 4], + "max-nested-callbacks": [2, 3], + "max-params": [2, 3], + "max-statements": [2, 20], + "no-new-func": [1], + "strict": [0] + } +} diff --git a/node_modules/function-bind/.jscs.json b/node_modules/function-bind/.jscs.json new file mode 100644 index 000000000..8c4479480 --- /dev/null +++ b/node_modules/function-bind/.jscs.json @@ -0,0 +1,176 @@ +{ + "es3": true, + + "additionalRules": [], + + "requireSemicolons": true, + + "disallowMultipleSpaces": true, + + "disallowIdentifierNames": [], + + "requireCurlyBraces": { + "allExcept": [], + "keywords": ["if", "else", "for", "while", "do", "try", "catch"] + }, + + "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], + + "disallowSpaceAfterKeywords": [], + + "disallowSpaceBeforeComma": true, + "disallowSpaceAfterComma": false, + "disallowSpaceBeforeSemicolon": true, + + "disallowNodeTypes": [ + "DebuggerStatement", + "ForInStatement", + "LabeledStatement", + "SwitchCase", + "SwitchStatement", + "WithStatement" + ], + + "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, + + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, + "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, + + "requireSpaceBetweenArguments": true, + + "disallowSpacesInsideParentheses": true, + + "disallowSpacesInsideArrayBrackets": true, + + "disallowQuotedKeysInObjects": { "allExcept": ["reserved"] }, + + "disallowSpaceAfterObjectKeys": true, + + "requireCommaBeforeLineBreak": true, + + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], + "requireSpaceAfterPrefixUnaryOperators": [], + + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], + "requireSpaceBeforePostfixUnaryOperators": [], + + "disallowSpaceBeforeBinaryOperators": [], + "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + + "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + "disallowSpaceAfterBinaryOperators": [], + + "disallowImplicitTypeConversion": ["binary", "string"], + + "disallowKeywords": ["with", "eval"], + + "requireKeywordsOnNewLine": [], + "disallowKeywordsOnNewLine": ["else"], + + "requireLineFeedAtFileEnd": true, + + "disallowTrailingWhitespace": true, + + "disallowTrailingComma": true, + + "excludeFiles": ["node_modules/**", "vendor/**"], + + "disallowMultipleLineStrings": true, + + "requireDotNotation": { "allExcept": ["keywords"] }, + + "requireParenthesesAroundIIFE": true, + + "validateLineBreaks": "LF", + + "validateQuoteMarks": { + "escape": true, + "mark": "'" + }, + + "disallowOperatorBeforeLineBreak": [], + + "requireSpaceBeforeKeywords": [ + "do", + "for", + "if", + "else", + "switch", + "case", + "try", + "catch", + "finally", + "while", + "with", + "return" + ], + + "validateAlignedFunctionParameters": { + "lineBreakAfterOpeningBraces": true, + "lineBreakBeforeClosingBraces": true + }, + + "requirePaddingNewLinesBeforeExport": true, + + "validateNewlineAfterArrayElements": { + "maximum": 8 + }, + + "requirePaddingNewLinesAfterUseStrict": true, + + "disallowArrowFunctions": true, + + "disallowMultiLineTernary": true, + + "validateOrderInObjectKeys": "asc-insensitive", + + "disallowIdenticalDestructuringNames": true, + + "disallowNestedTernaries": { "maxLevel": 1 }, + + "requireSpaceAfterComma": { "allExcept": ["trailing"] }, + "requireAlignedMultilineParams": false, + + "requireSpacesInGenerator": { + "afterStar": true + }, + + "disallowSpacesInGenerator": { + "beforeStar": true + }, + + "disallowVar": false, + + "requireArrayDestructuring": false, + + "requireEnhancedObjectLiterals": false, + + "requireObjectDestructuring": false, + + "requireEarlyReturn": false, + + "requireCapitalizedConstructorsNew": { + "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] + }, + + "requireImportAlphabetized": false, + + "requireSpaceBeforeObjectValues": true, + "requireSpaceBeforeDestructuredValues": true, + + "disallowSpacesInsideTemplateStringPlaceholders": true, + + "disallowArrayDestructuringReturn": false, + + "requireNewlineBeforeSingleStatementsInIf": false, + + "disallowUnusedVariables": true, + + "requireSpacesInsideImportedObjectBraces": true, + + "requireUseStrict": true +} + diff --git a/node_modules/function-bind/.npmignore b/node_modules/function-bind/.npmignore new file mode 100644 index 000000000..dbb555fd1 --- /dev/null +++ b/node_modules/function-bind/.npmignore @@ -0,0 +1,22 @@ +# gitignore +.DS_Store +.monitor +.*.swp +.nodemonignore +releases +*.log +*.err +fleet.json +public/browserify +bin/*.json +.bin +build +compile +.lock-wscript +coverage +node_modules + +# Only apps should have lockfiles +npm-shrinkwrap.json +package-lock.json +yarn.lock diff --git a/node_modules/function-bind/.travis.yml b/node_modules/function-bind/.travis.yml new file mode 100644 index 000000000..85f70d246 --- /dev/null +++ b/node_modules/function-bind/.travis.yml @@ -0,0 +1,168 @@ +language: node_js +os: + - linux +node_js: + - "8.4" + - "7.10" + - "6.11" + - "5.12" + - "4.8" + - "iojs-v3.3" + - "iojs-v2.5" + - "iojs-v1.8" + - "0.12" + - "0.10" + - "0.8" +before_install: + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then npm install -g npm@1.3 ; elif [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi' + - 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then if [ "${TRAVIS_NODE_VERSION%${TRAVIS_NODE_VERSION#[0-9]}}" = "0" ] || [ "${TRAVIS_NODE_VERSION:0:4}" = "iojs" ]; then npm install -g npm@4.5 ; else npm install -g npm; fi; fi' +install: + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then nvm install 0.8 && npm install -g npm@1.3 && npm install -g npm@1.4.28 && npm install -g npm@2 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' +script: + - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi' + - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi' + - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi' + - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi' +sudo: false +env: + - TEST=true +matrix: + fast_finish: true + include: + - node_js: "node" + env: PRETEST=true + - node_js: "4" + env: COVERAGE=true + - node_js: "8.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "8.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "7.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "6.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.10" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.8" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "5.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "4.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v3.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v2.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.7" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.5" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.4" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.3" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.2" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.1" + env: TEST=true ALLOW_FAILURE=true + - node_js: "iojs-v1.0" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.11" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.9" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.6" + env: TEST=true ALLOW_FAILURE=true + - node_js: "0.4" + env: TEST=true ALLOW_FAILURE=true + allow_failures: + - os: osx + - env: TEST=true ALLOW_FAILURE=true diff --git a/node_modules/function-bind/LICENSE b/node_modules/function-bind/LICENSE new file mode 100644 index 000000000..62d6d237f --- /dev/null +++ b/node_modules/function-bind/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2013 Raynos. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/node_modules/function-bind/README.md b/node_modules/function-bind/README.md new file mode 100644 index 000000000..81862a02c --- /dev/null +++ b/node_modules/function-bind/README.md @@ -0,0 +1,48 @@ +# function-bind + + + + + +Implementation of function.prototype.bind + +## Example + +I mainly do this for unit tests I run on phantomjs. +PhantomJS does not have Function.prototype.bind :( + +```js +Function.prototype.bind = require("function-bind") +``` + +## Installation + +`npm install function-bind` + +## Contributors + + - Raynos + +## MIT Licenced + + [travis-svg]: https://travis-ci.org/Raynos/function-bind.svg + [travis-url]: https://travis-ci.org/Raynos/function-bind + [npm-badge-svg]: https://badge.fury.io/js/function-bind.svg + [npm-url]: https://npmjs.org/package/function-bind + [5]: https://coveralls.io/repos/Raynos/function-bind/badge.png + [6]: https://coveralls.io/r/Raynos/function-bind + [7]: https://gemnasium.com/Raynos/function-bind.png + [8]: https://gemnasium.com/Raynos/function-bind + [deps-svg]: https://david-dm.org/Raynos/function-bind.svg + [deps-url]: https://david-dm.org/Raynos/function-bind + [dev-deps-svg]: https://david-dm.org/Raynos/function-bind/dev-status.svg + [dev-deps-url]: https://david-dm.org/Raynos/function-bind#info=devDependencies + [11]: https://ci.testling.com/Raynos/function-bind.png + [12]: https://ci.testling.com/Raynos/function-bind diff --git a/node_modules/function-bind/implementation.js b/node_modules/function-bind/implementation.js new file mode 100644 index 000000000..cc4daec1b --- /dev/null +++ b/node_modules/function-bind/implementation.js @@ -0,0 +1,52 @@ +'use strict'; + +/* eslint no-invalid-this: 1 */ + +var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; +var slice = Array.prototype.slice; +var toStr = Object.prototype.toString; +var funcType = '[object Function]'; + +module.exports = function bind(that) { + var target = this; + if (typeof target !== 'function' || toStr.call(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slice.call(arguments, 1); + + var bound; + var binder = function () { + if (this instanceof bound) { + var result = target.apply( + this, + args.concat(slice.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return this; + } else { + return target.apply( + that, + args.concat(slice.call(arguments)) + ); + } + }; + + var boundLength = Math.max(0, target.length - args.length); + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + boundArgs.push('$' + i); + } + + bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); + + if (target.prototype) { + var Empty = function Empty() {}; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + + return bound; +}; diff --git a/node_modules/function-bind/index.js b/node_modules/function-bind/index.js new file mode 100644 index 000000000..3bb6b9609 --- /dev/null +++ b/node_modules/function-bind/index.js @@ -0,0 +1,5 @@ +'use strict'; + +var implementation = require('./implementation'); + +module.exports = Function.prototype.bind || implementation; diff --git a/node_modules/function-bind/package.json b/node_modules/function-bind/package.json new file mode 100644 index 000000000..a51e3c39a --- /dev/null +++ b/node_modules/function-bind/package.json @@ -0,0 +1,94 @@ +{ + "_from": "function-bind@^1.1.1", + "_id": "function-bind@1.1.1", + "_inBundle": false, + "_integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "_location": "/function-bind", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "function-bind@^1.1.1", + "name": "function-bind", + "escapedName": "function-bind", + "rawSpec": "^1.1.1", + "saveSpec": null, + "fetchSpec": "^1.1.1" + }, + "_requiredBy": [ + "/has" + ], + "_resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "_shasum": "a56899d3ea3c9bab874bb9773b7c5ede92f4895d", + "_spec": "function-bind@^1.1.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/has", + "author": { + "name": "Raynos", + "email": "raynos2@gmail.com" + }, + "bugs": { + "url": "https://github.com/Raynos/function-bind/issues", + "email": "raynos2@gmail.com" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Raynos" + }, + { + "name": "Jordan Harband", + "url": "https://github.com/ljharb" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Implementation of Function.prototype.bind", + "devDependencies": { + "@ljharb/eslint-config": "^12.2.1", + "covert": "^1.1.0", + "eslint": "^4.5.0", + "jscs": "^3.0.7", + "tape": "^4.8.0" + }, + "homepage": "https://github.com/Raynos/function-bind", + "keywords": [ + "function", + "bind", + "shim", + "es5" + ], + "license": "MIT", + "main": "index", + "name": "function-bind", + "repository": { + "type": "git", + "url": "git://github.com/Raynos/function-bind.git" + }, + "scripts": { + "coverage": "covert test/*.js", + "eslint": "eslint *.js */*.js", + "jscs": "jscs *.js */*.js", + "lint": "npm run jscs && npm run eslint", + "posttest": "npm run coverage -- --quiet", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "node test" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "ie/8..latest", + "firefox/16..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "1.1.1" +} diff --git a/node_modules/function-bind/test/.eslintrc b/node_modules/function-bind/test/.eslintrc new file mode 100644 index 000000000..8a56d5b72 --- /dev/null +++ b/node_modules/function-bind/test/.eslintrc @@ -0,0 +1,9 @@ +{ + "rules": { + "array-bracket-newline": 0, + "array-element-newline": 0, + "max-statements-per-line": [2, { "max": 2 }], + "no-invalid-this": 0, + "no-magic-numbers": 0, + } +} diff --git a/node_modules/function-bind/test/index.js b/node_modules/function-bind/test/index.js new file mode 100644 index 000000000..2edecce2f --- /dev/null +++ b/node_modules/function-bind/test/index.js @@ -0,0 +1,252 @@ +// jscs:disable requireUseStrict + +var test = require('tape'); + +var functionBind = require('../implementation'); +var getCurrentContext = function () { return this; }; + +test('functionBind is a function', function (t) { + t.equal(typeof functionBind, 'function'); + t.end(); +}); + +test('non-functions', function (t) { + var nonFunctions = [true, false, [], {}, 42, 'foo', NaN, /a/g]; + t.plan(nonFunctions.length); + for (var i = 0; i < nonFunctions.length; ++i) { + try { functionBind.call(nonFunctions[i]); } catch (ex) { + t.ok(ex instanceof TypeError, 'throws when given ' + String(nonFunctions[i])); + } + } + t.end(); +}); + +test('without a context', function (t) { + t.test('binds properly', function (st) { + var args, context; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }) + }; + namespace.func(1, 2, 3); + st.deepEqual(args, [1, 2, 3]); + st.equal(context, getCurrentContext.call()); + st.end(); + }); + + t.test('binds properly, and still supplies bound arguments', function (st) { + var args, context; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }, undefined, 1, 2, 3) + }; + namespace.func(4, 5, 6); + st.deepEqual(args, [1, 2, 3, 4, 5, 6]); + st.equal(context, getCurrentContext.call()); + st.end(); + }); + + t.test('returns properly', function (st) { + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, null) + }; + var context = namespace.func(1, 2, 3); + st.equal(context, getCurrentContext.call(), 'returned context is namespaced context'); + st.deepEqual(args, [1, 2, 3], 'passed arguments are correct'); + st.end(); + }); + + t.test('returns properly with bound arguments', function (st) { + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, null, 1, 2, 3) + }; + var context = namespace.func(4, 5, 6); + st.equal(context, getCurrentContext.call(), 'returned context is namespaced context'); + st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct'); + st.end(); + }); + + t.test('called as a constructor', function (st) { + var thunkify = function (value) { + return function () { return value; }; + }; + st.test('returns object value', function (sst) { + var expectedReturnValue = [1, 2, 3]; + var Constructor = functionBind.call(thunkify(expectedReturnValue), null); + var result = new Constructor(); + sst.equal(result, expectedReturnValue); + sst.end(); + }); + + st.test('does not return primitive value', function (sst) { + var Constructor = functionBind.call(thunkify(42), null); + var result = new Constructor(); + sst.notEqual(result, 42); + sst.end(); + }); + + st.test('object from bound constructor is instance of original and bound constructor', function (sst) { + var A = function (x) { + this.name = x || 'A'; + }; + var B = functionBind.call(A, null, 'B'); + + var result = new B(); + sst.ok(result instanceof B, 'result is instance of bound constructor'); + sst.ok(result instanceof A, 'result is instance of original constructor'); + sst.end(); + }); + + st.end(); + }); + + t.end(); +}); + +test('with a context', function (t) { + t.test('with no bound arguments', function (st) { + var args, context; + var boundContext = {}; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }, boundContext) + }; + namespace.func(1, 2, 3); + st.equal(context, boundContext, 'binds a context properly'); + st.deepEqual(args, [1, 2, 3], 'supplies passed arguments'); + st.end(); + }); + + t.test('with bound arguments', function (st) { + var args, context; + var boundContext = {}; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + context = this; + }, boundContext, 1, 2, 3) + }; + namespace.func(4, 5, 6); + st.equal(context, boundContext, 'binds a context properly'); + st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'supplies bound and passed arguments'); + st.end(); + }); + + t.test('returns properly', function (st) { + var boundContext = {}; + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, boundContext) + }; + var context = namespace.func(1, 2, 3); + st.equal(context, boundContext, 'returned context is bound context'); + st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context'); + st.deepEqual(args, [1, 2, 3], 'passed arguments are correct'); + st.end(); + }); + + t.test('returns properly with bound arguments', function (st) { + var boundContext = {}; + var args; + var namespace = { + func: functionBind.call(function () { + args = Array.prototype.slice.call(arguments); + return this; + }, boundContext, 1, 2, 3) + }; + var context = namespace.func(4, 5, 6); + st.equal(context, boundContext, 'returned context is bound context'); + st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context'); + st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct'); + st.end(); + }); + + t.test('passes the correct arguments when called as a constructor', function (st) { + var expected = { name: 'Correct' }; + var namespace = { + Func: functionBind.call(function (arg) { + return arg; + }, { name: 'Incorrect' }) + }; + var returned = new namespace.Func(expected); + st.equal(returned, expected, 'returns the right arg when called as a constructor'); + st.end(); + }); + + t.test('has the new instance\'s context when called as a constructor', function (st) { + var actualContext; + var expectedContext = { foo: 'bar' }; + var namespace = { + Func: functionBind.call(function () { + actualContext = this; + }, expectedContext) + }; + var result = new namespace.Func(); + st.equal(result instanceof namespace.Func, true); + st.notEqual(actualContext, expectedContext); + st.end(); + }); + + t.end(); +}); + +test('bound function length', function (t) { + t.test('sets a correct length without thisArg', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }); + st.equal(subject.length, 3); + st.equal(subject(1, 2, 3), 6); + st.end(); + }); + + t.test('sets a correct length with thisArg', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}); + st.equal(subject.length, 3); + st.equal(subject(1, 2, 3), 6); + st.end(); + }); + + t.test('sets a correct length without thisArg and first argument', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1); + st.equal(subject.length, 2); + st.equal(subject(2, 3), 6); + st.end(); + }); + + t.test('sets a correct length with thisArg and first argument', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1); + st.equal(subject.length, 2); + st.equal(subject(2, 3), 6); + st.end(); + }); + + t.test('sets a correct length without thisArg and too many arguments', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1, 2, 3, 4); + st.equal(subject.length, 0); + st.equal(subject(), 6); + st.end(); + }); + + t.test('sets a correct length with thisArg and too many arguments', function (st) { + var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1, 2, 3, 4); + st.equal(subject.length, 0); + st.equal(subject(), 6); + st.end(); + }); +}); diff --git a/node_modules/garnish/LICENSE.md b/node_modules/garnish/LICENSE.md new file mode 100644 index 000000000..89a78cf22 --- /dev/null +++ b/node_modules/garnish/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) +Copyright (c) 2015 Matt DesLauriers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/garnish/README.md b/node_modules/garnish/README.md new file mode 100644 index 000000000..9ba8f0683 --- /dev/null +++ b/node_modules/garnish/README.md @@ -0,0 +1,119 @@ +# garnish + +[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges) + +Prettifies [ndjson](http://ndjson.org/) or [bole](https://github.com/rvagg/bole) logs from [budo](https://github.com/mattdesl/budo), [wzrd](https://github.com/maxogden/wzrd/) and other tools. + +Example with [budo](https://github.com/mattdesl/budo), which uses this under the hood. + + + +## Install + +```sh +npm install garnish [-g|--save-dev] +``` + +## Usage + +### CLI + +Pipe a ndjson emitter into `garnish` like so: + +```sh +node app.js | garnish [opts] + +Options: + + --level, -l the minimum debug level, default 'debug' + --name, -n the default app name +``` + +Where `level` can be `debug`, `info`, `warn`, `error`. + +### API + +#### `garnish([opt])` + +Returns a duplexer that parses input as ndjson, and writes a pretty-printed result. Options: + +- `level` (String) + - the minimum log level to print (default `'debug'`) + - the order is as follows: `debug`, `info`, `warn`, `error` +- `name` (String) + - the default name for your logger; a message's `name` field will not be printed when it matches this default name, to reduce redundant/obvious information in the logs. + +## format + +Typically, you would use [bole](https://github.com/rvagg/bole) or [ndjson](https://www.npmjs.com/package/ndjson) to write the content to garnish. You can also write ndjson to `stdout` like so: + +```js +// a log message +console.log({ + name: 'myApp', + level: 'warn', + message: 'not found' +}) + +// a typical server message +console.log({ + name: 'myApp', + type: 'generated', + level: 'info', + url: '/foo.png', + statusCode: 200, + contentLength: 12800, // in bytes + elapsed: 120 // in milliseconds +}) +``` + + +Currently garnish styles the following: + +- `level` + - the log level e.g. `debug`, `info`, `warn`, `error` (default `debug`) - only shown if `message` is present +- `name` + - an optional event or application name. It's recommended to always have a name. +- `message` + - an event message. +- `url` + - a url (stripped to pathname), useful for router logging. +- `statusCode` + - an HTTP statusCode. Codes `>=400` are displayed in red. +- `contentLength` + - the response size; if a `number`, bytes are assumed +- `elapsed` + - time elapsed since the previous related event; if a `number`, milliseconds are assumed +- `type` + - the type of event logged +- `colors` + - an optional color mapping for custom styles + +You can use the `colors` field to override any of the default colors with a new [ANSI style](https://github.com/chalk/ansi-styles). + +For example, the following will print `elapsed` in yellow if it passes our threshold: + +```js +function logTime (msg) { + var now = Date.now() + var time = now - lastTime + lastTime = now + + console.log({ + name: 'app', + message: msg, + elapsed: time + ' ms', + colors: { + elapsed: time > 1000 ? 'yellow' : 'green' + } + }) +} +``` + +## See Also + +- [bistre](https://github.com/hughsk/bistre) + +## License + +MIT, see [LICENSE.md](http://github.com/mattdesl/garnish/blob/master/LICENSE.md) for details. diff --git a/node_modules/garnish/bin/cmd.js b/node_modules/garnish/bin/cmd.js new file mode 100755 index 000000000..4170346be --- /dev/null +++ b/node_modules/garnish/bin/cmd.js @@ -0,0 +1,15 @@ +#!/usr/bin/env node +var stdout = require('stdout-stream') +var garnish = require('../') +var argv = require('minimist')(process.argv.slice(2), { + alias: { + level: 'l', + name: 'n' + } +}) + +process.stdin.resume() +process.stdin.setEncoding('utf8') +process.stdin + .pipe(garnish(argv)) + .pipe(stdout) diff --git a/node_modules/garnish/index.js b/node_modules/garnish/index.js new file mode 100644 index 000000000..44a44493d --- /dev/null +++ b/node_modules/garnish/index.js @@ -0,0 +1,59 @@ +var split = require('split2') +var eol = require('os').EOL + +var renderer = require('./lib/renderer') +var levels = require('./lib/levels') + +module.exports = garnish + +function garnish (opt) { + opt = opt || {} + + var loggerLevel = opt.level || 'debug' + var render = renderer.create(opt.name) + + return split(parse) + + function parse (line) { + try { + var obj = JSON.parse(line) + + if (obj.name === 'http' && obj.message === 'request') return + if (typeof obj.level === 'number') toBunyan(obj) + + // check if we need to style it + if (!renderer.isStyleObject(obj)) return line + eol + obj.level = obj.level || 'info' + + // allow user to filter to a specific level + if (!levels.valid(loggerLevel, obj.level)) return + + // errors should be formatted differently + if (typeof obj.err === 'object') return renderer.renderError(obj) + eol + + if (typeof obj.message === 'object') { + return renderer.renderObject(obj) + eol + } + + return render(obj) + eol + } catch (e) { + return line + eol + } + } +} + +// mutate a bole log to bunyan log +// obj -> null +function toBunyan (obj) { + if (obj.msg && !obj.message) { + obj.message = obj.msg + delete obj.msg + } + + if (typeof obj.level === 'number') { + if (obj.level === 20) obj.level = 'debug' + if (obj.level === 30) obj.level = 'info' + if (obj.level === 40) obj.level = 'warn' + if (obj.level === 50) obj.level = 'error' + } +} diff --git a/node_modules/garnish/lib/levels.js b/node_modules/garnish/lib/levels.js new file mode 100644 index 000000000..7db7ec961 --- /dev/null +++ b/node_modules/garnish/lib/levels.js @@ -0,0 +1,34 @@ +var padRight = require('pad-right') + +var colors = { + debug: 'cyan', + info: 'dim', + warn: 'yellow', + error: 'red' +} + +var padLen = Object.keys(colors).reduce(function (prev, a) { + return Math.max(prev, a.length) +}, 0) + +var levels = Object.keys(colors) + +// whether the message level is valid for the given logger +module.exports.valid = function (logLevel, msgLevel) { + var levelIdx = levels.indexOf(logLevel) + var msgIdx = levels.indexOf(msgLevel) + if (msgIdx === -1 || levelIdx === -1) return true + return msgIdx >= levelIdx +} + +// stringify with padding +module.exports.stringify = function (level) { + return padRight(level, padLen, ' ') +} + +// get a level's default color +module.exports.color = function (level) { + return colors[level] +} + +module.exports.maxLength = padLen diff --git a/node_modules/garnish/lib/renderer.js b/node_modules/garnish/lib/renderer.js new file mode 100644 index 000000000..cd09e54fb --- /dev/null +++ b/node_modules/garnish/lib/renderer.js @@ -0,0 +1,192 @@ +var chalk = require('chalk') +var stripUrl = require('url-trim') +var now = require('right-now') +var levels = require('./levels') +var padLeft = require('pad-left') +var padRight = require('pad-right') +var prettyBytes = require('prettier-bytes') +var prettyMs = require('pretty-ms') + +var paddings = { + method: 6, + statusCode: 3, + contentLength: 8, + elapsed: 7 +} + +var leftAligns = [ 'method' ] + +var ansiStyles = Object.keys(chalk.styles) +var keys = [ + 'time', + 'level', + 'elapsed', + 'contentLength', + 'message', + 'method', + 'statusCode', + 'url', + 'type', + 'name' +] + +var startTime = now() + +exports.isStyleObject = function (data) { + // skip false/undefined/etc + if (typeof data !== 'object' || !data) { + return false + } + // ensure we have something worth styling + return keys.some(function (key) { + return data.hasOwnProperty(key) + }) +} + +exports.renderError = function (data) { + var timeOff = String(Math.round((now() - startTime) / 1000) % 10000) + var line = '[' + padLeft(timeOff, 4, '0') + '] ' + line += chalk['magenta']('(' + data.name + ')') + '\n' + line += chalk.red(data.err.stack) + '\n' + return line +} + +exports.renderObject = function (data) { + var timeOff = String(Math.round((now() - startTime) / 1000) % 10000) + var line = '' + line += '[' + padLeft(timeOff, 4, '0') + '] ' + line += levels.stringify(data.level) + line += chalk['magenta']('(' + data.name + ')') + '\n' + line += destructureMessage(data.message) + return line +} + +exports.create = function (defaultName) { + return function render (data) { + var level = data.level + var name = data.name + + // some default colors + var defaultColors = { + level: levels.color(level) || 'yellow', + name: 'magenta', + time: 'dim', + statusCode: data.statusCode >= 400 ? 'red' : 'green', + contentLength: 'dim', + elapsed: 'dim', + url: 'bold', + method: 'dim', + type: 'dim' + } + + // possible user overrides + var colors = data.colors || {} + + if (typeof data.message === 'object') { + data.message = destructureMessage(data.message) + } + + // clean up the messages a little + if (level) { + data.level = levels.stringify(level) + } + + if (name) { + data.name = name === defaultName ? '' : ('(' + name + ')') + } + + if (data.url) data.url = stripUrl(data.url) + if (data.type) data.type = '(' + data.type + ')' + + var line = [] + var timeOff = String(Math.round((now() - startTime) / 1000) % 10000) + data.time = '[' + padLeft(timeOff, 4, '0') + ']' + + if (!data.message) { + data.level = level = '' + } + + var alignLeft = true + + // render each of our valid keys + keys.forEach(function (key) { + var value = data[key] + + // skip empty data + if (!value && typeof value !== 'number') { + return + } + + // compact formatting + if (key === 'elapsed') value = fixElapsed(value) + if (key === 'contentLength') value = fixSize(value) + + // pad to length + if (key in paddings) { + var left = alignLeft || leftAligns.indexOf(key) >= 0 + var padFn = left ? padRight : padLeft + value = padFn.call(padFn, value, paddings[key], ' ') + alignLeft = false + } + + // colorize chunk + var newColor = getColor(key, colors, defaultColors) + + if (newColor) { + value = chalk[newColor](value) + } + + line.push(value) + }) + return line.join(' ') + } +} + +function fixElapsed (time) { + if (typeof time === 'string' && /s$/i.test(time)) { + return time + } + if (/infinity/i.test(time)) return time + var ms = parseInt(time, 10) + return ms > 9999 ? prettyMs(ms) : (ms + 'ms') +} + +function fixSize (size) { + if (typeof size === 'string' && /s$/i.test(size)) { + return size + } + if (/infinity/i.test(size)) return size + var bytes = parseInt(size, 10) + return bytes > 9999 + ? prettyBytes(bytes) + .replace(/ /, '') + : (bytes + 'B') +} + +function getColor (key, colors, defaultColors) { + // try to apply user style + var newColor = colors[key] + + // use default if style is invalid + if (ansiStyles.indexOf(newColor) === -1) { + newColor = null + } + return newColor || defaultColors[key] +} + +// destructure a message onto an object if the message +// is an object. +// obj -> str +function destructureMessage (msg) { + const keys = Object.keys(msg) + var res = '' + for (var i = 0; i < keys.length; i++) { + var key = keys[i] + var val = msg[key] + if (i !== 0) res += '\n' + res += chalk.blue(' "' + key + '"') + res += ': ' + res += chalk.green('"' + val + '"') + } + return res +} diff --git a/node_modules/garnish/package.json b/node_modules/garnish/package.json new file mode 100644 index 000000000..99a1726af --- /dev/null +++ b/node_modules/garnish/package.json @@ -0,0 +1,86 @@ +{ + "_from": "garnish@^5.0.0", + "_id": "garnish@5.2.0", + "_inBundle": false, + "_integrity": "sha1-vtQ2WTguSxmOM8eTiXvnxwHmVXc=", + "_location": "/garnish", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "garnish@^5.0.0", + "name": "garnish", + "escapedName": "garnish", + "rawSpec": "^5.0.0", + "saveSpec": null, + "fetchSpec": "^5.0.0" + }, + "_requiredBy": [ + "/budo" + ], + "_resolved": "https://registry.npmjs.org/garnish/-/garnish-5.2.0.tgz", + "_shasum": "bed43659382e4b198e33c793897be7c701e65577", + "_spec": "garnish@^5.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", + "author": { + "name": "Matt DesLauriers", + "email": "dave.des@gmail.com", + "url": "https://github.com/mattdesl" + }, + "bin": { + "garnish": "./bin/cmd.js" + }, + "bugs": { + "url": "https://github.com/mattdesl/garnish/issues" + }, + "bundleDependencies": false, + "dependencies": { + "chalk": "^0.5.1", + "minimist": "^1.1.0", + "pad-left": "^2.0.0", + "pad-right": "^0.2.2", + "prettier-bytes": "^1.0.3", + "pretty-ms": "^2.1.0", + "right-now": "^1.0.0", + "split2": "^0.2.1", + "stdout-stream": "^1.4.0", + "url-trim": "^1.0.0" + }, + "deprecated": false, + "description": "prettifies ndjson from wzrd and similar tools", + "devDependencies": { + "browserify": "^8.1.3", + "standard": "^4.5.4", + "strip-ansi": "^2.0.1", + "tape": "^3.5.0", + "wzrd": "^1.2.1" + }, + "homepage": "https://github.com/mattdesl/garnish", + "keywords": [ + "prettify", + "pretty", + "print", + "pretty-print", + "ndjson", + "bundle", + "bundler", + "browserify", + "wzrd", + "beefy", + "wizz" + ], + "license": "MIT", + "main": "index.js", + "name": "garnish", + "repository": { + "type": "git", + "url": "git://github.com/mattdesl/garnish.git" + }, + "scripts": { + "demo": "node test/app.js | ./bin/cmd.js", + "start": "node test/server.js", + "test": "standard && node test/test.js", + "wzrd": "wzrd test/demo.js | ./bin/cmd.js" + }, + "version": "5.2.0" +} diff --git a/node_modules/get-assigned-identifiers/.travis.yml b/node_modules/get-assigned-identifiers/.travis.yml new file mode 100644 index 000000000..989f79196 --- /dev/null +++ b/node_modules/get-assigned-identifiers/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - 8 + - 6 + - 4 +cache: + directories: + - ~/.npm diff --git a/node_modules/get-assigned-identifiers/CHANGELOG.md b/node_modules/get-assigned-identifiers/CHANGELOG.md new file mode 100644 index 000000000..fe525db0d --- /dev/null +++ b/node_modules/get-assigned-identifiers/CHANGELOG.md @@ -0,0 +1,17 @@ +# get-destructure-identifiers change log + +All notable changes to this project will be documented in this file. + +This project adheres to [Semantic Versioning](http://semver.org/). + +## 1.2.0 / 2018-02-08 + +* support object rest destructuring `{...a} = b` + +## 1.1.0 / 2017-12-02 + +* support import declarations + +## 1.0.0 / 2017-11-11 + +* initial release diff --git a/node_modules/get-assigned-identifiers/LICENSE.md b/node_modules/get-assigned-identifiers/LICENSE.md new file mode 100644 index 000000000..04361d9e4 --- /dev/null +++ b/node_modules/get-assigned-identifiers/LICENSE.md @@ -0,0 +1,15 @@ +# [Apache License 2.0](https://spdx.org/licenses/Apache-2.0) + +Copyright 2017 Renée Kooi + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +> http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/node_modules/get-assigned-identifiers/README.md b/node_modules/get-assigned-identifiers/README.md new file mode 100644 index 000000000..06957e4cc --- /dev/null +++ b/node_modules/get-assigned-identifiers/README.md @@ -0,0 +1,45 @@ +# get-assigned-identifiers + +get a list of identifiers that are initialised by a JavaScript AST node. + +[![npm][npm-image]][npm-url] +[![travis][travis-image]][travis-url] +[![standard][standard-image]][standard-url] + +[npm-image]: https://img.shields.io/npm/v/get-assigned-identifiers.svg?style=flat-square +[npm-url]: https://www.npmjs.com/package/get-assigned-identifiers +[travis-image]: https://img.shields.io/travis/goto-bus-stop/get-assigned-identifiers.svg?style=flat-square +[travis-url]: https://travis-ci.org/goto-bus-stop/get-assigned-identifiers +[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square +[standard-url]: http://npm.im/standard + +## Install + +``` +npm install get-assigned-identifiers +``` + +## Usage + +```js +var getAssignedIdentifiers = require('get-assigned-identifiers') + +var ast = parse(` + var { a, b: [ c,, ...x ], d } = whatever() +`) +var node = ast.body[0].declarations[0].id +getAssignedIdentifiers(node) +// → [{ name: 'a' }, { name: 'c' }, { name: 'x' }, { name: 'd' }] +``` + +## API + +### `getAssignedIdentifiers(node)` + +Return an array of AST Nodes referencing identifiers that are initialised by the `node`, taking into account destructuring. + +If `node` is not an identifier or destructuring node, this returns an empty array. + +## License + +[Apache-2.0](LICENSE.md) diff --git a/node_modules/get-assigned-identifiers/index.js b/node_modules/get-assigned-identifiers/index.js new file mode 100644 index 000000000..5933f8378 --- /dev/null +++ b/node_modules/get-assigned-identifiers/index.js @@ -0,0 +1,57 @@ +var assert = require('assert') + +/** + * Get a list of all identifiers that are initialised by this (possibly destructuring) + * node. + * + * eg with input: + * + * var { a: [b, ...c], d } = xyz + * + * this returns the nodes for 'b', 'c', and 'd' + */ +module.exports = function getAssignedIdentifiers (node, identifiers) { + assert.equal(typeof node, 'object', 'get-assigned-identifiers: node must be object') + assert.equal(typeof node.type, 'string', 'get-assigned-identifiers: node must have a type') + + identifiers = identifiers || [] + + if (node.type === 'ImportDeclaration') { + node.specifiers.forEach(function (el) { + getAssignedIdentifiers(el, identifiers) + }) + } + + if (node.type === 'ImportDefaultSpecifier' || node.type === 'ImportNamespaceSpecifier' || node.type === 'ImportSpecifier') { + node = node.local + } + + if (node.type === 'RestElement') { + node = node.argument + } + + if (node.type === 'ArrayPattern') { + node.elements.forEach(function (el) { + // `el` might be `null` in case of `[x,,y] = whatever` + if (el) { + getAssignedIdentifiers(el, identifiers) + } + }) + } + + if (node.type === 'ObjectPattern') { + node.properties.forEach(function (prop) { + if (prop.type === 'Property') { + getAssignedIdentifiers(prop.value, identifiers) + } else if (prop.type === 'RestElement') { + getAssignedIdentifiers(prop, identifiers) + } + }) + } + + if (node.type === 'Identifier') { + identifiers.push(node) + } + + return identifiers +} diff --git a/node_modules/get-assigned-identifiers/package.json b/node_modules/get-assigned-identifiers/package.json new file mode 100644 index 000000000..4fdaabe3e --- /dev/null +++ b/node_modules/get-assigned-identifiers/package.json @@ -0,0 +1,61 @@ +{ + "_from": "get-assigned-identifiers@^1.2.0", + "_id": "get-assigned-identifiers@1.2.0", + "_inBundle": false, + "_integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==", + "_location": "/get-assigned-identifiers", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "get-assigned-identifiers@^1.2.0", + "name": "get-assigned-identifiers", + "escapedName": "get-assigned-identifiers", + "rawSpec": "^1.2.0", + "saveSpec": null, + "fetchSpec": "^1.2.0" + }, + "_requiredBy": [ + "/undeclared-identifiers" + ], + "_resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", + "_shasum": "6dbf411de648cbaf8d9169ebb0d2d576191e2ff1", + "_spec": "get-assigned-identifiers@^1.2.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/undeclared-identifiers", + "author": { + "name": "Renée Kooi", + "email": "renee@kooi.me" + }, + "bugs": { + "url": "https://github.com/goto-bus-stop/get-assigned-identifiers/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "get a list of identifiers that are initialised by a JavaScript AST node.", + "devDependencies": { + "acorn": "^5.4.1", + "standard": "^10.0.3", + "tape": "^4.8.0" + }, + "homepage": "https://github.com/goto-bus-stop/get-assigned-identifiers", + "keywords": [ + "ast", + "bindings", + "destructuring", + "identifiers", + "javascript", + "names", + "node" + ], + "license": "Apache-2.0", + "main": "index.js", + "name": "get-assigned-identifiers", + "repository": { + "type": "git", + "url": "git+https://github.com/goto-bus-stop/get-assigned-identifiers.git" + }, + "scripts": { + "test": "standard && tape test/*.js" + }, + "version": "1.2.0" +} diff --git a/node_modules/get-assigned-identifiers/test/index.js b/node_modules/get-assigned-identifiers/test/index.js new file mode 100644 index 000000000..3fbb2dd9a --- /dev/null +++ b/node_modules/get-assigned-identifiers/test/index.js @@ -0,0 +1,122 @@ +var test = require('tape') +var assert = require('assert') +var parse = require('acorn').parse +var getAssignedIdentifiers = require('../') + +function getName (node) { + assert.equal(node.type, 'Identifier', 'Returned node must be an Identifier') + return node.name +} + +test('example', function (t) { + t.plan(1) + + var ast = parse(` + var { a, b: [ c,, ...x ], d } = whatever() + `) + var node = ast.body[0].declarations[0].id + t.deepEqual(getAssignedIdentifiers(node).map(getName), [ + 'a', + 'c', + 'x', + 'd' + ]) +}) + +test('simple identifiers', function (t) { + t.plan(1) + var ast = parse(` + var xyz = whatever() + `) + var node = ast.body[0].declarations[0].id + t.deepEqual(getAssignedIdentifiers(node).map(getName), [ 'xyz' ]) +}) + +test('array destructuring', function (t) { + t.plan(1) + var ast = parse(` + var [a, b, c] = whatever() + `) + var node = ast.body[0].declarations[0].id + t.deepEqual(getAssignedIdentifiers(node).map(getName), [ 'a', 'b', 'c' ]) +}) + +test('array destructuring with rest element', function (t) { + t.plan(1) + var ast = parse(` + var [a, b, ...rest] = whatever() + `) + var node = ast.body[0].declarations[0].id + t.deepEqual(getAssignedIdentifiers(node).map(getName), [ 'a', 'b', 'rest' ]) +}) + +test('array destructuring with holes', function (t) { + t.plan(1) + var ast = parse(` + var [a, b,,,,,, boop] = whatever() + `) + var node = ast.body[0].declarations[0].id + t.deepEqual(getAssignedIdentifiers(node).map(getName), [ 'a', 'b', 'boop' ]) +}) + +test('nested array destructuring', function (t) { + t.plan(1) + var ast = parse(` + var [a, [[[b]], ...c], boop] = whatever() + `) + var node = ast.body[0].declarations[0].id + t.deepEqual(getAssignedIdentifiers(node).map(getName), [ 'a', 'b', 'c', 'boop' ]) +}) + +test('object destructuring', function (t) { + t.plan(1) + var ast = parse(` + var {a, b} = whatever() + `) + var node = ast.body[0].declarations[0].id + t.deepEqual(getAssignedIdentifiers(node).map(getName), [ 'a', 'b' ]) +}) + +test('object destructuring with different names', function (t) { + t.plan(1) + var ast = parse(` + var {a: b, b: lol} = whatever() + `) + var node = ast.body[0].declarations[0].id + t.deepEqual(getAssignedIdentifiers(node).map(getName), [ 'b', 'lol' ]) +}) + +test('nested object destructuring', function (t) { + t.plan(1) + var ast = parse(` + var {a: {b}, b: lol, c: { + d, e: { f: g } + }} = whatever() + `) + var node = ast.body[0].declarations[0].id + t.deepEqual(getAssignedIdentifiers(node).map(getName), [ 'b', 'lol', 'd', 'g' ]) +}) + +test('object rest destructuring', function (t) { + t.plan(1) + var ast = parse(` + var {a, ...b} = whatever() + `, { ecmaVersion: 9 }) + var node = ast.body[0].declarations[0].id + t.deepEqual(getAssignedIdentifiers(node).map(getName), [ 'a', 'b' ]) +}) + +test('import declarations', function (t) { + t.plan(2) + var ast = parse(` + import x, { y, z as a } from 'module' + `, { sourceType: 'module' }) + var node = ast.body[0] + t.deepEqual(getAssignedIdentifiers(node).map(getName), [ 'x', 'y', 'a' ]) + + ast = parse(` + import * as ns from 'module' + `, { sourceType: 'module' }) + node = ast.body[0] + t.deepEqual(getAssignedIdentifiers(node).map(getName), [ 'ns' ]) +}) diff --git a/node_modules/get-ports/LICENSE.md b/node_modules/get-ports/LICENSE.md new file mode 100644 index 000000000..9b10ce2a8 --- /dev/null +++ b/node_modules/get-ports/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) +Copyright (c) 2015 Jam3 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/get-ports/README.md b/node_modules/get-ports/README.md new file mode 100644 index 000000000..0af2fef8b --- /dev/null +++ b/node_modules/get-ports/README.md @@ -0,0 +1,48 @@ +# get-ports + +[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges) + +Finds multiple open ports after your specified base ports, and below the max range. + +Unlike [getport](https://github.com/mikeal/getport) or [get-port](https://github.com/sindresorhus/get-port), this is useful for situations where you need multiple servers to run on open ports. + +If not all ports could be found, the error callback is triggered. + +## Install + +```sh +npm install get-ports --save +``` + +## Example + +The resulting `ports` array is parallel to your input (base) ports. + +For example, if port `8000` and `9966` are already in use: + +```js +var getPorts = require('get-ports') + +getPorts([ 8000, 9966 ], function (err, ports) { + if (err) throw new Error('could not open servers') + + console.log(ports) + //=> [ 8001, 9967 ] +}) +``` + +## Usage + +[![NPM](https://nodei.co/npm/get-ports.png)](https://www.npmjs.com/package/get-ports) + +#### `getPorts(basePorts, [maxPort], callback)` + +For the given array of `basePorts`, tries to find the next available port from each one. This keeps track of available ports to ensure there are no conflicts in the final result. + +If the finite number `maxPort` is specified, the portfinding will fail when it reaches that maximum port. Defaults to 60000. + +The callback is called with `(err, ports)`, where `err` will be an Error if any of the portfindings failed (i.e. no open ports within range). If successful, `err` will be null and `ports` will be an array, parallel to `basePorts`, with the found port numbers. + +## License + +MIT, see [LICENSE.md](http://github.com/Jam3/get-ports/blob/master/LICENSE.md) for details. diff --git a/node_modules/get-ports/index.js b/node_modules/get-ports/index.js new file mode 100644 index 000000000..5aecfa83f --- /dev/null +++ b/node_modules/get-ports/index.js @@ -0,0 +1,50 @@ +var mapLimit = require('map-limit') +var net = require('net') +var DEFAULT_MAX_PORT = 65535 + +module.exports = getPorts +function getPorts (basePorts, maxPort, cb) { + if (!Array.isArray(basePorts)) { + throw new TypeError('must provide array of ports as first argument') + } + if (typeof maxPort !== 'number') { + cb = maxPort + maxPort = DEFAULT_MAX_PORT + } + if (typeof cb !== 'function') { + throw new TypeError('must provide callback function') + } + if (!isFinite(maxPort)) { + throw new TypeError('maxPort must be a finite number') + } + + var usedPorts = [] + mapLimit(basePorts, 1, function (base, next) { + getNextPort(base, function (err, port) { + if (err) return next(new Error('no ports found after ' + base)) + next(null, port) + }) + }, cb) + + function getNextPort (basePort, cb) { + // skip used ports + while (basePort < maxPort && usedPorts.indexOf(basePort) >= 0) { + basePort++ + } + + if (basePort >= maxPort) { + return process.nextTick(function () { + cb(new Error('no open ports')) + }) + } + + var c = net.connect(basePort, function () { + c.destroy() + getNextPort(basePort + 1, cb) + }) + c.on('error', function () { + usedPorts.push(basePort) + cb(null, basePort) + }) + } +} diff --git a/node_modules/get-ports/package.json b/node_modules/get-ports/package.json new file mode 100644 index 000000000..05e8b94e1 --- /dev/null +++ b/node_modules/get-ports/package.json @@ -0,0 +1,68 @@ +{ + "_from": "get-ports@^1.0.2", + "_id": "get-ports@1.0.3", + "_inBundle": false, + "_integrity": "sha1-9AvVgKyn7A77e5bL/L6wPviUteg=", + "_location": "/get-ports", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "get-ports@^1.0.2", + "name": "get-ports", + "escapedName": "get-ports", + "rawSpec": "^1.0.2", + "saveSpec": null, + "fetchSpec": "^1.0.2" + }, + "_requiredBy": [ + "/budo" + ], + "_resolved": "https://registry.npmjs.org/get-ports/-/get-ports-1.0.3.tgz", + "_shasum": "f40bd580aca7ec0efb7b96cbfcbeb03ef894b5e8", + "_spec": "get-ports@^1.0.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", + "author": { + "name": "Matt DesLauriers", + "email": "dave.des@gmail.com", + "url": "https://github.com/mattdesl" + }, + "bugs": { + "url": "https://github.com/Jam3/get-ports/issues" + }, + "bundleDependencies": false, + "dependencies": { + "map-limit": "0.0.1" + }, + "deprecated": false, + "description": "gets multiple open ports", + "devDependencies": { + "faucet": "0.0.1", + "standard": "^5.3.1", + "tape": "^4.2.1" + }, + "homepage": "https://github.com/Jam3/get-ports", + "keywords": [ + "get", + "port", + "find", + "portfind", + "finding", + "finds", + "gets", + "portfinding", + "portfinder", + "multiple" + ], + "license": "MIT", + "main": "index.js", + "name": "get-ports", + "repository": { + "type": "git", + "url": "git://github.com/Jam3/get-ports.git" + }, + "scripts": { + "test": "standard && node test.js | faucet" + }, + "version": "1.0.3" +} diff --git a/node_modules/get-stream/buffer-stream.js b/node_modules/get-stream/buffer-stream.js new file mode 100644 index 000000000..ae45d3d9e --- /dev/null +++ b/node_modules/get-stream/buffer-stream.js @@ -0,0 +1,51 @@ +'use strict'; +const PassThrough = require('stream').PassThrough; + +module.exports = opts => { + opts = Object.assign({}, opts); + + const array = opts.array; + let encoding = opts.encoding; + const buffer = encoding === 'buffer'; + let objectMode = false; + + if (array) { + objectMode = !(encoding || buffer); + } else { + encoding = encoding || 'utf8'; + } + + if (buffer) { + encoding = null; + } + + let len = 0; + const ret = []; + const stream = new PassThrough({objectMode}); + + if (encoding) { + stream.setEncoding(encoding); + } + + stream.on('data', chunk => { + ret.push(chunk); + + if (objectMode) { + len = ret.length; + } else { + len += chunk.length; + } + }); + + stream.getBufferedValue = () => { + if (array) { + return ret; + } + + return buffer ? Buffer.concat(ret, len) : ret.join(''); + }; + + stream.getBufferedLength = () => len; + + return stream; +}; diff --git a/node_modules/get-stream/index.js b/node_modules/get-stream/index.js new file mode 100644 index 000000000..2dc5ee96a --- /dev/null +++ b/node_modules/get-stream/index.js @@ -0,0 +1,51 @@ +'use strict'; +const bufferStream = require('./buffer-stream'); + +function getStream(inputStream, opts) { + if (!inputStream) { + return Promise.reject(new Error('Expected a stream')); + } + + opts = Object.assign({maxBuffer: Infinity}, opts); + + const maxBuffer = opts.maxBuffer; + let stream; + let clean; + + const p = new Promise((resolve, reject) => { + const error = err => { + if (err) { // null check + err.bufferedData = stream.getBufferedValue(); + } + + reject(err); + }; + + stream = bufferStream(opts); + inputStream.once('error', error); + inputStream.pipe(stream); + + stream.on('data', () => { + if (stream.getBufferedLength() > maxBuffer) { + reject(new Error('maxBuffer exceeded')); + } + }); + stream.once('error', error); + stream.on('end', resolve); + + clean = () => { + // some streams doesn't implement the `stream.Readable` interface correctly + if (inputStream.unpipe) { + inputStream.unpipe(stream); + } + }; + }); + + p.then(clean, clean); + + return p.then(() => stream.getBufferedValue()); +} + +module.exports = getStream; +module.exports.buffer = (stream, opts) => getStream(stream, Object.assign({}, opts, {encoding: 'buffer'})); +module.exports.array = (stream, opts) => getStream(stream, Object.assign({}, opts, {array: true})); diff --git a/node_modules/get-stream/license b/node_modules/get-stream/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/get-stream/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/get-stream/package.json b/node_modules/get-stream/package.json new file mode 100644 index 000000000..78eecdea3 --- /dev/null +++ b/node_modules/get-stream/package.json @@ -0,0 +1,80 @@ +{ + "_from": "get-stream@^3.0.0", + "_id": "get-stream@3.0.0", + "_inBundle": false, + "_integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "_location": "/get-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "get-stream@^3.0.0", + "name": "get-stream", + "escapedName": "get-stream", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/execa" + ], + "_resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "_shasum": "8e943d1358dc37555054ecbe2edb05aa174ede14", + "_spec": "get-stream@^3.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/execa", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/get-stream/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Get a stream as a string, buffer, or array", + "devDependencies": { + "ava": "*", + "into-stream": "^3.0.0", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js", + "buffer-stream.js" + ], + "homepage": "https://github.com/sindresorhus/get-stream#readme", + "keywords": [ + "get", + "stream", + "promise", + "concat", + "string", + "str", + "text", + "buffer", + "read", + "data", + "consume", + "readable", + "readablestream", + "array", + "object", + "obj" + ], + "license": "MIT", + "name": "get-stream", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/get-stream.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.0.0", + "xo": { + "esnext": true + } +} diff --git a/node_modules/get-stream/readme.md b/node_modules/get-stream/readme.md new file mode 100644 index 000000000..73b188fb4 --- /dev/null +++ b/node_modules/get-stream/readme.md @@ -0,0 +1,117 @@ +# get-stream [![Build Status](https://travis-ci.org/sindresorhus/get-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/get-stream) + +> Get a stream as a string, buffer, or array + + +## Install + +``` +$ npm install --save get-stream +``` + + +## Usage + +```js +const fs = require('fs'); +const getStream = require('get-stream'); +const stream = fs.createReadStream('unicorn.txt'); + +getStream(stream).then(str => { + console.log(str); + /* + ,,))))))));, + __)))))))))))))), + \|/ -\(((((''''((((((((. + -*-==//////(('' . `)))))), + /|\ ))| o ;-. '((((( ,(, + ( `| / ) ;))))' ,_))^;(~ + | | | ,))((((_ _____------~~~-. %,;(;(>';'~ + o_); ; )))(((` ~---~ `:: \ %%~~)(v;(`('~ + ; ''''```` `: `:::|\,__,%% );`'; ~ + | _ ) / `:|`----' `-' + ______/\/~ | / / + /~;;.____/;;' / ___--,-( `;;;/ + / // _;______;'------~~~~~ /;;/\ / + // | | / ; \;;,\ + (<_ | ; /',/-----' _> + \_| ||_ //~;~~~~~~~~~ + `\_| (,~~ + \~\ + ~~ + */ +}); +``` + + +## API + +The methods returns a promise that resolves when the `end` event fires on the stream, indicating that there is no more data to be read. The stream is switched to flowing mode. + +### getStream(stream, [options]) + +Get the `stream` as a string. + +#### options + +##### encoding + +Type: `string`
+Default: `utf8` + +[Encoding](https://nodejs.org/api/buffer.html#buffer_buffer) of the incoming stream. + +##### maxBuffer + +Type: `number`
+Default: `Infinity` + +Maximum length of the returned string. If it exceeds this value before the stream ends, the promise will be rejected. + +### getStream.buffer(stream, [options]) + +Get the `stream` as a buffer. + +It honors the `maxBuffer` option as above, but it refers to byte length rather than string length. + +### getStream.array(stream, [options]) + +Get the `stream` as an array of values. + +It honors both the `maxBuffer` and `encoding` options. The behavior changes slightly based on the encoding chosen: + +- When `encoding` is unset, it assumes an [object mode stream](https://nodesource.com/blog/understanding-object-streams/) and collects values emitted from `stream` unmodified. In this case `maxBuffer` refers to the number of items in the array (not the sum of their sizes). + +- When `encoding` is set to `buffer`, it collects an array of buffers. `maxBuffer` refers to the summed byte lengths of every buffer in the array. + +- When `encoding` is set to anything else, it collects an array of strings. `maxBuffer` refers to the summed character lengths of every string in the array. + + +## Errors + +If the input stream emits an `error` event, the promise will be rejected with the error. The buffered data will be attached to the `bufferedData` property of the error. + +```js +getStream(streamThatErrorsAtTheEnd('unicorn')) + .catch(err => { + console.log(err.bufferedData); + //=> 'unicorn' + }); +``` + + +## FAQ + +### How is this different from [`concat-stream`](https://github.com/maxogden/concat-stream)? + +This module accepts a stream instead of being one and returns a promise instead of using a callback. The API is simpler and it only supports returning a string, buffer, or array. It doesn't have a fragile type inference. You explicitly choose what you want. And it doesn't depend on the huge `readable-stream` package. + + +## Related + +- [get-stdin](https://github.com/sindresorhus/get-stdin) - Get stdin as a string or buffer + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/get-value/LICENSE b/node_modules/get-value/LICENSE new file mode 100644 index 000000000..39245ac1c --- /dev/null +++ b/node_modules/get-value/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/get-value/index.js b/node_modules/get-value/index.js new file mode 100644 index 000000000..5879a8848 --- /dev/null +++ b/node_modules/get-value/index.js @@ -0,0 +1,50 @@ +/*! + * get-value + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +module.exports = function(obj, prop, a, b, c) { + if (!isObject(obj) || !prop) { + return obj; + } + + prop = toString(prop); + + // allowing for multiple properties to be passed as + // a string or array, but much faster (3-4x) than doing + // `[].slice.call(arguments)` + if (a) prop += '.' + toString(a); + if (b) prop += '.' + toString(b); + if (c) prop += '.' + toString(c); + + if (prop in obj) { + return obj[prop]; + } + + var segs = prop.split('.'); + var len = segs.length; + var i = -1; + + while (obj && (++i < len)) { + var key = segs[i]; + while (key[key.length - 1] === '\\') { + key = key.slice(0, -1) + '.' + segs[++i]; + } + obj = obj[key]; + } + return obj; +}; + +function isObject(val) { + return val !== null && (typeof val === 'object' || typeof val === 'function'); +} + +function toString(val) { + if (!val) return ''; + if (Array.isArray(val)) { + return val.join('.'); + } + return val; +} diff --git a/node_modules/get-value/package.json b/node_modules/get-value/package.json new file mode 100644 index 000000000..76db558d6 --- /dev/null +++ b/node_modules/get-value/package.json @@ -0,0 +1,113 @@ +{ + "_from": "get-value@^2.0.6", + "_id": "get-value@2.0.6", + "_inBundle": false, + "_integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "_location": "/get-value", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "get-value@^2.0.6", + "name": "get-value", + "escapedName": "get-value", + "rawSpec": "^2.0.6", + "saveSpec": null, + "fetchSpec": "^2.0.6" + }, + "_requiredBy": [ + "/cache-base", + "/has-value", + "/union-value", + "/unset-value/has-value" + ], + "_resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "_shasum": "dc15ca1c672387ca76bd37ac0a395ba2042a2c28", + "_spec": "get-value@^2.0.6", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/cache-base", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/get-value/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Use property paths (`a.b.c`) to get a nested value from an object.", + "devDependencies": { + "ansi-bold": "^0.1.1", + "arr-reduce": "^1.0.1", + "benchmarked": "^0.1.4", + "dot-prop": "^2.2.0", + "getobject": "^0.1.0", + "gulp": "^3.9.0", + "gulp-eslint": "^1.1.1", + "gulp-format-md": "^0.1.5", + "gulp-istanbul": "^0.10.2", + "gulp-mocha": "^2.1.3", + "isobject": "^2.0.0", + "matched": "^0.3.2", + "minimist": "^1.2.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/get-value", + "keywords": [ + "get", + "key", + "nested", + "object", + "path", + "paths", + "prop", + "properties", + "property", + "props", + "segment", + "value", + "values" + ], + "license": "MIT", + "main": "index.js", + "name": "get-value", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/get-value.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "has-any", + "has-any-deep", + "has-value", + "set-value", + "unset-value" + ] + }, + "reflinks": [ + "verb", + "verb-readme-generator" + ], + "lint": { + "reflinks": true + } + }, + "version": "2.0.6" +} diff --git a/node_modules/glob-base/LICENSE b/node_modules/glob-base/LICENSE new file mode 100644 index 000000000..65f90aca8 --- /dev/null +++ b/node_modules/glob-base/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/glob-base/README.md b/node_modules/glob-base/README.md new file mode 100644 index 000000000..1da2e82f1 --- /dev/null +++ b/node_modules/glob-base/README.md @@ -0,0 +1,158 @@ +# glob-base [![NPM version](https://badge.fury.io/js/glob-base.svg)](http://badge.fury.io/js/glob-base) [![Build Status](https://travis-ci.org/jonschlinkert/glob-base.svg)](https://travis-ci.org/jonschlinkert/glob-base) + +> Returns an object with the (non-glob) base path and the actual pattern. + +Use [glob-parent](https://github.com/es128/glob-parent) if you just want the base path. + +## Install with [npm](npmjs.org) + +```bash +npm i glob-base --save +``` + +## Related projects +* [glob-parent](https://github.com/es128/glob-parent): Strips glob magic from a string to provide the parent path +* [micromatch](https://github.com/jonschlinkert/micromatch): Glob matching for javascript/node.js. A faster alternative to minimatch (10-45x faster on avg), with all the features you're used to using in your Grunt and gulp tasks. +* [parse-glob](https://github.com/jonschlinkert/parse-glob): Parse a glob pattern into an object of tokens. +* [is-glob](https://github.com/jonschlinkert/is-glob): Returns `true` if the given string looks like a glob pattern. +* [braces](https://github.com/jonschlinkert/braces): Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces specification. +* [fill-range](https://github.com/jonschlinkert/fill-range): Fill in a range of numbers or letters, optionally passing an increment or multiplier to use. +* [expand-range](https://github.com/jonschlinkert/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See the benchmarks. Used by micromatch. + +## Usage + +```js +var globBase = require('glob-base'); + +globBase('a/b/.git/'); +//=> { base: 'a/b/.git/', isGlob: false, glob: '' }) + +globBase('a/b/**/e'); +//=> { base: 'a/b', isGlob: true, glob: '**/e' } + +globBase('a/b/*.{foo,bar}'); +//=> { base: 'a/b', isGlob: true, glob: '*.{foo,bar}' } + +globBase('a/b/.git/**'); +//=> { base: 'a/b/.git', isGlob: true, glob: '**' } + +globBase('a/b/c/*.md'); +//=> { base: 'a/b/c', isGlob: true, glob: '*.md' } + +globBase('a/b/c/.*.md'); +//=> { base: 'a/b/c', isGlob: true, glob: '.*.md' } + +globBase('a/b/{c,d}'); +//=> { base: 'a/b', isGlob: true, glob: '{c,d}' } + +globBase('!*.min.js'); +//=> { base: '.', isGlob: true, glob: '!*.min.js' } + +globBase('!foo'); +//=> { base: '.', isGlob: true, glob: '!foo' } + +globBase('!foo/(a|b).min.js'); +//=> { base: '.', isGlob: true, glob: '!foo/(a|b).min.js' } + +globBase(''); +//=> { base: '.', isGlob: false, glob: '' } + +globBase('**/*.md'); +//=> { base: '.', isGlob: true, glob: '**/*.md' } + +globBase('**/*.min.js'); +//=> { base: '.', isGlob: true, glob: '**/*.min.js' } + +globBase('**/.*'); +//=> { base: '.', isGlob: true, glob: '**/.*' } + +globBase('**/d'); +//=> { base: '.', isGlob: true, glob: '**/d' } + +globBase('*.*'); +//=> { base: '.', isGlob: true, glob: '*.*' } + +globBase('*.min.js'); +//=> { base: '.', isGlob: true, glob: '*.min.js' } + +globBase('*/*'); +//=> { base: '.', isGlob: true, glob: '*/*' } + +globBase('*b'); +//=> { base: '.', isGlob: true, glob: '*b' } + +globBase('.'); +//=> { base: '.', isGlob: false, glob: '.' } + +globBase('.*'); +//=> { base: '.', isGlob: true, glob: '.*' } + +globBase('./*'); +//=> { base: '.', isGlob: true, glob: '*' } + +globBase('/a'); +//=> { base: '/', isGlob: false, glob: 'a' } + +globBase('@(a|b)/e.f.g/'); +//=> { base: '.', isGlob: true, glob: '@(a|b)/e.f.g/' } + +globBase('[a-c]b*'); +//=> { base: '.', isGlob: true, glob: '[a-c]b*' } + +globBase('a'); +//=> { base: '.', isGlob: false, glob: 'a' } + +globBase('a.min.js'); +//=> { base: '.', isGlob: false, glob: 'a.min.js' } + +globBase('a/'); +//=> { base: 'a/', isGlob: false, glob: '' } + +globBase('a/**/j/**/z/*.md'); +//=> { base: 'a', isGlob: true, glob: '**/j/**/z/*.md' } + +globBase('a/*/c/*.md'); +//=> { base: 'a', isGlob: true, glob: '*/c/*.md' } + +globBase('a/?/c.md'); +//=> { base: 'a', isGlob: true, glob: '?/c.md' } + +globBase('a/??/c.js'); +//=> { base: 'a', isGlob: true, glob: '??/c.js' } + +globBase('a?b'); +//=> { base: '.', isGlob: true, glob: 'a?b' } + +globBase('bb'); +//=> { base: '.', isGlob: false, glob: 'bb' } + +globBase('c.md'); +//=> { base: '.', isGlob: false, glob: 'c.md' } +``` + +## Running tests +Install dev dependencies. + +```bash +npm i -d && npm test +``` + + +## Contributing +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/glob-base/issues) + + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License +Copyright (c) 2015 Jon Schlinkert +Released under the MIT license + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 08, 2015._ diff --git a/node_modules/glob-base/index.js b/node_modules/glob-base/index.js new file mode 100644 index 000000000..564b4a885 --- /dev/null +++ b/node_modules/glob-base/index.js @@ -0,0 +1,51 @@ +/*! + * glob-base + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var path = require('path'); +var parent = require('glob-parent'); +var isGlob = require('is-glob'); + +module.exports = function globBase(pattern) { + if (typeof pattern !== 'string') { + throw new TypeError('glob-base expects a string.'); + } + + var res = {}; + res.base = parent(pattern); + res.isGlob = isGlob(pattern); + + if (res.base !== '.') { + res.glob = pattern.substr(res.base.length); + if (res.glob.charAt(0) === '/') { + res.glob = res.glob.substr(1); + } + } else { + res.glob = pattern; + } + + if (!res.isGlob) { + res.base = dirname(pattern); + res.glob = res.base !== '.' + ? pattern.substr(res.base.length) + : pattern; + } + + if (res.glob.substr(0, 2) === './') { + res.glob = res.glob.substr(2); + } + if (res.glob.charAt(0) === '/') { + res.glob = res.glob.substr(1); + } + return res; +}; + +function dirname(glob) { + if (glob.slice(-1) === '/') return glob; + return path.dirname(glob); +} diff --git a/node_modules/glob-base/package.json b/node_modules/glob-base/package.json new file mode 100644 index 000000000..70f0dcf2a --- /dev/null +++ b/node_modules/glob-base/package.json @@ -0,0 +1,77 @@ +{ + "_from": "glob-base@^0.3.0", + "_id": "glob-base@0.3.0", + "_inBundle": false, + "_integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "_location": "/glob-base", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "glob-base@^0.3.0", + "name": "glob-base", + "escapedName": "glob-base", + "rawSpec": "^0.3.0", + "saveSpec": null, + "fetchSpec": "^0.3.0" + }, + "_requiredBy": [ + "/parse-glob" + ], + "_resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "_shasum": "dbb164f6221b1c0b1ccf82aea328b497df0ea3c4", + "_spec": "glob-base@^0.3.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/parse-glob", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/glob-base/issues" + }, + "bundleDependencies": false, + "dependencies": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + }, + "deprecated": false, + "description": "Returns an object with the (non-glob) base path and the actual pattern.", + "devDependencies": { + "mocha": "*", + "should": "^5.1.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/glob-base", + "keywords": [ + "base", + "directory", + "dirname", + "expression", + "glob", + "parent", + "path", + "pattern", + "regex", + "regular", + "root" + ], + "license": { + "type": "MIT", + "url": "https://github.com/jonschlinkert/glob-base/blob/master/LICENSE" + }, + "main": "index.js", + "name": "glob-base", + "repository": { + "type": "git", + "url": "git://github.com/jonschlinkert/glob-base.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "0.3.0" +} diff --git a/node_modules/glob-parent/.npmignore b/node_modules/glob-parent/.npmignore new file mode 100644 index 000000000..33e391f0e --- /dev/null +++ b/node_modules/glob-parent/.npmignore @@ -0,0 +1,4 @@ +node_modules +.DS_Store +npm-debug.log +coverage diff --git a/node_modules/glob-parent/.travis.yml b/node_modules/glob-parent/.travis.yml new file mode 100644 index 000000000..18fc42f69 --- /dev/null +++ b/node_modules/glob-parent/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - "4" + - "iojs-v3" + - "iojs-v2" + - "iojs-v1" + - "0.12" + - "0.10" diff --git a/node_modules/glob-parent/LICENSE b/node_modules/glob-parent/LICENSE new file mode 100644 index 000000000..734076d8a --- /dev/null +++ b/node_modules/glob-parent/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2015 Elan Shanker + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/glob-parent/README.md b/node_modules/glob-parent/README.md new file mode 100644 index 000000000..ff5310d3b --- /dev/null +++ b/node_modules/glob-parent/README.md @@ -0,0 +1,43 @@ +glob-parent [![Build Status](https://travis-ci.org/es128/glob-parent.svg)](https://travis-ci.org/es128/glob-parent) [![Coverage Status](https://img.shields.io/coveralls/es128/glob-parent.svg)](https://coveralls.io/r/es128/glob-parent?branch=master) +====== +Javascript module to extract the non-magic parent path from a glob string. + +[![NPM](https://nodei.co/npm/glob-parent.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/glob-parent/) +[![NPM](https://nodei.co/npm-dl/glob-parent.png?height=3&months=9)](https://nodei.co/npm-dl/glob-parent/) + +Usage +----- +```sh +npm install glob-parent --save +``` + +```js +var globParent = require('glob-parent'); + +globParent('path/to/*.js'); // 'path/to' +globParent('/root/path/to/*.js'); // '/root/path/to' +globParent('/*.js'); // '/' +globParent('*.js'); // '.' +globParent('**/*.js'); // '.' +globParent('path/{to,from}'); // 'path' +globParent('path/!(to|from)'); // 'path' +globParent('path/?(to|from)'); // 'path' +globParent('path/+(to|from)'); // 'path' +globParent('path/*(to|from)'); // 'path' +globParent('path/@(to|from)'); // 'path' +globParent('path/**/*'); // 'path' + +// if provided a non-glob path, returns the nearest dir +globParent('path/foo/bar.js'); // 'path/foo' +globParent('path/foo/'); // 'path/foo' +globParent('path/foo'); // 'path' (see issue #3 for details) + +``` + +Change Log +---------- +[See release notes page on GitHub](https://github.com/es128/glob-parent/releases) + +License +------- +[ISC](https://raw.github.com/es128/glob-parent/master/LICENSE) diff --git a/node_modules/glob-parent/index.js b/node_modules/glob-parent/index.js new file mode 100644 index 000000000..61615f1ac --- /dev/null +++ b/node_modules/glob-parent/index.js @@ -0,0 +1,10 @@ +'use strict'; + +var path = require('path'); +var isglob = require('is-glob'); + +module.exports = function globParent(str) { + str += 'a'; // preserves full path in case of trailing path separator + do {str = path.dirname(str)} while (isglob(str)); + return str; +}; diff --git a/node_modules/glob-parent/package.json b/node_modules/glob-parent/package.json new file mode 100644 index 000000000..da6626b09 --- /dev/null +++ b/node_modules/glob-parent/package.json @@ -0,0 +1,63 @@ +{ + "_from": "glob-parent@^2.0.0", + "_id": "glob-parent@2.0.0", + "_inBundle": false, + "_integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "_location": "/glob-parent", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "glob-parent@^2.0.0", + "name": "glob-parent", + "escapedName": "glob-parent", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/chokidar", + "/glob-base" + ], + "_resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "_shasum": "81383d72db054fcccf5336daa902f182f6edbb28", + "_spec": "glob-parent@^2.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/chokidar", + "author": { + "name": "Elan Shanker" + }, + "bugs": { + "url": "https://github.com/es128/glob-parent/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-glob": "^2.0.0" + }, + "deprecated": false, + "description": "Strips glob magic from a string to provide the parent path", + "devDependencies": { + "coveralls": "^2.11.2", + "istanbul": "^0.3.5", + "mocha": "^2.1.0" + }, + "homepage": "https://github.com/es128/glob-parent", + "keywords": [ + "glob", + "parent", + "strip", + "path", + "directory", + "base" + ], + "license": "ISC", + "main": "index.js", + "name": "glob-parent", + "repository": { + "type": "git", + "url": "git+https://github.com/es128/glob-parent.git" + }, + "scripts": { + "test": "istanbul cover _mocha && cat ./coverage/lcov.info | coveralls" + }, + "version": "2.0.0" +} diff --git a/node_modules/glob-parent/test.js b/node_modules/glob-parent/test.js new file mode 100644 index 000000000..01156d2ff --- /dev/null +++ b/node_modules/glob-parent/test.js @@ -0,0 +1,28 @@ +'use strict'; + +var gp = require('./'); +var assert = require('assert'); + +describe('glob-parent', function() { + it('should strip glob magic to return parent path', function() { + assert.equal(gp('path/to/*.js'), 'path/to'); + assert.equal(gp('/root/path/to/*.js'), '/root/path/to'); + assert.equal(gp('/*.js'), '/'); + assert.equal(gp('*.js'), '.'); + assert.equal(gp('**/*.js'), '.'); + assert.equal(gp('path/{to,from}'), 'path'); + assert.equal(gp('path/!(to|from)'), 'path'); + assert.equal(gp('path/?(to|from)'), 'path'); + assert.equal(gp('path/+(to|from)'), 'path'); + assert.equal(gp('path/*(to|from)'), 'path'); + assert.equal(gp('path/@(to|from)'), 'path'); + assert.equal(gp('path/**/*'), 'path'); + assert.equal(gp('path/**/subdir/foo.*'), 'path'); + }); + + it('should return parent dirname from non-glob paths', function() { + assert.equal(gp('path/foo/bar.js'), 'path/foo'); + assert.equal(gp('path/foo/'), 'path/foo'); + assert.equal(gp('path/foo'), 'path'); + }); +}); diff --git a/node_modules/glob/LICENSE b/node_modules/glob/LICENSE new file mode 100644 index 000000000..19129e315 --- /dev/null +++ b/node_modules/glob/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/glob/README.md b/node_modules/glob/README.md new file mode 100644 index 000000000..baa1d1ba8 --- /dev/null +++ b/node_modules/glob/README.md @@ -0,0 +1,368 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![](oh-my-glob.gif) + +## Usage + +Install with npm + +``` +npm i glob +``` + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) +* `absolute` Set to true to always receive absolute paths for matched + files. Unlike `realpath`, this also affects the values returned in + the `match` event. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` diff --git a/node_modules/glob/changelog.md b/node_modules/glob/changelog.md new file mode 100644 index 000000000..41636771e --- /dev/null +++ b/node_modules/glob/changelog.md @@ -0,0 +1,67 @@ +## 7.0 + +- Raise error if `options.cwd` is specified, and not a directory + +## 6.0 + +- Remove comment and negation pattern support +- Ignore patterns are always in `dot:true` mode + +## 5.0 + +- Deprecate comment and negation patterns +- Fix regression in `mark` and `nodir` options from making all cache + keys absolute path. +- Abort if `fs.readdir` returns an error that's unexpected +- Don't emit `match` events for ignored items +- Treat ENOTSUP like ENOTDIR in readdir + +## 4.5 + +- Add `options.follow` to always follow directory symlinks in globstar +- Add `options.realpath` to call `fs.realpath` on all results +- Always cache based on absolute path + +## 4.4 + +- Add `options.ignore` +- Fix handling of broken symlinks + +## 4.3 + +- Bump minimatch to 2.x +- Pass all tests on Windows + +## 4.2 + +- Add `glob.hasMagic` function +- Add `options.nodir` flag + +## 4.1 + +- Refactor sync and async implementations for performance +- Throw if callback provided to sync glob function +- Treat symbolic links in globstar results the same as Bash 4.3 + +## 4.0 + +- Use `^` for dependency versions (bumped major because this breaks + older npm versions) +- Ensure callbacks are only ever called once +- switch to ISC license + +## 3.x + +- Rewrite in JavaScript +- Add support for setting root, cwd, and windows support +- Cache many fs calls +- Add globstar support +- emit match events + +## 2.x + +- Use `glob.h` and `fnmatch.h` from NetBSD + +## 1.x + +- `glob.h` static binding. diff --git a/node_modules/glob/common.js b/node_modules/glob/common.js new file mode 100644 index 000000000..66651bb3a --- /dev/null +++ b/node_modules/glob/common.js @@ -0,0 +1,240 @@ +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + self.absolute = !!options.absolute + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = path.resolve(options.cwd) + self.changedCwd = self.cwd !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + // TODO: is an absolute `cwd` supposed to be resolved against `root`? + // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') + self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) + if (process.platform === "win32") + self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(self.nocase ? alphasorti : alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + var notDir = !(/\/$/.test(e)) + var c = self.cache[e] || self.cache[makeAbs(self, e)] + if (notDir && c) + notDir = c !== 'DIR' && !Array.isArray(c) + return notDir + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + + if (process.platform === 'win32') + abs = abs.replace(/\\/g, '/') + + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/node_modules/glob/glob.js b/node_modules/glob/glob.js new file mode 100644 index 000000000..58dec0f6c --- /dev/null +++ b/node_modules/glob/glob.js @@ -0,0 +1,790 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var fs = require('fs') +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + + if (!pattern) + return false + + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + this._processing = 0 + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + var sync = true + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + sync = false + + function done () { + --self._processing + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish() + }) + } else { + self._finish() + } + } + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + rp.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = isAbsolute(e) ? e : this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) + e = abs + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er && er.code === 'ENOENT') + return cb() + + var isSym = lstat && lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + this.emit('error', error) + this.abort() + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) + return cb(null, false, stat) + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return cb() + + return cb(null, c, stat) +} diff --git a/node_modules/glob/package.json b/node_modules/glob/package.json new file mode 100644 index 000000000..01e23ba20 --- /dev/null +++ b/node_modules/glob/package.json @@ -0,0 +1,76 @@ +{ + "_from": "glob@^7.1.0", + "_id": "glob@7.1.3", + "_inBundle": false, + "_integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "_location": "/glob", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "glob@^7.1.0", + "name": "glob", + "escapedName": "glob", + "rawSpec": "^7.1.0", + "saveSpec": null, + "fetchSpec": "^7.1.0" + }, + "_requiredBy": [ + "/browserify" + ], + "_resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "_shasum": "3960832d3f1574108342dafd3a67b332c0969df1", + "_spec": "glob@^7.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "bundleDependencies": false, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "deprecated": false, + "description": "a little globber", + "devDependencies": { + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^12.0.1", + "tick": "0.0.6" + }, + "engines": { + "node": "*" + }, + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "homepage": "https://github.com/isaacs/node-glob#readme", + "license": "ISC", + "main": "glob.js", + "name": "glob", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "scripts": { + "bench": "bash benchmark.sh", + "benchclean": "node benchclean.js", + "prepublish": "npm run benchclean", + "prof": "bash prof.sh && cat profile.txt", + "profclean": "rm -f v8.log profile.txt", + "test": "tap test/*.js --cov", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" + }, + "version": "7.1.3" +} diff --git a/node_modules/glob/sync.js b/node_modules/glob/sync.js new file mode 100644 index 000000000..c952134ba --- /dev/null +++ b/node_modules/glob/sync.js @@ -0,0 +1,486 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var fs = require('fs') +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = rp.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + if (isIgnored(this, e)) + return + + var abs = this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) { + e = abs + } + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + if (er.code === 'ENOENT') { + // lstat failed, doesn't exist + return null + } + } + + var isSym = lstat && lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + throw error + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return false + } + } + + if (lstat && lstat.isSymbolicLink()) { + try { + stat = fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/node_modules/graceful-fs/LICENSE b/node_modules/graceful-fs/LICENSE new file mode 100644 index 000000000..9d2c80369 --- /dev/null +++ b/node_modules/graceful-fs/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter, Ben Noordhuis, and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/graceful-fs/README.md b/node_modules/graceful-fs/README.md new file mode 100644 index 000000000..5273a50ad --- /dev/null +++ b/node_modules/graceful-fs/README.md @@ -0,0 +1,133 @@ +# graceful-fs + +graceful-fs functions as a drop-in replacement for the fs module, +making various improvements. + +The improvements are meant to normalize behavior across different +platforms and environments, and to make filesystem access more +resilient to errors. + +## Improvements over [fs module](https://nodejs.org/api/fs.html) + +* Queues up `open` and `readdir` calls, and retries them once + something closes if there is an EMFILE error from too many file + descriptors. +* fixes `lchmod` for Node versions prior to 0.6.2. +* implements `fs.lutimes` if possible. Otherwise it becomes a noop. +* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or + `lchown` if the user isn't root. +* makes `lchmod` and `lchown` become noops, if not available. +* retries reading a file if `read` results in EAGAIN error. + +On Windows, it retries renaming a file for up to one second if `EACCESS` +or `EPERM` error occurs, likely because antivirus software has locked +the directory. + +## USAGE + +```javascript +// use just like fs +var fs = require('graceful-fs') + +// now go and do stuff with it... +fs.readFileSync('some-file-or-whatever') +``` + +## Global Patching + +If you want to patch the global fs module (or any other fs-like +module) you can do this: + +```javascript +// Make sure to read the caveat below. +var realFs = require('fs') +var gracefulFs = require('graceful-fs') +gracefulFs.gracefulify(realFs) +``` + +This should only ever be done at the top-level application layer, in +order to delay on EMFILE errors from any fs-using dependencies. You +should **not** do this in a library, because it can cause unexpected +delays in other parts of the program. + +## Changes + +This module is fairly stable at this point, and used by a lot of +things. That being said, because it implements a subtle behavior +change in a core part of the node API, even modest changes can be +extremely breaking, and the versioning is thus biased towards +bumping the major when in doubt. + +The main change between major versions has been switching between +providing a fully-patched `fs` module vs monkey-patching the node core +builtin, and the approach by which a non-monkey-patched `fs` was +created. + +The goal is to trade `EMFILE` errors for slower fs operations. So, if +you try to open a zillion files, rather than crashing, `open` +operations will be queued up and wait for something else to `close`. + +There are advantages to each approach. Monkey-patching the fs means +that no `EMFILE` errors can possibly occur anywhere in your +application, because everything is using the same core `fs` module, +which is patched. However, it can also obviously cause undesirable +side-effects, especially if the module is loaded multiple times. + +Implementing a separate-but-identical patched `fs` module is more +surgical (and doesn't run the risk of patching multiple times), but +also imposes the challenge of keeping in sync with the core module. + +The current approach loads the `fs` module, and then creates a +lookalike object that has all the same methods, except a few that are +patched. It is safe to use in all versions of Node from 0.8 through +7.0. + +### v4 + +* Do not monkey-patch the fs module. This module may now be used as a + drop-in dep, and users can opt into monkey-patching the fs builtin + if their app requires it. + +### v3 + +* Monkey-patch fs, because the eval approach no longer works on recent + node. +* fixed possible type-error throw if rename fails on windows +* verify that we *never* get EMFILE errors +* Ignore ENOSYS from chmod/chown +* clarify that graceful-fs must be used as a drop-in + +### v2.1.0 + +* Use eval rather than monkey-patching fs. +* readdir: Always sort the results +* win32: requeue a file if error has an OK status + +### v2.0 + +* A return to monkey patching +* wrap process.cwd + +### v1.1 + +* wrap readFile +* Wrap fs.writeFile. +* readdir protection +* Don't clobber the fs builtin +* Handle fs.read EAGAIN errors by trying again +* Expose the curOpen counter +* No-op lchown/lchmod if not implemented +* fs.rename patch only for win32 +* Patch fs.rename to handle AV software on Windows +* Close #4 Chown should not fail on einval or eperm if non-root +* Fix isaacs/fstream#1 Only wrap fs one time +* Fix #3 Start at 1024 max files, then back off on EMFILE +* lutimes that doens't blow up on Linux +* A full on-rewrite using a queue instead of just swallowing the EMFILE error +* Wrap Read/Write streams as well + +### 1.0 + +* Update engines for node 0.6 +* Be lstat-graceful on Windows +* first diff --git a/node_modules/graceful-fs/fs.js b/node_modules/graceful-fs/fs.js new file mode 100644 index 000000000..8ad4a3839 --- /dev/null +++ b/node_modules/graceful-fs/fs.js @@ -0,0 +1,21 @@ +'use strict' + +var fs = require('fs') + +module.exports = clone(fs) + +function clone (obj) { + if (obj === null || typeof obj !== 'object') + return obj + + if (obj instanceof Object) + var copy = { __proto__: obj.__proto__ } + else + var copy = Object.create(null) + + Object.getOwnPropertyNames(obj).forEach(function (key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) + }) + + return copy +} diff --git a/node_modules/graceful-fs/graceful-fs.js b/node_modules/graceful-fs/graceful-fs.js new file mode 100644 index 000000000..33b30d2e9 --- /dev/null +++ b/node_modules/graceful-fs/graceful-fs.js @@ -0,0 +1,262 @@ +var fs = require('fs') +var polyfills = require('./polyfills.js') +var legacy = require('./legacy-streams.js') +var queue = [] + +var util = require('util') + +function noop () {} + +var debug = noop +if (util.debuglog) + debug = util.debuglog('gfs4') +else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) + debug = function() { + var m = util.format.apply(util, arguments) + m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') + console.error(m) + } + +if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', function() { + debug(queue) + require('assert').equal(queue.length, 0) + }) +} + +module.exports = patch(require('./fs.js')) +if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) { + module.exports = patch(fs) +} + +// Always patch fs.close/closeSync, because we want to +// retry() whenever a close happens *anywhere* in the program. +// This is essential when multiple graceful-fs instances are +// in play at the same time. +module.exports.close = +fs.close = (function (fs$close) { return function (fd, cb) { + return fs$close.call(fs, fd, function (err) { + if (!err) + retry() + + if (typeof cb === 'function') + cb.apply(this, arguments) + }) +}})(fs.close) + +module.exports.closeSync = +fs.closeSync = (function (fs$closeSync) { return function (fd) { + // Note that graceful-fs also retries when fs.closeSync() fails. + // Looks like a bug to me, although it's probably a harmless one. + var rval = fs$closeSync.apply(fs, arguments) + retry() + return rval +}})(fs.closeSync) + +function patch (fs) { + // Everything that references the open() function needs to be in here + polyfills(fs) + fs.gracefulify = patch + fs.FileReadStream = ReadStream; // Legacy name. + fs.FileWriteStream = WriteStream; // Legacy name. + fs.createReadStream = createReadStream + fs.createWriteStream = createWriteStream + var fs$readFile = fs.readFile + fs.readFile = readFile + function readFile (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$readFile(path, options, cb) + + function go$readFile (path, options, cb) { + return fs$readFile(path, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readFile, [path, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$writeFile = fs.writeFile + fs.writeFile = writeFile + function writeFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$writeFile(path, data, options, cb) + + function go$writeFile (path, data, options, cb) { + return fs$writeFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$writeFile, [path, data, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$appendFile = fs.appendFile + if (fs$appendFile) + fs.appendFile = appendFile + function appendFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$appendFile(path, data, options, cb) + + function go$appendFile (path, data, options, cb) { + return fs$appendFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$appendFile, [path, data, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$readdir = fs.readdir + fs.readdir = readdir + function readdir (path, options, cb) { + var args = [path] + if (typeof options !== 'function') { + args.push(options) + } else { + cb = options + } + args.push(go$readdir$cb) + + return go$readdir(args) + + function go$readdir$cb (err, files) { + if (files && files.sort) + files.sort() + + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readdir, [args]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + } + } + + function go$readdir (args) { + return fs$readdir.apply(fs, args) + } + + if (process.version.substr(0, 4) === 'v0.8') { + var legStreams = legacy(fs) + ReadStream = legStreams.ReadStream + WriteStream = legStreams.WriteStream + } + + var fs$ReadStream = fs.ReadStream + ReadStream.prototype = Object.create(fs$ReadStream.prototype) + ReadStream.prototype.open = ReadStream$open + + var fs$WriteStream = fs.WriteStream + WriteStream.prototype = Object.create(fs$WriteStream.prototype) + WriteStream.prototype.open = WriteStream$open + + fs.ReadStream = ReadStream + fs.WriteStream = WriteStream + + function ReadStream (path, options) { + if (this instanceof ReadStream) + return fs$ReadStream.apply(this, arguments), this + else + return ReadStream.apply(Object.create(ReadStream.prototype), arguments) + } + + function ReadStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + if (that.autoClose) + that.destroy() + + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + that.read() + } + }) + } + + function WriteStream (path, options) { + if (this instanceof WriteStream) + return fs$WriteStream.apply(this, arguments), this + else + return WriteStream.apply(Object.create(WriteStream.prototype), arguments) + } + + function WriteStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + that.destroy() + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + } + }) + } + + function createReadStream (path, options) { + return new ReadStream(path, options) + } + + function createWriteStream (path, options) { + return new WriteStream(path, options) + } + + var fs$open = fs.open + fs.open = open + function open (path, flags, mode, cb) { + if (typeof mode === 'function') + cb = mode, mode = null + + return go$open(path, flags, mode, cb) + + function go$open (path, flags, mode, cb) { + return fs$open(path, flags, mode, function (err, fd) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$open, [path, flags, mode, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + return fs +} + +function enqueue (elem) { + debug('ENQUEUE', elem[0].name, elem[1]) + queue.push(elem) +} + +function retry () { + var elem = queue.shift() + if (elem) { + debug('RETRY', elem[0].name, elem[1]) + elem[0].apply(null, elem[1]) + } +} diff --git a/node_modules/graceful-fs/legacy-streams.js b/node_modules/graceful-fs/legacy-streams.js new file mode 100644 index 000000000..d617b50fc --- /dev/null +++ b/node_modules/graceful-fs/legacy-streams.js @@ -0,0 +1,118 @@ +var Stream = require('stream').Stream + +module.exports = legacy + +function legacy (fs) { + return { + ReadStream: ReadStream, + WriteStream: WriteStream + } + + function ReadStream (path, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path, options); + + Stream.call(this); + + var self = this; + + this.path = path; + this.fd = null; + this.readable = true; + this.paused = false; + + this.flags = 'r'; + this.mode = 438; /*=0666*/ + this.bufferSize = 64 * 1024; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.encoding) this.setEncoding(this.encoding); + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.end === undefined) { + this.end = Infinity; + } else if ('number' !== typeof this.end) { + throw TypeError('end must be a Number'); + } + + if (this.start > this.end) { + throw new Error('start must be <= end'); + } + + this.pos = this.start; + } + + if (this.fd !== null) { + process.nextTick(function() { + self._read(); + }); + return; + } + + fs.open(this.path, this.flags, this.mode, function (err, fd) { + if (err) { + self.emit('error', err); + self.readable = false; + return; + } + + self.fd = fd; + self.emit('open', fd); + self._read(); + }) + } + + function WriteStream (path, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path, options); + + Stream.call(this); + + this.path = path; + this.fd = null; + this.writable = true; + + this.flags = 'w'; + this.encoding = 'binary'; + this.mode = 438; /*=0666*/ + this.bytesWritten = 0; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.start < 0) { + throw new Error('start must be >= zero'); + } + + this.pos = this.start; + } + + this.busy = false; + this._queue = []; + + if (this.fd === null) { + this._open = fs.open; + this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); + this.flush(); + } + } +} diff --git a/node_modules/graceful-fs/package.json b/node_modules/graceful-fs/package.json new file mode 100644 index 000000000..c0f51572a --- /dev/null +++ b/node_modules/graceful-fs/package.json @@ -0,0 +1,76 @@ +{ + "_from": "graceful-fs@^4.1.11", + "_id": "graceful-fs@4.1.11", + "_inBundle": false, + "_integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "_location": "/graceful-fs", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "graceful-fs@^4.1.11", + "name": "graceful-fs", + "escapedName": "graceful-fs", + "rawSpec": "^4.1.11", + "saveSpec": null, + "fetchSpec": "^4.1.11" + }, + "_requiredBy": [ + "/readdirp" + ], + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "_shasum": "0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658", + "_spec": "graceful-fs@^4.1.11", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp", + "bugs": { + "url": "https://github.com/isaacs/node-graceful-fs/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A drop-in replacement for fs, making various improvements.", + "devDependencies": { + "mkdirp": "^0.5.0", + "rimraf": "^2.2.8", + "tap": "^5.4.2" + }, + "directories": { + "test": "test" + }, + "engines": { + "node": ">=0.4.0" + }, + "files": [ + "fs.js", + "graceful-fs.js", + "legacy-streams.js", + "polyfills.js" + ], + "homepage": "https://github.com/isaacs/node-graceful-fs#readme", + "keywords": [ + "fs", + "module", + "reading", + "retry", + "retries", + "queue", + "error", + "errors", + "handling", + "EMFILE", + "EAGAIN", + "EINVAL", + "EPERM", + "EACCESS" + ], + "license": "ISC", + "main": "graceful-fs.js", + "name": "graceful-fs", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/node-graceful-fs.git" + }, + "scripts": { + "test": "node test.js | tap -" + }, + "version": "4.1.11" +} diff --git a/node_modules/graceful-fs/polyfills.js b/node_modules/graceful-fs/polyfills.js new file mode 100644 index 000000000..4c6aca78a --- /dev/null +++ b/node_modules/graceful-fs/polyfills.js @@ -0,0 +1,330 @@ +var fs = require('./fs.js') +var constants = require('constants') + +var origCwd = process.cwd +var cwd = null + +var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform + +process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process) + return cwd +} +try { + process.cwd() +} catch (er) {} + +var chdir = process.chdir +process.chdir = function(d) { + cwd = null + chdir.call(process, d) +} + +module.exports = patch + +function patch (fs) { + // (re-)implement some things that are known busted or missing. + + // lchmod, broken prior to 0.6.2 + // back-port the fix here. + if (constants.hasOwnProperty('O_SYMLINK') && + process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs) + } + + // lutimes implementation, or no-op + if (!fs.lutimes) { + patchLutimes(fs) + } + + // https://github.com/isaacs/node-graceful-fs/issues/4 + // Chown should not fail on einval or eperm if non-root. + // It should not fail on enosys ever, as this just indicates + // that a fs doesn't support the intended operation. + + fs.chown = chownFix(fs.chown) + fs.fchown = chownFix(fs.fchown) + fs.lchown = chownFix(fs.lchown) + + fs.chmod = chmodFix(fs.chmod) + fs.fchmod = chmodFix(fs.fchmod) + fs.lchmod = chmodFix(fs.lchmod) + + fs.chownSync = chownFixSync(fs.chownSync) + fs.fchownSync = chownFixSync(fs.fchownSync) + fs.lchownSync = chownFixSync(fs.lchownSync) + + fs.chmodSync = chmodFixSync(fs.chmodSync) + fs.fchmodSync = chmodFixSync(fs.fchmodSync) + fs.lchmodSync = chmodFixSync(fs.lchmodSync) + + fs.stat = statFix(fs.stat) + fs.fstat = statFix(fs.fstat) + fs.lstat = statFix(fs.lstat) + + fs.statSync = statFixSync(fs.statSync) + fs.fstatSync = statFixSync(fs.fstatSync) + fs.lstatSync = statFixSync(fs.lstatSync) + + // if lchmod/lchown do not exist, then make them no-ops + if (!fs.lchmod) { + fs.lchmod = function (path, mode, cb) { + if (cb) process.nextTick(cb) + } + fs.lchmodSync = function () {} + } + if (!fs.lchown) { + fs.lchown = function (path, uid, gid, cb) { + if (cb) process.nextTick(cb) + } + fs.lchownSync = function () {} + } + + // on Windows, A/V software can lock the directory, causing this + // to fail with an EACCES or EPERM if the directory contains newly + // created files. Try again on failure, for up to 60 seconds. + + // Set the timeout this long because some Windows Anti-Virus, such as Parity + // bit9, may lock files for up to a minute, causing npm package install + // failures. Also, take care to yield the scheduler. Windows scheduling gives + // CPU to a busy looping process, which can cause the program causing the lock + // contention to be starved of CPU by node, so the contention doesn't resolve. + if (platform === "win32") { + fs.rename = (function (fs$rename) { return function (from, to, cb) { + var start = Date.now() + var backoff = 0; + fs$rename(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM") + && Date.now() - start < 60000) { + setTimeout(function() { + fs.stat(to, function (stater, st) { + if (stater && stater.code === "ENOENT") + fs$rename(from, to, CB); + else + cb(er) + }) + }, backoff) + if (backoff < 100) + backoff += 10; + return; + } + if (cb) cb(er) + }) + }})(fs.rename) + } + + // if read() returns EAGAIN, then just try it again. + fs.read = (function (fs$read) { return function (fd, buffer, offset, length, position, callback_) { + var callback + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0 + callback = function (er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + callback_.apply(this, arguments) + } + } + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + }})(fs.read) + + fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) { + var eagCounter = 0 + while (true) { + try { + return fs$readSync.call(fs, fd, buffer, offset, length, position) + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + continue + } + throw er + } + } + }})(fs.readSync) +} + +function patchLchmod (fs) { + fs.lchmod = function (path, mode, callback) { + fs.open( path + , constants.O_WRONLY | constants.O_SYMLINK + , mode + , function (err, fd) { + if (err) { + if (callback) callback(err) + return + } + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + fs.fchmod(fd, mode, function (err) { + fs.close(fd, function(err2) { + if (callback) callback(err || err2) + }) + }) + }) + } + + fs.lchmodSync = function (path, mode) { + var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) + + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + var threw = true + var ret + try { + ret = fs.fchmodSync(fd, mode) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } +} + +function patchLutimes (fs) { + if (constants.hasOwnProperty("O_SYMLINK")) { + fs.lutimes = function (path, at, mt, cb) { + fs.open(path, constants.O_SYMLINK, function (er, fd) { + if (er) { + if (cb) cb(er) + return + } + fs.futimes(fd, at, mt, function (er) { + fs.close(fd, function (er2) { + if (cb) cb(er || er2) + }) + }) + }) + } + + fs.lutimesSync = function (path, at, mt) { + var fd = fs.openSync(path, constants.O_SYMLINK) + var ret + var threw = true + try { + ret = fs.futimesSync(fd, at, mt) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + + } else { + fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } + fs.lutimesSync = function () {} + } +} + +function chmodFix (orig) { + if (!orig) return orig + return function (target, mode, cb) { + return orig.call(fs, target, mode, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } +} + +function chmodFixSync (orig) { + if (!orig) return orig + return function (target, mode) { + try { + return orig.call(fs, target, mode) + } catch (er) { + if (!chownErOk(er)) throw er + } + } +} + + +function chownFix (orig) { + if (!orig) return orig + return function (target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } +} + +function chownFixSync (orig) { + if (!orig) return orig + return function (target, uid, gid) { + try { + return orig.call(fs, target, uid, gid) + } catch (er) { + if (!chownErOk(er)) throw er + } + } +} + + +function statFix (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, cb) { + return orig.call(fs, target, function (er, stats) { + if (!stats) return cb.apply(this, arguments) + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + if (cb) cb.apply(this, arguments) + }) + } +} + +function statFixSync (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target) { + var stats = orig.call(fs, target) + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + return stats; + } +} + +// ENOSYS means that the fs doesn't support the op. Just ignore +// that, because it doesn't matter. +// +// if there's no getuid, or if getuid() is something other +// than 0, and the error is EINVAL or EPERM, then just ignore +// it. +// +// This specific case is a silent failure in cp, install, tar, +// and most other unix tools that manage permissions. +// +// When running as root, or if other types of errors are +// encountered, then it's strict. +function chownErOk (er) { + if (!er) + return true + + if (er.code === "ENOSYS") + return true + + var nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true + } + + return false +} diff --git a/node_modules/has-ansi/cli.js b/node_modules/has-ansi/cli.js new file mode 100755 index 000000000..e0956fcc7 --- /dev/null +++ b/node_modules/has-ansi/cli.js @@ -0,0 +1,53 @@ +#!/usr/bin/env node +'use strict'; +var pkg = require('./package.json'); +var hasAnsi = require('./'); +var input = process.argv[2]; + +function stdin(cb) { + var ret = ''; + process.stdin.setEncoding('utf8'); + process.stdin.on('data', function (data) { + ret += data; + }); + process.stdin.on('end', function () { + cb(ret); + }); +} + +function help() { + console.log([ + pkg.description, + '', + 'Usage', + ' $ has-ansi ', + ' $ echo | has-ansi', + '', + 'Exits with code 0 if input has ANSI escape codes and 1 if not' + ].join('\n')); +} + +function init(data) { + process.exit(hasAnsi(data) ? 0 : 1); +} + +if (process.argv.indexOf('--help') !== -1) { + help(); + return; +} + +if (process.argv.indexOf('--version') !== -1) { + console.log(pkg.version); + return; +} + +if (process.stdin.isTTY) { + if (!input) { + help(); + return; + } + + init(input); +} else { + stdin(init); +} diff --git a/node_modules/has-ansi/index.js b/node_modules/has-ansi/index.js new file mode 100644 index 000000000..98fae0676 --- /dev/null +++ b/node_modules/has-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +var ansiRegex = require('ansi-regex'); +var re = new RegExp(ansiRegex().source); // remove the `g` flag +module.exports = re.test.bind(re); diff --git a/node_modules/has-ansi/package.json b/node_modules/has-ansi/package.json new file mode 100644 index 000000000..9c84fb851 --- /dev/null +++ b/node_modules/has-ansi/package.json @@ -0,0 +1,89 @@ +{ + "_from": "has-ansi@^0.1.0", + "_id": "has-ansi@0.1.0", + "_inBundle": false, + "_integrity": "sha1-hPJlqujA5qiKEtcCKJS3VoiUxi4=", + "_location": "/has-ansi", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "has-ansi@^0.1.0", + "name": "has-ansi", + "escapedName": "has-ansi", + "rawSpec": "^0.1.0", + "saveSpec": null, + "fetchSpec": "^0.1.0" + }, + "_requiredBy": [ + "/chalk" + ], + "_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz", + "_shasum": "84f265aae8c0e6a88a12d7022894b7568894c62e", + "_spec": "has-ansi@^0.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/chalk", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "bin": { + "has-ansi": "cli.js" + }, + "bugs": { + "url": "https://github.com/sindresorhus/has-ansi/issues" + }, + "bundleDependencies": false, + "dependencies": { + "ansi-regex": "^0.2.0" + }, + "deprecated": false, + "description": "Check if a string has ANSI escape codes", + "devDependencies": { + "mocha": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "cli.js" + ], + "homepage": "https://github.com/sindresorhus/has-ansi#readme", + "keywords": [ + "cli", + "bin", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern", + "has" + ], + "license": "MIT", + "name": "has-ansi", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/has-ansi.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "0.1.0" +} diff --git a/node_modules/has-ansi/readme.md b/node_modules/has-ansi/readme.md new file mode 100644 index 000000000..070221231 --- /dev/null +++ b/node_modules/has-ansi/readme.md @@ -0,0 +1,45 @@ +# has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi) + +> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +```sh +$ npm install --save has-ansi +``` + + +## Usage + +```js +var hasAnsi = require('has-ansi'); + +hasAnsi('\u001b[4mcake\u001b[0m'); +//=> true + +hasAnsi('cake'); +//=> false +``` + + +## CLI + +```sh +$ npm install --global has-ansi +``` + +``` +$ has-ansi --help + +Usage + $ has-ansi + $ echo | has-ansi + +Exits with code 0 if input has ANSI escape codes and 1 if not +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/has-value/LICENSE b/node_modules/has-value/LICENSE new file mode 100644 index 000000000..d734237bd --- /dev/null +++ b/node_modules/has-value/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/has-value/README.md b/node_modules/has-value/README.md new file mode 100644 index 000000000..f9b428c9a --- /dev/null +++ b/node_modules/has-value/README.md @@ -0,0 +1,149 @@ +# has-value [![NPM version](https://img.shields.io/npm/v/has-value.svg?style=flat)](https://www.npmjs.com/package/has-value) [![NPM monthly downloads](https://img.shields.io/npm/dm/has-value.svg?style=flat)](https://npmjs.org/package/has-value) [![NPM total downloads](https://img.shields.io/npm/dt/has-value.svg?style=flat)](https://npmjs.org/package/has-value) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/has-value.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/has-value) + +> Returns true if a value exists, false if empty. Works with deeply nested values using object paths. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save has-value +``` + +**Works for:** + +* booleans +* functions +* numbers +* strings +* nulls +* object +* arrays + +## Usage + +Works with property values (supports object-path notation, like `foo.bar`) or a single value: + +```js +var hasValue = require('has-value'); + +hasValue('foo'); +hasValue({foo: 'bar'}, 'foo'); +hasValue({a: {b: {c: 'foo'}}}, 'a.b.c'); +//=> true + +hasValue(''); +hasValue({foo: ''}, 'foo'); +//=> false + +hasValue(0); +hasValue(1); +hasValue({foo: 0}, 'foo'); +hasValue({foo: 1}, 'foo'); +hasValue({foo: null}, 'foo'); +hasValue({foo: {bar: 'a'}}}, 'foo'); +hasValue({foo: {bar: 'a'}}}, 'foo.bar'); +//=> true + +hasValue({foo: {}}}, 'foo'); +hasValue({foo: {bar: {}}}}, 'foo.bar'); +hasValue({foo: undefined}, 'foo'); +//=> false + +hasValue([]); +hasValue([[]]); +hasValue([[], []]); +hasValue([undefined]); +hasValue({foo: []}, 'foo'); +//=> false + +hasValue([0]); +hasValue([null]); +hasValue(['foo']); +hasValue({foo: ['a']}, 'foo'); +//=> true + +hasValue(function() {}) +hasValue(function(foo) {}) +hasValue({foo: function(foo) {}}, 'foo'); +hasValue({foo: function() {}}, 'foo'); +//=> true + +hasValue(true); +hasValue(false); +hasValue({foo: true}, 'foo'); +hasValue({foo: false}, 'foo'); +//=> true +``` + +## isEmpty + +To do the opposite and test for empty values, do: + +```js +function isEmpty(o) { + return !hasValue.apply(hasValue, arguments); +} +``` + +## Release history + +### v1.0.0 + +* `zero` always returns true +* `array` now recurses, so that an array of empty arrays will return `false` +* `null` now returns true + +## About + +### Related projects + +* [define-property](https://www.npmjs.com/package/define-property): Define a non-enumerable property on an object. | [homepage](https://github.com/jonschlinkert/define-property "Define a non-enumerable property on an object.") +* [get-value](https://www.npmjs.com/package/get-value): Use property paths (`a.b.c`) to get a nested value from an object. | [homepage](https://github.com/jonschlinkert/get-value "Use property paths (`a.b.c`) to get a nested value from an object.") +* [set-value](https://www.npmjs.com/package/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/jonschlinkert/set-value "Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths.") +* [unset-value](https://www.npmjs.com/package/unset-value): Delete nested properties from an object using dot notation. | [homepage](https://github.com/jonschlinkert/unset-value "Delete nested properties from an object using dot notation.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 17 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [rmharrison](https://github.com/rmharrison) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 19, 2017._ \ No newline at end of file diff --git a/node_modules/has-value/index.js b/node_modules/has-value/index.js new file mode 100644 index 000000000..c23749488 --- /dev/null +++ b/node_modules/has-value/index.js @@ -0,0 +1,16 @@ +/*! + * has-value + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var isObject = require('isobject'); +var hasValues = require('has-values'); +var get = require('get-value'); + +module.exports = function(val, prop) { + return hasValues(isObject(val) && prop ? get(val, prop) : val); +}; diff --git a/node_modules/has-value/node_modules/isobject/LICENSE b/node_modules/has-value/node_modules/isobject/LICENSE new file mode 100644 index 000000000..943e71d05 --- /dev/null +++ b/node_modules/has-value/node_modules/isobject/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +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. \ No newline at end of file diff --git a/node_modules/has-value/node_modules/isobject/README.md b/node_modules/has-value/node_modules/isobject/README.md new file mode 100644 index 000000000..d01feaa40 --- /dev/null +++ b/node_modules/has-value/node_modules/isobject/README.md @@ -0,0 +1,122 @@ +# isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM monthly downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![NPM total downloads](https://img.shields.io/npm/dt/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/isobject) + +> Returns true if the value is an object and not an array or null. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save isobject +``` + +Install with [yarn](https://yarnpkg.com): + +```sh +$ yarn add isobject +``` + +Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install isobject +``` +Install with [bower](https://bower.io/) + +```sh +$ bower install isobject +``` + +## Usage + +```js +var isObject = require('isobject'); +``` + +**True** + +All of the following return `true`: + +```js +isObject({}); +isObject(Object.create({})); +isObject(Object.create(Object.prototype)); +isObject(Object.create(null)); +isObject({}); +isObject(new Foo); +isObject(/foo/); +``` + +**False** + +All of the following return `false`: + +```js +isObject(); +isObject(function () {}); +isObject(1); +isObject([]); +isObject(undefined); +isObject(null); +``` + +## About + +### Related projects + +* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") +* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 29 | [jonschlinkert](https://github.com/jonschlinkert) | +| 4 | [doowb](https://github.com/doowb) | +| 1 | [magnudae](https://github.com/magnudae) | +| 1 | [LeSuisse](https://github.com/LeSuisse) | +| 1 | [tmcw](https://github.com/tmcw) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 30, 2017._ \ No newline at end of file diff --git a/node_modules/has-value/node_modules/isobject/index.d.ts b/node_modules/has-value/node_modules/isobject/index.d.ts new file mode 100644 index 000000000..55f81c275 --- /dev/null +++ b/node_modules/has-value/node_modules/isobject/index.d.ts @@ -0,0 +1,5 @@ +export = isObject; + +declare function isObject(val: any): boolean; + +declare namespace isObject {} diff --git a/node_modules/has-value/node_modules/isobject/index.js b/node_modules/has-value/node_modules/isobject/index.js new file mode 100644 index 000000000..2d59958bf --- /dev/null +++ b/node_modules/has-value/node_modules/isobject/index.js @@ -0,0 +1,12 @@ +/*! + * isobject + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +module.exports = function isObject(val) { + return val != null && typeof val === 'object' && Array.isArray(val) === false; +}; diff --git a/node_modules/has-value/node_modules/isobject/package.json b/node_modules/has-value/node_modules/isobject/package.json new file mode 100644 index 000000000..97db41b40 --- /dev/null +++ b/node_modules/has-value/node_modules/isobject/package.json @@ -0,0 +1,119 @@ +{ + "_from": "isobject@^3.0.0", + "_id": "isobject@3.0.1", + "_inBundle": false, + "_integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "_location": "/has-value/isobject", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "isobject@^3.0.0", + "name": "isobject", + "escapedName": "isobject", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/has-value" + ], + "_resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "_shasum": "4e431e92b11a9731636aa1f9c8d1ccbcfdab78df", + "_spec": "isobject@^3.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/has-value", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/isobject/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "url": "https://github.com/LeSuisse" + }, + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Magnús Dæhlen", + "url": "https://github.com/magnudae" + }, + { + "name": "Tom MacWright", + "url": "https://macwright.org" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Returns true if the value is an object and not an array or null.", + "devDependencies": { + "gulp-format-md": "^0.1.9", + "mocha": "^2.4.5" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.d.ts", + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/isobject", + "keywords": [ + "check", + "is", + "is-object", + "isobject", + "kind", + "kind-of", + "kindof", + "native", + "object", + "type", + "typeof", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "isobject", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/isobject.git" + }, + "scripts": { + "test": "mocha" + }, + "types": "index.d.ts", + "verb": { + "related": { + "list": [ + "extend-shallow", + "is-plain-object", + "kind-of", + "merge-deep" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb" + ] + }, + "version": "3.0.1" +} diff --git a/node_modules/has-value/package.json b/node_modules/has-value/package.json new file mode 100644 index 000000000..88b815fc8 --- /dev/null +++ b/node_modules/has-value/package.json @@ -0,0 +1,120 @@ +{ + "_from": "has-value@^1.0.0", + "_id": "has-value@1.0.0", + "_inBundle": false, + "_integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "_location": "/has-value", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "has-value@^1.0.0", + "name": "has-value", + "escapedName": "has-value", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/cache-base" + ], + "_resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "_shasum": "18b281da585b1c5c51def24c930ed29a0be6b177", + "_spec": "has-value@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/cache-base", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/has-value/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Ryan M Harrison", + "url": "https://linkedin.com/in/harrisonrm" + } + ], + "dependencies": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + }, + "deprecated": false, + "description": "Returns true if a value exists, false if empty. Works with deeply nested values using object paths.", + "devDependencies": { + "gulp-format-md": "^0.1.12", + "mocha": "^3.4.1" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/has-value", + "keywords": [ + "array", + "boolean", + "empty", + "find", + "function", + "has", + "hasOwn", + "javascript", + "js", + "key", + "keys", + "node.js", + "null", + "number", + "object", + "properties", + "property", + "string", + "type", + "util", + "utilities", + "utility", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "has-value", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/has-value.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "define-property", + "get-value", + "set-value", + "unset-value" + ] + }, + "reflinks": [], + "lint": { + "reflinks": true + } + }, + "version": "1.0.0" +} diff --git a/node_modules/has-values/LICENSE b/node_modules/has-values/LICENSE new file mode 100644 index 000000000..d734237bd --- /dev/null +++ b/node_modules/has-values/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/has-values/README.md b/node_modules/has-values/README.md new file mode 100644 index 000000000..98d4367af --- /dev/null +++ b/node_modules/has-values/README.md @@ -0,0 +1,129 @@ +# has-values [![NPM version](https://img.shields.io/npm/v/has-values.svg?style=flat)](https://www.npmjs.com/package/has-values) [![NPM monthly downloads](https://img.shields.io/npm/dm/has-values.svg?style=flat)](https://npmjs.org/package/has-values) [![NPM total downloads](https://img.shields.io/npm/dt/has-values.svg?style=flat)](https://npmjs.org/package/has-values) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/has-values.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/has-values) + +> Returns true if any values exist, false if empty. Works for booleans, functions, numbers, strings, nulls, objects and arrays. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save has-values +``` + +## Usage + +```js +var hasValue = require('has-values'); + +hasValue('a'); +//=> true + +hasValue(''); +//=> false + +hasValue(1); +//=> true + +hasValue(0); +//=> false + +hasValue({a: 'a'}}); +//=> true + +hasValue({}); +hasValue({foo: undefined}); +//=> false + +hasValue({foo: null}); +//=> true + +hasValue(['a']); +//=> true + +hasValue([]); +hasValue([[], []]); +hasValue([[[]]]); +//=> false + +hasValue(['foo']); +hasValue([0]); +//=> true + +hasValue(function(foo) {}); +//=> true + +hasValue(function() {}); +//=> true + +hasValue(true); +//=> true + +hasValue(false); +//=> true +``` + +## isEmpty + +To test for empty values, do: + +```js +function isEmpty(o, isZero) { + return !hasValue(o, isZero); +} +``` + +## Release history + +### v1.0.0 + +* `zero` always returns true +* `array` now recurses, so that an array of empty arrays will return `false` +* `null` now returns true + +## About + +### Related projects + +* [has-value](https://www.npmjs.com/package/has-value): Returns true if a value exists, false if empty. Works with deeply nested values using… [more](https://github.com/jonschlinkert/has-value) | [homepage](https://github.com/jonschlinkert/has-value "Returns true if a value exists, false if empty. Works with deeply nested values using object paths.") +* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 19, 2017._ \ No newline at end of file diff --git a/node_modules/has-values/index.js b/node_modules/has-values/index.js new file mode 100644 index 000000000..9bebb9fcb --- /dev/null +++ b/node_modules/has-values/index.js @@ -0,0 +1,60 @@ +/*! + * has-values + * + * Copyright (c) 2014-2015, 2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var typeOf = require('kind-of'); +var isNumber = require('is-number'); + +module.exports = function hasValue(val) { + // is-number checks for NaN and other edge cases + if (isNumber(val)) { + return true; + } + + switch (typeOf(val)) { + case 'null': + case 'boolean': + case 'function': + return true; + case 'string': + case 'arguments': + return val.length !== 0; + case 'error': + return val.message !== ''; + case 'array': + var len = val.length; + if (len === 0) { + return false; + } + for (var i = 0; i < len; i++) { + if (hasValue(val[i])) { + return true; + } + } + return false; + case 'file': + case 'map': + case 'set': + return val.size !== 0; + case 'object': + var keys = Object.keys(val); + if (keys.length === 0) { + return false; + } + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (hasValue(val[key])) { + return true; + } + } + return false; + default: { + return false; + } + } +}; diff --git a/node_modules/has-values/node_modules/is-number/LICENSE b/node_modules/has-values/node_modules/is-number/LICENSE new file mode 100644 index 000000000..842218cf0 --- /dev/null +++ b/node_modules/has-values/node_modules/is-number/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/has-values/node_modules/is-number/README.md b/node_modules/has-values/node_modules/is-number/README.md new file mode 100644 index 000000000..281165dce --- /dev/null +++ b/node_modules/has-values/node_modules/is-number/README.md @@ -0,0 +1,115 @@ +# is-number [![NPM version](https://img.shields.io/npm/v/is-number.svg?style=flat)](https://www.npmjs.com/package/is-number) [![NPM downloads](https://img.shields.io/npm/dm/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-number.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-number) + +> Returns true if the value is a number. comprehensive tests. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-number +``` + +## Usage + +To understand some of the rationale behind the decisions made in this library (and to learn about some oddities of number evaluation in JavaScript), [see this gist](https://gist.github.com/jonschlinkert/e30c70c713da325d0e81). + +```js +var isNumber = require('is-number'); +``` + +### true + +See the [tests](./test.js) for more examples. + +```js +isNumber(5e3) //=> 'true' +isNumber(0xff) //=> 'true' +isNumber(-1.1) //=> 'true' +isNumber(0) //=> 'true' +isNumber(1) //=> 'true' +isNumber(1.1) //=> 'true' +isNumber(10) //=> 'true' +isNumber(10.10) //=> 'true' +isNumber(100) //=> 'true' +isNumber('-1.1') //=> 'true' +isNumber('0') //=> 'true' +isNumber('012') //=> 'true' +isNumber('0xff') //=> 'true' +isNumber('1') //=> 'true' +isNumber('1.1') //=> 'true' +isNumber('10') //=> 'true' +isNumber('10.10') //=> 'true' +isNumber('100') //=> 'true' +isNumber('5e3') //=> 'true' +isNumber(parseInt('012')) //=> 'true' +isNumber(parseFloat('012')) //=> 'true' +``` + +### False + +See the [tests](./test.js) for more examples. + +```js +isNumber('foo') //=> 'false' +isNumber([1]) //=> 'false' +isNumber([]) //=> 'false' +isNumber(function () {}) //=> 'false' +isNumber(Infinity) //=> 'false' +isNumber(NaN) //=> 'false' +isNumber(new Array('abc')) //=> 'false' +isNumber(new Array(2)) //=> 'false' +isNumber(new Buffer('abc')) //=> 'false' +isNumber(null) //=> 'false' +isNumber(undefined) //=> 'false' +isNumber({abc: 'abc'}) //=> 'false' +``` + +## About + +### Related projects + +* [even](https://www.npmjs.com/package/even): Get the even numbered items from an array. | [homepage](https://github.com/jonschlinkert/even "Get the even numbered items from an array.") +* [is-even](https://www.npmjs.com/package/is-even): Return true if the given number is even. | [homepage](https://github.com/jonschlinkert/is-even "Return true if the given number is even.") +* [is-odd](https://www.npmjs.com/package/is-odd): Returns true if the given number is odd. | [homepage](https://github.com/jonschlinkert/is-odd "Returns true if the given number is odd.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") +* [odd](https://www.npmjs.com/package/odd): Get the odd numbered items from an array. | [homepage](https://github.com/jonschlinkert/odd "Get the odd numbered items from an array.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/is-number/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.30, on September 10, 2016._ \ No newline at end of file diff --git a/node_modules/has-values/node_modules/is-number/index.js b/node_modules/has-values/node_modules/is-number/index.js new file mode 100644 index 000000000..7a2a45bed --- /dev/null +++ b/node_modules/has-values/node_modules/is-number/index.js @@ -0,0 +1,22 @@ +/*! + * is-number + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var typeOf = require('kind-of'); + +module.exports = function isNumber(num) { + var type = typeOf(num); + + if (type === 'string') { + if (!num.trim()) return false; + } else if (type !== 'number') { + return false; + } + + return (num - num + 1) >= 0; +}; diff --git a/node_modules/has-values/node_modules/is-number/node_modules/kind-of/LICENSE b/node_modules/has-values/node_modules/is-number/node_modules/kind-of/LICENSE new file mode 100644 index 000000000..d734237bd --- /dev/null +++ b/node_modules/has-values/node_modules/is-number/node_modules/kind-of/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/has-values/node_modules/is-number/node_modules/kind-of/README.md b/node_modules/has-values/node_modules/is-number/node_modules/kind-of/README.md new file mode 100644 index 000000000..6a9df36d3 --- /dev/null +++ b/node_modules/has-values/node_modules/is-number/node_modules/kind-of/README.md @@ -0,0 +1,261 @@ +# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) + +> Get the native type of a value. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save kind-of +``` + +## Install + +Install with [bower](https://bower.io/) + +```sh +$ bower install kind-of --save +``` + +## Usage + +> es5, browser and es6 ready + +```js +var kindOf = require('kind-of'); + +kindOf(undefined); +//=> 'undefined' + +kindOf(null); +//=> 'null' + +kindOf(true); +//=> 'boolean' + +kindOf(false); +//=> 'boolean' + +kindOf(new Boolean(true)); +//=> 'boolean' + +kindOf(new Buffer('')); +//=> 'buffer' + +kindOf(42); +//=> 'number' + +kindOf(new Number(42)); +//=> 'number' + +kindOf('str'); +//=> 'string' + +kindOf(new String('str')); +//=> 'string' + +kindOf(arguments); +//=> 'arguments' + +kindOf({}); +//=> 'object' + +kindOf(Object.create(null)); +//=> 'object' + +kindOf(new Test()); +//=> 'object' + +kindOf(new Date()); +//=> 'date' + +kindOf([]); +//=> 'array' + +kindOf([1, 2, 3]); +//=> 'array' + +kindOf(new Array()); +//=> 'array' + +kindOf(/foo/); +//=> 'regexp' + +kindOf(new RegExp('foo')); +//=> 'regexp' + +kindOf(function () {}); +//=> 'function' + +kindOf(function * () {}); +//=> 'function' + +kindOf(new Function()); +//=> 'function' + +kindOf(new Map()); +//=> 'map' + +kindOf(new WeakMap()); +//=> 'weakmap' + +kindOf(new Set()); +//=> 'set' + +kindOf(new WeakSet()); +//=> 'weakset' + +kindOf(Symbol('str')); +//=> 'symbol' + +kindOf(new Int8Array()); +//=> 'int8array' + +kindOf(new Uint8Array()); +//=> 'uint8array' + +kindOf(new Uint8ClampedArray()); +//=> 'uint8clampedarray' + +kindOf(new Int16Array()); +//=> 'int16array' + +kindOf(new Uint16Array()); +//=> 'uint16array' + +kindOf(new Int32Array()); +//=> 'int32array' + +kindOf(new Uint32Array()); +//=> 'uint32array' + +kindOf(new Float32Array()); +//=> 'float32array' + +kindOf(new Float64Array()); +//=> 'float64array' +``` + +## Benchmarks + +Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). +Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `WeakSet`. + +```bash +#1: array + current x 23,329,397 ops/sec ±0.82% (94 runs sampled) + lib-type-of x 4,170,273 ops/sec ±0.55% (94 runs sampled) + lib-typeof x 9,686,935 ops/sec ±0.59% (98 runs sampled) + +#2: boolean + current x 27,197,115 ops/sec ±0.85% (94 runs sampled) + lib-type-of x 3,145,791 ops/sec ±0.73% (97 runs sampled) + lib-typeof x 9,199,562 ops/sec ±0.44% (99 runs sampled) + +#3: date + current x 20,190,117 ops/sec ±0.86% (92 runs sampled) + lib-type-of x 5,166,970 ops/sec ±0.74% (94 runs sampled) + lib-typeof x 9,610,821 ops/sec ±0.50% (96 runs sampled) + +#4: function + current x 23,855,460 ops/sec ±0.60% (97 runs sampled) + lib-type-of x 5,667,740 ops/sec ±0.54% (100 runs sampled) + lib-typeof x 10,010,644 ops/sec ±0.44% (100 runs sampled) + +#5: null + current x 27,061,047 ops/sec ±0.97% (96 runs sampled) + lib-type-of x 13,965,573 ops/sec ±0.62% (97 runs sampled) + lib-typeof x 8,460,194 ops/sec ±0.61% (97 runs sampled) + +#6: number + current x 25,075,682 ops/sec ±0.53% (99 runs sampled) + lib-type-of x 2,266,405 ops/sec ±0.41% (98 runs sampled) + lib-typeof x 9,821,481 ops/sec ±0.45% (99 runs sampled) + +#7: object + current x 3,348,980 ops/sec ±0.49% (99 runs sampled) + lib-type-of x 3,245,138 ops/sec ±0.60% (94 runs sampled) + lib-typeof x 9,262,952 ops/sec ±0.59% (99 runs sampled) + +#8: regex + current x 21,284,827 ops/sec ±0.72% (96 runs sampled) + lib-type-of x 4,689,241 ops/sec ±0.43% (100 runs sampled) + lib-typeof x 8,957,593 ops/sec ±0.62% (98 runs sampled) + +#9: string + current x 25,379,234 ops/sec ±0.58% (96 runs sampled) + lib-type-of x 3,635,148 ops/sec ±0.76% (93 runs sampled) + lib-typeof x 9,494,134 ops/sec ±0.49% (98 runs sampled) + +#10: undef + current x 27,459,221 ops/sec ±1.01% (93 runs sampled) + lib-type-of x 14,360,433 ops/sec ±0.52% (99 runs sampled) + lib-typeof x 23,202,868 ops/sec ±0.59% (94 runs sampled) + +``` + +## Optimizations + +In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: + +1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. +2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. +3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` + +## About + +### Related projects + +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 59 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [miguelmota](https://github.com/miguelmota) | +| 1 | [dtothefp](https://github.com/dtothefp) | +| 1 | [ksheedlo](https://github.com/ksheedlo) | +| 1 | [pdehaan](https://github.com/pdehaan) | +| 1 | [laggingreflex](https://github.com/laggingreflex) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 16, 2017._ \ No newline at end of file diff --git a/node_modules/has-values/node_modules/is-number/node_modules/kind-of/index.js b/node_modules/has-values/node_modules/is-number/node_modules/kind-of/index.js new file mode 100644 index 000000000..b52c2917f --- /dev/null +++ b/node_modules/has-values/node_modules/is-number/node_modules/kind-of/index.js @@ -0,0 +1,116 @@ +var isBuffer = require('is-buffer'); +var toString = Object.prototype.toString; + +/** + * Get the native `typeof` a value. + * + * @param {*} `val` + * @return {*} Native javascript type + */ + +module.exports = function kindOf(val) { + // primitivies + if (typeof val === 'undefined') { + return 'undefined'; + } + if (val === null) { + return 'null'; + } + if (val === true || val === false || val instanceof Boolean) { + return 'boolean'; + } + if (typeof val === 'string' || val instanceof String) { + return 'string'; + } + if (typeof val === 'number' || val instanceof Number) { + return 'number'; + } + + // functions + if (typeof val === 'function' || val instanceof Function) { + return 'function'; + } + + // array + if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { + return 'array'; + } + + // check for instances of RegExp and Date before calling `toString` + if (val instanceof RegExp) { + return 'regexp'; + } + if (val instanceof Date) { + return 'date'; + } + + // other objects + var type = toString.call(val); + + if (type === '[object RegExp]') { + return 'regexp'; + } + if (type === '[object Date]') { + return 'date'; + } + if (type === '[object Arguments]') { + return 'arguments'; + } + if (type === '[object Error]') { + return 'error'; + } + + // buffer + if (isBuffer(val)) { + return 'buffer'; + } + + // es6: Map, WeakMap, Set, WeakSet + if (type === '[object Set]') { + return 'set'; + } + if (type === '[object WeakSet]') { + return 'weakset'; + } + if (type === '[object Map]') { + return 'map'; + } + if (type === '[object WeakMap]') { + return 'weakmap'; + } + if (type === '[object Symbol]') { + return 'symbol'; + } + + // typed arrays + if (type === '[object Int8Array]') { + return 'int8array'; + } + if (type === '[object Uint8Array]') { + return 'uint8array'; + } + if (type === '[object Uint8ClampedArray]') { + return 'uint8clampedarray'; + } + if (type === '[object Int16Array]') { + return 'int16array'; + } + if (type === '[object Uint16Array]') { + return 'uint16array'; + } + if (type === '[object Int32Array]') { + return 'int32array'; + } + if (type === '[object Uint32Array]') { + return 'uint32array'; + } + if (type === '[object Float32Array]') { + return 'float32array'; + } + if (type === '[object Float64Array]') { + return 'float64array'; + } + + // must be a plain object + return 'object'; +}; diff --git a/node_modules/has-values/node_modules/is-number/node_modules/kind-of/package.json b/node_modules/has-values/node_modules/is-number/node_modules/kind-of/package.json new file mode 100644 index 000000000..d6a392d69 --- /dev/null +++ b/node_modules/has-values/node_modules/is-number/node_modules/kind-of/package.json @@ -0,0 +1,139 @@ +{ + "_from": "kind-of@^3.0.2", + "_id": "kind-of@3.2.2", + "_inBundle": false, + "_integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "_location": "/has-values/is-number/kind-of", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "kind-of@^3.0.2", + "name": "kind-of", + "escapedName": "kind-of", + "rawSpec": "^3.0.2", + "saveSpec": null, + "fetchSpec": "^3.0.2" + }, + "_requiredBy": [ + "/has-values/is-number" + ], + "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "_shasum": "31ea21a734bab9bbb0f32466d893aea51e4a3c64", + "_spec": "kind-of@^3.0.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/has-values/node_modules/is-number", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/kind-of/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "David Fox-Powell", + "url": "https://dtothefp.github.io/me" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Ken Sheedlo", + "url": "kensheedlo.com" + }, + { + "name": "laggingreflex", + "url": "https://github.com/laggingreflex" + }, + { + "name": "Miguel Mota", + "url": "https://miguelmota.com" + }, + { + "name": "Peter deHaan", + "url": "http://about.me/peterdehaan" + } + ], + "dependencies": { + "is-buffer": "^1.1.5" + }, + "deprecated": false, + "description": "Get the native type of a value.", + "devDependencies": { + "ansi-bold": "^0.1.1", + "benchmarked": "^1.0.0", + "browserify": "^14.3.0", + "glob": "^7.1.1", + "gulp-format-md": "^0.1.12", + "mocha": "^3.3.0", + "type-of": "^2.0.1", + "typeof": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/kind-of", + "keywords": [ + "arguments", + "array", + "boolean", + "check", + "date", + "function", + "is", + "is-type", + "is-type-of", + "kind", + "kind-of", + "number", + "object", + "of", + "regexp", + "string", + "test", + "type", + "type-of", + "typeof", + "types" + ], + "license": "MIT", + "main": "index.js", + "name": "kind-of", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/kind-of.git" + }, + "scripts": { + "prepublish": "browserify -o browser.js -e index.js -s index --bare", + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "is-glob", + "is-number", + "is-primitive" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb" + ] + }, + "version": "3.2.2" +} diff --git a/node_modules/has-values/node_modules/is-number/package.json b/node_modules/has-values/node_modules/is-number/package.json new file mode 100644 index 000000000..903acef4b --- /dev/null +++ b/node_modules/has-values/node_modules/is-number/package.json @@ -0,0 +1,123 @@ +{ + "_from": "is-number@^3.0.0", + "_id": "is-number@3.0.0", + "_inBundle": false, + "_integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "_location": "/has-values/is-number", + "_phantomChildren": { + "is-buffer": "1.1.6" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-number@^3.0.0", + "name": "is-number", + "escapedName": "is-number", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/has-values" + ], + "_resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "_shasum": "24fd6201a4782cf50561c810276afc7d12d71195", + "_spec": "is-number@^3.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/has-values", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-number/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Charlike Mike Reagent", + "url": "http://www.tunnckocore.tk" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + } + ], + "dependencies": { + "kind-of": "^3.0.2" + }, + "deprecated": false, + "description": "Returns true if the value is a number. comprehensive tests.", + "devDependencies": { + "benchmarked": "^0.2.5", + "chalk": "^1.1.3", + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-number", + "keywords": [ + "check", + "coerce", + "coercion", + "integer", + "is", + "is-nan", + "is-num", + "is-number", + "istype", + "kind", + "math", + "nan", + "num", + "number", + "numeric", + "test", + "type", + "typeof", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "is-number", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-number.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "even", + "is-even", + "is-odd", + "is-primitive", + "kind-of", + "odd" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ] + }, + "version": "3.0.0" +} diff --git a/node_modules/has-values/node_modules/kind-of/LICENSE b/node_modules/has-values/node_modules/kind-of/LICENSE new file mode 100644 index 000000000..d734237bd --- /dev/null +++ b/node_modules/has-values/node_modules/kind-of/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/has-values/node_modules/kind-of/README.md b/node_modules/has-values/node_modules/kind-of/README.md new file mode 100644 index 000000000..83469b0b6 --- /dev/null +++ b/node_modules/has-values/node_modules/kind-of/README.md @@ -0,0 +1,267 @@ +# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) + +> Get the native type of a value. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save kind-of +``` + +Install with [bower](https://bower.io/) + +```sh +$ bower install kind-of --save +``` + +## Usage + +> es5, browser and es6 ready + +```js +var kindOf = require('kind-of'); + +kindOf(undefined); +//=> 'undefined' + +kindOf(null); +//=> 'null' + +kindOf(true); +//=> 'boolean' + +kindOf(false); +//=> 'boolean' + +kindOf(new Boolean(true)); +//=> 'boolean' + +kindOf(new Buffer('')); +//=> 'buffer' + +kindOf(42); +//=> 'number' + +kindOf(new Number(42)); +//=> 'number' + +kindOf('str'); +//=> 'string' + +kindOf(new String('str')); +//=> 'string' + +kindOf(arguments); +//=> 'arguments' + +kindOf({}); +//=> 'object' + +kindOf(Object.create(null)); +//=> 'object' + +kindOf(new Test()); +//=> 'object' + +kindOf(new Date()); +//=> 'date' + +kindOf([]); +//=> 'array' + +kindOf([1, 2, 3]); +//=> 'array' + +kindOf(new Array()); +//=> 'array' + +kindOf(/foo/); +//=> 'regexp' + +kindOf(new RegExp('foo')); +//=> 'regexp' + +kindOf(function () {}); +//=> 'function' + +kindOf(function * () {}); +//=> 'function' + +kindOf(new Function()); +//=> 'function' + +kindOf(new Map()); +//=> 'map' + +kindOf(new WeakMap()); +//=> 'weakmap' + +kindOf(new Set()); +//=> 'set' + +kindOf(new WeakSet()); +//=> 'weakset' + +kindOf(Symbol('str')); +//=> 'symbol' + +kindOf(new Int8Array()); +//=> 'int8array' + +kindOf(new Uint8Array()); +//=> 'uint8array' + +kindOf(new Uint8ClampedArray()); +//=> 'uint8clampedarray' + +kindOf(new Int16Array()); +//=> 'int16array' + +kindOf(new Uint16Array()); +//=> 'uint16array' + +kindOf(new Int32Array()); +//=> 'int32array' + +kindOf(new Uint32Array()); +//=> 'uint32array' + +kindOf(new Float32Array()); +//=> 'float32array' + +kindOf(new Float64Array()); +//=> 'float64array' +``` + +## Benchmarks + +Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). +Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `WeakSet`. + +```bash +#1: array + current x 23,329,397 ops/sec ±0.82% (94 runs sampled) + lib-type-of x 4,170,273 ops/sec ±0.55% (94 runs sampled) + lib-typeof x 9,686,935 ops/sec ±0.59% (98 runs sampled) + +#2: boolean + current x 27,197,115 ops/sec ±0.85% (94 runs sampled) + lib-type-of x 3,145,791 ops/sec ±0.73% (97 runs sampled) + lib-typeof x 9,199,562 ops/sec ±0.44% (99 runs sampled) + +#3: date + current x 20,190,117 ops/sec ±0.86% (92 runs sampled) + lib-type-of x 5,166,970 ops/sec ±0.74% (94 runs sampled) + lib-typeof x 9,610,821 ops/sec ±0.50% (96 runs sampled) + +#4: function + current x 23,855,460 ops/sec ±0.60% (97 runs sampled) + lib-type-of x 5,667,740 ops/sec ±0.54% (100 runs sampled) + lib-typeof x 10,010,644 ops/sec ±0.44% (100 runs sampled) + +#5: null + current x 27,061,047 ops/sec ±0.97% (96 runs sampled) + lib-type-of x 13,965,573 ops/sec ±0.62% (97 runs sampled) + lib-typeof x 8,460,194 ops/sec ±0.61% (97 runs sampled) + +#6: number + current x 25,075,682 ops/sec ±0.53% (99 runs sampled) + lib-type-of x 2,266,405 ops/sec ±0.41% (98 runs sampled) + lib-typeof x 9,821,481 ops/sec ±0.45% (99 runs sampled) + +#7: object + current x 3,348,980 ops/sec ±0.49% (99 runs sampled) + lib-type-of x 3,245,138 ops/sec ±0.60% (94 runs sampled) + lib-typeof x 9,262,952 ops/sec ±0.59% (99 runs sampled) + +#8: regex + current x 21,284,827 ops/sec ±0.72% (96 runs sampled) + lib-type-of x 4,689,241 ops/sec ±0.43% (100 runs sampled) + lib-typeof x 8,957,593 ops/sec ±0.62% (98 runs sampled) + +#9: string + current x 25,379,234 ops/sec ±0.58% (96 runs sampled) + lib-type-of x 3,635,148 ops/sec ±0.76% (93 runs sampled) + lib-typeof x 9,494,134 ops/sec ±0.49% (98 runs sampled) + +#10: undef + current x 27,459,221 ops/sec ±1.01% (93 runs sampled) + lib-type-of x 14,360,433 ops/sec ±0.52% (99 runs sampled) + lib-typeof x 23,202,868 ops/sec ±0.59% (94 runs sampled) + +``` + +## Release history + +### v4.0.0 + +**Added** + +* `promise` support + +## Optimizations + +In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: + +1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. +2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. +3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` + +## About + +### Related projects + +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 64 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [miguelmota](https://github.com/miguelmota) | +| 1 | [dtothefp](https://github.com/dtothefp) | +| 1 | [ksheedlo](https://github.com/ksheedlo) | +| 1 | [pdehaan](https://github.com/pdehaan) | +| 1 | [laggingreflex](https://github.com/laggingreflex) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 19, 2017._ \ No newline at end of file diff --git a/node_modules/has-values/node_modules/kind-of/index.js b/node_modules/has-values/node_modules/kind-of/index.js new file mode 100644 index 000000000..4c0233bc7 --- /dev/null +++ b/node_modules/has-values/node_modules/kind-of/index.js @@ -0,0 +1,119 @@ +var isBuffer = require('is-buffer'); +var toString = Object.prototype.toString; + +/** + * Get the native `typeof` a value. + * + * @param {*} `val` + * @return {*} Native javascript type + */ + +module.exports = function kindOf(val) { + // primitivies + if (typeof val === 'undefined') { + return 'undefined'; + } + if (val === null) { + return 'null'; + } + if (val === true || val === false || val instanceof Boolean) { + return 'boolean'; + } + if (typeof val === 'string' || val instanceof String) { + return 'string'; + } + if (typeof val === 'number' || val instanceof Number) { + return 'number'; + } + + // functions + if (typeof val === 'function' || val instanceof Function) { + return 'function'; + } + + // array + if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { + return 'array'; + } + + // check for instances of RegExp and Date before calling `toString` + if (val instanceof RegExp) { + return 'regexp'; + } + if (val instanceof Date) { + return 'date'; + } + + // other objects + var type = toString.call(val); + + if (type === '[object RegExp]') { + return 'regexp'; + } + if (type === '[object Date]') { + return 'date'; + } + if (type === '[object Arguments]') { + return 'arguments'; + } + if (type === '[object Error]') { + return 'error'; + } + if (type === '[object Promise]') { + return 'promise'; + } + + // buffer + if (isBuffer(val)) { + return 'buffer'; + } + + // es6: Map, WeakMap, Set, WeakSet + if (type === '[object Set]') { + return 'set'; + } + if (type === '[object WeakSet]') { + return 'weakset'; + } + if (type === '[object Map]') { + return 'map'; + } + if (type === '[object WeakMap]') { + return 'weakmap'; + } + if (type === '[object Symbol]') { + return 'symbol'; + } + + // typed arrays + if (type === '[object Int8Array]') { + return 'int8array'; + } + if (type === '[object Uint8Array]') { + return 'uint8array'; + } + if (type === '[object Uint8ClampedArray]') { + return 'uint8clampedarray'; + } + if (type === '[object Int16Array]') { + return 'int16array'; + } + if (type === '[object Uint16Array]') { + return 'uint16array'; + } + if (type === '[object Int32Array]') { + return 'int32array'; + } + if (type === '[object Uint32Array]') { + return 'uint32array'; + } + if (type === '[object Float32Array]') { + return 'float32array'; + } + if (type === '[object Float64Array]') { + return 'float64array'; + } + + // must be a plain object + return 'object'; +}; diff --git a/node_modules/has-values/node_modules/kind-of/package.json b/node_modules/has-values/node_modules/kind-of/package.json new file mode 100644 index 000000000..5393dd8bd --- /dev/null +++ b/node_modules/has-values/node_modules/kind-of/package.json @@ -0,0 +1,139 @@ +{ + "_from": "kind-of@^4.0.0", + "_id": "kind-of@4.0.0", + "_inBundle": false, + "_integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "_location": "/has-values/kind-of", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "kind-of@^4.0.0", + "name": "kind-of", + "escapedName": "kind-of", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/has-values" + ], + "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "_shasum": "20813df3d712928b207378691a45066fae72dd57", + "_spec": "kind-of@^4.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/has-values", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/kind-of/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "David Fox-Powell", + "url": "https://dtothefp.github.io/me" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Ken Sheedlo", + "url": "kensheedlo.com" + }, + { + "name": "laggingreflex", + "url": "https://github.com/laggingreflex" + }, + { + "name": "Miguel Mota", + "url": "https://miguelmota.com" + }, + { + "name": "Peter deHaan", + "url": "http://about.me/peterdehaan" + } + ], + "dependencies": { + "is-buffer": "^1.1.5" + }, + "deprecated": false, + "description": "Get the native type of a value.", + "devDependencies": { + "ansi-bold": "^0.1.1", + "benchmarked": "^1.1.1", + "browserify": "^14.3.0", + "glob": "^7.1.1", + "gulp-format-md": "^0.1.12", + "mocha": "^3.4.1", + "type-of": "^2.0.1", + "typeof": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/kind-of", + "keywords": [ + "arguments", + "array", + "boolean", + "check", + "date", + "function", + "is", + "is-type", + "is-type-of", + "kind", + "kind-of", + "number", + "object", + "of", + "regexp", + "string", + "test", + "type", + "type-of", + "typeof", + "types" + ], + "license": "MIT", + "main": "index.js", + "name": "kind-of", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/kind-of.git" + }, + "scripts": { + "prepublish": "browserify -o browser.js -e index.js -s index --bare", + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "is-glob", + "is-number", + "is-primitive" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb" + ] + }, + "version": "4.0.0" +} diff --git a/node_modules/has-values/package.json b/node_modules/has-values/package.json new file mode 100644 index 000000000..18bc7a107 --- /dev/null +++ b/node_modules/has-values/package.json @@ -0,0 +1,115 @@ +{ + "_from": "has-values@^1.0.0", + "_id": "has-values@1.0.0", + "_inBundle": false, + "_integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "_location": "/has-values", + "_phantomChildren": { + "is-buffer": "1.1.6" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "has-values@^1.0.0", + "name": "has-values", + "escapedName": "has-values", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/has-value" + ], + "_resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "_shasum": "95b0b63fec2146619a6fe57fe75628d5a39efe4f", + "_spec": "has-values@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/has-value", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/has-values/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "deprecated": false, + "description": "Returns true if any values exist, false if empty. Works for booleans, functions, numbers, strings, nulls, objects and arrays. ", + "devDependencies": { + "gulp-format-md": "^0.1.12", + "mocha": "^3.4.1" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/has-values", + "keywords": [ + "array", + "boolean", + "empty", + "find", + "function", + "has", + "hasOwn", + "javascript", + "js", + "key", + "keys", + "node.js", + "null", + "number", + "object", + "properties", + "property", + "string", + "type", + "util", + "utilities", + "utility", + "value", + "values" + ], + "license": "MIT", + "main": "index.js", + "name": "has-values", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/has-values.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "has-value", + "kind-of", + "is-number", + "is-plain-object", + "isobject" + ] + }, + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.0" +} diff --git a/node_modules/has/LICENSE-MIT b/node_modules/has/LICENSE-MIT new file mode 100644 index 000000000..ae7014d38 --- /dev/null +++ b/node_modules/has/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) 2013 Thiago de Arruda + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/has/README.md b/node_modules/has/README.md new file mode 100644 index 000000000..635e3a4ba --- /dev/null +++ b/node_modules/has/README.md @@ -0,0 +1,18 @@ +# has + +> Object.prototype.hasOwnProperty.call shortcut + +## Installation + +```sh +npm install --save has +``` + +## Usage + +```js +var has = require('has'); + +has({}, 'hasOwnProperty'); // false +has(Object.prototype, 'hasOwnProperty'); // true +``` diff --git a/node_modules/has/package.json b/node_modules/has/package.json new file mode 100644 index 000000000..b9a370cd8 --- /dev/null +++ b/node_modules/has/package.json @@ -0,0 +1,73 @@ +{ + "_from": "has@^1.0.0", + "_id": "has@1.0.3", + "_inBundle": false, + "_integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "_location": "/has", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "has@^1.0.0", + "name": "has", + "escapedName": "has", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/browserify" + ], + "_resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "_shasum": "722d7cbfc1f6aa8241f16dd814e011e1f41e8796", + "_spec": "has@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "Thiago de Arruda", + "email": "tpadilha84@gmail.com" + }, + "bugs": { + "url": "https://github.com/tarruda/has/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "dependencies": { + "function-bind": "^1.1.1" + }, + "deprecated": false, + "description": "Object.prototype.hasOwnProperty.call shortcut", + "devDependencies": { + "@ljharb/eslint-config": "^12.2.1", + "eslint": "^4.19.1", + "tape": "^4.9.0" + }, + "engines": { + "node": ">= 0.4.0" + }, + "homepage": "https://github.com/tarruda/has", + "license": "MIT", + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/tarruda/has/blob/master/LICENSE-MIT" + } + ], + "main": "./src", + "name": "has", + "repository": { + "type": "git", + "url": "git://github.com/tarruda/has.git" + }, + "scripts": { + "lint": "eslint .", + "pretest": "npm run lint", + "test": "tape test" + }, + "version": "1.0.3" +} diff --git a/node_modules/has/src/index.js b/node_modules/has/src/index.js new file mode 100644 index 000000000..dd92dd909 --- /dev/null +++ b/node_modules/has/src/index.js @@ -0,0 +1,5 @@ +'use strict'; + +var bind = require('function-bind'); + +module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); diff --git a/node_modules/has/test/index.js b/node_modules/has/test/index.js new file mode 100644 index 000000000..43d480b2c --- /dev/null +++ b/node_modules/has/test/index.js @@ -0,0 +1,10 @@ +'use strict'; + +var test = require('tape'); +var has = require('../'); + +test('has', function (t) { + t.equal(has({}, 'hasOwnProperty'), false, 'object literal does not have own property "hasOwnProperty"'); + t.equal(has(Object.prototype, 'hasOwnProperty'), true, 'Object.prototype has own property "hasOwnProperty"'); + t.end(); +}); diff --git a/node_modules/hash-base/LICENSE b/node_modules/hash-base/LICENSE new file mode 100644 index 000000000..6f02ae800 --- /dev/null +++ b/node_modules/hash-base/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Kirill Fomichev + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/hash-base/README.md b/node_modules/hash-base/README.md new file mode 100644 index 000000000..83ae2edcc --- /dev/null +++ b/node_modules/hash-base/README.md @@ -0,0 +1,48 @@ +# hash-base + +[![NPM Package](https://img.shields.io/npm/v/hash-base.svg?style=flat-square)](https://www.npmjs.org/package/hash-base) +[![Build Status](https://img.shields.io/travis/crypto-browserify/hash-base.svg?branch=master&style=flat-square)](https://travis-ci.org/crypto-browserify/hash-base) +[![Dependency status](https://img.shields.io/david/crypto-browserify/hash-base.svg?style=flat-square)](https://david-dm.org/crypto-browserify/hash-base#info=dependencies) + +[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) + +Abstract base class to inherit from if you want to create streams implementing the same API as node crypto [Hash][1] (for [Cipher][2] / [Decipher][3] check [crypto-browserify/cipher-base][4]). + +## Example + +```js +const HashBase = require('hash-base') +const inherits = require('inherits') + +// our hash function is XOR sum of all bytes +function MyHash () { + HashBase.call(this, 1) // in bytes + + this._sum = 0x00 +} + +inherits(MyHash, HashBase) + +MyHash.prototype._update = function () { + for (let i = 0; i < this._block.length; ++i) this._sum ^= this._block[i] +} + +MyHash.prototype._digest = function () { + return this._sum +} + +const data = Buffer.from([ 0x00, 0x42, 0x01 ]) +const hash = new MyHash().update(data).digest() +console.log(hash) // => 67 +``` +You also can check [source code](index.js) or [crypto-browserify/md5.js][5] + +## LICENSE + +MIT + +[1]: https://nodejs.org/api/crypto.html#crypto_class_hash +[2]: https://nodejs.org/api/crypto.html#crypto_class_cipher +[3]: https://nodejs.org/api/crypto.html#crypto_class_decipher +[4]: https://github.com/crypto-browserify/cipher-base +[5]: https://github.com/crypto-browserify/md5.js diff --git a/node_modules/hash-base/index.js b/node_modules/hash-base/index.js new file mode 100644 index 000000000..bf788daa4 --- /dev/null +++ b/node_modules/hash-base/index.js @@ -0,0 +1,95 @@ +'use strict' +var Buffer = require('safe-buffer').Buffer +var Transform = require('stream').Transform +var inherits = require('inherits') + +function throwIfNotStringOrBuffer (val, prefix) { + if (!Buffer.isBuffer(val) && typeof val !== 'string') { + throw new TypeError(prefix + ' must be a string or a buffer') + } +} + +function HashBase (blockSize) { + Transform.call(this) + + this._block = Buffer.allocUnsafe(blockSize) + this._blockSize = blockSize + this._blockOffset = 0 + this._length = [0, 0, 0, 0] + + this._finalized = false +} + +inherits(HashBase, Transform) + +HashBase.prototype._transform = function (chunk, encoding, callback) { + var error = null + try { + this.update(chunk, encoding) + } catch (err) { + error = err + } + + callback(error) +} + +HashBase.prototype._flush = function (callback) { + var error = null + try { + this.push(this.digest()) + } catch (err) { + error = err + } + + callback(error) +} + +HashBase.prototype.update = function (data, encoding) { + throwIfNotStringOrBuffer(data, 'Data') + if (this._finalized) throw new Error('Digest already called') + if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding) + + // consume data + var block = this._block + var offset = 0 + while (this._blockOffset + data.length - offset >= this._blockSize) { + for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++] + this._update() + this._blockOffset = 0 + } + while (offset < data.length) block[this._blockOffset++] = data[offset++] + + // update length + for (var j = 0, carry = data.length * 8; carry > 0; ++j) { + this._length[j] += carry + carry = (this._length[j] / 0x0100000000) | 0 + if (carry > 0) this._length[j] -= 0x0100000000 * carry + } + + return this +} + +HashBase.prototype._update = function () { + throw new Error('_update is not implemented') +} + +HashBase.prototype.digest = function (encoding) { + if (this._finalized) throw new Error('Digest already called') + this._finalized = true + + var digest = this._digest() + if (encoding !== undefined) digest = digest.toString(encoding) + + // reset state + this._block.fill(0) + this._blockOffset = 0 + for (var i = 0; i < 4; ++i) this._length[i] = 0 + + return digest +} + +HashBase.prototype._digest = function () { + throw new Error('_digest is not implemented') +} + +module.exports = HashBase diff --git a/node_modules/hash-base/package.json b/node_modules/hash-base/package.json new file mode 100644 index 000000000..7db3851ea --- /dev/null +++ b/node_modules/hash-base/package.json @@ -0,0 +1,71 @@ +{ + "_from": "hash-base@^3.0.0", + "_id": "hash-base@3.0.4", + "_inBundle": false, + "_integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "_location": "/hash-base", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "hash-base@^3.0.0", + "name": "hash-base", + "escapedName": "hash-base", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/md5.js", + "/ripemd160" + ], + "_resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "_shasum": "5fc8686847ecd73499403319a6b0a3f3f6ae4918", + "_spec": "hash-base@^3.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/md5.js", + "author": { + "name": "Kirill Fomichev", + "email": "fanatid@ya.ru", + "url": "https://github.com/fanatid" + }, + "bugs": { + "url": "https://github.com/crypto-browserify/hash-base/issues" + }, + "bundleDependencies": false, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "deprecated": false, + "description": "abstract base class for hash-streams", + "devDependencies": { + "nyc": "^8.3.2", + "standard": "*", + "tape": "^4.2.0" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/crypto-browserify/hash-base", + "keywords": [ + "hash", + "stream" + ], + "license": "MIT", + "main": "index.js", + "name": "hash-base", + "repository": { + "type": "git", + "url": "git+https://github.com/crypto-browserify/hash-base.git" + }, + "scripts": { + "coverage": "nyc node test/*.js", + "lint": "standard", + "test": "npm run lint && npm run unit", + "unit": "node test/*.js" + }, + "version": "3.0.4" +} diff --git a/node_modules/hash.js/.eslintrc.js b/node_modules/hash.js/.eslintrc.js new file mode 100644 index 000000000..614f8fc40 --- /dev/null +++ b/node_modules/hash.js/.eslintrc.js @@ -0,0 +1,41 @@ +module.exports = { + 'env': { + 'browser': true, + 'commonjs': true, + 'node': true, + 'es6': true + }, + 'parserOptions': { + 'ecmaVersion': 8 + }, + 'extends': 'eslint:recommended', + 'rules': { + 'indent': [ + 'error', + 2, + { + 'FunctionDeclaration': { + 'parameters': 'first' + }, + 'FunctionExpression': { + 'parameters': 'first' + }, + 'CallExpression': { + 'arguments': 'first' + } + } + ], + 'linebreak-style': [ + 'error', + 'unix' + ], + 'quotes': [ + 'error', + 'single' + ], + 'semi': [ + 'error', + 'always' + ] + } +}; diff --git a/node_modules/hash.js/.travis.yml b/node_modules/hash.js/.travis.yml new file mode 100644 index 000000000..92b8cdd42 --- /dev/null +++ b/node_modules/hash.js/.travis.yml @@ -0,0 +1,9 @@ +sudo: false +language: node_js +node_js: + - "4" + - "6" + - "stable" +branches: + only: + - master diff --git a/node_modules/hash.js/README.md b/node_modules/hash.js/README.md new file mode 100644 index 000000000..006d3bbf5 --- /dev/null +++ b/node_modules/hash.js/README.md @@ -0,0 +1,48 @@ +# hash.js [![Build Status](https://secure.travis-ci.org/indutny/hash.js.svg)](http://travis-ci.org/indutny/hash.js) + +Just a bike-shed. + +## Install + +```sh +npm install hash.js +``` + +## Usage + +```js +var hash = require('hash.js') +hash.sha256().update('abc').digest('hex') +``` + +## Selective hash usage + +```js +var sha512 = require('hash.js/lib/hash/sha/512'); +sha512().update('abc').digest('hex'); +``` + +#### LICENSE + +This software is licensed under the MIT License. + +Copyright Fedor Indutny, 2014. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/hash.js/lib/hash.d.ts b/node_modules/hash.js/lib/hash.d.ts new file mode 100644 index 000000000..abbb5c531 --- /dev/null +++ b/node_modules/hash.js/lib/hash.d.ts @@ -0,0 +1,106 @@ +declare var hash: Hash; + +declare module "hash.js" { + export = hash; +} + +interface BlockHash { + hmacStrength: number + padLength: number + endian: 'big' | 'little' +} + +interface MessageDigest { + blockSize: number + outSize: number + update(msg: any, enc?: 'hex'): T + digest(): number[] + digest(enc: 'hex'): string +} + +interface Hash { + hmac: HmacConstructor + ripemd: RipemdSet + ripemd160: Ripemd160Constructor + sha: ShaSet + sha1: Sha1Constructor + sha224: Sha224Constructor + sha256: Sha256Constructor + sha384: Sha384Constructor + sha512: Sha512Constructor + utils: Utils +} + +interface Utils { + toArray(msg: any, enc: 'hex'): Array + toHex(msg: any): string +} + +interface RipemdSet { + ripemd160: Ripemd160Constructor +} + +interface ShaSet { + sha1: Sha1Constructor + sha224: Sha224Constructor + sha256: Sha256Constructor + sha384: Sha384Constructor + sha512: Sha512Constructor +} + +interface HmacConstructor { (hash: BlockHash, key: any, enc?: 'hex'): Hmac } +interface Ripemd160Constructor { (): Ripemd160 } +interface Sha1Constructor { (): Sha1; } +interface Sha224Constructor { (): Sha224; } +interface Sha256Constructor { (): Sha256; } +interface Sha384Constructor { (): Sha384; } +interface Sha512Constructor { (): Sha512; } + +interface Hmac extends MessageDigest { + blockSize: 512 + outSize: 160 +} + +interface Ripemd160 extends BlockHash, MessageDigest { + blockSize: 512 + hmacStrength: 192 + outSize: 160 + padLength: 64 + endian: 'little' +} + +interface Sha1 extends BlockHash, MessageDigest { + blockSize: 512 + hmacStrength: 80 + outSize: 160 + padLength: 64 + endian: 'big' +} +interface Sha224 extends BlockHash, MessageDigest { + blockSize: 512 + hmacStrength: 192 + outSize: 224 + padLength: 64 + endian: 'big' +} +interface Sha256 extends BlockHash, MessageDigest { + blockSize: 512 + hmacStrength: 192 + outSize: 256 + padLength: 64 + endian: 'big' +} +interface Sha384 extends BlockHash, MessageDigest { + blockSize: 1024 + hmacStrength: 192 + outSize: 384 + padLength: 128 + endian: 'big' +} +interface Sha512 extends BlockHash, MessageDigest { + blockSize: 1024 + hmacStrength: 192 + outSize: 512 + padLength: 128 + endian: 'big' +} diff --git a/node_modules/hash.js/lib/hash.js b/node_modules/hash.js/lib/hash.js new file mode 100644 index 000000000..f59b67301 --- /dev/null +++ b/node_modules/hash.js/lib/hash.js @@ -0,0 +1,15 @@ +var hash = exports; + +hash.utils = require('./hash/utils'); +hash.common = require('./hash/common'); +hash.sha = require('./hash/sha'); +hash.ripemd = require('./hash/ripemd'); +hash.hmac = require('./hash/hmac'); + +// Proxy hash functions to the main object +hash.sha1 = hash.sha.sha1; +hash.sha256 = hash.sha.sha256; +hash.sha224 = hash.sha.sha224; +hash.sha384 = hash.sha.sha384; +hash.sha512 = hash.sha.sha512; +hash.ripemd160 = hash.ripemd.ripemd160; diff --git a/node_modules/hash.js/lib/hash/common.js b/node_modules/hash.js/lib/hash/common.js new file mode 100644 index 000000000..c49f47631 --- /dev/null +++ b/node_modules/hash.js/lib/hash/common.js @@ -0,0 +1,92 @@ +'use strict'; + +var utils = require('./utils'); +var assert = require('minimalistic-assert'); + +function BlockHash() { + this.pending = null; + this.pendingTotal = 0; + this.blockSize = this.constructor.blockSize; + this.outSize = this.constructor.outSize; + this.hmacStrength = this.constructor.hmacStrength; + this.padLength = this.constructor.padLength / 8; + this.endian = 'big'; + + this._delta8 = this.blockSize / 8; + this._delta32 = this.blockSize / 32; +} +exports.BlockHash = BlockHash; + +BlockHash.prototype.update = function update(msg, enc) { + // Convert message to array, pad it, and join into 32bit blocks + msg = utils.toArray(msg, enc); + if (!this.pending) + this.pending = msg; + else + this.pending = this.pending.concat(msg); + this.pendingTotal += msg.length; + + // Enough data, try updating + if (this.pending.length >= this._delta8) { + msg = this.pending; + + // Process pending data in blocks + var r = msg.length % this._delta8; + this.pending = msg.slice(msg.length - r, msg.length); + if (this.pending.length === 0) + this.pending = null; + + msg = utils.join32(msg, 0, msg.length - r, this.endian); + for (var i = 0; i < msg.length; i += this._delta32) + this._update(msg, i, i + this._delta32); + } + + return this; +}; + +BlockHash.prototype.digest = function digest(enc) { + this.update(this._pad()); + assert(this.pending === null); + + return this._digest(enc); +}; + +BlockHash.prototype._pad = function pad() { + var len = this.pendingTotal; + var bytes = this._delta8; + var k = bytes - ((len + this.padLength) % bytes); + var res = new Array(k + this.padLength); + res[0] = 0x80; + for (var i = 1; i < k; i++) + res[i] = 0; + + // Append length + len <<= 3; + if (this.endian === 'big') { + for (var t = 8; t < this.padLength; t++) + res[i++] = 0; + + res[i++] = 0; + res[i++] = 0; + res[i++] = 0; + res[i++] = 0; + res[i++] = (len >>> 24) & 0xff; + res[i++] = (len >>> 16) & 0xff; + res[i++] = (len >>> 8) & 0xff; + res[i++] = len & 0xff; + } else { + res[i++] = len & 0xff; + res[i++] = (len >>> 8) & 0xff; + res[i++] = (len >>> 16) & 0xff; + res[i++] = (len >>> 24) & 0xff; + res[i++] = 0; + res[i++] = 0; + res[i++] = 0; + res[i++] = 0; + + for (t = 8; t < this.padLength; t++) + res[i++] = 0; + } + + return res; +}; diff --git a/node_modules/hash.js/lib/hash/hmac.js b/node_modules/hash.js/lib/hash/hmac.js new file mode 100644 index 000000000..faff12d3b --- /dev/null +++ b/node_modules/hash.js/lib/hash/hmac.js @@ -0,0 +1,47 @@ +'use strict'; + +var utils = require('./utils'); +var assert = require('minimalistic-assert'); + +function Hmac(hash, key, enc) { + if (!(this instanceof Hmac)) + return new Hmac(hash, key, enc); + this.Hash = hash; + this.blockSize = hash.blockSize / 8; + this.outSize = hash.outSize / 8; + this.inner = null; + this.outer = null; + + this._init(utils.toArray(key, enc)); +} +module.exports = Hmac; + +Hmac.prototype._init = function init(key) { + // Shorten key, if needed + if (key.length > this.blockSize) + key = new this.Hash().update(key).digest(); + assert(key.length <= this.blockSize); + + // Add padding to key + for (var i = key.length; i < this.blockSize; i++) + key.push(0); + + for (i = 0; i < key.length; i++) + key[i] ^= 0x36; + this.inner = new this.Hash().update(key); + + // 0x36 ^ 0x5c = 0x6a + for (i = 0; i < key.length; i++) + key[i] ^= 0x6a; + this.outer = new this.Hash().update(key); +}; + +Hmac.prototype.update = function update(msg, enc) { + this.inner.update(msg, enc); + return this; +}; + +Hmac.prototype.digest = function digest(enc) { + this.outer.update(this.inner.digest()); + return this.outer.digest(enc); +}; diff --git a/node_modules/hash.js/lib/hash/ripemd.js b/node_modules/hash.js/lib/hash/ripemd.js new file mode 100644 index 000000000..2dcdff273 --- /dev/null +++ b/node_modules/hash.js/lib/hash/ripemd.js @@ -0,0 +1,146 @@ +'use strict'; + +var utils = require('./utils'); +var common = require('./common'); + +var rotl32 = utils.rotl32; +var sum32 = utils.sum32; +var sum32_3 = utils.sum32_3; +var sum32_4 = utils.sum32_4; +var BlockHash = common.BlockHash; + +function RIPEMD160() { + if (!(this instanceof RIPEMD160)) + return new RIPEMD160(); + + BlockHash.call(this); + + this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ]; + this.endian = 'little'; +} +utils.inherits(RIPEMD160, BlockHash); +exports.ripemd160 = RIPEMD160; + +RIPEMD160.blockSize = 512; +RIPEMD160.outSize = 160; +RIPEMD160.hmacStrength = 192; +RIPEMD160.padLength = 64; + +RIPEMD160.prototype._update = function update(msg, start) { + var A = this.h[0]; + var B = this.h[1]; + var C = this.h[2]; + var D = this.h[3]; + var E = this.h[4]; + var Ah = A; + var Bh = B; + var Ch = C; + var Dh = D; + var Eh = E; + for (var j = 0; j < 80; j++) { + var T = sum32( + rotl32( + sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)), + s[j]), + E); + A = E; + E = D; + D = rotl32(C, 10); + C = B; + B = T; + T = sum32( + rotl32( + sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)), + sh[j]), + Eh); + Ah = Eh; + Eh = Dh; + Dh = rotl32(Ch, 10); + Ch = Bh; + Bh = T; + } + T = sum32_3(this.h[1], C, Dh); + this.h[1] = sum32_3(this.h[2], D, Eh); + this.h[2] = sum32_3(this.h[3], E, Ah); + this.h[3] = sum32_3(this.h[4], A, Bh); + this.h[4] = sum32_3(this.h[0], B, Ch); + this.h[0] = T; +}; + +RIPEMD160.prototype._digest = function digest(enc) { + if (enc === 'hex') + return utils.toHex32(this.h, 'little'); + else + return utils.split32(this.h, 'little'); +}; + +function f(j, x, y, z) { + if (j <= 15) + return x ^ y ^ z; + else if (j <= 31) + return (x & y) | ((~x) & z); + else if (j <= 47) + return (x | (~y)) ^ z; + else if (j <= 63) + return (x & z) | (y & (~z)); + else + return x ^ (y | (~z)); +} + +function K(j) { + if (j <= 15) + return 0x00000000; + else if (j <= 31) + return 0x5a827999; + else if (j <= 47) + return 0x6ed9eba1; + else if (j <= 63) + return 0x8f1bbcdc; + else + return 0xa953fd4e; +} + +function Kh(j) { + if (j <= 15) + return 0x50a28be6; + else if (j <= 31) + return 0x5c4dd124; + else if (j <= 47) + return 0x6d703ef3; + else if (j <= 63) + return 0x7a6d76e9; + else + return 0x00000000; +} + +var r = [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, + 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, + 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, + 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13 +]; + +var rh = [ + 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, + 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, + 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, + 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, + 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11 +]; + +var s = [ + 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, + 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, + 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, + 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, + 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 +]; + +var sh = [ + 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, + 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, + 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, + 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, + 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 +]; diff --git a/node_modules/hash.js/lib/hash/sha.js b/node_modules/hash.js/lib/hash/sha.js new file mode 100644 index 000000000..f34a38d7b --- /dev/null +++ b/node_modules/hash.js/lib/hash/sha.js @@ -0,0 +1,7 @@ +'use strict'; + +exports.sha1 = require('./sha/1'); +exports.sha224 = require('./sha/224'); +exports.sha256 = require('./sha/256'); +exports.sha384 = require('./sha/384'); +exports.sha512 = require('./sha/512'); diff --git a/node_modules/hash.js/lib/hash/sha/1.js b/node_modules/hash.js/lib/hash/sha/1.js new file mode 100644 index 000000000..fcdfa2946 --- /dev/null +++ b/node_modules/hash.js/lib/hash/sha/1.js @@ -0,0 +1,74 @@ +'use strict'; + +var utils = require('../utils'); +var common = require('../common'); +var shaCommon = require('./common'); + +var rotl32 = utils.rotl32; +var sum32 = utils.sum32; +var sum32_5 = utils.sum32_5; +var ft_1 = shaCommon.ft_1; +var BlockHash = common.BlockHash; + +var sha1_K = [ + 0x5A827999, 0x6ED9EBA1, + 0x8F1BBCDC, 0xCA62C1D6 +]; + +function SHA1() { + if (!(this instanceof SHA1)) + return new SHA1(); + + BlockHash.call(this); + this.h = [ + 0x67452301, 0xefcdab89, 0x98badcfe, + 0x10325476, 0xc3d2e1f0 ]; + this.W = new Array(80); +} + +utils.inherits(SHA1, BlockHash); +module.exports = SHA1; + +SHA1.blockSize = 512; +SHA1.outSize = 160; +SHA1.hmacStrength = 80; +SHA1.padLength = 64; + +SHA1.prototype._update = function _update(msg, start) { + var W = this.W; + + for (var i = 0; i < 16; i++) + W[i] = msg[start + i]; + + for(; i < W.length; i++) + W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1); + + var a = this.h[0]; + var b = this.h[1]; + var c = this.h[2]; + var d = this.h[3]; + var e = this.h[4]; + + for (i = 0; i < W.length; i++) { + var s = ~~(i / 20); + var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]); + e = d; + d = c; + c = rotl32(b, 30); + b = a; + a = t; + } + + this.h[0] = sum32(this.h[0], a); + this.h[1] = sum32(this.h[1], b); + this.h[2] = sum32(this.h[2], c); + this.h[3] = sum32(this.h[3], d); + this.h[4] = sum32(this.h[4], e); +}; + +SHA1.prototype._digest = function digest(enc) { + if (enc === 'hex') + return utils.toHex32(this.h, 'big'); + else + return utils.split32(this.h, 'big'); +}; diff --git a/node_modules/hash.js/lib/hash/sha/224.js b/node_modules/hash.js/lib/hash/sha/224.js new file mode 100644 index 000000000..c69882db5 --- /dev/null +++ b/node_modules/hash.js/lib/hash/sha/224.js @@ -0,0 +1,30 @@ +'use strict'; + +var utils = require('../utils'); +var SHA256 = require('./256'); + +function SHA224() { + if (!(this instanceof SHA224)) + return new SHA224(); + + SHA256.call(this); + this.h = [ + 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, + 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ]; +} +utils.inherits(SHA224, SHA256); +module.exports = SHA224; + +SHA224.blockSize = 512; +SHA224.outSize = 224; +SHA224.hmacStrength = 192; +SHA224.padLength = 64; + +SHA224.prototype._digest = function digest(enc) { + // Just truncate output + if (enc === 'hex') + return utils.toHex32(this.h.slice(0, 7), 'big'); + else + return utils.split32(this.h.slice(0, 7), 'big'); +}; + diff --git a/node_modules/hash.js/lib/hash/sha/256.js b/node_modules/hash.js/lib/hash/sha/256.js new file mode 100644 index 000000000..6dbd6a0c4 --- /dev/null +++ b/node_modules/hash.js/lib/hash/sha/256.js @@ -0,0 +1,105 @@ +'use strict'; + +var utils = require('../utils'); +var common = require('../common'); +var shaCommon = require('./common'); +var assert = require('minimalistic-assert'); + +var sum32 = utils.sum32; +var sum32_4 = utils.sum32_4; +var sum32_5 = utils.sum32_5; +var ch32 = shaCommon.ch32; +var maj32 = shaCommon.maj32; +var s0_256 = shaCommon.s0_256; +var s1_256 = shaCommon.s1_256; +var g0_256 = shaCommon.g0_256; +var g1_256 = shaCommon.g1_256; + +var BlockHash = common.BlockHash; + +var sha256_K = [ + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, + 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, + 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, + 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, + 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, + 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 +]; + +function SHA256() { + if (!(this instanceof SHA256)) + return new SHA256(); + + BlockHash.call(this); + this.h = [ + 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, + 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 + ]; + this.k = sha256_K; + this.W = new Array(64); +} +utils.inherits(SHA256, BlockHash); +module.exports = SHA256; + +SHA256.blockSize = 512; +SHA256.outSize = 256; +SHA256.hmacStrength = 192; +SHA256.padLength = 64; + +SHA256.prototype._update = function _update(msg, start) { + var W = this.W; + + for (var i = 0; i < 16; i++) + W[i] = msg[start + i]; + for (; i < W.length; i++) + W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]); + + var a = this.h[0]; + var b = this.h[1]; + var c = this.h[2]; + var d = this.h[3]; + var e = this.h[4]; + var f = this.h[5]; + var g = this.h[6]; + var h = this.h[7]; + + assert(this.k.length === W.length); + for (i = 0; i < W.length; i++) { + var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]); + var T2 = sum32(s0_256(a), maj32(a, b, c)); + h = g; + g = f; + f = e; + e = sum32(d, T1); + d = c; + c = b; + b = a; + a = sum32(T1, T2); + } + + this.h[0] = sum32(this.h[0], a); + this.h[1] = sum32(this.h[1], b); + this.h[2] = sum32(this.h[2], c); + this.h[3] = sum32(this.h[3], d); + this.h[4] = sum32(this.h[4], e); + this.h[5] = sum32(this.h[5], f); + this.h[6] = sum32(this.h[6], g); + this.h[7] = sum32(this.h[7], h); +}; + +SHA256.prototype._digest = function digest(enc) { + if (enc === 'hex') + return utils.toHex32(this.h, 'big'); + else + return utils.split32(this.h, 'big'); +}; diff --git a/node_modules/hash.js/lib/hash/sha/384.js b/node_modules/hash.js/lib/hash/sha/384.js new file mode 100644 index 000000000..01df25608 --- /dev/null +++ b/node_modules/hash.js/lib/hash/sha/384.js @@ -0,0 +1,35 @@ +'use strict'; + +var utils = require('../utils'); + +var SHA512 = require('./512'); + +function SHA384() { + if (!(this instanceof SHA384)) + return new SHA384(); + + SHA512.call(this); + this.h = [ + 0xcbbb9d5d, 0xc1059ed8, + 0x629a292a, 0x367cd507, + 0x9159015a, 0x3070dd17, + 0x152fecd8, 0xf70e5939, + 0x67332667, 0xffc00b31, + 0x8eb44a87, 0x68581511, + 0xdb0c2e0d, 0x64f98fa7, + 0x47b5481d, 0xbefa4fa4 ]; +} +utils.inherits(SHA384, SHA512); +module.exports = SHA384; + +SHA384.blockSize = 1024; +SHA384.outSize = 384; +SHA384.hmacStrength = 192; +SHA384.padLength = 128; + +SHA384.prototype._digest = function digest(enc) { + if (enc === 'hex') + return utils.toHex32(this.h.slice(0, 12), 'big'); + else + return utils.split32(this.h.slice(0, 12), 'big'); +}; diff --git a/node_modules/hash.js/lib/hash/sha/512.js b/node_modules/hash.js/lib/hash/sha/512.js new file mode 100644 index 000000000..c371a2590 --- /dev/null +++ b/node_modules/hash.js/lib/hash/sha/512.js @@ -0,0 +1,330 @@ +'use strict'; + +var utils = require('../utils'); +var common = require('../common'); +var assert = require('minimalistic-assert'); + +var rotr64_hi = utils.rotr64_hi; +var rotr64_lo = utils.rotr64_lo; +var shr64_hi = utils.shr64_hi; +var shr64_lo = utils.shr64_lo; +var sum64 = utils.sum64; +var sum64_hi = utils.sum64_hi; +var sum64_lo = utils.sum64_lo; +var sum64_4_hi = utils.sum64_4_hi; +var sum64_4_lo = utils.sum64_4_lo; +var sum64_5_hi = utils.sum64_5_hi; +var sum64_5_lo = utils.sum64_5_lo; + +var BlockHash = common.BlockHash; + +var sha512_K = [ + 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, + 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc, + 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, + 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118, + 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, + 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2, + 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, + 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694, + 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, + 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65, + 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, + 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5, + 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, + 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4, + 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, + 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70, + 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, + 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df, + 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, + 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b, + 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, + 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30, + 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, + 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8, + 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, + 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8, + 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, + 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3, + 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, + 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec, + 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, + 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b, + 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, + 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178, + 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6, + 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b, + 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, + 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c, + 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, + 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817 +]; + +function SHA512() { + if (!(this instanceof SHA512)) + return new SHA512(); + + BlockHash.call(this); + this.h = [ + 0x6a09e667, 0xf3bcc908, + 0xbb67ae85, 0x84caa73b, + 0x3c6ef372, 0xfe94f82b, + 0xa54ff53a, 0x5f1d36f1, + 0x510e527f, 0xade682d1, + 0x9b05688c, 0x2b3e6c1f, + 0x1f83d9ab, 0xfb41bd6b, + 0x5be0cd19, 0x137e2179 ]; + this.k = sha512_K; + this.W = new Array(160); +} +utils.inherits(SHA512, BlockHash); +module.exports = SHA512; + +SHA512.blockSize = 1024; +SHA512.outSize = 512; +SHA512.hmacStrength = 192; +SHA512.padLength = 128; + +SHA512.prototype._prepareBlock = function _prepareBlock(msg, start) { + var W = this.W; + + // 32 x 32bit words + for (var i = 0; i < 32; i++) + W[i] = msg[start + i]; + for (; i < W.length; i += 2) { + var c0_hi = g1_512_hi(W[i - 4], W[i - 3]); // i - 2 + var c0_lo = g1_512_lo(W[i - 4], W[i - 3]); + var c1_hi = W[i - 14]; // i - 7 + var c1_lo = W[i - 13]; + var c2_hi = g0_512_hi(W[i - 30], W[i - 29]); // i - 15 + var c2_lo = g0_512_lo(W[i - 30], W[i - 29]); + var c3_hi = W[i - 32]; // i - 16 + var c3_lo = W[i - 31]; + + W[i] = sum64_4_hi( + c0_hi, c0_lo, + c1_hi, c1_lo, + c2_hi, c2_lo, + c3_hi, c3_lo); + W[i + 1] = sum64_4_lo( + c0_hi, c0_lo, + c1_hi, c1_lo, + c2_hi, c2_lo, + c3_hi, c3_lo); + } +}; + +SHA512.prototype._update = function _update(msg, start) { + this._prepareBlock(msg, start); + + var W = this.W; + + var ah = this.h[0]; + var al = this.h[1]; + var bh = this.h[2]; + var bl = this.h[3]; + var ch = this.h[4]; + var cl = this.h[5]; + var dh = this.h[6]; + var dl = this.h[7]; + var eh = this.h[8]; + var el = this.h[9]; + var fh = this.h[10]; + var fl = this.h[11]; + var gh = this.h[12]; + var gl = this.h[13]; + var hh = this.h[14]; + var hl = this.h[15]; + + assert(this.k.length === W.length); + for (var i = 0; i < W.length; i += 2) { + var c0_hi = hh; + var c0_lo = hl; + var c1_hi = s1_512_hi(eh, el); + var c1_lo = s1_512_lo(eh, el); + var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl); + var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl); + var c3_hi = this.k[i]; + var c3_lo = this.k[i + 1]; + var c4_hi = W[i]; + var c4_lo = W[i + 1]; + + var T1_hi = sum64_5_hi( + c0_hi, c0_lo, + c1_hi, c1_lo, + c2_hi, c2_lo, + c3_hi, c3_lo, + c4_hi, c4_lo); + var T1_lo = sum64_5_lo( + c0_hi, c0_lo, + c1_hi, c1_lo, + c2_hi, c2_lo, + c3_hi, c3_lo, + c4_hi, c4_lo); + + c0_hi = s0_512_hi(ah, al); + c0_lo = s0_512_lo(ah, al); + c1_hi = maj64_hi(ah, al, bh, bl, ch, cl); + c1_lo = maj64_lo(ah, al, bh, bl, ch, cl); + + var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo); + var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo); + + hh = gh; + hl = gl; + + gh = fh; + gl = fl; + + fh = eh; + fl = el; + + eh = sum64_hi(dh, dl, T1_hi, T1_lo); + el = sum64_lo(dl, dl, T1_hi, T1_lo); + + dh = ch; + dl = cl; + + ch = bh; + cl = bl; + + bh = ah; + bl = al; + + ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo); + al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo); + } + + sum64(this.h, 0, ah, al); + sum64(this.h, 2, bh, bl); + sum64(this.h, 4, ch, cl); + sum64(this.h, 6, dh, dl); + sum64(this.h, 8, eh, el); + sum64(this.h, 10, fh, fl); + sum64(this.h, 12, gh, gl); + sum64(this.h, 14, hh, hl); +}; + +SHA512.prototype._digest = function digest(enc) { + if (enc === 'hex') + return utils.toHex32(this.h, 'big'); + else + return utils.split32(this.h, 'big'); +}; + +function ch64_hi(xh, xl, yh, yl, zh) { + var r = (xh & yh) ^ ((~xh) & zh); + if (r < 0) + r += 0x100000000; + return r; +} + +function ch64_lo(xh, xl, yh, yl, zh, zl) { + var r = (xl & yl) ^ ((~xl) & zl); + if (r < 0) + r += 0x100000000; + return r; +} + +function maj64_hi(xh, xl, yh, yl, zh) { + var r = (xh & yh) ^ (xh & zh) ^ (yh & zh); + if (r < 0) + r += 0x100000000; + return r; +} + +function maj64_lo(xh, xl, yh, yl, zh, zl) { + var r = (xl & yl) ^ (xl & zl) ^ (yl & zl); + if (r < 0) + r += 0x100000000; + return r; +} + +function s0_512_hi(xh, xl) { + var c0_hi = rotr64_hi(xh, xl, 28); + var c1_hi = rotr64_hi(xl, xh, 2); // 34 + var c2_hi = rotr64_hi(xl, xh, 7); // 39 + + var r = c0_hi ^ c1_hi ^ c2_hi; + if (r < 0) + r += 0x100000000; + return r; +} + +function s0_512_lo(xh, xl) { + var c0_lo = rotr64_lo(xh, xl, 28); + var c1_lo = rotr64_lo(xl, xh, 2); // 34 + var c2_lo = rotr64_lo(xl, xh, 7); // 39 + + var r = c0_lo ^ c1_lo ^ c2_lo; + if (r < 0) + r += 0x100000000; + return r; +} + +function s1_512_hi(xh, xl) { + var c0_hi = rotr64_hi(xh, xl, 14); + var c1_hi = rotr64_hi(xh, xl, 18); + var c2_hi = rotr64_hi(xl, xh, 9); // 41 + + var r = c0_hi ^ c1_hi ^ c2_hi; + if (r < 0) + r += 0x100000000; + return r; +} + +function s1_512_lo(xh, xl) { + var c0_lo = rotr64_lo(xh, xl, 14); + var c1_lo = rotr64_lo(xh, xl, 18); + var c2_lo = rotr64_lo(xl, xh, 9); // 41 + + var r = c0_lo ^ c1_lo ^ c2_lo; + if (r < 0) + r += 0x100000000; + return r; +} + +function g0_512_hi(xh, xl) { + var c0_hi = rotr64_hi(xh, xl, 1); + var c1_hi = rotr64_hi(xh, xl, 8); + var c2_hi = shr64_hi(xh, xl, 7); + + var r = c0_hi ^ c1_hi ^ c2_hi; + if (r < 0) + r += 0x100000000; + return r; +} + +function g0_512_lo(xh, xl) { + var c0_lo = rotr64_lo(xh, xl, 1); + var c1_lo = rotr64_lo(xh, xl, 8); + var c2_lo = shr64_lo(xh, xl, 7); + + var r = c0_lo ^ c1_lo ^ c2_lo; + if (r < 0) + r += 0x100000000; + return r; +} + +function g1_512_hi(xh, xl) { + var c0_hi = rotr64_hi(xh, xl, 19); + var c1_hi = rotr64_hi(xl, xh, 29); // 61 + var c2_hi = shr64_hi(xh, xl, 6); + + var r = c0_hi ^ c1_hi ^ c2_hi; + if (r < 0) + r += 0x100000000; + return r; +} + +function g1_512_lo(xh, xl) { + var c0_lo = rotr64_lo(xh, xl, 19); + var c1_lo = rotr64_lo(xl, xh, 29); // 61 + var c2_lo = shr64_lo(xh, xl, 6); + + var r = c0_lo ^ c1_lo ^ c2_lo; + if (r < 0) + r += 0x100000000; + return r; +} diff --git a/node_modules/hash.js/lib/hash/sha/common.js b/node_modules/hash.js/lib/hash/sha/common.js new file mode 100644 index 000000000..d41b46431 --- /dev/null +++ b/node_modules/hash.js/lib/hash/sha/common.js @@ -0,0 +1,49 @@ +'use strict'; + +var utils = require('../utils'); +var rotr32 = utils.rotr32; + +function ft_1(s, x, y, z) { + if (s === 0) + return ch32(x, y, z); + if (s === 1 || s === 3) + return p32(x, y, z); + if (s === 2) + return maj32(x, y, z); +} +exports.ft_1 = ft_1; + +function ch32(x, y, z) { + return (x & y) ^ ((~x) & z); +} +exports.ch32 = ch32; + +function maj32(x, y, z) { + return (x & y) ^ (x & z) ^ (y & z); +} +exports.maj32 = maj32; + +function p32(x, y, z) { + return x ^ y ^ z; +} +exports.p32 = p32; + +function s0_256(x) { + return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22); +} +exports.s0_256 = s0_256; + +function s1_256(x) { + return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25); +} +exports.s1_256 = s1_256; + +function g0_256(x) { + return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3); +} +exports.g0_256 = g0_256; + +function g1_256(x) { + return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10); +} +exports.g1_256 = g1_256; diff --git a/node_modules/hash.js/lib/hash/utils.js b/node_modules/hash.js/lib/hash/utils.js new file mode 100644 index 000000000..3d7d4ea7e --- /dev/null +++ b/node_modules/hash.js/lib/hash/utils.js @@ -0,0 +1,253 @@ +'use strict'; + +var assert = require('minimalistic-assert'); +var inherits = require('inherits'); + +exports.inherits = inherits; + +function toArray(msg, enc) { + if (Array.isArray(msg)) + return msg.slice(); + if (!msg) + return []; + var res = []; + if (typeof msg === 'string') { + if (!enc) { + for (var i = 0; i < msg.length; i++) { + var c = msg.charCodeAt(i); + var hi = c >> 8; + var lo = c & 0xff; + if (hi) + res.push(hi, lo); + else + res.push(lo); + } + } else if (enc === 'hex') { + msg = msg.replace(/[^a-z0-9]+/ig, ''); + if (msg.length % 2 !== 0) + msg = '0' + msg; + for (i = 0; i < msg.length; i += 2) + res.push(parseInt(msg[i] + msg[i + 1], 16)); + } + } else { + for (i = 0; i < msg.length; i++) + res[i] = msg[i] | 0; + } + return res; +} +exports.toArray = toArray; + +function toHex(msg) { + var res = ''; + for (var i = 0; i < msg.length; i++) + res += zero2(msg[i].toString(16)); + return res; +} +exports.toHex = toHex; + +function htonl(w) { + var res = (w >>> 24) | + ((w >>> 8) & 0xff00) | + ((w << 8) & 0xff0000) | + ((w & 0xff) << 24); + return res >>> 0; +} +exports.htonl = htonl; + +function toHex32(msg, endian) { + var res = ''; + for (var i = 0; i < msg.length; i++) { + var w = msg[i]; + if (endian === 'little') + w = htonl(w); + res += zero8(w.toString(16)); + } + return res; +} +exports.toHex32 = toHex32; + +function zero2(word) { + if (word.length === 1) + return '0' + word; + else + return word; +} +exports.zero2 = zero2; + +function zero8(word) { + if (word.length === 7) + return '0' + word; + else if (word.length === 6) + return '00' + word; + else if (word.length === 5) + return '000' + word; + else if (word.length === 4) + return '0000' + word; + else if (word.length === 3) + return '00000' + word; + else if (word.length === 2) + return '000000' + word; + else if (word.length === 1) + return '0000000' + word; + else + return word; +} +exports.zero8 = zero8; + +function join32(msg, start, end, endian) { + var len = end - start; + assert(len % 4 === 0); + var res = new Array(len / 4); + for (var i = 0, k = start; i < res.length; i++, k += 4) { + var w; + if (endian === 'big') + w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3]; + else + w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k]; + res[i] = w >>> 0; + } + return res; +} +exports.join32 = join32; + +function split32(msg, endian) { + var res = new Array(msg.length * 4); + for (var i = 0, k = 0; i < msg.length; i++, k += 4) { + var m = msg[i]; + if (endian === 'big') { + res[k] = m >>> 24; + res[k + 1] = (m >>> 16) & 0xff; + res[k + 2] = (m >>> 8) & 0xff; + res[k + 3] = m & 0xff; + } else { + res[k + 3] = m >>> 24; + res[k + 2] = (m >>> 16) & 0xff; + res[k + 1] = (m >>> 8) & 0xff; + res[k] = m & 0xff; + } + } + return res; +} +exports.split32 = split32; + +function rotr32(w, b) { + return (w >>> b) | (w << (32 - b)); +} +exports.rotr32 = rotr32; + +function rotl32(w, b) { + return (w << b) | (w >>> (32 - b)); +} +exports.rotl32 = rotl32; + +function sum32(a, b) { + return (a + b) >>> 0; +} +exports.sum32 = sum32; + +function sum32_3(a, b, c) { + return (a + b + c) >>> 0; +} +exports.sum32_3 = sum32_3; + +function sum32_4(a, b, c, d) { + return (a + b + c + d) >>> 0; +} +exports.sum32_4 = sum32_4; + +function sum32_5(a, b, c, d, e) { + return (a + b + c + d + e) >>> 0; +} +exports.sum32_5 = sum32_5; + +function sum64(buf, pos, ah, al) { + var bh = buf[pos]; + var bl = buf[pos + 1]; + + var lo = (al + bl) >>> 0; + var hi = (lo < al ? 1 : 0) + ah + bh; + buf[pos] = hi >>> 0; + buf[pos + 1] = lo; +} +exports.sum64 = sum64; + +function sum64_hi(ah, al, bh, bl) { + var lo = (al + bl) >>> 0; + var hi = (lo < al ? 1 : 0) + ah + bh; + return hi >>> 0; +} +exports.sum64_hi = sum64_hi; + +function sum64_lo(ah, al, bh, bl) { + var lo = al + bl; + return lo >>> 0; +} +exports.sum64_lo = sum64_lo; + +function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) { + var carry = 0; + var lo = al; + lo = (lo + bl) >>> 0; + carry += lo < al ? 1 : 0; + lo = (lo + cl) >>> 0; + carry += lo < cl ? 1 : 0; + lo = (lo + dl) >>> 0; + carry += lo < dl ? 1 : 0; + + var hi = ah + bh + ch + dh + carry; + return hi >>> 0; +} +exports.sum64_4_hi = sum64_4_hi; + +function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) { + var lo = al + bl + cl + dl; + return lo >>> 0; +} +exports.sum64_4_lo = sum64_4_lo; + +function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { + var carry = 0; + var lo = al; + lo = (lo + bl) >>> 0; + carry += lo < al ? 1 : 0; + lo = (lo + cl) >>> 0; + carry += lo < cl ? 1 : 0; + lo = (lo + dl) >>> 0; + carry += lo < dl ? 1 : 0; + lo = (lo + el) >>> 0; + carry += lo < el ? 1 : 0; + + var hi = ah + bh + ch + dh + eh + carry; + return hi >>> 0; +} +exports.sum64_5_hi = sum64_5_hi; + +function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { + var lo = al + bl + cl + dl + el; + + return lo >>> 0; +} +exports.sum64_5_lo = sum64_5_lo; + +function rotr64_hi(ah, al, num) { + var r = (al << (32 - num)) | (ah >>> num); + return r >>> 0; +} +exports.rotr64_hi = rotr64_hi; + +function rotr64_lo(ah, al, num) { + var r = (ah << (32 - num)) | (al >>> num); + return r >>> 0; +} +exports.rotr64_lo = rotr64_lo; + +function shr64_hi(ah, al, num) { + return ah >>> num; +} +exports.shr64_hi = shr64_hi; + +function shr64_lo(ah, al, num) { + var r = (ah << (32 - num)) | (al >>> num); + return r >>> 0; +} +exports.shr64_lo = shr64_lo; diff --git a/node_modules/hash.js/package.json b/node_modules/hash.js/package.json new file mode 100644 index 000000000..7245dcdc4 --- /dev/null +++ b/node_modules/hash.js/package.json @@ -0,0 +1,64 @@ +{ + "_from": "hash.js@^1.0.0", + "_id": "hash.js@1.1.5", + "_inBundle": false, + "_integrity": "sha512-eWI5HG9Np+eHV1KQhisXWwM+4EPPYe5dFX1UZZH7k/E3JzDEazVH+VGlZi6R94ZqImq+A3D1mCEtrFIfg/E7sA==", + "_location": "/hash.js", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "hash.js@^1.0.0", + "name": "hash.js", + "escapedName": "hash.js", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/elliptic", + "/hmac-drbg" + ], + "_resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.5.tgz", + "_shasum": "e38ab4b85dfb1e0c40fe9265c0e9b54854c23812", + "_spec": "hash.js@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/elliptic", + "author": { + "name": "Fedor Indutny", + "email": "fedor@indutny.com" + }, + "bugs": { + "url": "https://github.com/indutny/hash.js/issues" + }, + "bundleDependencies": false, + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + }, + "deprecated": false, + "description": "Various hash functions that could be run by both browser and node", + "devDependencies": { + "eslint": "^4.19.1", + "mocha": "^5.2.0" + }, + "homepage": "https://github.com/indutny/hash.js", + "keywords": [ + "hash", + "sha256", + "sha224", + "hmac" + ], + "license": "MIT", + "main": "lib/hash.js", + "name": "hash.js", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/indutny/hash.js.git" + }, + "scripts": { + "lint": "eslint lib/*.js lib/**/*.js lib/**/**/*.js test/*.js", + "test": "mocha --reporter=spec test/*-test.js && npm run lint" + }, + "typings": "lib/hash.d.ts", + "version": "1.1.5" +} diff --git a/node_modules/hash.js/test/hash-test.js b/node_modules/hash.js/test/hash-test.js new file mode 100644 index 000000000..6a36efc6f --- /dev/null +++ b/node_modules/hash.js/test/hash-test.js @@ -0,0 +1,124 @@ +'use strict'; +/* global describe it */ + +var assert = require('assert'); +var hash = require('../'); + +describe('Hash', function() { + function test(fn, cases) { + for (var i = 0; i < cases.length; i++) { + var msg = cases[i][0]; + var res = cases[i][1]; + var enc = cases[i][2]; + + var dgst = fn().update(msg, enc).digest('hex'); + assert.equal(dgst, res); + + // Split message + dgst = fn().update(msg.slice(0, 2), enc) + .update(msg.slice(2), enc) + .digest('hex'); + assert.equal(dgst, res); + } + } + + it('should support sha256', function() { + assert.equal(hash.sha256.blockSize, 512); + assert.equal(hash.sha256.outSize, 256); + + test(hash.sha256, [ + [ 'abc', + 'ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad' ], + [ 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq', + '248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1' ], + [ 'deadbeef', + '5f78c33274e43fa9de5659265c1d917e25c03722dcb0b8d27db8d5feaa813953', + 'hex' ], + ]); + }); + + it('should support sha224', function() { + assert.equal(hash.sha224.blockSize, 512); + assert.equal(hash.sha224.outSize, 224); + + test(hash.sha224, [ + [ 'abc', + '23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7' ], + [ 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq', + '75388b16512776cc5dba5da1fd890150b0c6455cb4f58b1952522525' ], + [ 'deadbeef', + '55b9eee5f60cc362ddc07676f620372611e22272f60fdbec94f243f8', + 'hex' ], + ]); + }); + + it('should support ripemd160', function() { + assert.equal(hash.ripemd160.blockSize, 512); + assert.equal(hash.ripemd160.outSize, 160); + + test(hash.ripemd160, [ + [ '', '9c1185a5c5e9fc54612808977ee8f548b2258d31'], + [ 'abc', + '8eb208f7e05d987a9b044a8e98c6b087f15a0bfc' ], + [ 'message digest', + '5d0689ef49d2fae572b881b123a85ffa21595f36' ], + [ 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq', + '12a053384a9c0c88e405a06c27dcf49ada62eb2b' ], + [ 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', + 'b0e20b6e3116640286ed3a87a5713079b21f5189' ], + ]); + }); + + it('should support sha1', function() { + assert.equal(hash.sha1.blockSize, 512); + assert.equal(hash.sha1.outSize, 160); + + test(hash.sha1, [ + [ '', + 'da39a3ee5e6b4b0d3255bfef95601890afd80709' ], + [ 'abc', + 'a9993e364706816aba3e25717850c26c9cd0d89d' ], + [ 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq', + '84983e441c3bd26ebaae4aa1f95129e5e54670f1' ], + [ 'deadbeef', + 'd78f8bb992a56a597f6c7a1fb918bb78271367eb', + 'hex' ], + ]); + }); + + it('should support sha512', function() { + assert.equal(hash.sha512.blockSize, 1024); + assert.equal(hash.sha512.outSize, 512); + + test(hash.sha512, [ + [ 'abc', + 'ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a' + + '2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f' + ], + [ + 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn' + + 'hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu', + '8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018' + + '501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909' + ] + ]); + }); + + it('should support sha384', function() { + assert.equal(hash.sha384.blockSize, 1024); + assert.equal(hash.sha384.outSize, 384); + + test(hash.sha384, [ + [ 'abc', + 'cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed' + + '8086072ba1e7cc2358baeca134c825a7' + ], + [ + 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn' + + 'hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu', + '09330c33f71147e83d192fc782cd1b4753111b173b3b05d22fa08086e3b0f712' + + 'fcc7c71a557e2db966c3e9fa91746039' + ] + ]); + }); +}); diff --git a/node_modules/hash.js/test/hmac-test.js b/node_modules/hash.js/test/hmac-test.js new file mode 100644 index 000000000..6fe18e38e --- /dev/null +++ b/node_modules/hash.js/test/hmac-test.js @@ -0,0 +1,62 @@ +'use strict'; +/* global describe it */ + +var assert = require('assert'); +var hash = require('../'); + +describe('Hmac', function() { + describe('mixed test vector', function() { + test({ + name: 'nist 1', + key: '00010203 04050607 08090A0B 0C0D0E0F' + + '10111213 14151617 18191A1B 1C1D1E1F 20212223 24252627' + + '28292A2B 2C2D2E2F 30313233 34353637 38393A3B 3C3D3E3F', + msg: 'Sample message for keylen=blocklen', + res: '8bb9a1db9806f20df7f77b82138c7914d174d59e13dc4d0169c9057b133e1d62' + }); + test({ + name: 'nist 2', + key: '00010203 04050607' + + '08090A0B 0C0D0E0F 10111213 14151617 18191A1B 1C1D1E1F', + msg: 'Sample message for keylen +``` + +for node.js, you may install it via npm: + +```bash +npm install heap +``` + +then require it: + +``` +var Heap = require('heap'); +``` + +Examples +------- + + +push and pop + +```js +var heap = new Heap(); +heap.push(3); +heap.push(1); +heap.push(2); +heap.pop(); // 1 +``` + +custom comparison function + +```js +var heap = new Heap(function(a, b) { + return a.foo - b.foo; +}); +heap.push({foo: 3}); +heap.push({foo: 1}); +heap.push({foo: 2}); +heap.pop(); // {foo: 1} +``` + +find 3 largest/smallest items in an array + +```js +var array = [1, 3, 4, 2, 5]; +Heap.nlargest(array, 3); // [5, 4, 3] +Heap.nsmallest(array, 3); // [1, 2, 3] +``` + +Document +-------- + +This module exposes only one object, namely the Heap class. + +### Constructor: Heap([cmp]) ### + +The constructor receives a comparison function as an optional parameter. If omitted, the heap is built as a min-heap, which means that the smallest element will be popped out first. + +If the comparison function is supplied, the heap will be built according to the +return value of the comparison function. + +* if cmp(a, b) < 0, then item a will come prior to b +* if cmp(a, b) > 0, then item b will come prior to a + +So, the comparison function has the following form: + +```js +function cmp(a, b) { + if (a is prior to b) { + return -1; + } + if (b is prior to a) { + return 1; + } + return 0; +} +``` + +To compare numbers, simply: + +```js +function cmp(a, b) { + return a - b; +} +``` + +### Instance Methods ### + +**push(item)** (alias: **insert**) + +Push item onto heap. + +**pop()** + +Pop the smallest item off the heap and return it. + +**peek()** (alias: **top** / **front**) + +Return the smallest item of the heap. + +**replace(item)** + +Pop and return the current smallest value, and add the new item. + +This is more efficient than pop() followed by push(), and can be +more appropriate when using a fixed size heap. Note that the value +returned may be larger than item! + +**pushpop(item)** + +Fast version of a push followed by a pop. + +**heapify()** + +Rebuild the heap. This method may come handy when the priority of the +internal data is being modified. + +**updateItem(item)** + +Update the position of the given item in the heap. +This function should be called every time the item is being modified. + +**empty()** + +Determine whether the heap is empty. + +**size()** + +Get the number of elements stored in the heap. + +**toArray()** + +Return the array representation of the heap. (note: the array is a shallow copy of the heap's internal nodes) + +**clone()** (alias: **copy**) + +Return a clone of the heap. (note: the internal data is a shallow copy of the original one) + +### Static Methods ### + +NOTE: All the static methods are designed to be applied on arrays. + +**push(array, item, [cmp])** + +Push item onto array, maintaining the heap invariant. + +**pop(array, [cmp])** + +Pop the smallest item off the array, maintaining the heap invariant. + +**replace(array, item, [cmp])** + +Pop and return the current smallest value, and add the new item. + +This is more efficient than heappop() followed by heappush(), and can be +more appropriate when using a fixed size heap. Note that the value +returned may be larger than item! + +**pushpop(array, item, [cmp])** + +Fast version of a heappush followed by a heappop. + +**heapify(array, [cmp])** + +Build the heap. + +**updateItem(array, item, [cmp])** + +Update the position of the given item in the heap. +This function should be called every time the item is being modified. + +**nlargest(array, n, [cmp])** + +Find the n largest elements in a dataset. + +**nsmallest(array, n, [cmp])** + +Find the n smallest elements in a dataset. + + +License +------- + +Ported by Xueqiao Xu <xueqiaoxu@gmail.com> + +PSF LICENSE AGREEMENT FOR PYTHON 2.7.2 + +1. This LICENSE AGREEMENT is between the Python Software Foundation (“PSF”), and the Individual or Organization (“Licensee”) accessing and otherwise using Python 2.7.2 software in source or binary form and its associated documentation. +2. Subject to the terms and conditions of this License Agreement, PSF hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python 2.7.2 alone or in any derivative version, provided, however, that PSF’s License Agreement and PSF’s notice of copyright, i.e., “Copyright © 2001-2012 Python Software Foundation; All Rights Reserved” are retained in Python 2.7.2 alone or in any derivative version prepared by Licensee. +3. In the event Licensee prepares a derivative work that is based on or incorporates Python 2.7.2 or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to Python 2.7.2. +4. PSF is making Python 2.7.2 available to Licensee on an “AS IS” basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 2.7.2 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON 2.7.2 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 2.7.2, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. +6. This License Agreement will automatically terminate upon a material breach of its terms and conditions. +7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between PSF and Licensee. This License Agreement does not grant permission to use PSF trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party. +8. By copying, installing or otherwise using Python 2.7.2, Licensee agrees to be bound by the terms and conditions of this License Agreement. diff --git a/node_modules/heap/bower.json b/node_modules/heap/bower.json new file mode 100644 index 000000000..010e8763d --- /dev/null +++ b/node_modules/heap/bower.json @@ -0,0 +1,19 @@ +{ + "name" : "heap" + , "version" : "0.2.5" + , "description" : "binary heap (priority queue) algorithms (ported from Python's heapq module)" + , "homepage" : "https://github.com/qiao/heap.js" + , "keywords" : ["algorithm", "data structure", "heap"] + , "author" : "Xueqiao Xu " + , "main" : "lib/heap.js" + , "dependencies" : {} + , "devDependencies" : {} + , "repository" : { + "type" : "git" + , "url" : "git://github.com/qiao/heap.js.git" + } + , "licenses" : [{ + "type" : "PSF" + , "url" : "http://docs.python.org/license.html" + }] +} diff --git a/node_modules/heap/index.js b/node_modules/heap/index.js new file mode 100644 index 000000000..f4c5e9091 --- /dev/null +++ b/node_modules/heap/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/heap'); diff --git a/node_modules/heap/lib/heap.js b/node_modules/heap/lib/heap.js new file mode 100644 index 000000000..e185c6f9c --- /dev/null +++ b/node_modules/heap/lib/heap.js @@ -0,0 +1,375 @@ +// Generated by CoffeeScript 1.8.0 +(function() { + var Heap, defaultCmp, floor, heapify, heappop, heappush, heappushpop, heapreplace, insort, min, nlargest, nsmallest, updateItem, _siftdown, _siftup; + + floor = Math.floor, min = Math.min; + + + /* + Default comparison function to be used + */ + + defaultCmp = function(x, y) { + if (x < y) { + return -1; + } + if (x > y) { + return 1; + } + return 0; + }; + + + /* + Insert item x in list a, and keep it sorted assuming a is sorted. + + If x is already in a, insert it to the right of the rightmost x. + + Optional args lo (default 0) and hi (default a.length) bound the slice + of a to be searched. + */ + + insort = function(a, x, lo, hi, cmp) { + var mid; + if (lo == null) { + lo = 0; + } + if (cmp == null) { + cmp = defaultCmp; + } + if (lo < 0) { + throw new Error('lo must be non-negative'); + } + if (hi == null) { + hi = a.length; + } + while (lo < hi) { + mid = floor((lo + hi) / 2); + if (cmp(x, a[mid]) < 0) { + hi = mid; + } else { + lo = mid + 1; + } + } + return ([].splice.apply(a, [lo, lo - lo].concat(x)), x); + }; + + + /* + Push item onto heap, maintaining the heap invariant. + */ + + heappush = function(array, item, cmp) { + if (cmp == null) { + cmp = defaultCmp; + } + array.push(item); + return _siftdown(array, 0, array.length - 1, cmp); + }; + + + /* + Pop the smallest item off the heap, maintaining the heap invariant. + */ + + heappop = function(array, cmp) { + var lastelt, returnitem; + if (cmp == null) { + cmp = defaultCmp; + } + lastelt = array.pop(); + if (array.length) { + returnitem = array[0]; + array[0] = lastelt; + _siftup(array, 0, cmp); + } else { + returnitem = lastelt; + } + return returnitem; + }; + + + /* + Pop and return the current smallest value, and add the new item. + + This is more efficient than heappop() followed by heappush(), and can be + more appropriate when using a fixed size heap. Note that the value + returned may be larger than item! That constrains reasonable use of + this routine unless written as part of a conditional replacement: + if item > array[0] + item = heapreplace(array, item) + */ + + heapreplace = function(array, item, cmp) { + var returnitem; + if (cmp == null) { + cmp = defaultCmp; + } + returnitem = array[0]; + array[0] = item; + _siftup(array, 0, cmp); + return returnitem; + }; + + + /* + Fast version of a heappush followed by a heappop. + */ + + heappushpop = function(array, item, cmp) { + var _ref; + if (cmp == null) { + cmp = defaultCmp; + } + if (array.length && cmp(array[0], item) < 0) { + _ref = [array[0], item], item = _ref[0], array[0] = _ref[1]; + _siftup(array, 0, cmp); + } + return item; + }; + + + /* + Transform list into a heap, in-place, in O(array.length) time. + */ + + heapify = function(array, cmp) { + var i, _i, _j, _len, _ref, _ref1, _results, _results1; + if (cmp == null) { + cmp = defaultCmp; + } + _ref1 = (function() { + _results1 = []; + for (var _j = 0, _ref = floor(array.length / 2); 0 <= _ref ? _j < _ref : _j > _ref; 0 <= _ref ? _j++ : _j--){ _results1.push(_j); } + return _results1; + }).apply(this).reverse(); + _results = []; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + i = _ref1[_i]; + _results.push(_siftup(array, i, cmp)); + } + return _results; + }; + + + /* + Update the position of the given item in the heap. + This function should be called every time the item is being modified. + */ + + updateItem = function(array, item, cmp) { + var pos; + if (cmp == null) { + cmp = defaultCmp; + } + pos = array.indexOf(item); + if (pos === -1) { + return; + } + _siftdown(array, 0, pos, cmp); + return _siftup(array, pos, cmp); + }; + + + /* + Find the n largest elements in a dataset. + */ + + nlargest = function(array, n, cmp) { + var elem, result, _i, _len, _ref; + if (cmp == null) { + cmp = defaultCmp; + } + result = array.slice(0, n); + if (!result.length) { + return result; + } + heapify(result, cmp); + _ref = array.slice(n); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + elem = _ref[_i]; + heappushpop(result, elem, cmp); + } + return result.sort(cmp).reverse(); + }; + + + /* + Find the n smallest elements in a dataset. + */ + + nsmallest = function(array, n, cmp) { + var elem, i, los, result, _i, _j, _len, _ref, _ref1, _results; + if (cmp == null) { + cmp = defaultCmp; + } + if (n * 10 <= array.length) { + result = array.slice(0, n).sort(cmp); + if (!result.length) { + return result; + } + los = result[result.length - 1]; + _ref = array.slice(n); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + elem = _ref[_i]; + if (cmp(elem, los) < 0) { + insort(result, elem, 0, null, cmp); + result.pop(); + los = result[result.length - 1]; + } + } + return result; + } + heapify(array, cmp); + _results = []; + for (i = _j = 0, _ref1 = min(n, array.length); 0 <= _ref1 ? _j < _ref1 : _j > _ref1; i = 0 <= _ref1 ? ++_j : --_j) { + _results.push(heappop(array, cmp)); + } + return _results; + }; + + _siftdown = function(array, startpos, pos, cmp) { + var newitem, parent, parentpos; + if (cmp == null) { + cmp = defaultCmp; + } + newitem = array[pos]; + while (pos > startpos) { + parentpos = (pos - 1) >> 1; + parent = array[parentpos]; + if (cmp(newitem, parent) < 0) { + array[pos] = parent; + pos = parentpos; + continue; + } + break; + } + return array[pos] = newitem; + }; + + _siftup = function(array, pos, cmp) { + var childpos, endpos, newitem, rightpos, startpos; + if (cmp == null) { + cmp = defaultCmp; + } + endpos = array.length; + startpos = pos; + newitem = array[pos]; + childpos = 2 * pos + 1; + while (childpos < endpos) { + rightpos = childpos + 1; + if (rightpos < endpos && !(cmp(array[childpos], array[rightpos]) < 0)) { + childpos = rightpos; + } + array[pos] = array[childpos]; + pos = childpos; + childpos = 2 * pos + 1; + } + array[pos] = newitem; + return _siftdown(array, startpos, pos, cmp); + }; + + Heap = (function() { + Heap.push = heappush; + + Heap.pop = heappop; + + Heap.replace = heapreplace; + + Heap.pushpop = heappushpop; + + Heap.heapify = heapify; + + Heap.updateItem = updateItem; + + Heap.nlargest = nlargest; + + Heap.nsmallest = nsmallest; + + function Heap(cmp) { + this.cmp = cmp != null ? cmp : defaultCmp; + this.nodes = []; + } + + Heap.prototype.push = function(x) { + return heappush(this.nodes, x, this.cmp); + }; + + Heap.prototype.pop = function() { + return heappop(this.nodes, this.cmp); + }; + + Heap.prototype.peek = function() { + return this.nodes[0]; + }; + + Heap.prototype.contains = function(x) { + return this.nodes.indexOf(x) !== -1; + }; + + Heap.prototype.replace = function(x) { + return heapreplace(this.nodes, x, this.cmp); + }; + + Heap.prototype.pushpop = function(x) { + return heappushpop(this.nodes, x, this.cmp); + }; + + Heap.prototype.heapify = function() { + return heapify(this.nodes, this.cmp); + }; + + Heap.prototype.updateItem = function(x) { + return updateItem(this.nodes, x, this.cmp); + }; + + Heap.prototype.clear = function() { + return this.nodes = []; + }; + + Heap.prototype.empty = function() { + return this.nodes.length === 0; + }; + + Heap.prototype.size = function() { + return this.nodes.length; + }; + + Heap.prototype.clone = function() { + var heap; + heap = new Heap(); + heap.nodes = this.nodes.slice(0); + return heap; + }; + + Heap.prototype.toArray = function() { + return this.nodes.slice(0); + }; + + Heap.prototype.insert = Heap.prototype.push; + + Heap.prototype.top = Heap.prototype.peek; + + Heap.prototype.front = Heap.prototype.peek; + + Heap.prototype.has = Heap.prototype.contains; + + Heap.prototype.copy = Heap.prototype.clone; + + return Heap; + + })(); + + (function(root, factory) { + if (typeof define === 'function' && define.amd) { + return define([], factory); + } else if (typeof exports === 'object') { + return module.exports = factory(); + } else { + return root.Heap = factory(); + } + })(this, function() { + return Heap; + }); + +}).call(this); diff --git a/node_modules/heap/package.json b/node_modules/heap/package.json new file mode 100644 index 000000000..7956e65ce --- /dev/null +++ b/node_modules/heap/package.json @@ -0,0 +1,63 @@ +{ + "_from": "heap@^0.2.6", + "_id": "heap@0.2.6", + "_inBundle": false, + "_integrity": "sha1-CH4fELBGky/IWU3Z5tN4r8nR5aw=", + "_location": "/heap", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "heap@^0.2.6", + "name": "heap", + "escapedName": "heap", + "rawSpec": "^0.2.6", + "saveSpec": null, + "fetchSpec": "^0.2.6" + }, + "_requiredBy": [ + "/cytoscape" + ], + "_resolved": "https://registry.npmjs.org/heap/-/heap-0.2.6.tgz", + "_shasum": "087e1f10b046932fc8594dd9e6d378afc9d1e5ac", + "_spec": "heap@^0.2.6", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/cytoscape", + "author": { + "name": "Xueqiao Xu", + "email": "xueqiaoxu@gmail.com" + }, + "bugs": { + "url": "https://github.com/qiao/heap.js/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "binary heap (priority queue) algorithms (ported from Python's heapq module)", + "devDependencies": { + "coffee-script": "1.3.x", + "mocha": "2.1.x", + "should": "0.6.x" + }, + "homepage": "https://github.com/qiao/heap.js", + "keywords": [ + "algorithm", + "data structure", + "heap" + ], + "licenses": [ + { + "type": "PSF", + "url": "http://docs.python.org/license.html" + } + ], + "main": "./index.js", + "name": "heap", + "repository": { + "type": "git", + "url": "git://github.com/qiao/heap.js.git" + }, + "scripts": { + "test": "make test" + }, + "version": "0.2.6" +} diff --git a/node_modules/heap/src/heap.coffee b/node_modules/heap/src/heap.coffee new file mode 100644 index 000000000..8d6047393 --- /dev/null +++ b/node_modules/heap/src/heap.coffee @@ -0,0 +1,218 @@ +{floor, min} = Math + +### +Default comparison function to be used +### +defaultCmp = (x, y) -> + return -1 if x < y + return 1 if x > y + 0 + +### +Insert item x in list a, and keep it sorted assuming a is sorted. + +If x is already in a, insert it to the right of the rightmost x. + +Optional args lo (default 0) and hi (default a.length) bound the slice +of a to be searched. +### +insort = (a, x, lo=0, hi, cmp=defaultCmp) -> + throw new Error('lo must be non-negative') if lo < 0 + hi ?= a.length + while lo < hi + mid = floor((lo + hi) / 2) + if cmp(x, a[mid]) < 0 + hi = mid + else + lo = mid + 1 + a[lo...lo] = x + +### +Push item onto heap, maintaining the heap invariant. +### +heappush = (array, item, cmp=defaultCmp) -> + array.push(item) + _siftdown(array, 0, array.length - 1, cmp) + +### +Pop the smallest item off the heap, maintaining the heap invariant. +### +heappop = (array, cmp=defaultCmp) -> + lastelt = array.pop() + if array.length + returnitem = array[0] + array[0] = lastelt + _siftup(array, 0, cmp) + else + returnitem = lastelt + returnitem + +### +Pop and return the current smallest value, and add the new item. + +This is more efficient than heappop() followed by heappush(), and can be +more appropriate when using a fixed size heap. Note that the value +returned may be larger than item! That constrains reasonable use of +this routine unless written as part of a conditional replacement: + if item > array[0] + item = heapreplace(array, item) +### +heapreplace = (array, item, cmp=defaultCmp) -> + returnitem = array[0] + array[0] = item + _siftup(array, 0, cmp) + returnitem + +### +Fast version of a heappush followed by a heappop. +### +heappushpop = (array, item, cmp=defaultCmp) -> + if array.length and cmp(array[0], item) < 0 + [item, array[0]] = [array[0], item] + _siftup(array, 0, cmp) + item + +### +Transform list into a heap, in-place, in O(array.length) time. +### +heapify = (array, cmp=defaultCmp) -> + for i in [0...floor(array.length / 2)].reverse() + _siftup(array, i, cmp) + +### +Update the position of the given item in the heap. +This function should be called every time the item is being modified. +### +updateItem = (array, item, cmp=defaultCmp) -> + pos = array.indexOf(item) + return if pos is -1 + _siftdown(array, 0, pos, cmp) + _siftup(array, pos, cmp) + +### +Find the n largest elements in a dataset. +### +nlargest = (array, n, cmp=defaultCmp) -> + result = array[0...n] + return result unless result.length + heapify(result, cmp) + heappushpop(result, elem, cmp) for elem in array[n..] + result.sort(cmp).reverse() + +### +Find the n smallest elements in a dataset. +### +nsmallest = (array, n, cmp=defaultCmp) -> + if n * 10 <= array.length + result = array[0...n].sort(cmp) + return result unless result.length + los = result[result.length - 1] + for elem in array[n..] + if cmp(elem, los) < 0 + insort(result, elem, 0, null, cmp) + result.pop() + los = result[result.length - 1] + return result + + heapify(array, cmp) + (heappop(array, cmp) for i in [0...min(n, array.length)]) + +_siftdown = (array, startpos, pos, cmp=defaultCmp) -> + newitem = array[pos] + while pos > startpos + parentpos = (pos - 1) >> 1 + parent = array[parentpos] + if cmp(newitem, parent) < 0 + array[pos] = parent + pos = parentpos + continue + break + array[pos] = newitem + +_siftup = (array, pos, cmp=defaultCmp) -> + endpos = array.length + startpos = pos + newitem = array[pos] + childpos = 2 * pos + 1 + while childpos < endpos + rightpos = childpos + 1 + if rightpos < endpos and not (cmp(array[childpos], array[rightpos]) < 0) + childpos = rightpos + array[pos] = array[childpos] + pos = childpos + childpos = 2 * pos + 1 + array[pos] = newitem + _siftdown(array, startpos, pos, cmp) + +class Heap + @push: heappush + @pop: heappop + @replace: heapreplace + @pushpop: heappushpop + @heapify: heapify + @updateItem: updateItem + @nlargest: nlargest + @nsmallest: nsmallest + + constructor: (@cmp=defaultCmp) -> + @nodes = [] + + push: (x) -> + heappush(@nodes, x, @cmp) + + pop: -> + heappop(@nodes, @cmp) + + peek: -> + @nodes[0] + + contains: (x) -> + @nodes.indexOf(x) isnt -1 + + replace: (x) -> + heapreplace(@nodes, x, @cmp) + + pushpop: (x) -> + heappushpop(@nodes, x, @cmp) + + heapify: -> + heapify(@nodes, @cmp) + + updateItem: (x) -> + updateItem(@nodes, x, @cmp) + + clear: -> + @nodes = [] + + empty: -> + @nodes.length is 0 + + size: -> + @nodes.length + + clone: -> + heap = new Heap() + heap.nodes = @nodes.slice(0) + heap + + toArray: -> + @nodes.slice(0) + + # aliases + insert: @::push + top: @::peek + front: @::peek + has: @::contains + copy: @::clone + + +# exports to global +((root, factory) -> + if typeof define is 'function' and define.amd + define [], factory + else if typeof exports is 'object' + module.exports = factory() + else + root.Heap = factory() +) @, -> Heap + diff --git a/node_modules/heap/test/heap.test.coffee b/node_modules/heap/test/heap.test.coffee new file mode 100644 index 000000000..6c1d3f21a --- /dev/null +++ b/node_modules/heap/test/heap.test.coffee @@ -0,0 +1,100 @@ +Heap = require '..' +{random} = Math + +describe 'Heap#push, Heap#pop', -> + it 'should sort an array using push and pop', -> + heap = new Heap + heap.push(random()) for i in [1..10] + sorted = (heap.pop() until heap.empty()) + sorted.slice().sort().should.eql(sorted) + + it 'should work with custom comparison function', -> + cmp = (a, b) -> + return -1 if a > b + return 1 if a < b + 0 + heap = new Heap(cmp) + heap.push(random()) for i in [1..10] + sorted = (heap.pop() until heap.empty()) + sorted.slice().sort().reverse().should.eql(sorted) + +describe 'Heap#replace', -> + it 'should behave like pop() followed by push()', -> + heap = new Heap + heap.push(v) for v in [1..5] + heap.replace(3).should.eql(1) + heap.toArray().sort().should.eql([2,3,3,4,5]) + +describe 'Heap#pushpop', -> + it 'should behave like push() followed by pop()', -> + heap = new Heap + heap.push(v) for v in [1..5] + heap.pushpop(6).should.eql(1) + heap.toArray().sort().should.eql([2..6]) + +describe 'Heap#contains', -> + it 'should return whether it contains the value', -> + heap = new Heap + heap.push(v) for v in [1..5] + heap.contains(v).should.be.true for v in [1..5] + heap.contains(0).should.be.false + heap.contains(6).should.be.false + +describe 'Heap#peek', -> + it 'should return the top value', -> + heap = new Heap + heap.push(1) + heap.peek().should.eql(1) + heap.push(2) + heap.peek().should.eql(1) + heap.pop() + heap.peek().should.eql(2) + +describe 'Heap#clone', -> + it 'should return a cloned heap', -> + a = new Heap + a.push(v) for v in [1..5] + b = a.clone() + a.toArray().should.eql(b.toArray()) + +describe 'Heap.nsmallest', -> + it 'should return exactly n elements when size() >= n', -> + Heap.nsmallest([1..10], 3).should.eql([1..3]) + + array = [1,3,2,1,3,4,4,2,3,4,5,1,2,3,4,5,2,1,3,4,5,6,7,2] + Heap.nsmallest(array, 2).should.eql([1, 1]) + + it 'should return size() elements when size() <= n', -> + Heap.nsmallest([3..1], 10).should.eql([1..3]) + +describe 'Heap.nlargest', -> + it 'should return exactly n elements when size() >= n', -> + Heap.nlargest([1..10], 3).should.eql([10..8]) + + it 'should return size() elements when size() <= n', -> + Heap.nlargest([3..1], 10).should.eql([3..1]) + +describe 'Heap#updateItem', -> + it 'should return correct order', -> + a = x: 1 + b = x: 2 + c = x: 3 + h = new Heap (m, n) -> m.x - n.x + h.push(a) + h.push(b) + h.push(c) + c.x = 0 + h.updateItem(c) + h.pop().should.eql(c) + it 'should return correct order when used statically', -> + a = x: 1 + b = x: 2 + c = x: 3 + h = [] + cmp = (m, n) -> m.x - n.x + Heap.push(h, a, cmp) + Heap.push(h, b, cmp) + Heap.push(h, c, cmp) + c.x = 0 + Heap.updateItem(h, c, cmp) + Heap.pop(h, cmp).should.eql(c) diff --git a/node_modules/hmac-drbg/.npmignore b/node_modules/hmac-drbg/.npmignore new file mode 100644 index 000000000..1ca957177 --- /dev/null +++ b/node_modules/hmac-drbg/.npmignore @@ -0,0 +1,2 @@ +node_modules/ +npm-debug.log diff --git a/node_modules/hmac-drbg/.travis.yml b/node_modules/hmac-drbg/.travis.yml new file mode 100644 index 000000000..ce24b7a77 --- /dev/null +++ b/node_modules/hmac-drbg/.travis.yml @@ -0,0 +1,11 @@ +sudo: false + +language: node_js + +node_js: + - "4" + - "6" + - "stable" + +script: + - npm test diff --git a/node_modules/hmac-drbg/README.md b/node_modules/hmac-drbg/README.md new file mode 100644 index 000000000..7323899fc --- /dev/null +++ b/node_modules/hmac-drbg/README.md @@ -0,0 +1,48 @@ +# hmac-drbg +[![Build Status](https://secure.travis-ci.org/indutny/hmac-drbg.svg)](http://travis-ci.org/indutny/hmac-drbg) +[![NPM version](https://badge.fury.io/js/hmac-drbg.svg)](http://badge.fury.io/js/hmac-drbg) + +JS-only implementation of [HMAC DRBG][0]. + +## Usage + +```js +const DRBG = require('hmac-drbg'); +const hash = require('hash.js'); + +const d = new DRBG({ + hash: hash.sha256, + entropy: '0123456789abcdef', + nonce: '0123456789abcdef', + pers: '0123456789abcdef' /* or `null` */ +}); + +d.generate(32, 'hex'); +``` + +#### LICENSE + +This software is licensed under the MIT License. + +Copyright Fedor Indutny, 2017. + +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. + +[0]: http://csrc.nist.gov/groups/ST/toolkit/documents/rng/HashBlockCipherDRBG.pdf diff --git a/node_modules/hmac-drbg/lib/hmac-drbg.js b/node_modules/hmac-drbg/lib/hmac-drbg.js new file mode 100644 index 000000000..9051a52cd --- /dev/null +++ b/node_modules/hmac-drbg/lib/hmac-drbg.js @@ -0,0 +1,113 @@ +'use strict'; + +var hash = require('hash.js'); +var utils = require('minimalistic-crypto-utils'); +var assert = require('minimalistic-assert'); + +function HmacDRBG(options) { + if (!(this instanceof HmacDRBG)) + return new HmacDRBG(options); + this.hash = options.hash; + this.predResist = !!options.predResist; + + this.outLen = this.hash.outSize; + this.minEntropy = options.minEntropy || this.hash.hmacStrength; + + this._reseed = null; + this.reseedInterval = null; + this.K = null; + this.V = null; + + var entropy = utils.toArray(options.entropy, options.entropyEnc || 'hex'); + var nonce = utils.toArray(options.nonce, options.nonceEnc || 'hex'); + var pers = utils.toArray(options.pers, options.persEnc || 'hex'); + assert(entropy.length >= (this.minEntropy / 8), + 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits'); + this._init(entropy, nonce, pers); +} +module.exports = HmacDRBG; + +HmacDRBG.prototype._init = function init(entropy, nonce, pers) { + var seed = entropy.concat(nonce).concat(pers); + + this.K = new Array(this.outLen / 8); + this.V = new Array(this.outLen / 8); + for (var i = 0; i < this.V.length; i++) { + this.K[i] = 0x00; + this.V[i] = 0x01; + } + + this._update(seed); + this._reseed = 1; + this.reseedInterval = 0x1000000000000; // 2^48 +}; + +HmacDRBG.prototype._hmac = function hmac() { + return new hash.hmac(this.hash, this.K); +}; + +HmacDRBG.prototype._update = function update(seed) { + var kmac = this._hmac() + .update(this.V) + .update([ 0x00 ]); + if (seed) + kmac = kmac.update(seed); + this.K = kmac.digest(); + this.V = this._hmac().update(this.V).digest(); + if (!seed) + return; + + this.K = this._hmac() + .update(this.V) + .update([ 0x01 ]) + .update(seed) + .digest(); + this.V = this._hmac().update(this.V).digest(); +}; + +HmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) { + // Optional entropy enc + if (typeof entropyEnc !== 'string') { + addEnc = add; + add = entropyEnc; + entropyEnc = null; + } + + entropy = utils.toArray(entropy, entropyEnc); + add = utils.toArray(add, addEnc); + + assert(entropy.length >= (this.minEntropy / 8), + 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits'); + + this._update(entropy.concat(add || [])); + this._reseed = 1; +}; + +HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) { + if (this._reseed > this.reseedInterval) + throw new Error('Reseed is required'); + + // Optional encoding + if (typeof enc !== 'string') { + addEnc = add; + add = enc; + enc = null; + } + + // Optional additional data + if (add) { + add = utils.toArray(add, addEnc || 'hex'); + this._update(add); + } + + var temp = []; + while (temp.length < len) { + this.V = this._hmac().update(this.V).digest(); + temp = temp.concat(this.V); + } + + var res = temp.slice(0, len); + this._update(add); + this._reseed++; + return utils.encode(res, enc); +}; diff --git a/node_modules/hmac-drbg/package.json b/node_modules/hmac-drbg/package.json new file mode 100644 index 000000000..cad634476 --- /dev/null +++ b/node_modules/hmac-drbg/package.json @@ -0,0 +1,60 @@ +{ + "_from": "hmac-drbg@^1.0.0", + "_id": "hmac-drbg@1.0.1", + "_inBundle": false, + "_integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "_location": "/hmac-drbg", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "hmac-drbg@^1.0.0", + "name": "hmac-drbg", + "escapedName": "hmac-drbg", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/elliptic" + ], + "_resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "_shasum": "d2745701025a6c775a6c545793ed502fc0c649a1", + "_spec": "hmac-drbg@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/elliptic", + "author": { + "name": "Fedor Indutny", + "email": "fedor@indutny.com" + }, + "bugs": { + "url": "https://github.com/indutny/hmac-drbg/issues" + }, + "bundleDependencies": false, + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + }, + "deprecated": false, + "description": "Deterministic random bit generator (hmac)", + "devDependencies": { + "mocha": "^3.2.0" + }, + "homepage": "https://github.com/indutny/hmac-drbg#readme", + "keywords": [ + "hmac", + "drbg", + "prng" + ], + "license": "MIT", + "main": "lib/hmac-drbg.js", + "name": "hmac-drbg", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/indutny/hmac-drbg.git" + }, + "scripts": { + "test": "mocha --reporter=spec test/*-test.js" + }, + "version": "1.0.1" +} diff --git a/node_modules/hmac-drbg/test/drbg-test.js b/node_modules/hmac-drbg/test/drbg-test.js new file mode 100644 index 000000000..14fd28a84 --- /dev/null +++ b/node_modules/hmac-drbg/test/drbg-test.js @@ -0,0 +1,91 @@ +'use strict'; + +const assert = require('assert'); +const HmacDRBG = require('../'); +const hash = require('hash.js'); + +describe('Hmac_DRBG', () => { + it('should support hmac-drbg-sha256', () => { + function doDrbg(opt) { + const drbg = HmacDRBG({ + hash: hash.sha256, + entropy: opt.entropy, + entropyEnc: 'utf8', + nonce: opt.nonce, + nonceEnc: 'utf8', + pers: opt.pers, + persEnc: 'utf8' + }); + return drbg.generate(opt.size, 'hex'); + } + + const test = [ + { + entropy: 'totally random0123456789', + nonce: 'secret nonce', + pers: 'my drbg', + size: 32, + res: '018ec5f8e08c41e5ac974eb129ac297c5388ee1864324fa13d9b15cf98d9a157' + }, + { + entropy: 'totally random0123456789', + nonce: 'secret nonce', + pers: null, + size: 32, + res: 'ed5d61ecf0ef38258e62f03bbb49f19f2cd07ba5145a840d83b134d5963b3633' + } + ]; + for (let i = 0; i < test.length; i++) + assert.equal(doDrbg(test[i]), test[i].res); + }); + + describe('NIST vector', function() { + require('./fixtures/hmac-drbg-nist.json').forEach(function (opt) { + it('should not fail at ' + opt.name, function() { + const drbg = HmacDRBG({ + hash: hash.sha256, + entropy: opt.entropy, + nonce: opt.nonce, + pers: opt.pers + }); + + let last; + for (let i = 0; i < opt.add.length; i++) { + let add = opt.add[i]; + last = drbg.generate(opt.expected.length / 2, 'hex', add); + } + assert.equal(last, opt.expected); + }); + }); + }); + + describe('reseeding', function() { + it('should reseed', function() { + const entropy = 'totally random string with many chars that I typed ' + + 'in agony'; + const nonce = 'nonce'; + const pers = 'pers'; + + const original = HmacDRBG({ + hash: hash.sha256, + entropy, + nonce, + pers + }); + const reseeded = HmacDRBG({ + hash: hash.sha256, + entropy, + nonce, + pers + }); + + assert.strictEqual(original.generate(32, 'hex'), + reseeded.generate(32, 'hex')); + + reseeded.reseed('another absolutely random string'); + + assert.notEqual(original.generate(32, 'hex'), + reseeded.generate(32, 'hex')); + }); + }); +}); diff --git a/node_modules/hmac-drbg/test/fixtures/hmac-drbg-nist.json b/node_modules/hmac-drbg/test/fixtures/hmac-drbg-nist.json new file mode 100644 index 000000000..fce148a8e --- /dev/null +++ b/node_modules/hmac-drbg/test/fixtures/hmac-drbg-nist.json @@ -0,0 +1,332 @@ +[ + { + "name": "0", + "entropy": "ca851911349384bffe89de1cbdc46e6831e44d34a4fb935ee285dd14b71a7488", + "nonce": "659ba96c601dc69fc902940805ec0ca8", + "pers": null, + "add": [ + null, + null + ], + "expected": "e528e9abf2dece54d47c7e75e5fe302149f817ea9fb4bee6f4199697d04d5b89d54fbb978a15b5c443c9ec21036d2460b6f73ebad0dc2aba6e624abf07745bc107694bb7547bb0995f70de25d6b29e2d3011bb19d27676c07162c8b5ccde0668961df86803482cb37ed6d5c0bb8d50cf1f50d476aa0458bdaba806f48be9dcb8" + }, + { + "name": "1", + "entropy": "79737479ba4e7642a221fcfd1b820b134e9e3540a35bb48ffae29c20f5418ea3", + "nonce": "3593259c092bef4129bc2c6c9e19f343", + "pers": null, + "add": [ + null, + null + ], + "expected": "cf5ad5984f9e43917aa9087380dac46e410ddc8a7731859c84e9d0f31bd43655b924159413e2293b17610f211e09f770f172b8fb693a35b85d3b9e5e63b1dc252ac0e115002e9bedfb4b5b6fd43f33b8e0eafb2d072e1a6fee1f159df9b51e6c8da737e60d5032dd30544ec51558c6f080bdbdab1de8a939e961e06b5f1aca37" + }, + { + "name": "2", + "entropy": "b340907445b97a8b589264de4a17c0bea11bb53ad72f9f33297f05d2879d898d", + "nonce": "65cb27735d83c0708f72684ea58f7ee5", + "pers": null, + "add": [ + null, + null + ], + "expected": "75183aaaf3574bc68003352ad655d0e9ce9dd17552723b47fab0e84ef903694a32987eeddbdc48efd24195dbdac8a46ba2d972f5808f23a869e71343140361f58b243e62722088fe10a98e43372d252b144e00c89c215a76a121734bdc485486f65c0b16b8963524a3a70e6f38f169c12f6cbdd169dd48fe4421a235847a23ff" + }, + { + "name": "3", + "entropy": "8e159f60060a7d6a7e6fe7c9f769c30b98acb1240b25e7ee33f1da834c0858e7", + "nonce": "c39d35052201bdcce4e127a04f04d644", + "pers": null, + "add": [ + null, + null + ], + "expected": "62910a77213967ea93d6457e255af51fc79d49629af2fccd81840cdfbb4910991f50a477cbd29edd8a47c4fec9d141f50dfde7c4d8fcab473eff3cc2ee9e7cc90871f180777a97841597b0dd7e779eff9784b9cc33689fd7d48c0dcd341515ac8fecf5c55a6327aea8d58f97220b7462373e84e3b7417a57e80ce946d6120db5" + }, + { + "name": "4", + "entropy": "74755f196305f7fb6689b2fe6835dc1d81484fc481a6b8087f649a1952f4df6a", + "nonce": "c36387a544a5f2b78007651a7b74b749", + "pers": null, + "add": [ + null, + null + ], + "expected": "b2896f3af4375dab67e8062d82c1a005ef4ed119d13a9f18371b1b873774418684805fd659bfd69964f83a5cfe08667ddad672cafd16befffa9faed49865214f703951b443e6dca22edb636f3308380144b9333de4bcb0735710e4d9266786342fc53babe7bdbe3c01a3addb7f23c63ce2834729fabbd419b47beceb4a460236" + }, + { + "name": "5", + "entropy": "4b222718f56a3260b3c2625a4cf80950b7d6c1250f170bd5c28b118abdf23b2f", + "nonce": "7aed52d0016fcaef0b6492bc40bbe0e9", + "pers": null, + "add": [ + null, + null + ], + "expected": "a6da029b3665cd39fd50a54c553f99fed3626f4902ffe322dc51f0670dfe8742ed48415cf04bbad5ed3b23b18b7892d170a7dcf3ef8052d5717cb0c1a8b3010d9a9ea5de70ae5356249c0e098946030c46d9d3d209864539444374d8fbcae068e1d6548fa59e6562e6b2d1acbda8da0318c23752ebc9be0c1c1c5b3cf66dd967" + }, + { + "name": "6", + "entropy": "b512633f27fb182a076917e39888ba3ff35d23c3742eb8f3c635a044163768e0", + "nonce": "e2c39b84629a3de5c301db5643af1c21", + "pers": null, + "add": [ + null, + null + ], + "expected": "fb931d0d0194a97b48d5d4c231fdad5c61aedf1c3a55ac24983ecbf38487b1c93396c6b86ff3920cfa8c77e0146de835ea5809676e702dee6a78100da9aa43d8ec0bf5720befa71f82193205ac2ea403e8d7e0e6270b366dc4200be26afd9f63b7e79286a35c688c57cbff55ac747d4c28bb80a2b2097b3b62ea439950d75dff" + }, + { + "name": "7", + "entropy": "aae3ffc8605a975befefcea0a7a286642bc3b95fb37bd0eb0585a4cabf8b3d1e", + "nonce": "9504c3c0c4310c1c0746a036c91d9034", + "pers": null, + "add": [ + null, + null + ], + "expected": "2819bd3b0d216dad59ddd6c354c4518153a2b04374b07c49e64a8e4d055575dfbc9a8fcde68bd257ff1ba5c6000564b46d6dd7ecd9c5d684fd757df62d85211575d3562d7814008ab5c8bc00e7b5a649eae2318665b55d762de36eba00c2906c0e0ec8706edb493e51ca5eb4b9f015dc932f262f52a86b11c41e9a6d5b3bd431" + }, + { + "name": "8", + "entropy": "b9475210b79b87180e746df704b3cbc7bf8424750e416a7fbb5ce3ef25a82cc6", + "nonce": "24baf03599c10df6ef44065d715a93f7", + "pers": null, + "add": [ + null, + null + ], + "expected": "ae12d784f796183c50db5a1a283aa35ed9a2b685dacea97c596ff8c294906d1b1305ba1f80254eb062b874a8dfffa3378c809ab2869aa51a4e6a489692284a25038908a347342175c38401193b8afc498077e10522bec5c70882b7f760ea5946870bd9fc72961eedbe8bff4fd58c7cc1589bb4f369ed0d3bf26c5bbc62e0b2b2" + }, + { + "name": "9", + "entropy": "27838eb44ceccb4e36210703ebf38f659bc39dd3277cd76b7a9bcd6bc964b628", + "nonce": "39cfe0210db2e7b0eb52a387476e7ea1", + "pers": null, + "add": [ + null, + null + ], + "expected": "e5e72a53605d2aaa67832f97536445ab774dd9bff7f13a0d11fd27bf6593bfb52309f2d4f09d147192199ea584503181de87002f4ee085c7dc18bf32ce5315647a3708e6f404d6588c92b2dda599c131aa350d18c747b33dc8eda15cf40e95263d1231e1b4b68f8d829f86054d49cfdb1b8d96ab0465110569c8583a424a099a" + }, + { + "name": "10", + "entropy": "d7129e4f47008ad60c9b5d081ff4ca8eb821a6e4deb91608bf4e2647835373a5", + "nonce": "a72882773f78c2fc4878295840a53012", + "pers": null, + "add": [ + null, + null + ], + "expected": "0cbf48585c5de9183b7ff76557f8fc9ebcfdfde07e588a8641156f61b7952725bbee954f87e9b937513b16bba0f2e523d095114658e00f0f3772175acfcb3240a01de631c19c5a834c94cc58d04a6837f0d2782fa53d2f9f65178ee9c837222494c799e64c60406069bd319549b889fa00a0032dd7ba5b1cc9edbf58de82bfcd" + }, + { + "name": "11", + "entropy": "67fe5e300c513371976c80de4b20d4473889c9f1214bce718bc32d1da3ab7532", + "nonce": "e256d88497738a33923aa003a8d7845c", + "pers": null, + "add": [ + null, + null + ], + "expected": "b44660d64ef7bcebc7a1ab71f8407a02285c7592d755ae6766059e894f694373ed9c776c0cfc8594413eefb400ed427e158d687e28da3ecc205e0f7370fb089676bbb0fa591ec8d916c3d5f18a3eb4a417120705f3e2198154cd60648dbfcfc901242e15711cacd501b2c2826abe870ba32da785ed6f1fdc68f203d1ab43a64f" + }, + { + "name": "12", + "entropy": "de8142541255c46d66efc6173b0fe3ffaf5936c897a3ce2e9d5835616aafa2cb", + "nonce": "d01f9002c407127bc3297a561d89b81d", + "pers": null, + "add": [ + null, + null + ], + "expected": "64d1020929d74716446d8a4e17205d0756b5264867811aa24d0d0da8644db25d5cde474143c57d12482f6bf0f31d10af9d1da4eb6d701bdd605a8db74fb4e77f79aaa9e450afda50b18d19fae68f03db1d7b5f1738d2fdce9ad3ee9461b58ee242daf7a1d72c45c9213eca34e14810a9fca5208d5c56d8066bab1586f1513de7" + }, + { + "name": "13", + "entropy": "4a8e0bd90bdb12f7748ad5f147b115d7385bb1b06aee7d8b76136a25d779bcb7", + "nonce": "7f3cce4af8c8ce3c45bdf23c6b181a00", + "pers": null, + "add": [ + null, + null + ], + "expected": "320c7ca4bbeb7af977bc054f604b5086a3f237aa5501658112f3e7a33d2231f5536d2c85c1dad9d9b0bf7f619c81be4854661626839c8c10ae7fdc0c0b571be34b58d66da553676167b00e7d8e49f416aacb2926c6eb2c66ec98bffae20864cf92496db15e3b09e530b7b9648be8d3916b3c20a3a779bec7d66da63396849aaf" + }, + { + "name": "14", + "entropy": "451ed024bc4b95f1025b14ec3616f5e42e80824541dc795a2f07500f92adc665", + "nonce": "2f28e6ee8de5879db1eccd58c994e5f0", + "pers": null, + "add": [ + null, + null + ], + "expected": "3fb637085ab75f4e95655faae95885166a5fbb423bb03dbf0543be063bcd48799c4f05d4e522634d9275fe02e1edd920e26d9accd43709cb0d8f6e50aa54a5f3bdd618be23cf73ef736ed0ef7524b0d14d5bef8c8aec1cf1ed3e1c38a808b35e61a44078127c7cb3a8fd7addfa50fcf3ff3bc6d6bc355d5436fe9b71eb44f7fd" + }, + { + "name": "0 with additional data", + "entropy": "d3cc4d1acf3dde0c4bd2290d262337042dc632948223d3a2eaab87da44295fbd", + "nonce": "0109b0e729f457328aa18569a9224921", + "pers": null, + "add": [ + "3c311848183c9a212a26f27f8c6647e40375e466a0857cc39c4e47575d53f1f6", + "fcb9abd19ccfbccef88c9c39bfb3dd7b1c12266c9808992e305bc3cff566e4e4" + ], + "expected": "9c7b758b212cd0fcecd5daa489821712e3cdea4467b560ef5ddc24ab47749a1f1ffdbbb118f4e62fcfca3371b8fbfc5b0646b83e06bfbbab5fac30ea09ea2bc76f1ea568c9be0444b2cc90517b20ca825f2d0eccd88e7175538b85d90ab390183ca6395535d34473af6b5a5b88f5a59ee7561573337ea819da0dcc3573a22974" + }, + { + "name": "1 with additional data", + "entropy": "f97a3cfd91faa046b9e61b9493d436c4931f604b22f1081521b3419151e8ff06", + "nonce": "11f3a7d43595357d58120bd1e2dd8aed", + "pers": null, + "add": [ + "517289afe444a0fe5ed1a41dbbb5eb17150079bdd31e29cf2ff30034d8268e3b", + "88028d29ef80b4e6f0fe12f91d7449fe75062682e89c571440c0c9b52c42a6e0" + ], + "expected": "c6871cff0824fe55ea7689a52229886730450e5d362da5bf590dcf9acd67fed4cb32107df5d03969a66b1f6494fdf5d63d5b4d0d34ea7399a07d0116126d0d518c7c55ba46e12f62efc8fe28a51c9d428e6d371d7397ab319fc73ded4722e5b4f30004032a6128df5e7497ecf82ca7b0a50e867ef6728a4f509a8c859087039c" + }, + { + "name": "2 with additional data", + "entropy": "0f2f23d64f481cabec7abb01db3aabf125c3173a044b9bf26844300b69dcac8b", + "nonce": "9a5ae13232b43aa19cfe8d7958b4b590", + "pers": null, + "add": [ + "ec4c7a62acab73385f567da10e892ff395a0929f959231a5628188ce0c26e818", + "6b97b8c6b6bb8935e676c410c17caa8042aa3145f856d0a32b641e4ae5298648" + ], + "expected": "7480a361058bd9afa3db82c9d7586e42269102013f6ec5c269b6d05f17987847748684766b44918fd4b65e1648622fc0e0954178b0279dfc9fa99b66c6f53e51c4860131e9e0644287a4afe4ca8e480417e070db68008a97c3397e4b320b5d1a1d7e1d18a95cfedd7d1e74997052bf649d132deb9ec53aae7dafdab55e6dae93" + }, + { + "name": "3 with additional data", + "entropy": "53c56660c78481be9c63284e005fcc14fbc7fb27732c9bf1366d01a426765a31", + "nonce": "dc7a14d0eb5b0b3534e717a0b3c64614", + "pers": null, + "add": [ + "3aa848706ecb877f5bedf4ffc332d57c22e08747a47e75cff6f0fd1316861c95", + "9a401afa739b8f752fddacd291e0b854f5eff4a55b515e20cb319852189d3722" + ], + "expected": "5c0eb420e0bf41ce9323e815310e4e8303cd677a8a8b023f31f0d79f0ca15aeb636099a369fd074d69889865eac1b72ab3cbfebdb8cf460b00072802e2ec648b1349a5303be4ccaadd729f1a9ea17482fd026aaeb93f1602bc1404b9853adde40d6c34b844cf148bc088941ecfc1642c8c0b9778e45f3b07e06e21ee2c9e0300" + }, + { + "name": "4 with additional data", + "entropy": "f63c804404902db334c54bb298fc271a21d7acd9f770278e089775710bf4fdd7", + "nonce": "3e45009ea9cb2a36ba1aa4bf39178200", + "pers": null, + "add": [ + "d165a13dc8cc43f3f0952c3f5d3de4136954d983683d4a3e6d2dc4c89bf23423", + "75106bc86d0336df85097f6af8e80e2da59046a03fa65b06706b8bbc7ffc6785" + ], + "expected": "6363139bba32c22a0f5cd23ca6d437b5669b7d432f786b8af445471bee0b2d24c9d5f2f93717cbe00d1f010cc3b9c515fc9f7336d53d4d26ba5c0d76a90186663c8582eb739c7b6578a3328bf68dc2cec2cd89b3a90201f6993adcc854df0f5c6974d0f5570765a15fe03dbce28942dd2fd16ba2027e68abac83926969349af8" + }, + { + "name": "5 with additional data", + "entropy": "2aaca9147da66c176615726b69e3e851cc3537f5f279fe7344233d8e44cfc99d", + "nonce": "4e171f080af9a6081bee9f183ac9e340", + "pers": null, + "add": [ + "d75a2a6eb66c3833e50f5ec3d2e434cf791448d618026d0c360806d120ded669", + "b643b74c15b37612e6577ed7ca2a4c67a78d560af9eb50a4108fca742e87b8d6" + ], + "expected": "501dcdc977f4ba856f24eaa4968b374bebb3166b280334cb510232c31ebffde10fa47b7840ef3fe3b77725c2272d3a1d4219baf23e0290c622271edcced58838cf428f0517425d2e19e0d8c89377eecfc378245f283236fafa466c914b99672ceafab369e8889a0c866d8bd639db9fb797254262c6fd44cfa9045ad6340a60ef" + }, + { + "name": "6 with additional data", + "entropy": "a2e4cd48a5cf918d6f55942d95fcb4e8465cdc4f77b7c52b6fae5b16a25ca306", + "nonce": "bef036716440db6e6d333d9d760b7ca8", + "pers": null, + "add": [ + "bfa591c7287f3f931168f95e38869441d1f9a11035ad8ea625bb61b9ea17591c", + "c00c735463bca215adc372cb892b05e939bf669583341c06d4e31d0e5b363a37" + ], + "expected": "e7d136af69926a5421d4266ee0420fd729f2a4f7c295d3c966bdfa05268180b508b8a2852d1b3a06fd2ab3e13c54005123ef319f42d0c6d3a575e6e7e1496cb28aacadbcf83740fba8f35fcee04bb2ed8a51db3d3362b01094a62fb57e33c99a432f29fce6676cffbbcc05107e794e75e44a02d5e6d9d748c5fbff00a0178d65" + }, + { + "name": "7 with additional data", + "entropy": "95a67771cba69011a79776e713145d309edae56fad5fd6d41d83eaff89df6e5e", + "nonce": "be5b5164e31ecc51ba6f7c3c5199eb33", + "pers": null, + "add": [ + "065f693b229a7c4fd373cd15b3807552dd9bf98c5485cef361949d4e7d774b53", + "9afb62406f0e812c4f156d58b19a656c904813c1b4a45a0029ae7f50731f8014" + ], + "expected": "f61b61a6e79a41183e8ed6647899d2dc85cdaf5c3abf5c7f3bf37685946dc28f4923dc842f2d4326bd6ce0d50a84cb3ba869d72a36e246910eba6512ba36cd7ed3a5437c9245b00a344308c792b668b458d3c3e16dee2fbec41867da31084d46d8ec168de2148ef64fc5b72069abf5a6ada1ead2b7146bb793ff1c9c3690fa56" + }, + { + "name": "8 with additional data", + "entropy": "a459e1815cbca4514ec8094d5ab2414a557ba6fe10e613c345338d0521e4bf90", + "nonce": "62221392e2552e76cd0d36df6e6068eb", + "pers": null, + "add": [ + "0a3642b02b23b3ef62c701a63401124022f5b896de86dab6e6c7451497aa1dcc", + "c80514865901371c45ba92d9f95d50bb7c9dd1768cb3dfbc45b968da94965c6e" + ], + "expected": "464e6977b8adaef307c9623e41c357013249c9ffd77f405f3925cebb69f151ce8fbb6a277164002aee7858fc224f6499042aa1e6322deee9a5d133c31d640e12a7487c731ba03ad866a24675badb1d79220c40be689f79c2a0be93cb4dada3e0eac4ab140cb91998b6f11953e68f2319b050c40f71c34de9905ae41b2de1c2f6" + }, + { + "name": "9 with additional data", + "entropy": "252c2cad613e002478162861880979ee4e323025eebb6fb2e0aa9f200e28e0a1", + "nonce": "d001bc9a8f2c8c242e4369df0c191989", + "pers": null, + "add": [ + "9bcfc61cb2bc000034bb3db980eb47c76fb5ecdd40553eff113368d639b947fd", + "8b0565c767c2610ee0014582e9fbecb96e173005b60e9581503a6dca5637a26e" + ], + "expected": "e96c15fe8a60692b0a7d67171e0195ff6e1c87aab844221e71700d1bbee75feea695f6a740c9760bbe0e812ecf4061d8f0955bc0195e18c4fd1516ebca50ba6a6db86881737dbab8321707675479b87611db6af2c97ea361a5484555ead454defb1a64335de964fc803d40f3a6f057893d2afc25725754f4f00abc51920743dc" + }, + { + "name": "10 with additional data", + "entropy": "8be0ca6adc8b3870c9d69d6021bc1f1d8eb9e649073d35ee6c5aa0b7e56ad8a5", + "nonce": "9d1265f7d51fdb65377f1e6edd6ae0e4", + "pers": null, + "add": [ + "da86167ac997c406bb7979f423986a84ec6614d6caa7afc10aff0699a9b2cf7f", + "e4baa3c555950b53e2bfdba480cb4c94b59381bac1e33947e0c22e838a9534cf" + ], + "expected": "64384ecc4ea6b458efc227ca697eac5510092265520c0a0d8a0ccf9ed3ca9d58074671188c6a7ad16d0b050cdc072c125d7298d3a31d9f044a9ee40da0089a84fea28cc7f05f1716db952fad29a0e779635cb7a912a959be67be2f0a4170aace2981802e2ff6467e5b46f0ffbff3b42ba5935fd553c82482ac266acf1cd247d7" + }, + { + "name": "11 with additional data", + "entropy": "d43a75b6adf26d60322284cb12ac38327792442aa8f040f60a2f331b33ac4a8f", + "nonce": "0682f8b091f811afacaacaec9b04d279", + "pers": null, + "add": [ + "7fd3b8f512940da7de5d80199d9a7b42670c04a945775a3dba869546cbb9bc65", + "2575db20bc7aafc2a90a5dabab760db851d754777bc9f05616af1858b24ff3da" + ], + "expected": "0da7a8dc73c163014bf0841913d3067806456bbca6d5de92b85534c6545467313648d71ef17c923d090dc92cff8d4d1a9a2bb63e001dc2e8ab1a597999be3d6cf70ff63fee9985801395fbd4f4990430c4259fcae4fa1fcd73dc3187ccc102d04af7c07532885e5a226fc42809c48f22eecf4f6ab996ae4fcb144786957d9f41" + }, + { + "name": "12 with additional data", + "entropy": "64352f236af5d32067a529a8fd05ba00a338c9de306371a0b00c36e610a48d18", + "nonce": "df99ed2c7608c870624b962a5dc68acd", + "pers": null, + "add": [ + "da416335e7aaf60cf3d06fb438735ce796aad09034f8969c8f8c3f81e32fef24", + "a28c07c21a2297311adf172c19e83ca0a87731bdffb80548978d2d1cd82cf8a3" + ], + "expected": "132b9f25868729e3853d3c51f99a3b5fae6d4204bea70890daf62e042b776a526c8fb831b80a6d5d3f153237df1fd39b6fd9137963f5516d9cdd4e3f9195c46e9972c15d3edc6606e3368bde1594977fb88d0ca6e6f5f3d057ccadc7d7dab77dfc42658a1e972aa446b20d418286386a52dfc1c714d2ac548713268b0b709729" + }, + { + "name": "13 with additional data", + "entropy": "282f4d2e05a2cd30e9087f5633089389449f04bac11df718c90bb351cd3653a5", + "nonce": "90a7daf3c0de9ea286081efc4a684dfb", + "pers": null, + "add": [ + "2630b4ccc7271cc379cb580b0aaede3d3aa8c1c7ba002cf791f0752c3d739007", + "c31d69de499f1017be44e3d4fa77ecebc6a9b9934749fcf136f267b29115d2cc" + ], + "expected": "c899094520e0197c37b91dd50778e20a5b950decfb308d39f1db709447ae48f6101d9abe63a783fbb830eec1d359a5f61a2013728966d349213ee96382614aa4135058a967627183810c6622a2158cababe3b8ab99169c89e362108bf5955b4ffc47440f87e4bad0d36bc738e737e072e64d8842e7619f1be0af1141f05afe2d" + }, + { + "name": "14 with additional data", + "entropy": "13c752b9e745ce77bbc7c0dbda982313d3fe66f903e83ebd8dbe4ff0c11380e9", + "nonce": "f1a533095d6174164bd7c82532464ae7", + "pers": null, + "add": [ + "4f53db89b9ba7fc00767bc751fb8f3c103fe0f76acd6d5c7891ab15b2b7cf67c", + "582c2a7d34679088cca6bd28723c99aac07db46c332dc0153d1673256903b446" + ], + "expected": "6311f4c0c4cd1f86bd48349abb9eb930d4f63df5e5f7217d1d1b91a71d8a6938b0ad2b3e897bd7e3d8703db125fab30e03464fad41e5ddf5bf9aeeb5161b244468cfb26a9d956931a5412c97d64188b0da1bd907819c686f39af82e91cfeef0cbffb5d1e229e383bed26d06412988640706815a6e820796876f416653e464961" + } +] diff --git a/node_modules/htmlescape/.npmignore b/node_modules/htmlescape/.npmignore new file mode 100644 index 000000000..e2a6af879 --- /dev/null +++ b/node_modules/htmlescape/.npmignore @@ -0,0 +1,4 @@ +/.gitignore +/CHANGELOG.md +/LICENSE +/test diff --git a/node_modules/htmlescape/CHANGELOG.md b/node_modules/htmlescape/CHANGELOG.md new file mode 100644 index 000000000..d03d62042 --- /dev/null +++ b/node_modules/htmlescape/CHANGELOG.md @@ -0,0 +1,9 @@ +1.0.0 / 2014-09-29 +================== + + * No more API changes + +0.0.1 / 2014-09-28 +================== + + * Initial release diff --git a/node_modules/htmlescape/LICENSE b/node_modules/htmlescape/LICENSE new file mode 100644 index 000000000..bdff13e87 --- /dev/null +++ b/node_modules/htmlescape/LICENSE @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright (c) 2014 Andres Suarez + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/htmlescape/README.md b/node_modules/htmlescape/README.md new file mode 100644 index 000000000..870ba1669 --- /dev/null +++ b/node_modules/htmlescape/README.md @@ -0,0 +1,30 @@ +# htmlescape + +Properly escape JSON for usage as an object literal inside of a ` +``` diff --git a/node_modules/htmlescape/htmlescape.js b/node_modules/htmlescape/htmlescape.js new file mode 100644 index 000000000..5f0ce6c72 --- /dev/null +++ b/node_modules/htmlescape/htmlescape.js @@ -0,0 +1,42 @@ +/** + * Properly escape JSON for usage as an object literal inside of a ` + + diff --git a/node_modules/hyperx/example/deku/main.js b/node_modules/hyperx/example/deku/main.js new file mode 100644 index 000000000..15cff4505 --- /dev/null +++ b/node_modules/hyperx/example/deku/main.js @@ -0,0 +1,23 @@ +var deku = require('deku') +var hyperx = require('../..') +var hx = hyperx(deku.element) + +var render = deku.createApp(document.querySelector('#content')) + +var state = { + times: 0 +} + +rerender() + +function rerender () { + render(hx`
+

clicked ${state.times} times

+ +
`) + + function increment () { + state.times += 1 + rerender() + } +} diff --git a/node_modules/hyperx/example/deku/package.json b/node_modules/hyperx/example/deku/package.json new file mode 100644 index 000000000..851145e48 --- /dev/null +++ b/node_modules/hyperx/example/deku/package.json @@ -0,0 +1,6 @@ +{ + "scripts": { + "watch": "watchify main.js -o bundle.js -dv", + "build": "browserify main.js > bundle.js" + } +} diff --git a/node_modules/hyperx/example/hyperscript.js b/node_modules/hyperx/example/hyperscript.js new file mode 100644 index 000000000..9e43a283e --- /dev/null +++ b/node_modules/hyperx/example/hyperscript.js @@ -0,0 +1,15 @@ +var h = require('hyperscript') +var hyperx = require('../') +var hx = hyperx(h) + +var title = 'world' +var wow = [1,2,3] +var tree = hx`
+

hello ${title}!

+ ${hx`cool`} + wow + ${wow.map(function (w) { + return hx`${w}\n` + })} +
` +console.log(tree.outerHTML) diff --git a/node_modules/hyperx/example/main_loop/index.html b/node_modules/hyperx/example/main_loop/index.html new file mode 100644 index 000000000..f170d108e --- /dev/null +++ b/node_modules/hyperx/example/main_loop/index.html @@ -0,0 +1,6 @@ + + +
+ + + diff --git a/node_modules/hyperx/example/main_loop/main.js b/node_modules/hyperx/example/main_loop/main.js new file mode 100644 index 000000000..3ed6fb4e9 --- /dev/null +++ b/node_modules/hyperx/example/main_loop/main.js @@ -0,0 +1,18 @@ +var vdom = require('virtual-dom') +var hyperx = require('../../') +var hx = hyperx(vdom.h) + +var main = require('main-loop') +var loop = main({ times: 0 }, render, vdom) +document.querySelector('#content').appendChild(loop.target) + +function render (state) { + return hx`
+

clicked ${state.times} times

+ +
` + + function onclick () { + loop.update({ times: state.times + 1 }) + } +} diff --git a/node_modules/hyperx/example/main_loop/package.json b/node_modules/hyperx/example/main_loop/package.json new file mode 100644 index 000000000..851145e48 --- /dev/null +++ b/node_modules/hyperx/example/main_loop/package.json @@ -0,0 +1,6 @@ +{ + "scripts": { + "watch": "watchify main.js -o bundle.js -dv", + "build": "browserify main.js > bundle.js" + } +} diff --git a/node_modules/hyperx/example/react.js b/node_modules/hyperx/example/react.js new file mode 100644 index 000000000..88bbd779d --- /dev/null +++ b/node_modules/hyperx/example/react.js @@ -0,0 +1,16 @@ +var React = require('react') +var toString = require('react-dom/server').renderToString +var hyperx = require('../') +var hx = hyperx(React.createElement) + +var title = 'world' +var wow = [1,2,3] +var tree = hx`
+

hello ${title}!

+ ${hx`cool`} + wow + ${wow.map(function (w, i) { + return hx`${w}\n` + })} +
` +console.log(toString(tree)) diff --git a/node_modules/hyperx/example/react_browser/index.html b/node_modules/hyperx/example/react_browser/index.html new file mode 100644 index 000000000..f170d108e --- /dev/null +++ b/node_modules/hyperx/example/react_browser/index.html @@ -0,0 +1,6 @@ + + +
+ + + diff --git a/node_modules/hyperx/example/react_browser/main.js b/node_modules/hyperx/example/react_browser/main.js new file mode 100644 index 000000000..983e68eaf --- /dev/null +++ b/node_modules/hyperx/example/react_browser/main.js @@ -0,0 +1,18 @@ +var React = require('react') +var render = require('react-dom').render +var hyperx = require('../../') +var hx = hyperx(React.createElement) + +var App = React.createClass({ + getInitialState: function () { return { n: 0 } }, + render: function () { + return hx`
+

clicked ${this.state.n} times

+ +
` + }, + handleClick: function () { + this.setState({ n: this.state.n + 1 }) + } +}) +render(React.createElement(App), document.querySelector('#content')) diff --git a/node_modules/hyperx/example/react_browser/package.json b/node_modules/hyperx/example/react_browser/package.json new file mode 100644 index 000000000..851145e48 --- /dev/null +++ b/node_modules/hyperx/example/react_browser/package.json @@ -0,0 +1,6 @@ +{ + "scripts": { + "watch": "watchify main.js -o bundle.js -dv", + "build": "browserify main.js > bundle.js" + } +} diff --git a/node_modules/hyperx/example/vdom.js b/node_modules/hyperx/example/vdom.js new file mode 100644 index 000000000..d7e771449 --- /dev/null +++ b/node_modules/hyperx/example/vdom.js @@ -0,0 +1,15 @@ +var vdom = require('virtual-dom') +var hyperx = require('../') +var hx = hyperx(vdom.h) + +var title = 'world' +var wow = [1,2,3] +var tree = hx`
+

hello ${title}!

+ ${hx`cool`} + wow + ${wow.map(function (w, i) { + return hx`${w}\n` + })} +
` +console.log(vdom.create(tree).toString()) diff --git a/node_modules/hyperx/index.js b/node_modules/hyperx/index.js new file mode 100644 index 000000000..cf19752b7 --- /dev/null +++ b/node_modules/hyperx/index.js @@ -0,0 +1,294 @@ +var attrToProp = require('hyperscript-attribute-to-property') + +var VAR = 0, TEXT = 1, OPEN = 2, CLOSE = 3, ATTR = 4 +var ATTR_KEY = 5, ATTR_KEY_W = 6 +var ATTR_VALUE_W = 7, ATTR_VALUE = 8 +var ATTR_VALUE_SQ = 9, ATTR_VALUE_DQ = 10 +var ATTR_EQ = 11, ATTR_BREAK = 12 +var COMMENT = 13 + +module.exports = function (h, opts) { + if (!opts) opts = {} + var concat = opts.concat || function (a, b) { + return String(a) + String(b) + } + if (opts.attrToProp !== false) { + h = attrToProp(h) + } + + return function (strings) { + var state = TEXT, reg = '' + var arglen = arguments.length + var parts = [] + + for (var i = 0; i < strings.length; i++) { + if (i < arglen - 1) { + var arg = arguments[i+1] + var p = parse(strings[i]) + var xstate = state + if (xstate === ATTR_VALUE_DQ) xstate = ATTR_VALUE + if (xstate === ATTR_VALUE_SQ) xstate = ATTR_VALUE + if (xstate === ATTR_VALUE_W) xstate = ATTR_VALUE + if (xstate === ATTR) xstate = ATTR_KEY + if (xstate === OPEN) { + if (reg === '/') { + p.push([ OPEN, '/', arg ]) + reg = '' + } else { + p.push([ OPEN, arg ]) + } + } else { + p.push([ VAR, xstate, arg ]) + } + parts.push.apply(parts, p) + } else parts.push.apply(parts, parse(strings[i])) + } + + var tree = [null,{},[]] + var stack = [[tree,-1]] + for (var i = 0; i < parts.length; i++) { + var cur = stack[stack.length-1][0] + var p = parts[i], s = p[0] + if (s === OPEN && /^\//.test(p[1])) { + var ix = stack[stack.length-1][1] + if (stack.length > 1) { + stack.pop() + stack[stack.length-1][0][2][ix] = h( + cur[0], cur[1], cur[2].length ? cur[2] : undefined + ) + } + } else if (s === OPEN) { + var c = [p[1],{},[]] + cur[2].push(c) + stack.push([c,cur[2].length-1]) + } else if (s === ATTR_KEY || (s === VAR && p[1] === ATTR_KEY)) { + var key = '' + var copyKey + for (; i < parts.length; i++) { + if (parts[i][0] === ATTR_KEY) { + key = concat(key, parts[i][1]) + } else if (parts[i][0] === VAR && parts[i][1] === ATTR_KEY) { + if (typeof parts[i][2] === 'object' && !key) { + for (copyKey in parts[i][2]) { + if (parts[i][2].hasOwnProperty(copyKey) && !cur[1][copyKey]) { + cur[1][copyKey] = parts[i][2][copyKey] + } + } + } else { + key = concat(key, parts[i][2]) + } + } else break + } + if (parts[i][0] === ATTR_EQ) i++ + var j = i + for (; i < parts.length; i++) { + if (parts[i][0] === ATTR_VALUE || parts[i][0] === ATTR_KEY) { + if (!cur[1][key]) cur[1][key] = strfn(parts[i][1]) + else parts[i][1]==="" || (cur[1][key] = concat(cur[1][key], parts[i][1])); + } else if (parts[i][0] === VAR + && (parts[i][1] === ATTR_VALUE || parts[i][1] === ATTR_KEY)) { + if (!cur[1][key]) cur[1][key] = strfn(parts[i][2]) + else parts[i][2]==="" || (cur[1][key] = concat(cur[1][key], parts[i][2])); + } else { + if (key.length && !cur[1][key] && i === j + && (parts[i][0] === CLOSE || parts[i][0] === ATTR_BREAK)) { + // https://html.spec.whatwg.org/multipage/infrastructure.html#boolean-attributes + // empty string is falsy, not well behaved value in browser + cur[1][key] = key.toLowerCase() + } + if (parts[i][0] === CLOSE) { + i-- + } + break + } + } + } else if (s === ATTR_KEY) { + cur[1][p[1]] = true + } else if (s === VAR && p[1] === ATTR_KEY) { + cur[1][p[2]] = true + } else if (s === CLOSE) { + if (selfClosing(cur[0]) && stack.length) { + var ix = stack[stack.length-1][1] + stack.pop() + stack[stack.length-1][0][2][ix] = h( + cur[0], cur[1], cur[2].length ? cur[2] : undefined + ) + } + } else if (s === VAR && p[1] === TEXT) { + if (p[2] === undefined || p[2] === null) p[2] = '' + else if (!p[2]) p[2] = concat('', p[2]) + if (Array.isArray(p[2][0])) { + cur[2].push.apply(cur[2], p[2]) + } else { + cur[2].push(p[2]) + } + } else if (s === TEXT) { + cur[2].push(p[1]) + } else if (s === ATTR_EQ || s === ATTR_BREAK) { + // no-op + } else { + throw new Error('unhandled: ' + s) + } + } + + if (tree[2].length > 1 && /^\s*$/.test(tree[2][0])) { + tree[2].shift() + } + + if (tree[2].length > 2 + || (tree[2].length === 2 && /\S/.test(tree[2][1]))) { + throw new Error( + 'multiple root elements must be wrapped in an enclosing tag' + ) + } + if (Array.isArray(tree[2][0]) && typeof tree[2][0][0] === 'string' + && Array.isArray(tree[2][0][2])) { + tree[2][0] = h(tree[2][0][0], tree[2][0][1], tree[2][0][2]) + } + return tree[2][0] + + function parse (str) { + var res = [] + if (state === ATTR_VALUE_W) state = ATTR + for (var i = 0; i < str.length; i++) { + var c = str.charAt(i) + if (state === TEXT && c === '<') { + if (reg.length) res.push([TEXT, reg]) + reg = '' + state = OPEN + } else if (c === '>' && !quot(state) && state !== COMMENT) { + if (state === OPEN && reg.length) { + res.push([OPEN,reg]) + } else if (state === ATTR_KEY) { + res.push([ATTR_KEY,reg]) + } else if (state === ATTR_VALUE && reg.length) { + res.push([ATTR_VALUE,reg]) + } + res.push([CLOSE]) + reg = '' + state = TEXT + } else if (state === COMMENT && /-$/.test(reg) && c === '-') { + if (opts.comments) { + res.push([ATTR_VALUE,reg.substr(0, reg.length - 1)],[CLOSE]) + } + reg = '' + state = TEXT + } else if (state === OPEN && /^!--$/.test(reg)) { + if (opts.comments) { + res.push([OPEN, reg],[ATTR_KEY,'comment'],[ATTR_EQ]) + } + reg = c + state = COMMENT + } else if (state === TEXT || state === COMMENT) { + reg += c + } else if (state === OPEN && c === '/' && reg.length) { + // no-op, self closing tag without a space
+ } else if (state === OPEN && /\s/.test(c)) { + if (reg.length) { + res.push([OPEN, reg]) + } + reg = '' + state = ATTR + } else if (state === OPEN) { + reg += c + } else if (state === ATTR && /[^\s"'=/]/.test(c)) { + state = ATTR_KEY + reg = c + } else if (state === ATTR && /\s/.test(c)) { + if (reg.length) res.push([ATTR_KEY,reg]) + res.push([ATTR_BREAK]) + } else if (state === ATTR_KEY && /\s/.test(c)) { + res.push([ATTR_KEY,reg]) + reg = '' + state = ATTR_KEY_W + } else if (state === ATTR_KEY && c === '=') { + res.push([ATTR_KEY,reg],[ATTR_EQ]) + reg = '' + state = ATTR_VALUE_W + } else if (state === ATTR_KEY) { + reg += c + } else if ((state === ATTR_KEY_W || state === ATTR) && c === '=') { + res.push([ATTR_EQ]) + state = ATTR_VALUE_W + } else if ((state === ATTR_KEY_W || state === ATTR) && !/\s/.test(c)) { + res.push([ATTR_BREAK]) + if (/[\w-]/.test(c)) { + reg += c + state = ATTR_KEY + } else state = ATTR + } else if (state === ATTR_VALUE_W && c === '"') { + state = ATTR_VALUE_DQ + } else if (state === ATTR_VALUE_W && c === "'") { + state = ATTR_VALUE_SQ + } else if (state === ATTR_VALUE_DQ && c === '"') { + res.push([ATTR_VALUE,reg],[ATTR_BREAK]) + reg = '' + state = ATTR + } else if (state === ATTR_VALUE_SQ && c === "'") { + res.push([ATTR_VALUE,reg],[ATTR_BREAK]) + reg = '' + state = ATTR + } else if (state === ATTR_VALUE_W && !/\s/.test(c)) { + state = ATTR_VALUE + i-- + } else if (state === ATTR_VALUE && /\s/.test(c)) { + res.push([ATTR_VALUE,reg],[ATTR_BREAK]) + reg = '' + state = ATTR + } else if (state === ATTR_VALUE || state === ATTR_VALUE_SQ + || state === ATTR_VALUE_DQ) { + reg += c + } + } + if (state === TEXT && reg.length) { + res.push([TEXT,reg]) + reg = '' + } else if (state === ATTR_VALUE && reg.length) { + res.push([ATTR_VALUE,reg]) + reg = '' + } else if (state === ATTR_VALUE_DQ && reg.length) { + res.push([ATTR_VALUE,reg]) + reg = '' + } else if (state === ATTR_VALUE_SQ && reg.length) { + res.push([ATTR_VALUE,reg]) + reg = '' + } else if (state === ATTR_KEY) { + res.push([ATTR_KEY,reg]) + reg = '' + } + return res + } + } + + function strfn (x) { + if (typeof x === 'function') return x + else if (typeof x === 'string') return x + else if (x && typeof x === 'object') return x + else return concat('', x) + } +} + +function quot (state) { + return state === ATTR_VALUE_SQ || state === ATTR_VALUE_DQ +} + +var hasOwn = Object.prototype.hasOwnProperty +function has (obj, key) { return hasOwn.call(obj, key) } + +var closeRE = RegExp('^(' + [ + 'area', 'base', 'basefont', 'bgsound', 'br', 'col', 'command', 'embed', + 'frame', 'hr', 'img', 'input', 'isindex', 'keygen', 'link', 'meta', 'param', + 'source', 'track', 'wbr', '!--', + // SVG TAGS + 'animate', 'animateTransform', 'circle', 'cursor', 'desc', 'ellipse', + 'feBlend', 'feColorMatrix', 'feComposite', + 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', + 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', + 'feGaussianBlur', 'feImage', 'feMergeNode', 'feMorphology', + 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', + 'feTurbulence', 'font-face-format', 'font-face-name', 'font-face-uri', + 'glyph', 'glyphRef', 'hkern', 'image', 'line', 'missing-glyph', 'mpath', + 'path', 'polygon', 'polyline', 'rect', 'set', 'stop', 'tref', 'use', 'view', + 'vkern' +].join('|') + ')(?:[\.#][a-zA-Z0-9\u007F-\uFFFF_:-]+)*$') +function selfClosing (tag) { return closeRE.test(tag) } diff --git a/node_modules/hyperx/package.json b/node_modules/hyperx/package.json new file mode 100644 index 000000000..90f88994b --- /dev/null +++ b/node_modules/hyperx/package.json @@ -0,0 +1,70 @@ +{ + "_from": "hyperx@^2.3.0", + "_id": "hyperx@2.4.0", + "_inBundle": false, + "_integrity": "sha512-43jbOQfVkm9U0oAyBZ4Vt2eB0hZWS5EyrOhR3ZbgUrcprutGu9s/C476OVFL3QU1iynKO5s9kZsWrZm19gJKjg==", + "_location": "/hyperx", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "hyperx@^2.3.0", + "name": "hyperx", + "escapedName": "hyperx", + "rawSpec": "^2.3.0", + "saveSpec": null, + "fetchSpec": "^2.3.0" + }, + "_requiredBy": [ + "/bel" + ], + "_resolved": "https://registry.npmjs.org/hyperx/-/hyperx-2.4.0.tgz", + "_shasum": "397d6815d25785fee3c9f4968cbaafc1d8b36d39", + "_spec": "hyperx@^2.3.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/bel", + "author": { + "name": "substack" + }, + "bugs": { + "url": "https://github.com/substack/hyperx/issues" + }, + "bundleDependencies": false, + "dependencies": { + "hyperscript-attribute-to-property": "^1.0.0" + }, + "deprecated": false, + "description": "tagged template string virtual dom builder", + "devDependencies": { + "covert": "^1.1.0", + "hyperscript": "^1.4.7", + "tape": "^4.4.0", + "virtual-dom": "^2.1.1" + }, + "directories": { + "example": "example", + "test": "test" + }, + "homepage": "https://github.com/substack/hyperx#readme", + "keywords": [ + "jsx", + "virtual-dom", + "vdom", + "react", + "hyperscript", + "template string", + "template", + "es6" + ], + "license": "BSD", + "main": "index.js", + "name": "hyperx", + "repository": { + "type": "git", + "url": "git+https://github.com/substack/hyperx.git" + }, + "scripts": { + "coverage": "covert test/*.js", + "test": "tape test/*.js" + }, + "version": "2.4.0" +} diff --git a/node_modules/hyperx/readme.markdown b/node_modules/hyperx/readme.markdown new file mode 100644 index 000000000..9ebff7d33 --- /dev/null +++ b/node_modules/hyperx/readme.markdown @@ -0,0 +1,203 @@ +# hyperx + +tagged template string virtual dom builder + +This module is similar to JSX, but provided as a standards-compliant ES6 tagged +template string function. + +hyperx works with [virtual-dom](https://npmjs.com/package/virtual-dom), +[react](https://npmjs.com/package/react), +[hyperscript](https://npmjs.com/package/hyperscript), or any DOM builder with a +hyperscript-style API: `h(tagName, attrs, children)`. + +You might also want to check out the [hyperxify][2] browserify transform to +statically compile hyperx into javascript expressions to save sending the hyperx +parser down the wire. + +[2]: https://npmjs.com/package/hyperxify + +# compatibility + +[Template strings][1] are available in: +node 4+, chrome 41, firefox 34, edge, opera 28, safari 9 + +If you're targeting these platforms, there's no need to use a transpiler! + +[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/template_strings + +# examples + +## virtual-dom node example + +``` js +var vdom = require('virtual-dom') +var hyperx = require('hyperx') +var hx = hyperx(vdom.h) + +var title = 'world' +var wow = [1,2,3] +var tree = hx`
+

hello ${title}!

+ ${hx`cool`} + wow + ${wow.map(function (w, i) { + return hx`${w}\n` + })} +
` +console.log(vdom.create(tree).toString()) +``` + +output: + +``` +$ node vdom.js +
+

hello world!

+ cool + wow + 123 +
+``` + +## react node example + +``` js +var React = require('react') +var toString = require('react-dom/server').renderToString +var hyperx = require('hyperx') +var hx = hyperx(React.createElement) + +var title = 'world' +var wow = [1,2,3] +var tree = hx`
+

hello ${title}!

+ ${hx`cool`} + wow + ${wow.map(function (w, i) { + return hx`${w}\n` + })} +
` +console.log(toString(tree)) +``` + +## hyperscript node example + +``` js +var h = require('hyperscript') +var hyperx = require('hyperx') +var hx = hyperx(h) + +var title = 'world' +var wow = [1,2,3] +var tree = hx`
+

hello ${title}!

+ ${hx`cool`} + wow + ${wow.map(function (w) { + return hx`${w}\n` + })} +
` +console.log(tree.outerHTML) +``` + +## virtual-dom/main-loop browser example + +``` js +var vdom = require('virtual-dom') +var hyperx = require('hyperx') +var hx = hyperx(vdom.h) + +var main = require('main-loop') +var loop = main({ times: 0 }, render, vdom) +document.querySelector('#content').appendChild(loop.target) + +function render (state) { + return hx`
+

clicked ${state.times} times

+ +
` + + function onclick () { + loop.update({ times: state.times + 1 }) + } +} +``` + +## react browser example + +``` js +var React = require('react') +var render = require('react-dom').render +var hyperx = require('hyperx') +var hx = hyperx(React.createElement) + +var App = React.createClass({ + getInitialState: function () { return { n: 0 } }, + render: function () { + return hx`
+

clicked ${this.state.n} times

+ +
` + }, + handleClick: function () { + this.setState({ n: this.state.n + 1 }) + } +}) +render(React.createElement(App), document.querySelector('#content')) +``` + +## console.log example + +``` js +var hyperx = require('hyperx') + +var convertTaggedTemplateOutputToDomBuilder = hyperx(function (tagName, attrs, children) { + console.log(tagName, attrs, children) +}) + +convertTaggedTemplateOutputToDomBuilder`

hello world

` + +// Running this produces: h1 {} [ 'hello world' ] +``` + + +# api + +``` +var hyperx = require('hyperx') +``` + +## var hx = hyperx(h, opts={}) + +Return a tagged template function `hx` from a hyperscript-style factory function +`h`. + +Values to use for `h`: + +* virtual-dom - `vdom.h` +* react - `React.createElement` +* hyperscript - hyperscript + +Optionally provide: + +* `opts.concat(a, b)` - custom concatenation function to combine quasiliteral +strings with expressions. The `h` factory function will receive the objects +returned by the concatenation function and can make specific use of them. This +is useful if you want to implement a pre-processor to generate javascript from +hyperx syntax. +* `opts.attrToProp` - turn off attribute to property conversions when `false` + +# prior art + +* http://www.2ality.com/2014/07/jsx-template-strings.html?m=1 +* http://facebook.github.io/jsx/#why-not-template-literals (respectfully disagree) + +# license + +BSD + +# install + +``` +npm install hyperx +``` diff --git a/node_modules/hyperx/test/attr.js b/node_modules/hyperx/test/attr.js new file mode 100644 index 000000000..0cd385948 --- /dev/null +++ b/node_modules/hyperx/test/attr.js @@ -0,0 +1,76 @@ +var test = require('tape') +var vdom = require('virtual-dom') +var hyperx = require('../') +var hx = hyperx(vdom.h) + +test('class', function (t) { + var tree = hx`
` + t.equal(vdom.create(tree).toString(), '
') + t.end() +}) + +test('boolean attribute', function (t) { + var tree = hx`` + t.equal(vdom.create(tree).toString(), '') + t.end() +}) + +test('boolean attribute followed by normal attribute', function (t) { + var tree = hx`` + t.equal(vdom.create(tree).toString(), '') + t.end() +}) + +test('boolean attribute preceded by normal attribute', function (t) { + var tree = hx`` + t.equal(vdom.create(tree).toString(), '') + t.end() +}) + +test('unquoted attribute', function (t) { + var tree = hx`
` + t.equal(vdom.create(tree).toString(), '
') + t.end() +}) + +test('unquoted attribute preceded by boolean attribute', function (t) { + var tree = hx`` + t.equal(vdom.create(tree).toString(), '') + t.end() +}) + +test('unquoted attribute succeeded by boolean attribute', function (t) { + var tree = hx`` + t.equal(vdom.create(tree).toString(), '') + t.end() +}) + +test('unquoted attribute preceded by normal attribute', function (t) { + var tree = hx`
` + t.equal(vdom.create(tree).toString(), '
') + t.end() +}) + +test('unquoted attribute succeeded by normal attribute', function (t) { + var tree = hx`
` + t.equal(vdom.create(tree).toString(), '
') + t.end() +}) + +test('consecutive unquoted attributes', function (t) { + var tree = hx`
` + t.equal(vdom.create(tree).toString(), '
') + t.end() +}) + +test('strange leading character attributes', function (t) { + var tree = hx`
` + t.equal(vdom.create(tree).toString(), '
') + t.end() +}) + +test('strange inbetween character attributes', function (t) { + var tree = hx`
` + t.equal(vdom.create(tree).toString(), `
`) + t.end() +}) diff --git a/node_modules/hyperx/test/attr_to_prop.js b/node_modules/hyperx/test/attr_to_prop.js new file mode 100644 index 000000000..831fa8502 --- /dev/null +++ b/node_modules/hyperx/test/attr_to_prop.js @@ -0,0 +1,29 @@ +var test = require('tape') +var vdom = require('virtual-dom') +var hyperx = require('../') +var hx = hyperx(vdom.h) + +test('class to className', function (t) { + var tree = hx`
` + t.deepEqual(tree.properties, { className: 'wow' }) + t.end() +}) + +test('for to htmlFor', function (t) { + var tree = hx`
` + t.deepEqual(tree.properties, { htmlFor: 'wow' }) + t.end() +}) + +test('http-equiv to httpEquiv', function (t) { + var tree = hx`` + t.deepEqual(tree.properties, { content: '30', httpEquiv: 'refresh' }) + t.end() +}) + +test('no transform', t => { + var hx = hyperx(vdom.h, { attrToProp: false }) + var tree = hx`
` + t.deepEqual(tree.properties, { class: 'wow' }) + t.end() +}) diff --git a/node_modules/hyperx/test/br.js b/node_modules/hyperx/test/br.js new file mode 100644 index 000000000..b2f437efc --- /dev/null +++ b/node_modules/hyperx/test/br.js @@ -0,0 +1,10 @@ +var test = require('tape') +var vdom = require('virtual-dom') +var hyperx = require('../') +var hx = hyperx(vdom.h) + +test('self closing tags without a space', function (t) { + var tree = hx`
a
b
` + t.equal(vdom.create(tree).toString(), '
a
b
') + t.end() +}) diff --git a/node_modules/hyperx/test/children.js b/node_modules/hyperx/test/children.js new file mode 100644 index 000000000..654f368d6 --- /dev/null +++ b/node_modules/hyperx/test/children.js @@ -0,0 +1,42 @@ +var test = require('tape') +var vdom = require('virtual-dom') +var hyperx = require('../') +var hx = hyperx(vdom.h) + +test('1 child', function (t) { + var tree = hx`
foobar
` + t.equal(vdom.create(tree).toString(), '
foobar
') + t.end() +}) + +test('no children', function (t) { + var tree = hx`` + t.equal(vdom.create(tree).toString(), '') + t.end() +}) + +test('multiple children', function (t) { + var html = `
+

title

+
+ +
+
` + var tree = hx` +
+

title

+
+ +
+
` + t.equal(vdom.create(tree).toString(), html) + t.end() +}) diff --git a/node_modules/hyperx/test/comment.js b/node_modules/hyperx/test/comment.js new file mode 100644 index 000000000..f87347947 --- /dev/null +++ b/node_modules/hyperx/test/comment.js @@ -0,0 +1,51 @@ +var test = require('tape') +var hyperx = require('../') +var hx = hyperx(createElement) +var hxc = hyperx(createElement, {comments: true}) + +function createElement(tag, props, children) { + if (tag === '!--') { + return `` + } + return `<${tag}>${children ? children.join('') : ''}` +} + +test('1 comment', function (t) { + var tree = hxc`` + t.equal(tree, '') + t.end() +}) + +test('with crazy characters', function (t) { + var tree = hxc`` + t.equal(tree, '') + t.end() +}) + +test('as child', function (t) { + var tree = hxc`
` + t.equal(tree, '
') + t.end() +}) + +test('many comments', function (t) { + var html = `
+ + bar + +
` + var tree = hxc` +
+ + bar + +
` + t.equal(tree, html) + t.end() +}) + +test('excluded by default', function (t) { + var tree = hx`
` + t.equal(tree, '
') + t.end() +}) diff --git a/node_modules/hyperx/test/concat.js b/node_modules/hyperx/test/concat.js new file mode 100644 index 000000000..b8b25d3a8 --- /dev/null +++ b/node_modules/hyperx/test/concat.js @@ -0,0 +1,49 @@ +var test = require('tape') +var vdom = require('virtual-dom') +var hyperx = require('../') +var hx = hyperx(function (tagName, opts, children) { + return { + expr: 'h(' + JSON.stringify(tagName) + + ',' + JSON.stringify(opts) + + ',[' + children.map(child).join(',') + + '])' + } + function child (c) { + if (c.expr) return c.expr + else if (Array.isArray(c)) return c.map(child).join(',') + else return JSON.stringify(c) + } +}, { concat: concat }) + +function concat (a, b) { + if (!a.expr && !b.expr) return String(a) + String(b) + var aexpr, bexpr + if (a.expr) aexpr = '(' + a.expr + ')' + else aexpr = JSON.stringify(a) + if (b.expr) bexpr = '(' + b.expr + ')' + else bexpr = JSON.stringify(b) + return { expr: aexpr + '+' + bexpr } +} + +var expected = `
+

hello world!

+ cool + wow + 123 +
` + +test('vdom', function (t) { + var title = 'world' + var wow = [1,2,3] + var str = hx`
+

hello ${title}!

+ ${hx`cool`} + wow + ${wow.map(function (w, i) { + return hx`${w}\n` + })} +
`.expr + var tree = Function(['h'],'return ' + str)(vdom.h) + t.equal(vdom.create(tree).toString(), expected) + t.end() +}) diff --git a/node_modules/hyperx/test/esc.js b/node_modules/hyperx/test/esc.js new file mode 100644 index 000000000..65be7e22f --- /dev/null +++ b/node_modules/hyperx/test/esc.js @@ -0,0 +1,24 @@ +var test = require('tape') +var vdom = require('virtual-dom') +var hyperx = require('../') +var hx = hyperx(vdom.h) + +test('escape double quotes', function (t) { + var value = '">' + var tree = hx`` + t.equal( + vdom.create(tree).toString(), + `` + ) + t.end() +}) + +test('escape single quotes', function (t) { + var value = "'>" + var tree = hx`` + t.equal( + vdom.create(tree).toString(), + `` + ) + t.end() +}) diff --git a/node_modules/hyperx/test/ignore_surounding_whitespace.js b/node_modules/hyperx/test/ignore_surounding_whitespace.js new file mode 100644 index 000000000..b54cc0678 --- /dev/null +++ b/node_modules/hyperx/test/ignore_surounding_whitespace.js @@ -0,0 +1,19 @@ +var test = require('tape') +var vdom = require('virtual-dom') +var hyperx = require('../') +var hx = hyperx(vdom.h) + +test('ignore whitespace surrounding an element', function (t) { + var tree = hx`
`; + t.equal(vdom.create(tree).toString(), '
') + tree = hx` +
`; + t.equal(vdom.create(tree).toString(), '
') + tree = hx` +
+ `; + t.equal(vdom.create(tree).toString(), '
') + // It shouldn't strip whitespace from a text node + t.equal(hx` hello world `, ' hello world ') + t.end() +}) diff --git a/node_modules/hyperx/test/key.js b/node_modules/hyperx/test/key.js new file mode 100644 index 000000000..b60cb6035 --- /dev/null +++ b/node_modules/hyperx/test/key.js @@ -0,0 +1,72 @@ +var test = require('tape') +var vdom = require('virtual-dom') +var hyperx = require('../') +var hx = hyperx(vdom.h) + +test('key', function (t) { + var key = 'type' + var value = 'text' + var tree = hx`` + t.equal(vdom.create(tree).toString(), '') + t.end() +}) + +test('pre key', function (t) { + var key = 'ype' + var value = 'text' + var tree = hx`` + t.equal(vdom.create(tree).toString(), '') + t.end() +}) + +test('post key', function (t) { + var key = 'typ' + var value = 'text' + var tree = hx`` + t.equal(vdom.create(tree).toString(), '') + t.end() +}) + +test('pre post key', function (t) { + var key = 'yp' + var value = 'text' + var tree = hx`` + t.equal(vdom.create(tree).toString(), '') + t.end() +}) + +test('boolean key', function (t) { + var key = 'checked' + var tree = hx`` + t.equal(vdom.create(tree).toString(), + '') + t.end() +}) + +test('multiple keys', function (t) { + var props = { + type: 'text', + 'data-special': 'true' + } + var key = 'data-' + var value = 'bar' + var tree = hx`` + t.equal(vdom.create(tree).toString(), '') + t.end() +}) + +test('multiple keys dont overwrite existing ones', function (t) { + var props = { + type: 'text' + } + var tree = hx`` + t.equal(vdom.create(tree).toString(), '') + t.end() +}) + +// https://github.com/choojs/hyperx/issues/55 +test('unquoted key does not make void element eat adjacent elements', function (t) { + var tree = hx`sometext` + t.equal(vdom.create(tree).toString(), 'sometext') + t.end() +}) diff --git a/node_modules/hyperx/test/multi_elem_error.js b/node_modules/hyperx/test/multi_elem_error.js new file mode 100644 index 000000000..a8834ccbf --- /dev/null +++ b/node_modules/hyperx/test/multi_elem_error.js @@ -0,0 +1,12 @@ +var test = require('tape') +var vdom = require('virtual-dom') +var hyperx = require('../') +var hx = hyperx(vdom.h) + +test('multiple element error', function (t) { + t.plan(1) + t.throws(function () { + var tree = hx`
one
two
` + }, 'exception') + t.end() +}) diff --git a/node_modules/hyperx/test/style.js b/node_modules/hyperx/test/style.js new file mode 100644 index 000000000..7eef5b544 --- /dev/null +++ b/node_modules/hyperx/test/style.js @@ -0,0 +1,17 @@ +var test = require('tape') +var vdom = require('virtual-dom') +var hyperx = require('../') +var hx = hyperx(vdom.h) + +test('style', function (t) { + var key = 'type' + var value = 'text' + var tree = hx`` + t.equal( + vdom.create(tree).toString(), + '' + ) + t.end() +}) diff --git a/node_modules/hyperx/test/svg.js b/node_modules/hyperx/test/svg.js new file mode 100644 index 000000000..1ee0fa1df --- /dev/null +++ b/node_modules/hyperx/test/svg.js @@ -0,0 +1,21 @@ +var test = require('tape') +var vdom = require('virtual-dom') +var hyperx = require('../') +var hx = hyperx(vdom.h) + +test('svg mixed with html', function (t) { + var expected = `
+

test

+ + + +
` + var tree = hx`
+

test

+ + + +
` + t.equal(vdom.create(tree).toString(), expected) + t.end() +}) diff --git a/node_modules/hyperx/test/tags.js b/node_modules/hyperx/test/tags.js new file mode 100644 index 000000000..7d9dc7aab --- /dev/null +++ b/node_modules/hyperx/test/tags.js @@ -0,0 +1,23 @@ +var test = require('tape') +var vdom = require('virtual-dom') +var hyperx = require('../') +var hx = hyperx(vdom.h) + +test('tag as string variable', function (t) { + var tag = 'div' + var tree = hx`<${tag} class="wow">` + t.equal(vdom.create(tree).toString(), '
') + t.end() +}) + +test('tag as function variable', function (t) { + var customTag = function () {} + var h = function (tag, attrs, children) { + t.equal(tag, customTag) + t.deepEqual(attrs, { className: 'wow' }) + t.deepEqual(children, [ 'child' ]) + t.end() + } + var hx = hyperx(h) + var tree = hx`<${customTag} class="wow">child` +}) diff --git a/node_modules/hyperx/test/title.js b/node_modules/hyperx/test/title.js new file mode 100644 index 000000000..98e040760 --- /dev/null +++ b/node_modules/hyperx/test/title.js @@ -0,0 +1,10 @@ +var test = require('tape') +var vdom = require('virtual-dom') +var hyperx = require('../') +var hx = hyperx(vdom.h) + +test('title html tag', function (t) { + var tree = hx`hello` + t.equal(vdom.create(tree).toString(), 'hello') + t.end() +}) diff --git a/node_modules/hyperx/test/types.js b/node_modules/hyperx/test/types.js new file mode 100644 index 000000000..13f6c2195 --- /dev/null +++ b/node_modules/hyperx/test/types.js @@ -0,0 +1,28 @@ +var test = require('tape') +var vdom = require('virtual-dom') +var hyperx = require('../') +var hx = hyperx(vdom.h) + +test('undefined value (empty)', function (t) { + var tree = hx`
${undefined}
` + t.equal(vdom.create(tree).toString(), '
') + t.end() +}) + +test('null value (empty)', function (t) { + var tree = hx`
${null}
` + t.equal(vdom.create(tree).toString(), '
') + t.end() +}) + +test('boolean value', function (t) { + var tree = hx`
${false}
` + t.equal(vdom.create(tree).toString(), '
false
') + t.end() +}) + +test('numeric value', function (t) { + var tree = hx`
${555}
` + t.equal(vdom.create(tree).toString(), '
555
') + t.end() +}) diff --git a/node_modules/hyperx/test/value.js b/node_modules/hyperx/test/value.js new file mode 100644 index 000000000..c4621e003 --- /dev/null +++ b/node_modules/hyperx/test/value.js @@ -0,0 +1,36 @@ +var test = require('tape') +var vdom = require('virtual-dom') +var hyperx = require('../') +var hx = hyperx(vdom.h) + +test('value', function (t) { + var key = 'type' + var value = 'text' + var tree = hx`` + t.equal(vdom.create(tree).toString(), '') + t.end() +}) + +test('pre value', function (t) { + var key = 'type' + var value = 'ext' + var tree = hx`` + t.equal(vdom.create(tree).toString(), '') + t.end() +}) + +test('post key', function (t) { + var key = 'type' + var value = 'tex' + var tree = hx`` + t.equal(vdom.create(tree).toString(), '') + t.end() +}) + +test('pre post key', function (t) { + var key = 'type' + var value = 'ex' + var tree = hx`` + t.equal(vdom.create(tree).toString(), '') + t.end() +}) diff --git a/node_modules/hyperx/test/vdom.js b/node_modules/hyperx/test/vdom.js new file mode 100644 index 000000000..77532323c --- /dev/null +++ b/node_modules/hyperx/test/vdom.js @@ -0,0 +1,26 @@ +var test = require('tape') +var vdom = require('virtual-dom') +var hyperx = require('../') +var hx = hyperx(vdom.h) + +var expected = `
+

hello world!

+ cool + wow + 123 +
` + +test('vdom', function (t) { + var title = 'world' + var wow = [1,2,3] + var tree = hx`
+

hello ${title}!

+ ${hx`cool`} + wow + ${wow.map(function (w, i) { + return hx`${w}\n` + })} +
` + t.equal(vdom.create(tree).toString(), expected) + t.end() +}) diff --git a/node_modules/hyperx/test/z_hyperscript.js b/node_modules/hyperx/test/z_hyperscript.js new file mode 100644 index 000000000..74513ee8f --- /dev/null +++ b/node_modules/hyperx/test/z_hyperscript.js @@ -0,0 +1,27 @@ +var test = require('tape') +var h = require('hyperscript') +var hyperx = require('../') +var hx = hyperx(h) + +// We cant use custom attributes y="" with hyperscript in the browser, use data-y="" instead +var expected = `
+

hello world!

+ cool + wow + 123 +
` + +test('hyperscript', function (t) { + var title = 'world' + var wow = [1,2,3] + var tree = hx`
+

hello ${title}!

+ ${hx`cool`} + wow + ${wow.map(function (w) { + return hx`${w}\n` + })} +
` + t.equal(tree.outerHTML, expected) + t.end() +}) diff --git a/node_modules/ieee754/LICENSE b/node_modules/ieee754/LICENSE new file mode 100644 index 000000000..f37a2ebe2 --- /dev/null +++ b/node_modules/ieee754/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2008, Fair Oaks Labs, Inc. +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 Fair Oaks Labs, 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. diff --git a/node_modules/ieee754/README.md b/node_modules/ieee754/README.md new file mode 100644 index 000000000..cb7527b3c --- /dev/null +++ b/node_modules/ieee754/README.md @@ -0,0 +1,51 @@ +# ieee754 [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/ieee754/master.svg +[travis-url]: https://travis-ci.org/feross/ieee754 +[npm-image]: https://img.shields.io/npm/v/ieee754.svg +[npm-url]: https://npmjs.org/package/ieee754 +[downloads-image]: https://img.shields.io/npm/dm/ieee754.svg +[downloads-url]: https://npmjs.org/package/ieee754 +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +[![saucelabs][saucelabs-image]][saucelabs-url] + +[saucelabs-image]: https://saucelabs.com/browser-matrix/ieee754.svg +[saucelabs-url]: https://saucelabs.com/u/ieee754 + +### Read/write IEEE754 floating point numbers from/to a Buffer or array-like object. + +## install + +``` +npm install ieee754 +``` + +## methods + +`var ieee754 = require('ieee754')` + +The `ieee754` object has the following functions: + +``` +ieee754.read = function (buffer, offset, isLE, mLen, nBytes) +ieee754.write = function (buffer, value, offset, isLE, mLen, nBytes) +``` + +The arguments mean the following: + +- buffer = the buffer +- offset = offset into the buffer +- value = value to set (only for `write`) +- isLe = is little endian? +- mLen = mantissa length +- nBytes = number of bytes + +## what is ieee754? + +The IEEE Standard for Floating-Point Arithmetic (IEEE 754) is a technical standard for floating-point computation. [Read more](http://en.wikipedia.org/wiki/IEEE_floating_point). + +## license + +BSD 3 Clause. Copyright (c) 2008, Fair Oaks Labs, Inc. diff --git a/node_modules/ieee754/index.js b/node_modules/ieee754/index.js new file mode 100644 index 000000000..e87e6ff58 --- /dev/null +++ b/node_modules/ieee754/index.js @@ -0,0 +1,84 @@ +exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var nBits = -7 + var i = isLE ? (nBytes - 1) : 0 + var d = isLE ? -1 : 1 + var s = buffer[offset + i] + + i += d + + e = s & ((1 << (-nBits)) - 1) + s >>= (-nBits) + nBits += eLen + for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1) + e >>= (-nBits) + nBits += mLen + for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) + } else { + m = m + Math.pow(2, mLen) + e = e - eBias + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) +} + +exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) + var i = isLE ? 0 : (nBytes - 1) + var d = isLE ? 1 : -1 + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 + + value = Math.abs(value) + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0 + e = eMax + } else { + e = Math.floor(Math.log(value) / Math.LN2) + if (value * (c = Math.pow(2, -e)) < 1) { + e-- + c *= 2 + } + if (e + eBias >= 1) { + value += rt / c + } else { + value += rt * Math.pow(2, 1 - eBias) + } + if (value * c >= 2) { + e++ + c /= 2 + } + + if (e + eBias >= eMax) { + m = 0 + e = eMax + } else if (e + eBias >= 1) { + m = ((value * c) - 1) * Math.pow(2, mLen) + e = e + eBias + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) + e = 0 + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m + eLen += mLen + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128 +} diff --git a/node_modules/ieee754/package.json b/node_modules/ieee754/package.json new file mode 100644 index 000000000..2131f07af --- /dev/null +++ b/node_modules/ieee754/package.json @@ -0,0 +1,69 @@ +{ + "_from": "ieee754@^1.1.4", + "_id": "ieee754@1.1.12", + "_inBundle": false, + "_integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==", + "_location": "/ieee754", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ieee754@^1.1.4", + "name": "ieee754", + "escapedName": "ieee754", + "rawSpec": "^1.1.4", + "saveSpec": null, + "fetchSpec": "^1.1.4" + }, + "_requiredBy": [ + "/buffer" + ], + "_resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", + "_shasum": "50bf24e5b9c8bb98af4964c941cdb0918da7b60b", + "_spec": "ieee754@^1.1.4", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/buffer", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "http://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/ieee754/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Romain Beauxis", + "email": "toots@rastageeks.org" + } + ], + "deprecated": false, + "description": "Read/write IEEE754 floating point numbers from/to a Buffer or array-like object", + "devDependencies": { + "airtap": "0.0.7", + "standard": "*", + "tape": "^4.0.0" + }, + "homepage": "https://github.com/feross/ieee754#readme", + "keywords": [ + "IEEE 754", + "buffer", + "convert", + "floating point", + "ieee754" + ], + "license": "BSD-3-Clause", + "main": "index.js", + "name": "ieee754", + "repository": { + "type": "git", + "url": "git://github.com/feross/ieee754.git" + }, + "scripts": { + "test": "standard && npm run test-node && npm run test-browser", + "test-browser": "airtap -- test/*.js", + "test-browser-local": "airtap --local -- test/*.js", + "test-node": "tape test/*.js" + }, + "version": "1.1.12" +} diff --git a/node_modules/individual/.npmignore b/node_modules/individual/.npmignore new file mode 100644 index 000000000..7ce4923d1 --- /dev/null +++ b/node_modules/individual/.npmignore @@ -0,0 +1,4 @@ +node_modules +*.log +*.err +coverage diff --git a/node_modules/individual/.travis.yml b/node_modules/individual/.travis.yml new file mode 100644 index 000000000..c6314e120 --- /dev/null +++ b/node_modules/individual/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +node_js: + - "0.8" + - "0.10" + - "0.11" +before_install: npm i npm@latest -g +script: npm run travis diff --git a/node_modules/individual/LICENCE b/node_modules/individual/LICENCE new file mode 100644 index 000000000..a23e08a85 --- /dev/null +++ b/node_modules/individual/LICENCE @@ -0,0 +1,19 @@ +Copyright (c) 2012 Raynos. + +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. \ No newline at end of file diff --git a/node_modules/individual/README.md b/node_modules/individual/README.md new file mode 100644 index 000000000..5ff408891 --- /dev/null +++ b/node_modules/individual/README.md @@ -0,0 +1,69 @@ +# individual + +[![build status][build-png]][build] [![Coverage Status][cover-png]][cover] [![Davis Dependency status][dep-png]][dep] + +[![NPM][npm-png]][npm] + +[![browser support][test-png]][test] + +Garantueed individual values + +## Example + +```js +var Individual = require("individual") + +var moduleCache = Individual("__MY_MODULE_CACHE", {}) + +// moduleCache is a individual variable local to this file. +// It will always be the same value and defaults to {}. +``` + +This gives you a singleton value by a unique name (it stores it +as a global variable). + +## Use cases + +Your module has an internal cache. If your module is loaded + twice, (someone didn't npm dedup and has two copies of your + module) you would have two seperate caches that dont talk + to each other. + +Best case your cache is less efficient. Worst case you have a + cache because the native C++ extension you talk to crashes + if you instantiate something twice. + +You need a garantuee that this value is an individual, there is + only one of it. + +I use it myself because opening a SockJS websocket to the same + URI twice causes an infinite loop. I need a garantuee that + I have an individual value for the SockJS connection so I + can see whether I already have an open connection. + +## WHY GLOBALS >:( + +I can't imagine any other way to do it. I hate it too. Make a + pull request if you know the real solution + +## Installation + +`npm install individual` + +## Contributors + + - Raynos + +## MIT Licenced + + [build-png]: https://secure.travis-ci.org/Raynos/individual.png + [build]: https://travis-ci.org/Raynos/individual + [cover-png]: https://coveralls.io/repos/Raynos/individual/badge.png + [cover]: https://coveralls.io/r/Raynos/individual + [dep-png]: https://david-dm.org/Raynos/individual.png + [dep]: https://david-dm.org/Raynos/individual + [test-png]: https://ci.testling.com/Raynos/individual.png + [test]: https://ci.testling.com/Raynos/individual + [npm-png]: https://nodei.co/npm/individual.png?stars&downloads + [npm]: https://nodei.co/npm/individual + diff --git a/node_modules/individual/index.js b/node_modules/individual/index.js new file mode 100644 index 000000000..2cb8483c3 --- /dev/null +++ b/node_modules/individual/index.js @@ -0,0 +1,19 @@ +'use strict'; + +/*global window, global*/ + +var root = typeof window !== 'undefined' ? + window : typeof global !== 'undefined' ? + global : {}; + +module.exports = Individual; + +function Individual(key, value) { + if (key in root) { + return root[key]; + } + + root[key] = value; + + return value; +} diff --git a/node_modules/individual/one-version.js b/node_modules/individual/one-version.js new file mode 100644 index 000000000..0a169efc9 --- /dev/null +++ b/node_modules/individual/one-version.js @@ -0,0 +1,22 @@ +'use strict'; + +var Individual = require('./index.js'); + +module.exports = OneVersion; + +function OneVersion(moduleName, version, defaultValue) { + var key = '__INDIVIDUAL_ONE_VERSION_' + moduleName; + var enforceKey = key + '_ENFORCE_SINGLETON'; + + var versionValue = Individual(enforceKey, version); + + if (versionValue !== version) { + throw new Error('Can only have one copy of ' + + moduleName + '.\n' + + 'You already have version ' + versionValue + + ' installed.\n' + + 'This means you cannot install version ' + version); + } + + return Individual(key, defaultValue); +} diff --git a/node_modules/individual/package.json b/node_modules/individual/package.json new file mode 100644 index 000000000..0ee604b52 --- /dev/null +++ b/node_modules/individual/package.json @@ -0,0 +1,84 @@ +{ + "_from": "individual@>=3.0.0 <3.1.0-0", + "_id": "individual@3.0.0", + "_inBundle": false, + "_integrity": "sha1-58pPhfiVewGHNPKFdQ3CLsL5hi0=", + "_location": "/individual", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "individual@>=3.0.0 <3.1.0-0", + "name": "individual", + "escapedName": "individual", + "rawSpec": ">=3.0.0 <3.1.0-0", + "saveSpec": null, + "fetchSpec": ">=3.0.0 <3.1.0-0" + }, + "_requiredBy": [ + "/bole" + ], + "_resolved": "https://registry.npmjs.org/individual/-/individual-3.0.0.tgz", + "_shasum": "e7ca4f85f8957b018734f285750dc22ec2f9862d", + "_spec": "individual@>=3.0.0 <3.1.0-0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/bole", + "author": { + "name": "Raynos", + "email": "raynos2@gmail.com" + }, + "bugs": { + "url": "https://github.com/Raynos/individual/issues", + "email": "raynos2@gmail.com" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jake Verbaten" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Garantueed individual values", + "devDependencies": { + "coveralls": "^2.10.0", + "istanbul": "^0.2.7", + "run-browser": "^1.3.1", + "tape": "^2.12.3" + }, + "homepage": "https://github.com/Raynos/individual", + "keywords": [], + "licenses": [ + { + "type": "MIT", + "url": "http://github.com/Raynos/individual/raw/master/LICENSE" + } + ], + "main": "index", + "name": "individual", + "repository": { + "type": "git", + "url": "git://github.com/Raynos/individual.git" + }, + "scripts": { + "cover": "istanbul cover --report none --print detail test.js", + "test": "node test.js", + "travis": "npm run cover -s && istanbul report lcov && ((cat coverage/lcov.info | coveralls) || exit 0)" + }, + "testling": { + "files": "test.js", + "browsers": [ + "ie/8..latest", + "firefox/16..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "3.0.0" +} diff --git a/node_modules/individual/test.js b/node_modules/individual/test.js new file mode 100644 index 000000000..bf593dbee --- /dev/null +++ b/node_modules/individual/test.js @@ -0,0 +1,25 @@ +var test = require('tape'); + +var Individual = require('./index.js'); + +test('can create Individual', function (assert) { + var obj = Individual('someName', 42); + + assert.equal(obj, 42); + + var obj2 = Individual('someName', 50); + + assert.equal(obj, 42); + + assert.end(); +}); + +test('different keys', function (assert) { + var obj = Individual('someName2', 42); + var obj2 = Individual('otherName2', 50); + + assert.equal(obj, 42); + assert.equal(obj2, 50); + + assert.end(); +}); diff --git a/node_modules/inflight/LICENSE b/node_modules/inflight/LICENSE new file mode 100644 index 000000000..05eeeb88c --- /dev/null +++ b/node_modules/inflight/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/inflight/README.md b/node_modules/inflight/README.md new file mode 100644 index 000000000..6dc892917 --- /dev/null +++ b/node_modules/inflight/README.md @@ -0,0 +1,37 @@ +# inflight + +Add callbacks to requests in flight to avoid async duplication + +## USAGE + +```javascript +var inflight = require('inflight') + +// some request that does some stuff +function req(key, callback) { + // key is any random string. like a url or filename or whatever. + // + // will return either a falsey value, indicating that the + // request for this key is already in flight, or a new callback + // which when called will call all callbacks passed to inflightk + // with the same key + callback = inflight(key, callback) + + // If we got a falsey value back, then there's already a req going + if (!callback) return + + // this is where you'd fetch the url or whatever + // callback is also once()-ified, so it can safely be assigned + // to multiple events etc. First call wins. + setTimeout(function() { + callback(null, key) + }, 100) +} + +// only assigns a single setTimeout +// when it dings, all cbs get called +req('foo', cb1) +req('foo', cb2) +req('foo', cb3) +req('foo', cb4) +``` diff --git a/node_modules/inflight/inflight.js b/node_modules/inflight/inflight.js new file mode 100644 index 000000000..48202b3ca --- /dev/null +++ b/node_modules/inflight/inflight.js @@ -0,0 +1,54 @@ +var wrappy = require('wrappy') +var reqs = Object.create(null) +var once = require('once') + +module.exports = wrappy(inflight) + +function inflight (key, cb) { + if (reqs[key]) { + reqs[key].push(cb) + return null + } else { + reqs[key] = [cb] + return makeres(key) + } +} + +function makeres (key) { + return once(function RES () { + var cbs = reqs[key] + var len = cbs.length + var args = slice(arguments) + + // XXX It's somewhat ambiguous whether a new callback added in this + // pass should be queued for later execution if something in the + // list of callbacks throws, or if it should just be discarded. + // However, it's such an edge case that it hardly matters, and either + // choice is likely as surprising as the other. + // As it happens, we do go ahead and schedule it for later execution. + try { + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args) + } + } finally { + if (cbs.length > len) { + // added more in the interim. + // de-zalgo, just in case, but don't call again. + cbs.splice(0, len) + process.nextTick(function () { + RES.apply(null, args) + }) + } else { + delete reqs[key] + } + } + }) +} + +function slice (args) { + var length = args.length + var array = [] + + for (var i = 0; i < length; i++) array[i] = args[i] + return array +} diff --git a/node_modules/inflight/package.json b/node_modules/inflight/package.json new file mode 100644 index 000000000..0bfb6cb93 --- /dev/null +++ b/node_modules/inflight/package.json @@ -0,0 +1,58 @@ +{ + "_from": "inflight@^1.0.4", + "_id": "inflight@1.0.6", + "_inBundle": false, + "_integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "_location": "/inflight", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "inflight@^1.0.4", + "name": "inflight", + "escapedName": "inflight", + "rawSpec": "^1.0.4", + "saveSpec": null, + "fetchSpec": "^1.0.4" + }, + "_requiredBy": [ + "/glob" + ], + "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "_shasum": "49bd6331d7d02d0c09bc910a1075ba8165b56df9", + "_spec": "inflight@^1.0.4", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/glob", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/inflight/issues" + }, + "bundleDependencies": false, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + }, + "deprecated": false, + "description": "Add callbacks to requests in flight to avoid async duplication", + "devDependencies": { + "tap": "^7.1.2" + }, + "files": [ + "inflight.js" + ], + "homepage": "https://github.com/isaacs/inflight", + "license": "ISC", + "main": "inflight.js", + "name": "inflight", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/inflight.git" + }, + "scripts": { + "test": "tap test.js --100" + }, + "version": "1.0.6" +} diff --git a/node_modules/inherits/LICENSE b/node_modules/inherits/LICENSE new file mode 100644 index 000000000..dea3013d6 --- /dev/null +++ b/node_modules/inherits/LICENSE @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + diff --git a/node_modules/inherits/README.md b/node_modules/inherits/README.md new file mode 100644 index 000000000..b1c566585 --- /dev/null +++ b/node_modules/inherits/README.md @@ -0,0 +1,42 @@ +Browser-friendly inheritance fully compatible with standard node.js +[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). + +This package exports standard `inherits` from node.js `util` module in +node environment, but also provides alternative browser-friendly +implementation through [browser +field](https://gist.github.com/shtylman/4339901). Alternative +implementation is a literal copy of standard one located in standalone +module to avoid requiring of `util`. It also has a shim for old +browsers with no `Object.create` support. + +While keeping you sure you are using standard `inherits` +implementation in node.js environment, it allows bundlers such as +[browserify](https://github.com/substack/node-browserify) to not +include full `util` package to your client code if all you need is +just `inherits` function. It worth, because browser shim for `util` +package is large and `inherits` is often the single function you need +from it. + +It's recommended to use this package instead of +`require('util').inherits` for any code that has chances to be used +not only in node.js but in browser too. + +## usage + +```js +var inherits = require('inherits'); +// then use exactly as the standard one +``` + +## note on version ~1.0 + +Version ~1.0 had completely different motivation and is not compatible +neither with 2.0 nor with standard node.js `inherits`. + +If you are using version ~1.0 and planning to switch to ~2.0, be +careful: + +* new version uses `super_` instead of `super` for referencing + superclass +* new version overwrites current prototype while old one preserves any + existing fields on it diff --git a/node_modules/inherits/inherits.js b/node_modules/inherits/inherits.js new file mode 100644 index 000000000..3b94763a7 --- /dev/null +++ b/node_modules/inherits/inherits.js @@ -0,0 +1,7 @@ +try { + var util = require('util'); + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + module.exports = require('./inherits_browser.js'); +} diff --git a/node_modules/inherits/inherits_browser.js b/node_modules/inherits/inherits_browser.js new file mode 100644 index 000000000..c1e78a75e --- /dev/null +++ b/node_modules/inherits/inherits_browser.js @@ -0,0 +1,23 @@ +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 + } +} diff --git a/node_modules/inherits/package.json b/node_modules/inherits/package.json new file mode 100644 index 000000000..022ca1a68 --- /dev/null +++ b/node_modules/inherits/package.json @@ -0,0 +1,89 @@ +{ + "_from": "inherits@~2.0.1", + "_id": "inherits@2.0.3", + "_inBundle": false, + "_integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "_location": "/inherits", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "inherits@~2.0.1", + "name": "inherits", + "escapedName": "inherits", + "rawSpec": "~2.0.1", + "saveSpec": null, + "fetchSpec": "~2.0.1" + }, + "_requiredBy": [ + "/asn1.js", + "/browserify", + "/browserify-aes", + "/browserify-des", + "/browserify-sign", + "/chokidar", + "/cipher-base", + "/concat-stream", + "/create-hash", + "/create-hmac", + "/crypto-browserify", + "/des.js", + "/elliptic", + "/from2", + "/glob", + "/hash-base", + "/hash.js", + "/http-errors", + "/labeled-stream-splicer", + "/md5.js", + "/module-deps", + "/readable-stream", + "/ripemd160", + "/sha.js", + "/split2/readable-stream", + "/stream-browserify", + "/stream-http", + "/stream-splicer", + "/util" + ], + "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "_shasum": "633c2c83e3da42a502f52466022480f4208261de", + "_spec": "inherits@~2.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "browser": "./inherits_browser.js", + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "devDependencies": { + "tap": "^7.1.0" + }, + "files": [ + "inherits.js", + "inherits_browser.js" + ], + "homepage": "https://github.com/isaacs/inherits#readme", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "license": "ISC", + "main": "./inherits.js", + "name": "inherits", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/inherits.git" + }, + "scripts": { + "test": "node test" + }, + "version": "2.0.3" +} diff --git a/node_modules/inject-lr-script/LICENSE.md b/node_modules/inject-lr-script/LICENSE.md new file mode 100644 index 000000000..89a78cf22 --- /dev/null +++ b/node_modules/inject-lr-script/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) +Copyright (c) 2015 Matt DesLauriers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/inject-lr-script/index.js b/node_modules/inject-lr-script/index.js new file mode 100644 index 000000000..9b52de8f6 --- /dev/null +++ b/node_modules/inject-lr-script/index.js @@ -0,0 +1,42 @@ +var respModifier = require('resp-modifier') +var path = require('path') + +module.exports = injectLiveReloadSnippet +function injectLiveReloadSnippet (opts) { + opts = opts || {} + + var modifier = respModifier({ + rules: [ + { match: /]*>/i, fn: prepend } + ] + }) + + var fn = function (req, res, next) { + var ext = path.extname(req.url) + if (!ext || /\.html?$/i.test(ext)) { + if (!req.headers.accept) { + req.headers.accept = 'text/html' + } + } + modifier(req, res, next) + } + + fn.host = opts.host + fn.port = opts.port + fn.path = opts.path + fn.local = opts.local + + function snippet () { + var host = fn.host || 'localhost' + var port = fn.port || 35729 + var scriptPath = fn.path || '/livereload.js?snipver=1' + var src = fn.local ? scriptPath : ('//' + host + ':' + port + scriptPath) + return '' + } + + function prepend (req, res, body) { + return body + snippet() + } + + return fn +} diff --git a/node_modules/inject-lr-script/package.json b/node_modules/inject-lr-script/package.json new file mode 100644 index 000000000..3ed0cffea --- /dev/null +++ b/node_modules/inject-lr-script/package.json @@ -0,0 +1,68 @@ +{ + "_from": "inject-lr-script@^2.1.0", + "_id": "inject-lr-script@2.1.0", + "_inBundle": false, + "_integrity": "sha1-5htehMEYczkGy+oB7D10Zpijn2U=", + "_location": "/inject-lr-script", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "inject-lr-script@^2.1.0", + "name": "inject-lr-script", + "escapedName": "inject-lr-script", + "rawSpec": "^2.1.0", + "saveSpec": null, + "fetchSpec": "^2.1.0" + }, + "_requiredBy": [ + "/budo" + ], + "_resolved": "https://registry.npmjs.org/inject-lr-script/-/inject-lr-script-2.1.0.tgz", + "_shasum": "e61b5e84c118733906cbea01ec3d746698a39f65", + "_spec": "inject-lr-script@^2.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", + "author": { + "name": "Matt DesLauriers", + "email": "dave.des@gmail.com", + "url": "https://github.com/mattdesl" + }, + "bugs": { + "url": "https://github.com/mattdesl/inject-lr-script/issues" + }, + "bundleDependencies": false, + "dependencies": { + "resp-modifier": "^6.0.0" + }, + "deprecated": false, + "description": "inject live reload into HTML content", + "devDependencies": { + "request": "^2.53.0", + "serve-static": "^1.10.2", + "stacked": "^1.1.1", + "standard": "^5.4.1", + "tape": "^3.5.0" + }, + "homepage": "https://github.com/mattdesl/inject-lr-script", + "keywords": [ + "inject", + "live", + "reload", + "tiny-lr", + "lr", + "tiny", + "tinyreload", + "html" + ], + "license": "MIT", + "main": "index.js", + "name": "inject-lr-script", + "repository": { + "type": "git", + "url": "git://github.com/mattdesl/inject-lr-script.git" + }, + "scripts": { + "test": "standard && node test/test.js" + }, + "version": "2.1.0" +} diff --git a/node_modules/inline-source-map/.npmignore b/node_modules/inline-source-map/.npmignore new file mode 100644 index 000000000..de78e273f --- /dev/null +++ b/node_modules/inline-source-map/.npmignore @@ -0,0 +1,16 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +node_modules +npm-debug.log +tmp diff --git a/node_modules/inline-source-map/.travis.yml b/node_modules/inline-source-map/.travis.yml new file mode 100644 index 000000000..ac342082c --- /dev/null +++ b/node_modules/inline-source-map/.travis.yml @@ -0,0 +1,8 @@ +sudo: false +language: node_js +node_js: + - 0.10 + - 0.12 + - io.js +before_install: + - npm install --global npm diff --git a/node_modules/inline-source-map/LICENSE b/node_modules/inline-source-map/LICENSE new file mode 100644 index 000000000..41702c504 --- /dev/null +++ b/node_modules/inline-source-map/LICENSE @@ -0,0 +1,23 @@ +Copyright 2013 Thorsten Lorenz. +All rights reserved. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/inline-source-map/README.md b/node_modules/inline-source-map/README.md new file mode 100644 index 000000000..82c6b8b6a --- /dev/null +++ b/node_modules/inline-source-map/README.md @@ -0,0 +1,89 @@ +# inline-source-map [![build status](https://secure.travis-ci.org/thlorenz/inline-source-map.png)](http://travis-ci.org/thlorenz/inline-source-map) + +Adds source mappings and base64 encodes them, so they can be inlined in your generated file. + +```js +var generator = require('inline-source-map'); + +// default charset 'utf-8' is configurable +var gen = generator({ charset: 'utf-8' }) + .addMappings('foo.js', [{ original: { line: 2, column: 3 } , generated: { line: 5, column: 10 } }], { line: 5 }) + .addGeneratedMappings('bar.js', 'var a = 2;\nconsole.log(a)', { line: 23, column: 22 }); + +console.log('base64 mapping:', gen.base64Encode()); +console.log('inline mapping url:', gen.inlineMappingUrl()); +``` + +``` +base64 mapping: eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmb28uanMiLCJiYXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O1VBQ0c7Ozs7Ozs7Ozs7Ozs7O3NCQ0RIO3NCQUNBIn0= +inline mapping url: //@ sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmb28uanMiLCJiYXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O1VBQ0c7Ozs7Ozs7Ozs7Ozs7O3NCQ0RIO3NCQUNBIn0= +``` + +## API + +### addMappings(sourceFile, mappings, offset) + +``` +/** + * Adds the given mappings to the generator and offsets them if offset is given + * + * @name addMappings + * @function + * @param sourceFile {String} name of the source file + * @param mappings {Array{{Object}} each object has the form { original: { line: _, column: _ }, generated: { line: _, column: _ } } + * @param offset {Object} offset to apply to each mapping. Has the form { line: _, column: _ } + * @return {Object} the generator to allow chaining + */ +``` + +### addGeneratedMappings(sourceFile, source, offset) + +``` +/** + * Generates mappings for the given source and adds them, assuming that no translation from original to generated is necessary. + * + * @name addGeneratedMappings + * @function + * @param sourceFile {String} name of the source file + * @param source {String} source of the file + * @param offset {Object} offset to apply to each mapping. Has the form { line: _, column: _ } + * @return {Object} the generator to allow chaining + */ +``` + +### addSourceContent(sourceFile, sourceContent) + +``` +/** + * Adds source content for the given source file. + * + * @name addSourceContent + * @function + * @param sourceFile {String} The source file for which a mapping is included + * @param sourceContent {String} The content of the source file + * @return {Object} The generator to allow chaining + */ +``` + + +### base64Encode() + +``` +/** + * @name base64Encode + * @function + * @return {String} bas64 encoded representation of the added mappings + */ +``` + +If source contents were added, this will be included in the encoded mappings. + +### inlineMappingUrl() + +``` +/** + * @name inlineMappingUrl + * @function + * @return {String} comment with base64 encoded representation of the added mappings. Can be inlined at the end of the generated file. + */ +``` diff --git a/node_modules/inline-source-map/example/foo-bar.js b/node_modules/inline-source-map/example/foo-bar.js new file mode 100644 index 000000000..247ee3082 --- /dev/null +++ b/node_modules/inline-source-map/example/foo-bar.js @@ -0,0 +1,8 @@ +var generator = require('..'); + +var gen = generator() + .addMappings('foo.js', [{ original: { line: 2, column: 3 } , generated: { line: 5, column: 10 } }], { line: 5 }) + .addGeneratedMappings('bar.js', 'var a = 2;\nconsole.log(a)', { line: 23, column: 22 }); + +console.log('base64 mapping', gen.base64Encode()); +console.log('inline mapping url', gen.inlineMappingUrl()); diff --git a/node_modules/inline-source-map/index.js b/node_modules/inline-source-map/index.js new file mode 100644 index 000000000..df74d6126 --- /dev/null +++ b/node_modules/inline-source-map/index.js @@ -0,0 +1,135 @@ +'use strict'; +var SourceMapGenerator = require('source-map').SourceMapGenerator; + +function offsetMapping(mapping, offset) { + return { line: offset.line + mapping.line, column: offset.column + mapping.column }; +} + +function newlinesIn(src) { + if (!src) return 0; + var newlines = src.match(/\n/g); + + return newlines ? newlines.length : 0; +} + +function Generator(opts) { + opts = opts || {}; + this.generator = new SourceMapGenerator({ file: opts.file || '', sourceRoot: opts.sourceRoot || '' }); + this.sourcesContent = undefined; + this.opts = opts; +} + +/** + * Adds the given mappings to the generator and offsets them if offset is given + * + * @name addMappings + * @function + * @param sourceFile {String} name of the source file + * @param mappings {Array{{Object}} each object has the form { original: { line: _, column: _ }, generated: { line: _, column: _ } } + * @param offset {Object} offset to apply to each mapping. Has the form { line: _, column: _ } + * @return {Object} the generator to allow chaining + */ +Generator.prototype.addMappings = function (sourceFile, mappings, offset) { + var generator = this.generator; + + offset = offset || {}; + offset.line = offset.hasOwnProperty('line') ? offset.line : 0; + offset.column = offset.hasOwnProperty('column') ? offset.column : 0; + + mappings.forEach(function (m) { + // only set source if we have original position to handle edgecase (see inline-source-map tests) + generator.addMapping({ + source : m.original ? sourceFile : undefined + , original : m.original + , generated : offsetMapping(m.generated, offset) + }); + }); + return this; +}; + +/** + * Generates mappings for the given source, assuming that no translation from original to generated is necessary. + * + * @name addGeneratedMappings + * @function + * @param sourceFile {String} name of the source file + * @param source {String} source of the file + * @param offset {Object} offset to apply to each mapping. Has the form { line: _, column: _ } + * @return {Object} the generator to allow chaining + */ +Generator.prototype.addGeneratedMappings = function (sourceFile, source, offset) { + var mappings = [] + , linesToGenerate = newlinesIn(source) + 1; + + for (var line = 1; line <= linesToGenerate; line++) { + var location = { line: line, column: 0 }; + mappings.push({ original: location, generated: location }); + } + + return this.addMappings(sourceFile, mappings, offset); +}; + +/** + * Adds source content for the given source file. + * + * @name addSourceContent + * @function + * @param sourceFile {String} The source file for which a mapping is included + * @param sourcesContent {String} The content of the source file + * @return {Object} The generator to allow chaining + */ +Generator.prototype.addSourceContent = function (sourceFile, sourcesContent) { + this.sourcesContent = this.sourcesContent || {}; + this.sourcesContent[sourceFile] = sourcesContent; + return this; +}; + +/** + * @name base64Encode + * @function + * @return {String} bas64 encoded representation of the added mappings + */ +Generator.prototype.base64Encode = function () { + var map = this.toString(); + return new Buffer(map).toString('base64'); +}; + +/** + * @name inlineMappingUrl + * @function + * @return {String} comment with base64 encoded representation of the added mappings. Can be inlined at the end of the generated file. + */ +Generator.prototype.inlineMappingUrl = function () { + var charset = this.opts.charset || 'utf-8'; + return '//# sourceMappingURL=data:application/json;charset=' + charset + ';base64,' + this.base64Encode(); +}; + +Generator.prototype.toJSON = function () { + var map = this.generator.toJSON(); + if (!this.sourcesContent) return map; + + var toSourcesContent = (function (s) { + if (typeof this.sourcesContent[s] === 'string') { + return this.sourcesContent[s]; + } else { + return null; + } + }).bind(this); + map.sourcesContent = map.sources.map(toSourcesContent); + return map; +}; + +Generator.prototype.toString = function () { + return JSON.stringify(this); +}; + +Generator.prototype._mappings = function () { + return this.generator._mappings._array; +}; + +Generator.prototype.gen = function () { + return this.generator; +}; + +module.exports = function (opts) { return new Generator(opts); }; +module.exports.Generator = Generator; diff --git a/node_modules/inline-source-map/package.json b/node_modules/inline-source-map/package.json new file mode 100644 index 000000000..d67309de1 --- /dev/null +++ b/node_modules/inline-source-map/package.json @@ -0,0 +1,72 @@ +{ + "_from": "inline-source-map@~0.6.0", + "_id": "inline-source-map@0.6.2", + "_inBundle": false, + "_integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", + "_location": "/inline-source-map", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "inline-source-map@~0.6.0", + "name": "inline-source-map", + "escapedName": "inline-source-map", + "rawSpec": "~0.6.0", + "saveSpec": null, + "fetchSpec": "~0.6.0" + }, + "_requiredBy": [ + "/combine-source-map" + ], + "_resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", + "_shasum": "f9393471c18a79d1724f863fa38b586370ade2a5", + "_spec": "inline-source-map@~0.6.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/combine-source-map", + "author": { + "name": "Thorsten Lorenz", + "email": "thlorenz@gmx.de", + "url": "http://thlorenz.com" + }, + "bugs": { + "url": "https://github.com/thlorenz/inline-source-map/issues" + }, + "bundleDependencies": false, + "dependencies": { + "source-map": "~0.5.3" + }, + "deprecated": false, + "description": "Adds source mappings and base64 encodes them, so they can be inlined in your generated file.", + "devDependencies": { + "nave": "~0.5.0", + "tap": "~0.7.0" + }, + "engine": { + "node": ">=0.6" + }, + "homepage": "https://github.com/thlorenz/inline-source-map", + "keywords": [ + "source", + "map", + "inline", + "base64", + "bundle", + "generate", + "transpile" + ], + "license": "MIT", + "main": "index.js", + "name": "inline-source-map", + "repository": { + "type": "git", + "url": "git://github.com/thlorenz/inline-source-map.git" + }, + "scripts": { + "test": "if [ -e $TRAVIS ]; then npm run test-all; else npm run test-main; fi", + "test-0.10": "nave use 0.10 npm run test-main", + "test-0.12": "nave use 0.12 npm run test-main", + "test-0.8": "nave use 0.8 npm run test-main", + "test-all": "npm run test-main && npm run test-0.8 && npm run test-0.10 && npm run test-0.12", + "test-main": "tap test/*.js" + }, + "version": "0.6.2" +} diff --git a/node_modules/inline-source-map/test/inline-source-map.js b/node_modules/inline-source-map/test/inline-source-map.js new file mode 100644 index 000000000..a6b9f5ee3 --- /dev/null +++ b/node_modules/inline-source-map/test/inline-source-map.js @@ -0,0 +1,342 @@ +'use strict'; +/*jshint asi: true*/ + +var test = require('tap').test +var generator = require('..'); + +var foo = '' + function foo () { + var hello = 'hello'; + var world = 'world'; + console.log('%s %s', hello, world); +} + +var bar = '' + function bar () { + console.log('yes?'); +} + +function decode(base64) { + return new Buffer(base64, 'base64').toString(); +} + +function inspect(obj, depth) { + console.error(require('util').inspect(obj, false, depth || 5, true)); +} + +test('generated mappings', function (t) { + + t.test('one file no offset', function (t) { + var gen = generator() + .addGeneratedMappings('foo.js', foo) + + t.deepEqual( + gen._mappings() + , [ { generatedLine: 1, + generatedColumn: 0, + originalLine: 1, + originalColumn: 0, + source: 'foo.js', + name: null }, + { generatedLine: 2, + generatedColumn: 0, + originalLine: 2, + originalColumn: 0, + source: 'foo.js', + name: null }, + { generatedLine: 3, + generatedColumn: 0, + originalLine: 3, + originalColumn: 0, + source: 'foo.js', + name: null }, + { generatedLine: 4, + generatedColumn: 0, + originalLine: 4, + originalColumn: 0, + source: 'foo.js', + name: null }, + { generatedLine: 5, + generatedColumn: 0, + originalLine: 5, + originalColumn: 0, + source: 'foo.js', + name: null } ] + , 'generates correct mappings' + ) + + t.deepEqual( + JSON.parse(decode(gen.base64Encode())) + , {"version":3,"file":"","sources":["foo.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA","sourceRoot":""} + , 'encodes generated mappings' + ) + t.equal( + gen.inlineMappingUrl() + , '//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6IiIsInNvdXJjZVJvb3QiOiIifQ==' + , 'returns correct inline mapping url' + ) + t.end() + }) + + t.test('two files no offset', function (t) { + var gen = generator() + .addGeneratedMappings('foo.js', foo) + .addGeneratedMappings('bar.js', bar) + + t.deepEqual( + gen._mappings() + , [ { generatedLine: 1, + generatedColumn: 0, + originalLine: 1, + originalColumn: 0, + source: 'foo.js', + name: null }, + { generatedLine: 2, + generatedColumn: 0, + originalLine: 2, + originalColumn: 0, + source: 'foo.js', + name: null }, + { generatedLine: 3, + generatedColumn: 0, + originalLine: 3, + originalColumn: 0, + source: 'foo.js', + name: null }, + { generatedLine: 4, + generatedColumn: 0, + originalLine: 4, + originalColumn: 0, + source: 'foo.js', + name: null }, + { generatedLine: 5, + generatedColumn: 0, + originalLine: 5, + originalColumn: 0, + source: 'foo.js', + name: null }, + { generatedLine: 1, + generatedColumn: 0, + originalLine: 1, + originalColumn: 0, + source: 'bar.js', + name: null }, + { generatedLine: 2, + generatedColumn: 0, + originalLine: 2, + originalColumn: 0, + source: 'bar.js', + name: null }, + { generatedLine: 3, + generatedColumn: 0, + originalLine: 3, + originalColumn: 0, + source: 'bar.js', + name: null } ] + , 'generates correct mappings' + ) + t.deepEqual( + JSON.parse(decode(gen.base64Encode())) + , {"version":3,"file":"","sources":["foo.js","bar.js"],"names":[],"mappings":"ACAA,ADAA;ACCA,ADAA;ACCA,ADAA;AACA;AACA","sourceRoot": ""} + , 'encodes generated mappings' + ) + t.equal( + gen.inlineMappingUrl() + , '//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvby5qcyIsImJhci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUNBQSxBREFBO0FDQ0EsQURBQTtBQ0NBLEFEQUE7QUFDQTtBQUNBIiwiZmlsZSI6IiIsInNvdXJjZVJvb3QiOiIifQ==' + , 'returns correct inline mapping url' + ) + t.end() + }) + + t.test('one line source', function (t) { + var gen = generator().addGeneratedMappings('one-liner.js', 'console.log("line one");') + t.deepEqual( + gen._mappings() + , [ { generatedLine: 1, + generatedColumn: 0, + originalLine: 1, + originalColumn: 0, + source: 'one-liner.js', + name: null } ] + , 'generates correct mappings' + ) + t.end() + }) + + t.test('with offset', function (t) { + var gen = generator() + .addGeneratedMappings('foo.js', foo, { line: 20 }) + .addGeneratedMappings('bar.js', bar, { line: 23, column: 22 }) + + t.deepEqual( + gen._mappings() + , [ { generatedLine: 21, + generatedColumn: 0, + originalLine: 1, + originalColumn: 0, + source: 'foo.js', + name: null }, + { generatedLine: 22, + generatedColumn: 0, + originalLine: 2, + originalColumn: 0, + source: 'foo.js', + name: null }, + { generatedLine: 23, + generatedColumn: 0, + originalLine: 3, + originalColumn: 0, + source: 'foo.js', + name: null }, + { generatedLine: 24, + generatedColumn: 0, + originalLine: 4, + originalColumn: 0, + source: 'foo.js', + name: null }, + { generatedLine: 25, + generatedColumn: 0, + originalLine: 5, + originalColumn: 0, + source: 'foo.js', + name: null }, + { generatedLine: 24, + generatedColumn: 22, + originalLine: 1, + originalColumn: 0, + source: 'bar.js', + name: null }, + { generatedLine: 25, + generatedColumn: 22, + originalLine: 2, + originalColumn: 0, + source: 'bar.js', + name: null }, + { generatedLine: 26, + generatedColumn: 22, + originalLine: 3, + originalColumn: 0, + source: 'bar.js', + name: null } ] + , 'generates correct mappings' + ) + + t.deepEqual( + JSON.parse(decode(gen.base64Encode())) + , {"version":3,"file":"","sources":["foo.js","bar.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA,sBCHA;ADIA,sBCHA;sBACA", "sourceRoot": ""} + , 'encodes generated mappings with offset' + ) + t.end() + }) +}) + +test('given mappings, with one having no original', function (t) { + t.test('no offset', function (t) { + var gen = generator() + .addMappings('foo.js', [{ original: { line: 2, column: 3 } , generated: { line: 5, column: 10 } }]) + + // This addresses an edgecase in which a transpiler generates mappings but doesn't include the original position. + // If we set source to sourceFile (as usual) in that case, the mappings are considered invalid by the source-map module's + // SourceMapGenerator. Keeping source undefined fixes this problem. + // Raised issue: https://github.com/thlorenz/inline-source-map/issues/2 + // Validate function: https://github.com/mozilla/source-map/blob/a3372ea78e662582087dd25ebda999c06424e047/lib/source-map/source-map-generator.js#L232 + .addMappings('bar.js', [ + { original: { line: 6, column: 0 } , generated: { line: 7, column: 20 } } + , { generated: { line: 8, column: 30 } } + ]) + + t.deepEqual( + gen._mappings() + , [ { generatedLine: 5, + generatedColumn: 10, + originalLine: 2, + originalColumn: 3, + source: 'foo.js', + name: null }, + { generatedLine: 7, + generatedColumn: 20, + originalLine: 6, + originalColumn: 0, + source: 'bar.js', + name: null }, + { generatedLine: 8, + generatedColumn: 30, + originalLine: false, + originalColumn: false, + source: undefined, + name: null } ] + , 'adds correct mappings' + ) + t.deepEqual( + JSON.parse(decode(gen.base64Encode())) + , {"version":3,"file":"","sources":["foo.js","bar.js"],"names":[],"mappings":";;;;UACG;;oBCIH;8B", sourceRoot: ""} + , 'encodes generated mappings' + ) + t.equal( + gen.inlineMappingUrl() + , '//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvby5qcyIsImJhci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O1VBQ0c7O29CQ0lIOzhCIiwiZmlsZSI6IiIsInNvdXJjZVJvb3QiOiIifQ==' + , 'returns correct inline mapping url' + ) + t.end() + }) + + t.test('with offset', function (t) { + var gen = generator() + .addMappings('foo.js', [{ original: { line: 2, column: 3 } , generated: { line: 5, column: 10 } }], { line: 5 }) + .addMappings('bar.js', [{ original: { line: 6, column: 0 } , generated: { line: 7, column: 20 } }, { generated: { line: 8, column: 30 } }], { line: 9, column: 3 }) + + t.deepEqual( + gen._mappings() + , [ { generatedLine: 10, + generatedColumn: 10, + originalLine: 2, + originalColumn: 3, + source: 'foo.js', + name: null }, + { generatedLine: 16, + generatedColumn: 23, + originalLine: 6, + originalColumn: 0, + source: 'bar.js', + name: null }, + { generatedLine: 17, + generatedColumn: 33, + originalLine: false, + originalColumn: false, + source: undefined, + name: null } ] + , 'adds correct mappings' + ) + t.deepEqual( + JSON.parse(decode(gen.base64Encode())) + , {"version":3,"file":"","sources":["foo.js","bar.js"],"names":[],"mappings":";;;;;;;;;UACG;;;;;;uBCIH;iC", sourceRoot: ""} + , 'encodes mappings with offset' + ) + t.end() + }) +}); + +test('inline mapping url with charset opt', function(t){ + t.test('set inline mapping url charset to gbk', function(t){ + var gen = generator({charset: 'gbk'}) + .addGeneratedMappings('foo.js', foo); + t.equal( + gen.inlineMappingUrl(), + '//# sourceMappingURL=data:application/json;charset=gbk;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6IiIsInNvdXJjZVJvb3QiOiIifQ==', + 'charset set to gbk' + ); + + t.end(); + }); + + t.test('default charset should be utf-8', function(t){ + var gen = generator() + .addGeneratedMappings('foo.js', foo); + + t.equal( + gen.inlineMappingUrl(), + '//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6IiIsInNvdXJjZVJvb3QiOiIifQ==', + 'charset default to utf-8' + ); + + t.end(); + }); +}); diff --git a/node_modules/inline-source-map/test/source-content.js b/node_modules/inline-source-map/test/source-content.js new file mode 100644 index 000000000..d18997d65 --- /dev/null +++ b/node_modules/inline-source-map/test/source-content.js @@ -0,0 +1,143 @@ +'use strict'; +/*jshint asi: true*/ + +var test = require('tap').test +var generator = require('..'); + +var foo = '' + function foo () { + var hello = 'hello'; + var world = 'world'; + console.log('%s %s', hello, world); +} + +var bar = '' + function bar () { + console.log('yes?'); +} + +function decode(base64) { + return new Buffer(base64, 'base64').toString(); +} + +function inspect(obj, depth) { + console.log(require('util').inspect(obj, false, depth || 5, true)); +} + +test('generated mappings', function (t) { + + t.test('one file with source content', function (t) { + var gen = generator() + .addGeneratedMappings('foo.js', foo) + .addSourceContent('foo.js', foo) + + t.deepEqual( + gen.toJSON() + , { "version": 3, + "file": "", + "sources": [ + "foo.js" + ], + "names": [], + "mappings": "AAAA;AACA;AACA;AACA;AACA", + "sourceRoot": "", + "sourcesContent": [ + "function foo() {\n var hello = 'hello';\n var world = 'world';\n console.log('%s %s', hello, world);\n}" + ], + } + , 'includes source content' + ) + + t.equal( + decode(gen.base64Encode()) + , '{"version":3,"sources":["foo.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA","file":"","sourceRoot":"","sourcesContent":["function foo() {\\n var hello = \'hello\';\\n var world = \'world\';\\n console.log(\'%s %s\', hello, world);\\n}"]}' + , 'encodes generated mappings including source content' + ) + t.equal( + gen.inlineMappingUrl() + , '//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6IiIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJmdW5jdGlvbiBmb28oKSB7XG4gIHZhciBoZWxsbyA9ICdoZWxsbyc7XG4gIHZhciB3b3JsZCA9ICd3b3JsZCc7XG4gIGNvbnNvbGUubG9nKCclcyAlcycsIGhlbGxvLCB3b3JsZCk7XG59Il19' + , 'returns correct inline mapping url including source content' + ) + t.end() + }) + + t.test('two files with source content', function (t) { + var gen = generator() + .addGeneratedMappings('foo.js', foo) + .addSourceContent('foo.js', foo) + .addGeneratedMappings('bar.js', bar) + .addSourceContent('bar.js', bar) + + t.deepEqual( + gen.toJSON() + , { "version": 3, + "file": "", + "sources": [ + "foo.js", + "bar.js" + ], + "names": [], + "mappings": "ACAA,ADAA;ACCA,ADAA;ACCA,ADAA;AACA;AACA", + "sourceRoot": "", + "sourcesContent": [ + "function foo() {\n var hello = 'hello';\n var world = 'world';\n console.log('%s %s', hello, world);\n}", + "function bar() {\n console.log('yes?');\n}" + ], + } + , 'includes source content for both files' + ) + + t.deepEqual( + decode(gen.base64Encode()) + , '{"version":3,"sources":["foo.js","bar.js"],"names":[],"mappings":"ACAA,ADAA;ACCA,ADAA;ACCA,ADAA;AACA;AACA","file":"","sourceRoot":"","sourcesContent":["function foo() {\\n var hello = \'hello\';\\n var world = \'world\';\\n console.log(\'%s %s\', hello, world);\\n}","function bar() {\\n console.log(\'yes?\');\\n}"]}' + , 'encodes generated mappings including source content' + ) + t.equal( + gen.inlineMappingUrl() + , '//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvby5qcyIsImJhci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUNBQSxBREFBO0FDQ0EsQURBQTtBQ0NBLEFEQUE7QUFDQTtBQUNBIiwiZmlsZSI6IiIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJmdW5jdGlvbiBmb28oKSB7XG4gIHZhciBoZWxsbyA9ICdoZWxsbyc7XG4gIHZhciB3b3JsZCA9ICd3b3JsZCc7XG4gIGNvbnNvbGUubG9nKCclcyAlcycsIGhlbGxvLCB3b3JsZCk7XG59IiwiZnVuY3Rpb24gYmFyKCkge1xuICBjb25zb2xlLmxvZygneWVzPycpO1xufSJdfQ==' + , 'returns correct inline mapping url including source content' + ) + t.end() + }) + + t.test('two files, only one with source content', function (t) { + var gen = generator() + .addGeneratedMappings('foo.js', foo) + .addGeneratedMappings('bar.js', bar) + .addSourceContent('bar.js', bar) + + t.deepEqual( + gen.toJSON() + , { "version": 3, + "file": "", + "sources": [ + "foo.js", + "bar.js" + ], + "names": [], + "mappings": "ACAA,ADAA;ACCA,ADAA;ACCA,ADAA;AACA;AACA", + "sourcesContent": [ null, "function bar() {\n console.log('yes?');\n}" ], + "sourceRoot": "" + } + , 'includes source content for the file with source content and [null] for the other file' + ) + + t.deepEqual( + decode(gen.base64Encode()) + , '{"version":3,"sources":["foo.js","bar.js"],"names":[],"mappings":"ACAA,ADAA;ACCA,ADAA;ACCA,ADAA;AACA;AACA","file":"","sourceRoot":"","sourcesContent":[null,"function bar() {\\n console.log(\'yes?\');\\n}"]}' + , 'encodes generated mappings including source content' + ) + t.equal( + gen.inlineMappingUrl() + , '//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvby5qcyIsImJhci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUNBQSxBREFBO0FDQ0EsQURBQTtBQ0NBLEFEQUE7QUFDQTtBQUNBIiwiZmlsZSI6IiIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzQ29udGVudCI6W251bGwsImZ1bmN0aW9uIGJhcigpIHtcbiAgY29uc29sZS5sb2coJ3llcz8nKTtcbn0iXX0=' + , 'returns correct inline mapping url including source content' + ) + t.end() + }) + + t.test('one file with empty source', function (t) { + var gen = generator() + .addGeneratedMappings('empty.js', '') + .addSourceContent('empty.js', '') + t.deepEqual(gen.toJSON()["sourcesContent"], [""]) + t.end() + }); +}) diff --git a/node_modules/insert-css/LICENSE b/node_modules/insert-css/LICENSE new file mode 100644 index 000000000..ee27ba4b4 --- /dev/null +++ b/node_modules/insert-css/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/insert-css/example/bundle.js b/node_modules/insert-css/example/bundle.js new file mode 100644 index 000000000..ace6f6d3b --- /dev/null +++ b/node_modules/insert-css/example/bundle.js @@ -0,0 +1,31 @@ +;(function(e,t,n,r){function i(r){if(!n[r]){if(!t[r]){if(e)return e(r);throw new Error("Cannot find module '"+r+"'")}var s=n[r]={exports:{}};t[r][0](function(e){var n=t[r][1][e];return i(n?n:e)},s,s.exports)}return n[r].exports}for(var s=0;s= 0) return; + inserted.push(css); + + var elem = document.createElement('style'); + var text = document.createTextNode(css); + elem.appendChild(text); + + if (document.head.childNodes.length) { + document.head.insertBefore(elem, document.head.childNodes[0]); + } + else { + document.head.appendChild(elem); + } +}; + +},{}],2:[function(require,module,exports){ +// nothing to see here... no file methods for the browser + +},{}]},{},[1]) +; \ No newline at end of file diff --git a/node_modules/insert-css/example/index.html b/node_modules/insert-css/example/index.html new file mode 100644 index 000000000..907497298 --- /dev/null +++ b/node_modules/insert-css/example/index.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/node_modules/insert-css/example/insert.js b/node_modules/insert-css/example/insert.js new file mode 100644 index 000000000..a8a226435 --- /dev/null +++ b/node_modules/insert-css/example/insert.js @@ -0,0 +1,5 @@ +var fs = require('fs'); +var insertCss = require('../'); +var css = fs.readFileSync(__dirname + '/style.css'); +insertCss(css); +document.body.appendChild(document.createTextNode('HELLO CRUEL WORLD')); diff --git a/node_modules/insert-css/example/style.css b/node_modules/insert-css/example/style.css new file mode 100644 index 000000000..01efe8977 --- /dev/null +++ b/node_modules/insert-css/example/style.css @@ -0,0 +1,4 @@ +body { + background-color: purple; + color: yellow; +} diff --git a/node_modules/insert-css/index.js b/node_modules/insert-css/index.js new file mode 100644 index 000000000..51753a564 --- /dev/null +++ b/node_modules/insert-css/index.js @@ -0,0 +1,22 @@ +var inserted = {}; + +module.exports = function (css, options) { + if (inserted[css]) return; + inserted[css] = true; + + var elem = document.createElement('style'); + elem.setAttribute('type', 'text/css'); + + if ('textContent' in elem) { + elem.textContent = css; + } else { + elem.styleSheet.cssText = css; + } + + var head = document.getElementsByTagName('head')[0]; + if (options && options.prepend) { + head.insertBefore(elem, head.childNodes[0]); + } else { + head.appendChild(elem); + } +}; diff --git a/node_modules/insert-css/package.json b/node_modules/insert-css/package.json new file mode 100644 index 000000000..127b61e76 --- /dev/null +++ b/node_modules/insert-css/package.json @@ -0,0 +1,69 @@ +{ + "_from": "insert-css@^0.2.0", + "_id": "insert-css@0.2.0", + "_inBundle": false, + "_integrity": "sha1-0VeJlxZi2YmcKJd/tiINU4HSRRo=", + "_location": "/insert-css", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "insert-css@^0.2.0", + "name": "insert-css", + "escapedName": "insert-css", + "rawSpec": "^0.2.0", + "saveSpec": null, + "fetchSpec": "^0.2.0" + }, + "_requiredBy": [ + "/csjs-inject" + ], + "_resolved": "https://registry.npmjs.org/insert-css/-/insert-css-0.2.0.tgz", + "_shasum": "d15789971662d9899c28977fb6220d5381d2451a", + "_spec": "insert-css@^0.2.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/csjs-inject", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/insert-css/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "insert a string of css into the ", + "devDependencies": { + "computed-style": "~0.1.3", + "tape": "^2.13.3" + }, + "homepage": "https://github.com/substack/insert-css", + "keywords": [ + "css", + "insert", + "dom", + "browser", + "browserify" + ], + "license": "MIT", + "main": "index.js", + "name": "insert-css", + "repository": { + "type": "git", + "url": "git://github.com/substack/insert-css.git" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "chrome/20..latest", + "firefox/10..latest", + "safari/latest", + "opera/11.0..latest", + "iphone/6", + "ipad/6" + ] + }, + "version": "0.2.0" +} diff --git a/node_modules/insert-css/readme.markdown b/node_modules/insert-css/readme.markdown new file mode 100644 index 000000000..bac37bd4e --- /dev/null +++ b/node_modules/insert-css/readme.markdown @@ -0,0 +1,53 @@ +# insert-css + +insert a string of css into the `` + +[![browser support](https://ci.testling.com/substack/insert-css.png)](https://ci.testling.com/substack/insert-css) + +# example + +suppose we've got some css: + +``` css +body { + background-color: purple; + color: yellow; +} +``` + +and we want to bundle that css into a js file so that we can write an entirely +self-contained module: + +``` js +var fs = require('fs'); +var insertCss = require('insert-css'); +var css = fs.readFileSync(__dirname + '/style.css'); +insertCss(css); +document.body.appendChild(document.createTextNode('HELLO CRUEL WORLD')); +``` + +optionally prepend the css to the head with the `prepend` option: + +``` js +insertCss(css, { prepend: true }); +``` + +compile with [browserify](http://browserify.org) using +[brfs](https://github.com/substack/brfs) to inline the `fs.readFile()` +call: + +``` +$ browserify -t brfs insert.js > bundle.js +``` + +Now plop that bundle.js into a script tag and you'll have a self-contained js +blob with inline css! + +``` html + + + + + + +``` diff --git a/node_modules/insert-css/test/insert.js b/node_modules/insert-css/test/insert.js new file mode 100644 index 000000000..5b0c22116 --- /dev/null +++ b/node_modules/insert-css/test/insert.js @@ -0,0 +1,48 @@ +var test = require('tape'); +var insertCss = require('../'); +var getStyle = require('computed-style'); + +var css = 'body { background-color: purple; color: yellow; }'; + +test(function (t) { + t.plan(10); + + var before = colors(); + t.ok(before.bg === 'rgba(0,0,0,0)' || before.bg === 'transparent'); + t.ok(before.fg === 'rgb(0,0,0)' || before.fg === '#000000'); + + insertCss(css, { prepend: true }); + + var after = colors(); + t.ok(after.bg === 'rgb(128,0,128)' || after.bg === 'purple'); + t.ok(after.fg === 'rgb(255,255,0)' || after.fg === 'yellow'); + + var resetStyle = 'body { background-color: transparent; color: #000000; }'; + insertCss(resetStyle); + + var reset = colors(); + t.ok(reset.bg === 'rgba(0,0,0,0)' || reset.bg === 'transparent'); + t.ok(reset.fg === 'rgb(0,0,0)' || reset.fg === '#000000'); + + var resetStyle = 'body { background-color: green; color: pink; }'; + insertCss(resetStyle, { prepend: true }); + + var reset = colors(); + t.ok(reset.bg === 'rgba(0,0,0,0)' || reset.bg === 'transparent'); + t.ok(reset.fg === 'rgb(0,0,0)' || reset.fg === '#000000'); + + var resetStyle = 'body { background-color: yellow; color: purple; }'; + insertCss(resetStyle, { prepend: false }); + + var reset = colors(); + t.ok(reset.bg === 'rgb(255,255,0)' || reset.bg === 'yellow'); + t.ok(reset.fg === 'rgb(128,0,128)' || reset.fg === 'purple'); +}); + +function colors () { + var body = document.getElementsByTagName('body')[0]; + return { + bg: getStyle(body, 'backgroundColor').replace(/\s+/g, ''), + fg: getStyle(body, 'color').replace(/\s+/g, '') + }; +} diff --git a/node_modules/insert-module-globals/.travis.yml b/node_modules/insert-module-globals/.travis.yml new file mode 100644 index 000000000..4eaf0db4c --- /dev/null +++ b/node_modules/insert-module-globals/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.10" + - "0.12" + - node diff --git a/node_modules/insert-module-globals/LICENSE b/node_modules/insert-module-globals/LICENSE new file mode 100644 index 000000000..ee27ba4b4 --- /dev/null +++ b/node_modules/insert-module-globals/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/insert-module-globals/appveyor.yml b/node_modules/insert-module-globals/appveyor.yml new file mode 100644 index 000000000..9ca7511ac --- /dev/null +++ b/node_modules/insert-module-globals/appveyor.yml @@ -0,0 +1,18 @@ +version: "{build}" + +environment: + matrix: + - nodejs_version: "" # lastest + - nodejs_version: "0.12" + - nodejs_version: "0.10" + +install: + - ps: Install-Product node $env:nodejs_version + - npm install + +build: off + +test_script: + - node --version + - npm --version + - npm test diff --git a/node_modules/insert-module-globals/bench/.gitattributes b/node_modules/insert-module-globals/bench/.gitattributes new file mode 100644 index 000000000..e5789cac6 --- /dev/null +++ b/node_modules/insert-module-globals/bench/.gitattributes @@ -0,0 +1 @@ +jquery-3.3.1.js -diff diff --git a/node_modules/insert-module-globals/bench/index.js b/node_modules/insert-module-globals/bench/index.js new file mode 100644 index 000000000..e138aef5a --- /dev/null +++ b/node_modules/insert-module-globals/bench/index.js @@ -0,0 +1,15 @@ +var bench = require('nanobench'); +var path = require('path'); +var fs = require('fs'); +var insert = require('../'); + +bench('jquery', function (b) { + var source = fs.readFileSync(path.join(__dirname, 'jquery-3.3.1.js')); + b.start(); + var stream = insert(); + stream.on('data', function() {}); + stream.on('end', function () { + b.end(); + }); + stream.end(source); +}); diff --git a/node_modules/insert-module-globals/bin/cmd.js b/node_modules/insert-module-globals/bin/cmd.js new file mode 100755 index 000000000..3efe095e5 --- /dev/null +++ b/node_modules/insert-module-globals/bin/cmd.js @@ -0,0 +1,26 @@ +#!/usr/bin/env node + +var insert = require('../'); +var through = require('through2'); +var concat = require('concat-stream'); +var JSONStream = require('JSONStream'); + +var basedir = process.argv[2] || process.cwd(); + +process.stdin + .pipe(JSONStream.parse([ true ])) + .pipe(through.obj(write)) + .pipe(JSONStream.stringify()) + .pipe(process.stdout) +; + +function write (row, enc, next) { + var self = this; + var s = insert(row.id, { basedir: basedir }); + s.pipe(concat(function (src) { + row.source = src.toString('utf8'); + self.push(row); + next(); + })); + s.end(row.source); +} diff --git a/node_modules/insert-module-globals/example/files/foo/index.js b/node_modules/insert-module-globals/example/files/foo/index.js new file mode 100644 index 000000000..1f477ad78 --- /dev/null +++ b/node_modules/insert-module-globals/example/files/foo/index.js @@ -0,0 +1,6 @@ +process.nextTick(function () { + console.log('in foo/index.js: ' + JSON.stringify({ + __filename: __filename, + __dirname: __dirname + })); +}); diff --git a/node_modules/insert-module-globals/example/files/main.js b/node_modules/insert-module-globals/example/files/main.js new file mode 100644 index 000000000..4b359a25e --- /dev/null +++ b/node_modules/insert-module-globals/example/files/main.js @@ -0,0 +1,6 @@ +console.log('in main.js: ' + JSON.stringify({ + __filename: __filename, + __dirname: __dirname +})); + +require('./foo'); diff --git a/node_modules/insert-module-globals/example/insert.js b/node_modules/insert-module-globals/example/insert.js new file mode 100644 index 000000000..d2caefcf0 --- /dev/null +++ b/node_modules/insert-module-globals/example/insert.js @@ -0,0 +1,12 @@ +var mdeps = require('module-deps'); +var bpack = require('browser-pack'); +var insert = require('../'); +function inserter (file) { + return insert(file, { basedir: __dirname + '/files' }); +} + +var files = [ __dirname + '/files/main.js' ]; +mdeps(files, { transform: inserter }) + .pipe(bpack({ raw: true })) + .pipe(process.stdout) +; diff --git a/node_modules/insert-module-globals/index.js b/node_modules/insert-module-globals/index.js new file mode 100644 index 000000000..c697437e0 --- /dev/null +++ b/node_modules/insert-module-globals/index.js @@ -0,0 +1,194 @@ +var undeclaredIdentifiers = require('undeclared-identifiers'); +var through = require('through2'); +var merge = require('xtend'); +var parse = require('acorn-node').parse; + +var path = require('path'); +var isAbsolute = path.isAbsolute || require('path-is-absolute'); +var processPath = require.resolve('process/browser.js'); +var isbufferPath = require.resolve('is-buffer') +var combineSourceMap = require('combine-source-map'); + +function getRelativeRequirePath(fullPath, fromPath) { + var relpath = path.relative(path.dirname(fromPath), fullPath); + // If fullPath is in the same directory or a subdirectory of fromPath, + // relpath will result in something like "index.js", "src/abc.js". + // require() needs "./" prepended to these paths. + if (!/^\./.test(relpath) && !isAbsolute(relpath)) { + relpath = "./" + relpath; + } + // On Windows: Convert path separators to what require() expects + if (path.sep === '\\') { + relpath = relpath.replace(/\\/g, '/'); + } + return relpath; +} + +var defaultVars = { + process: function (file) { + var relpath = getRelativeRequirePath(processPath, file); + return 'require(' + JSON.stringify(relpath) + ')'; + }, + global: function () { + return 'typeof global !== "undefined" ? global : ' + + 'typeof self !== "undefined" ? self : ' + + 'typeof window !== "undefined" ? window : {}' + ; + }, + 'Buffer.isBuffer': function (file) { + var relpath = getRelativeRequirePath(isbufferPath, file); + return 'require(' + JSON.stringify(relpath) + ')'; + }, + Buffer: function () { + return 'require("buffer").Buffer'; + }, + setImmediate: function () { + return 'require("timers").setImmediate'; + }, + clearImmediate: function () { + return 'require("timers").clearImmediate'; + }, + __filename: function (file, basedir) { + var relpath = path.relative(basedir, file); + // standardize path separators, use slash in Windows too + if ( path.sep === '\\' ) { + relpath = relpath.replace(/\\/g, '/'); + } + var filename = '/' + relpath; + return JSON.stringify(filename); + }, + __dirname: function (file, basedir) { + var relpath = path.relative(basedir, file); + // standardize path separators, use slash in Windows too + if ( path.sep === '\\' ) { + relpath = relpath.replace(/\\/g, '/'); + } + var dir = path.dirname('/' + relpath ); + return JSON.stringify(dir); + } +}; + +module.exports = function (file, opts) { + if (/\.json$/i.test(file)) return through(); + if (!opts) opts = {}; + + var basedir = opts.basedir || '/'; + var vars = merge(defaultVars, opts.vars); + var varNames = Object.keys(vars).filter(function(name) { + return typeof vars[name] === 'function'; + }); + + var quick = RegExp(varNames.map(function (name) { + return '\\b' + name + '\\b'; + }).join('|')); + + var chunks = []; + + return through(write, end); + + function write (chunk, enc, next) { chunks.push(chunk); next() } + + function end () { + var self = this; + var source = Buffer.isBuffer(chunks[0]) + ? Buffer.concat(chunks).toString('utf8') + : chunks.join('') + ; + source = source + .replace(/^\ufeff/, '') + .replace(/^#![^\n]*\n/, '\n'); + + if (opts.always !== true && !quick.test(source)) { + this.push(source); + this.push(null); + return; + } + + try { + var undeclared = opts.always + ? { identifiers: varNames, properties: [] } + : undeclaredIdentifiers(parse(source), { wildcard: true }) + ; + } + catch (err) { + var e = new SyntaxError( + (err.message || err) + ' while parsing ' + file + ); + e.type = 'syntax'; + e.filename = file; + return this.emit('error', e); + } + + var globals = {}; + + varNames.forEach(function (name) { + if (!/\./.test(name)) return; + var parts = name.split('.') + var prop = undeclared.properties.indexOf(name) + if (prop === -1 || countprops(undeclared.properties, parts[0]) > 1) return; + var value = vars[name](file, basedir); + if (!value) return; + globals[parts[0]] = '{' + + JSON.stringify(parts[1]) + ':' + value + '}'; + self.emit('global', name); + }); + varNames.forEach(function (name) { + if (/\./.test(name)) return; + if (globals[name]) return; + if (undeclared.identifiers.indexOf(name) < 0) return; + var value = vars[name](file, basedir); + if (!value) return; + globals[name] = value; + self.emit('global', name); + }); + + this.push(closeOver(globals, source, file, opts)); + this.push(null); + } +}; + +module.exports.vars = defaultVars; + +function closeOver (globals, src, file, opts) { + var keys = Object.keys(globals); + if (keys.length === 0) return src; + var values = keys.map(function (key) { return globals[key] }); + + var wrappedSource; + if (keys.length <= 3) { + wrappedSource = '(function (' + keys.join(',') + '){\n' + + src + '\n}).call(this,' + values.join(',') + ')' + ; + } + else { + // necessary to make arguments[3..6] still work for workerify etc + // a,b,c,arguments[3..6],d,e,f... + var extra = [ '__argument0', '__argument1', '__argument2', '__argument3' ]; + var names = keys.slice(0,3).concat(extra).concat(keys.slice(3)); + values.splice(3, 0, + 'arguments[3]','arguments[4]', + 'arguments[5]','arguments[6]' + ); + wrappedSource = '(function (' + names.join(',') + '){\n' + + src + '\n}).call(this,' + values.join(',') + ')'; + } + + // Generate source maps if wanted. Including the right offset for + // the wrapped source. + if (!opts.debug) { + return wrappedSource; + } + var sourceFile = path.relative(opts.basedir, file) + .replace(/\\/g, '/'); + var sourceMap = combineSourceMap.create().addFile( + { sourceFile: sourceFile, source: src}, + { line: 1 }); + return combineSourceMap.removeComments(wrappedSource) + "\n" + + sourceMap.comment(); +} + +function countprops (props, name) { + return props.filter(function (prop) { + return prop.slice(0, name.length + 1) === name + '.'; + }).length; +} diff --git a/node_modules/insert-module-globals/package.json b/node_modules/insert-module-globals/package.json new file mode 100644 index 000000000..80db1f07d --- /dev/null +++ b/node_modules/insert-module-globals/package.json @@ -0,0 +1,81 @@ +{ + "_from": "insert-module-globals@^7.0.0", + "_id": "insert-module-globals@7.2.0", + "_inBundle": false, + "_integrity": "sha512-VE6NlW+WGn2/AeOMd496AHFYmE7eLKkUY6Ty31k4og5vmA3Fjuwe9v6ifH6Xx/Hz27QvdoMoviw1/pqWRB09Sw==", + "_location": "/insert-module-globals", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "insert-module-globals@^7.0.0", + "name": "insert-module-globals", + "escapedName": "insert-module-globals", + "rawSpec": "^7.0.0", + "saveSpec": null, + "fetchSpec": "^7.0.0" + }, + "_requiredBy": [ + "/browserify" + ], + "_resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.0.tgz", + "_shasum": "ec87e5b42728479e327bd5c5c71611ddfb4752ba", + "_spec": "insert-module-globals@^7.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bin": { + "insert-module-globals": "bin/cmd.js" + }, + "bugs": { + "url": "https://github.com/browserify/insert-module-globals/issues" + }, + "bundleDependencies": false, + "dependencies": { + "JSONStream": "^1.0.3", + "acorn-node": "^1.5.2", + "combine-source-map": "^0.8.0", + "concat-stream": "^1.6.1", + "is-buffer": "^1.1.0", + "path-is-absolute": "^1.0.1", + "process": "~0.11.0", + "through2": "^2.0.0", + "undeclared-identifiers": "^1.1.2", + "xtend": "^4.0.0" + }, + "deprecated": false, + "description": "insert implicit module globals into a module-deps stream", + "devDependencies": { + "browser-pack": "^6.0.0", + "buffer": "^4.9.1", + "convert-source-map": "~1.1.0", + "module-deps": "^4.0.2", + "nanobench": "^2.1.1", + "tape": "^4.2.0", + "timers-browserify": "^1.4.2" + }, + "homepage": "https://github.com/browserify/insert-module-globals", + "keywords": [ + "__filename", + "__dirname", + "global", + "process", + "module-deps", + "browser-pack", + "browserify" + ], + "license": "MIT", + "main": "index.js", + "name": "insert-module-globals", + "repository": { + "type": "git", + "url": "git://github.com/browserify/insert-module-globals.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "version": "7.2.0" +} diff --git a/node_modules/insert-module-globals/readme.markdown b/node_modules/insert-module-globals/readme.markdown new file mode 100644 index 000000000..0d5491aa3 --- /dev/null +++ b/node_modules/insert-module-globals/readme.markdown @@ -0,0 +1,146 @@ +# insert-module-globals + +insert implicit module globals +(`__filename`, `__dirname`, `process`, `global`, `setImmediate`, `clearImmediate` and `Buffer`) +as a browserify-style transform + +[![build status](https://secure.travis-ci.org/browserify/insert-module-globals.png)](http://travis-ci.org/browserify/insert-module-globals) + +# example + +``` js +var mdeps = require('module-deps'); +var bpack = require('browser-pack'); +var insert = require('insert-module-globals'); +function inserter (file) { + return insert(file, { basedir: __dirname + '/files' }); +} + +var files = [ __dirname + '/files/main.js' ]; +mdeps(files, { transform: inserter }) + .pipe(bpack({ raw: true })) + .pipe(process.stdout) +; +``` + +``` +$ node example/insert.js | node +in main.js: {"__filename":"/main.js","__dirname":"/"} +in foo/index.js: {"__filename":"/foo/index.js","__dirname":"/foo"} +``` + +or use the command-line scripts: + +``` +$ module-deps main.js | insert-module-globals | browser-pack | node +in main.js: {"__filename":"/main.js","__dirname":"/"} +in foo/index.js: {"__filename":"/foo/index.js","__dirname":"/foo"} +``` + +or use insert-module-globals as a transform: + +``` +$ module-deps main.js --transform insert-module-globals | browser-pack | node +in main.js: {"__filename":"/main.js","__dirname":"/"} +in foo/index.js: {"__filename":"/foo/index.js","__dirname":"/foo"} +``` + +# methods + +``` js +var insertGlobals = require('insert-module-globals') +``` + +## var inserter = insertGlobals(file, opts) + +Return a transform stream `inserter` for the filename `file` that will accept a +javascript file as input and will output the file with a closure around the +contents as necessary to define extra builtins. + +When `opts.always` is true, wrap every file with all the global variables +without parsing. This is handy because parsing the scope can take a long time, +so you can prioritize fast builds over saving bytes in the final output. When +`opts.always` is truthy but not true, avoid parsing but perform a quick test to +determine if wrapping should be skipped. + +Use `opts.vars` to override the default inserted variables, or set +`opts.vars[name]` to `undefined` to not insert a variable which would otherwise +be inserted. + +`opts.vars` properties with a `.` in their name will be executed instead of the +parent object if ONLY that property is used. For example, `"Buffer.isBuffer"` +will mask `"Buffer"` only when there is a `Buffer.isBuffer()` call in a file and +no other references to `Buffer`. + +If `opts.debug` is true, an inline source map will be generated to compensate +for the extra lines. + +# events + +## inserter.on('global', function (name) {}) + +When a global is detected, the inserter stream emits a `'global'` event. + +# usage + +``` +usage: insert-module-globals {basedir} +``` + +# install + +With [npm](https://npmjs.org), to get the library do: + +``` +npm install insert-module-globals +``` + +and to get the bin script do: + +``` +npm install -g insert-module-globals +``` + +# insert custom globals. + +`insert-module-globals` can also insert arbitary globals into files. +Pass in an object of functions as the `vars` option. + +``` js +var vars = { + process: function (file, basedir) { + return { + id: "path/to/custom_process.js", + source: customProcessContent + } + }, + Buffer: function (file, basedir) { + return { + id: 'path/to/custom_buffer.js', + source: customProcessContent, + //suffix is optional + //it's used to extract the value from the module. + //it becomes: require(...).Buffer in this case. + suffix: '.Buffer' + } + }, + Math: function () { + //if you return a string, + //it's simply set as the value. + return '{}' + //^ any attempt to use Math[x] will throw! + } +} + +function inserter (file) { + return insert(file, { vars: vars }); +} +mdeps(files, { transform: inserter }) + .pipe(bpack({ raw: true })) + .pipe(process.stdout) +``` + + +# license + +MIT diff --git a/node_modules/insert-module-globals/test/always.js b/node_modules/insert-module-globals/test/always.js new file mode 100644 index 000000000..05f3f5cac --- /dev/null +++ b/node_modules/insert-module-globals/test/always.js @@ -0,0 +1,108 @@ +var test = require('tape') +var mdeps = require('module-deps'); +var bpack = require('browser-pack'); +var insert = require('../'); +var concat = require('concat-stream'); +var vm = require('vm'); + +test('always true insert', function (t) { + t.plan(10); + var s = mdeps({ + modules: { + buffer: require.resolve('buffer/'), + timers: require.resolve('timers-browserify') + } + }); + s.pipe(bpack({ raw: true })).pipe(concat(function (src) { + var c = { + t: t, + process: 'sandbox process', + Buffer: 'sandbox Buffer', + __filename: 'sandbox __filename', + __dirname: 'sandbox __dirname', + custom: 'sandbox custom', + self: { xyz: 555 } + }; + vm.runInNewContext(src, c); + })); + s.write({ transform: inserter({ always: true }), global: true }); + s.end(__dirname + '/always/main.js'); +}); + +test('always true insert custom globals without defaults', function (t) { + t.plan(7); + var s = mdeps({ + modules: { + buffer: require.resolve('buffer/'), + timers: require.resolve('timers-browserify') + } + }); + s.pipe(bpack({ raw: true })).pipe(concat(function (src) { + var c = { + t: t, + process: 'sandbox process', + Buffer: 'sandbox Buffer', + __filename: 'sandbox __filename', + __dirname: 'sandbox __dirname', + custom: 'sandbox custom', + self: { xyz: 555 } + }; + vm.runInNewContext(src, c); + })); + s.write({ + transform: inserter({ always: true, vars: { + global: {}, + process: undefined, + Buffer: undefined, + __filename: undefined, + __dirname: undefined, + custom: function() { return '"inserted custom"' } + }}), + global: true + }); + s.end(__dirname + '/always/custom_globals_without_defaults.js'); +}); + +test('always truthy-but-not-true insert hidden from quick test is not really inserted; true is', function (t) { + t.plan(2); + var testit = function(always, expected) { + var s = mdeps({ + modules: { + buffer: require.resolve('buffer/'), + timers: require.resolve('timers-browserify') + } + }); + s.pipe(bpack({ raw: true })).pipe(concat(function (src) { + var c = { + t: t, + process: 'sandbox process', + Buffer: 'sandbox Buffer', + __filename: 'sandbox __filename', + __dirname: 'sandbox __dirname', + custom: 'sandbox custom', + expected: expected, + self: { xyz: 555 } + }; + vm.runInNewContext(src, c); + })); + s.write({ + transform: inserter({ always: always, vars: { + custom: function() { return '"inserted custom"' } + }}), + global: true + }) + s.end(__dirname + '/always/hidden_from_quick_test.js'); + }; + + var always = 'truthy', expected = 'sandbox custom'; + testit(always, expected); + + always = true; expected = 'inserted custom'; + testit(always, expected); +}); + +function inserter (opts) { + return function (file) { + return insert(file, opts); + }; +} diff --git a/node_modules/insert-module-globals/test/always/custom_globals_without_defaults.js b/node_modules/insert-module-globals/test/always/custom_globals_without_defaults.js new file mode 100644 index 000000000..4609487e7 --- /dev/null +++ b/node_modules/insert-module-globals/test/always/custom_globals_without_defaults.js @@ -0,0 +1,7 @@ +t.equal(eval('process'), 'sandbox process'); +t.equal(eval('typeof global'), 'undefined'); +t.equal(eval('self.xyz'), 555); +t.equal(eval('Buffer'), 'sandbox Buffer'); +t.equal(eval('__filename'), 'sandbox __filename'); +t.equal(eval('__dirname'), 'sandbox __dirname'); +t.equal(eval('custom'), 'inserted custom'); diff --git a/node_modules/insert-module-globals/test/always/hidden_from_quick_test.js b/node_modules/insert-module-globals/test/always/hidden_from_quick_test.js new file mode 100644 index 000000000..1c01491d2 --- /dev/null +++ b/node_modules/insert-module-globals/test/always/hidden_from_quick_test.js @@ -0,0 +1 @@ +t.equal(eval('cust' + 'om'), eval('expected')); diff --git a/node_modules/insert-module-globals/test/always/main.js b/node_modules/insert-module-globals/test/always/main.js new file mode 100644 index 000000000..50942a0cc --- /dev/null +++ b/node_modules/insert-module-globals/test/always/main.js @@ -0,0 +1,10 @@ +t.equal(eval('typeof process'), 'object'); +t.equal(eval('typeof process.nextTick'), 'function'); +t.equal(eval('typeof global'), 'object'); +t.equal(eval('global.xyz'), 555); +t.equal(eval('typeof Buffer'), 'function'); +t.equal(eval('typeof __filename'), 'string'); +t.notEqual(eval('__filename'), 'sandbox __filename'); +t.equal(eval('typeof __dirname'), 'string'); +t.notEqual(eval('__dirname'), 'sandbox __dirname'); +t.equal(eval('custom'), 'sandbox custom'); diff --git a/node_modules/insert-module-globals/test/global.js b/node_modules/insert-module-globals/test/global.js new file mode 100644 index 000000000..64a9ebead --- /dev/null +++ b/node_modules/insert-module-globals/test/global.js @@ -0,0 +1,64 @@ +var test = require('tape'); +var vm = require('vm'); +var concat = require('concat-stream'); + +var path = require('path'); +var insert = require('../'); +var bpack = require('browser-pack'); +var mdeps = require('module-deps'); + +test('insert globals', function (t) { + var expected = [ 'global' ]; + t.plan(2 + expected.length); + + var deps = mdeps() + var pack = bpack({ raw: true }); + + deps.pipe(pack); + + pack.pipe(concat(function (src) { + var c = { + t : t, + a : 555, + }; + c.self = c; + vm.runInNewContext(src, c); + })); + + deps.write({ + transform: function (file) { + var tr = inserter(file) + tr.on('global', function (name) { + t.equal(name, expected.shift()); + }); + return tr; + }, + global: true + }); + deps.end(__dirname + '/global/main.js'); +}); + +test('__filename and __dirname', function (t) { + t.plan(2); + + var file = path.join(__dirname, 'global', 'filename.js'); + var deps = mdeps() + var pack = bpack({ raw: true }); + + deps.pipe(pack); + + pack.pipe(concat(function (src) { + var c = {}; + vm.runInNewContext('require=' + src, c); + var x = c.require(file); + t.equal(x.filename, '/filename.js'); + t.equal(x.dirname, '/'); + })); + + deps.write({ transform: inserter, global: true }); + deps.end(file); +}); + +function inserter (file) { + return insert(file, { basedir: __dirname + '/global' }); +} diff --git a/node_modules/insert-module-globals/test/global/filename.js b/node_modules/insert-module-globals/test/global/filename.js new file mode 100644 index 000000000..85dc112bf --- /dev/null +++ b/node_modules/insert-module-globals/test/global/filename.js @@ -0,0 +1,2 @@ +exports.filename = __filename; +exports.dirname = __dirname; diff --git a/node_modules/insert-module-globals/test/global/main.js b/node_modules/insert-module-globals/test/global/main.js new file mode 100644 index 000000000..d77852b23 --- /dev/null +++ b/node_modules/insert-module-globals/test/global/main.js @@ -0,0 +1,2 @@ +t.equal(a, 555); +t.equal(a, global.a); diff --git a/node_modules/insert-module-globals/test/immediate.js b/node_modules/insert-module-globals/test/immediate.js new file mode 100644 index 000000000..a5c482b69 --- /dev/null +++ b/node_modules/insert-module-globals/test/immediate.js @@ -0,0 +1,30 @@ +var test = require('tape'); +var mdeps = require('module-deps'); +var bpack = require('browser-pack'); +var insert = require('../'); +var concat = require('concat-stream'); +var vm = require('vm'); + +test('immediate', function (t) { + t.plan(3); + var deps = mdeps({ + modules: { timers: require.resolve('timers-browserify') } + }); + var pack = bpack({ raw: true, hasExports: true }); + deps.pipe(pack).pipe(concat(function (src) { + var c = { + setTimeout: setTimeout, + clearTimeout: clearTimeout, + T: t + }; + t.ok(/require\("timers"\)/.test(src), 'timers required in source'); + t.notOk(/require\("\//.test(src), 'absolute path not required in source'); + vm.runInNewContext(src, c); + })); + deps.write({ transform: inserter, global: true }); + deps.end({ id: 'main', file: __dirname + '/immediate/main.js' }); +}); + +function inserter (file) { + return insert(file, { basedir: __dirname + '/immediate' }); +} diff --git a/node_modules/insert-module-globals/test/immediate/main.js b/node_modules/insert-module-globals/test/immediate/main.js new file mode 100644 index 000000000..fc53cc702 --- /dev/null +++ b/node_modules/insert-module-globals/test/immediate/main.js @@ -0,0 +1,8 @@ +var immediate = setImmediate(function () { + T.fail('should have been cleared') +}) +setImmediate(function () { + T.pass('should call setImmediate') +}) + +clearImmediate(immediate) diff --git a/node_modules/insert-module-globals/test/insert.js b/node_modules/insert-module-globals/test/insert.js new file mode 100644 index 000000000..8fe3b39cf --- /dev/null +++ b/node_modules/insert-module-globals/test/insert.js @@ -0,0 +1,46 @@ +var test = require('tape'); +var mdeps = require('module-deps'); +var bpack = require('browser-pack'); +var insert = require('../'); +var concat = require('concat-stream'); +var vm = require('vm'); + +test('process.nextTick inserts', function (t) { + t.plan(4); + var s = mdeps() + s.pipe(bpack({ raw: true })).pipe(concat(function (src) { + var c = { + t: t, + setTimeout: setTimeout, + clearTimeout: clearTimeout + }; + vm.runInNewContext(src, c); + })); + s.write({ transform: inserter, global: true }) + s.end(__dirname + '/insert/main.js'); +}); + +test('buffer inserts', function (t) { + t.plan(2); + var s = mdeps({ + modules: { buffer: require.resolve('buffer/') } + }); + s.pipe(bpack({ raw: true })).pipe(concat(function (src) { + var c = { + t: t, + setTimeout: setTimeout, + clearTimeout: clearTimeout, + Uint8Array: Uint8Array, + DataView: DataView + }; + vm.runInNewContext(src, c); + })); + s.write({ transform: inserter, global: true }) + s.end(__dirname + '/insert/buffer.js'); +}); + +function inserter (file) { + return insert(file, { + basedir: __dirname + '/insert' + }); +} diff --git a/node_modules/insert-module-globals/test/insert/buffer.js b/node_modules/insert-module-globals/test/insert/buffer.js new file mode 100644 index 000000000..54153e4d6 --- /dev/null +++ b/node_modules/insert-module-globals/test/insert/buffer.js @@ -0,0 +1 @@ +require('./foo/buf'); diff --git a/node_modules/insert-module-globals/test/insert/foo/buf.js b/node_modules/insert-module-globals/test/insert/foo/buf.js new file mode 100644 index 000000000..ea13200ae --- /dev/null +++ b/node_modules/insert-module-globals/test/insert/foo/buf.js @@ -0,0 +1,4 @@ +process.nextTick(function () { + t.equal(Buffer('abc').toString('base64'), 'YWJj'); + t.equal(Buffer([98,99,100]).toString(), 'bcd'); +}); diff --git a/node_modules/insert-module-globals/test/insert/foo/index.js b/node_modules/insert-module-globals/test/insert/foo/index.js new file mode 100644 index 000000000..0945157e4 --- /dev/null +++ b/node_modules/insert-module-globals/test/insert/foo/index.js @@ -0,0 +1,4 @@ +process.nextTick(function () { + t.equal(__filename, '/foo/index.js'); + t.equal(__dirname, '/foo'); +}); diff --git a/node_modules/insert-module-globals/test/insert/main.js b/node_modules/insert-module-globals/test/insert/main.js new file mode 100644 index 000000000..957a73d73 --- /dev/null +++ b/node_modules/insert-module-globals/test/insert/main.js @@ -0,0 +1,4 @@ +t.equal(__filename, '/main.js'); +t.equal(__dirname, '/'); + +require('./foo'); diff --git a/node_modules/insert-module-globals/test/isbuffer.js b/node_modules/insert-module-globals/test/isbuffer.js new file mode 100644 index 000000000..4ff6819ba --- /dev/null +++ b/node_modules/insert-module-globals/test/isbuffer.js @@ -0,0 +1,64 @@ +var test = require('tape'); +var mdeps = require('module-deps'); +var bpack = require('browser-pack'); +var insert = require('../'); +var concat = require('concat-stream'); +var vm = require('vm'); +// use is-buffer instead of builtin Buffer.isBuffer. The builtin +// does `instanceof` which does not work on the browserified version +var isBuffer = require('is-buffer'); + +test('isbuffer', function (t) { + t.plan(5); + var deps = mdeps() + var pack = bpack({ raw: true, hasExports: true }); + deps.pipe(pack).pipe(concat(function (src) { + var c = { global: {} }; + vm.runInNewContext(src, c); + t.equal(c.require('main')(Buffer('wow')), true, 'is a buffer'); + t.equal(c.require('main')('wow'), false, 'not a buffer (string)'); + t.equal(c.require('main')({}), false, 'not a buffer (object)'); + t.notOk(/require\("buffer"\)/.test(src), 'buffer not required in source') + t.notOk(/require\("\//.test(src), 'absolute path not required in source') + })); + deps.write({ transform: inserter, global: true }); + deps.end({ id: 'main', file: __dirname + '/isbuffer/main.js' }); +}); + +test('isbuffer (and Buffer.from)', function (t) { + t.plan(5); + var deps = mdeps() + var pack = bpack({ raw: true, hasExports: true }); + deps.pipe(pack).pipe(concat(function (src) { + var c = { global: {} }; + vm.runInNewContext(src, c); + t.equal(c.require('main')(c.require('main').a()), true, 'is a buffer'); + t.equal(c.require('main')('wow'), false, 'is not a buffer'); + t.equal(isBuffer(c.require('main').a()), true, 'is a buffer'); + t.ok(/require\("buffer"\)/.test(src), 'buffer required in source') + t.equal(c.require('main').a().toString('hex'), 'abcd', 'is a buffer'); + })); + deps.write({ transform: inserter, global: true }); + deps.end({ id: 'main', file: __dirname + '/isbuffer/both.js' }); +}); + +test('isbuffer (and new Buffer)', function (t) { + t.plan(5); + var deps = mdeps() + var pack = bpack({ raw: true, hasExports: true }); + deps.pipe(pack).pipe(concat(function (src) { + var c = { global: {} }; + vm.runInNewContext(src, c); + t.equal(c.require('main')(c.require('main').a()), true, 'is a buffer'); + t.equal(c.require('main')('wow'), false, 'is not a buffer'); + t.equal(isBuffer(c.require('main').a()), true, 'is a buffer'); + t.ok(/require\("buffer"\)/.test(src), 'buffer required in source') + t.equal(c.require('main').a().toString('utf8'), 'abcd', 'is a buffer'); + })); + deps.write({ transform: inserter, global: true }); + deps.end({ id: 'main', file: __dirname + '/isbuffer/new.js' }); +}); + +function inserter (file) { + return insert(file, { basedir: __dirname + '/isbuffer' }); +} diff --git a/node_modules/insert-module-globals/test/isbuffer/both.js b/node_modules/insert-module-globals/test/isbuffer/both.js new file mode 100644 index 000000000..d4927e141 --- /dev/null +++ b/node_modules/insert-module-globals/test/isbuffer/both.js @@ -0,0 +1,6 @@ +module.exports = function (buf) { + return Buffer.isBuffer(buf); +}; +module.exports.a = function () { + return Buffer.from('abcd', 'hex'); +}; diff --git a/node_modules/insert-module-globals/test/isbuffer/main.js b/node_modules/insert-module-globals/test/isbuffer/main.js new file mode 100644 index 000000000..c610fa193 --- /dev/null +++ b/node_modules/insert-module-globals/test/isbuffer/main.js @@ -0,0 +1,3 @@ +module.exports = function (buf) { + return Buffer.isBuffer(buf); +}; diff --git a/node_modules/insert-module-globals/test/isbuffer/new.js b/node_modules/insert-module-globals/test/isbuffer/new.js new file mode 100644 index 000000000..46d9fe25e --- /dev/null +++ b/node_modules/insert-module-globals/test/isbuffer/new.js @@ -0,0 +1,6 @@ +module.exports = function (buf) { + return Buffer.isBuffer(buf); +}; +module.exports.a = function () { + return new Buffer('abcd'); +}; diff --git a/node_modules/insert-module-globals/test/return.js b/node_modules/insert-module-globals/test/return.js new file mode 100644 index 000000000..7514f1f55 --- /dev/null +++ b/node_modules/insert-module-globals/test/return.js @@ -0,0 +1,27 @@ +var test = require('tape'); +var mdeps = require('module-deps'); +var bpack = require('browser-pack'); +var insert = require('../'); +var concat = require('concat-stream'); +var vm = require('vm'); + +test('early return', function (t) { + t.plan(4); + var s = mdeps() + s.pipe(bpack({ raw: true })).pipe(concat(function (src) { + var c = { + t: t, + setTimeout: setTimeout, + clearTimeout: clearTimeout + }; + vm.runInNewContext(src, c); + })); + s.write({ transform: inserter, global: true }); + s.end(__dirname + '/return/main.js'); +}); + +function inserter (file) { + return insert(file, { + basedir: __dirname + '/return' + }); +} diff --git a/node_modules/insert-module-globals/test/return/foo/index.js b/node_modules/insert-module-globals/test/return/foo/index.js new file mode 100644 index 000000000..0945157e4 --- /dev/null +++ b/node_modules/insert-module-globals/test/return/foo/index.js @@ -0,0 +1,4 @@ +process.nextTick(function () { + t.equal(__filename, '/foo/index.js'); + t.equal(__dirname, '/foo'); +}); diff --git a/node_modules/insert-module-globals/test/return/main.js b/node_modules/insert-module-globals/test/return/main.js new file mode 100644 index 000000000..c7d354cf4 --- /dev/null +++ b/node_modules/insert-module-globals/test/return/main.js @@ -0,0 +1,6 @@ +t.equal(__filename, '/main.js'); +t.equal(__dirname, '/'); + +require('./foo'); + +return; diff --git a/node_modules/insert-module-globals/test/roots.js b/node_modules/insert-module-globals/test/roots.js new file mode 100644 index 000000000..5bd2d9e0c --- /dev/null +++ b/node_modules/insert-module-globals/test/roots.js @@ -0,0 +1,35 @@ +var test = require('tape'); +var mdeps = require('module-deps'); +var bpack = require('browser-pack'); +var insert = require('../'); +var concat = require('concat-stream'); +var path = require('path'); +var fs = require('fs'); +var vm = require('vm'); + +test('windows partitions', { skip: process.platform !== 'win32' }, function (t) { + t.plan(1); + var deps = mdeps() + var pack = bpack({ raw: true, hasExports: true }); + deps.pipe(pack).pipe(concat(function (src) { + var c = { + console: { log: log } + }; + vm.runInNewContext(src, c); + function log (value) { + t.equal(typeof value, 'function'); + } + })); + deps.write({ transform: inserter, global: true }); + deps.end({ + id: 'main', + file: 'D:\\test.js', + source: fs.readFileSync(__dirname + '/roots/main.js') + }); +}); + +function inserter (file) { + return insert(file, { + basedir: path.join(__dirname, '..') + }); +} diff --git a/node_modules/insert-module-globals/test/roots/main.js b/node_modules/insert-module-globals/test/roots/main.js new file mode 100644 index 000000000..55f4d10cd --- /dev/null +++ b/node_modules/insert-module-globals/test/roots/main.js @@ -0,0 +1 @@ +console.log(Buffer.isBuffer) diff --git a/node_modules/insert-module-globals/test/sourcemap.js b/node_modules/insert-module-globals/test/sourcemap.js new file mode 100644 index 000000000..b1e3a7149 --- /dev/null +++ b/node_modules/insert-module-globals/test/sourcemap.js @@ -0,0 +1,41 @@ +var test = require('tape'); +var convert = require('convert-source-map'); +var insert = require('../'); +var mdeps = require('module-deps'); +var vm = require('vm'); +var path = require('path'); + +test('sourcemap', function (t) { + t.plan(6); + + var file = __dirname + '/sourcemap/main.js'; + var deps = mdeps() + + deps.on('data', function(row) { + var src = row.source; + + var sm = convert.fromSource(src).toObject(); + t.deepEqual(sm.sources, [ 'test/sourcemap/main_es6.js' ]); + t.deepEqual(sm.sourcesContent, [ 'console.log(`${__dirname}`, `${__filename}`);\n' ]); + t.deepEqual(sm.mappings, ';AAAA,OAAO,CAAC,GAAG,MAAI,SAAS,OAAO,UAAU,CAAG,CAAC'); + + t.equal(src.match(convert.commentRegex).length, 1); + + var c = { + console: { + log: function(dirname, filename) { + t.equal(dirname, '/'); + t.equal(filename, '/main.js'); + } + }, + }; + vm.runInNewContext(src, c); + }); + + deps.write({ transform: inserter, global: true }); + deps.end(file); +}); + +function inserter (file) { + return insert(file, { debug: true, basedir: __dirname + '/sourcemap' }); +} diff --git a/node_modules/insert-module-globals/test/sourcemap/main.js b/node_modules/insert-module-globals/test/sourcemap/main.js new file mode 100644 index 000000000..7d6f3c747 --- /dev/null +++ b/node_modules/insert-module-globals/test/sourcemap/main.js @@ -0,0 +1,3 @@ +console.log("" + __dirname, "" + __filename); + +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3Qvc291cmNlbWFwL21haW5fZXM2LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sQ0FBQyxHQUFHLE1BQUksU0FBUyxPQUFPLFVBQVUsQ0FBRyxDQUFDIiwiZmlsZSI6InVuZGVmaW5lZCIsInNvdXJjZXNDb250ZW50IjpbImNvbnNvbGUubG9nKGAke19fZGlybmFtZX1gLCBgJHtfX2ZpbGVuYW1lfWApO1xuIl19 diff --git a/node_modules/insert-module-globals/test/sourcemap/main_es6.js b/node_modules/insert-module-globals/test/sourcemap/main_es6.js new file mode 100644 index 000000000..f74babd6b --- /dev/null +++ b/node_modules/insert-module-globals/test/sourcemap/main_es6.js @@ -0,0 +1 @@ +console.log(`${__dirname}`, `${__filename}`); diff --git a/node_modules/insert-module-globals/test/subdir.js b/node_modules/insert-module-globals/test/subdir.js new file mode 100644 index 000000000..d9a515b1a --- /dev/null +++ b/node_modules/insert-module-globals/test/subdir.js @@ -0,0 +1,37 @@ +var test = require('tape'); +var mdeps = require('module-deps'); +var bpack = require('browser-pack'); +var insert = require('../'); +var concat = require('concat-stream'); +var path = require('path'); +var fs = require('fs'); +var vm = require('vm'); + +test('subdir', function (t) { + t.plan(1); + var deps = mdeps() + var pack = bpack({ raw: true, hasExports: true }); + deps.pipe(pack).pipe(concat(function (src) { + var c = { + console: { log: log } + }; + vm.runInNewContext(src, c); + function log (value) { + t.equal(value, false); + } + })); + deps.write({ transform: inserter, global: true }); + deps.end({ + id: 'main', + // Fake the file path so that the relative path to is-buffer becomes + // "node_modules/is-buffer/index.js" + file: path.join(__dirname, '../subdir_test.js'), + source: fs.readFileSync(__dirname + '/subdir/main.js') + }); +}); + +function inserter (file) { + return insert(file, { + basedir: path.join(__dirname, '..') + }); +} diff --git a/node_modules/insert-module-globals/test/subdir/main.js b/node_modules/insert-module-globals/test/subdir/main.js new file mode 100644 index 000000000..74f9f1936 --- /dev/null +++ b/node_modules/insert-module-globals/test/subdir/main.js @@ -0,0 +1 @@ +console.log(Buffer.isBuffer("test")) diff --git a/node_modules/insert-module-globals/test/subdir/node_modules/is-buffer/index.js b/node_modules/insert-module-globals/test/subdir/node_modules/is-buffer/index.js new file mode 100644 index 000000000..9cce39659 --- /dev/null +++ b/node_modules/insert-module-globals/test/subdir/node_modules/is-buffer/index.js @@ -0,0 +1,21 @@ +/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +// The _isBuffer check is for Safari 5-7 support, because it's missing +// Object.prototype.constructor. Remove this eventually +module.exports = function (obj) { + return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) +} + +function isBuffer (obj) { + return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) +} + +// For Node v0.10 support. Remove this eventually. +function isSlowBuffer (obj) { + return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) +} diff --git a/node_modules/insert-module-globals/test/unprefix.js b/node_modules/insert-module-globals/test/unprefix.js new file mode 100644 index 000000000..e87dc80e1 --- /dev/null +++ b/node_modules/insert-module-globals/test/unprefix.js @@ -0,0 +1,34 @@ +var test = require('tape'); +var vm = require('vm'); +var concat = require('concat-stream'); + +var path = require('path'); +var insert = require('../'); +var bpack = require('browser-pack'); +var mdeps = require('module-deps'); + +test('unprefix - remove shebang and bom', function (t) { + t.plan(3); + + var file = path.join(__dirname, 'unprefix', 'main.js'); + var deps = mdeps(); + var pack = bpack({ raw: true }); + + deps.pipe(pack); + + pack.pipe(concat(function (src) { + var c = {}; + vm.runInNewContext('require=' + src, c); + var x = c.require(file); + t.equal(x.filename, '/hello.js'); + t.equal(x.dirname, '/'); + t.notOk(/\ufeff/.test(src.toString())); + })); + + deps.write({ transform: inserter, global: true }); + deps.end(file); +}); + +function inserter (file) { + return insert(file, { basedir: __dirname + '/unprefix' }); +} diff --git a/node_modules/insert-module-globals/test/unprefix/hello.js b/node_modules/insert-module-globals/test/unprefix/hello.js new file mode 100644 index 000000000..993372f0f --- /dev/null +++ b/node_modules/insert-module-globals/test/unprefix/hello.js @@ -0,0 +1,2 @@ +exports.filename = __filename; +exports.dirname = __dirname; diff --git a/node_modules/insert-module-globals/test/unprefix/main.js b/node_modules/insert-module-globals/test/unprefix/main.js new file mode 100644 index 000000000..6a1f3711e --- /dev/null +++ b/node_modules/insert-module-globals/test/unprefix/main.js @@ -0,0 +1,3 @@ +#!/usr/bin/env node + +module.exports = require('./hello'); diff --git a/node_modules/internal-ip/index.js b/node_modules/internal-ip/index.js new file mode 100644 index 000000000..7c6d4cec3 --- /dev/null +++ b/node_modules/internal-ip/index.js @@ -0,0 +1,47 @@ +'use strict'; +const os = require('os'); +const defaultGateway = require('default-gateway'); +const ipaddr = require('ipaddr.js'); + +function findIp(gateway) { + const interfaces = os.networkInterfaces(); + const gatewayIp = ipaddr.parse(gateway); + let ip; + + // Look for the matching interface in all local interfaces + Object.keys(interfaces).some(name => { + return interfaces[name].some(addr => { + const prefix = ipaddr.parse(addr.netmask).prefixLengthFromSubnetMask(); + const net = ipaddr.parseCIDR(`${addr.address}/${prefix}`); + + if (net[0] && net[0].kind() === gatewayIp.kind() && gatewayIp.match(net)) { + ip = net[0].toString(); + } + + return Boolean(ip); + }); + }); + + return ip; +} + +function promise(family) { + return defaultGateway[family]().then(result => { + return findIp(result.gateway) || null; + }).catch(() => null); +} + +function sync(family) { + try { + const result = defaultGateway[family].sync(); + return findIp(result.gateway) || null; + } catch (err) { + return null; + } +} + +module.exports.v6 = () => promise('v6'); +module.exports.v4 = () => promise('v4'); + +module.exports.v6.sync = () => sync('v6'); +module.exports.v4.sync = () => sync('v4'); diff --git a/node_modules/internal-ip/license b/node_modules/internal-ip/license new file mode 100644 index 000000000..e7af2f771 --- /dev/null +++ b/node_modules/internal-ip/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/internal-ip/package.json b/node_modules/internal-ip/package.json new file mode 100644 index 000000000..577de47ef --- /dev/null +++ b/node_modules/internal-ip/package.json @@ -0,0 +1,82 @@ +{ + "_from": "internal-ip@^3.0.1", + "_id": "internal-ip@3.0.1", + "_inBundle": false, + "_integrity": "sha512-NXXgESC2nNVtU+pqmC9e6R8B1GpKxzsAQhffvh5AL79qKnodd+L7tnEQmTiUAVngqLalPbSqRA7XGIEL5nCd0Q==", + "_location": "/internal-ip", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "internal-ip@^3.0.1", + "name": "internal-ip", + "escapedName": "internal-ip", + "rawSpec": "^3.0.1", + "saveSpec": null, + "fetchSpec": "^3.0.1" + }, + "_requiredBy": [ + "/budo" + ], + "_resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-3.0.1.tgz", + "_shasum": "df5c99876e1d2eb2ea2d74f520e3f669a00ece27", + "_spec": "internal-ip@^3.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/internal-ip/issues" + }, + "bundleDependencies": false, + "dependencies": { + "default-gateway": "^2.6.0", + "ipaddr.js": "^1.5.2" + }, + "deprecated": false, + "description": "Get your internal IP address", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/internal-ip#readme", + "keywords": [ + "ip", + "ipv6", + "ipv4", + "address", + "internal", + "local", + "machine", + "system", + "net", + "gateway" + ], + "license": "MIT", + "name": "internal-ip", + "os": [ + "android", + "darwin", + "freebsd", + "linux", + "openbsd", + "sunos", + "win32" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/internal-ip.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.0.1" +} diff --git a/node_modules/internal-ip/readme.md b/node_modules/internal-ip/readme.md new file mode 100644 index 000000000..277abd13b --- /dev/null +++ b/node_modules/internal-ip/readme.md @@ -0,0 +1,49 @@ +# internal-ip [![Build Status](https://travis-ci.org/sindresorhus/internal-ip.svg?branch=master)](https://travis-ci.org/sindresorhus/internal-ip) + +> Get your internal IP address + + +## Install + +``` +$ npm install internal-ip +``` + + +## Usage + +```js +const internalIp = require('internal-ip'); + +internalIp.v6().then(ip => { + console.log(ip); + //=> 'fe80::1' +}); + +internalIp.v4().then(ip => { + console.log(ip); + //=> '10.0.0.79' +}); + +console.log(internalIp.v6.sync()) +//=> 'fe80::1' + +console.log(internalIp.v4.sync()) +//=> '10.0.0.79' +``` + +The module returns the address of the internet-facing interface, as determined from the default gateway. When the adress cannot be determined for any reason, `null` will be returned. + +The module relies on operating systems tools. On Linux and Android, the `ip` command must be available, which depending on distribution might not be installed by default. It is usually provided by the `iproute2` package. + + +## Related + +- [internal-ip-cli](https://github.com/sindresorhus/internal-ip-cli) - CLI for this module +- [public-ip](https://github.com/sindresorhus/public-ip) - Get your public IP address +- [default-gateway](https://github.com/silverwind/default-gateway) - Get your default gateway address + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/ip-regex/index.js b/node_modules/ip-regex/index.js new file mode 100644 index 000000000..973e5f41c --- /dev/null +++ b/node_modules/ip-regex/index.js @@ -0,0 +1,24 @@ +'use strict'; + +const v4 = '(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}'; + +const v6seg = '[0-9a-fA-F]{1,4}'; +const v6 = ` +( +(?:${v6seg}:){7}(?:${v6seg}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8 +(?:${v6seg}:){6}(?:${v4}|:${v6seg}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4 +(?:${v6seg}:){5}(?::${v4}|(:${v6seg}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4 +(?:${v6seg}:){4}(?:(:${v6seg}){0,1}:${v4}|(:${v6seg}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4 +(?:${v6seg}:){3}(?:(:${v6seg}){0,2}:${v4}|(:${v6seg}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4 +(?:${v6seg}:){2}(?:(:${v6seg}){0,3}:${v4}|(:${v6seg}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4 +(?:${v6seg}:){1}(?:(:${v6seg}){0,4}:${v4}|(:${v6seg}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4 +(?::((?::${v6seg}){0,5}:${v4}|(?::${v6seg}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4 +)(%[0-9a-zA-Z]{1,})? // %eth0 %1 +`.replace(/\s*\/\/.*$/gm, '').replace(/\n/g, '').trim(); + +const ip = module.exports = opts => opts && opts.exact ? + new RegExp(`(?:^${v4}$)|(?:^${v6}$)`) : + new RegExp(`(?:${v4})|(?:${v6})`, 'g'); + +ip.v4 = opts => opts && opts.exact ? new RegExp(`^${v4}$`) : new RegExp(v4, 'g'); +ip.v6 = opts => opts && opts.exact ? new RegExp(`^${v6}$`) : new RegExp(v6, 'g'); diff --git a/node_modules/ip-regex/license b/node_modules/ip-regex/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/ip-regex/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/ip-regex/package.json b/node_modules/ip-regex/package.json new file mode 100644 index 000000000..6f951eeaf --- /dev/null +++ b/node_modules/ip-regex/package.json @@ -0,0 +1,77 @@ +{ + "_from": "ip-regex@^2.1.0", + "_id": "ip-regex@2.1.0", + "_inBundle": false, + "_integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", + "_location": "/ip-regex", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ip-regex@^2.1.0", + "name": "ip-regex", + "escapedName": "ip-regex", + "rawSpec": "^2.1.0", + "saveSpec": null, + "fetchSpec": "^2.1.0" + }, + "_requiredBy": [ + "/default-gateway" + ], + "_resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", + "_shasum": "fa78bf5d2e6913c911ce9f819ee5146bb6d844e9", + "_spec": "ip-regex@^2.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/default-gateway", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/ip-regex/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Regular expression for matching IP addresses (IPv4 & IPv6)", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/ip-regex#readme", + "keywords": [ + "ip", + "ipv6", + "ipv4", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "text", + "pattern", + "internet", + "protocol", + "address", + "validate" + ], + "license": "MIT", + "name": "ip-regex", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/ip-regex.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.1.0", + "xo": { + "esnext": true + } +} diff --git a/node_modules/ip-regex/readme.md b/node_modules/ip-regex/readme.md new file mode 100644 index 000000000..66bc7f273 --- /dev/null +++ b/node_modules/ip-regex/readme.md @@ -0,0 +1,63 @@ +# ip-regex [![Build Status](https://travis-ci.org/sindresorhus/ip-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/ip-regex) + +> Regular expression for matching IP addresses + + +## Install + +``` +$ npm install --save ip-regex +``` + + +## Usage + +```js +const ipRegex = require('ip-regex'); + +// Contains an IP address? +ipRegex().test('unicorn 192.168.0.1'); +//=> true + +// Is an IP address? +ipRegex({exact: true}).test('unicorn 192.168.0.1'); +//=> false + +ipRegex.v6({exact: true}).test('1:2:3:4:5:6:7:8'); +//=> true + +'unicorn 192.168.0.1 cake 1:2:3:4:5:6:7:8 rainbow'.match(ipRegex()); +//=> ['192.168.0.1', '1:2:3:4:5:6:7:8'] +``` + + +## API + +### ipRegex([options]) + +Returns a regex for matching both IPv4 and IPv6. + +### ipRegex.v4([options]) + +Returns a regex for matching IPv4. + +### ipRegex.v6([options]) + +Returns a regex for matching IPv6. + +#### options.exact + +Type: `boolean`
+Default: `false` *(Matches any IP address in a string)* + +Only match an exact string. Useful with `RegExp#test()` to check if a string is an IP address. + + +## Related + +- [is-ip](https://github.com/sindresorhus/is-ip) - Check if a string is an IP address + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/ipaddr.js/README.md b/node_modules/ipaddr.js/README.md new file mode 100644 index 000000000..6876a3b82 --- /dev/null +++ b/node_modules/ipaddr.js/README.md @@ -0,0 +1,233 @@ +# ipaddr.js — an IPv6 and IPv4 address manipulation library [![Build Status](https://travis-ci.org/whitequark/ipaddr.js.svg)](https://travis-ci.org/whitequark/ipaddr.js) + +ipaddr.js is a small (1.9K minified and gzipped) library for manipulating +IP addresses in JavaScript environments. It runs on both CommonJS runtimes +(e.g. [nodejs]) and in a web browser. + +ipaddr.js allows you to verify and parse string representation of an IP +address, match it against a CIDR range or range list, determine if it falls +into some reserved ranges (examples include loopback and private ranges), +and convert between IPv4 and IPv4-mapped IPv6 addresses. + +[nodejs]: http://nodejs.org + +## Installation + +`npm install ipaddr.js` + +or + +`bower install ipaddr.js` + +## API + +ipaddr.js defines one object in the global scope: `ipaddr`. In CommonJS, +it is exported from the module: + +```js +var ipaddr = require('ipaddr.js'); +``` + +The API consists of several global methods and two classes: ipaddr.IPv6 and ipaddr.IPv4. + +### Global methods + +There are three global methods defined: `ipaddr.isValid`, `ipaddr.parse` and +`ipaddr.process`. All of them receive a string as a single parameter. + +The `ipaddr.isValid` method returns `true` if the address is a valid IPv4 or +IPv6 address, and `false` otherwise. It does not throw any exceptions. + +The `ipaddr.parse` method returns an object representing the IP address, +or throws an `Error` if the passed string is not a valid representation of an +IP address. + +The `ipaddr.process` method works just like the `ipaddr.parse` one, but it +automatically converts IPv4-mapped IPv6 addresses to their IPv4 counterparts +before returning. It is useful when you have a Node.js instance listening +on an IPv6 socket, and the `net.ivp6.bindv6only` sysctl parameter (or its +equivalent on non-Linux OS) is set to 0. In this case, you can accept IPv4 +connections on your IPv6-only socket, but the remote address will be mangled. +Use `ipaddr.process` method to automatically demangle it. + +### Object representation + +Parsing methods return an object which descends from `ipaddr.IPv6` or +`ipaddr.IPv4`. These objects share some properties, but most of them differ. + +#### Shared properties + +One can determine the type of address by calling `addr.kind()`. It will return +either `"ipv6"` or `"ipv4"`. + +An address can be converted back to its string representation with `addr.toString()`. +Note that this method: + * does not return the original string used to create the object (in fact, there is + no way of getting that string) + * returns a compact representation (when it is applicable) + +A `match(range, bits)` method can be used to check if the address falls into a +certain CIDR range. +Note that an address can be (obviously) matched only against an address of the same type. + +For example: + +```js +var addr = ipaddr.parse("2001:db8:1234::1"); +var range = ipaddr.parse("2001:db8::"); + +addr.match(range, 32); // => true +``` + +Alternatively, `match` can also be called as `match([range, bits])`. In this way, +it can be used together with the `parseCIDR(string)` method, which parses an IP +address together with a CIDR range. + +For example: + +```js +var addr = ipaddr.parse("2001:db8:1234::1"); + +addr.match(ipaddr.parseCIDR("2001:db8::/32")); // => true +``` + +A `range()` method returns one of predefined names for several special ranges defined +by IP protocols. The exact names (and their respective CIDR ranges) can be looked up +in the source: [IPv6 ranges] and [IPv4 ranges]. Some common ones include `"unicast"` +(the default one) and `"reserved"`. + +You can match against your own range list by using +`ipaddr.subnetMatch(address, rangeList, defaultName)` method. It can work with a mix of IPv6 or IPv4 addresses, and accepts a name-to-subnet map as the range list. For example: + +```js +var rangeList = { + documentationOnly: [ ipaddr.parse('2001:db8::'), 32 ], + tunnelProviders: [ + [ ipaddr.parse('2001:470::'), 32 ], // he.net + [ ipaddr.parse('2001:5c0::'), 32 ] // freenet6 + ] +}; +ipaddr.subnetMatch(ipaddr.parse('2001:470:8:66::1'), rangeList, 'unknown'); // => "tunnelProviders" +``` + +The addresses can be converted to their byte representation with `toByteArray()`. +(Actually, JavaScript mostly does not know about byte buffers. They are emulated with +arrays of numbers, each in range of 0..255.) + +```js +var bytes = ipaddr.parse('2a00:1450:8007::68').toByteArray(); // ipv6.google.com +bytes // => [42, 0x00, 0x14, 0x50, 0x80, 0x07, 0x00, , 0x00, 0x68 ] +``` + +The `ipaddr.IPv4` and `ipaddr.IPv6` objects have some methods defined, too. All of them +have the same interface for both protocols, and are similar to global methods. + +`ipaddr.IPvX.isValid(string)` can be used to check if the string is a valid address +for particular protocol, and `ipaddr.IPvX.parse(string)` is the error-throwing parser. + +`ipaddr.IPvX.isValid(string)` uses the same format for parsing as the POSIX `inet_ntoa` function, which accepts unusual formats like `0xc0.168.1.1` or `0x10000000`. The function `ipaddr.IPv4.isValidFourPartDecimal(string)` validates the IPv4 address and also ensures that it is written in four-part decimal format. + +[IPv6 ranges]: https://github.com/whitequark/ipaddr.js/blob/master/src/ipaddr.coffee#L186 +[IPv4 ranges]: https://github.com/whitequark/ipaddr.js/blob/master/src/ipaddr.coffee#L71 + +#### IPv6 properties + +Sometimes you will want to convert IPv6 not to a compact string representation (with +the `::` substitution); the `toNormalizedString()` method will return an address where +all zeroes are explicit. + +For example: + +```js +var addr = ipaddr.parse("2001:0db8::0001"); +addr.toString(); // => "2001:db8::1" +addr.toNormalizedString(); // => "2001:db8:0:0:0:0:0:1" +``` + +The `isIPv4MappedAddress()` method will return `true` if this address is an IPv4-mapped +one, and `toIPv4Address()` will return an IPv4 object address. + +To access the underlying binary representation of the address, use `addr.parts`. + +```js +var addr = ipaddr.parse("2001:db8:10::1234:DEAD"); +addr.parts // => [0x2001, 0xdb8, 0x10, 0, 0, 0, 0x1234, 0xdead] +``` + +A IPv6 zone index can be accessed via `addr.zoneId`: + +```js +var addr = ipaddr.parse("2001:db8::%eth0"); +addr.zoneId // => 'eth0' +``` + +#### IPv4 properties + +`toIPv4MappedAddress()` will return a corresponding IPv4-mapped IPv6 address. + +To access the underlying representation of the address, use `addr.octets`. + +```js +var addr = ipaddr.parse("192.168.1.1"); +addr.octets // => [192, 168, 1, 1] +``` + +`prefixLengthFromSubnetMask()` will return a CIDR prefix length for a valid IPv4 netmask or +false if the netmask is not valid. + +```js +ipaddr.IPv4.parse('255.255.255.240').prefixLengthFromSubnetMask() == 28 +ipaddr.IPv4.parse('255.192.164.0').prefixLengthFromSubnetMask() == null +``` + +`subnetMaskFromPrefixLength()` will return an IPv4 netmask for a valid CIDR prefix length. + +```js +ipaddr.IPv4.subnetMaskFromPrefixLength(24) == "255.255.255.0" +ipaddr.IPv4.subnetMaskFromPrefixLength(29) == "255.255.255.248" +``` + +`broadcastAddressFromCIDR()` will return the broadcast address for a given IPv4 interface and netmask in CIDR notation. +```js +ipaddr.IPv4.broadcastAddressFromCIDR("172.0.0.1/24") == "172.0.0.255" +``` +`networkAddressFromCIDR()` will return the network address for a given IPv4 interface and netmask in CIDR notation. +```js +ipaddr.IPv4.networkAddressFromCIDR("172.0.0.1/24") == "172.0.0.0" +``` + +#### Conversion + +IPv4 and IPv6 can be converted bidirectionally to and from network byte order (MSB) byte arrays. + +The `fromByteArray()` method will take an array and create an appropriate IPv4 or IPv6 object +if the input satisfies the requirements. For IPv4 it has to be an array of four 8-bit values, +while for IPv6 it has to be an array of sixteen 8-bit values. + +For example: +```js +var addr = ipaddr.fromByteArray([0x7f, 0, 0, 1]); +addr.toString(); // => "127.0.0.1" +``` + +or + +```js +var addr = ipaddr.fromByteArray([0x20, 1, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]) +addr.toString(); // => "2001:db8::1" +``` + +Both objects also offer a `toByteArray()` method, which returns an array in network byte order (MSB). + +For example: +```js +var addr = ipaddr.parse("127.0.0.1"); +addr.toByteArray(); // => [0x7f, 0, 0, 1] +``` + +or + +```js +var addr = ipaddr.parse("2001:db8::1"); +addr.toByteArray(); // => [0x20, 1, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] +``` diff --git a/node_modules/ipaddr.js/ipaddr.min.js b/node_modules/ipaddr.js/ipaddr.min.js new file mode 100644 index 000000000..56c227caf --- /dev/null +++ b/node_modules/ipaddr.js/ipaddr.min.js @@ -0,0 +1 @@ +(function(){var r,t,n,e,i,o,a,s;t={},s=this,"undefined"!=typeof module&&null!==module&&module.exports?module.exports=t:s.ipaddr=t,a=function(r,t,n,e){var i,o;if(r.length!==t.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");for(i=0;e>0;){if((o=n-e)<0&&(o=0),r[i]>>o!=t[i]>>o)return!1;e-=n,i+=1}return!0},t.subnetMatch=function(r,t,n){var e,i,o,a,s;null==n&&(n="unicast");for(o in t)for(!(a=t[o])[0]||a[0]instanceof Array||(a=[a]),e=0,i=a.length;e=0;t=n+=-1){if(!((e=this.octets[t])in a))return null;if(o=a[e],i&&0!==o)return null;8!==o&&(i=!0),r+=o}return 32-r},r}(),n="(0?\\d+|0x[a-f0-9]+)",e={fourOctet:new RegExp("^"+n+"\\."+n+"\\."+n+"\\."+n+"$","i"),longValue:new RegExp("^"+n+"$","i")},t.IPv4.parser=function(r){var t,n,i,o,a;if(n=function(r){return"0"===r[0]&&"x"!==r[1]?parseInt(r,8):parseInt(r)},t=r.match(e.fourOctet))return function(){var r,e,o,a;for(a=[],r=0,e=(o=t.slice(1,6)).length;r4294967295||a<0)throw new Error("ipaddr: address outside defined range");return function(){var r,t;for(t=[],o=r=0;r<=24;o=r+=8)t.push(a>>o&255);return t}().reverse()}return null},t.IPv6=function(){function r(r,t){var n,e,i,o,a,s;if(16===r.length)for(this.parts=[],n=e=0;e<=14;n=e+=2)this.parts.push(r[n]<<8|r[n+1]);else{if(8!==r.length)throw new Error("ipaddr: ipv6 part count should be 8 or 16");this.parts=r}for(i=0,o=(s=this.parts).length;i>8),r.push(255&e);return r},r.prototype.toNormalizedString=function(){var r,t,n;return r=function(){var r,n,e,i;for(i=[],r=0,n=(e=this.parts).length;r>8,255&r,n>>8,255&n])},r.prototype.prefixLengthFromSubnetMask=function(){var r,t,n,e,i,o,a;for(a={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},r=0,i=!1,t=n=7;n>=0;t=n+=-1){if(!((e=this.parts[t])in a))return null;if(o=a[e],i&&0!==o)return null;16!==o&&(i=!0),r+=o}return 128-r},r}(),i="(?:[0-9a-f]+::?)+",o={zoneIndex:new RegExp("%[0-9a-z]{1,}","i"),native:new RegExp("^(::)?("+i+")?([0-9a-f]+)?(::)?(%[0-9a-z]{1,})?$","i"),transitional:new RegExp("^((?:"+i+")|(?:::)(?:"+i+")?)"+n+"\\."+n+"\\."+n+"\\."+n+"(%[0-9a-z]{1,})?$","i")},r=function(r,t){var n,e,i,a,s,p;if(r.indexOf("::")!==r.lastIndexOf("::"))return null;for((p=(r.match(o.zoneIndex)||[])[0])&&(p=p.substring(1),r=r.replace(/%.+$/,"")),n=0,e=-1;(e=r.indexOf(":",e+1))>=0;)n++;if("::"===r.substr(0,2)&&n--,"::"===r.substr(-2,2)&&n--,n>t)return null;for(s=t-n,a=":";s--;)a+="0:";return":"===(r=r.replace("::",a))[0]&&(r=r.slice(1)),":"===r[r.length-1]&&(r=r.slice(0,-1)),t=function(){var t,n,e,o;for(o=[],t=0,n=(e=r.split(":")).length;t=0&&t<=32)return e=[this.parse(n[1]),t],Object.defineProperty(e,"toString",{value:function(){return this.join("/")}}),e;throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},t.IPv4.subnetMaskFromPrefixLength=function(r){var t,n,e;if((r=parseInt(r))<0||r>32)throw new Error("ipaddr: invalid IPv4 prefix length");for(e=[0,0,0,0],n=0,t=Math.floor(r/8);n=0&&t<=128)return e=[this.parse(n[1]),t],Object.defineProperty(e,"toString",{value:function(){return this.join("/")}}),e;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},t.isValid=function(r){return t.IPv6.isValid(r)||t.IPv4.isValid(r)},t.parse=function(r){if(t.IPv6.isValid(r))return t.IPv6.parse(r);if(t.IPv4.isValid(r))return t.IPv4.parse(r);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},t.parseCIDR=function(r){try{return t.IPv6.parseCIDR(r)}catch(n){n;try{return t.IPv4.parseCIDR(r)}catch(r){throw r,new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},t.fromByteArray=function(r){var n;if(4===(n=r.length))return new t.IPv4(r);if(16===n)return new t.IPv6(r);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},t.process=function(r){var t;return"ipv6"===(t=this.parse(r)).kind()&&t.isIPv4MappedAddress()?t.toIPv4Address():t}}).call(this); \ No newline at end of file diff --git a/node_modules/ipaddr.js/lib/ipaddr.js b/node_modules/ipaddr.js/lib/ipaddr.js new file mode 100644 index 000000000..ab5d74b4e --- /dev/null +++ b/node_modules/ipaddr.js/lib/ipaddr.js @@ -0,0 +1,636 @@ +(function() { + var expandIPv6, ipaddr, ipv4Part, ipv4Regexes, ipv6Part, ipv6Regexes, matchCIDR, root, zoneIndex; + + ipaddr = {}; + + root = this; + + if ((typeof module !== "undefined" && module !== null) && module.exports) { + module.exports = ipaddr; + } else { + root['ipaddr'] = ipaddr; + } + + matchCIDR = function(first, second, partSize, cidrBits) { + var part, shift; + if (first.length !== second.length) { + throw new Error("ipaddr: cannot match CIDR for objects with different lengths"); + } + part = 0; + while (cidrBits > 0) { + shift = partSize - cidrBits; + if (shift < 0) { + shift = 0; + } + if (first[part] >> shift !== second[part] >> shift) { + return false; + } + cidrBits -= partSize; + part += 1; + } + return true; + }; + + ipaddr.subnetMatch = function(address, rangeList, defaultName) { + var k, len, rangeName, rangeSubnets, subnet; + if (defaultName == null) { + defaultName = 'unicast'; + } + for (rangeName in rangeList) { + rangeSubnets = rangeList[rangeName]; + if (rangeSubnets[0] && !(rangeSubnets[0] instanceof Array)) { + rangeSubnets = [rangeSubnets]; + } + for (k = 0, len = rangeSubnets.length; k < len; k++) { + subnet = rangeSubnets[k]; + if (address.kind() === subnet[0].kind()) { + if (address.match.apply(address, subnet)) { + return rangeName; + } + } + } + } + return defaultName; + }; + + ipaddr.IPv4 = (function() { + function IPv4(octets) { + var k, len, octet; + if (octets.length !== 4) { + throw new Error("ipaddr: ipv4 octet count should be 4"); + } + for (k = 0, len = octets.length; k < len; k++) { + octet = octets[k]; + if (!((0 <= octet && octet <= 255))) { + throw new Error("ipaddr: ipv4 octet should fit in 8 bits"); + } + } + this.octets = octets; + } + + IPv4.prototype.kind = function() { + return 'ipv4'; + }; + + IPv4.prototype.toString = function() { + return this.octets.join("."); + }; + + IPv4.prototype.toNormalizedString = function() { + return this.toString(); + }; + + IPv4.prototype.toByteArray = function() { + return this.octets.slice(0); + }; + + IPv4.prototype.match = function(other, cidrRange) { + var ref; + if (cidrRange === void 0) { + ref = other, other = ref[0], cidrRange = ref[1]; + } + if (other.kind() !== 'ipv4') { + throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one"); + } + return matchCIDR(this.octets, other.octets, 8, cidrRange); + }; + + IPv4.prototype.SpecialRanges = { + unspecified: [[new IPv4([0, 0, 0, 0]), 8]], + broadcast: [[new IPv4([255, 255, 255, 255]), 32]], + multicast: [[new IPv4([224, 0, 0, 0]), 4]], + linkLocal: [[new IPv4([169, 254, 0, 0]), 16]], + loopback: [[new IPv4([127, 0, 0, 0]), 8]], + carrierGradeNat: [[new IPv4([100, 64, 0, 0]), 10]], + "private": [[new IPv4([10, 0, 0, 0]), 8], [new IPv4([172, 16, 0, 0]), 12], [new IPv4([192, 168, 0, 0]), 16]], + reserved: [[new IPv4([192, 0, 0, 0]), 24], [new IPv4([192, 0, 2, 0]), 24], [new IPv4([192, 88, 99, 0]), 24], [new IPv4([198, 51, 100, 0]), 24], [new IPv4([203, 0, 113, 0]), 24], [new IPv4([240, 0, 0, 0]), 4]] + }; + + IPv4.prototype.range = function() { + return ipaddr.subnetMatch(this, this.SpecialRanges); + }; + + IPv4.prototype.toIPv4MappedAddress = function() { + return ipaddr.IPv6.parse("::ffff:" + (this.toString())); + }; + + IPv4.prototype.prefixLengthFromSubnetMask = function() { + var cidr, i, k, octet, stop, zeros, zerotable; + zerotable = { + 0: 8, + 128: 7, + 192: 6, + 224: 5, + 240: 4, + 248: 3, + 252: 2, + 254: 1, + 255: 0 + }; + cidr = 0; + stop = false; + for (i = k = 3; k >= 0; i = k += -1) { + octet = this.octets[i]; + if (octet in zerotable) { + zeros = zerotable[octet]; + if (stop && zeros !== 0) { + return null; + } + if (zeros !== 8) { + stop = true; + } + cidr += zeros; + } else { + return null; + } + } + return 32 - cidr; + }; + + return IPv4; + + })(); + + ipv4Part = "(0?\\d+|0x[a-f0-9]+)"; + + ipv4Regexes = { + fourOctet: new RegExp("^" + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "$", 'i'), + longValue: new RegExp("^" + ipv4Part + "$", 'i') + }; + + ipaddr.IPv4.parser = function(string) { + var match, parseIntAuto, part, shift, value; + parseIntAuto = function(string) { + if (string[0] === "0" && string[1] !== "x") { + return parseInt(string, 8); + } else { + return parseInt(string); + } + }; + if (match = string.match(ipv4Regexes.fourOctet)) { + return (function() { + var k, len, ref, results; + ref = match.slice(1, 6); + results = []; + for (k = 0, len = ref.length; k < len; k++) { + part = ref[k]; + results.push(parseIntAuto(part)); + } + return results; + })(); + } else if (match = string.match(ipv4Regexes.longValue)) { + value = parseIntAuto(match[1]); + if (value > 0xffffffff || value < 0) { + throw new Error("ipaddr: address outside defined range"); + } + return ((function() { + var k, results; + results = []; + for (shift = k = 0; k <= 24; shift = k += 8) { + results.push((value >> shift) & 0xff); + } + return results; + })()).reverse(); + } else { + return null; + } + }; + + ipaddr.IPv6 = (function() { + function IPv6(parts, zoneId) { + var i, k, l, len, part, ref; + if (parts.length === 16) { + this.parts = []; + for (i = k = 0; k <= 14; i = k += 2) { + this.parts.push((parts[i] << 8) | parts[i + 1]); + } + } else if (parts.length === 8) { + this.parts = parts; + } else { + throw new Error("ipaddr: ipv6 part count should be 8 or 16"); + } + ref = this.parts; + for (l = 0, len = ref.length; l < len; l++) { + part = ref[l]; + if (!((0 <= part && part <= 0xffff))) { + throw new Error("ipaddr: ipv6 part should fit in 16 bits"); + } + } + if (zoneId) { + this.zoneId = zoneId; + } + } + + IPv6.prototype.kind = function() { + return 'ipv6'; + }; + + IPv6.prototype.toString = function() { + return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/, '::'); + }; + + IPv6.prototype.toByteArray = function() { + var bytes, k, len, part, ref; + bytes = []; + ref = this.parts; + for (k = 0, len = ref.length; k < len; k++) { + part = ref[k]; + bytes.push(part >> 8); + bytes.push(part & 0xff); + } + return bytes; + }; + + IPv6.prototype.toNormalizedString = function() { + var addr, part, suffix; + addr = ((function() { + var k, len, ref, results; + ref = this.parts; + results = []; + for (k = 0, len = ref.length; k < len; k++) { + part = ref[k]; + results.push(part.toString(16)); + } + return results; + }).call(this)).join(":"); + suffix = ''; + if (this.zoneId) { + suffix = '%' + this.zoneId; + } + return addr + suffix; + }; + + IPv6.prototype.match = function(other, cidrRange) { + var ref; + if (cidrRange === void 0) { + ref = other, other = ref[0], cidrRange = ref[1]; + } + if (other.kind() !== 'ipv6') { + throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one"); + } + return matchCIDR(this.parts, other.parts, 16, cidrRange); + }; + + IPv6.prototype.SpecialRanges = { + unspecified: [new IPv6([0, 0, 0, 0, 0, 0, 0, 0]), 128], + linkLocal: [new IPv6([0xfe80, 0, 0, 0, 0, 0, 0, 0]), 10], + multicast: [new IPv6([0xff00, 0, 0, 0, 0, 0, 0, 0]), 8], + loopback: [new IPv6([0, 0, 0, 0, 0, 0, 0, 1]), 128], + uniqueLocal: [new IPv6([0xfc00, 0, 0, 0, 0, 0, 0, 0]), 7], + ipv4Mapped: [new IPv6([0, 0, 0, 0, 0, 0xffff, 0, 0]), 96], + rfc6145: [new IPv6([0, 0, 0, 0, 0xffff, 0, 0, 0]), 96], + rfc6052: [new IPv6([0x64, 0xff9b, 0, 0, 0, 0, 0, 0]), 96], + '6to4': [new IPv6([0x2002, 0, 0, 0, 0, 0, 0, 0]), 16], + teredo: [new IPv6([0x2001, 0, 0, 0, 0, 0, 0, 0]), 32], + reserved: [[new IPv6([0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]), 32]] + }; + + IPv6.prototype.range = function() { + return ipaddr.subnetMatch(this, this.SpecialRanges); + }; + + IPv6.prototype.isIPv4MappedAddress = function() { + return this.range() === 'ipv4Mapped'; + }; + + IPv6.prototype.toIPv4Address = function() { + var high, low, ref; + if (!this.isIPv4MappedAddress()) { + throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4"); + } + ref = this.parts.slice(-2), high = ref[0], low = ref[1]; + return new ipaddr.IPv4([high >> 8, high & 0xff, low >> 8, low & 0xff]); + }; + + IPv6.prototype.prefixLengthFromSubnetMask = function() { + var cidr, i, k, part, stop, zeros, zerotable; + zerotable = { + 0: 16, + 32768: 15, + 49152: 14, + 57344: 13, + 61440: 12, + 63488: 11, + 64512: 10, + 65024: 9, + 65280: 8, + 65408: 7, + 65472: 6, + 65504: 5, + 65520: 4, + 65528: 3, + 65532: 2, + 65534: 1, + 65535: 0 + }; + cidr = 0; + stop = false; + for (i = k = 7; k >= 0; i = k += -1) { + part = this.parts[i]; + if (part in zerotable) { + zeros = zerotable[part]; + if (stop && zeros !== 0) { + return null; + } + if (zeros !== 16) { + stop = true; + } + cidr += zeros; + } else { + return null; + } + } + return 128 - cidr; + }; + + return IPv6; + + })(); + + ipv6Part = "(?:[0-9a-f]+::?)+"; + + zoneIndex = "%[0-9a-z]{1,}"; + + ipv6Regexes = { + zoneIndex: new RegExp(zoneIndex, 'i'), + "native": new RegExp("^(::)?(" + ipv6Part + ")?([0-9a-f]+)?(::)?(" + zoneIndex + ")?$", 'i'), + transitional: new RegExp(("^((?:" + ipv6Part + ")|(?:::)(?:" + ipv6Part + ")?)") + (ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part) + ("(" + zoneIndex + ")?$"), 'i') + }; + + expandIPv6 = function(string, parts) { + var colonCount, lastColon, part, replacement, replacementCount, zoneId; + if (string.indexOf('::') !== string.lastIndexOf('::')) { + return null; + } + zoneId = (string.match(ipv6Regexes['zoneIndex']) || [])[0]; + if (zoneId) { + zoneId = zoneId.substring(1); + string = string.replace(/%.+$/, ''); + } + colonCount = 0; + lastColon = -1; + while ((lastColon = string.indexOf(':', lastColon + 1)) >= 0) { + colonCount++; + } + if (string.substr(0, 2) === '::') { + colonCount--; + } + if (string.substr(-2, 2) === '::') { + colonCount--; + } + if (colonCount > parts) { + return null; + } + replacementCount = parts - colonCount; + replacement = ':'; + while (replacementCount--) { + replacement += '0:'; + } + string = string.replace('::', replacement); + if (string[0] === ':') { + string = string.slice(1); + } + if (string[string.length - 1] === ':') { + string = string.slice(0, -1); + } + parts = (function() { + var k, len, ref, results; + ref = string.split(":"); + results = []; + for (k = 0, len = ref.length; k < len; k++) { + part = ref[k]; + results.push(parseInt(part, 16)); + } + return results; + })(); + return { + parts: parts, + zoneId: zoneId + }; + }; + + ipaddr.IPv6.parser = function(string) { + var addr, k, len, match, octet, octets, zoneId; + if (ipv6Regexes['native'].test(string)) { + return expandIPv6(string, 8); + } else if (match = string.match(ipv6Regexes['transitional'])) { + zoneId = match[6] || ''; + addr = expandIPv6(match[1].slice(0, -1) + zoneId, 6); + if (addr.parts) { + octets = [parseInt(match[2]), parseInt(match[3]), parseInt(match[4]), parseInt(match[5])]; + for (k = 0, len = octets.length; k < len; k++) { + octet = octets[k]; + if (!((0 <= octet && octet <= 255))) { + return null; + } + } + addr.parts.push(octets[0] << 8 | octets[1]); + addr.parts.push(octets[2] << 8 | octets[3]); + return { + parts: addr.parts, + zoneId: addr.zoneId + }; + } + } + return null; + }; + + ipaddr.IPv4.isIPv4 = ipaddr.IPv6.isIPv6 = function(string) { + return this.parser(string) !== null; + }; + + ipaddr.IPv4.isValid = function(string) { + var e; + try { + new this(this.parser(string)); + return true; + } catch (error1) { + e = error1; + return false; + } + }; + + ipaddr.IPv4.isValidFourPartDecimal = function(string) { + if (ipaddr.IPv4.isValid(string) && string.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/)) { + return true; + } else { + return false; + } + }; + + ipaddr.IPv6.isValid = function(string) { + var addr, e; + if (typeof string === "string" && string.indexOf(":") === -1) { + return false; + } + try { + addr = this.parser(string); + new this(addr.parts, addr.zoneId); + return true; + } catch (error1) { + e = error1; + return false; + } + }; + + ipaddr.IPv4.parse = function(string) { + var parts; + parts = this.parser(string); + if (parts === null) { + throw new Error("ipaddr: string is not formatted like ip address"); + } + return new this(parts); + }; + + ipaddr.IPv6.parse = function(string) { + var addr; + addr = this.parser(string); + if (addr.parts === null) { + throw new Error("ipaddr: string is not formatted like ip address"); + } + return new this(addr.parts, addr.zoneId); + }; + + ipaddr.IPv4.parseCIDR = function(string) { + var maskLength, match, parsed; + if (match = string.match(/^(.+)\/(\d+)$/)) { + maskLength = parseInt(match[2]); + if (maskLength >= 0 && maskLength <= 32) { + parsed = [this.parse(match[1]), maskLength]; + Object.defineProperty(parsed, 'toString', { + value: function() { + return this.join('/'); + } + }); + return parsed; + } + } + throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range"); + }; + + ipaddr.IPv4.subnetMaskFromPrefixLength = function(prefix) { + var filledOctetCount, j, octets; + prefix = parseInt(prefix); + if (prefix < 0 || prefix > 32) { + throw new Error('ipaddr: invalid IPv4 prefix length'); + } + octets = [0, 0, 0, 0]; + j = 0; + filledOctetCount = Math.floor(prefix / 8); + while (j < filledOctetCount) { + octets[j] = 255; + j++; + } + if (filledOctetCount < 4) { + octets[filledOctetCount] = Math.pow(2, prefix % 8) - 1 << 8 - (prefix % 8); + } + return new this(octets); + }; + + ipaddr.IPv4.broadcastAddressFromCIDR = function(string) { + var cidr, error, i, ipInterfaceOctets, octets, subnetMaskOctets; + try { + cidr = this.parseCIDR(string); + ipInterfaceOctets = cidr[0].toByteArray(); + subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray(); + octets = []; + i = 0; + while (i < 4) { + octets.push(parseInt(ipInterfaceOctets[i], 10) | parseInt(subnetMaskOctets[i], 10) ^ 255); + i++; + } + return new this(octets); + } catch (error1) { + error = error1; + throw new Error('ipaddr: the address does not have IPv4 CIDR format'); + } + }; + + ipaddr.IPv4.networkAddressFromCIDR = function(string) { + var cidr, error, i, ipInterfaceOctets, octets, subnetMaskOctets; + try { + cidr = this.parseCIDR(string); + ipInterfaceOctets = cidr[0].toByteArray(); + subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray(); + octets = []; + i = 0; + while (i < 4) { + octets.push(parseInt(ipInterfaceOctets[i], 10) & parseInt(subnetMaskOctets[i], 10)); + i++; + } + return new this(octets); + } catch (error1) { + error = error1; + throw new Error('ipaddr: the address does not have IPv4 CIDR format'); + } + }; + + ipaddr.IPv6.parseCIDR = function(string) { + var maskLength, match, parsed; + if (match = string.match(/^(.+)\/(\d+)$/)) { + maskLength = parseInt(match[2]); + if (maskLength >= 0 && maskLength <= 128) { + parsed = [this.parse(match[1]), maskLength]; + Object.defineProperty(parsed, 'toString', { + value: function() { + return this.join('/'); + } + }); + return parsed; + } + } + throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range"); + }; + + ipaddr.isValid = function(string) { + return ipaddr.IPv6.isValid(string) || ipaddr.IPv4.isValid(string); + }; + + ipaddr.parse = function(string) { + if (ipaddr.IPv6.isValid(string)) { + return ipaddr.IPv6.parse(string); + } else if (ipaddr.IPv4.isValid(string)) { + return ipaddr.IPv4.parse(string); + } else { + throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format"); + } + }; + + ipaddr.parseCIDR = function(string) { + var e; + try { + return ipaddr.IPv6.parseCIDR(string); + } catch (error1) { + e = error1; + try { + return ipaddr.IPv4.parseCIDR(string); + } catch (error1) { + e = error1; + throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format"); + } + } + }; + + ipaddr.fromByteArray = function(bytes) { + var length; + length = bytes.length; + if (length === 4) { + return new ipaddr.IPv4(bytes); + } else if (length === 16) { + return new ipaddr.IPv6(bytes); + } else { + throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address"); + } + }; + + ipaddr.process = function(string) { + var addr; + addr = this.parse(string); + if (addr.kind() === 'ipv6' && addr.isIPv4MappedAddress()) { + return addr.toIPv4Address(); + } else { + return addr; + } + }; + +}).call(this); diff --git a/node_modules/ipaddr.js/lib/ipaddr.js.d.ts b/node_modules/ipaddr.js/lib/ipaddr.js.d.ts new file mode 100644 index 000000000..ef01ac4fb --- /dev/null +++ b/node_modules/ipaddr.js/lib/ipaddr.js.d.ts @@ -0,0 +1,71 @@ + + +declare module "ipaddr.js" { + + type IPv4Range = 'unicast' | 'unspecified' | 'broadcast' | 'multicast' | 'linkLocal' | 'loopback' | 'carrierGradeNat' | 'private' | 'reserved'; + type IPv6Range = 'unicast' | 'unspecified' | 'linkLocal' | 'multicast' | 'loopback' | 'uniqueLocal' | 'ipv4Mapped' | 'rfc6145' | 'rfc6052' | '6to4' | 'teredo' | 'reserved'; + + interface RangeList { + [name: string]: [T, number] | [T, number][]; + } + + + // Common methods/properties for IPv4 and IPv6 classes. + class IP { + + prefixLengthFromSubnetMask(): number | false; + toByteArray(): number[]; + toNormalizedString(): string; + toString(): string; + } + + namespace Address { + + export function isValid(addr: string): boolean; + export function fromByteArray(bytes: number[]): IPv4 | IPv6; + export function parse(addr: string): IPv4 | IPv6; + export function parseCIDR(mask: string): [IPv4 | IPv6, number]; + export function process(address: string): IPv4 | IPv6; + export function subnetMatch(addr: IPv4, rangeList: RangeList, defaultName?: string): string; + export function subnetMatch(addr: IPv6, rangeList: RangeList, defaultName?: string): string; + + export class IPv4 extends IP { + static broadcastAddressFromCIDR(addr: string): IPv4; + static isIPv4(addr: string): boolean; + static isValidFourPartDecimal(addr: string): boolean; + static isValid(addr: string): boolean; + static networkAddressFromCIDR(addr: string): IPv4; + static parse(addr: string): IPv4; + static parseCIDR(addr: string): [IPv4, number]; + static subnetMaskFromPrefixLength(prefix: number): IPv4; + constructor(octets: number[]); + + kind(): 'ipv4'; + match(addr: IPv4, bits: number): boolean; + match(mask: [IPv4, number]): boolean; + range(): IPv4Range; + subnetMatch(rangeList: RangeList, defaultName?: string): string; + toIPv4MappedAddress(): IPv6; + } + + export class IPv6 extends IP { + static broadcastAddressFromCIDR(addr: string): IPv6; + static isIPv6(addr: string): boolean; + static isValid(addr: string): boolean; + static parse(addr: string): IPv6; + static parseCIDR(addr: string): [IPv6, number]; + static subnetMaskFromPrefixLength(prefix: number): IPv6; + constructor(octets: number[]); + + isIPv4MappedAddress(): boolean; + kind(): 'ipv6'; + match(addr: IPv6, bits: number): boolean; + match(mask: [IPv6, number]): boolean; + range(): IPv6Range; + subnetMatch(rangeList: RangeList, defaultName?: string): string; + toIPv4Address(): IPv4; + } + } + + export = Address; +} diff --git a/node_modules/ipaddr.js/package.json b/node_modules/ipaddr.js/package.json new file mode 100644 index 000000000..64d00bff3 --- /dev/null +++ b/node_modules/ipaddr.js/package.json @@ -0,0 +1,69 @@ +{ + "_from": "ipaddr.js@^1.5.2", + "_id": "ipaddr.js@1.8.1", + "_inBundle": false, + "_integrity": "sha1-+kt5+kf9Pe9eOxWYJRYcClGclCc=", + "_location": "/ipaddr.js", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ipaddr.js@^1.5.2", + "name": "ipaddr.js", + "escapedName": "ipaddr.js", + "rawSpec": "^1.5.2", + "saveSpec": null, + "fetchSpec": "^1.5.2" + }, + "_requiredBy": [ + "/internal-ip" + ], + "_resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.1.tgz", + "_shasum": "fa4b79fa47fd3def5e3b159825161c0a519c9427", + "_spec": "ipaddr.js@^1.5.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/internal-ip", + "author": { + "name": "whitequark", + "email": "whitequark@whitequark.org" + }, + "bugs": { + "url": "https://github.com/whitequark/ipaddr.js/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "A library for manipulating IPv4 and IPv6 addresses in JavaScript.", + "devDependencies": { + "coffee-script": "~1.12.6", + "nodeunit": ">=0.8.2 <0.8.7", + "uglify-js": "~3.0.19" + }, + "directories": { + "lib": "./lib" + }, + "engines": { + "node": ">= 0.10" + }, + "files": [ + "lib/", + "ipaddr.min.js" + ], + "homepage": "https://github.com/whitequark/ipaddr.js#readme", + "keywords": [ + "ip", + "ipv4", + "ipv6" + ], + "license": "MIT", + "main": "./lib/ipaddr.js", + "name": "ipaddr.js", + "repository": { + "type": "git", + "url": "git://github.com/whitequark/ipaddr.js.git" + }, + "scripts": { + "test": "cake build test" + }, + "types": "./lib/ipaddr.js.d.ts", + "version": "1.8.1" +} diff --git a/node_modules/is-accessor-descriptor/LICENSE b/node_modules/is-accessor-descriptor/LICENSE new file mode 100644 index 000000000..65f90aca8 --- /dev/null +++ b/node_modules/is-accessor-descriptor/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-accessor-descriptor/README.md b/node_modules/is-accessor-descriptor/README.md new file mode 100644 index 000000000..3743fe6bc --- /dev/null +++ b/node_modules/is-accessor-descriptor/README.md @@ -0,0 +1,123 @@ +# is-accessor-descriptor [![NPM version](https://img.shields.io/npm/v/is-accessor-descriptor.svg)](https://www.npmjs.com/package/is-accessor-descriptor) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-accessor-descriptor.svg)](https://travis-ci.org/jonschlinkert/is-accessor-descriptor) + +> Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. + +- [Install](#install) +- [Usage](#usage) +- [Examples](#examples) +- [API](#api) +- [Related projects](#related-projects) +- [Running tests](#running-tests) +- [Contributing](#contributing) +- [Author](#author) +- [License](#license) + +_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm i is-accessor-descriptor --save +``` + +## Usage + +```js +var isAccessor = require('is-accessor-descriptor'); + +isAccessor({get: function() {}}); +//=> true +``` + +You may also pass an object and property name to check if the property is an accessor: + +```js +isAccessor(foo, 'bar'); +``` + +## Examples + +`false` when not an object + +```js +isAccessor('a') +isAccessor(null) +isAccessor([]) +//=> false +``` + +`true` when the object has valid properties + +and the properties all have the correct JavaScript types: + +```js +isAccessor({get: noop, set: noop}) +isAccessor({get: noop}) +isAccessor({set: noop}) +//=> true +``` + +`false` when the object has invalid properties + +```js +isAccessor({get: noop, set: noop, bar: 'baz'}) +isAccessor({get: noop, writable: true}) +isAccessor({get: noop, value: true}) +//=> false +``` + +`false` when an accessor is not a function + +```js +isAccessor({get: noop, set: 'baz'}) +isAccessor({get: 'foo', set: noop}) +isAccessor({get: 'foo', bar: 'baz'}) +isAccessor({get: 'foo', set: 'baz'}) +//=> false +``` + +`false` when a value is not the correct type + +```js +isAccessor({get: noop, set: noop, enumerable: 'foo'}) +isAccessor({set: noop, configurable: 'foo'}) +isAccessor({get: noop, configurable: 'foo'}) +//=> false +``` + +## Related projects + +* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor) +* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor) +* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://www.npmjs.com/package/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor) +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject) + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-accessor-descriptor/issues/new). + +## Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert) +Released under the MIT license. + +*** + +_This file was generated by [verb](https://github.com/verbose/verb) on December 28, 2015._ \ No newline at end of file diff --git a/node_modules/is-accessor-descriptor/index.js b/node_modules/is-accessor-descriptor/index.js new file mode 100644 index 000000000..2ca4af8bd --- /dev/null +++ b/node_modules/is-accessor-descriptor/index.js @@ -0,0 +1,69 @@ +/*! + * is-accessor-descriptor + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var typeOf = require('kind-of'); + +// accessor descriptor properties +var accessor = { + get: 'function', + set: 'function', + configurable: 'boolean', + enumerable: 'boolean' +}; + +function isAccessorDescriptor(obj, prop) { + if (typeof prop === 'string') { + var val = Object.getOwnPropertyDescriptor(obj, prop); + return typeof val !== 'undefined'; + } + + if (typeOf(obj) !== 'object') { + return false; + } + + if (has(obj, 'value') || has(obj, 'writable')) { + return false; + } + + if (!has(obj, 'get') || typeof obj.get !== 'function') { + return false; + } + + // tldr: it's valid to have "set" be undefined + // "set" might be undefined if `Object.getOwnPropertyDescriptor` + // was used to get the value, and only `get` was defined by the user + if (has(obj, 'set') && typeof obj[key] !== 'function' && typeof obj[key] !== 'undefined') { + return false; + } + + for (var key in obj) { + if (!accessor.hasOwnProperty(key)) { + continue; + } + + if (typeOf(obj[key]) === accessor[key]) { + continue; + } + + if (typeof obj[key] !== 'undefined') { + return false; + } + } + return true; +} + +function has(obj, key) { + return {}.hasOwnProperty.call(obj, key); +} + +/** + * Expose `isAccessorDescriptor` + */ + +module.exports = isAccessorDescriptor; diff --git a/node_modules/is-accessor-descriptor/package.json b/node_modules/is-accessor-descriptor/package.json new file mode 100644 index 000000000..b6137f874 --- /dev/null +++ b/node_modules/is-accessor-descriptor/package.json @@ -0,0 +1,92 @@ +{ + "_from": "is-accessor-descriptor@^0.1.6", + "_id": "is-accessor-descriptor@0.1.6", + "_inBundle": false, + "_integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "_location": "/is-accessor-descriptor", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-accessor-descriptor@^0.1.6", + "name": "is-accessor-descriptor", + "escapedName": "is-accessor-descriptor", + "rawSpec": "^0.1.6", + "saveSpec": null, + "fetchSpec": "^0.1.6" + }, + "_requiredBy": [ + "/is-descriptor" + ], + "_resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "_shasum": "a9e12cb3ae8d876727eeef3843f8a0897b5c98d6", + "_spec": "is-accessor-descriptor@^0.1.6", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/is-descriptor", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-accessor-descriptor/issues" + }, + "bundleDependencies": false, + "dependencies": { + "kind-of": "^3.0.2" + }, + "deprecated": false, + "description": "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.", + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-accessor-descriptor", + "keywords": [ + "accessor", + "check", + "data", + "descriptor", + "get", + "getter", + "is", + "keys", + "object", + "properties", + "property", + "set", + "setter", + "type", + "valid", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "is-accessor-descriptor", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-accessor-descriptor.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "is-accessor-descriptor", + "is-data-descriptor", + "is-descriptor", + "isobject" + ] + }, + "plugins": [ + "gulp-format-md" + ], + "layout": "default" + }, + "version": "0.1.6" +} diff --git a/node_modules/is-binary-path/index.js b/node_modules/is-binary-path/index.js new file mode 100644 index 000000000..6c8c7e728 --- /dev/null +++ b/node_modules/is-binary-path/index.js @@ -0,0 +1,12 @@ +'use strict'; +var path = require('path'); +var binaryExtensions = require('binary-extensions'); +var exts = Object.create(null); + +binaryExtensions.forEach(function (el) { + exts[el] = true; +}); + +module.exports = function (filepath) { + return path.extname(filepath).slice(1).toLowerCase() in exts; +}; diff --git a/node_modules/is-binary-path/license b/node_modules/is-binary-path/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/is-binary-path/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-binary-path/package.json b/node_modules/is-binary-path/package.json new file mode 100644 index 000000000..6f9197e67 --- /dev/null +++ b/node_modules/is-binary-path/package.json @@ -0,0 +1,71 @@ +{ + "_from": "is-binary-path@^1.0.0", + "_id": "is-binary-path@1.0.1", + "_inBundle": false, + "_integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "_location": "/is-binary-path", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-binary-path@^1.0.0", + "name": "is-binary-path", + "escapedName": "is-binary-path", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/chokidar" + ], + "_resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "_shasum": "75f16642b480f187a711c814161fd3a4a7655898", + "_spec": "is-binary-path@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/chokidar", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-binary-path/issues" + }, + "bundleDependencies": false, + "dependencies": { + "binary-extensions": "^1.0.0" + }, + "deprecated": false, + "description": "Check if a filepath is a binary file", + "devDependencies": { + "ava": "0.0.4" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/is-binary-path#readme", + "keywords": [ + "bin", + "binary", + "ext", + "extensions", + "extension", + "file", + "path", + "check", + "detect", + "is" + ], + "license": "MIT", + "name": "is-binary-path", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-binary-path.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.1" +} diff --git a/node_modules/is-binary-path/readme.md b/node_modules/is-binary-path/readme.md new file mode 100644 index 000000000..a17d6a245 --- /dev/null +++ b/node_modules/is-binary-path/readme.md @@ -0,0 +1,34 @@ +# is-binary-path [![Build Status](https://travis-ci.org/sindresorhus/is-binary-path.svg?branch=master)](https://travis-ci.org/sindresorhus/is-binary-path) + +> Check if a filepath is a binary file + + +## Install + +``` +$ npm install --save is-binary-path +``` + + +## Usage + +```js +var isBinaryPath = require('is-binary-path'); + +isBinaryPath('src/unicorn.png'); +//=> true + +isBinaryPath('src/unicorn.txt'); +//=> false +``` + + +## Related + +- [`binary-extensions`](https://github.com/sindresorhus/binary-extensions) - List of binary file extensions +- [`is-text-path`](https://github.com/sindresorhus/is-text-path) - Check if a filepath is a text file + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/is-buffer/LICENSE b/node_modules/is-buffer/LICENSE new file mode 100644 index 000000000..0c068ceec --- /dev/null +++ b/node_modules/is-buffer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-buffer/README.md b/node_modules/is-buffer/README.md new file mode 100644 index 000000000..cce0a8cf9 --- /dev/null +++ b/node_modules/is-buffer/README.md @@ -0,0 +1,53 @@ +# is-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/is-buffer/master.svg +[travis-url]: https://travis-ci.org/feross/is-buffer +[npm-image]: https://img.shields.io/npm/v/is-buffer.svg +[npm-url]: https://npmjs.org/package/is-buffer +[downloads-image]: https://img.shields.io/npm/dm/is-buffer.svg +[downloads-url]: https://npmjs.org/package/is-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +#### Determine if an object is a [`Buffer`](http://nodejs.org/api/buffer.html) (including the [browserify Buffer](https://github.com/feross/buffer)) + +[![saucelabs][saucelabs-image]][saucelabs-url] + +[saucelabs-image]: https://saucelabs.com/browser-matrix/is-buffer.svg +[saucelabs-url]: https://saucelabs.com/u/is-buffer + +## Why not use `Buffer.isBuffer`? + +This module lets you check if an object is a `Buffer` without using `Buffer.isBuffer` (which includes the whole [buffer](https://github.com/feross/buffer) module in [browserify](http://browserify.org/)). + +It's future-proof and works in node too! + +## install + +```bash +npm install is-buffer +``` + +## usage + +```js +var isBuffer = require('is-buffer') + +isBuffer(new Buffer(4)) // true + +isBuffer(undefined) // false +isBuffer(null) // false +isBuffer('') // false +isBuffer(true) // false +isBuffer(false) // false +isBuffer(0) // false +isBuffer(1) // false +isBuffer(1.0) // false +isBuffer('string') // false +isBuffer({}) // false +isBuffer(function foo () {}) // false +``` + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org). diff --git a/node_modules/is-buffer/index.js b/node_modules/is-buffer/index.js new file mode 100644 index 000000000..9cce39659 --- /dev/null +++ b/node_modules/is-buffer/index.js @@ -0,0 +1,21 @@ +/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +// The _isBuffer check is for Safari 5-7 support, because it's missing +// Object.prototype.constructor. Remove this eventually +module.exports = function (obj) { + return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) +} + +function isBuffer (obj) { + return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) +} + +// For Node v0.10 support. Remove this eventually. +function isSlowBuffer (obj) { + return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) +} diff --git a/node_modules/is-buffer/package.json b/node_modules/is-buffer/package.json new file mode 100644 index 000000000..4624e880d --- /dev/null +++ b/node_modules/is-buffer/package.json @@ -0,0 +1,84 @@ +{ + "_from": "is-buffer@^1.1.0", + "_id": "is-buffer@1.1.6", + "_inBundle": false, + "_integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "_location": "/is-buffer", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-buffer@^1.1.0", + "name": "is-buffer", + "escapedName": "is-buffer", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/has-values/is-number/kind-of", + "/has-values/kind-of", + "/insert-module-globals", + "/kind-of", + "/md5", + "/readdirp/expand-brackets/is-accessor-descriptor/kind-of", + "/readdirp/expand-brackets/is-data-descriptor/kind-of", + "/readdirp/is-number/kind-of" + ], + "_resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "_shasum": "efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be", + "_spec": "is-buffer@^1.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/insert-module-globals", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "http://feross.org/" + }, + "bugs": { + "url": "https://github.com/feross/is-buffer/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Determine if an object is a Buffer", + "devDependencies": { + "standard": "*", + "tape": "^4.0.0", + "zuul": "^3.0.0" + }, + "homepage": "https://github.com/feross/is-buffer#readme", + "keywords": [ + "buffer", + "buffers", + "type", + "core buffer", + "browser buffer", + "browserify", + "typed array", + "uint32array", + "int16array", + "int32array", + "float32array", + "float64array", + "browser", + "arraybuffer", + "dataview" + ], + "license": "MIT", + "main": "index.js", + "name": "is-buffer", + "repository": { + "type": "git", + "url": "git://github.com/feross/is-buffer.git" + }, + "scripts": { + "test": "standard && npm run test-node && npm run test-browser", + "test-browser": "zuul -- test/*.js", + "test-browser-local": "zuul --local -- test/*.js", + "test-node": "tape test/*.js" + }, + "testling": { + "files": "test/*.js" + }, + "version": "1.1.6" +} diff --git a/node_modules/is-buffer/test/basic.js b/node_modules/is-buffer/test/basic.js new file mode 100644 index 000000000..be4f8e438 --- /dev/null +++ b/node_modules/is-buffer/test/basic.js @@ -0,0 +1,24 @@ +var isBuffer = require('../') +var test = require('tape') + +test('is-buffer', function (t) { + t.equal(isBuffer(Buffer.alloc(4)), true, 'new Buffer(4)') + t.equal(isBuffer(Buffer.allocUnsafeSlow(100)), true, 'SlowBuffer(100)') + + t.equal(isBuffer(undefined), false, 'undefined') + t.equal(isBuffer(null), false, 'null') + t.equal(isBuffer(''), false, 'empty string') + t.equal(isBuffer(true), false, 'true') + t.equal(isBuffer(false), false, 'false') + t.equal(isBuffer(0), false, '0') + t.equal(isBuffer(1), false, '1') + t.equal(isBuffer(1.0), false, '1.0') + t.equal(isBuffer('string'), false, 'string') + t.equal(isBuffer({}), false, '{}') + t.equal(isBuffer([]), false, '[]') + t.equal(isBuffer(function foo () {}), false, 'function foo () {}') + t.equal(isBuffer({ isBuffer: null }), false, '{ isBuffer: null }') + t.equal(isBuffer({ isBuffer: function () { throw new Error() } }), false, '{ isBuffer: function () { throw new Error() } }') + + t.end() +}) diff --git a/node_modules/is-data-descriptor/LICENSE b/node_modules/is-data-descriptor/LICENSE new file mode 100644 index 000000000..65f90aca8 --- /dev/null +++ b/node_modules/is-data-descriptor/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-data-descriptor/README.md b/node_modules/is-data-descriptor/README.md new file mode 100644 index 000000000..41e1643f1 --- /dev/null +++ b/node_modules/is-data-descriptor/README.md @@ -0,0 +1,128 @@ +# is-data-descriptor [![NPM version](https://img.shields.io/npm/v/is-data-descriptor.svg)](https://www.npmjs.com/package/is-data-descriptor) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-data-descriptor.svg)](https://travis-ci.org/jonschlinkert/is-data-descriptor) + +> Returns true if a value has the characteristics of a valid JavaScript data descriptor. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm i is-data-descriptor --save +``` + +## Usage + +```js +var isDataDesc = require('is-data-descriptor'); +``` + +## Examples + +`true` when the descriptor has valid properties with valid values. + +```js +// `value` can be anything +isDataDesc({value: 'foo'}) +isDataDesc({value: function() {}}) +isDataDesc({value: true}) +//=> true +``` + +`false` when not an object + +```js +isDataDesc('a') +//=> false +isDataDesc(null) +//=> false +isDataDesc([]) +//=> false +``` + +`false` when the object has invalid properties + +```js +isDataDesc({value: 'foo', bar: 'baz'}) +//=> false +isDataDesc({value: 'foo', bar: 'baz'}) +//=> false +isDataDesc({value: 'foo', get: function(){}}) +//=> false +isDataDesc({get: function(){}, value: 'foo'}) +//=> false +``` + +`false` when a value is not the correct type + +```js +isDataDesc({value: 'foo', enumerable: 'foo'}) +//=> false +isDataDesc({value: 'foo', configurable: 'foo'}) +//=> false +isDataDesc({value: 'foo', writable: 'foo'}) +//=> false +``` + +## Valid properties + +The only valid data descriptor properties are the following: + +* `configurable` (required) +* `enumerable` (required) +* `value` (optional) +* `writable` (optional) + +To be a valid data descriptor, either `value` or `writable` must be defined. + +**Invalid properties** + +A descriptor may have additional _invalid_ properties (an error will **not** be thrown). + +```js +var foo = {}; + +Object.defineProperty(foo, 'bar', { + enumerable: true, + whatever: 'blah', // invalid, but doesn't cause an error + get: function() { + return 'baz'; + } +}); + +console.log(foo.bar); +//=> 'baz' +``` + +## Related projects + +* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor) +* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://www.npmjs.com/package/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor) +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject) + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-data-descriptor/issues/new). + +## Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert) +Released under the MIT license. + +*** + +_This file was generated by [verb](https://github.com/verbose/verb) on December 28, 2015._ \ No newline at end of file diff --git a/node_modules/is-data-descriptor/index.js b/node_modules/is-data-descriptor/index.js new file mode 100644 index 000000000..d4d09c92a --- /dev/null +++ b/node_modules/is-data-descriptor/index.js @@ -0,0 +1,55 @@ +/*! + * is-data-descriptor + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var typeOf = require('kind-of'); + +// data descriptor properties +var data = { + configurable: 'boolean', + enumerable: 'boolean', + writable: 'boolean' +}; + +function isDataDescriptor(obj, prop) { + if (typeOf(obj) !== 'object') { + return false; + } + + if (typeof prop === 'string') { + var val = Object.getOwnPropertyDescriptor(obj, prop); + return typeof val !== 'undefined'; + } + + if (!('value' in obj) && !('writable' in obj)) { + return false; + } + + for (var key in obj) { + if (key === 'value') continue; + + if (!data.hasOwnProperty(key)) { + continue; + } + + if (typeOf(obj[key]) === data[key]) { + continue; + } + + if (typeof obj[key] !== 'undefined') { + return false; + } + } + return true; +} + +/** + * Expose `isDataDescriptor` + */ + +module.exports = isDataDescriptor; diff --git a/node_modules/is-data-descriptor/package.json b/node_modules/is-data-descriptor/package.json new file mode 100644 index 000000000..3a0e1f4a7 --- /dev/null +++ b/node_modules/is-data-descriptor/package.json @@ -0,0 +1,91 @@ +{ + "_from": "is-data-descriptor@^0.1.4", + "_id": "is-data-descriptor@0.1.4", + "_inBundle": false, + "_integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "_location": "/is-data-descriptor", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-data-descriptor@^0.1.4", + "name": "is-data-descriptor", + "escapedName": "is-data-descriptor", + "rawSpec": "^0.1.4", + "saveSpec": null, + "fetchSpec": "^0.1.4" + }, + "_requiredBy": [ + "/is-descriptor" + ], + "_resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "_shasum": "0b5ee648388e2c860282e793f1856fec3f301b56", + "_spec": "is-data-descriptor@^0.1.4", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/is-descriptor", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-data-descriptor/issues" + }, + "bundleDependencies": false, + "dependencies": { + "kind-of": "^3.0.2" + }, + "deprecated": false, + "description": "Returns true if a value has the characteristics of a valid JavaScript data descriptor.", + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-data-descriptor", + "keywords": [ + "accessor", + "check", + "data", + "descriptor", + "get", + "getter", + "is", + "keys", + "object", + "properties", + "property", + "set", + "setter", + "type", + "valid", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "is-data-descriptor", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-data-descriptor.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "is-accessor-descriptor", + "is-data-descriptor", + "is-descriptor", + "isobject" + ] + }, + "plugins": [ + "gulp-format-md" + ] + }, + "version": "0.1.4" +} diff --git a/node_modules/is-descriptor/LICENSE b/node_modules/is-descriptor/LICENSE new file mode 100644 index 000000000..c0d7f1362 --- /dev/null +++ b/node_modules/is-descriptor/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert. + +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. \ No newline at end of file diff --git a/node_modules/is-descriptor/README.md b/node_modules/is-descriptor/README.md new file mode 100644 index 000000000..658e53301 --- /dev/null +++ b/node_modules/is-descriptor/README.md @@ -0,0 +1,193 @@ +# is-descriptor [![NPM version](https://img.shields.io/npm/v/is-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-descriptor) + +> Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-descriptor +``` + +## Usage + +```js +var isDescriptor = require('is-descriptor'); + +isDescriptor({value: 'foo'}) +//=> true +isDescriptor({get: function(){}, set: function(){}}) +//=> true +isDescriptor({get: 'foo', set: function(){}}) +//=> false +``` + +You may also check for a descriptor by passing an object as the first argument and property name (`string`) as the second argument. + +```js +var obj = {}; +obj.foo = 'abc'; + +Object.defineProperty(obj, 'bar', { + value: 'xyz' +}); + +isDescriptor(obj, 'foo'); +//=> true +isDescriptor(obj, 'bar'); +//=> true +``` + +## Examples + +### value type + +`false` when not an object + +```js +isDescriptor('a'); +//=> false +isDescriptor(null); +//=> false +isDescriptor([]); +//=> false +``` + +### data descriptor + +`true` when the object has valid properties with valid values. + +```js +isDescriptor({value: 'foo'}); +//=> true +isDescriptor({value: noop}); +//=> true +``` + +`false` when the object has invalid properties + +```js +isDescriptor({value: 'foo', bar: 'baz'}); +//=> false +isDescriptor({value: 'foo', bar: 'baz'}); +//=> false +isDescriptor({value: 'foo', get: noop}); +//=> false +isDescriptor({get: noop, value: noop}); +//=> false +``` + +`false` when a value is not the correct type + +```js +isDescriptor({value: 'foo', enumerable: 'foo'}); +//=> false +isDescriptor({value: 'foo', configurable: 'foo'}); +//=> false +isDescriptor({value: 'foo', writable: 'foo'}); +//=> false +``` + +### accessor descriptor + +`true` when the object has valid properties with valid values. + +```js +isDescriptor({get: noop, set: noop}); +//=> true +isDescriptor({get: noop}); +//=> true +isDescriptor({set: noop}); +//=> true +``` + +`false` when the object has invalid properties + +```js +isDescriptor({get: noop, set: noop, bar: 'baz'}); +//=> false +isDescriptor({get: noop, writable: true}); +//=> false +isDescriptor({get: noop, value: true}); +//=> false +``` + +`false` when an accessor is not a function + +```js +isDescriptor({get: noop, set: 'baz'}); +//=> false +isDescriptor({get: 'foo', set: noop}); +//=> false +isDescriptor({get: 'foo', bar: 'baz'}); +//=> false +isDescriptor({get: 'foo', set: 'baz'}); +//=> false +``` + +`false` when a value is not the correct type + +```js +isDescriptor({get: noop, set: noop, enumerable: 'foo'}); +//=> false +isDescriptor({set: noop, configurable: 'foo'}); +//=> false +isDescriptor({get: noop, configurable: 'foo'}); +//=> false +``` + +## About + +### Related projects + +* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.") +* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.") +* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 24 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [doowb](https://github.com/doowb) | +| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 22, 2017._ \ No newline at end of file diff --git a/node_modules/is-descriptor/index.js b/node_modules/is-descriptor/index.js new file mode 100644 index 000000000..c9b91d762 --- /dev/null +++ b/node_modules/is-descriptor/index.js @@ -0,0 +1,22 @@ +/*! + * is-descriptor + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var typeOf = require('kind-of'); +var isAccessor = require('is-accessor-descriptor'); +var isData = require('is-data-descriptor'); + +module.exports = function isDescriptor(obj, key) { + if (typeOf(obj) !== 'object') { + return false; + } + if ('get' in obj) { + return isAccessor(obj, key); + } + return isData(obj, key); +}; diff --git a/node_modules/is-descriptor/node_modules/kind-of/LICENSE b/node_modules/is-descriptor/node_modules/kind-of/LICENSE new file mode 100644 index 000000000..3f2eca18f --- /dev/null +++ b/node_modules/is-descriptor/node_modules/kind-of/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-descriptor/node_modules/kind-of/README.md b/node_modules/is-descriptor/node_modules/kind-of/README.md new file mode 100644 index 000000000..170bf3049 --- /dev/null +++ b/node_modules/is-descriptor/node_modules/kind-of/README.md @@ -0,0 +1,342 @@ +# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) + +> Get the native type of a value. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save kind-of +``` + +Install with [bower](https://bower.io/) + +```sh +$ bower install kind-of --save +``` + +## Why use this? + +1. [it's fast](#benchmarks) | [optimizations](#optimizations) +2. [better type checking](#better-type-checking) + +## Usage + +> es5, browser and es6 ready + +```js +var kindOf = require('kind-of'); + +kindOf(undefined); +//=> 'undefined' + +kindOf(null); +//=> 'null' + +kindOf(true); +//=> 'boolean' + +kindOf(false); +//=> 'boolean' + +kindOf(new Boolean(true)); +//=> 'boolean' + +kindOf(new Buffer('')); +//=> 'buffer' + +kindOf(42); +//=> 'number' + +kindOf(new Number(42)); +//=> 'number' + +kindOf('str'); +//=> 'string' + +kindOf(new String('str')); +//=> 'string' + +kindOf(arguments); +//=> 'arguments' + +kindOf({}); +//=> 'object' + +kindOf(Object.create(null)); +//=> 'object' + +kindOf(new Test()); +//=> 'object' + +kindOf(new Date()); +//=> 'date' + +kindOf([]); +//=> 'array' + +kindOf([1, 2, 3]); +//=> 'array' + +kindOf(new Array()); +//=> 'array' + +kindOf(/foo/); +//=> 'regexp' + +kindOf(new RegExp('foo')); +//=> 'regexp' + +kindOf(function () {}); +//=> 'function' + +kindOf(function * () {}); +//=> 'function' + +kindOf(new Function()); +//=> 'function' + +kindOf(new Map()); +//=> 'map' + +kindOf(new WeakMap()); +//=> 'weakmap' + +kindOf(new Set()); +//=> 'set' + +kindOf(new WeakSet()); +//=> 'weakset' + +kindOf(Symbol('str')); +//=> 'symbol' + +kindOf(new Int8Array()); +//=> 'int8array' + +kindOf(new Uint8Array()); +//=> 'uint8array' + +kindOf(new Uint8ClampedArray()); +//=> 'uint8clampedarray' + +kindOf(new Int16Array()); +//=> 'int16array' + +kindOf(new Uint16Array()); +//=> 'uint16array' + +kindOf(new Int32Array()); +//=> 'int32array' + +kindOf(new Uint32Array()); +//=> 'uint32array' + +kindOf(new Float32Array()); +//=> 'float32array' + +kindOf(new Float64Array()); +//=> 'float64array' +``` + +## Release history + +### v4.0.0 + +**Added** + +* `promise` support + +### v5.0.0 + +**Added** + +* `Set Iterator` and `Map Iterator` support + +**Fixed** + +* Now returns `generatorfunction` for generator functions + +## Benchmarks + +Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). +Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `WeakSet`. + +```bash +#1: array + current x 23,329,397 ops/sec ±0.82% (94 runs sampled) + lib-type-of x 4,170,273 ops/sec ±0.55% (94 runs sampled) + lib-typeof x 9,686,935 ops/sec ±0.59% (98 runs sampled) + +#2: boolean + current x 27,197,115 ops/sec ±0.85% (94 runs sampled) + lib-type-of x 3,145,791 ops/sec ±0.73% (97 runs sampled) + lib-typeof x 9,199,562 ops/sec ±0.44% (99 runs sampled) + +#3: date + current x 20,190,117 ops/sec ±0.86% (92 runs sampled) + lib-type-of x 5,166,970 ops/sec ±0.74% (94 runs sampled) + lib-typeof x 9,610,821 ops/sec ±0.50% (96 runs sampled) + +#4: function + current x 23,855,460 ops/sec ±0.60% (97 runs sampled) + lib-type-of x 5,667,740 ops/sec ±0.54% (100 runs sampled) + lib-typeof x 10,010,644 ops/sec ±0.44% (100 runs sampled) + +#5: null + current x 27,061,047 ops/sec ±0.97% (96 runs sampled) + lib-type-of x 13,965,573 ops/sec ±0.62% (97 runs sampled) + lib-typeof x 8,460,194 ops/sec ±0.61% (97 runs sampled) + +#6: number + current x 25,075,682 ops/sec ±0.53% (99 runs sampled) + lib-type-of x 2,266,405 ops/sec ±0.41% (98 runs sampled) + lib-typeof x 9,821,481 ops/sec ±0.45% (99 runs sampled) + +#7: object + current x 3,348,980 ops/sec ±0.49% (99 runs sampled) + lib-type-of x 3,245,138 ops/sec ±0.60% (94 runs sampled) + lib-typeof x 9,262,952 ops/sec ±0.59% (99 runs sampled) + +#8: regex + current x 21,284,827 ops/sec ±0.72% (96 runs sampled) + lib-type-of x 4,689,241 ops/sec ±0.43% (100 runs sampled) + lib-typeof x 8,957,593 ops/sec ±0.62% (98 runs sampled) + +#9: string + current x 25,379,234 ops/sec ±0.58% (96 runs sampled) + lib-type-of x 3,635,148 ops/sec ±0.76% (93 runs sampled) + lib-typeof x 9,494,134 ops/sec ±0.49% (98 runs sampled) + +#10: undef + current x 27,459,221 ops/sec ±1.01% (93 runs sampled) + lib-type-of x 14,360,433 ops/sec ±0.52% (99 runs sampled) + lib-typeof x 23,202,868 ops/sec ±0.59% (94 runs sampled) + +``` + +## Optimizations + +In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: + +1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. +2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. +3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` +4. There is no reason to make the code in a microlib as terse as possible, just to win points for making it shorter. It's always better to favor performant code over terse code. You will always only be using a single `require()` statement to use the library anyway, regardless of how the code is written. + +## Better type checking + +kind-of is more correct than other type checking libs I've looked at. For example, here are some differing results from other popular libs: + +### [typeof](https://github.com/CodingFu/typeof) lib + +Incorrectly tests instances of custom constructors (pretty common): + +```js +var typeOf = require('typeof'); +function Test() {} +console.log(typeOf(new Test())); +//=> 'test' +``` + +Returns `object` instead of `arguments`: + +```js +function foo() { + console.log(typeOf(arguments)) //=> 'object' +} +foo(); +``` + +### [type-of](https://github.com/ForbesLindesay/type-of) lib + +Incorrectly returns `object` for generator functions, buffers, `Map`, `Set`, `WeakMap` and `WeakSet`: + +```js +function * foo() {} +console.log(typeOf(foo)); +//=> 'object' +console.log(typeOf(new Buffer(''))); +//=> 'object' +console.log(typeOf(new Map())); +//=> 'object' +console.log(typeOf(new Set())); +//=> 'object' +console.log(typeOf(new WeakMap())); +//=> 'object' +console.log(typeOf(new WeakSet())); +//=> 'object' +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 82 | [jonschlinkert](https://github.com/jonschlinkert) | +| 3 | [aretecode](https://github.com/aretecode) | +| 2 | [miguelmota](https://github.com/miguelmota) | +| 1 | [dtothefp](https://github.com/dtothefp) | +| 1 | [ksheedlo](https://github.com/ksheedlo) | +| 1 | [pdehaan](https://github.com/pdehaan) | +| 1 | [laggingreflex](https://github.com/laggingreflex) | +| 1 | [charlike](https://github.com/charlike) | + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on October 13, 2017._ \ No newline at end of file diff --git a/node_modules/is-descriptor/node_modules/kind-of/index.js b/node_modules/is-descriptor/node_modules/kind-of/index.js new file mode 100644 index 000000000..fc5cde96e --- /dev/null +++ b/node_modules/is-descriptor/node_modules/kind-of/index.js @@ -0,0 +1,147 @@ +var toString = Object.prototype.toString; + +/** + * Get the native `typeof` a value. + * + * @param {*} `val` + * @return {*} Native javascript type + */ + +module.exports = function kindOf(val) { + var type = typeof val; + + // primitivies + if (type === 'undefined') { + return 'undefined'; + } + if (val === null) { + return 'null'; + } + if (val === true || val === false || val instanceof Boolean) { + return 'boolean'; + } + if (type === 'string' || val instanceof String) { + return 'string'; + } + if (type === 'number' || val instanceof Number) { + return 'number'; + } + + // functions + if (type === 'function' || val instanceof Function) { + if (typeof val.constructor.name !== 'undefined' && val.constructor.name.slice(0, 9) === 'Generator') { + return 'generatorfunction'; + } + return 'function'; + } + + // array + if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { + return 'array'; + } + + // check for instances of RegExp and Date before calling `toString` + if (val instanceof RegExp) { + return 'regexp'; + } + if (val instanceof Date) { + return 'date'; + } + + // other objects + type = toString.call(val); + + if (type === '[object RegExp]') { + return 'regexp'; + } + if (type === '[object Date]') { + return 'date'; + } + if (type === '[object Arguments]') { + return 'arguments'; + } + if (type === '[object Error]') { + return 'error'; + } + if (type === '[object Promise]') { + return 'promise'; + } + + // buffer + if (isBuffer(val)) { + return 'buffer'; + } + + // es6: Map, WeakMap, Set, WeakSet + if (type === '[object Set]') { + return 'set'; + } + if (type === '[object WeakSet]') { + return 'weakset'; + } + if (type === '[object Map]') { + return 'map'; + } + if (type === '[object WeakMap]') { + return 'weakmap'; + } + if (type === '[object Symbol]') { + return 'symbol'; + } + + if (type === '[object Map Iterator]') { + return 'mapiterator'; + } + if (type === '[object Set Iterator]') { + return 'setiterator'; + } + if (type === '[object String Iterator]') { + return 'stringiterator'; + } + if (type === '[object Array Iterator]') { + return 'arrayiterator'; + } + + // typed arrays + if (type === '[object Int8Array]') { + return 'int8array'; + } + if (type === '[object Uint8Array]') { + return 'uint8array'; + } + if (type === '[object Uint8ClampedArray]') { + return 'uint8clampedarray'; + } + if (type === '[object Int16Array]') { + return 'int16array'; + } + if (type === '[object Uint16Array]') { + return 'uint16array'; + } + if (type === '[object Int32Array]') { + return 'int32array'; + } + if (type === '[object Uint32Array]') { + return 'uint32array'; + } + if (type === '[object Float32Array]') { + return 'float32array'; + } + if (type === '[object Float64Array]') { + return 'float64array'; + } + + // must be a plain object + return 'object'; +}; + +/** + * If you need to support Safari 5-7 (8-10 yr-old browser), + * take a look at https://github.com/feross/is-buffer + */ + +function isBuffer(val) { + return val.constructor + && typeof val.constructor.isBuffer === 'function' + && val.constructor.isBuffer(val); +} diff --git a/node_modules/is-descriptor/node_modules/kind-of/package.json b/node_modules/is-descriptor/node_modules/kind-of/package.json new file mode 100644 index 000000000..20708754a --- /dev/null +++ b/node_modules/is-descriptor/node_modules/kind-of/package.json @@ -0,0 +1,146 @@ +{ + "_from": "kind-of@^5.0.0", + "_id": "kind-of@5.1.0", + "_inBundle": false, + "_integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "_location": "/is-descriptor/kind-of", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "kind-of@^5.0.0", + "name": "kind-of", + "escapedName": "kind-of", + "rawSpec": "^5.0.0", + "saveSpec": null, + "fetchSpec": "^5.0.0" + }, + "_requiredBy": [ + "/is-descriptor" + ], + "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "_shasum": "729c91e2d857b7a419a1f9aa65685c4c33f5845d", + "_spec": "kind-of@^5.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/is-descriptor", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/kind-of/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "David Fox-Powell", + "url": "https://dtothefp.github.io/me" + }, + { + "name": "James", + "url": "https://twitter.com/aretecode" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Ken Sheedlo", + "url": "kensheedlo.com" + }, + { + "name": "laggingreflex", + "url": "https://github.com/laggingreflex" + }, + { + "name": "Miguel Mota", + "url": "https://miguelmota.com" + }, + { + "name": "Peter deHaan", + "url": "http://about.me/peterdehaan" + }, + { + "name": "tunnckoCore", + "url": "https://i.am.charlike.online" + } + ], + "deprecated": false, + "description": "Get the native type of a value.", + "devDependencies": { + "ansi-bold": "^0.1.1", + "benchmarked": "^1.1.1", + "browserify": "^14.4.0", + "gulp-format-md": "^0.1.12", + "matched": "^0.4.4", + "mocha": "^3.4.2", + "type-of": "^2.0.1", + "typeof": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/kind-of", + "keywords": [ + "arguments", + "array", + "boolean", + "check", + "date", + "function", + "is", + "is-type", + "is-type-of", + "kind", + "kind-of", + "number", + "object", + "of", + "regexp", + "string", + "test", + "type", + "type-of", + "typeof", + "types" + ], + "license": "MIT", + "main": "index.js", + "name": "kind-of", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/kind-of.git" + }, + "scripts": { + "prepublish": "browserify -o browser.js -e index.js -s index --bare", + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "is-glob", + "is-number", + "is-primitive" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "type-of", + "typeof", + "verb" + ] + }, + "version": "5.1.0" +} diff --git a/node_modules/is-descriptor/package.json b/node_modules/is-descriptor/package.json new file mode 100644 index 000000000..70d28f9d3 --- /dev/null +++ b/node_modules/is-descriptor/package.json @@ -0,0 +1,117 @@ +{ + "_from": "is-descriptor@^0.1.0", + "_id": "is-descriptor@0.1.6", + "_inBundle": false, + "_integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "_location": "/is-descriptor", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-descriptor@^0.1.0", + "name": "is-descriptor", + "escapedName": "is-descriptor", + "rawSpec": "^0.1.0", + "saveSpec": null, + "fetchSpec": "^0.1.0" + }, + "_requiredBy": [ + "/class-utils/define-property", + "/object-copy/define-property", + "/snapdragon/define-property", + "/static-extend/define-property" + ], + "_resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "_shasum": "366d8240dde487ca51823b1ab9f07a10a78251ca", + "_spec": "is-descriptor@^0.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/class-utils/node_modules/define-property", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-descriptor/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "url": "https://github.com/wtgtybhertgeghgtwtg" + } + ], + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "deprecated": false, + "description": "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.4.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-descriptor", + "keywords": [ + "accessor", + "check", + "data", + "descriptor", + "get", + "getter", + "is", + "keys", + "object", + "properties", + "property", + "set", + "setter", + "type", + "valid", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "is-descriptor", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-descriptor.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "is-accessor-descriptor", + "is-data-descriptor", + "is-descriptor", + "isobject" + ] + }, + "plugins": [ + "gulp-format-md" + ], + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "lint": { + "reflinks": true + } + }, + "version": "0.1.6" +} diff --git a/node_modules/is-dotfile/LICENSE b/node_modules/is-dotfile/LICENSE new file mode 100644 index 000000000..83b56e709 --- /dev/null +++ b/node_modules/is-dotfile/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-dotfile/README.md b/node_modules/is-dotfile/README.md new file mode 100644 index 000000000..d69912bb1 --- /dev/null +++ b/node_modules/is-dotfile/README.md @@ -0,0 +1,95 @@ +# is-dotfile [![NPM version](https://img.shields.io/npm/v/is-dotfile.svg?style=flat)](https://www.npmjs.com/package/is-dotfile) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-dotfile.svg?style=flat)](https://npmjs.org/package/is-dotfile) [![NPM total downloads](https://img.shields.io/npm/dt/is-dotfile.svg?style=flat)](https://npmjs.org/package/is-dotfile) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-dotfile.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-dotfile) + +> Return true if a file path is (or has) a dotfile. Returns false if the path is a dot directory. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-dotfile +``` + +## Usage + +To be considered a dotfile, it must be the last filename in the path, like `.gitignore`. Otherwise it's a [dot directory](https://github.com/jonschlinkert/is-dotdir), like `.git/` and `.github/`. + +```js +var isDotfile = require('is-dotfile'); +``` + +**false** + +All of the following return `false`: + +```js +isDotfile('a/b/c.js'); +isDotfile('/.git/foo'); +isDotfile('a/b/c/.git/foo'); +//=> false +``` + +**true** + +All of the following return `true`: + +```js +isDotfile('a/b/.gitignore'); +isDotfile('.gitignore'); +isDotfile('/.gitignore'); +//=> true +``` + +## About + +### Related projects + +* [dotdir-regex](https://www.npmjs.com/package/dotdir-regex): Regex for matching dot-directories, like `.git/` | [homepage](https://github.com/regexps/dotdir-regex "Regex for matching dot-directories, like `.git/`") +* [dotfile-regex](https://www.npmjs.com/package/dotfile-regex): Regular expresson for matching dotfiles. | [homepage](https://github.com/regexps/dotfile-regex "Regular expresson for matching dotfiles.") +* [is-dotdir](https://www.npmjs.com/package/is-dotdir): Returns true if a path is a dot-directory. | [homepage](https://github.com/jonschlinkert/is-dotdir "Returns true if a path is a dot-directory.") +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 13 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [Lykathia](https://github.com/Lykathia) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 30, 2017._ \ No newline at end of file diff --git a/node_modules/is-dotfile/index.js b/node_modules/is-dotfile/index.js new file mode 100644 index 000000000..46cb20b14 --- /dev/null +++ b/node_modules/is-dotfile/index.js @@ -0,0 +1,14 @@ +/*! + * is-dotfile + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +module.exports = function(str) { + if (str.charCodeAt(0) === 46 /* . */ && str.indexOf('/', 1) === -1) { + return true; + } + var slash = str.lastIndexOf('/'); + return slash !== -1 ? str.charCodeAt(slash + 1) === 46 /* . */ : false; +}; diff --git a/node_modules/is-dotfile/package.json b/node_modules/is-dotfile/package.json new file mode 100644 index 000000000..18ef11107 --- /dev/null +++ b/node_modules/is-dotfile/package.json @@ -0,0 +1,106 @@ +{ + "_from": "is-dotfile@^1.0.0", + "_id": "is-dotfile@1.0.3", + "_inBundle": false, + "_integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "_location": "/is-dotfile", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-dotfile@^1.0.0", + "name": "is-dotfile", + "escapedName": "is-dotfile", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/parse-glob" + ], + "_resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "_shasum": "a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1", + "_spec": "is-dotfile@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/parse-glob", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-dotfile/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Evan Lowry", + "url": "http://exitiumonline.com" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + } + ], + "deprecated": false, + "description": "Return true if a file path is (or has) a dotfile. Returns false if the path is a dot directory.", + "devDependencies": { + "benchmarked": "^0.1.3", + "dotfile-regex": "^0.1.2", + "gulp-format-md": "^0.1.12", + "mocha": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-dotfile", + "keywords": [ + "detect", + "dot", + "dotfile", + "expression", + "file", + "filepath", + "find", + "fs", + "is", + "match", + "path", + "regex", + "regexp", + "regular" + ], + "license": "MIT", + "main": "index.js", + "name": "is-dotfile", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-dotfile.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "dotdir-regex", + "dotfile-regex", + "is-dotdir", + "is-glob" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.3" +} diff --git a/node_modules/is-electron/LICENSE b/node_modules/is-electron/LICENSE new file mode 100644 index 000000000..a1666f156 --- /dev/null +++ b/node_modules/is-electron/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Cheton Wu + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/is-electron/README.md b/node_modules/is-electron/README.md new file mode 100644 index 000000000..fec2cd15b --- /dev/null +++ b/node_modules/is-electron/README.md @@ -0,0 +1,25 @@ +# is-electron [![build status](https://travis-ci.org/cheton/is-electron.svg?branch=master)](https://travis-ci.org/cheton/is-electron) [![Coverage Status](https://coveralls.io/repos/github/cheton/is-electron/badge.svg?branch=master)](https://coveralls.io/github/cheton/is-electron?branch=master) + +[![NPM](https://nodei.co/npm/is-electron.png?downloads=true&stars=true)](https://www.npmjs.com/package/is-electron) + +Detect if running in Electron. + +## Installation + +```bash +npm install --save is-electron +``` + +## Usage + +```js +import isElectron from 'is-electron'; + +console.log(isElectron()); +``` + +## License + +Copyright (c) 2016 Cheton Wu + +Licensed under the [MIT License](LICENSE). diff --git a/node_modules/is-electron/index.js b/node_modules/is-electron/index.js new file mode 100644 index 000000000..a5c65da87 --- /dev/null +++ b/node_modules/is-electron/index.js @@ -0,0 +1,21 @@ +// https://github.com/electron/electron/issues/2288 +function isElectron() { + // Renderer process + if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') { + return true; + } + + // Main process + if (typeof process !== 'undefined' && typeof process.versions === 'object' && !!process.versions.electron) { + return true; + } + + // Detect the user agent when the `nodeIntegration` option is set to true + if (typeof navigator === 'object' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Electron') >= 0) { + return true; + } + + return false; +} + +module.exports = isElectron; diff --git a/node_modules/is-electron/package.json b/node_modules/is-electron/package.json new file mode 100644 index 000000000..d9581181e --- /dev/null +++ b/node_modules/is-electron/package.json @@ -0,0 +1,64 @@ +{ + "_from": "is-electron@^2.0.0", + "_id": "is-electron@2.1.0", + "_inBundle": false, + "_integrity": "sha512-dkg5xT383+M6zIbbXW/z7n2nz4SFUi2OSyhntnFYkRdtV+HVEfdjEK+5AWisfYgkpe3WYjTIuh7toaKmSfFVWw==", + "_location": "/is-electron", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-electron@^2.0.0", + "name": "is-electron", + "escapedName": "is-electron", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/bel" + ], + "_resolved": "https://registry.npmjs.org/is-electron/-/is-electron-2.1.0.tgz", + "_shasum": "37dd2e9e7167efa8bafce86c0c25762bc4b851fa", + "_spec": "is-electron@^2.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/bel", + "author": { + "name": "Cheton Wu", + "email": "cheton@gmail.com" + }, + "bugs": { + "url": "https://github.com/cheton/is-electron/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Detect if running in Electron.", + "devDependencies": { + "coveralls": "^2.11.9", + "tap": "^5.7.2" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/cheton/is-electron", + "keywords": [ + "atom", + "electron", + "renderer", + "process" + ], + "license": "MIT", + "main": "index.js", + "name": "is-electron", + "nyc": { + "exclude": [] + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/cheton/is-electron.git" + }, + "scripts": { + "coveralls": "tap --coverage --coverage-report=text-lcov test/*.js | node_modules/.bin/coveralls", + "test": "tap --coverage test/*.js" + }, + "version": "2.1.0" +} diff --git a/node_modules/is-equal-shallow/LICENSE b/node_modules/is-equal-shallow/LICENSE new file mode 100644 index 000000000..65f90aca8 --- /dev/null +++ b/node_modules/is-equal-shallow/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-equal-shallow/README.md b/node_modules/is-equal-shallow/README.md new file mode 100644 index 000000000..11422761f --- /dev/null +++ b/node_modules/is-equal-shallow/README.md @@ -0,0 +1,90 @@ +# is-equal-shallow [![NPM version](https://badge.fury.io/js/is-equal-shallow.svg)](http://badge.fury.io/js/is-equal-shallow) [![Build Status](https://travis-ci.org/jonschlinkert/is-equal-shallow.svg)](https://travis-ci.org/jonschlinkert/is-equal-shallow) + +> Does a shallow comparison of two objects, returning false if the keys or values differ. + +The purpose of this lib is to do the fastest comparison possible of two objects when the values will predictably be primitives. + +* only compares objects. +* only compares the first level of each object +* values must be primitives. If a value is not a primitive, even if the values are the same, `false` is returned. + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i is-equal-shallow --save +``` + +## Usage + +```js +var equals = require('is-equal-shallow'); +equals(object_a, object_b); +``` + +**Examples** + +```js +equals({a: true, b: true}, {a: true, b: true}); +//=> 'true' + +equals({a: true, b: false}, {c: false, b: false}); +//=> 'false' + +equals({a: true, b: false}, {a: false, b: false}); +//=> 'false' +``` + +Strict comparison for equality: + +```js +equals({a: true, b: true}, {a: true, b: 'true'}); +//=> 'false' +``` + +When values are not primitives, `false` is always returned: + +```js +equals({ b: {}}, { b: {}}); +//=> 'false' + +equals({ b: []}, { b: []}); +//=> 'false' +``` + +## Related projects + +Other object utils: + +* [clone-deep](https://github.com/jonschlinkert/clone-deep): Recursively (deep) clone JavaScript native types, like Object, Array, RegExp, Date as well as primitives. +* [for-in](https://github.com/jonschlinkert/for-in): Iterate over the own and inherited enumerable properties of an objecte, and return an object… [more](https://github.com/jonschlinkert/for-in) +* [for-own](https://github.com/jonschlinkert/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) +* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor. +* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null. + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-equal-shallow/issues/new) + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 22, 2015._ \ No newline at end of file diff --git a/node_modules/is-equal-shallow/index.js b/node_modules/is-equal-shallow/index.js new file mode 100644 index 000000000..1006eef10 --- /dev/null +++ b/node_modules/is-equal-shallow/index.js @@ -0,0 +1,27 @@ +/*! + * is-equal-shallow + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var isPrimitive = require('is-primitive'); + +module.exports = function isEqual(a, b) { + if (!a && !b) { return true; } + if (!a && b || a && !b) { return false; } + + var numKeysA = 0, numKeysB = 0, key; + for (key in b) { + numKeysB++; + if (!isPrimitive(b[key]) || !a.hasOwnProperty(key) || (a[key] !== b[key])) { + return false; + } + } + for (key in a) { + numKeysA++; + } + return numKeysA === numKeysB; +}; diff --git a/node_modules/is-equal-shallow/package.json b/node_modules/is-equal-shallow/package.json new file mode 100644 index 000000000..70b8bf97b --- /dev/null +++ b/node_modules/is-equal-shallow/package.json @@ -0,0 +1,85 @@ +{ + "_from": "is-equal-shallow@^0.1.3", + "_id": "is-equal-shallow@0.1.3", + "_inBundle": false, + "_integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "_location": "/is-equal-shallow", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-equal-shallow@^0.1.3", + "name": "is-equal-shallow", + "escapedName": "is-equal-shallow", + "rawSpec": "^0.1.3", + "saveSpec": null, + "fetchSpec": "^0.1.3" + }, + "_requiredBy": [ + "/regex-cache" + ], + "_resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "_shasum": "2238098fc221de0bcfa5d9eac4c45d638aa1c534", + "_spec": "is-equal-shallow@^0.1.3", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/regex-cache", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-equal-shallow/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-primitive": "^2.0.0" + }, + "deprecated": false, + "description": "Does a shallow comparison of two objects, returning false if the keys or values differ.", + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-equal-shallow", + "keywords": [ + "compare", + "comparison", + "equal", + "equals", + "is", + "is-equal", + "key", + "object", + "same", + "shallow", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "is-equal-shallow", + "repository": { + "type": "git", + "url": "git://github.com/jonschlinkert/is-equal-shallow.git" + }, + "scripts": { + "test": "mocha" + }, + "verbiage": { + "related": { + "description": "Other object utils:", + "list": [ + "is-plain-object", + "isobject", + "for-in", + "for-own", + "clone-deep" + ] + } + }, + "version": "0.1.3" +} diff --git a/node_modules/is-extendable/LICENSE b/node_modules/is-extendable/LICENSE new file mode 100644 index 000000000..65f90aca8 --- /dev/null +++ b/node_modules/is-extendable/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-extendable/README.md b/node_modules/is-extendable/README.md new file mode 100644 index 000000000..e4cfaebcb --- /dev/null +++ b/node_modules/is-extendable/README.md @@ -0,0 +1,72 @@ +# is-extendable [![NPM version](https://badge.fury.io/js/is-extendable.svg)](http://badge.fury.io/js/is-extendable) + +> Returns true if a value is any of the object types: array, regexp, plain object, function or date. This is useful for determining if a value can be extended, e.g. "can the value have keys?" + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i is-extendable --save +``` + +## Usage + +```js +var isExtendable = require('is-extendable'); +``` + +Returns true if the value is any of the following: + +* `array` +* `regexp` +* `plain object` +* `function` +* `date` +* `error` + +## Notes + +All objects in JavaScript can have keys, but it's a pain to check for this, since we ether need to verify that the value is not `null` or `undefined` and: + +* the value is not a primitive, or +* that the object is an `object`, `function` + +Also note that an `extendable` object is not the same as an [extensible object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible), which is one that (in es6) is not sealed, frozen, or marked as non-extensible using `preventExtensions`. + +## Related projects + +* [assign-deep](https://github.com/jonschlinkert/assign-deep): Deeply assign the enumerable properties of source objects to a destination object. +* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. +* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null. +* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor. +* [is-equal-shallow](https://github.com/jonschlinkert/is-equal-shallow): Does a shallow comparison of two objects, returning false if the keys or values differ. +* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value. + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-extendable/issues/new) + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 04, 2015._ \ No newline at end of file diff --git a/node_modules/is-extendable/index.js b/node_modules/is-extendable/index.js new file mode 100644 index 000000000..4ee71a44a --- /dev/null +++ b/node_modules/is-extendable/index.js @@ -0,0 +1,13 @@ +/*! + * is-extendable + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +module.exports = function isExtendable(val) { + return typeof val !== 'undefined' && val !== null + && (typeof val === 'object' || typeof val === 'function'); +}; diff --git a/node_modules/is-extendable/package.json b/node_modules/is-extendable/package.json new file mode 100644 index 000000000..db8ff7f6a --- /dev/null +++ b/node_modules/is-extendable/package.json @@ -0,0 +1,92 @@ +{ + "_from": "is-extendable@^0.1.1", + "_id": "is-extendable@0.1.1", + "_inBundle": false, + "_integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "_location": "/is-extendable", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-extendable@^0.1.1", + "name": "is-extendable", + "escapedName": "is-extendable", + "rawSpec": "^0.1.1", + "saveSpec": null, + "fetchSpec": "^0.1.1" + }, + "_requiredBy": [ + "/object.omit", + "/readdirp/braces/extend-shallow", + "/readdirp/expand-brackets/extend-shallow", + "/readdirp/extglob/extend-shallow", + "/readdirp/fill-range/extend-shallow", + "/set-value", + "/set-value/extend-shallow", + "/snapdragon/extend-shallow", + "/union-value", + "/union-value/extend-shallow", + "/union-value/set-value" + ], + "_resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "_shasum": "62b110e289a471418e3ec36a617d472e301dfc89", + "_spec": "is-extendable@^0.1.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/object.omit", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-extendable/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Returns true if a value is any of the object types: array, regexp, plain object, function or date. This is useful for determining if a value can be extended, e.g. \"can the value have keys?\"", + "devDependencies": { + "mocha": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-extendable", + "keywords": [ + "array", + "assign", + "check", + "date", + "extend", + "extensible", + "function", + "is", + "object", + "regex", + "test" + ], + "license": "MIT", + "main": "index.js", + "name": "is-extendable", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-extendable.git" + }, + "scripts": { + "test": "mocha" + }, + "verbiage": { + "related": { + "list": [ + "isobject", + "is-plain-object", + "kind-of", + "is-extendable", + "is-equal-shallow", + "extend-shallow", + "assign-deep" + ] + } + }, + "version": "0.1.1" +} diff --git a/node_modules/is-extglob/LICENSE b/node_modules/is-extglob/LICENSE new file mode 100644 index 000000000..fa30c4cb3 --- /dev/null +++ b/node_modules/is-extglob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-extglob/README.md b/node_modules/is-extglob/README.md new file mode 100644 index 000000000..80e7128d6 --- /dev/null +++ b/node_modules/is-extglob/README.md @@ -0,0 +1,75 @@ +# is-extglob [![NPM version](https://badge.fury.io/js/is-extglob.svg)](http://badge.fury.io/js/is-extglob) [![Build Status](https://travis-ci.org/jonschlinkert/is-extglob.svg)](https://travis-ci.org/jonschlinkert/is-extglob) + +> Returns true if a string has an extglob. + +## Install with [npm](npmjs.org) + +```bash +npm i is-extglob --save +``` + +## Usage + +```js +var isExtglob = require('is-extglob'); +``` + +**True** + +```js +isExtglob('?(abc)'); +isExtglob('@(abc)'); +isExtglob('!(abc)'); +isExtglob('*(abc)'); +isExtglob('+(abc)'); +``` + +**False** + +Everything else... + +```js +isExtglob('foo.js'); +isExtglob('!foo.js'); +isExtglob('*.js'); +isExtglob('**/abc.js'); +isExtglob('abc/*.js'); +isExtglob('abc/(aaa|bbb).js'); +isExtglob('abc/[a-z].js'); +isExtglob('abc/{a,b}.js'); +isExtglob('abc/?.js'); +isExtglob('abc.js'); +isExtglob('abc/def/ghi.js'); +``` + +## Related +* [extglob](https://github.com/jonschlinkert/extglob): Extended globs. extglobs add the expressive power of regular expressions to glob patterns. +* [micromatch](https://github.com/jonschlinkert/micromatch): Glob matching for javascript/node.js. A faster alternative to minimatch (10-45x faster on avg), with all the features you're used to using in your Grunt and gulp tasks. +* [parse-glob](https://github.com/jonschlinkert/parse-glob): Parse a glob pattern into an object of tokens. + +## Run tests +Install dev dependencies. + +```bash +npm i -d && npm test +``` + + +## Contributing +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-extglob/issues) + + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License +Copyright (c) 2015 Jon Schlinkert +Released under the MIT license + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 06, 2015._ \ No newline at end of file diff --git a/node_modules/is-extglob/index.js b/node_modules/is-extglob/index.js new file mode 100644 index 000000000..803047f74 --- /dev/null +++ b/node_modules/is-extglob/index.js @@ -0,0 +1,11 @@ +/*! + * is-extglob + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +module.exports = function isExtglob(str) { + return typeof str === 'string' + && /[@?!+*]\(/.test(str); +}; diff --git a/node_modules/is-extglob/package.json b/node_modules/is-extglob/package.json new file mode 100644 index 000000000..d060bee78 --- /dev/null +++ b/node_modules/is-extglob/package.json @@ -0,0 +1,79 @@ +{ + "_from": "is-extglob@^1.0.0", + "_id": "is-extglob@1.0.0", + "_inBundle": false, + "_integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "_location": "/is-extglob", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-extglob@^1.0.0", + "name": "is-extglob", + "escapedName": "is-extglob", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/extglob", + "/is-glob", + "/micromatch", + "/parse-glob" + ], + "_resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "_shasum": "ac468177c4943405a092fc8f29760c6ffc6206c0", + "_spec": "is-extglob@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-extglob/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Returns true if a string has an extglob.", + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-extglob", + "keywords": [ + "bash", + "braces", + "check", + "exec", + "extglob", + "expression", + "glob", + "globbing", + "globstar", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "license": "MIT", + "main": "index.js", + "name": "is-extglob", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-extglob.git" + }, + "scripts": { + "prepublish": "browserify -o browser.js -e index.js", + "test": "mocha" + }, + "version": "1.0.0" +} diff --git a/node_modules/is-finite/index.js b/node_modules/is-finite/index.js new file mode 100644 index 000000000..806738750 --- /dev/null +++ b/node_modules/is-finite/index.js @@ -0,0 +1,6 @@ +'use strict'; +var numberIsNan = require('number-is-nan'); + +module.exports = Number.isFinite || function (val) { + return !(typeof val !== 'number' || numberIsNan(val) || val === Infinity || val === -Infinity); +}; diff --git a/node_modules/is-finite/license b/node_modules/is-finite/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/is-finite/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-finite/package.json b/node_modules/is-finite/package.json new file mode 100644 index 000000000..9cc6eef8d --- /dev/null +++ b/node_modules/is-finite/package.json @@ -0,0 +1,68 @@ +{ + "_from": "is-finite@^1.0.1", + "_id": "is-finite@1.0.2", + "_inBundle": false, + "_integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "_location": "/is-finite", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-finite@^1.0.1", + "name": "is-finite", + "escapedName": "is-finite", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/pretty-ms" + ], + "_resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "_shasum": "cc6677695602be550ef11e8b4aa6305342b6d0aa", + "_spec": "is-finite@^1.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/pretty-ms", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-finite/issues" + }, + "bundleDependencies": false, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "deprecated": false, + "description": "ES2015 Number.isFinite() ponyfill", + "devDependencies": { + "ava": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/is-finite#readme", + "keywords": [ + "es2015", + "ponyfill", + "polyfill", + "shim", + "number", + "finite", + "is" + ], + "license": "MIT", + "name": "is-finite", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-finite.git" + }, + "scripts": { + "test": "ava" + }, + "version": "1.0.2" +} diff --git a/node_modules/is-finite/readme.md b/node_modules/is-finite/readme.md new file mode 100644 index 000000000..567710ca2 --- /dev/null +++ b/node_modules/is-finite/readme.md @@ -0,0 +1,28 @@ +# is-finite [![Build Status](https://travis-ci.org/sindresorhus/is-finite.svg?branch=master)](https://travis-ci.org/sindresorhus/is-finite) + +> ES2015 [`Number.isFinite()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite) [ponyfill](https://ponyfill.com) + + +## Install + +```sh +$ npm install --save is-finite +``` + + +## Usage + +```js +var numIsFinite = require('is-finite'); + +numIsFinite(4); +//=> true + +numIsFinite(Infinity); +//=> false +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/is-glob/LICENSE b/node_modules/is-glob/LICENSE new file mode 100644 index 000000000..fa30c4cb3 --- /dev/null +++ b/node_modules/is-glob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-glob/README.md b/node_modules/is-glob/README.md new file mode 100644 index 000000000..b16254293 --- /dev/null +++ b/node_modules/is-glob/README.md @@ -0,0 +1,105 @@ +# is-glob [![NPM version](https://badge.fury.io/js/is-glob.svg)](http://badge.fury.io/js/is-glob) [![Build Status](https://travis-ci.org/jonschlinkert/is-glob.svg)](https://travis-ci.org/jonschlinkert/is-glob) + +> Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience. + +Also take a look at [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob). + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i is-glob --save +``` + +## Usage + +```js +var isGlob = require('is-glob'); +``` + +**True** + +Patterns that have glob characters or regex patterns will return `true`: + +```js +isGlob('!foo.js'); +isGlob('*.js'); +isGlob('**/abc.js'); +isGlob('abc/*.js'); +isGlob('abc/(aaa|bbb).js'); +isGlob('abc/[a-z].js'); +isGlob('abc/{a,b}.js'); +isGlob('abc/?.js'); +//=> true +``` + +Extglobs + +```js +isGlob('abc/@(a).js'); +isGlob('abc/!(a).js'); +isGlob('abc/+(a).js'); +isGlob('abc/*(a).js'); +isGlob('abc/?(a).js'); +//=> true +``` + +**False** + +Patterns that do not have glob patterns return `false`: + +```js +isGlob('abc.js'); +isGlob('abc/def/ghi.js'); +isGlob('foo.js'); +isGlob('abc/@.js'); +isGlob('abc/+.js'); +isGlob(); +isGlob(null); +//=> false +``` + +Arrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)): + +```js +isGlob(['**/*.js']); +isGlob(['foo.js']); +//=> false +``` + +## Related + +* [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob) +* [is-extglob](https://www.npmjs.com/package/is-extglob): Returns true if a string has an extglob. | [homepage](https://github.com/jonschlinkert/is-extglob) +* [is-posix-bracket](https://www.npmjs.com/package/is-posix-bracket): Returns true if the given string is a POSIX bracket expression (POSIX character class). | [homepage](https://github.com/jonschlinkert/is-posix-bracket) +* [is-valid-glob](https://www.npmjs.com/package/is-valid-glob): Return true if a value is a valid glob pattern or patterns. | [homepage](https://github.com/jonschlinkert/is-valid-glob) +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just… [more](https://www.npmjs.com/package/micromatch) | [homepage](https://github.com/jonschlinkert/micromatch) + +## Run tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-glob/issues/new). + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 02, 2015._ \ No newline at end of file diff --git a/node_modules/is-glob/index.js b/node_modules/is-glob/index.js new file mode 100644 index 000000000..ef27bba4f --- /dev/null +++ b/node_modules/is-glob/index.js @@ -0,0 +1,14 @@ +/*! + * is-glob + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +var isExtglob = require('is-extglob'); + +module.exports = function isGlob(str) { + return typeof str === 'string' + && (/[*!?{}(|)[\]]/.test(str) + || isExtglob(str)); +}; \ No newline at end of file diff --git a/node_modules/is-glob/package.json b/node_modules/is-glob/package.json new file mode 100644 index 000000000..ea357ad6d --- /dev/null +++ b/node_modules/is-glob/package.json @@ -0,0 +1,92 @@ +{ + "_from": "is-glob@^2.0.0", + "_id": "is-glob@2.0.1", + "_inBundle": false, + "_integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "_location": "/is-glob", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-glob@^2.0.0", + "name": "is-glob", + "escapedName": "is-glob", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/chokidar", + "/glob-base", + "/glob-parent", + "/micromatch", + "/parse-glob" + ], + "_resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "_shasum": "d096f926a3ded5600f3fdfd91198cb0888c2d863", + "_spec": "is-glob@^2.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/chokidar", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-glob/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-extglob": "^1.0.0" + }, + "deprecated": false, + "description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.", + "devDependencies": { + "mocha": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-glob", + "keywords": [ + "bash", + "braces", + "check", + "exec", + "extglob", + "expression", + "glob", + "globbing", + "globstar", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "license": "MIT", + "main": "index.js", + "name": "is-glob", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-glob.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "has-glob", + "is-extglob", + "is-posix-bracket", + "is-valid-glob", + "micromatch" + ] + } + }, + "version": "2.0.1" +} diff --git a/node_modules/is-number/LICENSE b/node_modules/is-number/LICENSE new file mode 100644 index 000000000..fa30c4cb3 --- /dev/null +++ b/node_modules/is-number/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-number/README.md b/node_modules/is-number/README.md new file mode 100644 index 000000000..8395f9131 --- /dev/null +++ b/node_modules/is-number/README.md @@ -0,0 +1,103 @@ +# is-number [![NPM version](https://badge.fury.io/js/is-number.svg)](http://badge.fury.io/js/is-number) [![Build Status](https://travis-ci.org/jonschlinkert/is-number.svg)](https://travis-ci.org/jonschlinkert/is-number) + +> Returns true if the value is a number. comprehensive tests. + +To understand some of the rationale behind the decisions made in this library (and to learn about some oddities of number evaluation in JavaScript), [see this gist](https://gist.github.com/jonschlinkert/e30c70c713da325d0e81). + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i is-number --save +``` + +## Usage + +```js +var isNumber = require('is-number'); +``` + +### true + +See the [tests](./test.js) for more examples. + +```js +isNumber(5e3) //=> 'true' +isNumber(0xff) //=> 'true' +isNumber(-1.1) //=> 'true' +isNumber(0) //=> 'true' +isNumber(1) //=> 'true' +isNumber(1.1) //=> 'true' +isNumber(10) //=> 'true' +isNumber(10.10) //=> 'true' +isNumber(100) //=> 'true' +isNumber('-1.1') //=> 'true' +isNumber('0') //=> 'true' +isNumber('012') //=> 'true' +isNumber('0xff') //=> 'true' +isNumber('1') //=> 'true' +isNumber('1.1') //=> 'true' +isNumber('10') //=> 'true' +isNumber('10.10') //=> 'true' +isNumber('100') //=> 'true' +isNumber('5e3') //=> 'true' +isNumber(parseInt('012')) //=> 'true' +isNumber(parseFloat('012')) //=> 'true' +``` + +### False + +See the [tests](./test.js) for more examples. + +```js +isNumber('foo') //=> 'false' +isNumber([1]) //=> 'false' +isNumber([]) //=> 'false' +isNumber(function () {}) //=> 'false' +isNumber(Infinity) //=> 'false' +isNumber(NaN) //=> 'false' +isNumber(new Array('abc')) //=> 'false' +isNumber(new Array(2)) //=> 'false' +isNumber(new Buffer('abc')) //=> 'false' +isNumber(null) //=> 'false' +isNumber(undefined) //=> 'false' +isNumber({abc: 'abc'}) //=> 'false' +``` + +## Other projects + +* [even](https://www.npmjs.com/package/even): Get the even numbered items from an array. | [homepage](https://github.com/jonschlinkert/even) +* [is-even](https://www.npmjs.com/package/is-even): Return true if the given number is even. | [homepage](https://github.com/jonschlinkert/is-even) +* [is-odd](https://www.npmjs.com/package/is-odd): Returns true if the given number is odd. | [homepage](https://github.com/jonschlinkert/is-odd) +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive) +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of) +* [odd](https://www.npmjs.com/package/odd): Get the odd numbered items from an array. | [homepage](https://github.com/jonschlinkert/odd) + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-number/issues/new). + +## Run tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on November 22, 2015._ \ No newline at end of file diff --git a/node_modules/is-number/index.js b/node_modules/is-number/index.js new file mode 100644 index 000000000..96ec66d5e --- /dev/null +++ b/node_modules/is-number/index.js @@ -0,0 +1,19 @@ +/*! + * is-number + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var typeOf = require('kind-of'); + +module.exports = function isNumber(num) { + var type = typeOf(num); + if (type !== 'number' && type !== 'string') { + return false; + } + var n = +num; + return (n - n + 1) >= 0 && num !== ''; +}; diff --git a/node_modules/is-number/package.json b/node_modules/is-number/package.json new file mode 100644 index 000000000..7d91be0a8 --- /dev/null +++ b/node_modules/is-number/package.json @@ -0,0 +1,90 @@ +{ + "_from": "is-number@^2.1.0", + "_id": "is-number@2.1.0", + "_inBundle": false, + "_integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "_location": "/is-number", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-number@^2.1.0", + "name": "is-number", + "escapedName": "is-number", + "rawSpec": "^2.1.0", + "saveSpec": null, + "fetchSpec": "^2.1.0" + }, + "_requiredBy": [ + "/fill-range" + ], + "_resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "_shasum": "01fcbbb393463a548f2f466cce16dece49db908f", + "_spec": "is-number@^2.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/fill-range", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-number/issues" + }, + "bundleDependencies": false, + "dependencies": { + "kind-of": "^3.0.2" + }, + "deprecated": false, + "description": "Returns true if the value is a number. comprehensive tests.", + "devDependencies": { + "benchmarked": "^0.1.3", + "chalk": "^0.5.1", + "mocha": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-number", + "keywords": [ + "check", + "coerce", + "coercion", + "integer", + "is", + "is number", + "is-number", + "istype", + "kind of", + "math", + "number", + "test", + "type", + "typeof", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "is-number", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-number.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "kind-of", + "is-primitive", + "even", + "odd", + "is-even", + "is-odd" + ] + } + }, + "version": "2.1.0" +} diff --git a/node_modules/is-plain-object/LICENSE b/node_modules/is-plain-object/LICENSE new file mode 100644 index 000000000..3f2eca18f --- /dev/null +++ b/node_modules/is-plain-object/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-plain-object/README.md b/node_modules/is-plain-object/README.md new file mode 100644 index 000000000..1f9d0c82d --- /dev/null +++ b/node_modules/is-plain-object/README.md @@ -0,0 +1,104 @@ +# is-plain-object [![NPM version](https://img.shields.io/npm/v/is-plain-object.svg?style=flat)](https://www.npmjs.com/package/is-plain-object) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-plain-object.svg?style=flat)](https://npmjs.org/package/is-plain-object) [![NPM total downloads](https://img.shields.io/npm/dt/is-plain-object.svg?style=flat)](https://npmjs.org/package/is-plain-object) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-plain-object.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-plain-object) + +> Returns true if an object was created by the `Object` constructor. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-plain-object +``` + +Use [isobject](https://github.com/jonschlinkert/isobject) if you only want to check if the value is an object and not an array or null. + +## Usage + +```js +var isPlainObject = require('is-plain-object'); +``` + +**true** when created by the `Object` constructor. + +```js +isPlainObject(Object.create({})); +//=> true +isPlainObject(Object.create(Object.prototype)); +//=> true +isPlainObject({foo: 'bar'}); +//=> true +isPlainObject({}); +//=> true +``` + +**false** when not created by the `Object` constructor. + +```js +isPlainObject(1); +//=> false +isPlainObject(['foo', 'bar']); +//=> false +isPlainObject([]); +//=> false +isPlainObject(new Foo); +//=> false +isPlainObject(null); +//=> false +isPlainObject(Object.create(null)); +//=> false +``` + +## About + +### Related projects + +* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 17 | [jonschlinkert](https://github.com/jonschlinkert) | +| 6 | [stevenvachon](https://github.com/stevenvachon) | +| 3 | [onokumus](https://github.com/onokumus) | +| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 11, 2017._ \ No newline at end of file diff --git a/node_modules/is-plain-object/index.d.ts b/node_modules/is-plain-object/index.d.ts new file mode 100644 index 000000000..74a44e976 --- /dev/null +++ b/node_modules/is-plain-object/index.d.ts @@ -0,0 +1,5 @@ +export = isPlainObject; + +declare function isPlainObject(o: any): boolean; + +declare namespace isPlainObject {} diff --git a/node_modules/is-plain-object/index.js b/node_modules/is-plain-object/index.js new file mode 100644 index 000000000..c3284849e --- /dev/null +++ b/node_modules/is-plain-object/index.js @@ -0,0 +1,37 @@ +/*! + * is-plain-object + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var isObject = require('isobject'); + +function isObjectObject(o) { + return isObject(o) === true + && Object.prototype.toString.call(o) === '[object Object]'; +} + +module.exports = function isPlainObject(o) { + var ctor,prot; + + if (isObjectObject(o) === false) return false; + + // If has modified constructor + ctor = o.constructor; + if (typeof ctor !== 'function') return false; + + // If has modified prototype + prot = ctor.prototype; + if (isObjectObject(prot) === false) return false; + + // If constructor does not have an Object-specific method + if (prot.hasOwnProperty('isPrototypeOf') === false) { + return false; + } + + // Most likely a plain Object + return true; +}; diff --git a/node_modules/is-plain-object/node_modules/isobject/LICENSE b/node_modules/is-plain-object/node_modules/isobject/LICENSE new file mode 100644 index 000000000..943e71d05 --- /dev/null +++ b/node_modules/is-plain-object/node_modules/isobject/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +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. \ No newline at end of file diff --git a/node_modules/is-plain-object/node_modules/isobject/README.md b/node_modules/is-plain-object/node_modules/isobject/README.md new file mode 100644 index 000000000..d01feaa40 --- /dev/null +++ b/node_modules/is-plain-object/node_modules/isobject/README.md @@ -0,0 +1,122 @@ +# isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM monthly downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![NPM total downloads](https://img.shields.io/npm/dt/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/isobject) + +> Returns true if the value is an object and not an array or null. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save isobject +``` + +Install with [yarn](https://yarnpkg.com): + +```sh +$ yarn add isobject +``` + +Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install isobject +``` +Install with [bower](https://bower.io/) + +```sh +$ bower install isobject +``` + +## Usage + +```js +var isObject = require('isobject'); +``` + +**True** + +All of the following return `true`: + +```js +isObject({}); +isObject(Object.create({})); +isObject(Object.create(Object.prototype)); +isObject(Object.create(null)); +isObject({}); +isObject(new Foo); +isObject(/foo/); +``` + +**False** + +All of the following return `false`: + +```js +isObject(); +isObject(function () {}); +isObject(1); +isObject([]); +isObject(undefined); +isObject(null); +``` + +## About + +### Related projects + +* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") +* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 29 | [jonschlinkert](https://github.com/jonschlinkert) | +| 4 | [doowb](https://github.com/doowb) | +| 1 | [magnudae](https://github.com/magnudae) | +| 1 | [LeSuisse](https://github.com/LeSuisse) | +| 1 | [tmcw](https://github.com/tmcw) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 30, 2017._ \ No newline at end of file diff --git a/node_modules/is-plain-object/node_modules/isobject/index.d.ts b/node_modules/is-plain-object/node_modules/isobject/index.d.ts new file mode 100644 index 000000000..55f81c275 --- /dev/null +++ b/node_modules/is-plain-object/node_modules/isobject/index.d.ts @@ -0,0 +1,5 @@ +export = isObject; + +declare function isObject(val: any): boolean; + +declare namespace isObject {} diff --git a/node_modules/is-plain-object/node_modules/isobject/index.js b/node_modules/is-plain-object/node_modules/isobject/index.js new file mode 100644 index 000000000..2d59958bf --- /dev/null +++ b/node_modules/is-plain-object/node_modules/isobject/index.js @@ -0,0 +1,12 @@ +/*! + * isobject + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +module.exports = function isObject(val) { + return val != null && typeof val === 'object' && Array.isArray(val) === false; +}; diff --git a/node_modules/is-plain-object/node_modules/isobject/package.json b/node_modules/is-plain-object/node_modules/isobject/package.json new file mode 100644 index 000000000..5a4695df9 --- /dev/null +++ b/node_modules/is-plain-object/node_modules/isobject/package.json @@ -0,0 +1,119 @@ +{ + "_from": "isobject@^3.0.1", + "_id": "isobject@3.0.1", + "_inBundle": false, + "_integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "_location": "/is-plain-object/isobject", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "isobject@^3.0.1", + "name": "isobject", + "escapedName": "isobject", + "rawSpec": "^3.0.1", + "saveSpec": null, + "fetchSpec": "^3.0.1" + }, + "_requiredBy": [ + "/is-plain-object" + ], + "_resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "_shasum": "4e431e92b11a9731636aa1f9c8d1ccbcfdab78df", + "_spec": "isobject@^3.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/is-plain-object", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/isobject/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "url": "https://github.com/LeSuisse" + }, + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Magnús Dæhlen", + "url": "https://github.com/magnudae" + }, + { + "name": "Tom MacWright", + "url": "https://macwright.org" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Returns true if the value is an object and not an array or null.", + "devDependencies": { + "gulp-format-md": "^0.1.9", + "mocha": "^2.4.5" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.d.ts", + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/isobject", + "keywords": [ + "check", + "is", + "is-object", + "isobject", + "kind", + "kind-of", + "kindof", + "native", + "object", + "type", + "typeof", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "isobject", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/isobject.git" + }, + "scripts": { + "test": "mocha" + }, + "types": "index.d.ts", + "verb": { + "related": { + "list": [ + "extend-shallow", + "is-plain-object", + "kind-of", + "merge-deep" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb" + ] + }, + "version": "3.0.1" +} diff --git a/node_modules/is-plain-object/package.json b/node_modules/is-plain-object/package.json new file mode 100644 index 000000000..12d82f912 --- /dev/null +++ b/node_modules/is-plain-object/package.json @@ -0,0 +1,124 @@ +{ + "_from": "is-plain-object@^2.0.3", + "_id": "is-plain-object@2.0.4", + "_inBundle": false, + "_integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "_location": "/is-plain-object", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-plain-object@^2.0.3", + "name": "is-plain-object", + "escapedName": "is-plain-object", + "rawSpec": "^2.0.3", + "saveSpec": null, + "fetchSpec": "^2.0.3" + }, + "_requiredBy": [ + "/extend-shallow/is-extendable", + "/mixin-deep/is-extendable", + "/set-value", + "/union-value/set-value" + ], + "_resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "_shasum": "2c163b3fafb1b606d9d17928f05c2a1c38e07677", + "_spec": "is-plain-object@^2.0.3", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/set-value", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-plain-object/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Osman Nuri Okumuş", + "url": "http://onokumus.com" + }, + { + "name": "Steven Vachon", + "url": "https://svachon.com" + }, + { + "url": "https://github.com/wtgtybhertgeghgtwtg" + } + ], + "dependencies": { + "isobject": "^3.0.1" + }, + "deprecated": false, + "description": "Returns true if an object was created by the `Object` constructor.", + "devDependencies": { + "browserify": "^14.4.0", + "chai": "^4.0.2", + "gulp-format-md": "^1.0.0", + "mocha": "^3.4.2", + "mocha-phantomjs": "^4.1.0", + "phantomjs": "^2.1.7", + "uglify-js": "^3.0.24" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.d.ts", + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-plain-object", + "keywords": [ + "check", + "is", + "is-object", + "isobject", + "javascript", + "kind", + "kind-of", + "object", + "plain", + "type", + "typeof", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "is-plain-object", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-plain-object.git" + }, + "scripts": { + "browserify": "browserify index.js --standalone isPlainObject | uglifyjs --compress --mangle -o browser/is-plain-object.js", + "test": "npm run test_node && npm run browserify && npm run test_browser", + "test_browser": "mocha-phantomjs test/browser.html", + "test_node": "mocha" + }, + "types": "index.d.ts", + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "is-number", + "isobject", + "kind-of" + ] + }, + "lint": { + "reflinks": true + } + }, + "version": "2.0.4" +} diff --git a/node_modules/is-posix-bracket/LICENSE b/node_modules/is-posix-bracket/LICENSE new file mode 100644 index 000000000..1e49edf81 --- /dev/null +++ b/node_modules/is-posix-bracket/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2016, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-posix-bracket/README.md b/node_modules/is-posix-bracket/README.md new file mode 100644 index 000000000..1d06a4d9e --- /dev/null +++ b/node_modules/is-posix-bracket/README.md @@ -0,0 +1,88 @@ +# is-posix-bracket [![NPM version](https://img.shields.io/npm/v/is-posix-bracket.svg?style=flat)](https://www.npmjs.com/package/is-posix-bracket) [![NPM downloads](https://img.shields.io/npm/dm/is-posix-bracket.svg?style=flat)](https://npmjs.org/package/is-posix-bracket) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-posix-bracket.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-posix-bracket) + +> Returns true if the given string is a POSIX bracket expression (POSIX character class). + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install is-posix-bracket --save +``` + +## Usage + +```js +var isPosixBracket = require('is-posix-bracket'); + +isPosixBracket('[foo:]]'); +//=> false +isPosixBracket('[xdigit:]]'); +//=> false +isPosixBracket('[[:xdigit:]]'); +//=> true +isPosixBracket('[[:xdigit:]]'); +//=> true +isPosixBracket('[[:alpha:]123]'); +//=> true +isPosixBracket('[[:alpha:]123]'); +//=> true +isPosixBracket('[a-c[:digit:]x-z]'); +//=> true +isPosixBracket('[:al:]'); +//=> true +isPosixBracket('[abc[:punct:][0-9]'); +//=> true +``` + +## Related projects + +You might also be interested in these projects: + +* [braces](https://www.npmjs.com/package/braces): Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces… [more](https://www.npmjs.com/package/braces) | [homepage](https://github.com/jonschlinkert/braces) +* [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/jonschlinkert/expand-brackets) +* [is-extglob](https://www.npmjs.com/package/is-extglob): Returns true if a string has an extglob. | [homepage](https://github.com/jonschlinkert/is-extglob) +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern.… [more](https://www.npmjs.com/package/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob) +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just… [more](https://www.npmjs.com/package/micromatch) | [homepage](https://github.com/jonschlinkert/micromatch) + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-posix-bracket/issues/new). + +## Building docs + +Generate readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install verb && npm run docs +``` + +Or, if [verb](https://github.com/verbose/verb) is installed globally: + +```sh +$ verb +``` + +## Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +## Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/is-posix-bracket/blob/master/LICENSE). + +*** + +_This file was generated by [verb](https://github.com/verbose/verb), v, on April 05, 2016._ \ No newline at end of file diff --git a/node_modules/is-posix-bracket/index.js b/node_modules/is-posix-bracket/index.js new file mode 100644 index 000000000..7cf1de55b --- /dev/null +++ b/node_modules/is-posix-bracket/index.js @@ -0,0 +1,10 @@ +/*! + * is-posix-bracket + * + * Copyright (c) 2015-2016, Jon Schlinkert. + * Licensed under the MIT License. + */ + +module.exports = function isPosixBracket(str) { + return typeof str === 'string' && /\[([:.=+])(?:[^\[\]]|)+\1\]/.test(str); +}; diff --git a/node_modules/is-posix-bracket/package.json b/node_modules/is-posix-bracket/package.json new file mode 100644 index 000000000..eb7524bb8 --- /dev/null +++ b/node_modules/is-posix-bracket/package.json @@ -0,0 +1,95 @@ +{ + "_from": "is-posix-bracket@^0.1.0", + "_id": "is-posix-bracket@0.1.1", + "_inBundle": false, + "_integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "_location": "/is-posix-bracket", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-posix-bracket@^0.1.0", + "name": "is-posix-bracket", + "escapedName": "is-posix-bracket", + "rawSpec": "^0.1.0", + "saveSpec": null, + "fetchSpec": "^0.1.0" + }, + "_requiredBy": [ + "/expand-brackets" + ], + "_resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "_shasum": "3334dc79774368e92f016e6fbc0a88f5cd6e6bc4", + "_spec": "is-posix-bracket@^0.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/expand-brackets", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-posix-bracket/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Returns true if the given string is a POSIX bracket expression (POSIX character class).", + "devDependencies": { + "gulp-format-md": "^0.1.7", + "mocha": "^2.4.5" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-posix-bracket", + "keywords": [ + "braces", + "brackets", + "character", + "character-class", + "class", + "expression", + "posix", + "regex", + "regexp", + "regular" + ], + "license": "MIT", + "main": "index.js", + "name": "is-posix-bracket", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-posix-bracket.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "braces", + "expand-brackets", + "is-extglob", + "is-glob", + "micromatch" + ] + }, + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "0.1.1" +} diff --git a/node_modules/is-primitive/LICENSE b/node_modules/is-primitive/LICENSE new file mode 100644 index 000000000..fa30c4cb3 --- /dev/null +++ b/node_modules/is-primitive/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-primitive/README.md b/node_modules/is-primitive/README.md new file mode 100644 index 000000000..e1c306428 --- /dev/null +++ b/node_modules/is-primitive/README.md @@ -0,0 +1,57 @@ +# is-primitive [![NPM version](https://badge.fury.io/js/is-primitive.svg)](http://badge.fury.io/js/is-primitive) [![Build Status](https://travis-ci.org/jonschlinkert/is-primitive.svg)](https://travis-ci.org/jonschlinkert/is-primitive) + +> Returns `true` if the value is a primitive. + +## Install with [npm](npmjs.org) + +```bash +npm i is-primitive --save +``` + +## Running tests +Install dev dependencies. + +```bash +npm i -d && npm test +``` + +## Usage + +```js +var isPrimitive = require('is-primitive'); +isPrimitive('abc'); +//=> true + +isPrimitive(42); +//=> true + +isPrimitive(false); +//=> true + +isPrimitive(true); +//=> true + +isPrimitive({}); +//=> false + +isPrimitive([]); +//=> false + +isPrimitive(function(){}); +//=> false +``` + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License +Copyright (c) 2014-2015 Jon Schlinkert +Released under the MIT license + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 16, 2015._ \ No newline at end of file diff --git a/node_modules/is-primitive/index.js b/node_modules/is-primitive/index.js new file mode 100644 index 000000000..55f11cf05 --- /dev/null +++ b/node_modules/is-primitive/index.js @@ -0,0 +1,13 @@ +/*! + * is-primitive + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +// see http://jsperf.com/testing-value-is-primitive/7 +module.exports = function isPrimitive(value) { + return value == null || (typeof value !== 'function' && typeof value !== 'object'); +}; diff --git a/node_modules/is-primitive/package.json b/node_modules/is-primitive/package.json new file mode 100644 index 000000000..33bfdbc6c --- /dev/null +++ b/node_modules/is-primitive/package.json @@ -0,0 +1,71 @@ +{ + "_from": "is-primitive@^2.0.0", + "_id": "is-primitive@2.0.0", + "_inBundle": false, + "_integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "_location": "/is-primitive", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-primitive@^2.0.0", + "name": "is-primitive", + "escapedName": "is-primitive", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/is-equal-shallow" + ], + "_resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "_shasum": "207bab91638499c07b2adf240a41a87210034575", + "_spec": "is-primitive@^2.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/is-equal-shallow", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-primitive/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Returns `true` if the value is a primitive. ", + "devDependencies": { + "mocha": "*", + "should": "^4.0.4" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-primitive", + "keywords": [ + "boolean", + "check", + "number", + "primitive", + "string", + "symbol", + "type", + "typeof", + "util" + ], + "license": { + "type": "MIT", + "url": "https://github.com/jonschlinkert/is-primitive/blob/master/LICENSE" + }, + "main": "index.js", + "name": "is-primitive", + "repository": { + "type": "git", + "url": "git://github.com/jonschlinkert/is-primitive.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "2.0.0" +} diff --git a/node_modules/is-stream/index.js b/node_modules/is-stream/index.js new file mode 100644 index 000000000..6f7ec91a4 --- /dev/null +++ b/node_modules/is-stream/index.js @@ -0,0 +1,21 @@ +'use strict'; + +var isStream = module.exports = function (stream) { + return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function'; +}; + +isStream.writable = function (stream) { + return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object'; +}; + +isStream.readable = function (stream) { + return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object'; +}; + +isStream.duplex = function (stream) { + return isStream.writable(stream) && isStream.readable(stream); +}; + +isStream.transform = function (stream) { + return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object'; +}; diff --git a/node_modules/is-stream/license b/node_modules/is-stream/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/is-stream/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-stream/package.json b/node_modules/is-stream/package.json new file mode 100644 index 000000000..f4a380798 --- /dev/null +++ b/node_modules/is-stream/package.json @@ -0,0 +1,70 @@ +{ + "_from": "is-stream@^1.1.0", + "_id": "is-stream@1.1.0", + "_inBundle": false, + "_integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "_location": "/is-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-stream@^1.1.0", + "name": "is-stream", + "escapedName": "is-stream", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/execa" + ], + "_resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "_shasum": "12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44", + "_spec": "is-stream@^1.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/execa", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-stream/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Check if something is a Node.js stream", + "devDependencies": { + "ava": "*", + "tempfile": "^1.1.0", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/is-stream#readme", + "keywords": [ + "stream", + "type", + "streams", + "writable", + "readable", + "duplex", + "transform", + "check", + "detect", + "is" + ], + "license": "MIT", + "name": "is-stream", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-stream.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.1.0" +} diff --git a/node_modules/is-stream/readme.md b/node_modules/is-stream/readme.md new file mode 100644 index 000000000..d8afce81d --- /dev/null +++ b/node_modules/is-stream/readme.md @@ -0,0 +1,42 @@ +# is-stream [![Build Status](https://travis-ci.org/sindresorhus/is-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/is-stream) + +> Check if something is a [Node.js stream](https://nodejs.org/api/stream.html) + + +## Install + +``` +$ npm install --save is-stream +``` + + +## Usage + +```js +const fs = require('fs'); +const isStream = require('is-stream'); + +isStream(fs.createReadStream('unicorn.png')); +//=> true + +isStream({}); +//=> false +``` + + +## API + +### isStream(stream) + +#### isStream.writable(stream) + +#### isStream.readable(stream) + +#### isStream.duplex(stream) + +#### isStream.transform(stream) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/is-windows/LICENSE b/node_modules/is-windows/LICENSE new file mode 100644 index 000000000..f8de06305 --- /dev/null +++ b/node_modules/is-windows/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2018, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-windows/README.md b/node_modules/is-windows/README.md new file mode 100644 index 000000000..485bfdecb --- /dev/null +++ b/node_modules/is-windows/README.md @@ -0,0 +1,95 @@ +# is-windows [![NPM version](https://img.shields.io/npm/v/is-windows.svg?style=flat)](https://www.npmjs.com/package/is-windows) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-windows.svg?style=flat)](https://npmjs.org/package/is-windows) [![NPM total downloads](https://img.shields.io/npm/dt/is-windows.svg?style=flat)](https://npmjs.org/package/is-windows) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-windows.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-windows) + +> Returns true if the platform is windows. UMD module, works with node.js, commonjs, browser, AMD, electron, etc. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-windows +``` + +## Heads up! + +As of `v0.2.0` this module always returns a function. + +## Node.js usage + +```js +var isWindows = require('is-windows'); + +console.log(isWindows()); +//=> returns true if the platform is windows +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [is-absolute](https://www.npmjs.com/package/is-absolute): Returns true if a file path is absolute. Does not rely on the path module… [more](https://github.com/jonschlinkert/is-absolute) | [homepage](https://github.com/jonschlinkert/is-absolute "Returns true if a file path is absolute. Does not rely on the path module and can be used as a polyfill for node.js native `path.isAbolute`.") +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [is-relative](https://www.npmjs.com/package/is-relative): Returns `true` if the path appears to be relative. | [homepage](https://github.com/jonschlinkert/is-relative "Returns `true` if the path appears to be relative.") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") +* [window-size](https://www.npmjs.com/package/window-size): Reliable way to get the height and width of terminal/console, since it's not calculated or… [more](https://github.com/jonschlinkert/window-size) | [homepage](https://github.com/jonschlinkert/window-size "Reliable way to get the height and width of terminal/console, since it's not calculated or updated the same way on all platforms, environments and node.js versions.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 11 | [jonschlinkert](https://github.com/jonschlinkert) | +| 4 | [doowb](https://github.com/doowb) | +| 1 | [SimenB](https://github.com/SimenB) | +| 1 | [gucong3000](https://github.com/gucong3000) | + +### Author + +**Jon Schlinkert** + +* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on February 14, 2018._ \ No newline at end of file diff --git a/node_modules/is-windows/index.js b/node_modules/is-windows/index.js new file mode 100644 index 000000000..55d43e092 --- /dev/null +++ b/node_modules/is-windows/index.js @@ -0,0 +1,27 @@ +/*! + * is-windows + * + * Copyright © 2015-2018, Jon Schlinkert. + * Released under the MIT License. + */ + +(function(factory) { + if (exports && typeof exports === 'object' && typeof module !== 'undefined') { + module.exports = factory(); + } else if (typeof define === 'function' && define.amd) { + define([], factory); + } else if (typeof window !== 'undefined') { + window.isWindows = factory(); + } else if (typeof global !== 'undefined') { + global.isWindows = factory(); + } else if (typeof self !== 'undefined') { + self.isWindows = factory(); + } else { + this.isWindows = factory(); + } +})(function() { + 'use strict'; + return function isWindows() { + return process && (process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE)); + }; +}); diff --git a/node_modules/is-windows/package.json b/node_modules/is-windows/package.json new file mode 100644 index 000000000..f2c7ad3fe --- /dev/null +++ b/node_modules/is-windows/package.json @@ -0,0 +1,111 @@ +{ + "_from": "is-windows@^1.0.2", + "_id": "is-windows@1.0.2", + "_inBundle": false, + "_integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "_location": "/is-windows", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-windows@^1.0.2", + "name": "is-windows", + "escapedName": "is-windows", + "rawSpec": "^1.0.2", + "saveSpec": null, + "fetchSpec": "^1.0.2" + }, + "_requiredBy": [ + "/nanomatch" + ], + "_resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "_shasum": "d1850eb9791ecd18e6182ce12a30f396634bb19d", + "_spec": "is-windows@^1.0.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/nanomatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-windows/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Simen Bekkhus", + "url": "https://github.com/SimenB" + }, + { + "name": "刘祺", + "url": "gucong.co.cc" + } + ], + "deprecated": false, + "description": "Returns true if the platform is windows. UMD module, works with node.js, commonjs, browser, AMD, electron, etc.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.5.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-windows", + "keywords": [ + "check", + "cywin", + "is", + "is-windows", + "nix", + "operating system", + "os", + "platform", + "process", + "unix", + "win", + "win32", + "windows" + ], + "license": "MIT", + "main": "index.js", + "name": "is-windows", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-windows.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "is-absolute", + "is-glob", + "is-relative", + "isobject", + "window-size" + ] + }, + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb" + ] + }, + "version": "1.0.2" +} diff --git a/node_modules/isarray/.npmignore b/node_modules/isarray/.npmignore new file mode 100644 index 000000000..3c3629e64 --- /dev/null +++ b/node_modules/isarray/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/isarray/.travis.yml b/node_modules/isarray/.travis.yml new file mode 100644 index 000000000..cc4dba29d --- /dev/null +++ b/node_modules/isarray/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/node_modules/isarray/Makefile b/node_modules/isarray/Makefile new file mode 100644 index 000000000..787d56e1e --- /dev/null +++ b/node_modules/isarray/Makefile @@ -0,0 +1,6 @@ + +test: + @node_modules/.bin/tape test.js + +.PHONY: test + diff --git a/node_modules/isarray/README.md b/node_modules/isarray/README.md new file mode 100644 index 000000000..16d2c59c6 --- /dev/null +++ b/node_modules/isarray/README.md @@ -0,0 +1,60 @@ + +# isarray + +`Array#isArray` for older browsers. + +[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray) +[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray) + +[![browser support](https://ci.testling.com/juliangruber/isarray.png) +](https://ci.testling.com/juliangruber/isarray) + +## Usage + +```js +var isArray = require('isarray'); + +console.log(isArray([])); // => true +console.log(isArray({})); // => false +``` + +## Installation + +With [npm](http://npmjs.org) do + +```bash +$ npm install isarray +``` + +Then bundle for the browser with +[browserify](https://github.com/substack/browserify). + +With [component](http://component.io) do + +```bash +$ component install juliangruber/isarray +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/isarray/component.json b/node_modules/isarray/component.json new file mode 100644 index 000000000..9e31b6838 --- /dev/null +++ b/node_modules/isarray/component.json @@ -0,0 +1,19 @@ +{ + "name" : "isarray", + "description" : "Array#isArray for older browsers", + "version" : "0.0.1", + "repository" : "juliangruber/isarray", + "homepage": "https://github.com/juliangruber/isarray", + "main" : "index.js", + "scripts" : [ + "index.js" + ], + "dependencies" : {}, + "keywords": ["browser","isarray","array"], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT" +} diff --git a/node_modules/isarray/index.js b/node_modules/isarray/index.js new file mode 100644 index 000000000..a57f63495 --- /dev/null +++ b/node_modules/isarray/index.js @@ -0,0 +1,5 @@ +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; diff --git a/node_modules/isarray/package.json b/node_modules/isarray/package.json new file mode 100644 index 000000000..1741d1912 --- /dev/null +++ b/node_modules/isarray/package.json @@ -0,0 +1,75 @@ +{ + "_from": "isarray@~1.0.0", + "_id": "isarray@1.0.0", + "_inBundle": false, + "_integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "_location": "/isarray", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "isarray@~1.0.0", + "name": "isarray", + "escapedName": "isarray", + "rawSpec": "~1.0.0", + "saveSpec": null, + "fetchSpec": "~1.0.0" + }, + "_requiredBy": [ + "/isobject", + "/readable-stream", + "/unset-value/has-value/isobject" + ], + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "_shasum": "bb935d48582cba168c06834957a54a3e07124f11", + "_spec": "isarray@~1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readable-stream", + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/isarray/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Array#isArray for older browsers", + "devDependencies": { + "tape": "~2.13.4" + }, + "homepage": "https://github.com/juliangruber/isarray", + "keywords": [ + "browser", + "isarray", + "array" + ], + "license": "MIT", + "main": "index.js", + "name": "isarray", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/isarray.git" + }, + "scripts": { + "test": "tape test.js" + }, + "testling": { + "files": "test.js", + "browsers": [ + "ie/8..latest", + "firefox/17..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "1.0.0" +} diff --git a/node_modules/isarray/test.js b/node_modules/isarray/test.js new file mode 100644 index 000000000..e0c3444d8 --- /dev/null +++ b/node_modules/isarray/test.js @@ -0,0 +1,20 @@ +var isArray = require('./'); +var test = require('tape'); + +test('is array', function(t){ + t.ok(isArray([])); + t.notOk(isArray({})); + t.notOk(isArray(null)); + t.notOk(isArray(false)); + + var obj = {}; + obj[0] = true; + t.notOk(isArray(obj)); + + var arr = []; + arr.foo = 'bar'; + t.ok(isArray(arr)); + + t.end(); +}); + diff --git a/node_modules/isexe/.npmignore b/node_modules/isexe/.npmignore new file mode 100644 index 000000000..c1cb757ac --- /dev/null +++ b/node_modules/isexe/.npmignore @@ -0,0 +1,2 @@ +.nyc_output/ +coverage/ diff --git a/node_modules/isexe/LICENSE b/node_modules/isexe/LICENSE new file mode 100644 index 000000000..19129e315 --- /dev/null +++ b/node_modules/isexe/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/isexe/README.md b/node_modules/isexe/README.md new file mode 100644 index 000000000..35769e844 --- /dev/null +++ b/node_modules/isexe/README.md @@ -0,0 +1,51 @@ +# isexe + +Minimal module to check if a file is executable, and a normal file. + +Uses `fs.stat` and tests against the `PATHEXT` environment variable on +Windows. + +## USAGE + +```javascript +var isexe = require('isexe') +isexe('some-file-name', function (err, isExe) { + if (err) { + console.error('probably file does not exist or something', err) + } else if (isExe) { + console.error('this thing can be run') + } else { + console.error('cannot be run') + } +}) + +// same thing but synchronous, throws errors +var isExe = isexe.sync('some-file-name') + +// treat errors as just "not executable" +isexe('maybe-missing-file', { ignoreErrors: true }, callback) +var isExe = isexe.sync('maybe-missing-file', { ignoreErrors: true }) +``` + +## API + +### `isexe(path, [options], [callback])` + +Check if the path is executable. If no callback provided, and a +global `Promise` object is available, then a Promise will be returned. + +Will raise whatever errors may be raised by `fs.stat`, unless +`options.ignoreErrors` is set to true. + +### `isexe.sync(path, [options])` + +Same as `isexe` but returns the value and throws any errors raised. + +### Options + +* `ignoreErrors` Treat all errors as "no, this is not executable", but + don't raise them. +* `uid` Number to use as the user id +* `gid` Number to use as the group id +* `pathExt` List of path extensions to use instead of `PATHEXT` + environment variable on Windows. diff --git a/node_modules/isexe/index.js b/node_modules/isexe/index.js new file mode 100644 index 000000000..553fb32b1 --- /dev/null +++ b/node_modules/isexe/index.js @@ -0,0 +1,57 @@ +var fs = require('fs') +var core +if (process.platform === 'win32' || global.TESTING_WINDOWS) { + core = require('./windows.js') +} else { + core = require('./mode.js') +} + +module.exports = isexe +isexe.sync = sync + +function isexe (path, options, cb) { + if (typeof options === 'function') { + cb = options + options = {} + } + + if (!cb) { + if (typeof Promise !== 'function') { + throw new TypeError('callback not provided') + } + + return new Promise(function (resolve, reject) { + isexe(path, options || {}, function (er, is) { + if (er) { + reject(er) + } else { + resolve(is) + } + }) + }) + } + + core(path, options || {}, function (er, is) { + // ignore EACCES because that just means we aren't allowed to run it + if (er) { + if (er.code === 'EACCES' || options && options.ignoreErrors) { + er = null + is = false + } + } + cb(er, is) + }) +} + +function sync (path, options) { + // my kingdom for a filtered catch + try { + return core.sync(path, options || {}) + } catch (er) { + if (options && options.ignoreErrors || er.code === 'EACCES') { + return false + } else { + throw er + } + } +} diff --git a/node_modules/isexe/mode.js b/node_modules/isexe/mode.js new file mode 100644 index 000000000..1995ea4a0 --- /dev/null +++ b/node_modules/isexe/mode.js @@ -0,0 +1,41 @@ +module.exports = isexe +isexe.sync = sync + +var fs = require('fs') + +function isexe (path, options, cb) { + fs.stat(path, function (er, stat) { + cb(er, er ? false : checkStat(stat, options)) + }) +} + +function sync (path, options) { + return checkStat(fs.statSync(path), options) +} + +function checkStat (stat, options) { + return stat.isFile() && checkMode(stat, options) +} + +function checkMode (stat, options) { + var mod = stat.mode + var uid = stat.uid + var gid = stat.gid + + var myUid = options.uid !== undefined ? + options.uid : process.getuid && process.getuid() + var myGid = options.gid !== undefined ? + options.gid : process.getgid && process.getgid() + + var u = parseInt('100', 8) + var g = parseInt('010', 8) + var o = parseInt('001', 8) + var ug = u | g + + var ret = (mod & o) || + (mod & g) && gid === myGid || + (mod & u) && uid === myUid || + (mod & ug) && myUid === 0 + + return ret +} diff --git a/node_modules/isexe/package.json b/node_modules/isexe/package.json new file mode 100644 index 000000000..2e8db5bcc --- /dev/null +++ b/node_modules/isexe/package.json @@ -0,0 +1,60 @@ +{ + "_from": "isexe@^2.0.0", + "_id": "isexe@2.0.0", + "_inBundle": false, + "_integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "_location": "/isexe", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "isexe@^2.0.0", + "name": "isexe", + "escapedName": "isexe", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/which" + ], + "_resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "_shasum": "e8fbf374dc556ff8947a10dcb0572d633f2cfa10", + "_spec": "isexe@^2.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/which", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/isexe/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Minimal module to check if a file is executable.", + "devDependencies": { + "mkdirp": "^0.5.1", + "rimraf": "^2.5.0", + "tap": "^10.3.0" + }, + "directories": { + "test": "test" + }, + "homepage": "https://github.com/isaacs/isexe#readme", + "keywords": [], + "license": "ISC", + "main": "index.js", + "name": "isexe", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/isexe.git" + }, + "scripts": { + "postpublish": "git push origin --all; git push origin --tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "tap test/*.js --100" + }, + "version": "2.0.0" +} diff --git a/node_modules/isexe/test/basic.js b/node_modules/isexe/test/basic.js new file mode 100644 index 000000000..d926df64b --- /dev/null +++ b/node_modules/isexe/test/basic.js @@ -0,0 +1,221 @@ +var t = require('tap') +var fs = require('fs') +var path = require('path') +var fixture = path.resolve(__dirname, 'fixtures') +var meow = fixture + '/meow.cat' +var mine = fixture + '/mine.cat' +var ours = fixture + '/ours.cat' +var fail = fixture + '/fail.false' +var noent = fixture + '/enoent.exe' +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') + +var isWindows = process.platform === 'win32' +var hasAccess = typeof fs.access === 'function' +var winSkip = isWindows && 'windows' +var accessSkip = !hasAccess && 'no fs.access function' +var hasPromise = typeof Promise === 'function' +var promiseSkip = !hasPromise && 'no global Promise' + +function reset () { + delete require.cache[require.resolve('../')] + return require('../') +} + +t.test('setup fixtures', function (t) { + rimraf.sync(fixture) + mkdirp.sync(fixture) + fs.writeFileSync(meow, '#!/usr/bin/env cat\nmeow\n') + fs.chmodSync(meow, parseInt('0755', 8)) + fs.writeFileSync(fail, '#!/usr/bin/env false\n') + fs.chmodSync(fail, parseInt('0644', 8)) + fs.writeFileSync(mine, '#!/usr/bin/env cat\nmine\n') + fs.chmodSync(mine, parseInt('0744', 8)) + fs.writeFileSync(ours, '#!/usr/bin/env cat\nours\n') + fs.chmodSync(ours, parseInt('0754', 8)) + t.end() +}) + +t.test('promise', { skip: promiseSkip }, function (t) { + var isexe = reset() + t.test('meow async', function (t) { + isexe(meow).then(function (is) { + t.ok(is) + t.end() + }) + }) + t.test('fail async', function (t) { + isexe(fail).then(function (is) { + t.notOk(is) + t.end() + }) + }) + t.test('noent async', function (t) { + isexe(noent).catch(function (er) { + t.ok(er) + t.end() + }) + }) + t.test('noent ignore async', function (t) { + isexe(noent, { ignoreErrors: true }).then(function (is) { + t.notOk(is) + t.end() + }) + }) + t.end() +}) + +t.test('no promise', function (t) { + global.Promise = null + var isexe = reset() + t.throws('try to meow a promise', function () { + isexe(meow) + }) + t.end() +}) + +t.test('access', { skip: accessSkip || winSkip }, function (t) { + runTest(t) +}) + +t.test('mode', { skip: winSkip }, function (t) { + delete fs.access + delete fs.accessSync + var isexe = reset() + t.ok(isexe.sync(ours, { uid: 0, gid: 0 })) + t.ok(isexe.sync(mine, { uid: 0, gid: 0 })) + runTest(t) +}) + +t.test('windows', function (t) { + global.TESTING_WINDOWS = true + var pathExt = '.EXE;.CAT;.CMD;.COM' + t.test('pathExt option', function (t) { + runTest(t, { pathExt: '.EXE;.CAT;.CMD;.COM' }) + }) + t.test('pathExt env', function (t) { + process.env.PATHEXT = pathExt + runTest(t) + }) + t.test('no pathExt', function (t) { + // with a pathExt of '', any filename is fine. + // so the "fail" one would still pass. + runTest(t, { pathExt: '', skipFail: true }) + }) + t.test('pathext with empty entry', function (t) { + // with a pathExt of '', any filename is fine. + // so the "fail" one would still pass. + runTest(t, { pathExt: ';' + pathExt, skipFail: true }) + }) + t.end() +}) + +t.test('cleanup', function (t) { + rimraf.sync(fixture) + t.end() +}) + +function runTest (t, options) { + var isexe = reset() + + var optionsIgnore = Object.create(options || {}) + optionsIgnore.ignoreErrors = true + + if (!options || !options.skipFail) { + t.notOk(isexe.sync(fail, options)) + } + t.notOk(isexe.sync(noent, optionsIgnore)) + if (!options) { + t.ok(isexe.sync(meow)) + } else { + t.ok(isexe.sync(meow, options)) + } + + t.ok(isexe.sync(mine, options)) + t.ok(isexe.sync(ours, options)) + t.throws(function () { + isexe.sync(noent, options) + }) + + t.test('meow async', function (t) { + if (!options) { + isexe(meow, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + } else { + isexe(meow, options, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + } + }) + + t.test('mine async', function (t) { + isexe(mine, options, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + }) + + t.test('ours async', function (t) { + isexe(ours, options, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + }) + + if (!options || !options.skipFail) { + t.test('fail async', function (t) { + isexe(fail, options, function (er, is) { + if (er) { + throw er + } + t.notOk(is) + t.end() + }) + }) + } + + t.test('noent async', function (t) { + isexe(noent, options, function (er, is) { + t.ok(er) + t.notOk(is) + t.end() + }) + }) + + t.test('noent ignore async', function (t) { + isexe(noent, optionsIgnore, function (er, is) { + if (er) { + throw er + } + t.notOk(is) + t.end() + }) + }) + + t.test('directory is not executable', function (t) { + isexe(__dirname, options, function (er, is) { + if (er) { + throw er + } + t.notOk(is) + t.end() + }) + }) + + t.end() +} diff --git a/node_modules/isexe/windows.js b/node_modules/isexe/windows.js new file mode 100644 index 000000000..34996734d --- /dev/null +++ b/node_modules/isexe/windows.js @@ -0,0 +1,42 @@ +module.exports = isexe +isexe.sync = sync + +var fs = require('fs') + +function checkPathExt (path, options) { + var pathext = options.pathExt !== undefined ? + options.pathExt : process.env.PATHEXT + + if (!pathext) { + return true + } + + pathext = pathext.split(';') + if (pathext.indexOf('') !== -1) { + return true + } + for (var i = 0; i < pathext.length; i++) { + var p = pathext[i].toLowerCase() + if (p && path.substr(-p.length).toLowerCase() === p) { + return true + } + } + return false +} + +function checkStat (stat, path, options) { + if (!stat.isSymbolicLink() && !stat.isFile()) { + return false + } + return checkPathExt(path, options) +} + +function isexe (path, options, cb) { + fs.stat(path, function (er, stat) { + cb(er, er ? false : checkStat(stat, path, options)) + }) +} + +function sync (path, options) { + return checkStat(fs.statSync(path), path, options) +} diff --git a/node_modules/isobject/LICENSE b/node_modules/isobject/LICENSE new file mode 100644 index 000000000..39245ac1c --- /dev/null +++ b/node_modules/isobject/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/isobject/README.md b/node_modules/isobject/README.md new file mode 100644 index 000000000..9dd897aa0 --- /dev/null +++ b/node_modules/isobject/README.md @@ -0,0 +1,112 @@ +# isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat)](https://travis-ci.org/jonschlinkert/isobject) + +Returns true if the value is an object and not an array or null. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install isobject --save +``` + +Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install isobject +``` + +Install with [bower](http://bower.io/) + +```sh +$ bower install isobject +``` + +## Usage + +```js +var isObject = require('isobject'); +``` + +**True** + +All of the following return `true`: + +```js +isObject({}); +isObject(Object.create({})); +isObject(Object.create(Object.prototype)); +isObject(Object.create(null)); +isObject({}); +isObject(new Foo); +isObject(/foo/); +``` + +**False** + +All of the following return `false`: + +```js +isObject(); +isObject(function () {}); +isObject(1); +isObject([]); +isObject(undefined); +isObject(null); +``` + +## Related projects + +You might also be interested in these projects: + +[merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep) + +* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow) +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object) +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of) + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/isobject/issues/new). + +## Building docs + +Generate readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install verb && npm run docs +``` + +Or, if [verb](https://github.com/verbose/verb) is installed globally: + +```sh +$ verb +``` + +## Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +## Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/isobject/blob/master/LICENSE). + +*** + +_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on April 25, 2016._ \ No newline at end of file diff --git a/node_modules/isobject/index.js b/node_modules/isobject/index.js new file mode 100644 index 000000000..aa0dce0bb --- /dev/null +++ b/node_modules/isobject/index.js @@ -0,0 +1,14 @@ +/*! + * isobject + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var isArray = require('isarray'); + +module.exports = function isObject(val) { + return val != null && typeof val === 'object' && isArray(val) === false; +}; diff --git a/node_modules/isobject/package.json b/node_modules/isobject/package.json new file mode 100644 index 000000000..a7dbc40e2 --- /dev/null +++ b/node_modules/isobject/package.json @@ -0,0 +1,98 @@ +{ + "_from": "isobject@^2.0.0", + "_id": "isobject@2.1.0", + "_inBundle": false, + "_integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "_location": "/isobject", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "isobject@^2.0.0", + "name": "isobject", + "escapedName": "isobject", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/fill-range" + ], + "_resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "_shasum": "f065561096a3f1da2ef46272f815c840d87e0c89", + "_spec": "isobject@^2.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/fill-range", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/isobject/issues" + }, + "bundleDependencies": false, + "dependencies": { + "isarray": "1.0.0" + }, + "deprecated": false, + "description": "Returns true if the value is an object and not an array or null.", + "devDependencies": { + "gulp-format-md": "^0.1.9", + "mocha": "^2.4.5" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/isobject", + "keywords": [ + "check", + "is", + "is-object", + "isobject", + "kind", + "kind-of", + "kindof", + "native", + "object", + "type", + "typeof", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "isobject", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/isobject.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "merge-deep", + "extend-shallow", + "is-plain-object", + "kind-of" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb" + ] + }, + "version": "2.1.0" +} diff --git a/node_modules/json-stable-stringify/.travis.yml b/node_modules/json-stable-stringify/.travis.yml new file mode 100644 index 000000000..cc4dba29d --- /dev/null +++ b/node_modules/json-stable-stringify/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/node_modules/json-stable-stringify/LICENSE b/node_modules/json-stable-stringify/LICENSE new file mode 100644 index 000000000..ee27ba4b4 --- /dev/null +++ b/node_modules/json-stable-stringify/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/json-stable-stringify/example/key_cmp.js b/node_modules/json-stable-stringify/example/key_cmp.js new file mode 100644 index 000000000..d5f66752d --- /dev/null +++ b/node_modules/json-stable-stringify/example/key_cmp.js @@ -0,0 +1,7 @@ +var stringify = require('../'); + +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +var s = stringify(obj, function (a, b) { + return a.key < b.key ? 1 : -1; +}); +console.log(s); diff --git a/node_modules/json-stable-stringify/example/nested.js b/node_modules/json-stable-stringify/example/nested.js new file mode 100644 index 000000000..9a672fc65 --- /dev/null +++ b/node_modules/json-stable-stringify/example/nested.js @@ -0,0 +1,3 @@ +var stringify = require('../'); +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +console.log(stringify(obj)); diff --git a/node_modules/json-stable-stringify/example/str.js b/node_modules/json-stable-stringify/example/str.js new file mode 100644 index 000000000..9b4b3cd28 --- /dev/null +++ b/node_modules/json-stable-stringify/example/str.js @@ -0,0 +1,3 @@ +var stringify = require('../'); +var obj = { c: 6, b: [4,5], a: 3 }; +console.log(stringify(obj)); diff --git a/node_modules/json-stable-stringify/example/value_cmp.js b/node_modules/json-stable-stringify/example/value_cmp.js new file mode 100644 index 000000000..09f1c5f79 --- /dev/null +++ b/node_modules/json-stable-stringify/example/value_cmp.js @@ -0,0 +1,7 @@ +var stringify = require('../'); + +var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; +var s = stringify(obj, function (a, b) { + return a.value < b.value ? 1 : -1; +}); +console.log(s); diff --git a/node_modules/json-stable-stringify/index.js b/node_modules/json-stable-stringify/index.js new file mode 100644 index 000000000..1d609bf59 --- /dev/null +++ b/node_modules/json-stable-stringify/index.js @@ -0,0 +1,50 @@ +var json = typeof JSON !== 'undefined' ? JSON : require('jsonify'); + +module.exports = function (obj, opts) { + if (!opts) opts = {}; + if (typeof opts === 'function') opts = { cmp: opts }; + var cmp = opts.cmp && (function (f) { + return function (node) { + return function (a, b) { + var aobj = { key: a, value: node[a] }; + var bobj = { key: b, value: node[b] }; + return f(aobj, bobj); + }; + }; + })(opts.cmp); + + return (function stringify (node) { + if (typeof node !== 'object' || node === null) { + return json.stringify(node); + } + if (isArray(node)) { + var out = []; + for (var i = 0; i < node.length; i++) { + out.push(stringify(node[i])); + } + return '[' + out.join(',') + ']'; + } + else { + var keys = objectKeys(node).sort(cmp && cmp(node)); + var out = []; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + out.push(stringify(key) + ':' + stringify(node[key])); + } + return '{' + out.join(',') + '}'; + } + })(obj); +}; + +var isArray = Array.isArray || function (x) { + return {}.toString.call(x) === '[object Array]'; +}; + +var objectKeys = Object.keys || function (obj) { + var has = Object.prototype.hasOwnProperty || function () { return true }; + var keys = []; + for (var key in obj) { + if (has.call(obj, key)) keys.push(key); + } + return keys; +}; diff --git a/node_modules/json-stable-stringify/package.json b/node_modules/json-stable-stringify/package.json new file mode 100644 index 000000000..8ae5d4cff --- /dev/null +++ b/node_modules/json-stable-stringify/package.json @@ -0,0 +1,74 @@ +{ + "_from": "json-stable-stringify@~0.0.0", + "_id": "json-stable-stringify@0.0.1", + "_inBundle": false, + "_integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=", + "_location": "/json-stable-stringify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "json-stable-stringify@~0.0.0", + "name": "json-stable-stringify", + "escapedName": "json-stable-stringify", + "rawSpec": "~0.0.0", + "saveSpec": null, + "fetchSpec": "~0.0.0" + }, + "_requiredBy": [ + "/shasum" + ], + "_resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", + "_shasum": "611c23e814db375527df851193db59dd2af27f45", + "_spec": "json-stable-stringify@~0.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/shasum", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/json-stable-stringify/issues" + }, + "bundleDependencies": false, + "dependencies": { + "jsonify": "~0.0.0" + }, + "deprecated": false, + "description": "deterministic JSON.stringify() with custom sorting to get deterministic hashes from stringified results", + "devDependencies": { + "tape": "~1.0.4" + }, + "homepage": "https://github.com/substack/json-stable-stringify", + "keywords": [ + "json", + "stringify", + "deterministic", + "hash", + "sort", + "stable" + ], + "license": "MIT", + "main": "index.js", + "name": "json-stable-stringify", + "repository": { + "type": "git", + "url": "git://github.com/substack/json-stable-stringify.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "ff/5", + "ff/latest", + "chrome/15", + "chrome/latest", + "safari/latest", + "opera/latest" + ] + }, + "version": "0.0.1" +} diff --git a/node_modules/json-stable-stringify/readme.markdown b/node_modules/json-stable-stringify/readme.markdown new file mode 100644 index 000000000..3a3d00c7e --- /dev/null +++ b/node_modules/json-stable-stringify/readme.markdown @@ -0,0 +1,90 @@ +# json-stable-stringify + +deterministic version of `JSON.stringify()` so you can get a consistent hash +from stringified results + +You can also pass in a custom comparison function. + +[![browser support](https://ci.testling.com/substack/json-stable-stringify.png)](https://ci.testling.com/substack/json-stable-stringify) + +[![build status](https://secure.travis-ci.org/substack/json-stable-stringify.png)](http://travis-ci.org/substack/json-stable-stringify) + +# example + +``` js +var stringify = require('json-stable-stringify'); +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +console.log(stringify(obj)); +``` + +output: + +``` +{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8} +``` + +# methods + +``` js +var stringify = require('json-stable-stringify') +``` + +## var str = stringify(obj, opts) + +Return a deterministic stringified string `str` from the object `obj`. + +If `opts` is given, you can supply an `opts.cmp` to have a custom comparison +function for object keys. Your function `opts.cmp` is called with these +parameters: + +``` js +opts.cmp({ key: akey, value: avalue }, { key: bkey, value: bvalue }) +``` + +For example, to sort on the object key names in reverse order you could write: + +``` js +var stringify = require('json-stable-stringify'); + +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +var s = stringify(obj, function (a, b) { + return a.key < b.key ? 1 : -1; +}); +console.log(s); +``` + +which results in the output string: + +``` +{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3} +``` + +Or if you wanted to sort on the object values in reverse order, you could write: + +``` +var stringify = require('json-stable-stringify'); + +var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; +var s = stringify(obj, function (a, b) { + return a.value < b.value ? 1 : -1; +}); +console.log(s); +``` + +which outputs: + +``` +{"d":6,"c":5,"b":[{"z":3,"y":2,"x":1},9],"a":10} +``` + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install json-stable-stringify +``` + +# license + +MIT diff --git a/node_modules/json-stable-stringify/test/cmp.js b/node_modules/json-stable-stringify/test/cmp.js new file mode 100644 index 000000000..2dbb39355 --- /dev/null +++ b/node_modules/json-stable-stringify/test/cmp.js @@ -0,0 +1,11 @@ +var test = require('tape'); +var stringify = require('../'); + +test('custom comparison function', function (t) { + t.plan(1); + var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; + var s = stringify(obj, function (a, b) { + return a.key < b.key ? 1 : -1; + }); + t.equal(s, '{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3}'); +}); diff --git a/node_modules/json-stable-stringify/test/nested.js b/node_modules/json-stable-stringify/test/nested.js new file mode 100644 index 000000000..43459f2b8 --- /dev/null +++ b/node_modules/json-stable-stringify/test/nested.js @@ -0,0 +1,8 @@ +var test = require('tape'); +var stringify = require('../'); + +test('nested', function (t) { + t.plan(1); + var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; + t.equal(stringify(obj), '{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8}'); +}); diff --git a/node_modules/json-stable-stringify/test/str.js b/node_modules/json-stable-stringify/test/str.js new file mode 100644 index 000000000..d0e915937 --- /dev/null +++ b/node_modules/json-stable-stringify/test/str.js @@ -0,0 +1,8 @@ +var test = require('tape'); +var stringify = require('../'); + +test('simple object', function (t) { + t.plan(1); + var obj = { c: 6, b: [4,5], a: 3, z: null }; + t.equal(stringify(obj), '{"a":3,"b":[4,5],"c":6,"z":null}'); +}); diff --git a/node_modules/json-stringify-safe/.npmignore b/node_modules/json-stringify-safe/.npmignore new file mode 100644 index 000000000..17d6b3677 --- /dev/null +++ b/node_modules/json-stringify-safe/.npmignore @@ -0,0 +1 @@ +/*.tgz diff --git a/node_modules/json-stringify-safe/CHANGELOG.md b/node_modules/json-stringify-safe/CHANGELOG.md new file mode 100644 index 000000000..42bcb60af --- /dev/null +++ b/node_modules/json-stringify-safe/CHANGELOG.md @@ -0,0 +1,14 @@ +## Unreleased +- Fixes stringify to only take ancestors into account when checking + circularity. + It previously assumed every visited object was circular which led to [false + positives][issue9]. + Uses the tiny serializer I wrote for [Must.js][must] a year and a half ago. +- Fixes calling the `replacer` function in the proper context (`thisArg`). +- Fixes calling the `cycleReplacer` function in the proper context (`thisArg`). +- Speeds serializing by a factor of + Big-O(h-my-god-it-linearly-searched-every-object) it had ever seen. Searching + only the ancestors for a circular references speeds up things considerably. + +[must]: https://github.com/moll/js-must +[issue9]: https://github.com/isaacs/json-stringify-safe/issues/9 diff --git a/node_modules/json-stringify-safe/LICENSE b/node_modules/json-stringify-safe/LICENSE new file mode 100644 index 000000000..19129e315 --- /dev/null +++ b/node_modules/json-stringify-safe/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/json-stringify-safe/Makefile b/node_modules/json-stringify-safe/Makefile new file mode 100644 index 000000000..36088c723 --- /dev/null +++ b/node_modules/json-stringify-safe/Makefile @@ -0,0 +1,35 @@ +NODE_OPTS = +TEST_OPTS = + +love: + @echo "Feel like makin' love." + +test: + @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R dot $(TEST_OPTS) + +spec: + @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R spec $(TEST_OPTS) + +autotest: + @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R dot --watch $(TEST_OPTS) + +autospec: + @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R spec --watch $(TEST_OPTS) + +pack: + @file=$$(npm pack); echo "$$file"; tar tf "$$file" + +publish: + npm publish + +tag: + git tag "v$$(node -e 'console.log(require("./package").version)')" + +clean: + rm -f *.tgz + npm prune --production + +.PHONY: love +.PHONY: test spec autotest autospec +.PHONY: pack publish tag +.PHONY: clean diff --git a/node_modules/json-stringify-safe/README.md b/node_modules/json-stringify-safe/README.md new file mode 100644 index 000000000..a11f302a3 --- /dev/null +++ b/node_modules/json-stringify-safe/README.md @@ -0,0 +1,52 @@ +# json-stringify-safe + +Like JSON.stringify, but doesn't throw on circular references. + +## Usage + +Takes the same arguments as `JSON.stringify`. + +```javascript +var stringify = require('json-stringify-safe'); +var circularObj = {}; +circularObj.circularRef = circularObj; +circularObj.list = [ circularObj, circularObj ]; +console.log(stringify(circularObj, null, 2)); +``` + +Output: + +```json +{ + "circularRef": "[Circular]", + "list": [ + "[Circular]", + "[Circular]" + ] +} +``` + +## Details + +``` +stringify(obj, serializer, indent, decycler) +``` + +The first three arguments are the same as to JSON.stringify. The last +is an argument that's only used when the object has been seen already. + +The default `decycler` function returns the string `'[Circular]'`. +If, for example, you pass in `function(k,v){}` (return nothing) then it +will prune cycles. If you pass in `function(k,v){ return {foo: 'bar'}}`, +then cyclical objects will always be represented as `{"foo":"bar"}` in +the result. + +``` +stringify.getSerialize(serializer, decycler) +``` + +Returns a serializer that can be used elsewhere. This is the actual +function that's passed to JSON.stringify. + +**Note** that the function returned from `getSerialize` is stateful for now, so +do **not** use it more than once. diff --git a/node_modules/json-stringify-safe/package.json b/node_modules/json-stringify-safe/package.json new file mode 100644 index 000000000..ba8123f65 --- /dev/null +++ b/node_modules/json-stringify-safe/package.json @@ -0,0 +1,66 @@ +{ + "_from": "json-stringify-safe@>=5.0.0 <5.1.0-0", + "_id": "json-stringify-safe@5.0.1", + "_inBundle": false, + "_integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "_location": "/json-stringify-safe", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "json-stringify-safe@>=5.0.0 <5.1.0-0", + "name": "json-stringify-safe", + "escapedName": "json-stringify-safe", + "rawSpec": ">=5.0.0 <5.1.0-0", + "saveSpec": null, + "fetchSpec": ">=5.0.0 <5.1.0-0" + }, + "_requiredBy": [ + "/bole" + ], + "_resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "_shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb", + "_spec": "json-stringify-safe@>=5.0.0 <5.1.0-0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/bole", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "bugs": { + "url": "https://github.com/isaacs/json-stringify-safe/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Andri Möll", + "email": "andri@dot.ee", + "url": "http://themoll.com" + } + ], + "deprecated": false, + "description": "Like JSON.stringify, but doesn't blow up on circular refs.", + "devDependencies": { + "mocha": ">= 2.1.0 < 3", + "must": ">= 0.12 < 0.13", + "sinon": ">= 1.12.2 < 2" + }, + "homepage": "https://github.com/isaacs/json-stringify-safe", + "keywords": [ + "json", + "stringify", + "circular", + "safe" + ], + "license": "ISC", + "main": "stringify.js", + "name": "json-stringify-safe", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/json-stringify-safe.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "5.0.1" +} diff --git a/node_modules/json-stringify-safe/stringify.js b/node_modules/json-stringify-safe/stringify.js new file mode 100644 index 000000000..124a45218 --- /dev/null +++ b/node_modules/json-stringify-safe/stringify.js @@ -0,0 +1,27 @@ +exports = module.exports = stringify +exports.getSerialize = serializer + +function stringify(obj, replacer, spaces, cycleReplacer) { + return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces) +} + +function serializer(replacer, cycleReplacer) { + var stack = [], keys = [] + + if (cycleReplacer == null) cycleReplacer = function(key, value) { + if (stack[0] === value) return "[Circular ~]" + return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]" + } + + return function(key, value) { + if (stack.length > 0) { + var thisPos = stack.indexOf(this) + ~thisPos ? stack.splice(thisPos + 1) : stack.push(this) + ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key) + if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value) + } + else stack.push(value) + + return replacer == null ? value : replacer.call(this, key, value) + } +} diff --git a/node_modules/json-stringify-safe/test/mocha.opts b/node_modules/json-stringify-safe/test/mocha.opts new file mode 100644 index 000000000..2544e5861 --- /dev/null +++ b/node_modules/json-stringify-safe/test/mocha.opts @@ -0,0 +1,2 @@ +--recursive +--require must diff --git a/node_modules/json-stringify-safe/test/stringify_test.js b/node_modules/json-stringify-safe/test/stringify_test.js new file mode 100644 index 000000000..5b3258317 --- /dev/null +++ b/node_modules/json-stringify-safe/test/stringify_test.js @@ -0,0 +1,246 @@ +var Sinon = require("sinon") +var stringify = require("..") +function jsonify(obj) { return JSON.stringify(obj, null, 2) } + +describe("Stringify", function() { + it("must stringify circular objects", function() { + var obj = {name: "Alice"} + obj.self = obj + var json = stringify(obj, null, 2) + json.must.eql(jsonify({name: "Alice", self: "[Circular ~]"})) + }) + + it("must stringify circular objects with intermediaries", function() { + var obj = {name: "Alice"} + obj.identity = {self: obj} + var json = stringify(obj, null, 2) + json.must.eql(jsonify({name: "Alice", identity: {self: "[Circular ~]"}})) + }) + + it("must stringify circular objects deeper", function() { + var obj = {name: "Alice", child: {name: "Bob"}} + obj.child.self = obj.child + + stringify(obj, null, 2).must.eql(jsonify({ + name: "Alice", + child: {name: "Bob", self: "[Circular ~.child]"} + })) + }) + + it("must stringify circular objects deeper with intermediaries", function() { + var obj = {name: "Alice", child: {name: "Bob"}} + obj.child.identity = {self: obj.child} + + stringify(obj, null, 2).must.eql(jsonify({ + name: "Alice", + child: {name: "Bob", identity: {self: "[Circular ~.child]"}} + })) + }) + + it("must stringify circular objects in an array", function() { + var obj = {name: "Alice"} + obj.self = [obj, obj] + + stringify(obj, null, 2).must.eql(jsonify({ + name: "Alice", self: ["[Circular ~]", "[Circular ~]"] + })) + }) + + it("must stringify circular objects deeper in an array", function() { + var obj = {name: "Alice", children: [{name: "Bob"}, {name: "Eve"}]} + obj.children[0].self = obj.children[0] + obj.children[1].self = obj.children[1] + + stringify(obj, null, 2).must.eql(jsonify({ + name: "Alice", + children: [ + {name: "Bob", self: "[Circular ~.children.0]"}, + {name: "Eve", self: "[Circular ~.children.1]"} + ] + })) + }) + + it("must stringify circular arrays", function() { + var obj = [] + obj.push(obj) + obj.push(obj) + var json = stringify(obj, null, 2) + json.must.eql(jsonify(["[Circular ~]", "[Circular ~]"])) + }) + + it("must stringify circular arrays with intermediaries", function() { + var obj = [] + obj.push({name: "Alice", self: obj}) + obj.push({name: "Bob", self: obj}) + + stringify(obj, null, 2).must.eql(jsonify([ + {name: "Alice", self: "[Circular ~]"}, + {name: "Bob", self: "[Circular ~]"} + ])) + }) + + it("must stringify repeated objects in objects", function() { + var obj = {} + var alice = {name: "Alice"} + obj.alice1 = alice + obj.alice2 = alice + + stringify(obj, null, 2).must.eql(jsonify({ + alice1: {name: "Alice"}, + alice2: {name: "Alice"} + })) + }) + + it("must stringify repeated objects in arrays", function() { + var alice = {name: "Alice"} + var obj = [alice, alice] + var json = stringify(obj, null, 2) + json.must.eql(jsonify([{name: "Alice"}, {name: "Alice"}])) + }) + + it("must call given decycler and use its output", function() { + var obj = {} + obj.a = obj + obj.b = obj + + var decycle = Sinon.spy(function() { return decycle.callCount }) + var json = stringify(obj, null, 2, decycle) + json.must.eql(jsonify({a: 1, b: 2}, null, 2)) + + decycle.callCount.must.equal(2) + decycle.thisValues[0].must.equal(obj) + decycle.args[0][0].must.equal("a") + decycle.args[0][1].must.equal(obj) + decycle.thisValues[1].must.equal(obj) + decycle.args[1][0].must.equal("b") + decycle.args[1][1].must.equal(obj) + }) + + it("must call replacer and use its output", function() { + var obj = {name: "Alice", child: {name: "Bob"}} + + var replacer = Sinon.spy(bangString) + var json = stringify(obj, replacer, 2) + json.must.eql(jsonify({name: "Alice!", child: {name: "Bob!"}})) + + replacer.callCount.must.equal(4) + replacer.args[0][0].must.equal("") + replacer.args[0][1].must.equal(obj) + replacer.thisValues[1].must.equal(obj) + replacer.args[1][0].must.equal("name") + replacer.args[1][1].must.equal("Alice") + replacer.thisValues[2].must.equal(obj) + replacer.args[2][0].must.equal("child") + replacer.args[2][1].must.equal(obj.child) + replacer.thisValues[3].must.equal(obj.child) + replacer.args[3][0].must.equal("name") + replacer.args[3][1].must.equal("Bob") + }) + + it("must call replacer after describing circular references", function() { + var obj = {name: "Alice"} + obj.self = obj + + var replacer = Sinon.spy(bangString) + var json = stringify(obj, replacer, 2) + json.must.eql(jsonify({name: "Alice!", self: "[Circular ~]!"})) + + replacer.callCount.must.equal(3) + replacer.args[0][0].must.equal("") + replacer.args[0][1].must.equal(obj) + replacer.thisValues[1].must.equal(obj) + replacer.args[1][0].must.equal("name") + replacer.args[1][1].must.equal("Alice") + replacer.thisValues[2].must.equal(obj) + replacer.args[2][0].must.equal("self") + replacer.args[2][1].must.equal("[Circular ~]") + }) + + it("must call given decycler and use its output for nested objects", + function() { + var obj = {} + obj.a = obj + obj.b = {self: obj} + + var decycle = Sinon.spy(function() { return decycle.callCount }) + var json = stringify(obj, null, 2, decycle) + json.must.eql(jsonify({a: 1, b: {self: 2}})) + + decycle.callCount.must.equal(2) + decycle.args[0][0].must.equal("a") + decycle.args[0][1].must.equal(obj) + decycle.args[1][0].must.equal("self") + decycle.args[1][1].must.equal(obj) + }) + + it("must use decycler's output when it returned null", function() { + var obj = {a: "b"} + obj.self = obj + obj.selves = [obj, obj] + + function decycle() { return null } + stringify(obj, null, 2, decycle).must.eql(jsonify({ + a: "b", + self: null, + selves: [null, null] + })) + }) + + it("must use decycler's output when it returned undefined", function() { + var obj = {a: "b"} + obj.self = obj + obj.selves = [obj, obj] + + function decycle() {} + stringify(obj, null, 2, decycle).must.eql(jsonify({ + a: "b", + selves: [null, null] + })) + }) + + it("must throw given a decycler that returns a cycle", function() { + var obj = {} + obj.self = obj + var err + function identity(key, value) { return value } + try { stringify(obj, null, 2, identity) } catch (ex) { err = ex } + err.must.be.an.instanceof(TypeError) + }) + + describe(".getSerialize", function() { + it("must stringify circular objects", function() { + var obj = {a: "b"} + obj.circularRef = obj + obj.list = [obj, obj] + + var json = JSON.stringify(obj, stringify.getSerialize(), 2) + json.must.eql(jsonify({ + "a": "b", + "circularRef": "[Circular ~]", + "list": ["[Circular ~]", "[Circular ~]"] + })) + }) + + // This is the behavior as of Mar 3, 2015. + // The serializer function keeps state inside the returned function and + // so far I'm not sure how to not do that. JSON.stringify's replacer is not + // called _after_ serialization. + xit("must return a function that could be called twice", function() { + var obj = {name: "Alice"} + obj.self = obj + + var json + var serializer = stringify.getSerialize() + + json = JSON.stringify(obj, serializer, 2) + json.must.eql(jsonify({name: "Alice", self: "[Circular ~]"})) + + json = JSON.stringify(obj, serializer, 2) + json.must.eql(jsonify({name: "Alice", self: "[Circular ~]"})) + }) + }) +}) + +function bangString(key, value) { + return typeof value == "string" ? value + "!" : value +} diff --git a/node_modules/jsonify/README.markdown b/node_modules/jsonify/README.markdown new file mode 100644 index 000000000..71d9a93b5 --- /dev/null +++ b/node_modules/jsonify/README.markdown @@ -0,0 +1,34 @@ +jsonify +======= + +This module provides Douglas Crockford's JSON implementation without modifying +any globals. + +`stringify` and `parse` are merely exported without respect to whether or not a +global `JSON` object exists. + +methods +======= + +var json = require('jsonify'); + +json.parse(source, reviver) +--------------------------- + +Return a new javascript object from a parse of the `source` string. + +If a `reviver` function is specified, walk the structure passing each name/value +pair to `reviver.call(parent, key, value)` to transform the `value` before +parsing it. + +json.stringify(value, replacer, space) +-------------------------------------- + +Return a string representation for `value`. + +If `replacer` is specified, walk the structure passing each name/value pair to +`replacer.call(parent, key, value)` to transform the `value` before stringifying +it. + +If `space` is a number, indent the result by that many spaces. +If `space` is a string, use `space` as the indentation. diff --git a/node_modules/jsonify/index.js b/node_modules/jsonify/index.js new file mode 100644 index 000000000..f728a1605 --- /dev/null +++ b/node_modules/jsonify/index.js @@ -0,0 +1,2 @@ +exports.parse = require('./lib/parse'); +exports.stringify = require('./lib/stringify'); diff --git a/node_modules/jsonify/lib/parse.js b/node_modules/jsonify/lib/parse.js new file mode 100644 index 000000000..30e2f0143 --- /dev/null +++ b/node_modules/jsonify/lib/parse.js @@ -0,0 +1,273 @@ +var at, // The index of the current character + ch, // The current character + escapee = { + '"': '"', + '\\': '\\', + '/': '/', + b: '\b', + f: '\f', + n: '\n', + r: '\r', + t: '\t' + }, + text, + + error = function (m) { + // Call error when something is wrong. + throw { + name: 'SyntaxError', + message: m, + at: at, + text: text + }; + }, + + next = function (c) { + // If a c parameter is provided, verify that it matches the current character. + if (c && c !== ch) { + error("Expected '" + c + "' instead of '" + ch + "'"); + } + + // Get the next character. When there are no more characters, + // return the empty string. + + ch = text.charAt(at); + at += 1; + return ch; + }, + + number = function () { + // Parse a number value. + var number, + string = ''; + + if (ch === '-') { + string = '-'; + next('-'); + } + 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(); + } + } + number = +string; + if (!isFinite(number)) { + error("Bad number"); + } else { + return number; + } + }, + + string = function () { + // Parse a string value. + var hex, + i, + string = '', + uffff; + + // When parsing for string values, we must look for " and \ characters. + if (ch === '"') { + while (next()) { + if (ch === '"') { + 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 (typeof escapee[ch] === 'string') { + string += escapee[ch]; + } else { + break; + } + } else { + string += ch; + } + } + } + error("Bad string"); + }, + + white = function () { + +// Skip whitespace. + + while (ch && ch <= ' ') { + next(); + } + }, + + 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; + } + error("Unexpected '" + ch + "'"); + }, + + value, // Place holder for the value function. + + array = function () { + +// Parse an array value. + + var array = []; + + if (ch === '[') { + next('['); + white(); + if (ch === ']') { + next(']'); + return array; // empty array + } + while (ch) { + array.push(value()); + white(); + if (ch === ']') { + next(']'); + return array; + } + next(','); + white(); + } + } + error("Bad array"); + }, + + object = function () { + +// Parse an object value. + + var key, + object = {}; + + if (ch === '{') { + next('{'); + white(); + if (ch === '}') { + next('}'); + return object; // empty object + } + while (ch) { + key = string(); + white(); + next(':'); + if (Object.hasOwnProperty.call(object, key)) { + error('Duplicate key "' + key + '"'); + } + object[key] = value(); + white(); + 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 '"': + return string(); + 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. + +module.exports = function (source, reviver) { + var result; + + text = source; + at = 0; + 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; +}; diff --git a/node_modules/jsonify/lib/stringify.js b/node_modules/jsonify/lib/stringify.js new file mode 100644 index 000000000..134587081 --- /dev/null +++ b/node_modules/jsonify/lib/stringify.js @@ -0,0 +1,154 @@ +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, + gap, + indent, + meta = { // table of character substitutions + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '"' : '\\"', + '\\': '\\\\' + }, + rep; + +function quote(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 + '"'; +} + +function str(key, holder) { + // Produce a string from holder[key]. + var i, // The loop counter. + k, // The member key. + v, // The member value. + length, + mind = gap, + partial, + value = holder[key]; + + // If the value has a toJSON method, call it to obtain a replacement value. + if (value && typeof value === 'object' && + typeof value.toJSON === 'function') { + value = value.toJSON(key); + } + + // If we were called with a replacer function, then call the replacer to + // obtain a replacement value. + if (typeof rep === 'function') { + value = rep.call(holder, key, value); + } + + // What happens next depends on the value's type. + switch (typeof value) { + case 'string': + return quote(value); + + case 'number': + // JSON numbers must be finite. Encode non-finite numbers as null. + return isFinite(value) ? String(value) : 'null'; + + case 'boolean': + case 'null': + // If the value is a boolean or null, convert it to a string. Note: + // typeof null does not produce 'null'. The case is included here in + // the remote chance that this gets fixed someday. + return String(value); + + case 'object': + if (!value) return 'null'; + gap += indent; + partial = []; + + // Array.isArray + if (Object.prototype.toString.apply(value) === '[object Array]') { + length = value.length; + for (i = 0; i < length; i += 1) { + partial[i] = str(i, value) || 'null'; + } + + // Join all of the elements together, separated with commas, and + // wrap them in brackets. + v = partial.length === 0 ? '[]' : gap ? + '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : + '[' + partial.join(',') + ']'; + gap = mind; + return v; + } + + // If the replacer is an array, use it to select the members to be + // stringified. + if (rep && typeof rep === 'object') { + length = rep.length; + for (i = 0; i < length; i += 1) { + k = rep[i]; + if (typeof k === 'string') { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + else { + // Otherwise, iterate through all of the keys in the object. + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + + // Join all of the member texts together, separated with commas, + // and wrap them in braces. + + v = partial.length === 0 ? '{}' : gap ? + '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : + '{' + partial.join(',') + '}'; + gap = mind; + return v; + } +} + +module.exports = function (value, replacer, space) { + var i; + gap = ''; + indent = ''; + + // If the space parameter is a number, make an indent string containing that + // many spaces. + if (typeof space === 'number') { + for (i = 0; i < space; i += 1) { + indent += ' '; + } + } + // If the space parameter is a string, it will be used as the indent string. + else if (typeof space === 'string') { + indent = space; + } + + // If there is a replacer, it must be a function or an array. + // Otherwise, throw an error. + rep = replacer; + if (replacer && typeof replacer !== 'function' + && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) { + throw new Error('JSON.stringify'); + } + + // Make a fake root object containing our value under the key of ''. + // Return the result of stringifying the value. + return str('', {'': value}); +}; diff --git a/node_modules/jsonify/package.json b/node_modules/jsonify/package.json new file mode 100644 index 000000000..c9e9f5646 --- /dev/null +++ b/node_modules/jsonify/package.json @@ -0,0 +1,63 @@ +{ + "_from": "jsonify@~0.0.0", + "_id": "jsonify@0.0.0", + "_inBundle": false, + "_integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "_location": "/jsonify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "jsonify@~0.0.0", + "name": "jsonify", + "escapedName": "jsonify", + "rawSpec": "~0.0.0", + "saveSpec": null, + "fetchSpec": "~0.0.0" + }, + "_requiredBy": [ + "/json-stable-stringify", + "/shell-quote" + ], + "_resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "_shasum": "2c74b6ee41d93ca51b7b5aaee8f503631d252a73", + "_spec": "jsonify@~0.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/json-stable-stringify", + "author": { + "name": "Douglas Crockford", + "url": "http://crockford.com/" + }, + "bugs": { + "url": "https://github.com/substack/jsonify/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "JSON without touching any globals", + "devDependencies": { + "garbage": "0.0.x", + "tap": "0.0.x" + }, + "directories": { + "lib": ".", + "test": "test" + }, + "engines": { + "node": "*" + }, + "homepage": "https://github.com/substack/jsonify#readme", + "keywords": [ + "json", + "browser" + ], + "license": "Public Domain", + "main": "index.js", + "name": "jsonify", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/substack/jsonify.git" + }, + "scripts": { + "test": "tap test" + }, + "version": "0.0.0" +} diff --git a/node_modules/jsonify/test/parse.js b/node_modules/jsonify/test/parse.js new file mode 100644 index 000000000..e2313f55a --- /dev/null +++ b/node_modules/jsonify/test/parse.js @@ -0,0 +1,16 @@ +var test = require('tap').test; +var json = require('../'); +var garbage = require('garbage'); + +test('parse', function (t) { + for (var i = 0; i < 50; i++) { + var s = JSON.stringify(garbage(50)); + + t.deepEqual( + json.parse(s), + JSON.parse(s) + ); + } + + t.end(); +}); diff --git a/node_modules/jsonify/test/stringify.js b/node_modules/jsonify/test/stringify.js new file mode 100644 index 000000000..89b0b6703 --- /dev/null +++ b/node_modules/jsonify/test/stringify.js @@ -0,0 +1,15 @@ +var test = require('tap').test; +var json = require('../'); +var garbage = require('garbage'); + +test('stringify', function (t) { + for (var i = 0; i < 50; i++) { + var obj = garbage(50); + t.equal( + json.stringify(obj), + JSON.stringify(obj) + ); + } + + t.end(); +}); diff --git a/node_modules/jsonparse/.npmignore b/node_modules/jsonparse/.npmignore new file mode 100644 index 000000000..b512c09d4 --- /dev/null +++ b/node_modules/jsonparse/.npmignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/node_modules/jsonparse/LICENSE b/node_modules/jsonparse/LICENSE new file mode 100644 index 000000000..6dc24be5e --- /dev/null +++ b/node_modules/jsonparse/LICENSE @@ -0,0 +1,24 @@ +The MIT License + +Copyright (c) 2012 Tim Caswell + +Permission is hereby granted, free of charge, +to any person obtaining a copy of this software and +associated documentation files (the "Software"), to +deal in the Software without restriction, including +without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom +the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/jsonparse/README.markdown b/node_modules/jsonparse/README.markdown new file mode 100644 index 000000000..0f405d359 --- /dev/null +++ b/node_modules/jsonparse/README.markdown @@ -0,0 +1,11 @@ +This is a streaming JSON parser. For a simpler, sax-based version see this gist: https://gist.github.com/1821394 + +The MIT License (MIT) +Copyright (c) 2011-2012 Tim Caswell + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/jsonparse/bench.js b/node_modules/jsonparse/bench.js new file mode 100644 index 000000000..b36d92f7e --- /dev/null +++ b/node_modules/jsonparse/bench.js @@ -0,0 +1,26 @@ +var fs = require('fs'), + Parser = require('./jsonparse'); + + +var json = fs.readFileSync("samplejson/basic.json"); + + +while (true) { + var start = Date.now(); + for (var i = 0; i < 1000; i++) { + JSON.parse(json); + } + var first = Date.now() - start; + + start = Date.now(); + var p = new Parser(); + for (var i = 0; i < 1000; i++) { + p.write(json); + } + var second = Date.now() - start; + + + console.log("JSON.parse took %s", first); + console.log("streaming parser took %s", second); + console.log("streaming is %s times slower", second / first); +} diff --git a/node_modules/jsonparse/examples/twitterfeed.js b/node_modules/jsonparse/examples/twitterfeed.js new file mode 100644 index 000000000..10210d470 --- /dev/null +++ b/node_modules/jsonparse/examples/twitterfeed.js @@ -0,0 +1,30 @@ +var Parser = require('../jsonparse'); +var Http = require('http'); +require('./colors'); +var p = new Parser(); +var cred = require('./credentials'); +var client = Http.createClient(80, "stream.twitter.com"); +var request = client.request("GET", "/1/statuses/sample.json", { + "Host": "stream.twitter.com", + "Authorization": (new Buffer(cred.username + ":" + cred.password)).toString("base64") +}); +request.on('response', function (response) { + console.log(response.statusCode); + console.dir(response.headers); + response.on('data', function (chunk) { + p.write(chunk); + }); + response.on('end', function () { + console.log("END"); + }); +}); +request.end(); +var text = "", name = ""; +p.onValue = function (value) { + if (this.stack.length === 1 && this.key === 'text') { text = value; } + if (this.stack.length === 2 && this.key === 'name' && this.stack[1].key === 'user') { name = value; } + if (this.stack.length === 0) { + console.log(text.blue + " - " + name.yellow); + text = name = ""; + } +}; diff --git a/node_modules/jsonparse/jsonparse.js b/node_modules/jsonparse/jsonparse.js new file mode 100644 index 000000000..39910608b --- /dev/null +++ b/node_modules/jsonparse/jsonparse.js @@ -0,0 +1,413 @@ +/*global Buffer*/ +// Named constants with unique integer values +var C = {}; +// Tokens +var LEFT_BRACE = C.LEFT_BRACE = 0x1; +var RIGHT_BRACE = C.RIGHT_BRACE = 0x2; +var LEFT_BRACKET = C.LEFT_BRACKET = 0x3; +var RIGHT_BRACKET = C.RIGHT_BRACKET = 0x4; +var COLON = C.COLON = 0x5; +var COMMA = C.COMMA = 0x6; +var TRUE = C.TRUE = 0x7; +var FALSE = C.FALSE = 0x8; +var NULL = C.NULL = 0x9; +var STRING = C.STRING = 0xa; +var NUMBER = C.NUMBER = 0xb; +// Tokenizer States +var START = C.START = 0x11; +var STOP = C.STOP = 0x12; +var TRUE1 = C.TRUE1 = 0x21; +var TRUE2 = C.TRUE2 = 0x22; +var TRUE3 = C.TRUE3 = 0x23; +var FALSE1 = C.FALSE1 = 0x31; +var FALSE2 = C.FALSE2 = 0x32; +var FALSE3 = C.FALSE3 = 0x33; +var FALSE4 = C.FALSE4 = 0x34; +var NULL1 = C.NULL1 = 0x41; +var NULL2 = C.NULL2 = 0x42; +var NULL3 = C.NULL3 = 0x43; +var NUMBER1 = C.NUMBER1 = 0x51; +var NUMBER3 = C.NUMBER3 = 0x53; +var STRING1 = C.STRING1 = 0x61; +var STRING2 = C.STRING2 = 0x62; +var STRING3 = C.STRING3 = 0x63; +var STRING4 = C.STRING4 = 0x64; +var STRING5 = C.STRING5 = 0x65; +var STRING6 = C.STRING6 = 0x66; +// Parser States +var VALUE = C.VALUE = 0x71; +var KEY = C.KEY = 0x72; +// Parser Modes +var OBJECT = C.OBJECT = 0x81; +var ARRAY = C.ARRAY = 0x82; +// Character constants +var BACK_SLASH = "\\".charCodeAt(0); +var FORWARD_SLASH = "\/".charCodeAt(0); +var BACKSPACE = "\b".charCodeAt(0); +var FORM_FEED = "\f".charCodeAt(0); +var NEWLINE = "\n".charCodeAt(0); +var CARRIAGE_RETURN = "\r".charCodeAt(0); +var TAB = "\t".charCodeAt(0); + +var STRING_BUFFER_SIZE = 64 * 1024; + +function Parser() { + this.tState = START; + this.value = undefined; + + this.string = undefined; // string data + this.stringBuffer = Buffer.alloc ? Buffer.alloc(STRING_BUFFER_SIZE) : new Buffer(STRING_BUFFER_SIZE); + this.stringBufferOffset = 0; + this.unicode = undefined; // unicode escapes + this.highSurrogate = undefined; + + this.key = undefined; + this.mode = undefined; + this.stack = []; + this.state = VALUE; + this.bytes_remaining = 0; // number of bytes remaining in multi byte utf8 char to read after split boundary + this.bytes_in_sequence = 0; // bytes in multi byte utf8 char to read + this.temp_buffs = { "2": new Buffer(2), "3": new Buffer(3), "4": new Buffer(4) }; // for rebuilding chars split before boundary is reached + + // Stream offset + this.offset = -1; +} + +// Slow code to string converter (only used when throwing syntax errors) +Parser.toknam = function (code) { + var keys = Object.keys(C); + for (var i = 0, l = keys.length; i < l; i++) { + var key = keys[i]; + if (C[key] === code) { return key; } + } + return code && ("0x" + code.toString(16)); +}; + +var proto = Parser.prototype; +proto.onError = function (err) { throw err; }; +proto.charError = function (buffer, i) { + this.tState = STOP; + this.onError(new Error("Unexpected " + JSON.stringify(String.fromCharCode(buffer[i])) + " at position " + i + " in state " + Parser.toknam(this.tState))); +}; +proto.appendStringChar = function (char) { + if (this.stringBufferOffset >= STRING_BUFFER_SIZE) { + this.string += this.stringBuffer.toString('utf8'); + this.stringBufferOffset = 0; + } + + this.stringBuffer[this.stringBufferOffset++] = char; +}; +proto.appendStringBuf = function (buf, start, end) { + var size = buf.length; + if (typeof start === 'number') { + if (typeof end === 'number') { + if (end < 0) { + // adding a negative end decreeses the size + size = buf.length - start + end; + } else { + size = end - start; + } + } else { + size = buf.length - start; + } + } + + if (size < 0) { + size = 0; + } + + if (this.stringBufferOffset + size > STRING_BUFFER_SIZE) { + this.string += this.stringBuffer.toString('utf8', 0, this.stringBufferOffset); + this.stringBufferOffset = 0; + } + + buf.copy(this.stringBuffer, this.stringBufferOffset, start, end); + this.stringBufferOffset += size; +}; +proto.write = function (buffer) { + if (typeof buffer === "string") buffer = new Buffer(buffer); + var n; + for (var i = 0, l = buffer.length; i < l; i++) { + if (this.tState === START){ + n = buffer[i]; + this.offset++; + if(n === 0x7b){ this.onToken(LEFT_BRACE, "{"); // { + }else if(n === 0x7d){ this.onToken(RIGHT_BRACE, "}"); // } + }else if(n === 0x5b){ this.onToken(LEFT_BRACKET, "["); // [ + }else if(n === 0x5d){ this.onToken(RIGHT_BRACKET, "]"); // ] + }else if(n === 0x3a){ this.onToken(COLON, ":"); // : + }else if(n === 0x2c){ this.onToken(COMMA, ","); // , + }else if(n === 0x74){ this.tState = TRUE1; // t + }else if(n === 0x66){ this.tState = FALSE1; // f + }else if(n === 0x6e){ this.tState = NULL1; // n + }else if(n === 0x22){ // " + this.string = ""; + this.stringBufferOffset = 0; + this.tState = STRING1; + }else if(n === 0x2d){ this.string = "-"; this.tState = NUMBER1; // - + }else{ + if (n >= 0x30 && n < 0x40) { // 1-9 + this.string = String.fromCharCode(n); this.tState = NUMBER3; + } else if (n === 0x20 || n === 0x09 || n === 0x0a || n === 0x0d) { + // whitespace + } else { + return this.charError(buffer, i); + } + } + }else if (this.tState === STRING1){ // After open quote + n = buffer[i]; // get current byte from buffer + // check for carry over of a multi byte char split between data chunks + // & fill temp buffer it with start of this data chunk up to the boundary limit set in the last iteration + if (this.bytes_remaining > 0) { + for (var j = 0; j < this.bytes_remaining; j++) { + this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence - this.bytes_remaining + j] = buffer[j]; + } + + this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]); + this.bytes_in_sequence = this.bytes_remaining = 0; + i = i + j - 1; + } else if (this.bytes_remaining === 0 && n >= 128) { // else if no remainder bytes carried over, parse multi byte (>=128) chars one at a time + if (n <= 193 || n > 244) { + return this.onError(new Error("Invalid UTF-8 character at position " + i + " in state " + Parser.toknam(this.tState))); + } + if ((n >= 194) && (n <= 223)) this.bytes_in_sequence = 2; + if ((n >= 224) && (n <= 239)) this.bytes_in_sequence = 3; + if ((n >= 240) && (n <= 244)) this.bytes_in_sequence = 4; + if ((this.bytes_in_sequence + i) > buffer.length) { // if bytes needed to complete char fall outside buffer length, we have a boundary split + for (var k = 0; k <= (buffer.length - 1 - i); k++) { + this.temp_buffs[this.bytes_in_sequence][k] = buffer[i + k]; // fill temp buffer of correct size with bytes available in this chunk + } + this.bytes_remaining = (i + this.bytes_in_sequence) - buffer.length; + i = buffer.length - 1; + } else { + this.appendStringBuf(buffer, i, i + this.bytes_in_sequence); + i = i + this.bytes_in_sequence - 1; + } + } else if (n === 0x22) { + this.tState = START; + this.string += this.stringBuffer.toString('utf8', 0, this.stringBufferOffset); + this.stringBufferOffset = 0; + this.onToken(STRING, this.string); + this.offset += Buffer.byteLength(this.string, 'utf8') + 1; + this.string = undefined; + } + else if (n === 0x5c) { + this.tState = STRING2; + } + else if (n >= 0x20) { this.appendStringChar(n); } + else { + return this.charError(buffer, i); + } + }else if (this.tState === STRING2){ // After backslash + n = buffer[i]; + if(n === 0x22){ this.appendStringChar(n); this.tState = STRING1; + }else if(n === 0x5c){ this.appendStringChar(BACK_SLASH); this.tState = STRING1; + }else if(n === 0x2f){ this.appendStringChar(FORWARD_SLASH); this.tState = STRING1; + }else if(n === 0x62){ this.appendStringChar(BACKSPACE); this.tState = STRING1; + }else if(n === 0x66){ this.appendStringChar(FORM_FEED); this.tState = STRING1; + }else if(n === 0x6e){ this.appendStringChar(NEWLINE); this.tState = STRING1; + }else if(n === 0x72){ this.appendStringChar(CARRIAGE_RETURN); this.tState = STRING1; + }else if(n === 0x74){ this.appendStringChar(TAB); this.tState = STRING1; + }else if(n === 0x75){ this.unicode = ""; this.tState = STRING3; + }else{ + return this.charError(buffer, i); + } + }else if (this.tState === STRING3 || this.tState === STRING4 || this.tState === STRING5 || this.tState === STRING6){ // unicode hex codes + n = buffer[i]; + // 0-9 A-F a-f + if ((n >= 0x30 && n < 0x40) || (n > 0x40 && n <= 0x46) || (n > 0x60 && n <= 0x66)) { + this.unicode += String.fromCharCode(n); + if (this.tState++ === STRING6) { + var intVal = parseInt(this.unicode, 16); + this.unicode = undefined; + if (this.highSurrogate !== undefined && intVal >= 0xDC00 && intVal < (0xDFFF + 1)) { //<56320,57343> - lowSurrogate + this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate, intVal))); + this.highSurrogate = undefined; + } else if (this.highSurrogate === undefined && intVal >= 0xD800 && intVal < (0xDBFF + 1)) { //<55296,56319> - highSurrogate + this.highSurrogate = intVal; + } else { + if (this.highSurrogate !== undefined) { + this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate))); + this.highSurrogate = undefined; + } + this.appendStringBuf(new Buffer(String.fromCharCode(intVal))); + } + this.tState = STRING1; + } + } else { + return this.charError(buffer, i); + } + } else if (this.tState === NUMBER1 || this.tState === NUMBER3) { + n = buffer[i]; + + switch (n) { + case 0x30: // 0 + case 0x31: // 1 + case 0x32: // 2 + case 0x33: // 3 + case 0x34: // 4 + case 0x35: // 5 + case 0x36: // 6 + case 0x37: // 7 + case 0x38: // 8 + case 0x39: // 9 + case 0x2e: // . + case 0x65: // e + case 0x45: // E + case 0x2b: // + + case 0x2d: // - + this.string += String.fromCharCode(n); + this.tState = NUMBER3; + break; + default: + this.tState = START; + var result = Number(this.string); + + if (isNaN(result)){ + return this.charError(buffer, i); + } + + if ((this.string.match(/[0-9]+/) == this.string) && (result.toString() != this.string)) { + // Long string of digits which is an ID string and not valid and/or safe JavaScript integer Number + this.onToken(STRING, this.string); + } else { + this.onToken(NUMBER, result); + } + + this.offset += this.string.length - 1; + this.string = undefined; + i--; + break; + } + }else if (this.tState === TRUE1){ // r + if (buffer[i] === 0x72) { this.tState = TRUE2; } + else { return this.charError(buffer, i); } + }else if (this.tState === TRUE2){ // u + if (buffer[i] === 0x75) { this.tState = TRUE3; } + else { return this.charError(buffer, i); } + }else if (this.tState === TRUE3){ // e + if (buffer[i] === 0x65) { this.tState = START; this.onToken(TRUE, true); this.offset+= 3; } + else { return this.charError(buffer, i); } + }else if (this.tState === FALSE1){ // a + if (buffer[i] === 0x61) { this.tState = FALSE2; } + else { return this.charError(buffer, i); } + }else if (this.tState === FALSE2){ // l + if (buffer[i] === 0x6c) { this.tState = FALSE3; } + else { return this.charError(buffer, i); } + }else if (this.tState === FALSE3){ // s + if (buffer[i] === 0x73) { this.tState = FALSE4; } + else { return this.charError(buffer, i); } + }else if (this.tState === FALSE4){ // e + if (buffer[i] === 0x65) { this.tState = START; this.onToken(FALSE, false); this.offset+= 4; } + else { return this.charError(buffer, i); } + }else if (this.tState === NULL1){ // u + if (buffer[i] === 0x75) { this.tState = NULL2; } + else { return this.charError(buffer, i); } + }else if (this.tState === NULL2){ // l + if (buffer[i] === 0x6c) { this.tState = NULL3; } + else { return this.charError(buffer, i); } + }else if (this.tState === NULL3){ // l + if (buffer[i] === 0x6c) { this.tState = START; this.onToken(NULL, null); this.offset += 3; } + else { return this.charError(buffer, i); } + } + } +}; +proto.onToken = function (token, value) { + // Override this to get events +}; + +proto.parseError = function (token, value) { + this.tState = STOP; + this.onError(new Error("Unexpected " + Parser.toknam(token) + (value ? ("(" + JSON.stringify(value) + ")") : "") + " in state " + Parser.toknam(this.state))); +}; +proto.push = function () { + this.stack.push({value: this.value, key: this.key, mode: this.mode}); +}; +proto.pop = function () { + var value = this.value; + var parent = this.stack.pop(); + this.value = parent.value; + this.key = parent.key; + this.mode = parent.mode; + this.emit(value); + if (!this.mode) { this.state = VALUE; } +}; +proto.emit = function (value) { + if (this.mode) { this.state = COMMA; } + this.onValue(value); +}; +proto.onValue = function (value) { + // Override me +}; +proto.onToken = function (token, value) { + if(this.state === VALUE){ + if(token === STRING || token === NUMBER || token === TRUE || token === FALSE || token === NULL){ + if (this.value) { + this.value[this.key] = value; + } + this.emit(value); + }else if(token === LEFT_BRACE){ + this.push(); + if (this.value) { + this.value = this.value[this.key] = {}; + } else { + this.value = {}; + } + this.key = undefined; + this.state = KEY; + this.mode = OBJECT; + }else if(token === LEFT_BRACKET){ + this.push(); + if (this.value) { + this.value = this.value[this.key] = []; + } else { + this.value = []; + } + this.key = 0; + this.mode = ARRAY; + this.state = VALUE; + }else if(token === RIGHT_BRACE){ + if (this.mode === OBJECT) { + this.pop(); + } else { + return this.parseError(token, value); + } + }else if(token === RIGHT_BRACKET){ + if (this.mode === ARRAY) { + this.pop(); + } else { + return this.parseError(token, value); + } + }else{ + return this.parseError(token, value); + } + }else if(this.state === KEY){ + if (token === STRING) { + this.key = value; + this.state = COLON; + } else if (token === RIGHT_BRACE) { + this.pop(); + } else { + return this.parseError(token, value); + } + }else if(this.state === COLON){ + if (token === COLON) { this.state = VALUE; } + else { return this.parseError(token, value); } + }else if(this.state === COMMA){ + if (token === COMMA) { + if (this.mode === ARRAY) { this.key++; this.state = VALUE; } + else if (this.mode === OBJECT) { this.state = KEY; } + + } else if (token === RIGHT_BRACKET && this.mode === ARRAY || token === RIGHT_BRACE && this.mode === OBJECT) { + this.pop(); + } else { + return this.parseError(token, value); + } + }else{ + return this.parseError(token, value); + } +}; + +Parser.C = C; + +module.exports = Parser; diff --git a/node_modules/jsonparse/package.json b/node_modules/jsonparse/package.json new file mode 100644 index 000000000..1a30cda77 --- /dev/null +++ b/node_modules/jsonparse/package.json @@ -0,0 +1,58 @@ +{ + "_from": "jsonparse@^1.2.0", + "_id": "jsonparse@1.3.1", + "_inBundle": false, + "_integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "_location": "/jsonparse", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "jsonparse@^1.2.0", + "name": "jsonparse", + "escapedName": "jsonparse", + "rawSpec": "^1.2.0", + "saveSpec": null, + "fetchSpec": "^1.2.0" + }, + "_requiredBy": [ + "/JSONStream" + ], + "_resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "_shasum": "3f4dae4a91fac315f71062f8521cc239f1366280", + "_spec": "jsonparse@^1.2.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/JSONStream", + "author": { + "name": "Tim Caswell", + "email": "tim@creationix.com" + }, + "bugs": { + "url": "http://github.com/creationix/jsonparse/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "This is a pure-js JSON streaming parser for node.js", + "devDependencies": { + "tap": "~0.3.3", + "tape": "~0.1.1" + }, + "engines": [ + "node >= 0.2.0" + ], + "homepage": "https://github.com/creationix/jsonparse#readme", + "license": "MIT", + "main": "jsonparse.js", + "name": "jsonparse", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/creationix/jsonparse.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "tags": [ + "json", + "stream" + ], + "version": "1.3.1" +} diff --git a/node_modules/jsonparse/samplejson/basic.json b/node_modules/jsonparse/samplejson/basic.json new file mode 100644 index 000000000..950dff9e9 --- /dev/null +++ b/node_modules/jsonparse/samplejson/basic.json @@ -0,0 +1,167 @@ +[ + { + }, + { + "image": [ + {"shape": "rect", "fill": "#333", "stroke": "#999", "x": 0.5e+1, "y": 0.5, "z": 0.8e-0, "w": 0.5e5, "u": 2E10, "foo": 2E+1, "bar": 2E-0, "width": 47, "height": 47} + ], + "jumpable": 3, + "solid": { + "1": [2,4], + "2": [], + "3": [2,6], + "4": [], + "5": [2,8,1,3,7,9,4,6], + "6": [], + "7": [4,8], + "8": [], + "9": [6,8] + }, + "corners": {"1": true,"3": true,"7": true,"9": true} + }, + { + "image": [ + {"shape": "polygon", "fill": "#248", "stroke": "#48f", "points": [[0.5,47.5],[47.5,47.5],[47.5,0.5]]} + ], + "solid": { + "1": [2,4], + "2": [1], + "3": [2], + "4": [], + "5": [2,8,1,3,7,9,4,6], + "6": [], + "7": [4,8], + "8": [], + "9": [6,8] + }, + "corners": {"1": true,"3": true,"7": false,"9": true} + }, + { + "image": [ + {"shape": "polygon", "fill": "#248", "stroke": "#48f", "points": [[0.5,0.5],[47.5,47.5],[0.5,47.5]]} + ], + "solid": { + "1": [2], + "2": [3], + "3": [2,6], + "4": [], + "5": [2,8,1,3,7,9,4,6], + "6": [], + "7": [4,8], + "8": [], + "9": [6,8] + }, + "corners": {"1": true,"3": true,"7": true,"9": false} + }, + { + "image": [ + {"shape": "polygon", "fill": "#333", "stroke": "#999", "points": [[0.5,0.5],[47.5,47.5],[47.5,0.5]]} + ], + "jumpable": 3, + "solid": { + "1": [2,4], + "2": [], + "3": [2,6], + "4": [], + "5": [2,8,1,3,7,9,4,6], + "6": [3], + "7": [4,8], + "8": [7], + "9": [6,8] + }, + "corners": {"1": false,"3": true,"7": true,"9": true} + }, + { + "image": [ + {"shape": "polygon", "fill": "#333", "stroke": "#999", "points": [[0.5,0.5],[0.5,47.5],[47.5,0.5]]} + ], + "jumpable": 3, + "solid": { + "1": [2,4], + "2": [], + "3": [2,6], + "4": [1], + "5": [2,8,1,3,7,9,4,6], + "6": [], + "7": [4,8], + "8": [9], + "9": [6,8] + }, + "corners": {"1": true,"3": false,"7": true,"9": true} + }, + { + "image": [ + {"shape": "polygon", "fill": "#482", "stroke": "#8f4", "points": [[0.5,47.5],[0.5,23.5],[24.5,23.5],[24.5,0.5],[47.5,0.5],[47.5,47.5]]} + ], + "jumpable": 3, + "solid": { + "1": [2,4], + "2": [], + "3": [6,2], + "4": [], + "5": [2,8,1,3,7,9,4,6], + "6": [9], + "7": [4,8], + "8": [], + "9": [6,8] + }, + "corners": {"1": true,"3": true,"7": false,"9": true} + }, + { + "image": [ + {"shape": "polygon", "fill": "#482", "stroke": "#8f4", "points": [[0.5,0.5],[23.5,0.5],[23.5,24.5],[47.5,24.5],[47.5,47.5],[0.5,47.5]]} + ], + "jumpable": 3, + "solid": { + "1": [4,2], + "2": [], + "3": [2,6], + "4": [7], + "5": [2,8,1,3,7,9,4,6], + "6": [], + "7": [4,8], + "8": [], + "9": [6,8] + }, + "corners": {"1": true,"3": true,"7": true,"9": false} + }, + { + "image": [ + {"shape": "circle", "fill": "#ff0", "stroke": "#ff8", "cx": 24, "cy": 24, "r": 18} + ], + "item": true + }, + { + "image": [ + {"shape": "polygon", "fill": "#842", "stroke": "#f84", "points": [[4.5,0.5],[14.5,0.5],[14.5,17.5],[34,17.5],[33.5,0.5],[43.5,0.5],[43.5,47.5],[33.5,47.5],[33.5,30.5],[14.5,30.5],[14.5,47.5],[4.5,47.5]]} + ], + "jumpable": 3 + }, + { + "image": [ + {"shape": "polygon", "fill": "#333", "stroke": "#999", "points": [[0.5,0.5],[47.5,0.5],[24,47.5]]} + ], + "jumpable": 3, + "solid": { + "1": [2,4], + "2": [], + "3": [2,6], + "4": [1], + "5": [2,8,1,3,7,9,4,6], + "6": [3], + "7": [4,8], + "8": [], + "9": [6,8] + }, + "corners": {"1": false,"3": false,"7": true,"9": true} + }, + { + "image": [ + {"shape": "rect", "fill": "#114acb", "x": 0.5, "y": 0.5, "width": 47, "height": 47}, + {"shape": "polygon", "fill": "rgba(255,255,255,0.30)", "points": [[0.5,0.5],[47.5,0.5],[40,8],[8,8],[8,40],[0.5,47.5]]}, + {"shape": "polygon", "fill": "rgba(0,0,0,0.30)", "points": [[47.5,0.5],[48,48],[0.5,47.5],[8,40],[40,40],[40,8]]}, + {"shape": "polygon", "fill": "rgb(255,255,0)", "stroke": "rgba(255,255,0,0.5)", "points": [[24,9],[35,20],[26,29],[26,33],[22,33],[22,27],[29,20],[24,15],[16,23],[13,20]]}, + {"shape": "rect", "fill": "rgb(255,255,0)", "stroke": "rgba(255,255,0,0.5)", "x": 22, "y":35, "width": 4, "height": 4} + ] + } +] diff --git a/node_modules/jsonparse/samplejson/basic2.json b/node_modules/jsonparse/samplejson/basic2.json new file mode 100644 index 000000000..3a6919b2e --- /dev/null +++ b/node_modules/jsonparse/samplejson/basic2.json @@ -0,0 +1,180 @@ +[ + { + }, + { + "image": [ + {"shape": "rect", "fill": "#333", "stroke": "#999", "x": 0.5, "y": 0.5, "width": 47, "height": 47} + ], + "jumpable": 3, + "solid": { + "1": [2,4], + "2": [], + "3": [2,6], + "4": [], + "5": [2,8,1,3,7,9,4,6], + "6": [], + "7": [4,8], + "8": [], + "9": [6,8] + }, + "corners": {"1": true,"3": true,"7": true,"9": true} + }, + { + "image": [ + {"shape": "polygon", "fill": "#248", "stroke": "#48f", "points": [[0.5,47.5],[47.5,47.5],[47.5,0.5]]} + ], + "solid": { + "1": [2,4], + "2": [1], + "3": [2], + "4": [], + "5": [2,8,1,3,7,9,4,6], + "6": [], + "7": [4,8], + "8": [], + "9": [6,8] + }, + "corners": {"1": true,"3": true,"7": false,"9": true} + }, + { + "image": [ + {"shape": "polygon", "fill": "#248", "stroke": "#48f", "points": [[0.5,0.5],[47.5,47.5],[0.5,47.5]]} + ], + "solid": { + "1": [2], + "2": [3], + "3": [2,6], + "4": [], + "5": [2,8,1,3,7,9,4,6], + "6": [], + "7": [4,8], + "8": [], + "9": [6,8] + }, + "corners": {"1": true,"3": true,"7": true,"9": false} + }, + { + "image": [ + {"shape": "polygon", "fill": "#333", "stroke": "#999", "points": [[0.5,0.5],[47.5,47.5],[47.5,0.5]]} + ], + "jumpable": 3, + "solid": { + "1": [2,4], + "2": [], + "3": [2,6], + "4": [], + "5": [2,8,1,3,7,9,4,6], + "6": [3], + "7": [4,8], + "8": [7], + "9": [6,8] + }, + "corners": {"1": false,"3": true,"7": true,"9": true} + }, + { + "image": [ + {"shape": "polygon", "fill": "#333", "stroke": "#999", "points": [[0.5,0.5],[0.5,47.5],[47.5,0.5]]} + ], + "jumpable": 3, + "solid": { + "1": [2,4], + "2": [], + "3": [2,6], + "4": [1], + "5": [2,8,1,3,7,9,4,6], + "6": [], + "7": [4,8], + "8": [9], + "9": [6,8] + }, + "corners": {"1": true,"3": false,"7": true,"9": true} + }, + { + "image": [ + {"shape": "polygon", "fill": "#482", "stroke": "#8f4", "points": [[0.5,47.5],[0.5,23.5],[24.5,23.5],[24.5,0.5],[47.5,0.5],[47.5,47.5]]} + ], + "jumpable": 3, + "solid": { + "1": [2,4], + "2": [], + "3": [6,2], + "4": [], + "5": [2,8,1,3,7,9,4,6], + "6": [9], + "7": [4,8], + "8": [], + "9": [6,8] + }, + "corners": {"1": true,"3": true,"7": false,"9": true} + }, + { + "image": [ + {"shape": "polygon", "fill": "#482", "stroke": "#8f4", "points": [[0.5,0.5],[23.5,0.5],[23.5,24.5],[47.5,24.5],[47.5,47.5],[0.5,47.5]]} + ], + "jumpable": 3, + "solid": { + "1": [4,2], + "2": [], + "3": [2,6], + "4": [7], + "5": [2,8,1,3,7,9,4,6], + "6": [], + "7": [4,8], + "8": [], + "9": [6,8] + }, + "corners": {"1": true,"3": true,"7": true,"9": false} + }, + { + "image": [ + {"shape": "circle", "fill": "#ff0", "stroke": "#ff8", "cx": 24, "cy": 24, "r": 18} + ], + "item": true + }, + { + "image": [ + {"shape": "polygon", "fill": "#842", "stroke": "#f84", "points": [[4.5,0.5],[14.5,0.5],[14.5,17.5],[34,17.5],[33.5,0.5],[43.5,0.5],[43.5,47.5],[33.5,47.5],[33.5,30.5],[14.5,30.5],[14.5,47.5],[4.5,47.5]]} + ], + "jumpable": 3 + }, + { + "image": [ + {"shape": "polygon", "fill": "#333", "stroke": "#999", "points": [[0.5,0.5],[47.5,0.5],[24,47.5]]} + ], + "jumpable": 3, + "solid": { + "1": [2,4], + "2": [], + "3": [2,6], + "4": [1], + "5": [2,8,1,3,7,9,4,6], + "6": [3], + "7": [4,8], + "8": [], + "9": [6,8] + }, + "corners": {"1": false,"3": false,"7": true,"9": true} + }, + { + "image": [ + {"shape": "rect", "fill": "#114acb", "x": 0.5, "y": 0.5, "width": 47, "height": 47}, + {"shape": "polygon", "fill": "rgba(255,255,255,0.30)", "points": [[0.5,0.5],[47.5,0.5],[40,8],[8,8],[8,40],[0.5,47.5]]}, + {"shape": "polygon", "fill": "rgba(0,0,0,0.30)", "points": [[47.5,0.5],[48,48],[0.5,47.5],[8,40],[40,40],[40,8]]}, + {"shape": "polygon", "fill": "rgb(255,255,0)", "stroke": "rgba(255,255,0,0.5)", "points": [[24,9],[35,20],[26,29],[26,33],[22,33],[22,27],[29,20],[24,15],[16,23],[13,20]]}, + {"shape": "rect", "fill": "rgb(255,255,0)", "stroke": "rgba(255,255,0,0.5)", "x": 22, "y":35, "width": 4, "height": 4} + ], + "item": true + }, + { + "image": [ + {"shape": "circle", "fill": "#80f", "stroke": "#88f", "cx": 24, "cy": 24, "r": 18} + ], + "item": true + }, + { + "image": [ + {"shape": "circle", "fill": "#4f4", "stroke": "#8f8", "cx": 24, "cy": 24, "r": 18} + ], + "item": true + } +] diff --git a/node_modules/jsonparse/test/big-token.js b/node_modules/jsonparse/test/big-token.js new file mode 100644 index 000000000..36046317e --- /dev/null +++ b/node_modules/jsonparse/test/big-token.js @@ -0,0 +1,24 @@ +var stream = require('stream'); +var JsonParse = require('../jsonparse'); +var test = require('tape'); + +test('can handle large tokens without running out of memory', function (t) { + var parser = new JsonParse(); + var chunkSize = 1024; + var chunks = 1024 * 200; // 200mb + var quote = Buffer.from ? Buffer.from('"') : new Buffer('"'); + t.plan(1); + + parser.onToken = function (type, value) { + t.equal(value.length, chunkSize * chunks, 'token should be size of input json'); + t.end(); + }; + + parser.write(quote); + for (var i = 0; i < chunks; ++i) { + var buf = Buffer.alloc ? Buffer.alloc(chunkSize) : new Buffer(chunkSize); + buf.fill('a'); + parser.write(buf); + } + parser.write(quote); +}); diff --git a/node_modules/jsonparse/test/boundary.js b/node_modules/jsonparse/test/boundary.js new file mode 100644 index 000000000..6671f5f93 --- /dev/null +++ b/node_modules/jsonparse/test/boundary.js @@ -0,0 +1,110 @@ +var test = require('tape'); +var Parser = require('../'); + +test('2 byte utf8 \'De\' character: д', function (t) { + t.plan(1); + + var p = new Parser(); + p.onValue = function (value) { + t.equal(value, 'д'); + }; + + var de_buffer = new Buffer([0xd0, 0xb4]); + + p.write('"'); + p.write(de_buffer); + p.write('"'); + +}); + +test('3 byte utf8 \'Han\' character: 我', function (t) { + t.plan(1); + + var p = new Parser(); + p.onValue = function (value) { + t.equal(value, '我'); + }; + + var han_buffer = new Buffer([0xe6, 0x88, 0x91]); + p.write('"'); + p.write(han_buffer); + p.write('"'); +}); + +test('4 byte utf8 character (unicode scalar U+2070E): 𠜎', function (t) { + t.plan(1); + + var p = new Parser(); + p.onValue = function (value) { + t.equal(value, '𠜎'); + }; + + var Ux2070E_buffer = new Buffer([0xf0, 0xa0, 0x9c, 0x8e]); + p.write('"'); + p.write(Ux2070E_buffer); + p.write('"'); +}); + +test('3 byte utf8 \'Han\' character chunked inbetween 2nd and 3rd byte: 我', function (t) { + t.plan(1); + + var p = new Parser(); + p.onValue = function (value) { + t.equal(value, '我'); + }; + + var han_buffer_first = new Buffer([0xe6, 0x88]); + var han_buffer_second = new Buffer([0x91]); + p.write('"'); + p.write(han_buffer_first); + p.write(han_buffer_second); + p.write('"'); +}); + +test('4 byte utf8 character (unicode scalar U+2070E) chunked inbetween 2nd and 3rd byte: 𠜎', function (t) { + t.plan(1); + + var p = new Parser(); + p.onValue = function (value) { + t.equal(value, '𠜎'); + }; + + var Ux2070E_buffer_first = new Buffer([0xf0, 0xa0]); + var Ux2070E_buffer_second = new Buffer([0x9c, 0x8e]); + p.write('"'); + p.write(Ux2070E_buffer_first); + p.write(Ux2070E_buffer_second); + p.write('"'); +}); + +test('1-4 byte utf8 character string chunked inbetween random bytes: Aж文𠜱B', function (t) { + t.plan(1); + +var p = new Parser(); + p.onValue = function (value) { + t.equal(value, 'Aж文𠜱B'); + }; + + var eclectic_buffer = new Buffer([0x41, // A + 0xd0, 0xb6, // ж + 0xe6, 0x96, 0x87, // 文 + 0xf0, 0xa0, 0x9c, 0xb1, // 𠜱 + 0x42]); // B + + var rand_chunk = Math.floor(Math.random() * (eclectic_buffer.length)); + var first_buffer = eclectic_buffer.slice(0, rand_chunk); + var second_buffer = eclectic_buffer.slice(rand_chunk); + + //console.log('eclectic_buffer: ' + eclectic_buffer) + //console.log('sliced from 0 to ' + rand_chunk); + //console.log(first_buffer); + //console.log('then sliced from ' + rand_chunk + ' to the end'); + //console.log(second_buffer); + + console.log('chunked after offset ' + rand_chunk); + p.write('"'); + p.write(first_buffer); + p.write(second_buffer); + p.write('"'); + +}); \ No newline at end of file diff --git a/node_modules/jsonparse/test/offset.js b/node_modules/jsonparse/test/offset.js new file mode 100644 index 000000000..9a552ab05 --- /dev/null +++ b/node_modules/jsonparse/test/offset.js @@ -0,0 +1,67 @@ +var test = require('tape'); +var Parser = require('../'); + +var input = '{\n "string": "value",\n "number": 3,\n "object"'; +var input2 = ': {\n "key": "vд"\n },\n "array": [\n -1,\n 12\n ]\n '; +var input3 = '"null": null, "true": true, "false": false, "frac": 3.14 }'; + +var offsets = [ + [ 0, Parser.C.LEFT_BRACE ], + [ 4, Parser.C.STRING ], + [ 12, Parser.C.COLON ], + [ 14, Parser.C.STRING ], + [ 21, Parser.C.COMMA ], + [ 25, Parser.C.STRING ], + [ 33, Parser.C.COLON ], + [ 35, Parser.C.NUMBER ], + [ 36, Parser.C.COMMA ], + [ 40, Parser.C.STRING ], + [ 48, Parser.C.COLON ], + [ 50, Parser.C.LEFT_BRACE ], + [ 54, Parser.C.STRING ], + [ 59, Parser.C.COLON ], + [ 61, Parser.C.STRING ], + [ 69, Parser.C.RIGHT_BRACE ], + [ 70, Parser.C.COMMA ], + [ 74, Parser.C.STRING ], + [ 81, Parser.C.COLON ], + [ 83, Parser.C.LEFT_BRACKET ], + [ 87, Parser.C.NUMBER ], + [ 89, Parser.C.COMMA ], + [ 93, Parser.C.NUMBER ], + [ 98, Parser.C.RIGHT_BRACKET ], + [ 102, Parser.C.STRING ], + [ 108, Parser.C.COLON ], + [ 110, Parser.C.NULL ], + [ 114, Parser.C.COMMA ], + [ 116, Parser.C.STRING ], + [ 122, Parser.C.COLON ], + [ 124, Parser.C.TRUE ], + [ 128, Parser.C.COMMA ], + [ 130, Parser.C.STRING ], + [ 137, Parser.C.COLON ], + [ 139, Parser.C.FALSE ], + [ 144, Parser.C.COMMA ], + [ 146, Parser.C.STRING ], + [ 152, Parser.C.COLON ], + [ 154, Parser.C.NUMBER ], + [ 159, Parser.C.RIGHT_BRACE ] +]; + +test('offset', function(t) { + t.plan(offsets.length * 2 + 1); + + var p = new Parser(); + var i = 0; + p.onToken = function (token) { + t.equal(p.offset, offsets[i][0]); + t.equal(token, offsets[i][1]); + i++; + }; + + p.write(input); + p.write(input2); + p.write(input3); + + t.equal(i, offsets.length); +}); diff --git a/node_modules/jsonparse/test/primitives.js b/node_modules/jsonparse/test/primitives.js new file mode 100644 index 000000000..33cae169a --- /dev/null +++ b/node_modules/jsonparse/test/primitives.js @@ -0,0 +1,57 @@ +var test = require('tape'); +var Parser = require('../'); + +var expected = [ + [ [], '' ], + [ [], 'Hello' ], + [ [], 'This"is' ], + [ [], '\r\n\f\t\\/"' ], + [ [], 'Λάμβδα' ], + [ [], '\\' ], + [ [], '/' ], + [ [], '"' ], + [ [ 0 ], 0 ], + [ [ 1 ], 1 ], + [ [ 2 ], -1 ], + [ [], [ 0, 1, -1 ] ], + [ [ 0 ], 1 ], + [ [ 1 ], 1.1 ], + [ [ 2 ], -1.1 ], + [ [ 3 ], -1 ], + [ [], [ 1, 1.1, -1.1, -1 ] ], + [ [ 0 ], -1 ], + [ [], [ -1 ] ], + [ [ 0 ], -0.1 ], + [ [], [ -0.1 ] ], + [ [ 0 ], 6.02e+23 ], + [ [], [ 6.02e+23 ] ], + [ [ 0 ], '7161093205057351174' ], + [ [], [ '7161093205057351174'] ] +]; + +test('primitives', function (t) { + t.plan(25); + + var p = new Parser(); + p.onValue = function (value) { + var keys = this.stack + .slice(1) + .map(function (item) { return item.key }) + .concat(this.key !== undefined ? this.key : []) + ; + t.deepEqual( + [ keys, value ], + expected.shift() + ); + }; + + p.write('"""Hello""This\\"is""\\r\\n\\f\\t\\\\\\/\\""'); + p.write('"\\u039b\\u03ac\\u03bc\\u03b2\\u03b4\\u03b1"'); + p.write('"\\\\"'); + p.write('"\\/"'); + p.write('"\\""'); + p.write('[0,1,-1]'); + p.write('[1.0,1.1,-1.1,-1.0][-1][-0.1]'); + p.write('[6.02e23]'); + p.write('[7161093205057351174]'); +}); diff --git a/node_modules/jsonparse/test/surrogate.js b/node_modules/jsonparse/test/surrogate.js new file mode 100644 index 000000000..c048f3706 --- /dev/null +++ b/node_modules/jsonparse/test/surrogate.js @@ -0,0 +1,26 @@ +var test = require('tape'); +var Parser = require('../'); + +test('parse surrogate pair', function (t) { + t.plan(1); + + var p = new Parser(); + p.onValue = function (value) { + t.equal(value, '😋'); + }; + + p.write('"\\uD83D\\uDE0B"'); +}); + +test('parse chunked surrogate pair', function (t) { + t.plan(1); + + var p = new Parser(); + p.onValue = function (value) { + t.equal(value, '😋'); + }; + + p.write('"\\uD83D'); + p.write('\\uDE0B"'); +}); + diff --git a/node_modules/jsonparse/test/unvalid.js b/node_modules/jsonparse/test/unvalid.js new file mode 100644 index 000000000..7715cc0ef --- /dev/null +++ b/node_modules/jsonparse/test/unvalid.js @@ -0,0 +1,15 @@ +var test = require('tape'); +var Parser = require('../'); + +test('unvalid', function (t) { + var count = 0; + + var p = new Parser(); + p.onError = function (value) { + count++; + t.equal(1, count); + t.end(); + }; + + p.write('{"test": eer['); +}); diff --git a/node_modules/jsonparse/test/utf8.js b/node_modules/jsonparse/test/utf8.js new file mode 100644 index 000000000..6cb842f3e --- /dev/null +++ b/node_modules/jsonparse/test/utf8.js @@ -0,0 +1,38 @@ +var test = require('tape'); +var Parser = require('../'); + +test('3 bytes of utf8', function (t) { + t.plan(1); + + var p = new Parser(); + p.onValue = function (value) { + t.equal(value, '├──'); + }; + + p.write('"├──"'); +}); + +test('utf8 snowman', function (t) { + t.plan(1); + + var p = new Parser(); + p.onValue = function (value) { + t.equal(value, '☃'); + }; + + p.write('"☃"'); +}); + +test('utf8 with regular ascii', function (t) { + t.plan(4); + + var p = new Parser(); + var expected = [ "snow: ☃!", "xyz", "¡que!" ]; + expected.push(expected.slice()); + + p.onValue = function (value) { + t.deepEqual(value, expected.shift()); + }; + + p.write('["snow: ☃!","xyz","¡que!"]'); +}); diff --git a/node_modules/kind-of/LICENSE b/node_modules/kind-of/LICENSE new file mode 100644 index 000000000..d734237bd --- /dev/null +++ b/node_modules/kind-of/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/kind-of/README.md b/node_modules/kind-of/README.md new file mode 100644 index 000000000..6a9df36d3 --- /dev/null +++ b/node_modules/kind-of/README.md @@ -0,0 +1,261 @@ +# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) + +> Get the native type of a value. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save kind-of +``` + +## Install + +Install with [bower](https://bower.io/) + +```sh +$ bower install kind-of --save +``` + +## Usage + +> es5, browser and es6 ready + +```js +var kindOf = require('kind-of'); + +kindOf(undefined); +//=> 'undefined' + +kindOf(null); +//=> 'null' + +kindOf(true); +//=> 'boolean' + +kindOf(false); +//=> 'boolean' + +kindOf(new Boolean(true)); +//=> 'boolean' + +kindOf(new Buffer('')); +//=> 'buffer' + +kindOf(42); +//=> 'number' + +kindOf(new Number(42)); +//=> 'number' + +kindOf('str'); +//=> 'string' + +kindOf(new String('str')); +//=> 'string' + +kindOf(arguments); +//=> 'arguments' + +kindOf({}); +//=> 'object' + +kindOf(Object.create(null)); +//=> 'object' + +kindOf(new Test()); +//=> 'object' + +kindOf(new Date()); +//=> 'date' + +kindOf([]); +//=> 'array' + +kindOf([1, 2, 3]); +//=> 'array' + +kindOf(new Array()); +//=> 'array' + +kindOf(/foo/); +//=> 'regexp' + +kindOf(new RegExp('foo')); +//=> 'regexp' + +kindOf(function () {}); +//=> 'function' + +kindOf(function * () {}); +//=> 'function' + +kindOf(new Function()); +//=> 'function' + +kindOf(new Map()); +//=> 'map' + +kindOf(new WeakMap()); +//=> 'weakmap' + +kindOf(new Set()); +//=> 'set' + +kindOf(new WeakSet()); +//=> 'weakset' + +kindOf(Symbol('str')); +//=> 'symbol' + +kindOf(new Int8Array()); +//=> 'int8array' + +kindOf(new Uint8Array()); +//=> 'uint8array' + +kindOf(new Uint8ClampedArray()); +//=> 'uint8clampedarray' + +kindOf(new Int16Array()); +//=> 'int16array' + +kindOf(new Uint16Array()); +//=> 'uint16array' + +kindOf(new Int32Array()); +//=> 'int32array' + +kindOf(new Uint32Array()); +//=> 'uint32array' + +kindOf(new Float32Array()); +//=> 'float32array' + +kindOf(new Float64Array()); +//=> 'float64array' +``` + +## Benchmarks + +Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). +Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `WeakSet`. + +```bash +#1: array + current x 23,329,397 ops/sec ±0.82% (94 runs sampled) + lib-type-of x 4,170,273 ops/sec ±0.55% (94 runs sampled) + lib-typeof x 9,686,935 ops/sec ±0.59% (98 runs sampled) + +#2: boolean + current x 27,197,115 ops/sec ±0.85% (94 runs sampled) + lib-type-of x 3,145,791 ops/sec ±0.73% (97 runs sampled) + lib-typeof x 9,199,562 ops/sec ±0.44% (99 runs sampled) + +#3: date + current x 20,190,117 ops/sec ±0.86% (92 runs sampled) + lib-type-of x 5,166,970 ops/sec ±0.74% (94 runs sampled) + lib-typeof x 9,610,821 ops/sec ±0.50% (96 runs sampled) + +#4: function + current x 23,855,460 ops/sec ±0.60% (97 runs sampled) + lib-type-of x 5,667,740 ops/sec ±0.54% (100 runs sampled) + lib-typeof x 10,010,644 ops/sec ±0.44% (100 runs sampled) + +#5: null + current x 27,061,047 ops/sec ±0.97% (96 runs sampled) + lib-type-of x 13,965,573 ops/sec ±0.62% (97 runs sampled) + lib-typeof x 8,460,194 ops/sec ±0.61% (97 runs sampled) + +#6: number + current x 25,075,682 ops/sec ±0.53% (99 runs sampled) + lib-type-of x 2,266,405 ops/sec ±0.41% (98 runs sampled) + lib-typeof x 9,821,481 ops/sec ±0.45% (99 runs sampled) + +#7: object + current x 3,348,980 ops/sec ±0.49% (99 runs sampled) + lib-type-of x 3,245,138 ops/sec ±0.60% (94 runs sampled) + lib-typeof x 9,262,952 ops/sec ±0.59% (99 runs sampled) + +#8: regex + current x 21,284,827 ops/sec ±0.72% (96 runs sampled) + lib-type-of x 4,689,241 ops/sec ±0.43% (100 runs sampled) + lib-typeof x 8,957,593 ops/sec ±0.62% (98 runs sampled) + +#9: string + current x 25,379,234 ops/sec ±0.58% (96 runs sampled) + lib-type-of x 3,635,148 ops/sec ±0.76% (93 runs sampled) + lib-typeof x 9,494,134 ops/sec ±0.49% (98 runs sampled) + +#10: undef + current x 27,459,221 ops/sec ±1.01% (93 runs sampled) + lib-type-of x 14,360,433 ops/sec ±0.52% (99 runs sampled) + lib-typeof x 23,202,868 ops/sec ±0.59% (94 runs sampled) + +``` + +## Optimizations + +In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: + +1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. +2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. +3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` + +## About + +### Related projects + +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 59 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [miguelmota](https://github.com/miguelmota) | +| 1 | [dtothefp](https://github.com/dtothefp) | +| 1 | [ksheedlo](https://github.com/ksheedlo) | +| 1 | [pdehaan](https://github.com/pdehaan) | +| 1 | [laggingreflex](https://github.com/laggingreflex) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 16, 2017._ \ No newline at end of file diff --git a/node_modules/kind-of/index.js b/node_modules/kind-of/index.js new file mode 100644 index 000000000..b52c2917f --- /dev/null +++ b/node_modules/kind-of/index.js @@ -0,0 +1,116 @@ +var isBuffer = require('is-buffer'); +var toString = Object.prototype.toString; + +/** + * Get the native `typeof` a value. + * + * @param {*} `val` + * @return {*} Native javascript type + */ + +module.exports = function kindOf(val) { + // primitivies + if (typeof val === 'undefined') { + return 'undefined'; + } + if (val === null) { + return 'null'; + } + if (val === true || val === false || val instanceof Boolean) { + return 'boolean'; + } + if (typeof val === 'string' || val instanceof String) { + return 'string'; + } + if (typeof val === 'number' || val instanceof Number) { + return 'number'; + } + + // functions + if (typeof val === 'function' || val instanceof Function) { + return 'function'; + } + + // array + if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { + return 'array'; + } + + // check for instances of RegExp and Date before calling `toString` + if (val instanceof RegExp) { + return 'regexp'; + } + if (val instanceof Date) { + return 'date'; + } + + // other objects + var type = toString.call(val); + + if (type === '[object RegExp]') { + return 'regexp'; + } + if (type === '[object Date]') { + return 'date'; + } + if (type === '[object Arguments]') { + return 'arguments'; + } + if (type === '[object Error]') { + return 'error'; + } + + // buffer + if (isBuffer(val)) { + return 'buffer'; + } + + // es6: Map, WeakMap, Set, WeakSet + if (type === '[object Set]') { + return 'set'; + } + if (type === '[object WeakSet]') { + return 'weakset'; + } + if (type === '[object Map]') { + return 'map'; + } + if (type === '[object WeakMap]') { + return 'weakmap'; + } + if (type === '[object Symbol]') { + return 'symbol'; + } + + // typed arrays + if (type === '[object Int8Array]') { + return 'int8array'; + } + if (type === '[object Uint8Array]') { + return 'uint8array'; + } + if (type === '[object Uint8ClampedArray]') { + return 'uint8clampedarray'; + } + if (type === '[object Int16Array]') { + return 'int16array'; + } + if (type === '[object Uint16Array]') { + return 'uint16array'; + } + if (type === '[object Int32Array]') { + return 'int32array'; + } + if (type === '[object Uint32Array]') { + return 'uint32array'; + } + if (type === '[object Float32Array]') { + return 'float32array'; + } + if (type === '[object Float64Array]') { + return 'float64array'; + } + + // must be a plain object + return 'object'; +}; diff --git a/node_modules/kind-of/package.json b/node_modules/kind-of/package.json new file mode 100644 index 000000000..a522e8890 --- /dev/null +++ b/node_modules/kind-of/package.json @@ -0,0 +1,146 @@ +{ + "_from": "kind-of@^3.0.2", + "_id": "kind-of@3.2.2", + "_inBundle": false, + "_integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "_location": "/kind-of", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "kind-of@^3.0.2", + "name": "kind-of", + "escapedName": "kind-of", + "rawSpec": "^3.0.2", + "saveSpec": null, + "fetchSpec": "^3.0.2" + }, + "_requiredBy": [ + "/is-accessor-descriptor", + "/is-data-descriptor", + "/is-number", + "/micromatch", + "/object-copy", + "/snapdragon-util", + "/to-object-path", + "/to-regex-range/is-number" + ], + "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "_shasum": "31ea21a734bab9bbb0f32466d893aea51e4a3c64", + "_spec": "kind-of@^3.0.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/kind-of/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "David Fox-Powell", + "url": "https://dtothefp.github.io/me" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Ken Sheedlo", + "url": "kensheedlo.com" + }, + { + "name": "laggingreflex", + "url": "https://github.com/laggingreflex" + }, + { + "name": "Miguel Mota", + "url": "https://miguelmota.com" + }, + { + "name": "Peter deHaan", + "url": "http://about.me/peterdehaan" + } + ], + "dependencies": { + "is-buffer": "^1.1.5" + }, + "deprecated": false, + "description": "Get the native type of a value.", + "devDependencies": { + "ansi-bold": "^0.1.1", + "benchmarked": "^1.0.0", + "browserify": "^14.3.0", + "glob": "^7.1.1", + "gulp-format-md": "^0.1.12", + "mocha": "^3.3.0", + "type-of": "^2.0.1", + "typeof": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/kind-of", + "keywords": [ + "arguments", + "array", + "boolean", + "check", + "date", + "function", + "is", + "is-type", + "is-type-of", + "kind", + "kind-of", + "number", + "object", + "of", + "regexp", + "string", + "test", + "type", + "type-of", + "typeof", + "types" + ], + "license": "MIT", + "main": "index.js", + "name": "kind-of", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/kind-of.git" + }, + "scripts": { + "prepublish": "browserify -o browser.js -e index.js -s index --bare", + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "is-glob", + "is-number", + "is-primitive" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb" + ] + }, + "version": "3.2.2" +} diff --git a/node_modules/labeled-stream-splicer/.travis.yml b/node_modules/labeled-stream-splicer/.travis.yml new file mode 100644 index 000000000..9672e1293 --- /dev/null +++ b/node_modules/labeled-stream-splicer/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: + - "0.8" + - "0.10" +before_install: + - npm install -g npm@~1.4.6 diff --git a/node_modules/labeled-stream-splicer/LICENSE b/node_modules/labeled-stream-splicer/LICENSE new file mode 100644 index 000000000..ee27ba4b4 --- /dev/null +++ b/node_modules/labeled-stream-splicer/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/labeled-stream-splicer/example/browser/bar.js b/node_modules/labeled-stream-splicer/example/browser/bar.js new file mode 100644 index 000000000..c57fa530a --- /dev/null +++ b/node_modules/labeled-stream-splicer/example/browser/bar.js @@ -0,0 +1,3 @@ +module.exports = function (n) { + return n * 100; +}; diff --git a/node_modules/labeled-stream-splicer/example/browser/foo.js b/node_modules/labeled-stream-splicer/example/browser/foo.js new file mode 100644 index 000000000..c62e63856 --- /dev/null +++ b/node_modules/labeled-stream-splicer/example/browser/foo.js @@ -0,0 +1,5 @@ +var bar = require('./bar'); + +module.exports = function (n) { + return n * 111 + bar(n); +}; diff --git a/node_modules/labeled-stream-splicer/example/browser/main.js b/node_modules/labeled-stream-splicer/example/browser/main.js new file mode 100644 index 000000000..8c71d7997 --- /dev/null +++ b/node_modules/labeled-stream-splicer/example/browser/main.js @@ -0,0 +1,2 @@ +var foo = require('./foo'); +console.log('main: ' + foo(5)); diff --git a/node_modules/labeled-stream-splicer/example/browser/xyz.js b/node_modules/labeled-stream-splicer/example/browser/xyz.js new file mode 100644 index 000000000..dff6877a8 --- /dev/null +++ b/node_modules/labeled-stream-splicer/example/browser/xyz.js @@ -0,0 +1,2 @@ +var foo = require('./foo'); +console.log('xyz: ' + foo(6)); diff --git a/node_modules/labeled-stream-splicer/example/bundle.js b/node_modules/labeled-stream-splicer/example/bundle.js new file mode 100644 index 000000000..06f119d86 --- /dev/null +++ b/node_modules/labeled-stream-splicer/example/bundle.js @@ -0,0 +1,16 @@ +var splicer = require('../'); +var through = require('through2'); +var deps = require('module-deps'); +var pack = require('browser-pack'); + +var pipeline = splicer.obj([ + 'deps', [ deps(__dirname + '/browser/main.js') ], + 'pack', [ pack({ raw: true }) ], + process.stdout +]); + +pipeline.get('deps').push(through.obj(function (row, enc, next) { + row.source = row.source.toUpperCase(); + this.push(row); + next(); +})); diff --git a/node_modules/labeled-stream-splicer/index.js b/node_modules/labeled-stream-splicer/index.js new file mode 100644 index 000000000..59a93b272 --- /dev/null +++ b/node_modules/labeled-stream-splicer/index.js @@ -0,0 +1,65 @@ +var Splicer = require('stream-splicer'); +var inherits = require('inherits'); +var isarray = require('isarray'); + +module.exports = Labeled; +inherits(Labeled, Splicer); + +module.exports.obj = function (streams, opts) { + if (!opts) opts = {}; + opts.objectMode = true; + return new Labeled(streams, opts); +}; + +function Labeled (streams, opts) { + if (!(this instanceof Labeled)) return new Labeled(streams, opts); + Splicer.call(this, [], opts); + + var reps = []; + for (var i = 0; i < streams.length; i++) { + var s = streams[i]; + if (typeof s === 'string') continue; + if (isarray(s)) { + s = new Labeled(s, opts); + } + if (i >= 0 && typeof streams[i-1] === 'string') { + s.label = streams[i-1]; + } + reps.push(s); + } + if (typeof streams[i-1] === 'string') { + reps.push(new Labeled([], opts)); + } + this.splice.apply(this, [0,0].concat(reps)); +} + +Labeled.prototype.indexOf = function (stream) { + if (typeof stream === 'string') { + for (var i = 0; i < this._streams.length; i++) { + if (this._streams[i].label === stream) return i; + } + return -1; + } + else { + return Splicer.prototype.indexOf.call(this, stream); + } +}; + +Labeled.prototype.get = function (key) { + if (typeof key === 'string') { + var ix = this.indexOf(key); + if (ix < 0) return undefined; + return this._streams[ix]; + } + else return Splicer.prototype.get.call(this, key); +}; + +Labeled.prototype.splice = function (key) { + var ix; + if (typeof key === 'string') { + ix = this.indexOf(key); + } + else ix = key; + var args = [ ix ].concat([].slice.call(arguments, 1)); + return Splicer.prototype.splice.apply(this, args); +}; diff --git a/node_modules/labeled-stream-splicer/node_modules/isarray/README.md b/node_modules/labeled-stream-splicer/node_modules/isarray/README.md new file mode 100644 index 000000000..9c681fa2f --- /dev/null +++ b/node_modules/labeled-stream-splicer/node_modules/isarray/README.md @@ -0,0 +1,62 @@ + +# isarray + +`Array#isArray` for older browsers and deprecated Node.js versions. + +[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray) +[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray) + +[![browser support](https://ci.testling.com/juliangruber/isarray.png) +](https://ci.testling.com/juliangruber/isarray) + +__Just use Array.isArray directly__, unless you need to support those older versions. + +## Usage + +```js +var isArray = require('isarray'); + +console.log(isArray([])); // => true +console.log(isArray({})); // => false +``` + +## Installation + +With [npm](https://npmjs.org) do + +```bash +$ npm install isarray +``` + +Then bundle for the browser with +[browserify](https://github.com/substack/node-browserify). + +## Sponsors + +This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! + +Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/labeled-stream-splicer/node_modules/isarray/index.js b/node_modules/labeled-stream-splicer/node_modules/isarray/index.js new file mode 100644 index 000000000..a57f63495 --- /dev/null +++ b/node_modules/labeled-stream-splicer/node_modules/isarray/index.js @@ -0,0 +1,5 @@ +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; diff --git a/node_modules/labeled-stream-splicer/node_modules/isarray/package.json b/node_modules/labeled-stream-splicer/node_modules/isarray/package.json new file mode 100644 index 000000000..41a615986 --- /dev/null +++ b/node_modules/labeled-stream-splicer/node_modules/isarray/package.json @@ -0,0 +1,76 @@ +{ + "_from": "isarray@^2.0.4", + "_id": "isarray@2.0.4", + "_inBundle": false, + "_integrity": "sha512-GMxXOiUirWg1xTKRipM0Ek07rX+ubx4nNVElTJdNLYmNO/2YrDkgJGw9CljXn+r4EWiDQg/8lsRdHyg2PJuUaA==", + "_location": "/labeled-stream-splicer/isarray", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "isarray@^2.0.4", + "name": "isarray", + "escapedName": "isarray", + "rawSpec": "^2.0.4", + "saveSpec": null, + "fetchSpec": "^2.0.4" + }, + "_requiredBy": [ + "/labeled-stream-splicer" + ], + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.4.tgz", + "_shasum": "38e7bcbb0f3ba1b7933c86ba1894ddfc3781bbb7", + "_spec": "isarray@^2.0.4", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/labeled-stream-splicer", + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/isarray/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Array#isArray for older browsers", + "devDependencies": { + "tape": "~2.13.4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/juliangruber/isarray", + "keywords": [ + "browser", + "isarray", + "array" + ], + "license": "MIT", + "main": "index.js", + "name": "isarray", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/isarray.git" + }, + "scripts": { + "test": "tape test.js" + }, + "testling": { + "files": "test.js", + "browsers": [ + "ie/8..latest", + "firefox/17..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "2.0.4" +} diff --git a/node_modules/labeled-stream-splicer/package.json b/node_modules/labeled-stream-splicer/package.json new file mode 100644 index 000000000..84d1c7a7d --- /dev/null +++ b/node_modules/labeled-stream-splicer/package.json @@ -0,0 +1,67 @@ +{ + "_from": "labeled-stream-splicer@^2.0.0", + "_id": "labeled-stream-splicer@2.0.1", + "_inBundle": false, + "_integrity": "sha512-MC94mHZRvJ3LfykJlTUipBqenZz1pacOZEMhhQ8dMGcDHs0SBE5GbsavUXV7YtP3icBW17W0Zy1I0lfASmo9Pg==", + "_location": "/labeled-stream-splicer", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "labeled-stream-splicer@^2.0.0", + "name": "labeled-stream-splicer", + "escapedName": "labeled-stream-splicer", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/browserify" + ], + "_resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.1.tgz", + "_shasum": "9cffa32fd99e1612fd1d86a8db962416d5292926", + "_spec": "labeled-stream-splicer@^2.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/labeled-stream-splicer/issues" + }, + "bundleDependencies": false, + "dependencies": { + "inherits": "^2.0.1", + "isarray": "^2.0.4", + "stream-splicer": "^2.0.0" + }, + "deprecated": false, + "description": "stream splicer with labels", + "devDependencies": { + "browser-pack": "^2.0.1", + "concat-stream": "^1.4.6", + "module-deps": "^2.1.2", + "tape": "^2.12.1", + "through2": "^1.0.0" + }, + "homepage": "https://github.com/substack/labeled-stream-splicer", + "keywords": [ + "splice", + "stream", + "labels", + "mutable", + "pipeline" + ], + "license": "MIT", + "main": "index.js", + "name": "labeled-stream-splicer", + "repository": { + "type": "git", + "url": "git://github.com/substack/labeled-stream-splicer.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "version": "2.0.1" +} diff --git a/node_modules/labeled-stream-splicer/readme.markdown b/node_modules/labeled-stream-splicer/readme.markdown new file mode 100644 index 000000000..c8e08e20d --- /dev/null +++ b/node_modules/labeled-stream-splicer/readme.markdown @@ -0,0 +1,124 @@ +# labeled-stream-splicer + +[stream splicer](https://npmjs.org/package/stream-splicer) with labels + +[![build status](https://secure.travis-ci.org/substack/labeled-stream-splicer.png)](http://travis-ci.org/substack/labeled-stream-splicer) + +# example + +Here's an example that exposes a label for `deps` and `pack`: + +``` js +var splicer = require('labeled-stream-splicer'); +var through = require('through2'); +var deps = require('module-deps'); +var pack = require('browser-pack'); +var lstream = require('lstream'); + +var pipeline = splicer.obj([ + 'deps', [ deps() ], + 'pack', [ pack({ raw: true }) ] +]); + +pipeline.get('deps').unshift(lstream()); + +pipeline.get('deps').push(through.obj(function (row, enc, next) { + row.source = row.source.toUpperCase(); + this.push(row); + next(); +})); + +process.stdin.pipe(pipeline).pipe(process.stdout); +``` + +Here the `deps` sub-pipeline is augmented with a post-transformation that +uppercases its source input. + +# methods + +``` js +var splicer = require('labeled-stream-splicer') +``` + +The API is the same as +[stream-splicer](https://npmjs.org/package/stream-splicer), +except that `pipeline.get()`, `pipeline.splice()`, and `pipeline.indexOf()` can +accept string labels in addition to numeric indexes. + +## var pipeline = splicer(streams, opts) + +Create a `pipeline` duplex stream given an array of `streams`. Each `stream` +will be piped to the next. Writes to `pipeline` get written to the first stream +and data for reads from `pipeline` come from the last stream. + +To signify a label, a stream may have a `.label` property or a string may be +placed in the `streams` array. + +For example, for streams `[ a, 'foo', b, c, 'bar', d ]`, this pipeline is +constructed internally: + +``` +a.pipe(b).pipe(c).pipe(d) +``` + +with a label `'foo`' that points to `b` and a label `'bar'` that points to `d`. +If `a` or `c` has a `.label` property, that label would be used for addressing. + +Input will get written into `a`. Output will be read from `d`. + +If any of the elements in `streams` are arrays, they will be converted into +nested labeled pipelines. This is useful if you want to expose a hookable +pipeline with grouped insertion points. + +## var pipeline = splicer.obj(streams, opts) + +Create a `pipeline` with `opts.objectMode` set to true for convenience. + +## var removed = pipeline.splice(index, howMany, stream, ...) + +Splice the pipeline starting at `index`, removing `howMany` streams and +replacing them with each additional `stream` argument provided. + +The streams that were removed from the splice and returned. + +`index` can be an integer index or a label. + +## pipeline.push(stream, ...) + +Push one or more streams to the end of the pipeline. + +The stream arguments may have a `label` property that will be used for string +lookups. + +## var stream = pipeline.pop() + +Pop a stream from the end of the pipeline. + +## pipeline.unshift(stream, ...) + +Unshift one or more streams to the begining of the pipeline. + +The stream arguments may have a `label` property that will be used for string +lookups. + +## var stream = pipeline.shift() + +Shift a stream from the begining of the pipeline. + +## var stream = pipeline.get(index) + +Return the stream at index `index`. + +`index` can be an integer or a string label. + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install labeled-stream-splicer +``` + +# license + +MIT diff --git a/node_modules/labeled-stream-splicer/test/bundle.js b/node_modules/labeled-stream-splicer/test/bundle.js new file mode 100644 index 000000000..2cafc3c1c --- /dev/null +++ b/node_modules/labeled-stream-splicer/test/bundle.js @@ -0,0 +1,27 @@ +var test = require('tape'); +var splicer = require('../'); +var through = require('through2'); +var deps = require('module-deps'); +var pack = require('browser-pack'); +var concat = require('concat-stream'); + +test('bundle', function (t) { + t.plan(1); + + var pipeline = splicer.obj([ + 'deps', [ deps(__dirname + '/bundle/main.js') ], + 'pack', [ pack({ raw: true }) ] + ]); + pipeline.pipe(concat(function (body) { + Function([ 'console' ], body.toString('utf8'))({ log: log }); + function log (msg) { + t.equal(msg, 'main: 56055'); + } + })); + + pipeline.get('deps').push(through.obj(function (row, enc, next) { + row.source = row.source.replace(/111/g, '11111'); + this.push(row); + next(); + })); +}); diff --git a/node_modules/labeled-stream-splicer/test/bundle/bar.js b/node_modules/labeled-stream-splicer/test/bundle/bar.js new file mode 100644 index 000000000..c57fa530a --- /dev/null +++ b/node_modules/labeled-stream-splicer/test/bundle/bar.js @@ -0,0 +1,3 @@ +module.exports = function (n) { + return n * 100; +}; diff --git a/node_modules/labeled-stream-splicer/test/bundle/foo.js b/node_modules/labeled-stream-splicer/test/bundle/foo.js new file mode 100644 index 000000000..c62e63856 --- /dev/null +++ b/node_modules/labeled-stream-splicer/test/bundle/foo.js @@ -0,0 +1,5 @@ +var bar = require('./bar'); + +module.exports = function (n) { + return n * 111 + bar(n); +}; diff --git a/node_modules/labeled-stream-splicer/test/bundle/main.js b/node_modules/labeled-stream-splicer/test/bundle/main.js new file mode 100644 index 000000000..8c71d7997 --- /dev/null +++ b/node_modules/labeled-stream-splicer/test/bundle/main.js @@ -0,0 +1,2 @@ +var foo = require('./foo'); +console.log('main: ' + foo(5)); diff --git a/node_modules/labeled-stream-splicer/test/bundle/xyz.js b/node_modules/labeled-stream-splicer/test/bundle/xyz.js new file mode 100644 index 000000000..dff6877a8 --- /dev/null +++ b/node_modules/labeled-stream-splicer/test/bundle/xyz.js @@ -0,0 +1,2 @@ +var foo = require('./foo'); +console.log('xyz: ' + foo(6)); diff --git a/node_modules/lodash.debounce/LICENSE b/node_modules/lodash.debounce/LICENSE new file mode 100644 index 000000000..e0c69d560 --- /dev/null +++ b/node_modules/lodash.debounce/LICENSE @@ -0,0 +1,47 @@ +Copyright jQuery Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +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. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/node_modules/lodash.debounce/README.md b/node_modules/lodash.debounce/README.md new file mode 100644 index 000000000..52e638c74 --- /dev/null +++ b/node_modules/lodash.debounce/README.md @@ -0,0 +1,18 @@ +# lodash.debounce v4.0.8 + +The [lodash](https://lodash.com/) method `_.debounce` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.debounce +``` + +In Node.js: +```js +var debounce = require('lodash.debounce'); +``` + +See the [documentation](https://lodash.com/docs#debounce) or [package source](https://github.com/lodash/lodash/blob/4.0.8-npm-packages/lodash.debounce) for more details. diff --git a/node_modules/lodash.debounce/index.js b/node_modules/lodash.debounce/index.js new file mode 100644 index 000000000..ac5707d72 --- /dev/null +++ b/node_modules/lodash.debounce/index.js @@ -0,0 +1,377 @@ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */ +var now = function() { + return root.Date.now(); +}; + +/** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ +function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + result = wait - timeSinceLastCall; + + return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ +function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +module.exports = debounce; diff --git a/node_modules/lodash.debounce/package.json b/node_modules/lodash.debounce/package.json new file mode 100644 index 000000000..7366973e2 --- /dev/null +++ b/node_modules/lodash.debounce/package.json @@ -0,0 +1,69 @@ +{ + "_from": "lodash.debounce@^4.0.8", + "_id": "lodash.debounce@4.0.8", + "_inBundle": false, + "_integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", + "_location": "/lodash.debounce", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "lodash.debounce@^4.0.8", + "name": "lodash.debounce", + "escapedName": "lodash.debounce", + "rawSpec": "^4.0.8", + "saveSpec": null, + "fetchSpec": "^4.0.8" + }, + "_requiredBy": [ + "/cytoscape" + ], + "_resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "_shasum": "82d79bff30a67c4005ffd5e2515300ad9ca4d7af", + "_spec": "lodash.debounce@^4.0.8", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/cytoscape", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com", + "url": "https://github.com/phated" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "deprecated": false, + "description": "The lodash method `_.debounce` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash-modularized", + "debounce" + ], + "license": "MIT", + "name": "lodash.debounce", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.0.8" +} diff --git a/node_modules/lodash.memoize/LICENSE.txt b/node_modules/lodash.memoize/LICENSE.txt new file mode 100644 index 000000000..9cd87e5dc --- /dev/null +++ b/node_modules/lodash.memoize/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/lodash.memoize/README.md b/node_modules/lodash.memoize/README.md new file mode 100644 index 000000000..a417e274a --- /dev/null +++ b/node_modules/lodash.memoize/README.md @@ -0,0 +1,20 @@ +# lodash.memoize v3.0.4 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.memoize` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.memoize +``` + +In Node.js/io.js: + +```js +var memoize = require('lodash.memoize'); +``` + +See the [documentation](https://lodash.com/docs#memoize) or [package source](https://github.com/lodash/lodash/blob/3.0.4-npm-packages/lodash.memoize) for more details. diff --git a/node_modules/lodash.memoize/index.js b/node_modules/lodash.memoize/index.js new file mode 100644 index 000000000..8cb054a4c --- /dev/null +++ b/node_modules/lodash.memoize/index.js @@ -0,0 +1,167 @@ +/** + * lodash 3.0.4 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates a cache object to store key/value pairs. + * + * @private + * @static + * @name Cache + * @memberOf _.memoize + */ +function MapCache() { + this.__data__ = {}; +} + +/** + * Removes `key` and its value from the cache. + * + * @private + * @name delete + * @memberOf _.memoize.Cache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed successfully, else `false`. + */ +function mapDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the cached value for `key`. + * + * @private + * @name get + * @memberOf _.memoize.Cache + * @param {string} key The key of the value to get. + * @returns {*} Returns the cached value. + */ +function mapGet(key) { + return key == '__proto__' ? undefined : this.__data__[key]; +} + +/** + * Checks if a cached value for `key` exists. + * + * @private + * @name has + * @memberOf _.memoize.Cache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapHas(key) { + return key != '__proto__' && hasOwnProperty.call(this.__data__, key); +} + +/** + * Sets `value` to `key` of the cache. + * + * @private + * @name set + * @memberOf _.memoize.Cache + * @param {string} key The key of the value to cache. + * @param {*} value The value to cache. + * @returns {Object} Returns the cache object. + */ +function mapSet(key, value) { + if (key != '__proto__') { + this.__data__[key] = value; + } + return this; +} + +/** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is coerced to a string and used as the + * cache key. The `func` is invoked with the `this` binding of the memoized + * function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the [`Map`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-properties-of-the-map-prototype-object) + * method interface of `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoizing function. + * @example + * + * var upperCase = _.memoize(function(string) { + * return string.toUpperCase(); + * }); + * + * upperCase('fred'); + * // => 'FRED' + * + * // modifying the result cache + * upperCase.cache.set('fred', 'BARNEY'); + * upperCase('fred'); + * // => 'BARNEY' + * + * // replacing `_.memoize.Cache` + * var object = { 'user': 'fred' }; + * var other = { 'user': 'barney' }; + * var identity = _.memoize(_.identity); + * + * identity(object); + * // => { 'user': 'fred' } + * identity(other); + * // => { 'user': 'fred' } + * + * _.memoize.Cache = WeakMap; + * var identity = _.memoize(_.identity); + * + * identity(object); + * // => { 'user': 'fred' } + * identity(other); + * // => { 'user': 'barney' } + */ +function memoize(func, resolver) { + if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result); + return result; + }; + memoized.cache = new memoize.Cache; + return memoized; +} + +// Add functions to the `Map` cache. +MapCache.prototype['delete'] = mapDelete; +MapCache.prototype.get = mapGet; +MapCache.prototype.has = mapHas; +MapCache.prototype.set = mapSet; + +// Assign cache to `_.memoize`. +memoize.Cache = MapCache; + +module.exports = memoize; diff --git a/node_modules/lodash.memoize/package.json b/node_modules/lodash.memoize/package.json new file mode 100644 index 000000000..c33f18275 --- /dev/null +++ b/node_modules/lodash.memoize/package.json @@ -0,0 +1,81 @@ +{ + "_from": "lodash.memoize@~3.0.3", + "_id": "lodash.memoize@3.0.4", + "_inBundle": false, + "_integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", + "_location": "/lodash.memoize", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "lodash.memoize@~3.0.3", + "name": "lodash.memoize", + "escapedName": "lodash.memoize", + "rawSpec": "~3.0.3", + "saveSpec": null, + "fetchSpec": "~3.0.3" + }, + "_requiredBy": [ + "/combine-source-map" + ], + "_resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", + "_shasum": "2dcbd2c287cbc0a55cc42328bd0c736150d53e3f", + "_spec": "lodash.memoize@~3.0.3", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/combine-source-map", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "deprecated": false, + "description": "The modern build of lodash’s `_.memoize` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash", + "lodash-modularized", + "stdlib", + "util" + ], + "license": "MIT", + "name": "lodash.memoize", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "3.0.4" +} diff --git a/node_modules/map-cache/LICENSE b/node_modules/map-cache/LICENSE new file mode 100644 index 000000000..1e49edf81 --- /dev/null +++ b/node_modules/map-cache/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2016, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/map-cache/README.md b/node_modules/map-cache/README.md new file mode 100644 index 000000000..6260b29fc --- /dev/null +++ b/node_modules/map-cache/README.md @@ -0,0 +1,145 @@ +# map-cache [![NPM version](https://img.shields.io/npm/v/map-cache.svg?style=flat)](https://www.npmjs.com/package/map-cache) [![NPM downloads](https://img.shields.io/npm/dm/map-cache.svg?style=flat)](https://npmjs.org/package/map-cache) [![Build Status](https://img.shields.io/travis/jonschlinkert/map-cache.svg?style=flat)](https://travis-ci.org/jonschlinkert/map-cache) + +Basic cache object for storing key-value pairs. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install map-cache --save +``` + +Based on MapCache in Lo-dash v3.0. [MIT License](https://github.com/lodash/lodash/blob/master/LICENSE.txt) + +## Usage + +```js +var MapCache = require('map-cache'); +var mapCache = new MapCache(); +``` + +## API + +### [MapCache](index.js#L28) + +Creates a cache object to store key/value pairs. + +**Example** + +```js +var cache = new MapCache(); +``` + +### [.set](index.js#L45) + +Adds `value` to `key` on the cache. + +**Params** + +* `key` **{String}**: The key of the value to cache. +* `value` **{any}**: The value to cache. +* `returns` **{Object}**: Returns the `Cache` object for chaining. + +**Example** + +```js +cache.set('foo', 'bar'); +``` + +### [.get](index.js#L65) + +Gets the cached value for `key`. + +**Params** + +* `key` **{String}**: The key of the value to get. +* `returns` **{any}**: Returns the cached value. + +**Example** + +```js +cache.get('foo'); +//=> 'bar' +``` + +### [.has](index.js#L82) + +Checks if a cached value for `key` exists. + +**Params** + +* `key` **{String}**: The key of the entry to check. +* `returns` **{Boolean}**: Returns `true` if an entry for `key` exists, else `false`. + +**Example** + +```js +cache.has('foo'); +//=> true +``` + +### [.del](index.js#L98) + +Removes `key` and its value from the cache. + +**Params** + +* `key` **{String}**: The key of the value to remove. +* `returns` **{Boolean}**: Returns `true` if the entry was removed successfully, else `false`. + +**Example** + +```js +cache.del('foo'); +``` + +## Related projects + +You might also be interested in these projects: + +* [cache-base](https://www.npmjs.com/package/cache-base): Basic object cache with `get`, `set`, `del`, and `has` methods for node.js/javascript projects. | [homepage](https://github.com/jonschlinkert/cache-base) +* [config-cache](https://www.npmjs.com/package/config-cache): General purpose JavaScript object storage methods. | [homepage](https://github.com/jonschlinkert/config-cache) +* [option-cache](https://www.npmjs.com/package/option-cache): Simple API for managing options in JavaScript applications. | [homepage](https://github.com/jonschlinkert/option-cache) + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/map-cache/issues/new). + +## Building docs + +Generate readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install verb && npm run docs +``` + +Or, if [verb](https://github.com/verbose/verb) is installed globally: + +```sh +$ verb +``` + +## Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +## Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/map-cache/blob/master/LICENSE). + +*** + +_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on May 10, 2016._ \ No newline at end of file diff --git a/node_modules/map-cache/index.js b/node_modules/map-cache/index.js new file mode 100644 index 000000000..f86842f29 --- /dev/null +++ b/node_modules/map-cache/index.js @@ -0,0 +1,100 @@ +/*! + * map-cache + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var hasOwn = Object.prototype.hasOwnProperty; + +/** + * Expose `MapCache` + */ + +module.exports = MapCache; + +/** + * Creates a cache object to store key/value pairs. + * + * ```js + * var cache = new MapCache(); + * ``` + * + * @api public + */ + +function MapCache(data) { + this.__data__ = data || {}; +} + +/** + * Adds `value` to `key` on the cache. + * + * ```js + * cache.set('foo', 'bar'); + * ``` + * + * @param {String} `key` The key of the value to cache. + * @param {*} `value` The value to cache. + * @returns {Object} Returns the `Cache` object for chaining. + * @api public + */ + +MapCache.prototype.set = function mapSet(key, value) { + if (key !== '__proto__') { + this.__data__[key] = value; + } + return this; +}; + +/** + * Gets the cached value for `key`. + * + * ```js + * cache.get('foo'); + * //=> 'bar' + * ``` + * + * @param {String} `key` The key of the value to get. + * @returns {*} Returns the cached value. + * @api public + */ + +MapCache.prototype.get = function mapGet(key) { + return key === '__proto__' ? undefined : this.__data__[key]; +}; + +/** + * Checks if a cached value for `key` exists. + * + * ```js + * cache.has('foo'); + * //=> true + * ``` + * + * @param {String} `key` The key of the entry to check. + * @returns {Boolean} Returns `true` if an entry for `key` exists, else `false`. + * @api public + */ + +MapCache.prototype.has = function mapHas(key) { + return key !== '__proto__' && hasOwn.call(this.__data__, key); +}; + +/** + * Removes `key` and its value from the cache. + * + * ```js + * cache.del('foo'); + * ``` + * @title .del + * @param {String} `key` The key of the value to remove. + * @returns {Boolean} Returns `true` if the entry was removed successfully, else `false`. + * @api public + */ + +MapCache.prototype.del = function mapDelete(key) { + return this.has(key) && delete this.__data__[key]; +}; diff --git a/node_modules/map-cache/package.json b/node_modules/map-cache/package.json new file mode 100644 index 000000000..d38468417 --- /dev/null +++ b/node_modules/map-cache/package.json @@ -0,0 +1,91 @@ +{ + "_from": "map-cache@^0.2.2", + "_id": "map-cache@0.2.2", + "_inBundle": false, + "_integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "_location": "/map-cache", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "map-cache@^0.2.2", + "name": "map-cache", + "escapedName": "map-cache", + "rawSpec": "^0.2.2", + "saveSpec": null, + "fetchSpec": "^0.2.2" + }, + "_requiredBy": [ + "/fragment-cache", + "/snapdragon" + ], + "_resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "_shasum": "c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf", + "_spec": "map-cache@^0.2.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/snapdragon", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/map-cache/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Basic cache object for storing key-value pairs.", + "devDependencies": { + "gulp-format-md": "^0.1.9", + "should": "^8.3.1" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/map-cache", + "keywords": [ + "cache", + "get", + "has", + "object", + "set", + "storage", + "store" + ], + "license": "MIT", + "main": "index.js", + "name": "map-cache", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/map-cache.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "config-cache", + "option-cache", + "cache-base" + ] + }, + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "0.2.2" +} diff --git a/node_modules/map-limit/LICENSE.md b/node_modules/map-limit/LICENSE.md new file mode 100644 index 000000000..146cb32a7 --- /dev/null +++ b/node_modules/map-limit/LICENSE.md @@ -0,0 +1,21 @@ +## The MIT License (MIT) ## + +Copyright (c) 2014 Hugh Kennedy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/map-limit/README.md b/node_modules/map-limit/README.md new file mode 100644 index 000000000..f0ec5e69e --- /dev/null +++ b/node_modules/map-limit/README.md @@ -0,0 +1,32 @@ +# map-limit [![Flattr this!](https://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=hughskennedy&url=http://github.com/hughsk/map-limit&title=map-limit&description=hughsk/map-limit%20on%20GitHub&language=en_GB&tags=flattr,github,javascript&category=software)[![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges) # + +[async.mapLimit](https://github.com/caolan/async#maplimitarr-limit-iterator-callback)'s +functionality available as a standalone npm module. + +I often find myself pulling in [async](http://github.com/caolan/async) for this +method alone, so in the spirit of breaking things into smaller pieces here's +that method as a single thing you can require. + +## Usage ## + +[![map-limit](https://nodei.co/npm/map-limit.png?mini=true)](https://nodei.co/npm/map-limit) + +### `mapLimit(arr, limit, iterator, callback)` ### + +The same as map only no more than "limit" iterators will be simultaneously +running at any time. + +Note that the items are not processed in batches, so there is no guarantee +that the first "limit" iterator functions will complete before any others are +started. + +#### Arguments #### + +* **arr** - An array to iterate over. +* **limit** - The maximum number of iterators to run at any time. +* **iterator(item, callback)** - A function to apply to each item in the array. The iterator is passed a callback(err, transformed) which must be called once it has completed with an error (which can be null) and a transformed item. +* **callback(err, results)** - A callback which is called after all the iterator functions have finished, or an error has occurred. Results is an array of the transformed items from the original array. + +## License ## + +MIT. See [LICENSE.md](http://github.com/hughsk/map-limit/blob/master/LICENSE.md) for details. diff --git a/node_modules/map-limit/index.js b/node_modules/map-limit/index.js new file mode 100644 index 000000000..7b6e01ab2 --- /dev/null +++ b/node_modules/map-limit/index.js @@ -0,0 +1,54 @@ +var once = require('once') +var noop = function noop(){} + +module.exports = mapLimit + +function mapLimit(arr, limit, iterator, callback) { + var complete = 0 + var aborted = false + var results = [] + var queued = 0 + var l = arr.length + var i = 0 + + callback = once(callback || noop) + if (typeof iterator !== 'function') throw new Error( + 'Iterator function must be passed as the third argument' + ) + + for (var r = 0; r < l; r++) { + results[r] = null + } + + flush() + + function flush() { + if (complete === l) + return callback(null, results) + + while (queued < limit) { + if (aborted) break + if (i === l) break + push() + } + } + + function abort(err) { + aborted = true + return callback(err) + } + + function push() { + var idx = i++ + + queued += 1 + + iterator(arr[idx], function(err, result) { + if (err) return abort(err) + results[idx] = result + complete += 1 + queued -= 1 + flush() + }) + } +} diff --git a/node_modules/map-limit/node_modules/once/LICENSE b/node_modules/map-limit/node_modules/once/LICENSE new file mode 100644 index 000000000..19129e315 --- /dev/null +++ b/node_modules/map-limit/node_modules/once/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/map-limit/node_modules/once/README.md b/node_modules/map-limit/node_modules/once/README.md new file mode 100644 index 000000000..a2981ea07 --- /dev/null +++ b/node_modules/map-limit/node_modules/once/README.md @@ -0,0 +1,51 @@ +# once + +Only call a function once. + +## usage + +```javascript +var once = require('once') + +function load (file, cb) { + cb = once(cb) + loader.load('file') + loader.once('load', cb) + loader.once('error', cb) +} +``` + +Or add to the Function.prototype in a responsible way: + +```javascript +// only has to be done once +require('once').proto() + +function load (file, cb) { + cb = cb.once() + loader.load('file') + loader.once('load', cb) + loader.once('error', cb) +} +``` + +Ironically, the prototype feature makes this module twice as +complicated as necessary. + +To check whether you function has been called, use `fn.called`. Once the +function is called for the first time the return value of the original +function is saved in `fn.value` and subsequent calls will continue to +return this value. + +```javascript +var once = require('once') + +function load (cb) { + cb = once(cb) + var stream = createStream() + stream.once('data', cb) + stream.once('end', function () { + if (!cb.called) cb(new Error('not found')) + }) +} +``` diff --git a/node_modules/map-limit/node_modules/once/once.js b/node_modules/map-limit/node_modules/once/once.js new file mode 100644 index 000000000..2e1e721bf --- /dev/null +++ b/node_modules/map-limit/node_modules/once/once.js @@ -0,0 +1,21 @@ +var wrappy = require('wrappy') +module.exports = wrappy(once) + +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) +}) + +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) + } + f.called = false + return f +} diff --git a/node_modules/map-limit/node_modules/once/package.json b/node_modules/map-limit/node_modules/once/package.json new file mode 100644 index 000000000..067bf8ffa --- /dev/null +++ b/node_modules/map-limit/node_modules/once/package.json @@ -0,0 +1,66 @@ +{ + "_from": "once@~1.3.0", + "_id": "once@1.3.3", + "_inBundle": false, + "_integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", + "_location": "/map-limit/once", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "once@~1.3.0", + "name": "once", + "escapedName": "once", + "rawSpec": "~1.3.0", + "saveSpec": null, + "fetchSpec": "~1.3.0" + }, + "_requiredBy": [ + "/map-limit" + ], + "_resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "_shasum": "b2e261557ce4c314ec8304f3fa82663e4297ca20", + "_spec": "once@~1.3.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/map-limit", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/once/issues" + }, + "bundleDependencies": false, + "dependencies": { + "wrappy": "1" + }, + "deprecated": false, + "description": "Run a function exactly one time", + "devDependencies": { + "tap": "^1.2.0" + }, + "directories": { + "test": "test" + }, + "files": [ + "once.js" + ], + "homepage": "https://github.com/isaacs/once#readme", + "keywords": [ + "once", + "function", + "one", + "single" + ], + "license": "ISC", + "main": "once.js", + "name": "once", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/once.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "1.3.3" +} diff --git a/node_modules/map-limit/package.json b/node_modules/map-limit/package.json new file mode 100644 index 000000000..7fdade65f --- /dev/null +++ b/node_modules/map-limit/package.json @@ -0,0 +1,62 @@ +{ + "_from": "map-limit@0.0.1", + "_id": "map-limit@0.0.1", + "_inBundle": false, + "_integrity": "sha1-63lhAxwPDo0AG/LVb6toXViCLzg=", + "_location": "/map-limit", + "_phantomChildren": { + "wrappy": "1.0.2" + }, + "_requested": { + "type": "version", + "registry": true, + "raw": "map-limit@0.0.1", + "name": "map-limit", + "escapedName": "map-limit", + "rawSpec": "0.0.1", + "saveSpec": null, + "fetchSpec": "0.0.1" + }, + "_requiredBy": [ + "/get-ports" + ], + "_resolved": "https://registry.npmjs.org/map-limit/-/map-limit-0.0.1.tgz", + "_shasum": "eb7961031c0f0e8d001bf2d56fab685d58822f38", + "_spec": "map-limit@0.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/get-ports", + "author": { + "name": "Hugh Kennedy", + "email": "hughskennedy@gmail.com", + "url": "http://hughsk.io/" + }, + "browser": "index.js", + "bugs": { + "url": "https://github.com/hughsk/map-limit/issues" + }, + "bundleDependencies": false, + "dependencies": { + "once": "~1.3.0" + }, + "deprecated": false, + "description": "async.mapLimit's functionality available as a standalone npm module", + "devDependencies": { + "tape": "~2.4.2" + }, + "homepage": "https://github.com/hughsk/map-limit", + "keywords": [ + "async", + "map", + "limit" + ], + "license": "MIT", + "main": "index.js", + "name": "map-limit", + "repository": { + "type": "git", + "url": "git://github.com/hughsk/map-limit.git" + }, + "scripts": { + "test": "node test" + }, + "version": "0.0.1" +} diff --git a/node_modules/map-limit/test.js b/node_modules/map-limit/test.js new file mode 100644 index 000000000..c410ae769 --- /dev/null +++ b/node_modules/map-limit/test.js @@ -0,0 +1,39 @@ +var test = require('tape') +var mapl = require('./') + +test('basic', function(t) { + var items = [1, 2, 3, 4, 5] + var goals = [2, 4, 6, 8,10] + + t.plan(2) + + mapl(items, 5, function(item, next) { + next(null, item * 2) + }, function(err, results) { + t.ifError(err) + t.deepEqual(results, goals) + }) +}) + +test('stalled', function(t) { + var items = [1, 2, 3, 4, 5, 6, 7, 8] + var goals = [2, 4, 6, 8,10,12,14,16] + var n = 0 + + t.plan(6) + + mapl(items, 2, function(item, next) { + setTimeout(function() { + n += 1 + next(null, item * 2) + }, 150) + }, function(err, results) { + t.ifError(err) + t.deepEqual(results, goals) + }) + + setTimeout(function() { t.equal(n, 2) }, 225) + setTimeout(function() { t.equal(n, 4) }, 350) + setTimeout(function() { t.equal(n, 6) }, 475) + setTimeout(function() { t.equal(n, 8) }, 625) +}) diff --git a/node_modules/map-visit/LICENSE b/node_modules/map-visit/LICENSE new file mode 100644 index 000000000..83b56e709 --- /dev/null +++ b/node_modules/map-visit/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/map-visit/README.md b/node_modules/map-visit/README.md new file mode 100644 index 000000000..5ab02d450 --- /dev/null +++ b/node_modules/map-visit/README.md @@ -0,0 +1,155 @@ +# map-visit [![NPM version](https://img.shields.io/npm/v/map-visit.svg?style=flat)](https://www.npmjs.com/package/map-visit) [![NPM monthly downloads](https://img.shields.io/npm/dm/map-visit.svg?style=flat)](https://npmjs.org/package/map-visit) [![NPM total downloads](https://img.shields.io/npm/dt/map-visit.svg?style=flat)](https://npmjs.org/package/map-visit) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/map-visit.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/map-visit) + +> Map `visit` over an array of objects. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save map-visit +``` + +## Usage + +```js +var mapVisit = require('map-visit'); +``` + +## What does this do? + +**Assign/Merge/Extend vs. Visit** + +Let's say you want to add a `set` method to your application that will: + +* set key-value pairs on a `data` object +* extend objects onto the `data` object +* extend arrays of objects onto the data object + +**Example using `extend`** + +Here is one way to accomplish this using Lo-Dash's `extend` (comparable to `Object.assign`): + +```js +var _ = require('lodash'); + +var obj = { + data: {}, + set: function (key, value) { + if (Array.isArray(key)) { + _.extend.apply(_, [obj.data].concat(key)); + } else if (typeof key === 'object') { + _.extend(obj.data, key); + } else { + obj.data[key] = value; + } + } +}; + +obj.set('a', 'a'); +obj.set([{b: 'b'}, {c: 'c'}]); +obj.set({d: {e: 'f'}}); + +console.log(obj.data); +//=> {a: 'a', b: 'b', c: 'c', d: { e: 'f' }} +``` + +The above approach works fine for most use cases. However, **if you also want to emit an event** each time a property is added to the `data` object, or you want more control over what happens as the object is extended, a better approach would be to use `visit`. + +**Example using `visit`** + +In this approach: + +* when an array is passed to `set`, the `mapVisit` library calls the `set` method on each object in the array. +* when an object is passed, `visit` calls `set` on each property in the object. + +As a result, the `data` event will be emitted every time a property is added to `data` (events are just an example, you can use this approach to perform any necessary logic every time the method is called). + +```js +var mapVisit = require('map-visit'); +var visit = require('object-visit'); + +var obj = { + data: {}, + set: function (key, value) { + if (Array.isArray(key)) { + mapVisit(obj, 'set', key); + } else if (typeof key === 'object') { + visit(obj, 'set', key); + } else { + // simulate an event-emitter + console.log('emit', key, value); + obj.data[key] = value; + } + } +}; + +obj.set('a', 'a'); +obj.set([{b: 'b'}, {c: 'c'}]); +obj.set({d: {e: 'f'}}); +obj.set({g: 'h', i: 'j', k: 'l'}); + +console.log(obj.data); +//=> {a: 'a', b: 'b', c: 'c', d: { e: 'f' }, g: 'h', i: 'j', k: 'l'} + +// events would look something like: +// emit a a +// emit b b +// emit c c +// emit d { e: 'f' } +// emit g h +// emit i j +// emit k l +``` + +## About + +### Related projects + +* [collection-visit](https://www.npmjs.com/package/collection-visit): Visit a method over the items in an object, or map visit over the objects… [more](https://github.com/jonschlinkert/collection-visit) | [homepage](https://github.com/jonschlinkert/collection-visit "Visit a method over the items in an object, or map visit over the objects in an array.") +* [object-visit](https://www.npmjs.com/package/object-visit): Call a specified method on each value in the given object. | [homepage](https://github.com/jonschlinkert/object-visit "Call a specified method on each value in the given object.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 15 | [jonschlinkert](https://github.com/jonschlinkert) | +| 7 | [doowb](https://github.com/doowb) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 09, 2017._ \ No newline at end of file diff --git a/node_modules/map-visit/index.js b/node_modules/map-visit/index.js new file mode 100644 index 000000000..bc54ccc4e --- /dev/null +++ b/node_modules/map-visit/index.js @@ -0,0 +1,37 @@ +'use strict'; + +var util = require('util'); +var visit = require('object-visit'); + +/** + * Map `visit` over an array of objects. + * + * @param {Object} `collection` The context in which to invoke `method` + * @param {String} `method` Name of the method to call on `collection` + * @param {Object} `arr` Array of objects. + */ + +module.exports = function mapVisit(collection, method, val) { + if (isObject(val)) { + return visit.apply(null, arguments); + } + + if (!Array.isArray(val)) { + throw new TypeError('expected an array: ' + util.inspect(val)); + } + + var args = [].slice.call(arguments, 3); + + for (var i = 0; i < val.length; i++) { + var ele = val[i]; + if (isObject(ele)) { + visit.apply(null, [collection, method, ele].concat(args)); + } else { + collection[method].apply(collection, [ele].concat(args)); + } + } +}; + +function isObject(val) { + return val && (typeof val === 'function' || (!Array.isArray(val) && typeof val === 'object')); +} diff --git a/node_modules/map-visit/package.json b/node_modules/map-visit/package.json new file mode 100644 index 000000000..d02c0b21c --- /dev/null +++ b/node_modules/map-visit/package.json @@ -0,0 +1,113 @@ +{ + "_from": "map-visit@^1.0.0", + "_id": "map-visit@1.0.0", + "_inBundle": false, + "_integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "_location": "/map-visit", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "map-visit@^1.0.0", + "name": "map-visit", + "escapedName": "map-visit", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/collection-visit" + ], + "_resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "_shasum": "ecdca8f13144e660f1b5bd41f12f3479d98dfb8f", + "_spec": "map-visit@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/collection-visit", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/map-visit/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Brian Woodward", + "email": "brian.woodward@gmail.com", + "url": "https://twitter.com/doowb" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + } + ], + "dependencies": { + "object-visit": "^1.0.0" + }, + "deprecated": false, + "description": "Map `visit` over an array of objects.", + "devDependencies": { + "clone-deep": "^0.2.4", + "extend-shallow": "^2.0.1", + "gulp-format-md": "^0.1.12", + "lodash": "^4.17.4", + "mocha": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/map-visit", + "keywords": [ + "array", + "arrays", + "function", + "helper", + "invoke", + "key", + "map", + "method", + "object", + "objects", + "value", + "visit", + "visitor" + ], + "license": "MIT", + "main": "index.js", + "name": "map-visit", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/map-visit.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "related": { + "list": [ + "collection-visit", + "object-visit" + ] + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ] + }, + "version": "1.0.0" +} diff --git a/node_modules/math-random/.npmignore b/node_modules/math-random/.npmignore new file mode 100644 index 000000000..8d87b1d26 --- /dev/null +++ b/node_modules/math-random/.npmignore @@ -0,0 +1 @@ +node_modules/* diff --git a/node_modules/math-random/.travis.yml b/node_modules/math-random/.travis.yml new file mode 100644 index 000000000..054c803eb --- /dev/null +++ b/node_modules/math-random/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: + - "6" + - "4" + - "0.12" + - "0.10" diff --git a/node_modules/math-random/browser.js b/node_modules/math-random/browser.js new file mode 100644 index 000000000..cde412ed0 --- /dev/null +++ b/node_modules/math-random/browser.js @@ -0,0 +1,17 @@ +module.exports = (function (global) { + var uint32 = 'Uint32Array' in global + var crypto = global.crypto || global.msCrypto + var rando = crypto && typeof crypto.getRandomValues === 'function' + var good = uint32 && crypto && rando + if (!good) return Math.random + + var arr = new Uint32Array(1) + var max = Math.pow(2, 32) + function random () { + crypto.getRandomValues(arr) + return arr[0] / max + } + + random.cryptographic = true + return random +})(typeof self !== 'undefined' ? self : window) diff --git a/node_modules/math-random/node.js b/node_modules/math-random/node.js new file mode 100644 index 000000000..da6783ebe --- /dev/null +++ b/node_modules/math-random/node.js @@ -0,0 +1,13 @@ +var crypto = require('crypto') +var max = Math.pow(2, 32) + +module.exports = random +module.exports.cryptographic = true + +function random () { + var buf = crypto + .randomBytes(4) + .toString('hex') + + return parseInt(buf, 16) / max +} diff --git a/node_modules/math-random/package.json b/node_modules/math-random/package.json new file mode 100644 index 000000000..9e80f3b83 --- /dev/null +++ b/node_modules/math-random/package.json @@ -0,0 +1,58 @@ +{ + "_from": "math-random@^1.0.1", + "_id": "math-random@1.0.1", + "_inBundle": false, + "_integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", + "_location": "/math-random", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "math-random@^1.0.1", + "name": "math-random", + "escapedName": "math-random", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/randomatic" + ], + "_resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", + "_shasum": "8b3aac588b8a66e4975e3cdea67f7bb329601fac", + "_spec": "math-random@^1.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/randomatic", + "author": { + "name": "Michael Rhodes" + }, + "browser": "browser.js", + "bugs": { + "url": "https://github.com/michaelrhodes/math-random/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "a drop-in replacement for Math.random that uses cryptographically secure random number generation, where available", + "devDependencies": { + "array-unique": "~0.2.1", + "tape": "~4.2.2" + }, + "homepage": "https://github.com/michaelrhodes/math-random", + "keywords": [ + "Math.random", + "crypto.getRandomValues" + ], + "license": "MIT", + "main": "node.js", + "name": "math-random", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/michaelrhodes/math-random.git" + }, + "scripts": { + "test": "tape test.js" + }, + "testling": { + "files": "test.js" + }, + "version": "1.0.1" +} diff --git a/node_modules/math-random/readme.md b/node_modules/math-random/readme.md new file mode 100644 index 000000000..17beb7068 --- /dev/null +++ b/node_modules/math-random/readme.md @@ -0,0 +1,26 @@ +# math-random + +math-random is an drop-in replacement for Math.random that uses cryptographically secure random number generation, where available. It works in both browser and node environments. + +[![Build status](https://travis-ci.org/michaelrhodes/math-random.svg?branch=master)](https://travis-ci.org/michaelrhodes/math-random) + +## Install + +```sh +npm install math-random +``` + +### Usage + +```js +var random = require('math-random') + +console.log(random()) +=> 0.584293719381094 + +console.log(random.cryptographic) +=> true || undefined +``` + +### License +[MIT](http://opensource.org/licenses/MIT) diff --git a/node_modules/math-random/test.js b/node_modules/math-random/test.js new file mode 100644 index 000000000..b7706b7df --- /dev/null +++ b/node_modules/math-random/test.js @@ -0,0 +1,26 @@ +var test = require('tape') +var unique = require('array-unique') +var random = require('./') + +test('it works', function (assert) { + var number, l = 1000, cache = [] + + for (var i = 0; i < l; i++) { + number = random() + if (number <= 0) { + assert.fail('a random number was less than or equal to zero') + assert.end() + return + } + if (number >= 1) { + assert.fail('a random number was greater than or equal to one') + assert.end() + return + } + cache.push(number) + } + + assert.pass('all ' + l + ' random numbers were greater than zero and less than one') + assert.equal(cache.length, unique(cache).length, 'all ' + l + ' random numbers were unique') + assert.end() +}) diff --git a/node_modules/md5.js/LICENSE b/node_modules/md5.js/LICENSE new file mode 100644 index 000000000..6f02ae800 --- /dev/null +++ b/node_modules/md5.js/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Kirill Fomichev + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/md5.js/README.md b/node_modules/md5.js/README.md new file mode 100644 index 000000000..36316e1b3 --- /dev/null +++ b/node_modules/md5.js/README.md @@ -0,0 +1,29 @@ +# md5.js + +[![NPM Package](https://img.shields.io/npm/v/md5.js.svg?style=flat-square)](https://www.npmjs.org/package/md5.js) +[![Build Status](https://img.shields.io/travis/crypto-browserify/md5.js.svg?branch=master&style=flat-square)](https://travis-ci.org/crypto-browserify/md5.js) +[![Dependency status](https://img.shields.io/david/crypto-browserify/md5.js.svg?style=flat-square)](https://david-dm.org/crypto-browserify/md5.js#info=dependencies) + +[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) + +Node style `md5` on pure JavaScript. + +From [NIST SP 800-131A][1]: *md5 is no longer acceptable where collision resistance is required such as digital signatures.* + +## Example + +```js +var MD5 = require('md5.js') + +console.log(new MD5().update('42').digest('hex')) +// => a1d0c6e83f027327d8461063f4ac58a6 + +var md5stream = new MD5() +md5stream.end('42') +console.log(md5stream.read().toString('hex')) +// => a1d0c6e83f027327d8461063f4ac58a6 +``` + +## LICENSE [MIT](LICENSE) + +[1]: http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar1.pdf diff --git a/node_modules/md5.js/index.js b/node_modules/md5.js/index.js new file mode 100644 index 000000000..cbfa2e378 --- /dev/null +++ b/node_modules/md5.js/index.js @@ -0,0 +1,146 @@ +'use strict' +var inherits = require('inherits') +var HashBase = require('hash-base') +var Buffer = require('safe-buffer').Buffer + +var ARRAY16 = new Array(16) + +function MD5 () { + HashBase.call(this, 64) + + // state + this._a = 0x67452301 + this._b = 0xefcdab89 + this._c = 0x98badcfe + this._d = 0x10325476 +} + +inherits(MD5, HashBase) + +MD5.prototype._update = function () { + var M = ARRAY16 + for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4) + + var a = this._a + var b = this._b + var c = this._c + var d = this._d + + a = fnF(a, b, c, d, M[0], 0xd76aa478, 7) + d = fnF(d, a, b, c, M[1], 0xe8c7b756, 12) + c = fnF(c, d, a, b, M[2], 0x242070db, 17) + b = fnF(b, c, d, a, M[3], 0xc1bdceee, 22) + a = fnF(a, b, c, d, M[4], 0xf57c0faf, 7) + d = fnF(d, a, b, c, M[5], 0x4787c62a, 12) + c = fnF(c, d, a, b, M[6], 0xa8304613, 17) + b = fnF(b, c, d, a, M[7], 0xfd469501, 22) + a = fnF(a, b, c, d, M[8], 0x698098d8, 7) + d = fnF(d, a, b, c, M[9], 0x8b44f7af, 12) + c = fnF(c, d, a, b, M[10], 0xffff5bb1, 17) + b = fnF(b, c, d, a, M[11], 0x895cd7be, 22) + a = fnF(a, b, c, d, M[12], 0x6b901122, 7) + d = fnF(d, a, b, c, M[13], 0xfd987193, 12) + c = fnF(c, d, a, b, M[14], 0xa679438e, 17) + b = fnF(b, c, d, a, M[15], 0x49b40821, 22) + + a = fnG(a, b, c, d, M[1], 0xf61e2562, 5) + d = fnG(d, a, b, c, M[6], 0xc040b340, 9) + c = fnG(c, d, a, b, M[11], 0x265e5a51, 14) + b = fnG(b, c, d, a, M[0], 0xe9b6c7aa, 20) + a = fnG(a, b, c, d, M[5], 0xd62f105d, 5) + d = fnG(d, a, b, c, M[10], 0x02441453, 9) + c = fnG(c, d, a, b, M[15], 0xd8a1e681, 14) + b = fnG(b, c, d, a, M[4], 0xe7d3fbc8, 20) + a = fnG(a, b, c, d, M[9], 0x21e1cde6, 5) + d = fnG(d, a, b, c, M[14], 0xc33707d6, 9) + c = fnG(c, d, a, b, M[3], 0xf4d50d87, 14) + b = fnG(b, c, d, a, M[8], 0x455a14ed, 20) + a = fnG(a, b, c, d, M[13], 0xa9e3e905, 5) + d = fnG(d, a, b, c, M[2], 0xfcefa3f8, 9) + c = fnG(c, d, a, b, M[7], 0x676f02d9, 14) + b = fnG(b, c, d, a, M[12], 0x8d2a4c8a, 20) + + a = fnH(a, b, c, d, M[5], 0xfffa3942, 4) + d = fnH(d, a, b, c, M[8], 0x8771f681, 11) + c = fnH(c, d, a, b, M[11], 0x6d9d6122, 16) + b = fnH(b, c, d, a, M[14], 0xfde5380c, 23) + a = fnH(a, b, c, d, M[1], 0xa4beea44, 4) + d = fnH(d, a, b, c, M[4], 0x4bdecfa9, 11) + c = fnH(c, d, a, b, M[7], 0xf6bb4b60, 16) + b = fnH(b, c, d, a, M[10], 0xbebfbc70, 23) + a = fnH(a, b, c, d, M[13], 0x289b7ec6, 4) + d = fnH(d, a, b, c, M[0], 0xeaa127fa, 11) + c = fnH(c, d, a, b, M[3], 0xd4ef3085, 16) + b = fnH(b, c, d, a, M[6], 0x04881d05, 23) + a = fnH(a, b, c, d, M[9], 0xd9d4d039, 4) + d = fnH(d, a, b, c, M[12], 0xe6db99e5, 11) + c = fnH(c, d, a, b, M[15], 0x1fa27cf8, 16) + b = fnH(b, c, d, a, M[2], 0xc4ac5665, 23) + + a = fnI(a, b, c, d, M[0], 0xf4292244, 6) + d = fnI(d, a, b, c, M[7], 0x432aff97, 10) + c = fnI(c, d, a, b, M[14], 0xab9423a7, 15) + b = fnI(b, c, d, a, M[5], 0xfc93a039, 21) + a = fnI(a, b, c, d, M[12], 0x655b59c3, 6) + d = fnI(d, a, b, c, M[3], 0x8f0ccc92, 10) + c = fnI(c, d, a, b, M[10], 0xffeff47d, 15) + b = fnI(b, c, d, a, M[1], 0x85845dd1, 21) + a = fnI(a, b, c, d, M[8], 0x6fa87e4f, 6) + d = fnI(d, a, b, c, M[15], 0xfe2ce6e0, 10) + c = fnI(c, d, a, b, M[6], 0xa3014314, 15) + b = fnI(b, c, d, a, M[13], 0x4e0811a1, 21) + a = fnI(a, b, c, d, M[4], 0xf7537e82, 6) + d = fnI(d, a, b, c, M[11], 0xbd3af235, 10) + c = fnI(c, d, a, b, M[2], 0x2ad7d2bb, 15) + b = fnI(b, c, d, a, M[9], 0xeb86d391, 21) + + this._a = (this._a + a) | 0 + this._b = (this._b + b) | 0 + this._c = (this._c + c) | 0 + this._d = (this._d + d) | 0 +} + +MD5.prototype._digest = function () { + // create padding and handle blocks + this._block[this._blockOffset++] = 0x80 + if (this._blockOffset > 56) { + this._block.fill(0, this._blockOffset, 64) + this._update() + this._blockOffset = 0 + } + + this._block.fill(0, this._blockOffset, 56) + this._block.writeUInt32LE(this._length[0], 56) + this._block.writeUInt32LE(this._length[1], 60) + this._update() + + // produce result + var buffer = Buffer.allocUnsafe(16) + buffer.writeInt32LE(this._a, 0) + buffer.writeInt32LE(this._b, 4) + buffer.writeInt32LE(this._c, 8) + buffer.writeInt32LE(this._d, 12) + return buffer +} + +function rotl (x, n) { + return (x << n) | (x >>> (32 - n)) +} + +function fnF (a, b, c, d, m, k, s) { + return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + b) | 0 +} + +function fnG (a, b, c, d, m, k, s) { + return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + b) | 0 +} + +function fnH (a, b, c, d, m, k, s) { + return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + b) | 0 +} + +function fnI (a, b, c, d, m, k, s) { + return (rotl((a + ((c ^ (b | (~d)))) + m + k) | 0, s) + b) | 0 +} + +module.exports = MD5 diff --git a/node_modules/md5.js/package.json b/node_modules/md5.js/package.json new file mode 100644 index 000000000..ba5341dbd --- /dev/null +++ b/node_modules/md5.js/package.json @@ -0,0 +1,68 @@ +{ + "_from": "md5.js@^1.3.4", + "_id": "md5.js@1.3.5", + "_inBundle": false, + "_integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "_location": "/md5.js", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "md5.js@^1.3.4", + "name": "md5.js", + "escapedName": "md5.js", + "rawSpec": "^1.3.4", + "saveSpec": null, + "fetchSpec": "^1.3.4" + }, + "_requiredBy": [ + "/create-hash", + "/evp_bytestokey" + ], + "_resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "_shasum": "b5d07b8e3216e3e27cd728d72f70d1e6a342005f", + "_spec": "md5.js@^1.3.4", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/create-hash", + "author": { + "name": "Kirill Fomichev", + "email": "fanatid@ya.ru", + "url": "https://github.com/fanatid" + }, + "bugs": { + "url": "https://github.com/crypto-browserify/md5.js/issues" + }, + "bundleDependencies": false, + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + }, + "deprecated": false, + "description": "node style md5 on pure JavaScript", + "devDependencies": { + "hash-test-vectors": "^1.3.2", + "standard": "^7.0.0", + "tape": "^4.2.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/crypto-browserify/md5.js", + "keywords": [ + "crypto", + "md5" + ], + "license": "MIT", + "main": "index.js", + "name": "md5.js", + "repository": { + "type": "git", + "url": "git+https://github.com/crypto-browserify/md5.js.git" + }, + "scripts": { + "lint": "standard", + "test": "npm run lint && npm run unit", + "unit": "node test/*.js" + }, + "version": "1.3.5" +} diff --git a/node_modules/md5/.npmignore b/node_modules/md5/.npmignore new file mode 100644 index 000000000..d5d9f0f4b --- /dev/null +++ b/node_modules/md5/.npmignore @@ -0,0 +1 @@ +node_modules/mocha diff --git a/node_modules/md5/.travis.yml b/node_modules/md5/.travis.yml new file mode 100644 index 000000000..811124587 --- /dev/null +++ b/node_modules/md5/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.6 + - 0.8 \ No newline at end of file diff --git a/node_modules/md5/LICENSE b/node_modules/md5/LICENSE new file mode 100644 index 000000000..f476d11e7 --- /dev/null +++ b/node_modules/md5/LICENSE @@ -0,0 +1,27 @@ +Copyright © 2011-2012, Paul Vorbach. +Copyright © 2009, Jeff Mott. + +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 Crypto-JS 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 HOLDER 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. diff --git a/node_modules/md5/README.md b/node_modules/md5/README.md new file mode 100644 index 000000000..c449a333c --- /dev/null +++ b/node_modules/md5/README.md @@ -0,0 +1,108 @@ +# MD5 + +[![build status](https://secure.travis-ci.org/pvorb/node-md5.png)](http://travis-ci.org/pvorb/node-md5) + +a JavaScript function for hashing messages with MD5. + +## Installation + +You can use this package on the server side as well as the client side. + +### [Node.js](http://nodejs.org/): + +~~~ +npm install md5 +~~~ + + +## API + +~~~ javascript +md5(message) +~~~ + + * `message` -- `String` or `Buffer` + * returns `String` + + +## Usage + +~~~ javascript +var md5 = require('md5'); + +console.log(md5('message')); +~~~ + +This will print the following + +~~~ +78e731027d8fd50ed642340b7c9a63b3 +~~~ + +It supports buffers, too + +~~~ javascript +var fs = require('fs'); +var md5 = require('md5'); + +fs.readFile('example.txt', function(err, buf) { + console.log(md5(buf)); +}); +~~~ + +## Versions + +Before version 2.0.0 there were two packages called md5 on npm, one lowercase, +one uppercase (the one you're looking at). As of version 2.0.0, all new versions +of this module will go to lowercase [md5](https://www.npmjs.com/package/md5) on +npm. To use the correct version, users of this module will have to change their +code from `require('MD5')` to `require('md5')` if they want to use versions >= +2.0.0. + + +## Bugs and Issues + +If you encounter any bugs or issues, feel free to open an issue at +[github](https://github.com/pvorb/node-md5/issues). + + +## Credits + +This package is based on the work of Jeff Mott, who did a pure JS implementation +of the MD5 algorithm that was published by Ronald L. Rivest in 1991. I needed a +npm package of the algorithm, so I used Jeff’s implementation for this package. +The original implementation can be found in the +[CryptoJS](http://code.google.com/p/crypto-js/) project. + + +## License + +~~~ +Copyright © 2011-2015, Paul Vorbach. +Copyright © 2009, Jeff Mott. + +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 Crypto-JS 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 HOLDER 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. +~~~ diff --git a/node_modules/md5/md5.js b/node_modules/md5/md5.js new file mode 100644 index 000000000..e20b1f717 --- /dev/null +++ b/node_modules/md5/md5.js @@ -0,0 +1,160 @@ +(function(){ + var crypt = require('crypt'), + utf8 = require('charenc').utf8, + isBuffer = require('is-buffer'), + bin = require('charenc').bin, + + // The core + md5 = function (message, options) { + // Convert to byte array + if (message.constructor == String) + if (options && options.encoding === 'binary') + message = bin.stringToBytes(message); + else + message = utf8.stringToBytes(message); + else if (isBuffer(message)) + message = Array.prototype.slice.call(message, 0); + else if (!Array.isArray(message)) + message = message.toString(); + // else, assume byte array already + + var m = crypt.bytesToWords(message), + l = message.length * 8, + a = 1732584193, + b = -271733879, + c = -1732584194, + d = 271733878; + + // Swap endian + for (var i = 0; i < m.length; i++) { + m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF | + ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00; + } + + // Padding + m[l >>> 5] |= 0x80 << (l % 32); + m[(((l + 64) >>> 9) << 4) + 14] = l; + + // Method shortcuts + var FF = md5._ff, + GG = md5._gg, + HH = md5._hh, + II = md5._ii; + + for (var i = 0; i < m.length; i += 16) { + + var aa = a, + bb = b, + cc = c, + dd = d; + + a = FF(a, b, c, d, m[i+ 0], 7, -680876936); + d = FF(d, a, b, c, m[i+ 1], 12, -389564586); + c = FF(c, d, a, b, m[i+ 2], 17, 606105819); + b = FF(b, c, d, a, m[i+ 3], 22, -1044525330); + a = FF(a, b, c, d, m[i+ 4], 7, -176418897); + d = FF(d, a, b, c, m[i+ 5], 12, 1200080426); + c = FF(c, d, a, b, m[i+ 6], 17, -1473231341); + b = FF(b, c, d, a, m[i+ 7], 22, -45705983); + a = FF(a, b, c, d, m[i+ 8], 7, 1770035416); + d = FF(d, a, b, c, m[i+ 9], 12, -1958414417); + c = FF(c, d, a, b, m[i+10], 17, -42063); + b = FF(b, c, d, a, m[i+11], 22, -1990404162); + a = FF(a, b, c, d, m[i+12], 7, 1804603682); + d = FF(d, a, b, c, m[i+13], 12, -40341101); + c = FF(c, d, a, b, m[i+14], 17, -1502002290); + b = FF(b, c, d, a, m[i+15], 22, 1236535329); + + a = GG(a, b, c, d, m[i+ 1], 5, -165796510); + d = GG(d, a, b, c, m[i+ 6], 9, -1069501632); + c = GG(c, d, a, b, m[i+11], 14, 643717713); + b = GG(b, c, d, a, m[i+ 0], 20, -373897302); + a = GG(a, b, c, d, m[i+ 5], 5, -701558691); + d = GG(d, a, b, c, m[i+10], 9, 38016083); + c = GG(c, d, a, b, m[i+15], 14, -660478335); + b = GG(b, c, d, a, m[i+ 4], 20, -405537848); + a = GG(a, b, c, d, m[i+ 9], 5, 568446438); + d = GG(d, a, b, c, m[i+14], 9, -1019803690); + c = GG(c, d, a, b, m[i+ 3], 14, -187363961); + b = GG(b, c, d, a, m[i+ 8], 20, 1163531501); + a = GG(a, b, c, d, m[i+13], 5, -1444681467); + d = GG(d, a, b, c, m[i+ 2], 9, -51403784); + c = GG(c, d, a, b, m[i+ 7], 14, 1735328473); + b = GG(b, c, d, a, m[i+12], 20, -1926607734); + + a = HH(a, b, c, d, m[i+ 5], 4, -378558); + d = HH(d, a, b, c, m[i+ 8], 11, -2022574463); + c = HH(c, d, a, b, m[i+11], 16, 1839030562); + b = HH(b, c, d, a, m[i+14], 23, -35309556); + a = HH(a, b, c, d, m[i+ 1], 4, -1530992060); + d = HH(d, a, b, c, m[i+ 4], 11, 1272893353); + c = HH(c, d, a, b, m[i+ 7], 16, -155497632); + b = HH(b, c, d, a, m[i+10], 23, -1094730640); + a = HH(a, b, c, d, m[i+13], 4, 681279174); + d = HH(d, a, b, c, m[i+ 0], 11, -358537222); + c = HH(c, d, a, b, m[i+ 3], 16, -722521979); + b = HH(b, c, d, a, m[i+ 6], 23, 76029189); + a = HH(a, b, c, d, m[i+ 9], 4, -640364487); + d = HH(d, a, b, c, m[i+12], 11, -421815835); + c = HH(c, d, a, b, m[i+15], 16, 530742520); + b = HH(b, c, d, a, m[i+ 2], 23, -995338651); + + a = II(a, b, c, d, m[i+ 0], 6, -198630844); + d = II(d, a, b, c, m[i+ 7], 10, 1126891415); + c = II(c, d, a, b, m[i+14], 15, -1416354905); + b = II(b, c, d, a, m[i+ 5], 21, -57434055); + a = II(a, b, c, d, m[i+12], 6, 1700485571); + d = II(d, a, b, c, m[i+ 3], 10, -1894986606); + c = II(c, d, a, b, m[i+10], 15, -1051523); + b = II(b, c, d, a, m[i+ 1], 21, -2054922799); + a = II(a, b, c, d, m[i+ 8], 6, 1873313359); + d = II(d, a, b, c, m[i+15], 10, -30611744); + c = II(c, d, a, b, m[i+ 6], 15, -1560198380); + b = II(b, c, d, a, m[i+13], 21, 1309151649); + a = II(a, b, c, d, m[i+ 4], 6, -145523070); + d = II(d, a, b, c, m[i+11], 10, -1120210379); + c = II(c, d, a, b, m[i+ 2], 15, 718787259); + b = II(b, c, d, a, m[i+ 9], 21, -343485551); + + a = (a + aa) >>> 0; + b = (b + bb) >>> 0; + c = (c + cc) >>> 0; + d = (d + dd) >>> 0; + } + + return crypt.endian([a, b, c, d]); + }; + + // Auxiliary functions + md5._ff = function (a, b, c, d, x, s, t) { + var n = a + (b & c | ~b & d) + (x >>> 0) + t; + return ((n << s) | (n >>> (32 - s))) + b; + }; + md5._gg = function (a, b, c, d, x, s, t) { + var n = a + (b & d | c & ~d) + (x >>> 0) + t; + return ((n << s) | (n >>> (32 - s))) + b; + }; + md5._hh = function (a, b, c, d, x, s, t) { + var n = a + (b ^ c ^ d) + (x >>> 0) + t; + return ((n << s) | (n >>> (32 - s))) + b; + }; + md5._ii = function (a, b, c, d, x, s, t) { + var n = a + (c ^ (b | ~d)) + (x >>> 0) + t; + return ((n << s) | (n >>> (32 - s))) + b; + }; + + // Package private blocksize + md5._blocksize = 16; + md5._digestsize = 16; + + module.exports = function (message, options) { + if (message === undefined || message === null) + throw new Error('Illegal argument ' + message); + + var digestbytes = crypt.wordsToBytes(md5(message, options)); + return options && options.asBytes ? digestbytes : + options && options.asString ? bin.bytesToString(digestbytes) : + crypt.bytesToHex(digestbytes); + }; + +})(); diff --git a/node_modules/md5/package.json b/node_modules/md5/package.json new file mode 100644 index 000000000..6440e11d6 --- /dev/null +++ b/node_modules/md5/package.json @@ -0,0 +1,68 @@ +{ + "_from": "md5@^2.2.1", + "_id": "md5@2.2.1", + "_inBundle": false, + "_integrity": "sha1-U6s41f48iJG6RlMp6iP6wFQBJvk=", + "_location": "/md5", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "md5@^2.2.1", + "name": "md5", + "escapedName": "md5", + "rawSpec": "^2.2.1", + "saveSpec": null, + "fetchSpec": "^2.2.1" + }, + "_requiredBy": [ + "/pem" + ], + "_resolved": "https://registry.npmjs.org/md5/-/md5-2.2.1.tgz", + "_shasum": "53ab38d5fe3c8891ba465329ea23fac0540126f9", + "_spec": "md5@^2.2.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/pem", + "author": { + "name": "Paul Vorbach", + "email": "paul@vorba.ch", + "url": "http://paul.vorba.ch" + }, + "bugs": { + "url": "https://github.com/pvorb/node-md5/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "salba" + } + ], + "dependencies": { + "charenc": "~0.0.1", + "crypt": "~0.0.1", + "is-buffer": "~1.1.1" + }, + "deprecated": false, + "description": "js function for hashing messages with MD5", + "devDependencies": { + "mocha": "~2.3.4" + }, + "homepage": "https://github.com/pvorb/node-md5#readme", + "license": "BSD-3-Clause", + "main": "md5.js", + "name": "md5", + "optionalDependencies": {}, + "repository": { + "type": "git", + "url": "git://github.com/pvorb/node-md5.git" + }, + "scripts": { + "test": "mocha" + }, + "tags": [ + "md5", + "hash", + "encryption", + "message digest" + ], + "version": "2.2.1" +} diff --git a/node_modules/md5/test.js b/node_modules/md5/test.js new file mode 100644 index 000000000..db6378bfc --- /dev/null +++ b/node_modules/md5/test.js @@ -0,0 +1,45 @@ +var md5 = require('./md5.js'); +var assert = require('assert'); + +describe('md5', function () { + + it('should throw an error for `undefined`', function() { + assert.throws(function() { + md5(undefined); + }); + }); + + it('should throw an error for `null`', function() { + assert.throws(function() { + md5(null); + }); + }); + + it('should return the expected MD5 hash for "message"', function() { + assert.equal('78e731027d8fd50ed642340b7c9a63b3', md5('message')); + }); + + it('should not return the same hash for random numbers twice', function() { + var msg1 = Math.floor((Math.random() * 100000) + 1) + (new Date).getTime(); + var msg2 = Math.floor((Math.random() * 100000) + 1) + (new Date).getTime(); + + if (msg1 !== msg2) { + assert.notEqual(md5(msg1), md5(msg2)); + } else { + assert.equal(md5(msg1), md5(msg1)); + } + }); + + it('should support Node.js Buffers', function() { + var buffer = new Buffer('message áßäöü', 'utf8'); + + assert.equal(md5(buffer), md5('message áßäöü')); + }) + + it('should be able to use a binary encoded string', function() { + var hash1 = md5('abc', { asString: true }); + var hash2 = md5(hash1 + 'a', { asString: true, encoding : 'binary' }); + var hash3 = md5(hash1 + 'a', { encoding : 'binary' }); + assert.equal(hash3, '131f0ac52813044f5110e4aec638c169'); + }); +}); diff --git a/node_modules/micromatch/LICENSE b/node_modules/micromatch/LICENSE new file mode 100755 index 000000000..fa30c4cb3 --- /dev/null +++ b/node_modules/micromatch/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/micromatch/README.md b/node_modules/micromatch/README.md new file mode 100644 index 000000000..8fb391910 --- /dev/null +++ b/node_modules/micromatch/README.md @@ -0,0 +1,689 @@ +# micromatch [![NPM version](https://img.shields.io/npm/v/micromatch.svg?style=flat)](https://www.npmjs.com/package/micromatch) [![NPM downloads](https://img.shields.io/npm/dm/micromatch.svg?style=flat)](https://npmjs.org/package/micromatch) [![Build Status](https://img.shields.io/travis/jonschlinkert/micromatch.svg?style=flat)](https://travis-ci.org/jonschlinkert/micromatch) + +> Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. + +Micromatch supports all of the same matching features as [minimatch](https://github.com/isaacs/minimatch) and [multimatch](https://github.com/sindresorhus/multimatch). + +* [mm()](#usage) is the same as [multimatch()](https://github.com/sindresorhus/multimatch) +* [mm.match()](#match) is the same as [minimatch.match()](https://github.com/isaacs/minimatch) +* use [mm.isMatch()](#ismatch) instead of [minimatch()](https://github.com/isaacs/minimatch) + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save micromatch +``` + +## Start matching! + +```js +var mm = require('micromatch'); +console.log(mm([''])) +``` + +*** + +### Features + +* [Drop-in replacement](#switch-from-minimatch) for [minimatch](https://github.com/isaacs/minimatch) and [multimatch](https://github.com/sindresorhus/multimatch) +* Built-in support for multiple glob patterns, like `['foo/*.js', '!bar.js']` +* [Brace Expansion](https://github.com/jonschlinkert/braces) (`foo/bar-{1..5}.md`, `one/{two,three}/four.md`) +* Typical glob patterns, like `**/*`, `a/b/*.js`, or `['foo/*.js', '!bar.js']` +* Methods like `.isMatch()`, `.contains()` and `.any()` + +**Extended globbing features:** + +* Logical `OR` (`foo/bar/(abc|xyz).js`) +* Regex character classes (`foo/bar/baz-[1-5].js`) +* POSIX [bracket expressions](https://github.com/jonschlinkert/expand-brackets) (`**/[[:alpha:][:digit:]]/`) +* [extglobs](https://github.com/jonschlinkert/extglob) (`**/+(x|y)`, `!(a|b)`, etc). + +You can combine these to create whatever matching patterns you need. + +**Example** + +```js +// double-negation! +mm(['fa', 'fb', 'f', 'fo'], '!(f!(o))'); +//=> ['fo'] +``` + +## Why switch to micromatch? + +* Native support for multiple glob patterns, no need for wrappers like [multimatch](https://github.com/sindresorhus/multimatch) +* [10-55x faster](#benchmarks) and more performant than [minimatch](https://github.com/isaacs/minimatch) and [multimatch](https://github.com/sindresorhus/multimatch). This is achieved through a combination of caching and regex optimization strategies, a fundamentally different approach than minimatch. +* More extensive support for the Bash 4.3 specification +* More complete extglob support +* Extensive [unit tests](./test) (approx. 1,300 tests). Minimatch fails many of the tests. + +### Switch from minimatch + +Use `mm.isMatch()` instead of `minimatch()`: + +```js +mm.isMatch('foo', 'b*'); +//=> false +``` + +Use `mm.match()` instead of `minimatch.match()`: + +```js +mm.match(['foo', 'bar'], 'b*'); +//=> 'bar' +``` + +### Switch from multimatch + +Same signature: + +```js +mm(['foo', 'bar', 'baz'], ['f*', '*z']); +//=> ['foo', 'baz'] +``` + +*** + +## Usage + +Add micromatch to your node.js project: + +```js +var mm = require('micromatch'); +``` + +**Signature** + +```js +mm(array_of_strings, glob_patterns[, options]); +``` + +**Example** + +```js +mm(['foo', 'bar', 'baz'], 'b*'); +//=> ['bar', 'baz'] +``` + +### Usage examples + +**Brace expansion** + +Match files with `.js` or `.txt` extensions. + +```js +mm(['a.js', 'b.md', 'c.txt'], '*.{js,txt}'); +//=> ['a.js', 'c.txt'] +``` + +**Extglobs** + +Match anything except for files with the `.md` extension. + +```js +mm(files, '**/*.!(md)'); + +//=> ['a.js', 'c.txt'] +``` + +**Multiple patterns** + +Match using an array of patterns. + +```js +mm(['a.md', 'b.js', 'c.txt', 'd.json'], ['*.md', '*.txt']); +//=> ['a.md', 'c.txt'] +``` + +**Negation patterns:** + +Behavior is designed to be what users would expect, based on conventions that are already well-established. + +* [minimatch](https://github.com/isaacs/minimatch) behavior is used when the pattern is a string, so patterns are **inclusive by default**. +* [multimatch](https://github.com/sindresorhus/multimatch) behavior is used when an array of patterns is passed, so patterns are **exclusive by default**. + +```js +mm(['a.js', 'b.md', 'c.txt'], '!*.{js,txt}'); +//=> ['b.md'] + +mm(['a.md', 'b.js', 'c.txt', 'd.json'], ['*.*', '!*.{js,txt}']); +//=> ['a.md', 'd.json'] +``` + +*** + +## API methods + +```js +var mm = require('micromatch'); +``` + +### .match + +```js +mm.match(array, globString); +``` + +Return an array of files that match the given glob pattern. Useful if you only need to use a single glob pattern. + +**Example** + +```js +mm.match(['ab', 'a/b', 'bb', 'b/c'], '?b'); +//=> ['ab', 'bb'] + +mm.match(['ab', 'a/b', 'bb', 'b/c'], '*/b'); +//=> ['a/b'] +``` + +### .isMatch + +```js +mm.isMatch(filepath, globString); +``` + +Returns true if a file path matches the given glob pattern. + +**Example** + +```js +mm.isMatch('.verb.md', '*.md'); +//=> false + +mm.isMatch('.verb.md', '*.md', {dot: true}); +//=> true +``` + +### .contains + +Returns true if any part of a file path matches the given glob pattern. Think of this is "has path" versus "is path". + +**Example** + +`.isMatch()` would return false for both of the following: + +```js +mm.contains('a/b/c', 'a/b'); +//=> true + +mm.contains('a/b/c', 'a/*'); +//=> true +``` + +### .matcher + +Returns a function for matching using the supplied pattern. e.g. create your own "matcher". The advantage of this method is that the pattern can be compiled outside of a loop. + +**Pattern** + +Can be any of the following: + +* `glob/string` +* `regex` +* `function` + +**Example** + +```js +var isMatch = mm.matcher('*.md'); +var files = []; + +['a.md', 'b.txt', 'c.md'].forEach(function(fp) { + if (isMatch(fp)) { + files.push(fp); + } +}); +``` + +### .filter + +Returns a function that can be passed to `Array#filter()`. + +**Params** + +* `patterns` **{String|Array}**: + +**Examples** + +Single glob: + +```js +var fn = mm.filter('*.md'); +['a.js', 'b.txt', 'c.md'].filter(fn); +//=> ['c.md'] + +var fn = mm.filter('[a-c]'); +['a', 'b', 'c', 'd', 'e'].filter(fn); +//=> ['a', 'b', 'c'] +``` + +Array of glob patterns: + +```js +var arr = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]; + +var fn = mm.filter(['{1..10}', '![7-9]', '!{3..4}']); +arr.filter(fn); +//=> [1, 2, 5, 6, 10] +``` + +_(Internally this function generates the matching function by using the [matcher](#matcher) method. You can use the [matcher](#matcher) method directly to create your own filter function)_ + +### .any + +Returns true if a file path matches any of the given patterns. + +```js +mm.any(filepath, patterns, options); +``` + +**Params** + +* filepath `{String}`: The file path to test. +* patterns `{String|Array}`: One or more glob patterns +* options: `{Object}`: options to pass to the `.matcher()` method. + +**Example** + +```js +mm.any('abc', ['!*z']); +//=> true +mm.any('abc', ['a*', 'z*']); +//=> true +mm.any('abc', 'a*'); +//=> true +mm.any('abc', ['z*']); +//=> false +``` + +### .expand + +Returns an object with a regex-compatible string and tokens. + +```js +mm.expand('*.js'); + +// when `track` is enabled (for debugging), the `history` array is used +// to record each mutation to the glob pattern as it's converted to regex +{ options: { track: false, dot: undefined, makeRe: true, negated: false }, + pattern: '(.*\\/|^)bar\\/(?:(?!(?:^|\\/)\\.).)*?', + history: [], + tokens: + { path: + { whole: '**/bar/**', + dirname: '**/bar/', + filename: '**', + basename: '**', + extname: '', + ext: '' }, + is: + { glob: true, + negated: false, + globstar: true, + dotfile: false, + dotdir: false }, + match: {}, + original: '**/bar/**', + pattern: '**/bar/**', + base: '' } } +``` + +### .makeRe + +Create a regular expression for matching file paths based on the given pattern: + +```js +mm.makeRe('*.js'); +//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ +``` + +## Options + +### options.unixify + +Normalize slashes in file paths and glob patterns to forward slashes. + +Type: `{Boolean}` + +Default: `undefined` on non-windows, `true` on windows. + +### options.dot + +Match dotfiles. Same behavior as [minimatch](https://github.com/isaacs/minimatch). + +Type: `{Boolean}` + +Default: `false` + +### options.unescape + +Unescape slashes in glob patterns. Use cautiously, especially on windows. + +Type: `{Boolean}` + +Default: `undefined` + +**Example** + +```js +mm.isMatch('abc', '\\a\\b\\c', {unescape: true}); +//=> true +``` + +### options.nodupes + +Remove duplicate elements from the result array. + +Type: `{Boolean}` + +Default: `undefined` + +**Example** + +Example of using the `unescape` and `nodupes` options together: + +```js +mm.match(['abc', '\\a\\b\\c'], '\\a\\b\\c', {unescape: true}); +//=> ['abc', 'abc'] + +mm.match(['abc', '\\a\\b\\c'], '\\a\\b\\c', {unescape: true, nodupes: true}); +//=> ['abc'] +``` + +### options.matchBase + +Allow glob patterns without slashes to match a file path based on its basename. . Same behavior as [minimatch](https://github.com/isaacs/minimatch). + +Type: `{Boolean}` + +Default: `false` + +**Example** + +```js +mm(['a/b.js', 'a/c.md'], '*.js'); +//=> [] + +mm(['a/b.js', 'a/c.md'], '*.js', {matchBase: true}); +//=> ['a/b.js'] +``` + +### options.nobraces + +Don't expand braces in glob patterns. Same behavior as [minimatch](https://github.com/isaacs/minimatch) `nobrace`. + +Type: `{Boolean}` + +Default: `undefined` + +See [braces](https://github.com/jonschlinkert/braces) for more information about extended brace expansion. + +### options.nobrackets + +Don't expand POSIX bracket expressions. + +Type: `{Boolean}` + +Default: `undefined` + +See [expand-brackets](https://github.com/jonschlinkert/expand-brackets) for more information about extended bracket expressions. + +### options.noextglob + +Don't expand extended globs. + +Type: `{Boolean}` + +Default: `undefined` + +See [extglob](https://github.com/jonschlinkert/extglob) for more information about extended globs. + +### options.nocase + +Use a case-insensitive regex for matching files. Same behavior as [minimatch](https://github.com/isaacs/minimatch). + +Type: `{Boolean}` + +Default: `false` + +### options.nonegate + +Disallow negation (`!`) patterns. + +Type: `{Boolean}` + +Default: `false` + +### options.nonull + +If `true`, when no matches are found the actual (array-ified) glob pattern is returned instead of an empty array. Same behavior as [minimatch](https://github.com/isaacs/minimatch). + +Type: `{Boolean}` + +Default: `false` + +### options.cache + +Cache the platform (e.g. `win32`) to prevent this from being looked up for every filepath. + +Type: `{Boolean}` + +Default: `true` + +*** + +## Other features + +Micromatch also supports the following. + +### Extended globbing + +#### extglobs + +Extended globbing, as described by the bash man page: + +| **pattern** | **regex equivalent** | **description** | +| --- | --- | --- | +| `?(pattern-list)` | `(... | ...)?` | Matches zero or one occurrence of the given patterns | +| `*(pattern-list)` | `(... | ...)*` | Matches zero or more occurrences of the given patterns | +| `+(pattern-list)` | `(... | ...)+` | Matches one or more occurrences of the given patterns | +| `@(pattern-list)` | `(... | ...)` * | Matches one of the given patterns | +| `!(pattern-list)` | N/A | Matches anything except one of the given patterns | + +* `@` isn't a RegEx character. + +Powered by [extglob](https://github.com/jonschlinkert/extglob). Visit that library for the full range of options or to report extglob related issues. + +See [extglob](https://github.com/jonschlinkert/extglob) for more information about extended globs. + +#### brace expansion + +In simple cases, brace expansion appears to work the same way as the logical `OR` operator. For example, `(a|b)` will achieve the same result as `{a,b}`. + +Here are some powerful features unique to brace expansion (versus character classes): + +* range expansion: `a{1..3}b/*.js` expands to: `['a1b/*.js', 'a2b/*.js', 'a3b/*.js']` +* nesting: `a{c,{d,e}}b/*.js` expands to: `['acb/*.js', 'adb/*.js', 'aeb/*.js']` + +Visit [braces](https://github.com/jonschlinkert/braces) to ask questions and create an issue related to brace-expansion, or to see the full range of features and options related to brace expansion. + +#### regex character classes + +With the exception of brace expansion (`{a,b}`, `{1..5}`, etc), most of the special characters convert directly to regex, so you can expect them to follow the same rules and produce the same results as regex. + +For example, given the list: `['a.js', 'b.js', 'c.js', 'd.js', 'E.js']`: + +* `[ac].js`: matches both `a` and `c`, returning `['a.js', 'c.js']` +* `[b-d].js`: matches from `b` to `d`, returning `['b.js', 'c.js', 'd.js']` +* `[b-d].js`: matches from `b` to `d`, returning `['b.js', 'c.js', 'd.js']` +* `a/[A-Z].js`: matches and uppercase letter, returning `['a/E.md']` + +Learn about [regex character classes](http://www.regular-expressions.info/charclass.html). + +#### regex groups + +Given `['a.js', 'b.js', 'c.js', 'd.js', 'E.js']`: + +* `(a|c).js`: would match either `a` or `c`, returning `['a.js', 'c.js']` +* `(b|d).js`: would match either `b` or `d`, returning `['b.js', 'd.js']` +* `(b|[A-Z]).js`: would match either `b` or an uppercase letter, returning `['b.js', 'E.js']` + +As with regex, parenthese can be nested, so patterns like `((a|b)|c)/b` will work. But it might be easier to achieve your goal using brace expansion. + +#### POSIX bracket expressions + +**Example** + +```js +mm.isMatch('a1', '[[:alpha:][:digit:]]'); +//=> true +``` + +See [expand-brackets](https://github.com/jonschlinkert/expand-brackets) for more information about extended bracket expressions. + +*** + +## Notes + +Whenever possible parsing behavior for patterns is based on globbing specifications in Bash 4.3. Patterns that aren't described by Bash follow wildmatch spec (used by git). + +## Benchmarks + +Run the [benchmarks](./benchmark): + +```bash +node benchmark +``` + +As of July 15, 2016: + +```bash +#1: basename-braces + micromatch x 26,420 ops/sec ±0.89% (91 runs sampled) + minimatch x 3,507 ops/sec ±0.64% (97 runs sampled) + +#2: basename + micromatch x 25,315 ops/sec ±0.82% (93 runs sampled) + minimatch x 4,398 ops/sec ±0.86% (94 runs sampled) + +#3: braces-no-glob + micromatch x 341,254 ops/sec ±0.78% (93 runs sampled) + minimatch x 30,197 ops/sec ±1.12% (91 runs sampled) + +#4: braces + micromatch x 54,649 ops/sec ±0.74% (94 runs sampled) + minimatch x 3,095 ops/sec ±0.82% (95 runs sampled) + +#5: immediate + micromatch x 16,719 ops/sec ±0.79% (95 runs sampled) + minimatch x 4,348 ops/sec ±0.86% (96 runs sampled) + +#6: large + micromatch x 721 ops/sec ±0.77% (94 runs sampled) + minimatch x 17.73 ops/sec ±1.08% (50 runs sampled) + +#7: long + micromatch x 5,051 ops/sec ±0.87% (97 runs sampled) + minimatch x 628 ops/sec ±0.83% (94 runs sampled) + +#8: mid + micromatch x 51,280 ops/sec ±0.80% (95 runs sampled) + minimatch x 1,923 ops/sec ±0.84% (95 runs sampled) + +#9: multi-patterns + micromatch x 22,440 ops/sec ±0.97% (94 runs sampled) + minimatch x 2,481 ops/sec ±1.10% (94 runs sampled) + +#10: no-glob + micromatch x 722,823 ops/sec ±1.30% (87 runs sampled) + minimatch x 52,967 ops/sec ±1.09% (94 runs sampled) + +#11: range + micromatch x 243,471 ops/sec ±0.79% (94 runs sampled) + minimatch x 11,736 ops/sec ±0.82% (96 runs sampled) + +#12: shallow + micromatch x 190,874 ops/sec ±0.98% (95 runs sampled) + minimatch x 21,699 ops/sec ±0.81% (97 runs sampled) + +#13: short + micromatch x 496,393 ops/sec ±3.86% (90 runs sampled) + minimatch x 53,765 ops/sec ±0.75% (95 runs sampled) +``` + +## Tests + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Coverage + +As of July 15, 2016: + +```sh +Statements : 100% (441/441) +Branches : 100% (270/270) +Functions : 100% (54/54) +Lines : 100% (429/429) +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +Please be sure to run the benchmarks before/after any code changes to judge the impact before you do a PR. thanks! + +## Related + +* [braces](https://www.npmjs.com/package/braces): Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces… [more](https://github.com/jonschlinkert/braces) | [homepage](https://github.com/jonschlinkert/braces "Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces specification.") +* [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/jonschlinkert/expand-brackets "Expand POSIX bracket expressions (character classes) in glob patterns.") +* [expand-range](https://www.npmjs.com/package/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See… [more](https://github.com/jonschlinkert/expand-range) | [homepage](https://github.com/jonschlinkert/expand-range "Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See the benchmarks. Used by micromatch.") +* [extglob](https://www.npmjs.com/package/extglob): Convert extended globs to regex-compatible strings. Add (almost) the expressive power of regular expressions to… [more](https://github.com/jonschlinkert/extglob) | [homepage](https://github.com/jonschlinkert/extglob "Convert extended globs to regex-compatible strings. Add (almost) the expressive power of regular expressions to glob patterns.") +* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or multiplier to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or multiplier to use.") +* [gulp-micromatch](https://www.npmjs.com/package/gulp-micromatch): Filter vinyl files with glob patterns, string, regexp, array, object or matcher function. micromatch stream. | [homepage](https://github.com/tunnckocore/gulp-micromatch#readme "Filter vinyl files with glob patterns, string, regexp, array, object or matcher function. micromatch stream.") +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [parse-glob](https://www.npmjs.com/package/parse-glob): Parse a glob pattern into an object of tokens. | [homepage](https://github.com/jonschlinkert/parse-glob "Parse a glob pattern into an object of tokens.") + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +## Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +## Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +## Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/micromatch/blob/master/LICENSE). + +*** + +_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on July 15, 2016._ \ No newline at end of file diff --git a/node_modules/micromatch/index.js b/node_modules/micromatch/index.js new file mode 100755 index 000000000..f898ec176 --- /dev/null +++ b/node_modules/micromatch/index.js @@ -0,0 +1,431 @@ +/*! + * micromatch + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var expand = require('./lib/expand'); +var utils = require('./lib/utils'); + +/** + * The main function. Pass an array of filepaths, + * and a string or array of glob patterns + * + * @param {Array|String} `files` + * @param {Array|String} `patterns` + * @param {Object} `opts` + * @return {Array} Array of matches + */ + +function micromatch(files, patterns, opts) { + if (!files || !patterns) return []; + opts = opts || {}; + + if (typeof opts.cache === 'undefined') { + opts.cache = true; + } + + if (!Array.isArray(patterns)) { + return match(files, patterns, opts); + } + + var len = patterns.length, i = 0; + var omit = [], keep = []; + + while (len--) { + var glob = patterns[i++]; + if (typeof glob === 'string' && glob.charCodeAt(0) === 33 /* ! */) { + omit.push.apply(omit, match(files, glob.slice(1), opts)); + } else { + keep.push.apply(keep, match(files, glob, opts)); + } + } + return utils.diff(keep, omit); +} + +/** + * Return an array of files that match the given glob pattern. + * + * This function is called by the main `micromatch` function If you only + * need to pass a single pattern you might get very minor speed improvements + * using this function. + * + * @param {Array} `files` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Array} + */ + +function match(files, pattern, opts) { + if (utils.typeOf(files) !== 'string' && !Array.isArray(files)) { + throw new Error(msg('match', 'files', 'a string or array')); + } + + files = utils.arrayify(files); + opts = opts || {}; + + var negate = opts.negate || false; + var orig = pattern; + + if (typeof pattern === 'string') { + negate = pattern.charAt(0) === '!'; + if (negate) { + pattern = pattern.slice(1); + } + + // we need to remove the character regardless, + // so the above logic is still needed + if (opts.nonegate === true) { + negate = false; + } + } + + var _isMatch = matcher(pattern, opts); + var len = files.length, i = 0; + var res = []; + + while (i < len) { + var file = files[i++]; + var fp = utils.unixify(file, opts); + + if (!_isMatch(fp)) { continue; } + res.push(fp); + } + + if (res.length === 0) { + if (opts.failglob === true) { + throw new Error('micromatch.match() found no matches for: "' + orig + '".'); + } + + if (opts.nonull || opts.nullglob) { + res.push(utils.unescapeGlob(orig)); + } + } + + // if `negate` was defined, diff negated files + if (negate) { res = utils.diff(files, res); } + + // if `ignore` was defined, diff ignored filed + if (opts.ignore && opts.ignore.length) { + pattern = opts.ignore; + opts = utils.omit(opts, ['ignore']); + res = utils.diff(res, micromatch(res, pattern, opts)); + } + + if (opts.nodupes) { + return utils.unique(res); + } + return res; +} + +/** + * Returns a function that takes a glob pattern or array of glob patterns + * to be used with `Array#filter()`. (Internally this function generates + * the matching function using the [matcher] method). + * + * ```js + * var fn = mm.filter('[a-c]'); + * ['a', 'b', 'c', 'd', 'e'].filter(fn); + * //=> ['a', 'b', 'c'] + * ``` + * @param {String|Array} `patterns` Can be a glob or array of globs. + * @param {Options} `opts` Options to pass to the [matcher] method. + * @return {Function} Filter function to be passed to `Array#filter()`. + */ + +function filter(patterns, opts) { + if (!Array.isArray(patterns) && typeof patterns !== 'string') { + throw new TypeError(msg('filter', 'patterns', 'a string or array')); + } + + patterns = utils.arrayify(patterns); + var len = patterns.length, i = 0; + var patternMatchers = Array(len); + while (i < len) { + patternMatchers[i] = matcher(patterns[i++], opts); + } + + return function(fp) { + if (fp == null) return []; + var len = patternMatchers.length, i = 0; + var res = true; + + fp = utils.unixify(fp, opts); + while (i < len) { + var fn = patternMatchers[i++]; + if (!fn(fp)) { + res = false; + break; + } + } + return res; + }; +} + +/** + * Returns true if the filepath contains the given + * pattern. Can also return a function for matching. + * + * ```js + * isMatch('foo.md', '*.md', {}); + * //=> true + * + * isMatch('*.md', {})('foo.md') + * //=> true + * ``` + * @param {String} `fp` + * @param {String} `pattern` + * @param {Object} `opts` + * @return {Boolean} + */ + +function isMatch(fp, pattern, opts) { + if (typeof fp !== 'string') { + throw new TypeError(msg('isMatch', 'filepath', 'a string')); + } + + fp = utils.unixify(fp, opts); + if (utils.typeOf(pattern) === 'object') { + return matcher(fp, pattern); + } + return matcher(pattern, opts)(fp); +} + +/** + * Returns true if the filepath matches the + * given pattern. + */ + +function contains(fp, pattern, opts) { + if (typeof fp !== 'string') { + throw new TypeError(msg('contains', 'pattern', 'a string')); + } + + opts = opts || {}; + opts.contains = (pattern !== ''); + fp = utils.unixify(fp, opts); + + if (opts.contains && !utils.isGlob(pattern)) { + return fp.indexOf(pattern) !== -1; + } + return matcher(pattern, opts)(fp); +} + +/** + * Returns true if a file path matches any of the + * given patterns. + * + * @param {String} `fp` The filepath to test. + * @param {String|Array} `patterns` Glob patterns to use. + * @param {Object} `opts` Options to pass to the `matcher()` function. + * @return {String} + */ + +function any(fp, patterns, opts) { + if (!Array.isArray(patterns) && typeof patterns !== 'string') { + throw new TypeError(msg('any', 'patterns', 'a string or array')); + } + + patterns = utils.arrayify(patterns); + var len = patterns.length; + + fp = utils.unixify(fp, opts); + while (len--) { + var isMatch = matcher(patterns[len], opts); + if (isMatch(fp)) { + return true; + } + } + return false; +} + +/** + * Filter the keys of an object with the given `glob` pattern + * and `options` + * + * @param {Object} `object` + * @param {Pattern} `object` + * @return {Array} + */ + +function matchKeys(obj, glob, options) { + if (utils.typeOf(obj) !== 'object') { + throw new TypeError(msg('matchKeys', 'first argument', 'an object')); + } + + var fn = matcher(glob, options); + var res = {}; + + for (var key in obj) { + if (obj.hasOwnProperty(key) && fn(key)) { + res[key] = obj[key]; + } + } + return res; +} + +/** + * Return a function for matching based on the + * given `pattern` and `options`. + * + * @param {String} `pattern` + * @param {Object} `options` + * @return {Function} + */ + +function matcher(pattern, opts) { + // pattern is a function + if (typeof pattern === 'function') { + return pattern; + } + // pattern is a regex + if (pattern instanceof RegExp) { + return function(fp) { + return pattern.test(fp); + }; + } + + if (typeof pattern !== 'string') { + throw new TypeError(msg('matcher', 'pattern', 'a string, regex, or function')); + } + + // strings, all the way down... + pattern = utils.unixify(pattern, opts); + + // pattern is a non-glob string + if (!utils.isGlob(pattern)) { + return utils.matchPath(pattern, opts); + } + // pattern is a glob string + var re = makeRe(pattern, opts); + + // `matchBase` is defined + if (opts && opts.matchBase) { + return utils.hasFilename(re, opts); + } + // `matchBase` is not defined + return function(fp) { + fp = utils.unixify(fp, opts); + return re.test(fp); + }; +} + +/** + * Create and cache a regular expression for matching + * file paths. + * + * If the leading character in the `glob` is `!`, a negation + * regex is returned. + * + * @param {String} `glob` + * @param {Object} `options` + * @return {RegExp} + */ + +function toRegex(glob, options) { + // clone options to prevent mutating the original object + var opts = Object.create(options || {}); + var flags = opts.flags || ''; + if (opts.nocase && flags.indexOf('i') === -1) { + flags += 'i'; + } + + var parsed = expand(glob, opts); + + // pass in tokens to avoid parsing more than once + opts.negated = opts.negated || parsed.negated; + opts.negate = opts.negated; + glob = wrapGlob(parsed.pattern, opts); + var re; + + try { + re = new RegExp(glob, flags); + return re; + } catch (err) { + err.reason = 'micromatch invalid regex: (' + re + ')'; + if (opts.strict) throw new SyntaxError(err); + } + + // we're only here if a bad pattern was used and the user + // passed `options.silent`, so match nothing + return /$^/; +} + +/** + * Create the regex to do the matching. If the leading + * character in the `glob` is `!` a negation regex is returned. + * + * @param {String} `glob` + * @param {Boolean} `negate` + */ + +function wrapGlob(glob, opts) { + var prefix = (opts && !opts.contains) ? '^' : ''; + var after = (opts && !opts.contains) ? '$' : ''; + glob = ('(?:' + glob + ')' + after); + if (opts && opts.negate) { + return prefix + ('(?!^' + glob + ').*$'); + } + return prefix + glob; +} + +/** + * Create and cache a regular expression for matching file paths. + * If the leading character in the `glob` is `!`, a negation + * regex is returned. + * + * @param {String} `glob` + * @param {Object} `options` + * @return {RegExp} + */ + +function makeRe(glob, opts) { + if (utils.typeOf(glob) !== 'string') { + throw new Error(msg('makeRe', 'glob', 'a string')); + } + return utils.cache(toRegex, glob, opts); +} + +/** + * Make error messages consistent. Follows this format: + * + * ```js + * msg(methodName, argNumber, nativeType); + * // example: + * msg('matchKeys', 'first', 'an object'); + * ``` + * + * @param {String} `method` + * @param {String} `num` + * @param {String} `type` + * @return {String} + */ + +function msg(method, what, type) { + return 'micromatch.' + method + '(): ' + what + ' should be ' + type + '.'; +} + +/** + * Public methods + */ + +/* eslint no-multi-spaces: 0 */ +micromatch.any = any; +micromatch.braces = micromatch.braceExpand = utils.braces; +micromatch.contains = contains; +micromatch.expand = expand; +micromatch.filter = filter; +micromatch.isMatch = isMatch; +micromatch.makeRe = makeRe; +micromatch.match = match; +micromatch.matcher = matcher; +micromatch.matchKeys = matchKeys; + +/** + * Expose `micromatch` + */ + +module.exports = micromatch; diff --git a/node_modules/micromatch/lib/chars.js b/node_modules/micromatch/lib/chars.js new file mode 100644 index 000000000..a1ffe3714 --- /dev/null +++ b/node_modules/micromatch/lib/chars.js @@ -0,0 +1,67 @@ +'use strict'; + +var chars = {}, unesc, temp; + +function reverse(object, prepender) { + return Object.keys(object).reduce(function(reversed, key) { + var newKey = prepender ? prepender + key : key; // Optionally prepend a string to key. + reversed[object[key]] = newKey; // Swap key and value. + return reversed; // Return the result. + }, {}); +} + +/** + * Regex for common characters + */ + +chars.escapeRegex = { + '?': /\?/g, + '@': /\@/g, + '!': /\!/g, + '+': /\+/g, + '*': /\*/g, + '(': /\(/g, + ')': /\)/g, + '[': /\[/g, + ']': /\]/g +}; + +/** + * Escape characters + */ + +chars.ESC = { + '?': '__UNESC_QMRK__', + '@': '__UNESC_AMPE__', + '!': '__UNESC_EXCL__', + '+': '__UNESC_PLUS__', + '*': '__UNESC_STAR__', + ',': '__UNESC_COMMA__', + '(': '__UNESC_LTPAREN__', + ')': '__UNESC_RTPAREN__', + '[': '__UNESC_LTBRACK__', + ']': '__UNESC_RTBRACK__' +}; + +/** + * Unescape characters + */ + +chars.UNESC = unesc || (unesc = reverse(chars.ESC, '\\')); + +chars.ESC_TEMP = { + '?': '__TEMP_QMRK__', + '@': '__TEMP_AMPE__', + '!': '__TEMP_EXCL__', + '*': '__TEMP_STAR__', + '+': '__TEMP_PLUS__', + ',': '__TEMP_COMMA__', + '(': '__TEMP_LTPAREN__', + ')': '__TEMP_RTPAREN__', + '[': '__TEMP_LTBRACK__', + ']': '__TEMP_RTBRACK__' +}; + +chars.TEMP = temp || (temp = reverse(chars.ESC_TEMP)); + +module.exports = chars; diff --git a/node_modules/micromatch/lib/expand.js b/node_modules/micromatch/lib/expand.js new file mode 100644 index 000000000..e99b081eb --- /dev/null +++ b/node_modules/micromatch/lib/expand.js @@ -0,0 +1,304 @@ +/*! + * micromatch + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var utils = require('./utils'); +var Glob = require('./glob'); + +/** + * Expose `expand` + */ + +module.exports = expand; + +/** + * Expand a glob pattern to resolve braces and + * similar patterns before converting to regex. + * + * @param {String|Array} `pattern` + * @param {Array} `files` + * @param {Options} `opts` + * @return {Array} + */ + +function expand(pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('micromatch.expand(): argument should be a string.'); + } + + var glob = new Glob(pattern, options || {}); + var opts = glob.options; + + if (!utils.isGlob(pattern)) { + glob.pattern = glob.pattern.replace(/([\/.])/g, '\\$1'); + return glob; + } + + glob.pattern = glob.pattern.replace(/(\+)(?!\()/g, '\\$1'); + glob.pattern = glob.pattern.split('$').join('\\$'); + + if (typeof opts.braces !== 'boolean' && typeof opts.nobraces !== 'boolean') { + opts.braces = true; + } + + if (glob.pattern === '.*') { + return { + pattern: '\\.' + star, + tokens: tok, + options: opts + }; + } + + if (glob.pattern === '*') { + return { + pattern: oneStar(opts.dot), + tokens: tok, + options: opts + }; + } + + // parse the glob pattern into tokens + glob.parse(); + var tok = glob.tokens; + tok.is.negated = opts.negated; + + // dotfile handling + if ((opts.dotfiles === true || tok.is.dotfile) && opts.dot !== false) { + opts.dotfiles = true; + opts.dot = true; + } + + if ((opts.dotdirs === true || tok.is.dotdir) && opts.dot !== false) { + opts.dotdirs = true; + opts.dot = true; + } + + // check for braces with a dotfile pattern + if (/[{,]\./.test(glob.pattern)) { + opts.makeRe = false; + opts.dot = true; + } + + if (opts.nonegate !== true) { + opts.negated = glob.negated; + } + + // if the leading character is a dot or a slash, escape it + if (glob.pattern.charAt(0) === '.' && glob.pattern.charAt(1) !== '/') { + glob.pattern = '\\' + glob.pattern; + } + + /** + * Extended globs + */ + + // expand braces, e.g `{1..5}` + glob.track('before braces'); + if (tok.is.braces) { + glob.braces(); + } + glob.track('after braces'); + + // expand extglobs, e.g `foo/!(a|b)` + glob.track('before extglob'); + if (tok.is.extglob) { + glob.extglob(); + } + glob.track('after extglob'); + + // expand brackets, e.g `[[:alpha:]]` + glob.track('before brackets'); + if (tok.is.brackets) { + glob.brackets(); + } + glob.track('after brackets'); + + // special patterns + glob._replace('[!', '[^'); + glob._replace('(?', '(%~'); + glob._replace(/\[\]/, '\\[\\]'); + glob._replace('/[', '/' + (opts.dot ? dotfiles : nodot) + '[', true); + glob._replace('/?', '/' + (opts.dot ? dotfiles : nodot) + '[^/]', true); + glob._replace('/.', '/(?=.)\\.', true); + + // windows drives + glob._replace(/^(\w):([\\\/]+?)/gi, '(?=.)$1:$2', true); + + // negate slashes in exclusion ranges + if (glob.pattern.indexOf('[^') !== -1) { + glob.pattern = negateSlash(glob.pattern); + } + + if (opts.globstar !== false && glob.pattern === '**') { + glob.pattern = globstar(opts.dot); + + } else { + glob.pattern = balance(glob.pattern, '[', ']'); + glob.escape(glob.pattern); + + // if the pattern has `**` + if (tok.is.globstar) { + glob.pattern = collapse(glob.pattern, '/**'); + glob.pattern = collapse(glob.pattern, '**/'); + glob._replace('/**/', '(?:/' + globstar(opts.dot) + '/|/)', true); + glob._replace(/\*{2,}/g, '**'); + + // 'foo/*' + glob._replace(/(\w+)\*(?!\/)/g, '$1[^/]*?', true); + glob._replace(/\*\*\/\*(\w)/g, globstar(opts.dot) + '\\/' + (opts.dot ? dotfiles : nodot) + '[^/]*?$1', true); + + if (opts.dot !== true) { + glob._replace(/\*\*\/(.)/g, '(?:**\\/|)$1'); + } + + // 'foo/**' or '{**,*}', but not 'foo**' + if (tok.path.dirname !== '' || /,\*\*|\*\*,/.test(glob.orig)) { + glob._replace('**', globstar(opts.dot), true); + } + } + + // ends with /* + glob._replace(/\/\*$/, '\\/' + oneStar(opts.dot), true); + // ends with *, no slashes + glob._replace(/(?!\/)\*$/, star, true); + // has 'n*.' (partial wildcard w/ file extension) + glob._replace(/([^\/]+)\*/, '$1' + oneStar(true), true); + // has '*' + glob._replace('*', oneStar(opts.dot), true); + glob._replace('?.', '?\\.', true); + glob._replace('?:', '?:', true); + + glob._replace(/\?+/g, function(match) { + var len = match.length; + if (len === 1) { + return qmark; + } + return qmark + '{' + len + '}'; + }); + + // escape '.abc' => '\\.abc' + glob._replace(/\.([*\w]+)/g, '\\.$1'); + // fix '[^\\\\/]' + glob._replace(/\[\^[\\\/]+\]/g, qmark); + // '///' => '\/' + glob._replace(/\/+/g, '\\/'); + // '\\\\\\' => '\\' + glob._replace(/\\{2,}/g, '\\'); + } + + // unescape previously escaped patterns + glob.unescape(glob.pattern); + glob._replace('__UNESC_STAR__', '*'); + + // escape dots that follow qmarks + glob._replace('?.', '?\\.'); + + // remove unnecessary slashes in character classes + glob._replace('[^\\/]', qmark); + + if (glob.pattern.length > 1) { + if (/^[\[?*]/.test(glob.pattern)) { + // only prepend the string if we don't want to match dotfiles + glob.pattern = (opts.dot ? dotfiles : nodot) + glob.pattern; + } + } + + return glob; +} + +/** + * Collapse repeated character sequences. + * + * ```js + * collapse('a/../../../b', '../'); + * //=> 'a/../b' + * ``` + * + * @param {String} `str` + * @param {String} `ch` Character sequence to collapse + * @return {String} + */ + +function collapse(str, ch) { + var res = str.split(ch); + var isFirst = res[0] === ''; + var isLast = res[res.length - 1] === ''; + res = res.filter(Boolean); + if (isFirst) res.unshift(''); + if (isLast) res.push(''); + return res.join(ch); +} + +/** + * Negate slashes in exclusion ranges, per glob spec: + * + * ```js + * negateSlash('[^foo]'); + * //=> '[^\\/foo]' + * ``` + * + * @param {String} `str` glob pattern + * @return {String} + */ + +function negateSlash(str) { + return str.replace(/\[\^([^\]]*?)\]/g, function(match, inner) { + if (inner.indexOf('/') === -1) { + inner = '\\/' + inner; + } + return '[^' + inner + ']'; + }); +} + +/** + * Escape imbalanced braces/bracket. This is a very + * basic, naive implementation that only does enough + * to serve the purpose. + */ + +function balance(str, a, b) { + var aarr = str.split(a); + var alen = aarr.join('').length; + var blen = str.split(b).join('').length; + + if (alen !== blen) { + str = aarr.join('\\' + a); + return str.split(b).join('\\' + b); + } + return str; +} + +/** + * Special patterns to be converted to regex. + * Heuristics are used to simplify patterns + * and speed up processing. + */ + +/* eslint no-multi-spaces: 0 */ +var qmark = '[^/]'; +var star = qmark + '*?'; +var nodot = '(?!\\.)(?=.)'; +var dotfileGlob = '(?:\\/|^)\\.{1,2}($|\\/)'; +var dotfiles = '(?!' + dotfileGlob + ')(?=.)'; +var twoStarDot = '(?:(?!' + dotfileGlob + ').)*?'; + +/** + * Create a regex for `*`. + * + * If `dot` is true, or the pattern does not begin with + * a leading star, then return the simpler regex. + */ + +function oneStar(dotfile) { + return dotfile ? '(?!' + dotfileGlob + ')(?=.)' + star : (nodot + star); +} + +function globstar(dotfile) { + if (dotfile) { return twoStarDot; } + return '(?:(?!(?:\\/|^)\\.).)*?'; +} diff --git a/node_modules/micromatch/lib/glob.js b/node_modules/micromatch/lib/glob.js new file mode 100644 index 000000000..c61332673 --- /dev/null +++ b/node_modules/micromatch/lib/glob.js @@ -0,0 +1,193 @@ +'use strict'; + +var chars = require('./chars'); +var utils = require('./utils'); + +/** + * Expose `Glob` + */ + +var Glob = module.exports = function Glob(pattern, options) { + if (!(this instanceof Glob)) { + return new Glob(pattern, options); + } + this.options = options || {}; + this.pattern = pattern; + this.history = []; + this.tokens = {}; + this.init(pattern); +}; + +/** + * Initialize defaults + */ + +Glob.prototype.init = function(pattern) { + this.orig = pattern; + this.negated = this.isNegated(); + this.options.track = this.options.track || false; + this.options.makeRe = true; +}; + +/** + * Push a change into `glob.history`. Useful + * for debugging. + */ + +Glob.prototype.track = function(msg) { + if (this.options.track) { + this.history.push({msg: msg, pattern: this.pattern}); + } +}; + +/** + * Return true if `glob.pattern` was negated + * with `!`, also remove the `!` from the pattern. + * + * @return {Boolean} + */ + +Glob.prototype.isNegated = function() { + if (this.pattern.charCodeAt(0) === 33 /* '!' */) { + this.pattern = this.pattern.slice(1); + return true; + } + return false; +}; + +/** + * Expand braces in the given glob pattern. + * + * We only need to use the [braces] lib when + * patterns are nested. + */ + +Glob.prototype.braces = function() { + if (this.options.nobraces !== true && this.options.nobrace !== true) { + // naive/fast check for imbalanced characters + var a = this.pattern.match(/[\{\(\[]/g); + var b = this.pattern.match(/[\}\)\]]/g); + + // if imbalanced, don't optimize the pattern + if (a && b && (a.length !== b.length)) { + this.options.makeRe = false; + } + + // expand brace patterns and join the resulting array + var expanded = utils.braces(this.pattern, this.options); + this.pattern = expanded.join('|'); + } +}; + +/** + * Expand bracket expressions in `glob.pattern` + */ + +Glob.prototype.brackets = function() { + if (this.options.nobrackets !== true) { + this.pattern = utils.brackets(this.pattern); + } +}; + +/** + * Expand bracket expressions in `glob.pattern` + */ + +Glob.prototype.extglob = function() { + if (this.options.noextglob === true) return; + + if (utils.isExtglob(this.pattern)) { + this.pattern = utils.extglob(this.pattern, {escape: true}); + } +}; + +/** + * Parse the given pattern + */ + +Glob.prototype.parse = function(pattern) { + this.tokens = utils.parseGlob(pattern || this.pattern, true); + return this.tokens; +}; + +/** + * Replace `a` with `b`. Also tracks the change before and + * after each replacement. This is disabled by default, but + * can be enabled by setting `options.track` to true. + * + * Also, when the pattern is a string, `.split()` is used, + * because it's much faster than replace. + * + * @param {RegExp|String} `a` + * @param {String} `b` + * @param {Boolean} `escape` When `true`, escapes `*` and `?` in the replacement. + * @return {String} + */ + +Glob.prototype._replace = function(a, b, escape) { + this.track('before (find): "' + a + '" (replace with): "' + b + '"'); + if (escape) b = esc(b); + if (a && b && typeof a === 'string') { + this.pattern = this.pattern.split(a).join(b); + } else { + this.pattern = this.pattern.replace(a, b); + } + this.track('after'); +}; + +/** + * Escape special characters in the given string. + * + * @param {String} `str` Glob pattern + * @return {String} + */ + +Glob.prototype.escape = function(str) { + this.track('before escape: '); + var re = /["\\](['"]?[^"'\\]['"]?)/g; + + this.pattern = str.replace(re, function($0, $1) { + var o = chars.ESC; + var ch = o && o[$1]; + if (ch) { + return ch; + } + if (/[a-z]/i.test($0)) { + return $0.split('\\').join(''); + } + return $0; + }); + + this.track('after escape: '); +}; + +/** + * Unescape special characters in the given string. + * + * @param {String} `str` + * @return {String} + */ + +Glob.prototype.unescape = function(str) { + var re = /__([A-Z]+)_([A-Z]+)__/g; + this.pattern = str.replace(re, function($0, $1) { + return chars[$1][$0]; + }); + this.pattern = unesc(this.pattern); +}; + +/** + * Escape/unescape utils + */ + +function esc(str) { + str = str.split('?').join('%~'); + str = str.split('*').join('%%'); + return str; +} + +function unesc(str) { + str = str.split('%~').join('?'); + str = str.split('%%').join('*'); + return str; +} diff --git a/node_modules/micromatch/lib/utils.js b/node_modules/micromatch/lib/utils.js new file mode 100644 index 000000000..7c24a5106 --- /dev/null +++ b/node_modules/micromatch/lib/utils.js @@ -0,0 +1,149 @@ +'use strict'; + +var win32 = process && process.platform === 'win32'; +var path = require('path'); +var fileRe = require('filename-regex'); +var utils = module.exports; + +/** + * Module dependencies + */ + +utils.diff = require('arr-diff'); +utils.unique = require('array-unique'); +utils.braces = require('braces'); +utils.brackets = require('expand-brackets'); +utils.extglob = require('extglob'); +utils.isExtglob = require('is-extglob'); +utils.isGlob = require('is-glob'); +utils.typeOf = require('kind-of'); +utils.normalize = require('normalize-path'); +utils.omit = require('object.omit'); +utils.parseGlob = require('parse-glob'); +utils.cache = require('regex-cache'); + +/** + * Get the filename of a filepath + * + * @param {String} `string` + * @return {String} + */ + +utils.filename = function filename(fp) { + var seg = fp.match(fileRe()); + return seg && seg[0]; +}; + +/** + * Returns a function that returns true if the given + * pattern is the same as a given `filepath` + * + * @param {String} `pattern` + * @return {Function} + */ + +utils.isPath = function isPath(pattern, opts) { + opts = opts || {}; + return function(fp) { + var unixified = utils.unixify(fp, opts); + if(opts.nocase){ + return pattern.toLowerCase() === unixified.toLowerCase(); + } + return pattern === unixified; + }; +}; + +/** + * Returns a function that returns true if the given + * pattern contains a `filepath` + * + * @param {String} `pattern` + * @return {Function} + */ + +utils.hasPath = function hasPath(pattern, opts) { + return function(fp) { + return utils.unixify(pattern, opts).indexOf(fp) !== -1; + }; +}; + +/** + * Returns a function that returns true if the given + * pattern matches or contains a `filepath` + * + * @param {String} `pattern` + * @return {Function} + */ + +utils.matchPath = function matchPath(pattern, opts) { + var fn = (opts && opts.contains) + ? utils.hasPath(pattern, opts) + : utils.isPath(pattern, opts); + return fn; +}; + +/** + * Returns a function that returns true if the given + * regex matches the `filename` of a file path. + * + * @param {RegExp} `re` + * @return {Boolean} + */ + +utils.hasFilename = function hasFilename(re) { + return function(fp) { + var name = utils.filename(fp); + return name && re.test(name); + }; +}; + +/** + * Coerce `val` to an array + * + * @param {*} val + * @return {Array} + */ + +utils.arrayify = function arrayify(val) { + return !Array.isArray(val) + ? [val] + : val; +}; + +/** + * Normalize all slashes in a file path or glob pattern to + * forward slashes. + */ + +utils.unixify = function unixify(fp, opts) { + if (opts && opts.unixify === false) return fp; + if (opts && opts.unixify === true || win32 || path.sep === '\\') { + return utils.normalize(fp, false); + } + if (opts && opts.unescape === true) { + return fp ? fp.toString().replace(/\\(\w)/g, '$1') : ''; + } + return fp; +}; + +/** + * Escape/unescape utils + */ + +utils.escapePath = function escapePath(fp) { + return fp.replace(/[\\.]/g, '\\$&'); +}; + +utils.unescapeGlob = function unescapeGlob(fp) { + return fp.replace(/[\\"']/g, ''); +}; + +utils.escapeRe = function escapeRe(str) { + return str.replace(/[-[\\$*+?.#^\s{}(|)\]]/g, '\\$&'); +}; + +/** + * Expose `utils` + */ + +module.exports = utils; diff --git a/node_modules/micromatch/package.json b/node_modules/micromatch/package.json new file mode 100644 index 000000000..2772f9d59 --- /dev/null +++ b/node_modules/micromatch/package.json @@ -0,0 +1,146 @@ +{ + "_from": "micromatch@^2.2.0", + "_id": "micromatch@2.3.11", + "_inBundle": false, + "_integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "_location": "/micromatch", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "micromatch@^2.2.0", + "name": "micromatch", + "escapedName": "micromatch", + "rawSpec": "^2.2.0", + "saveSpec": null, + "fetchSpec": "^2.2.0" + }, + "_requiredBy": [ + "/anymatch", + "/budo" + ], + "_resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "_shasum": "86677c97d1720b363431d04d0d15293bd38c1565", + "_spec": "micromatch@^2.2.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/micromatch/issues" + }, + "bundleDependencies": false, + "dependencies": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + }, + "deprecated": false, + "description": "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.", + "devDependencies": { + "benchmarked": "^0.1.4", + "chalk": "^1.1.1", + "gulp": "^3.9.0", + "gulp-eslint": "^1.1.1", + "gulp-format-md": "^0.1.8", + "gulp-istanbul": "^0.10.1", + "gulp-mocha": "^2.1.3", + "minimatch": "^3.0.0", + "minimist": "^1.2.0", + "mocha": "^2", + "multimatch": "^2.0.0", + "should": "^8", + "write": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "lib" + ], + "homepage": "https://github.com/jonschlinkert/micromatch", + "keywords": [ + "bash", + "expand", + "expansion", + "expression", + "file", + "files", + "filter", + "find", + "glob", + "globbing", + "globs", + "globstar", + "match", + "matcher", + "matches", + "matching", + "minimatch", + "multimatch", + "path", + "pattern", + "patterns", + "regex", + "regexp", + "regular", + "shell", + "wildcard" + ], + "license": "MIT", + "main": "index.js", + "name": "micromatch", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/micromatch.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "braces", + "expand-brackets", + "expand-range", + "extglob", + "fill-range", + "gulp-micromatch", + "is-glob", + "parse-glob" + ] + }, + "reflinks": [ + "braces", + "expand-brackets", + "extglob", + "minimatch", + "multimatch", + "verb" + ], + "toc": false, + "layout": false, + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + }, + "version": "2.3.11" +} diff --git a/node_modules/miller-rabin/.npmignore b/node_modules/miller-rabin/.npmignore new file mode 100644 index 000000000..1ca957177 --- /dev/null +++ b/node_modules/miller-rabin/.npmignore @@ -0,0 +1,2 @@ +node_modules/ +npm-debug.log diff --git a/node_modules/miller-rabin/1.js b/node_modules/miller-rabin/1.js new file mode 100644 index 000000000..92953789e --- /dev/null +++ b/node_modules/miller-rabin/1.js @@ -0,0 +1,7 @@ +'use strict'; + +const BN = require('bn.js'); + +const p = new BN('2e1b162f326430f5ac6af10f96b2a8350e01675d22324c9f', 'hex'); + +console.log(p.bitLength()); diff --git a/node_modules/miller-rabin/README.md b/node_modules/miller-rabin/README.md new file mode 100644 index 000000000..e9d76f67c --- /dev/null +++ b/node_modules/miller-rabin/README.md @@ -0,0 +1,26 @@ +# Miller-Rabin + +#### LICENSE + +This software is licensed under the MIT License. + +Copyright Fedor Indutny, 2014. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/miller-rabin/bin/miller-rabin b/node_modules/miller-rabin/bin/miller-rabin new file mode 100755 index 000000000..2e18dfd53 --- /dev/null +++ b/node_modules/miller-rabin/bin/miller-rabin @@ -0,0 +1,29 @@ +#!/usr/bin/env node +var bn = require('bn.js'); +var fs = require('fs'); +var mr = require('../').create(); + +var num = ''; +if (process.argv[2]) { + num += fs.readFileSync(process.argv[2]); + start(num); +} else { + process.stdin.on('data', function(chunk) { + num += chunk.toString().replace(/[^0-9a-f]/gi, ''); + }); + process.stdin.once('end', function() { + start(num); + }); +} + +function start(text) { + var num = new bn(text, 16); + + var divisor = mr.getDivisor(num); + if (!divisor) + process.exit(1); + if (divisor.cmpn(1) === 0) + process.exit(0); + + console.log(divisor.toString(16)); +} diff --git a/node_modules/miller-rabin/lib/mr.js b/node_modules/miller-rabin/lib/mr.js new file mode 100644 index 000000000..60d2a8ef9 --- /dev/null +++ b/node_modules/miller-rabin/lib/mr.js @@ -0,0 +1,115 @@ +var bn = require('bn.js'); +var brorand = require('brorand'); + +function MillerRabin(rand) { + this.rand = rand || new brorand.Rand(); +} +module.exports = MillerRabin; + +MillerRabin.create = function create(rand) { + return new MillerRabin(rand); +}; + +MillerRabin.prototype._randbelow = function _randbelow(n) { + var len = n.bitLength(); + var min_bytes = Math.ceil(len / 8); + + // Generage random bytes until a number less than n is found. + // This ensures that 0..n-1 have an equal probability of being selected. + do + var a = new bn(this.rand.generate(min_bytes)); + while (a.cmp(n) >= 0); + + return a; +}; + +MillerRabin.prototype._randrange = function _randrange(start, stop) { + // Generate a random number greater than or equal to start and less than stop. + var size = stop.sub(start); + return start.add(this._randbelow(size)); +}; + +MillerRabin.prototype.test = function test(n, k, cb) { + var len = n.bitLength(); + var red = bn.mont(n); + var rone = new bn(1).toRed(red); + + if (!k) + k = Math.max(1, (len / 48) | 0); + + // Find d and s, (n - 1) = (2 ^ s) * d; + var n1 = n.subn(1); + for (var s = 0; !n1.testn(s); s++) {} + var d = n.shrn(s); + + var rn1 = n1.toRed(red); + + var prime = true; + for (; k > 0; k--) { + var a = this._randrange(new bn(2), n1); + if (cb) + cb(a); + + var x = a.toRed(red).redPow(d); + if (x.cmp(rone) === 0 || x.cmp(rn1) === 0) + continue; + + for (var i = 1; i < s; i++) { + x = x.redSqr(); + + if (x.cmp(rone) === 0) + return false; + if (x.cmp(rn1) === 0) + break; + } + + if (i === s) + return false; + } + + return prime; +}; + +MillerRabin.prototype.getDivisor = function getDivisor(n, k) { + var len = n.bitLength(); + var red = bn.mont(n); + var rone = new bn(1).toRed(red); + + if (!k) + k = Math.max(1, (len / 48) | 0); + + // Find d and s, (n - 1) = (2 ^ s) * d; + var n1 = n.subn(1); + for (var s = 0; !n1.testn(s); s++) {} + var d = n.shrn(s); + + var rn1 = n1.toRed(red); + + for (; k > 0; k--) { + var a = this._randrange(new bn(2), n1); + + var g = n.gcd(a); + if (g.cmpn(1) !== 0) + return g; + + var x = a.toRed(red).redPow(d); + if (x.cmp(rone) === 0 || x.cmp(rn1) === 0) + continue; + + for (var i = 1; i < s; i++) { + x = x.redSqr(); + + if (x.cmp(rone) === 0) + return x.fromRed().subn(1).gcd(n); + if (x.cmp(rn1) === 0) + break; + } + + if (i === s) { + x = x.redSqr(); + return x.fromRed().subn(1).gcd(n); + } + } + + return false; +}; diff --git a/node_modules/miller-rabin/package.json b/node_modules/miller-rabin/package.json new file mode 100644 index 000000000..d3acf9583 --- /dev/null +++ b/node_modules/miller-rabin/package.json @@ -0,0 +1,62 @@ +{ + "_from": "miller-rabin@^4.0.0", + "_id": "miller-rabin@4.0.1", + "_inBundle": false, + "_integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "_location": "/miller-rabin", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "miller-rabin@^4.0.0", + "name": "miller-rabin", + "escapedName": "miller-rabin", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/diffie-hellman" + ], + "_resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "_shasum": "f080351c865b0dc562a8462966daa53543c78a4d", + "_spec": "miller-rabin@^4.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/diffie-hellman", + "author": { + "name": "Fedor Indutny", + "email": "fedor@indutny.com" + }, + "bin": { + "miller-rabin": "bin/miller-rabin" + }, + "bugs": { + "url": "https://github.com/indutny/miller-rabin/issues" + }, + "bundleDependencies": false, + "dependencies": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "deprecated": false, + "description": "Miller Rabin algorithm for primality test", + "devDependencies": { + "mocha": "^2.0.1" + }, + "homepage": "https://github.com/indutny/miller-rabin", + "keywords": [ + "prime", + "miller-rabin", + "bignumber" + ], + "license": "MIT", + "main": "lib/mr.js", + "name": "miller-rabin", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/indutny/miller-rabin.git" + }, + "scripts": { + "test": "mocha --reporter=spec test/**/*-test.js" + }, + "version": "4.0.1" +} diff --git a/node_modules/miller-rabin/test.js b/node_modules/miller-rabin/test.js new file mode 100644 index 000000000..74b2ccfe4 --- /dev/null +++ b/node_modules/miller-rabin/test.js @@ -0,0 +1,25 @@ +var mr = require('./').create(); +var BN = require('bn.js'); + +var p = new BN( + `00:d3:99:af:83:02:de:91:f8:cc:1b:4e:2e:e0:18: + b3:0a:41:a4:77:98:d2:ad:66:0f:dc:17:85:ca:58: + b4:e4:88:55:c5:0a:82:08:7c:fb:70:a9:41:30:be: + af:50:d2:ce:93:cd:46:83:47:6e:c0:51:a7:10:e6: + 66:d1:08:e8:3d:b8:ce:fe:3e:4e:48:96:82:15:f7: + 2c:83:80:05:f2:14:3a:a4:5a:44:2b:22:22:67:e5: + 21:23:b7:cb:0f:71:5b:12:8b:3d:81:f6:5e:dc:99: + 8f:f9:80:38:75:57:c2:dd:9b:7a:b2:24:97:42:60: + 92:1f:1d:8a:68:c5:b8:7f:5d:c0:53:3d:15:f2:95: + b8:1d:8b:c2:e6:ca:a6:4c:bd:bf:88:9f:3e:d3:d7: + 24:18:27:62:6e:d0:52:75:68:9f:2a:c9:39:af:95: + 55:bb:11:08:dc:51:e9:8b:5a:38:e0:c0:e9:d8:a6: + 71:a5:03:f9:a7:2c:dd:1a:63:8e:7f:f0:36:68:a0: + 44:f8:09:48:3d:bd:de:b3:2d:3a:2f:73:88:8a:0c: + e2:7f:9b:dd:e8:c2:0e:ee:21:e4:a7:f9:4d:46:2f: + a7:f6:6d:fa:88:2e:95:60:ac:53:2e:45:a2:9d:9e: + c4:80:fc:c7:49:c9:42:bb:2b:66:f6:14:6d:7f:03: + 4e:f3`.replace(/[^a-f0-9]/g, ''), 16); +console.time(); +mr.test(p); +console.timeEnd(); diff --git a/node_modules/miller-rabin/test/api-test.js b/node_modules/miller-rabin/test/api-test.js new file mode 100644 index 000000000..dee094d95 --- /dev/null +++ b/node_modules/miller-rabin/test/api-test.js @@ -0,0 +1,18 @@ +var assert = require('assert'); +var mr = require('../').create(); +var bn = require('bn.js'); + +describe('Miller-Rabin', function() { + it('should test number for primality', function() { + assert(!mr.test(new bn(221))); + assert(mr.test(new bn(257))); + + var p = new bn('dba8191813fe8f51eaae1de70213aafede8f323f95f32cff' + + '8b64ebada275cfb18a446a0150e5fdaee246244c5f002ce0' + + 'aca97584be1745f2dd1eea2849c52aac8c4b5fb78a1c4da7' + + '052774338d3310a6e020c46168cb1f94014e9312511cc4fb' + + '79d695bb732449f0e015745b86bfa371dc6ca7386e9c7309' + + '5549c2e4b8002873', 16); + assert(mr.test(p)); + }); +}); diff --git a/node_modules/mime/LICENSE b/node_modules/mime/LICENSE new file mode 100644 index 000000000..d3f46f7e1 --- /dev/null +++ b/node_modules/mime/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2010 Benjamin Thomas, Robert Kieffer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/mime/README.md b/node_modules/mime/README.md new file mode 100644 index 000000000..506fbe550 --- /dev/null +++ b/node_modules/mime/README.md @@ -0,0 +1,90 @@ +# mime + +Comprehensive MIME type mapping API based on mime-db module. + +## Install + +Install with [npm](http://github.com/isaacs/npm): + + npm install mime + +## Contributing / Testing + + npm run test + +## Command Line + + mime [path_string] + +E.g. + + > mime scripts/jquery.js + application/javascript + +## API - Queries + +### mime.lookup(path) +Get the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g. + +```js +var mime = require('mime'); + +mime.lookup('/path/to/file.txt'); // => 'text/plain' +mime.lookup('file.txt'); // => 'text/plain' +mime.lookup('.TXT'); // => 'text/plain' +mime.lookup('htm'); // => 'text/html' +``` + +### mime.default_type +Sets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.) + +### mime.extension(type) +Get the default extension for `type` + +```js +mime.extension('text/html'); // => 'html' +mime.extension('application/octet-stream'); // => 'bin' +``` + +### mime.charsets.lookup() + +Map mime-type to charset + +```js +mime.charsets.lookup('text/plain'); // => 'UTF-8' +``` + +(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.) + +## API - Defining Custom Types + +Custom type mappings can be added on a per-project basis via the following APIs. + +### mime.define() + +Add custom mime/extension mappings + +```js +mime.define({ + 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'], + 'application/x-my-type': ['x-mt', 'x-mtt'], + // etc ... +}); + +mime.lookup('x-sft'); // => 'text/x-some-format' +``` + +The first entry in the extensions array is returned by `mime.extension()`. E.g. + +```js +mime.extension('text/x-some-format'); // => 'x-sf' +``` + +### mime.load(filepath) + +Load mappings from an Apache ".types" format file + +```js +mime.load('./my_project.types'); +``` +The .types file format is simple - See the `types` dir for examples. diff --git a/node_modules/mime/build/build.js b/node_modules/mime/build/build.js new file mode 100644 index 000000000..ed5313e3c --- /dev/null +++ b/node_modules/mime/build/build.js @@ -0,0 +1,11 @@ +var db = require('mime-db'); + +var mapByType = {}; +Object.keys(db).forEach(function(key) { + var extensions = db[key].extensions; + if (extensions) { + mapByType[key] = extensions; + } +}); + +console.log(JSON.stringify(mapByType)); diff --git a/node_modules/mime/build/test.js b/node_modules/mime/build/test.js new file mode 100644 index 000000000..010c42b98 --- /dev/null +++ b/node_modules/mime/build/test.js @@ -0,0 +1,60 @@ +/** + * Usage: node test.js + */ + +var mime = require('../mime'); +var assert = require('assert'); +var path = require('path'); + +// +// Test mime lookups +// + +assert.equal('text/plain', mime.lookup('text.txt')); // normal file +assert.equal('text/plain', mime.lookup('TEXT.TXT')); // uppercase +assert.equal('text/plain', mime.lookup('dir/text.txt')); // dir + file +assert.equal('text/plain', mime.lookup('.text.txt')); // hidden file +assert.equal('text/plain', mime.lookup('.txt')); // nameless +assert.equal('text/plain', mime.lookup('txt')); // extension-only +assert.equal('text/plain', mime.lookup('/txt')); // extension-less () +assert.equal('text/plain', mime.lookup('\\txt')); // Windows, extension-less +assert.equal('application/octet-stream', mime.lookup('text.nope')); // unrecognized +assert.equal('fallback', mime.lookup('text.fallback', 'fallback')); // alternate default + +// +// Test extensions +// + +assert.equal('txt', mime.extension(mime.types.text)); +assert.equal('html', mime.extension(mime.types.htm)); +assert.equal('bin', mime.extension('application/octet-stream')); +assert.equal('bin', mime.extension('application/octet-stream ')); +assert.equal('html', mime.extension(' text/html; charset=UTF-8')); +assert.equal('html', mime.extension('text/html; charset=UTF-8 ')); +assert.equal('html', mime.extension('text/html; charset=UTF-8')); +assert.equal('html', mime.extension('text/html ; charset=UTF-8')); +assert.equal('html', mime.extension('text/html;charset=UTF-8')); +assert.equal('html', mime.extension('text/Html;charset=UTF-8')); +assert.equal(undefined, mime.extension('unrecognized')); + +// +// Test node.types lookups +// + +assert.equal('application/font-woff', mime.lookup('file.woff')); +assert.equal('application/octet-stream', mime.lookup('file.buffer')); +// TODO: Uncomment once #157 is resolved +// assert.equal('audio/mp4', mime.lookup('file.m4a')); +assert.equal('font/otf', mime.lookup('file.otf')); + +// +// Test charsets +// + +assert.equal('UTF-8', mime.charsets.lookup('text/plain')); +assert.equal('UTF-8', mime.charsets.lookup(mime.types.js)); +assert.equal('UTF-8', mime.charsets.lookup(mime.types.json)); +assert.equal(undefined, mime.charsets.lookup(mime.types.bin)); +assert.equal('fallback', mime.charsets.lookup('application/octet-stream', 'fallback')); + +console.log('\nAll tests passed'); diff --git a/node_modules/mime/cli.js b/node_modules/mime/cli.js new file mode 100755 index 000000000..20b1ffeb2 --- /dev/null +++ b/node_modules/mime/cli.js @@ -0,0 +1,8 @@ +#!/usr/bin/env node + +var mime = require('./mime.js'); +var file = process.argv[2]; +var type = mime.lookup(file); + +process.stdout.write(type + '\n'); + diff --git a/node_modules/mime/mime.js b/node_modules/mime/mime.js new file mode 100644 index 000000000..d7efbde70 --- /dev/null +++ b/node_modules/mime/mime.js @@ -0,0 +1,108 @@ +var path = require('path'); +var fs = require('fs'); + +function Mime() { + // Map of extension -> mime type + this.types = Object.create(null); + + // Map of mime type -> extension + this.extensions = Object.create(null); +} + +/** + * Define mimetype -> extension mappings. Each key is a mime-type that maps + * to an array of extensions associated with the type. The first extension is + * used as the default extension for the type. + * + * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); + * + * @param map (Object) type definitions + */ +Mime.prototype.define = function (map) { + for (var type in map) { + var exts = map[type]; + for (var i = 0; i < exts.length; i++) { + if (process.env.DEBUG_MIME && this.types[exts[i]]) { + console.warn((this._loading || "define()").replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' + + this.types[exts[i]] + ' to ' + type); + } + + this.types[exts[i]] = type; + } + + // Default extension is the first one we encounter + if (!this.extensions[type]) { + this.extensions[type] = exts[0]; + } + } +}; + +/** + * Load an Apache2-style ".types" file + * + * This may be called multiple times (it's expected). Where files declare + * overlapping types/extensions, the last file wins. + * + * @param file (String) path of file to load. + */ +Mime.prototype.load = function(file) { + this._loading = file; + // Read file and split into lines + var map = {}, + content = fs.readFileSync(file, 'ascii'), + lines = content.split(/[\r\n]+/); + + lines.forEach(function(line) { + // Clean up whitespace/comments, and split into fields + var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/); + map[fields.shift()] = fields; + }); + + this.define(map); + + this._loading = null; +}; + +/** + * Lookup a mime type based on extension + */ +Mime.prototype.lookup = function(path, fallback) { + var ext = path.replace(/^.*[\.\/\\]/, '').toLowerCase(); + + return this.types[ext] || fallback || this.default_type; +}; + +/** + * Return file extension associated with a mime type + */ +Mime.prototype.extension = function(mimeType) { + var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase(); + return this.extensions[type]; +}; + +// Default instance +var mime = new Mime(); + +// Define built-in types +mime.define(require('./types.json')); + +// Default type +mime.default_type = mime.lookup('bin'); + +// +// Additional API specific to the default instance +// + +mime.Mime = Mime; + +/** + * Lookup a charset based on mime type. + */ +mime.charsets = { + lookup: function(mimeType, fallback) { + // Assume text types are utf8 + return (/^text\/|^application\/(javascript|json)/).test(mimeType) ? 'UTF-8' : fallback; + } +}; + +module.exports = mime; diff --git a/node_modules/mime/package.json b/node_modules/mime/package.json new file mode 100644 index 000000000..0711a389a --- /dev/null +++ b/node_modules/mime/package.json @@ -0,0 +1,67 @@ +{ + "_from": "mime@1.4.1", + "_id": "mime@1.4.1", + "_inBundle": false, + "_integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", + "_location": "/mime", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "mime@1.4.1", + "name": "mime", + "escapedName": "mime", + "rawSpec": "1.4.1", + "saveSpec": null, + "fetchSpec": "1.4.1" + }, + "_requiredBy": [ + "/send" + ], + "_resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", + "_shasum": "121f9ebc49e3766f311a76e1fa1c8003c4b03aa6", + "_spec": "mime@1.4.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/send", + "author": { + "name": "Robert Kieffer", + "email": "robert@broofa.com", + "url": "http://github.com/broofa" + }, + "bin": { + "mime": "cli.js" + }, + "bugs": { + "url": "https://github.com/broofa/node-mime/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Benjamin Thomas", + "email": "benjamin@benjaminthomas.org", + "url": "http://github.com/bentomas" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "A comprehensive library for mime-type mapping", + "devDependencies": { + "mime-db": "1.30.0" + }, + "homepage": "https://github.com/broofa/node-mime#readme", + "keywords": [ + "util", + "mime" + ], + "license": "MIT", + "main": "mime.js", + "name": "mime", + "repository": { + "url": "git+https://github.com/broofa/node-mime.git", + "type": "git" + }, + "scripts": { + "prepublish": "node build/build.js > types.json", + "test": "node build/test.js" + }, + "version": "1.4.1" +} diff --git a/node_modules/mime/types.json b/node_modules/mime/types.json new file mode 100644 index 000000000..5369cd1ca --- /dev/null +++ b/node_modules/mime/types.json @@ -0,0 +1 @@ +{"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":["woff"],"application/font-woff2":["woff2"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/prs.cww":["cww"],"application/pskc+xml":["pskcxml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/voicexml+xml":["vxml"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-otf":["otf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-ttf":["ttf","ttc"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["iso"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["exe"],"application/x-msdownload":["exe","dll","com","bat","msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","wmz","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["prc","pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["3gpp"],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp3":["mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/wav":["wav"],"audio/wave":["wav"],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["ra"],"audio/x-wav":["wav"],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/otf":["otf"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jpeg":["jpeg","jpg","jpe"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["bmp"],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/rtf":["rtf"],"text/sgml":["sgml","sgm"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/xml":["xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]} diff --git a/node_modules/minimalistic-assert/LICENSE b/node_modules/minimalistic-assert/LICENSE new file mode 100644 index 000000000..adca66b32 --- /dev/null +++ b/node_modules/minimalistic-assert/LICENSE @@ -0,0 +1,13 @@ +Copyright 2015 Calvin Metcalf + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/node_modules/minimalistic-assert/index.js b/node_modules/minimalistic-assert/index.js new file mode 100644 index 000000000..70b4ea5bb --- /dev/null +++ b/node_modules/minimalistic-assert/index.js @@ -0,0 +1,11 @@ +module.exports = assert; + +function assert(val, msg) { + if (!val) + throw new Error(msg || 'Assertion failed'); +} + +assert.equal = function assertEqual(l, r, msg) { + if (l != r) + throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r)); +}; diff --git a/node_modules/minimalistic-assert/package.json b/node_modules/minimalistic-assert/package.json new file mode 100644 index 000000000..a46dab98f --- /dev/null +++ b/node_modules/minimalistic-assert/package.json @@ -0,0 +1,48 @@ +{ + "_from": "minimalistic-assert@^1.0.0", + "_id": "minimalistic-assert@1.0.1", + "_inBundle": false, + "_integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "_location": "/minimalistic-assert", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "minimalistic-assert@^1.0.0", + "name": "minimalistic-assert", + "escapedName": "minimalistic-assert", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/asn1.js", + "/des.js", + "/elliptic", + "/hash.js", + "/hmac-drbg" + ], + "_resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "_shasum": "2e194de044626d4a10e7f7fbc00ce73e83e4d5c7", + "_spec": "minimalistic-assert@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/des.js", + "author": "", + "bugs": { + "url": "https://github.com/calvinmetcalf/minimalistic-assert/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "minimalistic-assert ===", + "homepage": "https://github.com/calvinmetcalf/minimalistic-assert", + "license": "ISC", + "main": "index.js", + "name": "minimalistic-assert", + "repository": { + "type": "git", + "url": "git+https://github.com/calvinmetcalf/minimalistic-assert.git" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "1.0.1" +} diff --git a/node_modules/minimalistic-assert/readme.md b/node_modules/minimalistic-assert/readme.md new file mode 100644 index 000000000..2ca0d256e --- /dev/null +++ b/node_modules/minimalistic-assert/readme.md @@ -0,0 +1,4 @@ +minimalistic-assert +=== + +very minimalistic assert module. diff --git a/node_modules/minimalistic-crypto-utils/.npmignore b/node_modules/minimalistic-crypto-utils/.npmignore new file mode 100644 index 000000000..1ca957177 --- /dev/null +++ b/node_modules/minimalistic-crypto-utils/.npmignore @@ -0,0 +1,2 @@ +node_modules/ +npm-debug.log diff --git a/node_modules/minimalistic-crypto-utils/.travis.yml b/node_modules/minimalistic-crypto-utils/.travis.yml new file mode 100644 index 000000000..ce24b7a77 --- /dev/null +++ b/node_modules/minimalistic-crypto-utils/.travis.yml @@ -0,0 +1,11 @@ +sudo: false + +language: node_js + +node_js: + - "4" + - "6" + - "stable" + +script: + - npm test diff --git a/node_modules/minimalistic-crypto-utils/README.md b/node_modules/minimalistic-crypto-utils/README.md new file mode 100644 index 000000000..9e58eba89 --- /dev/null +++ b/node_modules/minimalistic-crypto-utils/README.md @@ -0,0 +1,47 @@ +# minimalistic-crypto-utils +[![Build Status](https://secure.travis-ci.org/indutny/minimalistic-crypto-utils.svg)](http://travis-ci.org/indutny/minimalistic-crypto-utils) +[![NPM version](https://badge.fury.io/js/minimalistic-crypto-utils.svg)](http://badge.fury.io/js/minimalistic-crypto-utils) + +Very minimal utils that are required in order to write reasonable JS-only +crypto module. + +## Usage + +```js +const utils = require('minimalistic-crypto-utils'); + +utils.toArray('abcd', 'hex'); +utils.encode([ 1, 2, 3, 4 ], 'hex'); +utils.toHex([ 1, 2, 3, 4 ]); +``` + +#### LICENSE + +This software is licensed under the MIT License. + +Copyright Fedor Indutny, 2017. + +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. + +[0]: http://tools.ietf.org/html/rfc6979 +[1]: https://github.com/indutny/bn.js +[2]: https://github.com/indutny/hash.js +[3]: https://github.com/bitchan/eccrypto +[4]: https://github.com/wanderer/secp256k1-node diff --git a/node_modules/minimalistic-crypto-utils/lib/utils.js b/node_modules/minimalistic-crypto-utils/lib/utils.js new file mode 100644 index 000000000..cd48daf12 --- /dev/null +++ b/node_modules/minimalistic-crypto-utils/lib/utils.js @@ -0,0 +1,58 @@ +'use strict'; + +var utils = exports; + +function toArray(msg, enc) { + if (Array.isArray(msg)) + return msg.slice(); + if (!msg) + return []; + var res = []; + if (typeof msg !== 'string') { + for (var i = 0; i < msg.length; i++) + res[i] = msg[i] | 0; + return res; + } + if (enc === 'hex') { + msg = msg.replace(/[^a-z0-9]+/ig, ''); + if (msg.length % 2 !== 0) + msg = '0' + msg; + for (var i = 0; i < msg.length; i += 2) + res.push(parseInt(msg[i] + msg[i + 1], 16)); + } else { + for (var i = 0; i < msg.length; i++) { + var c = msg.charCodeAt(i); + var hi = c >> 8; + var lo = c & 0xff; + if (hi) + res.push(hi, lo); + else + res.push(lo); + } + } + return res; +} +utils.toArray = toArray; + +function zero2(word) { + if (word.length === 1) + return '0' + word; + else + return word; +} +utils.zero2 = zero2; + +function toHex(msg) { + var res = ''; + for (var i = 0; i < msg.length; i++) + res += zero2(msg[i].toString(16)); + return res; +} +utils.toHex = toHex; + +utils.encode = function encode(arr, enc) { + if (enc === 'hex') + return toHex(arr); + else + return arr; +}; diff --git a/node_modules/minimalistic-crypto-utils/package.json b/node_modules/minimalistic-crypto-utils/package.json new file mode 100644 index 000000000..0365fedc6 --- /dev/null +++ b/node_modules/minimalistic-crypto-utils/package.json @@ -0,0 +1,56 @@ +{ + "_from": "minimalistic-crypto-utils@^1.0.0", + "_id": "minimalistic-crypto-utils@1.0.1", + "_inBundle": false, + "_integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "_location": "/minimalistic-crypto-utils", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "minimalistic-crypto-utils@^1.0.0", + "name": "minimalistic-crypto-utils", + "escapedName": "minimalistic-crypto-utils", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/elliptic", + "/hmac-drbg" + ], + "_resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "_shasum": "f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a", + "_spec": "minimalistic-crypto-utils@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/elliptic", + "author": { + "name": "Fedor Indutny", + "email": "fedor@indutny.com" + }, + "bugs": { + "url": "https://github.com/indutny/minimalistic-crypto-utils/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Minimalistic tools for JS crypto modules", + "devDependencies": { + "mocha": "^3.2.0" + }, + "homepage": "https://github.com/indutny/minimalistic-crypto-utils#readme", + "keywords": [ + "minimalistic", + "utils", + "crypto" + ], + "license": "MIT", + "main": "lib/utils.js", + "name": "minimalistic-crypto-utils", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/indutny/minimalistic-crypto-utils.git" + }, + "scripts": { + "test": "mocha --reporter=spec test/*-test.js" + }, + "version": "1.0.1" +} diff --git a/node_modules/minimalistic-crypto-utils/test/utils-test.js b/node_modules/minimalistic-crypto-utils/test/utils-test.js new file mode 100644 index 000000000..3da812dbc --- /dev/null +++ b/node_modules/minimalistic-crypto-utils/test/utils-test.js @@ -0,0 +1,28 @@ +'use strict'; + +const assert = require('assert'); +const utils = require('../'); + +describe('utils', () => { + it('should convert to array', () => { + assert.deepEqual(utils.toArray('1234', 'hex'), [ 0x12, 0x34 ]); + assert.deepEqual(utils.toArray('1234'), [ 49, 50, 51, 52 ]); + assert.deepEqual(utils.toArray('1234', 'utf8'), [ 49, 50, 51, 52 ]); + assert.deepEqual(utils.toArray('\u1234234'), [ 18, 52, 50, 51, 52 ]); + assert.deepEqual(utils.toArray([ 1, 2, 3, 4 ]), [ 1, 2, 3, 4 ]); + }); + + it('should zero pad byte to hex', () => { + assert.equal(utils.zero2('0'), '00'); + assert.equal(utils.zero2('01'), '01'); + }); + + it('should convert to hex', () => { + assert.equal(utils.toHex([ 0, 1, 2, 3 ]), '00010203'); + }); + + it('should encode', () => { + assert.deepEqual(utils.encode([ 0, 1, 2, 3 ]), [ 0, 1, 2, 3 ]); + assert.deepEqual(utils.encode([ 0, 1, 2, 3 ], 'hex'), '00010203'); + }); +}); diff --git a/node_modules/minimatch/LICENSE b/node_modules/minimatch/LICENSE new file mode 100644 index 000000000..19129e315 --- /dev/null +++ b/node_modules/minimatch/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/minimatch/README.md b/node_modules/minimatch/README.md new file mode 100644 index 000000000..ad72b8133 --- /dev/null +++ b/node_modules/minimatch/README.md @@ -0,0 +1,209 @@ +# minimatch + +A minimal matching utility. + +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) + + +This is the matching library used internally by npm. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Usage + +```javascript +var minimatch = require("minimatch") + +minimatch("bar.foo", "*.foo") // true! +minimatch("bar.foo", "*.bar") // false! +minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` + +## Minimatch Class + +Create a minimatch object by instantiating the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require("minimatch").Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +* `pattern` The original pattern the minimatch object represents. +* `options` The options supplied to the constructor. +* `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +* `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +* `negate` True if the pattern is negated. +* `comment` True if the pattern is a comment. +* `empty` True if the pattern is `""`. + +### Methods + +* `makeRe` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +* `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +* `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. + +All other methods are internal, and will be called as necessary. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, "*.js", { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) +``` + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself if this option is set. When not set, an empty list +is returned if there are no matches. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between minimatch and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. diff --git a/node_modules/minimatch/minimatch.js b/node_modules/minimatch/minimatch.js new file mode 100644 index 000000000..5b5f8cf44 --- /dev/null +++ b/node_modules/minimatch/minimatch.js @@ -0,0 +1,923 @@ +module.exports = minimatch +minimatch.Minimatch = Minimatch + +var path = { sep: '/' } +try { + path = require('path') +} catch (er) {} + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = require('brace-expansion') + +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' + +// * => any number of characters +var star = qmark + '*?' + +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' + +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +} + +function minimatch (p, pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } + + // "" only matches "" + if (pattern.trim() === '') return p === '' + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } + + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + pattern = pattern.trim() + + // windows support: need to use /, not \ + if (path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') + } + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function () {} + +Minimatch.prototype.make = make +function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = console.error + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> 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, '\\$&') +} diff --git a/node_modules/minimatch/package.json b/node_modules/minimatch/package.json new file mode 100644 index 000000000..d29a82c56 --- /dev/null +++ b/node_modules/minimatch/package.json @@ -0,0 +1,64 @@ +{ + "_from": "minimatch@^3.0.4", + "_id": "minimatch@3.0.4", + "_inBundle": false, + "_integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "_location": "/minimatch", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "minimatch@^3.0.4", + "name": "minimatch", + "escapedName": "minimatch", + "rawSpec": "^3.0.4", + "saveSpec": null, + "fetchSpec": "^3.0.4" + }, + "_requiredBy": [ + "/glob", + "/resp-modifier" + ], + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "_shasum": "5166e286457f03306064be5497e8dbb0c3d32083", + "_spec": "minimatch@^3.0.4", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/glob", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "bugs": { + "url": "https://github.com/isaacs/minimatch/issues" + }, + "bundleDependencies": false, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "deprecated": false, + "description": "a glob matcher in javascript", + "devDependencies": { + "tap": "^10.3.2" + }, + "engines": { + "node": "*" + }, + "files": [ + "minimatch.js" + ], + "homepage": "https://github.com/isaacs/minimatch#readme", + "license": "ISC", + "main": "minimatch.js", + "name": "minimatch", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "scripts": { + "postpublish": "git push origin --all; git push origin --tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "tap test/*.js --cov" + }, + "version": "3.0.4" +} diff --git a/node_modules/minimist/.travis.yml b/node_modules/minimist/.travis.yml new file mode 100644 index 000000000..74c57bf15 --- /dev/null +++ b/node_modules/minimist/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - "0.8" + - "0.10" + - "0.12" + - "iojs" +before_install: + - npm install -g npm@~1.4.6 diff --git a/node_modules/minimist/LICENSE b/node_modules/minimist/LICENSE new file mode 100644 index 000000000..ee27ba4b4 --- /dev/null +++ b/node_modules/minimist/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/minimist/example/parse.js b/node_modules/minimist/example/parse.js new file mode 100644 index 000000000..abff3e8ee --- /dev/null +++ b/node_modules/minimist/example/parse.js @@ -0,0 +1,2 @@ +var argv = require('../')(process.argv.slice(2)); +console.dir(argv); diff --git a/node_modules/minimist/index.js b/node_modules/minimist/index.js new file mode 100644 index 000000000..6a0559d58 --- /dev/null +++ b/node_modules/minimist/index.js @@ -0,0 +1,236 @@ +module.exports = function (args, opts) { + if (!opts) opts = {}; + + var flags = { bools : {}, strings : {}, unknownFn: null }; + + if (typeof opts['unknown'] === 'function') { + flags.unknownFn = opts['unknown']; + } + + if (typeof opts['boolean'] === 'boolean' && opts['boolean']) { + flags.allBools = true; + } else { + [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { + flags.bools[key] = true; + }); + } + + var aliases = {}; + Object.keys(opts.alias || {}).forEach(function (key) { + aliases[key] = [].concat(opts.alias[key]); + aliases[key].forEach(function (x) { + aliases[x] = [key].concat(aliases[key].filter(function (y) { + return x !== y; + })); + }); + }); + + [].concat(opts.string).filter(Boolean).forEach(function (key) { + flags.strings[key] = true; + if (aliases[key]) { + flags.strings[aliases[key]] = true; + } + }); + + var defaults = opts['default'] || {}; + + var argv = { _ : [] }; + Object.keys(flags.bools).forEach(function (key) { + setArg(key, defaults[key] === undefined ? false : defaults[key]); + }); + + var notFlags = []; + + if (args.indexOf('--') !== -1) { + notFlags = args.slice(args.indexOf('--')+1); + args = args.slice(0, args.indexOf('--')); + } + + function argDefined(key, arg) { + return (flags.allBools && /^--[^=]+$/.test(arg)) || + flags.strings[key] || flags.bools[key] || aliases[key]; + } + + function setArg (key, val, arg) { + if (arg && flags.unknownFn && !argDefined(key, arg)) { + if (flags.unknownFn(arg) === false) return; + } + + var value = !flags.strings[key] && isNumber(val) + ? Number(val) : val + ; + setKey(argv, key.split('.'), value); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), value); + }); + } + + function setKey (obj, keys, value) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + if (o[key] === undefined) o[key] = {}; + o = o[key]; + }); + + var key = keys[keys.length - 1]; + if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') { + o[key] = value; + } + else if (Array.isArray(o[key])) { + o[key].push(value); + } + else { + o[key] = [ o[key], value ]; + } + } + + function aliasIsBoolean(key) { + return aliases[key].some(function (x) { + return flags.bools[x]; + }); + } + + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + + if (/^--.+=/.test(arg)) { + // Using [\s\S] instead of . because js doesn't support the + // 'dotall' regex modifier. See: + // http://stackoverflow.com/a/1068308/13216 + var m = arg.match(/^--([^=]+)=([\s\S]*)$/); + var key = m[1]; + var value = m[2]; + if (flags.bools[key]) { + value = value !== 'false'; + } + setArg(key, value, arg); + } + else if (/^--no-.+/.test(arg)) { + var key = arg.match(/^--no-(.+)/)[1]; + setArg(key, false, arg); + } + else if (/^--.+/.test(arg)) { + var key = arg.match(/^--(.+)/)[1]; + var next = args[i + 1]; + if (next !== undefined && !/^-/.test(next) + && !flags.bools[key] + && !flags.allBools + && (aliases[key] ? !aliasIsBoolean(key) : true)) { + setArg(key, next, arg); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next === 'true', arg); + i++; + } + else { + setArg(key, flags.strings[key] ? '' : true, arg); + } + } + else if (/^-[^-]+/.test(arg)) { + var letters = arg.slice(1,-1).split(''); + + var broken = false; + for (var j = 0; j < letters.length; j++) { + var next = arg.slice(j+2); + + if (next === '-') { + setArg(letters[j], next, arg) + continue; + } + + if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) { + setArg(letters[j], next.split('=')[1], arg); + broken = true; + break; + } + + if (/[A-Za-z]/.test(letters[j]) + && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { + setArg(letters[j], next, arg); + broken = true; + break; + } + + if (letters[j+1] && letters[j+1].match(/\W/)) { + setArg(letters[j], arg.slice(j+2), arg); + broken = true; + break; + } + else { + setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg); + } + } + + var key = arg.slice(-1)[0]; + if (!broken && key !== '-') { + if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) + && !flags.bools[key] + && (aliases[key] ? !aliasIsBoolean(key) : true)) { + setArg(key, args[i+1], arg); + i++; + } + else if (args[i+1] && /true|false/.test(args[i+1])) { + setArg(key, args[i+1] === 'true', arg); + i++; + } + else { + setArg(key, flags.strings[key] ? '' : true, arg); + } + } + } + else { + if (!flags.unknownFn || flags.unknownFn(arg) !== false) { + argv._.push( + flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) + ); + } + if (opts.stopEarly) { + argv._.push.apply(argv._, args.slice(i + 1)); + break; + } + } + } + + Object.keys(defaults).forEach(function (key) { + if (!hasKey(argv, key.split('.'))) { + setKey(argv, key.split('.'), defaults[key]); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), defaults[key]); + }); + } + }); + + if (opts['--']) { + argv['--'] = new Array(); + notFlags.forEach(function(key) { + argv['--'].push(key); + }); + } + else { + notFlags.forEach(function(key) { + argv._.push(key); + }); + } + + return argv; +}; + +function hasKey (obj, keys) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + o = (o[key] || {}); + }); + + var key = keys[keys.length - 1]; + return key in o; +} + +function isNumber (x) { + if (typeof x === 'number') return true; + if (/^0x[0-9a-f]+$/i.test(x)) return true; + return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); +} + diff --git a/node_modules/minimist/package.json b/node_modules/minimist/package.json new file mode 100644 index 000000000..7a80eead5 --- /dev/null +++ b/node_modules/minimist/package.json @@ -0,0 +1,75 @@ +{ + "_from": "minimist@^1.1.0", + "_id": "minimist@1.2.0", + "_inBundle": false, + "_integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "_location": "/minimist", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "minimist@^1.1.0", + "name": "minimist", + "escapedName": "minimist", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/detective", + "/garnish", + "/subarg" + ], + "_resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "_shasum": "a35008b20f41383eec1fb914f4cd5df79a264284", + "_spec": "minimist@^1.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/subarg", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/minimist/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "parse argument options", + "devDependencies": { + "covert": "^1.0.0", + "tap": "~0.4.0", + "tape": "^3.5.0" + }, + "homepage": "https://github.com/substack/minimist", + "keywords": [ + "argv", + "getopt", + "parser", + "optimist" + ], + "license": "MIT", + "main": "index.js", + "name": "minimist", + "repository": { + "type": "git", + "url": "git://github.com/substack/minimist.git" + }, + "scripts": { + "coverage": "covert test/*.js", + "test": "tap test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "ff/5", + "firefox/latest", + "chrome/10", + "chrome/latest", + "safari/5.1", + "safari/latest", + "opera/12" + ] + }, + "version": "1.2.0" +} diff --git a/node_modules/minimist/readme.markdown b/node_modules/minimist/readme.markdown new file mode 100644 index 000000000..30a74cf8c --- /dev/null +++ b/node_modules/minimist/readme.markdown @@ -0,0 +1,91 @@ +# minimist + +parse argument options + +This module is the guts of optimist's argument parser without all the +fanciful decoration. + +[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist) + +[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist) + +# example + +``` js +var argv = require('minimist')(process.argv.slice(2)); +console.dir(argv); +``` + +``` +$ node example/parse.js -a beep -b boop +{ _: [], a: 'beep', b: 'boop' } +``` + +``` +$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz +{ _: [ 'foo', 'bar', 'baz' ], + x: 3, + y: 4, + n: 5, + a: true, + b: true, + c: true, + beep: 'boop' } +``` + +# methods + +``` js +var parseArgs = require('minimist') +``` + +## var argv = parseArgs(args, opts={}) + +Return an argument object `argv` populated with the array arguments from `args`. + +`argv._` contains all the arguments that didn't have an option associated with +them. + +Numeric-looking arguments will be returned as numbers unless `opts.string` or +`opts.boolean` is set for that argument name. + +Any arguments after `'--'` will not be parsed and will end up in `argv._`. + +options can be: + +* `opts.string` - a string or array of strings argument names to always treat as +strings +* `opts.boolean` - a boolean, string or array of strings to always treat as +booleans. if `true` will treat all double hyphenated arguments without equal signs +as boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`) +* `opts.alias` - an object mapping string names to strings or arrays of string +argument names to use as aliases +* `opts.default` - an object mapping string argument names to default values +* `opts.stopEarly` - when true, populate `argv._` with everything after the +first non-option +* `opts['--']` - when true, populate `argv._` with everything before the `--` +and `argv['--']` with everything after the `--`. Here's an example: +* `opts.unknown` - a function which is invoked with a command line parameter not +defined in the `opts` configuration object. If the function returns `false`, the +unknown option is not added to `argv`. + +``` +> require('./')('one two three -- four five --six'.split(' '), { '--': true }) +{ _: [ 'one', 'two', 'three' ], + '--': [ 'four', 'five', '--six' ] } +``` + +Note that with `opts['--']` set, parsing for arguments still stops after the +`--`. + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install minimist +``` + +# license + +MIT diff --git a/node_modules/minimist/test/all_bool.js b/node_modules/minimist/test/all_bool.js new file mode 100644 index 000000000..ac835483d --- /dev/null +++ b/node_modules/minimist/test/all_bool.js @@ -0,0 +1,32 @@ +var parse = require('../'); +var test = require('tape'); + +test('flag boolean true (default all --args to boolean)', function (t) { + var argv = parse(['moo', '--honk', 'cow'], { + boolean: true + }); + + t.deepEqual(argv, { + honk: true, + _: ['moo', 'cow'] + }); + + t.deepEqual(typeof argv.honk, 'boolean'); + t.end(); +}); + +test('flag boolean true only affects double hyphen arguments without equals signs', function (t) { + var argv = parse(['moo', '--honk', 'cow', '-p', '55', '--tacos=good'], { + boolean: true + }); + + t.deepEqual(argv, { + honk: true, + tacos: 'good', + p: 55, + _: ['moo', 'cow'] + }); + + t.deepEqual(typeof argv.honk, 'boolean'); + t.end(); +}); diff --git a/node_modules/minimist/test/bool.js b/node_modules/minimist/test/bool.js new file mode 100644 index 000000000..14b0717ce --- /dev/null +++ b/node_modules/minimist/test/bool.js @@ -0,0 +1,166 @@ +var parse = require('../'); +var test = require('tape'); + +test('flag boolean default false', function (t) { + var argv = parse(['moo'], { + boolean: ['t', 'verbose'], + default: { verbose: false, t: false } + }); + + t.deepEqual(argv, { + verbose: false, + t: false, + _: ['moo'] + }); + + t.deepEqual(typeof argv.verbose, 'boolean'); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); + +}); + +test('boolean groups', function (t) { + var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { + boolean: ['x','y','z'] + }); + + t.deepEqual(argv, { + x : true, + y : false, + z : true, + _ : [ 'one', 'two', 'three' ] + }); + + t.deepEqual(typeof argv.x, 'boolean'); + t.deepEqual(typeof argv.y, 'boolean'); + t.deepEqual(typeof argv.z, 'boolean'); + t.end(); +}); +test('boolean and alias with chainable api', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + herp: { alias: 'h', boolean: true } + }; + var aliasedArgv = parse(aliased, { + boolean: 'herp', + alias: { h: 'herp' } + }); + var propertyArgv = parse(regular, { + boolean: 'herp', + alias: { h: 'herp' } + }); + var expected = { + herp: true, + h: true, + '_': [ 'derp' ] + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias with options hash', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + alias: { 'h': 'herp' }, + boolean: 'herp' + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var expected = { + herp: true, + h: true, + '_': [ 'derp' ] + }; + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias array with options hash', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var alt = [ '--harp', 'derp' ]; + var opts = { + alias: { 'h': ['herp', 'harp'] }, + boolean: 'h' + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var altPropertyArgv = parse(alt, opts); + var expected = { + harp: true, + herp: true, + h: true, + '_': [ 'derp' ] + }; + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.same(altPropertyArgv, expected); + t.end(); +}); + +test('boolean and alias using explicit true', function (t) { + var aliased = [ '-h', 'true' ]; + var regular = [ '--herp', 'true' ]; + var opts = { + alias: { h: 'herp' }, + boolean: 'h' + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var expected = { + herp: true, + h: true, + '_': [ ] + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +// regression, see https://github.com/substack/node-optimist/issues/71 +test('boolean and --x=true', function(t) { + var parsed = parse(['--boool', '--other=true'], { + boolean: 'boool' + }); + + t.same(parsed.boool, true); + t.same(parsed.other, 'true'); + + parsed = parse(['--boool', '--other=false'], { + boolean: 'boool' + }); + + t.same(parsed.boool, true); + t.same(parsed.other, 'false'); + t.end(); +}); + +test('boolean --boool=true', function (t) { + var parsed = parse(['--boool=true'], { + default: { + boool: false + }, + boolean: ['boool'] + }); + + t.same(parsed.boool, true); + t.end(); +}); + +test('boolean --boool=false', function (t) { + var parsed = parse(['--boool=false'], { + default: { + boool: true + }, + boolean: ['boool'] + }); + + t.same(parsed.boool, false); + t.end(); +}); diff --git a/node_modules/minimist/test/dash.js b/node_modules/minimist/test/dash.js new file mode 100644 index 000000000..5a4fa5be4 --- /dev/null +++ b/node_modules/minimist/test/dash.js @@ -0,0 +1,31 @@ +var parse = require('../'); +var test = require('tape'); + +test('-', function (t) { + t.plan(5); + t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] }); + t.deepEqual(parse([ '-' ]), { _: [ '-' ] }); + t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] }); + t.deepEqual( + parse([ '-b', '-' ], { boolean: 'b' }), + { b: true, _: [ '-' ] } + ); + t.deepEqual( + parse([ '-s', '-' ], { string: 's' }), + { s: '-', _: [] } + ); +}); + +test('-a -- b', function (t) { + t.plan(3); + t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] }); + t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); + t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); +}); + +test('move arguments after the -- into their own `--` array', function(t) { + t.plan(1); + t.deepEqual( + parse([ '--name', 'John', 'before', '--', 'after' ], { '--': true }), + { name: 'John', _: [ 'before' ], '--': [ 'after' ] }); +}); diff --git a/node_modules/minimist/test/default_bool.js b/node_modules/minimist/test/default_bool.js new file mode 100644 index 000000000..780a31127 --- /dev/null +++ b/node_modules/minimist/test/default_bool.js @@ -0,0 +1,35 @@ +var test = require('tape'); +var parse = require('../'); + +test('boolean default true', function (t) { + var argv = parse([], { + boolean: 'sometrue', + default: { sometrue: true } + }); + t.equal(argv.sometrue, true); + t.end(); +}); + +test('boolean default false', function (t) { + var argv = parse([], { + boolean: 'somefalse', + default: { somefalse: false } + }); + t.equal(argv.somefalse, false); + t.end(); +}); + +test('boolean default to null', function (t) { + var argv = parse([], { + boolean: 'maybe', + default: { maybe: null } + }); + t.equal(argv.maybe, null); + var argv = parse(['--maybe'], { + boolean: 'maybe', + default: { maybe: null } + }); + t.equal(argv.maybe, true); + t.end(); + +}) diff --git a/node_modules/minimist/test/dotted.js b/node_modules/minimist/test/dotted.js new file mode 100644 index 000000000..d8b3e856e --- /dev/null +++ b/node_modules/minimist/test/dotted.js @@ -0,0 +1,22 @@ +var parse = require('../'); +var test = require('tape'); + +test('dotted alias', function (t) { + var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); + t.equal(argv.a.b, 22); + t.equal(argv.aa.bb, 22); + t.end(); +}); + +test('dotted default', function (t) { + var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); + t.equal(argv.a.b, 11); + t.equal(argv.aa.bb, 11); + t.end(); +}); + +test('dotted default with no alias', function (t) { + var argv = parse('', {default: {'a.b': 11}}); + t.equal(argv.a.b, 11); + t.end(); +}); diff --git a/node_modules/minimist/test/kv_short.js b/node_modules/minimist/test/kv_short.js new file mode 100644 index 000000000..f813b3050 --- /dev/null +++ b/node_modules/minimist/test/kv_short.js @@ -0,0 +1,16 @@ +var parse = require('../'); +var test = require('tape'); + +test('short -k=v' , function (t) { + t.plan(1); + + var argv = parse([ '-b=123' ]); + t.deepEqual(argv, { b: 123, _: [] }); +}); + +test('multi short -k=v' , function (t) { + t.plan(1); + + var argv = parse([ '-a=whatever', '-b=robots' ]); + t.deepEqual(argv, { a: 'whatever', b: 'robots', _: [] }); +}); diff --git a/node_modules/minimist/test/long.js b/node_modules/minimist/test/long.js new file mode 100644 index 000000000..5d3a1e09d --- /dev/null +++ b/node_modules/minimist/test/long.js @@ -0,0 +1,31 @@ +var test = require('tape'); +var parse = require('../'); + +test('long opts', function (t) { + t.deepEqual( + parse([ '--bool' ]), + { bool : true, _ : [] }, + 'long boolean' + ); + t.deepEqual( + parse([ '--pow', 'xixxle' ]), + { pow : 'xixxle', _ : [] }, + 'long capture sp' + ); + t.deepEqual( + parse([ '--pow=xixxle' ]), + { pow : 'xixxle', _ : [] }, + 'long capture eq' + ); + t.deepEqual( + parse([ '--host', 'localhost', '--port', '555' ]), + { host : 'localhost', port : 555, _ : [] }, + 'long captures sp' + ); + t.deepEqual( + parse([ '--host=localhost', '--port=555' ]), + { host : 'localhost', port : 555, _ : [] }, + 'long captures eq' + ); + t.end(); +}); diff --git a/node_modules/minimist/test/num.js b/node_modules/minimist/test/num.js new file mode 100644 index 000000000..2cc77f4d6 --- /dev/null +++ b/node_modules/minimist/test/num.js @@ -0,0 +1,36 @@ +var parse = require('../'); +var test = require('tape'); + +test('nums', function (t) { + var argv = parse([ + '-x', '1234', + '-y', '5.67', + '-z', '1e7', + '-w', '10f', + '--hex', '0xdeadbeef', + '789' + ]); + t.deepEqual(argv, { + x : 1234, + y : 5.67, + z : 1e7, + w : '10f', + hex : 0xdeadbeef, + _ : [ 789 ] + }); + t.deepEqual(typeof argv.x, 'number'); + t.deepEqual(typeof argv.y, 'number'); + t.deepEqual(typeof argv.z, 'number'); + t.deepEqual(typeof argv.w, 'string'); + t.deepEqual(typeof argv.hex, 'number'); + t.deepEqual(typeof argv._[0], 'number'); + t.end(); +}); + +test('already a number', function (t) { + var argv = parse([ '-x', 1234, 789 ]); + t.deepEqual(argv, { x : 1234, _ : [ 789 ] }); + t.deepEqual(typeof argv.x, 'number'); + t.deepEqual(typeof argv._[0], 'number'); + t.end(); +}); diff --git a/node_modules/minimist/test/parse.js b/node_modules/minimist/test/parse.js new file mode 100644 index 000000000..7b4a2a17c --- /dev/null +++ b/node_modules/minimist/test/parse.js @@ -0,0 +1,197 @@ +var parse = require('../'); +var test = require('tape'); + +test('parse args', function (t) { + t.deepEqual( + parse([ '--no-moo' ]), + { moo : false, _ : [] }, + 'no' + ); + t.deepEqual( + parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), + { v : ['a','b','c'], _ : [] }, + 'multi' + ); + t.end(); +}); + +test('comprehensive', function (t) { + t.deepEqual( + parse([ + '--name=meowmers', 'bare', '-cats', 'woo', + '-h', 'awesome', '--multi=quux', + '--key', 'value', + '-b', '--bool', '--no-meep', '--multi=baz', + '--', '--not-a-flag', 'eek' + ]), + { + c : true, + a : true, + t : true, + s : 'woo', + h : 'awesome', + b : true, + bool : true, + key : 'value', + multi : [ 'quux', 'baz' ], + meep : false, + name : 'meowmers', + _ : [ 'bare', '--not-a-flag', 'eek' ] + } + ); + t.end(); +}); + +test('flag boolean', function (t) { + var argv = parse([ '-t', 'moo' ], { boolean: 't' }); + t.deepEqual(argv, { t : true, _ : [ 'moo' ] }); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); +}); + +test('flag boolean value', function (t) { + var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], { + boolean: [ 't', 'verbose' ], + default: { verbose: true } + }); + + t.deepEqual(argv, { + verbose: false, + t: true, + _: ['moo'] + }); + + t.deepEqual(typeof argv.verbose, 'boolean'); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); +}); + +test('newlines in params' , function (t) { + var args = parse([ '-s', "X\nX" ]) + t.deepEqual(args, { _ : [], s : "X\nX" }); + + // reproduce in bash: + // VALUE="new + // line" + // node program.js --s="$VALUE" + args = parse([ "--s=X\nX" ]) + t.deepEqual(args, { _ : [], s : "X\nX" }); + t.end(); +}); + +test('strings' , function (t) { + var s = parse([ '-s', '0001234' ], { string: 's' }).s; + t.equal(s, '0001234'); + t.equal(typeof s, 'string'); + + var x = parse([ '-x', '56' ], { string: 'x' }).x; + t.equal(x, '56'); + t.equal(typeof x, 'string'); + t.end(); +}); + +test('stringArgs', function (t) { + var s = parse([ ' ', ' ' ], { string: '_' })._; + t.same(s.length, 2); + t.same(typeof s[0], 'string'); + t.same(s[0], ' '); + t.same(typeof s[1], 'string'); + t.same(s[1], ' '); + t.end(); +}); + +test('empty strings', function(t) { + var s = parse([ '-s' ], { string: 's' }).s; + t.equal(s, ''); + t.equal(typeof s, 'string'); + + var str = parse([ '--str' ], { string: 'str' }).str; + t.equal(str, ''); + t.equal(typeof str, 'string'); + + var letters = parse([ '-art' ], { + string: [ 'a', 't' ] + }); + + t.equal(letters.a, ''); + t.equal(letters.r, true); + t.equal(letters.t, ''); + + t.end(); +}); + + +test('string and alias', function(t) { + var x = parse([ '--str', '000123' ], { + string: 's', + alias: { s: 'str' } + }); + + t.equal(x.str, '000123'); + t.equal(typeof x.str, 'string'); + t.equal(x.s, '000123'); + t.equal(typeof x.s, 'string'); + + var y = parse([ '-s', '000123' ], { + string: 'str', + alias: { str: 's' } + }); + + t.equal(y.str, '000123'); + t.equal(typeof y.str, 'string'); + t.equal(y.s, '000123'); + t.equal(typeof y.s, 'string'); + t.end(); +}); + +test('slashBreak', function (t) { + t.same( + parse([ '-I/foo/bar/baz' ]), + { I : '/foo/bar/baz', _ : [] } + ); + t.same( + parse([ '-xyz/foo/bar/baz' ]), + { x : true, y : true, z : '/foo/bar/baz', _ : [] } + ); + t.end(); +}); + +test('alias', function (t) { + var argv = parse([ '-f', '11', '--zoom', '55' ], { + alias: { z: 'zoom' } + }); + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.f, 11); + t.end(); +}); + +test('multiAlias', function (t) { + var argv = parse([ '-f', '11', '--zoom', '55' ], { + alias: { z: [ 'zm', 'zoom' ] } + }); + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.z, argv.zm); + t.equal(argv.f, 11); + t.end(); +}); + +test('nested dotted objects', function (t) { + var argv = parse([ + '--foo.bar', '3', '--foo.baz', '4', + '--foo.quux.quibble', '5', '--foo.quux.o_O', + '--beep.boop' + ]); + + t.same(argv.foo, { + bar : 3, + baz : 4, + quux : { + quibble : 5, + o_O : true + } + }); + t.same(argv.beep, { boop : true }); + t.end(); +}); diff --git a/node_modules/minimist/test/parse_modified.js b/node_modules/minimist/test/parse_modified.js new file mode 100644 index 000000000..ab620dc5e --- /dev/null +++ b/node_modules/minimist/test/parse_modified.js @@ -0,0 +1,9 @@ +var parse = require('../'); +var test = require('tape'); + +test('parse with modifier functions' , function (t) { + t.plan(1); + + var argv = parse([ '-b', '123' ], { boolean: 'b' }); + t.deepEqual(argv, { b: true, _: [123] }); +}); diff --git a/node_modules/minimist/test/short.js b/node_modules/minimist/test/short.js new file mode 100644 index 000000000..d513a1c25 --- /dev/null +++ b/node_modules/minimist/test/short.js @@ -0,0 +1,67 @@ +var parse = require('../'); +var test = require('tape'); + +test('numeric short args', function (t) { + t.plan(2); + t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] }); + t.deepEqual( + parse([ '-123', '456' ]), + { 1: true, 2: true, 3: 456, _: [] } + ); +}); + +test('short', function (t) { + t.deepEqual( + parse([ '-b' ]), + { b : true, _ : [] }, + 'short boolean' + ); + t.deepEqual( + parse([ 'foo', 'bar', 'baz' ]), + { _ : [ 'foo', 'bar', 'baz' ] }, + 'bare' + ); + t.deepEqual( + parse([ '-cats' ]), + { c : true, a : true, t : true, s : true, _ : [] }, + 'group' + ); + t.deepEqual( + parse([ '-cats', 'meow' ]), + { c : true, a : true, t : true, s : 'meow', _ : [] }, + 'short group next' + ); + t.deepEqual( + parse([ '-h', 'localhost' ]), + { h : 'localhost', _ : [] }, + 'short capture' + ); + t.deepEqual( + parse([ '-h', 'localhost', '-p', '555' ]), + { h : 'localhost', p : 555, _ : [] }, + 'short captures' + ); + t.end(); +}); + +test('mixed short bool and capture', function (t) { + t.same( + parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ] + } + ); + t.end(); +}); + +test('short and long', function (t) { + t.deepEqual( + parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ] + } + ); + t.end(); +}); diff --git a/node_modules/minimist/test/stop_early.js b/node_modules/minimist/test/stop_early.js new file mode 100644 index 000000000..bdf9fbcb0 --- /dev/null +++ b/node_modules/minimist/test/stop_early.js @@ -0,0 +1,15 @@ +var parse = require('../'); +var test = require('tape'); + +test('stops parsing on the first non-option when stopEarly is set', function (t) { + var argv = parse(['--aaa', 'bbb', 'ccc', '--ddd'], { + stopEarly: true + }); + + t.deepEqual(argv, { + aaa: 'bbb', + _: ['ccc', '--ddd'] + }); + + t.end(); +}); diff --git a/node_modules/minimist/test/unknown.js b/node_modules/minimist/test/unknown.js new file mode 100644 index 000000000..462a36bdd --- /dev/null +++ b/node_modules/minimist/test/unknown.js @@ -0,0 +1,102 @@ +var parse = require('../'); +var test = require('tape'); + +test('boolean and alias is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var aliased = [ '-h', 'true', '--derp', 'true' ]; + var regular = [ '--herp', 'true', '-d', 'true' ]; + var opts = { + alias: { h: 'herp' }, + boolean: 'h', + unknown: unknownFn + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + + t.same(unknown, ['--derp', '-d']); + t.end(); +}); + +test('flag boolean true any double hyphen argument is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var argv = parse(['--honk', '--tacos=good', 'cow', '-p', '55'], { + boolean: true, + unknown: unknownFn + }); + t.same(unknown, ['--tacos=good', 'cow', '-p']); + t.same(argv, { + honk: true, + _: [] + }); + t.end(); +}); + +test('string and alias is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var aliased = [ '-h', 'hello', '--derp', 'goodbye' ]; + var regular = [ '--herp', 'hello', '-d', 'moon' ]; + var opts = { + alias: { h: 'herp' }, + string: 'h', + unknown: unknownFn + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + + t.same(unknown, ['--derp', '-d']); + t.end(); +}); + +test('default and alias is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var aliased = [ '-h', 'hello' ]; + var regular = [ '--herp', 'hello' ]; + var opts = { + default: { 'h': 'bar' }, + alias: { 'h': 'herp' }, + unknown: unknownFn + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + + t.same(unknown, []); + t.end(); + unknownFn(); // exercise fn for 100% coverage +}); + +test('value following -- is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var aliased = [ '--bad', '--', 'good', 'arg' ]; + var opts = { + '--': true, + unknown: unknownFn + }; + var argv = parse(aliased, opts); + + t.same(unknown, ['--bad']); + t.same(argv, { + '--': ['good', 'arg'], + '_': [] + }) + t.end(); +}); diff --git a/node_modules/minimist/test/whitespace.js b/node_modules/minimist/test/whitespace.js new file mode 100644 index 000000000..8a52a58ce --- /dev/null +++ b/node_modules/minimist/test/whitespace.js @@ -0,0 +1,8 @@ +var parse = require('../'); +var test = require('tape'); + +test('whitespace should be whitespace' , function (t) { + t.plan(1); + var x = parse([ '-x', '\t' ]).x; + t.equal(x, '\t'); +}); diff --git a/node_modules/mixin-deep/LICENSE b/node_modules/mixin-deep/LICENSE new file mode 100644 index 000000000..99c936915 --- /dev/null +++ b/node_modules/mixin-deep/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, 2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/mixin-deep/README.md b/node_modules/mixin-deep/README.md new file mode 100644 index 000000000..111bde00b --- /dev/null +++ b/node_modules/mixin-deep/README.md @@ -0,0 +1,80 @@ +# mixin-deep [![NPM version](https://img.shields.io/npm/v/mixin-deep.svg?style=flat)](https://www.npmjs.com/package/mixin-deep) [![NPM monthly downloads](https://img.shields.io/npm/dm/mixin-deep.svg?style=flat)](https://npmjs.org/package/mixin-deep) [![NPM total downloads](https://img.shields.io/npm/dt/mixin-deep.svg?style=flat)](https://npmjs.org/package/mixin-deep) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/mixin-deep.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/mixin-deep) + +> Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save mixin-deep +``` + +## Usage + +```js +var mixinDeep = require('mixin-deep'); + +mixinDeep({a: {aa: 'aa'}}, {a: {bb: 'bb'}}, {a: {cc: 'cc'}}); +//=> { a: { aa: 'aa', bb: 'bb', cc: 'cc' } } +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [defaults-deep](https://www.npmjs.com/package/defaults-deep): Like `extend` but recursively copies only the missing properties/values to the target object. | [homepage](https://github.com/jonschlinkert/defaults-deep "Like `extend` but recursively copies only the missing properties/values to the target object.") +* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") +* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") +* [mixin-object](https://www.npmjs.com/package/mixin-object): Mixin the own and inherited properties of other objects onto the first object. Pass an… [more](https://github.com/jonschlinkert/mixin-object) | [homepage](https://github.com/jonschlinkert/mixin-object "Mixin the own and inherited properties of other objects onto the first object. Pass an empty object as the first arg to shallow clone.") + +### Author + +**Jon Schlinkert** + +* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on December 09, 2017._ \ No newline at end of file diff --git a/node_modules/mixin-deep/index.js b/node_modules/mixin-deep/index.js new file mode 100644 index 000000000..909fbef75 --- /dev/null +++ b/node_modules/mixin-deep/index.js @@ -0,0 +1,53 @@ +'use strict'; + +var isExtendable = require('is-extendable'); +var forIn = require('for-in'); + +function mixinDeep(target, objects) { + var len = arguments.length, i = 0; + while (++i < len) { + var obj = arguments[i]; + if (isObject(obj)) { + forIn(obj, copy, target); + } + } + return target; +} + +/** + * Copy properties from the source object to the + * target object. + * + * @param {*} `val` + * @param {String} `key` + */ + +function copy(val, key) { + if (key === '__proto__') { + return; + } + + var obj = this[key]; + if (isObject(val) && isObject(obj)) { + mixinDeep(obj, val); + } else { + this[key] = val; + } +} + +/** + * Returns true if `val` is an object or function. + * + * @param {any} val + * @return {Boolean} + */ + +function isObject(val) { + return isExtendable(val) && !Array.isArray(val); +} + +/** + * Expose `mixinDeep` + */ + +module.exports = mixinDeep; diff --git a/node_modules/mixin-deep/node_modules/is-extendable/LICENSE b/node_modules/mixin-deep/node_modules/is-extendable/LICENSE new file mode 100644 index 000000000..c0d7f1362 --- /dev/null +++ b/node_modules/mixin-deep/node_modules/is-extendable/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert. + +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. \ No newline at end of file diff --git a/node_modules/mixin-deep/node_modules/is-extendable/README.md b/node_modules/mixin-deep/node_modules/is-extendable/README.md new file mode 100644 index 000000000..875b56a73 --- /dev/null +++ b/node_modules/mixin-deep/node_modules/is-extendable/README.md @@ -0,0 +1,88 @@ +# is-extendable [![NPM version](https://img.shields.io/npm/v/is-extendable.svg?style=flat)](https://www.npmjs.com/package/is-extendable) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-extendable.svg?style=flat)](https://npmjs.org/package/is-extendable) [![NPM total downloads](https://img.shields.io/npm/dt/is-extendable.svg?style=flat)](https://npmjs.org/package/is-extendable) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-extendable.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-extendable) + +> Returns true if a value is a plain object, array or function. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-extendable +``` + +## Usage + +```js +var isExtendable = require('is-extendable'); +``` + +Returns true if the value is any of the following: + +* array +* plain object +* function + +## Notes + +All objects in JavaScript can have keys, but it's a pain to check for this, since we ether need to verify that the value is not `null` or `undefined` and: + +* the value is not a primitive, or +* that the object is a plain object, function or array + +Also note that an `extendable` object is not the same as an [extensible object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible), which is one that (in es6) is not sealed, frozen, or marked as non-extensible using `preventExtensions`. + +## Release history + +### v1.0.0 - 2017/07/20 + +**Breaking changes** + +* No longer considers date, regex or error objects to be extendable + +## About + +### Related projects + +* [assign-deep](https://www.npmjs.com/package/assign-deep): Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target… [more](https://github.com/jonschlinkert/assign-deep) | [homepage](https://github.com/jonschlinkert/assign-deep "Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target (first) object.") +* [is-equal-shallow](https://www.npmjs.com/package/is-equal-shallow): Does a shallow comparison of two objects, returning false if the keys or values differ. | [homepage](https://github.com/jonschlinkert/is-equal-shallow "Does a shallow comparison of two objects, returning false if the keys or values differ.") +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 20, 2017._ \ No newline at end of file diff --git a/node_modules/mixin-deep/node_modules/is-extendable/index.d.ts b/node_modules/mixin-deep/node_modules/is-extendable/index.d.ts new file mode 100644 index 000000000..b96d50754 --- /dev/null +++ b/node_modules/mixin-deep/node_modules/is-extendable/index.d.ts @@ -0,0 +1,5 @@ +export = isExtendable; + +declare function isExtendable(val: any): boolean; + +declare namespace isExtendable {} diff --git a/node_modules/mixin-deep/node_modules/is-extendable/index.js b/node_modules/mixin-deep/node_modules/is-extendable/index.js new file mode 100644 index 000000000..a8b26ad08 --- /dev/null +++ b/node_modules/mixin-deep/node_modules/is-extendable/index.js @@ -0,0 +1,14 @@ +/*! + * is-extendable + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var isPlainObject = require('is-plain-object'); + +module.exports = function isExtendable(val) { + return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); +}; diff --git a/node_modules/mixin-deep/node_modules/is-extendable/package.json b/node_modules/mixin-deep/node_modules/is-extendable/package.json new file mode 100644 index 000000000..1322c8454 --- /dev/null +++ b/node_modules/mixin-deep/node_modules/is-extendable/package.json @@ -0,0 +1,98 @@ +{ + "_from": "is-extendable@^1.0.1", + "_id": "is-extendable@1.0.1", + "_inBundle": false, + "_integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "_location": "/mixin-deep/is-extendable", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-extendable@^1.0.1", + "name": "is-extendable", + "escapedName": "is-extendable", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/mixin-deep" + ], + "_resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "_shasum": "a7470f9e426733d81bd81e1155264e3a3507cab4", + "_spec": "is-extendable@^1.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/mixin-deep", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-extendable/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "deprecated": false, + "description": "Returns true if a value is a plain object, array or function.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.4.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/jonschlinkert/is-extendable", + "keywords": [ + "array", + "assign", + "check", + "date", + "extend", + "extendable", + "extensible", + "function", + "is", + "object", + "regex", + "test" + ], + "license": "MIT", + "main": "index.js", + "name": "is-extendable", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-extendable.git" + }, + "scripts": { + "test": "mocha" + }, + "types": "index.d.ts", + "verb": { + "related": { + "list": [ + "assign-deep", + "is-equal-shallow", + "is-plain-object", + "isobject", + "kind-of" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.1" +} diff --git a/node_modules/mixin-deep/package.json b/node_modules/mixin-deep/package.json new file mode 100644 index 000000000..e1d08f32e --- /dev/null +++ b/node_modules/mixin-deep/package.json @@ -0,0 +1,98 @@ +{ + "_from": "mixin-deep@^1.2.0", + "_id": "mixin-deep@1.3.1", + "_inBundle": false, + "_integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "_location": "/mixin-deep", + "_phantomChildren": { + "is-plain-object": "2.0.4" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "mixin-deep@^1.2.0", + "name": "mixin-deep", + "escapedName": "mixin-deep", + "rawSpec": "^1.2.0", + "saveSpec": null, + "fetchSpec": "^1.2.0" + }, + "_requiredBy": [ + "/base" + ], + "_resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "_shasum": "a49e7268dce1a0d9698e45326c5626df3543d0fe", + "_spec": "mixin-deep@^1.2.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/base", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/mixin-deep/issues" + }, + "bundleDependencies": false, + "dependencies": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "deprecated": false, + "description": "Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.5.3", + "should": "^13.1.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/mixin-deep", + "keywords": [ + "deep", + "extend", + "key", + "keys", + "merge", + "mixin", + "object", + "prop", + "properties", + "util", + "values" + ], + "license": "MIT", + "main": "index.js", + "name": "mixin-deep", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/mixin-deep.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "defaults-deep", + "extend-shallow", + "merge-deep", + "mixin-object" + ] + }, + "lint": { + "reflinks": true + } + }, + "version": "1.3.1" +} diff --git a/node_modules/mkdirp/.travis.yml b/node_modules/mkdirp/.travis.yml new file mode 100644 index 000000000..74c57bf15 --- /dev/null +++ b/node_modules/mkdirp/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - "0.8" + - "0.10" + - "0.12" + - "iojs" +before_install: + - npm install -g npm@~1.4.6 diff --git a/node_modules/mkdirp/LICENSE b/node_modules/mkdirp/LICENSE new file mode 100644 index 000000000..432d1aeb0 --- /dev/null +++ b/node_modules/mkdirp/LICENSE @@ -0,0 +1,21 @@ +Copyright 2010 James Halliday (mail@substack.net) + +This project is free software released under the MIT/X11 license: + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/mkdirp/bin/cmd.js b/node_modules/mkdirp/bin/cmd.js new file mode 100755 index 000000000..d95de15ae --- /dev/null +++ b/node_modules/mkdirp/bin/cmd.js @@ -0,0 +1,33 @@ +#!/usr/bin/env node + +var mkdirp = require('../'); +var minimist = require('minimist'); +var fs = require('fs'); + +var argv = minimist(process.argv.slice(2), { + alias: { m: 'mode', h: 'help' }, + string: [ 'mode' ] +}); +if (argv.help) { + fs.createReadStream(__dirname + '/usage.txt').pipe(process.stdout); + return; +} + +var paths = argv._.slice(); +var mode = argv.mode ? parseInt(argv.mode, 8) : undefined; + +(function next () { + if (paths.length === 0) return; + var p = paths.shift(); + + if (mode === undefined) mkdirp(p, cb) + else mkdirp(p, mode, cb) + + function cb (err) { + if (err) { + console.error(err.message); + process.exit(1); + } + else next(); + } +})(); diff --git a/node_modules/mkdirp/bin/usage.txt b/node_modules/mkdirp/bin/usage.txt new file mode 100644 index 000000000..f952aa2c7 --- /dev/null +++ b/node_modules/mkdirp/bin/usage.txt @@ -0,0 +1,12 @@ +usage: mkdirp [DIR1,DIR2..] {OPTIONS} + + Create each supplied directory including any necessary parent directories that + don't yet exist. + + If the directory already exists, do nothing. + +OPTIONS are: + + -m, --mode If a directory needs to be created, set the mode as an octal + permission string. + diff --git a/node_modules/mkdirp/examples/pow.js b/node_modules/mkdirp/examples/pow.js new file mode 100644 index 000000000..e6924212e --- /dev/null +++ b/node_modules/mkdirp/examples/pow.js @@ -0,0 +1,6 @@ +var mkdirp = require('mkdirp'); + +mkdirp('/tmp/foo/bar/baz', function (err) { + if (err) console.error(err) + else console.log('pow!') +}); diff --git a/node_modules/mkdirp/index.js b/node_modules/mkdirp/index.js new file mode 100644 index 000000000..6ce241b58 --- /dev/null +++ b/node_modules/mkdirp/index.js @@ -0,0 +1,98 @@ +var path = require('path'); +var fs = require('fs'); +var _0777 = parseInt('0777', 8); + +module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; + +function mkdirP (p, opts, f, made) { + if (typeof opts === 'function') { + f = opts; + opts = {}; + } + else if (!opts || typeof opts !== 'object') { + opts = { mode: opts }; + } + + var mode = opts.mode; + var xfs = opts.fs || fs; + + if (mode === undefined) { + mode = _0777 & (~process.umask()); + } + if (!made) made = null; + + var cb = f || function () {}; + p = path.resolve(p); + + xfs.mkdir(p, mode, function (er) { + if (!er) { + made = made || p; + return cb(null, made); + } + switch (er.code) { + case 'ENOENT': + mkdirP(path.dirname(p), opts, function (er, made) { + if (er) cb(er, made); + else mkdirP(p, opts, cb, made); + }); + break; + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + xfs.stat(p, function (er2, stat) { + // if the stat fails, then that's super weird. + // let the original error be the failure reason. + if (er2 || !stat.isDirectory()) cb(er, made) + else cb(null, made); + }); + break; + } + }); +} + +mkdirP.sync = function sync (p, opts, made) { + if (!opts || typeof opts !== 'object') { + opts = { mode: opts }; + } + + var mode = opts.mode; + var xfs = opts.fs || fs; + + if (mode === undefined) { + mode = _0777 & (~process.umask()); + } + if (!made) made = null; + + p = path.resolve(p); + + try { + xfs.mkdirSync(p, mode); + made = made || p; + } + catch (err0) { + switch (err0.code) { + case 'ENOENT' : + made = sync(path.dirname(p), opts, made); + sync(p, opts, made); + break; + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + var stat; + try { + stat = xfs.statSync(p); + } + catch (err1) { + throw err0; + } + if (!stat.isDirectory()) throw err0; + break; + } + } + + return made; +}; diff --git a/node_modules/mkdirp/node_modules/minimist/.travis.yml b/node_modules/mkdirp/node_modules/minimist/.travis.yml new file mode 100644 index 000000000..cc4dba29d --- /dev/null +++ b/node_modules/mkdirp/node_modules/minimist/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/node_modules/mkdirp/node_modules/minimist/LICENSE b/node_modules/mkdirp/node_modules/minimist/LICENSE new file mode 100644 index 000000000..ee27ba4b4 --- /dev/null +++ b/node_modules/mkdirp/node_modules/minimist/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/mkdirp/node_modules/minimist/example/parse.js b/node_modules/mkdirp/node_modules/minimist/example/parse.js new file mode 100644 index 000000000..abff3e8ee --- /dev/null +++ b/node_modules/mkdirp/node_modules/minimist/example/parse.js @@ -0,0 +1,2 @@ +var argv = require('../')(process.argv.slice(2)); +console.dir(argv); diff --git a/node_modules/mkdirp/node_modules/minimist/index.js b/node_modules/mkdirp/node_modules/minimist/index.js new file mode 100644 index 000000000..584f551a6 --- /dev/null +++ b/node_modules/mkdirp/node_modules/minimist/index.js @@ -0,0 +1,187 @@ +module.exports = function (args, opts) { + if (!opts) opts = {}; + + var flags = { bools : {}, strings : {} }; + + [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { + flags.bools[key] = true; + }); + + [].concat(opts.string).filter(Boolean).forEach(function (key) { + flags.strings[key] = true; + }); + + var aliases = {}; + Object.keys(opts.alias || {}).forEach(function (key) { + aliases[key] = [].concat(opts.alias[key]); + aliases[key].forEach(function (x) { + aliases[x] = [key].concat(aliases[key].filter(function (y) { + return x !== y; + })); + }); + }); + + var defaults = opts['default'] || {}; + + var argv = { _ : [] }; + Object.keys(flags.bools).forEach(function (key) { + setArg(key, defaults[key] === undefined ? false : defaults[key]); + }); + + var notFlags = []; + + if (args.indexOf('--') !== -1) { + notFlags = args.slice(args.indexOf('--')+1); + args = args.slice(0, args.indexOf('--')); + } + + function setArg (key, val) { + var value = !flags.strings[key] && isNumber(val) + ? Number(val) : val + ; + setKey(argv, key.split('.'), value); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), value); + }); + } + + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + + if (/^--.+=/.test(arg)) { + // Using [\s\S] instead of . because js doesn't support the + // 'dotall' regex modifier. See: + // http://stackoverflow.com/a/1068308/13216 + var m = arg.match(/^--([^=]+)=([\s\S]*)$/); + setArg(m[1], m[2]); + } + else if (/^--no-.+/.test(arg)) { + var key = arg.match(/^--no-(.+)/)[1]; + setArg(key, false); + } + else if (/^--.+/.test(arg)) { + var key = arg.match(/^--(.+)/)[1]; + var next = args[i + 1]; + if (next !== undefined && !/^-/.test(next) + && !flags.bools[key] + && (aliases[key] ? !flags.bools[aliases[key]] : true)) { + setArg(key, next); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next === 'true'); + i++; + } + else { + setArg(key, flags.strings[key] ? '' : true); + } + } + else if (/^-[^-]+/.test(arg)) { + var letters = arg.slice(1,-1).split(''); + + var broken = false; + for (var j = 0; j < letters.length; j++) { + var next = arg.slice(j+2); + + if (next === '-') { + setArg(letters[j], next) + continue; + } + + if (/[A-Za-z]/.test(letters[j]) + && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { + setArg(letters[j], next); + broken = true; + break; + } + + if (letters[j+1] && letters[j+1].match(/\W/)) { + setArg(letters[j], arg.slice(j+2)); + broken = true; + break; + } + else { + setArg(letters[j], flags.strings[letters[j]] ? '' : true); + } + } + + var key = arg.slice(-1)[0]; + if (!broken && key !== '-') { + if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) + && !flags.bools[key] + && (aliases[key] ? !flags.bools[aliases[key]] : true)) { + setArg(key, args[i+1]); + i++; + } + else if (args[i+1] && /true|false/.test(args[i+1])) { + setArg(key, args[i+1] === 'true'); + i++; + } + else { + setArg(key, flags.strings[key] ? '' : true); + } + } + } + else { + argv._.push( + flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) + ); + } + } + + Object.keys(defaults).forEach(function (key) { + if (!hasKey(argv, key.split('.'))) { + setKey(argv, key.split('.'), defaults[key]); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), defaults[key]); + }); + } + }); + + notFlags.forEach(function(key) { + argv._.push(key); + }); + + return argv; +}; + +function hasKey (obj, keys) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + o = (o[key] || {}); + }); + + var key = keys[keys.length - 1]; + return key in o; +} + +function setKey (obj, keys, value) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + if (o[key] === undefined) o[key] = {}; + o = o[key]; + }); + + var key = keys[keys.length - 1]; + if (o[key] === undefined || typeof o[key] === 'boolean') { + o[key] = value; + } + else if (Array.isArray(o[key])) { + o[key].push(value); + } + else { + o[key] = [ o[key], value ]; + } +} + +function isNumber (x) { + if (typeof x === 'number') return true; + if (/^0x[0-9a-f]+$/i.test(x)) return true; + return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); +} + +function longest (xs) { + return Math.max.apply(null, xs.map(function (x) { return x.length })); +} diff --git a/node_modules/mkdirp/node_modules/minimist/package.json b/node_modules/mkdirp/node_modules/minimist/package.json new file mode 100644 index 000000000..060870161 --- /dev/null +++ b/node_modules/mkdirp/node_modules/minimist/package.json @@ -0,0 +1,71 @@ +{ + "_from": "minimist@0.0.8", + "_id": "minimist@0.0.8", + "_inBundle": false, + "_integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "_location": "/mkdirp/minimist", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "minimist@0.0.8", + "name": "minimist", + "escapedName": "minimist", + "rawSpec": "0.0.8", + "saveSpec": null, + "fetchSpec": "0.0.8" + }, + "_requiredBy": [ + "/mkdirp" + ], + "_resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "_shasum": "857fcabfc3397d2625b8228262e86aa7a011b05d", + "_spec": "minimist@0.0.8", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/mkdirp", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/minimist/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "parse argument options", + "devDependencies": { + "tap": "~0.4.0", + "tape": "~1.0.4" + }, + "homepage": "https://github.com/substack/minimist", + "keywords": [ + "argv", + "getopt", + "parser", + "optimist" + ], + "license": "MIT", + "main": "index.js", + "name": "minimist", + "repository": { + "type": "git", + "url": "git://github.com/substack/minimist.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "ff/5", + "firefox/latest", + "chrome/10", + "chrome/latest", + "safari/5.1", + "safari/latest", + "opera/12" + ] + }, + "version": "0.0.8" +} diff --git a/node_modules/mkdirp/node_modules/minimist/readme.markdown b/node_modules/mkdirp/node_modules/minimist/readme.markdown new file mode 100644 index 000000000..c25635323 --- /dev/null +++ b/node_modules/mkdirp/node_modules/minimist/readme.markdown @@ -0,0 +1,73 @@ +# minimist + +parse argument options + +This module is the guts of optimist's argument parser without all the +fanciful decoration. + +[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist) + +[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist) + +# example + +``` js +var argv = require('minimist')(process.argv.slice(2)); +console.dir(argv); +``` + +``` +$ node example/parse.js -a beep -b boop +{ _: [], a: 'beep', b: 'boop' } +``` + +``` +$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz +{ _: [ 'foo', 'bar', 'baz' ], + x: 3, + y: 4, + n: 5, + a: true, + b: true, + c: true, + beep: 'boop' } +``` + +# methods + +``` js +var parseArgs = require('minimist') +``` + +## var argv = parseArgs(args, opts={}) + +Return an argument object `argv` populated with the array arguments from `args`. + +`argv._` contains all the arguments that didn't have an option associated with +them. + +Numeric-looking arguments will be returned as numbers unless `opts.string` or +`opts.boolean` is set for that argument name. + +Any arguments after `'--'` will not be parsed and will end up in `argv._`. + +options can be: + +* `opts.string` - a string or array of strings argument names to always treat as +strings +* `opts.boolean` - a string or array of strings to always treat as booleans +* `opts.alias` - an object mapping string names to strings or arrays of string +argument names to use as aliases +* `opts.default` - an object mapping string argument names to default values + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install minimist +``` + +# license + +MIT diff --git a/node_modules/mkdirp/node_modules/minimist/test/dash.js b/node_modules/mkdirp/node_modules/minimist/test/dash.js new file mode 100644 index 000000000..8b034b99a --- /dev/null +++ b/node_modules/mkdirp/node_modules/minimist/test/dash.js @@ -0,0 +1,24 @@ +var parse = require('../'); +var test = require('tape'); + +test('-', function (t) { + t.plan(5); + t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] }); + t.deepEqual(parse([ '-' ]), { _: [ '-' ] }); + t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] }); + t.deepEqual( + parse([ '-b', '-' ], { boolean: 'b' }), + { b: true, _: [ '-' ] } + ); + t.deepEqual( + parse([ '-s', '-' ], { string: 's' }), + { s: '-', _: [] } + ); +}); + +test('-a -- b', function (t) { + t.plan(3); + t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] }); + t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); + t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); +}); diff --git a/node_modules/mkdirp/node_modules/minimist/test/default_bool.js b/node_modules/mkdirp/node_modules/minimist/test/default_bool.js new file mode 100644 index 000000000..f0041ee40 --- /dev/null +++ b/node_modules/mkdirp/node_modules/minimist/test/default_bool.js @@ -0,0 +1,20 @@ +var test = require('tape'); +var parse = require('../'); + +test('boolean default true', function (t) { + var argv = parse([], { + boolean: 'sometrue', + default: { sometrue: true } + }); + t.equal(argv.sometrue, true); + t.end(); +}); + +test('boolean default false', function (t) { + var argv = parse([], { + boolean: 'somefalse', + default: { somefalse: false } + }); + t.equal(argv.somefalse, false); + t.end(); +}); diff --git a/node_modules/mkdirp/node_modules/minimist/test/dotted.js b/node_modules/mkdirp/node_modules/minimist/test/dotted.js new file mode 100644 index 000000000..ef0ae349b --- /dev/null +++ b/node_modules/mkdirp/node_modules/minimist/test/dotted.js @@ -0,0 +1,16 @@ +var parse = require('../'); +var test = require('tape'); + +test('dotted alias', function (t) { + var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); + t.equal(argv.a.b, 22); + t.equal(argv.aa.bb, 22); + t.end(); +}); + +test('dotted default', function (t) { + var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); + t.equal(argv.a.b, 11); + t.equal(argv.aa.bb, 11); + t.end(); +}); diff --git a/node_modules/mkdirp/node_modules/minimist/test/long.js b/node_modules/mkdirp/node_modules/minimist/test/long.js new file mode 100644 index 000000000..5d3a1e09d --- /dev/null +++ b/node_modules/mkdirp/node_modules/minimist/test/long.js @@ -0,0 +1,31 @@ +var test = require('tape'); +var parse = require('../'); + +test('long opts', function (t) { + t.deepEqual( + parse([ '--bool' ]), + { bool : true, _ : [] }, + 'long boolean' + ); + t.deepEqual( + parse([ '--pow', 'xixxle' ]), + { pow : 'xixxle', _ : [] }, + 'long capture sp' + ); + t.deepEqual( + parse([ '--pow=xixxle' ]), + { pow : 'xixxle', _ : [] }, + 'long capture eq' + ); + t.deepEqual( + parse([ '--host', 'localhost', '--port', '555' ]), + { host : 'localhost', port : 555, _ : [] }, + 'long captures sp' + ); + t.deepEqual( + parse([ '--host=localhost', '--port=555' ]), + { host : 'localhost', port : 555, _ : [] }, + 'long captures eq' + ); + t.end(); +}); diff --git a/node_modules/mkdirp/node_modules/minimist/test/parse.js b/node_modules/mkdirp/node_modules/minimist/test/parse.js new file mode 100644 index 000000000..8a9064669 --- /dev/null +++ b/node_modules/mkdirp/node_modules/minimist/test/parse.js @@ -0,0 +1,318 @@ +var parse = require('../'); +var test = require('tape'); + +test('parse args', function (t) { + t.deepEqual( + parse([ '--no-moo' ]), + { moo : false, _ : [] }, + 'no' + ); + t.deepEqual( + parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), + { v : ['a','b','c'], _ : [] }, + 'multi' + ); + t.end(); +}); + +test('comprehensive', function (t) { + t.deepEqual( + parse([ + '--name=meowmers', 'bare', '-cats', 'woo', + '-h', 'awesome', '--multi=quux', + '--key', 'value', + '-b', '--bool', '--no-meep', '--multi=baz', + '--', '--not-a-flag', 'eek' + ]), + { + c : true, + a : true, + t : true, + s : 'woo', + h : 'awesome', + b : true, + bool : true, + key : 'value', + multi : [ 'quux', 'baz' ], + meep : false, + name : 'meowmers', + _ : [ 'bare', '--not-a-flag', 'eek' ] + } + ); + t.end(); +}); + +test('nums', function (t) { + var argv = parse([ + '-x', '1234', + '-y', '5.67', + '-z', '1e7', + '-w', '10f', + '--hex', '0xdeadbeef', + '789' + ]); + t.deepEqual(argv, { + x : 1234, + y : 5.67, + z : 1e7, + w : '10f', + hex : 0xdeadbeef, + _ : [ 789 ] + }); + t.deepEqual(typeof argv.x, 'number'); + t.deepEqual(typeof argv.y, 'number'); + t.deepEqual(typeof argv.z, 'number'); + t.deepEqual(typeof argv.w, 'string'); + t.deepEqual(typeof argv.hex, 'number'); + t.deepEqual(typeof argv._[0], 'number'); + t.end(); +}); + +test('flag boolean', function (t) { + var argv = parse([ '-t', 'moo' ], { boolean: 't' }); + t.deepEqual(argv, { t : true, _ : [ 'moo' ] }); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); +}); + +test('flag boolean value', function (t) { + var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], { + boolean: [ 't', 'verbose' ], + default: { verbose: true } + }); + + t.deepEqual(argv, { + verbose: false, + t: true, + _: ['moo'] + }); + + t.deepEqual(typeof argv.verbose, 'boolean'); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); +}); + +test('flag boolean default false', function (t) { + var argv = parse(['moo'], { + boolean: ['t', 'verbose'], + default: { verbose: false, t: false } + }); + + t.deepEqual(argv, { + verbose: false, + t: false, + _: ['moo'] + }); + + t.deepEqual(typeof argv.verbose, 'boolean'); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); + +}); + +test('boolean groups', function (t) { + var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { + boolean: ['x','y','z'] + }); + + t.deepEqual(argv, { + x : true, + y : false, + z : true, + _ : [ 'one', 'two', 'three' ] + }); + + t.deepEqual(typeof argv.x, 'boolean'); + t.deepEqual(typeof argv.y, 'boolean'); + t.deepEqual(typeof argv.z, 'boolean'); + t.end(); +}); + +test('newlines in params' , function (t) { + var args = parse([ '-s', "X\nX" ]) + t.deepEqual(args, { _ : [], s : "X\nX" }); + + // reproduce in bash: + // VALUE="new + // line" + // node program.js --s="$VALUE" + args = parse([ "--s=X\nX" ]) + t.deepEqual(args, { _ : [], s : "X\nX" }); + t.end(); +}); + +test('strings' , function (t) { + var s = parse([ '-s', '0001234' ], { string: 's' }).s; + t.equal(s, '0001234'); + t.equal(typeof s, 'string'); + + var x = parse([ '-x', '56' ], { string: 'x' }).x; + t.equal(x, '56'); + t.equal(typeof x, 'string'); + t.end(); +}); + +test('stringArgs', function (t) { + var s = parse([ ' ', ' ' ], { string: '_' })._; + t.same(s.length, 2); + t.same(typeof s[0], 'string'); + t.same(s[0], ' '); + t.same(typeof s[1], 'string'); + t.same(s[1], ' '); + t.end(); +}); + +test('empty strings', function(t) { + var s = parse([ '-s' ], { string: 's' }).s; + t.equal(s, ''); + t.equal(typeof s, 'string'); + + var str = parse([ '--str' ], { string: 'str' }).str; + t.equal(str, ''); + t.equal(typeof str, 'string'); + + var letters = parse([ '-art' ], { + string: [ 'a', 't' ] + }); + + t.equal(letters.a, ''); + t.equal(letters.r, true); + t.equal(letters.t, ''); + + t.end(); +}); + + +test('slashBreak', function (t) { + t.same( + parse([ '-I/foo/bar/baz' ]), + { I : '/foo/bar/baz', _ : [] } + ); + t.same( + parse([ '-xyz/foo/bar/baz' ]), + { x : true, y : true, z : '/foo/bar/baz', _ : [] } + ); + t.end(); +}); + +test('alias', function (t) { + var argv = parse([ '-f', '11', '--zoom', '55' ], { + alias: { z: 'zoom' } + }); + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.f, 11); + t.end(); +}); + +test('multiAlias', function (t) { + var argv = parse([ '-f', '11', '--zoom', '55' ], { + alias: { z: [ 'zm', 'zoom' ] } + }); + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.z, argv.zm); + t.equal(argv.f, 11); + t.end(); +}); + +test('nested dotted objects', function (t) { + var argv = parse([ + '--foo.bar', '3', '--foo.baz', '4', + '--foo.quux.quibble', '5', '--foo.quux.o_O', + '--beep.boop' + ]); + + t.same(argv.foo, { + bar : 3, + baz : 4, + quux : { + quibble : 5, + o_O : true + } + }); + t.same(argv.beep, { boop : true }); + t.end(); +}); + +test('boolean and alias with chainable api', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + herp: { alias: 'h', boolean: true } + }; + var aliasedArgv = parse(aliased, { + boolean: 'herp', + alias: { h: 'herp' } + }); + var propertyArgv = parse(regular, { + boolean: 'herp', + alias: { h: 'herp' } + }); + var expected = { + herp: true, + h: true, + '_': [ 'derp' ] + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias with options hash', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + alias: { 'h': 'herp' }, + boolean: 'herp' + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var expected = { + herp: true, + h: true, + '_': [ 'derp' ] + }; + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias using explicit true', function (t) { + var aliased = [ '-h', 'true' ]; + var regular = [ '--herp', 'true' ]; + var opts = { + alias: { h: 'herp' }, + boolean: 'h' + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var expected = { + herp: true, + h: true, + '_': [ ] + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +// regression, see https://github.com/substack/node-optimist/issues/71 +test('boolean and --x=true', function(t) { + var parsed = parse(['--boool', '--other=true'], { + boolean: 'boool' + }); + + t.same(parsed.boool, true); + t.same(parsed.other, 'true'); + + parsed = parse(['--boool', '--other=false'], { + boolean: 'boool' + }); + + t.same(parsed.boool, true); + t.same(parsed.other, 'false'); + t.end(); +}); diff --git a/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js b/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js new file mode 100644 index 000000000..21851b036 --- /dev/null +++ b/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js @@ -0,0 +1,9 @@ +var parse = require('../'); +var test = require('tape'); + +test('parse with modifier functions' , function (t) { + t.plan(1); + + var argv = parse([ '-b', '123' ], { boolean: 'b' }); + t.deepEqual(argv, { b: true, _: ['123'] }); +}); diff --git a/node_modules/mkdirp/node_modules/minimist/test/short.js b/node_modules/mkdirp/node_modules/minimist/test/short.js new file mode 100644 index 000000000..d513a1c25 --- /dev/null +++ b/node_modules/mkdirp/node_modules/minimist/test/short.js @@ -0,0 +1,67 @@ +var parse = require('../'); +var test = require('tape'); + +test('numeric short args', function (t) { + t.plan(2); + t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] }); + t.deepEqual( + parse([ '-123', '456' ]), + { 1: true, 2: true, 3: 456, _: [] } + ); +}); + +test('short', function (t) { + t.deepEqual( + parse([ '-b' ]), + { b : true, _ : [] }, + 'short boolean' + ); + t.deepEqual( + parse([ 'foo', 'bar', 'baz' ]), + { _ : [ 'foo', 'bar', 'baz' ] }, + 'bare' + ); + t.deepEqual( + parse([ '-cats' ]), + { c : true, a : true, t : true, s : true, _ : [] }, + 'group' + ); + t.deepEqual( + parse([ '-cats', 'meow' ]), + { c : true, a : true, t : true, s : 'meow', _ : [] }, + 'short group next' + ); + t.deepEqual( + parse([ '-h', 'localhost' ]), + { h : 'localhost', _ : [] }, + 'short capture' + ); + t.deepEqual( + parse([ '-h', 'localhost', '-p', '555' ]), + { h : 'localhost', p : 555, _ : [] }, + 'short captures' + ); + t.end(); +}); + +test('mixed short bool and capture', function (t) { + t.same( + parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ] + } + ); + t.end(); +}); + +test('short and long', function (t) { + t.deepEqual( + parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ] + } + ); + t.end(); +}); diff --git a/node_modules/mkdirp/node_modules/minimist/test/whitespace.js b/node_modules/mkdirp/node_modules/minimist/test/whitespace.js new file mode 100644 index 000000000..8a52a58ce --- /dev/null +++ b/node_modules/mkdirp/node_modules/minimist/test/whitespace.js @@ -0,0 +1,8 @@ +var parse = require('../'); +var test = require('tape'); + +test('whitespace should be whitespace' , function (t) { + t.plan(1); + var x = parse([ '-x', '\t' ]).x; + t.equal(x, '\t'); +}); diff --git a/node_modules/mkdirp/package.json b/node_modules/mkdirp/package.json new file mode 100644 index 000000000..cfb489467 --- /dev/null +++ b/node_modules/mkdirp/package.json @@ -0,0 +1,62 @@ +{ + "_from": "mkdirp@^0.5.0", + "_id": "mkdirp@0.5.1", + "_inBundle": false, + "_integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "_location": "/mkdirp", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "mkdirp@^0.5.0", + "name": "mkdirp", + "escapedName": "mkdirp", + "rawSpec": "^0.5.0", + "saveSpec": null, + "fetchSpec": "^0.5.0" + }, + "_requiredBy": [ + "/browserify" + ], + "_resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "_shasum": "30057438eac6cf7f8c4767f38648d6697d75c903", + "_spec": "mkdirp@^0.5.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "bugs": { + "url": "https://github.com/substack/node-mkdirp/issues" + }, + "bundleDependencies": false, + "dependencies": { + "minimist": "0.0.8" + }, + "deprecated": false, + "description": "Recursively mkdir, like `mkdir -p`", + "devDependencies": { + "mock-fs": "2 >=2.7.0", + "tap": "1" + }, + "homepage": "https://github.com/substack/node-mkdirp#readme", + "keywords": [ + "mkdir", + "directory" + ], + "license": "MIT", + "main": "index.js", + "name": "mkdirp", + "repository": { + "type": "git", + "url": "git+https://github.com/substack/node-mkdirp.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "0.5.1" +} diff --git a/node_modules/mkdirp/readme.markdown b/node_modules/mkdirp/readme.markdown new file mode 100644 index 000000000..3cc131538 --- /dev/null +++ b/node_modules/mkdirp/readme.markdown @@ -0,0 +1,100 @@ +# mkdirp + +Like `mkdir -p`, but in node.js! + +[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) + +# example + +## pow.js + +```js +var mkdirp = require('mkdirp'); + +mkdirp('/tmp/foo/bar/baz', function (err) { + if (err) console.error(err) + else console.log('pow!') +}); +``` + +Output + +``` +pow! +``` + +And now /tmp/foo/bar/baz exists, huzzah! + +# methods + +```js +var mkdirp = require('mkdirp'); +``` + +## mkdirp(dir, opts, cb) + +Create a new directory and any necessary subdirectories at `dir` with octal +permission string `opts.mode`. If `opts` is a non-object, it will be treated as +the `opts.mode`. + +If `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`. + +`cb(err, made)` fires with the error or the first directory `made` +that had to be created, if any. + +You can optionally pass in an alternate `fs` implementation by passing in +`opts.fs`. Your implementation should have `opts.fs.mkdir(path, mode, cb)` and +`opts.fs.stat(path, cb)`. + +## mkdirp.sync(dir, opts) + +Synchronously create a new directory and any necessary subdirectories at `dir` +with octal permission string `opts.mode`. If `opts` is a non-object, it will be +treated as the `opts.mode`. + +If `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`. + +Returns the first directory that had to be created, if any. + +You can optionally pass in an alternate `fs` implementation by passing in +`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` and +`opts.fs.statSync(path)`. + +# usage + +This package also ships with a `mkdirp` command. + +``` +usage: mkdirp [DIR1,DIR2..] {OPTIONS} + + Create each supplied directory including any necessary parent directories that + don't yet exist. + + If the directory already exists, do nothing. + +OPTIONS are: + + -m, --mode If a directory needs to be created, set the mode as an octal + permission string. + +``` + +# install + +With [npm](http://npmjs.org) do: + +``` +npm install mkdirp +``` + +to get the library, or + +``` +npm install -g mkdirp +``` + +to get the command. + +# license + +MIT diff --git a/node_modules/mkdirp/test/chmod.js b/node_modules/mkdirp/test/chmod.js new file mode 100644 index 000000000..6a404b932 --- /dev/null +++ b/node_modules/mkdirp/test/chmod.js @@ -0,0 +1,41 @@ +var mkdirp = require('../').mkdirp; +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; +var _0777 = parseInt('0777', 8); +var _0755 = parseInt('0755', 8); +var _0744 = parseInt('0744', 8); + +var ps = [ '', 'tmp' ]; + +for (var i = 0; i < 25; i++) { + var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + ps.push(dir); +} + +var file = ps.join('/'); + +test('chmod-pre', function (t) { + var mode = _0744 + mkdirp(file, mode, function (er) { + t.ifError(er, 'should not error'); + fs.stat(file, function (er, stat) { + t.ifError(er, 'should exist'); + t.ok(stat && stat.isDirectory(), 'should be directory'); + t.equal(stat && stat.mode & _0777, mode, 'should be 0744'); + t.end(); + }); + }); +}); + +test('chmod', function (t) { + var mode = _0755 + mkdirp(file, mode, function (er) { + t.ifError(er, 'should not error'); + fs.stat(file, function (er, stat) { + t.ifError(er, 'should exist'); + t.ok(stat && stat.isDirectory(), 'should be directory'); + t.end(); + }); + }); +}); diff --git a/node_modules/mkdirp/test/clobber.js b/node_modules/mkdirp/test/clobber.js new file mode 100644 index 000000000..2433b9ad5 --- /dev/null +++ b/node_modules/mkdirp/test/clobber.js @@ -0,0 +1,38 @@ +var mkdirp = require('../').mkdirp; +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; +var _0755 = parseInt('0755', 8); + +var ps = [ '', 'tmp' ]; + +for (var i = 0; i < 25; i++) { + var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + ps.push(dir); +} + +var file = ps.join('/'); + +// a file in the way +var itw = ps.slice(0, 3).join('/'); + + +test('clobber-pre', function (t) { + console.error("about to write to "+itw) + fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); + + fs.stat(itw, function (er, stat) { + t.ifError(er) + t.ok(stat && stat.isFile(), 'should be file') + t.end() + }) +}) + +test('clobber', function (t) { + t.plan(2); + mkdirp(file, _0755, function (err) { + t.ok(err); + t.equal(err.code, 'ENOTDIR'); + t.end(); + }); +}); diff --git a/node_modules/mkdirp/test/mkdirp.js b/node_modules/mkdirp/test/mkdirp.js new file mode 100644 index 000000000..eaa8921c7 --- /dev/null +++ b/node_modules/mkdirp/test/mkdirp.js @@ -0,0 +1,28 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var exists = fs.exists || path.exists; +var test = require('tap').test; +var _0777 = parseInt('0777', 8); +var _0755 = parseInt('0755', 8); + +test('woo', function (t) { + t.plan(5); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + mkdirp(file, _0755, function (err) { + t.ifError(err); + exists(file, function (ex) { + t.ok(ex, 'file created'); + fs.stat(file, function (err, stat) { + t.ifError(err); + t.equal(stat.mode & _0777, _0755); + t.ok(stat.isDirectory(), 'target not a directory'); + }) + }) + }); +}); diff --git a/node_modules/mkdirp/test/opts_fs.js b/node_modules/mkdirp/test/opts_fs.js new file mode 100644 index 000000000..97186b62e --- /dev/null +++ b/node_modules/mkdirp/test/opts_fs.js @@ -0,0 +1,29 @@ +var mkdirp = require('../'); +var path = require('path'); +var test = require('tap').test; +var mockfs = require('mock-fs'); +var _0777 = parseInt('0777', 8); +var _0755 = parseInt('0755', 8); + +test('opts.fs', function (t) { + t.plan(5); + + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/beep/boop/' + [x,y,z].join('/'); + var xfs = mockfs.fs(); + + mkdirp(file, { fs: xfs, mode: _0755 }, function (err) { + t.ifError(err); + xfs.exists(file, function (ex) { + t.ok(ex, 'created file'); + xfs.stat(file, function (err, stat) { + t.ifError(err); + t.equal(stat.mode & _0777, _0755); + t.ok(stat.isDirectory(), 'target not a directory'); + }); + }); + }); +}); diff --git a/node_modules/mkdirp/test/opts_fs_sync.js b/node_modules/mkdirp/test/opts_fs_sync.js new file mode 100644 index 000000000..6c370aa6e --- /dev/null +++ b/node_modules/mkdirp/test/opts_fs_sync.js @@ -0,0 +1,27 @@ +var mkdirp = require('../'); +var path = require('path'); +var test = require('tap').test; +var mockfs = require('mock-fs'); +var _0777 = parseInt('0777', 8); +var _0755 = parseInt('0755', 8); + +test('opts.fs sync', function (t) { + t.plan(4); + + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/beep/boop/' + [x,y,z].join('/'); + var xfs = mockfs.fs(); + + mkdirp.sync(file, { fs: xfs, mode: _0755 }); + xfs.exists(file, function (ex) { + t.ok(ex, 'created file'); + xfs.stat(file, function (err, stat) { + t.ifError(err); + t.equal(stat.mode & _0777, _0755); + t.ok(stat.isDirectory(), 'target not a directory'); + }); + }); +}); diff --git a/node_modules/mkdirp/test/perm.js b/node_modules/mkdirp/test/perm.js new file mode 100644 index 000000000..fbce44b82 --- /dev/null +++ b/node_modules/mkdirp/test/perm.js @@ -0,0 +1,32 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var exists = fs.exists || path.exists; +var test = require('tap').test; +var _0777 = parseInt('0777', 8); +var _0755 = parseInt('0755', 8); + +test('async perm', function (t) { + t.plan(5); + var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); + + mkdirp(file, _0755, function (err) { + t.ifError(err); + exists(file, function (ex) { + t.ok(ex, 'file created'); + fs.stat(file, function (err, stat) { + t.ifError(err); + t.equal(stat.mode & _0777, _0755); + t.ok(stat.isDirectory(), 'target not a directory'); + }) + }) + }); +}); + +test('async root perm', function (t) { + mkdirp('/tmp', _0755, function (err) { + if (err) t.fail(err); + t.end(); + }); + t.end(); +}); diff --git a/node_modules/mkdirp/test/perm_sync.js b/node_modules/mkdirp/test/perm_sync.js new file mode 100644 index 000000000..398229fe5 --- /dev/null +++ b/node_modules/mkdirp/test/perm_sync.js @@ -0,0 +1,36 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var exists = fs.exists || path.exists; +var test = require('tap').test; +var _0777 = parseInt('0777', 8); +var _0755 = parseInt('0755', 8); + +test('sync perm', function (t) { + t.plan(4); + var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; + + mkdirp.sync(file, _0755); + exists(file, function (ex) { + t.ok(ex, 'file created'); + fs.stat(file, function (err, stat) { + t.ifError(err); + t.equal(stat.mode & _0777, _0755); + t.ok(stat.isDirectory(), 'target not a directory'); + }); + }); +}); + +test('sync root perm', function (t) { + t.plan(3); + + var file = '/tmp'; + mkdirp.sync(file, _0755); + exists(file, function (ex) { + t.ok(ex, 'file created'); + fs.stat(file, function (err, stat) { + t.ifError(err); + t.ok(stat.isDirectory(), 'target not a directory'); + }) + }); +}); diff --git a/node_modules/mkdirp/test/race.js b/node_modules/mkdirp/test/race.js new file mode 100644 index 000000000..b0b9e183c --- /dev/null +++ b/node_modules/mkdirp/test/race.js @@ -0,0 +1,37 @@ +var mkdirp = require('../').mkdirp; +var path = require('path'); +var fs = require('fs'); +var exists = fs.exists || path.exists; +var test = require('tap').test; +var _0777 = parseInt('0777', 8); +var _0755 = parseInt('0755', 8); + +test('race', function (t) { + t.plan(10); + var ps = [ '', 'tmp' ]; + + for (var i = 0; i < 25; i++) { + var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + ps.push(dir); + } + var file = ps.join('/'); + + var res = 2; + mk(file); + + mk(file); + + function mk (file, cb) { + mkdirp(file, _0755, function (err) { + t.ifError(err); + exists(file, function (ex) { + t.ok(ex, 'file created'); + fs.stat(file, function (err, stat) { + t.ifError(err); + t.equal(stat.mode & _0777, _0755); + t.ok(stat.isDirectory(), 'target not a directory'); + }); + }) + }); + } +}); diff --git a/node_modules/mkdirp/test/rel.js b/node_modules/mkdirp/test/rel.js new file mode 100644 index 000000000..4ddb34276 --- /dev/null +++ b/node_modules/mkdirp/test/rel.js @@ -0,0 +1,32 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var exists = fs.exists || path.exists; +var test = require('tap').test; +var _0777 = parseInt('0777', 8); +var _0755 = parseInt('0755', 8); + +test('rel', function (t) { + t.plan(5); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var cwd = process.cwd(); + process.chdir('/tmp'); + + var file = [x,y,z].join('/'); + + mkdirp(file, _0755, function (err) { + t.ifError(err); + exists(file, function (ex) { + t.ok(ex, 'file created'); + fs.stat(file, function (err, stat) { + t.ifError(err); + process.chdir(cwd); + t.equal(stat.mode & _0777, _0755); + t.ok(stat.isDirectory(), 'target not a directory'); + }) + }) + }); +}); diff --git a/node_modules/mkdirp/test/return.js b/node_modules/mkdirp/test/return.js new file mode 100644 index 000000000..bce68e561 --- /dev/null +++ b/node_modules/mkdirp/test/return.js @@ -0,0 +1,25 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('return value', function (t) { + t.plan(4); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + // should return the first dir created. + // By this point, it would be profoundly surprising if /tmp didn't + // already exist, since every other test makes things in there. + mkdirp(file, function (err, made) { + t.ifError(err); + t.equal(made, '/tmp/' + x); + mkdirp(file, function (err, made) { + t.ifError(err); + t.equal(made, null); + }); + }); +}); diff --git a/node_modules/mkdirp/test/return_sync.js b/node_modules/mkdirp/test/return_sync.js new file mode 100644 index 000000000..7c222d355 --- /dev/null +++ b/node_modules/mkdirp/test/return_sync.js @@ -0,0 +1,24 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('return value', function (t) { + t.plan(2); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + // should return the first dir created. + // By this point, it would be profoundly surprising if /tmp didn't + // already exist, since every other test makes things in there. + // Note that this will throw on failure, which will fail the test. + var made = mkdirp.sync(file); + t.equal(made, '/tmp/' + x); + + // making the same file again should have no effect. + made = mkdirp.sync(file); + t.equal(made, null); +}); diff --git a/node_modules/mkdirp/test/root.js b/node_modules/mkdirp/test/root.js new file mode 100644 index 000000000..9e7d079d9 --- /dev/null +++ b/node_modules/mkdirp/test/root.js @@ -0,0 +1,19 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; +var _0755 = parseInt('0755', 8); + +test('root', function (t) { + // '/' on unix, 'c:/' on windows. + var file = path.resolve('/'); + + mkdirp(file, _0755, function (err) { + if (err) throw err + fs.stat(file, function (er, stat) { + if (er) throw er + t.ok(stat.isDirectory(), 'target is a directory'); + t.end(); + }) + }); +}); diff --git a/node_modules/mkdirp/test/sync.js b/node_modules/mkdirp/test/sync.js new file mode 100644 index 000000000..8c8dc938c --- /dev/null +++ b/node_modules/mkdirp/test/sync.js @@ -0,0 +1,32 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var exists = fs.exists || path.exists; +var test = require('tap').test; +var _0777 = parseInt('0777', 8); +var _0755 = parseInt('0755', 8); + +test('sync', function (t) { + t.plan(4); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + try { + mkdirp.sync(file, _0755); + } catch (err) { + t.fail(err); + return t.end(); + } + + exists(file, function (ex) { + t.ok(ex, 'file created'); + fs.stat(file, function (err, stat) { + t.ifError(err); + t.equal(stat.mode & _0777, _0755); + t.ok(stat.isDirectory(), 'target not a directory'); + }); + }); +}); diff --git a/node_modules/mkdirp/test/umask.js b/node_modules/mkdirp/test/umask.js new file mode 100644 index 000000000..2033c63a4 --- /dev/null +++ b/node_modules/mkdirp/test/umask.js @@ -0,0 +1,28 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var exists = fs.exists || path.exists; +var test = require('tap').test; +var _0777 = parseInt('0777', 8); +var _0755 = parseInt('0755', 8); + +test('implicit mode from umask', function (t) { + t.plan(5); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + mkdirp(file, function (err) { + t.ifError(err); + exists(file, function (ex) { + t.ok(ex, 'file created'); + fs.stat(file, function (err, stat) { + t.ifError(err); + t.equal(stat.mode & _0777, _0777 & (~process.umask())); + t.ok(stat.isDirectory(), 'target not a directory'); + }); + }) + }); +}); diff --git a/node_modules/mkdirp/test/umask_sync.js b/node_modules/mkdirp/test/umask_sync.js new file mode 100644 index 000000000..11a761474 --- /dev/null +++ b/node_modules/mkdirp/test/umask_sync.js @@ -0,0 +1,32 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var exists = fs.exists || path.exists; +var test = require('tap').test; +var _0777 = parseInt('0777', 8); +var _0755 = parseInt('0755', 8); + +test('umask sync modes', function (t) { + t.plan(4); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + try { + mkdirp.sync(file); + } catch (err) { + t.fail(err); + return t.end(); + } + + exists(file, function (ex) { + t.ok(ex, 'file created'); + fs.stat(file, function (err, stat) { + t.ifError(err); + t.equal(stat.mode & _0777, (_0777 & (~process.umask()))); + t.ok(stat.isDirectory(), 'target not a directory'); + }); + }); +}); diff --git a/node_modules/module-deps/.travis.yml b/node_modules/module-deps/.travis.yml new file mode 100644 index 000000000..a459790bd --- /dev/null +++ b/node_modules/module-deps/.travis.yml @@ -0,0 +1,17 @@ +language: node_js +node_js: + - "9" + - "8" + - "6" + - "4" + - "iojs" + - "0.12" + - "0.10" + - "0.8" +sudo: false +before_install: + # Old npm certs are untrusted https://github.com/npm/npm/issues/20191 + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.8" ]; then export NPM_CONFIG_STRICT_SSL=false; fi' + - 'nvm install-latest-npm' +matrix: + fast_finish: true diff --git a/node_modules/module-deps/CHANGELOG.md b/node_modules/module-deps/CHANGELOG.md new file mode 100644 index 000000000..6db38834e --- /dev/null +++ b/node_modules/module-deps/CHANGELOG.md @@ -0,0 +1,26 @@ +# module-deps Change Log +All notable changes to this project will be documented in this file. +This project adheres to [Semantic Versioning](http://semver.org/). + +## 6.1.0 - 2018-05-16 +* Add a `detect` option for custom dependency detection [#63](https://github.com/browserify/module-deps/pull/63), [2dcc339](https://github.com/browserify/module-deps/commit/2dcc3399ee67ba51ed26d9a0605a8ccdc70c9db7) + +## 6.0.2 - 2018-03-28 +* Fix missing 'file' event when file has a syntax error [#146](https://github.com/browserify/module-deps/pull/146) + +## 6.0.1 - 2018-03-27 +* Fix crash when file has a transform and a syntax error [#145](https://github.com/browserify/module-deps/pull/145) + +## 6.0.0 - 2018-02-07 +* Ignore package.json files that do not contain JSON objects [#142](https://github.com/browserify/module-deps/pull/142) +* Don't preserve symlinks when resolving transforms, matching Node resolution behaviour [#133](https://github.com/browserify/module-deps/pull/133) +* Fix 'file' events with `persistentCache` [#127](https://github.com/browserify/module-deps/pull/127) +* Add dependencies to a file when transforms emit 'dep' event [#141](https://github.com/browserify/module-deps/pull/141) + +## 5.0.1 - 2018-01-06 +* Restore support for node < 4.0.0. + +## 5.0.0 - 2018-01-02 +* Update deps +* Drop support for node < 0.12 due due to detective dropping support +* Add engines field set to `>=4.0.0` diff --git a/node_modules/module-deps/LICENSE b/node_modules/module-deps/LICENSE new file mode 100644 index 000000000..ee27ba4b4 --- /dev/null +++ b/node_modules/module-deps/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/module-deps/bin/cmd.js b/node_modules/module-deps/bin/cmd.js new file mode 100755 index 000000000..c776ed7f1 --- /dev/null +++ b/node_modules/module-deps/bin/cmd.js @@ -0,0 +1,28 @@ +#!/usr/bin/env node +var mdeps = require('../'); +var subarg = require('subarg'); +var fs = require('fs'); +var path = require('path'); + +var argv = subarg(process.argv.slice(2), { + alias: { h: 'help', t: 'transform', g: 'globalTransform' } +}); +if (argv.help) return usage(0); + +var JSONStream = require('JSONStream'); + +var files = argv._.map(function (file) { + if (file === '-') return process.stdin; + return path.resolve(file); +}); +var md = mdeps(argv); +md.pipe(JSONStream.stringify()).pipe(process.stdout); + +files.forEach(function (file) { md.write(file) }); +md.end(); + +function usage (code) { + var r = fs.createReadStream(__dirname + '/usage.txt'); + r.pipe(process.stdout); + if (code) r.on('end', function () { process.exit(code) }); +} diff --git a/node_modules/module-deps/bin/usage.txt b/node_modules/module-deps/bin/usage.txt new file mode 100644 index 000000000..8bbcbab24 --- /dev/null +++ b/node_modules/module-deps/bin/usage.txt @@ -0,0 +1,9 @@ +module-deps [FILES] OPTIONS + + Generate json output for the entry point FILES. + +OPTIONS are: + + -t TRANSFORM Apply a TRANSFORM. + -g TRANSFORM Apply a global TRANSFORM. + diff --git a/node_modules/module-deps/example/deps.js b/node_modules/module-deps/example/deps.js new file mode 100644 index 000000000..437c5e1a3 --- /dev/null +++ b/node_modules/module-deps/example/deps.js @@ -0,0 +1,6 @@ +var mdeps = require('../'); +var JSONStream = require('JSONStream'); + +var md = mdeps(); +md.pipe(JSONStream.stringify()).pipe(process.stdout); +md.end({ file: __dirname + '/files/main.js' }); diff --git a/node_modules/module-deps/example/files/bar.js b/node_modules/module-deps/example/files/bar.js new file mode 100644 index 000000000..c57fa530a --- /dev/null +++ b/node_modules/module-deps/example/files/bar.js @@ -0,0 +1,3 @@ +module.exports = function (n) { + return n * 100; +}; diff --git a/node_modules/module-deps/example/files/foo.js b/node_modules/module-deps/example/files/foo.js new file mode 100644 index 000000000..c62e63856 --- /dev/null +++ b/node_modules/module-deps/example/files/foo.js @@ -0,0 +1,5 @@ +var bar = require('./bar'); + +module.exports = function (n) { + return n * 111 + bar(n); +}; diff --git a/node_modules/module-deps/example/files/main.js b/node_modules/module-deps/example/files/main.js new file mode 100644 index 000000000..8c71d7997 --- /dev/null +++ b/node_modules/module-deps/example/files/main.js @@ -0,0 +1,2 @@ +var foo = require('./foo'); +console.log('main: ' + foo(5)); diff --git a/node_modules/module-deps/example/files/xyz.js b/node_modules/module-deps/example/files/xyz.js new file mode 100644 index 000000000..dff6877a8 --- /dev/null +++ b/node_modules/module-deps/example/files/xyz.js @@ -0,0 +1,2 @@ +var foo = require('./foo'); +console.log('xyz: ' + foo(6)); diff --git a/node_modules/module-deps/index.js b/node_modules/module-deps/index.js new file mode 100644 index 000000000..ac455c48f --- /dev/null +++ b/node_modules/module-deps/index.js @@ -0,0 +1,625 @@ +var fs = require('fs'); +var path = require('path'); +var relativePath = require('cached-path-relative'); + +var browserResolve = require('browser-resolve'); +var nodeResolve = require('resolve'); +var detective = require('detective'); +var through = require('through2'); +var concat = require('concat-stream'); +var parents = require('parents'); +var combine = require('stream-combiner2'); +var duplexer = require('duplexer2'); +var xtend = require('xtend'); +var defined = require('defined'); + +var inherits = require('inherits'); +var Transform = require('readable-stream').Transform; + +module.exports = Deps; +inherits(Deps, Transform); + +function Deps (opts) { + var self = this; + if (!(this instanceof Deps)) return new Deps(opts); + Transform.call(this, { objectMode: true }); + + if (!opts) opts = {}; + + this.basedir = opts.basedir || process.cwd(); + this.persistentCache = opts.persistentCache || function (file, id, pkg, fallback, cb) { + process.nextTick(function () { + fallback(null, cb); + }); + }; + this.cache = opts.cache; + this.fileCache = opts.fileCache; + this.pkgCache = opts.packageCache || {}; + this.pkgFileCache = {}; + this.pkgFileCachePending = {}; + this._emittedPkg = {}; + this._transformDeps = {}; + this.visited = {}; + this.walking = {}; + this.entries = []; + this._input = []; + + this.paths = opts.paths || process.env.NODE_PATH || ''; + if (typeof this.paths === 'string') { + var delimiter = path.delimiter || (process.platform === 'win32' ? ';' : ':'); + this.paths = this.paths.split(delimiter); + } + this.paths = this.paths + .filter(Boolean) + .map(function (p) { + return path.resolve(self.basedir, p); + }); + + this.transforms = [].concat(opts.transform).filter(Boolean); + this.globalTransforms = [].concat(opts.globalTransform).filter(Boolean); + this.resolver = opts.resolve || browserResolve; + this.detective = opts.detect || detective; + this.options = xtend(opts); + if (!this.options.modules) this.options.modules = {}; + + // If the caller passes options.expose, store resolved pathnames for exposed + // modules in it. If not, set it anyway so it's defined later. + if (!this.options.expose) this.options.expose = {}; + this.pending = 0; + this.inputPending = 0; + + var topfile = path.join(this.basedir, '__fake.js'); + this.top = { + id: topfile, + filename: topfile, + paths: this.paths, + basedir: this.basedir + }; +} + +Deps.prototype._isTopLevel = function (file) { + var isTopLevel = this.entries.some(function (main) { + var m = relativePath(path.dirname(main), file); + return m.split(/[\\\/]/).indexOf('node_modules') < 0; + }); + if (!isTopLevel) { + var m = relativePath(this.basedir, file); + isTopLevel = m.split(/[\\\/]/).indexOf('node_modules') < 0; + } + return isTopLevel; +}; + +Deps.prototype._transform = function (row, enc, next) { + var self = this; + if (typeof row === 'string') { + row = { file: row }; + } + if (row.transform && row.global) { + this.globalTransforms.push([ row.transform, row.options ]); + return next(); + } + else if (row.transform) { + this.transforms.push([ row.transform, row.options ]); + return next(); + } + + self.pending ++; + var basedir = defined(row.basedir, self.basedir); + + if (row.entry !== false) { + self.entries.push(path.resolve(basedir, row.file || row.id)); + } + + self.lookupPackage(row.file, function (err, pkg) { + if (err && self.options.ignoreMissing) { + self.emit('missing', row.file, self.top); + self.pending --; + return next(); + } + if (err) return self.emit('error', err) + self.pending --; + self._input.push({ row: row, pkg: pkg }); + next(); + }); +}; + +Deps.prototype._flush = function () { + var self = this; + var files = {}; + self._input.forEach(function (r) { + var w = r.row, f = files[w.file || w.id]; + if (f) { + f.row.entry = f.row.entry || w.entry; + var ex = f.row.expose || w.expose; + f.row.expose = ex; + if (ex && f.row.file === f.row.id && w.file !== w.id) { + f.row.id = w.id; + } + } + else files[w.file || w.id] = r; + }); + + Object.keys(files).forEach(function (key) { + var r = files[key]; + var pkg = r.pkg || {}; + var dir = r.row.file ? path.dirname(r.row.file) : self.basedir; + if (!pkg.__dirname) pkg.__dirname = dir; + self.walk(r.row, xtend(self.top, { + filename: path.join(dir, '_fake.js') + })); + }); + if (this.pending === 0) this.push(null); + this._ended = true; +}; + +Deps.prototype.resolve = function (id, parent, cb) { + var self = this; + var opts = self.options; + + if (xhas(self.cache, parent.id, 'deps', id) + && self.cache[parent.id].deps[id]) { + var file = self.cache[parent.id].deps[id]; + var pkg = self.pkgCache[file]; + if (pkg) return cb(null, file, pkg); + return self.lookupPackage(file, function (err, pkg) { + cb(null, file, pkg); + }); + } + + parent.packageFilter = function (p, x) { + var pkgdir = path.dirname(x); + if (opts.packageFilter) p = opts.packageFilter(p, x); + p.__dirname = pkgdir; + + return p; + }; + + if (opts.extensions) parent.extensions = opts.extensions; + if (opts.modules) parent.modules = opts.modules; + + self.resolver(id, parent, function onresolve (err, file, pkg, fakePath) { + if (err) return cb(err); + if (!file) return cb(new Error( + 'module not found: "' + id + '" from file ' + + parent.filename + )); + + if (!pkg || !pkg.__dirname) { + self.lookupPackage(file, function (err, p) { + if (err) return cb(err); + if (!p) p = {}; + if (!p.__dirname) p.__dirname = path.dirname(file); + self.pkgCache[file] = p; + onresolve(err, file, opts.packageFilter + ? opts.packageFilter(p, p.__dirname) : p, + fakePath + ); + }); + } + else cb(err, file, pkg, fakePath); + }); +}; + +Deps.prototype.readFile = function (file, id, pkg) { + var self = this; + if (xhas(this.fileCache, file)) { + return toStream(this.fileCache[file]); + } + var rs = fs.createReadStream(file, { + encoding: 'utf8' + }); + return rs; +}; + +Deps.prototype.getTransforms = function (file, pkg, opts) { + if (!opts) opts = {}; + var self = this; + + var isTopLevel; + if (opts.builtin || opts.inNodeModules) isTopLevel = false; + else isTopLevel = this._isTopLevel(file); + + var transforms = [].concat(isTopLevel ? this.transforms : []) + .concat(getTransforms(pkg, { + globalTransform: this.globalTransforms, + transformKey: this.options.transformKey + })) + ; + if (transforms.length === 0) return through(); + + var pending = transforms.length; + var streams = []; + var input = through(); + var output = through(); + var dup = duplexer(input, output); + + for (var i = 0; i < transforms.length; i++) (function (i) { + makeTransform(transforms[i], function (err, trs) { + if (err) { + return dup.emit('error', err); + } + streams[i] = trs; + if (-- pending === 0) done(); + }); + })(i); + return dup; + + function done () { + var middle = combine.apply(null, streams); + middle.on('error', function (err) { + err.message += ' while parsing file: ' + file; + if (!err.filename) err.filename = file; + dup.emit('error', err); + }); + input.pipe(middle).pipe(output); + } + + function makeTransform (tr, cb) { + var trOpts = {}; + if (Array.isArray(tr)) { + trOpts = tr[1] || {}; + tr = tr[0]; + } + trOpts._flags = trOpts.hasOwnProperty('_flags') ? trOpts._flags : self.options; + if (typeof tr === 'function') { + var t = tr(file, trOpts); + // allow transforms to `stream.emit('dep', path)` to add dependencies for this file + t.on('dep', function (dep) { + if (!self._transformDeps[file]) self._transformDeps[file] = []; + self._transformDeps[file].push(dep); + }); + self.emit('transform', t, file); + nextTick(cb, null, wrapTransform(t)); + } + else { + loadTransform(tr, trOpts, function (err, trs) { + if (err) return cb(err); + cb(null, wrapTransform(trs)); + }); + } + } + + function loadTransform (id, trOpts, cb) { + var params = { + basedir: path.dirname(file), + preserveSymlinks: false + }; + nodeResolve(id, params, function nr (err, res, again) { + if (err && again) return cb && cb(err); + + if (err) { + params.basedir = pkg.__dirname; + return nodeResolve(id, params, function (e, r) { + nr(e, r, true); + }); + } + + if (!res) return cb(new Error( + 'cannot find transform module ' + tr + + ' while transforming ' + file + )); + + var r = require(res); + if (typeof r !== 'function') { + return cb(new Error( + 'Unexpected ' + typeof r + ' exported by the ' + + JSON.stringify(res) + ' package. ' + + 'Expected a transform function.' + )); + } + + var trs = r(file, trOpts); + // allow transforms to `stream.emit('dep', path)` to add dependencies for this file + trs.on('dep', function (dep) { + if (!self._transformDeps[file]) self._transformDeps[file] = []; + self._transformDeps[file].push(dep); + }); + self.emit('transform', trs, file); + cb(null, trs); + }); + } +}; + +Deps.prototype.walk = function (id, parent, cb) { + var self = this; + var opts = self.options; + this.pending ++; + + var rec = {}; + var input; + if (typeof id === 'object') { + rec = xtend(id); + if (rec.entry === false) delete rec.entry; + id = rec.file || rec.id; + input = true; + this.inputPending ++; + } + + self.resolve(id, parent, function (err, file, pkg, fakePath) { + // this is checked early because parent.modules is also modified + // by this function. + var builtin = has(parent.modules, id); + + if (rec.expose) { + // Set options.expose to make the resolved pathname available to the + // caller. They may or may not have requested it, but it's harmless + // to set this if they didn't. + self.options.expose[rec.expose] = + self.options.modules[rec.expose] = file; + } + if (pkg && !self._emittedPkg[pkg.__dirname]) { + self._emittedPkg[pkg.__dirname] = true; + self.emit('package', pkg); + } + + if (opts.postFilter && !opts.postFilter(id, file, pkg)) { + if (--self.pending === 0) self.push(null); + if (input) --self.inputPending; + return cb && cb(null, undefined); + } + if (err && rec.source) { + file = rec.file; + + var ts = self.getTransforms(file, pkg); + ts.on('error', function (err) { + self.emit('error', err); + }); + ts.pipe(concat(function (body) { + rec.source = body.toString('utf8'); + fromSource(file, rec.source, pkg); + })); + return ts.end(rec.source); + } + if (err && self.options.ignoreMissing) { + if (--self.pending === 0) self.push(null); + if (input) --self.inputPending; + self.emit('missing', id, parent); + return cb && cb(null, undefined); + } + if (err) return self.emit('error', err); + if (self.visited[file]) { + if (-- self.pending === 0) self.push(null); + if (input) --self.inputPending; + return cb && cb(null, file); + } + self.visited[file] = true; + + if (rec.source) { + var ts = self.getTransforms(file, pkg); + ts.on('error', function (err) { + self.emit('error', err); + }); + ts.pipe(concat(function (body) { + rec.source = body.toString('utf8'); + fromSource(file, rec.source, pkg); + })); + return ts.end(rec.source); + } + + var c = self.cache && self.cache[file]; + if (c) return fromDeps(file, c.source, c.package, fakePath, Object.keys(c.deps)); + + self.persistentCache(file, id, pkg, persistentCacheFallback, function (err, c) { + self.emit('file', file, id); + if (err) { + self.emit('error', err); + return; + } + fromDeps(file, c.source, c.package, fakePath, Object.keys(c.deps)); + }); + + function persistentCacheFallback (dataAsString, cb) { + var stream = dataAsString ? toStream(dataAsString) : self.readFile(file, id, pkg).on('error', cb); + stream + .pipe(self.getTransforms(fakePath || file, pkg, { + builtin: builtin, + inNodeModules: parent.inNodeModules + })) + .on('error', cb) + .pipe(concat(function (body) { + var src = body.toString('utf8'); + try { var deps = getDeps(file, src); } + catch (err) { cb(err); } + if (deps) { + cb(null, { + source: src, + package: pkg, + deps: deps.reduce(function (deps, dep) { + deps[dep] = true; + return deps; + }, {}) + }); + } + })); + } + }); + + function getDeps (file, src) { + var deps = rec.noparse ? [] : self.parseDeps(file, src); + // dependencies emitted by transforms + if (self._transformDeps[file]) deps = deps.concat(self._transformDeps[file]); + return deps; + } + + function fromSource (file, src, pkg, fakePath) { + var deps = getDeps(file, src); + if (deps) fromDeps(file, src, pkg, fakePath, deps); + } + + function fromDeps (file, src, pkg, fakePath, deps) { + var p = deps.length; + var resolved = {}; + + if (input) --self.inputPending; + + (function resolve () { + if (self.inputPending > 0) return setTimeout(resolve); + deps.forEach(function (id) { + if (opts.filter && !opts.filter(id)) { + resolved[id] = false; + if (--p === 0) done(); + return; + } + var isTopLevel = self._isTopLevel(fakePath || file); + var current = { + id: file, + filename: file, + paths: self.paths, + package: pkg, + inNodeModules: parent.inNodeModules || !isTopLevel + }; + self.walk(id, current, function (err, r) { + resolved[id] = r; + if (--p === 0) done(); + }); + }); + if (deps.length === 0) done(); + })(); + + function done () { + if (!rec.id) rec.id = file; + if (!rec.source) rec.source = src; + if (!rec.deps) rec.deps = resolved; + if (!rec.file) rec.file = file; + + if (self.entries.indexOf(file) >= 0) { + rec.entry = true; + } + self.push(rec); + + if (cb) cb(null, file); + if (-- self.pending === 0) self.push(null); + } + } +}; + +Deps.prototype.parseDeps = function (file, src, cb) { + var self = this; + if (this.options.noParse === true) return []; + if (/\.json$/.test(file)) return []; + + if (Array.isArray(this.options.noParse) + && this.options.noParse.indexOf(file) >= 0) { + return []; + } + + try { var deps = self.detective(src) } + catch (ex) { + var message = ex && ex.message ? ex.message : ex; + throw new Error( + 'Parsing file ' + file + ': ' + message + ); + } + return deps; +}; + +Deps.prototype.lookupPackage = function (file, cb) { + var self = this; + + var cached = this.pkgCache[file]; + if (cached) return nextTick(cb, null, cached); + if (cached === false) return nextTick(cb, null, undefined); + + var dirs = parents(file ? path.dirname(file) : self.basedir); + + (function next () { + if (dirs.length === 0) { + self.pkgCache[file] = false; + return cb(null, undefined); + } + var dir = dirs.shift(); + if (dir.split(/[\\\/]/).slice(-1)[0] === 'node_modules') { + return cb(null, undefined); + } + + var pkgfile = path.join(dir, 'package.json'); + + var cached = self.pkgCache[pkgfile]; + if (cached) return nextTick(cb, null, cached); + else if (cached === false) return next(); + + var pcached = self.pkgFileCachePending[pkgfile]; + if (pcached) return pcached.push(onpkg); + pcached = self.pkgFileCachePending[pkgfile] = []; + + fs.readFile(pkgfile, function (err, src) { + if (err) return onpkg(); + try { var pkg = JSON.parse(src) } + catch (err) { + return onpkg(new Error([ + err + ' while parsing json file ' + pkgfile + ].join(''))); + } + pkg.__dirname = dir; + + self.pkgCache[pkgfile] = pkg; + self.pkgCache[file] = pkg; + onpkg(null, pkg); + }); + + function onpkg (err, pkg) { + if (self.pkgFileCachePending[pkgfile]) { + var fns = self.pkgFileCachePending[pkgfile]; + delete self.pkgFileCachePending[pkgfile]; + fns.forEach(function (f) { f(err, pkg) }); + } + if (err) cb(err); + else if (pkg && typeof pkg === 'object') cb(null, pkg); + else { + self.pkgCache[pkgfile] = false; + next(); + } + } + })(); +}; + +function getTransforms (pkg, opts) { + var trx = []; + if (opts.transformKey) { + var n = pkg; + var keys = opts.transformKey; + for (var i = 0; i < keys.length; i++) { + if (n && typeof n === 'object') n = n[keys[i]]; + else break; + } + if (i === keys.length) { + trx = [].concat(n).filter(Boolean); + } + } + return trx.concat(opts.globalTransform || []); +} + +function nextTick (cb) { + var args = [].slice.call(arguments, 1); + process.nextTick(function () { cb.apply(null, args) }); +} + +function xhas (obj) { + if (!obj) return false; + for (var i = 1; i < arguments.length; i++) { + var key = arguments[i]; + if (!has(obj, key)) return false; + obj = obj[key]; + } + return true; +} + +function toStream (dataAsString) { + var tr = through(); + tr.push(dataAsString); + tr.push(null); + return tr; +} + +function has (obj, key) { + return obj && Object.prototype.hasOwnProperty.call(obj, key); +} + +function wrapTransform (tr) { + if (typeof tr.read === 'function') return tr; + var input = through(), output = through(); + input.pipe(tr).pipe(output); + var wrapper = duplexer(input, output); + tr.on('error', function (err) { wrapper.emit('error', err) }); + return wrapper; +} diff --git a/node_modules/module-deps/package.json b/node_modules/module-deps/package.json new file mode 100644 index 000000000..6bc7e1fc0 --- /dev/null +++ b/node_modules/module-deps/package.json @@ -0,0 +1,84 @@ +{ + "_from": "module-deps@^6.0.0", + "_id": "module-deps@6.1.0", + "_inBundle": false, + "_integrity": "sha512-NPs5N511VD1rrVJihSso/LiBShRbJALYBKzDW91uZYy7BpjnO4bGnZL3HjZ9yKcFdZUWwaYjDz9zxbuP7vKMuQ==", + "_location": "/module-deps", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "module-deps@^6.0.0", + "name": "module-deps", + "escapedName": "module-deps", + "rawSpec": "^6.0.0", + "saveSpec": null, + "fetchSpec": "^6.0.0" + }, + "_requiredBy": [ + "/browserify" + ], + "_resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.1.0.tgz", + "_shasum": "d1e1efc481c6886269f7112c52c3236188e16479", + "_spec": "module-deps@^6.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bin": { + "module-deps": "bin/cmd.js" + }, + "bugs": { + "url": "https://github.com/browserify/module-deps/issues" + }, + "bundleDependencies": false, + "dependencies": { + "JSONStream": "^1.0.3", + "browser-resolve": "^1.7.0", + "cached-path-relative": "^1.0.0", + "concat-stream": "~1.6.0", + "defined": "^1.0.0", + "detective": "^5.0.2", + "duplexer2": "^0.1.2", + "inherits": "^2.0.1", + "parents": "^1.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.4.0", + "stream-combiner2": "^1.1.1", + "subarg": "^1.0.0", + "through2": "^2.0.0", + "xtend": "^4.0.0" + }, + "deprecated": false, + "description": "walk the dependency graph to generate json output that can be fed into browser-pack", + "devDependencies": { + "browser-pack": "^6.0.2", + "tap": "^1.0.0" + }, + "engines": { + "node": ">= 0.8.0" + }, + "homepage": "https://github.com/browserify/module-deps", + "keywords": [ + "dependency", + "graph", + "browser", + "require", + "module", + "exports", + "json" + ], + "license": "MIT", + "main": "index.js", + "name": "module-deps", + "repository": { + "type": "git", + "url": "git://github.com/browserify/module-deps.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "6.1.0" +} diff --git a/node_modules/module-deps/readme.markdown b/node_modules/module-deps/readme.markdown new file mode 100644 index 000000000..e7805e0ce --- /dev/null +++ b/node_modules/module-deps/readme.markdown @@ -0,0 +1,312 @@ +# module-deps + +walk the dependency graph to generate json output that can be fed into +[browser-pack](https://github.com/browserify/browser-pack) + +[![build status](https://secure.travis-ci.org/browserify/module-deps.png)](http://travis-ci.org/browserify/module-deps) + +# example + +``` js +var mdeps = require('module-deps'); +var JSONStream = require('JSONStream'); + +var md = mdeps(); +md.pipe(JSONStream.stringify()).pipe(process.stdout); +md.end({ file: __dirname + '/files/main.js' }); +``` + +output: + +```json +$ node example/deps.js +[ +{"id":"/home/substack/projects/module-deps/example/files/main.js","source":"var foo = require('./foo');\nconsole.log('main: ' + foo(5));\n","entry":true,"deps":{"./foo":"/home/substack/projects/module-deps/example/files/foo.js"}} +, +{"id":"/home/substack/projects/module-deps/example/files/foo.js","source":"var bar = require('./bar');\n\nmodule.exports = function (n) {\n return n * 111 + bar(n);\n};\n","deps":{"./bar":"/home/substack/projects/module-deps/example/files/bar.js"}} +, +{"id":"/home/substack/projects/module-deps/example/files/bar.js","source":"module.exports = function (n) {\n return n * 100;\n};\n","deps":{}} +] +``` + +and you can feed this json data into +[browser-pack](https://github.com/browserify/browser-pack): + +```bash +$ node example/deps.js | browser-pack | node +main: 1055 +``` + +# usage + +``` +usage: module-deps [files] + + generate json output from each entry file + +``` + +# methods + +``` js +var mdeps = require('module-deps') +``` + +## var d = mdeps(opts={}) + +Return an object transform stream `d` that expects entry filenames or +`{ id: ..., file: ... }` objects as input and produces objects for every +dependency from a recursive module traversal as output. + +Each file in `files` can be a string filename or a stream. + +Optionally pass in some `opts`: + +* `opts.transform` - a string or array of string transforms (see below) + +* `opts.transformKey` - an array path of strings showing where to look in the +package.json for source transformations. If falsy, don't look at the +package.json at all. + +* `opts.resolve` - custom resolve function using the +`opts.resolve(id, parent, cb)` signature that +[browser-resolve](https://github.com/shtylman/node-browser-resolve) has + +* `opts.detect` - a custom dependency detection function. `opts.detect(source)` +should return an array of dependency module names. By default +[detective](https://github.com/browserify/detective) is used. + +* `opts.filter` - a function (id) to skip resolution of some module `id` strings. +If defined, `opts.filter(id)` should return truthy for all the ids to include +and falsey for all the ids to skip. + +* `opts.postFilter` - a function (id, file, pkg) that gets called after `id` has +been resolved. Return false to skip this file. + +* `opts.packageFilter` - transform the parsed package.json contents before using +the values. `opts.packageFilter(pkg, dir)` should return the new `pkg` object to +use. + +* `opts.noParse` - an array of absolute paths to not parse for dependencies. Use +this for large dependencies like jquery or threejs which take forever to parse. + +* `opts.cache` - an object mapping filenames to file objects to skip costly io + +* `opts.packageCache` - an object mapping filenames to their parent package.json +contents for browser fields, main entries, and transforms + +* `opts.fileCache` - an object mapping filenames to raw source to avoid reading +from disk. + +* `opts.persistentCache` - a complex cache handler that allows async and persistent + caching of data. A `persistentCache` needs to follow this interface: + ```js + function persistentCache ( + file, // the path to the file that is loaded + id, // the id that is used to reference this file + pkg, // the package that this file belongs to fallback + fallback, // async fallback handler to be called if the cache doesn't hold the given file + cb // callback handler that receives the cache data + ) { + if (hasError()) { + return cb(error) // Pass any error to the callback + } + + var fileData = fs.readFileSync(file) + var key = keyFromFile(file, fileData) + + if (db.has(key)) { + return cb(null, { + source: db.get(key).toString(), + package: pkg, // The package for housekeeping + deps: { + 'id': // id that is used to reference a required file + 'file' // file path to the required file + } + }) + } + // + // The fallback will process the file in case the file is not + // in cache. + // + // Note that if your implementation doesn't need the file data + // then you can pass `null` instead of the source and the fallback will + // fetch the data by itself. + // + fallback(fileData, function (error, cacheableEntry) { + if (error) { + return cb(error) + } + db.addToCache(key, cacheableEntry) + cb(null, cacheableEntry) + }) + } + ``` + +* `opts.paths` - array of global paths to search. Defaults to splitting on `':'` +in `process.env.NODE_PATH` + +* `opts.ignoreMissing` - ignore files that failed to resolve + +# input objects + +Input objects should be string filenames or objects with these parameters: + +* `row.file` - filename +* `row.entry` - whether to treat this file as an entry point, defaults to + `true`. Set to `false` to include this file, but not run it automatically. +* `row.expose` - name to be exposed as +* `row.noparse` - when true, don't parse the file contents for dependencies + +or objects can specify transforms: + +* `row.transform` - string name, path, or function +* `row.options` - transform options as an object +* `row.global` - boolean, whether the transform is global + +# output objects + +Output objects describe files with dependencies. They have these properties: + +* `row.id` - an identifier for the file, used in the `row.deps` prperty +* `row.file` - path to the source file +* `row.entry` - true if the file is an entry point +* `row.expose` - name to be exposed as +* `row.source` - source file content as a string +* `row.deps` - object describing dependencies. The keys are strings as used + in `require()` calls in the file, and values are the row IDs (file paths) + of dependencies. + +# events + +## d.on('transform', function (tr, file) {}) + +Every time a transform is applied to a `file`, a `'transform'` event fires with +the instantiated transform stream `tr`. + +## d.on('file', function (file) {}) + +Every time a file is read, this event fires with the file path. + +## d.on('missing', function (id, parent) {}) + +When `opts.ignoreMissing` is enabled, this event fires for each missing package. + +## d.on('package', function (pkg) {}) + +Every time a package is read, this event fires. The directory name of the +package is available in `pkg.__dirname`. + +# transforms + +module-deps can be configured to run source transformations on files before +parsing them for `require()` calls. These transforms are useful if you want to +compile a language like [coffeescript](http://coffeescript.org/) on the fly or +if you want to load static assets into your bundle by parsing the AST for +`fs.readFileSync()` calls. + +If the transform is a function, it should take the `file` name as an argument +and return a through stream that will be written file contents and should output +the new transformed file contents. + +If the transform is a string, it is treated as a module name that will resolve +to a module that is expected to follow this format: + +``` js +var through = require('through2'); +module.exports = function (file, opts) { return through() }; +``` + +You don't necessarily need to use the +[through2](https://github.com/rvagg/through2) module to create a +readable/writable filter stream for transforming file contents, but this is an +easy way to do it. + +module-deps looks for `require()` calls and adds their arguments as dependencies +of a file. Transform streams can emit `'dep'` events to include additional +dependencies that are not consumed with `require()`. + +When you call `mdeps()` with an `opts.transform`, the transformations you +specify will not be run for any files in node_modules/. This is because modules +you include should be self-contained and not need to worry about guarding +themselves against transformations that may happen upstream. + +Modules can apply their own transformations by setting a transformation pipeline +in their package.json at the `opts.transformKey` path. These transformations +only apply to the files directly in the module itself, not to the module's +dependants nor to its dependencies. + +## package.json transformKey + +Transform keys live at a configurable location in the package.json denoted by +the `opts.transformKey` array. + +For a transformKey of `['foo','bar']`, the transformKey can be a single string +(`"fff"`): + +``` json +{ + "foo": { + "bar": "fff" + } +} +``` + +or an array of strings (`["fff","ggg"]`): + +``` json +{ + "foo": { + "bar": ["fff","ggg"] + } +} +``` + +If you want to pass options to the transforms, you can use a 2-element array +inside of the primary array. Here `fff` gets an options object with `{"x":3}` +and `ggg` gets `{"y":4}`: + +``` json +{ + "foo": { + "bar": [["fff",{"x":3}],["ggg",{"y":4}]] + } +} +``` + +Options sent to the module-deps constructor are also provided under +`opts._flags`. These options are sometimes required if your transform +needs to do something different when browserify is run in debug mode, for +example. + +# usage + +``` +module-deps [FILES] OPTIONS + + Generate json output for the entry point FILES. + +OPTIONS are: + + -t TRANSFORM Apply a TRANSFORM. + -g TRANSFORM Apply a global TRANSFORM. + +``` + +# install + +With [npm](http://npmjs.org), to get the module do: + +``` +npm install module-deps +``` + +and to get the `module-deps` command do: + +``` +npm install -g module-deps +``` + +# license + +MIT diff --git a/node_modules/module-deps/test/bundle.js b/node_modules/module-deps/test/bundle.js new file mode 100644 index 000000000..adf12efe4 --- /dev/null +++ b/node_modules/module-deps/test/bundle.js @@ -0,0 +1,23 @@ +var parser = require('../'); +var test = require('tap').test; +var JSONStream = require('JSONStream'); +var packer = require('browser-pack'); +var path = require('path'); + +test('bundle', function (t) { + t.plan(1); + var p = parser(); + p.end(path.join(__dirname, '/files/main.js')); + p.on('error', t.fail.bind(t)); + var pack = packer(); + + p.pipe(JSONStream.stringify()).pipe(pack); + + var src = ''; + pack.on('data', function (buf) { src += buf }); + pack.on('end', function () { + Function('console', src)({ + log: function (s) { t.equal(s, 'main: 1055') } + }); + }); +}); diff --git a/node_modules/module-deps/test/cache.js b/node_modules/module-deps/test/cache.js new file mode 100644 index 000000000..95c8afb5b --- /dev/null +++ b/node_modules/module-deps/test/cache.js @@ -0,0 +1,50 @@ +var parser = require('../'); +var test = require('tap').test; +var path = require('path'); + +var files = { + foo: path.join(__dirname, '/files/foo.js'), + bar: path.join(__dirname, '/files/bar.js') +}; + +var sources = { + foo: 'notreal foo', + bar: 'notreal bar' +}; + +var cache = {}; +cache[files.foo] = { + source: sources.foo, + deps: { './bar': files.bar } +}; +cache[files.bar] = { + source: sources.bar, + deps: {} +}; + +test('uses cache', function (t) { + t.plan(1); + var p = parser({ cache: cache }); + p.end({ id: 'foo', file: files.foo, entry: false }); + + var rows = []; + p.on('data', function (row) { rows.push(row) }); + p.on('end', function () { + t.same(rows.sort(cmp), [ + { + id: 'foo', + file: files.foo, + source: sources.foo, + deps: { './bar': files.bar } + }, + { + id: files.bar, + file: files.bar, + source: sources.bar, + deps: {} + } + ].sort(cmp)); + }); +}); + +function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/cache_expose.js b/node_modules/module-deps/test/cache_expose.js new file mode 100644 index 000000000..d52dc69fc --- /dev/null +++ b/node_modules/module-deps/test/cache_expose.js @@ -0,0 +1,54 @@ +var parser = require('../'); +var test = require('tap').test; +var path = require('path'); + +var files = { + foo: path.join(__dirname, '/files/foo.js'), + bar: path.join(__dirname, '/files/bar.js') +}; + +var sources = { + foo: 'notreal foo', + bar: 'notreal bar' +}; + +var cache = {}; +cache[files.foo] = { + source: sources.foo, + deps: { './bar': files.bar } +}; +cache[files.bar] = { + source: sources.bar, + deps: {} +}; + +test('cache preserves expose and entry', function (t) { + t.plan(1); + var p = parser({ cache: cache }); + p.write({ id: files.bar, expose: 'bar2', entry: false }); + p.end({ id: 'foo', file: files.foo, entry: true, expose: 'foo2' }); + + var rows = []; + p.on('data', function (row) { rows.push(row) }); + p.on('end', function () { + t.same(rows.sort(cmp), [ + { + id: 'foo', + expose: 'foo2', + entry: true, + file: files.foo, + source: sources.foo, + deps: { './bar': files.bar } + }, + { + id: files.bar, + expose: 'bar2', + file: files.bar, + source: sources.bar, + deps: {} + } + ].sort(cmp)); + }); +}); + +function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/cache_partial.js b/node_modules/module-deps/test/cache_partial.js new file mode 100644 index 000000000..ca98c119f --- /dev/null +++ b/node_modules/module-deps/test/cache_partial.js @@ -0,0 +1,47 @@ +var parser = require('../'); +var test = require('tap').test; +var fs = require('fs'); +var path = require('path'); + +var files = { + foo: path.join(__dirname, '/files/foo.js'), + bar: path.join(__dirname, '/files/bar.js') +}; + +var sources = { + foo: 'notreal foo', + bar: fs.readFileSync(files.bar, 'utf8') +}; + +var cache = {}; +cache[files.foo] = { + source: sources.foo, + deps: { './bar': files.bar } +}; + +test('uses cache and reads from disk', function (t) { + t.plan(1); + var p = parser({ cache: cache }); + p.end({ id: 'foo', file: files.foo, entry: false }); + + var rows = []; + p.on('data', function (row) { rows.push(row) }); + p.on('end', function () { + t.same(rows.sort(cmp), [ + { + id: 'foo', + file: files.foo, + source: sources.foo, + deps: { './bar': files.bar } + }, + { + id: files.bar, + file: files.bar, + source: sources.bar, + deps: {} + } + ].sort(cmp)); + }); +}); + +function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/cache_partial_expose.js b/node_modules/module-deps/test/cache_partial_expose.js new file mode 100644 index 000000000..1d5280b5b --- /dev/null +++ b/node_modules/module-deps/test/cache_partial_expose.js @@ -0,0 +1,104 @@ +var parser = require('../'); +var test = require('tap').test; +var fs = require('fs'); +var path = require('path'); +var xtend = require('xtend'); + +var files = { + abc: path.join(__dirname, '/expose/lib/abc.js'), + xyz: path.join(__dirname, '/expose/lib/xyz.js'), + foo: path.join(__dirname, '/expose/foo.js'), + bar: path.join(__dirname, '/expose/bar.js'), + main: path.join(__dirname, '/expose/main.js') +}; + +var sources = Object.keys(files).reduce(function (acc, file) { + acc[file] = fs.readFileSync(files[file], 'utf8'); + return acc; +}, {}); + +var cache = {}; +cache[files.abc] = { + source: sources.abc, + deps: {} +}; +cache[files.xyz] = { + source: sources.xyz, + deps: {'../foo': files.foo} +}; +cache[files.foo] = { + source: sources.foo, + deps: {'./lib/abc': files.abc} +}; +cache[files.bar] = { + source: sources.bar, + deps: {xyz: files.xyz} +}; +cache[files.main] = { + source: sources.main, + deps: { + abc: files.abc, + xyz: files.xyz, + './bar': files.bar + } +}; + +test('preserves expose and entry with partial cache', function(t) { + t.plan(1); + + var partialCache = xtend(cache); + delete partialCache[files.bar]; + + var p = parser({ cache: partialCache }); + p.write({ id: 'abc', file: files.abc, expose: 'abc' }); + p.write({ id: 'xyz', file: files.xyz, expose: 'xyz' }); + p.end({ id: 'main', file: files.main, entry: true }); + + var rows = []; + p.on('data', function (row) { rows.push(row); }); + p.on('end', function () { + t.same(rows.sort(cmp), [ + { + id: files.bar, + file: files.bar, + source: sources.bar, + deps: {xyz: files.xyz} + }, + { + file: files.foo, + id: files.foo, + source: sources.foo, + deps: {'./lib/abc': files.abc} + }, + { + id: 'abc', + file: files.abc, + source: sources.abc, + deps: {}, + entry: true, + expose: 'abc' + }, + { + id: 'main', + file: files.main, + source: sources.main, + deps: { + './bar': files.bar, + abc: files.abc, + xyz: files.xyz + }, + entry: true + }, + { + id: 'xyz', + file: files.xyz, + source: sources.xyz, + deps: {'../foo': files.foo}, + entry: true, + expose: 'xyz' + } + ].sort(cmp)); + }); +}); + +function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/cache_persistent.js b/node_modules/module-deps/test/cache_persistent.js new file mode 100644 index 000000000..13c827ee7 --- /dev/null +++ b/node_modules/module-deps/test/cache_persistent.js @@ -0,0 +1,122 @@ +var parser = require('../'); +var test = require('tap').test; +var path = require('path'); +var fs = require('fs'); + +var files = { + foo: path.join(__dirname, '/files/foo.js'), + bar: path.join(__dirname, '/files/bar.js') +}; + +test('uses persistent cache', function (t) { + t.plan(1); + var p = parser({ + persistentCache: function (file, id, pkg, fallback, cb) { + if (file === files.bar) { + return fallback(null, cb); + } + cb(null, { + source: 'file at ' + file + '@' + id, + package: pkg, + deps: { './bar': files.bar } + }); + } + }); + p.end({ id: 'foo', file: files.foo, entry: false }); + + var rows = []; + p.on('data', function (row) { rows.push(row) }); + p.on('end', function () { + t.same(rows.sort(cmp), [ + { + id: files.bar, + file: files.bar, + source: fs.readFileSync(files.bar, 'utf8'), + deps: {} + }, + { + id: 'foo', + file: files.foo, + source: 'file at ' + files.foo + '@' + files.foo, + deps: { './bar': files.bar } + } + ].sort(cmp)); + }); +}); + +test('passes persistent cache error through', function (t) { + t.plan(1); + var p = parser({ + persistentCache: function (file, id, pkg, fallback, cb) { + cb(new Error('foo')); + } + }); + p.end({ id: 'foo', file: files.foo, entry: false }); + p.on('error', function (err) { t.equals(err.message, 'foo') }); +}); + +test('allow passing of the raw source as string', function (t) { + t.plan(1); + var p = parser({ + persistentCache: function (file, id, pkg, fallback, cb) { + fallback(fs.readFileSync(files.bar, 'utf8'), cb); + } + }); + p.end({ id: 'foo', file: files.foo, entry: false }); + + var rows = []; + p.on('data', function (row) { rows.push(row) }); + p.on('end', function () { + t.same(rows.sort(cmp), [ + { + id: 'foo', + file: files.foo, + source: fs.readFileSync(files.bar, 'utf8'), + deps: {} + } + ].sort(cmp)); + }); +}); + +test('send file event with persistent cache', function (t) { + t.plan(2); + var p = parser({ + persistentCache: function (file, id, pkg, fallback, cb) { + cb(null, { + source: 'file at ' + file + '@' + id, + package: pkg, + deps: {} + }); + } + }); + p.end({ id: 'foo', file: files.foo, entry: false }); + p.on('file', function (file, id) { + t.same(file, path.resolve(files.foo)); + t.same(id, path.resolve(files.foo)); + }); +}); + +test('errors of transforms occur in the correct order with a persistent cache', function (t) { + t.plan(3); + var p = parser({ + transform: [ + path.join(__dirname, 'cache_persistent', 'error_transform') + ], + persistentCache: function (file, id, pkg, fallback, cb) { + fallback(fs.readFileSync(files.foo, 'utf8'), cb); + } + }); + p.end({ id: 'foo', file: files.foo, entry: false }); + var order = 0; + p.on('file', function (file, id) { + t.same(order, 0); + order += 1; + }); + p.on('error', function (err) { + t.same(order, 1); + t.same(err.message, 'rawr while parsing file: ' + path.resolve(files.foo)); + }); +}); + + +function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/cache_persistent/error_transform.js b/node_modules/module-deps/test/cache_persistent/error_transform.js new file mode 100644 index 000000000..0cfddab56 --- /dev/null +++ b/node_modules/module-deps/test/cache_persistent/error_transform.js @@ -0,0 +1,6 @@ +var through = require('through2'); +module.exports = function (file) { + return through(function (chunk, enc, callback) { + callback(new Error('rawr')); + }); +}; diff --git a/node_modules/module-deps/test/cycle.js b/node_modules/module-deps/test/cycle.js new file mode 100644 index 000000000..e2e3e9e5f --- /dev/null +++ b/node_modules/module-deps/test/cycle.js @@ -0,0 +1,19 @@ +var mdeps = require('../'); +var test = require('tap').test; +var JSONStream = require('JSONStream'); +var packer = require('browser-pack'); +var concat = require('concat-stream'); +var path = require('path'); + +test('cycle', function (t) { + t.plan(1); + var p = mdeps(); + p.end(path.join(__dirname, '/cycle/main.js')); + var pack = packer(); + + p.pipe(JSONStream.stringify()).pipe(pack).pipe(concat(function (src) { + Function('console', src.toString('utf8'))({ + log: function (msg) { t.equal(msg, 333) } + }); + })); +}); diff --git a/node_modules/module-deps/test/cycle/bar.js b/node_modules/module-deps/test/cycle/bar.js new file mode 100644 index 000000000..c78d1a5f2 --- /dev/null +++ b/node_modules/module-deps/test/cycle/bar.js @@ -0,0 +1,3 @@ +var foo = require('./foo.js'); + +module.exports = function (n) { return foo.p(n, 1) }; diff --git a/node_modules/module-deps/test/cycle/foo.js b/node_modules/module-deps/test/cycle/foo.js new file mode 100644 index 000000000..174496878 --- /dev/null +++ b/node_modules/module-deps/test/cycle/foo.js @@ -0,0 +1,4 @@ +var bar = require('./bar.js'); + +exports.ooo = function (n) { return n * bar(110) }; +exports.p = function (a, b) { return a + b } diff --git a/node_modules/module-deps/test/cycle/main.js b/node_modules/module-deps/test/cycle/main.js new file mode 100644 index 000000000..6601355f4 --- /dev/null +++ b/node_modules/module-deps/test/cycle/main.js @@ -0,0 +1,4 @@ +var foo = require('./foo.js'); +var bar = require('./bar.js'); + +console.log(foo.ooo(bar(2))); diff --git a/node_modules/module-deps/test/deps.js b/node_modules/module-deps/test/deps.js new file mode 100644 index 000000000..f269bc769 --- /dev/null +++ b/node_modules/module-deps/test/deps.js @@ -0,0 +1,49 @@ +var parser = require('../'); +var test = require('tap').test; +var fs = require('fs'); +var path = require('path'); + +var files = { + main: path.join(__dirname, '/files/main.js'), + foo: path.join(__dirname, '/files/foo.js'), + bar: path.join(__dirname, '/files/bar.js') +}; + +var sources = Object.keys(files).reduce(function (acc, file) { + acc[file] = fs.readFileSync(files[file], 'utf8'); + return acc; +}, {}); + +test('deps', function (t) { + t.plan(1); + var p = parser(); + p.end({ file: files.main, entry: true }); + + var rows = []; + p.on('data', function (row) { rows.push(row) }); + p.on('end', function () { + t.same(rows.sort(cmp), [ + { + id: files.main, + file: files.main, + source: sources.main, + entry: true, + deps: { './foo': files.foo } + }, + { + id: files.foo, + file: files.foo, + source: sources.foo, + deps: { './bar': files.bar } + }, + { + id: files.bar, + file: files.bar, + source: sources.bar, + deps: {} + } + ].sort(cmp)); + }); +}); + +function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/detect.js b/node_modules/module-deps/test/detect.js new file mode 100644 index 000000000..a5544590e --- /dev/null +++ b/node_modules/module-deps/test/detect.js @@ -0,0 +1,32 @@ +var parser = require('../'); +var test = require('tap').test; +var JSONStream = require('JSONStream'); +var packer = require('browser-pack'); +var path = require('path'); + +test('detect', function (t) { + t.plan(1); + var p = parser({ + detect: function (source) { + var rx = /require\(["'](.*?)["']\)/g; + var m, deps = []; + while (m = rx.exec(source)) { + deps.push(m[1]); + } + return deps; + } + }); + p.end(path.join(__dirname, '/files/main.js')); + p.on('error', t.fail.bind(t)); + var pack = packer(); + + p.pipe(JSONStream.stringify()).pipe(pack); + + var src = ''; + pack.on('data', function (buf) { src += buf }); + pack.on('end', function () { + Function('console', src)({ + log: function (s) { t.equal(s, 'main: 1055') } + }); + }); +}); diff --git a/node_modules/module-deps/test/dotdot.js b/node_modules/module-deps/test/dotdot.js new file mode 100644 index 000000000..d5f5fdde6 --- /dev/null +++ b/node_modules/module-deps/test/dotdot.js @@ -0,0 +1,20 @@ +var mdeps = require('../'); +var test = require('tap').test; +var through = require('through2'); +var path = require('path'); + +test('dotdot', function (t) { + var expected = [ + path.join(__dirname, '/dotdot/index.js'), + path.join(__dirname, '/dotdot/abc/index.js') + ]; + t.plan(expected.length); + + var d = mdeps(); + d.end(path.join(__dirname, '/dotdot/abc/index.js')); + + d.pipe(through.obj(function (row, enc, next) { + t.deepEqual(row.file, expected.shift()); + next(); + })); +}); diff --git a/node_modules/module-deps/test/dotdot/abc/index.js b/node_modules/module-deps/test/dotdot/abc/index.js new file mode 100644 index 000000000..67f2534eb --- /dev/null +++ b/node_modules/module-deps/test/dotdot/abc/index.js @@ -0,0 +1,2 @@ +var x = require('..'); +console.log(x); diff --git a/node_modules/module-deps/test/dotdot/index.js b/node_modules/module-deps/test/dotdot/index.js new file mode 100644 index 000000000..afec73603 --- /dev/null +++ b/node_modules/module-deps/test/dotdot/index.js @@ -0,0 +1 @@ +module.exports = 'whatever' diff --git a/node_modules/module-deps/test/expose.js b/node_modules/module-deps/test/expose.js new file mode 100644 index 000000000..947e79845 --- /dev/null +++ b/node_modules/module-deps/test/expose.js @@ -0,0 +1,41 @@ +var parser = require('../'); +var test = require('tap').test; +var fs = require('fs'); +var path = require('path'); + +var files = { + foo: path.join(__dirname, '/files/foo.js'), + bar: path.join(__dirname, '/files/bar.js') +}; + +var sources = Object.keys(files).reduce(function (acc, file) { + acc[file] = fs.readFileSync(files[file], 'utf8'); + return acc; +}, {}); + +test('single id export', function (t) { + t.plan(1); + var p = parser(); + p.end({ id: 'foo', file: files.foo, entry: false }); + + var rows = []; + p.on('data', function (row) { rows.push(row) }); + p.on('end', function () { + t.same(rows.sort(cmp), [ + { + id: 'foo', + file: files.foo, + source: sources.foo, + deps: { './bar': files.bar } + }, + { + id: files.bar, + file: files.bar, + source: sources.bar, + deps: {} + } + ].sort(cmp)); + }); +}); + +function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/expose/bar.js b/node_modules/module-deps/test/expose/bar.js new file mode 100644 index 000000000..31559ceef --- /dev/null +++ b/node_modules/module-deps/test/expose/bar.js @@ -0,0 +1 @@ +require('xyz'); diff --git a/node_modules/module-deps/test/expose/foo.js b/node_modules/module-deps/test/expose/foo.js new file mode 100644 index 000000000..aa7d3b95a --- /dev/null +++ b/node_modules/module-deps/test/expose/foo.js @@ -0,0 +1 @@ +require('./lib/abc'); diff --git a/node_modules/module-deps/test/expose/lib/abc.js b/node_modules/module-deps/test/expose/lib/abc.js new file mode 100644 index 000000000..d13b53674 --- /dev/null +++ b/node_modules/module-deps/test/expose/lib/abc.js @@ -0,0 +1 @@ +console.log('abc'); diff --git a/node_modules/module-deps/test/expose/lib/xyz.js b/node_modules/module-deps/test/expose/lib/xyz.js new file mode 100644 index 000000000..a44c530b0 --- /dev/null +++ b/node_modules/module-deps/test/expose/lib/xyz.js @@ -0,0 +1,2 @@ +require('../foo'); +console.log('xyz'); diff --git a/node_modules/module-deps/test/expose/main.js b/node_modules/module-deps/test/expose/main.js new file mode 100644 index 000000000..00c0e24fc --- /dev/null +++ b/node_modules/module-deps/test/expose/main.js @@ -0,0 +1,3 @@ +require('abc'); +require('xyz'); +require('./bar'); diff --git a/node_modules/module-deps/test/file_cache.js b/node_modules/module-deps/test/file_cache.js new file mode 100644 index 000000000..0a03c8774 --- /dev/null +++ b/node_modules/module-deps/test/file_cache.js @@ -0,0 +1,58 @@ +var mdeps = require('../'); +var test = require('tap').test; +var path = require('path'); +var through = require('through2'); + +var files = { + foo: path.join(__dirname, '/files/foo.js'), + bar: path.join(__dirname, '/files/bar.js') +}; + +var sources = { + foo: 'require("./bar"); var tongs;', + bar: 'notreal tongs' +}; + +var fileCache = {}; +fileCache[files.foo] = sources.foo; +fileCache[files.bar] = sources.bar; + +var specialReplace = function(input) { + return input.replace(/tongs/g, 'tangs'); +}; + +test('uses file cache', function (t) { + t.plan(1); + var p = mdeps({ + fileCache: fileCache, + transform: function (file) { + return through(function (buf, enc, next) { + this.push(specialReplace(String(buf))); + next(); + }); + }, + transformKey: [ 'browserify', 'transform' ] + }); + p.end({ id: 'foo', file: files.foo, entry: false }); + + var rows = []; + p.on('data', function (row) { rows.push(row) }); + p.on('end', function () { + t.same(rows.sort(cmp), [ + { + id: 'foo', + file: files.foo, + source: specialReplace(sources.foo), + deps: { './bar': files.bar } + }, + { + id: files.bar, + file: files.bar, + source: specialReplace(sources.bar), + deps: {} + } + ].sort(cmp)); + }); +}); + +function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/files/bar.js b/node_modules/module-deps/test/files/bar.js new file mode 100644 index 000000000..c57fa530a --- /dev/null +++ b/node_modules/module-deps/test/files/bar.js @@ -0,0 +1,3 @@ +module.exports = function (n) { + return n * 100; +}; diff --git a/node_modules/module-deps/test/files/extra.js b/node_modules/module-deps/test/files/extra.js new file mode 100644 index 000000000..3e842e734 --- /dev/null +++ b/node_modules/module-deps/test/files/extra.js @@ -0,0 +1 @@ +module.exports = 555 diff --git a/node_modules/module-deps/test/files/filterable.js b/node_modules/module-deps/test/files/filterable.js new file mode 100644 index 000000000..9374ed272 --- /dev/null +++ b/node_modules/module-deps/test/files/filterable.js @@ -0,0 +1,10 @@ + +module.exports = { + events: require('events'), + fs : require('fs'), + net : require('net'), + http : require('http'), + https : require('https'), + dgram : require('dgram'), + dns : require('dns') +} diff --git a/node_modules/module-deps/test/files/foo.js b/node_modules/module-deps/test/files/foo.js new file mode 100644 index 000000000..c62e63856 --- /dev/null +++ b/node_modules/module-deps/test/files/foo.js @@ -0,0 +1,5 @@ +var bar = require('./bar'); + +module.exports = function (n) { + return n * 111 + bar(n); +}; diff --git a/node_modules/module-deps/test/files/main.js b/node_modules/module-deps/test/files/main.js new file mode 100644 index 000000000..8c71d7997 --- /dev/null +++ b/node_modules/module-deps/test/files/main.js @@ -0,0 +1,2 @@ +var foo = require('./foo'); +console.log('main: ' + foo(5)); diff --git a/node_modules/module-deps/test/files/pkg_filter/one.js b/node_modules/module-deps/test/files/pkg_filter/one.js new file mode 100644 index 000000000..e8f7328d6 --- /dev/null +++ b/node_modules/module-deps/test/files/pkg_filter/one.js @@ -0,0 +1 @@ +module.exports = 1 diff --git a/node_modules/module-deps/test/files/pkg_filter/package.json b/node_modules/module-deps/test/files/pkg_filter/package.json new file mode 100644 index 000000000..0b4f872fc --- /dev/null +++ b/node_modules/module-deps/test/files/pkg_filter/package.json @@ -0,0 +1,3 @@ +{ + "main": "one.js" +} diff --git a/node_modules/module-deps/test/files/pkg_filter/test.js b/node_modules/module-deps/test/files/pkg_filter/test.js new file mode 100644 index 000000000..87697b9d3 --- /dev/null +++ b/node_modules/module-deps/test/files/pkg_filter/test.js @@ -0,0 +1 @@ +t.equal(require('./'), 2); diff --git a/node_modules/module-deps/test/files/pkg_filter/two.js b/node_modules/module-deps/test/files/pkg_filter/two.js new file mode 100644 index 000000000..4afe2eded --- /dev/null +++ b/node_modules/module-deps/test/files/pkg_filter/two.js @@ -0,0 +1 @@ +module.exports = 2 diff --git a/node_modules/module-deps/test/files/quotes/bar.js b/node_modules/module-deps/test/files/quotes/bar.js new file mode 100644 index 000000000..52b5cbb33 --- /dev/null +++ b/node_modules/module-deps/test/files/quotes/bar.js @@ -0,0 +1 @@ +module.exports = 'success'; diff --git a/node_modules/module-deps/test/files/quotes/baz.js b/node_modules/module-deps/test/files/quotes/baz.js new file mode 100644 index 000000000..52b5cbb33 --- /dev/null +++ b/node_modules/module-deps/test/files/quotes/baz.js @@ -0,0 +1 @@ +module.exports = 'success'; diff --git a/node_modules/module-deps/test/files/quotes/foo.js b/node_modules/module-deps/test/files/quotes/foo.js new file mode 100644 index 000000000..52b5cbb33 --- /dev/null +++ b/node_modules/module-deps/test/files/quotes/foo.js @@ -0,0 +1 @@ +module.exports = 'success'; diff --git a/node_modules/module-deps/test/files/quotes/main.js b/node_modules/module-deps/test/files/quotes/main.js new file mode 100644 index 000000000..8e459175d --- /dev/null +++ b/node_modules/module-deps/test/files/quotes/main.js @@ -0,0 +1,3 @@ +var foo = require('./foo'); +var bar = require("./bar"); +var baz = require(`./baz`); diff --git a/node_modules/module-deps/test/files/syntax_error.js b/node_modules/module-deps/test/files/syntax_error.js new file mode 100644 index 000000000..d2c024ec6 --- /dev/null +++ b/node_modules/module-deps/test/files/syntax_error.js @@ -0,0 +1,2 @@ +const a = require('a'); +const a = 0; diff --git a/node_modules/module-deps/test/files/tr_2dep_module/f.js b/node_modules/module-deps/test/files/tr_2dep_module/f.js new file mode 100644 index 000000000..39c9ea4be --- /dev/null +++ b/node_modules/module-deps/test/files/tr_2dep_module/f.js @@ -0,0 +1 @@ +module.exports = function (x) { return x + BBB } diff --git a/node_modules/module-deps/test/files/tr_2dep_module/main.js b/node_modules/module-deps/test/files/tr_2dep_module/main.js new file mode 100644 index 000000000..b7d22ab6f --- /dev/null +++ b/node_modules/module-deps/test/files/tr_2dep_module/main.js @@ -0,0 +1,7 @@ +var f = require('./f.js'); +var m = require('m'); +var g = require('g'); + +t.equal(m(f(AAA)), 777, 'transformation scope'); +t.equal(g(3), 333, 'sub-transformation applied'); +t.equal(typeof GGG, 'undefined', 'GGG leak'); diff --git a/node_modules/module-deps/test/files/tr_global/main.js b/node_modules/module-deps/test/files/tr_global/main.js new file mode 100644 index 000000000..493931839 --- /dev/null +++ b/node_modules/module-deps/test/files/tr_global/main.js @@ -0,0 +1 @@ +console.log(AAA + BBB + CCC + DDD + EEE + FFF); diff --git a/node_modules/module-deps/test/files/tr_global/package.json b/node_modules/module-deps/test/files/tr_global/package.json new file mode 100644 index 000000000..08b4f7136 --- /dev/null +++ b/node_modules/module-deps/test/files/tr_global/package.json @@ -0,0 +1,5 @@ +{ + "browserify": { + "transform": [ "tr-a", "tr-b" ] + } +} diff --git a/node_modules/module-deps/test/files/tr_module/f.js b/node_modules/module-deps/test/files/tr_module/f.js new file mode 100644 index 000000000..39c9ea4be --- /dev/null +++ b/node_modules/module-deps/test/files/tr_module/f.js @@ -0,0 +1 @@ +module.exports = function (x) { return x + BBB } diff --git a/node_modules/module-deps/test/files/tr_module/index.js b/node_modules/module-deps/test/files/tr_module/index.js new file mode 100644 index 000000000..b61f675e6 --- /dev/null +++ b/node_modules/module-deps/test/files/tr_module/index.js @@ -0,0 +1,8 @@ +var through = require('through2'); + +module.exports = function (file) { + return through(function (buf, enc, next) { + this.push(String(buf).replace(/XXX/g, '123')); + next(); + }); +}; diff --git a/node_modules/module-deps/test/files/tr_module/main.js b/node_modules/module-deps/test/files/tr_module/main.js new file mode 100644 index 000000000..19775fb66 --- /dev/null +++ b/node_modules/module-deps/test/files/tr_module/main.js @@ -0,0 +1,8 @@ +var f = require('./f.js'); +var m = require('m'); +var g = require('g'); + +t.equal(m(f(AAA)), 555, 'transformation scope'); +t.equal(g(3), 333, 'sub-transformation applied'); +t.equal(typeof GGG, 'undefined', 'GGG leak'); +t.equal(XXX, 123, 'XXX'); diff --git a/node_modules/module-deps/test/files/tr_module/package.json b/node_modules/module-deps/test/files/tr_module/package.json new file mode 100644 index 000000000..efba40639 --- /dev/null +++ b/node_modules/module-deps/test/files/tr_module/package.json @@ -0,0 +1,5 @@ +{ + "browserify": { + "transform": [ "./xxx.js" ] + } +} diff --git a/node_modules/module-deps/test/files/tr_module/xxx.js b/node_modules/module-deps/test/files/tr_module/xxx.js new file mode 100644 index 000000000..b61f675e6 --- /dev/null +++ b/node_modules/module-deps/test/files/tr_module/xxx.js @@ -0,0 +1,8 @@ +var through = require('through2'); + +module.exports = function (file) { + return through(function (buf, enc, next) { + this.push(String(buf).replace(/XXX/g, '123')); + next(); + }); +}; diff --git a/node_modules/module-deps/test/files/tr_no_entry/main.js b/node_modules/module-deps/test/files/tr_no_entry/main.js new file mode 100644 index 000000000..4f1d73371 --- /dev/null +++ b/node_modules/module-deps/test/files/tr_no_entry/main.js @@ -0,0 +1 @@ +console.log(AAA) diff --git a/node_modules/module-deps/test/files/tr_rel/package.json b/node_modules/module-deps/test/files/tr_rel/package.json new file mode 100644 index 000000000..efba40639 --- /dev/null +++ b/node_modules/module-deps/test/files/tr_rel/package.json @@ -0,0 +1,5 @@ +{ + "browserify": { + "transform": [ "./xxx.js" ] + } +} diff --git a/node_modules/module-deps/test/files/tr_rel/subdir/main.js b/node_modules/module-deps/test/files/tr_rel/subdir/main.js new file mode 100644 index 000000000..f03552207 --- /dev/null +++ b/node_modules/module-deps/test/files/tr_rel/subdir/main.js @@ -0,0 +1 @@ +console.log(XXX * 3) diff --git a/node_modules/module-deps/test/files/tr_rel/xxx.js b/node_modules/module-deps/test/files/tr_rel/xxx.js new file mode 100644 index 000000000..f8b47b11d --- /dev/null +++ b/node_modules/module-deps/test/files/tr_rel/xxx.js @@ -0,0 +1,8 @@ +var through = require('through2'); + +module.exports = function (file) { + return through(function (buf, enc, next) { + this.push(String(buf).replace(/XXX/g, '111')); + next(); + }); +}; diff --git a/node_modules/module-deps/test/files/tr_sh/f.js b/node_modules/module-deps/test/files/tr_sh/f.js new file mode 100644 index 000000000..39c9ea4be --- /dev/null +++ b/node_modules/module-deps/test/files/tr_sh/f.js @@ -0,0 +1 @@ +module.exports = function (x) { return x + BBB } diff --git a/node_modules/module-deps/test/files/tr_sh/main.js b/node_modules/module-deps/test/files/tr_sh/main.js new file mode 100644 index 000000000..084b20e04 --- /dev/null +++ b/node_modules/module-deps/test/files/tr_sh/main.js @@ -0,0 +1,7 @@ +var f = require('./f.js'); +var m = require('m'); +var g = require('g'); + +t.equal(m(f(AAA)), 555, 'transformation scope'); +t.equal(g(3), 333, 'sub-transformation applied'); +t.equal(typeof GGG, 'undefined', 'GGG leak'); diff --git a/node_modules/module-deps/test/files/tr_sh/tr_a.js b/node_modules/module-deps/test/files/tr_sh/tr_a.js new file mode 100644 index 000000000..397adcb6b --- /dev/null +++ b/node_modules/module-deps/test/files/tr_sh/tr_a.js @@ -0,0 +1,7 @@ +var through = require('through2'); +module.exports = function (file) { + return through(function (buf, enc, next) { + this.push(String(buf).replace(/AAA/g, '5')); + next(); + }); +}; diff --git a/node_modules/module-deps/test/files/tr_sh/tr_b.js b/node_modules/module-deps/test/files/tr_sh/tr_b.js new file mode 100644 index 000000000..6dfcb4efc --- /dev/null +++ b/node_modules/module-deps/test/files/tr_sh/tr_b.js @@ -0,0 +1,7 @@ +var through = require('through2'); +module.exports = function (file) { + return through(function (buf, enc, next) { + this.push(String(buf).replace(/BBB/g, '50')); + next(); + }); +}; diff --git a/node_modules/module-deps/test/files/tr_whole_package/f.js b/node_modules/module-deps/test/files/tr_whole_package/f.js new file mode 100644 index 000000000..39d983d5c --- /dev/null +++ b/node_modules/module-deps/test/files/tr_whole_package/f.js @@ -0,0 +1,3 @@ +var calc = require('algo').calc; + +module.exports = function (x) { return calc(x); } diff --git a/node_modules/module-deps/test/files/tr_whole_package/main.js b/node_modules/module-deps/test/files/tr_whole_package/main.js new file mode 100644 index 000000000..5b61c2414 --- /dev/null +++ b/node_modules/module-deps/test/files/tr_whole_package/main.js @@ -0,0 +1,3 @@ +var f = require('./f.js'); + +t.equal(f(14), 11, 'transformation scope'); diff --git a/node_modules/module-deps/test/files/transformdeps.js b/node_modules/module-deps/test/files/transformdeps.js new file mode 100644 index 000000000..0f1253062 --- /dev/null +++ b/node_modules/module-deps/test/files/transformdeps.js @@ -0,0 +1 @@ +// dependencies added by transform diff --git a/node_modules/module-deps/test/files/unicode/bar.js b/node_modules/module-deps/test/files/unicode/bar.js new file mode 100644 index 000000000..7ebb0ae44 --- /dev/null +++ b/node_modules/module-deps/test/files/unicode/bar.js @@ -0,0 +1,3 @@ +module.exports = function (ñ) { + return ñ * 100; +}; diff --git a/node_modules/module-deps/test/files/unicode/foo.js b/node_modules/module-deps/test/files/unicode/foo.js new file mode 100644 index 000000000..6541c71ab --- /dev/null +++ b/node_modules/module-deps/test/files/unicode/foo.js @@ -0,0 +1,5 @@ +var é = require('./bar'); + +module.exports = function (ñ) { + return ñ * 111 + é(n); +}; diff --git a/node_modules/module-deps/test/files/unicode/main.js b/node_modules/module-deps/test/files/unicode/main.js new file mode 100644 index 000000000..bb2095eb8 --- /dev/null +++ b/node_modules/module-deps/test/files/unicode/main.js @@ -0,0 +1,2 @@ +var π = require('./foo'); +console.log('main: ' + foo(5)); diff --git a/node_modules/module-deps/test/files/xyz.js b/node_modules/module-deps/test/files/xyz.js new file mode 100644 index 000000000..dff6877a8 --- /dev/null +++ b/node_modules/module-deps/test/files/xyz.js @@ -0,0 +1,2 @@ +var foo = require('./foo'); +console.log('xyz: ' + foo(6)); diff --git a/node_modules/module-deps/test/filter.js b/node_modules/module-deps/test/filter.js new file mode 100644 index 000000000..f66c12e24 --- /dev/null +++ b/node_modules/module-deps/test/filter.js @@ -0,0 +1,36 @@ +var test = require('tap').test; +var path = require('path') +var mdeps = require('../') + +var core = ['events', 'util', 'dns', 'dgram', 'http', 'https', 'net', 'fs'] + +var collect = [] + +var entry = path.join(__dirname, 'files', 'filterable.js') + +test('can filter core deps', function (t) { + var p = mdeps({ + filter: function (e) { + return !~core.indexOf(e) + } + }) + p.on('data', function (d) { + collect.push(d) + t.equal(d.id, entry) + t.deepEqual(d.deps, { + events: false, + fs: false, + net: false, + http: false, + https: false, + dgram: false, + dns: false + }) + t.equal(d.entry, true) + }); + p.on('end', function () { + t.equal(collect.length, 1) + t.end() + }); + p.end(entry); +}) diff --git a/node_modules/module-deps/test/ignore_missing.js b/node_modules/module-deps/test/ignore_missing.js new file mode 100644 index 000000000..a86845756 --- /dev/null +++ b/node_modules/module-deps/test/ignore_missing.js @@ -0,0 +1,60 @@ +var parser = require('../'); +var test = require('tap').test; +var fs = require('fs'); +var path = require('path'); + +var files = { + main: path.join(__dirname, '/ignore_missing/main.js'), + other: path.join(__dirname, '/ignore_missing/other.js') +}; + +var sources = Object.keys(files).reduce(function (acc, file) { + acc[file] = fs.readFileSync(files[file], 'utf8'); + return acc; +}, {}); + +test('ignoreMissing', function (t) { + t.plan(1); + var p = parser({ignoreMissing: true}); + p.end({file: files.main, entry: true}); + + var rows = []; + p.on('data', function (row) { rows.push(row) }); + p.on('end', function () { + t.same(rows.sort(cmp), [ + { + id: files.main, + file: files.main, + source: sources.main, + entry: true, + deps: { './other': files.other } + }, + { + id: files.other, + file: files.other, + source: sources.other, + deps: { 'missingModule': undefined } + } + ].sort(cmp)); + }); +}); + +test('ignoreMissing off', function (t) { + t.plan(1); + var p = parser(); + p.end({file: files.main, entry: true}); + + var rows = []; + p.on('data', function (row) { rows.push(row) }); + p.on('error', function (err) { + t.match( + String(err), + /Cannot find module 'missingModule'/ + ); + }); + p.on('end', function () { + t.fail('should have errored'); + }); +}); + +function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/ignore_missing/main.js b/node_modules/module-deps/test/ignore_missing/main.js new file mode 100644 index 000000000..709d2dba6 --- /dev/null +++ b/node_modules/module-deps/test/ignore_missing/main.js @@ -0,0 +1 @@ +require('./other'); diff --git a/node_modules/module-deps/test/ignore_missing/other.js b/node_modules/module-deps/test/ignore_missing/other.js new file mode 100644 index 000000000..d173b34d2 --- /dev/null +++ b/node_modules/module-deps/test/ignore_missing/other.js @@ -0,0 +1 @@ +require('missingModule'); diff --git a/node_modules/module-deps/test/ignore_missing_cache.js b/node_modules/module-deps/test/ignore_missing_cache.js new file mode 100644 index 000000000..715201518 --- /dev/null +++ b/node_modules/module-deps/test/ignore_missing_cache.js @@ -0,0 +1,52 @@ +var parser = require('../'); +var test = require('tap').test; +var fs = require('fs'); +var path = require('path'); + +var files = { + main: path.join(__dirname, '/ignore_missing/main.js'), + other: path.join(__dirname, '/ignore_missing/other.js') +}; + +var sources = Object.keys(files).reduce(function (acc, file) { + acc[file] = fs.readFileSync(files[file], 'utf8'); + return acc; +}, {}); + +var cache = {}; +cache[files.main] = { + source: sources.main, + deps: { './other': files.other } +}; +cache[files.other] = { + source: sources.other, + deps: { 'missingModule': undefined } +}; + +test('ignoreMissing with cache', function (t) { + t.plan(1); + var p = parser({ cache: cache, ignoreMissing: true }); + p.end({file: files.main, entry: true}); + + var rows = []; + p.on('data', function (row) { rows.push(row) }); + p.on('end', function () { + t.same(rows.sort(cmp), [ + { + id: files.main, + file: files.main, + source: sources.main, + entry: true, + deps: { './other': files.other } + }, + { + id: files.other, + file: files.other, + source: sources.other, + deps: { 'missingModule': undefined } + } + ].sort(cmp)); + }); +}); + +function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/invalid_pkg.js b/node_modules/module-deps/test/invalid_pkg.js new file mode 100644 index 000000000..943563286 --- /dev/null +++ b/node_modules/module-deps/test/invalid_pkg.js @@ -0,0 +1,16 @@ +var mdeps = require('../'); +var test = require('tap').test; +var path = require('path'); +var fs = require('fs'); + +test('invalid pkg', function (t) { + var d = mdeps(); + d.on('package', function (pkg_) { +// console.error({pkg_}); + }); + d.end(path.join(__dirname, '/invalid_pkg/file.js')); + d.on('data', function () {}); + d.on('end', function () { + t.end(); + }); +}); diff --git a/node_modules/module-deps/test/invalid_pkg/file.js b/node_modules/module-deps/test/invalid_pkg/file.js new file mode 100644 index 000000000..9d59a3b4c --- /dev/null +++ b/node_modules/module-deps/test/invalid_pkg/file.js @@ -0,0 +1 @@ +require('./') diff --git a/node_modules/module-deps/test/invalid_pkg/index.js b/node_modules/module-deps/test/invalid_pkg/index.js new file mode 100644 index 000000000..27aff7fdd --- /dev/null +++ b/node_modules/module-deps/test/invalid_pkg/index.js @@ -0,0 +1 @@ +T.pass() diff --git a/node_modules/module-deps/test/invalid_pkg/package.json b/node_modules/module-deps/test/invalid_pkg/package.json new file mode 100644 index 000000000..7deb8b173 --- /dev/null +++ b/node_modules/module-deps/test/invalid_pkg/package.json @@ -0,0 +1 @@ +"just a string" diff --git a/node_modules/module-deps/test/noparse.js b/node_modules/module-deps/test/noparse.js new file mode 100644 index 000000000..accbabae1 --- /dev/null +++ b/node_modules/module-deps/test/noparse.js @@ -0,0 +1,43 @@ +var parser = require('../'); +var test = require('tap').test; +var fs = require('fs'); +var path = require('path'); + +var files = { + main: path.join(__dirname, '/files/main.js'), + foo: path.join(__dirname, '/files/foo.js'), + bar: path.join(__dirname, '/files/bar.js') +}; + +var sources = Object.keys(files).reduce(function (acc, file) { + acc[file] = fs.readFileSync(files[file], 'utf8'); + return acc; +}, {}); + +test('noParse', function (t) { + t.plan(1); + var p = parser({ noParse: [ files.foo ] }); + p.end(files.main); + var rows = []; + + p.on('data', function (row) { rows.push(row) }); + p.on('end', function () { + t.deepEqual(rows.sort(cmp), [ + { + id: files.main, + file: files.main, + source: sources.main, + entry: true, + deps: { './foo': files.foo } + }, + { + id: files.foo, + file: files.foo, + source: sources.foo, + deps: {} + } + ].sort(cmp)); + }); +}); + +function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/noparse_row.js b/node_modules/module-deps/test/noparse_row.js new file mode 100644 index 000000000..e418da0f1 --- /dev/null +++ b/node_modules/module-deps/test/noparse_row.js @@ -0,0 +1,39 @@ +var parser = require('../'); +var test = require('tap').test; +var fs = require('fs'); +var concat = require('concat-stream'); +var path = require('path'); + +var files = { + main: path.join(__dirname, '/files/main.js'), + foo: path.join(__dirname, '/files/foo.js'), + bar: path.join(__dirname, '/files/bar.js') +}; + +var sources = Object.keys(files).reduce(function (acc, file) { + acc[file] = fs.readFileSync(files[file], 'utf8'); + return acc; +}, {}); + +test('noParse row', function (t) { + t.plan(1); + var p = parser(); + p.end({ file: files.main, noparse: true }); + var rows = []; + + p.on('data', function (row) { rows.push(row) }); + p.on('end', function () { + t.deepEqual(rows.sort(cmp), [ + { + id: files.main, + file: files.main, + source: sources.main, + entry: true, + noparse: true, + deps: {} + } + ].sort(cmp)); + }); +}); + +function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/pkg.js b/node_modules/module-deps/test/pkg.js new file mode 100644 index 000000000..6826d1c52 --- /dev/null +++ b/node_modules/module-deps/test/pkg.js @@ -0,0 +1,20 @@ +var mdeps = require('../'); +var test = require('tap').test; +var path = require('path'); +var fs = require('fs'); + +var dirname = path.join(__dirname, '/pkg'); + +test('pkg', function (t) { + t.plan(4); + + var d = mdeps(); + d.on('package', function (pkg_) { + var pkg = JSON.parse(fs.readFileSync(dirname + pkg_.dir + '/package.json')); + pkg.__dirname = path.join(dirname, pkg_.dir); + + t.deepEqual(pkg_, pkg); + }); + d.end(path.join(__dirname, '/pkg/main.js')); + d.resume(); +}); diff --git a/node_modules/module-deps/test/pkg/main.js b/node_modules/module-deps/test/pkg/main.js new file mode 100644 index 000000000..100fc1f73 --- /dev/null +++ b/node_modules/module-deps/test/pkg/main.js @@ -0,0 +1,2 @@ +require('pkga'); +require('pkgb'); diff --git a/node_modules/module-deps/test/pkg/package.json b/node_modules/module-deps/test/pkg/package.json new file mode 100644 index 000000000..e6c480b19 --- /dev/null +++ b/node_modules/module-deps/test/pkg/package.json @@ -0,0 +1,4 @@ +{ + "dir": "", + "main": "index.js" +} diff --git a/node_modules/module-deps/test/pkg_filter.js b/node_modules/module-deps/test/pkg_filter.js new file mode 100644 index 000000000..f383a6b49 --- /dev/null +++ b/node_modules/module-deps/test/pkg_filter.js @@ -0,0 +1,26 @@ +var mdeps = require('../'); +var test = require('tap').test; +var JSONStream = require('JSONStream'); +var packer = require('browser-pack'); +var concat = require('concat-stream'); +var path = require('path'); + +test('pkg filter', function (t) { + t.plan(3); + + var p = mdeps({ + packageFilter: function (pkg) { + t.equal(pkg.main, 'one.js'); + pkg.main = 'two.js' + return pkg; + } + }); + p.end(path.join(__dirname, '/files/pkg_filter/test.js')); + + var pack = packer(); + p.pipe(JSONStream.stringify()).pipe(pack); + + pack.pipe(concat(function (src) { + Function('t', src)(t); + })); +}); diff --git a/node_modules/module-deps/test/quotes.js b/node_modules/module-deps/test/quotes.js new file mode 100644 index 000000000..eb60e2f5e --- /dev/null +++ b/node_modules/module-deps/test/quotes.js @@ -0,0 +1,42 @@ +var parser = require('../'); +var test = require('tap').test; +var fs = require('fs'); +var path = require('path'); + +var files = { + main: path.join(__dirname, '/files/quotes/main.js'), + foo: path.join(__dirname, '/files/quotes/foo.js'), + bar: path.join(__dirname, '/files/quotes/bar.js'), + baz: path.join(__dirname, '/files/quotes/baz.js') +}; + +var sources = Object.keys(files).reduce(function (acc, file) { + acc[file] = fs.readFileSync(files[file], 'utf8'); + return acc; +}, {}); + +test('different quote styles', function (t) { + t.plan(1); + var p = parser(); + p.end(files.main); + var main = null + + p.on('data', function (row) { + if (row.id === files.main) { + main = row + } + }); + p.on('end', function () { + t.same(main, { + id: files.main, + file: files.main, + source: sources.main, + entry: true, + deps: { + './foo': files.foo, + './bar': files.bar, + './baz': files.baz + } + }); + }); +}); diff --git a/node_modules/module-deps/test/row_expose.js b/node_modules/module-deps/test/row_expose.js new file mode 100644 index 000000000..006e944cc --- /dev/null +++ b/node_modules/module-deps/test/row_expose.js @@ -0,0 +1,24 @@ +var parser = require('../'); +var test = require('tap').test; +var through = require('through2'); +var path = require('path'); + +// Test that p.options.expose is defined and that the row is properly exposed +// (resolved to the absolute pathname corresponding to the `file` value passed +// in the row, and set in opts.expose). +test('row is exposed', function (t) { + t.plan(1); + var common_path = path.join(__dirname, '/files/main'); + var opts = { expose: {} }; + var p = parser(opts); + // Note pathname without extension. + p.end({ file: common_path, expose: "whatever" }); + p.on('error', t.fail.bind(t)); + + p.pipe(through.obj()); + + p.on('end', function () { + // Note pathname with extension. + t.equal(opts.expose.whatever, common_path + '.js'); + }); +}); diff --git a/node_modules/module-deps/test/row_expose_name_is_file_transform.js b/node_modules/module-deps/test/row_expose_name_is_file_transform.js new file mode 100644 index 000000000..d93ec1f20 --- /dev/null +++ b/node_modules/module-deps/test/row_expose_name_is_file_transform.js @@ -0,0 +1,32 @@ +var parser = require('../'); +var test = require('tap').test; +var through = require('through2'); +var path = require('path'); + +// test that (non global) transforms are applied to an exposed module, where in the +// exposed name is identical to the file path. +test('row is exposed with a name equal to the path, and transformed', function (t) { + t.plan(2); + var exposed_path = path.join(__dirname, '/files/main.js'); + var found_exposed_path = false; + var opts = { + expose: {}, + transform: function(file) { + if (file === exposed_path) { + found_exposed_path = true; + } + return through(); + } + }; + + var p = parser(opts); + p.end({ file: exposed_path, expose: exposed_path }); + p.on('error', t.fail.bind(t)); + + p.pipe(through.obj()); + + p.on('end', function () { + t.equal(opts.expose[exposed_path], exposed_path); + t.ok(found_exposed_path); + }); +}); diff --git a/node_modules/module-deps/test/row_expose_transform.js b/node_modules/module-deps/test/row_expose_transform.js new file mode 100644 index 000000000..1b2d9eed7 --- /dev/null +++ b/node_modules/module-deps/test/row_expose_transform.js @@ -0,0 +1,31 @@ +var parser = require('../'); +var test = require('tap').test; +var through = require('through2'); +var path = require('path'); + +// test that (non global) transforms are applied to an exposed module +test('row is exposed and transformed', function (t) { + t.plan(2); + var exposed_path = path.join(__dirname, '/files/main.js'); + var found_exposed_path = false; + var opts = { + expose: {}, + transform: function(file) { + if (file === exposed_path) { + found_exposed_path = true; + } + return through(); + } + }; + + var p = parser(opts); + p.end({ file: exposed_path, expose: "whatever" }); + p.on('error', t.fail.bind(t)); + + p.pipe(through.obj()); + + p.on('end', function () { + t.equal(opts.expose.whatever, exposed_path); + t.ok(found_exposed_path); + }); +}); diff --git a/node_modules/module-deps/test/source.js b/node_modules/module-deps/test/source.js new file mode 100644 index 000000000..2c96e56e4 --- /dev/null +++ b/node_modules/module-deps/test/source.js @@ -0,0 +1,61 @@ +var parser = require('../'); +var test = require('tap').test; +var fs = require('fs'); +var path = require('path'); + +var files = { + main: path.join(__dirname, '/files/main.js'), + foo: path.join(__dirname, '/files/foo.js'), + bar: path.join(__dirname, '/files/bar.js'), + extra: path.join(__dirname, '/files/extra.js') +}; +var sources = { + foo: fs.readFileSync(files.foo, 'utf8'), + bar: fs.readFileSync(files.bar, 'utf8'), + extra: fs.readFileSync(files.extra, 'utf8'), + main: "console.log(require('./foo')(5)); require('./extra.js')" +}; + +test('source', function (t) { + t.plan(1); + var p = parser(); + p.end({ + file: files.main, + source: sources.main, + entry: true + }); + + var rows = []; + p.on('data', function (row) { rows.push(row) }); + p.on('end', function () { + t.same(rows.sort(cmp), [ + { + id: files.main, + file: files.main, + source: sources.main, + entry: true, + deps: { './foo': files.foo, './extra.js': files.extra } + }, + { + id: files.foo, + file: files.foo, + source: sources.foo, + deps: { './bar': files.bar } + }, + { + id: files.bar, + file: files.bar, + source: sources.bar, + deps: {} + }, + { + id: files.extra, + file: files.extra, + source: sources.extra, + deps: {} + }, + ].sort(cmp)); + }); +}); + +function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/syntax.js b/node_modules/module-deps/test/syntax.js new file mode 100644 index 000000000..43d2764a3 --- /dev/null +++ b/node_modules/module-deps/test/syntax.js @@ -0,0 +1,23 @@ +var mdeps = require('../'); +var test = require('tap').test; +var JSONStream = require('JSONStream'); +var packer = require('browser-pack'); +var through = require('through2'); +var path = require('path'); + +test('syntax error', function (t) { + t.plan(2); + var input = path.join(__dirname, '/files/syntax_error.js'); + // ensure transformDeps functionality does not break when parse errors happen + // see https://github.com/browserify/module-deps/commit/9fe46d5#commitcomment-28273437 + var p = mdeps({ + transform: function () { return through(); } + }); + p.on('file', function (file) { + t.equal(file, input, 'should emit a file event even if there was an error'); + }); + p.on('error', function (err) { + t.ok(err); + }); + p.end(input); +}); diff --git a/node_modules/module-deps/test/tr_2dep_module.js b/node_modules/module-deps/test/tr_2dep_module.js new file mode 100644 index 000000000..6ba8f8918 --- /dev/null +++ b/node_modules/module-deps/test/tr_2dep_module.js @@ -0,0 +1,23 @@ +var mdeps = require('../'); +var test = require('tap').test; +var JSONStream = require('JSONStream'); +var packer = require('browser-pack'); +var path = require('path'); + +test('transform', function (t) { + t.plan(3); + var p = mdeps({ + transform: [ 'insert-aaa', 'insert-bbb' ], + transformKey: [ 'browserify', 'transform' ] + }); + p.end(path.join(__dirname, '/files/tr_2dep_module/main.js')); + var pack = packer(); + + p.pipe(JSONStream.stringify()).pipe(pack); + + var src = ''; + pack.on('data', function (buf) { src += buf }); + pack.on('end', function () { + Function('t', src)(t); + }); +}); diff --git a/node_modules/module-deps/test/tr_deps.js b/node_modules/module-deps/test/tr_deps.js new file mode 100644 index 000000000..f00a854da --- /dev/null +++ b/node_modules/module-deps/test/tr_deps.js @@ -0,0 +1,60 @@ +var parser = require('../'); +var through = require('through2'); +var test = require('tap').test; +var fs = require('fs'); +var path = require('path'); + +var files = { + transformdeps: path.join(__dirname, '/files/transformdeps.js'), + foo: path.join(__dirname, '/files/foo.js'), + bar: path.join(__dirname, '/files/bar.js') +}; + +var sources = Object.keys(files).reduce(function (acc, file) { + acc[file] = fs.readFileSync(files[file], 'utf8'); + return acc; +}, {}); + +test('deps added by transforms', function (t) { + t.plan(1); + var p = parser(); + p.write({ transform: transform, options: {} }); + p.end({ file: files.transformdeps, entry: true }); + function transform (file) { + if (file === files.transformdeps) return through(function(chunk, enc, cb) { + cb(null, chunk); + }, function (cb) { + this.emit('dep', './foo'); + cb(); + }); + return through(); + } + + var rows = []; + p.on('data', function (row) { rows.push(row) }); + p.on('end', function () { + t.same(rows.sort(cmp), [ + { + id: files.transformdeps, + file: files.transformdeps, + source: sources.transformdeps, + entry: true, + deps: { './foo': files.foo } + }, + { + id: files.foo, + file: files.foo, + source: sources.foo, + deps: { './bar': files.bar } + }, + { + id: files.bar, + file: files.bar, + source: sources.bar, + deps: {} + } + ].sort(cmp)); + }); +}); + +function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/tr_err.js b/node_modules/module-deps/test/tr_err.js new file mode 100644 index 000000000..29322da01 --- /dev/null +++ b/node_modules/module-deps/test/tr_err.js @@ -0,0 +1,21 @@ +var mdeps = require('../'); +var test = require('tap').test; +var JSONStream = require('JSONStream'); +var packer = require('browser-pack'); +var through = require('through2'); +var path = require('path'); + +test('transform', function (t) { + t.plan(1); + var p = mdeps({ + transform: function (file) { + return through(function () { + this.emit('error', new Error('rawr')); + }); + } + }); + p.on('error', function (err) { + t.ok(/tr_sh[\\\/]main\.js/.test(err)); + }); + p.end(path.join(__dirname, '/files/tr_sh/main.js')); +}); diff --git a/node_modules/module-deps/test/tr_flags.js b/node_modules/module-deps/test/tr_flags.js new file mode 100644 index 000000000..c94fa6006 --- /dev/null +++ b/node_modules/module-deps/test/tr_flags.js @@ -0,0 +1,44 @@ +var through = require('through2'); +var mdeps = require('../'); +var test = require('tap').test; + +test('--debug passed to transforms', function (t) { + var empty = require.resolve('./tr_flags/empty.js'); + + t.plan(5); + + var p + [true, false].forEach(function(debug) { + p = mdeps({ + debug: debug, + transform: function (file, opts) { + t.equal(opts._flags.debug, debug, 'debug: ' + debug); + return through(); + } + }) + p.on('error', function (err) { return t.fail(err.message) }) + p.end(empty); + + p = mdeps({ debug: debug }) + p.write({ + transform: function (file, opts) { + t.equal(opts._flags.debug, debug, 'debug: ' + debug); + return through(); + }, + options: {} + }) + p.on('error', function (err) { return t.fail(err.message) }) + p.end(empty); + }); + + p = mdeps({ debug: true }) + p.write({ + transform: function (file, opts) { + t.equal(opts._flags, Infinity, 'transform arguments are preserved'); + return through(); + }, + options: { _flags: Infinity } + }) + p.on('error', function (err) { return t.fail(err.message) }) + p.end(empty); +}); diff --git a/node_modules/module-deps/test/tr_flags/empty.js b/node_modules/module-deps/test/tr_flags/empty.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/module-deps/test/tr_fn.js b/node_modules/module-deps/test/tr_fn.js new file mode 100644 index 000000000..127f4adc5 --- /dev/null +++ b/node_modules/module-deps/test/tr_fn.js @@ -0,0 +1,32 @@ +var mdeps = require('../'); +var test = require('tap').test; +var JSONStream = require('JSONStream'); +var packer = require('browser-pack'); +var through = require('through2'); +var path = require('path'); + +test('transform', function (t) { + t.plan(3); + var p = mdeps({ + transform: function (file) { + return through(function (buf, enc, next) { + this.push(String(buf) + .replace(/AAA/g, '5') + .replace(/BBB/g, '50') + ); + next(); + }); + }, + transformKey: [ 'browserify', 'transform' ] + }); + p.end(path.join(__dirname, '/files/tr_sh/main.js')); + var pack = packer(); + + p.pipe(JSONStream.stringify()).pipe(pack); + + var src = ''; + pack.on('data', function (buf) { src += buf }); + pack.on('end', function () { + Function('t', src)(t); + }); +}); diff --git a/node_modules/module-deps/test/tr_global.js b/node_modules/module-deps/test/tr_global.js new file mode 100644 index 000000000..2b4695e43 --- /dev/null +++ b/node_modules/module-deps/test/tr_global.js @@ -0,0 +1,29 @@ +var mdeps = require('../'); +var test = require('tap').test; +var JSONStream = require('JSONStream'); +var packer = require('browser-pack'); +var concat = require('concat-stream'); +var path = require('path'); + +test('global transforms', function (t) { + t.plan(1); + + var p = mdeps({ + transform: [ 'tr-c', 'tr-d' ], + globalTransform: [ + path.join(__dirname, '/files/tr_global/node_modules/tr-e'), + path.join(__dirname, '/files/tr_global/node_modules/tr-f') + ], + transformKey: [ 'browserify', 'transform' ] + }); + p.end(path.join(__dirname, '/files/tr_global/main.js')); + var pack = packer(); + + p.pipe(JSONStream.stringify()).pipe(pack).pipe(concat(function (src) { + Function(['console'], src)({ + log: function (msg) { + t.equal(msg, 111111); + } + }); + })); +}); diff --git a/node_modules/module-deps/test/tr_module.js b/node_modules/module-deps/test/tr_module.js new file mode 100644 index 000000000..f781746c3 --- /dev/null +++ b/node_modules/module-deps/test/tr_module.js @@ -0,0 +1,23 @@ +var mdeps = require('../'); +var test = require('tap').test; +var JSONStream = require('JSONStream'); +var packer = require('browser-pack'); +var path = require('path'); + +test('transform', function (t) { + t.plan(4); + var p = mdeps({ + transform: [ 'insert-aaa', 'insert-bbb' ], + transformKey: [ 'browserify', 'transform' ] + }); + p.end(path.join(__dirname, '/files/tr_module/main.js')); + var pack = packer(); + + p.pipe(JSONStream.stringify()).pipe(pack); + + var src = ''; + pack.on('data', function (buf) { src += buf }); + pack.on('end', function () { + Function('t', src)(t); + }); +}); diff --git a/node_modules/module-deps/test/tr_no_entry.js b/node_modules/module-deps/test/tr_no_entry.js new file mode 100644 index 000000000..e4428572a --- /dev/null +++ b/node_modules/module-deps/test/tr_no_entry.js @@ -0,0 +1,31 @@ +var mdeps = require('../'); +var test = require('tap').test; +var JSONStream = require('JSONStream'); +var packer = require('browser-pack'); +var through = require('through2'); +var concat = require('concat-stream'); +var path = require('path'); + +test('transform no entry', function (t) { + t.plan(1); + var p = mdeps({ + transform: [ function (file) { + return through(function (buf, enc, next) { + this.push(String(buf).replace(/AAA/g, '"WOW"')); + next(); + }); + } ] + }); + p.end({ + file: path.join(__dirname, '/files/tr_no_entry/main.js'), + id: 'xxx' + }); + + p.pipe(JSONStream.stringify()).pipe(packer()) + .pipe(concat(function (body) { + var con = { log: function (x) { t.equal(x, 'WOW') } }; + var src = 'require=' + body.toString('utf8') + ';require("xxx")'; + Function('console', src)(con); + })) + ; +}); diff --git a/node_modules/module-deps/test/tr_opts.js b/node_modules/module-deps/test/tr_opts.js new file mode 100644 index 000000000..6d2405ab2 --- /dev/null +++ b/node_modules/module-deps/test/tr_opts.js @@ -0,0 +1,21 @@ +var mdeps = require('../'); +var test = require('tap').test; +var JSONStream = require('JSONStream'); +var packer = require('browser-pack'); +var concat = require('concat-stream'); +var path = require('path'); + +test('transform options', function (t) { + t.plan(1); + var p = mdeps({ + transformKey: [ 'mdtr' ] + }); + p.end(path.join(__dirname, '/tr_opts/main.js')); + var pack = packer(); + + p.pipe(JSONStream.stringify()).pipe(pack).pipe(concat(function (src) { + Function('console', src.toString('utf8'))({ + log: function (msg) { t.equal(msg, 999) } + }); + })); +}); diff --git a/node_modules/module-deps/test/tr_opts/main.js b/node_modules/module-deps/test/tr_opts/main.js new file mode 100644 index 000000000..d1efe1ce5 --- /dev/null +++ b/node_modules/module-deps/test/tr_opts/main.js @@ -0,0 +1 @@ +console.log(FFF * GGG * HHH); diff --git a/node_modules/module-deps/test/tr_opts/package.json b/node_modules/module-deps/test/tr_opts/package.json new file mode 100644 index 000000000..51b32e977 --- /dev/null +++ b/node_modules/module-deps/test/tr_opts/package.json @@ -0,0 +1,7 @@ +{ + "mdtr": [ + [ "fff", { "x": 3 } ], + [ "ggg", { "z": 111 } ], + [ "hhh" ] + ] +} diff --git a/node_modules/module-deps/test/tr_rel.js b/node_modules/module-deps/test/tr_rel.js new file mode 100644 index 000000000..4e340c428 --- /dev/null +++ b/node_modules/module-deps/test/tr_rel.js @@ -0,0 +1,24 @@ +var mdeps = require('../'); +var test = require('tap').test; +var JSONStream = require('JSONStream'); +var packer = require('browser-pack'); +var path = require('path'); + +test('transform', function (t) { + t.plan(1); + var p = mdeps({ + transformKey: [ 'browserify', 'transform' ] + }); + p.end(path.join(__dirname, '/files/tr_rel/subdir/main.js')); + var pack = packer(); + + p.pipe(JSONStream.stringify()).pipe(pack); + + var src = ''; + pack.on('data', function (buf) { src += buf }); + pack.on('end', function () { + Function('console', src)({ log: function (msg) { + t.equal(msg, 333); + } }); + }); +}); diff --git a/node_modules/module-deps/test/tr_sh.js b/node_modules/module-deps/test/tr_sh.js new file mode 100644 index 000000000..a46f599d0 --- /dev/null +++ b/node_modules/module-deps/test/tr_sh.js @@ -0,0 +1,23 @@ +var mdeps = require('../'); +var test = require('tap').test; +var JSONStream = require('JSONStream'); +var packer = require('browser-pack'); +var path = require('path'); + +test('transform', function (t) { + t.plan(3); + var p = mdeps({ + transform: [ './tr_a.js', './tr_b.js' ], + transformKey: [ 'browserify', 'transform' ] + }); + p.end(path.join(__dirname, '/files/tr_sh/main.js')); + var pack = packer(); + + p.pipe(JSONStream.stringify()).pipe(pack); + + var src = ''; + pack.on('data', function (buf) { src += buf }); + pack.on('end', function () { + Function('t', src)(t); + }); +}); diff --git a/node_modules/module-deps/test/tr_whole_package.js b/node_modules/module-deps/test/tr_whole_package.js new file mode 100644 index 000000000..a2a31310e --- /dev/null +++ b/node_modules/module-deps/test/tr_whole_package.js @@ -0,0 +1,22 @@ +var mdeps = require('../'); +var test = require('tap').test; +var JSONStream = require('JSONStream'); +var packer = require('browser-pack'); +var path = require('path'); + +test('transform', function (t) { + t.plan(1); + var p = mdeps({ + transformKey: [ 'browserify', 'transform' ] + }); + p.end(path.join(__dirname, '/files/tr_whole_package/main.js')); + var pack = packer(); + + p.pipe(JSONStream.stringify()).pipe(pack); + + var src = ''; + pack.on('data', function (buf) { src += buf }); + pack.on('end', function () { + Function('t', src)(t); + }); +}); diff --git a/node_modules/module-deps/test/tr_write.js b/node_modules/module-deps/test/tr_write.js new file mode 100644 index 000000000..1d709d979 --- /dev/null +++ b/node_modules/module-deps/test/tr_write.js @@ -0,0 +1,32 @@ +var mdeps = require('../'); +var test = require('tap').test; +var JSONStream = require('JSONStream'); +var packer = require('browser-pack'); +var path = require('path'); +var concat = require('concat-stream'); + +test('transform write', function (t) { + t.plan(1); + var p = mdeps(); + + p.write({ + transform: 'insert-www', + options: {} + }); + p.write({ + file: path.join(__dirname, 'tr_write/main.js'), + id: path.join(__dirname, 'tr_write/main.js'), + entry: true + }); + p.end(); + + var pack = packer(); + p.pipe(JSONStream.stringify()).pipe(pack); + + pack.pipe(concat(function (buf) { + var src = buf.toString('utf8'); + Function('console', src)({ log: function (msg) { + t.equal(msg, 'WORLD WIDE WOW'); + } }); + })); +}); diff --git a/node_modules/module-deps/test/tr_write/main.js b/node_modules/module-deps/test/tr_write/main.js new file mode 100644 index 000000000..70f753251 --- /dev/null +++ b/node_modules/module-deps/test/tr_write/main.js @@ -0,0 +1 @@ +console.log(WWW.toUpperCase()); diff --git a/node_modules/module-deps/test/undef_file.js b/node_modules/module-deps/test/undef_file.js new file mode 100644 index 000000000..83f390523 --- /dev/null +++ b/node_modules/module-deps/test/undef_file.js @@ -0,0 +1,49 @@ +var parser = require('../'); +var test = require('tap').test; +var fs = require('fs'); +var path = require('path'); + +var files = { + main: path.join(__dirname, '/files/main.js'), + foo: path.join(__dirname, '/files/foo.js'), + bar: path.join(__dirname, '/files/bar.js') +}; + +var sources = Object.keys(files).reduce(function (acc, file) { + acc[file] = fs.readFileSync(files[file], 'utf8'); + return acc; +}, {}); + +test('undef file', function (t) { + t.plan(1); + var p = parser(); + p.end({ id: files.main, entry: true }); + + var rows = []; + p.on('data', function (row) { rows.push(row) }); + p.on('end', function () { + t.same(rows.sort(cmp), [ + { + id: files.main, + file: files.main, + source: sources.main, + entry: true, + deps: { './foo': files.foo } + }, + { + id: files.foo, + file: files.foo, + source: sources.foo, + deps: { './bar': files.bar } + }, + { + id: files.bar, + file: files.bar, + source: sources.bar, + deps: {} + } + ].sort(cmp)); + }); +}); + +function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/unicode.js b/node_modules/module-deps/test/unicode.js new file mode 100644 index 000000000..682f0f85b --- /dev/null +++ b/node_modules/module-deps/test/unicode.js @@ -0,0 +1,49 @@ +var parser = require('../'); +var test = require('tap').test; +var fs = require('fs'); +var path = require('path'); + +var files = { + main: path.join(__dirname, '/files/unicode/main.js'), + foo: path.join(__dirname, '/files/unicode/foo.js'), + bar: path.join(__dirname, '/files/unicode/bar.js') +}; + +var sources = Object.keys(files).reduce(function (acc, file) { + acc[file] = fs.readFileSync(files[file], 'utf8'); + return acc; +}, {}); + +test('unicode deps', function (t) { + t.plan(1); + var p = parser(); + p.end(files.main); + var rows = []; + + p.on('data', function (row) { rows.push(row) }); + p.on('end', function () { + t.same(rows.sort(cmp), [ + { + id: files.main, + file: files.main, + source: sources.main, + entry: true, + deps: { './foo': files.foo } + }, + { + id: files.foo, + file: files.foo, + source: sources.foo, + deps: { './bar': files.bar } + }, + { + id: files.bar, + file: files.bar, + source: sources.bar, + deps: {} + } + ].sort(cmp)); + }); +}); + +function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/ms/index.js b/node_modules/ms/index.js new file mode 100644 index 000000000..6a522b16b --- /dev/null +++ b/node_modules/ms/index.js @@ -0,0 +1,152 @@ +/** + * 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'; +} diff --git a/node_modules/ms/license.md b/node_modules/ms/license.md new file mode 100644 index 000000000..69b61253a --- /dev/null +++ b/node_modules/ms/license.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Zeit, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/ms/package.json b/node_modules/ms/package.json new file mode 100644 index 000000000..1588dd768 --- /dev/null +++ b/node_modules/ms/package.json @@ -0,0 +1,70 @@ +{ + "_from": "ms@2.0.0", + "_id": "ms@2.0.0", + "_inBundle": false, + "_integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "_location": "/ms", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "ms@2.0.0", + "name": "ms", + "escapedName": "ms", + "rawSpec": "2.0.0", + "saveSpec": null, + "fetchSpec": "2.0.0" + }, + "_requiredBy": [ + "/debug", + "/send" + ], + "_resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "_shasum": "5608aeadfc00be6c2901df5f9861788de0d597c8", + "_spec": "ms@2.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/debug", + "bugs": { + "url": "https://github.com/zeit/ms/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Tiny milisecond conversion utility", + "devDependencies": { + "eslint": "3.19.0", + "expect.js": "0.3.1", + "husky": "0.13.3", + "lint-staged": "3.4.1", + "mocha": "3.4.1" + }, + "eslintConfig": { + "extends": "eslint:recommended", + "env": { + "node": true, + "es6": true + } + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/zeit/ms#readme", + "license": "MIT", + "lint-staged": { + "*.js": [ + "npm run lint", + "prettier --single-quote --write", + "git add" + ] + }, + "main": "./index", + "name": "ms", + "repository": { + "type": "git", + "url": "git+https://github.com/zeit/ms.git" + }, + "scripts": { + "lint": "eslint lib/* bin/*", + "precommit": "lint-staged", + "test": "mocha tests.js" + }, + "version": "2.0.0" +} diff --git a/node_modules/ms/readme.md b/node_modules/ms/readme.md new file mode 100644 index 000000000..84a9974cc --- /dev/null +++ b/node_modules/ms/readme.md @@ -0,0 +1,51 @@ +# ms + +[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) +[![Slack Channel](http://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/) + +Use this package to easily convert various time formats to milliseconds. + +## Examples + +```js +ms('2 days') // 172800000 +ms('1d') // 86400000 +ms('10h') // 36000000 +ms('2.5 hrs') // 9000000 +ms('2h') // 7200000 +ms('1m') // 60000 +ms('5s') // 5000 +ms('1y') // 31557600000 +ms('100') // 100 +``` + +### Convert from milliseconds + +```js +ms(60000) // "1m" +ms(2 * 60000) // "2m" +ms(ms('10 hours')) // "10h" +``` + +### Time format written-out + +```js +ms(60000, { long: true }) // "1 minute" +ms(2 * 60000, { long: true }) // "2 minutes" +ms(ms('10 hours'), { long: true }) // "10 hours" +``` + +## Features + +- Works both in [node](https://nodejs.org) and in the browser. +- If a number is supplied to `ms`, a string with a unit is returned. +- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`). +- If you pass a string with a number and a valid unit, the number of equivalent ms is returned. + +## Caught a bug? + +1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device +2. Link the package to the global module directory: `npm link` +3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, node will now use your clone of ms! + +As always, you can run the tests using: `npm test` diff --git a/node_modules/nanomatch/CHANGELOG.md b/node_modules/nanomatch/CHANGELOG.md new file mode 100644 index 000000000..8c3aead9a --- /dev/null +++ b/node_modules/nanomatch/CHANGELOG.md @@ -0,0 +1,57 @@ +## History + +### key + +Changelog entries are classified using the following labels _(from [keep-a-changelog][]_): + +- `added`: for new features +- `changed`: for changes in existing functionality +- `deprecated`: for once-stable features removed in upcoming releases +- `removed`: for deprecated features removed in this release +- `fixed`: for any bug fixes +- `bumped`: updated dependencies, only minor or higher will be listed. + +### [1.1.0] - 2017-04-11 + +**Fixed** + +- adds support for unclosed quotes + +**Added** + +- adds support for `options.noglobstar` + +### [1.0.4] - 2017-04-06 + +Housekeeping updates. Adds documentation section about escaping, cleans up utils. + +### [1.0.3] - 2017-04-06 + +This release includes fixes for windows path edge cases and other improvements for stricter adherence to bash spec. + +**Fixed** + +- More windows path edge cases + +**Added** + +- Support for bash-like quoted strings for escaping sequences of characters, such as `foo/"**"/bar` where `**` should be matched literally and not evaluated as special characters. + +### [1.0.1] - 2016-12-12 + +**Added** + +- Support for windows path edge cases where backslashes are used in brackets or other unusual combinations. + +### [1.0.0] - 2016-12-12 + +Stable release. + +### [0.1.0] - 2016-10-08 + +First release. + +[Unreleased]: https://github.com/jonschlinkert/nanomatch/compare/0.1.0...HEAD +[0.2.0]: https://github.com/jonschlinkert/nanomatch/compare/0.1.0...0.2.0 + +[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog diff --git a/node_modules/nanomatch/LICENSE b/node_modules/nanomatch/LICENSE new file mode 100644 index 000000000..7c9987bc6 --- /dev/null +++ b/node_modules/nanomatch/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016-2018, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/nanomatch/README.md b/node_modules/nanomatch/README.md new file mode 100644 index 000000000..bdd35a94a --- /dev/null +++ b/node_modules/nanomatch/README.md @@ -0,0 +1,1148 @@ +# nanomatch [![NPM version](https://img.shields.io/npm/v/nanomatch.svg?style=flat)](https://www.npmjs.com/package/nanomatch) [![NPM monthly downloads](https://img.shields.io/npm/dm/nanomatch.svg?style=flat)](https://npmjs.org/package/nanomatch) [![NPM total downloads](https://img.shields.io/npm/dt/nanomatch.svg?style=flat)](https://npmjs.org/package/nanomatch) [![Linux Build Status](https://img.shields.io/travis/micromatch/nanomatch.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/nanomatch) [![Windows Build Status](https://img.shields.io/appveyor/ci/micromatch/nanomatch.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/micromatch/nanomatch) + +> Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces) + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Table of Contents + +
+Details + +- [Install](#install) +- [What is nanomatch?](#what-is-nanomatch) +- [Getting started](#getting-started) + * [Installing nanomatch](#installing-nanomatch) + * [Usage](#usage) +- [Documentation](#documentation) + * [Escaping](#escaping) +- [API](#api) +- [Options](#options) + * [options.basename](#optionsbasename) + * [options.bash](#optionsbash) + * [options.cache](#optionscache) + * [options.dot](#optionsdot) + * [options.failglob](#optionsfailglob) + * [options.ignore](#optionsignore) + * [options.matchBase](#optionsmatchbase) + * [options.nocase](#optionsnocase) + * [options.nodupes](#optionsnodupes) + * [options.noglobstar](#optionsnoglobstar) + * [options.nonegate](#optionsnonegate) + * [options.nonull](#optionsnonull) + * [options.nullglob](#optionsnullglob) + * [options.slash](#optionsslash) + * [options.star](#optionsstar) + * [options.snapdragon](#optionssnapdragon) + * [options.sourcemap](#optionssourcemap) + * [options.unescape](#optionsunescape) + * [options.unixify](#optionsunixify) +- [Features](#features) +- [Bash expansion libs](#bash-expansion-libs) +- [Benchmarks](#benchmarks) + * [Running benchmarks](#running-benchmarks) + * [Nanomatch vs. Minimatch vs. Multimatch](#nanomatch-vs-minimatch-vs-multimatch) +- [About](#about) + +
+ +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save nanomatch +``` + +
+Release history + +## History + +### key + +Changelog entries are classified using the following labels _(from [keep-a-changelog](https://github.com/olivierlacan/keep-a-changelog)_): + +* `added`: for new features +* `changed`: for changes in existing functionality +* `deprecated`: for once-stable features removed in upcoming releases +* `removed`: for deprecated features removed in this release +* `fixed`: for any bug fixes +* `bumped`: updated dependencies, only minor or higher will be listed. + +### [1.1.0](https://github.com/micromatch/nanomatch/compare/1.0.4...1.1.0) - 2017-04-11 + +**Fixed** + +* adds support for unclosed quotes + +**Added** + +* adds support for `options.noglobstar` + +### [1.0.4](https://github.com/micromatch/nanomatch/compare/1.0.3...1.0.4) - 2017-04-06 + +Housekeeping updates. Adds documentation section about escaping, cleans up utils. + +### [1.0.3](https://github.com/micromatch/nanomatch/compare/1.0.1...1.0.3) - 2017-04-06 + +This release includes fixes for windows path edge cases and other improvements for stricter adherence to bash spec. + +**Fixed** + +* More windows path edge cases + +**Added** + +* Support for bash-like quoted strings for escaping sequences of characters, such as `foo/"**"/bar` where `**` should be matched literally and not evaluated as special characters. + +### [1.0.1](https://github.com/micromatch/nanomatch/compare/1.0.0...1.0.1) - 2016-12-12 + +**Added** + +* Support for windows path edge cases where backslashes are used in brackets or other unusual combinations. + +### [1.0.0](https://github.com/micromatch/nanomatch/compare/0.1.0...1.0.0) - 2016-12-12 + +Stable release. + +### [0.1.0] - 2016-10-08 + +First release. + +
+ +## What is nanomatch? + +Nanomatch is a fast and accurate glob matcher with full support for standard Bash glob features, including the following "metacharacters": `*`, `**`, `?` and `[...]`. + +**Learn more** + +* [Getting started](#getting-started): learn how to install and begin using nanomatch +* [Features](#features): jump to info about supported patterns, and a glob matching reference +* [API documentation](#api): jump to available options and methods +* [Unit tests](test): visit unit tests. there is no better way to learn a code library than spending time the unit tests. Nanomatch has 36,000 unit tests - go become a glob matching ninja! + +
+How is this different? + +**Speed and accuracy** + +Nanomatch uses [snapdragon](https://github.com/jonschlinkert/snapdragon) for parsing and compiling globs, which results in: + +* Granular control over the entire conversion process in a way that is easy to understand, reason about, and customize. +* Faster matching, from a combination of optimized glob patterns and (optional) caching. +* Much greater accuracy than minimatch. In fact, nanomatch passes _all of the spec tests_ from bash, including some that bash still fails. However, since there is no real specification for globs, if you encounter a pattern that yields unexpected match results [after researching previous issues](../../issues), [please let us know](../../issues/new). + +**Basic globbing only** + +Nanomatch supports [basic globbing only](#features), which is limited to `*`, `**`, `?` and regex-like brackets. + +If you need support for the other [bash "expansion" types](#bash-expansion-libs) (in addition to the wildcard matching provided by nanomatch), consider using [micromatch](https://github.com/micromatch/micromatch) instead. _(micromatch >=3.0.0 uses the nanomatch parser and compiler for basic glob matching)_ + +
+ +## Getting started + +### Installing nanomatch + +**Install with [yarn](https://yarnpkg.com/)** + +```sh +$ yarn add nanomatch +``` + +**Install with [npm](https://npmjs.com)** + +```sh +$ npm install nanomatch +``` + +### Usage + +Add nanomatch to your project using node's `require()` system: + +```js +var nanomatch = require('nanomatch'); + +// the main export is a function that takes an array of strings to match +// and a string or array of patterns to use for matching +nanomatch(list, patterns[, options]); +``` + +**Params** + +* `list` **{String|Array}**: List of strings to perform matches against. This is often a list of file paths. +* `patterns` **{String|Array}**: One or more [glob paterns](#features) to use for matching. +* `options` **{Object}**: Any [supported options](#options) may be passed + +**Examples** + +```js +var nm = require('nanomatch'); +console.log(nm(['a', 'b/b', 'c/c/c'], '*')); +//=> ['a'] + +console.log(nm(['a', 'b/b', 'c/c/c'], '*/*')); +//=> ['b/b'] + +console.log(nm(['a', 'b/b', 'c/c/c'], '**')); +//=> ['a', 'b/b', 'c/c/c'] +``` + +See the [API documentation](#api) for available methods and [options](https://github.com/einaros/options.js). + +## Documentation + +### Escaping + +_Backslashes and quotes_ can be used to escape characters, forcing nanomatch to regard those characters as a literal characters. + +**Backslashes** + +Use backslashes to escape single characters. For example, the following pattern would match `foo/*/bar` exactly: + +```js +'foo/\*/bar' +``` + +The following pattern would match `foo/` followed by a literal `*`, followed by zero or more of any characters besides `/`, followed by `/bar`. + +```js +'foo/\**/bar' +``` + +**Quoted strings** + +Use single or double quotes to escape sequences of characters. For example, the following patterns would match `foo/**/bar` exactly: + +```js +'foo/"**"/bar' +'foo/\'**\'/bar' +"foo/'**'/bar" +``` + +**Matching literal quotes** + +If you need to match quotes literally, you can escape them as well. For example, the following will match `foo/"*"/bar`, `foo/"a"/bar`, `foo/"b"/bar`, or `foo/"c"/bar`: + +```js +'foo/\\"*\\"/bar' +``` + +And the following will match `foo/'*'/bar`, `foo/'a'/bar`, `foo/'b'/bar`, or `foo/'c'/bar`: + +```js +'foo/\\\'*\\\'/bar' +``` + +## API + +### [nanomatch](index.js#L40) + +The main function takes a list of strings and one or more glob patterns to use for matching. + +**Params** + +* `list` **{Array}**: A list of strings to match +* `patterns` **{String|Array}**: One or more glob patterns to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Array}**: Returns an array of matches + +**Example** + +```js +var nm = require('nanomatch'); +nm(list, patterns[, options]); + +console.log(nm(['a.js', 'a.txt'], ['*.js'])); +//=> [ 'a.js' ] +``` + +### [.match](index.js#L106) + +Similar to the main function, but `pattern` must be a string. + +**Params** + +* `list` **{Array}**: Array of strings to match +* `pattern` **{String}**: Glob pattern to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Array}**: Returns an array of matches + +**Example** + +```js +var nm = require('nanomatch'); +nm.match(list, pattern[, options]); + +console.log(nm.match(['a.a', 'a.aa', 'a.b', 'a.c'], '*.a')); +//=> ['a.a', 'a.aa'] +``` + +### [.isMatch](index.js#L167) + +Returns true if the specified `string` matches the given glob `pattern`. + +**Params** + +* `string` **{String}**: String to match +* `pattern` **{String}**: Glob pattern to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Boolean}**: Returns true if the string matches the glob pattern. + +**Example** + +```js +var nm = require('nanomatch'); +nm.isMatch(string, pattern[, options]); + +console.log(nm.isMatch('a.a', '*.a')); +//=> true +console.log(nm.isMatch('a.b', '*.a')); +//=> false +``` + +### [.some](index.js#L205) + +Returns true if some of the elements in the given `list` match any of the given glob `patterns`. + +**Params** + +* `list` **{String|Array}**: The string or array of strings to test. Returns as soon as the first match is found. +* `patterns` **{String|Array}**: One or more glob patterns to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Boolean}**: Returns true if any patterns match `str` + +**Example** + +```js +var nm = require('nanomatch'); +nm.some(list, patterns[, options]); + +console.log(nm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); +// true +console.log(nm.some(['foo.js'], ['*.js', '!foo.js'])); +// false +``` + +### [.every](index.js#L243) + +Returns true if every element in the given `list` matches at least one of the given glob `patterns`. + +**Params** + +* `list` **{String|Array}**: The string or array of strings to test. +* `patterns` **{String|Array}**: One or more glob patterns to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Boolean}**: Returns true if any patterns match `str` + +**Example** + +```js +var nm = require('nanomatch'); +nm.every(list, patterns[, options]); + +console.log(nm.every('foo.js', ['foo.js'])); +// true +console.log(nm.every(['foo.js', 'bar.js'], ['*.js'])); +// true +console.log(nm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); +// false +console.log(nm.every(['foo.js'], ['*.js', '!foo.js'])); +// false +``` + +### [.any](index.js#L277) + +Returns true if **any** of the given glob `patterns` match the specified `string`. + +**Params** + +* `str` **{String|Array}**: The string to test. +* `patterns` **{String|Array}**: One or more glob patterns to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Boolean}**: Returns true if any patterns match `str` + +**Example** + +```js +var nm = require('nanomatch'); +nm.any(string, patterns[, options]); + +console.log(nm.any('a.a', ['b.*', '*.a'])); +//=> true +console.log(nm.any('a.a', 'b.*')); +//=> false +``` + +### [.all](index.js#L325) + +Returns true if **all** of the given `patterns` match the specified string. + +**Params** + +* `str` **{String|Array}**: The string to test. +* `patterns` **{String|Array}**: One or more glob patterns to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Boolean}**: Returns true if any patterns match `str` + +**Example** + +```js +var nm = require('nanomatch'); +nm.all(string, patterns[, options]); + +console.log(nm.all('foo.js', ['foo.js'])); +// true + +console.log(nm.all('foo.js', ['*.js', '!foo.js'])); +// false + +console.log(nm.all('foo.js', ['*.js', 'foo.js'])); +// true + +console.log(nm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); +// true +``` + +### [.not](index.js#L359) + +Returns a list of strings that _**do not match any**_ of the given `patterns`. + +**Params** + +* `list` **{Array}**: Array of strings to match. +* `patterns` **{String|Array}**: One or more glob pattern to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Array}**: Returns an array of strings that **do not match** the given patterns. + +**Example** + +```js +var nm = require('nanomatch'); +nm.not(list, patterns[, options]); + +console.log(nm.not(['a.a', 'b.b', 'c.c'], '*.a')); +//=> ['b.b', 'c.c'] +``` + +### [.contains](index.js#L394) + +Returns true if the given `string` contains the given pattern. Similar to [.isMatch](#isMatch) but the pattern can match any part of the string. + +**Params** + +* `str` **{String}**: The string to match. +* `patterns` **{String|Array}**: Glob pattern to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Boolean}**: Returns true if the patter matches any part of `str`. + +**Example** + +```js +var nm = require('nanomatch'); +nm.contains(string, pattern[, options]); + +console.log(nm.contains('aa/bb/cc', '*b')); +//=> true +console.log(nm.contains('aa/bb/cc', '*d')); +//=> false +``` + +### [.matchKeys](index.js#L450) + +Filter the keys of the given object with the given `glob` pattern and `options`. Does not attempt to match nested keys. If you need this feature, use [glob-object](https://github.com/jonschlinkert/glob-object) instead. + +**Params** + +* `object` **{Object}**: The object with keys to filter. +* `patterns` **{String|Array}**: One or more glob patterns to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Object}**: Returns an object with only keys that match the given patterns. + +**Example** + +```js +var nm = require('nanomatch'); +nm.matchKeys(object, patterns[, options]); + +var obj = { aa: 'a', ab: 'b', ac: 'c' }; +console.log(nm.matchKeys(obj, '*b')); +//=> { ab: 'b' } +``` + +### [.matcher](index.js#L479) + +Returns a memoized matcher function from the given glob `pattern` and `options`. The returned function takes a string to match as its only argument and returns true if the string is a match. + +**Params** + +* `pattern` **{String}**: Glob pattern +* `options` **{Object}**: See available [options](#options) for changing how matches are performed. +* `returns` **{Function}**: Returns a matcher function. + +**Example** + +```js +var nm = require('nanomatch'); +nm.matcher(pattern[, options]); + +var isMatch = nm.matcher('*.!(*a)'); +console.log(isMatch('a.a')); +//=> false +console.log(isMatch('a.b')); +//=> true +``` + +### [.capture](index.js#L560) + +Returns an array of matches captured by `pattern` in `string, or`null` if the pattern did not match. + +**Params** + +* `pattern` **{String}**: Glob pattern to use for matching. +* `string` **{String}**: String to match +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Boolean}**: Returns an array of captures if the string matches the glob pattern, otherwise `null`. + +**Example** + +```js +var nm = require('nanomatch'); +nm.capture(pattern, string[, options]); + +console.log(nm.capture('test/*.js', 'test/foo.js')); +//=> ['foo'] +console.log(nm.capture('test/*.js', 'foo/bar.css')); +//=> null +``` + +### [.makeRe](index.js#L595) + +Create a regular expression from the given glob `pattern`. + +**Params** + +* `pattern` **{String}**: A glob pattern to convert to regex. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed. +* `returns` **{RegExp}**: Returns a regex created from the given pattern. + +**Example** + +```js +var nm = require('nanomatch'); +nm.makeRe(pattern[, options]); + +console.log(nm.makeRe('*.js')); +//=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ +``` + +### [.create](index.js#L658) + +Parses the given glob `pattern` and returns an object with the compiled `output` and optional source `map`. + +**Params** + +* `pattern` **{String}**: Glob pattern to parse and compile. +* `options` **{Object}**: Any [options](#options) to change how parsing and compiling is performed. +* `returns` **{Object}**: Returns an object with the parsed AST, compiled string and optional source map. + +**Example** + +```js +var nm = require('nanomatch'); +nm.create(pattern[, options]); + +console.log(nm.create('abc/*.js')); +// { options: { source: 'string', sourcemap: true }, +// state: {}, +// compilers: +// { ... }, +// output: '(\\.[\\\\\\/])?abc\\/(?!\\.)(?=.)[^\\/]*?\\.js', +// ast: +// { type: 'root', +// errors: [], +// nodes: +// [ ... ], +// dot: false, +// input: 'abc/*.js' }, +// parsingErrors: [], +// map: +// { version: 3, +// sources: [ 'string' ], +// names: [], +// mappings: 'AAAA,GAAG,EAAC,kBAAC,EAAC,EAAE', +// sourcesContent: [ 'abc/*.js' ] }, +// position: { line: 1, column: 28 }, +// content: {}, +// files: {}, +// idx: 6 } +``` + +### [.parse](index.js#L697) + +Parse the given `str` with the given `options`. + +**Params** + +* `str` **{String}** +* `options` **{Object}** +* `returns` **{Object}**: Returns an AST + +**Example** + +```js +var nm = require('nanomatch'); +nm.parse(pattern[, options]); + +var ast = nm.parse('a/{b,c}/d'); +console.log(ast); +// { type: 'root', +// errors: [], +// input: 'a/{b,c}/d', +// nodes: +// [ { type: 'bos', val: '' }, +// { type: 'text', val: 'a/' }, +// { type: 'brace', +// nodes: +// [ { type: 'brace.open', val: '{' }, +// { type: 'text', val: 'b,c' }, +// { type: 'brace.close', val: '}' } ] }, +// { type: 'text', val: '/d' }, +// { type: 'eos', val: '' } ] } +``` + +### [.compile](index.js#L745) + +Compile the given `ast` or string with the given `options`. + +**Params** + +* `ast` **{Object|String}** +* `options` **{Object}** +* `returns` **{Object}**: Returns an object that has an `output` property with the compiled string. + +**Example** + +```js +var nm = require('nanomatch'); +nm.compile(ast[, options]); + +var ast = nm.parse('a/{b,c}/d'); +console.log(nm.compile(ast)); +// { options: { source: 'string' }, +// state: {}, +// compilers: +// { eos: [Function], +// noop: [Function], +// bos: [Function], +// brace: [Function], +// 'brace.open': [Function], +// text: [Function], +// 'brace.close': [Function] }, +// output: [ 'a/(b|c)/d' ], +// ast: +// { ... }, +// parsingErrors: [] } +``` + +### [.clearCache](index.js#L768) + +Clear the regex cache. + +**Example** + +```js +nm.clearCache(); +``` + +## Options + +
+basename + +### options.basename + +Allow glob patterns without slashes to match a file path based on its basename. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `matchBase`. + +Type: `boolean` + +Default: `false` + +**Example** + +```js +nm(['a/b.js', 'a/c.md'], '*.js'); +//=> [] + +nm(['a/b.js', 'a/c.md'], '*.js', {matchBase: true}); +//=> ['a/b.js'] +``` + +
+ +
+bash + +### options.bash + +Enabled by default, this option enforces bash-like behavior with stars immediately following a bracket expression. Bash bracket expressions are similar to regex character classes, but unlike regex, a star following a bracket expression **does not repeat the bracketed characters**. Instead, the star is treated the same as an other star. + +Type: `boolean` + +Default: `true` + +**Example** + +```js +var files = ['abc', 'ajz']; +console.log(nm(files, '[a-c]*')); +//=> ['abc', 'ajz'] + +console.log(nm(files, '[a-c]*', {bash: false})); +``` + +
+ +
+cache + +### options.cache + +Disable regex and function memoization. + +Type: `boolean` + +Default: `undefined` + +
+ +
+dot + +### options.dot + +Match dotfiles. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `dot`. + +Type: `boolean` + +Default: `false` + +
+ +
+failglob + +### options.failglob + +Similar to the `--failglob` behavior in Bash, throws an error when no matches are found. + +Type: `boolean` + +Default: `undefined` + +
+ +
+ignore + +### options.ignore + +String or array of glob patterns to match files to ignore. + +Type: `String|Array` + +Default: `undefined` + +
+ +
+matchBase + +### options.matchBase + +Alias for [options.basename](#options-basename). + +
+ +
+nocase + +### options.nocase + +Use a case-insensitive regex for matching files. Same behavior as [minimatch](https://github.com/isaacs/minimatch). + +Type: `boolean` + +Default: `undefined` + +
+ +
+nodupes + +### options.nodupes + +Remove duplicate elements from the result array. + +Type: `boolean` + +Default: `true` (enabled by default) + +**Example** + +Example of using the `unescape` and `nodupes` options together: + +```js +nm.match(['a/b/c', 'a/b/c'], '**'); +//=> ['abc'] + +nm.match(['a/b/c', 'a/b/c'], '**', {nodupes: false}); +//=> ['a/b/c', 'a/b/c'] +``` + +
+ +
+nonegate + +### options.noglobstar + +Disable matching with globstars (`**`). + +Type: `boolean` + +Default: `undefined` + +```js +nm(['a/b', 'a/b/c', 'a/b/c/d'], 'a/**'); +//=> ['a/b', 'a/b/c', 'a/b/c/d'] + +nm(['a/b', 'a/b/c', 'a/b/c/d'], 'a/**', {noglobstar: true}); +//=> ['a/b'] +``` + +
+ +
+nonegate + +### options.nonegate + +Disallow negation (`!`) patterns, and treat leading `!` as a literal character to match. + +Type: `boolean` + +Default: `undefined` + +
+ +
+nonull + +### options.nonull + +Alias for [options.nullglob](#options-nullglob). + +
+ +
+nullglob + +### options.nullglob + +If `true`, when no matches are found the actual (arrayified) glob pattern is returned instead of an empty array. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `nonull`. + +Type: `boolean` + +Default: `undefined` + +
+ +
+slash + +### options.slash + +Customize the slash character(s) to use for matching. + +Type: `string|function` + +Default: `[/\\]` (forward slash and backslash) + +
+ +
+star + +### options.star + +Customize the star character(s) to use for matching. It's not recommended that you modify this unless you have advanced knowledge of the compiler and matching rules. + +Type: `string|function` + +Default: `[^/\\]*?` + +
+ +
+snapdragon + +### options.snapdragon + +Pass your own instance of [snapdragon](https://github.com/jonschlinkert/snapdragon) to customize parsers or compilers. + +Type: `object` + +Default: `undefined` + +
+ +
+snapdragon + +### options.sourcemap + +Generate a source map by enabling the `sourcemap` option with the `.parse`, `.compile`, or `.create` methods. + +**Examples** + +```js +var nm = require('nanomatch'); + +var res = nm.create('abc/*.js', {sourcemap: true}); +console.log(res.map); +// { version: 3, +// sources: [ 'string' ], +// names: [], +// mappings: 'AAAA,GAAG,EAAC,iBAAC,EAAC,EAAE', +// sourcesContent: [ 'abc/*.js' ] } + +var ast = nm.parse('abc/**/*.js'); +var res = nm.compile(ast, {sourcemap: true}); +console.log(res.map); +// { version: 3, +// sources: [ 'string' ], +// names: [], +// mappings: 'AAAA,GAAG,EAAC,2BAAE,EAAC,iBAAC,EAAC,EAAE', +// sourcesContent: [ 'abc/**/*.js' ] } +``` + +
+ +
+unescape + +### options.unescape + +Remove backslashes from returned matches. + +Type: `boolean` + +Default: `undefined` + +**Example** + +In this example we want to match a literal `*`: + +```js +nm.match(['abc', 'a\\*c'], 'a\\*c'); +//=> ['a\\*c'] + +nm.match(['abc', 'a\\*c'], 'a\\*c', {unescape: true}); +//=> ['a*c'] +``` + +
+ +
+unixify + +### options.unixify + +Convert path separators on returned files to posix/unix-style forward slashes. + +Type: `boolean` + +Default: `true` + +**Example** + +```js +nm.match(['a\\b\\c'], 'a/**'); +//=> ['a/b/c'] + +nm.match(['a\\b\\c'], {unixify: false}); +//=> ['a\\b\\c'] +``` + +
+ +## Features + +Nanomatch has full support for standard Bash glob features, including the following "metacharacters": `*`, `**`, `?` and `[...]`. + +Here are some examples of how they work: + +| **Pattern** | **Description** | +| --- | --- | +| `*` | Matches any string except for `/`, leading `.`, or `/.` inside a path | +| `**` | Matches any string including `/`, but not a leading `.` or `/.` inside a path. More than two stars (e.g. `***` is treated the same as one star, and `**` loses its special meaning | when it's not the only thing in a path segment, per Bash specifications) | +| `foo*` | Matches any string beginning with `foo` | +| `*bar*` | Matches any string containing `bar` (beginning, middle or end) | +| `*.min.js` | Matches any string ending with `.min.js` | +| `[abc]*.js` | Matches any string beginning with `a`, `b`, or `c` and ending with `.js` | +| `abc?` | Matches `abcd` or `abcz` but not `abcde` | + +The exceptions noted for `*` apply to all patterns that contain a `*`. + +**Not supported** + +The following extended-globbing features are not supported: + +* [brace expansion](https://github.com/jonschlinkert/braces) (e.g. `{a,b,c}`) +* [extglobs](https://github.com/jonschlinkert/extglob) (e.g. `@(a|!(c|d))`) +* [POSIX brackets](https://github.com/jonschlinkert/expand-brackets) (e.g. `[[:alpha:][:digit:]]`) + +If you need any of these features consider using [micromatch](https://github.com/micromatch/micromatch) instead. + +## Bash expansion libs + +Nanomatch is part of a suite of libraries aimed at bringing the power and expressiveness of [Bash's](https://www.gnu.org/software/bash/) matching and expansion capabilities to JavaScript, _and - as you can see by the [benchmarks](#benchmarks) - without sacrificing speed_. + +| **Related library** | **Matching Type** | **Example** | **Description** | +| --- | --- | --- | --- | +| `nanomatch` (you are here) | Wildcards | `*` | [Filename expansion](https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html#Filename-Expansion), also referred to as globbing and pathname expansion, allows the use of [wildcards](#features) for matching. | +| [expand-tilde](https://github.com/jonschlinkert/expand-tilde) | Tildes | `~` | [Tilde expansion](https://www.gnu.org/software/bash/manual/html_node/Tilde-Expansion.html#Tilde-Expansion) converts the leading tilde in a file path to the user home directory. | +| [braces](https://github.com/jonschlinkert/braces) | Braces | `{a,b,c}` | [Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html) | +| [expand-brackets](https://github.com/jonschlinkert/expand-brackets) | Brackets | `[[:alpha:]]` | [POSIX character classes](https://www.gnu.org/software/grep/manual/html_node/Character-Classes-and-Bracket-Expressions.html) (also referred to as POSIX brackets, or POSIX character classes) | +| [extglob](https://github.com/jonschlinkert/extglob) | Parens | `!(a\ | b)` | [Extglobs](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html#Pattern-Matching) | +| [micromatch](https://github.com/micromatch/micromatch) | All | all | Micromatch is built on top of the other libraries. | + +There are many resources available on the web if you want to dive deeper into how these features work in Bash. + +## Benchmarks + +### Running benchmarks + +Install dev dependencies: + +```bash +npm i -d && node benchmark +``` + +### Nanomatch vs. Minimatch vs. Multimatch + +```bash +# globstar-basic (182 bytes) + minimatch x 69,512 ops/sec ±1.92% (88 runs sampled) + multimatch x 63,376 ops/sec ±1.41% (89 runs sampled) + nanomatch x 432,451 ops/sec ±0.92% (88 runs sampled) + + fastest is nanomatch (by 651% avg) + +# large-list-globstar (485686 bytes) + minimatch x 34.02 ops/sec ±1.42% (59 runs sampled) + multimatch x 33.58 ops/sec ±1.97% (58 runs sampled) + nanomatch x 483 ops/sec ±1.06% (86 runs sampled) + + fastest is nanomatch (by 1429% avg) + +# long-list-globstar (194085 bytes) + minimatch x 383 ops/sec ±0.74% (90 runs sampled) + multimatch x 378 ops/sec ±0.59% (89 runs sampled) + nanomatch x 990 ops/sec ±1.14% (85 runs sampled) + + fastest is nanomatch (by 260% avg) + +# negation-basic (132 bytes) + minimatch x 242,145 ops/sec ±1.17% (89 runs sampled) + multimatch x 76,403 ops/sec ±0.78% (92 runs sampled) + nanomatch x 537,253 ops/sec ±1.44% (86 runs sampled) + + fastest is nanomatch (by 337% avg) + +# not-glob-basic (93 bytes) + minimatch x 252,402 ops/sec ±1.33% (89 runs sampled) + multimatch x 209,954 ops/sec ±1.30% (90 runs sampled) + nanomatch x 1,716,468 ops/sec ±1.13% (86 runs sampled) + + fastest is nanomatch (by 742% avg) + +# star-basic (93 bytes) + minimatch x 182,780 ops/sec ±1.41% (91 runs sampled) + multimatch x 153,210 ops/sec ±0.72% (89 runs sampled) + nanomatch x 599,621 ops/sec ±1.22% (90 runs sampled) + + fastest is nanomatch (by 357% avg) + +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards. + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [extglob](https://www.npmjs.com/package/extglob): Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob… [more](https://github.com/micromatch/extglob) | [homepage](https://github.com/micromatch/extglob "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.") +* [is-extglob](https://www.npmjs.com/package/is-extglob): Returns true if a string has an extglob. | [homepage](https://github.com/jonschlinkert/is-extglob "Returns true if a string has an extglob.") +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/micromatch/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 164 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [devongovett](https://github.com/devongovett) | + +### Author + +**Jon Schlinkert** + +* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on February 18, 2018._ \ No newline at end of file diff --git a/node_modules/nanomatch/index.js b/node_modules/nanomatch/index.js new file mode 100644 index 000000000..dddc6128e --- /dev/null +++ b/node_modules/nanomatch/index.js @@ -0,0 +1,838 @@ +'use strict'; + +/** + * Module dependencies + */ + +var util = require('util'); +var toRegex = require('to-regex'); +var extend = require('extend-shallow'); + +/** + * Local dependencies + */ + +var compilers = require('./lib/compilers'); +var parsers = require('./lib/parsers'); +var cache = require('./lib/cache'); +var utils = require('./lib/utils'); +var MAX_LENGTH = 1024 * 64; + +/** + * The main function takes a list of strings and one or more + * glob patterns to use for matching. + * + * ```js + * var nm = require('nanomatch'); + * nm(list, patterns[, options]); + * + * console.log(nm(['a.js', 'a.txt'], ['*.js'])); + * //=> [ 'a.js' ] + * ``` + * @param {Array} `list` A list of strings to match + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Array} Returns an array of matches + * @summary false + * @api public + */ + +function nanomatch(list, patterns, options) { + patterns = utils.arrayify(patterns); + list = utils.arrayify(list); + + var len = patterns.length; + if (list.length === 0 || len === 0) { + return []; + } + + if (len === 1) { + return nanomatch.match(list, patterns[0], options); + } + + var negated = false; + var omit = []; + var keep = []; + var idx = -1; + + while (++idx < len) { + var pattern = patterns[idx]; + + if (typeof pattern === 'string' && pattern.charCodeAt(0) === 33 /* ! */) { + omit.push.apply(omit, nanomatch.match(list, pattern.slice(1), options)); + negated = true; + } else { + keep.push.apply(keep, nanomatch.match(list, pattern, options)); + } + } + + // minimatch.match parity + if (negated && keep.length === 0) { + if (options && options.unixify === false) { + keep = list.slice(); + } else { + var unixify = utils.unixify(options); + for (var i = 0; i < list.length; i++) { + keep.push(unixify(list[i])); + } + } + } + + var matches = utils.diff(keep, omit); + if (!options || options.nodupes !== false) { + return utils.unique(matches); + } + + return matches; +} + +/** + * Similar to the main function, but `pattern` must be a string. + * + * ```js + * var nm = require('nanomatch'); + * nm.match(list, pattern[, options]); + * + * console.log(nm.match(['a.a', 'a.aa', 'a.b', 'a.c'], '*.a')); + * //=> ['a.a', 'a.aa'] + * ``` + * @param {Array} `list` Array of strings to match + * @param {String} `pattern` Glob pattern to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Array} Returns an array of matches + * @api public + */ + +nanomatch.match = function(list, pattern, options) { + if (Array.isArray(pattern)) { + throw new TypeError('expected pattern to be a string'); + } + + var unixify = utils.unixify(options); + var isMatch = memoize('match', pattern, options, nanomatch.matcher); + var matches = []; + + list = utils.arrayify(list); + var len = list.length; + var idx = -1; + + while (++idx < len) { + var ele = list[idx]; + if (ele === pattern || isMatch(ele)) { + matches.push(utils.value(ele, unixify, options)); + } + } + + // if no options were passed, uniquify results and return + if (typeof options === 'undefined') { + return utils.unique(matches); + } + + if (matches.length === 0) { + if (options.failglob === true) { + throw new Error('no matches found for "' + pattern + '"'); + } + if (options.nonull === true || options.nullglob === true) { + return [options.unescape ? utils.unescape(pattern) : pattern]; + } + } + + // if `opts.ignore` was defined, diff ignored list + if (options.ignore) { + matches = nanomatch.not(matches, options.ignore, options); + } + + return options.nodupes !== false ? utils.unique(matches) : matches; +}; + +/** + * Returns true if the specified `string` matches the given glob `pattern`. + * + * ```js + * var nm = require('nanomatch'); + * nm.isMatch(string, pattern[, options]); + * + * console.log(nm.isMatch('a.a', '*.a')); + * //=> true + * console.log(nm.isMatch('a.b', '*.a')); + * //=> false + * ``` + * @param {String} `string` String to match + * @param {String} `pattern` Glob pattern to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if the string matches the glob pattern. + * @api public + */ + +nanomatch.isMatch = function(str, pattern, options) { + if (typeof str !== 'string') { + throw new TypeError('expected a string: "' + util.inspect(str) + '"'); + } + + if (utils.isEmptyString(str) || utils.isEmptyString(pattern)) { + return false; + } + + var equals = utils.equalsPattern(options); + if (equals(str)) { + return true; + } + + var isMatch = memoize('isMatch', pattern, options, nanomatch.matcher); + return isMatch(str); +}; + +/** + * Returns true if some of the elements in the given `list` match any of the + * given glob `patterns`. + * + * ```js + * var nm = require('nanomatch'); + * nm.some(list, patterns[, options]); + * + * console.log(nm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); + * // true + * console.log(nm.some(['foo.js'], ['*.js', '!foo.js'])); + * // false + * ``` + * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +nanomatch.some = function(list, patterns, options) { + if (typeof list === 'string') { + list = [list]; + } + + for (var i = 0; i < list.length; i++) { + if (nanomatch(list[i], patterns, options).length === 1) { + return true; + } + } + + return false; +}; + +/** + * Returns true if every element in the given `list` matches + * at least one of the given glob `patterns`. + * + * ```js + * var nm = require('nanomatch'); + * nm.every(list, patterns[, options]); + * + * console.log(nm.every('foo.js', ['foo.js'])); + * // true + * console.log(nm.every(['foo.js', 'bar.js'], ['*.js'])); + * // true + * console.log(nm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); + * // false + * console.log(nm.every(['foo.js'], ['*.js', '!foo.js'])); + * // false + * ``` + * @param {String|Array} `list` The string or array of strings to test. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +nanomatch.every = function(list, patterns, options) { + if (typeof list === 'string') { + list = [list]; + } + + for (var i = 0; i < list.length; i++) { + if (nanomatch(list[i], patterns, options).length !== 1) { + return false; + } + } + + return true; +}; + +/** + * Returns true if **any** of the given glob `patterns` + * match the specified `string`. + * + * ```js + * var nm = require('nanomatch'); + * nm.any(string, patterns[, options]); + * + * console.log(nm.any('a.a', ['b.*', '*.a'])); + * //=> true + * console.log(nm.any('a.a', 'b.*')); + * //=> false + * ``` + * @param {String|Array} `str` The string to test. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +nanomatch.any = function(str, patterns, options) { + if (typeof str !== 'string') { + throw new TypeError('expected a string: "' + util.inspect(str) + '"'); + } + + if (utils.isEmptyString(str) || utils.isEmptyString(patterns)) { + return false; + } + + if (typeof patterns === 'string') { + patterns = [patterns]; + } + + for (var i = 0; i < patterns.length; i++) { + if (nanomatch.isMatch(str, patterns[i], options)) { + return true; + } + } + return false; +}; + +/** + * Returns true if **all** of the given `patterns` + * match the specified string. + * + * ```js + * var nm = require('nanomatch'); + * nm.all(string, patterns[, options]); + * + * console.log(nm.all('foo.js', ['foo.js'])); + * // true + * + * console.log(nm.all('foo.js', ['*.js', '!foo.js'])); + * // false + * + * console.log(nm.all('foo.js', ['*.js', 'foo.js'])); + * // true + * + * console.log(nm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); + * // true + * ``` + * @param {String|Array} `str` The string to test. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +nanomatch.all = function(str, patterns, options) { + if (typeof str !== 'string') { + throw new TypeError('expected a string: "' + util.inspect(str) + '"'); + } + + if (typeof patterns === 'string') { + patterns = [patterns]; + } + + for (var i = 0; i < patterns.length; i++) { + if (!nanomatch.isMatch(str, patterns[i], options)) { + return false; + } + } + return true; +}; + +/** + * Returns a list of strings that _**do not match any**_ of the given `patterns`. + * + * ```js + * var nm = require('nanomatch'); + * nm.not(list, patterns[, options]); + * + * console.log(nm.not(['a.a', 'b.b', 'c.c'], '*.a')); + * //=> ['b.b', 'c.c'] + * ``` + * @param {Array} `list` Array of strings to match. + * @param {String|Array} `patterns` One or more glob pattern to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Array} Returns an array of strings that **do not match** the given patterns. + * @api public + */ + +nanomatch.not = function(list, patterns, options) { + var opts = extend({}, options); + var ignore = opts.ignore; + delete opts.ignore; + + list = utils.arrayify(list); + + var matches = utils.diff(list, nanomatch(list, patterns, opts)); + if (ignore) { + matches = utils.diff(matches, nanomatch(list, ignore)); + } + + return opts.nodupes !== false ? utils.unique(matches) : matches; +}; + +/** + * Returns true if the given `string` contains the given pattern. Similar + * to [.isMatch](#isMatch) but the pattern can match any part of the string. + * + * ```js + * var nm = require('nanomatch'); + * nm.contains(string, pattern[, options]); + * + * console.log(nm.contains('aa/bb/cc', '*b')); + * //=> true + * console.log(nm.contains('aa/bb/cc', '*d')); + * //=> false + * ``` + * @param {String} `str` The string to match. + * @param {String|Array} `patterns` Glob pattern to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if the patter matches any part of `str`. + * @api public + */ + +nanomatch.contains = function(str, patterns, options) { + if (typeof str !== 'string') { + throw new TypeError('expected a string: "' + util.inspect(str) + '"'); + } + + if (typeof patterns === 'string') { + if (utils.isEmptyString(str) || utils.isEmptyString(patterns)) { + return false; + } + + var equals = utils.equalsPattern(patterns, options); + if (equals(str)) { + return true; + } + var contains = utils.containsPattern(patterns, options); + if (contains(str)) { + return true; + } + } + + var opts = extend({}, options, {contains: true}); + return nanomatch.any(str, patterns, opts); +}; + +/** + * Returns true if the given pattern and options should enable + * the `matchBase` option. + * @return {Boolean} + * @api private + */ + +nanomatch.matchBase = function(pattern, options) { + if (pattern && pattern.indexOf('/') !== -1 || !options) return false; + return options.basename === true || options.matchBase === true; +}; + +/** + * Filter the keys of the given object with the given `glob` pattern + * and `options`. Does not attempt to match nested keys. If you need this feature, + * use [glob-object][] instead. + * + * ```js + * var nm = require('nanomatch'); + * nm.matchKeys(object, patterns[, options]); + * + * var obj = { aa: 'a', ab: 'b', ac: 'c' }; + * console.log(nm.matchKeys(obj, '*b')); + * //=> { ab: 'b' } + * ``` + * @param {Object} `object` The object with keys to filter. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Object} Returns an object with only keys that match the given patterns. + * @api public + */ + +nanomatch.matchKeys = function(obj, patterns, options) { + if (!utils.isObject(obj)) { + throw new TypeError('expected the first argument to be an object'); + } + var keys = nanomatch(Object.keys(obj), patterns, options); + return utils.pick(obj, keys); +}; + +/** + * Returns a memoized matcher function from the given glob `pattern` and `options`. + * The returned function takes a string to match as its only argument and returns + * true if the string is a match. + * + * ```js + * var nm = require('nanomatch'); + * nm.matcher(pattern[, options]); + * + * var isMatch = nm.matcher('*.!(*a)'); + * console.log(isMatch('a.a')); + * //=> false + * console.log(isMatch('a.b')); + * //=> true + * ``` + * @param {String} `pattern` Glob pattern + * @param {Object} `options` See available [options](#options) for changing how matches are performed. + * @return {Function} Returns a matcher function. + * @api public + */ + +nanomatch.matcher = function matcher(pattern, options) { + if (utils.isEmptyString(pattern)) { + return function() { + return false; + }; + } + + if (Array.isArray(pattern)) { + return compose(pattern, options, matcher); + } + + // if pattern is a regex + if (pattern instanceof RegExp) { + return test(pattern); + } + + // if pattern is invalid + if (!utils.isString(pattern)) { + throw new TypeError('expected pattern to be an array, string or regex'); + } + + // if pattern is a non-glob string + if (!utils.hasSpecialChars(pattern)) { + if (options && options.nocase === true) { + pattern = pattern.toLowerCase(); + } + return utils.matchPath(pattern, options); + } + + // if pattern is a glob string + var re = nanomatch.makeRe(pattern, options); + + // if `options.matchBase` or `options.basename` is defined + if (nanomatch.matchBase(pattern, options)) { + return utils.matchBasename(re, options); + } + + function test(regex) { + var equals = utils.equalsPattern(options); + var unixify = utils.unixify(options); + + return function(str) { + if (equals(str)) { + return true; + } + + if (regex.test(unixify(str))) { + return true; + } + return false; + }; + } + + // create matcher function + var matcherFn = test(re); + // set result object from compiler on matcher function, + // as a non-enumerable property. useful for debugging + utils.define(matcherFn, 'result', re.result); + return matcherFn; +}; + +/** + * Returns an array of matches captured by `pattern` in `string, or + * `null` if the pattern did not match. + * + * ```js + * var nm = require('nanomatch'); + * nm.capture(pattern, string[, options]); + * + * console.log(nm.capture('test/*.js', 'test/foo.js')); + * //=> ['foo'] + * console.log(nm.capture('test/*.js', 'foo/bar.css')); + * //=> null + * ``` + * @param {String} `pattern` Glob pattern to use for matching. + * @param {String} `string` String to match + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns an array of captures if the string matches the glob pattern, otherwise `null`. + * @api public + */ + +nanomatch.capture = function(pattern, str, options) { + var re = nanomatch.makeRe(pattern, extend({capture: true}, options)); + var unixify = utils.unixify(options); + + function match() { + return function(string) { + var match = re.exec(unixify(string)); + if (!match) { + return null; + } + + return match.slice(1); + }; + } + + var capture = memoize('capture', pattern, options, match); + return capture(str); +}; + +/** + * Create a regular expression from the given glob `pattern`. + * + * ```js + * var nm = require('nanomatch'); + * nm.makeRe(pattern[, options]); + * + * console.log(nm.makeRe('*.js')); + * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ + * ``` + * @param {String} `pattern` A glob pattern to convert to regex. + * @param {Object} `options` See available [options](#options) for changing how matches are performed. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + +nanomatch.makeRe = function(pattern, options) { + if (pattern instanceof RegExp) { + return pattern; + } + + if (typeof pattern !== 'string') { + throw new TypeError('expected pattern to be a string'); + } + + if (pattern.length > MAX_LENGTH) { + throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters'); + } + + function makeRe() { + var opts = utils.extend({wrap: false}, options); + var result = nanomatch.create(pattern, opts); + var regex = toRegex(result.output, opts); + utils.define(regex, 'result', result); + return regex; + } + + return memoize('makeRe', pattern, options, makeRe); +}; + +/** + * Parses the given glob `pattern` and returns an object with the compiled `output` + * and optional source `map`. + * + * ```js + * var nm = require('nanomatch'); + * nm.create(pattern[, options]); + * + * console.log(nm.create('abc/*.js')); + * // { options: { source: 'string', sourcemap: true }, + * // state: {}, + * // compilers: + * // { ... }, + * // output: '(\\.[\\\\\\/])?abc\\/(?!\\.)(?=.)[^\\/]*?\\.js', + * // ast: + * // { type: 'root', + * // errors: [], + * // nodes: + * // [ ... ], + * // dot: false, + * // input: 'abc/*.js' }, + * // parsingErrors: [], + * // map: + * // { version: 3, + * // sources: [ 'string' ], + * // names: [], + * // mappings: 'AAAA,GAAG,EAAC,kBAAC,EAAC,EAAE', + * // sourcesContent: [ 'abc/*.js' ] }, + * // position: { line: 1, column: 28 }, + * // content: {}, + * // files: {}, + * // idx: 6 } + * ``` + * @param {String} `pattern` Glob pattern to parse and compile. + * @param {Object} `options` Any [options](#options) to change how parsing and compiling is performed. + * @return {Object} Returns an object with the parsed AST, compiled string and optional source map. + * @api public + */ + +nanomatch.create = function(pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('expected a string'); + } + function create() { + return nanomatch.compile(nanomatch.parse(pattern, options), options); + } + return memoize('create', pattern, options, create); +}; + +/** + * Parse the given `str` with the given `options`. + * + * ```js + * var nm = require('nanomatch'); + * nm.parse(pattern[, options]); + * + * var ast = nm.parse('a/{b,c}/d'); + * console.log(ast); + * // { type: 'root', + * // errors: [], + * // input: 'a/{b,c}/d', + * // nodes: + * // [ { type: 'bos', val: '' }, + * // { type: 'text', val: 'a/' }, + * // { type: 'brace', + * // nodes: + * // [ { type: 'brace.open', val: '{' }, + * // { type: 'text', val: 'b,c' }, + * // { type: 'brace.close', val: '}' } ] }, + * // { type: 'text', val: '/d' }, + * // { type: 'eos', val: '' } ] } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an AST + * @api public + */ + +nanomatch.parse = function(pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('expected a string'); + } + + function parse() { + var snapdragon = utils.instantiate(null, options); + parsers(snapdragon, options); + + var ast = snapdragon.parse(pattern, options); + utils.define(ast, 'snapdragon', snapdragon); + ast.input = pattern; + return ast; + } + + return memoize('parse', pattern, options, parse); +}; + +/** + * Compile the given `ast` or string with the given `options`. + * + * ```js + * var nm = require('nanomatch'); + * nm.compile(ast[, options]); + * + * var ast = nm.parse('a/{b,c}/d'); + * console.log(nm.compile(ast)); + * // { options: { source: 'string' }, + * // state: {}, + * // compilers: + * // { eos: [Function], + * // noop: [Function], + * // bos: [Function], + * // brace: [Function], + * // 'brace.open': [Function], + * // text: [Function], + * // 'brace.close': [Function] }, + * // output: [ 'a/(b|c)/d' ], + * // ast: + * // { ... }, + * // parsingErrors: [] } + * ``` + * @param {Object|String} `ast` + * @param {Object} `options` + * @return {Object} Returns an object that has an `output` property with the compiled string. + * @api public + */ + +nanomatch.compile = function(ast, options) { + if (typeof ast === 'string') { + ast = nanomatch.parse(ast, options); + } + + function compile() { + var snapdragon = utils.instantiate(ast, options); + compilers(snapdragon, options); + return snapdragon.compile(ast, options); + } + + return memoize('compile', ast.input, options, compile); +}; + +/** + * Clear the regex cache. + * + * ```js + * nm.clearCache(); + * ``` + * @api public + */ + +nanomatch.clearCache = function() { + nanomatch.cache.__data__ = {}; +}; + +/** + * Compose a matcher function with the given patterns. + * This allows matcher functions to be compiled once and + * called multiple times. + */ + +function compose(patterns, options, matcher) { + var matchers; + + return memoize('compose', String(patterns), options, function() { + return function(file) { + // delay composition until it's invoked the first time, + // after that it won't be called again + if (!matchers) { + matchers = []; + for (var i = 0; i < patterns.length; i++) { + matchers.push(matcher(patterns[i], options)); + } + } + + var len = matchers.length; + while (len--) { + if (matchers[len](file) === true) { + return true; + } + } + return false; + }; + }); +} + +/** + * Memoize a generated regex or function. A unique key is generated + * from the `type` (usually method name), the `pattern`, and + * user-defined options. + */ + +function memoize(type, pattern, options, fn) { + var key = utils.createKey(type + '=' + pattern, options); + + if (options && options.cache === false) { + return fn(pattern, options); + } + + if (cache.has(type, key)) { + return cache.get(type, key); + } + + var val = fn(pattern, options); + cache.set(type, key, val); + return val; +} + +/** + * Expose compiler, parser and cache on `nanomatch` + */ + +nanomatch.compilers = compilers; +nanomatch.parsers = parsers; +nanomatch.cache = cache; + +/** + * Expose `nanomatch` + * @type {Function} + */ + +module.exports = nanomatch; diff --git a/node_modules/nanomatch/lib/cache.js b/node_modules/nanomatch/lib/cache.js new file mode 100644 index 000000000..fffc4c17a --- /dev/null +++ b/node_modules/nanomatch/lib/cache.js @@ -0,0 +1 @@ +module.exports = new (require('fragment-cache'))(); diff --git a/node_modules/nanomatch/lib/compilers.js b/node_modules/nanomatch/lib/compilers.js new file mode 100644 index 000000000..d7a786e7a --- /dev/null +++ b/node_modules/nanomatch/lib/compilers.js @@ -0,0 +1,339 @@ +'use strict'; + +/** +* Nanomatch compilers +*/ + +module.exports = function(nanomatch, options) { + function slash() { + if (options && typeof options.slash === 'string') { + return options.slash; + } + if (options && typeof options.slash === 'function') { + return options.slash.call(nanomatch); + } + return '\\\\/'; + } + + function star() { + if (options && typeof options.star === 'string') { + return options.star; + } + if (options && typeof options.star === 'function') { + return options.star.call(nanomatch); + } + return '[^' + slash() + ']*?'; + } + + var ast = nanomatch.ast = nanomatch.parser.ast; + ast.state = nanomatch.parser.state; + nanomatch.compiler.state = ast.state; + nanomatch.compiler + + /** + * Negation / escaping + */ + + .set('not', function(node) { + var prev = this.prev(); + if (this.options.nonegate === true || prev.type !== 'bos') { + return this.emit('\\' + node.val, node); + } + return this.emit(node.val, node); + }) + .set('escape', function(node) { + if (this.options.unescape && /^[-\w_.]/.test(node.val)) { + return this.emit(node.val, node); + } + return this.emit('\\' + node.val, node); + }) + .set('quoted', function(node) { + return this.emit(node.val, node); + }) + + /** + * Regex + */ + + .set('dollar', function(node) { + if (node.parent.type === 'bracket') { + return this.emit(node.val, node); + } + return this.emit('\\' + node.val, node); + }) + + /** + * Dot: "." + */ + + .set('dot', function(node) { + if (node.dotfiles === true) this.dotfiles = true; + return this.emit('\\' + node.val, node); + }) + + /** + * Slashes: "/" and "\" + */ + + .set('backslash', function(node) { + return this.emit(node.val, node); + }) + .set('slash', function(node, nodes, i) { + var val = '[' + slash() + ']'; + var parent = node.parent; + var prev = this.prev(); + + // set "node.hasSlash" to true on all ancestor parens nodes + while (parent.type === 'paren' && !parent.hasSlash) { + parent.hasSlash = true; + parent = parent.parent; + } + + if (prev.addQmark) { + val += '?'; + } + + // word boundary + if (node.rest.slice(0, 2) === '\\b') { + return this.emit(val, node); + } + + // globstars + if (node.parsed === '**' || node.parsed === './**') { + this.output = '(?:' + this.output; + return this.emit(val + ')?', node); + } + + // negation + if (node.parsed === '!**' && this.options.nonegate !== true) { + return this.emit(val + '?\\b', node); + } + return this.emit(val, node); + }) + + /** + * Square brackets + */ + + .set('bracket', function(node) { + var close = node.close; + var open = !node.escaped ? '[' : '\\['; + var negated = node.negated; + var inner = node.inner; + var val = node.val; + + if (node.escaped === true) { + inner = inner.replace(/\\?(\W)/g, '\\$1'); + negated = ''; + } + + if (inner === ']-') { + inner = '\\]\\-'; + } + + if (negated && inner.indexOf('.') === -1) { + inner += '.'; + } + if (negated && inner.indexOf('/') === -1) { + inner += '/'; + } + + val = open + negated + inner + close; + return this.emit(val, node); + }) + + /** + * Square: "[.]" (only matches a single character in brackets) + */ + + .set('square', function(node) { + var val = (/^\W/.test(node.val) ? '\\' : '') + node.val; + return this.emit(val, node); + }) + + /** + * Question mark: "?" + */ + + .set('qmark', function(node) { + var prev = this.prev(); + // don't use "slash" variable so that we always avoid + // matching backslashes and slashes with a qmark + var val = '[^.\\\\/]'; + if (this.options.dot || (prev.type !== 'bos' && prev.type !== 'slash')) { + val = '[^\\\\/]'; + } + + if (node.parsed.slice(-1) === '(') { + var ch = node.rest.charAt(0); + if (ch === '!' || ch === '=' || ch === ':') { + return this.emit(node.val, node); + } + } + + if (node.val.length > 1) { + val += '{' + node.val.length + '}'; + } + return this.emit(val, node); + }) + + /** + * Plus + */ + + .set('plus', function(node) { + var prev = node.parsed.slice(-1); + if (prev === ']' || prev === ')') { + return this.emit(node.val, node); + } + if (!this.output || (/[?*+]/.test(ch) && node.parent.type !== 'bracket')) { + return this.emit('\\+', node); + } + var ch = this.output.slice(-1); + if (/\w/.test(ch) && !node.inside) { + return this.emit('+\\+?', node); + } + return this.emit('+', node); + }) + + /** + * globstar: '**' + */ + + .set('globstar', function(node, nodes, i) { + if (!this.output) { + this.state.leadingGlobstar = true; + } + + var prev = this.prev(); + var before = this.prev(2); + var next = this.next(); + var after = this.next(2); + var type = prev.type; + var val = node.val; + + if (prev.type === 'slash' && next.type === 'slash') { + if (before.type === 'text') { + this.output += '?'; + + if (after.type !== 'text') { + this.output += '\\b'; + } + } + } + + var parsed = node.parsed; + if (parsed.charAt(0) === '!') { + parsed = parsed.slice(1); + } + + var isInside = node.isInside.paren || node.isInside.brace; + if (parsed && type !== 'slash' && type !== 'bos' && !isInside) { + val = star(); + } else { + val = this.options.dot !== true + ? '(?:(?!(?:[' + slash() + ']|^)\\.).)*?' + : '(?:(?!(?:[' + slash() + ']|^)(?:\\.{1,2})($|[' + slash() + ']))(?!\\.{2}).)*?'; + } + + if ((type === 'slash' || type === 'bos') && this.options.dot !== true) { + val = '(?!\\.)' + val; + } + + if (prev.type === 'slash' && next.type === 'slash' && before.type !== 'text') { + if (after.type === 'text' || after.type === 'star') { + node.addQmark = true; + } + } + + if (this.options.capture) { + val = '(' + val + ')'; + } + + return this.emit(val, node); + }) + + /** + * Star: "*" + */ + + .set('star', function(node, nodes, i) { + var prior = nodes[i - 2] || {}; + var prev = this.prev(); + var next = this.next(); + var type = prev.type; + + function isStart(n) { + return n.type === 'bos' || n.type === 'slash'; + } + + if (this.output === '' && this.options.contains !== true) { + this.output = '(?![' + slash() + '])'; + } + + if (type === 'bracket' && this.options.bash === false) { + var str = next && next.type === 'bracket' ? star() : '*?'; + if (!prev.nodes || prev.nodes[1].type !== 'posix') { + return this.emit(str, node); + } + } + + var prefix = !this.dotfiles && type !== 'text' && type !== 'escape' + ? (this.options.dot ? '(?!(?:^|[' + slash() + '])\\.{1,2}(?:$|[' + slash() + ']))' : '(?!\\.)') + : ''; + + if (isStart(prev) || (isStart(prior) && type === 'not')) { + if (prefix !== '(?!\\.)') { + prefix += '(?!(\\.{2}|\\.[' + slash() + ']))(?=.)'; + } else { + prefix += '(?=.)'; + } + } else if (prefix === '(?!\\.)') { + prefix = ''; + } + + if (prev.type === 'not' && prior.type === 'bos' && this.options.dot === true) { + this.output = '(?!\\.)' + this.output; + } + + var output = prefix + star(); + if (this.options.capture) { + output = '(' + output + ')'; + } + + return this.emit(output, node); + }) + + /** + * Text + */ + + .set('text', function(node) { + return this.emit(node.val, node); + }) + + /** + * End-of-string + */ + + .set('eos', function(node) { + var prev = this.prev(); + var val = node.val; + + this.output = '(?:\\.[' + slash() + '](?=.))?' + this.output; + if (this.state.metachar && prev.type !== 'qmark' && prev.type !== 'slash') { + val += (this.options.contains ? '[' + slash() + ']?' : '(?:[' + slash() + ']|$)'); + } + + return this.emit(val, node); + }); + + /** + * Allow custom compilers to be passed on options + */ + + if (options && typeof options.compilers === 'function') { + options.compilers(nanomatch.compiler); + } +}; + diff --git a/node_modules/nanomatch/lib/parsers.js b/node_modules/nanomatch/lib/parsers.js new file mode 100644 index 000000000..f87df8f34 --- /dev/null +++ b/node_modules/nanomatch/lib/parsers.js @@ -0,0 +1,386 @@ +'use strict'; + +var regexNot = require('regex-not'); +var toRegex = require('to-regex'); + +/** + * Characters to use in negation regex (we want to "not" match + * characters that are matched by other parsers) + */ + +var cached; +var NOT_REGEX = '[\\[!*+?$^"\'.\\\\/]+'; +var not = createTextRegex(NOT_REGEX); + +/** + * Nanomatch parsers + */ + +module.exports = function(nanomatch, options) { + var parser = nanomatch.parser; + var opts = parser.options; + + parser.state = { + slashes: 0, + paths: [] + }; + + parser.ast.state = parser.state; + parser + + /** + * Beginning-of-string + */ + + .capture('prefix', function() { + if (this.parsed) return; + var m = this.match(/^\.[\\/]/); + if (!m) return; + this.state.strictOpen = !!this.options.strictOpen; + this.state.addPrefix = true; + }) + + /** + * Escape: "\\." + */ + + .capture('escape', function() { + if (this.isInside('bracket')) return; + var pos = this.position(); + var m = this.match(/^(?:\\(.)|([$^]))/); + if (!m) return; + + return pos({ + type: 'escape', + val: m[2] || m[1] + }); + }) + + /** + * Quoted strings + */ + + .capture('quoted', function() { + var pos = this.position(); + var m = this.match(/^["']/); + if (!m) return; + + var quote = m[0]; + if (this.input.indexOf(quote) === -1) { + return pos({ + type: 'escape', + val: quote + }); + } + + var tok = advanceTo(this.input, quote); + this.consume(tok.len); + + return pos({ + type: 'quoted', + val: tok.esc + }); + }) + + /** + * Negations: "!" + */ + + .capture('not', function() { + var parsed = this.parsed; + var pos = this.position(); + var m = this.match(this.notRegex || /^!+/); + if (!m) return; + var val = m[0]; + + var isNegated = (val.length % 2) === 1; + if (parsed === '' && !isNegated) { + val = ''; + } + + // if nothing has been parsed, we know `!` is at the start, + // so we need to wrap the result in a negation regex + if (parsed === '' && isNegated && this.options.nonegate !== true) { + this.bos.val = '(?!^(?:'; + this.append = ')$).*'; + val = ''; + } + return pos({ + type: 'not', + val: val + }); + }) + + /** + * Dot: "." + */ + + .capture('dot', function() { + var parsed = this.parsed; + var pos = this.position(); + var m = this.match(/^\.+/); + if (!m) return; + + var val = m[0]; + this.state.dot = val === '.' && (parsed === '' || parsed.slice(-1) === '/'); + + return pos({ + type: 'dot', + dotfiles: this.state.dot, + val: val + }); + }) + + /** + * Plus: "+" + */ + + .capture('plus', /^\+(?!\()/) + + /** + * Question mark: "?" + */ + + .capture('qmark', function() { + var parsed = this.parsed; + var pos = this.position(); + var m = this.match(/^\?+(?!\()/); + if (!m) return; + + this.state.metachar = true; + this.state.qmark = true; + + return pos({ + type: 'qmark', + parsed: parsed, + val: m[0] + }); + }) + + /** + * Globstar: "**" + */ + + .capture('globstar', function() { + var parsed = this.parsed; + var pos = this.position(); + var m = this.match(/^\*{2}(?![*(])(?=[,)/]|$)/); + if (!m) return; + + var type = opts.noglobstar !== true ? 'globstar' : 'star'; + var node = pos({type: type, parsed: parsed}); + this.state.metachar = true; + + while (this.input.slice(0, 4) === '/**/') { + this.input = this.input.slice(3); + } + + node.isInside = { + brace: this.isInside('brace'), + paren: this.isInside('paren') + }; + + if (type === 'globstar') { + this.state.globstar = true; + node.val = '**'; + + } else { + this.state.star = true; + node.val = '*'; + } + + return node; + }) + + /** + * Star: "*" + */ + + .capture('star', function() { + var pos = this.position(); + var starRe = /^(?:\*(?![*(])|[*]{3,}(?!\()|[*]{2}(?![(/]|$)|\*(?=\*\())/; + var m = this.match(starRe); + if (!m) return; + + this.state.metachar = true; + this.state.star = true; + return pos({ + type: 'star', + val: m[0] + }); + }) + + /** + * Slash: "/" + */ + + .capture('slash', function() { + var pos = this.position(); + var m = this.match(/^\//); + if (!m) return; + + this.state.slashes++; + return pos({ + type: 'slash', + val: m[0] + }); + }) + + /** + * Backslash: "\\" + */ + + .capture('backslash', function() { + var pos = this.position(); + var m = this.match(/^\\(?![*+?(){}[\]'"])/); + if (!m) return; + + var val = m[0]; + + if (this.isInside('bracket')) { + val = '\\'; + } else if (val.length > 1) { + val = '\\\\'; + } + + return pos({ + type: 'backslash', + val: val + }); + }) + + /** + * Square: "[.]" + */ + + .capture('square', function() { + if (this.isInside('bracket')) return; + var pos = this.position(); + var m = this.match(/^\[([^!^\\])\]/); + if (!m) return; + + return pos({ + type: 'square', + val: m[1] + }); + }) + + /** + * Brackets: "[...]" (basic, this can be overridden by other parsers) + */ + + .capture('bracket', function() { + var pos = this.position(); + var m = this.match(/^(?:\[([!^]?)([^\]]+|\]-)(\]|[^*+?]+)|\[)/); + if (!m) return; + + var val = m[0]; + var negated = m[1] ? '^' : ''; + var inner = (m[2] || '').replace(/\\\\+/, '\\\\'); + var close = m[3] || ''; + + if (m[2] && inner.length < m[2].length) { + val = val.replace(/\\\\+/, '\\\\'); + } + + var esc = this.input.slice(0, 2); + if (inner === '' && esc === '\\]') { + inner += esc; + this.consume(2); + + var str = this.input; + var idx = -1; + var ch; + + while ((ch = str[++idx])) { + this.consume(1); + if (ch === ']') { + close = ch; + break; + } + inner += ch; + } + } + + return pos({ + type: 'bracket', + val: val, + escaped: close !== ']', + negated: negated, + inner: inner, + close: close + }); + }) + + /** + * Text + */ + + .capture('text', function() { + if (this.isInside('bracket')) return; + var pos = this.position(); + var m = this.match(not); + if (!m || !m[0]) return; + + return pos({ + type: 'text', + val: m[0] + }); + }); + + /** + * Allow custom parsers to be passed on options + */ + + if (options && typeof options.parsers === 'function') { + options.parsers(nanomatch.parser); + } +}; + +/** + * Advance to the next non-escaped character + */ + +function advanceTo(input, endChar) { + var ch = input.charAt(0); + var tok = { len: 1, val: '', esc: '' }; + var idx = 0; + + function advance() { + if (ch !== '\\') { + tok.esc += '\\' + ch; + tok.val += ch; + } + + ch = input.charAt(++idx); + tok.len++; + + if (ch === '\\') { + advance(); + advance(); + } + } + + while (ch && ch !== endChar) { + advance(); + } + return tok; +} + +/** + * Create text regex + */ + +function createTextRegex(pattern) { + if (cached) return cached; + var opts = {contains: true, strictClose: false}; + var not = regexNot.create(pattern, opts); + var re = toRegex('^(?:[*]\\((?=.)|' + not + ')', opts); + return (cached = re); +} + +/** + * Expose negation string + */ + +module.exports.not = NOT_REGEX; diff --git a/node_modules/nanomatch/lib/utils.js b/node_modules/nanomatch/lib/utils.js new file mode 100644 index 000000000..0cf1501d2 --- /dev/null +++ b/node_modules/nanomatch/lib/utils.js @@ -0,0 +1,379 @@ +'use strict'; + +var utils = module.exports; +var path = require('path'); + +/** + * Module dependencies + */ + +var isWindows = require('is-windows')(); +var Snapdragon = require('snapdragon'); +utils.define = require('define-property'); +utils.diff = require('arr-diff'); +utils.extend = require('extend-shallow'); +utils.pick = require('object.pick'); +utils.typeOf = require('kind-of'); +utils.unique = require('array-unique'); + +/** + * Returns true if the given value is effectively an empty string + */ + +utils.isEmptyString = function(val) { + return String(val) === '' || String(val) === './'; +}; + +/** + * Returns true if the platform is windows, or `path.sep` is `\\`. + * This is defined as a function to allow `path.sep` to be set in unit tests, + * or by the user, if there is a reason to do so. + * @return {Boolean} + */ + +utils.isWindows = function() { + return path.sep === '\\' || isWindows === true; +}; + +/** + * Return the last element from an array + */ + +utils.last = function(arr, n) { + return arr[arr.length - (n || 1)]; +}; + +/** + * Get the `Snapdragon` instance to use + */ + +utils.instantiate = function(ast, options) { + var snapdragon; + // if an instance was created by `.parse`, use that instance + if (utils.typeOf(ast) === 'object' && ast.snapdragon) { + snapdragon = ast.snapdragon; + // if the user supplies an instance on options, use that instance + } else if (utils.typeOf(options) === 'object' && options.snapdragon) { + snapdragon = options.snapdragon; + // create a new instance + } else { + snapdragon = new Snapdragon(options); + } + + utils.define(snapdragon, 'parse', function(str, options) { + var parsed = Snapdragon.prototype.parse.call(this, str, options); + parsed.input = str; + + // escape unmatched brace/bracket/parens + var last = this.parser.stack.pop(); + if (last && this.options.strictErrors !== true) { + var open = last.nodes[0]; + var inner = last.nodes[1]; + if (last.type === 'bracket') { + if (inner.val.charAt(0) === '[') { + inner.val = '\\' + inner.val; + } + + } else { + open.val = '\\' + open.val; + var sibling = open.parent.nodes[1]; + if (sibling.type === 'star') { + sibling.loose = true; + } + } + } + + // add non-enumerable parser reference + utils.define(parsed, 'parser', this.parser); + return parsed; + }); + + return snapdragon; +}; + +/** + * Create the key to use for memoization. The key is generated + * by iterating over the options and concatenating key-value pairs + * to the pattern string. + */ + +utils.createKey = function(pattern, options) { + if (typeof options === 'undefined') { + return pattern; + } + var key = pattern; + for (var prop in options) { + if (options.hasOwnProperty(prop)) { + key += ';' + prop + '=' + String(options[prop]); + } + } + return key; +}; + +/** + * Cast `val` to an array + * @return {Array} + */ + +utils.arrayify = function(val) { + if (typeof val === 'string') return [val]; + return val ? (Array.isArray(val) ? val : [val]) : []; +}; + +/** + * Return true if `val` is a non-empty string + */ + +utils.isString = function(val) { + return typeof val === 'string'; +}; + +/** + * Return true if `val` is a non-empty string + */ + +utils.isRegex = function(val) { + return utils.typeOf(val) === 'regexp'; +}; + +/** + * Return true if `val` is a non-empty string + */ + +utils.isObject = function(val) { + return utils.typeOf(val) === 'object'; +}; + +/** + * Escape regex characters in the given string + */ + +utils.escapeRegex = function(str) { + return str.replace(/[-[\]{}()^$|*+?.\\/\s]/g, '\\$&'); +}; + +/** + * Combines duplicate characters in the provided `input` string. + * @param {String} `input` + * @returns {String} + */ + +utils.combineDupes = function(input, patterns) { + patterns = utils.arrayify(patterns).join('|').split('|'); + patterns = patterns.map(function(s) { + return s.replace(/\\?([+*\\/])/g, '\\$1'); + }); + var substr = patterns.join('|'); + var regex = new RegExp('(' + substr + ')(?=\\1)', 'g'); + return input.replace(regex, ''); +}; + +/** + * Returns true if the given `str` has special characters + */ + +utils.hasSpecialChars = function(str) { + return /(?:(?:(^|\/)[!.])|[*?+()|[\]{}]|[+@]\()/.test(str); +}; + +/** + * Normalize slashes in the given filepath. + * + * @param {String} `filepath` + * @return {String} + */ + +utils.toPosixPath = function(str) { + return str.replace(/\\+/g, '/'); +}; + +/** + * Strip backslashes before special characters in a string. + * + * @param {String} `str` + * @return {String} + */ + +utils.unescape = function(str) { + return utils.toPosixPath(str.replace(/\\(?=[*+?!.])/g, '')); +}; + +/** + * Strip the drive letter from a windows filepath + * @param {String} `fp` + * @return {String} + */ + +utils.stripDrive = function(fp) { + return utils.isWindows() ? fp.replace(/^[a-z]:[\\/]+?/i, '/') : fp; +}; + +/** + * Strip the prefix from a filepath + * @param {String} `fp` + * @return {String} + */ + +utils.stripPrefix = function(str) { + if (str.charAt(0) === '.' && (str.charAt(1) === '/' || str.charAt(1) === '\\')) { + return str.slice(2); + } + return str; +}; + +/** + * Returns true if `str` is a common character that doesn't need + * to be processed to be used for matching. + * @param {String} `str` + * @return {Boolean} + */ + +utils.isSimpleChar = function(str) { + return str.trim() === '' || str === '.'; +}; + +/** + * Returns true if the given str is an escaped or + * unescaped path character + */ + +utils.isSlash = function(str) { + return str === '/' || str === '\\/' || str === '\\' || str === '\\\\'; +}; + +/** + * Returns a function that returns true if the given + * pattern matches or contains a `filepath` + * + * @param {String} `pattern` + * @return {Function} + */ + +utils.matchPath = function(pattern, options) { + return (options && options.contains) + ? utils.containsPattern(pattern, options) + : utils.equalsPattern(pattern, options); +}; + +/** + * Returns true if the given (original) filepath or unixified path are equal + * to the given pattern. + */ + +utils._equals = function(filepath, unixPath, pattern) { + return pattern === filepath || pattern === unixPath; +}; + +/** + * Returns true if the given (original) filepath or unixified path contain + * the given pattern. + */ + +utils._contains = function(filepath, unixPath, pattern) { + return filepath.indexOf(pattern) !== -1 || unixPath.indexOf(pattern) !== -1; +}; + +/** + * Returns a function that returns true if the given + * pattern is the same as a given `filepath` + * + * @param {String} `pattern` + * @return {Function} + */ + +utils.equalsPattern = function(pattern, options) { + var unixify = utils.unixify(options); + options = options || {}; + + return function fn(filepath) { + var equal = utils._equals(filepath, unixify(filepath), pattern); + if (equal === true || options.nocase !== true) { + return equal; + } + var lower = filepath.toLowerCase(); + return utils._equals(lower, unixify(lower), pattern); + }; +}; + +/** + * Returns a function that returns true if the given + * pattern contains a `filepath` + * + * @param {String} `pattern` + * @return {Function} + */ + +utils.containsPattern = function(pattern, options) { + var unixify = utils.unixify(options); + options = options || {}; + + return function(filepath) { + var contains = utils._contains(filepath, unixify(filepath), pattern); + if (contains === true || options.nocase !== true) { + return contains; + } + var lower = filepath.toLowerCase(); + return utils._contains(lower, unixify(lower), pattern); + }; +}; + +/** + * Returns a function that returns true if the given + * regex matches the `filename` of a file path. + * + * @param {RegExp} `re` Matching regex + * @return {Function} + */ + +utils.matchBasename = function(re) { + return function(filepath) { + return re.test(filepath) || re.test(path.basename(filepath)); + }; +}; + +/** + * Returns the given value unchanced. + * @return {any} + */ + +utils.identity = function(val) { + return val; +}; + +/** + * Determines the filepath to return based on the provided options. + * @return {any} + */ + +utils.value = function(str, unixify, options) { + if (options && options.unixify === false) { + return str; + } + if (options && typeof options.unixify === 'function') { + return options.unixify(str); + } + return unixify(str); +}; + +/** + * Returns a function that normalizes slashes in a string to forward + * slashes, strips `./` from beginning of paths, and optionally unescapes + * special characters. + * @return {Function} + */ + +utils.unixify = function(options) { + var opts = options || {}; + return function(filepath) { + if (opts.stripPrefix !== false) { + filepath = utils.stripPrefix(filepath); + } + if (opts.unescape === true) { + filepath = utils.unescape(filepath); + } + if (opts.unixify === true || utils.isWindows()) { + filepath = utils.toPosixPath(filepath); + } + return filepath; + }; +}; diff --git a/node_modules/nanomatch/node_modules/arr-diff/LICENSE b/node_modules/nanomatch/node_modules/arr-diff/LICENSE new file mode 100755 index 000000000..d734237bd --- /dev/null +++ b/node_modules/nanomatch/node_modules/arr-diff/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/nanomatch/node_modules/arr-diff/README.md b/node_modules/nanomatch/node_modules/arr-diff/README.md new file mode 100644 index 000000000..961f5c3f1 --- /dev/null +++ b/node_modules/nanomatch/node_modules/arr-diff/README.md @@ -0,0 +1,130 @@ +# arr-diff [![NPM version](https://img.shields.io/npm/v/arr-diff.svg?style=flat)](https://www.npmjs.com/package/arr-diff) [![NPM monthly downloads](https://img.shields.io/npm/dm/arr-diff.svg?style=flat)](https://npmjs.org/package/arr-diff) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/arr-diff.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/arr-diff) + +> Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save arr-diff +``` + +Install with [yarn](https://yarnpkg.com): + +```sh +$ yarn add arr-diff +``` + +Install with [bower](https://bower.io/) + +```sh +$ bower install arr-diff --save +``` + +## Usage + +Returns the difference between the first array and additional arrays. + +```js +var diff = require('arr-diff'); + +var a = ['a', 'b', 'c', 'd']; +var b = ['b', 'c']; + +console.log(diff(a, b)) +//=> ['a', 'd'] +``` + +## Benchmarks + +This library versus [array-differ](https://github.com/sindresorhus/array-differ), on April 14, 2017: + +``` +Benchmarking: (4 of 4) + · long-dupes + · long + · med + · short + +# benchmark/fixtures/long-dupes.js (100804 bytes) + arr-diff-3.0.0 x 822 ops/sec ±0.67% (86 runs sampled) + arr-diff-4.0.0 x 2,141 ops/sec ±0.42% (89 runs sampled) + array-differ x 708 ops/sec ±0.70% (89 runs sampled) + + fastest is arr-diff-4.0.0 + +# benchmark/fixtures/long.js (94529 bytes) + arr-diff-3.0.0 x 882 ops/sec ±0.60% (87 runs sampled) + arr-diff-4.0.0 x 2,329 ops/sec ±0.97% (83 runs sampled) + array-differ x 769 ops/sec ±0.61% (90 runs sampled) + + fastest is arr-diff-4.0.0 + +# benchmark/fixtures/med.js (708 bytes) + arr-diff-3.0.0 x 856,150 ops/sec ±0.42% (89 runs sampled) + arr-diff-4.0.0 x 4,665,249 ops/sec ±1.06% (89 runs sampled) + array-differ x 653,888 ops/sec ±1.02% (86 runs sampled) + + fastest is arr-diff-4.0.0 + +# benchmark/fixtures/short.js (60 bytes) + arr-diff-3.0.0 x 3,078,467 ops/sec ±0.77% (93 runs sampled) + arr-diff-4.0.0 x 9,213,296 ops/sec ±0.65% (89 runs sampled) + array-differ x 1,337,051 ops/sec ±0.91% (92 runs sampled) + + fastest is arr-diff-4.0.0 +``` + +## About + +### Related projects + +* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays. This is the fastest implementation of array flatten.") +* [array-filter](https://www.npmjs.com/package/array-filter): Array#filter for older browsers. | [homepage](https://github.com/juliangruber/array-filter "Array#filter for older browsers.") +* [array-intersection](https://www.npmjs.com/package/array-intersection): Return an array with the unique values present in _all_ given arrays using strict equality… [more](https://github.com/jonschlinkert/array-intersection) | [homepage](https://github.com/jonschlinkert/array-intersection "Return an array with the unique values present in _all_ given arrays using strict equality for comparisons.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 33 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [paulmillr](https://github.com/paulmillr) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 14, 2017._ \ No newline at end of file diff --git a/node_modules/nanomatch/node_modules/arr-diff/index.js b/node_modules/nanomatch/node_modules/arr-diff/index.js new file mode 100644 index 000000000..90f280772 --- /dev/null +++ b/node_modules/nanomatch/node_modules/arr-diff/index.js @@ -0,0 +1,47 @@ +/*! + * arr-diff + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +module.exports = function diff(arr/*, arrays*/) { + var len = arguments.length; + var idx = 0; + while (++idx < len) { + arr = diffArray(arr, arguments[idx]); + } + return arr; +}; + +function diffArray(one, two) { + if (!Array.isArray(two)) { + return one.slice(); + } + + var tlen = two.length + var olen = one.length; + var idx = -1; + var arr = []; + + while (++idx < olen) { + var ele = one[idx]; + + var hasEle = false; + for (var i = 0; i < tlen; i++) { + var val = two[i]; + + if (ele === val) { + hasEle = true; + break; + } + } + + if (hasEle === false) { + arr.push(ele); + } + } + return arr; +} diff --git a/node_modules/nanomatch/node_modules/arr-diff/package.json b/node_modules/nanomatch/node_modules/arr-diff/package.json new file mode 100644 index 000000000..27d8ba7bb --- /dev/null +++ b/node_modules/nanomatch/node_modules/arr-diff/package.json @@ -0,0 +1,108 @@ +{ + "_from": "arr-diff@^4.0.0", + "_id": "arr-diff@4.0.0", + "_inBundle": false, + "_integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "_location": "/nanomatch/arr-diff", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "arr-diff@^4.0.0", + "name": "arr-diff", + "escapedName": "arr-diff", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/nanomatch" + ], + "_resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "_shasum": "d6461074febfec71e7e15235761a329a5dc7c520", + "_spec": "arr-diff@^4.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/nanomatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/arr-diff/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Paul Miller", + "email": "paul+gh@paulmillr.com", + "url": "paulmillr.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.", + "devDependencies": { + "ansi-bold": "^0.1.1", + "arr-flatten": "^1.0.1", + "array-differ": "^1.0.0", + "benchmarked": "^0.2.4", + "gulp-format-md": "^0.1.9", + "minimist": "^1.2.0", + "mocha": "^2.4.5" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/arr-diff", + "keywords": [ + "arr", + "array", + "array differ", + "array-differ", + "diff", + "differ", + "difference" + ], + "license": "MIT", + "main": "index.js", + "name": "arr-diff", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/arr-diff.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "arr-flatten", + "array-filter", + "array-intersection" + ] + }, + "reflinks": [ + "array-differ", + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "4.0.0" +} diff --git a/node_modules/nanomatch/node_modules/array-unique/LICENSE b/node_modules/nanomatch/node_modules/array-unique/LICENSE new file mode 100755 index 000000000..842218cf0 --- /dev/null +++ b/node_modules/nanomatch/node_modules/array-unique/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/nanomatch/node_modules/array-unique/README.md b/node_modules/nanomatch/node_modules/array-unique/README.md new file mode 100755 index 000000000..41c8c904e --- /dev/null +++ b/node_modules/nanomatch/node_modules/array-unique/README.md @@ -0,0 +1,77 @@ +# array-unique [![NPM version](https://img.shields.io/npm/v/array-unique.svg?style=flat)](https://www.npmjs.com/package/array-unique) [![NPM downloads](https://img.shields.io/npm/dm/array-unique.svg?style=flat)](https://npmjs.org/package/array-unique) [![Build Status](https://img.shields.io/travis/jonschlinkert/array-unique.svg?style=flat)](https://travis-ci.org/jonschlinkert/array-unique) + +Remove duplicate values from an array. Fastest ES5 implementation. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save array-unique +``` + +## Usage + +```js +var unique = require('array-unique'); + +var arr = ['a', 'b', 'c', 'c']; +console.log(unique(arr)) //=> ['a', 'b', 'c'] +console.log(arr) //=> ['a', 'b', 'c'] + +/* The above modifies the input array. To prevent that at a slight performance cost: */ +var unique = require("array-unique").immutable; + +var arr = ['a', 'b', 'c', 'c']; +console.log(unique(arr)) //=> ['a', 'b', 'c'] +console.log(arr) //=> ['a', 'b', 'c', 'c'] +``` + +## About + +### Related projects + +* [arr-diff](https://www.npmjs.com/package/arr-diff): Returns an array with only the unique values from the first array, by excluding all… [more](https://github.com/jonschlinkert/arr-diff) | [homepage](https://github.com/jonschlinkert/arr-diff "Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.") +* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays. This is the fastest implementation of array flatten.") +* [arr-map](https://www.npmjs.com/package/arr-map): Faster, node.js focused alternative to JavaScript's native array map. | [homepage](https://github.com/jonschlinkert/arr-map "Faster, node.js focused alternative to JavaScript's native array map.") +* [arr-pluck](https://www.npmjs.com/package/arr-pluck): Retrieves the value of a specified property from all elements in the collection. | [homepage](https://github.com/jonschlinkert/arr-pluck "Retrieves the value of a specified property from all elements in the collection.") +* [arr-reduce](https://www.npmjs.com/package/arr-reduce): Fast array reduce that also loops over sparse elements. | [homepage](https://github.com/jonschlinkert/arr-reduce "Fast array reduce that also loops over sparse elements.") +* [arr-union](https://www.npmjs.com/package/arr-union): Combines a list of arrays, returning a single array with unique values, using strict equality… [more](https://github.com/jonschlinkert/arr-union) | [homepage](https://github.com/jonschlinkert/arr-union "Combines a list of arrays, returning a single array with unique values, using strict equality for comparisons.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/array-unique/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.28, on July 31, 2016._ \ No newline at end of file diff --git a/node_modules/nanomatch/node_modules/array-unique/index.js b/node_modules/nanomatch/node_modules/array-unique/index.js new file mode 100644 index 000000000..7e481e072 --- /dev/null +++ b/node_modules/nanomatch/node_modules/array-unique/index.js @@ -0,0 +1,43 @@ +/*! + * array-unique + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +module.exports = function unique(arr) { + if (!Array.isArray(arr)) { + throw new TypeError('array-unique expects an array.'); + } + + var len = arr.length; + var i = -1; + + while (i++ < len) { + var j = i + 1; + + for (; j < arr.length; ++j) { + if (arr[i] === arr[j]) { + arr.splice(j--, 1); + } + } + } + return arr; +}; + +module.exports.immutable = function uniqueImmutable(arr) { + if (!Array.isArray(arr)) { + throw new TypeError('array-unique expects an array.'); + } + + var arrLen = arr.length; + var newArr = new Array(arrLen); + + for (var i = 0; i < arrLen; i++) { + newArr[i] = arr[i]; + } + + return module.exports(newArr); +}; diff --git a/node_modules/nanomatch/node_modules/array-unique/package.json b/node_modules/nanomatch/node_modules/array-unique/package.json new file mode 100644 index 000000000..44a7b4e4c --- /dev/null +++ b/node_modules/nanomatch/node_modules/array-unique/package.json @@ -0,0 +1,93 @@ +{ + "_from": "array-unique@^0.3.2", + "_id": "array-unique@0.3.2", + "_inBundle": false, + "_integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "_location": "/nanomatch/array-unique", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "array-unique@^0.3.2", + "name": "array-unique", + "escapedName": "array-unique", + "rawSpec": "^0.3.2", + "saveSpec": null, + "fetchSpec": "^0.3.2" + }, + "_requiredBy": [ + "/nanomatch" + ], + "_resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "_shasum": "a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428", + "_spec": "array-unique@^0.3.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/nanomatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/array-unique/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Remove duplicate values from an array. Fastest ES5 implementation.", + "devDependencies": { + "array-uniq": "^1.0.2", + "benchmarked": "^0.1.3", + "gulp-format-md": "^0.1.9", + "mocha": "^2.5.3", + "should": "^10.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "LICENSE", + "README.md" + ], + "homepage": "https://github.com/jonschlinkert/array-unique", + "keywords": [ + "array", + "unique" + ], + "license": "MIT", + "main": "index.js", + "name": "array-unique", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/array-unique.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "arr-diff", + "arr-union", + "arr-flatten", + "arr-reduce", + "arr-map", + "arr-pluck" + ] + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ], + "lint": { + "reflinks": true + } + }, + "version": "0.3.2" +} diff --git a/node_modules/nanomatch/node_modules/kind-of/CHANGELOG.md b/node_modules/nanomatch/node_modules/kind-of/CHANGELOG.md new file mode 100644 index 000000000..fb30b06df --- /dev/null +++ b/node_modules/nanomatch/node_modules/kind-of/CHANGELOG.md @@ -0,0 +1,157 @@ +# Release history + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +
+ Guiding Principles + +- Changelogs are for humans, not machines. +- There should be an entry for every single version. +- The same types of changes should be grouped. +- Versions and sections should be linkable. +- The latest version comes first. +- The release date of each versions is displayed. +- Mention whether you follow Semantic Versioning. + +
+ +
+ Types of changes + +Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_): + +- `Added` for new features. +- `Changed` for changes in existing functionality. +- `Deprecated` for soon-to-be removed features. +- `Removed` for now removed features. +- `Fixed` for any bug fixes. +- `Security` in case of vulnerabilities. + +
+ +## [6.0.0] - 2017-10-13 + +- refactor code to be more performant +- refactor benchmarks + +## [5.1.0] - 2017-10-13 + +**Added** + +- Merge pull request #15 from aretecode/patch-1 +- adds support and tests for string & array iterators + +**Changed** + +- updates benchmarks + +## [5.0.2] - 2017-08-02 + +- Merge pull request #14 from struct78/master +- Added `undefined` check + +## [5.0.0] - 2017-06-21 + +- Merge pull request #12 from aretecode/iterator +- Set Iterator + Map Iterator +- streamline `isbuffer`, minor edits + +## [4.0.0] - 2017-05-19 + +- Merge pull request #8 from tunnckoCore/master +- update deps + +## [3.2.2] - 2017-05-16 + +- fix version + +## [3.2.1] - 2017-05-16 + +- add browserify + +## [3.2.0] - 2017-04-25 + +- Merge pull request #10 from ksheedlo/unrequire-buffer +- add `promise` support and tests +- Remove unnecessary `Buffer` check + +## [3.1.0] - 2016-12-07 + +- Merge pull request #7 from laggingreflex/err +- add support for `error` and tests +- run update + +## [3.0.4] - 2016-07-29 + +- move tests +- run update + +## [3.0.3] - 2016-05-03 + +- fix prepublish script +- remove unused dep + +## [3.0.0] - 2015-11-17 + +- add typed array support +- Merge pull request #5 from miguelmota/typed-arrays +- adds new tests + +## [2.0.1] - 2015-08-21 + +- use `is-buffer` module + +## [2.0.0] - 2015-05-31 + +- Create fallback for `Array.isArray` if used as a browser package +- Merge pull request #2 from dtothefp/patch-1 +- Merge pull request #3 from pdehaan/patch-1 +- Merge branch 'master' of https://github.com/chorks/kind-of into chorks-master +- optimizations, mostly date and regex + +## [1.1.0] - 2015-02-09 + +- adds `buffer` support +- adds tests for `buffer` + +## [1.0.0] - 2015-01-19 + +- update benchmarks +- optimizations based on benchmarks + +## [0.1.2] - 2014-10-26 + +- return `typeof` value if it's not an object. very slight speed improvement +- use `.slice` +- adds benchmarks + +## [0.1.0] - 2014-9-26 + +- first commit + +[6.0.0]: https://github.com/jonschlinkert/kind-of/compare/5.1.0...6.0.0 +[5.1.0]: https://github.com/jonschlinkert/kind-of/compare/5.0.2...5.1.0 +[5.0.2]: https://github.com/jonschlinkert/kind-of/compare/5.0.1...5.0.2 +[5.0.1]: https://github.com/jonschlinkert/kind-of/compare/5.0.0...5.0.1 +[5.0.0]: https://github.com/jonschlinkert/kind-of/compare/4.0.0...5.0.0 +[4.0.0]: https://github.com/jonschlinkert/kind-of/compare/3.2.2...4.0.0 +[3.2.2]: https://github.com/jonschlinkert/kind-of/compare/3.2.1...3.2.2 +[3.2.1]: https://github.com/jonschlinkert/kind-of/compare/3.2.0...3.2.1 +[3.2.0]: https://github.com/jonschlinkert/kind-of/compare/3.1.0...3.2.0 +[3.1.0]: https://github.com/jonschlinkert/kind-of/compare/3.0.4...3.1.0 +[3.0.4]: https://github.com/jonschlinkert/kind-of/compare/3.0.3...3.0.4 +[3.0.3]: https://github.com/jonschlinkert/kind-of/compare/3.0.0...3.0.3 +[3.0.0]: https://github.com/jonschlinkert/kind-of/compare/2.0.1...3.0.0 +[2.0.1]: https://github.com/jonschlinkert/kind-of/compare/2.0.0...2.0.1 +[2.0.0]: https://github.com/jonschlinkert/kind-of/compare/1.1.0...2.0.0 +[1.1.0]: https://github.com/jonschlinkert/kind-of/compare/1.0.0...1.1.0 +[1.0.0]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...1.0.0 +[0.1.2]: https://github.com/jonschlinkert/kind-of/compare/0.1.0...0.1.2 +[0.1.0]: https://github.com/jonschlinkert/kind-of/commit/2fae09b0b19b1aadb558e9be39f0c3ef6034eb87 + +[Unreleased]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...HEAD +[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog + diff --git a/node_modules/nanomatch/node_modules/kind-of/LICENSE b/node_modules/nanomatch/node_modules/kind-of/LICENSE new file mode 100644 index 000000000..3f2eca18f --- /dev/null +++ b/node_modules/nanomatch/node_modules/kind-of/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/nanomatch/node_modules/kind-of/README.md b/node_modules/nanomatch/node_modules/kind-of/README.md new file mode 100644 index 000000000..4b0d4a818 --- /dev/null +++ b/node_modules/nanomatch/node_modules/kind-of/README.md @@ -0,0 +1,365 @@ +# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) + +> Get the native type of a value. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save kind-of +``` + +Install with [bower](https://bower.io/) + +```sh +$ bower install kind-of --save +``` + +## Why use this? + +1. [it's fast](#benchmarks) | [optimizations](#optimizations) +2. [better type checking](#better-type-checking) + +## Usage + +> es5, es6, and browser ready + +```js +var kindOf = require('kind-of'); + +kindOf(undefined); +//=> 'undefined' + +kindOf(null); +//=> 'null' + +kindOf(true); +//=> 'boolean' + +kindOf(false); +//=> 'boolean' + +kindOf(new Buffer('')); +//=> 'buffer' + +kindOf(42); +//=> 'number' + +kindOf('str'); +//=> 'string' + +kindOf(arguments); +//=> 'arguments' + +kindOf({}); +//=> 'object' + +kindOf(Object.create(null)); +//=> 'object' + +kindOf(new Test()); +//=> 'object' + +kindOf(new Date()); +//=> 'date' + +kindOf([1, 2, 3]); +//=> 'array' + +kindOf(/foo/); +//=> 'regexp' + +kindOf(new RegExp('foo')); +//=> 'regexp' + +kindOf(new Error('error')); +//=> 'error' + +kindOf(function () {}); +//=> 'function' + +kindOf(function * () {}); +//=> 'generatorfunction' + +kindOf(Symbol('str')); +//=> 'symbol' + +kindOf(new Map()); +//=> 'map' + +kindOf(new WeakMap()); +//=> 'weakmap' + +kindOf(new Set()); +//=> 'set' + +kindOf(new WeakSet()); +//=> 'weakset' + +kindOf(new Int8Array()); +//=> 'int8array' + +kindOf(new Uint8Array()); +//=> 'uint8array' + +kindOf(new Uint8ClampedArray()); +//=> 'uint8clampedarray' + +kindOf(new Int16Array()); +//=> 'int16array' + +kindOf(new Uint16Array()); +//=> 'uint16array' + +kindOf(new Int32Array()); +//=> 'int32array' + +kindOf(new Uint32Array()); +//=> 'uint32array' + +kindOf(new Float32Array()); +//=> 'float32array' + +kindOf(new Float64Array()); +//=> 'float64array' +``` + +## Benchmarks + +Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). + +```bash +# arguments (32 bytes) + kind-of x 17,024,098 ops/sec ±1.90% (86 runs sampled) + lib-type-of x 11,926,235 ops/sec ±1.34% (83 runs sampled) + lib-typeof x 9,245,257 ops/sec ±1.22% (87 runs sampled) + + fastest is kind-of (by 161% avg) + +# array (22 bytes) + kind-of x 17,196,492 ops/sec ±1.07% (88 runs sampled) + lib-type-of x 8,838,283 ops/sec ±1.02% (87 runs sampled) + lib-typeof x 8,677,848 ops/sec ±0.87% (87 runs sampled) + + fastest is kind-of (by 196% avg) + +# boolean (24 bytes) + kind-of x 16,841,600 ops/sec ±1.10% (86 runs sampled) + lib-type-of x 8,096,787 ops/sec ±0.95% (87 runs sampled) + lib-typeof x 8,423,345 ops/sec ±1.15% (86 runs sampled) + + fastest is kind-of (by 204% avg) + +# buffer (38 bytes) + kind-of x 14,848,060 ops/sec ±1.05% (86 runs sampled) + lib-type-of x 3,671,577 ops/sec ±1.49% (87 runs sampled) + lib-typeof x 8,360,236 ops/sec ±1.24% (86 runs sampled) + + fastest is kind-of (by 247% avg) + +# date (30 bytes) + kind-of x 16,067,761 ops/sec ±1.58% (86 runs sampled) + lib-type-of x 8,954,436 ops/sec ±1.40% (87 runs sampled) + lib-typeof x 8,488,307 ops/sec ±1.51% (84 runs sampled) + + fastest is kind-of (by 184% avg) + +# error (36 bytes) + kind-of x 9,634,090 ops/sec ±1.12% (89 runs sampled) + lib-type-of x 7,735,624 ops/sec ±1.32% (86 runs sampled) + lib-typeof x 7,442,160 ops/sec ±1.11% (90 runs sampled) + + fastest is kind-of (by 127% avg) + +# function (34 bytes) + kind-of x 10,031,494 ops/sec ±1.27% (86 runs sampled) + lib-type-of x 9,502,757 ops/sec ±1.17% (89 runs sampled) + lib-typeof x 8,278,985 ops/sec ±1.08% (88 runs sampled) + + fastest is kind-of (by 113% avg) + +# null (24 bytes) + kind-of x 18,159,808 ops/sec ±1.92% (86 runs sampled) + lib-type-of x 12,927,635 ops/sec ±1.01% (88 runs sampled) + lib-typeof x 7,958,234 ops/sec ±1.21% (89 runs sampled) + + fastest is kind-of (by 174% avg) + +# number (22 bytes) + kind-of x 17,846,779 ops/sec ±0.91% (85 runs sampled) + lib-type-of x 3,316,636 ops/sec ±1.19% (86 runs sampled) + lib-typeof x 2,329,477 ops/sec ±2.21% (85 runs sampled) + + fastest is kind-of (by 632% avg) + +# object-plain (47 bytes) + kind-of x 7,085,155 ops/sec ±1.05% (88 runs sampled) + lib-type-of x 8,870,930 ops/sec ±1.06% (83 runs sampled) + lib-typeof x 8,716,024 ops/sec ±1.05% (87 runs sampled) + + fastest is lib-type-of (by 112% avg) + +# regex (25 bytes) + kind-of x 14,196,052 ops/sec ±1.65% (84 runs sampled) + lib-type-of x 9,554,164 ops/sec ±1.25% (88 runs sampled) + lib-typeof x 8,359,691 ops/sec ±1.07% (87 runs sampled) + + fastest is kind-of (by 158% avg) + +# string (33 bytes) + kind-of x 16,131,428 ops/sec ±1.41% (85 runs sampled) + lib-type-of x 7,273,172 ops/sec ±1.05% (87 runs sampled) + lib-typeof x 7,382,635 ops/sec ±1.17% (85 runs sampled) + + fastest is kind-of (by 220% avg) + +# symbol (34 bytes) + kind-of x 17,011,537 ops/sec ±1.24% (86 runs sampled) + lib-type-of x 3,492,454 ops/sec ±1.23% (89 runs sampled) + lib-typeof x 7,471,235 ops/sec ±2.48% (87 runs sampled) + + fastest is kind-of (by 310% avg) + +# template-strings (36 bytes) + kind-of x 15,434,250 ops/sec ±1.46% (83 runs sampled) + lib-type-of x 7,157,907 ops/sec ±0.97% (87 runs sampled) + lib-typeof x 7,517,986 ops/sec ±0.92% (86 runs sampled) + + fastest is kind-of (by 210% avg) + +# undefined (29 bytes) + kind-of x 19,167,115 ops/sec ±1.71% (87 runs sampled) + lib-type-of x 15,477,740 ops/sec ±1.63% (85 runs sampled) + lib-typeof x 19,075,495 ops/sec ±1.17% (83 runs sampled) + + fastest is lib-typeof,kind-of + +``` + +## Optimizations + +In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: + +1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. +2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. +3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` +4. There is no reason to make the code in a microlib as terse as possible, just to win points for making it shorter. It's always better to favor performant code over terse code. You will always only be using a single `require()` statement to use the library anyway, regardless of how the code is written. + +## Better type checking + +kind-of seems to be more consistently "correct" than other type checking libs I've looked at. For example, here are some differing results from other popular libs: + +### [typeof](https://github.com/CodingFu/typeof) lib + +Incorrectly identifies instances of custom constructors (pretty common): + +```js +var typeOf = require('typeof'); +function Test() {} +console.log(typeOf(new Test())); +//=> 'test' +``` + +Returns `object` instead of `arguments`: + +```js +function foo() { + console.log(typeOf(arguments)) //=> 'object' +} +foo(); +``` + +### [type-of](https://github.com/ForbesLindesay/type-of) lib + +Incorrectly returns `object` for generator functions, buffers, `Map`, `Set`, `WeakMap` and `WeakSet`: + +```js +function * foo() {} +console.log(typeOf(foo)); +//=> 'object' +console.log(typeOf(new Buffer(''))); +//=> 'object' +console.log(typeOf(new Map())); +//=> 'object' +console.log(typeOf(new Set())); +//=> 'object' +console.log(typeOf(new WeakMap())); +//=> 'object' +console.log(typeOf(new WeakSet())); +//=> 'object' +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 98 | [jonschlinkert](https://github.com/jonschlinkert) | +| 3 | [aretecode](https://github.com/aretecode) | +| 2 | [miguelmota](https://github.com/miguelmota) | +| 1 | [dtothefp](https://github.com/dtothefp) | +| 1 | [ianstormtaylor](https://github.com/ianstormtaylor) | +| 1 | [ksheedlo](https://github.com/ksheedlo) | +| 1 | [pdehaan](https://github.com/pdehaan) | +| 1 | [laggingreflex](https://github.com/laggingreflex) | +| 1 | [charlike-old](https://github.com/charlike-old) | + +### Author + +**Jon Schlinkert** + +* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on December 01, 2017._ \ No newline at end of file diff --git a/node_modules/nanomatch/node_modules/kind-of/index.js b/node_modules/nanomatch/node_modules/kind-of/index.js new file mode 100644 index 000000000..aa2bb3944 --- /dev/null +++ b/node_modules/nanomatch/node_modules/kind-of/index.js @@ -0,0 +1,129 @@ +var toString = Object.prototype.toString; + +module.exports = function kindOf(val) { + if (val === void 0) return 'undefined'; + if (val === null) return 'null'; + + var type = typeof val; + if (type === 'boolean') return 'boolean'; + if (type === 'string') return 'string'; + if (type === 'number') return 'number'; + if (type === 'symbol') return 'symbol'; + if (type === 'function') { + return isGeneratorFn(val) ? 'generatorfunction' : 'function'; + } + + if (isArray(val)) return 'array'; + if (isBuffer(val)) return 'buffer'; + if (isArguments(val)) return 'arguments'; + if (isDate(val)) return 'date'; + if (isError(val)) return 'error'; + if (isRegexp(val)) return 'regexp'; + + switch (ctorName(val)) { + case 'Symbol': return 'symbol'; + case 'Promise': return 'promise'; + + // Set, Map, WeakSet, WeakMap + case 'WeakMap': return 'weakmap'; + case 'WeakSet': return 'weakset'; + case 'Map': return 'map'; + case 'Set': return 'set'; + + // 8-bit typed arrays + case 'Int8Array': return 'int8array'; + case 'Uint8Array': return 'uint8array'; + case 'Uint8ClampedArray': return 'uint8clampedarray'; + + // 16-bit typed arrays + case 'Int16Array': return 'int16array'; + case 'Uint16Array': return 'uint16array'; + + // 32-bit typed arrays + case 'Int32Array': return 'int32array'; + case 'Uint32Array': return 'uint32array'; + case 'Float32Array': return 'float32array'; + case 'Float64Array': return 'float64array'; + } + + if (isGeneratorObj(val)) { + return 'generator'; + } + + // Non-plain objects + type = toString.call(val); + switch (type) { + case '[object Object]': return 'object'; + // iterators + case '[object Map Iterator]': return 'mapiterator'; + case '[object Set Iterator]': return 'setiterator'; + case '[object String Iterator]': return 'stringiterator'; + case '[object Array Iterator]': return 'arrayiterator'; + } + + // other + return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); +}; + +function ctorName(val) { + return val.constructor ? val.constructor.name : null; +} + +function isArray(val) { + if (Array.isArray) return Array.isArray(val); + return val instanceof Array; +} + +function isError(val) { + return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'); +} + +function isDate(val) { + if (val instanceof Date) return true; + return typeof val.toDateString === 'function' + && typeof val.getDate === 'function' + && typeof val.setDate === 'function'; +} + +function isRegexp(val) { + if (val instanceof RegExp) return true; + return typeof val.flags === 'string' + && typeof val.ignoreCase === 'boolean' + && typeof val.multiline === 'boolean' + && typeof val.global === 'boolean'; +} + +function isGeneratorFn(name, val) { + return ctorName(name) === 'GeneratorFunction'; +} + +function isGeneratorObj(val) { + return typeof val.throw === 'function' + && typeof val.return === 'function' + && typeof val.next === 'function'; +} + +function isArguments(val) { + try { + if (typeof val.length === 'number' && typeof val.callee === 'function') { + return true; + } + } catch (err) { + if (err.message.indexOf('callee') !== -1) { + return true; + } + } + return false; +} + +/** + * If you need to support Safari 5-7 (8-10 yr-old browser), + * take a look at https://github.com/feross/is-buffer + */ + +function isBuffer(val) { + if (val.constructor && typeof val.constructor.isBuffer === 'function') { + return val.constructor.isBuffer(val); + } + return false; +} diff --git a/node_modules/nanomatch/node_modules/kind-of/package.json b/node_modules/nanomatch/node_modules/kind-of/package.json new file mode 100644 index 000000000..08621dd07 --- /dev/null +++ b/node_modules/nanomatch/node_modules/kind-of/package.json @@ -0,0 +1,143 @@ +{ + "_from": "kind-of@^6.0.2", + "_id": "kind-of@6.0.2", + "_inBundle": false, + "_integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "_location": "/nanomatch/kind-of", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "kind-of@^6.0.2", + "name": "kind-of", + "escapedName": "kind-of", + "rawSpec": "^6.0.2", + "saveSpec": null, + "fetchSpec": "^6.0.2" + }, + "_requiredBy": [ + "/nanomatch" + ], + "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "_shasum": "01146b36a6218e64e58f3a8d66de5d7fc6f6d051", + "_spec": "kind-of@^6.0.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/nanomatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/kind-of/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "David Fox-Powell", + "url": "https://dtothefp.github.io/me" + }, + { + "name": "James", + "url": "https://twitter.com/aretecode" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Ken Sheedlo", + "url": "kensheedlo.com" + }, + { + "name": "laggingreflex", + "url": "https://github.com/laggingreflex" + }, + { + "name": "Miguel Mota", + "url": "https://miguelmota.com" + }, + { + "name": "Peter deHaan", + "url": "http://about.me/peterdehaan" + }, + { + "name": "tunnckoCore", + "url": "https://i.am.charlike.online" + } + ], + "deprecated": false, + "description": "Get the native type of a value.", + "devDependencies": { + "benchmarked": "^2.0.0", + "browserify": "^14.4.0", + "gulp-format-md": "^1.0.0", + "mocha": "^4.0.1", + "write": "^1.0.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/kind-of", + "keywords": [ + "arguments", + "array", + "boolean", + "check", + "date", + "function", + "is", + "is-type", + "is-type-of", + "kind", + "kind-of", + "number", + "object", + "of", + "regexp", + "string", + "test", + "type", + "type-of", + "typeof", + "types" + ], + "license": "MIT", + "main": "index.js", + "name": "kind-of", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/kind-of.git" + }, + "scripts": { + "prepublish": "browserify -o browser.js -e index.js -s index --bare", + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "related": { + "list": [ + "is-glob", + "is-number", + "is-primitive" + ] + }, + "reflinks": [ + "type-of", + "typeof", + "verb" + ] + }, + "version": "6.0.2" +} diff --git a/node_modules/nanomatch/package.json b/node_modules/nanomatch/package.json new file mode 100644 index 000000000..5e15ee775 --- /dev/null +++ b/node_modules/nanomatch/package.json @@ -0,0 +1,171 @@ +{ + "_from": "nanomatch@^1.2.9", + "_id": "nanomatch@1.2.13", + "_inBundle": false, + "_integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "_location": "/nanomatch", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "nanomatch@^1.2.9", + "name": "nanomatch", + "escapedName": "nanomatch", + "rawSpec": "^1.2.9", + "saveSpec": null, + "fetchSpec": "^1.2.9" + }, + "_requiredBy": [ + "/readdirp/micromatch" + ], + "_resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "_shasum": "b87a8aa4fc0de8fe6be88895b38983ff265bd119", + "_spec": "nanomatch@^1.2.9", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/micromatch/nanomatch/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Devon Govett", + "url": "http://badassjs.com" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + } + ], + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "deprecated": false, + "description": "Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces)", + "devDependencies": { + "bash-match": "^1.0.2", + "for-own": "^1.0.0", + "gulp": "^3.9.1", + "gulp-format-md": "^1.0.0", + "gulp-istanbul": "^1.1.3", + "gulp-mocha": "^5.0.0", + "helper-changelog": "^0.3.0", + "minimatch": "^3.0.4", + "minimist": "^1.2.0", + "mocha": "^3.5.3", + "multimatch": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "lib" + ], + "homepage": "https://github.com/micromatch/nanomatch", + "keywords": [ + "bash", + "expand", + "expansion", + "expression", + "file", + "files", + "filter", + "find", + "glob", + "globbing", + "globs", + "globstar", + "match", + "matcher", + "matches", + "matching", + "micromatch", + "minimatch", + "multimatch", + "nanomatch", + "path", + "pattern", + "patterns", + "regex", + "regexp", + "regular", + "shell", + "wildcard" + ], + "license": "MIT", + "lintDeps": { + "dependencies": { + "options": { + "lock": { + "snapdragon": "^0.8.1" + } + } + }, + "devDependencies": { + "files": { + "options": { + "ignore": [ + "benchmark/**" + ] + } + } + } + }, + "main": "index.js", + "name": "nanomatch", + "repository": { + "type": "git", + "url": "git+https://github.com/micromatch/nanomatch.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": "collapsible", + "layout": "default", + "tasks": [ + "readme" + ], + "helpers": [ + "helper-changelog" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "extglob", + "is-extglob", + "is-glob", + "micromatch" + ] + }, + "reflinks": [ + "expand-brackets", + "expand-tilde", + "glob-object", + "micromatch", + "minimatch", + "options", + "snapdragon" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.2.13" +} diff --git a/node_modules/nice-try/CHANGELOG.md b/node_modules/nice-try/CHANGELOG.md new file mode 100644 index 000000000..9e6baf2fb --- /dev/null +++ b/node_modules/nice-try/CHANGELOG.md @@ -0,0 +1,21 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [1.0.5] - 2018-08-25 + +### Changed + +- Removed `prepublish` script from `package.json` + +## [1.0.4] - 2017-08-08 + +### New + +- Added a changelog + +### Changed + +- Ignore `yarn.lock` and `package-lock.json` files \ No newline at end of file diff --git a/node_modules/nice-try/LICENSE b/node_modules/nice-try/LICENSE new file mode 100644 index 000000000..681c8f507 --- /dev/null +++ b/node_modules/nice-try/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 Tobias Reich + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/nice-try/README.md b/node_modules/nice-try/README.md new file mode 100644 index 000000000..5b83b7882 --- /dev/null +++ b/node_modules/nice-try/README.md @@ -0,0 +1,32 @@ +# nice-try + +[![Travis Build Status](https://travis-ci.org/electerious/nice-try.svg?branch=master)](https://travis-ci.org/electerious/nice-try) [![AppVeyor Status](https://ci.appveyor.com/api/projects/status/8tqb09wrwci3xf8l?svg=true)](https://ci.appveyor.com/project/electerious/nice-try) [![Coverage Status](https://coveralls.io/repos/github/electerious/nice-try/badge.svg?branch=master)](https://coveralls.io/github/electerious/nice-try?branch=master) [![Dependencies](https://david-dm.org/electerious/nice-try.svg)](https://david-dm.org/electerious/nice-try#info=dependencies) [![Greenkeeper badge](https://badges.greenkeeper.io/electerious/nice-try.svg)](https://greenkeeper.io/) + +A function that tries to execute a function and discards any error that occurs. + +## Install + +``` +npm install nice-try +``` + +## Usage + +```js +const niceTry = require('nice-try') + +niceTry(() => JSON.parse('true')) // true +niceTry(() => JSON.parse('truee')) // undefined +niceTry() // undefined +niceTry(true) // undefined +``` + +## API + +### Parameters + +- `fn` `{Function}` Function that might or might not throw an error. + +### Returns + +- `{?*}` Return-value of the function when no error occurred. \ No newline at end of file diff --git a/node_modules/nice-try/package.json b/node_modules/nice-try/package.json new file mode 100644 index 000000000..b4150c7b4 --- /dev/null +++ b/node_modules/nice-try/package.json @@ -0,0 +1,61 @@ +{ + "_from": "nice-try@^1.0.4", + "_id": "nice-try@1.0.5", + "_inBundle": false, + "_integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "_location": "/nice-try", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "nice-try@^1.0.4", + "name": "nice-try", + "escapedName": "nice-try", + "rawSpec": "^1.0.4", + "saveSpec": null, + "fetchSpec": "^1.0.4" + }, + "_requiredBy": [ + "/cross-spawn" + ], + "_resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "_shasum": "a3378a7696ce7d223e88fc9b764bd7ef1089e366", + "_spec": "nice-try@^1.0.4", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/cross-spawn", + "authors": [ + "Tobias Reich " + ], + "bugs": { + "url": "https://github.com/electerious/nice-try/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Tries to execute a function and discards any error that occurs", + "devDependencies": { + "chai": "^4.1.2", + "coveralls": "^3.0.0", + "mocha": "^5.1.1", + "nyc": "^12.0.1" + }, + "files": [ + "src" + ], + "homepage": "https://github.com/electerious/nice-try", + "keywords": [ + "try", + "catch", + "error" + ], + "license": "MIT", + "main": "src/index.js", + "name": "nice-try", + "repository": { + "type": "git", + "url": "git+https://github.com/electerious/nice-try.git" + }, + "scripts": { + "coveralls": "nyc report --reporter=text-lcov | coveralls", + "test": "nyc node_modules/mocha/bin/_mocha" + }, + "version": "1.0.5" +} diff --git a/node_modules/nice-try/src/index.js b/node_modules/nice-try/src/index.js new file mode 100644 index 000000000..837506f2c --- /dev/null +++ b/node_modules/nice-try/src/index.js @@ -0,0 +1,12 @@ +'use strict' + +/** + * Tries to execute a function and discards any error that occurs. + * @param {Function} fn - Function that might or might not throw an error. + * @returns {?*} Return-value of the function when no error occurred. + */ +module.exports = function(fn) { + + try { return fn() } catch (e) {} + +} \ No newline at end of file diff --git a/node_modules/normalize-path/LICENSE b/node_modules/normalize-path/LICENSE new file mode 100644 index 000000000..d734237bd --- /dev/null +++ b/node_modules/normalize-path/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/normalize-path/README.md b/node_modules/normalize-path/README.md new file mode 100644 index 000000000..daa0edda3 --- /dev/null +++ b/node_modules/normalize-path/README.md @@ -0,0 +1,92 @@ +# normalize-path [![NPM version](https://img.shields.io/npm/v/normalize-path.svg?style=flat)](https://www.npmjs.com/package/normalize-path) [![NPM monthly downloads](https://img.shields.io/npm/dm/normalize-path.svg?style=flat)](https://npmjs.org/package/normalize-path) [![NPM total downloads](https://img.shields.io/npm/dt/normalize-path.svg?style=flat)](https://npmjs.org/package/normalize-path) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/normalize-path.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/normalize-path) + +> Normalize file path slashes to be unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes unless disabled. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save normalize-path +``` + +## Usage + +```js +var normalize = require('normalize-path'); + +normalize('\\foo\\bar\\baz\\'); +//=> '/foo/bar/baz' + +normalize('./foo/bar/baz/'); +//=> './foo/bar/baz' +``` + +Pass `false` as the last argument to **keep** trailing slashes: + +```js +normalize('./foo/bar/baz/', false); +//=> './foo/bar/baz/' + +normalize('foo\\bar\\baz\\', false); +//=> 'foo/bar/baz/' +``` + +## About + +### Related projects + +* [contains-path](https://www.npmjs.com/package/contains-path): Return true if a file path contains the given path. | [homepage](https://github.com/jonschlinkert/contains-path "Return true if a file path contains the given path.") +* [ends-with](https://www.npmjs.com/package/ends-with): Returns `true` if the given `string` or `array` ends with `suffix` using strict equality for… [more](https://github.com/jonschlinkert/ends-with) | [homepage](https://github.com/jonschlinkert/ends-with "Returns `true` if the given `string` or `array` ends with `suffix` using strict equality for comparisons.") +* [is-absolute](https://www.npmjs.com/package/is-absolute): Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute. | [homepage](https://github.com/jonschlinkert/is-absolute "Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute.") +* [is-relative](https://www.npmjs.com/package/is-relative): Returns `true` if the path appears to be relative. | [homepage](https://github.com/jonschlinkert/is-relative "Returns `true` if the path appears to be relative.") +* [parse-filepath](https://www.npmjs.com/package/parse-filepath): Pollyfill for node.js `path.parse`, parses a filepath into an object. | [homepage](https://github.com/jonschlinkert/parse-filepath "Pollyfill for node.js `path.parse`, parses a filepath into an object.") +* [path-ends-with](https://www.npmjs.com/package/path-ends-with): Return `true` if a file path ends with the given string/suffix. | [homepage](https://github.com/jonschlinkert/path-ends-with "Return `true` if a file path ends with the given string/suffix.") +* [path-segments](https://www.npmjs.com/package/path-segments): Get n specific segments of a file path, e.g. first 2, last 3, etc. | [homepage](https://github.com/jonschlinkert/path-segments "Get n specific segments of a file path, e.g. first 2, last 3, etc.") +* [rewrite-ext](https://www.npmjs.com/package/rewrite-ext): Automatically re-write the destination extension of a filepath based on the source extension. e.g… [more](https://github.com/jonschlinkert/rewrite-ext) | [homepage](https://github.com/jonschlinkert/rewrite-ext "Automatically re-write the destination extension of a filepath based on the source extension. e.g `.coffee` => `.js`. This will only rename the ext, no other path parts are modified.") +* [unixify](https://www.npmjs.com/package/unixify): Convert Windows file paths to unix paths. | [homepage](https://github.com/jonschlinkert/unixify "Convert Windows file paths to unix paths.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 31 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [phated](https://github.com/phated) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.3, on March 29, 2017._ \ No newline at end of file diff --git a/node_modules/normalize-path/index.js b/node_modules/normalize-path/index.js new file mode 100644 index 000000000..4a4f8ccdb --- /dev/null +++ b/node_modules/normalize-path/index.js @@ -0,0 +1,19 @@ +/*! + * normalize-path + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +var removeTrailingSeparator = require('remove-trailing-separator'); + +module.exports = function normalizePath(str, stripTrailing) { + if (typeof str !== 'string') { + throw new TypeError('expected a string'); + } + str = str.replace(/[\\\/]+/g, '/'); + if (stripTrailing !== false) { + str = removeTrailingSeparator(str); + } + return str; +}; diff --git a/node_modules/normalize-path/package.json b/node_modules/normalize-path/package.json new file mode 100644 index 000000000..619111610 --- /dev/null +++ b/node_modules/normalize-path/package.json @@ -0,0 +1,118 @@ +{ + "_from": "normalize-path@^2.0.0", + "_id": "normalize-path@2.1.1", + "_inBundle": false, + "_integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "_location": "/normalize-path", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "normalize-path@^2.0.0", + "name": "normalize-path", + "escapedName": "normalize-path", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/anymatch", + "/micromatch" + ], + "_resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "_shasum": "1ab28b556e198363a8c1a6f7e6fa20137fe6aed9", + "_spec": "normalize-path@^2.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/anymatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/normalize-path/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com", + "url": "https://twitter.com/BlaineBublitz" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + } + ], + "dependencies": { + "remove-trailing-separator": "^1.0.1" + }, + "deprecated": false, + "description": "Normalize file path slashes to be unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes unless disabled.", + "devDependencies": { + "benchmarked": "^0.1.1", + "gulp-format-md": "^0.1.11", + "minimist": "^1.2.0", + "mocha": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/normalize-path", + "keywords": [ + "backslash", + "file", + "filepath", + "fix", + "forward", + "fp", + "fs", + "normalize", + "path", + "slash", + "slashes", + "trailing", + "unix", + "urix" + ], + "license": "MIT", + "main": "index.js", + "name": "normalize-path", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/normalize-path.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "contains-path", + "ends-with", + "is-absolute", + "is-relative", + "parse-filepath", + "path-ends-with", + "path-segments", + "rewrite-ext", + "unixify" + ], + "description": "Other useful libraries for working with paths in node.js:" + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + }, + "version": "2.1.1" +} diff --git a/node_modules/npm-run-path/index.js b/node_modules/npm-run-path/index.js new file mode 100644 index 000000000..56f31e471 --- /dev/null +++ b/node_modules/npm-run-path/index.js @@ -0,0 +1,39 @@ +'use strict'; +const path = require('path'); +const pathKey = require('path-key'); + +module.exports = opts => { + opts = Object.assign({ + cwd: process.cwd(), + path: process.env[pathKey()] + }, opts); + + let prev; + let pth = path.resolve(opts.cwd); + const ret = []; + + while (prev !== pth) { + ret.push(path.join(pth, 'node_modules/.bin')); + prev = pth; + pth = path.resolve(pth, '..'); + } + + // ensure the running `node` binary is used + ret.push(path.dirname(process.execPath)); + + return ret.concat(opts.path).join(path.delimiter); +}; + +module.exports.env = opts => { + opts = Object.assign({ + env: process.env + }, opts); + + const env = Object.assign({}, opts.env); + const path = pathKey({env}); + + opts.path = env[path]; + env[path] = module.exports(opts); + + return env; +}; diff --git a/node_modules/npm-run-path/license b/node_modules/npm-run-path/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/npm-run-path/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/npm-run-path/package.json b/node_modules/npm-run-path/package.json new file mode 100644 index 000000000..8d9813e8e --- /dev/null +++ b/node_modules/npm-run-path/package.json @@ -0,0 +1,77 @@ +{ + "_from": "npm-run-path@^2.0.0", + "_id": "npm-run-path@2.0.2", + "_inBundle": false, + "_integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "_location": "/npm-run-path", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "npm-run-path@^2.0.0", + "name": "npm-run-path", + "escapedName": "npm-run-path", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/execa" + ], + "_resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "_shasum": "35a9232dfa35d7067b4cb2ddf2357b1871536c5f", + "_spec": "npm-run-path@^2.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/execa", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/npm-run-path/issues" + }, + "bundleDependencies": false, + "dependencies": { + "path-key": "^2.0.0" + }, + "deprecated": false, + "description": "Get your PATH prepended with locally installed binaries", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/npm-run-path#readme", + "keywords": [ + "npm", + "run", + "path", + "package", + "bin", + "binary", + "binaries", + "script", + "cli", + "command-line", + "execute", + "executable" + ], + "license": "MIT", + "name": "npm-run-path", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/npm-run-path.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.2", + "xo": { + "esnext": true + } +} diff --git a/node_modules/npm-run-path/readme.md b/node_modules/npm-run-path/readme.md new file mode 100644 index 000000000..4ff4722a6 --- /dev/null +++ b/node_modules/npm-run-path/readme.md @@ -0,0 +1,81 @@ +# npm-run-path [![Build Status](https://travis-ci.org/sindresorhus/npm-run-path.svg?branch=master)](https://travis-ci.org/sindresorhus/npm-run-path) + +> Get your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) prepended with locally installed binaries + +In [npm run scripts](https://docs.npmjs.com/cli/run-script) you can execute locally installed binaries by name. This enables the same outside npm. + + +## Install + +``` +$ npm install --save npm-run-path +``` + + +## Usage + +```js +const childProcess = require('child_process'); +const npmRunPath = require('npm-run-path'); + +console.log(process.env.PATH); +//=> '/usr/local/bin' + +console.log(npmRunPath()); +//=> '/Users/sindresorhus/dev/foo/node_modules/.bin:/Users/sindresorhus/dev/node_modules/.bin:/Users/sindresorhus/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/usr/local/bin' + +// `foo` is a locally installed binary +childProcess.execFileSync('foo', { + env: npmRunPath.env() +}); +``` + + +## API + +### npmRunPath([options]) + +#### options + +##### cwd + +Type: `string`
+Default: `process.cwd()` + +Working directory. + +##### path + +Type: `string`
+Default: [`PATH`](https://github.com/sindresorhus/path-key) + +PATH to be appended.
+Set it to an empty string to exclude the default PATH. + +### npmRunPath.env([options]) + +#### options + +##### cwd + +Type: `string`
+Default: `process.cwd()` + +Working directory. + +##### env + +Type: `Object` + +Accepts an object of environment variables, like `process.env`, and modifies the PATH using the correct [PATH key](https://github.com/sindresorhus/path-key). Use this if you're modifying the PATH for use in the `child_process` options. + + +## Related + +- [npm-run-path-cli](https://github.com/sindresorhus/npm-run-path-cli) - CLI for this module +- [execa](https://github.com/sindresorhus/execa) - Execute a locally installed binary + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/number-is-nan/index.js b/node_modules/number-is-nan/index.js new file mode 100644 index 000000000..79be4b9cb --- /dev/null +++ b/node_modules/number-is-nan/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = Number.isNaN || function (x) { + return x !== x; +}; diff --git a/node_modules/number-is-nan/license b/node_modules/number-is-nan/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/number-is-nan/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/number-is-nan/package.json b/node_modules/number-is-nan/package.json new file mode 100644 index 000000000..813fd7c3e --- /dev/null +++ b/node_modules/number-is-nan/package.json @@ -0,0 +1,67 @@ +{ + "_from": "number-is-nan@^1.0.0", + "_id": "number-is-nan@1.0.1", + "_inBundle": false, + "_integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "_location": "/number-is-nan", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "number-is-nan@^1.0.0", + "name": "number-is-nan", + "escapedName": "number-is-nan", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/is-finite" + ], + "_resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "_shasum": "097b602b53422a522c1afb8790318336941a011d", + "_spec": "number-is-nan@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/is-finite", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/number-is-nan/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "ES2015 Number.isNaN() ponyfill", + "devDependencies": { + "ava": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/number-is-nan#readme", + "keywords": [ + "es2015", + "ecmascript", + "ponyfill", + "polyfill", + "shim", + "number", + "is", + "nan", + "not" + ], + "license": "MIT", + "name": "number-is-nan", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/number-is-nan.git" + }, + "scripts": { + "test": "ava" + }, + "version": "1.0.1" +} diff --git a/node_modules/number-is-nan/readme.md b/node_modules/number-is-nan/readme.md new file mode 100644 index 000000000..246350871 --- /dev/null +++ b/node_modules/number-is-nan/readme.md @@ -0,0 +1,28 @@ +# number-is-nan [![Build Status](https://travis-ci.org/sindresorhus/number-is-nan.svg?branch=master)](https://travis-ci.org/sindresorhus/number-is-nan) + +> ES2015 [`Number.isNaN()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) [ponyfill](https://ponyfill.com) + + +## Install + +``` +$ npm install --save number-is-nan +``` + + +## Usage + +```js +var numberIsNan = require('number-is-nan'); + +numberIsNan(NaN); +//=> true + +numberIsNan('unicorn'); +//=> false +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/object-assign/index.js b/node_modules/object-assign/index.js new file mode 100644 index 000000000..0930cf889 --- /dev/null +++ b/node_modules/object-assign/index.js @@ -0,0 +1,90 @@ +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + +'use strict'; +/* 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; +}; diff --git a/node_modules/object-assign/license b/node_modules/object-assign/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/object-assign/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/object-assign/package.json b/node_modules/object-assign/package.json new file mode 100644 index 000000000..100bf33da --- /dev/null +++ b/node_modules/object-assign/package.json @@ -0,0 +1,76 @@ +{ + "_from": "object-assign@^4.0.1", + "_id": "object-assign@4.1.1", + "_inBundle": false, + "_integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "_location": "/object-assign", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "object-assign@^4.0.1", + "name": "object-assign", + "escapedName": "object-assign", + "rawSpec": "^4.0.1", + "saveSpec": null, + "fetchSpec": "^4.0.1" + }, + "_requiredBy": [ + "/opn", + "/query-string", + "/watchify-middleware" + ], + "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "_shasum": "2109adc7965887cfc05cbbd442cac8bfbb360863", + "_spec": "object-assign@^4.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/opn", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/object-assign/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "ES2015 `Object.assign()` ponyfill", + "devDependencies": { + "ava": "^0.16.0", + "lodash": "^4.16.4", + "matcha": "^0.7.0", + "xo": "^0.16.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/object-assign#readme", + "keywords": [ + "object", + "assign", + "extend", + "properties", + "es2015", + "ecmascript", + "harmony", + "ponyfill", + "prollyfill", + "polyfill", + "shim", + "browser" + ], + "license": "MIT", + "name": "object-assign", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/object-assign.git" + }, + "scripts": { + "bench": "matcha bench.js", + "test": "xo && ava" + }, + "version": "4.1.1" +} diff --git a/node_modules/object-assign/readme.md b/node_modules/object-assign/readme.md new file mode 100644 index 000000000..1be09d35c --- /dev/null +++ b/node_modules/object-assign/readme.md @@ -0,0 +1,61 @@ +# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) + +> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com) + + +## Use the built-in + +Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari), +support `Object.assign()` :tada:. If you target only those environments, then by all +means, use `Object.assign()` instead of this package. + + +## Install + +``` +$ npm install --save object-assign +``` + + +## Usage + +```js +const objectAssign = require('object-assign'); + +objectAssign({foo: 0}, {bar: 1}); +//=> {foo: 0, bar: 1} + +// multiple sources +objectAssign({foo: 0}, {bar: 1}, {baz: 2}); +//=> {foo: 0, bar: 1, baz: 2} + +// overwrites equal keys +objectAssign({foo: 0}, {foo: 1}, {foo: 2}); +//=> {foo: 2} + +// ignores null and undefined sources +objectAssign({foo: 0}, null, {bar: 1}, undefined); +//=> {foo: 0, bar: 1} +``` + + +## API + +### objectAssign(target, [source, ...]) + +Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. + + +## Resources + +- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) + + +## Related + +- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/object-copy/LICENSE b/node_modules/object-copy/LICENSE new file mode 100644 index 000000000..e28e60323 --- /dev/null +++ b/node_modules/object-copy/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/object-copy/index.js b/node_modules/object-copy/index.js new file mode 100644 index 000000000..f9faa2235 --- /dev/null +++ b/node_modules/object-copy/index.js @@ -0,0 +1,174 @@ +'use strict'; + +var typeOf = require('kind-of'); +var copyDescriptor = require('copy-descriptor'); +var define = require('define-property'); + +/** + * Copy static properties, prototype properties, and descriptors from one object to another. + * + * ```js + * function App() {} + * var proto = App.prototype; + * App.prototype.set = function() {}; + * App.prototype.get = function() {}; + * + * var obj = {}; + * copy(obj, proto); + * ``` + * @param {Object} `receiver` + * @param {Object} `provider` + * @param {String|Array} `omit` One or more properties to omit + * @return {Object} + * @api public + */ + +function copy(receiver, provider, omit) { + if (!isObject(receiver)) { + throw new TypeError('expected receiving object to be an object.'); + } + if (!isObject(provider)) { + throw new TypeError('expected providing object to be an object.'); + } + + var props = nativeKeys(provider); + var keys = Object.keys(provider); + var len = props.length; + omit = arrayify(omit); + + while (len--) { + var key = props[len]; + + if (has(keys, key)) { + define(receiver, key, provider[key]); + } else if (!(key in receiver) && !has(omit, key)) { + copyDescriptor(receiver, provider, key); + } + } +}; + +/** + * Return true if the given value is an object or function + */ + +function isObject(val) { + return typeOf(val) === 'object' || typeof val === 'function'; +} + +/** + * Returns true if an array has any of the given elements, or an + * object has any of the give keys. + * + * ```js + * has(['a', 'b', 'c'], 'c'); + * //=> true + * + * has(['a', 'b', 'c'], ['c', 'z']); + * //=> true + * + * has({a: 'b', c: 'd'}, ['c', 'z']); + * //=> true + * ``` + * @param {Object} `obj` + * @param {String|Array} `val` + * @return {Boolean} + */ + +function has(obj, val) { + val = arrayify(val); + var len = val.length; + + if (isObject(obj)) { + for (var key in obj) { + if (val.indexOf(key) > -1) { + return true; + } + } + + var keys = nativeKeys(obj); + return has(keys, val); + } + + if (Array.isArray(obj)) { + var arr = obj; + while (len--) { + if (arr.indexOf(val[len]) > -1) { + return true; + } + } + return false; + } + + throw new TypeError('expected an array or object.'); +} + +/** + * Cast the given value to an array. + * + * ```js + * arrayify('foo'); + * //=> ['foo'] + * + * arrayify(['foo']); + * //=> ['foo'] + * ``` + * + * @param {String|Array} `val` + * @return {Array} + */ + +function arrayify(val) { + return val ? (Array.isArray(val) ? val : [val]) : []; +} + +/** + * Returns true if a value has a `contructor` + * + * ```js + * hasConstructor({}); + * //=> true + * + * hasConstructor(Object.create(null)); + * //=> false + * ``` + * @param {Object} `value` + * @return {Boolean} + */ + +function hasConstructor(val) { + return isObject(val) && typeof val.constructor !== 'undefined'; +} + +/** + * Get the native `ownPropertyNames` from the constructor of the + * given `object`. An empty array is returned if the object does + * not have a constructor. + * + * ```js + * nativeKeys({a: 'b', b: 'c', c: 'd'}) + * //=> ['a', 'b', 'c'] + * + * nativeKeys(function(){}) + * //=> ['length', 'caller'] + * ``` + * + * @param {Object} `obj` Object that has a `constructor`. + * @return {Array} Array of keys. + */ + +function nativeKeys(val) { + if (!hasConstructor(val)) return []; + return Object.getOwnPropertyNames(val); +} + +/** + * Expose `copy` + */ + +module.exports = copy; + +/** + * Expose `copy.has` for tests + */ + +module.exports.has = has; diff --git a/node_modules/object-copy/node_modules/define-property/LICENSE b/node_modules/object-copy/node_modules/define-property/LICENSE new file mode 100644 index 000000000..65f90aca8 --- /dev/null +++ b/node_modules/object-copy/node_modules/define-property/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/object-copy/node_modules/define-property/README.md b/node_modules/object-copy/node_modules/define-property/README.md new file mode 100644 index 000000000..8cac698ad --- /dev/null +++ b/node_modules/object-copy/node_modules/define-property/README.md @@ -0,0 +1,77 @@ +# define-property [![NPM version](https://badge.fury.io/js/define-property.svg)](http://badge.fury.io/js/define-property) + +> Define a non-enumerable property on an object. + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i define-property --save +``` + +## Usage + +**Params** + +* `obj`: The object on which to define the property. +* `prop`: The name of the property to be defined or modified. +* `descriptor`: The descriptor for the property being defined or modified. + +```js +var define = require('define-property'); +var obj = {}; +define(obj, 'foo', function(val) { + return val.toUpperCase(); +}); + +console.log(obj); +//=> {} + +console.log(obj.foo('bar')); +//=> 'BAR' +``` + +**get/set** + +```js +define(obj, 'foo', { + get: function() {}, + set: function() {} +}); +``` + +## Related projects + +* [delegate-object](https://www.npmjs.com/package/delegate-object): Copy properties from an object to another object, where properties with function values will be… [more](https://www.npmjs.com/package/delegate-object) | [homepage](https://github.com/doowb/delegate-object) +* [forward-object](https://www.npmjs.com/package/forward-object): Copy properties from an object to another object, where properties with function values will be… [more](https://www.npmjs.com/package/forward-object) | [homepage](https://github.com/doowb/forward-object) +* [mixin-deep](https://www.npmjs.com/package/mixin-deep): Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. | [homepage](https://github.com/jonschlinkert/mixin-deep) +* [mixin-object](https://www.npmjs.com/package/mixin-object): Mixin the own and inherited properties of other objects onto the first object. Pass an… [more](https://www.npmjs.com/package/mixin-object) | [homepage](https://github.com/jonschlinkert/mixin-object) + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/define-property/issues/new). + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 31, 2015._ diff --git a/node_modules/object-copy/node_modules/define-property/index.js b/node_modules/object-copy/node_modules/define-property/index.js new file mode 100644 index 000000000..3e0e5e133 --- /dev/null +++ b/node_modules/object-copy/node_modules/define-property/index.js @@ -0,0 +1,31 @@ +/*! + * define-property + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var isDescriptor = require('is-descriptor'); + +module.exports = function defineProperty(obj, prop, val) { + if (typeof obj !== 'object' && typeof obj !== 'function') { + throw new TypeError('expected an object or function.'); + } + + if (typeof prop !== 'string') { + throw new TypeError('expected `prop` to be a string.'); + } + + if (isDescriptor(val) && ('set' in val || 'get' in val)) { + return Object.defineProperty(obj, prop, val); + } + + return Object.defineProperty(obj, prop, { + configurable: true, + enumerable: false, + writable: true, + value: val + }); +}; diff --git a/node_modules/object-copy/node_modules/define-property/package.json b/node_modules/object-copy/node_modules/define-property/package.json new file mode 100644 index 000000000..c1c6e4250 --- /dev/null +++ b/node_modules/object-copy/node_modules/define-property/package.json @@ -0,0 +1,82 @@ +{ + "_from": "define-property@^0.2.5", + "_id": "define-property@0.2.5", + "_inBundle": false, + "_integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "_location": "/object-copy/define-property", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "define-property@^0.2.5", + "name": "define-property", + "escapedName": "define-property", + "rawSpec": "^0.2.5", + "saveSpec": null, + "fetchSpec": "^0.2.5" + }, + "_requiredBy": [ + "/object-copy" + ], + "_resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "_shasum": "c35b1ef918ec3c990f9a5bc57be04aacec5c8116", + "_spec": "define-property@^0.2.5", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/object-copy", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/define-property/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "deprecated": false, + "description": "Define a non-enumerable property on an object.", + "devDependencies": { + "mocha": "*", + "should": "^7.0.4" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/define-property", + "keywords": [ + "define", + "define-property", + "enumerable", + "key", + "non", + "non-enumerable", + "object", + "prop", + "property", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "define-property", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/define-property.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "mixin-deep", + "mixin-object", + "delegate-object", + "forward-object" + ] + } + }, + "version": "0.2.5" +} diff --git a/node_modules/object-copy/package.json b/node_modules/object-copy/package.json new file mode 100644 index 000000000..c35b48781 --- /dev/null +++ b/node_modules/object-copy/package.json @@ -0,0 +1,80 @@ +{ + "_from": "object-copy@^0.1.0", + "_id": "object-copy@0.1.0", + "_inBundle": false, + "_integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "_location": "/object-copy", + "_phantomChildren": { + "is-descriptor": "0.1.6" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "object-copy@^0.1.0", + "name": "object-copy", + "escapedName": "object-copy", + "rawSpec": "^0.1.0", + "saveSpec": null, + "fetchSpec": "^0.1.0" + }, + "_requiredBy": [ + "/static-extend" + ], + "_resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "_shasum": "7e7d858b781bd7c991a41ba975ed3812754e998c", + "_spec": "object-copy@^0.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/static-extend", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/object-copy/issues" + }, + "bundleDependencies": false, + "dependencies": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "deprecated": false, + "description": "Copy static properties, prototype properties, and descriptors from one object to another.", + "devDependencies": { + "gulp-format-md": "*", + "mocha": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/object-copy", + "keywords": [ + "copy", + "object" + ], + "license": "MIT", + "main": "index.js", + "name": "object-copy", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/object-copy.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "layout": "default", + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [] + }, + "reflinks": [ + "verb" + ] + }, + "version": "0.1.0" +} diff --git a/node_modules/object-visit/LICENSE b/node_modules/object-visit/LICENSE new file mode 100644 index 000000000..ec85897eb --- /dev/null +++ b/node_modules/object-visit/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, 2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/object-visit/README.md b/node_modules/object-visit/README.md new file mode 100644 index 000000000..64015cb9a --- /dev/null +++ b/node_modules/object-visit/README.md @@ -0,0 +1,83 @@ +# object-visit [![NPM version](https://img.shields.io/npm/v/object-visit.svg?style=flat)](https://www.npmjs.com/package/object-visit) [![NPM monthly downloads](https://img.shields.io/npm/dm/object-visit.svg?style=flat)](https://npmjs.org/package/object-visit) [![NPM total downloads](https://img.shields.io/npm/dt/object-visit.svg?style=flat)](https://npmjs.org/package/object-visit) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/object-visit.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/object-visit) + +> Call a specified method on each value in the given object. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save object-visit +``` + +## Usage + +```js +var visit = require('object-visit'); + +var ctx = { + data: {}, + set: function (key, value) { + if (typeof key === 'object') { + visit(ctx, 'set', key); + } else { + ctx.data[key] = value; + } + } +}; + +ctx.set('a', 'a'); +ctx.set('b', 'b'); +ctx.set('c', 'c'); +ctx.set({d: {e: 'f'}}); + +console.log(ctx.data); +//=> {a: 'a', b: 'b', c: 'c', d: { e: 'f' }}; +``` + +## About + +### Related projects + +* [base-methods](https://www.npmjs.com/package/base-methods): base-methods is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… [more](https://github.com/jonschlinkert/base-methods) | [homepage](https://github.com/jonschlinkert/base-methods "base-methods is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting with a handful of common methods, like `set`, `get`, `del` and `use`.") +* [collection-visit](https://www.npmjs.com/package/collection-visit): Visit a method over the items in an object, or map visit over the objects… [more](https://github.com/jonschlinkert/collection-visit) | [homepage](https://github.com/jonschlinkert/collection-visit "Visit a method over the items in an object, or map visit over the objects in an array.") +* [define-property](https://www.npmjs.com/package/define-property): Define a non-enumerable property on an object. | [homepage](https://github.com/jonschlinkert/define-property "Define a non-enumerable property on an object.") +* [map-visit](https://www.npmjs.com/package/map-visit): Map `visit` over an array of objects. | [homepage](https://github.com/jonschlinkert/map-visit "Map `visit` over an array of objects.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 30, 2017._ \ No newline at end of file diff --git a/node_modules/object-visit/index.js b/node_modules/object-visit/index.js new file mode 100644 index 000000000..fcaeda925 --- /dev/null +++ b/node_modules/object-visit/index.js @@ -0,0 +1,33 @@ +/*! + * object-visit + * + * Copyright (c) 2015, 2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var isObject = require('isobject'); + +module.exports = function visit(thisArg, method, target, val) { + if (!isObject(thisArg) && typeof thisArg !== 'function') { + throw new Error('object-visit expects `thisArg` to be an object.'); + } + + if (typeof method !== 'string') { + throw new Error('object-visit expects `method` name to be a string'); + } + + if (typeof thisArg[method] !== 'function') { + return thisArg; + } + + var args = [].slice.call(arguments, 3); + target = target || {}; + + for (var key in target) { + var arr = [key, target[key]].concat(args); + thisArg[method].apply(thisArg, arr); + } + return thisArg; +}; diff --git a/node_modules/object-visit/node_modules/isobject/LICENSE b/node_modules/object-visit/node_modules/isobject/LICENSE new file mode 100644 index 000000000..943e71d05 --- /dev/null +++ b/node_modules/object-visit/node_modules/isobject/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +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. \ No newline at end of file diff --git a/node_modules/object-visit/node_modules/isobject/README.md b/node_modules/object-visit/node_modules/isobject/README.md new file mode 100644 index 000000000..d01feaa40 --- /dev/null +++ b/node_modules/object-visit/node_modules/isobject/README.md @@ -0,0 +1,122 @@ +# isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM monthly downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![NPM total downloads](https://img.shields.io/npm/dt/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/isobject) + +> Returns true if the value is an object and not an array or null. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save isobject +``` + +Install with [yarn](https://yarnpkg.com): + +```sh +$ yarn add isobject +``` + +Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install isobject +``` +Install with [bower](https://bower.io/) + +```sh +$ bower install isobject +``` + +## Usage + +```js +var isObject = require('isobject'); +``` + +**True** + +All of the following return `true`: + +```js +isObject({}); +isObject(Object.create({})); +isObject(Object.create(Object.prototype)); +isObject(Object.create(null)); +isObject({}); +isObject(new Foo); +isObject(/foo/); +``` + +**False** + +All of the following return `false`: + +```js +isObject(); +isObject(function () {}); +isObject(1); +isObject([]); +isObject(undefined); +isObject(null); +``` + +## About + +### Related projects + +* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") +* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 29 | [jonschlinkert](https://github.com/jonschlinkert) | +| 4 | [doowb](https://github.com/doowb) | +| 1 | [magnudae](https://github.com/magnudae) | +| 1 | [LeSuisse](https://github.com/LeSuisse) | +| 1 | [tmcw](https://github.com/tmcw) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 30, 2017._ \ No newline at end of file diff --git a/node_modules/object-visit/node_modules/isobject/index.d.ts b/node_modules/object-visit/node_modules/isobject/index.d.ts new file mode 100644 index 000000000..55f81c275 --- /dev/null +++ b/node_modules/object-visit/node_modules/isobject/index.d.ts @@ -0,0 +1,5 @@ +export = isObject; + +declare function isObject(val: any): boolean; + +declare namespace isObject {} diff --git a/node_modules/object-visit/node_modules/isobject/index.js b/node_modules/object-visit/node_modules/isobject/index.js new file mode 100644 index 000000000..2d59958bf --- /dev/null +++ b/node_modules/object-visit/node_modules/isobject/index.js @@ -0,0 +1,12 @@ +/*! + * isobject + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +module.exports = function isObject(val) { + return val != null && typeof val === 'object' && Array.isArray(val) === false; +}; diff --git a/node_modules/object-visit/node_modules/isobject/package.json b/node_modules/object-visit/node_modules/isobject/package.json new file mode 100644 index 000000000..093e77ccb --- /dev/null +++ b/node_modules/object-visit/node_modules/isobject/package.json @@ -0,0 +1,119 @@ +{ + "_from": "isobject@^3.0.0", + "_id": "isobject@3.0.1", + "_inBundle": false, + "_integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "_location": "/object-visit/isobject", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "isobject@^3.0.0", + "name": "isobject", + "escapedName": "isobject", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/object-visit" + ], + "_resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "_shasum": "4e431e92b11a9731636aa1f9c8d1ccbcfdab78df", + "_spec": "isobject@^3.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/object-visit", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/isobject/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "url": "https://github.com/LeSuisse" + }, + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Magnús Dæhlen", + "url": "https://github.com/magnudae" + }, + { + "name": "Tom MacWright", + "url": "https://macwright.org" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Returns true if the value is an object and not an array or null.", + "devDependencies": { + "gulp-format-md": "^0.1.9", + "mocha": "^2.4.5" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.d.ts", + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/isobject", + "keywords": [ + "check", + "is", + "is-object", + "isobject", + "kind", + "kind-of", + "kindof", + "native", + "object", + "type", + "typeof", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "isobject", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/isobject.git" + }, + "scripts": { + "test": "mocha" + }, + "types": "index.d.ts", + "verb": { + "related": { + "list": [ + "extend-shallow", + "is-plain-object", + "kind-of", + "merge-deep" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb" + ] + }, + "version": "3.0.1" +} diff --git a/node_modules/object-visit/package.json b/node_modules/object-visit/package.json new file mode 100644 index 000000000..94d0f7b1c --- /dev/null +++ b/node_modules/object-visit/package.json @@ -0,0 +1,97 @@ +{ + "_from": "object-visit@^1.0.0", + "_id": "object-visit@1.0.1", + "_inBundle": false, + "_integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "_location": "/object-visit", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "object-visit@^1.0.0", + "name": "object-visit", + "escapedName": "object-visit", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/collection-visit", + "/map-visit" + ], + "_resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "_shasum": "f79c4493af0c5377b59fe39d395e41042dd045bb", + "_spec": "object-visit@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/collection-visit", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/object-visit/issues" + }, + "bundleDependencies": false, + "dependencies": { + "isobject": "^3.0.0" + }, + "deprecated": false, + "description": "Call a specified method on each value in the given object.", + "devDependencies": { + "gulp": "^3.9.1", + "gulp-eslint": "^3.0.1", + "gulp-format-md": "^0.1.12", + "gulp-istanbul": "^1.1.1", + "gulp-mocha": "^3.0.0", + "mocha": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/object-visit", + "keywords": [ + "context", + "function", + "helper", + "key", + "method", + "object", + "value", + "visit", + "visitor" + ], + "license": "MIT", + "main": "index.js", + "name": "object-visit", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/object-visit.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "base-methods", + "collection-visit", + "define-property", + "map-visit" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.1" +} diff --git a/node_modules/object.omit/LICENSE b/node_modules/object.omit/LICENSE new file mode 100644 index 000000000..842218cf0 --- /dev/null +++ b/node_modules/object.omit/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/object.omit/README.md b/node_modules/object.omit/README.md new file mode 100644 index 000000000..246efe092 --- /dev/null +++ b/node_modules/object.omit/README.md @@ -0,0 +1,118 @@ +# object.omit [![NPM version](https://img.shields.io/npm/v/object.omit.svg?style=flat)](https://www.npmjs.com/package/object.omit) [![NPM monthly downloads](https://img.shields.io/npm/dm/object.omit.svg?style=flat)](https://npmjs.org/package/object.omit) [![NPM total downloads](https://img.shields.io/npm/dt/object.omit.svg?style=flat)](https://npmjs.org/package/object.omit) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/object.omit.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/object.omit) + +> Return a copy of an object excluding the given key, or array of keys. Also accepts an optional filter function as the last argument. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save object.omit +``` + +## Usage + +```js +var omit = require('object.omit'); +``` + +Pass a string `key` to omit: + +```js +omit({a: 'a', b: 'b', c: 'c'}, 'a') +//=> { b: 'b', c: 'c' } +``` + +Pass an array of `keys` to omit: + +```js +omit({a: 'a', b: 'b', c: 'c'}, ['a', 'c']) +//=> { b: 'b' } +``` + +Returns the object if no keys are passed: + +```js +omit({a: 'a', b: 'b', c: 'c'}) +//=> {a: 'a', b: 'b', c: 'c'} +``` + +Returns an empty object if no value is passed. + +```js +omit() +//=> {} +``` + +### Filter function + +An optional filter function may be passed as the last argument, with or without keys passed on the arguments: + +**filter on keys** + +```js +var res = omit({a: 'a', b: 'b', c: 'c'}, function (val, key) { + return key === 'a'; +}); +//=> {a: 'a'} +``` + +**filter on values** + +```js +var fn = function() {}; +var obj = {a: 'a', b: 'b', c: fn}; + +var res = omit(obj, ['a'], function (val, key) { + return typeof val !== 'function'; +}); +//=> {b: 'b'} +``` + +## About + +### Related projects + +* [object.defaults](https://www.npmjs.com/package/object.defaults): Like `extend` but only copies missing properties/values to the target object. | [homepage](https://github.com/jonschlinkert/object.defaults "Like `extend` but only copies missing properties/values to the target object.") +* [object.filter](https://www.npmjs.com/package/object.filter): Create a new object filtered to have only properties for which the callback returns true. | [homepage](https://github.com/jonschlinkert/object.filter "Create a new object filtered to have only properties for which the callback returns true.") +* [object.pick](https://www.npmjs.com/package/object.pick): Returns a filtered copy of an object with only the specified keys, similar to `_.pick… [more](https://github.com/jonschlinkert/object.pick) | [homepage](https://github.com/jonschlinkert/object.pick "Returns a filtered copy of an object with only the specified keys, similar to`_.pick` from lodash / underscore.") +* [object.pluck](https://www.npmjs.com/package/object.pluck): Like pluck from underscore / lo-dash, but returns an object composed of specified properties, with… [more](https://github.com/jonschlinkert/object.pluck) | [homepage](https://github.com/jonschlinkert/object.pluck "Like pluck from underscore / lo-dash, but returns an object composed of specified properties, with values unmodified from those of the original object.") +* [object.reduce](https://www.npmjs.com/package/object.reduce): Reduces an object to a value that is the accumulated result of running each property… [more](https://github.com/jonschlinkert/object.reduce) | [homepage](https://github.com/jonschlinkert/object.reduce "Reduces an object to a value that is the accumulated result of running each property in the object through a callback.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/object.omit/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on October 27, 2016._ \ No newline at end of file diff --git a/node_modules/object.omit/index.js b/node_modules/object.omit/index.js new file mode 100644 index 000000000..503a3c303 --- /dev/null +++ b/node_modules/object.omit/index.js @@ -0,0 +1,40 @@ +/*! + * object.omit + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var isObject = require('is-extendable'); +var forOwn = require('for-own'); + +module.exports = function omit(obj, keys) { + if (!isObject(obj)) return {}; + + keys = [].concat.apply([], [].slice.call(arguments, 1)); + var last = keys[keys.length - 1]; + var res = {}, fn; + + if (typeof last === 'function') { + fn = keys.pop(); + } + + var isFunction = typeof fn === 'function'; + if (!keys.length && !isFunction) { + return obj; + } + + forOwn(obj, function(value, key) { + if (keys.indexOf(key) === -1) { + + if (!isFunction) { + res[key] = value; + } else if (fn(value, key, obj)) { + res[key] = value; + } + } + }); + return res; +}; diff --git a/node_modules/object.omit/package.json b/node_modules/object.omit/package.json new file mode 100644 index 000000000..f361a8de1 --- /dev/null +++ b/node_modules/object.omit/package.json @@ -0,0 +1,98 @@ +{ + "_from": "object.omit@^2.0.0", + "_id": "object.omit@2.0.1", + "_inBundle": false, + "_integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "_location": "/object.omit", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "object.omit@^2.0.0", + "name": "object.omit", + "escapedName": "object.omit", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/micromatch" + ], + "_resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "_shasum": "1a9c744829f39dbb858c76ca3579ae2a54ebd1fa", + "_spec": "object.omit@^2.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/object.omit/issues" + }, + "bundleDependencies": false, + "dependencies": { + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" + }, + "deprecated": false, + "description": "Return a copy of an object excluding the given key, or array of keys. Also accepts an optional filter function as the last argument.", + "devDependencies": { + "gulp-format-md": "^0.1.11", + "mocha": "^3.1.2", + "should": "^11.1.1" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/object.omit", + "keywords": [ + "clear", + "delete", + "key", + "object", + "omit", + "property", + "remove", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "object.omit", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/object.omit.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "object.defaults", + "object.filter", + "object.pick", + "object.pluck", + "object.reduce" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ] + }, + "version": "2.0.1" +} diff --git a/node_modules/object.pick/LICENSE b/node_modules/object.pick/LICENSE new file mode 100644 index 000000000..39245ac1c --- /dev/null +++ b/node_modules/object.pick/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/object.pick/README.md b/node_modules/object.pick/README.md new file mode 100644 index 000000000..48f745348 --- /dev/null +++ b/node_modules/object.pick/README.md @@ -0,0 +1,76 @@ +# object.pick [![NPM version](https://img.shields.io/npm/v/object.pick.svg?style=flat)](https://www.npmjs.com/package/object.pick) [![NPM monthly downloads](https://img.shields.io/npm/dm/object.pick.svg?style=flat)](https://npmjs.org/package/object.pick) [![NPM total downloads](https://img.shields.io/npm/dt/object.pick.svg?style=flat)](https://npmjs.org/package/object.pick) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/object.pick.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/object.pick) + +> Returns a filtered copy of an object with only the specified keys, similar to `_.pick` from lodash / underscore. + +You might also be interested in [object.omit](https://github.com/jonschlinkert/object.omit). + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save object.pick +``` + +## benchmarks + +This is the [fastest implementation](http://jsperf.com/pick-props) I tested. Pull requests welcome! + +## Usage + +```js +var pick = require('object.pick'); + +pick({a: 'a', b: 'b'}, 'a') +//=> {a: 'a'} + +pick({a: 'a', b: 'b', c: 'c'}, ['a', 'b']) +//=> {a: 'a', b: 'b'} +``` + +## About + +### Related projects + +* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") +* [get-value](https://www.npmjs.com/package/get-value): Use property paths (`a.b.c`) to get a nested value from an object. | [homepage](https://github.com/jonschlinkert/get-value "Use property paths (`a.b.c`) to get a nested value from an object.") +* [mixin-deep](https://www.npmjs.com/package/mixin-deep): Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. | [homepage](https://github.com/jonschlinkert/mixin-deep "Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone.") +* [set-value](https://www.npmjs.com/package/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/jonschlinkert/set-value "Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/object.pick/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on October 27, 2016._ \ No newline at end of file diff --git a/node_modules/object.pick/index.js b/node_modules/object.pick/index.js new file mode 100644 index 000000000..0ce01782a --- /dev/null +++ b/node_modules/object.pick/index.js @@ -0,0 +1,35 @@ +/*! + * object.pick + * + * Copyright (c) 2014-2015 Jon Schlinkert, contributors. + * Licensed under the MIT License + */ + +'use strict'; + +var isObject = require('isobject'); + +module.exports = function pick(obj, keys) { + if (!isObject(obj) && typeof obj !== 'function') { + return {}; + } + + var res = {}; + if (typeof keys === 'string') { + if (keys in obj) { + res[keys] = obj[keys]; + } + return res; + } + + var len = keys.length; + var idx = -1; + + while (++idx < len) { + var key = keys[idx]; + if (key in obj) { + res[key] = obj[key]; + } + } + return res; +}; diff --git a/node_modules/object.pick/node_modules/isobject/LICENSE b/node_modules/object.pick/node_modules/isobject/LICENSE new file mode 100644 index 000000000..943e71d05 --- /dev/null +++ b/node_modules/object.pick/node_modules/isobject/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +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. \ No newline at end of file diff --git a/node_modules/object.pick/node_modules/isobject/README.md b/node_modules/object.pick/node_modules/isobject/README.md new file mode 100644 index 000000000..d01feaa40 --- /dev/null +++ b/node_modules/object.pick/node_modules/isobject/README.md @@ -0,0 +1,122 @@ +# isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM monthly downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![NPM total downloads](https://img.shields.io/npm/dt/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/isobject) + +> Returns true if the value is an object and not an array or null. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save isobject +``` + +Install with [yarn](https://yarnpkg.com): + +```sh +$ yarn add isobject +``` + +Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install isobject +``` +Install with [bower](https://bower.io/) + +```sh +$ bower install isobject +``` + +## Usage + +```js +var isObject = require('isobject'); +``` + +**True** + +All of the following return `true`: + +```js +isObject({}); +isObject(Object.create({})); +isObject(Object.create(Object.prototype)); +isObject(Object.create(null)); +isObject({}); +isObject(new Foo); +isObject(/foo/); +``` + +**False** + +All of the following return `false`: + +```js +isObject(); +isObject(function () {}); +isObject(1); +isObject([]); +isObject(undefined); +isObject(null); +``` + +## About + +### Related projects + +* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") +* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 29 | [jonschlinkert](https://github.com/jonschlinkert) | +| 4 | [doowb](https://github.com/doowb) | +| 1 | [magnudae](https://github.com/magnudae) | +| 1 | [LeSuisse](https://github.com/LeSuisse) | +| 1 | [tmcw](https://github.com/tmcw) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 30, 2017._ \ No newline at end of file diff --git a/node_modules/object.pick/node_modules/isobject/index.d.ts b/node_modules/object.pick/node_modules/isobject/index.d.ts new file mode 100644 index 000000000..55f81c275 --- /dev/null +++ b/node_modules/object.pick/node_modules/isobject/index.d.ts @@ -0,0 +1,5 @@ +export = isObject; + +declare function isObject(val: any): boolean; + +declare namespace isObject {} diff --git a/node_modules/object.pick/node_modules/isobject/index.js b/node_modules/object.pick/node_modules/isobject/index.js new file mode 100644 index 000000000..2d59958bf --- /dev/null +++ b/node_modules/object.pick/node_modules/isobject/index.js @@ -0,0 +1,12 @@ +/*! + * isobject + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +module.exports = function isObject(val) { + return val != null && typeof val === 'object' && Array.isArray(val) === false; +}; diff --git a/node_modules/object.pick/node_modules/isobject/package.json b/node_modules/object.pick/node_modules/isobject/package.json new file mode 100644 index 000000000..eff09e365 --- /dev/null +++ b/node_modules/object.pick/node_modules/isobject/package.json @@ -0,0 +1,119 @@ +{ + "_from": "isobject@^3.0.1", + "_id": "isobject@3.0.1", + "_inBundle": false, + "_integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "_location": "/object.pick/isobject", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "isobject@^3.0.1", + "name": "isobject", + "escapedName": "isobject", + "rawSpec": "^3.0.1", + "saveSpec": null, + "fetchSpec": "^3.0.1" + }, + "_requiredBy": [ + "/object.pick" + ], + "_resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "_shasum": "4e431e92b11a9731636aa1f9c8d1ccbcfdab78df", + "_spec": "isobject@^3.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/object.pick", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/isobject/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "url": "https://github.com/LeSuisse" + }, + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Magnús Dæhlen", + "url": "https://github.com/magnudae" + }, + { + "name": "Tom MacWright", + "url": "https://macwright.org" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Returns true if the value is an object and not an array or null.", + "devDependencies": { + "gulp-format-md": "^0.1.9", + "mocha": "^2.4.5" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.d.ts", + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/isobject", + "keywords": [ + "check", + "is", + "is-object", + "isobject", + "kind", + "kind-of", + "kindof", + "native", + "object", + "type", + "typeof", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "isobject", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/isobject.git" + }, + "scripts": { + "test": "mocha" + }, + "types": "index.d.ts", + "verb": { + "related": { + "list": [ + "extend-shallow", + "is-plain-object", + "kind-of", + "merge-deep" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb" + ] + }, + "version": "3.0.1" +} diff --git a/node_modules/object.pick/package.json b/node_modules/object.pick/package.json new file mode 100644 index 000000000..bd6119720 --- /dev/null +++ b/node_modules/object.pick/package.json @@ -0,0 +1,92 @@ +{ + "_from": "object.pick@^1.3.0", + "_id": "object.pick@1.3.0", + "_inBundle": false, + "_integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "_location": "/object.pick", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "object.pick@^1.3.0", + "name": "object.pick", + "escapedName": "object.pick", + "rawSpec": "^1.3.0", + "saveSpec": null, + "fetchSpec": "^1.3.0" + }, + "_requiredBy": [ + "/nanomatch", + "/readdirp/micromatch" + ], + "_resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "_shasum": "87a10ac4c1694bd2e1cbf53591a66141fb5dd747", + "_spec": "object.pick@^1.3.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/object.pick/issues" + }, + "bundleDependencies": false, + "dependencies": { + "isobject": "^3.0.1" + }, + "deprecated": false, + "description": "Returns a filtered copy of an object with only the specified keys, similar to `_.pick` from lodash / underscore.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.1.2", + "vinyl": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/object.pick", + "keywords": [ + "object", + "pick" + ], + "license": "MIT", + "main": "index.js", + "name": "object.pick", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/object.pick.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "extend-shallow", + "get-value", + "mixin-deep", + "set-value" + ], + "highlight": "object.omit" + }, + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.3.0" +} diff --git a/node_modules/on-finished/HISTORY.md b/node_modules/on-finished/HISTORY.md new file mode 100644 index 000000000..98ff0e992 --- /dev/null +++ b/node_modules/on-finished/HISTORY.md @@ -0,0 +1,88 @@ +2.3.0 / 2015-05-26 +================== + + * Add defined behavior for HTTP `CONNECT` requests + * Add defined behavior for HTTP `Upgrade` requests + * deps: ee-first@1.1.1 + +2.2.1 / 2015-04-22 +================== + + * Fix `isFinished(req)` when data buffered + +2.2.0 / 2014-12-22 +================== + + * Add message object to callback arguments + +2.1.1 / 2014-10-22 +================== + + * Fix handling of pipelined requests + +2.1.0 / 2014-08-16 +================== + + * Check if `socket` is detached + * Return `undefined` for `isFinished` if state unknown + +2.0.0 / 2014-08-16 +================== + + * Add `isFinished` function + * Move to `jshttp` organization + * Remove support for plain socket argument + * Rename to `on-finished` + * Support both `req` and `res` as arguments + * deps: ee-first@1.0.5 + +1.2.2 / 2014-06-10 +================== + + * Reduce listeners added to emitters + - avoids "event emitter leak" warnings when used multiple times on same request + +1.2.1 / 2014-06-08 +================== + + * Fix returned value when already finished + +1.2.0 / 2014-06-05 +================== + + * Call callback when called on already-finished socket + +1.1.4 / 2014-05-27 +================== + + * Support node.js 0.8 + +1.1.3 / 2014-04-30 +================== + + * Make sure errors passed as instanceof `Error` + +1.1.2 / 2014-04-18 +================== + + * Default the `socket` to passed-in object + +1.1.1 / 2014-01-16 +================== + + * Rename module to `finished` + +1.1.0 / 2013-12-25 +================== + + * Call callback when called on already-errored socket + +1.0.1 / 2013-12-20 +================== + + * Actually pass the error to the callback + +1.0.0 / 2013-12-20 +================== + + * Initial release diff --git a/node_modules/on-finished/LICENSE b/node_modules/on-finished/LICENSE new file mode 100644 index 000000000..5931fd23e --- /dev/null +++ b/node_modules/on-finished/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2013 Jonathan Ong +Copyright (c) 2014 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/on-finished/README.md b/node_modules/on-finished/README.md new file mode 100644 index 000000000..a0e115744 --- /dev/null +++ b/node_modules/on-finished/README.md @@ -0,0 +1,154 @@ +# on-finished + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Execute a callback when a HTTP request closes, finishes, or errors. + +## Install + +```sh +$ npm install on-finished +``` + +## API + +```js +var onFinished = require('on-finished') +``` + +### onFinished(res, listener) + +Attach a listener to listen for the response to finish. The listener will +be invoked only once when the response finished. If the response finished +to an error, the first argument will contain the error. If the response +has already finished, the listener will be invoked. + +Listening to the end of a response would be used to close things associated +with the response, like open files. + +Listener is invoked as `listener(err, res)`. + +```js +onFinished(res, function (err, res) { + // clean up open fds, etc. + // err contains the error is request error'd +}) +``` + +### onFinished(req, listener) + +Attach a listener to listen for the request to finish. The listener will +be invoked only once when the request finished. If the request finished +to an error, the first argument will contain the error. If the request +has already finished, the listener will be invoked. + +Listening to the end of a request would be used to know when to continue +after reading the data. + +Listener is invoked as `listener(err, req)`. + +```js +var data = '' + +req.setEncoding('utf8') +res.on('data', function (str) { + data += str +}) + +onFinished(req, function (err, req) { + // data is read unless there is err +}) +``` + +### onFinished.isFinished(res) + +Determine if `res` is already finished. This would be useful to check and +not even start certain operations if the response has already finished. + +### onFinished.isFinished(req) + +Determine if `req` is already finished. This would be useful to check and +not even start certain operations if the request has already finished. + +## Special Node.js requests + +### HTTP CONNECT method + +The meaning of the `CONNECT` method from RFC 7231, section 4.3.6: + +> The CONNECT method requests that the recipient establish a tunnel to +> the destination origin server identified by the request-target and, +> if successful, thereafter restrict its behavior to blind forwarding +> of packets, in both directions, until the tunnel is closed. Tunnels +> are commonly used to create an end-to-end virtual connection, through +> one or more proxies, which can then be secured using TLS (Transport +> Layer Security, [RFC5246]). + +In Node.js, these request objects come from the `'connect'` event on +the HTTP server. + +When this module is used on a HTTP `CONNECT` request, the request is +considered "finished" immediately, **due to limitations in the Node.js +interface**. This means if the `CONNECT` request contains a request entity, +the request will be considered "finished" even before it has been read. + +There is no such thing as a response object to a `CONNECT` request in +Node.js, so there is no support for for one. + +### HTTP Upgrade request + +The meaning of the `Upgrade` header from RFC 7230, section 6.1: + +> The "Upgrade" header field is intended to provide a simple mechanism +> for transitioning from HTTP/1.1 to some other protocol on the same +> connection. + +In Node.js, these request objects come from the `'upgrade'` event on +the HTTP server. + +When this module is used on a HTTP request with an `Upgrade` header, the +request is considered "finished" immediately, **due to limitations in the +Node.js interface**. This means if the `Upgrade` request contains a request +entity, the request will be considered "finished" even before it has been +read. + +There is no such thing as a response object to a `Upgrade` request in +Node.js, so there is no support for for one. + +## Example + +The following code ensures that file descriptors are always closed +once the response finishes. + +```js +var destroy = require('destroy') +var http = require('http') +var onFinished = require('on-finished') + +http.createServer(function onRequest(req, res) { + var stream = fs.createReadStream('package.json') + stream.pipe(res) + onFinished(res, function (err) { + destroy(stream) + }) +}) +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/on-finished.svg +[npm-url]: https://npmjs.org/package/on-finished +[node-version-image]: https://img.shields.io/node/v/on-finished.svg +[node-version-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/jshttp/on-finished/master.svg +[travis-url]: https://travis-ci.org/jshttp/on-finished +[coveralls-image]: https://img.shields.io/coveralls/jshttp/on-finished/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/on-finished?branch=master +[downloads-image]: https://img.shields.io/npm/dm/on-finished.svg +[downloads-url]: https://npmjs.org/package/on-finished diff --git a/node_modules/on-finished/index.js b/node_modules/on-finished/index.js new file mode 100644 index 000000000..9abd98f9d --- /dev/null +++ b/node_modules/on-finished/index.js @@ -0,0 +1,196 @@ +/*! + * on-finished + * Copyright(c) 2013 Jonathan Ong + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = onFinished +module.exports.isFinished = isFinished + +/** + * Module dependencies. + * @private + */ + +var first = require('ee-first') + +/** + * Variables. + * @private + */ + +/* istanbul ignore next */ +var defer = typeof setImmediate === 'function' + ? setImmediate + : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) } + +/** + * Invoke callback when the response has finished, useful for + * cleaning up resources afterwards. + * + * @param {object} msg + * @param {function} listener + * @return {object} + * @public + */ + +function onFinished(msg, listener) { + if (isFinished(msg) !== false) { + defer(listener, null, msg) + return msg + } + + // attach the listener to the message + attachListener(msg, listener) + + return msg +} + +/** + * Determine if message is already finished. + * + * @param {object} msg + * @return {boolean} + * @public + */ + +function isFinished(msg) { + var socket = msg.socket + + if (typeof msg.finished === 'boolean') { + // OutgoingMessage + return Boolean(msg.finished || (socket && !socket.writable)) + } + + if (typeof msg.complete === 'boolean') { + // IncomingMessage + return Boolean(msg.upgrade || !socket || !socket.readable || (msg.complete && !msg.readable)) + } + + // don't know + return undefined +} + +/** + * Attach a finished listener to the message. + * + * @param {object} msg + * @param {function} callback + * @private + */ + +function attachFinishedListener(msg, callback) { + var eeMsg + var eeSocket + var finished = false + + function onFinish(error) { + eeMsg.cancel() + eeSocket.cancel() + + finished = true + callback(error) + } + + // finished on first message event + eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish) + + function onSocket(socket) { + // remove listener + msg.removeListener('socket', onSocket) + + if (finished) return + if (eeMsg !== eeSocket) return + + // finished on first socket event + eeSocket = first([[socket, 'error', 'close']], onFinish) + } + + if (msg.socket) { + // socket already assigned + onSocket(msg.socket) + return + } + + // wait for socket to be assigned + msg.on('socket', onSocket) + + if (msg.socket === undefined) { + // node.js 0.8 patch + patchAssignSocket(msg, onSocket) + } +} + +/** + * Attach the listener to the message. + * + * @param {object} msg + * @return {function} + * @private + */ + +function attachListener(msg, listener) { + var attached = msg.__onFinished + + // create a private single listener with queue + if (!attached || !attached.queue) { + attached = msg.__onFinished = createListener(msg) + attachFinishedListener(msg, attached) + } + + attached.queue.push(listener) +} + +/** + * Create listener on message. + * + * @param {object} msg + * @return {function} + * @private + */ + +function createListener(msg) { + function listener(err) { + if (msg.__onFinished === listener) msg.__onFinished = null + if (!listener.queue) return + + var queue = listener.queue + listener.queue = null + + for (var i = 0; i < queue.length; i++) { + queue[i](err, msg) + } + } + + listener.queue = [] + + return listener +} + +/** + * Patch ServerResponse.prototype.assignSocket for node.js 0.8. + * + * @param {ServerResponse} res + * @param {function} callback + * @private + */ + +function patchAssignSocket(res, callback) { + var assignSocket = res.assignSocket + + if (typeof assignSocket !== 'function') return + + // res.on('socket', callback) is broken in 0.8 + res.assignSocket = function _assignSocket(socket) { + assignSocket.call(this, socket) + callback(socket) + } +} diff --git a/node_modules/on-finished/package.json b/node_modules/on-finished/package.json new file mode 100644 index 000000000..2e0bdb34c --- /dev/null +++ b/node_modules/on-finished/package.json @@ -0,0 +1,71 @@ +{ + "_from": "on-finished@^2.3.0", + "_id": "on-finished@2.3.0", + "_inBundle": false, + "_integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "_location": "/on-finished", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "on-finished@^2.3.0", + "name": "on-finished", + "escapedName": "on-finished", + "rawSpec": "^2.3.0", + "saveSpec": null, + "fetchSpec": "^2.3.0" + }, + "_requiredBy": [ + "/budo", + "/send" + ], + "_resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "_shasum": "20f1336481b083cd75337992a16971aa2d906947", + "_spec": "on-finished@^2.3.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", + "bugs": { + "url": "https://github.com/jshttp/on-finished/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + } + ], + "dependencies": { + "ee-first": "1.1.1" + }, + "deprecated": false, + "description": "Execute a callback when a request closes, finishes, or errors", + "devDependencies": { + "istanbul": "0.3.9", + "mocha": "2.2.5" + }, + "engines": { + "node": ">= 0.8" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "index.js" + ], + "homepage": "https://github.com/jshttp/on-finished#readme", + "license": "MIT", + "name": "on-finished", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/on-finished.git" + }, + "scripts": { + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "version": "2.3.0" +} diff --git a/node_modules/on-headers/HISTORY.md b/node_modules/on-headers/HISTORY.md new file mode 100644 index 000000000..e51ff0176 --- /dev/null +++ b/node_modules/on-headers/HISTORY.md @@ -0,0 +1,16 @@ +1.0.1 / 2015-09-29 +================== + + * perf: enable strict mode + +1.0.0 / 2014-08-10 +================== + + * Honor `res.statusCode` change in `listener` + * Move to `jshttp` orgainzation + * Prevent `arguments`-related de-opt + +0.0.0 / 2014-05-13 +================== + + * Initial implementation diff --git a/node_modules/on-headers/LICENSE b/node_modules/on-headers/LICENSE new file mode 100644 index 000000000..b7dce6cf9 --- /dev/null +++ b/node_modules/on-headers/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/on-headers/README.md b/node_modules/on-headers/README.md new file mode 100644 index 000000000..48ed9aefa --- /dev/null +++ b/node_modules/on-headers/README.md @@ -0,0 +1,76 @@ +# on-headers + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Execute a listener when a response is about to write headers. + +## Installation + +```sh +$ npm install on-headers +``` + +## API + +```js +var onHeaders = require('on-headers') +``` + +### onHeaders(res, listener) + +This will add the listener `listener` to fire when headers are emitted for `res`. +The listener is passed the `response` object as it's context (`this`). Headers are +considered to be emitted only once, right before they are sent to the client. + +When this is called multiple times on the same `res`, the `listener`s are fired +in the reverse order they were added. + +## Examples + +```js +var http = require('http') +var onHeaders = require('on-headers') + +http +.createServer(onRequest) +.listen(3000) + +function addPoweredBy() { + // set if not set by end of request + if (!this.getHeader('X-Powered-By')) { + this.setHeader('X-Powered-By', 'Node.js') + } +} + +function onRequest(req, res) { + onHeaders(res, addPoweredBy) + + res.setHeader('Content-Type', 'text/plain') + res.end('hello!') +} +``` + +## Testing + +```sh +$ npm test +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/on-headers.svg +[npm-url]: https://npmjs.org/package/on-headers +[node-version-image]: https://img.shields.io/node/v/on-headers.svg +[node-version-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/jshttp/on-headers/master.svg +[travis-url]: https://travis-ci.org/jshttp/on-headers +[coveralls-image]: https://img.shields.io/coveralls/jshttp/on-headers/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/on-headers?branch=master +[downloads-image]: https://img.shields.io/npm/dm/on-headers.svg +[downloads-url]: https://npmjs.org/package/on-headers diff --git a/node_modules/on-headers/index.js b/node_modules/on-headers/index.js new file mode 100644 index 000000000..089f2b342 --- /dev/null +++ b/node_modules/on-headers/index.js @@ -0,0 +1,93 @@ +/*! + * on-headers + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Reference to Array slice. + */ + +var slice = Array.prototype.slice + +/** + * Execute a listener when a response is about to write headers. + * + * @param {Object} res + * @return {Function} listener + * @api public + */ + +module.exports = function onHeaders(res, listener) { + if (!res) { + throw new TypeError('argument res is required') + } + + if (typeof listener !== 'function') { + throw new TypeError('argument listener must be a function') + } + + res.writeHead = createWriteHead(res.writeHead, listener) +} + +function createWriteHead(prevWriteHead, listener) { + var fired = false; + + // return function with core name and argument list + return function writeHead(statusCode) { + // set headers from arguments + var args = setWriteHeadHeaders.apply(this, arguments); + + // fire listener + if (!fired) { + fired = true + listener.call(this) + + // pass-along an updated status code + if (typeof args[0] === 'number' && this.statusCode !== args[0]) { + args[0] = this.statusCode + args.length = 1 + } + } + + prevWriteHead.apply(this, args); + } +} + +function setWriteHeadHeaders(statusCode) { + var length = arguments.length + var headerIndex = length > 1 && typeof arguments[1] === 'string' + ? 2 + : 1 + + var headers = length >= headerIndex + 1 + ? arguments[headerIndex] + : undefined + + this.statusCode = statusCode + + // the following block is from node.js core + if (Array.isArray(headers)) { + // handle array case + for (var i = 0, len = headers.length; i < len; ++i) { + this.setHeader(headers[i][0], headers[i][1]) + } + } else if (headers) { + // handle object case + var keys = Object.keys(headers) + for (var i = 0; i < keys.length; i++) { + var k = keys[i] + if (k) this.setHeader(k, headers[k]) + } + } + + // copy leading arguments + var args = new Array(Math.min(length, headerIndex)) + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + + return args +} diff --git a/node_modules/on-headers/package.json b/node_modules/on-headers/package.json new file mode 100644 index 000000000..dad530642 --- /dev/null +++ b/node_modules/on-headers/package.json @@ -0,0 +1,69 @@ +{ + "_from": "on-headers@^1.0.1", + "_id": "on-headers@1.0.1", + "_inBundle": false, + "_integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=", + "_location": "/on-headers", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "on-headers@^1.0.1", + "name": "on-headers", + "escapedName": "on-headers", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/budo" + ], + "_resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", + "_shasum": "928f5d0f470d49342651ea6794b0857c100693f7", + "_spec": "on-headers@^1.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", + "author": { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + "bugs": { + "url": "https://github.com/jshttp/on-headers/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Execute a listener when a response is about to write headers", + "devDependencies": { + "istanbul": "0.3.21", + "mocha": "2.3.3", + "supertest": "1.1.0" + }, + "engines": { + "node": ">= 0.8" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "homepage": "https://github.com/jshttp/on-headers#readme", + "keywords": [ + "event", + "headers", + "http", + "onheaders" + ], + "license": "MIT", + "name": "on-headers", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/on-headers.git" + }, + "scripts": { + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "version": "1.0.1" +} diff --git a/node_modules/once/LICENSE b/node_modules/once/LICENSE new file mode 100644 index 000000000..19129e315 --- /dev/null +++ b/node_modules/once/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/once/README.md b/node_modules/once/README.md new file mode 100644 index 000000000..1f1ffca93 --- /dev/null +++ b/node_modules/once/README.md @@ -0,0 +1,79 @@ +# once + +Only call a function once. + +## usage + +```javascript +var once = require('once') + +function load (file, cb) { + cb = once(cb) + loader.load('file') + loader.once('load', cb) + loader.once('error', cb) +} +``` + +Or add to the Function.prototype in a responsible way: + +```javascript +// only has to be done once +require('once').proto() + +function load (file, cb) { + cb = cb.once() + loader.load('file') + loader.once('load', cb) + loader.once('error', cb) +} +``` + +Ironically, the prototype feature makes this module twice as +complicated as necessary. + +To check whether you function has been called, use `fn.called`. Once the +function is called for the first time the return value of the original +function is saved in `fn.value` and subsequent calls will continue to +return this value. + +```javascript +var once = require('once') + +function load (cb) { + cb = once(cb) + var stream = createStream() + stream.once('data', cb) + stream.once('end', function () { + if (!cb.called) cb(new Error('not found')) + }) +} +``` + +## `once.strict(func)` + +Throw an error if the function is called twice. + +Some functions are expected to be called only once. Using `once` for them would +potentially hide logical errors. + +In the example below, the `greet` function has to call the callback only once: + +```javascript +function greet (name, cb) { + // return is missing from the if statement + // when no name is passed, the callback is called twice + if (!name) cb('Hello anonymous') + cb('Hello ' + name) +} + +function log (msg) { + console.log(msg) +} + +// this will print 'Hello anonymous' but the logical error will be missed +greet(null, once(msg)) + +// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time +greet(null, once.strict(msg)) +``` diff --git a/node_modules/once/once.js b/node_modules/once/once.js new file mode 100644 index 000000000..235406736 --- /dev/null +++ b/node_modules/once/once.js @@ -0,0 +1,42 @@ +var wrappy = require('wrappy') +module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) + +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) + + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) +}) + +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) + } + f.called = false + return f +} + +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) + } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f +} diff --git a/node_modules/once/package.json b/node_modules/once/package.json new file mode 100644 index 000000000..0f1ac82ef --- /dev/null +++ b/node_modules/once/package.json @@ -0,0 +1,68 @@ +{ + "_from": "once@^1.3.2", + "_id": "once@1.4.0", + "_inBundle": false, + "_integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "_location": "/once", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "once@^1.3.2", + "name": "once", + "escapedName": "once", + "rawSpec": "^1.3.2", + "saveSpec": null, + "fetchSpec": "^1.3.2" + }, + "_requiredBy": [ + "/budo", + "/glob", + "/inflight" + ], + "_resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "_shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1", + "_spec": "once@^1.3.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/once/issues" + }, + "bundleDependencies": false, + "dependencies": { + "wrappy": "1" + }, + "deprecated": false, + "description": "Run a function exactly one time", + "devDependencies": { + "tap": "^7.0.1" + }, + "directories": { + "test": "test" + }, + "files": [ + "once.js" + ], + "homepage": "https://github.com/isaacs/once#readme", + "keywords": [ + "once", + "function", + "one", + "single" + ], + "license": "ISC", + "main": "once.js", + "name": "once", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/once.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "1.4.0" +} diff --git a/node_modules/opn/index.js b/node_modules/opn/index.js new file mode 100644 index 000000000..2ca4c7f30 --- /dev/null +++ b/node_modules/opn/index.js @@ -0,0 +1,97 @@ +'use strict'; +var path = require('path'); +var childProcess = require('child_process'); +var objectAssign = require('object-assign'); + +module.exports = function (target, opts, cb) { + if (typeof target !== 'string') { + throw new Error('Expected a `target`'); + } + + if (typeof opts === 'function') { + cb = opts; + opts = null; + } + + opts = objectAssign({wait: true}, opts); + + var cmd; + var appArgs = []; + var args = []; + var cpOpts = {}; + + if (Array.isArray(opts.app)) { + appArgs = opts.app.slice(1); + opts.app = opts.app[0]; + } + + if (process.platform === 'darwin') { + cmd = 'open'; + + if (cb && opts.wait) { + args.push('-W'); + } + + if (opts.app) { + args.push('-a', opts.app); + } + + if (appArgs.length > 0) { + args.push('--args'); + args = args.concat(appArgs); + } + } else if (process.platform === 'win32') { + cmd = 'cmd'; + args.push('/c', 'start'); + target = target.replace(/&/g, '^&'); + + if (cb && opts.wait) { + args.push('/wait'); + } + + if (opts.app) { + args.push(opts.app); + } + + if (appArgs.length > 0) { + args = args.concat(appArgs); + } + } else { + if (opts.app) { + cmd = opts.app; + } else { + cmd = path.join(__dirname, 'xdg-open'); + } + + if (appArgs.length > 0) { + args = args.concat(appArgs); + } + + if (!(cb && opts.wait)) { + // xdg-open will block the process unless + // stdio is ignored even if it's unref'd + cpOpts.stdio = 'ignore'; + } + } + + args.push(target); + + var cp = childProcess.spawn(cmd, args, cpOpts); + + if (cb) { + cp.once('error', cb); + + cp.once('close', function (code) { + if (code > 0) { + cb(new Error('Exited with code ' + code)); + return; + } + + cb(); + }); + } else { + cp.unref(); + } + + return cp; +}; diff --git a/node_modules/opn/license b/node_modules/opn/license new file mode 100644 index 000000000..ced6f6b30 --- /dev/null +++ b/node_modules/opn/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/opn/package.json b/node_modules/opn/package.json new file mode 100644 index 000000000..aa2d51f61 --- /dev/null +++ b/node_modules/opn/package.json @@ -0,0 +1,87 @@ +{ + "_from": "opn@^3.0.2", + "_id": "opn@3.0.3", + "_inBundle": false, + "_integrity": "sha1-ttmec5n3jWXDuq/+8fsojpuFJDo=", + "_location": "/opn", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "opn@^3.0.2", + "name": "opn", + "escapedName": "opn", + "rawSpec": "^3.0.2", + "saveSpec": null, + "fetchSpec": "^3.0.2" + }, + "_requiredBy": [ + "/budo" + ], + "_resolved": "http://registry.npmjs.org/opn/-/opn-3.0.3.tgz", + "_shasum": "b6d99e7399f78d65c3baaffef1fb288e9b85243a", + "_spec": "opn@^3.0.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/opn/issues" + }, + "bundleDependencies": false, + "dependencies": { + "object-assign": "^4.0.1" + }, + "deprecated": false, + "description": "A better node-open. Opens stuff like websites, files, executables. Cross-platform.", + "devDependencies": { + "mocha": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "xdg-open" + ], + "homepage": "https://github.com/sindresorhus/opn#readme", + "keywords": [ + "app", + "open", + "opn", + "opener", + "opens", + "launch", + "start", + "xdg-open", + "xdg", + "default", + "cmd", + "browser", + "editor", + "executable", + "exe", + "url", + "urls", + "arguments", + "args", + "spawn", + "exec", + "child", + "process", + "website", + "file" + ], + "license": "MIT", + "name": "opn", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/opn.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "3.0.3" +} diff --git a/node_modules/opn/readme.md b/node_modules/opn/readme.md new file mode 100644 index 000000000..5951cad75 --- /dev/null +++ b/node_modules/opn/readme.md @@ -0,0 +1,93 @@ +# opn + +> A better [node-open](https://github.com/pwnall/node-open). Opens stuff like websites, files, executables. Cross-platform. + + +#### Why? + +- Actively maintained +- Supports app arguments +- Safer as it uses `spawn` instead of `exec` +- Fixes most of the open `node-open` issues +- Includes the latest [`xdg-open` script](http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=c55122295c2a480fa721a9614f0e2d42b2949c18) for Linux + + +## Install + +``` +$ npm install --save opn +``` + + +## Usage + +```js +var opn = require('opn'); + +opn('unicorn.png'); +// opens the image in the default image viewer + +opn('http://sindresorhus.com'); +// opens the url in the default browser + +opn('http://sindresorhus.com', {app: 'firefox'}); +// specify the app to open in + +opn('http://sindresorhus.com', {app: ['google chrome', '--incognito']}); +// specify app arguments +``` + + +## API + +Uses the command `open` on OS X, `start` on Windows and `xdg-open` on other platforms. + +### opn(target, [options], [callback]) + +Returns the [spawned child process](https://nodejs.org/api/child_process.html#child_process_class_childprocess). You'd normally not need to use this for anything, but it can be useful if you'd like to attach custom event listeners or perform other operations directly on the spawned process. + +#### target + +*Required* +Type: `string` + +The thing you want to open. Can be a URL, file, or executable. + +Opens in the default app for the file type. Eg. URLs opens in your default browser. + +#### options + +Type: `object` + +##### wait + +Type: `boolean` +Default: `true` + +Wait for the opened app to exit before calling the `callback`. If `false` it's called immediately when opening the app. + +On Windows you have to explicitly specify an app for it to be able to wait. + +##### app + +Type: `string`, `array` + +Specify the app to open the `target` with, or an array with the app and app arguments. + +The app name is platform dependent. Don't hard code it in reusable modules. Eg. Chrome is `google chrome` on OS X, `google-chrome` on Linux and `chrome` on Windows. + +#### callback(error) + +Type: `function` + +Called when the opened app exits, or if `wait: false`, immediately when opening. + + +## Related + +- [opn-cli](https://github.com/sindresorhus/opn-cli) - CLI for this module + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/opn/xdg-open b/node_modules/opn/xdg-open new file mode 100755 index 000000000..9be7f32f6 --- /dev/null +++ b/node_modules/opn/xdg-open @@ -0,0 +1,861 @@ +#!/bin/sh +#--------------------------------------------- +# xdg-open +# +# Utility script to open a URL in the registered default application. +# +# Refer to the usage() function below for usage. +# +# Copyright 2009-2010, Fathi Boudra +# Copyright 2009-2010, Rex Dieter +# Copyright 2006, Kevin Krammer +# Copyright 2006, Jeremy White +# +# LICENSE: +# +# 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. +# +#--------------------------------------------- + +manualpage() +{ +cat << _MANUALPAGE +Name + + xdg-open - opens a file or URL in the user's preferred + application + +Synopsis + + xdg-open { file | URL } + + xdg-open { --help | --manual | --version } + +Description + + xdg-open opens a file or URL in the user's preferred + application. If a URL is provided the URL will be opened in the + user's preferred web browser. If a file is provided the file + will be opened in the preferred application for files of that + type. xdg-open supports file, ftp, http and https URLs. + + xdg-open is for use inside a desktop session only. It is not + recommended to use xdg-open as root. + +Options + + --help + Show command synopsis. + + --manual + Show this manual page. + + --version + Show the xdg-utils version information. + +Exit Codes + + An exit code of 0 indicates success while a non-zero exit code + indicates failure. The following failure codes can be returned: + + 1 + Error in command line syntax. + + 2 + One of the files passed on the command line did not + exist. + + 3 + A required tool could not be found. + + 4 + The action failed. + +Examples + +xdg-open 'http://www.freedesktop.org/' + + Opens the freedesktop.org website in the user's default + browser. + +xdg-open /tmp/foobar.png + + Opens the PNG image file /tmp/foobar.png in the user's default + image viewing application. +_MANUALPAGE +} + +usage() +{ +cat << _USAGE + xdg-open - opens a file or URL in the user's preferred + application + +Synopsis + + xdg-open { file | URL } + + xdg-open { --help | --manual | --version } + +_USAGE +} + +#@xdg-utils-common@ + +#---------------------------------------------------------------------------- +# Common utility functions included in all XDG wrapper scripts +#---------------------------------------------------------------------------- + +DEBUG() +{ + [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && return 0; + [ ${XDG_UTILS_DEBUG_LEVEL} -lt $1 ] && return 0; + shift + echo "$@" >&2 +} + +# This handles backslashes but not quote marks. +first_word() +{ + read first rest + echo "$first" +} + +#------------------------------------------------------------- +# map a binary to a .desktop file +binary_to_desktop_file() +{ + search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" + binary="`which "$1"`" + binary="`readlink -f "$binary"`" + base="`basename "$binary"`" + IFS=: + for dir in $search; do + unset IFS + [ "$dir" ] || continue + [ -d "$dir/applications" ] || [ -d "$dir/applnk" ] || continue + for file in "$dir"/applications/*.desktop "$dir"/applications/*/*.desktop "$dir"/applnk/*.desktop "$dir"/applnk/*/*.desktop; do + [ -r "$file" ] || continue + # Check to make sure it's worth the processing. + grep -q "^Exec.*$base" "$file" || continue + # Make sure it's a visible desktop file (e.g. not "preferred-web-browser.desktop"). + grep -Eq "^(NoDisplay|Hidden)=true" "$file" && continue + command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" + command="`which "$command"`" + if [ x"`readlink -f "$command"`" = x"$binary" ]; then + # Fix any double slashes that got added path composition + echo "$file" | sed -e 's,//*,/,g' + return + fi + done + done +} + +#------------------------------------------------------------- +# map a .desktop file to a binary +## FIXME: handle vendor dir case +desktop_file_to_binary() +{ + search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" + desktop="`basename "$1"`" + IFS=: + for dir in $search; do + unset IFS + [ "$dir" ] && [ -d "$dir/applications" ] || continue + file="$dir/applications/$desktop" + [ -r "$file" ] || continue + # Remove any arguments (%F, %f, %U, %u, etc.). + command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" + command="`which "$command"`" + readlink -f "$command" + return + done +} + +#------------------------------------------------------------- +# Exit script on successfully completing the desired operation + +exit_success() +{ + if [ $# -gt 0 ]; then + echo "$@" + echo + fi + + exit 0 +} + + +#----------------------------------------- +# Exit script on malformed arguments, not enough arguments +# or missing required option. +# prints usage information + +exit_failure_syntax() +{ + if [ $# -gt 0 ]; then + echo "xdg-open: $@" >&2 + echo "Try 'xdg-open --help' for more information." >&2 + else + usage + echo "Use 'man xdg-open' or 'xdg-open --manual' for additional info." + fi + + exit 1 +} + +#------------------------------------------------------------- +# Exit script on missing file specified on command line + +exit_failure_file_missing() +{ + if [ $# -gt 0 ]; then + echo "xdg-open: $@" >&2 + fi + + exit 2 +} + +#------------------------------------------------------------- +# Exit script on failure to locate necessary tool applications + +exit_failure_operation_impossible() +{ + if [ $# -gt 0 ]; then + echo "xdg-open: $@" >&2 + fi + + exit 3 +} + +#------------------------------------------------------------- +# Exit script on failure returned by a tool application + +exit_failure_operation_failed() +{ + if [ $# -gt 0 ]; then + echo "xdg-open: $@" >&2 + fi + + exit 4 +} + +#------------------------------------------------------------ +# Exit script on insufficient permission to read a specified file + +exit_failure_file_permission_read() +{ + if [ $# -gt 0 ]; then + echo "xdg-open: $@" >&2 + fi + + exit 5 +} + +#------------------------------------------------------------ +# Exit script on insufficient permission to write a specified file + +exit_failure_file_permission_write() +{ + if [ $# -gt 0 ]; then + echo "xdg-open: $@" >&2 + fi + + exit 6 +} + +check_input_file() +{ + if [ ! -e "$1" ]; then + exit_failure_file_missing "file '$1' does not exist" + fi + if [ ! -r "$1" ]; then + exit_failure_file_permission_read "no permission to read file '$1'" + fi +} + +check_vendor_prefix() +{ + file_label="$2" + [ -n "$file_label" ] || file_label="filename" + file=`basename "$1"` + case "$file" in + [[:alpha:]]*-*) + return + ;; + esac + + echo "xdg-open: $file_label '$file' does not have a proper vendor prefix" >&2 + echo 'A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated' >&2 + echo 'with a dash ("-"). An example '"$file_label"' is '"'example-$file'" >&2 + echo "Use --novendor to override or 'xdg-open --manual' for additional info." >&2 + exit 1 +} + +check_output_file() +{ + # if the file exists, check if it is writeable + # if it does not exists, check if we are allowed to write on the directory + if [ -e "$1" ]; then + if [ ! -w "$1" ]; then + exit_failure_file_permission_write "no permission to write to file '$1'" + fi + else + DIR=`dirname "$1"` + if [ ! -w "$DIR" ] || [ ! -x "$DIR" ]; then + exit_failure_file_permission_write "no permission to create file '$1'" + fi + fi +} + +#---------------------------------------- +# Checks for shared commands, e.g. --help + +check_common_commands() +{ + while [ $# -gt 0 ] ; do + parm="$1" + shift + + case "$parm" in + --help) + usage + echo "Use 'man xdg-open' or 'xdg-open --manual' for additional info." + exit_success + ;; + + --manual) + manualpage + exit_success + ;; + + --version) + echo "xdg-open 1.1.0 rc3" + exit_success + ;; + esac + done +} + +check_common_commands "$@" + +[ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && unset XDG_UTILS_DEBUG_LEVEL; +if [ ${XDG_UTILS_DEBUG_LEVEL-0} -lt 1 ]; then + # Be silent + xdg_redirect_output=" > /dev/null 2> /dev/null" +else + # All output to stderr + xdg_redirect_output=" >&2" +fi + +#-------------------------------------- +# Checks for known desktop environments +# set variable DE to the desktop environments name, lowercase + +detectDE() +{ + # see https://bugs.freedesktop.org/show_bug.cgi?id=34164 + unset GREP_OPTIONS + + if [ -n "${XDG_CURRENT_DESKTOP}" ]; then + case "${XDG_CURRENT_DESKTOP}" in + ENLIGHTENMENT) + DE=enlightenment; + ;; + GNOME) + DE=gnome; + ;; + KDE) + DE=kde; + ;; + LXDE) + DE=lxde; + ;; + MATE) + DE=mate; + ;; + XFCE) + DE=xfce + ;; + esac + fi + + if [ x"$DE" = x"" ]; then + # classic fallbacks + if [ x"$KDE_FULL_SESSION" != x"" ]; then DE=kde; + elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; + elif [ x"$MATE_DESKTOP_SESSION_ID" != x"" ]; then DE=mate; + elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome; + elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; + elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null 2>&1; then DE=xfce + elif echo $DESKTOP | grep -q '^Enlightenment'; then DE=enlightenment; + fi + fi + + if [ x"$DE" = x"" ]; then + # fallback to checking $DESKTOP_SESSION + case "$DESKTOP_SESSION" in + gnome) + DE=gnome; + ;; + LXDE|Lubuntu) + DE=lxde; + ;; + MATE) + DE=mate; + ;; + xfce|xfce4|'Xfce Session') + DE=xfce; + ;; + esac + fi + + if [ x"$DE" = x"" ]; then + # fallback to uname output for other platforms + case "$(uname 2>/dev/null)" in + Darwin) + DE=darwin; + ;; + esac + fi + + if [ x"$DE" = x"gnome" ]; then + # gnome-default-applications-properties is only available in GNOME 2.x + # but not in GNOME 3.x + which gnome-default-applications-properties > /dev/null 2>&1 || DE="gnome3" + fi +} + +#---------------------------------------------------------------------------- +# kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4 +# It also always returns 1 in KDE 3.4 and earlier +# Simply return 0 in such case + +kfmclient_fix_exit_code() +{ + version=`LC_ALL=C.UTF-8 kde-config --version 2>/dev/null | grep '^KDE'` + major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'` + minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'` + release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'` + test "$major" -gt 3 && return $1 + test "$minor" -gt 5 && return $1 + test "$release" -gt 4 && return $1 + return 0 +} + +# This handles backslashes but not quote marks. +last_word() +{ + read first rest + echo "$rest" +} + +# Get the value of a key in a desktop file's Desktop Entry group. +# Example: Use get_key foo.desktop Exec +# to get the values of the Exec= key for the Desktop Entry group. +get_key() +{ + local file="${1}" + local key="${2}" + local desktop_entry="" + + IFS_="${IFS}" + IFS="" + while read line + do + case "$line" in + "[Desktop Entry]") + desktop_entry="y" + ;; + # Reset match flag for other groups + "["*) + desktop_entry="" + ;; + "${key}="*) + # Only match Desktop Entry group + if [ -n "${desktop_entry}" ] + then + echo "${line}" | cut -d= -f 2- + fi + esac + done < "${file}" + IFS="${IFS_}" +} + +open_darwin() +{ + open "$1" + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + +open_kde() +{ + if [ -n "${KDE_SESSION_VERSION}" ]; then + case "${KDE_SESSION_VERSION}" in + 4) + kde-open "$1" + ;; + 5) + kde-open${KDE_SESSION_VERSION} "$1" + ;; + esac + else + kfmclient exec "$1" + kfmclient_fix_exit_code $? + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + +open_gnome() +{ + if gvfs-open --help 2>/dev/null 1>&2; then + gvfs-open "$1" + else + gnome-open "$1" + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + +open_mate() +{ + if gvfs-open --help 2>/dev/null 1>&2; then + gvfs-open "$1" + else + mate-open "$1" + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + +open_xfce() +{ + exo-open "$1" + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + +open_enlightenment() +{ + enlightenment_open "$1" + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + +#----------------------------------------- +# Recursively search .desktop file + +search_desktop_file() +{ + local default="$1" + local dir="$2" + local target="$3" + + local file="" + # look for both vendor-app.desktop, vendor/app.desktop + if [ -r "$dir/$default" ]; then + file="$dir/$default" + elif [ -r "$dir/`echo $default | sed -e 's|-|/|'`" ]; then + file="$dir/`echo $default | sed -e 's|-|/|'`" + fi + + if [ -r "$file" ] ; then + command="$(get_key "${file}" "Exec" | first_word)" + command_exec=`which $command 2>/dev/null` + icon="$(get_key "${file}" "Icon")" + # FIXME: Actually LC_MESSAGES should be used as described in + # http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s04.html + localised_name="$(get_key "${file}" "Name")" + set -- $(get_key "${file}" "Exec" | last_word) + # We need to replace any occurrence of "%f", "%F" and + # the like by the target file. We examine each + # argument and append the modified argument to the + # end then shift. + local args=$# + local replaced=0 + while [ $args -gt 0 ]; do + case $1 in + %[c]) + replaced=1 + arg="${localised_name}" + shift + set -- "$@" "$arg" + ;; + %[fFuU]) + replaced=1 + arg="$target" + shift + set -- "$@" "$arg" + ;; + %[i]) + replaced=1 + shift + set -- "$@" "--icon" "$icon" + ;; + *) + arg="$1" + shift + set -- "$@" "$arg" + ;; + esac + args=$(( $args - 1 )) + done + [ $replaced -eq 1 ] || set -- "$@" "$target" + "$command_exec" "$@" + + if [ $? -eq 0 ]; then + exit_success + fi + fi + + for d in $dir/*/; do + [ -d "$d" ] && search_desktop_file "$default" "$d" "$target" + done +} + + +open_generic_xdg_mime() +{ + filetype="$2" + default=`xdg-mime query default "$filetype"` + if [ -n "$default" ] ; then + xdg_user_dir="$XDG_DATA_HOME" + [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" + + xdg_system_dirs="$XDG_DATA_DIRS" + [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/ + +DEBUG 3 "$xdg_user_dir:$xdg_system_dirs" + for x in `echo "$xdg_user_dir:$xdg_system_dirs" | sed 's/:/ /g'`; do + search_desktop_file "$default" "$x/applications/" "$1" + done + fi +} + +open_generic_xdg_file_mime() +{ + filetype=`xdg-mime query filetype "$1" | sed "s/;.*//"` + open_generic_xdg_mime "$1" "$filetype" +} + +open_generic_xdg_x_scheme_handler() +{ + scheme="`echo $1 | sed -n 's/\(^[[:alnum:]+\.-]*\):.*$/\1/p'`" + if [ -n $scheme ]; then + filetype="x-scheme-handler/$scheme" + open_generic_xdg_mime "$1" "$filetype" + fi +} + +open_generic() +{ + # Paths or file:// URLs + if (echo "$1" | grep -q '^file://' || + ! echo "$1" | egrep -q '^[[:alpha:]+\.\-]+:'); then + + local file="$1" + + # Decode URLs + if echo "$file" | grep -q '^file:///'; then + file=${file#file://} + file="$(printf "$(echo "$file" | sed -e 's@%\([a-f0-9A-F]\{2\}\)@\\x\1@g')")" + fi + file_check=${file%%#*} + file_check=${file_check%%\?*} + check_input_file "$file_check" + + filetype=`xdg-mime query filetype "$file_check" | sed "s/;.*//"` + open_generic_xdg_mime "$file" "$filetype" + + if which run-mailcap 2>/dev/null 1>&2; then + run-mailcap --action=view "$file" + if [ $? -eq 0 ]; then + exit_success + fi + fi + + if mimeopen -v 2>/dev/null 1>&2; then + mimeopen -L -n "$file" + if [ $? -eq 0 ]; then + exit_success + fi + fi + fi + + open_generic_xdg_x_scheme_handler "$1" + + IFS=":" + for browser in $BROWSER; do + if [ x"$browser" != x"" ]; then + + browser_with_arg=`printf "$browser" "$1" 2>/dev/null` + if [ $? -ne 0 ]; then + browser_with_arg=$browser; + fi + + if [ x"$browser_with_arg" = x"$browser" ]; then + eval '$browser "$1"'$xdg_redirect_output; + else eval '$browser_with_arg'$xdg_redirect_output; + fi + + if [ $? -eq 0 ]; then + exit_success; + fi + fi + done + + exit_failure_operation_impossible "no method available for opening '$1'" +} + +open_lxde() +{ + # pcmanfm only knows how to handle file:// urls and filepaths, it seems. + if (echo "$1" | grep -q '^file://' || + ! echo "$1" | egrep -q '^[[:alpha:]+\.\-]+:') + then + local file="$1" + + # handle relative paths + if ! echo "$file" | egrep -q '^(file://)?/'; then + file="$(pwd)/$file" + fi + + pcmanfm "$file" + + else + open_generic "$1" + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + +[ x"$1" != x"" ] || exit_failure_syntax + +url= +while [ $# -gt 0 ] ; do + parm="$1" + shift + + case "$parm" in + -*) + exit_failure_syntax "unexpected option '$parm'" + ;; + + *) + if [ -n "$url" ] ; then + exit_failure_syntax "unexpected argument '$parm'" + fi + url="$parm" + ;; + esac +done + +if [ -z "${url}" ] ; then + exit_failure_syntax "file or URL argument missing" +fi + +detectDE + +if [ x"$DE" = x"" ]; then + DE=generic +fi + +DEBUG 2 "Selected DE $DE" + +# sanitize BROWSER (avoid caling ourselves in particular) +case "${BROWSER}" in + *:"xdg-open"|"xdg-open":*) + BROWSER=$(echo $BROWSER | sed -e 's|:xdg-open||g' -e 's|xdg-open:||g') + ;; + "xdg-open") + BROWSER= + ;; +esac + +# if BROWSER variable is not set, check some well known browsers instead +if [ x"$BROWSER" = x"" ]; then + BROWSER=links2:elinks:links:lynx:w3m + if [ -n "$DISPLAY" ]; then + BROWSER=x-www-browser:firefox:seamonkey:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER + fi +fi + +case "$DE" in + kde) + open_kde "$url" + ;; + + gnome*) + open_gnome "$url" + ;; + + mate) + open_mate "$url" + ;; + + xfce) + open_xfce "$url" + ;; + + lxde) + open_lxde "$url" + ;; + + enlightenment) + open_enlightenment "$url" + ;; + + generic) + open_generic "$url" + ;; + + *) + exit_failure_operation_impossible "no method available for opening '$url'" + ;; +esac diff --git a/node_modules/options/.npmignore b/node_modules/options/.npmignore new file mode 100644 index 000000000..1b18fb395 --- /dev/null +++ b/node_modules/options/.npmignore @@ -0,0 +1,7 @@ +npm-debug.log +node_modules +.*.swp +.lock-* +build/ + +test diff --git a/node_modules/options/Makefile b/node_modules/options/Makefile new file mode 100644 index 000000000..7496b6fcc --- /dev/null +++ b/node_modules/options/Makefile @@ -0,0 +1,12 @@ +ALL_TESTS = $(shell find test/ -name '*.test.js') + +run-tests: + @./node_modules/.bin/mocha \ + -t 2000 \ + $(TESTFLAGS) \ + $(TESTS) + +test: + @$(MAKE) NODE_PATH=lib TESTS="$(ALL_TESTS)" run-tests + +.PHONY: test diff --git a/node_modules/options/README.md b/node_modules/options/README.md new file mode 100644 index 000000000..0dabc7551 --- /dev/null +++ b/node_modules/options/README.md @@ -0,0 +1,69 @@ +# options.js # + +A very light-weight in-code option parsers for node.js. + +## Usage ## + +``` js +var Options = require("options"); + +// Create an Options object +function foo(options) { + var default_options = { + foo : "bar" + }; + + // Create an option object with default value + var opts = new Options(default_options); + + // Merge options + opts = opts.merge(options); + + // Reset to default value + opts.reset(); + + // Copy selected attributes out + var seled_att = opts.copy("foo"); + + // Read json options from a file. + opts.read("options.file"); // Sync + opts.read("options.file", function(err){ // Async + if(err){ // If error occurs + console.log("File error."); + }else{ + // No error + } + }); + + // Attributes defined or not + opts.isDefinedAndNonNull("foobar"); + opts.isDefined("foobar"); +} + +``` + + +## License ## + +(The MIT License) + +Copyright (c) 2012 Einar Otto Stangvik <einaros@gmail.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/options/lib/options.js b/node_modules/options/lib/options.js new file mode 100644 index 000000000..4fc45e90a --- /dev/null +++ b/node_modules/options/lib/options.js @@ -0,0 +1,86 @@ +/*! + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +var fs = require('fs'); + +function Options(defaults) { + var internalValues = {}; + var values = this.value = {}; + Object.keys(defaults).forEach(function(key) { + internalValues[key] = defaults[key]; + Object.defineProperty(values, key, { + get: function() { return internalValues[key]; }, + configurable: false, + enumerable: true + }); + }); + this.reset = function() { + Object.keys(defaults).forEach(function(key) { + internalValues[key] = defaults[key]; + }); + return this; + }; + this.merge = function(options, required) { + options = options || {}; + if (Object.prototype.toString.call(required) === '[object Array]') { + var missing = []; + for (var i = 0, l = required.length; i < l; ++i) { + var key = required[i]; + if (!(key in options)) { + missing.push(key); + } + } + if (missing.length > 0) { + if (missing.length > 1) { + throw new Error('options ' + + missing.slice(0, missing.length - 1).join(', ') + ' and ' + + missing[missing.length - 1] + ' must be defined'); + } + else throw new Error('option ' + missing[0] + ' must be defined'); + } + } + Object.keys(options).forEach(function(key) { + if (key in internalValues) { + internalValues[key] = options[key]; + } + }); + return this; + }; + this.copy = function(keys) { + var obj = {}; + Object.keys(defaults).forEach(function(key) { + if (keys.indexOf(key) !== -1) { + obj[key] = values[key]; + } + }); + return obj; + }; + this.read = function(filename, cb) { + if (typeof cb == 'function') { + var self = this; + fs.readFile(filename, function(error, data) { + if (error) return cb(error); + var conf = JSON.parse(data); + self.merge(conf); + cb(); + }); + } + else { + var conf = JSON.parse(fs.readFileSync(filename)); + this.merge(conf); + } + return this; + }; + this.isDefined = function(key) { + return typeof values[key] != 'undefined'; + }; + this.isDefinedAndNonNull = function(key) { + return typeof values[key] != 'undefined' && values[key] !== null; + }; + Object.freeze(values); + Object.freeze(this); +} + +module.exports = Options; diff --git a/node_modules/options/package.json b/node_modules/options/package.json new file mode 100644 index 000000000..886f8741a --- /dev/null +++ b/node_modules/options/package.json @@ -0,0 +1,54 @@ +{ + "_from": "options@>=0.0.5", + "_id": "options@0.0.6", + "_inBundle": false, + "_integrity": "sha1-7CLTEoBrtT5zF3Pnza788cZDEo8=", + "_location": "/options", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "options@>=0.0.5", + "name": "options", + "escapedName": "options", + "rawSpec": ">=0.0.5", + "saveSpec": null, + "fetchSpec": ">=0.0.5" + }, + "_requiredBy": [ + "/ws" + ], + "_resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz", + "_shasum": "ec22d312806bb53e731773e7cdaefcf1c643128f", + "_spec": "options@>=0.0.5", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/ws", + "author": { + "name": "Einar Otto Stangvik", + "email": "einaros@gmail.com", + "url": "http://2x.io" + }, + "bugs": { + "url": "https://github.com/einaros/options.js/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "A very light-weight in-code option parsers for node.js.", + "devDependencies": { + "mocha": "latest" + }, + "engines": { + "node": ">=0.4.0" + }, + "homepage": "https://github.com/einaros/options.js#readme", + "main": "lib/options", + "name": "options", + "repository": { + "type": "git", + "url": "git://github.com/einaros/options.js.git" + }, + "scripts": { + "test": "make test" + }, + "version": "0.0.6" +} diff --git a/node_modules/os-browserify/.npmignore b/node_modules/os-browserify/.npmignore new file mode 100644 index 000000000..f356293ee --- /dev/null +++ b/node_modules/os-browserify/.npmignore @@ -0,0 +1,14 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +npm-debug.log diff --git a/node_modules/os-browserify/LICENSE b/node_modules/os-browserify/LICENSE new file mode 100644 index 000000000..4b870dac2 --- /dev/null +++ b/node_modules/os-browserify/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 CoderPuppy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/os-browserify/README.md b/node_modules/os-browserify/README.md new file mode 100644 index 000000000..4dd7d6ebc --- /dev/null +++ b/node_modules/os-browserify/README.md @@ -0,0 +1,5 @@ +# os-browserify + +The [os](https://nodejs.org/api/os.html) module from node.js, but for browsers. + +When you `require('os')` in [browserify](http://github.com/substack/node-browserify), this module will be loaded. diff --git a/node_modules/os-browserify/browser.js b/node_modules/os-browserify/browser.js new file mode 100644 index 000000000..22d9a2ad4 --- /dev/null +++ b/node_modules/os-browserify/browser.js @@ -0,0 +1,49 @@ +exports.endianness = function () { return 'LE' }; + +exports.hostname = function () { + if (typeof location !== 'undefined') { + return location.hostname + } + else return ''; +}; + +exports.loadavg = function () { return [] }; + +exports.uptime = function () { return 0 }; + +exports.freemem = function () { + return Number.MAX_VALUE; +}; + +exports.totalmem = function () { + return Number.MAX_VALUE; +}; + +exports.cpus = function () { return [] }; + +exports.type = function () { return 'Browser' }; + +exports.release = function () { + if (typeof navigator !== 'undefined') { + return navigator.appVersion; + } + return ''; +}; + +exports.networkInterfaces += exports.getNetworkInterfaces += function () { return {} }; + +exports.arch = function () { return 'javascript' }; + +exports.platform = function () { return 'browser' }; + +exports.tmpdir = exports.tmpDir = function () { + return '/tmp'; +}; + +exports.EOL = '\n'; + +exports.homedir = function () { + return '/' +}; diff --git a/node_modules/os-browserify/main.js b/node_modules/os-browserify/main.js new file mode 100644 index 000000000..5910697d8 --- /dev/null +++ b/node_modules/os-browserify/main.js @@ -0,0 +1 @@ +module.exports = require('os'); diff --git a/node_modules/os-browserify/package.json b/node_modules/os-browserify/package.json new file mode 100644 index 000000000..5eb0bc764 --- /dev/null +++ b/node_modules/os-browserify/package.json @@ -0,0 +1,53 @@ +{ + "_from": "os-browserify@~0.3.0", + "_id": "os-browserify@0.3.0", + "_inBundle": false, + "_integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "_location": "/os-browserify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "os-browserify@~0.3.0", + "name": "os-browserify", + "escapedName": "os-browserify", + "rawSpec": "~0.3.0", + "saveSpec": null, + "fetchSpec": "~0.3.0" + }, + "_requiredBy": [ + "/browserify" + ], + "_resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "_shasum": "854373c7f5c2315914fc9bfc6bd8238fdda1ec27", + "_spec": "os-browserify@~0.3.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "CoderPuppy", + "email": "coderpup@gmail.com" + }, + "browser": "browser.js", + "bugs": { + "url": "https://github.com/CoderPuppy/os-browserify/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "The [os](https://nodejs.org/api/os.html) module from node.js, but for browsers.", + "homepage": "https://github.com/CoderPuppy/os-browserify#readme", + "jspm": { + "map": { + "./main.js": { + "node": "@node/os", + "browser": "./browser.js" + } + } + }, + "license": "MIT", + "main": "main.js", + "name": "os-browserify", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/CoderPuppy/os-browserify.git" + }, + "version": "0.3.0" +} diff --git a/node_modules/os-tmpdir/index.js b/node_modules/os-tmpdir/index.js new file mode 100644 index 000000000..2077b1ce7 --- /dev/null +++ b/node_modules/os-tmpdir/index.js @@ -0,0 +1,25 @@ +'use strict'; +var isWindows = process.platform === 'win32'; +var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/; + +// https://github.com/nodejs/node/blob/3e7a14381497a3b73dda68d05b5130563cdab420/lib/os.js#L25-L43 +module.exports = function () { + var path; + + if (isWindows) { + path = process.env.TEMP || + process.env.TMP || + (process.env.SystemRoot || process.env.windir) + '\\temp'; + } else { + path = process.env.TMPDIR || + process.env.TMP || + process.env.TEMP || + '/tmp'; + } + + if (trailingSlashRe.test(path)) { + path = path.slice(0, -1); + } + + return path; +}; diff --git a/node_modules/os-tmpdir/license b/node_modules/os-tmpdir/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/os-tmpdir/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/os-tmpdir/package.json b/node_modules/os-tmpdir/package.json new file mode 100644 index 000000000..8013e112a --- /dev/null +++ b/node_modules/os-tmpdir/package.json @@ -0,0 +1,73 @@ +{ + "_from": "os-tmpdir@^1.0.1", + "_id": "os-tmpdir@1.0.2", + "_inBundle": false, + "_integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "_location": "/os-tmpdir", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "os-tmpdir@^1.0.1", + "name": "os-tmpdir", + "escapedName": "os-tmpdir", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/pem" + ], + "_resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "_shasum": "bbe67406c79aa85c5cfec766fe5734555dfa1274", + "_spec": "os-tmpdir@^1.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/pem", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/os-tmpdir/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Node.js os.tmpdir() ponyfill", + "devDependencies": { + "ava": "*", + "xo": "^0.16.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/os-tmpdir#readme", + "keywords": [ + "built-in", + "core", + "ponyfill", + "polyfill", + "shim", + "os", + "tmpdir", + "tempdir", + "tmp", + "temp", + "dir", + "directory", + "env", + "environment" + ], + "license": "MIT", + "name": "os-tmpdir", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/os-tmpdir.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.2" +} diff --git a/node_modules/os-tmpdir/readme.md b/node_modules/os-tmpdir/readme.md new file mode 100644 index 000000000..c09f7ed8d --- /dev/null +++ b/node_modules/os-tmpdir/readme.md @@ -0,0 +1,32 @@ +# os-tmpdir [![Build Status](https://travis-ci.org/sindresorhus/os-tmpdir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-tmpdir) + +> Node.js [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) [ponyfill](https://ponyfill.com) + +Use this instead of `require('os').tmpdir()` to get a consistent behavior on different Node.js versions (even 0.8). + + +## Install + +``` +$ npm install --save os-tmpdir +``` + + +## Usage + +```js +const osTmpdir = require('os-tmpdir'); + +osTmpdir(); +//=> '/var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T' +``` + + +## API + +See the [`os.tmpdir()` docs](https://nodejs.org/api/os.html#os_os_tmpdir). + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/outpipe/.npmignore b/node_modules/outpipe/.npmignore new file mode 100644 index 000000000..a0a4bd493 --- /dev/null +++ b/node_modules/outpipe/.npmignore @@ -0,0 +1,2 @@ +example/output +node_modules diff --git a/node_modules/outpipe/LICENSE b/node_modules/outpipe/LICENSE new file mode 100644 index 000000000..ee27ba4b4 --- /dev/null +++ b/node_modules/outpipe/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/outpipe/bin/echo.js b/node_modules/outpipe/bin/echo.js new file mode 100755 index 000000000..e1846d701 --- /dev/null +++ b/node_modules/outpipe/bin/echo.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +process.stdin.pipe(process.stdout); diff --git a/node_modules/outpipe/example/input/x.js b/node_modules/outpipe/example/input/x.js new file mode 100644 index 000000000..9aaeebd91 --- /dev/null +++ b/node_modules/outpipe/example/input/x.js @@ -0,0 +1,4 @@ +for (var i = 0; i < 100; i++) { + var n = 500; + console.log('i=', i); +} diff --git a/node_modules/outpipe/example/input/y.js b/node_modules/outpipe/example/input/y.js new file mode 100644 index 000000000..58f01c939 --- /dev/null +++ b/node_modules/outpipe/example/input/y.js @@ -0,0 +1,5 @@ +(function () { + var x = 5; + var x = 6; + console.log('ogre') +})(); diff --git a/node_modules/outpipe/example/input/z.js b/node_modules/outpipe/example/input/z.js new file mode 100644 index 000000000..e346bb697 --- /dev/null +++ b/node_modules/outpipe/example/input/z.js @@ -0,0 +1,2 @@ +if (false) console.log('welcome!') +console.log('keep out') diff --git a/node_modules/outpipe/example/watch.js b/node_modules/outpipe/example/watch.js new file mode 100644 index 000000000..b694e79bc --- /dev/null +++ b/node_modules/outpipe/example/watch.js @@ -0,0 +1,19 @@ +var outpipe = require('../'); +var gaze = require('gaze'); +var fs = require('fs'); + +var minimist = require('minimist'); +var argv = minimist(process.argv.slice(2), { + alias: { o: 'output' } +}); + +var file = argv._[0]; +gaze(file, function (err, w) { + w.on('changed', read); +}); +read(); + +function read () { + var r = fs.createReadStream(file); + r.pipe(outpipe(argv.output)); +} diff --git a/node_modules/outpipe/index.js b/node_modules/outpipe/index.js new file mode 100644 index 000000000..38b5a6afa --- /dev/null +++ b/node_modules/outpipe/index.js @@ -0,0 +1,34 @@ +var parse = require('shell-quote').parse; +var exec = require('child_process').exec; +var path = require('path'); +var echo = process.execPath + ' ' + path.join(__dirname, 'bin/echo'); +var fs = require('fs'); + +module.exports = function (str, opts) { + var parts = parse(str); + for (var i = 0; i < parts.length; i++) { + if (parts[i].op) break; + } + if (i === parts.length) { // no ops + var w = fs.createWriteStream(str); + w.once('finish', function () { w.emit('exit', 0) }); + w.once('error', function (err) { w.emit('exit', 1) }); + return w; + } + else { + if (parts[parts.length-1].op === '|') { + str += echo; + } + if (parts[0].op === '|') { + str = echo + str; + } + if (parts[0].op === '>') { + str = echo + str; + } + } + var p = exec(str, opts); + p.stderr.pipe(process.stderr, { end: false }); + p.stdout.pipe(process.stdout, { end: false }); + p.once('exit', function (code) { p.stdin.emit('exit', code) }); + return p.stdin; +}; diff --git a/node_modules/outpipe/package.json b/node_modules/outpipe/package.json new file mode 100644 index 000000000..8361b3440 --- /dev/null +++ b/node_modules/outpipe/package.json @@ -0,0 +1,69 @@ +{ + "_from": "outpipe@^1.1.0", + "_id": "outpipe@1.1.1", + "_inBundle": false, + "_integrity": "sha1-UM+GFjZeh+Ax4ppeyTOaPaRyX6I=", + "_location": "/outpipe", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "outpipe@^1.1.0", + "name": "outpipe", + "escapedName": "outpipe", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/watchify" + ], + "_resolved": "https://registry.npmjs.org/outpipe/-/outpipe-1.1.1.tgz", + "_shasum": "50cf8616365e87e031e29a5ec9339a3da4725fa2", + "_spec": "outpipe@^1.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/watchify", + "author": { + "name": "substack" + }, + "bugs": { + "url": "https://github.com/substack/outpipe/issues" + }, + "bundleDependencies": false, + "dependencies": { + "shell-quote": "^1.4.2" + }, + "deprecated": false, + "description": "write output to a file through shell commands", + "devDependencies": { + "gaze": "^0.5.1", + "minimist": "^1.1.0", + "osenv": "^0.1.0", + "tape": "^3.5.0", + "xtend": "^4.0.0" + }, + "directories": { + "example": "example" + }, + "homepage": "https://github.com/substack/outpipe", + "keywords": [ + "output", + "file", + "pipe", + "shell", + "exec", + "spawn", + "createWriteStream", + "redirect" + ], + "license": "MIT", + "main": "index.js", + "name": "outpipe", + "repository": { + "type": "git", + "url": "git://github.com/substack/outpipe.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "version": "1.1.1" +} diff --git a/node_modules/outpipe/readme.markdown b/node_modules/outpipe/readme.markdown new file mode 100644 index 000000000..efd4136fc --- /dev/null +++ b/node_modules/outpipe/readme.markdown @@ -0,0 +1,117 @@ +# outpipe + +write output to a file through shell commands + +# purpose + +Suppose you have a tool like +[watchify](https://npmjs.com/package/watchify) +or [factor-bundle](https://npmjs.com/package/factor-bundle) +that write to multiple files or write to the same file more than once. + +If you want to pipe the output of these tools to other programs, such as +minification with the `uglify` command, it's very difficult! You might need to +use the tool's API or use a separate command to watch for changes to the output +files. Ick. + +You don't get the elegance of something like: + +``` sh +$ browserify main.js | uglifyjs -cm | gzip > bundle.js.gz +``` + +Until now! With this library and a hypothetical version of watchify, you could +do: + +``` sh +$ watchify main.js -dv -o 'uglifyjs -cm | gzip > bundle.js.gz' +``` + +# example + +Here's a small watcher program that will just copy input files to a destination, +but transforms can be applied along the way with shell pipes and redirects. + +``` js +var outpipe = require('outpipe'); +var gaze = require('gaze'); +var fs = require('fs'); + +var minimist = require('minimist'); +var argv = minimist(process.argv.slice(2), { + alias: { o: 'output' } +}); + +var file = argv._[0]; +gaze(file, function (err, w) { + w.on('changed', read); +}); +read(); + +function read () { + var r = fs.createReadStream(file); + r.pipe(outpipe(argv.output)); +} +``` + +We can run the program with a single output file: + +``` sh +$ node watch.js input/x.js -o output/hmm.js +``` + +which just copies `x.js` to `output/hmm.js` whenever `x.js` changes. + +We could also run a minification step using the `uglify` command: + +``` sh +$ node watch.js input/x.js -o 'uglifyjs -cm > output/wow.js' +``` + +or we can just print the size of the minified and gzipped output to stdout: + +``` sh +$ node watch.js input/x.js -o 'uglifyjs -cm | gzip | wc -c' +123 +``` + +or we could write that size to a file: + +``` sh +$ node watch.js input/x.js -o 'uglifyjs -cm | gzip | wc -c > size.txt' +``` + +# methods + +``` js +var outpipe = require('outpipe') +``` + +## var w = outpipe(cmd, opts={}) + +Return a writable stream `w` that will pipe output to the command string `cmd`. + +If `cmd` has no operators (`|` or `>`), it will write to a file. + +Otherwise, each command between pipes will be executed and output is written to +a file if `>` is given. + +`opts` can be: + +* `opts.env` - an object mapping environment variables to their values or a +`function (key) {}` that returns the values. + +stdout and stderr are forwarded to process.stdout and process.stderr if +unhandled in the command. + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install outpipe +``` + +# license + +MIT diff --git a/node_modules/outpipe/test/cmd.js b/node_modules/outpipe/test/cmd.js new file mode 100644 index 000000000..baa536c96 --- /dev/null +++ b/node_modules/outpipe/test/cmd.js @@ -0,0 +1,19 @@ +var outpipe = require('../'); +var test = require('tape'); +var fs = require('fs'); +var path = require('path'); +var tmpdir = require('osenv').tmpdir(); + +test('cmd', function (t) { + t.plan(2); + var file = path.join(tmpdir, 'outpipe-' + Math.random()); + var p = outpipe('wc -c > ' + file); + p.end('wow'); + + p.once('exit', function () { + fs.readFile(file, 'utf8', function (err, src) { + t.ifError(err); + t.equal(src, '3\n'); + }); + }); +}); diff --git a/node_modules/outpipe/test/outfile.js b/node_modules/outpipe/test/outfile.js new file mode 100644 index 000000000..de5340cfa --- /dev/null +++ b/node_modules/outpipe/test/outfile.js @@ -0,0 +1,19 @@ +var outpipe = require('../'); +var test = require('tape'); +var fs = require('fs'); +var path = require('path'); +var tmpdir = require('osenv').tmpdir(); + +test('outfile', function (t) { + t.plan(2); + var file = path.join(tmpdir, 'outpipe-' + Math.random()); + var p = outpipe(file); + p.end('wow'); + + p.once('exit', function () { + fs.readFile(file, 'utf8', function (err, src) { + t.ifError(err); + t.equal(src, 'wow'); + }); + }); +}); diff --git a/node_modules/p-finally/index.js b/node_modules/p-finally/index.js new file mode 100644 index 000000000..52b7b49c5 --- /dev/null +++ b/node_modules/p-finally/index.js @@ -0,0 +1,15 @@ +'use strict'; +module.exports = (promise, onFinally) => { + onFinally = onFinally || (() => {}); + + return promise.then( + val => new Promise(resolve => { + resolve(onFinally()); + }).then(() => val), + err => new Promise(resolve => { + resolve(onFinally()); + }).then(() => { + throw err; + }) + ); +}; diff --git a/node_modules/p-finally/license b/node_modules/p-finally/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/p-finally/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/p-finally/package.json b/node_modules/p-finally/package.json new file mode 100644 index 000000000..5cafc490a --- /dev/null +++ b/node_modules/p-finally/package.json @@ -0,0 +1,74 @@ +{ + "_from": "p-finally@^1.0.0", + "_id": "p-finally@1.0.0", + "_inBundle": false, + "_integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "_location": "/p-finally", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "p-finally@^1.0.0", + "name": "p-finally", + "escapedName": "p-finally", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/execa" + ], + "_resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "_shasum": "3fbcfb15b899a44123b34b6dcc18b724336a2cae", + "_spec": "p-finally@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/execa", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/p-finally/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "`Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/p-finally#readme", + "keywords": [ + "promise", + "finally", + "handler", + "function", + "async", + "await", + "promises", + "settled", + "ponyfill", + "polyfill", + "shim", + "bluebird" + ], + "license": "MIT", + "name": "p-finally", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/p-finally.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.0", + "xo": { + "esnext": true + } +} diff --git a/node_modules/p-finally/readme.md b/node_modules/p-finally/readme.md new file mode 100644 index 000000000..09ef36416 --- /dev/null +++ b/node_modules/p-finally/readme.md @@ -0,0 +1,47 @@ +# p-finally [![Build Status](https://travis-ci.org/sindresorhus/p-finally.svg?branch=master)](https://travis-ci.org/sindresorhus/p-finally) + +> [`Promise#finally()`](https://github.com/tc39/proposal-promise-finally) [ponyfill](https://ponyfill.com) - Invoked when the promise is settled regardless of outcome + +Useful for cleanup. + + +## Install + +``` +$ npm install --save p-finally +``` + + +## Usage + +```js +const pFinally = require('p-finally'); + +const dir = createTempDir(); + +pFinally(write(dir), () => cleanup(dir)); +``` + + +## API + +### pFinally(promise, [onFinally]) + +Returns a `Promise`. + +#### onFinally + +Type: `Function` + +Note: Throwing or returning a rejected promise will reject `promise` with the rejection reason. + + +## Related + +- [p-try](https://github.com/sindresorhus/p-try) - `Promise#try()` ponyfill - Starts a promise chain +- [More…](https://github.com/sindresorhus/promise-fun) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/pad-left/LICENSE b/node_modules/pad-left/LICENSE new file mode 100644 index 000000000..39245ac1c --- /dev/null +++ b/node_modules/pad-left/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/pad-left/README.md b/node_modules/pad-left/README.md new file mode 100644 index 000000000..eae0f48eb --- /dev/null +++ b/node_modules/pad-left/README.md @@ -0,0 +1,134 @@ +# pad-left [![NPM version](https://img.shields.io/npm/v/pad-left.svg?style=flat)](https://www.npmjs.com/package/pad-left) [![NPM downloads](https://img.shields.io/npm/dm/pad-left.svg?style=flat)](https://npmjs.org/package/pad-left) [![Build Status](https://img.shields.io/travis/jonschlinkert/pad-left.svg?style=flat)](https://travis-ci.org/jonschlinkert/pad-left) + +Left pad a string with zeros or a specified string. Fastest implementation. + +You might also be interested in [word-wrap](https://github.com/jonschlinkert/word-wrap). + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install pad-left --save +``` + +## Usage + +```js +var pad = require('pad-left'); +pad( '4', 4, '0') // 0004 +pad( '35', 4, '0') // 0035 +pad('459', 4, '0') // 0459 +``` + +## Benchmarks + +Benchmarks for node.js v6.1.0 versus [left-pad](https://github.com/stevemao/left-pad). + +```sh +# benchmark/fixtures/10-custom-char.js (37 bytes) + pad-left x 14,940,947 ops/sec ±0.81% (87 runs sampled) + left-pad x 7,901,604 ops/sec ±1.17% (86 runs sampled) + +# benchmark/fixtures/10.js (32 bytes) + pad-left x 13,305,123 ops/sec ±1.53% (84 runs sampled) + left-pad x 6,979,536 ops/sec ±1.13% (84 runs sampled) + +# benchmark/fixtures/100-custom-char.js (38 bytes) + pad-left x 14,227,637 ops/sec ±1.41% (81 runs sampled) + left-pad x 1,352,240 ops/sec ±1.51% (86 runs sampled) + +# benchmark/fixtures/100.js (34 bytes) + pad-left x 15,664,561 ops/sec ±0.99% (83 runs sampled) + left-pad x 1,247,316 ops/sec ±0.96% (87 runs sampled) + +# benchmark/fixtures/1000-custom-char.js (40 bytes) + pad-left x 15,210,294 ops/sec ±1.15% (87 runs sampled) + left-pad x 159,958 ops/sec ±1.01% (88 runs sampled) + +# benchmark/fixtures/1000.js (35 bytes) + pad-left x 14,157,425 ops/sec ±1.10% (88 runs sampled) + left-pad x 143,805 ops/sec ±1.08% (87 runs sampled) +``` + +Benchmarks for node.js v6.1.0 versus [stevemao/left-pad](https://github.com/stevemao/left-pad). + +```sh +# benchmark/fixtures/10-custom-char.js (37 bytes) + pad-left x 13,251,037 ops/sec ±1.40% (84 runs sampled) + left-pad x 10,745,530 ops/sec ±1.18% (86 runs sampled) + +# benchmark/fixtures/10.js (32 bytes) + pad-left x 13,644,357 ops/sec ±1.33% (87 runs sampled) + left-pad x 20,107,245 ops/sec ±1.00% (88 runs sampled) + +# benchmark/fixtures/100-custom-char.js (38 bytes) + pad-left x 15,650,330 ops/sec ±1.01% (86 runs sampled) + left-pad x 9,706,877 ops/sec ±1.13% (87 runs sampled) + +# benchmark/fixtures/1000-custom-char.js (40 bytes) + pad-left x 17,255,593 ops/sec ±0.99% (88 runs sampled) + left-pad x 6,312,637 ops/sec ±1.16% (87 runs sampled) + +# benchmark/fixtures/1000.js (35 bytes) + pad-left x 15,679,410 ops/sec ±0.99% (90 runs sampled) + left-pad x 6,439,580 ops/sec ±1.08% (86 runs sampled) +``` + +## Related projects + +You might also be interested in these projects: + +* [align-text](https://www.npmjs.com/package/align-text): Align the text in a string. | [homepage](https://github.com/jonschlinkert/align-text) +* [center-align](https://www.npmjs.com/package/center-align): Center-align the text in a string. | [homepage](https://github.com/jonschlinkert/center-align) +* [justified](https://www.npmjs.com/package/justified): Wrap words to a specified length and justified the text. | [homepage](https://github.com/jonschlinkert/justified) +* [pad-right](https://www.npmjs.com/package/pad-right): Right pad a string with zeros or a specified string. Fastest implementation. | [homepage](https://github.com/jonschlinkert/pad-right) +* [repeat-string](https://www.npmjs.com/package/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string. | [homepage](https://github.com/jonschlinkert/repeat-string) +* [right-align-keys](https://www.npmjs.com/package/right-align-keys): Right align the keys of an object. | [homepage](https://github.com/jonschlinkert/right-align-keys) +* [right-align-values](https://www.npmjs.com/package/right-align-values): Right align the values of a given property for each object in an array. Useful… [more](https://www.npmjs.com/package/right-align-values) | [homepage](https://github.com/jonschlinkert/right-align-values) +* [right-align](https://www.npmjs.com/package/right-align): Right-align the text in a string. | [homepage](https://github.com/jonschlinkert/right-align) +* [right-pad-keys](https://www.npmjs.com/package/right-pad-keys): Right pad the keys of an object. | [homepage](https://github.com/jonschlinkert/right-pad-keys) +* [right-pad-values](https://www.npmjs.com/package/right-pad-values): Right pad the values of a given property for each object in an array. Useful… [more](https://www.npmjs.com/package/right-pad-values) | [homepage](https://github.com/jonschlinkert/right-pad-values) +* [word-wrap](https://www.npmjs.com/package/word-wrap): Wrap words to a specified length. | [homepage](https://github.com/jonschlinkert/word-wrap) + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/pad-left/issues/new). + +## Building docs + +Generate readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install verb && npm run docs +``` + +Or, if [verb](https://github.com/verbose/verb) is installed globally: + +```sh +$ verb +``` + +## Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +## Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/pad-left/blob/master/LICENSE). + +*** + +_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on May 07, 2016._ \ No newline at end of file diff --git a/node_modules/pad-left/index.js b/node_modules/pad-left/index.js new file mode 100755 index 000000000..ecec233ca --- /dev/null +++ b/node_modules/pad-left/index.js @@ -0,0 +1,28 @@ +/*! + * pad-left + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT license. + */ + +'use strict'; + +var repeat = require('repeat-string'); + +module.exports = function padLeft(str, num, ch) { + str = str.toString(); + + if (typeof num === 'undefined') { + return str; + } + + if (ch === 0) { + ch = '0'; + } else if (ch) { + ch = ch.toString(); + } else { + ch = ' '; + } + + return repeat(ch, num - str.length) + str; +}; diff --git a/node_modules/pad-left/package.json b/node_modules/pad-left/package.json new file mode 100644 index 000000000..818be2235 --- /dev/null +++ b/node_modules/pad-left/package.json @@ -0,0 +1,119 @@ +{ + "_from": "pad-left@^2.0.0", + "_id": "pad-left@2.1.0", + "_inBundle": false, + "_integrity": "sha1-FuajstRKjhOMsIOMx8tAOk/J6ZQ=", + "_location": "/pad-left", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "pad-left@^2.0.0", + "name": "pad-left", + "escapedName": "pad-left", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/garnish" + ], + "_resolved": "https://registry.npmjs.org/pad-left/-/pad-left-2.1.0.tgz", + "_shasum": "16e6a3b2d44a8e138cb0838cc7cb403a4fc9e994", + "_spec": "pad-left@^2.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/garnish", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/pad-left/issues" + }, + "bundleDependencies": false, + "dependencies": { + "repeat-string": "^1.5.4" + }, + "deprecated": false, + "description": "Left pad a string with zeros or a specified string. Fastest implementation.", + "devDependencies": { + "benchmarked": "^0.2.5", + "gulp-format-md": "^0.1.9", + "left-pad": "github:stevemao/left-pad", + "minimist": "^1.2.0", + "mocha": "^2.4.5", + "should": "^8.3.1" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/pad-left", + "keywords": [ + "align", + "fill", + "left", + "pad", + "pad-left", + "padded", + "padding", + "spaces", + "string", + "zero", + "zero-fill", + "zeros" + ], + "license": "MIT", + "main": "index.js", + "name": "pad-left", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/pad-left.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "options": { + "helper": { + "copyright": { + "start": 2014 + } + } + }, + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "highlight": "word-wrap", + "list": [ + "align-text", + "center-align", + "justified", + "pad-right", + "repeat-string", + "right-align", + "right-align-keys", + "right-align-values", + "right-pad-keys", + "right-pad-values", + "word-wrap" + ] + }, + "reflinks": [ + "verb", + "left-pad" + ], + "lint": { + "reflinks": true + } + }, + "version": "2.1.0" +} diff --git a/node_modules/pad-right/LICENSE b/node_modules/pad-right/LICENSE new file mode 100644 index 000000000..b576e8d48 --- /dev/null +++ b/node_modules/pad-right/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/pad-right/README.md b/node_modules/pad-right/README.md new file mode 100644 index 000000000..97106f463 --- /dev/null +++ b/node_modules/pad-right/README.md @@ -0,0 +1,71 @@ +# pad-right [![NPM version](https://badge.fury.io/js/pad-right.svg)](http://badge.fury.io/js/pad-right) + +> Right pad a string with zeros or a specified string. Fastest implementation. + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i pad-right --save +``` + +## Run tests + +```bash +npm test +``` + +## Usage + +```js +var pad = require('pad-right'); +pad('abc', 5) +// 'abc00' +pad('abc', 10) +// 'abc0000000' +pad('abc', 10, '~') +// 'abc~~~~~~~' +pad('abc', 10, ' ') +// 'abc ' +``` + +## Related + +* [align-text](https://github.com/jonschlinkert/align-text): Align the text in a string. +* [center-align](https://github.com/jonschlinkert/center-align): Center-align the text in a string. +* [justified](https://github.com/jonschlinkert/justified): Wrap words to a specified length and justified the text. +* [pad-left](https://github.com/jonschlinkert/pad-left): Left pad a string with zeros or a specified string. Fastest implementation. +* [repeat-string](https://github.com/jonschlinkert/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string. +* [right-align](https://github.com/jonschlinkert/right-align): Right-align the text in a string. +* [right-align-keys](https://github.com/jonschlinkert/right-align-keys): Right align the keys of an object. +* [right-align-values](https://github.com/jonschlinkert/right-align-values): Right align the values of a given property for each object in an array. Useful… [more](https://github.com/jonschlinkert/right-align-values) +* [right-pad-keys](https://github.com/jonschlinkert/right-pad-keys): Right pad the keys of an object. +* [right-pad-values](https://github.com/jonschlinkert/right-pad-values): Right pad the values of a given property for each object in an array. Useful… [more](https://github.com/jonschlinkert/right-pad-values) +* [word-wrap](https://github.com/jonschlinkert/word-wrap): Wrap words to a specified length. + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/pad-right/issues/new) + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2014-2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 15, 2015._ \ No newline at end of file diff --git a/node_modules/pad-right/index.js b/node_modules/pad-right/index.js new file mode 100644 index 000000000..701276669 --- /dev/null +++ b/node_modules/pad-right/index.js @@ -0,0 +1,20 @@ +'use strict'; + +var repeat = require('repeat-string'); + +module.exports = function padLeft(val, num, str) { + var padding = ''; + var diff = num - val.length; + + // Breakpoints based on benchmarks to use the fastest approach + // for the given number of zeros + if (diff <= 5 && !str) { + padding = '00000'; + } else if (diff <= 25 && !str) { + padding = '000000000000000000000000000'; + } else { + return val + repeat(str || '0', diff); + } + + return val + padding.slice(0, diff); +}; diff --git a/node_modules/pad-right/package.json b/node_modules/pad-right/package.json new file mode 100644 index 000000000..af3a1214e --- /dev/null +++ b/node_modules/pad-right/package.json @@ -0,0 +1,95 @@ +{ + "_from": "pad-right@^0.2.2", + "_id": "pad-right@0.2.2", + "_inBundle": false, + "_integrity": "sha1-b7ySQEXSRPKiokRQMGDTv8YAl3Q=", + "_location": "/pad-right", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "pad-right@^0.2.2", + "name": "pad-right", + "escapedName": "pad-right", + "rawSpec": "^0.2.2", + "saveSpec": null, + "fetchSpec": "^0.2.2" + }, + "_requiredBy": [ + "/garnish" + ], + "_resolved": "https://registry.npmjs.org/pad-right/-/pad-right-0.2.2.tgz", + "_shasum": "6fbc924045d244f2a2a244503060d3bfc6009774", + "_spec": "pad-right@^0.2.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/garnish", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/pad-right/issues" + }, + "bundleDependencies": false, + "dependencies": { + "repeat-string": "^1.5.2" + }, + "deprecated": false, + "description": "Right pad a string with zeros or a specified string. Fastest implementation.", + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/pad-right", + "keywords": [ + "align", + "alignment", + "fill", + "left", + "pad", + "pad-left", + "pad-right", + "padded", + "padding", + "right", + "right-pad", + "spaces", + "string", + "zero", + "zero-fill", + "zeros" + ], + "license": "MIT", + "main": "index.js", + "name": "pad-right", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/pad-right.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "align-text", + "center-align", + "justified", + "pad-left", + "repeat-string", + "right-align", + "right-align-keys", + "right-align-values", + "right-pad-keys", + "right-pad-values", + "word-wrap" + ] + } + }, + "version": "0.2.2" +} diff --git a/node_modules/pako/CHANGELOG.md b/node_modules/pako/CHANGELOG.md new file mode 100644 index 000000000..3ba89dde0 --- /dev/null +++ b/node_modules/pako/CHANGELOG.md @@ -0,0 +1,118 @@ +1.0.6 / 2017-09-14 +------------------ + +- Improve @std/esm compatibility. + + +1.0.5 / 2017-03-17 +------------------ + +- Maintenance. More formal `zlib` attribution and related + changes, #93. Thanks to @bastien-roucaries for the help. + + +1.0.4 / 2016-12-15 +------------------ + +- Bump dev dependencies. +- Make sure `err.message` is filled on throw. +- Code examples for utf-16 string encoding & object compression. + + +1.0.3 / 2016-07-25 +------------------ + +- Maintenance: re-release to properly display latest version in npm registry + and badges. Because `npm publish` timestamp used instead of versions. + + +1.0.2 / 2016-07-21 +------------------ + +- Fixed nasty bug in deflate (wrong `d_buf` offset), which could cause + broken data in some rare cases. +- Also released as 0.2.9 to give chance to old dependents, not updated to 1.x + version. + + +1.0.1 / 2016-04-01 +------------------ + +- Added dictionary support. Thanks to @dignifiedquire. + + +1.0.0 / 2016-02-17 +------------------ + +- Maintenance release (semver, coding style). + + +0.2.8 / 2015-09-14 +------------------ + +- Fixed regression after 0.2.4 for edge conditions in inflate wrapper (#65). + Added more tests to cover possible cases. + + +0.2.7 / 2015-06-09 +------------------ + +- Added Z_SYNC_FLUSH support. Thanks to @TinoLange. + + +0.2.6 / 2015-03-24 +------------------ + +- Allow ArrayBuffer input. + + +0.2.5 / 2014-07-19 +------------------ + +- Workaround for Chrome 38.0.2096.0 script parser bug, #30. + + +0.2.4 / 2014-07-07 +------------------ + +- Fixed bug in inflate wrapper, #29 + + +0.2.3 / 2014-06-09 +------------------ + +- Maintenance release, dependencies update. + + +0.2.2 / 2014-06-04 +------------------ + +- Fixed iOS 5.1 Safari issue with `apply(typed_array)`, #26. + + +0.2.1 / 2014-05-01 +------------------ + +- Fixed collision on switch dynamic/fixed tables. + + +0.2.0 / 2014-04-18 +------------------ + +- Added custom gzip headers support. +- Added strings support. +- Improved memory allocations for small chunks. +- ZStream properties rename/cleanup. +- More coverage tests. + + +0.1.1 / 2014-03-20 +------------------ + +- Bugfixes for inflate/deflate. + + +0.1.0 / 2014-03-15 +------------------ + +- First release. diff --git a/node_modules/pako/LICENSE b/node_modules/pako/LICENSE new file mode 100644 index 000000000..a934ef8db --- /dev/null +++ b/node_modules/pako/LICENSE @@ -0,0 +1,21 @@ +(The MIT License) + +Copyright (C) 2014-2017 by Vitaly Puzrin and Andrei Tuputcyn + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/pako/README.md b/node_modules/pako/README.md new file mode 100644 index 000000000..c58572a59 --- /dev/null +++ b/node_modules/pako/README.md @@ -0,0 +1,182 @@ +pako +========================================== + +[![Build Status](https://travis-ci.org/nodeca/pako.svg?branch=master)](https://travis-ci.org/nodeca/pako) +[![NPM version](https://img.shields.io/npm/v/pako.svg)](https://www.npmjs.org/package/pako) + +> zlib port to javascript, very fast! + +__Why pako is cool:__ + +- Almost as fast in modern JS engines as C implementation (see benchmarks). +- Works in browsers, you can browserify any separate component. +- Chunking support for big blobs. +- Results are binary equal to well known [zlib](http://www.zlib.net/) (now contains ported zlib v1.2.8). + +This project was done to understand how fast JS can be and is it necessary to +develop native C modules for CPU-intensive tasks. Enjoy the result! + + +__Famous projects, using pako:__ + +- [browserify](http://browserify.org/) (via [browserify-zlib](https://github.com/devongovett/browserify-zlib)) +- [JSZip](http://stuk.github.io/jszip/) +- [mincer](https://github.com/nodeca/mincer) +- [JS-Git](https://github.com/creationix/js-git) and + [Tedit](https://chrome.google.com/webstore/detail/tedit-development-environ/ooekdijbnbbjdfjocaiflnjgoohnblgf) + by [@creationix](https://github.com/creationix) + + +__Benchmarks:__ + +``` +node v0.10.26, 1mb sample: + + deflate-dankogai x 4.73 ops/sec ±0.82% (15 runs sampled) + deflate-gildas x 4.58 ops/sec ±2.33% (15 runs sampled) + deflate-imaya x 3.22 ops/sec ±3.95% (12 runs sampled) + ! deflate-pako x 6.99 ops/sec ±0.51% (21 runs sampled) + deflate-pako-string x 5.89 ops/sec ±0.77% (18 runs sampled) + deflate-pako-untyped x 4.39 ops/sec ±1.58% (14 runs sampled) + * deflate-zlib x 14.71 ops/sec ±4.23% (59 runs sampled) + inflate-dankogai x 32.16 ops/sec ±0.13% (56 runs sampled) + inflate-imaya x 30.35 ops/sec ±0.92% (53 runs sampled) + ! inflate-pako x 69.89 ops/sec ±1.46% (71 runs sampled) + inflate-pako-string x 19.22 ops/sec ±1.86% (49 runs sampled) + inflate-pako-untyped x 17.19 ops/sec ±0.85% (32 runs sampled) + * inflate-zlib x 70.03 ops/sec ±1.64% (81 runs sampled) + +node v0.11.12, 1mb sample: + + deflate-dankogai x 5.60 ops/sec ±0.49% (17 runs sampled) + deflate-gildas x 5.06 ops/sec ±6.00% (16 runs sampled) + deflate-imaya x 3.52 ops/sec ±3.71% (13 runs sampled) + ! deflate-pako x 11.52 ops/sec ±0.22% (32 runs sampled) + deflate-pako-string x 9.53 ops/sec ±1.12% (27 runs sampled) + deflate-pako-untyped x 5.44 ops/sec ±0.72% (17 runs sampled) + * deflate-zlib x 14.05 ops/sec ±3.34% (63 runs sampled) + inflate-dankogai x 42.19 ops/sec ±0.09% (56 runs sampled) + inflate-imaya x 79.68 ops/sec ±1.07% (68 runs sampled) + ! inflate-pako x 97.52 ops/sec ±0.83% (80 runs sampled) + inflate-pako-string x 45.19 ops/sec ±1.69% (57 runs sampled) + inflate-pako-untyped x 24.35 ops/sec ±2.59% (40 runs sampled) + * inflate-zlib x 60.32 ops/sec ±1.36% (69 runs sampled) +``` + +zlib's test is partially affected by marshalling (that make sense for inflate only). +You can change deflate level to 0 in benchmark source, to investigate details. +For deflate level 6 results can be considered as correct. + +__Install:__ + +node.js: + +``` +npm install pako +``` + +browser: + +``` +bower install pako +``` + + +Example & API +------------- + +Full docs - http://nodeca.github.io/pako/ + +```javascript +var pako = require('pako'); + +// Deflate +// +var input = new Uint8Array(); +//... fill input data here +var output = pako.deflate(input); + +// Inflate (simple wrapper can throw exception on broken stream) +// +var compressed = new Uint8Array(); +//... fill data to uncompress here +try { + var result = pako.inflate(compressed); +} catch (err) { + console.log(err); +} + +// +// Alternate interface for chunking & without exceptions +// + +var inflator = new pako.Inflate(); + +inflator.push(chunk1, false); +inflator.push(chunk2, false); +... +inflator.push(chunkN, true); // true -> last chunk + +if (inflator.err) { + console.log(inflator.msg); +} + +var output = inflator.result; + +``` + +Sometime you can wish to work with strings. For example, to send +big objects as json to server. Pako detects input data type. You can +force output to be string with option `{ to: 'string' }`. + +```javascript +var pako = require('pako'); + +var test = { my: 'super', puper: [456, 567], awesome: 'pako' }; + +var binaryString = pako.deflate(JSON.stringify(test), { to: 'string' }); + +// +// Here you can do base64 encode, make xhr requests and so on. +// + +var restored = JSON.parse(pako.inflate(binaryString, { to: 'string' })); +``` + + +Notes +----- + +Pako does not contain some specific zlib functions: + +- __deflate__ - methods `deflateCopy`, `deflateBound`, `deflateParams`, + `deflatePending`, `deflatePrime`, `deflateTune`. +- __inflate__ - methods `inflateCopy`, `inflateMark`, + `inflatePrime`, `inflateGetDictionary`, `inflateSync`, `inflateSyncPoint`, `inflateUndermine`. +- High level inflate/deflate wrappers (classes) may not support some flush + modes. Those should work: Z_NO_FLUSH, Z_FINISH, Z_SYNC_FLUSH. + + +Authors +------- + +- Andrey Tupitsin [@anrd83](https://github.com/andr83) +- Vitaly Puzrin [@puzrin](https://github.com/puzrin) + +Personal thanks to: + +- Vyacheslav Egorov ([@mraleph](https://github.com/mraleph)) for his awesome + tutorials about optimising JS code for v8, [IRHydra](http://mrale.ph/irhydra/) + tool and his advices. +- David Duponchel ([@dduponchel](https://github.com/dduponchel)) for help with + testing. + +Original implementation (in C): + +- [zlib](http://zlib.net/) by Jean-loup Gailly and Mark Adler. + + +License +------- + +MIT diff --git a/node_modules/pako/dist/pako.js b/node_modules/pako/dist/pako.js new file mode 100644 index 000000000..fc92282a0 --- /dev/null +++ b/node_modules/pako/dist/pako.js @@ -0,0 +1,6809 @@ +/* pako 1.0.6 nodeca/pako */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.pako = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o Array + * + * Chunks of output data, if [[Deflate#onData]] not overridden. + **/ + +/** + * Deflate.result -> Uint8Array|Array + * + * Compressed result, generated by default [[Deflate#onData]] + * and [[Deflate#onEnd]] handlers. Filled after you push last chunk + * (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you + * push a chunk with explicit flush (call [[Deflate#push]] with + * `Z_SYNC_FLUSH` param). + **/ + +/** + * Deflate.err -> Number + * + * Error code after deflate finished. 0 (Z_OK) on success. + * You will not need it in real life, because deflate errors + * are possible only on wrong options or bad `onData` / `onEnd` + * custom handlers. + **/ + +/** + * Deflate.msg -> String + * + * Error message, if [[Deflate.err]] != 0 + **/ + + +/** + * new Deflate(options) + * - options (Object): zlib deflate options. + * + * Creates new deflator instance with specified params. Throws exception + * on bad params. Supported options: + * + * - `level` + * - `windowBits` + * - `memLevel` + * - `strategy` + * - `dictionary` + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information on these. + * + * Additional options, for internal needs: + * + * - `chunkSize` - size of generated data chunks (16K by default) + * - `raw` (Boolean) - do raw deflate + * - `gzip` (Boolean) - create gzip wrapper + * - `to` (String) - if equal to 'string', then result will be "binary string" + * (each char code [0..255]) + * - `header` (Object) - custom header for gzip + * - `text` (Boolean) - true if compressed data believed to be text + * - `time` (Number) - modification time, unix timestamp + * - `os` (Number) - operation system code + * - `extra` (Array) - array of bytes with extra data (max 65536) + * - `name` (String) - file name (binary string) + * - `comment` (String) - comment (binary string) + * - `hcrc` (Boolean) - true if header crc should be added + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) + * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); + * + * var deflate = new pako.Deflate({ level: 3}); + * + * deflate.push(chunk1, false); + * deflate.push(chunk2, true); // true -> last chunk + * + * if (deflate.err) { throw new Error(deflate.err); } + * + * console.log(deflate.result); + * ``` + **/ +function Deflate(options) { + if (!(this instanceof Deflate)) return new Deflate(options); + + this.options = utils.assign({ + level: Z_DEFAULT_COMPRESSION, + method: Z_DEFLATED, + chunkSize: 16384, + windowBits: 15, + memLevel: 8, + strategy: Z_DEFAULT_STRATEGY, + to: '' + }, options || {}); + + var opt = this.options; + + if (opt.raw && (opt.windowBits > 0)) { + opt.windowBits = -opt.windowBits; + } + + else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) { + opt.windowBits += 16; + } + + this.err = 0; // error code, if happens (0 = Z_OK) + this.msg = ''; // error message + this.ended = false; // used to avoid multiple onEnd() calls + this.chunks = []; // chunks of compressed data + + this.strm = new ZStream(); + this.strm.avail_out = 0; + + var status = zlib_deflate.deflateInit2( + this.strm, + opt.level, + opt.method, + opt.windowBits, + opt.memLevel, + opt.strategy + ); + + if (status !== Z_OK) { + throw new Error(msg[status]); + } + + if (opt.header) { + zlib_deflate.deflateSetHeader(this.strm, opt.header); + } + + if (opt.dictionary) { + var dict; + // Convert data if needed + if (typeof opt.dictionary === 'string') { + // If we need to compress text, change encoding to utf8. + dict = strings.string2buf(opt.dictionary); + } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { + dict = new Uint8Array(opt.dictionary); + } else { + dict = opt.dictionary; + } + + status = zlib_deflate.deflateSetDictionary(this.strm, dict); + + if (status !== Z_OK) { + throw new Error(msg[status]); + } + + this._dict_set = true; + } +} + +/** + * Deflate#push(data[, mode]) -> Boolean + * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be + * converted to utf8 byte sequence. + * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. + * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH. + * + * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with + * new compressed chunks. Returns `true` on success. The last data block must have + * mode Z_FINISH (or `true`). That will flush internal pending buffers and call + * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you + * can use mode Z_SYNC_FLUSH, keeping the compression context. + * + * On fail call [[Deflate#onEnd]] with error code and return false. + * + * We strongly recommend to use `Uint8Array` on input for best speed (output + * array format is detected automatically). Also, don't skip last param and always + * use the same type in your code (boolean or number). That will improve JS speed. + * + * For regular `Array`-s make sure all elements are [0..255]. + * + * ##### Example + * + * ```javascript + * push(chunk, false); // push one of data chunks + * ... + * push(chunk, true); // push last chunk + * ``` + **/ +Deflate.prototype.push = function (data, mode) { + var strm = this.strm; + var chunkSize = this.options.chunkSize; + var status, _mode; + + if (this.ended) { return false; } + + _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH); + + // Convert data if needed + if (typeof data === 'string') { + // If we need to compress text, change encoding to utf8. + strm.input = strings.string2buf(data); + } else if (toString.call(data) === '[object ArrayBuffer]') { + strm.input = new Uint8Array(data); + } else { + strm.input = data; + } + + strm.next_in = 0; + strm.avail_in = strm.input.length; + + do { + if (strm.avail_out === 0) { + strm.output = new utils.Buf8(chunkSize); + strm.next_out = 0; + strm.avail_out = chunkSize; + } + status = zlib_deflate.deflate(strm, _mode); /* no bad return value */ + + if (status !== Z_STREAM_END && status !== Z_OK) { + this.onEnd(status); + this.ended = true; + return false; + } + if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) { + if (this.options.to === 'string') { + this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out))); + } else { + this.onData(utils.shrinkBuf(strm.output, strm.next_out)); + } + } + } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END); + + // Finalize on the last chunk. + if (_mode === Z_FINISH) { + status = zlib_deflate.deflateEnd(this.strm); + this.onEnd(status); + this.ended = true; + return status === Z_OK; + } + + // callback interim results if Z_SYNC_FLUSH. + if (_mode === Z_SYNC_FLUSH) { + this.onEnd(Z_OK); + strm.avail_out = 0; + return true; + } + + return true; +}; + + +/** + * Deflate#onData(chunk) -> Void + * - chunk (Uint8Array|Array|String): output data. Type of array depends + * on js engine support. When string output requested, each chunk + * will be string. + * + * By default, stores data blocks in `chunks[]` property and glue + * those in `onEnd`. Override this handler, if you need another behaviour. + **/ +Deflate.prototype.onData = function (chunk) { + this.chunks.push(chunk); +}; + + +/** + * Deflate#onEnd(status) -> Void + * - status (Number): deflate status. 0 (Z_OK) on success, + * other if not. + * + * Called once after you tell deflate that the input stream is + * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH) + * or if an error happened. By default - join collected chunks, + * free memory and fill `results` / `err` properties. + **/ +Deflate.prototype.onEnd = function (status) { + // On success - join + if (status === Z_OK) { + if (this.options.to === 'string') { + this.result = this.chunks.join(''); + } else { + this.result = utils.flattenChunks(this.chunks); + } + } + this.chunks = []; + this.err = status; + this.msg = this.strm.msg; +}; + + +/** + * deflate(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to compress. + * - options (Object): zlib deflate options. + * + * Compress `data` with deflate algorithm and `options`. + * + * Supported options are: + * + * - level + * - windowBits + * - memLevel + * - strategy + * - dictionary + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information on these. + * + * Sugar (options): + * + * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify + * negative windowBits implicitly. + * - `to` (String) - if equal to 'string', then result will be "binary string" + * (each char code [0..255]) + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , data = Uint8Array([1,2,3,4,5,6,7,8,9]); + * + * console.log(pako.deflate(data)); + * ``` + **/ +function deflate(input, options) { + var deflator = new Deflate(options); + + deflator.push(input, true); + + // That will never happens, if you don't cheat with options :) + if (deflator.err) { throw deflator.msg || msg[deflator.err]; } + + return deflator.result; +} + + +/** + * deflateRaw(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to compress. + * - options (Object): zlib deflate options. + * + * The same as [[deflate]], but creates raw data, without wrapper + * (header and adler32 crc). + **/ +function deflateRaw(input, options) { + options = options || {}; + options.raw = true; + return deflate(input, options); +} + + +/** + * gzip(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to compress. + * - options (Object): zlib deflate options. + * + * The same as [[deflate]], but create gzip wrapper instead of + * deflate one. + **/ +function gzip(input, options) { + options = options || {}; + options.gzip = true; + return deflate(input, options); +} + + +exports.Deflate = Deflate; +exports.deflate = deflate; +exports.deflateRaw = deflateRaw; +exports.gzip = gzip; + +},{"./utils/common":3,"./utils/strings":4,"./zlib/deflate":8,"./zlib/messages":13,"./zlib/zstream":15}],2:[function(require,module,exports){ +'use strict'; + + +var zlib_inflate = require('./zlib/inflate'); +var utils = require('./utils/common'); +var strings = require('./utils/strings'); +var c = require('./zlib/constants'); +var msg = require('./zlib/messages'); +var ZStream = require('./zlib/zstream'); +var GZheader = require('./zlib/gzheader'); + +var toString = Object.prototype.toString; + +/** + * class Inflate + * + * Generic JS-style wrapper for zlib calls. If you don't need + * streaming behaviour - use more simple functions: [[inflate]] + * and [[inflateRaw]]. + **/ + +/* internal + * inflate.chunks -> Array + * + * Chunks of output data, if [[Inflate#onData]] not overridden. + **/ + +/** + * Inflate.result -> Uint8Array|Array|String + * + * Uncompressed result, generated by default [[Inflate#onData]] + * and [[Inflate#onEnd]] handlers. Filled after you push last chunk + * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you + * push a chunk with explicit flush (call [[Inflate#push]] with + * `Z_SYNC_FLUSH` param). + **/ + +/** + * Inflate.err -> Number + * + * Error code after inflate finished. 0 (Z_OK) on success. + * Should be checked if broken data possible. + **/ + +/** + * Inflate.msg -> String + * + * Error message, if [[Inflate.err]] != 0 + **/ + + +/** + * new Inflate(options) + * - options (Object): zlib inflate options. + * + * Creates new inflator instance with specified params. Throws exception + * on bad params. Supported options: + * + * - `windowBits` + * - `dictionary` + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information on these. + * + * Additional options, for internal needs: + * + * - `chunkSize` - size of generated data chunks (16K by default) + * - `raw` (Boolean) - do raw inflate + * - `to` (String) - if equal to 'string', then result will be converted + * from utf8 to utf16 (javascript) string. When string output requested, + * chunk length can differ from `chunkSize`, depending on content. + * + * By default, when no options set, autodetect deflate/gzip data format via + * wrapper header. + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) + * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); + * + * var inflate = new pako.Inflate({ level: 3}); + * + * inflate.push(chunk1, false); + * inflate.push(chunk2, true); // true -> last chunk + * + * if (inflate.err) { throw new Error(inflate.err); } + * + * console.log(inflate.result); + * ``` + **/ +function Inflate(options) { + if (!(this instanceof Inflate)) return new Inflate(options); + + this.options = utils.assign({ + chunkSize: 16384, + windowBits: 0, + to: '' + }, options || {}); + + var opt = this.options; + + // Force window size for `raw` data, if not set directly, + // because we have no header for autodetect. + if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) { + opt.windowBits = -opt.windowBits; + if (opt.windowBits === 0) { opt.windowBits = -15; } + } + + // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate + if ((opt.windowBits >= 0) && (opt.windowBits < 16) && + !(options && options.windowBits)) { + opt.windowBits += 32; + } + + // Gzip header has no info about windows size, we can do autodetect only + // for deflate. So, if window size not set, force it to max when gzip possible + if ((opt.windowBits > 15) && (opt.windowBits < 48)) { + // bit 3 (16) -> gzipped data + // bit 4 (32) -> autodetect gzip/deflate + if ((opt.windowBits & 15) === 0) { + opt.windowBits |= 15; + } + } + + this.err = 0; // error code, if happens (0 = Z_OK) + this.msg = ''; // error message + this.ended = false; // used to avoid multiple onEnd() calls + this.chunks = []; // chunks of compressed data + + this.strm = new ZStream(); + this.strm.avail_out = 0; + + var status = zlib_inflate.inflateInit2( + this.strm, + opt.windowBits + ); + + if (status !== c.Z_OK) { + throw new Error(msg[status]); + } + + this.header = new GZheader(); + + zlib_inflate.inflateGetHeader(this.strm, this.header); +} + +/** + * Inflate#push(data[, mode]) -> Boolean + * - data (Uint8Array|Array|ArrayBuffer|String): input data + * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. + * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH. + * + * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with + * new output chunks. Returns `true` on success. The last data block must have + * mode Z_FINISH (or `true`). That will flush internal pending buffers and call + * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you + * can use mode Z_SYNC_FLUSH, keeping the decompression context. + * + * On fail call [[Inflate#onEnd]] with error code and return false. + * + * We strongly recommend to use `Uint8Array` on input for best speed (output + * format is detected automatically). Also, don't skip last param and always + * use the same type in your code (boolean or number). That will improve JS speed. + * + * For regular `Array`-s make sure all elements are [0..255]. + * + * ##### Example + * + * ```javascript + * push(chunk, false); // push one of data chunks + * ... + * push(chunk, true); // push last chunk + * ``` + **/ +Inflate.prototype.push = function (data, mode) { + var strm = this.strm; + var chunkSize = this.options.chunkSize; + var dictionary = this.options.dictionary; + var status, _mode; + var next_out_utf8, tail, utf8str; + var dict; + + // Flag to properly process Z_BUF_ERROR on testing inflate call + // when we check that all output data was flushed. + var allowBufError = false; + + if (this.ended) { return false; } + _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH); + + // Convert data if needed + if (typeof data === 'string') { + // Only binary strings can be decompressed on practice + strm.input = strings.binstring2buf(data); + } else if (toString.call(data) === '[object ArrayBuffer]') { + strm.input = new Uint8Array(data); + } else { + strm.input = data; + } + + strm.next_in = 0; + strm.avail_in = strm.input.length; + + do { + if (strm.avail_out === 0) { + strm.output = new utils.Buf8(chunkSize); + strm.next_out = 0; + strm.avail_out = chunkSize; + } + + status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */ + + if (status === c.Z_NEED_DICT && dictionary) { + // Convert data if needed + if (typeof dictionary === 'string') { + dict = strings.string2buf(dictionary); + } else if (toString.call(dictionary) === '[object ArrayBuffer]') { + dict = new Uint8Array(dictionary); + } else { + dict = dictionary; + } + + status = zlib_inflate.inflateSetDictionary(this.strm, dict); + + } + + if (status === c.Z_BUF_ERROR && allowBufError === true) { + status = c.Z_OK; + allowBufError = false; + } + + if (status !== c.Z_STREAM_END && status !== c.Z_OK) { + this.onEnd(status); + this.ended = true; + return false; + } + + if (strm.next_out) { + if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) { + + if (this.options.to === 'string') { + + next_out_utf8 = strings.utf8border(strm.output, strm.next_out); + + tail = strm.next_out - next_out_utf8; + utf8str = strings.buf2string(strm.output, next_out_utf8); + + // move tail + strm.next_out = tail; + strm.avail_out = chunkSize - tail; + if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); } + + this.onData(utf8str); + + } else { + this.onData(utils.shrinkBuf(strm.output, strm.next_out)); + } + } + } + + // When no more input data, we should check that internal inflate buffers + // are flushed. The only way to do it when avail_out = 0 - run one more + // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR. + // Here we set flag to process this error properly. + // + // NOTE. Deflate does not return error in this case and does not needs such + // logic. + if (strm.avail_in === 0 && strm.avail_out === 0) { + allowBufError = true; + } + + } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END); + + if (status === c.Z_STREAM_END) { + _mode = c.Z_FINISH; + } + + // Finalize on the last chunk. + if (_mode === c.Z_FINISH) { + status = zlib_inflate.inflateEnd(this.strm); + this.onEnd(status); + this.ended = true; + return status === c.Z_OK; + } + + // callback interim results if Z_SYNC_FLUSH. + if (_mode === c.Z_SYNC_FLUSH) { + this.onEnd(c.Z_OK); + strm.avail_out = 0; + return true; + } + + return true; +}; + + +/** + * Inflate#onData(chunk) -> Void + * - chunk (Uint8Array|Array|String): output data. Type of array depends + * on js engine support. When string output requested, each chunk + * will be string. + * + * By default, stores data blocks in `chunks[]` property and glue + * those in `onEnd`. Override this handler, if you need another behaviour. + **/ +Inflate.prototype.onData = function (chunk) { + this.chunks.push(chunk); +}; + + +/** + * Inflate#onEnd(status) -> Void + * - status (Number): inflate status. 0 (Z_OK) on success, + * other if not. + * + * Called either after you tell inflate that the input stream is + * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH) + * or if an error happened. By default - join collected chunks, + * free memory and fill `results` / `err` properties. + **/ +Inflate.prototype.onEnd = function (status) { + // On success - join + if (status === c.Z_OK) { + if (this.options.to === 'string') { + // Glue & convert here, until we teach pako to send + // utf8 aligned strings to onData + this.result = this.chunks.join(''); + } else { + this.result = utils.flattenChunks(this.chunks); + } + } + this.chunks = []; + this.err = status; + this.msg = this.strm.msg; +}; + + +/** + * inflate(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * Decompress `data` with inflate/ungzip and `options`. Autodetect + * format via wrapper header by default. That's why we don't provide + * separate `ungzip` method. + * + * Supported options are: + * + * - windowBits + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information. + * + * Sugar (options): + * + * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify + * negative windowBits implicitly. + * - `to` (String) - if equal to 'string', then result will be converted + * from utf8 to utf16 (javascript) string. When string output requested, + * chunk length can differ from `chunkSize`, depending on content. + * + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , input = pako.deflate([1,2,3,4,5,6,7,8,9]) + * , output; + * + * try { + * output = pako.inflate(input); + * } catch (err) + * console.log(err); + * } + * ``` + **/ +function inflate(input, options) { + var inflator = new Inflate(options); + + inflator.push(input, true); + + // That will never happens, if you don't cheat with options :) + if (inflator.err) { throw inflator.msg || msg[inflator.err]; } + + return inflator.result; +} + + +/** + * inflateRaw(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * The same as [[inflate]], but creates raw data, without wrapper + * (header and adler32 crc). + **/ +function inflateRaw(input, options) { + options = options || {}; + options.raw = true; + return inflate(input, options); +} + + +/** + * ungzip(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * Just shortcut to [[inflate]], because it autodetects format + * by header.content. Done for convenience. + **/ + + +exports.Inflate = Inflate; +exports.inflate = inflate; +exports.inflateRaw = inflateRaw; +exports.ungzip = inflate; + +},{"./utils/common":3,"./utils/strings":4,"./zlib/constants":6,"./zlib/gzheader":9,"./zlib/inflate":11,"./zlib/messages":13,"./zlib/zstream":15}],3:[function(require,module,exports){ +'use strict'; + + +var TYPED_OK = (typeof Uint8Array !== 'undefined') && + (typeof Uint16Array !== 'undefined') && + (typeof Int32Array !== 'undefined'); + +function _has(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} + +exports.assign = function (obj /*from1, from2, from3, ...*/) { + var sources = Array.prototype.slice.call(arguments, 1); + while (sources.length) { + var source = sources.shift(); + if (!source) { continue; } + + if (typeof source !== 'object') { + throw new TypeError(source + 'must be non-object'); + } + + for (var p in source) { + if (_has(source, p)) { + obj[p] = source[p]; + } + } + } + + return obj; +}; + + +// reduce buffer size, avoiding mem copy +exports.shrinkBuf = function (buf, size) { + if (buf.length === size) { return buf; } + if (buf.subarray) { return buf.subarray(0, size); } + buf.length = size; + return buf; +}; + + +var fnTyped = { + arraySet: function (dest, src, src_offs, len, dest_offs) { + if (src.subarray && dest.subarray) { + dest.set(src.subarray(src_offs, src_offs + len), dest_offs); + return; + } + // Fallback to ordinary array + for (var i = 0; i < len; i++) { + dest[dest_offs + i] = src[src_offs + i]; + } + }, + // Join array of chunks to single array. + flattenChunks: function (chunks) { + var i, l, len, pos, chunk, result; + + // calculate data length + len = 0; + for (i = 0, l = chunks.length; i < l; i++) { + len += chunks[i].length; + } + + // join chunks + result = new Uint8Array(len); + pos = 0; + for (i = 0, l = chunks.length; i < l; i++) { + chunk = chunks[i]; + result.set(chunk, pos); + pos += chunk.length; + } + + return result; + } +}; + +var fnUntyped = { + arraySet: function (dest, src, src_offs, len, dest_offs) { + for (var i = 0; i < len; i++) { + dest[dest_offs + i] = src[src_offs + i]; + } + }, + // Join array of chunks to single array. + flattenChunks: function (chunks) { + return [].concat.apply([], chunks); + } +}; + + +// Enable/Disable typed arrays use, for testing +// +exports.setTyped = function (on) { + if (on) { + exports.Buf8 = Uint8Array; + exports.Buf16 = Uint16Array; + exports.Buf32 = Int32Array; + exports.assign(exports, fnTyped); + } else { + exports.Buf8 = Array; + exports.Buf16 = Array; + exports.Buf32 = Array; + exports.assign(exports, fnUntyped); + } +}; + +exports.setTyped(TYPED_OK); + +},{}],4:[function(require,module,exports){ +// String encode/decode helpers +'use strict'; + + +var utils = require('./common'); + + +// Quick check if we can use fast array to bin string conversion +// +// - apply(Array) can fail on Android 2.2 +// - apply(Uint8Array) can fail on iOS 5.1 Safari +// +var STR_APPLY_OK = true; +var STR_APPLY_UIA_OK = true; + +try { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; } +try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; } + + +// Table with utf8 lengths (calculated by first byte of sequence) +// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS, +// because max possible codepoint is 0x10ffff +var _utf8len = new utils.Buf8(256); +for (var q = 0; q < 256; q++) { + _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1); +} +_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start + + +// convert string to array (typed, when possible) +exports.string2buf = function (str) { + var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; + + // count binary size + for (m_pos = 0; m_pos < str_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4; + } + + // allocate buffer + buf = new utils.Buf8(buf_len); + + // convert + for (i = 0, m_pos = 0; i < buf_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + if (c < 0x80) { + /* one byte */ + buf[i++] = c; + } else if (c < 0x800) { + /* two bytes */ + buf[i++] = 0xC0 | (c >>> 6); + buf[i++] = 0x80 | (c & 0x3f); + } else if (c < 0x10000) { + /* three bytes */ + buf[i++] = 0xE0 | (c >>> 12); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } else { + /* four bytes */ + buf[i++] = 0xf0 | (c >>> 18); + buf[i++] = 0x80 | (c >>> 12 & 0x3f); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } + } + + return buf; +}; + +// Helper (used in 2 places) +function buf2binstring(buf, len) { + // use fallback for big arrays to avoid stack overflow + if (len < 65537) { + if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) { + return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len)); + } + } + + var result = ''; + for (var i = 0; i < len; i++) { + result += String.fromCharCode(buf[i]); + } + return result; +} + + +// Convert byte array to binary string +exports.buf2binstring = function (buf) { + return buf2binstring(buf, buf.length); +}; + + +// Convert binary string (typed, when possible) +exports.binstring2buf = function (str) { + var buf = new utils.Buf8(str.length); + for (var i = 0, len = buf.length; i < len; i++) { + buf[i] = str.charCodeAt(i); + } + return buf; +}; + + +// convert array to string +exports.buf2string = function (buf, max) { + var i, out, c, c_len; + var len = max || buf.length; + + // Reserve max possible length (2 words per char) + // NB: by unknown reasons, Array is significantly faster for + // String.fromCharCode.apply than Uint16Array. + var utf16buf = new Array(len * 2); + + for (out = 0, i = 0; i < len;) { + c = buf[i++]; + // quick process ascii + if (c < 0x80) { utf16buf[out++] = c; continue; } + + c_len = _utf8len[c]; + // skip 5 & 6 byte codes + if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; } + + // apply mask on first byte + c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07; + // join the rest + while (c_len > 1 && i < len) { + c = (c << 6) | (buf[i++] & 0x3f); + c_len--; + } + + // terminated by end of string? + if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; } + + if (c < 0x10000) { + utf16buf[out++] = c; + } else { + c -= 0x10000; + utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff); + utf16buf[out++] = 0xdc00 | (c & 0x3ff); + } + } + + return buf2binstring(utf16buf, out); +}; + + +// Calculate max possible position in utf8 buffer, +// that will not break sequence. If that's not possible +// - (very small limits) return max size as is. +// +// buf[] - utf8 bytes array +// max - length limit (mandatory); +exports.utf8border = function (buf, max) { + var pos; + + max = max || buf.length; + if (max > buf.length) { max = buf.length; } + + // go back from last position, until start of sequence found + pos = max - 1; + while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; } + + // Very small and broken sequence, + // return max, because we should return something anyway. + if (pos < 0) { return max; } + + // If we came to start of buffer - that means buffer is too small, + // return max too. + if (pos === 0) { return max; } + + return (pos + _utf8len[buf[pos]] > max) ? pos : max; +}; + +},{"./common":3}],5:[function(require,module,exports){ +'use strict'; + +// Note: adler32 takes 12% for level 0 and 2% for level 6. +// It isn't worth it to make additional optimizations as in original. +// Small size is preferable. + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +function adler32(adler, buf, len, pos) { + var s1 = (adler & 0xffff) |0, + s2 = ((adler >>> 16) & 0xffff) |0, + n = 0; + + while (len !== 0) { + // Set limit ~ twice less than 5552, to keep + // s2 in 31-bits, because we force signed ints. + // in other case %= will fail. + n = len > 2000 ? 2000 : len; + len -= n; + + do { + s1 = (s1 + buf[pos++]) |0; + s2 = (s2 + s1) |0; + } while (--n); + + s1 %= 65521; + s2 %= 65521; + } + + return (s1 | (s2 << 16)) |0; +} + + +module.exports = adler32; + +},{}],6:[function(require,module,exports){ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +module.exports = { + + /* Allowed flush values; see deflate() and inflate() below for details */ + Z_NO_FLUSH: 0, + Z_PARTIAL_FLUSH: 1, + Z_SYNC_FLUSH: 2, + Z_FULL_FLUSH: 3, + Z_FINISH: 4, + Z_BLOCK: 5, + Z_TREES: 6, + + /* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ + Z_OK: 0, + Z_STREAM_END: 1, + Z_NEED_DICT: 2, + Z_ERRNO: -1, + Z_STREAM_ERROR: -2, + Z_DATA_ERROR: -3, + //Z_MEM_ERROR: -4, + Z_BUF_ERROR: -5, + //Z_VERSION_ERROR: -6, + + /* compression levels */ + Z_NO_COMPRESSION: 0, + Z_BEST_SPEED: 1, + Z_BEST_COMPRESSION: 9, + Z_DEFAULT_COMPRESSION: -1, + + + Z_FILTERED: 1, + Z_HUFFMAN_ONLY: 2, + Z_RLE: 3, + Z_FIXED: 4, + Z_DEFAULT_STRATEGY: 0, + + /* Possible values of the data_type field (though see inflate()) */ + Z_BINARY: 0, + Z_TEXT: 1, + //Z_ASCII: 1, // = Z_TEXT (deprecated) + Z_UNKNOWN: 2, + + /* The deflate compression method */ + Z_DEFLATED: 8 + //Z_NULL: null // Use -1 or null inline, depending on var type +}; + +},{}],7:[function(require,module,exports){ +'use strict'; + +// Note: we can't get significant speed boost here. +// So write code to minimize size - no pregenerated tables +// and array tools dependencies. + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +// Use ordinary array, since untyped makes no boost here +function makeTable() { + var c, table = []; + + for (var n = 0; n < 256; n++) { + c = n; + for (var k = 0; k < 8; k++) { + c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); + } + table[n] = c; + } + + return table; +} + +// Create table on load. Just 255 signed longs. Not a problem. +var crcTable = makeTable(); + + +function crc32(crc, buf, len, pos) { + var t = crcTable, + end = pos + len; + + crc ^= -1; + + for (var i = pos; i < end; i++) { + crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF]; + } + + return (crc ^ (-1)); // >>> 0; +} + + +module.exports = crc32; + +},{}],8:[function(require,module,exports){ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +var utils = require('../utils/common'); +var trees = require('./trees'); +var adler32 = require('./adler32'); +var crc32 = require('./crc32'); +var msg = require('./messages'); + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + + +/* Allowed flush values; see deflate() and inflate() below for details */ +var Z_NO_FLUSH = 0; +var Z_PARTIAL_FLUSH = 1; +//var Z_SYNC_FLUSH = 2; +var Z_FULL_FLUSH = 3; +var Z_FINISH = 4; +var Z_BLOCK = 5; +//var Z_TREES = 6; + + +/* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ +var Z_OK = 0; +var Z_STREAM_END = 1; +//var Z_NEED_DICT = 2; +//var Z_ERRNO = -1; +var Z_STREAM_ERROR = -2; +var Z_DATA_ERROR = -3; +//var Z_MEM_ERROR = -4; +var Z_BUF_ERROR = -5; +//var Z_VERSION_ERROR = -6; + + +/* compression levels */ +//var Z_NO_COMPRESSION = 0; +//var Z_BEST_SPEED = 1; +//var Z_BEST_COMPRESSION = 9; +var Z_DEFAULT_COMPRESSION = -1; + + +var Z_FILTERED = 1; +var Z_HUFFMAN_ONLY = 2; +var Z_RLE = 3; +var Z_FIXED = 4; +var Z_DEFAULT_STRATEGY = 0; + +/* Possible values of the data_type field (though see inflate()) */ +//var Z_BINARY = 0; +//var Z_TEXT = 1; +//var Z_ASCII = 1; // = Z_TEXT +var Z_UNKNOWN = 2; + + +/* The deflate compression method */ +var Z_DEFLATED = 8; + +/*============================================================================*/ + + +var MAX_MEM_LEVEL = 9; +/* Maximum value for memLevel in deflateInit2 */ +var MAX_WBITS = 15; +/* 32K LZ77 window */ +var DEF_MEM_LEVEL = 8; + + +var LENGTH_CODES = 29; +/* number of length codes, not counting the special END_BLOCK code */ +var LITERALS = 256; +/* number of literal bytes 0..255 */ +var L_CODES = LITERALS + 1 + LENGTH_CODES; +/* number of Literal or Length codes, including the END_BLOCK code */ +var D_CODES = 30; +/* number of distance codes */ +var BL_CODES = 19; +/* number of codes used to transfer the bit lengths */ +var HEAP_SIZE = 2 * L_CODES + 1; +/* maximum heap size */ +var MAX_BITS = 15; +/* All codes must not exceed MAX_BITS bits */ + +var MIN_MATCH = 3; +var MAX_MATCH = 258; +var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1); + +var PRESET_DICT = 0x20; + +var INIT_STATE = 42; +var EXTRA_STATE = 69; +var NAME_STATE = 73; +var COMMENT_STATE = 91; +var HCRC_STATE = 103; +var BUSY_STATE = 113; +var FINISH_STATE = 666; + +var BS_NEED_MORE = 1; /* block not completed, need more input or more output */ +var BS_BLOCK_DONE = 2; /* block flush performed */ +var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */ +var BS_FINISH_DONE = 4; /* finish done, accept no more input or output */ + +var OS_CODE = 0x03; // Unix :) . Don't detect, use this default. + +function err(strm, errorCode) { + strm.msg = msg[errorCode]; + return errorCode; +} + +function rank(f) { + return ((f) << 1) - ((f) > 4 ? 9 : 0); +} + +function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } + + +/* ========================================================================= + * Flush as much pending output as possible. All deflate() output goes + * through this function so some applications may wish to modify it + * to avoid allocating a large strm->output buffer and copying into it. + * (See also read_buf()). + */ +function flush_pending(strm) { + var s = strm.state; + + //_tr_flush_bits(s); + var len = s.pending; + if (len > strm.avail_out) { + len = strm.avail_out; + } + if (len === 0) { return; } + + utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out); + strm.next_out += len; + s.pending_out += len; + strm.total_out += len; + strm.avail_out -= len; + s.pending -= len; + if (s.pending === 0) { + s.pending_out = 0; + } +} + + +function flush_block_only(s, last) { + trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last); + s.block_start = s.strstart; + flush_pending(s.strm); +} + + +function put_byte(s, b) { + s.pending_buf[s.pending++] = b; +} + + +/* ========================================================================= + * Put a short in the pending buffer. The 16-bit value is put in MSB order. + * IN assertion: the stream state is correct and there is enough room in + * pending_buf. + */ +function putShortMSB(s, b) { +// put_byte(s, (Byte)(b >> 8)); +// put_byte(s, (Byte)(b & 0xff)); + s.pending_buf[s.pending++] = (b >>> 8) & 0xff; + s.pending_buf[s.pending++] = b & 0xff; +} + + +/* =========================================================================== + * Read a new buffer from the current input stream, update the adler32 + * and total number of bytes read. All deflate() input goes through + * this function so some applications may wish to modify it to avoid + * allocating a large strm->input buffer and copying from it. + * (See also flush_pending()). + */ +function read_buf(strm, buf, start, size) { + var len = strm.avail_in; + + if (len > size) { len = size; } + if (len === 0) { return 0; } + + strm.avail_in -= len; + + // zmemcpy(buf, strm->next_in, len); + utils.arraySet(buf, strm.input, strm.next_in, len, start); + if (strm.state.wrap === 1) { + strm.adler = adler32(strm.adler, buf, len, start); + } + + else if (strm.state.wrap === 2) { + strm.adler = crc32(strm.adler, buf, len, start); + } + + strm.next_in += len; + strm.total_in += len; + + return len; +} + + +/* =========================================================================== + * Set match_start to the longest match starting at the given string and + * return its length. Matches shorter or equal to prev_length are discarded, + * in which case the result is equal to prev_length and match_start is + * garbage. + * IN assertions: cur_match is the head of the hash chain for the current + * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 + * OUT assertion: the match length is not greater than s->lookahead. + */ +function longest_match(s, cur_match) { + var chain_length = s.max_chain_length; /* max hash chain length */ + var scan = s.strstart; /* current string */ + var match; /* matched string */ + var len; /* length of current match */ + var best_len = s.prev_length; /* best match length so far */ + var nice_match = s.nice_match; /* stop if match long enough */ + var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ? + s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/; + + var _win = s.window; // shortcut + + var wmask = s.w_mask; + var prev = s.prev; + + /* Stop when cur_match becomes <= limit. To simplify the code, + * we prevent matches with the string of window index 0. + */ + + var strend = s.strstart + MAX_MATCH; + var scan_end1 = _win[scan + best_len - 1]; + var scan_end = _win[scan + best_len]; + + /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. + * It is easy to get rid of this optimization if necessary. + */ + // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); + + /* Do not waste too much time if we already have a good match: */ + if (s.prev_length >= s.good_match) { + chain_length >>= 2; + } + /* Do not look for matches beyond the end of the input. This is necessary + * to make deflate deterministic. + */ + if (nice_match > s.lookahead) { nice_match = s.lookahead; } + + // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + + do { + // Assert(cur_match < s->strstart, "no future"); + match = cur_match; + + /* Skip to next match if the match length cannot increase + * or if the match length is less than 2. Note that the checks below + * for insufficient lookahead only occur occasionally for performance + * reasons. Therefore uninitialized memory will be accessed, and + * conditional jumps will be made that depend on those values. + * However the length of the match is limited to the lookahead, so + * the output of deflate is not affected by the uninitialized values. + */ + + if (_win[match + best_len] !== scan_end || + _win[match + best_len - 1] !== scan_end1 || + _win[match] !== _win[scan] || + _win[++match] !== _win[scan + 1]) { + continue; + } + + /* The check at best_len-1 can be removed because it will be made + * again later. (This heuristic is not always a win.) + * It is not necessary to compare scan[2] and match[2] since they + * are always equal when the other bytes match, given that + * the hash keys are equal and that HASH_BITS >= 8. + */ + scan += 2; + match++; + // Assert(*scan == *match, "match[2]?"); + + /* We check for insufficient lookahead only every 8th comparison; + * the 256th check will be made at strstart+258. + */ + do { + /*jshint noempty:false*/ + } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + scan < strend); + + // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + + len = MAX_MATCH - (strend - scan); + scan = strend - MAX_MATCH; + + if (len > best_len) { + s.match_start = cur_match; + best_len = len; + if (len >= nice_match) { + break; + } + scan_end1 = _win[scan + best_len - 1]; + scan_end = _win[scan + best_len]; + } + } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0); + + if (best_len <= s.lookahead) { + return best_len; + } + return s.lookahead; +} + + +/* =========================================================================== + * Fill the window when the lookahead becomes insufficient. + * Updates strstart and lookahead. + * + * IN assertion: lookahead < MIN_LOOKAHEAD + * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD + * At least one byte has been read, or avail_in == 0; reads are + * performed for at least two bytes (required for the zip translate_eol + * option -- not supported here). + */ +function fill_window(s) { + var _w_size = s.w_size; + var p, n, m, more, str; + + //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); + + do { + more = s.window_size - s.lookahead - s.strstart; + + // JS ints have 32 bit, block below not needed + /* Deal with !@#$% 64K limit: */ + //if (sizeof(int) <= 2) { + // if (more == 0 && s->strstart == 0 && s->lookahead == 0) { + // more = wsize; + // + // } else if (more == (unsigned)(-1)) { + // /* Very unlikely, but possible on 16 bit machine if + // * strstart == 0 && lookahead == 1 (input done a byte at time) + // */ + // more--; + // } + //} + + + /* If the window is almost full and there is insufficient lookahead, + * move the upper half to the lower one to make room in the upper half. + */ + if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) { + + utils.arraySet(s.window, s.window, _w_size, _w_size, 0); + s.match_start -= _w_size; + s.strstart -= _w_size; + /* we now have strstart >= MAX_DIST */ + s.block_start -= _w_size; + + /* Slide the hash table (could be avoided with 32 bit values + at the expense of memory usage). We slide even when level == 0 + to keep the hash table consistent if we switch back to level > 0 + later. (Using level 0 permanently is not an optimal usage of + zlib, so we don't care about this pathological case.) + */ + + n = s.hash_size; + p = n; + do { + m = s.head[--p]; + s.head[p] = (m >= _w_size ? m - _w_size : 0); + } while (--n); + + n = _w_size; + p = n; + do { + m = s.prev[--p]; + s.prev[p] = (m >= _w_size ? m - _w_size : 0); + /* If n is not on any hash chain, prev[n] is garbage but + * its value will never be used. + */ + } while (--n); + + more += _w_size; + } + if (s.strm.avail_in === 0) { + break; + } + + /* If there was no sliding: + * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && + * more == window_size - lookahead - strstart + * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) + * => more >= window_size - 2*WSIZE + 2 + * In the BIG_MEM or MMAP case (not yet supported), + * window_size == input_size + MIN_LOOKAHEAD && + * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. + * Otherwise, window_size == 2*WSIZE so more >= 2. + * If there was sliding, more >= WSIZE. So in all cases, more >= 2. + */ + //Assert(more >= 2, "more < 2"); + n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more); + s.lookahead += n; + + /* Initialize the hash value now that we have some input: */ + if (s.lookahead + s.insert >= MIN_MATCH) { + str = s.strstart - s.insert; + s.ins_h = s.window[str]; + + /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask; +//#if MIN_MATCH != 3 +// Call update_hash() MIN_MATCH-3 more times +//#endif + while (s.insert) { + /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; + + s.prev[str & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = str; + str++; + s.insert--; + if (s.lookahead + s.insert < MIN_MATCH) { + break; + } + } + } + /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, + * but this is not important since only literal bytes will be emitted. + */ + + } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0); + + /* If the WIN_INIT bytes after the end of the current data have never been + * written, then zero those bytes in order to avoid memory check reports of + * the use of uninitialized (or uninitialised as Julian writes) bytes by + * the longest match routines. Update the high water mark for the next + * time through here. WIN_INIT is set to MAX_MATCH since the longest match + * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. + */ +// if (s.high_water < s.window_size) { +// var curr = s.strstart + s.lookahead; +// var init = 0; +// +// if (s.high_water < curr) { +// /* Previous high water mark below current data -- zero WIN_INIT +// * bytes or up to end of window, whichever is less. +// */ +// init = s.window_size - curr; +// if (init > WIN_INIT) +// init = WIN_INIT; +// zmemzero(s->window + curr, (unsigned)init); +// s->high_water = curr + init; +// } +// else if (s->high_water < (ulg)curr + WIN_INIT) { +// /* High water mark at or above current data, but below current data +// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up +// * to end of window, whichever is less. +// */ +// init = (ulg)curr + WIN_INIT - s->high_water; +// if (init > s->window_size - s->high_water) +// init = s->window_size - s->high_water; +// zmemzero(s->window + s->high_water, (unsigned)init); +// s->high_water += init; +// } +// } +// +// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, +// "not enough room for search"); +} + +/* =========================================================================== + * Copy without compression as much as possible from the input stream, return + * the current block state. + * This function does not insert new strings in the dictionary since + * uncompressible data is probably not useful. This function is used + * only for the level=0 compression option. + * NOTE: this function should be optimized to avoid extra copying from + * window to pending_buf. + */ +function deflate_stored(s, flush) { + /* Stored blocks are limited to 0xffff bytes, pending_buf is limited + * to pending_buf_size, and each stored block has a 5 byte header: + */ + var max_block_size = 0xffff; + + if (max_block_size > s.pending_buf_size - 5) { + max_block_size = s.pending_buf_size - 5; + } + + /* Copy as much as possible from input to output: */ + for (;;) { + /* Fill the window as much as possible: */ + if (s.lookahead <= 1) { + + //Assert(s->strstart < s->w_size+MAX_DIST(s) || + // s->block_start >= (long)s->w_size, "slide too late"); +// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) || +// s.block_start >= s.w_size)) { +// throw new Error("slide too late"); +// } + + fill_window(s); + if (s.lookahead === 0 && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + + if (s.lookahead === 0) { + break; + } + /* flush the current block */ + } + //Assert(s->block_start >= 0L, "block gone"); +// if (s.block_start < 0) throw new Error("block gone"); + + s.strstart += s.lookahead; + s.lookahead = 0; + + /* Emit a stored block if pending_buf will be full: */ + var max_start = s.block_start + max_block_size; + + if (s.strstart === 0 || s.strstart >= max_start) { + /* strstart == 0 is possible when wraparound on 16-bit machine */ + s.lookahead = s.strstart - max_start; + s.strstart = max_start; + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + + + } + /* Flush if we may have to slide, otherwise block_start may become + * negative and the data will be gone: + */ + if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + + s.insert = 0; + + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + + if (s.strstart > s.block_start) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + + return BS_NEED_MORE; +} + +/* =========================================================================== + * Compress as much as possible from the input stream, return the current + * block state. + * This function does not perform lazy evaluation of matches and inserts + * new strings in the dictionary only for unmatched strings or for short + * matches. It is used only for the fast compression options. + */ +function deflate_fast(s, flush) { + var hash_head; /* head of the hash chain */ + var bflush; /* set if current block must be flushed */ + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s.lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { + break; /* flush the current block */ + } + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + hash_head = 0/*NIL*/; + if (s.lookahead >= MIN_MATCH) { + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + } + + /* Find the longest match, discarding those <= prev_length. + * At this point we have always match_length < MIN_MATCH + */ + if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + s.match_length = longest_match(s, hash_head); + /* longest_match() sets match_start */ + } + if (s.match_length >= MIN_MATCH) { + // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only + + /*** _tr_tally_dist(s, s.strstart - s.match_start, + s.match_length - MIN_MATCH, bflush); ***/ + bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); + + s.lookahead -= s.match_length; + + /* Insert new strings in the hash table only if the match length + * is not too large. This saves time but degrades compression. + */ + if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) { + s.match_length--; /* string at strstart already in table */ + do { + s.strstart++; + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + /* strstart never exceeds WSIZE-MAX_MATCH, so there are + * always MIN_MATCH bytes ahead. + */ + } while (--s.match_length !== 0); + s.strstart++; + } else + { + s.strstart += s.match_length; + s.match_length = 0; + s.ins_h = s.window[s.strstart]; + /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask; + +//#if MIN_MATCH != 3 +// Call UPDATE_HASH() MIN_MATCH-3 more times +//#endif + /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not + * matter since it will be recomputed at next deflate call. + */ + } + } else { + /* No match, output a literal byte */ + //Tracevv((stderr,"%c", s.window[s.strstart])); + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + + s.lookahead--; + s.strstart++; + } + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1); + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + return BS_BLOCK_DONE; +} + +/* =========================================================================== + * Same as above, but achieves better compression. We use a lazy + * evaluation for matches: a match is finally adopted only if there is + * no better match at the next window position. + */ +function deflate_slow(s, flush) { + var hash_head; /* head of hash chain */ + var bflush; /* set if current block must be flushed */ + + var max_insert; + + /* Process the input block. */ + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s.lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { break; } /* flush the current block */ + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + hash_head = 0/*NIL*/; + if (s.lookahead >= MIN_MATCH) { + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + } + + /* Find the longest match, discarding those <= prev_length. + */ + s.prev_length = s.match_length; + s.prev_match = s.match_start; + s.match_length = MIN_MATCH - 1; + + if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match && + s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + s.match_length = longest_match(s, hash_head); + /* longest_match() sets match_start */ + + if (s.match_length <= 5 && + (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { + + /* If prev_match is also MIN_MATCH, match_start is garbage + * but we will ignore the current match anyway. + */ + s.match_length = MIN_MATCH - 1; + } + } + /* If there was a match at the previous step and the current + * match is not better, output the previous match: + */ + if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { + max_insert = s.strstart + s.lookahead - MIN_MATCH; + /* Do not insert strings in hash table beyond this. */ + + //check_match(s, s.strstart-1, s.prev_match, s.prev_length); + + /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match, + s.prev_length - MIN_MATCH, bflush);***/ + bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH); + /* Insert in hash table all strings up to the end of the match. + * strstart-1 and strstart are already inserted. If there is not + * enough lookahead, the last two strings are not inserted in + * the hash table. + */ + s.lookahead -= s.prev_length - 1; + s.prev_length -= 2; + do { + if (++s.strstart <= max_insert) { + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + } + } while (--s.prev_length !== 0); + s.match_available = 0; + s.match_length = MIN_MATCH - 1; + s.strstart++; + + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + + } else if (s.match_available) { + /* If there was no match at the previous position, output a + * single literal. If there was a match but the current match + * is longer, truncate the previous match to a single literal. + */ + //Tracevv((stderr,"%c", s->window[s->strstart-1])); + /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); + + if (bflush) { + /*** FLUSH_BLOCK_ONLY(s, 0) ***/ + flush_block_only(s, false); + /***/ + } + s.strstart++; + s.lookahead--; + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } else { + /* There is no previous match to compare with, wait for + * the next step to decide. + */ + s.match_available = 1; + s.strstart++; + s.lookahead--; + } + } + //Assert (flush != Z_NO_FLUSH, "no flush?"); + if (s.match_available) { + //Tracevv((stderr,"%c", s->window[s->strstart-1])); + /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); + + s.match_available = 0; + } + s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + + return BS_BLOCK_DONE; +} + + +/* =========================================================================== + * For Z_RLE, simply look for runs of bytes, generate matches only of distance + * one. Do not maintain a hash table. (It will be regenerated if this run of + * deflate switches away from Z_RLE.) + */ +function deflate_rle(s, flush) { + var bflush; /* set if current block must be flushed */ + var prev; /* byte at distance one to match */ + var scan, strend; /* scan goes up to strend for length of run */ + + var _win = s.window; + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the longest run, plus one for the unrolled loop. + */ + if (s.lookahead <= MAX_MATCH) { + fill_window(s); + if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { break; } /* flush the current block */ + } + + /* See how many times the previous byte repeats */ + s.match_length = 0; + if (s.lookahead >= MIN_MATCH && s.strstart > 0) { + scan = s.strstart - 1; + prev = _win[scan]; + if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { + strend = s.strstart + MAX_MATCH; + do { + /*jshint noempty:false*/ + } while (prev === _win[++scan] && prev === _win[++scan] && + prev === _win[++scan] && prev === _win[++scan] && + prev === _win[++scan] && prev === _win[++scan] && + prev === _win[++scan] && prev === _win[++scan] && + scan < strend); + s.match_length = MAX_MATCH - (strend - scan); + if (s.match_length > s.lookahead) { + s.match_length = s.lookahead; + } + } + //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); + } + + /* Emit match if have run of MIN_MATCH or longer, else emit literal */ + if (s.match_length >= MIN_MATCH) { + //check_match(s, s.strstart, s.strstart - 1, s.match_length); + + /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/ + bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH); + + s.lookahead -= s.match_length; + s.strstart += s.match_length; + s.match_length = 0; + } else { + /* No match, output a literal byte */ + //Tracevv((stderr,"%c", s->window[s->strstart])); + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + + s.lookahead--; + s.strstart++; + } + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + s.insert = 0; + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + return BS_BLOCK_DONE; +} + +/* =========================================================================== + * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. + * (It will be regenerated if this run of deflate switches away from Huffman.) + */ +function deflate_huff(s, flush) { + var bflush; /* set if current block must be flushed */ + + for (;;) { + /* Make sure that we have a literal to write. */ + if (s.lookahead === 0) { + fill_window(s); + if (s.lookahead === 0) { + if (flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + break; /* flush the current block */ + } + } + + /* Output a literal byte */ + s.match_length = 0; + //Tracevv((stderr,"%c", s->window[s->strstart])); + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + s.lookahead--; + s.strstart++; + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + s.insert = 0; + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + return BS_BLOCK_DONE; +} + +/* Values for max_lazy_match, good_match and max_chain_length, depending on + * the desired pack level (0..9). The values given below have been tuned to + * exclude worst case performance for pathological files. Better values may be + * found for specific files. + */ +function Config(good_length, max_lazy, nice_length, max_chain, func) { + this.good_length = good_length; + this.max_lazy = max_lazy; + this.nice_length = nice_length; + this.max_chain = max_chain; + this.func = func; +} + +var configuration_table; + +configuration_table = [ + /* good lazy nice chain */ + new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */ + new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */ + new Config(4, 5, 16, 8, deflate_fast), /* 2 */ + new Config(4, 6, 32, 32, deflate_fast), /* 3 */ + + new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */ + new Config(8, 16, 32, 32, deflate_slow), /* 5 */ + new Config(8, 16, 128, 128, deflate_slow), /* 6 */ + new Config(8, 32, 128, 256, deflate_slow), /* 7 */ + new Config(32, 128, 258, 1024, deflate_slow), /* 8 */ + new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */ +]; + + +/* =========================================================================== + * Initialize the "longest match" routines for a new zlib stream + */ +function lm_init(s) { + s.window_size = 2 * s.w_size; + + /*** CLEAR_HASH(s); ***/ + zero(s.head); // Fill with NIL (= 0); + + /* Set the default configuration parameters: + */ + s.max_lazy_match = configuration_table[s.level].max_lazy; + s.good_match = configuration_table[s.level].good_length; + s.nice_match = configuration_table[s.level].nice_length; + s.max_chain_length = configuration_table[s.level].max_chain; + + s.strstart = 0; + s.block_start = 0; + s.lookahead = 0; + s.insert = 0; + s.match_length = s.prev_length = MIN_MATCH - 1; + s.match_available = 0; + s.ins_h = 0; +} + + +function DeflateState() { + this.strm = null; /* pointer back to this zlib stream */ + this.status = 0; /* as the name implies */ + this.pending_buf = null; /* output still pending */ + this.pending_buf_size = 0; /* size of pending_buf */ + this.pending_out = 0; /* next pending byte to output to the stream */ + this.pending = 0; /* nb of bytes in the pending buffer */ + this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ + this.gzhead = null; /* gzip header information to write */ + this.gzindex = 0; /* where in extra, name, or comment */ + this.method = Z_DEFLATED; /* can only be DEFLATED */ + this.last_flush = -1; /* value of flush param for previous deflate call */ + + this.w_size = 0; /* LZ77 window size (32K by default) */ + this.w_bits = 0; /* log2(w_size) (8..16) */ + this.w_mask = 0; /* w_size - 1 */ + + this.window = null; + /* Sliding window. Input bytes are read into the second half of the window, + * and move to the first half later to keep a dictionary of at least wSize + * bytes. With this organization, matches are limited to a distance of + * wSize-MAX_MATCH bytes, but this ensures that IO is always + * performed with a length multiple of the block size. + */ + + this.window_size = 0; + /* Actual size of window: 2*wSize, except when the user input buffer + * is directly used as sliding window. + */ + + this.prev = null; + /* Link to older string with same hash index. To limit the size of this + * array to 64K, this link is maintained only for the last 32K strings. + * An index in this array is thus a window index modulo 32K. + */ + + this.head = null; /* Heads of the hash chains or NIL. */ + + this.ins_h = 0; /* hash index of string to be inserted */ + this.hash_size = 0; /* number of elements in hash table */ + this.hash_bits = 0; /* log2(hash_size) */ + this.hash_mask = 0; /* hash_size-1 */ + + this.hash_shift = 0; + /* Number of bits by which ins_h must be shifted at each input + * step. It must be such that after MIN_MATCH steps, the oldest + * byte no longer takes part in the hash key, that is: + * hash_shift * MIN_MATCH >= hash_bits + */ + + this.block_start = 0; + /* Window position at the beginning of the current output block. Gets + * negative when the window is moved backwards. + */ + + this.match_length = 0; /* length of best match */ + this.prev_match = 0; /* previous match */ + this.match_available = 0; /* set if previous match exists */ + this.strstart = 0; /* start of string to insert */ + this.match_start = 0; /* start of matching string */ + this.lookahead = 0; /* number of valid bytes ahead in window */ + + this.prev_length = 0; + /* Length of the best match at previous step. Matches not greater than this + * are discarded. This is used in the lazy match evaluation. + */ + + this.max_chain_length = 0; + /* To speed up deflation, hash chains are never searched beyond this + * length. A higher limit improves compression ratio but degrades the + * speed. + */ + + this.max_lazy_match = 0; + /* Attempt to find a better match only when the current match is strictly + * smaller than this value. This mechanism is used only for compression + * levels >= 4. + */ + // That's alias to max_lazy_match, don't use directly + //this.max_insert_length = 0; + /* Insert new strings in the hash table only if the match length is not + * greater than this length. This saves time but degrades compression. + * max_insert_length is used only for compression levels <= 3. + */ + + this.level = 0; /* compression level (1..9) */ + this.strategy = 0; /* favor or force Huffman coding*/ + + this.good_match = 0; + /* Use a faster search when the previous match is longer than this */ + + this.nice_match = 0; /* Stop searching when current match exceeds this */ + + /* used by trees.c: */ + + /* Didn't use ct_data typedef below to suppress compiler warning */ + + // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ + // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ + // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ + + // Use flat array of DOUBLE size, with interleaved fata, + // because JS does not support effective + this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2); + this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2); + this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2); + zero(this.dyn_ltree); + zero(this.dyn_dtree); + zero(this.bl_tree); + + this.l_desc = null; /* desc. for literal tree */ + this.d_desc = null; /* desc. for distance tree */ + this.bl_desc = null; /* desc. for bit length tree */ + + //ush bl_count[MAX_BITS+1]; + this.bl_count = new utils.Buf16(MAX_BITS + 1); + /* number of codes at each bit length for an optimal tree */ + + //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ + this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */ + zero(this.heap); + + this.heap_len = 0; /* number of elements in the heap */ + this.heap_max = 0; /* element of largest frequency */ + /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. + * The same heap array is used to build all trees. + */ + + this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1]; + zero(this.depth); + /* Depth of each subtree used as tie breaker for trees of equal frequency + */ + + this.l_buf = 0; /* buffer index for literals or lengths */ + + this.lit_bufsize = 0; + /* Size of match buffer for literals/lengths. There are 4 reasons for + * limiting lit_bufsize to 64K: + * - frequencies can be kept in 16 bit counters + * - if compression is not successful for the first block, all input + * data is still in the window so we can still emit a stored block even + * when input comes from standard input. (This can also be done for + * all blocks if lit_bufsize is not greater than 32K.) + * - if compression is not successful for a file smaller than 64K, we can + * even emit a stored file instead of a stored block (saving 5 bytes). + * This is applicable only for zip (not gzip or zlib). + * - creating new Huffman trees less frequently may not provide fast + * adaptation to changes in the input data statistics. (Take for + * example a binary file with poorly compressible code followed by + * a highly compressible string table.) Smaller buffer sizes give + * fast adaptation but have of course the overhead of transmitting + * trees more frequently. + * - I can't count above 4 + */ + + this.last_lit = 0; /* running index in l_buf */ + + this.d_buf = 0; + /* Buffer index for distances. To simplify the code, d_buf and l_buf have + * the same number of elements. To use different lengths, an extra flag + * array would be necessary. + */ + + this.opt_len = 0; /* bit length of current block with optimal trees */ + this.static_len = 0; /* bit length of current block with static trees */ + this.matches = 0; /* number of string matches in current block */ + this.insert = 0; /* bytes at end of window left to insert */ + + + this.bi_buf = 0; + /* Output buffer. bits are inserted starting at the bottom (least + * significant bits). + */ + this.bi_valid = 0; + /* Number of valid bits in bi_buf. All bits above the last valid bit + * are always zero. + */ + + // Used for window memory init. We safely ignore it for JS. That makes + // sense only for pointers and memory check tools. + //this.high_water = 0; + /* High water mark offset in window for initialized bytes -- bytes above + * this are set to zero in order to avoid memory check warnings when + * longest match routines access bytes past the input. This is then + * updated to the new high water mark. + */ +} + + +function deflateResetKeep(strm) { + var s; + + if (!strm || !strm.state) { + return err(strm, Z_STREAM_ERROR); + } + + strm.total_in = strm.total_out = 0; + strm.data_type = Z_UNKNOWN; + + s = strm.state; + s.pending = 0; + s.pending_out = 0; + + if (s.wrap < 0) { + s.wrap = -s.wrap; + /* was made negative by deflate(..., Z_FINISH); */ + } + s.status = (s.wrap ? INIT_STATE : BUSY_STATE); + strm.adler = (s.wrap === 2) ? + 0 // crc32(0, Z_NULL, 0) + : + 1; // adler32(0, Z_NULL, 0) + s.last_flush = Z_NO_FLUSH; + trees._tr_init(s); + return Z_OK; +} + + +function deflateReset(strm) { + var ret = deflateResetKeep(strm); + if (ret === Z_OK) { + lm_init(strm.state); + } + return ret; +} + + +function deflateSetHeader(strm, head) { + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; } + strm.state.gzhead = head; + return Z_OK; +} + + +function deflateInit2(strm, level, method, windowBits, memLevel, strategy) { + if (!strm) { // === Z_NULL + return Z_STREAM_ERROR; + } + var wrap = 1; + + if (level === Z_DEFAULT_COMPRESSION) { + level = 6; + } + + if (windowBits < 0) { /* suppress zlib wrapper */ + wrap = 0; + windowBits = -windowBits; + } + + else if (windowBits > 15) { + wrap = 2; /* write gzip wrapper instead */ + windowBits -= 16; + } + + + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || + windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || + strategy < 0 || strategy > Z_FIXED) { + return err(strm, Z_STREAM_ERROR); + } + + + if (windowBits === 8) { + windowBits = 9; + } + /* until 256-byte window bug fixed */ + + var s = new DeflateState(); + + strm.state = s; + s.strm = strm; + + s.wrap = wrap; + s.gzhead = null; + s.w_bits = windowBits; + s.w_size = 1 << s.w_bits; + s.w_mask = s.w_size - 1; + + s.hash_bits = memLevel + 7; + s.hash_size = 1 << s.hash_bits; + s.hash_mask = s.hash_size - 1; + s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); + + s.window = new utils.Buf8(s.w_size * 2); + s.head = new utils.Buf16(s.hash_size); + s.prev = new utils.Buf16(s.w_size); + + // Don't need mem init magic for JS. + //s.high_water = 0; /* nothing written to s->window yet */ + + s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ + + s.pending_buf_size = s.lit_bufsize * 4; + + //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); + //s->pending_buf = (uchf *) overlay; + s.pending_buf = new utils.Buf8(s.pending_buf_size); + + // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`) + //s->d_buf = overlay + s->lit_bufsize/sizeof(ush); + s.d_buf = 1 * s.lit_bufsize; + + //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; + s.l_buf = (1 + 2) * s.lit_bufsize; + + s.level = level; + s.strategy = strategy; + s.method = method; + + return deflateReset(strm); +} + +function deflateInit(strm, level) { + return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); +} + + +function deflate(strm, flush) { + var old_flush, s; + var beg, val; // for gzip header write only + + if (!strm || !strm.state || + flush > Z_BLOCK || flush < 0) { + return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR; + } + + s = strm.state; + + if (!strm.output || + (!strm.input && strm.avail_in !== 0) || + (s.status === FINISH_STATE && flush !== Z_FINISH)) { + return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR); + } + + s.strm = strm; /* just in case */ + old_flush = s.last_flush; + s.last_flush = flush; + + /* Write the header */ + if (s.status === INIT_STATE) { + + if (s.wrap === 2) { // GZIP header + strm.adler = 0; //crc32(0L, Z_NULL, 0); + put_byte(s, 31); + put_byte(s, 139); + put_byte(s, 8); + if (!s.gzhead) { // s->gzhead == Z_NULL + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, s.level === 9 ? 2 : + (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? + 4 : 0)); + put_byte(s, OS_CODE); + s.status = BUSY_STATE; + } + else { + put_byte(s, (s.gzhead.text ? 1 : 0) + + (s.gzhead.hcrc ? 2 : 0) + + (!s.gzhead.extra ? 0 : 4) + + (!s.gzhead.name ? 0 : 8) + + (!s.gzhead.comment ? 0 : 16) + ); + put_byte(s, s.gzhead.time & 0xff); + put_byte(s, (s.gzhead.time >> 8) & 0xff); + put_byte(s, (s.gzhead.time >> 16) & 0xff); + put_byte(s, (s.gzhead.time >> 24) & 0xff); + put_byte(s, s.level === 9 ? 2 : + (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? + 4 : 0)); + put_byte(s, s.gzhead.os & 0xff); + if (s.gzhead.extra && s.gzhead.extra.length) { + put_byte(s, s.gzhead.extra.length & 0xff); + put_byte(s, (s.gzhead.extra.length >> 8) & 0xff); + } + if (s.gzhead.hcrc) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0); + } + s.gzindex = 0; + s.status = EXTRA_STATE; + } + } + else // DEFLATE header + { + var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8; + var level_flags = -1; + + if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { + level_flags = 0; + } else if (s.level < 6) { + level_flags = 1; + } else if (s.level === 6) { + level_flags = 2; + } else { + level_flags = 3; + } + header |= (level_flags << 6); + if (s.strstart !== 0) { header |= PRESET_DICT; } + header += 31 - (header % 31); + + s.status = BUSY_STATE; + putShortMSB(s, header); + + /* Save the adler32 of the preset dictionary: */ + if (s.strstart !== 0) { + putShortMSB(s, strm.adler >>> 16); + putShortMSB(s, strm.adler & 0xffff); + } + strm.adler = 1; // adler32(0L, Z_NULL, 0); + } + } + +//#ifdef GZIP + if (s.status === EXTRA_STATE) { + if (s.gzhead.extra/* != Z_NULL*/) { + beg = s.pending; /* start of bytes to update crc */ + + while (s.gzindex < (s.gzhead.extra.length & 0xffff)) { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + break; + } + } + put_byte(s, s.gzhead.extra[s.gzindex] & 0xff); + s.gzindex++; + } + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (s.gzindex === s.gzhead.extra.length) { + s.gzindex = 0; + s.status = NAME_STATE; + } + } + else { + s.status = NAME_STATE; + } + } + if (s.status === NAME_STATE) { + if (s.gzhead.name/* != Z_NULL*/) { + beg = s.pending; /* start of bytes to update crc */ + //int val; + + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + val = 1; + break; + } + } + // JS specific: little magic to add zero terminator to end of string + if (s.gzindex < s.gzhead.name.length) { + val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff; + } else { + val = 0; + } + put_byte(s, val); + } while (val !== 0); + + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (val === 0) { + s.gzindex = 0; + s.status = COMMENT_STATE; + } + } + else { + s.status = COMMENT_STATE; + } + } + if (s.status === COMMENT_STATE) { + if (s.gzhead.comment/* != Z_NULL*/) { + beg = s.pending; /* start of bytes to update crc */ + //int val; + + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + val = 1; + break; + } + } + // JS specific: little magic to add zero terminator to end of string + if (s.gzindex < s.gzhead.comment.length) { + val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff; + } else { + val = 0; + } + put_byte(s, val); + } while (val !== 0); + + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (val === 0) { + s.status = HCRC_STATE; + } + } + else { + s.status = HCRC_STATE; + } + } + if (s.status === HCRC_STATE) { + if (s.gzhead.hcrc) { + if (s.pending + 2 > s.pending_buf_size) { + flush_pending(strm); + } + if (s.pending + 2 <= s.pending_buf_size) { + put_byte(s, strm.adler & 0xff); + put_byte(s, (strm.adler >> 8) & 0xff); + strm.adler = 0; //crc32(0L, Z_NULL, 0); + s.status = BUSY_STATE; + } + } + else { + s.status = BUSY_STATE; + } + } +//#endif + + /* Flush as much pending output as possible */ + if (s.pending !== 0) { + flush_pending(strm); + if (strm.avail_out === 0) { + /* Since avail_out is 0, deflate will be called again with + * more output space, but possibly with both pending and + * avail_in equal to zero. There won't be anything to do, + * but this is not an error situation so make sure we + * return OK instead of BUF_ERROR at next call of deflate: + */ + s.last_flush = -1; + return Z_OK; + } + + /* Make sure there is something to do and avoid duplicate consecutive + * flushes. For repeated and useless calls with Z_FINISH, we keep + * returning Z_STREAM_END instead of Z_BUF_ERROR. + */ + } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && + flush !== Z_FINISH) { + return err(strm, Z_BUF_ERROR); + } + + /* User must not provide more input after the first FINISH: */ + if (s.status === FINISH_STATE && strm.avail_in !== 0) { + return err(strm, Z_BUF_ERROR); + } + + /* Start a new block or continue the current one. + */ + if (strm.avail_in !== 0 || s.lookahead !== 0 || + (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) { + var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) : + (s.strategy === Z_RLE ? deflate_rle(s, flush) : + configuration_table[s.level].func(s, flush)); + + if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) { + s.status = FINISH_STATE; + } + if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) { + if (strm.avail_out === 0) { + s.last_flush = -1; + /* avoid BUF_ERROR next call, see above */ + } + return Z_OK; + /* If flush != Z_NO_FLUSH && avail_out == 0, the next call + * of deflate should use the same flush parameter to make sure + * that the flush is complete. So we don't have to output an + * empty block here, this will be done at next call. This also + * ensures that for a very small output buffer, we emit at most + * one empty block. + */ + } + if (bstate === BS_BLOCK_DONE) { + if (flush === Z_PARTIAL_FLUSH) { + trees._tr_align(s); + } + else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ + + trees._tr_stored_block(s, 0, 0, false); + /* For a full flush, this empty block will be recognized + * as a special marker by inflate_sync(). + */ + if (flush === Z_FULL_FLUSH) { + /*** CLEAR_HASH(s); ***/ /* forget history */ + zero(s.head); // Fill with NIL (= 0); + + if (s.lookahead === 0) { + s.strstart = 0; + s.block_start = 0; + s.insert = 0; + } + } + } + flush_pending(strm); + if (strm.avail_out === 0) { + s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */ + return Z_OK; + } + } + } + //Assert(strm->avail_out > 0, "bug2"); + //if (strm.avail_out <= 0) { throw new Error("bug2");} + + if (flush !== Z_FINISH) { return Z_OK; } + if (s.wrap <= 0) { return Z_STREAM_END; } + + /* Write the trailer */ + if (s.wrap === 2) { + put_byte(s, strm.adler & 0xff); + put_byte(s, (strm.adler >> 8) & 0xff); + put_byte(s, (strm.adler >> 16) & 0xff); + put_byte(s, (strm.adler >> 24) & 0xff); + put_byte(s, strm.total_in & 0xff); + put_byte(s, (strm.total_in >> 8) & 0xff); + put_byte(s, (strm.total_in >> 16) & 0xff); + put_byte(s, (strm.total_in >> 24) & 0xff); + } + else + { + putShortMSB(s, strm.adler >>> 16); + putShortMSB(s, strm.adler & 0xffff); + } + + flush_pending(strm); + /* If avail_out is zero, the application will call deflate again + * to flush the rest. + */ + if (s.wrap > 0) { s.wrap = -s.wrap; } + /* write the trailer only once! */ + return s.pending !== 0 ? Z_OK : Z_STREAM_END; +} + +function deflateEnd(strm) { + var status; + + if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { + return Z_STREAM_ERROR; + } + + status = strm.state.status; + if (status !== INIT_STATE && + status !== EXTRA_STATE && + status !== NAME_STATE && + status !== COMMENT_STATE && + status !== HCRC_STATE && + status !== BUSY_STATE && + status !== FINISH_STATE + ) { + return err(strm, Z_STREAM_ERROR); + } + + strm.state = null; + + return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; +} + + +/* ========================================================================= + * Initializes the compression dictionary from the given byte + * sequence without producing any compressed output. + */ +function deflateSetDictionary(strm, dictionary) { + var dictLength = dictionary.length; + + var s; + var str, n; + var wrap; + var avail; + var next; + var input; + var tmpDict; + + if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { + return Z_STREAM_ERROR; + } + + s = strm.state; + wrap = s.wrap; + + if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) { + return Z_STREAM_ERROR; + } + + /* when using zlib wrappers, compute Adler-32 for provided dictionary */ + if (wrap === 1) { + /* adler32(strm->adler, dictionary, dictLength); */ + strm.adler = adler32(strm.adler, dictionary, dictLength, 0); + } + + s.wrap = 0; /* avoid computing Adler-32 in read_buf */ + + /* if dictionary would fill window, just replace the history */ + if (dictLength >= s.w_size) { + if (wrap === 0) { /* already empty otherwise */ + /*** CLEAR_HASH(s); ***/ + zero(s.head); // Fill with NIL (= 0); + s.strstart = 0; + s.block_start = 0; + s.insert = 0; + } + /* use the tail */ + // dictionary = dictionary.slice(dictLength - s.w_size); + tmpDict = new utils.Buf8(s.w_size); + utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0); + dictionary = tmpDict; + dictLength = s.w_size; + } + /* insert dictionary into window and hash */ + avail = strm.avail_in; + next = strm.next_in; + input = strm.input; + strm.avail_in = dictLength; + strm.next_in = 0; + strm.input = dictionary; + fill_window(s); + while (s.lookahead >= MIN_MATCH) { + str = s.strstart; + n = s.lookahead - (MIN_MATCH - 1); + do { + /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; + + s.prev[str & s.w_mask] = s.head[s.ins_h]; + + s.head[s.ins_h] = str; + str++; + } while (--n); + s.strstart = str; + s.lookahead = MIN_MATCH - 1; + fill_window(s); + } + s.strstart += s.lookahead; + s.block_start = s.strstart; + s.insert = s.lookahead; + s.lookahead = 0; + s.match_length = s.prev_length = MIN_MATCH - 1; + s.match_available = 0; + strm.next_in = next; + strm.input = input; + strm.avail_in = avail; + s.wrap = wrap; + return Z_OK; +} + + +exports.deflateInit = deflateInit; +exports.deflateInit2 = deflateInit2; +exports.deflateReset = deflateReset; +exports.deflateResetKeep = deflateResetKeep; +exports.deflateSetHeader = deflateSetHeader; +exports.deflate = deflate; +exports.deflateEnd = deflateEnd; +exports.deflateSetDictionary = deflateSetDictionary; +exports.deflateInfo = 'pako deflate (from Nodeca project)'; + +/* Not implemented +exports.deflateBound = deflateBound; +exports.deflateCopy = deflateCopy; +exports.deflateParams = deflateParams; +exports.deflatePending = deflatePending; +exports.deflatePrime = deflatePrime; +exports.deflateTune = deflateTune; +*/ + +},{"../utils/common":3,"./adler32":5,"./crc32":7,"./messages":13,"./trees":14}],9:[function(require,module,exports){ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +function GZheader() { + /* true if compressed data believed to be text */ + this.text = 0; + /* modification time */ + this.time = 0; + /* extra flags (not used when writing a gzip file) */ + this.xflags = 0; + /* operating system */ + this.os = 0; + /* pointer to extra field or Z_NULL if none */ + this.extra = null; + /* extra field length (valid if extra != Z_NULL) */ + this.extra_len = 0; // Actually, we don't need it in JS, + // but leave for few code modifications + + // + // Setup limits is not necessary because in js we should not preallocate memory + // for inflate use constant limit in 65536 bytes + // + + /* space at extra (only when reading header) */ + // this.extra_max = 0; + /* pointer to zero-terminated file name or Z_NULL */ + this.name = ''; + /* space at name (only when reading header) */ + // this.name_max = 0; + /* pointer to zero-terminated comment or Z_NULL */ + this.comment = ''; + /* space at comment (only when reading header) */ + // this.comm_max = 0; + /* true if there was or will be a header crc */ + this.hcrc = 0; + /* true when done reading gzip header (not used when writing a gzip file) */ + this.done = false; +} + +module.exports = GZheader; + +},{}],10:[function(require,module,exports){ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +// See state defs from inflate.js +var BAD = 30; /* got a data error -- remain here until reset */ +var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ + +/* + Decode literal, length, and distance codes and write out the resulting + literal and match bytes until either not enough input or output is + available, an end-of-block is encountered, or a data error is encountered. + When large enough input and output buffers are supplied to inflate(), for + example, a 16K input buffer and a 64K output buffer, more than 95% of the + inflate execution time is spent in this routine. + + Entry assumptions: + + state.mode === LEN + strm.avail_in >= 6 + strm.avail_out >= 258 + start >= strm.avail_out + state.bits < 8 + + On return, state.mode is one of: + + LEN -- ran out of enough output space or enough available input + TYPE -- reached end of block code, inflate() to interpret next block + BAD -- error in block data + + Notes: + + - The maximum input bits used by a length/distance pair is 15 bits for the + length code, 5 bits for the length extra, 15 bits for the distance code, + and 13 bits for the distance extra. This totals 48 bits, or six bytes. + Therefore if strm.avail_in >= 6, then there is enough input to avoid + checking for available input while decoding. + + - The maximum bytes that a single length/distance pair can output is 258 + bytes, which is the maximum length that can be coded. inflate_fast() + requires strm.avail_out >= 258 for each loop to avoid checking for + output space. + */ +module.exports = function inflate_fast(strm, start) { + var state; + var _in; /* local strm.input */ + var last; /* have enough input while in < last */ + var _out; /* local strm.output */ + var beg; /* inflate()'s initial strm.output */ + var end; /* while out < end, enough space available */ +//#ifdef INFLATE_STRICT + var dmax; /* maximum distance from zlib header */ +//#endif + var wsize; /* window size or zero if not using window */ + var whave; /* valid bytes in the window */ + var wnext; /* window write index */ + // Use `s_window` instead `window`, avoid conflict with instrumentation tools + var s_window; /* allocated sliding window, if wsize != 0 */ + var hold; /* local strm.hold */ + var bits; /* local strm.bits */ + var lcode; /* local strm.lencode */ + var dcode; /* local strm.distcode */ + var lmask; /* mask for first level of length codes */ + var dmask; /* mask for first level of distance codes */ + var here; /* retrieved table entry */ + var op; /* code bits, operation, extra bits, or */ + /* window position, window bytes to copy */ + var len; /* match length, unused bytes */ + var dist; /* match distance */ + var from; /* where to copy match from */ + var from_source; + + + var input, output; // JS specific, because we have no pointers + + /* copy state to local variables */ + state = strm.state; + //here = state.here; + _in = strm.next_in; + input = strm.input; + last = _in + (strm.avail_in - 5); + _out = strm.next_out; + output = strm.output; + beg = _out - (start - strm.avail_out); + end = _out + (strm.avail_out - 257); +//#ifdef INFLATE_STRICT + dmax = state.dmax; +//#endif + wsize = state.wsize; + whave = state.whave; + wnext = state.wnext; + s_window = state.window; + hold = state.hold; + bits = state.bits; + lcode = state.lencode; + dcode = state.distcode; + lmask = (1 << state.lenbits) - 1; + dmask = (1 << state.distbits) - 1; + + + /* decode literals and length/distances until end-of-block or not enough + input data or output space */ + + top: + do { + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + + here = lcode[hold & lmask]; + + dolen: + for (;;) { // Goto emulation + op = here >>> 24/*here.bits*/; + hold >>>= op; + bits -= op; + op = (here >>> 16) & 0xff/*here.op*/; + if (op === 0) { /* literal */ + //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? + // "inflate: literal '%c'\n" : + // "inflate: literal 0x%02x\n", here.val)); + output[_out++] = here & 0xffff/*here.val*/; + } + else if (op & 16) { /* length base */ + len = here & 0xffff/*here.val*/; + op &= 15; /* number of extra bits */ + if (op) { + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + len += hold & ((1 << op) - 1); + hold >>>= op; + bits -= op; + } + //Tracevv((stderr, "inflate: length %u\n", len)); + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + here = dcode[hold & dmask]; + + dodist: + for (;;) { // goto emulation + op = here >>> 24/*here.bits*/; + hold >>>= op; + bits -= op; + op = (here >>> 16) & 0xff/*here.op*/; + + if (op & 16) { /* distance base */ + dist = here & 0xffff/*here.val*/; + op &= 15; /* number of extra bits */ + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + } + dist += hold & ((1 << op) - 1); +//#ifdef INFLATE_STRICT + if (dist > dmax) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break top; + } +//#endif + hold >>>= op; + bits -= op; + //Tracevv((stderr, "inflate: distance %u\n", dist)); + op = _out - beg; /* max distance in output */ + if (dist > op) { /* see if copy from window */ + op = dist - op; /* distance back in window */ + if (op > whave) { + if (state.sane) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break top; + } + +// (!) This block is disabled in zlib defaults, +// don't enable it for binary compatibility +//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR +// if (len <= op - whave) { +// do { +// output[_out++] = 0; +// } while (--len); +// continue top; +// } +// len -= op - whave; +// do { +// output[_out++] = 0; +// } while (--op > whave); +// if (op === 0) { +// from = _out - dist; +// do { +// output[_out++] = output[from++]; +// } while (--len); +// continue top; +// } +//#endif + } + from = 0; // window index + from_source = s_window; + if (wnext === 0) { /* very common case */ + from += wsize - op; + if (op < len) { /* some from window */ + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + else if (wnext < op) { /* wrap around window */ + from += wsize + wnext - op; + op -= wnext; + if (op < len) { /* some from end of window */ + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = 0; + if (wnext < len) { /* some from start of window */ + op = wnext; + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + } + else { /* contiguous in window */ + from += wnext - op; + if (op < len) { /* some from window */ + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + while (len > 2) { + output[_out++] = from_source[from++]; + output[_out++] = from_source[from++]; + output[_out++] = from_source[from++]; + len -= 3; + } + if (len) { + output[_out++] = from_source[from++]; + if (len > 1) { + output[_out++] = from_source[from++]; + } + } + } + else { + from = _out - dist; /* copy direct from output */ + do { /* minimum length is three */ + output[_out++] = output[from++]; + output[_out++] = output[from++]; + output[_out++] = output[from++]; + len -= 3; + } while (len > 2); + if (len) { + output[_out++] = output[from++]; + if (len > 1) { + output[_out++] = output[from++]; + } + } + } + } + else if ((op & 64) === 0) { /* 2nd level distance code */ + here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; + continue dodist; + } + else { + strm.msg = 'invalid distance code'; + state.mode = BAD; + break top; + } + + break; // need to emulate goto via "continue" + } + } + else if ((op & 64) === 0) { /* 2nd level length code */ + here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; + continue dolen; + } + else if (op & 32) { /* end-of-block */ + //Tracevv((stderr, "inflate: end of block\n")); + state.mode = TYPE; + break top; + } + else { + strm.msg = 'invalid literal/length code'; + state.mode = BAD; + break top; + } + + break; // need to emulate goto via "continue" + } + } while (_in < last && _out < end); + + /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ + len = bits >> 3; + _in -= len; + bits -= len << 3; + hold &= (1 << bits) - 1; + + /* update state and return */ + strm.next_in = _in; + strm.next_out = _out; + strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last)); + strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end)); + state.hold = hold; + state.bits = bits; + return; +}; + +},{}],11:[function(require,module,exports){ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +var utils = require('../utils/common'); +var adler32 = require('./adler32'); +var crc32 = require('./crc32'); +var inflate_fast = require('./inffast'); +var inflate_table = require('./inftrees'); + +var CODES = 0; +var LENS = 1; +var DISTS = 2; + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + + +/* Allowed flush values; see deflate() and inflate() below for details */ +//var Z_NO_FLUSH = 0; +//var Z_PARTIAL_FLUSH = 1; +//var Z_SYNC_FLUSH = 2; +//var Z_FULL_FLUSH = 3; +var Z_FINISH = 4; +var Z_BLOCK = 5; +var Z_TREES = 6; + + +/* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ +var Z_OK = 0; +var Z_STREAM_END = 1; +var Z_NEED_DICT = 2; +//var Z_ERRNO = -1; +var Z_STREAM_ERROR = -2; +var Z_DATA_ERROR = -3; +var Z_MEM_ERROR = -4; +var Z_BUF_ERROR = -5; +//var Z_VERSION_ERROR = -6; + +/* The deflate compression method */ +var Z_DEFLATED = 8; + + +/* STATES ====================================================================*/ +/* ===========================================================================*/ + + +var HEAD = 1; /* i: waiting for magic header */ +var FLAGS = 2; /* i: waiting for method and flags (gzip) */ +var TIME = 3; /* i: waiting for modification time (gzip) */ +var OS = 4; /* i: waiting for extra flags and operating system (gzip) */ +var EXLEN = 5; /* i: waiting for extra length (gzip) */ +var EXTRA = 6; /* i: waiting for extra bytes (gzip) */ +var NAME = 7; /* i: waiting for end of file name (gzip) */ +var COMMENT = 8; /* i: waiting for end of comment (gzip) */ +var HCRC = 9; /* i: waiting for header crc (gzip) */ +var DICTID = 10; /* i: waiting for dictionary check value */ +var DICT = 11; /* waiting for inflateSetDictionary() call */ +var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ +var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */ +var STORED = 14; /* i: waiting for stored size (length and complement) */ +var COPY_ = 15; /* i/o: same as COPY below, but only first time in */ +var COPY = 16; /* i/o: waiting for input or output to copy stored block */ +var TABLE = 17; /* i: waiting for dynamic block table lengths */ +var LENLENS = 18; /* i: waiting for code length code lengths */ +var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */ +var LEN_ = 20; /* i: same as LEN below, but only first time in */ +var LEN = 21; /* i: waiting for length/lit/eob code */ +var LENEXT = 22; /* i: waiting for length extra bits */ +var DIST = 23; /* i: waiting for distance code */ +var DISTEXT = 24; /* i: waiting for distance extra bits */ +var MATCH = 25; /* o: waiting for output space to copy string */ +var LIT = 26; /* o: waiting for output space to write literal */ +var CHECK = 27; /* i: waiting for 32-bit check value */ +var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */ +var DONE = 29; /* finished check, done -- remain here until reset */ +var BAD = 30; /* got a data error -- remain here until reset */ +var MEM = 31; /* got an inflate() memory error -- remain here until reset */ +var SYNC = 32; /* looking for synchronization bytes to restart inflate() */ + +/* ===========================================================================*/ + + + +var ENOUGH_LENS = 852; +var ENOUGH_DISTS = 592; +//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); + +var MAX_WBITS = 15; +/* 32K LZ77 window */ +var DEF_WBITS = MAX_WBITS; + + +function zswap32(q) { + return (((q >>> 24) & 0xff) + + ((q >>> 8) & 0xff00) + + ((q & 0xff00) << 8) + + ((q & 0xff) << 24)); +} + + +function InflateState() { + this.mode = 0; /* current inflate mode */ + this.last = false; /* true if processing last block */ + this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ + this.havedict = false; /* true if dictionary provided */ + this.flags = 0; /* gzip header method and flags (0 if zlib) */ + this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */ + this.check = 0; /* protected copy of check value */ + this.total = 0; /* protected copy of output count */ + // TODO: may be {} + this.head = null; /* where to save gzip header information */ + + /* sliding window */ + this.wbits = 0; /* log base 2 of requested window size */ + this.wsize = 0; /* window size or zero if not using window */ + this.whave = 0; /* valid bytes in the window */ + this.wnext = 0; /* window write index */ + this.window = null; /* allocated sliding window, if needed */ + + /* bit accumulator */ + this.hold = 0; /* input bit accumulator */ + this.bits = 0; /* number of bits in "in" */ + + /* for string and stored block copying */ + this.length = 0; /* literal or length of data to copy */ + this.offset = 0; /* distance back to copy string from */ + + /* for table and code decoding */ + this.extra = 0; /* extra bits needed */ + + /* fixed and dynamic code tables */ + this.lencode = null; /* starting table for length/literal codes */ + this.distcode = null; /* starting table for distance codes */ + this.lenbits = 0; /* index bits for lencode */ + this.distbits = 0; /* index bits for distcode */ + + /* dynamic table building */ + this.ncode = 0; /* number of code length code lengths */ + this.nlen = 0; /* number of length code lengths */ + this.ndist = 0; /* number of distance code lengths */ + this.have = 0; /* number of code lengths in lens[] */ + this.next = null; /* next available space in codes[] */ + + this.lens = new utils.Buf16(320); /* temporary storage for code lengths */ + this.work = new utils.Buf16(288); /* work area for code table building */ + + /* + because we don't have pointers in js, we use lencode and distcode directly + as buffers so we don't need codes + */ + //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */ + this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */ + this.distdyn = null; /* dynamic table for distance codes (JS specific) */ + this.sane = 0; /* if false, allow invalid distance too far */ + this.back = 0; /* bits back of last unprocessed length/lit */ + this.was = 0; /* initial length of match */ +} + +function inflateResetKeep(strm) { + var state; + + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + strm.total_in = strm.total_out = state.total = 0; + strm.msg = ''; /*Z_NULL*/ + if (state.wrap) { /* to support ill-conceived Java test suite */ + strm.adler = state.wrap & 1; + } + state.mode = HEAD; + state.last = 0; + state.havedict = 0; + state.dmax = 32768; + state.head = null/*Z_NULL*/; + state.hold = 0; + state.bits = 0; + //state.lencode = state.distcode = state.next = state.codes; + state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS); + state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS); + + state.sane = 1; + state.back = -1; + //Tracev((stderr, "inflate: reset\n")); + return Z_OK; +} + +function inflateReset(strm) { + var state; + + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + state.wsize = 0; + state.whave = 0; + state.wnext = 0; + return inflateResetKeep(strm); + +} + +function inflateReset2(strm, windowBits) { + var wrap; + var state; + + /* get the state */ + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + + /* extract wrap request from windowBits parameter */ + if (windowBits < 0) { + wrap = 0; + windowBits = -windowBits; + } + else { + wrap = (windowBits >> 4) + 1; + if (windowBits < 48) { + windowBits &= 15; + } + } + + /* set number of window bits, free window if different */ + if (windowBits && (windowBits < 8 || windowBits > 15)) { + return Z_STREAM_ERROR; + } + if (state.window !== null && state.wbits !== windowBits) { + state.window = null; + } + + /* update state and reset the rest of it */ + state.wrap = wrap; + state.wbits = windowBits; + return inflateReset(strm); +} + +function inflateInit2(strm, windowBits) { + var ret; + var state; + + if (!strm) { return Z_STREAM_ERROR; } + //strm.msg = Z_NULL; /* in case we return an error */ + + state = new InflateState(); + + //if (state === Z_NULL) return Z_MEM_ERROR; + //Tracev((stderr, "inflate: allocated\n")); + strm.state = state; + state.window = null/*Z_NULL*/; + ret = inflateReset2(strm, windowBits); + if (ret !== Z_OK) { + strm.state = null/*Z_NULL*/; + } + return ret; +} + +function inflateInit(strm) { + return inflateInit2(strm, DEF_WBITS); +} + + +/* + Return state with length and distance decoding tables and index sizes set to + fixed code decoding. Normally this returns fixed tables from inffixed.h. + If BUILDFIXED is defined, then instead this routine builds the tables the + first time it's called, and returns those tables the first time and + thereafter. This reduces the size of the code by about 2K bytes, in + exchange for a little execution time. However, BUILDFIXED should not be + used for threaded applications, since the rewriting of the tables and virgin + may not be thread-safe. + */ +var virgin = true; + +var lenfix, distfix; // We have no pointers in JS, so keep tables separate + +function fixedtables(state) { + /* build fixed huffman tables if first call (may not be thread safe) */ + if (virgin) { + var sym; + + lenfix = new utils.Buf32(512); + distfix = new utils.Buf32(32); + + /* literal/length table */ + sym = 0; + while (sym < 144) { state.lens[sym++] = 8; } + while (sym < 256) { state.lens[sym++] = 9; } + while (sym < 280) { state.lens[sym++] = 7; } + while (sym < 288) { state.lens[sym++] = 8; } + + inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); + + /* distance table */ + sym = 0; + while (sym < 32) { state.lens[sym++] = 5; } + + inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); + + /* do this just once */ + virgin = false; + } + + state.lencode = lenfix; + state.lenbits = 9; + state.distcode = distfix; + state.distbits = 5; +} + + +/* + Update the window with the last wsize (normally 32K) bytes written before + returning. If window does not exist yet, create it. This is only called + when a window is already in use, or when output has been written during this + inflate call, but the end of the deflate stream has not been reached yet. + It is also called to create a window for dictionary data when a dictionary + is loaded. + + Providing output buffers larger than 32K to inflate() should provide a speed + advantage, since only the last 32K of output is copied to the sliding window + upon return from inflate(), and since all distances after the first 32K of + output will fall in the output data, making match copies simpler and faster. + The advantage may be dependent on the size of the processor's data caches. + */ +function updatewindow(strm, src, end, copy) { + var dist; + var state = strm.state; + + /* if it hasn't been done already, allocate space for the window */ + if (state.window === null) { + state.wsize = 1 << state.wbits; + state.wnext = 0; + state.whave = 0; + + state.window = new utils.Buf8(state.wsize); + } + + /* copy state->wsize or less output bytes into the circular window */ + if (copy >= state.wsize) { + utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0); + state.wnext = 0; + state.whave = state.wsize; + } + else { + dist = state.wsize - state.wnext; + if (dist > copy) { + dist = copy; + } + //zmemcpy(state->window + state->wnext, end - copy, dist); + utils.arraySet(state.window, src, end - copy, dist, state.wnext); + copy -= dist; + if (copy) { + //zmemcpy(state->window, end - copy, copy); + utils.arraySet(state.window, src, end - copy, copy, 0); + state.wnext = copy; + state.whave = state.wsize; + } + else { + state.wnext += dist; + if (state.wnext === state.wsize) { state.wnext = 0; } + if (state.whave < state.wsize) { state.whave += dist; } + } + } + return 0; +} + +function inflate(strm, flush) { + var state; + var input, output; // input/output buffers + var next; /* next input INDEX */ + var put; /* next output INDEX */ + var have, left; /* available input and output */ + var hold; /* bit buffer */ + var bits; /* bits in bit buffer */ + var _in, _out; /* save starting available input and output */ + var copy; /* number of stored or match bytes to copy */ + var from; /* where to copy match bytes from */ + var from_source; + var here = 0; /* current decoding table entry */ + var here_bits, here_op, here_val; // paked "here" denormalized (JS specific) + //var last; /* parent table entry */ + var last_bits, last_op, last_val; // paked "last" denormalized (JS specific) + var len; /* length to copy for repeats, bits to drop */ + var ret; /* return code */ + var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */ + var opts; + + var n; // temporary var for NEED_BITS + + var order = /* permutation of code lengths */ + [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]; + + + if (!strm || !strm.state || !strm.output || + (!strm.input && strm.avail_in !== 0)) { + return Z_STREAM_ERROR; + } + + state = strm.state; + if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */ + + + //--- LOAD() --- + put = strm.next_out; + output = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + //--- + + _in = have; + _out = left; + ret = Z_OK; + + inf_leave: // goto emulation + for (;;) { + switch (state.mode) { + case HEAD: + if (state.wrap === 0) { + state.mode = TYPEDO; + break; + } + //=== NEEDBITS(16); + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */ + state.check = 0/*crc32(0L, Z_NULL, 0)*/; + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = FLAGS; + break; + } + state.flags = 0; /* expect zlib header */ + if (state.head) { + state.head.done = false; + } + if (!(state.wrap & 1) || /* check if zlib header allowed */ + (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) { + strm.msg = 'incorrect header check'; + state.mode = BAD; + break; + } + if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) { + strm.msg = 'unknown compression method'; + state.mode = BAD; + break; + } + //--- DROPBITS(4) ---// + hold >>>= 4; + bits -= 4; + //---// + len = (hold & 0x0f)/*BITS(4)*/ + 8; + if (state.wbits === 0) { + state.wbits = len; + } + else if (len > state.wbits) { + strm.msg = 'invalid window size'; + state.mode = BAD; + break; + } + state.dmax = 1 << len; + //Tracev((stderr, "inflate: zlib header ok\n")); + strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; + state.mode = hold & 0x200 ? DICTID : TYPE; + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + break; + case FLAGS: + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.flags = hold; + if ((state.flags & 0xff) !== Z_DEFLATED) { + strm.msg = 'unknown compression method'; + state.mode = BAD; + break; + } + if (state.flags & 0xe000) { + strm.msg = 'unknown header flags set'; + state.mode = BAD; + break; + } + if (state.head) { + state.head.text = ((hold >> 8) & 1); + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = TIME; + /* falls through */ + case TIME: + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (state.head) { + state.head.time = hold; + } + if (state.flags & 0x0200) { + //=== CRC4(state.check, hold) + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + hbuf[2] = (hold >>> 16) & 0xff; + hbuf[3] = (hold >>> 24) & 0xff; + state.check = crc32(state.check, hbuf, 4, 0); + //=== + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = OS; + /* falls through */ + case OS: + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (state.head) { + state.head.xflags = (hold & 0xff); + state.head.os = (hold >> 8); + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = EXLEN; + /* falls through */ + case EXLEN: + if (state.flags & 0x0400) { + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.length = hold; + if (state.head) { + state.head.extra_len = hold; + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + } + else if (state.head) { + state.head.extra = null/*Z_NULL*/; + } + state.mode = EXTRA; + /* falls through */ + case EXTRA: + if (state.flags & 0x0400) { + copy = state.length; + if (copy > have) { copy = have; } + if (copy) { + if (state.head) { + len = state.head.extra_len - state.length; + if (!state.head.extra) { + // Use untyped array for more convenient processing later + state.head.extra = new Array(state.head.extra_len); + } + utils.arraySet( + state.head.extra, + input, + next, + // extra field is limited to 65536 bytes + // - no need for additional size check + copy, + /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ + len + ); + //zmemcpy(state.head.extra + len, next, + // len + copy > state.head.extra_max ? + // state.head.extra_max - len : copy); + } + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + state.length -= copy; + } + if (state.length) { break inf_leave; } + } + state.length = 0; + state.mode = NAME; + /* falls through */ + case NAME: + if (state.flags & 0x0800) { + if (have === 0) { break inf_leave; } + copy = 0; + do { + // TODO: 2 or 1 bytes? + len = input[next + copy++]; + /* use constant limit because in js we should not preallocate memory */ + if (state.head && len && + (state.length < 65536 /*state.head.name_max*/)) { + state.head.name += String.fromCharCode(len); + } + } while (len && copy < have); + + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + if (len) { break inf_leave; } + } + else if (state.head) { + state.head.name = null; + } + state.length = 0; + state.mode = COMMENT; + /* falls through */ + case COMMENT: + if (state.flags & 0x1000) { + if (have === 0) { break inf_leave; } + copy = 0; + do { + len = input[next + copy++]; + /* use constant limit because in js we should not preallocate memory */ + if (state.head && len && + (state.length < 65536 /*state.head.comm_max*/)) { + state.head.comment += String.fromCharCode(len); + } + } while (len && copy < have); + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + if (len) { break inf_leave; } + } + else if (state.head) { + state.head.comment = null; + } + state.mode = HCRC; + /* falls through */ + case HCRC: + if (state.flags & 0x0200) { + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (hold !== (state.check & 0xffff)) { + strm.msg = 'header crc mismatch'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + } + if (state.head) { + state.head.hcrc = ((state.flags >> 9) & 1); + state.head.done = true; + } + strm.adler = state.check = 0; + state.mode = TYPE; + break; + case DICTID: + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + strm.adler = state.check = zswap32(hold); + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = DICT; + /* falls through */ + case DICT: + if (state.havedict === 0) { + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + return Z_NEED_DICT; + } + strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; + state.mode = TYPE; + /* falls through */ + case TYPE: + if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; } + /* falls through */ + case TYPEDO: + if (state.last) { + //--- BYTEBITS() ---// + hold >>>= bits & 7; + bits -= bits & 7; + //---// + state.mode = CHECK; + break; + } + //=== NEEDBITS(3); */ + while (bits < 3) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.last = (hold & 0x01)/*BITS(1)*/; + //--- DROPBITS(1) ---// + hold >>>= 1; + bits -= 1; + //---// + + switch ((hold & 0x03)/*BITS(2)*/) { + case 0: /* stored block */ + //Tracev((stderr, "inflate: stored block%s\n", + // state.last ? " (last)" : "")); + state.mode = STORED; + break; + case 1: /* fixed block */ + fixedtables(state); + //Tracev((stderr, "inflate: fixed codes block%s\n", + // state.last ? " (last)" : "")); + state.mode = LEN_; /* decode codes */ + if (flush === Z_TREES) { + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + break inf_leave; + } + break; + case 2: /* dynamic block */ + //Tracev((stderr, "inflate: dynamic codes block%s\n", + // state.last ? " (last)" : "")); + state.mode = TABLE; + break; + case 3: + strm.msg = 'invalid block type'; + state.mode = BAD; + } + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + break; + case STORED: + //--- BYTEBITS() ---// /* go to byte boundary */ + hold >>>= bits & 7; + bits -= bits & 7; + //---// + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) { + strm.msg = 'invalid stored block lengths'; + state.mode = BAD; + break; + } + state.length = hold & 0xffff; + //Tracev((stderr, "inflate: stored length %u\n", + // state.length)); + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = COPY_; + if (flush === Z_TREES) { break inf_leave; } + /* falls through */ + case COPY_: + state.mode = COPY; + /* falls through */ + case COPY: + copy = state.length; + if (copy) { + if (copy > have) { copy = have; } + if (copy > left) { copy = left; } + if (copy === 0) { break inf_leave; } + //--- zmemcpy(put, next, copy); --- + utils.arraySet(output, input, next, copy, put); + //---// + have -= copy; + next += copy; + left -= copy; + put += copy; + state.length -= copy; + break; + } + //Tracev((stderr, "inflate: stored end\n")); + state.mode = TYPE; + break; + case TABLE: + //=== NEEDBITS(14); */ + while (bits < 14) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257; + //--- DROPBITS(5) ---// + hold >>>= 5; + bits -= 5; + //---// + state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1; + //--- DROPBITS(5) ---// + hold >>>= 5; + bits -= 5; + //---// + state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4; + //--- DROPBITS(4) ---// + hold >>>= 4; + bits -= 4; + //---// +//#ifndef PKZIP_BUG_WORKAROUND + if (state.nlen > 286 || state.ndist > 30) { + strm.msg = 'too many length or distance symbols'; + state.mode = BAD; + break; + } +//#endif + //Tracev((stderr, "inflate: table sizes ok\n")); + state.have = 0; + state.mode = LENLENS; + /* falls through */ + case LENLENS: + while (state.have < state.ncode) { + //=== NEEDBITS(3); + while (bits < 3) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.lens[order[state.have++]] = (hold & 0x07);//BITS(3); + //--- DROPBITS(3) ---// + hold >>>= 3; + bits -= 3; + //---// + } + while (state.have < 19) { + state.lens[order[state.have++]] = 0; + } + // We have separate tables & no pointers. 2 commented lines below not needed. + //state.next = state.codes; + //state.lencode = state.next; + // Switch to use dynamic table + state.lencode = state.lendyn; + state.lenbits = 7; + + opts = { bits: state.lenbits }; + ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); + state.lenbits = opts.bits; + + if (ret) { + strm.msg = 'invalid code lengths set'; + state.mode = BAD; + break; + } + //Tracev((stderr, "inflate: code lengths ok\n")); + state.have = 0; + state.mode = CODELENS; + /* falls through */ + case CODELENS: + while (state.have < state.nlen + state.ndist) { + for (;;) { + here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if (here_val < 16) { + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.lens[state.have++] = here_val; + } + else { + if (here_val === 16) { + //=== NEEDBITS(here.bits + 2); + n = here_bits + 2; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + if (state.have === 0) { + strm.msg = 'invalid bit length repeat'; + state.mode = BAD; + break; + } + len = state.lens[state.have - 1]; + copy = 3 + (hold & 0x03);//BITS(2); + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + } + else if (here_val === 17) { + //=== NEEDBITS(here.bits + 3); + n = here_bits + 3; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + len = 0; + copy = 3 + (hold & 0x07);//BITS(3); + //--- DROPBITS(3) ---// + hold >>>= 3; + bits -= 3; + //---// + } + else { + //=== NEEDBITS(here.bits + 7); + n = here_bits + 7; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + len = 0; + copy = 11 + (hold & 0x7f);//BITS(7); + //--- DROPBITS(7) ---// + hold >>>= 7; + bits -= 7; + //---// + } + if (state.have + copy > state.nlen + state.ndist) { + strm.msg = 'invalid bit length repeat'; + state.mode = BAD; + break; + } + while (copy--) { + state.lens[state.have++] = len; + } + } + } + + /* handle error breaks in while */ + if (state.mode === BAD) { break; } + + /* check for end-of-block code (better have one) */ + if (state.lens[256] === 0) { + strm.msg = 'invalid code -- missing end-of-block'; + state.mode = BAD; + break; + } + + /* build code tables -- note: do not change the lenbits or distbits + values here (9 and 6) without reading the comments in inftrees.h + concerning the ENOUGH constants, which depend on those values */ + state.lenbits = 9; + + opts = { bits: state.lenbits }; + ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); + // We have separate tables & no pointers. 2 commented lines below not needed. + // state.next_index = opts.table_index; + state.lenbits = opts.bits; + // state.lencode = state.next; + + if (ret) { + strm.msg = 'invalid literal/lengths set'; + state.mode = BAD; + break; + } + + state.distbits = 6; + //state.distcode.copy(state.codes); + // Switch to use dynamic table + state.distcode = state.distdyn; + opts = { bits: state.distbits }; + ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); + // We have separate tables & no pointers. 2 commented lines below not needed. + // state.next_index = opts.table_index; + state.distbits = opts.bits; + // state.distcode = state.next; + + if (ret) { + strm.msg = 'invalid distances set'; + state.mode = BAD; + break; + } + //Tracev((stderr, 'inflate: codes ok\n')); + state.mode = LEN_; + if (flush === Z_TREES) { break inf_leave; } + /* falls through */ + case LEN_: + state.mode = LEN; + /* falls through */ + case LEN: + if (have >= 6 && left >= 258) { + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + inflate_fast(strm, _out); + //--- LOAD() --- + put = strm.next_out; + output = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + //--- + + if (state.mode === TYPE) { + state.back = -1; + } + break; + } + state.back = 0; + for (;;) { + here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if (here_bits <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if (here_op && (here_op & 0xf0) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (;;) { + here = state.lencode[last_val + + ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)]; + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((last_bits + here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + //--- DROPBITS(last.bits) ---// + hold >>>= last_bits; + bits -= last_bits; + //---// + state.back += last_bits; + } + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.back += here_bits; + state.length = here_val; + if (here_op === 0) { + //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? + // "inflate: literal '%c'\n" : + // "inflate: literal 0x%02x\n", here.val)); + state.mode = LIT; + break; + } + if (here_op & 32) { + //Tracevv((stderr, "inflate: end of block\n")); + state.back = -1; + state.mode = TYPE; + break; + } + if (here_op & 64) { + strm.msg = 'invalid literal/length code'; + state.mode = BAD; + break; + } + state.extra = here_op & 15; + state.mode = LENEXT; + /* falls through */ + case LENEXT: + if (state.extra) { + //=== NEEDBITS(state.extra); + n = state.extra; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/; + //--- DROPBITS(state.extra) ---// + hold >>>= state.extra; + bits -= state.extra; + //---// + state.back += state.extra; + } + //Tracevv((stderr, "inflate: length %u\n", state.length)); + state.was = state.length; + state.mode = DIST; + /* falls through */ + case DIST: + for (;;) { + here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if ((here_op & 0xf0) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (;;) { + here = state.distcode[last_val + + ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)]; + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((last_bits + here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + //--- DROPBITS(last.bits) ---// + hold >>>= last_bits; + bits -= last_bits; + //---// + state.back += last_bits; + } + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.back += here_bits; + if (here_op & 64) { + strm.msg = 'invalid distance code'; + state.mode = BAD; + break; + } + state.offset = here_val; + state.extra = (here_op) & 15; + state.mode = DISTEXT; + /* falls through */ + case DISTEXT: + if (state.extra) { + //=== NEEDBITS(state.extra); + n = state.extra; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/; + //--- DROPBITS(state.extra) ---// + hold >>>= state.extra; + bits -= state.extra; + //---// + state.back += state.extra; + } +//#ifdef INFLATE_STRICT + if (state.offset > state.dmax) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break; + } +//#endif + //Tracevv((stderr, "inflate: distance %u\n", state.offset)); + state.mode = MATCH; + /* falls through */ + case MATCH: + if (left === 0) { break inf_leave; } + copy = _out - left; + if (state.offset > copy) { /* copy from window */ + copy = state.offset - copy; + if (copy > state.whave) { + if (state.sane) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break; + } +// (!) This block is disabled in zlib defaults, +// don't enable it for binary compatibility +//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR +// Trace((stderr, "inflate.c too far\n")); +// copy -= state.whave; +// if (copy > state.length) { copy = state.length; } +// if (copy > left) { copy = left; } +// left -= copy; +// state.length -= copy; +// do { +// output[put++] = 0; +// } while (--copy); +// if (state.length === 0) { state.mode = LEN; } +// break; +//#endif + } + if (copy > state.wnext) { + copy -= state.wnext; + from = state.wsize - copy; + } + else { + from = state.wnext - copy; + } + if (copy > state.length) { copy = state.length; } + from_source = state.window; + } + else { /* copy from output */ + from_source = output; + from = put - state.offset; + copy = state.length; + } + if (copy > left) { copy = left; } + left -= copy; + state.length -= copy; + do { + output[put++] = from_source[from++]; + } while (--copy); + if (state.length === 0) { state.mode = LEN; } + break; + case LIT: + if (left === 0) { break inf_leave; } + output[put++] = state.length; + left--; + state.mode = LEN; + break; + case CHECK: + if (state.wrap) { + //=== NEEDBITS(32); + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + // Use '|' instead of '+' to make sure that result is signed + hold |= input[next++] << bits; + bits += 8; + } + //===// + _out -= left; + strm.total_out += _out; + state.total += _out; + if (_out) { + strm.adler = state.check = + /*UPDATE(state.check, put - _out, _out);*/ + (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out)); + + } + _out = left; + // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too + if ((state.flags ? hold : zswap32(hold)) !== state.check) { + strm.msg = 'incorrect data check'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + //Tracev((stderr, "inflate: check matches trailer\n")); + } + state.mode = LENGTH; + /* falls through */ + case LENGTH: + if (state.wrap && state.flags) { + //=== NEEDBITS(32); + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (hold !== (state.total & 0xffffffff)) { + strm.msg = 'incorrect length check'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + //Tracev((stderr, "inflate: length matches trailer\n")); + } + state.mode = DONE; + /* falls through */ + case DONE: + ret = Z_STREAM_END; + break inf_leave; + case BAD: + ret = Z_DATA_ERROR; + break inf_leave; + case MEM: + return Z_MEM_ERROR; + case SYNC: + /* falls through */ + default: + return Z_STREAM_ERROR; + } + } + + // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave" + + /* + Return from inflate(), updating the total counts and the check value. + If there was no progress during the inflate() call, return a buffer + error. Call updatewindow() to create and/or update the window state. + Note: a memory error from inflate() is non-recoverable. + */ + + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + + if (state.wsize || (_out !== strm.avail_out && state.mode < BAD && + (state.mode < CHECK || flush !== Z_FINISH))) { + if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) { + state.mode = MEM; + return Z_MEM_ERROR; + } + } + _in -= strm.avail_in; + _out -= strm.avail_out; + strm.total_in += _in; + strm.total_out += _out; + state.total += _out; + if (state.wrap && _out) { + strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ + (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out)); + } + strm.data_type = state.bits + (state.last ? 64 : 0) + + (state.mode === TYPE ? 128 : 0) + + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); + if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) { + ret = Z_BUF_ERROR; + } + return ret; +} + +function inflateEnd(strm) { + + if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) { + return Z_STREAM_ERROR; + } + + var state = strm.state; + if (state.window) { + state.window = null; + } + strm.state = null; + return Z_OK; +} + +function inflateGetHeader(strm, head) { + var state; + + /* check state */ + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; } + + /* save header structure */ + state.head = head; + head.done = false; + return Z_OK; +} + +function inflateSetDictionary(strm, dictionary) { + var dictLength = dictionary.length; + + var state; + var dictid; + var ret; + + /* check state */ + if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; } + state = strm.state; + + if (state.wrap !== 0 && state.mode !== DICT) { + return Z_STREAM_ERROR; + } + + /* check for correct dictionary identifier */ + if (state.mode === DICT) { + dictid = 1; /* adler32(0, null, 0)*/ + /* dictid = adler32(dictid, dictionary, dictLength); */ + dictid = adler32(dictid, dictionary, dictLength, 0); + if (dictid !== state.check) { + return Z_DATA_ERROR; + } + } + /* copy dictionary to window using updatewindow(), which will amend the + existing dictionary if appropriate */ + ret = updatewindow(strm, dictionary, dictLength, dictLength); + if (ret) { + state.mode = MEM; + return Z_MEM_ERROR; + } + state.havedict = 1; + // Tracev((stderr, "inflate: dictionary set\n")); + return Z_OK; +} + +exports.inflateReset = inflateReset; +exports.inflateReset2 = inflateReset2; +exports.inflateResetKeep = inflateResetKeep; +exports.inflateInit = inflateInit; +exports.inflateInit2 = inflateInit2; +exports.inflate = inflate; +exports.inflateEnd = inflateEnd; +exports.inflateGetHeader = inflateGetHeader; +exports.inflateSetDictionary = inflateSetDictionary; +exports.inflateInfo = 'pako inflate (from Nodeca project)'; + +/* Not implemented +exports.inflateCopy = inflateCopy; +exports.inflateGetDictionary = inflateGetDictionary; +exports.inflateMark = inflateMark; +exports.inflatePrime = inflatePrime; +exports.inflateSync = inflateSync; +exports.inflateSyncPoint = inflateSyncPoint; +exports.inflateUndermine = inflateUndermine; +*/ + +},{"../utils/common":3,"./adler32":5,"./crc32":7,"./inffast":10,"./inftrees":12}],12:[function(require,module,exports){ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +var utils = require('../utils/common'); + +var MAXBITS = 15; +var ENOUGH_LENS = 852; +var ENOUGH_DISTS = 592; +//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); + +var CODES = 0; +var LENS = 1; +var DISTS = 2; + +var lbase = [ /* Length codes 257..285 base */ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 +]; + +var lext = [ /* Length codes 257..285 extra */ + 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78 +]; + +var dbase = [ /* Distance codes 0..29 base */ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577, 0, 0 +]; + +var dext = [ /* Distance codes 0..29 extra */ + 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, + 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, + 28, 28, 29, 29, 64, 64 +]; + +module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) +{ + var bits = opts.bits; + //here = opts.here; /* table entry for duplication */ + + var len = 0; /* a code's length in bits */ + var sym = 0; /* index of code symbols */ + var min = 0, max = 0; /* minimum and maximum code lengths */ + var root = 0; /* number of index bits for root table */ + var curr = 0; /* number of index bits for current table */ + var drop = 0; /* code bits to drop for sub-table */ + var left = 0; /* number of prefix codes available */ + var used = 0; /* code entries in table used */ + var huff = 0; /* Huffman code */ + var incr; /* for incrementing code, index */ + var fill; /* index for replicating entries */ + var low; /* low bits for current root entry */ + var mask; /* mask for low root bits */ + var next; /* next available space in table */ + var base = null; /* base value table to use */ + var base_index = 0; +// var shoextra; /* extra bits table to use */ + var end; /* use base and extra for symbol > end */ + var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */ + var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */ + var extra = null; + var extra_index = 0; + + var here_bits, here_op, here_val; + + /* + Process a set of code lengths to create a canonical Huffman code. The + code lengths are lens[0..codes-1]. Each length corresponds to the + symbols 0..codes-1. The Huffman code is generated by first sorting the + symbols by length from short to long, and retaining the symbol order + for codes with equal lengths. Then the code starts with all zero bits + for the first code of the shortest length, and the codes are integer + increments for the same length, and zeros are appended as the length + increases. For the deflate format, these bits are stored backwards + from their more natural integer increment ordering, and so when the + decoding tables are built in the large loop below, the integer codes + are incremented backwards. + + This routine assumes, but does not check, that all of the entries in + lens[] are in the range 0..MAXBITS. The caller must assure this. + 1..MAXBITS is interpreted as that code length. zero means that that + symbol does not occur in this code. + + The codes are sorted by computing a count of codes for each length, + creating from that a table of starting indices for each length in the + sorted table, and then entering the symbols in order in the sorted + table. The sorted table is work[], with that space being provided by + the caller. + + The length counts are used for other purposes as well, i.e. finding + the minimum and maximum length codes, determining if there are any + codes at all, checking for a valid set of lengths, and looking ahead + at length counts to determine sub-table sizes when building the + decoding tables. + */ + + /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ + for (len = 0; len <= MAXBITS; len++) { + count[len] = 0; + } + for (sym = 0; sym < codes; sym++) { + count[lens[lens_index + sym]]++; + } + + /* bound code lengths, force root to be within code lengths */ + root = bits; + for (max = MAXBITS; max >= 1; max--) { + if (count[max] !== 0) { break; } + } + if (root > max) { + root = max; + } + if (max === 0) { /* no symbols to code at all */ + //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */ + //table.bits[opts.table_index] = 1; //here.bits = (var char)1; + //table.val[opts.table_index++] = 0; //here.val = (var short)0; + table[table_index++] = (1 << 24) | (64 << 16) | 0; + + + //table.op[opts.table_index] = 64; + //table.bits[opts.table_index] = 1; + //table.val[opts.table_index++] = 0; + table[table_index++] = (1 << 24) | (64 << 16) | 0; + + opts.bits = 1; + return 0; /* no symbols, but wait for decoding to report error */ + } + for (min = 1; min < max; min++) { + if (count[min] !== 0) { break; } + } + if (root < min) { + root = min; + } + + /* check for an over-subscribed or incomplete set of lengths */ + left = 1; + for (len = 1; len <= MAXBITS; len++) { + left <<= 1; + left -= count[len]; + if (left < 0) { + return -1; + } /* over-subscribed */ + } + if (left > 0 && (type === CODES || max !== 1)) { + return -1; /* incomplete set */ + } + + /* generate offsets into symbol table for each length for sorting */ + offs[1] = 0; + for (len = 1; len < MAXBITS; len++) { + offs[len + 1] = offs[len] + count[len]; + } + + /* sort symbols by length, by symbol order within each length */ + for (sym = 0; sym < codes; sym++) { + if (lens[lens_index + sym] !== 0) { + work[offs[lens[lens_index + sym]]++] = sym; + } + } + + /* + Create and fill in decoding tables. In this loop, the table being + filled is at next and has curr index bits. The code being used is huff + with length len. That code is converted to an index by dropping drop + bits off of the bottom. For codes where len is less than drop + curr, + those top drop + curr - len bits are incremented through all values to + fill the table with replicated entries. + + root is the number of index bits for the root table. When len exceeds + root, sub-tables are created pointed to by the root entry with an index + of the low root bits of huff. This is saved in low to check for when a + new sub-table should be started. drop is zero when the root table is + being filled, and drop is root when sub-tables are being filled. + + When a new sub-table is needed, it is necessary to look ahead in the + code lengths to determine what size sub-table is needed. The length + counts are used for this, and so count[] is decremented as codes are + entered in the tables. + + used keeps track of how many table entries have been allocated from the + provided *table space. It is checked for LENS and DIST tables against + the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in + the initial root table size constants. See the comments in inftrees.h + for more information. + + sym increments through all symbols, and the loop terminates when + all codes of length max, i.e. all codes, have been processed. This + routine permits incomplete codes, so another loop after this one fills + in the rest of the decoding tables with invalid code markers. + */ + + /* set up for code type */ + // poor man optimization - use if-else instead of switch, + // to avoid deopts in old v8 + if (type === CODES) { + base = extra = work; /* dummy value--not used */ + end = 19; + + } else if (type === LENS) { + base = lbase; + base_index -= 257; + extra = lext; + extra_index -= 257; + end = 256; + + } else { /* DISTS */ + base = dbase; + extra = dext; + end = -1; + } + + /* initialize opts for loop */ + huff = 0; /* starting code */ + sym = 0; /* starting code symbol */ + len = min; /* starting code length */ + next = table_index; /* current table to fill in */ + curr = root; /* current table index bits */ + drop = 0; /* current bits to drop from code for index */ + low = -1; /* trigger new sub-table when len > root */ + used = 1 << root; /* use root table entries */ + mask = used - 1; /* mask for comparing low */ + + /* check available table space */ + if ((type === LENS && used > ENOUGH_LENS) || + (type === DISTS && used > ENOUGH_DISTS)) { + return 1; + } + + /* process all codes and make table entries */ + for (;;) { + /* create table entry */ + here_bits = len - drop; + if (work[sym] < end) { + here_op = 0; + here_val = work[sym]; + } + else if (work[sym] > end) { + here_op = extra[extra_index + work[sym]]; + here_val = base[base_index + work[sym]]; + } + else { + here_op = 32 + 64; /* end of block */ + here_val = 0; + } + + /* replicate for those indices with low len bits equal to huff */ + incr = 1 << (len - drop); + fill = 1 << curr; + min = fill; /* save offset to next table */ + do { + fill -= incr; + table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0; + } while (fill !== 0); + + /* backwards increment the len-bit code huff */ + incr = 1 << (len - 1); + while (huff & incr) { + incr >>= 1; + } + if (incr !== 0) { + huff &= incr - 1; + huff += incr; + } else { + huff = 0; + } + + /* go to next symbol, update count, len */ + sym++; + if (--count[len] === 0) { + if (len === max) { break; } + len = lens[lens_index + work[sym]]; + } + + /* create new sub-table if needed */ + if (len > root && (huff & mask) !== low) { + /* if first time, transition to sub-tables */ + if (drop === 0) { + drop = root; + } + + /* increment past last table */ + next += min; /* here min is 1 << curr */ + + /* determine length of next table */ + curr = len - drop; + left = 1 << curr; + while (curr + drop < max) { + left -= count[curr + drop]; + if (left <= 0) { break; } + curr++; + left <<= 1; + } + + /* check for enough space */ + used += 1 << curr; + if ((type === LENS && used > ENOUGH_LENS) || + (type === DISTS && used > ENOUGH_DISTS)) { + return 1; + } + + /* point entry in root table to sub-table */ + low = huff & mask; + /*table.op[low] = curr; + table.bits[low] = root; + table.val[low] = next - opts.table_index;*/ + table[low] = (root << 24) | (curr << 16) | (next - table_index) |0; + } + } + + /* fill in remaining table entry if code is incomplete (guaranteed to have + at most one remaining entry, since if the code is incomplete, the + maximum code length that was allowed to get this far is one bit) */ + if (huff !== 0) { + //table.op[next + huff] = 64; /* invalid code marker */ + //table.bits[next + huff] = len - drop; + //table.val[next + huff] = 0; + table[next + huff] = ((len - drop) << 24) | (64 << 16) |0; + } + + /* set return parameters */ + //opts.table_index += used; + opts.bits = root; + return 0; +}; + +},{"../utils/common":3}],13:[function(require,module,exports){ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +module.exports = { + 2: 'need dictionary', /* Z_NEED_DICT 2 */ + 1: 'stream end', /* Z_STREAM_END 1 */ + 0: '', /* Z_OK 0 */ + '-1': 'file error', /* Z_ERRNO (-1) */ + '-2': 'stream error', /* Z_STREAM_ERROR (-2) */ + '-3': 'data error', /* Z_DATA_ERROR (-3) */ + '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */ + '-5': 'buffer error', /* Z_BUF_ERROR (-5) */ + '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */ +}; + +},{}],14:[function(require,module,exports){ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +var utils = require('../utils/common'); + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + + +//var Z_FILTERED = 1; +//var Z_HUFFMAN_ONLY = 2; +//var Z_RLE = 3; +var Z_FIXED = 4; +//var Z_DEFAULT_STRATEGY = 0; + +/* Possible values of the data_type field (though see inflate()) */ +var Z_BINARY = 0; +var Z_TEXT = 1; +//var Z_ASCII = 1; // = Z_TEXT +var Z_UNKNOWN = 2; + +/*============================================================================*/ + + +function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } + +// From zutil.h + +var STORED_BLOCK = 0; +var STATIC_TREES = 1; +var DYN_TREES = 2; +/* The three kinds of block type */ + +var MIN_MATCH = 3; +var MAX_MATCH = 258; +/* The minimum and maximum match lengths */ + +// From deflate.h +/* =========================================================================== + * Internal compression state. + */ + +var LENGTH_CODES = 29; +/* number of length codes, not counting the special END_BLOCK code */ + +var LITERALS = 256; +/* number of literal bytes 0..255 */ + +var L_CODES = LITERALS + 1 + LENGTH_CODES; +/* number of Literal or Length codes, including the END_BLOCK code */ + +var D_CODES = 30; +/* number of distance codes */ + +var BL_CODES = 19; +/* number of codes used to transfer the bit lengths */ + +var HEAP_SIZE = 2 * L_CODES + 1; +/* maximum heap size */ + +var MAX_BITS = 15; +/* All codes must not exceed MAX_BITS bits */ + +var Buf_size = 16; +/* size of bit buffer in bi_buf */ + + +/* =========================================================================== + * Constants + */ + +var MAX_BL_BITS = 7; +/* Bit length codes must not exceed MAX_BL_BITS bits */ + +var END_BLOCK = 256; +/* end of block literal code */ + +var REP_3_6 = 16; +/* repeat previous bit length 3-6 times (2 bits of repeat count) */ + +var REPZ_3_10 = 17; +/* repeat a zero length 3-10 times (3 bits of repeat count) */ + +var REPZ_11_138 = 18; +/* repeat a zero length 11-138 times (7 bits of repeat count) */ + +/* eslint-disable comma-spacing,array-bracket-spacing */ +var extra_lbits = /* extra bits for each length code */ + [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]; + +var extra_dbits = /* extra bits for each distance code */ + [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]; + +var extra_blbits = /* extra bits for each bit length code */ + [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]; + +var bl_order = + [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]; +/* eslint-enable comma-spacing,array-bracket-spacing */ + +/* The lengths of the bit length codes are sent in order of decreasing + * probability, to avoid transmitting the lengths for unused bit length codes. + */ + +/* =========================================================================== + * Local data. These are initialized only once. + */ + +// We pre-fill arrays with 0 to avoid uninitialized gaps + +var DIST_CODE_LEN = 512; /* see definition of array dist_code below */ + +// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1 +var static_ltree = new Array((L_CODES + 2) * 2); +zero(static_ltree); +/* The static literal tree. Since the bit lengths are imposed, there is no + * need for the L_CODES extra codes used during heap construction. However + * The codes 286 and 287 are needed to build a canonical tree (see _tr_init + * below). + */ + +var static_dtree = new Array(D_CODES * 2); +zero(static_dtree); +/* The static distance tree. (Actually a trivial tree since all codes use + * 5 bits.) + */ + +var _dist_code = new Array(DIST_CODE_LEN); +zero(_dist_code); +/* Distance codes. The first 256 values correspond to the distances + * 3 .. 258, the last 256 values correspond to the top 8 bits of + * the 15 bit distances. + */ + +var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); +zero(_length_code); +/* length code for each normalized match length (0 == MIN_MATCH) */ + +var base_length = new Array(LENGTH_CODES); +zero(base_length); +/* First normalized length for each code (0 = MIN_MATCH) */ + +var base_dist = new Array(D_CODES); +zero(base_dist); +/* First normalized distance for each code (0 = distance of 1) */ + + +function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) { + + this.static_tree = static_tree; /* static tree or NULL */ + this.extra_bits = extra_bits; /* extra bits for each code or NULL */ + this.extra_base = extra_base; /* base index for extra_bits */ + this.elems = elems; /* max number of elements in the tree */ + this.max_length = max_length; /* max bit length for the codes */ + + // show if `static_tree` has data or dummy - needed for monomorphic objects + this.has_stree = static_tree && static_tree.length; +} + + +var static_l_desc; +var static_d_desc; +var static_bl_desc; + + +function TreeDesc(dyn_tree, stat_desc) { + this.dyn_tree = dyn_tree; /* the dynamic tree */ + this.max_code = 0; /* largest code with non zero frequency */ + this.stat_desc = stat_desc; /* the corresponding static tree */ +} + + + +function d_code(dist) { + return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)]; +} + + +/* =========================================================================== + * Output a short LSB first on the stream. + * IN assertion: there is enough room in pendingBuf. + */ +function put_short(s, w) { +// put_byte(s, (uch)((w) & 0xff)); +// put_byte(s, (uch)((ush)(w) >> 8)); + s.pending_buf[s.pending++] = (w) & 0xff; + s.pending_buf[s.pending++] = (w >>> 8) & 0xff; +} + + +/* =========================================================================== + * Send a value on a given number of bits. + * IN assertion: length <= 16 and value fits in length bits. + */ +function send_bits(s, value, length) { + if (s.bi_valid > (Buf_size - length)) { + s.bi_buf |= (value << s.bi_valid) & 0xffff; + put_short(s, s.bi_buf); + s.bi_buf = value >> (Buf_size - s.bi_valid); + s.bi_valid += length - Buf_size; + } else { + s.bi_buf |= (value << s.bi_valid) & 0xffff; + s.bi_valid += length; + } +} + + +function send_code(s, c, tree) { + send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/); +} + + +/* =========================================================================== + * Reverse the first len bits of a code, using straightforward code (a faster + * method would use a table) + * IN assertion: 1 <= len <= 15 + */ +function bi_reverse(code, len) { + var res = 0; + do { + res |= code & 1; + code >>>= 1; + res <<= 1; + } while (--len > 0); + return res >>> 1; +} + + +/* =========================================================================== + * Flush the bit buffer, keeping at most 7 bits in it. + */ +function bi_flush(s) { + if (s.bi_valid === 16) { + put_short(s, s.bi_buf); + s.bi_buf = 0; + s.bi_valid = 0; + + } else if (s.bi_valid >= 8) { + s.pending_buf[s.pending++] = s.bi_buf & 0xff; + s.bi_buf >>= 8; + s.bi_valid -= 8; + } +} + + +/* =========================================================================== + * Compute the optimal bit lengths for a tree and update the total bit length + * for the current block. + * IN assertion: the fields freq and dad are set, heap[heap_max] and + * above are the tree nodes sorted by increasing frequency. + * OUT assertions: the field len is set to the optimal bit length, the + * array bl_count contains the frequencies for each bit length. + * The length opt_len is updated; static_len is also updated if stree is + * not null. + */ +function gen_bitlen(s, desc) +// deflate_state *s; +// tree_desc *desc; /* the tree descriptor */ +{ + var tree = desc.dyn_tree; + var max_code = desc.max_code; + var stree = desc.stat_desc.static_tree; + var has_stree = desc.stat_desc.has_stree; + var extra = desc.stat_desc.extra_bits; + var base = desc.stat_desc.extra_base; + var max_length = desc.stat_desc.max_length; + var h; /* heap index */ + var n, m; /* iterate over the tree elements */ + var bits; /* bit length */ + var xbits; /* extra bits */ + var f; /* frequency */ + var overflow = 0; /* number of elements with bit length too large */ + + for (bits = 0; bits <= MAX_BITS; bits++) { + s.bl_count[bits] = 0; + } + + /* In a first pass, compute the optimal bit lengths (which may + * overflow in the case of the bit length tree). + */ + tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */ + + for (h = s.heap_max + 1; h < HEAP_SIZE; h++) { + n = s.heap[h]; + bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1; + if (bits > max_length) { + bits = max_length; + overflow++; + } + tree[n * 2 + 1]/*.Len*/ = bits; + /* We overwrite tree[n].Dad which is no longer needed */ + + if (n > max_code) { continue; } /* not a leaf node */ + + s.bl_count[bits]++; + xbits = 0; + if (n >= base) { + xbits = extra[n - base]; + } + f = tree[n * 2]/*.Freq*/; + s.opt_len += f * (bits + xbits); + if (has_stree) { + s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits); + } + } + if (overflow === 0) { return; } + + // Trace((stderr,"\nbit length overflow\n")); + /* This happens for example on obj2 and pic of the Calgary corpus */ + + /* Find the first bit length which could increase: */ + do { + bits = max_length - 1; + while (s.bl_count[bits] === 0) { bits--; } + s.bl_count[bits]--; /* move one leaf down the tree */ + s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */ + s.bl_count[max_length]--; + /* The brother of the overflow item also moves one step up, + * but this does not affect bl_count[max_length] + */ + overflow -= 2; + } while (overflow > 0); + + /* Now recompute all bit lengths, scanning in increasing frequency. + * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all + * lengths instead of fixing only the wrong ones. This idea is taken + * from 'ar' written by Haruhiko Okumura.) + */ + for (bits = max_length; bits !== 0; bits--) { + n = s.bl_count[bits]; + while (n !== 0) { + m = s.heap[--h]; + if (m > max_code) { continue; } + if (tree[m * 2 + 1]/*.Len*/ !== bits) { + // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); + s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/; + tree[m * 2 + 1]/*.Len*/ = bits; + } + n--; + } + } +} + + +/* =========================================================================== + * Generate the codes for a given tree and bit counts (which need not be + * optimal). + * IN assertion: the array bl_count contains the bit length statistics for + * the given tree and the field len is set for all tree elements. + * OUT assertion: the field code is set for all tree elements of non + * zero code length. + */ +function gen_codes(tree, max_code, bl_count) +// ct_data *tree; /* the tree to decorate */ +// int max_code; /* largest code with non zero frequency */ +// ushf *bl_count; /* number of codes at each bit length */ +{ + var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */ + var code = 0; /* running code value */ + var bits; /* bit index */ + var n; /* code index */ + + /* The distribution counts are first used to generate the code values + * without bit reversal. + */ + for (bits = 1; bits <= MAX_BITS; bits++) { + next_code[bits] = code = (code + bl_count[bits - 1]) << 1; + } + /* Check that the bit counts in bl_count are consistent. The last code + * must be all ones. + */ + //Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */ + length = 0; + for (code = 0; code < LENGTH_CODES - 1; code++) { + base_length[code] = length; + for (n = 0; n < (1 << extra_lbits[code]); n++) { + _length_code[length++] = code; + } + } + //Assert (length == 256, "tr_static_init: length != 256"); + /* Note that the length 255 (match length 258) can be represented + * in two different ways: code 284 + 5 bits or code 285, so we + * overwrite length_code[255] to use the best encoding: + */ + _length_code[length - 1] = code; + + /* Initialize the mapping dist (0..32K) -> dist code (0..29) */ + dist = 0; + for (code = 0; code < 16; code++) { + base_dist[code] = dist; + for (n = 0; n < (1 << extra_dbits[code]); n++) { + _dist_code[dist++] = code; + } + } + //Assert (dist == 256, "tr_static_init: dist != 256"); + dist >>= 7; /* from now on, all distances are divided by 128 */ + for (; code < D_CODES; code++) { + base_dist[code] = dist << 7; + for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) { + _dist_code[256 + dist++] = code; + } + } + //Assert (dist == 256, "tr_static_init: 256+dist != 512"); + + /* Construct the codes of the static literal tree */ + for (bits = 0; bits <= MAX_BITS; bits++) { + bl_count[bits] = 0; + } + + n = 0; + while (n <= 143) { + static_ltree[n * 2 + 1]/*.Len*/ = 8; + n++; + bl_count[8]++; + } + while (n <= 255) { + static_ltree[n * 2 + 1]/*.Len*/ = 9; + n++; + bl_count[9]++; + } + while (n <= 279) { + static_ltree[n * 2 + 1]/*.Len*/ = 7; + n++; + bl_count[7]++; + } + while (n <= 287) { + static_ltree[n * 2 + 1]/*.Len*/ = 8; + n++; + bl_count[8]++; + } + /* Codes 286 and 287 do not exist, but we must include them in the + * tree construction to get a canonical Huffman tree (longest code + * all ones) + */ + gen_codes(static_ltree, L_CODES + 1, bl_count); + + /* The static distance tree is trivial: */ + for (n = 0; n < D_CODES; n++) { + static_dtree[n * 2 + 1]/*.Len*/ = 5; + static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5); + } + + // Now data ready and we can init static trees + static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); + static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); + static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); + + //static_init_done = true; +} + + +/* =========================================================================== + * Initialize a new block. + */ +function init_block(s) { + var n; /* iterates over tree elements */ + + /* Initialize the trees. */ + for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; } + + s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1; + s.opt_len = s.static_len = 0; + s.last_lit = s.matches = 0; +} + + +/* =========================================================================== + * Flush the bit buffer and align the output on a byte boundary + */ +function bi_windup(s) +{ + if (s.bi_valid > 8) { + put_short(s, s.bi_buf); + } else if (s.bi_valid > 0) { + //put_byte(s, (Byte)s->bi_buf); + s.pending_buf[s.pending++] = s.bi_buf; + } + s.bi_buf = 0; + s.bi_valid = 0; +} + +/* =========================================================================== + * Copy a stored block, storing first the length and its + * one's complement if requested. + */ +function copy_block(s, buf, len, header) +//DeflateState *s; +//charf *buf; /* the input data */ +//unsigned len; /* its length */ +//int header; /* true if block header must be written */ +{ + bi_windup(s); /* align on byte boundary */ + + if (header) { + put_short(s, len); + put_short(s, ~len); + } +// while (len--) { +// put_byte(s, *buf++); +// } + utils.arraySet(s.pending_buf, s.window, buf, len, s.pending); + s.pending += len; +} + +/* =========================================================================== + * Compares to subtrees, using the tree depth as tie breaker when + * the subtrees have equal frequency. This minimizes the worst case length. + */ +function smaller(tree, n, m, depth) { + var _n2 = n * 2; + var _m2 = m * 2; + return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ || + (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m])); +} + +/* =========================================================================== + * Restore the heap property by moving down the tree starting at node k, + * exchanging a node with the smallest of its two sons if necessary, stopping + * when the heap property is re-established (each father smaller than its + * two sons). + */ +function pqdownheap(s, tree, k) +// deflate_state *s; +// ct_data *tree; /* the tree to restore */ +// int k; /* node to move down */ +{ + var v = s.heap[k]; + var j = k << 1; /* left son of k */ + while (j <= s.heap_len) { + /* Set j to the smallest of the two sons: */ + if (j < s.heap_len && + smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) { + j++; + } + /* Exit if v is smaller than both sons */ + if (smaller(tree, v, s.heap[j], s.depth)) { break; } + + /* Exchange v with the smallest son */ + s.heap[k] = s.heap[j]; + k = j; + + /* And continue down the tree, setting j to the left son of k */ + j <<= 1; + } + s.heap[k] = v; +} + + +// inlined manually +// var SMALLEST = 1; + +/* =========================================================================== + * Send the block data compressed using the given Huffman trees + */ +function compress_block(s, ltree, dtree) +// deflate_state *s; +// const ct_data *ltree; /* literal tree */ +// const ct_data *dtree; /* distance tree */ +{ + var dist; /* distance of matched string */ + var lc; /* match length or unmatched char (if dist == 0) */ + var lx = 0; /* running index in l_buf */ + var code; /* the code to send */ + var extra; /* number of extra bits to send */ + + if (s.last_lit !== 0) { + do { + dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]); + lc = s.pending_buf[s.l_buf + lx]; + lx++; + + if (dist === 0) { + send_code(s, lc, ltree); /* send a literal byte */ + //Tracecv(isgraph(lc), (stderr," '%c' ", lc)); + } else { + /* Here, lc is the match length - MIN_MATCH */ + code = _length_code[lc]; + send_code(s, code + LITERALS + 1, ltree); /* send the length code */ + extra = extra_lbits[code]; + if (extra !== 0) { + lc -= base_length[code]; + send_bits(s, lc, extra); /* send the extra length bits */ + } + dist--; /* dist is now the match distance - 1 */ + code = d_code(dist); + //Assert (code < D_CODES, "bad d_code"); + + send_code(s, code, dtree); /* send the distance code */ + extra = extra_dbits[code]; + if (extra !== 0) { + dist -= base_dist[code]; + send_bits(s, dist, extra); /* send the extra distance bits */ + } + } /* literal or match pair ? */ + + /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ + //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx, + // "pendingBuf overflow"); + + } while (lx < s.last_lit); + } + + send_code(s, END_BLOCK, ltree); +} + + +/* =========================================================================== + * Construct one Huffman tree and assigns the code bit strings and lengths. + * Update the total bit length for the current block. + * IN assertion: the field freq is set for all tree elements. + * OUT assertions: the fields len and code are set to the optimal bit length + * and corresponding code. The length opt_len is updated; static_len is + * also updated if stree is not null. The field max_code is set. + */ +function build_tree(s, desc) +// deflate_state *s; +// tree_desc *desc; /* the tree descriptor */ +{ + var tree = desc.dyn_tree; + var stree = desc.stat_desc.static_tree; + var has_stree = desc.stat_desc.has_stree; + var elems = desc.stat_desc.elems; + var n, m; /* iterate over heap elements */ + var max_code = -1; /* largest code with non zero frequency */ + var node; /* new node being created */ + + /* Construct the initial heap, with least frequent element in + * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. + * heap[0] is not used. + */ + s.heap_len = 0; + s.heap_max = HEAP_SIZE; + + for (n = 0; n < elems; n++) { + if (tree[n * 2]/*.Freq*/ !== 0) { + s.heap[++s.heap_len] = max_code = n; + s.depth[n] = 0; + + } else { + tree[n * 2 + 1]/*.Len*/ = 0; + } + } + + /* The pkzip format requires that at least one distance code exists, + * and that at least one bit should be sent even if there is only one + * possible code. So to avoid special checks later on we force at least + * two codes of non zero frequency. + */ + while (s.heap_len < 2) { + node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0); + tree[node * 2]/*.Freq*/ = 1; + s.depth[node] = 0; + s.opt_len--; + + if (has_stree) { + s.static_len -= stree[node * 2 + 1]/*.Len*/; + } + /* node is 0 or 1 so it does not have extra bits */ + } + desc.max_code = max_code; + + /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, + * establish sub-heaps of increasing lengths: + */ + for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); } + + /* Construct the Huffman tree by repeatedly combining the least two + * frequent nodes. + */ + node = elems; /* next internal node of the tree */ + do { + //pqremove(s, tree, n); /* n = node of least frequency */ + /*** pqremove ***/ + n = s.heap[1/*SMALLEST*/]; + s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--]; + pqdownheap(s, tree, 1/*SMALLEST*/); + /***/ + + m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */ + + s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */ + s.heap[--s.heap_max] = m; + + /* Create a new node father of n and m */ + tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/; + s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1; + tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node; + + /* and insert the new node in the heap */ + s.heap[1/*SMALLEST*/] = node++; + pqdownheap(s, tree, 1/*SMALLEST*/); + + } while (s.heap_len >= 2); + + s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/]; + + /* At this point, the fields freq and dad are set. We can now + * generate the bit lengths. + */ + gen_bitlen(s, desc); + + /* The field len is now set, we can generate the bit codes */ + gen_codes(tree, max_code, s.bl_count); +} + + +/* =========================================================================== + * Scan a literal or distance tree to determine the frequencies of the codes + * in the bit length tree. + */ +function scan_tree(s, tree, max_code) +// deflate_state *s; +// ct_data *tree; /* the tree to be scanned */ +// int max_code; /* and its largest code of non zero frequency */ +{ + var n; /* iterates over all tree elements */ + var prevlen = -1; /* last emitted length */ + var curlen; /* length of current code */ + + var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */ + + var count = 0; /* repeat count of the current code */ + var max_count = 7; /* max repeat count */ + var min_count = 4; /* min repeat count */ + + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } + tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */ + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; + nextlen = tree[(n + 1) * 2 + 1]/*.Len*/; + + if (++count < max_count && curlen === nextlen) { + continue; + + } else if (count < min_count) { + s.bl_tree[curlen * 2]/*.Freq*/ += count; + + } else if (curlen !== 0) { + + if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; } + s.bl_tree[REP_3_6 * 2]/*.Freq*/++; + + } else if (count <= 10) { + s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++; + + } else { + s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++; + } + + count = 0; + prevlen = curlen; + + if (nextlen === 0) { + max_count = 138; + min_count = 3; + + } else if (curlen === nextlen) { + max_count = 6; + min_count = 3; + + } else { + max_count = 7; + min_count = 4; + } + } +} + + +/* =========================================================================== + * Send a literal or distance tree in compressed form, using the codes in + * bl_tree. + */ +function send_tree(s, tree, max_code) +// deflate_state *s; +// ct_data *tree; /* the tree to be scanned */ +// int max_code; /* and its largest code of non zero frequency */ +{ + var n; /* iterates over all tree elements */ + var prevlen = -1; /* last emitted length */ + var curlen; /* length of current code */ + + var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */ + + var count = 0; /* repeat count of the current code */ + var max_count = 7; /* max repeat count */ + var min_count = 4; /* min repeat count */ + + /* tree[max_code+1].Len = -1; */ /* guard already set */ + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; + nextlen = tree[(n + 1) * 2 + 1]/*.Len*/; + + if (++count < max_count && curlen === nextlen) { + continue; + + } else if (count < min_count) { + do { send_code(s, curlen, s.bl_tree); } while (--count !== 0); + + } else if (curlen !== 0) { + if (curlen !== prevlen) { + send_code(s, curlen, s.bl_tree); + count--; + } + //Assert(count >= 3 && count <= 6, " 3_6?"); + send_code(s, REP_3_6, s.bl_tree); + send_bits(s, count - 3, 2); + + } else if (count <= 10) { + send_code(s, REPZ_3_10, s.bl_tree); + send_bits(s, count - 3, 3); + + } else { + send_code(s, REPZ_11_138, s.bl_tree); + send_bits(s, count - 11, 7); + } + + count = 0; + prevlen = curlen; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + + } else if (curlen === nextlen) { + max_count = 6; + min_count = 3; + + } else { + max_count = 7; + min_count = 4; + } + } +} + + +/* =========================================================================== + * Construct the Huffman tree for the bit lengths and return the index in + * bl_order of the last bit length code to send. + */ +function build_bl_tree(s) { + var max_blindex; /* index of last bit length code of non zero freq */ + + /* Determine the bit length frequencies for literal and distance trees */ + scan_tree(s, s.dyn_ltree, s.l_desc.max_code); + scan_tree(s, s.dyn_dtree, s.d_desc.max_code); + + /* Build the bit length tree: */ + build_tree(s, s.bl_desc); + /* opt_len now includes the length of the tree representations, except + * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. + */ + + /* Determine the number of bit length codes to send. The pkzip format + * requires that at least 4 bit length codes be sent. (appnote.txt says + * 3 but the actual value used is 4.) + */ + for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { + if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) { + break; + } + } + /* Update opt_len to include the bit length tree and counts */ + s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; + //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", + // s->opt_len, s->static_len)); + + return max_blindex; +} + + +/* =========================================================================== + * Send the header for a block using dynamic Huffman trees: the counts, the + * lengths of the bit length codes, the literal tree and the distance tree. + * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. + */ +function send_all_trees(s, lcodes, dcodes, blcodes) +// deflate_state *s; +// int lcodes, dcodes, blcodes; /* number of codes for each tree */ +{ + var rank; /* index in bl_order */ + + //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); + //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, + // "too many codes"); + //Tracev((stderr, "\nbl counts: ")); + send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */ + send_bits(s, dcodes - 1, 5); + send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */ + for (rank = 0; rank < blcodes; rank++) { + //Tracev((stderr, "\nbl code %2d ", bl_order[rank])); + send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3); + } + //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); + + send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */ + //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); + + send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */ + //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); +} + + +/* =========================================================================== + * Check if the data type is TEXT or BINARY, using the following algorithm: + * - TEXT if the two conditions below are satisfied: + * a) There are no non-portable control characters belonging to the + * "black list" (0..6, 14..25, 28..31). + * b) There is at least one printable character belonging to the + * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). + * - BINARY otherwise. + * - The following partially-portable control characters form a + * "gray list" that is ignored in this detection algorithm: + * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). + * IN assertion: the fields Freq of dyn_ltree are set. + */ +function detect_data_type(s) { + /* black_mask is the bit mask of black-listed bytes + * set bits 0..6, 14..25, and 28..31 + * 0xf3ffc07f = binary 11110011111111111100000001111111 + */ + var black_mask = 0xf3ffc07f; + var n; + + /* Check for non-textual ("black-listed") bytes. */ + for (n = 0; n <= 31; n++, black_mask >>>= 1) { + if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) { + return Z_BINARY; + } + } + + /* Check for textual ("white-listed") bytes. */ + if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 || + s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) { + return Z_TEXT; + } + for (n = 32; n < LITERALS; n++) { + if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) { + return Z_TEXT; + } + } + + /* There are no "black-listed" or "white-listed" bytes: + * this stream either is empty or has tolerated ("gray-listed") bytes only. + */ + return Z_BINARY; +} + + +var static_init_done = false; + +/* =========================================================================== + * Initialize the tree data structures for a new zlib stream. + */ +function _tr_init(s) +{ + + if (!static_init_done) { + tr_static_init(); + static_init_done = true; + } + + s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc); + s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc); + s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc); + + s.bi_buf = 0; + s.bi_valid = 0; + + /* Initialize the first block of the first file: */ + init_block(s); +} + + +/* =========================================================================== + * Send a stored block + */ +function _tr_stored_block(s, buf, stored_len, last) +//DeflateState *s; +//charf *buf; /* input block */ +//ulg stored_len; /* length of input block */ +//int last; /* one if this is the last block for a file */ +{ + send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */ + copy_block(s, buf, stored_len, true); /* with header */ +} + + +/* =========================================================================== + * Send one empty static block to give enough lookahead for inflate. + * This takes 10 bits, of which 7 may remain in the bit buffer. + */ +function _tr_align(s) { + send_bits(s, STATIC_TREES << 1, 3); + send_code(s, END_BLOCK, static_ltree); + bi_flush(s); +} + + +/* =========================================================================== + * Determine the best encoding for the current block: dynamic trees, static + * trees or store, and output the encoded block to the zip file. + */ +function _tr_flush_block(s, buf, stored_len, last) +//DeflateState *s; +//charf *buf; /* input block, or NULL if too old */ +//ulg stored_len; /* length of input block */ +//int last; /* one if this is the last block for a file */ +{ + var opt_lenb, static_lenb; /* opt_len and static_len in bytes */ + var max_blindex = 0; /* index of last bit length code of non zero freq */ + + /* Build the Huffman trees unless a stored block is forced */ + if (s.level > 0) { + + /* Check if the file is binary or text */ + if (s.strm.data_type === Z_UNKNOWN) { + s.strm.data_type = detect_data_type(s); + } + + /* Construct the literal and distance trees */ + build_tree(s, s.l_desc); + // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len, + // s->static_len)); + + build_tree(s, s.d_desc); + // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len, + // s->static_len)); + /* At this point, opt_len and static_len are the total bit lengths of + * the compressed block data, excluding the tree representations. + */ + + /* Build the bit length tree for the above two trees, and get the index + * in bl_order of the last bit length code to send. + */ + max_blindex = build_bl_tree(s); + + /* Determine the best encoding. Compute the block lengths in bytes. */ + opt_lenb = (s.opt_len + 3 + 7) >>> 3; + static_lenb = (s.static_len + 3 + 7) >>> 3; + + // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", + // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, + // s->last_lit)); + + if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; } + + } else { + // Assert(buf != (char*)0, "lost buf"); + opt_lenb = static_lenb = stored_len + 5; /* force a stored block */ + } + + if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) { + /* 4: two words for the lengths */ + + /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. + * Otherwise we can't have processed more than WSIZE input bytes since + * the last block flush, because compression would have been + * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to + * transform a block into a stored block. + */ + _tr_stored_block(s, buf, stored_len, last); + + } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { + + send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3); + compress_block(s, static_ltree, static_dtree); + + } else { + send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3); + send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1); + compress_block(s, s.dyn_ltree, s.dyn_dtree); + } + // Assert (s->compressed_len == s->bits_sent, "bad compressed size"); + /* The above check is made mod 2^32, for files larger than 512 MB + * and uLong implemented on 32 bits. + */ + init_block(s); + + if (last) { + bi_windup(s); + } + // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, + // s->compressed_len-7*last)); +} + +/* =========================================================================== + * Save the match info and tally the frequency counts. Return true if + * the current block must be flushed. + */ +function _tr_tally(s, dist, lc) +// deflate_state *s; +// unsigned dist; /* distance of matched string */ +// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ +{ + //var out_length, in_length, dcode; + + s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff; + s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff; + + s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff; + s.last_lit++; + + if (dist === 0) { + /* lc is the unmatched char */ + s.dyn_ltree[lc * 2]/*.Freq*/++; + } else { + s.matches++; + /* Here, lc is the match length - MIN_MATCH */ + dist--; /* dist = match distance - 1 */ + //Assert((ush)dist < (ush)MAX_DIST(s) && + // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && + // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); + + s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++; + s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++; + } + +// (!) This block is disabled in zlib defaults, +// don't enable it for binary compatibility + +//#ifdef TRUNCATE_BLOCK +// /* Try to guess if it is profitable to stop the current block here */ +// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) { +// /* Compute an upper bound for the compressed length */ +// out_length = s.last_lit*8; +// in_length = s.strstart - s.block_start; +// +// for (dcode = 0; dcode < D_CODES; dcode++) { +// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]); +// } +// out_length >>>= 3; +// //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", +// // s->last_lit, in_length, out_length, +// // 100L - out_length*100L/in_length)); +// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) { +// return true; +// } +// } +//#endif + + return (s.last_lit === s.lit_bufsize - 1); + /* We avoid equality with lit_bufsize because of wraparound at 64K + * on 16 bit machines and because stored blocks are restricted to + * 64K-1 bytes. + */ +} + +exports._tr_init = _tr_init; +exports._tr_stored_block = _tr_stored_block; +exports._tr_flush_block = _tr_flush_block; +exports._tr_tally = _tr_tally; +exports._tr_align = _tr_align; + +},{"../utils/common":3}],15:[function(require,module,exports){ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +function ZStream() { + /* next input byte */ + this.input = null; // JS specific, because we have no pointers + this.next_in = 0; + /* number of bytes available at input */ + this.avail_in = 0; + /* total number of input bytes read so far */ + this.total_in = 0; + /* next output byte should be put there */ + this.output = null; // JS specific, because we have no pointers + this.next_out = 0; + /* remaining free space at output */ + this.avail_out = 0; + /* total number of bytes output so far */ + this.total_out = 0; + /* last error message, NULL if no error */ + this.msg = ''/*Z_NULL*/; + /* not visible by applications */ + this.state = null; + /* best guess about the data type: binary or text */ + this.data_type = 2/*Z_UNKNOWN*/; + /* adler32 value of the uncompressed data */ + this.adler = 0; +} + +module.exports = ZStream; + +},{}],"/":[function(require,module,exports){ +// Top level file is just a mixin of submodules & constants +'use strict'; + +var assign = require('./lib/utils/common').assign; + +var deflate = require('./lib/deflate'); +var inflate = require('./lib/inflate'); +var constants = require('./lib/zlib/constants'); + +var pako = {}; + +assign(pako, deflate, inflate, constants); + +module.exports = pako; + +},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/") +}); \ No newline at end of file diff --git a/node_modules/pako/dist/pako.min.js b/node_modules/pako/dist/pako.min.js new file mode 100644 index 000000000..73024f7a6 --- /dev/null +++ b/node_modules/pako/dist/pako.min.js @@ -0,0 +1 @@ +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).pako=t()}}(function(){return function t(e,a,i){function n(s,o){if(!a[s]){if(!e[s]){var l="function"==typeof require&&require;if(!o&&l)return l(s,!0);if(r)return r(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var d=a[s]={exports:{}};e[s][0].call(d.exports,function(t){var a=e[s][1][t];return n(a||t)},d,d.exports,t,e,a,i)}return a[s].exports}for(var r="function"==typeof require&&require,s=0;s0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var a=r.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==f)throw new Error(l[a]);if(e.header&&r.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(n="string"==typeof e.dictionary?o.string2buf(e.dictionary):"[object ArrayBuffer]"===d.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(a=r.deflateSetDictionary(this.strm,n))!==f)throw new Error(l[a]);this._dict_set=!0}}function n(t,e){var a=new i(e);if(a.push(t,!0),a.err)throw a.msg||l[a.err];return a.result}var r=t("./zlib/deflate"),s=t("./utils/common"),o=t("./utils/strings"),l=t("./zlib/messages"),h=t("./zlib/zstream"),d=Object.prototype.toString,f=0,_=-1,u=0,c=8;i.prototype.push=function(t,e){var a,i,n=this.strm,l=this.options.chunkSize;if(this.ended)return!1;i=e===~~e?e:!0===e?4:0,"string"==typeof t?n.input=o.string2buf(t):"[object ArrayBuffer]"===d.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;do{if(0===n.avail_out&&(n.output=new s.Buf8(l),n.next_out=0,n.avail_out=l),1!==(a=r.deflate(n,i))&&a!==f)return this.onEnd(a),this.ended=!0,!1;0!==n.avail_out&&(0!==n.avail_in||4!==i&&2!==i)||("string"===this.options.to?this.onData(o.buf2binstring(s.shrinkBuf(n.output,n.next_out))):this.onData(s.shrinkBuf(n.output,n.next_out)))}while((n.avail_in>0||0===n.avail_out)&&1!==a);return 4===i?(a=r.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===f):2!==i||(this.onEnd(f),n.avail_out=0,!0)},i.prototype.onData=function(t){this.chunks.push(t)},i.prototype.onEnd=function(t){t===f&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},a.Deflate=i,a.deflate=n,a.deflateRaw=function(t,e){return e=e||{},e.raw=!0,n(t,e)},a.gzip=function(t,e){return e=e||{},e.gzip=!0,n(t,e)}},{"./utils/common":3,"./utils/strings":4,"./zlib/deflate":8,"./zlib/messages":13,"./zlib/zstream":15}],2:[function(t,e,a){"use strict";function i(t){if(!(this instanceof i))return new i(t);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var a=r.inflateInit2(this.strm,e.windowBits);if(a!==l.Z_OK)throw new Error(h[a]);this.header=new f,r.inflateGetHeader(this.strm,this.header)}function n(t,e){var a=new i(e);if(a.push(t,!0),a.err)throw a.msg||h[a.err];return a.result}var r=t("./zlib/inflate"),s=t("./utils/common"),o=t("./utils/strings"),l=t("./zlib/constants"),h=t("./zlib/messages"),d=t("./zlib/zstream"),f=t("./zlib/gzheader"),_=Object.prototype.toString;i.prototype.push=function(t,e){var a,i,n,h,d,f,u=this.strm,c=this.options.chunkSize,b=this.options.dictionary,g=!1;if(this.ended)return!1;i=e===~~e?e:!0===e?l.Z_FINISH:l.Z_NO_FLUSH,"string"==typeof t?u.input=o.binstring2buf(t):"[object ArrayBuffer]"===_.call(t)?u.input=new Uint8Array(t):u.input=t,u.next_in=0,u.avail_in=u.input.length;do{if(0===u.avail_out&&(u.output=new s.Buf8(c),u.next_out=0,u.avail_out=c),(a=r.inflate(u,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&b&&(f="string"==typeof b?o.string2buf(b):"[object ArrayBuffer]"===_.call(b)?new Uint8Array(b):b,a=r.inflateSetDictionary(this.strm,f)),a===l.Z_BUF_ERROR&&!0===g&&(a=l.Z_OK,g=!1),a!==l.Z_STREAM_END&&a!==l.Z_OK)return this.onEnd(a),this.ended=!0,!1;u.next_out&&(0!==u.avail_out&&a!==l.Z_STREAM_END&&(0!==u.avail_in||i!==l.Z_FINISH&&i!==l.Z_SYNC_FLUSH)||("string"===this.options.to?(n=o.utf8border(u.output,u.next_out),h=u.next_out-n,d=o.buf2string(u.output,n),u.next_out=h,u.avail_out=c-h,h&&s.arraySet(u.output,u.output,n,h,0),this.onData(d)):this.onData(s.shrinkBuf(u.output,u.next_out)))),0===u.avail_in&&0===u.avail_out&&(g=!0)}while((u.avail_in>0||0===u.avail_out)&&a!==l.Z_STREAM_END);return a===l.Z_STREAM_END&&(i=l.Z_FINISH),i===l.Z_FINISH?(a=r.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===l.Z_OK):i!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),u.avail_out=0,!0)},i.prototype.onData=function(t){this.chunks.push(t)},i.prototype.onEnd=function(t){t===l.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},a.Inflate=i,a.inflate=n,a.inflateRaw=function(t,e){return e=e||{},e.raw=!0,n(t,e)},a.ungzip=n},{"./utils/common":3,"./utils/strings":4,"./zlib/constants":6,"./zlib/gzheader":9,"./zlib/inflate":11,"./zlib/messages":13,"./zlib/zstream":15}],3:[function(t,e,a){"use strict";function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;a.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(var n in a)i(a,n)&&(t[n]=a[n])}}return t},a.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var r={arraySet:function(t,e,a,i,n){if(e.subarray&&t.subarray)t.set(e.subarray(a,a+i),n);else for(var r=0;r=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1;o[254]=o[254]=1,a.string2buf=function(t){var e,a,i,r,s,o=t.length,l=0;for(r=0;r>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},a.buf2binstring=function(t){return i(t,t.length)},a.binstring2buf=function(t){for(var e=new n.Buf8(t.length),a=0,i=e.length;a4)h[n++]=65533,a+=s-1;else{for(r&=2===s?31:3===s?15:7;s>1&&a1?h[n++]=65533:r<65536?h[n++]=r:(r-=65536,h[n++]=55296|r>>10&1023,h[n++]=56320|1023&r)}return i(h,n)},a.utf8border=function(t,e){var a;for((e=e||t.length)>t.length&&(e=t.length),a=e-1;a>=0&&128==(192&t[a]);)a--;return a<0?e:0===a?e:a+o[t[a]]>e?a:e}},{"./common":3}],5:[function(t,e,a){"use strict";e.exports=function(t,e,a,i){for(var n=65535&t|0,r=t>>>16&65535|0,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{r=r+(n=n+e[i++]|0)|0}while(--s);n%=65521,r%=65521}return n|r<<16|0}},{}],6:[function(t,e,a){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],7:[function(t,e,a){"use strict";var i=function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}();e.exports=function(t,e,a,n){var r=i,s=n+a;t^=-1;for(var o=n;o>>8^r[255&(t^e[o])];return-1^t}},{}],8:[function(t,e,a){"use strict";function i(t,e){return t.msg=A[e],e}function n(t){return(t<<1)-(t>4?9:0)}function r(t){for(var e=t.length;--e>=0;)t[e]=0}function s(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(z.arraySet(t.output,e.pending_buf,e.pending_out,a,t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))}function o(t,e){B._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,s(t.strm)}function l(t,e){t.pending_buf[t.pending++]=e}function h(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function d(t,e,a,i){var n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,z.arraySet(e,t.input,t.next_in,n,a),1===t.state.wrap?t.adler=S(t.adler,e,n,a):2===t.state.wrap&&(t.adler=E(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)}function f(t,e){var a,i,n=t.max_chain_length,r=t.strstart,s=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-it?t.strstart-(t.w_size-it):0,h=t.window,d=t.w_mask,f=t.prev,_=t.strstart+at,u=h[r+s-1],c=h[r+s];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(a=e,h[a+s]===c&&h[a+s-1]===u&&h[a]===h[r]&&h[++a]===h[r+1]){r+=2,a++;do{}while(h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&r<_);if(i=at-(_-r),r=_-at,i>s){if(t.match_start=e,s=i,i>=o)break;u=h[r+s-1],c=h[r+s]}}}while((e=f[e&d])>l&&0!=--n);return s<=t.lookahead?s:t.lookahead}function _(t){var e,a,i,n,r,s=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-it)){z.arraySet(t.window,t.window,s,s,0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{i=t.head[--e],t.head[e]=i>=s?i-s:0}while(--a);e=a=s;do{i=t.prev[--e],t.prev[e]=i>=s?i-s:0}while(--a);n+=s}if(0===t.strm.avail_in)break;if(a=d(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=a,t.lookahead+t.insert>=et)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=(t.ins_h<=et&&(t.ins_h=(t.ins_h<=et)if(i=B._tr_tally(t,t.strstart-t.match_start,t.match_length-et),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=et){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<=et&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=et-1)),t.prev_length>=et&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-et,i=B._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-et),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=(t.ins_h<=et&&t.strstart>0&&(n=t.strstart-1,(i=s[n])===s[++n]&&i===s[++n]&&i===s[++n])){r=t.strstart+at;do{}while(i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=et?(a=B._tr_tally(t,1,t.match_length-et),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=B._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(o(t,!1),0===t.strm.avail_out))return _t}return t.insert=0,e===N?(o(t,!0),0===t.strm.avail_out?ct:bt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?_t:ut}function g(t,e){for(var a;;){if(0===t.lookahead&&(_(t),0===t.lookahead)){if(e===Z)return _t;break}if(t.match_length=0,a=B._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(o(t,!1),0===t.strm.avail_out))return _t}return t.insert=0,e===N?(o(t,!0),0===t.strm.avail_out?ct:bt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?_t:ut}function m(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}function w(t){t.window_size=2*t.w_size,r(t.head),t.max_lazy_match=x[t.level].max_lazy,t.good_match=x[t.level].good_length,t.nice_match=x[t.level].nice_length,t.max_chain_length=x[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=et-1,t.match_available=0,t.ins_h=0}function p(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=q,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new z.Buf16(2*$),this.dyn_dtree=new z.Buf16(2*(2*Q+1)),this.bl_tree=new z.Buf16(2*(2*V+1)),r(this.dyn_ltree),r(this.dyn_dtree),r(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new z.Buf16(tt+1),this.heap=new z.Buf16(2*J+1),r(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new z.Buf16(2*J+1),r(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function v(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=Y,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?rt:dt,t.adler=2===e.wrap?0:1,e.last_flush=Z,B._tr_init(e),D):i(t,U)}function k(t){var e=v(t);return e===D&&w(t.state),e}function y(t,e,a,n,r,s){if(!t)return U;var o=1;if(e===L&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),r<1||r>G||a!==q||n<8||n>15||e<0||e>9||s<0||s>M)return i(t,U);8===n&&(n=9);var l=new p;return t.state=l,l.strm=t,l.wrap=o,l.gzhead=null,l.w_bits=n,l.w_size=1<t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(_(t),0===t.lookahead&&e===Z)return _t;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+a;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,o(t,!1),0===t.strm.avail_out))return _t;if(t.strstart-t.block_start>=t.w_size-it&&(o(t,!1),0===t.strm.avail_out))return _t}return t.insert=0,e===N?(o(t,!0),0===t.strm.avail_out?ct:bt):(t.strstart>t.block_start&&(o(t,!1),t.strm.avail_out),_t)}),new m(4,4,8,4,u),new m(4,5,16,8,u),new m(4,6,32,32,u),new m(4,4,16,16,c),new m(8,16,32,32,c),new m(8,16,128,128,c),new m(8,32,128,256,c),new m(32,128,258,1024,c),new m(32,258,258,4096,c)],a.deflateInit=function(t,e){return y(t,e,q,X,W,P)},a.deflateInit2=y,a.deflateReset=k,a.deflateResetKeep=v,a.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?U:(t.state.gzhead=e,D):U},a.deflate=function(t,e){var a,o,d,f;if(!t||!t.state||e>O||e<0)return t?i(t,U):U;if(o=t.state,!t.output||!t.input&&0!==t.avail_in||o.status===ft&&e!==N)return i(t,0===t.avail_out?F:U);if(o.strm=t,a=o.last_flush,o.last_flush=e,o.status===rt)if(2===o.wrap)t.adler=0,l(o,31),l(o,139),l(o,8),o.gzhead?(l(o,(o.gzhead.text?1:0)+(o.gzhead.hcrc?2:0)+(o.gzhead.extra?4:0)+(o.gzhead.name?8:0)+(o.gzhead.comment?16:0)),l(o,255&o.gzhead.time),l(o,o.gzhead.time>>8&255),l(o,o.gzhead.time>>16&255),l(o,o.gzhead.time>>24&255),l(o,9===o.level?2:o.strategy>=j||o.level<2?4:0),l(o,255&o.gzhead.os),o.gzhead.extra&&o.gzhead.extra.length&&(l(o,255&o.gzhead.extra.length),l(o,o.gzhead.extra.length>>8&255)),o.gzhead.hcrc&&(t.adler=E(t.adler,o.pending_buf,o.pending,0)),o.gzindex=0,o.status=st):(l(o,0),l(o,0),l(o,0),l(o,0),l(o,0),l(o,9===o.level?2:o.strategy>=j||o.level<2?4:0),l(o,gt),o.status=dt);else{var _=q+(o.w_bits-8<<4)<<8;_|=(o.strategy>=j||o.level<2?0:o.level<6?1:6===o.level?2:3)<<6,0!==o.strstart&&(_|=nt),_+=31-_%31,o.status=dt,h(o,_),0!==o.strstart&&(h(o,t.adler>>>16),h(o,65535&t.adler)),t.adler=1}if(o.status===st)if(o.gzhead.extra){for(d=o.pending;o.gzindex<(65535&o.gzhead.extra.length)&&(o.pending!==o.pending_buf_size||(o.gzhead.hcrc&&o.pending>d&&(t.adler=E(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending!==o.pending_buf_size));)l(o,255&o.gzhead.extra[o.gzindex]),o.gzindex++;o.gzhead.hcrc&&o.pending>d&&(t.adler=E(t.adler,o.pending_buf,o.pending-d,d)),o.gzindex===o.gzhead.extra.length&&(o.gzindex=0,o.status=ot)}else o.status=ot;if(o.status===ot)if(o.gzhead.name){d=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>d&&(t.adler=E(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending===o.pending_buf_size)){f=1;break}f=o.gzindexd&&(t.adler=E(t.adler,o.pending_buf,o.pending-d,d)),0===f&&(o.gzindex=0,o.status=lt)}else o.status=lt;if(o.status===lt)if(o.gzhead.comment){d=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>d&&(t.adler=E(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending===o.pending_buf_size)){f=1;break}f=o.gzindexd&&(t.adler=E(t.adler,o.pending_buf,o.pending-d,d)),0===f&&(o.status=ht)}else o.status=ht;if(o.status===ht&&(o.gzhead.hcrc?(o.pending+2>o.pending_buf_size&&s(t),o.pending+2<=o.pending_buf_size&&(l(o,255&t.adler),l(o,t.adler>>8&255),t.adler=0,o.status=dt)):o.status=dt),0!==o.pending){if(s(t),0===t.avail_out)return o.last_flush=-1,D}else if(0===t.avail_in&&n(e)<=n(a)&&e!==N)return i(t,F);if(o.status===ft&&0!==t.avail_in)return i(t,F);if(0!==t.avail_in||0!==o.lookahead||e!==Z&&o.status!==ft){var u=o.strategy===j?g(o,e):o.strategy===K?b(o,e):x[o.level].func(o,e);if(u!==ct&&u!==bt||(o.status=ft),u===_t||u===ct)return 0===t.avail_out&&(o.last_flush=-1),D;if(u===ut&&(e===R?B._tr_align(o):e!==O&&(B._tr_stored_block(o,0,0,!1),e===C&&(r(o.head),0===o.lookahead&&(o.strstart=0,o.block_start=0,o.insert=0))),s(t),0===t.avail_out))return o.last_flush=-1,D}return e!==N?D:o.wrap<=0?I:(2===o.wrap?(l(o,255&t.adler),l(o,t.adler>>8&255),l(o,t.adler>>16&255),l(o,t.adler>>24&255),l(o,255&t.total_in),l(o,t.total_in>>8&255),l(o,t.total_in>>16&255),l(o,t.total_in>>24&255)):(h(o,t.adler>>>16),h(o,65535&t.adler)),s(t),o.wrap>0&&(o.wrap=-o.wrap),0!==o.pending?D:I)},a.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==rt&&e!==st&&e!==ot&&e!==lt&&e!==ht&&e!==dt&&e!==ft?i(t,U):(t.state=null,e===dt?i(t,T):D):U},a.deflateSetDictionary=function(t,e){var a,i,n,s,o,l,h,d,f=e.length;if(!t||!t.state)return U;if(a=t.state,2===(s=a.wrap)||1===s&&a.status!==rt||a.lookahead)return U;for(1===s&&(t.adler=S(t.adler,e,f,0)),a.wrap=0,f>=a.w_size&&(0===s&&(r(a.head),a.strstart=0,a.block_start=0,a.insert=0),d=new z.Buf8(a.w_size),z.arraySet(d,e,f-a.w_size,a.w_size,0),e=d,f=a.w_size),o=t.avail_in,l=t.next_in,h=t.input,t.avail_in=f,t.next_in=0,t.input=e,_(a);a.lookahead>=et;){i=a.strstart,n=a.lookahead-(et-1);do{a.ins_h=(a.ins_h<>>24,u>>>=v,c-=v,0===(v=p>>>16&255))S[r++]=65535&p;else{if(!(16&v)){if(0==(64&v)){p=b[(65535&p)+(u&(1<>>=v,c-=v),c<15&&(u+=B[i++]<>>24,u>>>=v,c-=v,!(16&(v=p>>>16&255))){if(0==(64&v)){p=g[(65535&p)+(u&(1<l){t.msg="invalid distance too far back",a.mode=30;break t}if(u>>>=v,c-=v,v=r-s,y>v){if((v=y-v)>d&&a.sane){t.msg="invalid distance too far back",a.mode=30;break t}if(x=0,z=_,0===f){if(x+=h-v,v2;)S[r++]=z[x++],S[r++]=z[x++],S[r++]=z[x++],k-=3;k&&(S[r++]=z[x++],k>1&&(S[r++]=z[x++]))}else{x=r-y;do{S[r++]=S[x++],S[r++]=S[x++],S[r++]=S[x++],k-=3}while(k>2);k&&(S[r++]=S[x++],k>1&&(S[r++]=S[x++]))}break}}break}}while(i>3,u&=(1<<(c-=k<<3))-1,t.next_in=i,t.next_out=r,t.avail_in=i>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function n(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new u.Buf16(320),this.work=new u.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function r(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=N,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new u.Buf32(dt),e.distcode=e.distdyn=new u.Buf32(ft),e.sane=1,e.back=-1,z):E}function s(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,r(t)):E}function o(t,e){var a,i;return t&&t.state?(i=t.state,e<0?(a=0,e=-e):(a=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?E:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,s(t))):E}function l(t,e){var a,i;return t?(i=new n,t.state=i,i.window=null,(a=o(t,e))!==z&&(t.state=null),a):E}function h(t){if(ut){var e;for(f=new u.Buf32(512),_=new u.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(m(p,t.lens,0,288,f,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;m(v,t.lens,0,32,_,0,t.work,{bits:5}),ut=!1}t.lencode=f,t.lenbits=9,t.distcode=_,t.distbits=5}function d(t,e,a,i){var n,r=t.state;return null===r.window&&(r.wsize=1<=r.wsize?(u.arraySet(r.window,e,a-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):((n=r.wsize-r.wnext)>i&&(n=i),u.arraySet(r.window,e,a-i,n,r.wnext),(i-=n)?(u.arraySet(r.window,e,a-i,i,0),r.wnext=i,r.whave=r.wsize):(r.wnext+=n,r.wnext===r.wsize&&(r.wnext=0),r.whave>>8&255,a.check=b(a.check,Et,2,0),_=0,dt=0,a.mode=O;break}if(a.flags=0,a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&_)<<8)+(_>>8))%31){t.msg="incorrect header check",a.mode=ot;break}if((15&_)!==C){t.msg="unknown compression method",a.mode=ot;break}if(_>>>=4,dt-=4,yt=8+(15&_),0===a.wbits)a.wbits=yt;else if(yt>a.wbits){t.msg="invalid window size",a.mode=ot;break}a.dmax=1<>8&1),512&a.flags&&(Et[0]=255&_,Et[1]=_>>>8&255,a.check=b(a.check,Et,2,0)),_=0,dt=0,a.mode=D;case D:for(;dt<32;){if(0===l)break t;l--,_+=n[s++]<>>8&255,Et[2]=_>>>16&255,Et[3]=_>>>24&255,a.check=b(a.check,Et,4,0)),_=0,dt=0,a.mode=I;case I:for(;dt<16;){if(0===l)break t;l--,_+=n[s++]<>8),512&a.flags&&(Et[0]=255&_,Et[1]=_>>>8&255,a.check=b(a.check,Et,2,0)),_=0,dt=0,a.mode=U;case U:if(1024&a.flags){for(;dt<16;){if(0===l)break t;l--,_+=n[s++]<>>8&255,a.check=b(a.check,Et,2,0)),_=0,dt=0}else a.head&&(a.head.extra=null);a.mode=T;case T:if(1024&a.flags&&((ut=a.length)>l&&(ut=l),ut&&(a.head&&(yt=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Array(a.head.extra_len)),u.arraySet(a.head.extra,n,s,ut,yt)),512&a.flags&&(a.check=b(a.check,n,ut,s)),l-=ut,s+=ut,a.length-=ut),a.length))break t;a.length=0,a.mode=F;case F:if(2048&a.flags){if(0===l)break t;ut=0;do{yt=n[s+ut++],a.head&&yt&&a.length<65536&&(a.head.name+=String.fromCharCode(yt))}while(yt&&ut>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=M;break;case j:for(;dt<32;){if(0===l)break t;l--,_+=n[s++]<>>=7&dt,dt-=7&dt,a.mode=nt;break}for(;dt<3;){if(0===l)break t;l--,_+=n[s++]<>>=1,dt-=1,3&_){case 0:a.mode=Y;break;case 1:if(h(a),a.mode=Q,e===x){_>>>=2,dt-=2;break t}break;case 2:a.mode=X;break;case 3:t.msg="invalid block type",a.mode=ot}_>>>=2,dt-=2;break;case Y:for(_>>>=7&dt,dt-=7&dt;dt<32;){if(0===l)break t;l--,_+=n[s++]<>>16^65535)){t.msg="invalid stored block lengths",a.mode=ot;break}if(a.length=65535&_,_=0,dt=0,a.mode=q,e===x)break t;case q:a.mode=G;case G:if(ut=a.length){if(ut>l&&(ut=l),ut>f&&(ut=f),0===ut)break t;u.arraySet(r,n,s,ut,o),l-=ut,s+=ut,f-=ut,o+=ut,a.length-=ut;break}a.mode=M;break;case X:for(;dt<14;){if(0===l)break t;l--,_+=n[s++]<>>=5,dt-=5,a.ndist=1+(31&_),_>>>=5,dt-=5,a.ncode=4+(15&_),_>>>=4,dt-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=ot;break}a.have=0,a.mode=W;case W:for(;a.have>>=3,dt-=3}for(;a.have<19;)a.lens[At[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,zt={bits:a.lenbits},xt=m(w,a.lens,0,19,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid code lengths set",a.mode=ot;break}a.have=0,a.mode=J;case J:for(;a.have>>24,mt=St>>>16&255,wt=65535&St,!(gt<=dt);){if(0===l)break t;l--,_+=n[s++]<>>=gt,dt-=gt,a.lens[a.have++]=wt;else{if(16===wt){for(Bt=gt+2;dt>>=gt,dt-=gt,0===a.have){t.msg="invalid bit length repeat",a.mode=ot;break}yt=a.lens[a.have-1],ut=3+(3&_),_>>>=2,dt-=2}else if(17===wt){for(Bt=gt+3;dt>>=gt)),_>>>=3,dt-=3}else{for(Bt=gt+7;dt>>=gt)),_>>>=7,dt-=7}if(a.have+ut>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=ot;break}for(;ut--;)a.lens[a.have++]=yt}}if(a.mode===ot)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=ot;break}if(a.lenbits=9,zt={bits:a.lenbits},xt=m(p,a.lens,0,a.nlen,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid literal/lengths set",a.mode=ot;break}if(a.distbits=6,a.distcode=a.distdyn,zt={bits:a.distbits},xt=m(v,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,zt),a.distbits=zt.bits,xt){t.msg="invalid distances set",a.mode=ot;break}if(a.mode=Q,e===x)break t;case Q:a.mode=V;case V:if(l>=6&&f>=258){t.next_out=o,t.avail_out=f,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=dt,g(t,_t),o=t.next_out,r=t.output,f=t.avail_out,s=t.next_in,n=t.input,l=t.avail_in,_=a.hold,dt=a.bits,a.mode===M&&(a.back=-1);break}for(a.back=0;St=a.lencode[_&(1<>>24,mt=St>>>16&255,wt=65535&St,!(gt<=dt);){if(0===l)break t;l--,_+=n[s++]<>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=dt);){if(0===l)break t;l--,_+=n[s++]<>>=pt,dt-=pt,a.back+=pt}if(_>>>=gt,dt-=gt,a.back+=gt,a.length=wt,0===mt){a.mode=it;break}if(32&mt){a.back=-1,a.mode=M;break}if(64&mt){t.msg="invalid literal/length code",a.mode=ot;break}a.extra=15&mt,a.mode=$;case $:if(a.extra){for(Bt=a.extra;dt>>=a.extra,dt-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=tt;case tt:for(;St=a.distcode[_&(1<>>24,mt=St>>>16&255,wt=65535&St,!(gt<=dt);){if(0===l)break t;l--,_+=n[s++]<>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=dt);){if(0===l)break t;l--,_+=n[s++]<>>=pt,dt-=pt,a.back+=pt}if(_>>>=gt,dt-=gt,a.back+=gt,64&mt){t.msg="invalid distance code",a.mode=ot;break}a.offset=wt,a.extra=15&mt,a.mode=et;case et:if(a.extra){for(Bt=a.extra;dt>>=a.extra,dt-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=ot;break}a.mode=at;case at:if(0===f)break t;if(ut=_t-f,a.offset>ut){if((ut=a.offset-ut)>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=ot;break}ut>a.wnext?(ut-=a.wnext,ct=a.wsize-ut):ct=a.wnext-ut,ut>a.length&&(ut=a.length),bt=a.window}else bt=r,ct=o-a.offset,ut=a.length;ut>f&&(ut=f),f-=ut,a.length-=ut;do{r[o++]=bt[ct++]}while(--ut);0===a.length&&(a.mode=V);break;case it:if(0===f)break t;r[o++]=a.length,f--,a.mode=V;break;case nt:if(a.wrap){for(;dt<32;){if(0===l)break t;l--,_|=n[s++]<=1&&0===I[S];S--);if(E>S&&(E=S),0===S)return h[d++]=20971520,h[d++]=20971520,_.bits=1,0;for(B=1;B0&&(0===t||1!==S))return-1;for(U[1]=0,x=1;x<15;x++)U[x+1]=U[x]+I[x];for(z=0;z852||2===t&&C>592)return 1;for(;;){p=x-Z,f[z]w?(v=T[F+f[z]],k=O[D+f[z]]):(v=96,k=0),u=1<>Z)+(c-=u)]=p<<24|v<<16|k|0}while(0!==c);for(u=1<>=1;if(0!==u?(N&=u-1,N+=u):N=0,z++,0==--I[x]){if(x===S)break;x=e[a+f[z]]}if(x>E&&(N&g)!==b){for(0===Z&&(Z=E),m+=B,R=1<<(A=x-Z);A+Z852||2===t&&C>592)return 1;h[b=N&g]=E<<24|A<<16|m-d|0}}return 0!==N&&(h[m+N]=x-Z<<24|64<<16|0),_.bits=E,0}},{"../utils/common":3}],13:[function(t,e,a){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],14:[function(t,e,a){"use strict";function i(t){for(var e=t.length;--e>=0;)t[e]=0}function n(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function r(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function s(t){return t<256?et[t]:et[256+(t>>>7)]}function o(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function l(t,e,a){t.bi_valid>M-a?(t.bi_buf|=e<>M-t.bi_valid,t.bi_valid+=a-M):(t.bi_buf|=e<>>=1,a<<=1}while(--e>0);return a>>>1}function f(t){16===t.bi_valid?(o(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function _(t,e){var a,i,n,r,s,o,l=e.dyn_tree,h=e.max_code,d=e.stat_desc.static_tree,f=e.stat_desc.has_stree,_=e.stat_desc.extra_bits,u=e.stat_desc.extra_base,c=e.stat_desc.max_length,b=0;for(r=0;r<=K;r++)t.bl_count[r]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;ac&&(r=c,b++),l[2*i+1]=r,i>h||(t.bl_count[r]++,s=0,i>=u&&(s=_[i-u]),o=l[2*i],t.opt_len+=o*(r+s),f&&(t.static_len+=o*(d[2*i+1]+s)));if(0!==b){do{for(r=c-1;0===t.bl_count[r];)r--;t.bl_count[r]--,t.bl_count[r+1]+=2,t.bl_count[c]--,b-=2}while(b>0);for(r=c;0!==r;r--)for(i=t.bl_count[r];0!==i;)(n=t.heap[--a])>h||(l[2*n+1]!==r&&(t.opt_len+=(r-l[2*n+1])*l[2*n],l[2*n+1]=r),i--)}}function u(t,e,a){var i,n,r=new Array(K+1),s=0;for(i=1;i<=K;i++)r[i]=s=s+a[i-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=d(r[o]++,o))}}function c(){var t,e,a,i,r,s=new Array(K+1);for(a=0,i=0;i>=7;i8?o(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function m(t,e,a,i){g(t),i&&(o(t,a),o(t,~a)),A.arraySet(t.pending_buf,t.window,e,a,t.pending),t.pending+=a}function w(t,e,a,i){var n=2*e,r=2*a;return t[n]>1;a>=1;a--)p(t,r,a);n=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],p(t,r,1),i=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=i,r[2*n]=r[2*a]+r[2*i],t.depth[n]=(t.depth[a]>=t.depth[i]?t.depth[a]:t.depth[i])+1,r[2*a+1]=r[2*i+1]=n,t.heap[1]=n++,p(t,r,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],_(t,e),u(r,h,t.bl_count)}function y(t,e,a){var i,n,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=s,s=e[2*(i+1)+1],++o=3&&0===t.bl_tree[2*V[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function B(t,e,a,i){var n;for(l(t,e-257,5),l(t,a-1,5),l(t,i-4,4),n=0;n>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return R;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return C;for(e=32;e0?(t.strm.data_type===N&&(t.strm.data_type=S(t)),k(t,t.l_desc),k(t,t.d_desc),s=z(t),n=t.opt_len+3+7>>>3,(r=t.static_len+3+7>>>3)<=n&&(n=r)):n=r=a+5,a+4<=n&&-1!==e?E(t,e,a,i):t.strategy===Z||r===n?(l(t,(D<<1)+(i?1:0),3),v(t,$,tt)):(l(t,(I<<1)+(i?1:0),3),B(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),v(t,t.dyn_ltree,t.dyn_dtree)),b(t),i&&g(t)},a._tr_tally=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(at[a]+T+1)]++,t.dyn_dtree[2*s(e)]++),t.last_lit===t.lit_bufsize-1},a._tr_align=function(t){l(t,D<<1,3),h(t,Y,$),f(t)}},{"../utils/common":3}],15:[function(t,e,a){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/":[function(t,e,a){"use strict";var i={};(0,t("./lib/utils/common").assign)(i,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=i},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/")}); diff --git a/node_modules/pako/dist/pako_deflate.js b/node_modules/pako/dist/pako_deflate.js new file mode 100644 index 000000000..6998a82c3 --- /dev/null +++ b/node_modules/pako/dist/pako_deflate.js @@ -0,0 +1,3993 @@ +/* pako 1.0.6 nodeca/pako */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.pako = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1); +} +_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start + + +// convert string to array (typed, when possible) +exports.string2buf = function (str) { + var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; + + // count binary size + for (m_pos = 0; m_pos < str_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4; + } + + // allocate buffer + buf = new utils.Buf8(buf_len); + + // convert + for (i = 0, m_pos = 0; i < buf_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + if (c < 0x80) { + /* one byte */ + buf[i++] = c; + } else if (c < 0x800) { + /* two bytes */ + buf[i++] = 0xC0 | (c >>> 6); + buf[i++] = 0x80 | (c & 0x3f); + } else if (c < 0x10000) { + /* three bytes */ + buf[i++] = 0xE0 | (c >>> 12); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } else { + /* four bytes */ + buf[i++] = 0xf0 | (c >>> 18); + buf[i++] = 0x80 | (c >>> 12 & 0x3f); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } + } + + return buf; +}; + +// Helper (used in 2 places) +function buf2binstring(buf, len) { + // use fallback for big arrays to avoid stack overflow + if (len < 65537) { + if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) { + return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len)); + } + } + + var result = ''; + for (var i = 0; i < len; i++) { + result += String.fromCharCode(buf[i]); + } + return result; +} + + +// Convert byte array to binary string +exports.buf2binstring = function (buf) { + return buf2binstring(buf, buf.length); +}; + + +// Convert binary string (typed, when possible) +exports.binstring2buf = function (str) { + var buf = new utils.Buf8(str.length); + for (var i = 0, len = buf.length; i < len; i++) { + buf[i] = str.charCodeAt(i); + } + return buf; +}; + + +// convert array to string +exports.buf2string = function (buf, max) { + var i, out, c, c_len; + var len = max || buf.length; + + // Reserve max possible length (2 words per char) + // NB: by unknown reasons, Array is significantly faster for + // String.fromCharCode.apply than Uint16Array. + var utf16buf = new Array(len * 2); + + for (out = 0, i = 0; i < len;) { + c = buf[i++]; + // quick process ascii + if (c < 0x80) { utf16buf[out++] = c; continue; } + + c_len = _utf8len[c]; + // skip 5 & 6 byte codes + if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; } + + // apply mask on first byte + c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07; + // join the rest + while (c_len > 1 && i < len) { + c = (c << 6) | (buf[i++] & 0x3f); + c_len--; + } + + // terminated by end of string? + if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; } + + if (c < 0x10000) { + utf16buf[out++] = c; + } else { + c -= 0x10000; + utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff); + utf16buf[out++] = 0xdc00 | (c & 0x3ff); + } + } + + return buf2binstring(utf16buf, out); +}; + + +// Calculate max possible position in utf8 buffer, +// that will not break sequence. If that's not possible +// - (very small limits) return max size as is. +// +// buf[] - utf8 bytes array +// max - length limit (mandatory); +exports.utf8border = function (buf, max) { + var pos; + + max = max || buf.length; + if (max > buf.length) { max = buf.length; } + + // go back from last position, until start of sequence found + pos = max - 1; + while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; } + + // Very small and broken sequence, + // return max, because we should return something anyway. + if (pos < 0) { return max; } + + // If we came to start of buffer - that means buffer is too small, + // return max too. + if (pos === 0) { return max; } + + return (pos + _utf8len[buf[pos]] > max) ? pos : max; +}; + +},{"./common":1}],3:[function(require,module,exports){ +'use strict'; + +// Note: adler32 takes 12% for level 0 and 2% for level 6. +// It isn't worth it to make additional optimizations as in original. +// Small size is preferable. + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +function adler32(adler, buf, len, pos) { + var s1 = (adler & 0xffff) |0, + s2 = ((adler >>> 16) & 0xffff) |0, + n = 0; + + while (len !== 0) { + // Set limit ~ twice less than 5552, to keep + // s2 in 31-bits, because we force signed ints. + // in other case %= will fail. + n = len > 2000 ? 2000 : len; + len -= n; + + do { + s1 = (s1 + buf[pos++]) |0; + s2 = (s2 + s1) |0; + } while (--n); + + s1 %= 65521; + s2 %= 65521; + } + + return (s1 | (s2 << 16)) |0; +} + + +module.exports = adler32; + +},{}],4:[function(require,module,exports){ +'use strict'; + +// Note: we can't get significant speed boost here. +// So write code to minimize size - no pregenerated tables +// and array tools dependencies. + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +// Use ordinary array, since untyped makes no boost here +function makeTable() { + var c, table = []; + + for (var n = 0; n < 256; n++) { + c = n; + for (var k = 0; k < 8; k++) { + c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); + } + table[n] = c; + } + + return table; +} + +// Create table on load. Just 255 signed longs. Not a problem. +var crcTable = makeTable(); + + +function crc32(crc, buf, len, pos) { + var t = crcTable, + end = pos + len; + + crc ^= -1; + + for (var i = pos; i < end; i++) { + crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF]; + } + + return (crc ^ (-1)); // >>> 0; +} + + +module.exports = crc32; + +},{}],5:[function(require,module,exports){ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +var utils = require('../utils/common'); +var trees = require('./trees'); +var adler32 = require('./adler32'); +var crc32 = require('./crc32'); +var msg = require('./messages'); + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + + +/* Allowed flush values; see deflate() and inflate() below for details */ +var Z_NO_FLUSH = 0; +var Z_PARTIAL_FLUSH = 1; +//var Z_SYNC_FLUSH = 2; +var Z_FULL_FLUSH = 3; +var Z_FINISH = 4; +var Z_BLOCK = 5; +//var Z_TREES = 6; + + +/* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ +var Z_OK = 0; +var Z_STREAM_END = 1; +//var Z_NEED_DICT = 2; +//var Z_ERRNO = -1; +var Z_STREAM_ERROR = -2; +var Z_DATA_ERROR = -3; +//var Z_MEM_ERROR = -4; +var Z_BUF_ERROR = -5; +//var Z_VERSION_ERROR = -6; + + +/* compression levels */ +//var Z_NO_COMPRESSION = 0; +//var Z_BEST_SPEED = 1; +//var Z_BEST_COMPRESSION = 9; +var Z_DEFAULT_COMPRESSION = -1; + + +var Z_FILTERED = 1; +var Z_HUFFMAN_ONLY = 2; +var Z_RLE = 3; +var Z_FIXED = 4; +var Z_DEFAULT_STRATEGY = 0; + +/* Possible values of the data_type field (though see inflate()) */ +//var Z_BINARY = 0; +//var Z_TEXT = 1; +//var Z_ASCII = 1; // = Z_TEXT +var Z_UNKNOWN = 2; + + +/* The deflate compression method */ +var Z_DEFLATED = 8; + +/*============================================================================*/ + + +var MAX_MEM_LEVEL = 9; +/* Maximum value for memLevel in deflateInit2 */ +var MAX_WBITS = 15; +/* 32K LZ77 window */ +var DEF_MEM_LEVEL = 8; + + +var LENGTH_CODES = 29; +/* number of length codes, not counting the special END_BLOCK code */ +var LITERALS = 256; +/* number of literal bytes 0..255 */ +var L_CODES = LITERALS + 1 + LENGTH_CODES; +/* number of Literal or Length codes, including the END_BLOCK code */ +var D_CODES = 30; +/* number of distance codes */ +var BL_CODES = 19; +/* number of codes used to transfer the bit lengths */ +var HEAP_SIZE = 2 * L_CODES + 1; +/* maximum heap size */ +var MAX_BITS = 15; +/* All codes must not exceed MAX_BITS bits */ + +var MIN_MATCH = 3; +var MAX_MATCH = 258; +var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1); + +var PRESET_DICT = 0x20; + +var INIT_STATE = 42; +var EXTRA_STATE = 69; +var NAME_STATE = 73; +var COMMENT_STATE = 91; +var HCRC_STATE = 103; +var BUSY_STATE = 113; +var FINISH_STATE = 666; + +var BS_NEED_MORE = 1; /* block not completed, need more input or more output */ +var BS_BLOCK_DONE = 2; /* block flush performed */ +var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */ +var BS_FINISH_DONE = 4; /* finish done, accept no more input or output */ + +var OS_CODE = 0x03; // Unix :) . Don't detect, use this default. + +function err(strm, errorCode) { + strm.msg = msg[errorCode]; + return errorCode; +} + +function rank(f) { + return ((f) << 1) - ((f) > 4 ? 9 : 0); +} + +function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } + + +/* ========================================================================= + * Flush as much pending output as possible. All deflate() output goes + * through this function so some applications may wish to modify it + * to avoid allocating a large strm->output buffer and copying into it. + * (See also read_buf()). + */ +function flush_pending(strm) { + var s = strm.state; + + //_tr_flush_bits(s); + var len = s.pending; + if (len > strm.avail_out) { + len = strm.avail_out; + } + if (len === 0) { return; } + + utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out); + strm.next_out += len; + s.pending_out += len; + strm.total_out += len; + strm.avail_out -= len; + s.pending -= len; + if (s.pending === 0) { + s.pending_out = 0; + } +} + + +function flush_block_only(s, last) { + trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last); + s.block_start = s.strstart; + flush_pending(s.strm); +} + + +function put_byte(s, b) { + s.pending_buf[s.pending++] = b; +} + + +/* ========================================================================= + * Put a short in the pending buffer. The 16-bit value is put in MSB order. + * IN assertion: the stream state is correct and there is enough room in + * pending_buf. + */ +function putShortMSB(s, b) { +// put_byte(s, (Byte)(b >> 8)); +// put_byte(s, (Byte)(b & 0xff)); + s.pending_buf[s.pending++] = (b >>> 8) & 0xff; + s.pending_buf[s.pending++] = b & 0xff; +} + + +/* =========================================================================== + * Read a new buffer from the current input stream, update the adler32 + * and total number of bytes read. All deflate() input goes through + * this function so some applications may wish to modify it to avoid + * allocating a large strm->input buffer and copying from it. + * (See also flush_pending()). + */ +function read_buf(strm, buf, start, size) { + var len = strm.avail_in; + + if (len > size) { len = size; } + if (len === 0) { return 0; } + + strm.avail_in -= len; + + // zmemcpy(buf, strm->next_in, len); + utils.arraySet(buf, strm.input, strm.next_in, len, start); + if (strm.state.wrap === 1) { + strm.adler = adler32(strm.adler, buf, len, start); + } + + else if (strm.state.wrap === 2) { + strm.adler = crc32(strm.adler, buf, len, start); + } + + strm.next_in += len; + strm.total_in += len; + + return len; +} + + +/* =========================================================================== + * Set match_start to the longest match starting at the given string and + * return its length. Matches shorter or equal to prev_length are discarded, + * in which case the result is equal to prev_length and match_start is + * garbage. + * IN assertions: cur_match is the head of the hash chain for the current + * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 + * OUT assertion: the match length is not greater than s->lookahead. + */ +function longest_match(s, cur_match) { + var chain_length = s.max_chain_length; /* max hash chain length */ + var scan = s.strstart; /* current string */ + var match; /* matched string */ + var len; /* length of current match */ + var best_len = s.prev_length; /* best match length so far */ + var nice_match = s.nice_match; /* stop if match long enough */ + var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ? + s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/; + + var _win = s.window; // shortcut + + var wmask = s.w_mask; + var prev = s.prev; + + /* Stop when cur_match becomes <= limit. To simplify the code, + * we prevent matches with the string of window index 0. + */ + + var strend = s.strstart + MAX_MATCH; + var scan_end1 = _win[scan + best_len - 1]; + var scan_end = _win[scan + best_len]; + + /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. + * It is easy to get rid of this optimization if necessary. + */ + // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); + + /* Do not waste too much time if we already have a good match: */ + if (s.prev_length >= s.good_match) { + chain_length >>= 2; + } + /* Do not look for matches beyond the end of the input. This is necessary + * to make deflate deterministic. + */ + if (nice_match > s.lookahead) { nice_match = s.lookahead; } + + // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + + do { + // Assert(cur_match < s->strstart, "no future"); + match = cur_match; + + /* Skip to next match if the match length cannot increase + * or if the match length is less than 2. Note that the checks below + * for insufficient lookahead only occur occasionally for performance + * reasons. Therefore uninitialized memory will be accessed, and + * conditional jumps will be made that depend on those values. + * However the length of the match is limited to the lookahead, so + * the output of deflate is not affected by the uninitialized values. + */ + + if (_win[match + best_len] !== scan_end || + _win[match + best_len - 1] !== scan_end1 || + _win[match] !== _win[scan] || + _win[++match] !== _win[scan + 1]) { + continue; + } + + /* The check at best_len-1 can be removed because it will be made + * again later. (This heuristic is not always a win.) + * It is not necessary to compare scan[2] and match[2] since they + * are always equal when the other bytes match, given that + * the hash keys are equal and that HASH_BITS >= 8. + */ + scan += 2; + match++; + // Assert(*scan == *match, "match[2]?"); + + /* We check for insufficient lookahead only every 8th comparison; + * the 256th check will be made at strstart+258. + */ + do { + /*jshint noempty:false*/ + } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + scan < strend); + + // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + + len = MAX_MATCH - (strend - scan); + scan = strend - MAX_MATCH; + + if (len > best_len) { + s.match_start = cur_match; + best_len = len; + if (len >= nice_match) { + break; + } + scan_end1 = _win[scan + best_len - 1]; + scan_end = _win[scan + best_len]; + } + } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0); + + if (best_len <= s.lookahead) { + return best_len; + } + return s.lookahead; +} + + +/* =========================================================================== + * Fill the window when the lookahead becomes insufficient. + * Updates strstart and lookahead. + * + * IN assertion: lookahead < MIN_LOOKAHEAD + * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD + * At least one byte has been read, or avail_in == 0; reads are + * performed for at least two bytes (required for the zip translate_eol + * option -- not supported here). + */ +function fill_window(s) { + var _w_size = s.w_size; + var p, n, m, more, str; + + //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); + + do { + more = s.window_size - s.lookahead - s.strstart; + + // JS ints have 32 bit, block below not needed + /* Deal with !@#$% 64K limit: */ + //if (sizeof(int) <= 2) { + // if (more == 0 && s->strstart == 0 && s->lookahead == 0) { + // more = wsize; + // + // } else if (more == (unsigned)(-1)) { + // /* Very unlikely, but possible on 16 bit machine if + // * strstart == 0 && lookahead == 1 (input done a byte at time) + // */ + // more--; + // } + //} + + + /* If the window is almost full and there is insufficient lookahead, + * move the upper half to the lower one to make room in the upper half. + */ + if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) { + + utils.arraySet(s.window, s.window, _w_size, _w_size, 0); + s.match_start -= _w_size; + s.strstart -= _w_size; + /* we now have strstart >= MAX_DIST */ + s.block_start -= _w_size; + + /* Slide the hash table (could be avoided with 32 bit values + at the expense of memory usage). We slide even when level == 0 + to keep the hash table consistent if we switch back to level > 0 + later. (Using level 0 permanently is not an optimal usage of + zlib, so we don't care about this pathological case.) + */ + + n = s.hash_size; + p = n; + do { + m = s.head[--p]; + s.head[p] = (m >= _w_size ? m - _w_size : 0); + } while (--n); + + n = _w_size; + p = n; + do { + m = s.prev[--p]; + s.prev[p] = (m >= _w_size ? m - _w_size : 0); + /* If n is not on any hash chain, prev[n] is garbage but + * its value will never be used. + */ + } while (--n); + + more += _w_size; + } + if (s.strm.avail_in === 0) { + break; + } + + /* If there was no sliding: + * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && + * more == window_size - lookahead - strstart + * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) + * => more >= window_size - 2*WSIZE + 2 + * In the BIG_MEM or MMAP case (not yet supported), + * window_size == input_size + MIN_LOOKAHEAD && + * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. + * Otherwise, window_size == 2*WSIZE so more >= 2. + * If there was sliding, more >= WSIZE. So in all cases, more >= 2. + */ + //Assert(more >= 2, "more < 2"); + n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more); + s.lookahead += n; + + /* Initialize the hash value now that we have some input: */ + if (s.lookahead + s.insert >= MIN_MATCH) { + str = s.strstart - s.insert; + s.ins_h = s.window[str]; + + /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask; +//#if MIN_MATCH != 3 +// Call update_hash() MIN_MATCH-3 more times +//#endif + while (s.insert) { + /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; + + s.prev[str & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = str; + str++; + s.insert--; + if (s.lookahead + s.insert < MIN_MATCH) { + break; + } + } + } + /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, + * but this is not important since only literal bytes will be emitted. + */ + + } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0); + + /* If the WIN_INIT bytes after the end of the current data have never been + * written, then zero those bytes in order to avoid memory check reports of + * the use of uninitialized (or uninitialised as Julian writes) bytes by + * the longest match routines. Update the high water mark for the next + * time through here. WIN_INIT is set to MAX_MATCH since the longest match + * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. + */ +// if (s.high_water < s.window_size) { +// var curr = s.strstart + s.lookahead; +// var init = 0; +// +// if (s.high_water < curr) { +// /* Previous high water mark below current data -- zero WIN_INIT +// * bytes or up to end of window, whichever is less. +// */ +// init = s.window_size - curr; +// if (init > WIN_INIT) +// init = WIN_INIT; +// zmemzero(s->window + curr, (unsigned)init); +// s->high_water = curr + init; +// } +// else if (s->high_water < (ulg)curr + WIN_INIT) { +// /* High water mark at or above current data, but below current data +// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up +// * to end of window, whichever is less. +// */ +// init = (ulg)curr + WIN_INIT - s->high_water; +// if (init > s->window_size - s->high_water) +// init = s->window_size - s->high_water; +// zmemzero(s->window + s->high_water, (unsigned)init); +// s->high_water += init; +// } +// } +// +// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, +// "not enough room for search"); +} + +/* =========================================================================== + * Copy without compression as much as possible from the input stream, return + * the current block state. + * This function does not insert new strings in the dictionary since + * uncompressible data is probably not useful. This function is used + * only for the level=0 compression option. + * NOTE: this function should be optimized to avoid extra copying from + * window to pending_buf. + */ +function deflate_stored(s, flush) { + /* Stored blocks are limited to 0xffff bytes, pending_buf is limited + * to pending_buf_size, and each stored block has a 5 byte header: + */ + var max_block_size = 0xffff; + + if (max_block_size > s.pending_buf_size - 5) { + max_block_size = s.pending_buf_size - 5; + } + + /* Copy as much as possible from input to output: */ + for (;;) { + /* Fill the window as much as possible: */ + if (s.lookahead <= 1) { + + //Assert(s->strstart < s->w_size+MAX_DIST(s) || + // s->block_start >= (long)s->w_size, "slide too late"); +// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) || +// s.block_start >= s.w_size)) { +// throw new Error("slide too late"); +// } + + fill_window(s); + if (s.lookahead === 0 && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + + if (s.lookahead === 0) { + break; + } + /* flush the current block */ + } + //Assert(s->block_start >= 0L, "block gone"); +// if (s.block_start < 0) throw new Error("block gone"); + + s.strstart += s.lookahead; + s.lookahead = 0; + + /* Emit a stored block if pending_buf will be full: */ + var max_start = s.block_start + max_block_size; + + if (s.strstart === 0 || s.strstart >= max_start) { + /* strstart == 0 is possible when wraparound on 16-bit machine */ + s.lookahead = s.strstart - max_start; + s.strstart = max_start; + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + + + } + /* Flush if we may have to slide, otherwise block_start may become + * negative and the data will be gone: + */ + if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + + s.insert = 0; + + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + + if (s.strstart > s.block_start) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + + return BS_NEED_MORE; +} + +/* =========================================================================== + * Compress as much as possible from the input stream, return the current + * block state. + * This function does not perform lazy evaluation of matches and inserts + * new strings in the dictionary only for unmatched strings or for short + * matches. It is used only for the fast compression options. + */ +function deflate_fast(s, flush) { + var hash_head; /* head of the hash chain */ + var bflush; /* set if current block must be flushed */ + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s.lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { + break; /* flush the current block */ + } + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + hash_head = 0/*NIL*/; + if (s.lookahead >= MIN_MATCH) { + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + } + + /* Find the longest match, discarding those <= prev_length. + * At this point we have always match_length < MIN_MATCH + */ + if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + s.match_length = longest_match(s, hash_head); + /* longest_match() sets match_start */ + } + if (s.match_length >= MIN_MATCH) { + // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only + + /*** _tr_tally_dist(s, s.strstart - s.match_start, + s.match_length - MIN_MATCH, bflush); ***/ + bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); + + s.lookahead -= s.match_length; + + /* Insert new strings in the hash table only if the match length + * is not too large. This saves time but degrades compression. + */ + if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) { + s.match_length--; /* string at strstart already in table */ + do { + s.strstart++; + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + /* strstart never exceeds WSIZE-MAX_MATCH, so there are + * always MIN_MATCH bytes ahead. + */ + } while (--s.match_length !== 0); + s.strstart++; + } else + { + s.strstart += s.match_length; + s.match_length = 0; + s.ins_h = s.window[s.strstart]; + /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask; + +//#if MIN_MATCH != 3 +// Call UPDATE_HASH() MIN_MATCH-3 more times +//#endif + /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not + * matter since it will be recomputed at next deflate call. + */ + } + } else { + /* No match, output a literal byte */ + //Tracevv((stderr,"%c", s.window[s.strstart])); + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + + s.lookahead--; + s.strstart++; + } + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1); + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + return BS_BLOCK_DONE; +} + +/* =========================================================================== + * Same as above, but achieves better compression. We use a lazy + * evaluation for matches: a match is finally adopted only if there is + * no better match at the next window position. + */ +function deflate_slow(s, flush) { + var hash_head; /* head of hash chain */ + var bflush; /* set if current block must be flushed */ + + var max_insert; + + /* Process the input block. */ + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s.lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { break; } /* flush the current block */ + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + hash_head = 0/*NIL*/; + if (s.lookahead >= MIN_MATCH) { + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + } + + /* Find the longest match, discarding those <= prev_length. + */ + s.prev_length = s.match_length; + s.prev_match = s.match_start; + s.match_length = MIN_MATCH - 1; + + if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match && + s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + s.match_length = longest_match(s, hash_head); + /* longest_match() sets match_start */ + + if (s.match_length <= 5 && + (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { + + /* If prev_match is also MIN_MATCH, match_start is garbage + * but we will ignore the current match anyway. + */ + s.match_length = MIN_MATCH - 1; + } + } + /* If there was a match at the previous step and the current + * match is not better, output the previous match: + */ + if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { + max_insert = s.strstart + s.lookahead - MIN_MATCH; + /* Do not insert strings in hash table beyond this. */ + + //check_match(s, s.strstart-1, s.prev_match, s.prev_length); + + /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match, + s.prev_length - MIN_MATCH, bflush);***/ + bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH); + /* Insert in hash table all strings up to the end of the match. + * strstart-1 and strstart are already inserted. If there is not + * enough lookahead, the last two strings are not inserted in + * the hash table. + */ + s.lookahead -= s.prev_length - 1; + s.prev_length -= 2; + do { + if (++s.strstart <= max_insert) { + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + } + } while (--s.prev_length !== 0); + s.match_available = 0; + s.match_length = MIN_MATCH - 1; + s.strstart++; + + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + + } else if (s.match_available) { + /* If there was no match at the previous position, output a + * single literal. If there was a match but the current match + * is longer, truncate the previous match to a single literal. + */ + //Tracevv((stderr,"%c", s->window[s->strstart-1])); + /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); + + if (bflush) { + /*** FLUSH_BLOCK_ONLY(s, 0) ***/ + flush_block_only(s, false); + /***/ + } + s.strstart++; + s.lookahead--; + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } else { + /* There is no previous match to compare with, wait for + * the next step to decide. + */ + s.match_available = 1; + s.strstart++; + s.lookahead--; + } + } + //Assert (flush != Z_NO_FLUSH, "no flush?"); + if (s.match_available) { + //Tracevv((stderr,"%c", s->window[s->strstart-1])); + /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); + + s.match_available = 0; + } + s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + + return BS_BLOCK_DONE; +} + + +/* =========================================================================== + * For Z_RLE, simply look for runs of bytes, generate matches only of distance + * one. Do not maintain a hash table. (It will be regenerated if this run of + * deflate switches away from Z_RLE.) + */ +function deflate_rle(s, flush) { + var bflush; /* set if current block must be flushed */ + var prev; /* byte at distance one to match */ + var scan, strend; /* scan goes up to strend for length of run */ + + var _win = s.window; + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the longest run, plus one for the unrolled loop. + */ + if (s.lookahead <= MAX_MATCH) { + fill_window(s); + if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { break; } /* flush the current block */ + } + + /* See how many times the previous byte repeats */ + s.match_length = 0; + if (s.lookahead >= MIN_MATCH && s.strstart > 0) { + scan = s.strstart - 1; + prev = _win[scan]; + if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { + strend = s.strstart + MAX_MATCH; + do { + /*jshint noempty:false*/ + } while (prev === _win[++scan] && prev === _win[++scan] && + prev === _win[++scan] && prev === _win[++scan] && + prev === _win[++scan] && prev === _win[++scan] && + prev === _win[++scan] && prev === _win[++scan] && + scan < strend); + s.match_length = MAX_MATCH - (strend - scan); + if (s.match_length > s.lookahead) { + s.match_length = s.lookahead; + } + } + //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); + } + + /* Emit match if have run of MIN_MATCH or longer, else emit literal */ + if (s.match_length >= MIN_MATCH) { + //check_match(s, s.strstart, s.strstart - 1, s.match_length); + + /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/ + bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH); + + s.lookahead -= s.match_length; + s.strstart += s.match_length; + s.match_length = 0; + } else { + /* No match, output a literal byte */ + //Tracevv((stderr,"%c", s->window[s->strstart])); + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + + s.lookahead--; + s.strstart++; + } + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + s.insert = 0; + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + return BS_BLOCK_DONE; +} + +/* =========================================================================== + * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. + * (It will be regenerated if this run of deflate switches away from Huffman.) + */ +function deflate_huff(s, flush) { + var bflush; /* set if current block must be flushed */ + + for (;;) { + /* Make sure that we have a literal to write. */ + if (s.lookahead === 0) { + fill_window(s); + if (s.lookahead === 0) { + if (flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + break; /* flush the current block */ + } + } + + /* Output a literal byte */ + s.match_length = 0; + //Tracevv((stderr,"%c", s->window[s->strstart])); + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + s.lookahead--; + s.strstart++; + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + s.insert = 0; + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + return BS_BLOCK_DONE; +} + +/* Values for max_lazy_match, good_match and max_chain_length, depending on + * the desired pack level (0..9). The values given below have been tuned to + * exclude worst case performance for pathological files. Better values may be + * found for specific files. + */ +function Config(good_length, max_lazy, nice_length, max_chain, func) { + this.good_length = good_length; + this.max_lazy = max_lazy; + this.nice_length = nice_length; + this.max_chain = max_chain; + this.func = func; +} + +var configuration_table; + +configuration_table = [ + /* good lazy nice chain */ + new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */ + new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */ + new Config(4, 5, 16, 8, deflate_fast), /* 2 */ + new Config(4, 6, 32, 32, deflate_fast), /* 3 */ + + new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */ + new Config(8, 16, 32, 32, deflate_slow), /* 5 */ + new Config(8, 16, 128, 128, deflate_slow), /* 6 */ + new Config(8, 32, 128, 256, deflate_slow), /* 7 */ + new Config(32, 128, 258, 1024, deflate_slow), /* 8 */ + new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */ +]; + + +/* =========================================================================== + * Initialize the "longest match" routines for a new zlib stream + */ +function lm_init(s) { + s.window_size = 2 * s.w_size; + + /*** CLEAR_HASH(s); ***/ + zero(s.head); // Fill with NIL (= 0); + + /* Set the default configuration parameters: + */ + s.max_lazy_match = configuration_table[s.level].max_lazy; + s.good_match = configuration_table[s.level].good_length; + s.nice_match = configuration_table[s.level].nice_length; + s.max_chain_length = configuration_table[s.level].max_chain; + + s.strstart = 0; + s.block_start = 0; + s.lookahead = 0; + s.insert = 0; + s.match_length = s.prev_length = MIN_MATCH - 1; + s.match_available = 0; + s.ins_h = 0; +} + + +function DeflateState() { + this.strm = null; /* pointer back to this zlib stream */ + this.status = 0; /* as the name implies */ + this.pending_buf = null; /* output still pending */ + this.pending_buf_size = 0; /* size of pending_buf */ + this.pending_out = 0; /* next pending byte to output to the stream */ + this.pending = 0; /* nb of bytes in the pending buffer */ + this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ + this.gzhead = null; /* gzip header information to write */ + this.gzindex = 0; /* where in extra, name, or comment */ + this.method = Z_DEFLATED; /* can only be DEFLATED */ + this.last_flush = -1; /* value of flush param for previous deflate call */ + + this.w_size = 0; /* LZ77 window size (32K by default) */ + this.w_bits = 0; /* log2(w_size) (8..16) */ + this.w_mask = 0; /* w_size - 1 */ + + this.window = null; + /* Sliding window. Input bytes are read into the second half of the window, + * and move to the first half later to keep a dictionary of at least wSize + * bytes. With this organization, matches are limited to a distance of + * wSize-MAX_MATCH bytes, but this ensures that IO is always + * performed with a length multiple of the block size. + */ + + this.window_size = 0; + /* Actual size of window: 2*wSize, except when the user input buffer + * is directly used as sliding window. + */ + + this.prev = null; + /* Link to older string with same hash index. To limit the size of this + * array to 64K, this link is maintained only for the last 32K strings. + * An index in this array is thus a window index modulo 32K. + */ + + this.head = null; /* Heads of the hash chains or NIL. */ + + this.ins_h = 0; /* hash index of string to be inserted */ + this.hash_size = 0; /* number of elements in hash table */ + this.hash_bits = 0; /* log2(hash_size) */ + this.hash_mask = 0; /* hash_size-1 */ + + this.hash_shift = 0; + /* Number of bits by which ins_h must be shifted at each input + * step. It must be such that after MIN_MATCH steps, the oldest + * byte no longer takes part in the hash key, that is: + * hash_shift * MIN_MATCH >= hash_bits + */ + + this.block_start = 0; + /* Window position at the beginning of the current output block. Gets + * negative when the window is moved backwards. + */ + + this.match_length = 0; /* length of best match */ + this.prev_match = 0; /* previous match */ + this.match_available = 0; /* set if previous match exists */ + this.strstart = 0; /* start of string to insert */ + this.match_start = 0; /* start of matching string */ + this.lookahead = 0; /* number of valid bytes ahead in window */ + + this.prev_length = 0; + /* Length of the best match at previous step. Matches not greater than this + * are discarded. This is used in the lazy match evaluation. + */ + + this.max_chain_length = 0; + /* To speed up deflation, hash chains are never searched beyond this + * length. A higher limit improves compression ratio but degrades the + * speed. + */ + + this.max_lazy_match = 0; + /* Attempt to find a better match only when the current match is strictly + * smaller than this value. This mechanism is used only for compression + * levels >= 4. + */ + // That's alias to max_lazy_match, don't use directly + //this.max_insert_length = 0; + /* Insert new strings in the hash table only if the match length is not + * greater than this length. This saves time but degrades compression. + * max_insert_length is used only for compression levels <= 3. + */ + + this.level = 0; /* compression level (1..9) */ + this.strategy = 0; /* favor or force Huffman coding*/ + + this.good_match = 0; + /* Use a faster search when the previous match is longer than this */ + + this.nice_match = 0; /* Stop searching when current match exceeds this */ + + /* used by trees.c: */ + + /* Didn't use ct_data typedef below to suppress compiler warning */ + + // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ + // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ + // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ + + // Use flat array of DOUBLE size, with interleaved fata, + // because JS does not support effective + this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2); + this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2); + this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2); + zero(this.dyn_ltree); + zero(this.dyn_dtree); + zero(this.bl_tree); + + this.l_desc = null; /* desc. for literal tree */ + this.d_desc = null; /* desc. for distance tree */ + this.bl_desc = null; /* desc. for bit length tree */ + + //ush bl_count[MAX_BITS+1]; + this.bl_count = new utils.Buf16(MAX_BITS + 1); + /* number of codes at each bit length for an optimal tree */ + + //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ + this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */ + zero(this.heap); + + this.heap_len = 0; /* number of elements in the heap */ + this.heap_max = 0; /* element of largest frequency */ + /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. + * The same heap array is used to build all trees. + */ + + this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1]; + zero(this.depth); + /* Depth of each subtree used as tie breaker for trees of equal frequency + */ + + this.l_buf = 0; /* buffer index for literals or lengths */ + + this.lit_bufsize = 0; + /* Size of match buffer for literals/lengths. There are 4 reasons for + * limiting lit_bufsize to 64K: + * - frequencies can be kept in 16 bit counters + * - if compression is not successful for the first block, all input + * data is still in the window so we can still emit a stored block even + * when input comes from standard input. (This can also be done for + * all blocks if lit_bufsize is not greater than 32K.) + * - if compression is not successful for a file smaller than 64K, we can + * even emit a stored file instead of a stored block (saving 5 bytes). + * This is applicable only for zip (not gzip or zlib). + * - creating new Huffman trees less frequently may not provide fast + * adaptation to changes in the input data statistics. (Take for + * example a binary file with poorly compressible code followed by + * a highly compressible string table.) Smaller buffer sizes give + * fast adaptation but have of course the overhead of transmitting + * trees more frequently. + * - I can't count above 4 + */ + + this.last_lit = 0; /* running index in l_buf */ + + this.d_buf = 0; + /* Buffer index for distances. To simplify the code, d_buf and l_buf have + * the same number of elements. To use different lengths, an extra flag + * array would be necessary. + */ + + this.opt_len = 0; /* bit length of current block with optimal trees */ + this.static_len = 0; /* bit length of current block with static trees */ + this.matches = 0; /* number of string matches in current block */ + this.insert = 0; /* bytes at end of window left to insert */ + + + this.bi_buf = 0; + /* Output buffer. bits are inserted starting at the bottom (least + * significant bits). + */ + this.bi_valid = 0; + /* Number of valid bits in bi_buf. All bits above the last valid bit + * are always zero. + */ + + // Used for window memory init. We safely ignore it for JS. That makes + // sense only for pointers and memory check tools. + //this.high_water = 0; + /* High water mark offset in window for initialized bytes -- bytes above + * this are set to zero in order to avoid memory check warnings when + * longest match routines access bytes past the input. This is then + * updated to the new high water mark. + */ +} + + +function deflateResetKeep(strm) { + var s; + + if (!strm || !strm.state) { + return err(strm, Z_STREAM_ERROR); + } + + strm.total_in = strm.total_out = 0; + strm.data_type = Z_UNKNOWN; + + s = strm.state; + s.pending = 0; + s.pending_out = 0; + + if (s.wrap < 0) { + s.wrap = -s.wrap; + /* was made negative by deflate(..., Z_FINISH); */ + } + s.status = (s.wrap ? INIT_STATE : BUSY_STATE); + strm.adler = (s.wrap === 2) ? + 0 // crc32(0, Z_NULL, 0) + : + 1; // adler32(0, Z_NULL, 0) + s.last_flush = Z_NO_FLUSH; + trees._tr_init(s); + return Z_OK; +} + + +function deflateReset(strm) { + var ret = deflateResetKeep(strm); + if (ret === Z_OK) { + lm_init(strm.state); + } + return ret; +} + + +function deflateSetHeader(strm, head) { + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; } + strm.state.gzhead = head; + return Z_OK; +} + + +function deflateInit2(strm, level, method, windowBits, memLevel, strategy) { + if (!strm) { // === Z_NULL + return Z_STREAM_ERROR; + } + var wrap = 1; + + if (level === Z_DEFAULT_COMPRESSION) { + level = 6; + } + + if (windowBits < 0) { /* suppress zlib wrapper */ + wrap = 0; + windowBits = -windowBits; + } + + else if (windowBits > 15) { + wrap = 2; /* write gzip wrapper instead */ + windowBits -= 16; + } + + + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || + windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || + strategy < 0 || strategy > Z_FIXED) { + return err(strm, Z_STREAM_ERROR); + } + + + if (windowBits === 8) { + windowBits = 9; + } + /* until 256-byte window bug fixed */ + + var s = new DeflateState(); + + strm.state = s; + s.strm = strm; + + s.wrap = wrap; + s.gzhead = null; + s.w_bits = windowBits; + s.w_size = 1 << s.w_bits; + s.w_mask = s.w_size - 1; + + s.hash_bits = memLevel + 7; + s.hash_size = 1 << s.hash_bits; + s.hash_mask = s.hash_size - 1; + s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); + + s.window = new utils.Buf8(s.w_size * 2); + s.head = new utils.Buf16(s.hash_size); + s.prev = new utils.Buf16(s.w_size); + + // Don't need mem init magic for JS. + //s.high_water = 0; /* nothing written to s->window yet */ + + s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ + + s.pending_buf_size = s.lit_bufsize * 4; + + //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); + //s->pending_buf = (uchf *) overlay; + s.pending_buf = new utils.Buf8(s.pending_buf_size); + + // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`) + //s->d_buf = overlay + s->lit_bufsize/sizeof(ush); + s.d_buf = 1 * s.lit_bufsize; + + //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; + s.l_buf = (1 + 2) * s.lit_bufsize; + + s.level = level; + s.strategy = strategy; + s.method = method; + + return deflateReset(strm); +} + +function deflateInit(strm, level) { + return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); +} + + +function deflate(strm, flush) { + var old_flush, s; + var beg, val; // for gzip header write only + + if (!strm || !strm.state || + flush > Z_BLOCK || flush < 0) { + return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR; + } + + s = strm.state; + + if (!strm.output || + (!strm.input && strm.avail_in !== 0) || + (s.status === FINISH_STATE && flush !== Z_FINISH)) { + return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR); + } + + s.strm = strm; /* just in case */ + old_flush = s.last_flush; + s.last_flush = flush; + + /* Write the header */ + if (s.status === INIT_STATE) { + + if (s.wrap === 2) { // GZIP header + strm.adler = 0; //crc32(0L, Z_NULL, 0); + put_byte(s, 31); + put_byte(s, 139); + put_byte(s, 8); + if (!s.gzhead) { // s->gzhead == Z_NULL + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, s.level === 9 ? 2 : + (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? + 4 : 0)); + put_byte(s, OS_CODE); + s.status = BUSY_STATE; + } + else { + put_byte(s, (s.gzhead.text ? 1 : 0) + + (s.gzhead.hcrc ? 2 : 0) + + (!s.gzhead.extra ? 0 : 4) + + (!s.gzhead.name ? 0 : 8) + + (!s.gzhead.comment ? 0 : 16) + ); + put_byte(s, s.gzhead.time & 0xff); + put_byte(s, (s.gzhead.time >> 8) & 0xff); + put_byte(s, (s.gzhead.time >> 16) & 0xff); + put_byte(s, (s.gzhead.time >> 24) & 0xff); + put_byte(s, s.level === 9 ? 2 : + (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? + 4 : 0)); + put_byte(s, s.gzhead.os & 0xff); + if (s.gzhead.extra && s.gzhead.extra.length) { + put_byte(s, s.gzhead.extra.length & 0xff); + put_byte(s, (s.gzhead.extra.length >> 8) & 0xff); + } + if (s.gzhead.hcrc) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0); + } + s.gzindex = 0; + s.status = EXTRA_STATE; + } + } + else // DEFLATE header + { + var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8; + var level_flags = -1; + + if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { + level_flags = 0; + } else if (s.level < 6) { + level_flags = 1; + } else if (s.level === 6) { + level_flags = 2; + } else { + level_flags = 3; + } + header |= (level_flags << 6); + if (s.strstart !== 0) { header |= PRESET_DICT; } + header += 31 - (header % 31); + + s.status = BUSY_STATE; + putShortMSB(s, header); + + /* Save the adler32 of the preset dictionary: */ + if (s.strstart !== 0) { + putShortMSB(s, strm.adler >>> 16); + putShortMSB(s, strm.adler & 0xffff); + } + strm.adler = 1; // adler32(0L, Z_NULL, 0); + } + } + +//#ifdef GZIP + if (s.status === EXTRA_STATE) { + if (s.gzhead.extra/* != Z_NULL*/) { + beg = s.pending; /* start of bytes to update crc */ + + while (s.gzindex < (s.gzhead.extra.length & 0xffff)) { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + break; + } + } + put_byte(s, s.gzhead.extra[s.gzindex] & 0xff); + s.gzindex++; + } + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (s.gzindex === s.gzhead.extra.length) { + s.gzindex = 0; + s.status = NAME_STATE; + } + } + else { + s.status = NAME_STATE; + } + } + if (s.status === NAME_STATE) { + if (s.gzhead.name/* != Z_NULL*/) { + beg = s.pending; /* start of bytes to update crc */ + //int val; + + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + val = 1; + break; + } + } + // JS specific: little magic to add zero terminator to end of string + if (s.gzindex < s.gzhead.name.length) { + val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff; + } else { + val = 0; + } + put_byte(s, val); + } while (val !== 0); + + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (val === 0) { + s.gzindex = 0; + s.status = COMMENT_STATE; + } + } + else { + s.status = COMMENT_STATE; + } + } + if (s.status === COMMENT_STATE) { + if (s.gzhead.comment/* != Z_NULL*/) { + beg = s.pending; /* start of bytes to update crc */ + //int val; + + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + val = 1; + break; + } + } + // JS specific: little magic to add zero terminator to end of string + if (s.gzindex < s.gzhead.comment.length) { + val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff; + } else { + val = 0; + } + put_byte(s, val); + } while (val !== 0); + + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (val === 0) { + s.status = HCRC_STATE; + } + } + else { + s.status = HCRC_STATE; + } + } + if (s.status === HCRC_STATE) { + if (s.gzhead.hcrc) { + if (s.pending + 2 > s.pending_buf_size) { + flush_pending(strm); + } + if (s.pending + 2 <= s.pending_buf_size) { + put_byte(s, strm.adler & 0xff); + put_byte(s, (strm.adler >> 8) & 0xff); + strm.adler = 0; //crc32(0L, Z_NULL, 0); + s.status = BUSY_STATE; + } + } + else { + s.status = BUSY_STATE; + } + } +//#endif + + /* Flush as much pending output as possible */ + if (s.pending !== 0) { + flush_pending(strm); + if (strm.avail_out === 0) { + /* Since avail_out is 0, deflate will be called again with + * more output space, but possibly with both pending and + * avail_in equal to zero. There won't be anything to do, + * but this is not an error situation so make sure we + * return OK instead of BUF_ERROR at next call of deflate: + */ + s.last_flush = -1; + return Z_OK; + } + + /* Make sure there is something to do and avoid duplicate consecutive + * flushes. For repeated and useless calls with Z_FINISH, we keep + * returning Z_STREAM_END instead of Z_BUF_ERROR. + */ + } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && + flush !== Z_FINISH) { + return err(strm, Z_BUF_ERROR); + } + + /* User must not provide more input after the first FINISH: */ + if (s.status === FINISH_STATE && strm.avail_in !== 0) { + return err(strm, Z_BUF_ERROR); + } + + /* Start a new block or continue the current one. + */ + if (strm.avail_in !== 0 || s.lookahead !== 0 || + (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) { + var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) : + (s.strategy === Z_RLE ? deflate_rle(s, flush) : + configuration_table[s.level].func(s, flush)); + + if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) { + s.status = FINISH_STATE; + } + if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) { + if (strm.avail_out === 0) { + s.last_flush = -1; + /* avoid BUF_ERROR next call, see above */ + } + return Z_OK; + /* If flush != Z_NO_FLUSH && avail_out == 0, the next call + * of deflate should use the same flush parameter to make sure + * that the flush is complete. So we don't have to output an + * empty block here, this will be done at next call. This also + * ensures that for a very small output buffer, we emit at most + * one empty block. + */ + } + if (bstate === BS_BLOCK_DONE) { + if (flush === Z_PARTIAL_FLUSH) { + trees._tr_align(s); + } + else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ + + trees._tr_stored_block(s, 0, 0, false); + /* For a full flush, this empty block will be recognized + * as a special marker by inflate_sync(). + */ + if (flush === Z_FULL_FLUSH) { + /*** CLEAR_HASH(s); ***/ /* forget history */ + zero(s.head); // Fill with NIL (= 0); + + if (s.lookahead === 0) { + s.strstart = 0; + s.block_start = 0; + s.insert = 0; + } + } + } + flush_pending(strm); + if (strm.avail_out === 0) { + s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */ + return Z_OK; + } + } + } + //Assert(strm->avail_out > 0, "bug2"); + //if (strm.avail_out <= 0) { throw new Error("bug2");} + + if (flush !== Z_FINISH) { return Z_OK; } + if (s.wrap <= 0) { return Z_STREAM_END; } + + /* Write the trailer */ + if (s.wrap === 2) { + put_byte(s, strm.adler & 0xff); + put_byte(s, (strm.adler >> 8) & 0xff); + put_byte(s, (strm.adler >> 16) & 0xff); + put_byte(s, (strm.adler >> 24) & 0xff); + put_byte(s, strm.total_in & 0xff); + put_byte(s, (strm.total_in >> 8) & 0xff); + put_byte(s, (strm.total_in >> 16) & 0xff); + put_byte(s, (strm.total_in >> 24) & 0xff); + } + else + { + putShortMSB(s, strm.adler >>> 16); + putShortMSB(s, strm.adler & 0xffff); + } + + flush_pending(strm); + /* If avail_out is zero, the application will call deflate again + * to flush the rest. + */ + if (s.wrap > 0) { s.wrap = -s.wrap; } + /* write the trailer only once! */ + return s.pending !== 0 ? Z_OK : Z_STREAM_END; +} + +function deflateEnd(strm) { + var status; + + if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { + return Z_STREAM_ERROR; + } + + status = strm.state.status; + if (status !== INIT_STATE && + status !== EXTRA_STATE && + status !== NAME_STATE && + status !== COMMENT_STATE && + status !== HCRC_STATE && + status !== BUSY_STATE && + status !== FINISH_STATE + ) { + return err(strm, Z_STREAM_ERROR); + } + + strm.state = null; + + return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; +} + + +/* ========================================================================= + * Initializes the compression dictionary from the given byte + * sequence without producing any compressed output. + */ +function deflateSetDictionary(strm, dictionary) { + var dictLength = dictionary.length; + + var s; + var str, n; + var wrap; + var avail; + var next; + var input; + var tmpDict; + + if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { + return Z_STREAM_ERROR; + } + + s = strm.state; + wrap = s.wrap; + + if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) { + return Z_STREAM_ERROR; + } + + /* when using zlib wrappers, compute Adler-32 for provided dictionary */ + if (wrap === 1) { + /* adler32(strm->adler, dictionary, dictLength); */ + strm.adler = adler32(strm.adler, dictionary, dictLength, 0); + } + + s.wrap = 0; /* avoid computing Adler-32 in read_buf */ + + /* if dictionary would fill window, just replace the history */ + if (dictLength >= s.w_size) { + if (wrap === 0) { /* already empty otherwise */ + /*** CLEAR_HASH(s); ***/ + zero(s.head); // Fill with NIL (= 0); + s.strstart = 0; + s.block_start = 0; + s.insert = 0; + } + /* use the tail */ + // dictionary = dictionary.slice(dictLength - s.w_size); + tmpDict = new utils.Buf8(s.w_size); + utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0); + dictionary = tmpDict; + dictLength = s.w_size; + } + /* insert dictionary into window and hash */ + avail = strm.avail_in; + next = strm.next_in; + input = strm.input; + strm.avail_in = dictLength; + strm.next_in = 0; + strm.input = dictionary; + fill_window(s); + while (s.lookahead >= MIN_MATCH) { + str = s.strstart; + n = s.lookahead - (MIN_MATCH - 1); + do { + /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; + + s.prev[str & s.w_mask] = s.head[s.ins_h]; + + s.head[s.ins_h] = str; + str++; + } while (--n); + s.strstart = str; + s.lookahead = MIN_MATCH - 1; + fill_window(s); + } + s.strstart += s.lookahead; + s.block_start = s.strstart; + s.insert = s.lookahead; + s.lookahead = 0; + s.match_length = s.prev_length = MIN_MATCH - 1; + s.match_available = 0; + strm.next_in = next; + strm.input = input; + strm.avail_in = avail; + s.wrap = wrap; + return Z_OK; +} + + +exports.deflateInit = deflateInit; +exports.deflateInit2 = deflateInit2; +exports.deflateReset = deflateReset; +exports.deflateResetKeep = deflateResetKeep; +exports.deflateSetHeader = deflateSetHeader; +exports.deflate = deflate; +exports.deflateEnd = deflateEnd; +exports.deflateSetDictionary = deflateSetDictionary; +exports.deflateInfo = 'pako deflate (from Nodeca project)'; + +/* Not implemented +exports.deflateBound = deflateBound; +exports.deflateCopy = deflateCopy; +exports.deflateParams = deflateParams; +exports.deflatePending = deflatePending; +exports.deflatePrime = deflatePrime; +exports.deflateTune = deflateTune; +*/ + +},{"../utils/common":1,"./adler32":3,"./crc32":4,"./messages":6,"./trees":7}],6:[function(require,module,exports){ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +module.exports = { + 2: 'need dictionary', /* Z_NEED_DICT 2 */ + 1: 'stream end', /* Z_STREAM_END 1 */ + 0: '', /* Z_OK 0 */ + '-1': 'file error', /* Z_ERRNO (-1) */ + '-2': 'stream error', /* Z_STREAM_ERROR (-2) */ + '-3': 'data error', /* Z_DATA_ERROR (-3) */ + '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */ + '-5': 'buffer error', /* Z_BUF_ERROR (-5) */ + '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */ +}; + +},{}],7:[function(require,module,exports){ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +var utils = require('../utils/common'); + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + + +//var Z_FILTERED = 1; +//var Z_HUFFMAN_ONLY = 2; +//var Z_RLE = 3; +var Z_FIXED = 4; +//var Z_DEFAULT_STRATEGY = 0; + +/* Possible values of the data_type field (though see inflate()) */ +var Z_BINARY = 0; +var Z_TEXT = 1; +//var Z_ASCII = 1; // = Z_TEXT +var Z_UNKNOWN = 2; + +/*============================================================================*/ + + +function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } + +// From zutil.h + +var STORED_BLOCK = 0; +var STATIC_TREES = 1; +var DYN_TREES = 2; +/* The three kinds of block type */ + +var MIN_MATCH = 3; +var MAX_MATCH = 258; +/* The minimum and maximum match lengths */ + +// From deflate.h +/* =========================================================================== + * Internal compression state. + */ + +var LENGTH_CODES = 29; +/* number of length codes, not counting the special END_BLOCK code */ + +var LITERALS = 256; +/* number of literal bytes 0..255 */ + +var L_CODES = LITERALS + 1 + LENGTH_CODES; +/* number of Literal or Length codes, including the END_BLOCK code */ + +var D_CODES = 30; +/* number of distance codes */ + +var BL_CODES = 19; +/* number of codes used to transfer the bit lengths */ + +var HEAP_SIZE = 2 * L_CODES + 1; +/* maximum heap size */ + +var MAX_BITS = 15; +/* All codes must not exceed MAX_BITS bits */ + +var Buf_size = 16; +/* size of bit buffer in bi_buf */ + + +/* =========================================================================== + * Constants + */ + +var MAX_BL_BITS = 7; +/* Bit length codes must not exceed MAX_BL_BITS bits */ + +var END_BLOCK = 256; +/* end of block literal code */ + +var REP_3_6 = 16; +/* repeat previous bit length 3-6 times (2 bits of repeat count) */ + +var REPZ_3_10 = 17; +/* repeat a zero length 3-10 times (3 bits of repeat count) */ + +var REPZ_11_138 = 18; +/* repeat a zero length 11-138 times (7 bits of repeat count) */ + +/* eslint-disable comma-spacing,array-bracket-spacing */ +var extra_lbits = /* extra bits for each length code */ + [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]; + +var extra_dbits = /* extra bits for each distance code */ + [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]; + +var extra_blbits = /* extra bits for each bit length code */ + [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]; + +var bl_order = + [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]; +/* eslint-enable comma-spacing,array-bracket-spacing */ + +/* The lengths of the bit length codes are sent in order of decreasing + * probability, to avoid transmitting the lengths for unused bit length codes. + */ + +/* =========================================================================== + * Local data. These are initialized only once. + */ + +// We pre-fill arrays with 0 to avoid uninitialized gaps + +var DIST_CODE_LEN = 512; /* see definition of array dist_code below */ + +// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1 +var static_ltree = new Array((L_CODES + 2) * 2); +zero(static_ltree); +/* The static literal tree. Since the bit lengths are imposed, there is no + * need for the L_CODES extra codes used during heap construction. However + * The codes 286 and 287 are needed to build a canonical tree (see _tr_init + * below). + */ + +var static_dtree = new Array(D_CODES * 2); +zero(static_dtree); +/* The static distance tree. (Actually a trivial tree since all codes use + * 5 bits.) + */ + +var _dist_code = new Array(DIST_CODE_LEN); +zero(_dist_code); +/* Distance codes. The first 256 values correspond to the distances + * 3 .. 258, the last 256 values correspond to the top 8 bits of + * the 15 bit distances. + */ + +var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); +zero(_length_code); +/* length code for each normalized match length (0 == MIN_MATCH) */ + +var base_length = new Array(LENGTH_CODES); +zero(base_length); +/* First normalized length for each code (0 = MIN_MATCH) */ + +var base_dist = new Array(D_CODES); +zero(base_dist); +/* First normalized distance for each code (0 = distance of 1) */ + + +function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) { + + this.static_tree = static_tree; /* static tree or NULL */ + this.extra_bits = extra_bits; /* extra bits for each code or NULL */ + this.extra_base = extra_base; /* base index for extra_bits */ + this.elems = elems; /* max number of elements in the tree */ + this.max_length = max_length; /* max bit length for the codes */ + + // show if `static_tree` has data or dummy - needed for monomorphic objects + this.has_stree = static_tree && static_tree.length; +} + + +var static_l_desc; +var static_d_desc; +var static_bl_desc; + + +function TreeDesc(dyn_tree, stat_desc) { + this.dyn_tree = dyn_tree; /* the dynamic tree */ + this.max_code = 0; /* largest code with non zero frequency */ + this.stat_desc = stat_desc; /* the corresponding static tree */ +} + + + +function d_code(dist) { + return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)]; +} + + +/* =========================================================================== + * Output a short LSB first on the stream. + * IN assertion: there is enough room in pendingBuf. + */ +function put_short(s, w) { +// put_byte(s, (uch)((w) & 0xff)); +// put_byte(s, (uch)((ush)(w) >> 8)); + s.pending_buf[s.pending++] = (w) & 0xff; + s.pending_buf[s.pending++] = (w >>> 8) & 0xff; +} + + +/* =========================================================================== + * Send a value on a given number of bits. + * IN assertion: length <= 16 and value fits in length bits. + */ +function send_bits(s, value, length) { + if (s.bi_valid > (Buf_size - length)) { + s.bi_buf |= (value << s.bi_valid) & 0xffff; + put_short(s, s.bi_buf); + s.bi_buf = value >> (Buf_size - s.bi_valid); + s.bi_valid += length - Buf_size; + } else { + s.bi_buf |= (value << s.bi_valid) & 0xffff; + s.bi_valid += length; + } +} + + +function send_code(s, c, tree) { + send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/); +} + + +/* =========================================================================== + * Reverse the first len bits of a code, using straightforward code (a faster + * method would use a table) + * IN assertion: 1 <= len <= 15 + */ +function bi_reverse(code, len) { + var res = 0; + do { + res |= code & 1; + code >>>= 1; + res <<= 1; + } while (--len > 0); + return res >>> 1; +} + + +/* =========================================================================== + * Flush the bit buffer, keeping at most 7 bits in it. + */ +function bi_flush(s) { + if (s.bi_valid === 16) { + put_short(s, s.bi_buf); + s.bi_buf = 0; + s.bi_valid = 0; + + } else if (s.bi_valid >= 8) { + s.pending_buf[s.pending++] = s.bi_buf & 0xff; + s.bi_buf >>= 8; + s.bi_valid -= 8; + } +} + + +/* =========================================================================== + * Compute the optimal bit lengths for a tree and update the total bit length + * for the current block. + * IN assertion: the fields freq and dad are set, heap[heap_max] and + * above are the tree nodes sorted by increasing frequency. + * OUT assertions: the field len is set to the optimal bit length, the + * array bl_count contains the frequencies for each bit length. + * The length opt_len is updated; static_len is also updated if stree is + * not null. + */ +function gen_bitlen(s, desc) +// deflate_state *s; +// tree_desc *desc; /* the tree descriptor */ +{ + var tree = desc.dyn_tree; + var max_code = desc.max_code; + var stree = desc.stat_desc.static_tree; + var has_stree = desc.stat_desc.has_stree; + var extra = desc.stat_desc.extra_bits; + var base = desc.stat_desc.extra_base; + var max_length = desc.stat_desc.max_length; + var h; /* heap index */ + var n, m; /* iterate over the tree elements */ + var bits; /* bit length */ + var xbits; /* extra bits */ + var f; /* frequency */ + var overflow = 0; /* number of elements with bit length too large */ + + for (bits = 0; bits <= MAX_BITS; bits++) { + s.bl_count[bits] = 0; + } + + /* In a first pass, compute the optimal bit lengths (which may + * overflow in the case of the bit length tree). + */ + tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */ + + for (h = s.heap_max + 1; h < HEAP_SIZE; h++) { + n = s.heap[h]; + bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1; + if (bits > max_length) { + bits = max_length; + overflow++; + } + tree[n * 2 + 1]/*.Len*/ = bits; + /* We overwrite tree[n].Dad which is no longer needed */ + + if (n > max_code) { continue; } /* not a leaf node */ + + s.bl_count[bits]++; + xbits = 0; + if (n >= base) { + xbits = extra[n - base]; + } + f = tree[n * 2]/*.Freq*/; + s.opt_len += f * (bits + xbits); + if (has_stree) { + s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits); + } + } + if (overflow === 0) { return; } + + // Trace((stderr,"\nbit length overflow\n")); + /* This happens for example on obj2 and pic of the Calgary corpus */ + + /* Find the first bit length which could increase: */ + do { + bits = max_length - 1; + while (s.bl_count[bits] === 0) { bits--; } + s.bl_count[bits]--; /* move one leaf down the tree */ + s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */ + s.bl_count[max_length]--; + /* The brother of the overflow item also moves one step up, + * but this does not affect bl_count[max_length] + */ + overflow -= 2; + } while (overflow > 0); + + /* Now recompute all bit lengths, scanning in increasing frequency. + * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all + * lengths instead of fixing only the wrong ones. This idea is taken + * from 'ar' written by Haruhiko Okumura.) + */ + for (bits = max_length; bits !== 0; bits--) { + n = s.bl_count[bits]; + while (n !== 0) { + m = s.heap[--h]; + if (m > max_code) { continue; } + if (tree[m * 2 + 1]/*.Len*/ !== bits) { + // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); + s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/; + tree[m * 2 + 1]/*.Len*/ = bits; + } + n--; + } + } +} + + +/* =========================================================================== + * Generate the codes for a given tree and bit counts (which need not be + * optimal). + * IN assertion: the array bl_count contains the bit length statistics for + * the given tree and the field len is set for all tree elements. + * OUT assertion: the field code is set for all tree elements of non + * zero code length. + */ +function gen_codes(tree, max_code, bl_count) +// ct_data *tree; /* the tree to decorate */ +// int max_code; /* largest code with non zero frequency */ +// ushf *bl_count; /* number of codes at each bit length */ +{ + var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */ + var code = 0; /* running code value */ + var bits; /* bit index */ + var n; /* code index */ + + /* The distribution counts are first used to generate the code values + * without bit reversal. + */ + for (bits = 1; bits <= MAX_BITS; bits++) { + next_code[bits] = code = (code + bl_count[bits - 1]) << 1; + } + /* Check that the bit counts in bl_count are consistent. The last code + * must be all ones. + */ + //Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */ + length = 0; + for (code = 0; code < LENGTH_CODES - 1; code++) { + base_length[code] = length; + for (n = 0; n < (1 << extra_lbits[code]); n++) { + _length_code[length++] = code; + } + } + //Assert (length == 256, "tr_static_init: length != 256"); + /* Note that the length 255 (match length 258) can be represented + * in two different ways: code 284 + 5 bits or code 285, so we + * overwrite length_code[255] to use the best encoding: + */ + _length_code[length - 1] = code; + + /* Initialize the mapping dist (0..32K) -> dist code (0..29) */ + dist = 0; + for (code = 0; code < 16; code++) { + base_dist[code] = dist; + for (n = 0; n < (1 << extra_dbits[code]); n++) { + _dist_code[dist++] = code; + } + } + //Assert (dist == 256, "tr_static_init: dist != 256"); + dist >>= 7; /* from now on, all distances are divided by 128 */ + for (; code < D_CODES; code++) { + base_dist[code] = dist << 7; + for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) { + _dist_code[256 + dist++] = code; + } + } + //Assert (dist == 256, "tr_static_init: 256+dist != 512"); + + /* Construct the codes of the static literal tree */ + for (bits = 0; bits <= MAX_BITS; bits++) { + bl_count[bits] = 0; + } + + n = 0; + while (n <= 143) { + static_ltree[n * 2 + 1]/*.Len*/ = 8; + n++; + bl_count[8]++; + } + while (n <= 255) { + static_ltree[n * 2 + 1]/*.Len*/ = 9; + n++; + bl_count[9]++; + } + while (n <= 279) { + static_ltree[n * 2 + 1]/*.Len*/ = 7; + n++; + bl_count[7]++; + } + while (n <= 287) { + static_ltree[n * 2 + 1]/*.Len*/ = 8; + n++; + bl_count[8]++; + } + /* Codes 286 and 287 do not exist, but we must include them in the + * tree construction to get a canonical Huffman tree (longest code + * all ones) + */ + gen_codes(static_ltree, L_CODES + 1, bl_count); + + /* The static distance tree is trivial: */ + for (n = 0; n < D_CODES; n++) { + static_dtree[n * 2 + 1]/*.Len*/ = 5; + static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5); + } + + // Now data ready and we can init static trees + static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); + static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); + static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); + + //static_init_done = true; +} + + +/* =========================================================================== + * Initialize a new block. + */ +function init_block(s) { + var n; /* iterates over tree elements */ + + /* Initialize the trees. */ + for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; } + + s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1; + s.opt_len = s.static_len = 0; + s.last_lit = s.matches = 0; +} + + +/* =========================================================================== + * Flush the bit buffer and align the output on a byte boundary + */ +function bi_windup(s) +{ + if (s.bi_valid > 8) { + put_short(s, s.bi_buf); + } else if (s.bi_valid > 0) { + //put_byte(s, (Byte)s->bi_buf); + s.pending_buf[s.pending++] = s.bi_buf; + } + s.bi_buf = 0; + s.bi_valid = 0; +} + +/* =========================================================================== + * Copy a stored block, storing first the length and its + * one's complement if requested. + */ +function copy_block(s, buf, len, header) +//DeflateState *s; +//charf *buf; /* the input data */ +//unsigned len; /* its length */ +//int header; /* true if block header must be written */ +{ + bi_windup(s); /* align on byte boundary */ + + if (header) { + put_short(s, len); + put_short(s, ~len); + } +// while (len--) { +// put_byte(s, *buf++); +// } + utils.arraySet(s.pending_buf, s.window, buf, len, s.pending); + s.pending += len; +} + +/* =========================================================================== + * Compares to subtrees, using the tree depth as tie breaker when + * the subtrees have equal frequency. This minimizes the worst case length. + */ +function smaller(tree, n, m, depth) { + var _n2 = n * 2; + var _m2 = m * 2; + return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ || + (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m])); +} + +/* =========================================================================== + * Restore the heap property by moving down the tree starting at node k, + * exchanging a node with the smallest of its two sons if necessary, stopping + * when the heap property is re-established (each father smaller than its + * two sons). + */ +function pqdownheap(s, tree, k) +// deflate_state *s; +// ct_data *tree; /* the tree to restore */ +// int k; /* node to move down */ +{ + var v = s.heap[k]; + var j = k << 1; /* left son of k */ + while (j <= s.heap_len) { + /* Set j to the smallest of the two sons: */ + if (j < s.heap_len && + smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) { + j++; + } + /* Exit if v is smaller than both sons */ + if (smaller(tree, v, s.heap[j], s.depth)) { break; } + + /* Exchange v with the smallest son */ + s.heap[k] = s.heap[j]; + k = j; + + /* And continue down the tree, setting j to the left son of k */ + j <<= 1; + } + s.heap[k] = v; +} + + +// inlined manually +// var SMALLEST = 1; + +/* =========================================================================== + * Send the block data compressed using the given Huffman trees + */ +function compress_block(s, ltree, dtree) +// deflate_state *s; +// const ct_data *ltree; /* literal tree */ +// const ct_data *dtree; /* distance tree */ +{ + var dist; /* distance of matched string */ + var lc; /* match length or unmatched char (if dist == 0) */ + var lx = 0; /* running index in l_buf */ + var code; /* the code to send */ + var extra; /* number of extra bits to send */ + + if (s.last_lit !== 0) { + do { + dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]); + lc = s.pending_buf[s.l_buf + lx]; + lx++; + + if (dist === 0) { + send_code(s, lc, ltree); /* send a literal byte */ + //Tracecv(isgraph(lc), (stderr," '%c' ", lc)); + } else { + /* Here, lc is the match length - MIN_MATCH */ + code = _length_code[lc]; + send_code(s, code + LITERALS + 1, ltree); /* send the length code */ + extra = extra_lbits[code]; + if (extra !== 0) { + lc -= base_length[code]; + send_bits(s, lc, extra); /* send the extra length bits */ + } + dist--; /* dist is now the match distance - 1 */ + code = d_code(dist); + //Assert (code < D_CODES, "bad d_code"); + + send_code(s, code, dtree); /* send the distance code */ + extra = extra_dbits[code]; + if (extra !== 0) { + dist -= base_dist[code]; + send_bits(s, dist, extra); /* send the extra distance bits */ + } + } /* literal or match pair ? */ + + /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ + //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx, + // "pendingBuf overflow"); + + } while (lx < s.last_lit); + } + + send_code(s, END_BLOCK, ltree); +} + + +/* =========================================================================== + * Construct one Huffman tree and assigns the code bit strings and lengths. + * Update the total bit length for the current block. + * IN assertion: the field freq is set for all tree elements. + * OUT assertions: the fields len and code are set to the optimal bit length + * and corresponding code. The length opt_len is updated; static_len is + * also updated if stree is not null. The field max_code is set. + */ +function build_tree(s, desc) +// deflate_state *s; +// tree_desc *desc; /* the tree descriptor */ +{ + var tree = desc.dyn_tree; + var stree = desc.stat_desc.static_tree; + var has_stree = desc.stat_desc.has_stree; + var elems = desc.stat_desc.elems; + var n, m; /* iterate over heap elements */ + var max_code = -1; /* largest code with non zero frequency */ + var node; /* new node being created */ + + /* Construct the initial heap, with least frequent element in + * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. + * heap[0] is not used. + */ + s.heap_len = 0; + s.heap_max = HEAP_SIZE; + + for (n = 0; n < elems; n++) { + if (tree[n * 2]/*.Freq*/ !== 0) { + s.heap[++s.heap_len] = max_code = n; + s.depth[n] = 0; + + } else { + tree[n * 2 + 1]/*.Len*/ = 0; + } + } + + /* The pkzip format requires that at least one distance code exists, + * and that at least one bit should be sent even if there is only one + * possible code. So to avoid special checks later on we force at least + * two codes of non zero frequency. + */ + while (s.heap_len < 2) { + node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0); + tree[node * 2]/*.Freq*/ = 1; + s.depth[node] = 0; + s.opt_len--; + + if (has_stree) { + s.static_len -= stree[node * 2 + 1]/*.Len*/; + } + /* node is 0 or 1 so it does not have extra bits */ + } + desc.max_code = max_code; + + /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, + * establish sub-heaps of increasing lengths: + */ + for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); } + + /* Construct the Huffman tree by repeatedly combining the least two + * frequent nodes. + */ + node = elems; /* next internal node of the tree */ + do { + //pqremove(s, tree, n); /* n = node of least frequency */ + /*** pqremove ***/ + n = s.heap[1/*SMALLEST*/]; + s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--]; + pqdownheap(s, tree, 1/*SMALLEST*/); + /***/ + + m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */ + + s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */ + s.heap[--s.heap_max] = m; + + /* Create a new node father of n and m */ + tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/; + s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1; + tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node; + + /* and insert the new node in the heap */ + s.heap[1/*SMALLEST*/] = node++; + pqdownheap(s, tree, 1/*SMALLEST*/); + + } while (s.heap_len >= 2); + + s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/]; + + /* At this point, the fields freq and dad are set. We can now + * generate the bit lengths. + */ + gen_bitlen(s, desc); + + /* The field len is now set, we can generate the bit codes */ + gen_codes(tree, max_code, s.bl_count); +} + + +/* =========================================================================== + * Scan a literal or distance tree to determine the frequencies of the codes + * in the bit length tree. + */ +function scan_tree(s, tree, max_code) +// deflate_state *s; +// ct_data *tree; /* the tree to be scanned */ +// int max_code; /* and its largest code of non zero frequency */ +{ + var n; /* iterates over all tree elements */ + var prevlen = -1; /* last emitted length */ + var curlen; /* length of current code */ + + var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */ + + var count = 0; /* repeat count of the current code */ + var max_count = 7; /* max repeat count */ + var min_count = 4; /* min repeat count */ + + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } + tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */ + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; + nextlen = tree[(n + 1) * 2 + 1]/*.Len*/; + + if (++count < max_count && curlen === nextlen) { + continue; + + } else if (count < min_count) { + s.bl_tree[curlen * 2]/*.Freq*/ += count; + + } else if (curlen !== 0) { + + if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; } + s.bl_tree[REP_3_6 * 2]/*.Freq*/++; + + } else if (count <= 10) { + s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++; + + } else { + s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++; + } + + count = 0; + prevlen = curlen; + + if (nextlen === 0) { + max_count = 138; + min_count = 3; + + } else if (curlen === nextlen) { + max_count = 6; + min_count = 3; + + } else { + max_count = 7; + min_count = 4; + } + } +} + + +/* =========================================================================== + * Send a literal or distance tree in compressed form, using the codes in + * bl_tree. + */ +function send_tree(s, tree, max_code) +// deflate_state *s; +// ct_data *tree; /* the tree to be scanned */ +// int max_code; /* and its largest code of non zero frequency */ +{ + var n; /* iterates over all tree elements */ + var prevlen = -1; /* last emitted length */ + var curlen; /* length of current code */ + + var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */ + + var count = 0; /* repeat count of the current code */ + var max_count = 7; /* max repeat count */ + var min_count = 4; /* min repeat count */ + + /* tree[max_code+1].Len = -1; */ /* guard already set */ + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; + nextlen = tree[(n + 1) * 2 + 1]/*.Len*/; + + if (++count < max_count && curlen === nextlen) { + continue; + + } else if (count < min_count) { + do { send_code(s, curlen, s.bl_tree); } while (--count !== 0); + + } else if (curlen !== 0) { + if (curlen !== prevlen) { + send_code(s, curlen, s.bl_tree); + count--; + } + //Assert(count >= 3 && count <= 6, " 3_6?"); + send_code(s, REP_3_6, s.bl_tree); + send_bits(s, count - 3, 2); + + } else if (count <= 10) { + send_code(s, REPZ_3_10, s.bl_tree); + send_bits(s, count - 3, 3); + + } else { + send_code(s, REPZ_11_138, s.bl_tree); + send_bits(s, count - 11, 7); + } + + count = 0; + prevlen = curlen; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + + } else if (curlen === nextlen) { + max_count = 6; + min_count = 3; + + } else { + max_count = 7; + min_count = 4; + } + } +} + + +/* =========================================================================== + * Construct the Huffman tree for the bit lengths and return the index in + * bl_order of the last bit length code to send. + */ +function build_bl_tree(s) { + var max_blindex; /* index of last bit length code of non zero freq */ + + /* Determine the bit length frequencies for literal and distance trees */ + scan_tree(s, s.dyn_ltree, s.l_desc.max_code); + scan_tree(s, s.dyn_dtree, s.d_desc.max_code); + + /* Build the bit length tree: */ + build_tree(s, s.bl_desc); + /* opt_len now includes the length of the tree representations, except + * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. + */ + + /* Determine the number of bit length codes to send. The pkzip format + * requires that at least 4 bit length codes be sent. (appnote.txt says + * 3 but the actual value used is 4.) + */ + for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { + if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) { + break; + } + } + /* Update opt_len to include the bit length tree and counts */ + s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; + //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", + // s->opt_len, s->static_len)); + + return max_blindex; +} + + +/* =========================================================================== + * Send the header for a block using dynamic Huffman trees: the counts, the + * lengths of the bit length codes, the literal tree and the distance tree. + * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. + */ +function send_all_trees(s, lcodes, dcodes, blcodes) +// deflate_state *s; +// int lcodes, dcodes, blcodes; /* number of codes for each tree */ +{ + var rank; /* index in bl_order */ + + //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); + //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, + // "too many codes"); + //Tracev((stderr, "\nbl counts: ")); + send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */ + send_bits(s, dcodes - 1, 5); + send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */ + for (rank = 0; rank < blcodes; rank++) { + //Tracev((stderr, "\nbl code %2d ", bl_order[rank])); + send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3); + } + //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); + + send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */ + //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); + + send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */ + //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); +} + + +/* =========================================================================== + * Check if the data type is TEXT or BINARY, using the following algorithm: + * - TEXT if the two conditions below are satisfied: + * a) There are no non-portable control characters belonging to the + * "black list" (0..6, 14..25, 28..31). + * b) There is at least one printable character belonging to the + * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). + * - BINARY otherwise. + * - The following partially-portable control characters form a + * "gray list" that is ignored in this detection algorithm: + * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). + * IN assertion: the fields Freq of dyn_ltree are set. + */ +function detect_data_type(s) { + /* black_mask is the bit mask of black-listed bytes + * set bits 0..6, 14..25, and 28..31 + * 0xf3ffc07f = binary 11110011111111111100000001111111 + */ + var black_mask = 0xf3ffc07f; + var n; + + /* Check for non-textual ("black-listed") bytes. */ + for (n = 0; n <= 31; n++, black_mask >>>= 1) { + if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) { + return Z_BINARY; + } + } + + /* Check for textual ("white-listed") bytes. */ + if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 || + s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) { + return Z_TEXT; + } + for (n = 32; n < LITERALS; n++) { + if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) { + return Z_TEXT; + } + } + + /* There are no "black-listed" or "white-listed" bytes: + * this stream either is empty or has tolerated ("gray-listed") bytes only. + */ + return Z_BINARY; +} + + +var static_init_done = false; + +/* =========================================================================== + * Initialize the tree data structures for a new zlib stream. + */ +function _tr_init(s) +{ + + if (!static_init_done) { + tr_static_init(); + static_init_done = true; + } + + s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc); + s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc); + s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc); + + s.bi_buf = 0; + s.bi_valid = 0; + + /* Initialize the first block of the first file: */ + init_block(s); +} + + +/* =========================================================================== + * Send a stored block + */ +function _tr_stored_block(s, buf, stored_len, last) +//DeflateState *s; +//charf *buf; /* input block */ +//ulg stored_len; /* length of input block */ +//int last; /* one if this is the last block for a file */ +{ + send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */ + copy_block(s, buf, stored_len, true); /* with header */ +} + + +/* =========================================================================== + * Send one empty static block to give enough lookahead for inflate. + * This takes 10 bits, of which 7 may remain in the bit buffer. + */ +function _tr_align(s) { + send_bits(s, STATIC_TREES << 1, 3); + send_code(s, END_BLOCK, static_ltree); + bi_flush(s); +} + + +/* =========================================================================== + * Determine the best encoding for the current block: dynamic trees, static + * trees or store, and output the encoded block to the zip file. + */ +function _tr_flush_block(s, buf, stored_len, last) +//DeflateState *s; +//charf *buf; /* input block, or NULL if too old */ +//ulg stored_len; /* length of input block */ +//int last; /* one if this is the last block for a file */ +{ + var opt_lenb, static_lenb; /* opt_len and static_len in bytes */ + var max_blindex = 0; /* index of last bit length code of non zero freq */ + + /* Build the Huffman trees unless a stored block is forced */ + if (s.level > 0) { + + /* Check if the file is binary or text */ + if (s.strm.data_type === Z_UNKNOWN) { + s.strm.data_type = detect_data_type(s); + } + + /* Construct the literal and distance trees */ + build_tree(s, s.l_desc); + // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len, + // s->static_len)); + + build_tree(s, s.d_desc); + // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len, + // s->static_len)); + /* At this point, opt_len and static_len are the total bit lengths of + * the compressed block data, excluding the tree representations. + */ + + /* Build the bit length tree for the above two trees, and get the index + * in bl_order of the last bit length code to send. + */ + max_blindex = build_bl_tree(s); + + /* Determine the best encoding. Compute the block lengths in bytes. */ + opt_lenb = (s.opt_len + 3 + 7) >>> 3; + static_lenb = (s.static_len + 3 + 7) >>> 3; + + // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", + // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, + // s->last_lit)); + + if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; } + + } else { + // Assert(buf != (char*)0, "lost buf"); + opt_lenb = static_lenb = stored_len + 5; /* force a stored block */ + } + + if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) { + /* 4: two words for the lengths */ + + /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. + * Otherwise we can't have processed more than WSIZE input bytes since + * the last block flush, because compression would have been + * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to + * transform a block into a stored block. + */ + _tr_stored_block(s, buf, stored_len, last); + + } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { + + send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3); + compress_block(s, static_ltree, static_dtree); + + } else { + send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3); + send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1); + compress_block(s, s.dyn_ltree, s.dyn_dtree); + } + // Assert (s->compressed_len == s->bits_sent, "bad compressed size"); + /* The above check is made mod 2^32, for files larger than 512 MB + * and uLong implemented on 32 bits. + */ + init_block(s); + + if (last) { + bi_windup(s); + } + // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, + // s->compressed_len-7*last)); +} + +/* =========================================================================== + * Save the match info and tally the frequency counts. Return true if + * the current block must be flushed. + */ +function _tr_tally(s, dist, lc) +// deflate_state *s; +// unsigned dist; /* distance of matched string */ +// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ +{ + //var out_length, in_length, dcode; + + s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff; + s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff; + + s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff; + s.last_lit++; + + if (dist === 0) { + /* lc is the unmatched char */ + s.dyn_ltree[lc * 2]/*.Freq*/++; + } else { + s.matches++; + /* Here, lc is the match length - MIN_MATCH */ + dist--; /* dist = match distance - 1 */ + //Assert((ush)dist < (ush)MAX_DIST(s) && + // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && + // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); + + s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++; + s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++; + } + +// (!) This block is disabled in zlib defaults, +// don't enable it for binary compatibility + +//#ifdef TRUNCATE_BLOCK +// /* Try to guess if it is profitable to stop the current block here */ +// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) { +// /* Compute an upper bound for the compressed length */ +// out_length = s.last_lit*8; +// in_length = s.strstart - s.block_start; +// +// for (dcode = 0; dcode < D_CODES; dcode++) { +// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]); +// } +// out_length >>>= 3; +// //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", +// // s->last_lit, in_length, out_length, +// // 100L - out_length*100L/in_length)); +// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) { +// return true; +// } +// } +//#endif + + return (s.last_lit === s.lit_bufsize - 1); + /* We avoid equality with lit_bufsize because of wraparound at 64K + * on 16 bit machines and because stored blocks are restricted to + * 64K-1 bytes. + */ +} + +exports._tr_init = _tr_init; +exports._tr_stored_block = _tr_stored_block; +exports._tr_flush_block = _tr_flush_block; +exports._tr_tally = _tr_tally; +exports._tr_align = _tr_align; + +},{"../utils/common":1}],8:[function(require,module,exports){ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +function ZStream() { + /* next input byte */ + this.input = null; // JS specific, because we have no pointers + this.next_in = 0; + /* number of bytes available at input */ + this.avail_in = 0; + /* total number of input bytes read so far */ + this.total_in = 0; + /* next output byte should be put there */ + this.output = null; // JS specific, because we have no pointers + this.next_out = 0; + /* remaining free space at output */ + this.avail_out = 0; + /* total number of bytes output so far */ + this.total_out = 0; + /* last error message, NULL if no error */ + this.msg = ''/*Z_NULL*/; + /* not visible by applications */ + this.state = null; + /* best guess about the data type: binary or text */ + this.data_type = 2/*Z_UNKNOWN*/; + /* adler32 value of the uncompressed data */ + this.adler = 0; +} + +module.exports = ZStream; + +},{}],"/lib/deflate.js":[function(require,module,exports){ +'use strict'; + + +var zlib_deflate = require('./zlib/deflate'); +var utils = require('./utils/common'); +var strings = require('./utils/strings'); +var msg = require('./zlib/messages'); +var ZStream = require('./zlib/zstream'); + +var toString = Object.prototype.toString; + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + +var Z_NO_FLUSH = 0; +var Z_FINISH = 4; + +var Z_OK = 0; +var Z_STREAM_END = 1; +var Z_SYNC_FLUSH = 2; + +var Z_DEFAULT_COMPRESSION = -1; + +var Z_DEFAULT_STRATEGY = 0; + +var Z_DEFLATED = 8; + +/* ===========================================================================*/ + + +/** + * class Deflate + * + * Generic JS-style wrapper for zlib calls. If you don't need + * streaming behaviour - use more simple functions: [[deflate]], + * [[deflateRaw]] and [[gzip]]. + **/ + +/* internal + * Deflate.chunks -> Array + * + * Chunks of output data, if [[Deflate#onData]] not overridden. + **/ + +/** + * Deflate.result -> Uint8Array|Array + * + * Compressed result, generated by default [[Deflate#onData]] + * and [[Deflate#onEnd]] handlers. Filled after you push last chunk + * (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you + * push a chunk with explicit flush (call [[Deflate#push]] with + * `Z_SYNC_FLUSH` param). + **/ + +/** + * Deflate.err -> Number + * + * Error code after deflate finished. 0 (Z_OK) on success. + * You will not need it in real life, because deflate errors + * are possible only on wrong options or bad `onData` / `onEnd` + * custom handlers. + **/ + +/** + * Deflate.msg -> String + * + * Error message, if [[Deflate.err]] != 0 + **/ + + +/** + * new Deflate(options) + * - options (Object): zlib deflate options. + * + * Creates new deflator instance with specified params. Throws exception + * on bad params. Supported options: + * + * - `level` + * - `windowBits` + * - `memLevel` + * - `strategy` + * - `dictionary` + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information on these. + * + * Additional options, for internal needs: + * + * - `chunkSize` - size of generated data chunks (16K by default) + * - `raw` (Boolean) - do raw deflate + * - `gzip` (Boolean) - create gzip wrapper + * - `to` (String) - if equal to 'string', then result will be "binary string" + * (each char code [0..255]) + * - `header` (Object) - custom header for gzip + * - `text` (Boolean) - true if compressed data believed to be text + * - `time` (Number) - modification time, unix timestamp + * - `os` (Number) - operation system code + * - `extra` (Array) - array of bytes with extra data (max 65536) + * - `name` (String) - file name (binary string) + * - `comment` (String) - comment (binary string) + * - `hcrc` (Boolean) - true if header crc should be added + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) + * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); + * + * var deflate = new pako.Deflate({ level: 3}); + * + * deflate.push(chunk1, false); + * deflate.push(chunk2, true); // true -> last chunk + * + * if (deflate.err) { throw new Error(deflate.err); } + * + * console.log(deflate.result); + * ``` + **/ +function Deflate(options) { + if (!(this instanceof Deflate)) return new Deflate(options); + + this.options = utils.assign({ + level: Z_DEFAULT_COMPRESSION, + method: Z_DEFLATED, + chunkSize: 16384, + windowBits: 15, + memLevel: 8, + strategy: Z_DEFAULT_STRATEGY, + to: '' + }, options || {}); + + var opt = this.options; + + if (opt.raw && (opt.windowBits > 0)) { + opt.windowBits = -opt.windowBits; + } + + else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) { + opt.windowBits += 16; + } + + this.err = 0; // error code, if happens (0 = Z_OK) + this.msg = ''; // error message + this.ended = false; // used to avoid multiple onEnd() calls + this.chunks = []; // chunks of compressed data + + this.strm = new ZStream(); + this.strm.avail_out = 0; + + var status = zlib_deflate.deflateInit2( + this.strm, + opt.level, + opt.method, + opt.windowBits, + opt.memLevel, + opt.strategy + ); + + if (status !== Z_OK) { + throw new Error(msg[status]); + } + + if (opt.header) { + zlib_deflate.deflateSetHeader(this.strm, opt.header); + } + + if (opt.dictionary) { + var dict; + // Convert data if needed + if (typeof opt.dictionary === 'string') { + // If we need to compress text, change encoding to utf8. + dict = strings.string2buf(opt.dictionary); + } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { + dict = new Uint8Array(opt.dictionary); + } else { + dict = opt.dictionary; + } + + status = zlib_deflate.deflateSetDictionary(this.strm, dict); + + if (status !== Z_OK) { + throw new Error(msg[status]); + } + + this._dict_set = true; + } +} + +/** + * Deflate#push(data[, mode]) -> Boolean + * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be + * converted to utf8 byte sequence. + * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. + * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH. + * + * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with + * new compressed chunks. Returns `true` on success. The last data block must have + * mode Z_FINISH (or `true`). That will flush internal pending buffers and call + * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you + * can use mode Z_SYNC_FLUSH, keeping the compression context. + * + * On fail call [[Deflate#onEnd]] with error code and return false. + * + * We strongly recommend to use `Uint8Array` on input for best speed (output + * array format is detected automatically). Also, don't skip last param and always + * use the same type in your code (boolean or number). That will improve JS speed. + * + * For regular `Array`-s make sure all elements are [0..255]. + * + * ##### Example + * + * ```javascript + * push(chunk, false); // push one of data chunks + * ... + * push(chunk, true); // push last chunk + * ``` + **/ +Deflate.prototype.push = function (data, mode) { + var strm = this.strm; + var chunkSize = this.options.chunkSize; + var status, _mode; + + if (this.ended) { return false; } + + _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH); + + // Convert data if needed + if (typeof data === 'string') { + // If we need to compress text, change encoding to utf8. + strm.input = strings.string2buf(data); + } else if (toString.call(data) === '[object ArrayBuffer]') { + strm.input = new Uint8Array(data); + } else { + strm.input = data; + } + + strm.next_in = 0; + strm.avail_in = strm.input.length; + + do { + if (strm.avail_out === 0) { + strm.output = new utils.Buf8(chunkSize); + strm.next_out = 0; + strm.avail_out = chunkSize; + } + status = zlib_deflate.deflate(strm, _mode); /* no bad return value */ + + if (status !== Z_STREAM_END && status !== Z_OK) { + this.onEnd(status); + this.ended = true; + return false; + } + if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) { + if (this.options.to === 'string') { + this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out))); + } else { + this.onData(utils.shrinkBuf(strm.output, strm.next_out)); + } + } + } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END); + + // Finalize on the last chunk. + if (_mode === Z_FINISH) { + status = zlib_deflate.deflateEnd(this.strm); + this.onEnd(status); + this.ended = true; + return status === Z_OK; + } + + // callback interim results if Z_SYNC_FLUSH. + if (_mode === Z_SYNC_FLUSH) { + this.onEnd(Z_OK); + strm.avail_out = 0; + return true; + } + + return true; +}; + + +/** + * Deflate#onData(chunk) -> Void + * - chunk (Uint8Array|Array|String): output data. Type of array depends + * on js engine support. When string output requested, each chunk + * will be string. + * + * By default, stores data blocks in `chunks[]` property and glue + * those in `onEnd`. Override this handler, if you need another behaviour. + **/ +Deflate.prototype.onData = function (chunk) { + this.chunks.push(chunk); +}; + + +/** + * Deflate#onEnd(status) -> Void + * - status (Number): deflate status. 0 (Z_OK) on success, + * other if not. + * + * Called once after you tell deflate that the input stream is + * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH) + * or if an error happened. By default - join collected chunks, + * free memory and fill `results` / `err` properties. + **/ +Deflate.prototype.onEnd = function (status) { + // On success - join + if (status === Z_OK) { + if (this.options.to === 'string') { + this.result = this.chunks.join(''); + } else { + this.result = utils.flattenChunks(this.chunks); + } + } + this.chunks = []; + this.err = status; + this.msg = this.strm.msg; +}; + + +/** + * deflate(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to compress. + * - options (Object): zlib deflate options. + * + * Compress `data` with deflate algorithm and `options`. + * + * Supported options are: + * + * - level + * - windowBits + * - memLevel + * - strategy + * - dictionary + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information on these. + * + * Sugar (options): + * + * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify + * negative windowBits implicitly. + * - `to` (String) - if equal to 'string', then result will be "binary string" + * (each char code [0..255]) + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , data = Uint8Array([1,2,3,4,5,6,7,8,9]); + * + * console.log(pako.deflate(data)); + * ``` + **/ +function deflate(input, options) { + var deflator = new Deflate(options); + + deflator.push(input, true); + + // That will never happens, if you don't cheat with options :) + if (deflator.err) { throw deflator.msg || msg[deflator.err]; } + + return deflator.result; +} + + +/** + * deflateRaw(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to compress. + * - options (Object): zlib deflate options. + * + * The same as [[deflate]], but creates raw data, without wrapper + * (header and adler32 crc). + **/ +function deflateRaw(input, options) { + options = options || {}; + options.raw = true; + return deflate(input, options); +} + + +/** + * gzip(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to compress. + * - options (Object): zlib deflate options. + * + * The same as [[deflate]], but create gzip wrapper instead of + * deflate one. + **/ +function gzip(input, options) { + options = options || {}; + options.gzip = true; + return deflate(input, options); +} + + +exports.Deflate = Deflate; +exports.deflate = deflate; +exports.deflateRaw = deflateRaw; +exports.gzip = gzip; + +},{"./utils/common":1,"./utils/strings":2,"./zlib/deflate":5,"./zlib/messages":6,"./zlib/zstream":8}]},{},[])("/lib/deflate.js") +}); \ No newline at end of file diff --git a/node_modules/pako/dist/pako_deflate.min.js b/node_modules/pako/dist/pako_deflate.min.js new file mode 100644 index 000000000..56e5c5433 --- /dev/null +++ b/node_modules/pako/dist/pako_deflate.min.js @@ -0,0 +1 @@ +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).pako=t()}}(function(){return function t(e,a,n){function r(s,h){if(!a[s]){if(!e[s]){var l="function"==typeof require&&require;if(!h&&l)return l(s,!0);if(i)return i(s,!0);var o=new Error("Cannot find module '"+s+"'");throw o.code="MODULE_NOT_FOUND",o}var _=a[s]={exports:{}};e[s][0].call(_.exports,function(t){var a=e[s][1][t];return r(a||t)},_,_.exports,t,e,a,n)}return a[s].exports}for(var i="function"==typeof require&&require,s=0;s=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1;h[254]=h[254]=1,a.string2buf=function(t){var e,a,n,i,s,h=t.length,l=0;for(i=0;i>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},a.buf2binstring=function(t){return n(t,t.length)},a.binstring2buf=function(t){for(var e=new r.Buf8(t.length),a=0,n=e.length;a4)o[r++]=65533,a+=s-1;else{for(i&=2===s?31:3===s?15:7;s>1&&a1?o[r++]=65533:i<65536?o[r++]=i:(i-=65536,o[r++]=55296|i>>10&1023,o[r++]=56320|1023&i)}return n(o,r)},a.utf8border=function(t,e){var a;for((e=e||t.length)>t.length&&(e=t.length),a=e-1;a>=0&&128==(192&t[a]);)a--;return a<0?e:0===a?e:a+h[t[a]]>e?a:e}},{"./common":1}],3:[function(t,e,a){"use strict";e.exports=function(t,e,a,n){for(var r=65535&t|0,i=t>>>16&65535|0,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16|0}},{}],4:[function(t,e,a){"use strict";var n=function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}();e.exports=function(t,e,a,r){var i=n,s=r+a;t^=-1;for(var h=r;h>>8^i[255&(t^e[h])];return-1^t}},{}],5:[function(t,e,a){"use strict";function n(t,e){return t.msg=S[e],e}function r(t){return(t<<1)-(t>4?9:0)}function i(t){for(var e=t.length;--e>=0;)t[e]=0}function s(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(x.arraySet(t.output,e.pending_buf,e.pending_out,a,t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))}function h(t,e){B._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,s(t.strm)}function l(t,e){t.pending_buf[t.pending++]=e}function o(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function _(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,x.arraySet(e,t.input,t.next_in,r,a),1===t.state.wrap?t.adler=A(t.adler,e,r,a):2===t.state.wrap&&(t.adler=C(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)}function d(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-nt?t.strstart-(t.w_size-nt):0,o=t.window,_=t.w_mask,d=t.prev,u=t.strstart+at,f=o[i+s-1],c=o[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(a=e,o[a+s]===c&&o[a+s-1]===f&&o[a]===o[i]&&o[++a]===o[i+1]){i+=2,a++;do{}while(o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&is){if(t.match_start=e,s=n,n>=h)break;f=o[i+s-1],c=o[i+s]}}}while((e=d[e&_])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead}function u(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-nt)){x.arraySet(t.window,t.window,s,s,0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=_(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=et)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=(t.ins_h<=et&&(t.ins_h=(t.ins_h<=et)if(n=B._tr_tally(t,t.strstart-t.match_start,t.match_length-et),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=et){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<=et&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=et-1)),t.prev_length>=et&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-et,n=B._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-et),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=(t.ins_h<=et&&t.strstart>0&&(r=t.strstart-1,(n=s[r])===s[++r]&&n===s[++r]&&n===s[++r])){i=t.strstart+at;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&rt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=et?(a=B._tr_tally(t,1,t.match_length-et),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=B._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(h(t,!1),0===t.strm.avail_out))return ut}return t.insert=0,e===D?(h(t,!0),0===t.strm.avail_out?ct:pt):t.last_lit&&(h(t,!1),0===t.strm.avail_out)?ut:ft}function g(t,e){for(var a;;){if(0===t.lookahead&&(u(t),0===t.lookahead)){if(e===j)return ut;break}if(t.match_length=0,a=B._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(h(t,!1),0===t.strm.avail_out))return ut}return t.insert=0,e===D?(h(t,!0),0===t.strm.avail_out?ct:pt):t.last_lit&&(h(t,!1),0===t.strm.avail_out)?ut:ft}function m(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}function b(t){t.window_size=2*t.w_size,i(t.head),t.max_lazy_match=z[t.level].max_lazy,t.good_match=z[t.level].good_length,t.nice_match=z[t.level].nice_length,t.max_chain_length=z[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=et-1,t.match_available=0,t.ins_h=0}function w(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=J,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new x.Buf16(2*$),this.dyn_dtree=new x.Buf16(2*(2*Y+1)),this.bl_tree=new x.Buf16(2*(2*Z+1)),i(this.dyn_ltree),i(this.dyn_dtree),i(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new x.Buf16(tt+1),this.heap=new x.Buf16(2*X+1),i(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new x.Buf16(2*X+1),i(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function v(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=G,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?it:_t,t.adler=2===e.wrap?0:1,e.last_flush=j,B._tr_init(e),O):n(t,T)}function y(t){var e=v(t);return e===O&&b(t.state),e}function k(t,e,a,r,i,s){if(!t)return T;var h=1;if(e===R&&(e=6),r<0?(h=0,r=-r):r>15&&(h=2,r-=16),i<1||i>Q||a!==J||r<8||r>15||e<0||e>9||s<0||s>M)return n(t,T);8===r&&(r=9);var l=new w;return t.state=l,l.strm=t,l.wrap=h,l.gzhead=null,l.w_bits=r,l.w_size=1<t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(u(t),0===t.lookahead&&e===j)return ut;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,h(t,!1),0===t.strm.avail_out))return ut;if(t.strstart-t.block_start>=t.w_size-nt&&(h(t,!1),0===t.strm.avail_out))return ut}return t.insert=0,e===D?(h(t,!0),0===t.strm.avail_out?ct:pt):(t.strstart>t.block_start&&(h(t,!1),t.strm.avail_out),ut)}),new m(4,4,8,4,f),new m(4,5,16,8,f),new m(4,6,32,32,f),new m(4,4,16,16,c),new m(8,16,32,32,c),new m(8,16,128,128,c),new m(8,32,128,256,c),new m(32,128,258,1024,c),new m(32,258,258,4096,c)],a.deflateInit=function(t,e){return k(t,e,J,V,W,P)},a.deflateInit2=k,a.deflateReset=y,a.deflateResetKeep=v,a.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?T:(t.state.gzhead=e,O):T},a.deflate=function(t,e){var a,h,_,d;if(!t||!t.state||e>I||e<0)return t?n(t,T):T;if(h=t.state,!t.output||!t.input&&0!==t.avail_in||h.status===dt&&e!==D)return n(t,0===t.avail_out?N:T);if(h.strm=t,a=h.last_flush,h.last_flush=e,h.status===it)if(2===h.wrap)t.adler=0,l(h,31),l(h,139),l(h,8),h.gzhead?(l(h,(h.gzhead.text?1:0)+(h.gzhead.hcrc?2:0)+(h.gzhead.extra?4:0)+(h.gzhead.name?8:0)+(h.gzhead.comment?16:0)),l(h,255&h.gzhead.time),l(h,h.gzhead.time>>8&255),l(h,h.gzhead.time>>16&255),l(h,h.gzhead.time>>24&255),l(h,9===h.level?2:h.strategy>=F||h.level<2?4:0),l(h,255&h.gzhead.os),h.gzhead.extra&&h.gzhead.extra.length&&(l(h,255&h.gzhead.extra.length),l(h,h.gzhead.extra.length>>8&255)),h.gzhead.hcrc&&(t.adler=C(t.adler,h.pending_buf,h.pending,0)),h.gzindex=0,h.status=st):(l(h,0),l(h,0),l(h,0),l(h,0),l(h,0),l(h,9===h.level?2:h.strategy>=F||h.level<2?4:0),l(h,gt),h.status=_t);else{var u=J+(h.w_bits-8<<4)<<8;u|=(h.strategy>=F||h.level<2?0:h.level<6?1:6===h.level?2:3)<<6,0!==h.strstart&&(u|=rt),u+=31-u%31,h.status=_t,o(h,u),0!==h.strstart&&(o(h,t.adler>>>16),o(h,65535&t.adler)),t.adler=1}if(h.status===st)if(h.gzhead.extra){for(_=h.pending;h.gzindex<(65535&h.gzhead.extra.length)&&(h.pending!==h.pending_buf_size||(h.gzhead.hcrc&&h.pending>_&&(t.adler=C(t.adler,h.pending_buf,h.pending-_,_)),s(t),_=h.pending,h.pending!==h.pending_buf_size));)l(h,255&h.gzhead.extra[h.gzindex]),h.gzindex++;h.gzhead.hcrc&&h.pending>_&&(t.adler=C(t.adler,h.pending_buf,h.pending-_,_)),h.gzindex===h.gzhead.extra.length&&(h.gzindex=0,h.status=ht)}else h.status=ht;if(h.status===ht)if(h.gzhead.name){_=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>_&&(t.adler=C(t.adler,h.pending_buf,h.pending-_,_)),s(t),_=h.pending,h.pending===h.pending_buf_size)){d=1;break}d=h.gzindex_&&(t.adler=C(t.adler,h.pending_buf,h.pending-_,_)),0===d&&(h.gzindex=0,h.status=lt)}else h.status=lt;if(h.status===lt)if(h.gzhead.comment){_=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>_&&(t.adler=C(t.adler,h.pending_buf,h.pending-_,_)),s(t),_=h.pending,h.pending===h.pending_buf_size)){d=1;break}d=h.gzindex_&&(t.adler=C(t.adler,h.pending_buf,h.pending-_,_)),0===d&&(h.status=ot)}else h.status=ot;if(h.status===ot&&(h.gzhead.hcrc?(h.pending+2>h.pending_buf_size&&s(t),h.pending+2<=h.pending_buf_size&&(l(h,255&t.adler),l(h,t.adler>>8&255),t.adler=0,h.status=_t)):h.status=_t),0!==h.pending){if(s(t),0===t.avail_out)return h.last_flush=-1,O}else if(0===t.avail_in&&r(e)<=r(a)&&e!==D)return n(t,N);if(h.status===dt&&0!==t.avail_in)return n(t,N);if(0!==t.avail_in||0!==h.lookahead||e!==j&&h.status!==dt){var f=h.strategy===F?g(h,e):h.strategy===K?p(h,e):z[h.level].func(h,e);if(f!==ct&&f!==pt||(h.status=dt),f===ut||f===ct)return 0===t.avail_out&&(h.last_flush=-1),O;if(f===ft&&(e===E?B._tr_align(h):e!==I&&(B._tr_stored_block(h,0,0,!1),e===U&&(i(h.head),0===h.lookahead&&(h.strstart=0,h.block_start=0,h.insert=0))),s(t),0===t.avail_out))return h.last_flush=-1,O}return e!==D?O:h.wrap<=0?q:(2===h.wrap?(l(h,255&t.adler),l(h,t.adler>>8&255),l(h,t.adler>>16&255),l(h,t.adler>>24&255),l(h,255&t.total_in),l(h,t.total_in>>8&255),l(h,t.total_in>>16&255),l(h,t.total_in>>24&255)):(o(h,t.adler>>>16),o(h,65535&t.adler)),s(t),h.wrap>0&&(h.wrap=-h.wrap),0!==h.pending?O:q)},a.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==it&&e!==st&&e!==ht&&e!==lt&&e!==ot&&e!==_t&&e!==dt?n(t,T):(t.state=null,e===_t?n(t,L):O):T},a.deflateSetDictionary=function(t,e){var a,n,r,s,h,l,o,_,d=e.length;if(!t||!t.state)return T;if(a=t.state,2===(s=a.wrap)||1===s&&a.status!==it||a.lookahead)return T;for(1===s&&(t.adler=A(t.adler,e,d,0)),a.wrap=0,d>=a.w_size&&(0===s&&(i(a.head),a.strstart=0,a.block_start=0,a.insert=0),_=new x.Buf8(a.w_size),x.arraySet(_,e,d-a.w_size,a.w_size,0),e=_,d=a.w_size),h=t.avail_in,l=t.next_in,o=t.input,t.avail_in=d,t.next_in=0,t.input=e,u(a);a.lookahead>=et;){n=a.strstart,r=a.lookahead-(et-1);do{a.ins_h=(a.ins_h<=0;)t[e]=0}function r(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function i(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function s(t){return t<256?et[t]:et[256+(t>>>7)]}function h(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function l(t,e,a){t.bi_valid>M-a?(t.bi_buf|=e<>M-t.bi_valid,t.bi_valid+=a-M):(t.bi_buf|=e<>>=1,a<<=1}while(--e>0);return a>>>1}function d(t){16===t.bi_valid?(h(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function u(t,e){var a,n,r,i,s,h,l=e.dyn_tree,o=e.max_code,_=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=K;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;ac&&(i=c,p++),l[2*n+1]=i,n>o||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(_[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>o||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}function f(t,e,a){var n,r,i=new Array(K+1),s=0;for(n=1;n<=K;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=_(i[h]++,h))}}function c(){var t,e,a,n,i,s=new Array(K+1);for(a=0,n=0;n>=7;n8?h(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function m(t,e,a,n){g(t),n&&(h(t,a),h(t,~a)),S.arraySet(t.pending_buf,t.window,e,a,t.pending),t.pending+=a}function b(t,e,a,n){var r=2*e,i=2*a;return t[r]>1;a>=1;a--)w(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],w(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,w(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],u(t,e),f(i,o,t.bl_count)}function k(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,o=4;for(0===s&&(l=138,o=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h=3&&0===t.bl_tree[2*Z[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function B(t,e,a,n){var r;for(l(t,e-257,5),l(t,a-1,5),l(t,n-4,4),r=0;r>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return E;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return U;for(e=32;e0?(t.strm.data_type===D&&(t.strm.data_type=A(t)),y(t,t.l_desc),y(t,t.d_desc),s=x(t),r=t.opt_len+3+7>>>3,(i=t.static_len+3+7>>>3)<=r&&(r=i)):r=i=a+5,a+4<=r&&-1!==e?C(t,e,a,n):t.strategy===j||i===r?(l(t,(O<<1)+(n?1:0),3),v(t,$,tt)):(l(t,(q<<1)+(n?1:0),3),B(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),v(t,t.dyn_ltree,t.dyn_dtree)),p(t),n&&g(t)},a._tr_tally=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(at[a]+L+1)]++,t.dyn_dtree[2*s(e)]++),t.last_lit===t.lit_bufsize-1},a._tr_align=function(t){l(t,O<<1,3),o(t,G,$),d(t)}},{"../utils/common":1}],8:[function(t,e,a){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/lib/deflate.js":[function(t,e,a){"use strict";function n(t){if(!(this instanceof n))return new n(t);this.options=s.assign({level:u,method:c,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var a=i.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==d)throw new Error(l[a]);if(e.header&&i.deflateSetHeader(this.strm,e.header),e.dictionary){var r;if(r="string"==typeof e.dictionary?h.string2buf(e.dictionary):"[object ArrayBuffer]"===_.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(a=i.deflateSetDictionary(this.strm,r))!==d)throw new Error(l[a]);this._dict_set=!0}}function r(t,e){var a=new n(e);if(a.push(t,!0),a.err)throw a.msg||l[a.err];return a.result}var i=t("./zlib/deflate"),s=t("./utils/common"),h=t("./utils/strings"),l=t("./zlib/messages"),o=t("./zlib/zstream"),_=Object.prototype.toString,d=0,u=-1,f=0,c=8;n.prototype.push=function(t,e){var a,n,r=this.strm,l=this.options.chunkSize;if(this.ended)return!1;n=e===~~e?e:!0===e?4:0,"string"==typeof t?r.input=h.string2buf(t):"[object ArrayBuffer]"===_.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(0===r.avail_out&&(r.output=new s.Buf8(l),r.next_out=0,r.avail_out=l),1!==(a=i.deflate(r,n))&&a!==d)return this.onEnd(a),this.ended=!0,!1;0!==r.avail_out&&(0!==r.avail_in||4!==n&&2!==n)||("string"===this.options.to?this.onData(h.buf2binstring(s.shrinkBuf(r.output,r.next_out))):this.onData(s.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||0===r.avail_out)&&1!==a);return 4===n?(a=i.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===d):2!==n||(this.onEnd(d),r.avail_out=0,!0)},n.prototype.onData=function(t){this.chunks.push(t)},n.prototype.onEnd=function(t){t===d&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},a.Deflate=n,a.deflate=r,a.deflateRaw=function(t,e){return e=e||{},e.raw=!0,r(t,e)},a.gzip=function(t,e){return e=e||{},e.gzip=!0,r(t,e)}},{"./utils/common":1,"./utils/strings":2,"./zlib/deflate":5,"./zlib/messages":6,"./zlib/zstream":8}]},{},[])("/lib/deflate.js")}); diff --git a/node_modules/pako/dist/pako_inflate.js b/node_modules/pako/dist/pako_inflate.js new file mode 100644 index 000000000..343c7c800 --- /dev/null +++ b/node_modules/pako/dist/pako_inflate.js @@ -0,0 +1,3293 @@ +/* pako 1.0.6 nodeca/pako */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.pako = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1); +} +_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start + + +// convert string to array (typed, when possible) +exports.string2buf = function (str) { + var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; + + // count binary size + for (m_pos = 0; m_pos < str_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4; + } + + // allocate buffer + buf = new utils.Buf8(buf_len); + + // convert + for (i = 0, m_pos = 0; i < buf_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + if (c < 0x80) { + /* one byte */ + buf[i++] = c; + } else if (c < 0x800) { + /* two bytes */ + buf[i++] = 0xC0 | (c >>> 6); + buf[i++] = 0x80 | (c & 0x3f); + } else if (c < 0x10000) { + /* three bytes */ + buf[i++] = 0xE0 | (c >>> 12); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } else { + /* four bytes */ + buf[i++] = 0xf0 | (c >>> 18); + buf[i++] = 0x80 | (c >>> 12 & 0x3f); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } + } + + return buf; +}; + +// Helper (used in 2 places) +function buf2binstring(buf, len) { + // use fallback for big arrays to avoid stack overflow + if (len < 65537) { + if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) { + return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len)); + } + } + + var result = ''; + for (var i = 0; i < len; i++) { + result += String.fromCharCode(buf[i]); + } + return result; +} + + +// Convert byte array to binary string +exports.buf2binstring = function (buf) { + return buf2binstring(buf, buf.length); +}; + + +// Convert binary string (typed, when possible) +exports.binstring2buf = function (str) { + var buf = new utils.Buf8(str.length); + for (var i = 0, len = buf.length; i < len; i++) { + buf[i] = str.charCodeAt(i); + } + return buf; +}; + + +// convert array to string +exports.buf2string = function (buf, max) { + var i, out, c, c_len; + var len = max || buf.length; + + // Reserve max possible length (2 words per char) + // NB: by unknown reasons, Array is significantly faster for + // String.fromCharCode.apply than Uint16Array. + var utf16buf = new Array(len * 2); + + for (out = 0, i = 0; i < len;) { + c = buf[i++]; + // quick process ascii + if (c < 0x80) { utf16buf[out++] = c; continue; } + + c_len = _utf8len[c]; + // skip 5 & 6 byte codes + if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; } + + // apply mask on first byte + c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07; + // join the rest + while (c_len > 1 && i < len) { + c = (c << 6) | (buf[i++] & 0x3f); + c_len--; + } + + // terminated by end of string? + if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; } + + if (c < 0x10000) { + utf16buf[out++] = c; + } else { + c -= 0x10000; + utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff); + utf16buf[out++] = 0xdc00 | (c & 0x3ff); + } + } + + return buf2binstring(utf16buf, out); +}; + + +// Calculate max possible position in utf8 buffer, +// that will not break sequence. If that's not possible +// - (very small limits) return max size as is. +// +// buf[] - utf8 bytes array +// max - length limit (mandatory); +exports.utf8border = function (buf, max) { + var pos; + + max = max || buf.length; + if (max > buf.length) { max = buf.length; } + + // go back from last position, until start of sequence found + pos = max - 1; + while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; } + + // Very small and broken sequence, + // return max, because we should return something anyway. + if (pos < 0) { return max; } + + // If we came to start of buffer - that means buffer is too small, + // return max too. + if (pos === 0) { return max; } + + return (pos + _utf8len[buf[pos]] > max) ? pos : max; +}; + +},{"./common":1}],3:[function(require,module,exports){ +'use strict'; + +// Note: adler32 takes 12% for level 0 and 2% for level 6. +// It isn't worth it to make additional optimizations as in original. +// Small size is preferable. + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +function adler32(adler, buf, len, pos) { + var s1 = (adler & 0xffff) |0, + s2 = ((adler >>> 16) & 0xffff) |0, + n = 0; + + while (len !== 0) { + // Set limit ~ twice less than 5552, to keep + // s2 in 31-bits, because we force signed ints. + // in other case %= will fail. + n = len > 2000 ? 2000 : len; + len -= n; + + do { + s1 = (s1 + buf[pos++]) |0; + s2 = (s2 + s1) |0; + } while (--n); + + s1 %= 65521; + s2 %= 65521; + } + + return (s1 | (s2 << 16)) |0; +} + + +module.exports = adler32; + +},{}],4:[function(require,module,exports){ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +module.exports = { + + /* Allowed flush values; see deflate() and inflate() below for details */ + Z_NO_FLUSH: 0, + Z_PARTIAL_FLUSH: 1, + Z_SYNC_FLUSH: 2, + Z_FULL_FLUSH: 3, + Z_FINISH: 4, + Z_BLOCK: 5, + Z_TREES: 6, + + /* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ + Z_OK: 0, + Z_STREAM_END: 1, + Z_NEED_DICT: 2, + Z_ERRNO: -1, + Z_STREAM_ERROR: -2, + Z_DATA_ERROR: -3, + //Z_MEM_ERROR: -4, + Z_BUF_ERROR: -5, + //Z_VERSION_ERROR: -6, + + /* compression levels */ + Z_NO_COMPRESSION: 0, + Z_BEST_SPEED: 1, + Z_BEST_COMPRESSION: 9, + Z_DEFAULT_COMPRESSION: -1, + + + Z_FILTERED: 1, + Z_HUFFMAN_ONLY: 2, + Z_RLE: 3, + Z_FIXED: 4, + Z_DEFAULT_STRATEGY: 0, + + /* Possible values of the data_type field (though see inflate()) */ + Z_BINARY: 0, + Z_TEXT: 1, + //Z_ASCII: 1, // = Z_TEXT (deprecated) + Z_UNKNOWN: 2, + + /* The deflate compression method */ + Z_DEFLATED: 8 + //Z_NULL: null // Use -1 or null inline, depending on var type +}; + +},{}],5:[function(require,module,exports){ +'use strict'; + +// Note: we can't get significant speed boost here. +// So write code to minimize size - no pregenerated tables +// and array tools dependencies. + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +// Use ordinary array, since untyped makes no boost here +function makeTable() { + var c, table = []; + + for (var n = 0; n < 256; n++) { + c = n; + for (var k = 0; k < 8; k++) { + c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); + } + table[n] = c; + } + + return table; +} + +// Create table on load. Just 255 signed longs. Not a problem. +var crcTable = makeTable(); + + +function crc32(crc, buf, len, pos) { + var t = crcTable, + end = pos + len; + + crc ^= -1; + + for (var i = pos; i < end; i++) { + crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF]; + } + + return (crc ^ (-1)); // >>> 0; +} + + +module.exports = crc32; + +},{}],6:[function(require,module,exports){ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +function GZheader() { + /* true if compressed data believed to be text */ + this.text = 0; + /* modification time */ + this.time = 0; + /* extra flags (not used when writing a gzip file) */ + this.xflags = 0; + /* operating system */ + this.os = 0; + /* pointer to extra field or Z_NULL if none */ + this.extra = null; + /* extra field length (valid if extra != Z_NULL) */ + this.extra_len = 0; // Actually, we don't need it in JS, + // but leave for few code modifications + + // + // Setup limits is not necessary because in js we should not preallocate memory + // for inflate use constant limit in 65536 bytes + // + + /* space at extra (only when reading header) */ + // this.extra_max = 0; + /* pointer to zero-terminated file name or Z_NULL */ + this.name = ''; + /* space at name (only when reading header) */ + // this.name_max = 0; + /* pointer to zero-terminated comment or Z_NULL */ + this.comment = ''; + /* space at comment (only when reading header) */ + // this.comm_max = 0; + /* true if there was or will be a header crc */ + this.hcrc = 0; + /* true when done reading gzip header (not used when writing a gzip file) */ + this.done = false; +} + +module.exports = GZheader; + +},{}],7:[function(require,module,exports){ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +// See state defs from inflate.js +var BAD = 30; /* got a data error -- remain here until reset */ +var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ + +/* + Decode literal, length, and distance codes and write out the resulting + literal and match bytes until either not enough input or output is + available, an end-of-block is encountered, or a data error is encountered. + When large enough input and output buffers are supplied to inflate(), for + example, a 16K input buffer and a 64K output buffer, more than 95% of the + inflate execution time is spent in this routine. + + Entry assumptions: + + state.mode === LEN + strm.avail_in >= 6 + strm.avail_out >= 258 + start >= strm.avail_out + state.bits < 8 + + On return, state.mode is one of: + + LEN -- ran out of enough output space or enough available input + TYPE -- reached end of block code, inflate() to interpret next block + BAD -- error in block data + + Notes: + + - The maximum input bits used by a length/distance pair is 15 bits for the + length code, 5 bits for the length extra, 15 bits for the distance code, + and 13 bits for the distance extra. This totals 48 bits, or six bytes. + Therefore if strm.avail_in >= 6, then there is enough input to avoid + checking for available input while decoding. + + - The maximum bytes that a single length/distance pair can output is 258 + bytes, which is the maximum length that can be coded. inflate_fast() + requires strm.avail_out >= 258 for each loop to avoid checking for + output space. + */ +module.exports = function inflate_fast(strm, start) { + var state; + var _in; /* local strm.input */ + var last; /* have enough input while in < last */ + var _out; /* local strm.output */ + var beg; /* inflate()'s initial strm.output */ + var end; /* while out < end, enough space available */ +//#ifdef INFLATE_STRICT + var dmax; /* maximum distance from zlib header */ +//#endif + var wsize; /* window size or zero if not using window */ + var whave; /* valid bytes in the window */ + var wnext; /* window write index */ + // Use `s_window` instead `window`, avoid conflict with instrumentation tools + var s_window; /* allocated sliding window, if wsize != 0 */ + var hold; /* local strm.hold */ + var bits; /* local strm.bits */ + var lcode; /* local strm.lencode */ + var dcode; /* local strm.distcode */ + var lmask; /* mask for first level of length codes */ + var dmask; /* mask for first level of distance codes */ + var here; /* retrieved table entry */ + var op; /* code bits, operation, extra bits, or */ + /* window position, window bytes to copy */ + var len; /* match length, unused bytes */ + var dist; /* match distance */ + var from; /* where to copy match from */ + var from_source; + + + var input, output; // JS specific, because we have no pointers + + /* copy state to local variables */ + state = strm.state; + //here = state.here; + _in = strm.next_in; + input = strm.input; + last = _in + (strm.avail_in - 5); + _out = strm.next_out; + output = strm.output; + beg = _out - (start - strm.avail_out); + end = _out + (strm.avail_out - 257); +//#ifdef INFLATE_STRICT + dmax = state.dmax; +//#endif + wsize = state.wsize; + whave = state.whave; + wnext = state.wnext; + s_window = state.window; + hold = state.hold; + bits = state.bits; + lcode = state.lencode; + dcode = state.distcode; + lmask = (1 << state.lenbits) - 1; + dmask = (1 << state.distbits) - 1; + + + /* decode literals and length/distances until end-of-block or not enough + input data or output space */ + + top: + do { + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + + here = lcode[hold & lmask]; + + dolen: + for (;;) { // Goto emulation + op = here >>> 24/*here.bits*/; + hold >>>= op; + bits -= op; + op = (here >>> 16) & 0xff/*here.op*/; + if (op === 0) { /* literal */ + //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? + // "inflate: literal '%c'\n" : + // "inflate: literal 0x%02x\n", here.val)); + output[_out++] = here & 0xffff/*here.val*/; + } + else if (op & 16) { /* length base */ + len = here & 0xffff/*here.val*/; + op &= 15; /* number of extra bits */ + if (op) { + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + len += hold & ((1 << op) - 1); + hold >>>= op; + bits -= op; + } + //Tracevv((stderr, "inflate: length %u\n", len)); + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + here = dcode[hold & dmask]; + + dodist: + for (;;) { // goto emulation + op = here >>> 24/*here.bits*/; + hold >>>= op; + bits -= op; + op = (here >>> 16) & 0xff/*here.op*/; + + if (op & 16) { /* distance base */ + dist = here & 0xffff/*here.val*/; + op &= 15; /* number of extra bits */ + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + } + dist += hold & ((1 << op) - 1); +//#ifdef INFLATE_STRICT + if (dist > dmax) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break top; + } +//#endif + hold >>>= op; + bits -= op; + //Tracevv((stderr, "inflate: distance %u\n", dist)); + op = _out - beg; /* max distance in output */ + if (dist > op) { /* see if copy from window */ + op = dist - op; /* distance back in window */ + if (op > whave) { + if (state.sane) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break top; + } + +// (!) This block is disabled in zlib defaults, +// don't enable it for binary compatibility +//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR +// if (len <= op - whave) { +// do { +// output[_out++] = 0; +// } while (--len); +// continue top; +// } +// len -= op - whave; +// do { +// output[_out++] = 0; +// } while (--op > whave); +// if (op === 0) { +// from = _out - dist; +// do { +// output[_out++] = output[from++]; +// } while (--len); +// continue top; +// } +//#endif + } + from = 0; // window index + from_source = s_window; + if (wnext === 0) { /* very common case */ + from += wsize - op; + if (op < len) { /* some from window */ + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + else if (wnext < op) { /* wrap around window */ + from += wsize + wnext - op; + op -= wnext; + if (op < len) { /* some from end of window */ + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = 0; + if (wnext < len) { /* some from start of window */ + op = wnext; + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + } + else { /* contiguous in window */ + from += wnext - op; + if (op < len) { /* some from window */ + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + while (len > 2) { + output[_out++] = from_source[from++]; + output[_out++] = from_source[from++]; + output[_out++] = from_source[from++]; + len -= 3; + } + if (len) { + output[_out++] = from_source[from++]; + if (len > 1) { + output[_out++] = from_source[from++]; + } + } + } + else { + from = _out - dist; /* copy direct from output */ + do { /* minimum length is three */ + output[_out++] = output[from++]; + output[_out++] = output[from++]; + output[_out++] = output[from++]; + len -= 3; + } while (len > 2); + if (len) { + output[_out++] = output[from++]; + if (len > 1) { + output[_out++] = output[from++]; + } + } + } + } + else if ((op & 64) === 0) { /* 2nd level distance code */ + here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; + continue dodist; + } + else { + strm.msg = 'invalid distance code'; + state.mode = BAD; + break top; + } + + break; // need to emulate goto via "continue" + } + } + else if ((op & 64) === 0) { /* 2nd level length code */ + here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; + continue dolen; + } + else if (op & 32) { /* end-of-block */ + //Tracevv((stderr, "inflate: end of block\n")); + state.mode = TYPE; + break top; + } + else { + strm.msg = 'invalid literal/length code'; + state.mode = BAD; + break top; + } + + break; // need to emulate goto via "continue" + } + } while (_in < last && _out < end); + + /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ + len = bits >> 3; + _in -= len; + bits -= len << 3; + hold &= (1 << bits) - 1; + + /* update state and return */ + strm.next_in = _in; + strm.next_out = _out; + strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last)); + strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end)); + state.hold = hold; + state.bits = bits; + return; +}; + +},{}],8:[function(require,module,exports){ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +var utils = require('../utils/common'); +var adler32 = require('./adler32'); +var crc32 = require('./crc32'); +var inflate_fast = require('./inffast'); +var inflate_table = require('./inftrees'); + +var CODES = 0; +var LENS = 1; +var DISTS = 2; + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + + +/* Allowed flush values; see deflate() and inflate() below for details */ +//var Z_NO_FLUSH = 0; +//var Z_PARTIAL_FLUSH = 1; +//var Z_SYNC_FLUSH = 2; +//var Z_FULL_FLUSH = 3; +var Z_FINISH = 4; +var Z_BLOCK = 5; +var Z_TREES = 6; + + +/* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ +var Z_OK = 0; +var Z_STREAM_END = 1; +var Z_NEED_DICT = 2; +//var Z_ERRNO = -1; +var Z_STREAM_ERROR = -2; +var Z_DATA_ERROR = -3; +var Z_MEM_ERROR = -4; +var Z_BUF_ERROR = -5; +//var Z_VERSION_ERROR = -6; + +/* The deflate compression method */ +var Z_DEFLATED = 8; + + +/* STATES ====================================================================*/ +/* ===========================================================================*/ + + +var HEAD = 1; /* i: waiting for magic header */ +var FLAGS = 2; /* i: waiting for method and flags (gzip) */ +var TIME = 3; /* i: waiting for modification time (gzip) */ +var OS = 4; /* i: waiting for extra flags and operating system (gzip) */ +var EXLEN = 5; /* i: waiting for extra length (gzip) */ +var EXTRA = 6; /* i: waiting for extra bytes (gzip) */ +var NAME = 7; /* i: waiting for end of file name (gzip) */ +var COMMENT = 8; /* i: waiting for end of comment (gzip) */ +var HCRC = 9; /* i: waiting for header crc (gzip) */ +var DICTID = 10; /* i: waiting for dictionary check value */ +var DICT = 11; /* waiting for inflateSetDictionary() call */ +var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ +var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */ +var STORED = 14; /* i: waiting for stored size (length and complement) */ +var COPY_ = 15; /* i/o: same as COPY below, but only first time in */ +var COPY = 16; /* i/o: waiting for input or output to copy stored block */ +var TABLE = 17; /* i: waiting for dynamic block table lengths */ +var LENLENS = 18; /* i: waiting for code length code lengths */ +var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */ +var LEN_ = 20; /* i: same as LEN below, but only first time in */ +var LEN = 21; /* i: waiting for length/lit/eob code */ +var LENEXT = 22; /* i: waiting for length extra bits */ +var DIST = 23; /* i: waiting for distance code */ +var DISTEXT = 24; /* i: waiting for distance extra bits */ +var MATCH = 25; /* o: waiting for output space to copy string */ +var LIT = 26; /* o: waiting for output space to write literal */ +var CHECK = 27; /* i: waiting for 32-bit check value */ +var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */ +var DONE = 29; /* finished check, done -- remain here until reset */ +var BAD = 30; /* got a data error -- remain here until reset */ +var MEM = 31; /* got an inflate() memory error -- remain here until reset */ +var SYNC = 32; /* looking for synchronization bytes to restart inflate() */ + +/* ===========================================================================*/ + + + +var ENOUGH_LENS = 852; +var ENOUGH_DISTS = 592; +//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); + +var MAX_WBITS = 15; +/* 32K LZ77 window */ +var DEF_WBITS = MAX_WBITS; + + +function zswap32(q) { + return (((q >>> 24) & 0xff) + + ((q >>> 8) & 0xff00) + + ((q & 0xff00) << 8) + + ((q & 0xff) << 24)); +} + + +function InflateState() { + this.mode = 0; /* current inflate mode */ + this.last = false; /* true if processing last block */ + this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ + this.havedict = false; /* true if dictionary provided */ + this.flags = 0; /* gzip header method and flags (0 if zlib) */ + this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */ + this.check = 0; /* protected copy of check value */ + this.total = 0; /* protected copy of output count */ + // TODO: may be {} + this.head = null; /* where to save gzip header information */ + + /* sliding window */ + this.wbits = 0; /* log base 2 of requested window size */ + this.wsize = 0; /* window size or zero if not using window */ + this.whave = 0; /* valid bytes in the window */ + this.wnext = 0; /* window write index */ + this.window = null; /* allocated sliding window, if needed */ + + /* bit accumulator */ + this.hold = 0; /* input bit accumulator */ + this.bits = 0; /* number of bits in "in" */ + + /* for string and stored block copying */ + this.length = 0; /* literal or length of data to copy */ + this.offset = 0; /* distance back to copy string from */ + + /* for table and code decoding */ + this.extra = 0; /* extra bits needed */ + + /* fixed and dynamic code tables */ + this.lencode = null; /* starting table for length/literal codes */ + this.distcode = null; /* starting table for distance codes */ + this.lenbits = 0; /* index bits for lencode */ + this.distbits = 0; /* index bits for distcode */ + + /* dynamic table building */ + this.ncode = 0; /* number of code length code lengths */ + this.nlen = 0; /* number of length code lengths */ + this.ndist = 0; /* number of distance code lengths */ + this.have = 0; /* number of code lengths in lens[] */ + this.next = null; /* next available space in codes[] */ + + this.lens = new utils.Buf16(320); /* temporary storage for code lengths */ + this.work = new utils.Buf16(288); /* work area for code table building */ + + /* + because we don't have pointers in js, we use lencode and distcode directly + as buffers so we don't need codes + */ + //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */ + this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */ + this.distdyn = null; /* dynamic table for distance codes (JS specific) */ + this.sane = 0; /* if false, allow invalid distance too far */ + this.back = 0; /* bits back of last unprocessed length/lit */ + this.was = 0; /* initial length of match */ +} + +function inflateResetKeep(strm) { + var state; + + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + strm.total_in = strm.total_out = state.total = 0; + strm.msg = ''; /*Z_NULL*/ + if (state.wrap) { /* to support ill-conceived Java test suite */ + strm.adler = state.wrap & 1; + } + state.mode = HEAD; + state.last = 0; + state.havedict = 0; + state.dmax = 32768; + state.head = null/*Z_NULL*/; + state.hold = 0; + state.bits = 0; + //state.lencode = state.distcode = state.next = state.codes; + state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS); + state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS); + + state.sane = 1; + state.back = -1; + //Tracev((stderr, "inflate: reset\n")); + return Z_OK; +} + +function inflateReset(strm) { + var state; + + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + state.wsize = 0; + state.whave = 0; + state.wnext = 0; + return inflateResetKeep(strm); + +} + +function inflateReset2(strm, windowBits) { + var wrap; + var state; + + /* get the state */ + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + + /* extract wrap request from windowBits parameter */ + if (windowBits < 0) { + wrap = 0; + windowBits = -windowBits; + } + else { + wrap = (windowBits >> 4) + 1; + if (windowBits < 48) { + windowBits &= 15; + } + } + + /* set number of window bits, free window if different */ + if (windowBits && (windowBits < 8 || windowBits > 15)) { + return Z_STREAM_ERROR; + } + if (state.window !== null && state.wbits !== windowBits) { + state.window = null; + } + + /* update state and reset the rest of it */ + state.wrap = wrap; + state.wbits = windowBits; + return inflateReset(strm); +} + +function inflateInit2(strm, windowBits) { + var ret; + var state; + + if (!strm) { return Z_STREAM_ERROR; } + //strm.msg = Z_NULL; /* in case we return an error */ + + state = new InflateState(); + + //if (state === Z_NULL) return Z_MEM_ERROR; + //Tracev((stderr, "inflate: allocated\n")); + strm.state = state; + state.window = null/*Z_NULL*/; + ret = inflateReset2(strm, windowBits); + if (ret !== Z_OK) { + strm.state = null/*Z_NULL*/; + } + return ret; +} + +function inflateInit(strm) { + return inflateInit2(strm, DEF_WBITS); +} + + +/* + Return state with length and distance decoding tables and index sizes set to + fixed code decoding. Normally this returns fixed tables from inffixed.h. + If BUILDFIXED is defined, then instead this routine builds the tables the + first time it's called, and returns those tables the first time and + thereafter. This reduces the size of the code by about 2K bytes, in + exchange for a little execution time. However, BUILDFIXED should not be + used for threaded applications, since the rewriting of the tables and virgin + may not be thread-safe. + */ +var virgin = true; + +var lenfix, distfix; // We have no pointers in JS, so keep tables separate + +function fixedtables(state) { + /* build fixed huffman tables if first call (may not be thread safe) */ + if (virgin) { + var sym; + + lenfix = new utils.Buf32(512); + distfix = new utils.Buf32(32); + + /* literal/length table */ + sym = 0; + while (sym < 144) { state.lens[sym++] = 8; } + while (sym < 256) { state.lens[sym++] = 9; } + while (sym < 280) { state.lens[sym++] = 7; } + while (sym < 288) { state.lens[sym++] = 8; } + + inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); + + /* distance table */ + sym = 0; + while (sym < 32) { state.lens[sym++] = 5; } + + inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); + + /* do this just once */ + virgin = false; + } + + state.lencode = lenfix; + state.lenbits = 9; + state.distcode = distfix; + state.distbits = 5; +} + + +/* + Update the window with the last wsize (normally 32K) bytes written before + returning. If window does not exist yet, create it. This is only called + when a window is already in use, or when output has been written during this + inflate call, but the end of the deflate stream has not been reached yet. + It is also called to create a window for dictionary data when a dictionary + is loaded. + + Providing output buffers larger than 32K to inflate() should provide a speed + advantage, since only the last 32K of output is copied to the sliding window + upon return from inflate(), and since all distances after the first 32K of + output will fall in the output data, making match copies simpler and faster. + The advantage may be dependent on the size of the processor's data caches. + */ +function updatewindow(strm, src, end, copy) { + var dist; + var state = strm.state; + + /* if it hasn't been done already, allocate space for the window */ + if (state.window === null) { + state.wsize = 1 << state.wbits; + state.wnext = 0; + state.whave = 0; + + state.window = new utils.Buf8(state.wsize); + } + + /* copy state->wsize or less output bytes into the circular window */ + if (copy >= state.wsize) { + utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0); + state.wnext = 0; + state.whave = state.wsize; + } + else { + dist = state.wsize - state.wnext; + if (dist > copy) { + dist = copy; + } + //zmemcpy(state->window + state->wnext, end - copy, dist); + utils.arraySet(state.window, src, end - copy, dist, state.wnext); + copy -= dist; + if (copy) { + //zmemcpy(state->window, end - copy, copy); + utils.arraySet(state.window, src, end - copy, copy, 0); + state.wnext = copy; + state.whave = state.wsize; + } + else { + state.wnext += dist; + if (state.wnext === state.wsize) { state.wnext = 0; } + if (state.whave < state.wsize) { state.whave += dist; } + } + } + return 0; +} + +function inflate(strm, flush) { + var state; + var input, output; // input/output buffers + var next; /* next input INDEX */ + var put; /* next output INDEX */ + var have, left; /* available input and output */ + var hold; /* bit buffer */ + var bits; /* bits in bit buffer */ + var _in, _out; /* save starting available input and output */ + var copy; /* number of stored or match bytes to copy */ + var from; /* where to copy match bytes from */ + var from_source; + var here = 0; /* current decoding table entry */ + var here_bits, here_op, here_val; // paked "here" denormalized (JS specific) + //var last; /* parent table entry */ + var last_bits, last_op, last_val; // paked "last" denormalized (JS specific) + var len; /* length to copy for repeats, bits to drop */ + var ret; /* return code */ + var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */ + var opts; + + var n; // temporary var for NEED_BITS + + var order = /* permutation of code lengths */ + [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]; + + + if (!strm || !strm.state || !strm.output || + (!strm.input && strm.avail_in !== 0)) { + return Z_STREAM_ERROR; + } + + state = strm.state; + if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */ + + + //--- LOAD() --- + put = strm.next_out; + output = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + //--- + + _in = have; + _out = left; + ret = Z_OK; + + inf_leave: // goto emulation + for (;;) { + switch (state.mode) { + case HEAD: + if (state.wrap === 0) { + state.mode = TYPEDO; + break; + } + //=== NEEDBITS(16); + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */ + state.check = 0/*crc32(0L, Z_NULL, 0)*/; + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = FLAGS; + break; + } + state.flags = 0; /* expect zlib header */ + if (state.head) { + state.head.done = false; + } + if (!(state.wrap & 1) || /* check if zlib header allowed */ + (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) { + strm.msg = 'incorrect header check'; + state.mode = BAD; + break; + } + if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) { + strm.msg = 'unknown compression method'; + state.mode = BAD; + break; + } + //--- DROPBITS(4) ---// + hold >>>= 4; + bits -= 4; + //---// + len = (hold & 0x0f)/*BITS(4)*/ + 8; + if (state.wbits === 0) { + state.wbits = len; + } + else if (len > state.wbits) { + strm.msg = 'invalid window size'; + state.mode = BAD; + break; + } + state.dmax = 1 << len; + //Tracev((stderr, "inflate: zlib header ok\n")); + strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; + state.mode = hold & 0x200 ? DICTID : TYPE; + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + break; + case FLAGS: + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.flags = hold; + if ((state.flags & 0xff) !== Z_DEFLATED) { + strm.msg = 'unknown compression method'; + state.mode = BAD; + break; + } + if (state.flags & 0xe000) { + strm.msg = 'unknown header flags set'; + state.mode = BAD; + break; + } + if (state.head) { + state.head.text = ((hold >> 8) & 1); + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = TIME; + /* falls through */ + case TIME: + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (state.head) { + state.head.time = hold; + } + if (state.flags & 0x0200) { + //=== CRC4(state.check, hold) + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + hbuf[2] = (hold >>> 16) & 0xff; + hbuf[3] = (hold >>> 24) & 0xff; + state.check = crc32(state.check, hbuf, 4, 0); + //=== + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = OS; + /* falls through */ + case OS: + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (state.head) { + state.head.xflags = (hold & 0xff); + state.head.os = (hold >> 8); + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = EXLEN; + /* falls through */ + case EXLEN: + if (state.flags & 0x0400) { + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.length = hold; + if (state.head) { + state.head.extra_len = hold; + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + } + else if (state.head) { + state.head.extra = null/*Z_NULL*/; + } + state.mode = EXTRA; + /* falls through */ + case EXTRA: + if (state.flags & 0x0400) { + copy = state.length; + if (copy > have) { copy = have; } + if (copy) { + if (state.head) { + len = state.head.extra_len - state.length; + if (!state.head.extra) { + // Use untyped array for more convenient processing later + state.head.extra = new Array(state.head.extra_len); + } + utils.arraySet( + state.head.extra, + input, + next, + // extra field is limited to 65536 bytes + // - no need for additional size check + copy, + /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ + len + ); + //zmemcpy(state.head.extra + len, next, + // len + copy > state.head.extra_max ? + // state.head.extra_max - len : copy); + } + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + state.length -= copy; + } + if (state.length) { break inf_leave; } + } + state.length = 0; + state.mode = NAME; + /* falls through */ + case NAME: + if (state.flags & 0x0800) { + if (have === 0) { break inf_leave; } + copy = 0; + do { + // TODO: 2 or 1 bytes? + len = input[next + copy++]; + /* use constant limit because in js we should not preallocate memory */ + if (state.head && len && + (state.length < 65536 /*state.head.name_max*/)) { + state.head.name += String.fromCharCode(len); + } + } while (len && copy < have); + + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + if (len) { break inf_leave; } + } + else if (state.head) { + state.head.name = null; + } + state.length = 0; + state.mode = COMMENT; + /* falls through */ + case COMMENT: + if (state.flags & 0x1000) { + if (have === 0) { break inf_leave; } + copy = 0; + do { + len = input[next + copy++]; + /* use constant limit because in js we should not preallocate memory */ + if (state.head && len && + (state.length < 65536 /*state.head.comm_max*/)) { + state.head.comment += String.fromCharCode(len); + } + } while (len && copy < have); + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + if (len) { break inf_leave; } + } + else if (state.head) { + state.head.comment = null; + } + state.mode = HCRC; + /* falls through */ + case HCRC: + if (state.flags & 0x0200) { + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (hold !== (state.check & 0xffff)) { + strm.msg = 'header crc mismatch'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + } + if (state.head) { + state.head.hcrc = ((state.flags >> 9) & 1); + state.head.done = true; + } + strm.adler = state.check = 0; + state.mode = TYPE; + break; + case DICTID: + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + strm.adler = state.check = zswap32(hold); + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = DICT; + /* falls through */ + case DICT: + if (state.havedict === 0) { + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + return Z_NEED_DICT; + } + strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; + state.mode = TYPE; + /* falls through */ + case TYPE: + if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; } + /* falls through */ + case TYPEDO: + if (state.last) { + //--- BYTEBITS() ---// + hold >>>= bits & 7; + bits -= bits & 7; + //---// + state.mode = CHECK; + break; + } + //=== NEEDBITS(3); */ + while (bits < 3) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.last = (hold & 0x01)/*BITS(1)*/; + //--- DROPBITS(1) ---// + hold >>>= 1; + bits -= 1; + //---// + + switch ((hold & 0x03)/*BITS(2)*/) { + case 0: /* stored block */ + //Tracev((stderr, "inflate: stored block%s\n", + // state.last ? " (last)" : "")); + state.mode = STORED; + break; + case 1: /* fixed block */ + fixedtables(state); + //Tracev((stderr, "inflate: fixed codes block%s\n", + // state.last ? " (last)" : "")); + state.mode = LEN_; /* decode codes */ + if (flush === Z_TREES) { + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + break inf_leave; + } + break; + case 2: /* dynamic block */ + //Tracev((stderr, "inflate: dynamic codes block%s\n", + // state.last ? " (last)" : "")); + state.mode = TABLE; + break; + case 3: + strm.msg = 'invalid block type'; + state.mode = BAD; + } + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + break; + case STORED: + //--- BYTEBITS() ---// /* go to byte boundary */ + hold >>>= bits & 7; + bits -= bits & 7; + //---// + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) { + strm.msg = 'invalid stored block lengths'; + state.mode = BAD; + break; + } + state.length = hold & 0xffff; + //Tracev((stderr, "inflate: stored length %u\n", + // state.length)); + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = COPY_; + if (flush === Z_TREES) { break inf_leave; } + /* falls through */ + case COPY_: + state.mode = COPY; + /* falls through */ + case COPY: + copy = state.length; + if (copy) { + if (copy > have) { copy = have; } + if (copy > left) { copy = left; } + if (copy === 0) { break inf_leave; } + //--- zmemcpy(put, next, copy); --- + utils.arraySet(output, input, next, copy, put); + //---// + have -= copy; + next += copy; + left -= copy; + put += copy; + state.length -= copy; + break; + } + //Tracev((stderr, "inflate: stored end\n")); + state.mode = TYPE; + break; + case TABLE: + //=== NEEDBITS(14); */ + while (bits < 14) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257; + //--- DROPBITS(5) ---// + hold >>>= 5; + bits -= 5; + //---// + state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1; + //--- DROPBITS(5) ---// + hold >>>= 5; + bits -= 5; + //---// + state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4; + //--- DROPBITS(4) ---// + hold >>>= 4; + bits -= 4; + //---// +//#ifndef PKZIP_BUG_WORKAROUND + if (state.nlen > 286 || state.ndist > 30) { + strm.msg = 'too many length or distance symbols'; + state.mode = BAD; + break; + } +//#endif + //Tracev((stderr, "inflate: table sizes ok\n")); + state.have = 0; + state.mode = LENLENS; + /* falls through */ + case LENLENS: + while (state.have < state.ncode) { + //=== NEEDBITS(3); + while (bits < 3) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.lens[order[state.have++]] = (hold & 0x07);//BITS(3); + //--- DROPBITS(3) ---// + hold >>>= 3; + bits -= 3; + //---// + } + while (state.have < 19) { + state.lens[order[state.have++]] = 0; + } + // We have separate tables & no pointers. 2 commented lines below not needed. + //state.next = state.codes; + //state.lencode = state.next; + // Switch to use dynamic table + state.lencode = state.lendyn; + state.lenbits = 7; + + opts = { bits: state.lenbits }; + ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); + state.lenbits = opts.bits; + + if (ret) { + strm.msg = 'invalid code lengths set'; + state.mode = BAD; + break; + } + //Tracev((stderr, "inflate: code lengths ok\n")); + state.have = 0; + state.mode = CODELENS; + /* falls through */ + case CODELENS: + while (state.have < state.nlen + state.ndist) { + for (;;) { + here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if (here_val < 16) { + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.lens[state.have++] = here_val; + } + else { + if (here_val === 16) { + //=== NEEDBITS(here.bits + 2); + n = here_bits + 2; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + if (state.have === 0) { + strm.msg = 'invalid bit length repeat'; + state.mode = BAD; + break; + } + len = state.lens[state.have - 1]; + copy = 3 + (hold & 0x03);//BITS(2); + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + } + else if (here_val === 17) { + //=== NEEDBITS(here.bits + 3); + n = here_bits + 3; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + len = 0; + copy = 3 + (hold & 0x07);//BITS(3); + //--- DROPBITS(3) ---// + hold >>>= 3; + bits -= 3; + //---// + } + else { + //=== NEEDBITS(here.bits + 7); + n = here_bits + 7; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + len = 0; + copy = 11 + (hold & 0x7f);//BITS(7); + //--- DROPBITS(7) ---// + hold >>>= 7; + bits -= 7; + //---// + } + if (state.have + copy > state.nlen + state.ndist) { + strm.msg = 'invalid bit length repeat'; + state.mode = BAD; + break; + } + while (copy--) { + state.lens[state.have++] = len; + } + } + } + + /* handle error breaks in while */ + if (state.mode === BAD) { break; } + + /* check for end-of-block code (better have one) */ + if (state.lens[256] === 0) { + strm.msg = 'invalid code -- missing end-of-block'; + state.mode = BAD; + break; + } + + /* build code tables -- note: do not change the lenbits or distbits + values here (9 and 6) without reading the comments in inftrees.h + concerning the ENOUGH constants, which depend on those values */ + state.lenbits = 9; + + opts = { bits: state.lenbits }; + ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); + // We have separate tables & no pointers. 2 commented lines below not needed. + // state.next_index = opts.table_index; + state.lenbits = opts.bits; + // state.lencode = state.next; + + if (ret) { + strm.msg = 'invalid literal/lengths set'; + state.mode = BAD; + break; + } + + state.distbits = 6; + //state.distcode.copy(state.codes); + // Switch to use dynamic table + state.distcode = state.distdyn; + opts = { bits: state.distbits }; + ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); + // We have separate tables & no pointers. 2 commented lines below not needed. + // state.next_index = opts.table_index; + state.distbits = opts.bits; + // state.distcode = state.next; + + if (ret) { + strm.msg = 'invalid distances set'; + state.mode = BAD; + break; + } + //Tracev((stderr, 'inflate: codes ok\n')); + state.mode = LEN_; + if (flush === Z_TREES) { break inf_leave; } + /* falls through */ + case LEN_: + state.mode = LEN; + /* falls through */ + case LEN: + if (have >= 6 && left >= 258) { + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + inflate_fast(strm, _out); + //--- LOAD() --- + put = strm.next_out; + output = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + //--- + + if (state.mode === TYPE) { + state.back = -1; + } + break; + } + state.back = 0; + for (;;) { + here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if (here_bits <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if (here_op && (here_op & 0xf0) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (;;) { + here = state.lencode[last_val + + ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)]; + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((last_bits + here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + //--- DROPBITS(last.bits) ---// + hold >>>= last_bits; + bits -= last_bits; + //---// + state.back += last_bits; + } + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.back += here_bits; + state.length = here_val; + if (here_op === 0) { + //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? + // "inflate: literal '%c'\n" : + // "inflate: literal 0x%02x\n", here.val)); + state.mode = LIT; + break; + } + if (here_op & 32) { + //Tracevv((stderr, "inflate: end of block\n")); + state.back = -1; + state.mode = TYPE; + break; + } + if (here_op & 64) { + strm.msg = 'invalid literal/length code'; + state.mode = BAD; + break; + } + state.extra = here_op & 15; + state.mode = LENEXT; + /* falls through */ + case LENEXT: + if (state.extra) { + //=== NEEDBITS(state.extra); + n = state.extra; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/; + //--- DROPBITS(state.extra) ---// + hold >>>= state.extra; + bits -= state.extra; + //---// + state.back += state.extra; + } + //Tracevv((stderr, "inflate: length %u\n", state.length)); + state.was = state.length; + state.mode = DIST; + /* falls through */ + case DIST: + for (;;) { + here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if ((here_op & 0xf0) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (;;) { + here = state.distcode[last_val + + ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)]; + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((last_bits + here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + //--- DROPBITS(last.bits) ---// + hold >>>= last_bits; + bits -= last_bits; + //---// + state.back += last_bits; + } + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.back += here_bits; + if (here_op & 64) { + strm.msg = 'invalid distance code'; + state.mode = BAD; + break; + } + state.offset = here_val; + state.extra = (here_op) & 15; + state.mode = DISTEXT; + /* falls through */ + case DISTEXT: + if (state.extra) { + //=== NEEDBITS(state.extra); + n = state.extra; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/; + //--- DROPBITS(state.extra) ---// + hold >>>= state.extra; + bits -= state.extra; + //---// + state.back += state.extra; + } +//#ifdef INFLATE_STRICT + if (state.offset > state.dmax) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break; + } +//#endif + //Tracevv((stderr, "inflate: distance %u\n", state.offset)); + state.mode = MATCH; + /* falls through */ + case MATCH: + if (left === 0) { break inf_leave; } + copy = _out - left; + if (state.offset > copy) { /* copy from window */ + copy = state.offset - copy; + if (copy > state.whave) { + if (state.sane) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break; + } +// (!) This block is disabled in zlib defaults, +// don't enable it for binary compatibility +//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR +// Trace((stderr, "inflate.c too far\n")); +// copy -= state.whave; +// if (copy > state.length) { copy = state.length; } +// if (copy > left) { copy = left; } +// left -= copy; +// state.length -= copy; +// do { +// output[put++] = 0; +// } while (--copy); +// if (state.length === 0) { state.mode = LEN; } +// break; +//#endif + } + if (copy > state.wnext) { + copy -= state.wnext; + from = state.wsize - copy; + } + else { + from = state.wnext - copy; + } + if (copy > state.length) { copy = state.length; } + from_source = state.window; + } + else { /* copy from output */ + from_source = output; + from = put - state.offset; + copy = state.length; + } + if (copy > left) { copy = left; } + left -= copy; + state.length -= copy; + do { + output[put++] = from_source[from++]; + } while (--copy); + if (state.length === 0) { state.mode = LEN; } + break; + case LIT: + if (left === 0) { break inf_leave; } + output[put++] = state.length; + left--; + state.mode = LEN; + break; + case CHECK: + if (state.wrap) { + //=== NEEDBITS(32); + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + // Use '|' instead of '+' to make sure that result is signed + hold |= input[next++] << bits; + bits += 8; + } + //===// + _out -= left; + strm.total_out += _out; + state.total += _out; + if (_out) { + strm.adler = state.check = + /*UPDATE(state.check, put - _out, _out);*/ + (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out)); + + } + _out = left; + // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too + if ((state.flags ? hold : zswap32(hold)) !== state.check) { + strm.msg = 'incorrect data check'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + //Tracev((stderr, "inflate: check matches trailer\n")); + } + state.mode = LENGTH; + /* falls through */ + case LENGTH: + if (state.wrap && state.flags) { + //=== NEEDBITS(32); + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (hold !== (state.total & 0xffffffff)) { + strm.msg = 'incorrect length check'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + //Tracev((stderr, "inflate: length matches trailer\n")); + } + state.mode = DONE; + /* falls through */ + case DONE: + ret = Z_STREAM_END; + break inf_leave; + case BAD: + ret = Z_DATA_ERROR; + break inf_leave; + case MEM: + return Z_MEM_ERROR; + case SYNC: + /* falls through */ + default: + return Z_STREAM_ERROR; + } + } + + // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave" + + /* + Return from inflate(), updating the total counts and the check value. + If there was no progress during the inflate() call, return a buffer + error. Call updatewindow() to create and/or update the window state. + Note: a memory error from inflate() is non-recoverable. + */ + + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + + if (state.wsize || (_out !== strm.avail_out && state.mode < BAD && + (state.mode < CHECK || flush !== Z_FINISH))) { + if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) { + state.mode = MEM; + return Z_MEM_ERROR; + } + } + _in -= strm.avail_in; + _out -= strm.avail_out; + strm.total_in += _in; + strm.total_out += _out; + state.total += _out; + if (state.wrap && _out) { + strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ + (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out)); + } + strm.data_type = state.bits + (state.last ? 64 : 0) + + (state.mode === TYPE ? 128 : 0) + + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); + if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) { + ret = Z_BUF_ERROR; + } + return ret; +} + +function inflateEnd(strm) { + + if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) { + return Z_STREAM_ERROR; + } + + var state = strm.state; + if (state.window) { + state.window = null; + } + strm.state = null; + return Z_OK; +} + +function inflateGetHeader(strm, head) { + var state; + + /* check state */ + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; } + + /* save header structure */ + state.head = head; + head.done = false; + return Z_OK; +} + +function inflateSetDictionary(strm, dictionary) { + var dictLength = dictionary.length; + + var state; + var dictid; + var ret; + + /* check state */ + if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; } + state = strm.state; + + if (state.wrap !== 0 && state.mode !== DICT) { + return Z_STREAM_ERROR; + } + + /* check for correct dictionary identifier */ + if (state.mode === DICT) { + dictid = 1; /* adler32(0, null, 0)*/ + /* dictid = adler32(dictid, dictionary, dictLength); */ + dictid = adler32(dictid, dictionary, dictLength, 0); + if (dictid !== state.check) { + return Z_DATA_ERROR; + } + } + /* copy dictionary to window using updatewindow(), which will amend the + existing dictionary if appropriate */ + ret = updatewindow(strm, dictionary, dictLength, dictLength); + if (ret) { + state.mode = MEM; + return Z_MEM_ERROR; + } + state.havedict = 1; + // Tracev((stderr, "inflate: dictionary set\n")); + return Z_OK; +} + +exports.inflateReset = inflateReset; +exports.inflateReset2 = inflateReset2; +exports.inflateResetKeep = inflateResetKeep; +exports.inflateInit = inflateInit; +exports.inflateInit2 = inflateInit2; +exports.inflate = inflate; +exports.inflateEnd = inflateEnd; +exports.inflateGetHeader = inflateGetHeader; +exports.inflateSetDictionary = inflateSetDictionary; +exports.inflateInfo = 'pako inflate (from Nodeca project)'; + +/* Not implemented +exports.inflateCopy = inflateCopy; +exports.inflateGetDictionary = inflateGetDictionary; +exports.inflateMark = inflateMark; +exports.inflatePrime = inflatePrime; +exports.inflateSync = inflateSync; +exports.inflateSyncPoint = inflateSyncPoint; +exports.inflateUndermine = inflateUndermine; +*/ + +},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(require,module,exports){ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +var utils = require('../utils/common'); + +var MAXBITS = 15; +var ENOUGH_LENS = 852; +var ENOUGH_DISTS = 592; +//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); + +var CODES = 0; +var LENS = 1; +var DISTS = 2; + +var lbase = [ /* Length codes 257..285 base */ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 +]; + +var lext = [ /* Length codes 257..285 extra */ + 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78 +]; + +var dbase = [ /* Distance codes 0..29 base */ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577, 0, 0 +]; + +var dext = [ /* Distance codes 0..29 extra */ + 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, + 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, + 28, 28, 29, 29, 64, 64 +]; + +module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) +{ + var bits = opts.bits; + //here = opts.here; /* table entry for duplication */ + + var len = 0; /* a code's length in bits */ + var sym = 0; /* index of code symbols */ + var min = 0, max = 0; /* minimum and maximum code lengths */ + var root = 0; /* number of index bits for root table */ + var curr = 0; /* number of index bits for current table */ + var drop = 0; /* code bits to drop for sub-table */ + var left = 0; /* number of prefix codes available */ + var used = 0; /* code entries in table used */ + var huff = 0; /* Huffman code */ + var incr; /* for incrementing code, index */ + var fill; /* index for replicating entries */ + var low; /* low bits for current root entry */ + var mask; /* mask for low root bits */ + var next; /* next available space in table */ + var base = null; /* base value table to use */ + var base_index = 0; +// var shoextra; /* extra bits table to use */ + var end; /* use base and extra for symbol > end */ + var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */ + var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */ + var extra = null; + var extra_index = 0; + + var here_bits, here_op, here_val; + + /* + Process a set of code lengths to create a canonical Huffman code. The + code lengths are lens[0..codes-1]. Each length corresponds to the + symbols 0..codes-1. The Huffman code is generated by first sorting the + symbols by length from short to long, and retaining the symbol order + for codes with equal lengths. Then the code starts with all zero bits + for the first code of the shortest length, and the codes are integer + increments for the same length, and zeros are appended as the length + increases. For the deflate format, these bits are stored backwards + from their more natural integer increment ordering, and so when the + decoding tables are built in the large loop below, the integer codes + are incremented backwards. + + This routine assumes, but does not check, that all of the entries in + lens[] are in the range 0..MAXBITS. The caller must assure this. + 1..MAXBITS is interpreted as that code length. zero means that that + symbol does not occur in this code. + + The codes are sorted by computing a count of codes for each length, + creating from that a table of starting indices for each length in the + sorted table, and then entering the symbols in order in the sorted + table. The sorted table is work[], with that space being provided by + the caller. + + The length counts are used for other purposes as well, i.e. finding + the minimum and maximum length codes, determining if there are any + codes at all, checking for a valid set of lengths, and looking ahead + at length counts to determine sub-table sizes when building the + decoding tables. + */ + + /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ + for (len = 0; len <= MAXBITS; len++) { + count[len] = 0; + } + for (sym = 0; sym < codes; sym++) { + count[lens[lens_index + sym]]++; + } + + /* bound code lengths, force root to be within code lengths */ + root = bits; + for (max = MAXBITS; max >= 1; max--) { + if (count[max] !== 0) { break; } + } + if (root > max) { + root = max; + } + if (max === 0) { /* no symbols to code at all */ + //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */ + //table.bits[opts.table_index] = 1; //here.bits = (var char)1; + //table.val[opts.table_index++] = 0; //here.val = (var short)0; + table[table_index++] = (1 << 24) | (64 << 16) | 0; + + + //table.op[opts.table_index] = 64; + //table.bits[opts.table_index] = 1; + //table.val[opts.table_index++] = 0; + table[table_index++] = (1 << 24) | (64 << 16) | 0; + + opts.bits = 1; + return 0; /* no symbols, but wait for decoding to report error */ + } + for (min = 1; min < max; min++) { + if (count[min] !== 0) { break; } + } + if (root < min) { + root = min; + } + + /* check for an over-subscribed or incomplete set of lengths */ + left = 1; + for (len = 1; len <= MAXBITS; len++) { + left <<= 1; + left -= count[len]; + if (left < 0) { + return -1; + } /* over-subscribed */ + } + if (left > 0 && (type === CODES || max !== 1)) { + return -1; /* incomplete set */ + } + + /* generate offsets into symbol table for each length for sorting */ + offs[1] = 0; + for (len = 1; len < MAXBITS; len++) { + offs[len + 1] = offs[len] + count[len]; + } + + /* sort symbols by length, by symbol order within each length */ + for (sym = 0; sym < codes; sym++) { + if (lens[lens_index + sym] !== 0) { + work[offs[lens[lens_index + sym]]++] = sym; + } + } + + /* + Create and fill in decoding tables. In this loop, the table being + filled is at next and has curr index bits. The code being used is huff + with length len. That code is converted to an index by dropping drop + bits off of the bottom. For codes where len is less than drop + curr, + those top drop + curr - len bits are incremented through all values to + fill the table with replicated entries. + + root is the number of index bits for the root table. When len exceeds + root, sub-tables are created pointed to by the root entry with an index + of the low root bits of huff. This is saved in low to check for when a + new sub-table should be started. drop is zero when the root table is + being filled, and drop is root when sub-tables are being filled. + + When a new sub-table is needed, it is necessary to look ahead in the + code lengths to determine what size sub-table is needed. The length + counts are used for this, and so count[] is decremented as codes are + entered in the tables. + + used keeps track of how many table entries have been allocated from the + provided *table space. It is checked for LENS and DIST tables against + the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in + the initial root table size constants. See the comments in inftrees.h + for more information. + + sym increments through all symbols, and the loop terminates when + all codes of length max, i.e. all codes, have been processed. This + routine permits incomplete codes, so another loop after this one fills + in the rest of the decoding tables with invalid code markers. + */ + + /* set up for code type */ + // poor man optimization - use if-else instead of switch, + // to avoid deopts in old v8 + if (type === CODES) { + base = extra = work; /* dummy value--not used */ + end = 19; + + } else if (type === LENS) { + base = lbase; + base_index -= 257; + extra = lext; + extra_index -= 257; + end = 256; + + } else { /* DISTS */ + base = dbase; + extra = dext; + end = -1; + } + + /* initialize opts for loop */ + huff = 0; /* starting code */ + sym = 0; /* starting code symbol */ + len = min; /* starting code length */ + next = table_index; /* current table to fill in */ + curr = root; /* current table index bits */ + drop = 0; /* current bits to drop from code for index */ + low = -1; /* trigger new sub-table when len > root */ + used = 1 << root; /* use root table entries */ + mask = used - 1; /* mask for comparing low */ + + /* check available table space */ + if ((type === LENS && used > ENOUGH_LENS) || + (type === DISTS && used > ENOUGH_DISTS)) { + return 1; + } + + /* process all codes and make table entries */ + for (;;) { + /* create table entry */ + here_bits = len - drop; + if (work[sym] < end) { + here_op = 0; + here_val = work[sym]; + } + else if (work[sym] > end) { + here_op = extra[extra_index + work[sym]]; + here_val = base[base_index + work[sym]]; + } + else { + here_op = 32 + 64; /* end of block */ + here_val = 0; + } + + /* replicate for those indices with low len bits equal to huff */ + incr = 1 << (len - drop); + fill = 1 << curr; + min = fill; /* save offset to next table */ + do { + fill -= incr; + table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0; + } while (fill !== 0); + + /* backwards increment the len-bit code huff */ + incr = 1 << (len - 1); + while (huff & incr) { + incr >>= 1; + } + if (incr !== 0) { + huff &= incr - 1; + huff += incr; + } else { + huff = 0; + } + + /* go to next symbol, update count, len */ + sym++; + if (--count[len] === 0) { + if (len === max) { break; } + len = lens[lens_index + work[sym]]; + } + + /* create new sub-table if needed */ + if (len > root && (huff & mask) !== low) { + /* if first time, transition to sub-tables */ + if (drop === 0) { + drop = root; + } + + /* increment past last table */ + next += min; /* here min is 1 << curr */ + + /* determine length of next table */ + curr = len - drop; + left = 1 << curr; + while (curr + drop < max) { + left -= count[curr + drop]; + if (left <= 0) { break; } + curr++; + left <<= 1; + } + + /* check for enough space */ + used += 1 << curr; + if ((type === LENS && used > ENOUGH_LENS) || + (type === DISTS && used > ENOUGH_DISTS)) { + return 1; + } + + /* point entry in root table to sub-table */ + low = huff & mask; + /*table.op[low] = curr; + table.bits[low] = root; + table.val[low] = next - opts.table_index;*/ + table[low] = (root << 24) | (curr << 16) | (next - table_index) |0; + } + } + + /* fill in remaining table entry if code is incomplete (guaranteed to have + at most one remaining entry, since if the code is incomplete, the + maximum code length that was allowed to get this far is one bit) */ + if (huff !== 0) { + //table.op[next + huff] = 64; /* invalid code marker */ + //table.bits[next + huff] = len - drop; + //table.val[next + huff] = 0; + table[next + huff] = ((len - drop) << 24) | (64 << 16) |0; + } + + /* set return parameters */ + //opts.table_index += used; + opts.bits = root; + return 0; +}; + +},{"../utils/common":1}],10:[function(require,module,exports){ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +module.exports = { + 2: 'need dictionary', /* Z_NEED_DICT 2 */ + 1: 'stream end', /* Z_STREAM_END 1 */ + 0: '', /* Z_OK 0 */ + '-1': 'file error', /* Z_ERRNO (-1) */ + '-2': 'stream error', /* Z_STREAM_ERROR (-2) */ + '-3': 'data error', /* Z_DATA_ERROR (-3) */ + '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */ + '-5': 'buffer error', /* Z_BUF_ERROR (-5) */ + '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */ +}; + +},{}],11:[function(require,module,exports){ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +function ZStream() { + /* next input byte */ + this.input = null; // JS specific, because we have no pointers + this.next_in = 0; + /* number of bytes available at input */ + this.avail_in = 0; + /* total number of input bytes read so far */ + this.total_in = 0; + /* next output byte should be put there */ + this.output = null; // JS specific, because we have no pointers + this.next_out = 0; + /* remaining free space at output */ + this.avail_out = 0; + /* total number of bytes output so far */ + this.total_out = 0; + /* last error message, NULL if no error */ + this.msg = ''/*Z_NULL*/; + /* not visible by applications */ + this.state = null; + /* best guess about the data type: binary or text */ + this.data_type = 2/*Z_UNKNOWN*/; + /* adler32 value of the uncompressed data */ + this.adler = 0; +} + +module.exports = ZStream; + +},{}],"/lib/inflate.js":[function(require,module,exports){ +'use strict'; + + +var zlib_inflate = require('./zlib/inflate'); +var utils = require('./utils/common'); +var strings = require('./utils/strings'); +var c = require('./zlib/constants'); +var msg = require('./zlib/messages'); +var ZStream = require('./zlib/zstream'); +var GZheader = require('./zlib/gzheader'); + +var toString = Object.prototype.toString; + +/** + * class Inflate + * + * Generic JS-style wrapper for zlib calls. If you don't need + * streaming behaviour - use more simple functions: [[inflate]] + * and [[inflateRaw]]. + **/ + +/* internal + * inflate.chunks -> Array + * + * Chunks of output data, if [[Inflate#onData]] not overridden. + **/ + +/** + * Inflate.result -> Uint8Array|Array|String + * + * Uncompressed result, generated by default [[Inflate#onData]] + * and [[Inflate#onEnd]] handlers. Filled after you push last chunk + * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you + * push a chunk with explicit flush (call [[Inflate#push]] with + * `Z_SYNC_FLUSH` param). + **/ + +/** + * Inflate.err -> Number + * + * Error code after inflate finished. 0 (Z_OK) on success. + * Should be checked if broken data possible. + **/ + +/** + * Inflate.msg -> String + * + * Error message, if [[Inflate.err]] != 0 + **/ + + +/** + * new Inflate(options) + * - options (Object): zlib inflate options. + * + * Creates new inflator instance with specified params. Throws exception + * on bad params. Supported options: + * + * - `windowBits` + * - `dictionary` + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information on these. + * + * Additional options, for internal needs: + * + * - `chunkSize` - size of generated data chunks (16K by default) + * - `raw` (Boolean) - do raw inflate + * - `to` (String) - if equal to 'string', then result will be converted + * from utf8 to utf16 (javascript) string. When string output requested, + * chunk length can differ from `chunkSize`, depending on content. + * + * By default, when no options set, autodetect deflate/gzip data format via + * wrapper header. + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) + * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); + * + * var inflate = new pako.Inflate({ level: 3}); + * + * inflate.push(chunk1, false); + * inflate.push(chunk2, true); // true -> last chunk + * + * if (inflate.err) { throw new Error(inflate.err); } + * + * console.log(inflate.result); + * ``` + **/ +function Inflate(options) { + if (!(this instanceof Inflate)) return new Inflate(options); + + this.options = utils.assign({ + chunkSize: 16384, + windowBits: 0, + to: '' + }, options || {}); + + var opt = this.options; + + // Force window size for `raw` data, if not set directly, + // because we have no header for autodetect. + if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) { + opt.windowBits = -opt.windowBits; + if (opt.windowBits === 0) { opt.windowBits = -15; } + } + + // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate + if ((opt.windowBits >= 0) && (opt.windowBits < 16) && + !(options && options.windowBits)) { + opt.windowBits += 32; + } + + // Gzip header has no info about windows size, we can do autodetect only + // for deflate. So, if window size not set, force it to max when gzip possible + if ((opt.windowBits > 15) && (opt.windowBits < 48)) { + // bit 3 (16) -> gzipped data + // bit 4 (32) -> autodetect gzip/deflate + if ((opt.windowBits & 15) === 0) { + opt.windowBits |= 15; + } + } + + this.err = 0; // error code, if happens (0 = Z_OK) + this.msg = ''; // error message + this.ended = false; // used to avoid multiple onEnd() calls + this.chunks = []; // chunks of compressed data + + this.strm = new ZStream(); + this.strm.avail_out = 0; + + var status = zlib_inflate.inflateInit2( + this.strm, + opt.windowBits + ); + + if (status !== c.Z_OK) { + throw new Error(msg[status]); + } + + this.header = new GZheader(); + + zlib_inflate.inflateGetHeader(this.strm, this.header); +} + +/** + * Inflate#push(data[, mode]) -> Boolean + * - data (Uint8Array|Array|ArrayBuffer|String): input data + * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. + * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH. + * + * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with + * new output chunks. Returns `true` on success. The last data block must have + * mode Z_FINISH (or `true`). That will flush internal pending buffers and call + * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you + * can use mode Z_SYNC_FLUSH, keeping the decompression context. + * + * On fail call [[Inflate#onEnd]] with error code and return false. + * + * We strongly recommend to use `Uint8Array` on input for best speed (output + * format is detected automatically). Also, don't skip last param and always + * use the same type in your code (boolean or number). That will improve JS speed. + * + * For regular `Array`-s make sure all elements are [0..255]. + * + * ##### Example + * + * ```javascript + * push(chunk, false); // push one of data chunks + * ... + * push(chunk, true); // push last chunk + * ``` + **/ +Inflate.prototype.push = function (data, mode) { + var strm = this.strm; + var chunkSize = this.options.chunkSize; + var dictionary = this.options.dictionary; + var status, _mode; + var next_out_utf8, tail, utf8str; + var dict; + + // Flag to properly process Z_BUF_ERROR on testing inflate call + // when we check that all output data was flushed. + var allowBufError = false; + + if (this.ended) { return false; } + _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH); + + // Convert data if needed + if (typeof data === 'string') { + // Only binary strings can be decompressed on practice + strm.input = strings.binstring2buf(data); + } else if (toString.call(data) === '[object ArrayBuffer]') { + strm.input = new Uint8Array(data); + } else { + strm.input = data; + } + + strm.next_in = 0; + strm.avail_in = strm.input.length; + + do { + if (strm.avail_out === 0) { + strm.output = new utils.Buf8(chunkSize); + strm.next_out = 0; + strm.avail_out = chunkSize; + } + + status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */ + + if (status === c.Z_NEED_DICT && dictionary) { + // Convert data if needed + if (typeof dictionary === 'string') { + dict = strings.string2buf(dictionary); + } else if (toString.call(dictionary) === '[object ArrayBuffer]') { + dict = new Uint8Array(dictionary); + } else { + dict = dictionary; + } + + status = zlib_inflate.inflateSetDictionary(this.strm, dict); + + } + + if (status === c.Z_BUF_ERROR && allowBufError === true) { + status = c.Z_OK; + allowBufError = false; + } + + if (status !== c.Z_STREAM_END && status !== c.Z_OK) { + this.onEnd(status); + this.ended = true; + return false; + } + + if (strm.next_out) { + if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) { + + if (this.options.to === 'string') { + + next_out_utf8 = strings.utf8border(strm.output, strm.next_out); + + tail = strm.next_out - next_out_utf8; + utf8str = strings.buf2string(strm.output, next_out_utf8); + + // move tail + strm.next_out = tail; + strm.avail_out = chunkSize - tail; + if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); } + + this.onData(utf8str); + + } else { + this.onData(utils.shrinkBuf(strm.output, strm.next_out)); + } + } + } + + // When no more input data, we should check that internal inflate buffers + // are flushed. The only way to do it when avail_out = 0 - run one more + // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR. + // Here we set flag to process this error properly. + // + // NOTE. Deflate does not return error in this case and does not needs such + // logic. + if (strm.avail_in === 0 && strm.avail_out === 0) { + allowBufError = true; + } + + } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END); + + if (status === c.Z_STREAM_END) { + _mode = c.Z_FINISH; + } + + // Finalize on the last chunk. + if (_mode === c.Z_FINISH) { + status = zlib_inflate.inflateEnd(this.strm); + this.onEnd(status); + this.ended = true; + return status === c.Z_OK; + } + + // callback interim results if Z_SYNC_FLUSH. + if (_mode === c.Z_SYNC_FLUSH) { + this.onEnd(c.Z_OK); + strm.avail_out = 0; + return true; + } + + return true; +}; + + +/** + * Inflate#onData(chunk) -> Void + * - chunk (Uint8Array|Array|String): output data. Type of array depends + * on js engine support. When string output requested, each chunk + * will be string. + * + * By default, stores data blocks in `chunks[]` property and glue + * those in `onEnd`. Override this handler, if you need another behaviour. + **/ +Inflate.prototype.onData = function (chunk) { + this.chunks.push(chunk); +}; + + +/** + * Inflate#onEnd(status) -> Void + * - status (Number): inflate status. 0 (Z_OK) on success, + * other if not. + * + * Called either after you tell inflate that the input stream is + * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH) + * or if an error happened. By default - join collected chunks, + * free memory and fill `results` / `err` properties. + **/ +Inflate.prototype.onEnd = function (status) { + // On success - join + if (status === c.Z_OK) { + if (this.options.to === 'string') { + // Glue & convert here, until we teach pako to send + // utf8 aligned strings to onData + this.result = this.chunks.join(''); + } else { + this.result = utils.flattenChunks(this.chunks); + } + } + this.chunks = []; + this.err = status; + this.msg = this.strm.msg; +}; + + +/** + * inflate(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * Decompress `data` with inflate/ungzip and `options`. Autodetect + * format via wrapper header by default. That's why we don't provide + * separate `ungzip` method. + * + * Supported options are: + * + * - windowBits + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information. + * + * Sugar (options): + * + * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify + * negative windowBits implicitly. + * - `to` (String) - if equal to 'string', then result will be converted + * from utf8 to utf16 (javascript) string. When string output requested, + * chunk length can differ from `chunkSize`, depending on content. + * + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , input = pako.deflate([1,2,3,4,5,6,7,8,9]) + * , output; + * + * try { + * output = pako.inflate(input); + * } catch (err) + * console.log(err); + * } + * ``` + **/ +function inflate(input, options) { + var inflator = new Inflate(options); + + inflator.push(input, true); + + // That will never happens, if you don't cheat with options :) + if (inflator.err) { throw inflator.msg || msg[inflator.err]; } + + return inflator.result; +} + + +/** + * inflateRaw(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * The same as [[inflate]], but creates raw data, without wrapper + * (header and adler32 crc). + **/ +function inflateRaw(input, options) { + options = options || {}; + options.raw = true; + return inflate(input, options); +} + + +/** + * ungzip(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * Just shortcut to [[inflate]], because it autodetects format + * by header.content. Done for convenience. + **/ + + +exports.Inflate = Inflate; +exports.inflate = inflate; +exports.inflateRaw = inflateRaw; +exports.ungzip = inflate; + +},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js") +}); \ No newline at end of file diff --git a/node_modules/pako/dist/pako_inflate.min.js b/node_modules/pako/dist/pako_inflate.min.js new file mode 100644 index 000000000..466cd74a5 --- /dev/null +++ b/node_modules/pako/dist/pako_inflate.min.js @@ -0,0 +1 @@ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).pako=e()}}(function(){return function e(t,i,n){function a(o,s){if(!i[o]){if(!t[o]){var f="function"==typeof require&&require;if(!s&&f)return f(o,!0);if(r)return r(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var d=i[o]={exports:{}};t[o][0].call(d.exports,function(e){var i=t[o][1][e];return a(i||e)},d,d.exports,e,t,i,n)}return i[o].exports}for(var r="function"==typeof require&&require,o=0;o=252?6:f>=248?5:f>=240?4:f>=224?3:f>=192?2:1;s[254]=s[254]=1,i.string2buf=function(e){var t,i,n,r,o,s=e.length,f=0;for(r=0;r>>6,t[o++]=128|63&i):i<65536?(t[o++]=224|i>>>12,t[o++]=128|i>>>6&63,t[o++]=128|63&i):(t[o++]=240|i>>>18,t[o++]=128|i>>>12&63,t[o++]=128|i>>>6&63,t[o++]=128|63&i);return t},i.buf2binstring=function(e){return n(e,e.length)},i.binstring2buf=function(e){for(var t=new a.Buf8(e.length),i=0,n=t.length;i4)l[a++]=65533,i+=o-1;else{for(r&=2===o?31:3===o?15:7;o>1&&i1?l[a++]=65533:r<65536?l[a++]=r:(r-=65536,l[a++]=55296|r>>10&1023,l[a++]=56320|1023&r)}return n(l,a)},i.utf8border=function(e,t){var i;for((t=t||e.length)>e.length&&(t=e.length),i=t-1;i>=0&&128==(192&e[i]);)i--;return i<0?t:0===i?t:i+s[e[i]]>t?i:t}},{"./common":1}],3:[function(e,t,i){"use strict";t.exports=function(e,t,i,n){for(var a=65535&e|0,r=e>>>16&65535|0,o=0;0!==i;){i-=o=i>2e3?2e3:i;do{r=r+(a=a+t[n++]|0)|0}while(--o);a%=65521,r%=65521}return a|r<<16|0}},{}],4:[function(e,t,i){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(e,t,i){"use strict";var n=function(){for(var e,t=[],i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}();t.exports=function(e,t,i,a){var r=n,o=a+i;e^=-1;for(var s=a;s>>8^r[255&(e^t[s])];return-1^e}},{}],6:[function(e,t,i){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],7:[function(e,t,i){"use strict";t.exports=function(e,t){var i,n,a,r,o,s,f,l,d,u,c,h,b,w,m,k,_,g,v,p,x,y,S,E,B;i=e.state,n=e.next_in,E=e.input,a=n+(e.avail_in-5),r=e.next_out,B=e.output,o=r-(t-e.avail_out),s=r+(e.avail_out-257),f=i.dmax,l=i.wsize,d=i.whave,u=i.wnext,c=i.window,h=i.hold,b=i.bits,w=i.lencode,m=i.distcode,k=(1<>>24,h>>>=v,b-=v,0===(v=g>>>16&255))B[r++]=65535&g;else{if(!(16&v)){if(0==(64&v)){g=w[(65535&g)+(h&(1<>>=v,b-=v),b<15&&(h+=E[n++]<>>24,h>>>=v,b-=v,!(16&(v=g>>>16&255))){if(0==(64&v)){g=m[(65535&g)+(h&(1<f){e.msg="invalid distance too far back",i.mode=30;break e}if(h>>>=v,b-=v,v=r-o,x>v){if((v=x-v)>d&&i.sane){e.msg="invalid distance too far back",i.mode=30;break e}if(y=0,S=c,0===u){if(y+=l-v,v2;)B[r++]=S[y++],B[r++]=S[y++],B[r++]=S[y++],p-=3;p&&(B[r++]=S[y++],p>1&&(B[r++]=S[y++]))}else{y=r-x;do{B[r++]=B[y++],B[r++]=B[y++],B[r++]=B[y++],p-=3}while(p>2);p&&(B[r++]=B[y++],p>1&&(B[r++]=B[y++]))}break}}break}}while(n>3,h&=(1<<(b-=p<<3))-1,e.next_in=n,e.next_out=r,e.avail_in=n>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function a(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new h.Buf16(320),this.work=new h.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function r(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=O,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new h.Buf32(de),t.distcode=t.distdyn=new h.Buf32(ue),t.sane=1,t.back=-1,S):Z}function o(e){var t;return e&&e.state?(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,r(e)):Z}function s(e,t){var i,n;return e&&e.state?(n=e.state,t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Z:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,o(e))):Z}function f(e,t){var i,n;return e?(n=new a,e.state=n,n.window=null,(i=s(e,t))!==S&&(e.state=null),i):Z}function l(e){if(he){var t;for(u=new h.Buf32(512),c=new h.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(k(g,e.lens,0,288,u,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;k(v,e.lens,0,32,c,0,e.work,{bits:5}),he=!1}e.lencode=u,e.lenbits=9,e.distcode=c,e.distbits=5}function d(e,t,i,n){var a,r=e.state;return null===r.window&&(r.wsize=1<=r.wsize?(h.arraySet(r.window,t,i-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):((a=r.wsize-r.wnext)>n&&(a=n),h.arraySet(r.window,t,i-n,a,r.wnext),(n-=a)?(h.arraySet(r.window,t,i-n,n,0),r.wnext=n,r.whave=r.wsize):(r.wnext+=a,r.wnext===r.wsize&&(r.wnext=0),r.whave>>8&255,i.check=w(i.check,Ze,2,0),c=0,de=0,i.mode=C;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",i.mode=se;break}if((15&c)!==N){e.msg="unknown compression method",i.mode=se;break}if(c>>>=4,de-=4,xe=8+(15&c),0===i.wbits)i.wbits=xe;else if(xe>i.wbits){e.msg="invalid window size",i.mode=se;break}i.dmax=1<>8&1),512&i.flags&&(Ze[0]=255&c,Ze[1]=c>>>8&255,i.check=w(i.check,Ze,2,0)),c=0,de=0,i.mode=I;case I:for(;de<32;){if(0===f)break e;f--,c+=a[o++]<>>8&255,Ze[2]=c>>>16&255,Ze[3]=c>>>24&255,i.check=w(i.check,Ze,4,0)),c=0,de=0,i.mode=T;case T:for(;de<16;){if(0===f)break e;f--,c+=a[o++]<>8),512&i.flags&&(Ze[0]=255&c,Ze[1]=c>>>8&255,i.check=w(i.check,Ze,2,0)),c=0,de=0,i.mode=U;case U:if(1024&i.flags){for(;de<16;){if(0===f)break e;f--,c+=a[o++]<>>8&255,i.check=w(i.check,Ze,2,0)),c=0,de=0}else i.head&&(i.head.extra=null);i.mode=D;case D:if(1024&i.flags&&((he=i.length)>f&&(he=f),he&&(i.head&&(xe=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),h.arraySet(i.head.extra,a,o,he,xe)),512&i.flags&&(i.check=w(i.check,a,he,o)),f-=he,o+=he,i.length-=he),i.length))break e;i.length=0,i.mode=F;case F:if(2048&i.flags){if(0===f)break e;he=0;do{xe=a[o+he++],i.head&&xe&&i.length<65536&&(i.head.name+=String.fromCharCode(xe))}while(xe&&he>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=K;break;case j:for(;de<32;){if(0===f)break e;f--,c+=a[o++]<>>=7&de,de-=7&de,i.mode=ae;break}for(;de<3;){if(0===f)break e;f--,c+=a[o++]<>>=1,de-=1,3&c){case 0:i.mode=Y;break;case 1:if(l(i),i.mode=Q,t===y){c>>>=2,de-=2;break e}break;case 2:i.mode=X;break;case 3:e.msg="invalid block type",i.mode=se}c>>>=2,de-=2;break;case Y:for(c>>>=7&de,de-=7&de;de<32;){if(0===f)break e;f--,c+=a[o++]<>>16^65535)){e.msg="invalid stored block lengths",i.mode=se;break}if(i.length=65535&c,c=0,de=0,i.mode=q,t===y)break e;case q:i.mode=G;case G:if(he=i.length){if(he>f&&(he=f),he>u&&(he=u),0===he)break e;h.arraySet(r,a,o,he,s),f-=he,o+=he,u-=he,s+=he,i.length-=he;break}i.mode=K;break;case X:for(;de<14;){if(0===f)break e;f--,c+=a[o++]<>>=5,de-=5,i.ndist=1+(31&c),c>>>=5,de-=5,i.ncode=4+(15&c),c>>>=4,de-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=se;break}i.have=0,i.mode=W;case W:for(;i.have>>=3,de-=3}for(;i.have<19;)i.lens[Ae[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,Se={bits:i.lenbits},ye=k(_,i.lens,0,19,i.lencode,0,i.work,Se),i.lenbits=Se.bits,ye){e.msg="invalid code lengths set",i.mode=se;break}i.have=0,i.mode=J;case J:for(;i.have>>24,ke=Be>>>16&255,_e=65535&Be,!(me<=de);){if(0===f)break e;f--,c+=a[o++]<>>=me,de-=me,i.lens[i.have++]=_e;else{if(16===_e){for(Ee=me+2;de>>=me,de-=me,0===i.have){e.msg="invalid bit length repeat",i.mode=se;break}xe=i.lens[i.have-1],he=3+(3&c),c>>>=2,de-=2}else if(17===_e){for(Ee=me+3;de>>=me)),c>>>=3,de-=3}else{for(Ee=me+7;de>>=me)),c>>>=7,de-=7}if(i.have+he>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=se;break}for(;he--;)i.lens[i.have++]=xe}}if(i.mode===se)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=se;break}if(i.lenbits=9,Se={bits:i.lenbits},ye=k(g,i.lens,0,i.nlen,i.lencode,0,i.work,Se),i.lenbits=Se.bits,ye){e.msg="invalid literal/lengths set",i.mode=se;break}if(i.distbits=6,i.distcode=i.distdyn,Se={bits:i.distbits},ye=k(v,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,Se),i.distbits=Se.bits,ye){e.msg="invalid distances set",i.mode=se;break}if(i.mode=Q,t===y)break e;case Q:i.mode=V;case V:if(f>=6&&u>=258){e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=f,i.hold=c,i.bits=de,m(e,ce),s=e.next_out,r=e.output,u=e.avail_out,o=e.next_in,a=e.input,f=e.avail_in,c=i.hold,de=i.bits,i.mode===K&&(i.back=-1);break}for(i.back=0;Be=i.lencode[c&(1<>>24,ke=Be>>>16&255,_e=65535&Be,!(me<=de);){if(0===f)break e;f--,c+=a[o++]<>ge)],me=Be>>>24,ke=Be>>>16&255,_e=65535&Be,!(ge+me<=de);){if(0===f)break e;f--,c+=a[o++]<>>=ge,de-=ge,i.back+=ge}if(c>>>=me,de-=me,i.back+=me,i.length=_e,0===ke){i.mode=ne;break}if(32&ke){i.back=-1,i.mode=K;break}if(64&ke){e.msg="invalid literal/length code",i.mode=se;break}i.extra=15&ke,i.mode=$;case $:if(i.extra){for(Ee=i.extra;de>>=i.extra,de-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=ee;case ee:for(;Be=i.distcode[c&(1<>>24,ke=Be>>>16&255,_e=65535&Be,!(me<=de);){if(0===f)break e;f--,c+=a[o++]<>ge)],me=Be>>>24,ke=Be>>>16&255,_e=65535&Be,!(ge+me<=de);){if(0===f)break e;f--,c+=a[o++]<>>=ge,de-=ge,i.back+=ge}if(c>>>=me,de-=me,i.back+=me,64&ke){e.msg="invalid distance code",i.mode=se;break}i.offset=_e,i.extra=15&ke,i.mode=te;case te:if(i.extra){for(Ee=i.extra;de>>=i.extra,de-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=se;break}i.mode=ie;case ie:if(0===u)break e;if(he=ce-u,i.offset>he){if((he=i.offset-he)>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=se;break}he>i.wnext?(he-=i.wnext,be=i.wsize-he):be=i.wnext-he,he>i.length&&(he=i.length),we=i.window}else we=r,be=s-i.offset,he=i.length;he>u&&(he=u),u-=he,i.length-=he;do{r[s++]=we[be++]}while(--he);0===i.length&&(i.mode=V);break;case ne:if(0===u)break e;r[s++]=i.length,u--,i.mode=V;break;case ae:if(i.wrap){for(;de<32;){if(0===f)break e;f--,c|=a[o++]<=1&&0===T[B];B--);if(Z>B&&(Z=B),0===B)return l[d++]=20971520,l[d++]=20971520,c.bits=1,0;for(E=1;E0&&(0===e||1!==B))return-1;for(U[1]=0,y=1;y<15;y++)U[y+1]=U[y]+T[y];for(S=0;S852||2===e&&N>592)return 1;for(;;){g=y-z,u[S]<_?(v=0,p=u[S]):u[S]>_?(v=D[F+u[S]],p=C[I+u[S]]):(v=96,p=0),h=1<>z)+(b-=h)]=g<<24|v<<16|p|0}while(0!==b);for(h=1<>=1;if(0!==h?(O&=h-1,O+=h):O=0,S++,0==--T[y]){if(y===B)break;y=t[i+u[S]]}if(y>Z&&(O&m)!==w){for(0===z&&(z=Z),k+=E,R=1<<(A=y-z);A+z852||2===e&&N>592)return 1;l[w=O&m]=Z<<24|A<<16|k-d|0}}return 0!==O&&(l[k+O]=y-z<<24|64<<16|0),c.bits=Z,0}},{"../utils/common":1}],10:[function(e,t,i){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(e,t,i){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/lib/inflate.js":[function(e,t,i){"use strict";function n(e){if(!(this instanceof n))return new n(e);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var i=r.inflateInit2(this.strm,t.windowBits);if(i!==f.Z_OK)throw new Error(l[i]);this.header=new u,r.inflateGetHeader(this.strm,this.header)}function a(e,t){var i=new n(t);if(i.push(e,!0),i.err)throw i.msg||l[i.err];return i.result}var r=e("./zlib/inflate"),o=e("./utils/common"),s=e("./utils/strings"),f=e("./zlib/constants"),l=e("./zlib/messages"),d=e("./zlib/zstream"),u=e("./zlib/gzheader"),c=Object.prototype.toString;n.prototype.push=function(e,t){var i,n,a,l,d,u,h=this.strm,b=this.options.chunkSize,w=this.options.dictionary,m=!1;if(this.ended)return!1;n=t===~~t?t:!0===t?f.Z_FINISH:f.Z_NO_FLUSH,"string"==typeof e?h.input=s.binstring2buf(e):"[object ArrayBuffer]"===c.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new o.Buf8(b),h.next_out=0,h.avail_out=b),(i=r.inflate(h,f.Z_NO_FLUSH))===f.Z_NEED_DICT&&w&&(u="string"==typeof w?s.string2buf(w):"[object ArrayBuffer]"===c.call(w)?new Uint8Array(w):w,i=r.inflateSetDictionary(this.strm,u)),i===f.Z_BUF_ERROR&&!0===m&&(i=f.Z_OK,m=!1),i!==f.Z_STREAM_END&&i!==f.Z_OK)return this.onEnd(i),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&i!==f.Z_STREAM_END&&(0!==h.avail_in||n!==f.Z_FINISH&&n!==f.Z_SYNC_FLUSH)||("string"===this.options.to?(a=s.utf8border(h.output,h.next_out),l=h.next_out-a,d=s.buf2string(h.output,a),h.next_out=l,h.avail_out=b-l,l&&o.arraySet(h.output,h.output,a,l,0),this.onData(d)):this.onData(o.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(m=!0)}while((h.avail_in>0||0===h.avail_out)&&i!==f.Z_STREAM_END);return i===f.Z_STREAM_END&&(n=f.Z_FINISH),n===f.Z_FINISH?(i=r.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===f.Z_OK):n!==f.Z_SYNC_FLUSH||(this.onEnd(f.Z_OK),h.avail_out=0,!0)},n.prototype.onData=function(e){this.chunks.push(e)},n.prototype.onEnd=function(e){e===f.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},i.Inflate=n,i.inflate=a,i.inflateRaw=function(e,t){return t=t||{},t.raw=!0,a(e,t)},i.ungzip=a},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")}); diff --git a/node_modules/pako/index.js b/node_modules/pako/index.js new file mode 100644 index 000000000..cd0725152 --- /dev/null +++ b/node_modules/pako/index.js @@ -0,0 +1,14 @@ +// Top level file is just a mixin of submodules & constants +'use strict'; + +var assign = require('./lib/utils/common').assign; + +var deflate = require('./lib/deflate'); +var inflate = require('./lib/inflate'); +var constants = require('./lib/zlib/constants'); + +var pako = {}; + +assign(pako, deflate, inflate, constants); + +module.exports = pako; diff --git a/node_modules/pako/lib/deflate.js b/node_modules/pako/lib/deflate.js new file mode 100644 index 000000000..efeb00c7b --- /dev/null +++ b/node_modules/pako/lib/deflate.js @@ -0,0 +1,400 @@ +'use strict'; + + +var zlib_deflate = require('./zlib/deflate'); +var utils = require('./utils/common'); +var strings = require('./utils/strings'); +var msg = require('./zlib/messages'); +var ZStream = require('./zlib/zstream'); + +var toString = Object.prototype.toString; + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + +var Z_NO_FLUSH = 0; +var Z_FINISH = 4; + +var Z_OK = 0; +var Z_STREAM_END = 1; +var Z_SYNC_FLUSH = 2; + +var Z_DEFAULT_COMPRESSION = -1; + +var Z_DEFAULT_STRATEGY = 0; + +var Z_DEFLATED = 8; + +/* ===========================================================================*/ + + +/** + * class Deflate + * + * Generic JS-style wrapper for zlib calls. If you don't need + * streaming behaviour - use more simple functions: [[deflate]], + * [[deflateRaw]] and [[gzip]]. + **/ + +/* internal + * Deflate.chunks -> Array + * + * Chunks of output data, if [[Deflate#onData]] not overridden. + **/ + +/** + * Deflate.result -> Uint8Array|Array + * + * Compressed result, generated by default [[Deflate#onData]] + * and [[Deflate#onEnd]] handlers. Filled after you push last chunk + * (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you + * push a chunk with explicit flush (call [[Deflate#push]] with + * `Z_SYNC_FLUSH` param). + **/ + +/** + * Deflate.err -> Number + * + * Error code after deflate finished. 0 (Z_OK) on success. + * You will not need it in real life, because deflate errors + * are possible only on wrong options or bad `onData` / `onEnd` + * custom handlers. + **/ + +/** + * Deflate.msg -> String + * + * Error message, if [[Deflate.err]] != 0 + **/ + + +/** + * new Deflate(options) + * - options (Object): zlib deflate options. + * + * Creates new deflator instance with specified params. Throws exception + * on bad params. Supported options: + * + * - `level` + * - `windowBits` + * - `memLevel` + * - `strategy` + * - `dictionary` + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information on these. + * + * Additional options, for internal needs: + * + * - `chunkSize` - size of generated data chunks (16K by default) + * - `raw` (Boolean) - do raw deflate + * - `gzip` (Boolean) - create gzip wrapper + * - `to` (String) - if equal to 'string', then result will be "binary string" + * (each char code [0..255]) + * - `header` (Object) - custom header for gzip + * - `text` (Boolean) - true if compressed data believed to be text + * - `time` (Number) - modification time, unix timestamp + * - `os` (Number) - operation system code + * - `extra` (Array) - array of bytes with extra data (max 65536) + * - `name` (String) - file name (binary string) + * - `comment` (String) - comment (binary string) + * - `hcrc` (Boolean) - true if header crc should be added + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) + * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); + * + * var deflate = new pako.Deflate({ level: 3}); + * + * deflate.push(chunk1, false); + * deflate.push(chunk2, true); // true -> last chunk + * + * if (deflate.err) { throw new Error(deflate.err); } + * + * console.log(deflate.result); + * ``` + **/ +function Deflate(options) { + if (!(this instanceof Deflate)) return new Deflate(options); + + this.options = utils.assign({ + level: Z_DEFAULT_COMPRESSION, + method: Z_DEFLATED, + chunkSize: 16384, + windowBits: 15, + memLevel: 8, + strategy: Z_DEFAULT_STRATEGY, + to: '' + }, options || {}); + + var opt = this.options; + + if (opt.raw && (opt.windowBits > 0)) { + opt.windowBits = -opt.windowBits; + } + + else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) { + opt.windowBits += 16; + } + + this.err = 0; // error code, if happens (0 = Z_OK) + this.msg = ''; // error message + this.ended = false; // used to avoid multiple onEnd() calls + this.chunks = []; // chunks of compressed data + + this.strm = new ZStream(); + this.strm.avail_out = 0; + + var status = zlib_deflate.deflateInit2( + this.strm, + opt.level, + opt.method, + opt.windowBits, + opt.memLevel, + opt.strategy + ); + + if (status !== Z_OK) { + throw new Error(msg[status]); + } + + if (opt.header) { + zlib_deflate.deflateSetHeader(this.strm, opt.header); + } + + if (opt.dictionary) { + var dict; + // Convert data if needed + if (typeof opt.dictionary === 'string') { + // If we need to compress text, change encoding to utf8. + dict = strings.string2buf(opt.dictionary); + } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { + dict = new Uint8Array(opt.dictionary); + } else { + dict = opt.dictionary; + } + + status = zlib_deflate.deflateSetDictionary(this.strm, dict); + + if (status !== Z_OK) { + throw new Error(msg[status]); + } + + this._dict_set = true; + } +} + +/** + * Deflate#push(data[, mode]) -> Boolean + * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be + * converted to utf8 byte sequence. + * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. + * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH. + * + * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with + * new compressed chunks. Returns `true` on success. The last data block must have + * mode Z_FINISH (or `true`). That will flush internal pending buffers and call + * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you + * can use mode Z_SYNC_FLUSH, keeping the compression context. + * + * On fail call [[Deflate#onEnd]] with error code and return false. + * + * We strongly recommend to use `Uint8Array` on input for best speed (output + * array format is detected automatically). Also, don't skip last param and always + * use the same type in your code (boolean or number). That will improve JS speed. + * + * For regular `Array`-s make sure all elements are [0..255]. + * + * ##### Example + * + * ```javascript + * push(chunk, false); // push one of data chunks + * ... + * push(chunk, true); // push last chunk + * ``` + **/ +Deflate.prototype.push = function (data, mode) { + var strm = this.strm; + var chunkSize = this.options.chunkSize; + var status, _mode; + + if (this.ended) { return false; } + + _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH); + + // Convert data if needed + if (typeof data === 'string') { + // If we need to compress text, change encoding to utf8. + strm.input = strings.string2buf(data); + } else if (toString.call(data) === '[object ArrayBuffer]') { + strm.input = new Uint8Array(data); + } else { + strm.input = data; + } + + strm.next_in = 0; + strm.avail_in = strm.input.length; + + do { + if (strm.avail_out === 0) { + strm.output = new utils.Buf8(chunkSize); + strm.next_out = 0; + strm.avail_out = chunkSize; + } + status = zlib_deflate.deflate(strm, _mode); /* no bad return value */ + + if (status !== Z_STREAM_END && status !== Z_OK) { + this.onEnd(status); + this.ended = true; + return false; + } + if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) { + if (this.options.to === 'string') { + this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out))); + } else { + this.onData(utils.shrinkBuf(strm.output, strm.next_out)); + } + } + } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END); + + // Finalize on the last chunk. + if (_mode === Z_FINISH) { + status = zlib_deflate.deflateEnd(this.strm); + this.onEnd(status); + this.ended = true; + return status === Z_OK; + } + + // callback interim results if Z_SYNC_FLUSH. + if (_mode === Z_SYNC_FLUSH) { + this.onEnd(Z_OK); + strm.avail_out = 0; + return true; + } + + return true; +}; + + +/** + * Deflate#onData(chunk) -> Void + * - chunk (Uint8Array|Array|String): output data. Type of array depends + * on js engine support. When string output requested, each chunk + * will be string. + * + * By default, stores data blocks in `chunks[]` property and glue + * those in `onEnd`. Override this handler, if you need another behaviour. + **/ +Deflate.prototype.onData = function (chunk) { + this.chunks.push(chunk); +}; + + +/** + * Deflate#onEnd(status) -> Void + * - status (Number): deflate status. 0 (Z_OK) on success, + * other if not. + * + * Called once after you tell deflate that the input stream is + * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH) + * or if an error happened. By default - join collected chunks, + * free memory and fill `results` / `err` properties. + **/ +Deflate.prototype.onEnd = function (status) { + // On success - join + if (status === Z_OK) { + if (this.options.to === 'string') { + this.result = this.chunks.join(''); + } else { + this.result = utils.flattenChunks(this.chunks); + } + } + this.chunks = []; + this.err = status; + this.msg = this.strm.msg; +}; + + +/** + * deflate(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to compress. + * - options (Object): zlib deflate options. + * + * Compress `data` with deflate algorithm and `options`. + * + * Supported options are: + * + * - level + * - windowBits + * - memLevel + * - strategy + * - dictionary + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information on these. + * + * Sugar (options): + * + * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify + * negative windowBits implicitly. + * - `to` (String) - if equal to 'string', then result will be "binary string" + * (each char code [0..255]) + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , data = Uint8Array([1,2,3,4,5,6,7,8,9]); + * + * console.log(pako.deflate(data)); + * ``` + **/ +function deflate(input, options) { + var deflator = new Deflate(options); + + deflator.push(input, true); + + // That will never happens, if you don't cheat with options :) + if (deflator.err) { throw deflator.msg || msg[deflator.err]; } + + return deflator.result; +} + + +/** + * deflateRaw(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to compress. + * - options (Object): zlib deflate options. + * + * The same as [[deflate]], but creates raw data, without wrapper + * (header and adler32 crc). + **/ +function deflateRaw(input, options) { + options = options || {}; + options.raw = true; + return deflate(input, options); +} + + +/** + * gzip(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to compress. + * - options (Object): zlib deflate options. + * + * The same as [[deflate]], but create gzip wrapper instead of + * deflate one. + **/ +function gzip(input, options) { + options = options || {}; + options.gzip = true; + return deflate(input, options); +} + + +exports.Deflate = Deflate; +exports.deflate = deflate; +exports.deflateRaw = deflateRaw; +exports.gzip = gzip; diff --git a/node_modules/pako/lib/inflate.js b/node_modules/pako/lib/inflate.js new file mode 100644 index 000000000..4028130be --- /dev/null +++ b/node_modules/pako/lib/inflate.js @@ -0,0 +1,418 @@ +'use strict'; + + +var zlib_inflate = require('./zlib/inflate'); +var utils = require('./utils/common'); +var strings = require('./utils/strings'); +var c = require('./zlib/constants'); +var msg = require('./zlib/messages'); +var ZStream = require('./zlib/zstream'); +var GZheader = require('./zlib/gzheader'); + +var toString = Object.prototype.toString; + +/** + * class Inflate + * + * Generic JS-style wrapper for zlib calls. If you don't need + * streaming behaviour - use more simple functions: [[inflate]] + * and [[inflateRaw]]. + **/ + +/* internal + * inflate.chunks -> Array + * + * Chunks of output data, if [[Inflate#onData]] not overridden. + **/ + +/** + * Inflate.result -> Uint8Array|Array|String + * + * Uncompressed result, generated by default [[Inflate#onData]] + * and [[Inflate#onEnd]] handlers. Filled after you push last chunk + * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you + * push a chunk with explicit flush (call [[Inflate#push]] with + * `Z_SYNC_FLUSH` param). + **/ + +/** + * Inflate.err -> Number + * + * Error code after inflate finished. 0 (Z_OK) on success. + * Should be checked if broken data possible. + **/ + +/** + * Inflate.msg -> String + * + * Error message, if [[Inflate.err]] != 0 + **/ + + +/** + * new Inflate(options) + * - options (Object): zlib inflate options. + * + * Creates new inflator instance with specified params. Throws exception + * on bad params. Supported options: + * + * - `windowBits` + * - `dictionary` + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information on these. + * + * Additional options, for internal needs: + * + * - `chunkSize` - size of generated data chunks (16K by default) + * - `raw` (Boolean) - do raw inflate + * - `to` (String) - if equal to 'string', then result will be converted + * from utf8 to utf16 (javascript) string. When string output requested, + * chunk length can differ from `chunkSize`, depending on content. + * + * By default, when no options set, autodetect deflate/gzip data format via + * wrapper header. + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) + * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); + * + * var inflate = new pako.Inflate({ level: 3}); + * + * inflate.push(chunk1, false); + * inflate.push(chunk2, true); // true -> last chunk + * + * if (inflate.err) { throw new Error(inflate.err); } + * + * console.log(inflate.result); + * ``` + **/ +function Inflate(options) { + if (!(this instanceof Inflate)) return new Inflate(options); + + this.options = utils.assign({ + chunkSize: 16384, + windowBits: 0, + to: '' + }, options || {}); + + var opt = this.options; + + // Force window size for `raw` data, if not set directly, + // because we have no header for autodetect. + if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) { + opt.windowBits = -opt.windowBits; + if (opt.windowBits === 0) { opt.windowBits = -15; } + } + + // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate + if ((opt.windowBits >= 0) && (opt.windowBits < 16) && + !(options && options.windowBits)) { + opt.windowBits += 32; + } + + // Gzip header has no info about windows size, we can do autodetect only + // for deflate. So, if window size not set, force it to max when gzip possible + if ((opt.windowBits > 15) && (opt.windowBits < 48)) { + // bit 3 (16) -> gzipped data + // bit 4 (32) -> autodetect gzip/deflate + if ((opt.windowBits & 15) === 0) { + opt.windowBits |= 15; + } + } + + this.err = 0; // error code, if happens (0 = Z_OK) + this.msg = ''; // error message + this.ended = false; // used to avoid multiple onEnd() calls + this.chunks = []; // chunks of compressed data + + this.strm = new ZStream(); + this.strm.avail_out = 0; + + var status = zlib_inflate.inflateInit2( + this.strm, + opt.windowBits + ); + + if (status !== c.Z_OK) { + throw new Error(msg[status]); + } + + this.header = new GZheader(); + + zlib_inflate.inflateGetHeader(this.strm, this.header); +} + +/** + * Inflate#push(data[, mode]) -> Boolean + * - data (Uint8Array|Array|ArrayBuffer|String): input data + * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. + * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH. + * + * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with + * new output chunks. Returns `true` on success. The last data block must have + * mode Z_FINISH (or `true`). That will flush internal pending buffers and call + * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you + * can use mode Z_SYNC_FLUSH, keeping the decompression context. + * + * On fail call [[Inflate#onEnd]] with error code and return false. + * + * We strongly recommend to use `Uint8Array` on input for best speed (output + * format is detected automatically). Also, don't skip last param and always + * use the same type in your code (boolean or number). That will improve JS speed. + * + * For regular `Array`-s make sure all elements are [0..255]. + * + * ##### Example + * + * ```javascript + * push(chunk, false); // push one of data chunks + * ... + * push(chunk, true); // push last chunk + * ``` + **/ +Inflate.prototype.push = function (data, mode) { + var strm = this.strm; + var chunkSize = this.options.chunkSize; + var dictionary = this.options.dictionary; + var status, _mode; + var next_out_utf8, tail, utf8str; + var dict; + + // Flag to properly process Z_BUF_ERROR on testing inflate call + // when we check that all output data was flushed. + var allowBufError = false; + + if (this.ended) { return false; } + _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH); + + // Convert data if needed + if (typeof data === 'string') { + // Only binary strings can be decompressed on practice + strm.input = strings.binstring2buf(data); + } else if (toString.call(data) === '[object ArrayBuffer]') { + strm.input = new Uint8Array(data); + } else { + strm.input = data; + } + + strm.next_in = 0; + strm.avail_in = strm.input.length; + + do { + if (strm.avail_out === 0) { + strm.output = new utils.Buf8(chunkSize); + strm.next_out = 0; + strm.avail_out = chunkSize; + } + + status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */ + + if (status === c.Z_NEED_DICT && dictionary) { + // Convert data if needed + if (typeof dictionary === 'string') { + dict = strings.string2buf(dictionary); + } else if (toString.call(dictionary) === '[object ArrayBuffer]') { + dict = new Uint8Array(dictionary); + } else { + dict = dictionary; + } + + status = zlib_inflate.inflateSetDictionary(this.strm, dict); + + } + + if (status === c.Z_BUF_ERROR && allowBufError === true) { + status = c.Z_OK; + allowBufError = false; + } + + if (status !== c.Z_STREAM_END && status !== c.Z_OK) { + this.onEnd(status); + this.ended = true; + return false; + } + + if (strm.next_out) { + if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) { + + if (this.options.to === 'string') { + + next_out_utf8 = strings.utf8border(strm.output, strm.next_out); + + tail = strm.next_out - next_out_utf8; + utf8str = strings.buf2string(strm.output, next_out_utf8); + + // move tail + strm.next_out = tail; + strm.avail_out = chunkSize - tail; + if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); } + + this.onData(utf8str); + + } else { + this.onData(utils.shrinkBuf(strm.output, strm.next_out)); + } + } + } + + // When no more input data, we should check that internal inflate buffers + // are flushed. The only way to do it when avail_out = 0 - run one more + // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR. + // Here we set flag to process this error properly. + // + // NOTE. Deflate does not return error in this case and does not needs such + // logic. + if (strm.avail_in === 0 && strm.avail_out === 0) { + allowBufError = true; + } + + } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END); + + if (status === c.Z_STREAM_END) { + _mode = c.Z_FINISH; + } + + // Finalize on the last chunk. + if (_mode === c.Z_FINISH) { + status = zlib_inflate.inflateEnd(this.strm); + this.onEnd(status); + this.ended = true; + return status === c.Z_OK; + } + + // callback interim results if Z_SYNC_FLUSH. + if (_mode === c.Z_SYNC_FLUSH) { + this.onEnd(c.Z_OK); + strm.avail_out = 0; + return true; + } + + return true; +}; + + +/** + * Inflate#onData(chunk) -> Void + * - chunk (Uint8Array|Array|String): output data. Type of array depends + * on js engine support. When string output requested, each chunk + * will be string. + * + * By default, stores data blocks in `chunks[]` property and glue + * those in `onEnd`. Override this handler, if you need another behaviour. + **/ +Inflate.prototype.onData = function (chunk) { + this.chunks.push(chunk); +}; + + +/** + * Inflate#onEnd(status) -> Void + * - status (Number): inflate status. 0 (Z_OK) on success, + * other if not. + * + * Called either after you tell inflate that the input stream is + * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH) + * or if an error happened. By default - join collected chunks, + * free memory and fill `results` / `err` properties. + **/ +Inflate.prototype.onEnd = function (status) { + // On success - join + if (status === c.Z_OK) { + if (this.options.to === 'string') { + // Glue & convert here, until we teach pako to send + // utf8 aligned strings to onData + this.result = this.chunks.join(''); + } else { + this.result = utils.flattenChunks(this.chunks); + } + } + this.chunks = []; + this.err = status; + this.msg = this.strm.msg; +}; + + +/** + * inflate(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * Decompress `data` with inflate/ungzip and `options`. Autodetect + * format via wrapper header by default. That's why we don't provide + * separate `ungzip` method. + * + * Supported options are: + * + * - windowBits + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information. + * + * Sugar (options): + * + * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify + * negative windowBits implicitly. + * - `to` (String) - if equal to 'string', then result will be converted + * from utf8 to utf16 (javascript) string. When string output requested, + * chunk length can differ from `chunkSize`, depending on content. + * + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , input = pako.deflate([1,2,3,4,5,6,7,8,9]) + * , output; + * + * try { + * output = pako.inflate(input); + * } catch (err) + * console.log(err); + * } + * ``` + **/ +function inflate(input, options) { + var inflator = new Inflate(options); + + inflator.push(input, true); + + // That will never happens, if you don't cheat with options :) + if (inflator.err) { throw inflator.msg || msg[inflator.err]; } + + return inflator.result; +} + + +/** + * inflateRaw(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * The same as [[inflate]], but creates raw data, without wrapper + * (header and adler32 crc). + **/ +function inflateRaw(input, options) { + options = options || {}; + options.raw = true; + return inflate(input, options); +} + + +/** + * ungzip(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * Just shortcut to [[inflate]], because it autodetects format + * by header.content. Done for convenience. + **/ + + +exports.Inflate = Inflate; +exports.inflate = inflate; +exports.inflateRaw = inflateRaw; +exports.ungzip = inflate; diff --git a/node_modules/pako/lib/utils/common.js b/node_modules/pako/lib/utils/common.js new file mode 100644 index 000000000..58be4beb4 --- /dev/null +++ b/node_modules/pako/lib/utils/common.js @@ -0,0 +1,105 @@ +'use strict'; + + +var TYPED_OK = (typeof Uint8Array !== 'undefined') && + (typeof Uint16Array !== 'undefined') && + (typeof Int32Array !== 'undefined'); + +function _has(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} + +exports.assign = function (obj /*from1, from2, from3, ...*/) { + var sources = Array.prototype.slice.call(arguments, 1); + while (sources.length) { + var source = sources.shift(); + if (!source) { continue; } + + if (typeof source !== 'object') { + throw new TypeError(source + 'must be non-object'); + } + + for (var p in source) { + if (_has(source, p)) { + obj[p] = source[p]; + } + } + } + + return obj; +}; + + +// reduce buffer size, avoiding mem copy +exports.shrinkBuf = function (buf, size) { + if (buf.length === size) { return buf; } + if (buf.subarray) { return buf.subarray(0, size); } + buf.length = size; + return buf; +}; + + +var fnTyped = { + arraySet: function (dest, src, src_offs, len, dest_offs) { + if (src.subarray && dest.subarray) { + dest.set(src.subarray(src_offs, src_offs + len), dest_offs); + return; + } + // Fallback to ordinary array + for (var i = 0; i < len; i++) { + dest[dest_offs + i] = src[src_offs + i]; + } + }, + // Join array of chunks to single array. + flattenChunks: function (chunks) { + var i, l, len, pos, chunk, result; + + // calculate data length + len = 0; + for (i = 0, l = chunks.length; i < l; i++) { + len += chunks[i].length; + } + + // join chunks + result = new Uint8Array(len); + pos = 0; + for (i = 0, l = chunks.length; i < l; i++) { + chunk = chunks[i]; + result.set(chunk, pos); + pos += chunk.length; + } + + return result; + } +}; + +var fnUntyped = { + arraySet: function (dest, src, src_offs, len, dest_offs) { + for (var i = 0; i < len; i++) { + dest[dest_offs + i] = src[src_offs + i]; + } + }, + // Join array of chunks to single array. + flattenChunks: function (chunks) { + return [].concat.apply([], chunks); + } +}; + + +// Enable/Disable typed arrays use, for testing +// +exports.setTyped = function (on) { + if (on) { + exports.Buf8 = Uint8Array; + exports.Buf16 = Uint16Array; + exports.Buf32 = Int32Array; + exports.assign(exports, fnTyped); + } else { + exports.Buf8 = Array; + exports.Buf16 = Array; + exports.Buf32 = Array; + exports.assign(exports, fnUntyped); + } +}; + +exports.setTyped(TYPED_OK); diff --git a/node_modules/pako/lib/utils/strings.js b/node_modules/pako/lib/utils/strings.js new file mode 100644 index 000000000..313c27b9b --- /dev/null +++ b/node_modules/pako/lib/utils/strings.js @@ -0,0 +1,185 @@ +// String encode/decode helpers +'use strict'; + + +var utils = require('./common'); + + +// Quick check if we can use fast array to bin string conversion +// +// - apply(Array) can fail on Android 2.2 +// - apply(Uint8Array) can fail on iOS 5.1 Safari +// +var STR_APPLY_OK = true; +var STR_APPLY_UIA_OK = true; + +try { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; } +try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; } + + +// Table with utf8 lengths (calculated by first byte of sequence) +// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS, +// because max possible codepoint is 0x10ffff +var _utf8len = new utils.Buf8(256); +for (var q = 0; q < 256; q++) { + _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1); +} +_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start + + +// convert string to array (typed, when possible) +exports.string2buf = function (str) { + var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; + + // count binary size + for (m_pos = 0; m_pos < str_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4; + } + + // allocate buffer + buf = new utils.Buf8(buf_len); + + // convert + for (i = 0, m_pos = 0; i < buf_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + if (c < 0x80) { + /* one byte */ + buf[i++] = c; + } else if (c < 0x800) { + /* two bytes */ + buf[i++] = 0xC0 | (c >>> 6); + buf[i++] = 0x80 | (c & 0x3f); + } else if (c < 0x10000) { + /* three bytes */ + buf[i++] = 0xE0 | (c >>> 12); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } else { + /* four bytes */ + buf[i++] = 0xf0 | (c >>> 18); + buf[i++] = 0x80 | (c >>> 12 & 0x3f); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } + } + + return buf; +}; + +// Helper (used in 2 places) +function buf2binstring(buf, len) { + // use fallback for big arrays to avoid stack overflow + if (len < 65537) { + if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) { + return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len)); + } + } + + var result = ''; + for (var i = 0; i < len; i++) { + result += String.fromCharCode(buf[i]); + } + return result; +} + + +// Convert byte array to binary string +exports.buf2binstring = function (buf) { + return buf2binstring(buf, buf.length); +}; + + +// Convert binary string (typed, when possible) +exports.binstring2buf = function (str) { + var buf = new utils.Buf8(str.length); + for (var i = 0, len = buf.length; i < len; i++) { + buf[i] = str.charCodeAt(i); + } + return buf; +}; + + +// convert array to string +exports.buf2string = function (buf, max) { + var i, out, c, c_len; + var len = max || buf.length; + + // Reserve max possible length (2 words per char) + // NB: by unknown reasons, Array is significantly faster for + // String.fromCharCode.apply than Uint16Array. + var utf16buf = new Array(len * 2); + + for (out = 0, i = 0; i < len;) { + c = buf[i++]; + // quick process ascii + if (c < 0x80) { utf16buf[out++] = c; continue; } + + c_len = _utf8len[c]; + // skip 5 & 6 byte codes + if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; } + + // apply mask on first byte + c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07; + // join the rest + while (c_len > 1 && i < len) { + c = (c << 6) | (buf[i++] & 0x3f); + c_len--; + } + + // terminated by end of string? + if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; } + + if (c < 0x10000) { + utf16buf[out++] = c; + } else { + c -= 0x10000; + utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff); + utf16buf[out++] = 0xdc00 | (c & 0x3ff); + } + } + + return buf2binstring(utf16buf, out); +}; + + +// Calculate max possible position in utf8 buffer, +// that will not break sequence. If that's not possible +// - (very small limits) return max size as is. +// +// buf[] - utf8 bytes array +// max - length limit (mandatory); +exports.utf8border = function (buf, max) { + var pos; + + max = max || buf.length; + if (max > buf.length) { max = buf.length; } + + // go back from last position, until start of sequence found + pos = max - 1; + while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; } + + // Very small and broken sequence, + // return max, because we should return something anyway. + if (pos < 0) { return max; } + + // If we came to start of buffer - that means buffer is too small, + // return max too. + if (pos === 0) { return max; } + + return (pos + _utf8len[buf[pos]] > max) ? pos : max; +}; diff --git a/node_modules/pako/lib/zlib/README b/node_modules/pako/lib/zlib/README new file mode 100644 index 000000000..88a875247 --- /dev/null +++ b/node_modules/pako/lib/zlib/README @@ -0,0 +1,59 @@ +Content of this folder follows zlib C sources as close as possible. +That's intended to simplify maintainability and guarantee equal API +and result. + +Key differences: + +- Everything is in JavaScript. +- No platform-dependent blocks. +- Some things like crc32 rewritten to keep size small and make JIT + work better. +- Some code is different due missed features in JS (macros, pointers, + structures, header files) +- Specific API methods are not implemented (see notes in root readme) + +This port is based on zlib 1.2.8. + +This port is under zlib license (see below) with contribution and addition of javascript +port under expat license (see LICENSE at root of project) + +Copyright: +(C) 1995-2013 Jean-loup Gailly and Mark Adler +(C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin + + +From zlib's README +============================================================================= + +Acknowledgments: + + The deflate format used by zlib was defined by Phil Katz. The deflate and + zlib specifications were written by L. Peter Deutsch. Thanks to all the + people who reported problems and suggested various improvements in zlib; they + are too numerous to cite here. + +Copyright notice: + + (C) 1995-2013 Jean-loup Gailly and Mark Adler + +Copyright (c) <''year''> <''copyright holders''> + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. + + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu diff --git a/node_modules/pako/lib/zlib/adler32.js b/node_modules/pako/lib/zlib/adler32.js new file mode 100644 index 000000000..d440a9810 --- /dev/null +++ b/node_modules/pako/lib/zlib/adler32.js @@ -0,0 +1,51 @@ +'use strict'; + +// Note: adler32 takes 12% for level 0 and 2% for level 6. +// It isn't worth it to make additional optimizations as in original. +// Small size is preferable. + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +function adler32(adler, buf, len, pos) { + var s1 = (adler & 0xffff) |0, + s2 = ((adler >>> 16) & 0xffff) |0, + n = 0; + + while (len !== 0) { + // Set limit ~ twice less than 5552, to keep + // s2 in 31-bits, because we force signed ints. + // in other case %= will fail. + n = len > 2000 ? 2000 : len; + len -= n; + + do { + s1 = (s1 + buf[pos++]) |0; + s2 = (s2 + s1) |0; + } while (--n); + + s1 %= 65521; + s2 %= 65521; + } + + return (s1 | (s2 << 16)) |0; +} + + +module.exports = adler32; diff --git a/node_modules/pako/lib/zlib/constants.js b/node_modules/pako/lib/zlib/constants.js new file mode 100644 index 000000000..569b87241 --- /dev/null +++ b/node_modules/pako/lib/zlib/constants.js @@ -0,0 +1,68 @@ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +module.exports = { + + /* Allowed flush values; see deflate() and inflate() below for details */ + Z_NO_FLUSH: 0, + Z_PARTIAL_FLUSH: 1, + Z_SYNC_FLUSH: 2, + Z_FULL_FLUSH: 3, + Z_FINISH: 4, + Z_BLOCK: 5, + Z_TREES: 6, + + /* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ + Z_OK: 0, + Z_STREAM_END: 1, + Z_NEED_DICT: 2, + Z_ERRNO: -1, + Z_STREAM_ERROR: -2, + Z_DATA_ERROR: -3, + //Z_MEM_ERROR: -4, + Z_BUF_ERROR: -5, + //Z_VERSION_ERROR: -6, + + /* compression levels */ + Z_NO_COMPRESSION: 0, + Z_BEST_SPEED: 1, + Z_BEST_COMPRESSION: 9, + Z_DEFAULT_COMPRESSION: -1, + + + Z_FILTERED: 1, + Z_HUFFMAN_ONLY: 2, + Z_RLE: 3, + Z_FIXED: 4, + Z_DEFAULT_STRATEGY: 0, + + /* Possible values of the data_type field (though see inflate()) */ + Z_BINARY: 0, + Z_TEXT: 1, + //Z_ASCII: 1, // = Z_TEXT (deprecated) + Z_UNKNOWN: 2, + + /* The deflate compression method */ + Z_DEFLATED: 8 + //Z_NULL: null // Use -1 or null inline, depending on var type +}; diff --git a/node_modules/pako/lib/zlib/crc32.js b/node_modules/pako/lib/zlib/crc32.js new file mode 100644 index 000000000..6a9609246 --- /dev/null +++ b/node_modules/pako/lib/zlib/crc32.js @@ -0,0 +1,59 @@ +'use strict'; + +// Note: we can't get significant speed boost here. +// So write code to minimize size - no pregenerated tables +// and array tools dependencies. + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +// Use ordinary array, since untyped makes no boost here +function makeTable() { + var c, table = []; + + for (var n = 0; n < 256; n++) { + c = n; + for (var k = 0; k < 8; k++) { + c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); + } + table[n] = c; + } + + return table; +} + +// Create table on load. Just 255 signed longs. Not a problem. +var crcTable = makeTable(); + + +function crc32(crc, buf, len, pos) { + var t = crcTable, + end = pos + len; + + crc ^= -1; + + for (var i = pos; i < end; i++) { + crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF]; + } + + return (crc ^ (-1)); // >>> 0; +} + + +module.exports = crc32; diff --git a/node_modules/pako/lib/zlib/deflate.js b/node_modules/pako/lib/zlib/deflate.js new file mode 100644 index 000000000..f88ba1864 --- /dev/null +++ b/node_modules/pako/lib/zlib/deflate.js @@ -0,0 +1,1874 @@ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +var utils = require('../utils/common'); +var trees = require('./trees'); +var adler32 = require('./adler32'); +var crc32 = require('./crc32'); +var msg = require('./messages'); + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + + +/* Allowed flush values; see deflate() and inflate() below for details */ +var Z_NO_FLUSH = 0; +var Z_PARTIAL_FLUSH = 1; +//var Z_SYNC_FLUSH = 2; +var Z_FULL_FLUSH = 3; +var Z_FINISH = 4; +var Z_BLOCK = 5; +//var Z_TREES = 6; + + +/* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ +var Z_OK = 0; +var Z_STREAM_END = 1; +//var Z_NEED_DICT = 2; +//var Z_ERRNO = -1; +var Z_STREAM_ERROR = -2; +var Z_DATA_ERROR = -3; +//var Z_MEM_ERROR = -4; +var Z_BUF_ERROR = -5; +//var Z_VERSION_ERROR = -6; + + +/* compression levels */ +//var Z_NO_COMPRESSION = 0; +//var Z_BEST_SPEED = 1; +//var Z_BEST_COMPRESSION = 9; +var Z_DEFAULT_COMPRESSION = -1; + + +var Z_FILTERED = 1; +var Z_HUFFMAN_ONLY = 2; +var Z_RLE = 3; +var Z_FIXED = 4; +var Z_DEFAULT_STRATEGY = 0; + +/* Possible values of the data_type field (though see inflate()) */ +//var Z_BINARY = 0; +//var Z_TEXT = 1; +//var Z_ASCII = 1; // = Z_TEXT +var Z_UNKNOWN = 2; + + +/* The deflate compression method */ +var Z_DEFLATED = 8; + +/*============================================================================*/ + + +var MAX_MEM_LEVEL = 9; +/* Maximum value for memLevel in deflateInit2 */ +var MAX_WBITS = 15; +/* 32K LZ77 window */ +var DEF_MEM_LEVEL = 8; + + +var LENGTH_CODES = 29; +/* number of length codes, not counting the special END_BLOCK code */ +var LITERALS = 256; +/* number of literal bytes 0..255 */ +var L_CODES = LITERALS + 1 + LENGTH_CODES; +/* number of Literal or Length codes, including the END_BLOCK code */ +var D_CODES = 30; +/* number of distance codes */ +var BL_CODES = 19; +/* number of codes used to transfer the bit lengths */ +var HEAP_SIZE = 2 * L_CODES + 1; +/* maximum heap size */ +var MAX_BITS = 15; +/* All codes must not exceed MAX_BITS bits */ + +var MIN_MATCH = 3; +var MAX_MATCH = 258; +var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1); + +var PRESET_DICT = 0x20; + +var INIT_STATE = 42; +var EXTRA_STATE = 69; +var NAME_STATE = 73; +var COMMENT_STATE = 91; +var HCRC_STATE = 103; +var BUSY_STATE = 113; +var FINISH_STATE = 666; + +var BS_NEED_MORE = 1; /* block not completed, need more input or more output */ +var BS_BLOCK_DONE = 2; /* block flush performed */ +var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */ +var BS_FINISH_DONE = 4; /* finish done, accept no more input or output */ + +var OS_CODE = 0x03; // Unix :) . Don't detect, use this default. + +function err(strm, errorCode) { + strm.msg = msg[errorCode]; + return errorCode; +} + +function rank(f) { + return ((f) << 1) - ((f) > 4 ? 9 : 0); +} + +function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } + + +/* ========================================================================= + * Flush as much pending output as possible. All deflate() output goes + * through this function so some applications may wish to modify it + * to avoid allocating a large strm->output buffer and copying into it. + * (See also read_buf()). + */ +function flush_pending(strm) { + var s = strm.state; + + //_tr_flush_bits(s); + var len = s.pending; + if (len > strm.avail_out) { + len = strm.avail_out; + } + if (len === 0) { return; } + + utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out); + strm.next_out += len; + s.pending_out += len; + strm.total_out += len; + strm.avail_out -= len; + s.pending -= len; + if (s.pending === 0) { + s.pending_out = 0; + } +} + + +function flush_block_only(s, last) { + trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last); + s.block_start = s.strstart; + flush_pending(s.strm); +} + + +function put_byte(s, b) { + s.pending_buf[s.pending++] = b; +} + + +/* ========================================================================= + * Put a short in the pending buffer. The 16-bit value is put in MSB order. + * IN assertion: the stream state is correct and there is enough room in + * pending_buf. + */ +function putShortMSB(s, b) { +// put_byte(s, (Byte)(b >> 8)); +// put_byte(s, (Byte)(b & 0xff)); + s.pending_buf[s.pending++] = (b >>> 8) & 0xff; + s.pending_buf[s.pending++] = b & 0xff; +} + + +/* =========================================================================== + * Read a new buffer from the current input stream, update the adler32 + * and total number of bytes read. All deflate() input goes through + * this function so some applications may wish to modify it to avoid + * allocating a large strm->input buffer and copying from it. + * (See also flush_pending()). + */ +function read_buf(strm, buf, start, size) { + var len = strm.avail_in; + + if (len > size) { len = size; } + if (len === 0) { return 0; } + + strm.avail_in -= len; + + // zmemcpy(buf, strm->next_in, len); + utils.arraySet(buf, strm.input, strm.next_in, len, start); + if (strm.state.wrap === 1) { + strm.adler = adler32(strm.adler, buf, len, start); + } + + else if (strm.state.wrap === 2) { + strm.adler = crc32(strm.adler, buf, len, start); + } + + strm.next_in += len; + strm.total_in += len; + + return len; +} + + +/* =========================================================================== + * Set match_start to the longest match starting at the given string and + * return its length. Matches shorter or equal to prev_length are discarded, + * in which case the result is equal to prev_length and match_start is + * garbage. + * IN assertions: cur_match is the head of the hash chain for the current + * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 + * OUT assertion: the match length is not greater than s->lookahead. + */ +function longest_match(s, cur_match) { + var chain_length = s.max_chain_length; /* max hash chain length */ + var scan = s.strstart; /* current string */ + var match; /* matched string */ + var len; /* length of current match */ + var best_len = s.prev_length; /* best match length so far */ + var nice_match = s.nice_match; /* stop if match long enough */ + var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ? + s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/; + + var _win = s.window; // shortcut + + var wmask = s.w_mask; + var prev = s.prev; + + /* Stop when cur_match becomes <= limit. To simplify the code, + * we prevent matches with the string of window index 0. + */ + + var strend = s.strstart + MAX_MATCH; + var scan_end1 = _win[scan + best_len - 1]; + var scan_end = _win[scan + best_len]; + + /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. + * It is easy to get rid of this optimization if necessary. + */ + // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); + + /* Do not waste too much time if we already have a good match: */ + if (s.prev_length >= s.good_match) { + chain_length >>= 2; + } + /* Do not look for matches beyond the end of the input. This is necessary + * to make deflate deterministic. + */ + if (nice_match > s.lookahead) { nice_match = s.lookahead; } + + // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + + do { + // Assert(cur_match < s->strstart, "no future"); + match = cur_match; + + /* Skip to next match if the match length cannot increase + * or if the match length is less than 2. Note that the checks below + * for insufficient lookahead only occur occasionally for performance + * reasons. Therefore uninitialized memory will be accessed, and + * conditional jumps will be made that depend on those values. + * However the length of the match is limited to the lookahead, so + * the output of deflate is not affected by the uninitialized values. + */ + + if (_win[match + best_len] !== scan_end || + _win[match + best_len - 1] !== scan_end1 || + _win[match] !== _win[scan] || + _win[++match] !== _win[scan + 1]) { + continue; + } + + /* The check at best_len-1 can be removed because it will be made + * again later. (This heuristic is not always a win.) + * It is not necessary to compare scan[2] and match[2] since they + * are always equal when the other bytes match, given that + * the hash keys are equal and that HASH_BITS >= 8. + */ + scan += 2; + match++; + // Assert(*scan == *match, "match[2]?"); + + /* We check for insufficient lookahead only every 8th comparison; + * the 256th check will be made at strstart+258. + */ + do { + /*jshint noempty:false*/ + } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + scan < strend); + + // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + + len = MAX_MATCH - (strend - scan); + scan = strend - MAX_MATCH; + + if (len > best_len) { + s.match_start = cur_match; + best_len = len; + if (len >= nice_match) { + break; + } + scan_end1 = _win[scan + best_len - 1]; + scan_end = _win[scan + best_len]; + } + } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0); + + if (best_len <= s.lookahead) { + return best_len; + } + return s.lookahead; +} + + +/* =========================================================================== + * Fill the window when the lookahead becomes insufficient. + * Updates strstart and lookahead. + * + * IN assertion: lookahead < MIN_LOOKAHEAD + * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD + * At least one byte has been read, or avail_in == 0; reads are + * performed for at least two bytes (required for the zip translate_eol + * option -- not supported here). + */ +function fill_window(s) { + var _w_size = s.w_size; + var p, n, m, more, str; + + //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); + + do { + more = s.window_size - s.lookahead - s.strstart; + + // JS ints have 32 bit, block below not needed + /* Deal with !@#$% 64K limit: */ + //if (sizeof(int) <= 2) { + // if (more == 0 && s->strstart == 0 && s->lookahead == 0) { + // more = wsize; + // + // } else if (more == (unsigned)(-1)) { + // /* Very unlikely, but possible on 16 bit machine if + // * strstart == 0 && lookahead == 1 (input done a byte at time) + // */ + // more--; + // } + //} + + + /* If the window is almost full and there is insufficient lookahead, + * move the upper half to the lower one to make room in the upper half. + */ + if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) { + + utils.arraySet(s.window, s.window, _w_size, _w_size, 0); + s.match_start -= _w_size; + s.strstart -= _w_size; + /* we now have strstart >= MAX_DIST */ + s.block_start -= _w_size; + + /* Slide the hash table (could be avoided with 32 bit values + at the expense of memory usage). We slide even when level == 0 + to keep the hash table consistent if we switch back to level > 0 + later. (Using level 0 permanently is not an optimal usage of + zlib, so we don't care about this pathological case.) + */ + + n = s.hash_size; + p = n; + do { + m = s.head[--p]; + s.head[p] = (m >= _w_size ? m - _w_size : 0); + } while (--n); + + n = _w_size; + p = n; + do { + m = s.prev[--p]; + s.prev[p] = (m >= _w_size ? m - _w_size : 0); + /* If n is not on any hash chain, prev[n] is garbage but + * its value will never be used. + */ + } while (--n); + + more += _w_size; + } + if (s.strm.avail_in === 0) { + break; + } + + /* If there was no sliding: + * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && + * more == window_size - lookahead - strstart + * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) + * => more >= window_size - 2*WSIZE + 2 + * In the BIG_MEM or MMAP case (not yet supported), + * window_size == input_size + MIN_LOOKAHEAD && + * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. + * Otherwise, window_size == 2*WSIZE so more >= 2. + * If there was sliding, more >= WSIZE. So in all cases, more >= 2. + */ + //Assert(more >= 2, "more < 2"); + n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more); + s.lookahead += n; + + /* Initialize the hash value now that we have some input: */ + if (s.lookahead + s.insert >= MIN_MATCH) { + str = s.strstart - s.insert; + s.ins_h = s.window[str]; + + /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask; +//#if MIN_MATCH != 3 +// Call update_hash() MIN_MATCH-3 more times +//#endif + while (s.insert) { + /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; + + s.prev[str & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = str; + str++; + s.insert--; + if (s.lookahead + s.insert < MIN_MATCH) { + break; + } + } + } + /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, + * but this is not important since only literal bytes will be emitted. + */ + + } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0); + + /* If the WIN_INIT bytes after the end of the current data have never been + * written, then zero those bytes in order to avoid memory check reports of + * the use of uninitialized (or uninitialised as Julian writes) bytes by + * the longest match routines. Update the high water mark for the next + * time through here. WIN_INIT is set to MAX_MATCH since the longest match + * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. + */ +// if (s.high_water < s.window_size) { +// var curr = s.strstart + s.lookahead; +// var init = 0; +// +// if (s.high_water < curr) { +// /* Previous high water mark below current data -- zero WIN_INIT +// * bytes or up to end of window, whichever is less. +// */ +// init = s.window_size - curr; +// if (init > WIN_INIT) +// init = WIN_INIT; +// zmemzero(s->window + curr, (unsigned)init); +// s->high_water = curr + init; +// } +// else if (s->high_water < (ulg)curr + WIN_INIT) { +// /* High water mark at or above current data, but below current data +// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up +// * to end of window, whichever is less. +// */ +// init = (ulg)curr + WIN_INIT - s->high_water; +// if (init > s->window_size - s->high_water) +// init = s->window_size - s->high_water; +// zmemzero(s->window + s->high_water, (unsigned)init); +// s->high_water += init; +// } +// } +// +// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, +// "not enough room for search"); +} + +/* =========================================================================== + * Copy without compression as much as possible from the input stream, return + * the current block state. + * This function does not insert new strings in the dictionary since + * uncompressible data is probably not useful. This function is used + * only for the level=0 compression option. + * NOTE: this function should be optimized to avoid extra copying from + * window to pending_buf. + */ +function deflate_stored(s, flush) { + /* Stored blocks are limited to 0xffff bytes, pending_buf is limited + * to pending_buf_size, and each stored block has a 5 byte header: + */ + var max_block_size = 0xffff; + + if (max_block_size > s.pending_buf_size - 5) { + max_block_size = s.pending_buf_size - 5; + } + + /* Copy as much as possible from input to output: */ + for (;;) { + /* Fill the window as much as possible: */ + if (s.lookahead <= 1) { + + //Assert(s->strstart < s->w_size+MAX_DIST(s) || + // s->block_start >= (long)s->w_size, "slide too late"); +// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) || +// s.block_start >= s.w_size)) { +// throw new Error("slide too late"); +// } + + fill_window(s); + if (s.lookahead === 0 && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + + if (s.lookahead === 0) { + break; + } + /* flush the current block */ + } + //Assert(s->block_start >= 0L, "block gone"); +// if (s.block_start < 0) throw new Error("block gone"); + + s.strstart += s.lookahead; + s.lookahead = 0; + + /* Emit a stored block if pending_buf will be full: */ + var max_start = s.block_start + max_block_size; + + if (s.strstart === 0 || s.strstart >= max_start) { + /* strstart == 0 is possible when wraparound on 16-bit machine */ + s.lookahead = s.strstart - max_start; + s.strstart = max_start; + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + + + } + /* Flush if we may have to slide, otherwise block_start may become + * negative and the data will be gone: + */ + if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + + s.insert = 0; + + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + + if (s.strstart > s.block_start) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + + return BS_NEED_MORE; +} + +/* =========================================================================== + * Compress as much as possible from the input stream, return the current + * block state. + * This function does not perform lazy evaluation of matches and inserts + * new strings in the dictionary only for unmatched strings or for short + * matches. It is used only for the fast compression options. + */ +function deflate_fast(s, flush) { + var hash_head; /* head of the hash chain */ + var bflush; /* set if current block must be flushed */ + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s.lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { + break; /* flush the current block */ + } + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + hash_head = 0/*NIL*/; + if (s.lookahead >= MIN_MATCH) { + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + } + + /* Find the longest match, discarding those <= prev_length. + * At this point we have always match_length < MIN_MATCH + */ + if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + s.match_length = longest_match(s, hash_head); + /* longest_match() sets match_start */ + } + if (s.match_length >= MIN_MATCH) { + // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only + + /*** _tr_tally_dist(s, s.strstart - s.match_start, + s.match_length - MIN_MATCH, bflush); ***/ + bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); + + s.lookahead -= s.match_length; + + /* Insert new strings in the hash table only if the match length + * is not too large. This saves time but degrades compression. + */ + if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) { + s.match_length--; /* string at strstart already in table */ + do { + s.strstart++; + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + /* strstart never exceeds WSIZE-MAX_MATCH, so there are + * always MIN_MATCH bytes ahead. + */ + } while (--s.match_length !== 0); + s.strstart++; + } else + { + s.strstart += s.match_length; + s.match_length = 0; + s.ins_h = s.window[s.strstart]; + /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask; + +//#if MIN_MATCH != 3 +// Call UPDATE_HASH() MIN_MATCH-3 more times +//#endif + /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not + * matter since it will be recomputed at next deflate call. + */ + } + } else { + /* No match, output a literal byte */ + //Tracevv((stderr,"%c", s.window[s.strstart])); + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + + s.lookahead--; + s.strstart++; + } + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1); + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + return BS_BLOCK_DONE; +} + +/* =========================================================================== + * Same as above, but achieves better compression. We use a lazy + * evaluation for matches: a match is finally adopted only if there is + * no better match at the next window position. + */ +function deflate_slow(s, flush) { + var hash_head; /* head of hash chain */ + var bflush; /* set if current block must be flushed */ + + var max_insert; + + /* Process the input block. */ + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s.lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { break; } /* flush the current block */ + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + hash_head = 0/*NIL*/; + if (s.lookahead >= MIN_MATCH) { + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + } + + /* Find the longest match, discarding those <= prev_length. + */ + s.prev_length = s.match_length; + s.prev_match = s.match_start; + s.match_length = MIN_MATCH - 1; + + if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match && + s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + s.match_length = longest_match(s, hash_head); + /* longest_match() sets match_start */ + + if (s.match_length <= 5 && + (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { + + /* If prev_match is also MIN_MATCH, match_start is garbage + * but we will ignore the current match anyway. + */ + s.match_length = MIN_MATCH - 1; + } + } + /* If there was a match at the previous step and the current + * match is not better, output the previous match: + */ + if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { + max_insert = s.strstart + s.lookahead - MIN_MATCH; + /* Do not insert strings in hash table beyond this. */ + + //check_match(s, s.strstart-1, s.prev_match, s.prev_length); + + /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match, + s.prev_length - MIN_MATCH, bflush);***/ + bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH); + /* Insert in hash table all strings up to the end of the match. + * strstart-1 and strstart are already inserted. If there is not + * enough lookahead, the last two strings are not inserted in + * the hash table. + */ + s.lookahead -= s.prev_length - 1; + s.prev_length -= 2; + do { + if (++s.strstart <= max_insert) { + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + } + } while (--s.prev_length !== 0); + s.match_available = 0; + s.match_length = MIN_MATCH - 1; + s.strstart++; + + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + + } else if (s.match_available) { + /* If there was no match at the previous position, output a + * single literal. If there was a match but the current match + * is longer, truncate the previous match to a single literal. + */ + //Tracevv((stderr,"%c", s->window[s->strstart-1])); + /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); + + if (bflush) { + /*** FLUSH_BLOCK_ONLY(s, 0) ***/ + flush_block_only(s, false); + /***/ + } + s.strstart++; + s.lookahead--; + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } else { + /* There is no previous match to compare with, wait for + * the next step to decide. + */ + s.match_available = 1; + s.strstart++; + s.lookahead--; + } + } + //Assert (flush != Z_NO_FLUSH, "no flush?"); + if (s.match_available) { + //Tracevv((stderr,"%c", s->window[s->strstart-1])); + /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); + + s.match_available = 0; + } + s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + + return BS_BLOCK_DONE; +} + + +/* =========================================================================== + * For Z_RLE, simply look for runs of bytes, generate matches only of distance + * one. Do not maintain a hash table. (It will be regenerated if this run of + * deflate switches away from Z_RLE.) + */ +function deflate_rle(s, flush) { + var bflush; /* set if current block must be flushed */ + var prev; /* byte at distance one to match */ + var scan, strend; /* scan goes up to strend for length of run */ + + var _win = s.window; + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the longest run, plus one for the unrolled loop. + */ + if (s.lookahead <= MAX_MATCH) { + fill_window(s); + if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { break; } /* flush the current block */ + } + + /* See how many times the previous byte repeats */ + s.match_length = 0; + if (s.lookahead >= MIN_MATCH && s.strstart > 0) { + scan = s.strstart - 1; + prev = _win[scan]; + if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { + strend = s.strstart + MAX_MATCH; + do { + /*jshint noempty:false*/ + } while (prev === _win[++scan] && prev === _win[++scan] && + prev === _win[++scan] && prev === _win[++scan] && + prev === _win[++scan] && prev === _win[++scan] && + prev === _win[++scan] && prev === _win[++scan] && + scan < strend); + s.match_length = MAX_MATCH - (strend - scan); + if (s.match_length > s.lookahead) { + s.match_length = s.lookahead; + } + } + //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); + } + + /* Emit match if have run of MIN_MATCH or longer, else emit literal */ + if (s.match_length >= MIN_MATCH) { + //check_match(s, s.strstart, s.strstart - 1, s.match_length); + + /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/ + bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH); + + s.lookahead -= s.match_length; + s.strstart += s.match_length; + s.match_length = 0; + } else { + /* No match, output a literal byte */ + //Tracevv((stderr,"%c", s->window[s->strstart])); + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + + s.lookahead--; + s.strstart++; + } + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + s.insert = 0; + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + return BS_BLOCK_DONE; +} + +/* =========================================================================== + * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. + * (It will be regenerated if this run of deflate switches away from Huffman.) + */ +function deflate_huff(s, flush) { + var bflush; /* set if current block must be flushed */ + + for (;;) { + /* Make sure that we have a literal to write. */ + if (s.lookahead === 0) { + fill_window(s); + if (s.lookahead === 0) { + if (flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + break; /* flush the current block */ + } + } + + /* Output a literal byte */ + s.match_length = 0; + //Tracevv((stderr,"%c", s->window[s->strstart])); + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + s.lookahead--; + s.strstart++; + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + s.insert = 0; + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + return BS_BLOCK_DONE; +} + +/* Values for max_lazy_match, good_match and max_chain_length, depending on + * the desired pack level (0..9). The values given below have been tuned to + * exclude worst case performance for pathological files. Better values may be + * found for specific files. + */ +function Config(good_length, max_lazy, nice_length, max_chain, func) { + this.good_length = good_length; + this.max_lazy = max_lazy; + this.nice_length = nice_length; + this.max_chain = max_chain; + this.func = func; +} + +var configuration_table; + +configuration_table = [ + /* good lazy nice chain */ + new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */ + new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */ + new Config(4, 5, 16, 8, deflate_fast), /* 2 */ + new Config(4, 6, 32, 32, deflate_fast), /* 3 */ + + new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */ + new Config(8, 16, 32, 32, deflate_slow), /* 5 */ + new Config(8, 16, 128, 128, deflate_slow), /* 6 */ + new Config(8, 32, 128, 256, deflate_slow), /* 7 */ + new Config(32, 128, 258, 1024, deflate_slow), /* 8 */ + new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */ +]; + + +/* =========================================================================== + * Initialize the "longest match" routines for a new zlib stream + */ +function lm_init(s) { + s.window_size = 2 * s.w_size; + + /*** CLEAR_HASH(s); ***/ + zero(s.head); // Fill with NIL (= 0); + + /* Set the default configuration parameters: + */ + s.max_lazy_match = configuration_table[s.level].max_lazy; + s.good_match = configuration_table[s.level].good_length; + s.nice_match = configuration_table[s.level].nice_length; + s.max_chain_length = configuration_table[s.level].max_chain; + + s.strstart = 0; + s.block_start = 0; + s.lookahead = 0; + s.insert = 0; + s.match_length = s.prev_length = MIN_MATCH - 1; + s.match_available = 0; + s.ins_h = 0; +} + + +function DeflateState() { + this.strm = null; /* pointer back to this zlib stream */ + this.status = 0; /* as the name implies */ + this.pending_buf = null; /* output still pending */ + this.pending_buf_size = 0; /* size of pending_buf */ + this.pending_out = 0; /* next pending byte to output to the stream */ + this.pending = 0; /* nb of bytes in the pending buffer */ + this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ + this.gzhead = null; /* gzip header information to write */ + this.gzindex = 0; /* where in extra, name, or comment */ + this.method = Z_DEFLATED; /* can only be DEFLATED */ + this.last_flush = -1; /* value of flush param for previous deflate call */ + + this.w_size = 0; /* LZ77 window size (32K by default) */ + this.w_bits = 0; /* log2(w_size) (8..16) */ + this.w_mask = 0; /* w_size - 1 */ + + this.window = null; + /* Sliding window. Input bytes are read into the second half of the window, + * and move to the first half later to keep a dictionary of at least wSize + * bytes. With this organization, matches are limited to a distance of + * wSize-MAX_MATCH bytes, but this ensures that IO is always + * performed with a length multiple of the block size. + */ + + this.window_size = 0; + /* Actual size of window: 2*wSize, except when the user input buffer + * is directly used as sliding window. + */ + + this.prev = null; + /* Link to older string with same hash index. To limit the size of this + * array to 64K, this link is maintained only for the last 32K strings. + * An index in this array is thus a window index modulo 32K. + */ + + this.head = null; /* Heads of the hash chains or NIL. */ + + this.ins_h = 0; /* hash index of string to be inserted */ + this.hash_size = 0; /* number of elements in hash table */ + this.hash_bits = 0; /* log2(hash_size) */ + this.hash_mask = 0; /* hash_size-1 */ + + this.hash_shift = 0; + /* Number of bits by which ins_h must be shifted at each input + * step. It must be such that after MIN_MATCH steps, the oldest + * byte no longer takes part in the hash key, that is: + * hash_shift * MIN_MATCH >= hash_bits + */ + + this.block_start = 0; + /* Window position at the beginning of the current output block. Gets + * negative when the window is moved backwards. + */ + + this.match_length = 0; /* length of best match */ + this.prev_match = 0; /* previous match */ + this.match_available = 0; /* set if previous match exists */ + this.strstart = 0; /* start of string to insert */ + this.match_start = 0; /* start of matching string */ + this.lookahead = 0; /* number of valid bytes ahead in window */ + + this.prev_length = 0; + /* Length of the best match at previous step. Matches not greater than this + * are discarded. This is used in the lazy match evaluation. + */ + + this.max_chain_length = 0; + /* To speed up deflation, hash chains are never searched beyond this + * length. A higher limit improves compression ratio but degrades the + * speed. + */ + + this.max_lazy_match = 0; + /* Attempt to find a better match only when the current match is strictly + * smaller than this value. This mechanism is used only for compression + * levels >= 4. + */ + // That's alias to max_lazy_match, don't use directly + //this.max_insert_length = 0; + /* Insert new strings in the hash table only if the match length is not + * greater than this length. This saves time but degrades compression. + * max_insert_length is used only for compression levels <= 3. + */ + + this.level = 0; /* compression level (1..9) */ + this.strategy = 0; /* favor or force Huffman coding*/ + + this.good_match = 0; + /* Use a faster search when the previous match is longer than this */ + + this.nice_match = 0; /* Stop searching when current match exceeds this */ + + /* used by trees.c: */ + + /* Didn't use ct_data typedef below to suppress compiler warning */ + + // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ + // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ + // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ + + // Use flat array of DOUBLE size, with interleaved fata, + // because JS does not support effective + this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2); + this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2); + this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2); + zero(this.dyn_ltree); + zero(this.dyn_dtree); + zero(this.bl_tree); + + this.l_desc = null; /* desc. for literal tree */ + this.d_desc = null; /* desc. for distance tree */ + this.bl_desc = null; /* desc. for bit length tree */ + + //ush bl_count[MAX_BITS+1]; + this.bl_count = new utils.Buf16(MAX_BITS + 1); + /* number of codes at each bit length for an optimal tree */ + + //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ + this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */ + zero(this.heap); + + this.heap_len = 0; /* number of elements in the heap */ + this.heap_max = 0; /* element of largest frequency */ + /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. + * The same heap array is used to build all trees. + */ + + this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1]; + zero(this.depth); + /* Depth of each subtree used as tie breaker for trees of equal frequency + */ + + this.l_buf = 0; /* buffer index for literals or lengths */ + + this.lit_bufsize = 0; + /* Size of match buffer for literals/lengths. There are 4 reasons for + * limiting lit_bufsize to 64K: + * - frequencies can be kept in 16 bit counters + * - if compression is not successful for the first block, all input + * data is still in the window so we can still emit a stored block even + * when input comes from standard input. (This can also be done for + * all blocks if lit_bufsize is not greater than 32K.) + * - if compression is not successful for a file smaller than 64K, we can + * even emit a stored file instead of a stored block (saving 5 bytes). + * This is applicable only for zip (not gzip or zlib). + * - creating new Huffman trees less frequently may not provide fast + * adaptation to changes in the input data statistics. (Take for + * example a binary file with poorly compressible code followed by + * a highly compressible string table.) Smaller buffer sizes give + * fast adaptation but have of course the overhead of transmitting + * trees more frequently. + * - I can't count above 4 + */ + + this.last_lit = 0; /* running index in l_buf */ + + this.d_buf = 0; + /* Buffer index for distances. To simplify the code, d_buf and l_buf have + * the same number of elements. To use different lengths, an extra flag + * array would be necessary. + */ + + this.opt_len = 0; /* bit length of current block with optimal trees */ + this.static_len = 0; /* bit length of current block with static trees */ + this.matches = 0; /* number of string matches in current block */ + this.insert = 0; /* bytes at end of window left to insert */ + + + this.bi_buf = 0; + /* Output buffer. bits are inserted starting at the bottom (least + * significant bits). + */ + this.bi_valid = 0; + /* Number of valid bits in bi_buf. All bits above the last valid bit + * are always zero. + */ + + // Used for window memory init. We safely ignore it for JS. That makes + // sense only for pointers and memory check tools. + //this.high_water = 0; + /* High water mark offset in window for initialized bytes -- bytes above + * this are set to zero in order to avoid memory check warnings when + * longest match routines access bytes past the input. This is then + * updated to the new high water mark. + */ +} + + +function deflateResetKeep(strm) { + var s; + + if (!strm || !strm.state) { + return err(strm, Z_STREAM_ERROR); + } + + strm.total_in = strm.total_out = 0; + strm.data_type = Z_UNKNOWN; + + s = strm.state; + s.pending = 0; + s.pending_out = 0; + + if (s.wrap < 0) { + s.wrap = -s.wrap; + /* was made negative by deflate(..., Z_FINISH); */ + } + s.status = (s.wrap ? INIT_STATE : BUSY_STATE); + strm.adler = (s.wrap === 2) ? + 0 // crc32(0, Z_NULL, 0) + : + 1; // adler32(0, Z_NULL, 0) + s.last_flush = Z_NO_FLUSH; + trees._tr_init(s); + return Z_OK; +} + + +function deflateReset(strm) { + var ret = deflateResetKeep(strm); + if (ret === Z_OK) { + lm_init(strm.state); + } + return ret; +} + + +function deflateSetHeader(strm, head) { + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; } + strm.state.gzhead = head; + return Z_OK; +} + + +function deflateInit2(strm, level, method, windowBits, memLevel, strategy) { + if (!strm) { // === Z_NULL + return Z_STREAM_ERROR; + } + var wrap = 1; + + if (level === Z_DEFAULT_COMPRESSION) { + level = 6; + } + + if (windowBits < 0) { /* suppress zlib wrapper */ + wrap = 0; + windowBits = -windowBits; + } + + else if (windowBits > 15) { + wrap = 2; /* write gzip wrapper instead */ + windowBits -= 16; + } + + + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || + windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || + strategy < 0 || strategy > Z_FIXED) { + return err(strm, Z_STREAM_ERROR); + } + + + if (windowBits === 8) { + windowBits = 9; + } + /* until 256-byte window bug fixed */ + + var s = new DeflateState(); + + strm.state = s; + s.strm = strm; + + s.wrap = wrap; + s.gzhead = null; + s.w_bits = windowBits; + s.w_size = 1 << s.w_bits; + s.w_mask = s.w_size - 1; + + s.hash_bits = memLevel + 7; + s.hash_size = 1 << s.hash_bits; + s.hash_mask = s.hash_size - 1; + s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); + + s.window = new utils.Buf8(s.w_size * 2); + s.head = new utils.Buf16(s.hash_size); + s.prev = new utils.Buf16(s.w_size); + + // Don't need mem init magic for JS. + //s.high_water = 0; /* nothing written to s->window yet */ + + s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ + + s.pending_buf_size = s.lit_bufsize * 4; + + //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); + //s->pending_buf = (uchf *) overlay; + s.pending_buf = new utils.Buf8(s.pending_buf_size); + + // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`) + //s->d_buf = overlay + s->lit_bufsize/sizeof(ush); + s.d_buf = 1 * s.lit_bufsize; + + //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; + s.l_buf = (1 + 2) * s.lit_bufsize; + + s.level = level; + s.strategy = strategy; + s.method = method; + + return deflateReset(strm); +} + +function deflateInit(strm, level) { + return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); +} + + +function deflate(strm, flush) { + var old_flush, s; + var beg, val; // for gzip header write only + + if (!strm || !strm.state || + flush > Z_BLOCK || flush < 0) { + return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR; + } + + s = strm.state; + + if (!strm.output || + (!strm.input && strm.avail_in !== 0) || + (s.status === FINISH_STATE && flush !== Z_FINISH)) { + return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR); + } + + s.strm = strm; /* just in case */ + old_flush = s.last_flush; + s.last_flush = flush; + + /* Write the header */ + if (s.status === INIT_STATE) { + + if (s.wrap === 2) { // GZIP header + strm.adler = 0; //crc32(0L, Z_NULL, 0); + put_byte(s, 31); + put_byte(s, 139); + put_byte(s, 8); + if (!s.gzhead) { // s->gzhead == Z_NULL + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, s.level === 9 ? 2 : + (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? + 4 : 0)); + put_byte(s, OS_CODE); + s.status = BUSY_STATE; + } + else { + put_byte(s, (s.gzhead.text ? 1 : 0) + + (s.gzhead.hcrc ? 2 : 0) + + (!s.gzhead.extra ? 0 : 4) + + (!s.gzhead.name ? 0 : 8) + + (!s.gzhead.comment ? 0 : 16) + ); + put_byte(s, s.gzhead.time & 0xff); + put_byte(s, (s.gzhead.time >> 8) & 0xff); + put_byte(s, (s.gzhead.time >> 16) & 0xff); + put_byte(s, (s.gzhead.time >> 24) & 0xff); + put_byte(s, s.level === 9 ? 2 : + (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? + 4 : 0)); + put_byte(s, s.gzhead.os & 0xff); + if (s.gzhead.extra && s.gzhead.extra.length) { + put_byte(s, s.gzhead.extra.length & 0xff); + put_byte(s, (s.gzhead.extra.length >> 8) & 0xff); + } + if (s.gzhead.hcrc) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0); + } + s.gzindex = 0; + s.status = EXTRA_STATE; + } + } + else // DEFLATE header + { + var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8; + var level_flags = -1; + + if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { + level_flags = 0; + } else if (s.level < 6) { + level_flags = 1; + } else if (s.level === 6) { + level_flags = 2; + } else { + level_flags = 3; + } + header |= (level_flags << 6); + if (s.strstart !== 0) { header |= PRESET_DICT; } + header += 31 - (header % 31); + + s.status = BUSY_STATE; + putShortMSB(s, header); + + /* Save the adler32 of the preset dictionary: */ + if (s.strstart !== 0) { + putShortMSB(s, strm.adler >>> 16); + putShortMSB(s, strm.adler & 0xffff); + } + strm.adler = 1; // adler32(0L, Z_NULL, 0); + } + } + +//#ifdef GZIP + if (s.status === EXTRA_STATE) { + if (s.gzhead.extra/* != Z_NULL*/) { + beg = s.pending; /* start of bytes to update crc */ + + while (s.gzindex < (s.gzhead.extra.length & 0xffff)) { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + break; + } + } + put_byte(s, s.gzhead.extra[s.gzindex] & 0xff); + s.gzindex++; + } + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (s.gzindex === s.gzhead.extra.length) { + s.gzindex = 0; + s.status = NAME_STATE; + } + } + else { + s.status = NAME_STATE; + } + } + if (s.status === NAME_STATE) { + if (s.gzhead.name/* != Z_NULL*/) { + beg = s.pending; /* start of bytes to update crc */ + //int val; + + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + val = 1; + break; + } + } + // JS specific: little magic to add zero terminator to end of string + if (s.gzindex < s.gzhead.name.length) { + val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff; + } else { + val = 0; + } + put_byte(s, val); + } while (val !== 0); + + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (val === 0) { + s.gzindex = 0; + s.status = COMMENT_STATE; + } + } + else { + s.status = COMMENT_STATE; + } + } + if (s.status === COMMENT_STATE) { + if (s.gzhead.comment/* != Z_NULL*/) { + beg = s.pending; /* start of bytes to update crc */ + //int val; + + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + val = 1; + break; + } + } + // JS specific: little magic to add zero terminator to end of string + if (s.gzindex < s.gzhead.comment.length) { + val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff; + } else { + val = 0; + } + put_byte(s, val); + } while (val !== 0); + + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (val === 0) { + s.status = HCRC_STATE; + } + } + else { + s.status = HCRC_STATE; + } + } + if (s.status === HCRC_STATE) { + if (s.gzhead.hcrc) { + if (s.pending + 2 > s.pending_buf_size) { + flush_pending(strm); + } + if (s.pending + 2 <= s.pending_buf_size) { + put_byte(s, strm.adler & 0xff); + put_byte(s, (strm.adler >> 8) & 0xff); + strm.adler = 0; //crc32(0L, Z_NULL, 0); + s.status = BUSY_STATE; + } + } + else { + s.status = BUSY_STATE; + } + } +//#endif + + /* Flush as much pending output as possible */ + if (s.pending !== 0) { + flush_pending(strm); + if (strm.avail_out === 0) { + /* Since avail_out is 0, deflate will be called again with + * more output space, but possibly with both pending and + * avail_in equal to zero. There won't be anything to do, + * but this is not an error situation so make sure we + * return OK instead of BUF_ERROR at next call of deflate: + */ + s.last_flush = -1; + return Z_OK; + } + + /* Make sure there is something to do and avoid duplicate consecutive + * flushes. For repeated and useless calls with Z_FINISH, we keep + * returning Z_STREAM_END instead of Z_BUF_ERROR. + */ + } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && + flush !== Z_FINISH) { + return err(strm, Z_BUF_ERROR); + } + + /* User must not provide more input after the first FINISH: */ + if (s.status === FINISH_STATE && strm.avail_in !== 0) { + return err(strm, Z_BUF_ERROR); + } + + /* Start a new block or continue the current one. + */ + if (strm.avail_in !== 0 || s.lookahead !== 0 || + (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) { + var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) : + (s.strategy === Z_RLE ? deflate_rle(s, flush) : + configuration_table[s.level].func(s, flush)); + + if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) { + s.status = FINISH_STATE; + } + if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) { + if (strm.avail_out === 0) { + s.last_flush = -1; + /* avoid BUF_ERROR next call, see above */ + } + return Z_OK; + /* If flush != Z_NO_FLUSH && avail_out == 0, the next call + * of deflate should use the same flush parameter to make sure + * that the flush is complete. So we don't have to output an + * empty block here, this will be done at next call. This also + * ensures that for a very small output buffer, we emit at most + * one empty block. + */ + } + if (bstate === BS_BLOCK_DONE) { + if (flush === Z_PARTIAL_FLUSH) { + trees._tr_align(s); + } + else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ + + trees._tr_stored_block(s, 0, 0, false); + /* For a full flush, this empty block will be recognized + * as a special marker by inflate_sync(). + */ + if (flush === Z_FULL_FLUSH) { + /*** CLEAR_HASH(s); ***/ /* forget history */ + zero(s.head); // Fill with NIL (= 0); + + if (s.lookahead === 0) { + s.strstart = 0; + s.block_start = 0; + s.insert = 0; + } + } + } + flush_pending(strm); + if (strm.avail_out === 0) { + s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */ + return Z_OK; + } + } + } + //Assert(strm->avail_out > 0, "bug2"); + //if (strm.avail_out <= 0) { throw new Error("bug2");} + + if (flush !== Z_FINISH) { return Z_OK; } + if (s.wrap <= 0) { return Z_STREAM_END; } + + /* Write the trailer */ + if (s.wrap === 2) { + put_byte(s, strm.adler & 0xff); + put_byte(s, (strm.adler >> 8) & 0xff); + put_byte(s, (strm.adler >> 16) & 0xff); + put_byte(s, (strm.adler >> 24) & 0xff); + put_byte(s, strm.total_in & 0xff); + put_byte(s, (strm.total_in >> 8) & 0xff); + put_byte(s, (strm.total_in >> 16) & 0xff); + put_byte(s, (strm.total_in >> 24) & 0xff); + } + else + { + putShortMSB(s, strm.adler >>> 16); + putShortMSB(s, strm.adler & 0xffff); + } + + flush_pending(strm); + /* If avail_out is zero, the application will call deflate again + * to flush the rest. + */ + if (s.wrap > 0) { s.wrap = -s.wrap; } + /* write the trailer only once! */ + return s.pending !== 0 ? Z_OK : Z_STREAM_END; +} + +function deflateEnd(strm) { + var status; + + if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { + return Z_STREAM_ERROR; + } + + status = strm.state.status; + if (status !== INIT_STATE && + status !== EXTRA_STATE && + status !== NAME_STATE && + status !== COMMENT_STATE && + status !== HCRC_STATE && + status !== BUSY_STATE && + status !== FINISH_STATE + ) { + return err(strm, Z_STREAM_ERROR); + } + + strm.state = null; + + return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; +} + + +/* ========================================================================= + * Initializes the compression dictionary from the given byte + * sequence without producing any compressed output. + */ +function deflateSetDictionary(strm, dictionary) { + var dictLength = dictionary.length; + + var s; + var str, n; + var wrap; + var avail; + var next; + var input; + var tmpDict; + + if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { + return Z_STREAM_ERROR; + } + + s = strm.state; + wrap = s.wrap; + + if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) { + return Z_STREAM_ERROR; + } + + /* when using zlib wrappers, compute Adler-32 for provided dictionary */ + if (wrap === 1) { + /* adler32(strm->adler, dictionary, dictLength); */ + strm.adler = adler32(strm.adler, dictionary, dictLength, 0); + } + + s.wrap = 0; /* avoid computing Adler-32 in read_buf */ + + /* if dictionary would fill window, just replace the history */ + if (dictLength >= s.w_size) { + if (wrap === 0) { /* already empty otherwise */ + /*** CLEAR_HASH(s); ***/ + zero(s.head); // Fill with NIL (= 0); + s.strstart = 0; + s.block_start = 0; + s.insert = 0; + } + /* use the tail */ + // dictionary = dictionary.slice(dictLength - s.w_size); + tmpDict = new utils.Buf8(s.w_size); + utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0); + dictionary = tmpDict; + dictLength = s.w_size; + } + /* insert dictionary into window and hash */ + avail = strm.avail_in; + next = strm.next_in; + input = strm.input; + strm.avail_in = dictLength; + strm.next_in = 0; + strm.input = dictionary; + fill_window(s); + while (s.lookahead >= MIN_MATCH) { + str = s.strstart; + n = s.lookahead - (MIN_MATCH - 1); + do { + /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; + + s.prev[str & s.w_mask] = s.head[s.ins_h]; + + s.head[s.ins_h] = str; + str++; + } while (--n); + s.strstart = str; + s.lookahead = MIN_MATCH - 1; + fill_window(s); + } + s.strstart += s.lookahead; + s.block_start = s.strstart; + s.insert = s.lookahead; + s.lookahead = 0; + s.match_length = s.prev_length = MIN_MATCH - 1; + s.match_available = 0; + strm.next_in = next; + strm.input = input; + strm.avail_in = avail; + s.wrap = wrap; + return Z_OK; +} + + +exports.deflateInit = deflateInit; +exports.deflateInit2 = deflateInit2; +exports.deflateReset = deflateReset; +exports.deflateResetKeep = deflateResetKeep; +exports.deflateSetHeader = deflateSetHeader; +exports.deflate = deflate; +exports.deflateEnd = deflateEnd; +exports.deflateSetDictionary = deflateSetDictionary; +exports.deflateInfo = 'pako deflate (from Nodeca project)'; + +/* Not implemented +exports.deflateBound = deflateBound; +exports.deflateCopy = deflateCopy; +exports.deflateParams = deflateParams; +exports.deflatePending = deflatePending; +exports.deflatePrime = deflatePrime; +exports.deflateTune = deflateTune; +*/ diff --git a/node_modules/pako/lib/zlib/gzheader.js b/node_modules/pako/lib/zlib/gzheader.js new file mode 100644 index 000000000..9582cba60 --- /dev/null +++ b/node_modules/pako/lib/zlib/gzheader.js @@ -0,0 +1,58 @@ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +function GZheader() { + /* true if compressed data believed to be text */ + this.text = 0; + /* modification time */ + this.time = 0; + /* extra flags (not used when writing a gzip file) */ + this.xflags = 0; + /* operating system */ + this.os = 0; + /* pointer to extra field or Z_NULL if none */ + this.extra = null; + /* extra field length (valid if extra != Z_NULL) */ + this.extra_len = 0; // Actually, we don't need it in JS, + // but leave for few code modifications + + // + // Setup limits is not necessary because in js we should not preallocate memory + // for inflate use constant limit in 65536 bytes + // + + /* space at extra (only when reading header) */ + // this.extra_max = 0; + /* pointer to zero-terminated file name or Z_NULL */ + this.name = ''; + /* space at name (only when reading header) */ + // this.name_max = 0; + /* pointer to zero-terminated comment or Z_NULL */ + this.comment = ''; + /* space at comment (only when reading header) */ + // this.comm_max = 0; + /* true if there was or will be a header crc */ + this.hcrc = 0; + /* true when done reading gzip header (not used when writing a gzip file) */ + this.done = false; +} + +module.exports = GZheader; diff --git a/node_modules/pako/lib/zlib/inffast.js b/node_modules/pako/lib/zlib/inffast.js new file mode 100644 index 000000000..4cc958fee --- /dev/null +++ b/node_modules/pako/lib/zlib/inffast.js @@ -0,0 +1,345 @@ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +// See state defs from inflate.js +var BAD = 30; /* got a data error -- remain here until reset */ +var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ + +/* + Decode literal, length, and distance codes and write out the resulting + literal and match bytes until either not enough input or output is + available, an end-of-block is encountered, or a data error is encountered. + When large enough input and output buffers are supplied to inflate(), for + example, a 16K input buffer and a 64K output buffer, more than 95% of the + inflate execution time is spent in this routine. + + Entry assumptions: + + state.mode === LEN + strm.avail_in >= 6 + strm.avail_out >= 258 + start >= strm.avail_out + state.bits < 8 + + On return, state.mode is one of: + + LEN -- ran out of enough output space or enough available input + TYPE -- reached end of block code, inflate() to interpret next block + BAD -- error in block data + + Notes: + + - The maximum input bits used by a length/distance pair is 15 bits for the + length code, 5 bits for the length extra, 15 bits for the distance code, + and 13 bits for the distance extra. This totals 48 bits, or six bytes. + Therefore if strm.avail_in >= 6, then there is enough input to avoid + checking for available input while decoding. + + - The maximum bytes that a single length/distance pair can output is 258 + bytes, which is the maximum length that can be coded. inflate_fast() + requires strm.avail_out >= 258 for each loop to avoid checking for + output space. + */ +module.exports = function inflate_fast(strm, start) { + var state; + var _in; /* local strm.input */ + var last; /* have enough input while in < last */ + var _out; /* local strm.output */ + var beg; /* inflate()'s initial strm.output */ + var end; /* while out < end, enough space available */ +//#ifdef INFLATE_STRICT + var dmax; /* maximum distance from zlib header */ +//#endif + var wsize; /* window size or zero if not using window */ + var whave; /* valid bytes in the window */ + var wnext; /* window write index */ + // Use `s_window` instead `window`, avoid conflict with instrumentation tools + var s_window; /* allocated sliding window, if wsize != 0 */ + var hold; /* local strm.hold */ + var bits; /* local strm.bits */ + var lcode; /* local strm.lencode */ + var dcode; /* local strm.distcode */ + var lmask; /* mask for first level of length codes */ + var dmask; /* mask for first level of distance codes */ + var here; /* retrieved table entry */ + var op; /* code bits, operation, extra bits, or */ + /* window position, window bytes to copy */ + var len; /* match length, unused bytes */ + var dist; /* match distance */ + var from; /* where to copy match from */ + var from_source; + + + var input, output; // JS specific, because we have no pointers + + /* copy state to local variables */ + state = strm.state; + //here = state.here; + _in = strm.next_in; + input = strm.input; + last = _in + (strm.avail_in - 5); + _out = strm.next_out; + output = strm.output; + beg = _out - (start - strm.avail_out); + end = _out + (strm.avail_out - 257); +//#ifdef INFLATE_STRICT + dmax = state.dmax; +//#endif + wsize = state.wsize; + whave = state.whave; + wnext = state.wnext; + s_window = state.window; + hold = state.hold; + bits = state.bits; + lcode = state.lencode; + dcode = state.distcode; + lmask = (1 << state.lenbits) - 1; + dmask = (1 << state.distbits) - 1; + + + /* decode literals and length/distances until end-of-block or not enough + input data or output space */ + + top: + do { + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + + here = lcode[hold & lmask]; + + dolen: + for (;;) { // Goto emulation + op = here >>> 24/*here.bits*/; + hold >>>= op; + bits -= op; + op = (here >>> 16) & 0xff/*here.op*/; + if (op === 0) { /* literal */ + //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? + // "inflate: literal '%c'\n" : + // "inflate: literal 0x%02x\n", here.val)); + output[_out++] = here & 0xffff/*here.val*/; + } + else if (op & 16) { /* length base */ + len = here & 0xffff/*here.val*/; + op &= 15; /* number of extra bits */ + if (op) { + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + len += hold & ((1 << op) - 1); + hold >>>= op; + bits -= op; + } + //Tracevv((stderr, "inflate: length %u\n", len)); + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + here = dcode[hold & dmask]; + + dodist: + for (;;) { // goto emulation + op = here >>> 24/*here.bits*/; + hold >>>= op; + bits -= op; + op = (here >>> 16) & 0xff/*here.op*/; + + if (op & 16) { /* distance base */ + dist = here & 0xffff/*here.val*/; + op &= 15; /* number of extra bits */ + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + } + dist += hold & ((1 << op) - 1); +//#ifdef INFLATE_STRICT + if (dist > dmax) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break top; + } +//#endif + hold >>>= op; + bits -= op; + //Tracevv((stderr, "inflate: distance %u\n", dist)); + op = _out - beg; /* max distance in output */ + if (dist > op) { /* see if copy from window */ + op = dist - op; /* distance back in window */ + if (op > whave) { + if (state.sane) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break top; + } + +// (!) This block is disabled in zlib defaults, +// don't enable it for binary compatibility +//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR +// if (len <= op - whave) { +// do { +// output[_out++] = 0; +// } while (--len); +// continue top; +// } +// len -= op - whave; +// do { +// output[_out++] = 0; +// } while (--op > whave); +// if (op === 0) { +// from = _out - dist; +// do { +// output[_out++] = output[from++]; +// } while (--len); +// continue top; +// } +//#endif + } + from = 0; // window index + from_source = s_window; + if (wnext === 0) { /* very common case */ + from += wsize - op; + if (op < len) { /* some from window */ + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + else if (wnext < op) { /* wrap around window */ + from += wsize + wnext - op; + op -= wnext; + if (op < len) { /* some from end of window */ + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = 0; + if (wnext < len) { /* some from start of window */ + op = wnext; + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + } + else { /* contiguous in window */ + from += wnext - op; + if (op < len) { /* some from window */ + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + while (len > 2) { + output[_out++] = from_source[from++]; + output[_out++] = from_source[from++]; + output[_out++] = from_source[from++]; + len -= 3; + } + if (len) { + output[_out++] = from_source[from++]; + if (len > 1) { + output[_out++] = from_source[from++]; + } + } + } + else { + from = _out - dist; /* copy direct from output */ + do { /* minimum length is three */ + output[_out++] = output[from++]; + output[_out++] = output[from++]; + output[_out++] = output[from++]; + len -= 3; + } while (len > 2); + if (len) { + output[_out++] = output[from++]; + if (len > 1) { + output[_out++] = output[from++]; + } + } + } + } + else if ((op & 64) === 0) { /* 2nd level distance code */ + here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; + continue dodist; + } + else { + strm.msg = 'invalid distance code'; + state.mode = BAD; + break top; + } + + break; // need to emulate goto via "continue" + } + } + else if ((op & 64) === 0) { /* 2nd level length code */ + here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; + continue dolen; + } + else if (op & 32) { /* end-of-block */ + //Tracevv((stderr, "inflate: end of block\n")); + state.mode = TYPE; + break top; + } + else { + strm.msg = 'invalid literal/length code'; + state.mode = BAD; + break top; + } + + break; // need to emulate goto via "continue" + } + } while (_in < last && _out < end); + + /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ + len = bits >> 3; + _in -= len; + bits -= len << 3; + hold &= (1 << bits) - 1; + + /* update state and return */ + strm.next_in = _in; + strm.next_out = _out; + strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last)); + strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end)); + state.hold = hold; + state.bits = bits; + return; +}; diff --git a/node_modules/pako/lib/zlib/inflate.js b/node_modules/pako/lib/zlib/inflate.js new file mode 100644 index 000000000..638484484 --- /dev/null +++ b/node_modules/pako/lib/zlib/inflate.js @@ -0,0 +1,1556 @@ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +var utils = require('../utils/common'); +var adler32 = require('./adler32'); +var crc32 = require('./crc32'); +var inflate_fast = require('./inffast'); +var inflate_table = require('./inftrees'); + +var CODES = 0; +var LENS = 1; +var DISTS = 2; + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + + +/* Allowed flush values; see deflate() and inflate() below for details */ +//var Z_NO_FLUSH = 0; +//var Z_PARTIAL_FLUSH = 1; +//var Z_SYNC_FLUSH = 2; +//var Z_FULL_FLUSH = 3; +var Z_FINISH = 4; +var Z_BLOCK = 5; +var Z_TREES = 6; + + +/* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ +var Z_OK = 0; +var Z_STREAM_END = 1; +var Z_NEED_DICT = 2; +//var Z_ERRNO = -1; +var Z_STREAM_ERROR = -2; +var Z_DATA_ERROR = -3; +var Z_MEM_ERROR = -4; +var Z_BUF_ERROR = -5; +//var Z_VERSION_ERROR = -6; + +/* The deflate compression method */ +var Z_DEFLATED = 8; + + +/* STATES ====================================================================*/ +/* ===========================================================================*/ + + +var HEAD = 1; /* i: waiting for magic header */ +var FLAGS = 2; /* i: waiting for method and flags (gzip) */ +var TIME = 3; /* i: waiting for modification time (gzip) */ +var OS = 4; /* i: waiting for extra flags and operating system (gzip) */ +var EXLEN = 5; /* i: waiting for extra length (gzip) */ +var EXTRA = 6; /* i: waiting for extra bytes (gzip) */ +var NAME = 7; /* i: waiting for end of file name (gzip) */ +var COMMENT = 8; /* i: waiting for end of comment (gzip) */ +var HCRC = 9; /* i: waiting for header crc (gzip) */ +var DICTID = 10; /* i: waiting for dictionary check value */ +var DICT = 11; /* waiting for inflateSetDictionary() call */ +var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ +var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */ +var STORED = 14; /* i: waiting for stored size (length and complement) */ +var COPY_ = 15; /* i/o: same as COPY below, but only first time in */ +var COPY = 16; /* i/o: waiting for input or output to copy stored block */ +var TABLE = 17; /* i: waiting for dynamic block table lengths */ +var LENLENS = 18; /* i: waiting for code length code lengths */ +var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */ +var LEN_ = 20; /* i: same as LEN below, but only first time in */ +var LEN = 21; /* i: waiting for length/lit/eob code */ +var LENEXT = 22; /* i: waiting for length extra bits */ +var DIST = 23; /* i: waiting for distance code */ +var DISTEXT = 24; /* i: waiting for distance extra bits */ +var MATCH = 25; /* o: waiting for output space to copy string */ +var LIT = 26; /* o: waiting for output space to write literal */ +var CHECK = 27; /* i: waiting for 32-bit check value */ +var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */ +var DONE = 29; /* finished check, done -- remain here until reset */ +var BAD = 30; /* got a data error -- remain here until reset */ +var MEM = 31; /* got an inflate() memory error -- remain here until reset */ +var SYNC = 32; /* looking for synchronization bytes to restart inflate() */ + +/* ===========================================================================*/ + + + +var ENOUGH_LENS = 852; +var ENOUGH_DISTS = 592; +//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); + +var MAX_WBITS = 15; +/* 32K LZ77 window */ +var DEF_WBITS = MAX_WBITS; + + +function zswap32(q) { + return (((q >>> 24) & 0xff) + + ((q >>> 8) & 0xff00) + + ((q & 0xff00) << 8) + + ((q & 0xff) << 24)); +} + + +function InflateState() { + this.mode = 0; /* current inflate mode */ + this.last = false; /* true if processing last block */ + this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ + this.havedict = false; /* true if dictionary provided */ + this.flags = 0; /* gzip header method and flags (0 if zlib) */ + this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */ + this.check = 0; /* protected copy of check value */ + this.total = 0; /* protected copy of output count */ + // TODO: may be {} + this.head = null; /* where to save gzip header information */ + + /* sliding window */ + this.wbits = 0; /* log base 2 of requested window size */ + this.wsize = 0; /* window size or zero if not using window */ + this.whave = 0; /* valid bytes in the window */ + this.wnext = 0; /* window write index */ + this.window = null; /* allocated sliding window, if needed */ + + /* bit accumulator */ + this.hold = 0; /* input bit accumulator */ + this.bits = 0; /* number of bits in "in" */ + + /* for string and stored block copying */ + this.length = 0; /* literal or length of data to copy */ + this.offset = 0; /* distance back to copy string from */ + + /* for table and code decoding */ + this.extra = 0; /* extra bits needed */ + + /* fixed and dynamic code tables */ + this.lencode = null; /* starting table for length/literal codes */ + this.distcode = null; /* starting table for distance codes */ + this.lenbits = 0; /* index bits for lencode */ + this.distbits = 0; /* index bits for distcode */ + + /* dynamic table building */ + this.ncode = 0; /* number of code length code lengths */ + this.nlen = 0; /* number of length code lengths */ + this.ndist = 0; /* number of distance code lengths */ + this.have = 0; /* number of code lengths in lens[] */ + this.next = null; /* next available space in codes[] */ + + this.lens = new utils.Buf16(320); /* temporary storage for code lengths */ + this.work = new utils.Buf16(288); /* work area for code table building */ + + /* + because we don't have pointers in js, we use lencode and distcode directly + as buffers so we don't need codes + */ + //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */ + this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */ + this.distdyn = null; /* dynamic table for distance codes (JS specific) */ + this.sane = 0; /* if false, allow invalid distance too far */ + this.back = 0; /* bits back of last unprocessed length/lit */ + this.was = 0; /* initial length of match */ +} + +function inflateResetKeep(strm) { + var state; + + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + strm.total_in = strm.total_out = state.total = 0; + strm.msg = ''; /*Z_NULL*/ + if (state.wrap) { /* to support ill-conceived Java test suite */ + strm.adler = state.wrap & 1; + } + state.mode = HEAD; + state.last = 0; + state.havedict = 0; + state.dmax = 32768; + state.head = null/*Z_NULL*/; + state.hold = 0; + state.bits = 0; + //state.lencode = state.distcode = state.next = state.codes; + state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS); + state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS); + + state.sane = 1; + state.back = -1; + //Tracev((stderr, "inflate: reset\n")); + return Z_OK; +} + +function inflateReset(strm) { + var state; + + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + state.wsize = 0; + state.whave = 0; + state.wnext = 0; + return inflateResetKeep(strm); + +} + +function inflateReset2(strm, windowBits) { + var wrap; + var state; + + /* get the state */ + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + + /* extract wrap request from windowBits parameter */ + if (windowBits < 0) { + wrap = 0; + windowBits = -windowBits; + } + else { + wrap = (windowBits >> 4) + 1; + if (windowBits < 48) { + windowBits &= 15; + } + } + + /* set number of window bits, free window if different */ + if (windowBits && (windowBits < 8 || windowBits > 15)) { + return Z_STREAM_ERROR; + } + if (state.window !== null && state.wbits !== windowBits) { + state.window = null; + } + + /* update state and reset the rest of it */ + state.wrap = wrap; + state.wbits = windowBits; + return inflateReset(strm); +} + +function inflateInit2(strm, windowBits) { + var ret; + var state; + + if (!strm) { return Z_STREAM_ERROR; } + //strm.msg = Z_NULL; /* in case we return an error */ + + state = new InflateState(); + + //if (state === Z_NULL) return Z_MEM_ERROR; + //Tracev((stderr, "inflate: allocated\n")); + strm.state = state; + state.window = null/*Z_NULL*/; + ret = inflateReset2(strm, windowBits); + if (ret !== Z_OK) { + strm.state = null/*Z_NULL*/; + } + return ret; +} + +function inflateInit(strm) { + return inflateInit2(strm, DEF_WBITS); +} + + +/* + Return state with length and distance decoding tables and index sizes set to + fixed code decoding. Normally this returns fixed tables from inffixed.h. + If BUILDFIXED is defined, then instead this routine builds the tables the + first time it's called, and returns those tables the first time and + thereafter. This reduces the size of the code by about 2K bytes, in + exchange for a little execution time. However, BUILDFIXED should not be + used for threaded applications, since the rewriting of the tables and virgin + may not be thread-safe. + */ +var virgin = true; + +var lenfix, distfix; // We have no pointers in JS, so keep tables separate + +function fixedtables(state) { + /* build fixed huffman tables if first call (may not be thread safe) */ + if (virgin) { + var sym; + + lenfix = new utils.Buf32(512); + distfix = new utils.Buf32(32); + + /* literal/length table */ + sym = 0; + while (sym < 144) { state.lens[sym++] = 8; } + while (sym < 256) { state.lens[sym++] = 9; } + while (sym < 280) { state.lens[sym++] = 7; } + while (sym < 288) { state.lens[sym++] = 8; } + + inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); + + /* distance table */ + sym = 0; + while (sym < 32) { state.lens[sym++] = 5; } + + inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); + + /* do this just once */ + virgin = false; + } + + state.lencode = lenfix; + state.lenbits = 9; + state.distcode = distfix; + state.distbits = 5; +} + + +/* + Update the window with the last wsize (normally 32K) bytes written before + returning. If window does not exist yet, create it. This is only called + when a window is already in use, or when output has been written during this + inflate call, but the end of the deflate stream has not been reached yet. + It is also called to create a window for dictionary data when a dictionary + is loaded. + + Providing output buffers larger than 32K to inflate() should provide a speed + advantage, since only the last 32K of output is copied to the sliding window + upon return from inflate(), and since all distances after the first 32K of + output will fall in the output data, making match copies simpler and faster. + The advantage may be dependent on the size of the processor's data caches. + */ +function updatewindow(strm, src, end, copy) { + var dist; + var state = strm.state; + + /* if it hasn't been done already, allocate space for the window */ + if (state.window === null) { + state.wsize = 1 << state.wbits; + state.wnext = 0; + state.whave = 0; + + state.window = new utils.Buf8(state.wsize); + } + + /* copy state->wsize or less output bytes into the circular window */ + if (copy >= state.wsize) { + utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0); + state.wnext = 0; + state.whave = state.wsize; + } + else { + dist = state.wsize - state.wnext; + if (dist > copy) { + dist = copy; + } + //zmemcpy(state->window + state->wnext, end - copy, dist); + utils.arraySet(state.window, src, end - copy, dist, state.wnext); + copy -= dist; + if (copy) { + //zmemcpy(state->window, end - copy, copy); + utils.arraySet(state.window, src, end - copy, copy, 0); + state.wnext = copy; + state.whave = state.wsize; + } + else { + state.wnext += dist; + if (state.wnext === state.wsize) { state.wnext = 0; } + if (state.whave < state.wsize) { state.whave += dist; } + } + } + return 0; +} + +function inflate(strm, flush) { + var state; + var input, output; // input/output buffers + var next; /* next input INDEX */ + var put; /* next output INDEX */ + var have, left; /* available input and output */ + var hold; /* bit buffer */ + var bits; /* bits in bit buffer */ + var _in, _out; /* save starting available input and output */ + var copy; /* number of stored or match bytes to copy */ + var from; /* where to copy match bytes from */ + var from_source; + var here = 0; /* current decoding table entry */ + var here_bits, here_op, here_val; // paked "here" denormalized (JS specific) + //var last; /* parent table entry */ + var last_bits, last_op, last_val; // paked "last" denormalized (JS specific) + var len; /* length to copy for repeats, bits to drop */ + var ret; /* return code */ + var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */ + var opts; + + var n; // temporary var for NEED_BITS + + var order = /* permutation of code lengths */ + [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]; + + + if (!strm || !strm.state || !strm.output || + (!strm.input && strm.avail_in !== 0)) { + return Z_STREAM_ERROR; + } + + state = strm.state; + if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */ + + + //--- LOAD() --- + put = strm.next_out; + output = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + //--- + + _in = have; + _out = left; + ret = Z_OK; + + inf_leave: // goto emulation + for (;;) { + switch (state.mode) { + case HEAD: + if (state.wrap === 0) { + state.mode = TYPEDO; + break; + } + //=== NEEDBITS(16); + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */ + state.check = 0/*crc32(0L, Z_NULL, 0)*/; + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = FLAGS; + break; + } + state.flags = 0; /* expect zlib header */ + if (state.head) { + state.head.done = false; + } + if (!(state.wrap & 1) || /* check if zlib header allowed */ + (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) { + strm.msg = 'incorrect header check'; + state.mode = BAD; + break; + } + if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) { + strm.msg = 'unknown compression method'; + state.mode = BAD; + break; + } + //--- DROPBITS(4) ---// + hold >>>= 4; + bits -= 4; + //---// + len = (hold & 0x0f)/*BITS(4)*/ + 8; + if (state.wbits === 0) { + state.wbits = len; + } + else if (len > state.wbits) { + strm.msg = 'invalid window size'; + state.mode = BAD; + break; + } + state.dmax = 1 << len; + //Tracev((stderr, "inflate: zlib header ok\n")); + strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; + state.mode = hold & 0x200 ? DICTID : TYPE; + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + break; + case FLAGS: + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.flags = hold; + if ((state.flags & 0xff) !== Z_DEFLATED) { + strm.msg = 'unknown compression method'; + state.mode = BAD; + break; + } + if (state.flags & 0xe000) { + strm.msg = 'unknown header flags set'; + state.mode = BAD; + break; + } + if (state.head) { + state.head.text = ((hold >> 8) & 1); + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = TIME; + /* falls through */ + case TIME: + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (state.head) { + state.head.time = hold; + } + if (state.flags & 0x0200) { + //=== CRC4(state.check, hold) + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + hbuf[2] = (hold >>> 16) & 0xff; + hbuf[3] = (hold >>> 24) & 0xff; + state.check = crc32(state.check, hbuf, 4, 0); + //=== + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = OS; + /* falls through */ + case OS: + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (state.head) { + state.head.xflags = (hold & 0xff); + state.head.os = (hold >> 8); + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = EXLEN; + /* falls through */ + case EXLEN: + if (state.flags & 0x0400) { + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.length = hold; + if (state.head) { + state.head.extra_len = hold; + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + } + else if (state.head) { + state.head.extra = null/*Z_NULL*/; + } + state.mode = EXTRA; + /* falls through */ + case EXTRA: + if (state.flags & 0x0400) { + copy = state.length; + if (copy > have) { copy = have; } + if (copy) { + if (state.head) { + len = state.head.extra_len - state.length; + if (!state.head.extra) { + // Use untyped array for more convenient processing later + state.head.extra = new Array(state.head.extra_len); + } + utils.arraySet( + state.head.extra, + input, + next, + // extra field is limited to 65536 bytes + // - no need for additional size check + copy, + /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ + len + ); + //zmemcpy(state.head.extra + len, next, + // len + copy > state.head.extra_max ? + // state.head.extra_max - len : copy); + } + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + state.length -= copy; + } + if (state.length) { break inf_leave; } + } + state.length = 0; + state.mode = NAME; + /* falls through */ + case NAME: + if (state.flags & 0x0800) { + if (have === 0) { break inf_leave; } + copy = 0; + do { + // TODO: 2 or 1 bytes? + len = input[next + copy++]; + /* use constant limit because in js we should not preallocate memory */ + if (state.head && len && + (state.length < 65536 /*state.head.name_max*/)) { + state.head.name += String.fromCharCode(len); + } + } while (len && copy < have); + + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + if (len) { break inf_leave; } + } + else if (state.head) { + state.head.name = null; + } + state.length = 0; + state.mode = COMMENT; + /* falls through */ + case COMMENT: + if (state.flags & 0x1000) { + if (have === 0) { break inf_leave; } + copy = 0; + do { + len = input[next + copy++]; + /* use constant limit because in js we should not preallocate memory */ + if (state.head && len && + (state.length < 65536 /*state.head.comm_max*/)) { + state.head.comment += String.fromCharCode(len); + } + } while (len && copy < have); + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + if (len) { break inf_leave; } + } + else if (state.head) { + state.head.comment = null; + } + state.mode = HCRC; + /* falls through */ + case HCRC: + if (state.flags & 0x0200) { + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (hold !== (state.check & 0xffff)) { + strm.msg = 'header crc mismatch'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + } + if (state.head) { + state.head.hcrc = ((state.flags >> 9) & 1); + state.head.done = true; + } + strm.adler = state.check = 0; + state.mode = TYPE; + break; + case DICTID: + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + strm.adler = state.check = zswap32(hold); + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = DICT; + /* falls through */ + case DICT: + if (state.havedict === 0) { + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + return Z_NEED_DICT; + } + strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; + state.mode = TYPE; + /* falls through */ + case TYPE: + if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; } + /* falls through */ + case TYPEDO: + if (state.last) { + //--- BYTEBITS() ---// + hold >>>= bits & 7; + bits -= bits & 7; + //---// + state.mode = CHECK; + break; + } + //=== NEEDBITS(3); */ + while (bits < 3) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.last = (hold & 0x01)/*BITS(1)*/; + //--- DROPBITS(1) ---// + hold >>>= 1; + bits -= 1; + //---// + + switch ((hold & 0x03)/*BITS(2)*/) { + case 0: /* stored block */ + //Tracev((stderr, "inflate: stored block%s\n", + // state.last ? " (last)" : "")); + state.mode = STORED; + break; + case 1: /* fixed block */ + fixedtables(state); + //Tracev((stderr, "inflate: fixed codes block%s\n", + // state.last ? " (last)" : "")); + state.mode = LEN_; /* decode codes */ + if (flush === Z_TREES) { + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + break inf_leave; + } + break; + case 2: /* dynamic block */ + //Tracev((stderr, "inflate: dynamic codes block%s\n", + // state.last ? " (last)" : "")); + state.mode = TABLE; + break; + case 3: + strm.msg = 'invalid block type'; + state.mode = BAD; + } + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + break; + case STORED: + //--- BYTEBITS() ---// /* go to byte boundary */ + hold >>>= bits & 7; + bits -= bits & 7; + //---// + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) { + strm.msg = 'invalid stored block lengths'; + state.mode = BAD; + break; + } + state.length = hold & 0xffff; + //Tracev((stderr, "inflate: stored length %u\n", + // state.length)); + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = COPY_; + if (flush === Z_TREES) { break inf_leave; } + /* falls through */ + case COPY_: + state.mode = COPY; + /* falls through */ + case COPY: + copy = state.length; + if (copy) { + if (copy > have) { copy = have; } + if (copy > left) { copy = left; } + if (copy === 0) { break inf_leave; } + //--- zmemcpy(put, next, copy); --- + utils.arraySet(output, input, next, copy, put); + //---// + have -= copy; + next += copy; + left -= copy; + put += copy; + state.length -= copy; + break; + } + //Tracev((stderr, "inflate: stored end\n")); + state.mode = TYPE; + break; + case TABLE: + //=== NEEDBITS(14); */ + while (bits < 14) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257; + //--- DROPBITS(5) ---// + hold >>>= 5; + bits -= 5; + //---// + state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1; + //--- DROPBITS(5) ---// + hold >>>= 5; + bits -= 5; + //---// + state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4; + //--- DROPBITS(4) ---// + hold >>>= 4; + bits -= 4; + //---// +//#ifndef PKZIP_BUG_WORKAROUND + if (state.nlen > 286 || state.ndist > 30) { + strm.msg = 'too many length or distance symbols'; + state.mode = BAD; + break; + } +//#endif + //Tracev((stderr, "inflate: table sizes ok\n")); + state.have = 0; + state.mode = LENLENS; + /* falls through */ + case LENLENS: + while (state.have < state.ncode) { + //=== NEEDBITS(3); + while (bits < 3) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.lens[order[state.have++]] = (hold & 0x07);//BITS(3); + //--- DROPBITS(3) ---// + hold >>>= 3; + bits -= 3; + //---// + } + while (state.have < 19) { + state.lens[order[state.have++]] = 0; + } + // We have separate tables & no pointers. 2 commented lines below not needed. + //state.next = state.codes; + //state.lencode = state.next; + // Switch to use dynamic table + state.lencode = state.lendyn; + state.lenbits = 7; + + opts = { bits: state.lenbits }; + ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); + state.lenbits = opts.bits; + + if (ret) { + strm.msg = 'invalid code lengths set'; + state.mode = BAD; + break; + } + //Tracev((stderr, "inflate: code lengths ok\n")); + state.have = 0; + state.mode = CODELENS; + /* falls through */ + case CODELENS: + while (state.have < state.nlen + state.ndist) { + for (;;) { + here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if (here_val < 16) { + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.lens[state.have++] = here_val; + } + else { + if (here_val === 16) { + //=== NEEDBITS(here.bits + 2); + n = here_bits + 2; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + if (state.have === 0) { + strm.msg = 'invalid bit length repeat'; + state.mode = BAD; + break; + } + len = state.lens[state.have - 1]; + copy = 3 + (hold & 0x03);//BITS(2); + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + } + else if (here_val === 17) { + //=== NEEDBITS(here.bits + 3); + n = here_bits + 3; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + len = 0; + copy = 3 + (hold & 0x07);//BITS(3); + //--- DROPBITS(3) ---// + hold >>>= 3; + bits -= 3; + //---// + } + else { + //=== NEEDBITS(here.bits + 7); + n = here_bits + 7; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + len = 0; + copy = 11 + (hold & 0x7f);//BITS(7); + //--- DROPBITS(7) ---// + hold >>>= 7; + bits -= 7; + //---// + } + if (state.have + copy > state.nlen + state.ndist) { + strm.msg = 'invalid bit length repeat'; + state.mode = BAD; + break; + } + while (copy--) { + state.lens[state.have++] = len; + } + } + } + + /* handle error breaks in while */ + if (state.mode === BAD) { break; } + + /* check for end-of-block code (better have one) */ + if (state.lens[256] === 0) { + strm.msg = 'invalid code -- missing end-of-block'; + state.mode = BAD; + break; + } + + /* build code tables -- note: do not change the lenbits or distbits + values here (9 and 6) without reading the comments in inftrees.h + concerning the ENOUGH constants, which depend on those values */ + state.lenbits = 9; + + opts = { bits: state.lenbits }; + ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); + // We have separate tables & no pointers. 2 commented lines below not needed. + // state.next_index = opts.table_index; + state.lenbits = opts.bits; + // state.lencode = state.next; + + if (ret) { + strm.msg = 'invalid literal/lengths set'; + state.mode = BAD; + break; + } + + state.distbits = 6; + //state.distcode.copy(state.codes); + // Switch to use dynamic table + state.distcode = state.distdyn; + opts = { bits: state.distbits }; + ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); + // We have separate tables & no pointers. 2 commented lines below not needed. + // state.next_index = opts.table_index; + state.distbits = opts.bits; + // state.distcode = state.next; + + if (ret) { + strm.msg = 'invalid distances set'; + state.mode = BAD; + break; + } + //Tracev((stderr, 'inflate: codes ok\n')); + state.mode = LEN_; + if (flush === Z_TREES) { break inf_leave; } + /* falls through */ + case LEN_: + state.mode = LEN; + /* falls through */ + case LEN: + if (have >= 6 && left >= 258) { + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + inflate_fast(strm, _out); + //--- LOAD() --- + put = strm.next_out; + output = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + //--- + + if (state.mode === TYPE) { + state.back = -1; + } + break; + } + state.back = 0; + for (;;) { + here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if (here_bits <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if (here_op && (here_op & 0xf0) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (;;) { + here = state.lencode[last_val + + ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)]; + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((last_bits + here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + //--- DROPBITS(last.bits) ---// + hold >>>= last_bits; + bits -= last_bits; + //---// + state.back += last_bits; + } + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.back += here_bits; + state.length = here_val; + if (here_op === 0) { + //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? + // "inflate: literal '%c'\n" : + // "inflate: literal 0x%02x\n", here.val)); + state.mode = LIT; + break; + } + if (here_op & 32) { + //Tracevv((stderr, "inflate: end of block\n")); + state.back = -1; + state.mode = TYPE; + break; + } + if (here_op & 64) { + strm.msg = 'invalid literal/length code'; + state.mode = BAD; + break; + } + state.extra = here_op & 15; + state.mode = LENEXT; + /* falls through */ + case LENEXT: + if (state.extra) { + //=== NEEDBITS(state.extra); + n = state.extra; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/; + //--- DROPBITS(state.extra) ---// + hold >>>= state.extra; + bits -= state.extra; + //---// + state.back += state.extra; + } + //Tracevv((stderr, "inflate: length %u\n", state.length)); + state.was = state.length; + state.mode = DIST; + /* falls through */ + case DIST: + for (;;) { + here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if ((here_op & 0xf0) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (;;) { + here = state.distcode[last_val + + ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)]; + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((last_bits + here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + //--- DROPBITS(last.bits) ---// + hold >>>= last_bits; + bits -= last_bits; + //---// + state.back += last_bits; + } + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.back += here_bits; + if (here_op & 64) { + strm.msg = 'invalid distance code'; + state.mode = BAD; + break; + } + state.offset = here_val; + state.extra = (here_op) & 15; + state.mode = DISTEXT; + /* falls through */ + case DISTEXT: + if (state.extra) { + //=== NEEDBITS(state.extra); + n = state.extra; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/; + //--- DROPBITS(state.extra) ---// + hold >>>= state.extra; + bits -= state.extra; + //---// + state.back += state.extra; + } +//#ifdef INFLATE_STRICT + if (state.offset > state.dmax) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break; + } +//#endif + //Tracevv((stderr, "inflate: distance %u\n", state.offset)); + state.mode = MATCH; + /* falls through */ + case MATCH: + if (left === 0) { break inf_leave; } + copy = _out - left; + if (state.offset > copy) { /* copy from window */ + copy = state.offset - copy; + if (copy > state.whave) { + if (state.sane) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break; + } +// (!) This block is disabled in zlib defaults, +// don't enable it for binary compatibility +//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR +// Trace((stderr, "inflate.c too far\n")); +// copy -= state.whave; +// if (copy > state.length) { copy = state.length; } +// if (copy > left) { copy = left; } +// left -= copy; +// state.length -= copy; +// do { +// output[put++] = 0; +// } while (--copy); +// if (state.length === 0) { state.mode = LEN; } +// break; +//#endif + } + if (copy > state.wnext) { + copy -= state.wnext; + from = state.wsize - copy; + } + else { + from = state.wnext - copy; + } + if (copy > state.length) { copy = state.length; } + from_source = state.window; + } + else { /* copy from output */ + from_source = output; + from = put - state.offset; + copy = state.length; + } + if (copy > left) { copy = left; } + left -= copy; + state.length -= copy; + do { + output[put++] = from_source[from++]; + } while (--copy); + if (state.length === 0) { state.mode = LEN; } + break; + case LIT: + if (left === 0) { break inf_leave; } + output[put++] = state.length; + left--; + state.mode = LEN; + break; + case CHECK: + if (state.wrap) { + //=== NEEDBITS(32); + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + // Use '|' instead of '+' to make sure that result is signed + hold |= input[next++] << bits; + bits += 8; + } + //===// + _out -= left; + strm.total_out += _out; + state.total += _out; + if (_out) { + strm.adler = state.check = + /*UPDATE(state.check, put - _out, _out);*/ + (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out)); + + } + _out = left; + // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too + if ((state.flags ? hold : zswap32(hold)) !== state.check) { + strm.msg = 'incorrect data check'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + //Tracev((stderr, "inflate: check matches trailer\n")); + } + state.mode = LENGTH; + /* falls through */ + case LENGTH: + if (state.wrap && state.flags) { + //=== NEEDBITS(32); + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (hold !== (state.total & 0xffffffff)) { + strm.msg = 'incorrect length check'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + //Tracev((stderr, "inflate: length matches trailer\n")); + } + state.mode = DONE; + /* falls through */ + case DONE: + ret = Z_STREAM_END; + break inf_leave; + case BAD: + ret = Z_DATA_ERROR; + break inf_leave; + case MEM: + return Z_MEM_ERROR; + case SYNC: + /* falls through */ + default: + return Z_STREAM_ERROR; + } + } + + // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave" + + /* + Return from inflate(), updating the total counts and the check value. + If there was no progress during the inflate() call, return a buffer + error. Call updatewindow() to create and/or update the window state. + Note: a memory error from inflate() is non-recoverable. + */ + + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + + if (state.wsize || (_out !== strm.avail_out && state.mode < BAD && + (state.mode < CHECK || flush !== Z_FINISH))) { + if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) { + state.mode = MEM; + return Z_MEM_ERROR; + } + } + _in -= strm.avail_in; + _out -= strm.avail_out; + strm.total_in += _in; + strm.total_out += _out; + state.total += _out; + if (state.wrap && _out) { + strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ + (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out)); + } + strm.data_type = state.bits + (state.last ? 64 : 0) + + (state.mode === TYPE ? 128 : 0) + + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); + if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) { + ret = Z_BUF_ERROR; + } + return ret; +} + +function inflateEnd(strm) { + + if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) { + return Z_STREAM_ERROR; + } + + var state = strm.state; + if (state.window) { + state.window = null; + } + strm.state = null; + return Z_OK; +} + +function inflateGetHeader(strm, head) { + var state; + + /* check state */ + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; } + + /* save header structure */ + state.head = head; + head.done = false; + return Z_OK; +} + +function inflateSetDictionary(strm, dictionary) { + var dictLength = dictionary.length; + + var state; + var dictid; + var ret; + + /* check state */ + if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; } + state = strm.state; + + if (state.wrap !== 0 && state.mode !== DICT) { + return Z_STREAM_ERROR; + } + + /* check for correct dictionary identifier */ + if (state.mode === DICT) { + dictid = 1; /* adler32(0, null, 0)*/ + /* dictid = adler32(dictid, dictionary, dictLength); */ + dictid = adler32(dictid, dictionary, dictLength, 0); + if (dictid !== state.check) { + return Z_DATA_ERROR; + } + } + /* copy dictionary to window using updatewindow(), which will amend the + existing dictionary if appropriate */ + ret = updatewindow(strm, dictionary, dictLength, dictLength); + if (ret) { + state.mode = MEM; + return Z_MEM_ERROR; + } + state.havedict = 1; + // Tracev((stderr, "inflate: dictionary set\n")); + return Z_OK; +} + +exports.inflateReset = inflateReset; +exports.inflateReset2 = inflateReset2; +exports.inflateResetKeep = inflateResetKeep; +exports.inflateInit = inflateInit; +exports.inflateInit2 = inflateInit2; +exports.inflate = inflate; +exports.inflateEnd = inflateEnd; +exports.inflateGetHeader = inflateGetHeader; +exports.inflateSetDictionary = inflateSetDictionary; +exports.inflateInfo = 'pako inflate (from Nodeca project)'; + +/* Not implemented +exports.inflateCopy = inflateCopy; +exports.inflateGetDictionary = inflateGetDictionary; +exports.inflateMark = inflateMark; +exports.inflatePrime = inflatePrime; +exports.inflateSync = inflateSync; +exports.inflateSyncPoint = inflateSyncPoint; +exports.inflateUndermine = inflateUndermine; +*/ diff --git a/node_modules/pako/lib/zlib/inftrees.js b/node_modules/pako/lib/zlib/inftrees.js new file mode 100644 index 000000000..ec4e4e909 --- /dev/null +++ b/node_modules/pako/lib/zlib/inftrees.js @@ -0,0 +1,343 @@ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +var utils = require('../utils/common'); + +var MAXBITS = 15; +var ENOUGH_LENS = 852; +var ENOUGH_DISTS = 592; +//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); + +var CODES = 0; +var LENS = 1; +var DISTS = 2; + +var lbase = [ /* Length codes 257..285 base */ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 +]; + +var lext = [ /* Length codes 257..285 extra */ + 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78 +]; + +var dbase = [ /* Distance codes 0..29 base */ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577, 0, 0 +]; + +var dext = [ /* Distance codes 0..29 extra */ + 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, + 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, + 28, 28, 29, 29, 64, 64 +]; + +module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) +{ + var bits = opts.bits; + //here = opts.here; /* table entry for duplication */ + + var len = 0; /* a code's length in bits */ + var sym = 0; /* index of code symbols */ + var min = 0, max = 0; /* minimum and maximum code lengths */ + var root = 0; /* number of index bits for root table */ + var curr = 0; /* number of index bits for current table */ + var drop = 0; /* code bits to drop for sub-table */ + var left = 0; /* number of prefix codes available */ + var used = 0; /* code entries in table used */ + var huff = 0; /* Huffman code */ + var incr; /* for incrementing code, index */ + var fill; /* index for replicating entries */ + var low; /* low bits for current root entry */ + var mask; /* mask for low root bits */ + var next; /* next available space in table */ + var base = null; /* base value table to use */ + var base_index = 0; +// var shoextra; /* extra bits table to use */ + var end; /* use base and extra for symbol > end */ + var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */ + var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */ + var extra = null; + var extra_index = 0; + + var here_bits, here_op, here_val; + + /* + Process a set of code lengths to create a canonical Huffman code. The + code lengths are lens[0..codes-1]. Each length corresponds to the + symbols 0..codes-1. The Huffman code is generated by first sorting the + symbols by length from short to long, and retaining the symbol order + for codes with equal lengths. Then the code starts with all zero bits + for the first code of the shortest length, and the codes are integer + increments for the same length, and zeros are appended as the length + increases. For the deflate format, these bits are stored backwards + from their more natural integer increment ordering, and so when the + decoding tables are built in the large loop below, the integer codes + are incremented backwards. + + This routine assumes, but does not check, that all of the entries in + lens[] are in the range 0..MAXBITS. The caller must assure this. + 1..MAXBITS is interpreted as that code length. zero means that that + symbol does not occur in this code. + + The codes are sorted by computing a count of codes for each length, + creating from that a table of starting indices for each length in the + sorted table, and then entering the symbols in order in the sorted + table. The sorted table is work[], with that space being provided by + the caller. + + The length counts are used for other purposes as well, i.e. finding + the minimum and maximum length codes, determining if there are any + codes at all, checking for a valid set of lengths, and looking ahead + at length counts to determine sub-table sizes when building the + decoding tables. + */ + + /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ + for (len = 0; len <= MAXBITS; len++) { + count[len] = 0; + } + for (sym = 0; sym < codes; sym++) { + count[lens[lens_index + sym]]++; + } + + /* bound code lengths, force root to be within code lengths */ + root = bits; + for (max = MAXBITS; max >= 1; max--) { + if (count[max] !== 0) { break; } + } + if (root > max) { + root = max; + } + if (max === 0) { /* no symbols to code at all */ + //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */ + //table.bits[opts.table_index] = 1; //here.bits = (var char)1; + //table.val[opts.table_index++] = 0; //here.val = (var short)0; + table[table_index++] = (1 << 24) | (64 << 16) | 0; + + + //table.op[opts.table_index] = 64; + //table.bits[opts.table_index] = 1; + //table.val[opts.table_index++] = 0; + table[table_index++] = (1 << 24) | (64 << 16) | 0; + + opts.bits = 1; + return 0; /* no symbols, but wait for decoding to report error */ + } + for (min = 1; min < max; min++) { + if (count[min] !== 0) { break; } + } + if (root < min) { + root = min; + } + + /* check for an over-subscribed or incomplete set of lengths */ + left = 1; + for (len = 1; len <= MAXBITS; len++) { + left <<= 1; + left -= count[len]; + if (left < 0) { + return -1; + } /* over-subscribed */ + } + if (left > 0 && (type === CODES || max !== 1)) { + return -1; /* incomplete set */ + } + + /* generate offsets into symbol table for each length for sorting */ + offs[1] = 0; + for (len = 1; len < MAXBITS; len++) { + offs[len + 1] = offs[len] + count[len]; + } + + /* sort symbols by length, by symbol order within each length */ + for (sym = 0; sym < codes; sym++) { + if (lens[lens_index + sym] !== 0) { + work[offs[lens[lens_index + sym]]++] = sym; + } + } + + /* + Create and fill in decoding tables. In this loop, the table being + filled is at next and has curr index bits. The code being used is huff + with length len. That code is converted to an index by dropping drop + bits off of the bottom. For codes where len is less than drop + curr, + those top drop + curr - len bits are incremented through all values to + fill the table with replicated entries. + + root is the number of index bits for the root table. When len exceeds + root, sub-tables are created pointed to by the root entry with an index + of the low root bits of huff. This is saved in low to check for when a + new sub-table should be started. drop is zero when the root table is + being filled, and drop is root when sub-tables are being filled. + + When a new sub-table is needed, it is necessary to look ahead in the + code lengths to determine what size sub-table is needed. The length + counts are used for this, and so count[] is decremented as codes are + entered in the tables. + + used keeps track of how many table entries have been allocated from the + provided *table space. It is checked for LENS and DIST tables against + the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in + the initial root table size constants. See the comments in inftrees.h + for more information. + + sym increments through all symbols, and the loop terminates when + all codes of length max, i.e. all codes, have been processed. This + routine permits incomplete codes, so another loop after this one fills + in the rest of the decoding tables with invalid code markers. + */ + + /* set up for code type */ + // poor man optimization - use if-else instead of switch, + // to avoid deopts in old v8 + if (type === CODES) { + base = extra = work; /* dummy value--not used */ + end = 19; + + } else if (type === LENS) { + base = lbase; + base_index -= 257; + extra = lext; + extra_index -= 257; + end = 256; + + } else { /* DISTS */ + base = dbase; + extra = dext; + end = -1; + } + + /* initialize opts for loop */ + huff = 0; /* starting code */ + sym = 0; /* starting code symbol */ + len = min; /* starting code length */ + next = table_index; /* current table to fill in */ + curr = root; /* current table index bits */ + drop = 0; /* current bits to drop from code for index */ + low = -1; /* trigger new sub-table when len > root */ + used = 1 << root; /* use root table entries */ + mask = used - 1; /* mask for comparing low */ + + /* check available table space */ + if ((type === LENS && used > ENOUGH_LENS) || + (type === DISTS && used > ENOUGH_DISTS)) { + return 1; + } + + /* process all codes and make table entries */ + for (;;) { + /* create table entry */ + here_bits = len - drop; + if (work[sym] < end) { + here_op = 0; + here_val = work[sym]; + } + else if (work[sym] > end) { + here_op = extra[extra_index + work[sym]]; + here_val = base[base_index + work[sym]]; + } + else { + here_op = 32 + 64; /* end of block */ + here_val = 0; + } + + /* replicate for those indices with low len bits equal to huff */ + incr = 1 << (len - drop); + fill = 1 << curr; + min = fill; /* save offset to next table */ + do { + fill -= incr; + table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0; + } while (fill !== 0); + + /* backwards increment the len-bit code huff */ + incr = 1 << (len - 1); + while (huff & incr) { + incr >>= 1; + } + if (incr !== 0) { + huff &= incr - 1; + huff += incr; + } else { + huff = 0; + } + + /* go to next symbol, update count, len */ + sym++; + if (--count[len] === 0) { + if (len === max) { break; } + len = lens[lens_index + work[sym]]; + } + + /* create new sub-table if needed */ + if (len > root && (huff & mask) !== low) { + /* if first time, transition to sub-tables */ + if (drop === 0) { + drop = root; + } + + /* increment past last table */ + next += min; /* here min is 1 << curr */ + + /* determine length of next table */ + curr = len - drop; + left = 1 << curr; + while (curr + drop < max) { + left -= count[curr + drop]; + if (left <= 0) { break; } + curr++; + left <<= 1; + } + + /* check for enough space */ + used += 1 << curr; + if ((type === LENS && used > ENOUGH_LENS) || + (type === DISTS && used > ENOUGH_DISTS)) { + return 1; + } + + /* point entry in root table to sub-table */ + low = huff & mask; + /*table.op[low] = curr; + table.bits[low] = root; + table.val[low] = next - opts.table_index;*/ + table[low] = (root << 24) | (curr << 16) | (next - table_index) |0; + } + } + + /* fill in remaining table entry if code is incomplete (guaranteed to have + at most one remaining entry, since if the code is incomplete, the + maximum code length that was allowed to get this far is one bit) */ + if (huff !== 0) { + //table.op[next + huff] = 64; /* invalid code marker */ + //table.bits[next + huff] = len - drop; + //table.val[next + huff] = 0; + table[next + huff] = ((len - drop) << 24) | (64 << 16) |0; + } + + /* set return parameters */ + //opts.table_index += used; + opts.bits = root; + return 0; +}; diff --git a/node_modules/pako/lib/zlib/messages.js b/node_modules/pako/lib/zlib/messages.js new file mode 100644 index 000000000..426daec6b --- /dev/null +++ b/node_modules/pako/lib/zlib/messages.js @@ -0,0 +1,32 @@ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +module.exports = { + 2: 'need dictionary', /* Z_NEED_DICT 2 */ + 1: 'stream end', /* Z_STREAM_END 1 */ + 0: '', /* Z_OK 0 */ + '-1': 'file error', /* Z_ERRNO (-1) */ + '-2': 'stream error', /* Z_STREAM_ERROR (-2) */ + '-3': 'data error', /* Z_DATA_ERROR (-3) */ + '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */ + '-5': 'buffer error', /* Z_BUF_ERROR (-5) */ + '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */ +}; diff --git a/node_modules/pako/lib/zlib/trees.js b/node_modules/pako/lib/zlib/trees.js new file mode 100644 index 000000000..2a81992e5 --- /dev/null +++ b/node_modules/pako/lib/zlib/trees.js @@ -0,0 +1,1220 @@ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +var utils = require('../utils/common'); + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + + +//var Z_FILTERED = 1; +//var Z_HUFFMAN_ONLY = 2; +//var Z_RLE = 3; +var Z_FIXED = 4; +//var Z_DEFAULT_STRATEGY = 0; + +/* Possible values of the data_type field (though see inflate()) */ +var Z_BINARY = 0; +var Z_TEXT = 1; +//var Z_ASCII = 1; // = Z_TEXT +var Z_UNKNOWN = 2; + +/*============================================================================*/ + + +function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } + +// From zutil.h + +var STORED_BLOCK = 0; +var STATIC_TREES = 1; +var DYN_TREES = 2; +/* The three kinds of block type */ + +var MIN_MATCH = 3; +var MAX_MATCH = 258; +/* The minimum and maximum match lengths */ + +// From deflate.h +/* =========================================================================== + * Internal compression state. + */ + +var LENGTH_CODES = 29; +/* number of length codes, not counting the special END_BLOCK code */ + +var LITERALS = 256; +/* number of literal bytes 0..255 */ + +var L_CODES = LITERALS + 1 + LENGTH_CODES; +/* number of Literal or Length codes, including the END_BLOCK code */ + +var D_CODES = 30; +/* number of distance codes */ + +var BL_CODES = 19; +/* number of codes used to transfer the bit lengths */ + +var HEAP_SIZE = 2 * L_CODES + 1; +/* maximum heap size */ + +var MAX_BITS = 15; +/* All codes must not exceed MAX_BITS bits */ + +var Buf_size = 16; +/* size of bit buffer in bi_buf */ + + +/* =========================================================================== + * Constants + */ + +var MAX_BL_BITS = 7; +/* Bit length codes must not exceed MAX_BL_BITS bits */ + +var END_BLOCK = 256; +/* end of block literal code */ + +var REP_3_6 = 16; +/* repeat previous bit length 3-6 times (2 bits of repeat count) */ + +var REPZ_3_10 = 17; +/* repeat a zero length 3-10 times (3 bits of repeat count) */ + +var REPZ_11_138 = 18; +/* repeat a zero length 11-138 times (7 bits of repeat count) */ + +/* eslint-disable comma-spacing,array-bracket-spacing */ +var extra_lbits = /* extra bits for each length code */ + [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]; + +var extra_dbits = /* extra bits for each distance code */ + [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]; + +var extra_blbits = /* extra bits for each bit length code */ + [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]; + +var bl_order = + [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]; +/* eslint-enable comma-spacing,array-bracket-spacing */ + +/* The lengths of the bit length codes are sent in order of decreasing + * probability, to avoid transmitting the lengths for unused bit length codes. + */ + +/* =========================================================================== + * Local data. These are initialized only once. + */ + +// We pre-fill arrays with 0 to avoid uninitialized gaps + +var DIST_CODE_LEN = 512; /* see definition of array dist_code below */ + +// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1 +var static_ltree = new Array((L_CODES + 2) * 2); +zero(static_ltree); +/* The static literal tree. Since the bit lengths are imposed, there is no + * need for the L_CODES extra codes used during heap construction. However + * The codes 286 and 287 are needed to build a canonical tree (see _tr_init + * below). + */ + +var static_dtree = new Array(D_CODES * 2); +zero(static_dtree); +/* The static distance tree. (Actually a trivial tree since all codes use + * 5 bits.) + */ + +var _dist_code = new Array(DIST_CODE_LEN); +zero(_dist_code); +/* Distance codes. The first 256 values correspond to the distances + * 3 .. 258, the last 256 values correspond to the top 8 bits of + * the 15 bit distances. + */ + +var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); +zero(_length_code); +/* length code for each normalized match length (0 == MIN_MATCH) */ + +var base_length = new Array(LENGTH_CODES); +zero(base_length); +/* First normalized length for each code (0 = MIN_MATCH) */ + +var base_dist = new Array(D_CODES); +zero(base_dist); +/* First normalized distance for each code (0 = distance of 1) */ + + +function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) { + + this.static_tree = static_tree; /* static tree or NULL */ + this.extra_bits = extra_bits; /* extra bits for each code or NULL */ + this.extra_base = extra_base; /* base index for extra_bits */ + this.elems = elems; /* max number of elements in the tree */ + this.max_length = max_length; /* max bit length for the codes */ + + // show if `static_tree` has data or dummy - needed for monomorphic objects + this.has_stree = static_tree && static_tree.length; +} + + +var static_l_desc; +var static_d_desc; +var static_bl_desc; + + +function TreeDesc(dyn_tree, stat_desc) { + this.dyn_tree = dyn_tree; /* the dynamic tree */ + this.max_code = 0; /* largest code with non zero frequency */ + this.stat_desc = stat_desc; /* the corresponding static tree */ +} + + + +function d_code(dist) { + return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)]; +} + + +/* =========================================================================== + * Output a short LSB first on the stream. + * IN assertion: there is enough room in pendingBuf. + */ +function put_short(s, w) { +// put_byte(s, (uch)((w) & 0xff)); +// put_byte(s, (uch)((ush)(w) >> 8)); + s.pending_buf[s.pending++] = (w) & 0xff; + s.pending_buf[s.pending++] = (w >>> 8) & 0xff; +} + + +/* =========================================================================== + * Send a value on a given number of bits. + * IN assertion: length <= 16 and value fits in length bits. + */ +function send_bits(s, value, length) { + if (s.bi_valid > (Buf_size - length)) { + s.bi_buf |= (value << s.bi_valid) & 0xffff; + put_short(s, s.bi_buf); + s.bi_buf = value >> (Buf_size - s.bi_valid); + s.bi_valid += length - Buf_size; + } else { + s.bi_buf |= (value << s.bi_valid) & 0xffff; + s.bi_valid += length; + } +} + + +function send_code(s, c, tree) { + send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/); +} + + +/* =========================================================================== + * Reverse the first len bits of a code, using straightforward code (a faster + * method would use a table) + * IN assertion: 1 <= len <= 15 + */ +function bi_reverse(code, len) { + var res = 0; + do { + res |= code & 1; + code >>>= 1; + res <<= 1; + } while (--len > 0); + return res >>> 1; +} + + +/* =========================================================================== + * Flush the bit buffer, keeping at most 7 bits in it. + */ +function bi_flush(s) { + if (s.bi_valid === 16) { + put_short(s, s.bi_buf); + s.bi_buf = 0; + s.bi_valid = 0; + + } else if (s.bi_valid >= 8) { + s.pending_buf[s.pending++] = s.bi_buf & 0xff; + s.bi_buf >>= 8; + s.bi_valid -= 8; + } +} + + +/* =========================================================================== + * Compute the optimal bit lengths for a tree and update the total bit length + * for the current block. + * IN assertion: the fields freq and dad are set, heap[heap_max] and + * above are the tree nodes sorted by increasing frequency. + * OUT assertions: the field len is set to the optimal bit length, the + * array bl_count contains the frequencies for each bit length. + * The length opt_len is updated; static_len is also updated if stree is + * not null. + */ +function gen_bitlen(s, desc) +// deflate_state *s; +// tree_desc *desc; /* the tree descriptor */ +{ + var tree = desc.dyn_tree; + var max_code = desc.max_code; + var stree = desc.stat_desc.static_tree; + var has_stree = desc.stat_desc.has_stree; + var extra = desc.stat_desc.extra_bits; + var base = desc.stat_desc.extra_base; + var max_length = desc.stat_desc.max_length; + var h; /* heap index */ + var n, m; /* iterate over the tree elements */ + var bits; /* bit length */ + var xbits; /* extra bits */ + var f; /* frequency */ + var overflow = 0; /* number of elements with bit length too large */ + + for (bits = 0; bits <= MAX_BITS; bits++) { + s.bl_count[bits] = 0; + } + + /* In a first pass, compute the optimal bit lengths (which may + * overflow in the case of the bit length tree). + */ + tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */ + + for (h = s.heap_max + 1; h < HEAP_SIZE; h++) { + n = s.heap[h]; + bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1; + if (bits > max_length) { + bits = max_length; + overflow++; + } + tree[n * 2 + 1]/*.Len*/ = bits; + /* We overwrite tree[n].Dad which is no longer needed */ + + if (n > max_code) { continue; } /* not a leaf node */ + + s.bl_count[bits]++; + xbits = 0; + if (n >= base) { + xbits = extra[n - base]; + } + f = tree[n * 2]/*.Freq*/; + s.opt_len += f * (bits + xbits); + if (has_stree) { + s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits); + } + } + if (overflow === 0) { return; } + + // Trace((stderr,"\nbit length overflow\n")); + /* This happens for example on obj2 and pic of the Calgary corpus */ + + /* Find the first bit length which could increase: */ + do { + bits = max_length - 1; + while (s.bl_count[bits] === 0) { bits--; } + s.bl_count[bits]--; /* move one leaf down the tree */ + s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */ + s.bl_count[max_length]--; + /* The brother of the overflow item also moves one step up, + * but this does not affect bl_count[max_length] + */ + overflow -= 2; + } while (overflow > 0); + + /* Now recompute all bit lengths, scanning in increasing frequency. + * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all + * lengths instead of fixing only the wrong ones. This idea is taken + * from 'ar' written by Haruhiko Okumura.) + */ + for (bits = max_length; bits !== 0; bits--) { + n = s.bl_count[bits]; + while (n !== 0) { + m = s.heap[--h]; + if (m > max_code) { continue; } + if (tree[m * 2 + 1]/*.Len*/ !== bits) { + // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); + s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/; + tree[m * 2 + 1]/*.Len*/ = bits; + } + n--; + } + } +} + + +/* =========================================================================== + * Generate the codes for a given tree and bit counts (which need not be + * optimal). + * IN assertion: the array bl_count contains the bit length statistics for + * the given tree and the field len is set for all tree elements. + * OUT assertion: the field code is set for all tree elements of non + * zero code length. + */ +function gen_codes(tree, max_code, bl_count) +// ct_data *tree; /* the tree to decorate */ +// int max_code; /* largest code with non zero frequency */ +// ushf *bl_count; /* number of codes at each bit length */ +{ + var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */ + var code = 0; /* running code value */ + var bits; /* bit index */ + var n; /* code index */ + + /* The distribution counts are first used to generate the code values + * without bit reversal. + */ + for (bits = 1; bits <= MAX_BITS; bits++) { + next_code[bits] = code = (code + bl_count[bits - 1]) << 1; + } + /* Check that the bit counts in bl_count are consistent. The last code + * must be all ones. + */ + //Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */ + length = 0; + for (code = 0; code < LENGTH_CODES - 1; code++) { + base_length[code] = length; + for (n = 0; n < (1 << extra_lbits[code]); n++) { + _length_code[length++] = code; + } + } + //Assert (length == 256, "tr_static_init: length != 256"); + /* Note that the length 255 (match length 258) can be represented + * in two different ways: code 284 + 5 bits or code 285, so we + * overwrite length_code[255] to use the best encoding: + */ + _length_code[length - 1] = code; + + /* Initialize the mapping dist (0..32K) -> dist code (0..29) */ + dist = 0; + for (code = 0; code < 16; code++) { + base_dist[code] = dist; + for (n = 0; n < (1 << extra_dbits[code]); n++) { + _dist_code[dist++] = code; + } + } + //Assert (dist == 256, "tr_static_init: dist != 256"); + dist >>= 7; /* from now on, all distances are divided by 128 */ + for (; code < D_CODES; code++) { + base_dist[code] = dist << 7; + for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) { + _dist_code[256 + dist++] = code; + } + } + //Assert (dist == 256, "tr_static_init: 256+dist != 512"); + + /* Construct the codes of the static literal tree */ + for (bits = 0; bits <= MAX_BITS; bits++) { + bl_count[bits] = 0; + } + + n = 0; + while (n <= 143) { + static_ltree[n * 2 + 1]/*.Len*/ = 8; + n++; + bl_count[8]++; + } + while (n <= 255) { + static_ltree[n * 2 + 1]/*.Len*/ = 9; + n++; + bl_count[9]++; + } + while (n <= 279) { + static_ltree[n * 2 + 1]/*.Len*/ = 7; + n++; + bl_count[7]++; + } + while (n <= 287) { + static_ltree[n * 2 + 1]/*.Len*/ = 8; + n++; + bl_count[8]++; + } + /* Codes 286 and 287 do not exist, but we must include them in the + * tree construction to get a canonical Huffman tree (longest code + * all ones) + */ + gen_codes(static_ltree, L_CODES + 1, bl_count); + + /* The static distance tree is trivial: */ + for (n = 0; n < D_CODES; n++) { + static_dtree[n * 2 + 1]/*.Len*/ = 5; + static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5); + } + + // Now data ready and we can init static trees + static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); + static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); + static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); + + //static_init_done = true; +} + + +/* =========================================================================== + * Initialize a new block. + */ +function init_block(s) { + var n; /* iterates over tree elements */ + + /* Initialize the trees. */ + for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; } + + s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1; + s.opt_len = s.static_len = 0; + s.last_lit = s.matches = 0; +} + + +/* =========================================================================== + * Flush the bit buffer and align the output on a byte boundary + */ +function bi_windup(s) +{ + if (s.bi_valid > 8) { + put_short(s, s.bi_buf); + } else if (s.bi_valid > 0) { + //put_byte(s, (Byte)s->bi_buf); + s.pending_buf[s.pending++] = s.bi_buf; + } + s.bi_buf = 0; + s.bi_valid = 0; +} + +/* =========================================================================== + * Copy a stored block, storing first the length and its + * one's complement if requested. + */ +function copy_block(s, buf, len, header) +//DeflateState *s; +//charf *buf; /* the input data */ +//unsigned len; /* its length */ +//int header; /* true if block header must be written */ +{ + bi_windup(s); /* align on byte boundary */ + + if (header) { + put_short(s, len); + put_short(s, ~len); + } +// while (len--) { +// put_byte(s, *buf++); +// } + utils.arraySet(s.pending_buf, s.window, buf, len, s.pending); + s.pending += len; +} + +/* =========================================================================== + * Compares to subtrees, using the tree depth as tie breaker when + * the subtrees have equal frequency. This minimizes the worst case length. + */ +function smaller(tree, n, m, depth) { + var _n2 = n * 2; + var _m2 = m * 2; + return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ || + (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m])); +} + +/* =========================================================================== + * Restore the heap property by moving down the tree starting at node k, + * exchanging a node with the smallest of its two sons if necessary, stopping + * when the heap property is re-established (each father smaller than its + * two sons). + */ +function pqdownheap(s, tree, k) +// deflate_state *s; +// ct_data *tree; /* the tree to restore */ +// int k; /* node to move down */ +{ + var v = s.heap[k]; + var j = k << 1; /* left son of k */ + while (j <= s.heap_len) { + /* Set j to the smallest of the two sons: */ + if (j < s.heap_len && + smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) { + j++; + } + /* Exit if v is smaller than both sons */ + if (smaller(tree, v, s.heap[j], s.depth)) { break; } + + /* Exchange v with the smallest son */ + s.heap[k] = s.heap[j]; + k = j; + + /* And continue down the tree, setting j to the left son of k */ + j <<= 1; + } + s.heap[k] = v; +} + + +// inlined manually +// var SMALLEST = 1; + +/* =========================================================================== + * Send the block data compressed using the given Huffman trees + */ +function compress_block(s, ltree, dtree) +// deflate_state *s; +// const ct_data *ltree; /* literal tree */ +// const ct_data *dtree; /* distance tree */ +{ + var dist; /* distance of matched string */ + var lc; /* match length or unmatched char (if dist == 0) */ + var lx = 0; /* running index in l_buf */ + var code; /* the code to send */ + var extra; /* number of extra bits to send */ + + if (s.last_lit !== 0) { + do { + dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]); + lc = s.pending_buf[s.l_buf + lx]; + lx++; + + if (dist === 0) { + send_code(s, lc, ltree); /* send a literal byte */ + //Tracecv(isgraph(lc), (stderr," '%c' ", lc)); + } else { + /* Here, lc is the match length - MIN_MATCH */ + code = _length_code[lc]; + send_code(s, code + LITERALS + 1, ltree); /* send the length code */ + extra = extra_lbits[code]; + if (extra !== 0) { + lc -= base_length[code]; + send_bits(s, lc, extra); /* send the extra length bits */ + } + dist--; /* dist is now the match distance - 1 */ + code = d_code(dist); + //Assert (code < D_CODES, "bad d_code"); + + send_code(s, code, dtree); /* send the distance code */ + extra = extra_dbits[code]; + if (extra !== 0) { + dist -= base_dist[code]; + send_bits(s, dist, extra); /* send the extra distance bits */ + } + } /* literal or match pair ? */ + + /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ + //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx, + // "pendingBuf overflow"); + + } while (lx < s.last_lit); + } + + send_code(s, END_BLOCK, ltree); +} + + +/* =========================================================================== + * Construct one Huffman tree and assigns the code bit strings and lengths. + * Update the total bit length for the current block. + * IN assertion: the field freq is set for all tree elements. + * OUT assertions: the fields len and code are set to the optimal bit length + * and corresponding code. The length opt_len is updated; static_len is + * also updated if stree is not null. The field max_code is set. + */ +function build_tree(s, desc) +// deflate_state *s; +// tree_desc *desc; /* the tree descriptor */ +{ + var tree = desc.dyn_tree; + var stree = desc.stat_desc.static_tree; + var has_stree = desc.stat_desc.has_stree; + var elems = desc.stat_desc.elems; + var n, m; /* iterate over heap elements */ + var max_code = -1; /* largest code with non zero frequency */ + var node; /* new node being created */ + + /* Construct the initial heap, with least frequent element in + * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. + * heap[0] is not used. + */ + s.heap_len = 0; + s.heap_max = HEAP_SIZE; + + for (n = 0; n < elems; n++) { + if (tree[n * 2]/*.Freq*/ !== 0) { + s.heap[++s.heap_len] = max_code = n; + s.depth[n] = 0; + + } else { + tree[n * 2 + 1]/*.Len*/ = 0; + } + } + + /* The pkzip format requires that at least one distance code exists, + * and that at least one bit should be sent even if there is only one + * possible code. So to avoid special checks later on we force at least + * two codes of non zero frequency. + */ + while (s.heap_len < 2) { + node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0); + tree[node * 2]/*.Freq*/ = 1; + s.depth[node] = 0; + s.opt_len--; + + if (has_stree) { + s.static_len -= stree[node * 2 + 1]/*.Len*/; + } + /* node is 0 or 1 so it does not have extra bits */ + } + desc.max_code = max_code; + + /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, + * establish sub-heaps of increasing lengths: + */ + for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); } + + /* Construct the Huffman tree by repeatedly combining the least two + * frequent nodes. + */ + node = elems; /* next internal node of the tree */ + do { + //pqremove(s, tree, n); /* n = node of least frequency */ + /*** pqremove ***/ + n = s.heap[1/*SMALLEST*/]; + s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--]; + pqdownheap(s, tree, 1/*SMALLEST*/); + /***/ + + m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */ + + s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */ + s.heap[--s.heap_max] = m; + + /* Create a new node father of n and m */ + tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/; + s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1; + tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node; + + /* and insert the new node in the heap */ + s.heap[1/*SMALLEST*/] = node++; + pqdownheap(s, tree, 1/*SMALLEST*/); + + } while (s.heap_len >= 2); + + s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/]; + + /* At this point, the fields freq and dad are set. We can now + * generate the bit lengths. + */ + gen_bitlen(s, desc); + + /* The field len is now set, we can generate the bit codes */ + gen_codes(tree, max_code, s.bl_count); +} + + +/* =========================================================================== + * Scan a literal or distance tree to determine the frequencies of the codes + * in the bit length tree. + */ +function scan_tree(s, tree, max_code) +// deflate_state *s; +// ct_data *tree; /* the tree to be scanned */ +// int max_code; /* and its largest code of non zero frequency */ +{ + var n; /* iterates over all tree elements */ + var prevlen = -1; /* last emitted length */ + var curlen; /* length of current code */ + + var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */ + + var count = 0; /* repeat count of the current code */ + var max_count = 7; /* max repeat count */ + var min_count = 4; /* min repeat count */ + + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } + tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */ + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; + nextlen = tree[(n + 1) * 2 + 1]/*.Len*/; + + if (++count < max_count && curlen === nextlen) { + continue; + + } else if (count < min_count) { + s.bl_tree[curlen * 2]/*.Freq*/ += count; + + } else if (curlen !== 0) { + + if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; } + s.bl_tree[REP_3_6 * 2]/*.Freq*/++; + + } else if (count <= 10) { + s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++; + + } else { + s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++; + } + + count = 0; + prevlen = curlen; + + if (nextlen === 0) { + max_count = 138; + min_count = 3; + + } else if (curlen === nextlen) { + max_count = 6; + min_count = 3; + + } else { + max_count = 7; + min_count = 4; + } + } +} + + +/* =========================================================================== + * Send a literal or distance tree in compressed form, using the codes in + * bl_tree. + */ +function send_tree(s, tree, max_code) +// deflate_state *s; +// ct_data *tree; /* the tree to be scanned */ +// int max_code; /* and its largest code of non zero frequency */ +{ + var n; /* iterates over all tree elements */ + var prevlen = -1; /* last emitted length */ + var curlen; /* length of current code */ + + var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */ + + var count = 0; /* repeat count of the current code */ + var max_count = 7; /* max repeat count */ + var min_count = 4; /* min repeat count */ + + /* tree[max_code+1].Len = -1; */ /* guard already set */ + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; + nextlen = tree[(n + 1) * 2 + 1]/*.Len*/; + + if (++count < max_count && curlen === nextlen) { + continue; + + } else if (count < min_count) { + do { send_code(s, curlen, s.bl_tree); } while (--count !== 0); + + } else if (curlen !== 0) { + if (curlen !== prevlen) { + send_code(s, curlen, s.bl_tree); + count--; + } + //Assert(count >= 3 && count <= 6, " 3_6?"); + send_code(s, REP_3_6, s.bl_tree); + send_bits(s, count - 3, 2); + + } else if (count <= 10) { + send_code(s, REPZ_3_10, s.bl_tree); + send_bits(s, count - 3, 3); + + } else { + send_code(s, REPZ_11_138, s.bl_tree); + send_bits(s, count - 11, 7); + } + + count = 0; + prevlen = curlen; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + + } else if (curlen === nextlen) { + max_count = 6; + min_count = 3; + + } else { + max_count = 7; + min_count = 4; + } + } +} + + +/* =========================================================================== + * Construct the Huffman tree for the bit lengths and return the index in + * bl_order of the last bit length code to send. + */ +function build_bl_tree(s) { + var max_blindex; /* index of last bit length code of non zero freq */ + + /* Determine the bit length frequencies for literal and distance trees */ + scan_tree(s, s.dyn_ltree, s.l_desc.max_code); + scan_tree(s, s.dyn_dtree, s.d_desc.max_code); + + /* Build the bit length tree: */ + build_tree(s, s.bl_desc); + /* opt_len now includes the length of the tree representations, except + * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. + */ + + /* Determine the number of bit length codes to send. The pkzip format + * requires that at least 4 bit length codes be sent. (appnote.txt says + * 3 but the actual value used is 4.) + */ + for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { + if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) { + break; + } + } + /* Update opt_len to include the bit length tree and counts */ + s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; + //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", + // s->opt_len, s->static_len)); + + return max_blindex; +} + + +/* =========================================================================== + * Send the header for a block using dynamic Huffman trees: the counts, the + * lengths of the bit length codes, the literal tree and the distance tree. + * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. + */ +function send_all_trees(s, lcodes, dcodes, blcodes) +// deflate_state *s; +// int lcodes, dcodes, blcodes; /* number of codes for each tree */ +{ + var rank; /* index in bl_order */ + + //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); + //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, + // "too many codes"); + //Tracev((stderr, "\nbl counts: ")); + send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */ + send_bits(s, dcodes - 1, 5); + send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */ + for (rank = 0; rank < blcodes; rank++) { + //Tracev((stderr, "\nbl code %2d ", bl_order[rank])); + send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3); + } + //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); + + send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */ + //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); + + send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */ + //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); +} + + +/* =========================================================================== + * Check if the data type is TEXT or BINARY, using the following algorithm: + * - TEXT if the two conditions below are satisfied: + * a) There are no non-portable control characters belonging to the + * "black list" (0..6, 14..25, 28..31). + * b) There is at least one printable character belonging to the + * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). + * - BINARY otherwise. + * - The following partially-portable control characters form a + * "gray list" that is ignored in this detection algorithm: + * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). + * IN assertion: the fields Freq of dyn_ltree are set. + */ +function detect_data_type(s) { + /* black_mask is the bit mask of black-listed bytes + * set bits 0..6, 14..25, and 28..31 + * 0xf3ffc07f = binary 11110011111111111100000001111111 + */ + var black_mask = 0xf3ffc07f; + var n; + + /* Check for non-textual ("black-listed") bytes. */ + for (n = 0; n <= 31; n++, black_mask >>>= 1) { + if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) { + return Z_BINARY; + } + } + + /* Check for textual ("white-listed") bytes. */ + if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 || + s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) { + return Z_TEXT; + } + for (n = 32; n < LITERALS; n++) { + if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) { + return Z_TEXT; + } + } + + /* There are no "black-listed" or "white-listed" bytes: + * this stream either is empty or has tolerated ("gray-listed") bytes only. + */ + return Z_BINARY; +} + + +var static_init_done = false; + +/* =========================================================================== + * Initialize the tree data structures for a new zlib stream. + */ +function _tr_init(s) +{ + + if (!static_init_done) { + tr_static_init(); + static_init_done = true; + } + + s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc); + s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc); + s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc); + + s.bi_buf = 0; + s.bi_valid = 0; + + /* Initialize the first block of the first file: */ + init_block(s); +} + + +/* =========================================================================== + * Send a stored block + */ +function _tr_stored_block(s, buf, stored_len, last) +//DeflateState *s; +//charf *buf; /* input block */ +//ulg stored_len; /* length of input block */ +//int last; /* one if this is the last block for a file */ +{ + send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */ + copy_block(s, buf, stored_len, true); /* with header */ +} + + +/* =========================================================================== + * Send one empty static block to give enough lookahead for inflate. + * This takes 10 bits, of which 7 may remain in the bit buffer. + */ +function _tr_align(s) { + send_bits(s, STATIC_TREES << 1, 3); + send_code(s, END_BLOCK, static_ltree); + bi_flush(s); +} + + +/* =========================================================================== + * Determine the best encoding for the current block: dynamic trees, static + * trees or store, and output the encoded block to the zip file. + */ +function _tr_flush_block(s, buf, stored_len, last) +//DeflateState *s; +//charf *buf; /* input block, or NULL if too old */ +//ulg stored_len; /* length of input block */ +//int last; /* one if this is the last block for a file */ +{ + var opt_lenb, static_lenb; /* opt_len and static_len in bytes */ + var max_blindex = 0; /* index of last bit length code of non zero freq */ + + /* Build the Huffman trees unless a stored block is forced */ + if (s.level > 0) { + + /* Check if the file is binary or text */ + if (s.strm.data_type === Z_UNKNOWN) { + s.strm.data_type = detect_data_type(s); + } + + /* Construct the literal and distance trees */ + build_tree(s, s.l_desc); + // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len, + // s->static_len)); + + build_tree(s, s.d_desc); + // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len, + // s->static_len)); + /* At this point, opt_len and static_len are the total bit lengths of + * the compressed block data, excluding the tree representations. + */ + + /* Build the bit length tree for the above two trees, and get the index + * in bl_order of the last bit length code to send. + */ + max_blindex = build_bl_tree(s); + + /* Determine the best encoding. Compute the block lengths in bytes. */ + opt_lenb = (s.opt_len + 3 + 7) >>> 3; + static_lenb = (s.static_len + 3 + 7) >>> 3; + + // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", + // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, + // s->last_lit)); + + if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; } + + } else { + // Assert(buf != (char*)0, "lost buf"); + opt_lenb = static_lenb = stored_len + 5; /* force a stored block */ + } + + if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) { + /* 4: two words for the lengths */ + + /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. + * Otherwise we can't have processed more than WSIZE input bytes since + * the last block flush, because compression would have been + * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to + * transform a block into a stored block. + */ + _tr_stored_block(s, buf, stored_len, last); + + } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { + + send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3); + compress_block(s, static_ltree, static_dtree); + + } else { + send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3); + send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1); + compress_block(s, s.dyn_ltree, s.dyn_dtree); + } + // Assert (s->compressed_len == s->bits_sent, "bad compressed size"); + /* The above check is made mod 2^32, for files larger than 512 MB + * and uLong implemented on 32 bits. + */ + init_block(s); + + if (last) { + bi_windup(s); + } + // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, + // s->compressed_len-7*last)); +} + +/* =========================================================================== + * Save the match info and tally the frequency counts. Return true if + * the current block must be flushed. + */ +function _tr_tally(s, dist, lc) +// deflate_state *s; +// unsigned dist; /* distance of matched string */ +// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ +{ + //var out_length, in_length, dcode; + + s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff; + s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff; + + s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff; + s.last_lit++; + + if (dist === 0) { + /* lc is the unmatched char */ + s.dyn_ltree[lc * 2]/*.Freq*/++; + } else { + s.matches++; + /* Here, lc is the match length - MIN_MATCH */ + dist--; /* dist = match distance - 1 */ + //Assert((ush)dist < (ush)MAX_DIST(s) && + // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && + // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); + + s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++; + s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++; + } + +// (!) This block is disabled in zlib defaults, +// don't enable it for binary compatibility + +//#ifdef TRUNCATE_BLOCK +// /* Try to guess if it is profitable to stop the current block here */ +// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) { +// /* Compute an upper bound for the compressed length */ +// out_length = s.last_lit*8; +// in_length = s.strstart - s.block_start; +// +// for (dcode = 0; dcode < D_CODES; dcode++) { +// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]); +// } +// out_length >>>= 3; +// //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", +// // s->last_lit, in_length, out_length, +// // 100L - out_length*100L/in_length)); +// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) { +// return true; +// } +// } +//#endif + + return (s.last_lit === s.lit_bufsize - 1); + /* We avoid equality with lit_bufsize because of wraparound at 64K + * on 16 bit machines and because stored blocks are restricted to + * 64K-1 bytes. + */ +} + +exports._tr_init = _tr_init; +exports._tr_stored_block = _tr_stored_block; +exports._tr_flush_block = _tr_flush_block; +exports._tr_tally = _tr_tally; +exports._tr_align = _tr_align; diff --git a/node_modules/pako/lib/zlib/zstream.js b/node_modules/pako/lib/zlib/zstream.js new file mode 100644 index 000000000..122acfef0 --- /dev/null +++ b/node_modules/pako/lib/zlib/zstream.js @@ -0,0 +1,47 @@ +'use strict'; + +// (C) 1995-2013 Jean-loup Gailly and Mark Adler +// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +function ZStream() { + /* next input byte */ + this.input = null; // JS specific, because we have no pointers + this.next_in = 0; + /* number of bytes available at input */ + this.avail_in = 0; + /* total number of input bytes read so far */ + this.total_in = 0; + /* next output byte should be put there */ + this.output = null; // JS specific, because we have no pointers + this.next_out = 0; + /* remaining free space at output */ + this.avail_out = 0; + /* total number of bytes output so far */ + this.total_out = 0; + /* last error message, NULL if no error */ + this.msg = ''/*Z_NULL*/; + /* not visible by applications */ + this.state = null; + /* best guess about the data type: binary or text */ + this.data_type = 2/*Z_UNKNOWN*/; + /* adler32 value of the uncompressed data */ + this.adler = 0; +} + +module.exports = ZStream; diff --git a/node_modules/pako/package.json b/node_modules/pako/package.json new file mode 100644 index 000000000..caa1f580b --- /dev/null +++ b/node_modules/pako/package.json @@ -0,0 +1,95 @@ +{ + "_from": "pako@~1.0.5", + "_id": "pako@1.0.6", + "_inBundle": false, + "_integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", + "_location": "/pako", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "pako@~1.0.5", + "name": "pako", + "escapedName": "pako", + "rawSpec": "~1.0.5", + "saveSpec": null, + "fetchSpec": "~1.0.5" + }, + "_requiredBy": [ + "/browserify-zlib" + ], + "_resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", + "_shasum": "0101211baa70c4bca4a0f63f2206e97b7dfaf258", + "_spec": "pako@~1.0.5", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify-zlib", + "bugs": { + "url": "https://github.com/nodeca/pako/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Andrei Tuputcyn", + "url": "https://github.com/andr83" + }, + { + "name": "Vitaly Puzrin", + "url": "https://github.com/puzrin" + }, + { + "name": "Friedel Ziegelmayer", + "url": "https://github.com/dignifiedquire" + }, + { + "name": "Kirill Efimov", + "url": "https://github.com/Kirill89" + }, + { + "name": "Jean-loup Gailly" + }, + { + "name": "Mark Adler" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "zlib port to javascript - fast, modularized, with browser support", + "devDependencies": { + "ansi": "^0.3.1", + "benchmark": "^2.1.4", + "bluebird": "^3.5.0", + "browserify": "^14.4.0", + "eslint": "^3.12.2", + "grunt": "^1.0.1", + "grunt-cli": "^1.2.0", + "grunt-contrib-connect": "^1.0.2", + "grunt-saucelabs": "^9.0.0", + "istanbul": "^0.4.5", + "mocha": "^3.2.0", + "multiparty": "^4.1.3", + "ndoc": "^5.0.1", + "uglify-js": "^3.0.25", + "zlibjs": "^0.3.1" + }, + "files": [ + "index.js", + "dist/", + "lib/" + ], + "homepage": "https://github.com/nodeca/pako", + "keywords": [ + "zlib", + "deflate", + "inflate", + "gzip" + ], + "license": "(MIT AND Zlib)", + "name": "pako", + "repository": { + "type": "git", + "url": "git+https://github.com/nodeca/pako.git" + }, + "scripts": { + "test": "make test" + }, + "version": "1.0.6" +} diff --git a/node_modules/parents/.travis.yml b/node_modules/parents/.travis.yml new file mode 100644 index 000000000..895dbd362 --- /dev/null +++ b/node_modules/parents/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.6 + - 0.8 diff --git a/node_modules/parents/LICENSE b/node_modules/parents/LICENSE new file mode 100644 index 000000000..ee27ba4b4 --- /dev/null +++ b/node_modules/parents/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/parents/example/dirname.js b/node_modules/parents/example/dirname.js new file mode 100644 index 000000000..c9d381b20 --- /dev/null +++ b/node_modules/parents/example/dirname.js @@ -0,0 +1,3 @@ +var parents = require('../'); +var dirs = parents(__dirname); +console.dir(dirs); diff --git a/node_modules/parents/example/win32.js b/node_modules/parents/example/win32.js new file mode 100644 index 000000000..11b85d6e5 --- /dev/null +++ b/node_modules/parents/example/win32.js @@ -0,0 +1,5 @@ +var parents = require('../'); +var dir = 'C:\\Program Files\\Maxis\\Sim City 2000\\cities'; + +var dirs = parents(dir, { platform : 'win32' }); +console.dir(dirs); diff --git a/node_modules/parents/index.js b/node_modules/parents/index.js new file mode 100644 index 000000000..84a963979 --- /dev/null +++ b/node_modules/parents/index.js @@ -0,0 +1,48 @@ +var pathPlatform = require('path-platform'); + +module.exports = function (cwd, opts) { + if (cwd === undefined) cwd = process.cwd(); + if (!opts) opts = {}; + var platform = opts.platform || process.platform; + + var isWindows = /^win/.test(platform); + var path = isWindows ? pathPlatform.win32 : pathPlatform; + var normalize = !isWindows ? path.normalize : + path.normalize('c:') === 'c:.' ? fixNormalize(path.normalize) : + path.normalize; + var sep = isWindows ? /[\\\/]/ : '/'; + var init = isWindows ? '' : '/'; + + var join = function (x, y) { + var ps = [ x, y ].filter(function (p) { + return p && typeof p === 'string' + }); + + return normalize(ps.join(isWindows ? '\\' : '/')); + }; + + var res = normalize(cwd) + .split(sep) + .reduce(function (acc,dir,ix) { + return acc.concat(join(acc[ix], dir)) + }, [init]) + .slice(1) + .reverse() + ; + if (res[0] === res[1]) return [ res[0] ]; + if (isWindows && /^\\/.test(cwd)) { + return res.slice(0,-1).map(function (d) { + var ch = d.charAt(0) + return ch === '\\' ? d : + ch === '.' ? '\\' + d.slice(1) : + '\\' + d + }); + } + return res; + + function fixNormalize(fn) { + return function(p) { + return fn(p).replace(/:\.$/, ':') + } + } +} diff --git a/node_modules/parents/package.json b/node_modules/parents/package.json new file mode 100644 index 000000000..1abd5f095 --- /dev/null +++ b/node_modules/parents/package.json @@ -0,0 +1,69 @@ +{ + "_from": "parents@^1.0.1", + "_id": "parents@1.0.1", + "_inBundle": false, + "_integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", + "_location": "/parents", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "parents@^1.0.1", + "name": "parents", + "escapedName": "parents", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/browserify", + "/module-deps" + ], + "_resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", + "_shasum": "fedd4d2bf193a77745fe71e371d73c3307d9c751", + "_spec": "parents@^1.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bin": {}, + "bugs": { + "url": "https://github.com/substack/node-parents/issues" + }, + "bundleDependencies": false, + "dependencies": { + "path-platform": "~0.11.15" + }, + "deprecated": false, + "description": "return all the parent directories for a directory", + "devDependencies": { + "tap": "~0.2.5" + }, + "directories": { + "example": "example", + "test": "test" + }, + "engine": { + "node": ">=0.6" + }, + "homepage": "https://github.com/substack/node-parents", + "keywords": [ + "directory", + "parent", + "path", + "tree" + ], + "license": "MIT", + "main": "index.js", + "name": "parents", + "repository": { + "type": "git", + "url": "git://github.com/substack/node-parents.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "1.0.1" +} diff --git a/node_modules/parents/readme.markdown b/node_modules/parents/readme.markdown new file mode 100644 index 000000000..fe3bc1f0f --- /dev/null +++ b/node_modules/parents/readme.markdown @@ -0,0 +1,75 @@ +# parents + +Return all the parent directories of a directory, inclusive of that directory. + +[![build status](https://secure.travis-ci.org/substack/node-parents.png)](http://travis-ci.org/substack/node-parents) + +# example + +## dirname + +``` js +var parents = require('parents'); +var dirs = parents(__dirname); +console.dir(dirs); +``` + +*** + +``` +[ '/home/substack/projects/node-parents/example', + '/home/substack/projects/node-parents', + '/home/substack/projects', + '/home/substack', + '/home', + '/' ] +``` + +## win32 + +``` js +var parents = require('parents'); +var dir = 'C:\\Program Files\\Maxis\\Sim City 2000\\cities'; + +var dirs = parents(dir, { platform : 'win32' }); +console.dir(dirs); +``` + +*** + +``` +[ 'C:\\Program Files\\Maxis\\Sim City 2000\\cities', + 'C:\\Program Files\\Maxis\\Sim City 2000', + 'C:\\Program Files\\Maxis', + 'C:\\Program Files', + 'C:' ] +``` + +# methods + +``` js +var parents = require('parents') +``` + +## parents(dir, opts) + +Return an array of the parent directories of `dir`, including and starting with +`dir`. If a `dir` isn't specified, `process.cwd()` will be used. + +Optionally specify an `opts.platform` to control whether the separator and paths +works the unixy way with `'/'` or the windowsy way where sometimes things use +`'/'` and sometimes they use `'\\'` and also there are leading drive letters and +other exotic features. If `opts.platform` isn't specified, `process.platform` +will be used. Anything that matches `/^win/` will use the windowsy behavior. + +# install + +With [npm](http://npmjs.org) do: + +``` +npm install parents +``` + +# licence + +MIT diff --git a/node_modules/parents/test/dirname.js b/node_modules/parents/test/dirname.js new file mode 100644 index 000000000..317d131ce --- /dev/null +++ b/node_modules/parents/test/dirname.js @@ -0,0 +1,20 @@ +var test = require('tap').test; +var parents = require('../'); + +test('dirname', function (t) { + var dirs = parents('/foo/bar/baz/quux'); + t.same(dirs, [ + '/foo/bar/baz/quux', + '/foo/bar/baz', + '/foo/bar', + '/foo', + '/', + ]); + t.end(); +}); + +test('root', function (t) { + var dirs = parents('/'); + t.same(dirs, [ '/' ]); + t.end(); +}); diff --git a/node_modules/parents/test/win32.js b/node_modules/parents/test/win32.js new file mode 100644 index 000000000..c6f2ece80 --- /dev/null +++ b/node_modules/parents/test/win32.js @@ -0,0 +1,34 @@ +var test = require('tap').test; +var parents = require('../'); + +test('win32', function (t) { + var dir = 'c:\\Program Files\\Maxis\\Sim City 2000\\cities'; + var dirs = parents(dir, { platform : 'win32' }); + t.same(dirs, [ + 'c:\\Program Files\\Maxis\\Sim City 2000\\cities', + 'c:\\Program Files\\Maxis\\Sim City 2000', + 'c:\\Program Files\\Maxis', + 'c:\\Program Files', + 'c:', + ]); + t.end(); +}); + +test('win32 c:', function (t) { + var dirs = parents('c:\\', { platform : 'win32' }); + t.same(dirs, [ 'c:' ]); + t.end(); +}); + +test('win32 network drive', function (t) { + var dirs = parents( + '\\storageserver01\\Active Projects\\ProjectA', + { platform : 'win32' } + ); + t.same(dirs, [ + '\\storageserver01\\Active Projects\\ProjectA', + '\\storageserver01\\Active Projects', + '\\storageserver01' + ]); + t.end(); +}); diff --git a/node_modules/parse-asn1/.travis.yml b/node_modules/parse-asn1/.travis.yml new file mode 100644 index 000000000..ea321ccc5 --- /dev/null +++ b/node_modules/parse-asn1/.travis.yml @@ -0,0 +1,9 @@ +sudo: false +language: node_js +node_js: + - "0.12" + - "iojs" +env: + - TEST_SUITE=standard + - TEST_SUITE=unit +script: "npm run-script $TEST_SUITE" diff --git a/node_modules/parse-asn1/LICENSE b/node_modules/parse-asn1/LICENSE new file mode 100644 index 000000000..e0efcf251 --- /dev/null +++ b/node_modules/parse-asn1/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2017, crypto-browserify contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/parse-asn1/README.md b/node_modules/parse-asn1/README.md new file mode 100644 index 000000000..9cd4c153e --- /dev/null +++ b/node_modules/parse-asn1/README.md @@ -0,0 +1,8 @@ +# parse-asn1 + +[![TRAVIS](https://secure.travis-ci.org/crypto-browserify/parse-asn1.png)](http://travis-ci.org/crypto-browserify/parse-asn1) +[![NPM](http://img.shields.io/npm/v/parse-asn1.svg)](https://www.npmjs.org/package/parse-asn1) + +[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) + +utility library for parsing asn1 files for use with browserify-sign. diff --git a/node_modules/parse-asn1/aesid.json b/node_modules/parse-asn1/aesid.json new file mode 100644 index 000000000..24f653b40 --- /dev/null +++ b/node_modules/parse-asn1/aesid.json @@ -0,0 +1,13 @@ +{"2.16.840.1.101.3.4.1.1": "aes-128-ecb", +"2.16.840.1.101.3.4.1.2": "aes-128-cbc", +"2.16.840.1.101.3.4.1.3": "aes-128-ofb", +"2.16.840.1.101.3.4.1.4": "aes-128-cfb", +"2.16.840.1.101.3.4.1.21": "aes-192-ecb", +"2.16.840.1.101.3.4.1.22": "aes-192-cbc", +"2.16.840.1.101.3.4.1.23": "aes-192-ofb", +"2.16.840.1.101.3.4.1.24": "aes-192-cfb", +"2.16.840.1.101.3.4.1.41": "aes-256-ecb", +"2.16.840.1.101.3.4.1.42": "aes-256-cbc", +"2.16.840.1.101.3.4.1.43": "aes-256-ofb", +"2.16.840.1.101.3.4.1.44": "aes-256-cfb" +} \ No newline at end of file diff --git a/node_modules/parse-asn1/asn1.js b/node_modules/parse-asn1/asn1.js new file mode 100644 index 000000000..6cac822cf --- /dev/null +++ b/node_modules/parse-asn1/asn1.js @@ -0,0 +1,122 @@ +// from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js +// Fedor, you are amazing. +'use strict' + +var asn1 = require('asn1.js') + +exports.certificate = require('./certificate') + +var RSAPrivateKey = asn1.define('RSAPrivateKey', function () { + this.seq().obj( + this.key('version').int(), + this.key('modulus').int(), + this.key('publicExponent').int(), + this.key('privateExponent').int(), + this.key('prime1').int(), + this.key('prime2').int(), + this.key('exponent1').int(), + this.key('exponent2').int(), + this.key('coefficient').int() + ) +}) +exports.RSAPrivateKey = RSAPrivateKey + +var RSAPublicKey = asn1.define('RSAPublicKey', function () { + this.seq().obj( + this.key('modulus').int(), + this.key('publicExponent').int() + ) +}) +exports.RSAPublicKey = RSAPublicKey + +var PublicKey = asn1.define('SubjectPublicKeyInfo', function () { + this.seq().obj( + this.key('algorithm').use(AlgorithmIdentifier), + this.key('subjectPublicKey').bitstr() + ) +}) +exports.PublicKey = PublicKey + +var AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', function () { + this.seq().obj( + this.key('algorithm').objid(), + this.key('none').null_().optional(), + this.key('curve').objid().optional(), + this.key('params').seq().obj( + this.key('p').int(), + this.key('q').int(), + this.key('g').int() + ).optional() + ) +}) + +var PrivateKeyInfo = asn1.define('PrivateKeyInfo', function () { + this.seq().obj( + this.key('version').int(), + this.key('algorithm').use(AlgorithmIdentifier), + this.key('subjectPrivateKey').octstr() + ) +}) +exports.PrivateKey = PrivateKeyInfo +var EncryptedPrivateKeyInfo = asn1.define('EncryptedPrivateKeyInfo', function () { + this.seq().obj( + this.key('algorithm').seq().obj( + this.key('id').objid(), + this.key('decrypt').seq().obj( + this.key('kde').seq().obj( + this.key('id').objid(), + this.key('kdeparams').seq().obj( + this.key('salt').octstr(), + this.key('iters').int() + ) + ), + this.key('cipher').seq().obj( + this.key('algo').objid(), + this.key('iv').octstr() + ) + ) + ), + this.key('subjectPrivateKey').octstr() + ) +}) + +exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo + +var DSAPrivateKey = asn1.define('DSAPrivateKey', function () { + this.seq().obj( + this.key('version').int(), + this.key('p').int(), + this.key('q').int(), + this.key('g').int(), + this.key('pub_key').int(), + this.key('priv_key').int() + ) +}) +exports.DSAPrivateKey = DSAPrivateKey + +exports.DSAparam = asn1.define('DSAparam', function () { + this.int() +}) + +var ECPrivateKey = asn1.define('ECPrivateKey', function () { + this.seq().obj( + this.key('version').int(), + this.key('privateKey').octstr(), + this.key('parameters').optional().explicit(0).use(ECParameters), + this.key('publicKey').optional().explicit(1).bitstr() + ) +}) +exports.ECPrivateKey = ECPrivateKey + +var ECParameters = asn1.define('ECParameters', function () { + this.choice({ + namedCurve: this.objid() + }) +}) + +exports.signature = asn1.define('signature', function () { + this.seq().obj( + this.key('r').int(), + this.key('s').int() + ) +}) diff --git a/node_modules/parse-asn1/certificate.js b/node_modules/parse-asn1/certificate.js new file mode 100644 index 000000000..1acfe559e --- /dev/null +++ b/node_modules/parse-asn1/certificate.js @@ -0,0 +1,88 @@ +// from https://github.com/Rantanen/node-dtls/blob/25a7dc861bda38cfeac93a723500eea4f0ac2e86/Certificate.js +// thanks to @Rantanen + +'use strict' + +var asn = require('asn1.js') + +var Time = asn.define('Time', function () { + this.choice({ + utcTime: this.utctime(), + generalTime: this.gentime() + }) +}) + +var AttributeTypeValue = asn.define('AttributeTypeValue', function () { + this.seq().obj( + this.key('type').objid(), + this.key('value').any() + ) +}) + +var AlgorithmIdentifier = asn.define('AlgorithmIdentifier', function () { + this.seq().obj( + this.key('algorithm').objid(), + this.key('parameters').optional() + ) +}) + +var SubjectPublicKeyInfo = asn.define('SubjectPublicKeyInfo', function () { + this.seq().obj( + this.key('algorithm').use(AlgorithmIdentifier), + this.key('subjectPublicKey').bitstr() + ) +}) + +var RelativeDistinguishedName = asn.define('RelativeDistinguishedName', function () { + this.setof(AttributeTypeValue) +}) + +var RDNSequence = asn.define('RDNSequence', function () { + this.seqof(RelativeDistinguishedName) +}) + +var Name = asn.define('Name', function () { + this.choice({ + rdnSequence: this.use(RDNSequence) + }) +}) + +var Validity = asn.define('Validity', function () { + this.seq().obj( + this.key('notBefore').use(Time), + this.key('notAfter').use(Time) + ) +}) + +var Extension = asn.define('Extension', function () { + this.seq().obj( + this.key('extnID').objid(), + this.key('critical').bool().def(false), + this.key('extnValue').octstr() + ) +}) + +var TBSCertificate = asn.define('TBSCertificate', function () { + this.seq().obj( + this.key('version').explicit(0).int(), + this.key('serialNumber').int(), + this.key('signature').use(AlgorithmIdentifier), + this.key('issuer').use(Name), + this.key('validity').use(Validity), + this.key('subject').use(Name), + this.key('subjectPublicKeyInfo').use(SubjectPublicKeyInfo), + this.key('issuerUniqueID').implicit(1).bitstr().optional(), + this.key('subjectUniqueID').implicit(2).bitstr().optional(), + this.key('extensions').explicit(3).seqof(Extension).optional() + ) +}) + +var X509Certificate = asn.define('X509Certificate', function () { + this.seq().obj( + this.key('tbsCertificate').use(TBSCertificate), + this.key('signatureAlgorithm').use(AlgorithmIdentifier), + this.key('signatureValue').bitstr() + ) +}) + +module.exports = X509Certificate diff --git a/node_modules/parse-asn1/fixProc.js b/node_modules/parse-asn1/fixProc.js new file mode 100644 index 000000000..b50042ab0 --- /dev/null +++ b/node_modules/parse-asn1/fixProc.js @@ -0,0 +1,30 @@ +// adapted from https://github.com/apatil/pemstrip +var findProc = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m +var startRegex = /^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----/m +var fullRegex = /^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m +var evp = require('evp_bytestokey') +var ciphers = require('browserify-aes') +module.exports = function (okey, password) { + var key = okey.toString() + var match = key.match(findProc) + var decrypted + if (!match) { + var match2 = key.match(fullRegex) + decrypted = new Buffer(match2[2].replace(/[\r\n]/g, ''), 'base64') + } else { + var suite = 'aes' + match[1] + var iv = new Buffer(match[2], 'hex') + var cipherText = new Buffer(match[3].replace(/[\r\n]/g, ''), 'base64') + var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key + var out = [] + var cipher = ciphers.createDecipheriv(suite, cipherKey, iv) + out.push(cipher.update(cipherText)) + out.push(cipher.final()) + decrypted = Buffer.concat(out) + } + var tag = key.match(startRegex)[1] + return { + tag: tag, + data: decrypted + } +} diff --git a/node_modules/parse-asn1/index.js b/node_modules/parse-asn1/index.js new file mode 100644 index 000000000..14932dfc0 --- /dev/null +++ b/node_modules/parse-asn1/index.js @@ -0,0 +1,106 @@ +var asn1 = require('./asn1') +var aesid = require('./aesid.json') +var fixProc = require('./fixProc') +var ciphers = require('browserify-aes') +var compat = require('pbkdf2') +module.exports = parseKeys + +function parseKeys (buffer) { + var password + if (typeof buffer === 'object' && !Buffer.isBuffer(buffer)) { + password = buffer.passphrase + buffer = buffer.key + } + if (typeof buffer === 'string') { + buffer = new Buffer(buffer) + } + + var stripped = fixProc(buffer, password) + + var type = stripped.tag + var data = stripped.data + var subtype, ndata + switch (type) { + case 'CERTIFICATE': + ndata = asn1.certificate.decode(data, 'der').tbsCertificate.subjectPublicKeyInfo + // falls through + case 'PUBLIC KEY': + if (!ndata) { + ndata = asn1.PublicKey.decode(data, 'der') + } + subtype = ndata.algorithm.algorithm.join('.') + switch (subtype) { + case '1.2.840.113549.1.1.1': + return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, 'der') + case '1.2.840.10045.2.1': + ndata.subjectPrivateKey = ndata.subjectPublicKey + return { + type: 'ec', + data: ndata + } + case '1.2.840.10040.4.1': + ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, 'der') + return { + type: 'dsa', + data: ndata.algorithm.params + } + default: throw new Error('unknown key id ' + subtype) + } + throw new Error('unknown key type ' + type) + case 'ENCRYPTED PRIVATE KEY': + data = asn1.EncryptedPrivateKey.decode(data, 'der') + data = decrypt(data, password) + // falls through + case 'PRIVATE KEY': + ndata = asn1.PrivateKey.decode(data, 'der') + subtype = ndata.algorithm.algorithm.join('.') + switch (subtype) { + case '1.2.840.113549.1.1.1': + return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, 'der') + case '1.2.840.10045.2.1': + return { + curve: ndata.algorithm.curve, + privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, 'der').privateKey + } + case '1.2.840.10040.4.1': + ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, 'der') + return { + type: 'dsa', + params: ndata.algorithm.params + } + default: throw new Error('unknown key id ' + subtype) + } + throw new Error('unknown key type ' + type) + case 'RSA PUBLIC KEY': + return asn1.RSAPublicKey.decode(data, 'der') + case 'RSA PRIVATE KEY': + return asn1.RSAPrivateKey.decode(data, 'der') + case 'DSA PRIVATE KEY': + return { + type: 'dsa', + params: asn1.DSAPrivateKey.decode(data, 'der') + } + case 'EC PRIVATE KEY': + data = asn1.ECPrivateKey.decode(data, 'der') + return { + curve: data.parameters.value, + privateKey: data.privateKey + } + default: throw new Error('unknown key type ' + type) + } +} +parseKeys.signature = asn1.signature +function decrypt (data, password) { + var salt = data.algorithm.decrypt.kde.kdeparams.salt + var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10) + var algo = aesid[data.algorithm.decrypt.cipher.algo.join('.')] + var iv = data.algorithm.decrypt.cipher.iv + var cipherText = data.subjectPrivateKey + var keylen = parseInt(algo.split('-')[1], 10) / 8 + var key = compat.pbkdf2Sync(password, salt, iters, keylen) + var cipher = ciphers.createDecipheriv(algo, key, iv) + var out = [] + out.push(cipher.update(cipherText)) + out.push(cipher.final()) + return Buffer.concat(out) +} diff --git a/node_modules/parse-asn1/package-lock.json.1909017369 b/node_modules/parse-asn1/package-lock.json.1909017369 new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/parse-asn1/package.json b/node_modules/parse-asn1/package.json new file mode 100644 index 000000000..d57f07d4b --- /dev/null +++ b/node_modules/parse-asn1/package.json @@ -0,0 +1,58 @@ +{ + "_from": "parse-asn1@^5.0.0", + "_id": "parse-asn1@5.1.1", + "_inBundle": false, + "_integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", + "_location": "/parse-asn1", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "parse-asn1@^5.0.0", + "name": "parse-asn1", + "escapedName": "parse-asn1", + "rawSpec": "^5.0.0", + "saveSpec": null, + "fetchSpec": "^5.0.0" + }, + "_requiredBy": [ + "/browserify-sign", + "/public-encrypt" + ], + "_resolved": "http://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", + "_shasum": "f6bf293818332bd0dab54efb16087724745e6ca8", + "_spec": "parse-asn1@^5.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify-sign", + "author": "", + "bugs": { + "url": "https://github.com/crypto-browserify/parse-asn1/issues" + }, + "bundleDependencies": false, + "dependencies": { + "asn1.js": "^4.0.0", + "browserify-aes": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3" + }, + "deprecated": false, + "description": "utility library for parsing asn1 files for use with browserify-sign.", + "devDependencies": { + "standard": "^5.0.0", + "tape": "^3.4.0" + }, + "homepage": "https://github.com/crypto-browserify/parse-asn1#readme", + "license": "ISC", + "main": "index.js", + "name": "parse-asn1", + "repository": { + "type": "git", + "url": "git://github.com/crypto-browserify/parse-asn1.git" + }, + "scripts": { + "standard": "standard", + "test": "npm run standard && npm run unit", + "unit": "node ./test" + }, + "version": "5.1.1" +} diff --git a/node_modules/parse-asn1/test/1024.priv b/node_modules/parse-asn1/test/1024.priv new file mode 100644 index 000000000..720621692 --- /dev/null +++ b/node_modules/parse-asn1/test/1024.priv @@ -0,0 +1,16 @@ +-----BEGIN PRIVATE KEY----- +MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAKulUTZ8B1qccZ8c +DXRGSY08gW8KvLlcxxxGC4gZHNT3CBUF8n5R4KE30aZyYZ/rtsQZu05juZJxaJ0q +mbe75dlQ5d+Xc9BMXeQg/MpTZw5TAN7OIdGYYpFBe+1PLZ6wEfjkYrMqMUcfq2Lq +hTLdAbvBJnuRcYZLqmBeOQ8FTrKrAgMBAAECgYEAnkHRbEPU3/WISSQrP36iyCb2 +S/SBZwKkzmvCrBxDWhPeDswp9c/2JY76rNWfLzy8iXgUG8WUzvHje61Qh3gmBcKe +bUaTGl4Vy8Ha1YBADo5RfRrdm0FE4tvgvu/TkqFqpBBZweu54285hk5zlG7n/D7Y +dnNXUpu5MlNb5x3gW0kCQQDUL//cwcXUxY/evaJP4jSe+ZwEQZo+zXRLiPUulBoV +aw28CVMuxdgwqAo1X1IKefPeUaf7RQu8gCKaRnpGuEuXAkEAzxZTfMmvmCUDIew4 +5Gk6bK265XQWdhcgiq254lpBGOYmDj9yCE7yA+zmASQwMsXTdQOi1hOCEyrXuSJ5 +c++EDQJAFh3WrnzoEPByuYXMmET8tSFRWMQ5vpgNqh3haHR5b4gUC2hxaiunCBNL +1RpVY9AoUiDywGcG/SPh93CnKB3niwJBAKP7AtsifZgVXtiizB4aMThTjVYaSZrz +D0Kg9DuHylpkDChmFu77TGrNUQgAVuYtfhb/bRblVa/F0hJ4eQHT3JUCQBVT68tb +OgRUk0aP9tC3021VN82X6+klowSQN8oBPX8+TfDWSUilp/+j24Hky+Z29Do7yR/R +qutnL92CvBlVLV4= +-----END PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/1024.pub b/node_modules/parse-asn1/test/1024.pub new file mode 100644 index 000000000..2dba785d6 --- /dev/null +++ b/node_modules/parse-asn1/test/1024.pub @@ -0,0 +1,6 @@ +-----BEGIN PUBLIC KEY----- +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrpVE2fAdanHGfHA10RkmNPIFv +Cry5XMccRguIGRzU9wgVBfJ+UeChN9GmcmGf67bEGbtOY7mScWidKpm3u+XZUOXf +l3PQTF3kIPzKU2cOUwDeziHRmGKRQXvtTy2esBH45GKzKjFHH6ti6oUy3QG7wSZ7 +kXGGS6pgXjkPBU6yqwIDAQAB +-----END PUBLIC KEY----- diff --git a/node_modules/parse-asn1/test/dsa.1024.priv b/node_modules/parse-asn1/test/dsa.1024.priv new file mode 100644 index 000000000..1145b7d70 --- /dev/null +++ b/node_modules/parse-asn1/test/dsa.1024.priv @@ -0,0 +1,18 @@ +-----BEGIN DSA PARAMETERS----- +MIIBHgKBgQDdFg3WQmpOZxObxraIe4rrbUhrBw99fbnz99IvLj60sM/7Uk7eHYvp +UrPaJBIcjPy68BjV4ekDljuPpFoAorsLzyvVSHuNvN6I/bRGm1TCOjDFVe98Oz6k +XmI6pRfIF0TiIPXkel/sWIfBYa1lqdoW82h9FIjhbxVHrKGfvMEc9wIVAOzmJHec +s6yBm+nE3+OmpWFYj0ylAoGAYxO6mFSoIY7PDRyRzKJEnULSzYXd3FoMkPwDCd5I +ch/piIoAUIIQ542TL54GT9wuiCL+0D48qi9GWKasPZABfPQ008WOzmKzD8ncrUTd +a7pzvUvdmwldA4Aa5/5xSXwtpK+DDye7KPlu+oi1BF6uj4TgfeGr1uxouxC2WhBE +qH0= +-----END DSA PARAMETERS----- +-----BEGIN PRIVATE KEY----- +MIIBSwIBADCCASwGByqGSM44BAEwggEfAoGBAOY0KsTt5EpJ4LtlD3xRS5mDiGE1 +CMNp0S9X0sK8kP8Aps8iYwMLbZYglk18GCNnCk4SjbAnZHSB3kaIv6AKQc2J8W2Y +V5se3VhpKOFst7bqRtkGsl8uJtGlKTiXNclkv2jsKOrsBokSD1USGCECTNeMt3Og +ziRcZ1dS+djSOZ2nAhUAzB96SpxlAak+K/QLVJ+lDe5DcY0CgYEAtxX1/Hckvhlh +HQyKZWLQsDfZBILbhc+OLDpOyT6cJS/sJzfFIYZgK5M3rOS4OmzdYfJccQAuGq+T +VJQ3VcYOdbrIANJV8CDrn4jkkejTzJI6fCwAkPWOyxw8kbV1Hsoy6WLfSCHKpBUc +rogAqRGESqBVTawjyF/ECX667y/P49MEFgIUSeRVRgAXsLmeWR/V4Rh9Hex+9+s= +-----END PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/dsa.1024.pub b/node_modules/parse-asn1/test/dsa.1024.pub new file mode 100644 index 000000000..80a731ea3 --- /dev/null +++ b/node_modules/parse-asn1/test/dsa.1024.pub @@ -0,0 +1,12 @@ +-----BEGIN PUBLIC KEY----- +MIIBtzCCASwGByqGSM44BAEwggEfAoGBAOY0KsTt5EpJ4LtlD3xRS5mDiGE1CMNp +0S9X0sK8kP8Aps8iYwMLbZYglk18GCNnCk4SjbAnZHSB3kaIv6AKQc2J8W2YV5se +3VhpKOFst7bqRtkGsl8uJtGlKTiXNclkv2jsKOrsBokSD1USGCECTNeMt3OgziRc +Z1dS+djSOZ2nAhUAzB96SpxlAak+K/QLVJ+lDe5DcY0CgYEAtxX1/HckvhlhHQyK +ZWLQsDfZBILbhc+OLDpOyT6cJS/sJzfFIYZgK5M3rOS4OmzdYfJccQAuGq+TVJQ3 +VcYOdbrIANJV8CDrn4jkkejTzJI6fCwAkPWOyxw8kbV1Hsoy6WLfSCHKpBUcrogA +qRGESqBVTawjyF/ECX667y/P49MDgYQAAoGAXYmxO4+52C1gBzh7GgTwNLJl7bLn +gOhKTFlKhT36VjMjeFfdXmBVBVbfUottKZby/gVX1IXT38PStB/dswbF45bGDdoS +zMFjYmHTtLtrU/4hReVtvb5MYmrPDFX58SwcSRRO/cH6WJPvfu4Aq0cJZA9Kb0B9 +5Wo18JxAqvPtTB8= +-----END PUBLIC KEY----- diff --git a/node_modules/parse-asn1/test/dsa.2048.priv b/node_modules/parse-asn1/test/dsa.2048.priv new file mode 100644 index 000000000..2a77c2ee7 --- /dev/null +++ b/node_modules/parse-asn1/test/dsa.2048.priv @@ -0,0 +1,20 @@ +-----BEGIN DSA PRIVATE KEY----- +MIIDVQIBAAKCAQEA0jDs9lLWX//NXYE1kNKw4UiDVMHHEtTF1OzJvBJvUh3/xMlU +ic8mUpIMU5mt7BTjcijyLLl/TeNBcI/xDvWH3PAfCjP1CmNzOMHwU6wKA4Q20m5v +zjauVycd7loRm5h+1XyD2JL1KmQTzhIIRAmRTeXMnr8LAHidYfUKmzCOCCrnctlE +EOh1S6e7BFxQBRrlUxZF0LTjcAz31rrjIH6wKkYR4mnpGuI2vVJ+qHGmEhvq1hAb +DvP0GN0iofxHlIVqOlfXYCZO388ZabfcBOQG57tTofm8aS4pnXCgbok9wEYPgbU5 +n6fEvDGOOObQyY109hZZaDJmfygr5mmD0TIXrQIhAMVBhV4liqAN2MrT/+ZUH6hY ++DhTazzSNLIZKQ5gfd+1AoIBADqHGUVQa9pbwyjbzooeWdijUM9W5P7UUj1OjrA0 +HIkcx37qHiYOVFqHpbjDs3tbgRBxBX5zBpwuhywC/6OetDiqzDy7zZCV/YMn06d2 +ncW2Ctjp3KPl7of39+HgXXePgTdKcfkjH9upJQTko88rA4NWwZbHYeA3Lv7DcA11 +XY3+TQHcxMtxf/E6aePjANJBsJsQjYLy3WyUiS87jkgi0Bigjg/cD3Nel4LToCTR +JvQ4m3w3T4W0xL1+8nPjRZ2q0GgmxZzPfwALrwiSYMgGZC/ov43wqOs6WXs0NnpJ +moU4oxutC/uDvTZmJvRj77FINjK0ZA20jmNvWmTIeEm1Xn4CggEABeRpOymQS5IS +X+u9ya7C+P3MPIRGm4dcWPWgPpD1QcclNYLGnhRp7JazNsbbPMjnx1qtF+2qjfy9 +JDeWTAR8qfCNVmQHPAhJsJtV0C/V4PUii71FRNPVC3EAYbcBk8deMGoUg99cxSac +6MCxIIOxuUKWpw8XPlMVpuXc8+lIMTYCPeLGinmT4DQ573t0MS6U3Ck/987xjkH9 +sos7zcYn3vnjywDCxXMidC0eUK1rxAAuY7PL4vQiKwXq8kFtWiKAnns/Zm5LTjiZ +NrwlhNlU2wQVvyIcKaGfSRPheb69IbP+9qp5b7Xe7DNWdo48S0jl2KAFeZ91BnhM +TH6WPtMpjQIgOaTTn6xYK0kZvvH3lZXrzkjp4aNlNY65R0JAKKNsx3s= +-----END DSA PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/dsa.2048.pub b/node_modules/parse-asn1/test/dsa.2048.pub new file mode 100644 index 000000000..9f6cac1cc --- /dev/null +++ b/node_modules/parse-asn1/test/dsa.2048.pub @@ -0,0 +1,20 @@ +-----BEGIN PUBLIC KEY----- +MIIDRjCCAjkGByqGSM44BAEwggIsAoIBAQDSMOz2UtZf/81dgTWQ0rDhSINUwccS +1MXU7Mm8Em9SHf/EyVSJzyZSkgxTma3sFONyKPIsuX9N40Fwj/EO9Yfc8B8KM/UK +Y3M4wfBTrAoDhDbSbm/ONq5XJx3uWhGbmH7VfIPYkvUqZBPOEghECZFN5cyevwsA +eJ1h9QqbMI4IKudy2UQQ6HVLp7sEXFAFGuVTFkXQtONwDPfWuuMgfrAqRhHiaeka +4ja9Un6ocaYSG+rWEBsO8/QY3SKh/EeUhWo6V9dgJk7fzxlpt9wE5Abnu1Oh+bxp +LimdcKBuiT3ARg+BtTmfp8S8MY445tDJjXT2FlloMmZ/KCvmaYPRMhetAiEAxUGF +XiWKoA3YytP/5lQfqFj4OFNrPNI0shkpDmB937UCggEAOocZRVBr2lvDKNvOih5Z +2KNQz1bk/tRSPU6OsDQciRzHfuoeJg5UWoeluMOze1uBEHEFfnMGnC6HLAL/o560 +OKrMPLvNkJX9gyfTp3adxbYK2Onco+Xuh/f34eBdd4+BN0px+SMf26klBOSjzysD +g1bBlsdh4Dcu/sNwDXVdjf5NAdzEy3F/8Tpp4+MA0kGwmxCNgvLdbJSJLzuOSCLQ +GKCOD9wPc16XgtOgJNEm9DibfDdPhbTEvX7yc+NFnarQaCbFnM9/AAuvCJJgyAZk +L+i/jfCo6zpZezQ2ekmahTijG60L+4O9NmYm9GPvsUg2MrRkDbSOY29aZMh4SbVe +fgOCAQUAAoIBAAXkaTspkEuSEl/rvcmuwvj9zDyERpuHXFj1oD6Q9UHHJTWCxp4U +aeyWszbG2zzI58darRftqo38vSQ3lkwEfKnwjVZkBzwISbCbVdAv1eD1Iou9RUTT +1QtxAGG3AZPHXjBqFIPfXMUmnOjAsSCDsblClqcPFz5TFabl3PPpSDE2Aj3ixop5 +k+A0Oe97dDEulNwpP/fO8Y5B/bKLO83GJ97548sAwsVzInQtHlCta8QALmOzy+L0 +IisF6vJBbVoigJ57P2ZuS044mTa8JYTZVNsEFb8iHCmhn0kT4Xm+vSGz/vaqeW+1 +3uwzVnaOPEtI5digBXmfdQZ4TEx+lj7TKY0= +-----END PUBLIC KEY----- diff --git a/node_modules/parse-asn1/test/ec.pass.priv b/node_modules/parse-asn1/test/ec.pass.priv new file mode 100644 index 000000000..bf1836d55 --- /dev/null +++ b/node_modules/parse-asn1/test/ec.pass.priv @@ -0,0 +1,7 @@ +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIHeMEkGCSqGSIb3DQEFDTA8MBsGCSqGSIb3DQEFDDAOBAi9LqZQx4JFXAICCAAw +HQYJYIZIAWUDBAECBBA+js1fG4Rv/yRN7oZvxbgyBIGQ/D4yj86M1x8lMsnAHQ/K +7/ryb/baDNHqN9LTZanEGBuyxgrTzt08SiL+h91yFGMoaly029K1VgEI8Lxu5Np/ +A+LK7ewh73ABzsbuxYdcXI+rKnrvLN9Tt6veDs4GlqTTsWwq5wF0C+6gaYRBXA74 +T1b6NykGh2UNL5U5pHZEYdOVLz+lRJL7gYqlweNHP/S3 +-----END ENCRYPTED PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/ec.priv b/node_modules/parse-asn1/test/ec.priv new file mode 100644 index 000000000..25fffbd87 --- /dev/null +++ b/node_modules/parse-asn1/test/ec.priv @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MHQCAQEEIDF6Xv8Sv//wGUWD+c780ppGrU0QdZWCAzxAQPQX8r/uoAcGBSuBBAAK +oUQDQgAEIZeowDylls4K/wfBjO18bYo7gGx8nYQRija4e/qEMikOHJai7geeUreU +r5Xky/Ax7s2dGtegsPNsPgGe5MpQvg== +-----END EC PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/ec.pub b/node_modules/parse-asn1/test/ec.pub new file mode 100644 index 000000000..2e39e5bb6 --- /dev/null +++ b/node_modules/parse-asn1/test/ec.pub @@ -0,0 +1,4 @@ +-----BEGIN PUBLIC KEY----- +MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEIZeowDylls4K/wfBjO18bYo7gGx8nYQR +ija4e/qEMikOHJai7geeUreUr5Xky/Ax7s2dGtegsPNsPgGe5MpQvg== +-----END PUBLIC KEY----- diff --git a/node_modules/parse-asn1/test/index.js b/node_modules/parse-asn1/test/index.js new file mode 100644 index 000000000..85cb0ab4b --- /dev/null +++ b/node_modules/parse-asn1/test/index.js @@ -0,0 +1,138 @@ +var test = require('tape') +var fs = require('fs') +var parseKey = require('../') +var rsa1024 = { + private: fs.readFileSync(__dirname + '/rsa.1024.priv'), + public: fs.readFileSync(__dirname + '/rsa.1024.pub') +} +var rsa2028 = { + private: fs.readFileSync(__dirname + '/rsa.2028.priv'), + public: fs.readFileSync(__dirname + '/rsa.2028.pub') +} +var nonrsa1024 = { + private: fs.readFileSync(__dirname + '/1024.priv'), + public: fs.readFileSync(__dirname + '/1024.pub') +} +var pass1024 = { + private: { + passphrase: 'fooo', + key: fs.readFileSync(__dirname + '/pass.1024.priv') + }, + public: fs.readFileSync(__dirname + '/pass.1024.pub') +} +var ec = { + private: fs.readFileSync(__dirname + '/ec.priv'), + public: fs.readFileSync(__dirname + '/ec.pub') +} +var ecpass = { + private: { + key: fs.readFileSync(__dirname + '/ec.pass.priv'), + passphrase: 'bard' + }, + public: fs.readFileSync(__dirname + '/ec.pub') +} +var dsa = { + private: fs.readFileSync(__dirname + '/dsa.1024.priv'), + public: fs.readFileSync(__dirname + '/dsa.1024.pub') +} +var dsa2 = { + private: fs.readFileSync(__dirname + '/dsa.2048.priv'), + public: fs.readFileSync(__dirname + '/dsa.2048.pub') +} +var dsapass = { + private: { + key: fs.readFileSync(__dirname + '/pass.dsa.1024.priv'), + passphrase: 'password' + }, + public: fs.readFileSync(__dirname + '/pass.dsa.1024.pub') +} +var dsapass2 = { + private: { + key: fs.readFileSync(__dirname + '/pass2.dsa.1024.priv'), + passphrase: 'password' + }, + public: fs.readFileSync(__dirname + '/pass2.dsa.1024.pub') +} +var rsapass = { + private: { + key: fs.readFileSync(__dirname + '/pass.rsa.1024.priv'), + passphrase: 'password' + }, + public: fs.readFileSync(__dirname + '/pass.rsa.1024.pub') +} +var rsapass2 = { + private: { + key: fs.readFileSync(__dirname + '/pass.rsa.2028.priv'), + passphrase: 'password' + }, + public: fs.readFileSync(__dirname + '/pass.rsa.2028.pub') +} +var cert = { + private: fs.readFileSync(__dirname + '/rsa.1024.priv'), + public: fs.readFileSync(__dirname + '/node.cert') +} +var i = 0 +function testIt (keys) { + test('key ' + (++i), function (t) { + t.plan(2) + t.ok(parseKey(keys.public), 'public key') + t.ok(parseKey(keys.private), 'private key') + }) +} + +function testEOL (keys) { + var publicKey = keys.public.toString() + var newLineRegex = /\r?\n/g + var genPrivate = function (replace) { + if (keys.private.key) { + return { key: keys.private.key.toString().replace(newLineRegex, replace), passphrase: keys.private.passphrase } + } else { + return keys.private.toString().replace(newLineRegex, replace) + } + } + var testN = { + private: genPrivate('\n'), + public: publicKey.replace(newLineRegex, '\n') + } + testIt(testN) + var testR = { + private: genPrivate('\r'), + public: publicKey.replace(newLineRegex, '\r') + } + testIt(testR) + var testRN = { + private: genPrivate('\r\n'), + public: publicKey.replace(newLineRegex, '\r\n') + } + testIt(testRN) +} + +testIt(dsa) +testIt(dsa2) +testIt(rsa1024) +testIt(ec) +testIt(rsa2028) +testIt(nonrsa1024) +testIt(ecpass) +testIt(dsapass) +testIt(dsapass2) +testIt(rsapass) +testIt(rsapass2) +testIt(pass1024) +testIt(pass1024) +testIt(cert) + +testEOL(dsa) +testEOL(dsa2) +testEOL(rsa1024) +testEOL(ec) +testEOL(rsa2028) +testEOL(nonrsa1024) +testEOL(ecpass) +testEOL(dsapass) +testEOL(dsapass2) +testEOL(rsapass) +testEOL(rsapass2) +testEOL(pass1024) +testEOL(pass1024) +testEOL(cert) diff --git a/node_modules/parse-asn1/test/node.cert b/node_modules/parse-asn1/test/node.cert new file mode 100644 index 000000000..a3c1e4a0a --- /dev/null +++ b/node_modules/parse-asn1/test/node.cert @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDXDCCAsWgAwIBAgIJAKL0UG+mRkSPMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNV +BAYTAlVLMRQwEgYDVQQIEwtBY2tuYWNrIEx0ZDETMBEGA1UEBxMKUmh5cyBKb25l +czEQMA4GA1UEChMHbm9kZS5qczEdMBsGA1UECxMUVGVzdCBUTFMgQ2VydGlmaWNh +dGUxEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0wOTExMTEwOTUyMjJaFw0yOTExMDYw +OTUyMjJaMH0xCzAJBgNVBAYTAlVLMRQwEgYDVQQIEwtBY2tuYWNrIEx0ZDETMBEG +A1UEBxMKUmh5cyBKb25lczEQMA4GA1UEChMHbm9kZS5qczEdMBsGA1UECxMUVGVz +dCBUTFMgQ2VydGlmaWNhdGUxEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG +9w0BAQEFAAOBjQAwgYkCgYEA8d8Hc6atq78Jt1HLp9agA/wpQfsFvkYUdZ1YsdvO +kL2janjwHQgMMCy/Njal3FUEW0OLPebKZUJ8L44JBXSlVxU4zyiiSOWld8EkTetR +AVT3WKQq3ud+cnxv7g8rGRQp1UHZwmdbZ1wEfAYq8QjYx6m1ciMgRo7DaDQhD29k +d+UCAwEAAaOB4zCB4DAdBgNVHQ4EFgQUL9miTJn+HKNuTmx/oMWlZP9cd4QwgbAG +A1UdIwSBqDCBpYAUL9miTJn+HKNuTmx/oMWlZP9cd4ShgYGkfzB9MQswCQYDVQQG +EwJVSzEUMBIGA1UECBMLQWNrbmFjayBMdGQxEzARBgNVBAcTClJoeXMgSm9uZXMx +EDAOBgNVBAoTB25vZGUuanMxHTAbBgNVBAsTFFRlc3QgVExTIENlcnRpZmljYXRl +MRIwEAYDVQQDEwlsb2NhbGhvc3SCCQCi9FBvpkZEjzAMBgNVHRMEBTADAQH/MA0G +CSqGSIb3DQEBBQUAA4GBADRXXA2xSUK5W1i3oLYWW6NEDVWkTQ9RveplyeS9MOkP +e7yPcpz0+O0ZDDrxR9chAiZ7fmdBBX1Tr+pIuCrG/Ud49SBqeS5aMJGVwiSd7o1n +dhU2Sz3Q60DwJEL1VenQHiVYlWWtqXBThe9ggqRPnCfsCRTP8qifKkjk45zWPcpN +-----END CERTIFICATE----- diff --git a/node_modules/parse-asn1/test/pass.1024.priv b/node_modules/parse-asn1/test/pass.1024.priv new file mode 100644 index 000000000..b9f388450 --- /dev/null +++ b/node_modules/parse-asn1/test/pass.1024.priv @@ -0,0 +1,18 @@ +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIICzzBJBgkqhkiG9w0BBQ0wPDAbBgkqhkiG9w0BBQwwDgQIji3ZZ6JbsA4CAggA +MB0GCWCGSAFlAwQBFgQQC6MKblq8zyX90/KmgotsMQSCAoDghNf+yxPC/KRh7F3O +k0lMgtDkV+wCLDv7aBvUqy8Ry2zqFPIlfLb8XtSW943XEu6KUI13IZPEr8p9h1ve +Iye6L0g6uAgbFxBE2DwBBSI7mYr7lokr4v0k+inMKf4JeRdI9XWgwOILKTGf1vH7 +PhvBnqLhOg6BIOuF426qpiyYlmRda74d0Th4o6ZyhyMSzPI1XbWSg719Ew3N/tLe +OHdYl0eFrgNjq+xO4Ev+W7eNIh/XBMQtk9wo+mxeNdldRnX822HxTsL8fSSPs+9T +W5M/2EBTJMSsswSjZyFkq8ehtxovI2u0IBX1IiPulyUZLnSNPDV1eUVClK6rk+q1 +kVsfJhUr2qvIjNlQWlbEXQj4VwGtgl0++l8vdpj59MuN2J3Nx5TNMLjA6BYAa/tr +Bu928QoT7ET+SGx5XKCwKb5fwXmDlV5zZC4kZWTaF/d/Icvj5F+fDZuYFg1JOXNZ ++q2oA1qMYaHGX6lF3pbO84ebg1iwQTDM8iIqFeSMGUJTnk/3a7sqfaWQbEQwGb+X +fXnSTwkF+wO2rriPbFvWyzecWu67zDCP0ZWUgGb86sSJCM7xRGShESwCjOrb88F1 +5SZjyIqogrkc3IWiLH9gc5U8d86qoFjJnP6BfwYks1UIyXNGKfZTCqICpMphV+IS +b0N2jprjLTkWR6nxYGSH1bkKMs7x1M0FBLWWLAZqPn9X3pe6JwIBds04O6XjF0un +oxwDjcJdoxVs7PgRiM5d1Tubqu2zmpCCmXNiqi9B0+rV9/jHg9IA5gUfvYdCcEv+ +oAr90I+2+PuBFa9lgdbDV6DtZk4bSYluqamxVeLPg/vrewYfVfDv6jftfY1D0DEy +69H0 +-----END ENCRYPTED PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/pass.1024.pub b/node_modules/parse-asn1/test/pass.1024.pub new file mode 100644 index 000000000..617e7fb10 --- /dev/null +++ b/node_modules/parse-asn1/test/pass.1024.pub @@ -0,0 +1,6 @@ +-----BEGIN PUBLIC KEY----- +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDSK/7i5BV0x+gmX16Wrm7kRkCZ +y1QUt6wiM2g+SAZTYR0381VnSMX2cv7CpN3499lZj1rL5S7YTaZZwX3RvU5fz56/ +eDX6ciL/PZsbclN2KdkMWYgmcb9J1zUeoMQ3cjfFUCdQZ/ZvDWa+wY2Zg8os2Bow +AoufHtYHm3eOly/cWwIDAQAB +-----END PUBLIC KEY----- diff --git a/node_modules/parse-asn1/test/pass.dsa.1024.priv b/node_modules/parse-asn1/test/pass.dsa.1024.priv new file mode 100644 index 000000000..aab5fc2f1 --- /dev/null +++ b/node_modules/parse-asn1/test/pass.dsa.1024.priv @@ -0,0 +1,11 @@ +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIIBnzBJBgkqhkiG9w0BBQ0wPDAbBgkqhkiG9w0BBQwwDgQI1z4IJORFws4CAggA +MB0GCWCGSAFlAwQBAgQQq7f0CuKCTITfPS5Xax1H4wSCAVDFyIjYVXfBNe+BARqz +Tfo09y4vKkErOb7Sz4bQkAjRLjOXiUjM4eTNtivml8NqVrQTKAghN+ggxj416OD4 +oq6Ns7Ncbd4Xm5Ni8wrrWbJxVog6rAa/ioU0sfgRExYy/xE2Q9KkW+VE7SUwanwY +e81Od9qNM5KhZGM1yUSKa0JA6Xqb8dAqBo9rVt8DceumB9OP83xV3fLEimSZfR6p +slA1P/dTvKxwhpguQe4Z3OkzTzGCxyboqeRW1woNHKbxjzzSHcaki9SHQm3xpUW8 +hRAJd6OtDnLbkE9MnC+UcI3mjru1xfnR5MU7qG7e9nvOhEDVaDkiK3DbrSf0B0Bi +p1hyX1XsSXDewSEd/mlfMLdD8WecgUtl9ea7JzxY3/6R78yB951I5TmY45mp/v+N +tbxEv29B65UKf0ac7gVw4LNy8JF2ef/L/meEmBoIAE71f+8= +-----END ENCRYPTED PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/pass.dsa.1024.pub b/node_modules/parse-asn1/test/pass.dsa.1024.pub new file mode 100644 index 000000000..80a731ea3 --- /dev/null +++ b/node_modules/parse-asn1/test/pass.dsa.1024.pub @@ -0,0 +1,12 @@ +-----BEGIN PUBLIC KEY----- +MIIBtzCCASwGByqGSM44BAEwggEfAoGBAOY0KsTt5EpJ4LtlD3xRS5mDiGE1CMNp +0S9X0sK8kP8Aps8iYwMLbZYglk18GCNnCk4SjbAnZHSB3kaIv6AKQc2J8W2YV5se +3VhpKOFst7bqRtkGsl8uJtGlKTiXNclkv2jsKOrsBokSD1USGCECTNeMt3OgziRc +Z1dS+djSOZ2nAhUAzB96SpxlAak+K/QLVJ+lDe5DcY0CgYEAtxX1/HckvhlhHQyK +ZWLQsDfZBILbhc+OLDpOyT6cJS/sJzfFIYZgK5M3rOS4OmzdYfJccQAuGq+TVJQ3 +VcYOdbrIANJV8CDrn4jkkejTzJI6fCwAkPWOyxw8kbV1Hsoy6WLfSCHKpBUcrogA +qRGESqBVTawjyF/ECX667y/P49MDgYQAAoGAXYmxO4+52C1gBzh7GgTwNLJl7bLn +gOhKTFlKhT36VjMjeFfdXmBVBVbfUottKZby/gVX1IXT38PStB/dswbF45bGDdoS +zMFjYmHTtLtrU/4hReVtvb5MYmrPDFX58SwcSRRO/cH6WJPvfu4Aq0cJZA9Kb0B9 +5Wo18JxAqvPtTB8= +-----END PUBLIC KEY----- diff --git a/node_modules/parse-asn1/test/pass.rsa.1024.priv b/node_modules/parse-asn1/test/pass.rsa.1024.priv new file mode 100644 index 000000000..b67bd8043 --- /dev/null +++ b/node_modules/parse-asn1/test/pass.rsa.1024.priv @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: AES-192-CBC,04D2D7882E0C474E07E542FE997D2A49 + +vfB5Gtm34n3SeI6JELjWiGw6O+j+tGR6Wbi3SNeAZkfSA8PTjei6PVHr+dGK5zMd +nTckd0EpxItqxEdtLK6GtBIa9KRd3cEbayHmyyybH2FC4STXJCUFBe2eb7ZKmnCl +RB5FcmAqExif+QOJwHnZw6DTzq+oGSwi9cSoy2qE62FgXkj8uKAYcBLONmsP1YQA +4zIub4bnEbIghL/swEB/HVS86FyMCsMXrHEOnSuUUBf/UfZFNypI6kVUNXlItnN1 +14eeRsBD37VkL7dAQPMx+Dwm7DbU07QWrVvzgmWlu3KqR0tRNA9e4a5f14XOYxgS +HZ+XVZK8iAd+76OnprlFtGDowDXGM0wUXPYq5j8WpKxNsVs2RV+S6U0gQLoSqNxt +We7UPWZufzEdjTUO8q9KhdGqFmJ53XIYClZf0bp148b+Bk3P+dN5TbmKQEfulScn +rTLTRo34fdTIAJr5BJh0OXGNs9rFlMJ9Nz4FwVTEB1DMerXtt9ICdhud9BktRhvq +axgoz+XA3LrBrlPPcrSCZyIYjZFydGSkzg439OyDEZ6+uRmc0qhWA4j6AgXx6gGR +NvvypoFVKvXqEq/2F+SVyyMGrm4xPmsr/HUBeE9SmuTzNzDfVAM/xerqIoR2szR0 +O0hwtOj4fk7//cd1CjFzd0JiF/SqMkHxkdbmIC9qlhshkWlQbvvhbefodYPuGxmj +L1TaPgX36OcrQSodzyWBN5tSmmX1Nmftcz7iwc4AKrqkdnM3sPS3SczsAjMWrjRr +7iYhdPQSZtxVCTjACU3h7scNAg9AU6l4YZrowR//J6U= +-----END RSA PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/pass.rsa.1024.pub b/node_modules/parse-asn1/test/pass.rsa.1024.pub new file mode 100644 index 000000000..3506c331c --- /dev/null +++ b/node_modules/parse-asn1/test/pass.rsa.1024.pub @@ -0,0 +1,6 @@ +-----BEGIN PUBLIC KEY----- +MIGcMA0GCSqGSIb3DQEBAQUAA4GKADCBhgJ/OwswbFo/uyC8ltGf/yA1A+gV5IGd +nAgPbUSI3GzbHCA+x+TLG/tLvbRw3r1smppY/jkkpiVW1ErSMuN0uixp5gb78Z9r +H1XpWb5WWgp3WaY/9EHMjMdOkQ/9LVZvRvl/M/Fi6owP+q+amJI1BEjECYfbhGL3 +rmlVdq4qXc40QwIDAQAB +-----END PUBLIC KEY----- diff --git a/node_modules/parse-asn1/test/pass.rsa.2028.priv b/node_modules/parse-asn1/test/pass.rsa.2028.priv new file mode 100644 index 000000000..99e821352 --- /dev/null +++ b/node_modules/parse-asn1/test/pass.rsa.2028.priv @@ -0,0 +1,30 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: AES-256-CBC,7A6A055AD675947A657041422F06D439 + +HQdjzAKUuqqKhZHmpzzY/monfqFhiHnZ5c24jtR9fM4aQJXf/e1fz6MEhyIz6XON +sb4CnXZstnxUuVWDkHEu6KWQ/dKALgiDUuT+UdMawVoVPGdgyWZp35pQPWi3fT2V +XZn58YkG8bO3Y403eZPyhadOefD1VtuFuK6/f90jjzx6ZDnwveXpYgFV7Jy1/pFd +cLLMf07C+hbk416nX6UVipWe4GH+ADFom5ZCfAaUotM7n8i149dULNF4YYi2wP31 +1YaDH5vf1CqiaieDY7xLzpEixwJz6ZEg3gLXaUvz2MpF8owiGI3eP0g7voWp3xt4 +TQx/qDURlaXiaRriWdWtpKyW1MFuJ5+KdNtR1/kXr2BLPB/ZLwyqtynUy8ZYpb4+ +WIRYpUGeb//ZHGhlCH7CRMdABsal4wTwnzi9fW4Ax96ecJ2SlwCuKxwS7iEq2y1/ +FAfGwsE+XufHhme5p6XjKfiHx+zJMIB2NMkrm+wm4PbMTrGVnw5/41/r6XxOB8fe +iKi12Jth4dusc1vYGYfzKop9uEM6CZ6+Chqzb+Zyh/xUiZVlCX/BYnxr7yXUm9aR +PHQgxkn2Act8FgQB3Kgs3jCiCRIJrlsnybeWzQ3YO9TjC4MxygmmwODDBpsOKnEi +kXXS54+cZFjcsva4uJVwhAywRPVUkLzmTkH0tGiwCHjeQNECm+TLahkkEIXrVTb9 +c9creNXMgE6jVVz+R43HXsGvTcgMcBLyFRQJe2nVaj/dQ5JbF4uqNnQzRjAbD34K +uTpFaJ/kmlgcmeScRLnwaoYwFlmhSC+bK0dfY1Jr6AQRA6IDP7nIjqWNDCHNBB8r +Qj1v2KWoVQe3xNHaXhkbJPbA2DKlUIqffkBVtMKtt9KuG3Rccf3bVYAW6oid73/D +z7DMAF5G/OpVR8VbGh1WxXuR7zEVDUwpwsp9ek5dqN8BnBz1ppdZNIKqzszneckU +s2l/6mZBmgV1Nfy/cQU6U5s3S1Xc75UDQVLms3CIOpFTRIpecNTdfa31fYy/svy0 +M2lWTbCva0dOyuvMUhTgBL4I7Qa2dUMPXHMZatV5ooHYq/BZJA1r84C5cM5r+umE +2LLv/BlUr7RaQHhaKGn4Qhpzo5yRDE9mEqDpLVkbg8SxMsdf/pEF5/VyUwA9t8RT +fKVsInRd386tDqJSDbSFqKTvLztr/5YCyzZzvC2YB1voko/caOGd2d/G51Ij+bXU +xEN8U4fHDBsHwPUGb31uZUhTXpL37KiOqZmXFoH2usmuvx882XvyGcV0F4tstMaR +KLKzl2PwqzAYGFexLkYKMz0TYIeN6h3b86ETazPPU49nkaEU23Dx21J2Rb3UlH+I +lDQF3wuH1QlYiTnlcVa/Zu4QQg0/iP8ALkZ06mvn9e9mOtnA8gsh4B2oLqc19VLU +bcpv40dV1H3W9Lcx9B8JYUp0c/Oyno1D7Yj3tjGcwMKECmUpHi4kksehVo0/P933 +xmFmC6eyWYVdO9upvY/vKSB7b1dMt85iWr3gnMsSfRYc6jsbSxdjOPST46UsIzjx +wa1DS6+Bv5tiaC4uC6X+0tCAZo+UOQMYUbTGRR/7g/c= +-----END RSA PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/pass.rsa.2028.pub b/node_modules/parse-asn1/test/pass.rsa.2028.pub new file mode 100644 index 000000000..655cc3a4d --- /dev/null +++ b/node_modules/parse-asn1/test/pass.rsa.2028.pub @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBHjANBgkqhkiG9w0BAQEFAAOCAQsAMIIBBgKB/gy7mjaWgPeFdVYDZWRCA9BN +iv3pPb0es27+FKY0hszLaOw47ExCtAWpDsH48TXAfyHBYwBLguayfk4LGIupxb+C +GMbRo3xEp0CbfY1Jby26T9vGjRC1foHDDUJG84uaRbyHqaf4i6zt4gVR+xlAEIjk +aFAAK8cOoXAT1CVqGLLljUCchL8PjaHj/yriZ/S7rdwlI3LnABxwwmLrmR/v71Wt +pmO/aNG8N+1po+QwaghTkyQ59E/ZvAuOkFWHok2q/R6PYAa2jdZ9zim0FqOP+nkQ +aEDRbBFBmBqTv5fFGfk2WsAfKf/RG0/VFd+ZeM5251TeTvXH695nlSGauVl9AgMB +AAE= +-----END PUBLIC KEY----- diff --git a/node_modules/parse-asn1/test/pass2.dsa.1024.priv b/node_modules/parse-asn1/test/pass2.dsa.1024.priv new file mode 100644 index 000000000..29e367344 --- /dev/null +++ b/node_modules/parse-asn1/test/pass2.dsa.1024.priv @@ -0,0 +1,15 @@ +-----BEGIN DSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: AES-128-CBC,DC173C6DFD455EBE462A35D6AB9A603A + +FoC3sxbdUFJTaNtRpooMxaX2lcQRLUz8qcRhzDBn5a1kaMHp2JM3KlHK5aauybT4 +ilmlKJ9sSm8pFLAWPKbkczSgZ+X6p/51v4zaEJSebZ98p32kQk87XJQE7aYroxYV +UfM5PSOoKWilj+LZQQEXV10qDoYGrnbSdoNSxYW5V1a1aP+ua0EO7m9MUYkoLxi3 +SJ/s2h/5KM3TOz7d7DOZuSoNm+0n6YC4aqQnR3lmEtAXEYLQqLhH2Q3FTKTHwBQw +HgMBAzcXOS1YSw6Ekwh1eZamizrOEC4I6oZEHoUBqRfbsQ8tu77kDq2ovQSyn8Fp +SeE64m3GgZOYdfcDuNZ0ccmm3shBBfTfD9AwR+1thklKO3oaaLEHb6TmnkD79rEz +9WsiVxoN7vqqWdgoeyl7REOB6WLQp8kYS4FoRG0QB/ZS8Hs/Tf17QPnrQNiMkvP7 +sJSHmlaMKXjWXK0VoN94kfZKUXwkzLD1VXuXFCnUkznWU0tahYi06b8/SVXc6EG+ +0mzylckH7UnjOQfxSFAlZ+e/PiX80tcPakxYbk+f1Nv7L0NOyhrDv18KUbv9mEpV +Ysild1m7/QSF0u1qmjmGNQ== +-----END DSA PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/pass2.dsa.1024.pub b/node_modules/parse-asn1/test/pass2.dsa.1024.pub new file mode 100644 index 000000000..80a731ea3 --- /dev/null +++ b/node_modules/parse-asn1/test/pass2.dsa.1024.pub @@ -0,0 +1,12 @@ +-----BEGIN PUBLIC KEY----- +MIIBtzCCASwGByqGSM44BAEwggEfAoGBAOY0KsTt5EpJ4LtlD3xRS5mDiGE1CMNp +0S9X0sK8kP8Aps8iYwMLbZYglk18GCNnCk4SjbAnZHSB3kaIv6AKQc2J8W2YV5se +3VhpKOFst7bqRtkGsl8uJtGlKTiXNclkv2jsKOrsBokSD1USGCECTNeMt3OgziRc +Z1dS+djSOZ2nAhUAzB96SpxlAak+K/QLVJ+lDe5DcY0CgYEAtxX1/HckvhlhHQyK +ZWLQsDfZBILbhc+OLDpOyT6cJS/sJzfFIYZgK5M3rOS4OmzdYfJccQAuGq+TVJQ3 +VcYOdbrIANJV8CDrn4jkkejTzJI6fCwAkPWOyxw8kbV1Hsoy6WLfSCHKpBUcrogA +qRGESqBVTawjyF/ECX667y/P49MDgYQAAoGAXYmxO4+52C1gBzh7GgTwNLJl7bLn +gOhKTFlKhT36VjMjeFfdXmBVBVbfUottKZby/gVX1IXT38PStB/dswbF45bGDdoS +zMFjYmHTtLtrU/4hReVtvb5MYmrPDFX58SwcSRRO/cH6WJPvfu4Aq0cJZA9Kb0B9 +5Wo18JxAqvPtTB8= +-----END PUBLIC KEY----- diff --git a/node_modules/parse-asn1/test/rsa.1024.priv b/node_modules/parse-asn1/test/rsa.1024.priv new file mode 100644 index 000000000..d3b5fdab6 --- /dev/null +++ b/node_modules/parse-asn1/test/rsa.1024.priv @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICVAIBAAJ/OwswbFo/uyC8ltGf/yA1A+gV5IGdnAgPbUSI3GzbHCA+x+TLG/tL +vbRw3r1smppY/jkkpiVW1ErSMuN0uixp5gb78Z9rH1XpWb5WWgp3WaY/9EHMjMdO +kQ/9LVZvRvl/M/Fi6owP+q+amJI1BEjECYfbhGL3rmlVdq4qXc40QwIDAQABAn8I +VZ0BPoAOhyF33KFMHxy8r28fsVgxJUYgM3NqQgdv4fFawCYXjhJz9duU5YJGFJGJ +WUGeHlkyYFlpi4f3m7tY7JawmQUWB0MNSoKHI3cgDX4/tfBN8ni+cO0eSoR5czBY +EsAHBU47p1awNFAHwd+ZEuv9H4RmMn7p279rQTtpAkAH3Nqs2/vrRF2cZUN4fIXf +4xHsQBByUayGq8a3J0UGaSFWv68zTUKFherr9uZotNp7NJ4jBXiARw0q8docXUG1 +AkAHgmOKHoORtAmikqpmFEJZOtsXMaLCIm4EszPo5ciYoLMBcVit09AdiQlt7ZJL +DY02svU1b0agCZ97kDkmHDkXAkACa8M9JELuDs/P/vIGYDkMVatIFfW6bWF02eFG +taWwMqCcSEsWvbw0xqYt34jURpNbCjmCyQVwYfAw/+TLhP9dAkAFwRjdwjw37qpj +ddg1mNiu37b7swFxmkiMOXZRxaNNsfb56A14RpN3zob3QdGUybGodMIKTFbmU/lu +CjqAxafJAkAG2yf6RWbwFIWfMyt7WYCh0VaGBCcgy574AinVieEo3ZZyFfC63+xm +3uoaNy4iLoJv4GCjqUBz3ZfcVaO/DDWG +-----END RSA PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/rsa.1024.pub b/node_modules/parse-asn1/test/rsa.1024.pub new file mode 100644 index 000000000..7ba06369b --- /dev/null +++ b/node_modules/parse-asn1/test/rsa.1024.pub @@ -0,0 +1,5 @@ +-----BEGIN RSA PUBLIC KEY----- +MIGGAn87CzBsWj+7ILyW0Z//IDUD6BXkgZ2cCA9tRIjcbNscID7H5Msb+0u9tHDe +vWyamlj+OSSmJVbUStIy43S6LGnmBvvxn2sfVelZvlZaCndZpj/0QcyMx06RD/0t +Vm9G+X8z8WLqjA/6r5qYkjUESMQJh9uEYveuaVV2ripdzjRDAgMBAAE= +-----END RSA PUBLIC KEY----- diff --git a/node_modules/parse-asn1/test/rsa.2028.priv b/node_modules/parse-asn1/test/rsa.2028.priv new file mode 100644 index 000000000..10e651d86 --- /dev/null +++ b/node_modules/parse-asn1/test/rsa.2028.priv @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEjwIBAAKB/gy7mjaWgPeFdVYDZWRCA9BNiv3pPb0es27+FKY0hszLaOw47ExC +tAWpDsH48TXAfyHBYwBLguayfk4LGIupxb+CGMbRo3xEp0CbfY1Jby26T9vGjRC1 +foHDDUJG84uaRbyHqaf4i6zt4gVR+xlAEIjkaFAAK8cOoXAT1CVqGLLljUCchL8P +jaHj/yriZ/S7rdwlI3LnABxwwmLrmR/v71WtpmO/aNG8N+1po+QwaghTkyQ59E/Z +vAuOkFWHok2q/R6PYAa2jdZ9zim0FqOP+nkQaEDRbBFBmBqTv5fFGfk2WsAfKf/R +G0/VFd+ZeM5251TeTvXH695nlSGauVl9AgMBAAECgf4LrWHY/l54ouThZWvvbrug +pfz6sJX2g9l7yXmWlEWsPECVo/7SUbpYFpt6OZy99zSg+IKbGqWKfdhoKrTwIVtC +L0YZ0NlmdnANSIz0roxQG7ZxkL5+vHSw/PmD9x4Uwf+Cz8hATCmNBv1qc60dkyuW +4CLqe72qaTiVWRoO1iagQghNcLoo6vSy65ExLaCDTPha7yu2vw4hFZpWiEjW4dxf +rFdLiix52BC86YlAlxME/rLg8IJVvilbyo9aWdXmxOaUTLRv6PkFD1/gVdw8V9Qr +SLN9FlK2kkjiX0dzoibvZw3tMnt3yydAx0X87+sMRVahC1bp3kVPz4Hy0EWX4QJ/ +PM31vGiuITk2NCd51DXt1Ltn2OP5FaJSmCaEjh0XkU4qouYyjXWt8Bu6BTCl2vua +Fg0Uji9C+IkPLmaUMbMIOwaTk8cWqLthSxsLe70J5OkGrgfKUM/w+BHH1Pt/Pjzj +C++l0kiFaOVDVaAV9GpLPLCBoK/PC9Rb/rxMMoCCNwJ/NZuedIny2w3LMii77h/T +zSvergNGhjY6Rnva8lLXJ6dlrkcPAyps3gWwxqj4NR0T+GM0bDUPVLb7M07XV7SX +v7VJGm52JbRGwM1ss+r8XTTNemeGk+WRxG7TgtsMqYGXLfB8Qxk/f5/Mcc00Tl8u +wXFNsfxJxmt6AbsTr3g36wJ/IhOnibz9Ad+nchlBnN3QeW3CKHqzaR18voqvtVm2 +kJfHK15prH/sSGmxmiEGgrCJTZxtDbaNCO7/VBjnKudUUIhCAwsLtuq0/zub9vAd +8G1scfIpv5qaSNzmKoX8bOwArvrS6wP7yKrcTsuWIlHD8rJVI7IEDnQoTp5G8fK1 +hwJ/MIh8M5v0r5dUYEv6oIJWGcle6AH1JmsP5WIafgq72Z2288pHcCFHwNY8Dg9J +76QswVLnUhPTlmm3EOOPGEtam2iAD5r0Afytlb4lbNoQsj2szeXONDXB+6oueajh +VNELUr8HcSP5lgzRZjJW6aFIzj9LDRmQnUAOjGSXVOQtEwJ/MCQZ7N/v4dIKeDRA +8d8UExZ3+gGHumziztGRJ0tQryZH2PakP5I7V+1l7qEUnJ2c3mF+e1v41Ep9LCvh +bzrPKw9dxh18g4b+7bMpsWPnsraKh6ipxc7aaOaZV0Dxgez4zcZu0P1olO0cN3KM +nxJ0Pds3R8bAhNCDdS2JZaRp5Q== +-----END RSA PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/rsa.2028.pub b/node_modules/parse-asn1/test/rsa.2028.pub new file mode 100644 index 000000000..b36dca4d6 --- /dev/null +++ b/node_modules/parse-asn1/test/rsa.2028.pub @@ -0,0 +1,8 @@ +-----BEGIN RSA PUBLIC KEY----- +MIIBBgKB/gy7mjaWgPeFdVYDZWRCA9BNiv3pPb0es27+FKY0hszLaOw47ExCtAWp +DsH48TXAfyHBYwBLguayfk4LGIupxb+CGMbRo3xEp0CbfY1Jby26T9vGjRC1foHD +DUJG84uaRbyHqaf4i6zt4gVR+xlAEIjkaFAAK8cOoXAT1CVqGLLljUCchL8PjaHj +/yriZ/S7rdwlI3LnABxwwmLrmR/v71WtpmO/aNG8N+1po+QwaghTkyQ59E/ZvAuO +kFWHok2q/R6PYAa2jdZ9zim0FqOP+nkQaEDRbBFBmBqTv5fFGfk2WsAfKf/RG0/V +Fd+ZeM5251TeTvXH695nlSGauVl9AgMBAAE= +-----END RSA PUBLIC KEY----- diff --git a/node_modules/parse-asn1/test/vector.js b/node_modules/parse-asn1/test/vector.js new file mode 100644 index 000000000..4b8d8cf53 --- /dev/null +++ b/node_modules/parse-asn1/test/vector.js @@ -0,0 +1,7 @@ +module.exports = { + p: new Buffer('86F5CA03DCFEB225063FF830A0C769B9DD9D6153AD91D7CE27F787C43278B447E6533B86B18BED6E8A48B784A14C252C5BE0DBF60B86D6385BD2F12FB763ED8873ABFD3F5BA2E0A8C0A59082EAC056935E529DAF7C610467899C77ADEDFC846C881870B7B19B2B58F9BE0521A17002E3BDD6B86685EE90B3D9A1B02B782B1779', 'hex'), + q: new Buffer('996F967F6C8E388D9E28D01E205FBA957A5698B1', 'hex'), + g: new Buffer('07B0F92546150B62514BB771E2A0C0CE387F03BDA6C56B505209FF25FD3C133D89BBCD97E904E09114D9A7DEFDEADFC9078EA544D2E401AEECC40BB9FBBF78FD87995A10A1C27CB7789B594BA7EFB5C4326A9FE59A070E136DB77175464ADCA417BE5DCE2F40D10A46A3A3943F26AB7FD9C0398FF8C76EE0A56826A8A88F1DBD', 'hex'), + x: new Buffer('411602CB19A6CCC34494D79D98EF1E7ED5AF25F7', 'hex'), + y: new Buffer('5DF5E01DED31D0297E274E1691C192FE5868FEF9E19A84776454B100CF16F65392195A38B90523E2542EE61871C0440CB87C322FC4B4D2EC5E1E7EC766E1BE8D4CE935437DC11C3C8FD426338933EBFE739CB3465F4D3668C5E473508253B1E682F65CBDC4FAE93C2EA212390E54905A86E2223170B44EAA7DA5DD9FFCFB7F3B', 'hex') +} diff --git a/node_modules/parse-asn1/test/vector.priv b/node_modules/parse-asn1/test/vector.priv new file mode 100644 index 000000000..178bd1e68 --- /dev/null +++ b/node_modules/parse-asn1/test/vector.priv @@ -0,0 +1,12 @@ +-----BEGIN DSA PRIVATE KEY----- +MIIBugIBAAKBgQCG9coD3P6yJQY/+DCgx2m53Z1hU62R184n94fEMni0R+ZTO4ax +i+1uiki3hKFMJSxb4Nv2C4bWOFvS8S+3Y+2Ic6v9P1ui4KjApZCC6sBWk15Sna98 +YQRniZx3re38hGyIGHC3sZsrWPm+BSGhcALjvda4ZoXukLPZobAreCsXeQIVAJlv +ln9sjjiNnijQHiBfupV6VpixAoGAB7D5JUYVC2JRS7dx4qDAzjh/A72mxWtQUgn/ +Jf08Ez2Ju82X6QTgkRTZp9796t/JB46lRNLkAa7sxAu5+794/YeZWhChwny3eJtZ +S6fvtcQyap/lmgcOE223cXVGStykF75dzi9A0QpGo6OUPyarf9nAOY/4x27gpWgm +qKiPHb0CgYBd9eAd7THQKX4nThaRwZL+WGj++eGahHdkVLEAzxb2U5IZWji5BSPi +VC7mGHHARAy4fDIvxLTS7F4efsdm4b6NTOk1Q33BHDyP1CYziTPr/nOcs0ZfTTZo +xeRzUIJTseaC9ly9xPrpPC6iEjkOVJBahuIiMXC0Tqp9pd2f/Pt/OwIUQRYCyxmm +zMNElNedmO8eftWvJfc= +-----END DSA PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/vector2.priv b/node_modules/parse-asn1/test/vector2.priv new file mode 100644 index 000000000..ef53f6146 --- /dev/null +++ b/node_modules/parse-asn1/test/vector2.priv @@ -0,0 +1,19 @@ +-----BEGIN DSA PRIVATE KEY----- +MIIDVQIBAAKCAQEAnbb7WVG2a7b+HhQPHSzlUCN0Fh/WU43xZIIYZC8LXEjI96Qa +rfoYcyS4dnT6GCKwDx7PgTaUPXxVdXJk5aGkT/4BLpk24AwdPpMQsBx9F5gF0wWL +Kp9Ltvlxa/5hF8a1s8xNm+NBEErUqArWyU4AX0uZPhTwketRdDvzMFDDjeI1Vn4b +NMPWpcDOqhoPNoITw9GYQ9C0sJ3Ln8ctOcjeQfG/FNS7RWPKKDcWIcrTMktqLTkh +Rb6/rHSIBSNvXKL+krhxzY+cNtMpK1UJyoyqd6Kt/Hv9d92m9xElp0Vv6hU+QzJW +oiYcagbtNpN5fnmV+tWqu8++PtonQeN1QEriWwIhAPLDEZN0znbJNWmQtGU3Shfy +P57TUIm9lp9hxt3pmYwfAoIBAFx/9rBvjxQ/6CiEM0k+R2nE2Yis5b4loOJICWcH +FsYT17DO5pMvj6p8RNLLJFI9pT++T27DWViS0apYxDKKBsRqFWYufqpwOh3s+Luy +0F2+LrlWwUKjOGYdEEYcDRNUcghQV/NJQwn/pzxhH3izKtu1dAw2HJ81vpCZfbIB +Ti71qmF4L1Kr64vWQyxN0Je8VCOyhdr7YNw2ToFh9KKjWso6ELHE0gPMdqRwozr9 +y92SlZhZq9i1bhclJS146sZucbqa4/HdJIcZmHQ5PNTYMhhoAGVHYOHjTAnk0VUX +n57A3ERz+Za9zm7tHKvti28Rb3rZz1Bd8PmY40qydRSw/+cCggEAZnCYxlRCbHjX ++CAerGwgPvAw1DYFAywvH6k35SN9vZSfNKCiVk/hJtyLcVxRQYAs4JecgkZGPEDm +tr2qJRP6YRcocWwuT9U7yVuJ5plJ2WUS6HO5yPjf1JnMMSiCVhreyzH2WOk0wMGX +8sTZawXLrWc4Hnt2iJHk2jhD0k2UzftRJum4vyHoNY7g4KMO8T/WpmTA3ONzH3+0 +mkhFpP2CVGh5cqLTglmcm6xODteZgZMHiRMDJVgTSXZBC4nSwXHRI6w1/ZdyGVl6p9FcGppCjlkZT3XHIevLz65EaWpJmvp04EKZ8TICZgFjjLh6t5GQ1KCYY +xXajuxlYck4mWvq3wIgacdUjCHQ3+prmlHJ6tTifDPTs/GAMW5byrkskz8OTbw= +-----END DSA PRIVATE KEY----- diff --git a/node_modules/parse-glob/LICENSE b/node_modules/parse-glob/LICENSE new file mode 100644 index 000000000..65f90aca8 --- /dev/null +++ b/node_modules/parse-glob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/parse-glob/README.md b/node_modules/parse-glob/README.md new file mode 100644 index 000000000..000ccd99c --- /dev/null +++ b/node_modules/parse-glob/README.md @@ -0,0 +1,115 @@ +# parse-glob [![NPM version](https://badge.fury.io/js/parse-glob.svg)](http://badge.fury.io/js/parse-glob) [![Build Status](https://travis-ci.org/jonschlinkert/parse-glob.svg)](https://travis-ci.org/jonschlinkert/parse-glob) + +> Parse a glob pattern into an object of tokens. + +**Changes from v1.0.0 to v3.0.4** + +* all path-related properties are now on the `path` object +* all boolean properties are now on the `is` object +* adds `base` property + +See the [properties](#properties) section for details. + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i parse-glob --save +``` + +* parses 1,000+ glob patterns in 29ms (2.3 GHz Intel Core i7) +* Extensive [unit tests](./test.js) (more than 1,000 lines), covering wildcards, globstars, character classes, brace patterns, extglobs, dotfiles and other complex patterns. + +See the tests for [hundreds of examples](./test.js). + +## Usage + +```js +var parseGlob = require('parse-glob'); +``` + +**Example** + +```js +parseGlob('a/b/c/**/*.{yml,json}'); +``` + +**Returns:** + +```js +{ orig: 'a/b/c/**/*.{yml,json}', + is: + { glob: true, + negated: false, + extglob: false, + braces: true, + brackets: false, + globstar: true, + dotfile: false, + dotdir: false }, + glob: '**/*.{yml,json}', + base: 'a/b/c', + path: + { dirname: 'a/b/c/**/', + basename: '*.{yml,json}', + filename: '*', + extname: '.{yml,json}', + ext: '{yml,json}' } } +``` + +## Properties + +The object returned by parseGlob has the following properties: + +* `orig`: a copy of the original, unmodified glob pattern +* `is`: an object with boolean information about the glob: + - `glob`: true if the pattern actually a glob pattern + - `negated`: true if it's a negation pattern (`!**/foo.js`) + - `extglob`: true if it has extglobs (`@(foo|bar)`) + - `braces`: true if it has braces (`{1..2}` or `.{txt,md}`) + - `brackets`: true if it has POSIX brackets (`[[:alpha:]]`) + - `globstar`: true if the pattern has a globstar (double star, `**`) + - `dotfile`: true if the pattern should match dotfiles + - `dotdir`: true if the pattern should match dot-directories (like `.git`) +* `glob`: the glob pattern part of the string, if any +* `base`: the non-glob part of the string, if any +* `path`: file path segments + - `dirname`: directory + - `basename`: file name with extension + - `filename`: file name without extension + - `extname`: file extension with dot + - `ext`: file extension without dot + +## Related +* [glob-base](https://www.npmjs.com/package/glob-base): Returns an object with the (non-glob) base path and the actual pattern. | [homepage](https://github.com/jonschlinkert/glob-base) +* [glob-parent](https://www.npmjs.com/package/glob-parent): Strips glob magic from a string to provide the parent path | [homepage](https://github.com/es128/glob-parent) +* [glob-path-regex](https://www.npmjs.com/package/glob-path-regex): Regular expression for matching the parts of glob pattern. | [homepage](https://github.com/regexps/glob-path-regex) +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern. | [homepage](https://github.com/jonschlinkert/is-glob) +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just… [more](https://www.npmjs.com/package/micromatch) | [homepage](https://github.com/jonschlinkert/micromatch) + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/parse-glob/issues/new). + +## Tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2014-2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on September 22, 2015._ \ No newline at end of file diff --git a/node_modules/parse-glob/index.js b/node_modules/parse-glob/index.js new file mode 100644 index 000000000..4ab691afc --- /dev/null +++ b/node_modules/parse-glob/index.js @@ -0,0 +1,156 @@ +/*! + * parse-glob + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var isGlob = require('is-glob'); +var findBase = require('glob-base'); +var extglob = require('is-extglob'); +var dotfile = require('is-dotfile'); + +/** + * Expose `cache` + */ + +var cache = module.exports.cache = {}; + +/** + * Parse a glob pattern into tokens. + * + * When no paths or '**' are in the glob, we use a + * different strategy for parsing the filename, since + * file names can contain braces and other difficult + * patterns. such as: + * + * - `*.{a,b}` + * - `(**|*.js)` + */ + +module.exports = function parseGlob(glob) { + if (cache.hasOwnProperty(glob)) { + return cache[glob]; + } + + var tok = {}; + tok.orig = glob; + tok.is = {}; + + // unescape dots and slashes in braces/brackets + glob = escape(glob); + + var parsed = findBase(glob); + tok.is.glob = parsed.isGlob; + + tok.glob = parsed.glob; + tok.base = parsed.base; + var segs = /([^\/]*)$/.exec(glob); + + tok.path = {}; + tok.path.dirname = ''; + tok.path.basename = segs[1] || ''; + tok.path.dirname = glob.split(tok.path.basename).join('') || ''; + var basename = (tok.path.basename || '').split('.') || ''; + tok.path.filename = basename[0] || ''; + tok.path.extname = basename.slice(1).join('.') || ''; + tok.path.ext = ''; + + if (isGlob(tok.path.dirname) && !tok.path.basename) { + if (!/\/$/.test(tok.glob)) { + tok.path.basename = tok.glob; + } + tok.path.dirname = tok.base; + } + + if (glob.indexOf('/') === -1 && !tok.is.globstar) { + tok.path.dirname = ''; + tok.path.basename = tok.orig; + } + + var dot = tok.path.basename.indexOf('.'); + if (dot !== -1) { + tok.path.filename = tok.path.basename.slice(0, dot); + tok.path.extname = tok.path.basename.slice(dot); + } + + if (tok.path.extname.charAt(0) === '.') { + var exts = tok.path.extname.split('.'); + tok.path.ext = exts[exts.length - 1]; + } + + // unescape dots and slashes in braces/brackets + tok.glob = unescape(tok.glob); + tok.path.dirname = unescape(tok.path.dirname); + tok.path.basename = unescape(tok.path.basename); + tok.path.filename = unescape(tok.path.filename); + tok.path.extname = unescape(tok.path.extname); + + // Booleans + var is = (glob && tok.is.glob); + tok.is.negated = glob && glob.charAt(0) === '!'; + tok.is.extglob = glob && extglob(glob); + tok.is.braces = has(is, glob, '{'); + tok.is.brackets = has(is, glob, '[:'); + tok.is.globstar = has(is, glob, '**'); + tok.is.dotfile = dotfile(tok.path.basename) || dotfile(tok.path.filename); + tok.is.dotdir = dotdir(tok.path.dirname); + return (cache[glob] = tok); +} + +/** + * Returns true if the glob matches dot-directories. + * + * @param {Object} `tok` The tokens object + * @param {Object} `path` The path object + * @return {Object} + */ + +function dotdir(base) { + if (base.indexOf('/.') !== -1) { + return true; + } + if (base.charAt(0) === '.' && base.charAt(1) !== '/') { + return true; + } + return false; +} + +/** + * Returns true if the pattern has the given `ch`aracter(s) + * + * @param {Object} `glob` The glob pattern. + * @param {Object} `ch` The character to test for + * @return {Object} + */ + +function has(is, glob, ch) { + return is && glob.indexOf(ch) !== -1; +} + +/** + * Escape/unescape utils + */ + +function escape(str) { + var re = /\{([^{}]*?)}|\(([^()]*?)\)|\[([^\[\]]*?)\]/g; + return str.replace(re, function (outter, braces, parens, brackets) { + var inner = braces || parens || brackets; + if (!inner) { return outter; } + return outter.split(inner).join(esc(inner)); + }); +} + +function esc(str) { + str = str.split('/').join('__SLASH__'); + str = str.split('.').join('__DOT__'); + return str; +} + +function unescape(str) { + str = str.split('__SLASH__').join('/'); + str = str.split('__DOT__').join('.'); + return str; +} diff --git a/node_modules/parse-glob/package.json b/node_modules/parse-glob/package.json new file mode 100644 index 000000000..0e5a29821 --- /dev/null +++ b/node_modules/parse-glob/package.json @@ -0,0 +1,93 @@ +{ + "_from": "parse-glob@^3.0.4", + "_id": "parse-glob@3.0.4", + "_inBundle": false, + "_integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "_location": "/parse-glob", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "parse-glob@^3.0.4", + "name": "parse-glob", + "escapedName": "parse-glob", + "rawSpec": "^3.0.4", + "saveSpec": null, + "fetchSpec": "^3.0.4" + }, + "_requiredBy": [ + "/micromatch" + ], + "_resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "_shasum": "b2c376cfb11f35513badd173ef0bb6e3a388391c", + "_spec": "parse-glob@^3.0.4", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/parse-glob/issues" + }, + "bundleDependencies": false, + "dependencies": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + }, + "deprecated": false, + "description": "Parse a glob pattern into an object of tokens.", + "devDependencies": { + "browserify": "^9.0.3", + "lodash": "^3.3.1", + "mocha": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/parse-glob", + "keywords": [ + "glob", + "match", + "bash", + "expand", + "expansion", + "expression", + "file", + "files", + "filter", + "find", + "glob", + "globbing", + "globs", + "globstar", + "match", + "matcher", + "matches", + "matching", + "path", + "pattern", + "patterns", + "regex", + "regexp", + "regular", + "shell", + "wildcard" + ], + "license": "MIT", + "main": "index.js", + "name": "parse-glob", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/parse-glob.git" + }, + "scripts": { + "prepublish": "browserify -o browser.js -e index.js", + "test": "mocha" + }, + "version": "3.0.4" +} diff --git a/node_modules/parse-ms/index.js b/node_modules/parse-ms/index.js new file mode 100644 index 000000000..838cb2ef0 --- /dev/null +++ b/node_modules/parse-ms/index.js @@ -0,0 +1,16 @@ +'use strict'; +module.exports = function (ms) { + if (typeof ms !== 'number') { + throw new TypeError('Expected a number'); + } + + var roundTowardZero = ms > 0 ? Math.floor : Math.ceil; + + return { + days: roundTowardZero(ms / 86400000), + hours: roundTowardZero(ms / 3600000) % 24, + minutes: roundTowardZero(ms / 60000) % 60, + seconds: roundTowardZero(ms / 1000) % 60, + milliseconds: roundTowardZero(ms) % 1000 + }; +}; diff --git a/node_modules/parse-ms/license b/node_modules/parse-ms/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/parse-ms/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/parse-ms/package.json b/node_modules/parse-ms/package.json new file mode 100644 index 000000000..3f5bda445 --- /dev/null +++ b/node_modules/parse-ms/package.json @@ -0,0 +1,66 @@ +{ + "_from": "parse-ms@^1.0.0", + "_id": "parse-ms@1.0.1", + "_inBundle": false, + "_integrity": "sha1-VjRtR0nXjyNDDKDHE4UK75GqNh0=", + "_location": "/parse-ms", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "parse-ms@^1.0.0", + "name": "parse-ms", + "escapedName": "parse-ms", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/pretty-ms" + ], + "_resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-1.0.1.tgz", + "_shasum": "56346d4749d78f23430ca0c713850aef91aa361d", + "_spec": "parse-ms@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/pretty-ms", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/parse-ms/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Parse milliseconds into an object", + "devDependencies": { + "mocha": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/parse-ms#readme", + "keywords": [ + "browser", + "parse", + "time", + "ms", + "milliseconds", + "duration", + "period", + "range" + ], + "license": "MIT", + "name": "parse-ms", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/parse-ms.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "1.0.1" +} diff --git a/node_modules/parse-ms/readme.md b/node_modules/parse-ms/readme.md new file mode 100644 index 000000000..6e907d32e --- /dev/null +++ b/node_modules/parse-ms/readme.md @@ -0,0 +1,23 @@ +# parse-ms [![Build Status](https://travis-ci.org/sindresorhus/parse-ms.svg?branch=master)](https://travis-ci.org/sindresorhus/parse-ms) + +> Parse milliseconds into an object + + +## Install + +```sh +$ npm install --save parse-ms +``` + + +## Usage + +```js +parseMs(1337000001); +//=> { days: 15, hours: 11, minutes: 23, seconds: 20, milliseconds: 1 } +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/parseurl/HISTORY.md b/node_modules/parseurl/HISTORY.md new file mode 100644 index 000000000..4803393a9 --- /dev/null +++ b/node_modules/parseurl/HISTORY.md @@ -0,0 +1,53 @@ +1.3.2 / 2017-09-09 +================== + + * perf: reduce overhead for full URLs + * perf: unroll the "fast-path" `RegExp` + +1.3.1 / 2016-01-17 +================== + + * perf: enable strict mode + +1.3.0 / 2014-08-09 +================== + + * Add `parseurl.original` for parsing `req.originalUrl` with fallback + * Return `undefined` if `req.url` is `undefined` + +1.2.0 / 2014-07-21 +================== + + * Cache URLs based on original value + * Remove no-longer-needed URL mis-parse work-around + * Simplify the "fast-path" `RegExp` + +1.1.3 / 2014-07-08 +================== + + * Fix typo + +1.1.2 / 2014-07-08 +================== + + * Seriously fix Node.js 0.8 compatibility + +1.1.1 / 2014-07-08 +================== + + * Fix Node.js 0.8 compatibility + +1.1.0 / 2014-07-08 +================== + + * Incorporate URL href-only parse fast-path + +1.0.1 / 2014-03-08 +================== + + * Add missing `require` + +1.0.0 / 2014-03-08 +================== + + * Genesis from `connect` diff --git a/node_modules/parseurl/LICENSE b/node_modules/parseurl/LICENSE new file mode 100644 index 000000000..27653d3db --- /dev/null +++ b/node_modules/parseurl/LICENSE @@ -0,0 +1,24 @@ + +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2014-2017 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/parseurl/README.md b/node_modules/parseurl/README.md new file mode 100644 index 000000000..a5ccc51b0 --- /dev/null +++ b/node_modules/parseurl/README.md @@ -0,0 +1,124 @@ +# parseurl + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Parse a URL with memoization. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install parseurl +``` + +## API + +```js +var parseurl = require('parseurl') +``` + +### parseurl(req) + +Parse the URL of the given request object (looks at the `req.url` property) +and return the result. The result is the same as `url.parse` in Node.js core. +Calling this function multiple times on the same `req` where `req.url` does +not change will return a cached parsed object, rather than parsing again. + +### parseurl.original(req) + +Parse the original URL of the given request object and return the result. +This works by trying to parse `req.originalUrl` if it is a string, otherwise +parses `req.url`. The result is the same as `url.parse` in Node.js core. +Calling this function multiple times on the same `req` where `req.originalUrl` +does not change will return a cached parsed object, rather than parsing again. + +## Benchmark + +```bash +$ npm run-script bench + +> parseurl@1.3.2 bench nodejs-parseurl +> node benchmark/index.js + + http_parser@2.7.0 + node@4.8.4 + v8@4.5.103.47 + uv@1.9.1 + zlib@1.2.11 + ares@1.10.1-DEV + icu@56.1 + modules@46 + openssl@1.0.2k + +> node benchmark/fullurl.js + + Parsing URL "http://localhost:8888/foo/bar?user=tj&pet=fluffy" + + 3 tests completed. + + fasturl x 1,246,766 ops/sec ±0.74% (188 runs sampled) + nativeurl x 91,536 ops/sec ±0.54% (189 runs sampled) + parseurl x 90,645 ops/sec ±0.38% (189 runs sampled) + +> node benchmark/pathquery.js + + Parsing URL "/foo/bar?user=tj&pet=fluffy" + + 3 tests completed. + + fasturl x 2,077,650 ops/sec ±0.69% (186 runs sampled) + nativeurl x 638,669 ops/sec ±0.67% (189 runs sampled) + parseurl x 2,431,842 ops/sec ±0.71% (189 runs sampled) + +> node benchmark/samerequest.js + + Parsing URL "/foo/bar?user=tj&pet=fluffy" on same request object + + 3 tests completed. + + fasturl x 2,135,391 ops/sec ±0.69% (188 runs sampled) + nativeurl x 672,809 ops/sec ±3.83% (186 runs sampled) + parseurl x 11,604,947 ops/sec ±0.70% (189 runs sampled) + +> node benchmark/simplepath.js + + Parsing URL "/foo/bar" + + 3 tests completed. + + fasturl x 4,961,391 ops/sec ±0.97% (186 runs sampled) + nativeurl x 914,931 ops/sec ±0.83% (186 runs sampled) + parseurl x 7,559,196 ops/sec ±0.66% (188 runs sampled) + +> node benchmark/slash.js + + Parsing URL "/" + + 3 tests completed. + + fasturl x 4,053,379 ops/sec ±0.91% (187 runs sampled) + nativeurl x 963,999 ops/sec ±0.58% (189 runs sampled) + parseurl x 11,516,143 ops/sec ±0.58% (188 runs sampled) +``` + +## License + + [MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/parseurl.svg +[npm-url]: https://npmjs.org/package/parseurl +[node-version-image]: https://img.shields.io/node/v/parseurl.svg +[node-version-url]: https://nodejs.org/en/download/ +[travis-image]: https://img.shields.io/travis/pillarjs/parseurl/master.svg +[travis-url]: https://travis-ci.org/pillarjs/parseurl +[coveralls-image]: https://img.shields.io/coveralls/pillarjs/parseurl/master.svg +[coveralls-url]: https://coveralls.io/r/pillarjs/parseurl?branch=master +[downloads-image]: https://img.shields.io/npm/dm/parseurl.svg +[downloads-url]: https://npmjs.org/package/parseurl diff --git a/node_modules/parseurl/index.js b/node_modules/parseurl/index.js new file mode 100644 index 000000000..603eabe12 --- /dev/null +++ b/node_modules/parseurl/index.js @@ -0,0 +1,154 @@ +/*! + * parseurl + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2017 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var url = require('url') +var parse = url.parse +var Url = url.Url + +/** + * Module exports. + * @public + */ + +module.exports = parseurl +module.exports.original = originalurl + +/** + * Parse the `req` url with memoization. + * + * @param {ServerRequest} req + * @return {Object} + * @public + */ + +function parseurl (req) { + var url = req.url + + if (url === undefined) { + // URL is undefined + return undefined + } + + var parsed = req._parsedUrl + + if (fresh(url, parsed)) { + // Return cached URL parse + return parsed + } + + // Parse the URL + parsed = fastparse(url) + parsed._raw = url + + return (req._parsedUrl = parsed) +}; + +/** + * Parse the `req` original url with fallback and memoization. + * + * @param {ServerRequest} req + * @return {Object} + * @public + */ + +function originalurl (req) { + var url = req.originalUrl + + if (typeof url !== 'string') { + // Fallback + return parseurl(req) + } + + var parsed = req._parsedOriginalUrl + + if (fresh(url, parsed)) { + // Return cached URL parse + return parsed + } + + // Parse the URL + parsed = fastparse(url) + parsed._raw = url + + return (req._parsedOriginalUrl = parsed) +}; + +/** + * Parse the `str` url with fast-path short-cut. + * + * @param {string} str + * @return {Object} + * @private + */ + +function fastparse (str) { + if (typeof str !== 'string' || str.charCodeAt(0) !== 0x2f /* / */) { + return parse(str) + } + + var pathname = str + var query = null + var search = null + + // This takes the regexp from https://github.com/joyent/node/pull/7878 + // Which is /^(\/[^?#\s]*)(\?[^#\s]*)?$/ + // And unrolls it into a for loop + for (var i = 1; i < str.length; i++) { + switch (str.charCodeAt(i)) { + case 0x3f: /* ? */ + if (search === null) { + pathname = str.substring(0, i) + query = str.substring(i + 1) + search = str.substring(i) + } + break + case 0x09: /* \t */ + case 0x0a: /* \n */ + case 0x0c: /* \f */ + case 0x0d: /* \r */ + case 0x20: /* */ + case 0x23: /* # */ + case 0xa0: + case 0xfeff: + return parse(str) + } + } + + var url = Url !== undefined + ? new Url() + : {} + url.path = str + url.href = str + url.pathname = pathname + url.query = query + url.search = search + + return url +} + +/** + * Determine if parsed is still fresh for url. + * + * @param {string} url + * @param {object} parsedUrl + * @return {boolean} + * @private + */ + +function fresh (url, parsedUrl) { + return typeof parsedUrl === 'object' && + parsedUrl !== null && + (Url === undefined || parsedUrl instanceof Url) && + parsedUrl._raw === url +} diff --git a/node_modules/parseurl/package.json b/node_modules/parseurl/package.json new file mode 100644 index 000000000..5dfa1b3f9 --- /dev/null +++ b/node_modules/parseurl/package.json @@ -0,0 +1,79 @@ +{ + "_from": "parseurl@~1.3.2", + "_id": "parseurl@1.3.2", + "_inBundle": false, + "_integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=", + "_location": "/parseurl", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "parseurl@~1.3.2", + "name": "parseurl", + "escapedName": "parseurl", + "rawSpec": "~1.3.2", + "saveSpec": null, + "fetchSpec": "~1.3.2" + }, + "_requiredBy": [ + "/serve-static" + ], + "_resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", + "_shasum": "fc289d4ed8993119460c156253262cdc8de65bf3", + "_spec": "parseurl@~1.3.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/serve-static", + "bugs": { + "url": "https://github.com/pillarjs/parseurl/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + } + ], + "deprecated": false, + "description": "parse a url with memoization", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "2.1.4", + "eslint": "3.19.0", + "eslint-config-standard": "10.2.1", + "eslint-plugin-import": "2.7.0", + "eslint-plugin-node": "5.1.1", + "eslint-plugin-promise": "3.5.0", + "eslint-plugin-standard": "3.0.1", + "fast-url-parser": "1.1.3", + "istanbul": "0.4.5", + "mocha": "2.5.3" + }, + "engines": { + "node": ">= 0.8" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "homepage": "https://github.com/pillarjs/parseurl#readme", + "license": "MIT", + "name": "parseurl", + "repository": { + "type": "git", + "url": "git+https://github.com/pillarjs/parseurl.git" + }, + "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint .", + "test": "mocha --check-leaks --bail --reporter spec test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec test/" + }, + "version": "1.3.2" +} diff --git a/node_modules/pascalcase/LICENSE b/node_modules/pascalcase/LICENSE new file mode 100644 index 000000000..65f90aca8 --- /dev/null +++ b/node_modules/pascalcase/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/pascalcase/README.md b/node_modules/pascalcase/README.md new file mode 100644 index 000000000..fa3fd00fe --- /dev/null +++ b/node_modules/pascalcase/README.md @@ -0,0 +1,80 @@ +# pascalcase [![NPM version](https://badge.fury.io/js/pascalcase.svg)](http://badge.fury.io/js/pascalcase) + +> Convert a string to pascal-case. + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i pascalcase --save +``` + +## Usage + +```js +var pascalcase = require('pascalcase'); + +pascalcase('a'); +//=> 'A' + +pascalcase('foo bar baz'); +//=> 'FooBarBaz' + +pascalcase('foo_bar-baz'); +//=> 'FooBarBaz' + +pascalcase('foo.bar.baz'); +//=> 'FooBarBaz' + +pascalcase('foo/bar/baz'); +//=> 'FooBarBaz' + +pascalcase('foo[bar)baz'); +//=> 'FooBarBaz' + +pascalcase('#foo+bar*baz'); +//=> 'FooBarBaz' + +pascalcase('$foo~bar`baz'); +//=> 'FooBarBaz' + +pascalcase('_foo_bar-baz-'); +//=> 'FooBarBaz' +``` + +## Related projects + +* [justified](https://github.com/jonschlinkert/justified): Wrap words to a specified length and justified the text. +* [pad-left](https://github.com/jonschlinkert/pad-left): Left pad a string with zeros or a specified string. Fastest implementation. +* [pad-right](https://github.com/jonschlinkert/pad-right): Right pad a string with zeros or a specified string. Fastest implementation. +* [repeat-string](https://github.com/jonschlinkert/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string. +* [word-wrap](https://github.com/jonschlinkert/word-wrap): Wrap words to a specified length. + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/pascalcase/issues/new) + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 19, 2015._ \ No newline at end of file diff --git a/node_modules/pascalcase/index.js b/node_modules/pascalcase/index.js new file mode 100644 index 000000000..7e8159ce4 --- /dev/null +++ b/node_modules/pascalcase/index.js @@ -0,0 +1,21 @@ +/*! + * pascalcase + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +function pascalcase(str) { + if (typeof str !== 'string') { + throw new TypeError('expected a string.'); + } + str = str.replace(/([A-Z])/g, ' $1'); + if (str.length === 1) { return str.toUpperCase(); } + str = str.replace(/^[\W_]+|[\W_]+$/g, '').toLowerCase(); + str = str.charAt(0).toUpperCase() + str.slice(1); + return str.replace(/[\W_]+(\w|$)/g, function (_, ch) { + return ch.toUpperCase(); + }); +} + +module.exports = pascalcase; diff --git a/node_modules/pascalcase/package.json b/node_modules/pascalcase/package.json new file mode 100644 index 000000000..8abd29599 --- /dev/null +++ b/node_modules/pascalcase/package.json @@ -0,0 +1,77 @@ +{ + "_from": "pascalcase@^0.1.1", + "_id": "pascalcase@0.1.1", + "_inBundle": false, + "_integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "_location": "/pascalcase", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "pascalcase@^0.1.1", + "name": "pascalcase", + "escapedName": "pascalcase", + "rawSpec": "^0.1.1", + "saveSpec": null, + "fetchSpec": "^0.1.1" + }, + "_requiredBy": [ + "/base" + ], + "_resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "_shasum": "b363e55e8006ca6fe21784d2db22bd15d7917f14", + "_spec": "pascalcase@^0.1.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/base", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/pascalcase/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Convert a string to pascal-case.", + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/pascalcase", + "keywords": [ + "camelcase", + "case", + "casing", + "pascal", + "pascal-case", + "pascalcase", + "string" + ], + "license": "MIT", + "main": "index.js", + "name": "pascalcase", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/pascalcase.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "pad-left", + "pad-right", + "word-wrap", + "repeat-string", + "justified" + ] + } + }, + "version": "0.1.1" +} diff --git a/node_modules/path-browserify/LICENSE b/node_modules/path-browserify/LICENSE new file mode 100644 index 000000000..ee27ba4b4 --- /dev/null +++ b/node_modules/path-browserify/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/path-browserify/index.js b/node_modules/path-browserify/index.js new file mode 100644 index 000000000..208658a21 --- /dev/null +++ b/node_modules/path-browserify/index.js @@ -0,0 +1,302 @@ +// .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); + } +; diff --git a/node_modules/path-browserify/package.json b/node_modules/path-browserify/package.json new file mode 100644 index 000000000..004e0cc97 --- /dev/null +++ b/node_modules/path-browserify/package.json @@ -0,0 +1,57 @@ +{ + "_from": "path-browserify@~0.0.0", + "_id": "path-browserify@0.0.1", + "_inBundle": false, + "_integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", + "_location": "/path-browserify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "path-browserify@~0.0.0", + "name": "path-browserify", + "escapedName": "path-browserify", + "rawSpec": "~0.0.0", + "saveSpec": null, + "fetchSpec": "~0.0.0" + }, + "_requiredBy": [ + "/browserify" + ], + "_resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", + "_shasum": "e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a", + "_spec": "path-browserify@~0.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/path-browserify/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "the path module from node core for browsers", + "devDependencies": { + "tape": "~1.0.4" + }, + "homepage": "https://github.com/substack/path-browserify", + "keywords": [ + "path", + "browser", + "browserify" + ], + "license": "MIT", + "main": "index.js", + "name": "path-browserify", + "repository": { + "type": "git", + "url": "git://github.com/substack/path-browserify.git" + }, + "scripts": { + "test": "node test/test-path.js" + }, + "version": "0.0.1" +} diff --git a/node_modules/path-browserify/readme.markdown b/node_modules/path-browserify/readme.markdown new file mode 100644 index 000000000..8ae1dd89e --- /dev/null +++ b/node_modules/path-browserify/readme.markdown @@ -0,0 +1,3 @@ +# path-browserify + +the path module from node core for browsers diff --git a/node_modules/path-browserify/test/test-path.js b/node_modules/path-browserify/test/test-path.js new file mode 100644 index 000000000..29496e43e --- /dev/null +++ b/node_modules/path-browserify/test/test-path.js @@ -0,0 +1,424 @@ +// 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 assert = require('assert'); + +var path = require('.'); + +var isWindows = process.platform === 'win32'; + +// Mock the node.js path +var f = __dirname + '/simple/test-path.js'; + +assert.equal(path.basename(f), 'test-path.js'); +assert.equal(path.basename(f, '.js'), 'test-path'); +assert.equal(path.basename(''), ''); +assert.equal(path.basename('/dir/basename.ext'), 'basename.ext'); +assert.equal(path.basename('/basename.ext'), 'basename.ext'); +assert.equal(path.basename('basename.ext'), 'basename.ext'); +assert.equal(path.basename('basename.ext/'), 'basename.ext'); +assert.equal(path.basename('basename.ext//'), 'basename.ext'); + +if (isWindows) { + // On Windows a backslash acts as a path separator. + assert.equal(path.basename('\\dir\\basename.ext'), 'basename.ext'); + assert.equal(path.basename('\\basename.ext'), 'basename.ext'); + assert.equal(path.basename('basename.ext'), 'basename.ext'); + assert.equal(path.basename('basename.ext\\'), 'basename.ext'); + assert.equal(path.basename('basename.ext\\\\'), 'basename.ext'); + +} else { + // On unix a backslash is just treated as any other character. + assert.equal(path.basename('\\dir\\basename.ext'), '\\dir\\basename.ext'); + assert.equal(path.basename('\\basename.ext'), '\\basename.ext'); + assert.equal(path.basename('basename.ext'), 'basename.ext'); + assert.equal(path.basename('basename.ext\\'), 'basename.ext\\'); + assert.equal(path.basename('basename.ext\\\\'), 'basename.ext\\\\'); +} + +// POSIX filenames may include control characters +// c.f. http://www.dwheeler.com/essays/fixing-unix-linux-filenames.html +if (!isWindows) { + var controlCharFilename = 'Icon' + String.fromCharCode(13); + assert.equal(path.basename('/a/b/' + controlCharFilename), + controlCharFilename); +} + +assert.equal(path.extname(f), '.js'); + +assert.equal(path.dirname(f).substr(-11), + isWindows ? 'test\\simple' : 'test/simple'); +assert.equal(path.dirname('/a/b/'), '/a'); +assert.equal(path.dirname('/a/b'), '/a'); +assert.equal(path.dirname('/a'), '/'); +assert.equal(path.dirname(''), '.'); +assert.equal(path.dirname('/'), '/'); +assert.equal(path.dirname('////'), '/'); + +if (isWindows) { + assert.equal(path.dirname('c:\\'), 'c:\\'); + assert.equal(path.dirname('c:\\foo'), 'c:\\'); + assert.equal(path.dirname('c:\\foo\\'), 'c:\\'); + assert.equal(path.dirname('c:\\foo\\bar'), 'c:\\foo'); + assert.equal(path.dirname('c:\\foo\\bar\\'), 'c:\\foo'); + assert.equal(path.dirname('c:\\foo\\bar\\baz'), 'c:\\foo\\bar'); + assert.equal(path.dirname('\\'), '\\'); + assert.equal(path.dirname('\\foo'), '\\'); + assert.equal(path.dirname('\\foo\\'), '\\'); + assert.equal(path.dirname('\\foo\\bar'), '\\foo'); + assert.equal(path.dirname('\\foo\\bar\\'), '\\foo'); + assert.equal(path.dirname('\\foo\\bar\\baz'), '\\foo\\bar'); + assert.equal(path.dirname('c:'), 'c:'); + assert.equal(path.dirname('c:foo'), 'c:'); + assert.equal(path.dirname('c:foo\\'), 'c:'); + assert.equal(path.dirname('c:foo\\bar'), 'c:foo'); + assert.equal(path.dirname('c:foo\\bar\\'), 'c:foo'); + assert.equal(path.dirname('c:foo\\bar\\baz'), 'c:foo\\bar'); + assert.equal(path.dirname('\\\\unc\\share'), '\\\\unc\\share'); + assert.equal(path.dirname('\\\\unc\\share\\foo'), '\\\\unc\\share\\'); + assert.equal(path.dirname('\\\\unc\\share\\foo\\'), '\\\\unc\\share\\'); + assert.equal(path.dirname('\\\\unc\\share\\foo\\bar'), + '\\\\unc\\share\\foo'); + assert.equal(path.dirname('\\\\unc\\share\\foo\\bar\\'), + '\\\\unc\\share\\foo'); + assert.equal(path.dirname('\\\\unc\\share\\foo\\bar\\baz'), + '\\\\unc\\share\\foo\\bar'); +} + + +assert.equal(path.extname(''), ''); +assert.equal(path.extname('/path/to/file'), ''); +assert.equal(path.extname('/path/to/file.ext'), '.ext'); +assert.equal(path.extname('/path.to/file.ext'), '.ext'); +assert.equal(path.extname('/path.to/file'), ''); +assert.equal(path.extname('/path.to/.file'), ''); +assert.equal(path.extname('/path.to/.file.ext'), '.ext'); +assert.equal(path.extname('/path/to/f.ext'), '.ext'); +assert.equal(path.extname('/path/to/..ext'), '.ext'); +assert.equal(path.extname('file'), ''); +assert.equal(path.extname('file.ext'), '.ext'); +assert.equal(path.extname('.file'), ''); +assert.equal(path.extname('.file.ext'), '.ext'); +assert.equal(path.extname('/file'), ''); +assert.equal(path.extname('/file.ext'), '.ext'); +assert.equal(path.extname('/.file'), ''); +assert.equal(path.extname('/.file.ext'), '.ext'); +assert.equal(path.extname('.path/file.ext'), '.ext'); +assert.equal(path.extname('file.ext.ext'), '.ext'); +assert.equal(path.extname('file.'), '.'); +assert.equal(path.extname('.'), ''); +assert.equal(path.extname('./'), ''); +assert.equal(path.extname('.file.ext'), '.ext'); +assert.equal(path.extname('.file'), ''); +assert.equal(path.extname('.file.'), '.'); +assert.equal(path.extname('.file..'), '.'); +assert.equal(path.extname('..'), ''); +assert.equal(path.extname('../'), ''); +assert.equal(path.extname('..file.ext'), '.ext'); +assert.equal(path.extname('..file'), '.file'); +assert.equal(path.extname('..file.'), '.'); +assert.equal(path.extname('..file..'), '.'); +assert.equal(path.extname('...'), '.'); +assert.equal(path.extname('...ext'), '.ext'); +assert.equal(path.extname('....'), '.'); +assert.equal(path.extname('file.ext/'), '.ext'); +assert.equal(path.extname('file.ext//'), '.ext'); +assert.equal(path.extname('file/'), ''); +assert.equal(path.extname('file//'), ''); +assert.equal(path.extname('file./'), '.'); +assert.equal(path.extname('file.//'), '.'); + +if (isWindows) { + // On windows, backspace is a path separator. + assert.equal(path.extname('.\\'), ''); + assert.equal(path.extname('..\\'), ''); + assert.equal(path.extname('file.ext\\'), '.ext'); + assert.equal(path.extname('file.ext\\\\'), '.ext'); + assert.equal(path.extname('file\\'), ''); + assert.equal(path.extname('file\\\\'), ''); + assert.equal(path.extname('file.\\'), '.'); + assert.equal(path.extname('file.\\\\'), '.'); + +} else { + // On unix, backspace is a valid name component like any other character. + assert.equal(path.extname('.\\'), ''); + assert.equal(path.extname('..\\'), '.\\'); + assert.equal(path.extname('file.ext\\'), '.ext\\'); + assert.equal(path.extname('file.ext\\\\'), '.ext\\\\'); + assert.equal(path.extname('file\\'), ''); + assert.equal(path.extname('file\\\\'), ''); + assert.equal(path.extname('file.\\'), '.\\'); + assert.equal(path.extname('file.\\\\'), '.\\\\'); +} + +// path.join tests +var failures = []; +var joinTests = + // arguments result + [[['.', 'x/b', '..', '/b/c.js'], 'x/b/c.js'], + [['/.', 'x/b', '..', '/b/c.js'], '/x/b/c.js'], + [['/foo', '../../../bar'], '/bar'], + [['foo', '../../../bar'], '../../bar'], + [['foo/', '../../../bar'], '../../bar'], + [['foo/x', '../../../bar'], '../bar'], + [['foo/x', './bar'], 'foo/x/bar'], + [['foo/x/', './bar'], 'foo/x/bar'], + [['foo/x/', '.', 'bar'], 'foo/x/bar'], + [['./'], './'], + [['.', './'], './'], + [['.', '.', '.'], '.'], + [['.', './', '.'], '.'], + [['.', '/./', '.'], '.'], + [['.', '/////./', '.'], '.'], + [['.'], '.'], + [['', '.'], '.'], + [['', 'foo'], 'foo'], + [['foo', '/bar'], 'foo/bar'], + [['', '/foo'], '/foo'], + [['', '', '/foo'], '/foo'], + [['', '', 'foo'], 'foo'], + [['foo', ''], 'foo'], + [['foo/', ''], 'foo/'], + [['foo', '', '/bar'], 'foo/bar'], + [['./', '..', '/foo'], '../foo'], + [['./', '..', '..', '/foo'], '../../foo'], + [['.', '..', '..', '/foo'], '../../foo'], + [['', '..', '..', '/foo'], '../../foo'], + [['/'], '/'], + [['/', '.'], '/'], + [['/', '..'], '/'], + [['/', '..', '..'], '/'], + [[''], '.'], + [['', ''], '.'], + [[' /foo'], ' /foo'], + [[' ', 'foo'], ' /foo'], + [[' ', '.'], ' '], + [[' ', '/'], ' /'], + [[' ', ''], ' '], + [['/', 'foo'], '/foo'], + [['/', '/foo'], '/foo'], + [['/', '//foo'], '/foo'], + [['/', '', '/foo'], '/foo'], + [['', '/', 'foo'], '/foo'], + [['', '/', '/foo'], '/foo'] + ]; + +// Windows-specific join tests +if (isWindows) { + joinTests = joinTests.concat( + [// UNC path expected + [['//foo/bar'], '//foo/bar/'], + [['\\/foo/bar'], '//foo/bar/'], + [['\\\\foo/bar'], '//foo/bar/'], + // UNC path expected - server and share separate + [['//foo', 'bar'], '//foo/bar/'], + [['//foo/', 'bar'], '//foo/bar/'], + [['//foo', '/bar'], '//foo/bar/'], + // UNC path expected - questionable + [['//foo', '', 'bar'], '//foo/bar/'], + [['//foo/', '', 'bar'], '//foo/bar/'], + [['//foo/', '', '/bar'], '//foo/bar/'], + // UNC path expected - even more questionable + [['', '//foo', 'bar'], '//foo/bar/'], + [['', '//foo/', 'bar'], '//foo/bar/'], + [['', '//foo/', '/bar'], '//foo/bar/'], + // No UNC path expected (no double slash in first component) + [['\\', 'foo/bar'], '/foo/bar'], + [['\\', '/foo/bar'], '/foo/bar'], + [['', '/', '/foo/bar'], '/foo/bar'], + // No UNC path expected (no non-slashes in first component - questionable) + [['//', 'foo/bar'], '/foo/bar'], + [['//', '/foo/bar'], '/foo/bar'], + [['\\\\', '/', '/foo/bar'], '/foo/bar'], + [['//'], '/'], + // No UNC path expected (share name missing - questionable). + [['//foo'], '/foo'], + [['//foo/'], '/foo/'], + [['//foo', '/'], '/foo/'], + [['//foo', '', '/'], '/foo/'], + // No UNC path expected (too many leading slashes - questionable) + [['///foo/bar'], '/foo/bar'], + [['////foo', 'bar'], '/foo/bar'], + [['\\\\\\/foo/bar'], '/foo/bar'], + // Drive-relative vs drive-absolute paths. This merely describes the + // status quo, rather than being obviously right + [['c:'], 'c:.'], + [['c:.'], 'c:.'], + [['c:', ''], 'c:.'], + [['', 'c:'], 'c:.'], + [['c:.', '/'], 'c:./'], + [['c:.', 'file'], 'c:file'], + [['c:', '/'], 'c:/'], + [['c:', 'file'], 'c:/file'] + ]); +} + +// Run the join tests. +joinTests.forEach(function(test) { + var actual = path.join.apply(path, test[0]); + var expected = isWindows ? test[1].replace(/\//g, '\\') : test[1]; + var message = 'path.join(' + test[0].map(JSON.stringify).join(',') + ')' + + '\n expect=' + JSON.stringify(expected) + + '\n actual=' + JSON.stringify(actual); + if (actual !== expected) failures.push('\n' + message); + // assert.equal(actual, expected, message); +}); +assert.equal(failures.length, 0, failures.join('')); +var joinThrowTests = [true, false, 7, null, {}, undefined, [], NaN]; +joinThrowTests.forEach(function(test) { + assert.throws(function() { + path.join(test); + }, TypeError); + assert.throws(function() { + path.resolve(test); + }, TypeError); +}); + + +// path normalize tests +if (isWindows) { + assert.equal(path.normalize('./fixtures///b/../b/c.js'), + 'fixtures\\b\\c.js'); + assert.equal(path.normalize('/foo/../../../bar'), '\\bar'); + assert.equal(path.normalize('a//b//../b'), 'a\\b'); + assert.equal(path.normalize('a//b//./c'), 'a\\b\\c'); + assert.equal(path.normalize('a//b//.'), 'a\\b'); + assert.equal(path.normalize('//server/share/dir/file.ext'), + '\\\\server\\share\\dir\\file.ext'); +} else { + assert.equal(path.normalize('./fixtures///b/../b/c.js'), + 'fixtures/b/c.js'); + assert.equal(path.normalize('/foo/../../../bar'), '/bar'); + assert.equal(path.normalize('a//b//../b'), 'a/b'); + assert.equal(path.normalize('a//b//./c'), 'a/b/c'); + assert.equal(path.normalize('a//b//.'), 'a/b'); +} + +// path.resolve tests +if (isWindows) { + // windows + var resolveTests = + // arguments result + [[['c:/blah\\blah', 'd:/games', 'c:../a'], 'c:\\blah\\a'], + [['c:/ignore', 'd:\\a/b\\c/d', '\\e.exe'], 'd:\\e.exe'], + [['c:/ignore', 'c:/some/file'], 'c:\\some\\file'], + [['d:/ignore', 'd:some/dir//'], 'd:\\ignore\\some\\dir'], + [['.'], process.cwd()], + [['//server/share', '..', 'relative\\'], '\\\\server\\share\\relative'], + [['c:/', '//'], 'c:\\'], + [['c:/', '//dir'], 'c:\\dir'], + [['c:/', '//server/share'], '\\\\server\\share\\'], + [['c:/', '//server//share'], '\\\\server\\share\\'], + [['c:/', '///some//dir'], 'c:\\some\\dir'] + ]; +} else { + // Posix + var resolveTests = + // arguments result + [[['/var/lib', '../', 'file/'], '/var/file'], + [['/var/lib', '/../', 'file/'], '/file'], + [['a/b/c/', '../../..'], process.cwd()], + [['.'], process.cwd()], + [['/some/dir', '.', '/absolute/'], '/absolute']]; +} +var failures = []; +resolveTests.forEach(function(test) { + var actual = path.resolve.apply(path, test[0]); + var expected = test[1]; + var message = 'path.resolve(' + test[0].map(JSON.stringify).join(',') + ')' + + '\n expect=' + JSON.stringify(expected) + + '\n actual=' + JSON.stringify(actual); + if (actual !== expected) failures.push('\n' + message); + // assert.equal(actual, expected, message); +}); +assert.equal(failures.length, 0, failures.join('')); + +// path.isAbsolute tests +if (isWindows) { + assert.equal(path.isAbsolute('//server/file'), true); + assert.equal(path.isAbsolute('\\\\server\\file'), true); + assert.equal(path.isAbsolute('C:/Users/'), true); + assert.equal(path.isAbsolute('C:\\Users\\'), true); + assert.equal(path.isAbsolute('C:cwd/another'), false); + assert.equal(path.isAbsolute('C:cwd\\another'), false); + assert.equal(path.isAbsolute('directory/directory'), false); + assert.equal(path.isAbsolute('directory\\directory'), false); +} else { + assert.equal(path.isAbsolute('/home/foo'), true); + assert.equal(path.isAbsolute('/home/foo/..'), true); + assert.equal(path.isAbsolute('bar/'), false); + assert.equal(path.isAbsolute('./baz'), false); +} + +// path.relative tests +if (isWindows) { + // windows + var relativeTests = + // arguments result + [['c:/blah\\blah', 'd:/games', 'd:\\games'], + ['c:/aaaa/bbbb', 'c:/aaaa', '..'], + ['c:/aaaa/bbbb', 'c:/cccc', '..\\..\\cccc'], + ['c:/aaaa/bbbb', 'c:/aaaa/bbbb', ''], + ['c:/aaaa/bbbb', 'c:/aaaa/cccc', '..\\cccc'], + ['c:/aaaa/', 'c:/aaaa/cccc', 'cccc'], + ['c:/', 'c:\\aaaa\\bbbb', 'aaaa\\bbbb'], + ['c:/aaaa/bbbb', 'd:\\', 'd:\\']]; +} else { + // posix + var relativeTests = + // arguments result + [['/var/lib', '/var', '..'], + ['/var/lib', '/bin', '../../bin'], + ['/var/lib', '/var/lib', ''], + ['/var/lib', '/var/apache', '../apache'], + ['/var/', '/var/lib', 'lib'], + ['/', '/var/lib', 'var/lib']]; +} +var failures = []; +relativeTests.forEach(function(test) { + var actual = path.relative(test[0], test[1]); + var expected = test[2]; + var message = 'path.relative(' + + test.slice(0, 2).map(JSON.stringify).join(',') + + ')' + + '\n expect=' + JSON.stringify(expected) + + '\n actual=' + JSON.stringify(actual); + if (actual !== expected) failures.push('\n' + message); +}); +assert.equal(failures.length, 0, failures.join('')); + +// path.sep tests +if (isWindows) { + // windows + assert.equal(path.sep, '\\'); +} else { + // posix + assert.equal(path.sep, '/'); +} + +// path.delimiter tests +if (isWindows) { + // windows + assert.equal(path.delimiter, ';'); +} else { + // posix + assert.equal(path.delimiter, ':'); +} diff --git a/node_modules/path-is-absolute/index.js b/node_modules/path-is-absolute/index.js new file mode 100644 index 000000000..22aa6c356 --- /dev/null +++ b/node_modules/path-is-absolute/index.js @@ -0,0 +1,20 @@ +'use strict'; + +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; diff --git a/node_modules/path-is-absolute/license b/node_modules/path-is-absolute/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/path-is-absolute/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/path-is-absolute/package.json b/node_modules/path-is-absolute/package.json new file mode 100644 index 000000000..743b26d97 --- /dev/null +++ b/node_modules/path-is-absolute/package.json @@ -0,0 +1,78 @@ +{ + "_from": "path-is-absolute@^1.0.1", + "_id": "path-is-absolute@1.0.1", + "_inBundle": false, + "_integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "_location": "/path-is-absolute", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "path-is-absolute@^1.0.1", + "name": "path-is-absolute", + "escapedName": "path-is-absolute", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/budo", + "/chokidar", + "/glob", + "/insert-module-globals" + ], + "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "_shasum": "174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f", + "_spec": "path-is-absolute@^1.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/path-is-absolute/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Node.js 0.12 path.isAbsolute() ponyfill", + "devDependencies": { + "xo": "^0.16.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/path-is-absolute#readme", + "keywords": [ + "path", + "paths", + "file", + "dir", + "absolute", + "isabsolute", + "is-absolute", + "built-in", + "util", + "utils", + "core", + "ponyfill", + "polyfill", + "shim", + "is", + "detect", + "check" + ], + "license": "MIT", + "name": "path-is-absolute", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-is-absolute.git" + }, + "scripts": { + "test": "xo && node test.js" + }, + "version": "1.0.1" +} diff --git a/node_modules/path-is-absolute/readme.md b/node_modules/path-is-absolute/readme.md new file mode 100644 index 000000000..8dbdf5fcb --- /dev/null +++ b/node_modules/path-is-absolute/readme.md @@ -0,0 +1,59 @@ +# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) + +> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com) + + +## Install + +``` +$ npm install --save path-is-absolute +``` + + +## Usage + +```js +const pathIsAbsolute = require('path-is-absolute'); + +// Running on Linux +pathIsAbsolute('/home/foo'); +//=> true +pathIsAbsolute('C:/Users/foo'); +//=> false + +// Running on Windows +pathIsAbsolute('C:/Users/foo'); +//=> true +pathIsAbsolute('/home/foo'); +//=> false + +// Running on any OS +pathIsAbsolute.posix('/home/foo'); +//=> true +pathIsAbsolute.posix('C:/Users/foo'); +//=> false +pathIsAbsolute.win32('C:/Users/foo'); +//=> true +pathIsAbsolute.win32('/home/foo'); +//=> false +``` + + +## API + +See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). + +### pathIsAbsolute(path) + +### pathIsAbsolute.posix(path) + +POSIX specific version. + +### pathIsAbsolute.win32(path) + +Windows specific version. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/path-key/index.js b/node_modules/path-key/index.js new file mode 100644 index 000000000..62c8250ab --- /dev/null +++ b/node_modules/path-key/index.js @@ -0,0 +1,13 @@ +'use strict'; +module.exports = opts => { + opts = opts || {}; + + const env = opts.env || process.env; + const platform = opts.platform || process.platform; + + if (platform !== 'win32') { + return 'PATH'; + } + + return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path'; +}; diff --git a/node_modules/path-key/license b/node_modules/path-key/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/path-key/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/path-key/package.json b/node_modules/path-key/package.json new file mode 100644 index 000000000..b71aeddba --- /dev/null +++ b/node_modules/path-key/package.json @@ -0,0 +1,72 @@ +{ + "_from": "path-key@^2.0.1", + "_id": "path-key@2.0.1", + "_inBundle": false, + "_integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "_location": "/path-key", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "path-key@^2.0.1", + "name": "path-key", + "escapedName": "path-key", + "rawSpec": "^2.0.1", + "saveSpec": null, + "fetchSpec": "^2.0.1" + }, + "_requiredBy": [ + "/cross-spawn", + "/npm-run-path" + ], + "_resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "_shasum": "411cadb574c5a140d3a4b1910d40d80cc9f40b40", + "_spec": "path-key@^2.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/cross-spawn", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/path-key/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Get the PATH environment variable key cross-platform", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/path-key#readme", + "keywords": [ + "path", + "key", + "environment", + "env", + "variable", + "var", + "get", + "cross-platform", + "windows" + ], + "license": "MIT", + "name": "path-key", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-key.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.1", + "xo": { + "esnext": true + } +} diff --git a/node_modules/path-key/readme.md b/node_modules/path-key/readme.md new file mode 100644 index 000000000..cb5710aac --- /dev/null +++ b/node_modules/path-key/readme.md @@ -0,0 +1,51 @@ +# path-key [![Build Status](https://travis-ci.org/sindresorhus/path-key.svg?branch=master)](https://travis-ci.org/sindresorhus/path-key) + +> Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform + +It's usually `PATH`, but on Windows it can be any casing like `Path`... + + +## Install + +``` +$ npm install --save path-key +``` + + +## Usage + +```js +const pathKey = require('path-key'); + +const key = pathKey(); +//=> 'PATH' + +const PATH = process.env[key]; +//=> '/usr/local/bin:/usr/bin:/bin' +``` + + +## API + +### pathKey([options]) + +#### options + +##### env + +Type: `Object`
+Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env) + +Use a custom environment variables object. + +#### platform + +Type: `string`
+Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform) + +Get the PATH key for a specific platform. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/path-parse/.travis.yml b/node_modules/path-parse/.travis.yml new file mode 100644 index 000000000..dae31da96 --- /dev/null +++ b/node_modules/path-parse/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +node_js: + - "0.12" + - "0.11" + - "0.10" + - "0.10.12" + - "0.8" + - "0.6" + - "iojs" diff --git a/node_modules/path-parse/LICENSE b/node_modules/path-parse/LICENSE new file mode 100644 index 000000000..810f3dbea --- /dev/null +++ b/node_modules/path-parse/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Javier Blanco + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/path-parse/README.md b/node_modules/path-parse/README.md new file mode 100644 index 000000000..05097f86a --- /dev/null +++ b/node_modules/path-parse/README.md @@ -0,0 +1,42 @@ +# path-parse [![Build Status](https://travis-ci.org/jbgutierrez/path-parse.svg?branch=master)](https://travis-ci.org/jbgutierrez/path-parse) + +> Node.js [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) [ponyfill](https://ponyfill.com). + +## Install + +``` +$ npm install --save path-parse +``` + +## Usage + +```js +var pathParse = require('path-parse'); + +pathParse('/home/user/dir/file.txt'); +//=> { +// root : "/", +// dir : "/home/user/dir", +// base : "file.txt", +// ext : ".txt", +// name : "file" +// } +``` + +## API + +See [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) docs. + +### pathParse(path) + +### pathParse.posix(path) + +The Posix specific version. + +### pathParse.win32(path) + +The Windows specific version. + +## License + +MIT © [Javier Blanco](http://jbgutierrez.info) diff --git a/node_modules/path-parse/index.js b/node_modules/path-parse/index.js new file mode 100644 index 000000000..3b7601fe4 --- /dev/null +++ b/node_modules/path-parse/index.js @@ -0,0 +1,93 @@ +'use strict'; + +var isWindows = process.platform === 'win32'; + +// Regex to split a windows path into three parts: [*, device, slash, +// tail] windows-only +var splitDeviceRe = + /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + +// Regex to split the tail part of the above into [*, dir, basename, ext] +var splitTailRe = + /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/; + +var win32 = {}; + +// Function to split a filename into [root, dir, basename, ext] +function win32SplitPath(filename) { + // Separate device+slash from tail + var result = splitDeviceRe.exec(filename), + device = (result[1] || '') + (result[2] || ''), + tail = result[3] || ''; + // Split the tail into dir, basename and extension + var result2 = splitTailRe.exec(tail), + dir = result2[1], + basename = result2[2], + ext = result2[3]; + return [device, dir, basename, ext]; +} + +win32.parse = function(pathString) { + if (typeof pathString !== 'string') { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = win32SplitPath(pathString); + if (!allParts || allParts.length !== 4) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + return { + root: allParts[0], + dir: allParts[0] + allParts[1].slice(0, -1), + base: allParts[2], + ext: allParts[3], + name: allParts[2].slice(0, allParts[2].length - allParts[3].length) + }; +}; + + + +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = + /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; +var posix = {}; + + +function posixSplitPath(filename) { + return splitPathRe.exec(filename).slice(1); +} + + +posix.parse = function(pathString) { + if (typeof pathString !== 'string') { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = posixSplitPath(pathString); + if (!allParts || allParts.length !== 4) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + allParts[1] = allParts[1] || ''; + allParts[2] = allParts[2] || ''; + allParts[3] = allParts[3] || ''; + + return { + root: allParts[0], + dir: allParts[0] + allParts[1].slice(0, -1), + base: allParts[2], + ext: allParts[3], + name: allParts[2].slice(0, allParts[2].length - allParts[3].length) + }; +}; + + +if (isWindows) + module.exports = win32.parse; +else /* posix */ + module.exports = posix.parse; + +module.exports.posix = posix.parse; +module.exports.win32 = win32.parse; diff --git a/node_modules/path-parse/package.json b/node_modules/path-parse/package.json new file mode 100644 index 000000000..7116c65c0 --- /dev/null +++ b/node_modules/path-parse/package.json @@ -0,0 +1,61 @@ +{ + "_from": "path-parse@^1.0.5", + "_id": "path-parse@1.0.6", + "_inBundle": false, + "_integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "_location": "/path-parse", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "path-parse@^1.0.5", + "name": "path-parse", + "escapedName": "path-parse", + "rawSpec": "^1.0.5", + "saveSpec": null, + "fetchSpec": "^1.0.5" + }, + "_requiredBy": [ + "/resolve" + ], + "_resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "_shasum": "d62dbb5679405d72c4737ec58600e9ddcf06d24c", + "_spec": "path-parse@^1.0.5", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/resolve", + "author": { + "name": "Javier Blanco", + "email": "http://jbgutierrez.info" + }, + "bugs": { + "url": "https://github.com/jbgutierrez/path-parse/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Node.js path.parse() ponyfill", + "homepage": "https://github.com/jbgutierrez/path-parse#readme", + "keywords": [ + "path", + "paths", + "file", + "dir", + "parse", + "built-in", + "util", + "utils", + "core", + "ponyfill", + "polyfill", + "shim" + ], + "license": "MIT", + "main": "index.js", + "name": "path-parse", + "repository": { + "type": "git", + "url": "git+https://github.com/jbgutierrez/path-parse.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.6" +} diff --git a/node_modules/path-parse/test.js b/node_modules/path-parse/test.js new file mode 100644 index 000000000..0b30c1239 --- /dev/null +++ b/node_modules/path-parse/test.js @@ -0,0 +1,77 @@ +var assert = require('assert'); +var pathParse = require('./index'); + +var winParseTests = [ + [{ root: 'C:\\', dir: 'C:\\path\\dir', base: 'index.html', ext: '.html', name: 'index' }, 'C:\\path\\dir\\index.html'], + [{ root: 'C:\\', dir: 'C:\\another_path\\DIR\\1\\2\\33', base: 'index', ext: '', name: 'index' }, 'C:\\another_path\\DIR\\1\\2\\33\\index'], + [{ root: '', dir: 'another_path\\DIR with spaces\\1\\2\\33', base: 'index', ext: '', name: 'index' }, 'another_path\\DIR with spaces\\1\\2\\33\\index'], + [{ root: '\\', dir: '\\foo', base: 'C:', ext: '', name: 'C:' }, '\\foo\\C:'], + [{ root: '', dir: '', base: 'file', ext: '', name: 'file' }, 'file'], + [{ root: '', dir: '.', base: 'file', ext: '', name: 'file' }, '.\\file'], + + // unc + [{ root: '\\\\server\\share\\', dir: '\\\\server\\share\\', base: 'file_path', ext: '', name: 'file_path' }, '\\\\server\\share\\file_path'], + [{ root: '\\\\server two\\shared folder\\', dir: '\\\\server two\\shared folder\\', base: 'file path.zip', ext: '.zip', name: 'file path' }, '\\\\server two\\shared folder\\file path.zip'], + [{ root: '\\\\teela\\admin$\\', dir: '\\\\teela\\admin$\\', base: 'system32', ext: '', name: 'system32' }, '\\\\teela\\admin$\\system32'], + [{ root: '\\\\?\\UNC\\', dir: '\\\\?\\UNC\\server', base: 'share', ext: '', name: 'share' }, '\\\\?\\UNC\\server\\share'] +]; + +var winSpecialCaseFormatTests = [ + [{dir: 'some\\dir'}, 'some\\dir\\'], + [{base: 'index.html'}, 'index.html'], + [{}, ''] +]; + +var unixParseTests = [ + [{ root: '/', dir: '/home/user/dir', base: 'file.txt', ext: '.txt', name: 'file' }, '/home/user/dir/file.txt'], + [{ root: '/', dir: '/home/user/a dir', base: 'another File.zip', ext: '.zip', name: 'another File' }, '/home/user/a dir/another File.zip'], + [{ root: '/', dir: '/home/user/a dir/', base: 'another&File.', ext: '.', name: 'another&File' }, '/home/user/a dir//another&File.'], + [{ root: '/', dir: '/home/user/a$$$dir/', base: 'another File.zip', ext: '.zip', name: 'another File' }, '/home/user/a$$$dir//another File.zip'], + [{ root: '', dir: 'user/dir', base: 'another File.zip', ext: '.zip', name: 'another File' }, 'user/dir/another File.zip'], + [{ root: '', dir: '', base: 'file', ext: '', name: 'file' }, 'file'], + [{ root: '', dir: '', base: '.\\file', ext: '', name: '.\\file' }, '.\\file'], + [{ root: '', dir: '.', base: 'file', ext: '', name: 'file' }, './file'], + [{ root: '', dir: '', base: 'C:\\foo', ext: '', name: 'C:\\foo' }, 'C:\\foo'] +]; + +var unixSpecialCaseFormatTests = [ + [{dir: 'some/dir'}, 'some/dir/'], + [{base: 'index.html'}, 'index.html'], + [{}, ''] +]; + +var errors = [ + {input: null, message: /Parameter 'pathString' must be a string, not/}, + {input: {}, message: /Parameter 'pathString' must be a string, not object/}, + {input: true, message: /Parameter 'pathString' must be a string, not boolean/}, + {input: 1, message: /Parameter 'pathString' must be a string, not number/}, + {input: undefined, message: /Parameter 'pathString' must be a string, not undefined/}, +]; + +checkParseFormat(pathParse.win32, winParseTests); +checkParseFormat(pathParse.posix, unixParseTests); +checkErrors(pathParse.win32); +checkErrors(pathParse.posix); + +function checkErrors(parse) { + errors.forEach(function(errorCase) { + try { + parse(errorCase.input); + } catch(err) { + assert.ok(err instanceof TypeError); + assert.ok( + errorCase.message.test(err.message), + 'expected ' + errorCase.message + ' to match ' + err.message + ); + return; + } + + assert.fail('should have thrown'); + }); +} + +function checkParseFormat(parse, testCases) { + testCases.forEach(function(testCase) { + assert.deepEqual(parse(testCase[1]), testCase[0]); + }); +} diff --git a/node_modules/path-platform/LICENSE b/node_modules/path-platform/LICENSE new file mode 100644 index 000000000..cfa529ec7 --- /dev/null +++ b/node_modules/path-platform/LICENSE @@ -0,0 +1,3 @@ +MIT -- see https://github.com/joyent/node for license + +This file is pulled directly from Node.js diff --git a/node_modules/path-platform/README.md b/node_modules/path-platform/README.md new file mode 100644 index 000000000..9892dbdcf --- /dev/null +++ b/node_modules/path-platform/README.md @@ -0,0 +1,5 @@ +# path-platform + +This is a transitional package for those not on 0.12 that provides a compatible +interface to the builtin `path` module, but adds `path.posix` and `path.win32` +so you can `path.posix.normalize` on a win32 platform, or vice versa. diff --git a/node_modules/path-platform/package.json b/node_modules/path-platform/package.json new file mode 100644 index 000000000..42342bd5e --- /dev/null +++ b/node_modules/path-platform/package.json @@ -0,0 +1,54 @@ +{ + "_from": "path-platform@~0.11.15", + "_id": "path-platform@0.11.15", + "_inBundle": false, + "_integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=", + "_location": "/path-platform", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "path-platform@~0.11.15", + "name": "path-platform", + "escapedName": "path-platform", + "rawSpec": "~0.11.15", + "saveSpec": null, + "fetchSpec": "~0.11.15" + }, + "_requiredBy": [ + "/parents" + ], + "_resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", + "_shasum": "e864217f74c36850f0852b78dc7bf7d4a5721bf2", + "_spec": "path-platform@~0.11.15", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/parents", + "author": { + "name": "Timothy J Fontaine", + "email": "tjfontaine@gmail.com", + "url": "http://atxconsulting.com" + }, + "bugs": { + "url": "http://github.com/tjfontaine/node-path-platform/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Provide access to win32 and posix path operations; sourced directly from upstream Node.js", + "engines": { + "node": ">= 0.8.0" + }, + "homepage": "http://github.com/tjfontaine/node-path-platform", + "keywords": [ + "path", + "platform", + "posix", + "win32" + ], + "license": "MIT", + "main": "path.js", + "name": "path-platform", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/tjfontaine/node-path-platform.git" + }, + "version": "0.11.15" +} diff --git a/node_modules/path-platform/path.js b/node_modules/path-platform/path.js new file mode 100644 index 000000000..0a7a7075c --- /dev/null +++ b/node_modules/path-platform/path.js @@ -0,0 +1,643 @@ +// 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 isWindows = process.platform === 'win32'; +var util = require('util'); + +var _path = require('path'); + +// we are new enough we already have this from the system, just export the +// system then +if (_path.posix) { + module.exports = _path; + return; +} + +// resolves . and .. elements in a path array with directory names there +// must be no slashes 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) { + var res = []; + for (var i = 0; i < parts.length; i++) { + var p = parts[i]; + + // ignore empty parts + if (!p || p === '.') + continue; + + if (p === '..') { + if (res.length && res[res.length - 1] !== '..') { + res.pop(); + } else if (allowAboveRoot) { + res.push('..'); + } + } else { + res.push(p); + } + } + + return res; +} + +// Regex to split a windows path into three parts: [*, device, slash, +// tail] windows-only +var splitDeviceRe = + /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + +// Regex to split the tail part of the above into [*, dir, basename, ext] +var splitTailRe = + /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/; + +var win32 = {}; + +// Function to split a filename into [root, dir, basename, ext] +function win32SplitPath(filename) { + // Separate device+slash from tail + var result = splitDeviceRe.exec(filename), + device = (result[1] || '') + (result[2] || ''), + tail = result[3] || ''; + // Split the tail into dir, basename and extension + var result2 = splitTailRe.exec(tail), + dir = result2[1], + basename = result2[2], + ext = result2[3]; + return [device, dir, basename, ext]; +} + +var normalizeUNCRoot = function(device) { + return '\\\\' + device.replace(/^[\\\/]+/, '').replace(/[\\\/]+/g, '\\'); +}; + +// path.resolve([from ...], to) +win32.resolve = function() { + var resolvedDevice = '', + resolvedTail = '', + resolvedAbsolute = false; + + for (var i = arguments.length - 1; i >= -1; i--) { + var path; + if (i >= 0) { + path = arguments[i]; + } else if (!resolvedDevice) { + path = process.cwd(); + } else { + // Windows has the concept of drive-specific current working + // directories. If we've resolved a drive letter but not yet an + // absolute path, get cwd for that drive. We're sure the device is not + // an unc path at this points, because unc paths are always absolute. + path = process.env['=' + resolvedDevice]; + // Verify that a drive-local cwd was found and that it actually points + // to our drive. If not, default to the drive's root. + if (!path || path.substr(0, 3).toLowerCase() !== + resolvedDevice.toLowerCase() + '\\') { + path = resolvedDevice + '\\'; + } + } + + // Skip empty and invalid entries + if (!util.isString(path)) { + throw new TypeError('Arguments to path.resolve must be strings'); + } else if (!path) { + continue; + } + + var result = splitDeviceRe.exec(path), + device = result[1] || '', + isUnc = device && device.charAt(1) !== ':', + isAbsolute = win32.isAbsolute(path), + tail = result[3]; + + if (device && + resolvedDevice && + device.toLowerCase() !== resolvedDevice.toLowerCase()) { + // This path points to another device so it is not applicable + continue; + } + + if (!resolvedDevice) { + resolvedDevice = device; + } + if (!resolvedAbsolute) { + resolvedTail = tail + '\\' + resolvedTail; + resolvedAbsolute = isAbsolute; + } + + if (resolvedDevice && resolvedAbsolute) { + break; + } + } + + // Convert slashes to backslashes when `resolvedDevice` points to an UNC + // root. Also squash multiple slashes into a single one where appropriate. + if (isUnc) { + resolvedDevice = normalizeUNCRoot(resolvedDevice); + } + + // 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 tail path + resolvedTail = normalizeArray(resolvedTail.split(/[\\\/]+/), + !resolvedAbsolute).join('\\'); + + // If device is a drive letter, we'll normalize to lower case. + if (resolvedDevice && resolvedDevice.charAt(1) === ':') { + resolvedDevice = resolvedDevice[0].toLowerCase() + + resolvedDevice.substr(1); + } + + return (resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail) || + '.'; +}; + + +win32.normalize = function(path) { + var result = splitDeviceRe.exec(path), + device = result[1] || '', + isUnc = device && device.charAt(1) !== ':', + isAbsolute = win32.isAbsolute(path), + tail = result[3], + trailingSlash = /[\\\/]$/.test(tail); + + // If device is a drive letter, we'll normalize to lower case. + if (device && device.charAt(1) === ':') { + device = device[0].toLowerCase() + device.substr(1); + } + + // Normalize the tail path + tail = normalizeArray(tail.split(/[\\\/]+/), !isAbsolute).join('\\'); + + if (!tail && !isAbsolute) { + tail = '.'; + } + if (tail && trailingSlash) { + tail += '\\'; + } + + // Convert slashes to backslashes when `device` points to an UNC root. + // Also squash multiple slashes into a single one where appropriate. + if (isUnc) { + device = normalizeUNCRoot(device); + } + + return device + (isAbsolute ? '\\' : '') + tail; +}; + + +win32.isAbsolute = function(path) { + var result = splitDeviceRe.exec(path), + device = result[1] || '', + isUnc = !!device && device.charAt(1) !== ':'; + // UNC paths are always absolute + return !!result[2] || isUnc; +}; + +win32.join = function() { + function f(p) { + if (!util.isString(p)) { + throw new TypeError('Arguments to path.join must be strings'); + } + return p; + } + + var paths = Array.prototype.filter.call(arguments, f); + var joined = paths.join('\\'); + + // Make sure that the joined path doesn't start with two slashes, because + // normalize() will mistake it for an UNC path then. + // + // This step is skipped when it is very clear that the user actually + // intended to point at an UNC path. This is assumed when the first + // non-empty string arguments starts with exactly two slashes followed by + // at least one more non-slash character. + // + // Note that for normalize() to treat a path as an UNC path it needs to + // have at least 2 components, so we don't filter for that here. + // This means that the user can use join to construct UNC paths from + // a server name and a share name; for example: + // path.join('//server', 'share') -> '\\\\server\\share\') + if (!/^[\\\/]{2}[^\\\/]/.test(paths[0])) { + joined = joined.replace(/^[\\\/]{2,}/, '\\'); + } + + return win32.normalize(joined); +}; + + +// path.relative(from, to) +// it will solve the relative path from 'from' to 'to', for instance: +// from = 'C:\\orandea\\test\\aaa' +// to = 'C:\\orandea\\impl\\bbb' +// The output of the function should be: '..\\..\\impl\\bbb' +win32.relative = function(from, to) { + from = win32.resolve(from); + to = win32.resolve(to); + + // windows is not case sensitive + var lowerFrom = from.toLowerCase(); + var lowerTo = to.toLowerCase(); + + 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 + 1); + } + + var toParts = trim(to.split('\\')); + + var lowerFromParts = trim(lowerFrom.split('\\')); + var lowerToParts = trim(lowerTo.split('\\')); + + var length = Math.min(lowerFromParts.length, lowerToParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (lowerFromParts[i] !== lowerToParts[i]) { + samePartsLength = i; + break; + } + } + + if (samePartsLength == 0) { + return to; + } + + var outputParts = []; + for (var i = samePartsLength; i < lowerFromParts.length; i++) { + outputParts.push('..'); + } + + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + + return outputParts.join('\\'); +}; + + +win32._makeLong = function(path) { + // Note: this will *probably* throw somewhere. + if (!util.isString(path)) + return path; + + if (!path) { + return ''; + } + + var resolvedPath = win32.resolve(path); + + if (/^[a-zA-Z]\:\\/.test(resolvedPath)) { + // path is local filesystem path, which needs to be converted + // to long UNC path. + return '\\\\?\\' + resolvedPath; + } else if (/^\\\\[^?.]/.test(resolvedPath)) { + // path is network UNC path, which needs to be converted + // to long UNC path. + return '\\\\?\\UNC\\' + resolvedPath.substring(2); + } + + return path; +}; + + +win32.dirname = function(path) { + var result = win32SplitPath(path), + root = result[0], + dir = result[1]; + + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.substr(0, dir.length - 1); + } + + return root + dir; +}; + + +win32.basename = function(path, ext) { + var f = win32SplitPath(path)[2]; + // TODO: make this comparison case-insensitive on windows? + if (ext && f.substr(-1 * ext.length) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; +}; + + +win32.extname = function(path) { + return win32SplitPath(path)[3]; +}; + + +win32.format = function(pathObject) { + if (!util.isObject(pathObject)) { + throw new TypeError( + "Parameter 'pathObject' must be an object, not " + typeof pathObject + ); + } + + var root = pathObject.root || ''; + + if (!util.isString(root)) { + throw new TypeError( + "'pathObject.root' must be a string or undefined, not " + + typeof pathObject.root + ); + } + + var dir = pathObject.dir; + var base = pathObject.base || ''; + if (dir.slice(dir.length - 1, dir.length) === win32.sep) { + return dir + base; + } + + if (dir) { + return dir + win32.sep + base; + } + + return base; +}; + + +win32.parse = function(pathString) { + if (!util.isString(pathString)) { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = win32SplitPath(pathString); + if (!allParts || allParts.length !== 4) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + return { + root: allParts[0], + dir: allParts[0] + allParts[1].slice(0, allParts[1].length - 1), + base: allParts[2], + ext: allParts[3], + name: allParts[2].slice(0, allParts[2].length - allParts[3].length) + }; +}; + + +win32.sep = '\\'; +win32.delimiter = ';'; + + +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = + /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; +var posix = {}; + + +function posixSplitPath(filename) { + return splitPathRe.exec(filename).slice(1); +} + + +// path.resolve([from ...], to) +// posix version +posix.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 (!util.isString(path)) { + 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(resolvedPath.split('/'), + !resolvedAbsolute).join('/'); + + return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; +}; + +// path.normalize(path) +// posix version +posix.normalize = function(path) { + var isAbsolute = posix.isAbsolute(path), + trailingSlash = path.substr(-1) === '/'; + + // Normalize the path + path = normalizeArray(path.split('/'), !isAbsolute).join('/'); + + if (!path && !isAbsolute) { + path = '.'; + } + if (path && trailingSlash) { + path += '/'; + } + + return (isAbsolute ? '/' : '') + path; +}; + +// posix version +posix.isAbsolute = function(path) { + return path.charAt(0) === '/'; +}; + +// posix version +posix.join = function() { + var path = ''; + for (var i = 0; i < arguments.length; i++) { + var segment = arguments[i]; + if (!util.isString(segment)) { + throw new TypeError('Arguments to path.join must be strings'); + } + if (segment) { + if (!path) { + path += segment; + } else { + path += '/' + segment; + } + } + } + return posix.normalize(path); +}; + + +// path.relative(from, to) +// posix version +posix.relative = function(from, to) { + from = posix.resolve(from).substr(1); + to = posix.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 + 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('/'); +}; + + +posix._makeLong = function(path) { + return path; +}; + + +posix.dirname = function(path) { + var result = posixSplitPath(path), + root = result[0], + dir = result[1]; + + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.substr(0, dir.length - 1); + } + + return root + dir; +}; + + +posix.basename = function(path, ext) { + var f = posixSplitPath(path)[2]; + // TODO: make this comparison case-insensitive on windows? + if (ext && f.substr(-1 * ext.length) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; +}; + + +posix.extname = function(path) { + return posixSplitPath(path)[3]; +}; + + +posix.format = function(pathObject) { + if (!util.isObject(pathObject)) { + throw new TypeError( + "Parameter 'pathObject' must be an object, not " + typeof pathObject + ); + } + + var root = pathObject.root || ''; + + if (!util.isString(root)) { + throw new TypeError( + "'pathObject.root' must be a string or undefined, not " + + typeof pathObject.root + ); + } + + var dir = pathObject.dir ? pathObject.dir + posix.sep : ''; + var base = pathObject.base || ''; + return dir + base; +}; + + +posix.parse = function(pathString) { + if (!util.isString(pathString)) { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = posixSplitPath(pathString); + if (!allParts || allParts.length !== 4) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + allParts[1] = allParts[1] || ''; + allParts[2] = allParts[2] || ''; + allParts[3] = allParts[3] || ''; + + return { + root: allParts[0], + dir: allParts[0] + allParts[1].slice(0, allParts[1].length - 1), + base: allParts[2], + ext: allParts[3], + name: allParts[2].slice(0, allParts[2].length - allParts[3].length) + }; +}; + + +posix.sep = '/'; +posix.delimiter = ':'; + + +if (isWindows) + module.exports = win32; +else /* posix */ + module.exports = posix; + +module.exports.posix = posix; +module.exports.win32 = win32; diff --git a/node_modules/pbkdf2/LICENSE b/node_modules/pbkdf2/LICENSE new file mode 100644 index 000000000..a115b5242 --- /dev/null +++ b/node_modules/pbkdf2/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Daniel Cousens + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/pbkdf2/README.md b/node_modules/pbkdf2/README.md new file mode 100644 index 000000000..614934f72 --- /dev/null +++ b/node_modules/pbkdf2/README.md @@ -0,0 +1,30 @@ +# pbkdf2 + +[![NPM Package](https://img.shields.io/npm/v/pbkdf2.svg?style=flat-square)](https://www.npmjs.org/package/pbkdf2) +[![Build Status](https://img.shields.io/travis/crypto-browserify/pbkdf2.svg?branch=master&style=flat-square)](https://travis-ci.org/crypto-browserify/pbkdf2) +[![Dependency status](https://img.shields.io/david/crypto-browserify/pbkdf2.svg?style=flat-square)](https://david-dm.org/crypto-browserify/pbkdf2#info=dependencies) + +[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) + +This library provides the functionality of PBKDF2 with the ability to use any supported hashing algorithm returned from `crypto.getHashes()` + + +## Usage + +```js +var pbkdf2 = require('pbkdf2') +var derivedKey = pbkdf2.pbkdf2Sync('password', 'salt', 1, 32, 'sha512') + +... +``` + +For more information on the API, please see the relevant [Node documentation](https://nodejs.org/api/crypto.html#crypto_crypto_pbkdf2_password_salt_iterations_keylen_digest_callback). + +For high performance, use the `async` variant (`pbkdf2.pbkdf2`), not `pbkdf2.pbkdf2Sync`, this variant has the oppurtunity to use `window.crypto.subtle` when browserified. + + +## Credits + +This module is a derivative of [cryptocoinjs/pbkdf2-sha256](https://github.com/cryptocoinjs/pbkdf2-sha256/), so thanks to [JP Richardson](https://github.com/jprichardson/) for laying the ground work. + +Thank you to [FangDun Cai](https://github.com/fundon) for donating the package name on npm, if you're looking for his previous module it is located at [fundon/pbkdf2](https://github.com/fundon/pbkdf2). diff --git a/node_modules/pbkdf2/browser.js b/node_modules/pbkdf2/browser.js new file mode 100644 index 000000000..ac5fdd8d6 --- /dev/null +++ b/node_modules/pbkdf2/browser.js @@ -0,0 +1,2 @@ +exports.pbkdf2 = require('./lib/async') +exports.pbkdf2Sync = require('./lib/sync') diff --git a/node_modules/pbkdf2/index.js b/node_modules/pbkdf2/index.js new file mode 100644 index 000000000..fc2f8d96f --- /dev/null +++ b/node_modules/pbkdf2/index.js @@ -0,0 +1,31 @@ +var checkParameters = require('./lib/precondition') +var native = require('crypto') + +function nativePBKDF2 (password, salt, iterations, keylen, digest, callback) { + checkParameters(password, salt, iterations, keylen) + + if (typeof digest === 'function') { + callback = digest + digest = 'sha1' + } + if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2') + + return native.pbkdf2(password, salt, iterations, keylen, digest, callback) +} + +function nativePBKDF2Sync (password, salt, iterations, keylen, digest) { + checkParameters(password, salt, iterations, keylen) + digest = digest || 'sha1' + return native.pbkdf2Sync(password, salt, iterations, keylen, digest) +} + +/* istanbul ignore next */ +if (!native.pbkdf2Sync || native.pbkdf2Sync.toString().indexOf('keylen, digest') === -1) { + exports.pbkdf2Sync = require('./lib/sync') + exports.pbkdf2 = require('./lib/async') + +// native +} else { + exports.pbkdf2Sync = nativePBKDF2Sync + exports.pbkdf2 = nativePBKDF2 +} diff --git a/node_modules/pbkdf2/lib/async.js b/node_modules/pbkdf2/lib/async.js new file mode 100644 index 000000000..b20da7c8b --- /dev/null +++ b/node_modules/pbkdf2/lib/async.js @@ -0,0 +1,100 @@ +var checkParameters = require('./precondition') +var defaultEncoding = require('./default-encoding') +var sync = require('./sync') +var Buffer = require('safe-buffer').Buffer + +var ZERO_BUF +var subtle = global.crypto && global.crypto.subtle +var toBrowser = { + 'sha': 'SHA-1', + 'sha-1': 'SHA-1', + 'sha1': 'SHA-1', + 'sha256': 'SHA-256', + 'sha-256': 'SHA-256', + 'sha384': 'SHA-384', + 'sha-384': 'SHA-384', + 'sha-512': 'SHA-512', + 'sha512': 'SHA-512' +} +var checks = [] +function checkNative (algo) { + if (global.process && !global.process.browser) { + return Promise.resolve(false) + } + if (!subtle || !subtle.importKey || !subtle.deriveBits) { + return Promise.resolve(false) + } + if (checks[algo] !== undefined) { + return checks[algo] + } + ZERO_BUF = ZERO_BUF || Buffer.alloc(8) + var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo) + .then(function () { + return true + }).catch(function () { + return false + }) + checks[algo] = prom + return prom +} + +function browserPbkdf2 (password, salt, iterations, length, algo) { + return subtle.importKey( + 'raw', password, {name: 'PBKDF2'}, false, ['deriveBits'] + ).then(function (key) { + return subtle.deriveBits({ + name: 'PBKDF2', + salt: salt, + iterations: iterations, + hash: { + name: algo + } + }, key, length << 3) + }).then(function (res) { + return Buffer.from(res) + }) +} + +function resolvePromise (promise, callback) { + promise.then(function (out) { + process.nextTick(function () { + callback(null, out) + }) + }, function (e) { + process.nextTick(function () { + callback(e) + }) + }) +} +module.exports = function (password, salt, iterations, keylen, digest, callback) { + if (typeof digest === 'function') { + callback = digest + digest = undefined + } + + digest = digest || 'sha1' + var algo = toBrowser[digest.toLowerCase()] + + if (!algo || typeof global.Promise !== 'function') { + return process.nextTick(function () { + var out + try { + out = sync(password, salt, iterations, keylen, digest) + } catch (e) { + return callback(e) + } + callback(null, out) + }) + } + + checkParameters(password, salt, iterations, keylen) + if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2') + if (!Buffer.isBuffer(password)) password = Buffer.from(password, defaultEncoding) + if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, defaultEncoding) + + resolvePromise(checkNative(algo).then(function (resp) { + if (resp) return browserPbkdf2(password, salt, iterations, keylen, algo) + + return sync(password, salt, iterations, keylen, digest) + }), callback) +} diff --git a/node_modules/pbkdf2/lib/default-encoding.js b/node_modules/pbkdf2/lib/default-encoding.js new file mode 100644 index 000000000..13b8db92f --- /dev/null +++ b/node_modules/pbkdf2/lib/default-encoding.js @@ -0,0 +1,10 @@ +var defaultEncoding +/* istanbul ignore next */ +if (process.browser) { + defaultEncoding = 'utf-8' +} else { + var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10) + + defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary' +} +module.exports = defaultEncoding diff --git a/node_modules/pbkdf2/lib/precondition.js b/node_modules/pbkdf2/lib/precondition.js new file mode 100644 index 000000000..683db5630 --- /dev/null +++ b/node_modules/pbkdf2/lib/precondition.js @@ -0,0 +1,28 @@ +var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs + +function checkBuffer (buf, name) { + if (typeof buf !== 'string' && !Buffer.isBuffer(buf)) { + throw new TypeError(name + ' must be a buffer or string') + } +} + +module.exports = function (password, salt, iterations, keylen) { + checkBuffer(password, 'Password') + checkBuffer(salt, 'Salt') + + if (typeof iterations !== 'number') { + throw new TypeError('Iterations not a number') + } + + if (iterations < 0) { + throw new TypeError('Bad iterations') + } + + if (typeof keylen !== 'number') { + throw new TypeError('Key length not a number') + } + + if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */ + throw new TypeError('Bad key length') + } +} diff --git a/node_modules/pbkdf2/lib/sync-browser.js b/node_modules/pbkdf2/lib/sync-browser.js new file mode 100644 index 000000000..55c8c6d34 --- /dev/null +++ b/node_modules/pbkdf2/lib/sync-browser.js @@ -0,0 +1,104 @@ +var md5 = require('create-hash/md5') +var RIPEMD160 = require('ripemd160') +var sha = require('sha.js') + +var checkParameters = require('./precondition') +var defaultEncoding = require('./default-encoding') +var Buffer = require('safe-buffer').Buffer +var ZEROS = Buffer.alloc(128) +var sizes = { + md5: 16, + sha1: 20, + sha224: 28, + sha256: 32, + sha384: 48, + sha512: 64, + rmd160: 20, + ripemd160: 20 +} + +function Hmac (alg, key, saltLen) { + var hash = getDigest(alg) + var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64 + + if (key.length > blocksize) { + key = hash(key) + } else if (key.length < blocksize) { + key = Buffer.concat([key, ZEROS], blocksize) + } + + var ipad = Buffer.allocUnsafe(blocksize + sizes[alg]) + var opad = Buffer.allocUnsafe(blocksize + sizes[alg]) + for (var i = 0; i < blocksize; i++) { + ipad[i] = key[i] ^ 0x36 + opad[i] = key[i] ^ 0x5C + } + + var ipad1 = Buffer.allocUnsafe(blocksize + saltLen + 4) + ipad.copy(ipad1, 0, 0, blocksize) + this.ipad1 = ipad1 + this.ipad2 = ipad + this.opad = opad + this.alg = alg + this.blocksize = blocksize + this.hash = hash + this.size = sizes[alg] +} + +Hmac.prototype.run = function (data, ipad) { + data.copy(ipad, this.blocksize) + var h = this.hash(ipad) + h.copy(this.opad, this.blocksize) + return this.hash(this.opad) +} + +function getDigest (alg) { + function shaFunc (data) { + return sha(alg).update(data).digest() + } + function rmd160Func (data) { + return new RIPEMD160().update(data).digest() + } + + if (alg === 'rmd160' || alg === 'ripemd160') return rmd160Func + if (alg === 'md5') return md5 + return shaFunc +} + +function pbkdf2 (password, salt, iterations, keylen, digest) { + checkParameters(password, salt, iterations, keylen) + + if (!Buffer.isBuffer(password)) password = Buffer.from(password, defaultEncoding) + if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, defaultEncoding) + + digest = digest || 'sha1' + + var hmac = new Hmac(digest, password, salt.length) + + var DK = Buffer.allocUnsafe(keylen) + var block1 = Buffer.allocUnsafe(salt.length + 4) + salt.copy(block1, 0, 0, salt.length) + + var destPos = 0 + var hLen = sizes[digest] + var l = Math.ceil(keylen / hLen) + + for (var i = 1; i <= l; i++) { + block1.writeUInt32BE(i, salt.length) + + var T = hmac.run(block1, hmac.ipad1) + var U = T + + for (var j = 1; j < iterations; j++) { + U = hmac.run(U, hmac.ipad2) + for (var k = 0; k < hLen; k++) T[k] ^= U[k] + } + + T.copy(DK, destPos) + destPos += hLen + } + + return DK +} + +module.exports = pbkdf2 diff --git a/node_modules/pbkdf2/lib/sync.js b/node_modules/pbkdf2/lib/sync.js new file mode 100644 index 000000000..f691e31a6 --- /dev/null +++ b/node_modules/pbkdf2/lib/sync.js @@ -0,0 +1,51 @@ +var sizes = { + md5: 16, + sha1: 20, + sha224: 28, + sha256: 32, + sha384: 48, + sha512: 64, + rmd160: 20, + ripemd160: 20 +} + +var createHmac = require('create-hmac') +var checkParameters = require('../lib/precondition') +var defaultEncoding = require('../lib/default-encoding') +var Buffer = require('safe-buffer').Buffer + +function pbkdf2 (password, salt, iterations, keylen, digest) { + checkParameters(password, salt, iterations, keylen) + + if (!Buffer.isBuffer(password)) password = Buffer.from(password, defaultEncoding) + if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, defaultEncoding) + + digest = digest || 'sha1' + + var DK = Buffer.allocUnsafe(keylen) + var block1 = Buffer.allocUnsafe(salt.length + 4) + salt.copy(block1, 0, 0, salt.length) + + var destPos = 0 + var hLen = sizes[digest] + var l = Math.ceil(keylen / hLen) + + for (var i = 1; i <= l; i++) { + block1.writeUInt32BE(i, salt.length) + + var T = createHmac(digest, password).update(block1).digest() + var U = T + + for (var j = 1; j < iterations; j++) { + U = createHmac(digest, password).update(U).digest() + for (var k = 0; k < hLen; k++) T[k] ^= U[k] + } + + T.copy(DK, destPos) + destPos += hLen + } + + return DK +} + +module.exports = pbkdf2 diff --git a/node_modules/pbkdf2/package.json b/node_modules/pbkdf2/package.json new file mode 100644 index 000000000..8a9121145 --- /dev/null +++ b/node_modules/pbkdf2/package.json @@ -0,0 +1,98 @@ +{ + "_from": "pbkdf2@^3.0.3", + "_id": "pbkdf2@3.0.17", + "_inBundle": false, + "_integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", + "_location": "/pbkdf2", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "pbkdf2@^3.0.3", + "name": "pbkdf2", + "escapedName": "pbkdf2", + "rawSpec": "^3.0.3", + "saveSpec": null, + "fetchSpec": "^3.0.3" + }, + "_requiredBy": [ + "/crypto-browserify", + "/parse-asn1" + ], + "_resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", + "_shasum": "976c206530617b14ebb32114239f7b09336e93a6", + "_spec": "pbkdf2@^3.0.3", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/crypto-browserify", + "author": { + "name": "Daniel Cousens" + }, + "browser": { + "./index.js": "./browser.js", + "./lib/sync.js": "./lib/sync-browser.js" + }, + "bugs": { + "url": "https://github.com/crypto-browserify/pbkdf2/issues" + }, + "bundleDependencies": false, + "dependencies": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + }, + "deprecated": false, + "description": "This library provides the functionality of PBKDF2 with the ability to use any supported hashing algorithm returned from crypto.getHashes()", + "devDependencies": { + "benchmark": "^2.1.4", + "browserify": "*", + "nyc": "^6.4.0", + "standard": "*", + "tape": "^4.5.1" + }, + "engines": { + "node": ">=0.12" + }, + "files": [ + "browser.js", + "index.js", + "lib/" + ], + "homepage": "https://github.com/crypto-browserify/pbkdf2", + "keywords": [ + "pbkdf2", + "kdf", + "salt", + "hash" + ], + "license": "MIT", + "main": "index.js", + "name": "pbkdf2", + "nyc": { + "exclude": [ + "lib/async.js", + "test/bundle.js" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/crypto-browserify/pbkdf2.git" + }, + "scripts": { + "bench": "node bench/", + "bundle-test": "browserify test/index.js > test/bundle.js", + "coverage": "nyc --check-coverage --branches 95 --functions 95 tape test/*.js", + "coverage-html": "nyc report --reporter=html", + "coverage-report": "nyc report --reporter=lcov", + "lint": "standard", + "prepublish": "npm run test", + "test": "npm run lint && npm run unit", + "unit": "tape test/*.js" + }, + "standard": { + "ignore": [ + "test/bundle.js" + ] + }, + "version": "3.0.17" +} diff --git a/node_modules/pelo/README.md b/node_modules/pelo/README.md new file mode 100644 index 000000000..8c5cb9057 --- /dev/null +++ b/node_modules/pelo/README.md @@ -0,0 +1,56 @@ +# pelo (work in progress) + +Lightning fast server-side rendering with tagged template literals + +A tiny library that enables lightning fast server-side rendering with [hyperx](https://github.com/substack/hyperx)-like libraries such as `bel`, `yo-yo` and `choo/html`. It replaces the tag function of those libraries and just renders string without creating intermediate objects. + +## Installing + +```sh +npm install pelo +``` + +## Usage + +`ssr.js`: Call `pelo.replace(moduleId)` before you require any view module, `bel` in this case. + +```js +const pelo = require('pelo') +pelo.replace('bel') +const view = require('./view') + +const renderedString = view('pelo').toString() +``` + +`view.js`: You don't need to change your view files at all. You can use them for client-side rendering and server-side rendering. + +```js +const html = require('bel') + +module.exports = function helloView(name) { + return html`

Hello, ${name}

` +} +``` + +## Benchmark + +Rendering a simple view 10,000 times: + +```js +node benchmark.js +``` + +| tag | time (ms) | +| ---- | --------- | +| pelo | 219.093 | +| bel | 1982.610 | + +## Motivation + +Server-side rendering with modern JavaScript frameworks is slow. In general, they focus on the client-side, and generate virtual/real DOMs for efficient DOM updates from templates. However, this approach is a bit overkill when we focus on server-side rendering. Because the templates already look like HTML, it should be faster if they directly render HTML strings without creating intermediate object representations. + +With [`bel`](https://github.com/shama/bel), we can write HTML with tagged template literals and use them to create declarative views on browser. If we can use the same template also for directly generating HTML string on server-side, it will be a huge win. + +## Thanks + +Thanks [@yoshuawuyts](https://github.com/yoshuawuyts) for lots of advice! diff --git a/node_modules/pelo/app.js b/node_modules/pelo/app.js new file mode 100644 index 000000000..c9bd163f1 --- /dev/null +++ b/node_modules/pelo/app.js @@ -0,0 +1,67 @@ +'use strict' + +module.exports = function () { + // Allow `bel` to be swapped in benchmarking + const html = require('bel') + + const greeting = 'Hello' + const name = 'special characters, <, >, &' + const drinks = [ + { name: 'Cafe Latte', price: 3.0, sold: false }, + { name: 'Cappucino', price: 2.9, sold: true }, + { name: 'Club Mate', price: 2.2, sold: true }, + { name: 'Berliner Weiße', price: 3.5, sold: false } + ] + + const listeners = [] + function onChange (listener) { + listeners.push(listener) + } + function notifyChange () { + listeners.forEach((listener) => listener()) + } + + function deleteDrink (drink) { + const index = drinks.indexOf(drink) + if (index >= 0) { + drinks.splice(index, 1) + } + notifyChange() + } + + function drinkView (drink, deleteDrink) { + return html` +
  • + ${drink.name} is € ${drink.price} + +
  • + ` + } + + function mainView (greeting, name, drinks, deleteDrink) { + return html` +
    +

    ${greeting}, ${name}!

    + ${drinks.length > 0 ? html` +
      + ${drinks.map(drink => drinkView(drink, deleteDrink))} +
    + ` : html` +

    All drinks are gone!

    + `} +

    + attributes: ' }} /> +

    +
    + ` + } + + function render () { + return mainView(greeting, name, drinks, deleteDrink) + } + + return { + render: render, + onChange: onChange + } +} diff --git a/node_modules/pelo/bundle.js b/node_modules/pelo/bundle.js new file mode 100644 index 000000000..390a2e397 --- /dev/null +++ b/node_modules/pelo/bundle.js @@ -0,0 +1,1053 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o listener()) + } + + function deleteDrink (drink) { + const index = drinks.indexOf(drink) + if (index >= 0) { + drinks.splice(index, 1) + } + notifyChange() + } + + function drinkView (drink, deleteDrink) { + return html` +
  • + ${drink.name} is € ${drink.price} + +
  • + ` + } + + function mainView (greeting, name, drinks, deleteDrink) { + return html` +
    +

    ${greeting}, ${name}!

    + ${drinks.length > 0 ? html` +
      + ${drinks.map(drink => drinkView(drink, deleteDrink))} +
    + ` : html` +

    All drinks are gone!

    + `} +
    + ` + } + + function render () { + return mainView(greeting, name, drinks, deleteDrink) + } + + return { + render: render, + onChange: onChange + } +} + +},{"bel":3}],2:[function(require,module,exports){ +'use strict' + +const nanomorph = require('nanomorph') + +const createApp = require('./app') + +const app = createApp() + +const root = document.getElementById('root') +const tree = root.firstElementChild +nanomorph(tree, app.render()) +app.onChange(() => { + nanomorph(tree, app.render()) +}) + +},{"./app":1,"nanomorph":10}],3:[function(require,module,exports){ +var document = require('global/document') +var hyperx = require('hyperx') +var onload = require('on-load') + +var SVGNS = 'http://www.w3.org/2000/svg' +var XLINKNS = 'http://www.w3.org/1999/xlink' + +var BOOL_PROPS = { + autofocus: 1, + checked: 1, + defaultchecked: 1, + disabled: 1, + formnovalidate: 1, + indeterminate: 1, + readonly: 1, + required: 1, + selected: 1, + willvalidate: 1 +} +var COMMENT_TAG = '!--' +var SVG_TAGS = [ + 'svg', + 'altGlyph', 'altGlyphDef', 'altGlyphItem', 'animate', 'animateColor', + 'animateMotion', 'animateTransform', 'circle', 'clipPath', 'color-profile', + 'cursor', 'defs', 'desc', 'ellipse', 'feBlend', 'feColorMatrix', + 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', + 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', + 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', + 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', + 'feSpotLight', 'feTile', 'feTurbulence', 'filter', 'font', 'font-face', + 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', + 'foreignObject', 'g', 'glyph', 'glyphRef', 'hkern', 'image', 'line', + 'linearGradient', 'marker', 'mask', 'metadata', 'missing-glyph', 'mpath', + 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', + 'set', 'stop', 'switch', 'symbol', 'text', 'textPath', 'title', 'tref', + 'tspan', 'use', 'view', 'vkern' +] + +function belCreateElement (tag, props, children) { + var el + + // If an svg tag, it needs a namespace + if (SVG_TAGS.indexOf(tag) !== -1) { + props.namespace = SVGNS + } + + // If we are using a namespace + var ns = false + if (props.namespace) { + ns = props.namespace + delete props.namespace + } + + // Create the element + if (ns) { + el = document.createElementNS(ns, tag) + } else if (tag === COMMENT_TAG) { + return document.createComment(props.comment) + } else { + el = document.createElement(tag) + } + + // If adding onload events + if (props.onload || props.onunload) { + var load = props.onload || function () {} + var unload = props.onunload || function () {} + onload(el, function belOnload () { + load(el) + }, function belOnunload () { + unload(el) + }, + // We have to use non-standard `caller` to find who invokes `belCreateElement` + belCreateElement.caller.caller.caller) + delete props.onload + delete props.onunload + } + + // Create the properties + for (var p in props) { + if (props.hasOwnProperty(p)) { + var key = p.toLowerCase() + var val = props[p] + // Normalize className + if (key === 'classname') { + key = 'class' + p = 'class' + } + // The for attribute gets transformed to htmlFor, but we just set as for + if (p === 'htmlFor') { + p = 'for' + } + // If a property is boolean, set itself to the key + if (BOOL_PROPS[key]) { + if (val === 'true') val = key + else if (val === 'false') continue + } + // If a property prefers being set directly vs setAttribute + if (key.slice(0, 2) === 'on') { + el[p] = val + } else { + if (ns) { + if (p === 'xlink:href') { + el.setAttributeNS(XLINKNS, p, val) + } else if (/^xmlns($|:)/i.test(p)) { + // skip xmlns definitions + } else { + el.setAttributeNS(null, p, val) + } + } else { + el.setAttribute(p, val) + } + } + } + } + + function appendChild (childs) { + if (!Array.isArray(childs)) return + for (var i = 0; i < childs.length; i++) { + var node = childs[i] + if (Array.isArray(node)) { + appendChild(node) + continue + } + + if (typeof node === 'number' || + typeof node === 'boolean' || + typeof node === 'function' || + node instanceof Date || + node instanceof RegExp) { + node = node.toString() + } + + if (typeof node === 'string') { + if (el.lastChild && el.lastChild.nodeName === '#text') { + el.lastChild.nodeValue += node + continue + } + node = document.createTextNode(node) + } + + if (node && node.nodeType) { + el.appendChild(node) + } + } + } + appendChild(children) + + return el +} + +module.exports = hyperx(belCreateElement, {comments: true}) +module.exports.default = module.exports +module.exports.createElement = belCreateElement + +},{"global/document":5,"hyperx":8,"on-load":13}],4:[function(require,module,exports){ + +},{}],5:[function(require,module,exports){ +(function (global){ +var topLevel = typeof global !== 'undefined' ? global : + typeof window !== 'undefined' ? window : {} +var minDoc = require('min-document'); + +var doccy; + +if (typeof document !== 'undefined') { + doccy = document; +} else { + doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4']; + + if (!doccy) { + doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc; + } +} + +module.exports = doccy; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"min-document":4}],6:[function(require,module,exports){ +(function (global){ +var win; + +if (typeof window !== "undefined") { + win = window; +} else if (typeof global !== "undefined") { + win = global; +} else if (typeof self !== "undefined"){ + win = self; +} else { + win = {}; +} + +module.exports = win; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],7:[function(require,module,exports){ +module.exports = attributeToProperty + +var transform = { + 'class': 'className', + 'for': 'htmlFor', + 'http-equiv': 'httpEquiv' +} + +function attributeToProperty (h) { + return function (tagName, attrs, children) { + for (var attr in attrs) { + if (attr in transform) { + attrs[transform[attr]] = attrs[attr] + delete attrs[attr] + } + } + return h(tagName, attrs, children) + } +} + +},{}],8:[function(require,module,exports){ +var attrToProp = require('hyperscript-attribute-to-property') + +var VAR = 0, TEXT = 1, OPEN = 2, CLOSE = 3, ATTR = 4 +var ATTR_KEY = 5, ATTR_KEY_W = 6 +var ATTR_VALUE_W = 7, ATTR_VALUE = 8 +var ATTR_VALUE_SQ = 9, ATTR_VALUE_DQ = 10 +var ATTR_EQ = 11, ATTR_BREAK = 12 +var COMMENT = 13 + +module.exports = function (h, opts) { + if (!opts) opts = {} + var concat = opts.concat || function (a, b) { + return String(a) + String(b) + } + if (opts.attrToProp !== false) { + h = attrToProp(h) + } + + return function (strings) { + var state = TEXT, reg = '' + var arglen = arguments.length + var parts = [] + + for (var i = 0; i < strings.length; i++) { + if (i < arglen - 1) { + var arg = arguments[i+1] + var p = parse(strings[i]) + var xstate = state + if (xstate === ATTR_VALUE_DQ) xstate = ATTR_VALUE + if (xstate === ATTR_VALUE_SQ) xstate = ATTR_VALUE + if (xstate === ATTR_VALUE_W) xstate = ATTR_VALUE + if (xstate === ATTR) xstate = ATTR_KEY + p.push([ VAR, xstate, arg ]) + parts.push.apply(parts, p) + } else parts.push.apply(parts, parse(strings[i])) + } + + var tree = [null,{},[]] + var stack = [[tree,-1]] + for (var i = 0; i < parts.length; i++) { + var cur = stack[stack.length-1][0] + var p = parts[i], s = p[0] + if (s === OPEN && /^\//.test(p[1])) { + var ix = stack[stack.length-1][1] + if (stack.length > 1) { + stack.pop() + stack[stack.length-1][0][2][ix] = h( + cur[0], cur[1], cur[2].length ? cur[2] : undefined + ) + } + } else if (s === OPEN) { + var c = [p[1],{},[]] + cur[2].push(c) + stack.push([c,cur[2].length-1]) + } else if (s === ATTR_KEY || (s === VAR && p[1] === ATTR_KEY)) { + var key = '' + var copyKey + for (; i < parts.length; i++) { + if (parts[i][0] === ATTR_KEY) { + key = concat(key, parts[i][1]) + } else if (parts[i][0] === VAR && parts[i][1] === ATTR_KEY) { + if (typeof parts[i][2] === 'object' && !key) { + for (copyKey in parts[i][2]) { + if (parts[i][2].hasOwnProperty(copyKey) && !cur[1][copyKey]) { + cur[1][copyKey] = parts[i][2][copyKey] + } + } + } else { + key = concat(key, parts[i][2]) + } + } else break + } + if (parts[i][0] === ATTR_EQ) i++ + var j = i + for (; i < parts.length; i++) { + if (parts[i][0] === ATTR_VALUE || parts[i][0] === ATTR_KEY) { + if (!cur[1][key]) cur[1][key] = strfn(parts[i][1]) + else cur[1][key] = concat(cur[1][key], parts[i][1]) + } else if (parts[i][0] === VAR + && (parts[i][1] === ATTR_VALUE || parts[i][1] === ATTR_KEY)) { + if (!cur[1][key]) cur[1][key] = strfn(parts[i][2]) + else cur[1][key] = concat(cur[1][key], parts[i][2]) + } else { + if (key.length && !cur[1][key] && i === j + && (parts[i][0] === CLOSE || parts[i][0] === ATTR_BREAK)) { + // https://html.spec.whatwg.org/multipage/infrastructure.html#boolean-attributes + // empty string is falsy, not well behaved value in browser + cur[1][key] = key.toLowerCase() + } + break + } + } + } else if (s === ATTR_KEY) { + cur[1][p[1]] = true + } else if (s === VAR && p[1] === ATTR_KEY) { + cur[1][p[2]] = true + } else if (s === CLOSE) { + if (selfClosing(cur[0]) && stack.length) { + var ix = stack[stack.length-1][1] + stack.pop() + stack[stack.length-1][0][2][ix] = h( + cur[0], cur[1], cur[2].length ? cur[2] : undefined + ) + } + } else if (s === VAR && p[1] === TEXT) { + if (p[2] === undefined || p[2] === null) p[2] = '' + else if (!p[2]) p[2] = concat('', p[2]) + if (Array.isArray(p[2][0])) { + cur[2].push.apply(cur[2], p[2]) + } else { + cur[2].push(p[2]) + } + } else if (s === TEXT) { + cur[2].push(p[1]) + } else if (s === ATTR_EQ || s === ATTR_BREAK) { + // no-op + } else { + throw new Error('unhandled: ' + s) + } + } + + if (tree[2].length > 1 && /^\s*$/.test(tree[2][0])) { + tree[2].shift() + } + + if (tree[2].length > 2 + || (tree[2].length === 2 && /\S/.test(tree[2][1]))) { + throw new Error( + 'multiple root elements must be wrapped in an enclosing tag' + ) + } + if (Array.isArray(tree[2][0]) && typeof tree[2][0][0] === 'string' + && Array.isArray(tree[2][0][2])) { + tree[2][0] = h(tree[2][0][0], tree[2][0][1], tree[2][0][2]) + } + return tree[2][0] + + function parse (str) { + var res = [] + if (state === ATTR_VALUE_W) state = ATTR + for (var i = 0; i < str.length; i++) { + var c = str.charAt(i) + if (state === TEXT && c === '<') { + if (reg.length) res.push([TEXT, reg]) + reg = '' + state = OPEN + } else if (c === '>' && !quot(state) && state !== COMMENT) { + if (state === OPEN) { + res.push([OPEN,reg]) + } else if (state === ATTR_KEY) { + res.push([ATTR_KEY,reg]) + } else if (state === ATTR_VALUE && reg.length) { + res.push([ATTR_VALUE,reg]) + } + res.push([CLOSE]) + reg = '' + state = TEXT + } else if (state === COMMENT && /-$/.test(reg) && c === '-') { + if (opts.comments) { + res.push([ATTR_VALUE,reg.substr(0, reg.length - 1)],[CLOSE]) + } + reg = '' + state = TEXT + } else if (state === OPEN && /^!--$/.test(reg)) { + if (opts.comments) { + res.push([OPEN, reg],[ATTR_KEY,'comment'],[ATTR_EQ]) + } + reg = c + state = COMMENT + } else if (state === TEXT || state === COMMENT) { + reg += c + } else if (state === OPEN && /\s/.test(c)) { + res.push([OPEN, reg]) + reg = '' + state = ATTR + } else if (state === OPEN) { + reg += c + } else if (state === ATTR && /[^\s"'=/]/.test(c)) { + state = ATTR_KEY + reg = c + } else if (state === ATTR && /\s/.test(c)) { + if (reg.length) res.push([ATTR_KEY,reg]) + res.push([ATTR_BREAK]) + } else if (state === ATTR_KEY && /\s/.test(c)) { + res.push([ATTR_KEY,reg]) + reg = '' + state = ATTR_KEY_W + } else if (state === ATTR_KEY && c === '=') { + res.push([ATTR_KEY,reg],[ATTR_EQ]) + reg = '' + state = ATTR_VALUE_W + } else if (state === ATTR_KEY) { + reg += c + } else if ((state === ATTR_KEY_W || state === ATTR) && c === '=') { + res.push([ATTR_EQ]) + state = ATTR_VALUE_W + } else if ((state === ATTR_KEY_W || state === ATTR) && !/\s/.test(c)) { + res.push([ATTR_BREAK]) + if (/[\w-]/.test(c)) { + reg += c + state = ATTR_KEY + } else state = ATTR + } else if (state === ATTR_VALUE_W && c === '"') { + state = ATTR_VALUE_DQ + } else if (state === ATTR_VALUE_W && c === "'") { + state = ATTR_VALUE_SQ + } else if (state === ATTR_VALUE_DQ && c === '"') { + res.push([ATTR_VALUE,reg],[ATTR_BREAK]) + reg = '' + state = ATTR + } else if (state === ATTR_VALUE_SQ && c === "'") { + res.push([ATTR_VALUE,reg],[ATTR_BREAK]) + reg = '' + state = ATTR + } else if (state === ATTR_VALUE_W && !/\s/.test(c)) { + state = ATTR_VALUE + i-- + } else if (state === ATTR_VALUE && /\s/.test(c)) { + res.push([ATTR_VALUE,reg],[ATTR_BREAK]) + reg = '' + state = ATTR + } else if (state === ATTR_VALUE || state === ATTR_VALUE_SQ + || state === ATTR_VALUE_DQ) { + reg += c + } + } + if (state === TEXT && reg.length) { + res.push([TEXT,reg]) + reg = '' + } else if (state === ATTR_VALUE && reg.length) { + res.push([ATTR_VALUE,reg]) + reg = '' + } else if (state === ATTR_VALUE_DQ && reg.length) { + res.push([ATTR_VALUE,reg]) + reg = '' + } else if (state === ATTR_VALUE_SQ && reg.length) { + res.push([ATTR_VALUE,reg]) + reg = '' + } else if (state === ATTR_KEY) { + res.push([ATTR_KEY,reg]) + reg = '' + } + return res + } + } + + function strfn (x) { + if (typeof x === 'function') return x + else if (typeof x === 'string') return x + else if (x && typeof x === 'object') return x + else return concat('', x) + } +} + +function quot (state) { + return state === ATTR_VALUE_SQ || state === ATTR_VALUE_DQ +} + +var hasOwn = Object.prototype.hasOwnProperty +function has (obj, key) { return hasOwn.call(obj, key) } + +var closeRE = RegExp('^(' + [ + 'area', 'base', 'basefont', 'bgsound', 'br', 'col', 'command', 'embed', + 'frame', 'hr', 'img', 'input', 'isindex', 'keygen', 'link', 'meta', 'param', + 'source', 'track', 'wbr', '!--', + // SVG TAGS + 'animate', 'animateTransform', 'circle', 'cursor', 'desc', 'ellipse', + 'feBlend', 'feColorMatrix', 'feComposite', + 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', + 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', + 'feGaussianBlur', 'feImage', 'feMergeNode', 'feMorphology', + 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', + 'feTurbulence', 'font-face-format', 'font-face-name', 'font-face-uri', + 'glyph', 'glyphRef', 'hkern', 'image', 'line', 'missing-glyph', 'mpath', + 'path', 'polygon', 'polyline', 'rect', 'set', 'stop', 'tref', 'use', 'view', + 'vkern' +].join('|') + ')(?:[\.#][a-zA-Z0-9\u007F-\uFFFF_:-]+)*$') +function selfClosing (tag) { return closeRE.test(tag) } + +},{"hyperscript-attribute-to-property":7}],9:[function(require,module,exports){ +assert.notEqual = notEqual +assert.notOk = notOk +assert.equal = equal +assert.ok = assert + +module.exports = assert + +function equal (a, b, m) { + assert(a == b, m) // eslint-disable-line eqeqeq +} + +function notEqual (a, b, m) { + assert(a != b, m) // eslint-disable-line eqeqeq +} + +function notOk (t, m) { + assert(!t, m) +} + +function assert (t, m) { + if (!t) throw new Error(m || 'AssertionError') +} + +},{}],10:[function(require,module,exports){ +var assert = require('assert') +var morph = require('./lib/morph') + +var TEXT_NODE = 3 +// var DEBUG = false + +module.exports = nanomorph + +// Morph one tree into another tree +// +// no parent +// -> same: diff and walk children +// -> not same: replace and return +// old node doesn't exist +// -> insert new node +// new node doesn't exist +// -> delete old node +// nodes are not the same +// -> diff nodes and apply patch to old node +// nodes are the same +// -> walk all child nodes and append to old node +function nanomorph (oldTree, newTree) { + // if (DEBUG) { + // console.log( + // 'nanomorph\nold\n %s\nnew\n %s', + // oldTree && oldTree.outerHTML, + // newTree && newTree.outerHTML + // ) + // } + assert.equal(typeof oldTree, 'object', 'nanomorph: oldTree should be an object') + assert.equal(typeof newTree, 'object', 'nanomorph: newTree should be an object') + var tree = walk(newTree, oldTree) + // if (DEBUG) console.log('=> morphed\n %s', tree.outerHTML) + return tree +} + +// Walk and morph a dom tree +function walk (newNode, oldNode) { + // if (DEBUG) { + // console.log( + // 'walk\nold\n %s\nnew\n %s', + // oldNode && oldNode.outerHTML, + // newNode && newNode.outerHTML + // ) + // } + if (!oldNode) { + return newNode + } else if (!newNode) { + return null + } else if (newNode.isSameNode && newNode.isSameNode(oldNode)) { + return oldNode + } else if (newNode.tagName !== oldNode.tagName) { + return newNode + } else { + morph(newNode, oldNode) + updateChildren(newNode, oldNode) + return oldNode + } +} + +// Update the children of elements +// (obj, obj) -> null +function updateChildren (newNode, oldNode) { + // if (DEBUG) { + // console.log( + // 'updateChildren\nold\n %s\nnew\n %s', + // oldNode && oldNode.outerHTML, + // newNode && newNode.outerHTML + // ) + // } + var oldChild, newChild, morphed, oldMatch + + // The offset is only ever increased, and used for [i - offset] in the loop + var offset = 0 + + for (var i = 0; ; i++) { + oldChild = oldNode.childNodes[i] + newChild = newNode.childNodes[i - offset] + // if (DEBUG) { + // console.log( + // '===\n- old\n %s\n- new\n %s', + // oldChild && oldChild.outerHTML, + // newChild && newChild.outerHTML + // ) + // } + // Both nodes are empty, do nothing + if (!oldChild && !newChild) { + break + + // There is no new child, remove old + } else if (!newChild) { + oldNode.removeChild(oldChild) + i-- + + // There is no old child, add new + } else if (!oldChild) { + oldNode.appendChild(newChild) + offset++ + + // Both nodes are the same, morph + } else if (same(newChild, oldChild)) { + morphed = walk(newChild, oldChild) + if (morphed !== oldChild) { + oldNode.replaceChild(morphed, oldChild) + offset++ + } + + // Both nodes do not share an ID or a placeholder, try reorder + } else { + oldMatch = null + + // Try and find a similar node somewhere in the tree + for (var j = i; j < oldNode.childNodes.length; j++) { + if (same(oldNode.childNodes[j], newChild)) { + oldMatch = oldNode.childNodes[j] + break + } + } + + // If there was a node with the same ID or placeholder in the old list + if (oldMatch) { + morphed = walk(newChild, oldMatch) + if (morphed !== oldMatch) offset++ + oldNode.insertBefore(morphed, oldChild) + + // It's safe to morph two nodes in-place if neither has an ID + } else if (!newChild.id && !oldChild.id) { + morphed = walk(newChild, oldChild) + if (morphed !== oldChild) { + oldNode.replaceChild(morphed, oldChild) + offset++ + } + + // Insert the node at the index if we couldn't morph or find a matching node + } else { + oldNode.insertBefore(newChild, oldChild) + offset++ + } + } + } +} + +function same (a, b) { + if (a.id) return a.id === b.id + if (a.isSameNode) return a.isSameNode(b) + if (a.tagName !== b.tagName) return false + if (a.type === TEXT_NODE) return a.nodeValue === b.nodeValue + return false +} + +},{"./lib/morph":12,"assert":9}],11:[function(require,module,exports){ +module.exports = [ + // attribute events (can be set with attributes) + 'onclick', + 'ondblclick', + 'onmousedown', + 'onmouseup', + 'onmouseover', + 'onmousemove', + 'onmouseout', + 'onmouseenter', + 'onmouseleave', + 'ontouchcancel', + 'ontouchend', + 'ontouchmove', + 'ontouchstart', + 'ondragstart', + 'ondrag', + 'ondragenter', + 'ondragleave', + 'ondragover', + 'ondrop', + 'ondragend', + 'onkeydown', + 'onkeypress', + 'onkeyup', + 'onunload', + 'onabort', + 'onerror', + 'onresize', + 'onscroll', + 'onselect', + 'onchange', + 'onsubmit', + 'onreset', + 'onfocus', + 'onblur', + 'oninput', + // other common events + 'oncontextmenu', + 'onfocusin', + 'onfocusout' +] + +},{}],12:[function(require,module,exports){ +var events = require('./events') +var eventsLength = events.length + +var ELEMENT_NODE = 1 +var TEXT_NODE = 3 +var COMMENT_NODE = 8 + +module.exports = morph + +// diff elements and apply the resulting patch to the old node +// (obj, obj) -> null +function morph (newNode, oldNode) { + var nodeType = newNode.nodeType + var nodeName = newNode.nodeName + + if (nodeType === ELEMENT_NODE) { + copyAttrs(newNode, oldNode) + } + + if (nodeType === TEXT_NODE || nodeType === COMMENT_NODE) { + if (oldNode.nodeValue !== newNode.nodeValue) { + oldNode.nodeValue = newNode.nodeValue + } + } + + // Some DOM nodes are weird + // https://github.com/patrick-steele-idem/morphdom/blob/master/src/specialElHandlers.js + if (nodeName === 'INPUT') updateInput(newNode, oldNode) + else if (nodeName === 'OPTION') updateOption(newNode, oldNode) + else if (nodeName === 'TEXTAREA') updateTextarea(newNode, oldNode) + + copyEvents(newNode, oldNode) +} + +function copyAttrs (newNode, oldNode) { + var oldAttrs = oldNode.attributes + var newAttrs = newNode.attributes + var attrNamespaceURI = null + var attrValue = null + var fromValue = null + var attrName = null + var attr = null + + for (var i = newAttrs.length - 1; i >= 0; --i) { + attr = newAttrs[i] + attrName = attr.name + attrNamespaceURI = attr.namespaceURI + attrValue = attr.value + if (attrNamespaceURI) { + attrName = attr.localName || attrName + fromValue = oldNode.getAttributeNS(attrNamespaceURI, attrName) + if (fromValue !== attrValue) { + oldNode.setAttributeNS(attrNamespaceURI, attrName, attrValue) + } + } else { + if (!oldNode.hasAttribute(attrName)) { + oldNode.setAttribute(attrName, attrValue) + } else { + fromValue = oldNode.getAttribute(attrName) + if (fromValue !== attrValue) { + // apparently values are always cast to strings, ah well + if (attrValue === 'null' || attrValue === 'undefined') { + oldNode.removeAttribute(attrName) + } else { + oldNode.setAttribute(attrName, attrValue) + } + } + } + } + } + + // Remove any extra attributes found on the original DOM element that + // weren't found on the target element. + for (var j = oldAttrs.length - 1; j >= 0; --j) { + attr = oldAttrs[j] + if (attr.specified !== false) { + attrName = attr.name + attrNamespaceURI = attr.namespaceURI + + if (attrNamespaceURI) { + attrName = attr.localName || attrName + if (!newNode.hasAttributeNS(attrNamespaceURI, attrName)) { + oldNode.removeAttributeNS(attrNamespaceURI, attrName) + } + } else { + if (!newNode.hasAttributeNS(null, attrName)) { + oldNode.removeAttribute(attrName) + } + } + } + } +} + +function copyEvents (newNode, oldNode) { + for (var i = 0; i < eventsLength; i++) { + var ev = events[i] + if (newNode[ev]) { // if new element has a whitelisted attribute + oldNode[ev] = newNode[ev] // update existing element + } else if (oldNode[ev]) { // if existing element has it and new one doesnt + oldNode[ev] = undefined // remove it from existing element + } + } +} + +function updateOption (newNode, oldNode) { + updateAttribute(newNode, oldNode, 'selected') +} + +// The "value" attribute is special for the element since it sets the +// initial value. Changing the "value" attribute without changing the "value" +// property will have no effect since it is only used to the set the initial +// value. Similar for the "checked" attribute, and "disabled". +function updateInput (newNode, oldNode) { + var newValue = newNode.value + var oldValue = oldNode.value + + updateAttribute(newNode, oldNode, 'checked') + updateAttribute(newNode, oldNode, 'disabled') + + if (newValue !== oldValue) { + oldNode.setAttribute('value', newValue) + oldNode.value = newValue + } + + if (newValue === 'null') { + oldNode.value = '' + oldNode.removeAttribute('value') + } + + if (!newNode.hasAttributeNS(null, 'value')) { + oldNode.removeAttribute('value') + } else if (oldNode.type === 'range') { + // this is so elements like slider move their UI thingy + oldNode.value = newValue + } +} + +function updateTextarea (newNode, oldNode) { + var newValue = newNode.value + if (newValue !== oldNode.value) { + oldNode.value = newValue + } + + if (oldNode.firstChild && oldNode.firstChild.nodeValue !== newValue) { + // Needed for IE. Apparently IE sets the placeholder as the + // node value and vise versa. This ignores an empty update. + if (newValue === '' && oldNode.firstChild.nodeValue === oldNode.placeholder) { + return + } + + oldNode.firstChild.nodeValue = newValue + } +} + +function updateAttribute (newNode, oldNode, name) { + if (newNode[name] !== oldNode[name]) { + oldNode[name] = newNode[name] + if (newNode[name]) { + oldNode.setAttribute(name, '') + } else { + oldNode.removeAttribute(name) + } + } +} + +},{"./events":11}],13:[function(require,module,exports){ +/* global MutationObserver */ +var document = require('global/document') +var window = require('global/window') +var watch = Object.create(null) +var KEY_ID = 'onloadid' + (new Date() % 9e6).toString(36) +var KEY_ATTR = 'data-' + KEY_ID +var INDEX = 0 + +if (window && window.MutationObserver) { + var observer = new MutationObserver(function (mutations) { + if (Object.keys(watch).length < 1) return + for (var i = 0; i < mutations.length; i++) { + if (mutations[i].attributeName === KEY_ATTR) { + eachAttr(mutations[i], turnon, turnoff) + continue + } + eachMutation(mutations[i].removedNodes, turnoff) + eachMutation(mutations[i].addedNodes, turnon) + } + }) + observer.observe(document.body, { + childList: true, + subtree: true, + attributes: true, + attributeOldValue: true, + attributeFilter: [KEY_ATTR] + }) +} + +module.exports = function onload (el, on, off, caller) { + on = on || function () {} + off = off || function () {} + el.setAttribute(KEY_ATTR, 'o' + INDEX) + watch['o' + INDEX] = [on, off, 0, caller || onload.caller] + INDEX += 1 + return el +} + +function turnon (index, el) { + if (watch[index][0] && watch[index][2] === 0) { + watch[index][0](el) + watch[index][2] = 1 + } +} + +function turnoff (index, el) { + if (watch[index][1] && watch[index][2] === 1) { + watch[index][1](el) + watch[index][2] = 0 + } +} + +function eachAttr (mutation, on, off) { + var newValue = mutation.target.getAttribute(KEY_ATTR) + if (sameOrigin(mutation.oldValue, newValue)) { + watch[newValue] = watch[mutation.oldValue] + return + } + if (watch[mutation.oldValue]) { + off(mutation.oldValue, mutation.target) + } + if (watch[newValue]) { + on(newValue, mutation.target) + } +} + +function sameOrigin (oldValue, newValue) { + if (!oldValue || !newValue) return false + return watch[oldValue][3] === watch[newValue][3] +} + +function eachMutation (nodes, fn) { + var keys = Object.keys(watch) + for (var i = 0; i < nodes.length; i++) { + if (nodes[i] && nodes[i].getAttribute && nodes[i].getAttribute(KEY_ATTR)) { + var onloadid = nodes[i].getAttribute(KEY_ATTR) + keys.forEach(function (k) { + if (onloadid === k) { + fn(k, nodes[i]) + } + }) + } + if (nodes[i].childNodes.length > 0) { + eachMutation(nodes[i].childNodes, fn) + } + } +} + +},{"global/document":5,"global/window":6}]},{},[2]); diff --git a/node_modules/pelo/client.js b/node_modules/pelo/client.js new file mode 100644 index 000000000..a8895d5f0 --- /dev/null +++ b/node_modules/pelo/client.js @@ -0,0 +1,14 @@ +'use strict' + +const nanomorph = require('nanomorph') + +const createApp = require('./app') + +const app = createApp() + +const root = document.getElementById('root') +const tree = root.firstElementChild +nanomorph(tree, app.render()) +app.onChange(() => { + nanomorph(tree, app.render()) +}) diff --git a/node_modules/pelo/index.js b/node_modules/pelo/index.js new file mode 100644 index 000000000..1fbe8a338 --- /dev/null +++ b/node_modules/pelo/index.js @@ -0,0 +1,106 @@ +'use strict' + +const Module = require('module') + +var BOOL_PROPS = [ + 'autofocus', 'checked', 'defaultchecked', 'disabled', 'formnovalidate', + 'indeterminate', 'readonly', 'required', 'selected', 'willvalidate' +] + +var BOOL_PROP_PATTERN = new RegExp(' (' + BOOL_PROPS.join('|') + '|onclick)=(""|\'\')', 'ig') +var DISABLED_PATTERN = new RegExp('disabled=("true"|\'true\')', 'ig') + +const replaceMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + '\'': ''' +} +const replaceMapRE = new RegExp(Object.keys(replaceMap).join('|'), 'g') + +function replaceMapper (matched){ + return replaceMap[matched] +} + +function escape (value) { + return value.toString().replace(replaceMapRE, replaceMapper) +} + +function handleValue (value) { + if (value === null || value === undefined || value === false) { + return '' + } + + if (Array.isArray(value)) { + // Suppose that each item is a result of html``. + return value.join('') + } + // Ignore event handlers. + // onclick=${(e) => doSomething(e)} + // will become + // onclick="" + const valueType = typeof value + if (valueType === 'function') { + return '' + } + + if (valueType === 'object' && value.constructor.name !== 'String') { + return objToString(value) + } + + if (value.__encoded) { + return value + } + + return escape(value) +} + +function stringify () { + var pieces = arguments[0] + var output = '' + for (var i = 0; i < pieces.length - 1; i++) { + var piece = pieces[i] + var value = handleValue(arguments[i + 1]) + if (piece[piece.length - 1] === '=') { + output += piece + '"' + value + '"' + } else { + output += piece + value + } + } + output += pieces[i] + output = output + .replace(DISABLED_PATTERN, 'disabled="disabled"') + .replace(BOOL_PROP_PATTERN, '') + + // HACK: Avoid double encoding by marking encoded string + // You cannot add properties to string literals + // eslint-disable-next-line no-new-wrappers + const wrapper = new String(output) + wrapper.__encoded = true + return wrapper +} + +function objToString (obj) { + var values = '' + const keys = Object.keys(obj) + for (var i = 0; i < keys.length - 1; i++) { + values += keys[i] + '="' + escape(obj[keys[i]] || '') + '" ' + } + return values + keys[i] + '="' + escape(obj[keys[i]] || '') + '"' +} + +function replace (moduleId) { + const originalRequire = Module.prototype.require + Module.prototype.require = function (id) { + if (id === moduleId) { + return stringify + } else { + return originalRequire.apply(this, arguments) + } + } +} + +stringify.replace = replace + +module.exports = stringify diff --git a/node_modules/pelo/package.json b/node_modules/pelo/package.json new file mode 100644 index 000000000..f9da378ae --- /dev/null +++ b/node_modules/pelo/package.json @@ -0,0 +1,59 @@ +{ + "_from": "pelo@^0.1.0", + "_id": "pelo@0.1.0", + "_inBundle": false, + "_integrity": "sha512-+oVixa69fxS/X+3s1DaSJVQLG/ukHfjK2pHCmpIgjRChp73lnAfbqOYZ0MEo5C5yVkYeUJSoWAcRK0lx0hvOjQ==", + "_location": "/pelo", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "pelo@^0.1.0", + "name": "pelo", + "escapedName": "pelo", + "rawSpec": "^0.1.0", + "saveSpec": null, + "fetchSpec": "^0.1.0" + }, + "_requiredBy": [ + "/bel" + ], + "_resolved": "https://registry.npmjs.org/pelo/-/pelo-0.1.0.tgz", + "_shasum": "54157d3bc63c10da65504d6b801f0b535584c11b", + "_spec": "pelo@^0.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/bel", + "author": { + "name": "Shuhei Kagawa", + "email": "shuhei.kagawa@gmail.com" + }, + "bugs": { + "url": "https://github.com/shuhei/pelo/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Lightning fast server-side rendering with tagged template literals", + "devDependencies": { + "bel": "^4.6.0", + "browserify": "^14.3.0", + "html-minifier": "^3.5.6", + "nanomorph": "^5.1.3", + "standard": "^10.0.2", + "tape": "^4.8.0" + }, + "homepage": "https://github.com/shuhei/pelo", + "license": "ISC", + "main": "index.js", + "name": "pelo", + "repository": { + "type": "git", + "url": "git+https://github.com/shuhei/pelo.git" + }, + "scripts": { + "build": "browserify client.js > bundle.js", + "compare": "node compare.js", + "start": "npm run build && node server.js", + "test": "tape '**/*.test.js' && node benchmark.js" + }, + "version": "0.1.0" +} diff --git a/node_modules/pelo/server.js b/node_modules/pelo/server.js new file mode 100644 index 000000000..c6d37e092 --- /dev/null +++ b/node_modules/pelo/server.js @@ -0,0 +1,55 @@ +'use strict' + +const http = require('http') +const fs = require('fs') + +const pelo = require('.') +pelo.replace('bel') +const createApp = require('./app') + +const app = createApp() + +function layout (content) { + return ` + + + + + Hello + + + +
    + ${content} +
    + + + + ` +} + +const server = http.createServer((req, res) => { + if (req.url === '/bundle.js') { + res.writeHead(200, { + 'Content-Type': 'text/javascript' + }) + fs.createReadStream('./bundle.js').pipe(res) + return + } + + const content = app.render() + const body = layout(content) + res.writeHead(200, { + 'Content-Type': 'text/html' + }) + res.end(body) +}) +server.on('listening', () => { + console.log('Listening on', server.address()); +}); +server.listen(8080) diff --git a/node_modules/pelo/yarn.lock b/node_modules/pelo/yarn.lock new file mode 100644 index 000000000..08bf7ce91 --- /dev/null +++ b/node_modules/pelo/yarn.lock @@ -0,0 +1,2049 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +JSONStream@^1.0.3: + version "1.3.1" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.1.tgz#707f761e01dae9e16f1bcf93703b78c70966579a" + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + +acorn-jsx@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" + dependencies: + acorn "^3.0.4" + +acorn@^3.0.4: + version "3.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + +acorn@^4.0.3: + version "4.0.11" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.11.tgz#edcda3bd937e7556410d42ed5860f67399c794c0" + +acorn@^5.0.1: + version "5.0.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.0.3.tgz#c460df08491463f028ccb82eab3730bf01087b3d" + +ajv-keywords@^1.0.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" + +ajv@^4.7.0: + version "4.11.7" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.7.tgz#8655a5d86d0824985cc471a1d913fb6729a0ec48" + dependencies: + co "^4.6.0" + json-stable-stringify "^1.0.1" + +ansi-escapes@^1.1.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +argparse@^1.0.7: + version "1.0.9" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" + dependencies: + sprintf-js "~1.0.2" + +array-filter@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec" + +array-map@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" + +array-reduce@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b" + +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + +array.prototype.find@^2.0.1: + version "2.0.4" + resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.0.4.tgz#556a5c5362c08648323ddaeb9de9d14bc1864c90" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.7.0" + +arrify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +asn1.js@^4.0.0: + version "4.9.1" + resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.1.tgz#48ba240b45a9280e94748990ba597d216617fd40" + dependencies: + bn.js "^4.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +assert@^1.4.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" + dependencies: + util "0.10.3" + +astw@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/astw/-/astw-2.2.0.tgz#7bd41784d32493987aeb239b6b4e1c57a873b917" + dependencies: + acorn "^4.0.3" + +babel-code-frame@^6.16.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" + dependencies: + chalk "^1.1.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +balanced-match@^0.4.1: + version "0.4.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +base64-js@^1.0.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.0.tgz#a39992d723584811982be5e290bb6a53d86700f1" + +bel@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/bel/-/bel-4.6.0.tgz#3ade16e236ab2204d8d1c66eac4bd573793ac999" + dependencies: + global "^4.3.0" + hyperx "^2.3.0" + on-load "^3.2.0" + +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: + version "4.11.6" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" + +brace-expansion@^1.0.0: + version "1.1.7" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.7.tgz#3effc3c50e000531fb720eaff80f0ae8ef23cf59" + dependencies: + balanced-match "^0.4.1" + concat-map "0.0.1" + +brace-expansion@^1.1.7: + version "1.1.8" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +brorand@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + +browser-pack@^6.0.1: + version "6.0.2" + resolved "https://registry.yarnpkg.com/browser-pack/-/browser-pack-6.0.2.tgz#f86cd6cef4f5300c8e63e07a4d512f65fbff4531" + dependencies: + JSONStream "^1.0.3" + combine-source-map "~0.7.1" + defined "^1.0.0" + through2 "^2.0.0" + umd "^3.0.0" + +browser-resolve@^1.11.0, browser-resolve@^1.7.0: + version "1.11.2" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" + dependencies: + resolve "1.1.7" + +browserify-aes@^1.0.0, browserify-aes@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.0.6.tgz#5e7725dbdef1fd5930d4ebab48567ce451c48a0a" + dependencies: + buffer-xor "^1.0.2" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.0" + inherits "^2.0.1" + +browserify-cipher@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.0.tgz#9988244874bf5ed4e28da95666dcd66ac8fc363a" + dependencies: + browserify-aes "^1.0.4" + browserify-des "^1.0.0" + evp_bytestokey "^1.0.0" + +browserify-des@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.0.tgz#daa277717470922ed2fe18594118a175439721dd" + dependencies: + cipher-base "^1.0.1" + des.js "^1.0.0" + inherits "^2.0.1" + +browserify-rsa@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" + dependencies: + bn.js "^4.1.0" + randombytes "^2.0.1" + +browserify-sign@^4.0.0: + version "4.0.4" + resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" + dependencies: + bn.js "^4.1.1" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.2" + elliptic "^6.0.0" + inherits "^2.0.1" + parse-asn1 "^5.0.0" + +browserify-zlib@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" + dependencies: + pako "~1.0.5" + +browserify@^14.3.0: + version "14.5.0" + resolved "https://registry.yarnpkg.com/browserify/-/browserify-14.5.0.tgz#0bbbce521acd6e4d1d54d8e9365008efb85a9cc5" + dependencies: + JSONStream "^1.0.3" + assert "^1.4.0" + browser-pack "^6.0.1" + browser-resolve "^1.11.0" + browserify-zlib "~0.2.0" + buffer "^5.0.2" + cached-path-relative "^1.0.0" + concat-stream "~1.5.1" + console-browserify "^1.1.0" + constants-browserify "~1.0.0" + crypto-browserify "^3.0.0" + defined "^1.0.0" + deps-sort "^2.0.0" + domain-browser "~1.1.0" + duplexer2 "~0.1.2" + events "~1.1.0" + glob "^7.1.0" + has "^1.0.0" + htmlescape "^1.1.0" + https-browserify "^1.0.0" + inherits "~2.0.1" + insert-module-globals "^7.0.0" + labeled-stream-splicer "^2.0.0" + module-deps "^4.0.8" + os-browserify "~0.3.0" + parents "^1.0.1" + path-browserify "~0.0.0" + process "~0.11.0" + punycode "^1.3.2" + querystring-es3 "~0.2.0" + read-only-stream "^2.0.0" + readable-stream "^2.0.2" + resolve "^1.1.4" + shasum "^1.0.0" + shell-quote "^1.6.1" + stream-browserify "^2.0.0" + stream-http "^2.0.0" + string_decoder "~1.0.0" + subarg "^1.0.0" + syntax-error "^1.1.1" + through2 "^2.0.0" + timers-browserify "^1.0.1" + tty-browserify "~0.0.0" + url "~0.11.0" + util "~0.10.1" + vm-browserify "~0.0.1" + xtend "^4.0.0" + +buffer-shims@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" + +buffer-xor@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + +buffer@^5.0.2: + version "5.0.6" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.0.6.tgz#2ea669f7eec0b6eda05b08f8b5ff661b28573588" + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + +builtin-modules@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + +builtin-status-codes@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" + +cached-path-relative@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cached-path-relative/-/cached-path-relative-1.0.1.tgz#d09c4b52800aa4c078e2dd81a869aac90d2e54e7" + +caller-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" + dependencies: + callsites "^0.2.0" + +callsites@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" + +camel-case@3.0.x: + version "3.0.0" + resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73" + dependencies: + no-case "^2.2.0" + upper-case "^1.1.1" + +chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +cipher-base@^1.0.0, cipher-base@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.3.tgz#eeabf194419ce900da3018c207d212f2a6df0a07" + dependencies: + inherits "^2.0.1" + +circular-json@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d" + +clean-css@4.1.x: + version "4.1.9" + resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.1.9.tgz#35cee8ae7687a49b98034f70de00c4edd3826301" + dependencies: + source-map "0.5.x" + +cli-cursor@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" + dependencies: + restore-cursor "^1.0.1" + +cli-width@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +combine-source-map@~0.7.1: + version "0.7.2" + resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.7.2.tgz#0870312856b307a87cc4ac486f3a9a62aeccc09e" + dependencies: + convert-source-map "~1.1.0" + inline-source-map "~0.6.0" + lodash.memoize "~3.0.3" + source-map "~0.5.3" + +commander@2.11.x, commander@~2.11.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +concat-stream@^1.5.2, concat-stream@~1.5.0, concat-stream@~1.5.1: + version "1.5.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.5.2.tgz#708978624d856af41a5a741defdd261da752c266" + dependencies: + inherits "~2.0.1" + readable-stream "~2.0.0" + typedarray "~0.0.5" + +console-browserify@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" + dependencies: + date-now "^0.1.4" + +constants-browserify@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" + +contains-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" + +convert-source-map@~1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.1.3.tgz#4829c877e9fe49b3161f3bf3673888e204699860" + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +create-ecdh@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.0.tgz#888c723596cdf7612f6498233eebd7a35301737d" + dependencies: + bn.js "^4.1.0" + elliptic "^6.0.0" + +create-hash@^1.1.0, create-hash@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.2.tgz#51210062d7bb7479f6c65bb41a92208b1d61abad" + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + ripemd160 "^1.0.0" + sha.js "^2.3.6" + +create-hmac@^1.1.0, create-hmac@^1.1.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.4.tgz#d3fb4ba253eb8b3f56e39ea2fbcb8af747bd3170" + dependencies: + create-hash "^1.1.0" + inherits "^2.0.1" + +crypto-browserify@^3.0.0: + version "3.11.0" + resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.11.0.tgz#3652a0906ab9b2a7e0c3ce66a408e957a2485522" + dependencies: + browserify-cipher "^1.0.0" + browserify-sign "^4.0.0" + create-ecdh "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.0" + diffie-hellman "^5.0.0" + inherits "^2.0.1" + pbkdf2 "^3.0.3" + public-encrypt "^4.0.0" + randombytes "^2.0.0" + +d@1: + version "1.0.0" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" + dependencies: + es5-ext "^0.10.9" + +date-now@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" + +debug-log@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" + +debug@2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" + dependencies: + ms "0.7.1" + +debug@^2.1.1, debug@^2.2.0: + version "2.6.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.4.tgz#7586a9b3c39741c0282ae33445c4e8ac74734fe0" + dependencies: + ms "0.7.3" + +deep-equal@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + +define-properties@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" + dependencies: + foreach "^2.0.5" + object-keys "^1.0.8" + +defined@^1.0.0, defined@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" + +deglob@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/deglob/-/deglob-2.1.0.tgz#4d44abe16ef32c779b4972bd141a80325029a14a" + dependencies: + find-root "^1.0.0" + glob "^7.0.5" + ignore "^3.0.9" + pkg-config "^1.1.0" + run-parallel "^1.1.2" + uniq "^1.0.1" + +del@^2.0.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" + dependencies: + globby "^5.0.0" + is-path-cwd "^1.0.0" + is-path-in-cwd "^1.0.0" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + rimraf "^2.2.8" + +deps-sort@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/deps-sort/-/deps-sort-2.0.0.tgz#091724902e84658260eb910748cccd1af6e21fb5" + dependencies: + JSONStream "^1.0.3" + shasum "^1.0.0" + subarg "^1.0.0" + through2 "^2.0.0" + +des.js@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" + dependencies: + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +detective@^4.0.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/detective/-/detective-4.5.0.tgz#6e5a8c6b26e6c7a254b1c6b6d7490d98ec91edd1" + dependencies: + acorn "^4.0.3" + defined "^1.0.0" + +diffie-hellman@^5.0.0: + version "5.0.2" + resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e" + dependencies: + bn.js "^4.1.0" + miller-rabin "^4.0.0" + randombytes "^2.0.0" + +doctrine@1.5.0, doctrine@^1.2.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" + dependencies: + esutils "^2.0.2" + isarray "^1.0.0" + +doctrine@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.0.tgz#c73d8d2909d22291e1a007a395804da8b665fe63" + dependencies: + esutils "^2.0.2" + isarray "^1.0.0" + +dom-walk@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.1.tgz#672226dc74c8f799ad35307df936aba11acd6018" + +domain-browser@~1.1.0: + version "1.1.7" + resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc" + +duplexer2@^0.1.2, duplexer2@~0.1.0, duplexer2@~0.1.2: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" + dependencies: + readable-stream "^2.0.2" + +elliptic@^6.0.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df" + dependencies: + bn.js "^4.4.0" + brorand "^1.0.1" + hash.js "^1.0.0" + hmac-drbg "^1.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.0" + +error-ex@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.5.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.9.0.tgz#690829a07cae36b222e7fd9b75c0d0573eb25227" + dependencies: + es-to-primitive "^1.1.1" + function-bind "^1.1.1" + has "^1.0.1" + is-callable "^1.1.3" + is-regex "^1.0.4" + +es-abstract@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.7.0.tgz#dfade774e01bfcd97f96180298c449c8623fb94c" + dependencies: + es-to-primitive "^1.1.1" + function-bind "^1.1.0" + is-callable "^1.1.3" + is-regex "^1.0.3" + +es-to-primitive@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" + dependencies: + is-callable "^1.1.1" + is-date-object "^1.0.1" + is-symbol "^1.0.1" + +es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14: + version "0.10.15" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.15.tgz#c330a5934c1ee21284a7c081a86e5fd937c91ea6" + dependencies: + es6-iterator "2" + es6-symbol "~3.1" + +es6-iterator@2, es6-iterator@^2.0.1, es6-iterator@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.1.tgz#8e319c9f0453bf575d374940a655920e59ca5512" + dependencies: + d "1" + es5-ext "^0.10.14" + es6-symbol "^3.1" + +es6-map@^0.1.3: + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" + dependencies: + d "1" + es5-ext "~0.10.14" + es6-iterator "~2.0.1" + es6-set "~0.1.5" + es6-symbol "~3.1.1" + event-emitter "~0.3.5" + +es6-set@~0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" + dependencies: + d "1" + es5-ext "~0.10.14" + es6-iterator "~2.0.1" + es6-symbol "3.1.1" + event-emitter "~0.3.5" + +es6-symbol@3.1.1, es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1, es6-symbol@~3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" + dependencies: + d "1" + es5-ext "~0.10.14" + +es6-weak-map@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" + dependencies: + d "1" + es5-ext "^0.10.14" + es6-iterator "^2.0.1" + es6-symbol "^3.1.1" + +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +escope@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" + dependencies: + es6-map "^0.1.3" + es6-weak-map "^2.0.1" + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-config-standard-jsx@4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/eslint-config-standard-jsx/-/eslint-config-standard-jsx-4.0.2.tgz#009e53c4ddb1e9ee70b4650ffe63a7f39f8836e1" + +eslint-config-standard@10.2.1: + version "10.2.1" + resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-10.2.1.tgz#c061e4d066f379dc17cd562c64e819b4dd454591" + +eslint-import-resolver-node@^0.2.0: + version "0.2.3" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.2.3.tgz#5add8106e8c928db2cba232bcd9efa846e3da16c" + dependencies: + debug "^2.2.0" + object-assign "^4.0.1" + resolve "^1.1.6" + +eslint-module-utils@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.0.0.tgz#a6f8c21d901358759cdc35dbac1982ae1ee58bce" + dependencies: + debug "2.2.0" + pkg-dir "^1.0.0" + +eslint-plugin-import@~2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.2.0.tgz#72ba306fad305d67c4816348a4699a4229ac8b4e" + dependencies: + builtin-modules "^1.1.1" + contains-path "^0.1.0" + debug "^2.2.0" + doctrine "1.5.0" + eslint-import-resolver-node "^0.2.0" + eslint-module-utils "^2.0.0" + has "^1.0.1" + lodash.cond "^4.3.0" + minimatch "^3.0.3" + pkg-up "^1.0.0" + +eslint-plugin-node@~4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-4.2.2.tgz#82959ca9aed79fcbd28bb1b188d05cac04fb3363" + dependencies: + ignore "^3.0.11" + minimatch "^3.0.2" + object-assign "^4.0.1" + resolve "^1.1.7" + semver "5.3.0" + +eslint-plugin-promise@~3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-3.5.0.tgz#78fbb6ffe047201627569e85a6c5373af2a68fca" + +eslint-plugin-react@~6.10.0: + version "6.10.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-6.10.3.tgz#c5435beb06774e12c7db2f6abaddcbf900cd3f78" + dependencies: + array.prototype.find "^2.0.1" + doctrine "^1.2.2" + has "^1.0.1" + jsx-ast-utils "^1.3.4" + object.assign "^4.0.4" + +eslint-plugin-standard@~3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz#34d0c915b45edc6f010393c7eef3823b08565cf2" + +eslint@~3.19.0: + version "3.19.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.19.0.tgz#c8fc6201c7f40dd08941b87c085767386a679acc" + dependencies: + babel-code-frame "^6.16.0" + chalk "^1.1.3" + concat-stream "^1.5.2" + debug "^2.1.1" + doctrine "^2.0.0" + escope "^3.6.0" + espree "^3.4.0" + esquery "^1.0.0" + estraverse "^4.2.0" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + glob "^7.0.3" + globals "^9.14.0" + ignore "^3.2.0" + imurmurhash "^0.1.4" + inquirer "^0.12.0" + is-my-json-valid "^2.10.0" + is-resolvable "^1.0.0" + js-yaml "^3.5.1" + json-stable-stringify "^1.0.0" + levn "^0.3.0" + lodash "^4.0.0" + mkdirp "^0.5.0" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.1" + pluralize "^1.2.1" + progress "^1.1.8" + require-uncached "^1.0.2" + shelljs "^0.7.5" + strip-bom "^3.0.0" + strip-json-comments "~2.0.1" + table "^3.7.8" + text-table "~0.2.0" + user-home "^2.0.0" + +espree@^3.4.0: + version "3.4.2" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.2.tgz#38dbdedbedc95b8961a1fbf04734a8f6a9c8c592" + dependencies: + acorn "^5.0.1" + acorn-jsx "^3.0.0" + +esprima@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + +esquery@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa" + dependencies: + estraverse "^4.0.0" + +esrecurse@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.1.0.tgz#4713b6536adf7f2ac4f327d559e7756bff648220" + dependencies: + estraverse "~4.1.0" + object-assign "^4.0.1" + +estraverse@^4.0.0, estraverse@^4.1.1, estraverse@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + +estraverse@~4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.1.1.tgz#f6caca728933a850ef90661d0e17982ba47111a2" + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +event-emitter@~0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" + dependencies: + d "1" + es5-ext "~0.10.14" + +events@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" + +evp_bytestokey@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz#497b66ad9fef65cd7c08a6180824ba1476b66e53" + dependencies: + create-hash "^1.1.1" + +exit-hook@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + +figures@^1.3.5: + version "1.7.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + dependencies: + escape-string-regexp "^1.0.5" + object-assign "^4.1.0" + +file-entry-cache@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" + dependencies: + flat-cache "^1.2.1" + object-assign "^4.0.1" + +find-root@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.0.0.tgz#962ff211aab25c6520feeeb8d6287f8f6e95807a" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +find-up@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + dependencies: + locate-path "^2.0.0" + +flat-cache@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.2.tgz#fa86714e72c21db88601761ecf2f555d1abc6b96" + dependencies: + circular-json "^0.3.1" + del "^2.0.2" + graceful-fs "^4.1.2" + write "^0.2.1" + +for-each@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.2.tgz#2c40450b9348e97f281322593ba96704b9abd4d4" + dependencies: + is-function "~1.0.0" + +foreach@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +function-bind@^1.0.2, function-bind@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" + +function-bind@^1.1.1, function-bind@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + +generate-function@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" + +generate-object-property@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" + dependencies: + is-property "^1.0.0" + +get-stdin@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" + +glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.0: + version "7.1.1" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.2" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@~7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +global@^4.3.0: + version "4.3.2" + resolved "https://registry.yarnpkg.com/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f" + dependencies: + min-document "^2.19.0" + process "~0.5.1" + +globals@^9.14.0: + version "9.17.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.17.0.tgz#0c0ca696d9b9bb694d2e5470bd37777caad50286" + +globby@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" + dependencies: + array-union "^1.0.1" + arrify "^1.0.0" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +graceful-fs@^4.1.2: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has@^1.0.0, has@^1.0.1, has@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" + dependencies: + function-bind "^1.0.2" + +hash.js@^1.0.0, hash.js@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.0.3.tgz#1332ff00156c0a0ffdd8236013d07b77a0451573" + dependencies: + inherits "^2.0.1" + +he@1.1.x: + version "1.1.1" + resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" + +hmac-drbg@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +html-minifier@^3.5.6: + version "3.5.6" + resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.6.tgz#7e4e661a09999599c7d8e8a2b8d7fb7430bb5c3e" + dependencies: + camel-case "3.0.x" + clean-css "4.1.x" + commander "2.11.x" + he "1.1.x" + ncname "1.0.x" + param-case "2.1.x" + relateurl "0.2.x" + uglify-js "3.1.x" + +htmlescape@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/htmlescape/-/htmlescape-1.1.1.tgz#3a03edc2214bca3b66424a3e7959349509cb0351" + +https-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" + +hyperscript-attribute-to-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/hyperscript-attribute-to-property/-/hyperscript-attribute-to-property-1.0.0.tgz#825308d49bb8e2957923f731981bcc811cad7aff" + +hyperx@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/hyperx/-/hyperx-2.3.0.tgz#70f473d66d4ad550ddd1c83e4be2651276bbf1e2" + dependencies: + hyperscript-attribute-to-property "^1.0.0" + +ieee754@^1.1.4: + version "1.1.8" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" + +ignore@^3.0.11, ignore@^3.0.9, ignore@^3.2.0: + version "3.2.7" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.7.tgz#4810ca5f1d8eca5595213a34b94f2eb4ed926bbd" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + +indexof@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +inherits@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" + +inline-source-map@~0.6.0: + version "0.6.2" + resolved "https://registry.yarnpkg.com/inline-source-map/-/inline-source-map-0.6.2.tgz#f9393471c18a79d1724f863fa38b586370ade2a5" + dependencies: + source-map "~0.5.3" + +inquirer@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" + dependencies: + ansi-escapes "^1.1.0" + ansi-regex "^2.0.0" + chalk "^1.0.0" + cli-cursor "^1.0.1" + cli-width "^2.0.0" + figures "^1.3.5" + lodash "^4.3.0" + readline2 "^1.0.1" + run-async "^0.1.0" + rx-lite "^3.1.2" + string-width "^1.0.1" + strip-ansi "^3.0.0" + through "^2.3.6" + +insert-module-globals@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/insert-module-globals/-/insert-module-globals-7.0.1.tgz#c03bf4e01cb086d5b5e5ace8ad0afe7889d638c3" + dependencies: + JSONStream "^1.0.3" + combine-source-map "~0.7.1" + concat-stream "~1.5.1" + is-buffer "^1.1.0" + lexical-scope "^1.2.0" + process "~0.11.0" + through2 "^2.0.0" + xtend "^4.0.0" + +interpret@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + +is-buffer@^1.1.0: + version "1.1.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc" + +is-callable@^1.1.1, is-callable@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2" + +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + +is-function@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" + +is-my-json-valid@^2.10.0: + version "2.16.0" + resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693" + dependencies: + generate-function "^2.0.0" + generate-object-property "^1.1.0" + jsonpointer "^4.0.0" + xtend "^4.0.0" + +is-path-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" + +is-path-in-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" + dependencies: + is-path-inside "^1.0.0" + +is-path-inside@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.0.tgz#fc06e5a1683fbda13de667aff717bbc10a48f37f" + dependencies: + path-is-inside "^1.0.1" + +is-property@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" + +is-regex@^1.0.3, is-regex@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + dependencies: + has "^1.0.1" + +is-resolvable@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.0.tgz#8df57c61ea2e3c501408d100fb013cf8d6e0cc62" + dependencies: + tryit "^1.0.1" + +is-symbol@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" + +isarray@^1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isarray@~0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + +js-tokens@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" + +js-yaml@^3.5.1: + version "3.8.3" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.3.tgz#33a05ec481c850c8875929166fe1beb61c728766" + dependencies: + argparse "^1.0.7" + esprima "^3.1.1" + +json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + dependencies: + jsonify "~0.0.0" + +json-stable-stringify@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz#611c23e814db375527df851193db59dd2af27f45" + dependencies: + jsonify "~0.0.0" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + +jsonparse@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.0.tgz#85fc245b1d9259acc6941960b905adf64e7de0e8" + +jsonpointer@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" + +jsx-ast-utils@^1.3.4: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz#3867213e8dd79bf1e8f2300c0cfc1efb182c0df1" + +labeled-stream-splicer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/labeled-stream-splicer/-/labeled-stream-splicer-2.0.0.tgz#a52e1d138024c00b86b1c0c91f677918b8ae0a59" + dependencies: + inherits "^2.0.1" + isarray "~0.0.1" + stream-splicer "^2.0.0" + +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +lexical-scope@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/lexical-scope/-/lexical-scope-1.2.0.tgz#fcea5edc704a4b3a8796cdca419c3a0afaf22df4" + dependencies: + astw "^2.0.0" + +load-json-file@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + strip-bom "^3.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +lodash.cond@^4.3.0: + version "4.5.2" + resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5" + +lodash.memoize@~3.0.3: + version "3.0.4" + resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f" + +lodash@^4.0.0, lodash@^4.3.0: + version "4.17.4" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" + +lower-case@^1.1.1: + version "1.1.4" + resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac" + +miller-rabin@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.0.tgz#4a62fb1d42933c05583982f4c716f6fb9e6c6d3d" + dependencies: + bn.js "^4.0.0" + brorand "^1.0.1" + +min-document@^2.19.0: + version "2.19.0" + resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" + dependencies: + dom-walk "^0.1.0" + +minimalistic-assert@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz#702be2dda6b37f4836bcb3f5db56641b64a1d3d3" + +minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + +minimatch@^3.0.2, minimatch@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" + dependencies: + brace-expansion "^1.0.0" + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +minimist@^1.1.0, minimist@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +module-deps@^4.0.8: + version "4.1.1" + resolved "https://registry.yarnpkg.com/module-deps/-/module-deps-4.1.1.tgz#23215833f1da13fd606ccb8087b44852dcb821fd" + dependencies: + JSONStream "^1.0.3" + browser-resolve "^1.7.0" + cached-path-relative "^1.0.0" + concat-stream "~1.5.0" + defined "^1.0.0" + detective "^4.0.0" + duplexer2 "^0.1.2" + inherits "^2.0.1" + parents "^1.0.0" + readable-stream "^2.0.2" + resolve "^1.1.3" + stream-combiner2 "^1.1.1" + subarg "^1.0.0" + through2 "^2.0.0" + xtend "^4.0.0" + +ms@0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" + +ms@0.7.3: + version "0.7.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.3.tgz#708155a5e44e33f5fd0fc53e81d0d40a91be1fff" + +mute-stream@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" + +nanoassert@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/nanoassert/-/nanoassert-1.1.0.tgz#4f3152e09540fde28c76f44b19bbcd1d5a42478d" + +nanomorph@^5.1.3: + version "5.1.3" + resolved "https://registry.yarnpkg.com/nanomorph/-/nanomorph-5.1.3.tgz#65b81912bb32278aaa7aacc9ccd99b4508f6a21d" + dependencies: + nanoassert "^1.1.0" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + +ncname@1.0.x: + version "1.0.0" + resolved "https://registry.yarnpkg.com/ncname/-/ncname-1.0.0.tgz#5b57ad18b1ca092864ef62b0b1ed8194f383b71c" + dependencies: + xml-char-classes "^1.0.0" + +no-case@^2.2.0: + version "2.3.2" + resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.2.tgz#60b813396be39b3f1288a4c1ed5d1e7d28b464ac" + dependencies: + lower-case "^1.1.1" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +object-assign@^4.0.1, object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +object-inspect@~1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.3.0.tgz#5b1eb8e6742e2ee83342a637034d844928ba2f6d" + +object-keys@^1.0.10, object-keys@^1.0.8: + version "1.0.11" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" + +object.assign@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.0.4.tgz#b1c9cc044ef1b9fe63606fc141abbb32e14730cc" + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.0" + object-keys "^1.0.10" + +on-load@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/on-load/-/on-load-3.2.0.tgz#dd3145d3a5c2faa5666920d1df674b69f0c2f66f" + dependencies: + global "^4.3.0" + +once@^1.3.0: + version "1.3.3" + resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20" + dependencies: + wrappy "1" + +onetime@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" + +optionator@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +os-browserify@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +p-limit@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + dependencies: + p-limit "^1.1.0" + +pako@~1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.6.tgz#0101211baa70c4bca4a0f63f2206e97b7dfaf258" + +param-case@2.1.x: + version "2.1.1" + resolved "https://registry.yarnpkg.com/param-case/-/param-case-2.1.1.tgz#df94fd8cf6531ecf75e6bef9a0858fbc72be2247" + dependencies: + no-case "^2.2.0" + +parents@^1.0.0, parents@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parents/-/parents-1.0.1.tgz#fedd4d2bf193a77745fe71e371d73c3307d9c751" + dependencies: + path-platform "~0.11.15" + +parse-asn1@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.0.tgz#37c4f9b7ed3ab65c74817b5f2480937fbf97c712" + dependencies: + asn1.js "^4.0.0" + browserify-aes "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.0" + pbkdf2 "^3.0.3" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + +path-browserify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + dependencies: + pinkie-promise "^2.0.0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-is-inside@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + +path-platform@~0.11.15: + version "0.11.15" + resolved "https://registry.yarnpkg.com/path-platform/-/path-platform-0.11.15.tgz#e864217f74c36850f0852b78dc7bf7d4a5721bf2" + +pbkdf2@^3.0.3: + version "3.0.9" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.9.tgz#f2c4b25a600058b3c3773c086c37dbbee1ffe693" + dependencies: + create-hmac "^1.1.2" + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +pkg-conf@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-conf/-/pkg-conf-2.0.0.tgz#071c87650403bccfb9c627f58751bfe47c067279" + dependencies: + find-up "^2.0.0" + load-json-file "^2.0.0" + +pkg-config@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/pkg-config/-/pkg-config-1.1.1.tgz#557ef22d73da3c8837107766c52eadabde298fe4" + dependencies: + debug-log "^1.0.0" + find-root "^1.0.0" + xtend "^4.0.1" + +pkg-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" + dependencies: + find-up "^1.0.0" + +pkg-up@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-1.0.0.tgz#3e08fb461525c4421624a33b9f7e6d0af5b05a26" + dependencies: + find-up "^1.0.0" + +pluralize@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + +process-nextick-args@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" + +process@~0.11.0: + version "0.11.9" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.9.tgz#7bd5ad21aa6253e7da8682264f1e11d11c0318c1" + +process@~0.5.1: + version "0.5.2" + resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf" + +progress@^1.1.8: + version "1.1.8" + resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" + +public-encrypt@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6" + dependencies: + bn.js "^4.1.0" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + parse-asn1 "^5.0.0" + randombytes "^2.0.1" + +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + +punycode@^1.3.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + +querystring-es3@~0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" + +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + +randombytes@^2.0.0, randombytes@^2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.3.tgz#674c99760901c3c4112771a31e521dc349cc09ec" + +read-only-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-only-stream/-/read-only-stream-2.0.0.tgz#2724fd6a8113d73764ac288d4386270c1dbf17f0" + dependencies: + readable-stream "^2.0.2" + +readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.6: + version "2.2.9" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.9.tgz#cf78ec6f4a6d1eb43d26488cac97f042e74b7fc8" + dependencies: + buffer-shims "~1.0.0" + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~1.0.0" + util-deprecate "~1.0.1" + +readable-stream@~2.0.0: + version "2.0.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~0.10.x" + util-deprecate "~1.0.1" + +readline2@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/readline2/-/readline2-1.0.1.tgz#41059608ffc154757b715d9989d199ffbf372e35" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + mute-stream "0.0.5" + +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + dependencies: + resolve "^1.1.6" + +relateurl@0.2.x: + version "0.2.7" + resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" + +require-uncached@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" + dependencies: + caller-path "^0.1.0" + resolve-from "^1.0.0" + +resolve-from@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + +resolve@1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + +resolve@^1.1.3, resolve@^1.1.4, resolve@^1.1.6, resolve@^1.1.7: + version "1.3.3" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" + dependencies: + path-parse "^1.0.5" + +resolve@~1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.4.0.tgz#a75be01c53da25d934a98ebd0e4c4a7312f92a86" + dependencies: + path-parse "^1.0.5" + +restore-cursor@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" + dependencies: + exit-hook "^1.0.0" + onetime "^1.0.0" + +resumer@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759" + dependencies: + through "~2.3.4" + +rimraf@^2.2.8: + version "2.6.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" + dependencies: + glob "^7.0.5" + +ripemd160@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-1.0.1.tgz#93a4bbd4942bc574b69a8fa57c71de10ecca7d6e" + +run-async@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389" + dependencies: + once "^1.3.0" + +run-parallel@^1.1.2: + version "1.1.6" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.6.tgz#29003c9a2163e01e2d2dfc90575f2c6c1d61a039" + +rx-lite@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" + +semver@5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" + +sha.js@^2.3.6, sha.js@~2.4.4: + version "2.4.8" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.8.tgz#37068c2c476b6baf402d14a49c67f597921f634f" + dependencies: + inherits "^2.0.1" + +shasum@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/shasum/-/shasum-1.0.2.tgz#e7012310d8f417f4deb5712150e5678b87ae565f" + dependencies: + json-stable-stringify "~0.0.0" + sha.js "~2.4.4" + +shell-quote@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767" + dependencies: + array-filter "~0.0.0" + array-map "~0.0.0" + array-reduce "~0.0.0" + jsonify "~0.0.0" + +shelljs@^0.7.5: + version "0.7.7" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.7.tgz#b2f5c77ef97148f4b4f6e22682e10bba8667cff1" + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + +slice-ansi@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" + +source-map@0.5.x: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + +source-map@~0.5.3: + version "0.5.6" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" + +source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + +standard-engine@~7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/standard-engine/-/standard-engine-7.0.0.tgz#ebb77b9c8fc2c8165ffa353bd91ba0dff41af690" + dependencies: + deglob "^2.1.0" + get-stdin "^5.0.1" + minimist "^1.1.0" + pkg-conf "^2.0.0" + +standard@^10.0.2: + version "10.0.3" + resolved "https://registry.yarnpkg.com/standard/-/standard-10.0.3.tgz#7869bcbf422bdeeaab689a1ffb1fea9677dd50ea" + dependencies: + eslint "~3.19.0" + eslint-config-standard "10.2.1" + eslint-config-standard-jsx "4.0.2" + eslint-plugin-import "~2.2.0" + eslint-plugin-node "~4.2.2" + eslint-plugin-promise "~3.5.0" + eslint-plugin-react "~6.10.0" + eslint-plugin-standard "~3.0.1" + standard-engine "~7.0.0" + +stream-browserify@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" + dependencies: + inherits "~2.0.1" + readable-stream "^2.0.2" + +stream-combiner2@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stream-combiner2/-/stream-combiner2-1.1.1.tgz#fb4d8a1420ea362764e21ad4780397bebcb41cbe" + dependencies: + duplexer2 "~0.1.0" + readable-stream "^2.0.2" + +stream-http@^2.0.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.7.0.tgz#cec1f4e3b494bc4a81b451808970f8b20b4ed5f6" + dependencies: + builtin-status-codes "^3.0.0" + inherits "^2.0.1" + readable-stream "^2.2.6" + to-arraybuffer "^1.0.0" + xtend "^4.0.0" + +stream-splicer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/stream-splicer/-/stream-splicer-2.0.0.tgz#1b63be438a133e4b671cc1935197600175910d83" + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.2" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string-width@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.0.0.tgz#635c5436cc72a6e0c387ceca278d4e2eec52687e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^3.0.0" + +string.prototype.trim@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.5.0" + function-bind "^1.0.2" + +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + +string_decoder@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.0.tgz#f06f41157b664d86069f84bdbdc9b0d8ab281667" + dependencies: + buffer-shims "~1.0.0" + +strip-ansi@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +subarg@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/subarg/-/subarg-1.0.0.tgz#f62cf17581e996b48fc965699f54c06ae268b8d2" + dependencies: + minimist "^1.1.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +syntax-error@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/syntax-error/-/syntax-error-1.3.0.tgz#1ed9266c4d40be75dc55bf9bb1cb77062bb96ca1" + dependencies: + acorn "^4.0.3" + +table@^3.7.8: + version "3.8.3" + resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" + dependencies: + ajv "^4.7.0" + ajv-keywords "^1.0.0" + chalk "^1.1.1" + lodash "^4.0.0" + slice-ansi "0.0.4" + string-width "^2.0.0" + +tape@^4.8.0: + version "4.8.0" + resolved "https://registry.yarnpkg.com/tape/-/tape-4.8.0.tgz#f6a9fec41cc50a1de50fa33603ab580991f6068e" + dependencies: + deep-equal "~1.0.1" + defined "~1.0.0" + for-each "~0.3.2" + function-bind "~1.1.0" + glob "~7.1.2" + has "~1.0.1" + inherits "~2.0.3" + minimist "~1.2.0" + object-inspect "~1.3.0" + resolve "~1.4.0" + resumer "~0.0.0" + string.prototype.trim "~1.1.2" + through "~2.3.8" + +text-table@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + +through2@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" + dependencies: + readable-stream "^2.1.5" + xtend "~4.0.1" + +"through@>=2.2.7 <3", through@^2.3.6, through@~2.3.4, through@~2.3.8: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + +timers-browserify@^1.0.1: + version "1.4.2" + resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-1.4.2.tgz#c9c58b575be8407375cb5e2462dacee74359f41d" + dependencies: + process "~0.11.0" + +to-arraybuffer@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" + +tryit@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" + +tty-browserify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + dependencies: + prelude-ls "~1.1.2" + +typedarray@~0.0.5: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + +uglify-js@3.1.x: + version "3.1.6" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.1.6.tgz#918832602036e95d2318e11f27ee8461a8592c5d" + dependencies: + commander "~2.11.0" + source-map "~0.6.1" + +umd@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/umd/-/umd-3.0.1.tgz#8ae556e11011f63c2596708a8837259f01b3d60e" + +uniq@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" + +upper-case@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-1.1.3.tgz#f6b4501c2ec4cdd26ba78be7222961de77621598" + +url@~0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" + dependencies: + punycode "1.3.2" + querystring "0.2.0" + +user-home@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" + dependencies: + os-homedir "^1.0.0" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +util@0.10.3, util@~0.10.1: + version "0.10.3" + resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" + dependencies: + inherits "2.0.1" + +vm-browserify@~0.0.1: + version "0.0.4" + resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" + dependencies: + indexof "0.0.1" + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +write@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" + dependencies: + mkdirp "^0.5.1" + +xml-char-classes@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/xml-char-classes/-/xml-char-classes-1.0.0.tgz#64657848a20ffc5df583a42ad8a277b4512bbc4d" + +xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" diff --git a/node_modules/pem/.eslintignore b/node_modules/pem/.eslintignore new file mode 100644 index 000000000..62562b74a --- /dev/null +++ b/node_modules/pem/.eslintignore @@ -0,0 +1,2 @@ +coverage +node_modules diff --git a/node_modules/pem/.eslintrc.js b/node_modules/pem/.eslintrc.js new file mode 100644 index 000000000..7d401489e --- /dev/null +++ b/node_modules/pem/.eslintrc.js @@ -0,0 +1,11 @@ +module.exports = { + 'env': { + 'mocha': true, + 'node': true + }, + 'extends': 'standard', + 'plugins': [ + 'markdown', + 'json' + ] +} diff --git a/node_modules/pem/.travis.yml b/node_modules/pem/.travis.yml new file mode 100644 index 000000000..26c43b66d --- /dev/null +++ b/node_modules/pem/.travis.yml @@ -0,0 +1,63 @@ +language: node_js +sudo: required +notifications: + email: + recipients: + - github@josef-froehle.de + on_success: change + on_failure: change +node_js: + - '10' + - '8' + - '6' +env: + global: + - OPENSSL_DIR=/openssl + - TARGET=x86_64-unknown-linux-gnu + matrix: + - LIBRARY=openssl VERSION=0.9.8zh + - LIBRARY=openssl VERSION=1.0.1u + - LIBRARY=openssl VERSION=1.0.2p + - LIBRARY=openssl VERSION=1.1.0i + - LIBRARY=libressl VERSION=2.4.5 + - LIBRARY=libressl VERSION=2.6.5 + - LIBRARY=libressl VERSION=2.7.4 + - LIBRARY=libressl VERSION=2.8.0 +matrix: + exclude: + - node_js: '6' + - node_js: '8' + include: + - node_js: '6' + env: + - OPENSSL_DIR="" + - node_js: '8' + env: + - OPENSSL_DIR="" +before_install: + - sudo apt-get install -y haveged + - | + if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" != "false" ]]; then + #git clone "https://github.com/$TRAVIS_REPO_SLUG.git" "$TRAVIS_REPO_SLUG"; + #cd "$TRAVIS_REPO_SLUG"; + ( set -euo pipefail + if [[ "${TRAVIS_COMMIT}" != "$(git rev-parse HEAD)" ]]; then + echo "Commit $(git rev-parse HEAD) doesn't match expected commit ${TRAVIS_COMMIT}" + git checkout "${TRAVIS_COMMIT}" + fi + ) + fi +before_script: + - npm prune + - npm install -g travis-deploy-once + - sudo haveged -w 2048 +script: + - if [[ "$OPENSSL_DIR" != "" ]]; then "./bin/test_build_openssl.sh" ; fi + - npm run test +after_success: +# - if [[ "$TRAVIS_NODE_VERSION" == "8" && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then npm run aftersuccess ; fi + - if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then travis-deploy-once -b 3 && npm run changelog && npm run semantic-release ; fi +# - if [[ "$TRAVIS_NODE_VERSION" == "8" && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then npm run aftersuccess -- -push ; fi +branches: + except: + - /^v\d+\.\d+\.\d+$/ diff --git a/node_modules/pem/CHANGELOG.md b/node_modules/pem/CHANGELOG.md new file mode 100644 index 000000000..0529b2fa0 --- /dev/null +++ b/node_modules/pem/CHANGELOG.md @@ -0,0 +1,38 @@ +## [1.13.1](https://github.com/Dexus/pem/compare/v1.13.0...v1.13.1) (2018-09-14) + + +### Bug Fixes + +* **package:** remove -utf8 option ([4d10fb2](https://github.com/Dexus/pem/commit/4d10fb2)), closes [#214](https://github.com/Dexus/pem/issues/214) + +# [1.13.0](https://github.com/Dexus/pem/compare/v1.12.8...v1.13.0) (2018-09-11) + + +### Features + +* **package:** add promisify methods pem.promisify.FUNCTIONNAME ([8a0c1bc](https://github.com/Dexus/pem/commit/8a0c1bc)) + +## [1.12.8](https://github.com/Dexus/pem/compare/v1.12.7...v1.12.8) (2018-09-11) + + +### Bug Fixes + +* **package:** dep updates and fix deprecated api ([610a403](https://github.com/Dexus/pem/commit/610a403)) +* **package:** fix deprecated api ([6fdfd32](https://github.com/Dexus/pem/commit/6fdfd32)) +* **package:** fix deprecated api ([3fbe212](https://github.com/Dexus/pem/commit/3fbe212)) +* **pem:** allow utf8 charset in fields ([2cb97aa](https://github.com/Dexus/pem/commit/2cb97aa)) + +## [1.12.7](https://github.com/Dexus/pem/compare/v1.12.6...v1.12.7) (2018-09-11) + + +### Bug Fixes + +* **package:** fix fetchCertificate to list all infos ([3f13a0d](https://github.com/Dexus/pem/commit/3f13a0d)), closes [#196](https://github.com/Dexus/pem/issues/196) +* **package:** fix fetchCertificate to list all infos ([e6a8f3c](https://github.com/Dexus/pem/commit/e6a8f3c)), closes [#196](https://github.com/Dexus/pem/issues/196) + +## [1.12.6](https://github.com/Dexus/pem/compare/v1.12.5...v1.12.6) (2018-09-10) + + +### Bug Fixes + +* **package:** Update package ([ba9de04](https://github.com/Dexus/pem/commit/ba9de04)) diff --git a/node_modules/pem/CODE_OF_CONDUCT.md b/node_modules/pem/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..fc5296d01 --- /dev/null +++ b/node_modules/pem/CODE_OF_CONDUCT.md @@ -0,0 +1,84 @@ +# Code of Conduct + +## 1. Purpose + +A primary goal of PEM is to be inclusive to the largest number of contributors, with the most varied and diverse backgrounds possible. As such, we are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion (or lack thereof). + +This code of conduct outlines our expectations for all those who participate in our community, as well as the consequences for unacceptable behavior. + +We invite all those who participate in PEM to help us create safe and positive experiences for everyone. + +## 2. Open Source Citizenship + +A supplemental goal of this Code of Conduct is to increase open source citizenship by encouraging participants to recognize and strengthen the relationships between our actions and their effects on our community. + +Communities mirror the societies in which they exist and positive action is essential to counteract the many forms of inequality and abuses of power that exist in society. + +If you see someone who is making an extra effort to ensure our community is welcoming, friendly, and encourages all participants to contribute to the fullest extent, we want to know. + +## 3. Expected Behavior + +The following behaviors are expected and requested of all community members: + +* Participate in an authentic and active way. In doing so, you contribute to the health and longevity of this community. +* Exercise consideration and respect in your speech and actions. +* Attempt collaboration before conflict. +* Refrain from demeaning, discriminatory, or harassing behavior and speech. +* Be mindful of your surroundings and of your fellow participants. Alert community leaders if you notice a dangerous situation, someone in distress, or violations of this Code of Conduct, even if they seem inconsequential. +* Remember that community event venues may be shared with members of the public; please be respectful to all patrons of these locations. + +## 4. Unacceptable Behavior + +The following behaviors are considered harassment and are unacceptable within our community: + +* Violence, threats of violence or violent language directed against another person. +* Sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory jokes and language. +* Posting or displaying sexually explicit or violent material. +* Posting or threatening to post other people’s personally identifying information ("doxing"). +* Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability. +* Inappropriate photography or recording. +* Inappropriate physical contact. You should have someone’s consent before touching them. +* Unwelcome sexual attention. This includes, sexualized comments or jokes; inappropriate touching, groping, and unwelcomed sexual advances. +* Deliberate intimidation, stalking or following (online or in person). +* Advocating for, or encouraging, any of the above behavior. +* Sustained disruption of community events, including talks and presentations. + +## 5. Consequences of Unacceptable Behavior + +Unacceptable behavior from any community member, including sponsors and those with decision-making authority, will not be tolerated. + +Anyone asked to stop unacceptable behavior is expected to comply immediately. + +If a community member engages in unacceptable behavior, the community organizers may take any action they deem appropriate, up to and including a temporary ban or permanent expulsion from the community without warning (and without refund in the case of a paid event). + +## 6. Reporting Guidelines + +If you are subject to or witness unacceptable behavior, or have any other concerns, please notify a community organizer as soon as possible. github@josef-froehle.de. + + + +Additionally, community organizers are available to help community members engage with local law enforcement or to otherwise help those experiencing unacceptable behavior feel safe. In the context of in-person events, organizers will also provide escorts as desired by the person experiencing distress. + +## 7. Addressing Grievances + +If you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify Dexus with a concise description of your grievance. Your grievance will be handled in accordance with our existing governing policies. + + + +## 8. Scope + +We expect all community participants (contributors, paid or otherwise; sponsors; and other guests) to abide by this Code of Conduct in all community venues–online and in-person–as well as in all one-on-one communications pertaining to community business. + +This code of conduct and its related procedures also applies to unacceptable behavior occurring outside the scope of community activities when such behavior has the potential to adversely affect the safety and well-being of community members. + +## 9. Contact info + +github@josef-froehle.de + +## 10. License and attribution + +This Code of Conduct is distributed under a [Creative Commons Attribution-ShareAlike license](http://creativecommons.org/licenses/by-sa/3.0/). + +Portions of text derived from the [Django Code of Conduct](https://www.djangoproject.com/conduct/) and the [Geek Feminism Anti-Harassment Policy](http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Policy). + +Retrieved on November 22, 2016 from [http://citizencodeofconduct.org/](http://citizencodeofconduct.org/) diff --git a/node_modules/pem/CONTRIBUTING.md b/node_modules/pem/CONTRIBUTING.md new file mode 100644 index 000000000..736f094bb --- /dev/null +++ b/node_modules/pem/CONTRIBUTING.md @@ -0,0 +1,78 @@ +We love and appreciate contributions to Haraka. + +### To contribute money + +1. Create an issue +2. Use [Bountysource](https://www.bountysource.com/teams/dexus/issues) to post a bounty on that issue + +### To contribute code, use the Github "Pull Request" mechanism + +#### Overview + +1. fork, by clicking the Fork button on the [GitHub Project Page](https://github.com/Dexus/pem) +2. checkout a copy +3. create a branch +4. make changes +5. push changes to your fork +6. submit Pull Request + +#### Detailed Example + +```sh +export GHUSERNAME=CHANGE_THIS +git clone https://github.com/$GHUSERNAME/pem.git +cd pem +git checkout -b new_branch +$EDITOR lib/pem.js +git add lib/pem.js +git commit +git push origin new_branch +``` + +The `git commit` step(s) will launch you into `$EDITOR` where the first line should be a summary of the change(s) in less than 50 characters. Additional paragraphs can be added starting on line 3. + +To submit new_branch as a Pull Request, visit the [pem project page](https://github.com/Dexus/pem) where your recently pushed branches will appear with a green "Pull Request" button. + +### Rebase + +On branches with more than a couple commits, it's usually best to squash the commits (condense them into one) before submitting the change(s) as a PR. Notable exceptions to the single commit guideline are: + +* where there are multiple logical changes, put each in a commit (easier to review and revert) +* whitespace changes belong in their own commit +* no-op code refactoring is separate from functional changes + +To rebase: + +```sh +git remote add pem https://github.com/Dexus/pem.git +git remote update pem +git rebase -i pem/master +``` + +Change all but the first "pick" lines to "s" and save your changes. Your $EDITOR will then present you with all of the commit messages. Edit them and save. Then force push your branch: + +`git push -f` + +### General Guidelines + +* New features **must** be documented +* New features **should** include tests + +### Style conventions + +Standard Javascript + + +## Tests + +* run all tests: npm run test diff --git a/node_modules/pem/HISTORY.md b/node_modules/pem/HISTORY.md new file mode 100644 index 000000000..0dd944c04 --- /dev/null +++ b/node_modules/pem/HISTORY.md @@ -0,0 +1,96 @@ +### Changelog + +All notable changes to this project will be documented in this file. Dates are displayed in UTC. + +Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). + +#### [v1.13.0](https://github.com/Dexus/pem/compare/v1.12.8...v1.13.0) + +> 11 September 2018 + +- chore(release): 1.13.0 [skip ci] [`d5a20dd`](https://github.com/Dexus/pem/commit/d5a20ddaa4a0a6b5a79a0ec11afd4757d7176501) +- feat(package): add promisify methods pem.promisify.FUNCTIONNAME [`8a0c1bc`](https://github.com/Dexus/pem/commit/8a0c1bc5f22b213fc4386212a036c2ccb2006524) +- chore(package): add auto-changelog for history.md [`3a90fcb`](https://github.com/Dexus/pem/commit/3a90fcb5f5e0980ce5b48bd31fe850fecd702856) + +#### [v1.12.8](https://github.com/Dexus/pem/compare/v1.12.7...v1.12.8) + +> 11 September 2018 + +- chore(release): 1.12.8 [skip ci] [`a3d8edb`](https://github.com/Dexus/pem/commit/a3d8edb194d5dd354a6adf0cfd5978255f86ae6e) +- chore(package): fix node version dep [`515a518`](https://github.com/Dexus/pem/commit/515a51839f44bd3ec127040ffe5a0276051ce113) +- fix(package): fix deprecated api [`6fdfd32`](https://github.com/Dexus/pem/commit/6fdfd3209c1dd5d50d829c2f6db73a7df43c260c) + +#### [v1.12.7](https://github.com/Dexus/pem/compare/v1.12.6...v1.12.7) + +> 11 September 2018 + +- fix(package): fix fetchCertificate to list all infos [`#196`](https://github.com/Dexus/pem/issues/196) +- fix(package): fix fetchCertificate to list all infos [`#196`](https://github.com/Dexus/pem/issues/196) +- chore(release): 1.12.7 [skip ci] [`7d33439`](https://github.com/Dexus/pem/commit/7d33439f2ec68360a1e0176d4888b3cd18664c0b) + +#### [v1.12.6](https://github.com/Dexus/pem/compare/v1.12.5...v1.12.6) + +> 10 September 2018 + +- Added support for -CAserial flag via options.serialFile for createCer… [`#171`](https://github.com/Dexus/pem/pull/171) +- Fix broken public key detection from PKCS#8 formatted private keys [`#212`](https://github.com/Dexus/pem/pull/212) +- Added support to specify the parameter encoding of an ecparam key [`#207`](https://github.com/Dexus/pem/pull/207) +- Update travis-deploy-once to the latest version 🚀 [`#199`](https://github.com/Dexus/pem/pull/199) +- Update eslint-plugin-import to the latest version 🚀 [`#194`](https://github.com/Dexus/pem/pull/194) +- chore(release): 1.12.6 [skip ci] [`6975c5d`](https://github.com/Dexus/pem/commit/6975c5d7086dee5261514cf050efd16d55abcdec) +- fix(package): Update package [`ba9de04`](https://github.com/Dexus/pem/commit/ba9de04149bd877f6cf1bef3f0a854a6b8852e8a) +- fix(package) Update package [`40b8f42`](https://github.com/Dexus/pem/commit/40b8f42ce52766fc64824a625487bef1ffdb467c) + +#### [v1.12.5](https://github.com/Dexus/pem/compare/v1.12.4...v1.12.5) + +> 9 April 2018 + +- fix: Ensure synchronous tmpfile writes, deletes [`37d7cdd`](https://github.com/Dexus/pem/commit/37d7cddecc2fc8eefd7192d85c4115ea3c45db31) +- Ensure synchronous tmpfile writes, deletes [`85a00fb`](https://github.com/Dexus/pem/commit/85a00fbd65b50db7508f094d5ffb4f20d5ef0392) +- update bin/aftersuccess.sh [`371cc25`](https://github.com/Dexus/pem/commit/371cc254ba12e488b9925da21cdd9f17f69107a3) + +#### [v1.12.4](https://github.com/Dexus/pem/compare/v1.12.3...v1.12.4) + +> 4 April 2018 + +- fix: pin eslint-plugin-import to 2.10.0 [`#191`](https://github.com/Dexus/pem/pull/191) +- chore(package): update semantic-release to version 15.1.5 [`#190`](https://github.com/Dexus/pem/pull/190) +- chore(package): update cross-env to version 5.1.4 [`#189`](https://github.com/Dexus/pem/pull/189) +- Update eslint-config-standard to the latest version 🚀 [`#186`](https://github.com/Dexus/pem/pull/186) +- Update eslint-plugin-node to the latest version 🚀 [`#185`](https://github.com/Dexus/pem/pull/185) +- Update mocha to the latest version 🚀 [`#183`](https://github.com/Dexus/pem/pull/183) +- Update semantic-release to the latest version 🚀 [`#182`](https://github.com/Dexus/pem/pull/182) +- Update semantic-release to the latest version 🚀 [`#178`](https://github.com/Dexus/pem/pull/178) +- Update travis-deploy-once to the latest version 🚀 [`#181`](https://github.com/Dexus/pem/pull/181) +- chore(package): update cross-env to version 5.1.2 [`#180`](https://github.com/Dexus/pem/pull/180) +- Update docco to the latest version 🚀 [`#177`](https://github.com/Dexus/pem/pull/177) +- readCertificateInfo reports email addresses in subjectAltName field [`#170`](https://github.com/Dexus/pem/pull/170) +- chore(package): update semantic-release to version 15.1.5 [`#182`](https://github.com/Dexus/pem/issues/182) +- Update HISTORY.md via TravisCI [`8e89517`](https://github.com/Dexus/pem/commit/8e895178e7701e4f0fea7a5d98a41be10a4ce457) +- Update aftersuccess.sh [`e64edc9`](https://github.com/Dexus/pem/commit/e64edc98eea628736eb4d0ab04add946f878a989) +- Update aftersuccess.sh [`91df068`](https://github.com/Dexus/pem/commit/91df068ec55ec65cda9c62d55503f1a1ad6424d6) + +#### [v1.12.3](https://github.com/Dexus/pem/compare/v1.12.2...v1.12.3) + +> 10 October 2017 + +- Update HISTORY.md via TravisCI [`904f74d`](https://github.com/Dexus/pem/commit/904f74dd3c53ec2c68551230e518fd16af7b2efd) +- fix(package): #117 verifySigningChain optional CA certificates [`b6aafd4`](https://github.com/Dexus/pem/commit/b6aafd4909cca8b6a1b660eb42561b0dc5d1d5fa) + +#### [v1.12.2](https://github.com/Dexus/pem/compare/v1.12.1...v1.12.2) + +> 8 October 2017 + +- fix #150: serial can now be an 20 octets string, number or hex [`#150`](https://github.com/Dexus/pem/issues/150) +- Update HISTORY.md via TravisCI [`b58a0b2`](https://github.com/Dexus/pem/commit/b58a0b2ea8af3620337de3bf17dfebf21a5dd353) +- fix(package): build and release #150 fix and create HISTORY after release. [`e948217`](https://github.com/Dexus/pem/commit/e948217f34157024ec629d5d1111cbcef0c94e6a) +- chore(release-flow): change HISTORY.md only on master [`6da3254`](https://github.com/Dexus/pem/commit/6da325403b80a06d91d0cca2c46667c07414dbf5) + +#### v1.12.1 + +> 7 October 2017 + +- fix #159; renamed helper methods [`#159`](https://github.com/Dexus/pem/issues/159) +- change template for docs [`10672e4`](https://github.com/Dexus/pem/commit/10672e4d2d7e0c9e856e5bc1af90c4977da2ee8b) +- update template for docs [`2f95e38`](https://github.com/Dexus/pem/commit/2f95e3802ca2c742ec3c9f09591d4d34be165158) +- fix(tests): renamed helper functions [`0073032`](https://github.com/Dexus/pem/commit/007303276a16a03394361ab290d3d93a74ed77c8) diff --git a/node_modules/pem/LICENSE b/node_modules/pem/LICENSE new file mode 100644 index 000000000..6723091a7 --- /dev/null +++ b/node_modules/pem/LICENSE @@ -0,0 +1,17 @@ +Copyright (c) 2012 Andris Reinman +Copyright (c) 2016 Josef Fröhle + +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 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. \ No newline at end of file diff --git a/node_modules/pem/README.md b/node_modules/pem/README.md new file mode 100644 index 000000000..010d54b12 --- /dev/null +++ b/node_modules/pem/README.md @@ -0,0 +1,332 @@ +pem +=== + +Create private keys and certificates with node.js + +[![Build Status](https://secure.travis-ci.org/Dexus/pem.png)](http://travis-ci.org/Dexus/pem) [![npm version](https://badge.fury.io/js/pem.svg)](http://badge.fury.io/js/pem) [![npm downloads](https://img.shields.io/npm/dt/pem.svg)](https://www.npmjs.com/package/pem) [![pem documentation](https://img.shields.io/badge/pem-documentation-0099ff.svg?style=flat)](https://www.deineagentur.com/projects/pem) [![Greenkeeper badge](https://badges.greenkeeper.io/Dexus/pem.svg)](https://greenkeeper.io/) + + +[![JavaScript Style Guide](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/standard/standard) + +## Installation + +Install with npm + + npm install pem + +## Examples + +Here are some examples for creating an SSL key/cert on the fly, and running an HTTPS server on port 443. 443 is the standard HTTPS port, but requires root permissions on most systems. To get around this, you could use a higher port number, like 4300, and use https://localhost:4300 to access your server. + +### Basic https +```javascript +var https = require('https') +var pem = require('pem') + +pem.createCertificate({ days: 1, selfSigned: true }, function (err, keys) { + if (err) { + throw err + } + https.createServer({ key: keys.serviceKey, cert: keys.certificate }, function (req, res) { + res.end('o hai!') + }).listen(443) +}) +``` + +### Express +```javascript +var https = require('https') +var pem = require('pem') +var express = require('express') + +pem.createCertificate({ days: 1, selfSigned: true }, function (err, keys) { + if (err) { + throw err + } + var app = express() + + app.get('/', function (req, res) { + res.send('o hai!') + }) + + https.createServer({ key: keys.serviceKey, cert: keys.certificate }, app).listen(443) +}) +``` + +## API +Please have a look into the [API documentation](https://www.deineagentur.com/projects/pem/index.html). + +_we had to clean up a bit_ + + +### Custom extensions config file + +You can specify custom OpenSSL extensions using the `config` or `extFile` options for `createCertificate` (or using `csrConfigFile` with `createCSR`). + +`extFile` and `csrConfigFile` should be paths to the extension files. While `config` will generate a temporary file from the supplied file contents. + +If you specify `config` then the `v3_req` section of your config file will be used. + +The following would be an example of a Certificate Authority extensions file: + + [req] + req_extensions = v3_req + distinguished_name = req_distinguished_name + + [req_distinguished_name] + commonName = Common Name + commonName_max = 64 + + [v3_req] + basicConstraints = critical,CA:TRUE + +While the following would specify subjectAltNames in the resulting certificate: + + [req] + req_extensions = v3_req + + [ v3_req ] + basicConstraints = CA:FALSE + keyUsage = nonRepudiation, digitalSignature, keyEncipherment + subjectAltName = @alt_names + + [alt_names] + DNS.1 = host1.example.com + DNS.2 = host2.example.com + DNS.3 = host3.example.com + +Note that `createCertificate` and `createCSR` supports the `altNames` option which would be easier to use in most cases. + +**Warning: If you specify `altNames` the custom extensions file will not be passed to OpenSSL.** + +### Setting openssl location + +In some systems the `openssl` executable might not be available by the default name or it is not included in $PATH. In this case you can define the location of the executable yourself as a one time action after you have loaded the pem module: + +```javascript +var pem = require('pem') +pem.config({ + pathOpenSSL: '/usr/local/bin/openssl' +}) +// do something with the pem module +``` + +### Specialthanks to + +- Andris Reinman (@andris9) - Initiator of pem + +## License + +**MIT** diff --git a/node_modules/pem/bin/test_build_openssl.sh b/node_modules/pem/bin/test_build_openssl.sh new file mode 100755 index 000000000..bf61dd522 --- /dev/null +++ b/node_modules/pem/bin/test_build_openssl.sh @@ -0,0 +1,73 @@ +#!/bin/bash +set -e + +if [ -d "${OPENSSL_DIR}" ]; then + exit 0 +fi + +NORMALPATH=$(pwd) + +sudo apt-get install -y --no-install-recommends curl + +case "${LIBRARY}" in +"libressl") + URL1="http://ftp.eu.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${VERSION}.tar.gz" + URL2="http://ftp3.usa.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${VERSION}.tar.gz" + ;; +"openssl") + URL1="https://openssl.org/source/openssl-${VERSION}.tar.gz" + URL2="http://mirrors.ibiblio.org/openssl/source/openssl-${VERSION}.tar.gz" + ;; +esac + +case "${TARGET}" in +"x86_64-unknown-linux-gnu") + OS_COMPILER=linux-x86_64 + ;; +"i686-unknown-linux-gnu") + OS_COMPILER=linux-elf + OS_FLAGS=-m32 + ;; +"arm-unknown-linux-gnueabihf") + OS_COMPILER=linux-armv4 + export AR=arm-linux-gnueabihf-ar + export CC=arm-linux-gnueabihf-gcc + ;; +esac + +mkdir -p /tmp/build +cd /tmp/build + +OUT=/tmp/openssl.tgz +MAX_REDIRECTS=5 +curl -o ${OUT} -L --max-redirs ${MAX_REDIRECTS} "${URL1}" \ + || curl -o ${OUT} -L --max-redirs ${MAX_REDIRECTS} "${URL2}" + +tar --strip-components=1 -xzf ${OUT} + +case "${LIBRARY}" in +"openssl") + ./Configure --prefix="${OPENSSL_DIR}" ${OS_COMPILER} -fPIC -g ${OS_FLAGS} no-shared -static + ;; +"libressl") + ./configure --prefix="${OPENSSL_DIR}" --disable-shared --with-pic + ;; +esac + +make "-j$(nproc)" +sudo make install_sw + +case "${LIBRARY}" in +"openssl") + if [[ ! -f "${OPENSSL_DIR}/ssl/openssl.cnf" ]]; then sudo mkdir -p "${OPENSSL_DIR}/ssl" && sudo cp apps/openssl.cnf "${OPENSSL_DIR}/ssl/openssl.cnf" ; fi + ;; +"libressl") + if [[ ! -f "${OPENSSL_DIR}/ssl/openssl.cnf" ]]; then sudo mkdir -p "${OPENSSL_DIR}/ssl" && sudo cp apps/openssl/openssl.cnf "${OPENSSL_DIR}/ssl/openssl.cnf" ; fi + ;; +esac + +sudo chmod -Rf 0755 /openssl + +cd "${NORMALPATH}" + +rm -r -f node_modules && npm i diff --git a/node_modules/pem/jsdoc.json b/node_modules/pem/jsdoc.json new file mode 100644 index 000000000..fb02f7513 --- /dev/null +++ b/node_modules/pem/jsdoc.json @@ -0,0 +1,44 @@ +{ + "tags": { + "allowUnknownTags": false + }, + "source": { + "include": "./lib", + "includePattern": ".js$", + "excludePattern": "(node_modules/|test/|docs)" + }, + "plugins": ["plugins/markdown"], + "templates": { + "cleverLinks": true, + "monospaceLinks": true, + "outputSourceFiles": true, + "outputSourcePath": true, + "dateFormat": "MMMM Do YYYY, HH:mm Z", + "systemName": "pem", + "footer": "", + "copyright": "Copyright (c) 2012 Andris Reinman; 2016 Josef Fröhle", + "navType": "vertical", + "linenums": true, + "collapseSymbols": false, + "inverseNav": true, + "highlightTutorialCode": true, + "protocol": "html://", + "syntaxTheme": "dark" + }, + "markdown": { + "parser": "gfm", + "hardwrap": true + }, + "opts": { + "verbose": true, + "encoding": "utf8", + "destination": "docs/jsdoc/", + "recurse": true, + "readme": "./README.md", + "template": "node_modules/@deineagenturug/docdash" + }, + "docdash": { + "static": true, + "sort": true + } +} diff --git a/node_modules/pem/lib/convert.js b/node_modules/pem/lib/convert.js new file mode 100644 index 000000000..3096a6c83 --- /dev/null +++ b/node_modules/pem/lib/convert.js @@ -0,0 +1,278 @@ +'use strict' + +var openssl = require('./openssl.js') +var helper = require('./helper.js') + +// PEM format: .pem, .crt, .cer (!bin), .key +// base64 encoded; the cert file might also include the private key; so key file is optional + +// DER format: .der, .cer (bin) +// binary encoded format; cannot include key file + +// PKCS#7 / P7B format: .p7b, .p7c +// contains cert and ca chain cert files, but not the key file +// A PKCS7 certificate is serialized using either PEM or DER format. + +// PKCS#12 / PFX format: .pfx, .p12 +// contains all files: key file, cert and ca chain cert files + +/** + * pem convert module + * + * @module convert + */ + +/** + * conversion from PEM to DER format + * if private key is included in PEM encoded file, it won't be included in DER file + * use this method with type 'rsa' to export private key in that case + * @param {String} pathIN path of the PEM encoded certificate file + * @param {String} pathOUT path of the DER encoded certificate file to generate + * @param {String} [type] type of file, use 'rsa' for key file, 'x509' otherwise or leave this parameter out + * @param {Function} callback callback method called with error, boolean result + */ +module.exports.PEM2DER = function (pathIN, pathOUT, type, callback) { + if (!callback && typeof type === 'function') { + callback = type + type = 'x509' + } + var params = [ + type, + '-outform', + 'der', + '-in', + pathIN, + '-out', + pathOUT + ] + openssl.spawnWrapper(params, false, function (error, code) { + if (error) { + callback(error) + } else { + callback(null, code === 0) + } + }) +} + +/** + * conversion from DER to PEM format + * @param {String} pathIN path of the DER encoded certificate file + * @param {String} pathOUT path of the PEM encoded certificate file to generate + * @param {String} [type] type of file, use 'rsa' for key file, 'x509' otherwise or leave this parameter out + * @param {Function} callback callback method called with error, boolean result + */ +module.exports.DER2PEM = function (pathIN, pathOUT, type, callback) { + if (!callback && typeof type === 'function') { + callback = type + type = 'x509' + } + var params = [ + type, + '-inform', + 'der', + '-in', + pathIN, + '-out', + pathOUT + ] + openssl.spawnWrapper(params, false, function (error, code) { + if (error) { + callback(error) + } else { + callback(null, code === 0) + } + }) +} + +/** + * conversion from PEM to P7B format + * @param {Object} pathBundleIN paths of the PEM encoded certificate files ({cert: '...', ca: '...' or ['...', ...]}) + * @param {String} pathOUT path of the P7B encoded certificate file to generate + * @param {Function} callback callback method called with error, boolean result + */ +module.exports.PEM2P7B = function (pathBundleIN, pathOUT, callback) { + var params = [ + 'crl2pkcs7', + '-nocrl', + '-certfile', + pathBundleIN.cert, + '-out', + pathOUT + ] + if (pathBundleIN.ca) { + if (!Array.isArray(pathBundleIN.ca)) { + pathBundleIN.ca = [ pathBundleIN.ca ] + } + pathBundleIN.ca.forEach(function (ca) { + params.push('-certfile') + params.push(ca) + }) + } + openssl.spawnWrapper(params, false, function (error, code) { + if (error) { + callback(error) + } else { + callback(null, code === 0) + } + }) +} + +/** + * conversion from P7B to PEM format + * @param {String} pathIN path of the P7B encoded certificate file + * @param {String} pathOUT path of the PEM encoded certificate file to generate + * @param {Function} callback callback method called with error, boolean result + */ +module.exports.P7B2PEM = function (pathIN, pathOUT, callback) { + var params = [ + 'pkcs7', + '-print_certs', + '-in', + pathIN, + '-out', + pathOUT + ] + openssl.spawnWrapper(params, false, function (error, code) { + if (error) { + callback(error) + } else { + callback(null, code === 0) + } + }) +}// TODO: CA also included? + +/** + * conversion from PEM to PFX + * @param {Object} pathBundleIN paths of the PEM encoded certificate files ({cert: '...', key: '...', ca: '...' or ['...', ...]}) + * @param {String} pathOUT path of the PFX encoded certificate file to generate + * @param {String} password password to set for accessing the PFX file + * @param {Function} callback callback method called with error, boolean result + */ +module.exports.PEM2PFX = function (pathBundleIN, pathOUT, password, callback) { + var params = [ + 'pkcs12', + '-export', + '-out', + pathOUT, + '-inkey', + pathBundleIN.key, + '-in', + pathBundleIN.cert + ] + if (pathBundleIN.ca) { + if (!Array.isArray(pathBundleIN.ca)) { + pathBundleIN.ca = [ pathBundleIN.ca ] + } + pathBundleIN.ca.forEach(function (ca) { + params.push('-certfile') + params.push(ca) + }) + } + var delTempPWFiles = [] + helper.createPasswordFile({ 'cipher': '', 'password': password, 'passType': 'in' }, params, delTempPWFiles[delTempPWFiles.length]) + helper.createPasswordFile({ 'cipher': '', 'password': password, 'passType': 'out' }, params, delTempPWFiles[delTempPWFiles.length]) + openssl.spawnWrapper(params, false, function (error, code) { + function done (error) { + if (error) { + callback(error) + } else { + callback(null, code === 0) + } + } + helper.deleteTempFiles(delTempPWFiles, function (fsErr) { + done(error || fsErr) + }) + }) +} + +/** + * conversion from PFX to PEM + * @param {Object} pathIN path of the PFX encoded certificate file + * @param {String} pathOUT path of the PEM encoded certificate file to generate + * @param {String} password password to set for accessing the PFX file + * @param {Function} callback callback method called with error, boolean result + */ +module.exports.PFX2PEM = function (pathIN, pathOUT, password, callback) { + var params = [ + 'pkcs12', + '-in', + pathIN, + '-out', + pathOUT, + '-nodes' + ] + var delTempPWFiles = [] + helper.createPasswordFile({ 'cipher': '', 'password': password, 'passType': 'in' }, params, delTempPWFiles[delTempPWFiles.length]) + helper.createPasswordFile({ 'cipher': '', 'password': password, 'passType': 'out' }, params, delTempPWFiles[delTempPWFiles.length]) + openssl.spawnWrapper(params, false, function (error, code) { + function done (error) { + if (error) { + callback(error) + } else { + callback(null, code === 0) + } + } + helper.deleteTempFiles(delTempPWFiles, function (fsErr) { + done(error || fsErr) + }) + }) +} + +/** + * conversion from P7B to PFX/PKCS#12 + * @param {Object} pathBundleIN paths of the PEM encoded certificate files ({cert: '...', key: '...', ca: '...' or ['...', ...]}) + * @param {String} pathOUT path of the PFX certificate file to generate + * @param {String} password password to be set for the PFX file and to be used to access the key file + * @param {Function} callback callback method called with error, boolean result + */ +module.exports.P7B2PFX = function (pathBundleIN, pathOUT, password, callback) { + var tmpfile = pathBundleIN.cert.replace(/\.[^.]+$/, '.cer') + var params = [ + 'pkcs7', + '-print_certs', + '-in', + pathBundleIN.cert, + '-out', + tmpfile + ] + openssl.spawnWrapper(params, false, function (error, code) { + if (error) { + callback(error) + } else { + var params = [ + 'pkcs12', + '-export', + '-in', + tmpfile, + '-inkey', + pathBundleIN.key, + '-out', + pathOUT + ] + if (pathBundleIN.ca) { + if (!Array.isArray(pathBundleIN.ca)) { + pathBundleIN.ca = [ pathBundleIN.ca ] + } + pathBundleIN.ca.forEach(function (ca) { + params.push('-certfile') + params.push(ca) + }) + } + var delTempPWFiles = [tmpfile] + helper.createPasswordFile({ 'cipher': '', 'password': password, 'passType': 'in' }, params, delTempPWFiles[delTempPWFiles.length]) + helper.createPasswordFile({ 'cipher': '', 'password': password, 'passType': 'out' }, params, delTempPWFiles[delTempPWFiles.length]) + openssl.spawnWrapper(params, false, function (error, code) { + function done (error) { + if (error) { + callback(error) + } else { + callback(null, code === 0) + } + } + helper.deleteTempFiles(delTempPWFiles, function (fsErr) { + done(error || fsErr) + }) + }) + } + }) +} diff --git a/node_modules/pem/lib/helper.js b/node_modules/pem/lib/helper.js new file mode 100644 index 000000000..e9a2bf776 --- /dev/null +++ b/node_modules/pem/lib/helper.js @@ -0,0 +1,137 @@ +'use strict' + +var pathlib = require('path') +var fs = require('fs') +var crypto = require('crypto') +var osTmpdir = require('os-tmpdir') +var tempDir = process.env.PEMJS_TMPDIR || osTmpdir() +/** + * pem helper module + * + * @module helper + */ + +/** + * helper function to check is the string a number or not + * @param {String} str String that should be checked to be a number + */ +module.exports.isNumber = function (str) { + if (Array.isArray(str)) { + return false + } + /* + var bstr = str && str.toString() + str = str + '' + + return bstr - parseFloat(bstr) + 1 >= 0 && + !/^\s+|\s+$/g.test(str) && /^\d+$/g.test(str) && + !isNaN(str) && !isNaN(parseFloat(str)) + */ + return /^\d+$/g.test(str) +} + +/** + * helper function to check is the string a hexaceximal value + * @param {String} hex String that should be checked to be a hexaceximal + */ +module.exports.isHex = function isHex (hex) { + return /^(0x){0,1}([0-9A-F]{1,40}|[0-9A-F]{1,40})$/gi.test(hex) +} + +/** + * helper function to convert a string to a hexaceximal value + * @param {String} str String that should be converted to a hexaceximal + */ +module.exports.toHex = function toHex (str) { + var hex = '' + for (var i = 0; i < str.length; i++) { + hex += '' + str.charCodeAt(i).toString(16) + } + return hex +} + +// cipherPassword returns an array of supported ciphers. +/** + * list of supported ciphers + * @type {Array} + */ +module.exports.ciphers = ['aes128', 'aes192', 'aes256', 'camellia128', 'camellia192', 'camellia256', 'des', 'des3', 'idea'] +var ciphers = module.exports.ciphers + +/** + * Creates a PasswordFile to hide the password form process infos via `ps auxf` etc. + * @param {Object} options object of cipher, password and passType, mustPass, {cipher:'aes128', password:'xxxx', passType:"in/out/word"}, if the object empty we do nothing + * @param {String} options.cipher cipher like 'aes128', 'aes192', 'aes256', 'camellia128', 'camellia192', 'camellia256', 'des', 'des3', 'idea' + * @param {String} options.password password can be empty or at last 4 to 1023 chars + * @param {String} options.passType passType: can be in/out/word for passIN/passOUT/passWORD + * @param {Boolean} options.mustPass mustPass is used when you need to set the pass like as "-password pass:" most needed when empty password + * @param {Object} params params will be extended with the data that need for the openssl command. IS USED AS POINTER! + * @param {String} PasswordFile PasswordFile is the filePath that later need to deleted, after the openssl command. IS USED AS POINTER! + * @return {Boolean} result + */ +module.exports.createPasswordFile = function (options, params, PasswordFile) { + if (!options || !options.hasOwnProperty('password') || !options.hasOwnProperty('passType') || !/^(word|in|out)$/.test(options.passType)) { + return false + } + PasswordFile = pathlib.join(tempDir, crypto.randomBytes(20).toString('hex')) + options.password = options.password.trim() + if (options.password === '') { + options.mustPass = true + } + if (options.cipher && (ciphers.indexOf(options.cipher) !== -1)) { + params.push('-' + options.cipher) + } + params.push('-pass' + options.passType) + if (options.mustPass) { + params.push('pass:' + options.password) + } else { + fs.writeFileSync(PasswordFile, options.password) + params.push('file:' + PasswordFile) + } + return true +} + +/** + * Deletes a file or an array of files + * @param {Array} files array of files that shoudld be deleted + * @param {errorCallback} callback Callback function with an error object + */ +module.exports.deleteTempFiles = function (files, callback) { + var rmFiles = [] + if (typeof files === 'string') { + rmFiles.push(files) + } else if (Array.isArray(files)) { + rmFiles = files + } else { + return callback(new Error('Unexcepted files parameter type; only string or array supported')) + } + var deleteSeries = function (list, finalCallback) { + if (list.length) { + var file = list.shift() + var myCallback = function (err) { + if (err && err.code === 'ENOENT') { + // file doens't exist + return deleteSeries(list, finalCallback) + } else if (err) { + // other errors, e.g. maybe we don't have enough permission + return finalCallback(err) + } else { + return deleteSeries(list, finalCallback) + } + } + if (file && typeof file === 'string') { + fs.unlink(file, myCallback) + } else { + return deleteSeries(list, finalCallback) + } + } else { + return finalCallback(null) // no errors + } + } + deleteSeries(rmFiles, callback) +} +/** + * Callback for return an error object. + * @callback errorCallback + * @param {Error} err - An Error Object or null + */ diff --git a/node_modules/pem/lib/openssl.js b/node_modules/pem/lib/openssl.js new file mode 100644 index 000000000..aa397b2c8 --- /dev/null +++ b/node_modules/pem/lib/openssl.js @@ -0,0 +1,257 @@ +var helper = require('./helper.js') +var cpspawn = require('child_process').spawn +var pathlib = require('path') +var fs = require('fs') +var osTmpdir = require('os-tmpdir') +var crypto = require('crypto') +var which = require('which') +var settings = {} +var tempDir = process.env.PEMJS_TMPDIR || osTmpdir() + +/** + * pem openssl module + * + * @module openssl + */ + +/** + * configue this openssl module + * + * @static + * @param {String} option name e.g. pathOpenSSL, openSslVersion; TODO rethink nomenclature + * @param {*} value value + */ +function set (option, value) { + settings[option] = value +} + +/** + * get configuration setting value + * + * @static + * @param {String} option name + */ +function get (option) { + return settings[option] || null +} + +/** + * Spawn an openssl command + * + * @static + * @param {Array} params Array of openssl command line parameters + * @param {String} searchStr String to use to find data + * @param {Array} [tmpfiles] list of temporary files + * @param {Function} callback Called with (error, stdout-substring) + */ +function exec (params, searchStr, tmpfiles, callback) { + if (!callback && typeof tmpfiles === 'function') { + callback = tmpfiles + tmpfiles = false + } + + spawnWrapper(params, tmpfiles, function (err, code, stdout, stderr) { + var start, end + + if (err) { + return callback(err) + } + + if ((start = stdout.match(new RegExp('\\-+BEGIN ' + searchStr + '\\-+$', 'm')))) { + start = start.index + } else { + start = -1 + } + + // To get the full EC key with parameters and private key + if (searchStr === 'EC PARAMETERS') { + searchStr = 'EC PRIVATE KEY' + } + + if ((end = stdout.match(new RegExp('^\\-+END ' + searchStr + '\\-+', 'm')))) { + end = end.index + end[0].length + } else { + end = -1 + } + + if (start >= 0 && end >= 0) { + return callback(null, stdout.substring(start, end)) + } else { + return callback(new Error(searchStr + ' not found from openssl output:\n---stdout---\n' + stdout + '\n---stderr---\n' + stderr + '\ncode: ' + code)) + } + }) +} + +/** + * Spawn an openssl command and get binary output + * + * @static + * @param {Array} params Array of openssl command line parameters + * @param {Array} [tmpfiles] list of temporary files + * @param {Function} callback Called with (error, stdout) +*/ +function execBinary (params, tmpfiles, callback) { + if (!callback && typeof tmpfiles === 'function') { + callback = tmpfiles + tmpfiles = false + } + spawnWrapper(params, tmpfiles, true, function (err, code, stdout, stderr) { + if (err) { + return callback(err) + } + return callback(null, stdout) + }) +} + +/** + * Generically spawn openSSL, without processing the result + * + * @static + * @param {Array} params The parameters to pass to openssl + * @param {Boolean} binary Output of openssl is binary or text + * @param {Function} callback Called with (error, exitCode, stdout, stderr) + */ +function spawn (params, binary, callback) { + var pathBin = get('pathOpenSSL') || process.env.OPENSSL_BIN || 'openssl' + + testOpenSSLPath(pathBin, function (err) { + if (err) { + return callback(err) + } + var openssl = cpspawn(pathBin, params) + var stderr = '' + + var stdout = (binary ? Buffer.alloc(0) : '') + openssl.stdout.on('data', function (data) { + if (!binary) { + stdout += data.toString('binary') + } else { + stdout = Buffer.concat([stdout, data]) + } + }) + + openssl.stderr.on('data', function (data) { + stderr += data.toString('binary') + }) + // We need both the return code and access to all of stdout. Stdout isn't + // *really* available until the close event fires; the timing nuance was + // making this fail periodically. + var needed = 2 // wait for both exit and close. + var code = -1 + var finished = false + var done = function (err) { + if (finished) { + return + } + + if (err) { + finished = true + return callback(err) + } + + if (--needed < 1) { + finished = true + if (code) { + if (code === 2 && (stderr === '' || /depth lookup: unable to/.test(stderr))) { + return callback(null, code, stdout, stderr) + } + return callback(new Error('Invalid openssl exit code: ' + code + '\n% openssl ' + params.join(' ') + '\n' + stderr), code) + } else { + return callback(null, code, stdout, stderr) + } + } + } + + openssl.on('error', done) + + openssl.on('exit', function (ret) { + code = ret + done() + }) + + openssl.on('close', function () { + stdout = (binary ? stdout : Buffer.from(stdout, 'binary').toString('utf-8')) + stderr = Buffer.from(stderr, 'binary').toString('utf-8') + done() + }) + }) +} + +/** + * Wrapper for spawn method + * + * @static + * @param {Array} params The parameters to pass to openssl + * @param {Array} [tmpfiles] list of temporary files + * @param {Boolean} [binary] Output of openssl is binary or text + * @param {Function} callback Called with (error, exitCode, stdout, stderr) + */ +function spawnWrapper (params, tmpfiles, binary, callback) { + if (!callback && typeof binary === 'function') { + callback = binary + binary = false + } + + var files = [] + var delTempPWFiles = [] + + if (tmpfiles) { + tmpfiles = [].concat(tmpfiles) + var fpath, i + for (i = 0; i < params.length; i++) { + if (params[i] === '--TMPFILE--') { + fpath = pathlib.join(tempDir, crypto.randomBytes(20).toString('hex')) + files.push({ + path: fpath, + contents: tmpfiles.shift() + }) + params[i] = fpath + delTempPWFiles.push(fpath) + } + } + } + + var file + for (i = 0; i < files.length; i++) { + file = files[i] + fs.writeFileSync(file.path, file.contents) + } + + spawn(params, binary, function (err, code, stdout, stderr) { + helper.deleteTempFiles(delTempPWFiles, function (fsErr) { + callback(err || fsErr, code, stdout, stderr) + }) + }) +} + +/** + * Validates the pathBin for the openssl command + * + * @private + * @param {String} pathBin The path to OpenSSL Bin + * @param {Function} callback Callback function with an error object + */ +function testOpenSSLPath (pathBin, callback) { + which(pathBin, function (error) { + if (error) { + return callback(new Error('Could not find openssl on your system on this path: ' + pathBin)) + } + callback() + }) +} + +/* Once PEM is imported, the openSslVersion is set with this function. */ +spawn(['version'], false, function (err, code, stdout, stderr) { + var text = String(stdout) + '\n' + String(stderr) + '\n' + String(err) + var tmp = text.match(/^LibreSSL/i) + set('openSslVersion', (tmp && tmp[0] ? 'LibreSSL' : 'openssl').toUpperCase()) +}) + +module.exports = { + exec: exec, + execBinary: execBinary, + spawn: spawn, + spawnWrapper: spawnWrapper, + set: set, + get: get +} diff --git a/node_modules/pem/lib/pem.js b/node_modules/pem/lib/pem.js new file mode 100644 index 000000000..873017819 --- /dev/null +++ b/node_modules/pem/lib/pem.js @@ -0,0 +1,1288 @@ +'use strict' + +/** + * pem module + * + * @module pem + */ + +const { promisify } = require('es6-promisify') +var net = require('net') +var helper = require('./helper.js') +var openssl = require('./openssl.js') + +module.exports.createPrivateKey = createPrivateKey +module.exports.createDhparam = createDhparam +module.exports.createEcparam = createEcparam +module.exports.createCSR = createCSR +module.exports.createCertificate = createCertificate +module.exports.readCertificateInfo = readCertificateInfo +module.exports.getPublicKey = getPublicKey +module.exports.getFingerprint = getFingerprint +module.exports.getModulus = getModulus +module.exports.getDhparamInfo = getDhparamInfo +module.exports.createPkcs12 = createPkcs12 +module.exports.readPkcs12 = readPkcs12 +module.exports.verifySigningChain = verifySigningChain +module.exports.checkCertificate = checkCertificate +module.exports.checkPkcs12 = checkPkcs12 +module.exports.config = config + +/** + * quick access the convert module + * @type {module:convert} + */ +module.exports.convert = require('./convert.js') + +var KEY_START = '-----BEGIN PRIVATE KEY-----' +var KEY_END = '-----END PRIVATE KEY-----' +var RSA_KEY_START = '-----BEGIN RSA PRIVATE KEY-----' +var RSA_KEY_END = '-----END RSA PRIVATE KEY-----' +var ENCRYPTED_KEY_START = '-----BEGIN ENCRYPTED PRIVATE KEY-----' +var ENCRYPTED_KEY_END = '-----END ENCRYPTED PRIVATE KEY-----' +var CERT_START = '-----BEGIN CERTIFICATE-----' +var CERT_END = '-----END CERTIFICATE-----' + +/** + * Creates a private key + * + * @static + * @param {Number} [keyBitsize=2048] Size of the key, defaults to 2048bit + * @param {Object} [options] object of cipher and password {cipher:'aes128',password:'xxx'}, defaults empty object + * @param {String} [options.cipher] string of the cipher for the encryption - needed with password + * @param {String} [options.password] string of the cipher password for the encryption needed with cipher + * @param {Function} callback Callback function with an error object and {key} + */ +function createPrivateKey (keyBitsize, options, callback) { + if (!callback && !options && typeof keyBitsize === 'function') { + callback = keyBitsize + keyBitsize = undefined + options = {} + } else if (!callback && keyBitsize && typeof options === 'function') { + callback = options + options = {} + } + + keyBitsize = Number(keyBitsize) || 2048 + + var params = ['genrsa'] + var delTempPWFiles = [] + + if (options && options.cipher && (Number(helper.ciphers.indexOf(options.cipher)) !== -1) && options.password) { + helper.createPasswordFile({ 'cipher': options.cipher, 'password': options.password, 'passType': 'out' }, params, delTempPWFiles[delTempPWFiles.length]) + } + + params.push(keyBitsize) + + openssl.exec(params, 'RSA PRIVATE KEY', function (sslErr, key) { + function done (err) { + if (err) { + return callback(err) + } + callback(null, { + key: key + }) + } + helper.deleteTempFiles(delTempPWFiles, function (fsErr) { + done(sslErr || fsErr) + }) + }) +} + +/** + * Creates a dhparam key + * + * @static + * @param {Number} [keyBitsize=512] Size of the key, defaults to 512bit + * @param {Function} callback Callback function with an error object and {dhparam} + */ +function createDhparam (keyBitsize, callback) { + if (!callback && typeof keyBitsize === 'function') { + callback = keyBitsize + keyBitsize = undefined + } + + keyBitsize = Number(keyBitsize) || 512 + + var params = ['dhparam', + '-outform', + 'PEM', + keyBitsize + ] + + openssl.exec(params, 'DH PARAMETERS', function (error, dhparam) { + if (error) { + return callback(error) + } + return callback(null, { + dhparam: dhparam + }) + }) +} + +/** + * Creates a ecparam key + * @static + * @param {String} [keyName=secp256k1] Name of the key, defaults to secp256k1 + * @param {String} [paramEnc=explicit] Encoding of the elliptic curve parameters, defaults to explicit + * @param {Boolean} [noOut=false] This option inhibits the output of the encoded version of the parameters. + * @param {Function} callback Callback function with an error object and {ecparam} + */ +function createEcparam (keyName, paramEnc, noOut, callback) { + if (!callback && typeof noOut === 'undefined' && !paramEnc && typeof keyName === 'function') { + callback = keyName + keyName = undefined + } else if (!callback && typeof noOut === 'undefined' && keyName && typeof paramEnc === 'function') { + callback = paramEnc + paramEnc = undefined + } else if (!callback && typeof noOut === 'function' && keyName && paramEnc) { + callback = noOut + noOut = undefined + } + + keyName = keyName || 'secp256k1' + paramEnc = paramEnc || 'explicit' + noOut = noOut || false + + var params = ['ecparam', + '-name', + keyName, + '-genkey', + '-param_enc', + paramEnc + ] + + var searchString = 'EC PARAMETERS' + if (noOut) { + params.push('-noout') + searchString = 'EC PRIVATE KEY' + } + + openssl.exec(params, searchString, function (error, ecparam) { + if (error) { + return callback(error) + } + return callback(null, { + ecparam: ecparam + }) + }) +} + +/** + * Creates a Certificate Signing Request + * If client key is undefined, a new key is created automatically. The used key is included + * in the callback return as clientKey + * @static + * @param {Object} [options] Optional options object + * @param {String} [options.clientKey] Optional client key to use + * @param {Number} [options.keyBitsize] If clientKey is undefined, bit size to use for generating a new key (defaults to 2048) + * @param {String} [options.hash] Hash function to use (either md5 sha1 or sha256, defaults to sha256) + * @param {String} [options.country] CSR country field + * @param {String} [options.state] CSR state field + * @param {String} [options.locality] CSR locality field + * @param {String} [options.organization] CSR organization field + * @param {String} [options.organizationUnit] CSR organizational unit field + * @param {String} [options.commonName='localhost'] CSR common name field + * @param {String} [options.emailAddress] CSR email address field + * @param {String} [options.csrConfigFile] CSR config file + * @param {Array} [options.altNames] is a list of subjectAltNames in the subjectAltName field + * @param {Function} callback Callback function with an error object and {csr, clientKey} + */ +function createCSR (options, callback) { + if (!callback && typeof options === 'function') { + callback = options + options = undefined + } + + options = options || {} + + // http://stackoverflow.com/questions/14089872/why-does-node-js-accept-ip-addresses-in-certificates-only-for-san-not-for-cn + if (options.commonName && (net.isIPv4(options.commonName) || net.isIPv6(options.commonName))) { + if (!options.altNames) { + options.altNames = [options.commonName] + } else if (options.altNames.indexOf(options.commonName) === -1) { + options.altNames = options.altNames.concat([options.commonName]) + } + } + + if (!options.clientKey) { + createPrivateKey(options.keyBitsize || 2048, function (error, keyData) { + if (error) { + return callback(error) + } + options.clientKey = keyData.key + createCSR(options, callback) + }) + return + } + + var params = ['req', + '-new', + '-' + (options.hash || 'sha256') + ] + + if (options.csrConfigFile) { + params.push('-config') + params.push(options.csrConfigFile) + } else { + params.push('-subj') + params.push(generateCSRSubject(options)) + } + + params.push('-key') + params.push('--TMPFILE--') + + var tmpfiles = [options.clientKey] + var config = null + + if (options.altNames && Array.isArray(options.altNames) && options.altNames.length) { + params.push('-extensions') + params.push('v3_req') + params.push('-config') + params.push('--TMPFILE--') + var altNamesRep = [] + for (var i = 0; i < options.altNames.length; i++) { + altNamesRep.push((net.isIP(options.altNames[i]) ? 'IP' : 'DNS') + '.' + (i + 1) + ' = ' + options.altNames[i]) + } + + tmpfiles.push(config = [ + '[req]', + 'req_extensions = v3_req', + 'distinguished_name = req_distinguished_name', + '[v3_req]', + 'subjectAltName = @alt_names', + '[alt_names]', + altNamesRep.join('\n'), + '[req_distinguished_name]', + 'commonName = Common Name', + 'commonName_max = 64' + ].join('\n')) + } else if (options.config) { + config = options.config + } + + var delTempPWFiles = [] + if (options.clientKeyPassword) { + helper.createPasswordFile({ 'cipher': '', 'password': options.clientKeyPassword, 'passType': 'in' }, params, delTempPWFiles[delTempPWFiles.length]) + } + + openssl.exec(params, 'CERTIFICATE REQUEST', tmpfiles, function (sslErr, data) { + function done (err) { + if (err) { + return callback(err) + } + callback(null, { + csr: data, + config: config, + clientKey: options.clientKey + }) + } + helper.deleteTempFiles(delTempPWFiles, function (fsErr) { + done(sslErr || fsErr) + }) + }) +} + +/** + * Creates a certificate based on a CSR. If CSR is not defined, a new one + * will be generated automatically. For CSR generation all the options values + * can be used as with createCSR. + * @static + * @param {Object} [options] Optional options object + * @param {String} [options.serviceCertificate] PEM encoded certificate + * @param {String} [options.serviceKey] Private key for signing the certificate, if not defined a new one is generated + * @param {String} [options.serviceKeyPassword] Password of the service key + * @param {Boolean} [options.selfSigned] If set to true and serviceKey is not defined, use clientKey for signing + * @param {String|Number} [options.serial] Set a serial max. 20 octets - only together with options.serviceCertificate + * @param {String} [options.serialFile] Set the name of the serial file, without extension. - only together with options.serviceCertificate and never in tandem with options.serial + * @param {String} [options.hash] Hash function to use (either md5 sha1 or sha256, defaults to sha256) + * @param {String} [options.csr] CSR for the certificate, if not defined a new one is generated + * @param {Number} [options.days] Certificate expire time in days + * @param {String} [options.clientKeyPassword] Password of the client key + * @param {String} [options.extFile] extension config file - without '-extensions v3_req' + * @param {String} [options.config] extension config file - with '-extensions v3_req' + * @param {Function} callback Callback function with an error object and {certificate, csr, clientKey, serviceKey} + */ +function createCertificate (options, callback) { + if (!callback && typeof options === 'function') { + callback = options + options = undefined + } + + options = options || {} + + if (!options.csr) { + createCSR(options, function (error, keyData) { + if (error) { + return callback(error) + } + options.csr = keyData.csr + options.config = keyData.config + options.clientKey = keyData.clientKey + createCertificate(options, callback) + }) + return + } + + if (!options.serviceKey) { + if (options.selfSigned) { + options.serviceKey = options.clientKey + } else { + createPrivateKey(options.keyBitsize || 2048, function (error, keyData) { + if (error) { + return callback(error) + } + options.serviceKey = keyData.key + createCertificate(options, callback) + }) + return + } + } + + var params = ['x509', + '-req', + '-' + (options.hash || 'sha256'), + '-days', + Number(options.days) || '365', + '-in', + '--TMPFILE--' + ] + var tmpfiles = [options.csr] + var delTempPWFiles = [] + + if (options.serviceCertificate) { + params.push('-CA') + params.push('--TMPFILE--') + params.push('-CAkey') + params.push('--TMPFILE--') + if (options.serial) { + params.push('-set_serial') + if (helper.isNumber(options.serial)) { + // set the serial to the max lenth of 20 octets () + // A certificate serial number is not decimal conforming. That is the + // bytes in a serial number do not necessarily map to a printable ASCII + // character. + // eg: 0x00 is a valid serial number and can not be represented in a + // human readable format (atleast one that can be directly mapped to + // the ACSII table). + params.push('0x' + ('0000000000000000000000000000000000000000' + options.serial.toString(16)).slice(-40)) + } else { + if (helper.isHex(options.serial)) { + if (options.serial.startsWith('0x')) { + options.serial = options.serial.substring(2, options.serial.length) + } + params.push('0x' + ('0000000000000000000000000000000000000000' + options.serial).slice(-40)) + } else { + params.push('0x' + ('0000000000000000000000000000000000000000' + helper.toHex(options.serial)).slice(-40)) + } + } + } else { + params.push('-CAcreateserial') + if (options.serialFile) { + params.push('-CAserial') + params.push(options.serialFile + '.srl') + } + } + if (options.serviceKeyPassword) { + helper.createPasswordFile({ 'cipher': '', 'password': options.serviceKeyPassword, 'passType': 'in' }, params, delTempPWFiles[delTempPWFiles.length]) + } + tmpfiles.push(options.serviceCertificate) + tmpfiles.push(options.serviceKey) + } else { + params.push('-signkey') + params.push('--TMPFILE--') + if (options.serviceKeyPassword) { + helper.createPasswordFile({ 'cipher': '', 'password': options.serviceKeyPassword, 'passType': 'in' }, params, delTempPWFiles[delTempPWFiles.length]) + } + tmpfiles.push(options.serviceKey) + } + + if (options.config) { + params.push('-extensions') + params.push('v3_req') + params.push('-extfile') + params.push('--TMPFILE--') + tmpfiles.push(options.config) + } else if (options.extFile) { + params.push('-extfile') + params.push(options.extFile) + } + + if (options.clientKeyPassword) { + helper.createPasswordFile({ 'cipher': '', 'password': options.clientKeyPassword, 'passType': 'in' }, params, delTempPWFiles[delTempPWFiles.length]) + } + + openssl.exec(params, 'CERTIFICATE', tmpfiles, function (sslErr, data) { + function done (err) { + if (err) { + return callback(err) + } + var response = { + csr: options.csr, + clientKey: options.clientKey, + certificate: data, + serviceKey: options.serviceKey + } + return callback(null, response) + } + + helper.deleteTempFiles(delTempPWFiles, function (fsErr) { + done(sslErr || fsErr) + }) + }) +} + +/** + * Exports a public key from a private key, CSR or certificate + * @static + * @param {String} certificate PEM encoded private key, CSR or certificate + * @param {Function} callback Callback function with an error object and {publicKey} + */ +function getPublicKey (certificate, callback) { + if (!callback && typeof certificate === 'function') { + callback = certificate + certificate = undefined + } + + certificate = (certificate || '').toString() + + var params + + if (certificate.match(/BEGIN(\sNEW)? CERTIFICATE REQUEST/)) { + params = ['req', + '-in', + '--TMPFILE--', + '-pubkey', + '-noout' + ] + } else if (certificate.match(/BEGIN RSA PRIVATE KEY/) || certificate.match(/BEGIN PRIVATE KEY/)) { + params = ['rsa', + '-in', + '--TMPFILE--', + '-pubout' + ] + } else { + params = ['x509', + '-in', + '--TMPFILE--', + '-pubkey', + '-noout' + ] + } + + openssl.exec(params, 'PUBLIC KEY', certificate, function (error, key) { + if (error) { + return callback(error) + } + return callback(null, { + publicKey: key + }) + }) +} + +/** + * Reads subject data from a certificate or a CSR + * @static + * @param {String} certificate PEM encoded CSR or certificate + * @param {Function} callback Callback function with an error object and {country, state, locality, organization, organizationUnit, commonName, emailAddress} + */ +function readCertificateInfo (certificate, callback) { + if (!callback && typeof certificate === 'function') { + callback = certificate + certificate = undefined + } + + certificate = (certificate || '').toString() + var isMatch = certificate.match(/BEGIN(\sNEW)? CERTIFICATE REQUEST/) + var type = isMatch ? 'req' : 'x509' + var params = [type, + '-noout', + '-nameopt', + 'RFC2253,sep_multiline,space_eq,-esc_msb,utf8', + '-text', + '-in', + '--TMPFILE--' + ] + openssl.spawnWrapper(params, certificate, function (err, code, stdout, stderr) { + if (err) { + return callback(err) + } else if (stderr) { + return callback(stderr) + } + return fetchCertificateData(stdout, callback) + }) +} + +/** + * get the modulus from a certificate, a CSR or a private key + * @static + * @param {String} certificate PEM encoded, CSR PEM encoded, or private key + * @param {String} [password] password for the certificate + * @param {String} [hash] hash function to use (up to now `md5` supported) (default: none) + * @param {Function} callback Callback function with an error object and {modulus} + */ +function getModulus (certificate, password, hash, callback) { + if (!callback && !hash && typeof password === 'function') { + callback = password + password = undefined + hash = false + } else if (!callback && hash && typeof hash === 'function') { + callback = hash + hash = false + // password will be falsy if not provided + } + // adding hash function to params, is not supported by openssl. + // process piping would be the right way (... | openssl md5) + // No idea how this can be achieved in easy with the current build in methods + // of pem. + if (hash && hash !== 'md5') { + hash = false + } + + certificate = (Buffer.isBuffer(certificate) && certificate.toString()) || certificate + + var type = '' + if (certificate.match(/BEGIN(\sNEW)? CERTIFICATE REQUEST/)) { + type = 'req' + } else if (certificate.match(/BEGIN RSA PRIVATE KEY/) || certificate.match(/BEGIN PRIVATE KEY/)) { + type = 'rsa' + } else { + type = 'x509' + } + var params = [ + type, + '-noout', + '-modulus', + '-in', + '--TMPFILE--' + ] + var delTempPWFiles = [] + if (password) { + helper.createPasswordFile({ 'cipher': '', 'password': password, 'passType': 'in' }, params, delTempPWFiles[delTempPWFiles.length]) + } + + openssl.spawnWrapper(params, certificate, function (sslErr, code, stdout, stderr) { + function done (err) { + if (err) { + return callback(err) + } + var match = stdout.match(/Modulus=([0-9a-fA-F]+)$/m) + if (match) { + return callback(null, { + modulus: hash ? require(hash)(match[1]) : match[1] + }) + } else { + return callback(new Error('No modulus')) + } + } + helper.deleteTempFiles(delTempPWFiles, function (fsErr) { + done(sslErr || fsErr || stderr) + }) + }) +} + +/** + * get the size and prime of DH parameters + * @static + * @param {String} DH parameters PEM encoded + * @param {Function} callback Callback function with an error object and {size, prime} + */ +function getDhparamInfo (dh, callback) { + dh = (Buffer.isBuffer(dh) && dh.toString()) || dh + + var params = [ + 'dhparam', + '-text', + '-in', + '--TMPFILE--' + ] + + openssl.spawnWrapper(params, dh, function (err, code, stdout, stderr) { + if (err) { + return callback(err) + } else if (stderr) { + return callback(stderr) + } + + var result = {} + var match = stdout.match(/Parameters: \((\d+) bit\)/) + + if (match) { + result.size = Number(match[1]) + } + + var prime = '' + stdout.split('\n').forEach(function (line) { + if (/\s+([0-9a-f][0-9a-f]:)+[0-9a-f]?[0-9a-f]?/g.test(line)) { + prime += line.trim() + } + }) + + if (prime) { + result.prime = prime + } + + if (!match && !prime) { + return callback(new Error('No DH info found')) + } + + return callback(null, result) + }) +} + +/** + * config the pem module + * @static + * @param {Object} options + */ +function config (options) { + Object.keys(options).forEach(function (k) { + openssl.set(k, options[k]) + }) +} + +/** + * Gets the fingerprint for a certificate + * @static + * @param {String} PEM encoded certificate + * @param {String} [hash] hash function to use (either `md5`, `sha1` or `sha256`, defaults to `sha1`) + * @param {Function} callback Callback function with an error object and {fingerprint} + */ +function getFingerprint (certificate, hash, callback) { + if (!callback && typeof hash === 'function') { + callback = hash + hash = undefined + } + + hash = hash || 'sha1' + + var params = ['x509', + '-in', + '--TMPFILE--', + '-fingerprint', + '-noout', + '-' + hash + ] + + openssl.spawnWrapper(params, certificate, function (err, code, stdout, stderr) { + if (err) { + return callback(err) + } else if (stderr) { + return callback(stderr) + } + var match = stdout.match(/Fingerprint=([0-9a-fA-F:]+)$/m) + if (match) { + return callback(null, { + fingerprint: match[1] + }) + } else { + return callback(new Error('No fingerprint')) + } + }) +} + +/** + * Export private key and certificate to a PKCS12 keystore + * @static + * @param {String} PEM encoded private key + * @param {String} PEM encoded certificate + * @param {String} Password of the result PKCS12 file + * @param {Object} [options] object of cipher and optional client key password {cipher:'aes128', clientKeyPassword: 'xxxx', certFiles: ['file1','file2']} + * @param {Function} callback Callback function with an error object and {pkcs12} + */ +function createPkcs12 (key, certificate, password, options, callback) { + if (!callback && typeof options === 'function') { + callback = options + options = {} + } + + var params = ['pkcs12', '-export'] + var delTempPWFiles = [] + + if (options.cipher && options.clientKeyPassword) { + // NOTICE: The password field is needed! self if it is empty. + // create password file for the import "-passin" + helper.createPasswordFile({ 'cipher': options.cipher, 'password': options.clientKeyPassword, 'passType': 'in' }, params, delTempPWFiles[delTempPWFiles.length]) + } + // NOTICE: The password field is needed! self if it is empty. + // create password file for the password "-password" + helper.createPasswordFile({ 'cipher': '', 'password': password, 'passType': 'word' }, params, delTempPWFiles[delTempPWFiles.length]) + + params.push('-in') + params.push('--TMPFILE--') + params.push('-inkey') + params.push('--TMPFILE--') + + var tmpfiles = [certificate, key] + + if (options.certFiles) { + tmpfiles.push(options.certFiles.join('')) + + params.push('-certfile') + params.push('--TMPFILE--') + } + + openssl.execBinary(params, tmpfiles, function (sslErr, pkcs12) { + function done (err) { + if (err) { + return callback(err) + } + return callback(null, { + pkcs12: pkcs12 + }) + } + helper.deleteTempFiles(delTempPWFiles, function (fsErr) { + done(sslErr || fsErr) + }) + }) +} + +/** + * read sslcert data from Pkcs12 file. Results are provided in callback response in object notation ({cert: .., ca:..., key:...}) + * @static + * @param {Buffer|String} bufferOrPath Buffer or path to file + * @param {Object} [options] openssl options + * @param {Function} callback Called with error object and sslcert bundle object + */ +function readPkcs12 (bufferOrPath, options, callback) { + if (!callback && typeof options === 'function') { + callback = options + options = {} + } + + options.p12Password = options.p12Password || '' + + var tmpfiles = [] + var delTempPWFiles = [] + var args = ['pkcs12', '-in', bufferOrPath] + + helper.createPasswordFile({ 'cipher': '', 'password': options.p12Password, 'passType': 'in' }, args, delTempPWFiles[delTempPWFiles.length]) + + if (Buffer.isBuffer(bufferOrPath)) { + tmpfiles = [bufferOrPath] + args[2] = '--TMPFILE--' + } + + if (options.clientKeyPassword) { + helper.createPasswordFile({ 'cipher': '', 'password': options.clientKeyPassword, 'passType': 'out' }, args, delTempPWFiles[delTempPWFiles.length]) + } else { + args.push('-nodes') + } + + openssl.execBinary(args, tmpfiles, function (sslErr, stdout) { + function done (err) { + var keybundle = {} + + if (err && err.message.indexOf('No such file or directory') !== -1) { + err.code = 'ENOENT' + } + + if (!err) { + var certs = readFromString(stdout, CERT_START, CERT_END) + keybundle.cert = certs.shift() + keybundle.ca = certs + keybundle.key = readFromString(stdout, KEY_START, KEY_END).pop() + + if (keybundle.key) { + // convert to RSA key + return openssl.exec(['rsa', '-in', '--TMPFILE--'], 'RSA PRIVATE KEY', [keybundle.key], function (err, key) { + keybundle.key = key + + return callback(err, keybundle) + }) + } + + if (options.clientKeyPassword) { + keybundle.key = readFromString(stdout, ENCRYPTED_KEY_START, ENCRYPTED_KEY_END).pop() + } else { + keybundle.key = readFromString(stdout, RSA_KEY_START, RSA_KEY_END).pop() + } + } + + return callback(err, keybundle) + } + helper.deleteTempFiles(delTempPWFiles, function (fsErr) { + done(sslErr || fsErr) + }) + }) +} + +/** + * Check a certificate + * @static + * @param {String} PEM encoded certificate + * @param {String} [passphrase] password for the certificate + * @param {Function} callback Callback function with an error object and a boolean valid + */ +function checkCertificate (certificate, passphrase, callback) { + var params + var delTempPWFiles = [] + + if (!callback && typeof passphrase === 'function') { + callback = passphrase + passphrase = undefined + } + certificate = (certificate || '').toString() + + if (certificate.match(/BEGIN(\sNEW)? CERTIFICATE REQUEST/)) { + params = ['req', '-text', '-noout', '-verify', '-in', '--TMPFILE--'] + } else if (certificate.match(/BEGIN RSA PRIVATE KEY/) || certificate.match(/BEGIN PRIVATE KEY/)) { + params = ['rsa', '-noout', '-check', '-in', '--TMPFILE--'] + } else { + params = ['x509', '-text', '-noout', '-in', '--TMPFILE--'] + } + if (passphrase) { + helper.createPasswordFile({ 'cipher': '', 'password': passphrase, 'passType': 'in' }, params, delTempPWFiles[delTempPWFiles.length]) + } + + openssl.spawnWrapper(params, certificate, function (sslErr, code, stdout, stderr) { + function done (err) { + if (err && err.toString().trim() !== 'verify OK') { + return callback(err) + } + var result + switch (params[0]) { + case 'rsa': + result = /^Rsa key ok$/i.test(stdout.trim()) + break + default: + result = /Signature Algorithm/im.test(stdout) + break + } + + callback(null, result) + } + helper.deleteTempFiles(delTempPWFiles, function (fsErr) { + done(sslErr || fsErr || stderr) + }) + }) +} + +/** + * check a PKCS#12 file (.pfx or.p12) + * @static + * @param {Buffer|String} bufferOrPath PKCS#12 certificate + * @param {String} [passphrase] optional passphrase which will be used to open the keystore + * @param {Function} callback Callback function with an error object and a boolean valid + */ +function checkPkcs12 (bufferOrPath, passphrase, callback) { + if (!callback && typeof passphrase === 'function') { + callback = passphrase + passphrase = '' + } + + var tmpfiles = [] + var delTempPWFiles = [] + var args = ['pkcs12', '-info', '-in', bufferOrPath, '-noout', '-maciter', '-nodes'] + + helper.createPasswordFile({ 'cipher': '', 'password': passphrase, 'passType': 'in' }, args, delTempPWFiles[delTempPWFiles.length]) + + if (Buffer.isBuffer(bufferOrPath)) { + tmpfiles = [bufferOrPath] + args[3] = '--TMPFILE--' + } + + openssl.spawnWrapper(args, tmpfiles, function (sslErr, code, stdout, stderr) { + function done (err) { + if (err) { + return callback(err) + } + callback(null, (/MAC verified OK/im.test(stderr) || (!(/MAC verified OK/im.test(stderr)) && !(/Mac verify error/im.test(stderr))))) + } + helper.deleteTempFiles(delTempPWFiles, function (fsErr) { + done(sslErr || fsErr) + }) + }) +} + +/** + * Verifies the signing chain of the passed certificate + * @static + * @param {String|Array} PEM encoded certificate include intermediate certificates + * @param {String|Array} [List] of CA certificates + * @param {Function} callback Callback function with an error object and a boolean valid + */ +function verifySigningChain (certificate, ca, callback) { + if (!callback && typeof ca === 'function') { + callback = ca + ca = undefined + } + if (!Array.isArray(certificate)) { + certificate = [certificate] + } + if (!Array.isArray(ca) && ca !== undefined) { + if (ca !== '') { + ca = [ca] + } + } + + var files = [] + + if (ca !== undefined) { + // ca certificates + files.push(ca.join('\n')) + } + // certificate incl. intermediate certificates + files.push(certificate.join('\n')) + + var params = ['verify'] + + if (ca !== undefined) { + // ca certificates + params.push('-CAfile') + params.push('--TMPFILE--') + } + // certificate incl. intermediate certificates + params.push('--TMPFILE--') + + openssl.spawnWrapper(params, files, function (err, code, stdout, stderr) { + if (err) { + return callback(err) + } + + callback(null, stdout.trim().slice(-4) === ': OK') + }) +} + +// HELPER FUNCTIONS +function fetchCertificateData (certData, callback) { + certData = (certData || '').toString() + + var serial, subject, tmp, issuer + var certValues = { + issuer: {} + } + var validity = {} + var san + + var ky, i + + // serial + if ((serial = certData.match(/\s*Serial Number:\r?\n?\s*([^\r\n]*)\r?\n\s*\b/)) && serial.length > 1) { + certValues.serial = serial[1] + } + + if ((subject = certData.match(/\s*Subject:\r?\n(\s*(([a-zA-Z0-9.]+)\s=\s[^\r\n]+\r?\n))*\s*\b/)) && subject.length > 1) { + subject = subject[0] + tmp = matchAll(subject, /\s([a-zA-Z0-9.]+)\s=\s([^\r\n].*)/g) + for (i = 0; i < tmp.length; i++) { + ky = tmp[i][1].trim() + if (ky.match('(C|ST|L|O|OU|CN|emailAddress|DC)') || ky === '') { + continue + } + certValues[ky] = tmp[i][2].trim() + } + + // country + tmp = subject.match(/\sC\s=\s([^\r\n].*?)[\r\n]/) + certValues.country = (tmp && tmp[1]) || '' + + // state + tmp = subject.match(/\sST\s=\s([^\r\n].*?)[\r\n]/) + certValues.state = (tmp && tmp[1]) || '' + + // locality + tmp = subject.match(/\sL\s=\s([^\r\n].*?)[\r\n]/) + certValues.locality = (tmp && tmp[1]) || '' + + // organization + tmp = matchAll(subject, /\sO\s=\s([^\r\n].*)/g) + certValues.organization = tmp ? (tmp.length > 1 ? tmp.sort(function (t, n) { + var e = t[1].toUpperCase() + var r = n[1].toUpperCase() + return r > e ? -1 : e > r ? 1 : 0 + }).sort(function (t, n) { + return t[1].length - n[1].length + }).map(function (t) { + return t[1] + }) : tmp[0][1]) : '' + + // unit + tmp = matchAll(subject, /\sOU\s=\s([^\r\n].*)/g) + certValues.organizationUnit = tmp ? (tmp.length > 1 ? tmp.sort(function (t, n) { + var e = t[1].toUpperCase() + var r = n[1].toUpperCase() + return r > e ? -1 : e > r ? 1 : 0 + }).sort(function (t, n) { + return t[1].length - n[1].length + }).map(function (t) { + return t[1] + }) : tmp[0][1]) : '' + + // common name + tmp = matchAll(subject, /\sCN\s=\s([^\r\n].*)/g) + certValues.commonName = tmp ? (tmp.length > 1 ? tmp.sort(function (t, n) { + var e = t[1].toUpperCase() + var r = n[1].toUpperCase() + return r > e ? -1 : e > r ? 1 : 0 + }).sort(function (t, n) { + return t[1].length - n[1].length + }).map(function (t) { + return t[1] + }) : tmp[0][1]) : '' + + // email + tmp = matchAll(subject, /emailAddress\s=\s([^\r\n].*)/g) + certValues.emailAddress = tmp ? (tmp.length > 1 ? tmp.sort(function (t, n) { + var e = t[1].toUpperCase() + var r = n[1].toUpperCase() + return r > e ? -1 : e > r ? 1 : 0 + }).sort(function (t, n) { + return t[1].length - n[1].length + }).map(function (t) { + return t[1] + }) : tmp[0][1]) : '' + + // DC name + tmp = matchAll(subject, /\sDC\s=\s([^\r\n].*)/g) + certValues.dc = tmp ? (tmp.length > 1 ? tmp.sort(function (t, n) { + var e = t[1].toUpperCase() + var r = n[1].toUpperCase() + return r > e ? -1 : e > r ? 1 : 0 + }).sort(function (t, n) { + return t[1].length - n[1].length + }).map(function (t) { + return t[1] + }) : tmp[0][1]) : '' + } + + if ((issuer = certData.match(/\s*Issuer:\r?\n(\s*([a-zA-Z0-9.]+)\s=\s[^\r\n].*\r?\n)*\s*\b/)) && issuer.length > 1) { + issuer = issuer[0] + tmp = matchAll(issuer, /\s([a-zA-Z0-9.]+)\s=\s([^\r\n].*)/g) + for (i = 0; i < tmp.length; i++) { + ky = tmp[i][1].toString() + if (ky.match('(C|ST|L|O|OU|CN|emailAddress|DC)')) { + continue + } + certValues.issuer[ky] = tmp[i][2].toString() + } + + // country + tmp = issuer.match(/\sC\s=\s([^\r\n].*?)[\r\n]/) + certValues.issuer.country = (tmp && tmp[1]) || '' + + // state + tmp = issuer.match(/\sST\s=\s([^\r\n].*?)[\r\n]/) + certValues.issuer.state = (tmp && tmp[1]) || '' + + // locality + tmp = issuer.match(/\sL\s=\s([^\r\n].*?)[\r\n]/) + certValues.issuer.locality = (tmp && tmp[1]) || '' + + // organization + tmp = matchAll(issuer, /\sO\s=\s([^\r\n].*)/g) + certValues.issuer.organization = tmp ? (tmp.length > 1 ? tmp.sort(function (t, n) { + var e = t[1].toUpperCase() + var r = n[1].toUpperCase() + return r > e ? -1 : e > r ? 1 : 0 + }).sort(function (t, n) { + return t[1].length - n[1].length + }).map(function (t) { + return t[1] + }) : tmp[0][1]) : '' + + // unit + tmp = matchAll(issuer, /\sOU\s=\s([^\r\n].*)/g) + certValues.issuer.organizationUnit = tmp ? (tmp.length > 1 ? tmp.sort(function (t, n) { + var e = t[1].toUpperCase() + var + r = n[1].toUpperCase() + return r > e ? -1 : e > r ? 1 : 0 + }).sort(function (t, n) { + return t[1].length - n[1].length + }).map(function (t) { + return t[1] + }) : tmp[0][1]) : '' + + // common name + tmp = matchAll(issuer, /\sCN\s=\s([^\r\n].*)/g) + certValues.issuer.commonName = tmp ? (tmp.length > 1 ? tmp.sort(function (t, n) { + var e = t[1].toUpperCase() + var + r = n[1].toUpperCase() + return r > e ? -1 : e > r ? 1 : 0 + }).sort(function (t, n) { + return t[1].length - n[1].length + }).map(function (t) { + return t[1] + }) : tmp[0][1]) : '' + + // DC name + tmp = matchAll(issuer, /\sDC\s=\s([^\r\n].*)/g) + certValues.issuer.dc = tmp ? (tmp.length > 1 ? tmp.sort(function (t, n) { + var e = t[1].toUpperCase() + var + r = n[1].toUpperCase() + return r > e ? -1 : e > r ? 1 : 0 + }).sort(function (t, n) { + return t[1].length - n[1].length + }).map(function (t) { + return t[1] + }) : tmp[0][1]) : '' + } + + // SAN + if ((san = certData.match(/X509v3 Subject Alternative Name: \r?\n([^\r\n]*)\r?\n/)) && san.length > 1) { + san = san[1].trim() + '\n' + certValues.san = {} + + // hostnames + tmp = pregMatchAll('DNS:([^,\\r\\n].*?)[,\\r\\n]', san) + certValues.san.dns = tmp || '' + + // IP-Addresses IPv4 & IPv6 + tmp = pregMatchAll('IP Address:([^,\\r\\n].*?)[,\\r\\n\\s]', san) + certValues.san.ip = tmp || '' + + // Email Addresses + tmp = pregMatchAll('email:([^,\\r\\n].*?)[,\\r\\n\\s]', san) + certValues.san.email = tmp || '' + } + + // Validity + if ((tmp = certData.match(/Not Before\s?:\s?([^\r\n]*)\r?\n/)) && tmp.length > 1) { + validity.start = Date.parse((tmp && tmp[1]) || '') + } + + if ((tmp = certData.match(/Not After\s?:\s?([^\r\n]*)\r?\n/)) && tmp.length > 1) { + validity.end = Date.parse((tmp && tmp[1]) || '') + } + + if (validity.start && validity.end) { + certValues.validity = validity + } + // Validity end + + // Signature Algorithm + if ((tmp = certData.match(/Signature Algorithm: ([^\r\n]*)\r?\n/)) && tmp.length > 1) { + certValues.signatureAlgorithm = (tmp && tmp[1]) || '' + } + + // Public Key + if ((tmp = certData.match(/Public[ -]Key: ([^\r\n]*)\r?\n/)) && tmp.length > 1) { + certValues.publicKeySize = ((tmp && tmp[1]) || '').replace(/[()]/g, '') + } + + // Public Key Algorithm + if ((tmp = certData.match(/Public Key Algorithm: ([^\r\n]*)\r?\n/)) && tmp.length > 1) { + certValues.publicKeyAlgorithm = (tmp && tmp[1]) || '' + } + + callback(null, certValues) +} + +function matchAll (str, regexp) { + var matches = [] + str.replace(regexp, function () { + var arr = ([]).slice.call(arguments, 0) + var extras = arr.splice(-2) + arr.index = extras[0] + arr.input = extras[1] + matches.push(arr) + }) + return matches.length ? matches : null +} + +function pregMatchAll (regex, haystack) { + var globalRegex = new RegExp(regex, 'g') + var globalMatch = haystack.match(globalRegex) || [] + var matchArray = [] + var nonGlobalRegex, nonGlobalMatch + for (var i = 0; i < globalMatch.length; i++) { + nonGlobalRegex = new RegExp(regex) + nonGlobalMatch = globalMatch[i].match(nonGlobalRegex) + matchArray.push(nonGlobalMatch[1]) + } + return matchArray +} + +function generateCSRSubject (options) { + options = options || {} + + var csrData = { + C: options.country || options.C, + ST: options.state || options.ST, + L: options.locality || options.L, + O: options.organization || options.O, + OU: options.organizationUnit || options.OU, + CN: options.commonName || options.CN || 'localhost', + DC: options.dc || options.DC || '', + emailAddress: options.emailAddress + } + + var csrBuilder = Object.keys(csrData).map(function (key) { + if (csrData[key]) { + if (typeof csrData[key] === 'object' && csrData[key].length >= 1) { + var tmpStr = '' + csrData[key].map(function (o) { + tmpStr += '/' + key + '=' + o.replace(/[^\w .*\-,@']+/g, ' ').trim() + }) + return tmpStr + } else { + return '/' + key + '=' + csrData[key].replace(/[^\w .*\-,@']+/g, ' ').trim() + } + } + }) + + return csrBuilder.join('') +} + +function readFromString (string, start, end) { + if (Buffer.isBuffer(string)) { + string = string.toString('utf8') + } + + var output = [] + + if (!string) { + return output + } + + var offset = string.indexOf(start) + + while (offset !== -1) { + string = string.substring(offset) + + var endOffset = string.indexOf(end) + + if (endOffset === -1) { + break + } + + endOffset += end.length + + output.push(string.substring(0, endOffset)) + offset = string.indexOf(start, endOffset) + } + + return output +} + +// promisify not tested yet +/** + * Verifies the signing chain of the passed certificate + * @namespace + * @name promisified + * @property {function} createPrivateKey @see createPrivateKey + * @property {function} createDhparam - The default number of players. + * @property {function} createEcparam - The default level for the party. + * @property {function} createCSR - The default treasure. + * @property {function} createCertificate - How much gold the party starts with. + */ +module.exports.promisified = { + createPrivateKey: promisify(createPrivateKey), + createDhparam: promisify(createDhparam), + createEcparam: promisify(createEcparam), + createCSR: promisify(createCSR), + createCertificate: promisify(createCertificate), + readCertificateInfo: promisify(readCertificateInfo), + getPublicKey: promisify(getPublicKey), + getFingerprint: promisify(getFingerprint), + getModulus: promisify(getModulus), + getDhparamInfo: promisify(getDhparamInfo), + createPkcs12: promisify(createPkcs12), + readPkcs12: promisify(readPkcs12), + verifySigningChain: promisify(verifySigningChain), + checkCertificate: promisify(checkCertificate), + checkPkcs12: promisify(checkPkcs12) +} diff --git a/node_modules/pem/mocha.opts b/node_modules/pem/mocha.opts new file mode 100644 index 000000000..7e92d4382 --- /dev/null +++ b/node_modules/pem/mocha.opts @@ -0,0 +1,6 @@ +--recursive +--bail +--inline-diffs +--reporter spec +--check-leaks +--use_strict diff --git a/node_modules/pem/package.json b/node_modules/pem/package.json new file mode 100644 index 000000000..321d46bf8 --- /dev/null +++ b/node_modules/pem/package.json @@ -0,0 +1,135 @@ +{ + "_from": "pem@^1.8.3", + "_id": "pem@1.13.1", + "_inBundle": false, + "_integrity": "sha512-gA/kl8/MWWBaVRRv8M4iRkaJXEbp0L9NyG5ggZlbvQxylZAq5K5wGesAZifs89kwL/m4EGdekXtBMOzXM9rv7w==", + "_location": "/pem", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "pem@^1.8.3", + "name": "pem", + "escapedName": "pem", + "rawSpec": "^1.8.3", + "saveSpec": null, + "fetchSpec": "^1.8.3" + }, + "_requiredBy": [ + "/budo" + ], + "_resolved": "https://registry.npmjs.org/pem/-/pem-1.13.1.tgz", + "_shasum": "57dd3e0c044fbcf709db026a737e1aad7dc8330f", + "_spec": "pem@^1.8.3", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", + "author": { + "name": "Andris Reinman", + "email": "andris@kreata.ee" + }, + "bugs": { + "url": "https://github.com/Dexus/pem/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Josef Fröhle", + "email": "github@josef-froehle.de", + "url": "https://www.josef-froehle.de/" + } + ], + "dependencies": { + "es6-promisify": "^6.0.0", + "md5": "^2.2.1", + "os-tmpdir": "^1.0.1", + "which": "^1.3.1" + }, + "deprecated": false, + "description": "Create private keys and certificates with node.js and io.js", + "devDependencies": { + "@deineagenturug/docdash": "^0.4.1", + "@semantic-release/changelog": "^3.0.0", + "@semantic-release/git": "^7.0.4", + "@semantic-release/github": "^5.0.5", + "@semantic-release/npm": "^5.0.4", + "ajv": "^6.0.0", + "auto-changelog": "^1.8.0", + "chai": "^4.1.2", + "cross-env": "^5.2.0", + "dirty-chai": "^2.0.1", + "docco": "^0.8.0", + "eslint": "^5.5.0", + "eslint-config-standard": "^12.0.0", + "eslint-plugin-import": "2.14.0", + "eslint-plugin-json": "^1.2.1", + "eslint-plugin-markdown": "^1.0.0-beta.8", + "eslint-plugin-node": "^7.0.1", + "eslint-plugin-promise": "^4.0.1", + "eslint-plugin-standard": "^4.0.0", + "jsdoc": "^3.5.5", + "marked": "^0.5.0", + "mocha": "^5.2.0", + "nyc": "^13.1.0", + "semantic-release": "^15.9.15", + "travis-deploy-once": "^5.0.7" + }, + "engines": { + "node": ">=6.0.0" + }, + "homepage": "https://github.com/Dexus/pem#readme", + "license": "MIT", + "main": "lib/pem", + "name": "pem", + "nyc": { + "reporter": [ + "html", + "text" + ], + "exclude": [ + "**/*.spec.js", + "test/pem.helper.js" + ] + }, + "release": { + "debug": false, + "verifyConditions": [ + "@semantic-release/changelog", + "@semantic-release/npm", + "@semantic-release/git", + "@semantic-release/github" + ], + "prepare": [ + "@semantic-release/changelog", + "@semantic-release/npm", + { + "path": "@semantic-release/git", + "assets": [ + "CHANGELOG.md", + "HISTORY.md", + "package.json", + "package-lock.json", + "npm-shrinkwrap.json" + ], + "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + } + ], + "publish": [ + "@semantic-release/npm", + "@semantic-release/github" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Dexus/pem.git" + }, + "scripts": { + "changelog": "auto-changelog --output HISTORY.md", + "coverage": "cross-env NODE_ENV=development nyc ./node_modules/.bin/_mocha --opts mocha.opts $(find . -type f -name '*.spec.js' ! -path './nyc_output/*' ! -path './coverage/*' ! -path './node_modules/*')", + "docco": "docco -l parallel -o docs/docco lib/helper.js lib/openssl.js lib/pem.js", + "documentation": "npm run docco --silent && npm run jsdoc --silent", + "jsdoc": "jsdoc -c jsdoc.json", + "lint": "eslint --fix --config=./.eslintrc.js lib/*.js *.md *.json lib/*.js test/*.js test/*.spec.js", + "semantic-release": "semantic-release", + "test": "npm run lint --silent && npm run coverage --silent" + }, + "version": "1.13.1" +} diff --git a/node_modules/pem/test/convert.spec.js b/node_modules/pem/test/convert.spec.js new file mode 100644 index 000000000..55e3fe4be --- /dev/null +++ b/node_modules/pem/test/convert.spec.js @@ -0,0 +1,255 @@ +'use strict' + +var pem = require('..') +var pemHelper = require('../lib/helper.js') +var fs = require('fs') +var hlp = require('./pem.helper.js') +var chai = require('chai') +var dirtyChai = require('dirty-chai') +var expect = chai.expect +chai.use(dirtyChai) + +describe('convert.js tests', function () { + after(function (done) { + var tmpfiles + tmpfiles = [ + './test/fixtures/tmp.der', + './test/fixtures/tmp.pem', + './test/fixtures/tmp.p7b', + './test/fixtures/tmp.pfx' + ] + pemHelper.deleteTempFiles(tmpfiles, function (fsErr) { + hlp.checkError(fsErr) + done() + }) + }) + + describe('trigger error case', function () { + before(function () { + pem.config({ + pathOpenSSL: 'zzzzzzzzzzz' + }) + }) + it('#.PEM2DER()', function (done) { + pem.convert.PEM2DER('./test/fixtures/nopkey.pem', './test/fixtures/tmp.der', function (error, result) { + hlp.checkError(error, true) + done() + }) + }) + it('#.DER2PEM()', function (done) { + pem.convert.DER2PEM('./test/fixtures/tmp.der', './test/fixtures/tmp.pem', function (error, result) { + hlp.checkError(error, true) + done() + }) + }) + it('#.PEM2P7B()', function (done) { + pem.convert.PEM2P7B({ cert: './test/fixtures/nopkey.pem' }, './test/fixtures/tmp.p7b', function (error, result) { + hlp.checkError(error, true) + done() + }) + }) + it('#.P7B2PEM()', function (done) { + pem.convert.P7B2PEM('./test/fixtures/tmp.p7b', './test/fixtures/tmp.pem', function (error, result) { + hlp.checkError(error, true) + done() + }) + }) + it('#.PEM2PFX()', function (done) { + var pathIN = { + cert: './test/fixtures/test.crt', + key: './test/fixtures/testnopw.key' + } + // password is required to encrypt the .pfx file; enforced by openssl + pem.convert.PEM2PFX(pathIN, './test/fixtures/tmp.pfx', 'password', function (error, result) { + hlp.checkError(error, true) + done() + }) + }) + it('#.PFX2PEM()', function (done) { + pem.convert.PFX2PEM('./test/fixtures/tmp.pfx', './test/fixtures/tmp.pem', 'password', function (error, result) { + hlp.checkError(error, true) + done() + }) + }) + it('#.P7B2PFX() [error in 1st step]', function (done) { + pem.convert.P7B2PFX({ cert: './test/fixtures/test.p7b', key: './test/fixtures/test.key', ca: './test/fixtures/GeoTrust_Primary_CA.pem' }, './test/fixtures/tmp.pfx', 'password', function (error, result) { + hlp.checkError(error, true) + done() + }) + }) + it('#.P7B2PFX() [error in 2nd step]', function (done) { + pem.config({ + pathOpenSSL: process.env.OPENSSL_BIN || 'openssl' + }) + pem.convert.P7B2PFX({ cert: './test/fixtures/test.p7b', key: './test/fixtures/test404.key', ca: './test/fixtures/ca404.pem' }, './test/fixtures/tmp.pfx', 'password', function (error, result) { + hlp.checkError(error, true) + done() + }) + }) + }) + + describe('check all success cases', function () { + it('#.PEM2DER() [not providing type]', function (done) { + pem.convert.PEM2DER('./test/fixtures/nopkey.pem', './test/fixtures/tmp.der', function (error, result) { + hlp.checkError(error) + expect(result).to.be.true() + done() + }) + }) + + it('#.PEM2DER() [providing type]', function (done) { + pem.convert.PEM2DER('./test/fixtures/nopkey.pem', './test/fixtures/tmp.der', 'x509', function (error, result) { + hlp.checkError(error) + expect(result).to.be.true() + done() + }) + }) + + it('#.DER2PEM() [not providing type]', function (done) { + pem.convert.DER2PEM('./test/fixtures/tmp.der', './test/fixtures/tmp.pem', function (error, result) { + hlp.checkError(error) + expect(result).to.be.true() + var f1 = fs.readFileSync('./test/fixtures/nopkey.pem').toString() + var f2 = fs.readFileSync('./test/fixtures/tmp.pem').toString() + expect(f1).to.equal(f2) + done() + }) + }) + + it('#.DER2PEM() [providing type]', function (done) { + pem.convert.DER2PEM('./test/fixtures/tmp.der', './test/fixtures/tmp.pem', 'x509', function (error, result) { + hlp.checkError(error) + expect(result).to.be.true() + var f1 = fs.readFileSync('./test/fixtures/nopkey.pem').toString() + var f2 = fs.readFileSync('./test/fixtures/tmp.pem').toString() + expect(f1).to.equal(f2) + done() + }) + }) + + it('#.PEM2P7B() [providing a CA cert; no array format]', function (done) { + pem.convert.PEM2P7B({ cert: './test/fixtures/nopkey.pem', ca: './test/fixtures/GeoTrust_Primary_CA.pem' }, './test/fixtures/tmp.p7b', function (error, result) { + hlp.checkError(error) + expect(result).to.be.true() + done() + }) + }) + + it('#.PEM2P7B() [providing a CA cert; array format]', function (done) { + pem.convert.PEM2P7B({ cert: './test/fixtures/nopkey.pem', ca: ['./test/fixtures/GeoTrust_Primary_CA.pem'] }, './test/fixtures/tmp.p7b', function (error, result) { + hlp.checkError(error) + expect(result).to.be.true() + done() + }) + }) + + it('#.PEM2P7B() [not providing a CA cert]', function (done) { + pem.convert.PEM2P7B({ cert: './test/fixtures/nopkey.pem' }, './test/fixtures/tmp.p7b', function (error, result) { + hlp.checkError(error) + expect(result).to.be.true() + done() + }) + }) + + it('#.P7B2PEM()', function (done) { + pem.convert.P7B2PEM('./test/fixtures/tmp.p7b', './test/fixtures/tmp.pem', function (error, result) { + hlp.checkError(error) + expect(result).to.be.true() + var f1 = fs.readFileSync('./test/fixtures/nopkey.pem').toString() + var f2 = fs.readFileSync('./test/fixtures/tmp.pem').toString() + // can't directly compare as f2 comes with x509v3 header which might not be included in source file + pem.readCertificateInfo(f1, function (error, d1) { + hlp.checkError(error) + pem.readCertificateInfo(f2, function (error, d2) { + hlp.checkError(error) + expect(d1).to.eql(d2) + }) + done() + }) + }) + }) + + it('#.PEM2PFX() [no password protected key file]', function (done) { + var pathIN = { + cert: './test/fixtures/test.crt', + key: './test/fixtures/testnopw.key' + } + // password is required to encrypt the .pfx file; enforced by openssl + pem.convert.PEM2PFX(pathIN, './test/fixtures/tmp.pfx', 'password', function (error, result) { + hlp.checkError(error) + expect(result).to.be.true() + done() + }) + }) + + it('#.PEM2PFX() [password protected key file]', function (done) { + var pathIN = { + cert: './test/fixtures/test.crt', + key: './test/fixtures/test.key' + } + pem.convert.PEM2PFX(pathIN, './test/fixtures/tmp.pfx', 'password', function (error, result) { + hlp.checkError(error) + expect(result).to.be.true() + done() + }) + }) + + it('#.PEM2PFX() [providing CA cert; no array format]', function (done) { + var pathIN = { + cert: './test/fixtures/test.crt', + key: './test/fixtures/test.key', + ca: './test/fixtures/GeoTrust_Primary_CA.pem' + } + pem.convert.PEM2PFX(pathIN, './test/fixtures/tmp.pfx', 'password', function (error, result) { + hlp.checkError(error) + expect(result).to.be.true() + done() + }) + }) + + it('#.PEM2PFX() [providing CA cert; array format]', function (done) { + var pathIN = { + cert: './test/fixtures/test.crt', + key: './test/fixtures/test.key', + ca: ['./test/fixtures/GeoTrust_Primary_CA.pem'] + } + pem.convert.PEM2PFX(pathIN, './test/fixtures/tmp.pfx', 'password', function (error, result) { + hlp.checkError(error) + expect(result).to.be.true() + done() + }) + }) + + it('#.PFX2PEM()', function (done) { + pem.convert.PFX2PEM('./test/fixtures/tmp.pfx', './test/fixtures/tmp.pem', 'password', function (error, result) { + hlp.checkError(error) + expect(result).to.be.true() + done() + }) + }) + + it('#.P7B2PFX() [providing ca cert; no array format]', function (done) { + pem.convert.P7B2PFX({ cert: './test/fixtures/test.p7b', key: './test/fixtures/test.key', ca: './test/fixtures/GeoTrust_Primary_CA.pem' }, './test/fixtures/tmp.pfx', 'password', function (error, result) { + hlp.checkError(error) + expect(result).to.be.true() + done() + }) + }) + + it('#.P7B2PFX() [providing ca cert; array format]', function (done) { + pem.convert.P7B2PFX({ cert: './test/fixtures/test.p7b', key: './test/fixtures/test.key', ca: ['./test/fixtures/GeoTrust_Primary_CA.pem'] }, './test/fixtures/tmp.pfx', 'password', function (error, result) { + hlp.checkError(error) + expect(result).to.be.true() + done() + }) + }) + + it('#.P7B2PFX() [not providing ca cert]', function (done) { + pem.convert.P7B2PFX({ cert: './test/fixtures/test.p7b', key: './test/fixtures/test.key' }, './test/fixtures/tmp.pfx', 'password', function (error, result) { + hlp.checkError(error) + expect(result).to.be.true() + done() + }) + }) + }) +}) diff --git a/node_modules/pem/test/fixtures/GeoTrust_Primary_CA.pem b/node_modules/pem/test/fixtures/GeoTrust_Primary_CA.pem new file mode 100644 index 000000000..41372438b --- /dev/null +++ b/node_modules/pem/test/fixtures/GeoTrust_Primary_CA.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBY +MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMo +R2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEx +MjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgxCzAJBgNVBAYTAlVTMRYwFAYDVQQK +Ew1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQcmltYXJ5IENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9 +AWbK7hWNb6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjA +ZIVcFU2Ix7e64HXprQU9nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE0 +7e9GceBrAqg1cmuXm2bgyxx5X9gaBGgeRwLmnWDiNpcB3841kt++Z8dtd1k7j53W +kBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGttm/81w7a4DSwDRp35+MI +mO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4G +A1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJ +KoZIhvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ1 +6CePbJC/kRYkRj5KTs4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl +4b7UVXGYNTq+k+qurUKykG/g/CFNNWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6K +oKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHaFloxt/m0cYASSJlyc1pZU8Fj +UjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG1riR/aYNKxoU +AT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk= +-----END CERTIFICATE----- diff --git a/node_modules/pem/test/fixtures/cn_openssl.crt b/node_modules/pem/test/fixtures/cn_openssl.crt new file mode 100644 index 000000000..79d250bae --- /dev/null +++ b/node_modules/pem/test/fixtures/cn_openssl.crt @@ -0,0 +1,34 @@ +-----BEGIN CERTIFICATE----- +MIIF7zCCA9egAwIBAgIJAIunRBcrTt9GMA0GCSqGSIb3DQEBCwUAMIGKMRUwEwYD +VQQDDAzkuK3lm73pk7booYwxHzAdBgkqhkiG9w0BCQEWEGVudmVrQGVudmVrLm5h +bWUxGzAZBgNVBAoMEuazleWFsOWFi+emj+WIhuihjDESMBAGA1UECwwJ5YWL56aP +5YiGMRIwEAYDVQQHDAnlhbDlhYvnpo8xCzAJBgNVBAYTAlJVMB4XDTE4MDkxMTIw +MjU0M1oXDTE5MDkxMTIwMjU0M1owgYoxFTATBgNVBAMMDOS4reWbvemTtuihjDEf +MB0GCSqGSIb3DQEJARYQZW52ZWtAZW52ZWsubmFtZTEbMBkGA1UECgwS5rOV5YWw +5YWL56aP5YiG6KGMMRIwEAYDVQQLDAnlhYvnpo/liIYxEjAQBgNVBAcMCeWFsOWF +i+emjzELMAkGA1UEBhMCUlUwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQC/FZCosDlD/6CeAmVtM8mtccjbzpMSuMzGNd2h40Nz156a4gdCveoLmna4Kxud +2tlkH9MfhHZRHjoscS3E/r3MbQj8MfLV6NOV39YZeKpibKVHUxH4NKW0QoauWh9R +uzdVm9G5cZScs1lernELLP4G2DoOlc3GYJq5TzCM/XHPOyHvF7ORsmSoBHpjCxHB +QWqVjCY0/2owQaTD4WSaC9Kouf1RA6efm2WqrnN7RqtApJn/1AgiN7tMvob855/2 +EoSrb04MVOe49NnyF5epWxvdiI3LwCabpXQ+zZ9GQLAQdbLhn/IYIFZMYVOCXFq2 +3cun2fdW9c+oTzHNcaNe1Xj2mwMfnxkRUYKicqcI5/BNcDIxIyPIlYprHC2jBieO +M7Sl24+N9hX6V/mlcIAYttdTtGjM+ZzmGyaD+8dW1RmVsWGMbxW0eHtt55I46HKu +YB0G5CleuG4KmZVB9eILrycCpniVabsr35YNj2rxYOrbozu3QqmvDwfBd5c2wNfg +xmXIOvRjpQU1wcZlMc8QFUP7PQqdBJoYz9oieSY/9BwD/OwldhAFA6UH4q0xJbhD +qBp8VhVc4cI9gb484cZxel22smpiKGRqTwcLwpwJvk1+PZuU28Exe116ThYE0kiy +YD8B0If+eHeyGaxESzoG7YY1o1qY4QNsbxTK4oL1sWzYiwIDAQABo1YwVDAJBgNV +HRMEAjAAMAsGA1UdDwQEAwIFoDA6BgNVHREEMzAxggtleGFtcGxlLmNvbYIRKi5h +cHAuZXhhbXBsZS5jb22CD3d3dy5leGFtcGxlLmNvbTANBgkqhkiG9w0BAQsFAAOC +AgEALwUbyLP3pvjYiKvy54BLobrLtdQiD6jNUR6VyUpCxmNIZXC0k7V5Xdte5pAs +qrf6YJyCzea/Z3AZL/RrVDKSRTU/yFgPJL6LUsfpdaL9bcrD2E79dlWuzj90ovp6 +poPebkFSsWoS0sDjzafCVccICR/r7Hdae1ITcIMrfgWPMZ134A1cU43V21Sj5qy2 +18hrErzDEUCBM1mpI2AAs8bhotLT5oVW5M7cvLmOVYja+ahoKHIf+waoIm5f4ofY +JsnqyPk7GXRFkWpagEZVIcCBtcBGo3yMNVHwY7H1G4KmgMaPeHKwBXWqmfBzWAq9 +tWn49pFB8uNPHoFmE/IQIngHcziuaGBduiEOAbJfncSQfQY9RoZEy7SfkOY4FMp7 +mRY2SVEa0m0Lvt9HZuxsQsoMYsHuihCEIKnPfr8bcn/+qvctOc4I6A5LnfVNxv93 +Gw/ZbmoAYPL23RkzP3uxl3f9vMwfNIwl5wGFbXdcxl3KBT/FG4ruvyfDY8PMfeoR +qdF7Ns7y/aUEthiRk/66zMFyywyXWu8vG8tw1sy8WpBVjc7tNgfSuKt1sCASmcRx +zcEDebyLF2rNLuqP8BrJcFG9s5+SRq5gp0X1CNXV9N6WpulyA3L3XgJuLb1I7dDT +9kRcesNkaKfT4/STBU09lXRF4N+Y68UywYjg8yl0xVVtIjo= +-----END CERTIFICATE----- diff --git a/node_modules/pem/test/fixtures/cn_openssl.csr b/node_modules/pem/test/fixtures/cn_openssl.csr new file mode 100644 index 000000000..cb7370427 --- /dev/null +++ b/node_modules/pem/test/fixtures/cn_openssl.csr @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIDCDCCAfACAQAwgYoxFTATBgNVBAMMDOS4reWbvemTtuihjDEfMB0GCSqGSIb3 +DQEJARYQZW52ZWtAZW52ZWsubmFtZTEbMBkGA1UECgwS5rOV5YWw5YWL56aP5YiG +6KGMMRIwEAYDVQQLDAnlhYvnpo/liIYxEjAQBgNVBAcMCeWFsOWFi+emjzELMAkG +A1UEBhMCUlUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCqhXFd9CPZ +FQzzPGQL8mdPHNLg2xxbcDLUtT7S1B3L1cOBacb9cF6bEUqeIUqZILcTgHODb/Oh +/HSyzwVo1LspqjAbP3e/eBrqkkCo7fH1I6iaKK6CqGv7232YgNKA0i5FXjV7VDGO +ewA5foQVqk5G/PlNhO79vIBDf+7dGHKpn8rCrf7OtBsvtVruMruA++1Sqpf2Vd+f +X+sCr2SvlJbddt66MycICv7kg05sJ/fEYuQQMj1VeRn2ZVbx+K6eKGIl6Z4ow7Y0 +/jqlP1UTFpDGLp0MelAUtm9ytDmyclFCfBk371H9K16gkM8dppG0CKMdjrfSP5a5 +MGu6DdloawUxAgMBAAGgODA2BgkqhkiG9w0BCQ4xKTAnMCUGA1UdEQQeMByCC2V4 +YW1wbGUuY29tgg0qLmV4YW1wbGUuY29tMA0GCSqGSIb3DQEBCwUAA4IBAQBu3ROV +8aDYNWTi2+qwC8XbMV/07Pj+SQ9MI8PT8ePh3DTIzYsFGO0eO3yKRS6srPd8bkGN +6YFcot3/9XQdHbCeBJo/O0bTinqTd8yHlgsfymj83zdIZTIxeRsW3cmKA/swjDAC +p5fMSWYNID5ChaFz+B7H7Pcoisu+aIAaKw8zzLW1uWwzv5xnLSS1aeRE/FSiSs76 +zP8Jedpfc8F4FVyswgp6QTQVgf9RLg9UTLbv/wqXi/R/MYvSRLDVNwZl09Ky9Q+N +ErbreM847nGGyY+yAk6JRwhuiqbjxMSfRpzezbGEaea/VH/7+OqnEPtaZBV8rOqu +2WO/PNGuXswH8x/e +-----END CERTIFICATE REQUEST----- diff --git a/node_modules/pem/test/fixtures/cn_openssl.key b/node_modules/pem/test/fixtures/cn_openssl.key new file mode 100644 index 000000000..c7e5bbf84 --- /dev/null +++ b/node_modules/pem/test/fixtures/cn_openssl.key @@ -0,0 +1,52 @@ +-----BEGIN PRIVATE KEY----- +MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQC/FZCosDlD/6Ce +AmVtM8mtccjbzpMSuMzGNd2h40Nz156a4gdCveoLmna4Kxud2tlkH9MfhHZRHjos +cS3E/r3MbQj8MfLV6NOV39YZeKpibKVHUxH4NKW0QoauWh9RuzdVm9G5cZScs1le +rnELLP4G2DoOlc3GYJq5TzCM/XHPOyHvF7ORsmSoBHpjCxHBQWqVjCY0/2owQaTD +4WSaC9Kouf1RA6efm2WqrnN7RqtApJn/1AgiN7tMvob855/2EoSrb04MVOe49Nny +F5epWxvdiI3LwCabpXQ+zZ9GQLAQdbLhn/IYIFZMYVOCXFq23cun2fdW9c+oTzHN +caNe1Xj2mwMfnxkRUYKicqcI5/BNcDIxIyPIlYprHC2jBieOM7Sl24+N9hX6V/ml +cIAYttdTtGjM+ZzmGyaD+8dW1RmVsWGMbxW0eHtt55I46HKuYB0G5CleuG4KmZVB +9eILrycCpniVabsr35YNj2rxYOrbozu3QqmvDwfBd5c2wNfgxmXIOvRjpQU1wcZl +Mc8QFUP7PQqdBJoYz9oieSY/9BwD/OwldhAFA6UH4q0xJbhDqBp8VhVc4cI9gb48 +4cZxel22smpiKGRqTwcLwpwJvk1+PZuU28Exe116ThYE0kiyYD8B0If+eHeyGaxE +SzoG7YY1o1qY4QNsbxTK4oL1sWzYiwIDAQABAoICAApit6wTd+lUOXydELowuGNu +7cXUonXACZE0WEl2OrJPI9WzN0XPYKskyBMWdLfNr0cb27O41V1vUSYdOKmeVt6H +hpd+d35c2zMoKVDVGB2lXg5UW4OsCN2VSBCt4Unl7QoAIBP+Ml+Z99+Hh6ld1qi0 +k+M7DSYdFgvAXBktpUPoKN3/4cinc4UWSTic32grkAl0xpbW0wSwbK4g0AD3Z4m4 +IiaHFlM8dPgj5y7qFmC7EYuwEIkbkliHenrAdBdBxmgy8oEFFFsfI8FeuuV/iDIw +O9S5KuAGzBylvGRrG6apXwGYWeYpy8b2+zz4nA2YXHtRA3p8fb7eHwzVglWjMKHO +fgVMx+lPRbMjwp6zO6B8CJCpL45Ts3MRzcj+kPTgH0DOA4H1RtSX8VF2sj2fqPNg +xjJ6yBIzcO62QYMOYy3GXNWDak3lF7uZnfVYTu/pN09wUpxwuLYsoDKEQnYrYbfy +ZfDMe/8x6NZ8saPUy75eq2MViTKOWrhHrV+kPUriFD/S08YsajyYdW4UNy9gTmhH +S2t5cz5bM5ppQikLI9E1ZOnC/BTmtOqyp3VddY34VlrKmlE8kKuHjuXclL5zSD5o ++yzKVGSRoLVx0rx3H+t5Ginypk8C8MItgZ/fzKr1pCGppY+5SYFVi0MF9mfqHpzN +z4e1e36TW7x60rD619ARAoIBAQD0ML/Hvk0hRby6n258lOvLgmDPTDFCFMN3m9Sj +9wklWC5Az0SuFJgCL6UQXUPOd5j+eLLk8ZR1zPq/0kBgLe7vKhSeHLqwqAZ9qL3b +BakxCcUxieP+YEdqcNMpMBL5uJaSU89lpAiXheroewwEp4+wVOFrrUovBLld15Ri +P+O23N9LpS0Mktu/srxwlU7zsEi5SLeo8RQuHDjvshCuUTmV0ekiQUyCmvRuvLbJ +KqvPMfMTaaJpB1SYLYkMwI8Q4fUJWSP76GVMCGJNY1QXeqJn3bDRixOrAJYMBg0E +U58m3FbCVX0mr2wwcY8z/8A1WBqWDdddRoxSZ2Zajftthbm9AoIBAQDIU1LY2UAm +iOfp7LDaca5sslnncm79FpZyoWqaZSskM0qF4u3zSUNgJQf+IIJDwD9m6WZWB/XU +2Jc8OpA2FufDCQyRmLhHWXaNl1YXnHBCP6AEaDqF7/Go3OmFL7Z0wbISSHqFr6sf +PRjpVenI9eGNS51IqeGHhTbJkRyTbDYG1DyDiKMa7sHhu8u1feqQjzMKCCEXVRaR +Nvf+IRTf9nZfMCUMhiP26zb8xKLUgmwohETFiax3J9uHN3thROl0EfyBbNJC0qFB +SS+HUdffJFDovdC4Z7sebg9cYYNF8NojK89LMtZ++M/4IqmA6swSaR3AqaVpomxX +KChoZNIyBavnAoIBAGAoHiz6rAaxHmtiwrA+OEfwNE0NFMyPvpUIAQj8C1bwTW5p +8AKYy2748gfqofvYrp9uSgvLcYmdyRPmKEF3dQIq0OmeKInN8Jhk7TYlGYXc8hDa +2rPdl+G7QfuTGbXKUUiXxjChEl0Qd/tKEOZ4USW/lvC+0VqIgrIIZT73J6Vnfmqc +RYwQ/IWVTY0LzoY5YbnMf74ACNFLfcQtm1H5XDK58RLzIbzAZgaBO30l13gElFKN +o022fEJck/44iV29jK88seXNkq4JEySkO4XvXaqG6szo9jq9RVjAvTl58E7uLx/h +aCHmrDS7UwfH6xlWc0mpc6ggUrtUSkLYbCypnwUCggEBAIuJjsHBwm+VGYXV+vKO +ESNhsEIJccoU+8LpMOpO4hgbKiPMiFbYh3fnE4QufM5YkVFL7p6qeNBD9kRbvqwO +lG1EVl7sdCAu7ud9rNhRfdiHnRy0xV8aXchz6K1/KKZ3bWRS3BVW4emmkz2lPG1g +6DWVn/9HZfMSFbGdxLvjulZTa7trZ8GQ4bgtKZ5IESWUucaZFwO7nzaThXac8H94 +m8d+L7Bjl5WdDfZPueQw3Mn0KDs4xMtTFhU/zk9Ywwy4opw8gtFNCkoBgnvNxIKI +N1uHLGXmy25M16JPwjLrq+an04Lb7JERGzwKWOuVoYSJd9IF2VSVcMXdERh2cfup ++60CggEATnzogQm0ysLp8qA8uqvvYBh2XuQwuoVYedbRkxEOoaBgr0iUf6xWtaNb +dFpd3pad4ubT4wUuZfqYwfm3qOThmTih13/4P/6kFR1dC5HwD4AXLrJgvYns+HdV +z4jf45WCqHnJdWw9DjH3UJ3xysdshCNL29ywNCF0ldF37HhdVQK1bGJ1T4jjXfof +CMBBDEwP7SYO0YE/5LtxBPn/0Fw3tTixDvofGh8qnEnCK+hwNMAnPjANBRyvdL2N +gBMs5svby2vT0FXsrwNAEOVufjelUGyyBQW0nrZz7nsnOKqOFZJtpmXBnlMAwoO8 +arLIdCWiu5/CkI+NEdAJShlznkh4nQ== +-----END PRIVATE KEY----- diff --git a/node_modules/pem/test/fixtures/cn_openssl_config.conf b/node_modules/pem/test/fixtures/cn_openssl_config.conf new file mode 100644 index 000000000..2d65cd76f --- /dev/null +++ b/node_modules/pem/test/fixtures/cn_openssl_config.conf @@ -0,0 +1,38 @@ +# openssl req -new -utf8 -nameopt multiline,utf8 -config Dokumente/git/dexus-pem/test/fixtures/cn_openssl_config.conf -newkey rsa:2048 -nodes -keyout Dokumente/git/dexus-pem/test/fixtures/cn_openssl.key -out Dokumente/git/dexus-pem/test/fixtures/cn_openssl.csr +# openssl req -x509 -newkey rsa:4096 -sha256 -utf8 -days 365 -nodes \ + -config Dokumente/git/dexus-pem/test/fixtures/cn_openssl_config.conf \ + -keyout Dokumente/git/dexus-pem/test/fixtures/cn_openssl.key \ + -out Dokumente/git/dexus-pem/test/fixtures/cn_openssl.crt + +HOME = . +RANDFILE = $ENV::HOME/.rnd + +[CA_default] +copy_extensions = copy + +[req] +default_bits = 4096 +prompt = no +string_mask = utf8only +utf8 = yes +default_md = sha256 +distinguished_name = dn +x509_extensions = v3_ca + +[dn] +CN = 中国银行 # Site description +emailAddress = envek@envek.name +O = 法兰克福分行 # My company +OU = 克福分 # My dept +L = 兰克福 # Moscow +C = RU + +[v3_ca] +basicConstraints = CA:FALSE +keyUsage = digitalSignature, keyEncipherment +subjectAltName = @alternate_names + +[alternate_names] +DNS.1 = example.com +DNS.2 = *.app.example.com +DNS.3 = www.example.com diff --git a/node_modules/pem/test/fixtures/google.com.pem b/node_modules/pem/test/fixtures/google.com.pem new file mode 100644 index 000000000..0d3c09550 --- /dev/null +++ b/node_modules/pem/test/fixtures/google.com.pem @@ -0,0 +1,68 @@ +-----BEGIN CERTIFICATE----- +MIIDwjCCAqqgAwIBAgIIMPfmgdxQ04QwDQYJKoZIhvcNAQELBQAwSTELMAkGA1UE +BhMCVVMxEzARBgNVBAoTCkdvb2dsZSBJbmMxJTAjBgNVBAMTHEdvb2dsZSBJbnRl +cm5ldCBBdXRob3JpdHkgRzIwHhcNMTcwOTI2MTA1OTAwWhcNMTcxMjE5MTA1OTAw +WjBoMQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwN +TW91bnRhaW4gVmlldzETMBEGA1UECgwKR29vZ2xlIEluYzEXMBUGA1UEAwwOd3d3 +Lmdvb2dsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQptqSsDzHdgCpE +2bLsaN1aKT/np0r/I2bQ2QZueQvOWKwaJD5Kt6s6HE1LUZ/omxTwacgT7HDWmj8f +bhMEZ45No4IBWDCCAVQwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAsG +A1UdDwQEAwIHgDAZBgNVHREEEjAQgg53d3cuZ29vZ2xlLmNvbTBoBggrBgEFBQcB +AQRcMFowKwYIKwYBBQUHMAKGH2h0dHA6Ly9wa2kuZ29vZ2xlLmNvbS9HSUFHMi5j +cnQwKwYIKwYBBQUHMAGGH2h0dHA6Ly9jbGllbnRzMS5nb29nbGUuY29tL29jc3Aw +HQYDVR0OBBYEFD1fAbfuUfW5VEUWBvJeq8hsdnzlMAwGA1UdEwEB/wQCMAAwHwYD +VR0jBBgwFoAUSt0GFhu89mi1dvWBtrtiGrpagS8wIQYDVR0gBBowGDAMBgorBgEE +AdZ5AgUBMAgGBmeBDAECAjAwBgNVHR8EKTAnMCWgI6Ahhh9odHRwOi8vcGtpLmdv +b2dsZS5jb20vR0lBRzIuY3JsMA0GCSqGSIb3DQEBCwUAA4IBAQBEd6FLPzPDnVVS +HLBtKfb5Gv3rkLku4wy13QORTK1yU+c2cbWCiVXyU8rXUqWLeFfjNw5Z6/2vvNRF +SQ2G/isM+GdT42UI0cPxYV+oLfxcQU9pu2FnsIaq1mSu0ckIe7gFSXRnUZWOHMur +WkSP+4EwUZlXgK/h06fy3Ran1NmBglwWGF3MXAGgNeFeKSRtszn8pClOaWOmjNt8 +pzp6KfJIaZV0y1ss1I8x1XnR7EFbG+9vPQpsB2xhEPqyC78QoazaCS3y9AyFrpzb +Ig2jZRLdtq9bLhsEb1jSM3qIECCiPu0AwNLU+508PVyYXlvRTfwMVo1PfllWhiMP +Ub8Y7gCe +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEKDCCAxCgAwIBAgIQAQAhJYiw+lmnd+8Fe2Yn3zANBgkqhkiG9w0BAQsFADBC +MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMS +R2VvVHJ1c3QgR2xvYmFsIENBMB4XDTE3MDUyMjExMzIzN1oXDTE4MTIzMTIzNTk1 +OVowSTELMAkGA1UEBhMCVVMxEzARBgNVBAoTCkdvb2dsZSBJbmMxJTAjBgNVBAMT +HEdvb2dsZSBJbnRlcm5ldCBBdXRob3JpdHkgRzIwggEiMA0GCSqGSIb3DQEBAQUA +A4IBDwAwggEKAoIBAQCcKgR3XNhQkToGo4Lg2FBIvIk/8RlwGohGfuCPxfGJziHu +Wv5hDbcyRImgdAtTT1WkzoJile7rWV/G4QWAEsRelD+8W0g49FP3JOb7kekVxM/0 +Uw30SvyfVN59vqBrb4fA0FAfKDADQNoIc1Fsf/86PKc3Bo69SxEE630k3ub5/DFx ++5TVYPMuSq9C0svqxGoassxT3RVLix/IGWEfzZ2oPmMrhDVpZYTIGcVGIvhTlb7j +gEoQxirsupcgEcc5mRAEoPBhepUljE5SdeK27QjKFPzOImqzTs9GA5eXA37Asd57 +r0Uzz7o+cbfe9CUlwg01iZ2d+w4ReYkeN8WvjnJpAgMBAAGjggERMIIBDTAfBgNV +HSMEGDAWgBTAephojYn7qwVkDBF9qn1luMrMTjAdBgNVHQ4EFgQUSt0GFhu89mi1 +dvWBtrtiGrpagS8wDgYDVR0PAQH/BAQDAgEGMC4GCCsGAQUFBwEBBCIwIDAeBggr +BgEFBQcwAYYSaHR0cDovL2cuc3ltY2QuY29tMBIGA1UdEwEB/wQIMAYBAf8CAQAw +NQYDVR0fBC4wLDAqoCigJoYkaHR0cDovL2cuc3ltY2IuY29tL2NybHMvZ3RnbG9i +YWwuY3JsMCEGA1UdIAQaMBgwDAYKKwYBBAHWeQIFATAIBgZngQwBAgIwHQYDVR0l +BBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMA0GCSqGSIb3DQEBCwUAA4IBAQDKSeWs +12Rkd1u+cfrP9B4jx5ppY1Rf60zWGSgjZGaOHMeHgGRfBIsmr5jfCnC8vBk97nsz +qX+99AXUcLsFJnnqmseYuQcZZTTMPOk/xQH6bwx+23pwXEz+LQDwyr4tjrSogPsB +E4jLnD/lu3fKOmc2887VJwJyQ6C9bgLxRwVxPgFZ6RGeGvOED4Cmong1L7bHon8X +fOGLVq7uZ4hRJzBgpWJSwzfVO+qFKgE4h6LPcK2kesnE58rF2rwjMvL+GMJ74N87 +L9TQEOaWTPtEtyFkDbkAlDASJodYmDkFOA/MgkgMCkdm7r+0X8T/cKjhf4t5K7hl +MqO5tzHpCvX2HzLc +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT +MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i +YWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQG +EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3Qg +R2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD9 +9BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjoBbdq +fnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv +iS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU +1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+ +bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoW +MPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA +ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l +uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn +Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS +tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF +PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un +hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV +5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw== +-----END CERTIFICATE----- diff --git a/node_modules/pem/test/fixtures/idsrv3test.pfx b/node_modules/pem/test/fixtures/idsrv3test.pfx new file mode 100644 index 0000000000000000000000000000000000000000..0247dea03f0cc23694291f21310f3ae88880e2bb GIT binary patch literal 3395 zcmY*ac{tQ<7yiu{V_$|rA%;e>y=E+9O_nU#g|hFBC`-tmWsqeoSyGW9LYA!AlQm0d zlqs?cuRUcMvVK$7_r34+{c)aipZh-Nxy~QY_1q{N(`7J-3WZ}lgwlyV(0Q=O1fl`u z;TYE;IL2iPy@0|&nf_0rK7rt<4^TL2G9|X44F8>Cqz8fXaF7!e4sw9vh0_0zrd-Yp zq5aB`c0pwf*#!pE3`1~`u};|qLmAL66%SqGD&c1ok7w*g=3CPGVk4GBqUnz5R$^lb z8Dv(rRpfX7yvJ$AZ8B=IukK|?oWq7THPW9AE8<%>%oONtPAOw&x8_?KHa0J|WVwA0 zIe9iq|#j@0h-r2z9#p>N7n4=mGfXBZdZv zm>}$|9($ZRdyt-g#VGBa?>B!qNzif-i+FE)kucwfM0uQ_?eH5E22H7{O&W(b9&xxe z%p<>vWCX)-exQO)Be=&=gf&-c#+j`(NUetfn}WVXG{= z^!3S{N|*XdJW@10Ikf3}LcuN>qA~Ixlg<}c;VO{NzpbcV)gX{XXMvCF$|Bihu8%Mj`v7 z@JI#bMy0mL?ntjDyu>tItFCrcM?2T4qxi{DAYXF4re+jt!0KM!4AX1-`m6J2B-j7$ ztQmXW9+nsyVA76pGD!SNDBJX7<=P3^TAtMP*S&|$8V_zcInNp6F})=P6L9WM3skx( zrU*k+zF?-S=hmjpL4Q3zv>!AS5ZdH` zP7@1%4o~2pGsTCkqHI#fTE9t6L}0I0RV#X80*5W8dQ!d^3i!EAcx!{g?Ymhx9_uH| z%5-;5L5^5@FPajHS9ShoBMyy!p(c{qxOAL#hI6ENh505_rZ0?SGHg>G?cH-JcX$bP zvvcygKZ|q33xcOvl0F>Lq;-3oT1}&U{+hFQhdrnZ&f3Cd?*G~+e;NZj-CLQ#d7u*d z-zLck*=~$_*oTD=7glD2s_n4ZBbndKCJM<*Y#U_RIHLGB-|y!WU`T^)1|P6xbeP|G zVeM+?bDY~u1~eh71YCS>5m|2W++)$^^VxHSdmxwhWqlh$#}_R*QJIE}!YhyC22(}y z-pGi)Mp$4isupi_SdyK1kwa|ypqYxDZM%%-W8XLUrq=uHuIVLfoLXn0Ft*+*&7DasMmP3gdi3$so3cjv zU3_I_!HIUJ-KLn$?yVs^q%Nt?{K4vH$8|KG-fP7I-JGh){ZkukKp&IeTFS zofK|@;`zesc<{wV&~=^Lpxwgq@1SZU!pFuL4xnXwJhXzpFXWPHqe5C^&F$XOKSyA*?hARwF^42%X)?En0pbR1|X1Ofs80A>9z2}c|9=>s8v zEFceP0#bk)B`W|LfCL~z!7_mQA0!RPQ8WpPf}*g$)hhsoqDlYhLQ^z_KfESzA7%UR z0wA<8pCMoXxBgEJg#e8I z^!ZaN7vLt~Loo#6Kiktl^Kj613iSpI0w}5OUj_7kE&%=Q0@7Z?>>U#@$=@yzfrG{o ztFTv(L~LX}xO!x0^EITtLxl@_o6uy5gghAR{hz9rAUI9X6qKa_Nw%q za~SdO27));Ss1O7WmAmU?z>@+sX7%|EH>F*@OZUVn!`%vFPjg13@;Tl|_JIFJuO?ibe+@(=CitY0KN zmhw8P&DGlJBqvEH_i~51(xCCqvU$O5a^w(gap!{;x$=mI;>(I{4_^3{xSVlt0*&Z-y38aD8;?f`*U1VzA?{YPa$fn^V7$cGLd)&c%khfmt-qvZ_d8X! z7hHsG8{dHEPrBwl**uN9qgJ5pDa-DS;*TkBvMr}WsGRp(tl&q zOLj#>q5fr!g3h>N*4Lo!^2f&yedb9`Kc@UII#(J*#=~mQpg7_^@Qad_`7&Rw^Q13P zmkj26C2^Lfg&(Un^M{l&&Z~Al#>~&po-IRgbH;zV|EZU6sq2W4r<`>`jAnHJX0F#X zoYLuTJJ&S__HOHM}CU)!}{mUnHM4&H-PJ zDgU|rTaFE6VJ^#8$-7}h}^b=$AFm^Ju%|Irt#Xm@y!x8ht)nP}yX zak6LD=XrWjz}YIk=NKi;Oyzuyhr4N#>$;BIHeVmO7CwR&BH~$h($R>lxm#|jH)hMo z7Cl?fME$4w@i!`TUwnfzepq`tb2MXQ>vjOez4DO&G+ zwbxqf;c;Lz7e^2GJN4&pn)*n036&#X{M)L}3jNt9WQoG#Ltw0 zBSd@4uASn_19~vFMd|jhEOlmOnzg#t-W`Y8`{ihls#Ej*@-YyvQR5@XB{Zgn*UU@bPjBb)ma-dM*TyAY#Qr-I?}ssTqWiQUU~9nVL8urj8g zB=?6~(E%Bt>5<*!OPB%-9y0pkl!uu8}JyuP^C{VwK-!6&8CcOsFR z#AD|e+mNE9i#41w#l(h}rbw&h^*Xp8>93ZTvg}r-DJps1W6hRpeV*HGw|(EWnX7>t zi;7~9X)yDN{8DJzLpxCoH*tL3SHK!$Z}tQc<%NTk$t)S*4<=4>wFvMd!y)pV_liw) z7Z+8=AXg^QgwL(&DRsQU5*({(LDt{G-4Rx#dhx6AP+_msH%Jue6QCy=B0w?y#4k$7;> z=5ttmpV&vFVv}ZY>6NE%#+W))M)nU;WMS%-mtLT!)&4oAMhnY2Hb@dJUGXLb^4wIex}=co7n{7tD1N!| zw63xzN%ImPTf3iZ?X@yq6*F$jX5my$Q%SSyOrlD)y}jkyw`e{y&l34ahp)821A!iS z4-;-p@j6Gn!f>FJQ2ZzwD76?f6_^_WN5dA?3G%E0bF79+L#MT|(Yv~t5ct?-mV0Fj V%$88{h~I%@Xjg7x^oQR@_8&Ry9S;Bi literal 0 HcmV?d00001 diff --git a/node_modules/pem/test/fixtures/inclpkey.pem b/node_modules/pem/test/fixtures/inclpkey.pem new file mode 100644 index 000000000..1e97918d1 --- /dev/null +++ b/node_modules/pem/test/fixtures/inclpkey.pem @@ -0,0 +1,86 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKAIBAAKCAgEA18CnxulIxFNAs3bZLzcoPaPEQtB2zQibUOMcUeUUcvoroLEG +I/PBrZJ8ef4VVNHlZ2La7YGqfuKxUKn72CkJ2oRNPPRuE6sL1e6AYzJ9V6+DPBwn +7exn1v0cEy1Av9Hav3q2Z36wdTttYZ3MbBqX8Vben4DTFmC7im9Gm740dcNM0vHI +8z6YKDDkyy0lYWJIvi7c7ZCTrnS3+klDZSCsjv5SbACOUT62msZPRBx7hBe9XPY2 +6UyRiW9OrawQQcXFZYogyPcno+qsW3QJmSeIYMdEaRgMMhp38kdTRuMSxWmVRRWa +FGB2IKe1jFG/WlcZWseovAvEMMoL5tD4xKiE2SSikvaE8hPqpJOX/u132C91eiw5 +iDxEVgrvElfVno81jn+E5xrRGY0j27XOxX/hiG0E1gHe8HI+UZUdTzC2MgoPhLUA +NOS/gHEQYhTBMlqppt7CWOhS62ZauF7CBnymajPyHopBB1O7a0GSWYV5BKnfVkzg +Yh6Yh5UHsRBJNJyQTAuDJSefASf70MRuUMz1AkcsRZox5c59ho/b/YPqpgBJcRRE +oY6duqSkz50VIC1ndkKBY6J2Tksitd492PjgQ3+jEPBz+27hajeZ3IejBUwp9WMU +m+ujOpsrtFH1BQPeQeXLGo5260eTU5BxxY+GX54LTTOcPIiKkJ+QpjWQgfECAwEA +AQKCAgEAuKLJsiMwP7sTcsHxyUNFr8J3kco+8OY9rLI/KSKHJoJLVcBJBflztOvY +lLnJXYYm8RwbSQgfdWjg36wot2sfYJ66TsDLdw95GIJ74uhxddng0E80KJuYndaL +8SlX8RBRSG5mrRkxP5I04EYfjCASCdoSuKORgeQUersRzPSwhls1YozCMNBPfI2j +LvEavUVUBVWrga6pg7GlRI7wGxokMlcZCA5NvN+Te87cROivF3MNfgHDKlJ5dgkI +Zv4KB4+Nh4D236ULim6pQ7aBBE1dm5zMQbfvr+0Q2wkJDnADP2hE8xMygd+vF/EO +H+BRhqllLFgTYaIcKriuCMCrM/kXff0Wz/zgqRzoUBvYTkL1dBWWNxnDe2nN0UUl +C6fE9RRHJqOGJDDeKDe7S65h08Mbxxh4ZOaRBnxtOygvILza2rGRZ3kxPgPqcSIX +HU3e76OOL5IrXV+C6Z0RX6Fckm2bu1Ado1iXS2xXWDCR0AVl/ADhVIOl5uV9iBoW +eGV1E8uNbCkAZXdAVWXEfU780qN4QCcNmL+Do2nkC/z7E78/m7bTIsk3bXKg3eyc +dm5Sz0I5MrrSliE3WNZDL3RqbTQB+b7/e1MhuIW4pBCtePzbrfl6c/RJ9NjVp3nM +x25cSx8pwCSDh1O63Tjs7S/YwLXOAm86QrsLsNZKh15KG5BTNoUCggEBAP7c6LPt +ZUIHt5r6g1Yb38pR/y2e4d5x9HT/ej6WPCocILcBpHHgOreIER9ZchhrjWvldsk5 +N97TCPolGalKj/NxOdOCyTg4h79z/ivSTDzp+6XAtT/hkf0ylKszxaudbp/2BCpR +/ioBqhcxTlpLEv89VGuGL69U1vySP0ulqfad7Qs3Oig1/tee8bFnj73RR31iDEda +vuDllni7ZM74Q/ibM1T82b9CQyX5VliZbfqMGW6o1mzQEclV8VDBXetJKla3LysF +peiegN1Cu7qxVqymBxoN1ON2x6UMJs2h63dDCrbM6j2j8uA22/RmBE0OtD8QboAH +9q6TSHHmbiJAhysCggEBANi3E5sLY1SdyFTIw0xf/KKjqYQanDo44sZgpN718AtC +gVIf0cn2phIfUx4zHMygQFs0jdo2dghSYIV827/5+X8hmWthVZOTWaQvgcME9PCA +adWn4WcM6VMycWLFsKQzq5hTak17KUx56JETZOti0BKKy4kSr+NcS1ojFJILM0M3 +M1SlXvOIxmZa5QUKR5ZasUiXyFQxv6PiREhM5ppku6NnX+Iroygj09rz/7TrX4Di +ivOi3mUJK/G5047aASR2TbAweKAJ1HYQ1wZkZONAluMRaPruzwQlPFmDmwggNT6a +qW+1vLWd1KRQmoPsPTOX0OwNQq96dOJV59TsnpeWjVMCggEAO/JMDd493f0gs6RO +9hcSWW1V/y4K5J6bKFXbNBN0TVdWXpVVT6+1P+wSUvRgANxzZDiR6xy5RoEO8H9/ +fLFcEJ/GQTjXCZFKZL7svvP1GLLUjRU5zK/K/epCy84epZIfLiLYsfedN9YyYsgn +LNfRvRV44N2sI6pp8viXSLzLsIVO9z9jP4gLzD3HjbnVNomeLiC80J/Im++EqBsz +x/bfTf97YHck5Ha6gpkWNTrJgpAnfz7ZSLjcJiY/34XMCIaqHcFyp8TpVEDMAL8s +luoVgACBVSCBvYr3xJuKGP4H+4JaZ8rlIeCJRTHCJMdGJbXasaa0xwqYfFGKTbgs +mYPiBwKCAQAa6RDsLcvV1AnuTUfDEiBC6ePA3bUMnce7LoEKlquKGmYIlp7sX05b +7bvagipPVo7nRG1g7WZWvjPyH4ECI75RhRCR/vIrcx6sfqG0X8cynh+GQmSA8V9/ +z0G5LCc1HJ1wOtt2Z5bHQlQYv7nGaOzBgK6phMKGjw1kUfrZ774b2JztI+PYheFt +EFhj+dTN3NEq3H4pxkuvxAcKm1H/Vgbe0ZVcdmK6N0i1ZZsZEik3zenHOzA2h58H +UzXsBTIjHvWirUItTUsupgStbIYCmiCibaUFk+Xs89q8mtUDe0xhS79CeeTHAKRJ +CyFExG8NGwr8ZOEk/SXKfTRegktnM3C1AoIBACF8jJNF9hlI0nxjKt4TP1jUTCx1 +Jz25APXDpgfMyOatLa5LGP37/FHJwehxim17CrBmE4ahIin7myqZ5MSaf81Dr0qq +k0dWj16h9P6TvfcNl2iwT4VIwx0uy2faWBED1DrCJcuQCy5nPrts2ZIaAWPi1t3t +VbDKQvs+KXBEeqh0qYcYkejUXqIF0uKUFLjiQmZssjpL5RHqqWuYKbO87n+Jod1L +TjGRHdbP0zF2U0LdjM17rc2hpJ3qrmgJ7pOLzbXMcOr+NP1ojRCArXhQ4iLs7D8T +eHw9QH4luJYtnmk7x03izLMQdLWcKnUbqh/xOVPyazgJHXwRxwNXpMsBVGY= +-----END RSA PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIIGJzCCBA+gAwIBAgIBAzANBgkqhkiG9w0BAQUFADCBsjELMAkGA1UEBhMCRlIx +DzANBgNVBAgMBkFsc2FjZTETMBEGA1UEBwwKU3RyYXNib3VyZzEYMBYGA1UECgwP +d3d3LmZyZWVsYW4ub3JnMRAwDgYDVQQLDAdmcmVlbGFuMS0wKwYDVQQDDCRGcmVl +bGFuIFNhbXBsZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxIjAgBgkqhkiG9w0BCQEW +E2NvbnRhY3RAZnJlZWxhbi5vcmcwHhcNMTIwNDI3MTA1NDUzWhcNMjIwNDI1MTA1 +NDUzWjB+MQswCQYDVQQGEwJGUjEPMA0GA1UECAwGQWxzYWNlMRgwFgYDVQQKDA93 +d3cuZnJlZWxhbi5vcmcxEDAOBgNVBAsMB2ZyZWVsYW4xDjAMBgNVBAMMBWNhcm9s +MSIwIAYJKoZIhvcNAQkBFhNjb250YWN0QGZyZWVsYW4ub3JnMIICIjANBgkqhkiG +9w0BAQEFAAOCAg8AMIICCgKCAgEA18CnxulIxFNAs3bZLzcoPaPEQtB2zQibUOMc +UeUUcvoroLEGI/PBrZJ8ef4VVNHlZ2La7YGqfuKxUKn72CkJ2oRNPPRuE6sL1e6A +YzJ9V6+DPBwn7exn1v0cEy1Av9Hav3q2Z36wdTttYZ3MbBqX8Vben4DTFmC7im9G +m740dcNM0vHI8z6YKDDkyy0lYWJIvi7c7ZCTrnS3+klDZSCsjv5SbACOUT62msZP +RBx7hBe9XPY26UyRiW9OrawQQcXFZYogyPcno+qsW3QJmSeIYMdEaRgMMhp38kdT +RuMSxWmVRRWaFGB2IKe1jFG/WlcZWseovAvEMMoL5tD4xKiE2SSikvaE8hPqpJOX +/u132C91eiw5iDxEVgrvElfVno81jn+E5xrRGY0j27XOxX/hiG0E1gHe8HI+UZUd +TzC2MgoPhLUANOS/gHEQYhTBMlqppt7CWOhS62ZauF7CBnymajPyHopBB1O7a0GS +WYV5BKnfVkzgYh6Yh5UHsRBJNJyQTAuDJSefASf70MRuUMz1AkcsRZox5c59ho/b +/YPqpgBJcRREoY6duqSkz50VIC1ndkKBY6J2Tksitd492PjgQ3+jEPBz+27hajeZ +3IejBUwp9WMUm+ujOpsrtFH1BQPeQeXLGo5260eTU5BxxY+GX54LTTOcPIiKkJ+Q +pjWQgfECAwEAAaN7MHkwCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNT +TCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFLVdDU9V9nUaI7P1jLxr +WraWbK7gMB8GA1UdIwQYMBaAFCNsLT0+KV14uGw+quK7Lh5sh/JTMA0GCSqGSIb3 +DQEBBQUAA4ICAQC/P+cWorqxz9Z584TtpRA+YEIO1RrG6bE5hlou3a62txYzMxc+ +g/eh97QbCXSPmw2OTMeh1mZsAjq18nKqyeSzxp1uwEjcOSEwGKBvywm+3g9jgwQy +c6e8QjS3odwhIQiGZbwuxXiu+/6r+4uFv2Hg4qpSXx4NGSITlHq0vVwwjUMitOkT +Yn4+9eJ6KjvaH1dKXbhsTPVuNLm9tB/ciNAoIKIMMeh/OiO4YEjITuECYq4A+9Cl +dsvq89d1DZ5WSMEuRMcMnwOzrJbFoqAGnivD67UEFTN5Sp4olB0oUJjj67V0aX9p +vGFy0YrM+4m+UTSBEXv6is/nv4GRNBoRY5JB62J9eipaK6OFNls5CEBrDby37TZC +YEXuDCfxQTie25mPD/8b6gKYnxkhM8qiR4nLHalMlLY9suK/HfcSjQH/d9ZyZXDK +gI6iLXgMsp2EOlD56I6FA1jrCtNb01XQvX3eyFuA6g5T1jWGYBDtvQb0WRVkdUy9 +L/uK+sHQwtloCSuakcQAsWV9bajCQtHX8XGu25Yz56kpJ/OJjcishxT6pc/sthum +A5PX739JsNUi/p5aG+H/6eNx+ukJP7QaM646YCfS5i8S9DJUvim+/BSlKi2ZiOCd +0MYH4Xb7lmAOTNmTvSYpKo9J2fZ9erw0MYSBTyjh6F7PRbHBiivgUnJfGQ== +-----END CERTIFICATE----- diff --git a/node_modules/pem/test/fixtures/nopkey.der b/node_modules/pem/test/fixtures/nopkey.der new file mode 100644 index 0000000000000000000000000000000000000000..2457364ef9fa0aaffa38bdc374bed033711075cf GIT binary patch literal 965 zcmXqLVm@fl#H_V|nTe5!iHT3nfR~L^tIebBJ1-+6D=ULR<7`8215P&PP!={}Ca(ZP zJ_8;QheMb(BtN?{-%!AS55#8|W_Qjg&DYH?H54@92Z?YAbGQ{H=4G3>xEM+ph=GK- zh55r%lblnFN)&=i3kvd!N?)g53U0QbjD{JDin|W8)PTQtFsMq&IVgG`+M^nBRZ)A#gH)YtB z_bNG5_~9($dt4h&3h}E$r*WO|2aeHykReP+N%$J`pvDg^3XZ!fgY0OXJKJx zVqIV$3*zvxh_Q%-Y53*Fd@}O(a;ovm%}Czqd`{t{LE{CGyfRDU34_L?4I)XOtKYI+ z*?4tMy~oq{M^B0-{=F%pM0p1Or$dlzrUne}x--|FXUEc wR#^1Mv`&o5ICKyWUbKhS4ICQ}j(NErHYMi~VE($RN09!^V`v3p{ literal 0 HcmV?d00001 diff --git a/node_modules/pem/test/fixtures/nopkey.pem b/node_modules/pem/test/fixtures/nopkey.pem new file mode 100644 index 000000000..e251f0abb --- /dev/null +++ b/node_modules/pem/test/fixtures/nopkey.pem @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIIDwTCCAyqgAwIBAgICDh4wDQYJKoZIhvcNAQEFBQAwgZsxCzAJBgNVBAYTAkpQ +MQ4wDAYDVQQIEwVUb2t5bzEQMA4GA1UEBxMHQ2h1by1rdTERMA8GA1UEChMIRnJh +bms0REQxGDAWBgNVBAsTD1dlYkNlcnQgU3VwcG9ydDEYMBYGA1UEAxMPRnJhbms0 +REQgV2ViIENBMSMwIQYJKoZIhvcNAQkBFhRzdXBwb3J0QGZyYW5rNGRkLmNvbTAi +GA8wMDAwMDEwMTAwMDAwMVoYDzk5OTkxMjMxMjM1OTU5WjCBgTELMAkGA1UEBhMC +SlAxDjAMBgNVBAgTBVRva3lvMREwDwYDVQQKEwhGcmFuazRERDEQMA4GA1UECxMH +U3VwcG9ydDEiMCAGCSqGSIb3DQEJARYTcHVibGljQGZyYW5rNGRkLmNvbTEZMBcG +A1UEAxMQd3d3LmZyYW5rNGRkLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC +gYEA4rkBL30FzR2ZHZ1vpF9kGBO0DMwhu2pcrkcLJ0SEuf52ggo+md0tPis8f1KN +Tchxj6DtxWT3c7ECW0c1ALpu6mNVE+GaM94KsckSDehoPfbLjT9Apcc/F0mqvDsC +N6fPdDixWrjx6xKT7xXi3lCy1yIKRMHA6Ha+T4qPyyCyMPECAwEAAaOCASYwggEi +MAwGA1UdEwEB/wQCMAAwCwYDVR0PBAQDAgWgMB0GA1UdDgQWBBRWKE5tXPIyS0pC +fE5taGO5Q84gyTCB0AYDVR0jBIHIMIHFgBRi83vtBtSx1Zx/SOXvxckVYf3ZEaGB +oaSBnjCBmzELMAkGA1UEBhMCSlAxDjAMBgNVBAgTBVRva3lvMRAwDgYDVQQHEwdD +aHVvLWt1MREwDwYDVQQKEwhGcmFuazRERDEYMBYGA1UECxMPV2ViQ2VydCBTdXBw +b3J0MRgwFgYDVQQDEw9GcmFuazRERCBXZWIgQ0ExIzAhBgkqhkiG9w0BCQEWFHN1 +cHBvcnRAZnJhbms0ZGQuY29tggkAxscECbwiW6AwEwYDVR0lBAwwCgYIKwYBBQUH +AwEwDQYJKoZIhvcNAQEFBQADgYEAfXCfXcePJwnMKc06qLa336cEPpXEsPed1bw4 +xiIXfgZ39duBnN+Nv4a49Yl2kbh4JO8tcr5h8WYAI/a/69w8qBFQBUAjTEY/+lcw +9/6wU7UA3kh7yexeqDiNTRflnPUv3sfiVdLDTjqLWWAxGS8L26PjVaCUFfJLNiYJ +jerREgM= +-----END CERTIFICATE----- diff --git a/node_modules/pem/test/fixtures/pem196.pem b/node_modules/pem/test/fixtures/pem196.pem new file mode 100644 index 000000000..0845368ad --- /dev/null +++ b/node_modules/pem/test/fixtures/pem196.pem @@ -0,0 +1,35 @@ +-----BEGIN CERTIFICATE----- +MIIGFjCCA/6gAwIBAgIIJ5ucCoLSHoowDQYJKoZIhvcNAQELBQAwSzEsMCoGA1UE +AwwjRW50aWRhZCBDZXJ0aWZpY2Fkb3JhIFB1YmxpY2EgQURTSUIxDjAMBgNVBAoM +BUFEU0lCMQswCQYDVQQGEwJCTzAeFw0xODA0MTkyMjAxMzFaFw0xODA0MjIyMjAx +MzFaME0xCzAJBgNVBC4TAkNJMRswGQYDVQQDDBJJTFNFIFNJTEVTIEJFQ0VSUkEx +CzAJBgNVBAYTAkJPMRQwEgYHKwYBAQEBAAwHNDcxMjI4NjCCASIwDQYJKoZIhvcN +AQEBBQADggEPADCCAQoCggEBANU/nRjNgV359qnNoeGFDc54ZSu+ewUgerYa3N0Q +z67vm1RihYo5dWgZRb4SSWMh9fJxSEjr2DpWOpOwhOGj1+0LGdHFVeDRyaF2ftEE +TXtR3Zif//uYQe4IkIGPBovqhbMMChMoR6yEQp41nZXdy1MUFAUc/jv20uKy2kwW +EGbMlhZolZTxb+usyFPBXswmd2zyoiQc9rza36aaXwFo5kX5g5h1ZICdWFybuexW +B3PjU7zc/MgSD2fUeq6DZnQZuhjQEe6IeiOALsDPFIFmxA71CA7elfIPOi/FuyCb +T9nytF5aIKzoXqX+FgzpRJnJnLMYju8GCPtXHd15eba9MOUCAwEAAaOCAfowggH2 +MIGFBggrBgEFBQcBAQR5MHcwQwYIKwYBBQUHMAKGN2h0dHBzOi8vd2VidGVzdC5m +aXJtYWRpZ2l0YWwuYm8vdGVzdGZpcm1hZGlnaXRhbF9iby5wZW0wMAYIKwYBBQUH +MAGGJGh0dHA6Ly93ZWJ0ZXN0LmZpcm1hZGlnaXRhbC5iby9vY3NwLzAdBgNVHQ4E +FgQUWIM6e2y6hsQpY5q9mwW1Pi12puUwHwYDVR0jBBgwFoAUdaV7ANOxKdxh5iBJ +pnkWLGdmvUIwVAYDVR0gBE0wSzBJBgxgRAAAAAEOAQIAAQEwOTA3BggrBgEFBQcC +ARYraHR0cHM6Ly93ZWJ0ZXN0LmZpcm1hZGlnaXRhbC5iby9lY2Fkc2liLnBkZjCB +nAYDVR0fBIGUMIGRMIGOoDugOYY3aHR0cHM6Ly93ZWJ0ZXN0LmZpcm1hZGlnaXRh +bC5iby90ZXN0ZmlybWFkaWdpdGFsX2JvLmNybKJPpE0wSzEsMCoGA1UEAwwjRW50 +aWRhZCBDZXJ0aWZpY2Fkb3JhIFB1YmxpY2EgQURTSUIxDjAMBgNVBAoMBUFEU0lC +MQswCQYDVQQGEwJCTzAOBgNVHQ8BAf8EBAMCBPAwJwYDVR0lBCAwHgYIKwYBBQUH +AwIGCCsGAQUFBwMDBggrBgEFBQcDBDANBgkqhkiG9w0BAQsFAAOCAgEAT9ms6z1g +ardIFD3l90bv8tug7ktK9Rp4d6DLuAjvgDN6fuXCNSwH4nydMJSUS9KlHAaBtFVD +7/RLDVIcoq+FQStXuAjZnOP3fAPgnPr8601rXFhrF2cP1Z7yTR88L9SRu4Xhordl +qPUiSnY1mKiwb7NvjKrFd1Md5zdAraCLtGJw8JGy/QbJIATq+spHTRb7sXnrNh++ +AoZOAx//8lzZkQcO8fZjwFvhXYcaRrafzKUnbU1KuTSx7KKnROzrtO8dHafiJ8/0 +wAWemFkV7fGSDq7IVN1YSTp46vNh4GDt9613x+vE2CLPlWATFDhC6o7b7+0J+g8q +Ac0uUBzqSIhh5HRFIbSmC6o2I48JDB8bWWApjyh6rDpJhvl6cUHbyOzFSceXmf+S +UPvMHk/4A1mpXyrbPCX4zkREyoydxwWNhL/QJWiXF7gKR3miXUVFIiv+RIiT97fC +/GYcLF1RgJENPI7j2JFbqXGXpxoozLziESp51NxTpiusKqUQhBerq/MM97uENwX7 +qr1Qdti0YqKVeth7vgkzhdlSzyyNqripalR/O58uFxRSedU+qLmeT6rJW6FU7KHr +Nr/lVEdzOCFyBln866lF/qN2oLkxJvJCjjuRKbgTzv7V2a5itR4B+4DMUh+iiygb +aptRpqCDtfmC6IjiFUCL4RiwwyxsYgsuwsI= +-----END CERTIFICATE----- \ No newline at end of file diff --git a/node_modules/pem/test/fixtures/ru_openssl.crt b/node_modules/pem/test/fixtures/ru_openssl.crt new file mode 100644 index 000000000..efd463d71 --- /dev/null +++ b/node_modules/pem/test/fixtures/ru_openssl.crt @@ -0,0 +1,36 @@ +-----BEGIN CERTIFICATE----- +MIIGTTCCBDWgAwIBAgIJAIHtPbhZDAgJMA0GCSqGSIb3DQEBCwUAMIG5MSQwIgYD +VQQDDBvQntC/0LjRgdCw0L3QuNC1INGB0LDQudGC0LAxHzAdBgkqhkiG9w0BCQEW +EGVudmVrQGVudmVrLm5hbWUxIDAeBgNVBAoMF9Cc0L7RjyDQutC+0LzQv9Cw0L3Q +uNGPMSowKAYDVQQLDCHQnNC+0ZEg0L/QvtC00YDQsNC30LTQtdC70LXQvdC40LUx +FTATBgNVBAcMDNCc0L7RgdC60LLQsDELMAkGA1UEBhMCUlUwHhcNMTgwOTExMjAy +NjU1WhcNMTkwOTExMjAyNjU1WjCBuTEkMCIGA1UEAwwb0J7Qv9C40YHQsNC90LjQ +tSDRgdCw0LnRgtCwMR8wHQYJKoZIhvcNAQkBFhBlbnZla0BlbnZlay5uYW1lMSAw +HgYDVQQKDBfQnNC+0Y8g0LrQvtC80L/QsNC90LjRjzEqMCgGA1UECwwh0JzQvtGR +INC/0L7QtNGA0LDQt9C00LXQu9C10L3QuNC1MRUwEwYDVQQHDAzQnNC+0YHQutCy +0LAxCzAJBgNVBAYTAlJVMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA +mG1gvqlNWIPvUKA5um5GdOUssI5R9MdjoUBFVaZKva8DRDGyI/TcHUmfx2DfiDX3 +Xaa6iez7E4LYvKwiMqmYFSZZa5fVlYz2ggbmldudTnoc7pWzsDafhIwfEVuZAftC +J/LvjIDSZcItPCe+lCwzkLZSZNeR4xS4IUKpMcd2q+8YA1SgBynsNWHU/yv0YVKX +O25bpCvlWXi+5gNt06gZv9gcCH9PsrMJb0S3ZozeG/VLb056zuUUic8URzhuhdJU +0OaXAImRaN7LDE9Ya1gitbvKyP5a93pxIb+B95Gs0YTb98QAYeMChkhdETOww4aJ +hyROJJci/uS/einmAn3AHv9qkFjC9erMvejnaQlTl6hFKtVc3vbvWLfLoGBV4vB5 +tI1O6Bht6m/SOMJ7bFA8T/v+Sp0iWFyGiUFuLUxnLb3sWbrjnp5WWRJXcqmbnV/I +yJu1+4YrdqsWF5LMCmZZNynUiBEjICcLWGIdXsUcRFQRRs4hTdxZO9+gwEPIM32t +2QQKmqWuElIWNsRqQ5o9UTUorT+qPSAi2ajeDHh31yzqTRTm7DG6rieJfI7JvYdv +rTSD7zsK51Y/wmNB43JnRDaIo3zPA4J2c/WO1HQd+LUsJqTdS74j5ac+9NJM8PJY +ZOTKQ2oJ2BMYDuJLV9cG4vz6VoGZSV99bBwE/Fbdm/MCAwEAAaNWMFQwCQYDVR0T +BAIwADALBgNVHQ8EBAMCBaAwOgYDVR0RBDMwMYILZXhhbXBsZS5jb22CESouYXBw +LmV4YW1wbGUuY29tgg93d3cuZXhhbXBsZS5jb20wDQYJKoZIhvcNAQELBQADggIB +AIiEFg9fRBEPQlfGH/fL3BLFT5al+oZPT3G+AYefMfMg7gXl07uBXCpOzhSfxoWw +to2wvORN3Du4vjRbeCLXYAuLX0jz/TgfRDlomLz7u9FND/YftsrLVGvdUE/SPfDm +vPvwA8ga0hNytHJIUFdXSjikCcY2EdBy9c06OW3q9AUEIvlFMexe+aJ8N0y7j5oU +K+2GWqhXR9boqcPIH5l48lYYKlhtpK6lBF1w/EqTxhXZYYRUOtfhPu5+Z/w2sgzF +HtbChDNX7u0IDCTJlQtkbLv7PV0k/PAVkf6ublexfoGhSaycCT75J3KMKofB+8/K +WpymjMtWWHaTVGzbd7ipdXdY/cRqN5qAgiArxYKaYNCu6UUEF/MD38dVjnymD1mN +rG1iIiytFifxnRzU3iUNRgSAyYZGhx9zYkdthS3zjPVvEvPjpTXRFhw9M4pl/dpc +M4z3kAjFaSEiS+Pzump/2T/BIi7s/MdtLMj2OoLTBjusCpRkugKHIUN4ET/glF4B +J/Jb5bMQXeXZ+HPg3gUAgJ9DCjcatxoIS8CGkW8NsYRAYtYKPGsVhXEovWKkNaFv +6wlHomLRIo5lQ0ZyX+VQ6FWEOnN6JMMuonZexrXrHm7WWvCL9BYOL7sj3jtfHUfI +xrFS+TZNYSGp8NqwiofG8tzK0ax7A6XmkKD5SG9i34se +-----END CERTIFICATE----- diff --git a/node_modules/pem/test/fixtures/ru_openssl.csr b/node_modules/pem/test/fixtures/ru_openssl.csr new file mode 100644 index 000000000..e8c7d2373 --- /dev/null +++ b/node_modules/pem/test/fixtures/ru_openssl.csr @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIDNzCCAh8CAQAwgbkxJDAiBgNVBAMMG9Ce0L/QuNGB0LDQvdC40LUg0YHQsNC5 +0YLQsDEfMB0GCSqGSIb3DQEJARYQZW52ZWtAZW52ZWsubmFtZTEgMB4GA1UECgwX +0JzQvtGPINC60L7QvNC/0LDQvdC40Y8xKjAoBgNVBAsMIdCc0L7RkSDQv9C+0LTR +gNCw0LfQtNC10LvQtdC90LjQtTEVMBMGA1UEBwwM0JzQvtGB0LrQstCwMQswCQYD +VQQGEwJSVTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANiwspBlQzk6 +Yo8EBaVHy/k9vNMpifcbcThux7xLXgwlRgnf8dcfFAzr6WDNGuFJaVihB6TjHKUb +gbafEDrorAiXC+PLe7rgN+tTbgN9r4qhSslRWVplkN4ZEByNAPHvbAW+8dAn7a3O +2tgTtTRSwCrPb53WxtJ4inSb70kKneTF90Ey3kUbRX93V71+nbdQAdxuXAWlLao9 +5QQRBdESjGeFuT6mpjlobRWnWDvcl6QMItF25PjBUF2Klmhk7nk2pyxkDAIkkdRe +JFAU136EoL+2OPSvAfrHR8b0YiZ9GCn6CwTt+5l6TaA19jEkpvmi70+oA2ss9+uu +u7NnpN9+Kn8CAwEAAaA4MDYGCSqGSIb3DQEJDjEpMCcwJQYDVR0RBB4wHIILZXhh +bXBsZS5jb22CDSouZXhhbXBsZS5jb20wDQYJKoZIhvcNAQELBQADggEBAMnzJVf1 +8nPMJa4B87Am+6BWSfxZfUV19CcKK8AtFpQSMUhulLaBa2962jXOHuqEGIj7kxq2 +byBb+6BEay8Oz57bTXthQJ+xr7bDf3XqsOoFy1oWDlZnstxAnl6UeJY8a6uCBqyY +tvdOaf80tntCjjMZ1eNMzg3eEFYl5OCG77SZf0vcST/lf8/ObUA/A190mUmUHktK +WDzI5AgaCDSuE9j8rsHeIyUxuEqb6T/MbeNfbHjUEwHrKnItMY099QtVbDmZ4dPr +axUyIatyGV6Fgn1ABplwBQiRC+6gc3+LJmc4etn5dSgdi0S3HtxYVY6oEfmmYkn5 +zdfhrg3O7xnDqto= +-----END CERTIFICATE REQUEST----- diff --git a/node_modules/pem/test/fixtures/ru_openssl.key b/node_modules/pem/test/fixtures/ru_openssl.key new file mode 100644 index 000000000..c7f82b228 --- /dev/null +++ b/node_modules/pem/test/fixtures/ru_openssl.key @@ -0,0 +1,52 @@ +-----BEGIN PRIVATE KEY----- +MIIJQQIBADANBgkqhkiG9w0BAQEFAASCCSswggknAgEAAoICAQCYbWC+qU1Yg+9Q +oDm6bkZ05SywjlH0x2OhQEVVpkq9rwNEMbIj9NwdSZ/HYN+INfddprqJ7PsTgti8 +rCIyqZgVJllrl9WVjPaCBuaV251OehzulbOwNp+EjB8RW5kB+0In8u+MgNJlwi08 +J76ULDOQtlJk15HjFLghQqkxx3ar7xgDVKAHKew1YdT/K/RhUpc7blukK+VZeL7m +A23TqBm/2BwIf0+yswlvRLdmjN4b9UtvTnrO5RSJzxRHOG6F0lTQ5pcAiZFo3ssM +T1hrWCK1u8rI/lr3enEhv4H3kazRhNv3xABh4wKGSF0RM7DDhomHJE4klyL+5L96 +KeYCfcAe/2qQWML16sy96OdpCVOXqEUq1Vze9u9Yt8ugYFXi8Hm0jU7oGG3qb9I4 +wntsUDxP+/5KnSJYXIaJQW4tTGctvexZuuOenlZZEldyqZudX8jIm7X7hit2qxYX +kswKZlk3KdSIESMgJwtYYh1exRxEVBFGziFN3Fk736DAQ8gzfa3ZBAqapa4SUhY2 +xGpDmj1RNSitP6o9ICLZqN4MeHfXLOpNFObsMbquJ4l8jsm9h2+tNIPvOwrnVj/C +Y0HjcmdENoijfM8DgnZz9Y7UdB34tSwmpN1LviPlpz700kzw8lhk5MpDagnYExgO +4ktX1wbi/PpWgZlJX31sHAT8Vt2b8wIDAQABAoICAHwTVNP+dlJeGxjzQ+qIx1ty +DX2ua/Int+bTrVy5308mPi9tkIeKUv6YJrKiHXMAEtqt1FxfhkVslkaGi9PXj09w +Bwv47UguFZ7kRSCpQxRVfGWNgFYpMJIxiTyU5ijhwQlJzEr/tcRVWoMECzMMA/GB +J/KkM0G4ZOXWIGm/5s6v8kkLwrPyIS+W8k3AFs5971LWU0yA2tGI40PSeLz4sfUi +0jbsgxCAgmaLdgrJEieJ9ZymMntlp+FBqk0LF5RhEN93RGWQlcfay0e68st2U9LB +CaGwwpV+msaQ4BeJAjcOwgueBX2ozy5Fi1RsUi/mvN4/5EgOqtL3mxGzN2LBv/d5 +3D8D5TuiFtR5uHX4jNO8TLQ4/34EqurqELsydq/I3EduxwbzVV0qw9gp/KgftZ+c +wuZvjoqwsJyleK6XAsBipjszGZvWDHoM6F20rU5kAw8gTInwIjtFgb/CpzOnUqlK +zBlWsyE6tEdyLak94d9qWbuArjAEWY8DMeWcEHnr9H/g42JkO1pCVA6eXk/fBy0+ +SVWGsmSxm3nDMk0WoATqsvO4UBAj2pxdSmy4QlyPzCq/fri3bXYuNaMkohsGJWzI +y0d65bgOV6hCYpHTvTRvcza+OHNbBjOUgOfYhMift3uAh3ETS5VIlWSO7T4dCWYD +IoxqXkYp7oP7F2oO+srxAoIBAQDKQULRlz7dW+jyaiBOHSZzq5ZmaIt57phkvY6b +071FCvnjYM1R7lxyxOiT+iJVxrMTDZKzE36OkQI2oQcA73/qfBNMsxueW8Fe5QRZ +rUTXxImjpyqPSW0iba+9Ei0Q0tkfIVDlBKt/O/EXTHfeg58XrHwMCIOfCyq18znr +avhb5c/+hA8nGx1qYt9HJifnRnkC7tvMh1YNoZAKhXV/DCLEkSnR+KJkoMEqRKzH +pSUGB5+qn9axBk8dTQhkkYt5RuFyzZuS5nO3U6x+Wn0xnSsP5xbTC4iklWvFWNH6 +XMbebTCly72bnJcEbIIiZQA+tGBts5xBMA9DxYD/+XjTl13JAoIBAQDA7oENPg7m +7HDRyK3XYeYEOyMz+9JcugnhTAjf4sxI/rvqfs7aMN8hWY+rkkpdhFCX3g9SWsaY +DFqIf7AC6cq3p9EajEAHqQNUq1YqJAKZJCg5054UbZzBrT3R2BELCW7nCKIKu08C +jDShIsMdHVNB6CPOlurjQhBGtfi4IMaxSV4hdnZ/Mb7gk+GbAR3AVpLqBBePRGG7 +0H6Ke8+0qdYrFnTx4XCXDJMTQzfobn9lxsS1lhrwE8yLhrlGFXDkV0POgObvio8N +36zRX8m0RHZ1WJxuW/CfnMEcqswx41ieYckTOFmJ+VUOyqjYSb+d2lMWcgKDCyAW +nm67a3qTWdnbAoIBAHEFEt+oErsDtyJvZ2n/JBOTGNJVLUuPppz0yBIPuj4wqf8D +gvh7qDGCEy1No44nIL5O4WEsTZZBNeltBkrhiqtvdiFwHMjbIS1z8IBkMIoaC4fl +zASR1Whdvsx6sbArAqVAqsGvYF4TEuAgHQO8rVQ/UHow78waI13VctI4zlwcCaSC +Cy2hG0jtwzMxAS9d1BVtgGnEXrPzSlh2x3edQnhxXds1gxmUMxz5j0to302FSRXB +h+kYS3FmMIByTGwSzbynZH4sRRF2sndQ/ZCR8RRL4BdC5LKDxNtcjMnIumBkx8B+ +H5ArasBQGlA5/G8NwKzMp05OGtmWLkXcFEa42PECggEAL/keTdSoj/Mq+n8T+wJ0 +14h88GglnrkDy+nEKyeR9HSi9WQiu057rSc/+kGeDDLid2DYHnpD93ra6CYX9iF8 +Lr6j2B4Xrc/w7BTOkBv0KXA8MGTWYe3/lIknXg6D7mKiGQCkilaZBuEmFQs3yP2J +vlGi1bPhJDFBKtQEzIQZ4+uCZH+4Z1hPRjh/WLOmWjUswtPRp+YxByqIzJaMxzeT +8ZLb8WlFPcn6qEeGl10igIQ0VZLFj/zcV7VgTHT4ZU7tpWOYCOhDOgfsSQOwfAqq +CfPGsgpagtXPjvlJXP5TAs792LGiUhSVeeAaq+1qoC2xi1s+FKenivhKQIAxMoKd +EQKCAQAf5JLEpUtQUYDvV7oF/Q9HUdaF214Tdnz44FfW91R5TRsmwwGnTkyOUtHo +d/XWb2veV8LtLNh5A/v0SHGIbMSQGrQ/5dLNmuDDrvyTzeuV4DTxi/tlv+vHko73 +8r9olAAqs7uz43hOBLDj814yUYGqwCmczOzacE8FvJAGZt6Lz7k3lt3fv/t8OVkr +cXvI6yHmYyXXBOR/NMDzSd8Az+3YQ1QuWh3dxZHbglbAPuVVgbxiSdcvrivn/v0D +er8piuPKboEtLfPNk/2XLDRJK3VRUCMWyTwMB0aXZYYgOs5gpJsYS+UmAHnOrYra +hNKjP4pz5JpmD4tLqZQD3rLH8vOg +-----END PRIVATE KEY----- diff --git a/node_modules/pem/test/fixtures/ru_openssl_config.conf b/node_modules/pem/test/fixtures/ru_openssl_config.conf new file mode 100644 index 000000000..3fcc6442f --- /dev/null +++ b/node_modules/pem/test/fixtures/ru_openssl_config.conf @@ -0,0 +1,40 @@ +# openssl req -new -utf8 -nameopt multiline,utf8 -config Dokumente/git/dexus-pem/test/fixtures/ru_openssl_config.conf -newkey rsa:2048 -nodes -keyout Dokumente/git/dexus-pem/test/fixtures/ru_openssl.key -out Dokumente/git/dexus-pem/test/fixtures/ru_openssl.csr +# openssl req -x509 -newkey rsa:4096 -sha256 -utf8 -days 365 -nodes \ + -config Dokumente/git/dexus-pem/test/fixtures/ru_openssl_config.conf \ + -keyout Dokumente/git/dexus-pem/test/fixtures/ru_openssl.key \ + -out Dokumente/git/dexus-pem/test/fixtures/ru_openssl.crt + +HOME = . +RANDFILE = $ENV::HOME/.rnd + +[CA_default] +copy_extensions = copy +string_mask = utf8only +utf8 = yes + +[req] +default_bits = 4096 +prompt = no +string_mask = utf8only +utf8 = yes +default_md = sha256 +distinguished_name = dn +x509_extensions = v3_ca + +[dn] +CN = Описание сайта # Site description +emailAddress = envek@envek.name +O = Моя компания # My company +OU = Моё подразделение # My dept +L = Москва # Moscow +C = RU + +[v3_ca] +basicConstraints = CA:FALSE +keyUsage = digitalSignature, keyEncipherment +subjectAltName = @alternate_names + +[alternate_names] +DNS.1 = example.com +DNS.2 = *.app.example.com +DNS.3 = www.example.com diff --git a/node_modules/pem/test/fixtures/test.cnf b/node_modules/pem/test/fixtures/test.cnf new file mode 100644 index 000000000..d1b14e8db --- /dev/null +++ b/node_modules/pem/test/fixtures/test.cnf @@ -0,0 +1,26 @@ +[ req ] +default_bits = 4096 +days = 9999 +distinguished_name = req_distinguished_name +attributes = req_attributes +prompt = no +x509_extensions = v3_ca + +[ req_distinguished_name ] +C = EE +ST = Harjumaa +L = Tallinn +O = Node.ee +OU = test +CN = www.node.ee +emailAddress = andris@node.ee + +[ req_attributes ] +challengePassword = challengePass + +[ v3_ca ] +authorityInfoAccess = @issuer_info + +[ issuer_info ] +OCSP;URI.0 = http://ocsp.node.ee/ +caIssuers;URI.0 = http://node.ee/ca.cert diff --git a/node_modules/pem/test/fixtures/test.crt b/node_modules/pem/test/fixtures/test.crt new file mode 100644 index 000000000..3c146c568 --- /dev/null +++ b/node_modules/pem/test/fixtures/test.crt @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE----- +MIIChTCCAe4CCQDbGP0P9s69azANBgkqhkiG9w0BAQsFADCBhjELMAkGA1UEBhMC +WlcxGzAZBgNVBAgMEk1hdGViZWxlbGFuZCBOb3J0aDERMA8GA1UEBwwIQnVsYXdh +eW8xDDAKBgNVBAoMA0J5bzELMAkGA1UECwwCSVQxDzANBgNVBAMMBmJ5by56dzEb +MBkGCSqGSIb3DQEJARYMYWRtaW5AYnlvLnp3MB4XDTE1MDQxMDA5NTM1OVoXDTE2 +MDQwOTA5NTM1OVowgYYxCzAJBgNVBAYTAlpXMRswGQYDVQQIDBJNYXRlYmVsZWxh +bmQgTm9ydGgxETAPBgNVBAcMCEJ1bGF3YXlvMQwwCgYDVQQKDANCeW8xCzAJBgNV +BAsMAklUMQ8wDQYDVQQDDAZieW8uencxGzAZBgkqhkiG9w0BCQEWDGFkbWluQGJ5 +by56dzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0q4cDxLRslRKvG2pw5Gx +7fsq7YyiTokoBaDavNold5Vvayi02Mc7dqIanr/ckc0AqgiDd5Kw2bBAYmQpWiDn +pZxp79JIV+gGh7pkiB4wDzvRBXMcew72B9uuYEeUQ8eonE/Yro0ZnD0ZGmBiuk/6 +5xyWNikBhfPLnb2V+Cr/EKsCAwEAATANBgkqhkiG9w0BAQsFAAOBgQAwigr+o+Y+ +5BiL6MuHLTaC+lcv9r2GTHb7wNea674Db3Bi3u6FgmyMsZ8npPSlR0t/YZcFWtRM +y4uXmw5zUutGZTbO/JFxts6kPV+a76mnNm71fF4QINkemmojvJyPZq9N+hV16dba +v1m+dTK7hDZvpd/sM5bMtqWEq4aHkGhujw== +-----END CERTIFICATE----- \ No newline at end of file diff --git a/node_modules/pem/test/fixtures/test.csr b/node_modules/pem/test/fixtures/test.csr new file mode 100644 index 000000000..7851a725e --- /dev/null +++ b/node_modules/pem/test/fixtures/test.csr @@ -0,0 +1,13 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIB3jCCAUcCAQAwgYYxCzAJBgNVBAYTAlpXMRswGQYDVQQIDBJNYXRlYmVsZWxh +bmQgTm9ydGgxETAPBgNVBAcMCEJ1bGF3YXlvMQwwCgYDVQQKDANCeW8xCzAJBgNV +BAsMAklUMQ8wDQYDVQQDDAZieW8uencxGzAZBgkqhkiG9w0BCQEWDGFkbWluQGJ5 +by56dzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0q4cDxLRslRKvG2pw5Gx +7fsq7YyiTokoBaDavNold5Vvayi02Mc7dqIanr/ckc0AqgiDd5Kw2bBAYmQpWiDn +pZxp79JIV+gGh7pkiB4wDzvRBXMcew72B9uuYEeUQ8eonE/Yro0ZnD0ZGmBiuk/6 +5xyWNikBhfPLnb2V+Cr/EKsCAwEAAaAXMBUGCSqGSIb3DQEJAjEIDAZCeW8gQ28w +DQYJKoZIhvcNAQELBQADgYEAxP+4Z2POlTlCBYpGhhKpTBbRDeAQakXqGBlB7ZC2 +0K4fSxuAGVArLV5rbPDHlzNCtmF8mvt55F7zVny4YQ8BHE7ujV3SWtiAr0Otq9VV +WG5LmBLAbyrrUZloHJEpX0wPgQDmMdLhkDkbcjcKOT6WKNW5q36MW+Q9nViStGD5 +lJg= +-----END CERTIFICATE REQUEST----- \ No newline at end of file diff --git a/node_modules/pem/test/fixtures/test.dh b/node_modules/pem/test/fixtures/test.dh new file mode 100644 index 000000000..b8b18b14c --- /dev/null +++ b/node_modules/pem/test/fixtures/test.dh @@ -0,0 +1,5 @@ +-----BEGIN DH PARAMETERS----- +MIGHAoGBAMYXwgiuPY6TqxODWXbRRWx6eWoJuGkjKN8RjhBiLxFJzwgpdfONv5iG +IHHGI8/IfhHI78Mqq+5z3z8L16fuOYnpbaDa2BSUdHZQQmFiCV748lOv9he08UJ5 +qgrFgdgi56V4FdRs2EHJnezvYmviAbIsi8imn+9TVed4DnOmuE1rAgEC +-----END DH PARAMETERS----- diff --git a/node_modules/pem/test/fixtures/test.key b/node_modules/pem/test/fixtures/test.key new file mode 100644 index 000000000..ec1c5ece3 --- /dev/null +++ b/node_modules/pem/test/fixtures/test.key @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,8D7649F2550A3AD6 + +iD68IbbRZDJuiYBqiEMLSfQQqcbXr4CeHFVkAYxCKN785tg+icShBeYXP2H2Oa7m +dmFBNrtuPclUjk1VFeDcRhd1WwabuSbKJkV26bqIwYKSa1blDcgviSvIc8OgN06G +K7kX+3jQzUMeSj+B1phyysCSoSU059oJvcNknBOEe67ersYZhXWFDOxVOeCnpsVA +xDPRGVWa5g5jj0WqcXey/oC/hUccX8w8RZJLSBurIxfWBGy1QtsnopNRaxs5gqXj +FCucQtYTMwRzA0c65/6yDrYrnv3v0mmCKBKXoTvhcmxkE/Ejrk0+ydxlgWXoMjOD +CzuDy8xQ2KN2/62fb0Eb6LwnI3EHceXAO9GbgpCTXDZt0yoKMBDZFYA1+TuYBXJj +RRcKDcF+gt1VdloSkAWIaDwypnPi0xngsJbzNIHKoSKYPuxWdUXB5rThbSdPki5x +r8La88LBK6/WarJevce8Ggg/KCAx5ng/w9XzQDlMSNVT6Ht+gGe6+69XjBA5IyIo +bymu9PlwRMMYEeEcH53tGXcCgSkzlDs2Cc+1+JUypZpX4oggNV5YhsmLZS5BtPFs +9i3lA7RsxXoV0u1BTgHIqrH58IKaXN9xs0ceie3cLR5tcSiSsU9sh3wpjZ2AZ/Q5 +zjoHuyzQVxY14qlE3uWzI9vJtc/kCkQ4D8wdBRVM8uRzf+YGYKRbI6vvsSICeLuW +n82E2zin77HnIOGVHPJ5aNaTQD91Ubxxv7lVeuxZf2tgejs2DbJraKOtOmHLd9GA +Zb5G9TdFMxVcXq18xUMm/Rbkj8ugALxRy8CGNSrTFTPHaEwYxqhnAQ== +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/node_modules/pem/test/fixtures/test.p7b b/node_modules/pem/test/fixtures/test.p7b new file mode 100644 index 000000000..430c129f5 --- /dev/null +++ b/node_modules/pem/test/fixtures/test.p7b @@ -0,0 +1,17 @@ +-----BEGIN PKCS7----- +MIICtgYJKoZIhvcNAQcCoIICpzCCAqMCAQExADALBgkqhkiG9w0BBwGgggKJMIIC +hTCCAe4CCQDbGP0P9s69azANBgkqhkiG9w0BAQsFADCBhjELMAkGA1UEBhMCWlcx +GzAZBgNVBAgMEk1hdGViZWxlbGFuZCBOb3J0aDERMA8GA1UEBwwIQnVsYXdheW8x +DDAKBgNVBAoMA0J5bzELMAkGA1UECwwCSVQxDzANBgNVBAMMBmJ5by56dzEbMBkG +CSqGSIb3DQEJARYMYWRtaW5AYnlvLnp3MB4XDTE1MDQxMDA5NTM1OVoXDTE2MDQw +OTA5NTM1OVowgYYxCzAJBgNVBAYTAlpXMRswGQYDVQQIDBJNYXRlYmVsZWxhbmQg +Tm9ydGgxETAPBgNVBAcMCEJ1bGF3YXlvMQwwCgYDVQQKDANCeW8xCzAJBgNVBAsM +AklUMQ8wDQYDVQQDDAZieW8uencxGzAZBgkqhkiG9w0BCQEWDGFkbWluQGJ5by56 +dzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0q4cDxLRslRKvG2pw5Gx7fsq +7YyiTokoBaDavNold5Vvayi02Mc7dqIanr/ckc0AqgiDd5Kw2bBAYmQpWiDnpZxp +79JIV+gGh7pkiB4wDzvRBXMcew72B9uuYEeUQ8eonE/Yro0ZnD0ZGmBiuk/65xyW +NikBhfPLnb2V+Cr/EKsCAwEAATANBgkqhkiG9w0BAQsFAAOBgQAwigr+o+Y+5BiL +6MuHLTaC+lcv9r2GTHb7wNea674Db3Bi3u6FgmyMsZ8npPSlR0t/YZcFWtRMy4uX +mw5zUutGZTbO/JFxts6kPV+a76mnNm71fF4QINkemmojvJyPZq9N+hV16dbav1m+ +dTK7hDZvpd/sM5bMtqWEq4aHkGhuj6EAMQA= +-----END PKCS7----- diff --git a/node_modules/pem/test/fixtures/testnopw.key b/node_modules/pem/test/fixtures/testnopw.key new file mode 100644 index 000000000..d507c834e --- /dev/null +++ b/node_modules/pem/test/fixtures/testnopw.key @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQDSrhwPEtGyVEq8banDkbHt+yrtjKJOiSgFoNq82iV3lW9rKLTY +xzt2ohqev9yRzQCqCIN3krDZsEBiZClaIOelnGnv0khX6AaHumSIHjAPO9EFcxx7 +DvYH265gR5RDx6icT9iujRmcPRkaYGK6T/rnHJY2KQGF88udvZX4Kv8QqwIDAQAB +AoGALuEtPzFp1eupwaoJR4pI9HKaR8euahlc/XugkLtd8PEgnNCvBTm4Aprpn3+D +3jGmvy8rydSrY5UzjnFJPlPqF2kWkQaBFtqBJpQFjCPDbQ3nwVoaEN7X/lz3v91M +BdoMT36CPvzDwtdrA3U16Jd1JOV09DxP/7jAuvrP3zvuoOkCQQD/eXu/UL++xUb8 +BH4hkookSWrRJHIsRw5gktMoo2tGhe0AXVDh+3Eg8KNfvy2T/PqI7z/pn3QTcjn6 +hJlG7ujVAkEA0x0KUstDNB8FEn64xfmmbCWJ/kyYm3dtiR1ByvqNBJ4Dt3IAIwnP +1ww9NWJfZta34nUzI97rDLyvBubaN0rTfwJBAM1kDOIt+EpWbpBUyFcTai5sPA1y +4LvKULvBrzQ/1hI3v+gIHevg6/3QmXhzyh/tRjrrJpYb1QWBUy2eh2Bo2RUCQQCl +hPROG62yFMwORyqpleXkjr4VkopoAgfwY+7srOqZfyZc0tXGou/ApIjs7Rbtc1Wz +CL6y1hkl4F2+JItcpJ8TAkBUGA1T46IMHtQ4D7HaemPup+ve7gwYx2c1EDlLYAc/ +M9y+va/N+2k6DAMHUNIRktmgYsA5inGT/QCftLql4v+5 +-----END RSA PRIVATE KEY----- diff --git a/node_modules/pem/test/helper.spec.js b/node_modules/pem/test/helper.spec.js new file mode 100644 index 000000000..b13cf3a83 --- /dev/null +++ b/node_modules/pem/test/helper.spec.js @@ -0,0 +1,77 @@ +'use strict' + +var fs = require('fs') +var helper = require('../lib/helper.js') +var hlp = require('./pem.helper.js') +var chai = require('chai') +var dirtyChai = require('dirty-chai') +chai.use(dirtyChai) + +// NOTE: we cover here only the test cases left in coverage report +describe('helper.js tests', function () { + describe('#.createPasswordFile()', function () { + it('invalid options [not sufficient object keys]', function (done) { + var tmpfiles = [] + var bufferOrPath = fs.readFileSync('./test/fixtures/idsrv3test.pfx') + helper.createPasswordFile( + {}, + ['pkcs12', '-info', '-in', bufferOrPath, '-noout', '-maciter', '-nodes'], + tmpfiles[tmpfiles.length] + ) + helper.deleteTempFiles(tmpfiles, function (fsErr) { + hlp.checkError(fsErr) + done() + }) + }) + it('invalid options [no password and passType option]', function (done) { + var tmpfiles = [] + var bufferOrPath = fs.readFileSync('./test/fixtures/idsrv3test.pfx') + helper.createPasswordFile( + { cipher: '', bla: true, blub: true }, + ['pkcs12', '-info', '-in', bufferOrPath, '-noout', '-maciter', '-nodes'], + tmpfiles[tmpfiles.length] + ) + helper.deleteTempFiles(tmpfiles, function (fsErr) { + hlp.checkError(fsErr) + done() + }) + }) + it('mustPass option', function (done) { + var tmpfiles = [] + var bufferOrPath = fs.readFileSync('./test/fixtures/idsrv3test.pfx') + helper.createPasswordFile( + { cipher: '', password: 'gregegegeg', passType: 'in', mustPass: 'password' }, + ['pkcs12', '-info', '-in', bufferOrPath, '-noout', '-maciter', '-nodes'], + tmpfiles[tmpfiles.length] + ) + helper.deleteTempFiles(tmpfiles, function (fsErr) { + hlp.checkError(fsErr) + done() + }) + }) + }) + + describe('#.deleteTempFiles()', function () { + it('files argument typeof string', function (done) { + helper.deleteTempFiles('404.pem', function (fsErr) { + hlp.checkError(fsErr) + done() + }) + }) + it('files argument invalid type', function (done) { + helper.deleteTempFiles(true, function (fsErr) { + hlp.checkError(fsErr, true) + done() + }) + }) + it('files argument array contains non-string value', function (done) { + helper.deleteTempFiles([true], function (fsErr) { + hlp.checkError(fsErr) + done() + }) + }) + it.skip('other error than ENOENT occured', function (done) { + // TODO + }) + }) +}) diff --git a/node_modules/pem/test/openssl.spec.js b/node_modules/pem/test/openssl.spec.js new file mode 100644 index 000000000..d33e8049d --- /dev/null +++ b/node_modules/pem/test/openssl.spec.js @@ -0,0 +1,47 @@ +'use strict' + +var openssl = require('../lib/openssl.js') +var hlp = require('./pem.helper.js') +var chai = require('chai') +var dirtyChai = require('dirty-chai') +var expect = chai.expect +chai.use(dirtyChai) + +// NOTE: we cover here only the test cases left in coverage report +describe('openssl.js tests', function () { + describe('#.exec()', function () { + it('search string not found', function (done) { + openssl.exec([ + 'dhparam', + '-outform', + 'PEM', + 128 + ], 'DH PARAMETERS 404', function (error) { + hlp.checkError(error, true) + done() + }) + }) + }) + + describe('#.execBinary()', function () { + it('no tmpfiles parameter', function (done) { + openssl.execBinary([ + 'dhparam', + '-outform', + 'PEM', + 128 + ], function (error, result) { + hlp.checkError(error) + expect(result).to.be.ok() + done() + }) + }) + }) + + describe('#.spawn()', function () { + it.skip('error case [openssl return code 2]', function (done) { + // TODO; couldn't figure an example out + }) + // TODO; I expect some more cases in here or code cleanup required + }) +}) diff --git a/node_modules/pem/test/pem.helper.js b/node_modules/pem/test/pem.helper.js new file mode 100644 index 000000000..8a295ad29 --- /dev/null +++ b/node_modules/pem/test/pem.helper.js @@ -0,0 +1,132 @@ +'use strict' + +var fs = require('fs') +var chai = require('chai') +var dirtyChai = require('dirty-chai') +var expect = chai.expect +chai.use(dirtyChai) + +process.env.PEMJS_TMPDIR = './tmp' + +if (process.env.TRAVIS === 'true' && process.env.OPENSSL_DIR !== '') { + process.env.OPENSSL_BIN = '/openssl/bin/openssl' +} + +function checkTmpEmpty () { + expect(fs.readdirSync(process.env.PEMJS_TMPDIR)).to.be.empty() +} + +function checkError (error, expectError) { + if (expectError) { + expect(error).to.be.ok() + if (expectError !== true) { // object + Object.keys(expectError).forEach(function (k) { + expect(error[k]).to.equal(expectError[k]) // code, message, ... + }) + } + } else { expect(error).to.not.be.ok() } +} + +function checkEcparam (data, min, max) { + expect(data).to.be.an('object').that.has.property('ecparam') + expect(data.ecparam).to.be.a('string') + expect(/^\r?\n*-----BEGIN EC PARAMETERS-----\r?\n/.test(data.ecparam)).to.be.true() + expect(/\r?\n-----END EC PARAMETERS-----\r?\n/.test(data.ecparam)).to.be.true() + expect(/\r?\n-----BEGIN EC PRIVATE KEY-----\r?\n/.test(data.ecparam)).to.be.true() + expect(/\r?\n-----END EC PRIVATE KEY-----\r?\n*$/.test(data.ecparam)).to.be.true() + var matchup = /-----BEGIN EC PRIVATE KEY-----[\s\S]+-----END EC PRIVATE KEY-----/.exec(data.ecparam) + expect(matchup[0].trim().length).to.be.within(min + 1, max - 1) +} + +function checkEcparamNoOut (data, min, max) { + expect(data).to.be.an('object').that.has.property('ecparam') + expect(data.ecparam).to.be.a('string') + expect(/^\r?\n*-----BEGIN EC PRIVATE KEY-----\r?\n/.test(data.ecparam)).to.be.true() + expect(/\r?\n-----END EC PRIVATE KEY-----\r?\n*$/.test(data.ecparam)).to.be.true() + var matchup = /-----BEGIN EC PRIVATE KEY-----[\s\S]+-----END EC PRIVATE KEY-----/.exec(data.ecparam) + expect(matchup[0].trim().length).to.be.within(min + 1, max - 1) +} + +function checkDhparam (data, min, max) { + expect(data).to.be.an('object').that.has.property('dhparam') + expect(data.dhparam).to.be.a('string') + expect(/^\r?\n*-----BEGIN DH PARAMETERS-----\r?\n/.test(data.dhparam)).to.be.true() + expect(/\r?\n-----END DH PARAMETERS-----\r?\n*$/.test(data.dhparam)).to.be.true() + expect(data.dhparam.trim().length).to.be.within(min + 1, max - 1) +} + +function checkPrivateKey (data, min, max, encrypted) { + expect(data).to.be.an('object').that.has.property('key') + expect(data.key).to.be.a('string') + if (encrypted) { expect(/ENCRYPTED\r?\n/.test(data.key)).to.be.true() } + expect(/^\r?\n*-----BEGIN RSA PRIVATE KEY-----\r?\n/.test(data.key)).to.be.true() + expect(/\r?\n-----END RSA PRIVATE KEY-----\r?\n*$/.test(data.key)).to.be.true() + expect(data.key.trim().length).to.be.within(min + 1, max - 1) +} + +function checkCSR (data, expectClientKey) { + expect(data).to.be.an('object'); + ['clientKey', 'csr'].forEach(function (k) { + expect(data).to.have.property(k) + expect(data[k]).to.be.a('string') + }) + if (expectClientKey) { expect(data.clientKey).to.equal(expectClientKey) } + expect(/^\r?\n*-----BEGIN CERTIFICATE REQUEST-----\r?\n/.test(data.csr)).to.be.true() + expect(/\r?\n-----END CERTIFICATE REQUEST-----\r?\n*$/.test(data.csr)).to.be.true() +} + +function checkCertificate (data, selfsigned) { + expect(data).to.be.an('object'); + ['certificate', 'clientKey', 'serviceKey', 'csr'].forEach(function (k) { + expect(data).to.have.property(k) + expect(data[k]).to.be.a('string') + }) + expect(/^\r?\n*-----BEGIN CERTIFICATE-----\r?\n/.test(data.certificate)).to.be.true() + expect(/\r?\n-----END CERTIFICATE-----\r?\n*$/.test(data.certificate)).to.be.true() + if (selfsigned) { expect(data.clientKey).to.equal(data.serviceKey) } else { expect(data.clientKey).to.not.equal(data.serviceKey) } +} + +function checkCertificateData (data, info) { + expect(data).to.deep.equal(info) +} + +function checkPublicKey (data) { + expect(data).to.be.an('object').that.has.property('publicKey') + expect(data.publicKey).to.be.a('string') + expect(/^\r?\n*-----BEGIN PUBLIC KEY-----\r?\n/.test(data.publicKey)).to.be.true() + expect(/\r?\n-----END PUBLIC KEY-----\r?\n*$/.test(data.publicKey)).to.be.true() +} + +function checkFingerprint (data) { + expect(data).to.be.an('object').that.has.property('fingerprint') + expect(data.fingerprint).to.be.a('string') + expect(/^[0-9A-F]{2}(:[0-9A-F]{2}){19}$/.test(data.fingerprint)).to.be.true() +} + +function checkModulus (data, encryptAlgorithm) { + expect(data).to.be.an('object').that.has.property('modulus') + expect(data.modulus).to.be.a('string') + switch (encryptAlgorithm) { + case 'md5': + expect(/^[a-f0-9]{32}$/i.test(data.modulus)).to.be.true() + break + default: + expect(/^[0-9A-F]*$/.test(data.modulus)).to.be.true() + break + } +} + +module.exports = { + checkTmpEmpty: checkTmpEmpty, + checkError: checkError, + checkDhparam: checkDhparam, + checkEcparam: checkEcparam, + checkEcparamNoOut: checkEcparamNoOut, + checkPrivateKey: checkPrivateKey, + checkCSR: checkCSR, + checkCertificate: checkCertificate, + checkCertificateData: checkCertificateData, + checkPublicKey: checkPublicKey, + checkFingerprint: checkFingerprint, + checkModulus: checkModulus +} diff --git a/node_modules/pem/test/pem.spec.js b/node_modules/pem/test/pem.spec.js new file mode 100644 index 000000000..0ddbb1ecf --- /dev/null +++ b/node_modules/pem/test/pem.spec.js @@ -0,0 +1,963 @@ +'use strict' + +var pem = require('..') +var fs = require('fs') +var hlp = require('./pem.helper.js') +var chai = require('chai') +var dirtyChai = require('dirty-chai') +var expect = chai.expect +chai.use(dirtyChai) + +describe('General Tests', function () { + this.timeout(300000)// 5 minutes + this.slow(2000)// 2 seconds + + describe('Requirements', function () { + it('Create tmp folder', function () { + expect(function () { + if (!fs.existsSync(process.env.PEMJS_TMPDIR)) { + fs.mkdirSync(process.env.PEMJS_TMPDIR) + } + }).to.not.throw() + }) + + it('Return an error if openssl was not found', function (done) { + pem.config({ + pathOpenSSL: 'zzzzzzzzzzz' + }) + pem.createPrivateKey(function (error) { + hlp.checkError(error, true) + pem.config({ + pathOpenSSL: process.env.OPENSSL_BIN || 'openssl' + }) + pem.createPrivateKey(function (error) { + hlp.checkError(error) + done() + }) + }) + }) + }) + + describe('#.createDhparam tests', function () { + it('Create default sized dhparam key', function (done) { + pem.createDhparam(function (error, data) { + hlp.checkError(error) + hlp.checkDhparam(data, 150, 160) + hlp.checkTmpEmpty() + done() + }) + }) + it('Create 1024bit dhparam key', function (done) { + this.timeout(600000)// 10 minutes + pem.createDhparam(1024, function (error, data) { + hlp.checkError(error) + hlp.checkDhparam(data, 240, 250) + hlp.checkTmpEmpty() + done() + }) + }) + }) + + describe('#.createEcparam tests', function () { + it('Create default ecparam key', function (done) { + pem.createEcparam(function (error, data) { + hlp.checkError(error) + hlp.checkEcparam(data, 430, 470) + hlp.checkTmpEmpty() + done() + }) + }) + it('Create secp521k1 ecparam key', function (done) { + pem.createEcparam('secp521r1', function (error, data) { + hlp.checkError(error) + hlp.checkEcparam(data, 960, 1000) + hlp.checkTmpEmpty() + done() + }) + }) + it('Create prime256v1 ecparam key', function (done) { + pem.createEcparam('prime256v1', function (error, data) { + hlp.checkError(error) + hlp.checkEcparam(data, 430, 570) + hlp.checkTmpEmpty() + done() + }) + }) + it('Create prime256v1 ecparam key with named_curve param encoding', function (done) { + pem.createEcparam('prime256v1', 'named_curve', function (error, data) { + hlp.checkError(error) + hlp.checkEcparam(data, 200, 430) + hlp.checkTmpEmpty() + done() + }) + }) + it('Create prime256v1 ecparam key with noOut set to true', function (done) { + pem.createEcparam('prime256v1', 'named_curve', true, function (error, data) { + hlp.checkError(error) + hlp.checkEcparamNoOut(data, 200, 430) + hlp.checkTmpEmpty() + done() + }) + }) + it('Create prime256v1 ecparam key with noOut set to false', function (done) { + pem.createEcparam('prime256v1', 'named_curve', false, function (error, data) { + hlp.checkError(error) + hlp.checkEcparam(data, 200, 430) + hlp.checkTmpEmpty() + done() + }) + }) + }) + + describe('#.createPrivateKey tests', function () { + describe('default sized private key', function () { + var pkey + it('create private key', function (done) { + pem.createPrivateKey(function (error, data) { + hlp.checkError(error) + hlp.checkPrivateKey(data, 850, 1900) + hlp.checkTmpEmpty() + pkey = data + done() + }) + }) + + it('get its public key', function (done) { + pem.getPublicKey(pkey.key, function (error, data) { + hlp.checkError(error) + hlp.checkPublicKey(data) + hlp.checkTmpEmpty() + done() + }) + }) + + it('create csr and check key', function (done) { + pem.createCSR({ + clientKey: pkey.key + }, function (error, data) { + hlp.checkError(error) + hlp.checkCSR(data, pkey.key) + hlp.checkTmpEmpty() + done() + }) + }) + + it('create pkcs12 w/o password', function (done) { + pem.createCertificate({ + clientKey: pkey.key, + selfSigned: true + }, function (error, data) { + hlp.checkError(error) + + pem.createPkcs12(data.clientKey, data.certificate, 'mypassword', function (error, pkcs12) { + hlp.checkError(error) + expect(pkcs12).to.be.ok() + hlp.checkTmpEmpty() + done() + }) + }) + }) + }) + + describe('2048bit Private key', function () { + var pwkey + it('create private key', function (done) { + pem.createPrivateKey(2048, function (error, data) { + hlp.checkError(error) + hlp.checkPrivateKey(data, 1650, 1710) + hlp.checkTmpEmpty() + done() + }) + }) + + it('create private key with password', function (done) { + pem.createPrivateKey(2048, { + cipher: 'aes128', + password: 'min4chars' + }, function (error, data) { + hlp.checkError(error) + hlp.checkPrivateKey(data, 1700, 1800, true) + hlp.checkTmpEmpty() + pwkey = data + done() + }) + }) + + it('create csr using private key with password', function (done) { + pem.createCSR({ + clientKey: pwkey.key, + clientKeyPassword: 'min4chars' + }, function (error, data) { + hlp.checkError(error) + hlp.checkCSR(data, pwkey.key) + hlp.checkTmpEmpty() + done() + }) + }) + + it('create cert using pkey w/ password; create pkcs12', function (done) { + pem.createCertificate({ + clientKey: pwkey.key, + clientKeyPassword: 'min4chars', + selfSigned: true + }, function (error, data) { + hlp.checkError(error) + hlp.checkCertificate(data, true) + hlp.checkTmpEmpty() + + pem.createPkcs12(data.clientKey, data.certificate, 'mypassword', { + cipher: 'aes256', + clientKeyPassword: 'min4chars' + }, function (error, pkcs12) { + hlp.checkError(error) + expect(pkcs12).to.be.ok() + hlp.checkTmpEmpty() + done() + }) + }) + }) + }) + }) + + describe('#.createCSR tests', function () { + it('Create default CSR; get its public key; read its data', function (done) { + pem.createCSR(function (error, data1) { + hlp.checkError(error) + hlp.checkCSR(data1) + hlp.checkTmpEmpty() + + pem.getPublicKey(data1.clientKey, function (error, data2) { + hlp.checkError(error) + hlp.checkPublicKey(data2) + hlp.checkTmpEmpty() + + pem.readCertificateInfo(data1.csr, function (error, data3) { + hlp.checkError(error) + hlp.checkCertificateData(data3, { + issuer: {}, + country: '', + state: '', + locality: '', + organization: '', + organizationUnit: '', + commonName: 'localhost', + emailAddress: '', + dc: '', + signatureAlgorithm: 'sha256WithRSAEncryption', + publicKeyAlgorithm: 'rsaEncryption', + publicKeySize: '2048 bit' + }) + hlp.checkTmpEmpty() + done() + }) + }) + }) + }) + + it('Create CSR using config file', function (done) { + pem.createCSR({ + csrConfigFile: './test/fixtures/test.cnf' + }, function (error, data) { + hlp.checkError(error) + hlp.checkCSR(data) + hlp.checkTmpEmpty() + + pem.readCertificateInfo(data.csr, function (error, data) { + hlp.checkError(error) + hlp.checkCertificateData(data, { + issuer: {}, + country: 'EE', + state: 'Harjumaa', + locality: 'Tallinn', + organization: 'Node.ee', + organizationUnit: 'test', + commonName: 'www.node.ee', + emailAddress: 'andris@node.ee', + dc: '', + signatureAlgorithm: 'sha256WithRSAEncryption', + publicKeyAlgorithm: 'rsaEncryption', + publicKeySize: '2048 bit' + }) + hlp.checkTmpEmpty() + done() + }) + }) + }) + + it('Create CSR with multiple organizations using config file', function (done) { + pem.createCSR({ + issuer: {}, + country: 'EE', + state: 'Harjumaa', + locality: 'Tallinn', + organization: ['Node2.ee', 'Node.ee'], + organizationUnit: 'test', + commonName: 'www.node.ee', + emailAddress: 'andris@node.ee', + dc: '', + signatureAlgorithm: 'sha256WithRSAEncryption', + publicKeyAlgorithm: 'rsaEncryption', + publicKeySize: '2048 bit' + }, function (error, data) { + hlp.checkError(error) + hlp.checkCSR(data) + hlp.checkTmpEmpty() + + pem.readCertificateInfo(data.csr, function (error, data) { + hlp.checkError(error) + hlp.checkCertificateData(data, { + issuer: {}, + country: 'EE', + state: 'Harjumaa', + locality: 'Tallinn', + organization: ['Node.ee', 'Node2.ee'], + organizationUnit: 'test', + commonName: 'www.node.ee', + emailAddress: 'andris@node.ee', + dc: '', + signatureAlgorithm: 'sha256WithRSAEncryption', + publicKeyAlgorithm: 'rsaEncryption', + publicKeySize: '2048 bit' + }) + hlp.checkTmpEmpty() + done() + }) + }) + }) + + it('Read edited cert data from CSR', function (done) { + var certInfo = { + issuer: {}, + country: 'EE', + state: 'Harjumaa', + locality: 'Tallinn', + organization: 'Node.ee', + organizationUnit: 'test', + commonName: 'www.node.ee', + emailAddress: 'andris@node.ee', + dc: '', + signatureAlgorithm: 'sha256WithRSAEncryption', + publicKeyAlgorithm: 'rsaEncryption', + publicKeySize: '2048 bit' + } + pem.createCSR(Object.create(certInfo), function (error, data) { + hlp.checkError(error) + hlp.checkCSR(data) + hlp.checkTmpEmpty() + + pem.readCertificateInfo(data.csr, function (error, data) { + hlp.checkError(error) + hlp.checkCertificateData(data, certInfo) + hlp.checkTmpEmpty() + done() + }) + }) + }) + }) + + describe('#.createCertificate tests', function () { + describe('Default certificate', function () { + var cert + it('Create default certificate', function (done) { + pem.createCertificate(function (error, data) { + hlp.checkError(error) + hlp.checkCertificate(data) + hlp.checkTmpEmpty() + cert = data + done() + }) + }) + + it('get its public key', function (done) { + pem.getPublicKey(cert.clientKey, function (error, data) { + hlp.checkError(error) + hlp.checkPublicKey(data) + hlp.checkTmpEmpty() + done() + }) + }) + + it('get its fingerprint', function (done) { + pem.getFingerprint(cert.certificate, function (error, data) { + hlp.checkError(error) + hlp.checkFingerprint(data) + hlp.checkTmpEmpty() + done() + }) + }) + + it('get its modulus [not hashed]', function (done) { + pem.getModulus(cert.certificate, function (error, + data) { + hlp.checkError(error) + hlp.checkModulus(data) + hlp.checkTmpEmpty() + done() + }) + }) + + it('get its modulus [md5 hashed]', function (done) { + pem.getModulus(cert.certificate, null, 'md5', + function (error, data) { + hlp.checkError(error) + hlp.checkModulus(data, 'md5') + hlp.checkTmpEmpty() + done() + }) + }) + + it('read its data', function (done) { + pem.readCertificateInfo(cert.certificate, function ( + error, data) { + hlp.checkError(error); + ['validity', 'serial', 'signatureAlgorithm', + 'publicKeySize', 'publicKeyAlgorithm' + ].forEach(function (k) { + if (data[k]) { delete data[k] } + }) + hlp.checkCertificateData(data, { + issuer: { + country: '', + state: '', + locality: '', + organization: '', + organizationUnit: '', + commonName: 'localhost', + dc: '' + }, + country: '', + state: '', + locality: '', + organization: '', + organizationUnit: '', + commonName: 'localhost', + emailAddress: '', + dc: '' + }) + hlp.checkTmpEmpty() + done() + }) + }) + }) + + describe('CA certificate', function () { + var ca + it('create ca certificate', function (done) { + pem.createCertificate({ + commonName: 'CA Certificate' + }, + function (error, data) { + hlp.checkError(error) + hlp.checkCertificate(data) + hlp.checkTmpEmpty() + ca = data + done() + }) + }) + it('create certificate with text serial "demo-serial"', function (done) { + pem.createCertificate({ + serviceKey: ca.serviceKey, + serviceCertificate: ca.certificate, + serial: 'demo-serial' + }, + function (error, data) { + hlp.checkError(error) + hlp.checkCertificate(data) + hlp.checkTmpEmpty() + pem.readCertificateInfo(data.certificate, function (error, data) { + hlp.checkError(error); + ['validity', 'serial'].forEach(function (k) { + if (data[k]) { + delete data[k] + } + }) + hlp.checkTmpEmpty() + done() + }) + }) + }) + it('create certificate with hex serial "0x1234567890abcdef"', function (done) { + pem.createCertificate({ + serviceKey: ca.serviceKey, + serviceCertificate: ca.certificate, + serial: '0x1234567890abcdef' + }, + function (error, data) { + hlp.checkError(error) + hlp.checkCertificate(data) + hlp.checkTmpEmpty() + pem.readCertificateInfo(data.certificate, function (error, data) { + hlp.checkError(error); + ['validity', 'serial'].forEach(function (k) { + if (data[k]) { + delete data[k] + } + }) + hlp.checkTmpEmpty() + done() + }) + }) + }) + it('create certificate with hex serial "1234567890abcdef"', function (done) { + pem.createCertificate({ + serviceKey: ca.serviceKey, + serviceCertificate: ca.certificate, + serial: '1234567890abcdef' + }, + function (error, data) { + hlp.checkError(error) + hlp.checkCertificate(data) + hlp.checkTmpEmpty() + pem.readCertificateInfo(data.certificate, function (error, data) { + hlp.checkError(error); + ['validity', 'serial'].forEach(function (k) { + if (data[k]) { + delete data[k] + } + }) + hlp.checkTmpEmpty() + done() + }) + }) + }) + it('create certificate with number serial "1234567890"', function (done) { + pem.createCertificate({ + serviceKey: ca.serviceKey, + serviceCertificate: ca.certificate, + serial: 1234567890 + }, + function (error, data) { + hlp.checkError(error) + hlp.checkCertificate(data) + hlp.checkTmpEmpty() + pem.readCertificateInfo(data.certificate, function (error, data) { + hlp.checkError(error); + ['validity', 'serial'].forEach(function (k) { + if (data[k]) { + delete data[k] + } + }) + hlp.checkTmpEmpty() + done() + }) + }) + }) + it('verify signing chain; create and read PKCS12', function (done) { + pem.createCertificate({ + serviceKey: ca.serviceKey, + serviceCertificate: ca.certificate, + serial: Date.now() + }, function (error, data) { + hlp.checkError(error) + hlp.checkCertificate(data) + hlp.checkTmpEmpty() + + pem.verifySigningChain(data.certificate, + ca.certificate, + function (error, valid) { + hlp.checkError(error) + expect(valid).to.be.true() + + pem.createPkcs12(data.clientKey, + data.certificate, '', { + certFiles: [ca.certificate] + }, + function (error, d) { + hlp.checkError(error) + expect(d).to.be.ok() + hlp.checkTmpEmpty() + + pem.readPkcs12(d.pkcs12, + function (error, keystore) { + hlp.checkError(error) + expect(keystore).to.be.an('object') + expect(keystore).to.have.property('ca') + expect(keystore).to.have.property('cert') + expect(keystore).to.have.property('key') + expect(keystore.ca).to.be.an('array') + expect(keystore.cert).to.be.an('string') + expect(keystore.key).to.be.an('string') + expect(keystore.ca[0]).to.equal(ca.certificate) + expect(keystore.cert).to.equal(data.certificate) + expect(keystore.key).to.equal(data.clientKey) + done() + }) + }) + }) + }) + }) + it('Fail to verify invalid sigining chain', function (done) { + pem.createCertificate({ + serviceKey: ca.serviceKey, + serviceCertificate: ca.certificate, + serial: Date.now() + }, function (error, data) { + hlp.checkError(error) + hlp.checkCertificate(data) + hlp.checkTmpEmpty() + + pem.verifySigningChain(data.certificate, + data.certificate, + function (error, valid) { + hlp.checkError(error) + expect(valid).to.be.false() + done() + }) + }) + }) + it('Verify google.com certificate without provided CA certificates', function (done) { + var certificate = fs.readFileSync('./test/fixtures/google.com.pem').toString() + pem.verifySigningChain(certificate, function (error, valid) { + hlp.checkError(error) + expect(valid).to.be.false() + done() + }) + }) + it('Verify deep sigining chain', function (done) { + pem.createCertificate({ + commonName: 'Intermediate CA Certificate', + serviceKey: ca.serviceKey, + serviceCertificate: ca.certificate, + serial: Date.now() + }, function (error, intermediate) { + hlp.checkError(error) + hlp.checkCertificate(intermediate) + hlp.checkTmpEmpty() + + pem.createCertificate({ + serviceKey: intermediate.clientKey, + serviceCertificate: intermediate.certificate, + serial: Date.now() + // days: 1024 + }, function (error, cert) { + hlp.checkError(error) + hlp.checkCertificate(cert) + hlp.checkTmpEmpty() + + // chain check ok + pem.verifySigningChain([intermediate.certificate, cert.certificate], [ + ca.certificate, intermediate.certificate + ], function (error, valid) { + hlp.checkError(error) + expect(valid).to.be.true() + + // chain check fails -> missing ca cert in chain + pem.verifySigningChain(cert.certificate, [ + intermediate.certificate + ], function (error, valid) { + hlp.checkError(error) + expect(valid).to.be.false() + + // chain check fails -> missing intermediate cert in chain + pem.verifySigningChain( + cert.certificate, [ + ca.certificate + ], + function (error, + valid) { + hlp.checkError(error) + expect(valid).to.be.false() + done() + }) + }) + }) + }) + }) + }) + }) + + it('Create self signed certificate', function (done) { + pem.createCertificate({ + selfSigned: true + }, function (error, data) { + hlp.checkError(error) + hlp.checkCertificate(data, true) + hlp.checkTmpEmpty() + done() + }) + }) + it('Create and verify wildcard certificate', function (done) { + var certInfo = { + commonName: '*.node.ee' + } + pem.createCertificate(Object.create(certInfo), function (error, data) { + hlp.checkError(error) + hlp.checkCertificate(data) + hlp.checkTmpEmpty() + + pem.readCertificateInfo(data.certificate, function (error, data) { + hlp.checkError(error) + expect(data).to.be.an('object').that.has.property('commonName') + expect(data.commonName).to.equal(certInfo.commonName) + hlp.checkTmpEmpty() + done() + }) + }) + }) + it('Read edited cert data from certificate', function (done) { + var certInfo = { + issuer: { + country: 'EE', + state: 'Harjumaa', + locality: 'Tallinn', + organization: 'Node.ee', + organizationUnit: 'test', + commonName: 'www.node.ee', + dc: '' + }, + country: 'EE', + state: 'Harjumaa', + locality: 'Tallinn', + organization: 'Node.ee', + organizationUnit: 'test', + commonName: 'www.node.ee', + emailAddress: 'andris@node.ee', + dc: '', + signatureAlgorithm: 'sha256WithRSAEncryption', + publicKeyAlgorithm: 'rsaEncryption', + publicKeySize: '2048 bit' + } + pem.createCertificate(Object.create(certInfo), function (error, data) { + hlp.checkError(error) + hlp.checkCertificate(data) + hlp.checkTmpEmpty() + + pem.readCertificateInfo(data.certificate, function (error, data) { + hlp.checkError(error); + ['validity', 'serial'].forEach(function (k) { + if (data[k]) { delete data[k] } + }) + hlp.checkCertificateData(data, certInfo) + hlp.checkTmpEmpty() + done() + }) + }) + }) + + it('Read CertInformation form ./test/fixtures/pem196.pem', function (done) { + var certInfo = { + issuer: { + country: 'BO', + state: '', + locality: '', + organization: 'ADSIB', + organizationUnit: '', + commonName: 'Entidad Certificadora Publica ADSIB', + dc: '' + }, + serial: '2854046357827755658 (0x279b9c0a82d21e8a)', + '1.3.6.1.1.1.1.0': '#0C0734373132323836', + dnQualifier: 'CI', + country: 'BO', + state: '', + locality: '', + organization: '', + organizationUnit: '', + commonName: 'ILSE SILES BECERRA', + emailAddress: '', + dc: '', + validity: { + start: 1524175291000, + end: 1524434491000 + }, + signatureAlgorithm: 'sha256WithRSAEncryption', + publicKeySize: '2048 bit', + publicKeyAlgorithm: 'rsaEncryption' + } + + var d = fs.readFileSync('./test/fixtures/pem196.pem').toString() + pem.readCertificateInfo(d, function (error, data) { + if (data.serial) delete data.serial + if (certInfo.serial) delete certInfo.serial + hlp.checkError(error) + hlp.checkCertificateData(data, certInfo) + hlp.checkTmpEmpty() + done() + }) + }) + + it('Read CertInformation from ./test/fixtures/ru_openssl.crt', function (done) { + var certInfo = { + issuer: { + country: 'RU', + state: '', + locality: 'Москва', + organization: 'Моя компания', + organizationUnit: 'Моё подразделение', + commonName: 'Описание сайта', + dc: '' + }, + country: 'RU', + state: '', + locality: 'Москва', + organization: 'Моя компания', + organizationUnit: 'Моё подразделение', + commonName: 'Описание сайта', + emailAddress: 'envek@envek.name', + dc: '', + validity: { + end: 1568233615000, + start: 1536697615000 + }, + san: { + dns: [ + 'example.com', + '*.app.example.com', + 'www.example.com' + ], + email: [], + ip: [] + }, + signatureAlgorithm: 'sha256WithRSAEncryption', + publicKeySize: '4096 bit', + publicKeyAlgorithm: 'rsaEncryption' + } + + var d = fs.readFileSync('./test/fixtures/ru_openssl.crt').toString() + pem.readCertificateInfo(d, function (error, data) { + if (data.serial) delete data.serial + if (certInfo.serial) delete certInfo.serial + hlp.checkError(error) + hlp.checkCertificateData(data, certInfo) + hlp.checkTmpEmpty() + done() + }) + }) + + it('Read CertInformation from ./test/fixtures/cn_openssl.crt', function (done) { + var certInfo = { + issuer: { + country: 'RU', + state: '', + locality: '兰克福', + organization: '法兰克福分行', + organizationUnit: '克福分', + commonName: '中国银行', + dc: '' + }, + serial: '2854046357827755658 (0x279b9c0a82d21e8a)', + country: 'RU', + state: '', + locality: '兰克福', + organization: '法兰克福分行', + organizationUnit: '克福分', + commonName: '中国银行', + emailAddress: 'envek@envek.name', + dc: '', + validity: { + end: 1568233543000, + start: 1536697543000 + }, + san: { + dns: [ + 'example.com', + '*.app.example.com', + 'www.example.com' + ], + email: [], + ip: [] + }, + signatureAlgorithm: 'sha256WithRSAEncryption', + publicKeySize: '4096 bit', + publicKeyAlgorithm: 'rsaEncryption' + } + + var d = fs.readFileSync('./test/fixtures/cn_openssl.crt').toString() + pem.readCertificateInfo(d, function (error, data) { + if (data.serial) delete data.serial + if (certInfo.serial) delete certInfo.serial + hlp.checkError(error) + hlp.checkCertificateData(data, certInfo) + hlp.checkTmpEmpty() + done() + }) + }) + }) + + describe('#.checkCertificate tests', function () { + it('Check certificate file @ ./test/fixtures/test.key', function (done) { + var d = fs.readFileSync('./test/fixtures/test.key').toString() + pem.checkCertificate(d, 'password', function (error, result) { + hlp.checkError(error) + expect(result).to.be.ok() + done() + }) + }) + it('Check certificate file @ ./test/fixtures/test.crt', function (done) { + var d = fs.readFileSync('./test/fixtures/test.crt').toString() + pem.checkCertificate(d, function (error, result) { + hlp.checkError(error) + expect(result).to.be.ok() + done() + }) + }) + it('Check certificate file @ ./test/fixtures/test.csr', function (done) { + var d = fs.readFileSync('./test/fixtures/test.csr').toString() + pem.checkCertificate(d, function (error, result) { + hlp.checkError(error) + expect(result).to.be.ok() + done() + }) + }) + }) + + describe('#.getModulus tests', function () { + it('Check matching modulus of key and cert file', function (done) { + var f = fs.readFileSync('./test/fixtures/test.crt').toString() + pem.getModulus(f, function (error, data1) { + hlp.checkError(error) + hlp.checkModulus(data1) + hlp.checkTmpEmpty() + + f = fs.readFileSync('./test/fixtures/test.key').toString() + pem.getModulus(f, 'password', function (error, data2) { + hlp.checkError(error) + hlp.checkModulus(data2) + expect(data1.modulus).to.equal(data2.modulus) + hlp.checkTmpEmpty() + done() + }) + }) + }) + }) + + describe('#.getDhparamInfo tests', function () { + it('Get DH param info', function (done) { + var dh = fs.readFileSync('./test/fixtures/test.dh').toString() + pem.getDhparamInfo(dh, function (error, data) { + hlp.checkError(error) + var size = (data && data.size) || 0 + var prime = ((data && data.prime) || '').toString() + expect(size).to.be.a('number') + expect(size).to.equal(1024) + expect(prime).to.be.a('string') + expect(/([0-9a-f][0-9a-f]:)+[0-9a-f][0-9a-f]$/g.test(prime)).to.be.true() + hlp.checkTmpEmpty() + done() + }) + }) + }) + + describe('#.readPkcs12 tests', function () { + it('Respond with ENOENT for missing PKCS12 file', function ( + done) { + pem.readPkcs12('/i/do/not/exist.p12', function (error) { + hlp.checkError(error, { + code: 'ENOENT' + }) + done() + }) + }) + }) + + describe('#.checkPkcs12 tests', function () { + it('Check PKCS12 keystore', function (done) { + var pkcs12 = fs.readFileSync('./test/fixtures/idsrv3test.pfx') + pem.checkPkcs12(pkcs12, 'idsrv3test', function (error, result) { + hlp.checkError(error) + expect(result).to.be.ok() + done() + }) + }) + }) +}) diff --git a/node_modules/plur/index.js b/node_modules/plur/index.js new file mode 100644 index 000000000..0a16a559c --- /dev/null +++ b/node_modules/plur/index.js @@ -0,0 +1,9 @@ +'use strict'; +module.exports = function (str, plural, count) { + if (typeof plural === 'number') { + count = plural; + plural = str + 's'; + } + + return count === 1 ? str : plural; +}; diff --git a/node_modules/plur/license b/node_modules/plur/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/plur/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/plur/package.json b/node_modules/plur/package.json new file mode 100644 index 000000000..c1f7dc100 --- /dev/null +++ b/node_modules/plur/package.json @@ -0,0 +1,69 @@ +{ + "_from": "plur@^1.0.0", + "_id": "plur@1.0.0", + "_inBundle": false, + "_integrity": "sha1-24XGgU9eXlo7Se/CjWBP7GKXUVY=", + "_location": "/plur", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "plur@^1.0.0", + "name": "plur", + "escapedName": "plur", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/pretty-ms" + ], + "_resolved": "https://registry.npmjs.org/plur/-/plur-1.0.0.tgz", + "_shasum": "db85c6814f5e5e5a3b49efc28d604fec62975156", + "_spec": "plur@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/pretty-ms", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/plur/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Naively pluralize a word", + "devDependencies": { + "ava": "0.0.4" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/plur#readme", + "keywords": [ + "plur", + "plural", + "plurals", + "pluralize", + "singular", + "count", + "word", + "string", + "str", + "naive", + "simple" + ], + "license": "MIT", + "name": "plur", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/plur.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/node_modules/plur/readme.md b/node_modules/plur/readme.md new file mode 100644 index 000000000..ebc7d43f0 --- /dev/null +++ b/node_modules/plur/readme.md @@ -0,0 +1,52 @@ +# plur [![Build Status](https://travis-ci.org/sindresorhus/plur.svg?branch=master)](https://travis-ci.org/sindresorhus/plur) + +> Naively pluralize a word + + +## Install + +``` +$ npm install --save plur +``` + + +## Usage + +```js +var plur = require('plur'); + +plur('unicorn', 4); +//=> 'unicorns' + +plur('hero', 'heroes', 4); +//=> 'heroes' +``` + + +## API + +### plur(word, [plural], count) + +#### word + +Type: `string` + +Word to pluralize. + +#### plural + +Type: `string` +Default: `word` + `s` + +Pluralized word. + +#### count + +Type: `number` + +Count to determine whether to use singular or plural. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/posix-character-classes/LICENSE b/node_modules/posix-character-classes/LICENSE new file mode 100644 index 000000000..b11cb7968 --- /dev/null +++ b/node_modules/posix-character-classes/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/posix-character-classes/README.md b/node_modules/posix-character-classes/README.md new file mode 100644 index 000000000..894ae237a --- /dev/null +++ b/node_modules/posix-character-classes/README.md @@ -0,0 +1,103 @@ +# posix-character-classes [![NPM version](https://img.shields.io/npm/v/posix-character-classes.svg?style=flat)](https://www.npmjs.com/package/posix-character-classes) [![NPM monthly downloads](https://img.shields.io/npm/dm/posix-character-classes.svg?style=flat)](https://npmjs.org/package/posix-character-classes) [![NPM total downloads](https://img.shields.io/npm/dt/posix-character-classes.svg?style=flat)](https://npmjs.org/package/posix-character-classes) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/posix-character-classes.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/posix-character-classes) + +> POSIX character classes for creating regular expressions. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save posix-character-classes +``` + +Install with [yarn](https://yarnpkg.com): + +```sh +$ yarn add posix-character-classes +``` + +## Usage + +```js +var posix = require('posix-character-classes'); +console.log(posix.alpha); +//=> 'A-Za-z' +``` + +## POSIX Character classes + +The POSIX standard supports the following classes or categories of charactersh (note that classes must be defined within brackets)[1]: + +| **POSIX class** | **Equivalent to** | **Matches** | +| --- | --- | --- | +| `[:alnum:]` | `[A-Za-z0-9]` | digits, uppercase and lowercase letters | +| `[:alpha:]` | `[A-Za-z]` | upper- and lowercase letters | +| `[:ascii:]` | `[\x00-\x7F]` | ASCII characters | +| `[:blank:]` | `[ \t]` | space and TAB characters only | +| `[:cntrl:]` | `[\x00-\x1F\x7F]` | Control characters | +| `[:digit:]` | `[0-9]` | digits | +| `[:graph:]` | `[^[:cntrl:]]` | graphic characters (all characters which have graphic representation) | +| `[:lower:]` | `[a-z]` | lowercase letters | +| `[:print:]` | `[[:graph] ]` | graphic characters and space | +| `[:punct:]` | ``[-!"#$%&'()*+,./:;<=>?@[]^_`{ | }~]`` | all punctuation characters (all graphic characters except letters and digits) | +| `[:space:]` | `[ \t\n\r\f\v]` | all blank (whitespace) characters, including spaces, tabs, new lines, carriage returns, form feeds, and vertical tabs | +| `[:upper:]` | `[A-Z]` | uppercase letters | +| `[:word:]` | `[A-Za-z0-9_]` | word characters | +| `[:xdigit:]` | `[0-9A-Fa-f]` | hexadecimal digits | + +## Examples + +* `a[[:digit:]]b` matches `a0b`, `a1b`, ..., `a9b`. +* `a[:digit:]b` is invalid, character classes must be enclosed in brackets +* `[[:digit:]abc]` matches any digit, as well as `a`, `b`, and `c`. +* `[abc[:digit:]]` is the same as the previous, matching any digit, as well as `a`, `b`, and `c` +* `[^ABZ[:lower:]]` matches any character except lowercase letters, `A`, `B`, and `Z`. + +## About + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 20, 2017._ + +
    +
    +
      +
    1. table and examples are based on the WikiBooks page for [Regular Expressions/POSIX Basic Regular Expressions](https://en.wikibooks.org/wiki/Regular_Expressions/POSIX_Basic_Regular_Expressions), which is available under the [Creative Commons Attribution-ShareAlike License](https://creativecommons.org/licenses/by-sa/3.0/). + +
    2. +
    +
    \ No newline at end of file diff --git a/node_modules/posix-character-classes/index.js b/node_modules/posix-character-classes/index.js new file mode 100644 index 000000000..19f1c9866 --- /dev/null +++ b/node_modules/posix-character-classes/index.js @@ -0,0 +1,22 @@ +'use strict'; + +/** + * POSIX character classes + */ + +module.exports = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' +}; diff --git a/node_modules/posix-character-classes/package.json b/node_modules/posix-character-classes/package.json new file mode 100644 index 000000000..0445adc76 --- /dev/null +++ b/node_modules/posix-character-classes/package.json @@ -0,0 +1,85 @@ +{ + "_from": "posix-character-classes@^0.1.0", + "_id": "posix-character-classes@0.1.1", + "_inBundle": false, + "_integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "_location": "/posix-character-classes", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "posix-character-classes@^0.1.0", + "name": "posix-character-classes", + "escapedName": "posix-character-classes", + "rawSpec": "^0.1.0", + "saveSpec": null, + "fetchSpec": "^0.1.0" + }, + "_requiredBy": [ + "/readdirp/expand-brackets" + ], + "_resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "_shasum": "01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab", + "_spec": "posix-character-classes@^0.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/expand-brackets", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/posix-character-classes/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "POSIX character classes for creating regular expressions.", + "devDependencies": { + "gulp-format-md": "^0.1.12", + "mocha": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/posix-character-classes", + "keywords": [ + "character", + "classes", + "posix" + ], + "license": "MIT", + "main": "index.js", + "name": "posix-character-classes", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/posix-character-classes.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "reflinks": [ + "verb", + "verb-generate-readme" + ], + "lint": { + "reflinks": true + }, + "related-list": [ + "micromatch", + "nanomatch", + "extglob", + "expand-brackets" + ] + }, + "version": "0.1.1" +} diff --git a/node_modules/preserve/.gitattributes b/node_modules/preserve/.gitattributes new file mode 100644 index 000000000..759c2c5af --- /dev/null +++ b/node_modules/preserve/.gitattributes @@ -0,0 +1,14 @@ +# Enforce Unix newlines +*.* text eol=lf +*.css text eol=lf +*.html text eol=lf +*.js text eol=lf +*.json text eol=lf +*.less text eol=lf +*.md text eol=lf +*.yml text eol=lf + +*.jpg binary +*.gif binary +*.png binary +*.jpeg binary \ No newline at end of file diff --git a/node_modules/preserve/.jshintrc b/node_modules/preserve/.jshintrc new file mode 100644 index 000000000..e72045d2b --- /dev/null +++ b/node_modules/preserve/.jshintrc @@ -0,0 +1,24 @@ +{ + "asi": false, + "boss": true, + "curly": true, + "eqeqeq": true, + "eqnull": true, + "esnext": true, + "immed": true, + "latedef": true, + "laxcomma": false, + "newcap": true, + "noarg": true, + "node": true, + "sub": true, + "undef": true, + "unused": true, + "globals": { + "define": true, + "before": true, + "after": true, + "describe": true, + "it": true + } +} \ No newline at end of file diff --git a/node_modules/preserve/.npmignore b/node_modules/preserve/.npmignore new file mode 100644 index 000000000..1a2e47f0d --- /dev/null +++ b/node_modules/preserve/.npmignore @@ -0,0 +1,53 @@ +# Numerous always-ignore extensions +*.csv +*.dat +*.diff +*.err +*.gz +*.log +*.orig +*.out +*.pid +*.rar +*.rej +*.seed +*.swo +*.swp +*.vi +*.yo-rc.json +*.zip +*~ +.ruby-version +lib-cov +npm-debug.log + +# Always-ignore dirs +/bower_components/ +/node_modules/ +/temp/ +/tmp/ +/vendor/ +_gh_pages + +# OS or Editor folders +*.esproj +*.komodoproject +.komodotools +*.sublime-* +._* +.cache +.DS_Store +.idea +.project +.settings +.tmproj +nbproject +Thumbs.db + +# grunt-html-validation +validation-status.json +validation-report.json + +# misc +TODO.md +benchmark \ No newline at end of file diff --git a/node_modules/preserve/.travis.yml b/node_modules/preserve/.travis.yml new file mode 100644 index 000000000..ff74a054e --- /dev/null +++ b/node_modules/preserve/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - '0.10' \ No newline at end of file diff --git a/node_modules/preserve/.verb.md b/node_modules/preserve/.verb.md new file mode 100644 index 000000000..72344a9eb --- /dev/null +++ b/node_modules/preserve/.verb.md @@ -0,0 +1,59 @@ +# {%= name %} {%= badge("fury") %} + +> {%= description %} + +Useful for protecting tokens, like templates in HTML, from being mutated when the string is transformed in some way, like from a formatter/beautifier. + +**Example without `preserve`** + +Let's say you want to use [js-beautify] on a string of html with Lo-Dash/Underscore templates, such as: `
    • <%= name %>
    `: + +js-beautify will render the template unusable (and apply incorrect formatting because of the unfamiliar syntax from the Lo-Dash template): + +```html +
      +
    • + <%=n ame %> +
    • +
    +``` + +**Example with `preserve`** + +Correct. + +```html +
      +
    • <%= name %>
    • +
    +``` + +For the record, this is just a random example, I've had very few issues with js-beautify in general. But with or without js-beautify, this kind of token mangling does happen sometimes when you use formatters, beautifiers or similar tools. + +## Install +{%= include("install-npm", {save: true}) %} + +## Run tests + +```bash +npm test +``` + +## API +{%= apidocs("index.js") %} + +## Contributing +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue]({%= bugs.url %}) + +## Author +{%= include("author") %} + +## License +{%= copyright() %} +{%= license() %} + +*** + +{%= include("footer") %} + +[js-beautify]: https://github.com/beautify-web/js-beautify \ No newline at end of file diff --git a/node_modules/preserve/LICENSE b/node_modules/preserve/LICENSE new file mode 100644 index 000000000..5a9956a75 --- /dev/null +++ b/node_modules/preserve/LICENSE @@ -0,0 +1,24 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/preserve/README.md b/node_modules/preserve/README.md new file mode 100644 index 000000000..75000b933 --- /dev/null +++ b/node_modules/preserve/README.md @@ -0,0 +1,90 @@ +# preserve [![NPM version](https://badge.fury.io/js/preserve.svg)](http://badge.fury.io/js/preserve) + +> Temporarily substitute tokens in the given `string` with placeholders, then put them back after transforming the string. + +Useful for protecting tokens, like templates in HTML, from being mutated when the string is transformed in some way, like from a formatter/beautifier. + +**Example without `preserve`** + +Let's say you want to use [js-beautify] on a string of html with Lo-Dash/Underscore templates, such as: `
    • <%= name %>
    `: + +js-beautify will render the template unusable (and apply incorrect formatting because of the unfamiliar syntax from the Lo-Dash template): + +```html +
      +
    • + <%=n ame %> +
    • +
    +``` + +**Example with `preserve`** + +Correct. + +```html +
      +
    • <%= name %>
    • +
    +``` + +For the record, this is just a random example, I've had very few issues with js-beautify in general. But with or without js-beautify, this kind of token mangling does happen sometimes when you use formatters, beautifiers or similar tools. + +## Install +## Install with [npm](npmjs.org) + +```bash +npm i preserve --save +``` + +## Run tests + +```bash +npm test +``` + +## API +### [.before](index.js#L23) + +Replace tokens in `str` with a temporary, heuristic placeholder. + +* `str` **{String}** +* `returns` **{String}**: String with placeholders. + +```js +tokens.before('{a\\,b}'); +//=> '{__ID1__}' +``` + +### [.after](index.js#L44) + +Replace placeholders in `str` with original tokens. + +* `str` **{String}**: String with placeholders +* `returns` **{String}** `str`: String with original tokens. + +```js +tokens.after('{__ID1__}'); +//=> '{a\\,b}' +``` + + +## Contributing +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/preserve/issues) + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License +Copyright (c) 2015-2015, Jon Schlinkert. +Released under the MIT license + +*** + +_This file was generated by [verb](https://github.com/assemble/verb) on January 10, 2015._ + +[js-beautify]: https://github.com/beautify-web/js-beautify \ No newline at end of file diff --git a/node_modules/preserve/index.js b/node_modules/preserve/index.js new file mode 100644 index 000000000..a6c5d481d --- /dev/null +++ b/node_modules/preserve/index.js @@ -0,0 +1,54 @@ +/*! + * preserve + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT license. + */ + +'use strict'; + +/** + * Replace tokens in `str` with a temporary, heuristic placeholder. + * + * ```js + * tokens.before('{a\\,b}'); + * //=> '{__ID1__}' + * ``` + * + * @param {String} `str` + * @return {String} String with placeholders. + * @api public + */ + +exports.before = function before(str, re) { + return str.replace(re, function (match) { + var id = randomize(); + cache[id] = match; + return '__ID' + id + '__'; + }); +}; + +/** + * Replace placeholders in `str` with original tokens. + * + * ```js + * tokens.after('{__ID1__}'); + * //=> '{a\\,b}' + * ``` + * + * @param {String} `str` String with placeholders + * @return {String} `str` String with original tokens. + * @api public + */ + +exports.after = function after(str) { + return str.replace(/__ID(.{5})__/g, function (_, id) { + return cache[id]; + }); +}; + +function randomize() { + return Math.random().toString().slice(2, 7); +} + +var cache = {}; \ No newline at end of file diff --git a/node_modules/preserve/package.json b/node_modules/preserve/package.json new file mode 100644 index 000000000..fce64cb07 --- /dev/null +++ b/node_modules/preserve/package.json @@ -0,0 +1,73 @@ +{ + "_from": "preserve@^0.2.0", + "_id": "preserve@0.2.0", + "_inBundle": false, + "_integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "_location": "/preserve", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "preserve@^0.2.0", + "name": "preserve", + "escapedName": "preserve", + "rawSpec": "^0.2.0", + "saveSpec": null, + "fetchSpec": "^0.2.0" + }, + "_requiredBy": [ + "/braces" + ], + "_resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "_shasum": "815ed1f6ebc65926f865b310c0713bcb3315ce4b", + "_spec": "preserve@^0.2.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/braces", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/preserve/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Temporarily substitute tokens in the given `string` with placeholders, then put them back after transforming the string.", + "devDependencies": { + "benchmarked": "^0.1.3", + "chalk": "^0.5.1", + "js-beautify": "^1.5.4", + "mocha": "*", + "should": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "homepage": "https://github.com/jonschlinkert/preserve", + "keywords": [ + "escape", + "format", + "placeholder", + "placeholders", + "prettify", + "regex", + "replace", + "template", + "templates", + "token", + "tokens" + ], + "license": { + "type": "MIT", + "url": "https://github.com/jonschlinkert/preserve/blob/master/LICENSE-MIT" + }, + "main": "index.js", + "name": "preserve", + "repository": { + "type": "git", + "url": "git://github.com/jonschlinkert/preserve.git" + }, + "scripts": { + "test": "mocha -R spec" + }, + "version": "0.2.0" +} diff --git a/node_modules/preserve/test.js b/node_modules/preserve/test.js new file mode 100644 index 000000000..9bf174f12 --- /dev/null +++ b/node_modules/preserve/test.js @@ -0,0 +1,48 @@ +/*! + * preserve + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License + */ + +'use strict'; + +var should = require('should'); +var tokens = require('./'); + +var re = /<%=\s*[^>]+%>/g; +var pretty = function(str) { + return require('js-beautify').html(str, { + indent_char: ' ', + indent_size: 2, + }); +}; + +describe('preserve tokens', function () { + var testRe = /__ID.{5}__\n__ID.{5}__\n__ID.{5}__/; + var re = /<%=\s*[^>]+%>/g; + + it('should (e.g. shouldn\'t, but will) mangle tokens in the given string', function () { + var html = pretty('
    • <%= name %>
    '); + html.should.equal('
      \n
    • \n <%=n ame %>\n
    • \n
    '); + }); + + it('should preserve tokens in the given string', function () { + var html = tokens.after(pretty(tokens.before('
    • <%= name %>
    ', re))); + html.should.equal('
      \n
    • <%= name %>
    • \n
    '); + }); + + describe('.before()', function () { + it('should replace matches with placeholder tokens:', function () { + tokens.before('<%= a %>\n<%= b %>\n<%= c %>', re).should.match(testRe); + }); + }); + + describe('tokens.after()', function () { + it('should replace placeholder tokens with original values:', function () { + var before = tokens.before('<%= a %>\n<%= b %>\n<%= c %>', re); + before.should.match(testRe); + tokens.after(before).should.equal('<%= a %>\n<%= b %>\n<%= c %>'); + }); + }); +}); diff --git a/node_modules/prettier-bytes/.npmignore b/node_modules/prettier-bytes/.npmignore new file mode 100644 index 000000000..123ae94d0 --- /dev/null +++ b/node_modules/prettier-bytes/.npmignore @@ -0,0 +1,27 @@ +# Logs +logs +*.log + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git +node_modules diff --git a/node_modules/prettier-bytes/.travis.yml b/node_modules/prettier-bytes/.travis.yml new file mode 100644 index 000000000..5ce0575b2 --- /dev/null +++ b/node_modules/prettier-bytes/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +node_js: + - 'stable' + - '0.12' + - '0.10' +sudo: false +cache: + directories: + - node_modules diff --git a/node_modules/prettier-bytes/CHANGELOG.md b/node_modules/prettier-bytes/CHANGELOG.md new file mode 100644 index 000000000..a50094f03 --- /dev/null +++ b/node_modules/prettier-bytes/CHANGELOG.md @@ -0,0 +1,7 @@ +# prettier-bytes change log + +All notable changes to this project will be documented in this file. +This project adheres to [Semantic Versioning](http://semver.org/). + +## Unreleased +* engage diff --git a/node_modules/prettier-bytes/CONTRIBUTING.md b/node_modules/prettier-bytes/CONTRIBUTING.md new file mode 100644 index 000000000..9a7d3616a --- /dev/null +++ b/node_modules/prettier-bytes/CONTRIBUTING.md @@ -0,0 +1,61 @@ +# Contributing Guidelines + +Contributions welcome! + +**Before spending lots of time on something, ask for feedback on your idea first!** + +Please search issues and pull requests before adding something new to avoid duplicating efforts and conversations. + +In addition to improving the project by refactoring code and implementing relevant features, this project welcomes the following types of contributions: + +- **Ideas**: participate in an issue thread or start your own to have your voice heard. +- **Writing**: contribute your expertise in an area by helping expand the included content. +- **Copy editing**: fix typos, clarify language, and generally improve the quality of the content. +- **Formatting**: help keep content easy to read with consistent formatting. + +## Installing + +Fork and clone the repo, then `npm install` to install all dependencies. + +## Testing + +Tests are run with `npm test`. Unless you're creating a failing test to increase test coverage or show a problem, please make sure all tests are passing before submitting a pull request. + +## Code Style + +[![standard][standard-image]][standard-url] + +This repository uses [`standard`][standard-url] to maintain code style and consistency and avoid style arguments. `npm test` runs `standard` so you don't have to! + +[standard-image]: https://cdn.rawgit.com/feross/standard/master/badge.svg +[standard-url]: https://github.com/feross/standard +[semistandard-image]: https://cdn.rawgit.com/flet/semistandard/master/badge.svg +[semistandard-url]: https://github.com/Flet/semistandard + +--- + +# Collaborating Guidelines + +**This is an OPEN Open Source Project.** + +## What? + +Individuals making significant and valuable contributions are given commit access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project. + +## Rules + +There are a few basic ground rules for collaborators: + +1. **No `--force` pushes** or modifying the Git history in any way. +1. **Non-master branches** ought to be used for ongoing work. +1. **External API changes and significant modifications** ought to be subject to an **internal pull request** to solicit feedback from other collaborators. +1. Internal pull requests to solicit feedback are *encouraged* for any other non-trivial contribution but left to the discretion of the contributor. +1. Contributors should attempt to adhere to the prevailing code style. + +## Releases + +Declaring formal releases remains the prerogative of the project maintainer. + +## Changes to this arrangement + +This is an experiment and feedback is welcome! This document may also be subject to pull requests or changes by collaborators where you believe you have something valuable to add or change. diff --git a/node_modules/prettier-bytes/LICENSE b/node_modules/prettier-bytes/LICENSE new file mode 100644 index 000000000..91e21962b --- /dev/null +++ b/node_modules/prettier-bytes/LICENSE @@ -0,0 +1,5 @@ +Copyright (c) 2016, Dan Flettre + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/prettier-bytes/README.md b/node_modules/prettier-bytes/README.md new file mode 100644 index 000000000..a4c850a14 --- /dev/null +++ b/node_modules/prettier-bytes/README.md @@ -0,0 +1,64 @@ +# prettier-bytes + +[![npm][npm-image]][npm-url] +[![travis][travis-image]][travis-url] +[![standard][standard-image]][standard-url] + +[npm-image]: https://img.shields.io/npm/v/prettier-bytes.svg?style=flat-square +[npm-url]: https://www.npmjs.com/package/prettier-bytes +[travis-image]: https://img.shields.io/travis/Flet/prettier-bytes.svg?style=flat-square +[travis-url]: https://travis-ci.org/Flet/prettier-bytes +[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square +[standard-url]: http://npm.im/standard + +Augment pretty-bytes to make the output a little more readable (and a little less precise) + +Differences from `pretty-bytes`: + - The fractional portion is rounded to one digit (ex: `2.1 MB`). + - If there is more than one digit to the left of the decimal, the fractional portion is rounded off (ex: `11 KB`). + - Changed `kB` to `KB`, for more prettiness. Regular users are not likely to care about the technical difference. + - No dependencies. + +## Install + +``` +npm install prettier-bytes +``` + +## Usage + +```js +var prettierBytes = require('prettier-bytes') + +var pretty = prettierBytes(1337) +console.log(pretty) +// logs 1.3 KB +``` + +Examples from test output: +```bash + ✔ bytes: 2 -> 2 B + ✔ bytes: 9 -> 9 B + ✔ bytes: 25 -> 25 B + ✔ bytes: 235 -> 235 B + ✔ bytes: 2335 -> 2.3 KB + ✔ bytes: 23552 -> 24 KB + ✔ bytes: 235520 -> 236 KB + ✔ bytes: 2355520 -> 2.4 MB + ✔ bytes: 23555520 -> 24 MB + ✔ bytes: 235555520 -> 236 MB + ✔ bytes: 2355555520 -> 2.4 GB + ✔ bytes: 23555555520 -> 24 GB + ✔ bytes: 235556555520 -> 236 GB + ✔ bytes: 2355556655520 -> 2.4 TB + ✔ bytes: 23555566655520 -> 24 TB + ✔ bytes: 235555566665520 -> 236 TB +``` + +## Contributing + +Contributions welcome! Please read the [contributing guidelines](CONTRIBUTING.md) first. + +## License + +[ISC](LICENSE) diff --git a/node_modules/prettier-bytes/index.js b/node_modules/prettier-bytes/index.js new file mode 100644 index 000000000..fbbe78053 --- /dev/null +++ b/node_modules/prettier-bytes/index.js @@ -0,0 +1,30 @@ +module.exports = prettierBytes + +function prettierBytes (num) { + if (typeof num !== 'number' || isNaN(num)) { + throw new TypeError('Expected a number, got ' + typeof num) + } + + var neg = num < 0 + var units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'] + + if (neg) { + num = -num + } + + if (num < 1) { + return (neg ? '-' : '') + num + ' B' + } + + var exponent = Math.min(Math.floor(Math.log(num) / Math.log(1000)), units.length - 1) + num = Number(num / Math.pow(1000, exponent)) + var unit = units[exponent] + + if (num >= 10 || num % 1 === 0) { + // Do not show decimals when the number is two-digit, or if the number has no + // decimal component. + return (neg ? '-' : '') + num.toFixed(0) + ' ' + unit + } else { + return (neg ? '-' : '') + num.toFixed(1) + ' ' + unit + } +} diff --git a/node_modules/prettier-bytes/package.json b/node_modules/prettier-bytes/package.json new file mode 100644 index 000000000..8cfdde7a9 --- /dev/null +++ b/node_modules/prettier-bytes/package.json @@ -0,0 +1,59 @@ +{ + "_from": "prettier-bytes@^1.0.3", + "_id": "prettier-bytes@1.0.4", + "_inBundle": false, + "_integrity": "sha1-mUsCqkb2mcULYle1+qp/4lV+YtY=", + "_location": "/prettier-bytes", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "prettier-bytes@^1.0.3", + "name": "prettier-bytes", + "escapedName": "prettier-bytes", + "rawSpec": "^1.0.3", + "saveSpec": null, + "fetchSpec": "^1.0.3" + }, + "_requiredBy": [ + "/garnish" + ], + "_resolved": "https://registry.npmjs.org/prettier-bytes/-/prettier-bytes-1.0.4.tgz", + "_shasum": "994b02aa46f699c50b6257b5faaa7fe2557e62d6", + "_spec": "prettier-bytes@^1.0.3", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/garnish", + "author": { + "name": "Dan Flettre", + "email": "flettre@gmail.com" + }, + "bugs": { + "url": "https://github.com/Flet/prettier-bytes/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "augment pretty-bytes to make the output a little more readable (and a little less precise)", + "devDependencies": { + "standard": "*", + "tap-spec": "^4.0.2", + "tape": "^4.0.0" + }, + "homepage": "https://github.com/Flet/prettier-bytes", + "keywords": [ + "bytes", + "output", + "pretty", + "pretty-bytes" + ], + "license": "ISC", + "main": "index.js", + "name": "prettier-bytes", + "repository": { + "type": "git", + "url": "git+https://github.com/Flet/prettier-bytes.git" + }, + "scripts": { + "test": "tape test/*.js | tap-spec && standard" + }, + "version": "1.0.4" +} diff --git a/node_modules/prettier-bytes/test/index.js b/node_modules/prettier-bytes/test/index.js new file mode 100644 index 000000000..10597194b --- /dev/null +++ b/node_modules/prettier-bytes/test/index.js @@ -0,0 +1,44 @@ +var test = require('tape') + +var prettierBytes = require('../') + +var testData = [ + [2, '2 B'], + [9, '9 B'], + [25, '25 B'], + [235, '235 B'], + [2335, '2.3 KB'], + [23552, '24 KB'], + [235520, '236 KB'], + [2355520, '2.4 MB'], + [23555520, '24 MB'], + [235555520, '236 MB'], + [2355555520, '2.4 GB'], + [23555555520, '24 GB'], + [235556555520, '236 GB'], + [2355556655520, '2.4 TB'], + [23555566655520, '24 TB'], + [235555566665520, '236 TB'] +] + +test('pretty bytes', function (t) { + testData.forEach(function (data) { + t.equals(prettierBytes(data[0]), data[1], 'bytes: ' + data[0] + ' -> ' + data[1]) + }) + + t.end() +}) + +test('throws on non-number', function (t) { + t.throws(function () { + prettierBytes('this is a string') + }) + t.end() +}) + +test('throws on NaN', function (t) { + t.throws(function () { + prettierBytes(NaN) + }) + t.end() +}) diff --git a/node_modules/pretty-ms/index.js b/node_modules/pretty-ms/index.js new file mode 100644 index 000000000..74aadf440 --- /dev/null +++ b/node_modules/pretty-ms/index.js @@ -0,0 +1,47 @@ +'use strict'; +var parseMs = require('parse-ms'); +var plur = require('plur'); +var isFinitePonyfill = require('is-finite'); + +module.exports = function (ms, opts) { + if (!isFinitePonyfill(ms)) { + throw new TypeError('Expected a finite number'); + } + + opts = opts || {}; + + if (ms < 1000) { + var msDecimalDigits = typeof opts.msDecimalDigits === 'number' ? opts.msDecimalDigits : 0; + return (msDecimalDigits ? ms.toFixed(msDecimalDigits) : Math.ceil(ms)) + (opts.verbose ? ' ' + plur('millisecond', Math.ceil(ms)) : 'ms'); + } + + var ret = []; + + var add = function (val, long, short, valStr) { + if (val === 0) { + return; + } + + var postfix = opts.verbose ? ' ' + plur(long, val) : short; + + ret.push((valStr || val) + postfix); + }; + + var parsed = parseMs(ms); + + add(parsed.days, 'day', 'd'); + add(parsed.hours, 'hour', 'h'); + add(parsed.minutes, 'minute', 'm'); + + if (opts.compact) { + add(parsed.seconds, 'second', 's'); + return '~' + ret[0]; + } + + var sec = ms / 1000 % 60; + var secDecimalDigits = typeof opts.secDecimalDigits === 'number' ? opts.secDecimalDigits : 1; + var secStr = sec.toFixed(secDecimalDigits).replace(/\.0$/, ''); + add(sec, 'second', 's', secStr); + + return ret.join(' '); +}; diff --git a/node_modules/pretty-ms/license b/node_modules/pretty-ms/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/pretty-ms/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/pretty-ms/package.json b/node_modules/pretty-ms/package.json new file mode 100644 index 000000000..da4e56820 --- /dev/null +++ b/node_modules/pretty-ms/package.json @@ -0,0 +1,80 @@ +{ + "_from": "pretty-ms@^2.1.0", + "_id": "pretty-ms@2.1.0", + "_inBundle": false, + "_integrity": "sha1-QlfCVt8/sLRR1q/6qwIYhBJpgdw=", + "_location": "/pretty-ms", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "pretty-ms@^2.1.0", + "name": "pretty-ms", + "escapedName": "pretty-ms", + "rawSpec": "^2.1.0", + "saveSpec": null, + "fetchSpec": "^2.1.0" + }, + "_requiredBy": [ + "/garnish" + ], + "_resolved": "http://registry.npmjs.org/pretty-ms/-/pretty-ms-2.1.0.tgz", + "_shasum": "4257c256df3fb0b451d6affaab021884126981dc", + "_spec": "pretty-ms@^2.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/garnish", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/pretty-ms/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-finite": "^1.0.1", + "parse-ms": "^1.0.0", + "plur": "^1.0.0" + }, + "deprecated": false, + "description": "Convert milliseconds to a human readable string: 1337000000 → 15d 11h 23m 20s", + "devDependencies": { + "mocha": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/pretty-ms#readme", + "keywords": [ + "pretty", + "prettify", + "human", + "humanize", + "humanized", + "readable", + "time", + "ms", + "milliseconds", + "duration", + "period", + "range", + "text", + "string", + "str", + "number", + "hrtime" + ], + "license": "MIT", + "name": "pretty-ms", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/pretty-ms.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "2.1.0" +} diff --git a/node_modules/pretty-ms/readme.md b/node_modules/pretty-ms/readme.md new file mode 100644 index 000000000..2a1bf780f --- /dev/null +++ b/node_modules/pretty-ms/readme.md @@ -0,0 +1,89 @@ +# pretty-ms [![Build Status](https://travis-ci.org/sindresorhus/pretty-ms.svg?branch=master)](https://travis-ci.org/sindresorhus/pretty-ms) + +> Convert milliseconds to a human readable string: `1337000000` → `15d 11h 23m 20s` + + +## Usage + +``` +$ npm install --save pretty-ms +``` + +```js +var prettyMs = require('pretty-ms'); + +prettyMs(1337000000); +//=> '15d 11h 23m 20s' + +prettyMs(1337); +//=> '1.3s' + +prettyMs(133); +//=> '133ms' + +// compact option +prettyMs(1337, {compact: true}); +//=> '~1s' + +// verbose option +prettyMs(1335669000, {verbose: true}); +//=> '15 days 11 hours 1 minute 9 seconds' + +// can be useful for time durations +prettyMs(new Date(2014, 0, 1, 10, 40) - new Date(2014, 0, 1, 10, 5)) +//=> '35m' +``` + + +## API + +### prettyMs(milliseconds, [options]) + +#### milliseconds + +*Required* +Type: `number` + +Milliseconds to humanize. + +#### options + +##### secDecimalDigits + +Type: `number` +Default: `1` + +Number of digits to appear after the seconds decimal point. + +##### msDecimalDigits + +Type: `number` +Default: `0` + +Number of digits to appear after the milliseconds decimal point. + +Useful in combination with [`process.hrtime()`](https://nodejs.org/api/process.html#process_process_hrtime). + +##### compact + +Type: `boolean` +Default: `false` + +Only show the first unit: `1h 10m` → `~1h`. + +##### verbose + +Type: `boolean` +Default: `false` + +Use full-length units: `5h 1m 45s` → `5 hours 1 minute 45 seconds` + + +## Related + +- [pretty-ms-cli](https://github.com/sindresorhus/pretty-ms-cli) - CLI for this module + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/process-nextick-args/index.js b/node_modules/process-nextick-args/index.js new file mode 100644 index 000000000..5f585e8e7 --- /dev/null +++ b/node_modules/process-nextick-args/index.js @@ -0,0 +1,44 @@ +'use strict'; + +if (!process.version || + process.version.indexOf('v0.') === 0 || + process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { + module.exports = { nextTick: nextTick }; +} else { + module.exports = process +} + +function nextTick(fn, arg1, arg2, arg3) { + if (typeof fn !== 'function') { + throw new TypeError('"callback" argument must be a function'); + } + var len = arguments.length; + var args, i; + switch (len) { + case 0: + case 1: + return process.nextTick(fn); + case 2: + return process.nextTick(function afterTickOne() { + fn.call(null, arg1); + }); + case 3: + return process.nextTick(function afterTickTwo() { + fn.call(null, arg1, arg2); + }); + case 4: + return process.nextTick(function afterTickThree() { + fn.call(null, arg1, arg2, arg3); + }); + default: + args = new Array(len - 1); + i = 0; + while (i < args.length) { + args[i++] = arguments[i]; + } + return process.nextTick(function afterTick() { + fn.apply(null, args); + }); + } +} + diff --git a/node_modules/process-nextick-args/license.md b/node_modules/process-nextick-args/license.md new file mode 100644 index 000000000..c67e3532b --- /dev/null +++ b/node_modules/process-nextick-args/license.md @@ -0,0 +1,19 @@ +# Copyright (c) 2015 Calvin Metcalf + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.** diff --git a/node_modules/process-nextick-args/package.json b/node_modules/process-nextick-args/package.json new file mode 100644 index 000000000..7cf00938a --- /dev/null +++ b/node_modules/process-nextick-args/package.json @@ -0,0 +1,50 @@ +{ + "_from": "process-nextick-args@~2.0.0", + "_id": "process-nextick-args@2.0.0", + "_inBundle": false, + "_integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "_location": "/process-nextick-args", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "process-nextick-args@~2.0.0", + "name": "process-nextick-args", + "escapedName": "process-nextick-args", + "rawSpec": "~2.0.0", + "saveSpec": null, + "fetchSpec": "~2.0.0" + }, + "_requiredBy": [ + "/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "_shasum": "a37d732f4271b4ab1ad070d35508e8290788ffaa", + "_spec": "process-nextick-args@~2.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readable-stream", + "author": "", + "bugs": { + "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "process.nextTick but always with args", + "devDependencies": { + "tap": "~0.2.6" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/calvinmetcalf/process-nextick-args", + "license": "MIT", + "main": "index.js", + "name": "process-nextick-args", + "repository": { + "type": "git", + "url": "git+https://github.com/calvinmetcalf/process-nextick-args.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "2.0.0" +} diff --git a/node_modules/process-nextick-args/readme.md b/node_modules/process-nextick-args/readme.md new file mode 100644 index 000000000..ecb432c9b --- /dev/null +++ b/node_modules/process-nextick-args/readme.md @@ -0,0 +1,18 @@ +process-nextick-args +===== + +[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args) + +```bash +npm install --save process-nextick-args +``` + +Always be able to pass arguments to process.nextTick, no matter the platform + +```js +var pna = require('process-nextick-args'); + +pna.nextTick(function (a, b, c) { + console.log(a, b, c); +}, 'step', 3, 'profit'); +``` diff --git a/node_modules/process/.eslintrc b/node_modules/process/.eslintrc new file mode 100644 index 000000000..1e7aab73e --- /dev/null +++ b/node_modules/process/.eslintrc @@ -0,0 +1,21 @@ +{ +extends: "eslint:recommended", + "env": { + "node": true, + "browser": true, + "es6" : true, + "mocha": true + }, + "rules": { + "indent": [2, 4], + "brace-style": [2, "1tbs"], + "quotes": [2, "single"], + "no-console": 0, + "no-shadow": 0, + "no-use-before-define": [2, "nofunc"], + "no-underscore-dangle": 0, + "no-constant-condition": 0, + "space-after-function-name": 0, + "consistent-return": 0 + } +} diff --git a/node_modules/process/LICENSE b/node_modules/process/LICENSE new file mode 100644 index 000000000..b8c1246cf --- /dev/null +++ b/node_modules/process/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2013 Roman Shtylman + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/process/README.md b/node_modules/process/README.md new file mode 100644 index 000000000..6570729b2 --- /dev/null +++ b/node_modules/process/README.md @@ -0,0 +1,26 @@ +# process + +```require('process');``` just like any other module. + +Works in node.js and browsers via the browser.js shim provided with the module. + +## browser implementation + +The goal of this module is not to be a full-fledged alternative to the builtin process module. This module mostly exists to provide the nextTick functionality and little more. We keep this module lean because it will often be included by default by tools like browserify when it detects a module has used the `process` global. + +It also exposes a "browser" member (i.e. `process.browser`) which is `true` in this implementation but `undefined` in node. This can be used in isomorphic code that adjusts it's behavior depending on which environment it's running in. + +If you are looking to provide other process methods, I suggest you monkey patch them onto the process global in your app. A list of user created patches is below. + +* [hrtime](https://github.com/kumavis/browser-process-hrtime) +* [stdout](https://github.com/kumavis/browser-stdout) + +## package manager notes + +If you are writing a bundler to package modules for client side use, make sure you use the ```browser``` field hint in package.json. + +See https://gist.github.com/4339901 for details. + +The [browserify](https://github.com/substack/node-browserify) module will properly handle this field when bundling your files. + + diff --git a/node_modules/process/browser.js b/node_modules/process/browser.js new file mode 100644 index 000000000..d05936230 --- /dev/null +++ b/node_modules/process/browser.js @@ -0,0 +1,184 @@ +// 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; }; diff --git a/node_modules/process/index.js b/node_modules/process/index.js new file mode 100644 index 000000000..8d8ed7df4 --- /dev/null +++ b/node_modules/process/index.js @@ -0,0 +1,2 @@ +// for now just expose the builtin process global from node.js +module.exports = global.process; diff --git a/node_modules/process/package.json b/node_modules/process/package.json new file mode 100644 index 000000000..810bef308 --- /dev/null +++ b/node_modules/process/package.json @@ -0,0 +1,61 @@ +{ + "_from": "process@~0.11.0", + "_id": "process@0.11.10", + "_inBundle": false, + "_integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "_location": "/process", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "process@~0.11.0", + "name": "process", + "escapedName": "process", + "rawSpec": "~0.11.0", + "saveSpec": null, + "fetchSpec": "~0.11.0" + }, + "_requiredBy": [ + "/browserify", + "/insert-module-globals", + "/timers-browserify" + ], + "_resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "_shasum": "7332300e840161bda3e69a1d1d91a7d4bc16f182", + "_spec": "process@~0.11.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "Roman Shtylman", + "email": "shtylman@gmail.com" + }, + "browser": "./browser.js", + "bugs": { + "url": "https://github.com/shtylman/node-process/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "process information for node.js and browsers", + "devDependencies": { + "mocha": "2.2.1", + "zuul": "^3.10.3" + }, + "engines": { + "node": ">= 0.6.0" + }, + "homepage": "https://github.com/shtylman/node-process#readme", + "keywords": [ + "process" + ], + "license": "MIT", + "main": "./index.js", + "name": "process", + "repository": { + "type": "git", + "url": "git://github.com/shtylman/node-process.git" + }, + "scripts": { + "browser": "zuul --no-coverage --ui mocha-bdd --local 8080 -- test.js", + "test": "mocha test.js" + }, + "version": "0.11.10" +} diff --git a/node_modules/process/test.js b/node_modules/process/test.js new file mode 100644 index 000000000..8ba579c0a --- /dev/null +++ b/node_modules/process/test.js @@ -0,0 +1,199 @@ +var assert = require('assert'); +var ourProcess = require('./browser'); +describe('test against our process', function () { + test(ourProcess); +}); +if (!process.browser) { + describe('test against node', function () { + test(process); + }); + vmtest(); +} +function test (ourProcess) { + describe('test arguments', function () { + it ('works', function (done) { + var order = 0; + + + ourProcess.nextTick(function (num) { + assert.equal(num, order++, 'first one works'); + ourProcess.nextTick(function (num) { + assert.equal(num, order++, 'recursive one is 4th'); + }, 3); + }, 0); + ourProcess.nextTick(function (num) { + assert.equal(num, order++, 'second one starts'); + ourProcess.nextTick(function (num) { + assert.equal(num, order++, 'this is third'); + ourProcess.nextTick(function (num) { + assert.equal(num, order++, 'this is last'); + done(); + }, 5); + }, 4); + }, 1); + ourProcess.nextTick(function (num) { + + assert.equal(num, order++, '3rd schedualed happens after the error'); + }, 2); + }); + }); +if (!process.browser) { + describe('test errors', function (t) { + it ('works', function (done) { + var order = 0; + process.removeAllListeners('uncaughtException'); + process.once('uncaughtException', function(err) { + assert.equal(2, order++, 'error is third'); + ourProcess.nextTick(function () { + assert.equal(5, order++, 'schedualed in error is last'); + done(); + }); + }); + ourProcess.nextTick(function () { + assert.equal(0, order++, 'first one works'); + ourProcess.nextTick(function () { + assert.equal(4, order++, 'recursive one is 4th'); + }); + }); + ourProcess.nextTick(function () { + assert.equal(1, order++, 'second one starts'); + throw(new Error('an error is thrown')); + }); + ourProcess.nextTick(function () { + assert.equal(3, order++, '3rd schedualed happens after the error'); + }); + }); + }); +} + describe('rename globals', function (t) { + var oldTimeout = setTimeout; + var oldClear = clearTimeout; + + it('clearTimeout', function (done){ + + var ok = true; + clearTimeout = function () { + ok = false; + } + var ran = false; + function cleanup() { + clearTimeout = oldClear; + var err; + try { + assert.ok(ok, 'fake clearTimeout ran'); + assert.ok(ran, 'should have run'); + } catch (e) { + err = e; + } + done(err); + } + setTimeout(cleanup, 1000); + ourProcess.nextTick(function () { + ran = true; + }); + }); + it('just setTimeout', function (done){ + + + setTimeout = function () { + setTimeout = oldTimeout; + try { + assert.ok(false, 'fake setTimeout called') + } catch (e) { + done(e); + } + + } + + ourProcess.nextTick(function () { + setTimeout = oldTimeout; + done(); + }); + }); + }); +} +function vmtest() { + var vm = require('vm'); + var fs = require('fs'); + var process = fs.readFileSync('./browser.js', {encoding: 'utf8'}); + + + describe('should work in vm in strict mode with no globals', function () { + it('should parse', function (done) { + var str = '"use strict";var module = {exports:{}};'; + str += process; + str += 'this.works = process.browser;'; + var script = new vm.Script(str); + var context = { + works: false + }; + script.runInNewContext(context); + assert.ok(context.works); + done(); + }); + it('setTimeout throws error', function (done) { + var str = '"use strict";var module = {exports:{}};'; + str += process; + str += 'try {process.nextTick(function () {})} catch (e){this.works = e;}'; + var script = new vm.Script(str); + var context = { + works: false + }; + script.runInNewContext(context); + assert.ok(context.works); + done(); + }); + it('should generally work', function (done) { + var str = '"use strict";var module = {exports:{}};'; + str += process; + str += 'process.nextTick(function () {assert.ok(true);done();})'; + var script = new vm.Script(str); + var context = { + clearTimeout: clearTimeout, + setTimeout: setTimeout, + done: done, + assert: assert + }; + script.runInNewContext(context); + }); + it('late defs setTimeout', function (done) { + var str = '"use strict";var module = {exports:{}};'; + str += process; + str += 'var setTimeout = hiddenSetTimeout;process.nextTick(function () {assert.ok(true);done();})'; + var script = new vm.Script(str); + var context = { + clearTimeout: clearTimeout, + hiddenSetTimeout: setTimeout, + done: done, + assert: assert + }; + script.runInNewContext(context); + }); + it('late defs clearTimeout', function (done) { + var str = '"use strict";var module = {exports:{}};'; + str += process; + str += 'var clearTimeout = hiddenClearTimeout;process.nextTick(function () {assert.ok(true);done();})'; + var script = new vm.Script(str); + var context = { + hiddenClearTimeout: clearTimeout, + setTimeout: setTimeout, + done: done, + assert: assert + }; + script.runInNewContext(context); + }); + it('late defs setTimeout and then redefine', function (done) { + var str = '"use strict";var module = {exports:{}};'; + str += process; + str += 'var setTimeout = hiddenSetTimeout;process.nextTick(function () {setTimeout = function (){throw new Error("foo")};hiddenSetTimeout(function(){process.nextTick(function (){assert.ok(true);done();});});});'; + var script = new vm.Script(str); + var context = { + clearTimeout: clearTimeout, + hiddenSetTimeout: setTimeout, + done: done, + assert: assert + }; + script.runInNewContext(context); + }); + }); +} diff --git a/node_modules/public-encrypt/.travis.yml b/node_modules/public-encrypt/.travis.yml new file mode 100644 index 000000000..1b7266674 --- /dev/null +++ b/node_modules/public-encrypt/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: + - "0.10" + - "0.11" + - "0.12" + - iojs \ No newline at end of file diff --git a/node_modules/public-encrypt/LICENSE b/node_modules/public-encrypt/LICENSE new file mode 100644 index 000000000..c9ddc0feb --- /dev/null +++ b/node_modules/public-encrypt/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2017 Calvin Metcalf + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/public-encrypt/browser.js b/node_modules/public-encrypt/browser.js new file mode 100644 index 000000000..4032f6866 --- /dev/null +++ b/node_modules/public-encrypt/browser.js @@ -0,0 +1,10 @@ +exports.publicEncrypt = require('./publicEncrypt') +exports.privateDecrypt = require('./privateDecrypt') + +exports.privateEncrypt = function privateEncrypt (key, buf) { + return exports.publicEncrypt(key, buf, true) +} + +exports.publicDecrypt = function publicDecrypt (key, buf) { + return exports.privateDecrypt(key, buf, true) +} diff --git a/node_modules/public-encrypt/index.js b/node_modules/public-encrypt/index.js new file mode 100644 index 000000000..6ff4014e8 --- /dev/null +++ b/node_modules/public-encrypt/index.js @@ -0,0 +1,18 @@ +var crypto = require('crypto') +if (typeof crypto.publicEncrypt !== 'function') { + crypto = require('./browser') +} +exports.publicEncrypt = crypto.publicEncrypt +exports.privateDecrypt = crypto.privateDecrypt + +if (typeof crypto.privateEncrypt !== 'function') { + exports.privateEncrypt = require('./browser').privateEncrypt +} else { + exports.privateEncrypt = crypto.privateEncrypt +} + +if (typeof crypto.publicDecrypt !== 'function') { + exports.publicDecrypt = require('./browser').publicDecrypt +} else { + exports.publicDecrypt = crypto.publicDecrypt +} diff --git a/node_modules/public-encrypt/mgf.js b/node_modules/public-encrypt/mgf.js new file mode 100644 index 000000000..b966f317b --- /dev/null +++ b/node_modules/public-encrypt/mgf.js @@ -0,0 +1,19 @@ +var createHash = require('create-hash') +var Buffer = require('safe-buffer').Buffer + +module.exports = function (seed, len) { + var t = Buffer.alloc(0) + var i = 0 + var c + while (t.length < len) { + c = i2ops(i++) + t = Buffer.concat([t, createHash('sha1').update(seed).update(c).digest()]) + } + return t.slice(0, len) +} + +function i2ops (c) { + var out = Buffer.allocUnsafe(4) + out.writeUInt32BE(c, 0) + return out +} diff --git a/node_modules/public-encrypt/package.json b/node_modules/public-encrypt/package.json new file mode 100644 index 000000000..a849a3de5 --- /dev/null +++ b/node_modules/public-encrypt/package.json @@ -0,0 +1,64 @@ +{ + "_from": "public-encrypt@^4.0.0", + "_id": "public-encrypt@4.0.3", + "_inBundle": false, + "_integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "_location": "/public-encrypt", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "public-encrypt@^4.0.0", + "name": "public-encrypt", + "escapedName": "public-encrypt", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/crypto-browserify" + ], + "_resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "_shasum": "4fcc9d77a07e48ba7527e7cbe0de33d0701331e0", + "_spec": "public-encrypt@^4.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/crypto-browserify", + "author": { + "name": "Calvin Metcalf" + }, + "browser": "browser.js", + "bugs": { + "url": "https://github.com/crypto-browserify/publicEncrypt/issues" + }, + "bundleDependencies": false, + "dependencies": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + }, + "deprecated": false, + "description": "browserify version of publicEncrypt & privateDecrypt", + "devDependencies": { + "standard": "^12.0.0", + "tap-spec": "^2.1.2", + "tape": "^3.0.3" + }, + "directories": { + "test": "test" + }, + "homepage": "https://github.com/crypto-browserify/publicEncrypt", + "license": "MIT", + "main": "index.js", + "name": "public-encrypt", + "repository": { + "type": "git", + "url": "git+https://github.com/crypto-browserify/publicEncrypt.git" + }, + "scripts": { + "lint": "standard", + "test": "node test/index.js | tspec" + }, + "version": "4.0.3" +} diff --git a/node_modules/public-encrypt/privateDecrypt.js b/node_modules/public-encrypt/privateDecrypt.js new file mode 100644 index 000000000..8fc6dfecb --- /dev/null +++ b/node_modules/public-encrypt/privateDecrypt.js @@ -0,0 +1,105 @@ +var parseKeys = require('parse-asn1') +var mgf = require('./mgf') +var xor = require('./xor') +var BN = require('bn.js') +var crt = require('browserify-rsa') +var createHash = require('create-hash') +var withPublic = require('./withPublic') +var Buffer = require('safe-buffer').Buffer + +module.exports = function privateDecrypt (privateKey, enc, reverse) { + var padding + if (privateKey.padding) { + padding = privateKey.padding + } else if (reverse) { + padding = 1 + } else { + padding = 4 + } + + var key = parseKeys(privateKey) + var k = key.modulus.byteLength() + if (enc.length > k || new BN(enc).cmp(key.modulus) >= 0) { + throw new Error('decryption error') + } + var msg + if (reverse) { + msg = withPublic(new BN(enc), key) + } else { + msg = crt(enc, key) + } + var zBuffer = Buffer.alloc(k - msg.length) + msg = Buffer.concat([zBuffer, msg], k) + if (padding === 4) { + return oaep(key, msg) + } else if (padding === 1) { + return pkcs1(key, msg, reverse) + } else if (padding === 3) { + return msg + } else { + throw new Error('unknown padding') + } +} + +function oaep (key, msg) { + var k = key.modulus.byteLength() + var iHash = createHash('sha1').update(Buffer.alloc(0)).digest() + var hLen = iHash.length + if (msg[0] !== 0) { + throw new Error('decryption error') + } + var maskedSeed = msg.slice(1, hLen + 1) + var maskedDb = msg.slice(hLen + 1) + var seed = xor(maskedSeed, mgf(maskedDb, hLen)) + var db = xor(maskedDb, mgf(seed, k - hLen - 1)) + if (compare(iHash, db.slice(0, hLen))) { + throw new Error('decryption error') + } + var i = hLen + while (db[i] === 0) { + i++ + } + if (db[i++] !== 1) { + throw new Error('decryption error') + } + return db.slice(i) +} + +function pkcs1 (key, msg, reverse) { + var p1 = msg.slice(0, 2) + var i = 2 + var status = 0 + while (msg[i++] !== 0) { + if (i >= msg.length) { + status++ + break + } + } + var ps = msg.slice(2, i - 1) + + if ((p1.toString('hex') !== '0002' && !reverse) || (p1.toString('hex') !== '0001' && reverse)) { + status++ + } + if (ps.length < 8) { + status++ + } + if (status) { + throw new Error('decryption error') + } + return msg.slice(i) +} +function compare (a, b) { + a = Buffer.from(a) + b = Buffer.from(b) + var dif = 0 + var len = a.length + if (a.length !== b.length) { + dif++ + len = Math.min(a.length, b.length) + } + var i = -1 + while (++i < len) { + dif += (a[i] ^ b[i]) + } + return dif +} diff --git a/node_modules/public-encrypt/publicEncrypt.js b/node_modules/public-encrypt/publicEncrypt.js new file mode 100644 index 000000000..122aa7652 --- /dev/null +++ b/node_modules/public-encrypt/publicEncrypt.js @@ -0,0 +1,88 @@ +var parseKeys = require('parse-asn1') +var randomBytes = require('randombytes') +var createHash = require('create-hash') +var mgf = require('./mgf') +var xor = require('./xor') +var BN = require('bn.js') +var withPublic = require('./withPublic') +var crt = require('browserify-rsa') +var Buffer = require('safe-buffer').Buffer + +module.exports = function publicEncrypt (publicKey, msg, reverse) { + var padding + if (publicKey.padding) { + padding = publicKey.padding + } else if (reverse) { + padding = 1 + } else { + padding = 4 + } + var key = parseKeys(publicKey) + var paddedMsg + if (padding === 4) { + paddedMsg = oaep(key, msg) + } else if (padding === 1) { + paddedMsg = pkcs1(key, msg, reverse) + } else if (padding === 3) { + paddedMsg = new BN(msg) + if (paddedMsg.cmp(key.modulus) >= 0) { + throw new Error('data too long for modulus') + } + } else { + throw new Error('unknown padding') + } + if (reverse) { + return crt(paddedMsg, key) + } else { + return withPublic(paddedMsg, key) + } +} + +function oaep (key, msg) { + var k = key.modulus.byteLength() + var mLen = msg.length + var iHash = createHash('sha1').update(Buffer.alloc(0)).digest() + var hLen = iHash.length + var hLen2 = 2 * hLen + if (mLen > k - hLen2 - 2) { + throw new Error('message too long') + } + var ps = Buffer.alloc(k - mLen - hLen2 - 2) + var dblen = k - hLen - 1 + var seed = randomBytes(hLen) + var maskedDb = xor(Buffer.concat([iHash, ps, Buffer.alloc(1, 1), msg], dblen), mgf(seed, dblen)) + var maskedSeed = xor(seed, mgf(maskedDb, hLen)) + return new BN(Buffer.concat([Buffer.alloc(1), maskedSeed, maskedDb], k)) +} +function pkcs1 (key, msg, reverse) { + var mLen = msg.length + var k = key.modulus.byteLength() + if (mLen > k - 11) { + throw new Error('message too long') + } + var ps + if (reverse) { + ps = Buffer.alloc(k - mLen - 3, 0xff) + } else { + ps = nonZero(k - mLen - 3) + } + return new BN(Buffer.concat([Buffer.from([0, reverse ? 1 : 2]), ps, Buffer.alloc(1), msg], k)) +} +function nonZero (len) { + var out = Buffer.allocUnsafe(len) + var i = 0 + var cache = randomBytes(len * 2) + var cur = 0 + var num + while (i < len) { + if (cur === cache.length) { + cache = randomBytes(len * 2) + cur = 0 + } + num = cache[cur++] + if (num) { + out[i++] = num + } + } + return out +} diff --git a/node_modules/public-encrypt/readme.md b/node_modules/public-encrypt/readme.md new file mode 100644 index 000000000..96fe944f8 --- /dev/null +++ b/node_modules/public-encrypt/readme.md @@ -0,0 +1,8 @@ +publicEncrypt +=== + +[![Build Status](https://travis-ci.org/crypto-browserify/publicEncrypt.svg)](https://travis-ci.org/crypto-browserify/publicEncrypt) + +publicEncrypt/privateDecrypt for browserify + +[Blog post about the moving parts that have gone into this.](http://calvinmetcalf.com/post/109301244759/porting-nodejs-crypto-to-the-browser-part-3) diff --git a/node_modules/public-encrypt/test/1024.priv b/node_modules/public-encrypt/test/1024.priv new file mode 100644 index 000000000..720621692 --- /dev/null +++ b/node_modules/public-encrypt/test/1024.priv @@ -0,0 +1,16 @@ +-----BEGIN PRIVATE KEY----- +MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAKulUTZ8B1qccZ8c +DXRGSY08gW8KvLlcxxxGC4gZHNT3CBUF8n5R4KE30aZyYZ/rtsQZu05juZJxaJ0q +mbe75dlQ5d+Xc9BMXeQg/MpTZw5TAN7OIdGYYpFBe+1PLZ6wEfjkYrMqMUcfq2Lq +hTLdAbvBJnuRcYZLqmBeOQ8FTrKrAgMBAAECgYEAnkHRbEPU3/WISSQrP36iyCb2 +S/SBZwKkzmvCrBxDWhPeDswp9c/2JY76rNWfLzy8iXgUG8WUzvHje61Qh3gmBcKe +bUaTGl4Vy8Ha1YBADo5RfRrdm0FE4tvgvu/TkqFqpBBZweu54285hk5zlG7n/D7Y +dnNXUpu5MlNb5x3gW0kCQQDUL//cwcXUxY/evaJP4jSe+ZwEQZo+zXRLiPUulBoV +aw28CVMuxdgwqAo1X1IKefPeUaf7RQu8gCKaRnpGuEuXAkEAzxZTfMmvmCUDIew4 +5Gk6bK265XQWdhcgiq254lpBGOYmDj9yCE7yA+zmASQwMsXTdQOi1hOCEyrXuSJ5 +c++EDQJAFh3WrnzoEPByuYXMmET8tSFRWMQ5vpgNqh3haHR5b4gUC2hxaiunCBNL +1RpVY9AoUiDywGcG/SPh93CnKB3niwJBAKP7AtsifZgVXtiizB4aMThTjVYaSZrz +D0Kg9DuHylpkDChmFu77TGrNUQgAVuYtfhb/bRblVa/F0hJ4eQHT3JUCQBVT68tb +OgRUk0aP9tC3021VN82X6+klowSQN8oBPX8+TfDWSUilp/+j24Hky+Z29Do7yR/R +qutnL92CvBlVLV4= +-----END PRIVATE KEY----- diff --git a/node_modules/public-encrypt/test/1024.pub b/node_modules/public-encrypt/test/1024.pub new file mode 100644 index 000000000..2dba785d6 --- /dev/null +++ b/node_modules/public-encrypt/test/1024.pub @@ -0,0 +1,6 @@ +-----BEGIN PUBLIC KEY----- +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrpVE2fAdanHGfHA10RkmNPIFv +Cry5XMccRguIGRzU9wgVBfJ+UeChN9GmcmGf67bEGbtOY7mScWidKpm3u+XZUOXf +l3PQTF3kIPzKU2cOUwDeziHRmGKRQXvtTy2esBH45GKzKjFHH6ti6oUy3QG7wSZ7 +kXGGS6pgXjkPBU6yqwIDAQAB +-----END PUBLIC KEY----- diff --git a/node_modules/public-encrypt/test/ec.pass.priv b/node_modules/public-encrypt/test/ec.pass.priv new file mode 100644 index 000000000..bf1836d55 --- /dev/null +++ b/node_modules/public-encrypt/test/ec.pass.priv @@ -0,0 +1,7 @@ +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIHeMEkGCSqGSIb3DQEFDTA8MBsGCSqGSIb3DQEFDDAOBAi9LqZQx4JFXAICCAAw +HQYJYIZIAWUDBAECBBA+js1fG4Rv/yRN7oZvxbgyBIGQ/D4yj86M1x8lMsnAHQ/K +7/ryb/baDNHqN9LTZanEGBuyxgrTzt08SiL+h91yFGMoaly029K1VgEI8Lxu5Np/ +A+LK7ewh73ABzsbuxYdcXI+rKnrvLN9Tt6veDs4GlqTTsWwq5wF0C+6gaYRBXA74 +T1b6NykGh2UNL5U5pHZEYdOVLz+lRJL7gYqlweNHP/S3 +-----END ENCRYPTED PRIVATE KEY----- diff --git a/node_modules/public-encrypt/test/ec.priv b/node_modules/public-encrypt/test/ec.priv new file mode 100644 index 000000000..25fffbd87 --- /dev/null +++ b/node_modules/public-encrypt/test/ec.priv @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MHQCAQEEIDF6Xv8Sv//wGUWD+c780ppGrU0QdZWCAzxAQPQX8r/uoAcGBSuBBAAK +oUQDQgAEIZeowDylls4K/wfBjO18bYo7gGx8nYQRija4e/qEMikOHJai7geeUreU +r5Xky/Ax7s2dGtegsPNsPgGe5MpQvg== +-----END EC PRIVATE KEY----- diff --git a/node_modules/public-encrypt/test/ec.pub b/node_modules/public-encrypt/test/ec.pub new file mode 100644 index 000000000..2e39e5bb6 --- /dev/null +++ b/node_modules/public-encrypt/test/ec.pub @@ -0,0 +1,4 @@ +-----BEGIN PUBLIC KEY----- +MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEIZeowDylls4K/wfBjO18bYo7gGx8nYQR +ija4e/qEMikOHJai7geeUreUr5Xky/Ax7s2dGtegsPNsPgGe5MpQvg== +-----END PUBLIC KEY----- diff --git a/node_modules/public-encrypt/test/index.js b/node_modules/public-encrypt/test/index.js new file mode 100644 index 000000000..85b32e30f --- /dev/null +++ b/node_modules/public-encrypt/test/index.js @@ -0,0 +1,113 @@ +var test = require('tape') +var fs = require('fs') +var parseKeys = require('parse-asn1') +var Buffer = require('safe-buffer').Buffer +var path = require('path') + +require('./nodeTests') +var rsa1024 = { + private: fs.readFileSync(path.join(__dirname, 'rsa.1024.priv')), + public: fs.readFileSync(path.join(__dirname, 'rsa.1024.pub')) +} +var rsa1024priv = { + private: fs.readFileSync(path.join(__dirname, 'rsa.1024.priv')), + public: fs.readFileSync(path.join(__dirname, 'rsa.1024.priv')) +} + +var rsa2028 = { + private: fs.readFileSync(path.join(__dirname, 'rsa.2028.priv')), + public: fs.readFileSync(path.join(__dirname, 'rsa.2028.pub')) +} +var nonrsa1024 = { + private: fs.readFileSync(path.join(__dirname, '1024.priv')), + public: fs.readFileSync(path.join(__dirname, '1024.pub')) +} +var nonrsa1024str = { + private: fs.readFileSync(path.join(__dirname, '1024.priv')).toString(), + public: fs.readFileSync(path.join(__dirname, '1024.pub')).toString() +} +var pass1024 = { + private: { + passphrase: 'fooo', + key: fs.readFileSync(path.join(__dirname, 'pass.1024.priv')) + }, + public: fs.readFileSync(path.join(__dirname, 'pass.1024.pub')) +} +var pass2028 = { + private: { + passphrase: 'password', + key: fs.readFileSync(path.join(__dirname, 'rsa.pass.priv')) + }, + public: fs.readFileSync(path.join(__dirname, 'rsa.pass.pub')) +} + +var nodeCrypto = require('../') +var myCrypto = require('../browser') +function _testIt (keys, message, t) { + var pub = keys.public + var priv = keys.private + t.test(message.toString(), function (t) { + t.plan(8) + + var myEnc = myCrypto.publicEncrypt(pub, message) + var nodeEnc = nodeCrypto.publicEncrypt(pub, message) + t.equals(myCrypto.privateDecrypt(priv, myEnc).toString('hex'), message.toString('hex'), 'my decrypter my message') + t.equals(myCrypto.privateDecrypt(priv, nodeEnc).toString('hex'), message.toString('hex'), 'my decrypter node\'s message') + t.equals(nodeCrypto.privateDecrypt(priv, myEnc).toString('hex'), message.toString('hex'), 'node decrypter my message') + t.equals(nodeCrypto.privateDecrypt(priv, nodeEnc).toString('hex'), message.toString('hex'), 'node decrypter node\'s message') + myEnc = myCrypto.privateEncrypt(priv, message) + nodeEnc = nodeCrypto.privateEncrypt(priv, message) + t.equals(myCrypto.publicDecrypt(pub, myEnc).toString('hex'), message.toString('hex'), 'reverse methods my decrypter my message') + t.equals(myCrypto.publicDecrypt(pub, nodeEnc).toString('hex'), message.toString('hex'), 'reverse methods my decrypter node\'s message') + t.equals(nodeCrypto.publicDecrypt(pub, myEnc).toString('hex'), message.toString('hex'), 'reverse methods node decrypter my message') + t.equals(nodeCrypto.publicDecrypt(pub, nodeEnc).toString('hex'), message.toString('hex'), 'reverse methods node decrypter node\'s message') + }) +} +function testIt (keys, message, t) { + _testIt(keys, message, t) + _testIt(paddingObject(keys, 1), Buffer.concat([message, Buffer.from(' with RSA_PKCS1_PADDING')]), t) + var parsedKey = parseKeys(keys.public) + var k = parsedKey.modulus.byteLength() + var zBuf = Buffer.alloc(k) + var msg = Buffer.concat([zBuf, message, Buffer.from(' with no padding')]).slice(-k) + _testIt(paddingObject(keys, 3), msg, t) +} +function paddingObject (keys, padding) { + return { + public: addPadding(keys.public, padding), + private: addPadding(keys.private, padding) + } +} +function addPadding (key, padding) { + if (typeof key === 'string' || Buffer.isBuffer(key)) { + return { + key: key, + padding: padding + } + } + var out = { + key: key.key, + padding: padding + } + if ('passphrase' in key) { + out.passphrase = key.passphrase + } + return out +} +function testRun (i) { + test('run ' + i, function (t) { + testIt(rsa1024priv, Buffer.from('1024 2 private keys'), t) + testIt(rsa1024, Buffer.from('1024 keys'), t) + testIt(rsa2028, Buffer.from('2028 keys'), t) + testIt(nonrsa1024, Buffer.from('1024 keys non-rsa key'), t) + testIt(pass1024, Buffer.from('1024 keys and password'), t) + testIt(nonrsa1024str, Buffer.from('1024 keys non-rsa key as a string'), t) + testIt(pass2028, Buffer.from('2028 rsa key with variant passwords'), t) + }) +} + +var i = 0 +var num = 20 +while (++i <= num) { + testRun(i) +} diff --git a/node_modules/public-encrypt/test/nodeTests.js b/node_modules/public-encrypt/test/nodeTests.js new file mode 100644 index 000000000..f022e071c --- /dev/null +++ b/node_modules/public-encrypt/test/nodeTests.js @@ -0,0 +1,51 @@ +var crypto = require('../browser') +var test = require('tape') +var fs = require('fs') +var Buffer = require('safe-buffer').Buffer +var path = require('path') +// Test RSA encryption/decryption +test('node tests', function (t) { + var keyPem = fs.readFileSync(path.join(__dirname, 'test_key.pem'), 'ascii') + var rsaPubPem = fs.readFileSync(path.join(__dirname, 'test_rsa_pubkey.pem'), + 'ascii') + var rsaKeyPem = fs.readFileSync(path.join(__dirname, 'test_rsa_privkey.pem'), + 'ascii') + var rsaKeyPemEncrypted = fs.readFileSync(path.join( + __dirname, 'test_rsa_privkey_encrypted.pem'), 'ascii') + var input = 'I AM THE WALRUS' + var bufferToEncrypt = Buffer.from(input) + + var encryptedBuffer = crypto.publicEncrypt(rsaPubPem, bufferToEncrypt) + + var decryptedBuffer = crypto.privateDecrypt(rsaKeyPem, encryptedBuffer) + t.equal(input, decryptedBuffer.toString()) + + var decryptedBufferWithPassword = crypto.privateDecrypt({ + key: rsaKeyPemEncrypted, + passphrase: 'password' + }, encryptedBuffer) + t.equal(input, decryptedBufferWithPassword.toString()) + + // encryptedBuffer = crypto.publicEncrypt(certPem, bufferToEncrypt); + + // decryptedBuffer = crypto.privateDecrypt(keyPem, encryptedBuffer); + // t.equal(input, decryptedBuffer.toString()); + + encryptedBuffer = crypto.publicEncrypt(keyPem, bufferToEncrypt) + + decryptedBuffer = crypto.privateDecrypt(keyPem, encryptedBuffer) + t.equal(input, decryptedBuffer.toString()) + + encryptedBuffer = crypto.privateEncrypt(keyPem, bufferToEncrypt) + + decryptedBuffer = crypto.publicDecrypt(keyPem, encryptedBuffer) + t.equal(input, decryptedBuffer.toString()) + + t.throws(function () { + crypto.privateDecrypt({ + key: rsaKeyPemEncrypted, + passphrase: 'wrong' + }, encryptedBuffer) + }) + t.end() +}) diff --git a/node_modules/public-encrypt/test/pass.1024.priv b/node_modules/public-encrypt/test/pass.1024.priv new file mode 100644 index 000000000..b9f388450 --- /dev/null +++ b/node_modules/public-encrypt/test/pass.1024.priv @@ -0,0 +1,18 @@ +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIICzzBJBgkqhkiG9w0BBQ0wPDAbBgkqhkiG9w0BBQwwDgQIji3ZZ6JbsA4CAggA +MB0GCWCGSAFlAwQBFgQQC6MKblq8zyX90/KmgotsMQSCAoDghNf+yxPC/KRh7F3O +k0lMgtDkV+wCLDv7aBvUqy8Ry2zqFPIlfLb8XtSW943XEu6KUI13IZPEr8p9h1ve +Iye6L0g6uAgbFxBE2DwBBSI7mYr7lokr4v0k+inMKf4JeRdI9XWgwOILKTGf1vH7 +PhvBnqLhOg6BIOuF426qpiyYlmRda74d0Th4o6ZyhyMSzPI1XbWSg719Ew3N/tLe +OHdYl0eFrgNjq+xO4Ev+W7eNIh/XBMQtk9wo+mxeNdldRnX822HxTsL8fSSPs+9T +W5M/2EBTJMSsswSjZyFkq8ehtxovI2u0IBX1IiPulyUZLnSNPDV1eUVClK6rk+q1 +kVsfJhUr2qvIjNlQWlbEXQj4VwGtgl0++l8vdpj59MuN2J3Nx5TNMLjA6BYAa/tr +Bu928QoT7ET+SGx5XKCwKb5fwXmDlV5zZC4kZWTaF/d/Icvj5F+fDZuYFg1JOXNZ ++q2oA1qMYaHGX6lF3pbO84ebg1iwQTDM8iIqFeSMGUJTnk/3a7sqfaWQbEQwGb+X +fXnSTwkF+wO2rriPbFvWyzecWu67zDCP0ZWUgGb86sSJCM7xRGShESwCjOrb88F1 +5SZjyIqogrkc3IWiLH9gc5U8d86qoFjJnP6BfwYks1UIyXNGKfZTCqICpMphV+IS +b0N2jprjLTkWR6nxYGSH1bkKMs7x1M0FBLWWLAZqPn9X3pe6JwIBds04O6XjF0un +oxwDjcJdoxVs7PgRiM5d1Tubqu2zmpCCmXNiqi9B0+rV9/jHg9IA5gUfvYdCcEv+ +oAr90I+2+PuBFa9lgdbDV6DtZk4bSYluqamxVeLPg/vrewYfVfDv6jftfY1D0DEy +69H0 +-----END ENCRYPTED PRIVATE KEY----- diff --git a/node_modules/public-encrypt/test/pass.1024.pub b/node_modules/public-encrypt/test/pass.1024.pub new file mode 100644 index 000000000..617e7fb10 --- /dev/null +++ b/node_modules/public-encrypt/test/pass.1024.pub @@ -0,0 +1,6 @@ +-----BEGIN PUBLIC KEY----- +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDSK/7i5BV0x+gmX16Wrm7kRkCZ +y1QUt6wiM2g+SAZTYR0381VnSMX2cv7CpN3499lZj1rL5S7YTaZZwX3RvU5fz56/ +eDX6ciL/PZsbclN2KdkMWYgmcb9J1zUeoMQ3cjfFUCdQZ/ZvDWa+wY2Zg8os2Bow +AoufHtYHm3eOly/cWwIDAQAB +-----END PUBLIC KEY----- diff --git a/node_modules/public-encrypt/test/rsa.1024.priv b/node_modules/public-encrypt/test/rsa.1024.priv new file mode 100644 index 000000000..d3b5fdab6 --- /dev/null +++ b/node_modules/public-encrypt/test/rsa.1024.priv @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICVAIBAAJ/OwswbFo/uyC8ltGf/yA1A+gV5IGdnAgPbUSI3GzbHCA+x+TLG/tL +vbRw3r1smppY/jkkpiVW1ErSMuN0uixp5gb78Z9rH1XpWb5WWgp3WaY/9EHMjMdO +kQ/9LVZvRvl/M/Fi6owP+q+amJI1BEjECYfbhGL3rmlVdq4qXc40QwIDAQABAn8I +VZ0BPoAOhyF33KFMHxy8r28fsVgxJUYgM3NqQgdv4fFawCYXjhJz9duU5YJGFJGJ +WUGeHlkyYFlpi4f3m7tY7JawmQUWB0MNSoKHI3cgDX4/tfBN8ni+cO0eSoR5czBY +EsAHBU47p1awNFAHwd+ZEuv9H4RmMn7p279rQTtpAkAH3Nqs2/vrRF2cZUN4fIXf +4xHsQBByUayGq8a3J0UGaSFWv68zTUKFherr9uZotNp7NJ4jBXiARw0q8docXUG1 +AkAHgmOKHoORtAmikqpmFEJZOtsXMaLCIm4EszPo5ciYoLMBcVit09AdiQlt7ZJL +DY02svU1b0agCZ97kDkmHDkXAkACa8M9JELuDs/P/vIGYDkMVatIFfW6bWF02eFG +taWwMqCcSEsWvbw0xqYt34jURpNbCjmCyQVwYfAw/+TLhP9dAkAFwRjdwjw37qpj +ddg1mNiu37b7swFxmkiMOXZRxaNNsfb56A14RpN3zob3QdGUybGodMIKTFbmU/lu +CjqAxafJAkAG2yf6RWbwFIWfMyt7WYCh0VaGBCcgy574AinVieEo3ZZyFfC63+xm +3uoaNy4iLoJv4GCjqUBz3ZfcVaO/DDWG +-----END RSA PRIVATE KEY----- diff --git a/node_modules/public-encrypt/test/rsa.1024.pub b/node_modules/public-encrypt/test/rsa.1024.pub new file mode 100644 index 000000000..7ba06369b --- /dev/null +++ b/node_modules/public-encrypt/test/rsa.1024.pub @@ -0,0 +1,5 @@ +-----BEGIN RSA PUBLIC KEY----- +MIGGAn87CzBsWj+7ILyW0Z//IDUD6BXkgZ2cCA9tRIjcbNscID7H5Msb+0u9tHDe +vWyamlj+OSSmJVbUStIy43S6LGnmBvvxn2sfVelZvlZaCndZpj/0QcyMx06RD/0t +Vm9G+X8z8WLqjA/6r5qYkjUESMQJh9uEYveuaVV2ripdzjRDAgMBAAE= +-----END RSA PUBLIC KEY----- diff --git a/node_modules/public-encrypt/test/rsa.2028.priv b/node_modules/public-encrypt/test/rsa.2028.priv new file mode 100644 index 000000000..10e651d86 --- /dev/null +++ b/node_modules/public-encrypt/test/rsa.2028.priv @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEjwIBAAKB/gy7mjaWgPeFdVYDZWRCA9BNiv3pPb0es27+FKY0hszLaOw47ExC +tAWpDsH48TXAfyHBYwBLguayfk4LGIupxb+CGMbRo3xEp0CbfY1Jby26T9vGjRC1 +foHDDUJG84uaRbyHqaf4i6zt4gVR+xlAEIjkaFAAK8cOoXAT1CVqGLLljUCchL8P +jaHj/yriZ/S7rdwlI3LnABxwwmLrmR/v71WtpmO/aNG8N+1po+QwaghTkyQ59E/Z +vAuOkFWHok2q/R6PYAa2jdZ9zim0FqOP+nkQaEDRbBFBmBqTv5fFGfk2WsAfKf/R +G0/VFd+ZeM5251TeTvXH695nlSGauVl9AgMBAAECgf4LrWHY/l54ouThZWvvbrug +pfz6sJX2g9l7yXmWlEWsPECVo/7SUbpYFpt6OZy99zSg+IKbGqWKfdhoKrTwIVtC +L0YZ0NlmdnANSIz0roxQG7ZxkL5+vHSw/PmD9x4Uwf+Cz8hATCmNBv1qc60dkyuW +4CLqe72qaTiVWRoO1iagQghNcLoo6vSy65ExLaCDTPha7yu2vw4hFZpWiEjW4dxf +rFdLiix52BC86YlAlxME/rLg8IJVvilbyo9aWdXmxOaUTLRv6PkFD1/gVdw8V9Qr +SLN9FlK2kkjiX0dzoibvZw3tMnt3yydAx0X87+sMRVahC1bp3kVPz4Hy0EWX4QJ/ +PM31vGiuITk2NCd51DXt1Ltn2OP5FaJSmCaEjh0XkU4qouYyjXWt8Bu6BTCl2vua +Fg0Uji9C+IkPLmaUMbMIOwaTk8cWqLthSxsLe70J5OkGrgfKUM/w+BHH1Pt/Pjzj +C++l0kiFaOVDVaAV9GpLPLCBoK/PC9Rb/rxMMoCCNwJ/NZuedIny2w3LMii77h/T +zSvergNGhjY6Rnva8lLXJ6dlrkcPAyps3gWwxqj4NR0T+GM0bDUPVLb7M07XV7SX +v7VJGm52JbRGwM1ss+r8XTTNemeGk+WRxG7TgtsMqYGXLfB8Qxk/f5/Mcc00Tl8u +wXFNsfxJxmt6AbsTr3g36wJ/IhOnibz9Ad+nchlBnN3QeW3CKHqzaR18voqvtVm2 +kJfHK15prH/sSGmxmiEGgrCJTZxtDbaNCO7/VBjnKudUUIhCAwsLtuq0/zub9vAd +8G1scfIpv5qaSNzmKoX8bOwArvrS6wP7yKrcTsuWIlHD8rJVI7IEDnQoTp5G8fK1 +hwJ/MIh8M5v0r5dUYEv6oIJWGcle6AH1JmsP5WIafgq72Z2288pHcCFHwNY8Dg9J +76QswVLnUhPTlmm3EOOPGEtam2iAD5r0Afytlb4lbNoQsj2szeXONDXB+6oueajh +VNELUr8HcSP5lgzRZjJW6aFIzj9LDRmQnUAOjGSXVOQtEwJ/MCQZ7N/v4dIKeDRA +8d8UExZ3+gGHumziztGRJ0tQryZH2PakP5I7V+1l7qEUnJ2c3mF+e1v41Ep9LCvh +bzrPKw9dxh18g4b+7bMpsWPnsraKh6ipxc7aaOaZV0Dxgez4zcZu0P1olO0cN3KM +nxJ0Pds3R8bAhNCDdS2JZaRp5Q== +-----END RSA PRIVATE KEY----- diff --git a/node_modules/public-encrypt/test/rsa.2028.pub b/node_modules/public-encrypt/test/rsa.2028.pub new file mode 100644 index 000000000..b36dca4d6 --- /dev/null +++ b/node_modules/public-encrypt/test/rsa.2028.pub @@ -0,0 +1,8 @@ +-----BEGIN RSA PUBLIC KEY----- +MIIBBgKB/gy7mjaWgPeFdVYDZWRCA9BNiv3pPb0es27+FKY0hszLaOw47ExCtAWp +DsH48TXAfyHBYwBLguayfk4LGIupxb+CGMbRo3xEp0CbfY1Jby26T9vGjRC1foHD +DUJG84uaRbyHqaf4i6zt4gVR+xlAEIjkaFAAK8cOoXAT1CVqGLLljUCchL8PjaHj +/yriZ/S7rdwlI3LnABxwwmLrmR/v71WtpmO/aNG8N+1po+QwaghTkyQ59E/ZvAuO +kFWHok2q/R6PYAa2jdZ9zim0FqOP+nkQaEDRbBFBmBqTv5fFGfk2WsAfKf/RG0/V +Fd+ZeM5251TeTvXH695nlSGauVl9AgMBAAE= +-----END RSA PUBLIC KEY----- diff --git a/node_modules/public-encrypt/test/rsa.pass.priv b/node_modules/public-encrypt/test/rsa.pass.priv new file mode 100644 index 000000000..99e821352 --- /dev/null +++ b/node_modules/public-encrypt/test/rsa.pass.priv @@ -0,0 +1,30 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: AES-256-CBC,7A6A055AD675947A657041422F06D439 + +HQdjzAKUuqqKhZHmpzzY/monfqFhiHnZ5c24jtR9fM4aQJXf/e1fz6MEhyIz6XON +sb4CnXZstnxUuVWDkHEu6KWQ/dKALgiDUuT+UdMawVoVPGdgyWZp35pQPWi3fT2V +XZn58YkG8bO3Y403eZPyhadOefD1VtuFuK6/f90jjzx6ZDnwveXpYgFV7Jy1/pFd +cLLMf07C+hbk416nX6UVipWe4GH+ADFom5ZCfAaUotM7n8i149dULNF4YYi2wP31 +1YaDH5vf1CqiaieDY7xLzpEixwJz6ZEg3gLXaUvz2MpF8owiGI3eP0g7voWp3xt4 +TQx/qDURlaXiaRriWdWtpKyW1MFuJ5+KdNtR1/kXr2BLPB/ZLwyqtynUy8ZYpb4+ +WIRYpUGeb//ZHGhlCH7CRMdABsal4wTwnzi9fW4Ax96ecJ2SlwCuKxwS7iEq2y1/ +FAfGwsE+XufHhme5p6XjKfiHx+zJMIB2NMkrm+wm4PbMTrGVnw5/41/r6XxOB8fe +iKi12Jth4dusc1vYGYfzKop9uEM6CZ6+Chqzb+Zyh/xUiZVlCX/BYnxr7yXUm9aR +PHQgxkn2Act8FgQB3Kgs3jCiCRIJrlsnybeWzQ3YO9TjC4MxygmmwODDBpsOKnEi +kXXS54+cZFjcsva4uJVwhAywRPVUkLzmTkH0tGiwCHjeQNECm+TLahkkEIXrVTb9 +c9creNXMgE6jVVz+R43HXsGvTcgMcBLyFRQJe2nVaj/dQ5JbF4uqNnQzRjAbD34K +uTpFaJ/kmlgcmeScRLnwaoYwFlmhSC+bK0dfY1Jr6AQRA6IDP7nIjqWNDCHNBB8r +Qj1v2KWoVQe3xNHaXhkbJPbA2DKlUIqffkBVtMKtt9KuG3Rccf3bVYAW6oid73/D +z7DMAF5G/OpVR8VbGh1WxXuR7zEVDUwpwsp9ek5dqN8BnBz1ppdZNIKqzszneckU +s2l/6mZBmgV1Nfy/cQU6U5s3S1Xc75UDQVLms3CIOpFTRIpecNTdfa31fYy/svy0 +M2lWTbCva0dOyuvMUhTgBL4I7Qa2dUMPXHMZatV5ooHYq/BZJA1r84C5cM5r+umE +2LLv/BlUr7RaQHhaKGn4Qhpzo5yRDE9mEqDpLVkbg8SxMsdf/pEF5/VyUwA9t8RT +fKVsInRd386tDqJSDbSFqKTvLztr/5YCyzZzvC2YB1voko/caOGd2d/G51Ij+bXU +xEN8U4fHDBsHwPUGb31uZUhTXpL37KiOqZmXFoH2usmuvx882XvyGcV0F4tstMaR +KLKzl2PwqzAYGFexLkYKMz0TYIeN6h3b86ETazPPU49nkaEU23Dx21J2Rb3UlH+I +lDQF3wuH1QlYiTnlcVa/Zu4QQg0/iP8ALkZ06mvn9e9mOtnA8gsh4B2oLqc19VLU +bcpv40dV1H3W9Lcx9B8JYUp0c/Oyno1D7Yj3tjGcwMKECmUpHi4kksehVo0/P933 +xmFmC6eyWYVdO9upvY/vKSB7b1dMt85iWr3gnMsSfRYc6jsbSxdjOPST46UsIzjx +wa1DS6+Bv5tiaC4uC6X+0tCAZo+UOQMYUbTGRR/7g/c= +-----END RSA PRIVATE KEY----- diff --git a/node_modules/public-encrypt/test/rsa.pass.pub b/node_modules/public-encrypt/test/rsa.pass.pub new file mode 100644 index 000000000..655cc3a4d --- /dev/null +++ b/node_modules/public-encrypt/test/rsa.pass.pub @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBHjANBgkqhkiG9w0BAQEFAAOCAQsAMIIBBgKB/gy7mjaWgPeFdVYDZWRCA9BN +iv3pPb0es27+FKY0hszLaOw47ExCtAWpDsH48TXAfyHBYwBLguayfk4LGIupxb+C +GMbRo3xEp0CbfY1Jby26T9vGjRC1foHDDUJG84uaRbyHqaf4i6zt4gVR+xlAEIjk +aFAAK8cOoXAT1CVqGLLljUCchL8PjaHj/yriZ/S7rdwlI3LnABxwwmLrmR/v71Wt +pmO/aNG8N+1po+QwaghTkyQ59E/ZvAuOkFWHok2q/R6PYAa2jdZ9zim0FqOP+nkQ +aEDRbBFBmBqTv5fFGfk2WsAfKf/RG0/VFd+ZeM5251TeTvXH695nlSGauVl9AgMB +AAE= +-----END PUBLIC KEY----- diff --git a/node_modules/public-encrypt/test/test_cert.pem b/node_modules/public-encrypt/test/test_cert.pem new file mode 100644 index 000000000..a3c1e4a0a --- /dev/null +++ b/node_modules/public-encrypt/test/test_cert.pem @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDXDCCAsWgAwIBAgIJAKL0UG+mRkSPMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNV +BAYTAlVLMRQwEgYDVQQIEwtBY2tuYWNrIEx0ZDETMBEGA1UEBxMKUmh5cyBKb25l +czEQMA4GA1UEChMHbm9kZS5qczEdMBsGA1UECxMUVGVzdCBUTFMgQ2VydGlmaWNh +dGUxEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0wOTExMTEwOTUyMjJaFw0yOTExMDYw +OTUyMjJaMH0xCzAJBgNVBAYTAlVLMRQwEgYDVQQIEwtBY2tuYWNrIEx0ZDETMBEG +A1UEBxMKUmh5cyBKb25lczEQMA4GA1UEChMHbm9kZS5qczEdMBsGA1UECxMUVGVz +dCBUTFMgQ2VydGlmaWNhdGUxEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG +9w0BAQEFAAOBjQAwgYkCgYEA8d8Hc6atq78Jt1HLp9agA/wpQfsFvkYUdZ1YsdvO +kL2janjwHQgMMCy/Njal3FUEW0OLPebKZUJ8L44JBXSlVxU4zyiiSOWld8EkTetR +AVT3WKQq3ud+cnxv7g8rGRQp1UHZwmdbZ1wEfAYq8QjYx6m1ciMgRo7DaDQhD29k +d+UCAwEAAaOB4zCB4DAdBgNVHQ4EFgQUL9miTJn+HKNuTmx/oMWlZP9cd4QwgbAG +A1UdIwSBqDCBpYAUL9miTJn+HKNuTmx/oMWlZP9cd4ShgYGkfzB9MQswCQYDVQQG +EwJVSzEUMBIGA1UECBMLQWNrbmFjayBMdGQxEzARBgNVBAcTClJoeXMgSm9uZXMx +EDAOBgNVBAoTB25vZGUuanMxHTAbBgNVBAsTFFRlc3QgVExTIENlcnRpZmljYXRl +MRIwEAYDVQQDEwlsb2NhbGhvc3SCCQCi9FBvpkZEjzAMBgNVHRMEBTADAQH/MA0G +CSqGSIb3DQEBBQUAA4GBADRXXA2xSUK5W1i3oLYWW6NEDVWkTQ9RveplyeS9MOkP +e7yPcpz0+O0ZDDrxR9chAiZ7fmdBBX1Tr+pIuCrG/Ud49SBqeS5aMJGVwiSd7o1n +dhU2Sz3Q60DwJEL1VenQHiVYlWWtqXBThe9ggqRPnCfsCRTP8qifKkjk45zWPcpN +-----END CERTIFICATE----- diff --git a/node_modules/public-encrypt/test/test_key.pem b/node_modules/public-encrypt/test/test_key.pem new file mode 100644 index 000000000..48fd93c99 --- /dev/null +++ b/node_modules/public-encrypt/test/test_key.pem @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQDx3wdzpq2rvwm3Ucun1qAD/ClB+wW+RhR1nVix286QvaNqePAd +CAwwLL82NqXcVQRbQ4s95splQnwvjgkFdKVXFTjPKKJI5aV3wSRN61EBVPdYpCre +535yfG/uDysZFCnVQdnCZ1tnXAR8BirxCNjHqbVyIyBGjsNoNCEPb2R35QIDAQAB +AoGBAJNem9C4ftrFNGtQ2DB0Udz7uDuucepkErUy4MbFsc947GfENjDKJXr42Kx0 +kYx09ImS1vUpeKpH3xiuhwqe7tm4FsCBg4TYqQle14oxxm7TNeBwwGC3OB7hiokb +aAjbPZ1hAuNs6ms3Ybvvj6Lmxzx42m8O5DXCG2/f+KMvaNUhAkEA/ekrOsWkNoW9 +2n3m+msdVuxeek4B87EoTOtzCXb1dybIZUVv4J48VAiM43hhZHWZck2boD/hhwjC +M5NWd4oY6QJBAPPcgBVNdNZSZ8hR4ogI4nzwWrQhl9MRbqqtfOn2TK/tjMv10ALg +lPmn3SaPSNRPKD2hoLbFuHFERlcS79pbCZ0CQQChX3PuIna/gDitiJ8oQLOg7xEM +wk9TRiDK4kl2lnhjhe6PDpaQN4E4F0cTuwqLAoLHtrNWIcOAQvzKMrYdu1MhAkBm +Et3qDMnjDAs05lGT72QeN90/mPAcASf5eTTYGahv21cb6IBxM+AnwAPpqAAsHhYR +9h13Y7uYbaOjvuF23LRhAkBoI9eaSMn+l81WXOVUHnzh3ZwB4GuTyxMXXNOhuiFd +0z4LKAMh99Z4xQmqSoEkXsfM4KPpfhYjF/bwIcP5gOei +-----END RSA PRIVATE KEY----- diff --git a/node_modules/public-encrypt/test/test_rsa_privkey.pem b/node_modules/public-encrypt/test/test_rsa_privkey.pem new file mode 100644 index 000000000..425518a06 --- /dev/null +++ b/node_modules/public-encrypt/test/test_rsa_privkey.pem @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXgIBAAKBgQDCFENGw33yGihy92pDjZQhl0C36rPJj+CvfSC8+q28hxA161QF +NUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6Z4UMR7EOcpfdUE9Hf3m/hs+F +UR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJwoYi+1hqp1fIekaxsyQIDAQAB +AoGBAJR8ZkCUvx5kzv+utdl7T5MnordT1TvoXXJGXK7ZZ+UuvMNUCdN2QPc4sBiA +QWvLw1cSKt5DsKZ8UETpYPy8pPYnnDEz2dDYiaew9+xEpubyeW2oH4Zx71wqBtOK +kqwrXa/pzdpiucRRjk6vE6YY7EBBs/g7uanVpGibOVAEsqH1AkEA7DkjVH28WDUg +f1nqvfn2Kj6CT7nIcE3jGJsZZ7zlZmBmHFDONMLUrXR/Zm3pR5m0tCmBqa5RK95u +412jt1dPIwJBANJT3v8pnkth48bQo/fKel6uEYyboRtA5/uHuHkZ6FQF7OUkGogc +mSJluOdc5t6hI1VsLn0QZEjQZMEOWr+wKSMCQQCC4kXJEsHAve77oP6HtG/IiEn7 +kpyUXRNvFsDE0czpJJBvL/aRFUJxuRK91jhjC68sA7NsKMGg5OXb5I5Jj36xAkEA +gIT7aFOYBFwGgQAQkWNKLvySgKbAZRTeLBacpHMuQdl1DfdntvAyqpAZ0lY0RKmW +G6aFKaqQfOXKCyWoUiVknQJAXrlgySFci/2ueKlIE1QqIiLSZ8V8OlpFLRnb1pzI +7U1yQXnTAEFYM560yJlzUpOb1V4cScGd365tiSMvxLOvTA== +-----END RSA PRIVATE KEY----- diff --git a/node_modules/public-encrypt/test/test_rsa_privkey_encrypted.pem b/node_modules/public-encrypt/test/test_rsa_privkey_encrypted.pem new file mode 100644 index 000000000..08e761719 --- /dev/null +++ b/node_modules/public-encrypt/test/test_rsa_privkey_encrypted.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: AES-128-CBC,9D916E00476DFF9E70FA4BA9E3A6CB0E + +oj0VC35ShSEqlfJ0rLGgkqJCyIK+mXSsa/X/xAur+lI/RVOVTWd7oQQGTdI/0rLX +PdQR02Na3X9Rptezh6J04PfMGeFysxdT6RpC+rkHRPVbN0F4TqxSNNXzkwK70+EF +dSuDMyVKv9YN4wWDf0g6VKe4ShAH/sqICQBrVyzWyYLvH/hwZmZZ1QEab6ylIKtb +EJunwu9BxVVA04bbuATKkKjJOqDn0fG8hb4bYbyD02dJwgLePzzn36F31kcBCEHI +tESlD3RsS+EtfpfgPkplXNOhqYzkD9auDb7Zy+ZwL20fjnJb75OSGu8gOg3KTljt +mApZOg0nJ5Jk9ATAdyzyVSFOM1Hhcw12ws06Dq9KRnXgO6bbuadLTFRDdvSYDFvD +ijUb+97UolQfYIXQMqXli3EIvHr7CTWe/3mpoDgK1mtr0+923Bm97XgE7KSr0L46 +n5QpNjCZf1vbXldNmW+TRifiJMgtVdS7x0N4vqDPNEe+FelVv3U4Pz3HIOtFuWLr +ZCxlgVxJY4IsyYlV0ItQjIv8fJiAyemZdO2lA9K6h0eEF+9Apr3i79JGWUi74p5D +Ooak4le0Va9O34f6FxCGn/a54A6bhKu24Ub/0gr/e4WRa7693euEdgIAZXhtMu2Z +taU5SKjjXPzjmRCM2kINHTCENlaU4oFzTmj3TYY/jdKyNP1bHa07NhlomladkIHK +GD6HaYkcbuwvh8hOPsopSwuS+NqjnGPq9Vv4ecBC+9veDEmpIE1iR6FK9Hjrre88 +kLoMQNmA+vuc8jG4/FIHM3SauQiR1ZJ6+zkz97kcmOf+X7LRaS4j6lfFR6qHiJ6y +-----END RSA PRIVATE KEY----- diff --git a/node_modules/public-encrypt/test/test_rsa_pubkey.pem b/node_modules/public-encrypt/test/test_rsa_pubkey.pem new file mode 100644 index 000000000..b3bbf6cb9 --- /dev/null +++ b/node_modules/public-encrypt/test/test_rsa_pubkey.pem @@ -0,0 +1,6 @@ +-----BEGIN PUBLIC KEY----- +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCFENGw33yGihy92pDjZQhl0C3 +6rPJj+CvfSC8+q28hxA161QFNUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6 +Z4UMR7EOcpfdUE9Hf3m/hs+FUR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJw +oYi+1hqp1fIekaxsyQIDAQAB +-----END PUBLIC KEY----- diff --git a/node_modules/public-encrypt/withPublic.js b/node_modules/public-encrypt/withPublic.js new file mode 100644 index 000000000..417a1bf7b --- /dev/null +++ b/node_modules/public-encrypt/withPublic.js @@ -0,0 +1,12 @@ +var BN = require('bn.js') +var Buffer = require('safe-buffer').Buffer + +function withPublic (paddedMsg, key) { + return Buffer.from(paddedMsg + .toRed(BN.mont(key.modulus)) + .redPow(new BN(key.publicExponent)) + .fromRed() + .toArray()) +} + +module.exports = withPublic diff --git a/node_modules/public-encrypt/xor.js b/node_modules/public-encrypt/xor.js new file mode 100644 index 000000000..10d2764e8 --- /dev/null +++ b/node_modules/public-encrypt/xor.js @@ -0,0 +1,8 @@ +module.exports = function xor (a, b) { + var len = a.length + var i = -1 + while (++i < len) { + a[i] ^= b[i] + } + return a +} diff --git a/node_modules/punycode/LICENSE-MIT.txt b/node_modules/punycode/LICENSE-MIT.txt new file mode 100644 index 000000000..a41e0a7ef --- /dev/null +++ b/node_modules/punycode/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/punycode/README.md b/node_modules/punycode/README.md new file mode 100644 index 000000000..7ad7d1faa --- /dev/null +++ b/node_modules/punycode/README.md @@ -0,0 +1,176 @@ +# Punycode.js [![Build status](https://travis-ci.org/bestiejs/punycode.js.svg?branch=master)](https://travis-ci.org/bestiejs/punycode.js) [![Code coverage status](http://img.shields.io/coveralls/bestiejs/punycode.js/master.svg)](https://coveralls.io/r/bestiejs/punycode.js) [![Dependency status](https://gemnasium.com/bestiejs/punycode.js.svg)](https://gemnasium.com/bestiejs/punycode.js) + +A robust Punycode converter that fully complies to [RFC 3492](https://tools.ietf.org/html/rfc3492) and [RFC 5891](https://tools.ietf.org/html/rfc5891), and works on nearly all JavaScript platforms. + +This JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm: + +* [The C example code from RFC 3492](https://tools.ietf.org/html/rfc3492#appendix-C) +* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c) +* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c) +* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287) +* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072)) + +This project is [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with [Node.js v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc) and [io.js v1.0.0+](https://github.com/iojs/io.js/blob/v1.x/lib/punycode.js). + +## Installation + +Via [npm](https://www.npmjs.com/) (only required for Node.js releases older than v0.6.2): + +```bash +npm install punycode +``` + +Via [Bower](http://bower.io/): + +```bash +bower install punycode +``` + +Via [Component](https://github.com/component/component): + +```bash +component install bestiejs/punycode.js +``` + +In a browser: + +```html + +``` + +In [Node.js](https://nodejs.org/), [io.js](https://iojs.org/), [Narwhal](http://narwhaljs.org/), and [RingoJS](http://ringojs.org/): + +```js +var punycode = require('punycode'); +``` + +In [Rhino](http://www.mozilla.org/rhino/): + +```js +load('punycode.js'); +``` + +Using an AMD loader like [RequireJS](http://requirejs.org/): + +```js +require( + { + 'paths': { + 'punycode': 'path/to/punycode' + } + }, + ['punycode'], + function(punycode) { + console.log(punycode); + } +); +``` + +## API + +### `punycode.decode(string)` + +Converts a Punycode string of ASCII symbols to a string of Unicode symbols. + +```js +// decode domain name parts +punycode.decode('maana-pta'); // 'mañana' +punycode.decode('--dqo34k'); // '☃-⌘' +``` + +### `punycode.encode(string)` + +Converts a string of Unicode symbols to a Punycode string of ASCII symbols. + +```js +// encode domain name parts +punycode.encode('mañana'); // 'maana-pta' +punycode.encode('☃-⌘'); // '--dqo34k' +``` + +### `punycode.toUnicode(input)` + +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. + +```js +// decode domain names +punycode.toUnicode('xn--maana-pta.com'); +// → 'mañana.com' +punycode.toUnicode('xn----dqo34k.com'); +// → '☃-⌘.com' + +// decode email addresses +punycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'); +// → 'джумла@джpумлатест.bрфa' +``` + +### `punycode.toASCII(input)` + +Converts a lowercased Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that’s already in ASCII. + +```js +// encode domain names +punycode.toASCII('mañana.com'); +// → 'xn--maana-pta.com' +punycode.toASCII('☃-⌘.com'); +// → 'xn----dqo34k.com' + +// encode email addresses +punycode.toASCII('джумла@джpумлатест.bрфa'); +// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq' +``` + +### `punycode.ucs2` + +#### `punycode.ucs2.decode(string)` + +Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), 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. + +```js +punycode.ucs2.decode('abc'); +// → [0x61, 0x62, 0x63] +// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE: +punycode.ucs2.decode('\uD834\uDF06'); +// → [0x1D306] +``` + +#### `punycode.ucs2.encode(codePoints)` + +Creates a string based on an array of numeric code point values. + +```js +punycode.ucs2.encode([0x61, 0x62, 0x63]); +// → 'abc' +punycode.ucs2.encode([0x1D306]); +// → '\uD834\uDF06' +``` + +### `punycode.version` + +A string representing the current Punycode.js version number. + +## Unit tests & code coverage + +After cloning this repository, run `npm install --dev` to install the dependencies needed for Punycode.js development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`. + +Once that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, PhantomJS, and web browsers as well, use `grunt test`. + +To generate the code coverage report, use `grunt cover`. + +Feel free to fork if you see possible improvements! + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## Contributors + +| [![twitter/jdalton](https://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## License + +Punycode.js is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/punycode/package.json b/node_modules/punycode/package.json new file mode 100644 index 000000000..2fc07acf8 --- /dev/null +++ b/node_modules/punycode/package.json @@ -0,0 +1,87 @@ +{ + "_from": "punycode@^1.3.2", + "_id": "punycode@1.4.1", + "_inBundle": false, + "_integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "_location": "/punycode", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "punycode@^1.3.2", + "name": "punycode", + "escapedName": "punycode", + "rawSpec": "^1.3.2", + "saveSpec": null, + "fetchSpec": "^1.3.2" + }, + "_requiredBy": [ + "/browserify" + ], + "_resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "_shasum": "c0d5a63b2718800ad8e1eb0fa5269c84dd41845e", + "_spec": "punycode@^1.3.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "bugs": { + "url": "https://github.com/bestiejs/punycode.js/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + { + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + } + ], + "deprecated": false, + "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", + "devDependencies": { + "coveralls": "^2.11.4", + "grunt": "^0.4.5", + "grunt-contrib-uglify": "^0.11.0", + "grunt-shell": "^1.1.2", + "istanbul": "^0.4.1", + "qunit-extras": "^1.4.4", + "qunitjs": "~1.11.0", + "requirejs": "^2.1.22" + }, + "files": [ + "LICENSE-MIT.txt", + "punycode.js" + ], + "homepage": "https://mths.be/punycode", + "jspm": { + "map": { + "./punycode.js": { + "node": "@node/punycode" + } + } + }, + "keywords": [ + "punycode", + "unicode", + "idn", + "idna", + "dns", + "url", + "domain" + ], + "license": "MIT", + "main": "punycode.js", + "name": "punycode", + "repository": { + "type": "git", + "url": "git+https://github.com/bestiejs/punycode.js.git" + }, + "scripts": { + "test": "node tests/tests.js" + }, + "version": "1.4.1" +} diff --git a/node_modules/punycode/punycode.js b/node_modules/punycode/punycode.js new file mode 100644 index 000000000..2c87f6cc4 --- /dev/null +++ b/node_modules/punycode/punycode.js @@ -0,0 +1,533 @@ +/*! https://mths.be/punycode v1.4.1 by @mathias */ +;(function(root) { + + /** Detect free variables */ + var freeExports = typeof exports == 'object' && exports && + !exports.nodeType && exports; + var freeModule = typeof module == 'object' && 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 ( + typeof define == 'function' && + typeof define.amd == 'object' && + define.amd + ) { + define('punycode', function() { + return punycode; + }); + } else if (freeExports && freeModule) { + if (module.exports == freeExports) { + // in Node.js, io.js, or RingoJS v0.8.0+ + freeModule.exports = punycode; + } else { + // in Narwhal or RingoJS v0.7.0- + for (key in punycode) { + punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); + } + } + } else { + // in Rhino or a web browser + root.punycode = punycode; + } + +}(this)); diff --git a/node_modules/query-string/index.js b/node_modules/query-string/index.js new file mode 100644 index 000000000..2d22df2a7 --- /dev/null +++ b/node_modules/query-string/index.js @@ -0,0 +1,205 @@ +'use strict'; +var strictUriEncode = require('strict-uri-encode'); +var objectAssign = require('object-assign'); + +function encoderForArrayFormat(opts) { + switch (opts.arrayFormat) { + case 'index': + return function (key, value, index) { + return value === null ? [ + encode(key, opts), + '[', + index, + ']' + ].join('') : [ + encode(key, opts), + '[', + encode(index, opts), + ']=', + encode(value, opts) + ].join(''); + }; + + case 'bracket': + return function (key, value) { + return value === null ? encode(key, opts) : [ + encode(key, opts), + '[]=', + encode(value, opts) + ].join(''); + }; + + default: + return function (key, value) { + return value === null ? encode(key, opts) : [ + encode(key, opts), + '=', + encode(value, opts) + ].join(''); + }; + } +} + +function parserForArrayFormat(opts) { + var result; + + switch (opts.arrayFormat) { + case 'index': + return function (key, value, accumulator) { + result = /\[(\d*)\]$/.exec(key); + + key = key.replace(/\[\d*\]$/, ''); + + if (!result) { + accumulator[key] = value; + return; + } + + if (accumulator[key] === undefined) { + accumulator[key] = {}; + } + + accumulator[key][result[1]] = value; + }; + + case 'bracket': + return function (key, value, accumulator) { + result = /(\[\])$/.exec(key); + key = key.replace(/\[\]$/, ''); + + if (!result) { + accumulator[key] = value; + return; + } else if (accumulator[key] === undefined) { + accumulator[key] = [value]; + return; + } + + accumulator[key] = [].concat(accumulator[key], value); + }; + + default: + return function (key, value, accumulator) { + if (accumulator[key] === undefined) { + accumulator[key] = value; + return; + } + + accumulator[key] = [].concat(accumulator[key], value); + }; + } +} + +function encode(value, opts) { + if (opts.encode) { + return opts.strict ? strictUriEncode(value) : encodeURIComponent(value); + } + + return value; +} + +function keysSorter(input) { + if (Array.isArray(input)) { + return input.sort(); + } else if (typeof input === 'object') { + return keysSorter(Object.keys(input)).sort(function (a, b) { + return Number(a) - Number(b); + }).map(function (key) { + return input[key]; + }); + } + + return input; +} + +exports.extract = function (str) { + return str.split('?')[1] || ''; +}; + +exports.parse = function (str, opts) { + opts = objectAssign({arrayFormat: 'none'}, opts); + + var formatter = parserForArrayFormat(opts); + + // Create an object with no prototype + // https://github.com/sindresorhus/query-string/issues/47 + var ret = Object.create(null); + + if (typeof str !== 'string') { + return ret; + } + + str = str.trim().replace(/^(\?|#|&)/, ''); + + if (!str) { + return ret; + } + + str.split('&').forEach(function (param) { + var parts = param.replace(/\+/g, ' ').split('='); + // Firefox (pre 40) decodes `%3D` to `=` + // https://github.com/sindresorhus/query-string/pull/37 + var key = parts.shift(); + var val = parts.length > 0 ? parts.join('=') : undefined; + + // missing `=` should be `null`: + // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters + val = val === undefined ? null : decodeURIComponent(val); + + formatter(decodeURIComponent(key), val, ret); + }); + + return Object.keys(ret).sort().reduce(function (result, key) { + var val = ret[key]; + if (Boolean(val) && typeof val === 'object' && !Array.isArray(val)) { + // Sort object keys, not values + result[key] = keysSorter(val); + } else { + result[key] = val; + } + + return result; + }, Object.create(null)); +}; + +exports.stringify = function (obj, opts) { + var defaults = { + encode: true, + strict: true, + arrayFormat: 'none' + }; + + opts = objectAssign(defaults, opts); + + var formatter = encoderForArrayFormat(opts); + + return obj ? Object.keys(obj).sort().map(function (key) { + var val = obj[key]; + + if (val === undefined) { + return ''; + } + + if (val === null) { + return encode(key, opts); + } + + if (Array.isArray(val)) { + var result = []; + + val.slice().forEach(function (val2) { + if (val2 === undefined) { + return; + } + + result.push(formatter(key, val2, result.length)); + }); + + return result.join('&'); + } + + return encode(key, opts) + '=' + encode(val, opts); + }).filter(function (x) { + return x.length > 0; + }).join('&') : ''; +}; diff --git a/node_modules/query-string/license b/node_modules/query-string/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/query-string/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/query-string/package.json b/node_modules/query-string/package.json new file mode 100644 index 000000000..73b2ff1be --- /dev/null +++ b/node_modules/query-string/package.json @@ -0,0 +1,76 @@ +{ + "_from": "query-string@^4.2.3", + "_id": "query-string@4.3.4", + "_inBundle": false, + "_integrity": "sha1-u7aTucqRXCMlFbIosaArYJBD2+s=", + "_location": "/query-string", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "query-string@^4.2.3", + "name": "query-string", + "escapedName": "query-string", + "rawSpec": "^4.2.3", + "saveSpec": null, + "fetchSpec": "^4.2.3" + }, + "_requiredBy": [ + "/reload-css" + ], + "_resolved": "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz", + "_shasum": "bbb693b9ca915c232515b228b1a02b609043dbeb", + "_spec": "query-string@^4.2.3", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/reload-css", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/query-string/issues" + }, + "bundleDependencies": false, + "dependencies": { + "object-assign": "^4.1.0", + "strict-uri-encode": "^1.0.0" + }, + "deprecated": false, + "description": "Parse and stringify URL query strings", + "devDependencies": { + "ava": "^0.17.0", + "xo": "^0.16.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/query-string#readme", + "keywords": [ + "browser", + "querystring", + "query", + "string", + "qs", + "param", + "parameter", + "url", + "uri", + "parse", + "stringify", + "encode", + "decode" + ], + "license": "MIT", + "name": "query-string", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/query-string.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "4.3.4" +} diff --git a/node_modules/query-string/readme.md b/node_modules/query-string/readme.md new file mode 100644 index 000000000..f8ac0da30 --- /dev/null +++ b/node_modules/query-string/readme.md @@ -0,0 +1,184 @@ +# query-string [![Build Status](https://travis-ci.org/sindresorhus/query-string.svg?branch=master)](https://travis-ci.org/sindresorhus/query-string) + +> Parse and stringify URL [query strings](http://en.wikipedia.org/wiki/Query_string) + +--- + +

    🔥 Want to strengthen your core JavaScript skills and master ES6?
    I would personally recommend this awesome ES6 course by Wes Bos. You might also like his React course.

    + +--- + + +## Install + +``` +$ npm install --save query-string +``` + + +## Usage + +```js +const queryString = require('query-string'); + +console.log(location.search); +//=> '?foo=bar' + +const parsed = queryString.parse(location.search); +console.log(parsed); +//=> {foo: 'bar'} + +console.log(location.hash); +//=> '#token=bada55cafe' + +const parsedHash = queryString.parse(location.hash); +console.log(parsedHash); +//=> {token: 'bada55cafe'} + +parsed.foo = 'unicorn'; +parsed.ilike = 'pizza'; + +const stringified = queryString.stringify(parsed); +//=> 'foo=unicorn&ilike=pizza' + +location.search = stringified; +// note that `location.search` automatically prepends a question mark +console.log(location.search); +//=> '?foo=unicorn&ilike=pizza' +``` + + +## API + +### .parse(*string*, *[options]*) + +Parse a query string into an object. Leading `?` or `#` are ignored, so you can pass `location.search` or `location.hash` directly. + +The returned object is created with [`Object.create(null)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) and thus does not have a `prototype`. + +#### arrayFormat + +Type: `string`
    +Default: `'none'` + +Supports both `index` for an indexed array representation or `bracket` for a *bracketed* array representation. + +- `bracket`: stands for parsing correctly arrays with bracket representation on the query string, such as: + +```js +queryString.parse('foo[]=1&foo[]=2&foo[]=3', {arrayFormat: 'bracket'}); +//=> foo: [1,2,3] +``` + +- `index`: stands for parsing taking the index into account, such as: + +```js +queryString.parse('foo[0]=1&foo[1]=2&foo[3]=3', {arrayFormat: 'index'}); +//=> foo: [1,2,3] +``` + +- `none`: is the **default** option and removes any bracket representation, such as: + +```js +queryString.parse('foo=1&foo=2&foo=3'); +//=> foo: [1,2,3] +``` + +### .stringify(*object*, *[options]*) + +Stringify an object into a query string, sorting the keys. + +#### strict + +Type: `boolean`
    +Default: `true` + +Strictly encode URI components with [strict-uri-encode](https://github.com/kevva/strict-uri-encode). It uses [encodeURIComponent](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) +if set to false. You probably [don't care](https://github.com/sindresorhus/query-string/issues/42) about this option. + +#### encode + +Type: `boolean`
    +Default: `true` + +[URL encode](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) the keys and values. + +#### arrayFormat + +Type: `string`
    +Default: `'none'` + +Supports both `index` for an indexed array representation or `bracket` for a *bracketed* array representation. + +- `bracket`: stands for parsing correctly arrays with bracket representation on the query string, such as: + +```js +queryString.stringify({foo: [1,2,3]}, {arrayFormat: 'bracket'}); +// => foo[]=1&foo[]=2&foo[]=3 +``` + +- `index`: stands for parsing taking the index into account, such as: + +```js +queryString.stringify({foo: [1,2,3]}, {arrayFormat: 'index'}); +// => foo[0]=1&foo[1]=2&foo[3]=3 +``` + +- `none`: is the __default__ option and removes any bracket representation, such as: + +```js +queryString.stringify({foo: [1,2,3]}); +// => foo=1&foo=2&foo=3 +``` + +### .extract(*string*) + +Extract a query string from a URL that can be passed into `.parse()`. + + +## Nesting + +This module intentionally doesn't support nesting as it's not spec'd and varies between implementations, which causes a lot of [edge cases](https://github.com/visionmedia/node-querystring/issues). + +You're much better off just converting the object to a JSON string: + +```js +queryString.stringify({ + foo: 'bar', + nested: JSON.stringify({ + unicorn: 'cake' + }) +}); +//=> 'foo=bar&nested=%7B%22unicorn%22%3A%22cake%22%7D' +``` + +However, there is support for multiple instances of the same key: + +```js +queryString.parse('likes=cake&name=bob&likes=icecream'); +//=> {likes: ['cake', 'icecream'], name: 'bob'} + +queryString.stringify({color: ['taupe', 'chartreuse'], id: '515'}); +//=> 'color=chartreuse&color=taupe&id=515' +``` + + +## Falsy values + +Sometimes you want to unset a key, or maybe just make it present without assigning a value to it. Here is how falsy values are stringified: + +```js +queryString.stringify({foo: false}); +//=> 'foo=false' + +queryString.stringify({foo: null}); +//=> 'foo' + +queryString.stringify({foo: undefined}); +//=> '' +``` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/querystring-es3/.travis.yml b/node_modules/querystring-es3/.travis.yml new file mode 100644 index 000000000..895dbd362 --- /dev/null +++ b/node_modules/querystring-es3/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.6 + - 0.8 diff --git a/node_modules/querystring-es3/History.md b/node_modules/querystring-es3/History.md new file mode 100644 index 000000000..4fddbaf78 --- /dev/null +++ b/node_modules/querystring-es3/History.md @@ -0,0 +1,20 @@ +# 0.2.0 / 2013-02-21 + + - Refactor into function per-module idiomatic style. + - Improved test coverage. + +# 0.1.0 / 2011-12-13 + + - Minor project reorganization + +# 0.0.3 / 2011-04-16 + - Support for AMD module loaders + +# 0.0.2 / 2011-04-16 + + - Ported unit tests + - Removed functionality that depended on Buffers + +# 0.0.1 / 2011-04-15 + + - Initial release diff --git a/node_modules/querystring-es3/License.md b/node_modules/querystring-es3/License.md new file mode 100644 index 000000000..fc80e85f2 --- /dev/null +++ b/node_modules/querystring-es3/License.md @@ -0,0 +1,19 @@ + +Copyright 2012 Irakli Gozalishvili. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/node_modules/querystring-es3/Readme.md b/node_modules/querystring-es3/Readme.md new file mode 100644 index 000000000..be1668df0 --- /dev/null +++ b/node_modules/querystring-es3/Readme.md @@ -0,0 +1,15 @@ +# querystring + +[![Build Status](https://secure.travis-ci.org/mike-spainhower/querystring.png)](http://travis-ci.org/mike-spainhower/querystring) + + +[![Browser support](http://ci.testling.com/mike-spainhower/querystring.png)](http://ci.testling.com/mike-spainhower/querystring) + + + +Node's querystring module for all engines. + +## Install ## + + npm install querystring + diff --git a/node_modules/querystring-es3/decode.js b/node_modules/querystring-es3/decode.js new file mode 100644 index 000000000..b5825c0b7 --- /dev/null +++ b/node_modules/querystring-es3/decode.js @@ -0,0 +1,84 @@ +// 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. + +'use strict'; + +// 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]'; +}; diff --git a/node_modules/querystring-es3/encode.js b/node_modules/querystring-es3/encode.js new file mode 100644 index 000000000..76e4cfb09 --- /dev/null +++ b/node_modules/querystring-es3/encode.js @@ -0,0 +1,85 @@ +// 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. + +'use strict'; + +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; +}; diff --git a/node_modules/querystring-es3/index.js b/node_modules/querystring-es3/index.js new file mode 100644 index 000000000..99826ea8a --- /dev/null +++ b/node_modules/querystring-es3/index.js @@ -0,0 +1,4 @@ +'use strict'; + +exports.decode = exports.parse = require('./decode'); +exports.encode = exports.stringify = require('./encode'); diff --git a/node_modules/querystring-es3/package.json b/node_modules/querystring-es3/package.json new file mode 100644 index 000000000..ab83a7e16 --- /dev/null +++ b/node_modules/querystring-es3/package.json @@ -0,0 +1,100 @@ +{ + "_from": "querystring-es3@~0.2.0", + "_id": "querystring-es3@0.2.1", + "_inBundle": false, + "_integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "_location": "/querystring-es3", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "querystring-es3@~0.2.0", + "name": "querystring-es3", + "escapedName": "querystring-es3", + "rawSpec": "~0.2.0", + "saveSpec": null, + "fetchSpec": "~0.2.0" + }, + "_requiredBy": [ + "/browserify" + ], + "_resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "_shasum": "9ec61f79049875707d69414596fd907a4d711e73", + "_spec": "querystring-es3@~0.2.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "Irakli Gozalishvili", + "email": "rfobic@gmail.com" + }, + "bugs": { + "url": "http://github.com/mike-spainhower/querystring/issues/" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Node's querystring module for all engines. (ES3 compat fork)", + "devDependencies": { + "phantomify": "~0.x.0", + "retape": "~0.x.0", + "tape": "~0.1.5", + "test": "~0.x.0" + }, + "engines": { + "node": ">=0.4.x" + }, + "homepage": "https://github.com/mike-spainhower/querystring#readme", + "id": "querystring-es3", + "keywords": [ + "commonjs", + "query", + "querystring" + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/Gozala/enchain/License.md" + } + ], + "name": "querystring-es3", + "repository": { + "type": "git", + "url": "git://github.com/mike-spainhower/querystring.git", + "web": "https://github.com/mike-spainhower/querystring" + }, + "scripts": { + "test": "npm run test-node && npm run test-browser && npm run test-tap", + "test-browser": "node ./node_modules/phantomify/bin/cmd.js ./test/common-index.js", + "test-node": "node ./test/common-index.js", + "test-tap": "node ./test/tap-index.js" + }, + "testling": { + "files": "test/tap-index.js", + "browsers": { + "iexplore": [ + 9, + 10 + ], + "chrome": [ + 16, + 20, + 25, + "canary" + ], + "firefox": [ + 10, + 15, + 16, + 17, + 18, + "nightly" + ], + "safari": [ + 5, + 6 + ], + "opera": [ + 12 + ] + } + }, + "version": "0.2.1" +} diff --git a/node_modules/querystring-es3/test/common-index.js b/node_modules/querystring-es3/test/common-index.js new file mode 100644 index 000000000..f356f9875 --- /dev/null +++ b/node_modules/querystring-es3/test/common-index.js @@ -0,0 +1,3 @@ +"use strict"; + +require("test").run(require("./index")) \ No newline at end of file diff --git a/node_modules/querystring-es3/test/index.js b/node_modules/querystring-es3/test/index.js new file mode 100644 index 000000000..62eb2ac89 --- /dev/null +++ b/node_modules/querystring-es3/test/index.js @@ -0,0 +1,210 @@ +// 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. + +"use strict"; + +// test using assert +var qs = require('../'); + +// folding block, commented to pass gjslint +// {{{ +// [ wonkyQS, canonicalQS, obj ] +var qsTestCases = [ + ['foo=918854443121279438895193', + 'foo=918854443121279438895193', + {'foo': '918854443121279438895193'}], + ['foo=bar', 'foo=bar', {'foo': 'bar'}], + ['foo=bar&foo=quux', 'foo=bar&foo=quux', {'foo': ['bar', 'quux']}], + ['foo=1&bar=2', 'foo=1&bar=2', {'foo': '1', 'bar': '2'}], + ['my+weird+field=q1%212%22%27w%245%267%2Fz8%29%3F', + 'my%20weird%20field=q1!2%22\'w%245%267%2Fz8)%3F', + {'my weird field': 'q1!2"\'w$5&7/z8)?' }], + ['foo%3Dbaz=bar', 'foo%3Dbaz=bar', {'foo=baz': 'bar'}], + ['foo=baz=bar', 'foo=baz%3Dbar', {'foo': 'baz=bar'}], + ['str=foo&arr=1&arr=2&arr=3&somenull=&undef=', + 'str=foo&arr=1&arr=2&arr=3&somenull=&undef=', + { 'str': 'foo', + 'arr': ['1', '2', '3'], + 'somenull': '', + 'undef': ''}], + [' foo = bar ', '%20foo%20=%20bar%20', {' foo ': ' bar '}], + // disable test that fails ['foo=%zx', 'foo=%25zx', {'foo': '%zx'}], + ['foo=%EF%BF%BD', 'foo=%EF%BF%BD', {'foo': '\ufffd' }], + // See: https://github.com/joyent/node/issues/1707 + ['hasOwnProperty=x&toString=foo&valueOf=bar&__defineGetter__=baz', + 'hasOwnProperty=x&toString=foo&valueOf=bar&__defineGetter__=baz', + { hasOwnProperty: 'x', + toString: 'foo', + valueOf: 'bar', + __defineGetter__: 'baz' }], + // See: https://github.com/joyent/node/issues/3058 + ['foo&bar=baz', 'foo=&bar=baz', { foo: '', bar: 'baz' }] +]; + +// [ wonkyQS, canonicalQS, obj ] +var qsColonTestCases = [ + ['foo:bar', 'foo:bar', {'foo': 'bar'}], + ['foo:bar;foo:quux', 'foo:bar;foo:quux', {'foo': ['bar', 'quux']}], + ['foo:1&bar:2;baz:quux', + 'foo:1%26bar%3A2;baz:quux', + {'foo': '1&bar:2', 'baz': 'quux'}], + ['foo%3Abaz:bar', 'foo%3Abaz:bar', {'foo:baz': 'bar'}], + ['foo:baz:bar', 'foo:baz%3Abar', {'foo': 'baz:bar'}] +]; + +// [wonkyObj, qs, canonicalObj] +var extendedFunction = function() {}; +extendedFunction.prototype = {a: 'b'}; +var qsWeirdObjects = [ + [{regexp: /./g}, 'regexp=', {'regexp': ''}], + [{regexp: new RegExp('.', 'g')}, 'regexp=', {'regexp': ''}], + [{fn: function() {}}, 'fn=', {'fn': ''}], + [{fn: new Function('')}, 'fn=', {'fn': ''}], + [{math: Math}, 'math=', {'math': ''}], + [{e: extendedFunction}, 'e=', {'e': ''}], + [{d: new Date()}, 'd=', {'d': ''}], + [{d: Date}, 'd=', {'d': ''}], + [{f: new Boolean(false), t: new Boolean(true)}, 'f=&t=', {'f': '', 't': ''}], + [{f: false, t: true}, 'f=false&t=true', {'f': 'false', 't': 'true'}], + [{n: null}, 'n=', {'n': ''}], + [{nan: NaN}, 'nan=', {'nan': ''}], + [{inf: Infinity}, 'inf=', {'inf': ''}] +]; +// }}} + +var qsNoMungeTestCases = [ + ['', {}], + ['foo=bar&foo=baz', {'foo': ['bar', 'baz']}], + ['blah=burp', {'blah': 'burp'}], + ['gragh=1&gragh=3&goo=2', {'gragh': ['1', '3'], 'goo': '2'}], + ['frappucino=muffin&goat%5B%5D=scone&pond=moose', + {'frappucino': 'muffin', 'goat[]': 'scone', 'pond': 'moose'}], + ['trololol=yes&lololo=no', {'trololol': 'yes', 'lololo': 'no'}] +]; + +exports['test basic'] = function(assert) { + assert.strictEqual('918854443121279438895193', + qs.parse('id=918854443121279438895193').id, + 'prase id=918854443121279438895193'); +}; + +exports['test that the canonical qs is parsed properly'] = function(assert) { + qsTestCases.forEach(function(testCase) { + assert.deepEqual(testCase[2], qs.parse(testCase[0]), + 'parse ' + testCase[0]); + }); +}; + + +exports['test that the colon test cases can do the same'] = function(assert) { + qsColonTestCases.forEach(function(testCase) { + assert.deepEqual(testCase[2], qs.parse(testCase[0], ';', ':'), + 'parse ' + testCase[0] + ' -> ; :'); + }); +}; + +exports['test the weird objects, that they get parsed properly'] = function(assert) { + qsWeirdObjects.forEach(function(testCase) { + assert.deepEqual(testCase[2], qs.parse(testCase[1]), + 'parse ' + testCase[1]); + }); +}; + +exports['test non munge test cases'] = function(assert) { + qsNoMungeTestCases.forEach(function(testCase) { + assert.deepEqual(testCase[0], qs.stringify(testCase[1], '&', '=', false), + 'stringify ' + JSON.stringify(testCase[1]) + ' -> & ='); + }); +}; + +exports['test the nested qs-in-qs case'] = function(assert) { + var f = qs.parse('a=b&q=x%3Dy%26y%3Dz'); + f.q = qs.parse(f.q); + assert.deepEqual(f, { a: 'b', q: { x: 'y', y: 'z' } }, + 'parse a=b&q=x%3Dy%26y%3Dz'); +}; + +exports['test nested in colon'] = function(assert) { + var f = qs.parse('a:b;q:x%3Ay%3By%3Az', ';', ':'); + f.q = qs.parse(f.q, ';', ':'); + assert.deepEqual(f, { a: 'b', q: { x: 'y', y: 'z' } }, + 'parse a:b;q:x%3Ay%3By%3Az -> ; :'); +}; + +exports['test stringifying'] = function(assert) { + qsTestCases.forEach(function(testCase) { + assert.equal(testCase[1], qs.stringify(testCase[2]), + 'stringify ' + JSON.stringify(testCase[2])); + }); + + qsColonTestCases.forEach(function(testCase) { + assert.equal(testCase[1], qs.stringify(testCase[2], ';', ':'), + 'stringify ' + JSON.stringify(testCase[2]) + ' -> ; :'); + }); + + qsWeirdObjects.forEach(function(testCase) { + assert.equal(testCase[1], qs.stringify(testCase[0]), + 'stringify ' + JSON.stringify(testCase[0])); + }); +}; + +exports['test stringifying nested'] = function(assert) { + var f = qs.stringify({ + a: 'b', + q: qs.stringify({ + x: 'y', + y: 'z' + }) + }); + assert.equal(f, 'a=b&q=x%3Dy%26y%3Dz', + JSON.stringify({ + a: 'b', + 'qs.stringify -> q': { + x: 'y', + y: 'z' + } + })); + + var threw = false; + try { qs.parse(undefined); } catch(error) { threw = true; } + assert.ok(!threw, "does not throws on undefined"); +}; + +exports['test nested in colon'] = function(assert) { + var f = qs.stringify({ + a: 'b', + q: qs.stringify({ + x: 'y', + y: 'z' + }, ';', ':') + }, ';', ':'); + assert.equal(f, 'a:b;q:x%3Ay%3By%3Az', + 'stringify ' + JSON.stringify({ + a: 'b', + 'qs.stringify -> q': { + x: 'y', + y: 'z' + } + }) + ' -> ; : '); + + + assert.deepEqual({}, qs.parse(), 'parse undefined'); +}; diff --git a/node_modules/querystring-es3/test/tap-index.js b/node_modules/querystring-es3/test/tap-index.js new file mode 100644 index 000000000..70679b3fc --- /dev/null +++ b/node_modules/querystring-es3/test/tap-index.js @@ -0,0 +1,3 @@ +"use strict"; + +require("retape")(require("./index")) \ No newline at end of file diff --git a/node_modules/querystring/.History.md.un~ b/node_modules/querystring/.History.md.un~ new file mode 100644 index 0000000000000000000000000000000000000000..c96a7dd8c8c86e2e4b6af0478b1bc122b929528d GIT binary patch literal 7960 zcmeI1O>0v@6ozk__}SL4mLj+rD1;VG%uP&mDblr2L05iY+Y|yOx0H0*MfHaW;zHes zKR`F`T=@gs`hk0K;X==IGN(>L?aJBB3n!DAdy@?3;XU`)S!)7yiU;&V2&^z8MM z_O~xGQz3{XCeC6fM$1j%OzWXru>3x=E^Ac0e$!mpo5+#Xq5{S_vTkUMz zuW+=IJ^08`5g#ydh*13&{hirr8vkDgRy%8%;>fZe=l$2h@R$S`78YHj-l(_SW!G%v zd987!mUrA@dr#qUMp?pSNJ_l70&gjVNBWOSOu%a%Tp;ai+aKUqn`0q4k1WKLz+3(o zyv!FzkZ`p#0hgesNr*^7R0*PsAtG=bmpCcGHEe#=fQ9Dmz#6q#%RwOxR6L$U>@xmX=tfkh&gPir=9Y8Y%7Y^LoR2jl5aQTOJ*#w5#Al zqW${GB%vb7^QPhnO@ ZFiAa69(m~N+kCx4vvqx5-`@NB>JPML-n9S# literal 0 HcmV?d00001 diff --git a/node_modules/querystring/.Readme.md.un~ b/node_modules/querystring/.Readme.md.un~ new file mode 100644 index 0000000000000000000000000000000000000000..71613b59ba1b551647a6ba1b47180a44ac70212b GIT binary patch literal 3225 zcmeHJyGjE=6dhxHHnxHY5fx2g(wK;m2tL4CM2U#VlB~&Ul8rO75g(v-*8YIKrG>3O zV4?PwVrgY5de3Y|*AUQ%YqbYXhTNHb%sprCofWHezFeNSA6e+|G>1{HPna%a9q zp?4>dB~Fx_m_f}bEc`<0w6uAF!lBtZI=41*ERw;dU*sfHzCq6QQM z(+C8rAq#$jR2#4V2qA}7&H7al*JZhx3SRRAv~Tn57%zhgoI^2MwfumpG2qeK*kR#H{5#i5Mo3~;7 L>#09+@^tYI$G;b9 literal 0 HcmV?d00001 diff --git a/node_modules/querystring/.package.json.un~ b/node_modules/querystring/.package.json.un~ new file mode 100644 index 0000000000000000000000000000000000000000..d86fe314c5aaeffce89d94a968668c5dc133ba5b GIT binary patch literal 5710 zcmeHLOKTKC5T3-u_&`k*#kb>v5n;0rb>mwIL_}{n=tV>}yR&9w=i$t5j7Sb%Jt!(3 z#j~D7Px=RZ9K@@FM-@en9!0;erhB)O4H6P_n}%advIf~Yu2>IpEI{p6-nwZjxRQ_iVj17;! z7CJ2J*JjwJ>o);g0aDRz+b#V7{%--S(oLa`NW0+oTY(hIAm$NE$+IKoH;x2dTe_-tEeJ1%Z=M1ZOox*jx?OI z;BL#4u&_;g6>?JdLDdHdv+jf{mN*-jUEZjtZacu}T8rR|E0G&EBxgdCoe_|JP<3oZ zXPoEn(AB0BU5^`)>tD`Yi8Hi<9^r$q^VYWWHHj*1MG`eAH4Fdhb|Wvc+)NN4N9X%K3+ zEKs&QiS=YhP9l&-zN|bI3e_tiYvT!kL8pQ(EANE5Xp-L@KxffBJhNzqo*gxPshdMm zK?etI-&BrA!L`_lYweI$<0LH0a(RkNUQlh;oj4y(l>J8FxwY&0ao5jRyeew2 zos-I(uLPbK_$!kb(xC? zt2)(Y$kTvqZ^(7(P+!ME0h4Y(wM`b+Ts#Sv$$c2M2V_`zKp#dnPzh76GZof@h|h5W zrq(2C3>?Ad7${aGii>=7F@&MYL=<>>1t?2eW`Ch`$$B+bb0en~OsT8j8I-=rHMHF} zQ!I6w(N~VkwQ}StEA1tvTv3d)?|!(`M!&jb5IRx0!$fg^vZ61UbrHAJ%kDHfW@cd~ z(O;#|l`L}{QeLLg%tDteqM4b6{W(rzm1mM!mM6vG7$z~Zi~!6m;A}dp-<-?}fHC2X k7WsA2O1YvJ7SZOxmG@1!>PxuN-yAeobAJIY-TeCGFNStew*UYD literal 0 HcmV?d00001 diff --git a/node_modules/querystring/.travis.yml b/node_modules/querystring/.travis.yml new file mode 100644 index 000000000..895dbd362 --- /dev/null +++ b/node_modules/querystring/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.6 + - 0.8 diff --git a/node_modules/querystring/History.md b/node_modules/querystring/History.md new file mode 100644 index 000000000..4fddbaf78 --- /dev/null +++ b/node_modules/querystring/History.md @@ -0,0 +1,20 @@ +# 0.2.0 / 2013-02-21 + + - Refactor into function per-module idiomatic style. + - Improved test coverage. + +# 0.1.0 / 2011-12-13 + + - Minor project reorganization + +# 0.0.3 / 2011-04-16 + - Support for AMD module loaders + +# 0.0.2 / 2011-04-16 + + - Ported unit tests + - Removed functionality that depended on Buffers + +# 0.0.1 / 2011-04-15 + + - Initial release diff --git a/node_modules/querystring/License.md b/node_modules/querystring/License.md new file mode 100644 index 000000000..fc80e85f2 --- /dev/null +++ b/node_modules/querystring/License.md @@ -0,0 +1,19 @@ + +Copyright 2012 Irakli Gozalishvili. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/node_modules/querystring/Readme.md b/node_modules/querystring/Readme.md new file mode 100644 index 000000000..a4fe2520d --- /dev/null +++ b/node_modules/querystring/Readme.md @@ -0,0 +1,15 @@ +# querystring + +[![Build Status](https://secure.travis-ci.org/Gozala/querystring.png)](http://travis-ci.org/Gozala/querystring) + + +[![Browser support](http://ci.testling.com/Gozala/querystring.png)](http://ci.testling.com/Gozala/querystring) + + + +Node's querystring module for all engines. + +## Install ## + + npm install querystring + diff --git a/node_modules/querystring/decode.js b/node_modules/querystring/decode.js new file mode 100644 index 000000000..a6518b8ff --- /dev/null +++ b/node_modules/querystring/decode.js @@ -0,0 +1,80 @@ +// 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. + +'use strict'; + +// 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 (Array.isArray(obj[k])) { + obj[k].push(v); + } else { + obj[k] = [obj[k], v]; + } + } + + return obj; +}; diff --git a/node_modules/querystring/encode.js b/node_modules/querystring/encode.js new file mode 100644 index 000000000..4f2b561b2 --- /dev/null +++ b/node_modules/querystring/encode.js @@ -0,0 +1,64 @@ +// 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. + +'use strict'; + +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 Object.keys(obj).map(function(k) { + var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; + if (Array.isArray(obj[k])) { + return obj[k].map(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)); +}; diff --git a/node_modules/querystring/index.js b/node_modules/querystring/index.js new file mode 100644 index 000000000..99826ea8a --- /dev/null +++ b/node_modules/querystring/index.js @@ -0,0 +1,4 @@ +'use strict'; + +exports.decode = exports.parse = require('./decode'); +exports.encode = exports.stringify = require('./encode'); diff --git a/node_modules/querystring/package.json b/node_modules/querystring/package.json new file mode 100644 index 000000000..2a0cb9d44 --- /dev/null +++ b/node_modules/querystring/package.json @@ -0,0 +1,100 @@ +{ + "_from": "querystring@0.2.0", + "_id": "querystring@0.2.0", + "_inBundle": false, + "_integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "_location": "/querystring", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "querystring@0.2.0", + "name": "querystring", + "escapedName": "querystring", + "rawSpec": "0.2.0", + "saveSpec": null, + "fetchSpec": "0.2.0" + }, + "_requiredBy": [ + "/url" + ], + "_resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "_shasum": "b209849203bb25df820da756e747005878521620", + "_spec": "querystring@0.2.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/url", + "author": { + "name": "Irakli Gozalishvili", + "email": "rfobic@gmail.com" + }, + "bugs": { + "url": "http://github.com/Gozala/querystring/issues/" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Node's querystring module for all engines.", + "devDependencies": { + "phantomify": "~0.x.0", + "retape": "~0.x.0", + "tape": "~0.1.5", + "test": "~0.x.0" + }, + "engines": { + "node": ">=0.4.x" + }, + "homepage": "https://github.com/Gozala/querystring#readme", + "id": "querystring", + "keywords": [ + "commonjs", + "query", + "querystring" + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/Gozala/enchain/License.md" + } + ], + "name": "querystring", + "repository": { + "type": "git", + "url": "git://github.com/Gozala/querystring.git", + "web": "https://github.com/Gozala/querystring" + }, + "scripts": { + "test": "npm run test-node && npm run test-browser && npm run test-tap", + "test-browser": "node ./node_modules/phantomify/bin/cmd.js ./test/common-index.js", + "test-node": "node ./test/common-index.js", + "test-tap": "node ./test/tap-index.js" + }, + "testling": { + "files": "test/tap-index.js", + "browsers": { + "iexplore": [ + 9, + 10 + ], + "chrome": [ + 16, + 20, + 25, + "canary" + ], + "firefox": [ + 10, + 15, + 16, + 17, + 18, + "nightly" + ], + "safari": [ + 5, + 6 + ], + "opera": [ + 12 + ] + } + }, + "version": "0.2.0" +} diff --git a/node_modules/querystring/test/.index.js.un~ b/node_modules/querystring/test/.index.js.un~ new file mode 100644 index 0000000000000000000000000000000000000000..898eceddc9e485e85275e41f9b8b98294bb3fe08 GIT binary patch literal 975 zcmWH`%$*;a=aT=Ffr(>^0h6blXhl42hkT^^Cju)3aORMz^9E7#J=A zF*0BTa+sh3AR2}l0?m@ovVde68R9P>DS$G8!VCjM7vN0bq2T0Y?V| z!&eEQ*`RoY1wSY%7)%?%(FA6L_)q|fPnbG}(P)AN3$18)G%;e2CfTCY!qUv5R1Kw) b)Z!8)O}(PhJdM ; :'); + }); +}; + +exports['test the weird objects, that they get parsed properly'] = function(assert) { + qsWeirdObjects.forEach(function(testCase) { + assert.deepEqual(testCase[2], qs.parse(testCase[1]), + 'parse ' + testCase[1]); + }); +}; + +exports['test non munge test cases'] = function(assert) { + qsNoMungeTestCases.forEach(function(testCase) { + assert.deepEqual(testCase[0], qs.stringify(testCase[1], '&', '=', false), + 'stringify ' + JSON.stringify(testCase[1]) + ' -> & ='); + }); +}; + +exports['test the nested qs-in-qs case'] = function(assert) { + var f = qs.parse('a=b&q=x%3Dy%26y%3Dz'); + f.q = qs.parse(f.q); + assert.deepEqual(f, { a: 'b', q: { x: 'y', y: 'z' } }, + 'parse a=b&q=x%3Dy%26y%3Dz'); +}; + +exports['test nested in colon'] = function(assert) { + var f = qs.parse('a:b;q:x%3Ay%3By%3Az', ';', ':'); + f.q = qs.parse(f.q, ';', ':'); + assert.deepEqual(f, { a: 'b', q: { x: 'y', y: 'z' } }, + 'parse a:b;q:x%3Ay%3By%3Az -> ; :'); +}; + +exports['test stringifying'] = function(assert) { + qsTestCases.forEach(function(testCase) { + assert.equal(testCase[1], qs.stringify(testCase[2]), + 'stringify ' + JSON.stringify(testCase[2])); + }); + + qsColonTestCases.forEach(function(testCase) { + assert.equal(testCase[1], qs.stringify(testCase[2], ';', ':'), + 'stringify ' + JSON.stringify(testCase[2]) + ' -> ; :'); + }); + + qsWeirdObjects.forEach(function(testCase) { + assert.equal(testCase[1], qs.stringify(testCase[0]), + 'stringify ' + JSON.stringify(testCase[0])); + }); +}; + +exports['test stringifying nested'] = function(assert) { + var f = qs.stringify({ + a: 'b', + q: qs.stringify({ + x: 'y', + y: 'z' + }) + }); + assert.equal(f, 'a=b&q=x%3Dy%26y%3Dz', + JSON.stringify({ + a: 'b', + 'qs.stringify -> q': { + x: 'y', + y: 'z' + } + })); + + var threw = false; + try { qs.parse(undefined); } catch(error) { threw = true; } + assert.ok(!threw, "does not throws on undefined"); +}; + +exports['test nested in colon'] = function(assert) { + var f = qs.stringify({ + a: 'b', + q: qs.stringify({ + x: 'y', + y: 'z' + }, ';', ':') + }, ';', ':'); + assert.equal(f, 'a:b;q:x%3Ay%3By%3Az', + 'stringify ' + JSON.stringify({ + a: 'b', + 'qs.stringify -> q': { + x: 'y', + y: 'z' + } + }) + ' -> ; : '); + + + assert.deepEqual({}, qs.parse(), 'parse undefined'); +}; diff --git a/node_modules/querystring/test/tap-index.js b/node_modules/querystring/test/tap-index.js new file mode 100644 index 000000000..70679b3fc --- /dev/null +++ b/node_modules/querystring/test/tap-index.js @@ -0,0 +1,3 @@ +"use strict"; + +require("retape")(require("./index")) \ No newline at end of file diff --git a/node_modules/randomatic/LICENSE b/node_modules/randomatic/LICENSE new file mode 100644 index 000000000..38a4a0bf1 --- /dev/null +++ b/node_modules/randomatic/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/randomatic/README.md b/node_modules/randomatic/README.md new file mode 100644 index 000000000..292e64225 --- /dev/null +++ b/node_modules/randomatic/README.md @@ -0,0 +1,193 @@ +# randomatic [![NPM version](https://img.shields.io/npm/v/randomatic.svg?style=flat)](https://www.npmjs.com/package/randomatic) [![NPM monthly downloads](https://img.shields.io/npm/dm/randomatic.svg?style=flat)](https://npmjs.org/package/randomatic) [![NPM total downloads](https://img.shields.io/npm/dt/randomatic.svg?style=flat)](https://npmjs.org/package/randomatic) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/randomatic.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/randomatic) + +> Generate randomized strings of a specified length using simple character sequences. The original generate-password. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save randomatic +``` + +## Usage + +```js +var randomize = require('randomatic'); +``` + +## API + +```js +randomize(pattern, length, options); +randomize.isCrypto; +``` + +* `pattern` **{String}**: (required) The pattern to use for randomizing +* `length` **{Number}**: (optional) The length of the string to generate +* `options` **{Object}**: (optional) See available [options](#options) +* `randomize.isCrypto` will be `true` when a cryptographically secure function is being used to generate random numbers. The value will be `false` when the function in use is `Math.random`. + +### pattern + +> The pattern to use for randomizing + +Patterns can contain any combination of the below characters, specified in any order. + +**Example:** + +To generate a 10-character randomized string using all available characters: + +```js +randomize('*', 10); +//=> 'x2_^-5_T[$' + +randomize('Aa0!', 10); +//=> 'LV3u~BSGhw' +``` + +* `a`: Lowercase alpha characters (`abcdefghijklmnopqrstuvwxyz'`) +* `A`: Uppercase alpha characters (`ABCDEFGHIJKLMNOPQRSTUVWXYZ'`) +* `0`: Numeric characters (`0123456789'`) +* `!`: Special characters (`~!@#$%^&()_+-={}[];\',.`) +* `*`: All characters (all of the above combined) +* `?`: Custom characters (pass a string of custom characters to the options) + +### length + +> The length of the string to generate + +**Examples:** + +* `randomize('A', 5)` will generate a 5-character, uppercase, alphabetical, randomized string, e.g. `KDJWJ`. +* `randomize('0', 2)` will generate a 2-digit random number +* `randomize('0', 3)` will generate a 3-digit random number +* `randomize('0', 12)` will generate a 12-digit random number +* `randomize('A0', 16)` will generate a 16-character, alpha-numeric randomized string + +If `length` is left undefined, the length of the pattern in the first parameter will be used. For example: + +* `randomize('00')` will generate a 2-digit random number +* `randomize('000')` will generate a 3-digit random number +* `randomize('0000')` will generate a 4-digit random number... +* `randomize('AAAAA')` will generate a 5-character, uppercase alphabetical random string... + +These are just examples, [see the tests](./test.js) for more use cases and examples. + +## options + +> These are options that can be passed as the third argument. + +#### chars + +Type: `String` + +Default: `undefined` + +Define a custom string to be randomized. + +**Example:** + +* `randomize('?', 20, {chars: 'jonschlinkert'})` will generate a 20-character randomized string from the letters contained in `jonschlinkert`. +* `randomize('?', {chars: 'jonschlinkert'})` will generate a 13-character randomized string from the letters contained in `jonschlinkert`. + +#### exclude + +Type: `String|Array` + +Default: `undefined` + +Specify a string or array of characters can are excluded from the possible characters used to generate the randomized string. + +**Example:** + +* `randomize('*', 20, { exclude: '0oOiIlL1' })` will generate a 20-character randomized string using all of possible characters except for `0oOiIlL1`. + +## Usage Examples + +* `randomize('A', 4)` (_whitespace insenstive_) would result in randomized 4-digit uppercase letters, like, `ZAKH`, `UJSL`... etc. +* `randomize('AAAA')` is equivelant to `randomize('A', 4)` +* `randomize('AAA0')` and `randomize('AA00')` and `randomize('A0A0')` are equivelant to `randomize('A0', 4)` +* `randomize('aa')`: results in double-digit, randomized, lower-case letters (`abcdefghijklmnopqrstuvwxyz`) +* `randomize('AAA')`: results in triple-digit, randomized, upper-case letters (`ABCDEFGHIJKLMNOPQRSTUVWXYZ`) +* `randomize('0', 6)`: results in six-digit, randomized numbers (`0123456789`) +* `randomize('!', 5)`: results in single-digit randomized, _valid_ non-letter characters (`~!@#$%^&()_+-={}[] +* `randomize('A!a0', 9)`: results in nine-digit, randomized characters (any of the above) + +_The order in which the characters are defined is insignificant._ + +## About + +
    +Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
    + +
    +Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
    + +
    +Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
    + +### Related projects + +You might also be interested in these projects: + +* [pad-left](https://www.npmjs.com/package/pad-left): Left pad a string with zeros or a specified string. Fastest implementation. | [homepage](https://github.com/jonschlinkert/pad-left "Left pad a string with zeros or a specified string. Fastest implementation.") +* [pad-right](https://www.npmjs.com/package/pad-right): Right pad a string with zeros or a specified string. Fastest implementation. | [homepage](https://github.com/jonschlinkert/pad-right "Right pad a string with zeros or a specified string. Fastest implementation.") +* [repeat-string](https://www.npmjs.com/package/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string. | [homepage](https://github.com/jonschlinkert/repeat-string "Repeat the given string n times. Fastest implementation for repeating a string.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 56 | [jonschlinkert](https://github.com/jonschlinkert) | +| 6 | [doowb](https://github.com/doowb) | +| 4 | [kivlor](https://github.com/kivlor) | +| 2 | [realityking](https://github.com/realityking) | +| 2 | [ywpark1](https://github.com/ywpark1) | +| 1 | [TrySound](https://github.com/TrySound) | +| 1 | [drag0s](https://github.com/drag0s) | +| 1 | [paulmillr](https://github.com/paulmillr) | +| 1 | [sunknudsen](https://github.com/sunknudsen) | +| 1 | [faizulhaque-tp](https://github.com/faizulhaque-tp) | +| 1 | [michaelrhodes](https://github.com/michaelrhodes) | + +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on October 23, 2018._ \ No newline at end of file diff --git a/node_modules/randomatic/index.js b/node_modules/randomatic/index.js new file mode 100644 index 000000000..dc636fb1b --- /dev/null +++ b/node_modules/randomatic/index.js @@ -0,0 +1,95 @@ +/*! + * randomatic + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var isNumber = require('is-number'); +var typeOf = require('kind-of'); +var mathRandom = require('math-random'); + +/** + * Expose `randomatic` + */ + +module.exports = randomatic; +module.exports.isCrypto = !!mathRandom.cryptographic; + +/** + * Available mask characters + */ + +var type = { + lower: 'abcdefghijklmnopqrstuvwxyz', + upper: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', + number: '0123456789', + special: '~!@#$%^&()_+-={}[];\',.' +}; + +type.all = type.lower + type.upper + type.number + type.special; + +/** + * Generate random character sequences of a specified `length`, + * based on the given `pattern`. + * + * @param {String} `pattern` The pattern to use for generating the random string. + * @param {String} `length` The length of the string to generate. + * @param {String} `options` + * @return {String} + * @api public + */ + +function randomatic(pattern, length, options) { + if (typeof pattern === 'undefined') { + throw new Error('randomatic expects a string or number.'); + } + + var custom = false; + if (arguments.length === 1) { + if (typeof pattern === 'string') { + length = pattern.length; + + } else if (isNumber(pattern)) { + options = {}; + length = pattern; + pattern = '*'; + } + } + + if (typeOf(length) === 'object' && length.hasOwnProperty('chars')) { + options = length; + pattern = options.chars; + length = pattern.length; + custom = true; + } + + var opts = options || {}; + var mask = ''; + var res = ''; + + // Characters to be used + if (pattern.indexOf('?') !== -1) mask += opts.chars; + if (pattern.indexOf('a') !== -1) mask += type.lower; + if (pattern.indexOf('A') !== -1) mask += type.upper; + if (pattern.indexOf('0') !== -1) mask += type.number; + if (pattern.indexOf('!') !== -1) mask += type.special; + if (pattern.indexOf('*') !== -1) mask += type.all; + if (custom) mask += pattern; + + // Characters to exclude + if (opts.exclude) { + var exclude = typeOf(opts.exclude) === 'string' ? opts.exclude : opts.exclude.join(''); + exclude = exclude.replace(new RegExp('[\\]]+', 'g'), ''); + mask = mask.replace(new RegExp('[' + exclude + ']+', 'g'), ''); + + if(opts.exclude.indexOf(']') !== -1) mask = mask.replace(new RegExp('[\\]]+', 'g'), ''); + } + + while (length--) { + res += mask.charAt(parseInt(mathRandom() * mask.length, 10)); + } + return res; +}; diff --git a/node_modules/randomatic/node_modules/is-number/LICENSE b/node_modules/randomatic/node_modules/is-number/LICENSE new file mode 100644 index 000000000..3f2eca18f --- /dev/null +++ b/node_modules/randomatic/node_modules/is-number/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/randomatic/node_modules/is-number/README.md b/node_modules/randomatic/node_modules/is-number/README.md new file mode 100644 index 000000000..6436992dc --- /dev/null +++ b/node_modules/randomatic/node_modules/is-number/README.md @@ -0,0 +1,135 @@ +# is-number [![NPM version](https://img.shields.io/npm/v/is-number.svg?style=flat)](https://www.npmjs.com/package/is-number) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![NPM total downloads](https://img.shields.io/npm/dt/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-number.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-number) + +> Returns true if the value is a number. comprehensive tests. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-number +``` + +## Usage + +To understand some of the rationale behind the decisions made in this library (and to learn about some oddities of number evaluation in JavaScript), [see this gist](https://gist.github.com/jonschlinkert/e30c70c713da325d0e81). + +```js +var isNumber = require('is-number'); +``` + +### true + +See the [tests](./test.js) for more examples. + +```js +isNumber(5e3) //=> 'true' +isNumber(0xff) //=> 'true' +isNumber(-1.1) //=> 'true' +isNumber(0) //=> 'true' +isNumber(1) //=> 'true' +isNumber(1.1) //=> 'true' +isNumber(10) //=> 'true' +isNumber(10.10) //=> 'true' +isNumber(100) //=> 'true' +isNumber('-1.1') //=> 'true' +isNumber('0') //=> 'true' +isNumber('012') //=> 'true' +isNumber('0xff') //=> 'true' +isNumber('1') //=> 'true' +isNumber('1.1') //=> 'true' +isNumber('10') //=> 'true' +isNumber('10.10') //=> 'true' +isNumber('100') //=> 'true' +isNumber('5e3') //=> 'true' +isNumber(parseInt('012')) //=> 'true' +isNumber(parseFloat('012')) //=> 'true' +``` + +### False + +See the [tests](./test.js) for more examples. + +```js +isNumber('foo') //=> 'false' +isNumber([1]) //=> 'false' +isNumber([]) //=> 'false' +isNumber(function () {}) //=> 'false' +isNumber(Infinity) //=> 'false' +isNumber(NaN) //=> 'false' +isNumber(new Array('abc')) //=> 'false' +isNumber(new Array(2)) //=> 'false' +isNumber(new Buffer('abc')) //=> 'false' +isNumber(null) //=> 'false' +isNumber(undefined) //=> 'false' +isNumber({abc: 'abc'}) //=> 'false' +``` + +## About + +
    +Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
    + +
    +Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
    + +
    +Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
    + +### Related projects + +You might also be interested in these projects: + +* [even](https://www.npmjs.com/package/even): Get the even numbered items from an array. | [homepage](https://github.com/jonschlinkert/even "Get the even numbered items from an array.") +* [is-even](https://www.npmjs.com/package/is-even): Return true if the given number is even. | [homepage](https://github.com/jonschlinkert/is-even "Return true if the given number is even.") +* [is-odd](https://www.npmjs.com/package/is-odd): Returns true if the given number is odd. | [homepage](https://github.com/jonschlinkert/is-odd "Returns true if the given number is odd.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") +* [odd](https://www.npmjs.com/package/odd): Get the odd numbered items from an array. | [homepage](https://github.com/jonschlinkert/odd "Get the odd numbered items from an array.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 38 | [jonschlinkert](https://github.com/jonschlinkert) | +| 5 | [charlike](https://github.com/charlike) | + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on October 17, 2017._ \ No newline at end of file diff --git a/node_modules/randomatic/node_modules/is-number/index.js b/node_modules/randomatic/node_modules/is-number/index.js new file mode 100644 index 000000000..5221f4056 --- /dev/null +++ b/node_modules/randomatic/node_modules/is-number/index.js @@ -0,0 +1,21 @@ +/*! + * is-number + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +module.exports = function isNumber(num) { + var type = typeof num; + + if (type === 'string' || num instanceof String) { + // an empty string would be coerced to true with the below logic + if (!num.trim()) return false; + } else if (type !== 'number' && !(num instanceof Number)) { + return false; + } + + return (num - num + 1) >= 0; +}; diff --git a/node_modules/randomatic/node_modules/is-number/package.json b/node_modules/randomatic/node_modules/is-number/package.json new file mode 100644 index 000000000..22a049959 --- /dev/null +++ b/node_modules/randomatic/node_modules/is-number/package.json @@ -0,0 +1,113 @@ +{ + "_from": "is-number@^4.0.0", + "_id": "is-number@4.0.0", + "_inBundle": false, + "_integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "_location": "/randomatic/is-number", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-number@^4.0.0", + "name": "is-number", + "escapedName": "is-number", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/randomatic" + ], + "_resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "_shasum": "0026e37f5454d73e356dfe6564699867c6a7f0ff", + "_spec": "is-number@^4.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/randomatic", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-number/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "tunnckoCore", + "url": "https://i.am.charlike.online" + } + ], + "deprecated": false, + "description": "Returns true if the value is a number. comprehensive tests.", + "devDependencies": { + "benchmarked": "^2.0.0", + "chalk": "^2.1.0", + "gulp-format-md": "^1.0.0", + "mocha": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-number", + "keywords": [ + "check", + "coerce", + "coercion", + "integer", + "is", + "is-nan", + "is-num", + "is-number", + "istype", + "kind", + "math", + "nan", + "num", + "number", + "numeric", + "test", + "type", + "typeof", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "is-number", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-number.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "even", + "is-even", + "is-odd", + "is-primitive", + "kind-of", + "odd" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + }, + "version": "4.0.0" +} diff --git a/node_modules/randomatic/node_modules/kind-of/CHANGELOG.md b/node_modules/randomatic/node_modules/kind-of/CHANGELOG.md new file mode 100644 index 000000000..fb30b06df --- /dev/null +++ b/node_modules/randomatic/node_modules/kind-of/CHANGELOG.md @@ -0,0 +1,157 @@ +# Release history + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +
    + Guiding Principles + +- Changelogs are for humans, not machines. +- There should be an entry for every single version. +- The same types of changes should be grouped. +- Versions and sections should be linkable. +- The latest version comes first. +- The release date of each versions is displayed. +- Mention whether you follow Semantic Versioning. + +
    + +
    + Types of changes + +Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_): + +- `Added` for new features. +- `Changed` for changes in existing functionality. +- `Deprecated` for soon-to-be removed features. +- `Removed` for now removed features. +- `Fixed` for any bug fixes. +- `Security` in case of vulnerabilities. + +
    + +## [6.0.0] - 2017-10-13 + +- refactor code to be more performant +- refactor benchmarks + +## [5.1.0] - 2017-10-13 + +**Added** + +- Merge pull request #15 from aretecode/patch-1 +- adds support and tests for string & array iterators + +**Changed** + +- updates benchmarks + +## [5.0.2] - 2017-08-02 + +- Merge pull request #14 from struct78/master +- Added `undefined` check + +## [5.0.0] - 2017-06-21 + +- Merge pull request #12 from aretecode/iterator +- Set Iterator + Map Iterator +- streamline `isbuffer`, minor edits + +## [4.0.0] - 2017-05-19 + +- Merge pull request #8 from tunnckoCore/master +- update deps + +## [3.2.2] - 2017-05-16 + +- fix version + +## [3.2.1] - 2017-05-16 + +- add browserify + +## [3.2.0] - 2017-04-25 + +- Merge pull request #10 from ksheedlo/unrequire-buffer +- add `promise` support and tests +- Remove unnecessary `Buffer` check + +## [3.1.0] - 2016-12-07 + +- Merge pull request #7 from laggingreflex/err +- add support for `error` and tests +- run update + +## [3.0.4] - 2016-07-29 + +- move tests +- run update + +## [3.0.3] - 2016-05-03 + +- fix prepublish script +- remove unused dep + +## [3.0.0] - 2015-11-17 + +- add typed array support +- Merge pull request #5 from miguelmota/typed-arrays +- adds new tests + +## [2.0.1] - 2015-08-21 + +- use `is-buffer` module + +## [2.0.0] - 2015-05-31 + +- Create fallback for `Array.isArray` if used as a browser package +- Merge pull request #2 from dtothefp/patch-1 +- Merge pull request #3 from pdehaan/patch-1 +- Merge branch 'master' of https://github.com/chorks/kind-of into chorks-master +- optimizations, mostly date and regex + +## [1.1.0] - 2015-02-09 + +- adds `buffer` support +- adds tests for `buffer` + +## [1.0.0] - 2015-01-19 + +- update benchmarks +- optimizations based on benchmarks + +## [0.1.2] - 2014-10-26 + +- return `typeof` value if it's not an object. very slight speed improvement +- use `.slice` +- adds benchmarks + +## [0.1.0] - 2014-9-26 + +- first commit + +[6.0.0]: https://github.com/jonschlinkert/kind-of/compare/5.1.0...6.0.0 +[5.1.0]: https://github.com/jonschlinkert/kind-of/compare/5.0.2...5.1.0 +[5.0.2]: https://github.com/jonschlinkert/kind-of/compare/5.0.1...5.0.2 +[5.0.1]: https://github.com/jonschlinkert/kind-of/compare/5.0.0...5.0.1 +[5.0.0]: https://github.com/jonschlinkert/kind-of/compare/4.0.0...5.0.0 +[4.0.0]: https://github.com/jonschlinkert/kind-of/compare/3.2.2...4.0.0 +[3.2.2]: https://github.com/jonschlinkert/kind-of/compare/3.2.1...3.2.2 +[3.2.1]: https://github.com/jonschlinkert/kind-of/compare/3.2.0...3.2.1 +[3.2.0]: https://github.com/jonschlinkert/kind-of/compare/3.1.0...3.2.0 +[3.1.0]: https://github.com/jonschlinkert/kind-of/compare/3.0.4...3.1.0 +[3.0.4]: https://github.com/jonschlinkert/kind-of/compare/3.0.3...3.0.4 +[3.0.3]: https://github.com/jonschlinkert/kind-of/compare/3.0.0...3.0.3 +[3.0.0]: https://github.com/jonschlinkert/kind-of/compare/2.0.1...3.0.0 +[2.0.1]: https://github.com/jonschlinkert/kind-of/compare/2.0.0...2.0.1 +[2.0.0]: https://github.com/jonschlinkert/kind-of/compare/1.1.0...2.0.0 +[1.1.0]: https://github.com/jonschlinkert/kind-of/compare/1.0.0...1.1.0 +[1.0.0]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...1.0.0 +[0.1.2]: https://github.com/jonschlinkert/kind-of/compare/0.1.0...0.1.2 +[0.1.0]: https://github.com/jonschlinkert/kind-of/commit/2fae09b0b19b1aadb558e9be39f0c3ef6034eb87 + +[Unreleased]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...HEAD +[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog + diff --git a/node_modules/randomatic/node_modules/kind-of/LICENSE b/node_modules/randomatic/node_modules/kind-of/LICENSE new file mode 100644 index 000000000..3f2eca18f --- /dev/null +++ b/node_modules/randomatic/node_modules/kind-of/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/randomatic/node_modules/kind-of/README.md b/node_modules/randomatic/node_modules/kind-of/README.md new file mode 100644 index 000000000..4b0d4a818 --- /dev/null +++ b/node_modules/randomatic/node_modules/kind-of/README.md @@ -0,0 +1,365 @@ +# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) + +> Get the native type of a value. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save kind-of +``` + +Install with [bower](https://bower.io/) + +```sh +$ bower install kind-of --save +``` + +## Why use this? + +1. [it's fast](#benchmarks) | [optimizations](#optimizations) +2. [better type checking](#better-type-checking) + +## Usage + +> es5, es6, and browser ready + +```js +var kindOf = require('kind-of'); + +kindOf(undefined); +//=> 'undefined' + +kindOf(null); +//=> 'null' + +kindOf(true); +//=> 'boolean' + +kindOf(false); +//=> 'boolean' + +kindOf(new Buffer('')); +//=> 'buffer' + +kindOf(42); +//=> 'number' + +kindOf('str'); +//=> 'string' + +kindOf(arguments); +//=> 'arguments' + +kindOf({}); +//=> 'object' + +kindOf(Object.create(null)); +//=> 'object' + +kindOf(new Test()); +//=> 'object' + +kindOf(new Date()); +//=> 'date' + +kindOf([1, 2, 3]); +//=> 'array' + +kindOf(/foo/); +//=> 'regexp' + +kindOf(new RegExp('foo')); +//=> 'regexp' + +kindOf(new Error('error')); +//=> 'error' + +kindOf(function () {}); +//=> 'function' + +kindOf(function * () {}); +//=> 'generatorfunction' + +kindOf(Symbol('str')); +//=> 'symbol' + +kindOf(new Map()); +//=> 'map' + +kindOf(new WeakMap()); +//=> 'weakmap' + +kindOf(new Set()); +//=> 'set' + +kindOf(new WeakSet()); +//=> 'weakset' + +kindOf(new Int8Array()); +//=> 'int8array' + +kindOf(new Uint8Array()); +//=> 'uint8array' + +kindOf(new Uint8ClampedArray()); +//=> 'uint8clampedarray' + +kindOf(new Int16Array()); +//=> 'int16array' + +kindOf(new Uint16Array()); +//=> 'uint16array' + +kindOf(new Int32Array()); +//=> 'int32array' + +kindOf(new Uint32Array()); +//=> 'uint32array' + +kindOf(new Float32Array()); +//=> 'float32array' + +kindOf(new Float64Array()); +//=> 'float64array' +``` + +## Benchmarks + +Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). + +```bash +# arguments (32 bytes) + kind-of x 17,024,098 ops/sec ±1.90% (86 runs sampled) + lib-type-of x 11,926,235 ops/sec ±1.34% (83 runs sampled) + lib-typeof x 9,245,257 ops/sec ±1.22% (87 runs sampled) + + fastest is kind-of (by 161% avg) + +# array (22 bytes) + kind-of x 17,196,492 ops/sec ±1.07% (88 runs sampled) + lib-type-of x 8,838,283 ops/sec ±1.02% (87 runs sampled) + lib-typeof x 8,677,848 ops/sec ±0.87% (87 runs sampled) + + fastest is kind-of (by 196% avg) + +# boolean (24 bytes) + kind-of x 16,841,600 ops/sec ±1.10% (86 runs sampled) + lib-type-of x 8,096,787 ops/sec ±0.95% (87 runs sampled) + lib-typeof x 8,423,345 ops/sec ±1.15% (86 runs sampled) + + fastest is kind-of (by 204% avg) + +# buffer (38 bytes) + kind-of x 14,848,060 ops/sec ±1.05% (86 runs sampled) + lib-type-of x 3,671,577 ops/sec ±1.49% (87 runs sampled) + lib-typeof x 8,360,236 ops/sec ±1.24% (86 runs sampled) + + fastest is kind-of (by 247% avg) + +# date (30 bytes) + kind-of x 16,067,761 ops/sec ±1.58% (86 runs sampled) + lib-type-of x 8,954,436 ops/sec ±1.40% (87 runs sampled) + lib-typeof x 8,488,307 ops/sec ±1.51% (84 runs sampled) + + fastest is kind-of (by 184% avg) + +# error (36 bytes) + kind-of x 9,634,090 ops/sec ±1.12% (89 runs sampled) + lib-type-of x 7,735,624 ops/sec ±1.32% (86 runs sampled) + lib-typeof x 7,442,160 ops/sec ±1.11% (90 runs sampled) + + fastest is kind-of (by 127% avg) + +# function (34 bytes) + kind-of x 10,031,494 ops/sec ±1.27% (86 runs sampled) + lib-type-of x 9,502,757 ops/sec ±1.17% (89 runs sampled) + lib-typeof x 8,278,985 ops/sec ±1.08% (88 runs sampled) + + fastest is kind-of (by 113% avg) + +# null (24 bytes) + kind-of x 18,159,808 ops/sec ±1.92% (86 runs sampled) + lib-type-of x 12,927,635 ops/sec ±1.01% (88 runs sampled) + lib-typeof x 7,958,234 ops/sec ±1.21% (89 runs sampled) + + fastest is kind-of (by 174% avg) + +# number (22 bytes) + kind-of x 17,846,779 ops/sec ±0.91% (85 runs sampled) + lib-type-of x 3,316,636 ops/sec ±1.19% (86 runs sampled) + lib-typeof x 2,329,477 ops/sec ±2.21% (85 runs sampled) + + fastest is kind-of (by 632% avg) + +# object-plain (47 bytes) + kind-of x 7,085,155 ops/sec ±1.05% (88 runs sampled) + lib-type-of x 8,870,930 ops/sec ±1.06% (83 runs sampled) + lib-typeof x 8,716,024 ops/sec ±1.05% (87 runs sampled) + + fastest is lib-type-of (by 112% avg) + +# regex (25 bytes) + kind-of x 14,196,052 ops/sec ±1.65% (84 runs sampled) + lib-type-of x 9,554,164 ops/sec ±1.25% (88 runs sampled) + lib-typeof x 8,359,691 ops/sec ±1.07% (87 runs sampled) + + fastest is kind-of (by 158% avg) + +# string (33 bytes) + kind-of x 16,131,428 ops/sec ±1.41% (85 runs sampled) + lib-type-of x 7,273,172 ops/sec ±1.05% (87 runs sampled) + lib-typeof x 7,382,635 ops/sec ±1.17% (85 runs sampled) + + fastest is kind-of (by 220% avg) + +# symbol (34 bytes) + kind-of x 17,011,537 ops/sec ±1.24% (86 runs sampled) + lib-type-of x 3,492,454 ops/sec ±1.23% (89 runs sampled) + lib-typeof x 7,471,235 ops/sec ±2.48% (87 runs sampled) + + fastest is kind-of (by 310% avg) + +# template-strings (36 bytes) + kind-of x 15,434,250 ops/sec ±1.46% (83 runs sampled) + lib-type-of x 7,157,907 ops/sec ±0.97% (87 runs sampled) + lib-typeof x 7,517,986 ops/sec ±0.92% (86 runs sampled) + + fastest is kind-of (by 210% avg) + +# undefined (29 bytes) + kind-of x 19,167,115 ops/sec ±1.71% (87 runs sampled) + lib-type-of x 15,477,740 ops/sec ±1.63% (85 runs sampled) + lib-typeof x 19,075,495 ops/sec ±1.17% (83 runs sampled) + + fastest is lib-typeof,kind-of + +``` + +## Optimizations + +In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: + +1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. +2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. +3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` +4. There is no reason to make the code in a microlib as terse as possible, just to win points for making it shorter. It's always better to favor performant code over terse code. You will always only be using a single `require()` statement to use the library anyway, regardless of how the code is written. + +## Better type checking + +kind-of seems to be more consistently "correct" than other type checking libs I've looked at. For example, here are some differing results from other popular libs: + +### [typeof](https://github.com/CodingFu/typeof) lib + +Incorrectly identifies instances of custom constructors (pretty common): + +```js +var typeOf = require('typeof'); +function Test() {} +console.log(typeOf(new Test())); +//=> 'test' +``` + +Returns `object` instead of `arguments`: + +```js +function foo() { + console.log(typeOf(arguments)) //=> 'object' +} +foo(); +``` + +### [type-of](https://github.com/ForbesLindesay/type-of) lib + +Incorrectly returns `object` for generator functions, buffers, `Map`, `Set`, `WeakMap` and `WeakSet`: + +```js +function * foo() {} +console.log(typeOf(foo)); +//=> 'object' +console.log(typeOf(new Buffer(''))); +//=> 'object' +console.log(typeOf(new Map())); +//=> 'object' +console.log(typeOf(new Set())); +//=> 'object' +console.log(typeOf(new WeakMap())); +//=> 'object' +console.log(typeOf(new WeakSet())); +//=> 'object' +``` + +## About + +
    +Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
    + +
    +Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
    + +
    +Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
    + +### Related projects + +You might also be interested in these projects: + +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 98 | [jonschlinkert](https://github.com/jonschlinkert) | +| 3 | [aretecode](https://github.com/aretecode) | +| 2 | [miguelmota](https://github.com/miguelmota) | +| 1 | [dtothefp](https://github.com/dtothefp) | +| 1 | [ianstormtaylor](https://github.com/ianstormtaylor) | +| 1 | [ksheedlo](https://github.com/ksheedlo) | +| 1 | [pdehaan](https://github.com/pdehaan) | +| 1 | [laggingreflex](https://github.com/laggingreflex) | +| 1 | [charlike-old](https://github.com/charlike-old) | + +### Author + +**Jon Schlinkert** + +* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on December 01, 2017._ \ No newline at end of file diff --git a/node_modules/randomatic/node_modules/kind-of/index.js b/node_modules/randomatic/node_modules/kind-of/index.js new file mode 100644 index 000000000..aa2bb3944 --- /dev/null +++ b/node_modules/randomatic/node_modules/kind-of/index.js @@ -0,0 +1,129 @@ +var toString = Object.prototype.toString; + +module.exports = function kindOf(val) { + if (val === void 0) return 'undefined'; + if (val === null) return 'null'; + + var type = typeof val; + if (type === 'boolean') return 'boolean'; + if (type === 'string') return 'string'; + if (type === 'number') return 'number'; + if (type === 'symbol') return 'symbol'; + if (type === 'function') { + return isGeneratorFn(val) ? 'generatorfunction' : 'function'; + } + + if (isArray(val)) return 'array'; + if (isBuffer(val)) return 'buffer'; + if (isArguments(val)) return 'arguments'; + if (isDate(val)) return 'date'; + if (isError(val)) return 'error'; + if (isRegexp(val)) return 'regexp'; + + switch (ctorName(val)) { + case 'Symbol': return 'symbol'; + case 'Promise': return 'promise'; + + // Set, Map, WeakSet, WeakMap + case 'WeakMap': return 'weakmap'; + case 'WeakSet': return 'weakset'; + case 'Map': return 'map'; + case 'Set': return 'set'; + + // 8-bit typed arrays + case 'Int8Array': return 'int8array'; + case 'Uint8Array': return 'uint8array'; + case 'Uint8ClampedArray': return 'uint8clampedarray'; + + // 16-bit typed arrays + case 'Int16Array': return 'int16array'; + case 'Uint16Array': return 'uint16array'; + + // 32-bit typed arrays + case 'Int32Array': return 'int32array'; + case 'Uint32Array': return 'uint32array'; + case 'Float32Array': return 'float32array'; + case 'Float64Array': return 'float64array'; + } + + if (isGeneratorObj(val)) { + return 'generator'; + } + + // Non-plain objects + type = toString.call(val); + switch (type) { + case '[object Object]': return 'object'; + // iterators + case '[object Map Iterator]': return 'mapiterator'; + case '[object Set Iterator]': return 'setiterator'; + case '[object String Iterator]': return 'stringiterator'; + case '[object Array Iterator]': return 'arrayiterator'; + } + + // other + return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); +}; + +function ctorName(val) { + return val.constructor ? val.constructor.name : null; +} + +function isArray(val) { + if (Array.isArray) return Array.isArray(val); + return val instanceof Array; +} + +function isError(val) { + return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'); +} + +function isDate(val) { + if (val instanceof Date) return true; + return typeof val.toDateString === 'function' + && typeof val.getDate === 'function' + && typeof val.setDate === 'function'; +} + +function isRegexp(val) { + if (val instanceof RegExp) return true; + return typeof val.flags === 'string' + && typeof val.ignoreCase === 'boolean' + && typeof val.multiline === 'boolean' + && typeof val.global === 'boolean'; +} + +function isGeneratorFn(name, val) { + return ctorName(name) === 'GeneratorFunction'; +} + +function isGeneratorObj(val) { + return typeof val.throw === 'function' + && typeof val.return === 'function' + && typeof val.next === 'function'; +} + +function isArguments(val) { + try { + if (typeof val.length === 'number' && typeof val.callee === 'function') { + return true; + } + } catch (err) { + if (err.message.indexOf('callee') !== -1) { + return true; + } + } + return false; +} + +/** + * If you need to support Safari 5-7 (8-10 yr-old browser), + * take a look at https://github.com/feross/is-buffer + */ + +function isBuffer(val) { + if (val.constructor && typeof val.constructor.isBuffer === 'function') { + return val.constructor.isBuffer(val); + } + return false; +} diff --git a/node_modules/randomatic/node_modules/kind-of/package.json b/node_modules/randomatic/node_modules/kind-of/package.json new file mode 100644 index 000000000..3de623494 --- /dev/null +++ b/node_modules/randomatic/node_modules/kind-of/package.json @@ -0,0 +1,143 @@ +{ + "_from": "kind-of@^6.0.0", + "_id": "kind-of@6.0.2", + "_inBundle": false, + "_integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "_location": "/randomatic/kind-of", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "kind-of@^6.0.0", + "name": "kind-of", + "escapedName": "kind-of", + "rawSpec": "^6.0.0", + "saveSpec": null, + "fetchSpec": "^6.0.0" + }, + "_requiredBy": [ + "/randomatic" + ], + "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "_shasum": "01146b36a6218e64e58f3a8d66de5d7fc6f6d051", + "_spec": "kind-of@^6.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/randomatic", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/kind-of/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "David Fox-Powell", + "url": "https://dtothefp.github.io/me" + }, + { + "name": "James", + "url": "https://twitter.com/aretecode" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Ken Sheedlo", + "url": "kensheedlo.com" + }, + { + "name": "laggingreflex", + "url": "https://github.com/laggingreflex" + }, + { + "name": "Miguel Mota", + "url": "https://miguelmota.com" + }, + { + "name": "Peter deHaan", + "url": "http://about.me/peterdehaan" + }, + { + "name": "tunnckoCore", + "url": "https://i.am.charlike.online" + } + ], + "deprecated": false, + "description": "Get the native type of a value.", + "devDependencies": { + "benchmarked": "^2.0.0", + "browserify": "^14.4.0", + "gulp-format-md": "^1.0.0", + "mocha": "^4.0.1", + "write": "^1.0.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/kind-of", + "keywords": [ + "arguments", + "array", + "boolean", + "check", + "date", + "function", + "is", + "is-type", + "is-type-of", + "kind", + "kind-of", + "number", + "object", + "of", + "regexp", + "string", + "test", + "type", + "type-of", + "typeof", + "types" + ], + "license": "MIT", + "main": "index.js", + "name": "kind-of", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/kind-of.git" + }, + "scripts": { + "prepublish": "browserify -o browser.js -e index.js -s index --bare", + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "related": { + "list": [ + "is-glob", + "is-number", + "is-primitive" + ] + }, + "reflinks": [ + "type-of", + "typeof", + "verb" + ] + }, + "version": "6.0.2" +} diff --git a/node_modules/randomatic/package.json b/node_modules/randomatic/package.json new file mode 100644 index 000000000..95fd37f8f --- /dev/null +++ b/node_modules/randomatic/package.json @@ -0,0 +1,135 @@ +{ + "_from": "randomatic@^3.0.0", + "_id": "randomatic@3.1.1", + "_inBundle": false, + "_integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", + "_location": "/randomatic", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "randomatic@^3.0.0", + "name": "randomatic", + "escapedName": "randomatic", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/fill-range" + ], + "_resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", + "_shasum": "b776efc59375984e36c537b2f51a1f0aff0da1ed", + "_spec": "randomatic@^3.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/fill-range", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/randomatic/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Bogdan Chadkin", + "url": "https://github.com/TrySound" + }, + { + "name": "Dragos Fotescu", + "url": "http://dragosfotescu.com" + }, + { + "name": "Faiz ul haque", + "url": "http://www.10pearls.com" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Michael Rhodes", + "url": "http://michaelrhod.es" + }, + { + "name": "Paul Miller", + "url": "https://paulmillr.com" + }, + { + "name": "Rouven Weßling", + "url": "www.rouvenwessling.de" + }, + { + "name": "Sun Knudsen", + "url": "https://sunknudsen.com" + } + ], + "dependencies": { + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" + }, + "deprecated": false, + "description": "Generate randomized strings of a specified length using simple character sequences. The original generate-password.", + "devDependencies": { + "ansi-bold": "^0.1.1", + "benchmarked": "^1.1.1", + "glob": "^7.1.2", + "gulp-format-md": "^0.1.12", + "mocha": "^3.4.2" + }, + "engines": { + "node": ">= 0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/randomatic", + "keywords": [ + "alpha", + "alpha-numeric", + "alphanumeric", + "characters", + "chars", + "generate", + "generate-password", + "numeric", + "password", + "rand", + "random", + "randomatic", + "randomize", + "randomized" + ], + "license": "MIT", + "main": "index.js", + "name": "randomatic", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/randomatic.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "pad-left", + "pad-right", + "repeat-string" + ] + }, + "lint": { + "reflinks": true + } + }, + "version": "3.1.1" +} diff --git a/node_modules/randombytes/.travis.yml b/node_modules/randombytes/.travis.yml new file mode 100644 index 000000000..69fdf7130 --- /dev/null +++ b/node_modules/randombytes/.travis.yml @@ -0,0 +1,15 @@ +sudo: false +language: node_js +matrix: + include: + - node_js: '7' + env: TEST_SUITE=test + - node_js: '6' + env: TEST_SUITE=test + - node_js: '5' + env: TEST_SUITE=test + - node_js: '4' + env: TEST_SUITE=test + - node_js: '4' + env: TEST_SUITE=phantom +script: "npm run-script $TEST_SUITE" diff --git a/node_modules/randombytes/.zuul.yml b/node_modules/randombytes/.zuul.yml new file mode 100644 index 000000000..96d9cfbd3 --- /dev/null +++ b/node_modules/randombytes/.zuul.yml @@ -0,0 +1 @@ +ui: tape diff --git a/node_modules/randombytes/LICENSE b/node_modules/randombytes/LICENSE new file mode 100644 index 000000000..fea9d48a4 --- /dev/null +++ b/node_modules/randombytes/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 crypto-browserify + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/randombytes/README.md b/node_modules/randombytes/README.md new file mode 100644 index 000000000..3bacba4d1 --- /dev/null +++ b/node_modules/randombytes/README.md @@ -0,0 +1,14 @@ +randombytes +=== + +[![Version](http://img.shields.io/npm/v/randombytes.svg)](https://www.npmjs.org/package/randombytes) [![Build Status](https://travis-ci.org/crypto-browserify/randombytes.svg?branch=master)](https://travis-ci.org/crypto-browserify/randombytes) + +randombytes from node that works in the browser. In node you just get crypto.randomBytes, but in the browser it uses .crypto/msCrypto.getRandomValues + +```js +var randomBytes = require('randombytes'); +randomBytes(16);//get 16 random bytes +randomBytes(16, function (err, resp) { + // resp is 16 random bytes +}); +``` diff --git a/node_modules/randombytes/browser.js b/node_modules/randombytes/browser.js new file mode 100644 index 000000000..58990c557 --- /dev/null +++ b/node_modules/randombytes/browser.js @@ -0,0 +1,38 @@ +'use strict' + +function oldBrowser () { + throw new Error('Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11') +} + +var Buffer = require('safe-buffer').Buffer +var crypto = global.crypto || global.msCrypto + +if (crypto && crypto.getRandomValues) { + module.exports = randomBytes +} else { + module.exports = oldBrowser +} + +function randomBytes (size, cb) { + // phantomjs needs to throw + if (size > 65536) throw new Error('requested too many random bytes') + // in case browserify isn't using the Uint8Array version + var rawBytes = new global.Uint8Array(size) + + // This will not work in older browsers. + // See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues + if (size > 0) { // getRandomValues fails on IE if size == 0 + crypto.getRandomValues(rawBytes) + } + + // XXX: phantomjs doesn't like a buffer being passed here + var bytes = Buffer.from(rawBytes.buffer) + + if (typeof cb === 'function') { + return process.nextTick(function () { + cb(null, bytes) + }) + } + + return bytes +} diff --git a/node_modules/randombytes/index.js b/node_modules/randombytes/index.js new file mode 100644 index 000000000..a2d9e3911 --- /dev/null +++ b/node_modules/randombytes/index.js @@ -0,0 +1 @@ +module.exports = require('crypto').randomBytes diff --git a/node_modules/randombytes/package.json b/node_modules/randombytes/package.json new file mode 100644 index 000000000..479ae6e6a --- /dev/null +++ b/node_modules/randombytes/package.json @@ -0,0 +1,65 @@ +{ + "_from": "randombytes@^2.0.0", + "_id": "randombytes@2.0.6", + "_inBundle": false, + "_integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", + "_location": "/randombytes", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "randombytes@^2.0.0", + "name": "randombytes", + "escapedName": "randombytes", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/browserify-rsa", + "/crypto-browserify", + "/diffie-hellman", + "/public-encrypt", + "/randomfill" + ], + "_resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", + "_shasum": "d302c522948588848a8d300c932b44c24231da80", + "_spec": "randombytes@^2.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/crypto-browserify", + "author": "", + "browser": "browser.js", + "bugs": { + "url": "https://github.com/crypto-browserify/randombytes/issues" + }, + "bundleDependencies": false, + "dependencies": { + "safe-buffer": "^5.1.0" + }, + "deprecated": false, + "description": "random bytes from browserify stand alone", + "devDependencies": { + "phantomjs": "^1.9.9", + "standard": "^10.0.2", + "tap-spec": "^2.1.2", + "tape": "^4.6.3", + "zuul": "^3.7.2" + }, + "homepage": "https://github.com/crypto-browserify/randombytes", + "keywords": [ + "crypto", + "random" + ], + "license": "MIT", + "main": "index.js", + "name": "randombytes", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/crypto-browserify/randombytes.git" + }, + "scripts": { + "local": "zuul --local --no-coverage -- test.js", + "phantom": "zuul --phantom -- test.js", + "test": "standard && node test.js | tspec" + }, + "version": "2.0.6" +} diff --git a/node_modules/randombytes/test.js b/node_modules/randombytes/test.js new file mode 100644 index 000000000..8e34dcaa4 --- /dev/null +++ b/node_modules/randombytes/test.js @@ -0,0 +1,56 @@ +var test = require('tape') +var randomBytes = require('./') + +test('sync', function (t) { + t.plan(4) + t.equals(randomBytes(0).length, 0, 'len: ' + 0) + t.equals(randomBytes(3).length, 3, 'len: ' + 3) + t.equals(randomBytes(30).length, 30, 'len: ' + 30) + t.equals(randomBytes(300).length, 300, 'len: ' + 300) +}) + +test('async', function (t) { + t.plan(4) + + randomBytes(0, function (err, resp) { + if (err) throw err + + t.equals(resp.length, 0, 'len: ' + 0) + }) + + randomBytes(3, function (err, resp) { + if (err) throw err + + t.equals(resp.length, 3, 'len: ' + 3) + }) + + randomBytes(30, function (err, resp) { + if (err) throw err + + t.equals(resp.length, 30, 'len: ' + 30) + }) + + randomBytes(300, function (err, resp) { + if (err) throw err + + t.equals(resp.length, 300, 'len: ' + 300) + }) +}) + +if (process.browser) { + test('requesting to much throws', function (t) { + t.plan(1) + t.throws(function () { + randomBytes(65537) + }) + }) + + test('requesting to much throws async', function (t) { + t.plan(1) + t.throws(function () { + randomBytes(65537, function () { + t.ok(false, 'should not get here') + }) + }) + }) +} diff --git a/node_modules/randomfill/.travis.yml b/node_modules/randomfill/.travis.yml new file mode 100644 index 000000000..69fdf7130 --- /dev/null +++ b/node_modules/randomfill/.travis.yml @@ -0,0 +1,15 @@ +sudo: false +language: node_js +matrix: + include: + - node_js: '7' + env: TEST_SUITE=test + - node_js: '6' + env: TEST_SUITE=test + - node_js: '5' + env: TEST_SUITE=test + - node_js: '4' + env: TEST_SUITE=test + - node_js: '4' + env: TEST_SUITE=phantom +script: "npm run-script $TEST_SUITE" diff --git a/node_modules/randomfill/.zuul.yml b/node_modules/randomfill/.zuul.yml new file mode 100644 index 000000000..96d9cfbd3 --- /dev/null +++ b/node_modules/randomfill/.zuul.yml @@ -0,0 +1 @@ +ui: tape diff --git a/node_modules/randomfill/LICENSE b/node_modules/randomfill/LICENSE new file mode 100644 index 000000000..fea9d48a4 --- /dev/null +++ b/node_modules/randomfill/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 crypto-browserify + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/randomfill/README.md b/node_modules/randomfill/README.md new file mode 100644 index 000000000..1ae13adfa --- /dev/null +++ b/node_modules/randomfill/README.md @@ -0,0 +1,15 @@ +randomfill +=== + +[![Version](http://img.shields.io/npm/v/randomfill.svg)](https://www.npmjs.org/package/randomfill) + +randomfill from node that works in the browser. In node you just get crypto.randomBytes, but in the browser it uses .crypto/msCrypto.getRandomValues + +```js +var randomFill = require('randomfill'); +var buf +randomFill.randomFillSync(16);//get 16 random bytes +randomFill.randomFill(16, function (err, resp) { + // resp is 16 random bytes +}); +``` diff --git a/node_modules/randomfill/browser.js b/node_modules/randomfill/browser.js new file mode 100644 index 000000000..ce34a693e --- /dev/null +++ b/node_modules/randomfill/browser.js @@ -0,0 +1,108 @@ +'use strict' + +function oldBrowser () { + throw new Error('secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11') +} +var safeBuffer = require('safe-buffer') +var randombytes = require('randombytes') +var Buffer = safeBuffer.Buffer +var kBufferMaxLength = safeBuffer.kMaxLength +var crypto = global.crypto || global.msCrypto +var kMaxUint32 = Math.pow(2, 32) - 1 +function assertOffset (offset, length) { + if (typeof offset !== 'number' || offset !== offset) { // eslint-disable-line no-self-compare + throw new TypeError('offset must be a number') + } + + if (offset > kMaxUint32 || offset < 0) { + throw new TypeError('offset must be a uint32') + } + + if (offset > kBufferMaxLength || offset > length) { + throw new RangeError('offset out of range') + } +} + +function assertSize (size, offset, length) { + if (typeof size !== 'number' || size !== size) { // eslint-disable-line no-self-compare + throw new TypeError('size must be a number') + } + + if (size > kMaxUint32 || size < 0) { + throw new TypeError('size must be a uint32') + } + + if (size + offset > length || size > kBufferMaxLength) { + throw new RangeError('buffer too small') + } +} +if ((crypto && crypto.getRandomValues) || !process.browser) { + exports.randomFill = randomFill + exports.randomFillSync = randomFillSync +} else { + exports.randomFill = oldBrowser + exports.randomFillSync = oldBrowser +} +function randomFill (buf, offset, size, cb) { + if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) { + throw new TypeError('"buf" argument must be a Buffer or Uint8Array') + } + + if (typeof offset === 'function') { + cb = offset + offset = 0 + size = buf.length + } else if (typeof size === 'function') { + cb = size + size = buf.length - offset + } else if (typeof cb !== 'function') { + throw new TypeError('"cb" argument must be a function') + } + assertOffset(offset, buf.length) + assertSize(size, offset, buf.length) + return actualFill(buf, offset, size, cb) +} + +function actualFill (buf, offset, size, cb) { + if (process.browser) { + var ourBuf = buf.buffer + var uint = new Uint8Array(ourBuf, offset, size) + crypto.getRandomValues(uint) + if (cb) { + process.nextTick(function () { + cb(null, buf) + }) + return + } + return buf + } + if (cb) { + randombytes(size, function (err, bytes) { + if (err) { + return cb(err) + } + bytes.copy(buf, offset) + cb(null, buf) + }) + return + } + var bytes = randombytes(size) + bytes.copy(buf, offset) + return buf +} +function randomFillSync (buf, offset, size) { + if (typeof offset === 'undefined') { + offset = 0 + } + if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) { + throw new TypeError('"buf" argument must be a Buffer or Uint8Array') + } + + assertOffset(offset, buf.length) + + if (size === undefined) size = buf.length - offset + + assertSize(size, offset, buf.length) + + return actualFill(buf, offset, size) +} diff --git a/node_modules/randomfill/index.js b/node_modules/randomfill/index.js new file mode 100644 index 000000000..e2b5f7a70 --- /dev/null +++ b/node_modules/randomfill/index.js @@ -0,0 +1,7 @@ +var crypto = require('crypto') +if (typeof crypto.randomFill === 'function' && typeof crypto.randomFillSync === 'function') { + exports.randomFill = crypto.randomFill + exports.randomFillSync = crypto.randomFillSync +} else { + module.exports = require('./browser') +} diff --git a/node_modules/randomfill/package.json b/node_modules/randomfill/package.json new file mode 100644 index 000000000..418bf3e15 --- /dev/null +++ b/node_modules/randomfill/package.json @@ -0,0 +1,62 @@ +{ + "_from": "randomfill@^1.0.3", + "_id": "randomfill@1.0.4", + "_inBundle": false, + "_integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "_location": "/randomfill", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "randomfill@^1.0.3", + "name": "randomfill", + "escapedName": "randomfill", + "rawSpec": "^1.0.3", + "saveSpec": null, + "fetchSpec": "^1.0.3" + }, + "_requiredBy": [ + "/crypto-browserify" + ], + "_resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "_shasum": "c92196fc86ab42be983f1bf31778224931d61458", + "_spec": "randomfill@^1.0.3", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/crypto-browserify", + "author": "", + "browser": "browser.js", + "bugs": { + "url": "https://github.com/crypto-browserify/randomfill/issues" + }, + "bundleDependencies": false, + "dependencies": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + }, + "deprecated": false, + "description": "random fill from browserify stand alone", + "devDependencies": { + "phantomjs": "^1.9.9", + "standard": "^10.0.2", + "tap-spec": "^2.1.2", + "tape": "^4.6.3", + "zuul": "^3.7.2" + }, + "homepage": "https://github.com/crypto-browserify/randomfill", + "keywords": [ + "crypto", + "random" + ], + "license": "MIT", + "main": "index.js", + "name": "randomfill", + "repository": { + "type": "git", + "url": "git+https://github.com/crypto-browserify/randomfill.git" + }, + "scripts": { + "local": "zuul --local --no-coverage -- test.js", + "phantom": "zuul --phantom -- test.js", + "test": "standard && node test.js | tspec" + }, + "version": "1.0.4" +} diff --git a/node_modules/randomfill/test.js b/node_modules/randomfill/test.js new file mode 100644 index 000000000..eff227c2e --- /dev/null +++ b/node_modules/randomfill/test.js @@ -0,0 +1,28 @@ +var test = require('tape') +var crypto = require('./browser') +var Buffer = require('safe-buffer').Buffer +test('sync', function (t) { + t.test('first', function (t) { + const buf = Buffer.alloc(10) + const before = buf.toString('hex') + crypto.randomFillSync(buf, 5, 5) + const after = buf.toString('hex') + t.notEqual(before, after) + t.equal(before.slice(0, 10), after.slice(0, 10)) + t.end() + }) +}) +test('async', function (t) { + t.test('first', function (t) { + const buf = Buffer.alloc(10) + const before = buf.toString('hex') + crypto.randomFill(buf, 5, 5, function (err, bufa) { + t.error(err) + const after = bufa.toString('hex') + t.notEqual(before, after) + t.equal(before.slice(0, 10), after.slice(0, 10)) + t.ok(buf === bufa, 'same buffer') + t.end() + }) + }) +}) diff --git a/node_modules/range-parser/HISTORY.md b/node_modules/range-parser/HISTORY.md new file mode 100644 index 000000000..5e01eef46 --- /dev/null +++ b/node_modules/range-parser/HISTORY.md @@ -0,0 +1,51 @@ +1.2.0 / 2016-06-01 +================== + + * Add `combine` option to combine overlapping ranges + +1.1.0 / 2016-05-13 +================== + + * Fix incorrectly returning -1 when there is at least one valid range + * perf: remove internal function + +1.0.3 / 2015-10-29 +================== + + * perf: enable strict mode + +1.0.2 / 2014-09-08 +================== + + * Support Node.js 0.6 + +1.0.1 / 2014-09-07 +================== + + * Move repository to jshttp + +1.0.0 / 2013-12-11 +================== + + * Add repository to package.json + * Add MIT license + +0.0.4 / 2012-06-17 +================== + + * Change ret -1 for unsatisfiable and -2 when invalid + +0.0.3 / 2012-06-17 +================== + + * Fix last-byte-pos default to len - 1 + +0.0.2 / 2012-06-14 +================== + + * Add `.type` + +0.0.1 / 2012-06-11 +================== + + * Initial release diff --git a/node_modules/range-parser/LICENSE b/node_modules/range-parser/LICENSE new file mode 100644 index 000000000..359995436 --- /dev/null +++ b/node_modules/range-parser/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2012-2014 TJ Holowaychuk +Copyright (c) 2015-2016 Douglas Christopher Wilson [ +// { start: 0, end: 10 }, +// { start: 50, end: 60 } +// ] +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/range-parser.svg +[npm-url]: https://npmjs.org/package/range-parser +[node-version-image]: https://img.shields.io/node/v/range-parser.svg +[node-version-url]: https://nodejs.org/endownload +[travis-image]: https://img.shields.io/travis/jshttp/range-parser.svg +[travis-url]: https://travis-ci.org/jshttp/range-parser +[coveralls-image]: https://img.shields.io/coveralls/jshttp/range-parser.svg +[coveralls-url]: https://coveralls.io/r/jshttp/range-parser +[downloads-image]: https://img.shields.io/npm/dm/range-parser.svg +[downloads-url]: https://npmjs.org/package/range-parser diff --git a/node_modules/range-parser/index.js b/node_modules/range-parser/index.js new file mode 100644 index 000000000..83b2eb6b3 --- /dev/null +++ b/node_modules/range-parser/index.js @@ -0,0 +1,158 @@ +/*! + * range-parser + * Copyright(c) 2012-2014 TJ Holowaychuk + * Copyright(c) 2015-2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = rangeParser + +/** + * Parse "Range" header `str` relative to the given file `size`. + * + * @param {Number} size + * @param {String} str + * @param {Object} [options] + * @return {Array} + * @public + */ + +function rangeParser (size, str, options) { + var index = str.indexOf('=') + + if (index === -1) { + return -2 + } + + // split the range string + var arr = str.slice(index + 1).split(',') + var ranges = [] + + // add ranges type + ranges.type = str.slice(0, index) + + // parse all ranges + for (var i = 0; i < arr.length; i++) { + var range = arr[i].split('-') + var start = parseInt(range[0], 10) + var end = parseInt(range[1], 10) + + // -nnn + if (isNaN(start)) { + start = size - end + end = size - 1 + // nnn- + } else if (isNaN(end)) { + end = size - 1 + } + + // limit last-byte-pos to current length + if (end > size - 1) { + end = size - 1 + } + + // invalid or unsatisifiable + if (isNaN(start) || isNaN(end) || start > end || start < 0) { + continue + } + + // add range + ranges.push({ + start: start, + end: end + }) + } + + if (ranges.length < 1) { + // unsatisifiable + return -1 + } + + return options && options.combine + ? combineRanges(ranges) + : ranges +} + +/** + * Combine overlapping & adjacent ranges. + * @private + */ + +function combineRanges (ranges) { + var ordered = ranges.map(mapWithIndex).sort(sortByRangeStart) + + for (var j = 0, i = 1; i < ordered.length; i++) { + var range = ordered[i] + var current = ordered[j] + + if (range.start > current.end + 1) { + // next range + ordered[++j] = range + } else if (range.end > current.end) { + // extend range + current.end = range.end + current.index = Math.min(current.index, range.index) + } + } + + // trim ordered array + ordered.length = j + 1 + + // generate combined range + var combined = ordered.sort(sortByRangeIndex).map(mapWithoutIndex) + + // copy ranges type + combined.type = ranges.type + + return combined +} + +/** + * Map function to add index value to ranges. + * @private + */ + +function mapWithIndex (range, index) { + return { + start: range.start, + end: range.end, + index: index + } +} + +/** + * Map function to remove index value from ranges. + * @private + */ + +function mapWithoutIndex (range) { + return { + start: range.start, + end: range.end + } +} + +/** + * Sort function to sort ranges by index. + * @private + */ + +function sortByRangeIndex (a, b) { + return a.index - b.index +} + +/** + * Sort function to sort ranges by start position. + * @private + */ + +function sortByRangeStart (a, b) { + return a.start - b.start +} diff --git a/node_modules/range-parser/package.json b/node_modules/range-parser/package.json new file mode 100644 index 000000000..38f5aaadc --- /dev/null +++ b/node_modules/range-parser/package.json @@ -0,0 +1,86 @@ +{ + "_from": "range-parser@~1.2.0", + "_id": "range-parser@1.2.0", + "_inBundle": false, + "_integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", + "_location": "/range-parser", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "range-parser@~1.2.0", + "name": "range-parser", + "escapedName": "range-parser", + "rawSpec": "~1.2.0", + "saveSpec": null, + "fetchSpec": "~1.2.0" + }, + "_requiredBy": [ + "/send" + ], + "_resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "_shasum": "f49be6b487894ddc40dcc94a322f611092e00d5e", + "_spec": "range-parser@~1.2.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/send", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca", + "url": "http://tjholowaychuk.com" + }, + "bugs": { + "url": "https://github.com/jshttp/range-parser/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "James Wyatt Cready", + "email": "wyatt.cready@lanetix.com" + }, + { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + } + ], + "deprecated": false, + "description": "Range header field string parser", + "devDependencies": { + "eslint": "2.11.1", + "eslint-config-standard": "5.3.1", + "eslint-plugin-promise": "1.1.0", + "eslint-plugin-standard": "1.3.2", + "istanbul": "0.4.3", + "mocha": "1.21.5" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "index.js" + ], + "homepage": "https://github.com/jshttp/range-parser#readme", + "keywords": [ + "range", + "parser", + "http" + ], + "license": "MIT", + "name": "range-parser", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/range-parser.git" + }, + "scripts": { + "lint": "eslint **/*.js", + "test": "mocha --reporter spec", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" + }, + "version": "1.2.0" +} diff --git a/node_modules/read-only-stream/.travis.yml b/node_modules/read-only-stream/.travis.yml new file mode 100644 index 000000000..9672e1293 --- /dev/null +++ b/node_modules/read-only-stream/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: + - "0.8" + - "0.10" +before_install: + - npm install -g npm@~1.4.6 diff --git a/node_modules/read-only-stream/LICENSE b/node_modules/read-only-stream/LICENSE new file mode 100644 index 000000000..ee27ba4b4 --- /dev/null +++ b/node_modules/read-only-stream/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/read-only-stream/example/main.js b/node_modules/read-only-stream/example/main.js new file mode 100644 index 000000000..22720fe3c --- /dev/null +++ b/node_modules/read-only-stream/example/main.js @@ -0,0 +1,3 @@ +var wrap = require('./wrap.js'); +var ro = wrap(); // can't write to `ro` and muck up internal state +ro.pipe(process.stdout); diff --git a/node_modules/read-only-stream/example/wrap.js b/node_modules/read-only-stream/example/wrap.js new file mode 100644 index 000000000..55860810a --- /dev/null +++ b/node_modules/read-only-stream/example/wrap.js @@ -0,0 +1,8 @@ +var through = require('through2'); +var readonly = require('../'); + +module.exports = function () { + var stream = through(); + stream.end('wooooo\n'); + return readonly(stream); +}; diff --git a/node_modules/read-only-stream/index.js b/node_modules/read-only-stream/index.js new file mode 100644 index 000000000..68c495deb --- /dev/null +++ b/node_modules/read-only-stream/index.js @@ -0,0 +1,30 @@ +var Readable = require('readable-stream').Readable; + +module.exports = function (stream) { + var opts = stream._readableState; + if (typeof stream.read !== 'function') { + stream = new Readable(opts).wrap(stream); + } + + var ro = new Readable({ objectMode: opts && opts.objectMode }); + var waiting = false; + + stream.on('readable', function () { + if (waiting) { + waiting = false; + ro._read(); + } + }); + + ro._read = function () { + var buf, reads = 0; + while ((buf = stream.read()) !== null) { + ro.push(buf); + reads ++; + } + if (reads === 0) waiting = true; + }; + stream.once('end', function () { ro.push(null) }); + stream.on('error', function (err) { ro.emit('error', err) }); + return ro; +}; diff --git a/node_modules/read-only-stream/package.json b/node_modules/read-only-stream/package.json new file mode 100644 index 000000000..0b7307667 --- /dev/null +++ b/node_modules/read-only-stream/package.json @@ -0,0 +1,63 @@ +{ + "_from": "read-only-stream@^2.0.0", + "_id": "read-only-stream@2.0.0", + "_inBundle": false, + "_integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", + "_location": "/read-only-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "read-only-stream@^2.0.0", + "name": "read-only-stream", + "escapedName": "read-only-stream", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/browserify" + ], + "_resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", + "_shasum": "2724fd6a8113d73764ac288d4386270c1dbf17f0", + "_spec": "read-only-stream@^2.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/read-only-stream/issues" + }, + "bundleDependencies": false, + "dependencies": { + "readable-stream": "^2.0.2" + }, + "deprecated": false, + "description": "wrap a readable/writable stream to be read-only", + "devDependencies": { + "concat-stream": "^1.4.6", + "covert": "^1.0.0", + "tape": "^4.2.0", + "through": "^2.3.4", + "through2": "^2.0.0" + }, + "homepage": "https://github.com/substack/read-only-stream", + "keywords": [ + "stream", + "readonly" + ], + "license": "MIT", + "main": "index.js", + "name": "read-only-stream", + "repository": { + "type": "git", + "url": "git://github.com/substack/read-only-stream.git" + }, + "scripts": { + "coverage": "covert test/*.js", + "test": "tape test/*.js" + }, + "version": "2.0.0" +} diff --git a/node_modules/read-only-stream/readme.markdown b/node_modules/read-only-stream/readme.markdown new file mode 100644 index 000000000..05e6a9db7 --- /dev/null +++ b/node_modules/read-only-stream/readme.markdown @@ -0,0 +1,60 @@ +# read-only-stream + +wrap a readable/writable stream to be read-only +to prevent mucking up the input side + +[![build status](https://secure.travis-ci.org/substack/read-only-stream.png)](http://travis-ci.org/substack/read-only-stream) + +# example + +Suppose you have a module that uses a readable/writable stream internally but +want to expose just the readable part of that internal stream. This is common if +you use the writable side internally and expose the readable side as the +interface. + +Now we can write some code like this with a `through` stream internally for +convenience: + +``` js +var through = require('through2'); +var readonly = require('read-only-stream'); + +module.exports = function () { + var stream = through(); + stream.end('wooooo\n'); + return readonly(stream); +}; +``` + +but consumers won't be able to write to the input side and break the api: + +``` js +var wrap = require('./wrap.js'); +var ro = wrap(); // can't write to `ro` and muck up internal state +ro.pipe(process.stdout); +``` + +# methods + +``` js +var readonly = require('read-only-stream') +``` + +## var ro = readonly(stream) + +Return a readable stream `ro` that wraps the readable/writable `stream` argument +given to only expose the readable side. + +`stream` can be a streams1 or streams2 stream. + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install read-only-stream +``` + +# license + +MIT diff --git a/node_modules/read-only-stream/test/error.js b/node_modules/read-only-stream/test/error.js new file mode 100644 index 000000000..e53447c6a --- /dev/null +++ b/node_modules/read-only-stream/test/error.js @@ -0,0 +1,15 @@ +var test = require('tape'); +var readonly = require('../'); +var through = require('through2'); + +test('error', function (t) { + t.plan(1); + + var stream = through(); + var ro = readonly(stream); + + ro.on('error', function (err) { + t.ok(err); + }); + stream.emit('error', new Error); +}); diff --git a/node_modules/read-only-stream/test/ro.js b/node_modules/read-only-stream/test/ro.js new file mode 100644 index 000000000..b7f4a5518 --- /dev/null +++ b/node_modules/read-only-stream/test/ro.js @@ -0,0 +1,22 @@ +var test = require('tape'); +var readonly = require('../'); +var through = require('through2'); +var concat = require('concat-stream'); + +test('readonly', function (t) { + t.plan(2); + + var stream = through(); + stream.write('woo'); + + var ro = readonly(stream); + ro.pipe(concat(function (body) { + t.equal(body.toString('utf8'), 'woo'); + })); + + t.throws(function () { + ro.write('beep'); + }); + + stream.end(); +}); diff --git a/node_modules/read-only-stream/test/streams1.js b/node_modules/read-only-stream/test/streams1.js new file mode 100644 index 000000000..dfe408fa8 --- /dev/null +++ b/node_modules/read-only-stream/test/streams1.js @@ -0,0 +1,21 @@ +var test = require('tape'); +var readonly = require('../'); +var through = require('through'); +var concat = require('concat-stream'); + +test('streams1', function (t) { + t.plan(2); + + var stream = through(); + + var ro = readonly(stream); + ro.pipe(concat(function (body) { + t.equal(body.toString('utf8'), 'woo'); + })); + + t.throws(function () { + ro.write('beep'); + }); + + stream.end('woo'); +}); diff --git a/node_modules/readable-stream/.travis.yml b/node_modules/readable-stream/.travis.yml new file mode 100644 index 000000000..40992555b --- /dev/null +++ b/node_modules/readable-stream/.travis.yml @@ -0,0 +1,55 @@ +sudo: false +language: node_js +before_install: + - npm install -g npm@2 + - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g +notifications: + email: false +matrix: + fast_finish: true + include: + - node_js: '0.8' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.10' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.11' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.12' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 1 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 2 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 3 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 4 + env: TASK=test + - node_js: 5 + env: TASK=test + - node_js: 6 + env: TASK=test + - node_js: 7 + env: TASK=test + - node_js: 8 + env: TASK=test + - node_js: 9 + env: TASK=test +script: "npm run $TASK" +env: + global: + - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= + - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/node_modules/readable-stream/CONTRIBUTING.md b/node_modules/readable-stream/CONTRIBUTING.md new file mode 100644 index 000000000..f478d58dc --- /dev/null +++ b/node_modules/readable-stream/CONTRIBUTING.md @@ -0,0 +1,38 @@ +# Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +* (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +* (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +* (c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +* (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + +## Moderation Policy + +The [Node.js Moderation Policy] applies to this WG. + +## Code of Conduct + +The [Node.js Code of Conduct][] applies to this WG. + +[Node.js Code of Conduct]: +https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md +[Node.js Moderation Policy]: +https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md diff --git a/node_modules/readable-stream/GOVERNANCE.md b/node_modules/readable-stream/GOVERNANCE.md new file mode 100644 index 000000000..16ffb93f2 --- /dev/null +++ b/node_modules/readable-stream/GOVERNANCE.md @@ -0,0 +1,136 @@ +### Streams Working Group + +The Node.js Streams is jointly governed by a Working Group +(WG) +that is responsible for high-level guidance of the project. + +The WG has final authority over this project including: + +* Technical direction +* Project governance and process (including this policy) +* Contribution policy +* GitHub repository hosting +* Conduct guidelines +* Maintaining the list of additional Collaborators + +For the current list of WG members, see the project +[README.md](./README.md#current-project-team-members). + +### Collaborators + +The readable-stream GitHub repository is +maintained by the WG and additional Collaborators who are added by the +WG on an ongoing basis. + +Individuals making significant and valuable contributions are made +Collaborators and given commit-access to the project. These +individuals are identified by the WG and their addition as +Collaborators is discussed during the WG meeting. + +_Note:_ If you make a significant contribution and are not considered +for commit-access log an issue or contact a WG member directly and it +will be brought up in the next WG meeting. + +Modifications of the contents of the readable-stream repository are +made on +a collaborative basis. Anybody with a GitHub account may propose a +modification via pull request and it will be considered by the project +Collaborators. All pull requests must be reviewed and accepted by a +Collaborator with sufficient expertise who is able to take full +responsibility for the change. In the case of pull requests proposed +by an existing Collaborator, an additional Collaborator is required +for sign-off. Consensus should be sought if additional Collaborators +participate and there is disagreement around a particular +modification. See _Consensus Seeking Process_ below for further detail +on the consensus model used for governance. + +Collaborators may opt to elevate significant or controversial +modifications, or modifications that have not found consensus to the +WG for discussion by assigning the ***WG-agenda*** tag to a pull +request or issue. The WG should serve as the final arbiter where +required. + +For the current list of Collaborators, see the project +[README.md](./README.md#members). + +### WG Membership + +WG seats are not time-limited. There is no fixed size of the WG. +However, the expected target is between 6 and 12, to ensure adequate +coverage of important areas of expertise, balanced with the ability to +make decisions efficiently. + +There is no specific set of requirements or qualifications for WG +membership beyond these rules. + +The WG may add additional members to the WG by unanimous consensus. + +A WG member may be removed from the WG by voluntary resignation, or by +unanimous consensus of all other WG members. + +Changes to WG membership should be posted in the agenda, and may be +suggested as any other agenda item (see "WG Meetings" below). + +If an addition or removal is proposed during a meeting, and the full +WG is not in attendance to participate, then the addition or removal +is added to the agenda for the subsequent meeting. This is to ensure +that all members are given the opportunity to participate in all +membership decisions. If a WG member is unable to attend a meeting +where a planned membership decision is being made, then their consent +is assumed. + +No more than 1/3 of the WG members may be affiliated with the same +employer. If removal or resignation of a WG member, or a change of +employment by a WG member, creates a situation where more than 1/3 of +the WG membership shares an employer, then the situation must be +immediately remedied by the resignation or removal of one or more WG +members affiliated with the over-represented employer(s). + +### WG Meetings + +The WG meets occasionally on a Google Hangout On Air. A designated moderator +approved by the WG runs the meeting. Each meeting should be +published to YouTube. + +Items are added to the WG agenda that are considered contentious or +are modifications of governance, contribution policy, WG membership, +or release process. + +The intention of the agenda is not to approve or review all patches; +that should happen continuously on GitHub and be handled by the larger +group of Collaborators. + +Any community member or contributor can ask that something be added to +the next meeting's agenda by logging a GitHub Issue. Any Collaborator, +WG member or the moderator can add the item to the agenda by adding +the ***WG-agenda*** tag to the issue. + +Prior to each WG meeting the moderator will share the Agenda with +members of the WG. WG members can add any items they like to the +agenda at the beginning of each meeting. The moderator and the WG +cannot veto or remove items. + +The WG may invite persons or representatives from certain projects to +participate in a non-voting capacity. + +The moderator is responsible for summarizing the discussion of each +agenda item and sends it as a pull request after the meeting. + +### Consensus Seeking Process + +The WG follows a +[Consensus +Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) +decision-making model. + +When an agenda item has appeared to reach a consensus the moderator +will ask "Does anyone object?" as a final call for dissent from the +consensus. + +If an agenda item cannot reach a consensus a WG member can call for +either a closing vote or a vote to table the issue to the next +meeting. The call for a vote must be seconded by a majority of the WG +or else the discussion will continue. Simple majority wins. + +Note that changes to WG membership require a majority consensus. See +"WG Membership" above. diff --git a/node_modules/readable-stream/LICENSE b/node_modules/readable-stream/LICENSE new file mode 100644 index 000000000..2873b3b2e --- /dev/null +++ b/node_modules/readable-stream/LICENSE @@ -0,0 +1,47 @@ +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +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. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/node_modules/readable-stream/README.md b/node_modules/readable-stream/README.md new file mode 100644 index 000000000..23fe3f3e3 --- /dev/null +++ b/node_modules/readable-stream/README.md @@ -0,0 +1,58 @@ +# readable-stream + +***Node-core v8.11.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) + + +[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) +[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) + + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) + +```bash +npm install --save readable-stream +``` + +***Node-core streams for userland*** + +This package is a mirror of the Streams2 and Streams3 implementations in +Node-core. + +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html). + +If you want to guarantee a stable streams base, regardless of what version of +Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). + +As of version 2.0.0 **readable-stream** uses semantic versioning. + +# Streams Working Group + +`readable-stream` is maintained by the Streams Working Group, which +oversees the development and maintenance of the Streams API within +Node.js. The responsibilities of the Streams Working Group include: + +* Addressing stream issues on the Node.js issue tracker. +* Authoring and editing stream documentation within the Node.js project. +* Reviewing changes to stream subclasses within the Node.js project. +* Redirecting changes to streams from the Node.js project to this + project. +* Assisting in the implementation of stream providers within Node.js. +* Recommending versions of `readable-stream` to be included in Node.js. +* Messaging about the future of streams to give the community advance + notice of changes. + + +## Team Members + +* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> + - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B +* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> + - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 +* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> + - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D +* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> +* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> +* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> +* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> + - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E +* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> diff --git a/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md new file mode 100644 index 000000000..83275f192 --- /dev/null +++ b/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -0,0 +1,60 @@ +# streams WG Meeting 2015-01-30 + +## Links + +* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg +* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 +* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ + +## Agenda + +Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. + +* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) +* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) +* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) +* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) + +## Minutes + +### adopt a charter + +* group: +1's all around + +### What versioning scheme should be adopted? +* group: +1’s 3.0.0 +* domenic+group: pulling in patches from other sources where appropriate +* mikeal: version independently, suggesting versions for io.js +* mikeal+domenic: work with TC to notify in advance of changes +simpler stream creation + +### streamline creation of streams +* sam: streamline creation of streams +* domenic: nice simple solution posted + but, we lose the opportunity to change the model + may not be backwards incompatible (double check keys) + + **action item:** domenic will check + +### remove implicit flowing of streams on(‘data’) +* add isFlowing / isPaused +* mikeal: worrying that we’re documenting polyfill methods – confuses users +* domenic: more reflective API is probably good, with warning labels for users +* new section for mad scientists (reflective stream access) +* calvin: name the “third state” +* mikeal: maybe borrow the name from whatwg? +* domenic: we’re missing the “third state” +* consensus: kind of difficult to name the third state +* mikeal: figure out differences in states / compat +* mathias: always flow on data – eliminates third state + * explore what it breaks + +**action items:** +* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) +* ask rod/build for infrastructure +* **chris**: explore the “flow on data” approach +* add isPaused/isFlowing +* add new docs section +* move isPaused to that section + + diff --git a/node_modules/readable-stream/duplex-browser.js b/node_modules/readable-stream/duplex-browser.js new file mode 100644 index 000000000..f8b2db83d --- /dev/null +++ b/node_modules/readable-stream/duplex-browser.js @@ -0,0 +1 @@ +module.exports = require('./lib/_stream_duplex.js'); diff --git a/node_modules/readable-stream/duplex.js b/node_modules/readable-stream/duplex.js new file mode 100644 index 000000000..46924cbfd --- /dev/null +++ b/node_modules/readable-stream/duplex.js @@ -0,0 +1 @@ +module.exports = require('./readable').Duplex diff --git a/node_modules/readable-stream/lib/_stream_duplex.js b/node_modules/readable-stream/lib/_stream_duplex.js new file mode 100644 index 000000000..a1ca813e5 --- /dev/null +++ b/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,131 @@ +// 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. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ + +module.exports = Duplex; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +{ + // avoid scope creep, the keys array can then be collected + var keys = objectKeys(Writable.prototype); + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; + } +} + +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) this.readable = false; + + if (options && options.writable === false) this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); +} + +Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + pna.nextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +Object.defineProperty(Duplex.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined || this._writableState === undefined) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); + +Duplex.prototype._destroy = function (err, cb) { + this.push(null); + this.end(); + + pna.nextTick(cb, err); +}; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/_stream_passthrough.js b/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 000000000..a9c835884 --- /dev/null +++ b/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,47 @@ +// 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. + +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +'use strict'; + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/_stream_readable.js b/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 000000000..bf34ac65e --- /dev/null +++ b/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,1019 @@ +// 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. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +module.exports = Readable; + +/**/ +var isArray = require('isarray'); +/**/ + +/**/ +var Duplex; +/**/ + +Readable.ReadableState = ReadableState; + +/**/ +var EE = require('events').EventEmitter; + +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +/**/ + +var Buffer = require('safe-buffer').Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var debugUtil = require('util'); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + +var BufferList = require('./internal/streams/BufferList'); +var destroyImpl = require('./internal/streams/destroy'); +var StringDecoder; + +util.inherits(Readable, Stream); + +var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; + +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); + + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} + +function ReadableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var readableHwm = options.readableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + + // has it been destroyed + this.destroyed = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + if (!(this instanceof Readable)) return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + if (options) { + if (typeof options.read === 'function') this._read = options.read; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + } + + Stream.call(this); +} + +Object.defineProperty(Readable.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined) { + return false; + } + return this._readableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + } +}); + +Readable.prototype.destroy = destroyImpl.destroy; +Readable.prototype._undestroy = destroyImpl.undestroy; +Readable.prototype._destroy = function (err, cb) { + this.push(null); + cb(err); +}; + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; + + if (!state.objectMode) { + if (typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = Buffer.from(chunk, encoding); + encoding = ''; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + return readableAddChunk(this, chunk, null, true, false); +}; + +function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + var state = stream._readableState; + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (addToFront) { + if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); + } else if (state.ended) { + stream.emit('error', new Error('stream.push() after EOF')); + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); + } else { + addChunk(stream, state, chunk, false); + } + } + } else if (!addToFront) { + state.reading = false; + } + } + + return needMoreData(state); +} + +function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + + if (state.needReadable) emitReadable(stream); + } + maybeReadMore(stream, state); +} + +function chunkInvalid(state, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); +} + +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; + +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; +} + +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; + } + // If we're asking for more than the current hwm, then raise the hwm. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; + // Don't have enough + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; + + if (n !== 0) state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } else if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (!state.reading) n = howMuchToRead(nOrig, state); + } + + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } else { + state.length -= n; + } + + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended) endReadable(this); + } + + if (ret !== null) this.emit('data', ret); + + return ret; +}; + +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); + } +} + +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + pna.nextTick(maybeReadMore_, stream, state); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('_read() is not implemented')); +}; + +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable, unpipeInfo) { + debug('onunpipe'); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', unpipe); + src.removeListener('data', ondata); + + cleanedUp = true; + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + increasedAwaitDrain = false; + var ret = dest.write(chunk); + if (false === ret && !increasedAwaitDrain) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + increasedAwaitDrain = true; + } + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } + + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} + +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + var unpipeInfo = { hasUnpiped: false }; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + + if (!dest) dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this, unpipeInfo); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var i = 0; i < len; i++) { + dests[i].emit('unpipe', this, unpipeInfo); + }return this; + } + + // try to find the right one. + var index = indexOf(state.pipes, dest); + if (index === -1) return this; + + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + + dest.emit('unpipe', this, unpipeInfo); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + if (ev === 'data') { + // Start flowing on next tick if stream isn't explicitly paused + if (this._readableState.flowing !== false) this.resume(); + } else if (ev === 'readable') { + var state = this._readableState; + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.emittedReadable = false; + if (!state.reading) { + pna.nextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); + } + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + pna.nextTick(resume_, stream, state); + } +} + +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } + + state.resumeScheduled = false; + state.awaitDrain = 0; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} + +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; + +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + while (state.flowing && stream.read() !== null) {} +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var _this = this; + + var state = this._readableState; + var paused = false; + + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); + } + + _this.push(null); + }); + + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + + var ret = _this.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } + + // proxy certain important events. + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + this._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + + return this; +}; + +Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._readableState.highWaterMark; + } +}); + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; + + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + // read part of list + ret = fromListPartial(n, state.buffer, state.decoder); + } + + return ret; +} + +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); + } else { + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); + } + return ret; +} + +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBufferString(n, list) { + var p = list.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = str.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBuffer(n, list) { + var ret = Buffer.allocUnsafe(n); + var p = list.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + pna.nextTick(endReadableNT, state, stream); + } +} + +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} + +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} \ No newline at end of file diff --git a/node_modules/readable-stream/lib/_stream_transform.js b/node_modules/readable-stream/lib/_stream_transform.js new file mode 100644 index 000000000..5d1f8b876 --- /dev/null +++ b/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,214 @@ +// 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. + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +'use strict'; + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + +function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) { + return this.emit('error', new Error('write callback called multiple times')); + } + + ts.writechunk = null; + ts.writecb = null; + + if (data != null) // single equals check for both `null` and `undefined` + this.push(data); + + cb(er); + + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } +} + +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + + Duplex.call(this, options); + + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; + } + + // When the writable side finishes, then flush out anything remaining. + this.on('prefinish', prefinish); +} + +function prefinish() { + var _this = this; + + if (typeof this._flush === 'function') { + this._flush(function (er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); + } +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('_transform() is not implemented'); +}; + +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + +Transform.prototype._destroy = function (err, cb) { + var _this2 = this; + + Duplex.prototype._destroy.call(this, err, function (err2) { + cb(err2); + _this2.emit('close'); + }); +}; + +function done(stream, er, data) { + if (er) return stream.emit('error', er); + + if (data != null) // single equals check for both `null` and `undefined` + stream.push(data); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); + + if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); + + return stream.push(null); +} \ No newline at end of file diff --git a/node_modules/readable-stream/lib/_stream_writable.js b/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 000000000..b3f4e85a2 --- /dev/null +++ b/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,687 @@ +// 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. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +module.exports = Writable; + +/* */ +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + this.finish = function () { + onCorkedFinish(_this, state); + }; +} +/* */ + +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; +/**/ + +/**/ +var Duplex; +/**/ + +Writable.WritableState = WritableState; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +/**/ + +var Buffer = require('safe-buffer').Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +var destroyImpl = require('./internal/streams/destroy'); + +util.inherits(Writable, Stream); + +function nop() {} + +function WritableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var writableHwm = options.writableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // if _final has been called + this.finalCalled = false; + + // drain event flag. + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // has it been destroyed + this.destroyed = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} + +WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; + +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') + }); + } catch (_) {} +})(); + +// Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. +var realHasInstance; +if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function (object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + + return object && object._writableState instanceof WritableState; + } + }); +} else { + realHasInstance = function (object) { + return object instanceof this; + }; +} + +function Writable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. + + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { + return new Writable(options); + } + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + if (options) { + if (typeof options.write === 'function') this._write = options.write; + + if (typeof options.writev === 'function') this._writev = options.writev; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + + if (typeof options.final === 'function') this._final = options.final; + } + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; + +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + pna.nextTick(cb, er); +} + +// Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. +function validChunk(stream, state, chunk, cb) { + var valid = true; + var er = false; + + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + if (er) { + stream.emit('error', er); + pna.nextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk); + + if (isBuf && !Buffer.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + + if (typeof cb !== 'function') cb = nop; + + if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } + + return ret; +}; + +Writable.prototype.cork = function () { + var state = this._writableState; + + state.corked++; +}; + +Writable.prototype.uncork = function () { + var state = this._writableState; + + if (state.corked) { + state.corked--; + + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; + +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = Buffer.from(chunk, encoding); + } + return chunk; +} + +Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); + if (chunk !== newChunk) { + isBuf = true; + encoding = 'buffer'; + chunk = newChunk; + } + } + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; + + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: isBuf, + callback: cb, + next: null + }; + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + + return ret; +} + +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + + if (sync) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + pna.nextTick(cb, er); + // this can emit finish, and it will always happen + // after error + pna.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + // this can emit finish, but finish must + // always follow error + finishMaybe(stream, state); + } +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); + + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + + var count = 0; + var allBuffers = true; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } + buffer.allBuffers = allBuffers; + + doWrite(stream, state, true, state.length, buffer, '', holder.finish); + + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + state.bufferedRequestCount = 0; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } + + if (entry === null) state.lastBufferedRequest = null; + } + + state.bufferedRequest = entry; + state.bufferProcessing = false; +} + +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('_write() is not implemented')); +}; + +Writable.prototype._writev = null; + +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; + +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} +function callFinal(stream, state) { + stream._final(function (err) { + state.pendingcb--; + if (err) { + stream.emit('error', err); + } + state.prefinished = true; + stream.emit('prefinish'); + finishMaybe(stream, state); + }); +} +function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === 'function') { + state.pendingcb++; + state.finalCalled = true; + pna.nextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit('prefinish'); + } + } +} + +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + prefinish(stream, state); + if (state.pendingcb === 0) { + state.finished = true; + stream.emit('finish'); + } + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} + +function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = corkReq; + } else { + state.corkedRequestsFree = corkReq; + } +} + +Object.defineProperty(Writable.prototype, 'destroyed', { + get: function () { + if (this._writableState === undefined) { + return false; + } + return this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._writableState.destroyed = value; + } +}); + +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; +Writable.prototype._destroy = function (err, cb) { + this.end(); + cb(err); +}; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/internal/streams/BufferList.js b/node_modules/readable-stream/lib/internal/streams/BufferList.js new file mode 100644 index 000000000..aefc68bd9 --- /dev/null +++ b/node_modules/readable-stream/lib/internal/streams/BufferList.js @@ -0,0 +1,79 @@ +'use strict'; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Buffer = require('safe-buffer').Buffer; +var util = require('util'); + +function copyBuffer(src, target, offset) { + src.copy(target, offset); +} + +module.exports = function () { + function BufferList() { + _classCallCheck(this, BufferList); + + this.head = null; + this.tail = null; + this.length = 0; + } + + BufferList.prototype.push = function push(v) { + var entry = { data: v, next: null }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; + }; + + BufferList.prototype.unshift = function unshift(v) { + var entry = { data: v, next: this.head }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + }; + + BufferList.prototype.shift = function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; + }; + + BufferList.prototype.clear = function clear() { + this.head = this.tail = null; + this.length = 0; + }; + + BufferList.prototype.join = function join(s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + while (p = p.next) { + ret += s + p.data; + }return ret; + }; + + BufferList.prototype.concat = function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + if (this.length === 1) return this.head.data; + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } + return ret; + }; + + return BufferList; +}(); + +if (util && util.inspect && util.inspect.custom) { + module.exports.prototype[util.inspect.custom] = function () { + var obj = util.inspect({ length: this.length }); + return this.constructor.name + ' ' + obj; + }; +} \ No newline at end of file diff --git a/node_modules/readable-stream/lib/internal/streams/destroy.js b/node_modules/readable-stream/lib/internal/streams/destroy.js new file mode 100644 index 000000000..5a0a0d88c --- /dev/null +++ b/node_modules/readable-stream/lib/internal/streams/destroy.js @@ -0,0 +1,74 @@ +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +// undocumented cb() API, needed for core, not for public API +function destroy(err, cb) { + var _this = this; + + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { + pna.nextTick(emitErrorNT, this, err); + } + return this; + } + + // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks + + if (this._readableState) { + this._readableState.destroyed = true; + } + + // if this is a duplex stream mark the writable part as destroyed as well + if (this._writableState) { + this._writableState.destroyed = true; + } + + this._destroy(err || null, function (err) { + if (!cb && err) { + pna.nextTick(emitErrorNT, _this, err); + if (_this._writableState) { + _this._writableState.errorEmitted = true; + } + } else if (cb) { + cb(err); + } + }); + + return this; +} + +function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } +} + +function emitErrorNT(self, err) { + self.emit('error', err); +} + +module.exports = { + destroy: destroy, + undestroy: undestroy +}; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/node_modules/readable-stream/lib/internal/streams/stream-browser.js new file mode 100644 index 000000000..9332a3fda --- /dev/null +++ b/node_modules/readable-stream/lib/internal/streams/stream-browser.js @@ -0,0 +1 @@ +module.exports = require('events').EventEmitter; diff --git a/node_modules/readable-stream/lib/internal/streams/stream.js b/node_modules/readable-stream/lib/internal/streams/stream.js new file mode 100644 index 000000000..ce2ad5b6e --- /dev/null +++ b/node_modules/readable-stream/lib/internal/streams/stream.js @@ -0,0 +1 @@ +module.exports = require('stream'); diff --git a/node_modules/readable-stream/package.json b/node_modules/readable-stream/package.json new file mode 100644 index 000000000..2c57a036c --- /dev/null +++ b/node_modules/readable-stream/package.json @@ -0,0 +1,93 @@ +{ + "_from": "readable-stream@^2.0.2", + "_id": "readable-stream@2.3.6", + "_inBundle": false, + "_integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "_location": "/readable-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "readable-stream@^2.0.2", + "name": "readable-stream", + "escapedName": "readable-stream", + "rawSpec": "^2.0.2", + "saveSpec": null, + "fetchSpec": "^2.0.2" + }, + "_requiredBy": [ + "/browserify", + "/concat-stream", + "/duplexer2", + "/from2", + "/module-deps", + "/read-only-stream", + "/readdirp", + "/stdout-stream", + "/stream-browserify", + "/stream-combiner2", + "/stream-http", + "/stream-splicer", + "/through2" + ], + "_resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "_shasum": "b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf", + "_spec": "readable-stream@^2.0.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "browser": { + "util": false, + "./readable.js": "./readable-browser.js", + "./writable.js": "./writable-browser.js", + "./duplex.js": "./duplex-browser.js", + "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" + }, + "bugs": { + "url": "https://github.com/nodejs/readable-stream/issues" + }, + "bundleDependencies": false, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "deprecated": false, + "description": "Streams3, a user-land copy of the stream library from Node.js", + "devDependencies": { + "assert": "^1.4.0", + "babel-polyfill": "^6.9.1", + "buffer": "^4.9.0", + "lolex": "^2.3.2", + "nyc": "^6.4.0", + "tap": "^0.7.0", + "tape": "^4.8.0" + }, + "homepage": "https://github.com/nodejs/readable-stream#readme", + "keywords": [ + "readable", + "stream", + "pipe" + ], + "license": "MIT", + "main": "readable.js", + "name": "readable-stream", + "nyc": { + "include": [ + "lib/**.js" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/nodejs/readable-stream.git" + }, + "scripts": { + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", + "cover": "nyc npm test", + "report": "nyc report --reporter=lcov", + "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js" + }, + "version": "2.3.6" +} diff --git a/node_modules/readable-stream/passthrough.js b/node_modules/readable-stream/passthrough.js new file mode 100644 index 000000000..ffd791d7f --- /dev/null +++ b/node_modules/readable-stream/passthrough.js @@ -0,0 +1 @@ +module.exports = require('./readable').PassThrough diff --git a/node_modules/readable-stream/readable-browser.js b/node_modules/readable-stream/readable-browser.js new file mode 100644 index 000000000..e50372592 --- /dev/null +++ b/node_modules/readable-stream/readable-browser.js @@ -0,0 +1,7 @@ +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/node_modules/readable-stream/readable.js b/node_modules/readable-stream/readable.js new file mode 100644 index 000000000..ec89ec533 --- /dev/null +++ b/node_modules/readable-stream/readable.js @@ -0,0 +1,19 @@ +var Stream = require('stream'); +if (process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; + exports = module.exports = Stream.Readable; + exports.Readable = Stream.Readable; + exports.Writable = Stream.Writable; + exports.Duplex = Stream.Duplex; + exports.Transform = Stream.Transform; + exports.PassThrough = Stream.PassThrough; + exports.Stream = Stream; +} else { + exports = module.exports = require('./lib/_stream_readable.js'); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = require('./lib/_stream_writable.js'); + exports.Duplex = require('./lib/_stream_duplex.js'); + exports.Transform = require('./lib/_stream_transform.js'); + exports.PassThrough = require('./lib/_stream_passthrough.js'); +} diff --git a/node_modules/readable-stream/transform.js b/node_modules/readable-stream/transform.js new file mode 100644 index 000000000..b1baba26d --- /dev/null +++ b/node_modules/readable-stream/transform.js @@ -0,0 +1 @@ +module.exports = require('./readable').Transform diff --git a/node_modules/readable-stream/writable-browser.js b/node_modules/readable-stream/writable-browser.js new file mode 100644 index 000000000..ebdde6a85 --- /dev/null +++ b/node_modules/readable-stream/writable-browser.js @@ -0,0 +1 @@ +module.exports = require('./lib/_stream_writable.js'); diff --git a/node_modules/readable-stream/writable.js b/node_modules/readable-stream/writable.js new file mode 100644 index 000000000..3211a6f80 --- /dev/null +++ b/node_modules/readable-stream/writable.js @@ -0,0 +1,8 @@ +var Stream = require("stream") +var Writable = require("./lib/_stream_writable.js") + +if (process.env.READABLE_STREAM === 'disable') { + module.exports = Stream && Stream.Writable || Writable +} else { + module.exports = Writable +} diff --git a/node_modules/readdirp/LICENSE b/node_modules/readdirp/LICENSE new file mode 100644 index 000000000..8a63b80ba --- /dev/null +++ b/node_modules/readdirp/LICENSE @@ -0,0 +1,20 @@ +This software is released under the MIT license: + +Copyright (c) 2012-2015 Thorsten Lorenz + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/readdirp/README.md b/node_modules/readdirp/README.md new file mode 100644 index 000000000..431f40258 --- /dev/null +++ b/node_modules/readdirp/README.md @@ -0,0 +1,204 @@ +# readdirp [![Build Status](https://secure.travis-ci.org/thlorenz/readdirp.svg)](http://travis-ci.org/thlorenz/readdirp) + +[![NPM](https://nodei.co/npm/readdirp.png?downloads=true&stars=true)](https://nodei.co/npm/readdirp/) + +Recursive version of [fs.readdir](http://nodejs.org/docs/latest/api/fs.html#fs_fs_readdir_path_callback). Exposes a **stream api**. + +```javascript +var readdirp = require('readdirp') + , path = require('path') + , es = require('event-stream'); + +// print out all JavaScript files along with their size + +var stream = readdirp({ root: path.join(__dirname), fileFilter: '*.js' }); +stream + .on('warn', function (err) { + console.error('non-fatal error', err); + // optionally call stream.destroy() here in order to abort and cause 'close' to be emitted + }) + .on('error', function (err) { console.error('fatal error', err); }) + .pipe(es.mapSync(function (entry) { + return { path: entry.path, size: entry.stat.size }; + })) + .pipe(es.stringify()) + .pipe(process.stdout); +``` + +Meant to be one of the recursive versions of [fs](http://nodejs.org/docs/latest/api/fs.html) functions, e.g., like [mkdirp](https://github.com/substack/node-mkdirp). + +**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* + +- [Installation](#installation) +- [API](#api) + - [entry stream](#entry-stream) + - [options](#options) + - [entry info](#entry-info) + - [Filters](#filters) + - [Callback API](#callback-api) + - [allProcessed ](#allprocessed) + - [fileProcessed](#fileprocessed) +- [More Examples](#more-examples) + - [stream api](#stream-api) + - [stream api pipe](#stream-api-pipe) + - [grep](#grep) + - [using callback api](#using-callback-api) + - [tests](#tests) + + +# Installation + + npm install readdirp + +# API + +***var entryStream = readdirp (options)*** + +Reads given root recursively and returns a `stream` of [entry info](#entry-info)s. + +## entry stream + +Behaves as follows: + +- `emit('data')` passes an [entry info](#entry-info) whenever one is found +- `emit('warn')` passes a non-fatal `Error` that prevents a file/directory from being processed (i.e., if it is + inaccessible to the user) +- `emit('error')` passes a fatal `Error` which also ends the stream (i.e., when illegal options where passed) +- `emit('end')` called when all entries were found and no more will be emitted (i.e., we are done) +- `emit('close')` called when the stream is destroyed via `stream.destroy()` (which could be useful if you want to + manually abort even on a non fatal error) - at that point the stream is no longer `readable` and no more entries, + warning or errors are emitted +- to learn more about streams, consult the very detailed + [nodejs streams documentation](http://nodejs.org/api/stream.html) or the + [stream-handbook](https://github.com/substack/stream-handbook) + + +## options + +- **root**: path in which to start reading and recursing into subdirectories + +- **fileFilter**: filter to include/exclude files found (see [Filters](#filters) for more) + +- **directoryFilter**: filter to include/exclude directories found and to recurse into (see [Filters](#filters) for more) + +- **depth**: depth at which to stop recursing even if more subdirectories are found + +- **entryType**: determines if data events on the stream should be emitted for `'files'`, `'directories'`, `'both'`, or `'all'`. Setting to `'all'` will also include entries for other types of file descriptors like character devices, unix sockets and named pipes. Defaults to `'files'`. + +- **lstat**: if `true`, readdirp uses `fs.lstat` instead of `fs.stat` in order to stat files and includes symlink entries in the stream along with files. + +## entry info + +Has the following properties: + +- **parentDir** : directory in which entry was found (relative to given root) +- **fullParentDir** : full path to parent directory +- **name** : name of the file/directory +- **path** : path to the file/directory (relative to given root) +- **fullPath** : full path to the file/directory found +- **stat** : built in [stat object](http://nodejs.org/docs/v0.4.9/api/fs.html#fs.Stats) +- **Example**: (assuming root was `/User/dev/readdirp`) + + parentDir : 'test/bed/root_dir1', + fullParentDir : '/User/dev/readdirp/test/bed/root_dir1', + name : 'root_dir1_subdir1', + path : 'test/bed/root_dir1/root_dir1_subdir1', + fullPath : '/User/dev/readdirp/test/bed/root_dir1/root_dir1_subdir1', + stat : [ ... ] + +## Filters + +There are three different ways to specify filters for files and directories respectively. + +- **function**: a function that takes an entry info as a parameter and returns true to include or false to exclude the entry + +- **glob string**: a string (e.g., `*.js`) which is matched using [minimatch](https://github.com/isaacs/minimatch), so go there for more + information. + + Globstars (`**`) are not supported since specifying a recursive pattern for an already recursive function doesn't make sense. + + Negated globs (as explained in the minimatch documentation) are allowed, e.g., `!*.txt` matches everything but text files. + +- **array of glob strings**: either need to be all inclusive or all exclusive (negated) patterns otherwise an error is thrown. + + `[ '*.json', '*.js' ]` includes all JavaScript and Json files. + + + `[ '!.git', '!node_modules' ]` includes all directories except the '.git' and 'node_modules'. + +Directories that do not pass a filter will not be recursed into. + +## Callback API + +Although the stream api is recommended, readdirp also exposes a callback based api. + +***readdirp (options, callback1 [, callback2])*** + +If callback2 is given, callback1 functions as the **fileProcessed** callback, and callback2 as the **allProcessed** callback. + +If only callback1 is given, it functions as the **allProcessed** callback. + +### allProcessed + +- function with err and res parameters, e.g., `function (err, res) { ... }` +- **err**: array of errors that occurred during the operation, **res may still be present, even if errors occurred** +- **res**: collection of file/directory [entry infos](#entry-info) + +### fileProcessed + +- function with [entry info](#entry-info) parameter e.g., `function (entryInfo) { ... }` + + +# More Examples + +`on('error', ..)`, `on('warn', ..)` and `on('end', ..)` handling omitted for brevity + +```javascript +var readdirp = require('readdirp'); + +// Glob file filter +readdirp({ root: './test/bed', fileFilter: '*.js' }) + .on('data', function (entry) { + // do something with each JavaScript file entry + }); + +// Combined glob file filters +readdirp({ root: './test/bed', fileFilter: [ '*.js', '*.json' ] }) + .on('data', function (entry) { + // do something with each JavaScript and Json file entry + }); + +// Combined negated directory filters +readdirp({ root: './test/bed', directoryFilter: [ '!.git', '!*modules' ] }) + .on('data', function (entry) { + // do something with each file entry found outside '.git' or any modules directory + }); + +// Function directory filter +readdirp({ root: './test/bed', directoryFilter: function (di) { return di.name.length === 9; } }) + .on('data', function (entry) { + // do something with each file entry found inside directories whose name has length 9 + }); + +// Limiting depth +readdirp({ root: './test/bed', depth: 1 }) + .on('data', function (entry) { + // do something with each file entry found up to 1 subdirectory deep + }); + +// callback api +readdirp({ root: '.' }, function(fileInfo) { + // do something with file entry here + }, function (err, res) { + // all done, move on or do final step for all file entries here +}); +``` + +Try more examples by following [instructions](https://github.com/paulmillr/readdirp/blob/master/examples/Readme.md) +on how to get going. + +## tests + +The [readdirp tests](https://github.com/paulmillr/readdirp/blob/master/test/readdirp.js) also will give you a good idea on +how things work. + diff --git a/node_modules/readdirp/node_modules/arr-diff/LICENSE b/node_modules/readdirp/node_modules/arr-diff/LICENSE new file mode 100755 index 000000000..d734237bd --- /dev/null +++ b/node_modules/readdirp/node_modules/arr-diff/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/arr-diff/README.md b/node_modules/readdirp/node_modules/arr-diff/README.md new file mode 100644 index 000000000..961f5c3f1 --- /dev/null +++ b/node_modules/readdirp/node_modules/arr-diff/README.md @@ -0,0 +1,130 @@ +# arr-diff [![NPM version](https://img.shields.io/npm/v/arr-diff.svg?style=flat)](https://www.npmjs.com/package/arr-diff) [![NPM monthly downloads](https://img.shields.io/npm/dm/arr-diff.svg?style=flat)](https://npmjs.org/package/arr-diff) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/arr-diff.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/arr-diff) + +> Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save arr-diff +``` + +Install with [yarn](https://yarnpkg.com): + +```sh +$ yarn add arr-diff +``` + +Install with [bower](https://bower.io/) + +```sh +$ bower install arr-diff --save +``` + +## Usage + +Returns the difference between the first array and additional arrays. + +```js +var diff = require('arr-diff'); + +var a = ['a', 'b', 'c', 'd']; +var b = ['b', 'c']; + +console.log(diff(a, b)) +//=> ['a', 'd'] +``` + +## Benchmarks + +This library versus [array-differ](https://github.com/sindresorhus/array-differ), on April 14, 2017: + +``` +Benchmarking: (4 of 4) + · long-dupes + · long + · med + · short + +# benchmark/fixtures/long-dupes.js (100804 bytes) + arr-diff-3.0.0 x 822 ops/sec ±0.67% (86 runs sampled) + arr-diff-4.0.0 x 2,141 ops/sec ±0.42% (89 runs sampled) + array-differ x 708 ops/sec ±0.70% (89 runs sampled) + + fastest is arr-diff-4.0.0 + +# benchmark/fixtures/long.js (94529 bytes) + arr-diff-3.0.0 x 882 ops/sec ±0.60% (87 runs sampled) + arr-diff-4.0.0 x 2,329 ops/sec ±0.97% (83 runs sampled) + array-differ x 769 ops/sec ±0.61% (90 runs sampled) + + fastest is arr-diff-4.0.0 + +# benchmark/fixtures/med.js (708 bytes) + arr-diff-3.0.0 x 856,150 ops/sec ±0.42% (89 runs sampled) + arr-diff-4.0.0 x 4,665,249 ops/sec ±1.06% (89 runs sampled) + array-differ x 653,888 ops/sec ±1.02% (86 runs sampled) + + fastest is arr-diff-4.0.0 + +# benchmark/fixtures/short.js (60 bytes) + arr-diff-3.0.0 x 3,078,467 ops/sec ±0.77% (93 runs sampled) + arr-diff-4.0.0 x 9,213,296 ops/sec ±0.65% (89 runs sampled) + array-differ x 1,337,051 ops/sec ±0.91% (92 runs sampled) + + fastest is arr-diff-4.0.0 +``` + +## About + +### Related projects + +* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays. This is the fastest implementation of array flatten.") +* [array-filter](https://www.npmjs.com/package/array-filter): Array#filter for older browsers. | [homepage](https://github.com/juliangruber/array-filter "Array#filter for older browsers.") +* [array-intersection](https://www.npmjs.com/package/array-intersection): Return an array with the unique values present in _all_ given arrays using strict equality… [more](https://github.com/jonschlinkert/array-intersection) | [homepage](https://github.com/jonschlinkert/array-intersection "Return an array with the unique values present in _all_ given arrays using strict equality for comparisons.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 33 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [paulmillr](https://github.com/paulmillr) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 14, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/arr-diff/index.js b/node_modules/readdirp/node_modules/arr-diff/index.js new file mode 100644 index 000000000..90f280772 --- /dev/null +++ b/node_modules/readdirp/node_modules/arr-diff/index.js @@ -0,0 +1,47 @@ +/*! + * arr-diff + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +module.exports = function diff(arr/*, arrays*/) { + var len = arguments.length; + var idx = 0; + while (++idx < len) { + arr = diffArray(arr, arguments[idx]); + } + return arr; +}; + +function diffArray(one, two) { + if (!Array.isArray(two)) { + return one.slice(); + } + + var tlen = two.length + var olen = one.length; + var idx = -1; + var arr = []; + + while (++idx < olen) { + var ele = one[idx]; + + var hasEle = false; + for (var i = 0; i < tlen; i++) { + var val = two[i]; + + if (ele === val) { + hasEle = true; + break; + } + } + + if (hasEle === false) { + arr.push(ele); + } + } + return arr; +} diff --git a/node_modules/readdirp/node_modules/arr-diff/package.json b/node_modules/readdirp/node_modules/arr-diff/package.json new file mode 100644 index 000000000..8227e5980 --- /dev/null +++ b/node_modules/readdirp/node_modules/arr-diff/package.json @@ -0,0 +1,108 @@ +{ + "_from": "arr-diff@^4.0.0", + "_id": "arr-diff@4.0.0", + "_inBundle": false, + "_integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "_location": "/readdirp/arr-diff", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "arr-diff@^4.0.0", + "name": "arr-diff", + "escapedName": "arr-diff", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/readdirp/micromatch" + ], + "_resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "_shasum": "d6461074febfec71e7e15235761a329a5dc7c520", + "_spec": "arr-diff@^4.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/arr-diff/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Paul Miller", + "email": "paul+gh@paulmillr.com", + "url": "paulmillr.com" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.", + "devDependencies": { + "ansi-bold": "^0.1.1", + "arr-flatten": "^1.0.1", + "array-differ": "^1.0.0", + "benchmarked": "^0.2.4", + "gulp-format-md": "^0.1.9", + "minimist": "^1.2.0", + "mocha": "^2.4.5" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/arr-diff", + "keywords": [ + "arr", + "array", + "array differ", + "array-differ", + "diff", + "differ", + "difference" + ], + "license": "MIT", + "main": "index.js", + "name": "arr-diff", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/arr-diff.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "arr-flatten", + "array-filter", + "array-intersection" + ] + }, + "reflinks": [ + "array-differ", + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "4.0.0" +} diff --git a/node_modules/readdirp/node_modules/array-unique/LICENSE b/node_modules/readdirp/node_modules/array-unique/LICENSE new file mode 100755 index 000000000..842218cf0 --- /dev/null +++ b/node_modules/readdirp/node_modules/array-unique/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/array-unique/README.md b/node_modules/readdirp/node_modules/array-unique/README.md new file mode 100755 index 000000000..41c8c904e --- /dev/null +++ b/node_modules/readdirp/node_modules/array-unique/README.md @@ -0,0 +1,77 @@ +# array-unique [![NPM version](https://img.shields.io/npm/v/array-unique.svg?style=flat)](https://www.npmjs.com/package/array-unique) [![NPM downloads](https://img.shields.io/npm/dm/array-unique.svg?style=flat)](https://npmjs.org/package/array-unique) [![Build Status](https://img.shields.io/travis/jonschlinkert/array-unique.svg?style=flat)](https://travis-ci.org/jonschlinkert/array-unique) + +Remove duplicate values from an array. Fastest ES5 implementation. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save array-unique +``` + +## Usage + +```js +var unique = require('array-unique'); + +var arr = ['a', 'b', 'c', 'c']; +console.log(unique(arr)) //=> ['a', 'b', 'c'] +console.log(arr) //=> ['a', 'b', 'c'] + +/* The above modifies the input array. To prevent that at a slight performance cost: */ +var unique = require("array-unique").immutable; + +var arr = ['a', 'b', 'c', 'c']; +console.log(unique(arr)) //=> ['a', 'b', 'c'] +console.log(arr) //=> ['a', 'b', 'c', 'c'] +``` + +## About + +### Related projects + +* [arr-diff](https://www.npmjs.com/package/arr-diff): Returns an array with only the unique values from the first array, by excluding all… [more](https://github.com/jonschlinkert/arr-diff) | [homepage](https://github.com/jonschlinkert/arr-diff "Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.") +* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays. This is the fastest implementation of array flatten.") +* [arr-map](https://www.npmjs.com/package/arr-map): Faster, node.js focused alternative to JavaScript's native array map. | [homepage](https://github.com/jonschlinkert/arr-map "Faster, node.js focused alternative to JavaScript's native array map.") +* [arr-pluck](https://www.npmjs.com/package/arr-pluck): Retrieves the value of a specified property from all elements in the collection. | [homepage](https://github.com/jonschlinkert/arr-pluck "Retrieves the value of a specified property from all elements in the collection.") +* [arr-reduce](https://www.npmjs.com/package/arr-reduce): Fast array reduce that also loops over sparse elements. | [homepage](https://github.com/jonschlinkert/arr-reduce "Fast array reduce that also loops over sparse elements.") +* [arr-union](https://www.npmjs.com/package/arr-union): Combines a list of arrays, returning a single array with unique values, using strict equality… [more](https://github.com/jonschlinkert/arr-union) | [homepage](https://github.com/jonschlinkert/arr-union "Combines a list of arrays, returning a single array with unique values, using strict equality for comparisons.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/array-unique/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.28, on July 31, 2016._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/array-unique/index.js b/node_modules/readdirp/node_modules/array-unique/index.js new file mode 100644 index 000000000..7e481e072 --- /dev/null +++ b/node_modules/readdirp/node_modules/array-unique/index.js @@ -0,0 +1,43 @@ +/*! + * array-unique + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +module.exports = function unique(arr) { + if (!Array.isArray(arr)) { + throw new TypeError('array-unique expects an array.'); + } + + var len = arr.length; + var i = -1; + + while (i++ < len) { + var j = i + 1; + + for (; j < arr.length; ++j) { + if (arr[i] === arr[j]) { + arr.splice(j--, 1); + } + } + } + return arr; +}; + +module.exports.immutable = function uniqueImmutable(arr) { + if (!Array.isArray(arr)) { + throw new TypeError('array-unique expects an array.'); + } + + var arrLen = arr.length; + var newArr = new Array(arrLen); + + for (var i = 0; i < arrLen; i++) { + newArr[i] = arr[i]; + } + + return module.exports(newArr); +}; diff --git a/node_modules/readdirp/node_modules/array-unique/package.json b/node_modules/readdirp/node_modules/array-unique/package.json new file mode 100644 index 000000000..8048e069e --- /dev/null +++ b/node_modules/readdirp/node_modules/array-unique/package.json @@ -0,0 +1,95 @@ +{ + "_from": "array-unique@^0.3.2", + "_id": "array-unique@0.3.2", + "_inBundle": false, + "_integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "_location": "/readdirp/array-unique", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "array-unique@^0.3.2", + "name": "array-unique", + "escapedName": "array-unique", + "rawSpec": "^0.3.2", + "saveSpec": null, + "fetchSpec": "^0.3.2" + }, + "_requiredBy": [ + "/readdirp/braces", + "/readdirp/extglob", + "/readdirp/micromatch" + ], + "_resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "_shasum": "a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428", + "_spec": "array-unique@^0.3.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/array-unique/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Remove duplicate values from an array. Fastest ES5 implementation.", + "devDependencies": { + "array-uniq": "^1.0.2", + "benchmarked": "^0.1.3", + "gulp-format-md": "^0.1.9", + "mocha": "^2.5.3", + "should": "^10.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "LICENSE", + "README.md" + ], + "homepage": "https://github.com/jonschlinkert/array-unique", + "keywords": [ + "array", + "unique" + ], + "license": "MIT", + "main": "index.js", + "name": "array-unique", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/array-unique.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "arr-diff", + "arr-union", + "arr-flatten", + "arr-reduce", + "arr-map", + "arr-pluck" + ] + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ], + "lint": { + "reflinks": true + } + }, + "version": "0.3.2" +} diff --git a/node_modules/readdirp/node_modules/braces/LICENSE b/node_modules/readdirp/node_modules/braces/LICENSE new file mode 100644 index 000000000..d32ab4426 --- /dev/null +++ b/node_modules/readdirp/node_modules/braces/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2018, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/braces/README.md b/node_modules/readdirp/node_modules/braces/README.md new file mode 100644 index 000000000..f909bfba1 --- /dev/null +++ b/node_modules/readdirp/node_modules/braces/README.md @@ -0,0 +1,640 @@ +# braces [![NPM version](https://img.shields.io/npm/v/braces.svg?style=flat)](https://www.npmjs.com/package/braces) [![NPM monthly downloads](https://img.shields.io/npm/dm/braces.svg?style=flat)](https://npmjs.org/package/braces) [![NPM total downloads](https://img.shields.io/npm/dt/braces.svg?style=flat)](https://npmjs.org/package/braces) [![Linux Build Status](https://img.shields.io/travis/micromatch/braces.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/braces) [![Windows Build Status](https://img.shields.io/appveyor/ci/micromatch/braces.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/micromatch/braces) + +> Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save braces +``` + +## Why use braces? + +Brace patterns are great for matching ranges. Users (and implementors) shouldn't have to think about whether or not they will break their application (or yours) from accidentally defining an aggressive brace pattern. _Braces is the only library that offers a [solution to this problem](#performance)_. + +* **Safe(r)**: Braces isn't vulnerable to DoS attacks like [brace-expansion](https://github.com/juliangruber/brace-expansion), [minimatch](https://github.com/isaacs/minimatch) and [multimatch](https://github.com/sindresorhus/multimatch) (a different bug than the [other regex DoS bug](https://medium.com/node-security/minimatch-redos-vulnerability-590da24e6d3c#.jew0b6mpc)). +* **Accurate**: complete support for the [Bash 4.3 Brace Expansion](www.gnu.org/software/bash/) specification (passes all of the Bash braces tests) +* **[fast and performant](#benchmarks)**: Starts fast, runs fast and [scales well](#performance) as patterns increase in complexity. +* **Organized code base**: with parser and compiler that are eas(y|ier) to maintain and update when edge cases crop up. +* **Well-tested**: thousands of test assertions. Passes 100% of the [minimatch](https://github.com/isaacs/minimatch) and [brace-expansion](https://github.com/juliangruber/brace-expansion) unit tests as well (as of the writing of this). + +## Usage + +The main export is a function that takes one or more brace `patterns` and `options`. + +```js +var braces = require('braces'); +braces(pattern[, options]); +``` + +By default, braces returns an optimized regex-source string. To get an array of brace patterns, use `brace.expand()`. + +The following section explains the difference in more detail. _(If you're curious about "why" braces does this by default, see [brace matching pitfalls](#brace-matching-pitfalls)_. + +### Optimized vs. expanded braces + +**Optimized** + +By default, patterns are optimized for regex and matching: + +```js +console.log(braces('a/{x,y,z}/b')); +//=> ['a/(x|y|z)/b'] +``` + +**Expanded** + +To expand patterns the same way as Bash or [minimatch](https://github.com/isaacs/minimatch), use the [.expand](#expand) method: + +```js +console.log(braces.expand('a/{x,y,z}/b')); +//=> ['a/x/b', 'a/y/b', 'a/z/b'] +``` + +Or use [options.expand](#optionsexpand): + +```js +console.log(braces('a/{x,y,z}/b', {expand: true})); +//=> ['a/x/b', 'a/y/b', 'a/z/b'] +``` + +## Features + +* [lists](#lists): Supports "lists": `a/{b,c}/d` => `['a/b/d', 'a/c/d']` +* [sequences](#sequences): Supports alphabetical or numerical "sequences" (ranges): `{1..3}` => `['1', '2', '3']` +* [steps](#steps): Supports "steps" or increments: `{2..10..2}` => `['2', '4', '6', '8', '10']` +* [escaping](#escaping) +* [options](#options) + +### Lists + +Uses [fill-range](https://github.com/jonschlinkert/fill-range) for expanding alphabetical or numeric lists: + +```js +console.log(braces('a/{foo,bar,baz}/*.js')); +//=> ['a/(foo|bar|baz)/*.js'] + +console.log(braces.expand('a/{foo,bar,baz}/*.js')); +//=> ['a/foo/*.js', 'a/bar/*.js', 'a/baz/*.js'] +``` + +### Sequences + +Uses [fill-range](https://github.com/jonschlinkert/fill-range) for expanding alphabetical or numeric ranges (bash "sequences"): + +```js +console.log(braces.expand('{1..3}')); // ['1', '2', '3'] +console.log(braces.expand('a{01..03}b')); // ['a01b', 'a02b', 'a03b'] +console.log(braces.expand('a{1..3}b')); // ['a1b', 'a2b', 'a3b'] +console.log(braces.expand('{a..c}')); // ['a', 'b', 'c'] +console.log(braces.expand('foo/{a..c}')); // ['foo/a', 'foo/b', 'foo/c'] + +// supports padded ranges +console.log(braces('a{01..03}b')); //=> [ 'a(0[1-3])b' ] +console.log(braces('a{001..300}b')); //=> [ 'a(0{2}[1-9]|0[1-9][0-9]|[12][0-9]{2}|300)b' ] +``` + +### Steps + +Steps, or increments, may be used with ranges: + +```js +console.log(braces.expand('{2..10..2}')); +//=> ['2', '4', '6', '8', '10'] + +console.log(braces('{2..10..2}')); +//=> ['(2|4|6|8|10)'] +``` + +When the [.optimize](#optimize) method is used, or [options.optimize](#optionsoptimize) is set to true, sequences are passed to [to-regex-range](https://github.com/jonschlinkert/to-regex-range) for expansion. + +### Nesting + +Brace patterns may be nested. The results of each expanded string are not sorted, and left to right order is preserved. + +**"Expanded" braces** + +```js +console.log(braces.expand('a{b,c,/{x,y}}/e')); +//=> ['ab/e', 'ac/e', 'a/x/e', 'a/y/e'] + +console.log(braces.expand('a/{x,{1..5},y}/c')); +//=> ['a/x/c', 'a/1/c', 'a/2/c', 'a/3/c', 'a/4/c', 'a/5/c', 'a/y/c'] +``` + +**"Optimized" braces** + +```js +console.log(braces('a{b,c,/{x,y}}/e')); +//=> ['a(b|c|/(x|y))/e'] + +console.log(braces('a/{x,{1..5},y}/c')); +//=> ['a/(x|([1-5])|y)/c'] +``` + +### Escaping + +**Escaping braces** + +A brace pattern will not be expanded or evaluted if _either the opening or closing brace is escaped_: + +```js +console.log(braces.expand('a\\{d,c,b}e')); +//=> ['a{d,c,b}e'] + +console.log(braces.expand('a{d,c,b\\}e')); +//=> ['a{d,c,b}e'] +``` + +**Escaping commas** + +Commas inside braces may also be escaped: + +```js +console.log(braces.expand('a{b\\,c}d')); +//=> ['a{b,c}d'] + +console.log(braces.expand('a{d\\,c,b}e')); +//=> ['ad,ce', 'abe'] +``` + +**Single items** + +Following bash conventions, a brace pattern is also not expanded when it contains a single character: + +```js +console.log(braces.expand('a{b}c')); +//=> ['a{b}c'] +``` + +## Options + +### options.maxLength + +**Type**: `Number` + +**Default**: `65,536` + +**Description**: Limit the length of the input string. Useful when the input string is generated or your application allows users to pass a string, et cetera. + +```js +console.log(braces('a/{b,c}/d', { maxLength: 3 })); //=> throws an error +``` + +### options.expand + +**Type**: `Boolean` + +**Default**: `undefined` + +**Description**: Generate an "expanded" brace pattern (this option is unncessary with the `.expand` method, which does the same thing). + +```js +console.log(braces('a/{b,c}/d', {expand: true})); +//=> [ 'a/b/d', 'a/c/d' ] +``` + +### options.optimize + +**Type**: `Boolean` + +**Default**: `true` + +**Description**: Enabled by default. + +```js +console.log(braces('a/{b,c}/d')); +//=> [ 'a/(b|c)/d' ] +``` + +### options.nodupes + +**Type**: `Boolean` + +**Default**: `true` + +**Description**: Duplicates are removed by default. To keep duplicates, pass `{nodupes: false}` on the options + +### options.rangeLimit + +**Type**: `Number` + +**Default**: `250` + +**Description**: When `braces.expand()` is used, or `options.expand` is true, brace patterns will automatically be [optimized](#optionsoptimize) when the difference between the range minimum and range maximum exceeds the `rangeLimit`. This is to prevent huge ranges from freezing your application. + +You can set this to any number, or change `options.rangeLimit` to `Inifinity` to disable this altogether. + +**Examples** + +```js +// pattern exceeds the "rangeLimit", so it's optimized automatically +console.log(braces.expand('{1..1000}')); +//=> ['([1-9]|[1-9][0-9]{1,2}|1000)'] + +// pattern does not exceed "rangeLimit", so it's NOT optimized +console.log(braces.expand('{1..100}')); +//=> ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '100'] +``` + +### options.transform + +**Type**: `Function` + +**Default**: `undefined` + +**Description**: Customize range expansion. + +```js +var range = braces.expand('x{a..e}y', { + transform: function(str) { + return 'foo' + str; + } +}); + +console.log(range); +//=> [ 'xfooay', 'xfooby', 'xfoocy', 'xfoody', 'xfooey' ] +``` + +### options.quantifiers + +**Type**: `Boolean` + +**Default**: `undefined` + +**Description**: In regular expressions, quanitifiers can be used to specify how many times a token can be repeated. For example, `a{1,3}` will match the letter `a` one to three times. + +Unfortunately, regex quantifiers happen to share the same syntax as [Bash lists](#lists) + +The `quantifiers` option tells braces to detect when [regex quantifiers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#quantifiers) are defined in the given pattern, and not to try to expand them as lists. + +**Examples** + +```js +var braces = require('braces'); +console.log(braces('a/b{1,3}/{x,y,z}')); +//=> [ 'a/b(1|3)/(x|y|z)' ] +console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true})); +//=> [ 'a/b{1,3}/(x|y|z)' ] +console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true, expand: true})); +//=> [ 'a/b{1,3}/x', 'a/b{1,3}/y', 'a/b{1,3}/z' ] +``` + +### options.unescape + +**Type**: `Boolean` + +**Default**: `undefined` + +**Description**: Strip backslashes that were used for escaping from the result. + +## What is "brace expansion"? + +Brace expansion is a type of parameter expansion that was made popular by unix shells for generating lists of strings, as well as regex-like matching when used alongside wildcards (globs). + +In addition to "expansion", braces are also used for matching. In other words: + +* [brace expansion](#brace-expansion) is for generating new lists +* [brace matching](#brace-matching) is for filtering existing lists + +
    +More about brace expansion (click to expand) + +There are two main types of brace expansion: + +1. **lists**: which are defined using comma-separated values inside curly braces: `{a,b,c}` +2. **sequences**: which are defined using a starting value and an ending value, separated by two dots: `a{1..3}b`. Optionally, a third argument may be passed to define a "step" or increment to use: `a{1..100..10}b`. These are also sometimes referred to as "ranges". + +Here are some example brace patterns to illustrate how they work: + +**Sets** + +``` +{a,b,c} => a b c +{a,b,c}{1,2} => a1 a2 b1 b2 c1 c2 +``` + +**Sequences** + +``` +{1..9} => 1 2 3 4 5 6 7 8 9 +{4..-4} => 4 3 2 1 0 -1 -2 -3 -4 +{1..20..3} => 1 4 7 10 13 16 19 +{a..j} => a b c d e f g h i j +{j..a} => j i h g f e d c b a +{a..z..3} => a d g j m p s v y +``` + +**Combination** + +Sets and sequences can be mixed together or used along with any other strings. + +``` +{a,b,c}{1..3} => a1 a2 a3 b1 b2 b3 c1 c2 c3 +foo/{a,b,c}/bar => foo/a/bar foo/b/bar foo/c/bar +``` + +The fact that braces can be "expanded" from relatively simple patterns makes them ideal for quickly generating test fixtures, file paths, and similar use cases. + +## Brace matching + +In addition to _expansion_, brace patterns are also useful for performing regular-expression-like matching. + +For example, the pattern `foo/{1..3}/bar` would match any of following strings: + +``` +foo/1/bar +foo/2/bar +foo/3/bar +``` + +But not: + +``` +baz/1/qux +baz/2/qux +baz/3/qux +``` + +Braces can also be combined with [glob patterns](https://github.com/jonschlinkert/micromatch) to perform more advanced wildcard matching. For example, the pattern `*/{1..3}/*` would match any of following strings: + +``` +foo/1/bar +foo/2/bar +foo/3/bar +baz/1/qux +baz/2/qux +baz/3/qux +``` + +## Brace matching pitfalls + +Although brace patterns offer a user-friendly way of matching ranges or sets of strings, there are also some major disadvantages and potential risks you should be aware of. + +### tldr + +**"brace bombs"** + +* brace expansion can eat up a huge amount of processing resources +* as brace patterns increase _linearly in size_, the system resources required to expand the pattern increase exponentially +* users can accidentally (or intentially) exhaust your system's resources resulting in the equivalent of a DoS attack (bonus: no programming knowledge is required!) + +For a more detailed explanation with examples, see the [geometric complexity](#geometric-complexity) section. + +### The solution + +Jump to the [performance section](#performance) to see how Braces solves this problem in comparison to other libraries. + +### Geometric complexity + +At minimum, brace patterns with sets limited to two elements have quadradic or `O(n^2)` complexity. But the complexity of the algorithm increases exponentially as the number of sets, _and elements per set_, increases, which is `O(n^c)`. + +For example, the following sets demonstrate quadratic (`O(n^2)`) complexity: + +``` +{1,2}{3,4} => (2X2) => 13 14 23 24 +{1,2}{3,4}{5,6} => (2X2X2) => 135 136 145 146 235 236 245 246 +``` + +But add an element to a set, and we get a n-fold Cartesian product with `O(n^c)` complexity: + +``` +{1,2,3}{4,5,6}{7,8,9} => (3X3X3) => 147 148 149 157 158 159 167 168 169 247 248 + 249 257 258 259 267 268 269 347 348 349 357 + 358 359 367 368 369 +``` + +Now, imagine how this complexity grows given that each element is a n-tuple: + +``` +{1..100}{1..100} => (100X100) => 10,000 elements (38.4 kB) +{1..100}{1..100}{1..100} => (100X100X100) => 1,000,000 elements (5.76 MB) +``` + +Although these examples are clearly contrived, they demonstrate how brace patterns can quickly grow out of control. + +**More information** + +Interested in learning more about brace expansion? + +* [linuxjournal/bash-brace-expansion](http://www.linuxjournal.com/content/bash-brace-expansion) +* [rosettacode/Brace_expansion](https://rosettacode.org/wiki/Brace_expansion) +* [cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) + +
    + +## Performance + +Braces is not only screaming fast, it's also more accurate the other brace expansion libraries. + +### Better algorithms + +Fortunately there is a solution to the ["brace bomb" problem](#brace-matching-pitfalls): _don't expand brace patterns into an array when they're used for matching_. + +Instead, convert the pattern into an optimized regular expression. This is easier said than done, and braces is the only library that does this currently. + +**The proof is in the numbers** + +Minimatch gets exponentially slower as patterns increase in complexity, braces does not. The following results were generated using `braces()` and `minimatch.braceExpand()`, respectively. + +| **Pattern** | **braces** | **[minimatch](https://github.com/isaacs/minimatch)** | +| --- | --- | --- | +| `{1..9007199254740991}`[1] | `298 B` (5ms 459μs) | N/A (freezes) | +| `{1..1000000000000000}` | `41 B` (1ms 15μs) | N/A (freezes) | +| `{1..100000000000000}` | `40 B` (890μs) | N/A (freezes) | +| `{1..10000000000000}` | `39 B` (2ms 49μs) | N/A (freezes) | +| `{1..1000000000000}` | `38 B` (608μs) | N/A (freezes) | +| `{1..100000000000}` | `37 B` (397μs) | N/A (freezes) | +| `{1..10000000000}` | `35 B` (983μs) | N/A (freezes) | +| `{1..1000000000}` | `34 B` (798μs) | N/A (freezes) | +| `{1..100000000}` | `33 B` (733μs) | N/A (freezes) | +| `{1..10000000}` | `32 B` (5ms 632μs) | `78.89 MB` (16s 388ms 569μs) | +| `{1..1000000}` | `31 B` (1ms 381μs) | `6.89 MB` (1s 496ms 887μs) | +| `{1..100000}` | `30 B` (950μs) | `588.89 kB` (146ms 921μs) | +| `{1..10000}` | `29 B` (1ms 114μs) | `48.89 kB` (14ms 187μs) | +| `{1..1000}` | `28 B` (760μs) | `3.89 kB` (1ms 453μs) | +| `{1..100}` | `22 B` (345μs) | `291 B` (196μs) | +| `{1..10}` | `10 B` (533μs) | `20 B` (37μs) | +| `{1..3}` | `7 B` (190μs) | `5 B` (27μs) | + +### Faster algorithms + +When you need expansion, braces is still much faster. + +_(the following results were generated using `braces.expand()` and `minimatch.braceExpand()`, respectively)_ + +| **Pattern** | **braces** | **[minimatch](https://github.com/isaacs/minimatch)** | +| --- | --- | --- | +| `{1..10000000}` | `78.89 MB` (2s 698ms 642μs) | `78.89 MB` (18s 601ms 974μs) | +| `{1..1000000}` | `6.89 MB` (458ms 576μs) | `6.89 MB` (1s 491ms 621μs) | +| `{1..100000}` | `588.89 kB` (20ms 728μs) | `588.89 kB` (156ms 919μs) | +| `{1..10000}` | `48.89 kB` (2ms 202μs) | `48.89 kB` (13ms 641μs) | +| `{1..1000}` | `3.89 kB` (1ms 796μs) | `3.89 kB` (1ms 958μs) | +| `{1..100}` | `291 B` (424μs) | `291 B` (211μs) | +| `{1..10}` | `20 B` (487μs) | `20 B` (72μs) | +| `{1..3}` | `5 B` (166μs) | `5 B` (27μs) | + +If you'd like to run these comparisons yourself, see [test/support/generate.js](test/support/generate.js). + +## Benchmarks + +### Running benchmarks + +Install dev dependencies: + +```bash +npm i -d && npm benchmark +``` + +### Latest results + +```bash +Benchmarking: (8 of 8) + · combination-nested + · combination + · escaped + · list-basic + · list-multiple + · no-braces + · sequence-basic + · sequence-multiple + +# benchmark/fixtures/combination-nested.js (52 bytes) + brace-expansion x 4,756 ops/sec ±1.09% (86 runs sampled) + braces x 11,202,303 ops/sec ±1.06% (88 runs sampled) + minimatch x 4,816 ops/sec ±0.99% (87 runs sampled) + + fastest is braces + +# benchmark/fixtures/combination.js (51 bytes) + brace-expansion x 625 ops/sec ±0.87% (87 runs sampled) + braces x 11,031,884 ops/sec ±0.72% (90 runs sampled) + minimatch x 637 ops/sec ±0.84% (88 runs sampled) + + fastest is braces + +# benchmark/fixtures/escaped.js (44 bytes) + brace-expansion x 163,325 ops/sec ±1.05% (87 runs sampled) + braces x 10,655,071 ops/sec ±1.22% (88 runs sampled) + minimatch x 147,495 ops/sec ±0.96% (88 runs sampled) + + fastest is braces + +# benchmark/fixtures/list-basic.js (40 bytes) + brace-expansion x 99,726 ops/sec ±1.07% (83 runs sampled) + braces x 10,596,584 ops/sec ±0.98% (88 runs sampled) + minimatch x 100,069 ops/sec ±1.17% (86 runs sampled) + + fastest is braces + +# benchmark/fixtures/list-multiple.js (52 bytes) + brace-expansion x 34,348 ops/sec ±1.08% (88 runs sampled) + braces x 9,264,131 ops/sec ±1.12% (88 runs sampled) + minimatch x 34,893 ops/sec ±0.87% (87 runs sampled) + + fastest is braces + +# benchmark/fixtures/no-braces.js (48 bytes) + brace-expansion x 275,368 ops/sec ±1.18% (89 runs sampled) + braces x 9,134,677 ops/sec ±0.95% (88 runs sampled) + minimatch x 3,755,954 ops/sec ±1.13% (89 runs sampled) + + fastest is braces + +# benchmark/fixtures/sequence-basic.js (41 bytes) + brace-expansion x 5,492 ops/sec ±1.35% (87 runs sampled) + braces x 8,485,034 ops/sec ±1.28% (89 runs sampled) + minimatch x 5,341 ops/sec ±1.17% (87 runs sampled) + + fastest is braces + +# benchmark/fixtures/sequence-multiple.js (51 bytes) + brace-expansion x 116 ops/sec ±0.77% (77 runs sampled) + braces x 9,445,118 ops/sec ±1.32% (84 runs sampled) + minimatch x 109 ops/sec ±1.16% (76 runs sampled) + + fastest is braces +``` + +## About + +
    +Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
    + +
    +Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
    + +
    +Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
    + +### Related projects + +You might also be interested in these projects: + +* [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/jonschlinkert/expand-brackets "Expand POSIX bracket expressions (character classes) in glob patterns.") +* [extglob](https://www.npmjs.com/package/extglob): Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob… [more](https://github.com/micromatch/extglob) | [homepage](https://github.com/micromatch/extglob "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.") +* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or `step` to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/micromatch/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") +* [nanomatch](https://www.npmjs.com/package/nanomatch): Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash… [more](https://github.com/micromatch/nanomatch) | [homepage](https://github.com/micromatch/nanomatch "Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces)") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 188 | [jonschlinkert](https://github.com/jonschlinkert) | +| 4 | [doowb](https://github.com/doowb) | +| 1 | [es128](https://github.com/es128) | +| 1 | [eush77](https://github.com/eush77) | +| 1 | [hemanth](https://github.com/hemanth) | + +### Author + +**Jon Schlinkert** + +* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on February 17, 2018._ + +
    +
    +
      +
    1. this is the largest safe integer allowed in JavaScript. + +
    2. +
    +
    \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/braces/index.js b/node_modules/readdirp/node_modules/braces/index.js new file mode 100644 index 000000000..048e1c233 --- /dev/null +++ b/node_modules/readdirp/node_modules/braces/index.js @@ -0,0 +1,318 @@ +'use strict'; + +/** + * Module dependencies + */ + +var toRegex = require('to-regex'); +var unique = require('array-unique'); +var extend = require('extend-shallow'); + +/** + * Local dependencies + */ + +var compilers = require('./lib/compilers'); +var parsers = require('./lib/parsers'); +var Braces = require('./lib/braces'); +var utils = require('./lib/utils'); +var MAX_LENGTH = 1024 * 64; +var cache = {}; + +/** + * Convert the given `braces` pattern into a regex-compatible string. By default, only one string is generated for every input string. Set `options.expand` to true to return an array of patterns (similar to Bash or minimatch. Before using `options.expand`, it's recommended that you read the [performance notes](#performance)). + * + * ```js + * var braces = require('braces'); + * console.log(braces('{a,b,c}')); + * //=> ['(a|b|c)'] + * + * console.log(braces('{a,b,c}', {expand: true})); + * //=> ['a', 'b', 'c'] + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {String} + * @api public + */ + +function braces(pattern, options) { + var key = utils.createKey(String(pattern), options); + var arr = []; + + var disabled = options && options.cache === false; + if (!disabled && cache.hasOwnProperty(key)) { + return cache[key]; + } + + if (Array.isArray(pattern)) { + for (var i = 0; i < pattern.length; i++) { + arr.push.apply(arr, braces.create(pattern[i], options)); + } + } else { + arr = braces.create(pattern, options); + } + + if (options && options.nodupes === true) { + arr = unique(arr); + } + + if (!disabled) { + cache[key] = arr; + } + return arr; +} + +/** + * Expands a brace pattern into an array. This method is called by the main [braces](#braces) function when `options.expand` is true. Before using this method it's recommended that you read the [performance notes](#performance)) and advantages of using [.optimize](#optimize) instead. + * + * ```js + * var braces = require('braces'); + * console.log(braces.expand('a/{b,c}/d')); + * //=> ['a/b/d', 'a/c/d']; + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces.expand = function(pattern, options) { + return braces.create(pattern, extend({}, options, {expand: true})); +}; + +/** + * Expands a brace pattern into a regex-compatible, optimized string. This method is called by the main [braces](#braces) function by default. + * + * ```js + * var braces = require('braces'); + * console.log(braces.expand('a/{b,c}/d')); + * //=> ['a/(b|c)/d'] + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces.optimize = function(pattern, options) { + return braces.create(pattern, options); +}; + +/** + * Processes a brace pattern and returns either an expanded array (if `options.expand` is true), a highly optimized regex-compatible string. This method is called by the main [braces](#braces) function. + * + * ```js + * var braces = require('braces'); + * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) + * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces.create = function(pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('expected a string'); + } + + var maxLength = (options && options.maxLength) || MAX_LENGTH; + if (pattern.length >= maxLength) { + throw new Error('expected pattern to be less than ' + maxLength + ' characters'); + } + + function create() { + if (pattern === '' || pattern.length < 3) { + return [pattern]; + } + + if (utils.isEmptySets(pattern)) { + return []; + } + + if (utils.isQuotedString(pattern)) { + return [pattern.slice(1, -1)]; + } + + var proto = new Braces(options); + var result = !options || options.expand !== true + ? proto.optimize(pattern, options) + : proto.expand(pattern, options); + + // get the generated pattern(s) + var arr = result.output; + + // filter out empty strings if specified + if (options && options.noempty === true) { + arr = arr.filter(Boolean); + } + + // filter out duplicates if specified + if (options && options.nodupes === true) { + arr = unique(arr); + } + + Object.defineProperty(arr, 'result', { + enumerable: false, + value: result + }); + + return arr; + } + + return memoize('create', pattern, options, create); +}; + +/** + * Create a regular expression from the given string `pattern`. + * + * ```js + * var braces = require('braces'); + * + * console.log(braces.makeRe('id-{200..300}')); + * //=> /^(?:id-(20[0-9]|2[1-9][0-9]|300))$/ + * ``` + * @param {String} `pattern` The pattern to convert to regex. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + +braces.makeRe = function(pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('expected a string'); + } + + var maxLength = (options && options.maxLength) || MAX_LENGTH; + if (pattern.length >= maxLength) { + throw new Error('expected pattern to be less than ' + maxLength + ' characters'); + } + + function makeRe() { + var arr = braces(pattern, options); + var opts = extend({strictErrors: false}, options); + return toRegex(arr, opts); + } + + return memoize('makeRe', pattern, options, makeRe); +}; + +/** + * Parse the given `str` with the given `options`. + * + * ```js + * var braces = require('braces'); + * var ast = braces.parse('a/{b,c}/d'); + * console.log(ast); + * // { type: 'root', + * // errors: [], + * // input: 'a/{b,c}/d', + * // nodes: + * // [ { type: 'bos', val: '' }, + * // { type: 'text', val: 'a/' }, + * // { type: 'brace', + * // nodes: + * // [ { type: 'brace.open', val: '{' }, + * // { type: 'text', val: 'b,c' }, + * // { type: 'brace.close', val: '}' } ] }, + * // { type: 'text', val: '/d' }, + * // { type: 'eos', val: '' } ] } + * ``` + * @param {String} `pattern` Brace pattern to parse + * @param {Object} `options` + * @return {Object} Returns an AST + * @api public + */ + +braces.parse = function(pattern, options) { + var proto = new Braces(options); + return proto.parse(pattern, options); +}; + +/** + * Compile the given `ast` or string with the given `options`. + * + * ```js + * var braces = require('braces'); + * var ast = braces.parse('a/{b,c}/d'); + * console.log(braces.compile(ast)); + * // { options: { source: 'string' }, + * // state: {}, + * // compilers: + * // { eos: [Function], + * // noop: [Function], + * // bos: [Function], + * // brace: [Function], + * // 'brace.open': [Function], + * // text: [Function], + * // 'brace.close': [Function] }, + * // output: [ 'a/(b|c)/d' ], + * // ast: + * // { ... }, + * // parsingErrors: [] } + * ``` + * @param {Object|String} `ast` AST from [.parse](#parse). If a string is passed it will be parsed first. + * @param {Object} `options` + * @return {Object} Returns an object that has an `output` property with the compiled string. + * @api public + */ + +braces.compile = function(ast, options) { + var proto = new Braces(options); + return proto.compile(ast, options); +}; + +/** + * Clear the regex cache. + * + * ```js + * braces.clearCache(); + * ``` + * @api public + */ + +braces.clearCache = function() { + cache = braces.cache = {}; +}; + +/** + * Memoize a generated regex or function. A unique key is generated + * from the method name, pattern, and user-defined options. Set + * options.memoize to false to disable. + */ + +function memoize(type, pattern, options, fn) { + var key = utils.createKey(type + ':' + pattern, options); + var disabled = options && options.cache === false; + if (disabled) { + braces.clearCache(); + return fn(pattern, options); + } + + if (cache.hasOwnProperty(key)) { + return cache[key]; + } + + var res = fn(pattern, options); + cache[key] = res; + return res; +} + +/** + * Expose `Braces` constructor and methods + * @type {Function} + */ + +braces.Braces = Braces; +braces.compilers = compilers; +braces.parsers = parsers; +braces.cache = cache; + +/** + * Expose `braces` + * @type {Function} + */ + +module.exports = braces; diff --git a/node_modules/readdirp/node_modules/braces/lib/braces.js b/node_modules/readdirp/node_modules/braces/lib/braces.js new file mode 100644 index 000000000..baf6bf1bc --- /dev/null +++ b/node_modules/readdirp/node_modules/braces/lib/braces.js @@ -0,0 +1,104 @@ +'use strict'; + +var extend = require('extend-shallow'); +var Snapdragon = require('snapdragon'); +var compilers = require('./compilers'); +var parsers = require('./parsers'); +var utils = require('./utils'); + +/** + * Customize Snapdragon parser and renderer + */ + +function Braces(options) { + this.options = extend({}, options); +} + +/** + * Initialize braces + */ + +Braces.prototype.init = function(options) { + if (this.isInitialized) return; + this.isInitialized = true; + var opts = utils.createOptions({}, this.options, options); + this.snapdragon = this.options.snapdragon || new Snapdragon(opts); + this.compiler = this.snapdragon.compiler; + this.parser = this.snapdragon.parser; + + compilers(this.snapdragon, opts); + parsers(this.snapdragon, opts); + + /** + * Call Snapdragon `.parse` method. When AST is returned, we check to + * see if any unclosed braces are left on the stack and, if so, we iterate + * over the stack and correct the AST so that compilers are called in the correct + * order and unbalance braces are properly escaped. + */ + + utils.define(this.snapdragon, 'parse', function(pattern, options) { + var parsed = Snapdragon.prototype.parse.apply(this, arguments); + this.parser.ast.input = pattern; + + var stack = this.parser.stack; + while (stack.length) { + addParent({type: 'brace.close', val: ''}, stack.pop()); + } + + function addParent(node, parent) { + utils.define(node, 'parent', parent); + parent.nodes.push(node); + } + + // add non-enumerable parser reference + utils.define(parsed, 'parser', this.parser); + return parsed; + }); +}; + +/** + * Decorate `.parse` method + */ + +Braces.prototype.parse = function(ast, options) { + if (ast && typeof ast === 'object' && ast.nodes) return ast; + this.init(options); + return this.snapdragon.parse(ast, options); +}; + +/** + * Decorate `.compile` method + */ + +Braces.prototype.compile = function(ast, options) { + if (typeof ast === 'string') { + ast = this.parse(ast, options); + } else { + this.init(options); + } + return this.snapdragon.compile(ast, options); +}; + +/** + * Expand + */ + +Braces.prototype.expand = function(pattern) { + var ast = this.parse(pattern, {expand: true}); + return this.compile(ast, {expand: true}); +}; + +/** + * Optimize + */ + +Braces.prototype.optimize = function(pattern) { + var ast = this.parse(pattern, {optimize: true}); + return this.compile(ast, {optimize: true}); +}; + +/** + * Expose `Braces` + */ + +module.exports = Braces; diff --git a/node_modules/readdirp/node_modules/braces/lib/compilers.js b/node_modules/readdirp/node_modules/braces/lib/compilers.js new file mode 100644 index 000000000..a3b820e41 --- /dev/null +++ b/node_modules/readdirp/node_modules/braces/lib/compilers.js @@ -0,0 +1,282 @@ +'use strict'; + +var utils = require('./utils'); + +module.exports = function(braces, options) { + braces.compiler + + /** + * bos + */ + + .set('bos', function() { + if (this.output) return; + this.ast.queue = isEscaped(this.ast) ? [this.ast.val] : []; + this.ast.count = 1; + }) + + /** + * Square brackets + */ + + .set('bracket', function(node) { + var close = node.close; + var open = !node.escaped ? '[' : '\\['; + var negated = node.negated; + var inner = node.inner; + + inner = inner.replace(/\\(?=[\\\w]|$)/g, '\\\\'); + if (inner === ']-') { + inner = '\\]\\-'; + } + + if (negated && inner.indexOf('.') === -1) { + inner += '.'; + } + if (negated && inner.indexOf('/') === -1) { + inner += '/'; + } + + var val = open + negated + inner + close; + var queue = node.parent.queue; + var last = utils.arrayify(queue.pop()); + + queue.push(utils.join(last, val)); + queue.push.apply(queue, []); + }) + + /** + * Brace + */ + + .set('brace', function(node) { + node.queue = isEscaped(node) ? [node.val] : []; + node.count = 1; + return this.mapVisit(node.nodes); + }) + + /** + * Open + */ + + .set('brace.open', function(node) { + node.parent.open = node.val; + }) + + /** + * Inner + */ + + .set('text', function(node) { + var queue = node.parent.queue; + var escaped = node.escaped; + var segs = [node.val]; + + if (node.optimize === false) { + options = utils.extend({}, options, {optimize: false}); + } + + if (node.multiplier > 1) { + node.parent.count *= node.multiplier; + } + + if (options.quantifiers === true && utils.isQuantifier(node.val)) { + escaped = true; + + } else if (node.val.length > 1) { + if (isType(node.parent, 'brace') && !isEscaped(node)) { + var expanded = utils.expand(node.val, options); + segs = expanded.segs; + + if (expanded.isOptimized) { + node.parent.isOptimized = true; + } + + // if nothing was expanded, we probably have a literal brace + if (!segs.length) { + var val = (expanded.val || node.val); + if (options.unescape !== false) { + // unescape unexpanded brace sequence/set separators + val = val.replace(/\\([,.])/g, '$1'); + // strip quotes + val = val.replace(/["'`]/g, ''); + } + + segs = [val]; + escaped = true; + } + } + + } else if (node.val === ',') { + if (options.expand) { + node.parent.queue.push(['']); + segs = ['']; + } else { + segs = ['|']; + } + } else { + escaped = true; + } + + if (escaped && isType(node.parent, 'brace')) { + if (node.parent.nodes.length <= 4 && node.parent.count === 1) { + node.parent.escaped = true; + } else if (node.parent.length <= 3) { + node.parent.escaped = true; + } + } + + if (!hasQueue(node.parent)) { + node.parent.queue = segs; + return; + } + + var last = utils.arrayify(queue.pop()); + if (node.parent.count > 1 && options.expand) { + last = multiply(last, node.parent.count); + node.parent.count = 1; + } + + queue.push(utils.join(utils.flatten(last), segs.shift())); + queue.push.apply(queue, segs); + }) + + /** + * Close + */ + + .set('brace.close', function(node) { + var queue = node.parent.queue; + var prev = node.parent.parent; + var last = prev.queue.pop(); + var open = node.parent.open; + var close = node.val; + + if (open && close && isOptimized(node, options)) { + open = '('; + close = ')'; + } + + // if a close brace exists, and the previous segment is one character + // don't wrap the result in braces or parens + var ele = utils.last(queue); + if (node.parent.count > 1 && options.expand) { + ele = multiply(queue.pop(), node.parent.count); + node.parent.count = 1; + queue.push(ele); + } + + if (close && typeof ele === 'string' && ele.length === 1) { + open = ''; + close = ''; + } + + if ((isLiteralBrace(node, options) || noInner(node)) && !node.parent.hasEmpty) { + queue.push(utils.join(open, queue.pop() || '')); + queue = utils.flatten(utils.join(queue, close)); + } + + if (typeof last === 'undefined') { + prev.queue = [queue]; + } else { + prev.queue.push(utils.flatten(utils.join(last, queue))); + } + }) + + /** + * eos + */ + + .set('eos', function(node) { + if (this.input) return; + + if (options.optimize !== false) { + this.output = utils.last(utils.flatten(this.ast.queue)); + } else if (Array.isArray(utils.last(this.ast.queue))) { + this.output = utils.flatten(this.ast.queue.pop()); + } else { + this.output = utils.flatten(this.ast.queue); + } + + if (node.parent.count > 1 && options.expand) { + this.output = multiply(this.output, node.parent.count); + } + + this.output = utils.arrayify(this.output); + this.ast.queue = []; + }); + +}; + +/** + * Multiply the segments in the current brace level + */ + +function multiply(queue, n, options) { + return utils.flatten(utils.repeat(utils.arrayify(queue), n)); +} + +/** + * Return true if `node` is escaped + */ + +function isEscaped(node) { + return node.escaped === true; +} + +/** + * Returns true if regex parens should be used for sets. If the parent `type` + * is not `brace`, then we're on a root node, which means we should never + * expand segments and open/close braces should be `{}` (since this indicates + * a brace is missing from the set) + */ + +function isOptimized(node, options) { + if (node.parent.isOptimized) return true; + return isType(node.parent, 'brace') + && !isEscaped(node.parent) + && options.expand !== true; +} + +/** + * Returns true if the value in `node` should be wrapped in a literal brace. + * @return {Boolean} + */ + +function isLiteralBrace(node, options) { + return isEscaped(node.parent) || options.optimize !== false; +} + +/** + * Returns true if the given `node` does not have an inner value. + * @return {Boolean} + */ + +function noInner(node, type) { + if (node.parent.queue.length === 1) { + return true; + } + var nodes = node.parent.nodes; + return nodes.length === 3 + && isType(nodes[0], 'brace.open') + && !isType(nodes[1], 'text') + && isType(nodes[2], 'brace.close'); +} + +/** + * Returns true if the given `node` is the given `type` + * @return {Boolean} + */ + +function isType(node, type) { + return typeof node !== 'undefined' && node.type === type; +} + +/** + * Returns true if the given `node` has a non-empty queue. + * @return {Boolean} + */ + +function hasQueue(node) { + return Array.isArray(node.queue) && node.queue.length; +} diff --git a/node_modules/readdirp/node_modules/braces/lib/parsers.js b/node_modules/readdirp/node_modules/braces/lib/parsers.js new file mode 100644 index 000000000..8bf3e92b5 --- /dev/null +++ b/node_modules/readdirp/node_modules/braces/lib/parsers.js @@ -0,0 +1,360 @@ +'use strict'; + +var Node = require('snapdragon-node'); +var utils = require('./utils'); + +/** + * Braces parsers + */ + +module.exports = function(braces, options) { + braces.parser + .set('bos', function() { + if (!this.parsed) { + this.ast = this.nodes[0] = new Node(this.ast); + } + }) + + /** + * Character parsers + */ + + .set('escape', function() { + var pos = this.position(); + var m = this.match(/^(?:\\(.)|\$\{)/); + if (!m) return; + + var prev = this.prev(); + var last = utils.last(prev.nodes); + + var node = pos(new Node({ + type: 'text', + multiplier: 1, + val: m[0] + })); + + if (node.val === '\\\\') { + return node; + } + + if (node.val === '${') { + var str = this.input; + var idx = -1; + var ch; + + while ((ch = str[++idx])) { + this.consume(1); + node.val += ch; + if (ch === '\\') { + node.val += str[++idx]; + continue; + } + if (ch === '}') { + break; + } + } + } + + if (this.options.unescape !== false) { + node.val = node.val.replace(/\\([{}])/g, '$1'); + } + + if (last.val === '"' && this.input.charAt(0) === '"') { + last.val = node.val; + this.consume(1); + return; + } + + return concatNodes.call(this, pos, node, prev, options); + }) + + /** + * Brackets: "[...]" (basic, this is overridden by + * other parsers in more advanced implementations) + */ + + .set('bracket', function() { + var isInside = this.isInside('brace'); + var pos = this.position(); + var m = this.match(/^(?:\[([!^]?)([^\]]{2,}|\]-)(\]|[^*+?]+)|\[)/); + if (!m) return; + + var prev = this.prev(); + var val = m[0]; + var negated = m[1] ? '^' : ''; + var inner = m[2] || ''; + var close = m[3] || ''; + + if (isInside && prev.type === 'brace') { + prev.text = prev.text || ''; + prev.text += val; + } + + var esc = this.input.slice(0, 2); + if (inner === '' && esc === '\\]') { + inner += esc; + this.consume(2); + + var str = this.input; + var idx = -1; + var ch; + + while ((ch = str[++idx])) { + this.consume(1); + if (ch === ']') { + close = ch; + break; + } + inner += ch; + } + } + + return pos(new Node({ + type: 'bracket', + val: val, + escaped: close !== ']', + negated: negated, + inner: inner, + close: close + })); + }) + + /** + * Empty braces (we capture these early to + * speed up processing in the compiler) + */ + + .set('multiplier', function() { + var isInside = this.isInside('brace'); + var pos = this.position(); + var m = this.match(/^\{((?:,|\{,+\})+)\}/); + if (!m) return; + + this.multiplier = true; + var prev = this.prev(); + var val = m[0]; + + if (isInside && prev.type === 'brace') { + prev.text = prev.text || ''; + prev.text += val; + } + + var node = pos(new Node({ + type: 'text', + multiplier: 1, + match: m, + val: val + })); + + return concatNodes.call(this, pos, node, prev, options); + }) + + /** + * Open + */ + + .set('brace.open', function() { + var pos = this.position(); + var m = this.match(/^\{(?!(?:[^\\}]?|,+)\})/); + if (!m) return; + + var prev = this.prev(); + var last = utils.last(prev.nodes); + + // if the last parsed character was an extglob character + // we need to _not optimize_ the brace pattern because + // it might be mistaken for an extglob by a downstream parser + if (last && last.val && isExtglobChar(last.val.slice(-1))) { + last.optimize = false; + } + + var open = pos(new Node({ + type: 'brace.open', + val: m[0] + })); + + var node = pos(new Node({ + type: 'brace', + nodes: [] + })); + + node.push(open); + prev.push(node); + this.push('brace', node); + }) + + /** + * Close + */ + + .set('brace.close', function() { + var pos = this.position(); + var m = this.match(/^\}/); + if (!m || !m[0]) return; + + var brace = this.pop('brace'); + var node = pos(new Node({ + type: 'brace.close', + val: m[0] + })); + + if (!this.isType(brace, 'brace')) { + if (this.options.strict) { + throw new Error('missing opening "{"'); + } + node.type = 'text'; + node.multiplier = 0; + node.escaped = true; + return node; + } + + var prev = this.prev(); + var last = utils.last(prev.nodes); + if (last.text) { + var lastNode = utils.last(last.nodes); + if (lastNode.val === ')' && /[!@*?+]\(/.test(last.text)) { + var open = last.nodes[0]; + var text = last.nodes[1]; + if (open.type === 'brace.open' && text && text.type === 'text') { + text.optimize = false; + } + } + } + + if (brace.nodes.length > 2) { + var first = brace.nodes[1]; + if (first.type === 'text' && first.val === ',') { + brace.nodes.splice(1, 1); + brace.nodes.push(first); + } + } + + brace.push(node); + }) + + /** + * Capture boundary characters + */ + + .set('boundary', function() { + var pos = this.position(); + var m = this.match(/^[$^](?!\{)/); + if (!m) return; + return pos(new Node({ + type: 'text', + val: m[0] + })); + }) + + /** + * One or zero, non-comma characters wrapped in braces + */ + + .set('nobrace', function() { + var isInside = this.isInside('brace'); + var pos = this.position(); + var m = this.match(/^\{[^,]?\}/); + if (!m) return; + + var prev = this.prev(); + var val = m[0]; + + if (isInside && prev.type === 'brace') { + prev.text = prev.text || ''; + prev.text += val; + } + + return pos(new Node({ + type: 'text', + multiplier: 0, + val: val + })); + }) + + /** + * Text + */ + + .set('text', function() { + var isInside = this.isInside('brace'); + var pos = this.position(); + var m = this.match(/^((?!\\)[^${}[\]])+/); + if (!m) return; + + var prev = this.prev(); + var val = m[0]; + + if (isInside && prev.type === 'brace') { + prev.text = prev.text || ''; + prev.text += val; + } + + var node = pos(new Node({ + type: 'text', + multiplier: 1, + val: val + })); + + return concatNodes.call(this, pos, node, prev, options); + }); +}; + +/** + * Returns true if the character is an extglob character. + */ + +function isExtglobChar(ch) { + return ch === '!' || ch === '@' || ch === '*' || ch === '?' || ch === '+'; +} + +/** + * Combine text nodes, and calculate empty sets (`{,,}`) + * @param {Function} `pos` Function to calculate node position + * @param {Object} `node` AST node + * @return {Object} + */ + +function concatNodes(pos, node, parent, options) { + node.orig = node.val; + var prev = this.prev(); + var last = utils.last(prev.nodes); + var isEscaped = false; + + if (node.val.length > 1) { + var a = node.val.charAt(0); + var b = node.val.slice(-1); + + isEscaped = (a === '"' && b === '"') + || (a === "'" && b === "'") + || (a === '`' && b === '`'); + } + + if (isEscaped && options.unescape !== false) { + node.val = node.val.slice(1, node.val.length - 1); + node.escaped = true; + } + + if (node.match) { + var match = node.match[1]; + if (!match || match.indexOf('}') === -1) { + match = node.match[0]; + } + + // replace each set with a single "," + var val = match.replace(/\{/g, ',').replace(/\}/g, ''); + node.multiplier *= val.length; + node.val = ''; + } + + var simpleText = last.type === 'text' + && last.multiplier === 1 + && node.multiplier === 1 + && node.val; + + if (simpleText) { + last.val += node.val; + return; + } + + prev.push(node); +} diff --git a/node_modules/readdirp/node_modules/braces/lib/utils.js b/node_modules/readdirp/node_modules/braces/lib/utils.js new file mode 100644 index 000000000..471667171 --- /dev/null +++ b/node_modules/readdirp/node_modules/braces/lib/utils.js @@ -0,0 +1,343 @@ +'use strict'; + +var splitString = require('split-string'); +var utils = module.exports; + +/** + * Module dependencies + */ + +utils.extend = require('extend-shallow'); +utils.flatten = require('arr-flatten'); +utils.isObject = require('isobject'); +utils.fillRange = require('fill-range'); +utils.repeat = require('repeat-element'); +utils.unique = require('array-unique'); + +utils.define = function(obj, key, val) { + Object.defineProperty(obj, key, { + writable: true, + configurable: true, + enumerable: false, + value: val + }); +}; + +/** + * Returns true if the given string contains only empty brace sets. + */ + +utils.isEmptySets = function(str) { + return /^(?:\{,\})+$/.test(str); +}; + +/** + * Returns true if the given string contains only empty brace sets. + */ + +utils.isQuotedString = function(str) { + var open = str.charAt(0); + if (open === '\'' || open === '"' || open === '`') { + return str.slice(-1) === open; + } + return false; +}; + +/** + * Create the key to use for memoization. The unique key is generated + * by iterating over the options and concatenating key-value pairs + * to the pattern string. + */ + +utils.createKey = function(pattern, options) { + var id = pattern; + if (typeof options === 'undefined') { + return id; + } + var keys = Object.keys(options); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + id += ';' + key + '=' + String(options[key]); + } + return id; +}; + +/** + * Normalize options + */ + +utils.createOptions = function(options) { + var opts = utils.extend.apply(null, arguments); + if (typeof opts.expand === 'boolean') { + opts.optimize = !opts.expand; + } + if (typeof opts.optimize === 'boolean') { + opts.expand = !opts.optimize; + } + if (opts.optimize === true) { + opts.makeRe = true; + } + return opts; +}; + +/** + * Join patterns in `a` to patterns in `b` + */ + +utils.join = function(a, b, options) { + options = options || {}; + a = utils.arrayify(a); + b = utils.arrayify(b); + + if (!a.length) return b; + if (!b.length) return a; + + var len = a.length; + var idx = -1; + var arr = []; + + while (++idx < len) { + var val = a[idx]; + if (Array.isArray(val)) { + for (var i = 0; i < val.length; i++) { + val[i] = utils.join(val[i], b, options); + } + arr.push(val); + continue; + } + + for (var j = 0; j < b.length; j++) { + var bval = b[j]; + + if (Array.isArray(bval)) { + arr.push(utils.join(val, bval, options)); + } else { + arr.push(val + bval); + } + } + } + return arr; +}; + +/** + * Split the given string on `,` if not escaped. + */ + +utils.split = function(str, options) { + var opts = utils.extend({sep: ','}, options); + if (typeof opts.keepQuotes !== 'boolean') { + opts.keepQuotes = true; + } + if (opts.unescape === false) { + opts.keepEscaping = true; + } + return splitString(str, opts, utils.escapeBrackets(opts)); +}; + +/** + * Expand ranges or sets in the given `pattern`. + * + * @param {String} `str` + * @param {Object} `options` + * @return {Object} + */ + +utils.expand = function(str, options) { + var opts = utils.extend({rangeLimit: 10000}, options); + var segs = utils.split(str, opts); + var tok = { segs: segs }; + + if (utils.isQuotedString(str)) { + return tok; + } + + if (opts.rangeLimit === true) { + opts.rangeLimit = 10000; + } + + if (segs.length > 1) { + if (opts.optimize === false) { + tok.val = segs[0]; + return tok; + } + + tok.segs = utils.stringifyArray(tok.segs); + } else if (segs.length === 1) { + var arr = str.split('..'); + + if (arr.length === 1) { + tok.val = tok.segs[tok.segs.length - 1] || tok.val || str; + tok.segs = []; + return tok; + } + + if (arr.length === 2 && arr[0] === arr[1]) { + tok.escaped = true; + tok.val = arr[0]; + tok.segs = []; + return tok; + } + + if (arr.length > 1) { + if (opts.optimize !== false) { + opts.optimize = true; + delete opts.expand; + } + + if (opts.optimize !== true) { + var min = Math.min(arr[0], arr[1]); + var max = Math.max(arr[0], arr[1]); + var step = arr[2] || 1; + + if (opts.rangeLimit !== false && ((max - min) / step >= opts.rangeLimit)) { + throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); + } + } + + arr.push(opts); + tok.segs = utils.fillRange.apply(null, arr); + + if (!tok.segs.length) { + tok.escaped = true; + tok.val = str; + return tok; + } + + if (opts.optimize === true) { + tok.segs = utils.stringifyArray(tok.segs); + } + + if (tok.segs === '') { + tok.val = str; + } else { + tok.val = tok.segs[0]; + } + return tok; + } + } else { + tok.val = str; + } + return tok; +}; + +/** + * Ensure commas inside brackets and parens are not split. + * @param {Object} `tok` Token from the `split-string` module + * @return {undefined} + */ + +utils.escapeBrackets = function(options) { + return function(tok) { + if (tok.escaped && tok.val === 'b') { + tok.val = '\\b'; + return; + } + + if (tok.val !== '(' && tok.val !== '[') return; + var opts = utils.extend({}, options); + var brackets = []; + var parens = []; + var stack = []; + var val = tok.val; + var str = tok.str; + var i = tok.idx - 1; + + while (++i < str.length) { + var ch = str[i]; + + if (ch === '\\') { + val += (opts.keepEscaping === false ? '' : ch) + str[++i]; + continue; + } + + if (ch === '(') { + parens.push(ch); + stack.push(ch); + } + + if (ch === '[') { + brackets.push(ch); + stack.push(ch); + } + + if (ch === ')') { + parens.pop(); + stack.pop(); + if (!stack.length) { + val += ch; + break; + } + } + + if (ch === ']') { + brackets.pop(); + stack.pop(); + if (!stack.length) { + val += ch; + break; + } + } + val += ch; + } + + tok.split = false; + tok.val = val.slice(1); + tok.idx = i; + }; +}; + +/** + * Returns true if the given string looks like a regex quantifier + * @return {Boolean} + */ + +utils.isQuantifier = function(str) { + return /^(?:[0-9]?,[0-9]|[0-9],)$/.test(str); +}; + +/** + * Cast `val` to an array. + * @param {*} `val` + */ + +utils.stringifyArray = function(arr) { + return [utils.arrayify(arr).join('|')]; +}; + +/** + * Cast `val` to an array. + * @param {*} `val` + */ + +utils.arrayify = function(arr) { + if (typeof arr === 'undefined') { + return []; + } + if (typeof arr === 'string') { + return [arr]; + } + return arr; +}; + +/** + * Returns true if the given `str` is a non-empty string + * @return {Boolean} + */ + +utils.isString = function(str) { + return str != null && typeof str === 'string'; +}; + +/** + * Get the last element from `array` + * @param {Array} `array` + * @return {*} + */ + +utils.last = function(arr, n) { + return arr[arr.length - (n || 1)]; +}; + +utils.escapeRegex = function(str) { + return str.replace(/\\?([!^*?()[\]{}+?/])/g, '\\$1'); +}; diff --git a/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/LICENSE b/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/LICENSE new file mode 100644 index 000000000..fa30c4cb3 --- /dev/null +++ b/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/README.md b/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/README.md new file mode 100644 index 000000000..cdc45d4ff --- /dev/null +++ b/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/README.md @@ -0,0 +1,61 @@ +# extend-shallow [![NPM version](https://badge.fury.io/js/extend-shallow.svg)](http://badge.fury.io/js/extend-shallow) [![Build Status](https://travis-ci.org/jonschlinkert/extend-shallow.svg)](https://travis-ci.org/jonschlinkert/extend-shallow) + +> Extend an object with the properties of additional objects. node.js/javascript util. + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i extend-shallow --save +``` + +## Usage + +```js +var extend = require('extend-shallow'); + +extend({a: 'b'}, {c: 'd'}) +//=> {a: 'b', c: 'd'} +``` + +Pass an empty object to shallow clone: + +```js +var obj = {}; +extend(obj, {a: 'b'}, {c: 'd'}) +//=> {a: 'b', c: 'd'} +``` + +## Related + +* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. +* [for-own](https://github.com/jonschlinkert/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) +* [for-in](https://github.com/jonschlinkert/for-in): Iterate over the own and inherited enumerable properties of an objecte, and return an object… [more](https://github.com/jonschlinkert/for-in) +* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor. +* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null. +* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value. + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 29, 2015._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/index.js b/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/index.js new file mode 100644 index 000000000..92a067fcc --- /dev/null +++ b/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/index.js @@ -0,0 +1,33 @@ +'use strict'; + +var isObject = require('is-extendable'); + +module.exports = function extend(o/*, objects*/) { + if (!isObject(o)) { o = {}; } + + var len = arguments.length; + for (var i = 1; i < len; i++) { + var obj = arguments[i]; + + if (isObject(obj)) { + assign(o, obj); + } + } + return o; +}; + +function assign(a, b) { + for (var key in b) { + if (hasOwn(b, key)) { + a[key] = b[key]; + } + } +} + +/** + * Returns true if the given `key` is an own property of `obj`. + */ + +function hasOwn(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} diff --git a/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/package.json b/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/package.json new file mode 100644 index 000000000..ba82f1bfd --- /dev/null +++ b/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/package.json @@ -0,0 +1,87 @@ +{ + "_from": "extend-shallow@^2.0.1", + "_id": "extend-shallow@2.0.1", + "_inBundle": false, + "_integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "_location": "/readdirp/braces/extend-shallow", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "extend-shallow@^2.0.1", + "name": "extend-shallow", + "escapedName": "extend-shallow", + "rawSpec": "^2.0.1", + "saveSpec": null, + "fetchSpec": "^2.0.1" + }, + "_requiredBy": [ + "/readdirp/braces" + ], + "_resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "_shasum": "51af7d614ad9a9f610ea1bafbb989d6b1c56890f", + "_spec": "extend-shallow@^2.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/braces", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/extend-shallow/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "deprecated": false, + "description": "Extend an object with the properties of additional objects. node.js/javascript util.", + "devDependencies": { + "array-slice": "^0.2.3", + "benchmarked": "^0.1.4", + "chalk": "^1.0.0", + "for-own": "^0.1.3", + "glob": "^5.0.12", + "is-plain-object": "^2.0.1", + "kind-of": "^2.0.0", + "minimist": "^1.1.1", + "mocha": "^2.2.5", + "should": "^7.0.1" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/extend-shallow", + "keywords": [ + "assign", + "extend", + "javascript", + "js", + "keys", + "merge", + "obj", + "object", + "prop", + "properties", + "property", + "props", + "shallow", + "util", + "utility", + "utils", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "extend-shallow", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/extend-shallow.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "2.0.1" +} diff --git a/node_modules/readdirp/node_modules/braces/package.json b/node_modules/readdirp/node_modules/braces/package.json new file mode 100644 index 000000000..59ddfed61 --- /dev/null +++ b/node_modules/readdirp/node_modules/braces/package.json @@ -0,0 +1,156 @@ +{ + "_from": "braces@^2.3.1", + "_id": "braces@2.3.2", + "_inBundle": false, + "_integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "_location": "/readdirp/braces", + "_phantomChildren": { + "is-extendable": "0.1.1" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "braces@^2.3.1", + "name": "braces", + "escapedName": "braces", + "rawSpec": "^2.3.1", + "saveSpec": null, + "fetchSpec": "^2.3.1" + }, + "_requiredBy": [ + "/readdirp/micromatch" + ], + "_resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "_shasum": "5979fd3f14cd531565e5fa2df1abfff1dfaee729", + "_spec": "braces@^2.3.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/micromatch/braces/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Elan Shanker", + "url": "https://github.com/es128" + }, + { + "name": "Eugene Sharygin", + "url": "https://github.com/eush77" + }, + { + "name": "hemanth.hm", + "url": "http://h3manth.com" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + } + ], + "dependencies": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "deprecated": false, + "description": "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.", + "devDependencies": { + "ansi-cyan": "^0.1.1", + "benchmarked": "^2.0.0", + "brace-expansion": "^1.1.8", + "cross-spawn": "^5.1.0", + "gulp": "^3.9.1", + "gulp-eslint": "^4.0.0", + "gulp-format-md": "^1.0.0", + "gulp-istanbul": "^1.1.2", + "gulp-mocha": "^3.0.1", + "gulp-unused": "^0.2.1", + "is-windows": "^1.0.1", + "minimatch": "^3.0.4", + "mocha": "^3.2.0", + "noncharacters": "^1.1.0", + "text-table": "^0.2.0", + "time-diff": "^0.3.1", + "yargs-parser": "^8.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "lib" + ], + "homepage": "https://github.com/micromatch/braces", + "keywords": [ + "alpha", + "alphabetical", + "bash", + "brace", + "braces", + "expand", + "expansion", + "filepath", + "fill", + "fs", + "glob", + "globbing", + "letter", + "match", + "matches", + "matching", + "number", + "numerical", + "path", + "range", + "ranges", + "sh" + ], + "license": "MIT", + "main": "index.js", + "name": "braces", + "repository": { + "type": "git", + "url": "git+https://github.com/micromatch/braces.git" + }, + "scripts": { + "benchmark": "node benchmark", + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "lint": { + "reflinks": true + }, + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "expand-brackets", + "extglob", + "fill-range", + "micromatch", + "nanomatch" + ] + } + }, + "version": "2.3.2" +} diff --git a/node_modules/readdirp/node_modules/expand-brackets/LICENSE b/node_modules/readdirp/node_modules/expand-brackets/LICENSE new file mode 100644 index 000000000..652517172 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2016, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/expand-brackets/README.md b/node_modules/readdirp/node_modules/expand-brackets/README.md new file mode 100644 index 000000000..c0e33d080 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/README.md @@ -0,0 +1,302 @@ +# expand-brackets [![NPM version](https://img.shields.io/npm/v/expand-brackets.svg?style=flat)](https://www.npmjs.com/package/expand-brackets) [![NPM monthly downloads](https://img.shields.io/npm/dm/expand-brackets.svg?style=flat)](https://npmjs.org/package/expand-brackets) [![NPM total downloads](https://img.shields.io/npm/dt/expand-brackets.svg?style=flat)](https://npmjs.org/package/expand-brackets) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/expand-brackets.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/expand-brackets) [![Windows Build Status](https://img.shields.io/appveyor/ci/jonschlinkert/expand-brackets.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/jonschlinkert/expand-brackets) + +> Expand POSIX bracket expressions (character classes) in glob patterns. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save expand-brackets +``` + +## Usage + +```js +var brackets = require('expand-brackets'); +brackets(string[, options]); +``` + +**Params** + +The main export is a function that takes the following parameters: + +* `pattern` **{String}**: the pattern to convert +* `options` **{Object}**: optionally supply an options object +* `returns` **{String}**: returns a string that can be used to create a regex + +**Example** + +```js +console.log(brackets('[![:lower:]]')); +//=> '[^a-z]' +``` + +## API + +### [brackets](index.js#L29) + +Parses the given POSIX character class `pattern` and returns a +string that can be used for creating regular expressions for matching. + +**Params** + +* `pattern` **{String}** +* `options` **{Object}** +* `returns` **{Object}** + +### [.match](index.js#L54) + +Takes an array of strings and a POSIX character class pattern, and returns a new array with only the strings that matched the pattern. + +**Example** + +```js +var brackets = require('expand-brackets'); +console.log(brackets.match(['1', 'a', 'ab'], '[[:alpha:]]')); +//=> ['a'] + +console.log(brackets.match(['1', 'a', 'ab'], '[[:alpha:]]+')); +//=> ['a', 'ab'] +``` + +**Params** + +* `arr` **{Array}**: Array of strings to match +* `pattern` **{String}**: POSIX character class pattern(s) +* `options` **{Object}** +* `returns` **{Array}** + +### [.isMatch](index.js#L100) + +Returns true if the specified `string` matches the given brackets `pattern`. + +**Example** + +```js +var brackets = require('expand-brackets'); + +console.log(brackets.isMatch('a.a', '[[:alpha:]].[[:alpha:]]')); +//=> true +console.log(brackets.isMatch('1.2', '[[:alpha:]].[[:alpha:]]')); +//=> false +``` + +**Params** + +* `string` **{String}**: String to match +* `pattern` **{String}**: Poxis pattern +* `options` **{String}** +* `returns` **{Boolean}** + +### [.matcher](index.js#L123) + +Takes a POSIX character class pattern and returns a matcher function. The returned function takes the string to match as its only argument. + +**Example** + +```js +var brackets = require('expand-brackets'); +var isMatch = brackets.matcher('[[:lower:]].[[:upper:]]'); + +console.log(isMatch('a.a')); +//=> false +console.log(isMatch('a.A')); +//=> true +``` + +**Params** + +* `pattern` **{String}**: Poxis pattern +* `options` **{String}** +* `returns` **{Boolean}** + +### [.makeRe](index.js#L145) + +Create a regular expression from the given `pattern`. + +**Example** + +```js +var brackets = require('expand-brackets'); +var re = brackets.makeRe('[[:alpha:]]'); +console.log(re); +//=> /^(?:[a-zA-Z])$/ +``` + +**Params** + +* `pattern` **{String}**: The pattern to convert to regex. +* `options` **{Object}** +* `returns` **{RegExp}** + +### [.create](index.js#L187) + +Parses the given POSIX character class `pattern` and returns an object with the compiled `output` and optional source `map`. + +**Example** + +```js +var brackets = require('expand-brackets'); +console.log(brackets('[[:alpha:]]')); +// { options: { source: 'string' }, +// input: '[[:alpha:]]', +// state: {}, +// compilers: +// { eos: [Function], +// noop: [Function], +// bos: [Function], +// not: [Function], +// escape: [Function], +// text: [Function], +// posix: [Function], +// bracket: [Function], +// 'bracket.open': [Function], +// 'bracket.inner': [Function], +// 'bracket.literal': [Function], +// 'bracket.close': [Function] }, +// output: '[a-zA-Z]', +// ast: +// { type: 'root', +// errors: [], +// nodes: [ [Object], [Object], [Object] ] }, +// parsingErrors: [] } +``` + +**Params** + +* `pattern` **{String}** +* `options` **{Object}** +* `returns` **{Object}** + +## Options + +### options.sourcemap + +Generate a source map for the given pattern. + +**Example** + +```js +var res = brackets('[:alpha:]', {sourcemap: true}); + +console.log(res.map); +// { version: 3, +// sources: [ 'brackets' ], +// names: [], +// mappings: 'AAAA,MAAS', +// sourcesContent: [ '[:alpha:]' ] } +``` + +### POSIX Character classes + +The following named POSIX bracket expressions are supported: + +* `[:alnum:]`: Alphanumeric characters (`a-zA-Z0-9]`) +* `[:alpha:]`: Alphabetic characters (`a-zA-Z]`) +* `[:blank:]`: Space and tab (`[ t]`) +* `[:digit:]`: Digits (`[0-9]`) +* `[:lower:]`: Lowercase letters (`[a-z]`) +* `[:punct:]`: Punctuation and symbols. (`[!"#$%&'()*+, -./:;<=>?@ [\]^_``{|}~]`) +* `[:upper:]`: Uppercase letters (`[A-Z]`) +* `[:word:]`: Word characters (letters, numbers and underscores) (`[A-Za-z0-9_]`) +* `[:xdigit:]`: Hexadecimal digits (`[A-Fa-f0-9]`) + +See [posix-character-classes](https://github.com/jonschlinkert/posix-character-classes) for more details. + +**Not supported** + +* [equivalence classes](https://www.gnu.org/software/gawk/manual/html_node/Bracket-Expressions.html) are not supported +* [POSIX.2 collating symbols](https://www.gnu.org/software/gawk/manual/html_node/Bracket-Expressions.html) are not supported + +## Changelog + +### v2.0.0 + +**Breaking changes** + +* The main export now returns the compiled string, instead of the object returned from the compiler + +**Added features** + +* Adds a `.create` method to do what the main function did before v2.0.0 + +### v0.2.0 + +In addition to performance and matching improvements, the v0.2.0 refactor adds complete POSIX character class support, with the exception of equivalence classes and POSIX.2 collating symbols which are not relevant to node.js usage. + +**Added features** + +* parser is exposed, so that expand-brackets parsers can be used by upstream parsers (like [micromatch](https://github.com/jonschlinkert/micromatch)) +* compiler is exposed, so that expand-brackets compilers can be used by upstream compilers +* source maps + +**source map example** + +```js +var brackets = require('expand-brackets'); +var res = brackets('[:alpha:]'); +console.log(res.map); + +{ version: 3, + sources: [ 'brackets' ], + names: [], + mappings: 'AAAA,MAAS', + sourcesContent: [ '[:alpha:]' ] } +``` + +## About + +### Related projects + +* [braces](https://www.npmjs.com/package/braces): Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces… [more](https://github.com/jonschlinkert/braces) | [homepage](https://github.com/jonschlinkert/braces "Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces specification, without sacrificing speed.") +* [extglob](https://www.npmjs.com/package/extglob): Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob… [more](https://github.com/jonschlinkert/extglob) | [homepage](https://github.com/jonschlinkert/extglob "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") +* [nanomatch](https://www.npmjs.com/package/nanomatch): Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash… [more](https://github.com/jonschlinkert/nanomatch) | [homepage](https://github.com/jonschlinkert/nanomatch "Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces)") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor**
    | +| --- | --- | +| 66 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [MartinKolarik](https://github.com/MartinKolarik) | +| 2 | [es128](https://github.com/es128) | +| 1 | [eush77](https://github.com/eush77) | + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/expand-brackets/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on December 12, 2016._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/expand-brackets/changelog.md b/node_modules/readdirp/node_modules/expand-brackets/changelog.md new file mode 100644 index 000000000..0c0723ab4 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/changelog.md @@ -0,0 +1,35 @@ +## Changelog + +### v2.0.0 + +**Breaking changes** + +- The main export now returns the compiled string, instead of the object returned from the compiler + +**Added features** + +- Adds a `.create` method to do what the main function did before v2.0.0 + +### v0.2.0 + +In addition to performance and matching improvements, the v0.2.0 refactor adds complete POSIX character class support, with the exception of equivalence classes and POSIX.2 collating symbols which are not relevant to node.js usage. + +**Added features** + +- parser is exposed, so that expand-brackets parsers can be used by upstream parsers (like [micromatch][]) +- compiler is exposed, so that expand-brackets compilers can be used by upstream compilers +- source maps + +**source map example** + +```js +var brackets = require('expand-brackets'); +var res = brackets('[:alpha:]'); +console.log(res.map); + +{ version: 3, + sources: [ 'brackets' ], + names: [], + mappings: 'AAAA,MAAS', + sourcesContent: [ '[:alpha:]' ] } +``` diff --git a/node_modules/readdirp/node_modules/expand-brackets/index.js b/node_modules/readdirp/node_modules/expand-brackets/index.js new file mode 100644 index 000000000..74b8b1556 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/index.js @@ -0,0 +1,211 @@ +'use strict'; + +/** + * Local dependencies + */ + +var compilers = require('./lib/compilers'); +var parsers = require('./lib/parsers'); + +/** + * Module dependencies + */ + +var debug = require('debug')('expand-brackets'); +var extend = require('extend-shallow'); +var Snapdragon = require('snapdragon'); +var toRegex = require('to-regex'); + +/** + * Parses the given POSIX character class `pattern` and returns a + * string that can be used for creating regular expressions for matching. + * + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} + * @api public + */ + +function brackets(pattern, options) { + debug('initializing from <%s>', __filename); + var res = brackets.create(pattern, options); + return res.output; +} + +/** + * Takes an array of strings and a POSIX character class pattern, and returns a new + * array with only the strings that matched the pattern. + * + * ```js + * var brackets = require('expand-brackets'); + * console.log(brackets.match(['1', 'a', 'ab'], '[[:alpha:]]')); + * //=> ['a'] + * + * console.log(brackets.match(['1', 'a', 'ab'], '[[:alpha:]]+')); + * //=> ['a', 'ab'] + * ``` + * @param {Array} `arr` Array of strings to match + * @param {String} `pattern` POSIX character class pattern(s) + * @param {Object} `options` + * @return {Array} + * @api public + */ + +brackets.match = function(arr, pattern, options) { + arr = [].concat(arr); + var opts = extend({}, options); + var isMatch = brackets.matcher(pattern, opts); + var len = arr.length; + var idx = -1; + var res = []; + + while (++idx < len) { + var ele = arr[idx]; + if (isMatch(ele)) { + res.push(ele); + } + } + + if (res.length === 0) { + if (opts.failglob === true) { + throw new Error('no matches found for "' + pattern + '"'); + } + + if (opts.nonull === true || opts.nullglob === true) { + return [pattern.split('\\').join('')]; + } + } + return res; +}; + +/** + * Returns true if the specified `string` matches the given + * brackets `pattern`. + * + * ```js + * var brackets = require('expand-brackets'); + * + * console.log(brackets.isMatch('a.a', '[[:alpha:]].[[:alpha:]]')); + * //=> true + * console.log(brackets.isMatch('1.2', '[[:alpha:]].[[:alpha:]]')); + * //=> false + * ``` + * @param {String} `string` String to match + * @param {String} `pattern` Poxis pattern + * @param {String} `options` + * @return {Boolean} + * @api public + */ + +brackets.isMatch = function(str, pattern, options) { + return brackets.matcher(pattern, options)(str); +}; + +/** + * Takes a POSIX character class pattern and returns a matcher function. The returned + * function takes the string to match as its only argument. + * + * ```js + * var brackets = require('expand-brackets'); + * var isMatch = brackets.matcher('[[:lower:]].[[:upper:]]'); + * + * console.log(isMatch('a.a')); + * //=> false + * console.log(isMatch('a.A')); + * //=> true + * ``` + * @param {String} `pattern` Poxis pattern + * @param {String} `options` + * @return {Boolean} + * @api public + */ + +brackets.matcher = function(pattern, options) { + var re = brackets.makeRe(pattern, options); + return function(str) { + return re.test(str); + }; +}; + +/** + * Create a regular expression from the given `pattern`. + * + * ```js + * var brackets = require('expand-brackets'); + * var re = brackets.makeRe('[[:alpha:]]'); + * console.log(re); + * //=> /^(?:[a-zA-Z])$/ + * ``` + * @param {String} `pattern` The pattern to convert to regex. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + +brackets.makeRe = function(pattern, options) { + var res = brackets.create(pattern, options); + var opts = extend({strictErrors: false}, options); + return toRegex(res.output, opts); +}; + +/** + * Parses the given POSIX character class `pattern` and returns an object + * with the compiled `output` and optional source `map`. + * + * ```js + * var brackets = require('expand-brackets'); + * console.log(brackets('[[:alpha:]]')); + * // { options: { source: 'string' }, + * // input: '[[:alpha:]]', + * // state: {}, + * // compilers: + * // { eos: [Function], + * // noop: [Function], + * // bos: [Function], + * // not: [Function], + * // escape: [Function], + * // text: [Function], + * // posix: [Function], + * // bracket: [Function], + * // 'bracket.open': [Function], + * // 'bracket.inner': [Function], + * // 'bracket.literal': [Function], + * // 'bracket.close': [Function] }, + * // output: '[a-zA-Z]', + * // ast: + * // { type: 'root', + * // errors: [], + * // nodes: [ [Object], [Object], [Object] ] }, + * // parsingErrors: [] } + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} + * @api public + */ + +brackets.create = function(pattern, options) { + var snapdragon = (options && options.snapdragon) || new Snapdragon(options); + compilers(snapdragon); + parsers(snapdragon); + + var ast = snapdragon.parse(pattern, options); + ast.input = pattern; + var res = snapdragon.compile(ast, options); + res.input = pattern; + return res; +}; + +/** + * Expose `brackets` constructor, parsers and compilers + */ + +brackets.compilers = compilers; +brackets.parsers = parsers; + +/** + * Expose `brackets` + * @type {Function} + */ + +module.exports = brackets; diff --git a/node_modules/readdirp/node_modules/expand-brackets/lib/compilers.js b/node_modules/readdirp/node_modules/expand-brackets/lib/compilers.js new file mode 100644 index 000000000..fbf7fe818 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/lib/compilers.js @@ -0,0 +1,87 @@ +'use strict'; + +var posix = require('posix-character-classes'); + +module.exports = function(brackets) { + brackets.compiler + + /** + * Escaped characters + */ + + .set('escape', function(node) { + return this.emit('\\' + node.val.replace(/^\\/, ''), node); + }) + + /** + * Text + */ + + .set('text', function(node) { + return this.emit(node.val.replace(/([{}])/g, '\\$1'), node); + }) + + /** + * POSIX character classes + */ + + .set('posix', function(node) { + if (node.val === '[::]') { + return this.emit('\\[::\\]', node); + } + + var val = posix[node.inner]; + if (typeof val === 'undefined') { + val = '[' + node.inner + ']'; + } + return this.emit(val, node); + }) + + /** + * Non-posix brackets + */ + + .set('bracket', function(node) { + return this.mapVisit(node.nodes); + }) + .set('bracket.open', function(node) { + return this.emit(node.val, node); + }) + .set('bracket.inner', function(node) { + var inner = node.val; + + if (inner === '[' || inner === ']') { + return this.emit('\\' + node.val, node); + } + if (inner === '^]') { + return this.emit('^\\]', node); + } + if (inner === '^') { + return this.emit('^', node); + } + + if (/-/.test(inner) && !/(\d-\d|\w-\w)/.test(inner)) { + inner = inner.split('-').join('\\-'); + } + + var isNegated = inner.charAt(0) === '^'; + // add slashes to negated brackets, per spec + if (isNegated && inner.indexOf('/') === -1) { + inner += '/'; + } + if (isNegated && inner.indexOf('.') === -1) { + inner += '.'; + } + + // don't unescape `0` (octal literal) + inner = inner.replace(/\\([1-9])/g, '$1'); + return this.emit(inner, node); + }) + .set('bracket.close', function(node) { + var val = node.val.replace(/^\\/, ''); + if (node.parent.escaped === true) { + return this.emit('\\' + val, node); + } + return this.emit(val, node); + }); +}; diff --git a/node_modules/readdirp/node_modules/expand-brackets/lib/parsers.js b/node_modules/readdirp/node_modules/expand-brackets/lib/parsers.js new file mode 100644 index 000000000..450a512e4 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/lib/parsers.js @@ -0,0 +1,219 @@ +'use strict'; + +var utils = require('./utils'); +var define = require('define-property'); + +/** + * Text regex + */ + +var TEXT_REGEX = '(\\[(?=.*\\])|\\])+'; +var not = utils.createRegex(TEXT_REGEX); + +/** + * Brackets parsers + */ + +function parsers(brackets) { + brackets.state = brackets.state || {}; + brackets.parser.sets.bracket = brackets.parser.sets.bracket || []; + brackets.parser + + .capture('escape', function() { + if (this.isInside('bracket')) return; + var pos = this.position(); + var m = this.match(/^\\(.)/); + if (!m) return; + + return pos({ + type: 'escape', + val: m[0] + }); + }) + + /** + * Text parser + */ + + .capture('text', function() { + if (this.isInside('bracket')) return; + var pos = this.position(); + var m = this.match(not); + if (!m || !m[0]) return; + + return pos({ + type: 'text', + val: m[0] + }); + }) + + /** + * POSIX character classes: "[[:alpha:][:digits:]]" + */ + + .capture('posix', function() { + var pos = this.position(); + var m = this.match(/^\[:(.*?):\](?=.*\])/); + if (!m) return; + + var inside = this.isInside('bracket'); + if (inside) { + brackets.posix++; + } + + return pos({ + type: 'posix', + insideBracket: inside, + inner: m[1], + val: m[0] + }); + }) + + /** + * Bracket (noop) + */ + + .capture('bracket', function() {}) + + /** + * Open: '[' + */ + + .capture('bracket.open', function() { + var parsed = this.parsed; + var pos = this.position(); + var m = this.match(/^\[(?=.*\])/); + if (!m) return; + + var prev = this.prev(); + var last = utils.last(prev.nodes); + + if (parsed.slice(-1) === '\\' && !this.isInside('bracket')) { + last.val = last.val.slice(0, last.val.length - 1); + return pos({ + type: 'escape', + val: m[0] + }); + } + + var open = pos({ + type: 'bracket.open', + val: m[0] + }); + + if (last.type === 'bracket.open' || this.isInside('bracket')) { + open.val = '\\' + open.val; + open.type = 'bracket.inner'; + open.escaped = true; + return open; + } + + var node = pos({ + type: 'bracket', + nodes: [open] + }); + + define(node, 'parent', prev); + define(open, 'parent', node); + this.push('bracket', node); + prev.nodes.push(node); + }) + + /** + * Bracket text + */ + + .capture('bracket.inner', function() { + if (!this.isInside('bracket')) return; + var pos = this.position(); + var m = this.match(not); + if (!m || !m[0]) return; + + var next = this.input.charAt(0); + var val = m[0]; + + var node = pos({ + type: 'bracket.inner', + val: val + }); + + if (val === '\\\\') { + return node; + } + + var first = val.charAt(0); + var last = val.slice(-1); + + if (first === '!') { + val = '^' + val.slice(1); + } + + if (last === '\\' || (val === '^' && next === ']')) { + val += this.input[0]; + this.consume(1); + } + + node.val = val; + return node; + }) + + /** + * Close: ']' + */ + + .capture('bracket.close', function() { + var parsed = this.parsed; + var pos = this.position(); + var m = this.match(/^\]/); + if (!m) return; + + var prev = this.prev(); + var last = utils.last(prev.nodes); + + if (parsed.slice(-1) === '\\' && !this.isInside('bracket')) { + last.val = last.val.slice(0, last.val.length - 1); + + return pos({ + type: 'escape', + val: m[0] + }); + } + + var node = pos({ + type: 'bracket.close', + rest: this.input, + val: m[0] + }); + + if (last.type === 'bracket.open') { + node.type = 'bracket.inner'; + node.escaped = true; + return node; + } + + var bracket = this.pop('bracket'); + if (!this.isType(bracket, 'bracket')) { + if (this.options.strict) { + throw new Error('missing opening "["'); + } + node.type = 'bracket.inner'; + node.escaped = true; + return node; + } + + bracket.nodes.push(node); + define(node, 'parent', bracket); + }); +} + +/** + * Brackets parsers + */ + +module.exports = parsers; + +/** + * Expose text regex + */ + +module.exports.TEXT_REGEX = TEXT_REGEX; diff --git a/node_modules/readdirp/node_modules/expand-brackets/lib/utils.js b/node_modules/readdirp/node_modules/expand-brackets/lib/utils.js new file mode 100644 index 000000000..599ff5126 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/lib/utils.js @@ -0,0 +1,34 @@ +'use strict'; + +var toRegex = require('to-regex'); +var regexNot = require('regex-not'); +var cached; + +/** + * Get the last element from `array` + * @param {Array} `array` + * @return {*} + */ + +exports.last = function(arr) { + return arr[arr.length - 1]; +}; + +/** + * Create and cache regex to use for text nodes + */ + +exports.createRegex = function(pattern, include) { + if (cached) return cached; + var opts = {contains: true, strictClose: false}; + var not = regexNot.create(pattern, opts); + var re; + + if (typeof include === 'string') { + re = toRegex('^(?:' + include + '|' + not + ')', opts); + } else { + re = toRegex(not, opts); + } + + return (cached = re); +}; diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/LICENSE b/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/LICENSE new file mode 100644 index 000000000..65f90aca8 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/README.md b/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/README.md new file mode 100644 index 000000000..8cac698ad --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/README.md @@ -0,0 +1,77 @@ +# define-property [![NPM version](https://badge.fury.io/js/define-property.svg)](http://badge.fury.io/js/define-property) + +> Define a non-enumerable property on an object. + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i define-property --save +``` + +## Usage + +**Params** + +* `obj`: The object on which to define the property. +* `prop`: The name of the property to be defined or modified. +* `descriptor`: The descriptor for the property being defined or modified. + +```js +var define = require('define-property'); +var obj = {}; +define(obj, 'foo', function(val) { + return val.toUpperCase(); +}); + +console.log(obj); +//=> {} + +console.log(obj.foo('bar')); +//=> 'BAR' +``` + +**get/set** + +```js +define(obj, 'foo', { + get: function() {}, + set: function() {} +}); +``` + +## Related projects + +* [delegate-object](https://www.npmjs.com/package/delegate-object): Copy properties from an object to another object, where properties with function values will be… [more](https://www.npmjs.com/package/delegate-object) | [homepage](https://github.com/doowb/delegate-object) +* [forward-object](https://www.npmjs.com/package/forward-object): Copy properties from an object to another object, where properties with function values will be… [more](https://www.npmjs.com/package/forward-object) | [homepage](https://github.com/doowb/forward-object) +* [mixin-deep](https://www.npmjs.com/package/mixin-deep): Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. | [homepage](https://github.com/jonschlinkert/mixin-deep) +* [mixin-object](https://www.npmjs.com/package/mixin-object): Mixin the own and inherited properties of other objects onto the first object. Pass an… [more](https://www.npmjs.com/package/mixin-object) | [homepage](https://github.com/jonschlinkert/mixin-object) + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/define-property/issues/new). + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 31, 2015._ diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/index.js b/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/index.js new file mode 100644 index 000000000..3e0e5e133 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/index.js @@ -0,0 +1,31 @@ +/*! + * define-property + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var isDescriptor = require('is-descriptor'); + +module.exports = function defineProperty(obj, prop, val) { + if (typeof obj !== 'object' && typeof obj !== 'function') { + throw new TypeError('expected an object or function.'); + } + + if (typeof prop !== 'string') { + throw new TypeError('expected `prop` to be a string.'); + } + + if (isDescriptor(val) && ('set' in val || 'get' in val)) { + return Object.defineProperty(obj, prop, val); + } + + return Object.defineProperty(obj, prop, { + configurable: true, + enumerable: false, + writable: true, + value: val + }); +}; diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/package.json b/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/package.json new file mode 100644 index 000000000..5004497e7 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/package.json @@ -0,0 +1,82 @@ +{ + "_from": "define-property@^0.2.5", + "_id": "define-property@0.2.5", + "_inBundle": false, + "_integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "_location": "/readdirp/expand-brackets/define-property", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "define-property@^0.2.5", + "name": "define-property", + "escapedName": "define-property", + "rawSpec": "^0.2.5", + "saveSpec": null, + "fetchSpec": "^0.2.5" + }, + "_requiredBy": [ + "/readdirp/expand-brackets" + ], + "_resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "_shasum": "c35b1ef918ec3c990f9a5bc57be04aacec5c8116", + "_spec": "define-property@^0.2.5", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/expand-brackets", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/define-property/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "deprecated": false, + "description": "Define a non-enumerable property on an object.", + "devDependencies": { + "mocha": "*", + "should": "^7.0.4" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/define-property", + "keywords": [ + "define", + "define-property", + "enumerable", + "key", + "non", + "non-enumerable", + "object", + "prop", + "property", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "define-property", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/define-property.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "mixin-deep", + "mixin-object", + "delegate-object", + "forward-object" + ] + } + }, + "version": "0.2.5" +} diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/LICENSE b/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/LICENSE new file mode 100644 index 000000000..fa30c4cb3 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/README.md b/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/README.md new file mode 100644 index 000000000..cdc45d4ff --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/README.md @@ -0,0 +1,61 @@ +# extend-shallow [![NPM version](https://badge.fury.io/js/extend-shallow.svg)](http://badge.fury.io/js/extend-shallow) [![Build Status](https://travis-ci.org/jonschlinkert/extend-shallow.svg)](https://travis-ci.org/jonschlinkert/extend-shallow) + +> Extend an object with the properties of additional objects. node.js/javascript util. + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i extend-shallow --save +``` + +## Usage + +```js +var extend = require('extend-shallow'); + +extend({a: 'b'}, {c: 'd'}) +//=> {a: 'b', c: 'd'} +``` + +Pass an empty object to shallow clone: + +```js +var obj = {}; +extend(obj, {a: 'b'}, {c: 'd'}) +//=> {a: 'b', c: 'd'} +``` + +## Related + +* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. +* [for-own](https://github.com/jonschlinkert/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) +* [for-in](https://github.com/jonschlinkert/for-in): Iterate over the own and inherited enumerable properties of an objecte, and return an object… [more](https://github.com/jonschlinkert/for-in) +* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor. +* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null. +* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value. + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 29, 2015._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/index.js b/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/index.js new file mode 100644 index 000000000..92a067fcc --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/index.js @@ -0,0 +1,33 @@ +'use strict'; + +var isObject = require('is-extendable'); + +module.exports = function extend(o/*, objects*/) { + if (!isObject(o)) { o = {}; } + + var len = arguments.length; + for (var i = 1; i < len; i++) { + var obj = arguments[i]; + + if (isObject(obj)) { + assign(o, obj); + } + } + return o; +}; + +function assign(a, b) { + for (var key in b) { + if (hasOwn(b, key)) { + a[key] = b[key]; + } + } +} + +/** + * Returns true if the given `key` is an own property of `obj`. + */ + +function hasOwn(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/package.json b/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/package.json new file mode 100644 index 000000000..357b559c2 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/package.json @@ -0,0 +1,87 @@ +{ + "_from": "extend-shallow@^2.0.1", + "_id": "extend-shallow@2.0.1", + "_inBundle": false, + "_integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "_location": "/readdirp/expand-brackets/extend-shallow", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "extend-shallow@^2.0.1", + "name": "extend-shallow", + "escapedName": "extend-shallow", + "rawSpec": "^2.0.1", + "saveSpec": null, + "fetchSpec": "^2.0.1" + }, + "_requiredBy": [ + "/readdirp/expand-brackets" + ], + "_resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "_shasum": "51af7d614ad9a9f610ea1bafbb989d6b1c56890f", + "_spec": "extend-shallow@^2.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/expand-brackets", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/extend-shallow/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "deprecated": false, + "description": "Extend an object with the properties of additional objects. node.js/javascript util.", + "devDependencies": { + "array-slice": "^0.2.3", + "benchmarked": "^0.1.4", + "chalk": "^1.0.0", + "for-own": "^0.1.3", + "glob": "^5.0.12", + "is-plain-object": "^2.0.1", + "kind-of": "^2.0.0", + "minimist": "^1.1.1", + "mocha": "^2.2.5", + "should": "^7.0.1" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/extend-shallow", + "keywords": [ + "assign", + "extend", + "javascript", + "js", + "keys", + "merge", + "obj", + "object", + "prop", + "properties", + "property", + "props", + "shallow", + "util", + "utility", + "utils", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "extend-shallow", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/extend-shallow.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "2.0.1" +} diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/LICENSE b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/LICENSE new file mode 100644 index 000000000..65f90aca8 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/README.md b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/README.md new file mode 100644 index 000000000..3743fe6bc --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/README.md @@ -0,0 +1,123 @@ +# is-accessor-descriptor [![NPM version](https://img.shields.io/npm/v/is-accessor-descriptor.svg)](https://www.npmjs.com/package/is-accessor-descriptor) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-accessor-descriptor.svg)](https://travis-ci.org/jonschlinkert/is-accessor-descriptor) + +> Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. + +- [Install](#install) +- [Usage](#usage) +- [Examples](#examples) +- [API](#api) +- [Related projects](#related-projects) +- [Running tests](#running-tests) +- [Contributing](#contributing) +- [Author](#author) +- [License](#license) + +_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm i is-accessor-descriptor --save +``` + +## Usage + +```js +var isAccessor = require('is-accessor-descriptor'); + +isAccessor({get: function() {}}); +//=> true +``` + +You may also pass an object and property name to check if the property is an accessor: + +```js +isAccessor(foo, 'bar'); +``` + +## Examples + +`false` when not an object + +```js +isAccessor('a') +isAccessor(null) +isAccessor([]) +//=> false +``` + +`true` when the object has valid properties + +and the properties all have the correct JavaScript types: + +```js +isAccessor({get: noop, set: noop}) +isAccessor({get: noop}) +isAccessor({set: noop}) +//=> true +``` + +`false` when the object has invalid properties + +```js +isAccessor({get: noop, set: noop, bar: 'baz'}) +isAccessor({get: noop, writable: true}) +isAccessor({get: noop, value: true}) +//=> false +``` + +`false` when an accessor is not a function + +```js +isAccessor({get: noop, set: 'baz'}) +isAccessor({get: 'foo', set: noop}) +isAccessor({get: 'foo', bar: 'baz'}) +isAccessor({get: 'foo', set: 'baz'}) +//=> false +``` + +`false` when a value is not the correct type + +```js +isAccessor({get: noop, set: noop, enumerable: 'foo'}) +isAccessor({set: noop, configurable: 'foo'}) +isAccessor({get: noop, configurable: 'foo'}) +//=> false +``` + +## Related projects + +* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor) +* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor) +* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://www.npmjs.com/package/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor) +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject) + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-accessor-descriptor/issues/new). + +## Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert) +Released under the MIT license. + +*** + +_This file was generated by [verb](https://github.com/verbose/verb) on December 28, 2015._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/index.js b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/index.js new file mode 100644 index 000000000..2ca4af8bd --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/index.js @@ -0,0 +1,69 @@ +/*! + * is-accessor-descriptor + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var typeOf = require('kind-of'); + +// accessor descriptor properties +var accessor = { + get: 'function', + set: 'function', + configurable: 'boolean', + enumerable: 'boolean' +}; + +function isAccessorDescriptor(obj, prop) { + if (typeof prop === 'string') { + var val = Object.getOwnPropertyDescriptor(obj, prop); + return typeof val !== 'undefined'; + } + + if (typeOf(obj) !== 'object') { + return false; + } + + if (has(obj, 'value') || has(obj, 'writable')) { + return false; + } + + if (!has(obj, 'get') || typeof obj.get !== 'function') { + return false; + } + + // tldr: it's valid to have "set" be undefined + // "set" might be undefined if `Object.getOwnPropertyDescriptor` + // was used to get the value, and only `get` was defined by the user + if (has(obj, 'set') && typeof obj[key] !== 'function' && typeof obj[key] !== 'undefined') { + return false; + } + + for (var key in obj) { + if (!accessor.hasOwnProperty(key)) { + continue; + } + + if (typeOf(obj[key]) === accessor[key]) { + continue; + } + + if (typeof obj[key] !== 'undefined') { + return false; + } + } + return true; +} + +function has(obj, key) { + return {}.hasOwnProperty.call(obj, key); +} + +/** + * Expose `isAccessorDescriptor` + */ + +module.exports = isAccessorDescriptor; diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/LICENSE b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/LICENSE new file mode 100644 index 000000000..d734237bd --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/README.md b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/README.md new file mode 100644 index 000000000..6a9df36d3 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/README.md @@ -0,0 +1,261 @@ +# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) + +> Get the native type of a value. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save kind-of +``` + +## Install + +Install with [bower](https://bower.io/) + +```sh +$ bower install kind-of --save +``` + +## Usage + +> es5, browser and es6 ready + +```js +var kindOf = require('kind-of'); + +kindOf(undefined); +//=> 'undefined' + +kindOf(null); +//=> 'null' + +kindOf(true); +//=> 'boolean' + +kindOf(false); +//=> 'boolean' + +kindOf(new Boolean(true)); +//=> 'boolean' + +kindOf(new Buffer('')); +//=> 'buffer' + +kindOf(42); +//=> 'number' + +kindOf(new Number(42)); +//=> 'number' + +kindOf('str'); +//=> 'string' + +kindOf(new String('str')); +//=> 'string' + +kindOf(arguments); +//=> 'arguments' + +kindOf({}); +//=> 'object' + +kindOf(Object.create(null)); +//=> 'object' + +kindOf(new Test()); +//=> 'object' + +kindOf(new Date()); +//=> 'date' + +kindOf([]); +//=> 'array' + +kindOf([1, 2, 3]); +//=> 'array' + +kindOf(new Array()); +//=> 'array' + +kindOf(/foo/); +//=> 'regexp' + +kindOf(new RegExp('foo')); +//=> 'regexp' + +kindOf(function () {}); +//=> 'function' + +kindOf(function * () {}); +//=> 'function' + +kindOf(new Function()); +//=> 'function' + +kindOf(new Map()); +//=> 'map' + +kindOf(new WeakMap()); +//=> 'weakmap' + +kindOf(new Set()); +//=> 'set' + +kindOf(new WeakSet()); +//=> 'weakset' + +kindOf(Symbol('str')); +//=> 'symbol' + +kindOf(new Int8Array()); +//=> 'int8array' + +kindOf(new Uint8Array()); +//=> 'uint8array' + +kindOf(new Uint8ClampedArray()); +//=> 'uint8clampedarray' + +kindOf(new Int16Array()); +//=> 'int16array' + +kindOf(new Uint16Array()); +//=> 'uint16array' + +kindOf(new Int32Array()); +//=> 'int32array' + +kindOf(new Uint32Array()); +//=> 'uint32array' + +kindOf(new Float32Array()); +//=> 'float32array' + +kindOf(new Float64Array()); +//=> 'float64array' +``` + +## Benchmarks + +Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). +Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `WeakSet`. + +```bash +#1: array + current x 23,329,397 ops/sec ±0.82% (94 runs sampled) + lib-type-of x 4,170,273 ops/sec ±0.55% (94 runs sampled) + lib-typeof x 9,686,935 ops/sec ±0.59% (98 runs sampled) + +#2: boolean + current x 27,197,115 ops/sec ±0.85% (94 runs sampled) + lib-type-of x 3,145,791 ops/sec ±0.73% (97 runs sampled) + lib-typeof x 9,199,562 ops/sec ±0.44% (99 runs sampled) + +#3: date + current x 20,190,117 ops/sec ±0.86% (92 runs sampled) + lib-type-of x 5,166,970 ops/sec ±0.74% (94 runs sampled) + lib-typeof x 9,610,821 ops/sec ±0.50% (96 runs sampled) + +#4: function + current x 23,855,460 ops/sec ±0.60% (97 runs sampled) + lib-type-of x 5,667,740 ops/sec ±0.54% (100 runs sampled) + lib-typeof x 10,010,644 ops/sec ±0.44% (100 runs sampled) + +#5: null + current x 27,061,047 ops/sec ±0.97% (96 runs sampled) + lib-type-of x 13,965,573 ops/sec ±0.62% (97 runs sampled) + lib-typeof x 8,460,194 ops/sec ±0.61% (97 runs sampled) + +#6: number + current x 25,075,682 ops/sec ±0.53% (99 runs sampled) + lib-type-of x 2,266,405 ops/sec ±0.41% (98 runs sampled) + lib-typeof x 9,821,481 ops/sec ±0.45% (99 runs sampled) + +#7: object + current x 3,348,980 ops/sec ±0.49% (99 runs sampled) + lib-type-of x 3,245,138 ops/sec ±0.60% (94 runs sampled) + lib-typeof x 9,262,952 ops/sec ±0.59% (99 runs sampled) + +#8: regex + current x 21,284,827 ops/sec ±0.72% (96 runs sampled) + lib-type-of x 4,689,241 ops/sec ±0.43% (100 runs sampled) + lib-typeof x 8,957,593 ops/sec ±0.62% (98 runs sampled) + +#9: string + current x 25,379,234 ops/sec ±0.58% (96 runs sampled) + lib-type-of x 3,635,148 ops/sec ±0.76% (93 runs sampled) + lib-typeof x 9,494,134 ops/sec ±0.49% (98 runs sampled) + +#10: undef + current x 27,459,221 ops/sec ±1.01% (93 runs sampled) + lib-type-of x 14,360,433 ops/sec ±0.52% (99 runs sampled) + lib-typeof x 23,202,868 ops/sec ±0.59% (94 runs sampled) + +``` + +## Optimizations + +In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: + +1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. +2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. +3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` + +## About + +### Related projects + +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 59 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [miguelmota](https://github.com/miguelmota) | +| 1 | [dtothefp](https://github.com/dtothefp) | +| 1 | [ksheedlo](https://github.com/ksheedlo) | +| 1 | [pdehaan](https://github.com/pdehaan) | +| 1 | [laggingreflex](https://github.com/laggingreflex) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 16, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/index.js b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/index.js new file mode 100644 index 000000000..b52c2917f --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/index.js @@ -0,0 +1,116 @@ +var isBuffer = require('is-buffer'); +var toString = Object.prototype.toString; + +/** + * Get the native `typeof` a value. + * + * @param {*} `val` + * @return {*} Native javascript type + */ + +module.exports = function kindOf(val) { + // primitivies + if (typeof val === 'undefined') { + return 'undefined'; + } + if (val === null) { + return 'null'; + } + if (val === true || val === false || val instanceof Boolean) { + return 'boolean'; + } + if (typeof val === 'string' || val instanceof String) { + return 'string'; + } + if (typeof val === 'number' || val instanceof Number) { + return 'number'; + } + + // functions + if (typeof val === 'function' || val instanceof Function) { + return 'function'; + } + + // array + if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { + return 'array'; + } + + // check for instances of RegExp and Date before calling `toString` + if (val instanceof RegExp) { + return 'regexp'; + } + if (val instanceof Date) { + return 'date'; + } + + // other objects + var type = toString.call(val); + + if (type === '[object RegExp]') { + return 'regexp'; + } + if (type === '[object Date]') { + return 'date'; + } + if (type === '[object Arguments]') { + return 'arguments'; + } + if (type === '[object Error]') { + return 'error'; + } + + // buffer + if (isBuffer(val)) { + return 'buffer'; + } + + // es6: Map, WeakMap, Set, WeakSet + if (type === '[object Set]') { + return 'set'; + } + if (type === '[object WeakSet]') { + return 'weakset'; + } + if (type === '[object Map]') { + return 'map'; + } + if (type === '[object WeakMap]') { + return 'weakmap'; + } + if (type === '[object Symbol]') { + return 'symbol'; + } + + // typed arrays + if (type === '[object Int8Array]') { + return 'int8array'; + } + if (type === '[object Uint8Array]') { + return 'uint8array'; + } + if (type === '[object Uint8ClampedArray]') { + return 'uint8clampedarray'; + } + if (type === '[object Int16Array]') { + return 'int16array'; + } + if (type === '[object Uint16Array]') { + return 'uint16array'; + } + if (type === '[object Int32Array]') { + return 'int32array'; + } + if (type === '[object Uint32Array]') { + return 'uint32array'; + } + if (type === '[object Float32Array]') { + return 'float32array'; + } + if (type === '[object Float64Array]') { + return 'float64array'; + } + + // must be a plain object + return 'object'; +}; diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/package.json b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/package.json new file mode 100644 index 000000000..5a2dad55f --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/package.json @@ -0,0 +1,139 @@ +{ + "_from": "kind-of@^3.0.2", + "_id": "kind-of@3.2.2", + "_inBundle": false, + "_integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "_location": "/readdirp/expand-brackets/is-accessor-descriptor/kind-of", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "kind-of@^3.0.2", + "name": "kind-of", + "escapedName": "kind-of", + "rawSpec": "^3.0.2", + "saveSpec": null, + "fetchSpec": "^3.0.2" + }, + "_requiredBy": [ + "/readdirp/expand-brackets/is-accessor-descriptor" + ], + "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "_shasum": "31ea21a734bab9bbb0f32466d893aea51e4a3c64", + "_spec": "kind-of@^3.0.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/kind-of/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "David Fox-Powell", + "url": "https://dtothefp.github.io/me" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Ken Sheedlo", + "url": "kensheedlo.com" + }, + { + "name": "laggingreflex", + "url": "https://github.com/laggingreflex" + }, + { + "name": "Miguel Mota", + "url": "https://miguelmota.com" + }, + { + "name": "Peter deHaan", + "url": "http://about.me/peterdehaan" + } + ], + "dependencies": { + "is-buffer": "^1.1.5" + }, + "deprecated": false, + "description": "Get the native type of a value.", + "devDependencies": { + "ansi-bold": "^0.1.1", + "benchmarked": "^1.0.0", + "browserify": "^14.3.0", + "glob": "^7.1.1", + "gulp-format-md": "^0.1.12", + "mocha": "^3.3.0", + "type-of": "^2.0.1", + "typeof": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/kind-of", + "keywords": [ + "arguments", + "array", + "boolean", + "check", + "date", + "function", + "is", + "is-type", + "is-type-of", + "kind", + "kind-of", + "number", + "object", + "of", + "regexp", + "string", + "test", + "type", + "type-of", + "typeof", + "types" + ], + "license": "MIT", + "main": "index.js", + "name": "kind-of", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/kind-of.git" + }, + "scripts": { + "prepublish": "browserify -o browser.js -e index.js -s index --bare", + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "is-glob", + "is-number", + "is-primitive" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb" + ] + }, + "version": "3.2.2" +} diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/package.json b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/package.json new file mode 100644 index 000000000..081de213c --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/package.json @@ -0,0 +1,94 @@ +{ + "_from": "is-accessor-descriptor@^0.1.6", + "_id": "is-accessor-descriptor@0.1.6", + "_inBundle": false, + "_integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "_location": "/readdirp/expand-brackets/is-accessor-descriptor", + "_phantomChildren": { + "is-buffer": "1.1.6" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-accessor-descriptor@^0.1.6", + "name": "is-accessor-descriptor", + "escapedName": "is-accessor-descriptor", + "rawSpec": "^0.1.6", + "saveSpec": null, + "fetchSpec": "^0.1.6" + }, + "_requiredBy": [ + "/readdirp/expand-brackets/is-descriptor" + ], + "_resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "_shasum": "a9e12cb3ae8d876727eeef3843f8a0897b5c98d6", + "_spec": "is-accessor-descriptor@^0.1.6", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-accessor-descriptor/issues" + }, + "bundleDependencies": false, + "dependencies": { + "kind-of": "^3.0.2" + }, + "deprecated": false, + "description": "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.", + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-accessor-descriptor", + "keywords": [ + "accessor", + "check", + "data", + "descriptor", + "get", + "getter", + "is", + "keys", + "object", + "properties", + "property", + "set", + "setter", + "type", + "valid", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "is-accessor-descriptor", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-accessor-descriptor.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "is-accessor-descriptor", + "is-data-descriptor", + "is-descriptor", + "isobject" + ] + }, + "plugins": [ + "gulp-format-md" + ], + "layout": "default" + }, + "version": "0.1.6" +} diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/LICENSE b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/LICENSE new file mode 100644 index 000000000..65f90aca8 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/README.md b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/README.md new file mode 100644 index 000000000..41e1643f1 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/README.md @@ -0,0 +1,128 @@ +# is-data-descriptor [![NPM version](https://img.shields.io/npm/v/is-data-descriptor.svg)](https://www.npmjs.com/package/is-data-descriptor) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-data-descriptor.svg)](https://travis-ci.org/jonschlinkert/is-data-descriptor) + +> Returns true if a value has the characteristics of a valid JavaScript data descriptor. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm i is-data-descriptor --save +``` + +## Usage + +```js +var isDataDesc = require('is-data-descriptor'); +``` + +## Examples + +`true` when the descriptor has valid properties with valid values. + +```js +// `value` can be anything +isDataDesc({value: 'foo'}) +isDataDesc({value: function() {}}) +isDataDesc({value: true}) +//=> true +``` + +`false` when not an object + +```js +isDataDesc('a') +//=> false +isDataDesc(null) +//=> false +isDataDesc([]) +//=> false +``` + +`false` when the object has invalid properties + +```js +isDataDesc({value: 'foo', bar: 'baz'}) +//=> false +isDataDesc({value: 'foo', bar: 'baz'}) +//=> false +isDataDesc({value: 'foo', get: function(){}}) +//=> false +isDataDesc({get: function(){}, value: 'foo'}) +//=> false +``` + +`false` when a value is not the correct type + +```js +isDataDesc({value: 'foo', enumerable: 'foo'}) +//=> false +isDataDesc({value: 'foo', configurable: 'foo'}) +//=> false +isDataDesc({value: 'foo', writable: 'foo'}) +//=> false +``` + +## Valid properties + +The only valid data descriptor properties are the following: + +* `configurable` (required) +* `enumerable` (required) +* `value` (optional) +* `writable` (optional) + +To be a valid data descriptor, either `value` or `writable` must be defined. + +**Invalid properties** + +A descriptor may have additional _invalid_ properties (an error will **not** be thrown). + +```js +var foo = {}; + +Object.defineProperty(foo, 'bar', { + enumerable: true, + whatever: 'blah', // invalid, but doesn't cause an error + get: function() { + return 'baz'; + } +}); + +console.log(foo.bar); +//=> 'baz' +``` + +## Related projects + +* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor) +* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://www.npmjs.com/package/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor) +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject) + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-data-descriptor/issues/new). + +## Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert) +Released under the MIT license. + +*** + +_This file was generated by [verb](https://github.com/verbose/verb) on December 28, 2015._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/index.js b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/index.js new file mode 100644 index 000000000..d4d09c92a --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/index.js @@ -0,0 +1,55 @@ +/*! + * is-data-descriptor + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var typeOf = require('kind-of'); + +// data descriptor properties +var data = { + configurable: 'boolean', + enumerable: 'boolean', + writable: 'boolean' +}; + +function isDataDescriptor(obj, prop) { + if (typeOf(obj) !== 'object') { + return false; + } + + if (typeof prop === 'string') { + var val = Object.getOwnPropertyDescriptor(obj, prop); + return typeof val !== 'undefined'; + } + + if (!('value' in obj) && !('writable' in obj)) { + return false; + } + + for (var key in obj) { + if (key === 'value') continue; + + if (!data.hasOwnProperty(key)) { + continue; + } + + if (typeOf(obj[key]) === data[key]) { + continue; + } + + if (typeof obj[key] !== 'undefined') { + return false; + } + } + return true; +} + +/** + * Expose `isDataDescriptor` + */ + +module.exports = isDataDescriptor; diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/LICENSE b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/LICENSE new file mode 100644 index 000000000..d734237bd --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/README.md b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/README.md new file mode 100644 index 000000000..6a9df36d3 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/README.md @@ -0,0 +1,261 @@ +# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) + +> Get the native type of a value. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save kind-of +``` + +## Install + +Install with [bower](https://bower.io/) + +```sh +$ bower install kind-of --save +``` + +## Usage + +> es5, browser and es6 ready + +```js +var kindOf = require('kind-of'); + +kindOf(undefined); +//=> 'undefined' + +kindOf(null); +//=> 'null' + +kindOf(true); +//=> 'boolean' + +kindOf(false); +//=> 'boolean' + +kindOf(new Boolean(true)); +//=> 'boolean' + +kindOf(new Buffer('')); +//=> 'buffer' + +kindOf(42); +//=> 'number' + +kindOf(new Number(42)); +//=> 'number' + +kindOf('str'); +//=> 'string' + +kindOf(new String('str')); +//=> 'string' + +kindOf(arguments); +//=> 'arguments' + +kindOf({}); +//=> 'object' + +kindOf(Object.create(null)); +//=> 'object' + +kindOf(new Test()); +//=> 'object' + +kindOf(new Date()); +//=> 'date' + +kindOf([]); +//=> 'array' + +kindOf([1, 2, 3]); +//=> 'array' + +kindOf(new Array()); +//=> 'array' + +kindOf(/foo/); +//=> 'regexp' + +kindOf(new RegExp('foo')); +//=> 'regexp' + +kindOf(function () {}); +//=> 'function' + +kindOf(function * () {}); +//=> 'function' + +kindOf(new Function()); +//=> 'function' + +kindOf(new Map()); +//=> 'map' + +kindOf(new WeakMap()); +//=> 'weakmap' + +kindOf(new Set()); +//=> 'set' + +kindOf(new WeakSet()); +//=> 'weakset' + +kindOf(Symbol('str')); +//=> 'symbol' + +kindOf(new Int8Array()); +//=> 'int8array' + +kindOf(new Uint8Array()); +//=> 'uint8array' + +kindOf(new Uint8ClampedArray()); +//=> 'uint8clampedarray' + +kindOf(new Int16Array()); +//=> 'int16array' + +kindOf(new Uint16Array()); +//=> 'uint16array' + +kindOf(new Int32Array()); +//=> 'int32array' + +kindOf(new Uint32Array()); +//=> 'uint32array' + +kindOf(new Float32Array()); +//=> 'float32array' + +kindOf(new Float64Array()); +//=> 'float64array' +``` + +## Benchmarks + +Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). +Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `WeakSet`. + +```bash +#1: array + current x 23,329,397 ops/sec ±0.82% (94 runs sampled) + lib-type-of x 4,170,273 ops/sec ±0.55% (94 runs sampled) + lib-typeof x 9,686,935 ops/sec ±0.59% (98 runs sampled) + +#2: boolean + current x 27,197,115 ops/sec ±0.85% (94 runs sampled) + lib-type-of x 3,145,791 ops/sec ±0.73% (97 runs sampled) + lib-typeof x 9,199,562 ops/sec ±0.44% (99 runs sampled) + +#3: date + current x 20,190,117 ops/sec ±0.86% (92 runs sampled) + lib-type-of x 5,166,970 ops/sec ±0.74% (94 runs sampled) + lib-typeof x 9,610,821 ops/sec ±0.50% (96 runs sampled) + +#4: function + current x 23,855,460 ops/sec ±0.60% (97 runs sampled) + lib-type-of x 5,667,740 ops/sec ±0.54% (100 runs sampled) + lib-typeof x 10,010,644 ops/sec ±0.44% (100 runs sampled) + +#5: null + current x 27,061,047 ops/sec ±0.97% (96 runs sampled) + lib-type-of x 13,965,573 ops/sec ±0.62% (97 runs sampled) + lib-typeof x 8,460,194 ops/sec ±0.61% (97 runs sampled) + +#6: number + current x 25,075,682 ops/sec ±0.53% (99 runs sampled) + lib-type-of x 2,266,405 ops/sec ±0.41% (98 runs sampled) + lib-typeof x 9,821,481 ops/sec ±0.45% (99 runs sampled) + +#7: object + current x 3,348,980 ops/sec ±0.49% (99 runs sampled) + lib-type-of x 3,245,138 ops/sec ±0.60% (94 runs sampled) + lib-typeof x 9,262,952 ops/sec ±0.59% (99 runs sampled) + +#8: regex + current x 21,284,827 ops/sec ±0.72% (96 runs sampled) + lib-type-of x 4,689,241 ops/sec ±0.43% (100 runs sampled) + lib-typeof x 8,957,593 ops/sec ±0.62% (98 runs sampled) + +#9: string + current x 25,379,234 ops/sec ±0.58% (96 runs sampled) + lib-type-of x 3,635,148 ops/sec ±0.76% (93 runs sampled) + lib-typeof x 9,494,134 ops/sec ±0.49% (98 runs sampled) + +#10: undef + current x 27,459,221 ops/sec ±1.01% (93 runs sampled) + lib-type-of x 14,360,433 ops/sec ±0.52% (99 runs sampled) + lib-typeof x 23,202,868 ops/sec ±0.59% (94 runs sampled) + +``` + +## Optimizations + +In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: + +1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. +2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. +3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` + +## About + +### Related projects + +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 59 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [miguelmota](https://github.com/miguelmota) | +| 1 | [dtothefp](https://github.com/dtothefp) | +| 1 | [ksheedlo](https://github.com/ksheedlo) | +| 1 | [pdehaan](https://github.com/pdehaan) | +| 1 | [laggingreflex](https://github.com/laggingreflex) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 16, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/index.js b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/index.js new file mode 100644 index 000000000..b52c2917f --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/index.js @@ -0,0 +1,116 @@ +var isBuffer = require('is-buffer'); +var toString = Object.prototype.toString; + +/** + * Get the native `typeof` a value. + * + * @param {*} `val` + * @return {*} Native javascript type + */ + +module.exports = function kindOf(val) { + // primitivies + if (typeof val === 'undefined') { + return 'undefined'; + } + if (val === null) { + return 'null'; + } + if (val === true || val === false || val instanceof Boolean) { + return 'boolean'; + } + if (typeof val === 'string' || val instanceof String) { + return 'string'; + } + if (typeof val === 'number' || val instanceof Number) { + return 'number'; + } + + // functions + if (typeof val === 'function' || val instanceof Function) { + return 'function'; + } + + // array + if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { + return 'array'; + } + + // check for instances of RegExp and Date before calling `toString` + if (val instanceof RegExp) { + return 'regexp'; + } + if (val instanceof Date) { + return 'date'; + } + + // other objects + var type = toString.call(val); + + if (type === '[object RegExp]') { + return 'regexp'; + } + if (type === '[object Date]') { + return 'date'; + } + if (type === '[object Arguments]') { + return 'arguments'; + } + if (type === '[object Error]') { + return 'error'; + } + + // buffer + if (isBuffer(val)) { + return 'buffer'; + } + + // es6: Map, WeakMap, Set, WeakSet + if (type === '[object Set]') { + return 'set'; + } + if (type === '[object WeakSet]') { + return 'weakset'; + } + if (type === '[object Map]') { + return 'map'; + } + if (type === '[object WeakMap]') { + return 'weakmap'; + } + if (type === '[object Symbol]') { + return 'symbol'; + } + + // typed arrays + if (type === '[object Int8Array]') { + return 'int8array'; + } + if (type === '[object Uint8Array]') { + return 'uint8array'; + } + if (type === '[object Uint8ClampedArray]') { + return 'uint8clampedarray'; + } + if (type === '[object Int16Array]') { + return 'int16array'; + } + if (type === '[object Uint16Array]') { + return 'uint16array'; + } + if (type === '[object Int32Array]') { + return 'int32array'; + } + if (type === '[object Uint32Array]') { + return 'uint32array'; + } + if (type === '[object Float32Array]') { + return 'float32array'; + } + if (type === '[object Float64Array]') { + return 'float64array'; + } + + // must be a plain object + return 'object'; +}; diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/package.json b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/package.json new file mode 100644 index 000000000..629822e91 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/package.json @@ -0,0 +1,139 @@ +{ + "_from": "kind-of@^3.0.2", + "_id": "kind-of@3.2.2", + "_inBundle": false, + "_integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "_location": "/readdirp/expand-brackets/is-data-descriptor/kind-of", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "kind-of@^3.0.2", + "name": "kind-of", + "escapedName": "kind-of", + "rawSpec": "^3.0.2", + "saveSpec": null, + "fetchSpec": "^3.0.2" + }, + "_requiredBy": [ + "/readdirp/expand-brackets/is-data-descriptor" + ], + "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "_shasum": "31ea21a734bab9bbb0f32466d893aea51e4a3c64", + "_spec": "kind-of@^3.0.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/kind-of/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "David Fox-Powell", + "url": "https://dtothefp.github.io/me" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Ken Sheedlo", + "url": "kensheedlo.com" + }, + { + "name": "laggingreflex", + "url": "https://github.com/laggingreflex" + }, + { + "name": "Miguel Mota", + "url": "https://miguelmota.com" + }, + { + "name": "Peter deHaan", + "url": "http://about.me/peterdehaan" + } + ], + "dependencies": { + "is-buffer": "^1.1.5" + }, + "deprecated": false, + "description": "Get the native type of a value.", + "devDependencies": { + "ansi-bold": "^0.1.1", + "benchmarked": "^1.0.0", + "browserify": "^14.3.0", + "glob": "^7.1.1", + "gulp-format-md": "^0.1.12", + "mocha": "^3.3.0", + "type-of": "^2.0.1", + "typeof": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/kind-of", + "keywords": [ + "arguments", + "array", + "boolean", + "check", + "date", + "function", + "is", + "is-type", + "is-type-of", + "kind", + "kind-of", + "number", + "object", + "of", + "regexp", + "string", + "test", + "type", + "type-of", + "typeof", + "types" + ], + "license": "MIT", + "main": "index.js", + "name": "kind-of", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/kind-of.git" + }, + "scripts": { + "prepublish": "browserify -o browser.js -e index.js -s index --bare", + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "is-glob", + "is-number", + "is-primitive" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb" + ] + }, + "version": "3.2.2" +} diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/package.json b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/package.json new file mode 100644 index 000000000..30fcaa6b2 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/package.json @@ -0,0 +1,93 @@ +{ + "_from": "is-data-descriptor@^0.1.4", + "_id": "is-data-descriptor@0.1.4", + "_inBundle": false, + "_integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "_location": "/readdirp/expand-brackets/is-data-descriptor", + "_phantomChildren": { + "is-buffer": "1.1.6" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-data-descriptor@^0.1.4", + "name": "is-data-descriptor", + "escapedName": "is-data-descriptor", + "rawSpec": "^0.1.4", + "saveSpec": null, + "fetchSpec": "^0.1.4" + }, + "_requiredBy": [ + "/readdirp/expand-brackets/is-descriptor" + ], + "_resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "_shasum": "0b5ee648388e2c860282e793f1856fec3f301b56", + "_spec": "is-data-descriptor@^0.1.4", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-data-descriptor/issues" + }, + "bundleDependencies": false, + "dependencies": { + "kind-of": "^3.0.2" + }, + "deprecated": false, + "description": "Returns true if a value has the characteristics of a valid JavaScript data descriptor.", + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-data-descriptor", + "keywords": [ + "accessor", + "check", + "data", + "descriptor", + "get", + "getter", + "is", + "keys", + "object", + "properties", + "property", + "set", + "setter", + "type", + "valid", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "is-data-descriptor", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-data-descriptor.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "is-accessor-descriptor", + "is-data-descriptor", + "is-descriptor", + "isobject" + ] + }, + "plugins": [ + "gulp-format-md" + ] + }, + "version": "0.1.4" +} diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/LICENSE b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/LICENSE new file mode 100644 index 000000000..c0d7f1362 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert. + +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. \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/README.md b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/README.md new file mode 100644 index 000000000..658e53301 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/README.md @@ -0,0 +1,193 @@ +# is-descriptor [![NPM version](https://img.shields.io/npm/v/is-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-descriptor) + +> Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-descriptor +``` + +## Usage + +```js +var isDescriptor = require('is-descriptor'); + +isDescriptor({value: 'foo'}) +//=> true +isDescriptor({get: function(){}, set: function(){}}) +//=> true +isDescriptor({get: 'foo', set: function(){}}) +//=> false +``` + +You may also check for a descriptor by passing an object as the first argument and property name (`string`) as the second argument. + +```js +var obj = {}; +obj.foo = 'abc'; + +Object.defineProperty(obj, 'bar', { + value: 'xyz' +}); + +isDescriptor(obj, 'foo'); +//=> true +isDescriptor(obj, 'bar'); +//=> true +``` + +## Examples + +### value type + +`false` when not an object + +```js +isDescriptor('a'); +//=> false +isDescriptor(null); +//=> false +isDescriptor([]); +//=> false +``` + +### data descriptor + +`true` when the object has valid properties with valid values. + +```js +isDescriptor({value: 'foo'}); +//=> true +isDescriptor({value: noop}); +//=> true +``` + +`false` when the object has invalid properties + +```js +isDescriptor({value: 'foo', bar: 'baz'}); +//=> false +isDescriptor({value: 'foo', bar: 'baz'}); +//=> false +isDescriptor({value: 'foo', get: noop}); +//=> false +isDescriptor({get: noop, value: noop}); +//=> false +``` + +`false` when a value is not the correct type + +```js +isDescriptor({value: 'foo', enumerable: 'foo'}); +//=> false +isDescriptor({value: 'foo', configurable: 'foo'}); +//=> false +isDescriptor({value: 'foo', writable: 'foo'}); +//=> false +``` + +### accessor descriptor + +`true` when the object has valid properties with valid values. + +```js +isDescriptor({get: noop, set: noop}); +//=> true +isDescriptor({get: noop}); +//=> true +isDescriptor({set: noop}); +//=> true +``` + +`false` when the object has invalid properties + +```js +isDescriptor({get: noop, set: noop, bar: 'baz'}); +//=> false +isDescriptor({get: noop, writable: true}); +//=> false +isDescriptor({get: noop, value: true}); +//=> false +``` + +`false` when an accessor is not a function + +```js +isDescriptor({get: noop, set: 'baz'}); +//=> false +isDescriptor({get: 'foo', set: noop}); +//=> false +isDescriptor({get: 'foo', bar: 'baz'}); +//=> false +isDescriptor({get: 'foo', set: 'baz'}); +//=> false +``` + +`false` when a value is not the correct type + +```js +isDescriptor({get: noop, set: noop, enumerable: 'foo'}); +//=> false +isDescriptor({set: noop, configurable: 'foo'}); +//=> false +isDescriptor({get: noop, configurable: 'foo'}); +//=> false +``` + +## About + +### Related projects + +* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.") +* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.") +* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 24 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [doowb](https://github.com/doowb) | +| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 22, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/index.js b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/index.js new file mode 100644 index 000000000..c9b91d762 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/index.js @@ -0,0 +1,22 @@ +/*! + * is-descriptor + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var typeOf = require('kind-of'); +var isAccessor = require('is-accessor-descriptor'); +var isData = require('is-data-descriptor'); + +module.exports = function isDescriptor(obj, key) { + if (typeOf(obj) !== 'object') { + return false; + } + if ('get' in obj) { + return isAccessor(obj, key); + } + return isData(obj, key); +}; diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/package.json b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/package.json new file mode 100644 index 000000000..4c90fd896 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/package.json @@ -0,0 +1,114 @@ +{ + "_from": "is-descriptor@^0.1.0", + "_id": "is-descriptor@0.1.6", + "_inBundle": false, + "_integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "_location": "/readdirp/expand-brackets/is-descriptor", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-descriptor@^0.1.0", + "name": "is-descriptor", + "escapedName": "is-descriptor", + "rawSpec": "^0.1.0", + "saveSpec": null, + "fetchSpec": "^0.1.0" + }, + "_requiredBy": [ + "/readdirp/expand-brackets/define-property" + ], + "_resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "_shasum": "366d8240dde487ca51823b1ab9f07a10a78251ca", + "_spec": "is-descriptor@^0.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-descriptor/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "url": "https://github.com/wtgtybhertgeghgtwtg" + } + ], + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "deprecated": false, + "description": "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.4.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-descriptor", + "keywords": [ + "accessor", + "check", + "data", + "descriptor", + "get", + "getter", + "is", + "keys", + "object", + "properties", + "property", + "set", + "setter", + "type", + "valid", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "is-descriptor", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-descriptor.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "is-accessor-descriptor", + "is-data-descriptor", + "is-descriptor", + "isobject" + ] + }, + "plugins": [ + "gulp-format-md" + ], + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "lint": { + "reflinks": true + } + }, + "version": "0.1.6" +} diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/LICENSE b/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/LICENSE new file mode 100644 index 000000000..3f2eca18f --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/README.md b/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/README.md new file mode 100644 index 000000000..170bf3049 --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/README.md @@ -0,0 +1,342 @@ +# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) + +> Get the native type of a value. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save kind-of +``` + +Install with [bower](https://bower.io/) + +```sh +$ bower install kind-of --save +``` + +## Why use this? + +1. [it's fast](#benchmarks) | [optimizations](#optimizations) +2. [better type checking](#better-type-checking) + +## Usage + +> es5, browser and es6 ready + +```js +var kindOf = require('kind-of'); + +kindOf(undefined); +//=> 'undefined' + +kindOf(null); +//=> 'null' + +kindOf(true); +//=> 'boolean' + +kindOf(false); +//=> 'boolean' + +kindOf(new Boolean(true)); +//=> 'boolean' + +kindOf(new Buffer('')); +//=> 'buffer' + +kindOf(42); +//=> 'number' + +kindOf(new Number(42)); +//=> 'number' + +kindOf('str'); +//=> 'string' + +kindOf(new String('str')); +//=> 'string' + +kindOf(arguments); +//=> 'arguments' + +kindOf({}); +//=> 'object' + +kindOf(Object.create(null)); +//=> 'object' + +kindOf(new Test()); +//=> 'object' + +kindOf(new Date()); +//=> 'date' + +kindOf([]); +//=> 'array' + +kindOf([1, 2, 3]); +//=> 'array' + +kindOf(new Array()); +//=> 'array' + +kindOf(/foo/); +//=> 'regexp' + +kindOf(new RegExp('foo')); +//=> 'regexp' + +kindOf(function () {}); +//=> 'function' + +kindOf(function * () {}); +//=> 'function' + +kindOf(new Function()); +//=> 'function' + +kindOf(new Map()); +//=> 'map' + +kindOf(new WeakMap()); +//=> 'weakmap' + +kindOf(new Set()); +//=> 'set' + +kindOf(new WeakSet()); +//=> 'weakset' + +kindOf(Symbol('str')); +//=> 'symbol' + +kindOf(new Int8Array()); +//=> 'int8array' + +kindOf(new Uint8Array()); +//=> 'uint8array' + +kindOf(new Uint8ClampedArray()); +//=> 'uint8clampedarray' + +kindOf(new Int16Array()); +//=> 'int16array' + +kindOf(new Uint16Array()); +//=> 'uint16array' + +kindOf(new Int32Array()); +//=> 'int32array' + +kindOf(new Uint32Array()); +//=> 'uint32array' + +kindOf(new Float32Array()); +//=> 'float32array' + +kindOf(new Float64Array()); +//=> 'float64array' +``` + +## Release history + +### v4.0.0 + +**Added** + +* `promise` support + +### v5.0.0 + +**Added** + +* `Set Iterator` and `Map Iterator` support + +**Fixed** + +* Now returns `generatorfunction` for generator functions + +## Benchmarks + +Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). +Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `WeakSet`. + +```bash +#1: array + current x 23,329,397 ops/sec ±0.82% (94 runs sampled) + lib-type-of x 4,170,273 ops/sec ±0.55% (94 runs sampled) + lib-typeof x 9,686,935 ops/sec ±0.59% (98 runs sampled) + +#2: boolean + current x 27,197,115 ops/sec ±0.85% (94 runs sampled) + lib-type-of x 3,145,791 ops/sec ±0.73% (97 runs sampled) + lib-typeof x 9,199,562 ops/sec ±0.44% (99 runs sampled) + +#3: date + current x 20,190,117 ops/sec ±0.86% (92 runs sampled) + lib-type-of x 5,166,970 ops/sec ±0.74% (94 runs sampled) + lib-typeof x 9,610,821 ops/sec ±0.50% (96 runs sampled) + +#4: function + current x 23,855,460 ops/sec ±0.60% (97 runs sampled) + lib-type-of x 5,667,740 ops/sec ±0.54% (100 runs sampled) + lib-typeof x 10,010,644 ops/sec ±0.44% (100 runs sampled) + +#5: null + current x 27,061,047 ops/sec ±0.97% (96 runs sampled) + lib-type-of x 13,965,573 ops/sec ±0.62% (97 runs sampled) + lib-typeof x 8,460,194 ops/sec ±0.61% (97 runs sampled) + +#6: number + current x 25,075,682 ops/sec ±0.53% (99 runs sampled) + lib-type-of x 2,266,405 ops/sec ±0.41% (98 runs sampled) + lib-typeof x 9,821,481 ops/sec ±0.45% (99 runs sampled) + +#7: object + current x 3,348,980 ops/sec ±0.49% (99 runs sampled) + lib-type-of x 3,245,138 ops/sec ±0.60% (94 runs sampled) + lib-typeof x 9,262,952 ops/sec ±0.59% (99 runs sampled) + +#8: regex + current x 21,284,827 ops/sec ±0.72% (96 runs sampled) + lib-type-of x 4,689,241 ops/sec ±0.43% (100 runs sampled) + lib-typeof x 8,957,593 ops/sec ±0.62% (98 runs sampled) + +#9: string + current x 25,379,234 ops/sec ±0.58% (96 runs sampled) + lib-type-of x 3,635,148 ops/sec ±0.76% (93 runs sampled) + lib-typeof x 9,494,134 ops/sec ±0.49% (98 runs sampled) + +#10: undef + current x 27,459,221 ops/sec ±1.01% (93 runs sampled) + lib-type-of x 14,360,433 ops/sec ±0.52% (99 runs sampled) + lib-typeof x 23,202,868 ops/sec ±0.59% (94 runs sampled) + +``` + +## Optimizations + +In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: + +1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. +2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. +3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` +4. There is no reason to make the code in a microlib as terse as possible, just to win points for making it shorter. It's always better to favor performant code over terse code. You will always only be using a single `require()` statement to use the library anyway, regardless of how the code is written. + +## Better type checking + +kind-of is more correct than other type checking libs I've looked at. For example, here are some differing results from other popular libs: + +### [typeof](https://github.com/CodingFu/typeof) lib + +Incorrectly tests instances of custom constructors (pretty common): + +```js +var typeOf = require('typeof'); +function Test() {} +console.log(typeOf(new Test())); +//=> 'test' +``` + +Returns `object` instead of `arguments`: + +```js +function foo() { + console.log(typeOf(arguments)) //=> 'object' +} +foo(); +``` + +### [type-of](https://github.com/ForbesLindesay/type-of) lib + +Incorrectly returns `object` for generator functions, buffers, `Map`, `Set`, `WeakMap` and `WeakSet`: + +```js +function * foo() {} +console.log(typeOf(foo)); +//=> 'object' +console.log(typeOf(new Buffer(''))); +//=> 'object' +console.log(typeOf(new Map())); +//=> 'object' +console.log(typeOf(new Set())); +//=> 'object' +console.log(typeOf(new WeakMap())); +//=> 'object' +console.log(typeOf(new WeakSet())); +//=> 'object' +``` + +## About + +
    +Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
    + +
    +Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
    + +
    +Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
    + +### Related projects + +You might also be interested in these projects: + +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 82 | [jonschlinkert](https://github.com/jonschlinkert) | +| 3 | [aretecode](https://github.com/aretecode) | +| 2 | [miguelmota](https://github.com/miguelmota) | +| 1 | [dtothefp](https://github.com/dtothefp) | +| 1 | [ksheedlo](https://github.com/ksheedlo) | +| 1 | [pdehaan](https://github.com/pdehaan) | +| 1 | [laggingreflex](https://github.com/laggingreflex) | +| 1 | [charlike](https://github.com/charlike) | + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on October 13, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/index.js b/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/index.js new file mode 100644 index 000000000..fc5cde96e --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/index.js @@ -0,0 +1,147 @@ +var toString = Object.prototype.toString; + +/** + * Get the native `typeof` a value. + * + * @param {*} `val` + * @return {*} Native javascript type + */ + +module.exports = function kindOf(val) { + var type = typeof val; + + // primitivies + if (type === 'undefined') { + return 'undefined'; + } + if (val === null) { + return 'null'; + } + if (val === true || val === false || val instanceof Boolean) { + return 'boolean'; + } + if (type === 'string' || val instanceof String) { + return 'string'; + } + if (type === 'number' || val instanceof Number) { + return 'number'; + } + + // functions + if (type === 'function' || val instanceof Function) { + if (typeof val.constructor.name !== 'undefined' && val.constructor.name.slice(0, 9) === 'Generator') { + return 'generatorfunction'; + } + return 'function'; + } + + // array + if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { + return 'array'; + } + + // check for instances of RegExp and Date before calling `toString` + if (val instanceof RegExp) { + return 'regexp'; + } + if (val instanceof Date) { + return 'date'; + } + + // other objects + type = toString.call(val); + + if (type === '[object RegExp]') { + return 'regexp'; + } + if (type === '[object Date]') { + return 'date'; + } + if (type === '[object Arguments]') { + return 'arguments'; + } + if (type === '[object Error]') { + return 'error'; + } + if (type === '[object Promise]') { + return 'promise'; + } + + // buffer + if (isBuffer(val)) { + return 'buffer'; + } + + // es6: Map, WeakMap, Set, WeakSet + if (type === '[object Set]') { + return 'set'; + } + if (type === '[object WeakSet]') { + return 'weakset'; + } + if (type === '[object Map]') { + return 'map'; + } + if (type === '[object WeakMap]') { + return 'weakmap'; + } + if (type === '[object Symbol]') { + return 'symbol'; + } + + if (type === '[object Map Iterator]') { + return 'mapiterator'; + } + if (type === '[object Set Iterator]') { + return 'setiterator'; + } + if (type === '[object String Iterator]') { + return 'stringiterator'; + } + if (type === '[object Array Iterator]') { + return 'arrayiterator'; + } + + // typed arrays + if (type === '[object Int8Array]') { + return 'int8array'; + } + if (type === '[object Uint8Array]') { + return 'uint8array'; + } + if (type === '[object Uint8ClampedArray]') { + return 'uint8clampedarray'; + } + if (type === '[object Int16Array]') { + return 'int16array'; + } + if (type === '[object Uint16Array]') { + return 'uint16array'; + } + if (type === '[object Int32Array]') { + return 'int32array'; + } + if (type === '[object Uint32Array]') { + return 'uint32array'; + } + if (type === '[object Float32Array]') { + return 'float32array'; + } + if (type === '[object Float64Array]') { + return 'float64array'; + } + + // must be a plain object + return 'object'; +}; + +/** + * If you need to support Safari 5-7 (8-10 yr-old browser), + * take a look at https://github.com/feross/is-buffer + */ + +function isBuffer(val) { + return val.constructor + && typeof val.constructor.isBuffer === 'function' + && val.constructor.isBuffer(val); +} diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/package.json b/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/package.json new file mode 100644 index 000000000..e3faa210c --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/package.json @@ -0,0 +1,146 @@ +{ + "_from": "kind-of@^5.0.0", + "_id": "kind-of@5.1.0", + "_inBundle": false, + "_integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "_location": "/readdirp/expand-brackets/kind-of", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "kind-of@^5.0.0", + "name": "kind-of", + "escapedName": "kind-of", + "rawSpec": "^5.0.0", + "saveSpec": null, + "fetchSpec": "^5.0.0" + }, + "_requiredBy": [ + "/readdirp/expand-brackets/is-descriptor" + ], + "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "_shasum": "729c91e2d857b7a419a1f9aa65685c4c33f5845d", + "_spec": "kind-of@^5.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/kind-of/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "David Fox-Powell", + "url": "https://dtothefp.github.io/me" + }, + { + "name": "James", + "url": "https://twitter.com/aretecode" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Ken Sheedlo", + "url": "kensheedlo.com" + }, + { + "name": "laggingreflex", + "url": "https://github.com/laggingreflex" + }, + { + "name": "Miguel Mota", + "url": "https://miguelmota.com" + }, + { + "name": "Peter deHaan", + "url": "http://about.me/peterdehaan" + }, + { + "name": "tunnckoCore", + "url": "https://i.am.charlike.online" + } + ], + "deprecated": false, + "description": "Get the native type of a value.", + "devDependencies": { + "ansi-bold": "^0.1.1", + "benchmarked": "^1.1.1", + "browserify": "^14.4.0", + "gulp-format-md": "^0.1.12", + "matched": "^0.4.4", + "mocha": "^3.4.2", + "type-of": "^2.0.1", + "typeof": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/kind-of", + "keywords": [ + "arguments", + "array", + "boolean", + "check", + "date", + "function", + "is", + "is-type", + "is-type-of", + "kind", + "kind-of", + "number", + "object", + "of", + "regexp", + "string", + "test", + "type", + "type-of", + "typeof", + "types" + ], + "license": "MIT", + "main": "index.js", + "name": "kind-of", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/kind-of.git" + }, + "scripts": { + "prepublish": "browserify -o browser.js -e index.js -s index --bare", + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "is-glob", + "is-number", + "is-primitive" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "type-of", + "typeof", + "verb" + ] + }, + "version": "5.1.0" +} diff --git a/node_modules/readdirp/node_modules/expand-brackets/package.json b/node_modules/readdirp/node_modules/expand-brackets/package.json new file mode 100644 index 000000000..87197274c --- /dev/null +++ b/node_modules/readdirp/node_modules/expand-brackets/package.json @@ -0,0 +1,133 @@ +{ + "_from": "expand-brackets@^2.1.4", + "_id": "expand-brackets@2.1.4", + "_inBundle": false, + "_integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "_location": "/readdirp/expand-brackets", + "_phantomChildren": { + "is-buffer": "1.1.6", + "is-extendable": "0.1.1" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "expand-brackets@^2.1.4", + "name": "expand-brackets", + "escapedName": "expand-brackets", + "rawSpec": "^2.1.4", + "saveSpec": null, + "fetchSpec": "^2.1.4" + }, + "_requiredBy": [ + "/readdirp/extglob" + ], + "_resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "_shasum": "b77735e315ce30f6b6eff0f83b04151a22449622", + "_spec": "expand-brackets@^2.1.4", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/extglob", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/expand-brackets/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Elan Shanker", + "url": "https://github.com/es128" + }, + { + "name": "Eugene Sharygin", + "url": "https://github.com/eush77" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Martin Kolárik", + "email": "martin@kolarik.sk", + "url": "http://kolarik.sk" + } + ], + "dependencies": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "deprecated": false, + "description": "Expand POSIX bracket expressions (character classes) in glob patterns.", + "devDependencies": { + "bash-match": "^0.1.1", + "gulp-format-md": "^0.1.10", + "helper-changelog": "^0.3.0", + "minimatch": "^3.0.3", + "mocha": "^3.0.2", + "multimatch": "^2.1.0", + "yargs-parser": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "lib" + ], + "homepage": "https://github.com/jonschlinkert/expand-brackets", + "keywords": [ + "bracket", + "brackets", + "character class", + "expand", + "expression", + "posix" + ], + "license": "MIT", + "main": "index.js", + "name": "expand-brackets", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/expand-brackets.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "helpers": [ + "helper-changelog" + ], + "related": { + "list": [ + "braces", + "extglob", + "micromatch", + "nanomatch" + ] + }, + "reflinks": [ + "micromatch", + "verb", + "verb-generate-readme" + ], + "lint": { + "reflinks": true + } + }, + "version": "2.1.4" +} diff --git a/node_modules/readdirp/node_modules/extglob/LICENSE b/node_modules/readdirp/node_modules/extglob/LICENSE new file mode 100644 index 000000000..e33d14b75 --- /dev/null +++ b/node_modules/readdirp/node_modules/extglob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/extglob/README.md b/node_modules/readdirp/node_modules/extglob/README.md new file mode 100644 index 000000000..3255ea2b7 --- /dev/null +++ b/node_modules/readdirp/node_modules/extglob/README.md @@ -0,0 +1,362 @@ +# extglob [![NPM version](https://img.shields.io/npm/v/extglob.svg?style=flat)](https://www.npmjs.com/package/extglob) [![NPM monthly downloads](https://img.shields.io/npm/dm/extglob.svg?style=flat)](https://npmjs.org/package/extglob) [![NPM total downloads](https://img.shields.io/npm/dt/extglob.svg?style=flat)](https://npmjs.org/package/extglob) [![Linux Build Status](https://img.shields.io/travis/micromatch/extglob.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/extglob) [![Windows Build Status](https://img.shields.io/appveyor/ci/micromatch/extglob.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/micromatch/extglob) + +> Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save extglob +``` + +* Convert an extglob string to a regex-compatible string. +* More complete (and correct) support than [minimatch](https://github.com/isaacs/minimatch) (minimatch fails a large percentage of the extglob tests) +* Handles [negation patterns](#extglob-patterns) +* Handles [nested patterns](#extglob-patterns) +* Organized code base, easy to maintain and make changes when edge cases arise +* As you can see by the [benchmarks](#benchmarks), extglob doesn't pay with speed for it's completeness, accuracy and quality. + +**Heads up!**: This library only supports extglobs, to handle full glob patterns and other extended globbing features use [micromatch](https://github.com/jonschlinkert/micromatch) instead. + +## Usage + +The main export is a function that takes a string and options, and returns an object with the parsed AST and the compiled `.output`, which is a regex-compatible string that can be used for matching. + +```js +var extglob = require('extglob'); +console.log(extglob('!(xyz)*.js')); +``` + +## Extglob cheatsheet + +Extended globbing patterns can be defined as follows (as described by the [bash man page](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html)): + +| **pattern** | **regex equivalent** | **description** | +| --- | --- | --- | +| `?(pattern-list)` | `(...|...)?` | Matches zero or one occurrence of the given pattern(s) | +| `*(pattern-list)` | `(...|...)*` | Matches zero or more occurrences of the given pattern(s) | +| `+(pattern-list)` | `(...|...)+` | Matches one or more occurrences of the given pattern(s) | +| `@(pattern-list)` | `(...|...)` [1] | Matches one of the given pattern(s) | +| `!(pattern-list)` | N/A | Matches anything except one of the given pattern(s) | + +## API + +### [extglob](index.js#L36) + +Convert the given `extglob` pattern into a regex-compatible string. Returns an object with the compiled result and the parsed AST. + +**Params** + +* `pattern` **{String}** +* `options` **{Object}** +* `returns` **{String}** + +**Example** + +```js +var extglob = require('extglob'); +console.log(extglob('*.!(*a)')); +//=> '(?!\\.)[^/]*?\\.(?!(?!\\.)[^/]*?a\\b).*?' +``` + +### [.match](index.js#L56) + +Takes an array of strings and an extglob pattern and returns a new array that contains only the strings that match the pattern. + +**Params** + +* `list` **{Array}**: Array of strings to match +* `pattern` **{String}**: Extglob pattern +* `options` **{Object}** +* `returns` **{Array}**: Returns an array of matches + +**Example** + +```js +var extglob = require('extglob'); +console.log(extglob.match(['a.a', 'a.b', 'a.c'], '*.!(*a)')); +//=> ['a.b', 'a.c'] +``` + +### [.isMatch](index.js#L111) + +Returns true if the specified `string` matches the given extglob `pattern`. + +**Params** + +* `string` **{String}**: String to match +* `pattern` **{String}**: Extglob pattern +* `options` **{String}** +* `returns` **{Boolean}** + +**Example** + +```js +var extglob = require('extglob'); + +console.log(extglob.isMatch('a.a', '*.!(*a)')); +//=> false +console.log(extglob.isMatch('a.b', '*.!(*a)')); +//=> true +``` + +### [.contains](index.js#L150) + +Returns true if the given `string` contains the given pattern. Similar to `.isMatch` but the pattern can match any part of the string. + +**Params** + +* `str` **{String}**: The string to match. +* `pattern` **{String}**: Glob pattern to use for matching. +* `options` **{Object}** +* `returns` **{Boolean}**: Returns true if the patter matches any part of `str`. + +**Example** + +```js +var extglob = require('extglob'); +console.log(extglob.contains('aa/bb/cc', '*b')); +//=> true +console.log(extglob.contains('aa/bb/cc', '*d')); +//=> false +``` + +### [.matcher](index.js#L184) + +Takes an extglob pattern and returns a matcher function. The returned function takes the string to match as its only argument. + +**Params** + +* `pattern` **{String}**: Extglob pattern +* `options` **{String}** +* `returns` **{Boolean}** + +**Example** + +```js +var extglob = require('extglob'); +var isMatch = extglob.matcher('*.!(*a)'); + +console.log(isMatch('a.a')); +//=> false +console.log(isMatch('a.b')); +//=> true +``` + +### [.create](index.js#L214) + +Convert the given `extglob` pattern into a regex-compatible string. Returns an object with the compiled result and the parsed AST. + +**Params** + +* `str` **{String}** +* `options` **{Object}** +* `returns` **{String}** + +**Example** + +```js +var extglob = require('extglob'); +console.log(extglob.create('*.!(*a)').output); +//=> '(?!\\.)[^/]*?\\.(?!(?!\\.)[^/]*?a\\b).*?' +``` + +### [.capture](index.js#L248) + +Returns an array of matches captured by `pattern` in `string`, or `null` if the pattern did not match. + +**Params** + +* `pattern` **{String}**: Glob pattern to use for matching. +* `string` **{String}**: String to match +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Boolean}**: Returns an array of captures if the string matches the glob pattern, otherwise `null`. + +**Example** + +```js +var extglob = require('extglob'); +extglob.capture(pattern, string[, options]); + +console.log(extglob.capture('test/*.js', 'test/foo.js')); +//=> ['foo'] +console.log(extglob.capture('test/*.js', 'foo/bar.css')); +//=> null +``` + +### [.makeRe](index.js#L281) + +Create a regular expression from the given `pattern` and `options`. + +**Params** + +* `pattern` **{String}**: The pattern to convert to regex. +* `options` **{Object}** +* `returns` **{RegExp}** + +**Example** + +```js +var extglob = require('extglob'); +var re = extglob.makeRe('*.!(*a)'); +console.log(re); +//=> /^[^\/]*?\.(?![^\/]*?a)[^\/]*?$/ +``` + +## Options + +Available options are based on the options from Bash (and the option names used in bash). + +### options.nullglob + +**Type**: `boolean` + +**Default**: `undefined` + +When enabled, the pattern itself will be returned when no matches are found. + +### options.nonull + +Alias for [options.nullglob](#optionsnullglob), included for parity with minimatch. + +### options.cache + +**Type**: `boolean` + +**Default**: `undefined` + +Functions are memoized based on the given glob patterns and options. Disable memoization by setting `options.cache` to false. + +### options.failglob + +**Type**: `boolean` + +**Default**: `undefined` + +Throw an error is no matches are found. + +## Benchmarks + +Last run on December 21, 2017 + +```sh +# negation-nested (49 bytes) + extglob x 2,228,255 ops/sec ±0.98% (89 runs sampled) + minimatch x 207,875 ops/sec ±0.61% (91 runs sampled) + + fastest is extglob (by 1072% avg) + +# negation-simple (43 bytes) + extglob x 2,205,668 ops/sec ±1.00% (91 runs sampled) + minimatch x 311,923 ops/sec ±1.25% (91 runs sampled) + + fastest is extglob (by 707% avg) + +# range-false (57 bytes) + extglob x 2,263,877 ops/sec ±0.40% (94 runs sampled) + minimatch x 271,372 ops/sec ±1.02% (91 runs sampled) + + fastest is extglob (by 834% avg) + +# range-true (56 bytes) + extglob x 2,161,891 ops/sec ±0.41% (92 runs sampled) + minimatch x 268,265 ops/sec ±1.17% (91 runs sampled) + + fastest is extglob (by 806% avg) + +# star-simple (46 bytes) + extglob x 2,211,081 ops/sec ±0.49% (92 runs sampled) + minimatch x 343,319 ops/sec ±0.59% (91 runs sampled) + + fastest is extglob (by 644% avg) + +``` + +## Differences from Bash + +This library has complete parity with Bash 4.3 with only a couple of minor differences. + +* In some cases Bash returns true if the given string "contains" the pattern, whereas this library returns true if the string is an exact match for the pattern. You can relax this by setting `options.contains` to true. +* This library is more accurate than Bash and thus does not fail some of the tests that Bash 4.3 still lists as failing in their unit tests + +## About + +
    +Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
    + +
    +Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
    +
    +Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
    + +### Related projects + +You might also be interested in these projects: + +* [braces](https://www.npmjs.com/package/braces): Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support… [more](https://github.com/micromatch/braces) | [homepage](https://github.com/micromatch/braces "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.") +* [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/jonschlinkert/expand-brackets "Expand POSIX bracket expressions (character classes) in glob patterns.") +* [expand-range](https://www.npmjs.com/package/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. Used… [more](https://github.com/jonschlinkert/expand-range) | [homepage](https://github.com/jonschlinkert/expand-range "Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. Used by [micromatch].") +* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or `step` to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/micromatch/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 49 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [isiahmeadows](https://github.com/isiahmeadows) | +| 1 | [doowb](https://github.com/doowb) | +| 1 | [devongovett](https://github.com/devongovett) | +| 1 | [mjbvz](https://github.com/mjbvz) | +| 1 | [shinnn](https://github.com/shinnn) | + +### Author + +**Jon Schlinkert** + +* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on December 21, 2017._ + +
    +
    +
      +
    1. `@` isn "'t a RegEx character." + +
    2. +
    +
    \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/extglob/changelog.md b/node_modules/readdirp/node_modules/extglob/changelog.md new file mode 100644 index 000000000..c9fc4fcd7 --- /dev/null +++ b/node_modules/readdirp/node_modules/extglob/changelog.md @@ -0,0 +1,25 @@ +## Changelog + +### v2.0.0 + +**Added features** + +- Adds [.capture](readme.md#capture) method for capturing matches, thanks to [devongovett](https://github.com/devongovett) + + +### v1.0.0 + +**Breaking changes** + +- The main export now returns the compiled string, instead of the object returned from the compiler + +**Added features** + +- Adds a `.create` method to do what the main function did before v1.0.0 + +**Other changes** + +- adds `expand-brackets` parsers/compilers to handle nested brackets and extglobs +- uses `to-regex` to build regex for `makeRe` method +- improves coverage +- optimizations \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/extglob/index.js b/node_modules/readdirp/node_modules/extglob/index.js new file mode 100644 index 000000000..116e6d5cb --- /dev/null +++ b/node_modules/readdirp/node_modules/extglob/index.js @@ -0,0 +1,331 @@ +'use strict'; + +/** + * Module dependencies + */ + +var extend = require('extend-shallow'); +var unique = require('array-unique'); +var toRegex = require('to-regex'); + +/** + * Local dependencies + */ + +var compilers = require('./lib/compilers'); +var parsers = require('./lib/parsers'); +var Extglob = require('./lib/extglob'); +var utils = require('./lib/utils'); +var MAX_LENGTH = 1024 * 64; + +/** + * Convert the given `extglob` pattern into a regex-compatible string. Returns + * an object with the compiled result and the parsed AST. + * + * ```js + * var extglob = require('extglob'); + * console.log(extglob('*.!(*a)')); + * //=> '(?!\\.)[^/]*?\\.(?!(?!\\.)[^/]*?a\\b).*?' + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {String} + * @api public + */ + +function extglob(pattern, options) { + return extglob.create(pattern, options).output; +} + +/** + * Takes an array of strings and an extglob pattern and returns a new + * array that contains only the strings that match the pattern. + * + * ```js + * var extglob = require('extglob'); + * console.log(extglob.match(['a.a', 'a.b', 'a.c'], '*.!(*a)')); + * //=> ['a.b', 'a.c'] + * ``` + * @param {Array} `list` Array of strings to match + * @param {String} `pattern` Extglob pattern + * @param {Object} `options` + * @return {Array} Returns an array of matches + * @api public + */ + +extglob.match = function(list, pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('expected pattern to be a string'); + } + + list = utils.arrayify(list); + var isMatch = extglob.matcher(pattern, options); + var len = list.length; + var idx = -1; + var matches = []; + + while (++idx < len) { + var ele = list[idx]; + + if (isMatch(ele)) { + matches.push(ele); + } + } + + // if no options were passed, uniquify results and return + if (typeof options === 'undefined') { + return unique(matches); + } + + if (matches.length === 0) { + if (options.failglob === true) { + throw new Error('no matches found for "' + pattern + '"'); + } + if (options.nonull === true || options.nullglob === true) { + return [pattern.split('\\').join('')]; + } + } + + return options.nodupes !== false ? unique(matches) : matches; +}; + +/** + * Returns true if the specified `string` matches the given + * extglob `pattern`. + * + * ```js + * var extglob = require('extglob'); + * + * console.log(extglob.isMatch('a.a', '*.!(*a)')); + * //=> false + * console.log(extglob.isMatch('a.b', '*.!(*a)')); + * //=> true + * ``` + * @param {String} `string` String to match + * @param {String} `pattern` Extglob pattern + * @param {String} `options` + * @return {Boolean} + * @api public + */ + +extglob.isMatch = function(str, pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('expected pattern to be a string'); + } + + if (typeof str !== 'string') { + throw new TypeError('expected a string'); + } + + if (pattern === str) { + return true; + } + + if (pattern === '' || pattern === ' ' || pattern === '.') { + return pattern === str; + } + + var isMatch = utils.memoize('isMatch', pattern, options, extglob.matcher); + return isMatch(str); +}; + +/** + * Returns true if the given `string` contains the given pattern. Similar to `.isMatch` but + * the pattern can match any part of the string. + * + * ```js + * var extglob = require('extglob'); + * console.log(extglob.contains('aa/bb/cc', '*b')); + * //=> true + * console.log(extglob.contains('aa/bb/cc', '*d')); + * //=> false + * ``` + * @param {String} `str` The string to match. + * @param {String} `pattern` Glob pattern to use for matching. + * @param {Object} `options` + * @return {Boolean} Returns true if the patter matches any part of `str`. + * @api public + */ + +extglob.contains = function(str, pattern, options) { + if (typeof str !== 'string') { + throw new TypeError('expected a string'); + } + + if (pattern === '' || pattern === ' ' || pattern === '.') { + return pattern === str; + } + + var opts = extend({}, options, {contains: true}); + opts.strictClose = false; + opts.strictOpen = false; + return extglob.isMatch(str, pattern, opts); +}; + +/** + * Takes an extglob pattern and returns a matcher function. The returned + * function takes the string to match as its only argument. + * + * ```js + * var extglob = require('extglob'); + * var isMatch = extglob.matcher('*.!(*a)'); + * + * console.log(isMatch('a.a')); + * //=> false + * console.log(isMatch('a.b')); + * //=> true + * ``` + * @param {String} `pattern` Extglob pattern + * @param {String} `options` + * @return {Boolean} + * @api public + */ + +extglob.matcher = function(pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('expected pattern to be a string'); + } + + function matcher() { + var re = extglob.makeRe(pattern, options); + return function(str) { + return re.test(str); + }; + } + + return utils.memoize('matcher', pattern, options, matcher); +}; + +/** + * Convert the given `extglob` pattern into a regex-compatible string. Returns + * an object with the compiled result and the parsed AST. + * + * ```js + * var extglob = require('extglob'); + * console.log(extglob.create('*.!(*a)').output); + * //=> '(?!\\.)[^/]*?\\.(?!(?!\\.)[^/]*?a\\b).*?' + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {String} + * @api public + */ + +extglob.create = function(pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('expected pattern to be a string'); + } + + function create() { + var ext = new Extglob(options); + var ast = ext.parse(pattern, options); + return ext.compile(ast, options); + } + + return utils.memoize('create', pattern, options, create); +}; + +/** + * Returns an array of matches captured by `pattern` in `string`, or `null` + * if the pattern did not match. + * + * ```js + * var extglob = require('extglob'); + * extglob.capture(pattern, string[, options]); + * + * console.log(extglob.capture('test/*.js', 'test/foo.js')); + * //=> ['foo'] + * console.log(extglob.capture('test/*.js', 'foo/bar.css')); + * //=> null + * ``` + * @param {String} `pattern` Glob pattern to use for matching. + * @param {String} `string` String to match + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns an array of captures if the string matches the glob pattern, otherwise `null`. + * @api public + */ + +extglob.capture = function(pattern, str, options) { + var re = extglob.makeRe(pattern, extend({capture: true}, options)); + + function match() { + return function(string) { + var match = re.exec(string); + if (!match) { + return null; + } + + return match.slice(1); + }; + } + + var capture = utils.memoize('capture', pattern, options, match); + return capture(str); +}; + +/** + * Create a regular expression from the given `pattern` and `options`. + * + * ```js + * var extglob = require('extglob'); + * var re = extglob.makeRe('*.!(*a)'); + * console.log(re); + * //=> /^[^\/]*?\.(?![^\/]*?a)[^\/]*?$/ + * ``` + * @param {String} `pattern` The pattern to convert to regex. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + +extglob.makeRe = function(pattern, options) { + if (pattern instanceof RegExp) { + return pattern; + } + + if (typeof pattern !== 'string') { + throw new TypeError('expected pattern to be a string'); + } + + if (pattern.length > MAX_LENGTH) { + throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters'); + } + + function makeRe() { + var opts = extend({strictErrors: false}, options); + if (opts.strictErrors === true) opts.strict = true; + var res = extglob.create(pattern, opts); + return toRegex(res.output, opts); + } + + var regex = utils.memoize('makeRe', pattern, options, makeRe); + if (regex.source.length > MAX_LENGTH) { + throw new SyntaxError('potentially malicious regex detected'); + } + + return regex; +}; + +/** + * Cache + */ + +extglob.cache = utils.cache; +extglob.clearCache = function() { + extglob.cache.__data__ = {}; +}; + +/** + * Expose `Extglob` constructor, parsers and compilers + */ + +extglob.Extglob = Extglob; +extglob.compilers = compilers; +extglob.parsers = parsers; + +/** + * Expose `extglob` + * @type {Function} + */ + +module.exports = extglob; diff --git a/node_modules/readdirp/node_modules/extglob/lib/.DS_Store b/node_modules/readdirp/node_modules/extglob/lib/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 1) { + val += '{' + node.val.length + '}'; + } + return this.emit(val, node); + }) + + /** + * Plus: "+" + */ + + .set('plus', function(node) { + var prev = node.parsed.slice(-1); + if (prev === ']' || prev === ')') { + return this.emit(node.val, node); + } + var ch = this.output.slice(-1); + if (!this.output || (/[?*+]/.test(ch) && node.parent.type !== 'bracket')) { + return this.emit('\\+', node); + } + if (/\w/.test(ch) && !node.inside) { + return this.emit('+\\+?', node); + } + return this.emit('+', node); + }) + + /** + * Star: "*" + */ + + .set('star', function(node) { + var prev = this.prev(); + var prefix = prev.type !== 'text' && prev.type !== 'escape' + ? '(?!\\.)' + : ''; + + return this.emit(prefix + star.call(this, node), node); + }) + + /** + * Parens + */ + + .set('paren', function(node) { + return this.mapVisit(node.nodes); + }) + .set('paren.open', function(node) { + var capture = this.options.capture ? '(' : ''; + + switch (node.parent.prefix) { + case '!': + case '^': + return this.emit(capture + '(?:(?!(?:', node); + case '*': + case '+': + case '?': + case '@': + return this.emit(capture + '(?:', node); + default: { + var val = node.val; + if (this.options.bash === true) { + val = '\\' + val; + } else if (!this.options.capture && val === '(' && node.parent.rest[0] !== '?') { + val += '?:'; + } + + return this.emit(val, node); + } + } + }) + .set('paren.close', function(node) { + var capture = this.options.capture ? ')' : ''; + + switch (node.prefix) { + case '!': + case '^': + var prefix = /^(\)|$)/.test(node.rest) ? '$' : ''; + var str = star.call(this, node); + + // if the extglob has a slash explicitly defined, we know the user wants + // to match slashes, so we need to ensure the "star" regex allows for it + if (node.parent.hasSlash && !this.options.star && this.options.slash !== false) { + str = '.*?'; + } + + return this.emit(prefix + ('))' + str + ')') + capture, node); + case '*': + case '+': + case '?': + return this.emit(')' + node.prefix + capture, node); + case '@': + return this.emit(')' + capture, node); + default: { + var val = (this.options.bash === true ? '\\' : '') + ')'; + return this.emit(val, node); + } + } + }) + + /** + * Text + */ + + .set('text', function(node) { + var val = node.val.replace(/[\[\]]/g, '\\$&'); + return this.emit(val, node); + }); +}; diff --git a/node_modules/readdirp/node_modules/extglob/lib/extglob.js b/node_modules/readdirp/node_modules/extglob/lib/extglob.js new file mode 100644 index 000000000..015f92895 --- /dev/null +++ b/node_modules/readdirp/node_modules/extglob/lib/extglob.js @@ -0,0 +1,78 @@ +'use strict'; + +/** + * Module dependencies + */ + +var Snapdragon = require('snapdragon'); +var define = require('define-property'); +var extend = require('extend-shallow'); + +/** + * Local dependencies + */ + +var compilers = require('./compilers'); +var parsers = require('./parsers'); + +/** + * Customize Snapdragon parser and renderer + */ + +function Extglob(options) { + this.options = extend({source: 'extglob'}, options); + this.snapdragon = this.options.snapdragon || new Snapdragon(this.options); + this.snapdragon.patterns = this.snapdragon.patterns || {}; + this.compiler = this.snapdragon.compiler; + this.parser = this.snapdragon.parser; + + compilers(this.snapdragon); + parsers(this.snapdragon); + + /** + * Override Snapdragon `.parse` method + */ + + define(this.snapdragon, 'parse', function(str, options) { + var parsed = Snapdragon.prototype.parse.apply(this, arguments); + parsed.input = str; + + // escape unmatched brace/bracket/parens + var last = this.parser.stack.pop(); + if (last && this.options.strict !== true) { + var node = last.nodes[0]; + node.val = '\\' + node.val; + var sibling = node.parent.nodes[1]; + if (sibling.type === 'star') { + sibling.loose = true; + } + } + + // add non-enumerable parser reference + define(parsed, 'parser', this.parser); + return parsed; + }); + + /** + * Decorate `.parse` method + */ + + define(this, 'parse', function(ast, options) { + return this.snapdragon.parse.apply(this.snapdragon, arguments); + }); + + /** + * Decorate `.compile` method + */ + + define(this, 'compile', function(ast, options) { + return this.snapdragon.compile.apply(this.snapdragon, arguments); + }); + +} + +/** + * Expose `Extglob` + */ + +module.exports = Extglob; diff --git a/node_modules/readdirp/node_modules/extglob/lib/parsers.js b/node_modules/readdirp/node_modules/extglob/lib/parsers.js new file mode 100644 index 000000000..2ba7352e9 --- /dev/null +++ b/node_modules/readdirp/node_modules/extglob/lib/parsers.js @@ -0,0 +1,156 @@ +'use strict'; + +var brackets = require('expand-brackets'); +var define = require('define-property'); +var utils = require('./utils'); + +/** + * Characters to use in text regex (we want to "not" match + * characters that are matched by other parsers) + */ + +var TEXT_REGEX = '([!@*?+]?\\(|\\)|[*?.+\\\\]|\\[:?(?=.*\\])|:?\\])+'; +var not = utils.createRegex(TEXT_REGEX); + +/** + * Extglob parsers + */ + +function parsers(extglob) { + extglob.state = extglob.state || {}; + + /** + * Use `expand-brackets` parsers + */ + + extglob.use(brackets.parsers); + extglob.parser.sets.paren = extglob.parser.sets.paren || []; + extglob.parser + + /** + * Extglob open: "*(" + */ + + .capture('paren.open', function() { + var parsed = this.parsed; + var pos = this.position(); + var m = this.match(/^([!@*?+])?\(/); + if (!m) return; + + var prev = this.prev(); + var prefix = m[1]; + var val = m[0]; + + var open = pos({ + type: 'paren.open', + parsed: parsed, + val: val + }); + + var node = pos({ + type: 'paren', + prefix: prefix, + nodes: [open] + }); + + // if nested negation extglobs, just cancel them out to simplify + if (prefix === '!' && prev.type === 'paren' && prev.prefix === '!') { + prev.prefix = '@'; + node.prefix = '@'; + } + + define(node, 'rest', this.input); + define(node, 'parsed', parsed); + define(node, 'parent', prev); + define(open, 'parent', node); + + this.push('paren', node); + prev.nodes.push(node); + }) + + /** + * Extglob close: ")" + */ + + .capture('paren.close', function() { + var parsed = this.parsed; + var pos = this.position(); + var m = this.match(/^\)/); + if (!m) return; + + var parent = this.pop('paren'); + var node = pos({ + type: 'paren.close', + rest: this.input, + parsed: parsed, + val: m[0] + }); + + if (!this.isType(parent, 'paren')) { + if (this.options.strict) { + throw new Error('missing opening paren: "("'); + } + node.escaped = true; + return node; + } + + node.prefix = parent.prefix; + parent.nodes.push(node); + define(node, 'parent', parent); + }) + + /** + * Escape: "\\." + */ + + .capture('escape', function() { + var pos = this.position(); + var m = this.match(/^\\(.)/); + if (!m) return; + + return pos({ + type: 'escape', + val: m[0], + ch: m[1] + }); + }) + + /** + * Question marks: "?" + */ + + .capture('qmark', function() { + var parsed = this.parsed; + var pos = this.position(); + var m = this.match(/^\?+(?!\()/); + if (!m) return; + extglob.state.metachar = true; + return pos({ + type: 'qmark', + rest: this.input, + parsed: parsed, + val: m[0] + }); + }) + + /** + * Character parsers + */ + + .capture('star', /^\*(?!\()/) + .capture('plus', /^\+(?!\()/) + .capture('dot', /^\./) + .capture('text', not); +}; + +/** + * Expose text regex string + */ + +module.exports.TEXT_REGEX = TEXT_REGEX; + +/** + * Extglob parsers + */ + +module.exports = parsers; diff --git a/node_modules/readdirp/node_modules/extglob/lib/utils.js b/node_modules/readdirp/node_modules/extglob/lib/utils.js new file mode 100644 index 000000000..37a59fbce --- /dev/null +++ b/node_modules/readdirp/node_modules/extglob/lib/utils.js @@ -0,0 +1,69 @@ +'use strict'; + +var regex = require('regex-not'); +var Cache = require('fragment-cache'); + +/** + * Utils + */ + +var utils = module.exports; +var cache = utils.cache = new Cache(); + +/** + * Cast `val` to an array + * @return {Array} + */ + +utils.arrayify = function(val) { + if (!Array.isArray(val)) { + return [val]; + } + return val; +}; + +/** + * Memoize a generated regex or function + */ + +utils.memoize = function(type, pattern, options, fn) { + var key = utils.createKey(type + pattern, options); + + if (cache.has(type, key)) { + return cache.get(type, key); + } + + var val = fn(pattern, options); + if (options && options.cache === false) { + return val; + } + + cache.set(type, key, val); + return val; +}; + +/** + * Create the key to use for memoization. The key is generated + * by iterating over the options and concatenating key-value pairs + * to the pattern string. + */ + +utils.createKey = function(pattern, options) { + var key = pattern; + if (typeof options === 'undefined') { + return key; + } + for (var prop in options) { + key += ';' + prop + '=' + String(options[prop]); + } + return key; +}; + +/** + * Create the regex to use for matching text + */ + +utils.createRegex = function(str) { + var opts = {contains: true, strictClose: false}; + return regex(str, opts); +}; diff --git a/node_modules/readdirp/node_modules/extglob/node_modules/define-property/LICENSE b/node_modules/readdirp/node_modules/extglob/node_modules/define-property/LICENSE new file mode 100644 index 000000000..ec85897eb --- /dev/null +++ b/node_modules/readdirp/node_modules/extglob/node_modules/define-property/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, 2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/extglob/node_modules/define-property/README.md b/node_modules/readdirp/node_modules/extglob/node_modules/define-property/README.md new file mode 100644 index 000000000..2f1af05f3 --- /dev/null +++ b/node_modules/readdirp/node_modules/extglob/node_modules/define-property/README.md @@ -0,0 +1,95 @@ +# define-property [![NPM version](https://img.shields.io/npm/v/define-property.svg?style=flat)](https://www.npmjs.com/package/define-property) [![NPM monthly downloads](https://img.shields.io/npm/dm/define-property.svg?style=flat)](https://npmjs.org/package/define-property) [![NPM total downloads](https://img.shields.io/npm/dt/define-property.svg?style=flat)](https://npmjs.org/package/define-property) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/define-property.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/define-property) + +> Define a non-enumerable property on an object. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save define-property +``` + +Install with [yarn](https://yarnpkg.com): + +```sh +$ yarn add define-property +``` + +## Usage + +**Params** + +* `obj`: The object on which to define the property. +* `prop`: The name of the property to be defined or modified. +* `descriptor`: The descriptor for the property being defined or modified. + +```js +var define = require('define-property'); +var obj = {}; +define(obj, 'foo', function(val) { + return val.toUpperCase(); +}); + +console.log(obj); +//=> {} + +console.log(obj.foo('bar')); +//=> 'BAR' +``` + +**get/set** + +```js +define(obj, 'foo', { + get: function() {}, + set: function() {} +}); +``` + +## About + +### Related projects + +* [assign-deep](https://www.npmjs.com/package/assign-deep): Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target… [more](https://github.com/jonschlinkert/assign-deep) | [homepage](https://github.com/jonschlinkert/assign-deep "Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target (first) object.") +* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") +* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") +* [mixin-deep](https://www.npmjs.com/package/mixin-deep): Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. | [homepage](https://github.com/jonschlinkert/mixin-deep "Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 20, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/extglob/node_modules/define-property/index.js b/node_modules/readdirp/node_modules/extglob/node_modules/define-property/index.js new file mode 100644 index 000000000..27c19ebf6 --- /dev/null +++ b/node_modules/readdirp/node_modules/extglob/node_modules/define-property/index.js @@ -0,0 +1,31 @@ +/*! + * define-property + * + * Copyright (c) 2015, 2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var isDescriptor = require('is-descriptor'); + +module.exports = function defineProperty(obj, prop, val) { + if (typeof obj !== 'object' && typeof obj !== 'function') { + throw new TypeError('expected an object or function.'); + } + + if (typeof prop !== 'string') { + throw new TypeError('expected `prop` to be a string.'); + } + + if (isDescriptor(val) && ('set' in val || 'get' in val)) { + return Object.defineProperty(obj, prop, val); + } + + return Object.defineProperty(obj, prop, { + configurable: true, + enumerable: false, + writable: true, + value: val + }); +}; diff --git a/node_modules/readdirp/node_modules/extglob/node_modules/define-property/package.json b/node_modules/readdirp/node_modules/extglob/node_modules/define-property/package.json new file mode 100644 index 000000000..d699ed015 --- /dev/null +++ b/node_modules/readdirp/node_modules/extglob/node_modules/define-property/package.json @@ -0,0 +1,93 @@ +{ + "_from": "define-property@^1.0.0", + "_id": "define-property@1.0.0", + "_inBundle": false, + "_integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "_location": "/readdirp/extglob/define-property", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "define-property@^1.0.0", + "name": "define-property", + "escapedName": "define-property", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/readdirp/extglob" + ], + "_resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "_shasum": "769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6", + "_spec": "define-property@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/extglob", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/define-property/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "deprecated": false, + "description": "Define a non-enumerable property on an object.", + "devDependencies": { + "gulp-format-md": "^0.1.12", + "mocha": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/define-property", + "keywords": [ + "define", + "define-property", + "enumerable", + "key", + "non", + "non-enumerable", + "object", + "prop", + "property", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "define-property", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/define-property.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "extend-shallow", + "merge-deep", + "assign-deep", + "mixin-deep" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.0" +} diff --git a/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/LICENSE b/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/LICENSE new file mode 100644 index 000000000..fa30c4cb3 --- /dev/null +++ b/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/README.md b/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/README.md new file mode 100644 index 000000000..cdc45d4ff --- /dev/null +++ b/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/README.md @@ -0,0 +1,61 @@ +# extend-shallow [![NPM version](https://badge.fury.io/js/extend-shallow.svg)](http://badge.fury.io/js/extend-shallow) [![Build Status](https://travis-ci.org/jonschlinkert/extend-shallow.svg)](https://travis-ci.org/jonschlinkert/extend-shallow) + +> Extend an object with the properties of additional objects. node.js/javascript util. + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i extend-shallow --save +``` + +## Usage + +```js +var extend = require('extend-shallow'); + +extend({a: 'b'}, {c: 'd'}) +//=> {a: 'b', c: 'd'} +``` + +Pass an empty object to shallow clone: + +```js +var obj = {}; +extend(obj, {a: 'b'}, {c: 'd'}) +//=> {a: 'b', c: 'd'} +``` + +## Related + +* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. +* [for-own](https://github.com/jonschlinkert/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) +* [for-in](https://github.com/jonschlinkert/for-in): Iterate over the own and inherited enumerable properties of an objecte, and return an object… [more](https://github.com/jonschlinkert/for-in) +* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor. +* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null. +* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value. + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 29, 2015._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/index.js b/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/index.js new file mode 100644 index 000000000..92a067fcc --- /dev/null +++ b/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/index.js @@ -0,0 +1,33 @@ +'use strict'; + +var isObject = require('is-extendable'); + +module.exports = function extend(o/*, objects*/) { + if (!isObject(o)) { o = {}; } + + var len = arguments.length; + for (var i = 1; i < len; i++) { + var obj = arguments[i]; + + if (isObject(obj)) { + assign(o, obj); + } + } + return o; +}; + +function assign(a, b) { + for (var key in b) { + if (hasOwn(b, key)) { + a[key] = b[key]; + } + } +} + +/** + * Returns true if the given `key` is an own property of `obj`. + */ + +function hasOwn(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} diff --git a/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/package.json b/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/package.json new file mode 100644 index 000000000..2b61ad110 --- /dev/null +++ b/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/package.json @@ -0,0 +1,87 @@ +{ + "_from": "extend-shallow@^2.0.1", + "_id": "extend-shallow@2.0.1", + "_inBundle": false, + "_integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "_location": "/readdirp/extglob/extend-shallow", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "extend-shallow@^2.0.1", + "name": "extend-shallow", + "escapedName": "extend-shallow", + "rawSpec": "^2.0.1", + "saveSpec": null, + "fetchSpec": "^2.0.1" + }, + "_requiredBy": [ + "/readdirp/extglob" + ], + "_resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "_shasum": "51af7d614ad9a9f610ea1bafbb989d6b1c56890f", + "_spec": "extend-shallow@^2.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/extglob", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/extend-shallow/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "deprecated": false, + "description": "Extend an object with the properties of additional objects. node.js/javascript util.", + "devDependencies": { + "array-slice": "^0.2.3", + "benchmarked": "^0.1.4", + "chalk": "^1.0.0", + "for-own": "^0.1.3", + "glob": "^5.0.12", + "is-plain-object": "^2.0.1", + "kind-of": "^2.0.0", + "minimist": "^1.1.1", + "mocha": "^2.2.5", + "should": "^7.0.1" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/extend-shallow", + "keywords": [ + "assign", + "extend", + "javascript", + "js", + "keys", + "merge", + "obj", + "object", + "prop", + "properties", + "property", + "props", + "shallow", + "util", + "utility", + "utils", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "extend-shallow", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/extend-shallow.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "2.0.1" +} diff --git a/node_modules/readdirp/node_modules/extglob/package.json b/node_modules/readdirp/node_modules/extglob/package.json new file mode 100644 index 000000000..6e4b78b7c --- /dev/null +++ b/node_modules/readdirp/node_modules/extglob/package.json @@ -0,0 +1,160 @@ +{ + "_from": "extglob@^2.0.4", + "_id": "extglob@2.0.4", + "_inBundle": false, + "_integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "_location": "/readdirp/extglob", + "_phantomChildren": { + "is-descriptor": "1.0.2", + "is-extendable": "0.1.1" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "extglob@^2.0.4", + "name": "extglob", + "escapedName": "extglob", + "rawSpec": "^2.0.4", + "saveSpec": null, + "fetchSpec": "^2.0.4" + }, + "_requiredBy": [ + "/readdirp/micromatch" + ], + "_resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "_shasum": "ad00fe4dc612a9232e8718711dc5cb5ab0285543", + "_spec": "extglob@^2.0.4", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/micromatch/extglob/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Devon Govett", + "url": "http://badassjs.com" + }, + { + "name": "Isiah Meadows", + "url": "https://www.isiahmeadows.com" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Matt Bierner", + "url": "http://mattbierner.com" + }, + { + "name": "Shinnosuke Watanabe", + "url": "https://shinnn.github.io" + } + ], + "dependencies": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "deprecated": false, + "description": "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.", + "devDependencies": { + "bash-match": "^1.0.2", + "for-own": "^1.0.0", + "gulp": "^3.9.1", + "gulp-eslint": "^4.0.0", + "gulp-format-md": "^1.0.0", + "gulp-istanbul": "^1.1.2", + "gulp-mocha": "^3.0.1", + "gulp-unused": "^0.2.1", + "helper-changelog": "^0.3.0", + "is-windows": "^1.0.1", + "micromatch": "^3.0.4", + "minimatch": "^3.0.4", + "minimist": "^1.2.0", + "mocha": "^3.5.0", + "multimatch": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "lib" + ], + "homepage": "https://github.com/micromatch/extglob", + "keywords": [ + "bash", + "extended", + "extglob", + "glob", + "globbing", + "ksh", + "match", + "pattern", + "patterns", + "regex", + "test", + "wildcard" + ], + "license": "MIT", + "lintDeps": { + "devDependencies": { + "files": { + "options": { + "ignore": [ + "benchmark/**/*.js" + ] + } + } + } + }, + "main": "index.js", + "name": "extglob", + "repository": { + "type": "git", + "url": "git+https://github.com/micromatch/extglob.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "related": { + "list": [ + "braces", + "expand-brackets", + "expand-range", + "fill-range", + "micromatch" + ] + }, + "helpers": [ + "helper-changelog" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + }, + "version": "2.0.4" +} diff --git a/node_modules/readdirp/node_modules/fill-range/LICENSE b/node_modules/readdirp/node_modules/fill-range/LICENSE new file mode 100644 index 000000000..d734237bd --- /dev/null +++ b/node_modules/readdirp/node_modules/fill-range/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/fill-range/README.md b/node_modules/readdirp/node_modules/fill-range/README.md new file mode 100644 index 000000000..bc1f8a044 --- /dev/null +++ b/node_modules/readdirp/node_modules/fill-range/README.md @@ -0,0 +1,250 @@ +# fill-range [![NPM version](https://img.shields.io/npm/v/fill-range.svg?style=flat)](https://www.npmjs.com/package/fill-range) [![NPM monthly downloads](https://img.shields.io/npm/dm/fill-range.svg?style=flat)](https://npmjs.org/package/fill-range) [![NPM total downloads](https://img.shields.io/npm/dt/fill-range.svg?style=flat)](https://npmjs.org/package/fill-range) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/fill-range.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/fill-range) + +> Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex` + +## Table of Contents + +- [Install](#install) +- [Usage](#usage) +- [Examples](#examples) +- [Options](#options) + * [options.step](#optionsstep) + * [options.strictRanges](#optionsstrictranges) + * [options.stringify](#optionsstringify) + * [options.toRegex](#optionstoregex) + * [options.transform](#optionstransform) +- [About](#about) + +_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save fill-range +``` + +Install with [yarn](https://yarnpkg.com): + +```sh +$ yarn add fill-range +``` + +## Usage + +Expands numbers and letters, optionally using a `step` as the last argument. _(Numbers may be defined as JavaScript numbers or strings)_. + +```js +var fill = require('fill-range'); +fill(from, to[, step, options]); + +// examples +console.log(fill('1', '10')); //=> '[ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10' ]' +console.log(fill('1', '10', {toRegex: true})); //=> [1-9]|10 +``` + +**Params** + +* `from`: **{String|Number}** the number or letter to start with +* `to`: **{String|Number}** the number or letter to end with +* `step`: **{String|Number|Object|Function}** Optionally pass a [step](#optionsstep) to use. +* `options`: **{Object|Function}**: See all available [options](#options) + +## Examples + +By default, an array of values is returned. + +**Alphabetical ranges** + +```js +console.log(fill('a', 'e')); //=> ['a', 'b', 'c', 'd', 'e'] +console.log(fill('A', 'E')); //=> [ 'A', 'B', 'C', 'D', 'E' ] +``` + +**Numerical ranges** + +Numbers can be defined as actual numbers or strings. + +```js +console.log(fill(1, 5)); //=> [ 1, 2, 3, 4, 5 ] +console.log(fill('1', '5')); //=> [ 1, 2, 3, 4, 5 ] +``` + +**Negative ranges** + +Numbers can be defined as actual numbers or strings. + +```js +console.log(fill('-5', '-1')); //=> [ '-5', '-4', '-3', '-2', '-1' ] +console.log(fill('-5', '5')); //=> [ '-5', '-4', '-3', '-2', '-1', '0', '1', '2', '3', '4', '5' ] +``` + +**Steps (increments)** + +```js +// numerical ranges with increments +console.log(fill('0', '25', 4)); //=> [ '0', '4', '8', '12', '16', '20', '24' ] +console.log(fill('0', '25', 5)); //=> [ '0', '5', '10', '15', '20', '25' ] +console.log(fill('0', '25', 6)); //=> [ '0', '6', '12', '18', '24' ] + +// alphabetical ranges with increments +console.log(fill('a', 'z', 4)); //=> [ 'a', 'e', 'i', 'm', 'q', 'u', 'y' ] +console.log(fill('a', 'z', 5)); //=> [ 'a', 'f', 'k', 'p', 'u', 'z' ] +console.log(fill('a', 'z', 6)); //=> [ 'a', 'g', 'm', 's', 'y' ] +``` + +## Options + +### options.step + +**Type**: `number` (formatted as a string or number) + +**Default**: `undefined` + +**Description**: The increment to use for the range. Can be used with letters or numbers. + +**Example(s)** + +```js +// numbers +console.log(fill('1', '10', 2)); //=> [ '1', '3', '5', '7', '9' ] +console.log(fill('1', '10', 3)); //=> [ '1', '4', '7', '10' ] +console.log(fill('1', '10', 4)); //=> [ '1', '5', '9' ] + +// letters +console.log(fill('a', 'z', 5)); //=> [ 'a', 'f', 'k', 'p', 'u', 'z' ] +console.log(fill('a', 'z', 7)); //=> [ 'a', 'h', 'o', 'v' ] +console.log(fill('a', 'z', 9)); //=> [ 'a', 'j', 's' ] +``` + +### options.strictRanges + +**Type**: `boolean` + +**Default**: `false` + +**Description**: By default, `null` is returned when an invalid range is passed. Enable this option to throw a `RangeError` on invalid ranges. + +**Example(s)** + +The following are all invalid: + +```js +fill('1.1', '2'); // decimals not supported in ranges +fill('a', '2'); // incompatible range values +fill(1, 10, 'foo'); // invalid "step" argument +``` + +### options.stringify + +**Type**: `boolean` + +**Default**: `undefined` + +**Description**: Cast all returned values to strings. By default, integers are returned as numbers. + +**Example(s)** + +```js +console.log(fill(1, 5)); //=> [ 1, 2, 3, 4, 5 ] +console.log(fill(1, 5, {stringify: true})); //=> [ '1', '2', '3', '4', '5' ] +``` + +### options.toRegex + +**Type**: `boolean` + +**Default**: `undefined` + +**Description**: Create a regex-compatible source string, instead of expanding values to an array. + +**Example(s)** + +```js +// alphabetical range +console.log(fill('a', 'e', {toRegex: true})); //=> '[a-e]' +// alphabetical with step +console.log(fill('a', 'z', 3, {toRegex: true})); //=> 'a|d|g|j|m|p|s|v|y' +// numerical range +console.log(fill('1', '100', {toRegex: true})); //=> '[1-9]|[1-9][0-9]|100' +// numerical range with zero padding +console.log(fill('000001', '100000', {toRegex: true})); +//=> '0{5}[1-9]|0{4}[1-9][0-9]|0{3}[1-9][0-9]{2}|0{2}[1-9][0-9]{3}|0[1-9][0-9]{4}|100000' +``` + +### options.transform + +**Type**: `function` + +**Default**: `undefined` + +**Description**: Customize each value in the returned array (or [string](#optionstoRegex)). _(you can also pass this function as the last argument to `fill()`)_. + +**Example(s)** + +```js +// increase padding by two +var arr = fill('01', '05', function(val, a, b, step, idx, arr, options) { + return repeat('0', (options.maxLength + 2) - val.length) + val; +}); + +console.log(arr); +//=> ['0001', '0002', '0003', '0004', '0005'] +``` + +## About + +### Related projects + +* [braces](https://www.npmjs.com/package/braces): Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces… [more](https://github.com/jonschlinkert/braces) | [homepage](https://github.com/jonschlinkert/braces "Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces specification, without sacrificing speed.") +* [expand-range](https://www.npmjs.com/package/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See… [more](https://github.com/jonschlinkert/expand-range) | [homepage](https://github.com/jonschlinkert/expand-range "Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See the benchmarks. Used by micromatch.") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") +* [to-regex-range](https://www.npmjs.com/package/to-regex-range): Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than… [more](https://github.com/jonschlinkert/to-regex-range) | [homepage](https://github.com/jonschlinkert/to-regex-range "Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.87 million test assertions.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 103 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [paulmillr](https://github.com/paulmillr) | +| 1 | [edorivai](https://github.com/edorivai) | +| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 23, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/fill-range/index.js b/node_modules/readdirp/node_modules/fill-range/index.js new file mode 100644 index 000000000..294a2edde --- /dev/null +++ b/node_modules/readdirp/node_modules/fill-range/index.js @@ -0,0 +1,208 @@ +/*! + * fill-range + * + * Copyright (c) 2014-2015, 2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var util = require('util'); +var isNumber = require('is-number'); +var extend = require('extend-shallow'); +var repeat = require('repeat-string'); +var toRegex = require('to-regex-range'); + +/** + * Return a range of numbers or letters. + * + * @param {String} `start` Start of the range + * @param {String} `stop` End of the range + * @param {String} `step` Increment or decrement to use. + * @param {Function} `fn` Custom function to modify each element in the range. + * @return {Array} + */ + +function fillRange(start, stop, step, options) { + if (typeof start === 'undefined') { + return []; + } + + if (typeof stop === 'undefined' || start === stop) { + // special case, for handling negative zero + var isString = typeof start === 'string'; + if (isNumber(start) && !toNumber(start)) { + return [isString ? '0' : 0]; + } + return [start]; + } + + if (typeof step !== 'number' && typeof step !== 'string') { + options = step; + step = undefined; + } + + if (typeof options === 'function') { + options = { transform: options }; + } + + var opts = extend({step: step}, options); + if (opts.step && !isValidNumber(opts.step)) { + if (opts.strictRanges === true) { + throw new TypeError('expected options.step to be a number'); + } + return []; + } + + opts.isNumber = isValidNumber(start) && isValidNumber(stop); + if (!opts.isNumber && !isValid(start, stop)) { + if (opts.strictRanges === true) { + throw new RangeError('invalid range arguments: ' + util.inspect([start, stop])); + } + return []; + } + + opts.isPadded = isPadded(start) || isPadded(stop); + opts.toString = opts.stringify + || typeof opts.step === 'string' + || typeof start === 'string' + || typeof stop === 'string' + || !opts.isNumber; + + if (opts.isPadded) { + opts.maxLength = Math.max(String(start).length, String(stop).length); + } + + // support legacy minimatch/fill-range options + if (typeof opts.optimize === 'boolean') opts.toRegex = opts.optimize; + if (typeof opts.makeRe === 'boolean') opts.toRegex = opts.makeRe; + return expand(start, stop, opts); +} + +function expand(start, stop, options) { + var a = options.isNumber ? toNumber(start) : start.charCodeAt(0); + var b = options.isNumber ? toNumber(stop) : stop.charCodeAt(0); + + var step = Math.abs(toNumber(options.step)) || 1; + if (options.toRegex && step === 1) { + return toRange(a, b, start, stop, options); + } + + var zero = {greater: [], lesser: []}; + var asc = a < b; + var arr = new Array(Math.round((asc ? b - a : a - b) / step)); + var idx = 0; + + while (asc ? a <= b : a >= b) { + var val = options.isNumber ? a : String.fromCharCode(a); + if (options.toRegex && (val >= 0 || !options.isNumber)) { + zero.greater.push(val); + } else { + zero.lesser.push(Math.abs(val)); + } + + if (options.isPadded) { + val = zeros(val, options); + } + + if (options.toString) { + val = String(val); + } + + if (typeof options.transform === 'function') { + arr[idx++] = options.transform(val, a, b, step, idx, arr, options); + } else { + arr[idx++] = val; + } + + if (asc) { + a += step; + } else { + a -= step; + } + } + + if (options.toRegex === true) { + return toSequence(arr, zero, options); + } + return arr; +} + +function toRange(a, b, start, stop, options) { + if (options.isPadded) { + return toRegex(start, stop, options); + } + + if (options.isNumber) { + return toRegex(Math.min(a, b), Math.max(a, b), options); + } + + var start = String.fromCharCode(Math.min(a, b)); + var stop = String.fromCharCode(Math.max(a, b)); + return '[' + start + '-' + stop + ']'; +} + +function toSequence(arr, zeros, options) { + var greater = '', lesser = ''; + if (zeros.greater.length) { + greater = zeros.greater.join('|'); + } + if (zeros.lesser.length) { + lesser = '-(' + zeros.lesser.join('|') + ')'; + } + var res = greater && lesser + ? greater + '|' + lesser + : greater || lesser; + + if (options.capture) { + return '(' + res + ')'; + } + return res; +} + +function zeros(val, options) { + if (options.isPadded) { + var str = String(val); + var len = str.length; + var dash = ''; + if (str.charAt(0) === '-') { + dash = '-'; + str = str.slice(1); + } + var diff = options.maxLength - len; + var pad = repeat('0', diff); + val = (dash + pad + str); + } + if (options.stringify) { + return String(val); + } + return val; +} + +function toNumber(val) { + return Number(val) || 0; +} + +function isPadded(str) { + return /^-?0\d/.test(str); +} + +function isValid(min, max) { + return (isValidNumber(min) || isValidLetter(min)) + && (isValidNumber(max) || isValidLetter(max)); +} + +function isValidLetter(ch) { + return typeof ch === 'string' && ch.length === 1 && /^\w+$/.test(ch); +} + +function isValidNumber(n) { + return isNumber(n) && !/\./.test(n); +} + +/** + * Expose `fillRange` + * @type {Function} + */ + +module.exports = fillRange; diff --git a/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/LICENSE b/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/LICENSE new file mode 100644 index 000000000..fa30c4cb3 --- /dev/null +++ b/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/README.md b/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/README.md new file mode 100644 index 000000000..cdc45d4ff --- /dev/null +++ b/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/README.md @@ -0,0 +1,61 @@ +# extend-shallow [![NPM version](https://badge.fury.io/js/extend-shallow.svg)](http://badge.fury.io/js/extend-shallow) [![Build Status](https://travis-ci.org/jonschlinkert/extend-shallow.svg)](https://travis-ci.org/jonschlinkert/extend-shallow) + +> Extend an object with the properties of additional objects. node.js/javascript util. + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i extend-shallow --save +``` + +## Usage + +```js +var extend = require('extend-shallow'); + +extend({a: 'b'}, {c: 'd'}) +//=> {a: 'b', c: 'd'} +``` + +Pass an empty object to shallow clone: + +```js +var obj = {}; +extend(obj, {a: 'b'}, {c: 'd'}) +//=> {a: 'b', c: 'd'} +``` + +## Related + +* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. +* [for-own](https://github.com/jonschlinkert/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) +* [for-in](https://github.com/jonschlinkert/for-in): Iterate over the own and inherited enumerable properties of an objecte, and return an object… [more](https://github.com/jonschlinkert/for-in) +* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor. +* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null. +* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value. + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 29, 2015._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/index.js b/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/index.js new file mode 100644 index 000000000..92a067fcc --- /dev/null +++ b/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/index.js @@ -0,0 +1,33 @@ +'use strict'; + +var isObject = require('is-extendable'); + +module.exports = function extend(o/*, objects*/) { + if (!isObject(o)) { o = {}; } + + var len = arguments.length; + for (var i = 1; i < len; i++) { + var obj = arguments[i]; + + if (isObject(obj)) { + assign(o, obj); + } + } + return o; +}; + +function assign(a, b) { + for (var key in b) { + if (hasOwn(b, key)) { + a[key] = b[key]; + } + } +} + +/** + * Returns true if the given `key` is an own property of `obj`. + */ + +function hasOwn(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} diff --git a/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/package.json b/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/package.json new file mode 100644 index 000000000..7ff07ce88 --- /dev/null +++ b/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/package.json @@ -0,0 +1,87 @@ +{ + "_from": "extend-shallow@^2.0.1", + "_id": "extend-shallow@2.0.1", + "_inBundle": false, + "_integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "_location": "/readdirp/fill-range/extend-shallow", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "extend-shallow@^2.0.1", + "name": "extend-shallow", + "escapedName": "extend-shallow", + "rawSpec": "^2.0.1", + "saveSpec": null, + "fetchSpec": "^2.0.1" + }, + "_requiredBy": [ + "/readdirp/fill-range" + ], + "_resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "_shasum": "51af7d614ad9a9f610ea1bafbb989d6b1c56890f", + "_spec": "extend-shallow@^2.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/fill-range", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/extend-shallow/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "deprecated": false, + "description": "Extend an object with the properties of additional objects. node.js/javascript util.", + "devDependencies": { + "array-slice": "^0.2.3", + "benchmarked": "^0.1.4", + "chalk": "^1.0.0", + "for-own": "^0.1.3", + "glob": "^5.0.12", + "is-plain-object": "^2.0.1", + "kind-of": "^2.0.0", + "minimist": "^1.1.1", + "mocha": "^2.2.5", + "should": "^7.0.1" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/extend-shallow", + "keywords": [ + "assign", + "extend", + "javascript", + "js", + "keys", + "merge", + "obj", + "object", + "prop", + "properties", + "property", + "props", + "shallow", + "util", + "utility", + "utils", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "extend-shallow", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/extend-shallow.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "2.0.1" +} diff --git a/node_modules/readdirp/node_modules/fill-range/package.json b/node_modules/readdirp/node_modules/fill-range/package.json new file mode 100644 index 000000000..fc5fea9ae --- /dev/null +++ b/node_modules/readdirp/node_modules/fill-range/package.json @@ -0,0 +1,130 @@ +{ + "_from": "fill-range@^4.0.0", + "_id": "fill-range@4.0.0", + "_inBundle": false, + "_integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "_location": "/readdirp/fill-range", + "_phantomChildren": { + "is-extendable": "0.1.1" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "fill-range@^4.0.0", + "name": "fill-range", + "escapedName": "fill-range", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/readdirp/braces" + ], + "_resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "_shasum": "d544811d428f98eb06a63dc402d2403c328c38f7", + "_spec": "fill-range@^4.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/braces", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/fill-range/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "email": "wtgtybhertgeghgtwtg@gmail.com", + "url": "https://github.com/wtgtybhertgeghgtwtg" + }, + { + "name": "Edo Rivai", + "email": "edo.rivai@gmail.com", + "url": "edo.rivai.nl" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Paul Miller", + "email": "paul+gh@paulmillr.com", + "url": "paulmillr.com" + } + ], + "dependencies": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "deprecated": false, + "description": "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`", + "devDependencies": { + "ansi-cyan": "^0.1.1", + "benchmarked": "^1.0.0", + "gulp-format-md": "^0.1.12", + "minimist": "^1.2.0", + "mocha": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/fill-range", + "keywords": [ + "alpha", + "alphabetical", + "array", + "bash", + "brace", + "expand", + "expansion", + "fill", + "glob", + "match", + "matches", + "matching", + "number", + "numerical", + "range", + "ranges", + "regex", + "sh" + ], + "license": "MIT", + "main": "index.js", + "name": "fill-range", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/fill-range.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "braces", + "expand-range", + "micromatch", + "to-regex-range" + ] + }, + "toc": true, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + }, + "version": "4.0.0" +} diff --git a/node_modules/readdirp/node_modules/is-accessor-descriptor/LICENSE b/node_modules/readdirp/node_modules/is-accessor-descriptor/LICENSE new file mode 100644 index 000000000..e33d14b75 --- /dev/null +++ b/node_modules/readdirp/node_modules/is-accessor-descriptor/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/is-accessor-descriptor/README.md b/node_modules/readdirp/node_modules/is-accessor-descriptor/README.md new file mode 100644 index 000000000..d198e1f05 --- /dev/null +++ b/node_modules/readdirp/node_modules/is-accessor-descriptor/README.md @@ -0,0 +1,144 @@ +# is-accessor-descriptor [![NPM version](https://img.shields.io/npm/v/is-accessor-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-accessor-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-accessor-descriptor.svg?style=flat)](https://npmjs.org/package/is-accessor-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-accessor-descriptor.svg?style=flat)](https://npmjs.org/package/is-accessor-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-accessor-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-accessor-descriptor) + +> Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-accessor-descriptor +``` + +## Usage + +```js +var isAccessor = require('is-accessor-descriptor'); + +isAccessor({get: function() {}}); +//=> true +``` + +You may also pass an object and property name to check if the property is an accessor: + +```js +isAccessor(foo, 'bar'); +``` + +## Examples + +`false` when not an object + +```js +isAccessor('a') +isAccessor(null) +isAccessor([]) +//=> false +``` + +`true` when the object has valid properties + +and the properties all have the correct JavaScript types: + +```js +isAccessor({get: noop, set: noop}) +isAccessor({get: noop}) +isAccessor({set: noop}) +//=> true +``` + +`false` when the object has invalid properties + +```js +isAccessor({get: noop, set: noop, bar: 'baz'}) +isAccessor({get: noop, writable: true}) +isAccessor({get: noop, value: true}) +//=> false +``` + +`false` when an accessor is not a function + +```js +isAccessor({get: noop, set: 'baz'}) +isAccessor({get: 'foo', set: noop}) +isAccessor({get: 'foo', bar: 'baz'}) +isAccessor({get: 'foo', set: 'baz'}) +//=> false +``` + +`false` when a value is not the correct type + +```js +isAccessor({get: noop, set: noop, enumerable: 'foo'}) +isAccessor({set: noop, configurable: 'foo'}) +isAccessor({get: noop, configurable: 'foo'}) +//=> false +``` + +## About + +
    +Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
    + +
    +Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
    + +
    +Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
    + +### Related projects + +You might also be interested in these projects: + +* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.") +* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.") +* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.") +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 22 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [realityking](https://github.com/realityking) | + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on November 01, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/is-accessor-descriptor/index.js b/node_modules/readdirp/node_modules/is-accessor-descriptor/index.js new file mode 100644 index 000000000..d2e6fe8b9 --- /dev/null +++ b/node_modules/readdirp/node_modules/is-accessor-descriptor/index.js @@ -0,0 +1,69 @@ +/*! + * is-accessor-descriptor + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var typeOf = require('kind-of'); + +// accessor descriptor properties +var accessor = { + get: 'function', + set: 'function', + configurable: 'boolean', + enumerable: 'boolean' +}; + +function isAccessorDescriptor(obj, prop) { + if (typeof prop === 'string') { + var val = Object.getOwnPropertyDescriptor(obj, prop); + return typeof val !== 'undefined'; + } + + if (typeOf(obj) !== 'object') { + return false; + } + + if (has(obj, 'value') || has(obj, 'writable')) { + return false; + } + + if (!has(obj, 'get') || typeof obj.get !== 'function') { + return false; + } + + // tldr: it's valid to have "set" be undefined + // "set" might be undefined if `Object.getOwnPropertyDescriptor` + // was used to get the value, and only `get` was defined by the user + if (has(obj, 'set') && typeof obj[key] !== 'function' && typeof obj[key] !== 'undefined') { + return false; + } + + for (var key in obj) { + if (!accessor.hasOwnProperty(key)) { + continue; + } + + if (typeOf(obj[key]) === accessor[key]) { + continue; + } + + if (typeof obj[key] !== 'undefined') { + return false; + } + } + return true; +} + +function has(obj, key) { + return {}.hasOwnProperty.call(obj, key); +} + +/** + * Expose `isAccessorDescriptor` + */ + +module.exports = isAccessorDescriptor; diff --git a/node_modules/readdirp/node_modules/is-accessor-descriptor/package.json b/node_modules/readdirp/node_modules/is-accessor-descriptor/package.json new file mode 100644 index 000000000..f159b1ce9 --- /dev/null +++ b/node_modules/readdirp/node_modules/is-accessor-descriptor/package.json @@ -0,0 +1,110 @@ +{ + "_from": "is-accessor-descriptor@^1.0.0", + "_id": "is-accessor-descriptor@1.0.0", + "_inBundle": false, + "_integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "_location": "/readdirp/is-accessor-descriptor", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-accessor-descriptor@^1.0.0", + "name": "is-accessor-descriptor", + "escapedName": "is-accessor-descriptor", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/readdirp/is-descriptor" + ], + "_resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "_shasum": "169c2f6d3df1f992618072365c9b0ea1f6878656", + "_spec": "is-accessor-descriptor@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/is-descriptor", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-accessor-descriptor/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Rouven Weßling", + "url": "www.rouvenwessling.de" + } + ], + "dependencies": { + "kind-of": "^6.0.0" + }, + "deprecated": false, + "description": "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.5.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-accessor-descriptor", + "keywords": [ + "accessor", + "check", + "data", + "descriptor", + "get", + "getter", + "is", + "keys", + "object", + "properties", + "property", + "set", + "setter", + "type", + "valid", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "is-accessor-descriptor", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-accessor-descriptor.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "is-accessor-descriptor", + "is-data-descriptor", + "is-descriptor", + "is-plain-object", + "isobject" + ] + }, + "lint": { + "reflinks": true + } + }, + "version": "1.0.0" +} diff --git a/node_modules/readdirp/node_modules/is-data-descriptor/LICENSE b/node_modules/readdirp/node_modules/is-data-descriptor/LICENSE new file mode 100644 index 000000000..e33d14b75 --- /dev/null +++ b/node_modules/readdirp/node_modules/is-data-descriptor/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/is-data-descriptor/README.md b/node_modules/readdirp/node_modules/is-data-descriptor/README.md new file mode 100644 index 000000000..42b071446 --- /dev/null +++ b/node_modules/readdirp/node_modules/is-data-descriptor/README.md @@ -0,0 +1,161 @@ +# is-data-descriptor [![NPM version](https://img.shields.io/npm/v/is-data-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-data-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-data-descriptor.svg?style=flat)](https://npmjs.org/package/is-data-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-data-descriptor.svg?style=flat)](https://npmjs.org/package/is-data-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-data-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-data-descriptor) + +> Returns true if a value has the characteristics of a valid JavaScript data descriptor. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-data-descriptor +``` + +## Usage + +```js +var isDataDesc = require('is-data-descriptor'); +``` + +## Examples + +`true` when the descriptor has valid properties with valid values. + +```js +// `value` can be anything +isDataDesc({value: 'foo'}) +isDataDesc({value: function() {}}) +isDataDesc({value: true}) +//=> true +``` + +`false` when not an object + +```js +isDataDesc('a') +//=> false +isDataDesc(null) +//=> false +isDataDesc([]) +//=> false +``` + +`false` when the object has invalid properties + +```js +isDataDesc({value: 'foo', bar: 'baz'}) +//=> false +isDataDesc({value: 'foo', bar: 'baz'}) +//=> false +isDataDesc({value: 'foo', get: function(){}}) +//=> false +isDataDesc({get: function(){}, value: 'foo'}) +//=> false +``` + +`false` when a value is not the correct type + +```js +isDataDesc({value: 'foo', enumerable: 'foo'}) +//=> false +isDataDesc({value: 'foo', configurable: 'foo'}) +//=> false +isDataDesc({value: 'foo', writable: 'foo'}) +//=> false +``` + +## Valid properties + +The only valid data descriptor properties are the following: + +* `configurable` (required) +* `enumerable` (required) +* `value` (optional) +* `writable` (optional) + +To be a valid data descriptor, either `value` or `writable` must be defined. + +**Invalid properties** + +A descriptor may have additional _invalid_ properties (an error will **not** be thrown). + +```js +var foo = {}; + +Object.defineProperty(foo, 'bar', { + enumerable: true, + whatever: 'blah', // invalid, but doesn't cause an error + get: function() { + return 'baz'; + } +}); + +console.log(foo.bar); +//=> 'baz' +``` + +## About + +
    +Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
    + +
    +Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
    + +
    +Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
    + +### Related projects + +You might also be interested in these projects: + +* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.") +* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.") +* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 21 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [realityking](https://github.com/realityking) | + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on November 01, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/is-data-descriptor/index.js b/node_modules/readdirp/node_modules/is-data-descriptor/index.js new file mode 100644 index 000000000..cfeae3619 --- /dev/null +++ b/node_modules/readdirp/node_modules/is-data-descriptor/index.js @@ -0,0 +1,49 @@ +/*! + * is-data-descriptor + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var typeOf = require('kind-of'); + +module.exports = function isDataDescriptor(obj, prop) { + // data descriptor properties + var data = { + configurable: 'boolean', + enumerable: 'boolean', + writable: 'boolean' + }; + + if (typeOf(obj) !== 'object') { + return false; + } + + if (typeof prop === 'string') { + var val = Object.getOwnPropertyDescriptor(obj, prop); + return typeof val !== 'undefined'; + } + + if (!('value' in obj) && !('writable' in obj)) { + return false; + } + + for (var key in obj) { + if (key === 'value') continue; + + if (!data.hasOwnProperty(key)) { + continue; + } + + if (typeOf(obj[key]) === data[key]) { + continue; + } + + if (typeof obj[key] !== 'undefined') { + return false; + } + } + return true; +}; diff --git a/node_modules/readdirp/node_modules/is-data-descriptor/package.json b/node_modules/readdirp/node_modules/is-data-descriptor/package.json new file mode 100644 index 000000000..6d3cbab24 --- /dev/null +++ b/node_modules/readdirp/node_modules/is-data-descriptor/package.json @@ -0,0 +1,109 @@ +{ + "_from": "is-data-descriptor@^1.0.0", + "_id": "is-data-descriptor@1.0.0", + "_inBundle": false, + "_integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "_location": "/readdirp/is-data-descriptor", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-data-descriptor@^1.0.0", + "name": "is-data-descriptor", + "escapedName": "is-data-descriptor", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/readdirp/is-descriptor" + ], + "_resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "_shasum": "d84876321d0e7add03990406abbbbd36ba9268c7", + "_spec": "is-data-descriptor@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/is-descriptor", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-data-descriptor/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Rouven Weßling", + "url": "www.rouvenwessling.de" + } + ], + "dependencies": { + "kind-of": "^6.0.0" + }, + "deprecated": false, + "description": "Returns true if a value has the characteristics of a valid JavaScript data descriptor.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.5.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-data-descriptor", + "keywords": [ + "accessor", + "check", + "data", + "descriptor", + "get", + "getter", + "is", + "keys", + "object", + "properties", + "property", + "set", + "setter", + "type", + "valid", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "is-data-descriptor", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-data-descriptor.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "is-accessor-descriptor", + "is-data-descriptor", + "is-descriptor", + "isobject" + ] + }, + "lint": { + "reflinks": true + } + }, + "version": "1.0.0" +} diff --git a/node_modules/readdirp/node_modules/is-descriptor/LICENSE b/node_modules/readdirp/node_modules/is-descriptor/LICENSE new file mode 100644 index 000000000..c0d7f1362 --- /dev/null +++ b/node_modules/readdirp/node_modules/is-descriptor/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert. + +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. \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/is-descriptor/README.md b/node_modules/readdirp/node_modules/is-descriptor/README.md new file mode 100644 index 000000000..658e53301 --- /dev/null +++ b/node_modules/readdirp/node_modules/is-descriptor/README.md @@ -0,0 +1,193 @@ +# is-descriptor [![NPM version](https://img.shields.io/npm/v/is-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-descriptor) + +> Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-descriptor +``` + +## Usage + +```js +var isDescriptor = require('is-descriptor'); + +isDescriptor({value: 'foo'}) +//=> true +isDescriptor({get: function(){}, set: function(){}}) +//=> true +isDescriptor({get: 'foo', set: function(){}}) +//=> false +``` + +You may also check for a descriptor by passing an object as the first argument and property name (`string`) as the second argument. + +```js +var obj = {}; +obj.foo = 'abc'; + +Object.defineProperty(obj, 'bar', { + value: 'xyz' +}); + +isDescriptor(obj, 'foo'); +//=> true +isDescriptor(obj, 'bar'); +//=> true +``` + +## Examples + +### value type + +`false` when not an object + +```js +isDescriptor('a'); +//=> false +isDescriptor(null); +//=> false +isDescriptor([]); +//=> false +``` + +### data descriptor + +`true` when the object has valid properties with valid values. + +```js +isDescriptor({value: 'foo'}); +//=> true +isDescriptor({value: noop}); +//=> true +``` + +`false` when the object has invalid properties + +```js +isDescriptor({value: 'foo', bar: 'baz'}); +//=> false +isDescriptor({value: 'foo', bar: 'baz'}); +//=> false +isDescriptor({value: 'foo', get: noop}); +//=> false +isDescriptor({get: noop, value: noop}); +//=> false +``` + +`false` when a value is not the correct type + +```js +isDescriptor({value: 'foo', enumerable: 'foo'}); +//=> false +isDescriptor({value: 'foo', configurable: 'foo'}); +//=> false +isDescriptor({value: 'foo', writable: 'foo'}); +//=> false +``` + +### accessor descriptor + +`true` when the object has valid properties with valid values. + +```js +isDescriptor({get: noop, set: noop}); +//=> true +isDescriptor({get: noop}); +//=> true +isDescriptor({set: noop}); +//=> true +``` + +`false` when the object has invalid properties + +```js +isDescriptor({get: noop, set: noop, bar: 'baz'}); +//=> false +isDescriptor({get: noop, writable: true}); +//=> false +isDescriptor({get: noop, value: true}); +//=> false +``` + +`false` when an accessor is not a function + +```js +isDescriptor({get: noop, set: 'baz'}); +//=> false +isDescriptor({get: 'foo', set: noop}); +//=> false +isDescriptor({get: 'foo', bar: 'baz'}); +//=> false +isDescriptor({get: 'foo', set: 'baz'}); +//=> false +``` + +`false` when a value is not the correct type + +```js +isDescriptor({get: noop, set: noop, enumerable: 'foo'}); +//=> false +isDescriptor({set: noop, configurable: 'foo'}); +//=> false +isDescriptor({get: noop, configurable: 'foo'}); +//=> false +``` + +## About + +### Related projects + +* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.") +* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.") +* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 24 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [doowb](https://github.com/doowb) | +| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 22, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/is-descriptor/index.js b/node_modules/readdirp/node_modules/is-descriptor/index.js new file mode 100644 index 000000000..c9b91d762 --- /dev/null +++ b/node_modules/readdirp/node_modules/is-descriptor/index.js @@ -0,0 +1,22 @@ +/*! + * is-descriptor + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var typeOf = require('kind-of'); +var isAccessor = require('is-accessor-descriptor'); +var isData = require('is-data-descriptor'); + +module.exports = function isDescriptor(obj, key) { + if (typeOf(obj) !== 'object') { + return false; + } + if ('get' in obj) { + return isAccessor(obj, key); + } + return isData(obj, key); +}; diff --git a/node_modules/readdirp/node_modules/is-descriptor/package.json b/node_modules/readdirp/node_modules/is-descriptor/package.json new file mode 100644 index 000000000..c058e6e59 --- /dev/null +++ b/node_modules/readdirp/node_modules/is-descriptor/package.json @@ -0,0 +1,114 @@ +{ + "_from": "is-descriptor@^1.0.0", + "_id": "is-descriptor@1.0.2", + "_inBundle": false, + "_integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "_location": "/readdirp/is-descriptor", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-descriptor@^1.0.0", + "name": "is-descriptor", + "escapedName": "is-descriptor", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/readdirp/extglob/define-property" + ], + "_resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "_shasum": "3b159746a66604b04f8c81524ba365c5f14d86ec", + "_spec": "is-descriptor@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/extglob/node_modules/define-property", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-descriptor/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "url": "https://github.com/wtgtybhertgeghgtwtg" + } + ], + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "deprecated": false, + "description": "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.5.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-descriptor", + "keywords": [ + "accessor", + "check", + "data", + "descriptor", + "get", + "getter", + "is", + "keys", + "object", + "properties", + "property", + "set", + "setter", + "type", + "valid", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "is-descriptor", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-descriptor.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "is-accessor-descriptor", + "is-data-descriptor", + "is-descriptor", + "isobject" + ] + }, + "plugins": [ + "gulp-format-md" + ], + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.2" +} diff --git a/node_modules/readdirp/node_modules/is-number/LICENSE b/node_modules/readdirp/node_modules/is-number/LICENSE new file mode 100644 index 000000000..842218cf0 --- /dev/null +++ b/node_modules/readdirp/node_modules/is-number/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/is-number/README.md b/node_modules/readdirp/node_modules/is-number/README.md new file mode 100644 index 000000000..281165dce --- /dev/null +++ b/node_modules/readdirp/node_modules/is-number/README.md @@ -0,0 +1,115 @@ +# is-number [![NPM version](https://img.shields.io/npm/v/is-number.svg?style=flat)](https://www.npmjs.com/package/is-number) [![NPM downloads](https://img.shields.io/npm/dm/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-number.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-number) + +> Returns true if the value is a number. comprehensive tests. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-number +``` + +## Usage + +To understand some of the rationale behind the decisions made in this library (and to learn about some oddities of number evaluation in JavaScript), [see this gist](https://gist.github.com/jonschlinkert/e30c70c713da325d0e81). + +```js +var isNumber = require('is-number'); +``` + +### true + +See the [tests](./test.js) for more examples. + +```js +isNumber(5e3) //=> 'true' +isNumber(0xff) //=> 'true' +isNumber(-1.1) //=> 'true' +isNumber(0) //=> 'true' +isNumber(1) //=> 'true' +isNumber(1.1) //=> 'true' +isNumber(10) //=> 'true' +isNumber(10.10) //=> 'true' +isNumber(100) //=> 'true' +isNumber('-1.1') //=> 'true' +isNumber('0') //=> 'true' +isNumber('012') //=> 'true' +isNumber('0xff') //=> 'true' +isNumber('1') //=> 'true' +isNumber('1.1') //=> 'true' +isNumber('10') //=> 'true' +isNumber('10.10') //=> 'true' +isNumber('100') //=> 'true' +isNumber('5e3') //=> 'true' +isNumber(parseInt('012')) //=> 'true' +isNumber(parseFloat('012')) //=> 'true' +``` + +### False + +See the [tests](./test.js) for more examples. + +```js +isNumber('foo') //=> 'false' +isNumber([1]) //=> 'false' +isNumber([]) //=> 'false' +isNumber(function () {}) //=> 'false' +isNumber(Infinity) //=> 'false' +isNumber(NaN) //=> 'false' +isNumber(new Array('abc')) //=> 'false' +isNumber(new Array(2)) //=> 'false' +isNumber(new Buffer('abc')) //=> 'false' +isNumber(null) //=> 'false' +isNumber(undefined) //=> 'false' +isNumber({abc: 'abc'}) //=> 'false' +``` + +## About + +### Related projects + +* [even](https://www.npmjs.com/package/even): Get the even numbered items from an array. | [homepage](https://github.com/jonschlinkert/even "Get the even numbered items from an array.") +* [is-even](https://www.npmjs.com/package/is-even): Return true if the given number is even. | [homepage](https://github.com/jonschlinkert/is-even "Return true if the given number is even.") +* [is-odd](https://www.npmjs.com/package/is-odd): Returns true if the given number is odd. | [homepage](https://github.com/jonschlinkert/is-odd "Returns true if the given number is odd.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") +* [odd](https://www.npmjs.com/package/odd): Get the odd numbered items from an array. | [homepage](https://github.com/jonschlinkert/odd "Get the odd numbered items from an array.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/is-number/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.30, on September 10, 2016._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/is-number/index.js b/node_modules/readdirp/node_modules/is-number/index.js new file mode 100644 index 000000000..7a2a45bed --- /dev/null +++ b/node_modules/readdirp/node_modules/is-number/index.js @@ -0,0 +1,22 @@ +/*! + * is-number + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var typeOf = require('kind-of'); + +module.exports = function isNumber(num) { + var type = typeOf(num); + + if (type === 'string') { + if (!num.trim()) return false; + } else if (type !== 'number') { + return false; + } + + return (num - num + 1) >= 0; +}; diff --git a/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/LICENSE b/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/LICENSE new file mode 100644 index 000000000..d734237bd --- /dev/null +++ b/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/README.md b/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/README.md new file mode 100644 index 000000000..6a9df36d3 --- /dev/null +++ b/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/README.md @@ -0,0 +1,261 @@ +# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) + +> Get the native type of a value. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save kind-of +``` + +## Install + +Install with [bower](https://bower.io/) + +```sh +$ bower install kind-of --save +``` + +## Usage + +> es5, browser and es6 ready + +```js +var kindOf = require('kind-of'); + +kindOf(undefined); +//=> 'undefined' + +kindOf(null); +//=> 'null' + +kindOf(true); +//=> 'boolean' + +kindOf(false); +//=> 'boolean' + +kindOf(new Boolean(true)); +//=> 'boolean' + +kindOf(new Buffer('')); +//=> 'buffer' + +kindOf(42); +//=> 'number' + +kindOf(new Number(42)); +//=> 'number' + +kindOf('str'); +//=> 'string' + +kindOf(new String('str')); +//=> 'string' + +kindOf(arguments); +//=> 'arguments' + +kindOf({}); +//=> 'object' + +kindOf(Object.create(null)); +//=> 'object' + +kindOf(new Test()); +//=> 'object' + +kindOf(new Date()); +//=> 'date' + +kindOf([]); +//=> 'array' + +kindOf([1, 2, 3]); +//=> 'array' + +kindOf(new Array()); +//=> 'array' + +kindOf(/foo/); +//=> 'regexp' + +kindOf(new RegExp('foo')); +//=> 'regexp' + +kindOf(function () {}); +//=> 'function' + +kindOf(function * () {}); +//=> 'function' + +kindOf(new Function()); +//=> 'function' + +kindOf(new Map()); +//=> 'map' + +kindOf(new WeakMap()); +//=> 'weakmap' + +kindOf(new Set()); +//=> 'set' + +kindOf(new WeakSet()); +//=> 'weakset' + +kindOf(Symbol('str')); +//=> 'symbol' + +kindOf(new Int8Array()); +//=> 'int8array' + +kindOf(new Uint8Array()); +//=> 'uint8array' + +kindOf(new Uint8ClampedArray()); +//=> 'uint8clampedarray' + +kindOf(new Int16Array()); +//=> 'int16array' + +kindOf(new Uint16Array()); +//=> 'uint16array' + +kindOf(new Int32Array()); +//=> 'int32array' + +kindOf(new Uint32Array()); +//=> 'uint32array' + +kindOf(new Float32Array()); +//=> 'float32array' + +kindOf(new Float64Array()); +//=> 'float64array' +``` + +## Benchmarks + +Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). +Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `WeakSet`. + +```bash +#1: array + current x 23,329,397 ops/sec ±0.82% (94 runs sampled) + lib-type-of x 4,170,273 ops/sec ±0.55% (94 runs sampled) + lib-typeof x 9,686,935 ops/sec ±0.59% (98 runs sampled) + +#2: boolean + current x 27,197,115 ops/sec ±0.85% (94 runs sampled) + lib-type-of x 3,145,791 ops/sec ±0.73% (97 runs sampled) + lib-typeof x 9,199,562 ops/sec ±0.44% (99 runs sampled) + +#3: date + current x 20,190,117 ops/sec ±0.86% (92 runs sampled) + lib-type-of x 5,166,970 ops/sec ±0.74% (94 runs sampled) + lib-typeof x 9,610,821 ops/sec ±0.50% (96 runs sampled) + +#4: function + current x 23,855,460 ops/sec ±0.60% (97 runs sampled) + lib-type-of x 5,667,740 ops/sec ±0.54% (100 runs sampled) + lib-typeof x 10,010,644 ops/sec ±0.44% (100 runs sampled) + +#5: null + current x 27,061,047 ops/sec ±0.97% (96 runs sampled) + lib-type-of x 13,965,573 ops/sec ±0.62% (97 runs sampled) + lib-typeof x 8,460,194 ops/sec ±0.61% (97 runs sampled) + +#6: number + current x 25,075,682 ops/sec ±0.53% (99 runs sampled) + lib-type-of x 2,266,405 ops/sec ±0.41% (98 runs sampled) + lib-typeof x 9,821,481 ops/sec ±0.45% (99 runs sampled) + +#7: object + current x 3,348,980 ops/sec ±0.49% (99 runs sampled) + lib-type-of x 3,245,138 ops/sec ±0.60% (94 runs sampled) + lib-typeof x 9,262,952 ops/sec ±0.59% (99 runs sampled) + +#8: regex + current x 21,284,827 ops/sec ±0.72% (96 runs sampled) + lib-type-of x 4,689,241 ops/sec ±0.43% (100 runs sampled) + lib-typeof x 8,957,593 ops/sec ±0.62% (98 runs sampled) + +#9: string + current x 25,379,234 ops/sec ±0.58% (96 runs sampled) + lib-type-of x 3,635,148 ops/sec ±0.76% (93 runs sampled) + lib-typeof x 9,494,134 ops/sec ±0.49% (98 runs sampled) + +#10: undef + current x 27,459,221 ops/sec ±1.01% (93 runs sampled) + lib-type-of x 14,360,433 ops/sec ±0.52% (99 runs sampled) + lib-typeof x 23,202,868 ops/sec ±0.59% (94 runs sampled) + +``` + +## Optimizations + +In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: + +1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. +2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. +3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` + +## About + +### Related projects + +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 59 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [miguelmota](https://github.com/miguelmota) | +| 1 | [dtothefp](https://github.com/dtothefp) | +| 1 | [ksheedlo](https://github.com/ksheedlo) | +| 1 | [pdehaan](https://github.com/pdehaan) | +| 1 | [laggingreflex](https://github.com/laggingreflex) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 16, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/index.js b/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/index.js new file mode 100644 index 000000000..b52c2917f --- /dev/null +++ b/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/index.js @@ -0,0 +1,116 @@ +var isBuffer = require('is-buffer'); +var toString = Object.prototype.toString; + +/** + * Get the native `typeof` a value. + * + * @param {*} `val` + * @return {*} Native javascript type + */ + +module.exports = function kindOf(val) { + // primitivies + if (typeof val === 'undefined') { + return 'undefined'; + } + if (val === null) { + return 'null'; + } + if (val === true || val === false || val instanceof Boolean) { + return 'boolean'; + } + if (typeof val === 'string' || val instanceof String) { + return 'string'; + } + if (typeof val === 'number' || val instanceof Number) { + return 'number'; + } + + // functions + if (typeof val === 'function' || val instanceof Function) { + return 'function'; + } + + // array + if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { + return 'array'; + } + + // check for instances of RegExp and Date before calling `toString` + if (val instanceof RegExp) { + return 'regexp'; + } + if (val instanceof Date) { + return 'date'; + } + + // other objects + var type = toString.call(val); + + if (type === '[object RegExp]') { + return 'regexp'; + } + if (type === '[object Date]') { + return 'date'; + } + if (type === '[object Arguments]') { + return 'arguments'; + } + if (type === '[object Error]') { + return 'error'; + } + + // buffer + if (isBuffer(val)) { + return 'buffer'; + } + + // es6: Map, WeakMap, Set, WeakSet + if (type === '[object Set]') { + return 'set'; + } + if (type === '[object WeakSet]') { + return 'weakset'; + } + if (type === '[object Map]') { + return 'map'; + } + if (type === '[object WeakMap]') { + return 'weakmap'; + } + if (type === '[object Symbol]') { + return 'symbol'; + } + + // typed arrays + if (type === '[object Int8Array]') { + return 'int8array'; + } + if (type === '[object Uint8Array]') { + return 'uint8array'; + } + if (type === '[object Uint8ClampedArray]') { + return 'uint8clampedarray'; + } + if (type === '[object Int16Array]') { + return 'int16array'; + } + if (type === '[object Uint16Array]') { + return 'uint16array'; + } + if (type === '[object Int32Array]') { + return 'int32array'; + } + if (type === '[object Uint32Array]') { + return 'uint32array'; + } + if (type === '[object Float32Array]') { + return 'float32array'; + } + if (type === '[object Float64Array]') { + return 'float64array'; + } + + // must be a plain object + return 'object'; +}; diff --git a/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/package.json b/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/package.json new file mode 100644 index 000000000..c2712ca74 --- /dev/null +++ b/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/package.json @@ -0,0 +1,139 @@ +{ + "_from": "kind-of@^3.0.2", + "_id": "kind-of@3.2.2", + "_inBundle": false, + "_integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "_location": "/readdirp/is-number/kind-of", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "kind-of@^3.0.2", + "name": "kind-of", + "escapedName": "kind-of", + "rawSpec": "^3.0.2", + "saveSpec": null, + "fetchSpec": "^3.0.2" + }, + "_requiredBy": [ + "/readdirp/is-number" + ], + "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "_shasum": "31ea21a734bab9bbb0f32466d893aea51e4a3c64", + "_spec": "kind-of@^3.0.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/is-number", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/kind-of/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "David Fox-Powell", + "url": "https://dtothefp.github.io/me" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Ken Sheedlo", + "url": "kensheedlo.com" + }, + { + "name": "laggingreflex", + "url": "https://github.com/laggingreflex" + }, + { + "name": "Miguel Mota", + "url": "https://miguelmota.com" + }, + { + "name": "Peter deHaan", + "url": "http://about.me/peterdehaan" + } + ], + "dependencies": { + "is-buffer": "^1.1.5" + }, + "deprecated": false, + "description": "Get the native type of a value.", + "devDependencies": { + "ansi-bold": "^0.1.1", + "benchmarked": "^1.0.0", + "browserify": "^14.3.0", + "glob": "^7.1.1", + "gulp-format-md": "^0.1.12", + "mocha": "^3.3.0", + "type-of": "^2.0.1", + "typeof": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/kind-of", + "keywords": [ + "arguments", + "array", + "boolean", + "check", + "date", + "function", + "is", + "is-type", + "is-type-of", + "kind", + "kind-of", + "number", + "object", + "of", + "regexp", + "string", + "test", + "type", + "type-of", + "typeof", + "types" + ], + "license": "MIT", + "main": "index.js", + "name": "kind-of", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/kind-of.git" + }, + "scripts": { + "prepublish": "browserify -o browser.js -e index.js -s index --bare", + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "is-glob", + "is-number", + "is-primitive" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb" + ] + }, + "version": "3.2.2" +} diff --git a/node_modules/readdirp/node_modules/is-number/package.json b/node_modules/readdirp/node_modules/is-number/package.json new file mode 100644 index 000000000..9a6bba5a9 --- /dev/null +++ b/node_modules/readdirp/node_modules/is-number/package.json @@ -0,0 +1,123 @@ +{ + "_from": "is-number@^3.0.0", + "_id": "is-number@3.0.0", + "_inBundle": false, + "_integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "_location": "/readdirp/is-number", + "_phantomChildren": { + "is-buffer": "1.1.6" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-number@^3.0.0", + "name": "is-number", + "escapedName": "is-number", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/readdirp/fill-range" + ], + "_resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "_shasum": "24fd6201a4782cf50561c810276afc7d12d71195", + "_spec": "is-number@^3.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/fill-range", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-number/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Charlike Mike Reagent", + "url": "http://www.tunnckocore.tk" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + } + ], + "dependencies": { + "kind-of": "^3.0.2" + }, + "deprecated": false, + "description": "Returns true if the value is a number. comprehensive tests.", + "devDependencies": { + "benchmarked": "^0.2.5", + "chalk": "^1.1.3", + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-number", + "keywords": [ + "check", + "coerce", + "coercion", + "integer", + "is", + "is-nan", + "is-num", + "is-number", + "istype", + "kind", + "math", + "nan", + "num", + "number", + "numeric", + "test", + "type", + "typeof", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "is-number", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-number.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "even", + "is-even", + "is-odd", + "is-primitive", + "kind-of", + "odd" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ] + }, + "version": "3.0.0" +} diff --git a/node_modules/readdirp/node_modules/isobject/LICENSE b/node_modules/readdirp/node_modules/isobject/LICENSE new file mode 100644 index 000000000..943e71d05 --- /dev/null +++ b/node_modules/readdirp/node_modules/isobject/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +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. \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/isobject/README.md b/node_modules/readdirp/node_modules/isobject/README.md new file mode 100644 index 000000000..d01feaa40 --- /dev/null +++ b/node_modules/readdirp/node_modules/isobject/README.md @@ -0,0 +1,122 @@ +# isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM monthly downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![NPM total downloads](https://img.shields.io/npm/dt/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/isobject) + +> Returns true if the value is an object and not an array or null. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save isobject +``` + +Install with [yarn](https://yarnpkg.com): + +```sh +$ yarn add isobject +``` + +Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install isobject +``` +Install with [bower](https://bower.io/) + +```sh +$ bower install isobject +``` + +## Usage + +```js +var isObject = require('isobject'); +``` + +**True** + +All of the following return `true`: + +```js +isObject({}); +isObject(Object.create({})); +isObject(Object.create(Object.prototype)); +isObject(Object.create(null)); +isObject({}); +isObject(new Foo); +isObject(/foo/); +``` + +**False** + +All of the following return `false`: + +```js +isObject(); +isObject(function () {}); +isObject(1); +isObject([]); +isObject(undefined); +isObject(null); +``` + +## About + +### Related projects + +* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") +* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 29 | [jonschlinkert](https://github.com/jonschlinkert) | +| 4 | [doowb](https://github.com/doowb) | +| 1 | [magnudae](https://github.com/magnudae) | +| 1 | [LeSuisse](https://github.com/LeSuisse) | +| 1 | [tmcw](https://github.com/tmcw) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 30, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/isobject/index.d.ts b/node_modules/readdirp/node_modules/isobject/index.d.ts new file mode 100644 index 000000000..55f81c275 --- /dev/null +++ b/node_modules/readdirp/node_modules/isobject/index.d.ts @@ -0,0 +1,5 @@ +export = isObject; + +declare function isObject(val: any): boolean; + +declare namespace isObject {} diff --git a/node_modules/readdirp/node_modules/isobject/index.js b/node_modules/readdirp/node_modules/isobject/index.js new file mode 100644 index 000000000..2d59958bf --- /dev/null +++ b/node_modules/readdirp/node_modules/isobject/index.js @@ -0,0 +1,12 @@ +/*! + * isobject + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +module.exports = function isObject(val) { + return val != null && typeof val === 'object' && Array.isArray(val) === false; +}; diff --git a/node_modules/readdirp/node_modules/isobject/package.json b/node_modules/readdirp/node_modules/isobject/package.json new file mode 100644 index 000000000..45d7a0490 --- /dev/null +++ b/node_modules/readdirp/node_modules/isobject/package.json @@ -0,0 +1,119 @@ +{ + "_from": "isobject@^3.0.1", + "_id": "isobject@3.0.1", + "_inBundle": false, + "_integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "_location": "/readdirp/isobject", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "isobject@^3.0.1", + "name": "isobject", + "escapedName": "isobject", + "rawSpec": "^3.0.1", + "saveSpec": null, + "fetchSpec": "^3.0.1" + }, + "_requiredBy": [ + "/readdirp/braces" + ], + "_resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "_shasum": "4e431e92b11a9731636aa1f9c8d1ccbcfdab78df", + "_spec": "isobject@^3.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/braces", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/isobject/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "url": "https://github.com/LeSuisse" + }, + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Magnús Dæhlen", + "url": "https://github.com/magnudae" + }, + { + "name": "Tom MacWright", + "url": "https://macwright.org" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Returns true if the value is an object and not an array or null.", + "devDependencies": { + "gulp-format-md": "^0.1.9", + "mocha": "^2.4.5" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.d.ts", + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/isobject", + "keywords": [ + "check", + "is", + "is-object", + "isobject", + "kind", + "kind-of", + "kindof", + "native", + "object", + "type", + "typeof", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "isobject", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/isobject.git" + }, + "scripts": { + "test": "mocha" + }, + "types": "index.d.ts", + "verb": { + "related": { + "list": [ + "extend-shallow", + "is-plain-object", + "kind-of", + "merge-deep" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb" + ] + }, + "version": "3.0.1" +} diff --git a/node_modules/readdirp/node_modules/kind-of/CHANGELOG.md b/node_modules/readdirp/node_modules/kind-of/CHANGELOG.md new file mode 100644 index 000000000..fb30b06df --- /dev/null +++ b/node_modules/readdirp/node_modules/kind-of/CHANGELOG.md @@ -0,0 +1,157 @@ +# Release history + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +
    + Guiding Principles + +- Changelogs are for humans, not machines. +- There should be an entry for every single version. +- The same types of changes should be grouped. +- Versions and sections should be linkable. +- The latest version comes first. +- The release date of each versions is displayed. +- Mention whether you follow Semantic Versioning. + +
    + +
    + Types of changes + +Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_): + +- `Added` for new features. +- `Changed` for changes in existing functionality. +- `Deprecated` for soon-to-be removed features. +- `Removed` for now removed features. +- `Fixed` for any bug fixes. +- `Security` in case of vulnerabilities. + +
    + +## [6.0.0] - 2017-10-13 + +- refactor code to be more performant +- refactor benchmarks + +## [5.1.0] - 2017-10-13 + +**Added** + +- Merge pull request #15 from aretecode/patch-1 +- adds support and tests for string & array iterators + +**Changed** + +- updates benchmarks + +## [5.0.2] - 2017-08-02 + +- Merge pull request #14 from struct78/master +- Added `undefined` check + +## [5.0.0] - 2017-06-21 + +- Merge pull request #12 from aretecode/iterator +- Set Iterator + Map Iterator +- streamline `isbuffer`, minor edits + +## [4.0.0] - 2017-05-19 + +- Merge pull request #8 from tunnckoCore/master +- update deps + +## [3.2.2] - 2017-05-16 + +- fix version + +## [3.2.1] - 2017-05-16 + +- add browserify + +## [3.2.0] - 2017-04-25 + +- Merge pull request #10 from ksheedlo/unrequire-buffer +- add `promise` support and tests +- Remove unnecessary `Buffer` check + +## [3.1.0] - 2016-12-07 + +- Merge pull request #7 from laggingreflex/err +- add support for `error` and tests +- run update + +## [3.0.4] - 2016-07-29 + +- move tests +- run update + +## [3.0.3] - 2016-05-03 + +- fix prepublish script +- remove unused dep + +## [3.0.0] - 2015-11-17 + +- add typed array support +- Merge pull request #5 from miguelmota/typed-arrays +- adds new tests + +## [2.0.1] - 2015-08-21 + +- use `is-buffer` module + +## [2.0.0] - 2015-05-31 + +- Create fallback for `Array.isArray` if used as a browser package +- Merge pull request #2 from dtothefp/patch-1 +- Merge pull request #3 from pdehaan/patch-1 +- Merge branch 'master' of https://github.com/chorks/kind-of into chorks-master +- optimizations, mostly date and regex + +## [1.1.0] - 2015-02-09 + +- adds `buffer` support +- adds tests for `buffer` + +## [1.0.0] - 2015-01-19 + +- update benchmarks +- optimizations based on benchmarks + +## [0.1.2] - 2014-10-26 + +- return `typeof` value if it's not an object. very slight speed improvement +- use `.slice` +- adds benchmarks + +## [0.1.0] - 2014-9-26 + +- first commit + +[6.0.0]: https://github.com/jonschlinkert/kind-of/compare/5.1.0...6.0.0 +[5.1.0]: https://github.com/jonschlinkert/kind-of/compare/5.0.2...5.1.0 +[5.0.2]: https://github.com/jonschlinkert/kind-of/compare/5.0.1...5.0.2 +[5.0.1]: https://github.com/jonschlinkert/kind-of/compare/5.0.0...5.0.1 +[5.0.0]: https://github.com/jonschlinkert/kind-of/compare/4.0.0...5.0.0 +[4.0.0]: https://github.com/jonschlinkert/kind-of/compare/3.2.2...4.0.0 +[3.2.2]: https://github.com/jonschlinkert/kind-of/compare/3.2.1...3.2.2 +[3.2.1]: https://github.com/jonschlinkert/kind-of/compare/3.2.0...3.2.1 +[3.2.0]: https://github.com/jonschlinkert/kind-of/compare/3.1.0...3.2.0 +[3.1.0]: https://github.com/jonschlinkert/kind-of/compare/3.0.4...3.1.0 +[3.0.4]: https://github.com/jonschlinkert/kind-of/compare/3.0.3...3.0.4 +[3.0.3]: https://github.com/jonschlinkert/kind-of/compare/3.0.0...3.0.3 +[3.0.0]: https://github.com/jonschlinkert/kind-of/compare/2.0.1...3.0.0 +[2.0.1]: https://github.com/jonschlinkert/kind-of/compare/2.0.0...2.0.1 +[2.0.0]: https://github.com/jonschlinkert/kind-of/compare/1.1.0...2.0.0 +[1.1.0]: https://github.com/jonschlinkert/kind-of/compare/1.0.0...1.1.0 +[1.0.0]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...1.0.0 +[0.1.2]: https://github.com/jonschlinkert/kind-of/compare/0.1.0...0.1.2 +[0.1.0]: https://github.com/jonschlinkert/kind-of/commit/2fae09b0b19b1aadb558e9be39f0c3ef6034eb87 + +[Unreleased]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...HEAD +[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog + diff --git a/node_modules/readdirp/node_modules/kind-of/LICENSE b/node_modules/readdirp/node_modules/kind-of/LICENSE new file mode 100644 index 000000000..3f2eca18f --- /dev/null +++ b/node_modules/readdirp/node_modules/kind-of/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/kind-of/README.md b/node_modules/readdirp/node_modules/kind-of/README.md new file mode 100644 index 000000000..4b0d4a818 --- /dev/null +++ b/node_modules/readdirp/node_modules/kind-of/README.md @@ -0,0 +1,365 @@ +# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) + +> Get the native type of a value. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save kind-of +``` + +Install with [bower](https://bower.io/) + +```sh +$ bower install kind-of --save +``` + +## Why use this? + +1. [it's fast](#benchmarks) | [optimizations](#optimizations) +2. [better type checking](#better-type-checking) + +## Usage + +> es5, es6, and browser ready + +```js +var kindOf = require('kind-of'); + +kindOf(undefined); +//=> 'undefined' + +kindOf(null); +//=> 'null' + +kindOf(true); +//=> 'boolean' + +kindOf(false); +//=> 'boolean' + +kindOf(new Buffer('')); +//=> 'buffer' + +kindOf(42); +//=> 'number' + +kindOf('str'); +//=> 'string' + +kindOf(arguments); +//=> 'arguments' + +kindOf({}); +//=> 'object' + +kindOf(Object.create(null)); +//=> 'object' + +kindOf(new Test()); +//=> 'object' + +kindOf(new Date()); +//=> 'date' + +kindOf([1, 2, 3]); +//=> 'array' + +kindOf(/foo/); +//=> 'regexp' + +kindOf(new RegExp('foo')); +//=> 'regexp' + +kindOf(new Error('error')); +//=> 'error' + +kindOf(function () {}); +//=> 'function' + +kindOf(function * () {}); +//=> 'generatorfunction' + +kindOf(Symbol('str')); +//=> 'symbol' + +kindOf(new Map()); +//=> 'map' + +kindOf(new WeakMap()); +//=> 'weakmap' + +kindOf(new Set()); +//=> 'set' + +kindOf(new WeakSet()); +//=> 'weakset' + +kindOf(new Int8Array()); +//=> 'int8array' + +kindOf(new Uint8Array()); +//=> 'uint8array' + +kindOf(new Uint8ClampedArray()); +//=> 'uint8clampedarray' + +kindOf(new Int16Array()); +//=> 'int16array' + +kindOf(new Uint16Array()); +//=> 'uint16array' + +kindOf(new Int32Array()); +//=> 'int32array' + +kindOf(new Uint32Array()); +//=> 'uint32array' + +kindOf(new Float32Array()); +//=> 'float32array' + +kindOf(new Float64Array()); +//=> 'float64array' +``` + +## Benchmarks + +Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). + +```bash +# arguments (32 bytes) + kind-of x 17,024,098 ops/sec ±1.90% (86 runs sampled) + lib-type-of x 11,926,235 ops/sec ±1.34% (83 runs sampled) + lib-typeof x 9,245,257 ops/sec ±1.22% (87 runs sampled) + + fastest is kind-of (by 161% avg) + +# array (22 bytes) + kind-of x 17,196,492 ops/sec ±1.07% (88 runs sampled) + lib-type-of x 8,838,283 ops/sec ±1.02% (87 runs sampled) + lib-typeof x 8,677,848 ops/sec ±0.87% (87 runs sampled) + + fastest is kind-of (by 196% avg) + +# boolean (24 bytes) + kind-of x 16,841,600 ops/sec ±1.10% (86 runs sampled) + lib-type-of x 8,096,787 ops/sec ±0.95% (87 runs sampled) + lib-typeof x 8,423,345 ops/sec ±1.15% (86 runs sampled) + + fastest is kind-of (by 204% avg) + +# buffer (38 bytes) + kind-of x 14,848,060 ops/sec ±1.05% (86 runs sampled) + lib-type-of x 3,671,577 ops/sec ±1.49% (87 runs sampled) + lib-typeof x 8,360,236 ops/sec ±1.24% (86 runs sampled) + + fastest is kind-of (by 247% avg) + +# date (30 bytes) + kind-of x 16,067,761 ops/sec ±1.58% (86 runs sampled) + lib-type-of x 8,954,436 ops/sec ±1.40% (87 runs sampled) + lib-typeof x 8,488,307 ops/sec ±1.51% (84 runs sampled) + + fastest is kind-of (by 184% avg) + +# error (36 bytes) + kind-of x 9,634,090 ops/sec ±1.12% (89 runs sampled) + lib-type-of x 7,735,624 ops/sec ±1.32% (86 runs sampled) + lib-typeof x 7,442,160 ops/sec ±1.11% (90 runs sampled) + + fastest is kind-of (by 127% avg) + +# function (34 bytes) + kind-of x 10,031,494 ops/sec ±1.27% (86 runs sampled) + lib-type-of x 9,502,757 ops/sec ±1.17% (89 runs sampled) + lib-typeof x 8,278,985 ops/sec ±1.08% (88 runs sampled) + + fastest is kind-of (by 113% avg) + +# null (24 bytes) + kind-of x 18,159,808 ops/sec ±1.92% (86 runs sampled) + lib-type-of x 12,927,635 ops/sec ±1.01% (88 runs sampled) + lib-typeof x 7,958,234 ops/sec ±1.21% (89 runs sampled) + + fastest is kind-of (by 174% avg) + +# number (22 bytes) + kind-of x 17,846,779 ops/sec ±0.91% (85 runs sampled) + lib-type-of x 3,316,636 ops/sec ±1.19% (86 runs sampled) + lib-typeof x 2,329,477 ops/sec ±2.21% (85 runs sampled) + + fastest is kind-of (by 632% avg) + +# object-plain (47 bytes) + kind-of x 7,085,155 ops/sec ±1.05% (88 runs sampled) + lib-type-of x 8,870,930 ops/sec ±1.06% (83 runs sampled) + lib-typeof x 8,716,024 ops/sec ±1.05% (87 runs sampled) + + fastest is lib-type-of (by 112% avg) + +# regex (25 bytes) + kind-of x 14,196,052 ops/sec ±1.65% (84 runs sampled) + lib-type-of x 9,554,164 ops/sec ±1.25% (88 runs sampled) + lib-typeof x 8,359,691 ops/sec ±1.07% (87 runs sampled) + + fastest is kind-of (by 158% avg) + +# string (33 bytes) + kind-of x 16,131,428 ops/sec ±1.41% (85 runs sampled) + lib-type-of x 7,273,172 ops/sec ±1.05% (87 runs sampled) + lib-typeof x 7,382,635 ops/sec ±1.17% (85 runs sampled) + + fastest is kind-of (by 220% avg) + +# symbol (34 bytes) + kind-of x 17,011,537 ops/sec ±1.24% (86 runs sampled) + lib-type-of x 3,492,454 ops/sec ±1.23% (89 runs sampled) + lib-typeof x 7,471,235 ops/sec ±2.48% (87 runs sampled) + + fastest is kind-of (by 310% avg) + +# template-strings (36 bytes) + kind-of x 15,434,250 ops/sec ±1.46% (83 runs sampled) + lib-type-of x 7,157,907 ops/sec ±0.97% (87 runs sampled) + lib-typeof x 7,517,986 ops/sec ±0.92% (86 runs sampled) + + fastest is kind-of (by 210% avg) + +# undefined (29 bytes) + kind-of x 19,167,115 ops/sec ±1.71% (87 runs sampled) + lib-type-of x 15,477,740 ops/sec ±1.63% (85 runs sampled) + lib-typeof x 19,075,495 ops/sec ±1.17% (83 runs sampled) + + fastest is lib-typeof,kind-of + +``` + +## Optimizations + +In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: + +1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. +2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. +3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` +4. There is no reason to make the code in a microlib as terse as possible, just to win points for making it shorter. It's always better to favor performant code over terse code. You will always only be using a single `require()` statement to use the library anyway, regardless of how the code is written. + +## Better type checking + +kind-of seems to be more consistently "correct" than other type checking libs I've looked at. For example, here are some differing results from other popular libs: + +### [typeof](https://github.com/CodingFu/typeof) lib + +Incorrectly identifies instances of custom constructors (pretty common): + +```js +var typeOf = require('typeof'); +function Test() {} +console.log(typeOf(new Test())); +//=> 'test' +``` + +Returns `object` instead of `arguments`: + +```js +function foo() { + console.log(typeOf(arguments)) //=> 'object' +} +foo(); +``` + +### [type-of](https://github.com/ForbesLindesay/type-of) lib + +Incorrectly returns `object` for generator functions, buffers, `Map`, `Set`, `WeakMap` and `WeakSet`: + +```js +function * foo() {} +console.log(typeOf(foo)); +//=> 'object' +console.log(typeOf(new Buffer(''))); +//=> 'object' +console.log(typeOf(new Map())); +//=> 'object' +console.log(typeOf(new Set())); +//=> 'object' +console.log(typeOf(new WeakMap())); +//=> 'object' +console.log(typeOf(new WeakSet())); +//=> 'object' +``` + +## About + +
    +Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
    + +
    +Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
    + +
    +Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
    + +### Related projects + +You might also be interested in these projects: + +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 98 | [jonschlinkert](https://github.com/jonschlinkert) | +| 3 | [aretecode](https://github.com/aretecode) | +| 2 | [miguelmota](https://github.com/miguelmota) | +| 1 | [dtothefp](https://github.com/dtothefp) | +| 1 | [ianstormtaylor](https://github.com/ianstormtaylor) | +| 1 | [ksheedlo](https://github.com/ksheedlo) | +| 1 | [pdehaan](https://github.com/pdehaan) | +| 1 | [laggingreflex](https://github.com/laggingreflex) | +| 1 | [charlike-old](https://github.com/charlike-old) | + +### Author + +**Jon Schlinkert** + +* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on December 01, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/kind-of/index.js b/node_modules/readdirp/node_modules/kind-of/index.js new file mode 100644 index 000000000..aa2bb3944 --- /dev/null +++ b/node_modules/readdirp/node_modules/kind-of/index.js @@ -0,0 +1,129 @@ +var toString = Object.prototype.toString; + +module.exports = function kindOf(val) { + if (val === void 0) return 'undefined'; + if (val === null) return 'null'; + + var type = typeof val; + if (type === 'boolean') return 'boolean'; + if (type === 'string') return 'string'; + if (type === 'number') return 'number'; + if (type === 'symbol') return 'symbol'; + if (type === 'function') { + return isGeneratorFn(val) ? 'generatorfunction' : 'function'; + } + + if (isArray(val)) return 'array'; + if (isBuffer(val)) return 'buffer'; + if (isArguments(val)) return 'arguments'; + if (isDate(val)) return 'date'; + if (isError(val)) return 'error'; + if (isRegexp(val)) return 'regexp'; + + switch (ctorName(val)) { + case 'Symbol': return 'symbol'; + case 'Promise': return 'promise'; + + // Set, Map, WeakSet, WeakMap + case 'WeakMap': return 'weakmap'; + case 'WeakSet': return 'weakset'; + case 'Map': return 'map'; + case 'Set': return 'set'; + + // 8-bit typed arrays + case 'Int8Array': return 'int8array'; + case 'Uint8Array': return 'uint8array'; + case 'Uint8ClampedArray': return 'uint8clampedarray'; + + // 16-bit typed arrays + case 'Int16Array': return 'int16array'; + case 'Uint16Array': return 'uint16array'; + + // 32-bit typed arrays + case 'Int32Array': return 'int32array'; + case 'Uint32Array': return 'uint32array'; + case 'Float32Array': return 'float32array'; + case 'Float64Array': return 'float64array'; + } + + if (isGeneratorObj(val)) { + return 'generator'; + } + + // Non-plain objects + type = toString.call(val); + switch (type) { + case '[object Object]': return 'object'; + // iterators + case '[object Map Iterator]': return 'mapiterator'; + case '[object Set Iterator]': return 'setiterator'; + case '[object String Iterator]': return 'stringiterator'; + case '[object Array Iterator]': return 'arrayiterator'; + } + + // other + return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); +}; + +function ctorName(val) { + return val.constructor ? val.constructor.name : null; +} + +function isArray(val) { + if (Array.isArray) return Array.isArray(val); + return val instanceof Array; +} + +function isError(val) { + return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'); +} + +function isDate(val) { + if (val instanceof Date) return true; + return typeof val.toDateString === 'function' + && typeof val.getDate === 'function' + && typeof val.setDate === 'function'; +} + +function isRegexp(val) { + if (val instanceof RegExp) return true; + return typeof val.flags === 'string' + && typeof val.ignoreCase === 'boolean' + && typeof val.multiline === 'boolean' + && typeof val.global === 'boolean'; +} + +function isGeneratorFn(name, val) { + return ctorName(name) === 'GeneratorFunction'; +} + +function isGeneratorObj(val) { + return typeof val.throw === 'function' + && typeof val.return === 'function' + && typeof val.next === 'function'; +} + +function isArguments(val) { + try { + if (typeof val.length === 'number' && typeof val.callee === 'function') { + return true; + } + } catch (err) { + if (err.message.indexOf('callee') !== -1) { + return true; + } + } + return false; +} + +/** + * If you need to support Safari 5-7 (8-10 yr-old browser), + * take a look at https://github.com/feross/is-buffer + */ + +function isBuffer(val) { + if (val.constructor && typeof val.constructor.isBuffer === 'function') { + return val.constructor.isBuffer(val); + } + return false; +} diff --git a/node_modules/readdirp/node_modules/kind-of/package.json b/node_modules/readdirp/node_modules/kind-of/package.json new file mode 100644 index 000000000..f87fa5e46 --- /dev/null +++ b/node_modules/readdirp/node_modules/kind-of/package.json @@ -0,0 +1,146 @@ +{ + "_from": "kind-of@^6.0.2", + "_id": "kind-of@6.0.2", + "_inBundle": false, + "_integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "_location": "/readdirp/kind-of", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "kind-of@^6.0.2", + "name": "kind-of", + "escapedName": "kind-of", + "rawSpec": "^6.0.2", + "saveSpec": null, + "fetchSpec": "^6.0.2" + }, + "_requiredBy": [ + "/readdirp/is-accessor-descriptor", + "/readdirp/is-data-descriptor", + "/readdirp/is-descriptor", + "/readdirp/micromatch" + ], + "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "_shasum": "01146b36a6218e64e58f3a8d66de5d7fc6f6d051", + "_spec": "kind-of@^6.0.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/kind-of/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "David Fox-Powell", + "url": "https://dtothefp.github.io/me" + }, + { + "name": "James", + "url": "https://twitter.com/aretecode" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Ken Sheedlo", + "url": "kensheedlo.com" + }, + { + "name": "laggingreflex", + "url": "https://github.com/laggingreflex" + }, + { + "name": "Miguel Mota", + "url": "https://miguelmota.com" + }, + { + "name": "Peter deHaan", + "url": "http://about.me/peterdehaan" + }, + { + "name": "tunnckoCore", + "url": "https://i.am.charlike.online" + } + ], + "deprecated": false, + "description": "Get the native type of a value.", + "devDependencies": { + "benchmarked": "^2.0.0", + "browserify": "^14.4.0", + "gulp-format-md": "^1.0.0", + "mocha": "^4.0.1", + "write": "^1.0.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/kind-of", + "keywords": [ + "arguments", + "array", + "boolean", + "check", + "date", + "function", + "is", + "is-type", + "is-type-of", + "kind", + "kind-of", + "number", + "object", + "of", + "regexp", + "string", + "test", + "type", + "type-of", + "typeof", + "types" + ], + "license": "MIT", + "main": "index.js", + "name": "kind-of", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/kind-of.git" + }, + "scripts": { + "prepublish": "browserify -o browser.js -e index.js -s index --bare", + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "related": { + "list": [ + "is-glob", + "is-number", + "is-primitive" + ] + }, + "reflinks": [ + "type-of", + "typeof", + "verb" + ] + }, + "version": "6.0.2" +} diff --git a/node_modules/readdirp/node_modules/micromatch/CHANGELOG.md b/node_modules/readdirp/node_modules/micromatch/CHANGELOG.md new file mode 100644 index 000000000..9d8e5ed09 --- /dev/null +++ b/node_modules/readdirp/node_modules/micromatch/CHANGELOG.md @@ -0,0 +1,37 @@ +## History + +### key + +Changelog entries are classified using the following labels _(from [keep-a-changelog][]_): + +- `added`: for new features +- `changed`: for changes in existing functionality +- `deprecated`: for once-stable features removed in upcoming releases +- `removed`: for deprecated features removed in this release +- `fixed`: for any bug fixes +- `bumped`: updated dependencies, only minor or higher will be listed. + +### [3.0.0] - 2017-04-11 + +TODO. There should be no breaking changes. Please report any regressions. I will [reformat these release notes](https://github.com/micromatch/micromatch/pull/76) and add them to the changelog as soon as I have a chance. + +### [1.0.1] - 2016-12-12 + +**Added** + +- Support for windows path edge cases where backslashes are used in brackets or other unusual combinations. + +### [1.0.0] - 2016-12-12 + +Stable release. + +### [0.1.0] - 2016-10-08 + +First release. + + +[Unreleased]: https://github.com/jonschlinkert/micromatch/compare/0.1.0...HEAD +[0.2.0]: https://github.com/jonschlinkert/micromatch/compare/0.1.0...0.2.0 + +[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog + diff --git a/node_modules/readdirp/node_modules/micromatch/LICENSE b/node_modules/readdirp/node_modules/micromatch/LICENSE new file mode 100755 index 000000000..d32ab4426 --- /dev/null +++ b/node_modules/readdirp/node_modules/micromatch/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2018, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/micromatch/README.md b/node_modules/readdirp/node_modules/micromatch/README.md new file mode 100644 index 000000000..5dfa1498a --- /dev/null +++ b/node_modules/readdirp/node_modules/micromatch/README.md @@ -0,0 +1,1150 @@ +# micromatch [![NPM version](https://img.shields.io/npm/v/micromatch.svg?style=flat)](https://www.npmjs.com/package/micromatch) [![NPM monthly downloads](https://img.shields.io/npm/dm/micromatch.svg?style=flat)](https://npmjs.org/package/micromatch) [![NPM total downloads](https://img.shields.io/npm/dt/micromatch.svg?style=flat)](https://npmjs.org/package/micromatch) [![Linux Build Status](https://img.shields.io/travis/micromatch/micromatch.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/micromatch) [![Windows Build Status](https://img.shields.io/appveyor/ci/micromatch/micromatch.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/micromatch/micromatch) + +> Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Table of Contents + +
    +Details + +- [Install](#install) +- [Quickstart](#quickstart) +- [Why use micromatch?](#why-use-micromatch) + * [Matching features](#matching-features) +- [Switching to micromatch](#switching-to-micromatch) + * [From minimatch](#from-minimatch) + * [From multimatch](#from-multimatch) +- [API](#api) +- [Options](#options) + * [options.basename](#optionsbasename) + * [options.bash](#optionsbash) + * [options.cache](#optionscache) + * [options.dot](#optionsdot) + * [options.failglob](#optionsfailglob) + * [options.ignore](#optionsignore) + * [options.matchBase](#optionsmatchbase) + * [options.nobrace](#optionsnobrace) + * [options.nocase](#optionsnocase) + * [options.nodupes](#optionsnodupes) + * [options.noext](#optionsnoext) + * [options.nonegate](#optionsnonegate) + * [options.noglobstar](#optionsnoglobstar) + * [options.nonull](#optionsnonull) + * [options.nullglob](#optionsnullglob) + * [options.snapdragon](#optionssnapdragon) + * [options.sourcemap](#optionssourcemap) + * [options.unescape](#optionsunescape) + * [options.unixify](#optionsunixify) +- [Extended globbing](#extended-globbing) + * [extglobs](#extglobs) + * [braces](#braces) + * [regex character classes](#regex-character-classes) + * [regex groups](#regex-groups) + * [POSIX bracket expressions](#posix-bracket-expressions) +- [Notes](#notes) + * [Bash 4.3 parity](#bash-43-parity) + * [Backslashes](#backslashes) +- [Contributing](#contributing) +- [Benchmarks](#benchmarks) + * [Running benchmarks](#running-benchmarks) + * [Latest results](#latest-results) +- [About](#about) + +
    + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save micromatch +``` + +## Quickstart + +```js +var mm = require('micromatch'); +mm(list, patterns[, options]); +``` + +The [main export](#micromatch) takes a list of strings and one or more glob patterns: + +```js +console.log(mm(['foo', 'bar', 'qux'], ['f*', 'b*'])); +//=> ['foo', 'bar'] +``` + +Use [.isMatch()](#ismatch) to get true/false: + +```js +console.log(mm.isMatch('foo', 'f*')); +//=> true +``` + +[Switching](#switching-to-micromatch) from minimatch and multimatch is easy! + +## Why use micromatch? + +> micromatch is a [drop-in replacement](#switching-to-micromatch) for minimatch and multimatch + +* Supports all of the same matching features as [minimatch](https://github.com/isaacs/minimatch) and [multimatch](https://github.com/sindresorhus/multimatch) +* Micromatch uses [snapdragon](https://github.com/jonschlinkert/snapdragon) for parsing and compiling globs, which provides granular control over the entire conversion process in a way that is easy to understand, reason about, and maintain. +* More consistently accurate matching [than minimatch](https://github.com/yarnpkg/yarn/pull/3339), with more than 36,000 [test assertions](./test) to prove it. +* More complete support for the Bash 4.3 specification than minimatch and multimatch. In fact, micromatch passes _all of the spec tests_ from bash, including some that bash still fails. +* [Faster matching](#benchmarks), from a combination of optimized glob patterns, faster algorithms, and regex caching. +* [Micromatch is safer](https://github.com/micromatch/braces#braces-is-safe), and is not subject to DoS with brace patterns, like minimatch and multimatch. +* More reliable windows support than minimatch and multimatch. + +### Matching features + +* Support for multiple glob patterns (no need for wrappers like multimatch) +* Wildcards (`**`, `*.js`) +* Negation (`'!a/*.js'`, `'*!(b).js']`) +* [extglobs](https://github.com/micromatch/extglob) (`+(x|y)`, `!(a|b)`) +* [POSIX character classes](https://github.com/micromatch/expand-brackets) (`[[:alpha:][:digit:]]`) +* [brace expansion](https://github.com/micromatch/braces) (`foo/{1..5}.md`, `bar/{a,b,c}.js`) +* regex character classes (`foo-[1-5].js`) +* regex logical "or" (`foo/(abc|xyz).js`) + +You can mix and match these features to create whatever patterns you need! + +## Switching to micromatch + +There is one notable difference between micromatch and minimatch in regards to how backslashes are handled. See [the notes about backslashes](#backslashes) for more information. + +### From minimatch + +Use [mm.isMatch()](#ismatch) instead of `minimatch()`: + +```js +mm.isMatch('foo', 'b*'); +//=> false +``` + +Use [mm.match()](#match) instead of `minimatch.match()`: + +```js +mm.match(['foo', 'bar'], 'b*'); +//=> 'bar' +``` + +### From multimatch + +Same signature: + +```js +mm(['foo', 'bar', 'baz'], ['f*', '*z']); +//=> ['foo', 'baz'] +``` + +## API + +### [micromatch](index.js#L41) + +The main function takes a list of strings and one or more glob patterns to use for matching. + +**Params** + +* `list` **{Array}**: A list of strings to match +* `patterns` **{String|Array}**: One or more glob patterns to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Array}**: Returns an array of matches + +**Example** + +```js +var mm = require('micromatch'); +mm(list, patterns[, options]); + +console.log(mm(['a.js', 'a.txt'], ['*.js'])); +//=> [ 'a.js' ] +``` + +### [.match](index.js#L93) + +Similar to the main function, but `pattern` must be a string. + +**Params** + +* `list` **{Array}**: Array of strings to match +* `pattern` **{String}**: Glob pattern to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Array}**: Returns an array of matches + +**Example** + +```js +var mm = require('micromatch'); +mm.match(list, pattern[, options]); + +console.log(mm.match(['a.a', 'a.aa', 'a.b', 'a.c'], '*.a')); +//=> ['a.a', 'a.aa'] +``` + +### [.isMatch](index.js#L154) + +Returns true if the specified `string` matches the given glob `pattern`. + +**Params** + +* `string` **{String}**: String to match +* `pattern` **{String}**: Glob pattern to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Boolean}**: Returns true if the string matches the glob pattern. + +**Example** + +```js +var mm = require('micromatch'); +mm.isMatch(string, pattern[, options]); + +console.log(mm.isMatch('a.a', '*.a')); +//=> true +console.log(mm.isMatch('a.b', '*.a')); +//=> false +``` + +### [.some](index.js#L192) + +Returns true if some of the strings in the given `list` match any of the given glob `patterns`. + +**Params** + +* `list` **{String|Array}**: The string or array of strings to test. Returns as soon as the first match is found. +* `patterns` **{String|Array}**: One or more glob patterns to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Boolean}**: Returns true if any patterns match `str` + +**Example** + +```js +var mm = require('micromatch'); +mm.some(list, patterns[, options]); + +console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); +// true +console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); +// false +``` + +### [.every](index.js#L228) + +Returns true if every string in the given `list` matches any of the given glob `patterns`. + +**Params** + +* `list` **{String|Array}**: The string or array of strings to test. +* `patterns` **{String|Array}**: One or more glob patterns to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Boolean}**: Returns true if any patterns match `str` + +**Example** + +```js +var mm = require('micromatch'); +mm.every(list, patterns[, options]); + +console.log(mm.every('foo.js', ['foo.js'])); +// true +console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); +// true +console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); +// false +console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); +// false +``` + +### [.any](index.js#L260) + +Returns true if **any** of the given glob `patterns` match the specified `string`. + +**Params** + +* `str` **{String|Array}**: The string to test. +* `patterns` **{String|Array}**: One or more glob patterns to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Boolean}**: Returns true if any patterns match `str` + +**Example** + +```js +var mm = require('micromatch'); +mm.any(string, patterns[, options]); + +console.log(mm.any('a.a', ['b.*', '*.a'])); +//=> true +console.log(mm.any('a.a', 'b.*')); +//=> false +``` + +### [.all](index.js#L308) + +Returns true if **all** of the given `patterns` match the specified string. + +**Params** + +* `str` **{String|Array}**: The string to test. +* `patterns` **{String|Array}**: One or more glob patterns to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Boolean}**: Returns true if any patterns match `str` + +**Example** + +```js +var mm = require('micromatch'); +mm.all(string, patterns[, options]); + +console.log(mm.all('foo.js', ['foo.js'])); +// true + +console.log(mm.all('foo.js', ['*.js', '!foo.js'])); +// false + +console.log(mm.all('foo.js', ['*.js', 'foo.js'])); +// true + +console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); +// true +``` + +### [.not](index.js#L340) + +Returns a list of strings that _**do not match any**_ of the given `patterns`. + +**Params** + +* `list` **{Array}**: Array of strings to match. +* `patterns` **{String|Array}**: One or more glob pattern to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Array}**: Returns an array of strings that **do not match** the given patterns. + +**Example** + +```js +var mm = require('micromatch'); +mm.not(list, patterns[, options]); + +console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a')); +//=> ['b.b', 'c.c'] +``` + +### [.contains](index.js#L376) + +Returns true if the given `string` contains the given pattern. Similar to [.isMatch](#isMatch) but the pattern can match any part of the string. + +**Params** + +* `str` **{String}**: The string to match. +* `patterns` **{String|Array}**: Glob pattern to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Boolean}**: Returns true if the patter matches any part of `str`. + +**Example** + +```js +var mm = require('micromatch'); +mm.contains(string, pattern[, options]); + +console.log(mm.contains('aa/bb/cc', '*b')); +//=> true +console.log(mm.contains('aa/bb/cc', '*d')); +//=> false +``` + +### [.matchKeys](index.js#L432) + +Filter the keys of the given object with the given `glob` pattern and `options`. Does not attempt to match nested keys. If you need this feature, use [glob-object](https://github.com/jonschlinkert/glob-object) instead. + +**Params** + +* `object` **{Object}**: The object with keys to filter. +* `patterns` **{String|Array}**: One or more glob patterns to use for matching. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Object}**: Returns an object with only keys that match the given patterns. + +**Example** + +```js +var mm = require('micromatch'); +mm.matchKeys(object, patterns[, options]); + +var obj = { aa: 'a', ab: 'b', ac: 'c' }; +console.log(mm.matchKeys(obj, '*b')); +//=> { ab: 'b' } +``` + +### [.matcher](index.js#L461) + +Returns a memoized matcher function from the given glob `pattern` and `options`. The returned function takes a string to match as its only argument and returns true if the string is a match. + +**Params** + +* `pattern` **{String}**: Glob pattern +* `options` **{Object}**: See available [options](#options) for changing how matches are performed. +* `returns` **{Function}**: Returns a matcher function. + +**Example** + +```js +var mm = require('micromatch'); +mm.matcher(pattern[, options]); + +var isMatch = mm.matcher('*.!(*a)'); +console.log(isMatch('a.a')); +//=> false +console.log(isMatch('a.b')); +//=> true +``` + +### [.capture](index.js#L536) + +Returns an array of matches captured by `pattern` in `string, or`null` if the pattern did not match. + +**Params** + +* `pattern` **{String}**: Glob pattern to use for matching. +* `string` **{String}**: String to match +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Boolean}**: Returns an array of captures if the string matches the glob pattern, otherwise `null`. + +**Example** + +```js +var mm = require('micromatch'); +mm.capture(pattern, string[, options]); + +console.log(mm.capture('test/*.js', 'test/foo.js')); +//=> ['foo'] +console.log(mm.capture('test/*.js', 'foo/bar.css')); +//=> null +``` + +### [.makeRe](index.js#L571) + +Create a regular expression from the given glob `pattern`. + +**Params** + +* `pattern` **{String}**: A glob pattern to convert to regex. +* `options` **{Object}**: See available [options](#options) for changing how matches are performed. +* `returns` **{RegExp}**: Returns a regex created from the given pattern. + +**Example** + +```js +var mm = require('micromatch'); +mm.makeRe(pattern[, options]); + +console.log(mm.makeRe('*.js')); +//=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ +``` + +### [.braces](index.js#L618) + +Expand the given brace `pattern`. + +**Params** + +* `pattern` **{String}**: String with brace pattern to expand. +* `options` **{Object}**: Any [options](#options) to change how expansion is performed. See the [braces](https://github.com/micromatch/braces) library for all available options. +* `returns` **{Array}** + +**Example** + +```js +var mm = require('micromatch'); +console.log(mm.braces('foo/{a,b}/bar')); +//=> ['foo/(a|b)/bar'] + +console.log(mm.braces('foo/{a,b}/bar', {expand: true})); +//=> ['foo/(a|b)/bar'] +``` + +### [.create](index.js#L685) + +Parses the given glob `pattern` and returns an array of abstract syntax trees (ASTs), with the compiled `output` and optional source `map` on each AST. + +**Params** + +* `pattern` **{String}**: Glob pattern to parse and compile. +* `options` **{Object}**: Any [options](#options) to change how parsing and compiling is performed. +* `returns` **{Object}**: Returns an object with the parsed AST, compiled string and optional source map. + +**Example** + +```js +var mm = require('micromatch'); +mm.create(pattern[, options]); + +console.log(mm.create('abc/*.js')); +// [{ options: { source: 'string', sourcemap: true }, +// state: {}, +// compilers: +// { ... }, +// output: '(\\.[\\\\\\/])?abc\\/(?!\\.)(?=.)[^\\/]*?\\.js', +// ast: +// { type: 'root', +// errors: [], +// nodes: +// [ ... ], +// dot: false, +// input: 'abc/*.js' }, +// parsingErrors: [], +// map: +// { version: 3, +// sources: [ 'string' ], +// names: [], +// mappings: 'AAAA,GAAG,EAAC,kBAAC,EAAC,EAAE', +// sourcesContent: [ 'abc/*.js' ] }, +// position: { line: 1, column: 28 }, +// content: {}, +// files: {}, +// idx: 6 }] +``` + +### [.parse](index.js#L732) + +Parse the given `str` with the given `options`. + +**Params** + +* `str` **{String}** +* `options` **{Object}** +* `returns` **{Object}**: Returns an AST + +**Example** + +```js +var mm = require('micromatch'); +mm.parse(pattern[, options]); + +var ast = mm.parse('a/{b,c}/d'); +console.log(ast); +// { type: 'root', +// errors: [], +// input: 'a/{b,c}/d', +// nodes: +// [ { type: 'bos', val: '' }, +// { type: 'text', val: 'a/' }, +// { type: 'brace', +// nodes: +// [ { type: 'brace.open', val: '{' }, +// { type: 'text', val: 'b,c' }, +// { type: 'brace.close', val: '}' } ] }, +// { type: 'text', val: '/d' }, +// { type: 'eos', val: '' } ] } +``` + +### [.compile](index.js#L780) + +Compile the given `ast` or string with the given `options`. + +**Params** + +* `ast` **{Object|String}** +* `options` **{Object}** +* `returns` **{Object}**: Returns an object that has an `output` property with the compiled string. + +**Example** + +```js +var mm = require('micromatch'); +mm.compile(ast[, options]); + +var ast = mm.parse('a/{b,c}/d'); +console.log(mm.compile(ast)); +// { options: { source: 'string' }, +// state: {}, +// compilers: +// { eos: [Function], +// noop: [Function], +// bos: [Function], +// brace: [Function], +// 'brace.open': [Function], +// text: [Function], +// 'brace.close': [Function] }, +// output: [ 'a/(b|c)/d' ], +// ast: +// { ... }, +// parsingErrors: [] } +``` + +### [.clearCache](index.js#L801) + +Clear the regex cache. + +**Example** + +```js +mm.clearCache(); +``` + +## Options + +* [basename](#optionsbasename) +* [bash](#optionsbash) +* [cache](#optionscache) +* [dot](#optionsdot) +* [failglob](#optionsfailglob) +* [ignore](#optionsignore) +* [matchBase](#optionsmatchBase) +* [nobrace](#optionsnobrace) +* [nocase](#optionsnocase) +* [nodupes](#optionsnodupes) +* [noext](#optionsnoext) +* [noglobstar](#optionsnoglobstar) +* [nonull](#optionsnonull) +* [nullglob](#optionsnullglob) +* [snapdragon](#optionssnapdragon) +* [sourcemap](#optionssourcemap) +* [unescape](#optionsunescape) +* [unixify](#optionsunixify) + +### options.basename + +Allow glob patterns without slashes to match a file path based on its basename. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `matchBase`. + +**Type**: `Boolean` + +**Default**: `false` + +**Example** + +```js +mm(['a/b.js', 'a/c.md'], '*.js'); +//=> [] + +mm(['a/b.js', 'a/c.md'], '*.js', {matchBase: true}); +//=> ['a/b.js'] +``` + +### options.bash + +Enabled by default, this option enforces bash-like behavior with stars immediately following a bracket expression. Bash bracket expressions are similar to regex character classes, but unlike regex, a star following a bracket expression **does not repeat the bracketed characters**. Instead, the star is treated the same as an other star. + +**Type**: `Boolean` + +**Default**: `true` + +**Example** + +```js +var files = ['abc', 'ajz']; +console.log(mm(files, '[a-c]*')); +//=> ['abc', 'ajz'] + +console.log(mm(files, '[a-c]*', {bash: false})); +``` + +### options.cache + +Disable regex and function memoization. + +**Type**: `Boolean` + +**Default**: `undefined` + +### options.dot + +Match dotfiles. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `dot`. + +**Type**: `Boolean` + +**Default**: `false` + +### options.failglob + +Similar to the `--failglob` behavior in Bash, throws an error when no matches are found. + +**Type**: `Boolean` + +**Default**: `undefined` + +### options.ignore + +String or array of glob patterns to match files to ignore. + +**Type**: `String|Array` + +**Default**: `undefined` + +### options.matchBase + +Alias for [options.basename](#options-basename). + +### options.nobrace + +Disable expansion of brace patterns. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `nobrace`. + +**Type**: `Boolean` + +**Default**: `undefined` + +See [braces](https://github.com/micromatch/braces) for more information about extended brace expansion. + +### options.nocase + +Use a case-insensitive regex for matching files. Same behavior as [minimatch](https://github.com/isaacs/minimatch). + +**Type**: `Boolean` + +**Default**: `undefined` + +### options.nodupes + +Remove duplicate elements from the result array. + +**Type**: `Boolean` + +**Default**: `undefined` + +**Example** + +Example of using the `unescape` and `nodupes` options together: + +```js +mm.match(['a/b/c', 'a/b/c'], 'a/b/c'); +//=> ['a/b/c', 'a/b/c'] + +mm.match(['a/b/c', 'a/b/c'], 'a/b/c', {nodupes: true}); +//=> ['abc'] +``` + +### options.noext + +Disable extglob support, so that extglobs are regarded as literal characters. + +**Type**: `Boolean` + +**Default**: `undefined` + +**Examples** + +```js +mm(['a/z', 'a/b', 'a/!(z)'], 'a/!(z)'); +//=> ['a/b', 'a/!(z)'] + +mm(['a/z', 'a/b', 'a/!(z)'], 'a/!(z)', {noext: true}); +//=> ['a/!(z)'] (matches only as literal characters) +``` + +### options.nonegate + +Disallow negation (`!`) patterns, and treat leading `!` as a literal character to match. + +**Type**: `Boolean` + +**Default**: `undefined` + +### options.noglobstar + +Disable matching with globstars (`**`). + +**Type**: `Boolean` + +**Default**: `undefined` + +```js +mm(['a/b', 'a/b/c', 'a/b/c/d'], 'a/**'); +//=> ['a/b', 'a/b/c', 'a/b/c/d'] + +mm(['a/b', 'a/b/c', 'a/b/c/d'], 'a/**', {noglobstar: true}); +//=> ['a/b'] +``` + +### options.nonull + +Alias for [options.nullglob](#options-nullglob). + +### options.nullglob + +If `true`, when no matches are found the actual (arrayified) glob pattern is returned instead of an empty array. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `nonull`. + +**Type**: `Boolean` + +**Default**: `undefined` + +### options.snapdragon + +Pass your own instance of [snapdragon](https://github.com/jonschlinkert/snapdragon), to customize parsers or compilers. + +**Type**: `Object` + +**Default**: `undefined` + +### options.sourcemap + +Generate a source map by enabling the `sourcemap` option with the `.parse`, `.compile`, or `.create` methods. + +_(Note that sourcemaps are currently not enabled for brace patterns)_ + +**Examples** + +``` js +var mm = require('micromatch'); +var pattern = '*(*(of*(a)x)z)'; + +var res = mm.create('abc/*.js', {sourcemap: true}); +console.log(res.map); +// { version: 3, +// sources: [ 'string' ], +// names: [], +// mappings: 'AAAA,GAAG,EAAC,iBAAC,EAAC,EAAE', +// sourcesContent: [ 'abc/*.js' ] } + +var ast = mm.parse('abc/**/*.js'); +var res = mm.compile(ast, {sourcemap: true}); +console.log(res.map); +// { version: 3, +// sources: [ 'string' ], +// names: [], +// mappings: 'AAAA,GAAG,EAAC,2BAAE,EAAC,iBAAC,EAAC,EAAE', +// sourcesContent: [ 'abc/**/*.js' ] } + +var ast = mm.parse(pattern); +var res = mm.compile(ast, {sourcemap: true}); +console.log(res.map); +// { version: 3, +// sources: [ 'string' ], +// names: [], +// mappings: 'AAAA,CAAE,CAAE,EAAE,CAAE,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC', +// sourcesContent: [ '*(*(of*(a)x)z)' ] } +``` + +### options.unescape + +Remove backslashes from returned matches. + +**Type**: `Boolean` + +**Default**: `undefined` + +**Example** + +In this example we want to match a literal `*`: + +```js +mm.match(['abc', 'a\\*c'], 'a\\*c'); +//=> ['a\\*c'] + +mm.match(['abc', 'a\\*c'], 'a\\*c', {unescape: true}); +//=> ['a*c'] +``` + +### options.unixify + +Convert path separators on returned files to posix/unix-style forward slashes. + +**Type**: `Boolean` + +**Default**: `true` on windows, `false` everywhere else + +**Example** + +```js +mm.match(['a\\b\\c'], 'a/**'); +//=> ['a/b/c'] + +mm.match(['a\\b\\c'], {unixify: false}); +//=> ['a\\b\\c'] +``` + +## Extended globbing + +Micromatch also supports extended globbing features. + +### extglobs + +Extended globbing, as described by the bash man page: + +| **pattern** | **regex equivalent** | **description** | +| --- | --- | --- | +| `?(pattern)` | `(pattern)?` | Matches zero or one occurrence of the given patterns | +| `*(pattern)` | `(pattern)*` | Matches zero or more occurrences of the given patterns | +| `+(pattern)` | `(pattern)+` | Matches one or more occurrences of the given patterns | +| `@(pattern)` | `(pattern)` * | Matches one of the given patterns | +| `!(pattern)` | N/A (equivalent regex is much more complicated) | Matches anything except one of the given patterns | + +* Note that `@` isn't a RegEx character. + +Powered by [extglob](https://github.com/micromatch/extglob). Visit that library for the full range of options or to report extglob related issues. + +### braces + +Brace patterns can be used to match specific ranges or sets of characters. For example, the pattern `*/{1..3}/*` would match any of following strings: + +``` +foo/1/bar +foo/2/bar +foo/3/bar +baz/1/qux +baz/2/qux +baz/3/qux +``` + +Visit [braces](https://github.com/micromatch/braces) to see the full range of features and options related to brace expansion, or to create brace matching or expansion related issues. + +### regex character classes + +Given the list: `['a.js', 'b.js', 'c.js', 'd.js', 'E.js']`: + +* `[ac].js`: matches both `a` and `c`, returning `['a.js', 'c.js']` +* `[b-d].js`: matches from `b` to `d`, returning `['b.js', 'c.js', 'd.js']` +* `[b-d].js`: matches from `b` to `d`, returning `['b.js', 'c.js', 'd.js']` +* `a/[A-Z].js`: matches and uppercase letter, returning `['a/E.md']` + +Learn about [regex character classes](http://www.regular-expressions.info/charclass.html). + +### regex groups + +Given `['a.js', 'b.js', 'c.js', 'd.js', 'E.js']`: + +* `(a|c).js`: would match either `a` or `c`, returning `['a.js', 'c.js']` +* `(b|d).js`: would match either `b` or `d`, returning `['b.js', 'd.js']` +* `(b|[A-Z]).js`: would match either `b` or an uppercase letter, returning `['b.js', 'E.js']` + +As with regex, parens can be nested, so patterns like `((a|b)|c)/b` will work. Although brace expansion might be friendlier to use, depending on preference. + +### POSIX bracket expressions + +POSIX brackets are intended to be more user-friendly than regex character classes. This of course is in the eye of the beholder. + +**Example** + +```js +mm.isMatch('a1', '[[:alpha:][:digit:]]'); +//=> true + +mm.isMatch('a1', '[[:alpha:][:alpha:]]'); +//=> false +``` + +See [expand-brackets](https://github.com/jonschlinkert/expand-brackets) for more information about bracket expressions. + +*** + +## Notes + +### Bash 4.3 parity + +Whenever possible matching behavior is based on behavior Bash 4.3, which is mostly consistent with minimatch. + +However, it's suprising how many edge cases and rabbit holes there are with glob matching, and since there is no real glob specification, and micromatch is more accurate than both Bash and minimatch, there are cases where best-guesses were made for behavior. In a few cases where Bash had no answers, we used wildmatch (used by git) as a fallback. + +### Backslashes + +There is an important, notable difference between minimatch and micromatch _in regards to how backslashes are handled_ in glob patterns. + +* Micromatch exclusively and explicitly reserves backslashes for escaping characters in a glob pattern, even on windows. This is consistent with bash behavior. +* Minimatch converts all backslashes to forward slashes, which means you can't use backslashes to escape any characters in your glob patterns. + +We made this decision for micromatch for a couple of reasons: + +* consistency with bash conventions. +* glob patterns are not filepaths. They are a type of [regular language](https://en.wikipedia.org/wiki/Regular_language) that is converted to a JavaScript regular expression. Thus, when forward slashes are defined in a glob pattern, the resulting regular expression will match windows or POSIX path separators just fine. + +**A note about joining paths to globs** + +Note that when you pass something like `path.join('foo', '*')` to micromatch, you are creating a filepath and expecting it to still work as a glob pattern. This causes problems on windows, since the `path.sep` is `\\`. + +In other words, since `\\` is reserved as an escape character in globs, on windows `path.join('foo', '*')` would result in `foo\\*`, which tells micromatch to match `*` as a literal character. This is the same behavior as bash. + +## Contributing + +All contributions are welcome! Please read [the contributing guide](.github/contributing.md) to get started. + +**Bug reports** + +Please create an issue if you encounter a bug or matching behavior that doesn't seem correct. If you find a matching-related issue, please: + +* [research existing issues first](../../issues) (open and closed) +* visit the [GNU Bash documentation](https://www.gnu.org/software/bash/manual/) to see how Bash deals with the pattern +* visit the [minimatch](https://github.com/isaacs/minimatch) documentation to cross-check expected behavior in node.js +* if all else fails, since there is no real specification for globs we will probably need to discuss expected behavior and decide how to resolve it. which means any detail you can provide to help with this discussion would be greatly appreciated. + +**Platform issues** + +It's important to us that micromatch work consistently on all platforms. If you encounter any platform-specific matching or path related issues, please let us know (pull requests are also greatly appreciated). + +## Benchmarks + +### Running benchmarks + +Install dev dependencies: + +```bash +npm i -d && npm run benchmark +``` + +### Latest results + +As of February 18, 2018 (longer bars are better): + +```sh +# braces-globstar-large-list (485691 bytes) + micromatch ██████████████████████████████████████████████████ (517 ops/sec ±0.49%) + minimatch █ (18.92 ops/sec ±0.54%) + multimatch █ (18.94 ops/sec ±0.62%) + + micromatch is faster by an avg. of 2,733% + +# braces-multiple (3362 bytes) + micromatch ██████████████████████████████████████████████████ (33,625 ops/sec ±0.45%) + minimatch (2.92 ops/sec ±3.26%) + multimatch (2.90 ops/sec ±2.76%) + + micromatch is faster by an avg. of 1,156,935% + +# braces-range (727 bytes) + micromatch █████████████████████████████████████████████████ (155,220 ops/sec ±0.56%) + minimatch ██████ (20,186 ops/sec ±1.27%) + multimatch ██████ (19,809 ops/sec ±0.60%) + + micromatch is faster by an avg. of 776% + +# braces-set (2858 bytes) + micromatch █████████████████████████████████████████████████ (24,354 ops/sec ±0.92%) + minimatch █████ (2,566 ops/sec ±0.56%) + multimatch ████ (2,431 ops/sec ±1.25%) + + micromatch is faster by an avg. of 975% + +# globstar-large-list (485686 bytes) + micromatch █████████████████████████████████████████████████ (504 ops/sec ±0.45%) + minimatch ███ (33.36 ops/sec ±1.08%) + multimatch ███ (33.19 ops/sec ±1.35%) + + micromatch is faster by an avg. of 1,514% + +# globstar-long-list (90647 bytes) + micromatch ██████████████████████████████████████████████████ (2,694 ops/sec ±1.08%) + minimatch ████████████████ (870 ops/sec ±1.09%) + multimatch ████████████████ (862 ops/sec ±0.84%) + + micromatch is faster by an avg. of 311% + +# globstar-short-list (182 bytes) + micromatch ██████████████████████████████████████████████████ (328,921 ops/sec ±1.06%) + minimatch █████████ (64,808 ops/sec ±1.42%) + multimatch ████████ (57,991 ops/sec ±2.11%) + + micromatch is faster by an avg. of 536% + +# no-glob (701 bytes) + micromatch █████████████████████████████████████████████████ (415,935 ops/sec ±0.36%) + minimatch ███████████ (92,730 ops/sec ±1.44%) + multimatch █████████ (81,958 ops/sec ±2.13%) + + micromatch is faster by an avg. of 476% + +# star-basename-long (12339 bytes) + micromatch █████████████████████████████████████████████████ (7,963 ops/sec ±0.36%) + minimatch ███████████████████████████████ (5,072 ops/sec ±0.83%) + multimatch ███████████████████████████████ (5,028 ops/sec ±0.40%) + + micromatch is faster by an avg. of 158% + +# star-basename-short (349 bytes) + micromatch ██████████████████████████████████████████████████ (269,552 ops/sec ±0.70%) + minimatch ██████████████████████ (122,457 ops/sec ±1.39%) + multimatch ████████████████████ (110,788 ops/sec ±1.99%) + + micromatch is faster by an avg. of 231% + +# star-folder-long (19207 bytes) + micromatch █████████████████████████████████████████████████ (3,806 ops/sec ±0.38%) + minimatch ████████████████████████████ (2,204 ops/sec ±0.32%) + multimatch ██████████████████████████ (2,020 ops/sec ±1.07%) + + micromatch is faster by an avg. of 180% + +# star-folder-short (551 bytes) + micromatch ██████████████████████████████████████████████████ (249,077 ops/sec ±0.40%) + minimatch ███████████ (59,431 ops/sec ±1.67%) + multimatch ███████████ (55,569 ops/sec ±1.43%) + + micromatch is faster by an avg. of 433% +``` + +## About + +
    +Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards. + +
    + +
    +Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
    + +
    +Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
    + +### Related projects + +You might also be interested in these projects: + +* [braces](https://www.npmjs.com/package/braces): Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support… [more](https://github.com/micromatch/braces) | [homepage](https://github.com/micromatch/braces "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.") +* [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/jonschlinkert/expand-brackets "Expand POSIX bracket expressions (character classes) in glob patterns.") +* [extglob](https://www.npmjs.com/package/extglob): Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob… [more](https://github.com/micromatch/extglob) | [homepage](https://github.com/micromatch/extglob "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.") +* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or `step` to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`") +* [nanomatch](https://www.npmjs.com/package/nanomatch): Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash… [more](https://github.com/micromatch/nanomatch) | [homepage](https://github.com/micromatch/nanomatch "Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces)") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 457 | [jonschlinkert](https://github.com/jonschlinkert) | +| 12 | [es128](https://github.com/es128) | +| 8 | [doowb](https://github.com/doowb) | +| 3 | [paulmillr](https://github.com/paulmillr) | +| 2 | [TrySound](https://github.com/TrySound) | +| 2 | [MartinKolarik](https://github.com/MartinKolarik) | +| 2 | [charlike-old](https://github.com/charlike-old) | +| 1 | [amilajack](https://github.com/amilajack) | +| 1 | [mrmlnc](https://github.com/mrmlnc) | +| 1 | [devongovett](https://github.com/devongovett) | +| 1 | [DianeLooney](https://github.com/DianeLooney) | +| 1 | [UltCombo](https://github.com/UltCombo) | +| 1 | [tomByrer](https://github.com/tomByrer) | +| 1 | [fidian](https://github.com/fidian) | + +### Author + +**Jon Schlinkert** + +* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on February 18, 2018._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/micromatch/index.js b/node_modules/readdirp/node_modules/micromatch/index.js new file mode 100644 index 000000000..fe02f2cb2 --- /dev/null +++ b/node_modules/readdirp/node_modules/micromatch/index.js @@ -0,0 +1,877 @@ +'use strict'; + +/** + * Module dependencies + */ + +var util = require('util'); +var braces = require('braces'); +var toRegex = require('to-regex'); +var extend = require('extend-shallow'); + +/** + * Local dependencies + */ + +var compilers = require('./lib/compilers'); +var parsers = require('./lib/parsers'); +var cache = require('./lib/cache'); +var utils = require('./lib/utils'); +var MAX_LENGTH = 1024 * 64; + +/** + * The main function takes a list of strings and one or more + * glob patterns to use for matching. + * + * ```js + * var mm = require('micromatch'); + * mm(list, patterns[, options]); + * + * console.log(mm(['a.js', 'a.txt'], ['*.js'])); + * //=> [ 'a.js' ] + * ``` + * @param {Array} `list` A list of strings to match + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Array} Returns an array of matches + * @summary false + * @api public + */ + +function micromatch(list, patterns, options) { + patterns = utils.arrayify(patterns); + list = utils.arrayify(list); + + var len = patterns.length; + if (list.length === 0 || len === 0) { + return []; + } + + if (len === 1) { + return micromatch.match(list, patterns[0], options); + } + + var omit = []; + var keep = []; + var idx = -1; + + while (++idx < len) { + var pattern = patterns[idx]; + + if (typeof pattern === 'string' && pattern.charCodeAt(0) === 33 /* ! */) { + omit.push.apply(omit, micromatch.match(list, pattern.slice(1), options)); + } else { + keep.push.apply(keep, micromatch.match(list, pattern, options)); + } + } + + var matches = utils.diff(keep, omit); + if (!options || options.nodupes !== false) { + return utils.unique(matches); + } + + return matches; +} + +/** + * Similar to the main function, but `pattern` must be a string. + * + * ```js + * var mm = require('micromatch'); + * mm.match(list, pattern[, options]); + * + * console.log(mm.match(['a.a', 'a.aa', 'a.b', 'a.c'], '*.a')); + * //=> ['a.a', 'a.aa'] + * ``` + * @param {Array} `list` Array of strings to match + * @param {String} `pattern` Glob pattern to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Array} Returns an array of matches + * @api public + */ + +micromatch.match = function(list, pattern, options) { + if (Array.isArray(pattern)) { + throw new TypeError('expected pattern to be a string'); + } + + var unixify = utils.unixify(options); + var isMatch = memoize('match', pattern, options, micromatch.matcher); + var matches = []; + + list = utils.arrayify(list); + var len = list.length; + var idx = -1; + + while (++idx < len) { + var ele = list[idx]; + if (ele === pattern || isMatch(ele)) { + matches.push(utils.value(ele, unixify, options)); + } + } + + // if no options were passed, uniquify results and return + if (typeof options === 'undefined') { + return utils.unique(matches); + } + + if (matches.length === 0) { + if (options.failglob === true) { + throw new Error('no matches found for "' + pattern + '"'); + } + if (options.nonull === true || options.nullglob === true) { + return [options.unescape ? utils.unescape(pattern) : pattern]; + } + } + + // if `opts.ignore` was defined, diff ignored list + if (options.ignore) { + matches = micromatch.not(matches, options.ignore, options); + } + + return options.nodupes !== false ? utils.unique(matches) : matches; +}; + +/** + * Returns true if the specified `string` matches the given glob `pattern`. + * + * ```js + * var mm = require('micromatch'); + * mm.isMatch(string, pattern[, options]); + * + * console.log(mm.isMatch('a.a', '*.a')); + * //=> true + * console.log(mm.isMatch('a.b', '*.a')); + * //=> false + * ``` + * @param {String} `string` String to match + * @param {String} `pattern` Glob pattern to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if the string matches the glob pattern. + * @api public + */ + +micromatch.isMatch = function(str, pattern, options) { + if (typeof str !== 'string') { + throw new TypeError('expected a string: "' + util.inspect(str) + '"'); + } + + if (isEmptyString(str) || isEmptyString(pattern)) { + return false; + } + + var equals = utils.equalsPattern(options); + if (equals(str)) { + return true; + } + + var isMatch = memoize('isMatch', pattern, options, micromatch.matcher); + return isMatch(str); +}; + +/** + * Returns true if some of the strings in the given `list` match any of the + * given glob `patterns`. + * + * ```js + * var mm = require('micromatch'); + * mm.some(list, patterns[, options]); + * + * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); + * // true + * console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); + * // false + * ``` + * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +micromatch.some = function(list, patterns, options) { + if (typeof list === 'string') { + list = [list]; + } + for (var i = 0; i < list.length; i++) { + if (micromatch(list[i], patterns, options).length === 1) { + return true; + } + } + return false; +}; + +/** + * Returns true if every string in the given `list` matches + * any of the given glob `patterns`. + * + * ```js + * var mm = require('micromatch'); + * mm.every(list, patterns[, options]); + * + * console.log(mm.every('foo.js', ['foo.js'])); + * // true + * console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); + * // true + * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); + * // false + * console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); + * // false + * ``` + * @param {String|Array} `list` The string or array of strings to test. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +micromatch.every = function(list, patterns, options) { + if (typeof list === 'string') { + list = [list]; + } + for (var i = 0; i < list.length; i++) { + if (micromatch(list[i], patterns, options).length !== 1) { + return false; + } + } + return true; +}; + +/** + * Returns true if **any** of the given glob `patterns` + * match the specified `string`. + * + * ```js + * var mm = require('micromatch'); + * mm.any(string, patterns[, options]); + * + * console.log(mm.any('a.a', ['b.*', '*.a'])); + * //=> true + * console.log(mm.any('a.a', 'b.*')); + * //=> false + * ``` + * @param {String|Array} `str` The string to test. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +micromatch.any = function(str, patterns, options) { + if (typeof str !== 'string') { + throw new TypeError('expected a string: "' + util.inspect(str) + '"'); + } + + if (isEmptyString(str) || isEmptyString(patterns)) { + return false; + } + + if (typeof patterns === 'string') { + patterns = [patterns]; + } + + for (var i = 0; i < patterns.length; i++) { + if (micromatch.isMatch(str, patterns[i], options)) { + return true; + } + } + return false; +}; + +/** + * Returns true if **all** of the given `patterns` match + * the specified string. + * + * ```js + * var mm = require('micromatch'); + * mm.all(string, patterns[, options]); + * + * console.log(mm.all('foo.js', ['foo.js'])); + * // true + * + * console.log(mm.all('foo.js', ['*.js', '!foo.js'])); + * // false + * + * console.log(mm.all('foo.js', ['*.js', 'foo.js'])); + * // true + * + * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); + * // true + * ``` + * @param {String|Array} `str` The string to test. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +micromatch.all = function(str, patterns, options) { + if (typeof str !== 'string') { + throw new TypeError('expected a string: "' + util.inspect(str) + '"'); + } + if (typeof patterns === 'string') { + patterns = [patterns]; + } + for (var i = 0; i < patterns.length; i++) { + if (!micromatch.isMatch(str, patterns[i], options)) { + return false; + } + } + return true; +}; + +/** + * Returns a list of strings that _**do not match any**_ of the given `patterns`. + * + * ```js + * var mm = require('micromatch'); + * mm.not(list, patterns[, options]); + * + * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a')); + * //=> ['b.b', 'c.c'] + * ``` + * @param {Array} `list` Array of strings to match. + * @param {String|Array} `patterns` One or more glob pattern to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Array} Returns an array of strings that **do not match** the given patterns. + * @api public + */ + +micromatch.not = function(list, patterns, options) { + var opts = extend({}, options); + var ignore = opts.ignore; + delete opts.ignore; + + var unixify = utils.unixify(opts); + list = utils.arrayify(list).map(unixify); + + var matches = utils.diff(list, micromatch(list, patterns, opts)); + if (ignore) { + matches = utils.diff(matches, micromatch(list, ignore)); + } + + return opts.nodupes !== false ? utils.unique(matches) : matches; +}; + +/** + * Returns true if the given `string` contains the given pattern. Similar + * to [.isMatch](#isMatch) but the pattern can match any part of the string. + * + * ```js + * var mm = require('micromatch'); + * mm.contains(string, pattern[, options]); + * + * console.log(mm.contains('aa/bb/cc', '*b')); + * //=> true + * console.log(mm.contains('aa/bb/cc', '*d')); + * //=> false + * ``` + * @param {String} `str` The string to match. + * @param {String|Array} `patterns` Glob pattern to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns true if the patter matches any part of `str`. + * @api public + */ + +micromatch.contains = function(str, patterns, options) { + if (typeof str !== 'string') { + throw new TypeError('expected a string: "' + util.inspect(str) + '"'); + } + + if (typeof patterns === 'string') { + if (isEmptyString(str) || isEmptyString(patterns)) { + return false; + } + + var equals = utils.equalsPattern(patterns, options); + if (equals(str)) { + return true; + } + var contains = utils.containsPattern(patterns, options); + if (contains(str)) { + return true; + } + } + + var opts = extend({}, options, {contains: true}); + return micromatch.any(str, patterns, opts); +}; + +/** + * Returns true if the given pattern and options should enable + * the `matchBase` option. + * @return {Boolean} + * @api private + */ + +micromatch.matchBase = function(pattern, options) { + if (pattern && pattern.indexOf('/') !== -1 || !options) return false; + return options.basename === true || options.matchBase === true; +}; + +/** + * Filter the keys of the given object with the given `glob` pattern + * and `options`. Does not attempt to match nested keys. If you need this feature, + * use [glob-object][] instead. + * + * ```js + * var mm = require('micromatch'); + * mm.matchKeys(object, patterns[, options]); + * + * var obj = { aa: 'a', ab: 'b', ac: 'c' }; + * console.log(mm.matchKeys(obj, '*b')); + * //=> { ab: 'b' } + * ``` + * @param {Object} `object` The object with keys to filter. + * @param {String|Array} `patterns` One or more glob patterns to use for matching. + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Object} Returns an object with only keys that match the given patterns. + * @api public + */ + +micromatch.matchKeys = function(obj, patterns, options) { + if (!utils.isObject(obj)) { + throw new TypeError('expected the first argument to be an object'); + } + var keys = micromatch(Object.keys(obj), patterns, options); + return utils.pick(obj, keys); +}; + +/** + * Returns a memoized matcher function from the given glob `pattern` and `options`. + * The returned function takes a string to match as its only argument and returns + * true if the string is a match. + * + * ```js + * var mm = require('micromatch'); + * mm.matcher(pattern[, options]); + * + * var isMatch = mm.matcher('*.!(*a)'); + * console.log(isMatch('a.a')); + * //=> false + * console.log(isMatch('a.b')); + * //=> true + * ``` + * @param {String} `pattern` Glob pattern + * @param {Object} `options` See available [options](#options) for changing how matches are performed. + * @return {Function} Returns a matcher function. + * @api public + */ + +micromatch.matcher = function matcher(pattern, options) { + if (Array.isArray(pattern)) { + return compose(pattern, options, matcher); + } + + // if pattern is a regex + if (pattern instanceof RegExp) { + return test(pattern); + } + + // if pattern is invalid + if (!utils.isString(pattern)) { + throw new TypeError('expected pattern to be an array, string or regex'); + } + + // if pattern is a non-glob string + if (!utils.hasSpecialChars(pattern)) { + if (options && options.nocase === true) { + pattern = pattern.toLowerCase(); + } + return utils.matchPath(pattern, options); + } + + // if pattern is a glob string + var re = micromatch.makeRe(pattern, options); + + // if `options.matchBase` or `options.basename` is defined + if (micromatch.matchBase(pattern, options)) { + return utils.matchBasename(re, options); + } + + function test(regex) { + var equals = utils.equalsPattern(options); + var unixify = utils.unixify(options); + + return function(str) { + if (equals(str)) { + return true; + } + + if (regex.test(unixify(str))) { + return true; + } + return false; + }; + } + + var fn = test(re); + Object.defineProperty(fn, 'result', { + configurable: true, + enumerable: false, + value: re.result + }); + return fn; +}; + +/** + * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match. + * + * ```js + * var mm = require('micromatch'); + * mm.capture(pattern, string[, options]); + * + * console.log(mm.capture('test/*.js', 'test/foo.js')); + * //=> ['foo'] + * console.log(mm.capture('test/*.js', 'foo/bar.css')); + * //=> null + * ``` + * @param {String} `pattern` Glob pattern to use for matching. + * @param {String} `string` String to match + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns an array of captures if the string matches the glob pattern, otherwise `null`. + * @api public + */ + +micromatch.capture = function(pattern, str, options) { + var re = micromatch.makeRe(pattern, extend({capture: true}, options)); + var unixify = utils.unixify(options); + + function match() { + return function(string) { + var match = re.exec(unixify(string)); + if (!match) { + return null; + } + + return match.slice(1); + }; + } + + var capture = memoize('capture', pattern, options, match); + return capture(str); +}; + +/** + * Create a regular expression from the given glob `pattern`. + * + * ```js + * var mm = require('micromatch'); + * mm.makeRe(pattern[, options]); + * + * console.log(mm.makeRe('*.js')); + * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ + * ``` + * @param {String} `pattern` A glob pattern to convert to regex. + * @param {Object} `options` See available [options](#options) for changing how matches are performed. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + +micromatch.makeRe = function(pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('expected pattern to be a string'); + } + + if (pattern.length > MAX_LENGTH) { + throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters'); + } + + function makeRe() { + var result = micromatch.create(pattern, options); + var ast_array = []; + var output = result.map(function(obj) { + obj.ast.state = obj.state; + ast_array.push(obj.ast); + return obj.output; + }); + + var regex = toRegex(output.join('|'), options); + Object.defineProperty(regex, 'result', { + configurable: true, + enumerable: false, + value: ast_array + }); + return regex; + } + + return memoize('makeRe', pattern, options, makeRe); +}; + +/** + * Expand the given brace `pattern`. + * + * ```js + * var mm = require('micromatch'); + * console.log(mm.braces('foo/{a,b}/bar')); + * //=> ['foo/(a|b)/bar'] + * + * console.log(mm.braces('foo/{a,b}/bar', {expand: true})); + * //=> ['foo/(a|b)/bar'] + * ``` + * @param {String} `pattern` String with brace pattern to expand. + * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options. + * @return {Array} + * @api public + */ + +micromatch.braces = function(pattern, options) { + if (typeof pattern !== 'string' && !Array.isArray(pattern)) { + throw new TypeError('expected pattern to be an array or string'); + } + + function expand() { + if (options && options.nobrace === true || !/\{.*\}/.test(pattern)) { + return utils.arrayify(pattern); + } + return braces(pattern, options); + } + + return memoize('braces', pattern, options, expand); +}; + +/** + * Proxy to the [micromatch.braces](#method), for parity with + * minimatch. + */ + +micromatch.braceExpand = function(pattern, options) { + var opts = extend({}, options, {expand: true}); + return micromatch.braces(pattern, opts); +}; + +/** + * Parses the given glob `pattern` and returns an array of abstract syntax + * trees (ASTs), with the compiled `output` and optional source `map` on + * each AST. + * + * ```js + * var mm = require('micromatch'); + * mm.create(pattern[, options]); + * + * console.log(mm.create('abc/*.js')); + * // [{ options: { source: 'string', sourcemap: true }, + * // state: {}, + * // compilers: + * // { ... }, + * // output: '(\\.[\\\\\\/])?abc\\/(?!\\.)(?=.)[^\\/]*?\\.js', + * // ast: + * // { type: 'root', + * // errors: [], + * // nodes: + * // [ ... ], + * // dot: false, + * // input: 'abc/*.js' }, + * // parsingErrors: [], + * // map: + * // { version: 3, + * // sources: [ 'string' ], + * // names: [], + * // mappings: 'AAAA,GAAG,EAAC,kBAAC,EAAC,EAAE', + * // sourcesContent: [ 'abc/*.js' ] }, + * // position: { line: 1, column: 28 }, + * // content: {}, + * // files: {}, + * // idx: 6 }] + * ``` + * @param {String} `pattern` Glob pattern to parse and compile. + * @param {Object} `options` Any [options](#options) to change how parsing and compiling is performed. + * @return {Object} Returns an object with the parsed AST, compiled string and optional source map. + * @api public + */ + +micromatch.create = function(pattern, options) { + return memoize('create', pattern, options, function() { + function create(str, opts) { + return micromatch.compile(micromatch.parse(str, opts), opts); + } + + pattern = micromatch.braces(pattern, options); + var len = pattern.length; + var idx = -1; + var res = []; + + while (++idx < len) { + res.push(create(pattern[idx], options)); + } + return res; + }); +}; + +/** + * Parse the given `str` with the given `options`. + * + * ```js + * var mm = require('micromatch'); + * mm.parse(pattern[, options]); + * + * var ast = mm.parse('a/{b,c}/d'); + * console.log(ast); + * // { type: 'root', + * // errors: [], + * // input: 'a/{b,c}/d', + * // nodes: + * // [ { type: 'bos', val: '' }, + * // { type: 'text', val: 'a/' }, + * // { type: 'brace', + * // nodes: + * // [ { type: 'brace.open', val: '{' }, + * // { type: 'text', val: 'b,c' }, + * // { type: 'brace.close', val: '}' } ] }, + * // { type: 'text', val: '/d' }, + * // { type: 'eos', val: '' } ] } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an AST + * @api public + */ + +micromatch.parse = function(pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('expected a string'); + } + + function parse() { + var snapdragon = utils.instantiate(null, options); + parsers(snapdragon, options); + + var ast = snapdragon.parse(pattern, options); + utils.define(ast, 'snapdragon', snapdragon); + ast.input = pattern; + return ast; + } + + return memoize('parse', pattern, options, parse); +}; + +/** + * Compile the given `ast` or string with the given `options`. + * + * ```js + * var mm = require('micromatch'); + * mm.compile(ast[, options]); + * + * var ast = mm.parse('a/{b,c}/d'); + * console.log(mm.compile(ast)); + * // { options: { source: 'string' }, + * // state: {}, + * // compilers: + * // { eos: [Function], + * // noop: [Function], + * // bos: [Function], + * // brace: [Function], + * // 'brace.open': [Function], + * // text: [Function], + * // 'brace.close': [Function] }, + * // output: [ 'a/(b|c)/d' ], + * // ast: + * // { ... }, + * // parsingErrors: [] } + * ``` + * @param {Object|String} `ast` + * @param {Object} `options` + * @return {Object} Returns an object that has an `output` property with the compiled string. + * @api public + */ + +micromatch.compile = function(ast, options) { + if (typeof ast === 'string') { + ast = micromatch.parse(ast, options); + } + + return memoize('compile', ast.input, options, function() { + var snapdragon = utils.instantiate(ast, options); + compilers(snapdragon, options); + return snapdragon.compile(ast, options); + }); +}; + +/** + * Clear the regex cache. + * + * ```js + * mm.clearCache(); + * ``` + * @api public + */ + +micromatch.clearCache = function() { + micromatch.cache.caches = {}; +}; + +/** + * Returns true if the given value is effectively an empty string + */ + +function isEmptyString(val) { + return String(val) === '' || String(val) === './'; +} + +/** + * Compose a matcher function with the given patterns. + * This allows matcher functions to be compiled once and + * called multiple times. + */ + +function compose(patterns, options, matcher) { + var matchers; + + return memoize('compose', String(patterns), options, function() { + return function(file) { + // delay composition until it's invoked the first time, + // after that it won't be called again + if (!matchers) { + matchers = []; + for (var i = 0; i < patterns.length; i++) { + matchers.push(matcher(patterns[i], options)); + } + } + + var len = matchers.length; + while (len--) { + if (matchers[len](file) === true) { + return true; + } + } + return false; + }; + }); +} + +/** + * Memoize a generated regex or function. A unique key is generated + * from the `type` (usually method name), the `pattern`, and + * user-defined options. + */ + +function memoize(type, pattern, options, fn) { + var key = utils.createKey(type + '=' + pattern, options); + + if (options && options.cache === false) { + return fn(pattern, options); + } + + if (cache.has(type, key)) { + return cache.get(type, key); + } + + var val = fn(pattern, options); + cache.set(type, key, val); + return val; +} + +/** + * Expose compiler, parser and cache on `micromatch` + */ + +micromatch.compilers = compilers; +micromatch.parsers = parsers; +micromatch.caches = cache.caches; + +/** + * Expose `micromatch` + * @type {Function} + */ + +module.exports = micromatch; diff --git a/node_modules/readdirp/node_modules/micromatch/lib/.DS_Store b/node_modules/readdirp/node_modules/micromatch/lib/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0=0.10.0" + }, + "files": [ + "index.js", + "lib" + ], + "homepage": "https://github.com/micromatch/micromatch", + "keywords": [ + "bash", + "expand", + "expansion", + "expression", + "file", + "files", + "filter", + "find", + "glob", + "globbing", + "globs", + "globstar", + "match", + "matcher", + "matches", + "matching", + "micromatch", + "minimatch", + "multimatch", + "path", + "pattern", + "patterns", + "regex", + "regexp", + "regular", + "shell", + "wildcard" + ], + "license": "MIT", + "lintDeps": { + "dependencies": { + "options": { + "lock": { + "snapdragon": "^0.8.1" + } + } + }, + "devDependencies": { + "files": { + "options": { + "ignore": [ + "benchmark/**" + ] + } + } + } + }, + "main": "index.js", + "name": "micromatch", + "repository": { + "type": "git", + "url": "git+https://github.com/micromatch/micromatch.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": "collapsible", + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "helpers": [ + "./benchmark/helper.js" + ], + "related": { + "list": [ + "braces", + "expand-brackets", + "extglob", + "fill-range", + "nanomatch" + ] + }, + "lint": { + "reflinks": true + }, + "reflinks": [ + "expand-brackets", + "extglob", + "glob-object", + "minimatch", + "multimatch", + "snapdragon" + ] + }, + "version": "3.1.10" +} diff --git a/node_modules/readdirp/package.json b/node_modules/readdirp/package.json new file mode 100644 index 000000000..79b26881b --- /dev/null +++ b/node_modules/readdirp/package.json @@ -0,0 +1,101 @@ +{ + "_from": "readdirp@^2.0.0", + "_id": "readdirp@2.2.1", + "_inBundle": false, + "_integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "_location": "/readdirp", + "_phantomChildren": { + "arr-flatten": "1.1.0", + "debug": "2.6.9", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "fragment-cache": "0.2.1", + "is-buffer": "1.1.6", + "is-extendable": "0.1.1", + "nanomatch": "1.2.13", + "object.pick": "1.3.0", + "posix-character-classes": "0.1.1", + "regex-not": "1.0.2", + "repeat-element": "1.1.3", + "repeat-string": "1.6.1", + "snapdragon": "0.8.2", + "snapdragon-node": "2.1.1", + "split-string": "3.1.0", + "to-regex": "3.0.2", + "to-regex-range": "2.1.1" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "readdirp@^2.0.0", + "name": "readdirp", + "escapedName": "readdirp", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/chokidar" + ], + "_resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "_shasum": "0e87622a3325aa33e892285caf8b4e846529a525", + "_spec": "readdirp@^2.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/chokidar", + "author": { + "name": "Thorsten Lorenz", + "email": "thlorenz@gmx.de", + "url": "thlorenz.com" + }, + "bugs": { + "url": "https://github.com/paulmillr/readdirp/issues" + }, + "bundleDependencies": false, + "dependencies": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + }, + "deprecated": false, + "description": "Recursive version of fs.readdir with streaming api.", + "devDependencies": { + "nave": "^0.5.1", + "proxyquire": "^1.7.9", + "tap": "1.3.2", + "through2": "^2.0.0" + }, + "engines": { + "node": ">=0.10" + }, + "files": [ + "readdirp.js", + "stream-api.js" + ], + "homepage": "https://github.com/paulmillr/readdirp", + "keywords": [ + "recursive", + "fs", + "stream", + "streams", + "readdir", + "filesystem", + "find", + "filter" + ], + "license": "MIT", + "main": "readdirp.js", + "name": "readdirp", + "repository": { + "type": "git", + "url": "git://github.com/paulmillr/readdirp.git" + }, + "scripts": { + "test": "npm run test-main", + "test-0.10": "nave use 0.10 npm run test-main", + "test-0.12": "nave use 0.12 npm run test-main", + "test-4": "nave use 4.4 npm run test-main", + "test-6": "nave use 6.2 npm run test-main", + "test-all": "npm run test-main && npm run test-0.10 && npm run test-0.12 && npm run test-4 && npm run test-6", + "test-main": "(cd test && set -e; for t in ./*.js; do node $t; done)" + }, + "version": "2.2.1" +} diff --git a/node_modules/readdirp/readdirp.js b/node_modules/readdirp/readdirp.js new file mode 100644 index 000000000..863bd17b8 --- /dev/null +++ b/node_modules/readdirp/readdirp.js @@ -0,0 +1,294 @@ +'use strict'; + +var fs = require('graceful-fs') + , path = require('path') + , micromatch = require('micromatch').isMatch + , toString = Object.prototype.toString + ; + + +// Standard helpers +function isFunction (obj) { + return toString.call(obj) === '[object Function]'; +} + +function isString (obj) { + return toString.call(obj) === '[object String]'; +} + +function isUndefined (obj) { + return obj === void 0; +} + +/** + * Main function which ends up calling readdirRec and reads all files and directories in given root recursively. + * @param { Object } opts Options to specify root (start directory), filters and recursion depth + * @param { function } callback1 When callback2 is given calls back for each processed file - function (fileInfo) { ... }, + * when callback2 is not given, it behaves like explained in callback2 + * @param { function } callback2 Calls back once all files have been processed with an array of errors and file infos + * function (err, fileInfos) { ... } + */ +function readdir(opts, callback1, callback2) { + var stream + , handleError + , handleFatalError + , errors = [] + , readdirResult = { + directories: [] + , files: [] + } + , fileProcessed + , allProcessed + , realRoot + , aborted = false + , paused = false + ; + + // If no callbacks were given we will use a streaming interface + if (isUndefined(callback1)) { + var api = require('./stream-api')(); + stream = api.stream; + callback1 = api.processEntry; + callback2 = api.done; + handleError = api.handleError; + handleFatalError = api.handleFatalError; + + stream.on('close', function () { aborted = true; }); + stream.on('pause', function () { paused = true; }); + stream.on('resume', function () { paused = false; }); + } else { + handleError = function (err) { errors.push(err); }; + handleFatalError = function (err) { + handleError(err); + allProcessed(errors, null); + }; + } + + if (isUndefined(opts)){ + handleFatalError(new Error ( + 'Need to pass at least one argument: opts! \n' + + 'https://github.com/paulmillr/readdirp#options' + ) + ); + return stream; + } + + opts.root = opts.root || '.'; + opts.fileFilter = opts.fileFilter || function() { return true; }; + opts.directoryFilter = opts.directoryFilter || function() { return true; }; + opts.depth = typeof opts.depth === 'undefined' ? 999999999 : opts.depth; + opts.entryType = opts.entryType || 'files'; + + var statfn = opts.lstat === true ? fs.lstat.bind(fs) : fs.stat.bind(fs); + + if (isUndefined(callback2)) { + fileProcessed = function() { }; + allProcessed = callback1; + } else { + fileProcessed = callback1; + allProcessed = callback2; + } + + function normalizeFilter (filter) { + + if (isUndefined(filter)) return undefined; + + function isNegated (filters) { + + function negated(f) { + return f.indexOf('!') === 0; + } + + var some = filters.some(negated); + if (!some) { + return false; + } else { + if (filters.every(negated)) { + return true; + } else { + // if we detect illegal filters, bail out immediately + throw new Error( + 'Cannot mix negated with non negated glob filters: ' + filters + '\n' + + 'https://github.com/paulmillr/readdirp#filters' + ); + } + } + } + + // Turn all filters into a function + if (isFunction(filter)) { + + return filter; + + } else if (isString(filter)) { + + return function (entryInfo) { + return micromatch(entryInfo.name, filter.trim()); + }; + + } else if (filter && Array.isArray(filter)) { + + if (filter) filter = filter.map(function (f) { + return f.trim(); + }); + + return isNegated(filter) ? + // use AND to concat multiple negated filters + function (entryInfo) { + return filter.every(function (f) { + return micromatch(entryInfo.name, f); + }); + } + : + // use OR to concat multiple inclusive filters + function (entryInfo) { + return filter.some(function (f) { + return micromatch(entryInfo.name, f); + }); + }; + } + } + + function processDir(currentDir, entries, callProcessed) { + if (aborted) return; + var total = entries.length + , processed = 0 + , entryInfos = [] + ; + + fs.realpath(currentDir, function(err, realCurrentDir) { + if (aborted) return; + if (err) { + handleError(err); + callProcessed(entryInfos); + return; + } + + var relDir = path.relative(realRoot, realCurrentDir); + + if (entries.length === 0) { + callProcessed([]); + } else { + entries.forEach(function (entry) { + + var fullPath = path.join(realCurrentDir, entry) + , relPath = path.join(relDir, entry); + + statfn(fullPath, function (err, stat) { + if (err) { + handleError(err); + } else { + entryInfos.push({ + name : entry + , path : relPath // relative to root + , fullPath : fullPath + + , parentDir : relDir // relative to root + , fullParentDir : realCurrentDir + + , stat : stat + }); + } + processed++; + if (processed === total) callProcessed(entryInfos); + }); + }); + } + }); + } + + function readdirRec(currentDir, depth, callCurrentDirProcessed) { + var args = arguments; + if (aborted) return; + if (paused) { + setImmediate(function () { + readdirRec.apply(null, args); + }) + return; + } + + fs.readdir(currentDir, function (err, entries) { + if (err) { + handleError(err); + callCurrentDirProcessed(); + return; + } + + processDir(currentDir, entries, function(entryInfos) { + + var subdirs = entryInfos + .filter(function (ei) { return ei.stat.isDirectory() && opts.directoryFilter(ei); }); + + subdirs.forEach(function (di) { + if(opts.entryType === 'directories' || opts.entryType === 'both' || opts.entryType === 'all') { + fileProcessed(di); + } + readdirResult.directories.push(di); + }); + + entryInfos + .filter(function(ei) { + var isCorrectType = opts.entryType === 'all' ? + !ei.stat.isDirectory() : ei.stat.isFile() || ei.stat.isSymbolicLink(); + return isCorrectType && opts.fileFilter(ei); + }) + .forEach(function (fi) { + if(opts.entryType === 'files' || opts.entryType === 'both' || opts.entryType === 'all') { + fileProcessed(fi); + } + readdirResult.files.push(fi); + }); + + var pendingSubdirs = subdirs.length; + + // Be done if no more subfolders exist or we reached the maximum desired depth + if(pendingSubdirs === 0 || depth === opts.depth) { + callCurrentDirProcessed(); + } else { + // recurse into subdirs, keeping track of which ones are done + // and call back once all are processed + subdirs.forEach(function (subdir) { + readdirRec(subdir.fullPath, depth + 1, function () { + pendingSubdirs = pendingSubdirs - 1; + if(pendingSubdirs === 0) { + callCurrentDirProcessed(); + } + }); + }); + } + }); + }); + } + + // Validate and normalize filters + try { + opts.fileFilter = normalizeFilter(opts.fileFilter); + opts.directoryFilter = normalizeFilter(opts.directoryFilter); + } catch (err) { + // if we detect illegal filters, bail out immediately + handleFatalError(err); + return stream; + } + + // If filters were valid get on with the show + fs.realpath(opts.root, function(err, res) { + if (err) { + handleFatalError(err); + return stream; + } + + realRoot = res; + readdirRec(opts.root, 0, function () { + // All errors are collected into the errors array + if (errors.length > 0) { + allProcessed(errors, readdirResult); + } else { + allProcessed(null, readdirResult); + } + }); + }); + + return stream; +} + +module.exports = readdir; diff --git a/node_modules/readdirp/stream-api.js b/node_modules/readdirp/stream-api.js new file mode 100644 index 000000000..bffd1a977 --- /dev/null +++ b/node_modules/readdirp/stream-api.js @@ -0,0 +1,98 @@ +'use strict'; + +var stream = require('readable-stream'); +var util = require('util'); + +var Readable = stream.Readable; + +module.exports = ReaddirpReadable; + +util.inherits(ReaddirpReadable, Readable); + +function ReaddirpReadable (opts) { + if (!(this instanceof ReaddirpReadable)) return new ReaddirpReadable(opts); + + opts = opts || {}; + + opts.objectMode = true; + Readable.call(this, opts); + + // backpressure not implemented at this point + this.highWaterMark = Infinity; + + this._destroyed = false; + this._paused = false; + this._warnings = []; + this._errors = []; + + this._pauseResumeErrors(); +} + +var proto = ReaddirpReadable.prototype; + +proto._pauseResumeErrors = function () { + var self = this; + self.on('pause', function () { self._paused = true }); + self.on('resume', function () { + if (self._destroyed) return; + self._paused = false; + + self._warnings.forEach(function (err) { self.emit('warn', err) }); + self._warnings.length = 0; + + self._errors.forEach(function (err) { self.emit('error', err) }); + self._errors.length = 0; + }) +} + +// called for each entry +proto._processEntry = function (entry) { + if (this._destroyed) return; + this.push(entry); +} + +proto._read = function () { } + +proto.destroy = function () { + // when stream is destroyed it will emit nothing further, not even errors or warnings + this.push(null); + this.readable = false; + this._destroyed = true; + this.emit('close'); +} + +proto._done = function () { + this.push(null); +} + +// we emit errors and warnings async since we may handle errors like invalid args +// within the initial event loop before any event listeners subscribed +proto._handleError = function (err) { + var self = this; + setImmediate(function () { + if (self._paused) return self._warnings.push(err); + if (!self._destroyed) self.emit('warn', err); + }); +} + +proto._handleFatalError = function (err) { + var self = this; + setImmediate(function () { + if (self._paused) return self._errors.push(err); + if (!self._destroyed) self.emit('error', err); + }); +} + +function createStreamAPI () { + var stream = new ReaddirpReadable(); + + return { + stream : stream + , processEntry : stream._processEntry.bind(stream) + , done : stream._done.bind(stream) + , handleError : stream._handleError.bind(stream) + , handleFatalError : stream._handleFatalError.bind(stream) + }; +} + +module.exports = createStreamAPI; diff --git a/node_modules/regenerator-runtime/README.md b/node_modules/regenerator-runtime/README.md new file mode 100644 index 000000000..d93386a30 --- /dev/null +++ b/node_modules/regenerator-runtime/README.md @@ -0,0 +1,31 @@ +# regenerator-runtime + +Standalone runtime for +[Regenerator](https://github.com/facebook/regenerator)-compiled generator +and `async` functions. + +To import the runtime as a module (recommended), either of the following +import styles will work: +```js +// CommonJS +const regeneratorRuntime = require("regenerator-runtime"); + +// ECMAScript 2015 +import regeneratorRuntime from "regenerator-runtime"; +``` + +To ensure that `regeneratorRuntime` is defined globally, either of the +following styles will work: +```js +// CommonJS +require("regenerator-runtime/runtime"); + +// ECMAScript 2015 +import "regenerator-runtime/runtime"; +``` + +To get the absolute file system path of `runtime.js`, evaluate the +following expression: +```js +require("regenerator-runtime/path").path +``` diff --git a/node_modules/regenerator-runtime/package.json b/node_modules/regenerator-runtime/package.json new file mode 100644 index 000000000..867c256df --- /dev/null +++ b/node_modules/regenerator-runtime/package.json @@ -0,0 +1,46 @@ +{ + "_from": "regenerator-runtime@^0.11.1", + "_id": "regenerator-runtime@0.11.1", + "_inBundle": false, + "_integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "_location": "/regenerator-runtime", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "regenerator-runtime@^0.11.1", + "name": "regenerator-runtime", + "escapedName": "regenerator-runtime", + "rawSpec": "^0.11.1", + "saveSpec": null, + "fetchSpec": "^0.11.1" + }, + "_requiredBy": [ + "/@babel/polyfill" + ], + "_resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "_shasum": "be05ad7f9bf7d22e056f9726cee5017fbf19e2e9", + "_spec": "regenerator-runtime@^0.11.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/@babel/polyfill", + "author": { + "name": "Ben Newman", + "email": "bn@cs.stanford.edu" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Runtime for Regenerator-compiled generator and async functions.", + "keywords": [ + "regenerator", + "runtime", + "generator", + "async" + ], + "license": "MIT", + "main": "runtime-module.js", + "name": "regenerator-runtime", + "repository": { + "type": "git", + "url": "https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime" + }, + "version": "0.11.1" +} diff --git a/node_modules/regenerator-runtime/path.js b/node_modules/regenerator-runtime/path.js new file mode 100644 index 000000000..ced878b88 --- /dev/null +++ b/node_modules/regenerator-runtime/path.js @@ -0,0 +1,11 @@ +/** + * Copyright (c) 2014-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. + */ + +exports.path = require("path").join( + __dirname, + "runtime.js" +); diff --git a/node_modules/regenerator-runtime/runtime-module.js b/node_modules/regenerator-runtime/runtime-module.js new file mode 100644 index 000000000..ed2843177 --- /dev/null +++ b/node_modules/regenerator-runtime/runtime-module.js @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2014-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 method of obtaining a reference to the global object needs to be +// kept identical to the way it is obtained in runtime.js +var g = (function() { return this })() || Function("return this")(); + +// Use `getOwnPropertyNames` because not all browsers support calling +// `hasOwnProperty` on the global `self` object in a worker. See #183. +var hadRuntime = g.regeneratorRuntime && + Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0; + +// Save the old regeneratorRuntime in case it needs to be restored later. +var oldRuntime = hadRuntime && g.regeneratorRuntime; + +// Force reevalutation of runtime.js. +g.regeneratorRuntime = undefined; + +module.exports = require("./runtime"); + +if (hadRuntime) { + // Restore the original runtime. + g.regeneratorRuntime = oldRuntime; +} else { + // Remove the global property added by runtime.js. + try { + delete g.regeneratorRuntime; + } catch(e) { + g.regeneratorRuntime = undefined; + } +} diff --git a/node_modules/regenerator-runtime/runtime.js b/node_modules/regenerator-runtime/runtime.js new file mode 100644 index 000000000..22e7b005c --- /dev/null +++ b/node_modules/regenerator-runtime/runtime.js @@ -0,0 +1,727 @@ +/** + * Copyright (c) 2014-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. + */ + +!(function(global) { + "use strict"; + + var Op = Object.prototype; + var hasOwn = Op.hasOwnProperty; + var undefined; // More compressible than void 0. + var $Symbol = typeof Symbol === "function" ? Symbol : {}; + var iteratorSymbol = $Symbol.iterator || "@@iterator"; + var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + + var inModule = typeof module === "object"; + var runtime = global.regeneratorRuntime; + if (runtime) { + if (inModule) { + // If regeneratorRuntime is defined globally and we're in a module, + // make the exports object identical to regeneratorRuntime. + module.exports = runtime; + } + // Don't bother evaluating the rest of this file if the runtime was + // already defined globally. + return; + } + + // Define the runtime globally (as expected by generated code) as either + // module.exports (if we're in a module) or a new, empty object. + runtime = global.regeneratorRuntime = inModule ? module.exports : {}; + + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; + var generator = Object.create(protoGenerator.prototype); + var context = new Context(tryLocsList || []); + + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + generator._invoke = makeInvokeMethod(innerFn, self, context); + + return generator; + } + runtime.wrap = wrap; + + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; + } + } + + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; + + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + + // This is a polyfill for %IteratorPrototype% for environments that + // don't natively support it. + var IteratorPrototype = {}; + IteratorPrototype[iteratorSymbol] = function () { + return this; + }; + + var getProto = Object.getPrototypeOf; + var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); + if (NativeIteratorPrototype && + NativeIteratorPrototype !== Op && + hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { + // This environment has a native %IteratorPrototype%; use it instead + // of the polyfill. + IteratorPrototype = NativeIteratorPrototype; + } + + var Gp = GeneratorFunctionPrototype.prototype = + Generator.prototype = Object.create(IteratorPrototype); + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunctionPrototype[toStringTagSymbol] = + GeneratorFunction.displayName = "GeneratorFunction"; + + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + prototype[method] = function(arg) { + return this._invoke(method, arg); + }; + }); + } + + runtime.isGeneratorFunction = function(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor + ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" + : false; + }; + + runtime.mark = function(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + if (!(toStringTagSymbol in genFun)) { + genFun[toStringTagSymbol] = "GeneratorFunction"; + } + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `hasOwn.call(value, "__await")` to determine if the yielded value is + // meant to be awaited. + runtime.awrap = function(arg) { + return { __await: arg }; + }; + + function AsyncIterator(generator) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + if (record.type === "throw") { + reject(record.arg); + } else { + var result = record.arg; + var value = result.value; + if (value && + typeof value === "object" && + hasOwn.call(value, "__await")) { + return Promise.resolve(value.__await).then(function(value) { + invoke("next", value, resolve, reject); + }, function(err) { + invoke("throw", err, resolve, reject); + }); + } + + return Promise.resolve(value).then(function(unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. If the Promise is rejected, however, the + // result for this iteration will be rejected with the same + // reason. Note that rejections of yielded Promises are not + // thrown back into the generator function, as is the case + // when an awaited Promise is rejected. This difference in + // behavior between yield and await is important, because it + // allows the consumer to decide what to do with the yielded + // rejection (swallow it and continue, manually .throw it back + // into the generator, abandon iteration, whatever). With + // await, by contrast, there is no opportunity to examine the + // rejection reason outside the generator function, so the + // only option is to throw it from the await expression, and + // let the generator function handle the exception. + result.value = unwrapped; + resolve(result); + }, reject); + } + } + + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return new Promise(function(resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } + + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then( + callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg + ) : callInvokeWithMethodAndArg(); + } + + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + this._invoke = enqueue; + } + + defineIteratorMethods(AsyncIterator.prototype); + AsyncIterator.prototype[asyncIteratorSymbol] = function () { + return this; + }; + runtime.AsyncIterator = AsyncIterator; + + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + runtime.async = function(innerFn, outerFn, self, tryLocsList) { + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList) + ); + + return runtime.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + return doneResult(); + } + + context.method = method; + context.arg = arg; + + while (true) { + var delegate = context.delegate; + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + if (delegateResult) { + if (delegateResult === ContinueSentinel) continue; + return delegateResult; + } + } + + if (context.method === "next") { + // Setting context._sent for legacy support of Babel's + // function.sent implementation. + context.sent = context._sent = context.arg; + + } else if (context.method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw context.arg; + } + + context.dispatchException(context.arg); + + } else if (context.method === "return") { + context.abrupt("return", context.arg); + } + + state = GenStateExecuting; + + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; + + if (record.arg === ContinueSentinel) { + continue; + } + + return { + value: record.arg, + done: context.done + }; + + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(context.arg) call above. + context.method = "throw"; + context.arg = record.arg; + } + } + }; + } + + // Call delegate.iterator[context.method](context.arg) and handle the + // result, either by returning a { value, done } result from the + // delegate iterator, or by modifying context.method and context.arg, + // setting context.delegate to null, and returning the ContinueSentinel. + function maybeInvokeDelegate(delegate, context) { + var method = delegate.iterator[context.method]; + if (method === undefined) { + // A .throw or .return when the delegate iterator has no .throw + // method always terminates the yield* loop. + context.delegate = null; + + if (context.method === "throw") { + if (delegate.iterator.return) { + // If the delegate iterator has a return method, give it a + // chance to clean up. + context.method = "return"; + context.arg = undefined; + maybeInvokeDelegate(delegate, context); + + if (context.method === "throw") { + // If maybeInvokeDelegate(context) changed context.method from + // "return" to "throw", let that override the TypeError below. + return ContinueSentinel; + } + } + + context.method = "throw"; + context.arg = new TypeError( + "The iterator does not provide a 'throw' method"); + } + + return ContinueSentinel; + } + + var record = tryCatch(method, delegate.iterator, context.arg); + + if (record.type === "throw") { + context.method = "throw"; + context.arg = record.arg; + context.delegate = null; + return ContinueSentinel; + } + + var info = record.arg; + + if (! info) { + context.method = "throw"; + context.arg = new TypeError("iterator result is not an object"); + context.delegate = null; + return ContinueSentinel; + } + + if (info.done) { + // Assign the result of the finished delegate to the temporary + // variable specified by delegate.resultName (see delegateYield). + context[delegate.resultName] = info.value; + + // Resume execution at the desired location (see delegateYield). + context.next = delegate.nextLoc; + + // If context.method was "throw" but the delegate handled the + // exception, let the outer generator proceed normally. If + // context.method was "next", forget context.arg since it has been + // "consumed" by the delegate iterator. If context.method was + // "return", allow the original .return call to continue in the + // outer generator. + if (context.method !== "return") { + context.method = "next"; + context.arg = undefined; + } + + } else { + // Re-yield the result returned by the delegate method. + return info; + } + + // The delegate iterator is finished, so forget it and continue with + // the outer generator. + context.delegate = null; + return ContinueSentinel; + } + + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); + + Gp[toStringTagSymbol] = "Generator"; + + // A Generator should always return itself as the iterator object when the + // @@iterator function is called on it. Some browsers' implementations of the + // iterator prototype chain incorrectly implement this, causing the Generator + // object to not be returned from this call. This ensures that doesn't happen. + // See https://github.com/facebook/regenerator/issues/274 for more details. + Gp[iteratorSymbol] = function() { + return this; + }; + + Gp.toString = function() { + return "[object Generator]"; + }; + + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + runtime.keys = function(object) { + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined; + next.done = true; + + return next; + }; + + return next.next = next; + } + } + + // Return an iterator with no values. + return { next: doneResult }; + } + runtime.values = values; + + function doneResult() { + return { value: undefined, done: true }; + } + + Context.prototype = { + constructor: Context, + + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + // Resetting context._sent for legacy support of Babel's + // function.sent implementation. + this.sent = this._sent = undefined; + this.done = false; + this.delegate = null; + + this.method = "next"; + this.arg = undefined; + + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + + stop: function() { + this.done = true; + + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + + dispatchException: function(exception) { + if (this.done) { + throw exception; + } + + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + + if (caught) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + context.method = "next"; + context.arg = undefined; + } + + return !! caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + + abrupt: function(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && + (type === "break" || + type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.method = "next"; + this.next = finallyEntry.finallyLoc; + return ContinueSentinel; + } + + return this.complete(record); + }, + + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || + record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = this.arg = record.arg; + this.method = "return"; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + + return ContinueSentinel; + }, + + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, + + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + if (this.method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + this.arg = undefined; + } + + return ContinueSentinel; + } + }; +})( + // In sloppy mode, unbound `this` refers to the global object, fallback to + // Function constructor if we're in global strict mode. That is sadly a form + // of indirect eval which violates Content Security Policy. + (function() { return this })() || Function("return this")() +); diff --git a/node_modules/regex-cache/LICENSE b/node_modules/regex-cache/LICENSE new file mode 100644 index 000000000..c0d7f1362 --- /dev/null +++ b/node_modules/regex-cache/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert. + +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. \ No newline at end of file diff --git a/node_modules/regex-cache/README.md b/node_modules/regex-cache/README.md new file mode 100644 index 000000000..8c6601478 --- /dev/null +++ b/node_modules/regex-cache/README.md @@ -0,0 +1,166 @@ +# regex-cache [![NPM version](https://img.shields.io/npm/v/regex-cache.svg?style=flat)](https://www.npmjs.com/package/regex-cache) [![NPM monthly downloads](https://img.shields.io/npm/dm/regex-cache.svg?style=flat)](https://npmjs.org/package/regex-cache) [![NPM total downloads](https://img.shields.io/npm/dt/regex-cache.svg?style=flat)](https://npmjs.org/package/regex-cache) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/regex-cache.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/regex-cache) [![Windows Build Status](https://img.shields.io/appveyor/ci/jonschlinkert/regex-cache.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/jonschlinkert/regex-cache) + +> Memoize the results of a call to the RegExp constructor, avoiding repetitious runtime compilation of the same string and options, resulting in surprising performance improvements. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save regex-cache +``` + +* Read [what this does](#what-this-does). +* See [the benchmarks](#benchmarks) + +## Usage + +Wrap a function like this: + +```js +var cache = require('regex-cache'); +var someRegex = cache(require('some-regex-lib')); +``` + +**Caching a regex** + +If you want to cache a regex after calling `new RegExp()`, or you're requiring a module that returns a regex, wrap it with a function first: + +```js +var cache = require('regex-cache'); + +function yourRegex(str, opts) { + // do stuff to str and opts + return new RegExp(str, opts.flags); +} + +var regex = cache(yourRegex); +``` + +## Recommendations + +### Use this when... + +* **No options are passed** to the function that creates the regex. Regardless of how big or small the regex is, when zero options are passed, caching will be faster than not. +* **A few options are passed**, and the values are primitives. The limited benchmarks I did show that caching is beneficial when up to 8 or 9 options are passed. + +### Do not use this when... + +* **The values of options are not primitives**. When non-primitives must be compared for equality, the time to compare the options is most likely as long or longer than the time to just create a new regex. + +### Example benchmarks + +Performance results, with and without regex-cache: + +```bash +# no args passed (defaults) + with-cache x 8,699,231 ops/sec ±0.86% (93 runs sampled) + without-cache x 2,777,551 ops/sec ±0.63% (95 runs sampled) + +# string and six options passed + with-cache x 1,885,934 ops/sec ±0.80% (93 runs sampled) + without-cache x 1,256,893 ops/sec ±0.65% (97 runs sampled) + +# string only + with-cache x 7,723,256 ops/sec ±0.87% (92 runs sampled) + without-cache x 2,303,060 ops/sec ±0.47% (99 runs sampled) + +# one option passed + with-cache x 4,179,877 ops/sec ±0.53% (100 runs sampled) + without-cache x 2,198,422 ops/sec ±0.47% (95 runs sampled) + +# two options passed + with-cache x 3,256,222 ops/sec ±0.51% (99 runs sampled) + without-cache x 2,121,401 ops/sec ±0.79% (97 runs sampled) + +# six options passed + with-cache x 1,816,018 ops/sec ±1.08% (96 runs sampled) + without-cache x 1,157,176 ops/sec ±0.53% (100 runs sampled) + +# +# diminishing returns happen about here +# + +# ten options passed + with-cache x 1,210,598 ops/sec ±0.56% (92 runs sampled) + without-cache x 1,665,588 ops/sec ±1.07% (100 runs sampled) + +# twelve options passed + with-cache x 1,042,096 ops/sec ±0.68% (92 runs sampled) + without-cache x 1,389,414 ops/sec ±0.68% (97 runs sampled) + +# twenty options passed + with-cache x 661,125 ops/sec ±0.80% (93 runs sampled) + without-cache x 1,208,757 ops/sec ±0.65% (97 runs sampled) + +# +# when non-primitive values are compared +# + +# single value on the options is an object + with-cache x 1,398,313 ops/sec ±1.05% (95 runs sampled) + without-cache x 2,228,281 ops/sec ±0.56% (99 runs sampled) +``` + +## Run benchmarks + +Install dev dependencies: + +```bash +npm i -d && npm run benchmarks +``` + +## What this does + +If you're using `new RegExp('foo')` instead of a regex literal, it's probably because you need to dyamically generate a regex based on user options or some other potentially changing factors. + +When your function creates a string based on user inputs and passes it to the `RegExp` constructor, regex-cache caches the results. The next time the function is called if the key of a cached regex matches the user input (or no input was given), the cached regex is returned, avoiding unnecessary runtime compilation. + +Using the RegExp constructor offers a lot of flexibility, but the runtime compilation comes at a price - it's slow. Not specifically because of the call to the RegExp constructor, but **because you have to build up the string before `new RegExp()` is even called**. + +## About + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 31 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [MartinKolarik](https://github.com/MartinKolarik) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on September 01, 2017._ \ No newline at end of file diff --git a/node_modules/regex-cache/index.js b/node_modules/regex-cache/index.js new file mode 100644 index 000000000..df8c42312 --- /dev/null +++ b/node_modules/regex-cache/index.js @@ -0,0 +1,68 @@ +/*! + * regex-cache + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var equal = require('is-equal-shallow'); +var basic = {}; +var cache = {}; + +/** + * Expose `regexCache` + */ + +module.exports = regexCache; + +/** + * Memoize the results of a call to the new RegExp constructor. + * + * @param {Function} fn [description] + * @param {String} str [description] + * @param {Options} options [description] + * @param {Boolean} nocompare [description] + * @return {RegExp} + */ + +function regexCache(fn, str, opts) { + var key = '_default_', regex, cached; + + if (!str && !opts) { + if (typeof fn !== 'function') { + return fn; + } + return basic[key] || (basic[key] = fn(str)); + } + + var isString = typeof str === 'string'; + if (isString) { + if (!opts) { + return basic[str] || (basic[str] = fn(str)); + } + key = str; + } else { + opts = str; + } + + cached = cache[key]; + if (cached && equal(cached.opts, opts)) { + return cached.regex; + } + + memo(key, opts, (regex = fn(str, opts))); + return regex; +} + +function memo(key, opts, regex) { + cache[key] = {regex: regex, opts: opts}; +} + +/** + * Expose `cache` + */ + +module.exports.cache = cache; +module.exports.basic = basic; diff --git a/node_modules/regex-cache/package.json b/node_modules/regex-cache/package.json new file mode 100644 index 000000000..b63b9a0b9 --- /dev/null +++ b/node_modules/regex-cache/package.json @@ -0,0 +1,101 @@ +{ + "_from": "regex-cache@^0.4.2", + "_id": "regex-cache@0.4.4", + "_inBundle": false, + "_integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "_location": "/regex-cache", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "regex-cache@^0.4.2", + "name": "regex-cache", + "escapedName": "regex-cache", + "rawSpec": "^0.4.2", + "saveSpec": null, + "fetchSpec": "^0.4.2" + }, + "_requiredBy": [ + "/micromatch" + ], + "_resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "_shasum": "75bdc58a2a1496cec48a12835bc54c8d562336dd", + "_spec": "regex-cache@^0.4.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/regex-cache/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Martin Kolárik", + "url": "https://kolarik.sk" + } + ], + "dependencies": { + "is-equal-shallow": "^0.1.3" + }, + "deprecated": false, + "description": "Memoize the results of a call to the RegExp constructor, avoiding repetitious runtime compilation of the same string and options, resulting in surprising performance improvements.", + "devDependencies": { + "ansi-bold": "^0.1.1", + "benchmarked": "^0.1.5", + "gulp-format-md": "^0.1.7", + "micromatch": "^2.3.7", + "should": "^8.3.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/regex-cache", + "keywords": [ + "cache", + "expression", + "regex", + "regexp", + "regular", + "regular expression", + "store", + "to-regex" + ], + "license": "MIT", + "main": "index.js", + "name": "regex-cache", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/regex-cache.git" + }, + "scripts": { + "benchmarks": "node benchmark", + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "0.4.4" +} diff --git a/node_modules/regex-not/LICENSE b/node_modules/regex-not/LICENSE new file mode 100644 index 000000000..8ee09d911 --- /dev/null +++ b/node_modules/regex-not/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016, 2018, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/regex-not/README.md b/node_modules/regex-not/README.md new file mode 100644 index 000000000..24d00e7de --- /dev/null +++ b/node_modules/regex-not/README.md @@ -0,0 +1,133 @@ +# regex-not [![NPM version](https://img.shields.io/npm/v/regex-not.svg?style=flat)](https://www.npmjs.com/package/regex-not) [![NPM monthly downloads](https://img.shields.io/npm/dm/regex-not.svg?style=flat)](https://npmjs.org/package/regex-not) [![NPM total downloads](https://img.shields.io/npm/dt/regex-not.svg?style=flat)](https://npmjs.org/package/regex-not) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/regex-not.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/regex-not) + +> Create a javascript regular expression for matching everything except for the given string. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save regex-not +``` + +## Usage + +```js +var not = require('regex-not'); +``` + +The main export is a function that takes a string an options object. + +```js +not(string[, options]); +``` + +**Example** + +```js +var not = require('regex-not'); +console.log(not('foo')); +//=> /^(?:(?!^(?:foo)$).)+$/ +``` + +**Strict matching** + +By default, the returned regex is for strictly (not) matching the exact given pattern (in other words, "match this string if it does NOT _exactly equal_ `foo`"): + +```js +var re = not('foo'); +console.log(re.test('foo')); //=> false +console.log(re.test('bar')); //=> true +console.log(re.test('foobar')); //=> true +console.log(re.test('barfoo')); //=> true +``` + +### .create + +Returns a string to allow you to create your own regex: + +```js +console.log(not.create('foo')); +//=> '(?:(?!^(?:foo)$).)+' +``` + +### Options + +**options.contains** + +You can relax strict matching by setting `options.contains` to true (in other words, "match this string if it does NOT _contain_ `foo`"): + +```js +var re = not('foo'); +console.log(re.test('foo', {contains: true})); //=> false +console.log(re.test('bar', {contains: true})); //=> true +console.log(re.test('foobar', {contains: true})); //=> false +console.log(re.test('barfoo', {contains: true})); //=> false +``` + +## About + +
    +Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
    + +
    +Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
    + +
    +Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
    + +### Related projects + +You might also be interested in these projects: + +* [regex-cache](https://www.npmjs.com/package/regex-cache): Memoize the results of a call to the RegExp constructor, avoiding repetitious runtime compilation of… [more](https://github.com/jonschlinkert/regex-cache) | [homepage](https://github.com/jonschlinkert/regex-cache "Memoize the results of a call to the RegExp constructor, avoiding repetitious runtime compilation of the same string and options, resulting in surprising performance improvements.") +* [to-regex](https://www.npmjs.com/package/to-regex): Generate a regex from a string or array of strings. | [homepage](https://github.com/jonschlinkert/to-regex "Generate a regex from a string or array of strings.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 9 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [doowb](https://github.com/doowb) | +| 1 | [EdwardBetts](https://github.com/EdwardBetts) | + +### Author + +**Jon Schlinkert** + +* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on February 19, 2018._ \ No newline at end of file diff --git a/node_modules/regex-not/index.js b/node_modules/regex-not/index.js new file mode 100644 index 000000000..02bfed4a8 --- /dev/null +++ b/node_modules/regex-not/index.js @@ -0,0 +1,72 @@ +'use strict'; + +var extend = require('extend-shallow'); +var safe = require('safe-regex'); + +/** + * The main export is a function that takes a `pattern` string and an `options` object. + * + * ```js + & var not = require('regex-not'); + & console.log(not('foo')); + & //=> /^(?:(?!^(?:foo)$).)*$/ + * ``` + * + * @param {String} `pattern` + * @param {Object} `options` + * @return {RegExp} Converts the given `pattern` to a regex using the specified `options`. + * @api public + */ + +function toRegex(pattern, options) { + return new RegExp(toRegex.create(pattern, options)); +} + +/** + * Create a regex-compatible string from the given `pattern` and `options`. + * + * ```js + & var not = require('regex-not'); + & console.log(not.create('foo')); + & //=> '^(?:(?!^(?:foo)$).)*$' + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {String} + * @api public + */ + +toRegex.create = function(pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('expected a string'); + } + + var opts = extend({}, options); + if (opts.contains === true) { + opts.strictNegate = false; + } + + var open = opts.strictOpen !== false ? '^' : ''; + var close = opts.strictClose !== false ? '$' : ''; + var endChar = opts.endChar ? opts.endChar : '+'; + var str = pattern; + + if (opts.strictNegate === false) { + str = '(?:(?!(?:' + pattern + ')).)' + endChar; + } else { + str = '(?:(?!^(?:' + pattern + ')$).)' + endChar; + } + + var res = open + str + close; + if (opts.safe === true && safe(res) === false) { + throw new Error('potentially unsafe regular expression: ' + res); + } + + return res; +}; + +/** + * Expose `toRegex` + */ + +module.exports = toRegex; diff --git a/node_modules/regex-not/package.json b/node_modules/regex-not/package.json new file mode 100644 index 000000000..5d35f67f4 --- /dev/null +++ b/node_modules/regex-not/package.json @@ -0,0 +1,98 @@ +{ + "_from": "regex-not@^1.0.0", + "_id": "regex-not@1.0.2", + "_inBundle": false, + "_integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "_location": "/regex-not", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "regex-not@^1.0.0", + "name": "regex-not", + "escapedName": "regex-not", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/nanomatch", + "/readdirp/expand-brackets", + "/readdirp/extglob", + "/readdirp/micromatch", + "/to-regex" + ], + "_resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "_shasum": "1f4ece27e00b0b65e0247a6810e6a85d83a5752c", + "_spec": "regex-not@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/regex-not/issues" + }, + "bundleDependencies": false, + "dependencies": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + }, + "deprecated": false, + "description": "Create a javascript regular expression for matching everything except for the given string.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.5.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/regex-not", + "keywords": [ + "exec", + "match", + "negate", + "negation", + "not", + "regex", + "regular expression", + "test" + ], + "license": "MIT", + "main": "index.js", + "name": "regex-not", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/regex-not.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "regex-cache", + "to-regex" + ] + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.2" +} diff --git a/node_modules/reload-css/LICENSE.md b/node_modules/reload-css/LICENSE.md new file mode 100644 index 000000000..20a7f479c --- /dev/null +++ b/node_modules/reload-css/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) +Copyright (c) 2017 Jam3 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/reload-css/README.md b/node_modules/reload-css/README.md new file mode 100644 index 000000000..6d1a49ece --- /dev/null +++ b/node_modules/reload-css/README.md @@ -0,0 +1,31 @@ +# reload-css + +[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges) + +This module reloads all style sheets associated with a specified `url`. This is primarily useful for LiveReload servers that wish to update style sheets without triggering a full page refresh. + +If you omit the `url` argument, all style sheets will be cache busted. + +## Install + +```sh +npm install reload-css --save +``` + +## Usage + +[![NPM](https://nodei.co/npm/reload-css.png)](https://www.npmjs.com/package/reload-css) + +#### `reloadCSS([url], [opt])` + +Cache-busts the URLs for all `` tags that match the specified `url`, as well as any other style sheets that `@import` the URL. + +By default, this will only look for local style sheets (i.e. `localhost`, `127.0.0.1`, or matching the document domain). You can pass `{ local: false }` as the options to cache bust all styles. + +In some cases, it will walk upwards to a more top-level style sheet (i.e. in a long chain of import dependencies) to ensure a consistent result across browsers. Import statements are updated in the `cssRules`, and `` tags are re-attached for a clean update (no flicker/flash). + +You can omit `url` or pass `null` as the first argument to reload all styles instead of just a target one. + +## License + +MIT, see [LICENSE.md](http://github.com/Jam3/reload-css/blob/master/LICENSE.md) for details. diff --git a/node_modules/reload-css/index.js b/node_modules/reload-css/index.js new file mode 100644 index 000000000..22d21d971 --- /dev/null +++ b/node_modules/reload-css/index.js @@ -0,0 +1,244 @@ +var qs = require('query-string'); +var URL = require('./lib/url'); +var baseHosts = getBaseHosts(); + +module.exports = function (url, opt) { + // by default, only reloads local style sheets + var localOnly = true; + if (opt && opt.local === false) { + localOnly = false; + } + + // determine base URL + var baseUrl = document.location.pathname; + var baseTag = document.querySelector('base'); + if (baseTag) { + baseUrl = baseTag.getAttribute('href'); + var parsedBase = URL.parse(baseUrl); + parsedBase.pathname = '/'; + parsedBase.hash = null; + parsedBase.query = null; + parsedBase.search = null; + baseUrl = URL.format(parsedBase); + } + + // Find all and + + +
    +

    The MIT License (MIT)

    +

    Copyright (c) 2016 Rod Vagg (the "Original Author") and additional 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.

    +
    +
    + + \ No newline at end of file diff --git a/node_modules/through2/LICENSE.md b/node_modules/through2/LICENSE.md new file mode 100644 index 000000000..7f0b93daa --- /dev/null +++ b/node_modules/through2/LICENSE.md @@ -0,0 +1,9 @@ +# The MIT License (MIT) + +**Copyright (c) 2016 Rod Vagg (the "Original Author") and additional 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. \ No newline at end of file diff --git a/node_modules/through2/README.md b/node_modules/through2/README.md new file mode 100644 index 000000000..a916f15ef --- /dev/null +++ b/node_modules/through2/README.md @@ -0,0 +1,136 @@ +# through2 + +[![NPM](https://nodei.co/npm/through2.png?downloads&downloadRank)](https://nodei.co/npm/through2/) + +**A tiny wrapper around Node streams.Transform (Streams2) to avoid explicit subclassing noise** + +Inspired by [Dominic Tarr](https://github.com/dominictarr)'s [through](https://github.com/dominictarr/through) in that it's so much easier to make a stream out of a function than it is to set up the prototype chain properly: `through(function (chunk) { ... })`. + +Note: As 2.x.x this module starts using **Streams3** instead of Stream2. To continue using a Streams2 version use `npm install through2@0` to fetch the latest version of 0.x.x. More information about Streams2 vs Streams3 and recommendations see the article **[Why I don't use Node's core 'stream' module](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html)**. + +```js +fs.createReadStream('ex.txt') + .pipe(through2(function (chunk, enc, callback) { + for (var i = 0; i < chunk.length; i++) + if (chunk[i] == 97) + chunk[i] = 122 // swap 'a' for 'z' + + this.push(chunk) + + callback() + })) + .pipe(fs.createWriteStream('out.txt')) + .on('finish', function () { + doSomethingSpecial() + }) +``` + +Or object streams: + +```js +var all = [] + +fs.createReadStream('data.csv') + .pipe(csv2()) + .pipe(through2.obj(function (chunk, enc, callback) { + var data = { + name : chunk[0] + , address : chunk[3] + , phone : chunk[10] + } + this.push(data) + + callback() + })) + .on('data', function (data) { + all.push(data) + }) + .on('end', function () { + doSomethingSpecial(all) + }) +``` + +Note that `through2.obj(fn)` is a convenience wrapper around `through2({ objectMode: true }, fn)`. + +## API + +through2([ options, ] [ transformFunction ] [, flushFunction ]) + +Consult the **[stream.Transform](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_transform)** documentation for the exact rules of the `transformFunction` (i.e. `this._transform`) and the optional `flushFunction` (i.e. `this._flush`). + +### options + +The options argument is optional and is passed straight through to `stream.Transform`. So you can use `objectMode:true` if you are processing non-binary streams (or just use `through2.obj()`). + +The `options` argument is first, unlike standard convention, because if I'm passing in an anonymous function then I'd prefer for the options argument to not get lost at the end of the call: + +```js +fs.createReadStream('/tmp/important.dat') + .pipe(through2({ objectMode: true, allowHalfOpen: false }, + function (chunk, enc, cb) { + cb(null, 'wut?') // note we can use the second argument on the callback + // to provide data as an alternative to this.push('wut?') + } + ) + .pipe(fs.createWriteStream('/tmp/wut.txt')) +``` + +### transformFunction + +The `transformFunction` must have the following signature: `function (chunk, encoding, callback) {}`. A minimal implementation should call the `callback` function to indicate that the transformation is done, even if that transformation means discarding the chunk. + +To queue a new chunk, call `this.push(chunk)`—this can be called as many times as required before the `callback()` if you have multiple pieces to send on. + +Alternatively, you may use `callback(err, chunk)` as shorthand for emitting a single chunk or an error. + +If you **do not provide a `transformFunction`** then you will get a simple pass-through stream. + +### flushFunction + +The optional `flushFunction` is provided as the last argument (2nd or 3rd, depending on whether you've supplied options) is called just prior to the stream ending. Can be used to finish up any processing that may be in progress. + +```js +fs.createReadStream('/tmp/important.dat') + .pipe(through2( + function (chunk, enc, cb) { cb(null, chunk) }, // transform is a noop + function (cb) { // flush function + this.push('tacking on an extra buffer to the end'); + cb(); + } + )) + .pipe(fs.createWriteStream('/tmp/wut.txt')); +``` + +through2.ctor([ options, ] transformFunction[, flushFunction ]) + +Instead of returning a `stream.Transform` instance, `through2.ctor()` returns a **constructor** for a custom Transform. This is useful when you want to use the same transform logic in multiple instances. + +```js +var FToC = through2.ctor({objectMode: true}, function (record, encoding, callback) { + if (record.temp != null && record.unit == "F") { + record.temp = ( ( record.temp - 32 ) * 5 ) / 9 + record.unit = "C" + } + this.push(record) + callback() +}) + +// Create instances of FToC like so: +var converter = new FToC() +// Or: +var converter = FToC() +// Or specify/override options when you instantiate, if you prefer: +var converter = FToC({objectMode: true}) +``` + +## See Also + + - [through2-map](https://github.com/brycebaril/through2-map) - Array.prototype.map analog for streams. + - [through2-filter](https://github.com/brycebaril/through2-filter) - Array.prototype.filter analog for streams. + - [through2-reduce](https://github.com/brycebaril/through2-reduce) - Array.prototype.reduce analog for streams. + - [through2-spy](https://github.com/brycebaril/through2-spy) - Wrapper for simple stream.PassThrough spies. + - the [mississippi stream utility collection](https://github.com/maxogden/mississippi) includes `through2` as well as many more useful stream modules similar to this one + +## License + +**through2** is Copyright (c) 2013 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details. diff --git a/node_modules/through2/package.json b/node_modules/through2/package.json new file mode 100644 index 000000000..40e619371 --- /dev/null +++ b/node_modules/through2/package.json @@ -0,0 +1,70 @@ +{ + "_from": "through2@^2.0.0", + "_id": "through2@2.0.3", + "_inBundle": false, + "_integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "_location": "/through2", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "through2@^2.0.0", + "name": "through2", + "escapedName": "through2", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/browser-pack", + "/browserify", + "/deps-sort", + "/insert-module-globals", + "/module-deps", + "/watchify" + ], + "_resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "_shasum": "0004569b37c7c74ba39c43f3ced78d1ad94140be", + "_spec": "through2@^2.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "Rod Vagg", + "email": "r@va.gg", + "url": "https://github.com/rvagg" + }, + "bugs": { + "url": "https://github.com/rvagg/through2/issues" + }, + "bundleDependencies": false, + "dependencies": { + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" + }, + "deprecated": false, + "description": "A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise", + "devDependencies": { + "bl": "~1.1.2", + "faucet": "0.0.1", + "stream-spigot": "~3.0.5", + "tape": "~4.6.2" + }, + "homepage": "https://github.com/rvagg/through2#readme", + "keywords": [ + "stream", + "streams2", + "through", + "transform" + ], + "license": "MIT", + "main": "through2.js", + "name": "through2", + "repository": { + "type": "git", + "url": "git+https://github.com/rvagg/through2.git" + }, + "scripts": { + "test": "node test/test.js | faucet", + "test-local": "brtapsauce-local test/basic-test.js" + }, + "version": "2.0.3" +} diff --git a/node_modules/through2/through2.js b/node_modules/through2/through2.js new file mode 100644 index 000000000..5b7a880e8 --- /dev/null +++ b/node_modules/through2/through2.js @@ -0,0 +1,96 @@ +var Transform = require('readable-stream/transform') + , inherits = require('util').inherits + , xtend = require('xtend') + +function DestroyableTransform(opts) { + Transform.call(this, opts) + this._destroyed = false +} + +inherits(DestroyableTransform, Transform) + +DestroyableTransform.prototype.destroy = function(err) { + if (this._destroyed) return + this._destroyed = true + + var self = this + process.nextTick(function() { + if (err) + self.emit('error', err) + self.emit('close') + }) +} + +// a noop _transform function +function noop (chunk, enc, callback) { + callback(null, chunk) +} + + +// create a new export function, used by both the main export and +// the .ctor export, contains common logic for dealing with arguments +function through2 (construct) { + return function (options, transform, flush) { + if (typeof options == 'function') { + flush = transform + transform = options + options = {} + } + + if (typeof transform != 'function') + transform = noop + + if (typeof flush != 'function') + flush = null + + return construct(options, transform, flush) + } +} + + +// main export, just make me a transform stream! +module.exports = through2(function (options, transform, flush) { + var t2 = new DestroyableTransform(options) + + t2._transform = transform + + if (flush) + t2._flush = flush + + return t2 +}) + + +// make me a reusable prototype that I can `new`, or implicitly `new` +// with a constructor call +module.exports.ctor = through2(function (options, transform, flush) { + function Through2 (override) { + if (!(this instanceof Through2)) + return new Through2(override) + + this.options = xtend(options, override) + + DestroyableTransform.call(this, this.options) + } + + inherits(Through2, DestroyableTransform) + + Through2.prototype._transform = transform + + if (flush) + Through2.prototype._flush = flush + + return Through2 +}) + + +module.exports.obj = through2(function (options, transform, flush) { + var t2 = new DestroyableTransform(xtend({ objectMode: true, highWaterMark: 16 }, options)) + + t2._transform = transform + + if (flush) + t2._flush = flush + + return t2 +}) diff --git a/node_modules/timers-browserify/.npmignore b/node_modules/timers-browserify/.npmignore new file mode 100644 index 000000000..03e05e4c0 --- /dev/null +++ b/node_modules/timers-browserify/.npmignore @@ -0,0 +1,2 @@ +.DS_Store +/node_modules diff --git a/node_modules/timers-browserify/CHANGELOG.md b/node_modules/timers-browserify/CHANGELOG.md new file mode 100644 index 000000000..a7cd8bc87 --- /dev/null +++ b/node_modules/timers-browserify/CHANGELOG.md @@ -0,0 +1,58 @@ +# Change Log +All notable changes to this project will be documented in this file. +This project adheres to [Semantic Versioning](http://semver.org/). + +## 1.4.0 - 2015-02-23 + +### Added +* Link to `timers-browserify-full`, which offers a larger, but much more exact, + version of Node's `timers` library + +### Changed +* `setTimeout` and `setInterval` return objects with the same API as the Node + implementation, instead of just IDs + +### Fixed +* `active` implementation actually has an effect, as in Node +* Replaced usages of `apply` that break in IE 8 + +## 1.3.0 - 2015-02-04 + +### Changed +* Prefer native versions of `setImmediate` and `clearImmediate` if they exist + +## 1.2.0 - 2015-01-02 + +### Changed +* Update `process` dependency + +## 1.1.0 - 2014-08-26 + +### Added +* `clearImmediate` available to undo `setImmediate` + +## 1.0.3 - 2014-06-30 + +### Fixed +* Resume returning opaque IDs from `setTimeout` and `setInterval` + +## 1.0.2 - 2014-06-30 + +### Fixed +* Pass `window` explicitly to `setTimeout` and others to resolve an error in + Chrome + +## 1.0.1 - 2013-12-28 + +### Changed +* Replaced `setimmediate` dependency with `process` for the `nextTick` shim + +## 1.0.0 - 2013-12-10 + +### Added +* Guard against undefined globals like `setTimeout` in some environments + +## 0.0.0 - 2012-05-30 + +### Added +* Basic functionality for initial release diff --git a/node_modules/timers-browserify/LICENSE.md b/node_modules/timers-browserify/LICENSE.md new file mode 100644 index 000000000..940ec90a7 --- /dev/null +++ b/node_modules/timers-browserify/LICENSE.md @@ -0,0 +1,46 @@ +# timers-browserify + +This project uses the [MIT](http://jryans.mit-license.org/) license: + + Copyright © 2012 J. Ryan Stinnett + + 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. + +# lib/node + +The `lib/node` directory borrows files from joyent/node which uses the following license: + + Copyright Joyent, Inc. and other Node contributors. All rights reserved. + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. diff --git a/node_modules/timers-browserify/README.md b/node_modules/timers-browserify/README.md new file mode 100644 index 000000000..c7efa1921 --- /dev/null +++ b/node_modules/timers-browserify/README.md @@ -0,0 +1,40 @@ +# Overview + +Adds support for the `timers` module to browserify. + +## Wait, isn't it already supported in the browser? + +The public methods of the `timers` module are: + +* `setTimeout(callback, delay, [arg], [...])` +* `clearTimeout(timeoutId)` +* `setInterval(callback, delay, [arg], [...])` +* `clearInterval(intervalId)` + +and indeed, browsers support these already. + +## So, why does this exist? + +The `timers` module also includes some private methods used in other built-in +Node.js modules: + +* `enroll(item, delay)` +* `unenroll(item)` +* `active(item)` + +These are used to efficiently support a large quantity of timers with the same +timeouts by creating only a few timers under the covers. + +Node.js also offers the `immediate` APIs, which aren't yet available cross-browser, so we polyfill those: + +* `setImmediate(callback, [arg], [...])` +* `clearImmediate(immediateId)` + +## I need lots of timers and want to use linked list timers as Node.js does. + +Linked lists are efficient when you have thousands (millions?) of timers with the same delay. +Take a look at [timers-browserify-full](https://www.npmjs.com/package/timers-browserify-full) in this case. + +# License + +[MIT](http://jryans.mit-license.org/) diff --git a/node_modules/timers-browserify/example/enroll/build.sh b/node_modules/timers-browserify/example/enroll/build.sh new file mode 100755 index 000000000..d276735d4 --- /dev/null +++ b/node_modules/timers-browserify/example/enroll/build.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +browserify --debug -o js/browserify.js js/main.js diff --git a/node_modules/timers-browserify/example/enroll/index.html b/node_modules/timers-browserify/example/enroll/index.html new file mode 100644 index 000000000..9cc11401b --- /dev/null +++ b/node_modules/timers-browserify/example/enroll/index.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/node_modules/timers-browserify/example/enroll/js/browserify.js b/node_modules/timers-browserify/example/enroll/js/browserify.js new file mode 100644 index 000000000..c2d08210a --- /dev/null +++ b/node_modules/timers-browserify/example/enroll/js/browserify.js @@ -0,0 +1,233 @@ +var require = function (file, cwd) { + var resolved = require.resolve(file, cwd || '/'); + var mod = require.modules[resolved]; + if (!mod) throw new Error( + 'Failed to resolve module ' + file + ', tried ' + resolved + ); + var res = mod._cached ? mod._cached : mod(); + return res; +} + +require.paths = []; +require.modules = {}; +require.extensions = [".js",".coffee"]; + +require._core = { + 'assert': true, + 'events': true, + 'fs': true, + 'path': true, + 'vm': true +}; + +require.resolve = (function () { + return function (x, cwd) { + if (!cwd) cwd = '/'; + + if (require._core[x]) return x; + var path = require.modules.path(); + cwd = path.resolve('/', cwd); + var y = cwd || '/'; + + if (x.match(/^(?:\.\.?\/|\/)/)) { + var m = loadAsFileSync(path.resolve(y, x)) + || loadAsDirectorySync(path.resolve(y, x)); + if (m) return m; + } + + var n = loadNodeModulesSync(x, y); + if (n) return n; + + throw new Error("Cannot find module '" + x + "'"); + + function loadAsFileSync (x) { + if (require.modules[x]) { + return x; + } + + for (var i = 0; i < require.extensions.length; i++) { + var ext = require.extensions[i]; + if (require.modules[x + ext]) return x + ext; + } + } + + function loadAsDirectorySync (x) { + x = x.replace(/\/+$/, ''); + var pkgfile = x + '/package.json'; + if (require.modules[pkgfile]) { + var pkg = require.modules[pkgfile](); + var b = pkg.browserify; + if (typeof b === 'object' && b.main) { + var m = loadAsFileSync(path.resolve(x, b.main)); + if (m) return m; + } + else if (typeof b === 'string') { + var m = loadAsFileSync(path.resolve(x, b)); + if (m) return m; + } + else if (pkg.main) { + var m = loadAsFileSync(path.resolve(x, pkg.main)); + if (m) return m; + } + } + + return loadAsFileSync(x + '/index'); + } + + function loadNodeModulesSync (x, start) { + var dirs = nodeModulesPathsSync(start); + for (var i = 0; i < dirs.length; i++) { + var dir = dirs[i]; + var m = loadAsFileSync(dir + '/' + x); + if (m) return m; + var n = loadAsDirectorySync(dir + '/' + x); + if (n) return n; + } + + var m = loadAsFileSync(x); + if (m) return m; + } + + function nodeModulesPathsSync (start) { + var parts; + if (start === '/') parts = [ '' ]; + else parts = path.normalize(start).split('/'); + + var dirs = []; + for (var i = parts.length - 1; i >= 0; i--) { + if (parts[i] === 'node_modules') continue; + var dir = parts.slice(0, i + 1).join('/') + '/node_modules'; + dirs.push(dir); + } + + return dirs; + } + }; +})(); + +require.alias = function (from, to) { + var path = require.modules.path(); + var res = null; + try { + res = require.resolve(from + '/package.json', '/'); + } + catch (err) { + res = require.resolve(from, '/'); + } + var basedir = path.dirname(res); + + var keys = (Object.keys || function (obj) { + var res = []; + for (var key in obj) res.push(key) + return res; + })(require.modules); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (key.slice(0, basedir.length + 1) === basedir + '/') { + var f = key.slice(basedir.length); + require.modules[to + f] = require.modules[basedir + f]; + } + else if (key === basedir) { + require.modules[to] = require.modules[basedir]; + } + } +}; + +require.define = function (filename, fn) { + var dirname = require._core[filename] + ? '' + : require.modules.path().dirname(filename) + ; + + var require_ = function (file) { + return require(file, dirname) + }; + require_.resolve = function (name) { + return require.resolve(name, dirname); + }; + require_.modules = require.modules; + require_.define = require.define; + var module_ = { exports : {} }; + + require.modules[filename] = function () { + require.modules[filename]._cached = module_.exports; + fn.call( + module_.exports, + require_, + module_, + module_.exports, + dirname, + filename + ); + require.modules[filename]._cached = module_.exports; + return module_.exports; + }; +}; + +if (typeof process === 'undefined') process = {}; + +if (!process.nextTick) process.nextTick = (function () { + var queue = []; + var canPost = typeof window !== 'undefined' + && window.postMessage && window.addEventListener + ; + + if (canPost) { + window.addEventListener('message', function (ev) { + if (ev.source === window && ev.data === 'browserify-tick') { + ev.stopPropagation(); + if (queue.length > 0) { + var fn = queue.shift(); + fn(); + } + } + }, true); + } + + return function (fn) { + if (canPost) { + queue.push(fn); + window.postMessage('browserify-tick', '*'); + } + else setTimeout(fn, 0); + }; +})(); + +if (!process.title) process.title = 'browser'; + +if (!process.binding) process.binding = function (name) { + if (name === 'evals') return require('vm') + else throw new Error('No such module') +}; + +if (!process.cwd) process.cwd = function () { return '.' }; + +if (!process.env) process.env = {}; +if (!process.argv) process.argv = []; + +require.define("path", Function( + [ 'require', 'module', 'exports', '__dirname', '__filename' ], + "function filter (xs, fn) {\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (fn(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length; i >= 0; i--) {\n var last = parts[i];\n if (last == '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// Regex to split a filename into [*, dir, basename, ext]\n// posix version\nvar splitPathRe = /^(.+\\/(?!$)|\\/)?((?:.+?)?(\\.[^.]*)?)$/;\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\nvar resolvedPath = '',\n resolvedAbsolute = false;\n\nfor (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0)\n ? arguments[i]\n : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string' || !path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n}\n\n// At this point the path should be resolved to a full absolute path, but\n// handle relative paths to be safe (might happen when process.cwd() fails)\n\n// Normalize the path\nresolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\nvar isAbsolute = path.charAt(0) === '/',\n trailingSlash = path.slice(-1) === '/';\n\n// Normalize the path\npath = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n \n return (isAbsolute ? '/' : '') + path;\n};\n\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n return p && typeof p === 'string';\n }).join('/'));\n};\n\n\nexports.dirname = function(path) {\n var dir = splitPathRe.exec(path)[1] || '';\n var isWindows = false;\n if (!dir) {\n // No dirname\n return '.';\n } else if (dir.length === 1 ||\n (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) {\n // It is just a slash or a drive letter with a slash\n return dir;\n } else {\n // It is a full dirname, strip trailing slash\n return dir.substring(0, dir.length - 1);\n }\n};\n\n\nexports.basename = function(path, ext) {\n var f = splitPathRe.exec(path)[2] || '';\n // TODO: make this comparison case-insensitive on windows?\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\n\nexports.extname = function(path) {\n return splitPathRe.exec(path)[3] || '';\n};\n\n//@ sourceURL=path" +)); + +require.define("timers", Function( + [ 'require', 'module', 'exports', '__dirname', '__filename' ], + "module.exports = require(\"timers-browserify\")\n//@ sourceURL=timers" +)); + +require.define("/node_modules/timers-browserify/package.json", Function( + [ 'require', 'module', 'exports', '__dirname', '__filename' ], + "module.exports = {\"main\":\"main.js\"}\n//@ sourceURL=/node_modules/timers-browserify/package.json" +)); + +require.define("/node_modules/timers-browserify/main.js", Function( + [ 'require', 'module', 'exports', '__dirname', '__filename' ], + "// DOM APIs, for completeness\n\nexports.setTimeout = setTimeout;\nexports.clearTimeout = clearTimeout;\nexports.setInterval = setInterval;\nexports.clearInterval = clearInterval;\n\n// TODO: Change to more effiecient list approach used in Node.js\n// For now, we just implement the APIs using the primitives above.\n\nexports.enroll = function(item, delay) {\n item._timeoutID = setTimeout(item._onTimeout, delay);\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._timeoutID);\n};\n\nexports.active = function(item) {\n // our naive impl doesn't care (correctness is still preserved)\n};\n\n//@ sourceURL=/node_modules/timers-browserify/main.js" +)); + +require.define("/main.js", Function( + [ 'require', 'module', 'exports', '__dirname', '__filename' ], + "var timers = require('timers');\n\nvar obj = {\n _onTimeout: function() {\n console.log('Timer ran for: ' + (new Date().getTime() - obj.now) + ' ms');\n },\n start: function() {\n console.log('Timer should run for 100 ms');\n this.now = new Date().getTime();\n timers.enroll(this, 100);\n }\n};\n\nobj.start();\n\n//@ sourceURL=/main.js" +)); +require("/main.js"); diff --git a/node_modules/timers-browserify/example/enroll/js/main.js b/node_modules/timers-browserify/example/enroll/js/main.js new file mode 100644 index 000000000..0007df854 --- /dev/null +++ b/node_modules/timers-browserify/example/enroll/js/main.js @@ -0,0 +1,14 @@ +var timers = require('timers'); + +var obj = { + _onTimeout: function() { + console.log('Timer ran for: ' + (new Date().getTime() - obj.now) + ' ms'); + }, + start: function() { + console.log('Timer should run for 100 ms'); + this.now = new Date().getTime(); + timers.enroll(this, 100); + } +}; + +obj.start(); diff --git a/node_modules/timers-browserify/example/enroll/server.js b/node_modules/timers-browserify/example/enroll/server.js new file mode 100644 index 000000000..37b1a0ad6 --- /dev/null +++ b/node_modules/timers-browserify/example/enroll/server.js @@ -0,0 +1,11 @@ +var connect = require('connect'); +var server = connect.createServer(); +server.use(connect.static(__dirname)); + +var browserify = require('browserify'); +var bundle = browserify(__dirname + '/js/main.js', { mount: '/js/browserify.js' }); +server.use(bundle); + +var port = parseInt(process.argv[2] || 8080, 10); +server.listen(port); +console.log('Listening on :' + port); diff --git a/node_modules/timers-browserify/main.js b/node_modules/timers-browserify/main.js new file mode 100644 index 000000000..38c058f19 --- /dev/null +++ b/node_modules/timers-browserify/main.js @@ -0,0 +1,76 @@ +var nextTick = require('process/browser.js').nextTick; +var apply = Function.prototype.apply; +var slice = Array.prototype.slice; +var immediateIds = {}; +var nextImmediateId = 0; + +// DOM APIs, for completeness + +exports.setTimeout = function() { + return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout); +}; +exports.setInterval = function() { + return new Timeout(apply.call(setInterval, window, arguments), clearInterval); +}; +exports.clearTimeout = +exports.clearInterval = function(timeout) { timeout.close(); }; + +function Timeout(id, clearFn) { + this._id = id; + this._clearFn = clearFn; +} +Timeout.prototype.unref = Timeout.prototype.ref = function() {}; +Timeout.prototype.close = function() { + this._clearFn.call(window, this._id); +}; + +// Does not start the time, just sets up the members needed. +exports.enroll = function(item, msecs) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = msecs; +}; + +exports.unenroll = function(item) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = -1; +}; + +exports._unrefActive = exports.active = function(item) { + clearTimeout(item._idleTimeoutId); + + var msecs = item._idleTimeout; + if (msecs >= 0) { + item._idleTimeoutId = setTimeout(function onTimeout() { + if (item._onTimeout) + item._onTimeout(); + }, msecs); + } +}; + +// That's not how node.js implements it but the exposed api is the same. +exports.setImmediate = typeof setImmediate === "function" ? setImmediate : function(fn) { + var id = nextImmediateId++; + var args = arguments.length < 2 ? false : slice.call(arguments, 1); + + immediateIds[id] = true; + + nextTick(function onNextTick() { + if (immediateIds[id]) { + // fn.call() is faster so we optimize for the common use-case + // @see http://jsperf.com/call-apply-segu + if (args) { + fn.apply(null, args); + } else { + fn.call(null); + } + // Prevent ids from leaking + exports.clearImmediate(id); + } + }); + + return id; +}; + +exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) { + delete immediateIds[id]; +}; \ No newline at end of file diff --git a/node_modules/timers-browserify/package.json b/node_modules/timers-browserify/package.json new file mode 100644 index 000000000..8eafec076 --- /dev/null +++ b/node_modules/timers-browserify/package.json @@ -0,0 +1,103 @@ +{ + "_from": "timers-browserify@^1.0.1", + "_id": "timers-browserify@1.4.2", + "_inBundle": false, + "_integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", + "_location": "/timers-browserify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "timers-browserify@^1.0.1", + "name": "timers-browserify", + "escapedName": "timers-browserify", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/browserify" + ], + "_resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", + "_shasum": "c9c58b575be8407375cb5e2462dacee74359f41d", + "_spec": "timers-browserify@^1.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "J. Ryan Stinnett", + "email": "jryans@gmail.com", + "url": "http://convolv.es/" + }, + "bugs": { + "url": "https://github.com/jryans/timers-browserify/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Guy Bedford", + "email": "guybedford@gmail.com" + }, + { + "name": "Ionut-Cristian Florescu", + "email": "ionut.florescu@gmail.com" + }, + { + "name": "James Halliday", + "email": "mail@substack.net" + }, + { + "name": "Jan Schär", + "email": "jscissr@gmail.com" + }, + { + "name": "Johannes Ewald", + "email": "johannes.ewald@peerigon.com" + }, + { + "name": "Jonathan Prins", + "email": "jon@blip.tv" + }, + { + "name": "Matt Esch", + "email": "matt@mattesch.info" + } + ], + "dependencies": { + "process": "~0.11.0" + }, + "deprecated": false, + "description": "timers module for browserify", + "devDependencies": { + "browserify": "~1.10.16", + "connect": "~2.3.0" + }, + "engines": { + "node": ">=0.6.0" + }, + "homepage": "https://github.com/jryans/timers-browserify", + "jspm": { + "map": { + "./main.js": { + "node": "@node/timers" + } + } + }, + "keywords": [ + "timers", + "browserify", + "browser" + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jryans/timers-browserify/blob/master/LICENSE.md" + } + ], + "main": "main.js", + "name": "timers-browserify", + "optionalDependencies": {}, + "repository": { + "type": "git", + "url": "git://github.com/jryans/timers-browserify.git" + }, + "version": "1.4.2" +} diff --git a/node_modules/to-arraybuffer/.npmignore b/node_modules/to-arraybuffer/.npmignore new file mode 100644 index 000000000..6c3df58ff --- /dev/null +++ b/node_modules/to-arraybuffer/.npmignore @@ -0,0 +1,4 @@ +.DS_Store +node_modules +npm-debug.log +.zuulrc diff --git a/node_modules/to-arraybuffer/.travis.yml b/node_modules/to-arraybuffer/.travis.yml new file mode 100644 index 000000000..3428b14b3 --- /dev/null +++ b/node_modules/to-arraybuffer/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - "4.1" \ No newline at end of file diff --git a/node_modules/to-arraybuffer/.zuul.yml b/node_modules/to-arraybuffer/.zuul.yml new file mode 100644 index 000000000..7e60601fa --- /dev/null +++ b/node_modules/to-arraybuffer/.zuul.yml @@ -0,0 +1,16 @@ +ui: tape +browsers: + - name: chrome + version: 39..latest + - name: firefox + version: 34..latest + - name: safari + version: 5..latest + - name: ie + version: 10..latest + - name: opera + version: 11..latest + - name: iphone + version: 5.1..latest + - name: android + version: 4.0..latest \ No newline at end of file diff --git a/node_modules/to-arraybuffer/LICENSE b/node_modules/to-arraybuffer/LICENSE new file mode 100644 index 000000000..1e936dad4 --- /dev/null +++ b/node_modules/to-arraybuffer/LICENSE @@ -0,0 +1,24 @@ +The MIT License + +Copyright (c) 2016 John Hiesey + +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. \ No newline at end of file diff --git a/node_modules/to-arraybuffer/README.md b/node_modules/to-arraybuffer/README.md new file mode 100644 index 000000000..6bdef265b --- /dev/null +++ b/node_modules/to-arraybuffer/README.md @@ -0,0 +1,27 @@ +# to-arraybuffer [![Build Status](https://travis-ci.org/jhiesey/to-arraybuffer.svg?branch=master)](https://travis-ci.org/jhiesey/to-arraybuffer) + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/to-arraybuffer.svg)](https://saucelabs.com/u/to-arraybuffer) + +Convert from a Buffer to an ArrayBuffer as fast as possible. + +Note that in some cases the returned ArrayBuffer is backed by the same memory as the original +Buffer (but in other cases it is a copy), so **modifying the ArrayBuffer is not recommended**. + +This module is designed to work both in node.js and in all browsers with ArrayBuffer support +when using [the Buffer implementation provided by Browserify](https://www.npmjs.com/package/buffer). + +## Usage + +``` js +var toArrayBuffer = require('to-arraybuffer') + +var buffer = new Buffer(100) +// Fill the buffer with some data + +var ab = toArrayBuffer(buffer) +// `ab` now contains the same data as `buffer` +``` + +## License + +MIT \ No newline at end of file diff --git a/node_modules/to-arraybuffer/index.js b/node_modules/to-arraybuffer/index.js new file mode 100644 index 000000000..2f69ae0c8 --- /dev/null +++ b/node_modules/to-arraybuffer/index.js @@ -0,0 +1,27 @@ +var Buffer = require('buffer').Buffer + +module.exports = function (buf) { + // If the buffer is backed by a Uint8Array, a faster version will work + if (buf instanceof Uint8Array) { + // If the buffer isn't a subarray, return the underlying ArrayBuffer + if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) { + return buf.buffer + } else if (typeof buf.buffer.slice === 'function') { + // Otherwise we need to get a proper copy + return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength) + } + } + + if (Buffer.isBuffer(buf)) { + // This is the slow version that will work with any Buffer + // implementation (even in old browsers) + var arrayCopy = new Uint8Array(buf.length) + var len = buf.length + for (var i = 0; i < len; i++) { + arrayCopy[i] = buf[i] + } + return arrayCopy.buffer + } else { + throw new Error('Argument must be a Buffer') + } +} diff --git a/node_modules/to-arraybuffer/package.json b/node_modules/to-arraybuffer/package.json new file mode 100644 index 000000000..809b9f5db --- /dev/null +++ b/node_modules/to-arraybuffer/package.json @@ -0,0 +1,61 @@ +{ + "_from": "to-arraybuffer@^1.0.0", + "_id": "to-arraybuffer@1.0.1", + "_inBundle": false, + "_integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "_location": "/to-arraybuffer", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "to-arraybuffer@^1.0.0", + "name": "to-arraybuffer", + "escapedName": "to-arraybuffer", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/stream-http" + ], + "_resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "_shasum": "7d229b1fcc637e466ca081180836a7aabff83f43", + "_spec": "to-arraybuffer@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/stream-http", + "author": { + "name": "John Hiesey" + }, + "bugs": { + "url": "https://github.com/jhiesey/to-arraybuffer/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Get an ArrayBuffer from a Buffer as fast as possible", + "devDependencies": { + "tape": "^4.4.0", + "zuul": "^3.9.0" + }, + "homepage": "https://github.com/jhiesey/to-arraybuffer#readme", + "keywords": [ + "buffer", + "to", + "arraybuffer", + "fast", + "read", + "only" + ], + "license": "MIT", + "main": "index.js", + "name": "to-arraybuffer", + "repository": { + "type": "git", + "url": "git://github.com/jhiesey/to-arraybuffer.git" + }, + "scripts": { + "test": "npm run test-node && ([ -n \"${TRAVIS_PULL_REQUEST}\" -a \"${TRAVIS_PULL_REQUEST}\" != 'false' ] || npm run test-browser)", + "test-browser": "zuul --no-coverage -- test.js", + "test-browser-local": "zuul --local 8080 --no-coverage -- test.js", + "test-node": "tape test.js" + }, + "version": "1.0.1" +} diff --git a/node_modules/to-arraybuffer/test.js b/node_modules/to-arraybuffer/test.js new file mode 100644 index 000000000..1814ae3ff --- /dev/null +++ b/node_modules/to-arraybuffer/test.js @@ -0,0 +1,57 @@ +var Buffer = require('buffer').Buffer +var test = require('tape') + +var toArrayBuffer = require('.') + +function elementsEqual (ab, buffer) { + var view = new Uint8Array(ab) + for (var i = 0; i < view.length; i++) { + if (view[i] !== buffer[i]) { + return false + } + } + return true +} + +test('Basic behavior', function (t) { + var buf = new Buffer(10) + for (var i = 0; i < 10; i++) { + buf[i] = i + } + + var ab = toArrayBuffer(buf) + + t.equals(ab.byteLength, 10, 'correct length') + t.ok(elementsEqual(ab, buf), 'elements equal') + t.end() +}) + +test('Behavior when input is a subarray 1', function (t) { + var origBuf = new Buffer(10) + for (var i = 0; i < 10; i++) { + origBuf[i] = i + } + var buf = origBuf.slice(1) + + var ab = toArrayBuffer(buf) + + t.equals(ab.byteLength, 9, 'correct length') + t.ok(elementsEqual(ab, buf), 'elements equal') + t.notOk(ab === buf.buffer, 'the underlying ArrayBuffer is not returned when incorrect') + t.end() +}) + +test('Behavior when input is a subarray 2', function (t) { + var origBuf = new Buffer(10) + for (var i = 0; i < 10; i++) { + origBuf[i] = i + } + var buf = origBuf.slice(0, 9) + + var ab = toArrayBuffer(buf) + + t.equals(ab.byteLength, 9, 'correct length') + t.ok(elementsEqual(ab, buf), 'elements equal') + t.notOk(ab === buf.buffer, 'the underlying ArrayBuffer is not returned when incorrect') + t.end() +}) diff --git a/node_modules/to-object-path/LICENSE b/node_modules/to-object-path/LICENSE new file mode 100644 index 000000000..1e49edf81 --- /dev/null +++ b/node_modules/to-object-path/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2016, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/to-object-path/README.md b/node_modules/to-object-path/README.md new file mode 100644 index 000000000..7f3cfb163 --- /dev/null +++ b/node_modules/to-object-path/README.md @@ -0,0 +1,71 @@ +# to-object-path [![NPM version](https://badge.fury.io/js/to-object-path.svg)](http://badge.fury.io/js/to-object-path) + +> Create an object path from a list or array of strings. + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i to-object-path --save +``` + +## Usage + +```js +var toPath = require('to-object-path'); + +toPath('foo', 'bar', 'baz'); +toPath('foo', ['bar', 'baz']); +//=> 'foo.bar.baz' +``` + +Also supports passing an arguments object (without having to slice args): + +```js +function foo() + return toPath(arguments); +} + +foo('foo', 'bar', 'baz'); +foo('foo', ['bar', 'baz']); +//=> 'foo.bar.baz' +``` + +Visit the [example](./example.js) to see how this could be used in an application. + +## Related projects + +* [get-value](https://www.npmjs.com/package/get-value): Use property paths (` a.b.c`) to get a nested value from an object. | [homepage](https://github.com/jonschlinkert/get-value) +* [has-value](https://www.npmjs.com/package/has-value): Returns true if a value exists, false if empty. Works with deeply nested values using… [more](https://www.npmjs.com/package/has-value) | [homepage](https://github.com/jonschlinkert/has-value) +* [omit-value](https://www.npmjs.com/package/omit-value): Omit properties from an object or deeply nested property of an object using object path… [more](https://www.npmjs.com/package/omit-value) | [homepage](https://github.com/jonschlinkert/omit-value) +* [set-value](https://www.npmjs.com/package/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/jonschlinkert/set-value) +* [unset-value](https://www.npmjs.com/package/unset-value): Delete nested properties from an object using dot notation. | [homepage](https://github.com/jonschlinkert/unset-value) + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/to-object-path/issues/new). + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 28, 2015._ \ No newline at end of file diff --git a/node_modules/to-object-path/index.js b/node_modules/to-object-path/index.js new file mode 100644 index 000000000..489f8f684 --- /dev/null +++ b/node_modules/to-object-path/index.js @@ -0,0 +1,33 @@ +/*! + * to-object-path + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var typeOf = require('kind-of'); + +module.exports = function toPath(args) { + if (typeOf(args) !== 'arguments') { + args = arguments; + } + return filter(args).join('.'); +}; + +function filter(arr) { + var len = arr.length; + var idx = -1; + var res = []; + + while (++idx < len) { + var ele = arr[idx]; + if (typeOf(ele) === 'arguments' || Array.isArray(ele)) { + res.push.apply(res, filter(ele)); + } else if (typeof ele === 'string') { + res.push(ele); + } + } + return res; +} diff --git a/node_modules/to-object-path/package.json b/node_modules/to-object-path/package.json new file mode 100644 index 000000000..a662aaa87 --- /dev/null +++ b/node_modules/to-object-path/package.json @@ -0,0 +1,80 @@ +{ + "_from": "to-object-path@^0.3.0", + "_id": "to-object-path@0.3.0", + "_inBundle": false, + "_integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "_location": "/to-object-path", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "to-object-path@^0.3.0", + "name": "to-object-path", + "escapedName": "to-object-path", + "rawSpec": "^0.3.0", + "saveSpec": null, + "fetchSpec": "^0.3.0" + }, + "_requiredBy": [ + "/cache-base", + "/union-value/set-value" + ], + "_resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "_shasum": "297588b7b0e7e0ac08e04e672f85c1f4999e17af", + "_spec": "to-object-path@^0.3.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/cache-base", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/to-object-path/issues" + }, + "bundleDependencies": false, + "dependencies": { + "kind-of": "^3.0.2" + }, + "deprecated": false, + "description": "Create an object path from a list or array of strings.", + "devDependencies": { + "base": "^0.6.7", + "mocha": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/to-object-path", + "keywords": [ + "dot", + "nested", + "notation", + "object", + "path", + "stringify" + ], + "license": "MIT", + "main": "index.js", + "name": "to-object-path", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/to-object-path.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "get-value", + "set-value", + "has-value", + "omit-value", + "unset-value" + ] + } + }, + "version": "0.3.0" +} diff --git a/node_modules/to-regex-range/LICENSE b/node_modules/to-regex-range/LICENSE new file mode 100644 index 000000000..83b56e709 --- /dev/null +++ b/node_modules/to-regex-range/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/to-regex-range/README.md b/node_modules/to-regex-range/README.md new file mode 100644 index 000000000..2763c5aef --- /dev/null +++ b/node_modules/to-regex-range/README.md @@ -0,0 +1,281 @@ +# to-regex-range [![NPM version](https://img.shields.io/npm/v/to-regex-range.svg?style=flat)](https://www.npmjs.com/package/to-regex-range) [![NPM monthly downloads](https://img.shields.io/npm/dm/to-regex-range.svg?style=flat)](https://npmjs.org/package/to-regex-range) [![NPM total downloads](https://img.shields.io/npm/dt/to-regex-range.svg?style=flat)](https://npmjs.org/package/to-regex-range) [![Linux Build Status](https://img.shields.io/travis/micromatch/to-regex-range.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/to-regex-range) + +> Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.78 million test assertions. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save to-regex-range +``` + +Install with [yarn](https://yarnpkg.com): + +```sh +$ yarn add to-regex-range +``` + +
    +What does this do? + +
    + +This libary generates the `source` string to be passed to `new RegExp()` for matching a range of numbers. + +**Example** + +```js +var toRegexRange = require('to-regex-range'); +var regex = new RegExp(toRegexRange('15', '95')); +``` + +A string is returned so that you can do whatever you need with it before passing it to `new RegExp()` (like adding `^` or `$` boundaries, defining flags, or combining it another string). + +
    + +
    + +
    +Why use this library? + +
    + +### Convenience + +Creating regular expressions for matching numbers gets deceptively complicated pretty fast. + +For example, let's say you need a validation regex for matching part of a user-id, postal code, social security number, tax id, etc: + +* regex for matching `1` => `/1/` (easy enough) +* regex for matching `1` through `5` => `/[1-5]/` (not bad...) +* regex for matching `1` or `5` => `/(1|5)/` (still easy...) +* regex for matching `1` through `50` => `/([1-9]|[1-4][0-9]|50)/` (uh-oh...) +* regex for matching `1` through `55` => `/([1-9]|[1-4][0-9]|5[0-5])/` (no prob, I can do this...) +* regex for matching `1` through `555` => `/([1-9]|[1-9][0-9]|[1-4][0-9]{2}|5[0-4][0-9]|55[0-5])/` (maybe not...) +* regex for matching `0001` through `5555` => `/(0{3}[1-9]|0{2}[1-9][0-9]|0[1-9][0-9]{2}|[1-4][0-9]{3}|5[0-4][0-9]{2}|55[0-4][0-9]|555[0-5])/` (okay, I get the point!) + +The numbers are contrived, but they're also really basic. In the real world you might need to generate a regex on-the-fly for validation. + +**Learn more** + +If you're interested in learning more about [character classes](http://www.regular-expressions.info/charclass.html) and other regex features, I personally have always found [regular-expressions.info](http://www.regular-expressions.info/charclass.html) to be pretty useful. + +### Heavily tested + +As of April 27, 2017, this library runs [2,783,483 test assertions](./test/test.js) against generated regex-ranges to provide brute-force verification that results are indeed correct. + +Tests run in ~870ms on my MacBook Pro, 2.5 GHz Intel Core i7. + +### Highly optimized + +Generated regular expressions are highly optimized: + +* duplicate sequences and character classes are reduced using quantifiers +* smart enough to use `?` conditionals when number(s) or range(s) can be positive or negative +* uses fragment caching to avoid processing the same exact string more than once + +
    + +
    + +## Usage + +Add this library to your javascript application with the following line of code + +```js +var toRegexRange = require('to-regex-range'); +``` + +The main export is a function that takes two integers: the `min` value and `max` value (formatted as strings or numbers). + +```js +var source = toRegexRange('15', '95'); +//=> 1[5-9]|[2-8][0-9]|9[0-5] + +var re = new RegExp('^' + source + '$'); +console.log(re.test('14')); //=> false +console.log(re.test('50')); //=> true +console.log(re.test('94')); //=> true +console.log(re.test('96')); //=> false +``` + +## Options + +### options.capture + +**Type**: `boolean` + +**Deafault**: `undefined` + +Wrap the returned value in parentheses when there is more than one regex condition. Useful when you're dynamically generating ranges. + +```js +console.log(toRegexRange('-10', '10')); +//=> -[1-9]|-?10|[0-9] + +console.log(toRegexRange('-10', '10', {capture: true})); +//=> (-[1-9]|-?10|[0-9]) +``` + +### options.shorthand + +**Type**: `boolean` + +**Deafault**: `undefined` + +Use the regex shorthand for `[0-9]`: + +```js +console.log(toRegexRange('0', '999999')); +//=> [0-9]|[1-9][0-9]{1,5} + +console.log(toRegexRange('0', '999999', {shorthand: true})); +//=> \d|[1-9]\d{1,5} +``` + +### options.relaxZeros + +**Type**: `boolean` + +**Default**: `true` + +This option only applies to **negative zero-padded ranges**. By default, when a negative zero-padded range is defined, the number of leading zeros is relaxed using `-0*`. + +```js +console.log(toRegexRange('-001', '100')); +//=> -0*1|0{2}[0-9]|0[1-9][0-9]|100 + +console.log(toRegexRange('-001', '100', {relaxZeros: false})); +//=> -0{2}1|0{2}[0-9]|0[1-9][0-9]|100 +``` + +
    +Why are zeros relaxed for negative zero-padded ranges by default? + +Consider the following. + +```js +var regex = toRegexRange('-001', '100'); +``` + +_Note that `-001` and `100` are both three digits long_. + +In most zero-padding implementations, only a single leading zero is enough to indicate that zero-padding should be applied. Thus, the leading zeros would be "corrected" on the negative range in the example to `-01`, instead of `-001`, to make total length of each string no greater than the length of the largest number in the range (in other words, `-001` is 4 digits, but `100` is only three digits). + +If zeros were not relaxed by default, you might expect the resulting regex of the above pattern to match `-001` - given that it's defined that way in the arguments - _but it wouldn't_. It would, however, match `-01`. This gets even more ambiguous with large ranges, like `-01` to `1000000`. + +Thus, we relax zeros by default to provide a more predictable experience for users. + +
    + +## Examples + +| **Range** | **Result** | **Compile time** | +| --- | --- | --- | +| `toRegexRange('5, 5')` | `5` | _33μs_ | +| `toRegexRange('5, 6')` | `5\|6` | _53μs_ | +| `toRegexRange('29, 51')` | `29\|[34][0-9]\|5[01]` | _699μs_ | +| `toRegexRange('31, 877')` | `3[1-9]\|[4-9][0-9]\|[1-7][0-9]{2}\|8[0-6][0-9]\|87[0-7]` | _711μs_ | +| `toRegexRange('111, 555')` | `11[1-9]\|1[2-9][0-9]\|[2-4][0-9]{2}\|5[0-4][0-9]\|55[0-5]` | _62μs_ | +| `toRegexRange('-10, 10')` | `-[1-9]\|-?10\|[0-9]` | _74μs_ | +| `toRegexRange('-100, -10')` | `-1[0-9]\|-[2-9][0-9]\|-100` | _49μs_ | +| `toRegexRange('-100, 100')` | `-[1-9]\|-?[1-9][0-9]\|-?100\|[0-9]` | _45μs_ | +| `toRegexRange('001, 100')` | `0{2}[1-9]\|0[1-9][0-9]\|100` | _158μs_ | +| `toRegexRange('0010, 1000')` | `0{2}1[0-9]\|0{2}[2-9][0-9]\|0[1-9][0-9]{2}\|1000` | _61μs_ | +| `toRegexRange('1, 2')` | `1\|2` | _10μs_ | +| `toRegexRange('1, 5')` | `[1-5]` | _24μs_ | +| `toRegexRange('1, 10')` | `[1-9]\|10` | _23μs_ | +| `toRegexRange('1, 100')` | `[1-9]\|[1-9][0-9]\|100` | _30μs_ | +| `toRegexRange('1, 1000')` | `[1-9]\|[1-9][0-9]{1,2}\|1000` | _52μs_ | +| `toRegexRange('1, 10000')` | `[1-9]\|[1-9][0-9]{1,3}\|10000` | _47μs_ | +| `toRegexRange('1, 100000')` | `[1-9]\|[1-9][0-9]{1,4}\|100000` | _44μs_ | +| `toRegexRange('1, 1000000')` | `[1-9]\|[1-9][0-9]{1,5}\|1000000` | _49μs_ | +| `toRegexRange('1, 10000000')` | `[1-9]\|[1-9][0-9]{1,6}\|10000000` | _63μs_ | + +## Heads up! + +**Order of arguments** + +When the `min` is larger than the `max`, values will be flipped to create a valid range: + +```js +toRegexRange('51', '29'); +``` + +Is effectively flipped to: + +```js +toRegexRange('29', '51'); +//=> 29|[3-4][0-9]|5[0-1] +``` + +**Steps / increments** + +This library does not support steps (increments). A pr to add support would be welcome. + +## History + +### v2.0.0 - 2017-04-21 + +**New features** + +Adds support for zero-padding! + +### v1.0.0 + +**Optimizations** + +Repeating ranges are now grouped using quantifiers. rocessing time is roughly the same, but the generated regex is much smaller, which should result in faster matching. + +## Attribution + +Inspired by the python library [range-regex](https://github.com/dimka665/range-regex). + +## About + +### Related projects + +* [expand-range](https://www.npmjs.com/package/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See… [more](https://github.com/jonschlinkert/expand-range) | [homepage](https://github.com/jonschlinkert/expand-range "Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See the benchmarks. Used by micromatch.") +* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or `step` to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") +* [repeat-element](https://www.npmjs.com/package/repeat-element): Create an array by repeating the given value n times. | [homepage](https://github.com/jonschlinkert/repeat-element "Create an array by repeating the given value n times.") +* [repeat-string](https://www.npmjs.com/package/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string. | [homepage](https://github.com/jonschlinkert/repeat-string "Repeat the given string n times. Fastest implementation for repeating a string.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on April 27, 2017._ \ No newline at end of file diff --git a/node_modules/to-regex-range/index.js b/node_modules/to-regex-range/index.js new file mode 100644 index 000000000..7bb5a743e --- /dev/null +++ b/node_modules/to-regex-range/index.js @@ -0,0 +1,294 @@ +/*! + * to-regex-range + * + * Copyright (c) 2015, 2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var repeat = require('repeat-string'); +var isNumber = require('is-number'); +var cache = {}; + +function toRegexRange(min, max, options) { + if (isNumber(min) === false) { + throw new RangeError('toRegexRange: first argument is invalid.'); + } + + if (typeof max === 'undefined' || min === max) { + return String(min); + } + + if (isNumber(max) === false) { + throw new RangeError('toRegexRange: second argument is invalid.'); + } + + options = options || {}; + var relax = String(options.relaxZeros); + var shorthand = String(options.shorthand); + var capture = String(options.capture); + var key = min + ':' + max + '=' + relax + shorthand + capture; + if (cache.hasOwnProperty(key)) { + return cache[key].result; + } + + var a = Math.min(min, max); + var b = Math.max(min, max); + + if (Math.abs(a - b) === 1) { + var result = min + '|' + max; + if (options.capture) { + return '(' + result + ')'; + } + return result; + } + + var isPadded = padding(min) || padding(max); + var positives = []; + var negatives = []; + + var tok = {min: min, max: max, a: a, b: b}; + if (isPadded) { + tok.isPadded = isPadded; + tok.maxLen = String(tok.max).length; + } + + if (a < 0) { + var newMin = b < 0 ? Math.abs(b) : 1; + var newMax = Math.abs(a); + negatives = splitToPatterns(newMin, newMax, tok, options); + a = tok.a = 0; + } + + if (b >= 0) { + positives = splitToPatterns(a, b, tok, options); + } + + tok.negatives = negatives; + tok.positives = positives; + tok.result = siftPatterns(negatives, positives, options); + + if (options.capture && (positives.length + negatives.length) > 1) { + tok.result = '(' + tok.result + ')'; + } + + cache[key] = tok; + return tok.result; +} + +function siftPatterns(neg, pos, options) { + var onlyNegative = filterPatterns(neg, pos, '-', false, options) || []; + var onlyPositive = filterPatterns(pos, neg, '', false, options) || []; + var intersected = filterPatterns(neg, pos, '-?', true, options) || []; + var subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); + return subpatterns.join('|'); +} + +function splitToRanges(min, max) { + min = Number(min); + max = Number(max); + + var nines = 1; + var stops = [max]; + var stop = +countNines(min, nines); + + while (min <= stop && stop <= max) { + stops = push(stops, stop); + nines += 1; + stop = +countNines(min, nines); + } + + var zeros = 1; + stop = countZeros(max + 1, zeros) - 1; + + while (min < stop && stop <= max) { + stops = push(stops, stop); + zeros += 1; + stop = countZeros(max + 1, zeros) - 1; + } + + stops.sort(compare); + return stops; +} + +/** + * Convert a range to a regex pattern + * @param {Number} `start` + * @param {Number} `stop` + * @return {String} + */ + +function rangeToPattern(start, stop, options) { + if (start === stop) { + return {pattern: String(start), digits: []}; + } + + var zipped = zip(String(start), String(stop)); + var len = zipped.length, i = -1; + + var pattern = ''; + var digits = 0; + + while (++i < len) { + var numbers = zipped[i]; + var startDigit = numbers[0]; + var stopDigit = numbers[1]; + + if (startDigit === stopDigit) { + pattern += startDigit; + + } else if (startDigit !== '0' || stopDigit !== '9') { + pattern += toCharacterClass(startDigit, stopDigit); + + } else { + digits += 1; + } + } + + if (digits) { + pattern += options.shorthand ? '\\d' : '[0-9]'; + } + + return { pattern: pattern, digits: [digits] }; +} + +function splitToPatterns(min, max, tok, options) { + var ranges = splitToRanges(min, max); + var len = ranges.length; + var idx = -1; + + var tokens = []; + var start = min; + var prev; + + while (++idx < len) { + var range = ranges[idx]; + var obj = rangeToPattern(start, range, options); + var zeros = ''; + + if (!tok.isPadded && prev && prev.pattern === obj.pattern) { + if (prev.digits.length > 1) { + prev.digits.pop(); + } + prev.digits.push(obj.digits[0]); + prev.string = prev.pattern + toQuantifier(prev.digits); + start = range + 1; + continue; + } + + if (tok.isPadded) { + zeros = padZeros(range, tok); + } + + obj.string = zeros + obj.pattern + toQuantifier(obj.digits); + tokens.push(obj); + start = range + 1; + prev = obj; + } + + return tokens; +} + +function filterPatterns(arr, comparison, prefix, intersection, options) { + var res = []; + + for (var i = 0; i < arr.length; i++) { + var tok = arr[i]; + var ele = tok.string; + + if (options.relaxZeros !== false) { + if (prefix === '-' && ele.charAt(0) === '0') { + if (ele.charAt(1) === '{') { + ele = '0*' + ele.replace(/^0\{\d+\}/, ''); + } else { + ele = '0*' + ele.slice(1); + } + } + } + + if (!intersection && !contains(comparison, 'string', ele)) { + res.push(prefix + ele); + } + + if (intersection && contains(comparison, 'string', ele)) { + res.push(prefix + ele); + } + } + return res; +} + +/** + * Zip strings (`for in` can be used on string characters) + */ + +function zip(a, b) { + var arr = []; + for (var ch in a) arr.push([a[ch], b[ch]]); + return arr; +} + +function compare(a, b) { + return a > b ? 1 : b > a ? -1 : 0; +} + +function push(arr, ele) { + if (arr.indexOf(ele) === -1) arr.push(ele); + return arr; +} + +function contains(arr, key, val) { + for (var i = 0; i < arr.length; i++) { + if (arr[i][key] === val) { + return true; + } + } + return false; +} + +function countNines(min, len) { + return String(min).slice(0, -len) + repeat('9', len); +} + +function countZeros(integer, zeros) { + return integer - (integer % Math.pow(10, zeros)); +} + +function toQuantifier(digits) { + var start = digits[0]; + var stop = digits[1] ? (',' + digits[1]) : ''; + if (!stop && (!start || start === 1)) { + return ''; + } + return '{' + start + stop + '}'; +} + +function toCharacterClass(a, b) { + return '[' + a + ((b - a === 1) ? '' : '-') + b + ']'; +} + +function padding(str) { + return /^-?(0+)\d/.exec(str); +} + +function padZeros(val, tok) { + if (tok.isPadded) { + var diff = Math.abs(tok.maxLen - String(val).length); + switch (diff) { + case 0: + return ''; + case 1: + return '0'; + default: { + return '0{' + diff + '}'; + } + } + } + return val; +} + +/** + * Expose `toRegexRange` + */ + +module.exports = toRegexRange; diff --git a/node_modules/to-regex-range/node_modules/is-number/LICENSE b/node_modules/to-regex-range/node_modules/is-number/LICENSE new file mode 100644 index 000000000..842218cf0 --- /dev/null +++ b/node_modules/to-regex-range/node_modules/is-number/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/to-regex-range/node_modules/is-number/README.md b/node_modules/to-regex-range/node_modules/is-number/README.md new file mode 100644 index 000000000..281165dce --- /dev/null +++ b/node_modules/to-regex-range/node_modules/is-number/README.md @@ -0,0 +1,115 @@ +# is-number [![NPM version](https://img.shields.io/npm/v/is-number.svg?style=flat)](https://www.npmjs.com/package/is-number) [![NPM downloads](https://img.shields.io/npm/dm/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-number.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-number) + +> Returns true if the value is a number. comprehensive tests. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-number +``` + +## Usage + +To understand some of the rationale behind the decisions made in this library (and to learn about some oddities of number evaluation in JavaScript), [see this gist](https://gist.github.com/jonschlinkert/e30c70c713da325d0e81). + +```js +var isNumber = require('is-number'); +``` + +### true + +See the [tests](./test.js) for more examples. + +```js +isNumber(5e3) //=> 'true' +isNumber(0xff) //=> 'true' +isNumber(-1.1) //=> 'true' +isNumber(0) //=> 'true' +isNumber(1) //=> 'true' +isNumber(1.1) //=> 'true' +isNumber(10) //=> 'true' +isNumber(10.10) //=> 'true' +isNumber(100) //=> 'true' +isNumber('-1.1') //=> 'true' +isNumber('0') //=> 'true' +isNumber('012') //=> 'true' +isNumber('0xff') //=> 'true' +isNumber('1') //=> 'true' +isNumber('1.1') //=> 'true' +isNumber('10') //=> 'true' +isNumber('10.10') //=> 'true' +isNumber('100') //=> 'true' +isNumber('5e3') //=> 'true' +isNumber(parseInt('012')) //=> 'true' +isNumber(parseFloat('012')) //=> 'true' +``` + +### False + +See the [tests](./test.js) for more examples. + +```js +isNumber('foo') //=> 'false' +isNumber([1]) //=> 'false' +isNumber([]) //=> 'false' +isNumber(function () {}) //=> 'false' +isNumber(Infinity) //=> 'false' +isNumber(NaN) //=> 'false' +isNumber(new Array('abc')) //=> 'false' +isNumber(new Array(2)) //=> 'false' +isNumber(new Buffer('abc')) //=> 'false' +isNumber(null) //=> 'false' +isNumber(undefined) //=> 'false' +isNumber({abc: 'abc'}) //=> 'false' +``` + +## About + +### Related projects + +* [even](https://www.npmjs.com/package/even): Get the even numbered items from an array. | [homepage](https://github.com/jonschlinkert/even "Get the even numbered items from an array.") +* [is-even](https://www.npmjs.com/package/is-even): Return true if the given number is even. | [homepage](https://github.com/jonschlinkert/is-even "Return true if the given number is even.") +* [is-odd](https://www.npmjs.com/package/is-odd): Returns true if the given number is odd. | [homepage](https://github.com/jonschlinkert/is-odd "Returns true if the given number is odd.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") +* [odd](https://www.npmjs.com/package/odd): Get the odd numbered items from an array. | [homepage](https://github.com/jonschlinkert/odd "Get the odd numbered items from an array.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/is-number/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.30, on September 10, 2016._ \ No newline at end of file diff --git a/node_modules/to-regex-range/node_modules/is-number/index.js b/node_modules/to-regex-range/node_modules/is-number/index.js new file mode 100644 index 000000000..7a2a45bed --- /dev/null +++ b/node_modules/to-regex-range/node_modules/is-number/index.js @@ -0,0 +1,22 @@ +/*! + * is-number + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var typeOf = require('kind-of'); + +module.exports = function isNumber(num) { + var type = typeOf(num); + + if (type === 'string') { + if (!num.trim()) return false; + } else if (type !== 'number') { + return false; + } + + return (num - num + 1) >= 0; +}; diff --git a/node_modules/to-regex-range/node_modules/is-number/package.json b/node_modules/to-regex-range/node_modules/is-number/package.json new file mode 100644 index 000000000..58e016483 --- /dev/null +++ b/node_modules/to-regex-range/node_modules/is-number/package.json @@ -0,0 +1,121 @@ +{ + "_from": "is-number@^3.0.0", + "_id": "is-number@3.0.0", + "_inBundle": false, + "_integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "_location": "/to-regex-range/is-number", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-number@^3.0.0", + "name": "is-number", + "escapedName": "is-number", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/to-regex-range" + ], + "_resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "_shasum": "24fd6201a4782cf50561c810276afc7d12d71195", + "_spec": "is-number@^3.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/to-regex-range", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/is-number/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Charlike Mike Reagent", + "url": "http://www.tunnckocore.tk" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + } + ], + "dependencies": { + "kind-of": "^3.0.2" + }, + "deprecated": false, + "description": "Returns true if the value is a number. comprehensive tests.", + "devDependencies": { + "benchmarked": "^0.2.5", + "chalk": "^1.1.3", + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/is-number", + "keywords": [ + "check", + "coerce", + "coercion", + "integer", + "is", + "is-nan", + "is-num", + "is-number", + "istype", + "kind", + "math", + "nan", + "num", + "number", + "numeric", + "test", + "type", + "typeof", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "is-number", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/is-number.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "even", + "is-even", + "is-odd", + "is-primitive", + "kind-of", + "odd" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ] + }, + "version": "3.0.0" +} diff --git a/node_modules/to-regex-range/package.json b/node_modules/to-regex-range/package.json new file mode 100644 index 000000000..212e42e1b --- /dev/null +++ b/node_modules/to-regex-range/package.json @@ -0,0 +1,119 @@ +{ + "_from": "to-regex-range@^2.1.0", + "_id": "to-regex-range@2.1.1", + "_inBundle": false, + "_integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "_location": "/to-regex-range", + "_phantomChildren": { + "kind-of": "3.2.2" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "to-regex-range@^2.1.0", + "name": "to-regex-range", + "escapedName": "to-regex-range", + "rawSpec": "^2.1.0", + "saveSpec": null, + "fetchSpec": "^2.1.0" + }, + "_requiredBy": [ + "/readdirp/fill-range" + ], + "_resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "_shasum": "7c80c17b9dfebe599e27367e0d4dd5590141db38", + "_spec": "to-regex-range@^2.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/fill-range", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/micromatch/to-regex-range/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "deprecated": false, + "description": "Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.78 million test assertions.", + "devDependencies": { + "fill-range": "^3.1.1", + "gulp-format-md": "^0.1.12", + "mocha": "^3.2.0", + "text-table": "^0.2.0", + "time-diff": "^0.3.1" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/micromatch/to-regex-range", + "keywords": [ + "alpha", + "alphabetical", + "bash", + "brace", + "date", + "expand", + "expansion", + "glob", + "match", + "matches", + "matching", + "number", + "numerical", + "range", + "ranges", + "regex", + "sequence", + "sh", + "to", + "year" + ], + "license": "MIT", + "main": "index.js", + "name": "to-regex-range", + "repository": { + "type": "git", + "url": "git+https://github.com/micromatch/to-regex-range.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "expand-range", + "fill-range", + "micromatch", + "repeat-element", + "repeat-string" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "helpers": [ + "./examples.js" + ], + "reflinks": [ + "0-5", + "0-9", + "1-5", + "1-9" + ] + }, + "version": "2.1.1" +} diff --git a/node_modules/to-regex/LICENSE b/node_modules/to-regex/LICENSE new file mode 100644 index 000000000..7c9987bc6 --- /dev/null +++ b/node_modules/to-regex/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016-2018, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/to-regex/README.md b/node_modules/to-regex/README.md new file mode 100644 index 000000000..5a28fc33b --- /dev/null +++ b/node_modules/to-regex/README.md @@ -0,0 +1,205 @@ +# to-regex [![NPM version](https://img.shields.io/npm/v/to-regex.svg?style=flat)](https://www.npmjs.com/package/to-regex) [![NPM monthly downloads](https://img.shields.io/npm/dm/to-regex.svg?style=flat)](https://npmjs.org/package/to-regex) [![NPM total downloads](https://img.shields.io/npm/dt/to-regex.svg?style=flat)](https://npmjs.org/package/to-regex) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/to-regex.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/to-regex) + +> Generate a regex from a string or array of strings. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +- [Install](#install) +- [Usage](#usage) +- [Options](#options) + * [options.contains](#optionscontains) + * [options.negate](#optionsnegate) + * [options.nocase](#optionsnocase) + * [options.flags](#optionsflags) + * [options.cache](#optionscache) + * [options.safe](#optionssafe) +- [About](#about) + * [Related projects](#related-projects) + * [Author](#author) + * [License](#license) + +_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save to-regex +``` + +## Usage + +```js +var toRegex = require('to-regex'); + +console.log(toRegex('foo')); +//=> /^(?:foo)$/ + +console.log(toRegex('foo', {negate: true})); +//=> /^(?:(?:(?!^(?:foo)$).)*)$/ + +console.log(toRegex('foo', {contains: true})); +//=> /(?:foo)/ + +console.log(toRegex(['foo', 'bar'], {negate: true})); +//=> /^(?:(?:(?!^(?:(?:foo)|(?:bar))$).)*)$/ + +console.log(toRegex(['foo', 'bar'], {negate: true, contains: true})); +//=> /^(?:(?:(?!(?:(?:foo)|(?:bar))).)*)$/ +``` + +## Options + +### options.contains + +**Type**: `Boolean` + +**Default**: `undefined` + +Generate a regex that will match any string that _contains_ the given pattern. By default, regex is strict will only return true for exact matches. + +```js +var toRegex = require('to-regex'); +console.log(toRegex('foo', {contains: true})); +//=> /(?:foo)/ +``` + +### options.negate + +**Type**: `Boolean` + +**Default**: `undefined` + +Create a regex that will match everything except the given pattern. + +```js +var toRegex = require('to-regex'); +console.log(toRegex('foo', {negate: true})); +//=> /^(?:(?:(?!^(?:foo)$).)*)$/ +``` + +### options.nocase + +**Type**: `Boolean` + +**Default**: `undefined` + +Adds the `i` flag, to enable case-insensitive matching. + +```js +var toRegex = require('to-regex'); +console.log(toRegex('foo', {nocase: true})); +//=> /^(?:foo)$/i +``` + +Alternatively you can pass the flags you want directly on [options.flags](#options.flags). + +### options.flags + +**Type**: `String` + +**Default**: `undefined` + +Define the flags you want to use on the generated regex. + +```js +var toRegex = require('to-regex'); +console.log(toRegex('foo', {flags: 'gm'})); +//=> /^(?:foo)$/gm +console.log(toRegex('foo', {flags: 'gmi', nocase: true})); //<= handles redundancy +//=> /^(?:foo)$/gmi +``` + +### options.cache + +**Type**: `Boolean` + +**Default**: `true` + +Generated regex is cached based on the provided string and options. As a result, runtime compilation only happens once per pattern (as long as options are also the same), which can result in dramatic speed improvements. + +This also helps with debugging, since adding options and pattern are added to the generated regex. + +**Disable caching** + +```js +toRegex('foo', {cache: false}); +``` + +### options.safe + +**Type**: `Boolean` + +**Default**: `undefined` + +Check the generated regular expression with [safe-regex](https://github.com/substack/safe-regex) and throw an error if the regex is potentially unsafe. + +**Examples** + +```js +console.log(toRegex('(x+x+)+y')); +//=> /^(?:(x+x+)+y)$/ + +// The following would throw an error +toRegex('(x+x+)+y', {safe: true}); +``` + +## About + +
    +Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
    + +
    +Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
    + +
    +Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
    + +### Related projects + +You might also be interested in these projects: + +* [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob "Returns `true` if an array has a glob pattern.") +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [path-regex](https://www.npmjs.com/package/path-regex): Regular expression for matching the parts of a file path. | [homepage](https://github.com/regexps/path-regex "Regular expression for matching the parts of a file path.") +* [to-regex-range](https://www.npmjs.com/package/to-regex-range): Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than… [more](https://github.com/micromatch/to-regex-range) | [homepage](https://github.com/micromatch/to-regex-range "Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.78 million test assertions.") + +### Author + +**Jon Schlinkert** + +* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on February 24, 2018._ \ No newline at end of file diff --git a/node_modules/to-regex/index.js b/node_modules/to-regex/index.js new file mode 100644 index 000000000..a87d01591 --- /dev/null +++ b/node_modules/to-regex/index.js @@ -0,0 +1,155 @@ +'use strict'; + +var safe = require('safe-regex'); +var define = require('define-property'); +var extend = require('extend-shallow'); +var not = require('regex-not'); +var MAX_LENGTH = 1024 * 64; + +/** + * Session cache + */ + +var cache = {}; + +/** + * Create a regular expression from the given `pattern` string. + * + * @param {String|RegExp} `pattern` Pattern can be a string or regular expression. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + +module.exports = function(patterns, options) { + if (!Array.isArray(patterns)) { + return makeRe(patterns, options); + } + return makeRe(patterns.join('|'), options); +}; + +/** + * Create a regular expression from the given `pattern` string. + * + * @param {String|RegExp} `pattern` Pattern can be a string or regular expression. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + +function makeRe(pattern, options) { + if (pattern instanceof RegExp) { + return pattern; + } + + if (typeof pattern !== 'string') { + throw new TypeError('expected a string'); + } + + if (pattern.length > MAX_LENGTH) { + throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters'); + } + + var key = pattern; + // do this before shallow cloning options, it's a lot faster + if (!options || (options && options.cache !== false)) { + key = createKey(pattern, options); + + if (cache.hasOwnProperty(key)) { + return cache[key]; + } + } + + var opts = extend({}, options); + if (opts.contains === true) { + if (opts.negate === true) { + opts.strictNegate = false; + } else { + opts.strict = false; + } + } + + if (opts.strict === false) { + opts.strictOpen = false; + opts.strictClose = false; + } + + var open = opts.strictOpen !== false ? '^' : ''; + var close = opts.strictClose !== false ? '$' : ''; + var flags = opts.flags || ''; + var regex; + + if (opts.nocase === true && !/i/.test(flags)) { + flags += 'i'; + } + + try { + if (opts.negate || typeof opts.strictNegate === 'boolean') { + pattern = not.create(pattern, opts); + } + + var str = open + '(?:' + pattern + ')' + close; + regex = new RegExp(str, flags); + + if (opts.safe === true && safe(regex) === false) { + throw new Error('potentially unsafe regular expression: ' + regex.source); + } + + } catch (err) { + if (opts.strictErrors === true || opts.safe === true) { + err.key = key; + err.pattern = pattern; + err.originalOptions = options; + err.createdOptions = opts; + throw err; + } + + try { + regex = new RegExp('^' + pattern.replace(/(\W)/g, '\\$1') + '$'); + } catch (err) { + regex = /.^/; //<= match nothing + } + } + + if (opts.cache !== false) { + memoize(regex, key, pattern, opts); + } + return regex; +} + +/** + * Memoize generated regex. This can result in dramatic speed improvements + * and simplify debugging by adding options and pattern to the regex. It can be + * disabled by passing setting `options.cache` to false. + */ + +function memoize(regex, key, pattern, options) { + define(regex, 'cached', true); + define(regex, 'pattern', pattern); + define(regex, 'options', options); + define(regex, 'key', key); + cache[key] = regex; +} + +/** + * Create the key to use for memoization. The key is generated + * by iterating over the options and concatenating key-value pairs + * to the pattern string. + */ + +function createKey(pattern, options) { + if (!options) return pattern; + var key = pattern; + for (var prop in options) { + if (options.hasOwnProperty(prop)) { + key += ';' + prop + '=' + String(options[prop]); + } + } + return key; +} + +/** + * Expose `makeRe` + */ + +module.exports.makeRe = makeRe; diff --git a/node_modules/to-regex/package.json b/node_modules/to-regex/package.json new file mode 100644 index 000000000..39d634e6b --- /dev/null +++ b/node_modules/to-regex/package.json @@ -0,0 +1,97 @@ +{ + "_from": "to-regex@^3.0.2", + "_id": "to-regex@3.0.2", + "_inBundle": false, + "_integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "_location": "/to-regex", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "to-regex@^3.0.2", + "name": "to-regex", + "escapedName": "to-regex", + "rawSpec": "^3.0.2", + "saveSpec": null, + "fetchSpec": "^3.0.2" + }, + "_requiredBy": [ + "/nanomatch", + "/readdirp/braces", + "/readdirp/expand-brackets", + "/readdirp/extglob", + "/readdirp/micromatch" + ], + "_resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "_shasum": "13cfdd9b336552f30b51f33a8ae1b42a7a7599ce", + "_spec": "to-regex@^3.0.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/to-regex/issues" + }, + "bundleDependencies": false, + "dependencies": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + }, + "deprecated": false, + "description": "Generate a regex from a string or array of strings.", + "devDependencies": { + "gulp-format-md": "^1.0.0", + "mocha": "^3.5.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/to-regex", + "keywords": [ + "match", + "regex", + "regular expression", + "test", + "to" + ], + "license": "MIT", + "main": "index.js", + "name": "to-regex", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/to-regex.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": { + "method": "preWrite" + }, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "has-glob", + "is-glob", + "path-regex", + "to-regex-range" + ] + }, + "lint": { + "reflinks": true + } + }, + "version": "3.0.2" +} diff --git a/node_modules/tty-browserify/LICENSE b/node_modules/tty-browserify/LICENSE new file mode 100644 index 000000000..ee27ba4b4 --- /dev/null +++ b/node_modules/tty-browserify/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/tty-browserify/index.js b/node_modules/tty-browserify/index.js new file mode 100644 index 000000000..7823016c5 --- /dev/null +++ b/node_modules/tty-browserify/index.js @@ -0,0 +1,11 @@ +exports.isatty = function () { return false; }; + +function ReadStream() { + throw new Error('tty.ReadStream is not implemented'); +} +exports.ReadStream = ReadStream; + +function WriteStream() { + throw new Error('tty.WriteStream is not implemented'); +} +exports.WriteStream = WriteStream; diff --git a/node_modules/tty-browserify/package.json b/node_modules/tty-browserify/package.json new file mode 100644 index 000000000..cab3b4444 --- /dev/null +++ b/node_modules/tty-browserify/package.json @@ -0,0 +1,57 @@ +{ + "_from": "tty-browserify@0.0.1", + "_id": "tty-browserify@0.0.1", + "_inBundle": false, + "_integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", + "_location": "/tty-browserify", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "tty-browserify@0.0.1", + "name": "tty-browserify", + "escapedName": "tty-browserify", + "rawSpec": "0.0.1", + "saveSpec": null, + "fetchSpec": "0.0.1" + }, + "_requiredBy": [ + "/browserify" + ], + "_resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", + "_shasum": "3f05251ee17904dfd0677546670db9651682b811", + "_spec": "tty-browserify@0.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/browserify/tty-browserify/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "the tty module from node core for browsers", + "devDependencies": { + "tape": "~1.0.4" + }, + "homepage": "https://github.com/browserify/tty-browserify", + "keywords": [ + "tty", + "browser", + "browserify" + ], + "license": "MIT", + "main": "index.js", + "name": "tty-browserify", + "repository": { + "type": "git", + "url": "git://github.com/browserify/tty-browserify.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "version": "0.0.1" +} diff --git a/node_modules/tty-browserify/readme.markdown b/node_modules/tty-browserify/readme.markdown new file mode 100644 index 000000000..91a2051ae --- /dev/null +++ b/node_modules/tty-browserify/readme.markdown @@ -0,0 +1 @@ +# tty-browserify diff --git a/node_modules/typedarray/.travis.yml b/node_modules/typedarray/.travis.yml new file mode 100644 index 000000000..cc4dba29d --- /dev/null +++ b/node_modules/typedarray/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/node_modules/typedarray/LICENSE b/node_modules/typedarray/LICENSE new file mode 100644 index 000000000..11adfaec9 --- /dev/null +++ b/node_modules/typedarray/LICENSE @@ -0,0 +1,35 @@ +/* + Copyright (c) 2010, Linden Research, Inc. + Copyright (c) 2012, Joshua Bell + + 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. + $/LicenseInfo$ + */ + +// Original can be found at: +// https://bitbucket.org/lindenlab/llsd +// Modifications by Joshua Bell inexorabletash@gmail.com +// https://github.com/inexorabletash/polyfill + +// ES3/ES5 implementation of the Krhonos Typed Array Specification +// Ref: http://www.khronos.org/registry/typedarray/specs/latest/ +// Date: 2011-02-01 +// +// Variations: +// * Allows typed_array.get/set() as alias for subscripts (typed_array[]) diff --git a/node_modules/typedarray/example/tarray.js b/node_modules/typedarray/example/tarray.js new file mode 100644 index 000000000..8423d7c9b --- /dev/null +++ b/node_modules/typedarray/example/tarray.js @@ -0,0 +1,4 @@ +var Uint8Array = require('../').Uint8Array; +var ua = new Uint8Array(5); +ua[1] = 256 + 55; +console.log(ua[1]); diff --git a/node_modules/typedarray/index.js b/node_modules/typedarray/index.js new file mode 100644 index 000000000..5e540841f --- /dev/null +++ b/node_modules/typedarray/index.js @@ -0,0 +1,630 @@ +var undefined = (void 0); // Paranoia + +// Beyond this value, index getters/setters (i.e. array[0], array[1]) are so slow to +// create, and consume so much memory, that the browser appears frozen. +var MAX_ARRAY_LENGTH = 1e5; + +// Approximations of internal ECMAScript conversion functions +var ECMAScript = (function() { + // Stash a copy in case other scripts modify these + var opts = Object.prototype.toString, + ophop = Object.prototype.hasOwnProperty; + + return { + // Class returns internal [[Class]] property, used to avoid cross-frame instanceof issues: + Class: function(v) { return opts.call(v).replace(/^\[object *|\]$/g, ''); }, + HasProperty: function(o, p) { return p in o; }, + HasOwnProperty: function(o, p) { return ophop.call(o, p); }, + IsCallable: function(o) { return typeof o === 'function'; }, + ToInt32: function(v) { return v >> 0; }, + ToUint32: function(v) { return v >>> 0; } + }; +}()); + +// Snapshot intrinsics +var LN2 = Math.LN2, + abs = Math.abs, + floor = Math.floor, + log = Math.log, + min = Math.min, + pow = Math.pow, + round = Math.round; + +// ES5: lock down object properties +function configureProperties(obj) { + if (getOwnPropNames && defineProp) { + var props = getOwnPropNames(obj), i; + for (i = 0; i < props.length; i += 1) { + defineProp(obj, props[i], { + value: obj[props[i]], + writable: false, + enumerable: false, + configurable: false + }); + } + } +} + +// emulate ES5 getter/setter API using legacy APIs +// http://blogs.msdn.com/b/ie/archive/2010/09/07/transitioning-existing-code-to-the-es5-getter-setter-apis.aspx +// (second clause tests for Object.defineProperty() in IE<9 that only supports extending DOM prototypes, but +// note that IE<9 does not support __defineGetter__ or __defineSetter__ so it just renders the method harmless) +var defineProp +if (Object.defineProperty && (function() { + try { + Object.defineProperty({}, 'x', {}); + return true; + } catch (e) { + return false; + } + })()) { + defineProp = Object.defineProperty; +} else { + defineProp = function(o, p, desc) { + if (!o === Object(o)) throw new TypeError("Object.defineProperty called on non-object"); + if (ECMAScript.HasProperty(desc, 'get') && Object.prototype.__defineGetter__) { Object.prototype.__defineGetter__.call(o, p, desc.get); } + if (ECMAScript.HasProperty(desc, 'set') && Object.prototype.__defineSetter__) { Object.prototype.__defineSetter__.call(o, p, desc.set); } + if (ECMAScript.HasProperty(desc, 'value')) { o[p] = desc.value; } + return o; + }; +} + +var getOwnPropNames = Object.getOwnPropertyNames || function (o) { + if (o !== Object(o)) throw new TypeError("Object.getOwnPropertyNames called on non-object"); + var props = [], p; + for (p in o) { + if (ECMAScript.HasOwnProperty(o, p)) { + props.push(p); + } + } + return props; +}; + +// ES5: Make obj[index] an alias for obj._getter(index)/obj._setter(index, value) +// for index in 0 ... obj.length +function makeArrayAccessors(obj) { + if (!defineProp) { return; } + + if (obj.length > MAX_ARRAY_LENGTH) throw new RangeError("Array too large for polyfill"); + + function makeArrayAccessor(index) { + defineProp(obj, index, { + 'get': function() { return obj._getter(index); }, + 'set': function(v) { obj._setter(index, v); }, + enumerable: true, + configurable: false + }); + } + + var i; + for (i = 0; i < obj.length; i += 1) { + makeArrayAccessor(i); + } +} + +// Internal conversion functions: +// pack() - take a number (interpreted as Type), output a byte array +// unpack() - take a byte array, output a Type-like number + +function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; } +function as_unsigned(value, bits) { var s = 32 - bits; return (value << s) >>> s; } + +function packI8(n) { return [n & 0xff]; } +function unpackI8(bytes) { return as_signed(bytes[0], 8); } + +function packU8(n) { return [n & 0xff]; } +function unpackU8(bytes) { return as_unsigned(bytes[0], 8); } + +function packU8Clamped(n) { n = round(Number(n)); return [n < 0 ? 0 : n > 0xff ? 0xff : n & 0xff]; } + +function packI16(n) { return [(n >> 8) & 0xff, n & 0xff]; } +function unpackI16(bytes) { return as_signed(bytes[0] << 8 | bytes[1], 16); } + +function packU16(n) { return [(n >> 8) & 0xff, n & 0xff]; } +function unpackU16(bytes) { return as_unsigned(bytes[0] << 8 | bytes[1], 16); } + +function packI32(n) { return [(n >> 24) & 0xff, (n >> 16) & 0xff, (n >> 8) & 0xff, n & 0xff]; } +function unpackI32(bytes) { return as_signed(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32); } + +function packU32(n) { return [(n >> 24) & 0xff, (n >> 16) & 0xff, (n >> 8) & 0xff, n & 0xff]; } +function unpackU32(bytes) { return as_unsigned(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32); } + +function packIEEE754(v, ebits, fbits) { + + var bias = (1 << (ebits - 1)) - 1, + s, e, f, ln, + i, bits, str, bytes; + + function roundToEven(n) { + var w = floor(n), f = n - w; + if (f < 0.5) + return w; + if (f > 0.5) + return w + 1; + return w % 2 ? w + 1 : w; + } + + // Compute sign, exponent, fraction + if (v !== v) { + // NaN + // http://dev.w3.org/2006/webapi/WebIDL/#es-type-mapping + e = (1 << ebits) - 1; f = pow(2, fbits - 1); s = 0; + } else if (v === Infinity || v === -Infinity) { + e = (1 << ebits) - 1; f = 0; s = (v < 0) ? 1 : 0; + } else if (v === 0) { + e = 0; f = 0; s = (1 / v === -Infinity) ? 1 : 0; + } else { + s = v < 0; + v = abs(v); + + if (v >= pow(2, 1 - bias)) { + e = min(floor(log(v) / LN2), 1023); + f = roundToEven(v / pow(2, e) * pow(2, fbits)); + if (f / pow(2, fbits) >= 2) { + e = e + 1; + f = 1; + } + if (e > bias) { + // Overflow + e = (1 << ebits) - 1; + f = 0; + } else { + // Normalized + e = e + bias; + f = f - pow(2, fbits); + } + } else { + // Denormalized + e = 0; + f = roundToEven(v / pow(2, 1 - bias - fbits)); + } + } + + // Pack sign, exponent, fraction + bits = []; + for (i = fbits; i; i -= 1) { bits.push(f % 2 ? 1 : 0); f = floor(f / 2); } + for (i = ebits; i; i -= 1) { bits.push(e % 2 ? 1 : 0); e = floor(e / 2); } + bits.push(s ? 1 : 0); + bits.reverse(); + str = bits.join(''); + + // Bits to bytes + bytes = []; + while (str.length) { + bytes.push(parseInt(str.substring(0, 8), 2)); + str = str.substring(8); + } + return bytes; +} + +function unpackIEEE754(bytes, ebits, fbits) { + + // Bytes to bits + var bits = [], i, j, b, str, + bias, s, e, f; + + for (i = bytes.length; i; i -= 1) { + b = bytes[i - 1]; + for (j = 8; j; j -= 1) { + bits.push(b % 2 ? 1 : 0); b = b >> 1; + } + } + bits.reverse(); + str = bits.join(''); + + // Unpack sign, exponent, fraction + bias = (1 << (ebits - 1)) - 1; + s = parseInt(str.substring(0, 1), 2) ? -1 : 1; + e = parseInt(str.substring(1, 1 + ebits), 2); + f = parseInt(str.substring(1 + ebits), 2); + + // Produce number + if (e === (1 << ebits) - 1) { + return f !== 0 ? NaN : s * Infinity; + } else if (e > 0) { + // Normalized + return s * pow(2, e - bias) * (1 + f / pow(2, fbits)); + } else if (f !== 0) { + // Denormalized + return s * pow(2, -(bias - 1)) * (f / pow(2, fbits)); + } else { + return s < 0 ? -0 : 0; + } +} + +function unpackF64(b) { return unpackIEEE754(b, 11, 52); } +function packF64(v) { return packIEEE754(v, 11, 52); } +function unpackF32(b) { return unpackIEEE754(b, 8, 23); } +function packF32(v) { return packIEEE754(v, 8, 23); } + + +// +// 3 The ArrayBuffer Type +// + +(function() { + + /** @constructor */ + var ArrayBuffer = function ArrayBuffer(length) { + length = ECMAScript.ToInt32(length); + if (length < 0) throw new RangeError('ArrayBuffer size is not a small enough positive integer'); + + this.byteLength = length; + this._bytes = []; + this._bytes.length = length; + + var i; + for (i = 0; i < this.byteLength; i += 1) { + this._bytes[i] = 0; + } + + configureProperties(this); + }; + + exports.ArrayBuffer = exports.ArrayBuffer || ArrayBuffer; + + // + // 4 The ArrayBufferView Type + // + + // NOTE: this constructor is not exported + /** @constructor */ + var ArrayBufferView = function ArrayBufferView() { + //this.buffer = null; + //this.byteOffset = 0; + //this.byteLength = 0; + }; + + // + // 5 The Typed Array View Types + // + + function makeConstructor(bytesPerElement, pack, unpack) { + // Each TypedArray type requires a distinct constructor instance with + // identical logic, which this produces. + + var ctor; + ctor = function(buffer, byteOffset, length) { + var array, sequence, i, s; + + if (!arguments.length || typeof arguments[0] === 'number') { + // Constructor(unsigned long length) + this.length = ECMAScript.ToInt32(arguments[0]); + if (length < 0) throw new RangeError('ArrayBufferView size is not a small enough positive integer'); + + this.byteLength = this.length * this.BYTES_PER_ELEMENT; + this.buffer = new ArrayBuffer(this.byteLength); + this.byteOffset = 0; + } else if (typeof arguments[0] === 'object' && arguments[0].constructor === ctor) { + // Constructor(TypedArray array) + array = arguments[0]; + + this.length = array.length; + this.byteLength = this.length * this.BYTES_PER_ELEMENT; + this.buffer = new ArrayBuffer(this.byteLength); + this.byteOffset = 0; + + for (i = 0; i < this.length; i += 1) { + this._setter(i, array._getter(i)); + } + } else if (typeof arguments[0] === 'object' && + !(arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) { + // Constructor(sequence array) + sequence = arguments[0]; + + this.length = ECMAScript.ToUint32(sequence.length); + this.byteLength = this.length * this.BYTES_PER_ELEMENT; + this.buffer = new ArrayBuffer(this.byteLength); + this.byteOffset = 0; + + for (i = 0; i < this.length; i += 1) { + s = sequence[i]; + this._setter(i, Number(s)); + } + } else if (typeof arguments[0] === 'object' && + (arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) { + // Constructor(ArrayBuffer buffer, + // optional unsigned long byteOffset, optional unsigned long length) + this.buffer = buffer; + + this.byteOffset = ECMAScript.ToUint32(byteOffset); + if (this.byteOffset > this.buffer.byteLength) { + throw new RangeError("byteOffset out of range"); + } + + if (this.byteOffset % this.BYTES_PER_ELEMENT) { + // The given byteOffset must be a multiple of the element + // size of the specific type, otherwise an exception is raised. + throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size."); + } + + if (arguments.length < 3) { + this.byteLength = this.buffer.byteLength - this.byteOffset; + + if (this.byteLength % this.BYTES_PER_ELEMENT) { + throw new RangeError("length of buffer minus byteOffset not a multiple of the element size"); + } + this.length = this.byteLength / this.BYTES_PER_ELEMENT; + } else { + this.length = ECMAScript.ToUint32(length); + this.byteLength = this.length * this.BYTES_PER_ELEMENT; + } + + if ((this.byteOffset + this.byteLength) > this.buffer.byteLength) { + throw new RangeError("byteOffset and length reference an area beyond the end of the buffer"); + } + } else { + throw new TypeError("Unexpected argument type(s)"); + } + + this.constructor = ctor; + + configureProperties(this); + makeArrayAccessors(this); + }; + + ctor.prototype = new ArrayBufferView(); + ctor.prototype.BYTES_PER_ELEMENT = bytesPerElement; + ctor.prototype._pack = pack; + ctor.prototype._unpack = unpack; + ctor.BYTES_PER_ELEMENT = bytesPerElement; + + // getter type (unsigned long index); + ctor.prototype._getter = function(index) { + if (arguments.length < 1) throw new SyntaxError("Not enough arguments"); + + index = ECMAScript.ToUint32(index); + if (index >= this.length) { + return undefined; + } + + var bytes = [], i, o; + for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; + i < this.BYTES_PER_ELEMENT; + i += 1, o += 1) { + bytes.push(this.buffer._bytes[o]); + } + return this._unpack(bytes); + }; + + // NONSTANDARD: convenience alias for getter: type get(unsigned long index); + ctor.prototype.get = ctor.prototype._getter; + + // setter void (unsigned long index, type value); + ctor.prototype._setter = function(index, value) { + if (arguments.length < 2) throw new SyntaxError("Not enough arguments"); + + index = ECMAScript.ToUint32(index); + if (index >= this.length) { + return undefined; + } + + var bytes = this._pack(value), i, o; + for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; + i < this.BYTES_PER_ELEMENT; + i += 1, o += 1) { + this.buffer._bytes[o] = bytes[i]; + } + }; + + // void set(TypedArray array, optional unsigned long offset); + // void set(sequence array, optional unsigned long offset); + ctor.prototype.set = function(index, value) { + if (arguments.length < 1) throw new SyntaxError("Not enough arguments"); + var array, sequence, offset, len, + i, s, d, + byteOffset, byteLength, tmp; + + if (typeof arguments[0] === 'object' && arguments[0].constructor === this.constructor) { + // void set(TypedArray array, optional unsigned long offset); + array = arguments[0]; + offset = ECMAScript.ToUint32(arguments[1]); + + if (offset + array.length > this.length) { + throw new RangeError("Offset plus length of array is out of range"); + } + + byteOffset = this.byteOffset + offset * this.BYTES_PER_ELEMENT; + byteLength = array.length * this.BYTES_PER_ELEMENT; + + if (array.buffer === this.buffer) { + tmp = []; + for (i = 0, s = array.byteOffset; i < byteLength; i += 1, s += 1) { + tmp[i] = array.buffer._bytes[s]; + } + for (i = 0, d = byteOffset; i < byteLength; i += 1, d += 1) { + this.buffer._bytes[d] = tmp[i]; + } + } else { + for (i = 0, s = array.byteOffset, d = byteOffset; + i < byteLength; i += 1, s += 1, d += 1) { + this.buffer._bytes[d] = array.buffer._bytes[s]; + } + } + } else if (typeof arguments[0] === 'object' && typeof arguments[0].length !== 'undefined') { + // void set(sequence array, optional unsigned long offset); + sequence = arguments[0]; + len = ECMAScript.ToUint32(sequence.length); + offset = ECMAScript.ToUint32(arguments[1]); + + if (offset + len > this.length) { + throw new RangeError("Offset plus length of array is out of range"); + } + + for (i = 0; i < len; i += 1) { + s = sequence[i]; + this._setter(offset + i, Number(s)); + } + } else { + throw new TypeError("Unexpected argument type(s)"); + } + }; + + // TypedArray subarray(long begin, optional long end); + ctor.prototype.subarray = function(start, end) { + function clamp(v, min, max) { return v < min ? min : v > max ? max : v; } + + start = ECMAScript.ToInt32(start); + end = ECMAScript.ToInt32(end); + + if (arguments.length < 1) { start = 0; } + if (arguments.length < 2) { end = this.length; } + + if (start < 0) { start = this.length + start; } + if (end < 0) { end = this.length + end; } + + start = clamp(start, 0, this.length); + end = clamp(end, 0, this.length); + + var len = end - start; + if (len < 0) { + len = 0; + } + + return new this.constructor( + this.buffer, this.byteOffset + start * this.BYTES_PER_ELEMENT, len); + }; + + return ctor; + } + + var Int8Array = makeConstructor(1, packI8, unpackI8); + var Uint8Array = makeConstructor(1, packU8, unpackU8); + var Uint8ClampedArray = makeConstructor(1, packU8Clamped, unpackU8); + var Int16Array = makeConstructor(2, packI16, unpackI16); + var Uint16Array = makeConstructor(2, packU16, unpackU16); + var Int32Array = makeConstructor(4, packI32, unpackI32); + var Uint32Array = makeConstructor(4, packU32, unpackU32); + var Float32Array = makeConstructor(4, packF32, unpackF32); + var Float64Array = makeConstructor(8, packF64, unpackF64); + + exports.Int8Array = exports.Int8Array || Int8Array; + exports.Uint8Array = exports.Uint8Array || Uint8Array; + exports.Uint8ClampedArray = exports.Uint8ClampedArray || Uint8ClampedArray; + exports.Int16Array = exports.Int16Array || Int16Array; + exports.Uint16Array = exports.Uint16Array || Uint16Array; + exports.Int32Array = exports.Int32Array || Int32Array; + exports.Uint32Array = exports.Uint32Array || Uint32Array; + exports.Float32Array = exports.Float32Array || Float32Array; + exports.Float64Array = exports.Float64Array || Float64Array; +}()); + +// +// 6 The DataView View Type +// + +(function() { + function r(array, index) { + return ECMAScript.IsCallable(array.get) ? array.get(index) : array[index]; + } + + var IS_BIG_ENDIAN = (function() { + var u16array = new(exports.Uint16Array)([0x1234]), + u8array = new(exports.Uint8Array)(u16array.buffer); + return r(u8array, 0) === 0x12; + }()); + + // Constructor(ArrayBuffer buffer, + // optional unsigned long byteOffset, + // optional unsigned long byteLength) + /** @constructor */ + var DataView = function DataView(buffer, byteOffset, byteLength) { + if (arguments.length === 0) { + buffer = new exports.ArrayBuffer(0); + } else if (!(buffer instanceof exports.ArrayBuffer || ECMAScript.Class(buffer) === 'ArrayBuffer')) { + throw new TypeError("TypeError"); + } + + this.buffer = buffer || new exports.ArrayBuffer(0); + + this.byteOffset = ECMAScript.ToUint32(byteOffset); + if (this.byteOffset > this.buffer.byteLength) { + throw new RangeError("byteOffset out of range"); + } + + if (arguments.length < 3) { + this.byteLength = this.buffer.byteLength - this.byteOffset; + } else { + this.byteLength = ECMAScript.ToUint32(byteLength); + } + + if ((this.byteOffset + this.byteLength) > this.buffer.byteLength) { + throw new RangeError("byteOffset and length reference an area beyond the end of the buffer"); + } + + configureProperties(this); + }; + + function makeGetter(arrayType) { + return function(byteOffset, littleEndian) { + + byteOffset = ECMAScript.ToUint32(byteOffset); + + if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) { + throw new RangeError("Array index out of range"); + } + byteOffset += this.byteOffset; + + var uint8Array = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT), + bytes = [], i; + for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) { + bytes.push(r(uint8Array, i)); + } + + if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) { + bytes.reverse(); + } + + return r(new arrayType(new exports.Uint8Array(bytes).buffer), 0); + }; + } + + DataView.prototype.getUint8 = makeGetter(exports.Uint8Array); + DataView.prototype.getInt8 = makeGetter(exports.Int8Array); + DataView.prototype.getUint16 = makeGetter(exports.Uint16Array); + DataView.prototype.getInt16 = makeGetter(exports.Int16Array); + DataView.prototype.getUint32 = makeGetter(exports.Uint32Array); + DataView.prototype.getInt32 = makeGetter(exports.Int32Array); + DataView.prototype.getFloat32 = makeGetter(exports.Float32Array); + DataView.prototype.getFloat64 = makeGetter(exports.Float64Array); + + function makeSetter(arrayType) { + return function(byteOffset, value, littleEndian) { + + byteOffset = ECMAScript.ToUint32(byteOffset); + if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) { + throw new RangeError("Array index out of range"); + } + + // Get bytes + var typeArray = new arrayType([value]), + byteArray = new exports.Uint8Array(typeArray.buffer), + bytes = [], i, byteView; + + for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) { + bytes.push(r(byteArray, i)); + } + + // Flip if necessary + if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) { + bytes.reverse(); + } + + // Write them + byteView = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT); + byteView.set(bytes); + }; + } + + DataView.prototype.setUint8 = makeSetter(exports.Uint8Array); + DataView.prototype.setInt8 = makeSetter(exports.Int8Array); + DataView.prototype.setUint16 = makeSetter(exports.Uint16Array); + DataView.prototype.setInt16 = makeSetter(exports.Int16Array); + DataView.prototype.setUint32 = makeSetter(exports.Uint32Array); + DataView.prototype.setInt32 = makeSetter(exports.Int32Array); + DataView.prototype.setFloat32 = makeSetter(exports.Float32Array); + DataView.prototype.setFloat64 = makeSetter(exports.Float64Array); + + exports.DataView = exports.DataView || DataView; + +}()); diff --git a/node_modules/typedarray/package.json b/node_modules/typedarray/package.json new file mode 100644 index 000000000..ee00a9fe5 --- /dev/null +++ b/node_modules/typedarray/package.json @@ -0,0 +1,83 @@ +{ + "_from": "typedarray@^0.0.6", + "_id": "typedarray@0.0.6", + "_inBundle": false, + "_integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "_location": "/typedarray", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "typedarray@^0.0.6", + "name": "typedarray", + "escapedName": "typedarray", + "rawSpec": "^0.0.6", + "saveSpec": null, + "fetchSpec": "^0.0.6" + }, + "_requiredBy": [ + "/concat-stream" + ], + "_resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "_shasum": "867ac74e3864187b1d3d47d996a78ec5c8830777", + "_spec": "typedarray@^0.0.6", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/concat-stream", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/typedarray/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "TypedArray polyfill for old browsers", + "devDependencies": { + "tape": "~2.3.2" + }, + "homepage": "https://github.com/substack/typedarray", + "keywords": [ + "ArrayBuffer", + "DataView", + "Float32Array", + "Float64Array", + "Int8Array", + "Int16Array", + "Int32Array", + "Uint8Array", + "Uint8ClampedArray", + "Uint16Array", + "Uint32Array", + "typed", + "array", + "polyfill" + ], + "license": "MIT", + "main": "index.js", + "name": "typedarray", + "repository": { + "type": "git", + "url": "git://github.com/substack/typedarray.git" + }, + "scripts": { + "test": "tape test/*.js test/server/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "firefox/16..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "0.0.6" +} diff --git a/node_modules/typedarray/readme.markdown b/node_modules/typedarray/readme.markdown new file mode 100644 index 000000000..d18f6f719 --- /dev/null +++ b/node_modules/typedarray/readme.markdown @@ -0,0 +1,61 @@ +# typedarray + +TypedArray polyfill ripped from [this +module](https://raw.github.com/inexorabletash/polyfill). + +[![build status](https://secure.travis-ci.org/substack/typedarray.png)](http://travis-ci.org/substack/typedarray) + +[![testling badge](https://ci.testling.com/substack/typedarray.png)](https://ci.testling.com/substack/typedarray) + +# example + +``` js +var Uint8Array = require('typedarray').Uint8Array; +var ua = new Uint8Array(5); +ua[1] = 256 + 55; +console.log(ua[1]); +``` + +output: + +``` +55 +``` + +# methods + +``` js +var TA = require('typedarray') +``` + +The `TA` object has the following constructors: + +* TA.ArrayBuffer +* TA.DataView +* TA.Float32Array +* TA.Float64Array +* TA.Int8Array +* TA.Int16Array +* TA.Int32Array +* TA.Uint8Array +* TA.Uint8ClampedArray +* TA.Uint16Array +* TA.Uint32Array + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install typedarray +``` + +To use this module in the browser, compile with +[browserify](http://browserify.org) +or download a UMD build from browserify CDN: + +http://wzrd.in/standalone/typedarray@latest + +# license + +MIT diff --git a/node_modules/typedarray/test/server/undef_globals.js b/node_modules/typedarray/test/server/undef_globals.js new file mode 100644 index 000000000..425950f9f --- /dev/null +++ b/node_modules/typedarray/test/server/undef_globals.js @@ -0,0 +1,19 @@ +var test = require('tape'); +var vm = require('vm'); +var fs = require('fs'); +var src = fs.readFileSync(__dirname + '/../../index.js', 'utf8'); + +test('u8a without globals', function (t) { + var c = { + module: { exports: {} }, + }; + c.exports = c.module.exports; + vm.runInNewContext(src, c); + var TA = c.module.exports; + var ua = new(TA.Uint8Array)(5); + + t.equal(ua.length, 5); + ua[1] = 256 + 55; + t.equal(ua[1], 55); + t.end(); +}); diff --git a/node_modules/typedarray/test/tarray.js b/node_modules/typedarray/test/tarray.js new file mode 100644 index 000000000..df596a34f --- /dev/null +++ b/node_modules/typedarray/test/tarray.js @@ -0,0 +1,10 @@ +var TA = require('../'); +var test = require('tape'); + +test('tiny u8a test', function (t) { + var ua = new(TA.Uint8Array)(5); + t.equal(ua.length, 5); + ua[1] = 256 + 55; + t.equal(ua[1], 55); + t.end(); +}); diff --git a/node_modules/ultron/.npmignore b/node_modules/ultron/.npmignore new file mode 100644 index 000000000..66210a2a6 --- /dev/null +++ b/node_modules/ultron/.npmignore @@ -0,0 +1,3 @@ +node_modules +coverage +.tern-port diff --git a/node_modules/ultron/.travis.yml b/node_modules/ultron/.travis.yml new file mode 100644 index 000000000..a505004be --- /dev/null +++ b/node_modules/ultron/.travis.yml @@ -0,0 +1,21 @@ +sudo: false +language: node_js +node_js: + - "0.12" + - "0.10" + - "0.8" + - "iojs" +before_install: + - 'if [ "${TRAVIS_NODE_VERSION}" == "0.8" ]; then npm install -g npm@2.11.1; fi' +script: + - "npm run test-travis" +after_script: + - "npm install coveralls@2.11.x && cat coverage/lcov.info | coveralls" +matrix: + fast_finish: true +notifications: + irc: + channels: + - "irc.freenode.org#unshift" + on_success: change + on_failure: change diff --git a/node_modules/ultron/LICENSE b/node_modules/ultron/LICENSE new file mode 100644 index 000000000..6dc9316a6 --- /dev/null +++ b/node_modules/ultron/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Unshift.io, Arnout Kazemier, the 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. + diff --git a/node_modules/ultron/README.md b/node_modules/ultron/README.md new file mode 100644 index 000000000..84fa3f238 --- /dev/null +++ b/node_modules/ultron/README.md @@ -0,0 +1,97 @@ +# Ultron + +[![Made by unshift](https://img.shields.io/badge/made%20by-unshift-00ffcc.svg?style=flat-square)](http://unshift.io)[![Version npm](http://img.shields.io/npm/v/ultron.svg?style=flat-square)](http://browsenpm.org/package/ultron)[![Build Status](http://img.shields.io/travis/unshiftio/ultron/master.svg?style=flat-square)](https://travis-ci.org/unshiftio/ultron)[![Dependencies](https://img.shields.io/david/unshiftio/ultron.svg?style=flat-square)](https://david-dm.org/unshiftio/ultron)[![Coverage Status](http://img.shields.io/coveralls/unshiftio/ultron/master.svg?style=flat-square)](https://coveralls.io/r/unshiftio/ultron?branch=master)[![IRC channel](http://img.shields.io/badge/IRC-irc.freenode.net%23unshift-00a8ff.svg?style=flat-square)](http://webchat.freenode.net/?channels=unshift) + +Ultron is a high-intelligence robot. It gathers intelligence so it can start +improving upon his rudimentary design. It will learn your event emitting +patterns and find ways to exterminate them. Allowing you to remove only the +event emitters that **you** assigned and not the ones that your users or +developers assigned. This can prevent race conditions, memory leaks and even file +descriptor leaks from ever happening as you won't remove clean up processes. + +## Installation + +The module is designed to be used in browsers using browserify and in Node.js. +You can install the module through the public npm registry by running the +following command in CLI: + +``` +npm install --save ultron +``` + +## Usage + +In all examples we assume that you've required the library as following: + +```js +'use strict'; + +var Ultron = require('ultron'); +``` + +Now that we've required the library we can construct our first `Ultron` instance. +The constructor requires one argument which should be the `EventEmitter` +instance that we need to operate upon. This can be the `EventEmitter` module +that ships with Node.js or `EventEmitter3` or anything else as long as it +follow the same API and internal structure as these 2. So with that in mind we +can create the instance: + +```js +// +// For the sake of this example we're going to construct an empty EventEmitter +// +var EventEmitter = require('events').EventEmitter; // or require('eventmitter3'); +var events = new EventEmitter(); + +var ultron = new Ultron(events); +``` + +You can now use the following API's from the Ultron instance: + +### Ultron.on + +Register a new event listener for the given event. It follows the exact same API +as `EventEmitter.on` but it will return itself instead of returning the +EventEmitter instance. If you are using EventEmitter3 it also supports the +context param: + +```js +ultron.on('event-name', handler, { custom: 'function context' }); +``` + +### Ultron.once + +Exactly the same as the [Ultron.on](#ultronon) but it only allows the execution +once. + +### Ultron.remove + +This is where all the magic happens and the safe removal starts. This function +accepts different argument styles: + +- No arguments, assume that all events need to be removed so it will work as + `removeAllListeners()` API. +- 1 argument, when it's a string it will be split on ` ` and `,` to create a + list of events that need to be cleared. +- Multiple arguments, we assume that they are all names of events that need to + be cleared. + +```js +ultron.remove('foo, bar baz'); // Removes foo, bar and baz. +ultron.remove('foo', 'bar', 'baz'); // Removes foo, bar and baz. +ultron.remove(); // Removes everything. +``` + +If you just want to remove a single event listener using a function reference +you can still use the EventEmitter's `removeListener(event, fn)` API: + +```js +function foo() {} + +ulton.on('foo', foo); +events.removeListener('foo', foo); +``` + +## License + +MIT diff --git a/node_modules/ultron/index.js b/node_modules/ultron/index.js new file mode 100644 index 000000000..af17ab7cc --- /dev/null +++ b/node_modules/ultron/index.js @@ -0,0 +1,129 @@ +'use strict'; + +var has = Object.prototype.hasOwnProperty; + +/** + * An auto incrementing id which we can use to create "unique" Ultron instances + * so we can track the event emitters that are added through the Ultron + * interface. + * + * @type {Number} + * @private + */ +var id = 0; + +/** + * Ultron is high-intelligence robot. It gathers intelligence so it can start improving + * upon his rudimentary design. It will learn from your EventEmitting patterns + * and exterminate them. + * + * @constructor + * @param {EventEmitter} ee EventEmitter instance we need to wrap. + * @api public + */ +function Ultron(ee) { + if (!(this instanceof Ultron)) return new Ultron(ee); + + this.id = id++; + this.ee = ee; +} + +/** + * Register a new EventListener for the given event. + * + * @param {String} event Name of the event. + * @param {Functon} fn Callback function. + * @param {Mixed} context The context of the function. + * @returns {Ultron} + * @api public + */ +Ultron.prototype.on = function on(event, fn, context) { + fn.__ultron = this.id; + this.ee.on(event, fn, context); + + return this; +}; +/** + * Add an EventListener that's only called once. + * + * @param {String} event Name of the event. + * @param {Function} fn Callback function. + * @param {Mixed} context The context of the function. + * @returns {Ultron} + * @api public + */ +Ultron.prototype.once = function once(event, fn, context) { + fn.__ultron = this.id; + this.ee.once(event, fn, context); + + return this; +}; + +/** + * Remove the listeners we assigned for the given event. + * + * @returns {Ultron} + * @api public + */ +Ultron.prototype.remove = function remove() { + var args = arguments + , event; + + // + // When no event names are provided we assume that we need to clear all the + // events that were assigned through us. + // + if (args.length === 1 && 'string' === typeof args[0]) { + args = args[0].split(/[, ]+/); + } else if (!args.length) { + args = []; + + for (event in this.ee._events) { + if (has.call(this.ee._events, event)) args.push(event); + } + } + + for (var i = 0; i < args.length; i++) { + var listeners = this.ee.listeners(args[i]); + + for (var j = 0; j < listeners.length; j++) { + event = listeners[j]; + + // + // Once listeners have a `listener` property that stores the real listener + // in the EventEmitter that ships with Node.js. + // + if (event.listener) { + if (event.listener.__ultron !== this.id) continue; + delete event.listener.__ultron; + } else { + if (event.__ultron !== this.id) continue; + delete event.__ultron; + } + + this.ee.removeListener(args[i], event); + } + } + + return this; +}; + +/** + * Destroy the Ultron instance, remove all listeners and release all references. + * + * @returns {Boolean} + * @api public + */ +Ultron.prototype.destroy = function destroy() { + if (!this.ee) return false; + + this.remove(); + this.ee = null; + + return true; +}; + +// +// Expose the module. +// +module.exports = Ultron; diff --git a/node_modules/ultron/package.json b/node_modules/ultron/package.json new file mode 100644 index 000000000..7a73c2d08 --- /dev/null +++ b/node_modules/ultron/package.json @@ -0,0 +1,68 @@ +{ + "_from": "ultron@1.0.x", + "_id": "ultron@1.0.2", + "_inBundle": false, + "_integrity": "sha1-rOEWq1V80Zc4ak6I9GhTeMiy5Po=", + "_location": "/ultron", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ultron@1.0.x", + "name": "ultron", + "escapedName": "ultron", + "rawSpec": "1.0.x", + "saveSpec": null, + "fetchSpec": "1.0.x" + }, + "_requiredBy": [ + "/ws" + ], + "_resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz", + "_shasum": "ace116ab557cd197386a4e88f4685378c8b2e4fa", + "_spec": "ultron@1.0.x", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/ws", + "author": { + "name": "Arnout Kazemier" + }, + "bugs": { + "url": "https://github.com/unshiftio/ultron/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Ultron is high-intelligence robot. It gathers intel so it can start improving upon his rudimentary design", + "devDependencies": { + "assume": "1.2.x", + "eventemitter3": "1.1.x", + "istanbul": "0.3.x", + "mocha": "2.2.x", + "pre-commit": "1.0.x" + }, + "homepage": "https://github.com/unshiftio/ultron", + "keywords": [ + "Ultron", + "robot", + "gather", + "intelligence", + "event", + "events", + "eventemitter", + "emitter", + "cleanup" + ], + "license": "MIT", + "main": "index.js", + "name": "ultron", + "repository": { + "type": "git", + "url": "git+https://github.com/unshiftio/ultron.git" + }, + "scripts": { + "100%": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100", + "coverage": "istanbul cover ./node_modules/.bin/_mocha -- test.js", + "test": "mocha test.js", + "test-travis": "istanbul cover node_modules/.bin/_mocha --report lcovonly -- test.js", + "watch": "mocha --watch test.js" + }, + "version": "1.0.2" +} diff --git a/node_modules/ultron/test.js b/node_modules/ultron/test.js new file mode 100644 index 000000000..1fd4f1bb5 --- /dev/null +++ b/node_modules/ultron/test.js @@ -0,0 +1,327 @@ +/* istanbul ignore next */ +describe('Ultron', function () { + 'use strict'; + + var EventEmitter = require('eventemitter3') + , EE = require('events').EventEmitter + , assume = require('assume') + , Ultron = require('./') + , ultron + , ee; + + beforeEach(function () { + ee = new EventEmitter(); + ultron = new Ultron(ee); + }); + + afterEach(function () { + ultron.destroy(); + ee.removeAllListeners(); + }); + + it('is exposed as a function', function () { + assume(Ultron).is.a('function'); + }); + + it('can be initialized without the new keyword', function () { + assume(Ultron(ee)).is.instanceOf(Ultron); + }); + + it('assigns a unique id to every instance', function () { + for (var i = 0; i < 100; i++) { + assume(ultron.id).does.not.equal((new Ultron()).id); + } + }); + + it('allows removal through the event emitter', function () { + function foo() {} + function bar() {} + + ultron.on('foo', foo); + ultron.once('foo', bar); + + assume(foo.__ultron).equals(ultron.id); + assume(bar.__ultron).equals(ultron.id); + assume(ee.listeners('foo').length).equals(2); + + ee.removeListener('foo', foo); + assume(ee.listeners('foo').length).equals(1); + + ee.removeListener('foo', bar); + assume(ee.listeners('foo').length).equals(0); + }); + + describe('#on', function () { + it('assigns a listener', function () { + assume(ee.listeners('foo').length).equals(0); + + function foo() {} + + ultron.on('foo', foo); + assume(ee.listeners('foo').length).equals(1); + assume(ee.listeners('foo')[0]).equals(foo); + }); + + it('tags the assigned function', function () { + assume(ee.listeners('foo').length).equals(0); + + ultron.on('foo', function () {}); + assume(ee.listeners('foo')[0].__ultron).equals(ultron.id); + }); + + it('also passes in the context', function (next) { + var context = 1313; + + ultron.on('foo', function (a, b, c) { + assume(a).equals('a'); + assume(b).equals('b'); + assume(c).equals('c'); + + assume(this).equals(context); + + next(); + }, context); + + ee.emit('foo', 'a', 'b', 'c'); + }); + + it('works with regular eventemitters as well', function (next) { + var ee = new EE() + , ultron = new Ultron(ee); + + ultron.on('foo', function (a, b, c) { + assume(a).equals('a'); + assume(b).equals('b'); + assume(c).equals('c'); + + next(); + }); + + ee.emit('foo', 'a', 'b', 'c'); + }); + }); + + describe('#once', function () { + it('assigns a listener', function () { + assume(ee.listeners('foo').length).equals(0); + + function foo() {} + ultron.once('foo', foo); + assume(ee.listeners('foo').length).equals(1); + assume(ee.listeners('foo')[0]).equals(foo); + }); + + it('tags the assigned function', function () { + assume(ee.listeners('foo').length).equals(0); + + ultron.once('foo', function () {}); + assume(ee.listeners('foo')[0].__ultron).equals(ultron.id); + }); + + it('also passes in the context', function (next) { + var context = 1313; + + ultron.once('foo', function (a, b, c) { + assume(a).equals('a'); + assume(b).equals('b'); + assume(c).equals('c'); + + assume(this).equals(context); + + next(); + }, context); + + ee.emit('foo', 'a', 'b', 'c'); + ee.emit('foo', 'a', 'b', 'c'); // Ensure that we don't double execute + }); + + it('works with regular eventemitters as well', function (next) { + var ee = new EE() + , ultron = new Ultron(ee); + + ultron.once('foo', function (a, b, c) { + assume(a).equals('a'); + assume(b).equals('b'); + assume(c).equals('c'); + + next(); + }); + + ee.emit('foo', 'a', 'b', 'c'); + ee.emit('foo', 'a', 'b', 'c'); // Ensure that we don't double execute + }); + }); + + describe('#remove', function () { + it('removes only our assigned `on` listeners', function () { + function foo() {} + function bar() {} + + ee.on('foo', foo); + ultron.on('foo', bar); + assume(ee.listeners('foo').length).equals(2); + + ultron.remove('foo'); + assume(ee.listeners('foo').length).equals(1); + assume(ee.listeners('foo')[0]).equals(foo); + }); + + it('removes our private __ultron references', function () { + function once() {} + function on() {} + + assume('__ultron' in once).is.false(); + assume('__ultron' in on).is.false(); + + ultron.on('foo', on); + ultron.once('bar', once); + + assume('__ultron' in once).is.true(); + assume('__ultron' in on).is.true(); + + ultron.remove('foo, bar'); + + assume('__ultron' in once).is.false(); + assume('__ultron' in on).is.false(); + + ultron.destroy(); + + ee = new EE(); + ultron = new Ultron(ee); + + assume('__ultron' in once).is.false(); + assume('__ultron' in on).is.false(); + + ultron.on('foo', on); + ultron.once('bar', once); + + assume('__ultron' in once).is.true(); + assume('__ultron' in on).is.true(); + + ultron.remove('foo, bar'); + + assume('__ultron' in once).is.false(); + assume('__ultron' in on).is.false(); + }); + + it('removes only our assigned `once` listeners', function () { + function foo() {} + function bar() {} + + ee.once('foo', foo); + ultron.once('foo', bar); + assume(ee.listeners('foo').length).equals(2); + + ultron.remove('foo'); + assume(ee.listeners('foo').length).equals(1); + assume(ee.listeners('foo')[0]).equals(foo); + }); + + it('removes only our assigned `once` listeners from regular EE', function () { + var ee = new EE() + , ultron = new Ultron(ee); + + function foo() {} + function bar() {} + + ee.once('foo', foo); + ultron.once('foo', bar); + assume(ee.listeners('foo').length).equals(2); + + ultron.remove('foo'); + assume(ee.listeners('foo').length).equals(1); + assume(ee.listeners('foo')[0].listener).equals(foo); + }); + + it('removes all assigned events if called without args', function () { + function foo() {} + function bar() {} + + ultron.on('foo', foo); + ultron.on('bar', bar); + + assume(ee.listeners('foo').length).equals(1); + assume(ee.listeners('bar').length).equals(1); + + ultron.remove(); + + assume(ee.listeners('foo').length).equals(0); + assume(ee.listeners('bar').length).equals(0); + }); + + it('removes multiple listeners based on args', function () { + function foo() {} + function bar() {} + function baz() {} + + ultron.on('foo', foo); + ultron.on('bar', bar); + ultron.on('baz', baz); + + assume(ee.listeners('foo').length).equals(1); + assume(ee.listeners('bar').length).equals(1); + assume(ee.listeners('baz').length).equals(1); + + ultron.remove('foo', 'bar'); + + assume(ee.listeners('foo').length).equals(0); + assume(ee.listeners('bar').length).equals(0); + assume(ee.listeners('baz').length).equals(1); + }); + + it('removes multiple listeners if first arg is seperated string', function () { + function foo() {} + function bar() {} + function baz() {} + + ultron.on('foo', foo); + ultron.on('bar', bar); + ultron.on('baz', baz); + + assume(ee.listeners('foo').length).equals(1); + assume(ee.listeners('bar').length).equals(1); + assume(ee.listeners('baz').length).equals(1); + + ultron.remove('foo, bar'); + + assume(ee.listeners('foo').length).equals(0); + assume(ee.listeners('bar').length).equals(0); + assume(ee.listeners('baz').length).equals(1); + }); + }); + + describe('#destroy', function () { + it('removes all listeners', function () { + function foo() {} + function bar() {} + function baz() {} + + ultron.on('foo', foo); + ultron.on('bar', bar); + ultron.on('baz', baz); + + assume(ee.listeners('foo').length).equals(1); + assume(ee.listeners('bar').length).equals(1); + assume(ee.listeners('baz').length).equals(1); + + ultron.destroy(); + + assume(ee.listeners('foo').length).equals(0); + assume(ee.listeners('bar').length).equals(0); + assume(ee.listeners('baz').length).equals(0); + }); + + it('removes the .ee reference', function () { + assume(ultron.ee).equals(ee); + ultron.destroy(); + assume(ultron.ee).equals(null); + }); + + it('returns booleans for state indication', function () { + assume(ultron.destroy()).is.true(); + assume(ultron.destroy()).is.false(); + assume(ultron.destroy()).is.false(); + assume(ultron.destroy()).is.false(); + }); + }); +}); diff --git a/node_modules/umd/HISTORY.md b/node_modules/umd/HISTORY.md new file mode 100644 index 000000000..2d4b449a2 --- /dev/null +++ b/node_modules/umd/HISTORY.md @@ -0,0 +1,64 @@ +3.0.1 / 2015-04-25 +================== + +- Document and test casing/sanitization behavior (thanks @bendrucker) + +3.0.0 / 2015-02-04 +================== + + - remove dependency on ruglify (thanks to @zertosh) + - add `this` as an additional fallback when looking for a global (thanks to @winterbe) + - use `options` rather than `true` / `false` for whether to use CommonJS (with fallback for backwards compatibility). + - support `$` and `_` in module names (thanks to @fitnr) **(BREAKING CHANGE)** + - uglify as a pre-publish step - removing a dependency + - brfs as a pre-publish step - allowing this module to be used from the browser. + - remove support for streaming **(BREAKING CHANGE)** + +2.1.0 / 2014-04-02 +================== + + - Check for definition of `module` as well as `exports` for CommonJS (fixes some custom RequireJS loaders) + - Pass empty array to define for AMD + +2.0.0 / 2013-12-29 +================== + + - Use module name as a namespace for globals if it contains `.` + +1.3.1 / 2013-08-25 +================== + + - Update uglify-js + +1.3.0 / 2013-08-01 +================== + + - Remove SES and Montage bootstrap + - Add MIT LICENSE + - Handle web workers global + - Update uglify-js to fix npm warning + +1.2.1 / 2013-06-07 +================== + + - Fix CLI + +1.2.0 / 2013-06-07 +================== + + - Add CLI + +1.1.1 / 2013-04-15 +================== + + - Update through + +1.1.0 / 2013-03-31 +================== + + - Make Cammel Case less suprising/forcefull + +1.0.0 / 2013-03-16 +================== + + - Initial Release diff --git a/node_modules/umd/LICENSE b/node_modules/umd/LICENSE new file mode 100644 index 000000000..dfb0b19ea --- /dev/null +++ b/node_modules/umd/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2013 Forbes Lindesay + +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. \ No newline at end of file diff --git a/node_modules/umd/README.md b/node_modules/umd/README.md new file mode 100644 index 000000000..1fb98c58d --- /dev/null +++ b/node_modules/umd/README.md @@ -0,0 +1,82 @@ +# umd + + +Universal Module Definition for use in automated build systems + + - simple synchronous wrapping of a string + - `return` style module support + - CommonJS support + - prevents internal UMDs from conflicting + +[![Build Status](https://img.shields.io/travis/ForbesLindesay/umd/master.svg)](https://travis-ci.org/ForbesLindesay/umd) +[![Dependency Status](https://img.shields.io/david/ForbesLindesay/umd.svg)](https://david-dm.org/ForbesLindesay/umd) +[![NPM version](https://img.shields.io/npm/v/umd.svg)](https://www.npmjs.com/package/umd) + +## Source Format + +In order for the UMD wrapper to work the source code for your module should `return` the export, e.g. + +```javascript +function method() { + //code +} +method.helper = function () { + //code +} +return method; +``` + +For examples, see the examples directory. The CommonJS module format is also supported by passing true as the second argument to methods. + +## API + +options: + + - `commonJS` (default: `false`) - If commonJS is `true` then it will accept CommonJS source instead of source code which `return`s the module. + +### umd(name, source, [options]) + + The `name` should the the name of the module. Use a string like name, all lower case with hyphens instead of spaces. + + If `source` should be a string, that is wrapped in umd and returned as a string. + +### umd.prelude(module, [options]) + + return the text which will be inserted before a module. + +### umd.postlude(module, [options]) + + return the text which will be inserted after a module. + +## Command Line + +``` +Usage: umd [options] + +Pipe Usage: umd [options] < source > destination + +Options: + + -h --help Display usage information + -c --commonJS Use CommonJS module format + ``` + + You can easilly pipe unix commands together like: + + ```js + cat my-module.js | umd my-module | uglify-js > my-module.umd.min.js + ``` + +## Name Casing and Characters + +The `name` passed to `umd` will be converted to camel case (`my-library` becomes `myLibrary`) and may only contain: + +* alphanumeric characters +* $ +* _ + +The name may not begin with a number. Invalid characters will be stripped. + +## License + + MIT diff --git a/node_modules/umd/bin/cli.js b/node_modules/umd/bin/cli.js new file mode 100755 index 000000000..3a2287a6d --- /dev/null +++ b/node_modules/umd/bin/cli.js @@ -0,0 +1,43 @@ +#!/usr/bin/env node + +var read = require('fs').createReadStream +var write = require('fs').createWriteStream + +var umd = require('../') + +var args = process.argv.slice(2) + +var help = false +var commonJS = false +args = args.filter(function (arg) { + if (arg === '-h' || arg === '--help') { + help = true + return false + } else if (arg === '-c' || arg === '--commonJS') { + commonJS = true + return false + } + return true +}) + +if (help || !args[0]) { + console.log('Usage: umd [options]') + console.log('') + console.log('Pipe Usage: umd [options] < source > destination') + console.log('') + console.log('Options:') + console.log('') + console.log(' -h --help Display usage information') + console.log(' -c --commonJS Use CommonJS module format') + console.log('') + if (!help) process.exit(1) +} else { + var source = args[1] ? read(args[1]) : process.stdin + var dest = args[2] ? write(args[2]) : process.stdout + var prelude = umd.prelude(args[0], {commonJS: commonJS}) + var postlude = umd.postlude(args[0], {commonJS: commonJS}) + dest.write(prelude) + source.on('end', function () { + dest.write(postlude + '\n') + }).pipe(dest, {end: false}) +} diff --git a/node_modules/umd/index.js b/node_modules/umd/index.js new file mode 100644 index 000000000..bc32794f2 --- /dev/null +++ b/node_modules/umd/index.js @@ -0,0 +1,78 @@ +'use strict'; + + +var templateSTR = "(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}defineNamespace()}})(function(){source()});\n"; + +function template(moduleName, options) { + if (typeof options === 'boolean') { + options = {commonJS: options}; + } else if (!options) { + options = {}; + } + var str = templateSTR.replace(/defineNamespace\(\)/g, compileNamespace(moduleName)) + .split('source()') + str[0] = str[0].trim(); + //make sure these are undefined so as to not get confused if modules have inner UMD systems + str[0] += 'var define,module,exports;'; + if (options.commonJS) str[0] += 'module={exports:(exports={})};'; + str[0] += '\n'; + if (options.commonJS) str[1] = 'return module.exports;' + str[1]; + str[1] = '\n' + str[1]; + return str; +} + +exports = module.exports = function (name, src, options) { + if (typeof options === 'string' && typeof src === 'object') { + var tmp = options; + options = src; + src = tmp; + } + return exports.prelude(name, options) + src + exports.postlude(name, options); +}; + +exports.prelude = function (moduleName, options) { + return template(moduleName, options)[0]; +}; +exports.postlude = function (moduleName, options) { + return template(moduleName, options)[1]; +}; + + +function camelCase(name) { + name = name.replace(/\-([a-z])/g, function (_, char) { return char.toUpperCase(); }); + if (!/^[a-zA-Z_$]$/.test(name[0])) { + name = name.substr(1); + } + var result = name.replace(/[^\w$]+/g, '') + if (!result) { + throw new Error('Invalid JavaScript identifier resulted from camel-casing'); + } + return result +} + + +function compileNamespace(name) { + var names = name.split('.') + + // No namespaces, yield the best case 'global.NAME = VALUE' + if (names.length === 1) { + return 'g.' + camelCase(name) + ' = f()'; + + // Acceptable case, with reasonable compilation + } else if (names.length === 2) { + names = names.map(camelCase); + return '(g.' + names[0] + ' || (g.' + names[0] + ' = {})).' + names[1] + ' = f()'; + + // Worst case, too many namespaces to care about + } else { + var valueContainer = names.pop() + return names.map(compileNamespaceStep) + .concat(['g.' + camelCase(valueContainer) + ' = f()']) + .join(';'); + } +} + +function compileNamespaceStep(name) { + name = camelCase(name); + return 'g=(g.' + name + '||(g.' + name + ' = {}))'; +} diff --git a/node_modules/umd/package.json b/node_modules/umd/package.json new file mode 100644 index 000000000..0f21d798a --- /dev/null +++ b/node_modules/umd/package.json @@ -0,0 +1,61 @@ +{ + "_from": "umd@^3.0.0", + "_id": "umd@3.0.3", + "_inBundle": false, + "_integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==", + "_location": "/umd", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "umd@^3.0.0", + "name": "umd", + "escapedName": "umd", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/browser-pack" + ], + "_resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz", + "_shasum": "aa9fe653c42b9097678489c01000acb69f0b26cf", + "_spec": "umd@^3.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browser-pack", + "author": { + "name": "ForbesLindesay" + }, + "bin": { + "umd": "./bin/cli.js" + }, + "bugs": { + "url": "https://github.com/ForbesLindesay/umd/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Universal Module Definition for use in automated build systems", + "devDependencies": { + "brfs": "^1.3.0", + "linify": "^1.0.1", + "mocha": "*", + "uglify-js": "^3.3.15" + }, + "files": [ + "index.js", + "bin/cli.js" + ], + "homepage": "https://github.com/ForbesLindesay/umd#readme", + "license": "MIT", + "name": "umd", + "repository": { + "type": "git", + "url": "git+https://github.com/ForbesLindesay/umd.git" + }, + "scripts": { + "build": "uglifyjs template.js > template.min.js && brfs source.js > index.js", + "prepublish": "npm run build && linify transform bin", + "test": "npm run build && mocha -R spec" + }, + "version": "3.0.3" +} diff --git a/node_modules/undeclared-identifiers/.travis.yml b/node_modules/undeclared-identifiers/.travis.yml new file mode 100644 index 000000000..9b333bf88 --- /dev/null +++ b/node_modules/undeclared-identifiers/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +node_js: + - stable + - 8 + - 6 + - 4 +cache: + directories: + - ~/.npm diff --git a/node_modules/undeclared-identifiers/CHANGELOG.md b/node_modules/undeclared-identifiers/CHANGELOG.md new file mode 100644 index 000000000..ed3e30029 --- /dev/null +++ b/node_modules/undeclared-identifiers/CHANGELOG.md @@ -0,0 +1,19 @@ +# undeclared-identifiers change log + +All notable changes to this project will be documented in this file. + +This project adheres to [Semantic Versioning](http://semver.org/). + +## 1.1.2 +* Fix wildcard use not being detected after property use. ([349d998](https://github.com/goto-bus-stop/undeclared-identifiers/commit/349d998559f83976ccd3b3d091e2b06f00ce4189)) + +## 1.1.1 +* Fix standard property access being detected as wildcards. ([029a0b7](https://github.com/goto-bus-stop/undeclared-identifiers/commit/029a0b773a7a4d2402a6de19c8c8693407f8da63)) + +## 1.1.0 +* Accept an AST. ([1605b88](https://github.com/goto-bus-stop/undeclared-identifiers/commit/1605b881cd567894fab1ee2727961dd715a38820)) +* Add `opts.wildcard`. ([cdabd70](https://github.com/goto-bus-stop/undeclared-identifiers/commit/cdabd70e000b2fa976c7f4118757736e023b93f2)) + +## 1.0.0 + +* initial release. diff --git a/node_modules/undeclared-identifiers/LICENSE.md b/node_modules/undeclared-identifiers/LICENSE.md new file mode 100644 index 000000000..22b9972a8 --- /dev/null +++ b/node_modules/undeclared-identifiers/LICENSE.md @@ -0,0 +1,15 @@ +# [Apache License 2.0](https://spdx.org/licenses/Apache-2.0) + +Copyright 2018 Renée Kooi + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +> http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/node_modules/undeclared-identifiers/README.md b/node_modules/undeclared-identifiers/README.md new file mode 100644 index 000000000..8afc3d997 --- /dev/null +++ b/node_modules/undeclared-identifiers/README.md @@ -0,0 +1,55 @@ +# undeclared-identifiers + +find undeclared identifiers and property accesses in a javascript file. + +[![npm][npm-image]][npm-url] +[![travis][travis-image]][travis-url] +[![standard][standard-image]][standard-url] + +[npm-image]: https://img.shields.io/npm/v/undeclared-identifiers.svg?style=flat-square +[npm-url]: https://www.npmjs.com/package/undeclared-identifiers +[travis-image]: https://img.shields.io/travis/goto-bus-stop/undeclared-identifiers.svg?style=flat-square +[travis-url]: https://travis-ci.org/goto-bus-stop/undeclared-identifiers +[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square +[standard-url]: http://npm.im/standard + +## Install + +``` +npm install undeclared-identifiers +``` + +## Usage + +```js +var undeclaredIdentifiers = require('undeclared-identifiers') + +undeclaredIdentifiers(src) +// { identifiers: ['Buffer'], +// properties: ['Buffer.isBuffer'] } +``` + +## API + +### `res = undeclaredIdentifiers(source, opts)` + +Find undeclared identifiers and properties that are used in the `source`. `source` can be an AST or a source string that will be parsed using [acorn-node](https://github.com/browserify/acorn-node). + +`res` is an object with properties: + + - `res.identifiers` - an array of variable names as strings. + - `res.properties` - an array of property names as .-separated strings, such as `'xyz.abc'`. These are the property accesses on the undeclared variables found in `res.identifiers`. + +Set `opts.properties` to false to only return identifiers. + +When `opts.wildcard` is true, unknown uses of undeclared identifiers will be added to `res.properties` as `'VarName.*'`. + +```js +undeclaredIdentifiers('Buffer(), Buffer.from()', { wildcard: true }) +// { identifiers: ['Buffer'], +// properties: ['Buffer.*', 'Buffer.from'] } +``` + +## License + +[Apache-2.0](LICENSE.md) diff --git a/node_modules/undeclared-identifiers/bench/index.js b/node_modules/undeclared-identifiers/bench/index.js new file mode 100644 index 000000000..e20d65107 --- /dev/null +++ b/node_modules/undeclared-identifiers/bench/index.js @@ -0,0 +1,44 @@ +/* eslint-disable no-unused-expressions */ +var bench = require('nanobench') +var acornsrc = require('fs').readFileSync(require.resolve('acorn')) +var lodashsrc = require('fs').readFileSync(require.resolve('lodash')) +var jquerysrc = require('fs').readFileSync(require.resolve('jquery')) +var find = require('../') + +// Optimize. +for (var i = 0; i < 5; i++) find(acornsrc).properties + +// Has very few undeclared identifiers +bench('acorn × 1', function (b) { + b.start() + find(acornsrc).properties + b.end() +}) +bench('acorn × 5', function (b) { + b.start() + for (var i = 0; i < 5; i++) find(acornsrc).properties + b.end() +}) + +bench('lodash × 1', function (b) { + b.start() + find(lodashsrc).properties + b.end() +}) +bench('lodash × 5', function (b) { + b.start() + for (var i = 0; i < 5; i++) find(lodashsrc).properties + b.end() +}) + +// Has more undeclared identifiers and properties +bench('jquery × 1', function (b) { + b.start() + find(jquerysrc).properties + b.end() +}) +bench('jquery × 5', function (b) { + b.start() + for (var i = 0; i < 5; i++) find(jquerysrc).properties + b.end() +}) diff --git a/node_modules/undeclared-identifiers/bin.js b/node_modules/undeclared-identifiers/bin.js new file mode 100755 index 000000000..936e11edb --- /dev/null +++ b/node_modules/undeclared-identifiers/bin.js @@ -0,0 +1,29 @@ +#!/usr/bin/env node + +var concat = require('simple-concat') +var undeclared = require('./') + +if (arg('--help') || arg('-h')) { + console.log('usage: undeclared-identifiers [--identifiers] [--properties] < source.js') + process.exit(0) +} + +concat(process.stdin, function (err, src) { + if (err) throw err + + var r = undeclared(src) + var i = arg('--identifiers') || arg('-i') + var p = arg('--properties') || arg('-p') + + if (!i && !p) i = p = true + + if (i) r.identifiers.forEach(log) + if (p) r.properties.forEach(log) +}) + +function arg (s) { + return process.argv.indexOf(s) !== -1 +} +function log (n) { + console.log(n) +} diff --git a/node_modules/undeclared-identifiers/index.js b/node_modules/undeclared-identifiers/index.js new file mode 100644 index 000000000..c331176c5 --- /dev/null +++ b/node_modules/undeclared-identifiers/index.js @@ -0,0 +1,127 @@ +var xtend = require('xtend') +var acorn = require('acorn-node') +var walk = require('acorn-node/walk') +var getAssignedIdentifiers = require('get-assigned-identifiers') + +function visitFunction (node, state, ancestors) { + if (node.params.length > 0) { + var idents = [] + for (var i = 0; i < node.params.length; i++) { + var sub = getAssignedIdentifiers(node.params[i]) + for (var j = 0; j < sub.length; j++) idents.push(sub[j]) + } + declareNames(node, idents) + } + if (node.type === 'FunctionDeclaration') { + var parent = getScopeNode(ancestors, 'const') + declareNames(parent, [node.id]) + } else if (node.type === 'FunctionExpression' && node.id) { + declareNames(node, [node.id]) + } +} + +var scopeVisitor = { + VariableDeclaration: function (node, state, ancestors) { + var parent = getScopeNode(ancestors, node.kind) + for (var i = 0; i < node.declarations.length; i++) { + declareNames(parent, getAssignedIdentifiers(node.declarations[i].id)) + } + }, + FunctionExpression: visitFunction, + FunctionDeclaration: visitFunction, + ArrowFunctionExpression: visitFunction, + ImportDeclaration: function (node, state, ancestors) { + declareNames(ancestors[0] /* root */, getAssignedIdentifiers(node)) + }, + CatchClause: function (node) { + if (node.param) declareNames(node, [node.param]) + } +} + +var bindingVisitor = { + Identifier: function (node, state, ancestors) { + if (!state.identifiers) return + var parent = ancestors[ancestors.length - 2] + if (parent.type === 'MemberExpression' && parent.property === node) return + if (!has(state.undeclared, node.name)) { + for (var i = ancestors.length - 1; i >= 0; i--) { + if (ancestors[i]._names !== undefined && ancestors[i]._names.indexOf(node.name) !== -1) { + return + } + } + + state.undeclared[node.name] = true + } + + if (state.wildcard && + !(parent.type === 'MemberExpression' && parent.object === node) && + !(parent.type === 'VariableDeclarator' && parent.id === node) && + !(parent.type === 'AssignmentExpression' && parent.left === node)) { + state.undeclaredProps[node.name + '.*'] = true + } + }, + MemberExpression: function (node, state, ancestors) { + if (!state.properties) return + if (node.object.type === 'Identifier' && has(state.undeclared, node.object.name)) { + var prop = !node.computed && node.property.type === 'Identifier' + ? node.property.name + : node.computed && node.property.type === 'Literal' + ? node.property.value + : null + if (prop) state.undeclaredProps[node.object.name + '.' + prop] = true + } + } +} + +module.exports = function findUndeclared (src, opts) { + opts = xtend({ + identifiers: true, + properties: true, + wildcard: false + }, opts) + + var state = { + undeclared: {}, + undeclaredProps: {}, + identifiers: opts.identifiers, + properties: opts.properties, + wildcard: opts.wildcard + } + + // Parse if `src` is not already an AST. + var ast = typeof src === 'object' && src !== null && typeof src.type === 'string' + ? src + : acorn.parse(src) + + walk.ancestor(ast, scopeVisitor) + walk.ancestor(ast, bindingVisitor, walk.base, state) + + return { + identifiers: Object.keys(state.undeclared), + properties: Object.keys(state.undeclaredProps) + } +} + +function getScopeNode (parents, kind) { + for (var i = parents.length - 2; i >= 0; i--) { + if (parents[i].type === 'FunctionDeclaration' || parents[i].type === 'FunctionExpression' || + parents[i].type === 'ArrowFunctionExpression' || parents[i].type === 'Program') { + return parents[i] + } + if (kind !== 'var' && parents[i].type === 'BlockStatement') { + return parents[i] + } + } +} + +function declareNames (node, names) { + if (node._names === undefined) { + node._names = names.map(function (id) { return id.name }) + return + } + for (var i = 0; i < names.length; i++) { + node._names.push(names[i].name) + } +} + +function has (obj, name) { return Object.prototype.hasOwnProperty.call(obj, name) } diff --git a/node_modules/undeclared-identifiers/package.json b/node_modules/undeclared-identifiers/package.json new file mode 100644 index 000000000..82412e633 --- /dev/null +++ b/node_modules/undeclared-identifiers/package.json @@ -0,0 +1,72 @@ +{ + "_from": "undeclared-identifiers@^1.1.2", + "_id": "undeclared-identifiers@1.1.2", + "_inBundle": false, + "_integrity": "sha512-13EaeocO4edF/3JKime9rD7oB6QI8llAGhgn5fKOPyfkJbRb6NFv9pYV6dFEmpa4uRjKeBqLZP8GpuzqHlKDMQ==", + "_location": "/undeclared-identifiers", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "undeclared-identifiers@^1.1.2", + "name": "undeclared-identifiers", + "escapedName": "undeclared-identifiers", + "rawSpec": "^1.1.2", + "saveSpec": null, + "fetchSpec": "^1.1.2" + }, + "_requiredBy": [ + "/insert-module-globals" + ], + "_resolved": "https://registry.npmjs.org/undeclared-identifiers/-/undeclared-identifiers-1.1.2.tgz", + "_shasum": "7d850a98887cff4bd0bf64999c014d08ed6d1acc", + "_spec": "undeclared-identifiers@^1.1.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/insert-module-globals", + "author": { + "name": "Renée Kooi", + "email": "renee@kooi.me" + }, + "bin": { + "undeclared-identifiers": "bin.js" + }, + "bugs": { + "url": "https://github.com/goto-bus-stop/undeclared-identifiers/issues" + }, + "bundleDependencies": false, + "dependencies": { + "acorn-node": "^1.3.0", + "get-assigned-identifiers": "^1.2.0", + "simple-concat": "^1.0.0", + "xtend": "^4.0.1" + }, + "deprecated": false, + "description": "find undeclared identifiers and property accesses in a javascript file.", + "devDependencies": { + "jquery": "^3.3.1", + "lodash": "^4.17.5", + "nanobench": "^2.1.0", + "standard": "^11.0.0", + "tap-spec": "^4.0.2", + "tape": "^4.0.0" + }, + "homepage": "https://github.com/goto-bus-stop/undeclared-identifiers", + "keywords": [ + "ast", + "check", + "detect", + "identifiers", + "javascript", + "undeclared" + ], + "license": "Apache-2.0", + "main": "index.js", + "name": "undeclared-identifiers", + "repository": { + "type": "git", + "url": "git+https://github.com/goto-bus-stop/undeclared-identifiers.git" + }, + "scripts": { + "test": "standard && tape test/*.js | tap-spec" + }, + "version": "1.1.2" +} diff --git a/node_modules/undeclared-identifiers/test/index.js b/node_modules/undeclared-identifiers/test/index.js new file mode 100644 index 000000000..5ac045806 --- /dev/null +++ b/node_modules/undeclared-identifiers/test/index.js @@ -0,0 +1,198 @@ +var test = require('tape') +var acorn = require('acorn-node') +var find = require('../') + +test('undeclared variables', function (t) { + t.deepEqual(find(` + var a, b + a, b, c + `), { + identifiers: ['c'], + properties: [] + }) + t.end() +}) + +test('pass in a parsed ast', function (t) { + t.deepEqual(find(acorn.parse(` + var a, b + a, b, c + `)), { + identifiers: ['c'], + properties: [] + }) + t.end() +}) + +test('undeclared properties', function (t) { + t.deepEqual(find(` + var a, b + a, b, c, d.e + `), { + identifiers: ['c', 'd'], + properties: ['d.e'] + }) + t.end() +}) + +test('wildcard use of undeclared name', function (t) { + t.deepEqual(find(` + function func () {} + new A() + A.from() + func(b) + C.from() + `, { wildcard: true }), { + identifiers: ['A', 'b', 'C'], + properties: ['A.*', 'A.from', 'b.*', 'C.from'] + }) + t.end() +}) + +test('wildcard use of undeclared name (different order)', function (t) { + t.deepEqual(find(` + A.from() + new A() + `, { wildcard: true }), { + identifiers: ['A'], + properties: ['A.from', 'A.*'] + }) + t.end() +}) + +test('function names', function (t) { + t.deepEqual(find(` + function x () { + return x + } + x() + `), { + identifiers: [], + properties: [] + }) + t.deepEqual(find(` + function x () { + return x + } + y() + `), { + identifiers: ['y'], + properties: [] + }) + t.end() +}) + +test('scope', function (t) { + t.deepEqual(find(` + function y () { + function x () { + return x + } + } + x(y(x.y)) + `), { + identifiers: ['x'], + properties: ['x.y'] + }) + t.end() +}) + +test('block scope', function (t) { + t.deepEqual(find(` + var x + { var y; let z } + x, y, z + `), { + identifiers: ['z'], + properties: [] + }) + t.end() +}) + +test('function parameters', function (t) { + t.deepEqual(find(` + function a (a1, a2) { a, a1, a2, a3 } + ;(function b (b1, b2) { b, b1, b2, b3 }) + ;((c1, c2) => { c1, c2, c3 }) + `), { + identifiers: ['a3', 'b3', 'c3'], + properties: [] + }) + t.deepEqual(find(` + function a (a1, a2) { } + a, a1, a2 + `), { + identifiers: ['a1', 'a2'], + properties: [] + }) + t.end() +}) + +test('assignment', function (t) { + t.deepEqual(find(` + var a + b = 2 + b.c = 3 + `), { + identifiers: ['b'], + properties: ['b.c'] + }) + t.end() +}) + +test('catch', function (t) { + t.deepEqual(find(` + try { var a } catch (err) { err } + try { let b } catch (orr) { orr } + a, b + `), { + identifiers: ['b'], + properties: [] + }) + t.end() +}) + +test('object prototype names', function (t) { + t.deepEqual(find(` + var propertyIsEnumerable, hasOwnProperty + isPrototypeOf + `), { + identifiers: ['isPrototypeOf'], + properties: [] + }) + t.end() +}) + +test('labels', function (t) { + t.deepEqual(find(` + a: a; + b: a; + c: a; + `), { + identifiers: ['a'], + properties: [] + }) + t.end() +}) + +test('property keys', function (t) { + t.deepEqual(find(` + ({ a: a, + b: a, [d]: a, + c: a, }) + `), { + identifiers: ['a', 'd'], + properties: [] + }) + t.end() +}) + +test('string property access', function (t) { + t.deepEqual(find(` + Buffer["isBuffer"] + `), { + identifiers: ['Buffer'], + properties: ['Buffer.isBuffer'] + }) + t.end() +}) diff --git a/node_modules/union-value/LICENSE b/node_modules/union-value/LICENSE new file mode 100644 index 000000000..83b56e709 --- /dev/null +++ b/node_modules/union-value/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/union-value/README.md b/node_modules/union-value/README.md new file mode 100644 index 000000000..1a90ffbd5 --- /dev/null +++ b/node_modules/union-value/README.md @@ -0,0 +1,73 @@ +# union-value [![NPM version](https://img.shields.io/npm/v/union-value.svg?style=flat)](https://www.npmjs.com/package/union-value) [![NPM monthly downloads](https://img.shields.io/npm/dm/union-value.svg?style=flat)](https://npmjs.org/package/union-value) [![NPM total downloads](https://img.shields.io/npm/dt/union-value.svg?style=flat)](https://npmjs.org/package/union-value) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/union-value.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/union-value) + +> Set an array of unique values as the property of an object. Supports setting deeply nested properties using using object-paths/dot notation. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save union-value +``` + +## Usage + +```js +var union = require('union-value'); + +var obj = {}; + +union(obj, 'a.b.c', ['one', 'two']); +union(obj, 'a.b.c', ['three']); + +console.log(obj); +//=> {a: {b: {c: [ 'one', 'two', 'three' ] }}} +``` + +## About + +### Related projects + +* [assign-value](https://www.npmjs.com/package/assign-value): Assign a value or extend a deeply nested property of an object using object path… [more](https://github.com/jonschlinkert/assign-value) | [homepage](https://github.com/jonschlinkert/assign-value "Assign a value or extend a deeply nested property of an object using object path notation.") +* [get-value](https://www.npmjs.com/package/get-value): Use property paths (`a.b.c`) to get a nested value from an object. | [homepage](https://github.com/jonschlinkert/get-value "Use property paths (`a.b.c`) to get a nested value from an object.") +* [has-value](https://www.npmjs.com/package/has-value): Returns true if a value exists, false if empty. Works with deeply nested values using… [more](https://github.com/jonschlinkert/has-value) | [homepage](https://github.com/jonschlinkert/has-value "Returns true if a value exists, false if empty. Works with deeply nested values using object paths.") +* [set-value](https://www.npmjs.com/package/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/jonschlinkert/set-value "Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths.") +* [unset-value](https://www.npmjs.com/package/unset-value): Delete nested properties from an object using dot notation. | [homepage](https://github.com/jonschlinkert/unset-value "Delete nested properties from an object using dot notation.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 25, 2017._ \ No newline at end of file diff --git a/node_modules/union-value/index.js b/node_modules/union-value/index.js new file mode 100644 index 000000000..9c5d8db2c --- /dev/null +++ b/node_modules/union-value/index.js @@ -0,0 +1,30 @@ +'use strict'; + +var isObject = require('is-extendable'); +var union = require('arr-union'); +var get = require('get-value'); +var set = require('set-value'); + +module.exports = function unionValue(obj, prop, value) { + if (!isObject(obj)) { + throw new TypeError('union-value expects the first argument to be an object.'); + } + + if (typeof prop !== 'string') { + throw new TypeError('union-value expects `prop` to be a string.'); + } + + var arr = arrayify(get(obj, prop)); + set(obj, prop, union(arr, arrayify(value))); + return obj; +}; + +function arrayify(val) { + if (val === null || typeof val === 'undefined') { + return []; + } + if (Array.isArray(val)) { + return val; + } + return [val]; +} diff --git a/node_modules/union-value/node_modules/extend-shallow/LICENSE b/node_modules/union-value/node_modules/extend-shallow/LICENSE new file mode 100644 index 000000000..fa30c4cb3 --- /dev/null +++ b/node_modules/union-value/node_modules/extend-shallow/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/union-value/node_modules/extend-shallow/README.md b/node_modules/union-value/node_modules/extend-shallow/README.md new file mode 100644 index 000000000..cdc45d4ff --- /dev/null +++ b/node_modules/union-value/node_modules/extend-shallow/README.md @@ -0,0 +1,61 @@ +# extend-shallow [![NPM version](https://badge.fury.io/js/extend-shallow.svg)](http://badge.fury.io/js/extend-shallow) [![Build Status](https://travis-ci.org/jonschlinkert/extend-shallow.svg)](https://travis-ci.org/jonschlinkert/extend-shallow) + +> Extend an object with the properties of additional objects. node.js/javascript util. + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i extend-shallow --save +``` + +## Usage + +```js +var extend = require('extend-shallow'); + +extend({a: 'b'}, {c: 'd'}) +//=> {a: 'b', c: 'd'} +``` + +Pass an empty object to shallow clone: + +```js +var obj = {}; +extend(obj, {a: 'b'}, {c: 'd'}) +//=> {a: 'b', c: 'd'} +``` + +## Related + +* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. +* [for-own](https://github.com/jonschlinkert/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) +* [for-in](https://github.com/jonschlinkert/for-in): Iterate over the own and inherited enumerable properties of an objecte, and return an object… [more](https://github.com/jonschlinkert/for-in) +* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor. +* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null. +* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value. + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 29, 2015._ \ No newline at end of file diff --git a/node_modules/union-value/node_modules/extend-shallow/index.js b/node_modules/union-value/node_modules/extend-shallow/index.js new file mode 100644 index 000000000..92a067fcc --- /dev/null +++ b/node_modules/union-value/node_modules/extend-shallow/index.js @@ -0,0 +1,33 @@ +'use strict'; + +var isObject = require('is-extendable'); + +module.exports = function extend(o/*, objects*/) { + if (!isObject(o)) { o = {}; } + + var len = arguments.length; + for (var i = 1; i < len; i++) { + var obj = arguments[i]; + + if (isObject(obj)) { + assign(o, obj); + } + } + return o; +}; + +function assign(a, b) { + for (var key in b) { + if (hasOwn(b, key)) { + a[key] = b[key]; + } + } +} + +/** + * Returns true if the given `key` is an own property of `obj`. + */ + +function hasOwn(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} diff --git a/node_modules/union-value/node_modules/extend-shallow/package.json b/node_modules/union-value/node_modules/extend-shallow/package.json new file mode 100644 index 000000000..3e26e21fa --- /dev/null +++ b/node_modules/union-value/node_modules/extend-shallow/package.json @@ -0,0 +1,87 @@ +{ + "_from": "extend-shallow@^2.0.1", + "_id": "extend-shallow@2.0.1", + "_inBundle": false, + "_integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "_location": "/union-value/extend-shallow", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "extend-shallow@^2.0.1", + "name": "extend-shallow", + "escapedName": "extend-shallow", + "rawSpec": "^2.0.1", + "saveSpec": null, + "fetchSpec": "^2.0.1" + }, + "_requiredBy": [ + "/union-value/set-value" + ], + "_resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "_shasum": "51af7d614ad9a9f610ea1bafbb989d6b1c56890f", + "_spec": "extend-shallow@^2.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/union-value/node_modules/set-value", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/extend-shallow/issues" + }, + "bundleDependencies": false, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "deprecated": false, + "description": "Extend an object with the properties of additional objects. node.js/javascript util.", + "devDependencies": { + "array-slice": "^0.2.3", + "benchmarked": "^0.1.4", + "chalk": "^1.0.0", + "for-own": "^0.1.3", + "glob": "^5.0.12", + "is-plain-object": "^2.0.1", + "kind-of": "^2.0.0", + "minimist": "^1.1.1", + "mocha": "^2.2.5", + "should": "^7.0.1" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/extend-shallow", + "keywords": [ + "assign", + "extend", + "javascript", + "js", + "keys", + "merge", + "obj", + "object", + "prop", + "properties", + "property", + "props", + "shallow", + "util", + "utility", + "utils", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "extend-shallow", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/extend-shallow.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "2.0.1" +} diff --git a/node_modules/union-value/node_modules/set-value/LICENSE b/node_modules/union-value/node_modules/set-value/LICENSE new file mode 100644 index 000000000..d734237bd --- /dev/null +++ b/node_modules/union-value/node_modules/set-value/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/union-value/node_modules/set-value/README.md b/node_modules/union-value/node_modules/set-value/README.md new file mode 100644 index 000000000..19fbdbb4d --- /dev/null +++ b/node_modules/union-value/node_modules/set-value/README.md @@ -0,0 +1,81 @@ +# set-value [![NPM version](https://img.shields.io/npm/v/set-value.svg?style=flat)](https://www.npmjs.com/package/set-value) [![NPM monthly downloads](https://img.shields.io/npm/dm/set-value.svg?style=flat)](https://npmjs.org/package/set-value) [![NPM total downloads](https://img.shields.io/npm/dt/set-value.svg?style=flat)](https://npmjs.org/package/set-value) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/set-value.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/set-value) + +> Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save set-value +``` + +## Usage + +```js +var set = require('set-value'); + +var obj = {}; +set(obj, 'a.b.c', 'd'); +console.log(obj); +//=> {a: {b: c: 'd'}} +``` + +## About + +### Related projects + +* [assign-value](https://www.npmjs.com/package/assign-value): Assign a value or extend a deeply nested property of an object using object path… [more](https://github.com/jonschlinkert/assign-value) | [homepage](https://github.com/jonschlinkert/assign-value "Assign a value or extend a deeply nested property of an object using object path notation.") +* [get-value](https://www.npmjs.com/package/get-value): Use property paths (`a.b.c`) to get a nested value from an object. | [homepage](https://github.com/jonschlinkert/get-value "Use property paths (`a.b.c`) to get a nested value from an object.") +* [has-value](https://www.npmjs.com/package/has-value): Returns true if a value exists, false if empty. Works with deeply nested values using… [more](https://github.com/jonschlinkert/has-value) | [homepage](https://github.com/jonschlinkert/has-value "Returns true if a value exists, false if empty. Works with deeply nested values using object paths.") +* [merge-value](https://www.npmjs.com/package/merge-value): Similar to assign-value but deeply merges object values or nested values using object path/dot notation. | [homepage](https://github.com/jonschlinkert/merge-value "Similar to assign-value but deeply merges object values or nested values using object path/dot notation.") +* [omit-value](https://www.npmjs.com/package/omit-value): Omit properties from an object or deeply nested property of an object using object path… [more](https://github.com/jonschlinkert/omit-value) | [homepage](https://github.com/jonschlinkert/omit-value "Omit properties from an object or deeply nested property of an object using object path notation.") +* [set-value](https://www.npmjs.com/package/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/jonschlinkert/set-value "Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths.") +* [union-value](https://www.npmjs.com/package/union-value): Set an array of unique values as the property of an object. Supports setting deeply… [more](https://github.com/jonschlinkert/union-value) | [homepage](https://github.com/jonschlinkert/union-value "Set an array of unique values as the property of an object. Supports setting deeply nested properties using using object-paths/dot notation.") +* [unset-value](https://www.npmjs.com/package/unset-value): Delete nested properties from an object using dot notation. | [homepage](https://github.com/jonschlinkert/unset-value "Delete nested properties from an object using dot notation.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 53 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [vadimdemedes](https://github.com/vadimdemedes) | +| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 22, 2017._ \ No newline at end of file diff --git a/node_modules/union-value/node_modules/set-value/index.js b/node_modules/union-value/node_modules/set-value/index.js new file mode 100644 index 000000000..e51ece557 --- /dev/null +++ b/node_modules/union-value/node_modules/set-value/index.js @@ -0,0 +1,63 @@ +/*! + * set-value + * + * Copyright (c) 2014-2015, 2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var toPath = require('to-object-path'); +var extend = require('extend-shallow'); +var isPlainObject = require('is-plain-object'); +var isObject = require('is-extendable'); + +module.exports = function(obj, path, val) { + if (!isObject(obj)) { + return obj; + } + + if (Array.isArray(path)) { + path = toPath(path); + } + + if (typeof path !== 'string') { + return obj; + } + + var segs = path.split('.'); + var len = segs.length, i = -1; + var res = obj; + var last; + + while (++i < len) { + var key = segs[i]; + + while (key[key.length - 1] === '\\') { + key = key.slice(0, -1) + '.' + segs[++i]; + } + + if (i === len - 1) { + last = key; + break; + } + + if (!isObject(obj[key])) { + obj[key] = {}; + } + obj = obj[key]; + } + + if (obj.hasOwnProperty(last) && isObject(obj[last])) { + if (isPlainObject(val)) { + extend(obj[last], val); + } else { + obj[last] = val; + } + + } else { + obj[last] = val; + } + return res; +}; + diff --git a/node_modules/union-value/node_modules/set-value/package.json b/node_modules/union-value/node_modules/set-value/package.json new file mode 100644 index 000000000..abe11354e --- /dev/null +++ b/node_modules/union-value/node_modules/set-value/package.json @@ -0,0 +1,121 @@ +{ + "_from": "set-value@^0.4.3", + "_id": "set-value@0.4.3", + "_inBundle": false, + "_integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "_location": "/union-value/set-value", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "set-value@^0.4.3", + "name": "set-value", + "escapedName": "set-value", + "rawSpec": "^0.4.3", + "saveSpec": null, + "fetchSpec": "^0.4.3" + }, + "_requiredBy": [ + "/union-value" + ], + "_resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "_shasum": "7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1", + "_spec": "set-value@^0.4.3", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/union-value", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/set-value/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "email": "wtgtybhertgeghgtwtg@gmail.com", + "url": "https://github.com/wtgtybhertgeghgtwtg" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Vadim Demedes", + "email": "vdemedes@gmail.com", + "url": "https://vadimdemedes.com" + } + ], + "dependencies": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + }, + "deprecated": false, + "description": "Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths.", + "devDependencies": { + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/set-value", + "keywords": [ + "get", + "has", + "hasown", + "key", + "keys", + "nested", + "notation", + "object", + "prop", + "properties", + "property", + "props", + "set", + "value", + "values" + ], + "license": "MIT", + "main": "index.js", + "name": "set-value", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/set-value.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "assign-value", + "get-value", + "has-value", + "merge-value", + "omit-value", + "set-value", + "union-value", + "unset-value" + ] + }, + "lint": { + "reflinks": true + } + }, + "version": "0.4.3" +} diff --git a/node_modules/union-value/package.json b/node_modules/union-value/package.json new file mode 100644 index 000000000..29d155dd5 --- /dev/null +++ b/node_modules/union-value/package.json @@ -0,0 +1,105 @@ +{ + "_from": "union-value@^1.0.0", + "_id": "union-value@1.0.0", + "_inBundle": false, + "_integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "_location": "/union-value", + "_phantomChildren": { + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "to-object-path": "0.3.0" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "union-value@^1.0.0", + "name": "union-value", + "escapedName": "union-value", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/cache-base" + ], + "_resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "_shasum": "5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4", + "_spec": "union-value@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/cache-base", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/union-value/issues" + }, + "bundleDependencies": false, + "dependencies": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "deprecated": false, + "description": "Set an array of unique values as the property of an object. Supports setting deeply nested properties using using object-paths/dot notation.", + "devDependencies": { + "gulp-format-md": "^0.1.11", + "mocha": "^3.2.0", + "should": "^11.2.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/union-value", + "keywords": [ + "array", + "dot", + "get", + "has", + "nested", + "notation", + "object", + "path", + "prop", + "property", + "set", + "union", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "union-value", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/union-value.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "assign-value", + "get-value", + "has-value", + "set-value", + "unset-value" + ] + }, + "lint": { + "reflinks": true + } + }, + "version": "1.0.0" +} diff --git a/node_modules/unset-value/LICENSE b/node_modules/unset-value/LICENSE new file mode 100644 index 000000000..ec85897eb --- /dev/null +++ b/node_modules/unset-value/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, 2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/unset-value/README.md b/node_modules/unset-value/README.md new file mode 100644 index 000000000..f0fec3d3d --- /dev/null +++ b/node_modules/unset-value/README.md @@ -0,0 +1,131 @@ +# unset-value [![NPM version](https://img.shields.io/npm/v/unset-value.svg?style=flat)](https://www.npmjs.com/package/unset-value) [![NPM monthly downloads](https://img.shields.io/npm/dm/unset-value.svg?style=flat)](https://npmjs.org/package/unset-value) [![NPM total downloads](https://img.shields.io/npm/dt/unset-value.svg?style=flat)](https://npmjs.org/package/unset-value) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/unset-value.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/unset-value) + +> Delete nested properties from an object using dot notation. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save unset-value +``` + +## Usage + +```js +var unset = require('unset-value'); + +var obj = {a: {b: {c: 'd', e: 'f'}}}; +unset(obj, 'a.b.c'); +console.log(obj); +//=> {a: {b: {e: 'f'}}}; +``` + +## Examples + +### Updates the object when a property is deleted + +```js +var obj = {a: 'b'}; +unset(obj, 'a'); +console.log(obj); +//=> {} +``` + +### Returns true when a property is deleted + +```js +unset({a: 'b'}, 'a') // true +``` + +### Returns `true` when a property does not exist + +This is consistent with `delete` behavior in that it does not +throw when a property does not exist. + +```js +unset({a: {b: {c: 'd'}}}, 'd') // true +``` + +### delete nested values + +```js +var one = {a: {b: {c: 'd'}}}; +unset(one, 'a.b'); +console.log(one); +//=> {a: {}} + +var two = {a: {b: {c: 'd'}}}; +unset(two, 'a.b.c'); +console.log(two); +//=> {a: {b: {}}} + +var three = {a: {b: {c: 'd', e: 'f'}}}; +unset(three, 'a.b.c'); +console.log(three); +//=> {a: {b: {e: 'f'}}} +``` + +### throws on invalid args + +```js +unset(); +// 'expected an object.' +``` + +## About + +### Related projects + +* [get-value](https://www.npmjs.com/package/get-value): Use property paths (`a.b.c`) to get a nested value from an object. | [homepage](https://github.com/jonschlinkert/get-value "Use property paths (`a.b.c`) to get a nested value from an object.") +* [get-values](https://www.npmjs.com/package/get-values): Return an array of all values from the given object. | [homepage](https://github.com/jonschlinkert/get-values "Return an array of all values from the given object.") +* [omit-value](https://www.npmjs.com/package/omit-value): Omit properties from an object or deeply nested property of an object using object path… [more](https://github.com/jonschlinkert/omit-value) | [homepage](https://github.com/jonschlinkert/omit-value "Omit properties from an object or deeply nested property of an object using object path notation.") +* [put-value](https://www.npmjs.com/package/put-value): Update only existing values from an object, works with dot notation paths like `a.b.c` and… [more](https://github.com/tunnckocore/put-value#readme) | [homepage](https://github.com/tunnckocore/put-value#readme "Update only existing values from an object, works with dot notation paths like `a.b.c` and support deep nesting.") +* [set-value](https://www.npmjs.com/package/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/jonschlinkert/set-value "Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths.") +* [union-value](https://www.npmjs.com/package/union-value): Set an array of unique values as the property of an object. Supports setting deeply… [more](https://github.com/jonschlinkert/union-value) | [homepage](https://github.com/jonschlinkert/union-value "Set an array of unique values as the property of an object. Supports setting deeply nested properties using using object-paths/dot notation.") +* [upsert-value](https://www.npmjs.com/package/upsert-value): Update or set nested values and any intermediaries with dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/doowb/upsert-value "Update or set nested values and any intermediaries with dot notation (`'a.b.c'`) paths.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 6 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 25, 2017._ \ No newline at end of file diff --git a/node_modules/unset-value/index.js b/node_modules/unset-value/index.js new file mode 100644 index 000000000..a91901018 --- /dev/null +++ b/node_modules/unset-value/index.js @@ -0,0 +1,32 @@ +/*! + * unset-value + * + * Copyright (c) 2015, 2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var isObject = require('isobject'); +var has = require('has-value'); + +module.exports = function unset(obj, prop) { + if (!isObject(obj)) { + throw new TypeError('expected an object.'); + } + if (obj.hasOwnProperty(prop)) { + delete obj[prop]; + return true; + } + + if (has(obj, prop)) { + var segs = prop.split('.'); + var last = segs.pop(); + while (segs.length && segs[segs.length - 1].slice(-1) === '\\') { + last = segs.pop().slice(0, -1) + '.' + last; + } + while (segs.length) obj = obj[prop = segs.shift()]; + return (delete obj[last]); + } + return true; +}; diff --git a/node_modules/unset-value/node_modules/has-value/LICENSE b/node_modules/unset-value/node_modules/has-value/LICENSE new file mode 100644 index 000000000..39245ac1c --- /dev/null +++ b/node_modules/unset-value/node_modules/has-value/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/unset-value/node_modules/has-value/README.md b/node_modules/unset-value/node_modules/has-value/README.md new file mode 100644 index 000000000..a927633e5 --- /dev/null +++ b/node_modules/unset-value/node_modules/has-value/README.md @@ -0,0 +1,130 @@ +# has-value [![NPM version](https://img.shields.io/npm/v/has-value.svg?style=flat)](https://www.npmjs.com/package/has-value) [![NPM downloads](https://img.shields.io/npm/dm/has-value.svg?style=flat)](https://npmjs.org/package/has-value) [![Build Status](https://img.shields.io/travis/jonschlinkert/has-value.svg?style=flat)](https://travis-ci.org/jonschlinkert/has-value) + +> Returns true if a value exists, false if empty. Works with deeply nested values using object paths. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install has-value --save +``` + +**Works for:** + +* booleans +* functions +* numbers (pass `true` as the last arg to treat zero as a value instead of falsey) +* strings +* nulls +* object +* arrays + +## Usage + +Works with nested object paths or a single value: + +```js +var hasValue = require('has-value'); + +hasValue({a: {b: {c: 'foo'}}} 'a.b.c'); +//=> true + +hasValue('a'); +//=> true + +hasValue(''); +//=> false + +hasValue(1); +//=> true + +hasValue(0); +//=> false + +hasValue(0, true); // pass `true` as the last arg to treat zero as a value +//=> true + +hasValue({a: 'a'}}); +//=> true + +hasValue({}}); +//=> false + +hasValue(['a']); +//=> true + +hasValue([]); +//=> false + +hasValue(function(foo) {}); // function length/arity +//=> true + +hasValue(function() {}); +//=> false + +hasValue(true); +hasValue(false); +//=> true +``` + +## isEmpty + +To do the opposite and test for empty values, do: + +```js +function isEmpty(o, isZero) { + return !hasValue.apply(hasValue, arguments); +} +``` + +## Related projects + +You might also be interested in these projects: + +* [get-object](https://www.npmjs.com/package/get-object): Get a property from an object using dot (object path) notation. | [homepage](https://github.com/jonschlinkert/get-object) +* [get-property](https://www.npmjs.com/package/get-property): Get a nested property or its value from an object using simple `a.b.c` paths. | [homepage](https://github.com/jonschlinkert/get-property) +* [get-value](https://www.npmjs.com/package/get-value): Use property paths (`a.b.c`) to get a nested value from an object. | [homepage](https://github.com/jonschlinkert/get-value) +* [set-value](https://www.npmjs.com/package/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/jonschlinkert/set-value) + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/has-value/issues/new). + +## Building docs + +Generate readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install verb && npm run docs +``` + +Or, if [verb](https://github.com/verbose/verb) is installed globally: + +```sh +$ verb +``` + +## Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +## Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/has-value/blob/master/LICENSE). + +*** + +_This file was generated by [verb](https://github.com/verbose/verb), v, on March 27, 2016._ \ No newline at end of file diff --git a/node_modules/unset-value/node_modules/has-value/index.js b/node_modules/unset-value/node_modules/has-value/index.js new file mode 100644 index 000000000..90687c877 --- /dev/null +++ b/node_modules/unset-value/node_modules/has-value/index.js @@ -0,0 +1,19 @@ +/*! + * has-value + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var isObject = require('isobject'); +var hasValues = require('has-values'); +var get = require('get-value'); + +module.exports = function(obj, prop, noZero) { + if (isObject(obj)) { + return hasValues(get(obj, prop), noZero); + } + return hasValues(obj, prop); +}; diff --git a/node_modules/unset-value/node_modules/has-value/node_modules/isobject/LICENSE b/node_modules/unset-value/node_modules/has-value/node_modules/isobject/LICENSE new file mode 100644 index 000000000..39245ac1c --- /dev/null +++ b/node_modules/unset-value/node_modules/has-value/node_modules/isobject/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/unset-value/node_modules/has-value/node_modules/isobject/README.md b/node_modules/unset-value/node_modules/has-value/node_modules/isobject/README.md new file mode 100644 index 000000000..9dd897aa0 --- /dev/null +++ b/node_modules/unset-value/node_modules/has-value/node_modules/isobject/README.md @@ -0,0 +1,112 @@ +# isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat)](https://travis-ci.org/jonschlinkert/isobject) + +Returns true if the value is an object and not an array or null. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install isobject --save +``` + +Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install isobject +``` + +Install with [bower](http://bower.io/) + +```sh +$ bower install isobject +``` + +## Usage + +```js +var isObject = require('isobject'); +``` + +**True** + +All of the following return `true`: + +```js +isObject({}); +isObject(Object.create({})); +isObject(Object.create(Object.prototype)); +isObject(Object.create(null)); +isObject({}); +isObject(new Foo); +isObject(/foo/); +``` + +**False** + +All of the following return `false`: + +```js +isObject(); +isObject(function () {}); +isObject(1); +isObject([]); +isObject(undefined); +isObject(null); +``` + +## Related projects + +You might also be interested in these projects: + +[merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep) + +* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow) +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object) +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of) + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/isobject/issues/new). + +## Building docs + +Generate readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install verb && npm run docs +``` + +Or, if [verb](https://github.com/verbose/verb) is installed globally: + +```sh +$ verb +``` + +## Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +## Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/isobject/blob/master/LICENSE). + +*** + +_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on April 25, 2016._ \ No newline at end of file diff --git a/node_modules/unset-value/node_modules/has-value/node_modules/isobject/index.js b/node_modules/unset-value/node_modules/has-value/node_modules/isobject/index.js new file mode 100644 index 000000000..aa0dce0bb --- /dev/null +++ b/node_modules/unset-value/node_modules/has-value/node_modules/isobject/index.js @@ -0,0 +1,14 @@ +/*! + * isobject + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var isArray = require('isarray'); + +module.exports = function isObject(val) { + return val != null && typeof val === 'object' && isArray(val) === false; +}; diff --git a/node_modules/unset-value/node_modules/has-value/node_modules/isobject/package.json b/node_modules/unset-value/node_modules/has-value/node_modules/isobject/package.json new file mode 100644 index 000000000..c77ef6307 --- /dev/null +++ b/node_modules/unset-value/node_modules/has-value/node_modules/isobject/package.json @@ -0,0 +1,98 @@ +{ + "_from": "isobject@^2.0.0", + "_id": "isobject@2.1.0", + "_inBundle": false, + "_integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "_location": "/unset-value/has-value/isobject", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "isobject@^2.0.0", + "name": "isobject", + "escapedName": "isobject", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/unset-value/has-value" + ], + "_resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "_shasum": "f065561096a3f1da2ef46272f815c840d87e0c89", + "_spec": "isobject@^2.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/unset-value/node_modules/has-value", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/isobject/issues" + }, + "bundleDependencies": false, + "dependencies": { + "isarray": "1.0.0" + }, + "deprecated": false, + "description": "Returns true if the value is an object and not an array or null.", + "devDependencies": { + "gulp-format-md": "^0.1.9", + "mocha": "^2.4.5" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/isobject", + "keywords": [ + "check", + "is", + "is-object", + "isobject", + "kind", + "kind-of", + "kindof", + "native", + "object", + "type", + "typeof", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "isobject", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/isobject.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "merge-deep", + "extend-shallow", + "is-plain-object", + "kind-of" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb" + ] + }, + "version": "2.1.0" +} diff --git a/node_modules/unset-value/node_modules/has-value/package.json b/node_modules/unset-value/node_modules/has-value/package.json new file mode 100644 index 000000000..6e79133b6 --- /dev/null +++ b/node_modules/unset-value/node_modules/has-value/package.json @@ -0,0 +1,114 @@ +{ + "_from": "has-value@^0.3.1", + "_id": "has-value@0.3.1", + "_inBundle": false, + "_integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "_location": "/unset-value/has-value", + "_phantomChildren": { + "isarray": "1.0.0" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "has-value@^0.3.1", + "name": "has-value", + "escapedName": "has-value", + "rawSpec": "^0.3.1", + "saveSpec": null, + "fetchSpec": "^0.3.1" + }, + "_requiredBy": [ + "/unset-value" + ], + "_resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "_shasum": "7b1f58bada62ca827ec0a2078025654845995e1f", + "_spec": "has-value@^0.3.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/unset-value", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/has-value/issues" + }, + "bundleDependencies": false, + "dependencies": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "deprecated": false, + "description": "Returns true if a value exists, false if empty. Works with deeply nested values using object paths.", + "devDependencies": { + "gulp-format-md": "^0.1.7", + "mocha": "^2.4.5" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/has-value", + "keywords": [ + "array", + "boolean", + "empty", + "find", + "function", + "has", + "hasOwn", + "javascript", + "js", + "key", + "keys", + "node.js", + "null", + "number", + "object", + "properties", + "property", + "string", + "type", + "util", + "utilities", + "utility", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "has-value", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/has-value.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "get-object", + "get-property", + "get-value", + "set-value" + ] + }, + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "0.3.1" +} diff --git a/node_modules/unset-value/node_modules/has-values/LICENSE b/node_modules/unset-value/node_modules/has-values/LICENSE new file mode 100644 index 000000000..39245ac1c --- /dev/null +++ b/node_modules/unset-value/node_modules/has-values/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/unset-value/node_modules/has-values/README.md b/node_modules/unset-value/node_modules/has-values/README.md new file mode 100644 index 000000000..13319c517 --- /dev/null +++ b/node_modules/unset-value/node_modules/has-values/README.md @@ -0,0 +1,114 @@ +# has-values [![NPM version](https://img.shields.io/npm/v/has-values.svg?style=flat)](https://www.npmjs.com/package/has-values) [![NPM downloads](https://img.shields.io/npm/dm/has-values.svg?style=flat)](https://npmjs.org/package/has-values) [![Build Status](https://img.shields.io/travis/jonschlinkert/has-values.svg?style=flat)](https://travis-ci.org/jonschlinkert/has-values) + +> Returns true if any values exist, false if empty. Works for booleans, functions, numbers, strings, nulls, objects and arrays. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install has-values --save +``` + +## Usage + +```js +var hasValue = require('has-values'); + +hasValue('a'); +//=> true + +hasValue(''); +//=> false + +hasValue(1); +//=> true + +hasValue(0); +//=> false + +hasValue(0, true); // treat zero as a value +//=> true + +hasValue({a: 'a'}}); +//=> true + +hasValue({}}); +//=> false + +hasValue(['a']); +//=> true + +hasValue([]); +//=> false + +hasValue(function(foo) {}); // function length/arity +//=> true + +hasValue(function() {}); +//=> false + +hasValue(true); +hasValue(false); +//=> true +``` + +## isEmpty + +To test for empty values, do: + +```js +function isEmpty(o, isZero) { + return !hasValue(o, isZero); +} +``` + +## Related projects + +You might also be interested in these projects: + +* [has-value](https://www.npmjs.com/package/has-value): Returns true if a value exists, false if empty. Works with deeply nested values using… [more](https://www.npmjs.com/package/has-value) | [homepage](https://github.com/jonschlinkert/has-value) +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object) +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject) + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/has-values/issues/new). + +## Building docs + +Generate readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install verb && npm run docs +``` + +Or, if [verb](https://github.com/verbose/verb) is installed globally: + +```sh +$ verb +``` + +## Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +## Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/has-values/blob/master/LICENSE). + +*** + +_This file was generated by [verb](https://github.com/verbose/verb), v, on March 27, 2016._ \ No newline at end of file diff --git a/node_modules/unset-value/node_modules/has-values/index.js b/node_modules/unset-value/node_modules/has-values/index.js new file mode 100644 index 000000000..6d04ba1fe --- /dev/null +++ b/node_modules/unset-value/node_modules/has-values/index.js @@ -0,0 +1,36 @@ +/*! + * has-values + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +module.exports = function hasValue(o, noZero) { + if (o === null || o === undefined) { + return false; + } + + if (typeof o === 'boolean') { + return true; + } + + if (typeof o === 'number') { + if (o === 0 && noZero === true) { + return false; + } + return true; + } + + if (o.length !== undefined) { + return o.length !== 0; + } + + for (var key in o) { + if (o.hasOwnProperty(key)) { + return true; + } + } + return false; +}; diff --git a/node_modules/unset-value/node_modules/has-values/package.json b/node_modules/unset-value/node_modules/has-values/package.json new file mode 100644 index 000000000..6b042b863 --- /dev/null +++ b/node_modules/unset-value/node_modules/has-values/package.json @@ -0,0 +1,106 @@ +{ + "_from": "has-values@^0.1.4", + "_id": "has-values@0.1.4", + "_inBundle": false, + "_integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "_location": "/unset-value/has-values", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "has-values@^0.1.4", + "name": "has-values", + "escapedName": "has-values", + "rawSpec": "^0.1.4", + "saveSpec": null, + "fetchSpec": "^0.1.4" + }, + "_requiredBy": [ + "/unset-value/has-value" + ], + "_resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "_shasum": "6d61de95d91dfca9b9a02089ad384bff8f62b771", + "_spec": "has-values@^0.1.4", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/unset-value/node_modules/has-value", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/has-values/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Returns true if any values exist, false if empty. Works for booleans, functions, numbers, strings, nulls, objects and arrays. ", + "devDependencies": { + "gulp-format-md": "^0.1.7", + "mocha": "^2.4.5" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/has-values", + "keywords": [ + "array", + "boolean", + "empty", + "find", + "function", + "has", + "hasOwn", + "javascript", + "js", + "key", + "keys", + "node.js", + "null", + "number", + "object", + "properties", + "property", + "string", + "type", + "util", + "utilities", + "utility", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "has-values", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/has-values.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "has-value", + "isobject", + "is-plain-object" + ] + }, + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "0.1.4" +} diff --git a/node_modules/unset-value/node_modules/isobject/LICENSE b/node_modules/unset-value/node_modules/isobject/LICENSE new file mode 100644 index 000000000..943e71d05 --- /dev/null +++ b/node_modules/unset-value/node_modules/isobject/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +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. \ No newline at end of file diff --git a/node_modules/unset-value/node_modules/isobject/README.md b/node_modules/unset-value/node_modules/isobject/README.md new file mode 100644 index 000000000..d01feaa40 --- /dev/null +++ b/node_modules/unset-value/node_modules/isobject/README.md @@ -0,0 +1,122 @@ +# isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM monthly downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![NPM total downloads](https://img.shields.io/npm/dt/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/isobject) + +> Returns true if the value is an object and not an array or null. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save isobject +``` + +Install with [yarn](https://yarnpkg.com): + +```sh +$ yarn add isobject +``` + +Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install isobject +``` +Install with [bower](https://bower.io/) + +```sh +$ bower install isobject +``` + +## Usage + +```js +var isObject = require('isobject'); +``` + +**True** + +All of the following return `true`: + +```js +isObject({}); +isObject(Object.create({})); +isObject(Object.create(Object.prototype)); +isObject(Object.create(null)); +isObject({}); +isObject(new Foo); +isObject(/foo/); +``` + +**False** + +All of the following return `false`: + +```js +isObject(); +isObject(function () {}); +isObject(1); +isObject([]); +isObject(undefined); +isObject(null); +``` + +## About + +### Related projects + +* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") +* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 29 | [jonschlinkert](https://github.com/jonschlinkert) | +| 4 | [doowb](https://github.com/doowb) | +| 1 | [magnudae](https://github.com/magnudae) | +| 1 | [LeSuisse](https://github.com/LeSuisse) | +| 1 | [tmcw](https://github.com/tmcw) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 30, 2017._ \ No newline at end of file diff --git a/node_modules/unset-value/node_modules/isobject/index.d.ts b/node_modules/unset-value/node_modules/isobject/index.d.ts new file mode 100644 index 000000000..55f81c275 --- /dev/null +++ b/node_modules/unset-value/node_modules/isobject/index.d.ts @@ -0,0 +1,5 @@ +export = isObject; + +declare function isObject(val: any): boolean; + +declare namespace isObject {} diff --git a/node_modules/unset-value/node_modules/isobject/index.js b/node_modules/unset-value/node_modules/isobject/index.js new file mode 100644 index 000000000..2d59958bf --- /dev/null +++ b/node_modules/unset-value/node_modules/isobject/index.js @@ -0,0 +1,12 @@ +/*! + * isobject + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +module.exports = function isObject(val) { + return val != null && typeof val === 'object' && Array.isArray(val) === false; +}; diff --git a/node_modules/unset-value/node_modules/isobject/package.json b/node_modules/unset-value/node_modules/isobject/package.json new file mode 100644 index 000000000..42ffe6182 --- /dev/null +++ b/node_modules/unset-value/node_modules/isobject/package.json @@ -0,0 +1,119 @@ +{ + "_from": "isobject@^3.0.0", + "_id": "isobject@3.0.1", + "_inBundle": false, + "_integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "_location": "/unset-value/isobject", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "isobject@^3.0.0", + "name": "isobject", + "escapedName": "isobject", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/unset-value" + ], + "_resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "_shasum": "4e431e92b11a9731636aa1f9c8d1ccbcfdab78df", + "_spec": "isobject@^3.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/unset-value", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/isobject/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "url": "https://github.com/LeSuisse" + }, + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Magnús Dæhlen", + "url": "https://github.com/magnudae" + }, + { + "name": "Tom MacWright", + "url": "https://macwright.org" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "Returns true if the value is an object and not an array or null.", + "devDependencies": { + "gulp-format-md": "^0.1.9", + "mocha": "^2.4.5" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.d.ts", + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/isobject", + "keywords": [ + "check", + "is", + "is-object", + "isobject", + "kind", + "kind-of", + "kindof", + "native", + "object", + "type", + "typeof", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "isobject", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/isobject.git" + }, + "scripts": { + "test": "mocha" + }, + "types": "index.d.ts", + "verb": { + "related": { + "list": [ + "extend-shallow", + "is-plain-object", + "kind-of", + "merge-deep" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb" + ] + }, + "version": "3.0.1" +} diff --git a/node_modules/unset-value/package.json b/node_modules/unset-value/package.json new file mode 100644 index 000000000..c50d4e94f --- /dev/null +++ b/node_modules/unset-value/package.json @@ -0,0 +1,112 @@ +{ + "_from": "unset-value@^1.0.0", + "_id": "unset-value@1.0.0", + "_inBundle": false, + "_integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "_location": "/unset-value", + "_phantomChildren": { + "get-value": "2.0.6", + "isarray": "1.0.0" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "unset-value@^1.0.0", + "name": "unset-value", + "escapedName": "unset-value", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/cache-base" + ], + "_resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "_shasum": "8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559", + "_spec": "unset-value@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/cache-base", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/unset-value/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "email": "wtgtybhertgeghgtwtg@gmail.com", + "url": "https://github.com/wtgtybhertgeghgtwtg" + }, + { + "name": "Jon Schlinkert", + "email": "jon.schlinkert@sellside.com", + "url": "http://twitter.com/jonschlinkert" + } + ], + "dependencies": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "deprecated": false, + "description": "Delete nested properties from an object using dot notation.", + "devDependencies": { + "gulp-format-md": "^0.1.11", + "mocha": "*", + "should": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/unset-value", + "keywords": [ + "del", + "delete", + "key", + "object", + "omit", + "prop", + "property", + "remove", + "unset", + "value" + ], + "license": "MIT", + "main": "index.js", + "name": "unset-value", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/unset-value.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "get-value", + "get-values", + "omit-value", + "put-value", + "set-value", + "union-value", + "upsert-value" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + }, + "version": "1.0.0" +} diff --git a/node_modules/urix/.jshintrc b/node_modules/urix/.jshintrc new file mode 100644 index 000000000..9d1a61836 --- /dev/null +++ b/node_modules/urix/.jshintrc @@ -0,0 +1,42 @@ +{ + "bitwise": true, + "camelcase": true, + "curly": false, + "eqeqeq": true, + "es3": false, + "forin": true, + "immed": false, + "indent": false, + "latedef": "nofunc", + "newcap": false, + "noarg": true, + "noempty": true, + "nonew": false, + "plusplus": false, + "quotmark": true, + "undef": true, + "unused": "vars", + "strict": false, + "trailing": true, + "maxparams": 5, + "maxdepth": false, + "maxstatements": false, + "maxcomplexity": false, + "maxlen": 100, + + "asi": true, + "expr": true, + "globalstrict": true, + "smarttabs": true, + "sub": true, + + "node": true, + "globals": { + "describe": false, + "it": false, + "before": false, + "beforeEach": false, + "after": false, + "afterEach": false + } +} diff --git a/node_modules/urix/LICENSE b/node_modules/urix/LICENSE new file mode 100644 index 000000000..0595be367 --- /dev/null +++ b/node_modules/urix/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013 Simon Lydell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/urix/index.js b/node_modules/urix/index.js new file mode 100644 index 000000000..dc6ef2700 --- /dev/null +++ b/node_modules/urix/index.js @@ -0,0 +1,17 @@ +// Copyright 2014 Simon Lydell +// X11 (“MIT”) Licensed. (See LICENSE.) + +var path = require("path") + +"use strict" + +function urix(aPath) { + if (path.sep === "\\") { + return aPath + .replace(/\\/g, "/") + .replace(/^[a-z]:\/?/i, "/") + } + return aPath +} + +module.exports = urix diff --git a/node_modules/urix/package.json b/node_modules/urix/package.json new file mode 100644 index 000000000..c94404228 --- /dev/null +++ b/node_modules/urix/package.json @@ -0,0 +1,59 @@ +{ + "_from": "urix@^0.1.0", + "_id": "urix@0.1.0", + "_inBundle": false, + "_integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "_location": "/urix", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "urix@^0.1.0", + "name": "urix", + "escapedName": "urix", + "rawSpec": "^0.1.0", + "saveSpec": null, + "fetchSpec": "^0.1.0" + }, + "_requiredBy": [ + "/source-map-resolve" + ], + "_resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "_shasum": "da937f7a62e21fec1fd18d49b35c2935067a6c72", + "_spec": "urix@^0.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/source-map-resolve", + "author": { + "name": "Simon Lydell" + }, + "bugs": { + "url": "https://github.com/lydell/urix/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Makes Windows-style paths more unix and URI friendly.", + "devDependencies": { + "jshint": "^2.4.4", + "mocha": "^1.17.1" + }, + "homepage": "https://github.com/lydell/urix#readme", + "keywords": [ + "path", + "url", + "uri", + "unix", + "windows", + "backslash", + "slash" + ], + "license": "MIT", + "main": "index.js", + "name": "urix", + "repository": { + "type": "git", + "url": "git+https://github.com/lydell/urix.git" + }, + "scripts": { + "test": "jshint index.js test/ && mocha" + }, + "version": "0.1.0" +} diff --git a/node_modules/urix/readme.md b/node_modules/urix/readme.md new file mode 100644 index 000000000..b258b9863 --- /dev/null +++ b/node_modules/urix/readme.md @@ -0,0 +1,46 @@ +[![Build Status](https://travis-ci.org/lydell/urix.png?branch=master)](https://travis-ci.org/lydell/urix) + +Overview +======== + +Makes Windows-style paths more unix and URI friendly. Useful if you work with +paths that eventually will be used in URLs. + +```js +var urix = require("urix") + +// On Windows: +urix("c:\\users\\you\\foo") +// /users/you/foo + +// On unix-like systems: +urix("c:\\users\\you\\foo") +// c:\users\you\foo +``` + + +Installation +============ + +`npm install urix` + +```js +var urix = require("urix") +``` + + +Usage +===== + +### `urix(path)` ### + +On Windows, replaces all backslashes with slashes and uses a slash instead of a +drive letter and a colon for absolute paths. + +On unix-like systems it is a no-op. + + +License +======= + +[The X11 (“MIT”) License](LICENSE). diff --git a/node_modules/urix/test/index.js b/node_modules/urix/test/index.js new file mode 100644 index 000000000..5333f2463 --- /dev/null +++ b/node_modules/urix/test/index.js @@ -0,0 +1,43 @@ +// Copyright 2014 Simon Lydell +// X11 (“MIT”) Licensed. (See LICENSE.) + +var path = require("path") +var assert = require("assert") +var urix = require("../") + +"use stict" + +function test(testPath, expected) { + path.sep = "\\" + assert.equal(urix(testPath), expected) + path.sep = "/" + assert.equal(urix(testPath), testPath) +} + +describe("urix", function() { + + it("is a function", function() { + assert.equal(typeof urix, "function") + }) + + + it("converts backslashes to slashes", function() { + test("a\\b\\c", "a/b/c") + test("\\a\\b\\c", "/a/b/c") + test("a/b\\c", "a/b/c") + test("\\\\a\\\\\\b///c", "//a///b///c") + }) + + + it("changes the drive letter to a slash", function() { + test("c:\\a", "/a") + test("C:\\a", "/a") + test("z:\\a", "/a") + test("c:a", "/a") + test("c:/a", "/a") + test("c:\\\\a", "//a") + test("c://a", "//a") + test("c:\\//a", "///a") + }) + +}) diff --git a/node_modules/url-trim/LICENSE.md b/node_modules/url-trim/LICENSE.md new file mode 100644 index 000000000..9b10ce2a8 --- /dev/null +++ b/node_modules/url-trim/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) +Copyright (c) 2015 Jam3 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/url-trim/README.md b/node_modules/url-trim/README.md new file mode 100644 index 000000000..2c11115df --- /dev/null +++ b/node_modules/url-trim/README.md @@ -0,0 +1,37 @@ +# url-trim + +[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges) + +Trims query and hash parameters off of a URL. + +## Install + +```sh +npm install url-trim --save +``` + +## Example + +```js +var urlTrim = require('url-trim') + +urlTrim('http://localhost:9966/?foo=bar') +//=> 'http://localhost:9966/' + +urlTrim('/path/foo?blah#bar') +//=> '/path/foo' +``` + +## Usage + +[![NPM](https://nodei.co/npm/url-trim.png)](https://www.npmjs.com/package/url-trim) + +#### `trimmed = trim([url])` + +Trims the query string and hash parameters from a URL. + +If `url` is empty or not a string, this method returns an empty string. + +## License + +MIT, see [LICENSE.md](http://github.com/Jam3/url-trim/blob/master/LICENSE.md) for details. diff --git a/node_modules/url-trim/index.js b/node_modules/url-trim/index.js new file mode 100644 index 000000000..6b6dbb034 --- /dev/null +++ b/node_modules/url-trim/index.js @@ -0,0 +1,13 @@ +var urlLib = require('url') + +module.exports = stripUrl +function stripUrl (url) { + if (!url) return '' + var obj = urlLib.parse(url) + obj.search = '' + obj.hash = '' + obj.query = '' + obj.pathname = (obj.pathname || '').replace(/\/+$/, '/') + url = urlLib.format(obj) + return url || '/' +} diff --git a/node_modules/url-trim/package.json b/node_modules/url-trim/package.json new file mode 100644 index 000000000..ad7c5a406 --- /dev/null +++ b/node_modules/url-trim/package.json @@ -0,0 +1,70 @@ +{ + "_from": "url-trim@^1.0.0", + "_id": "url-trim@1.0.0", + "_inBundle": false, + "_integrity": "sha1-QAV+LxZLiOXaynJp2kfm0d2Detw=", + "_location": "/url-trim", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "url-trim@^1.0.0", + "name": "url-trim", + "escapedName": "url-trim", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/budo", + "/garnish" + ], + "_resolved": "https://registry.npmjs.org/url-trim/-/url-trim-1.0.0.tgz", + "_shasum": "40057e2f164b88e5daca7269da47e6d1dd837adc", + "_spec": "url-trim@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", + "author": { + "name": "Matt DesLauriers", + "email": "dave.des@gmail.com", + "url": "https://github.com/mattdesl" + }, + "bugs": { + "url": "https://github.com/Jam3/url-trim/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "trims query and hash parameters off a URL", + "devDependencies": { + "faucet": "0.0.1", + "standard": "^5.3.1", + "tape": "^4.2.0" + }, + "homepage": "https://github.com/Jam3/url-trim", + "keywords": [ + "url", + "trim", + "strip", + "path", + "name", + "pathname", + "param", + "params", + "query", + "hash", + "querystring", + "string", + "qs" + ], + "license": "MIT", + "main": "index.js", + "name": "url-trim", + "repository": { + "type": "git", + "url": "git://github.com/Jam3/url-trim.git" + }, + "scripts": { + "test": "node test.js | faucet" + }, + "version": "1.0.0" +} diff --git a/node_modules/url/.npmignore b/node_modules/url/.npmignore new file mode 100644 index 000000000..ba114713b --- /dev/null +++ b/node_modules/url/.npmignore @@ -0,0 +1 @@ +test-url.js diff --git a/node_modules/url/.travis.yml b/node_modules/url/.travis.yml new file mode 100644 index 000000000..16ed30155 --- /dev/null +++ b/node_modules/url/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +node_js: + - "0.10" +env: + global: + - secure: OgPRLCzHFh5WbjHEKlghHFW1oOreSF2JVUr3CMaFDi03ngTS2WONSw8mRn8SA6FTldiGGBx1n8orDzUw6cdkB7+tkU3G5B0M0V3vl823NaUFKgxsCM3UGDYfJb3yfAG5cj72rVZoX/ABd1fVuG4vBIlDLxsSlKQFMzUCFoyttr8= + - secure: AiZP8GHbyx83ZBhOvOxxtpNcgNHoP+vo5G1a1OYU78EHCgHg8NRyHKyCdrBnPvw6mV2BI/8frZaXAEicsHMtHMofBYn7nibNlaajBPI8AkHtYfNSc+zO+71Kwv7VOTOKKnkMEIkqhHlc6njFoH3QaBNHsgNlzzplPxaIt8vdUVk= diff --git a/node_modules/url/.zuul.yml b/node_modules/url/.zuul.yml new file mode 100644 index 000000000..feea8b60d --- /dev/null +++ b/node_modules/url/.zuul.yml @@ -0,0 +1,16 @@ +ui: mocha-tdd +browsers: + - name: chrome + version: latest + - name: firefox + version: 24..latest + - name: safari + version: latest + - name: ie + version: 9..latest + - name: iphone + version: oldest..latest + - name: ipad + version: oldest..latest + - name: android + version: oldest..latest diff --git a/node_modules/url/LICENSE b/node_modules/url/LICENSE new file mode 100644 index 000000000..f45bc1186 --- /dev/null +++ b/node_modules/url/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +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. diff --git a/node_modules/url/README.md b/node_modules/url/README.md new file mode 100644 index 000000000..8b3546028 --- /dev/null +++ b/node_modules/url/README.md @@ -0,0 +1,108 @@ +# node-url + +[![Build Status](https://travis-ci.org/defunctzombie/node-url.svg?branch=master)](https://travis-ci.org/defunctzombie/node-url) + +This module has utilities for URL resolution and parsing meant to have feature parity with node.js core [url](http://nodejs.org/api/url.html) module. + +```js +var url = require('url'); +``` + +## api + +Parsed URL objects have some or all of the following fields, depending on +whether or not they exist in the URL string. Any parts that are not in the URL +string will not be in the parsed object. Examples are shown for the URL + +`'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'` + +* `href`: The full URL that was originally parsed. Both the protocol and host are lowercased. + + Example: `'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'` + +* `protocol`: The request protocol, lowercased. + + Example: `'http:'` + +* `host`: The full lowercased host portion of the URL, including port + information. + + Example: `'host.com:8080'` + +* `auth`: The authentication information portion of a URL. + + Example: `'user:pass'` + +* `hostname`: Just the lowercased hostname portion of the host. + + Example: `'host.com'` + +* `port`: The port number portion of the host. + + Example: `'8080'` + +* `pathname`: The path section of the URL, that comes after the host and + before the query, including the initial slash if present. + + Example: `'/p/a/t/h'` + +* `search`: The 'query string' portion of the URL, including the leading + question mark. + + Example: `'?query=string'` + +* `path`: Concatenation of `pathname` and `search`. + + Example: `'/p/a/t/h?query=string'` + +* `query`: Either the 'params' portion of the query string, or a + querystring-parsed object. + + Example: `'query=string'` or `{'query':'string'}` + +* `hash`: The 'fragment' portion of the URL including the pound-sign. + + Example: `'#hash'` + +The following methods are provided by the URL module: + +### url.parse(urlStr, [parseQueryString], [slashesDenoteHost]) + +Take a URL string, and return an object. + +Pass `true` as the second argument to also parse +the query string using the `querystring` module. +Defaults to `false`. + +Pass `true` as the third argument to treat `//foo/bar` as +`{ host: 'foo', pathname: '/bar' }` rather than +`{ pathname: '//foo/bar' }`. Defaults to `false`. + +### url.format(urlObj) + +Take a parsed URL object, and return a formatted URL string. + +* `href` will be ignored. +* `protocol` is treated the same with or without the trailing `:` (colon). + * The protocols `http`, `https`, `ftp`, `gopher`, `file` will be + postfixed with `://` (colon-slash-slash). + * All other protocols `mailto`, `xmpp`, `aim`, `sftp`, `foo`, etc will + be postfixed with `:` (colon) +* `auth` will be used if present. +* `hostname` will only be used if `host` is absent. +* `port` will only be used if `host` is absent. +* `host` will be used in place of `hostname` and `port` +* `pathname` is treated the same with or without the leading `/` (slash) +* `search` will be used in place of `query` +* `query` (object; see `querystring`) will only be used if `search` is absent. +* `search` is treated the same with or without the leading `?` (question mark) +* `hash` is treated the same with or without the leading `#` (pound sign, anchor) + +### url.resolve(from, to) + +Take a base URL, and a href URL, and resolve them as a browser would for +an anchor tag. Examples: + + url.resolve('/one/two/three', 'four') // '/one/two/four' + url.resolve('http://example.com/', '/one') // 'http://example.com/one' + url.resolve('http://example.com/one', '/two') // 'http://example.com/two' diff --git a/node_modules/url/node_modules/punycode/LICENSE-MIT.txt b/node_modules/url/node_modules/punycode/LICENSE-MIT.txt new file mode 100644 index 000000000..a41e0a7ef --- /dev/null +++ b/node_modules/url/node_modules/punycode/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/url/node_modules/punycode/README.md b/node_modules/url/node_modules/punycode/README.md new file mode 100644 index 000000000..831e6379b --- /dev/null +++ b/node_modules/url/node_modules/punycode/README.md @@ -0,0 +1,176 @@ +# Punycode.js [![Build status](https://travis-ci.org/bestiejs/punycode.js.svg?branch=master)](https://travis-ci.org/bestiejs/punycode.js) [![Code coverage status](http://img.shields.io/coveralls/bestiejs/punycode.js/master.svg)](https://coveralls.io/r/bestiejs/punycode.js) [![Dependency status](https://gemnasium.com/bestiejs/punycode.js.svg)](https://gemnasium.com/bestiejs/punycode.js) + +A robust Punycode converter that fully complies to [RFC 3492](http://tools.ietf.org/html/rfc3492) and [RFC 5891](http://tools.ietf.org/html/rfc5891), and works on nearly all JavaScript platforms. + +This JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm: + +* [The C example code from RFC 3492](http://tools.ietf.org/html/rfc3492#appendix-C) +* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c) +* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c) +* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287) +* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072)) + +This project is [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with [Node.js v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc). + +## Installation + +Via [npm](http://npmjs.org/) (only required for Node.js releases older than v0.6.2): + +```bash +npm install punycode +``` + +Via [Bower](http://bower.io/): + +```bash +bower install punycode +``` + +Via [Component](https://github.com/component/component): + +```bash +component install bestiejs/punycode.js +``` + +In a browser: + +```html + +``` + +In [Narwhal](http://narwhaljs.org/), [Node.js](http://nodejs.org/), and [RingoJS](http://ringojs.org/): + +```js +var punycode = require('punycode'); +``` + +In [Rhino](http://www.mozilla.org/rhino/): + +```js +load('punycode.js'); +``` + +Using an AMD loader like [RequireJS](http://requirejs.org/): + +```js +require( + { + 'paths': { + 'punycode': 'path/to/punycode' + } + }, + ['punycode'], + function(punycode) { + console.log(punycode); + } +); +``` + +## API + +### `punycode.decode(string)` + +Converts a Punycode string of ASCII symbols to a string of Unicode symbols. + +```js +// decode domain name parts +punycode.decode('maana-pta'); // 'mañana' +punycode.decode('--dqo34k'); // '☃-⌘' +``` + +### `punycode.encode(string)` + +Converts a string of Unicode symbols to a Punycode string of ASCII symbols. + +```js +// encode domain name parts +punycode.encode('mañana'); // 'maana-pta' +punycode.encode('☃-⌘'); // '--dqo34k' +``` + +### `punycode.toUnicode(input)` + +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. + +```js +// decode domain names +punycode.toUnicode('xn--maana-pta.com'); +// → 'mañana.com' +punycode.toUnicode('xn----dqo34k.com'); +// → '☃-⌘.com' + +// decode email addresses +punycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'); +// → 'джумла@джpумлатест.bрфa' +``` + +### `punycode.toASCII(input)` + +Converts a Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that's already in ASCII. + +```js +// encode domain names +punycode.toASCII('mañana.com'); +// → 'xn--maana-pta.com' +punycode.toASCII('☃-⌘.com'); +// → 'xn----dqo34k.com' + +// encode email addresses +punycode.toASCII('джумла@джpумлатест.bрфa'); +// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq' +``` + +### `punycode.ucs2` + +#### `punycode.ucs2.decode(string)` + +Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), 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. + +```js +punycode.ucs2.decode('abc'); +// → [0x61, 0x62, 0x63] +// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE: +punycode.ucs2.decode('\uD834\uDF06'); +// → [0x1D306] +``` + +#### `punycode.ucs2.encode(codePoints)` + +Creates a string based on an array of numeric code point values. + +```js +punycode.ucs2.encode([0x61, 0x62, 0x63]); +// → 'abc' +punycode.ucs2.encode([0x1D306]); +// → '\uD834\uDF06' +``` + +### `punycode.version` + +A string representing the current Punycode.js version number. + +## Unit tests & code coverage + +After cloning this repository, run `npm install --dev` to install the dependencies needed for Punycode.js development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`. + +Once that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, PhantomJS, and web browsers as well, use `grunt test`. + +To generate the code coverage report, use `grunt cover`. + +Feel free to fork if you see possible improvements! + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## Contributors + +| [![twitter/jdalton](https://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | +|---| +| [John-David Dalton](http://allyoucanleet.com/) | + +## License + +Punycode.js is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/url/node_modules/punycode/package.json b/node_modules/url/node_modules/punycode/package.json new file mode 100644 index 000000000..c23b90e8f --- /dev/null +++ b/node_modules/url/node_modules/punycode/package.json @@ -0,0 +1,80 @@ +{ + "_from": "punycode@1.3.2", + "_id": "punycode@1.3.2", + "_inBundle": false, + "_integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "_location": "/url/punycode", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "punycode@1.3.2", + "name": "punycode", + "escapedName": "punycode", + "rawSpec": "1.3.2", + "saveSpec": null, + "fetchSpec": "1.3.2" + }, + "_requiredBy": [ + "/url" + ], + "_resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "_shasum": "9653a036fb7c1ee42342f2325cceefea3926c48d", + "_spec": "punycode@1.3.2", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/url", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "bugs": { + "url": "https://github.com/bestiejs/punycode.js/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + { + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + } + ], + "deprecated": false, + "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", + "devDependencies": { + "coveralls": "^2.10.1", + "grunt": "^0.4.5", + "grunt-contrib-uglify": "^0.5.0", + "grunt-shell": "^0.7.0", + "istanbul": "^0.2.13", + "qunit-extras": "^1.2.0", + "qunitjs": "~1.11.0", + "requirejs": "^2.1.14" + }, + "files": [ + "LICENSE-MIT.txt", + "punycode.js" + ], + "homepage": "https://mths.be/punycode", + "keywords": [ + "punycode", + "unicode", + "idn", + "idna", + "dns", + "url", + "domain" + ], + "license": "MIT", + "main": "punycode.js", + "name": "punycode", + "repository": { + "type": "git", + "url": "git+https://github.com/bestiejs/punycode.js.git" + }, + "scripts": { + "test": "node tests/tests.js" + }, + "version": "1.3.2" +} diff --git a/node_modules/url/node_modules/punycode/punycode.js b/node_modules/url/node_modules/punycode/punycode.js new file mode 100644 index 000000000..ac6859738 --- /dev/null +++ b/node_modules/url/node_modules/punycode/punycode.js @@ -0,0 +1,530 @@ +/*! https://mths.be/punycode v1.3.2 by @mathias */ +;(function(root) { + + /** Detect free variables */ + var freeExports = typeof exports == 'object' && exports && + !exports.nodeType && exports; + var freeModule = typeof module == 'object' && 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 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. + * http://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.3.2', + /** + * 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 ( + typeof define == 'function' && + typeof define.amd == 'object' && + define.amd + ) { + define('punycode', function() { + return punycode; + }); + } else if (freeExports && freeModule) { + if (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+ + freeModule.exports = punycode; + } else { // in Narwhal or RingoJS v0.7.0- + for (key in punycode) { + punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); + } + } + } else { // in Rhino or a web browser + root.punycode = punycode; + } + +}(this)); diff --git a/node_modules/url/package.json b/node_modules/url/package.json new file mode 100644 index 000000000..2244433b4 --- /dev/null +++ b/node_modules/url/package.json @@ -0,0 +1,53 @@ +{ + "_from": "url@~0.11.0", + "_id": "url@0.11.0", + "_inBundle": false, + "_integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "_location": "/url", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "url@~0.11.0", + "name": "url", + "escapedName": "url", + "rawSpec": "~0.11.0", + "saveSpec": null, + "fetchSpec": "~0.11.0" + }, + "_requiredBy": [ + "/browserify" + ], + "_resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "_shasum": "3838e97cfc60521eb73c525a8e55bfdd9e2e28f1", + "_spec": "url@~0.11.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "bugs": { + "url": "https://github.com/defunctzombie/node-url/issues" + }, + "bundleDependencies": false, + "dependencies": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "deprecated": false, + "description": "The core `url` packaged standalone for use with Browserify.", + "devDependencies": { + "assert": "1.1.1", + "mocha": "1.18.2", + "zuul": "3.3.0" + }, + "homepage": "https://github.com/defunctzombie/node-url#readme", + "license": "MIT", + "main": "./url.js", + "name": "url", + "repository": { + "type": "git", + "url": "git+https://github.com/defunctzombie/node-url.git" + }, + "scripts": { + "test": "mocha --ui qunit test.js && zuul -- test.js", + "test-local": "zuul --local -- test.js" + }, + "version": "0.11.0" +} diff --git a/node_modules/url/test.js b/node_modules/url/test.js new file mode 100644 index 000000000..3b7d3358c --- /dev/null +++ b/node_modules/url/test.js @@ -0,0 +1,1599 @@ +// 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 assert = require('assert'); + +var url = require('./url'); + +// URLs to parse, and expected data +// { url : parsed } +var parseTests = { + '//some_path' : { + 'href': '//some_path', + 'pathname': '//some_path', + 'path': '//some_path' + }, + + 'http:\\\\evil-phisher\\foo.html#h\\a\\s\\h': { + protocol: 'http:', + slashes: true, + host: 'evil-phisher', + hostname: 'evil-phisher', + pathname: '/foo.html', + path: '/foo.html', + hash: '#h%5Ca%5Cs%5Ch', + href: 'http://evil-phisher/foo.html#h%5Ca%5Cs%5Ch' + }, + + 'http:\\\\evil-phisher\\foo.html?json="\\"foo\\""#h\\a\\s\\h': { + protocol: 'http:', + slashes: true, + host: 'evil-phisher', + hostname: 'evil-phisher', + pathname: '/foo.html', + search: '?json=%22%5C%22foo%5C%22%22', + query: 'json=%22%5C%22foo%5C%22%22', + path: '/foo.html?json=%22%5C%22foo%5C%22%22', + hash: '#h%5Ca%5Cs%5Ch', + href: 'http://evil-phisher/foo.html?json=%22%5C%22foo%5C%22%22#h%5Ca%5Cs%5Ch' + }, + + 'http:\\\\evil-phisher\\foo.html#h\\a\\s\\h?blarg': { + protocol: 'http:', + slashes: true, + host: 'evil-phisher', + hostname: 'evil-phisher', + pathname: '/foo.html', + path: '/foo.html', + hash: '#h%5Ca%5Cs%5Ch?blarg', + href: 'http://evil-phisher/foo.html#h%5Ca%5Cs%5Ch?blarg' + }, + + + 'http:\\\\evil-phisher\\foo.html': { + protocol: 'http:', + slashes: true, + host: 'evil-phisher', + hostname: 'evil-phisher', + pathname: '/foo.html', + path: '/foo.html', + href: 'http://evil-phisher/foo.html' + }, + + 'HTTP://www.example.com/' : { + 'href': 'http://www.example.com/', + 'protocol': 'http:', + 'slashes': true, + 'host': 'www.example.com', + 'hostname': 'www.example.com', + 'pathname': '/', + 'path': '/' + }, + + 'HTTP://www.example.com' : { + 'href': 'http://www.example.com/', + 'protocol': 'http:', + 'slashes': true, + 'host': 'www.example.com', + 'hostname': 'www.example.com', + 'pathname': '/', + 'path': '/' + }, + + 'http://www.ExAmPlE.com/' : { + 'href': 'http://www.example.com/', + 'protocol': 'http:', + 'slashes': true, + 'host': 'www.example.com', + 'hostname': 'www.example.com', + 'pathname': '/', + 'path': '/' + }, + + 'http://user:pw@www.ExAmPlE.com/' : { + 'href': 'http://user:pw@www.example.com/', + 'protocol': 'http:', + 'slashes': true, + 'auth': 'user:pw', + 'host': 'www.example.com', + 'hostname': 'www.example.com', + 'pathname': '/', + 'path': '/' + }, + + 'http://USER:PW@www.ExAmPlE.com/' : { + 'href': 'http://USER:PW@www.example.com/', + 'protocol': 'http:', + 'slashes': true, + 'auth': 'USER:PW', + 'host': 'www.example.com', + 'hostname': 'www.example.com', + 'pathname': '/', + 'path': '/' + }, + + 'http://user@www.example.com/' : { + 'href': 'http://user@www.example.com/', + 'protocol': 'http:', + 'slashes': true, + 'auth': 'user', + 'host': 'www.example.com', + 'hostname': 'www.example.com', + 'pathname': '/', + 'path': '/' + }, + + 'http://user%3Apw@www.example.com/' : { + 'href': 'http://user:pw@www.example.com/', + 'protocol': 'http:', + 'slashes': true, + 'auth': 'user:pw', + 'host': 'www.example.com', + 'hostname': 'www.example.com', + 'pathname': '/', + 'path': '/' + }, + + 'http://x.com/path?that\'s#all, folks' : { + 'href': 'http://x.com/path?that%27s#all,%20folks', + 'protocol': 'http:', + 'slashes': true, + 'host': 'x.com', + 'hostname': 'x.com', + 'search': '?that%27s', + 'query': 'that%27s', + 'pathname': '/path', + 'hash': '#all,%20folks', + 'path': '/path?that%27s' + }, + + 'HTTP://X.COM/Y' : { + 'href': 'http://x.com/Y', + 'protocol': 'http:', + 'slashes': true, + 'host': 'x.com', + 'hostname': 'x.com', + 'pathname': '/Y', + 'path': '/Y' + }, + + // + not an invalid host character + // per https://url.spec.whatwg.org/#host-parsing + 'http://x.y.com+a/b/c' : { + 'href': 'http://x.y.com+a/b/c', + 'protocol': 'http:', + 'slashes': true, + 'host': 'x.y.com+a', + 'hostname': 'x.y.com+a', + 'pathname': '/b/c', + 'path': '/b/c' + }, + + // an unexpected invalid char in the hostname. + 'HtTp://x.y.cOm;a/b/c?d=e#f gi' : { + 'href': 'http://x.y.com/;a/b/c?d=e#f%20g%3Ch%3Ei', + 'protocol': 'http:', + 'slashes': true, + 'host': 'x.y.com', + 'hostname': 'x.y.com', + 'pathname': ';a/b/c', + 'search': '?d=e', + 'query': 'd=e', + 'hash': '#f%20g%3Ch%3Ei', + 'path': ';a/b/c?d=e' + }, + + // make sure that we don't accidentally lcast the path parts. + 'HtTp://x.y.cOm;A/b/c?d=e#f gi' : { + 'href': 'http://x.y.com/;A/b/c?d=e#f%20g%3Ch%3Ei', + 'protocol': 'http:', + 'slashes': true, + 'host': 'x.y.com', + 'hostname': 'x.y.com', + 'pathname': ';A/b/c', + 'search': '?d=e', + 'query': 'd=e', + 'hash': '#f%20g%3Ch%3Ei', + 'path': ';A/b/c?d=e' + }, + + 'http://x...y...#p': { + 'href': 'http://x...y.../#p', + 'protocol': 'http:', + 'slashes': true, + 'host': 'x...y...', + 'hostname': 'x...y...', + 'hash': '#p', + 'pathname': '/', + 'path': '/' + }, + + 'http://x/p/"quoted"': { + 'href': 'http://x/p/%22quoted%22', + 'protocol': 'http:', + 'slashes': true, + 'host': 'x', + 'hostname': 'x', + 'pathname': '/p/%22quoted%22', + 'path': '/p/%22quoted%22' + }, + + ' Is a URL!': { + 'href': '%3Chttp://goo.corn/bread%3E%20Is%20a%20URL!', + 'pathname': '%3Chttp://goo.corn/bread%3E%20Is%20a%20URL!', + 'path': '%3Chttp://goo.corn/bread%3E%20Is%20a%20URL!' + }, + + 'http://www.narwhaljs.org/blog/categories?id=news' : { + 'href': 'http://www.narwhaljs.org/blog/categories?id=news', + 'protocol': 'http:', + 'slashes': true, + 'host': 'www.narwhaljs.org', + 'hostname': 'www.narwhaljs.org', + 'search': '?id=news', + 'query': 'id=news', + 'pathname': '/blog/categories', + 'path': '/blog/categories?id=news' + }, + + 'http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=' : { + 'href': 'http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=', + 'protocol': 'http:', + 'slashes': true, + 'host': 'mt0.google.com', + 'hostname': 'mt0.google.com', + 'pathname': '/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=', + 'path': '/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=' + }, + + 'http://mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' : { + 'href': 'http://mt0.google.com/vt/lyrs=m@114???&hl=en&src=api' + + '&x=2&y=2&z=3&s=', + 'protocol': 'http:', + 'slashes': true, + 'host': 'mt0.google.com', + 'hostname': 'mt0.google.com', + 'search': '???&hl=en&src=api&x=2&y=2&z=3&s=', + 'query': '??&hl=en&src=api&x=2&y=2&z=3&s=', + 'pathname': '/vt/lyrs=m@114', + 'path': '/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' + }, + + 'http://user:pass@mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=': + { + 'href': 'http://user:pass@mt0.google.com/vt/lyrs=m@114???' + + '&hl=en&src=api&x=2&y=2&z=3&s=', + 'protocol': 'http:', + 'slashes': true, + 'host': 'mt0.google.com', + 'auth': 'user:pass', + 'hostname': 'mt0.google.com', + 'search': '???&hl=en&src=api&x=2&y=2&z=3&s=', + 'query': '??&hl=en&src=api&x=2&y=2&z=3&s=', + 'pathname': '/vt/lyrs=m@114', + 'path': '/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' + }, + + 'file:///etc/passwd' : { + 'href': 'file:///etc/passwd', + 'slashes': true, + 'protocol': 'file:', + 'pathname': '/etc/passwd', + 'hostname': '', + 'host': '', + 'path': '/etc/passwd' + }, + + 'file://localhost/etc/passwd' : { + 'href': 'file://localhost/etc/passwd', + 'protocol': 'file:', + 'slashes': true, + 'pathname': '/etc/passwd', + 'hostname': 'localhost', + 'host': 'localhost', + 'path': '/etc/passwd' + }, + + 'file://foo/etc/passwd' : { + 'href': 'file://foo/etc/passwd', + 'protocol': 'file:', + 'slashes': true, + 'pathname': '/etc/passwd', + 'hostname': 'foo', + 'host': 'foo', + 'path': '/etc/passwd' + }, + + 'file:///etc/node/' : { + 'href': 'file:///etc/node/', + 'slashes': true, + 'protocol': 'file:', + 'pathname': '/etc/node/', + 'hostname': '', + 'host': '', + 'path': '/etc/node/' + }, + + 'file://localhost/etc/node/' : { + 'href': 'file://localhost/etc/node/', + 'protocol': 'file:', + 'slashes': true, + 'pathname': '/etc/node/', + 'hostname': 'localhost', + 'host': 'localhost', + 'path': '/etc/node/' + }, + + 'file://foo/etc/node/' : { + 'href': 'file://foo/etc/node/', + 'protocol': 'file:', + 'slashes': true, + 'pathname': '/etc/node/', + 'hostname': 'foo', + 'host': 'foo', + 'path': '/etc/node/' + }, + + 'http:/baz/../foo/bar' : { + 'href': 'http:/baz/../foo/bar', + 'protocol': 'http:', + 'pathname': '/baz/../foo/bar', + 'path': '/baz/../foo/bar' + }, + + 'http://user:pass@example.com:8000/foo/bar?baz=quux#frag' : { + 'href': 'http://user:pass@example.com:8000/foo/bar?baz=quux#frag', + 'protocol': 'http:', + 'slashes': true, + 'host': 'example.com:8000', + 'auth': 'user:pass', + 'port': '8000', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?baz=quux', + 'query': 'baz=quux', + 'pathname': '/foo/bar', + 'path': '/foo/bar?baz=quux' + }, + + '//user:pass@example.com:8000/foo/bar?baz=quux#frag' : { + 'href': '//user:pass@example.com:8000/foo/bar?baz=quux#frag', + 'slashes': true, + 'host': 'example.com:8000', + 'auth': 'user:pass', + 'port': '8000', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?baz=quux', + 'query': 'baz=quux', + 'pathname': '/foo/bar', + 'path': '/foo/bar?baz=quux' + }, + + '/foo/bar?baz=quux#frag' : { + 'href': '/foo/bar?baz=quux#frag', + 'hash': '#frag', + 'search': '?baz=quux', + 'query': 'baz=quux', + 'pathname': '/foo/bar', + 'path': '/foo/bar?baz=quux' + }, + + 'http:/foo/bar?baz=quux#frag' : { + 'href': 'http:/foo/bar?baz=quux#frag', + 'protocol': 'http:', + 'hash': '#frag', + 'search': '?baz=quux', + 'query': 'baz=quux', + 'pathname': '/foo/bar', + 'path': '/foo/bar?baz=quux' + }, + + 'mailto:foo@bar.com?subject=hello' : { + 'href': 'mailto:foo@bar.com?subject=hello', + 'protocol': 'mailto:', + 'host': 'bar.com', + 'auth' : 'foo', + 'hostname' : 'bar.com', + 'search': '?subject=hello', + 'query': 'subject=hello', + 'path': '?subject=hello' + }, + + 'javascript:alert(\'hello\');' : { + 'href': 'javascript:alert(\'hello\');', + 'protocol': 'javascript:', + 'pathname': 'alert(\'hello\');', + 'path': 'alert(\'hello\');' + }, + + 'xmpp:isaacschlueter@jabber.org' : { + 'href': 'xmpp:isaacschlueter@jabber.org', + 'protocol': 'xmpp:', + 'host': 'jabber.org', + 'auth': 'isaacschlueter', + 'hostname': 'jabber.org' + }, + + 'http://atpass:foo%40bar@127.0.0.1:8080/path?search=foo#bar' : { + 'href' : 'http://atpass:foo%40bar@127.0.0.1:8080/path?search=foo#bar', + 'protocol' : 'http:', + 'slashes': true, + 'host' : '127.0.0.1:8080', + 'auth' : 'atpass:foo@bar', + 'hostname' : '127.0.0.1', + 'port' : '8080', + 'pathname': '/path', + 'search' : '?search=foo', + 'query' : 'search=foo', + 'hash' : '#bar', + 'path': '/path?search=foo' + }, + + 'svn+ssh://foo/bar': { + 'href': 'svn+ssh://foo/bar', + 'host': 'foo', + 'hostname': 'foo', + 'protocol': 'svn+ssh:', + 'pathname': '/bar', + 'path': '/bar', + 'slashes': true + }, + + 'dash-test://foo/bar': { + 'href': 'dash-test://foo/bar', + 'host': 'foo', + 'hostname': 'foo', + 'protocol': 'dash-test:', + 'pathname': '/bar', + 'path': '/bar', + 'slashes': true + }, + + 'dash-test:foo/bar': { + 'href': 'dash-test:foo/bar', + 'host': 'foo', + 'hostname': 'foo', + 'protocol': 'dash-test:', + 'pathname': '/bar', + 'path': '/bar' + }, + + 'dot.test://foo/bar': { + 'href': 'dot.test://foo/bar', + 'host': 'foo', + 'hostname': 'foo', + 'protocol': 'dot.test:', + 'pathname': '/bar', + 'path': '/bar', + 'slashes': true + }, + + 'dot.test:foo/bar': { + 'href': 'dot.test:foo/bar', + 'host': 'foo', + 'hostname': 'foo', + 'protocol': 'dot.test:', + 'pathname': '/bar', + 'path': '/bar' + }, + + // IDNA tests + 'http://www.日本語.com/' : { + 'href': 'http://www.xn--wgv71a119e.com/', + 'protocol': 'http:', + 'slashes': true, + 'host': 'www.xn--wgv71a119e.com', + 'hostname': 'www.xn--wgv71a119e.com', + 'pathname': '/', + 'path': '/' + }, + + 'http://example.Bücher.com/' : { + 'href': 'http://example.xn--bcher-kva.com/', + 'protocol': 'http:', + 'slashes': true, + 'host': 'example.xn--bcher-kva.com', + 'hostname': 'example.xn--bcher-kva.com', + 'pathname': '/', + 'path': '/' + }, + + 'http://www.Äffchen.com/' : { + 'href': 'http://www.xn--ffchen-9ta.com/', + 'protocol': 'http:', + 'slashes': true, + 'host': 'www.xn--ffchen-9ta.com', + 'hostname': 'www.xn--ffchen-9ta.com', + 'pathname': '/', + 'path': '/' + }, + + 'http://www.Äffchen.cOm;A/b/c?d=e#f gi' : { + 'href': 'http://www.xn--ffchen-9ta.com/;A/b/c?d=e#f%20g%3Ch%3Ei', + 'protocol': 'http:', + 'slashes': true, + 'host': 'www.xn--ffchen-9ta.com', + 'hostname': 'www.xn--ffchen-9ta.com', + 'pathname': ';A/b/c', + 'search': '?d=e', + 'query': 'd=e', + 'hash': '#f%20g%3Ch%3Ei', + 'path': ';A/b/c?d=e' + }, + + 'http://SÉLIER.COM/' : { + 'href': 'http://xn--slier-bsa.com/', + 'protocol': 'http:', + 'slashes': true, + 'host': 'xn--slier-bsa.com', + 'hostname': 'xn--slier-bsa.com', + 'pathname': '/', + 'path': '/' + }, + + 'http://ليهمابتكلموشعربي؟.ي؟/' : { + 'href': 'http://xn--egbpdaj6bu4bxfgehfvwxn.xn--egb9f/', + 'protocol': 'http:', + 'slashes': true, + 'host': 'xn--egbpdaj6bu4bxfgehfvwxn.xn--egb9f', + 'hostname': 'xn--egbpdaj6bu4bxfgehfvwxn.xn--egb9f', + 'pathname': '/', + 'path': '/' + }, + + 'http://➡.ws/➡' : { + 'href': 'http://xn--hgi.ws/➡', + 'protocol': 'http:', + 'slashes': true, + 'host': 'xn--hgi.ws', + 'hostname': 'xn--hgi.ws', + 'pathname': '/➡', + 'path': '/➡' + }, + + 'http://bucket_name.s3.amazonaws.com/image.jpg': { + protocol: 'http:', + 'slashes': true, + slashes: true, + host: 'bucket_name.s3.amazonaws.com', + hostname: 'bucket_name.s3.amazonaws.com', + pathname: '/image.jpg', + href: 'http://bucket_name.s3.amazonaws.com/image.jpg', + 'path': '/image.jpg' + }, + + 'git+http://github.com/joyent/node.git': { + protocol: 'git+http:', + slashes: true, + host: 'github.com', + hostname: 'github.com', + pathname: '/joyent/node.git', + path: '/joyent/node.git', + href: 'git+http://github.com/joyent/node.git' + }, + + //if local1@domain1 is uses as a relative URL it may + //be parse into auth@hostname, but here there is no + //way to make it work in url.parse, I add the test to be explicit + 'local1@domain1': { + 'pathname': 'local1@domain1', + 'path': 'local1@domain1', + 'href': 'local1@domain1' + }, + + //While this may seem counter-intuitive, a browser will parse + // as a path. + 'www.example.com' : { + 'href': 'www.example.com', + 'pathname': 'www.example.com', + 'path': 'www.example.com' + }, + + // ipv6 support + '[fe80::1]': { + 'href': '[fe80::1]', + 'pathname': '[fe80::1]', + 'path': '[fe80::1]' + }, + + 'coap://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]': { + 'protocol': 'coap:', + 'slashes': true, + 'host': '[fedc:ba98:7654:3210:fedc:ba98:7654:3210]', + 'hostname': 'fedc:ba98:7654:3210:fedc:ba98:7654:3210', + 'href': 'coap://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/', + 'pathname': '/', + 'path': '/' + }, + + 'coap://[1080:0:0:0:8:800:200C:417A]:61616/': { + 'protocol': 'coap:', + 'slashes': true, + 'host': '[1080:0:0:0:8:800:200c:417a]:61616', + 'port': '61616', + 'hostname': '1080:0:0:0:8:800:200c:417a', + 'href': 'coap://[1080:0:0:0:8:800:200c:417a]:61616/', + 'pathname': '/', + 'path': '/' + }, + + 'http://user:password@[3ffe:2a00:100:7031::1]:8080': { + 'protocol': 'http:', + 'slashes': true, + 'auth': 'user:password', + 'host': '[3ffe:2a00:100:7031::1]:8080', + 'port': '8080', + 'hostname': '3ffe:2a00:100:7031::1', + 'href': 'http://user:password@[3ffe:2a00:100:7031::1]:8080/', + 'pathname': '/', + 'path': '/' + }, + + 'coap://u:p@[::192.9.5.5]:61616/.well-known/r?n=Temperature': { + 'protocol': 'coap:', + 'slashes': true, + 'auth': 'u:p', + 'host': '[::192.9.5.5]:61616', + 'port': '61616', + 'hostname': '::192.9.5.5', + 'href': 'coap://u:p@[::192.9.5.5]:61616/.well-known/r?n=Temperature', + 'search': '?n=Temperature', + 'query': 'n=Temperature', + 'pathname': '/.well-known/r', + 'path': '/.well-known/r?n=Temperature' + }, + + // empty port + 'http://example.com:': { + 'protocol': 'http:', + 'slashes': true, + 'host': 'example.com', + 'hostname': 'example.com', + 'href': 'http://example.com/', + 'pathname': '/', + 'path': '/' + }, + + 'http://example.com:/a/b.html': { + 'protocol': 'http:', + 'slashes': true, + 'host': 'example.com', + 'hostname': 'example.com', + 'href': 'http://example.com/a/b.html', + 'pathname': '/a/b.html', + 'path': '/a/b.html' + }, + + 'http://example.com:?a=b': { + 'protocol': 'http:', + 'slashes': true, + 'host': 'example.com', + 'hostname': 'example.com', + 'href': 'http://example.com/?a=b', + 'search': '?a=b', + 'query': 'a=b', + 'pathname': '/', + 'path': '/?a=b' + }, + + 'http://example.com:#abc': { + 'protocol': 'http:', + 'slashes': true, + 'host': 'example.com', + 'hostname': 'example.com', + 'href': 'http://example.com/#abc', + 'hash': '#abc', + 'pathname': '/', + 'path': '/' + }, + + 'http://[fe80::1]:/a/b?a=b#abc': { + 'protocol': 'http:', + 'slashes': true, + 'host': '[fe80::1]', + 'hostname': 'fe80::1', + 'href': 'http://[fe80::1]/a/b?a=b#abc', + 'search': '?a=b', + 'query': 'a=b', + 'hash': '#abc', + 'pathname': '/a/b', + 'path': '/a/b?a=b' + }, + + 'http://-lovemonsterz.tumblr.com/rss': { + 'protocol': 'http:', + 'slashes': true, + 'host': '-lovemonsterz.tumblr.com', + 'hostname': '-lovemonsterz.tumblr.com', + 'href': 'http://-lovemonsterz.tumblr.com/rss', + 'pathname': '/rss', + 'path': '/rss', + }, + + 'http://-lovemonsterz.tumblr.com:80/rss': { + 'protocol': 'http:', + 'slashes': true, + 'port': '80', + 'host': '-lovemonsterz.tumblr.com:80', + 'hostname': '-lovemonsterz.tumblr.com', + 'href': 'http://-lovemonsterz.tumblr.com:80/rss', + 'pathname': '/rss', + 'path': '/rss', + }, + + 'http://user:pass@-lovemonsterz.tumblr.com/rss': { + 'protocol': 'http:', + 'slashes': true, + 'auth': 'user:pass', + 'host': '-lovemonsterz.tumblr.com', + 'hostname': '-lovemonsterz.tumblr.com', + 'href': 'http://user:pass@-lovemonsterz.tumblr.com/rss', + 'pathname': '/rss', + 'path': '/rss', + }, + + 'http://user:pass@-lovemonsterz.tumblr.com:80/rss': { + 'protocol': 'http:', + 'slashes': true, + 'auth': 'user:pass', + 'port': '80', + 'host': '-lovemonsterz.tumblr.com:80', + 'hostname': '-lovemonsterz.tumblr.com', + 'href': 'http://user:pass@-lovemonsterz.tumblr.com:80/rss', + 'pathname': '/rss', + 'path': '/rss', + }, + + 'http://_jabber._tcp.google.com/test': { + 'protocol': 'http:', + 'slashes': true, + 'host': '_jabber._tcp.google.com', + 'hostname': '_jabber._tcp.google.com', + 'href': 'http://_jabber._tcp.google.com/test', + 'pathname': '/test', + 'path': '/test', + }, + + 'http://user:pass@_jabber._tcp.google.com/test': { + 'protocol': 'http:', + 'slashes': true, + 'auth': 'user:pass', + 'host': '_jabber._tcp.google.com', + 'hostname': '_jabber._tcp.google.com', + 'href': 'http://user:pass@_jabber._tcp.google.com/test', + 'pathname': '/test', + 'path': '/test', + }, + + 'http://_jabber._tcp.google.com:80/test': { + 'protocol': 'http:', + 'slashes': true, + 'port': '80', + 'host': '_jabber._tcp.google.com:80', + 'hostname': '_jabber._tcp.google.com', + 'href': 'http://_jabber._tcp.google.com:80/test', + 'pathname': '/test', + 'path': '/test', + }, + + 'http://user:pass@_jabber._tcp.google.com:80/test': { + 'protocol': 'http:', + 'slashes': true, + 'auth': 'user:pass', + 'port': '80', + 'host': '_jabber._tcp.google.com:80', + 'hostname': '_jabber._tcp.google.com', + 'href': 'http://user:pass@_jabber._tcp.google.com:80/test', + 'pathname': '/test', + 'path': '/test', + }, + + 'http://x:1/\' <>"`/{}|\\^~`/': { + protocol: 'http:', + slashes: true, + host: 'x:1', + port: '1', + hostname: 'x', + pathname: '/%27%20%3C%3E%22%60/%7B%7D%7C/%5E~%60/', + path: '/%27%20%3C%3E%22%60/%7B%7D%7C/%5E~%60/', + href: 'http://x:1/%27%20%3C%3E%22%60/%7B%7D%7C/%5E~%60/' + }, + + 'http://a@b@c/': { + protocol: 'http:', + slashes: true, + auth: 'a@b', + host: 'c', + hostname: 'c', + href: 'http://a%40b@c/', + path: '/', + pathname: '/' + }, + + 'http://a@b?@c': { + protocol: 'http:', + slashes: true, + auth: 'a', + host: 'b', + hostname: 'b', + href: 'http://a@b/?@c', + path: '/?@c', + pathname: '/', + search: '?@c', + query: '@c' + }, + + 'http://a\r" \t\n<\'b:b@c\r\nd/e?f':{ + protocol: 'http:', + slashes: true, + auth: 'a\r" \t\n<\'b:b', + host: 'c', + port: null, + hostname: 'c', + hash: null, + search: '?f', + query: 'f', + pathname: '%0D%0Ad/e', + path: '%0D%0Ad/e?f', + href: 'http://a%0D%22%20%09%0A%3C\'b:b@c/%0D%0Ad/e?f' + }, + + // git urls used by npm + 'git+ssh://git@github.com:npm/npm': { + protocol: 'git+ssh:', + slashes: true, + auth: 'git', + host: 'github.com', + port: null, + hostname: 'github.com', + hash: null, + search: null, + query: null, + pathname: '/:npm/npm', + path: '/:npm/npm', + href: 'git+ssh://git@github.com/:npm/npm' + } + +}; + +Object.keys(parseTests).forEach(function(u) { + test('parse(' + u + ')', function() { + var actual = url.parse(u), + spaced = url.parse(' \t ' + u + '\n\t'); + expected = parseTests[u]; + + Object.keys(actual).forEach(function (i) { + if (expected[i] === undefined && actual[i] === null) { + expected[i] = null; + } + }); + + assert.deepEqual(actual, expected); + assert.deepEqual(spaced, expected); + + var expected = parseTests[u].href, + actual = url.format(parseTests[u]); + + assert.equal(actual, expected, + 'format(' + u + ') == ' + u + '\nactual:' + actual); + }); +}); + +var parseTestsWithQueryString = { + '/foo/bar?baz=quux#frag' : { + 'href': '/foo/bar?baz=quux#frag', + 'hash': '#frag', + 'search': '?baz=quux', + 'query': { + 'baz': 'quux' + }, + 'pathname': '/foo/bar', + 'path': '/foo/bar?baz=quux' + }, + 'http://example.com' : { + 'href': 'http://example.com/', + 'protocol': 'http:', + 'slashes': true, + 'host': 'example.com', + 'hostname': 'example.com', + 'query': {}, + 'search': '', + 'pathname': '/', + 'path': '/' + }, + '/example': { + protocol: null, + slashes: null, + auth: null, + host: null, + port: null, + hostname: null, + hash: null, + search: '', + query: {}, + pathname: '/example', + path: '/example', + href: '/example' + }, + '/example?query=value':{ + protocol: null, + slashes: null, + auth: null, + host: null, + port: null, + hostname: null, + hash: null, + search: '?query=value', + query: { query: 'value' }, + pathname: '/example', + path: '/example?query=value', + href: '/example?query=value' + } +}; + +Object.keys(parseTestsWithQueryString).forEach(function(u) { + test('parse(' + u + ')', function() { + var actual = url.parse(u, true); + var expected = parseTestsWithQueryString[u]; + for (var i in actual) { + if (actual[i] === null && expected[i] === undefined) { + expected[i] = null; + } + } + + assert.deepEqual(actual, expected); + }); +}); + +// some extra formatting tests, just to verify +// that it'll format slightly wonky content to a valid url. +var formatTests = { + 'http://example.com?' : { + 'href': 'http://example.com/?', + 'protocol': 'http:', + 'slashes': true, + 'host': 'example.com', + 'hostname': 'example.com', + 'search': '?', + 'query': {}, + 'pathname': '/' + }, + 'http://example.com?foo=bar#frag' : { + 'href': 'http://example.com/?foo=bar#frag', + 'protocol': 'http:', + 'host': 'example.com', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?foo=bar', + 'query': 'foo=bar', + 'pathname': '/' + }, + 'http://example.com?foo=@bar#frag' : { + 'href': 'http://example.com/?foo=@bar#frag', + 'protocol': 'http:', + 'host': 'example.com', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?foo=@bar', + 'query': 'foo=@bar', + 'pathname': '/' + }, + 'http://example.com?foo=/bar/#frag' : { + 'href': 'http://example.com/?foo=/bar/#frag', + 'protocol': 'http:', + 'host': 'example.com', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?foo=/bar/', + 'query': 'foo=/bar/', + 'pathname': '/' + }, + 'http://example.com?foo=?bar/#frag' : { + 'href': 'http://example.com/?foo=?bar/#frag', + 'protocol': 'http:', + 'host': 'example.com', + 'hostname': 'example.com', + 'hash': '#frag', + 'search': '?foo=?bar/', + 'query': 'foo=?bar/', + 'pathname': '/' + }, + 'http://example.com#frag=?bar/#frag' : { + 'href': 'http://example.com/#frag=?bar/#frag', + 'protocol': 'http:', + 'host': 'example.com', + 'hostname': 'example.com', + 'hash': '#frag=?bar/#frag', + 'pathname': '/' + }, + 'http://google.com" onload="alert(42)/' : { + 'href': 'http://google.com/%22%20onload=%22alert(42)/', + 'protocol': 'http:', + 'host': 'google.com', + 'pathname': '/%22%20onload=%22alert(42)/' + }, + 'http://a.com/a/b/c?s#h' : { + 'href': 'http://a.com/a/b/c?s#h', + 'protocol': 'http', + 'host': 'a.com', + 'pathname': 'a/b/c', + 'hash': 'h', + 'search': 's' + }, + 'xmpp:isaacschlueter@jabber.org' : { + 'href': 'xmpp:isaacschlueter@jabber.org', + 'protocol': 'xmpp:', + 'host': 'jabber.org', + 'auth': 'isaacschlueter', + 'hostname': 'jabber.org' + }, + 'http://atpass:foo%40bar@127.0.0.1/' : { + 'href': 'http://atpass:foo%40bar@127.0.0.1/', + 'auth': 'atpass:foo@bar', + 'hostname': '127.0.0.1', + 'protocol': 'http:', + 'pathname': '/' + }, + 'http://atslash%2F%40:%2F%40@foo/' : { + 'href': 'http://atslash%2F%40:%2F%40@foo/', + 'auth': 'atslash/@:/@', + 'hostname': 'foo', + 'protocol': 'http:', + 'pathname': '/' + }, + 'svn+ssh://foo/bar': { + 'href': 'svn+ssh://foo/bar', + 'hostname': 'foo', + 'protocol': 'svn+ssh:', + 'pathname': '/bar', + 'slashes': true + }, + 'dash-test://foo/bar': { + 'href': 'dash-test://foo/bar', + 'hostname': 'foo', + 'protocol': 'dash-test:', + 'pathname': '/bar', + 'slashes': true + }, + 'dash-test:foo/bar': { + 'href': 'dash-test:foo/bar', + 'hostname': 'foo', + 'protocol': 'dash-test:', + 'pathname': '/bar' + }, + 'dot.test://foo/bar': { + 'href': 'dot.test://foo/bar', + 'hostname': 'foo', + 'protocol': 'dot.test:', + 'pathname': '/bar', + 'slashes': true + }, + 'dot.test:foo/bar': { + 'href': 'dot.test:foo/bar', + 'hostname': 'foo', + 'protocol': 'dot.test:', + 'pathname': '/bar' + }, + // ipv6 support + 'coap:u:p@[::1]:61616/.well-known/r?n=Temperature': { + 'href': 'coap:u:p@[::1]:61616/.well-known/r?n=Temperature', + 'protocol': 'coap:', + 'auth': 'u:p', + 'hostname': '::1', + 'port': '61616', + 'pathname': '/.well-known/r', + 'search': 'n=Temperature' + }, + 'coap:[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:61616/s/stopButton': { + 'href': 'coap:[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:61616/s/stopButton', + 'protocol': 'coap', + 'host': '[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:61616', + 'pathname': '/s/stopButton' + }, + + // encode context-specific delimiters in path and query, but do not touch + // other non-delimiter chars like `%`. + // + + // `#`,`?` in path + '/path/to/%%23%3F+=&.txt?foo=theA1#bar' : { + href : '/path/to/%%23%3F+=&.txt?foo=theA1#bar', + pathname: '/path/to/%#?+=&.txt', + query: { + foo: 'theA1' + }, + hash: "#bar" + }, + + // `#`,`?` in path + `#` in query + '/path/to/%%23%3F+=&.txt?foo=the%231#bar' : { + href : '/path/to/%%23%3F+=&.txt?foo=the%231#bar', + pathname: '/path/to/%#?+=&.txt', + query: { + foo: 'the#1' + }, + hash: "#bar" + }, + + // `?` and `#` in path and search + 'http://ex.com/foo%3F100%m%23r?abc=the%231?&foo=bar#frag': { + href: 'http://ex.com/foo%3F100%m%23r?abc=the%231?&foo=bar#frag', + protocol: 'http:', + hostname: 'ex.com', + hash: '#frag', + search: '?abc=the#1?&foo=bar', + pathname: '/foo?100%m#r', + }, + + // `?` and `#` in search only + 'http://ex.com/fooA100%mBr?abc=the%231?&foo=bar#frag': { + href: 'http://ex.com/fooA100%mBr?abc=the%231?&foo=bar#frag', + protocol: 'http:', + hostname: 'ex.com', + hash: '#frag', + search: '?abc=the#1?&foo=bar', + pathname: '/fooA100%mBr', + } +}; + +Object.keys(formatTests).forEach(function(u) { + test('format(' + u + ')', function() { + var expect = formatTests[u].href; + delete formatTests[u].href; + var actual = url.format(u); + var actualObj = url.format(formatTests[u]); + assert.equal(actual, expect, + 'wonky format(' + u + ') == ' + expect + + '\nactual:' + actual); + assert.equal(actualObj, expect, + 'wonky format(' + JSON.stringify(formatTests[u]) + + ') == ' + expect + + '\nactual: ' + actualObj); + }); +}); + +/* + [from, path, expected] +*/ +var relativeTests = [ + ['/foo/bar/baz', 'quux', '/foo/bar/quux'], + ['/foo/bar/baz', 'quux/asdf', '/foo/bar/quux/asdf'], + ['/foo/bar/baz', 'quux/baz', '/foo/bar/quux/baz'], + ['/foo/bar/baz', '../quux/baz', '/foo/quux/baz'], + ['/foo/bar/baz', '/bar', '/bar'], + ['/foo/bar/baz/', 'quux', '/foo/bar/baz/quux'], + ['/foo/bar/baz/', 'quux/baz', '/foo/bar/baz/quux/baz'], + ['/foo/bar/baz', '../../../../../../../../quux/baz', '/quux/baz'], + ['/foo/bar/baz', '../../../../../../../quux/baz', '/quux/baz'], + ['/foo', '.', '/'], + ['/foo', '..', '/'], + ['/foo/', '.', '/foo/'], + ['/foo/', '..', '/'], + ['/foo/bar', '.', '/foo/'], + ['/foo/bar', '..', '/'], + ['/foo/bar/', '.', '/foo/bar/'], + ['/foo/bar/', '..', '/foo/'], + ['foo/bar', '../../../baz', '../../baz'], + ['foo/bar/', '../../../baz', '../baz'], + ['http://example.com/b//c//d;p?q#blarg', 'https:#hash2', 'https:///#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'https:/p/a/t/h?s#hash2', + 'https://p/a/t/h?s#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'https://u:p@h.com/p/a/t/h?s#hash2', + 'https://u:p@h.com/p/a/t/h?s#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'https:/a/b/c/d', + 'https://a/b/c/d'], + ['http://example.com/b//c//d;p?q#blarg', + 'http:#hash2', + 'http://example.com/b//c//d;p?q#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'http:/p/a/t/h?s#hash2', + 'http://example.com/p/a/t/h?s#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'http://u:p@h.com/p/a/t/h?s#hash2', + 'http://u:p@h.com/p/a/t/h?s#hash2'], + ['http://example.com/b//c//d;p?q#blarg', + 'http:/a/b/c/d', + 'http://example.com/a/b/c/d'], + ['/foo/bar/baz', '/../etc/passwd', '/etc/passwd'] +]; + +relativeTests.forEach(function(relativeTest) { + test('resolve(' + [relativeTest[0], relativeTest[1]] + ')', function() { + var a = url.resolve(relativeTest[0], relativeTest[1]), + e = relativeTest[2]; + assert.equal(a, e, + 'resolve(' + [relativeTest[0], relativeTest[1]] + ') == ' + e + + '\n actual=' + a); + }); +}); + + +// https://github.com/joyent/node/issues/568 +[ + undefined, + null, + true, + false, + 0.0, + 0, + [], + {} +].forEach(function(val) { + test('parse(' + val + ')', function() { + assert.throws(function() { url.parse(val); }, TypeError); + }); +}); + + +// +// Tests below taken from Chiron +// http://code.google.com/p/chironjs/source/browse/trunk/src/test/http/url.js +// +// Copyright (c) 2002-2008 Kris Kowal +// used with permission under MIT License +// +// Changes marked with @isaacs + +var bases = [ + 'http://a/b/c/d;p?q', + 'http://a/b/c/d;p?q=1/2', + 'http://a/b/c/d;p=1/2?q', + 'fred:///s//a/b/c', + 'http:///s//a/b/c' +]; + +//[to, from, result] +var relativeTests2 = [ + // http://lists.w3.org/Archives/Public/uri/2004Feb/0114.html + ['../c', 'foo:a/b', 'foo:c'], + ['foo:.', 'foo:a', 'foo:'], + ['/foo/../../../bar', 'zz:abc', 'zz:/bar'], + ['/foo/../bar', 'zz:abc', 'zz:/bar'], + // @isaacs Disagree. Not how web browsers resolve this. + ['foo/../../../bar', 'zz:abc', 'zz:bar'], + // ['foo/../../../bar', 'zz:abc', 'zz:../../bar'], // @isaacs Added + ['foo/../bar', 'zz:abc', 'zz:bar'], + ['zz:.', 'zz:abc', 'zz:'], + ['/.', bases[0], 'http://a/'], + ['/.foo', bases[0], 'http://a/.foo'], + ['.foo', bases[0], 'http://a/b/c/.foo'], + + // http://gbiv.com/protocols/uri/test/rel_examples1.html + // examples from RFC 2396 + ['g:h', bases[0], 'g:h'], + ['g', bases[0], 'http://a/b/c/g'], + ['./g', bases[0], 'http://a/b/c/g'], + ['g/', bases[0], 'http://a/b/c/g/'], + ['/g', bases[0], 'http://a/g'], + ['//g', bases[0], 'http://g/'], + // changed with RFC 2396bis + //('?y', bases[0], 'http://a/b/c/d;p?y'], + ['?y', bases[0], 'http://a/b/c/d;p?y'], + ['g?y', bases[0], 'http://a/b/c/g?y'], + // changed with RFC 2396bis + //('#s', bases[0], CURRENT_DOC_URI + '#s'], + ['#s', bases[0], 'http://a/b/c/d;p?q#s'], + ['g#s', bases[0], 'http://a/b/c/g#s'], + ['g?y#s', bases[0], 'http://a/b/c/g?y#s'], + [';x', bases[0], 'http://a/b/c/;x'], + ['g;x', bases[0], 'http://a/b/c/g;x'], + ['g;x?y#s' , bases[0], 'http://a/b/c/g;x?y#s'], + // changed with RFC 2396bis + //('', bases[0], CURRENT_DOC_URI], + ['', bases[0], 'http://a/b/c/d;p?q'], + ['.', bases[0], 'http://a/b/c/'], + ['./', bases[0], 'http://a/b/c/'], + ['..', bases[0], 'http://a/b/'], + ['../', bases[0], 'http://a/b/'], + ['../g', bases[0], 'http://a/b/g'], + ['../..', bases[0], 'http://a/'], + ['../../', bases[0], 'http://a/'], + ['../../g' , bases[0], 'http://a/g'], + ['../../../g', bases[0], ('http://a/../g', 'http://a/g')], + ['../../../../g', bases[0], ('http://a/../../g', 'http://a/g')], + // changed with RFC 2396bis + //('/./g', bases[0], 'http://a/./g'], + ['/./g', bases[0], 'http://a/g'], + // changed with RFC 2396bis + //('/../g', bases[0], 'http://a/../g'], + ['/../g', bases[0], 'http://a/g'], + ['g.', bases[0], 'http://a/b/c/g.'], + ['.g', bases[0], 'http://a/b/c/.g'], + ['g..', bases[0], 'http://a/b/c/g..'], + ['..g', bases[0], 'http://a/b/c/..g'], + ['./../g', bases[0], 'http://a/b/g'], + ['./g/.', bases[0], 'http://a/b/c/g/'], + ['g/./h', bases[0], 'http://a/b/c/g/h'], + ['g/../h', bases[0], 'http://a/b/c/h'], + ['g;x=1/./y', bases[0], 'http://a/b/c/g;x=1/y'], + ['g;x=1/../y', bases[0], 'http://a/b/c/y'], + ['g?y/./x', bases[0], 'http://a/b/c/g?y/./x'], + ['g?y/../x', bases[0], 'http://a/b/c/g?y/../x'], + ['g#s/./x', bases[0], 'http://a/b/c/g#s/./x'], + ['g#s/../x', bases[0], 'http://a/b/c/g#s/../x'], + ['http:g', bases[0], ('http:g', 'http://a/b/c/g')], + ['http:', bases[0], ('http:', bases[0])], + // not sure where this one originated + ['/a/b/c/./../../g', bases[0], 'http://a/a/g'], + + // http://gbiv.com/protocols/uri/test/rel_examples2.html + // slashes in base URI's query args + ['g', bases[1], 'http://a/b/c/g'], + ['./g', bases[1], 'http://a/b/c/g'], + ['g/', bases[1], 'http://a/b/c/g/'], + ['/g', bases[1], 'http://a/g'], + ['//g', bases[1], 'http://g/'], + // changed in RFC 2396bis + //('?y', bases[1], 'http://a/b/c/?y'], + ['?y', bases[1], 'http://a/b/c/d;p?y'], + ['g?y', bases[1], 'http://a/b/c/g?y'], + ['g?y/./x' , bases[1], 'http://a/b/c/g?y/./x'], + ['g?y/../x', bases[1], 'http://a/b/c/g?y/../x'], + ['g#s', bases[1], 'http://a/b/c/g#s'], + ['g#s/./x' , bases[1], 'http://a/b/c/g#s/./x'], + ['g#s/../x', bases[1], 'http://a/b/c/g#s/../x'], + ['./', bases[1], 'http://a/b/c/'], + ['../', bases[1], 'http://a/b/'], + ['../g', bases[1], 'http://a/b/g'], + ['../../', bases[1], 'http://a/'], + ['../../g' , bases[1], 'http://a/g'], + + // http://gbiv.com/protocols/uri/test/rel_examples3.html + // slashes in path params + // all of these changed in RFC 2396bis + ['g', bases[2], 'http://a/b/c/d;p=1/g'], + ['./g', bases[2], 'http://a/b/c/d;p=1/g'], + ['g/', bases[2], 'http://a/b/c/d;p=1/g/'], + ['g?y', bases[2], 'http://a/b/c/d;p=1/g?y'], + [';x', bases[2], 'http://a/b/c/d;p=1/;x'], + ['g;x', bases[2], 'http://a/b/c/d;p=1/g;x'], + ['g;x=1/./y', bases[2], 'http://a/b/c/d;p=1/g;x=1/y'], + ['g;x=1/../y', bases[2], 'http://a/b/c/d;p=1/y'], + ['./', bases[2], 'http://a/b/c/d;p=1/'], + ['../', bases[2], 'http://a/b/c/'], + ['../g', bases[2], 'http://a/b/c/g'], + ['../../', bases[2], 'http://a/b/'], + ['../../g' , bases[2], 'http://a/b/g'], + + // http://gbiv.com/protocols/uri/test/rel_examples4.html + // double and triple slash, unknown scheme + ['g:h', bases[3], 'g:h'], + ['g', bases[3], 'fred:///s//a/b/g'], + ['./g', bases[3], 'fred:///s//a/b/g'], + ['g/', bases[3], 'fred:///s//a/b/g/'], + ['/g', bases[3], 'fred:///g'], // may change to fred:///s//a/g + ['//g', bases[3], 'fred://g'], // may change to fred:///s//g + ['//g/x', bases[3], 'fred://g/x'], // may change to fred:///s//g/x + ['///g', bases[3], 'fred:///g'], + ['./', bases[3], 'fred:///s//a/b/'], + ['../', bases[3], 'fred:///s//a/'], + ['../g', bases[3], 'fred:///s//a/g'], + + ['../../', bases[3], 'fred:///s//'], + ['../../g' , bases[3], 'fred:///s//g'], + ['../../../g', bases[3], 'fred:///s/g'], + // may change to fred:///s//a/../../../g + ['../../../../g', bases[3], 'fred:///g'], + + // http://gbiv.com/protocols/uri/test/rel_examples5.html + // double and triple slash, well-known scheme + ['g:h', bases[4], 'g:h'], + ['g', bases[4], 'http:///s//a/b/g'], + ['./g', bases[4], 'http:///s//a/b/g'], + ['g/', bases[4], 'http:///s//a/b/g/'], + ['/g', bases[4], 'http:///g'], // may change to http:///s//a/g + ['//g', bases[4], 'http://g/'], // may change to http:///s//g + ['//g/x', bases[4], 'http://g/x'], // may change to http:///s//g/x + ['///g', bases[4], 'http:///g'], + ['./', bases[4], 'http:///s//a/b/'], + ['../', bases[4], 'http:///s//a/'], + ['../g', bases[4], 'http:///s//a/g'], + ['../../', bases[4], 'http:///s//'], + ['../../g' , bases[4], 'http:///s//g'], + // may change to http:///s//a/../../g + ['../../../g', bases[4], 'http:///s/g'], + // may change to http:///s//a/../../../g + ['../../../../g', bases[4], 'http:///g'], + + // from Dan Connelly's tests in http://www.w3.org/2000/10/swap/uripath.py + ['bar:abc', 'foo:xyz', 'bar:abc'], + ['../abc', 'http://example/x/y/z', 'http://example/x/abc'], + ['http://example/x/abc', 'http://example2/x/y/z', 'http://example/x/abc'], + ['../r', 'http://ex/x/y/z', 'http://ex/x/r'], + ['q/r', 'http://ex/x/y', 'http://ex/x/q/r'], + ['q/r#s', 'http://ex/x/y', 'http://ex/x/q/r#s'], + ['q/r#s/t', 'http://ex/x/y', 'http://ex/x/q/r#s/t'], + ['ftp://ex/x/q/r', 'http://ex/x/y', 'ftp://ex/x/q/r'], + ['', 'http://ex/x/y', 'http://ex/x/y'], + ['', 'http://ex/x/y/', 'http://ex/x/y/'], + ['', 'http://ex/x/y/pdq', 'http://ex/x/y/pdq'], + ['z/', 'http://ex/x/y/', 'http://ex/x/y/z/'], + ['#Animal', + 'file:/swap/test/animal.rdf', + 'file:/swap/test/animal.rdf#Animal'], + ['../abc', 'file:/e/x/y/z', 'file:/e/x/abc'], + ['/example/x/abc', 'file:/example2/x/y/z', 'file:/example/x/abc'], + ['../r', 'file:/ex/x/y/z', 'file:/ex/x/r'], + ['/r', 'file:/ex/x/y/z', 'file:/r'], + ['q/r', 'file:/ex/x/y', 'file:/ex/x/q/r'], + ['q/r#s', 'file:/ex/x/y', 'file:/ex/x/q/r#s'], + ['q/r#', 'file:/ex/x/y', 'file:/ex/x/q/r#'], + ['q/r#s/t', 'file:/ex/x/y', 'file:/ex/x/q/r#s/t'], + ['ftp://ex/x/q/r', 'file:/ex/x/y', 'ftp://ex/x/q/r'], + ['', 'file:/ex/x/y', 'file:/ex/x/y'], + ['', 'file:/ex/x/y/', 'file:/ex/x/y/'], + ['', 'file:/ex/x/y/pdq', 'file:/ex/x/y/pdq'], + ['z/', 'file:/ex/x/y/', 'file:/ex/x/y/z/'], + ['file://meetings.example.com/cal#m1', + 'file:/devel/WWW/2000/10/swap/test/reluri-1.n3', + 'file://meetings.example.com/cal#m1'], + ['file://meetings.example.com/cal#m1', + 'file:/home/connolly/w3ccvs/WWW/2000/10/swap/test/reluri-1.n3', + 'file://meetings.example.com/cal#m1'], + ['./#blort', 'file:/some/dir/foo', 'file:/some/dir/#blort'], + ['./#', 'file:/some/dir/foo', 'file:/some/dir/#'], + // Ryan Lee + ['./', 'http://example/x/abc.efg', 'http://example/x/'], + + + // Graham Klyne's tests + // http://www.ninebynine.org/Software/HaskellUtils/Network/UriTest.xls + // 01-31 are from Connelly's cases + + // 32-49 + ['./q:r', 'http://ex/x/y', 'http://ex/x/q:r'], + ['./p=q:r', 'http://ex/x/y', 'http://ex/x/p=q:r'], + ['?pp/rr', 'http://ex/x/y?pp/qq', 'http://ex/x/y?pp/rr'], + ['y/z', 'http://ex/x/y?pp/qq', 'http://ex/x/y/z'], + ['local/qual@domain.org#frag', + 'mailto:local', + 'mailto:local/qual@domain.org#frag'], + ['more/qual2@domain2.org#frag', + 'mailto:local/qual1@domain1.org', + 'mailto:local/more/qual2@domain2.org#frag'], + ['y?q', 'http://ex/x/y?q', 'http://ex/x/y?q'], + ['/x/y?q', 'http://ex?p', 'http://ex/x/y?q'], + ['c/d', 'foo:a/b', 'foo:a/c/d'], + ['/c/d', 'foo:a/b', 'foo:/c/d'], + ['', 'foo:a/b?c#d', 'foo:a/b?c'], + ['b/c', 'foo:a', 'foo:b/c'], + ['../b/c', 'foo:/a/y/z', 'foo:/a/b/c'], + ['./b/c', 'foo:a', 'foo:b/c'], + ['/./b/c', 'foo:a', 'foo:/b/c'], + ['../../d', 'foo://a//b/c', 'foo://a/d'], + ['.', 'foo:a', 'foo:'], + ['..', 'foo:a', 'foo:'], + + // 50-57[cf. TimBL comments -- + // http://lists.w3.org/Archives/Public/uri/2003Feb/0028.html, + // http://lists.w3.org/Archives/Public/uri/2003Jan/0008.html) + ['abc', 'http://example/x/y%2Fz', 'http://example/x/abc'], + ['../../x%2Fabc', 'http://example/a/x/y/z', 'http://example/a/x%2Fabc'], + ['../x%2Fabc', 'http://example/a/x/y%2Fz', 'http://example/a/x%2Fabc'], + ['abc', 'http://example/x%2Fy/z', 'http://example/x%2Fy/abc'], + ['q%3Ar', 'http://ex/x/y', 'http://ex/x/q%3Ar'], + ['/x%2Fabc', 'http://example/x/y%2Fz', 'http://example/x%2Fabc'], + ['/x%2Fabc', 'http://example/x/y/z', 'http://example/x%2Fabc'], + ['/x%2Fabc', 'http://example/x/y%2Fz', 'http://example/x%2Fabc'], + + // 70-77 + ['local2@domain2', 'mailto:local1@domain1?query1', 'mailto:local2@domain2'], + ['local2@domain2?query2', + 'mailto:local1@domain1', + 'mailto:local2@domain2?query2'], + ['local2@domain2?query2', + 'mailto:local1@domain1?query1', + 'mailto:local2@domain2?query2'], + ['?query2', 'mailto:local@domain?query1', 'mailto:local@domain?query2'], + ['local@domain?query2', 'mailto:?query1', 'mailto:local@domain?query2'], + ['?query2', 'mailto:local@domain?query1', 'mailto:local@domain?query2'], + ['http://example/a/b?c/../d', 'foo:bar', 'http://example/a/b?c/../d'], + ['http://example/a/b#c/../d', 'foo:bar', 'http://example/a/b#c/../d'], + + // 82-88 + // @isaacs Disagree. Not how browsers do it. + // ['http:this', 'http://example.org/base/uri', 'http:this'], + // @isaacs Added + ['http:this', 'http://example.org/base/uri', 'http://example.org/base/this'], + ['http:this', 'http:base', 'http:this'], + ['.//g', 'f:/a', 'f://g'], + ['b/c//d/e', 'f://example.org/base/a', 'f://example.org/base/b/c//d/e'], + ['m2@example.ord/c2@example.org', + 'mid:m@example.ord/c@example.org', + 'mid:m@example.ord/m2@example.ord/c2@example.org'], + ['mini1.xml', + 'file:///C:/DEV/Haskell/lib/HXmlToolbox-3.01/examples/', + 'file:///C:/DEV/Haskell/lib/HXmlToolbox-3.01/examples/mini1.xml'], + ['../b/c', 'foo:a/y/z', 'foo:a/b/c'], + + //changeing auth + ['http://diff:auth@www.example.com', + 'http://asdf:qwer@www.example.com', + 'http://diff:auth@www.example.com/'] +]; + +relativeTests2.forEach(function(relativeTest) { + test('resolve(' + [relativeTest[1], relativeTest[0]] + ')', function() { + var a = url.resolve(relativeTest[1], relativeTest[0]), + e = relativeTest[2]; + assert.equal(a, e, + 'resolve(' + [relativeTest[1], relativeTest[0]] + ') == ' + e + + '\n actual=' + a); + }); +}); + +//if format and parse are inverse operations then +//resolveObject(parse(x), y) == parse(resolve(x, y)) + +//host and hostname are special, in this case a '' value is important +var emptyIsImportant = {'host': true, 'hostname': ''}; + +//format: [from, path, expected] +relativeTests.forEach(function(relativeTest) { +test('resolveObject(' + [relativeTest[0], relativeTest[1]] + ')', function() { + var actual = url.resolveObject(url.parse(relativeTest[0]), relativeTest[1]), + expected = url.parse(relativeTest[2]); + + + assert.deepEqual(actual, expected); + + expected = relativeTest[2]; + actual = url.format(actual); + + assert.equal(actual, expected, + 'format(' + actual + ') == ' + expected + '\nactual:' + actual); + }); +}); + +//format: [to, from, result] +// the test: ['.//g', 'f:/a', 'f://g'] is a fundamental problem +// url.parse('f:/a') does not have a host +// url.resolve('f:/a', './/g') does not have a host because you have moved +// down to the g directory. i.e. f: //g, however when this url is parsed +// f:// will indicate that the host is g which is not the case. +// it is unclear to me how to keep this information from being lost +// it may be that a pathname of ////g should collapse to /g but this seems +// to be a lot of work for an edge case. Right now I remove the test +if (relativeTests2[181][0] === './/g' && + relativeTests2[181][1] === 'f:/a' && + relativeTests2[181][2] === 'f://g') { + relativeTests2.splice(181, 1); +} + +relativeTests2.forEach(function(relativeTest) { + test('resolveObject(' + [relativeTest[1], relativeTest[0]] + ')', function() { + var actual = url.resolveObject(url.parse(relativeTest[1]), relativeTest[0]), + expected = url.parse(relativeTest[2]); + + assert.deepEqual(actual, expected); + + var expected = relativeTest[2], + actual = url.format(actual); + + assert.equal(actual, expected, + 'format(' + relativeTest[1] + ') == ' + expected + + '\nactual:' + actual); + }); +}); diff --git a/node_modules/url/url.js b/node_modules/url/url.js new file mode 100644 index 000000000..23ac6f5db --- /dev/null +++ b/node_modules/url/url.js @@ -0,0 +1,732 @@ +// 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. + +'use strict'; + +var punycode = require('punycode'); +var util = require('./util'); + +exports.parse = urlParse; +exports.resolve = urlResolve; +exports.resolveObject = urlResolveObject; +exports.format = urlFormat; + +exports.Url = Url; + +function Url() { + this.protocol = null; + this.slashes = null; + this.auth = null; + this.host = null; + this.port = null; + this.hostname = null; + this.hash = null; + this.search = null; + this.query = null; + this.pathname = null; + this.path = null; + this.href = null; +} + +// Reference: RFC 3986, RFC 1808, RFC 2396 + +// define these here so at least they only have to be +// compiled once on the first module load. +var protocolPattern = /^([a-z0-9.+-]+:)/i, + portPattern = /:[0-9]*$/, + + // Special case for a simple path URL + simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, + + // RFC 2396: characters reserved for delimiting URLs. + // We actually just auto-escape these. + delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], + + // RFC 2396: characters not allowed for various reasons. + unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), + + // Allowed by RFCs, but cause of XSS attacks. Always escape these. + autoEscape = ['\''].concat(unwise), + // Characters that are never ever allowed in a hostname. + // Note that any invalid chars are also handled, but these + // are the ones that are *expected* to be seen, so we fast-path + // them. + nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), + hostEndingChars = ['/', '?', '#'], + hostnameMaxLen = 255, + hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, + hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, + // protocols that can allow "unsafe" and "unwise" chars. + unsafeProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that never have a hostname. + hostlessProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that always contain a // bit. + slashedProtocol = { + 'http': true, + 'https': true, + 'ftp': true, + 'gopher': true, + 'file': true, + 'http:': true, + 'https:': true, + 'ftp:': true, + 'gopher:': true, + 'file:': true + }, + querystring = require('querystring'); + +function urlParse(url, parseQueryString, slashesDenoteHost) { + if (url && util.isObject(url) && url instanceof Url) return url; + + var u = new Url; + u.parse(url, parseQueryString, slashesDenoteHost); + return u; +} + +Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { + if (!util.isString(url)) { + throw new TypeError("Parameter 'url' must be a string, not " + typeof url); + } + + // Copy chrome, IE, opera backslash-handling behavior. + // Back slashes before the query string get converted to forward slashes + // See: https://code.google.com/p/chromium/issues/detail?id=25916 + var queryIndex = url.indexOf('?'), + splitter = + (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', + uSplit = url.split(splitter), + slashRegex = /\\/g; + uSplit[0] = uSplit[0].replace(slashRegex, '/'); + url = uSplit.join(splitter); + + var rest = url; + + // trim before proceeding. + // This is to support parse stuff like " http://foo.com \n" + rest = rest.trim(); + + if (!slashesDenoteHost && url.split('#').length === 1) { + // Try fast path regexp + var simplePath = simplePathPattern.exec(rest); + if (simplePath) { + this.path = rest; + this.href = rest; + this.pathname = simplePath[1]; + if (simplePath[2]) { + this.search = simplePath[2]; + if (parseQueryString) { + this.query = querystring.parse(this.search.substr(1)); + } else { + this.query = this.search.substr(1); + } + } else if (parseQueryString) { + this.search = ''; + this.query = {}; + } + return this; + } + } + + var proto = protocolPattern.exec(rest); + if (proto) { + proto = proto[0]; + var lowerProto = proto.toLowerCase(); + this.protocol = lowerProto; + rest = rest.substr(proto.length); + } + + // figure out if it's got a host + // user@server is *always* interpreted as a hostname, and url + // resolution will treat //foo/bar as host=foo,path=bar because that's + // how the browser resolves relative URLs. + if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { + var slashes = rest.substr(0, 2) === '//'; + if (slashes && !(proto && hostlessProtocol[proto])) { + rest = rest.substr(2); + this.slashes = true; + } + } + + if (!hostlessProtocol[proto] && + (slashes || (proto && !slashedProtocol[proto]))) { + + // there's a hostname. + // the first instance of /, ?, ;, or # ends the host. + // + // If there is an @ in the hostname, then non-host chars *are* allowed + // to the left of the last @ sign, unless some host-ending character + // comes *before* the @-sign. + // URLs are obnoxious. + // + // ex: + // http://a@b@c/ => user:a@b host:c + // http://a@b?@c => user:a host:c path:/?@c + + // v0.12 TODO(isaacs): This is not quite how Chrome does things. + // Review our test case against browsers more comprehensively. + + // find the first instance of any hostEndingChars + var hostEnd = -1; + for (var i = 0; i < hostEndingChars.length; i++) { + var hec = rest.indexOf(hostEndingChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + + // at this point, either we have an explicit point where the + // auth portion cannot go past, or the last @ char is the decider. + var auth, atSign; + if (hostEnd === -1) { + // atSign can be anywhere. + atSign = rest.lastIndexOf('@'); + } else { + // atSign must be in auth portion. + // http://a@b/c@d => host:b auth:a path:/c@d + atSign = rest.lastIndexOf('@', hostEnd); + } + + // Now we have a portion which is definitely the auth. + // Pull that off. + if (atSign !== -1) { + auth = rest.slice(0, atSign); + rest = rest.slice(atSign + 1); + this.auth = decodeURIComponent(auth); + } + + // the host is the remaining to the left of the first non-host char + hostEnd = -1; + for (var i = 0; i < nonHostChars.length; i++) { + var hec = rest.indexOf(nonHostChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + // if we still have not hit it, then the entire thing is a host. + if (hostEnd === -1) + hostEnd = rest.length; + + this.host = rest.slice(0, hostEnd); + rest = rest.slice(hostEnd); + + // pull out port. + this.parseHost(); + + // we've indicated that there is a hostname, + // so even if it's empty, it has to be present. + this.hostname = this.hostname || ''; + + // if hostname begins with [ and ends with ] + // assume that it's an IPv6 address. + var ipv6Hostname = this.hostname[0] === '[' && + this.hostname[this.hostname.length - 1] === ']'; + + // validate a little. + if (!ipv6Hostname) { + var hostparts = this.hostname.split(/\./); + for (var i = 0, l = hostparts.length; i < l; i++) { + var part = hostparts[i]; + if (!part) continue; + if (!part.match(hostnamePartPattern)) { + var newpart = ''; + for (var j = 0, k = part.length; j < k; j++) { + if (part.charCodeAt(j) > 127) { + // we replace non-ASCII char with a temporary placeholder + // we need this to make sure size of hostname is not + // broken by replacing non-ASCII by nothing + newpart += 'x'; + } else { + newpart += part[j]; + } + } + // we test again with ASCII char only + if (!newpart.match(hostnamePartPattern)) { + var validParts = hostparts.slice(0, i); + var notHost = hostparts.slice(i + 1); + var bit = part.match(hostnamePartStart); + if (bit) { + validParts.push(bit[1]); + notHost.unshift(bit[2]); + } + if (notHost.length) { + rest = '/' + notHost.join('.') + rest; + } + this.hostname = validParts.join('.'); + break; + } + } + } + } + + if (this.hostname.length > hostnameMaxLen) { + this.hostname = ''; + } else { + // hostnames are always lower case. + this.hostname = this.hostname.toLowerCase(); + } + + if (!ipv6Hostname) { + // IDNA Support: Returns a punycoded representation of "domain". + // It only converts parts of the domain name that + // have non-ASCII characters, i.e. it doesn't matter if + // you call it with a domain that already is ASCII-only. + this.hostname = punycode.toASCII(this.hostname); + } + + var p = this.port ? ':' + this.port : ''; + var h = this.hostname || ''; + this.host = h + p; + this.href += this.host; + + // strip [ and ] from the hostname + // the host field still retains them, though + if (ipv6Hostname) { + this.hostname = this.hostname.substr(1, this.hostname.length - 2); + if (rest[0] !== '/') { + rest = '/' + rest; + } + } + } + + // now rest is set to the post-host stuff. + // chop off any delim chars. + if (!unsafeProtocol[lowerProto]) { + + // First, make 100% sure that any "autoEscape" chars get + // escaped, even if encodeURIComponent doesn't think they + // need to be. + for (var i = 0, l = autoEscape.length; i < l; i++) { + var ae = autoEscape[i]; + if (rest.indexOf(ae) === -1) + continue; + var esc = encodeURIComponent(ae); + if (esc === ae) { + esc = escape(ae); + } + rest = rest.split(ae).join(esc); + } + } + + + // chop off from the tail first. + var hash = rest.indexOf('#'); + if (hash !== -1) { + // got a fragment string. + this.hash = rest.substr(hash); + rest = rest.slice(0, hash); + } + var qm = rest.indexOf('?'); + if (qm !== -1) { + this.search = rest.substr(qm); + this.query = rest.substr(qm + 1); + if (parseQueryString) { + this.query = querystring.parse(this.query); + } + rest = rest.slice(0, qm); + } else if (parseQueryString) { + // no query string, but parseQueryString still requested + this.search = ''; + this.query = {}; + } + if (rest) this.pathname = rest; + if (slashedProtocol[lowerProto] && + this.hostname && !this.pathname) { + this.pathname = '/'; + } + + //to support http.request + if (this.pathname || this.search) { + var p = this.pathname || ''; + var s = this.search || ''; + this.path = p + s; + } + + // finally, reconstruct the href based on what has been validated. + this.href = this.format(); + return this; +}; + +// format a parsed object into a url string +function urlFormat(obj) { + // ensure it's an object, and not a string url. + // If it's an obj, this is a no-op. + // this way, you can call url_format() on strings + // to clean up potentially wonky urls. + if (util.isString(obj)) obj = urlParse(obj); + if (!(obj instanceof Url)) return Url.prototype.format.call(obj); + return obj.format(); +} + +Url.prototype.format = function() { + var auth = this.auth || ''; + if (auth) { + auth = encodeURIComponent(auth); + auth = auth.replace(/%3A/i, ':'); + auth += '@'; + } + + var protocol = this.protocol || '', + pathname = this.pathname || '', + hash = this.hash || '', + host = false, + query = ''; + + if (this.host) { + host = auth + this.host; + } else if (this.hostname) { + host = auth + (this.hostname.indexOf(':') === -1 ? + this.hostname : + '[' + this.hostname + ']'); + if (this.port) { + host += ':' + this.port; + } + } + + if (this.query && + util.isObject(this.query) && + Object.keys(this.query).length) { + query = querystring.stringify(this.query); + } + + var search = this.search || (query && ('?' + query)) || ''; + + if (protocol && protocol.substr(-1) !== ':') protocol += ':'; + + // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. + // unless they had them to begin with. + if (this.slashes || + (!protocol || slashedProtocol[protocol]) && host !== false) { + host = '//' + (host || ''); + if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; + } else if (!host) { + host = ''; + } + + if (hash && hash.charAt(0) !== '#') hash = '#' + hash; + if (search && search.charAt(0) !== '?') search = '?' + search; + + pathname = pathname.replace(/[?#]/g, function(match) { + return encodeURIComponent(match); + }); + search = search.replace('#', '%23'); + + return protocol + host + pathname + search + hash; +}; + +function urlResolve(source, relative) { + return urlParse(source, false, true).resolve(relative); +} + +Url.prototype.resolve = function(relative) { + return this.resolveObject(urlParse(relative, false, true)).format(); +}; + +function urlResolveObject(source, relative) { + if (!source) return relative; + return urlParse(source, false, true).resolveObject(relative); +} + +Url.prototype.resolveObject = function(relative) { + if (util.isString(relative)) { + var rel = new Url(); + rel.parse(relative, false, true); + relative = rel; + } + + var result = new Url(); + var tkeys = Object.keys(this); + for (var tk = 0; tk < tkeys.length; tk++) { + var tkey = tkeys[tk]; + result[tkey] = this[tkey]; + } + + // hash is always overridden, no matter what. + // even href="" will remove it. + result.hash = relative.hash; + + // if the relative url is empty, then there's nothing left to do here. + if (relative.href === '') { + result.href = result.format(); + return result; + } + + // hrefs like //foo/bar always cut to the protocol. + if (relative.slashes && !relative.protocol) { + // take everything except the protocol from relative + var rkeys = Object.keys(relative); + for (var rk = 0; rk < rkeys.length; rk++) { + var rkey = rkeys[rk]; + if (rkey !== 'protocol') + result[rkey] = relative[rkey]; + } + + //urlParse appends trailing / to urls like http://www.example.com + if (slashedProtocol[result.protocol] && + result.hostname && !result.pathname) { + result.path = result.pathname = '/'; + } + + result.href = result.format(); + return result; + } + + if (relative.protocol && relative.protocol !== result.protocol) { + // if it's a known url protocol, then changing + // the protocol does weird things + // first, if it's not file:, then we MUST have a host, + // and if there was a path + // to begin with, then we MUST have a path. + // if it is file:, then the host is dropped, + // because that's known to be hostless. + // anything else is assumed to be absolute. + if (!slashedProtocol[relative.protocol]) { + var keys = Object.keys(relative); + for (var v = 0; v < keys.length; v++) { + var k = keys[v]; + result[k] = relative[k]; + } + result.href = result.format(); + return result; + } + + result.protocol = relative.protocol; + if (!relative.host && !hostlessProtocol[relative.protocol]) { + var relPath = (relative.pathname || '').split('/'); + while (relPath.length && !(relative.host = relPath.shift())); + if (!relative.host) relative.host = ''; + if (!relative.hostname) relative.hostname = ''; + if (relPath[0] !== '') relPath.unshift(''); + if (relPath.length < 2) relPath.unshift(''); + result.pathname = relPath.join('/'); + } else { + result.pathname = relative.pathname; + } + result.search = relative.search; + result.query = relative.query; + result.host = relative.host || ''; + result.auth = relative.auth; + result.hostname = relative.hostname || relative.host; + result.port = relative.port; + // to support http.request + if (result.pathname || result.search) { + var p = result.pathname || ''; + var s = result.search || ''; + result.path = p + s; + } + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; + } + + var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), + isRelAbs = ( + relative.host || + relative.pathname && relative.pathname.charAt(0) === '/' + ), + mustEndAbs = (isRelAbs || isSourceAbs || + (result.host && relative.pathname)), + removeAllDots = mustEndAbs, + srcPath = result.pathname && result.pathname.split('/') || [], + relPath = relative.pathname && relative.pathname.split('/') || [], + psychotic = result.protocol && !slashedProtocol[result.protocol]; + + // if the url is a non-slashed url, then relative + // links like ../.. should be able + // to crawl up to the hostname, as well. This is strange. + // result.protocol has already been set by now. + // Later on, put the first path part into the host field. + if (psychotic) { + result.hostname = ''; + result.port = null; + if (result.host) { + if (srcPath[0] === '') srcPath[0] = result.host; + else srcPath.unshift(result.host); + } + result.host = ''; + if (relative.protocol) { + relative.hostname = null; + relative.port = null; + if (relative.host) { + if (relPath[0] === '') relPath[0] = relative.host; + else relPath.unshift(relative.host); + } + relative.host = null; + } + mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); + } + + if (isRelAbs) { + // it's absolute. + result.host = (relative.host || relative.host === '') ? + relative.host : result.host; + result.hostname = (relative.hostname || relative.hostname === '') ? + relative.hostname : result.hostname; + result.search = relative.search; + result.query = relative.query; + srcPath = relPath; + // fall through to the dot-handling below. + } else if (relPath.length) { + // it's relative + // throw away the existing file, and take the new path instead. + if (!srcPath) srcPath = []; + srcPath.pop(); + srcPath = srcPath.concat(relPath); + result.search = relative.search; + result.query = relative.query; + } else if (!util.isNullOrUndefined(relative.search)) { + // just pull out the search. + // like href='?foo'. + // Put this after the other two cases because it simplifies the booleans + if (psychotic) { + result.hostname = result.host = srcPath.shift(); + //occationaly the auth can get stuck only in host + //this especially happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + var authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + result.search = relative.search; + result.query = relative.query; + //to support http.request + if (!util.isNull(result.pathname) || !util.isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.href = result.format(); + return result; + } + + if (!srcPath.length) { + // no path at all. easy. + // we've already handled the other stuff above. + result.pathname = null; + //to support http.request + if (result.search) { + result.path = '/' + result.search; + } else { + result.path = null; + } + result.href = result.format(); + return result; + } + + // if a url ENDs in . or .., then it must get a trailing slash. + // however, if it ends in anything else non-slashy, + // then it must NOT get a trailing slash. + var last = srcPath.slice(-1)[0]; + var hasTrailingSlash = ( + (result.host || relative.host || srcPath.length > 1) && + (last === '.' || last === '..') || last === ''); + + // strip single dots, resolve double dots to parent dir + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = srcPath.length; i >= 0; i--) { + last = srcPath[i]; + if (last === '.') { + srcPath.splice(i, 1); + } else if (last === '..') { + srcPath.splice(i, 1); + up++; + } else if (up) { + srcPath.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (!mustEndAbs && !removeAllDots) { + for (; up--; up) { + srcPath.unshift('..'); + } + } + + if (mustEndAbs && srcPath[0] !== '' && + (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { + srcPath.unshift(''); + } + + if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { + srcPath.push(''); + } + + var isAbsolute = srcPath[0] === '' || + (srcPath[0] && srcPath[0].charAt(0) === '/'); + + // put the host back + if (psychotic) { + result.hostname = result.host = isAbsolute ? '' : + srcPath.length ? srcPath.shift() : ''; + //occationaly the auth can get stuck only in host + //this especially happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + var authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + + mustEndAbs = mustEndAbs || (result.host && srcPath.length); + + if (mustEndAbs && !isAbsolute) { + srcPath.unshift(''); + } + + if (!srcPath.length) { + result.pathname = null; + result.path = null; + } else { + result.pathname = srcPath.join('/'); + } + + //to support request.http + if (!util.isNull(result.pathname) || !util.isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.auth = relative.auth || result.auth; + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; +}; + +Url.prototype.parseHost = function() { + var host = this.host; + var port = portPattern.exec(host); + if (port) { + port = port[0]; + if (port !== ':') { + this.port = port.substr(1); + } + host = host.substr(0, host.length - port.length); + } + if (host) this.hostname = host; +}; diff --git a/node_modules/url/util.js b/node_modules/url/util.js new file mode 100644 index 000000000..97dcf31cd --- /dev/null +++ b/node_modules/url/util.js @@ -0,0 +1,16 @@ +'use strict'; + +module.exports = { + isString: function(arg) { + return typeof(arg) === 'string'; + }, + isObject: function(arg) { + return typeof(arg) === 'object' && arg !== null; + }, + isNull: function(arg) { + return arg === null; + }, + isNullOrUndefined: function(arg) { + return arg == null; + } +}; diff --git a/node_modules/use/LICENSE b/node_modules/use/LICENSE new file mode 100644 index 000000000..7cccaf9e3 --- /dev/null +++ b/node_modules/use/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-present, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/use/README.md b/node_modules/use/README.md new file mode 100644 index 000000000..59b1dbd82 --- /dev/null +++ b/node_modules/use/README.md @@ -0,0 +1,90 @@ +# use [![NPM version](https://img.shields.io/npm/v/use.svg?style=flat)](https://www.npmjs.com/package/use) [![NPM monthly downloads](https://img.shields.io/npm/dm/use.svg?style=flat)](https://npmjs.org/package/use) [![NPM total downloads](https://img.shields.io/npm/dt/use.svg?style=flat)](https://npmjs.org/package/use) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/use.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/use) + +> Easily add plugin support to your node.js application. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save use +``` + +A different take on plugin handling! This is not a middleware system, if you need something that handles async middleware, [ware](https://github.com/segmentio/ware) is great for that. + +## Usage + +```js +const use = require('use'); +``` + +See the [examples folder](./examples) for usage examples. + +## About + +
    +Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
    + +
    +Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
    + +
    +Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
    + +### Related projects + +You might also be interested in these projects: + +* [base-plugins](https://www.npmjs.com/package/base-plugins): Adds 'smart plugin' support to your base application. | [homepage](https://github.com/node-base/base-plugins "Adds 'smart plugin' support to your base application.") +* [base](https://www.npmjs.com/package/base): Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks | [homepage](https://github.com/node-base/base "Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks") +* [ware](https://www.npmjs.com/package/ware): Easily create your own middleware layer. | [homepage](https://github.com/segmentio/ware "Easily create your own middleware layer.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 37 | [jonschlinkert](https://github.com/jonschlinkert) | +| 7 | [charlike-old](https://github.com/charlike-old) | +| 2 | [doowb](https://github.com/doowb) | +| 2 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | + +### Author + +**Jon Schlinkert** + +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 12, 2018._ \ No newline at end of file diff --git a/node_modules/use/index.js b/node_modules/use/index.js new file mode 100644 index 000000000..9a1eb4ee9 --- /dev/null +++ b/node_modules/use/index.js @@ -0,0 +1,155 @@ +/*! + * use + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +module.exports = function base(app, options) { + if (!isObject(app) && typeof app !== 'function') { + throw new TypeError('expected an object or function'); + } + + var opts = isObject(options) ? options : {}; + var prop = typeof opts.prop === 'string' ? opts.prop : 'fns'; + if (!Array.isArray(app[prop])) { + define(app, prop, []); + } + + /** + * Define a plugin function to be passed to use. The only + * parameter exposed to the plugin is `app`, the object or function. + * passed to `use(app)`. `app` is also exposed as `this` in plugins. + * + * Additionally, **if a plugin returns a function, the function will + * be pushed onto the `fns` array**, allowing the plugin to be + * called at a later point by the `run` method. + * + * ```js + * var use = require('use'); + * + * // define a plugin + * function foo(app) { + * // do stuff + * } + * + * var app = function(){}; + * use(app); + * + * // register plugins + * app.use(foo); + * app.use(bar); + * app.use(baz); + * ``` + * @name .use + * @param {Function} `fn` plugin function to call + * @api public + */ + + define(app, 'use', use); + + /** + * Run all plugins on `fns`. Any plugin that returns a function + * when called by `use` is pushed onto the `fns` array. + * + * ```js + * var config = {}; + * app.run(config); + * ``` + * @name .run + * @param {Object} `value` Object to be modified by plugins. + * @return {Object} Returns the object passed to `run` + * @api public + */ + + define(app, 'run', function(val) { + if (!isObject(val)) return; + + if (!val.use || !val.run) { + define(val, prop, val[prop] || []); + define(val, 'use', use); + } + + if (!val[prop] || val[prop].indexOf(base) === -1) { + val.use(base); + } + + var self = this || app; + var fns = self[prop]; + var len = fns.length; + var idx = -1; + + while (++idx < len) { + val.use(fns[idx]); + } + return val; + }); + + /** + * Call plugin `fn`. If a function is returned push it into the + * `fns` array to be called by the `run` method. + */ + + function use(type, fn, options) { + var offset = 1; + + if (typeof type === 'string' || Array.isArray(type)) { + fn = wrap(type, fn); + offset++; + } else { + options = fn; + fn = type; + } + + if (typeof fn !== 'function') { + throw new TypeError('expected a function'); + } + + var self = this || app; + var fns = self[prop]; + + var args = [].slice.call(arguments, offset); + args.unshift(self); + + if (typeof opts.hook === 'function') { + opts.hook.apply(self, args); + } + + var val = fn.apply(self, args); + if (typeof val === 'function' && fns.indexOf(val) === -1) { + fns.push(val); + } + return self; + } + + /** + * Wrap a named plugin function so that it's only called on objects of the + * given `type` + * + * @param {String} `type` + * @param {Function} `fn` Plugin function + * @return {Function} + */ + + function wrap(type, fn) { + return function plugin() { + return this.type === type ? fn.apply(this, arguments) : plugin; + }; + } + + return app; +}; + +function isObject(val) { + return val && typeof val === 'object' && !Array.isArray(val); +} + +function define(obj, key, val) { + Object.defineProperty(obj, key, { + configurable: true, + writable: true, + value: val + }); +} diff --git a/node_modules/use/package.json b/node_modules/use/package.json new file mode 100644 index 000000000..4ed15ce55 --- /dev/null +++ b/node_modules/use/package.json @@ -0,0 +1,108 @@ +{ + "_from": "use@^3.1.0", + "_id": "use@3.1.1", + "_inBundle": false, + "_integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "_location": "/use", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "use@^3.1.0", + "name": "use", + "escapedName": "use", + "rawSpec": "^3.1.0", + "saveSpec": null, + "fetchSpec": "^3.1.0" + }, + "_requiredBy": [ + "/snapdragon" + ], + "_resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "_shasum": "d50c8cac79a19fbc20f2911f56eb973f4e10070f", + "_spec": "use@^3.1.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/snapdragon", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/use/issues" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Brian Woodward", + "url": "https://twitter.com/doowb" + }, + { + "name": "Jon Schlinkert", + "url": "http://twitter.com/jonschlinkert" + }, + { + "name": "Olsten Larck", + "url": "https://i.am.charlike.online" + }, + { + "url": "https://github.com/wtgtybhertgeghgtwtg" + } + ], + "deprecated": false, + "description": "Easily add plugin support to your node.js application.", + "devDependencies": { + "base-plugins": "^1.0.0", + "define-property": "^2.0.0", + "extend-shallow": "^3.0.1", + "gulp": "^3.9.1", + "gulp-eslint": "^4.0.0", + "gulp-format-md": "^1.0.0", + "gulp-istanbul": "^1.1.2", + "gulp-mocha": "^3.0.1", + "mocha": "^4.0.1" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jonschlinkert/use", + "keywords": [ + "use" + ], + "license": "MIT", + "main": "index.js", + "name": "use", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/use.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "base", + "base-plugins", + "ware" + ] + }, + "reflinks": [ + "verb", + "ware" + ], + "lint": { + "reflinks": true + } + }, + "version": "3.1.1" +} diff --git a/node_modules/util-deprecate/History.md b/node_modules/util-deprecate/History.md new file mode 100644 index 000000000..acc867537 --- /dev/null +++ b/node_modules/util-deprecate/History.md @@ -0,0 +1,16 @@ + +1.0.2 / 2015-10-07 +================== + + * use try/catch when checking `localStorage` (#3, @kumavis) + +1.0.1 / 2014-11-25 +================== + + * browser: use `console.warn()` for deprecation calls + * browser: more jsdocs + +1.0.0 / 2014-04-30 +================== + + * initial commit diff --git a/node_modules/util-deprecate/LICENSE b/node_modules/util-deprecate/LICENSE new file mode 100644 index 000000000..6a60e8c22 --- /dev/null +++ b/node_modules/util-deprecate/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2014 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/util-deprecate/README.md b/node_modules/util-deprecate/README.md new file mode 100644 index 000000000..75622fa7c --- /dev/null +++ b/node_modules/util-deprecate/README.md @@ -0,0 +1,53 @@ +util-deprecate +============== +### The Node.js `util.deprecate()` function with browser support + +In Node.js, this module simply re-exports the `util.deprecate()` function. + +In the web browser (i.e. via browserify), a browser-specific implementation +of the `util.deprecate()` function is used. + + +## API + +A `deprecate()` function is the only thing exposed by this module. + +``` javascript +// setup: +exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead'); + + +// users see: +foo(); +// foo() is deprecated, use bar() instead +foo(); +foo(); +``` + + +## License + +(The MIT License) + +Copyright (c) 2014 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/util-deprecate/browser.js b/node_modules/util-deprecate/browser.js new file mode 100644 index 000000000..549ae2f06 --- /dev/null +++ b/node_modules/util-deprecate/browser.js @@ -0,0 +1,67 @@ + +/** + * Module exports. + */ + +module.exports = deprecate; + +/** + * Mark that a method should not be used. + * Returns a modified function which warns once by default. + * + * If `localStorage.noDeprecation = true` is set, then it is a no-op. + * + * If `localStorage.throwDeprecation = true` is set, then deprecated functions + * will throw an Error when invoked. + * + * If `localStorage.traceDeprecation = true` is set, then deprecated functions + * will invoke `console.trace()` instead of `console.error()`. + * + * @param {Function} fn - the function to deprecate + * @param {String} msg - the string to print to the console when `fn` is invoked + * @returns {Function} a new "deprecated" version of `fn` + * @api public + */ + +function deprecate (fn, msg) { + if (config('noDeprecation')) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (config('throwDeprecation')) { + throw new Error(msg); + } else if (config('traceDeprecation')) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +} + +/** + * Checks `localStorage` for boolean values for the given `name`. + * + * @param {String} name + * @returns {Boolean} + * @api private + */ + +function config (name) { + // accessing global.localStorage can trigger a DOMException in sandboxed iframes + try { + if (!global.localStorage) return false; + } catch (_) { + return false; + } + var val = global.localStorage[name]; + if (null == val) return false; + return String(val).toLowerCase() === 'true'; +} diff --git a/node_modules/util-deprecate/node.js b/node_modules/util-deprecate/node.js new file mode 100644 index 000000000..5e6fcff5d --- /dev/null +++ b/node_modules/util-deprecate/node.js @@ -0,0 +1,6 @@ + +/** + * For Node.js, simply re-export the core `util.deprecate` function. + */ + +module.exports = require('util').deprecate; diff --git a/node_modules/util-deprecate/package.json b/node_modules/util-deprecate/package.json new file mode 100644 index 000000000..aaaa696ce --- /dev/null +++ b/node_modules/util-deprecate/package.json @@ -0,0 +1,56 @@ +{ + "_from": "util-deprecate@~1.0.1", + "_id": "util-deprecate@1.0.2", + "_inBundle": false, + "_integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "_location": "/util-deprecate", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "util-deprecate@~1.0.1", + "name": "util-deprecate", + "escapedName": "util-deprecate", + "rawSpec": "~1.0.1", + "saveSpec": null, + "fetchSpec": "~1.0.1" + }, + "_requiredBy": [ + "/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "_shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", + "_spec": "util-deprecate@~1.0.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readable-stream", + "author": { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://n8.io/" + }, + "browser": "browser.js", + "bugs": { + "url": "https://github.com/TooTallNate/util-deprecate/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "The Node.js `util.deprecate()` function with browser support", + "homepage": "https://github.com/TooTallNate/util-deprecate", + "keywords": [ + "util", + "deprecate", + "browserify", + "browser", + "node" + ], + "license": "MIT", + "main": "node.js", + "name": "util-deprecate", + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/util-deprecate.git" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "1.0.2" +} diff --git a/node_modules/util/LICENSE b/node_modules/util/LICENSE new file mode 100644 index 000000000..e3d4e695a --- /dev/null +++ b/node_modules/util/LICENSE @@ -0,0 +1,18 @@ +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/node_modules/util/README.md b/node_modules/util/README.md new file mode 100644 index 000000000..1c473d2cf --- /dev/null +++ b/node_modules/util/README.md @@ -0,0 +1,15 @@ +# util + +[![Build Status](https://travis-ci.org/defunctzombie/node-util.png?branch=master)](https://travis-ci.org/defunctzombie/node-util) + +node.js [util](http://nodejs.org/api/util.html) module as a module + +## install via [npm](npmjs.org) + +```shell +npm install util +``` + +## browser support + +This module also works in modern browsers. If you need legacy browser support you will need to polyfill ES5 features. diff --git a/node_modules/util/package.json b/node_modules/util/package.json new file mode 100644 index 000000000..6ac8e92b9 --- /dev/null +++ b/node_modules/util/package.json @@ -0,0 +1,63 @@ +{ + "_from": "util@~0.10.1", + "_id": "util@0.10.4", + "_inBundle": false, + "_integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "_location": "/util", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "util@~0.10.1", + "name": "util", + "escapedName": "util", + "rawSpec": "~0.10.1", + "saveSpec": null, + "fetchSpec": "~0.10.1" + }, + "_requiredBy": [ + "/browserify" + ], + "_resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", + "_shasum": "3aa0125bfe668a4672de58857d3ace27ecb76901", + "_spec": "util@~0.10.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "Joyent", + "url": "http://www.joyent.com" + }, + "browser": { + "./support/isBuffer.js": "./support/isBufferBrowser.js" + }, + "bugs": { + "url": "https://github.com/defunctzombie/node-util/issues" + }, + "bundleDependencies": false, + "dependencies": { + "inherits": "2.0.3" + }, + "deprecated": false, + "description": "Node.JS util module", + "devDependencies": { + "zuul": "~1.0.9" + }, + "files": [ + "util.js", + "support" + ], + "homepage": "https://github.com/defunctzombie/node-util", + "keywords": [ + "util" + ], + "license": "MIT", + "main": "./util.js", + "name": "util", + "repository": { + "type": "git", + "url": "git://github.com/defunctzombie/node-util.git" + }, + "scripts": { + "test": "node test/node/*.js && zuul test/browser/*.js" + }, + "version": "0.10.4" +} diff --git a/node_modules/util/support/isBuffer.js b/node_modules/util/support/isBuffer.js new file mode 100644 index 000000000..ace9ac00d --- /dev/null +++ b/node_modules/util/support/isBuffer.js @@ -0,0 +1,3 @@ +module.exports = function isBuffer(arg) { + return arg instanceof Buffer; +} diff --git a/node_modules/util/support/isBufferBrowser.js b/node_modules/util/support/isBufferBrowser.js new file mode 100644 index 000000000..0e1bee1eb --- /dev/null +++ b/node_modules/util/support/isBufferBrowser.js @@ -0,0 +1,6 @@ +module.exports = function isBuffer(arg) { + return arg && typeof arg === 'object' + && typeof arg.copy === 'function' + && typeof arg.fill === 'function' + && typeof arg.readUInt8 === 'function'; +} \ No newline at end of file diff --git a/node_modules/util/util.js b/node_modules/util/util.js new file mode 100644 index 000000000..e0ea321d3 --- /dev/null +++ b/node_modules/util/util.js @@ -0,0 +1,586 @@ +// 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 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) { + // Allow for deprecating things in the process of starting up. + if (isUndefined(global.process)) { + return function() { + return exports.deprecate(fn, msg).apply(this, arguments); + }; + } + + if (process.noDeprecation === true) { + return fn; + } + + 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 = process.env.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 = require('./support/isBuffer'); + +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 = require('inherits'); + +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); +} diff --git a/node_modules/vm-browserify/.travis.yml b/node_modules/vm-browserify/.travis.yml new file mode 100644 index 000000000..987e4fc1b --- /dev/null +++ b/node_modules/vm-browserify/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: + - "stable" +sudo: false +before_script: + - export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start diff --git a/node_modules/vm-browserify/CHANGELOG.md b/node_modules/vm-browserify/CHANGELOG.md new file mode 100644 index 000000000..a2ae96582 --- /dev/null +++ b/node_modules/vm-browserify/CHANGELOG.md @@ -0,0 +1,16 @@ +# vm-browserify Change Log +All notable changes to this project will be documented in this file. +This project adheres to [Semantic Versioning](http://semver.org/). + +## 1.1.0 - 2018-06-15 +* Add `vm.isContext(sandbox)`. (https://github.com/browserify/vm-browserify/commit/038c3cb33edcad9eec33aa8a8beae31b15c1a006) + +## 1.0.1 - 2018-04-13 +* Remove the `component-indexof` dependency. (https://github.com/browserify/vm-browserify/commit/0d9bd4c99f80db12c5c45e260a23ebfc51ec850d) + +## 1.0.0 - 2018-03-23 + +(This is not a breaking change.) + +* Make the `sandbox` argument to `runInNewContext` optional, like in Node. (https://github.com/browserify/vm-browserify/pull/13) +* Substituting `component-indexof` for deprecated `indexof`. (https://github.com/browserify/vm-browserify/pull/14) diff --git a/node_modules/vm-browserify/LICENSE b/node_modules/vm-browserify/LICENSE new file mode 100644 index 000000000..ee27ba4b4 --- /dev/null +++ b/node_modules/vm-browserify/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/vm-browserify/example/run/bundle.js b/node_modules/vm-browserify/example/run/bundle.js new file mode 100644 index 000000000..5dbc43f41 --- /dev/null +++ b/node_modules/vm-browserify/example/run/bundle.js @@ -0,0 +1,473 @@ +var require = function (file, cwd) { + var resolved = require.resolve(file, cwd || '/'); + var mod = require.modules[resolved]; + if (!mod) throw new Error( + 'Failed to resolve module ' + file + ', tried ' + resolved + ); + var res = mod._cached ? mod._cached : mod(); + return res; +} + +require.paths = []; +require.modules = {}; +require.extensions = [".js",".coffee"]; + +require._core = { + 'assert': true, + 'events': true, + 'fs': true, + 'path': true, + 'vm': true +}; + +require.resolve = (function () { + return function (x, cwd) { + if (!cwd) cwd = '/'; + + if (require._core[x]) return x; + var path = require.modules.path(); + var y = cwd || '.'; + + if (x.match(/^(?:\.\.?\/|\/)/)) { + var m = loadAsFileSync(path.resolve(y, x)) + || loadAsDirectorySync(path.resolve(y, x)); + if (m) return m; + } + + var n = loadNodeModulesSync(x, y); + if (n) return n; + + throw new Error("Cannot find module '" + x + "'"); + + function loadAsFileSync (x) { + if (require.modules[x]) { + return x; + } + + for (var i = 0; i < require.extensions.length; i++) { + var ext = require.extensions[i]; + if (require.modules[x + ext]) return x + ext; + } + } + + function loadAsDirectorySync (x) { + x = x.replace(/\/+$/, ''); + var pkgfile = x + '/package.json'; + if (require.modules[pkgfile]) { + var pkg = require.modules[pkgfile](); + var b = pkg.browserify; + if (typeof b === 'object' && b.main) { + var m = loadAsFileSync(path.resolve(x, b.main)); + if (m) return m; + } + else if (typeof b === 'string') { + var m = loadAsFileSync(path.resolve(x, b)); + if (m) return m; + } + else if (pkg.main) { + var m = loadAsFileSync(path.resolve(x, pkg.main)); + if (m) return m; + } + } + + return loadAsFileSync(x + '/index'); + } + + function loadNodeModulesSync (x, start) { + var dirs = nodeModulesPathsSync(start); + for (var i = 0; i < dirs.length; i++) { + var dir = dirs[i]; + var m = loadAsFileSync(dir + '/' + x); + if (m) return m; + var n = loadAsDirectorySync(dir + '/' + x); + if (n) return n; + } + + var m = loadAsFileSync(x); + if (m) return m; + } + + function nodeModulesPathsSync (start) { + var parts; + if (start === '/') parts = [ '' ]; + else parts = path.normalize(start).split('/'); + + var dirs = []; + for (var i = parts.length - 1; i >= 0; i--) { + if (parts[i] === 'node_modules') continue; + var dir = parts.slice(0, i + 1).join('/') + '/node_modules'; + dirs.push(dir); + } + + return dirs; + } + }; +})(); + +require.alias = function (from, to) { + var path = require.modules.path(); + var res = null; + try { + res = require.resolve(from + '/package.json', '/'); + } + catch (err) { + res = require.resolve(from, '/'); + } + var basedir = path.dirname(res); + + var keys = (Object.keys || function (obj) { + var res = []; + for (var key in obj) res.push(key) + return res; + })(require.modules); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (key.slice(0, basedir.length + 1) === basedir + '/') { + var f = key.slice(basedir.length); + require.modules[to + f] = require.modules[basedir + f]; + } + else if (key === basedir) { + require.modules[to] = require.modules[basedir]; + } + } +}; + +require.define = function (filename, fn) { + var dirname = require._core[filename] + ? '' + : require.modules.path().dirname(filename) + ; + + var require_ = function (file) { + return require(file, dirname) + }; + require_.resolve = function (name) { + return require.resolve(name, dirname); + }; + require_.modules = require.modules; + require_.define = require.define; + var module_ = { exports : {} }; + + require.modules[filename] = function () { + require.modules[filename]._cached = module_.exports; + fn.call( + module_.exports, + require_, + module_, + module_.exports, + dirname, + filename + ); + require.modules[filename]._cached = module_.exports; + return module_.exports; + }; +}; + +if (typeof process === 'undefined') process = {}; + +if (!process.nextTick) process.nextTick = (function () { + var queue = []; + var canPost = typeof window !== 'undefined' + && window.postMessage && window.addEventListener + ; + + if (canPost) { + window.addEventListener('message', function (ev) { + if (ev.source === window && ev.data === 'browserify-tick') { + ev.stopPropagation(); + if (queue.length > 0) { + var fn = queue.shift(); + fn(); + } + } + }, true); + } + + return function (fn) { + if (canPost) { + queue.push(fn); + window.postMessage('browserify-tick', '*'); + } + else setTimeout(fn, 0); + }; +})(); + +if (!process.title) process.title = 'browser'; + +if (!process.binding) process.binding = function (name) { + if (name === 'evals') return require('vm') + else throw new Error('No such module') +}; + +if (!process.cwd) process.cwd = function () { return '.' }; + +require.define("path", function (require, module, exports, __dirname, __filename) { +function filter (xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + if (fn(xs[i], i, xs)) res.push(xs[i]); + } + return res; +} + +// 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; 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; +} + +// Regex to split a filename into [*, dir, basename, ext] +// posix version +var splitPathRe = /^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/; + +// path.resolve([from ...], to) +// posix version +exports.resolve = function() { +var resolvedPath = '', + resolvedAbsolute = false; + +for (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) { + var path = (i >= 0) + ? arguments[i] + : process.cwd(); + + // Skip empty and invalid entries + if (typeof path !== 'string' || !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 = path.charAt(0) === '/', + trailingSlash = path.slice(-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.join = function() { + var paths = Array.prototype.slice.call(arguments, 0); + return exports.normalize(filter(paths, function(p, index) { + return p && typeof p === 'string'; + }).join('/')); +}; + + +exports.dirname = function(path) { + var dir = splitPathRe.exec(path)[1] || ''; + var isWindows = false; + if (!dir) { + // No dirname + return '.'; + } else if (dir.length === 1 || + (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) { + // It is just a slash or a drive letter with a slash + return dir; + } else { + // It is a full dirname, strip trailing slash + return dir.substring(0, dir.length - 1); + } +}; + + +exports.basename = function(path, ext) { + var f = splitPathRe.exec(path)[2] || ''; + // TODO: make this comparison case-insensitive on windows? + if (ext && f.substr(-1 * ext.length) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; +}; + + +exports.extname = function(path) { + return splitPathRe.exec(path)[3] || ''; +}; + +}); + +require.define("vm", function (require, module, exports, __dirname, __filename) { +var Object_keys = function (obj) { + if (Object.keys) return Object.keys(obj) + else { + var res = []; + for (var key in obj) res.push(key) + return res; + } +}; + +var forEach = function (xs, fn) { + if (xs.forEach) return xs.forEach(fn) + else for (var i = 0; i < xs.length; i++) { + fn(xs[i], i, xs); + } +}; + +var Script = exports.Script = function NodeScript (code) { + if (!(this instanceof Script)) return new Script(code); + this.code = code; +}; + +var iframe = document.createElement('iframe'); +if (!iframe.style) iframe.style = {}; +iframe.style.display = 'none'; + +var iframeCapable = true; // until proven otherwise +if (navigator.appName === 'Microsoft Internet Explorer') { + var m = navigator.appVersion.match(/\bMSIE (\d+\.\d+);/); + if (m && parseFloat(m[1]) <= 9.0) { + iframeCapable = false; + } +} + +Script.prototype.runInNewContext = function (context) { + if (!context) context = {}; + + if (!iframeCapable) { + var keys = Object_keys(context); + var args = []; + for (var i = 0; i < keys.length; i++) { + args.push(context[keys[i]]); + } + + var fn = new Function(keys, 'return ' + this.code); + return fn.apply(null, args); + } + + document.body.appendChild(iframe); + + var win = iframe.contentWindow + || (window.frames && window.frames[window.frames.length - 1]) + || window[window.length - 1] + ; + + forEach(Object_keys(context), function (key) { + win[key] = context[key]; + iframe[key] = context[key]; + }); + + if (win.eval) { + // chrome and ff can just .eval() + var res = win.eval(this.code); + } + else { + // this works in IE9 but not anything newer + iframe.setAttribute('src', + 'javascript:__browserifyVmResult=(' + this.code + ')' + ); + if ('__browserifyVmResult' in win) { + var res = win.__browserifyVmResult; + } + else { + iframeCapable = false; + res = this.runInThisContext(context); + } + } + + forEach(Object_keys(win), function (key) { + context[key] = win[key]; + }); + + document.body.removeChild(iframe); + + return res; +}; + +Script.prototype.runInThisContext = function () { + return eval(this.code); // maybe... +}; + +Script.prototype.runInContext = function (context) { + // seems to be just runInNewContext on magical context objects which are + // otherwise indistinguishable from objects except plain old objects + // for the parameter segfaults node + return this.runInNewContext(context); +}; + +forEach(Object_keys(Script.prototype), function (name) { + exports[name] = Script[name] = function (code) { + var s = Script(code); + return s[name].apply(s, [].slice.call(arguments, 1)); + }; +}); + +exports.createScript = function (code) { + return exports.Script(code); +}; + +exports.createContext = Script.createContext = function (context) { + // not really sure what this one does + // seems to just make a shallow copy + var copy = {}; + forEach(Object_keys(context), function (key) { + copy[key] = context[key]; + }); + return copy; +}; + +}); + +require.define("/entry.js", function (require, module, exports, __dirname, __filename) { + var vm = require('vm'); + +$(function () { + var res = vm.runInNewContext('a + 5', { a : 100 }); + $('#res').text(res); +}); + +}); +require("/entry.js"); diff --git a/node_modules/vm-browserify/example/run/entry.js b/node_modules/vm-browserify/example/run/entry.js new file mode 100644 index 000000000..c7d38918c --- /dev/null +++ b/node_modules/vm-browserify/example/run/entry.js @@ -0,0 +1,6 @@ +var vm = require('vm'); + +$(function () { + var res = vm.runInNewContext('a + 5', { a : 100 }); + $('#res').text(res); +}); diff --git a/node_modules/vm-browserify/example/run/index.html b/node_modules/vm-browserify/example/run/index.html new file mode 100644 index 000000000..1ea094235 --- /dev/null +++ b/node_modules/vm-browserify/example/run/index.html @@ -0,0 +1,9 @@ + + + + + + + result = + + diff --git a/node_modules/vm-browserify/example/run/server.js b/node_modules/vm-browserify/example/run/server.js new file mode 100644 index 000000000..339d3eea0 --- /dev/null +++ b/node_modules/vm-browserify/example/run/server.js @@ -0,0 +1,6 @@ +var ecstatic = require('ecstatic')(__dirname); +var http = require('http'); +http.createServer(ecstatic).listen(8000); + +console.log('listening on :8000'); +console.log('# remember to run browserify entry.js -o bundle.js'); diff --git a/node_modules/vm-browserify/index.js b/node_modules/vm-browserify/index.js new file mode 100644 index 000000000..4292de776 --- /dev/null +++ b/node_modules/vm-browserify/index.js @@ -0,0 +1,149 @@ +var indexOf = function (xs, item) { + if (xs.indexOf) return xs.indexOf(item); + else for (var i = 0; i < xs.length; i++) { + if (xs[i] === item) return i; + } + return -1; +}; +var Object_keys = function (obj) { + if (Object.keys) return Object.keys(obj) + else { + var res = []; + for (var key in obj) res.push(key) + return res; + } +}; + +var forEach = function (xs, fn) { + if (xs.forEach) return xs.forEach(fn) + else for (var i = 0; i < xs.length; i++) { + fn(xs[i], i, xs); + } +}; + +var defineProp = (function() { + try { + Object.defineProperty({}, '_', {}); + return function(obj, name, value) { + Object.defineProperty(obj, name, { + writable: true, + enumerable: false, + configurable: true, + value: value + }) + }; + } catch(e) { + return function(obj, name, value) { + obj[name] = value; + }; + } +}()); + +var globals = ['Array', 'Boolean', 'Date', 'Error', 'EvalError', 'Function', +'Infinity', 'JSON', 'Math', 'NaN', 'Number', 'Object', 'RangeError', +'ReferenceError', 'RegExp', 'String', 'SyntaxError', 'TypeError', 'URIError', +'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent', 'escape', +'eval', 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'undefined', 'unescape']; + +function Context() {} +Context.prototype = {}; + +var Script = exports.Script = function NodeScript (code) { + if (!(this instanceof Script)) return new Script(code); + this.code = code; +}; + +Script.prototype.runInContext = function (context) { + if (!(context instanceof Context)) { + throw new TypeError("needs a 'context' argument."); + } + + var iframe = document.createElement('iframe'); + if (!iframe.style) iframe.style = {}; + iframe.style.display = 'none'; + + document.body.appendChild(iframe); + + var win = iframe.contentWindow; + var wEval = win.eval, wExecScript = win.execScript; + + if (!wEval && wExecScript) { + // win.eval() magically appears when this is called in IE: + wExecScript.call(win, 'null'); + wEval = win.eval; + } + + forEach(Object_keys(context), function (key) { + win[key] = context[key]; + }); + forEach(globals, function (key) { + if (context[key]) { + win[key] = context[key]; + } + }); + + var winKeys = Object_keys(win); + + var res = wEval.call(win, this.code); + + forEach(Object_keys(win), function (key) { + // Avoid copying circular objects like `top` and `window` by only + // updating existing context properties or new properties in the `win` + // that was only introduced after the eval. + if (key in context || indexOf(winKeys, key) === -1) { + context[key] = win[key]; + } + }); + + forEach(globals, function (key) { + if (!(key in context)) { + defineProp(context, key, win[key]); + } + }); + + document.body.removeChild(iframe); + + return res; +}; + +Script.prototype.runInThisContext = function () { + return eval(this.code); // maybe... +}; + +Script.prototype.runInNewContext = function (context) { + var ctx = Script.createContext(context); + var res = this.runInContext(ctx); + + if (context) { + forEach(Object_keys(ctx), function (key) { + context[key] = ctx[key]; + }); + } + + return res; +}; + +forEach(Object_keys(Script.prototype), function (name) { + exports[name] = Script[name] = function (code) { + var s = Script(code); + return s[name].apply(s, [].slice.call(arguments, 1)); + }; +}); + +exports.isContext = function (context) { + return context instanceof Context; +}; + +exports.createScript = function (code) { + return exports.Script(code); +}; + +exports.createContext = Script.createContext = function (context) { + var copy = new Context(); + if(typeof context === 'object') { + forEach(Object_keys(context), function (key) { + copy[key] = context[key]; + }); + } + return copy; +}; diff --git a/node_modules/vm-browserify/package.json b/node_modules/vm-browserify/package.json new file mode 100644 index 000000000..6090115da --- /dev/null +++ b/node_modules/vm-browserify/package.json @@ -0,0 +1,59 @@ +{ + "_from": "vm-browserify@^1.0.0", + "_id": "vm-browserify@1.1.0", + "_inBundle": false, + "_integrity": "sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw==", + "_location": "/vm-browserify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "vm-browserify@^1.0.0", + "name": "vm-browserify", + "escapedName": "vm-browserify", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/browserify" + ], + "_resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.0.tgz", + "_shasum": "bd76d6a23323e2ca8ffa12028dc04559c75f9019", + "_spec": "vm-browserify@^1.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/vm-browserify/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "vm module for the browser", + "devDependencies": { + "browserify": "^16.1.1", + "tape": "~2.3.2", + "tape-run": "^3.0.4" + }, + "homepage": "https://github.com/substack/vm-browserify#readme", + "keywords": [ + "vm", + "browser", + "eval" + ], + "license": "MIT", + "main": "index.js", + "name": "vm-browserify", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/substack/vm-browserify.git" + }, + "scripts": { + "test": "browserify test/vm.js | tape-run" + }, + "version": "1.1.0" +} diff --git a/node_modules/vm-browserify/readme.markdown b/node_modules/vm-browserify/readme.markdown new file mode 100644 index 000000000..8707c3bc6 --- /dev/null +++ b/node_modules/vm-browserify/readme.markdown @@ -0,0 +1,67 @@ +# vm-browserify + +emulate node's vm module for the browser + +[![Build Status](https://travis-ci.org/browserify/vm-browserify.svg?branch=master)](https://travis-ci.org/browserify/vm-browserify) + +# example + +Just write some client-side javascript: + +``` js +var vm = require('vm'); + +$(function () { + var res = vm.runInNewContext('a + 5', { a : 100 }); + $('#res').text(res); +}); +``` + +compile it with [browserify](http://github.com/substack/node-browserify): + +``` +browserify entry.js -o bundle.js +``` + +then whip up some html: + +``` html + + + + + + + result = + + +``` + +and when you load the page you should see: + +``` +result = 105 +``` + +# methods + +## vm.runInNewContext(code, context={}) + +Evaluate some `code` in a new iframe with a `context`. + +Contexts are like wrapping your code in a `with()` except slightly less terrible +because the code is sandboxed into a new iframe. + +# install + +This module is depended upon by browserify, so you should just be able to +`require('vm')` and it will just work. However if you want to use this module +directly you can install it with [npm](http://npmjs.org): + +``` +npm install vm-browserify +``` + +# license + +MIT diff --git a/node_modules/vm-browserify/test/vm.js b/node_modules/vm-browserify/test/vm.js new file mode 100644 index 000000000..ea8cd31be --- /dev/null +++ b/node_modules/vm-browserify/test/vm.js @@ -0,0 +1,35 @@ +var test = require('tape'); +var vm = require('../'); + +test('vmRunInNewContext', function (t) { + t.plan(6); + + t.equal(vm.runInNewContext('a + 5', { a : 100 }), 105); + + (function () { + var vars = { x : 10 }; + t.equal(vm.runInNewContext('x++', vars), 10); + t.equal(vars.x, 11); + })(); + + (function () { + var vars = { x : 10 }; + t.equal(vm.runInNewContext('var y = 3; y + x++', vars), 13); + t.equal(vars.x, 11); + t.equal(vars.y, 3); + })(); + + t.end(); +}); + +test('vmRunInContext', function (t) { + t.plan(2); + + var context = vm.createContext({ foo: 1 }); + + vm.runInContext('var x = 1', context); + t.deepEqual(context, { foo: 1, x: 1 }); + + vm.runInContext('var y = 1', context); + t.deepEqual(context, { foo: 1, x: 1, y: 1 }); +}); diff --git a/node_modules/watchify-middleware/LICENSE.md b/node_modules/watchify-middleware/LICENSE.md new file mode 100644 index 000000000..89a78cf22 --- /dev/null +++ b/node_modules/watchify-middleware/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) +Copyright (c) 2015 Matt DesLauriers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/watchify-middleware/README.md b/node_modules/watchify-middleware/README.md new file mode 100644 index 000000000..c96a3d735 --- /dev/null +++ b/node_modules/watchify-middleware/README.md @@ -0,0 +1,154 @@ +# watchify-middleware + +[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges) + +A simple middleware for watchify which provides a few features for a better development experience: + +- suspends the server response so you are never served a stale or empty bundle +- removes the default 600ms delay (left up to the developer to reconfigure) +- emits timing information in a `'log'` event +- (optional) allows for a browser-based error handler (eg: print to DevTools console) + +For practical implementations, see [watchify-server](https://www.npmjs.com/package/watchify-server) or [budo](https://www.npmjs.com/package/budo). + +## Install + +```sh +npm install watchify-middleware --save +``` + +## Example + +```js +var watchifyMiddleware = require('watchify-middleware') +var defaultIndex = require('simple-html-index') + +var staticUrl = 'bundle.js' +var bundler = browserify('app.js', { + // config for watchify + cache: {}, + packageCache: {}, + basedir: __dirname +}) +var watchify = watchifyMiddleware(bundler) + +var server = http.createServer(function (req, res) { + if (req.url === '/') { + defaultIndex({ entry: staticUrl }).pipe(res) + } else if (req.url === '/' + staticUrl) { + watchify(req, res) + } +}) + +server.listen(8000, 'localhost', function () { + console.log('Listening on http://localhost:8000/') +}) +``` + +For a more complete example, see [example/server.js](example/server.js). + +## Usage + +[![NPM](https://nodei.co/npm/watchify-middleware.png)](https://www.npmjs.com/package/watchify-middleware) + +#### `middleware = watchifyMiddleware(browserify[, opt])` + +Returns a `middleware(req, res)` function from the given `browserify` bundler instance and options: + +- `delay` (default 0) a delay to debounce the rebuild, useful for things like git branch switches (where hundreds of files may change at once) +- `errorHandler` (default false) a boolean or function for handling errors +- `initialBundle` (default true) whether to initially bundle and emit `'pending'` + +`errorHandler` can be a function that accepts `(err)` parameter and optionally returns the new contents (String|Buffer) of the JavaScript bundle. If `errorHandler` is `true`, it will default to the following: + +```js +var stripAnsi = require('strip-ansi') + +function defaultErrorHandler (err) { + console.error('%s', err) + var msg = stripAnsi(err.message) + return ';console.error(' + JSON.stringify(msg) + ');' +} +``` + + (some plugins produce ANSI color codes in error messages) + +Otherwise, it assumes the normal behaviour for error handling (which is typically just an uncaught error event). + +#### `emitter = watchifyMiddleware.emitter(browserify[, opt])` + +The same as above, except this returns an EventEmitter for handling bundle updates. + +##### `emitter.middleware` + +The `middleware(req, res)` function for use in your server. + +##### `emitter.bundle()` + +Triggers a bundle event. Usually should only be called if `initialBundle` is set to false, to trigger the initial bundle. + +##### `emitter.on('pending', fn)` + +Called when watchify begins its incremental rebuild. + +##### `emitter.on('update', fn)` + +Called when bundling is finished, with parameter `(contents, rows)`. + +`contents` is a Buffer/String of the bundle and `rows` is a list of dependencies that have changed since last update. On first run, this will be an empty array. + +##### `emitter.on('log', fn)` + +Provides timing and server request logging, passing an `(event)` parameter. + +Server request logs look like this: + +```js +{ level: 'debug', type: 'request', message: 'bundle (pending|ready)'} +``` + +Bundle updates look like this: + +```js +{ elapsed: Number, level: 'info', type: 'bundle' } +``` + +These events work well with [garnish](https://github.com/mattdesl/garnish) and other ndjson-based tools. + +##### `emitter.on('error', fn)` + +If `errorHandler` was `fasle`, this will get triggered on bundle errors. If an error handler is being used, this will not get triggered. + +##### `emitter.on('bundle-error', fn)` + +This will get triggered on bundle errors, regardless of whether `errorHandler` is being used. This can be used to respond to syntax errors, such as showing a stylized notification. + +##### `emitter.close()` + +Closes the `watchify` instance and stops file watching. + +#### `version = watchifyMiddleware.getWatchifyVersion()` + +Primarily useful for debugging, this will return the *actual* version number of the `watchify` module being used by `watchify-middleware`. + +## running the demo + +To run the example, first git clone and install dependencies. + +```sh +git clone https://github.com/mattdesl/watchify-middleware.git +cd watchify-middleware +npm install +``` + +Then: + +```sh +npm start +``` + +And open [http://localhost:8000/](http://localhost:8000/). Try making changes to [example/app.js](example/app.js) and you will see timing information in console, and reloading the browser will provide the new bundle. + +## License + +MIT, see [LICENSE.md](http://github.com/mattdesl/watchify-middleware/blob/master/LICENSE.md) for details. diff --git a/node_modules/watchify-middleware/example/app.js b/node_modules/watchify-middleware/example/app.js new file mode 100644 index 000000000..b5b757db7 --- /dev/null +++ b/node_modules/watchify-middleware/example/app.js @@ -0,0 +1,5 @@ +var url = require('url') +console.log(url.parse(window.location.href)) + +var file = require('fs').readFileSync(__dirname + '/../README.md', 'utf8') +console.log(file) \ No newline at end of file diff --git a/node_modules/watchify-middleware/example/server.js b/node_modules/watchify-middleware/example/server.js new file mode 100644 index 000000000..760e8dd1f --- /dev/null +++ b/node_modules/watchify-middleware/example/server.js @@ -0,0 +1,49 @@ +var watchifyMiddleware = require('../') +var http = require('http') +var defaultIndex = require('simple-html-index') +var browserify = require('browserify') + +var staticUrl = 'bundle.js' +var bundler = browserify('app.js', { + // config for watchify + cache: {}, + transform: [ require('babelify'), 'brfs' ], + packageCache: {}, + debug: true, + basedir: __dirname +}) + +var watcher = watchifyMiddleware.emitter(bundler, { + errorHandler: true +}) + +watcher.on('pending', function () { + console.log('pending request') +}) + +watcher.on('update', function () { + console.log('update request') +}) + +watcher.on('log', function (ev) { + if (ev.elapsed) { + ev.elapsed = ev.elapsed + 'ms' + ev.url = staticUrl + } + ev.name = 'server' + console.log(JSON.stringify(ev)) +}) + +var middleware = watcher.middleware + +var server = http.createServer(function (req, res) { + if (req.url === '/') { + defaultIndex({ entry: staticUrl }).pipe(res) + } else if (req.url === '/' + staticUrl) { + middleware(req, res) + } +}) + +server.listen(8000, 'localhost', function () { + console.log('Listening on http://localhost:8000/') +}) diff --git a/node_modules/watchify-middleware/index.js b/node_modules/watchify-middleware/index.js new file mode 100644 index 000000000..59218d893 --- /dev/null +++ b/node_modules/watchify-middleware/index.js @@ -0,0 +1,57 @@ +var createBundler = require('./lib/bundler') + +module.exports = function watchifyMiddleware (browserify, opt) { + var emitter = createEmitter(browserify, opt) + return emitter.middleware +} + +module.exports.emitter = createEmitter + +module.exports.getWatchifyVersion = function () { + return require('watchify/package.json').version +} + +function createEmitter (browserify, opt) { + var bundler = createBundler(browserify, opt) + var pending = false + var contents = '' + + bundler.on('pending', function () { + pending = true + }) + + bundler.on('update', function (data) { + pending = false + contents = data + }) + + bundler.middleware = function middleware (req, res) { + if (pending) { + bundler.emit('log', { + level: 'debug', + type: 'request', + message: 'bundle pending' + }) + + bundler.once('update', function () { + bundler.emit('log', { + level: 'debug', + type: 'request', + message: 'bundle ready' + }) + submit(req, res) + }) + } else { + submit(req, res) + } + } + + return bundler + + function submit (req, res) { + res.setHeader('content-type', 'application/javascript; charset=utf-8') + res.setHeader('content-length', contents.length) + res.statusCode = req.statusCode || 200 + res.end(contents) + } +} diff --git a/node_modules/watchify-middleware/lib/bundler.js b/node_modules/watchify-middleware/lib/bundler.js new file mode 100644 index 000000000..ed2520af7 --- /dev/null +++ b/node_modules/watchify-middleware/lib/bundler.js @@ -0,0 +1,133 @@ +var createWatchify = require('watchify') +var EventEmitter = require('events').EventEmitter +var debounce = require('debounce') +var concat = require('concat-stream') +var assign = require('object-assign') +var stripAnsi = require('strip-ansi') +var parseError = require('./parse-error') + +module.exports = bundler +function bundler (browserify, opt) { + opt = opt || {} + var emitter = new EventEmitter() + var delay = opt.delay || 0 + var closed = false + var pending = false + var time = Date.now() + var updates = [] + var errorHandler = opt.errorHandler + if (errorHandler === true) { + errorHandler = defaultErrorHandler + } + + var watchify = createWatchify(browserify, assign({}, opt, { + // we use our own debounce, so make sure watchify + // ignores theirs + delay: 0 + })) + var contents = null + + emitter.close = function () { + if (closed) return + closed = true + if (watchify) { + // needed for watchify@3.0.0 + // this needs to be revisited upstream + setTimeout(function () { + watchify.close() + }, 200) + } + } + + var bundleDebounced = debounce(bundle, delay) + watchify.on('update', function (rows) { + if (closed) return + updates = rows + pending = true + time = Date.now() + emitter.emit('pending', updates) + bundleDebounced() + }) + + emitter.bundle = function () { + if (closed) return + time = Date.now() + if (!pending) { + pending = true + process.nextTick(function () { + emitter.emit('pending', updates) + }) + } + bundle() + } + + // initial bundle + if (opt.initialBundle !== false) { + emitter.bundle() + } + + return emitter + + function bundle () { + if (closed) { + update() + return + } + + var didError = false + var outStream = concat(function (body) { + if (!didError) { + contents = body + + var delay = Date.now() - time + emitter.emit('log', { + contentLength: contents.length, + elapsed: Math.round(delay), + level: 'info', + type: 'bundle' + }) + + bundleEnd() + } + }) + + var wb = watchify.bundle() + // it can be nice to handle errors gracefully + if (typeof errorHandler === 'function') { + wb.once('error', function (err) { + err.message = parseError(err) + contents = errorHandler(err) || '' + + didError = true + emitter.emit('bundle-error', err) + bundleEnd() + }) + } else { + wb.once('error', function (err) { + err.message = parseError(err) + emitter.emit('error', err) + emitter.emit('bundle-error', err) + }) + } + wb.pipe(outStream) + + function bundleEnd () { + update() + } + } + + function update () { + if (closed) return + if (pending) { + pending = false + emitter.emit('update', contents, updates) + updates = [] + } + } +} + +function defaultErrorHandler (err) { + console.error('%s', err) + var msg = stripAnsi(err.message) + return ';console.error(' + JSON.stringify(msg) + ');' +} diff --git a/node_modules/watchify-middleware/lib/parse-error.js b/node_modules/watchify-middleware/lib/parse-error.js new file mode 100644 index 000000000..b79e731bc --- /dev/null +++ b/node_modules/watchify-middleware/lib/parse-error.js @@ -0,0 +1,9 @@ +// parses a syntax error for pretty-printing to console +module.exports = parseError +function parseError (err) { + if (err.codeFrame) { // babelify@6.x + return [err.message, err.codeFrame].join('\n\n') + } else { // babelify@5.x and browserify + return err.annotated || err.message + } +} diff --git a/node_modules/watchify-middleware/package.json b/node_modules/watchify-middleware/package.json new file mode 100644 index 000000000..2f7384abc --- /dev/null +++ b/node_modules/watchify-middleware/package.json @@ -0,0 +1,84 @@ +{ + "_from": "watchify-middleware@^1.8.0", + "_id": "watchify-middleware@1.8.0", + "_inBundle": false, + "_integrity": "sha512-INYU5/3zTZtWQvJKPelr47j0JeLTZK4GUDF0PoMltMPzMUEh/lW6g1t+Qe/tGHxm70AUc0NQrth3k3PTfOU9Nw==", + "_location": "/watchify-middleware", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "watchify-middleware@^1.8.0", + "name": "watchify-middleware", + "escapedName": "watchify-middleware", + "rawSpec": "^1.8.0", + "saveSpec": null, + "fetchSpec": "^1.8.0" + }, + "_requiredBy": [ + "/budo" + ], + "_resolved": "https://registry.npmjs.org/watchify-middleware/-/watchify-middleware-1.8.0.tgz", + "_shasum": "8f7cb9c528022be8525a7e066c10e2fd8c544be6", + "_spec": "watchify-middleware@^1.8.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", + "author": { + "name": "Matt DesLauriers", + "email": "dave.des@gmail.com", + "url": "https://github.com/mattdesl" + }, + "bugs": { + "url": "https://github.com/mattdesl/watchify-middleware/issues" + }, + "bundleDependencies": false, + "dependencies": { + "concat-stream": "^1.5.0", + "debounce": "^1.0.0", + "events": "^1.0.2", + "object-assign": "^4.0.1", + "strip-ansi": "^3.0.0", + "watchify": "^3.3.1" + }, + "deprecated": false, + "description": "a server for faster watchify development", + "devDependencies": { + "babelify": "^6.3.0", + "brfs": "^1.4.1", + "browserify": "^11.2.0", + "faucet": "0.0.1", + "garnish": "^2.3.0", + "got": "^4.2.0", + "minimist": "^1.1.3", + "semver": "^5.0.3", + "simple-html-index": "^1.0.1", + "tape": "^4.2.0" + }, + "homepage": "https://github.com/mattdesl/watchify-middleware", + "keywords": [ + "watchify", + "server", + "fast", + "reload", + "incremental", + "suspend", + "request", + "response", + "wait", + "delay", + "live", + "browser", + "browserify" + ], + "license": "MIT", + "main": "index.js", + "name": "watchify-middleware", + "repository": { + "type": "git", + "url": "git://github.com/mattdesl/watchify-middleware.git" + }, + "scripts": { + "start": "node example/server.js ", + "test": "node test/index.js | faucet" + }, + "version": "1.8.0" +} diff --git a/node_modules/watchify/.travis.yml b/node_modules/watchify/.travis.yml new file mode 100644 index 000000000..d76c6d0e3 --- /dev/null +++ b/node_modules/watchify/.travis.yml @@ -0,0 +1,6 @@ +sudo: false +language: node_js +node_js: + - "0.10" + - "0.12" + - node diff --git a/node_modules/watchify/LICENSE b/node_modules/watchify/LICENSE new file mode 100644 index 000000000..ee27ba4b4 --- /dev/null +++ b/node_modules/watchify/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/watchify/bin/args.js b/node_modules/watchify/bin/args.js new file mode 100644 index 000000000..ccfdd3f8e --- /dev/null +++ b/node_modules/watchify/bin/args.js @@ -0,0 +1,16 @@ +var fromArgs = require('browserify/bin/args'); +var watchify = require('../'); +var defined = require('defined'); +var xtend = require('xtend'); + +module.exports = function (args) { + var b = fromArgs(args, watchify.args); + + var opts = {}; + var ignoreWatch = defined(b.argv['ignore-watch'], b.argv.iw); + if (ignoreWatch) { + opts.ignoreWatch = ignoreWatch; + } + + return watchify(b, xtend(opts, b.argv)); +}; diff --git a/node_modules/watchify/bin/cmd.js b/node_modules/watchify/bin/cmd.js new file mode 100755 index 000000000..59a43eb26 --- /dev/null +++ b/node_modules/watchify/bin/cmd.js @@ -0,0 +1,69 @@ +#!/usr/bin/env node + +var path = require('path'); +var outpipe = require('outpipe'); +var through = require('through2'); + +var fromArgs = require('./args.js'); +var w = fromArgs(process.argv.slice(2)); + +var outfile = w.argv.o || w.argv.outfile; +var verbose = w.argv.v || w.argv.verbose; + +if (w.argv.version) { + console.error('watchify v' + require('../package.json').version + + ' (in ' + path.resolve(__dirname, '..') + ')' + ); + console.error('browserify v' + require('browserify/package.json').version + + ' (in ' + path.dirname(require.resolve('browserify')) + ')' + ); + return; +} + +if (!outfile) { + console.error('You MUST specify an outfile with -o.'); + process.exit(1); +} + +var bytes, time; +w.on('bytes', function (b) { bytes = b }); +w.on('time', function (t) { time = t }); + +w.on('update', bundle); +bundle(); + +function bundle () { + var didError = false; + var writer = through(); + var wb = w.bundle(); + + w.pipeline.get('pack').once('readable', function() { + if (!didError) { + wb.pipe(writer); + } + }); + + wb.on('error', function (err) { + console.error(String(err)); + if (!didError) { + didError = true; + writer.end('console.error(' + JSON.stringify(String(err)) + ');'); + } + }); + + writer.once('readable', function() { + var outStream = outpipe(outfile); + outStream.on('error', function (err) { + console.error(err); + }); + outStream.on('exit', function () { + if (verbose && !didError) { + console.error(bytes + ' bytes written to ' + outfile + + ' (' + (time / 1000).toFixed(2) + ' seconds) at ' + + new Date().toLocaleTimeString() + ); + } + }); + writer.pipe(outStream); + }); +} diff --git a/node_modules/watchify/example/files/main.js b/node_modules/watchify/example/files/main.js new file mode 100644 index 000000000..a01098c10 --- /dev/null +++ b/node_modules/watchify/example/files/main.js @@ -0,0 +1,2 @@ +var one = require('./one'); +console.log(one(5)); diff --git a/node_modules/watchify/example/files/one.js b/node_modules/watchify/example/files/one.js new file mode 100644 index 000000000..75f7df68f --- /dev/null +++ b/node_modules/watchify/example/files/one.js @@ -0,0 +1,3 @@ +var two = require('./two'); + +module.exports = function (x) { return x * two(x + 5) }; diff --git a/node_modules/watchify/example/files/two.js b/node_modules/watchify/example/files/two.js new file mode 100644 index 000000000..5d48ef2d0 --- /dev/null +++ b/node_modules/watchify/example/files/two.js @@ -0,0 +1 @@ +module.exports = function (n) { return n * 11 }; diff --git a/node_modules/watchify/index.js b/node_modules/watchify/index.js new file mode 100644 index 000000000..0753b9f13 --- /dev/null +++ b/node_modules/watchify/index.js @@ -0,0 +1,165 @@ +var through = require('through2'); +var path = require('path'); +var chokidar = require('chokidar'); +var xtend = require('xtend'); +var anymatch = require('anymatch'); + +module.exports = watchify; +module.exports.args = { + cache: {}, packageCache: {} +}; + +function watchify (b, opts) { + if (!opts) opts = {}; + var cache = b._options.cache; + var pkgcache = b._options.packageCache; + var delay = typeof opts.delay === 'number' ? opts.delay : 100; + var changingDeps = {}; + var pending = false; + var updating = false; + + var wopts = {persistent: true}; + if (opts.ignoreWatch) { + var ignored = opts.ignoreWatch !== true + ? opts.ignoreWatch + : '**/node_modules/**'; + } + if (opts.poll || typeof opts.poll === 'number') { + wopts.usePolling = true; + wopts.interval = opts.poll !== true + ? opts.poll + : undefined; + } + + if (cache) { + b.on('reset', collect); + collect(); + } + + function collect () { + b.pipeline.get('deps').push(through.obj(function(row, enc, next) { + var file = row.expose ? b._expose[row.id] : row.file; + cache[file] = { + source: row.source, + deps: xtend(row.deps) + }; + this.push(row); + next(); + })); + } + + b.on('file', function (file) { + watchFile(file); + }); + + b.on('package', function (pkg) { + var file = path.join(pkg.__dirname, 'package.json'); + watchFile(file); + if (pkgcache) pkgcache[file] = pkg; + }); + + b.on('reset', reset); + reset(); + + function reset () { + var time = null; + var bytes = 0; + b.pipeline.get('record').on('end', function () { + time = Date.now(); + }); + + b.pipeline.get('wrap').push(through(write, end)); + function write (buf, enc, next) { + bytes += buf.length; + this.push(buf); + next(); + } + function end () { + var delta = Date.now() - time; + b.emit('time', delta); + b.emit('bytes', bytes); + b.emit('log', bytes + ' bytes written (' + + (delta / 1000).toFixed(2) + ' seconds)' + ); + this.push(null); + } + } + + var fwatchers = {}; + var fwatcherFiles = {}; + var ignoredFiles = {}; + + b.on('transform', function (tr, mfile) { + tr.on('file', function (dep) { + watchFile(mfile, dep); + }); + }); + b.on('bundle', function (bundle) { + updating = true; + bundle.on('error', onend); + bundle.on('end', onend); + function onend () { updating = false } + }); + + function watchFile (file, dep) { + dep = dep || file; + if (ignored) { + if (!ignoredFiles.hasOwnProperty(file)) { + ignoredFiles[file] = anymatch(ignored, file); + } + if (ignoredFiles[file]) return; + } + if (!fwatchers[file]) fwatchers[file] = []; + if (!fwatcherFiles[file]) fwatcherFiles[file] = []; + if (fwatcherFiles[file].indexOf(dep) >= 0) return; + + var w = b._watcher(dep, wopts); + w.setMaxListeners(0); + w.on('error', b.emit.bind(b, 'error')); + w.on('change', function () { + invalidate(file); + }); + fwatchers[file].push(w); + fwatcherFiles[file].push(dep); + } + + function invalidate (id) { + if (cache) delete cache[id]; + if (pkgcache) delete pkgcache[id]; + changingDeps[id] = true; + + if (!updating && fwatchers[id]) { + fwatchers[id].forEach(function (w) { + w.close(); + }); + delete fwatchers[id]; + delete fwatcherFiles[id]; + } + + // wait for the disk/editor to quiet down first: + if (pending) clearTimeout(pending); + pending = setTimeout(notify, delay); + } + + function notify () { + if (updating) { + pending = setTimeout(notify, delay); + } else { + pending = false; + b.emit('update', Object.keys(changingDeps)); + changingDeps = {}; + } + } + + b.close = function () { + Object.keys(fwatchers).forEach(function (id) { + fwatchers[id].forEach(function (w) { w.close() }); + }); + }; + + b._watcher = function (file, opts) { + return chokidar.watch(file, opts); + }; + + return b; +} diff --git a/node_modules/watchify/package.json b/node_modules/watchify/package.json new file mode 100644 index 000000000..164242f12 --- /dev/null +++ b/node_modules/watchify/package.json @@ -0,0 +1,76 @@ +{ + "_from": "watchify@^3.3.1", + "_id": "watchify@3.11.0", + "_inBundle": false, + "_integrity": "sha512-7jWG0c3cKKm2hKScnSAMUEUjRJKXUShwMPk0ASVhICycQhwND3IMAdhJYmc1mxxKzBUJTSF5HZizfrKrS6BzkA==", + "_location": "/watchify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "watchify@^3.3.1", + "name": "watchify", + "escapedName": "watchify", + "rawSpec": "^3.3.1", + "saveSpec": null, + "fetchSpec": "^3.3.1" + }, + "_requiredBy": [ + "/watchify-middleware" + ], + "_resolved": "https://registry.npmjs.org/watchify/-/watchify-3.11.0.tgz", + "_shasum": "03f1355c643955e7ab8dcbf399f624644221330f", + "_spec": "watchify@^3.3.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/watchify-middleware", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bin": { + "watchify": "bin/cmd.js" + }, + "bugs": { + "url": "https://github.com/substack/watchify/issues" + }, + "bundleDependencies": false, + "dependencies": { + "anymatch": "^1.3.0", + "browserify": "^16.1.0", + "chokidar": "^1.0.0", + "defined": "^1.0.0", + "outpipe": "^1.1.0", + "through2": "^2.0.0", + "xtend": "^4.0.0" + }, + "deprecated": false, + "description": "watch mode for browserify builds", + "devDependencies": { + "brfs": "^1.0.1", + "mkdirp": "~0.5.1", + "split": "^1.0.0", + "tape": "^4.2.2", + "uglify-js": "^2.5.0", + "win-spawn": "^2.0.0" + }, + "homepage": "https://github.com/substack/watchify", + "keywords": [ + "browserify", + "browserify-tool", + "watch", + "bundle", + "build", + "browser" + ], + "license": "MIT", + "main": "index.js", + "name": "watchify", + "repository": { + "type": "git", + "url": "git://github.com/substack/watchify.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "version": "3.11.0" +} diff --git a/node_modules/watchify/readme.markdown b/node_modules/watchify/readme.markdown new file mode 100644 index 000000000..5904f843a --- /dev/null +++ b/node_modules/watchify/readme.markdown @@ -0,0 +1,233 @@ +# watchify + +watch mode for [browserify](https://github.com/substack/node-browserify) builds + +[![build status](https://secure.travis-ci.org/substack/watchify.svg?branch=master)](http://travis-ci.org/substack/watchify) + +Update any source file and your browserify bundle will be recompiled on the +spot. + +# example + +``` +$ watchify main.js -o static/bundle.js +``` + +Now as you update files, `static/bundle.js` will be automatically +incrementally rebuilt on the fly. + +The `-o` option can be a file or a shell command (not available on Windows) +that receives piped input: + +``` sh +watchify main.js -o 'exorcist static/bundle.js.map > static/bundle.js' -d +``` + +``` sh +watchify main.js -o 'uglifyjs -cm > static/bundle.min.js' +``` + +You can use `-v` to get more verbose output to show when a file was written and how long the bundling took (in seconds): + +``` +$ watchify browser.js -d -o static/bundle.js -v +610598 bytes written to static/bundle.js (0.23 seconds) at 8:31:25 PM +610606 bytes written to static/bundle.js (0.10 seconds) at 8:45:59 PM +610597 bytes written to static/bundle.js (0.14 seconds) at 8:46:02 PM +610606 bytes written to static/bundle.js (0.08 seconds) at 8:50:13 PM +610597 bytes written to static/bundle.js (0.08 seconds) at 8:58:16 PM +610597 bytes written to static/bundle.js (0.19 seconds) at 9:10:45 PM +``` + +# usage + +Use `watchify` with all the same options as `browserify` except that `-o` (or +`--outfile`) is mandatory. Additionally, there are also: + +``` +Standard Options: + + --outfile=FILE, -o FILE + + This option is required. Write the browserify bundle to this file. If + the file contains the operators `|` or `>`, it will be treated as a + shell command, and the output will be piped to it. + + --verbose, -v [default: false] + + Show when a file was written and how long the bundling took (in + seconds). + + --version + + Show the watchify and browserify versions with their module paths. +``` + +``` +Advanced Options: + + --delay [default: 100] + + Amount of time in milliseconds to wait before emitting an "update" + event after a change. + + --ignore-watch=GLOB, --iw GLOB [default: false] + + Ignore monitoring files for changes that match the pattern. Omitting + the pattern will default to "**/node_modules/**". + + --poll=INTERVAL [default: false] + + Use polling to monitor for changes. Omitting the interval will default + to 100ms. This option is useful if you're watching an NFS volume. +``` + +# methods + +``` js +var watchify = require('watchify'); +``` + +## watchify(b, opts) + +watchify is a browserify [plugin](https://github.com/substack/node-browserify#bpluginplugin-opts), so it can be applied like any other plugin. +However, when creating the browserify instance `b`, **you MUST set the `cache` +and `packageCache` properties**: + +``` js +var b = browserify({ cache: {}, packageCache: {} }); +b.plugin(watchify); +``` + +```js +var b = browserify({ + cache: {}, + packageCache: {}, + plugin: [watchify] +}); +``` + +**By default, watchify doesn't display any output, see [events](https://github.com/substack/watchify#events) for more info.** + +`b` continues to behave like a browserify instance except that it caches file +contents and emits an `'update'` event when a file changes. You should call +`b.bundle()` after the `'update'` event fires to generate a new bundle. +Calling `b.bundle()` extra times past the first time will be much faster due +to caching. + +**Important:** Watchify will not emit `'update'` events until you've called +`b.bundle()` once and completely drained the stream it returns. + +```js +var fs = require('fs'); +var browserify = require('browserify'); +var watchify = require('watchify'); + +var b = browserify({ + entries: ['path/to/entry.js'], + cache: {}, + packageCache: {}, + plugin: [watchify] +}); + +b.on('update', bundle); +bundle(); + +function bundle() { + b.bundle().pipe(fs.createWriteStream('output.js')); +} +``` + +### options + +You can to pass an additional options object as a second parameter of +watchify. Its properties are: + +`opts.delay` is the amount of time in milliseconds to wait before emitting +an "update" event after a change. Defaults to `100`. + +`opts.ignoreWatch` ignores monitoring files for changes. If set to `true`, +then `**/node_modules/**` will be ignored. For other possible values see +Chokidar's [documentation](https://github.com/paulmillr/chokidar#path-filtering) on "ignored". + +`opts.poll` enables polling to monitor for changes. If set to `true`, then +a polling interval of 100ms is used. If set to a number, then that amount of +milliseconds will be the polling interval. For more info see Chokidar's +[documentation](https://github.com/paulmillr/chokidar#performance) on +"usePolling" and "interval". +**This option is useful if you're watching an NFS volume.** + +```js +var b = browserify({ cache: {}, packageCache: {} }); +// watchify defaults: +b.plugin(watchify, { + delay: 100, + ignoreWatch: ['**/node_modules/**'], + poll: false +}); +``` + +## b.close() + +Close all the open watch handles. + +# events + +## b.on('update', function (ids) {}) + +When the bundle changes, emit the array of bundle `ids` that changed. + +## b.on('bytes', function (bytes) {}) + +When a bundle is generated, this event fires with the number of bytes. + +## b.on('time', function (time) {}) + +When a bundle is generated, this event fires with the time it took to create the +bundle in milliseconds. + +## b.on('log', function (msg) {}) + +This event fires after a bundle was created with messages of the form: + +``` +X bytes written (Y seconds) +``` + +with the number of bytes in the bundle X and the time in seconds Y. + +# install + +With [npm](https://npmjs.org) do: + +``` +$ npm install -g watchify +``` + +to get the watchify command and: + +``` +$ npm install watchify +``` + +to get just the library. + +# troubleshooting + +## rebuilds on OS X never trigger + +It may be related to a bug in `fsevents` (see [#250](https://github.com/substack/watchify/issues/205#issuecomment-98672850) +and [stackoverflow](http://stackoverflow.com/questions/26708205/webpack-watch-isnt-compiling-changed-files/28610124#28610124)). +Try the `--poll` flag +and/or renaming the project's directory - that might help. + +# see also + +- [budo](https://www.npmjs.com/package/budo) – a simple development server built on watchify +- [errorify](https://www.npmjs.com/package/errorify) – a plugin to add error handling to watchify development +- [watchify-request](https://www.npmjs.com/package/watchify-request) – wraps a `watchify` instance to avoid stale bundles in HTTP requests +- [watchify-middleware](https://www.npmjs.com/package/watchify-middleware) – similar to `watchify-request`, but includes some higher-level features + +# license + +MIT diff --git a/node_modules/watchify/test/api.js b/node_modules/watchify/test/api.js new file mode 100644 index 000000000..5877b2a3b --- /dev/null +++ b/node_modules/watchify/test/api.js @@ -0,0 +1,44 @@ +var test = require('tape'); +var watchify = require('../'); +var browserify = require('browserify'); +var vm = require('vm'); + +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); + +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var file = path.join(tmpdir, 'main.js'); + +mkdirp.sync(tmpdir); +fs.writeFileSync(file, 'console.log(555)'); + +test('api', function (t) { + t.plan(5); + var w = watchify(browserify(file, watchify.args)); + w.on('update', function () { + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), '333\n'); + w.close(); + }); + }); + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), '555\n'); + setTimeout(function () { + fs.writeFile(file, 'console.log(333)', function (err) { + t.ifError(err); + }); + }, 1000); + }); +}); + +function run (src) { + var output = ''; + function log (msg) { output += msg + '\n' } + vm.runInNewContext(src, { console: { log: log } }); + return output; +} diff --git a/node_modules/watchify/test/api_brfs.js b/node_modules/watchify/test/api_brfs.js new file mode 100644 index 000000000..0078d4521 --- /dev/null +++ b/node_modules/watchify/test/api_brfs.js @@ -0,0 +1,53 @@ +var test = require('tape'); +var watchify = require('../'); +var browserify = require('browserify'); +var vm = require('vm'); + +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); + +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + lines: path.join(tmpdir, 'lines.txt') +}; + +mkdirp.sync(tmpdir); +fs.writeFileSync(files.main, [ + 'var fs = require("fs");', + 'var src = fs.readFileSync(__dirname + "/lines.txt", "utf8");', + 'console.log(src.toUpperCase());' +].join('\n')); +fs.writeFileSync(files.lines, 'beep\nboop'); + +test('api with brfs', function (t) { + t.plan(5); + var w = watchify(browserify(files.main, watchify.args)); + w.transform('brfs'); + w.on('update', function () { + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), 'ROBO-BOOGIE\n'); + w.close(); + }); + }); + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), 'BEEP\nBOOP\n'); + setTimeout(function () { + fs.writeFile(files.lines, 'rObO-bOOgie', function (err) { + t.ifError(err); + }); + }, 1000); + }); +}); + +function run (src) { + var output = ''; + function log (msg) { output += msg + '\n' } + vm.runInNewContext(src, { console: { log: log } }); + return output; +} diff --git a/node_modules/watchify/test/api_ignore_watch.js b/node_modules/watchify/test/api_ignore_watch.js new file mode 100644 index 000000000..17139a38a --- /dev/null +++ b/node_modules/watchify/test/api_ignore_watch.js @@ -0,0 +1,60 @@ +var test = require('tape'); +var watchify = require('../'); +var browserify = require('browserify'); +var vm = require('vm'); + +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); + +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + beep: path.join(tmpdir, 'beep.js'), + boop: path.join(tmpdir, 'boop.js'), + robot: path.join(tmpdir, 'node_modules', 'robot', 'index.js') +}; + +mkdirp.sync(tmpdir); +mkdirp.sync(path.dirname(files.robot)); +fs.writeFileSync(files.main, [ + 'var beep = require("./beep");', + 'var boop = require("./boop");', + 'var robot = require("robot");', + 'console.log(beep + " " + boop + " " + robot);' +].join('\n')); +fs.writeFileSync(files.beep, 'module.exports = "beep";'); +fs.writeFileSync(files.boop, 'module.exports = "boop";'); +fs.writeFileSync(files.robot, 'module.exports = "robot";'); + +test('api ignore watch', function (t) { + t.plan(4); + var w = watchify(browserify(files.main, watchify.args), { + ignoreWatch: '**/be*.js' + }); + w.on('update', function () { + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), 'beep BOOP ROBOT\n'); + w.close(); + }); + }); + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), 'beep boop robot\n'); + setTimeout(function () { + fs.writeFileSync(files.beep, 'module.exports = "BEEP";'); + fs.writeFileSync(files.boop, 'module.exports = "BOOP";'); + fs.writeFileSync(files.robot, 'module.exports = "ROBOT";'); + }, 1000); + }); +}); + +function run (src) { + var output = ''; + function log (msg) { output += msg + '\n' } + vm.runInNewContext(src, { console: { log: log } }); + return output; +} diff --git a/node_modules/watchify/test/api_ignore_watch_default.js b/node_modules/watchify/test/api_ignore_watch_default.js new file mode 100644 index 000000000..9a7a48dc4 --- /dev/null +++ b/node_modules/watchify/test/api_ignore_watch_default.js @@ -0,0 +1,60 @@ +var test = require('tape'); +var watchify = require('../'); +var browserify = require('browserify'); +var vm = require('vm'); + +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); + +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + beep: path.join(tmpdir, 'beep.js'), + boop: path.join(tmpdir, 'boop.js'), + robot: path.join(tmpdir, 'node_modules', 'robot', 'index.js') +}; + +mkdirp.sync(tmpdir); +mkdirp.sync(path.dirname(files.robot)); +fs.writeFileSync(files.main, [ + 'var beep = require("./beep");', + 'var boop = require("./boop");', + 'var robot = require("robot");', + 'console.log(beep + " " + boop + " " + robot);' +].join('\n')); +fs.writeFileSync(files.beep, 'module.exports = "beep";'); +fs.writeFileSync(files.boop, 'module.exports = "boop";'); +fs.writeFileSync(files.robot, 'module.exports = "robot";'); + +test('api ignore watch default', function (t) { + t.plan(4); + var w = watchify(browserify(files.main, watchify.args), { + ignoreWatch: true + }); + w.on('update', function () { + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), 'BEEP BOOP robot\n'); + w.close(); + }); + }); + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), 'beep boop robot\n'); + setTimeout(function () { + fs.writeFileSync(files.beep, 'module.exports = "BEEP";'); + fs.writeFileSync(files.boop, 'module.exports = "BOOP";'); + fs.writeFileSync(files.robot, 'module.exports = "ROBOT";'); + }, 1000); + }); +}); + +function run (src) { + var output = ''; + function log (msg) { output += msg + '\n' } + vm.runInNewContext(src, { console: { log: log } }); + return output; +} diff --git a/node_modules/watchify/test/api_ignore_watch_multiple.js b/node_modules/watchify/test/api_ignore_watch_multiple.js new file mode 100644 index 000000000..91857ef57 --- /dev/null +++ b/node_modules/watchify/test/api_ignore_watch_multiple.js @@ -0,0 +1,60 @@ +var test = require('tape'); +var watchify = require('../'); +var browserify = require('browserify'); +var vm = require('vm'); + +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); + +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + beep: path.join(tmpdir, 'beep.js'), + boop: path.join(tmpdir, 'boop.js'), + robot: path.join(tmpdir, 'node_modules', 'robot', 'index.js') +}; + +mkdirp.sync(tmpdir); +mkdirp.sync(path.dirname(files.robot)); +fs.writeFileSync(files.main, [ + 'var beep = require("./beep");', + 'var boop = require("./boop");', + 'var robot = require("robot");', + 'console.log(beep + " " + boop + " " + robot);' +].join('\n')); +fs.writeFileSync(files.beep, 'module.exports = "beep";'); +fs.writeFileSync(files.boop, 'module.exports = "boop";'); +fs.writeFileSync(files.robot, 'module.exports = "robot";'); + +test('api ignore watch multiple paths', function (t) { + t.plan(4); + var w = watchify(browserify(files.main, watchify.args), { + ignoreWatch: ['**/be*.js', '**/robot/*.js'] + }); + w.on('update', function () { + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), 'beep BOOP robot\n'); + w.close(); + }); + }); + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), 'beep boop robot\n'); + setTimeout(function () { + fs.writeFileSync(files.beep, 'module.exports = "BEEP";'); + fs.writeFileSync(files.boop, 'module.exports = "BOOP";'); + fs.writeFileSync(files.robot, 'module.exports = "ROBOT";'); + }, 1000); + }); +}); + +function run (src) { + var output = ''; + function log (msg) { output += msg + '\n' } + vm.runInNewContext(src, { console: { log: log } }); + return output; +} diff --git a/node_modules/watchify/test/api_implicit_cache.js b/node_modules/watchify/test/api_implicit_cache.js new file mode 100644 index 000000000..0f1152805 --- /dev/null +++ b/node_modules/watchify/test/api_implicit_cache.js @@ -0,0 +1,44 @@ +var test = require('tape'); +var watchify = require('../'); +var browserify = require('browserify'); +var vm = require('vm'); + +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); + +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var file = path.join(tmpdir, 'main.js'); + +mkdirp.sync(tmpdir); +fs.writeFileSync(file, 'console.log(555)'); + +test('api implicit cache', function (t) { + t.plan(5); + var w = watchify(browserify(file)); + w.on('update', function () { + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), '333\n'); + w.close(); + }); + }); + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), '555\n'); + setTimeout(function () { + fs.writeFile(file, 'console.log(333)', function (err) { + t.ifError(err); + }); + }, 1000); + }); +}); + +function run (src) { + var output = ''; + function log (msg) { output += msg + '\n' } + vm.runInNewContext(src, { console: { log: log } }); + return output; +} diff --git a/node_modules/watchify/test/bin.js b/node_modules/watchify/test/bin.js new file mode 100644 index 000000000..c72a02faf --- /dev/null +++ b/node_modules/watchify/test/bin.js @@ -0,0 +1,52 @@ +var test = require('tape'); +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var spawn = require('win-spawn'); +var split = require('split'); + +var cmd = path.resolve(__dirname, '../bin/cmd.js'); +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + bundle: path.join(tmpdir, 'bundle.js') +}; + +mkdirp.sync(tmpdir); +fs.writeFileSync(files.main, 'console.log(555)'); + +test('bin', function (t) { + t.plan(5); + var ps = spawn(cmd, [ files.main, '-o', files.bundle, '-v' ]); + var lineNum = 0; + ps.stderr.pipe(split()).on('data', function (line) { + lineNum ++; + if (lineNum === 1) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, '555\n'); + fs.writeFile(files.main, 'console.log(333)', t.ifError); + }) + } + else if (lineNum === 2) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, '333\n'); + ps.kill(); + }); + } + }); +}); + +function run (file, cb) { + var ps = spawn(process.execPath, [ file ]); + var data = []; + ps.stdout.on('data', function (buf) { data.push(buf) }); + ps.stdout.on('end', function () { + cb(null, Buffer.concat(data).toString('utf8')); + }); + ps.on('error', cb); + return ps; +} diff --git a/node_modules/watchify/test/bin_brfs.js b/node_modules/watchify/test/bin_brfs.js new file mode 100644 index 000000000..114437789 --- /dev/null +++ b/node_modules/watchify/test/bin_brfs.js @@ -0,0 +1,62 @@ +var test = require('tape'); +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var spawn = require('win-spawn'); +var split = require('split'); + +var cmd = path.resolve(__dirname, '../bin/cmd.js'); +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + lines: path.join(tmpdir, 'lines.txt'), + bundle: path.join(tmpdir, 'bundle.js') +}; + +mkdirp.sync(tmpdir); +fs.writeFileSync(files.main, [ + 'var fs = require("fs");', + 'var src = fs.readFileSync(__dirname + "/lines.txt", "utf8");', + 'console.log(src.toUpperCase());' +].join('\n')); +fs.writeFileSync(files.lines, 'beep\nboop'); + +test('bin brfs', function (t) { + t.plan(5); + var ps = spawn(cmd, [ + files.main, + '-t', require.resolve('brfs'), '-v', + '-o', files.bundle + ]); + var lineNum = 0; + ps.stderr.pipe(split()).on('data', function (line) { + lineNum ++; + if (lineNum === 1) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, 'BEEP\nBOOP\n'); + fs.writeFile(files.lines, 'robo-bOOgie', t.ifError); + }) + } + else if (lineNum === 2) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, 'ROBO-BOOGIE\n'); + ps.kill(); + }); + } + }); +}); + +function run (file, cb) { + var ps = spawn(process.execPath, [ file ]); + var data = []; + ps.stdout.on('data', function (buf) { data.push(buf) }); + ps.stdout.on('end', function () { + cb(null, Buffer.concat(data).toString('utf8')); + }); + ps.on('error', cb); + return ps; +} diff --git a/node_modules/watchify/test/bin_ignore_watch.js b/node_modules/watchify/test/bin_ignore_watch.js new file mode 100644 index 000000000..358090f71 --- /dev/null +++ b/node_modules/watchify/test/bin_ignore_watch.js @@ -0,0 +1,71 @@ +var test = require('tape'); +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var spawn = require('win-spawn'); +var split = require('split'); + +var cmd = path.resolve(__dirname, '../bin/cmd.js'); +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + beep: path.join(tmpdir, 'beep.js'), + boop: path.join(tmpdir, 'boop.js'), + robot: path.join(tmpdir, 'node_modules', 'robot', 'index.js'), + bundle: path.join(tmpdir, 'bundle.js') +}; + +mkdirp.sync(tmpdir); +mkdirp.sync(path.dirname(files.robot)); +fs.writeFileSync(files.main, [ + 'var beep = require("./beep");', + 'var boop = require("./boop");', + 'var robot = require("robot");', + 'console.log(beep + " " + boop + " " + robot);' +].join('\n')); +fs.writeFileSync(files.beep, 'module.exports = "beep";'); +fs.writeFileSync(files.boop, 'module.exports = "boop";'); +fs.writeFileSync(files.robot, 'module.exports = "robot";'); + +test('api ignore watch', function (t) { + t.plan(4); + var ps = spawn(cmd, [ + files.main, + '--ignore-watch', '**/be*.js', + '-o', files.bundle, + '-v' + ]); + var lineNum = 0; + ps.stderr.pipe(split()).on('data', function (line) { + lineNum ++; + if (lineNum === 1) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, 'beep boop robot\n'); + fs.writeFileSync(files.beep, 'module.exports = "BEEP";'); + fs.writeFileSync(files.boop, 'module.exports = "BOOP";'); + fs.writeFileSync(files.robot, 'module.exports = "ROBOT";'); + }); + } + else if (lineNum === 2) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, 'beep BOOP ROBOT\n'); + ps.kill(); + }); + } + }); +}); + +function run (file, cb) { + var ps = spawn(process.execPath, [ file ]); + var data = []; + ps.stdout.on('data', function (buf) { data.push(buf) }); + ps.stdout.on('end', function () { + cb(null, Buffer.concat(data).toString('utf8')); + }); + ps.on('error', cb); + return ps; +} diff --git a/node_modules/watchify/test/bin_ignore_watch_default.js b/node_modules/watchify/test/bin_ignore_watch_default.js new file mode 100644 index 000000000..f70134880 --- /dev/null +++ b/node_modules/watchify/test/bin_ignore_watch_default.js @@ -0,0 +1,71 @@ +var test = require('tape'); +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var spawn = require('win-spawn'); +var split = require('split'); + +var cmd = path.resolve(__dirname, '../bin/cmd.js'); +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + beep: path.join(tmpdir, 'beep.js'), + boop: path.join(tmpdir, 'boop.js'), + robot: path.join(tmpdir, 'node_modules', 'robot', 'index.js'), + bundle: path.join(tmpdir, 'bundle.js') +}; + +mkdirp.sync(tmpdir); +mkdirp.sync(path.dirname(files.robot)); +fs.writeFileSync(files.main, [ + 'var beep = require("./beep");', + 'var boop = require("./boop");', + 'var robot = require("robot");', + 'console.log(beep + " " + boop + " " + robot);' +].join('\n')); +fs.writeFileSync(files.beep, 'module.exports = "beep";'); +fs.writeFileSync(files.boop, 'module.exports = "boop";'); +fs.writeFileSync(files.robot, 'module.exports = "robot";'); + +test('api ignore watch', function (t) { + t.plan(4); + var ps = spawn(cmd, [ + files.main, + '--ignore-watch', + '-o', files.bundle, + '-v' + ]); + var lineNum = 0; + ps.stderr.pipe(split()).on('data', function (line) { + lineNum ++; + if (lineNum === 1) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, 'beep boop robot\n'); + fs.writeFileSync(files.beep, 'module.exports = "BEEP";'); + fs.writeFileSync(files.boop, 'module.exports = "BOOP";'); + fs.writeFileSync(files.robot, 'module.exports = "ROBOT";'); + }); + } + else if (lineNum === 2) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, 'BEEP BOOP robot\n'); + ps.kill(); + }); + } + }); +}); + +function run (file, cb) { + var ps = spawn(process.execPath, [ file ]); + var data = []; + ps.stdout.on('data', function (buf) { data.push(buf) }); + ps.stdout.on('end', function () { + cb(null, Buffer.concat(data).toString('utf8')); + }); + ps.on('error', cb); + return ps; +} diff --git a/node_modules/watchify/test/bin_ignore_watch_multiple.js b/node_modules/watchify/test/bin_ignore_watch_multiple.js new file mode 100644 index 000000000..37ff91f99 --- /dev/null +++ b/node_modules/watchify/test/bin_ignore_watch_multiple.js @@ -0,0 +1,72 @@ +var test = require('tape'); +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var spawn = require('win-spawn'); +var split = require('split'); + +var cmd = path.resolve(__dirname, '../bin/cmd.js'); +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + beep: path.join(tmpdir, 'beep.js'), + boop: path.join(tmpdir, 'boop.js'), + robot: path.join(tmpdir, 'node_modules', 'robot', 'index.js'), + bundle: path.join(tmpdir, 'bundle.js') +}; + +mkdirp.sync(tmpdir); +mkdirp.sync(path.dirname(files.robot)); +fs.writeFileSync(files.main, [ + 'var beep = require("./beep");', + 'var boop = require("./boop");', + 'var robot = require("robot");', + 'console.log(beep + " " + boop + " " + robot);' +].join('\n')); +fs.writeFileSync(files.beep, 'module.exports = "beep";'); +fs.writeFileSync(files.boop, 'module.exports = "boop";'); +fs.writeFileSync(files.robot, 'module.exports = "robot";'); + +test('api ignore watch multiple paths', function (t) { + t.plan(4); + var ps = spawn(cmd, [ + files.main, + '--ignore-watch', '**/be*.js', + '--ignore-watch', '**/robot/*.js', + '-o', files.bundle, + '-v' + ]); + var lineNum = 0; + ps.stderr.pipe(split()).on('data', function (line) { + lineNum ++; + if (lineNum === 1) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, 'beep boop robot\n'); + fs.writeFileSync(files.beep, 'module.exports = "BEEP";'); + fs.writeFileSync(files.boop, 'module.exports = "BOOP";'); + fs.writeFileSync(files.robot, 'module.exports = "ROBOT";'); + }); + } + else if (lineNum === 2) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, 'beep BOOP robot\n'); + ps.kill(); + }); + } + }); +}); + +function run (file, cb) { + var ps = spawn(process.execPath, [ file ]); + var data = []; + ps.stdout.on('data', function (buf) { data.push(buf) }); + ps.stdout.on('end', function () { + cb(null, Buffer.concat(data).toString('utf8')); + }); + ps.on('error', cb); + return ps; +} diff --git a/node_modules/watchify/test/bin_pipe.js b/node_modules/watchify/test/bin_pipe.js new file mode 100644 index 000000000..02f14d0a0 --- /dev/null +++ b/node_modules/watchify/test/bin_pipe.js @@ -0,0 +1,56 @@ +var test = require('tape'); +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var spawn = require('win-spawn'); +var split = require('split'); + +var cmd = path.resolve(__dirname, '../bin/cmd.js'); +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + bundle: path.join(tmpdir, 'bundle.js') +}; + +mkdirp.sync(tmpdir); +fs.writeFileSync(files.main, 'console.log(num * 2)'); + +test('bin with pipe', function (t) { + t.plan(5); + var ps = spawn(cmd, [ + files.main, + '-o', 'uglifyjs - --enclose 11:num > ' + files.bundle, + '-v' + ]); + var lineNum = 0; + ps.stderr.pipe(split()).on('data', function (line) { + lineNum ++; + if (lineNum === 1) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, '22\n'); + fs.writeFile(files.main, 'console.log(num * 3)', t.ifError); + }); + } + else if (lineNum === 2) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, '33\n'); + ps.kill(); + }); + } + }); +}); + +function run (file, cb) { + var ps = spawn(process.execPath, [ file ]); + var data = []; + ps.stdout.on('data', function (buf) { data.push(buf) }); + ps.stdout.on('end', function () { + cb(null, Buffer.concat(data).toString('utf8')); + }); + ps.on('error', cb); + return ps; +} diff --git a/node_modules/watchify/test/bin_plugins_pipelining_multiple_errors.js b/node_modules/watchify/test/bin_plugins_pipelining_multiple_errors.js new file mode 100644 index 000000000..cdc701704 --- /dev/null +++ b/node_modules/watchify/test/bin_plugins_pipelining_multiple_errors.js @@ -0,0 +1,56 @@ +var test = require('tape'); +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var spawn = require('win-spawn'); +var split = require('split'); + +var cmd = path.resolve(__dirname, '../bin/cmd.js'); +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + plugin: path.join(tmpdir, 'plugin.js'), + bundle: path.join(tmpdir, 'bundle.js') +}; + +mkdirp.sync(tmpdir); +fs.writeFileSync(files.plugin, [ + 'module.exports = function(b, opts) {', + ' b.on("file", function (file, id) {', + ' b.pipeline.emit("error", "bad boop");', + ' b.pipeline.emit("error", "bad boop");', + ' });', + '};', +].join('\n')); +fs.writeFileSync(files.main, 'boop\nbeep'); + +test('bin plugins pipelining multiple errors', function (t) { + t.plan(4); + var ps = spawn(cmd, [ + files.main, + '-p', files.plugin, '-v', + '-o', files.bundle + ]); + var lineNum = 0; + ps.stderr.pipe(split()).on('data', function (line) { + lineNum ++; + if (lineNum === 1) { + t.equal(line, 'bad boop'); + } + if (lineNum === 2) { + t.equal(line, 'bad boop'); + setTimeout(function() { + fs.writeFileSync(files.main, 'beep\nboop'); + }, 1000); + } + if (lineNum === 3) { + t.equal(line, 'bad boop'); + } + if (lineNum === 4) { + t.equal(line, 'bad boop'); + ps.kill(); + } + }); +}); diff --git a/node_modules/watchify/test/bin_standalone.js b/node_modules/watchify/test/bin_standalone.js new file mode 100644 index 000000000..f3f3dcfe4 --- /dev/null +++ b/node_modules/watchify/test/bin_standalone.js @@ -0,0 +1,52 @@ +var test = require('tape'); +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var spawn = require('win-spawn'); +var split = require('split'); + +var cmd = path.resolve(__dirname, '../bin/cmd.js'); +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + bundle: path.join(tmpdir, 'bundle.js') +}; + +mkdirp.sync(tmpdir); +fs.writeFileSync(files.main, 'console.log(555)'); + +test('bin with standalone', function (t) { + t.plan(5); + var ps = spawn(cmd, [ files.main, '-o', files.bundle, '-v', '-s', 'XXX' ]); + var lineNum = 0; + ps.stderr.pipe(split()).on('data', function (line) { + lineNum ++; + if (lineNum === 1) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, '555\n'); + fs.writeFile(files.main, 'console.log(333)', t.ifError); + }) + } + else if (lineNum === 2) { + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, '333\n'); + ps.kill(); + }); + } + }); +}); + +function run (file, cb) { + var ps = spawn(process.execPath, [ file ]); + var data = []; + ps.stdout.on('data', function (buf) { data.push(buf) }); + ps.stdout.on('end', function () { + cb(null, Buffer.concat(data).toString('utf8')); + }); + ps.on('error', cb); + return ps; +} diff --git a/node_modules/watchify/test/errors.js b/node_modules/watchify/test/errors.js new file mode 100644 index 000000000..059e553b8 --- /dev/null +++ b/node_modules/watchify/test/errors.js @@ -0,0 +1,56 @@ +var test = require('tape'); +var watchify = require('../'); +var browserify = require('browserify'); +var vm = require('vm'); + +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); + +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var file = path.join(tmpdir, 'main.js'); + +mkdirp.sync(tmpdir); +fs.writeFileSync(file, 'console.log(555)'); + +test('errors', function (t) { + t.plan(5); + var w = watchify(browserify(file, watchify.args)); + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), '555\n'); + breakTheBuild(); + }); + function breakTheBuild() { + setTimeout(function() { + fs.writeFileSync(file, 'console.log('); + }, 1000); + w.once('update', function () { + w.bundle(function (err, src) { + t.ok(err instanceof Error, 'should be error'); + fixTheBuild(); + }); + }); + } + function fixTheBuild() { + setTimeout(function() { + fs.writeFileSync(file, 'console.log(333)'); + }, 1000); + w.once('update', function () { + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), '333\n'); + w.close(); + }); + }); + } +}); + +function run (src) { + var output = ''; + function log (msg) { output += msg + '\n' } + vm.runInNewContext(src, { console: { log: log } }); + return output; +} diff --git a/node_modules/watchify/test/errors_transform.js b/node_modules/watchify/test/errors_transform.js new file mode 100644 index 000000000..c45869007 --- /dev/null +++ b/node_modules/watchify/test/errors_transform.js @@ -0,0 +1,83 @@ +var test = require('tape'); +var watchify = require('../'); +var browserify = require('browserify'); +var vm = require('vm'); + +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var through = require('through2'); + +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var main = path.join(tmpdir, 'main.js'); +var file = path.join(tmpdir, 'dep.jsnum'); + +mkdirp.sync(tmpdir); +fs.writeFileSync(main, 'require("./dep.jsnum")'); +fs.writeFileSync(file, 'console.log(555)'); + +function someTransform(file) { + if (!/\.jsnum$/.test(file)) { + return through(); + } + function write (chunk, enc, next) { + if (/\d/.test(chunk)) { + this.push(chunk); + } else { + this.emit('error', new Error('No number in this chunk')); + } + next(); + } + return through(write); +} + +test('errors in transform', function (t) { + t.plan(6); + var b = browserify(main, watchify.args); + b.transform(someTransform); + var w = watchify(b); + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), '555\n'); + breakTheBuild(); + }); + function breakTheBuild() { + setTimeout(function() { + fs.writeFileSync(file, 'console.log()'); + }, 1000); + w.once('update', function () { + w.bundle(function (err, src) { + t.ok(err instanceof Error, 'should be error'); + t.ok(/^No number in this chunk/.test(err.message)); + fixTheBuild(); + }); + }); + } + function fixTheBuild() { + setTimeout(function() { + fs.writeFileSync(file, 'console.log(333)'); + }, 1000); + var safety = setTimeout(function() { + t.fail("gave up waiting"); + w.close(); + t.end(); + }, 5000); + w.once('update', function () { + clearTimeout(safety); + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), '333\n'); + w.close(); + }); + }); + } +}); + +function run (src) { + var output = ''; + function log (msg) { output += msg + '\n' } + vm.runInNewContext(src, { console: { log: log } }); + return output; +} diff --git a/node_modules/watchify/test/expose.js b/node_modules/watchify/test/expose.js new file mode 100644 index 000000000..e42c62dee --- /dev/null +++ b/node_modules/watchify/test/expose.js @@ -0,0 +1,72 @@ +var test = require('tape'); +var watchify = require('../'); +var browserify = require('browserify'); +var vm = require('vm'); + +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); + +var os = require('os'); +var tmpbase = fs.realpathSync((os.tmpdir || os.tmpDir)()); +var tmpdir = path.join(tmpbase, 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + beep: path.join(tmpdir, 'beep.js'), + boop: path.join(tmpdir, 'boop.js'), + abc: path.join(tmpdir, 'lib', 'abc.js'), + xyz: path.join(tmpdir, 'lib', 'xyz.js') +}; + +mkdirp.sync(tmpdir); +mkdirp.sync(path.join(tmpdir, 'lib')); + +fs.writeFileSync(files.main, [ + 'var abc = require("abc");', + 'var xyz = require("xyz");', + 'var beep = require("./beep");', + 'console.log(abc + " " + xyz + " " + beep);' +].join('\n')); +fs.writeFileSync(files.beep, 'module.exports = require("./boop");'); +fs.writeFileSync(files.boop, 'module.exports = require("xyz");'); +fs.writeFileSync(files.abc, 'module.exports = "abc";'); +fs.writeFileSync(files.xyz, 'module.exports = "xyz";'); + +test('properly caches exposed files', function (t) { + t.plan(4); + var cache = {}; + var w = watchify(browserify({ + entries: [files.main], + basedir: tmpdir, + cache: cache, + packageCache: {} + })); + + w.require('./lib/abc', {expose: 'abc'}); + w.require('./lib/xyz', {expose: 'xyz'}); + w.on('update', function () { + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), 'ABC XYZ XYZ\n'); + w.close(); + }); + }); + w.bundle(function (err, src) { + t.ifError(err); + t.equal(run(src), 'abc xyz xyz\n'); + setTimeout(function () { + // If we're incorrectly caching exposed files, + // then "files.abc" would be re-read from disk. + cache[files.abc].source = 'module.exports = "ABC";'; + fs.writeFileSync(files.xyz, 'module.exports = "XYZ";'); + }, 1000); + }); +}); + +function run (src) { + var output = ''; + function log (msg) { output += msg + '\n' } + vm.runInNewContext(src, { console: { log: log } }); + return output; +} diff --git a/node_modules/watchify/test/many.js b/node_modules/watchify/test/many.js new file mode 100644 index 000000000..bc6b22cc1 --- /dev/null +++ b/node_modules/watchify/test/many.js @@ -0,0 +1,101 @@ +var test = require('tape'); +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var spawn = require('win-spawn'); +var split = require('split'); + +var cmd = path.resolve(__dirname, '../bin/cmd.js'); +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + robot: path.join(tmpdir, 'robot.js'), + lines: path.join(tmpdir, 'lines.txt'), + bundle: path.join(tmpdir, 'bundle.js') +}; + +var edits = [ + { file: 'lines', source: 'robo-boogie' }, + { file: 'lines', source: 'dinosaurus rex' }, + { + file: 'robot', + source: 'module.exports = function (n) { return n * 111 }', + next: true + }, + { file: 'main', source: [ + 'var fs = require("fs");', + 'var robot = require("./robot.js");', + 'var src = fs.readFileSync(__dirname + "/lines.txt", "utf8");', + 'console.log(src.toUpperCase() + " " + robot(src.length));' + ].join('\n') }, + { file: 'lines', source: 't-rex' }, + { + file: 'robot', + source: 'module.exports = function (n) { return n * 100 }', + } +]; + +var expected = [ + 'BEEP\nBOOP\n', + 'ROBO-BOOGIE\n', + 'DINOSAURUS REX\n', + 'DINOSAURUS REX 1554\n', + 'T-REX 555\n', + 'T-REX 500\n' +]; + +mkdirp.sync(tmpdir); +fs.writeFileSync(files.main, [ + 'var fs = require("fs");', + 'var src = fs.readFileSync(__dirname + "/lines.txt", "utf8");', + 'console.log(src.toUpperCase());' +].join('\n')); +fs.writeFileSync(files.lines, 'beep\nboop'); + +test('many edits', function (t) { + t.plan(expected.length * 2 + edits.length); + var ps = spawn(cmd, [ + files.main, + '-t', require.resolve('brfs'), '-v', + '-o', files.bundle + ]); + ps.stdout.pipe(process.stdout); + ps.stderr.pipe(process.stdout); + var lineNum = 0; + ps.stderr.pipe(split()).on('data', function (line) { + if (line.length === 0) return; + + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, expected.shift()); + + (function next () { + if (edits.length === 0) return; + var edit = edits.shift(); + setTimeout(function () { + fs.writeFile(files[edit.file], edit.source, function (err) { + t.ifError(err); + if (edit.next) next(); + }); + }, 25); + })(); + }) + }); + + t.on('end', function () { + ps.kill(); + }); +}); + +function run (file, cb) { + var ps = spawn(process.execPath, [ file ]); + var data = []; + ps.stdout.on('data', function (buf) { data.push(buf) }); + ps.stdout.on('end', function () { + cb(null, Buffer.concat(data).toString('utf8')); + }); + ps.on('error', cb); + return ps; +} diff --git a/node_modules/watchify/test/many_immediate.js b/node_modules/watchify/test/many_immediate.js new file mode 100644 index 000000000..290b95e83 --- /dev/null +++ b/node_modules/watchify/test/many_immediate.js @@ -0,0 +1,99 @@ +var test = require('tape'); +var fs = require('fs'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var spawn = require('win-spawn'); +var split = require('split'); + +var cmd = path.resolve(__dirname, '../bin/cmd.js'); +var os = require('os'); +var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); + +var files = { + main: path.join(tmpdir, 'main.js'), + robot: path.join(tmpdir, 'robot.js'), + lines: path.join(tmpdir, 'lines.txt'), + bundle: path.join(tmpdir, 'bundle.js') +}; + +var edits = [ + { file: 'lines', source: 'robo-boogie' }, + { file: 'lines', source: 'dinosaurus rex' }, + { + file: 'robot', + source: 'module.exports = function (n) { return n * 111 }', + next: true + }, + { file: 'main', source: [ + 'var fs = require("fs");', + 'var robot = require("./robot.js");', + 'var src = fs.readFileSync(__dirname + "/lines.txt", "utf8");', + 'console.log(src.toUpperCase() + " " + robot(src.length));' + ].join('\n') }, + { file: 'lines', source: 't-rex' }, + { + file: 'robot', + source: 'module.exports = function (n) { return n * 100 }', + } +]; + +var expected = [ + 'BEEP\nBOOP\n', + 'ROBO-BOOGIE\n', + 'DINOSAURUS REX\n', + 'DINOSAURUS REX 1554\n', + 'T-REX 555\n', + 'T-REX 500\n' +]; + +mkdirp.sync(tmpdir); +fs.writeFileSync(files.main, [ + 'var fs = require("fs");', + 'var src = fs.readFileSync(__dirname + "/lines.txt", "utf8");', + 'console.log(src.toUpperCase());' +].join('\n')); +fs.writeFileSync(files.lines, 'beep\nboop'); + +test('many immediate', function (t) { + t.plan(expected.length * 2 + edits.length); + var ps = spawn(cmd, [ + files.main, + '-t', require.resolve('brfs'), '-v', + '-o', files.bundle + ]); + ps.stdout.pipe(process.stdout); + ps.stderr.pipe(process.stdout); + var lineNum = 0; + ps.stderr.pipe(split()).on('data', function (line) { + if (line.length === 0) return; + + run(files.bundle, function (err, output) { + t.ifError(err); + t.equal(output, expected.shift()); + + (function next () { + if (edits.length === 0) return; + var edit = edits.shift(); + fs.writeFile(files[edit.file], edit.source, function (err) { + t.ifError(err); + if (edit.next) next(); + }); + })(); + }) + }); + + t.on('end', function () { + ps.kill(); + }); +}); + +function run (file, cb) { + var ps = spawn(process.execPath, [ file ]); + var data = []; + ps.stdout.on('data', function (buf) { data.push(buf) }); + ps.stdout.on('end', function () { + cb(null, Buffer.concat(data).toString('utf8')); + }); + ps.on('error', cb); + return ps; +} diff --git a/node_modules/watchify/test/zzz.js b/node_modules/watchify/test/zzz.js new file mode 100644 index 000000000..bf1ec9190 --- /dev/null +++ b/node_modules/watchify/test/zzz.js @@ -0,0 +1,10 @@ +var test = require('tape'); + +test('__END__', function (t) { + t.on('end', function () { + setTimeout(function () { + process.exit(0); + }, 100) + }); + t.end(); +}); diff --git a/node_modules/which/CHANGELOG.md b/node_modules/which/CHANGELOG.md new file mode 100644 index 000000000..3d83d2694 --- /dev/null +++ b/node_modules/which/CHANGELOG.md @@ -0,0 +1,152 @@ +# Changes + + +## 1.3.1 + +* update deps +* update travis + +## v1.3.0 + +* Add nothrow option to which.sync +* update tap + +## v1.2.14 + +* appveyor: drop node 5 and 0.x +* travis-ci: add node 6, drop 0.x + +## v1.2.13 + +* test: Pass missing option to pass on windows +* update tap +* update isexe to 2.0.0 +* neveragain.tech pledge request + +## v1.2.12 + +* Removed unused require + +## v1.2.11 + +* Prevent changelog script from being included in package + +## v1.2.10 + +* Use env.PATH only, not env.Path + +## v1.2.9 + +* fix for paths starting with ../ +* Remove unused `is-absolute` module + +## v1.2.8 + +* bullet items in changelog that contain (but don't start with) # + +## v1.2.7 + +* strip 'update changelog' changelog entries out of changelog + +## v1.2.6 + +* make the changelog bulleted + +## v1.2.5 + +* make a changelog, and keep it up to date +* don't include tests in package +* Properly handle relative-path executables +* appveyor +* Attach error code to Not Found error +* Make tests pass on Windows + +## v1.2.4 + +* Fix typo + +## v1.2.3 + +* update isexe, fix regression in pathExt handling + +## v1.2.2 + +* update deps, use isexe module, test windows + +## v1.2.1 + +* Sometimes windows PATH entries are quoted +* Fixed a bug in the check for group and user mode bits. This bug was introduced during refactoring for supporting strict mode. +* doc cli + +## v1.2.0 + +* Add support for opt.all and -as cli flags +* test the bin +* update travis +* Allow checking for multiple programs in bin/which +* tap 2 + +## v1.1.2 + +* travis +* Refactored and fixed undefined error on Windows +* Support strict mode + +## v1.1.1 + +* test +g exes against secondary groups, if available +* Use windows exe semantics on cygwin & msys +* cwd should be first in path on win32, not last +* Handle lower-case 'env.Path' on Windows +* Update docs +* use single-quotes + +## v1.1.0 + +* Add tests, depend on is-absolute + +## v1.0.9 + +* which.js: root is allowed to execute files owned by anyone + +## v1.0.8 + +* don't use graceful-fs + +## v1.0.7 + +* add license to package.json + +## v1.0.6 + +* isc license + +## 1.0.5 + +* Awful typo + +## 1.0.4 + +* Test for path absoluteness properly +* win: Allow '' as a pathext if cmd has a . in it + +## 1.0.3 + +* Remove references to execPath +* Make `which.sync()` work on Windows by honoring the PATHEXT variable. +* Make `isExe()` always return true on Windows. +* MIT + +## 1.0.2 + +* Only files can be exes + +## 1.0.1 + +* Respect the PATHEXT env for win32 support +* should 0755 the bin +* binary +* guts +* package +* 1st diff --git a/node_modules/which/LICENSE b/node_modules/which/LICENSE new file mode 100644 index 000000000..19129e315 --- /dev/null +++ b/node_modules/which/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/which/README.md b/node_modules/which/README.md new file mode 100644 index 000000000..8c0b0cbf7 --- /dev/null +++ b/node_modules/which/README.md @@ -0,0 +1,51 @@ +# which + +Like the unix `which` utility. + +Finds the first instance of a specified executable in the PATH +environment variable. Does not cache the results, so `hash -r` is not +needed when the PATH changes. + +## USAGE + +```javascript +var which = require('which') + +// async usage +which('node', function (er, resolvedPath) { + // er is returned if no "node" is found on the PATH + // if it is found, then the absolute path to the exec is returned +}) + +// sync usage +// throws if not found +var resolved = which.sync('node') + +// if nothrow option is used, returns null if not found +resolved = which.sync('node', {nothrow: true}) + +// Pass options to override the PATH and PATHEXT environment vars. +which('node', { path: someOtherPath }, function (er, resolved) { + if (er) + throw er + console.log('found at %j', resolved) +}) +``` + +## CLI USAGE + +Same as the BSD `which(1)` binary. + +``` +usage: which [-as] program ... +``` + +## OPTIONS + +You may pass an options object as the second argument. + +- `path`: Use instead of the `PATH` environment variable. +- `pathExt`: Use instead of the `PATHEXT` environment variable. +- `all`: Return all matches, instead of just the first one. Note that + this means the function returns an array of strings instead of a + single string. diff --git a/node_modules/which/bin/which b/node_modules/which/bin/which new file mode 100755 index 000000000..7cee3729e --- /dev/null +++ b/node_modules/which/bin/which @@ -0,0 +1,52 @@ +#!/usr/bin/env node +var which = require("../") +if (process.argv.length < 3) + usage() + +function usage () { + console.error('usage: which [-as] program ...') + process.exit(1) +} + +var all = false +var silent = false +var dashdash = false +var args = process.argv.slice(2).filter(function (arg) { + if (dashdash || !/^-/.test(arg)) + return true + + if (arg === '--') { + dashdash = true + return false + } + + var flags = arg.substr(1).split('') + for (var f = 0; f < flags.length; f++) { + var flag = flags[f] + switch (flag) { + case 's': + silent = true + break + case 'a': + all = true + break + default: + console.error('which: illegal option -- ' + flag) + usage() + } + } + return false +}) + +process.exit(args.reduce(function (pv, current) { + try { + var f = which.sync(current, { all: all }) + if (all) + f = f.join('\n') + if (!silent) + console.log(f) + return pv; + } catch (e) { + return 1; + } +}, 0)) diff --git a/node_modules/which/package.json b/node_modules/which/package.json new file mode 100644 index 000000000..dd1618223 --- /dev/null +++ b/node_modules/which/package.json @@ -0,0 +1,66 @@ +{ + "_from": "which@^1.2.9", + "_id": "which@1.3.1", + "_inBundle": false, + "_integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "_location": "/which", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "which@^1.2.9", + "name": "which", + "escapedName": "which", + "rawSpec": "^1.2.9", + "saveSpec": null, + "fetchSpec": "^1.2.9" + }, + "_requiredBy": [ + "/cross-spawn", + "/pem" + ], + "_resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "_shasum": "a45043d54f5805316da8d62f9f50918d3da70b0a", + "_spec": "which@^1.2.9", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/cross-spawn", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "bin": { + "which": "./bin/which" + }, + "bugs": { + "url": "https://github.com/isaacs/node-which/issues" + }, + "bundleDependencies": false, + "dependencies": { + "isexe": "^2.0.0" + }, + "deprecated": false, + "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", + "devDependencies": { + "mkdirp": "^0.5.0", + "rimraf": "^2.6.2", + "tap": "^12.0.1" + }, + "files": [ + "which.js", + "bin/which" + ], + "homepage": "https://github.com/isaacs/node-which#readme", + "license": "ISC", + "main": "which.js", + "name": "which", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-which.git" + }, + "scripts": { + "changelog": "bash gen-changelog.sh", + "postversion": "npm run changelog && git add CHANGELOG.md && git commit -m 'update changelog - '${npm_package_version}", + "test": "tap test/*.js --cov" + }, + "version": "1.3.1" +} diff --git a/node_modules/which/which.js b/node_modules/which/which.js new file mode 100644 index 000000000..4347f91a1 --- /dev/null +++ b/node_modules/which/which.js @@ -0,0 +1,135 @@ +module.exports = which +which.sync = whichSync + +var isWindows = process.platform === 'win32' || + process.env.OSTYPE === 'cygwin' || + process.env.OSTYPE === 'msys' + +var path = require('path') +var COLON = isWindows ? ';' : ':' +var isexe = require('isexe') + +function getNotFoundError (cmd) { + var er = new Error('not found: ' + cmd) + er.code = 'ENOENT' + + return er +} + +function getPathInfo (cmd, opt) { + var colon = opt.colon || COLON + var pathEnv = opt.path || process.env.PATH || '' + var pathExt = [''] + + pathEnv = pathEnv.split(colon) + + var pathExtExe = '' + if (isWindows) { + pathEnv.unshift(process.cwd()) + pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM') + pathExt = pathExtExe.split(colon) + + + // Always test the cmd itself first. isexe will check to make sure + // it's found in the pathExt set. + if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') + pathExt.unshift('') + } + + // If it has a slash, then we don't bother searching the pathenv. + // just check the file itself, and that's it. + if (cmd.match(/\//) || isWindows && cmd.match(/\\/)) + pathEnv = [''] + + return { + env: pathEnv, + ext: pathExt, + extExe: pathExtExe + } +} + +function which (cmd, opt, cb) { + if (typeof opt === 'function') { + cb = opt + opt = {} + } + + var info = getPathInfo(cmd, opt) + var pathEnv = info.env + var pathExt = info.ext + var pathExtExe = info.extExe + var found = [] + + ;(function F (i, l) { + if (i === l) { + if (opt.all && found.length) + return cb(null, found) + else + return cb(getNotFoundError(cmd)) + } + + var pathPart = pathEnv[i] + if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') + pathPart = pathPart.slice(1, -1) + + var p = path.join(pathPart, cmd) + if (!pathPart && (/^\.[\\\/]/).test(cmd)) { + p = cmd.slice(0, 2) + p + } + ;(function E (ii, ll) { + if (ii === ll) return F(i + 1, l) + var ext = pathExt[ii] + isexe(p + ext, { pathExt: pathExtExe }, function (er, is) { + if (!er && is) { + if (opt.all) + found.push(p + ext) + else + return cb(null, p + ext) + } + return E(ii + 1, ll) + }) + })(0, pathExt.length) + })(0, pathEnv.length) +} + +function whichSync (cmd, opt) { + opt = opt || {} + + var info = getPathInfo(cmd, opt) + var pathEnv = info.env + var pathExt = info.ext + var pathExtExe = info.extExe + var found = [] + + for (var i = 0, l = pathEnv.length; i < l; i ++) { + var pathPart = pathEnv[i] + if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') + pathPart = pathPart.slice(1, -1) + + var p = path.join(pathPart, cmd) + if (!pathPart && /^\.[\\\/]/.test(cmd)) { + p = cmd.slice(0, 2) + p + } + for (var j = 0, ll = pathExt.length; j < ll; j ++) { + var cur = p + pathExt[j] + var is + try { + is = isexe.sync(cur, { pathExt: pathExtExe }) + if (is) { + if (opt.all) + found.push(cur) + else + return cur + } + } catch (ex) {} + } + } + + if (opt.all && found.length) + return found + + if (opt.nothrow) + return null + + throw getNotFoundError(cmd) +} diff --git a/node_modules/wrappy/LICENSE b/node_modules/wrappy/LICENSE new file mode 100644 index 000000000..19129e315 --- /dev/null +++ b/node_modules/wrappy/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/wrappy/README.md b/node_modules/wrappy/README.md new file mode 100644 index 000000000..98eab2522 --- /dev/null +++ b/node_modules/wrappy/README.md @@ -0,0 +1,36 @@ +# wrappy + +Callback wrapping utility + +## USAGE + +```javascript +var wrappy = require("wrappy") + +// var wrapper = wrappy(wrapperFunction) + +// make sure a cb is called only once +// See also: http://npm.im/once for this specific use case +var once = wrappy(function (cb) { + var called = false + return function () { + if (called) return + called = true + return cb.apply(this, arguments) + } +}) + +function printBoo () { + console.log('boo') +} +// has some rando property +printBoo.iAmBooPrinter = true + +var onlyPrintOnce = once(printBoo) + +onlyPrintOnce() // prints 'boo' +onlyPrintOnce() // does nothing + +// random property is retained! +assert.equal(onlyPrintOnce.iAmBooPrinter, true) +``` diff --git a/node_modules/wrappy/package.json b/node_modules/wrappy/package.json new file mode 100644 index 000000000..235412881 --- /dev/null +++ b/node_modules/wrappy/package.json @@ -0,0 +1,60 @@ +{ + "_from": "wrappy@1", + "_id": "wrappy@1.0.2", + "_inBundle": false, + "_integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "_location": "/wrappy", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "wrappy@1", + "name": "wrappy", + "escapedName": "wrappy", + "rawSpec": "1", + "saveSpec": null, + "fetchSpec": "1" + }, + "_requiredBy": [ + "/inflight", + "/map-limit/once", + "/once" + ], + "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "_shasum": "b5243d8f3ec1aa35f1364605bc0d1036e30ab69f", + "_spec": "wrappy@1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/inflight", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/npm/wrappy/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Callback wrapping utility", + "devDependencies": { + "tap": "^2.3.1" + }, + "directories": { + "test": "test" + }, + "files": [ + "wrappy.js" + ], + "homepage": "https://github.com/npm/wrappy", + "license": "ISC", + "main": "wrappy.js", + "name": "wrappy", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/wrappy.git" + }, + "scripts": { + "test": "tap --coverage test/*.js" + }, + "version": "1.0.2" +} diff --git a/node_modules/wrappy/wrappy.js b/node_modules/wrappy/wrappy.js new file mode 100644 index 000000000..bb7e7d6fc --- /dev/null +++ b/node_modules/wrappy/wrappy.js @@ -0,0 +1,33 @@ +// Returns a wrapper function that returns a wrapped callback +// The wrapper function should do some stuff, and return a +// presumably different callback function. +// This makes sure that own properties are retained, so that +// decorations and such are not lost along the way. +module.exports = wrappy +function wrappy (fn, cb) { + if (fn && cb) return wrappy(fn)(cb) + + if (typeof fn !== 'function') + throw new TypeError('need wrapper function') + + Object.keys(fn).forEach(function (k) { + wrapper[k] = fn[k] + }) + + return wrapper + + function wrapper() { + var args = new Array(arguments.length) + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + var ret = fn.apply(this, args) + var cb = args[args.length-1] + if (typeof ret === 'function' && ret !== cb) { + Object.keys(cb).forEach(function (k) { + ret[k] = cb[k] + }) + } + return ret + } +} diff --git a/node_modules/ws/README.md b/node_modules/ws/README.md new file mode 100644 index 000000000..93106d7a3 --- /dev/null +++ b/node_modules/ws/README.md @@ -0,0 +1,235 @@ +# ws: a node.js websocket library + +[![Build Status](https://travis-ci.org/websockets/ws.svg?branch=master)](https://travis-ci.org/websockets/ws) + +`ws` is a simple to use WebSocket implementation, up-to-date against RFC-6455, +and [probably the fastest WebSocket library for node.js][archive]. + +Passes the quite extensive Autobahn test suite. See http://websockets.github.com/ws +for the full reports. + +## Protocol support + +* **Hixie draft 76** (Old and deprecated, but still in use by Safari and Opera. + Added to ws version 0.4.2, but server only. Can be disabled by setting the + `disableHixie` option to true.) +* **HyBi drafts 07-12** (Use the option `protocolVersion: 8`) +* **HyBi drafts 13-17** (Current default, alternatively option `protocolVersion: 13`) + +### Installing + +``` +npm install --save ws +``` + +### Opt-in for performance + +There are 2 optional modules that can be installed along side with the `ws` +module. These modules are binary addons which improve certain operations, but as +they are binary addons they require compilation which can fail if no c++ +compiler is installed on the host system. + +- `npm install --save bufferutil`: Improves internal buffer operations which + allows for faster processing of masked WebSocket frames and general buffer + operations. +- `npm install --save utf-8-validate`: The specification requires validation of + invalid UTF-8 chars, some of these validations could not be done in JavaScript + hence the need for a binary addon. In most cases you will already be + validating the input that you receive for security purposes leading to double + validation. But if you want to be 100% spec-conforming and have fast + validation of UTF-8 then this module is a must. + +### Sending and receiving text data + +```js +var WebSocket = require('ws'); +var ws = new WebSocket('ws://www.host.com/path'); + +ws.on('open', function open() { + ws.send('something'); +}); + +ws.on('message', function(data, flags) { + // flags.binary will be set if a binary data is received. + // flags.masked will be set if the data was masked. +}); +``` + +### Sending binary data + +```js +var WebSocket = require('ws'); +var ws = new WebSocket('ws://www.host.com/path'); + +ws.on('open', function open() { + var array = new Float32Array(5); + + for (var i = 0; i < array.length; ++i) { + array[i] = i / 2; + } + + ws.send(array, { binary: true, mask: true }); +}); +``` + +Setting `mask`, as done for the send options above, will cause the data to be +masked according to the WebSocket protocol. The same option applies for text +data. + +### Server example + +```js +var WebSocketServer = require('ws').Server + , wss = new WebSocketServer({ port: 8080 }); + +wss.on('connection', function connection(ws) { + ws.on('message', function incoming(message) { + console.log('received: %s', message); + }); + + ws.send('something'); +}); +``` + +### ExpressJS example + +```js +var server = require('http').createServer() + , url = require('url') + , WebSocketServer = require('ws').Server + , wss = new WebSocketServer({ server: server }) + , express = require('express') + , app = express() + , port = 4080; + +app.use(function (req, res) { + res.send({ msg: "hello" }); +}); + +wss.on('connection', function connection(ws) { + var location = url.parse(ws.upgradeReq.url, true); + // you might use location.query.access_token to authenticate or share sessions + // or ws.upgradeReq.headers.cookie (see http://stackoverflow.com/a/16395220/151312) + + ws.on('message', function incoming(message) { + console.log('received: %s', message); + }); + + ws.send('something'); +}); + +server.on('request', app); +server.listen(port, function () { console.log('Listening on ' + server.address().port) }); +``` + +### Server sending broadcast data + +```js +var WebSocketServer = require('ws').Server + , wss = new WebSocketServer({ port: 8080 }); + +wss.broadcast = function broadcast(data) { + wss.clients.forEach(function each(client) { + client.send(data); + }); +}; +``` + +### Error handling best practices + +```js +// If the WebSocket is closed before the following send is attempted +ws.send('something'); + +// Errors (both immediate and async write errors) can be detected in an optional +// callback. The callback is also the only way of being notified that data has +// actually been sent. +ws.send('something', function ack(error) { + // if error is not defined, the send has been completed, + // otherwise the error object will indicate what failed. +}); + +// Immediate errors can also be handled with try/catch-blocks, but **note** that +// since sends are inherently asynchronous, socket write failures will *not* be +// captured when this technique is used. +try { ws.send('something'); } +catch (e) { /* handle error */ } +``` + +### echo.websocket.org demo + +```js +var WebSocket = require('ws'); +var ws = new WebSocket('ws://echo.websocket.org/', { + protocolVersion: 8, + origin: 'http://websocket.org' +}); + +ws.on('open', function open() { + console.log('connected'); + ws.send(Date.now().toString(), {mask: true}); +}); + +ws.on('close', function close() { + console.log('disconnected'); +}); + +ws.on('message', function message(data, flags) { + console.log('Roundtrip time: ' + (Date.now() - parseInt(data)) + 'ms', flags); + + setTimeout(function timeout() { + ws.send(Date.now().toString(), {mask: true}); + }, 500); +}); +``` + +### Other examples + +For a full example with a browser client communicating with a ws server, see the +examples folder. + +Note that the usage together with Express 3.0 is quite different from Express +2.x. The difference is expressed in the two different serverstats-examples. + +Otherwise, see the test cases. + +### Running the tests + +``` +make test +``` + +## API Docs + +See [`/doc/ws.md`](https://github.com/websockets/ws/blob/master/doc/ws.md) for Node.js-like docs for the ws classes. + +## Changelog + +We're using the GitHub [`releases`](https://github.com/websockets/ws/releases) for changelog entries. + +## License + +(The MIT License) + +Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.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 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. + +[archive]: http://web.archive.org/web/20130314230536/http://hobbycoding.posterous.com/the-fastest-websocket-module-for-nodejs diff --git a/node_modules/ws/index.js b/node_modules/ws/index.js new file mode 100644 index 000000000..a7e8644b9 --- /dev/null +++ b/node_modules/ws/index.js @@ -0,0 +1,49 @@ +'use strict'; + +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +var WS = module.exports = require('./lib/WebSocket'); + +WS.Server = require('./lib/WebSocketServer'); +WS.Sender = require('./lib/Sender'); +WS.Receiver = require('./lib/Receiver'); + +/** + * Create a new WebSocket server. + * + * @param {Object} options Server options + * @param {Function} fn Optional connection listener. + * @returns {WS.Server} + * @api public + */ +WS.createServer = function createServer(options, fn) { + var server = new WS.Server(options); + + if (typeof fn === 'function') { + server.on('connection', fn); + } + + return server; +}; + +/** + * Create a new WebSocket connection. + * + * @param {String} address The URL/address we need to connect to. + * @param {Function} fn Open listener. + * @returns {WS} + * @api public + */ +WS.connect = WS.createConnection = function connect(address, fn) { + var client = new WS(address); + + if (typeof fn === 'function') { + client.on('open', fn); + } + + return client; +}; diff --git a/node_modules/ws/lib/.DS_Store b/node_modules/ws/lib/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 + * MIT Licensed + */ + +var util = require('util'); + +function BufferPool(initialSize, growStrategy, shrinkStrategy) { + if (this instanceof BufferPool === false) { + throw new TypeError("Classes can't be function-called"); + } + + if (typeof initialSize === 'function') { + shrinkStrategy = growStrategy; + growStrategy = initialSize; + initialSize = 0; + } + else if (typeof initialSize === 'undefined') { + initialSize = 0; + } + this._growStrategy = (growStrategy || function(db, size) { + return db.used + size; + }).bind(null, this); + this._shrinkStrategy = (shrinkStrategy || function(db) { + return initialSize; + }).bind(null, this); + this._buffer = initialSize ? new Buffer(initialSize) : null; + this._offset = 0; + this._used = 0; + this._changeFactor = 0; + this.__defineGetter__('size', function(){ + return this._buffer == null ? 0 : this._buffer.length; + }); + this.__defineGetter__('used', function(){ + return this._used; + }); +} + +BufferPool.prototype.get = function(length) { + if (this._buffer == null || this._offset + length > this._buffer.length) { + var newBuf = new Buffer(this._growStrategy(length)); + this._buffer = newBuf; + this._offset = 0; + } + this._used += length; + var buf = this._buffer.slice(this._offset, this._offset + length); + this._offset += length; + return buf; +} + +BufferPool.prototype.reset = function(forceNewBuffer) { + var len = this._shrinkStrategy(); + if (len < this.size) this._changeFactor -= 1; + if (forceNewBuffer || this._changeFactor < -2) { + this._changeFactor = 0; + this._buffer = len ? new Buffer(len) : null; + } + this._offset = 0; + this._used = 0; +} + +module.exports = BufferPool; diff --git a/node_modules/ws/lib/BufferUtil.fallback.js b/node_modules/ws/lib/BufferUtil.fallback.js new file mode 100644 index 000000000..7abd0d8a6 --- /dev/null +++ b/node_modules/ws/lib/BufferUtil.fallback.js @@ -0,0 +1,47 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +exports.BufferUtil = { + merge: function(mergedBuffer, buffers) { + var offset = 0; + for (var i = 0, l = buffers.length; i < l; ++i) { + var buf = buffers[i]; + buf.copy(mergedBuffer, offset); + offset += buf.length; + } + }, + mask: function(source, mask, output, offset, length) { + var maskNum = mask.readUInt32LE(0, true); + var i = 0; + for (; i < length - 3; i += 4) { + var num = maskNum ^ source.readUInt32LE(i, true); + if (num < 0) num = 4294967296 + num; + output.writeUInt32LE(num, offset + i, true); + } + switch (length % 4) { + case 3: output[offset + i + 2] = source[i + 2] ^ mask[2]; + case 2: output[offset + i + 1] = source[i + 1] ^ mask[1]; + case 1: output[offset + i] = source[i] ^ mask[0]; + case 0:; + } + }, + unmask: function(data, mask) { + var maskNum = mask.readUInt32LE(0, true); + var length = data.length; + var i = 0; + for (; i < length - 3; i += 4) { + var num = maskNum ^ data.readUInt32LE(i, true); + if (num < 0) num = 4294967296 + num; + data.writeUInt32LE(num, i, true); + } + switch (length % 4) { + case 3: data[i + 2] = data[i + 2] ^ mask[2]; + case 2: data[i + 1] = data[i + 1] ^ mask[1]; + case 1: data[i] = data[i] ^ mask[0]; + case 0:; + } + } +} diff --git a/node_modules/ws/lib/BufferUtil.js b/node_modules/ws/lib/BufferUtil.js new file mode 100644 index 000000000..794684f5f --- /dev/null +++ b/node_modules/ws/lib/BufferUtil.js @@ -0,0 +1,17 @@ +'use strict'; + +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +var bufferUtil; + +try { + bufferUtil = require('bufferutil'); +} catch (e) { + bufferUtil = require('./BufferUtil.fallback'); +} + +module.exports = bufferUtil.BufferUtil || bufferUtil; diff --git a/node_modules/ws/lib/ErrorCodes.js b/node_modules/ws/lib/ErrorCodes.js new file mode 100644 index 000000000..55ebd529b --- /dev/null +++ b/node_modules/ws/lib/ErrorCodes.js @@ -0,0 +1,24 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +module.exports = { + isValidErrorCode: function(code) { + return (code >= 1000 && code <= 1011 && code != 1004 && code != 1005 && code != 1006) || + (code >= 3000 && code <= 4999); + }, + 1000: 'normal', + 1001: 'going away', + 1002: 'protocol error', + 1003: 'unsupported data', + 1004: 'reserved', + 1005: 'reserved for extensions', + 1006: 'reserved for extensions', + 1007: 'inconsistent or invalid data', + 1008: 'policy violation', + 1009: 'message too big', + 1010: 'extension handshake missing', + 1011: 'an unexpected condition prevented the request from being fulfilled', +}; \ No newline at end of file diff --git a/node_modules/ws/lib/Extensions.js b/node_modules/ws/lib/Extensions.js new file mode 100644 index 000000000..669b1a4bf --- /dev/null +++ b/node_modules/ws/lib/Extensions.js @@ -0,0 +1,81 @@ + +var util = require('util'); + +/** + * Module exports. + */ + +exports.parse = parse; +exports.format = format; + +/** + * Parse extensions header value + */ + +function parse(value) { + value = value || ''; + + var extensions = {}; + + value.split(',').forEach(function(v) { + var params = v.split(';'); + var token = params.shift().trim(); + + if (extensions[token] === undefined) { + extensions[token] = []; + } else if (!extensions.hasOwnProperty(token)) { + return; + } + + var parsedParams = {}; + + params.forEach(function(param) { + var parts = param.trim().split('='); + var key = parts[0]; + var value = parts[1]; + if (typeof value === 'undefined') { + value = true; + } else { + // unquote value + if (value[0] === '"') { + value = value.slice(1); + } + if (value[value.length - 1] === '"') { + value = value.slice(0, value.length - 1); + } + } + + if (parsedParams[key] === undefined) { + parsedParams[key] = [value]; + } else if (parsedParams.hasOwnProperty(key)) { + parsedParams[key].push(value); + } + }); + + extensions[token].push(parsedParams); + }); + + return extensions; +} + +/** + * Format extensions header value + */ + +function format(value) { + return Object.keys(value).map(function(token) { + var paramsList = value[token]; + if (!util.isArray(paramsList)) { + paramsList = [paramsList]; + } + return paramsList.map(function(params) { + return [token].concat(Object.keys(params).map(function(k) { + var p = params[k]; + if (!util.isArray(p)) p = [p]; + return p.map(function(v) { + return v === true ? k : k + '=' + v; + }).join('; '); + })).join('; '); + }).join(', '); + }).join(', '); +} diff --git a/node_modules/ws/lib/PerMessageDeflate.js b/node_modules/ws/lib/PerMessageDeflate.js new file mode 100644 index 000000000..00a6ea62a --- /dev/null +++ b/node_modules/ws/lib/PerMessageDeflate.js @@ -0,0 +1,337 @@ + +var zlib = require('zlib'); + +var AVAILABLE_WINDOW_BITS = [8, 9, 10, 11, 12, 13, 14, 15]; +var DEFAULT_WINDOW_BITS = 15; +var DEFAULT_MEM_LEVEL = 8; + +PerMessageDeflate.extensionName = 'permessage-deflate'; + +/** + * Per-message Compression Extensions implementation + */ + +function PerMessageDeflate(options, isServer,maxPayload) { + if (this instanceof PerMessageDeflate === false) { + throw new TypeError("Classes can't be function-called"); + } + + this._options = options || {}; + this._isServer = !!isServer; + this._inflate = null; + this._deflate = null; + this.params = null; + this._maxPayload = maxPayload || 0; +} + +/** + * Create extension parameters offer + * + * @api public + */ + +PerMessageDeflate.prototype.offer = function() { + var params = {}; + if (this._options.serverNoContextTakeover) { + params.server_no_context_takeover = true; + } + if (this._options.clientNoContextTakeover) { + params.client_no_context_takeover = true; + } + if (this._options.serverMaxWindowBits) { + params.server_max_window_bits = this._options.serverMaxWindowBits; + } + if (this._options.clientMaxWindowBits) { + params.client_max_window_bits = this._options.clientMaxWindowBits; + } else if (this._options.clientMaxWindowBits == null) { + params.client_max_window_bits = true; + } + return params; +}; + +/** + * Accept extension offer + * + * @api public + */ + +PerMessageDeflate.prototype.accept = function(paramsList) { + paramsList = this.normalizeParams(paramsList); + + var params; + if (this._isServer) { + params = this.acceptAsServer(paramsList); + } else { + params = this.acceptAsClient(paramsList); + } + + this.params = params; + return params; +}; + +/** + * Releases all resources used by the extension + * + * @api public + */ + +PerMessageDeflate.prototype.cleanup = function() { + if (this._inflate) { + if (this._inflate.writeInProgress) { + this._inflate.pendingClose = true; + } else { + if (this._inflate.close) this._inflate.close(); + this._inflate = null; + } + } + if (this._deflate) { + if (this._deflate.writeInProgress) { + this._deflate.pendingClose = true; + } else { + if (this._deflate.close) this._deflate.close(); + this._deflate = null; + } + } +}; + +/** + * Accept extension offer from client + * + * @api private + */ + +PerMessageDeflate.prototype.acceptAsServer = function(paramsList) { + var accepted = {}; + var result = paramsList.some(function(params) { + accepted = {}; + if (this._options.serverNoContextTakeover === false && params.server_no_context_takeover) { + return; + } + if (this._options.serverMaxWindowBits === false && params.server_max_window_bits) { + return; + } + if (typeof this._options.serverMaxWindowBits === 'number' && + typeof params.server_max_window_bits === 'number' && + this._options.serverMaxWindowBits > params.server_max_window_bits) { + return; + } + if (typeof this._options.clientMaxWindowBits === 'number' && !params.client_max_window_bits) { + return; + } + + if (this._options.serverNoContextTakeover || params.server_no_context_takeover) { + accepted.server_no_context_takeover = true; + } + if (this._options.clientNoContextTakeover) { + accepted.client_no_context_takeover = true; + } + if (this._options.clientNoContextTakeover !== false && params.client_no_context_takeover) { + accepted.client_no_context_takeover = true; + } + if (typeof this._options.serverMaxWindowBits === 'number') { + accepted.server_max_window_bits = this._options.serverMaxWindowBits; + } else if (typeof params.server_max_window_bits === 'number') { + accepted.server_max_window_bits = params.server_max_window_bits; + } + if (typeof this._options.clientMaxWindowBits === 'number') { + accepted.client_max_window_bits = this._options.clientMaxWindowBits; + } else if (this._options.clientMaxWindowBits !== false && typeof params.client_max_window_bits === 'number') { + accepted.client_max_window_bits = params.client_max_window_bits; + } + return true; + }, this); + + if (!result) { + throw new Error('Doesn\'t support the offered configuration'); + } + + return accepted; +}; + +/** + * Accept extension response from server + * + * @api privaye + */ + +PerMessageDeflate.prototype.acceptAsClient = function(paramsList) { + var params = paramsList[0]; + if (this._options.clientNoContextTakeover != null) { + if (this._options.clientNoContextTakeover === false && params.client_no_context_takeover) { + throw new Error('Invalid value for "client_no_context_takeover"'); + } + } + if (this._options.clientMaxWindowBits != null) { + if (this._options.clientMaxWindowBits === false && params.client_max_window_bits) { + throw new Error('Invalid value for "client_max_window_bits"'); + } + if (typeof this._options.clientMaxWindowBits === 'number' && + (!params.client_max_window_bits || params.client_max_window_bits > this._options.clientMaxWindowBits)) { + throw new Error('Invalid value for "client_max_window_bits"'); + } + } + return params; +}; + +/** + * Normalize extensions parameters + * + * @api private + */ + +PerMessageDeflate.prototype.normalizeParams = function(paramsList) { + return paramsList.map(function(params) { + Object.keys(params).forEach(function(key) { + var value = params[key]; + if (value.length > 1) { + throw new Error('Multiple extension parameters for ' + key); + } + + value = value[0]; + + switch (key) { + case 'server_no_context_takeover': + case 'client_no_context_takeover': + if (value !== true) { + throw new Error('invalid extension parameter value for ' + key + ' (' + value + ')'); + } + params[key] = true; + break; + case 'server_max_window_bits': + case 'client_max_window_bits': + if (typeof value === 'string') { + value = parseInt(value, 10); + if (!~AVAILABLE_WINDOW_BITS.indexOf(value)) { + throw new Error('invalid extension parameter value for ' + key + ' (' + value + ')'); + } + } + if (!this._isServer && value === true) { + throw new Error('Missing extension parameter value for ' + key); + } + params[key] = value; + break; + default: + throw new Error('Not defined extension parameter (' + key + ')'); + } + }, this); + return params; + }, this); +}; + +/** + * Decompress message + * + * @api public + */ + +PerMessageDeflate.prototype.decompress = function (data, fin, callback) { + var endpoint = this._isServer ? 'client' : 'server'; + + if (!this._inflate) { + var maxWindowBits = this.params[endpoint + '_max_window_bits']; + this._inflate = zlib.createInflateRaw({ + windowBits: 'number' === typeof maxWindowBits ? maxWindowBits : DEFAULT_WINDOW_BITS + }); + } + this._inflate.writeInProgress = true; + + var self = this; + var buffers = []; + var cumulativeBufferLength=0; + + this._inflate.on('error', onError).on('data', onData); + this._inflate.write(data); + if (fin) { + this._inflate.write(new Buffer([0x00, 0x00, 0xff, 0xff])); + } + this._inflate.flush(function() { + cleanup(); + callback(null, Buffer.concat(buffers)); + }); + + function onError(err) { + cleanup(); + callback(err); + } + + function onData(data) { + if(self._maxPayload!==undefined && self._maxPayload!==null && self._maxPayload>0){ + cumulativeBufferLength+=data.length; + if(cumulativeBufferLength>self._maxPayload){ + buffers=[]; + cleanup(); + var err={type:1009}; + callback(err); + return; + } + } + buffers.push(data); + } + + function cleanup() { + if (!self._inflate) return; + self._inflate.removeListener('error', onError); + self._inflate.removeListener('data', onData); + self._inflate.writeInProgress = false; + if ((fin && self.params[endpoint + '_no_context_takeover']) || self._inflate.pendingClose) { + if (self._inflate.close) self._inflate.close(); + self._inflate = null; + } + } +}; + +/** + * Compress message + * + * @api public + */ + +PerMessageDeflate.prototype.compress = function (data, fin, callback) { + var endpoint = this._isServer ? 'server' : 'client'; + + if (!this._deflate) { + var maxWindowBits = this.params[endpoint + '_max_window_bits']; + this._deflate = zlib.createDeflateRaw({ + flush: zlib.Z_SYNC_FLUSH, + windowBits: 'number' === typeof maxWindowBits ? maxWindowBits : DEFAULT_WINDOW_BITS, + memLevel: this._options.memLevel || DEFAULT_MEM_LEVEL + }); + } + this._deflate.writeInProgress = true; + + var self = this; + var buffers = []; + + this._deflate.on('error', onError).on('data', onData); + this._deflate.write(data); + this._deflate.flush(function() { + cleanup(); + var data = Buffer.concat(buffers); + if (fin) { + data = data.slice(0, data.length - 4); + } + callback(null, data); + }); + + function onError(err) { + cleanup(); + callback(err); + } + + function onData(data) { + buffers.push(data); + } + + function cleanup() { + if (!self._deflate) return; + self._deflate.removeListener('error', onError); + self._deflate.removeListener('data', onData); + self._deflate.writeInProgress = false; + if ((fin && self.params[endpoint + '_no_context_takeover']) || self._deflate.pendingClose) { + if (self._deflate.close) self._deflate.close(); + self._deflate = null; + } + } +}; + +module.exports = PerMessageDeflate; diff --git a/node_modules/ws/lib/Receiver.hixie.js b/node_modules/ws/lib/Receiver.hixie.js new file mode 100644 index 000000000..598ccbdaf --- /dev/null +++ b/node_modules/ws/lib/Receiver.hixie.js @@ -0,0 +1,194 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +var util = require('util'); + +/** + * State constants + */ + +var EMPTY = 0 + , BODY = 1; +var BINARYLENGTH = 2 + , BINARYBODY = 3; + +/** + * Hixie Receiver implementation + */ + +function Receiver () { + if (this instanceof Receiver === false) { + throw new TypeError("Classes can't be function-called"); + } + + this.state = EMPTY; + this.buffers = []; + this.messageEnd = -1; + this.spanLength = 0; + this.dead = false; + + this.onerror = function() {}; + this.ontext = function() {}; + this.onbinary = function() {}; + this.onclose = function() {}; + this.onping = function() {}; + this.onpong = function() {}; +} + +module.exports = Receiver; + +/** + * Add new data to the parser. + * + * @api public + */ + +Receiver.prototype.add = function(data) { + if (this.dead) return; + var self = this; + function doAdd() { + if (self.state === EMPTY) { + if (data.length == 2 && data[0] == 0xFF && data[1] == 0x00) { + self.reset(); + self.onclose(); + return; + } + if (data[0] === 0x80) { + self.messageEnd = 0; + self.state = BINARYLENGTH; + data = data.slice(1); + } else { + + if (data[0] !== 0x00) { + self.error('payload must start with 0x00 byte', true); + return; + } + data = data.slice(1); + self.state = BODY; + + } + } + if (self.state === BINARYLENGTH) { + var i = 0; + while ((i < data.length) && (data[i] & 0x80)) { + self.messageEnd = 128 * self.messageEnd + (data[i] & 0x7f); + ++i; + } + if (i < data.length) { + self.messageEnd = 128 * self.messageEnd + (data[i] & 0x7f); + self.state = BINARYBODY; + ++i; + } + if (i > 0) + data = data.slice(i); + } + if (self.state === BINARYBODY) { + var dataleft = self.messageEnd - self.spanLength; + if (data.length >= dataleft) { + // consume the whole buffer to finish the frame + self.buffers.push(data); + self.spanLength += dataleft; + self.messageEnd = dataleft; + return self.parse(); + } + // frame's not done even if we consume it all + self.buffers.push(data); + self.spanLength += data.length; + return; + } + self.buffers.push(data); + if ((self.messageEnd = bufferIndex(data, 0xFF)) != -1) { + self.spanLength += self.messageEnd; + return self.parse(); + } + else self.spanLength += data.length; + } + while(data) data = doAdd(); +}; + +/** + * Releases all resources used by the receiver. + * + * @api public + */ + +Receiver.prototype.cleanup = function() { + this.dead = true; + this.state = EMPTY; + this.buffers = []; +}; + +/** + * Process buffered data. + * + * @api public + */ + +Receiver.prototype.parse = function() { + var output = new Buffer(this.spanLength); + var outputIndex = 0; + for (var bi = 0, bl = this.buffers.length; bi < bl - 1; ++bi) { + var buffer = this.buffers[bi]; + buffer.copy(output, outputIndex); + outputIndex += buffer.length; + } + var lastBuffer = this.buffers[this.buffers.length - 1]; + if (this.messageEnd > 0) lastBuffer.copy(output, outputIndex, 0, this.messageEnd); + if (this.state !== BODY) --this.messageEnd; + var tail = null; + if (this.messageEnd < lastBuffer.length - 1) { + tail = lastBuffer.slice(this.messageEnd + 1); + } + this.reset(); + this.ontext(output.toString('utf8')); + return tail; +}; + +/** + * Handles an error + * + * @api private + */ + +Receiver.prototype.error = function (reason, terminate) { + if (this.dead) return; + this.reset(); + if(typeof reason == 'string'){ + this.onerror(new Error(reason), terminate); + } + else if(reason.constructor == Error){ + this.onerror(reason, terminate); + } + else{ + this.onerror(new Error("An error occured"),terminate); + } + return this; +}; + +/** + * Reset parser state + * + * @api private + */ + +Receiver.prototype.reset = function (reason) { + if (this.dead) return; + this.state = EMPTY; + this.buffers = []; + this.messageEnd = -1; + this.spanLength = 0; +}; + +/** + * Internal api + */ + +function bufferIndex(buffer, byte) { + for (var i = 0, l = buffer.length; i < l; ++i) { + if (buffer[i] === byte) return i; + } + return -1; +} diff --git a/node_modules/ws/lib/Receiver.js b/node_modules/ws/lib/Receiver.js new file mode 100644 index 000000000..acbe62125 --- /dev/null +++ b/node_modules/ws/lib/Receiver.js @@ -0,0 +1,793 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +var util = require('util') + , isValidUTF8 = require('./Validation') + , ErrorCodes = require('./ErrorCodes') + , BufferPool = require('./BufferPool') + , bufferUtil = require('./BufferUtil') + , PerMessageDeflate = require('./PerMessageDeflate'); + +/** + * HyBi Receiver implementation + */ + +function Receiver (extensions,maxPayload) { + if (this instanceof Receiver === false) { + throw new TypeError("Classes can't be function-called"); + } + if(typeof extensions==='number'){ + maxPayload=extensions; + extensions={}; + } + + + // memory pool for fragmented messages + var fragmentedPoolPrevUsed = -1; + this.fragmentedBufferPool = new BufferPool(1024, function(db, length) { + return db.used + length; + }, function(db) { + return fragmentedPoolPrevUsed = fragmentedPoolPrevUsed >= 0 ? + Math.ceil((fragmentedPoolPrevUsed + db.used) / 2) : + db.used; + }); + + // memory pool for unfragmented messages + var unfragmentedPoolPrevUsed = -1; + this.unfragmentedBufferPool = new BufferPool(1024, function(db, length) { + return db.used + length; + }, function(db) { + return unfragmentedPoolPrevUsed = unfragmentedPoolPrevUsed >= 0 ? + Math.ceil((unfragmentedPoolPrevUsed + db.used) / 2) : + db.used; + }); + this.extensions = extensions || {}; + this.maxPayload = maxPayload || 0; + this.currentPayloadLength = 0; + this.state = { + activeFragmentedOperation: null, + lastFragment: false, + masked: false, + opcode: 0, + fragmentedOperation: false + }; + this.overflow = []; + this.headerBuffer = new Buffer(10); + this.expectOffset = 0; + this.expectBuffer = null; + this.expectHandler = null; + this.currentMessage = []; + this.currentMessageLength = 0; + this.messageHandlers = []; + this.expectHeader(2, this.processPacket); + this.dead = false; + this.processing = false; + + this.onerror = function() {}; + this.ontext = function() {}; + this.onbinary = function() {}; + this.onclose = function() {}; + this.onping = function() {}; + this.onpong = function() {}; +} + +module.exports = Receiver; + +/** + * Add new data to the parser. + * + * @api public + */ + +Receiver.prototype.add = function(data) { + if (this.dead) return; + var dataLength = data.length; + if (dataLength == 0) return; + if (this.expectBuffer == null) { + this.overflow.push(data); + return; + } + var toRead = Math.min(dataLength, this.expectBuffer.length - this.expectOffset); + fastCopy(toRead, data, this.expectBuffer, this.expectOffset); + this.expectOffset += toRead; + if (toRead < dataLength) { + this.overflow.push(data.slice(toRead)); + } + while (this.expectBuffer && this.expectOffset == this.expectBuffer.length) { + var bufferForHandler = this.expectBuffer; + this.expectBuffer = null; + this.expectOffset = 0; + this.expectHandler.call(this, bufferForHandler); + } +}; + +/** + * Releases all resources used by the receiver. + * + * @api public + */ + +Receiver.prototype.cleanup = function() { + this.dead = true; + this.overflow = null; + this.headerBuffer = null; + this.expectBuffer = null; + this.expectHandler = null; + this.unfragmentedBufferPool = null; + this.fragmentedBufferPool = null; + this.state = null; + this.currentMessage = null; + this.onerror = null; + this.ontext = null; + this.onbinary = null; + this.onclose = null; + this.onping = null; + this.onpong = null; +}; + +/** + * Waits for a certain amount of header bytes to be available, then fires a callback. + * + * @api private + */ + +Receiver.prototype.expectHeader = function(length, handler) { + if (length == 0) { + handler(null); + return; + } + this.expectBuffer = this.headerBuffer.slice(this.expectOffset, this.expectOffset + length); + this.expectHandler = handler; + var toRead = length; + while (toRead > 0 && this.overflow.length > 0) { + var fromOverflow = this.overflow.pop(); + if (toRead < fromOverflow.length) this.overflow.push(fromOverflow.slice(toRead)); + var read = Math.min(fromOverflow.length, toRead); + fastCopy(read, fromOverflow, this.expectBuffer, this.expectOffset); + this.expectOffset += read; + toRead -= read; + } +}; + +/** + * Waits for a certain amount of data bytes to be available, then fires a callback. + * + * @api private + */ + +Receiver.prototype.expectData = function(length, handler) { + if (length == 0) { + handler(null); + return; + } + this.expectBuffer = this.allocateFromPool(length, this.state.fragmentedOperation); + this.expectHandler = handler; + var toRead = length; + while (toRead > 0 && this.overflow.length > 0) { + var fromOverflow = this.overflow.pop(); + if (toRead < fromOverflow.length) this.overflow.push(fromOverflow.slice(toRead)); + var read = Math.min(fromOverflow.length, toRead); + fastCopy(read, fromOverflow, this.expectBuffer, this.expectOffset); + this.expectOffset += read; + toRead -= read; + } +}; + +/** + * Allocates memory from the buffer pool. + * + * @api private + */ + +Receiver.prototype.allocateFromPool = function(length, isFragmented) { + return (isFragmented ? this.fragmentedBufferPool : this.unfragmentedBufferPool).get(length); +}; + +/** + * Start processing a new packet. + * + * @api private + */ + +Receiver.prototype.processPacket = function (data) { + if (this.extensions[PerMessageDeflate.extensionName]) { + if ((data[0] & 0x30) != 0) { + this.error('reserved fields (2, 3) must be empty', 1002); + return; + } + } else { + if ((data[0] & 0x70) != 0) { + this.error('reserved fields must be empty', 1002); + return; + } + } + this.state.lastFragment = (data[0] & 0x80) == 0x80; + this.state.masked = (data[1] & 0x80) == 0x80; + var compressed = (data[0] & 0x40) == 0x40; + var opcode = data[0] & 0xf; + if (opcode === 0) { + if (compressed) { + this.error('continuation frame cannot have the Per-message Compressed bits', 1002); + return; + } + // continuation frame + this.state.fragmentedOperation = true; + this.state.opcode = this.state.activeFragmentedOperation; + if (!(this.state.opcode == 1 || this.state.opcode == 2)) { + this.error('continuation frame cannot follow current opcode', 1002); + return; + } + } + else { + if (opcode < 3 && this.state.activeFragmentedOperation != null) { + this.error('data frames after the initial data frame must have opcode 0', 1002); + return; + } + if (opcode >= 8 && compressed) { + this.error('control frames cannot have the Per-message Compressed bits', 1002); + return; + } + this.state.compressed = compressed; + this.state.opcode = opcode; + if (this.state.lastFragment === false) { + this.state.fragmentedOperation = true; + this.state.activeFragmentedOperation = opcode; + } + else this.state.fragmentedOperation = false; + } + var handler = opcodes[this.state.opcode]; + if (typeof handler == 'undefined') this.error('no handler for opcode ' + this.state.opcode, 1002); + else { + handler.start.call(this, data); + } +}; + +/** + * Endprocessing a packet. + * + * @api private + */ + +Receiver.prototype.endPacket = function() { + if (this.dead) return; + if (!this.state.fragmentedOperation) this.unfragmentedBufferPool.reset(true); + else if (this.state.lastFragment) this.fragmentedBufferPool.reset(true); + this.expectOffset = 0; + this.expectBuffer = null; + this.expectHandler = null; + if (this.state.lastFragment && this.state.opcode === this.state.activeFragmentedOperation) { + // end current fragmented operation + this.state.activeFragmentedOperation = null; + } + this.currentPayloadLength = 0; + this.state.lastFragment = false; + this.state.opcode = this.state.activeFragmentedOperation != null ? this.state.activeFragmentedOperation : 0; + this.state.masked = false; + this.expectHeader(2, this.processPacket); +}; + +/** + * Reset the parser state. + * + * @api private + */ + +Receiver.prototype.reset = function() { + if (this.dead) return; + this.state = { + activeFragmentedOperation: null, + lastFragment: false, + masked: false, + opcode: 0, + fragmentedOperation: false + }; + this.fragmentedBufferPool.reset(true); + this.unfragmentedBufferPool.reset(true); + this.expectOffset = 0; + this.expectBuffer = null; + this.expectHandler = null; + this.overflow = []; + this.currentMessage = []; + this.currentMessageLength = 0; + this.messageHandlers = []; + this.currentPayloadLength = 0; +}; + +/** + * Unmask received data. + * + * @api private + */ + +Receiver.prototype.unmask = function (mask, buf, binary) { + if (mask != null && buf != null) bufferUtil.unmask(buf, mask); + if (binary) return buf; + return buf != null ? buf.toString('utf8') : ''; +}; + +/** + * Handles an error + * + * @api private + */ + +Receiver.prototype.error = function (reason, protocolErrorCode) { + if (this.dead) return; + this.reset(); + if(typeof reason == 'string'){ + this.onerror(new Error(reason), protocolErrorCode); + } + else if(reason.constructor == Error){ + this.onerror(reason, protocolErrorCode); + } + else{ + this.onerror(new Error("An error occured"),protocolErrorCode); + } + return this; +}; + +/** + * Execute message handler buffers + * + * @api private + */ + +Receiver.prototype.flush = function() { + if (this.processing || this.dead) return; + + var handler = this.messageHandlers.shift(); + if (!handler) return; + + this.processing = true; + var self = this; + + handler(function() { + self.processing = false; + self.flush(); + }); +}; + +/** + * Apply extensions to message + * + * @api private + */ + +Receiver.prototype.applyExtensions = function(messageBuffer, fin, compressed, callback) { + var self = this; + if (compressed) { + this.extensions[PerMessageDeflate.extensionName].decompress(messageBuffer, fin, function(err, buffer) { + if (self.dead) return; + if (err) { + callback(new Error('invalid compressed data')); + return; + } + callback(null, buffer); + }); + } else { + callback(null, messageBuffer); + } +}; + +/** +* Checks payload size, disconnects socket when it exceeds maxPayload +* +* @api private +*/ +Receiver.prototype.maxPayloadExceeded = function(length) { + if (this.maxPayload=== undefined || this.maxPayload === null || this.maxPayload < 1) { + return false; + } + var fullLength = this.currentPayloadLength + length; + if (fullLength < this.maxPayload) { + this.currentPayloadLength = fullLength; + return false; + } + this.error('payload cannot exceed ' + this.maxPayload + ' bytes', 1009); + this.messageBuffer=[]; + this.cleanup(); + + return true; +}; + +/** + * Buffer utilities + */ + +function readUInt16BE(start) { + return (this[start]<<8) + + this[start+1]; +} + +function readUInt32BE(start) { + return (this[start]<<24) + + (this[start+1]<<16) + + (this[start+2]<<8) + + this[start+3]; +} + +function fastCopy(length, srcBuffer, dstBuffer, dstOffset) { + switch (length) { + default: srcBuffer.copy(dstBuffer, dstOffset, 0, length); break; + case 16: dstBuffer[dstOffset+15] = srcBuffer[15]; + case 15: dstBuffer[dstOffset+14] = srcBuffer[14]; + case 14: dstBuffer[dstOffset+13] = srcBuffer[13]; + case 13: dstBuffer[dstOffset+12] = srcBuffer[12]; + case 12: dstBuffer[dstOffset+11] = srcBuffer[11]; + case 11: dstBuffer[dstOffset+10] = srcBuffer[10]; + case 10: dstBuffer[dstOffset+9] = srcBuffer[9]; + case 9: dstBuffer[dstOffset+8] = srcBuffer[8]; + case 8: dstBuffer[dstOffset+7] = srcBuffer[7]; + case 7: dstBuffer[dstOffset+6] = srcBuffer[6]; + case 6: dstBuffer[dstOffset+5] = srcBuffer[5]; + case 5: dstBuffer[dstOffset+4] = srcBuffer[4]; + case 4: dstBuffer[dstOffset+3] = srcBuffer[3]; + case 3: dstBuffer[dstOffset+2] = srcBuffer[2]; + case 2: dstBuffer[dstOffset+1] = srcBuffer[1]; + case 1: dstBuffer[dstOffset] = srcBuffer[0]; + } +} + +function clone(obj) { + var cloned = {}; + for (var k in obj) { + if (obj.hasOwnProperty(k)) { + cloned[k] = obj[k]; + } + } + return cloned; +} + +/** + * Opcode handlers + */ + +var opcodes = { + // text + '1': { + start: function(data) { + var self = this; + // decode length + var firstLength = data[1] & 0x7f; + if (firstLength < 126) { + if (self.maxPayloadExceeded(firstLength)){ + self.error('Maximumpayload exceeded in compressed text message. Aborting...', 1009); + return; + } + opcodes['1'].getData.call(self, firstLength); + } + else if (firstLength == 126) { + self.expectHeader(2, function(data) { + var length = readUInt16BE.call(data, 0); + if (self.maxPayloadExceeded(length)){ + self.error('Maximumpayload exceeded in compressed text message. Aborting...', 1009); + return; + } + opcodes['1'].getData.call(self, length); + }); + } + else if (firstLength == 127) { + self.expectHeader(8, function(data) { + if (readUInt32BE.call(data, 0) != 0) { + self.error('packets with length spanning more than 32 bit is currently not supported', 1008); + return; + } + var length = readUInt32BE.call(data, 4); + if (self.maxPayloadExceeded(length)){ + self.error('Maximumpayload exceeded in compressed text message. Aborting...', 1009); + return; + } + opcodes['1'].getData.call(self, readUInt32BE.call(data, 4)); + }); + } + }, + getData: function(length) { + var self = this; + if (self.state.masked) { + self.expectHeader(4, function(data) { + var mask = data; + self.expectData(length, function(data) { + opcodes['1'].finish.call(self, mask, data); + }); + }); + } + else { + self.expectData(length, function(data) { + opcodes['1'].finish.call(self, null, data); + }); + } + }, + finish: function(mask, data) { + var self = this; + var packet = this.unmask(mask, data, true) || new Buffer(0); + var state = clone(this.state); + this.messageHandlers.push(function(callback) { + self.applyExtensions(packet, state.lastFragment, state.compressed, function(err, buffer) { + if (err) { + if(err.type===1009){ + return self.error('Maximumpayload exceeded in compressed text message. Aborting...', 1009); + } + return self.error(err.message, 1007); + } + if (buffer != null) { + if( self.maxPayload==0 || (self.maxPayload > 0 && (self.currentMessageLength + buffer.length) < self.maxPayload) ){ + self.currentMessage.push(buffer); + } + else{ + self.currentMessage=null; + self.currentMessage = []; + self.currentMessageLength = 0; + self.error(new Error('Maximum payload exceeded. maxPayload: '+self.maxPayload), 1009); + return; + } + self.currentMessageLength += buffer.length; + } + if (state.lastFragment) { + var messageBuffer = Buffer.concat(self.currentMessage); + self.currentMessage = []; + self.currentMessageLength = 0; + if (!isValidUTF8(messageBuffer)) { + self.error('invalid utf8 sequence', 1007); + return; + } + self.ontext(messageBuffer.toString('utf8'), {masked: state.masked, buffer: messageBuffer}); + } + callback(); + }); + }); + this.flush(); + this.endPacket(); + } + }, + // binary + '2': { + start: function(data) { + var self = this; + // decode length + var firstLength = data[1] & 0x7f; + if (firstLength < 126) { + if (self.maxPayloadExceeded(firstLength)){ + self.error('Max payload exceeded in compressed text message. Aborting...', 1009); + return; + } + opcodes['2'].getData.call(self, firstLength); + } + else if (firstLength == 126) { + self.expectHeader(2, function(data) { + var length = readUInt16BE.call(data, 0); + if (self.maxPayloadExceeded(length)){ + self.error('Max payload exceeded in compressed text message. Aborting...', 1009); + return; + } + opcodes['2'].getData.call(self, length); + }); + } + else if (firstLength == 127) { + self.expectHeader(8, function(data) { + if (readUInt32BE.call(data, 0) != 0) { + self.error('packets with length spanning more than 32 bit is currently not supported', 1008); + return; + } + var length = readUInt32BE.call(data, 4, true); + if (self.maxPayloadExceeded(length)){ + self.error('Max payload exceeded in compressed text message. Aborting...', 1009); + return; + } + opcodes['2'].getData.call(self, length); + }); + } + }, + getData: function(length) { + var self = this; + if (self.state.masked) { + self.expectHeader(4, function(data) { + var mask = data; + self.expectData(length, function(data) { + opcodes['2'].finish.call(self, mask, data); + }); + }); + } + else { + self.expectData(length, function(data) { + opcodes['2'].finish.call(self, null, data); + }); + } + }, + finish: function(mask, data) { + var self = this; + var packet = this.unmask(mask, data, true) || new Buffer(0); + var state = clone(this.state); + this.messageHandlers.push(function(callback) { + self.applyExtensions(packet, state.lastFragment, state.compressed, function(err, buffer) { + if (err) { + if(err.type===1009){ + return self.error('Max payload exceeded in compressed binary message. Aborting...', 1009); + } + return self.error(err.message, 1007); + } + if (buffer != null) { + if( self.maxPayload==0 || (self.maxPayload > 0 && (self.currentMessageLength + buffer.length) < self.maxPayload) ){ + self.currentMessage.push(buffer); + } + else{ + self.currentMessage=null; + self.currentMessage = []; + self.currentMessageLength = 0; + self.error(new Error('Maximum payload exceeded'), 1009); + return; + } + self.currentMessageLength += buffer.length; + } + if (state.lastFragment) { + var messageBuffer = Buffer.concat(self.currentMessage); + self.currentMessage = []; + self.currentMessageLength = 0; + self.onbinary(messageBuffer, {masked: state.masked, buffer: messageBuffer}); + } + callback(); + }); + }); + this.flush(); + this.endPacket(); + } + }, + // close + '8': { + start: function(data) { + var self = this; + if (self.state.lastFragment == false) { + self.error('fragmented close is not supported', 1002); + return; + } + + // decode length + var firstLength = data[1] & 0x7f; + if (firstLength < 126) { + opcodes['8'].getData.call(self, firstLength); + } + else { + self.error('control frames cannot have more than 125 bytes of data', 1002); + } + }, + getData: function(length) { + var self = this; + if (self.state.masked) { + self.expectHeader(4, function(data) { + var mask = data; + self.expectData(length, function(data) { + opcodes['8'].finish.call(self, mask, data); + }); + }); + } + else { + self.expectData(length, function(data) { + opcodes['8'].finish.call(self, null, data); + }); + } + }, + finish: function(mask, data) { + var self = this; + data = self.unmask(mask, data, true); + + var state = clone(this.state); + this.messageHandlers.push(function() { + if (data && data.length == 1) { + self.error('close packets with data must be at least two bytes long', 1002); + return; + } + var code = data && data.length > 1 ? readUInt16BE.call(data, 0) : 1000; + if (!ErrorCodes.isValidErrorCode(code)) { + self.error('invalid error code', 1002); + return; + } + var message = ''; + if (data && data.length > 2) { + var messageBuffer = data.slice(2); + if (!isValidUTF8(messageBuffer)) { + self.error('invalid utf8 sequence', 1007); + return; + } + message = messageBuffer.toString('utf8'); + } + self.onclose(code, message, {masked: state.masked}); + self.reset(); + }); + this.flush(); + }, + }, + // ping + '9': { + start: function(data) { + var self = this; + if (self.state.lastFragment == false) { + self.error('fragmented ping is not supported', 1002); + return; + } + + // decode length + var firstLength = data[1] & 0x7f; + if (firstLength < 126) { + opcodes['9'].getData.call(self, firstLength); + } + else { + self.error('control frames cannot have more than 125 bytes of data', 1002); + } + }, + getData: function(length) { + var self = this; + if (self.state.masked) { + self.expectHeader(4, function(data) { + var mask = data; + self.expectData(length, function(data) { + opcodes['9'].finish.call(self, mask, data); + }); + }); + } + else { + self.expectData(length, function(data) { + opcodes['9'].finish.call(self, null, data); + }); + } + }, + finish: function(mask, data) { + var self = this; + data = this.unmask(mask, data, true); + var state = clone(this.state); + this.messageHandlers.push(function(callback) { + self.onping(data, {masked: state.masked, binary: true}); + callback(); + }); + this.flush(); + this.endPacket(); + } + }, + // pong + '10': { + start: function(data) { + var self = this; + if (self.state.lastFragment == false) { + self.error('fragmented pong is not supported', 1002); + return; + } + + // decode length + var firstLength = data[1] & 0x7f; + if (firstLength < 126) { + opcodes['10'].getData.call(self, firstLength); + } + else { + self.error('control frames cannot have more than 125 bytes of data', 1002); + } + }, + getData: function(length) { + var self = this; + if (this.state.masked) { + this.expectHeader(4, function(data) { + var mask = data; + self.expectData(length, function(data) { + opcodes['10'].finish.call(self, mask, data); + }); + }); + } + else { + this.expectData(length, function(data) { + opcodes['10'].finish.call(self, null, data); + }); + } + }, + finish: function(mask, data) { + var self = this; + data = self.unmask(mask, data, true); + var state = clone(this.state); + this.messageHandlers.push(function(callback) { + self.onpong(data, {masked: state.masked, binary: true}); + callback(); + }); + this.flush(); + this.endPacket(); + } + } +} diff --git a/node_modules/ws/lib/Sender.hixie.js b/node_modules/ws/lib/Sender.hixie.js new file mode 100644 index 000000000..b87d9dd93 --- /dev/null +++ b/node_modules/ws/lib/Sender.hixie.js @@ -0,0 +1,124 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +var events = require('events') + , util = require('util') + , EventEmitter = events.EventEmitter; + +/** + * Hixie Sender implementation + */ + +function Sender(socket) { + if (this instanceof Sender === false) { + throw new TypeError("Classes can't be function-called"); + } + + events.EventEmitter.call(this); + + this.socket = socket; + this.continuationFrame = false; + this.isClosed = false; +} + +module.exports = Sender; + +/** + * Inherits from EventEmitter. + */ + +util.inherits(Sender, events.EventEmitter); + +/** + * Frames and writes data. + * + * @api public + */ + +Sender.prototype.send = function(data, options, cb) { + if (this.isClosed) return; + + var isString = typeof data == 'string' + , length = isString ? Buffer.byteLength(data) : data.length + , lengthbytes = (length > 127) ? 2 : 1 // assume less than 2**14 bytes + , writeStartMarker = this.continuationFrame == false + , writeEndMarker = !options || !(typeof options.fin != 'undefined' && !options.fin) + , buffer = new Buffer((writeStartMarker ? ((options && options.binary) ? (1 + lengthbytes) : 1) : 0) + length + ((writeEndMarker && !(options && options.binary)) ? 1 : 0)) + , offset = writeStartMarker ? 1 : 0; + + if (writeStartMarker) { + if (options && options.binary) { + buffer.write('\x80', 'binary'); + // assume length less than 2**14 bytes + if (lengthbytes > 1) + buffer.write(String.fromCharCode(128+length/128), offset++, 'binary'); + buffer.write(String.fromCharCode(length&0x7f), offset++, 'binary'); + } else + buffer.write('\x00', 'binary'); + } + + if (isString) buffer.write(data, offset, 'utf8'); + else data.copy(buffer, offset, 0); + + if (writeEndMarker) { + if (options && options.binary) { + // sending binary, not writing end marker + } else + buffer.write('\xff', offset + length, 'binary'); + this.continuationFrame = false; + } + else this.continuationFrame = true; + + try { + this.socket.write(buffer, 'binary', cb); + } catch (e) { + this.error(e.toString()); + } +}; + +/** + * Sends a close instruction to the remote party. + * + * @api public + */ + +Sender.prototype.close = function(code, data, mask, cb) { + if (this.isClosed) return; + this.isClosed = true; + try { + if (this.continuationFrame) this.socket.write(new Buffer([0xff], 'binary')); + this.socket.write(new Buffer([0xff, 0x00]), 'binary', cb); + } catch (e) { + this.error(e.toString()); + } +}; + +/** + * Sends a ping message to the remote party. Not available for hixie. + * + * @api public + */ + +Sender.prototype.ping = function(data, options) {}; + +/** + * Sends a pong message to the remote party. Not available for hixie. + * + * @api public + */ + +Sender.prototype.pong = function(data, options) {}; + +/** + * Handles an error + * + * @api private + */ + +Sender.prototype.error = function (reason) { + this.emit('error', reason); + return this; +}; diff --git a/node_modules/ws/lib/Sender.js b/node_modules/ws/lib/Sender.js new file mode 100644 index 000000000..9a1e43b4f --- /dev/null +++ b/node_modules/ws/lib/Sender.js @@ -0,0 +1,310 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +var events = require('events') + , util = require('util') + , crypto = require('crypto') + , EventEmitter = events.EventEmitter + , ErrorCodes = require('./ErrorCodes') + , bufferUtil = require('./BufferUtil') + , PerMessageDeflate = require('./PerMessageDeflate'); + +/** + * HyBi Sender implementation + */ + +function Sender(socket, extensions) { + if (this instanceof Sender === false) { + throw new TypeError("Classes can't be function-called"); + } + + events.EventEmitter.call(this); + + this._socket = socket; + this.extensions = extensions || {}; + this.firstFragment = true; + this.compress = false; + this.messageHandlers = []; + this.processing = false; +} + +/** + * Inherits from EventEmitter. + */ + +util.inherits(Sender, events.EventEmitter); + +/** + * Sends a close instruction to the remote party. + * + * @api public + */ + +Sender.prototype.close = function(code, data, mask, cb) { + if (typeof code !== 'undefined') { + if (typeof code !== 'number' || + !ErrorCodes.isValidErrorCode(code)) throw new Error('first argument must be a valid error code number'); + } + code = code || 1000; + var dataBuffer = new Buffer(2 + (data ? Buffer.byteLength(data) : 0)); + writeUInt16BE.call(dataBuffer, code, 0); + if (dataBuffer.length > 2) dataBuffer.write(data, 2); + + var self = this; + this.messageHandlers.push(function() { + self.frameAndSend(0x8, dataBuffer, true, mask); + if (typeof cb == 'function') cb(); + }); + this.flush(); +}; + +/** + * Sends a ping message to the remote party. + * + * @api public + */ + +Sender.prototype.ping = function(data, options) { + var mask = options && options.mask; + var self = this; + this.messageHandlers.push(function() { + self.frameAndSend(0x9, data || '', true, mask); + }); + this.flush(); +}; + +/** + * Sends a pong message to the remote party. + * + * @api public + */ + +Sender.prototype.pong = function(data, options) { + var mask = options && options.mask; + var self = this; + this.messageHandlers.push(function() { + self.frameAndSend(0xa, data || '', true, mask); + }); + this.flush(); +}; + +/** + * Sends text or binary data to the remote party. + * + * @api public + */ + +Sender.prototype.send = function(data, options, cb) { + var finalFragment = options && options.fin === false ? false : true; + var mask = options && options.mask; + var compress = options && options.compress; + var opcode = options && options.binary ? 2 : 1; + if (this.firstFragment === false) { + opcode = 0; + compress = false; + } else { + this.firstFragment = false; + this.compress = compress; + } + if (finalFragment) this.firstFragment = true + + var compressFragment = this.compress; + + var self = this; + this.messageHandlers.push(function() { + if (!data || !compressFragment) { + self.frameAndSend(opcode, data, finalFragment, mask, compress, cb); + return; + } + + self.processing = true; + self.applyExtensions(data, finalFragment, compressFragment, function(err, data) { + if (err) { + if (typeof cb == 'function') cb(err); + else self.emit('error', err); + return; + } + self.frameAndSend(opcode, data, finalFragment, mask, compress, cb); + self.processing = false; + self.flush(); + }); + }); + this.flush(); +}; + +/** + * Frames and sends a piece of data according to the HyBi WebSocket protocol. + * + * @api private + */ + +Sender.prototype.frameAndSend = function(opcode, data, finalFragment, maskData, compressed, cb) { + var canModifyData = false; + + if (!data) { + try { + this._socket.write(new Buffer([opcode | (finalFragment ? 0x80 : 0), 0 | (maskData ? 0x80 : 0)].concat(maskData ? [0, 0, 0, 0] : [])), 'binary', cb); + } + catch (e) { + if (typeof cb == 'function') cb(e); + else this.emit('error', e); + } + return; + } + + if (!Buffer.isBuffer(data)) { + canModifyData = true; + if (data && (typeof data.byteLength !== 'undefined' || typeof data.buffer !== 'undefined')) { + data = getArrayBuffer(data); + } else { + // + // If people want to send a number, this would allocate the number in + // bytes as memory size instead of storing the number as buffer value. So + // we need to transform it to string in order to prevent possible + // vulnerabilities / memory attacks. + // + if (typeof data === 'number') data = data.toString(); + + data = new Buffer(data); + } + } + + var dataLength = data.length + , dataOffset = maskData ? 6 : 2 + , secondByte = dataLength; + + if (dataLength >= 65536) { + dataOffset += 8; + secondByte = 127; + } + else if (dataLength > 125) { + dataOffset += 2; + secondByte = 126; + } + + var mergeBuffers = dataLength < 32768 || (maskData && !canModifyData); + var totalLength = mergeBuffers ? dataLength + dataOffset : dataOffset; + var outputBuffer = new Buffer(totalLength); + outputBuffer[0] = finalFragment ? opcode | 0x80 : opcode; + if (compressed) outputBuffer[0] |= 0x40; + + switch (secondByte) { + case 126: + writeUInt16BE.call(outputBuffer, dataLength, 2); + break; + case 127: + writeUInt32BE.call(outputBuffer, 0, 2); + writeUInt32BE.call(outputBuffer, dataLength, 6); + } + + if (maskData) { + outputBuffer[1] = secondByte | 0x80; + var mask = getRandomMask(); + outputBuffer[dataOffset - 4] = mask[0]; + outputBuffer[dataOffset - 3] = mask[1]; + outputBuffer[dataOffset - 2] = mask[2]; + outputBuffer[dataOffset - 1] = mask[3]; + if (mergeBuffers) { + bufferUtil.mask(data, mask, outputBuffer, dataOffset, dataLength); + try { + this._socket.write(outputBuffer, 'binary', cb); + } + catch (e) { + if (typeof cb == 'function') cb(e); + else this.emit('error', e); + } + } + else { + bufferUtil.mask(data, mask, data, 0, dataLength); + try { + this._socket.write(outputBuffer, 'binary'); + this._socket.write(data, 'binary', cb); + } + catch (e) { + if (typeof cb == 'function') cb(e); + else this.emit('error', e); + } + } + } + else { + outputBuffer[1] = secondByte; + if (mergeBuffers) { + data.copy(outputBuffer, dataOffset); + try { + this._socket.write(outputBuffer, 'binary', cb); + } + catch (e) { + if (typeof cb == 'function') cb(e); + else this.emit('error', e); + } + } + else { + try { + this._socket.write(outputBuffer, 'binary'); + this._socket.write(data, 'binary', cb); + } + catch (e) { + if (typeof cb == 'function') cb(e); + else this.emit('error', e); + } + } + } +}; + +/** + * Execute message handler buffers + * + * @api private + */ + +Sender.prototype.flush = function() { + while (!this.processing && this.messageHandlers.length) { + this.messageHandlers.shift()(); + } +}; + +/** + * Apply extensions to message + * + * @api private + */ + +Sender.prototype.applyExtensions = function(data, fin, compress, callback) { + if ((data.buffer || data) instanceof ArrayBuffer) { + data = getArrayBuffer(data); + } + this.extensions[PerMessageDeflate.extensionName].compress(data, fin, callback); +}; + +module.exports = Sender; + +function writeUInt16BE(value, offset) { + this[offset] = (value & 0xff00)>>8; + this[offset+1] = value & 0xff; +} + +function writeUInt32BE(value, offset) { + this[offset] = (value & 0xff000000)>>24; + this[offset+1] = (value & 0xff0000)>>16; + this[offset+2] = (value & 0xff00)>>8; + this[offset+3] = value & 0xff; +} + +function getArrayBuffer(data) { + // data is either an ArrayBuffer or ArrayBufferView. + var array = new Uint8Array(data.buffer || data) + , l = data.byteLength || data.length + , o = data.byteOffset || 0 + , buffer = new Buffer(l); + for (var i = 0; i < l; ++i) { + buffer[i] = array[o+i]; + } + return buffer; +} + +function getRandomMask() { + return crypto.randomBytes(4); +} diff --git a/node_modules/ws/lib/Validation.fallback.js b/node_modules/ws/lib/Validation.fallback.js new file mode 100644 index 000000000..639b0d316 --- /dev/null +++ b/node_modules/ws/lib/Validation.fallback.js @@ -0,0 +1,11 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +exports.Validation = { + isValidUTF8: function(buffer) { + return true; + } +}; diff --git a/node_modules/ws/lib/Validation.js b/node_modules/ws/lib/Validation.js new file mode 100644 index 000000000..0adace5ff --- /dev/null +++ b/node_modules/ws/lib/Validation.js @@ -0,0 +1,19 @@ +'use strict'; + +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +var isValidUTF8; + +try { + isValidUTF8 = require('utf-8-validate'); +} catch (e) { + isValidUTF8 = require('./Validation.fallback'); +} + +module.exports = typeof isValidUTF8 === 'object' + ? isValidUTF8.Validation.isValidUTF8 + : isValidUTF8; diff --git a/node_modules/ws/lib/WebSocket.js b/node_modules/ws/lib/WebSocket.js new file mode 100644 index 000000000..bb09e851b --- /dev/null +++ b/node_modules/ws/lib/WebSocket.js @@ -0,0 +1,987 @@ +'use strict'; + +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +var url = require('url') + , util = require('util') + , http = require('http') + , https = require('https') + , crypto = require('crypto') + , stream = require('stream') + , Ultron = require('ultron') + , Options = require('options') + , Sender = require('./Sender') + , Receiver = require('./Receiver') + , SenderHixie = require('./Sender.hixie') + , ReceiverHixie = require('./Receiver.hixie') + , Extensions = require('./Extensions') + , PerMessageDeflate = require('./PerMessageDeflate') + , EventEmitter = require('events').EventEmitter; + +/** + * Constants + */ + +// Default protocol version + +var protocolVersion = 13; + +// Close timeout + +var closeTimeout = 30 * 1000; // Allow 30 seconds to terminate the connection cleanly + +/** + * WebSocket implementation + * + * @constructor + * @param {String} address Connection address. + * @param {String|Array} protocols WebSocket protocols. + * @param {Object} options Additional connection options. + * @api public + */ +function WebSocket(address, protocols, options) { + if (this instanceof WebSocket === false) { + return new WebSocket(address, protocols, options); + } + + EventEmitter.call(this); + + if (protocols && !Array.isArray(protocols) && 'object' === typeof protocols) { + // accept the "options" Object as the 2nd argument + options = protocols; + protocols = null; + } + + if ('string' === typeof protocols) { + protocols = [ protocols ]; + } + + if (!Array.isArray(protocols)) { + protocols = []; + } + + this._socket = null; + this._ultron = null; + this._closeReceived = false; + this.bytesReceived = 0; + this.readyState = null; + this.supports = {}; + this.extensions = {}; + this._binaryType = 'nodebuffer'; + + if (Array.isArray(address)) { + initAsServerClient.apply(this, address.concat(options)); + } else { + initAsClient.apply(this, [address, protocols, options]); + } +} + +/** + * Inherits from EventEmitter. + */ +util.inherits(WebSocket, EventEmitter); + +/** + * Ready States + */ +["CONNECTING", "OPEN", "CLOSING", "CLOSED"].forEach(function each(state, index) { + WebSocket.prototype[state] = WebSocket[state] = index; +}); + +/** + * Gracefully closes the connection, after sending a description message to the server + * + * @param {Object} data to be sent to the server + * @api public + */ +WebSocket.prototype.close = function close(code, data) { + if (this.readyState === WebSocket.CLOSED) return; + + if (this.readyState === WebSocket.CONNECTING) { + this.readyState = WebSocket.CLOSED; + return; + } + + if (this.readyState === WebSocket.CLOSING) { + if (this._closeReceived && this._isServer) { + this.terminate(); + } + return; + } + + var self = this; + try { + this.readyState = WebSocket.CLOSING; + this._closeCode = code; + this._closeMessage = data; + var mask = !this._isServer; + this._sender.close(code, data, mask, function(err) { + if (err) self.emit('error', err); + + if (self._closeReceived && self._isServer) { + self.terminate(); + } else { + // ensure that the connection is cleaned up even when no response of closing handshake. + clearTimeout(self._closeTimer); + self._closeTimer = setTimeout(cleanupWebsocketResources.bind(self, true), closeTimeout); + } + }); + } catch (e) { + this.emit('error', e); + } +}; + +/** + * Pause the client stream + * + * @api public + */ +WebSocket.prototype.pause = function pauser() { + if (this.readyState !== WebSocket.OPEN) throw new Error('not opened'); + + return this._socket.pause(); +}; + +/** + * Sends a ping + * + * @param {Object} data to be sent to the server + * @param {Object} Members - mask: boolean, binary: boolean + * @param {boolean} dontFailWhenClosed indicates whether or not to throw if the connection isnt open + * @api public + */ +WebSocket.prototype.ping = function ping(data, options, dontFailWhenClosed) { + if (this.readyState !== WebSocket.OPEN) { + if (dontFailWhenClosed === true) return; + throw new Error('not opened'); + } + + options = options || {}; + + if (typeof options.mask === 'undefined') options.mask = !this._isServer; + + this._sender.ping(data, options); +}; + +/** + * Sends a pong + * + * @param {Object} data to be sent to the server + * @param {Object} Members - mask: boolean, binary: boolean + * @param {boolean} dontFailWhenClosed indicates whether or not to throw if the connection isnt open + * @api public + */ +WebSocket.prototype.pong = function(data, options, dontFailWhenClosed) { + if (this.readyState !== WebSocket.OPEN) { + if (dontFailWhenClosed === true) return; + throw new Error('not opened'); + } + + options = options || {}; + + if (typeof options.mask === 'undefined') options.mask = !this._isServer; + + this._sender.pong(data, options); +}; + +/** + * Resume the client stream + * + * @api public + */ +WebSocket.prototype.resume = function resume() { + if (this.readyState !== WebSocket.OPEN) throw new Error('not opened'); + + return this._socket.resume(); +}; + +/** + * Sends a piece of data + * + * @param {Object} data to be sent to the server + * @param {Object} Members - mask: boolean, binary: boolean, compress: boolean + * @param {function} Optional callback which is executed after the send completes + * @api public + */ + +WebSocket.prototype.send = function send(data, options, cb) { + if (typeof options === 'function') { + cb = options; + options = {}; + } + + if (this.readyState !== WebSocket.OPEN) { + if (typeof cb === 'function') cb(new Error('not opened')); + else throw new Error('not opened'); + return; + } + + if (!data) data = ''; + if (this._queue) { + var self = this; + this._queue.push(function() { self.send(data, options, cb); }); + return; + } + + options = options || {}; + options.fin = true; + + if (typeof options.binary === 'undefined') { + options.binary = (data instanceof ArrayBuffer || data instanceof Buffer || + data instanceof Uint8Array || + data instanceof Uint16Array || + data instanceof Uint32Array || + data instanceof Int8Array || + data instanceof Int16Array || + data instanceof Int32Array || + data instanceof Float32Array || + data instanceof Float64Array); + } + + if (typeof options.mask === 'undefined') options.mask = !this._isServer; + if (typeof options.compress === 'undefined') options.compress = true; + if (!this.extensions[PerMessageDeflate.extensionName]) { + options.compress = false; + } + + var readable = typeof stream.Readable === 'function' + ? stream.Readable + : stream.Stream; + + if (data instanceof readable) { + startQueue(this); + var self = this; + + sendStream(this, data, options, function send(error) { + process.nextTick(function tock() { + executeQueueSends(self); + }); + + if (typeof cb === 'function') cb(error); + }); + } else { + this._sender.send(data, options, cb); + } +}; + +/** + * Streams data through calls to a user supplied function + * + * @param {Object} Members - mask: boolean, binary: boolean, compress: boolean + * @param {function} 'function (error, send)' which is executed on successive ticks of which send is 'function (data, final)'. + * @api public + */ +WebSocket.prototype.stream = function stream(options, cb) { + if (typeof options === 'function') { + cb = options; + options = {}; + } + + var self = this; + + if (typeof cb !== 'function') throw new Error('callback must be provided'); + + if (this.readyState !== WebSocket.OPEN) { + if (typeof cb === 'function') cb(new Error('not opened')); + else throw new Error('not opened'); + return; + } + + if (this._queue) { + this._queue.push(function () { self.stream(options, cb); }); + return; + } + + options = options || {}; + + if (typeof options.mask === 'undefined') options.mask = !this._isServer; + if (typeof options.compress === 'undefined') options.compress = true; + if (!this.extensions[PerMessageDeflate.extensionName]) { + options.compress = false; + } + + startQueue(this); + + function send(data, final) { + try { + if (self.readyState !== WebSocket.OPEN) throw new Error('not opened'); + options.fin = final === true; + self._sender.send(data, options); + if (!final) process.nextTick(cb.bind(null, null, send)); + else executeQueueSends(self); + } catch (e) { + if (typeof cb === 'function') cb(e); + else { + delete self._queue; + self.emit('error', e); + } + } + } + + process.nextTick(cb.bind(null, null, send)); +}; + +/** + * Immediately shuts down the connection + * + * @api public + */ +WebSocket.prototype.terminate = function terminate() { + if (this.readyState === WebSocket.CLOSED) return; + + if (this._socket) { + this.readyState = WebSocket.CLOSING; + + // End the connection + try { this._socket.end(); } + catch (e) { + // Socket error during end() call, so just destroy it right now + cleanupWebsocketResources.call(this, true); + return; + } + + // Add a timeout to ensure that the connection is completely + // cleaned up within 30 seconds, even if the clean close procedure + // fails for whatever reason + // First cleanup any pre-existing timeout from an earlier "terminate" call, + // if one exists. Otherwise terminate calls in quick succession will leak timeouts + // and hold the program open for `closeTimout` time. + if (this._closeTimer) { clearTimeout(this._closeTimer); } + this._closeTimer = setTimeout(cleanupWebsocketResources.bind(this, true), closeTimeout); + } else if (this.readyState === WebSocket.CONNECTING) { + cleanupWebsocketResources.call(this, true); + } +}; + +/** + * Expose bufferedAmount + * + * @api public + */ +Object.defineProperty(WebSocket.prototype, 'bufferedAmount', { + get: function get() { + var amount = 0; + if (this._socket) { + amount = this._socket.bufferSize || 0; + } + return amount; + } +}); + +/** + * Expose binaryType + * + * This deviates from the W3C interface since ws doesn't support the required + * default "blob" type (instead we define a custom "nodebuffer" type). + * + * @see http://dev.w3.org/html5/websockets/#the-websocket-interface + * @api public + */ +Object.defineProperty(WebSocket.prototype, 'binaryType', { + get: function get() { + return this._binaryType; + }, + set: function set(type) { + if (type === 'arraybuffer' || type === 'nodebuffer') + this._binaryType = type; + else + throw new SyntaxError('unsupported binaryType: must be either "nodebuffer" or "arraybuffer"'); + } +}); + +/** + * Emulates the W3C Browser based WebSocket interface using function members. + * + * @see http://dev.w3.org/html5/websockets/#the-websocket-interface + * @api public + */ +['open', 'error', 'close', 'message'].forEach(function(method) { + Object.defineProperty(WebSocket.prototype, 'on' + method, { + /** + * Returns the current listener + * + * @returns {Mixed} the set function or undefined + * @api public + */ + get: function get() { + var listener = this.listeners(method)[0]; + return listener ? (listener._listener ? listener._listener : listener) : undefined; + }, + + /** + * Start listening for events + * + * @param {Function} listener the listener + * @returns {Mixed} the set function or undefined + * @api public + */ + set: function set(listener) { + this.removeAllListeners(method); + this.addEventListener(method, listener); + } + }); +}); + +/** + * Emulates the W3C Browser based WebSocket interface using addEventListener. + * + * @see https://developer.mozilla.org/en/DOM/element.addEventListener + * @see http://dev.w3.org/html5/websockets/#the-websocket-interface + * @api public + */ +WebSocket.prototype.addEventListener = function(method, listener) { + var target = this; + + function onMessage (data, flags) { + if (flags.binary && this.binaryType === 'arraybuffer') + data = new Uint8Array(data).buffer; + listener.call(target, new MessageEvent(data, !!flags.binary, target)); + } + + function onClose (code, message) { + listener.call(target, new CloseEvent(code, message, target)); + } + + function onError (event) { + event.type = 'error'; + event.target = target; + listener.call(target, event); + } + + function onOpen () { + listener.call(target, new OpenEvent(target)); + } + + if (typeof listener === 'function') { + if (method === 'message') { + // store a reference so we can return the original function from the + // addEventListener hook + onMessage._listener = listener; + this.on(method, onMessage); + } else if (method === 'close') { + // store a reference so we can return the original function from the + // addEventListener hook + onClose._listener = listener; + this.on(method, onClose); + } else if (method === 'error') { + // store a reference so we can return the original function from the + // addEventListener hook + onError._listener = listener; + this.on(method, onError); + } else if (method === 'open') { + // store a reference so we can return the original function from the + // addEventListener hook + onOpen._listener = listener; + this.on(method, onOpen); + } else { + this.on(method, listener); + } + } +}; + +module.exports = WebSocket; +module.exports.buildHostHeader = buildHostHeader + +/** + * W3C MessageEvent + * + * @see http://www.w3.org/TR/html5/comms.html + * @constructor + * @api private + */ +function MessageEvent(dataArg, isBinary, target) { + this.type = 'message'; + this.data = dataArg; + this.target = target; + this.binary = isBinary; // non-standard. +} + +/** + * W3C CloseEvent + * + * @see http://www.w3.org/TR/html5/comms.html + * @constructor + * @api private + */ +function CloseEvent(code, reason, target) { + this.type = 'close'; + this.wasClean = (typeof code === 'undefined' || code === 1000); + this.code = code; + this.reason = reason; + this.target = target; +} + +/** + * W3C OpenEvent + * + * @see http://www.w3.org/TR/html5/comms.html + * @constructor + * @api private + */ +function OpenEvent(target) { + this.type = 'open'; + this.target = target; +} + +// Append port number to Host header, only if specified in the url +// and non-default +function buildHostHeader(isSecure, hostname, port) { + var headerHost = hostname; + if (hostname) { + if ((isSecure && (port != 443)) || (!isSecure && (port != 80))){ + headerHost = headerHost + ':' + port; + } + } + return headerHost; +} + +/** + * Entirely private apis, + * which may or may not be bound to a sepcific WebSocket instance. + */ +function initAsServerClient(req, socket, upgradeHead, options) { + options = new Options({ + protocolVersion: protocolVersion, + protocol: null, + extensions: {}, + maxPayload: 0 + }).merge(options); + + // expose state properties + this.protocol = options.value.protocol; + this.protocolVersion = options.value.protocolVersion; + this.extensions = options.value.extensions; + this.supports.binary = (this.protocolVersion !== 'hixie-76'); + this.upgradeReq = req; + this.readyState = WebSocket.CONNECTING; + this._isServer = true; + this.maxPayload = options.value.maxPayload; + // establish connection + if (options.value.protocolVersion === 'hixie-76') { + establishConnection.call(this, ReceiverHixie, SenderHixie, socket, upgradeHead); + } else { + establishConnection.call(this, Receiver, Sender, socket, upgradeHead); + } +} + +function initAsClient(address, protocols, options) { + options = new Options({ + origin: null, + protocolVersion: protocolVersion, + host: null, + headers: null, + protocol: protocols.join(','), + agent: null, + + // ssl-related options + pfx: null, + key: null, + passphrase: null, + cert: null, + ca: null, + ciphers: null, + rejectUnauthorized: null, + perMessageDeflate: true, + localAddress: null + }).merge(options); + + if (options.value.protocolVersion !== 8 && options.value.protocolVersion !== 13) { + throw new Error('unsupported protocol version'); + } + + // verify URL and establish http class + var serverUrl = url.parse(address); + var isUnixSocket = serverUrl.protocol === 'ws+unix:'; + if (!serverUrl.host && !isUnixSocket) throw new Error('invalid url'); + var isSecure = serverUrl.protocol === 'wss:' || serverUrl.protocol === 'https:'; + var httpObj = isSecure ? https : http; + var port = serverUrl.port || (isSecure ? 443 : 80); + var auth = serverUrl.auth; + + // prepare extensions + var extensionsOffer = {}; + var perMessageDeflate; + if (options.value.perMessageDeflate) { + perMessageDeflate = new PerMessageDeflate(typeof options.value.perMessageDeflate !== true ? options.value.perMessageDeflate : {}, false); + extensionsOffer[PerMessageDeflate.extensionName] = perMessageDeflate.offer(); + } + + // expose state properties + this._isServer = false; + this.url = address; + this.protocolVersion = options.value.protocolVersion; + this.supports.binary = (this.protocolVersion !== 'hixie-76'); + + // begin handshake + var key = new Buffer(options.value.protocolVersion + '-' + Date.now()).toString('base64'); + var shasum = crypto.createHash('sha1'); + shasum.update(key + '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'); + var expectedServerKey = shasum.digest('base64'); + + var agent = options.value.agent; + + var headerHost = buildHostHeader(isSecure, serverUrl.hostname, port) + + var requestOptions = { + port: port, + host: serverUrl.hostname, + headers: { + 'Connection': 'Upgrade', + 'Upgrade': 'websocket', + 'Host': headerHost, + 'Sec-WebSocket-Version': options.value.protocolVersion, + 'Sec-WebSocket-Key': key + } + }; + + // If we have basic auth. + if (auth) { + requestOptions.headers.Authorization = 'Basic ' + new Buffer(auth).toString('base64'); + } + + if (options.value.protocol) { + requestOptions.headers['Sec-WebSocket-Protocol'] = options.value.protocol; + } + + if (options.value.host) { + requestOptions.headers.Host = options.value.host; + } + + if (options.value.headers) { + for (var header in options.value.headers) { + if (options.value.headers.hasOwnProperty(header)) { + requestOptions.headers[header] = options.value.headers[header]; + } + } + } + + if (Object.keys(extensionsOffer).length) { + requestOptions.headers['Sec-WebSocket-Extensions'] = Extensions.format(extensionsOffer); + } + + if (options.isDefinedAndNonNull('pfx') + || options.isDefinedAndNonNull('key') + || options.isDefinedAndNonNull('passphrase') + || options.isDefinedAndNonNull('cert') + || options.isDefinedAndNonNull('ca') + || options.isDefinedAndNonNull('ciphers') + || options.isDefinedAndNonNull('rejectUnauthorized')) { + + if (options.isDefinedAndNonNull('pfx')) requestOptions.pfx = options.value.pfx; + if (options.isDefinedAndNonNull('key')) requestOptions.key = options.value.key; + if (options.isDefinedAndNonNull('passphrase')) requestOptions.passphrase = options.value.passphrase; + if (options.isDefinedAndNonNull('cert')) requestOptions.cert = options.value.cert; + if (options.isDefinedAndNonNull('ca')) requestOptions.ca = options.value.ca; + if (options.isDefinedAndNonNull('ciphers')) requestOptions.ciphers = options.value.ciphers; + if (options.isDefinedAndNonNull('rejectUnauthorized')) requestOptions.rejectUnauthorized = options.value.rejectUnauthorized; + + if (!agent) { + // global agent ignores client side certificates + agent = new httpObj.Agent(requestOptions); + } + } + + requestOptions.path = serverUrl.path || '/'; + + if (agent) { + requestOptions.agent = agent; + } + + if (isUnixSocket) { + requestOptions.socketPath = serverUrl.pathname; + } + + if (options.value.localAddress) { + requestOptions.localAddress = options.value.localAddress; + } + + if (options.value.origin) { + if (options.value.protocolVersion < 13) requestOptions.headers['Sec-WebSocket-Origin'] = options.value.origin; + else requestOptions.headers.Origin = options.value.origin; + } + + var self = this; + var req = httpObj.request(requestOptions); + + req.on('error', function onerror(error) { + self.emit('error', error); + cleanupWebsocketResources.call(self, error); + }); + + req.once('response', function response(res) { + var error; + + if (!self.emit('unexpected-response', req, res)) { + error = new Error('unexpected server response (' + res.statusCode + ')'); + req.abort(); + self.emit('error', error); + } + + cleanupWebsocketResources.call(self, error); + }); + + req.once('upgrade', function upgrade(res, socket, upgradeHead) { + if (self.readyState === WebSocket.CLOSED) { + // client closed before server accepted connection + self.emit('close'); + self.removeAllListeners(); + socket.end(); + return; + } + + var serverKey = res.headers['sec-websocket-accept']; + if (typeof serverKey === 'undefined' || serverKey !== expectedServerKey) { + self.emit('error', 'invalid server key'); + self.removeAllListeners(); + socket.end(); + return; + } + + var serverProt = res.headers['sec-websocket-protocol']; + var protList = (options.value.protocol || "").split(/, */); + var protError = null; + + if (!options.value.protocol && serverProt) { + protError = 'server sent a subprotocol even though none requested'; + } else if (options.value.protocol && !serverProt) { + protError = 'server sent no subprotocol even though requested'; + } else if (serverProt && protList.indexOf(serverProt) === -1) { + protError = 'server responded with an invalid protocol'; + } + + if (protError) { + self.emit('error', protError); + self.removeAllListeners(); + socket.end(); + return; + } else if (serverProt) { + self.protocol = serverProt; + } + + var serverExtensions = Extensions.parse(res.headers['sec-websocket-extensions']); + if (perMessageDeflate && serverExtensions[PerMessageDeflate.extensionName]) { + try { + perMessageDeflate.accept(serverExtensions[PerMessageDeflate.extensionName]); + } catch (err) { + self.emit('error', 'invalid extension parameter'); + self.removeAllListeners(); + socket.end(); + return; + } + self.extensions[PerMessageDeflate.extensionName] = perMessageDeflate; + } + + establishConnection.call(self, Receiver, Sender, socket, upgradeHead); + + // perform cleanup on http resources + req.removeAllListeners(); + req = null; + agent = null; + }); + + req.end(); + this.readyState = WebSocket.CONNECTING; +} + +function establishConnection(ReceiverClass, SenderClass, socket, upgradeHead) { + var ultron = this._ultron = new Ultron(socket) + , called = false + , self = this; + + socket.setTimeout(0); + socket.setNoDelay(true); + + this._receiver = new ReceiverClass(this.extensions,this.maxPayload); + this._socket = socket; + + // socket cleanup handlers + ultron.on('end', cleanupWebsocketResources.bind(this)); + ultron.on('close', cleanupWebsocketResources.bind(this)); + ultron.on('error', cleanupWebsocketResources.bind(this)); + + // ensure that the upgradeHead is added to the receiver + function firstHandler(data) { + if (called || self.readyState === WebSocket.CLOSED) return; + + called = true; + socket.removeListener('data', firstHandler); + ultron.on('data', realHandler); + + if (upgradeHead && upgradeHead.length > 0) { + realHandler(upgradeHead); + upgradeHead = null; + } + + if (data) realHandler(data); + } + + // subsequent packets are pushed straight to the receiver + function realHandler(data) { + self.bytesReceived += data.length; + self._receiver.add(data); + } + + ultron.on('data', firstHandler); + + // if data was passed along with the http upgrade, + // this will schedule a push of that on to the receiver. + // this has to be done on next tick, since the caller + // hasn't had a chance to set event handlers on this client + // object yet. + process.nextTick(firstHandler); + + // receiver event handlers + self._receiver.ontext = function ontext(data, flags) { + flags = flags || {}; + + self.emit('message', data, flags); + }; + + self._receiver.onbinary = function onbinary(data, flags) { + flags = flags || {}; + + flags.binary = true; + self.emit('message', data, flags); + }; + + self._receiver.onping = function onping(data, flags) { + flags = flags || {}; + + self.pong(data, { + mask: !self._isServer, + binary: flags.binary === true + }, true); + + self.emit('ping', data, flags); + }; + + self._receiver.onpong = function onpong(data, flags) { + self.emit('pong', data, flags || {}); + }; + + self._receiver.onclose = function onclose(code, data, flags) { + flags = flags || {}; + + self._closeReceived = true; + self.close(code, data); + }; + + self._receiver.onerror = function onerror(reason, errorCode) { + // close the connection when the receiver reports a HyBi error code + self.close(typeof errorCode !== 'undefined' ? errorCode : 1002, ''); + self.emit('error', (reason instanceof Error) ? reason : (new Error(reason))); + }; + + // finalize the client + this._sender = new SenderClass(socket, this.extensions); + this._sender.on('error', function onerror(error) { + self.close(1002, ''); + self.emit('error', error); + }); + + this.readyState = WebSocket.OPEN; + this.emit('open'); +} + +function startQueue(instance) { + instance._queue = instance._queue || []; +} + +function executeQueueSends(instance) { + var queue = instance._queue; + if (typeof queue === 'undefined') return; + + delete instance._queue; + for (var i = 0, l = queue.length; i < l; ++i) { + queue[i](); + } +} + +function sendStream(instance, stream, options, cb) { + stream.on('data', function incoming(data) { + if (instance.readyState !== WebSocket.OPEN) { + if (typeof cb === 'function') cb(new Error('not opened')); + else { + delete instance._queue; + instance.emit('error', new Error('not opened')); + } + return; + } + + options.fin = false; + instance._sender.send(data, options); + }); + + stream.on('end', function end() { + if (instance.readyState !== WebSocket.OPEN) { + if (typeof cb === 'function') cb(new Error('not opened')); + else { + delete instance._queue; + instance.emit('error', new Error('not opened')); + } + return; + } + + options.fin = true; + instance._sender.send(null, options); + + if (typeof cb === 'function') cb(null); + }); +} + +function cleanupWebsocketResources(error) { + if (this.readyState === WebSocket.CLOSED) return; + + this.readyState = WebSocket.CLOSED; + + clearTimeout(this._closeTimer); + this._closeTimer = null; + + // If the connection was closed abnormally (with an error), or if + // the close control frame was not received then the close code + // must default to 1006. + if (error || !this._closeReceived) { + this._closeCode = 1006; + } + this.emit('close', this._closeCode || 1000, this._closeMessage || ''); + + if (this._socket) { + if (this._ultron) this._ultron.destroy(); + this._socket.on('error', function onerror() { + try { this.destroy(); } + catch (e) {} + }); + + try { + if (!error) this._socket.end(); + else this._socket.destroy(); + } catch (e) { /* Ignore termination errors */ } + + this._socket = null; + this._ultron = null; + } + + if (this._sender) { + this._sender.removeAllListeners(); + this._sender = null; + } + + if (this._receiver) { + this._receiver.cleanup(); + this._receiver = null; + } + + if (this.extensions[PerMessageDeflate.extensionName]) { + this.extensions[PerMessageDeflate.extensionName].cleanup(); + } + + this.extensions = null; + + this.removeAllListeners(); + this.on('error', function onerror() {}); // catch all errors after this + delete this._queue; +} diff --git a/node_modules/ws/lib/WebSocketServer.js b/node_modules/ws/lib/WebSocketServer.js new file mode 100644 index 000000000..92077cd5a --- /dev/null +++ b/node_modules/ws/lib/WebSocketServer.js @@ -0,0 +1,554 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +var util = require('util') + , events = require('events') + , http = require('http') + , crypto = require('crypto') + , Options = require('options') + , WebSocket = require('./WebSocket') + , Extensions = require('./Extensions') + , PerMessageDeflate = require('./PerMessageDeflate') + , tls = require('tls') + , url = require('url'); + +/** + * WebSocket Server implementation + */ + +function WebSocketServer(options, callback) { + if (this instanceof WebSocketServer === false) { + return new WebSocketServer(options, callback); + } + + events.EventEmitter.call(this); + + options = new Options({ + host: '0.0.0.0', + port: null, + server: null, + verifyClient: null, + handleProtocols: null, + path: null, + noServer: false, + disableHixie: false, + clientTracking: true, + perMessageDeflate: true, + maxPayload: 100 * 1024 * 1024 + }).merge(options); + + if (!options.isDefinedAndNonNull('port') && !options.isDefinedAndNonNull('server') && !options.value.noServer) { + throw new TypeError('`port` or a `server` must be provided'); + } + + var self = this; + + if (options.isDefinedAndNonNull('port')) { + this._server = http.createServer(function (req, res) { + var body = http.STATUS_CODES[426]; + res.writeHead(426, { + 'Content-Length': body.length, + 'Content-Type': 'text/plain' + }); + res.end(body); + }); + this._server.allowHalfOpen = false; + this._server.listen(options.value.port, options.value.host, callback); + this._closeServer = function() { if (self._server) self._server.close(); }; + } + else if (options.value.server) { + this._server = options.value.server; + if (options.value.path) { + // take note of the path, to avoid collisions when multiple websocket servers are + // listening on the same http server + if (this._server._webSocketPaths && options.value.server._webSocketPaths[options.value.path]) { + throw new Error('two instances of WebSocketServer cannot listen on the same http server path'); + } + if (typeof this._server._webSocketPaths !== 'object') { + this._server._webSocketPaths = {}; + } + this._server._webSocketPaths[options.value.path] = 1; + } + } + if (this._server) { + this._onceServerListening = function() { self.emit('listening'); }; + this._server.once('listening', this._onceServerListening); + } + + if (typeof this._server != 'undefined') { + this._onServerError = function(error) { self.emit('error', error) }; + this._server.on('error', this._onServerError); + this._onServerUpgrade = function(req, socket, upgradeHead) { + //copy upgradeHead to avoid retention of large slab buffers used in node core + var head = new Buffer(upgradeHead.length); + upgradeHead.copy(head); + + self.handleUpgrade(req, socket, head, function(client) { + self.emit('connection'+req.url, client); + self.emit('connection', client); + }); + }; + this._server.on('upgrade', this._onServerUpgrade); + } + + this.options = options.value; + this.path = options.value.path; + this.clients = []; +} + +/** + * Inherits from EventEmitter. + */ + +util.inherits(WebSocketServer, events.EventEmitter); + +/** + * Immediately shuts down the connection. + * + * @api public + */ + +WebSocketServer.prototype.close = function(callback) { + // terminate all associated clients + var error = null; + try { + for (var i = 0, l = this.clients.length; i < l; ++i) { + this.clients[i].terminate(); + } + } + catch (e) { + error = e; + } + + // remove path descriptor, if any + if (this.path && this._server._webSocketPaths) { + delete this._server._webSocketPaths[this.path]; + if (Object.keys(this._server._webSocketPaths).length == 0) { + delete this._server._webSocketPaths; + } + } + + // close the http server if it was internally created + try { + if (typeof this._closeServer !== 'undefined') { + this._closeServer(); + } + } + finally { + if (this._server) { + this._server.removeListener('listening', this._onceServerListening); + this._server.removeListener('error', this._onServerError); + this._server.removeListener('upgrade', this._onServerUpgrade); + } + delete this._server; + } + if(callback) + callback(error); + else if(error) + throw error; +} + +/** + * Handle a HTTP Upgrade request. + * + * @api public + */ + +WebSocketServer.prototype.handleUpgrade = function(req, socket, upgradeHead, cb) { + // check for wrong path + if (this.options.path) { + var u = url.parse(req.url); + if (u && u.pathname !== this.options.path) return; + } + + if (typeof req.headers.upgrade === 'undefined' || req.headers.upgrade.toLowerCase() !== 'websocket') { + abortConnection(socket, 400, 'Bad Request'); + return; + } + + if (req.headers['sec-websocket-key1']) handleHixieUpgrade.apply(this, arguments); + else handleHybiUpgrade.apply(this, arguments); +} + +module.exports = WebSocketServer; + +/** + * Entirely private apis, + * which may or may not be bound to a sepcific WebSocket instance. + */ + +function handleHybiUpgrade(req, socket, upgradeHead, cb) { + // handle premature socket errors + var errorHandler = function() { + try { socket.destroy(); } catch (e) {} + } + socket.on('error', errorHandler); + + // verify key presence + if (!req.headers['sec-websocket-key']) { + abortConnection(socket, 400, 'Bad Request'); + return; + } + + // verify version + var version = parseInt(req.headers['sec-websocket-version']); + if ([8, 13].indexOf(version) === -1) { + abortConnection(socket, 400, 'Bad Request'); + return; + } + + // verify protocol + var protocols = req.headers['sec-websocket-protocol']; + + // verify client + var origin = version < 13 ? + req.headers['sec-websocket-origin'] : + req.headers['origin']; + + // handle extensions offer + var extensionsOffer = Extensions.parse(req.headers['sec-websocket-extensions']); + + // handler to call when the connection sequence completes + var self = this; + var completeHybiUpgrade2 = function(protocol) { + + // calc key + var key = req.headers['sec-websocket-key']; + var shasum = crypto.createHash('sha1'); + shasum.update(key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"); + key = shasum.digest('base64'); + + var headers = [ + 'HTTP/1.1 101 Switching Protocols' + , 'Upgrade: websocket' + , 'Connection: Upgrade' + , 'Sec-WebSocket-Accept: ' + key + ]; + + if (typeof protocol != 'undefined') { + headers.push('Sec-WebSocket-Protocol: ' + protocol); + } + + var extensions = {}; + try { + extensions = acceptExtensions.call(self, extensionsOffer); + } catch (err) { + abortConnection(socket, 400, 'Bad Request'); + return; + } + + if (Object.keys(extensions).length) { + var serverExtensions = {}; + Object.keys(extensions).forEach(function(token) { + serverExtensions[token] = [extensions[token].params] + }); + headers.push('Sec-WebSocket-Extensions: ' + Extensions.format(serverExtensions)); + } + + // allows external modification/inspection of handshake headers + self.emit('headers', headers); + + socket.setTimeout(0); + socket.setNoDelay(true); + try { + socket.write(headers.concat('', '').join('\r\n')); + } + catch (e) { + // if the upgrade write fails, shut the connection down hard + try { socket.destroy(); } catch (e) {} + return; + } + + var client = new WebSocket([req, socket, upgradeHead], { + protocolVersion: version, + protocol: protocol, + extensions: extensions, + maxPayload: self.options.maxPayload + }); + + if (self.options.clientTracking) { + self.clients.push(client); + client.on('close', function() { + var index = self.clients.indexOf(client); + if (index != -1) { + self.clients.splice(index, 1); + } + }); + } + + // signal upgrade complete + socket.removeListener('error', errorHandler); + cb(client); + } + + // optionally call external protocol selection handler before + // calling completeHybiUpgrade2 + var completeHybiUpgrade1 = function() { + // choose from the sub-protocols + if (typeof self.options.handleProtocols == 'function') { + var protList = (protocols || "").split(/, */); + var callbackCalled = false; + var res = self.options.handleProtocols(protList, function(result, protocol) { + callbackCalled = true; + if (!result) abortConnection(socket, 401, 'Unauthorized'); + else completeHybiUpgrade2(protocol); + }); + if (!callbackCalled) { + // the handleProtocols handler never called our callback + abortConnection(socket, 501, 'Could not process protocols'); + } + return; + } else { + if (typeof protocols !== 'undefined') { + completeHybiUpgrade2(protocols.split(/, */)[0]); + } + else { + completeHybiUpgrade2(); + } + } + } + + // optionally call external client verification handler + if (typeof this.options.verifyClient == 'function') { + var info = { + origin: origin, + secure: typeof req.connection.authorized !== 'undefined' || typeof req.connection.encrypted !== 'undefined', + req: req + }; + if (this.options.verifyClient.length == 2) { + this.options.verifyClient(info, function(result, code, name) { + if (typeof code === 'undefined') code = 401; + if (typeof name === 'undefined') name = http.STATUS_CODES[code]; + + if (!result) abortConnection(socket, code, name); + else completeHybiUpgrade1(); + }); + return; + } + else if (!this.options.verifyClient(info)) { + abortConnection(socket, 401, 'Unauthorized'); + return; + } + } + + completeHybiUpgrade1(); +} + +function handleHixieUpgrade(req, socket, upgradeHead, cb) { + // handle premature socket errors + var errorHandler = function() { + try { socket.destroy(); } catch (e) {} + } + socket.on('error', errorHandler); + + // bail if options prevent hixie + if (this.options.disableHixie) { + abortConnection(socket, 401, 'Hixie support disabled'); + return; + } + + // verify key presence + if (!req.headers['sec-websocket-key2']) { + abortConnection(socket, 400, 'Bad Request'); + return; + } + + var origin = req.headers['origin'] + , self = this; + + // setup handshake completion to run after client has been verified + var onClientVerified = function() { + var wshost; + if (!req.headers['x-forwarded-host']) + wshost = req.headers.host; + else + wshost = req.headers['x-forwarded-host']; + var location = ((req.headers['x-forwarded-proto'] === 'https' || socket.encrypted) ? 'wss' : 'ws') + '://' + wshost + req.url + , protocol = req.headers['sec-websocket-protocol']; + + // build the response header and return a Buffer + var buildResponseHeader = function() { + var headers = [ + 'HTTP/1.1 101 Switching Protocols' + , 'Upgrade: WebSocket' + , 'Connection: Upgrade' + , 'Sec-WebSocket-Location: ' + location + ]; + if (typeof protocol != 'undefined') headers.push('Sec-WebSocket-Protocol: ' + protocol); + if (typeof origin != 'undefined') headers.push('Sec-WebSocket-Origin: ' + origin); + + return new Buffer(headers.concat('', '').join('\r\n')); + }; + + // send handshake response before receiving the nonce + var handshakeResponse = function() { + + socket.setTimeout(0); + socket.setNoDelay(true); + + var headerBuffer = buildResponseHeader(); + + try { + socket.write(headerBuffer, 'binary', function(err) { + // remove listener if there was an error + if (err) socket.removeListener('data', handler); + return; + }); + } catch (e) { + try { socket.destroy(); } catch (e) {} + return; + }; + }; + + // handshake completion code to run once nonce has been successfully retrieved + var completeHandshake = function(nonce, rest, headerBuffer) { + // calculate key + var k1 = req.headers['sec-websocket-key1'] + , k2 = req.headers['sec-websocket-key2'] + , md5 = crypto.createHash('md5'); + + [k1, k2].forEach(function (k) { + var n = parseInt(k.replace(/[^\d]/g, '')) + , spaces = k.replace(/[^ ]/g, '').length; + if (spaces === 0 || n % spaces !== 0){ + abortConnection(socket, 400, 'Bad Request'); + return; + } + n /= spaces; + md5.update(String.fromCharCode( + n >> 24 & 0xFF, + n >> 16 & 0xFF, + n >> 8 & 0xFF, + n & 0xFF)); + }); + md5.update(nonce.toString('binary')); + + socket.setTimeout(0); + socket.setNoDelay(true); + + try { + var hashBuffer = new Buffer(md5.digest('binary'), 'binary'); + var handshakeBuffer = new Buffer(headerBuffer.length + hashBuffer.length); + headerBuffer.copy(handshakeBuffer, 0); + hashBuffer.copy(handshakeBuffer, headerBuffer.length); + + // do a single write, which - upon success - causes a new client websocket to be setup + socket.write(handshakeBuffer, 'binary', function(err) { + if (err) return; // do not create client if an error happens + var client = new WebSocket([req, socket, rest], { + protocolVersion: 'hixie-76', + protocol: protocol + }); + if (self.options.clientTracking) { + self.clients.push(client); + client.on('close', function() { + var index = self.clients.indexOf(client); + if (index != -1) { + self.clients.splice(index, 1); + } + }); + } + + // signal upgrade complete + socket.removeListener('error', errorHandler); + cb(client); + }); + } + catch (e) { + try { socket.destroy(); } catch (e) {} + return; + } + } + + // retrieve nonce + var nonceLength = 8; + if (upgradeHead && upgradeHead.length >= nonceLength) { + var nonce = upgradeHead.slice(0, nonceLength); + var rest = upgradeHead.length > nonceLength ? upgradeHead.slice(nonceLength) : null; + completeHandshake.call(self, nonce, rest, buildResponseHeader()); + } + else { + // nonce not present in upgradeHead + var nonce = new Buffer(nonceLength); + upgradeHead.copy(nonce, 0); + var received = upgradeHead.length; + var rest = null; + var handler = function (data) { + var toRead = Math.min(data.length, nonceLength - received); + if (toRead === 0) return; + data.copy(nonce, received, 0, toRead); + received += toRead; + if (received == nonceLength) { + socket.removeListener('data', handler); + if (toRead < data.length) rest = data.slice(toRead); + + // complete the handshake but send empty buffer for headers since they have already been sent + completeHandshake.call(self, nonce, rest, new Buffer(0)); + } + } + + // handle additional data as we receive it + socket.on('data', handler); + + // send header response before we have the nonce to fix haproxy buffering + handshakeResponse(); + } + } + + // verify client + if (typeof this.options.verifyClient == 'function') { + var info = { + origin: origin, + secure: typeof req.connection.authorized !== 'undefined' || typeof req.connection.encrypted !== 'undefined', + req: req + }; + if (this.options.verifyClient.length == 2) { + var self = this; + this.options.verifyClient(info, function(result, code, name) { + if (typeof code === 'undefined') code = 401; + if (typeof name === 'undefined') name = http.STATUS_CODES[code]; + + if (!result) abortConnection(socket, code, name); + else onClientVerified.apply(self); + }); + return; + } + else if (!this.options.verifyClient(info)) { + abortConnection(socket, 401, 'Unauthorized'); + return; + } + } + + // no client verification required + onClientVerified(); +} + +function acceptExtensions(offer) { + var extensions = {}; + var options = this.options.perMessageDeflate; + var maxPayload = this.options.maxPayload; + if (options && offer[PerMessageDeflate.extensionName]) { + var perMessageDeflate = new PerMessageDeflate(options !== true ? options : {}, true, maxPayload); + perMessageDeflate.accept(offer[PerMessageDeflate.extensionName]); + extensions[PerMessageDeflate.extensionName] = perMessageDeflate; + } + return extensions; +} + +function abortConnection(socket, code, name) { + try { + var response = [ + 'HTTP/1.1 ' + code + ' ' + name, + 'Content-type: text/html' + ]; + socket.write(response.concat('', '').join('\r\n')); + } + catch (e) { /* ignore errors - we've aborted this connection */ } + finally { + // ensure that an early aborted connection is shut down completely + try { socket.destroy(); } catch (e) {} + } +} diff --git a/node_modules/ws/package.json b/node_modules/ws/package.json new file mode 100644 index 000000000..15627e201 --- /dev/null +++ b/node_modules/ws/package.json @@ -0,0 +1,76 @@ +{ + "_from": "ws@^1.1.1", + "_id": "ws@1.1.5", + "_inBundle": false, + "_integrity": "sha512-o3KqipXNUdS7wpQzBHSe180lBGO60SoK0yVo3CYJgb2MkobuWuBX6dhkYP5ORCLd55y+SaflMOV5fqAB53ux4w==", + "_location": "/ws", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ws@^1.1.1", + "name": "ws", + "escapedName": "ws", + "rawSpec": "^1.1.1", + "saveSpec": null, + "fetchSpec": "^1.1.1" + }, + "_requiredBy": [ + "/budo" + ], + "_resolved": "https://registry.npmjs.org/ws/-/ws-1.1.5.tgz", + "_shasum": "cbd9e6e75e09fc5d2c90015f21f0c40875e0dd51", + "_spec": "ws@^1.1.1", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", + "author": { + "name": "Einar Otto Stangvik", + "email": "einaros@gmail.com", + "url": "http://2x.io" + }, + "bugs": { + "url": "https://github.com/websockets/ws/issues" + }, + "bundleDependencies": false, + "dependencies": { + "options": ">=0.0.5", + "ultron": "1.0.x" + }, + "deprecated": false, + "description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js", + "devDependencies": { + "ansi": "0.3.x", + "benchmark": "0.3.x", + "bufferutil": "1.2.x", + "expect.js": "0.3.x", + "istanbul": "^0.4.1", + "mocha": "2.3.x", + "should": "8.0.x", + "tinycolor": "0.0.x", + "utf-8-validate": "1.2.x" + }, + "files": [ + "index.js", + "lib" + ], + "homepage": "https://github.com/websockets/ws", + "keywords": [ + "Hixie", + "HyBi", + "Push", + "RFC-6455", + "WebSocket", + "WebSockets", + "real-time" + ], + "license": "MIT", + "main": "index.js", + "name": "ws", + "repository": { + "type": "git", + "url": "git+https://github.com/websockets/ws.git" + }, + "scripts": { + "test": "make test" + }, + "version": "1.1.5" +} diff --git a/node_modules/xtend/.jshintrc b/node_modules/xtend/.jshintrc new file mode 100644 index 000000000..77887b5f0 --- /dev/null +++ b/node_modules/xtend/.jshintrc @@ -0,0 +1,30 @@ +{ + "maxdepth": 4, + "maxstatements": 200, + "maxcomplexity": 12, + "maxlen": 80, + "maxparams": 5, + + "curly": true, + "eqeqeq": true, + "immed": true, + "latedef": false, + "noarg": true, + "noempty": true, + "nonew": true, + "undef": true, + "unused": "vars", + "trailing": true, + + "quotmark": true, + "expr": true, + "asi": true, + + "browser": false, + "esnext": true, + "devel": false, + "node": false, + "nonstandard": false, + + "predef": ["require", "module", "__dirname", "__filename"] +} diff --git a/node_modules/xtend/.npmignore b/node_modules/xtend/.npmignore new file mode 100644 index 000000000..3c3629e64 --- /dev/null +++ b/node_modules/xtend/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/xtend/LICENCE b/node_modules/xtend/LICENCE new file mode 100644 index 000000000..1a14b437e --- /dev/null +++ b/node_modules/xtend/LICENCE @@ -0,0 +1,19 @@ +Copyright (c) 2012-2014 Raynos. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/xtend/Makefile b/node_modules/xtend/Makefile new file mode 100644 index 000000000..d583fcf49 --- /dev/null +++ b/node_modules/xtend/Makefile @@ -0,0 +1,4 @@ +browser: + node ./support/compile + +.PHONY: browser \ No newline at end of file diff --git a/node_modules/xtend/README.md b/node_modules/xtend/README.md new file mode 100644 index 000000000..093cb2978 --- /dev/null +++ b/node_modules/xtend/README.md @@ -0,0 +1,32 @@ +# xtend + +[![browser support][3]][4] + +[![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges) + +Extend like a boss + +xtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes precedence. + +## Examples + +```js +var extend = require("xtend") + +// extend returns a new object. Does not mutate arguments +var combination = extend({ + a: "a", + b: 'c' +}, { + b: "b" +}) +// { a: "a", b: "b" } +``` + +## Stability status: Locked + +## MIT Licenced + + + [3]: http://ci.testling.com/Raynos/xtend.png + [4]: http://ci.testling.com/Raynos/xtend diff --git a/node_modules/xtend/immutable.js b/node_modules/xtend/immutable.js new file mode 100644 index 000000000..94889c9de --- /dev/null +++ b/node_modules/xtend/immutable.js @@ -0,0 +1,19 @@ +module.exports = extend + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +function extend() { + var target = {} + + for (var i = 0; i < arguments.length; i++) { + var source = arguments[i] + + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + target[key] = source[key] + } + } + } + + return target +} diff --git a/node_modules/xtend/mutable.js b/node_modules/xtend/mutable.js new file mode 100644 index 000000000..72debede6 --- /dev/null +++ b/node_modules/xtend/mutable.js @@ -0,0 +1,17 @@ +module.exports = extend + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +function extend(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] + + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + target[key] = source[key] + } + } + } + + return target +} diff --git a/node_modules/xtend/package.json b/node_modules/xtend/package.json new file mode 100644 index 000000000..4f251ae20 --- /dev/null +++ b/node_modules/xtend/package.json @@ -0,0 +1,95 @@ +{ + "_from": "xtend@^4.0.0", + "_id": "xtend@4.0.1", + "_inBundle": false, + "_integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "_location": "/xtend", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "xtend@^4.0.0", + "name": "xtend", + "escapedName": "xtend", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/acorn-node", + "/browserify", + "/budo", + "/insert-module-globals", + "/module-deps", + "/split2/through2", + "/stream-http", + "/through2", + "/undeclared-identifiers", + "/watchify" + ], + "_resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "_shasum": "a5c6d532be656e23db820efb943a1f04998d63af", + "_spec": "xtend@^4.0.0", + "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", + "author": { + "name": "Raynos", + "email": "raynos2@gmail.com" + }, + "bugs": { + "url": "https://github.com/Raynos/xtend/issues", + "email": "raynos2@gmail.com" + }, + "bundleDependencies": false, + "contributors": [ + { + "name": "Jake Verbaten" + }, + { + "name": "Matt Esch" + } + ], + "dependencies": {}, + "deprecated": false, + "description": "extend like a boss", + "devDependencies": { + "tape": "~1.1.0" + }, + "engines": { + "node": ">=0.4" + }, + "homepage": "https://github.com/Raynos/xtend", + "keywords": [ + "extend", + "merge", + "options", + "opts", + "object", + "array" + ], + "license": "MIT", + "main": "immutable", + "name": "xtend", + "repository": { + "type": "git", + "url": "git://github.com/Raynos/xtend.git" + }, + "scripts": { + "test": "node test" + }, + "testling": { + "files": "test.js", + "browsers": [ + "ie/7..latest", + "firefox/16..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest" + ] + }, + "version": "4.0.1" +} diff --git a/node_modules/xtend/test.js b/node_modules/xtend/test.js new file mode 100644 index 000000000..093a2b061 --- /dev/null +++ b/node_modules/xtend/test.js @@ -0,0 +1,83 @@ +var test = require("tape") +var extend = require("./") +var mutableExtend = require("./mutable") + +test("merge", function(assert) { + var a = { a: "foo" } + var b = { b: "bar" } + + assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) + assert.end() +}) + +test("replace", function(assert) { + var a = { a: "foo" } + var b = { a: "bar" } + + assert.deepEqual(extend(a, b), { a: "bar" }) + assert.end() +}) + +test("undefined", function(assert) { + var a = { a: undefined } + var b = { b: "foo" } + + assert.deepEqual(extend(a, b), { a: undefined, b: "foo" }) + assert.deepEqual(extend(b, a), { a: undefined, b: "foo" }) + assert.end() +}) + +test("handle 0", function(assert) { + var a = { a: "default" } + var b = { a: 0 } + + assert.deepEqual(extend(a, b), { a: 0 }) + assert.deepEqual(extend(b, a), { a: "default" }) + assert.end() +}) + +test("is immutable", function (assert) { + var record = {} + + extend(record, { foo: "bar" }) + assert.equal(record.foo, undefined) + assert.end() +}) + +test("null as argument", function (assert) { + var a = { foo: "bar" } + var b = null + var c = void 0 + + assert.deepEqual(extend(b, a, c), { foo: "bar" }) + assert.end() +}) + +test("mutable", function (assert) { + var a = { foo: "bar" } + + mutableExtend(a, { bar: "baz" }) + + assert.equal(a.bar, "baz") + assert.end() +}) + +test("null prototype", function(assert) { + var a = { a: "foo" } + var b = Object.create(null) + b.b = "bar"; + + assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) + assert.end() +}) + +test("null prototype mutable", function (assert) { + var a = { foo: "bar" } + var b = Object.create(null) + b.bar = "baz"; + + mutableExtend(a, b) + + assert.equal(a.bar, "baz") + assert.end() +}) diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 000000000..d36c0791c --- /dev/null +++ b/package-lock.json @@ -0,0 +1,4234 @@ +{ + "name": "play-logo", + "version": "4.0.2", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/polyfill": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.0.0.tgz", + "integrity": "sha512-dnrMRkyyr74CRelJwvgnnSUDh2ge2NCTyHVwpOdvRMHtJUyxLtMAfhBN3s64pY41zdw0kgiLPh6S20eb1NcX6Q==", + "requires": { + "core-js": "^2.5.7", + "regenerator-runtime": "^0.11.1" + } + }, + "JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "dev": true, + "requires": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + } + }, + "acorn": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.2.tgz", + "integrity": "sha512-GXmKIvbrN3TV7aVqAzVFaMW8F8wzVX7voEBRO3bDA64+EX37YSayggRJP5Xig6HYHBkWKpFg9W5gg6orklubhg==", + "dev": true + }, + "acorn-dynamic-import": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", + "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", + "dev": true + }, + "acorn-node": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.6.2.tgz", + "integrity": "sha512-rIhNEZuNI8ibQcL7ANm/mGyPukIaZsRNX9psFNQURyJW0nu6k8wjSDld20z6v2mDBWqX13pIEnk9gGZJHIlEXg==", + "dev": true, + "requires": { + "acorn": "^6.0.2", + "acorn-dynamic-import": "^4.0.0", + "acorn-walk": "^6.1.0", + "xtend": "^4.0.1" + } + }, + "acorn-walk": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.0.tgz", + "integrity": "sha512-ugTb7Lq7u4GfWSqqpwE0bGyoBZNMTok/zDBXxfEG0QM50jNlGhIWjRC1pPN7bvV1anhF+bs+/gNcRw+o55Evbg==", + "dev": true + }, + "ansi-regex": { + "version": "0.2.1", + "resolved": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz", + "integrity": "sha1-DY6UaWej2BQ/k+JOKYUl/BsiNfk=", + "dev": true + }, + "ansi-styles": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz", + "integrity": "sha1-6uy/Zs1waIJ2Cy9GkVgrj1XXp94=", + "dev": true + }, + "anymatch": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "dev": true, + "requires": { + "micromatch": "^2.1.5", + "normalize-path": "^2.0.0" + } + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-filter": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", + "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", + "dev": true + }, + "array-map": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", + "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", + "dev": true + }, + "array-reduce": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", + "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", + "dev": true + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "assert": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", + "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "dev": true, + "requires": { + "util": "0.10.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + } + } + } + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "async-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "base64-js": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", + "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", + "dev": true + }, + "bel": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/bel/-/bel-6.0.0.tgz", + "integrity": "sha512-KXYw+v9f7szrr0750pJ2vJbM40TLCKVd7kZv7tR/Cw8vShvR3+ouZZfZqU4nSkDuWBru7JhRPExq33bGsnCINg==", + "requires": { + "hyperx": "^2.3.0", + "is-electron": "^2.0.0", + "pelo": "^0.1.0" + } + }, + "binary-extensions": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.12.0.tgz", + "integrity": "sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg==", + "dev": true + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "bole": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bole/-/bole-2.0.0.tgz", + "integrity": "sha1-2KocaQRnv7T+Ebh0rLLoOH44JhU=", + "dev": true, + "requires": { + "core-util-is": ">=1.0.1 <1.1.0-0", + "individual": ">=3.0.0 <3.1.0-0", + "json-stringify-safe": ">=5.0.0 <5.1.0-0" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browser-pack": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.1.0.tgz", + "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "combine-source-map": "~0.8.0", + "defined": "^1.0.0", + "safe-buffer": "^5.1.1", + "through2": "^2.0.0", + "umd": "^3.0.0" + } + }, + "browser-resolve": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.3.tgz", + "integrity": "sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==", + "dev": true, + "requires": { + "resolve": "1.1.7" + }, + "dependencies": { + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + } + } + }, + "browserify": { + "version": "16.2.3", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-16.2.3.tgz", + "integrity": "sha512-zQt/Gd1+W+IY+h/xX2NYMW4orQWhqSwyV+xsblycTtpOuB27h1fZhhNQuipJ4t79ohw4P4mMem0jp/ZkISQtjQ==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "assert": "^1.4.0", + "browser-pack": "^6.0.1", + "browser-resolve": "^1.11.0", + "browserify-zlib": "~0.2.0", + "buffer": "^5.0.2", + "cached-path-relative": "^1.0.0", + "concat-stream": "^1.6.0", + "console-browserify": "^1.1.0", + "constants-browserify": "~1.0.0", + "crypto-browserify": "^3.0.0", + "defined": "^1.0.0", + "deps-sort": "^2.0.0", + "domain-browser": "^1.2.0", + "duplexer2": "~0.1.2", + "events": "^2.0.0", + "glob": "^7.1.0", + "has": "^1.0.0", + "htmlescape": "^1.1.0", + "https-browserify": "^1.0.0", + "inherits": "~2.0.1", + "insert-module-globals": "^7.0.0", + "labeled-stream-splicer": "^2.0.0", + "mkdirp": "^0.5.0", + "module-deps": "^6.0.0", + "os-browserify": "~0.3.0", + "parents": "^1.0.1", + "path-browserify": "~0.0.0", + "process": "~0.11.0", + "punycode": "^1.3.2", + "querystring-es3": "~0.2.0", + "read-only-stream": "^2.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.1.4", + "shasum": "^1.0.0", + "shell-quote": "^1.6.1", + "stream-browserify": "^2.0.0", + "stream-http": "^2.0.0", + "string_decoder": "^1.1.1", + "subarg": "^1.0.0", + "syntax-error": "^1.1.1", + "through2": "^2.0.0", + "timers-browserify": "^1.0.1", + "tty-browserify": "0.0.1", + "url": "~0.11.0", + "util": "~0.10.1", + "vm-browserify": "^1.0.0", + "xtend": "^4.0.0" + }, + "dependencies": { + "events": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/events/-/events-2.1.0.tgz", + "integrity": "sha512-3Zmiobend8P9DjmKAty0Era4jV8oJ0yGYe2nJJAxgymF9+N8F2m0hhZiMoWtcfepExzNKZumFU3ksdQbInGWCg==", + "dev": true + } + } + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" + } + }, + "browserify-sign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "dev": true, + "requires": { + "bn.js": "^4.1.1", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.2", + "elliptic": "^6.0.0", + "inherits": "^2.0.1", + "parse-asn1": "^5.0.0" + } + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "requires": { + "pako": "~1.0.5" + } + }, + "budo": { + "version": "11.5.0", + "resolved": "https://registry.npmjs.org/budo/-/budo-11.5.0.tgz", + "integrity": "sha512-kijEIfBG/UOQsNPQiNHAduFeDSMh28jCa6TI+mApIJWUrM2Gq3T7yzh3lCNipWhZTUNBztSj6UxiV1oE31Mvdw==", + "dev": true, + "requires": { + "bole": "^2.0.0", + "browserify": "^16.1.0", + "chokidar": "^1.0.1", + "connect-pushstate": "^1.1.0", + "escape-html": "^1.0.3", + "events": "^1.0.2", + "garnish": "^5.0.0", + "get-ports": "^1.0.2", + "inject-lr-script": "^2.1.0", + "internal-ip": "^3.0.1", + "micromatch": "^2.2.0", + "on-finished": "^2.3.0", + "on-headers": "^1.0.1", + "once": "^1.3.2", + "opn": "^3.0.2", + "path-is-absolute": "^1.0.1", + "pem": "^1.8.3", + "reload-css": "^1.0.0", + "resolve": "^1.1.6", + "serve-static": "^1.10.0", + "simple-html-index": "^1.4.0", + "stacked": "^1.1.1", + "stdout-stream": "^1.4.0", + "strip-ansi": "^3.0.0", + "subarg": "^1.0.0", + "term-color": "^1.0.1", + "url-trim": "^1.0.0", + "watchify-middleware": "^1.8.0", + "ws": "^1.1.1", + "xtend": "^4.0.0" + } + }, + "buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", + "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "cached-path-relative": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.1.tgz", + "integrity": "sha1-0JxLUoAKpMB44t2BqGmqyQ0uVOc=", + "dev": true + }, + "chalk": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz", + "integrity": "sha1-Zjs6ZItotV0EaQ1JFnqoN4WPIXQ=", + "dev": true, + "requires": { + "ansi-styles": "^1.1.0", + "escape-string-regexp": "^1.0.0", + "has-ansi": "^0.1.0", + "strip-ansi": "^0.3.0", + "supports-color": "^0.2.0" + }, + "dependencies": { + "strip-ansi": { + "version": "0.3.0", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz", + "integrity": "sha1-JfSOoiynkYfzF0pNuHWTR7sSYiA=", + "dev": true, + "requires": { + "ansi-regex": "^0.2.1" + } + } + } + }, + "charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=", + "dev": true + }, + "chokidar": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "dev": true, + "requires": { + "anymatch": "^1.3.0", + "async-each": "^1.0.0", + "fsevents": "^1.0.0", + "glob-parent": "^2.0.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^2.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0" + } + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "combine-source-map": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", + "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", + "dev": true, + "requires": { + "convert-source-map": "~1.1.0", + "inline-source-map": "~0.6.0", + "lodash.memoize": "~3.0.3", + "source-map": "~0.5.3" + } + }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "connect-pushstate": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/connect-pushstate/-/connect-pushstate-1.1.0.tgz", + "integrity": "sha1-vKsiQnHEOWBKD7D2FMCl9WPojiQ=", + "dev": true + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "requires": { + "date-now": "^0.1.4" + } + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "convert-source-map": { + "version": "1.1.3", + "resolved": "http://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", + "dev": true + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "core-js": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", + "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "create-ecdh": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", + "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=", + "dev": true + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "csjs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/csjs/-/csjs-1.1.0.tgz", + "integrity": "sha1-G1dTxr2QLaJp3rNpIVWFpdjx84A=" + }, + "csjs-inject": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/csjs-inject/-/csjs-inject-1.0.1.tgz", + "integrity": "sha1-3iIRPEC0bP4X09YqAMd8nX2nUnw=", + "requires": { + "csjs": "^1.0.0", + "insert-css": "^0.2.0" + } + }, + "cytoscape": { + "version": "3.2.18", + "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.2.18.tgz", + "integrity": "sha512-Jg9Z6XwywQtk3hWzd12IznslY2oh87A19xn2pw4zUG9vlRcykeBHUpGAme7Xgrfbzw5TNy0M+IlXcvnyYQrp9g==", + "requires": { + "heap": "^0.2.6", + "lodash.debounce": "^4.0.8" + } + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "debounce": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.0.tgz", + "integrity": "sha512-mYtLl1xfZLi1m4RtQYlZgJUNQjl4ZxVnHzIR8nLLgi4q1YT8o/WM+MK/f8yfcc9s5Ir5zRaPZyZU6xs1Syoocg==", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "default-gateway": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-2.7.2.tgz", + "integrity": "sha512-lAc4i9QJR0YHSDFdzeBQKfZ1SRDG3hsJNEkrpcZa8QhBfidLAilT60BDEIVUUGqosFp425KOgB3uYqcnQrWafQ==", + "dev": true, + "requires": { + "execa": "^0.10.0", + "ip-regex": "^2.1.0" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "dev": true + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, + "deps-sort": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", + "integrity": "sha1-CRckkC6EZYJg65EHSMzNGvbiH7U=", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "shasum": "^1.0.0", + "subarg": "^1.0.0", + "through2": "^2.0.0" + } + }, + "des.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, + "detective": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/detective/-/detective-5.1.0.tgz", + "integrity": "sha512-TFHMqfOvxlgrfVzTEkNBSh9SvSNX/HfF4OFI2QFGCyPm02EsyILqnUeb5P6q7JZ3SFNTBL5t2sePRgrN4epUWQ==", + "dev": true, + "requires": { + "acorn-node": "^1.3.0", + "defined": "^1.0.0", + "minimist": "^1.1.1" + } + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "dev": true + }, + "duplexer2": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", + "dev": true, + "requires": { + "readable-stream": "^2.0.2" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + }, + "elliptic": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", + "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "dev": true + }, + "es6-promisify": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-6.0.1.tgz", + "integrity": "sha512-J3ZkwbEnnO+fGAKrjVpeUAnZshAdfZvbhQpqfIH9kSAspReRC4nJnu8ewm55b4y9ElyeuhCTzJD0XiH8Tsbhlw==", + "dev": true + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "dev": true + }, + "events": { + "version": "1.1.1", + "resolved": "http://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "execa": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz", + "integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "^2.1.0" + } + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true + }, + "fill-range": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "dev": true, + "requires": { + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "dev": true + }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "from2-string": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/from2-string/-/from2-string-1.1.0.tgz", + "integrity": "sha1-GCgrJ9CKJnyzAwzSuLSw8hKvdSo=", + "dev": true, + "requires": { + "from2": "^2.0.3" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", + "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", + "dev": true, + "optional": true, + "requires": { + "nan": "^2.9.2", + "node-pre-gyp": "^0.10.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "debug": { + "version": "2.6.9", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.21", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safer-buffer": "^2.1.0" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "minipass": { + "version": "2.2.4", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "^5.1.1", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "needle": { + "version": "2.2.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "^2.1.2", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.10.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.0", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.1.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.1.10", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.7", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "^0.5.1", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-buffer": { + "version": "5.1.1", + "bundled": true, + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "dev": true, + "optional": true + }, + "semver": { + "version": "5.5.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "4.4.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "chownr": "^1.0.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.2.4", + "minizlib": "^1.1.0", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.1", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "^1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "yallist": { + "version": "3.0.2", + "bundled": true, + "dev": true + } + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "garnish": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/garnish/-/garnish-5.2.0.tgz", + "integrity": "sha1-vtQ2WTguSxmOM8eTiXvnxwHmVXc=", + "dev": true, + "requires": { + "chalk": "^0.5.1", + "minimist": "^1.1.0", + "pad-left": "^2.0.0", + "pad-right": "^0.2.2", + "prettier-bytes": "^1.0.3", + "pretty-ms": "^2.1.0", + "right-now": "^1.0.0", + "split2": "^0.2.1", + "stdout-stream": "^1.4.0", + "url-trim": "^1.0.0" + } + }, + "get-assigned-identifiers": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", + "integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==", + "dev": true + }, + "get-ports": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-ports/-/get-ports-1.0.3.tgz", + "integrity": "sha1-9AvVgKyn7A77e5bL/L6wPviUteg=", + "dev": true, + "requires": { + "map-limit": "0.0.1" + } + }, + "get-stream": { + "version": "3.0.0", + "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "^2.0.0" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-ansi": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz", + "integrity": "sha1-hPJlqujA5qiKEtcCKJS3VoiUxi4=", + "dev": true, + "requires": { + "ansi-regex": "^0.2.0" + } + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "hash.js": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.5.tgz", + "integrity": "sha512-eWI5HG9Np+eHV1KQhisXWwM+4EPPYe5dFX1UZZH7k/E3JzDEazVH+VGlZi6R94ZqImq+A3D1mCEtrFIfg/E7sA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "heap": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/heap/-/heap-0.2.6.tgz", + "integrity": "sha1-CH4fELBGky/IWU3Z5tN4r8nR5aw=" + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "htmlescape": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", + "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", + "dev": true + }, + "http-errors": { + "version": "1.6.3", + "resolved": "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + } + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "dev": true + }, + "hyperscript-attribute-to-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/hyperscript-attribute-to-property/-/hyperscript-attribute-to-property-1.0.2.tgz", + "integrity": "sha512-oerMul16jZCmrbNsUw8QgrtDzF8lKgFri1bKQjReLw1IhiiNkI59CWuzZjJDGT79UQ1YiWqXhJMv/tRMVqgtkA==" + }, + "hyperx": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/hyperx/-/hyperx-2.4.0.tgz", + "integrity": "sha512-43jbOQfVkm9U0oAyBZ4Vt2eB0hZWS5EyrOhR3ZbgUrcprutGu9s/C476OVFL3QU1iynKO5s9kZsWrZm19gJKjg==", + "requires": { + "hyperscript-attribute-to-property": "^1.0.0" + } + }, + "ieee754": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", + "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==", + "dev": true + }, + "individual": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/individual/-/individual-3.0.0.tgz", + "integrity": "sha1-58pPhfiVewGHNPKFdQ3CLsL5hi0=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "inject-lr-script": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/inject-lr-script/-/inject-lr-script-2.1.0.tgz", + "integrity": "sha1-5htehMEYczkGy+oB7D10Zpijn2U=", + "dev": true, + "requires": { + "resp-modifier": "^6.0.0" + } + }, + "inline-source-map": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", + "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", + "dev": true, + "requires": { + "source-map": "~0.5.3" + } + }, + "insert-css": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/insert-css/-/insert-css-0.2.0.tgz", + "integrity": "sha1-0VeJlxZi2YmcKJd/tiINU4HSRRo=" + }, + "insert-module-globals": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.0.tgz", + "integrity": "sha512-VE6NlW+WGn2/AeOMd496AHFYmE7eLKkUY6Ty31k4og5vmA3Fjuwe9v6ifH6Xx/Hz27QvdoMoviw1/pqWRB09Sw==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "acorn-node": "^1.5.2", + "combine-source-map": "^0.8.0", + "concat-stream": "^1.6.1", + "is-buffer": "^1.1.0", + "path-is-absolute": "^1.0.1", + "process": "~0.11.0", + "through2": "^2.0.0", + "undeclared-identifiers": "^1.1.2", + "xtend": "^4.0.0" + } + }, + "internal-ip": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-3.0.1.tgz", + "integrity": "sha512-NXXgESC2nNVtU+pqmC9e6R8B1GpKxzsAQhffvh5AL79qKnodd+L7tnEQmTiUAVngqLalPbSqRA7XGIEL5nCd0Q==", + "dev": true, + "requires": { + "default-gateway": "^2.6.0", + "ipaddr.js": "^1.5.2" + } + }, + "ip-regex": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", + "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", + "dev": true + }, + "ipaddr.js": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.1.tgz", + "integrity": "sha1-+kt5+kf9Pe9eOxWYJRYcClGclCc=", + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true + }, + "is-electron": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-electron/-/is-electron-2.1.0.tgz", + "integrity": "sha512-dkg5xT383+M6zIbbXW/z7n2nz4SFUi2OSyhntnFYkRdtV+HVEfdjEK+5AWisfYgkpe3WYjTIuh7toaKmSfFVWw==" + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "^2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, + "json-stable-stringify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", + "integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=", + "dev": true, + "requires": { + "jsonify": "~0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "labeled-stream-splicer": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.1.tgz", + "integrity": "sha512-MC94mHZRvJ3LfykJlTUipBqenZz1pacOZEMhhQ8dMGcDHs0SBE5GbsavUXV7YtP3icBW17W0Zy1I0lfASmo9Pg==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "isarray": "^2.0.4", + "stream-splicer": "^2.0.0" + }, + "dependencies": { + "isarray": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.4.tgz", + "integrity": "sha512-GMxXOiUirWg1xTKRipM0Ek07rX+ubx4nNVElTJdNLYmNO/2YrDkgJGw9CljXn+r4EWiDQg/8lsRdHyg2PJuUaA==", + "dev": true + } + } + }, + "lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=" + }, + "lodash.memoize": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", + "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", + "dev": true + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-limit": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/map-limit/-/map-limit-0.0.1.tgz", + "integrity": "sha1-63lhAxwPDo0AG/LVb6toXViCLzg=", + "dev": true, + "requires": { + "once": "~1.3.0" + }, + "dependencies": { + "once": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", + "dev": true, + "requires": { + "wrappy": "1" + } + } + } + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "math-random": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", + "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", + "dev": true + }, + "md5": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/md5/-/md5-2.2.1.tgz", + "integrity": "sha1-U6s41f48iJG6RlMp6iP6wFQBJvk=", + "dev": true, + "requires": { + "charenc": "~0.0.1", + "crypt": "~0.0.1", + "is-buffer": "~1.1.1" + } + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + } + }, + "mime": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", + "dev": true + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "module-deps": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.1.0.tgz", + "integrity": "sha512-NPs5N511VD1rrVJihSso/LiBShRbJALYBKzDW91uZYy7BpjnO4bGnZL3HjZ9yKcFdZUWwaYjDz9zxbuP7vKMuQ==", + "dev": true, + "requires": { + "JSONStream": "^1.0.3", + "browser-resolve": "^1.7.0", + "cached-path-relative": "^1.0.0", + "concat-stream": "~1.6.0", + "defined": "^1.0.0", + "detective": "^5.0.2", + "duplexer2": "^0.1.2", + "inherits": "^2.0.1", + "parents": "^1.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.4.0", + "stream-combiner2": "^1.1.1", + "subarg": "^1.0.0", + "through2": "^2.0.0", + "xtend": "^4.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "nan": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", + "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==", + "dev": true, + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "requires": { + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, + "on-headers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", + "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "opn": { + "version": "3.0.3", + "resolved": "http://registry.npmjs.org/opn/-/opn-3.0.3.tgz", + "integrity": "sha1-ttmec5n3jWXDuq/+8fsojpuFJDo=", + "dev": true, + "requires": { + "object-assign": "^4.0.1" + } + }, + "options": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz", + "integrity": "sha1-7CLTEoBrtT5zF3Pnza788cZDEo8=", + "dev": true + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "outpipe": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/outpipe/-/outpipe-1.1.1.tgz", + "integrity": "sha1-UM+GFjZeh+Ax4ppeyTOaPaRyX6I=", + "dev": true, + "requires": { + "shell-quote": "^1.4.2" + } + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "pad-left": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pad-left/-/pad-left-2.1.0.tgz", + "integrity": "sha1-FuajstRKjhOMsIOMx8tAOk/J6ZQ=", + "dev": true, + "requires": { + "repeat-string": "^1.5.4" + } + }, + "pad-right": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/pad-right/-/pad-right-0.2.2.tgz", + "integrity": "sha1-b7ySQEXSRPKiokRQMGDTv8YAl3Q=", + "dev": true, + "requires": { + "repeat-string": "^1.5.2" + } + }, + "pako": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", + "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", + "dev": true + }, + "parents": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", + "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", + "dev": true, + "requires": { + "path-platform": "~0.11.15" + } + }, + "parse-asn1": { + "version": "5.1.1", + "resolved": "http://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", + "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", + "dev": true, + "requires": { + "asn1.js": "^4.0.0", + "browserify-aes": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3" + } + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + } + }, + "parse-ms": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-1.0.1.tgz", + "integrity": "sha1-VjRtR0nXjyNDDKDHE4UK75GqNh0=", + "dev": true + }, + "parseurl": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", + "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=", + "dev": true + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", + "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-platform": { + "version": "0.11.15", + "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", + "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=", + "dev": true + }, + "pbkdf2": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", + "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", + "dev": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "pelo": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/pelo/-/pelo-0.1.0.tgz", + "integrity": "sha512-+oVixa69fxS/X+3s1DaSJVQLG/ukHfjK2pHCmpIgjRChp73lnAfbqOYZ0MEo5C5yVkYeUJSoWAcRK0lx0hvOjQ==" + }, + "pem": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/pem/-/pem-1.13.1.tgz", + "integrity": "sha512-gA/kl8/MWWBaVRRv8M4iRkaJXEbp0L9NyG5ggZlbvQxylZAq5K5wGesAZifs89kwL/m4EGdekXtBMOzXM9rv7w==", + "dev": true, + "requires": { + "es6-promisify": "^6.0.0", + "md5": "^2.2.1", + "os-tmpdir": "^1.0.1", + "which": "^1.3.1" + } + }, + "plur": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/plur/-/plur-1.0.0.tgz", + "integrity": "sha1-24XGgU9eXlo7Se/CjWBP7GKXUVY=", + "dev": true + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, + "prettier-bytes": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prettier-bytes/-/prettier-bytes-1.0.4.tgz", + "integrity": "sha1-mUsCqkb2mcULYle1+qp/4lV+YtY=", + "dev": true + }, + "pretty-ms": { + "version": "2.1.0", + "resolved": "http://registry.npmjs.org/pretty-ms/-/pretty-ms-2.1.0.tgz", + "integrity": "sha1-QlfCVt8/sLRR1q/6qwIYhBJpgdw=", + "dev": true, + "requires": { + "is-finite": "^1.0.1", + "parse-ms": "^1.0.0", + "plur": "^1.0.0" + } + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "query-string": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz", + "integrity": "sha1-u7aTucqRXCMlFbIosaArYJBD2+s=", + "dev": true, + "requires": { + "object-assign": "^4.1.0", + "strict-uri-encode": "^1.0.0" + } + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true + }, + "randomatic": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", + "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", + "dev": true, + "requires": { + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "randombytes": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", + "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", + "dev": true + }, + "read-only-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", + "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", + "dev": true, + "requires": { + "readable-stream": "^2.0.2" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + }, + "dependencies": { + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + } + } + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "^0.1.3" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "reload-css": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/reload-css/-/reload-css-1.0.2.tgz", + "integrity": "sha1-avsRFi4jFP7M2tbcX96CH9cxgzE=", + "dev": true, + "requires": { + "query-string": "^4.2.3" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "resolve": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", + "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", + "dev": true, + "requires": { + "path-parse": "^1.0.5" + } + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "resp-modifier": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/resp-modifier/-/resp-modifier-6.0.2.tgz", + "integrity": "sha1-sSTeXE+6/LpUH0j/pzlw9KpFa08=", + "dev": true, + "requires": { + "debug": "^2.2.0", + "minimatch": "^3.0.2" + } + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "right-now": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/right-now/-/right-now-1.0.0.tgz", + "integrity": "sha1-bolgne69fc2vja7Mmuo5z1haCRg=", + "dev": true + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "dev": true + }, + "send": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", + "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", + "dev": true, + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.6.2", + "mime": "1.4.1", + "ms": "2.0.0", + "on-finished": "~2.3.0", + "range-parser": "~1.2.0", + "statuses": "~1.4.0" + } + }, + "serve-static": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", + "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", + "dev": true, + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.2", + "send": "0.16.2" + } + }, + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", + "dev": true + }, + "sha.js": { + "version": "2.4.11", + "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shasum": { + "version": "1.0.2", + "resolved": "http://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", + "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=", + "dev": true, + "requires": { + "json-stable-stringify": "~0.0.0", + "sha.js": "~2.4.4" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "shell-quote": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", + "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", + "dev": true, + "requires": { + "array-filter": "~0.0.0", + "array-map": "~0.0.0", + "array-reduce": "~0.0.0", + "jsonify": "~0.0.0" + } + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "simple-concat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", + "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=", + "dev": true + }, + "simple-html-index": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/simple-html-index/-/simple-html-index-1.5.0.tgz", + "integrity": "sha1-LJPurrrAAdihNfwAIr1K3o9YmW8=", + "dev": true, + "requires": { + "from2-string": "^1.1.0" + } + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "split2": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/split2/-/split2-0.2.1.tgz", + "integrity": "sha1-At2smtwD7Au3jBKC7Aecpuha6QA=", + "dev": true, + "requires": { + "through2": "~0.6.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "through2": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", + "dev": true, + "requires": { + "readable-stream": ">=1.0.33-1 <1.1.0-0", + "xtend": ">=4.0.0 <4.1.0-0" + } + } + } + }, + "stacked": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stacked/-/stacked-1.1.1.tgz", + "integrity": "sha1-LH+jjMfjejQRp3zY55LeRI+faXU=", + "dev": true + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", + "dev": true + }, + "stdout-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.1.tgz", + "integrity": "sha512-j4emi03KXqJWcIeF8eIXkjMFN1Cmb8gUlDYGeBALLPo5qdyTfA9bOtl8m33lRoC+vFMkP3gl0WsDr6+gzxbbTA==", + "dev": true, + "requires": { + "readable-stream": "^2.0.1" + } + }, + "stream-browserify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", + "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", + "dev": true, + "requires": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "stream-combiner2": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", + "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", + "dev": true, + "requires": { + "duplexer2": "~0.1.0", + "readable-stream": "^2.0.2" + } + }, + "stream-http": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", + "dev": true, + "requires": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "stream-splicer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.0.tgz", + "integrity": "sha1-G2O+Q4oTPktnHMGTUZdgAXWRDYM=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.2" + } + }, + "strict-uri-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + } + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "subarg": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", + "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", + "dev": true, + "requires": { + "minimist": "^1.1.0" + } + }, + "supports-color": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz", + "integrity": "sha1-2S3iaU6z9nMjlz1649i1W0wiGQo=", + "dev": true + }, + "syntax-error": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", + "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==", + "dev": true, + "requires": { + "acorn-node": "^1.2.0" + } + }, + "term-color": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/term-color/-/term-color-1.0.1.tgz", + "integrity": "sha1-OOGSVTpHPjXkFgT/UZmEa/gRejo=", + "dev": true, + "requires": { + "ansi-styles": "2.0.1", + "supports-color": "1.3.1" + }, + "dependencies": { + "ansi-styles": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.0.1.tgz", + "integrity": "sha1-sDP1f5Pi0oreuLwRE4+hPaD9IKM=", + "dev": true + }, + "supports-color": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-1.3.1.tgz", + "integrity": "sha1-FXWN8J2P87SswwdTn6vicJXhBC0=", + "dev": true + } + } + }, + "through": { + "version": "2.3.8", + "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" + } + }, + "timers-browserify": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", + "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", + "dev": true, + "requires": { + "process": "~0.11.0" + } + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + } + } + }, + "tty-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", + "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", + "dev": true + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "ultron": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz", + "integrity": "sha1-rOEWq1V80Zc4ak6I9GhTeMiy5Po=", + "dev": true + }, + "umd": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz", + "integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==", + "dev": true + }, + "undeclared-identifiers": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/undeclared-identifiers/-/undeclared-identifiers-1.1.2.tgz", + "integrity": "sha512-13EaeocO4edF/3JKime9rD7oB6QI8llAGhgn5fKOPyfkJbRb6NFv9pYV6dFEmpa4uRjKeBqLZP8GpuzqHlKDMQ==", + "dev": true, + "requires": { + "acorn-node": "^1.3.0", + "get-assigned-identifiers": "^1.2.0", + "simple-concat": "^1.0.0", + "xtend": "^4.0.1" + } + }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + } + } + } + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "url-trim": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-trim/-/url-trim-1.0.0.tgz", + "integrity": "sha1-QAV+LxZLiOXaynJp2kfm0d2Detw=", + "dev": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "vm-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.0.tgz", + "integrity": "sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw==", + "dev": true + }, + "watchify": { + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/watchify/-/watchify-3.11.0.tgz", + "integrity": "sha512-7jWG0c3cKKm2hKScnSAMUEUjRJKXUShwMPk0ASVhICycQhwND3IMAdhJYmc1mxxKzBUJTSF5HZizfrKrS6BzkA==", + "dev": true, + "requires": { + "anymatch": "^1.3.0", + "browserify": "^16.1.0", + "chokidar": "^1.0.0", + "defined": "^1.0.0", + "outpipe": "^1.1.0", + "through2": "^2.0.0", + "xtend": "^4.0.0" + } + }, + "watchify-middleware": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/watchify-middleware/-/watchify-middleware-1.8.0.tgz", + "integrity": "sha512-INYU5/3zTZtWQvJKPelr47j0JeLTZK4GUDF0PoMltMPzMUEh/lW6g1t+Qe/tGHxm70AUc0NQrth3k3PTfOU9Nw==", + "dev": true, + "requires": { + "concat-stream": "^1.5.0", + "debounce": "^1.0.0", + "events": "^1.0.2", + "object-assign": "^4.0.1", + "strip-ansi": "^3.0.0", + "watchify": "^3.3.1" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "ws": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ws/-/ws-1.1.5.tgz", + "integrity": "sha512-o3KqipXNUdS7wpQzBHSe180lBGO60SoK0yVo3CYJgb2MkobuWuBX6dhkYP5ORCLd55y+SaflMOV5fqAB53ux4w==", + "dev": true, + "requires": { + "options": ">=0.0.5", + "ultron": "1.0.x" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 000000000..a22443734 --- /dev/null +++ b/package.json @@ -0,0 +1,30 @@ +{ + "name": "play-logo", + "version": "4.0.2", + "description": "Play skilltree", + "main": "src/index.js", + "scripts": { + "start": "budo src/index.js:bundle.js --dir ./ --live --open", + "build": "browserify src/index.js > bundle.js" + }, + "repository": { + "type": "git", + "url": "" + }, + "keywords": [ + "cryptolife", + "workshops", + "play", + "skilltree" + ], + "license": "MIT", + "dependencies": { + "@babel/polyfill": "^7.0.0", + "bel": "^6.0.0", + "csjs-inject": "^1.0.1", + "cytoscape": "^3.2.18" + }, + "devDependencies": { + "budo": "^11.5.0" + } +} diff --git a/src/index.js b/src/index.js new file mode 100644 index 000000000..2dedd9bee --- /dev/null +++ b/src/index.js @@ -0,0 +1,147 @@ +var bel = require('bel') +var csjs = require('csjs-inject') +//var cytoscape = require('cytoscape') + +var jsons + +function html () { + var css = csjs` + .cy { + width: 80%; + height: 80%; + position: absolute; + left: 15%; + top: 15%; + z-index: 999; + background-color: grey; + border-radius: 4; + } + .title { + display: flex; + flex-direction: column; + align-items: center; + } + ` + + document.body.innerHTML = `
    ` + var cyDiv = document.body.children[0] + function createCy (cyNodes, cyEdges) { + var cy = window.cy = cytoscape({ + container: cyDiv, + boxSelectionEnabled: false, + autounselectify: true, + layout: { name: 'circle'}, + style: [ + { + selector: 'node', + style: { + 'content': 'data(label)', + 'text-opacity': 0.8, + 'text-valign': 'center', + 'text-halign': 'right', + 'background-color': 'violet', + 'font-size': 30 + } + }, + { + selector: 'edge', + style: { + 'width': 10, + 'target-arrow-shape': 'triangle', + 'line-color': 'black', + 'target-arrow-color': 'violet', + 'curve-style': 'bezier' + } + } + ], + + + elements: { + nodes: cyNodes, + edges: cyEdges + }, + + + }) + cy.on('tap', 'node', selectedNodeHandler) + function selectedNodeHandler(node) { + console.log(node) + window.open('https://ninabreznik.github.io/workshop_app/','_blank') + } + } + + + + var arr = [ + "http://172.31.253.118:9966/json_s/1.json", + "http://172.31.253.118:9966/json_s/2.json", + "http://172.31.253.118:9966/json_s/3.json", + "http://172.31.253.118:9966/json_s/4.json", + "http://172.31.253.118:9966/json_s/5.json", + "http://172.31.253.118:9966/json_s/6.json", + "http://172.31.253.118:9966/json_s/7.json", + "http://172.31.253.118:9966/json_s/8.json", + "http://172.31.253.118:9966/json_s/9.json", + "http://172.31.253.118:9966/json_s/10.json" + ] + + var el = bel` +
    + +
    ${displayDependencies()}
    + ${cyDiv} +
    + ` + + function getNodesAndEdges (arr) { + var all = {} + var cyNodes = [] + var cyEdges = [] + var lenghts = [] + arr.forEach((workshop,id)=>{ + cyNodes.push({ data: { id: 'n'+id, label: workshop.title } }) + all[workshop.url] = `n${id}` + }) + arr.forEach((workshop,id)=> { + generateEdges(workshop, id, cyEdges, all) + }) + createCy(cyNodes, cyEdges) + } + + function generateEdges(workshop, id, edges, all) { + var requirements = workshop.needs + requirements.forEach((url,i) => { + edges.push({ data: { source: all[url], target: 'n'+id } }) + }) + } + + function displayDependencies () { + getData((err,data) => { + if (err) { console.log(err) } + else { + getNodesAndEdges(data) + } + }) + } + + function getData (next) { + var promises = arr.map(fetchJson) + Promise.all(promises).then(result => { + next(null, result) + }) + } + + async function fetchJson (url) { + var response = await fetch(url) + var result = await response.json() + result.url = url + return result + } + + document.body.appendChild(el) +} + +html() From 8d09f5779b0507a13bccc6b7292f7002dc9f61bb Mon Sep 17 00:00:00 2001 From: Nina Breznik Date: Sun, 28 Oct 2018 12:00:50 +0100 Subject: [PATCH 2/9] Create README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 000000000..a65aea29b --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# Team Play + +## Resources +* https://ninabreznik.github.io/workshop_app/ +* https://github.com/ninabreznik/workshop_app/ +* [Work in progress - Solidity workshop](https://github.com/grdddj/My-codebase/tree/master/Hackathon%20Prague%2026.-28.%2010.%202018) +* [Many workshop repositories](https://github.com/ffakk?tab=repositories) +* [Workshop module](https://github.com/wizardamigos/wizardamigos-workshop) From 48ea4aa6c5ce3ed5bcc8e36bdc8980fc14933989 Mon Sep 17 00:00:00 2001 From: Nina Breznik Date: Sun, 28 Oct 2018 12:05:34 +0100 Subject: [PATCH 3/9] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index a65aea29b..9779905d9 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,12 @@ # Team Play +[Github page from 'earn while you learn' project/skilltree](https://ninabreznik.github.io/CryptoLife/) + ## Resources * https://ninabreznik.github.io/workshop_app/ * https://github.com/ninabreznik/workshop_app/ * [Work in progress - Solidity workshop](https://github.com/grdddj/My-codebase/tree/master/Hackathon%20Prague%2026.-28.%2010.%202018) * [Many workshop repositories](https://github.com/ffakk?tab=repositories) * [Workshop module](https://github.com/wizardamigos/wizardamigos-workshop) +* [More learning resources for JS topic](https://github.com/wizardamigos/skilltree) + From e0a5a64a975ded54b3f93996db3ada0666e6b363 Mon Sep 17 00:00:00 2001 From: ninabreznik Date: Sun, 28 Oct 2018 12:06:08 +0100 Subject: [PATCH 4/9] Build --- bundle.js | 147 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 144 insertions(+), 3 deletions(-) diff --git a/bundle.js b/bundle.js index 6fa6f8dd3..4e52f4e41 100644 --- a/bundle.js +++ b/bundle.js @@ -1071,10 +1071,151 @@ module.exports = function (css, options) { },{}],25:[function(require,module,exports){ var bel = require('bel') -var css = require('csjs-inject') +var csjs = require('csjs-inject') +//var cytoscape = require('cytoscape') + +var jsons + +function html () { + var css = csjs` + .cy { + width: 80%; + height: 80%; + position: absolute; + left: 15%; + top: 15%; + z-index: 999; + background-color: grey; + border-radius: 4; + } + .title { + display: flex; + flex-direction: column; + align-items: center; + } + ` + + document.body.innerHTML = `
    ` + var cyDiv = document.body.children[0] + function createCy (cyNodes, cyEdges) { + var cy = window.cy = cytoscape({ + container: cyDiv, + boxSelectionEnabled: false, + autounselectify: true, + layout: { name: 'circle'}, + style: [ + { + selector: 'node', + style: { + 'content': 'data(label)', + 'text-opacity': 0.8, + 'text-valign': 'center', + 'text-halign': 'right', + 'background-color': 'violet', + 'font-size': 30 + } + }, + { + selector: 'edge', + style: { + 'width': 10, + 'target-arrow-shape': 'triangle', + 'line-color': 'black', + 'target-arrow-color': 'violet', + 'curve-style': 'bezier' + } + } + ], + + + elements: { + nodes: cyNodes, + edges: cyEdges + }, + + + }) + cy.on('tap', 'node', selectedNodeHandler) + function selectedNodeHandler(node) { + console.log(node) + window.open('https://ninabreznik.github.io/workshop_app/','_blank') + } + } + -var el = bel`
    Hello world
    ` -document.body.appendChild(el) + var arr = [ + "http://172.31.253.118:9966/json_s/1.json", + "http://172.31.253.118:9966/json_s/2.json", + "http://172.31.253.118:9966/json_s/3.json", + "http://172.31.253.118:9966/json_s/4.json", + "http://172.31.253.118:9966/json_s/5.json", + "http://172.31.253.118:9966/json_s/6.json", + "http://172.31.253.118:9966/json_s/7.json", + "http://172.31.253.118:9966/json_s/8.json", + "http://172.31.253.118:9966/json_s/9.json", + "http://172.31.253.118:9966/json_s/10.json" + ] + + var el = bel` +
    +
    +

    Skilltree

    +

    inspired by Dungeons and developers

    +
    +
    ${displayDependencies()}
    + ${cyDiv} +
    + ` + + function getNodesAndEdges (arr) { + var all = {} + var cyNodes = [] + var cyEdges = [] + var lenghts = [] + arr.forEach((workshop,id)=>{ + cyNodes.push({ data: { id: 'n'+id, label: workshop.title } }) + all[workshop.url] = `n${id}` + }) + arr.forEach((workshop,id)=> { + generateEdges(workshop, id, cyEdges, all) + }) + createCy(cyNodes, cyEdges) + } + + function generateEdges(workshop, id, edges, all) { + var requirements = workshop.needs + requirements.forEach((url,i) => { + edges.push({ data: { source: all[url], target: 'n'+id } }) + }) + } + + function displayDependencies () { + getData((err,data) => { + if (err) { console.log(err) } + else { + getNodesAndEdges(data) + } + }) + } + + function getData (next) { + var promises = arr.map(fetchJson) + Promise.all(promises).then(result => { + next(null, result) + }) + } + + async function fetchJson (url) { + var response = await fetch(url) + var result = await response.json() + result.url = url + return result + } + + document.body.appendChild(el) +} + +html() },{"bel":2,"csjs-inject":5}]},{},[25]); From eec0e8af080ef6c3f7a92a56113d448bd41bb118 Mon Sep 17 00:00:00 2001 From: ninabreznik Date: Sun, 28 Oct 2018 12:08:46 +0100 Subject: [PATCH 5/9] Remove node modules --- node_modules/.bin/JSONStream | 1 - node_modules/.bin/acorn | 1 - node_modules/.bin/atob | 1 - node_modules/.bin/browser-pack | 1 - node_modules/.bin/browserify | 1 - node_modules/.bin/budo | 1 - node_modules/.bin/deps-sort | 1 - node_modules/.bin/detective | 1 - node_modules/.bin/garnish | 1 - node_modules/.bin/has-ansi | 1 - node_modules/.bin/insert-module-globals | 1 - node_modules/.bin/miller-rabin | 1 - node_modules/.bin/mime | 1 - node_modules/.bin/mkdirp | 1 - node_modules/.bin/module-deps | 1 - node_modules/.bin/semver | 1 - node_modules/.bin/sha.js | 1 - node_modules/.bin/supports-color | 1 - node_modules/.bin/umd | 1 - node_modules/.bin/undeclared-identifiers | 1 - node_modules/.bin/watchify | 1 - node_modules/.bin/which | 1 - node_modules/@babel/polyfill/LICENSE | 22 - node_modules/@babel/polyfill/README.md | 19 - node_modules/@babel/polyfill/browser.js | 3 - node_modules/@babel/polyfill/dist/polyfill.js | 6568 ---- .../@babel/polyfill/dist/polyfill.min.js | 3 - node_modules/@babel/polyfill/lib/index.js | 29 - .../@babel/polyfill/lib/noConflict.js | 23 - node_modules/@babel/polyfill/noConflict.js | 1 - node_modules/@babel/polyfill/package.json | 47 - .../@babel/polyfill/scripts/build-dist.sh | 17 - .../@babel/polyfill/scripts/postpublish.js | 8 - .../@babel/polyfill/scripts/prepublish.js | 13 - node_modules/JSONStream/.travis.yml | 8 - node_modules/JSONStream/LICENSE.APACHE2 | 15 - node_modules/JSONStream/LICENSE.MIT | 24 - node_modules/JSONStream/bin.js | 12 - node_modules/JSONStream/examples/all_docs.js | 13 - node_modules/JSONStream/index.js | 247 - node_modules/JSONStream/package.json | 78 - node_modules/JSONStream/readme.markdown | 207 - node_modules/JSONStream/test/bool.js | 41 - node_modules/JSONStream/test/browser.js | 18 - .../JSONStream/test/destroy_missing.js | 27 - node_modules/JSONStream/test/doubledot1.js | 29 - node_modules/JSONStream/test/doubledot2.js | 30 - node_modules/JSONStream/test/empty.js | 44 - .../JSONStream/test/error_contents.js | 45 - .../JSONStream/test/fixtures/all_npm.json | 4030 --- .../test/fixtures/couch_sample.json | 18 - .../JSONStream/test/fixtures/depth.json | 15 - .../JSONStream/test/fixtures/error.json | 1 - .../test/fixtures/header_footer.json | 19 - node_modules/JSONStream/test/fn.js | 39 - node_modules/JSONStream/test/gen.js | 135 - node_modules/JSONStream/test/header_footer.js | 55 - node_modules/JSONStream/test/issues.js | 34 - node_modules/JSONStream/test/keys.js | 105 - node_modules/JSONStream/test/map.js | 40 - .../JSONStream/test/multiple_objects.js | 36 - .../JSONStream/test/multiple_objects_error.js | 29 - node_modules/JSONStream/test/null.js | 28 - node_modules/JSONStream/test/parsejson.js | 29 - node_modules/JSONStream/test/run.js | 13 - node_modules/JSONStream/test/stringify.js | 41 - .../JSONStream/test/stringify_object.js | 47 - node_modules/JSONStream/test/test.js | 35 - node_modules/JSONStream/test/test2.js | 29 - node_modules/JSONStream/test/two-ways.js | 41 - .../acorn-dynamic-import/CHANGELOG.md | 28 - node_modules/acorn-dynamic-import/LICENSE | 21 - node_modules/acorn-dynamic-import/README.md | 29 - .../acorn-dynamic-import/lib/index.js | 84 - node_modules/acorn-dynamic-import/lib/walk.js | 16 - .../acorn-dynamic-import/package.json | 78 - .../acorn-dynamic-import/src/index.js | 38 - node_modules/acorn-dynamic-import/src/walk.js | 9 - node_modules/acorn-node/.travis.yml | 21 - node_modules/acorn-node/CHANGELOG.md | 59 - node_modules/acorn-node/LICENSE.md | 95 - node_modules/acorn-node/README.md | 51 - node_modules/acorn-node/build.js | 21 - node_modules/acorn-node/index.js | 34 - node_modules/acorn-node/lib/bigint/index.js | 65 - .../acorn-node/lib/import-meta/index.js | 58 - node_modules/acorn-node/package.json | 77 - node_modules/acorn-node/test/index.js | 112 - node_modules/acorn-node/walk.js | 58 - node_modules/acorn-walk/CHANGELOG.md | 97 - node_modules/acorn-walk/LICENSE | 19 - node_modules/acorn-walk/README.md | 126 - node_modules/acorn-walk/dist/walk.es.js | 436 - node_modules/acorn-walk/dist/walk.es.js.map | 1 - node_modules/acorn-walk/dist/walk.js | 456 - node_modules/acorn-walk/dist/walk.js.map | 1 - node_modules/acorn-walk/package.json | 63 - node_modules/acorn/CHANGELOG.md | 438 - node_modules/acorn/LICENSE | 19 - node_modules/acorn/README.md | 269 - node_modules/acorn/bin/acorn | 4 - node_modules/acorn/dist/acorn.d.ts | 208 - node_modules/acorn/dist/acorn.js | 5314 --- node_modules/acorn/dist/acorn.js.map | 1 - node_modules/acorn/dist/acorn.mjs | 5283 --- node_modules/acorn/dist/acorn.mjs.map | 1 - node_modules/acorn/dist/bin.js | 68 - node_modules/acorn/package.json | 66 - node_modules/ansi-regex/index.js | 4 - node_modules/ansi-regex/package.json | 84 - node_modules/ansi-regex/readme.md | 33 - node_modules/ansi-styles/index.js | 40 - node_modules/ansi-styles/package.json | 78 - node_modules/ansi-styles/readme.md | 70 - node_modules/anymatch/LICENSE | 15 - node_modules/anymatch/README.md | 98 - node_modules/anymatch/index.js | 67 - node_modules/anymatch/package.json | 73 - node_modules/arr-diff/LICENSE | 21 - node_modules/arr-diff/README.md | 74 - node_modules/arr-diff/index.js | 58 - node_modules/arr-diff/package.json | 80 - node_modules/arr-flatten/LICENSE | 21 - node_modules/arr-flatten/README.md | 86 - node_modules/arr-flatten/index.js | 22 - node_modules/arr-flatten/package.json | 114 - node_modules/arr-union/LICENSE | 21 - node_modules/arr-union/README.md | 99 - node_modules/arr-union/index.js | 29 - node_modules/arr-union/package.json | 108 - node_modules/array-filter/.npmignore | 1 - node_modules/array-filter/.travis.yml | 4 - node_modules/array-filter/README.md | 54 - node_modules/array-filter/index.js | 19 - node_modules/array-filter/package.json | 75 - node_modules/array-filter/test/filter.js | 12 - node_modules/array-filter/test/holes.js | 12 - node_modules/array-map/.travis.yml | 4 - node_modules/array-map/LICENSE | 18 - node_modules/array-map/example/map.js | 5 - node_modules/array-map/index.js | 11 - node_modules/array-map/package.json | 77 - node_modules/array-map/readme.markdown | 46 - node_modules/array-map/test/map.js | 77 - node_modules/array-reduce/.travis.yml | 4 - node_modules/array-reduce/LICENSE | 18 - node_modules/array-reduce/example/sum.js | 4 - node_modules/array-reduce/index.js | 18 - node_modules/array-reduce/package.json | 76 - node_modules/array-reduce/readme.markdown | 46 - node_modules/array-reduce/test/reduce.js | 85 - node_modules/array-unique/LICENSE | 21 - node_modules/array-unique/README.md | 51 - node_modules/array-unique/index.js | 28 - node_modules/array-unique/package.json | 62 - node_modules/asn1.js/README.md | 100 - node_modules/asn1.js/lib/asn1.js | 9 - node_modules/asn1.js/lib/asn1/api.js | 61 - node_modules/asn1.js/lib/asn1/base/buffer.js | 116 - node_modules/asn1.js/lib/asn1/base/index.js | 6 - node_modules/asn1.js/lib/asn1/base/node.js | 634 - .../asn1.js/lib/asn1/base/reporter.js | 121 - .../asn1.js/lib/asn1/constants/der.js | 42 - .../asn1.js/lib/asn1/constants/index.js | 19 - node_modules/asn1.js/lib/asn1/decoders/der.js | 324 - .../asn1.js/lib/asn1/decoders/index.js | 4 - node_modules/asn1.js/lib/asn1/decoders/pem.js | 49 - node_modules/asn1.js/lib/asn1/encoders/der.js | 295 - .../asn1.js/lib/asn1/encoders/index.js | 4 - node_modules/asn1.js/lib/asn1/encoders/pem.js | 21 - node_modules/asn1.js/package.json | 58 - node_modules/assert/.npmignore | 1 - node_modules/assert/.travis.yml | 31 - node_modules/assert/.zuul.yml | 13 - node_modules/assert/LICENSE | 18 - node_modules/assert/README.md | 64 - node_modules/assert/assert.js | 490 - .../assert/node_modules/inherits/LICENSE | 16 - .../assert/node_modules/inherits/README.md | 42 - .../assert/node_modules/inherits/inherits.js | 1 - .../node_modules/inherits/inherits_browser.js | 23 - .../assert/node_modules/inherits/package.json | 54 - .../assert/node_modules/inherits/test.js | 25 - .../assert/node_modules/util/.npmignore | 1 - .../assert/node_modules/util/.travis.yml | 8 - .../assert/node_modules/util/.zuul.yml | 10 - node_modules/assert/node_modules/util/LICENSE | 18 - .../assert/node_modules/util/README.md | 15 - .../assert/node_modules/util/package.json | 59 - .../node_modules/util/support/isBuffer.js | 3 - .../util/support/isBufferBrowser.js | 6 - .../node_modules/util/test/browser/inspect.js | 41 - .../node_modules/util/test/browser/is.js | 91 - .../node_modules/util/test/node/debug.js | 86 - .../node_modules/util/test/node/format.js | 77 - .../node_modules/util/test/node/inspect.js | 195 - .../assert/node_modules/util/test/node/log.js | 58 - .../node_modules/util/test/node/util.js | 83 - node_modules/assert/node_modules/util/util.js | 586 - node_modules/assert/package.json | 58 - node_modules/assert/test.js | 345 - node_modules/assign-symbols/LICENSE | 21 - node_modules/assign-symbols/README.md | 73 - node_modules/assign-symbols/index.js | 40 - node_modules/assign-symbols/package.json | 71 - node_modules/async-each/.npmignore | 3 - node_modules/async-each/CHANGELOG.md | 23 - node_modules/async-each/README.md | 38 - node_modules/async-each/index.js | 38 - node_modules/async-each/package.json | 60 - node_modules/atob/LICENSE | 230 - node_modules/atob/LICENSE.DOCS | 319 - node_modules/atob/README.md | 49 - node_modules/atob/bin/atob.js | 6 - node_modules/atob/bower.json | 24 - node_modules/atob/browser-atob.js | 44 - node_modules/atob/node-atob.js | 7 - node_modules/atob/package.json | 53 - node_modules/atob/test.js | 18 - node_modules/balanced-match/.npmignore | 5 - node_modules/balanced-match/LICENSE.md | 21 - node_modules/balanced-match/README.md | 91 - node_modules/balanced-match/index.js | 59 - node_modules/balanced-match/package.json | 77 - node_modules/base/LICENSE | 21 - node_modules/base/README.md | 491 - node_modules/base/index.js | 435 - .../base/node_modules/define-property/LICENSE | 21 - .../node_modules/define-property/README.md | 95 - .../node_modules/define-property/index.js | 31 - .../node_modules/define-property/package.json | 93 - .../is-accessor-descriptor/LICENSE | 21 - .../is-accessor-descriptor/README.md | 144 - .../is-accessor-descriptor/index.js | 69 - .../is-accessor-descriptor/package.json | 110 - .../node_modules/is-data-descriptor/LICENSE | 21 - .../node_modules/is-data-descriptor/README.md | 161 - .../node_modules/is-data-descriptor/index.js | 49 - .../is-data-descriptor/package.json | 109 - .../base/node_modules/is-descriptor/LICENSE | 21 - .../base/node_modules/is-descriptor/README.md | 193 - .../base/node_modules/is-descriptor/index.js | 22 - .../node_modules/is-descriptor/package.json | 114 - .../base/node_modules/isobject/LICENSE | 21 - .../base/node_modules/isobject/README.md | 122 - .../base/node_modules/isobject/index.d.ts | 5 - .../base/node_modules/isobject/index.js | 12 - .../base/node_modules/isobject/package.json | 119 - .../base/node_modules/kind-of/CHANGELOG.md | 157 - .../base/node_modules/kind-of/LICENSE | 21 - .../base/node_modules/kind-of/README.md | 365 - .../base/node_modules/kind-of/index.js | 129 - .../base/node_modules/kind-of/package.json | 145 - node_modules/base/package.json | 162 - node_modules/base64-js/LICENSE | 21 - node_modules/base64-js/README.md | 34 - node_modules/base64-js/base64js.min.js | 1 - node_modules/base64-js/index.js | 151 - node_modules/base64-js/package.json | 65 - node_modules/base64-js/test/big-data.js | 25 - node_modules/base64-js/test/convert.js | 88 - node_modules/base64-js/test/corrupt.js | 10 - node_modules/base64-js/test/url-safe.js | 24 - node_modules/bel/.travis.yml | 5 - node_modules/bel/README.md | 186 - node_modules/bel/appendChild.js | 131 - node_modules/bel/bel.d.ts | 4 - node_modules/bel/bench/bench.js | 11 - node_modules/bel/bench/create-trees.js | 53 - node_modules/bel/bench/index.js | 1 - node_modules/bel/browser.js | 99 - node_modules/bel/index.js | 5 - node_modules/bel/package.json | 73 - node_modules/bel/raw.js | 25 - node_modules/bel/test/api.js | 36 - node_modules/bel/test/elements.js | 182 - node_modules/bel/test/events.js | 551 - node_modules/bel/test/index.js | 4 - node_modules/bel/test/raw.js | 13 - node_modules/bel/test/server.js | 54 - .../binary-extensions/binary-extensions.json | 250 - node_modules/binary-extensions/license | 9 - node_modules/binary-extensions/package.json | 68 - node_modules/binary-extensions/readme.md | 33 - node_modules/bn.js/.npmignore | 8 - node_modules/bn.js/README.md | 221 - node_modules/bn.js/lib/bn.js | 3427 -- node_modules/bn.js/package.json | 71 - node_modules/bn.js/util/genCombMulTo.js | 65 - node_modules/bn.js/util/genCombMulTo10.js | 65 - node_modules/bole/.jshintrc | 59 - node_modules/bole/.npmignore | 1 - node_modules/bole/LICENSE.md | 11 - node_modules/bole/README.md | 126 - node_modules/bole/bole.js | 126 - node_modules/bole/package.json | 63 - node_modules/bole/test.js | 451 - node_modules/brace-expansion/LICENSE | 21 - node_modules/brace-expansion/README.md | 129 - node_modules/brace-expansion/index.js | 201 - node_modules/brace-expansion/package.json | 75 - node_modules/braces/LICENSE | 21 - node_modules/braces/README.md | 248 - node_modules/braces/index.js | 399 - node_modules/braces/package.json | 114 - node_modules/brorand/.npmignore | 2 - node_modules/brorand/README.md | 26 - node_modules/brorand/index.js | 65 - node_modules/brorand/package.json | 60 - node_modules/brorand/test/api-test.js | 8 - node_modules/browser-pack/.travis.yml | 9 - node_modules/browser-pack/CHANGELOG.md | 10 - node_modules/browser-pack/LICENSE | 18 - node_modules/browser-pack/_prelude.js | 1 - node_modules/browser-pack/bin/cmd.js | 4 - node_modules/browser-pack/bin/prepublish.js | 21 - node_modules/browser-pack/example/input.json | 13 - node_modules/browser-pack/example/output.js | 1 - .../browser-pack/example/sourcemap/input.json | 15 - .../browser-pack/example/sourcemap/output.js | 6 - node_modules/browser-pack/index.js | 127 - node_modules/browser-pack/package.json | 91 - node_modules/browser-pack/prelude.js | 50 - node_modules/browser-pack/readme.markdown | 97 - node_modules/browser-pack/test/comment.js | 33 - node_modules/browser-pack/test/empty.js | 33 - node_modules/browser-pack/test/not_found.js | 34 - .../browser-pack/test/only_execute_entries.js | 26 - node_modules/browser-pack/test/order.js | 38 - node_modules/browser-pack/test/pack.js | 28 - node_modules/browser-pack/test/raw.js | 32 - .../browser-pack/test/source-maps-existing.js | 59 - node_modules/browser-pack/test/source-maps.js | 221 - node_modules/browser-pack/test/this.js | 24 - node_modules/browser-pack/test/unicode.js | 32 - node_modules/browser-resolve/LICENSE | 21 - node_modules/browser-resolve/README.md | 146 - node_modules/browser-resolve/empty.js | 0 node_modules/browser-resolve/index.js | 345 - .../node_modules/resolve/.travis.yml | 4 - .../node_modules/resolve/LICENSE | 18 - .../node_modules/resolve/example/async.js | 5 - .../node_modules/resolve/example/sync.js | 3 - .../node_modules/resolve/index.js | 5 - .../node_modules/resolve/lib/async.js | 192 - .../node_modules/resolve/lib/caller.js | 8 - .../node_modules/resolve/lib/core.js | 4 - .../node_modules/resolve/lib/core.json | 38 - .../resolve/lib/node-modules-paths.js | 38 - .../node_modules/resolve/lib/sync.js | 81 - .../node_modules/resolve/package.json | 58 - .../node_modules/resolve/readme.markdown | 148 - .../node_modules/resolve/test/core.js | 12 - .../node_modules/resolve/test/dotdot.js | 29 - .../resolve/test/dotdot/abc/index.js | 2 - .../node_modules/resolve/test/dotdot/index.js | 1 - .../resolve/test/faulty_basedir.js | 17 - .../node_modules/resolve/test/filter.js | 18 - .../node_modules/resolve/test/filter_sync.js | 15 - .../node_modules/resolve/test/mock.js | 142 - .../node_modules/resolve/test/mock_sync.js | 68 - .../node_modules/resolve/test/module_dir.js | 56 - .../test/module_dir/xmodules/aaa/index.js | 1 - .../test/module_dir/ymodules/aaa/index.js | 1 - .../test/module_dir/zmodules/bbb/main.js | 1 - .../test/module_dir/zmodules/bbb/package.json | 3 - .../node_modules/resolve/test/node_path.js | 48 - .../resolve/test/node_path/x/aaa/index.js | 1 - .../resolve/test/node_path/x/ccc/index.js | 1 - .../resolve/test/node_path/y/bbb/index.js | 1 - .../resolve/test/node_path/y/ccc/index.js | 1 - .../node_modules/resolve/test/nonstring.js | 9 - .../node_modules/resolve/test/pathfilter.js | 35 - .../resolve/test/pathfilter/deep_ref/main.js | 0 .../deep_ref/node_modules/deep/alt.js | 0 .../deep_ref/node_modules/deep/deeper/ref.js | 0 .../deep_ref/node_modules/deep/package.json | 4 - .../deep_ref/node_modules/deep/ref.js | 0 .../node_modules/resolve/test/precedence.js | 23 - .../resolve/test/precedence/aaa.js | 1 - .../resolve/test/precedence/aaa/index.js | 1 - .../resolve/test/precedence/aaa/main.js | 1 - .../resolve/test/precedence/bbb.js | 1 - .../resolve/test/precedence/bbb/main.js | 1 - .../node_modules/resolve/test/resolver.js | 281 - .../resolver/bar/node_modules/foo/index.js | 1 - .../resolve/test/resolver/baz/doom.js | 0 .../resolve/test/resolver/baz/package.json | 3 - .../resolve/test/resolver/baz/quux.js | 1 - .../biz/node_modules/garply/lib/index.js | 1 - .../biz/node_modules/garply/package.json | 3 - .../resolver/biz/node_modules/grux/index.js | 1 - .../resolver/biz/node_modules/tiv/index.js | 1 - .../resolve/test/resolver/cup.coffee | 1 - .../node_modules/resolve/test/resolver/foo.js | 1 - .../test/resolver/incorrect_main/index.js | 2 - .../test/resolver/incorrect_main/package.json | 3 - .../resolve/test/resolver/mug.coffee | 0 .../node_modules/resolve/test/resolver/mug.js | 0 .../test/resolver/other_path/lib/other-lib.js | 0 .../resolve/test/resolver/other_path/root.js | 0 .../punycode/node_modules/punycode/index.js | 0 .../resolve/test/resolver/quux/foo/index.js | 1 - .../test/resolver/without_basedir/main.js | 6 - .../without_basedir/node_modules/mymodule.js | 1 - .../resolve/test/resolver_sync.js | 180 - .../node_modules/resolve/test/subdirs.js | 13 - .../test/subdirs/node_modules/a/b/c/x.json | 1 - .../test/subdirs/node_modules/a/package.json | 1 - node_modules/browser-resolve/package.json | 62 - node_modules/browserify-aes/.travis.yml | 15 - node_modules/browserify-aes/LICENSE | 21 - node_modules/browserify-aes/README.md | 19 - node_modules/browserify-aes/aes.js | 228 - node_modules/browserify-aes/authCipher.js | 117 - node_modules/browserify-aes/browser.js | 13 - node_modules/browserify-aes/decrypter.js | 124 - node_modules/browserify-aes/encrypter.js | 114 - node_modules/browserify-aes/ghash.js | 89 - node_modules/browserify-aes/incr32.js | 15 - node_modules/browserify-aes/index.js | 7 - node_modules/browserify-aes/modes/cbc.js | 17 - node_modules/browserify-aes/modes/cfb.js | 33 - node_modules/browserify-aes/modes/cfb1.js | 42 - node_modules/browserify-aes/modes/cfb8.js | 25 - node_modules/browserify-aes/modes/ctr.js | 30 - node_modules/browserify-aes/modes/ecb.js | 7 - node_modules/browserify-aes/modes/index.js | 18 - node_modules/browserify-aes/modes/list.json | 191 - node_modules/browserify-aes/modes/ofb.js | 16 - node_modules/browserify-aes/package.json | 69 - node_modules/browserify-aes/streamCipher.js | 27 - node_modules/browserify-cipher/.travis.yml | 14 - node_modules/browserify-cipher/LICENSE | 21 - node_modules/browserify-cipher/README.md | 7 - node_modules/browserify-cipher/browser.js | 67 - node_modules/browserify-cipher/index.js | 7 - node_modules/browserify-cipher/package.json | 58 - node_modules/browserify-cipher/test.js | 55 - node_modules/browserify-des/.travis.yml | 8 - node_modules/browserify-des/index.js | 50 - node_modules/browserify-des/license | 21 - node_modules/browserify-des/modes.js | 24 - node_modules/browserify-des/package.json | 58 - node_modules/browserify-des/readme.md | 6 - node_modules/browserify-des/test.js | 81 - node_modules/browserify-rsa/.travis.yml | 3 - node_modules/browserify-rsa/LICENSE | 21 - node_modules/browserify-rsa/index.js | 40 - node_modules/browserify-rsa/package.json | 54 - node_modules/browserify-rsa/readme.md | 10 - node_modules/browserify-rsa/test.js | 53 - node_modules/browserify-sign/LICENSE | 13 - node_modules/browserify-sign/README.md | 13 - node_modules/browserify-sign/algos.js | 1 - .../browserify-sign/browser/algorithms.json | 152 - .../browserify-sign/browser/curves.json | 8 - node_modules/browserify-sign/browser/index.js | 91 - node_modules/browserify-sign/browser/sign.js | 145 - .../browserify-sign/browser/verify.js | 83 - node_modules/browserify-sign/index.js | 7 - node_modules/browserify-sign/package.json | 66 - node_modules/browserify-zlib/.npmignore | 7 - node_modules/browserify-zlib/.travis.yml | 16 - node_modules/browserify-zlib/LICENSE | 70 - node_modules/browserify-zlib/README.md | 24 - node_modules/browserify-zlib/karma.conf.js | 11 - node_modules/browserify-zlib/lib/binding.js | 409 - node_modules/browserify-zlib/lib/index.js | 609 - node_modules/browserify-zlib/package.json | 92 - node_modules/browserify-zlib/src/binding.js | 432 - node_modules/browserify-zlib/src/index.js | 650 - node_modules/browserify-zlib/yarn.lock | 3819 -- node_modules/browserify/.travis.yml | 23 - node_modules/browserify/LICENSE | 84 - node_modules/browserify/appveyor.yml | 27 - node_modules/browserify/assets/browserify.png | Bin 61391 -> 0 bytes node_modules/browserify/assets/logo.png | Bin 31422 -> 0 bytes node_modules/browserify/bin/advanced.txt | 117 - node_modules/browserify/bin/args.js | 260 - node_modules/browserify/bin/cmd.js | 91 - node_modules/browserify/bin/usage.txt | 34 - node_modules/browserify/changelog.markdown | 1339 - node_modules/browserify/code-of-conduct.md | 78 - .../browserify/example/api/browser/bar.js | 1 - .../browserify/example/api/browser/foo.js | 5 - .../browserify/example/api/browser/main.js | 2 - node_modules/browserify/example/api/build.js | 4 - .../example/multiple_bundles/beep.js | 2 - .../example/multiple_bundles/boop.js | 2 - .../example/multiple_bundles/build.sh | 4 - .../example/multiple_bundles/robot.js | 1 - .../example/multiple_bundles/static/beep.html | 2 - .../example/multiple_bundles/static/boop.html | 2 - .../browserify/example/source_maps/build.js | 13 - .../browserify/example/source_maps/build.sh | 4 - .../browserify/example/source_maps/index.html | 11 - .../example/source_maps/js/build/.npmignore | 1 - .../example/source_maps/js/build/bundle.js | 28 - .../browserify/example/source_maps/js/foo.js | 7 - .../browserify/example/source_maps/js/main.js | 4 - .../example/source_maps/js/wunder/bar.js | 8 - node_modules/browserify/index.js | 859 - node_modules/browserify/lib/_empty.js | 0 node_modules/browserify/lib/builtins.js | 40 - .../node_modules/events/.travis.yml | 11 - .../browserify/node_modules/events/.zuul.yml | 13 - .../browserify/node_modules/events/History.md | 58 - .../browserify/node_modules/events/LICENSE | 22 - .../browserify/node_modules/events/Readme.md | 21 - .../browserify/node_modules/events/events.js | 523 - .../node_modules/events/package.json | 66 - .../events/tests/add-listeners.js | 111 - .../events/tests/check-listener-leaks.js | 93 - .../node_modules/events/tests/common.js | 103 - .../node_modules/events/tests/index.js | 25 - .../events/tests/legacy-compat.js | 16 - .../events/tests/listener-count.js | 37 - .../events/tests/listeners-side-effects.js | 57 - .../node_modules/events/tests/listeners.js | 149 - .../events/tests/max-listeners.js | 47 - .../events/tests/modify-in-emit.js | 90 - .../node_modules/events/tests/num-args.js | 69 - .../node_modules/events/tests/once.js | 83 - .../events/tests/remove-all-listeners.js | 139 - .../events/tests/remove-listeners.js | 212 - .../tests/set-max-listeners-side-effects.js | 32 - .../node_modules/events/tests/subclass.js | 73 - node_modules/browserify/package.json | 129 - node_modules/browserify/readme.markdown | 829 - node_modules/browserify/test/args.js | 72 - node_modules/browserify/test/array.js | 74 - node_modules/browserify/test/array/one.js | 1 - node_modules/browserify/test/array/three.js | 1 - node_modules/browserify/test/array/two.js | 1 - node_modules/browserify/test/async.js | 24 - node_modules/browserify/test/async/src.js | 8 - node_modules/browserify/test/backbone.js | 23 - node_modules/browserify/test/bare.js | 173 - .../browserify/test/bare/dirname-filename.js | 4 - node_modules/browserify/test/bare/main.js | 7 - node_modules/browserify/test/bare_shebang.js | 37 - node_modules/browserify/test/bin.js | 31 - node_modules/browserify/test/bin_entry.js | 31 - node_modules/browserify/test/bin_tr_error.js | 27 - .../browserify/test/bin_tr_error/main.js | 1 - .../browserify/test/bin_tr_error/tr.js | 12 - node_modules/browserify/test/bom.js | 19 - node_modules/browserify/test/bom/hello.js | 1 - .../browserify/test/browser_field_file.js | 13 - .../test/browser_field_file/package.json | 5 - .../browserify/test/browser_field_file/wow.js | 1 - .../browserify/test/browser_field_resolve.js | 124 - .../test/browser_field_resolve/a/main.js | 1 - .../a/node_modules/aaa/main.js | 1 - .../a/node_modules/aaa/package.json | 3 - .../test/browser_field_resolve/a/package.json | 5 - .../test/browser_field_resolve/b/main.js | 1 - .../test/browser_field_resolve/b/package.json | 5 - .../test/browser_field_resolve/b/x.js | 1 - .../test/browser_field_resolve/c/main.js | 1 - .../test/browser_field_resolve/c/package.json | 5 - .../test/browser_field_resolve/c/x.js | 1 - .../test/browser_field_resolve/d/main.js | 1 - .../test/browser_field_resolve/d/package.json | 5 - .../test/browser_field_resolve/d/x.js | 1 - .../test/browser_field_resolve/e/main.js | 1 - .../test/browser_field_resolve/e/package.json | 5 - .../test/browser_field_resolve/e/x.js | 1 - .../test/browser_field_resolve/f/main.js | 1 - .../test/browser_field_resolve/f/package.json | 5 - .../test/browser_field_resolve/f/x.js | 1 - .../test/browser_field_resolve/g/main.js | 2 - .../test/browser_field_resolve/g/package.json | 5 - .../test/browser_field_resolve/g/x.js | 1 - .../test/browser_field_resolve/h/main.js | 2 - .../test/browser_field_resolve/h/package.json | 5 - .../test/browser_field_resolve/h/x.js | 1 - .../test/browser_field_resolve/i/browser.js | 1 - .../test/browser_field_resolve/i/main.js | 2 - .../test/browser_field_resolve/i/package.json | 5 - .../test/browser_field_resolve/i/x.js | 1 - .../test/browser_field_resolve/j/browser.js | 1 - .../test/browser_field_resolve/j/main.js | 2 - .../test/browser_field_resolve/j/package.json | 5 - .../test/browser_field_resolve/j/x.js | 1 - .../test/browser_field_resolve/k/main.js | 2 - .../k/node_modules/x/hey.js | 1 - .../k/node_modules/x/package.json | 5 - .../test/browser_field_resolve/l/main.js | 2 - .../l/node_modules/x/hey.js | 1 - .../l/node_modules/x/package.json | 5 - node_modules/browserify/test/buffer.js | 144 - .../browserify/test/bundle-bundle-external.js | 31 - .../test/bundle-bundle-external/bar.js | 2 - .../test/bundle-bundle-external/baz.js | 3 - .../test/bundle-bundle-external/foo.js | 5 - node_modules/browserify/test/bundle-stream.js | 18 - node_modules/browserify/test/bundle.js | 33 - .../browserify/test/bundle_external.js | 26 - .../browserify/test/bundle_external/boop.js | 4 - .../browserify/test/bundle_external/main.js | 4 - .../browserify/test/bundle_external/robot.js | 1 - .../browserify/test/bundle_external_global.js | 24 - .../browserify/test/bundle_sourcemap.js | 32 - node_modules/browserify/test/catch.js | 22 - node_modules/browserify/test/catch/main.js | 1 - node_modules/browserify/test/circular.js | 34 - node_modules/browserify/test/circular/a.js | 3 - node_modules/browserify/test/circular/b.js | 1 - node_modules/browserify/test/circular/main.js | 1 - node_modules/browserify/test/coffee_bin.js | 36 - .../browserify/test/coffee_bin/main.coffee | 2 - .../browserify/test/coffee_bin/x.coffee | 1 - node_modules/browserify/test/coffeeify.js | 19 - .../browserify/test/coffeeify/main.coffee | 2 - node_modules/browserify/test/comment.js | 16 - node_modules/browserify/test/comment/main.js | 2 - node_modules/browserify/test/constants.js | 18 - node_modules/browserify/test/crypto.js | 41 - node_modules/browserify/test/crypto_ig.js | 41 - node_modules/browserify/test/cycle.js | 13 - node_modules/browserify/test/cycle/README.md | 16 - node_modules/browserify/test/cycle/entry.js | 15 - node_modules/browserify/test/cycle/mod1/a.js | 1 - node_modules/browserify/test/cycle/mod1/b.js | 1 - node_modules/browserify/test/cycle/mod2/a.js | 1 - node_modules/browserify/test/cycle/mod2/b.js | 1 - .../browserify/test/debug_standalone.js | 64 - .../browserify/test/debug_standalone/x.js | 1 - node_modules/browserify/test/dedupe-deps.js | 59 - node_modules/browserify/test/dedupe-nomap.js | 64 - node_modules/browserify/test/delay.js | 25 - .../browserify/test/delay/diverted.js | 1 - node_modules/browserify/test/delay/main.js | 1 - node_modules/browserify/test/dep.js | 25 - node_modules/browserify/test/dollar.js | 17 - .../browserify/test/dollar/dollar/index.js | 7 - node_modules/browserify/test/double_buffer.js | 16 - .../browserify/test/double_buffer/explicit.js | 1 - .../browserify/test/double_buffer/implicit.js | 1 - .../browserify/test/double_buffer/main.js | 4 - node_modules/browserify/test/double_bundle.js | 24 - .../browserify/test/double_bundle_error.js | 17 - .../test/double_bundle_error/main.js | 1 - .../test/double_bundle_error/needs_three.js | 1 - .../test/double_bundle_error/one.js | 1 - .../test/double_bundle_error/package.json | 5 - .../test/double_bundle_error/three.js | 3 - .../test/double_bundle_error/two.js | 1 - .../browserify/test/double_bundle_json.js | 37 - .../browserify/test/double_bundle_json/a.json | 1 - .../browserify/test/double_bundle_json/b.json | 1 - .../test/double_bundle_json/index.js | 5 - .../browserify/test/double_bundle_parallel.js | 33 - .../test/double_bundle_parallel_cache.js | 35 - node_modules/browserify/test/dup/foo-dup.js | 4 - node_modules/browserify/test/dup/foo.js | 4 - node_modules/browserify/test/dup/index.js | 5 - node_modules/browserify/test/entry.js | 43 - node_modules/browserify/test/entry/main.js | 1 - .../browserify/test/entry/needs_three.js | 1 - node_modules/browserify/test/entry/one.js | 1 - .../browserify/test/entry/package.json | 5 - node_modules/browserify/test/entry/three.js | 1 - node_modules/browserify/test/entry/two.js | 1 - node_modules/browserify/test/entry_exec.js | 15 - .../browserify/test/entry_exec/fail.js | 1 - .../browserify/test/entry_exec/main.js | 1 - node_modules/browserify/test/entry_expose.js | 18 - .../browserify/test/entry_expose/main.js | 2 - .../browserify/test/entry_relative.js | 45 - node_modules/browserify/test/error_code.js | 28 - .../browserify/test/error_code/src.js | 2 - node_modules/browserify/test/exclude.js | 21 - node_modules/browserify/test/exclude/array.js | 2 - node_modules/browserify/test/exclude/skip.js | 1 - node_modules/browserify/test/exclude/skip2.js | 1 - node_modules/browserify/test/export.js | 35 - node_modules/browserify/test/export/entry.js | 1 - node_modules/browserify/test/external.js | 20 - node_modules/browserify/test/external/main.js | 2 - node_modules/browserify/test/external/x.js | 3 - .../browserify/test/external_args/main.js | 10 - node_modules/browserify/test/external_shim.js | 27 - .../browserify/test/external_shim/bundle1.js | 1 - .../browserify/test/external_shim/bundle2.js | 1 - .../test/external_shim/package.json | 5 - .../browserify/test/external_shim/shim.js | 0 node_modules/browserify/test/externalize.js | 59 - .../browserify/test/externalize/beep.js | 2 - .../browserify/test/externalize/boop.js | 2 - .../browserify/test/externalize/robot.js | 1 - node_modules/browserify/test/fake.js | 15 - node_modules/browserify/test/fake/fake_fs.js | 1 - node_modules/browserify/test/fake/main.js | 2 - node_modules/browserify/test/field.js | 72 - node_modules/browserify/test/field/miss.js | 1 - .../test/field/node_modules/z-miss/browser.js | 1 - .../test/field/node_modules/z-miss/main.js | 1 - .../field/node_modules/z-miss/package.json | 4 - .../field/node_modules/z-object/browser.js | 1 - .../test/field/node_modules/z-object/main.js | 1 - .../field/node_modules/z-object/package.json | 4 - .../field/node_modules/z-string/browser.js | 1 - .../test/field/node_modules/z-string/main.js | 1 - .../field/node_modules/z-string/package.json | 4 - .../field/node_modules/z-sub/browser/a.js | 1 - .../field/node_modules/z-sub/browser/b.js | 1 - .../test/field/node_modules/z-sub/main.js | 1 - .../field/node_modules/z-sub/package.json | 4 - node_modules/browserify/test/field/object.js | 1 - node_modules/browserify/test/field/string.js | 1 - node_modules/browserify/test/field/sub.js | 1 - node_modules/browserify/test/file_event.js | 33 - node_modules/browserify/test/five_bundle.js | 30 - node_modules/browserify/test/full_paths.js | 58 - node_modules/browserify/test/glob.js | 29 - node_modules/browserify/test/glob/a.js | 6 - node_modules/browserify/test/glob/b.js | 5 - node_modules/browserify/test/glob/lib/z.js | 1 - node_modules/browserify/test/glob/vendor/x.js | 1 - node_modules/browserify/test/glob/vendor/y.js | 1 - node_modules/browserify/test/global.js | 92 - node_modules/browserify/test/global/buffer.js | 2 - .../browserify/test/global/filename.js | 2 - node_modules/browserify/test/global/main.js | 2 - .../test/global/node_modules/aaa/index.js | 2 - .../test/global/node_modules/robot/index.js | 1 - .../global/node_modules/robot/lib/beep.js | 2 - node_modules/browserify/test/global/tick.js | 3 - .../browserify/test/global_coffeeify.js | 19 - .../browserify/test/global_noparse.js | 102 - .../browserify/test/global_recorder.js | 22 - .../browserify/test/global_recorder/main.js | 1 - node_modules/browserify/test/hash.js | 15 - .../browserify/test/hash/foo/other.js | 1 - node_modules/browserify/test/hash/foo/two.js | 2 - node_modules/browserify/test/hash/main.js | 2 - node_modules/browserify/test/hash/one.js | 2 - node_modules/browserify/test/hash/other.js | 1 - .../browserify/test/hash_instance_context.js | 25 - .../test/hash_instance_context/main.js | 17 - .../test/hash_instance_context/one/dir/f.js | 3 - .../test/hash_instance_context/one/dir/g.js | 2 - .../test/hash_instance_context/one/f.js | 3 - .../test/hash_instance_context/one/g.js | 2 - .../test/hash_instance_context/three/dir/f.js | 3 - .../test/hash_instance_context/three/dir/g.js | 2 - .../test/hash_instance_context/three/dir/h.js | 2 - .../test/hash_instance_context/three/f.js | 3 - .../test/hash_instance_context/three/g.js | 2 - .../test/hash_instance_context/three/h.js | 2 - .../test/hash_instance_context/two/dir/f.js | 3 - .../test/hash_instance_context/two/dir/g.js | 2 - .../test/hash_instance_context/two/dir/h.js | 2 - .../test/hash_instance_context/two/f.js | 3 - .../test/hash_instance_context/two/g.js | 2 - .../test/hash_instance_context/two/h.js | 2 - node_modules/browserify/test/identical.js | 19 - .../browserify/test/identical/main.js | 6 - node_modules/browserify/test/identical/x.js | 2 - node_modules/browserify/test/identical/y.js | 2 - .../browserify/test/identical_different.js | 19 - .../test/identical_different/main.js | 6 - .../node_modules/op/index.js | 3 - .../wow/node_modules/op/index.js | 3 - .../test/identical_different/wow/y.js | 3 - .../browserify/test/identical_different/x.js | 3 - node_modules/browserify/test/ignore.js | 91 - node_modules/browserify/test/ignore/array.js | 2 - node_modules/browserify/test/ignore/by-id.js | 3 - .../browserify/test/ignore/by-relative.js | 5 - .../browserify/test/ignore/double-skip.js | 2 - .../test/ignore/double-skip/index.js | 1 - .../test/ignore/double-skip/skip.js | 5 - .../browserify/test/ignore/ignored/skip.js | 1 - node_modules/browserify/test/ignore/main.js | 1 - .../browserify/test/ignore/relative/index.js | 1 - node_modules/browserify/test/ignore/skip.js | 1 - node_modules/browserify/test/ignore/skip2.js | 1 - .../browserify/test/ignore_browser_field.js | 21 - .../test/ignore_browser_field/main.js | 2 - .../node_modules/a/browser.js | 1 - .../node_modules/a/main.js | 1 - .../node_modules/a/package.json | 6 - .../node_modules/b/browser-x.js | 1 - .../node_modules/b/main.js | 1 - .../node_modules/b/package.json | 8 - .../ignore_browser_field/node_modules/b/x.js | 1 - .../browserify/test/ignore_missing.js | 41 - .../browserify/test/ignore_missing/main.js | 1 - .../browserify/test/ignore_transform_key.js | 17 - .../test/ignore_transform_key/main.js | 3 - .../node_modules/a/index.js | 1 - .../node_modules/a/package.json | 10 - .../node_modules/evil-transform/index.js | 12 - .../node_modules/evil-transform/package.json | 5 - node_modules/browserify/test/json.js | 48 - node_modules/browserify/test/json/beep.json | 4 - .../browserify/test/json/evil-chars.json | 3 - node_modules/browserify/test/json/evil.js | 2 - node_modules/browserify/test/json/main.js | 2 - node_modules/browserify/test/leak.js | 59 - node_modules/browserify/test/maxlisteners.js | 13 - .../browserify/test/maxlisteners/main.js | 3 - node_modules/browserify/test/multi_bundle.js | 86 - .../browserify/test/multi_bundle/_prelude.js | 1 - .../browserify/test/multi_bundle/a.js | 3 - .../browserify/test/multi_bundle/b.js | 5 - .../browserify/test/multi_bundle/c.js | 4 - .../browserify/test/multi_bundle_unique.js | 56 - node_modules/browserify/test/multi_entry.js | 122 - node_modules/browserify/test/multi_entry/a.js | 2 - node_modules/browserify/test/multi_entry/b.js | 2 - node_modules/browserify/test/multi_entry/c.js | 2 - .../test/multi_entry_cross_require.js | 93 - .../test/multi_entry_cross_require/a.js | 8 - .../test/multi_entry_cross_require/c.js | 7 - .../test/multi_entry_cross_require/lib/b.js | 5 - node_modules/browserify/test/multi_require.js | 18 - .../browserify/test/multi_require/a.js | 3 - .../browserify/test/multi_require/main.js | 4 - node_modules/browserify/test/multi_symlink.js | 13 - .../browserify/test/multi_symlink/main.js | 2 - .../browserify/test/multi_symlink/x.js | 1 - node_modules/browserify/test/no_builtins.js | 66 - .../browserify/test/no_builtins/extra/fs.js | 1 - .../browserify/test/no_builtins/extra/tls.js | 1 - .../browserify/test/no_builtins/main.js | 4 - .../browserify/test/no_builtins/x.txt | 1 - .../test/node_modules/beep/index.js | 1 - .../test/node_modules/plugin-foo/index.js | 9 - .../browserify/test/node_modules/tr/index.js | 8 - node_modules/browserify/test/noparse.js | 31 - node_modules/browserify/test/noparse/a.js | 4 - node_modules/browserify/test/noparse/b.js | 5 - .../browserify/test/noparse/dir1/1.js | 4 - .../browserify/test/noparse/dir1/dir2/2.js | 3 - .../noparse/node_modules/robot/lib/beep.js | 4 - .../noparse/node_modules/robot/lib/boop.js | 3 - .../test/noparse/node_modules/robot/main.js | 4 - .../noparse/node_modules/robot/package.json | 3 - node_modules/browserify/test/pack.js | 33 - node_modules/browserify/test/paths.js | 32 - node_modules/browserify/test/paths/main.js | 3 - .../browserify/test/paths/x/aaa/index.js | 1 - .../browserify/test/paths/x/ccc/index.js | 1 - .../browserify/test/paths/y/bbb/index.js | 1 - .../browserify/test/paths/y/ccc/index.js | 1 - .../browserify/test/paths_transform.js | 76 - node_modules/browserify/test/pipeline_deps.js | 22 - .../browserify/test/pipeline_deps/bar.js | 3 - .../browserify/test/pipeline_deps/foo.js | 5 - .../browserify/test/pipeline_deps/main.js | 2 - .../browserify/test/pipeline_deps/xyz.js | 2 - node_modules/browserify/test/pkg.js | 20 - node_modules/browserify/test/pkg/main.js | 1 - node_modules/browserify/test/pkg/package.json | 1 - node_modules/browserify/test/pkg_event.js | 31 - .../browserify/test/pkg_event/main.js | 1 - .../pkg_event/node_modules/aaa/lib/butts.js | 1 - .../node_modules/aaa/lib/package.json | 4 - .../pkg_event/node_modules/aaa/lib/woo.js | 1 - .../test/pkg_event/node_modules/aaa/main.js | 1 - .../pkg_event/node_modules/aaa/package.json | 4 - .../browserify/test/pkg_event/package.json | 3 - node_modules/browserify/test/plugin.js | 28 - node_modules/browserify/test/plugin/main.js | 1 - .../browserify/test/preserve-symlinks.js | 27 - .../test/preserve_symlinks/a/index.js | 1 - .../a/node_modules/b/index.js | 1 - .../a/node_modules/c/index.js | 0 .../test/preserve_symlinks/b/index.js | 1 - node_modules/browserify/test/process.js | 21 - node_modules/browserify/test/process/main.js | 3 - node_modules/browserify/test/process/one.js | 1 - node_modules/browserify/test/process/two.js | 1 - node_modules/browserify/test/quotes.js | 38 - .../browserify/test/quotes/backtick.js | 1 - node_modules/browserify/test/quotes/main.js | 1 - node_modules/browserify/test/quotes/one.js | 1 - node_modules/browserify/test/quotes/three.js | 1 - node_modules/browserify/test/quotes/two.js | 1 - .../browserify/test/relative_dedupe.js | 17 - .../browserify/test/relative_dedupe/a/a.js | 3 - .../browserify/test/relative_dedupe/a/b.js | 3 - .../test/relative_dedupe/a/index.js | 4 - .../browserify/test/relative_dedupe/b/a.js | 3 - .../browserify/test/relative_dedupe/b/b.js | 3 - .../test/relative_dedupe/b/index.js | 4 - .../browserify/test/relative_dedupe/index.js | 4 - .../browserify/test/relative_dedupe/main.js | 5 - node_modules/browserify/test/require_cache.js | 19 - .../browserify/test/require_expose.js | 53 - .../browserify/test/require_expose/main.js | 1 - .../test/require_expose/some_dep.js | 1 - node_modules/browserify/test/reset.js | 31 - .../browserify/test/resolve_exposed.js | 20 - .../browserify/test/resolve_exposed/main.js | 2 - .../browserify/test/resolve_exposed/x.js | 1 - node_modules/browserify/test/retarget.js | 25 - .../browserify/test/reverse_multi_bundle.js | 47 - .../test/reverse_multi_bundle/app.js | 22 - .../test/reverse_multi_bundle/arbitrary.js | 6 - .../test/reverse_multi_bundle/lazy.js | 9 - .../test/reverse_multi_bundle/shared.js | 6 - .../browserify/test/shared_symlink.js | 16 - .../test/shared_symlink/app/index.js | 1 - .../app/node_modules/foo/index.js | 1 - .../app/node_modules/shared/index.js | 1 - .../browserify/test/shared_symlink/main.js | 1 - .../test/shared_symlink/shared/index.js | 1 - node_modules/browserify/test/shebang.js | 11 - node_modules/browserify/test/shebang/foo.js | 2 - node_modules/browserify/test/shebang/main.js | 4 - node_modules/browserify/test/spread.js | 14 - node_modules/browserify/test/spread/main.js | 1 - node_modules/browserify/test/standalone.js | 85 - .../browserify/test/standalone/main.js | 3 - .../browserify/test/standalone/one.js | 1 - .../browserify/test/standalone/two.js | 1 - .../browserify/test/standalone_events.js | 19 - .../browserify/test/standalone_sourcemap.js | 55 - node_modules/browserify/test/stdin.js | 35 - node_modules/browserify/test/stream.js | 15 - node_modules/browserify/test/stream/bar.js | 1 - node_modules/browserify/test/stream/foo.js | 1 - node_modules/browserify/test/stream/main.js | 2 - node_modules/browserify/test/stream_file.js | 29 - node_modules/browserify/test/subdep.js | 16 - node_modules/browserify/test/subdep/index.js | 1 - .../test/subdep/node_modules/qq/b.js | 1 - .../test/subdep/node_modules/qq/ignore_me.js | 1 - .../node_modules/qq/node_modules/a/index.js | 1 - .../qq/node_modules/a/package.json | 5 - .../node_modules/qq/node_modules/c/index.js | 1 - .../qq/node_modules/c/package.json | 5 - .../node_modules/qq/node_modules/f/index.js | 1 - .../node_modules/qq/node_modules/z/index.js | 1 - .../test/subdep/node_modules/qq/package.json | 3 - .../browserify/test/subdep/package.json | 6 - .../browserify/test/symlink_dedupe.js | 16 - .../browserify/test/symlink_dedupe/main.js | 6 - .../browserify/test/symlink_dedupe/one/f.js | 3 - .../browserify/test/symlink_dedupe/one/g.js | 2 - node_modules/browserify/test/syntax_cache.js | 47 - .../browserify/test/syntax_cache/invalid.js | 2 - .../browserify/test/syntax_cache/valid.js | 2 - node_modules/browserify/test/tr.js | 28 - node_modules/browserify/test/tr/f.js | 2 - node_modules/browserify/test/tr/main.js | 9 - .../test/tr/node_modules/g/index.js | 2 - .../g/node_modules/insert-ggg/index.js | 7 - .../test/tr/node_modules/g/package.json | 6 - .../test/tr/node_modules/insert-aaa/index.js | 7 - .../test/tr/node_modules/insert-bbb/index.js | 7 - .../test/tr/node_modules/m/index.js | 3 - .../test/tr/node_modules/xyz/index.js | 7 - node_modules/browserify/test/tr/package.json | 5 - node_modules/browserify/test/tr/subdir/g.js | 1 - node_modules/browserify/test/tr_args.js | 24 - node_modules/browserify/test/tr_args/main.js | 1 - node_modules/browserify/test/tr_args/tr.js | 12 - node_modules/browserify/test/tr_error.js | 33 - node_modules/browserify/test/tr_flags.js | 36 - node_modules/browserify/test/tr_global.js | 17 - .../browserify/test/tr_global/main.js | 1 - .../test/tr_global/node_modules/tr/index.js | 8 - .../test/tr_global/node_modules/x/index.js | 1 - .../node_modules/x/node_modules/tr/index.js | 8 - node_modules/browserify/test/tr_no_entry.js | 20 - .../browserify/test/tr_no_entry/main.js | 1 - node_modules/browserify/test/tr_once.js | 21 - node_modules/browserify/test/tr_once/main.js | 1 - node_modules/browserify/test/tr_order.js | 23 - .../browserify/test/tr_order/replace_aaa.js | 10 - .../browserify/test/tr_order/replace_bbb.js | 11 - node_modules/browserify/test/tr_symlink.js | 27 - .../test/tr_symlink/a-module/index.js | 1 - .../browserify/test/tr_symlink/app/main.js | 6 - .../tr_symlink/app/node_modules/aaa/index.js | 1 - .../tr_symlink/app/node_modules/bbb/ext.js | 1 - .../tr_symlink/app/node_modules/bbb/index.js | 2 - .../tr_symlink/app/node_modules/tr/index.js | 14 - .../test/tr_symlink/app/package.json | 5 - .../test/tr_symlink/b-module/ext.js | 1 - .../test/tr_symlink/b-module/index.js | 2 - node_modules/browserify/test/unicode.js | 19 - node_modules/browserify/test/unicode/main.js | 1 - node_modules/browserify/test/unicode/one.js | 1 - node_modules/browserify/test/unicode/two.js | 1 - node_modules/browserify/test/util.js | 62 - node_modules/browserify/test/yield.js | 20 - node_modules/browserify/test/yield/f.js | 5 - node_modules/browserify/test/yield/main.js | 4 - node_modules/budo/.travis.yml | 8 - node_modules/budo/CHANGELOG.md | 244 - node_modules/budo/LICENSE.md | 21 - node_modules/budo/README.md | 169 - .../budo/bin/bundle-livereload-client.js | 37 - node_modules/budo/bin/cmd.js | 7 - node_modules/budo/bin/help.txt | 32 - .../budo/build/bundled-livereload-client.js | 1 - node_modules/budo/index.js | 86 - node_modules/budo/lib/budo.js | 331 - node_modules/budo/lib/bundler.js | 50 - node_modules/budo/lib/error-handler.js | 248 - node_modules/budo/lib/file-watch.js | 45 - node_modules/budo/lib/get-ports.js | 24 - node_modules/budo/lib/map-entry.js | 44 - node_modules/budo/lib/middleware.js | 254 - node_modules/budo/lib/parse-args.js | 70 - node_modules/budo/lib/reload/client.js | 155 - node_modules/budo/lib/reload/error-popup.js | 83 - node_modules/budo/lib/reload/server.js | 86 - node_modules/budo/lib/server.js | 59 - node_modules/budo/lib/simple-http-logger.js | 75 - node_modules/budo/package.json | 126 - node_modules/buffer-from/LICENSE | 21 - node_modules/buffer-from/index.js | 69 - node_modules/buffer-from/package.json | 52 - node_modules/buffer-from/readme.md | 69 - node_modules/buffer-xor/.npmignore | 1 - node_modules/buffer-xor/.travis.yml | 9 - node_modules/buffer-xor/LICENSE | 21 - node_modules/buffer-xor/README.md | 41 - node_modules/buffer-xor/index.js | 10 - node_modules/buffer-xor/inline.js | 1 - node_modules/buffer-xor/inplace.js | 9 - node_modules/buffer-xor/package.json | 64 - node_modules/buffer-xor/test/fixtures.json | 23 - node_modules/buffer-xor/test/index.js | 38 - node_modules/buffer/AUTHORS.md | 55 - node_modules/buffer/LICENSE | 21 - node_modules/buffer/README.md | 409 - node_modules/buffer/index.d.ts | 185 - node_modules/buffer/index.js | 1777 - node_modules/buffer/package.json | 110 - node_modules/builtin-status-codes/browser.js | 64 - node_modules/builtin-status-codes/build.js | 8 - node_modules/builtin-status-codes/index.js | 3 - node_modules/builtin-status-codes/license | 21 - .../builtin-status-codes/package.json | 71 - node_modules/builtin-status-codes/readme.md | 31 - node_modules/cache-base/LICENSE | 21 - node_modules/cache-base/README.md | 291 - node_modules/cache-base/index.js | 261 - .../cache-base/node_modules/isobject/LICENSE | 21 - .../node_modules/isobject/README.md | 122 - .../node_modules/isobject/index.d.ts | 5 - .../cache-base/node_modules/isobject/index.js | 12 - .../node_modules/isobject/package.json | 119 - node_modules/cache-base/package.json | 118 - node_modules/cached-path-relative/.npmignore | 2 - node_modules/cached-path-relative/History.md | 0 node_modules/cached-path-relative/Makefile | 20 - node_modules/cached-path-relative/Readme.md | 41 - .../cached-path-relative/lib/index.js | 43 - .../cached-path-relative/package.json | 46 - node_modules/cached-path-relative/shim.js | 12 - .../cached-path-relative/test/index.js | 17 - node_modules/chalk/index.js | 95 - .../chalk/node_modules/.bin/strip-ansi | 1 - .../chalk/node_modules/strip-ansi/cli.js | 39 - .../chalk/node_modules/strip-ansi/index.js | 6 - .../node_modules/strip-ansi/package.json | 88 - .../chalk/node_modules/strip-ansi/readme.md | 43 - node_modules/chalk/package.json | 94 - node_modules/chalk/readme.md | 175 - node_modules/charenc/LICENSE.mkd | 27 - node_modules/charenc/README.js | 1 - node_modules/charenc/charenc.js | 33 - node_modules/charenc/package.json | 54 - node_modules/chokidar/CHANGELOG.md | 274 - node_modules/chokidar/README.md | 293 - node_modules/chokidar/index.js | 716 - node_modules/chokidar/lib/fsevents-handler.js | 397 - node_modules/chokidar/lib/nodefs-handler.js | 481 - node_modules/chokidar/package.json | 85 - node_modules/cipher-base/.eslintrc | 3 - node_modules/cipher-base/.npmignore | 1 - node_modules/cipher-base/.travis.yml | 6 - node_modules/cipher-base/LICENSE | 21 - node_modules/cipher-base/README.md | 17 - node_modules/cipher-base/index.js | 99 - node_modules/cipher-base/package.json | 63 - node_modules/cipher-base/test.js | 111 - node_modules/class-utils/LICENSE | 21 - node_modules/class-utils/README.md | 300 - node_modules/class-utils/index.js | 370 - .../node_modules/define-property/LICENSE | 21 - .../node_modules/define-property/README.md | 77 - .../node_modules/define-property/index.js | 31 - .../node_modules/define-property/package.json | 82 - .../class-utils/node_modules/isobject/LICENSE | 21 - .../node_modules/isobject/README.md | 122 - .../node_modules/isobject/index.d.ts | 5 - .../node_modules/isobject/index.js | 12 - .../node_modules/isobject/package.json | 119 - node_modules/class-utils/package.json | 131 - node_modules/collection-visit/LICENSE | 21 - node_modules/collection-visit/README.md | 89 - node_modules/collection-visit/index.js | 30 - node_modules/collection-visit/package.json | 115 - node_modules/combine-source-map/.npmignore | 16 - node_modules/combine-source-map/.travis.yml | 8 - node_modules/combine-source-map/LICENSE | 23 - node_modules/combine-source-map/README.md | 111 - .../example/two-files-short.js | 26 - .../combine-source-map/example/two-files.js | 46 - node_modules/combine-source-map/index.js | 155 - .../lib/mappings-from-map.js | 30 - .../lib/path-is-absolute.js | 20 - .../lib/path-is-absolute.license | 21 - node_modules/combine-source-map/package.json | 71 - .../test/combine-source-map.js | 347 - node_modules/component-emitter/History.md | 68 - node_modules/component-emitter/LICENSE | 24 - node_modules/component-emitter/Readme.md | 74 - node_modules/component-emitter/index.js | 163 - node_modules/component-emitter/package.json | 57 - node_modules/concat-map/.travis.yml | 4 - node_modules/concat-map/LICENSE | 18 - node_modules/concat-map/README.markdown | 62 - node_modules/concat-map/example/map.js | 6 - node_modules/concat-map/index.js | 13 - node_modules/concat-map/package.json | 88 - node_modules/concat-map/test/map.js | 39 - node_modules/concat-stream/LICENSE | 24 - node_modules/concat-stream/index.js | 144 - node_modules/concat-stream/package.json | 87 - node_modules/concat-stream/readme.md | 102 - node_modules/connect-pushstate/.jshintrc | 17 - node_modules/connect-pushstate/.npmignore | 3 - node_modules/connect-pushstate/Gruntfile.js | 31 - node_modules/connect-pushstate/LICENSE | 22 - node_modules/connect-pushstate/README.md | 77 - .../connect-pushstate/examples/server.js | 15 - node_modules/connect-pushstate/index.js | 26 - node_modules/connect-pushstate/package.json | 66 - .../test/fixtures/www/images/image.png | Bin 6279 -> 0 bytes .../test/fixtures/www/index.html | 1 - .../test/fixtures/www/other/index.html | 1 - .../connect-pushstate/test/pushstate-test.js | 102 - node_modules/console-browserify/.npmignore | 14 - node_modules/console-browserify/.testem.json | 14 - node_modules/console-browserify/.travis.yml | 4 - node_modules/console-browserify/LICENCE | 19 - node_modules/console-browserify/README.md | 33 - node_modules/console-browserify/index.js | 86 - node_modules/console-browserify/package.json | 93 - node_modules/console-browserify/test/index.js | 67 - .../console-browserify/test/static/index.html | 12 - .../test/static/test-adapter.js | 53 - node_modules/constants-browserify/README.md | 54 - node_modules/constants-browserify/build.sh | 1 - .../constants-browserify/constants.json | 209 - .../constants-browserify/package.json | 62 - node_modules/constants-browserify/test.js | 18 - node_modules/convert-source-map/.npmignore | 16 - node_modules/convert-source-map/.travis.yml | 5 - node_modules/convert-source-map/LICENSE | 23 - node_modules/convert-source-map/README.md | 121 - .../example/comment-to-json.js | 15 - node_modules/convert-source-map/index.js | 156 - node_modules/convert-source-map/package.json | 64 - .../convert-source-map/test/comment-regex.js | 138 - .../test/convert-source-map.js | 207 - .../map-file-comment-double-slash.css | 14 - .../test/fixtures/map-file-comment-inline.css | 14 - .../test/fixtures/map-file-comment.css | 14 - .../test/fixtures/map-file-comment.css.map | 6 - .../test/map-file-comment.js | 70 - node_modules/copy-descriptor/LICENSE | 21 - node_modules/copy-descriptor/index.js | 81 - node_modules/copy-descriptor/package.json | 87 - node_modules/core-js/CHANGELOG.md | 667 - node_modules/core-js/Gruntfile.js | 3 - node_modules/core-js/LICENSE | 19 - node_modules/core-js/README.md | 2289 -- node_modules/core-js/bower.json | 49 - node_modules/core-js/build/Gruntfile.ls | 86 - node_modules/core-js/build/build.ls | 62 - node_modules/core-js/build/config.js | 274 - node_modules/core-js/build/index.js | 104 - node_modules/core-js/client/core.js | 8645 ----- node_modules/core-js/client/core.min.js | 10 - node_modules/core-js/client/core.min.js.map | 1 - node_modules/core-js/client/library.js | 8129 ----- node_modules/core-js/client/library.min.js | 10 - .../core-js/client/library.min.js.map | 1 - node_modules/core-js/client/shim.js | 8213 ----- node_modules/core-js/client/shim.min.js | 10 - node_modules/core-js/client/shim.min.js.map | 1 - node_modules/core-js/core/_.js | 2 - node_modules/core-js/core/delay.js | 2 - node_modules/core-js/core/dict.js | 2 - node_modules/core-js/core/function.js | 2 - node_modules/core-js/core/index.js | 15 - node_modules/core-js/core/number.js | 2 - node_modules/core-js/core/object.js | 5 - node_modules/core-js/core/regexp.js | 2 - node_modules/core-js/core/string.js | 3 - node_modules/core-js/es5/index.js | 37 - node_modules/core-js/es6/array.js | 23 - node_modules/core-js/es6/date.js | 6 - node_modules/core-js/es6/function.js | 4 - node_modules/core-js/es6/index.js | 138 - node_modules/core-js/es6/map.js | 5 - node_modules/core-js/es6/math.js | 18 - node_modules/core-js/es6/number.js | 13 - node_modules/core-js/es6/object.js | 20 - node_modules/core-js/es6/parse-float.js | 2 - node_modules/core-js/es6/parse-int.js | 2 - node_modules/core-js/es6/promise.js | 5 - node_modules/core-js/es6/reflect.js | 15 - node_modules/core-js/es6/regexp.js | 8 - node_modules/core-js/es6/set.js | 5 - node_modules/core-js/es6/string.js | 27 - node_modules/core-js/es6/symbol.js | 3 - node_modules/core-js/es6/typed.js | 13 - node_modules/core-js/es6/weak-map.js | 4 - node_modules/core-js/es6/weak-set.js | 4 - node_modules/core-js/es7/array.js | 4 - node_modules/core-js/es7/asap.js | 2 - node_modules/core-js/es7/error.js | 2 - node_modules/core-js/es7/global.js | 2 - node_modules/core-js/es7/index.js | 56 - node_modules/core-js/es7/map.js | 4 - node_modules/core-js/es7/math.js | 13 - node_modules/core-js/es7/object.js | 8 - node_modules/core-js/es7/observable.js | 7 - node_modules/core-js/es7/promise.js | 3 - node_modules/core-js/es7/reflect.js | 10 - node_modules/core-js/es7/set.js | 4 - node_modules/core-js/es7/string.js | 7 - node_modules/core-js/es7/symbol.js | 3 - node_modules/core-js/es7/system.js | 2 - node_modules/core-js/es7/weak-map.js | 3 - node_modules/core-js/es7/weak-set.js | 3 - node_modules/core-js/fn/_.js | 2 - node_modules/core-js/fn/array/concat.js | 4 - node_modules/core-js/fn/array/copy-within.js | 2 - node_modules/core-js/fn/array/entries.js | 2 - node_modules/core-js/fn/array/every.js | 2 - node_modules/core-js/fn/array/fill.js | 2 - node_modules/core-js/fn/array/filter.js | 2 - node_modules/core-js/fn/array/find-index.js | 2 - node_modules/core-js/fn/array/find.js | 2 - node_modules/core-js/fn/array/flat-map.js | 2 - node_modules/core-js/fn/array/flatten.js | 2 - node_modules/core-js/fn/array/for-each.js | 2 - node_modules/core-js/fn/array/from.js | 3 - node_modules/core-js/fn/array/includes.js | 2 - node_modules/core-js/fn/array/index-of.js | 2 - node_modules/core-js/fn/array/index.js | 26 - node_modules/core-js/fn/array/is-array.js | 2 - node_modules/core-js/fn/array/iterator.js | 2 - node_modules/core-js/fn/array/join.js | 2 - node_modules/core-js/fn/array/keys.js | 2 - .../core-js/fn/array/last-index-of.js | 2 - node_modules/core-js/fn/array/map.js | 2 - node_modules/core-js/fn/array/of.js | 2 - node_modules/core-js/fn/array/pop.js | 4 - node_modules/core-js/fn/array/push.js | 4 - node_modules/core-js/fn/array/reduce-right.js | 2 - node_modules/core-js/fn/array/reduce.js | 2 - node_modules/core-js/fn/array/reverse.js | 4 - node_modules/core-js/fn/array/shift.js | 4 - node_modules/core-js/fn/array/slice.js | 2 - node_modules/core-js/fn/array/some.js | 2 - node_modules/core-js/fn/array/sort.js | 2 - node_modules/core-js/fn/array/splice.js | 4 - node_modules/core-js/fn/array/unshift.js | 4 - node_modules/core-js/fn/array/values.js | 2 - .../core-js/fn/array/virtual/copy-within.js | 2 - .../core-js/fn/array/virtual/entries.js | 2 - .../core-js/fn/array/virtual/every.js | 2 - node_modules/core-js/fn/array/virtual/fill.js | 2 - .../core-js/fn/array/virtual/filter.js | 2 - .../core-js/fn/array/virtual/find-index.js | 2 - node_modules/core-js/fn/array/virtual/find.js | 2 - .../core-js/fn/array/virtual/flat-map.js | 2 - .../core-js/fn/array/virtual/flatten.js | 2 - .../core-js/fn/array/virtual/for-each.js | 2 - .../core-js/fn/array/virtual/includes.js | 2 - .../core-js/fn/array/virtual/index-of.js | 2 - .../core-js/fn/array/virtual/index.js | 20 - .../core-js/fn/array/virtual/iterator.js | 2 - node_modules/core-js/fn/array/virtual/join.js | 2 - node_modules/core-js/fn/array/virtual/keys.js | 2 - .../core-js/fn/array/virtual/last-index-of.js | 2 - node_modules/core-js/fn/array/virtual/map.js | 2 - .../core-js/fn/array/virtual/reduce-right.js | 2 - .../core-js/fn/array/virtual/reduce.js | 2 - .../core-js/fn/array/virtual/slice.js | 2 - node_modules/core-js/fn/array/virtual/some.js | 2 - node_modules/core-js/fn/array/virtual/sort.js | 2 - .../core-js/fn/array/virtual/values.js | 2 - node_modules/core-js/fn/asap.js | 2 - node_modules/core-js/fn/clear-immediate.js | 2 - node_modules/core-js/fn/date/index.js | 6 - node_modules/core-js/fn/date/now.js | 2 - node_modules/core-js/fn/date/to-iso-string.js | 3 - node_modules/core-js/fn/date/to-json.js | 2 - node_modules/core-js/fn/date/to-primitive.js | 5 - node_modules/core-js/fn/date/to-string.js | 5 - node_modules/core-js/fn/delay.js | 2 - node_modules/core-js/fn/dict.js | 2 - .../core-js/fn/dom-collections/index.js | 8 - .../core-js/fn/dom-collections/iterator.js | 2 - node_modules/core-js/fn/error/index.js | 2 - node_modules/core-js/fn/error/is-error.js | 2 - node_modules/core-js/fn/function/bind.js | 2 - .../core-js/fn/function/has-instance.js | 2 - node_modules/core-js/fn/function/index.js | 5 - node_modules/core-js/fn/function/name.js | 1 - node_modules/core-js/fn/function/part.js | 2 - .../core-js/fn/function/virtual/bind.js | 2 - .../core-js/fn/function/virtual/index.js | 3 - .../core-js/fn/function/virtual/part.js | 2 - .../core-js/fn/get-iterator-method.js | 3 - node_modules/core-js/fn/get-iterator.js | 3 - node_modules/core-js/fn/global.js | 2 - node_modules/core-js/fn/is-iterable.js | 3 - node_modules/core-js/fn/json/index.js | 2 - node_modules/core-js/fn/json/stringify.js | 5 - node_modules/core-js/fn/map.js | 8 - node_modules/core-js/fn/map/from.js | 8 - node_modules/core-js/fn/map/index.js | 8 - node_modules/core-js/fn/map/of.js | 8 - node_modules/core-js/fn/math/acosh.js | 2 - node_modules/core-js/fn/math/asinh.js | 2 - node_modules/core-js/fn/math/atanh.js | 2 - node_modules/core-js/fn/math/cbrt.js | 2 - node_modules/core-js/fn/math/clamp.js | 2 - node_modules/core-js/fn/math/clz32.js | 2 - node_modules/core-js/fn/math/cosh.js | 2 - node_modules/core-js/fn/math/deg-per-rad.js | 2 - node_modules/core-js/fn/math/degrees.js | 2 - node_modules/core-js/fn/math/expm1.js | 2 - node_modules/core-js/fn/math/fround.js | 2 - node_modules/core-js/fn/math/fscale.js | 2 - node_modules/core-js/fn/math/hypot.js | 2 - node_modules/core-js/fn/math/iaddh.js | 2 - node_modules/core-js/fn/math/imul.js | 2 - node_modules/core-js/fn/math/imulh.js | 2 - node_modules/core-js/fn/math/index.js | 30 - node_modules/core-js/fn/math/isubh.js | 2 - node_modules/core-js/fn/math/log10.js | 2 - node_modules/core-js/fn/math/log1p.js | 2 - node_modules/core-js/fn/math/log2.js | 2 - node_modules/core-js/fn/math/rad-per-deg.js | 2 - node_modules/core-js/fn/math/radians.js | 2 - node_modules/core-js/fn/math/scale.js | 2 - node_modules/core-js/fn/math/sign.js | 2 - node_modules/core-js/fn/math/signbit.js | 3 - node_modules/core-js/fn/math/sinh.js | 2 - node_modules/core-js/fn/math/tanh.js | 2 - node_modules/core-js/fn/math/trunc.js | 2 - node_modules/core-js/fn/math/umulh.js | 2 - node_modules/core-js/fn/number/constructor.js | 2 - node_modules/core-js/fn/number/epsilon.js | 2 - node_modules/core-js/fn/number/index.js | 14 - node_modules/core-js/fn/number/is-finite.js | 2 - node_modules/core-js/fn/number/is-integer.js | 2 - node_modules/core-js/fn/number/is-nan.js | 2 - .../core-js/fn/number/is-safe-integer.js | 2 - node_modules/core-js/fn/number/iterator.js | 5 - .../core-js/fn/number/max-safe-integer.js | 2 - .../core-js/fn/number/min-safe-integer.js | 2 - node_modules/core-js/fn/number/parse-float.js | 2 - node_modules/core-js/fn/number/parse-int.js | 2 - node_modules/core-js/fn/number/to-fixed.js | 2 - .../core-js/fn/number/to-precision.js | 2 - .../core-js/fn/number/virtual/index.js | 4 - .../core-js/fn/number/virtual/iterator.js | 2 - .../core-js/fn/number/virtual/to-fixed.js | 2 - .../core-js/fn/number/virtual/to-precision.js | 2 - node_modules/core-js/fn/object/assign.js | 2 - node_modules/core-js/fn/object/classof.js | 2 - node_modules/core-js/fn/object/create.js | 5 - .../core-js/fn/object/define-getter.js | 2 - .../core-js/fn/object/define-properties.js | 5 - .../core-js/fn/object/define-property.js | 5 - .../core-js/fn/object/define-setter.js | 2 - node_modules/core-js/fn/object/define.js | 2 - node_modules/core-js/fn/object/entries.js | 2 - node_modules/core-js/fn/object/freeze.js | 2 - .../fn/object/get-own-property-descriptor.js | 5 - .../fn/object/get-own-property-descriptors.js | 2 - .../fn/object/get-own-property-names.js | 5 - .../fn/object/get-own-property-symbols.js | 2 - .../core-js/fn/object/get-prototype-of.js | 2 - node_modules/core-js/fn/object/index.js | 30 - .../core-js/fn/object/is-extensible.js | 2 - node_modules/core-js/fn/object/is-frozen.js | 2 - node_modules/core-js/fn/object/is-object.js | 2 - node_modules/core-js/fn/object/is-sealed.js | 2 - node_modules/core-js/fn/object/is.js | 2 - node_modules/core-js/fn/object/keys.js | 2 - .../core-js/fn/object/lookup-getter.js | 2 - .../core-js/fn/object/lookup-setter.js | 2 - node_modules/core-js/fn/object/make.js | 2 - .../core-js/fn/object/prevent-extensions.js | 2 - node_modules/core-js/fn/object/seal.js | 2 - .../core-js/fn/object/set-prototype-of.js | 2 - node_modules/core-js/fn/object/values.js | 2 - node_modules/core-js/fn/observable.js | 7 - node_modules/core-js/fn/parse-float.js | 2 - node_modules/core-js/fn/parse-int.js | 2 - node_modules/core-js/fn/promise.js | 7 - node_modules/core-js/fn/promise/finally.js | 4 - node_modules/core-js/fn/promise/index.js | 7 - node_modules/core-js/fn/promise/try.js | 8 - node_modules/core-js/fn/reflect/apply.js | 2 - node_modules/core-js/fn/reflect/construct.js | 2 - .../core-js/fn/reflect/define-metadata.js | 2 - .../core-js/fn/reflect/define-property.js | 2 - .../core-js/fn/reflect/delete-metadata.js | 2 - .../core-js/fn/reflect/delete-property.js | 2 - node_modules/core-js/fn/reflect/enumerate.js | 2 - .../core-js/fn/reflect/get-metadata-keys.js | 2 - .../core-js/fn/reflect/get-metadata.js | 2 - .../fn/reflect/get-own-metadata-keys.js | 2 - .../core-js/fn/reflect/get-own-metadata.js | 2 - .../fn/reflect/get-own-property-descriptor.js | 2 - .../core-js/fn/reflect/get-prototype-of.js | 2 - node_modules/core-js/fn/reflect/get.js | 2 - .../core-js/fn/reflect/has-metadata.js | 2 - .../core-js/fn/reflect/has-own-metadata.js | 2 - node_modules/core-js/fn/reflect/has.js | 2 - node_modules/core-js/fn/reflect/index.js | 24 - .../core-js/fn/reflect/is-extensible.js | 2 - node_modules/core-js/fn/reflect/metadata.js | 2 - node_modules/core-js/fn/reflect/own-keys.js | 2 - .../core-js/fn/reflect/prevent-extensions.js | 2 - .../core-js/fn/reflect/set-prototype-of.js | 2 - node_modules/core-js/fn/reflect/set.js | 2 - node_modules/core-js/fn/regexp/constructor.js | 2 - node_modules/core-js/fn/regexp/escape.js | 2 - node_modules/core-js/fn/regexp/flags.js | 5 - node_modules/core-js/fn/regexp/index.js | 9 - node_modules/core-js/fn/regexp/match.js | 5 - node_modules/core-js/fn/regexp/replace.js | 5 - node_modules/core-js/fn/regexp/search.js | 5 - node_modules/core-js/fn/regexp/split.js | 5 - node_modules/core-js/fn/regexp/to-string.js | 5 - node_modules/core-js/fn/set-immediate.js | 2 - node_modules/core-js/fn/set-interval.js | 2 - node_modules/core-js/fn/set-timeout.js | 2 - node_modules/core-js/fn/set.js | 8 - node_modules/core-js/fn/set/from.js | 8 - node_modules/core-js/fn/set/index.js | 8 - node_modules/core-js/fn/set/of.js | 8 - node_modules/core-js/fn/string/anchor.js | 2 - node_modules/core-js/fn/string/at.js | 2 - node_modules/core-js/fn/string/big.js | 2 - node_modules/core-js/fn/string/blink.js | 2 - node_modules/core-js/fn/string/bold.js | 2 - .../core-js/fn/string/code-point-at.js | 2 - node_modules/core-js/fn/string/ends-with.js | 2 - node_modules/core-js/fn/string/escape-html.js | 2 - node_modules/core-js/fn/string/fixed.js | 2 - node_modules/core-js/fn/string/fontcolor.js | 2 - node_modules/core-js/fn/string/fontsize.js | 2 - .../core-js/fn/string/from-code-point.js | 2 - node_modules/core-js/fn/string/includes.js | 2 - node_modules/core-js/fn/string/index.js | 35 - node_modules/core-js/fn/string/italics.js | 2 - node_modules/core-js/fn/string/iterator.js | 5 - node_modules/core-js/fn/string/link.js | 2 - node_modules/core-js/fn/string/match-all.js | 2 - node_modules/core-js/fn/string/pad-end.js | 2 - node_modules/core-js/fn/string/pad-start.js | 2 - node_modules/core-js/fn/string/raw.js | 2 - node_modules/core-js/fn/string/repeat.js | 2 - node_modules/core-js/fn/string/small.js | 2 - node_modules/core-js/fn/string/starts-with.js | 2 - node_modules/core-js/fn/string/strike.js | 2 - node_modules/core-js/fn/string/sub.js | 2 - node_modules/core-js/fn/string/sup.js | 2 - node_modules/core-js/fn/string/trim-end.js | 2 - node_modules/core-js/fn/string/trim-left.js | 2 - node_modules/core-js/fn/string/trim-right.js | 2 - node_modules/core-js/fn/string/trim-start.js | 2 - node_modules/core-js/fn/string/trim.js | 2 - .../core-js/fn/string/unescape-html.js | 2 - .../core-js/fn/string/virtual/anchor.js | 2 - node_modules/core-js/fn/string/virtual/at.js | 2 - node_modules/core-js/fn/string/virtual/big.js | 2 - .../core-js/fn/string/virtual/blink.js | 2 - .../core-js/fn/string/virtual/bold.js | 2 - .../fn/string/virtual/code-point-at.js | 2 - .../core-js/fn/string/virtual/ends-with.js | 2 - .../core-js/fn/string/virtual/escape-html.js | 2 - .../core-js/fn/string/virtual/fixed.js | 2 - .../core-js/fn/string/virtual/fontcolor.js | 2 - .../core-js/fn/string/virtual/fontsize.js | 2 - .../core-js/fn/string/virtual/includes.js | 2 - .../core-js/fn/string/virtual/index.js | 33 - .../core-js/fn/string/virtual/italics.js | 2 - .../core-js/fn/string/virtual/iterator.js | 2 - .../core-js/fn/string/virtual/link.js | 2 - .../core-js/fn/string/virtual/match-all.js | 2 - .../core-js/fn/string/virtual/pad-end.js | 2 - .../core-js/fn/string/virtual/pad-start.js | 2 - .../core-js/fn/string/virtual/repeat.js | 2 - .../core-js/fn/string/virtual/small.js | 2 - .../core-js/fn/string/virtual/starts-with.js | 2 - .../core-js/fn/string/virtual/strike.js | 2 - node_modules/core-js/fn/string/virtual/sub.js | 2 - node_modules/core-js/fn/string/virtual/sup.js | 2 - .../core-js/fn/string/virtual/trim-end.js | 2 - .../core-js/fn/string/virtual/trim-left.js | 2 - .../core-js/fn/string/virtual/trim-right.js | 2 - .../core-js/fn/string/virtual/trim-start.js | 2 - .../core-js/fn/string/virtual/trim.js | 2 - .../fn/string/virtual/unescape-html.js | 2 - .../core-js/fn/symbol/async-iterator.js | 2 - node_modules/core-js/fn/symbol/for.js | 2 - .../core-js/fn/symbol/has-instance.js | 2 - node_modules/core-js/fn/symbol/index.js | 5 - .../core-js/fn/symbol/is-concat-spreadable.js | 1 - node_modules/core-js/fn/symbol/iterator.js | 3 - node_modules/core-js/fn/symbol/key-for.js | 2 - node_modules/core-js/fn/symbol/match.js | 2 - node_modules/core-js/fn/symbol/observable.js | 2 - node_modules/core-js/fn/symbol/replace.js | 2 - node_modules/core-js/fn/symbol/search.js | 2 - node_modules/core-js/fn/symbol/species.js | 1 - node_modules/core-js/fn/symbol/split.js | 2 - .../core-js/fn/symbol/to-primitive.js | 1 - .../core-js/fn/symbol/to-string-tag.js | 2 - node_modules/core-js/fn/symbol/unscopables.js | 1 - node_modules/core-js/fn/system/global.js | 2 - node_modules/core-js/fn/system/index.js | 2 - node_modules/core-js/fn/typed/array-buffer.js | 3 - node_modules/core-js/fn/typed/data-view.js | 3 - .../core-js/fn/typed/float32-array.js | 2 - .../core-js/fn/typed/float64-array.js | 2 - node_modules/core-js/fn/typed/index.js | 13 - node_modules/core-js/fn/typed/int16-array.js | 2 - node_modules/core-js/fn/typed/int32-array.js | 2 - node_modules/core-js/fn/typed/int8-array.js | 2 - node_modules/core-js/fn/typed/uint16-array.js | 2 - node_modules/core-js/fn/typed/uint32-array.js | 2 - node_modules/core-js/fn/typed/uint8-array.js | 2 - .../core-js/fn/typed/uint8-clamped-array.js | 2 - node_modules/core-js/fn/weak-map.js | 6 - node_modules/core-js/fn/weak-map/from.js | 8 - node_modules/core-js/fn/weak-map/index.js | 6 - node_modules/core-js/fn/weak-map/of.js | 8 - node_modules/core-js/fn/weak-set.js | 6 - node_modules/core-js/fn/weak-set/from.js | 8 - node_modules/core-js/fn/weak-set/index.js | 6 - node_modules/core-js/fn/weak-set/of.js | 8 - node_modules/core-js/index.js | 16 - node_modules/core-js/library/core/_.js | 2 - node_modules/core-js/library/core/delay.js | 2 - node_modules/core-js/library/core/dict.js | 2 - node_modules/core-js/library/core/function.js | 2 - node_modules/core-js/library/core/index.js | 15 - node_modules/core-js/library/core/number.js | 2 - node_modules/core-js/library/core/object.js | 5 - node_modules/core-js/library/core/regexp.js | 2 - node_modules/core-js/library/core/string.js | 3 - node_modules/core-js/library/es5/index.js | 37 - node_modules/core-js/library/es6/array.js | 23 - node_modules/core-js/library/es6/date.js | 6 - node_modules/core-js/library/es6/function.js | 4 - node_modules/core-js/library/es6/index.js | 138 - node_modules/core-js/library/es6/map.js | 5 - node_modules/core-js/library/es6/math.js | 18 - node_modules/core-js/library/es6/number.js | 13 - node_modules/core-js/library/es6/object.js | 20 - .../core-js/library/es6/parse-float.js | 2 - node_modules/core-js/library/es6/parse-int.js | 2 - node_modules/core-js/library/es6/promise.js | 5 - node_modules/core-js/library/es6/reflect.js | 15 - node_modules/core-js/library/es6/regexp.js | 8 - node_modules/core-js/library/es6/set.js | 5 - node_modules/core-js/library/es6/string.js | 27 - node_modules/core-js/library/es6/symbol.js | 3 - node_modules/core-js/library/es6/typed.js | 13 - node_modules/core-js/library/es6/weak-map.js | 4 - node_modules/core-js/library/es6/weak-set.js | 4 - node_modules/core-js/library/es7/array.js | 4 - node_modules/core-js/library/es7/asap.js | 2 - node_modules/core-js/library/es7/error.js | 2 - node_modules/core-js/library/es7/global.js | 2 - node_modules/core-js/library/es7/index.js | 56 - node_modules/core-js/library/es7/map.js | 4 - node_modules/core-js/library/es7/math.js | 13 - node_modules/core-js/library/es7/object.js | 8 - .../core-js/library/es7/observable.js | 7 - node_modules/core-js/library/es7/promise.js | 3 - node_modules/core-js/library/es7/reflect.js | 10 - node_modules/core-js/library/es7/set.js | 4 - node_modules/core-js/library/es7/string.js | 7 - node_modules/core-js/library/es7/symbol.js | 3 - node_modules/core-js/library/es7/system.js | 2 - node_modules/core-js/library/es7/weak-map.js | 3 - node_modules/core-js/library/es7/weak-set.js | 3 - node_modules/core-js/library/fn/_.js | 2 - .../core-js/library/fn/array/concat.js | 4 - .../core-js/library/fn/array/copy-within.js | 2 - .../core-js/library/fn/array/entries.js | 2 - .../core-js/library/fn/array/every.js | 2 - node_modules/core-js/library/fn/array/fill.js | 2 - .../core-js/library/fn/array/filter.js | 2 - .../core-js/library/fn/array/find-index.js | 2 - node_modules/core-js/library/fn/array/find.js | 2 - .../core-js/library/fn/array/flat-map.js | 2 - .../core-js/library/fn/array/flatten.js | 2 - .../core-js/library/fn/array/for-each.js | 2 - node_modules/core-js/library/fn/array/from.js | 3 - .../core-js/library/fn/array/includes.js | 2 - .../core-js/library/fn/array/index-of.js | 2 - .../core-js/library/fn/array/index.js | 26 - .../core-js/library/fn/array/is-array.js | 2 - .../core-js/library/fn/array/iterator.js | 2 - node_modules/core-js/library/fn/array/join.js | 2 - node_modules/core-js/library/fn/array/keys.js | 2 - .../core-js/library/fn/array/last-index-of.js | 2 - node_modules/core-js/library/fn/array/map.js | 2 - node_modules/core-js/library/fn/array/of.js | 2 - node_modules/core-js/library/fn/array/pop.js | 4 - node_modules/core-js/library/fn/array/push.js | 4 - .../core-js/library/fn/array/reduce-right.js | 2 - .../core-js/library/fn/array/reduce.js | 2 - .../core-js/library/fn/array/reverse.js | 4 - .../core-js/library/fn/array/shift.js | 4 - .../core-js/library/fn/array/slice.js | 2 - node_modules/core-js/library/fn/array/some.js | 2 - node_modules/core-js/library/fn/array/sort.js | 2 - .../core-js/library/fn/array/splice.js | 4 - .../core-js/library/fn/array/unshift.js | 4 - .../core-js/library/fn/array/values.js | 2 - .../library/fn/array/virtual/copy-within.js | 2 - .../library/fn/array/virtual/entries.js | 2 - .../core-js/library/fn/array/virtual/every.js | 2 - .../core-js/library/fn/array/virtual/fill.js | 2 - .../library/fn/array/virtual/filter.js | 2 - .../library/fn/array/virtual/find-index.js | 2 - .../core-js/library/fn/array/virtual/find.js | 2 - .../library/fn/array/virtual/flat-map.js | 2 - .../library/fn/array/virtual/flatten.js | 2 - .../library/fn/array/virtual/for-each.js | 2 - .../library/fn/array/virtual/includes.js | 2 - .../library/fn/array/virtual/index-of.js | 2 - .../core-js/library/fn/array/virtual/index.js | 20 - .../library/fn/array/virtual/iterator.js | 2 - .../core-js/library/fn/array/virtual/join.js | 2 - .../core-js/library/fn/array/virtual/keys.js | 2 - .../library/fn/array/virtual/last-index-of.js | 2 - .../core-js/library/fn/array/virtual/map.js | 2 - .../library/fn/array/virtual/reduce-right.js | 2 - .../library/fn/array/virtual/reduce.js | 2 - .../core-js/library/fn/array/virtual/slice.js | 2 - .../core-js/library/fn/array/virtual/some.js | 2 - .../core-js/library/fn/array/virtual/sort.js | 2 - .../library/fn/array/virtual/values.js | 2 - node_modules/core-js/library/fn/asap.js | 2 - .../core-js/library/fn/clear-immediate.js | 2 - node_modules/core-js/library/fn/date/index.js | 6 - node_modules/core-js/library/fn/date/now.js | 2 - .../core-js/library/fn/date/to-iso-string.js | 3 - .../core-js/library/fn/date/to-json.js | 2 - .../core-js/library/fn/date/to-primitive.js | 5 - .../core-js/library/fn/date/to-string.js | 5 - node_modules/core-js/library/fn/delay.js | 2 - node_modules/core-js/library/fn/dict.js | 2 - .../library/fn/dom-collections/index.js | 8 - .../library/fn/dom-collections/iterator.js | 2 - .../core-js/library/fn/error/index.js | 2 - .../core-js/library/fn/error/is-error.js | 2 - .../core-js/library/fn/function/bind.js | 2 - .../library/fn/function/has-instance.js | 2 - .../core-js/library/fn/function/index.js | 5 - .../core-js/library/fn/function/name.js | 1 - .../core-js/library/fn/function/part.js | 2 - .../library/fn/function/virtual/bind.js | 2 - .../library/fn/function/virtual/index.js | 3 - .../library/fn/function/virtual/part.js | 2 - .../core-js/library/fn/get-iterator-method.js | 3 - .../core-js/library/fn/get-iterator.js | 3 - node_modules/core-js/library/fn/global.js | 2 - .../core-js/library/fn/is-iterable.js | 3 - node_modules/core-js/library/fn/json/index.js | 2 - .../core-js/library/fn/json/stringify.js | 5 - node_modules/core-js/library/fn/map.js | 8 - node_modules/core-js/library/fn/map/from.js | 8 - node_modules/core-js/library/fn/map/index.js | 8 - node_modules/core-js/library/fn/map/of.js | 8 - node_modules/core-js/library/fn/math/acosh.js | 2 - node_modules/core-js/library/fn/math/asinh.js | 2 - node_modules/core-js/library/fn/math/atanh.js | 2 - node_modules/core-js/library/fn/math/cbrt.js | 2 - node_modules/core-js/library/fn/math/clamp.js | 2 - node_modules/core-js/library/fn/math/clz32.js | 2 - node_modules/core-js/library/fn/math/cosh.js | 2 - .../core-js/library/fn/math/deg-per-rad.js | 2 - .../core-js/library/fn/math/degrees.js | 2 - node_modules/core-js/library/fn/math/expm1.js | 2 - .../core-js/library/fn/math/fround.js | 2 - .../core-js/library/fn/math/fscale.js | 2 - node_modules/core-js/library/fn/math/hypot.js | 2 - node_modules/core-js/library/fn/math/iaddh.js | 2 - node_modules/core-js/library/fn/math/imul.js | 2 - node_modules/core-js/library/fn/math/imulh.js | 2 - node_modules/core-js/library/fn/math/index.js | 30 - node_modules/core-js/library/fn/math/isubh.js | 2 - node_modules/core-js/library/fn/math/log10.js | 2 - node_modules/core-js/library/fn/math/log1p.js | 2 - node_modules/core-js/library/fn/math/log2.js | 2 - .../core-js/library/fn/math/rad-per-deg.js | 2 - .../core-js/library/fn/math/radians.js | 2 - node_modules/core-js/library/fn/math/scale.js | 2 - node_modules/core-js/library/fn/math/sign.js | 2 - .../core-js/library/fn/math/signbit.js | 3 - node_modules/core-js/library/fn/math/sinh.js | 2 - node_modules/core-js/library/fn/math/tanh.js | 2 - node_modules/core-js/library/fn/math/trunc.js | 2 - node_modules/core-js/library/fn/math/umulh.js | 2 - .../core-js/library/fn/number/constructor.js | 2 - .../core-js/library/fn/number/epsilon.js | 2 - .../core-js/library/fn/number/index.js | 14 - .../core-js/library/fn/number/is-finite.js | 2 - .../core-js/library/fn/number/is-integer.js | 2 - .../core-js/library/fn/number/is-nan.js | 2 - .../library/fn/number/is-safe-integer.js | 2 - .../core-js/library/fn/number/iterator.js | 5 - .../library/fn/number/max-safe-integer.js | 2 - .../library/fn/number/min-safe-integer.js | 2 - .../core-js/library/fn/number/parse-float.js | 2 - .../core-js/library/fn/number/parse-int.js | 2 - .../core-js/library/fn/number/to-fixed.js | 2 - .../core-js/library/fn/number/to-precision.js | 2 - .../library/fn/number/virtual/index.js | 4 - .../library/fn/number/virtual/iterator.js | 2 - .../library/fn/number/virtual/to-fixed.js | 2 - .../library/fn/number/virtual/to-precision.js | 2 - .../core-js/library/fn/object/assign.js | 2 - .../core-js/library/fn/object/classof.js | 2 - .../core-js/library/fn/object/create.js | 5 - .../library/fn/object/define-getter.js | 2 - .../library/fn/object/define-properties.js | 5 - .../library/fn/object/define-property.js | 5 - .../library/fn/object/define-setter.js | 2 - .../core-js/library/fn/object/define.js | 2 - .../core-js/library/fn/object/entries.js | 2 - .../core-js/library/fn/object/freeze.js | 2 - .../fn/object/get-own-property-descriptor.js | 5 - .../fn/object/get-own-property-descriptors.js | 2 - .../fn/object/get-own-property-names.js | 5 - .../fn/object/get-own-property-symbols.js | 2 - .../library/fn/object/get-prototype-of.js | 2 - .../core-js/library/fn/object/index.js | 30 - .../library/fn/object/is-extensible.js | 2 - .../core-js/library/fn/object/is-frozen.js | 2 - .../core-js/library/fn/object/is-object.js | 2 - .../core-js/library/fn/object/is-sealed.js | 2 - node_modules/core-js/library/fn/object/is.js | 2 - .../core-js/library/fn/object/keys.js | 2 - .../library/fn/object/lookup-getter.js | 2 - .../library/fn/object/lookup-setter.js | 2 - .../core-js/library/fn/object/make.js | 2 - .../library/fn/object/prevent-extensions.js | 2 - .../core-js/library/fn/object/seal.js | 2 - .../library/fn/object/set-prototype-of.js | 2 - .../core-js/library/fn/object/values.js | 2 - node_modules/core-js/library/fn/observable.js | 7 - .../core-js/library/fn/parse-float.js | 2 - node_modules/core-js/library/fn/parse-int.js | 2 - node_modules/core-js/library/fn/promise.js | 7 - .../core-js/library/fn/promise/finally.js | 4 - .../core-js/library/fn/promise/index.js | 7 - .../core-js/library/fn/promise/try.js | 8 - .../core-js/library/fn/reflect/apply.js | 2 - .../core-js/library/fn/reflect/construct.js | 2 - .../library/fn/reflect/define-metadata.js | 2 - .../library/fn/reflect/define-property.js | 2 - .../library/fn/reflect/delete-metadata.js | 2 - .../library/fn/reflect/delete-property.js | 2 - .../core-js/library/fn/reflect/enumerate.js | 2 - .../library/fn/reflect/get-metadata-keys.js | 2 - .../library/fn/reflect/get-metadata.js | 2 - .../fn/reflect/get-own-metadata-keys.js | 2 - .../library/fn/reflect/get-own-metadata.js | 2 - .../fn/reflect/get-own-property-descriptor.js | 2 - .../library/fn/reflect/get-prototype-of.js | 2 - .../core-js/library/fn/reflect/get.js | 2 - .../library/fn/reflect/has-metadata.js | 2 - .../library/fn/reflect/has-own-metadata.js | 2 - .../core-js/library/fn/reflect/has.js | 2 - .../core-js/library/fn/reflect/index.js | 24 - .../library/fn/reflect/is-extensible.js | 2 - .../core-js/library/fn/reflect/metadata.js | 2 - .../core-js/library/fn/reflect/own-keys.js | 2 - .../library/fn/reflect/prevent-extensions.js | 2 - .../library/fn/reflect/set-prototype-of.js | 2 - .../core-js/library/fn/reflect/set.js | 2 - .../core-js/library/fn/regexp/constructor.js | 2 - .../core-js/library/fn/regexp/escape.js | 2 - .../core-js/library/fn/regexp/flags.js | 5 - .../core-js/library/fn/regexp/index.js | 9 - .../core-js/library/fn/regexp/match.js | 5 - .../core-js/library/fn/regexp/replace.js | 5 - .../core-js/library/fn/regexp/search.js | 5 - .../core-js/library/fn/regexp/split.js | 5 - .../core-js/library/fn/regexp/to-string.js | 5 - .../core-js/library/fn/set-immediate.js | 2 - .../core-js/library/fn/set-interval.js | 2 - .../core-js/library/fn/set-timeout.js | 2 - node_modules/core-js/library/fn/set.js | 8 - node_modules/core-js/library/fn/set/from.js | 8 - node_modules/core-js/library/fn/set/index.js | 8 - node_modules/core-js/library/fn/set/of.js | 8 - .../core-js/library/fn/string/anchor.js | 2 - node_modules/core-js/library/fn/string/at.js | 2 - node_modules/core-js/library/fn/string/big.js | 2 - .../core-js/library/fn/string/blink.js | 2 - .../core-js/library/fn/string/bold.js | 2 - .../library/fn/string/code-point-at.js | 2 - .../core-js/library/fn/string/ends-with.js | 2 - .../core-js/library/fn/string/escape-html.js | 2 - .../core-js/library/fn/string/fixed.js | 2 - .../core-js/library/fn/string/fontcolor.js | 2 - .../core-js/library/fn/string/fontsize.js | 2 - .../library/fn/string/from-code-point.js | 2 - .../core-js/library/fn/string/includes.js | 2 - .../core-js/library/fn/string/index.js | 35 - .../core-js/library/fn/string/italics.js | 2 - .../core-js/library/fn/string/iterator.js | 5 - .../core-js/library/fn/string/link.js | 2 - .../core-js/library/fn/string/match-all.js | 2 - .../core-js/library/fn/string/pad-end.js | 2 - .../core-js/library/fn/string/pad-start.js | 2 - node_modules/core-js/library/fn/string/raw.js | 2 - .../core-js/library/fn/string/repeat.js | 2 - .../core-js/library/fn/string/small.js | 2 - .../core-js/library/fn/string/starts-with.js | 2 - .../core-js/library/fn/string/strike.js | 2 - node_modules/core-js/library/fn/string/sub.js | 2 - node_modules/core-js/library/fn/string/sup.js | 2 - .../core-js/library/fn/string/trim-end.js | 2 - .../core-js/library/fn/string/trim-left.js | 2 - .../core-js/library/fn/string/trim-right.js | 2 - .../core-js/library/fn/string/trim-start.js | 2 - .../core-js/library/fn/string/trim.js | 2 - .../library/fn/string/unescape-html.js | 2 - .../library/fn/string/virtual/anchor.js | 2 - .../core-js/library/fn/string/virtual/at.js | 2 - .../core-js/library/fn/string/virtual/big.js | 2 - .../library/fn/string/virtual/blink.js | 2 - .../core-js/library/fn/string/virtual/bold.js | 2 - .../fn/string/virtual/code-point-at.js | 2 - .../library/fn/string/virtual/ends-with.js | 2 - .../library/fn/string/virtual/escape-html.js | 2 - .../library/fn/string/virtual/fixed.js | 2 - .../library/fn/string/virtual/fontcolor.js | 2 - .../library/fn/string/virtual/fontsize.js | 2 - .../library/fn/string/virtual/includes.js | 2 - .../library/fn/string/virtual/index.js | 33 - .../library/fn/string/virtual/italics.js | 2 - .../library/fn/string/virtual/iterator.js | 2 - .../core-js/library/fn/string/virtual/link.js | 2 - .../library/fn/string/virtual/match-all.js | 2 - .../library/fn/string/virtual/pad-end.js | 2 - .../library/fn/string/virtual/pad-start.js | 2 - .../library/fn/string/virtual/repeat.js | 2 - .../library/fn/string/virtual/small.js | 2 - .../library/fn/string/virtual/starts-with.js | 2 - .../library/fn/string/virtual/strike.js | 2 - .../core-js/library/fn/string/virtual/sub.js | 2 - .../core-js/library/fn/string/virtual/sup.js | 2 - .../library/fn/string/virtual/trim-end.js | 2 - .../library/fn/string/virtual/trim-left.js | 2 - .../library/fn/string/virtual/trim-right.js | 2 - .../library/fn/string/virtual/trim-start.js | 2 - .../core-js/library/fn/string/virtual/trim.js | 2 - .../fn/string/virtual/unescape-html.js | 2 - .../library/fn/symbol/async-iterator.js | 2 - node_modules/core-js/library/fn/symbol/for.js | 2 - .../core-js/library/fn/symbol/has-instance.js | 2 - .../core-js/library/fn/symbol/index.js | 5 - .../library/fn/symbol/is-concat-spreadable.js | 1 - .../core-js/library/fn/symbol/iterator.js | 3 - .../core-js/library/fn/symbol/key-for.js | 2 - .../core-js/library/fn/symbol/match.js | 2 - .../core-js/library/fn/symbol/observable.js | 2 - .../core-js/library/fn/symbol/replace.js | 2 - .../core-js/library/fn/symbol/search.js | 2 - .../core-js/library/fn/symbol/species.js | 1 - .../core-js/library/fn/symbol/split.js | 2 - .../core-js/library/fn/symbol/to-primitive.js | 1 - .../library/fn/symbol/to-string-tag.js | 2 - .../core-js/library/fn/symbol/unscopables.js | 1 - .../core-js/library/fn/system/global.js | 2 - .../core-js/library/fn/system/index.js | 2 - .../core-js/library/fn/typed/array-buffer.js | 3 - .../core-js/library/fn/typed/data-view.js | 3 - .../core-js/library/fn/typed/float32-array.js | 2 - .../core-js/library/fn/typed/float64-array.js | 2 - .../core-js/library/fn/typed/index.js | 13 - .../core-js/library/fn/typed/int16-array.js | 2 - .../core-js/library/fn/typed/int32-array.js | 2 - .../core-js/library/fn/typed/int8-array.js | 2 - .../core-js/library/fn/typed/uint16-array.js | 2 - .../core-js/library/fn/typed/uint32-array.js | 2 - .../core-js/library/fn/typed/uint8-array.js | 2 - .../library/fn/typed/uint8-clamped-array.js | 2 - node_modules/core-js/library/fn/weak-map.js | 6 - .../core-js/library/fn/weak-map/from.js | 8 - .../core-js/library/fn/weak-map/index.js | 6 - .../core-js/library/fn/weak-map/of.js | 8 - node_modules/core-js/library/fn/weak-set.js | 6 - .../core-js/library/fn/weak-set/from.js | 8 - .../core-js/library/fn/weak-set/index.js | 6 - .../core-js/library/fn/weak-set/of.js | 8 - node_modules/core-js/library/index.js | 16 - .../core-js/library/modules/_a-function.js | 4 - .../library/modules/_a-number-value.js | 5 - .../library/modules/_add-to-unscopables.js | 1 - .../core-js/library/modules/_an-instance.js | 5 - .../core-js/library/modules/_an-object.js | 5 - .../library/modules/_array-copy-within.js | 26 - .../core-js/library/modules/_array-fill.js | 15 - .../library/modules/_array-from-iterable.js | 7 - .../library/modules/_array-includes.js | 23 - .../core-js/library/modules/_array-methods.js | 44 - .../core-js/library/modules/_array-reduce.js | 28 - .../modules/_array-species-constructor.js | 16 - .../library/modules/_array-species-create.js | 6 - node_modules/core-js/library/modules/_bind.js | 25 - .../core-js/library/modules/_classof.js | 23 - node_modules/core-js/library/modules/_cof.js | 5 - .../library/modules/_collection-strong.js | 144 - .../library/modules/_collection-to-json.js | 9 - .../library/modules/_collection-weak.js | 85 - .../core-js/library/modules/_collection.js | 59 - node_modules/core-js/library/modules/_core.js | 2 - .../library/modules/_create-property.js | 8 - node_modules/core-js/library/modules/_ctx.js | 20 - .../library/modules/_date-to-iso-string.js | 26 - .../library/modules/_date-to-primitive.js | 9 - .../core-js/library/modules/_defined.js | 5 - .../core-js/library/modules/_descriptors.js | 4 - .../core-js/library/modules/_dom-create.js | 7 - .../core-js/library/modules/_entry-virtual.js | 5 - .../core-js/library/modules/_enum-bug-keys.js | 4 - .../core-js/library/modules/_enum-keys.js | 15 - .../core-js/library/modules/_export.js | 62 - .../library/modules/_fails-is-regexp.js | 12 - .../core-js/library/modules/_fails.js | 7 - .../core-js/library/modules/_fix-re-wks.js | 28 - .../core-js/library/modules/_flags.js | 13 - .../library/modules/_flatten-into-array.js | 39 - .../core-js/library/modules/_for-of.js | 25 - .../core-js/library/modules/_global.js | 6 - node_modules/core-js/library/modules/_has.js | 4 - node_modules/core-js/library/modules/_hide.js | 8 - node_modules/core-js/library/modules/_html.js | 2 - .../library/modules/_ie8-dom-define.js | 3 - .../library/modules/_inherit-if-required.js | 9 - .../core-js/library/modules/_invoke.js | 16 - .../core-js/library/modules/_iobject.js | 6 - .../core-js/library/modules/_is-array-iter.js | 8 - .../core-js/library/modules/_is-array.js | 5 - .../core-js/library/modules/_is-integer.js | 6 - .../core-js/library/modules/_is-object.js | 3 - .../core-js/library/modules/_is-regexp.js | 8 - .../core-js/library/modules/_iter-call.js | 12 - .../core-js/library/modules/_iter-create.js | 13 - .../core-js/library/modules/_iter-define.js | 69 - .../core-js/library/modules/_iter-detect.js | 22 - .../core-js/library/modules/_iter-step.js | 3 - .../core-js/library/modules/_iterators.js | 1 - .../core-js/library/modules/_keyof.js | 10 - .../core-js/library/modules/_library.js | 1 - .../core-js/library/modules/_math-expm1.js | 10 - .../core-js/library/modules/_math-fround.js | 23 - .../core-js/library/modules/_math-log1p.js | 4 - .../core-js/library/modules/_math-scale.js | 18 - .../core-js/library/modules/_math-sign.js | 5 - node_modules/core-js/library/modules/_meta.js | 53 - .../core-js/library/modules/_metadata.js | 51 - .../core-js/library/modules/_microtask.js | 69 - .../modules/_new-promise-capability.js | 18 - .../core-js/library/modules/_object-assign.js | 34 - .../core-js/library/modules/_object-create.js | 41 - .../core-js/library/modules/_object-define.js | 13 - .../core-js/library/modules/_object-dp.js | 16 - .../core-js/library/modules/_object-dps.js | 13 - .../library/modules/_object-forced-pam.js | 9 - .../core-js/library/modules/_object-gopd.js | 16 - .../library/modules/_object-gopn-ext.js | 19 - .../core-js/library/modules/_object-gopn.js | 7 - .../core-js/library/modules/_object-gops.js | 1 - .../core-js/library/modules/_object-gpo.js | 13 - .../library/modules/_object-keys-internal.js | 17 - .../core-js/library/modules/_object-keys.js | 7 - .../core-js/library/modules/_object-pie.js | 1 - .../core-js/library/modules/_object-sap.js | 10 - .../library/modules/_object-to-array.js | 16 - .../core-js/library/modules/_own-keys.js | 10 - .../core-js/library/modules/_parse-float.js | 8 - .../core-js/library/modules/_parse-int.js | 9 - .../core-js/library/modules/_partial.js | 25 - node_modules/core-js/library/modules/_path.js | 1 - .../core-js/library/modules/_perform.js | 7 - .../library/modules/_promise-resolve.js | 12 - .../core-js/library/modules/_property-desc.js | 8 - .../core-js/library/modules/_redefine-all.js | 7 - .../core-js/library/modules/_redefine.js | 1 - .../core-js/library/modules/_replacer.js | 8 - .../core-js/library/modules/_same-value.js | 5 - .../library/modules/_set-collection-from.js | 28 - .../library/modules/_set-collection-of.js | 12 - .../core-js/library/modules/_set-proto.js | 25 - .../core-js/library/modules/_set-species.js | 14 - .../library/modules/_set-to-string-tag.js | 7 - .../core-js/library/modules/_shared-key.js | 5 - .../core-js/library/modules/_shared.js | 12 - .../library/modules/_species-constructor.js | 9 - .../core-js/library/modules/_strict-method.js | 9 - .../core-js/library/modules/_string-at.js | 17 - .../library/modules/_string-context.js | 8 - .../core-js/library/modules/_string-html.js | 19 - .../core-js/library/modules/_string-pad.js | 16 - .../core-js/library/modules/_string-repeat.js | 12 - .../core-js/library/modules/_string-trim.js | 30 - .../core-js/library/modules/_string-ws.js | 2 - node_modules/core-js/library/modules/_task.js | 84 - .../library/modules/_to-absolute-index.js | 7 - .../core-js/library/modules/_to-index.js | 10 - .../core-js/library/modules/_to-integer.js | 6 - .../core-js/library/modules/_to-iobject.js | 6 - .../core-js/library/modules/_to-length.js | 6 - .../core-js/library/modules/_to-object.js | 5 - .../core-js/library/modules/_to-primitive.js | 12 - .../core-js/library/modules/_typed-array.js | 480 - .../core-js/library/modules/_typed-buffer.js | 276 - .../core-js/library/modules/_typed.js | 28 - node_modules/core-js/library/modules/_uid.js | 5 - .../core-js/library/modules/_user-agent.js | 4 - .../library/modules/_validate-collection.js | 5 - .../core-js/library/modules/_wks-define.js | 9 - .../core-js/library/modules/_wks-ext.js | 1 - node_modules/core-js/library/modules/_wks.js | 11 - .../core-js/library/modules/core.delay.js | 12 - .../core-js/library/modules/core.dict.js | 157 - .../library/modules/core.function.part.js | 7 - .../modules/core.get-iterator-method.js | 8 - .../library/modules/core.get-iterator.js | 7 - .../library/modules/core.is-iterable.js | 10 - .../library/modules/core.number.iterator.js | 9 - .../library/modules/core.object.classof.js | 3 - .../library/modules/core.object.define.js | 4 - .../library/modules/core.object.is-object.js | 3 - .../library/modules/core.object.make.js | 9 - .../library/modules/core.regexp.escape.js | 5 - .../modules/core.string.escape-html.js | 11 - .../modules/core.string.unescape-html.js | 11 - node_modules/core-js/library/modules/es5.js | 35 - .../library/modules/es6.array.copy-within.js | 6 - .../library/modules/es6.array.every.js | 10 - .../core-js/library/modules/es6.array.fill.js | 6 - .../library/modules/es6.array.filter.js | 10 - .../library/modules/es6.array.find-index.js | 14 - .../core-js/library/modules/es6.array.find.js | 14 - .../library/modules/es6.array.for-each.js | 11 - .../core-js/library/modules/es6.array.from.js | 37 - .../library/modules/es6.array.index-of.js | 15 - .../library/modules/es6.array.is-array.js | 4 - .../library/modules/es6.array.iterator.js | 34 - .../core-js/library/modules/es6.array.join.js | 12 - .../modules/es6.array.last-index-of.js | 22 - .../core-js/library/modules/es6.array.map.js | 10 - .../core-js/library/modules/es6.array.of.js | 19 - .../library/modules/es6.array.reduce-right.js | 10 - .../library/modules/es6.array.reduce.js | 10 - .../library/modules/es6.array.slice.js | 28 - .../core-js/library/modules/es6.array.some.js | 10 - .../core-js/library/modules/es6.array.sort.js | 23 - .../library/modules/es6.array.species.js | 1 - .../core-js/library/modules/es6.date.now.js | 4 - .../library/modules/es6.date.to-iso-string.js | 8 - .../library/modules/es6.date.to-json.js | 19 - .../library/modules/es6.date.to-primitive.js | 0 .../library/modules/es6.date.to-string.js | 0 .../library/modules/es6.function.bind.js | 4 - .../modules/es6.function.has-instance.js | 13 - .../library/modules/es6.function.name.js | 0 .../core-js/library/modules/es6.map.js | 19 - .../core-js/library/modules/es6.math.acosh.js | 18 - .../core-js/library/modules/es6.math.asinh.js | 10 - .../core-js/library/modules/es6.math.atanh.js | 10 - .../core-js/library/modules/es6.math.cbrt.js | 9 - .../core-js/library/modules/es6.math.clz32.js | 8 - .../core-js/library/modules/es6.math.cosh.js | 9 - .../core-js/library/modules/es6.math.expm1.js | 5 - .../library/modules/es6.math.fround.js | 4 - .../core-js/library/modules/es6.math.hypot.js | 25 - .../core-js/library/modules/es6.math.imul.js | 17 - .../core-js/library/modules/es6.math.log10.js | 8 - .../core-js/library/modules/es6.math.log1p.js | 4 - .../core-js/library/modules/es6.math.log2.js | 8 - .../core-js/library/modules/es6.math.sign.js | 4 - .../core-js/library/modules/es6.math.sinh.js | 15 - .../core-js/library/modules/es6.math.tanh.js | 12 - .../core-js/library/modules/es6.math.trunc.js | 8 - .../library/modules/es6.number.constructor.js | 0 .../library/modules/es6.number.epsilon.js | 4 - .../library/modules/es6.number.is-finite.js | 9 - .../library/modules/es6.number.is-integer.js | 4 - .../library/modules/es6.number.is-nan.js | 9 - .../modules/es6.number.is-safe-integer.js | 10 - .../modules/es6.number.max-safe-integer.js | 4 - .../modules/es6.number.min-safe-integer.js | 4 - .../library/modules/es6.number.parse-float.js | 4 - .../library/modules/es6.number.parse-int.js | 4 - .../library/modules/es6.number.to-fixed.js | 114 - .../modules/es6.number.to-precision.js | 18 - .../library/modules/es6.object.assign.js | 4 - .../library/modules/es6.object.create.js | 3 - .../modules/es6.object.define-properties.js | 3 - .../modules/es6.object.define-property.js | 3 - .../library/modules/es6.object.freeze.js | 9 - .../es6.object.get-own-property-descriptor.js | 9 - .../es6.object.get-own-property-names.js | 4 - .../modules/es6.object.get-prototype-of.js | 9 - .../modules/es6.object.is-extensible.js | 8 - .../library/modules/es6.object.is-frozen.js | 8 - .../library/modules/es6.object.is-sealed.js | 8 - .../core-js/library/modules/es6.object.is.js | 3 - .../library/modules/es6.object.keys.js | 9 - .../modules/es6.object.prevent-extensions.js | 9 - .../library/modules/es6.object.seal.js | 9 - .../modules/es6.object.set-prototype-of.js | 3 - .../library/modules/es6.object.to-string.js | 0 .../library/modules/es6.parse-float.js | 4 - .../core-js/library/modules/es6.parse-int.js | 4 - .../core-js/library/modules/es6.promise.js | 286 - .../library/modules/es6.reflect.apply.js | 16 - .../library/modules/es6.reflect.construct.js | 47 - .../modules/es6.reflect.define-property.js | 23 - .../modules/es6.reflect.delete-property.js | 11 - .../library/modules/es6.reflect.enumerate.js | 26 - ...es6.reflect.get-own-property-descriptor.js | 10 - .../modules/es6.reflect.get-prototype-of.js | 10 - .../library/modules/es6.reflect.get.js | 21 - .../library/modules/es6.reflect.has.js | 8 - .../modules/es6.reflect.is-extensible.js | 11 - .../library/modules/es6.reflect.own-keys.js | 4 - .../modules/es6.reflect.prevent-extensions.js | 16 - .../modules/es6.reflect.set-prototype-of.js | 15 - .../library/modules/es6.reflect.set.js | 33 - .../library/modules/es6.regexp.constructor.js | 1 - .../library/modules/es6.regexp.flags.js | 0 .../library/modules/es6.regexp.match.js | 0 .../library/modules/es6.regexp.replace.js | 0 .../library/modules/es6.regexp.search.js | 0 .../library/modules/es6.regexp.split.js | 0 .../library/modules/es6.regexp.to-string.js | 0 .../core-js/library/modules/es6.set.js | 14 - .../library/modules/es6.string.anchor.js | 7 - .../core-js/library/modules/es6.string.big.js | 7 - .../library/modules/es6.string.blink.js | 7 - .../library/modules/es6.string.bold.js | 7 - .../modules/es6.string.code-point-at.js | 9 - .../library/modules/es6.string.ends-with.js | 20 - .../library/modules/es6.string.fixed.js | 7 - .../library/modules/es6.string.fontcolor.js | 7 - .../library/modules/es6.string.fontsize.js | 7 - .../modules/es6.string.from-code-point.js | 23 - .../library/modules/es6.string.includes.js | 12 - .../library/modules/es6.string.italics.js | 7 - .../library/modules/es6.string.iterator.js | 17 - .../library/modules/es6.string.link.js | 7 - .../core-js/library/modules/es6.string.raw.js | 18 - .../library/modules/es6.string.repeat.js | 6 - .../library/modules/es6.string.small.js | 7 - .../library/modules/es6.string.starts-with.js | 18 - .../library/modules/es6.string.strike.js | 7 - .../core-js/library/modules/es6.string.sub.js | 7 - .../core-js/library/modules/es6.string.sup.js | 7 - .../library/modules/es6.string.trim.js | 7 - .../core-js/library/modules/es6.symbol.js | 234 - .../library/modules/es6.typed.array-buffer.js | 46 - .../library/modules/es6.typed.data-view.js | 4 - .../modules/es6.typed.float32-array.js | 5 - .../modules/es6.typed.float64-array.js | 5 - .../library/modules/es6.typed.int16-array.js | 5 - .../library/modules/es6.typed.int32-array.js | 5 - .../library/modules/es6.typed.int8-array.js | 5 - .../library/modules/es6.typed.uint16-array.js | 5 - .../library/modules/es6.typed.uint32-array.js | 5 - .../library/modules/es6.typed.uint8-array.js | 5 - .../modules/es6.typed.uint8-clamped-array.js | 5 - .../core-js/library/modules/es6.weak-map.js | 59 - .../core-js/library/modules/es6.weak-set.js | 14 - .../library/modules/es7.array.flat-map.js | 22 - .../library/modules/es7.array.flatten.js | 21 - .../library/modules/es7.array.includes.js | 12 - .../core-js/library/modules/es7.asap.js | 12 - .../library/modules/es7.error.is-error.js | 9 - .../core-js/library/modules/es7.global.js | 4 - .../core-js/library/modules/es7.map.from.js | 2 - .../core-js/library/modules/es7.map.of.js | 2 - .../library/modules/es7.map.to-json.js | 4 - .../core-js/library/modules/es7.math.clamp.js | 8 - .../library/modules/es7.math.deg-per-rad.js | 4 - .../library/modules/es7.math.degrees.js | 9 - .../library/modules/es7.math.fscale.js | 10 - .../core-js/library/modules/es7.math.iaddh.js | 11 - .../core-js/library/modules/es7.math.imulh.js | 16 - .../core-js/library/modules/es7.math.isubh.js | 11 - .../library/modules/es7.math.rad-per-deg.js | 4 - .../library/modules/es7.math.radians.js | 9 - .../core-js/library/modules/es7.math.scale.js | 4 - .../library/modules/es7.math.signbit.js | 7 - .../core-js/library/modules/es7.math.umulh.js | 16 - .../modules/es7.object.define-getter.js | 12 - .../modules/es7.object.define-setter.js | 12 - .../library/modules/es7.object.entries.js | 9 - ...es7.object.get-own-property-descriptors.js | 22 - .../modules/es7.object.lookup-getter.js | 18 - .../modules/es7.object.lookup-setter.js | 18 - .../library/modules/es7.object.values.js | 9 - .../core-js/library/modules/es7.observable.js | 199 - .../library/modules/es7.promise.finally.js | 20 - .../library/modules/es7.promise.try.js | 12 - .../modules/es7.reflect.define-metadata.js | 8 - .../modules/es7.reflect.delete-metadata.js | 15 - .../modules/es7.reflect.get-metadata-keys.js | 19 - .../modules/es7.reflect.get-metadata.js | 17 - .../es7.reflect.get-own-metadata-keys.js | 8 - .../modules/es7.reflect.get-own-metadata.js | 9 - .../modules/es7.reflect.has-metadata.js | 16 - .../modules/es7.reflect.has-own-metadata.js | 9 - .../library/modules/es7.reflect.metadata.js | 15 - .../core-js/library/modules/es7.set.from.js | 2 - .../core-js/library/modules/es7.set.of.js | 2 - .../library/modules/es7.set.to-json.js | 4 - .../core-js/library/modules/es7.string.at.js | 10 - .../library/modules/es7.string.match-all.js | 30 - .../library/modules/es7.string.pad-end.js | 12 - .../library/modules/es7.string.pad-start.js | 12 - .../library/modules/es7.string.trim-left.js | 7 - .../library/modules/es7.string.trim-right.js | 7 - .../modules/es7.symbol.async-iterator.js | 1 - .../library/modules/es7.symbol.observable.js | 1 - .../library/modules/es7.system.global.js | 4 - .../library/modules/es7.weak-map.from.js | 2 - .../library/modules/es7.weak-map.of.js | 2 - .../library/modules/es7.weak-set.from.js | 2 - .../library/modules/es7.weak-set.of.js | 2 - .../library/modules/web.dom.iterable.js | 19 - .../core-js/library/modules/web.immediate.js | 6 - .../core-js/library/modules/web.timers.js | 20 - node_modules/core-js/library/shim.js | 197 - node_modules/core-js/library/stage/0.js | 10 - node_modules/core-js/library/stage/1.js | 23 - node_modules/core-js/library/stage/2.js | 4 - node_modules/core-js/library/stage/3.js | 4 - node_modules/core-js/library/stage/4.js | 11 - node_modules/core-js/library/stage/index.js | 1 - node_modules/core-js/library/stage/pre.js | 10 - .../core-js/library/web/dom-collections.js | 2 - node_modules/core-js/library/web/immediate.js | 2 - node_modules/core-js/library/web/index.js | 4 - node_modules/core-js/library/web/timers.js | 2 - node_modules/core-js/modules/_a-function.js | 4 - .../core-js/modules/_a-number-value.js | 5 - .../core-js/modules/_add-to-unscopables.js | 7 - node_modules/core-js/modules/_an-instance.js | 5 - node_modules/core-js/modules/_an-object.js | 5 - .../core-js/modules/_array-copy-within.js | 26 - node_modules/core-js/modules/_array-fill.js | 15 - .../core-js/modules/_array-from-iterable.js | 7 - .../core-js/modules/_array-includes.js | 23 - .../core-js/modules/_array-methods.js | 44 - node_modules/core-js/modules/_array-reduce.js | 28 - .../modules/_array-species-constructor.js | 16 - .../core-js/modules/_array-species-create.js | 6 - node_modules/core-js/modules/_bind.js | 25 - node_modules/core-js/modules/_classof.js | 23 - node_modules/core-js/modules/_cof.js | 5 - .../core-js/modules/_collection-strong.js | 144 - .../core-js/modules/_collection-to-json.js | 9 - .../core-js/modules/_collection-weak.js | 85 - node_modules/core-js/modules/_collection.js | 85 - node_modules/core-js/modules/_core.js | 2 - .../core-js/modules/_create-property.js | 8 - node_modules/core-js/modules/_ctx.js | 20 - .../core-js/modules/_date-to-iso-string.js | 26 - .../core-js/modules/_date-to-primitive.js | 9 - node_modules/core-js/modules/_defined.js | 5 - node_modules/core-js/modules/_descriptors.js | 4 - node_modules/core-js/modules/_dom-create.js | 7 - .../core-js/modules/_entry-virtual.js | 5 - .../core-js/modules/_enum-bug-keys.js | 4 - node_modules/core-js/modules/_enum-keys.js | 15 - node_modules/core-js/modules/_export.js | 43 - .../core-js/modules/_fails-is-regexp.js | 12 - node_modules/core-js/modules/_fails.js | 7 - node_modules/core-js/modules/_fix-re-wks.js | 28 - node_modules/core-js/modules/_flags.js | 13 - .../core-js/modules/_flatten-into-array.js | 39 - node_modules/core-js/modules/_for-of.js | 25 - node_modules/core-js/modules/_global.js | 6 - node_modules/core-js/modules/_has.js | 4 - node_modules/core-js/modules/_hide.js | 8 - node_modules/core-js/modules/_html.js | 2 - .../core-js/modules/_ie8-dom-define.js | 3 - .../core-js/modules/_inherit-if-required.js | 9 - node_modules/core-js/modules/_invoke.js | 16 - node_modules/core-js/modules/_iobject.js | 6 - .../core-js/modules/_is-array-iter.js | 8 - node_modules/core-js/modules/_is-array.js | 5 - node_modules/core-js/modules/_is-integer.js | 6 - node_modules/core-js/modules/_is-object.js | 3 - node_modules/core-js/modules/_is-regexp.js | 8 - node_modules/core-js/modules/_iter-call.js | 12 - node_modules/core-js/modules/_iter-create.js | 13 - node_modules/core-js/modules/_iter-define.js | 69 - node_modules/core-js/modules/_iter-detect.js | 22 - node_modules/core-js/modules/_iter-step.js | 3 - node_modules/core-js/modules/_iterators.js | 1 - node_modules/core-js/modules/_keyof.js | 10 - node_modules/core-js/modules/_library.js | 1 - node_modules/core-js/modules/_math-expm1.js | 10 - node_modules/core-js/modules/_math-fround.js | 23 - node_modules/core-js/modules/_math-log1p.js | 4 - node_modules/core-js/modules/_math-scale.js | 18 - node_modules/core-js/modules/_math-sign.js | 5 - node_modules/core-js/modules/_meta.js | 53 - node_modules/core-js/modules/_metadata.js | 51 - node_modules/core-js/modules/_microtask.js | 69 - .../modules/_new-promise-capability.js | 18 - .../core-js/modules/_object-assign.js | 34 - .../core-js/modules/_object-create.js | 41 - .../core-js/modules/_object-define.js | 13 - node_modules/core-js/modules/_object-dp.js | 16 - node_modules/core-js/modules/_object-dps.js | 13 - .../core-js/modules/_object-forced-pam.js | 9 - node_modules/core-js/modules/_object-gopd.js | 16 - .../core-js/modules/_object-gopn-ext.js | 19 - node_modules/core-js/modules/_object-gopn.js | 7 - node_modules/core-js/modules/_object-gops.js | 1 - node_modules/core-js/modules/_object-gpo.js | 13 - .../core-js/modules/_object-keys-internal.js | 17 - node_modules/core-js/modules/_object-keys.js | 7 - node_modules/core-js/modules/_object-pie.js | 1 - node_modules/core-js/modules/_object-sap.js | 10 - .../core-js/modules/_object-to-array.js | 16 - node_modules/core-js/modules/_own-keys.js | 10 - node_modules/core-js/modules/_parse-float.js | 8 - node_modules/core-js/modules/_parse-int.js | 9 - node_modules/core-js/modules/_partial.js | 25 - node_modules/core-js/modules/_path.js | 1 - node_modules/core-js/modules/_perform.js | 7 - .../core-js/modules/_promise-resolve.js | 12 - .../core-js/modules/_property-desc.js | 8 - node_modules/core-js/modules/_redefine-all.js | 5 - node_modules/core-js/modules/_redefine.js | 31 - node_modules/core-js/modules/_replacer.js | 8 - node_modules/core-js/modules/_same-value.js | 5 - .../core-js/modules/_set-collection-from.js | 28 - .../core-js/modules/_set-collection-of.js | 12 - node_modules/core-js/modules/_set-proto.js | 25 - node_modules/core-js/modules/_set-species.js | 13 - .../core-js/modules/_set-to-string-tag.js | 7 - node_modules/core-js/modules/_shared-key.js | 5 - node_modules/core-js/modules/_shared.js | 12 - .../core-js/modules/_species-constructor.js | 9 - .../core-js/modules/_strict-method.js | 9 - node_modules/core-js/modules/_string-at.js | 17 - .../core-js/modules/_string-context.js | 8 - node_modules/core-js/modules/_string-html.js | 19 - node_modules/core-js/modules/_string-pad.js | 16 - .../core-js/modules/_string-repeat.js | 12 - node_modules/core-js/modules/_string-trim.js | 30 - node_modules/core-js/modules/_string-ws.js | 2 - node_modules/core-js/modules/_task.js | 84 - .../core-js/modules/_to-absolute-index.js | 7 - node_modules/core-js/modules/_to-index.js | 10 - node_modules/core-js/modules/_to-integer.js | 6 - node_modules/core-js/modules/_to-iobject.js | 6 - node_modules/core-js/modules/_to-length.js | 6 - node_modules/core-js/modules/_to-object.js | 5 - node_modules/core-js/modules/_to-primitive.js | 12 - node_modules/core-js/modules/_typed-array.js | 480 - node_modules/core-js/modules/_typed-buffer.js | 276 - node_modules/core-js/modules/_typed.js | 28 - node_modules/core-js/modules/_uid.js | 5 - node_modules/core-js/modules/_user-agent.js | 4 - .../core-js/modules/_validate-collection.js | 5 - node_modules/core-js/modules/_wks-define.js | 9 - node_modules/core-js/modules/_wks-ext.js | 1 - node_modules/core-js/modules/_wks.js | 11 - node_modules/core-js/modules/core.delay.js | 12 - node_modules/core-js/modules/core.dict.js | 157 - .../core-js/modules/core.function.part.js | 7 - .../modules/core.get-iterator-method.js | 8 - .../core-js/modules/core.get-iterator.js | 7 - .../core-js/modules/core.is-iterable.js | 10 - .../core-js/modules/core.number.iterator.js | 9 - .../core-js/modules/core.object.classof.js | 3 - .../core-js/modules/core.object.define.js | 4 - .../core-js/modules/core.object.is-object.js | 3 - .../core-js/modules/core.object.make.js | 9 - .../core-js/modules/core.regexp.escape.js | 5 - .../modules/core.string.escape-html.js | 11 - .../modules/core.string.unescape-html.js | 11 - node_modules/core-js/modules/es5.js | 35 - .../core-js/modules/es6.array.copy-within.js | 6 - .../core-js/modules/es6.array.every.js | 10 - .../core-js/modules/es6.array.fill.js | 6 - .../core-js/modules/es6.array.filter.js | 10 - .../core-js/modules/es6.array.find-index.js | 14 - .../core-js/modules/es6.array.find.js | 14 - .../core-js/modules/es6.array.for-each.js | 11 - .../core-js/modules/es6.array.from.js | 37 - .../core-js/modules/es6.array.index-of.js | 15 - .../core-js/modules/es6.array.is-array.js | 4 - .../core-js/modules/es6.array.iterator.js | 34 - .../core-js/modules/es6.array.join.js | 12 - .../modules/es6.array.last-index-of.js | 22 - node_modules/core-js/modules/es6.array.map.js | 10 - node_modules/core-js/modules/es6.array.of.js | 19 - .../core-js/modules/es6.array.reduce-right.js | 10 - .../core-js/modules/es6.array.reduce.js | 10 - .../core-js/modules/es6.array.slice.js | 28 - .../core-js/modules/es6.array.some.js | 10 - .../core-js/modules/es6.array.sort.js | 23 - .../core-js/modules/es6.array.species.js | 1 - node_modules/core-js/modules/es6.date.now.js | 4 - .../core-js/modules/es6.date.to-iso-string.js | 8 - .../core-js/modules/es6.date.to-json.js | 16 - .../core-js/modules/es6.date.to-primitive.js | 4 - .../core-js/modules/es6.date.to-string.js | 12 - .../core-js/modules/es6.function.bind.js | 4 - .../modules/es6.function.has-instance.js | 13 - .../core-js/modules/es6.function.name.js | 16 - node_modules/core-js/modules/es6.map.js | 19 - .../core-js/modules/es6.math.acosh.js | 18 - .../core-js/modules/es6.math.asinh.js | 10 - .../core-js/modules/es6.math.atanh.js | 10 - node_modules/core-js/modules/es6.math.cbrt.js | 9 - .../core-js/modules/es6.math.clz32.js | 8 - node_modules/core-js/modules/es6.math.cosh.js | 9 - .../core-js/modules/es6.math.expm1.js | 5 - .../core-js/modules/es6.math.fround.js | 4 - .../core-js/modules/es6.math.hypot.js | 25 - node_modules/core-js/modules/es6.math.imul.js | 17 - .../core-js/modules/es6.math.log10.js | 8 - .../core-js/modules/es6.math.log1p.js | 4 - node_modules/core-js/modules/es6.math.log2.js | 8 - node_modules/core-js/modules/es6.math.sign.js | 4 - node_modules/core-js/modules/es6.math.sinh.js | 15 - node_modules/core-js/modules/es6.math.tanh.js | 12 - .../core-js/modules/es6.math.trunc.js | 8 - .../core-js/modules/es6.number.constructor.js | 69 - .../core-js/modules/es6.number.epsilon.js | 4 - .../core-js/modules/es6.number.is-finite.js | 9 - .../core-js/modules/es6.number.is-integer.js | 4 - .../core-js/modules/es6.number.is-nan.js | 9 - .../modules/es6.number.is-safe-integer.js | 10 - .../modules/es6.number.max-safe-integer.js | 4 - .../modules/es6.number.min-safe-integer.js | 4 - .../core-js/modules/es6.number.parse-float.js | 4 - .../core-js/modules/es6.number.parse-int.js | 4 - .../core-js/modules/es6.number.to-fixed.js | 114 - .../modules/es6.number.to-precision.js | 18 - .../core-js/modules/es6.object.assign.js | 4 - .../core-js/modules/es6.object.create.js | 3 - .../modules/es6.object.define-properties.js | 3 - .../modules/es6.object.define-property.js | 3 - .../core-js/modules/es6.object.freeze.js | 9 - .../es6.object.get-own-property-descriptor.js | 9 - .../es6.object.get-own-property-names.js | 4 - .../modules/es6.object.get-prototype-of.js | 9 - .../modules/es6.object.is-extensible.js | 8 - .../core-js/modules/es6.object.is-frozen.js | 8 - .../core-js/modules/es6.object.is-sealed.js | 8 - node_modules/core-js/modules/es6.object.is.js | 3 - .../core-js/modules/es6.object.keys.js | 9 - .../modules/es6.object.prevent-extensions.js | 9 - .../core-js/modules/es6.object.seal.js | 9 - .../modules/es6.object.set-prototype-of.js | 3 - .../core-js/modules/es6.object.to-string.js | 10 - .../core-js/modules/es6.parse-float.js | 4 - node_modules/core-js/modules/es6.parse-int.js | 4 - node_modules/core-js/modules/es6.promise.js | 286 - .../core-js/modules/es6.reflect.apply.js | 16 - .../core-js/modules/es6.reflect.construct.js | 47 - .../modules/es6.reflect.define-property.js | 23 - .../modules/es6.reflect.delete-property.js | 11 - .../core-js/modules/es6.reflect.enumerate.js | 26 - ...es6.reflect.get-own-property-descriptor.js | 10 - .../modules/es6.reflect.get-prototype-of.js | 10 - .../core-js/modules/es6.reflect.get.js | 21 - .../core-js/modules/es6.reflect.has.js | 8 - .../modules/es6.reflect.is-extensible.js | 11 - .../core-js/modules/es6.reflect.own-keys.js | 4 - .../modules/es6.reflect.prevent-extensions.js | 16 - .../modules/es6.reflect.set-prototype-of.js | 15 - .../core-js/modules/es6.reflect.set.js | 33 - .../core-js/modules/es6.regexp.constructor.js | 43 - .../core-js/modules/es6.regexp.flags.js | 5 - .../core-js/modules/es6.regexp.match.js | 10 - .../core-js/modules/es6.regexp.replace.js | 12 - .../core-js/modules/es6.regexp.search.js | 10 - .../core-js/modules/es6.regexp.split.js | 71 - .../core-js/modules/es6.regexp.to-string.js | 25 - node_modules/core-js/modules/es6.set.js | 14 - .../core-js/modules/es6.string.anchor.js | 7 - .../core-js/modules/es6.string.big.js | 7 - .../core-js/modules/es6.string.blink.js | 7 - .../core-js/modules/es6.string.bold.js | 7 - .../modules/es6.string.code-point-at.js | 9 - .../core-js/modules/es6.string.ends-with.js | 20 - .../core-js/modules/es6.string.fixed.js | 7 - .../core-js/modules/es6.string.fontcolor.js | 7 - .../core-js/modules/es6.string.fontsize.js | 7 - .../modules/es6.string.from-code-point.js | 23 - .../core-js/modules/es6.string.includes.js | 12 - .../core-js/modules/es6.string.italics.js | 7 - .../core-js/modules/es6.string.iterator.js | 17 - .../core-js/modules/es6.string.link.js | 7 - .../core-js/modules/es6.string.raw.js | 18 - .../core-js/modules/es6.string.repeat.js | 6 - .../core-js/modules/es6.string.small.js | 7 - .../core-js/modules/es6.string.starts-with.js | 18 - .../core-js/modules/es6.string.strike.js | 7 - .../core-js/modules/es6.string.sub.js | 7 - .../core-js/modules/es6.string.sup.js | 7 - .../core-js/modules/es6.string.trim.js | 7 - node_modules/core-js/modules/es6.symbol.js | 234 - .../core-js/modules/es6.typed.array-buffer.js | 46 - .../core-js/modules/es6.typed.data-view.js | 4 - .../modules/es6.typed.float32-array.js | 5 - .../modules/es6.typed.float64-array.js | 5 - .../core-js/modules/es6.typed.int16-array.js | 5 - .../core-js/modules/es6.typed.int32-array.js | 5 - .../core-js/modules/es6.typed.int8-array.js | 5 - .../core-js/modules/es6.typed.uint16-array.js | 5 - .../core-js/modules/es6.typed.uint32-array.js | 5 - .../core-js/modules/es6.typed.uint8-array.js | 5 - .../modules/es6.typed.uint8-clamped-array.js | 5 - node_modules/core-js/modules/es6.weak-map.js | 59 - node_modules/core-js/modules/es6.weak-set.js | 14 - .../core-js/modules/es7.array.flat-map.js | 22 - .../core-js/modules/es7.array.flatten.js | 21 - .../core-js/modules/es7.array.includes.js | 12 - node_modules/core-js/modules/es7.asap.js | 12 - .../core-js/modules/es7.error.is-error.js | 9 - node_modules/core-js/modules/es7.global.js | 4 - node_modules/core-js/modules/es7.map.from.js | 2 - node_modules/core-js/modules/es7.map.of.js | 2 - .../core-js/modules/es7.map.to-json.js | 4 - .../core-js/modules/es7.math.clamp.js | 8 - .../core-js/modules/es7.math.deg-per-rad.js | 4 - .../core-js/modules/es7.math.degrees.js | 9 - .../core-js/modules/es7.math.fscale.js | 10 - .../core-js/modules/es7.math.iaddh.js | 11 - .../core-js/modules/es7.math.imulh.js | 16 - .../core-js/modules/es7.math.isubh.js | 11 - .../core-js/modules/es7.math.rad-per-deg.js | 4 - .../core-js/modules/es7.math.radians.js | 9 - .../core-js/modules/es7.math.scale.js | 4 - .../core-js/modules/es7.math.signbit.js | 7 - .../core-js/modules/es7.math.umulh.js | 16 - .../modules/es7.object.define-getter.js | 12 - .../modules/es7.object.define-setter.js | 12 - .../core-js/modules/es7.object.entries.js | 9 - ...es7.object.get-own-property-descriptors.js | 22 - .../modules/es7.object.lookup-getter.js | 18 - .../modules/es7.object.lookup-setter.js | 18 - .../core-js/modules/es7.object.values.js | 9 - .../core-js/modules/es7.observable.js | 199 - .../core-js/modules/es7.promise.finally.js | 20 - .../core-js/modules/es7.promise.try.js | 12 - .../modules/es7.reflect.define-metadata.js | 8 - .../modules/es7.reflect.delete-metadata.js | 15 - .../modules/es7.reflect.get-metadata-keys.js | 19 - .../modules/es7.reflect.get-metadata.js | 17 - .../es7.reflect.get-own-metadata-keys.js | 8 - .../modules/es7.reflect.get-own-metadata.js | 9 - .../modules/es7.reflect.has-metadata.js | 16 - .../modules/es7.reflect.has-own-metadata.js | 9 - .../core-js/modules/es7.reflect.metadata.js | 15 - node_modules/core-js/modules/es7.set.from.js | 2 - node_modules/core-js/modules/es7.set.of.js | 2 - .../core-js/modules/es7.set.to-json.js | 4 - node_modules/core-js/modules/es7.string.at.js | 10 - .../core-js/modules/es7.string.match-all.js | 30 - .../core-js/modules/es7.string.pad-end.js | 12 - .../core-js/modules/es7.string.pad-start.js | 12 - .../core-js/modules/es7.string.trim-left.js | 7 - .../core-js/modules/es7.string.trim-right.js | 7 - .../modules/es7.symbol.async-iterator.js | 1 - .../core-js/modules/es7.symbol.observable.js | 1 - .../core-js/modules/es7.system.global.js | 4 - .../core-js/modules/es7.weak-map.from.js | 2 - .../core-js/modules/es7.weak-map.of.js | 2 - .../core-js/modules/es7.weak-set.from.js | 2 - .../core-js/modules/es7.weak-set.of.js | 2 - .../modules/library/_add-to-unscopables.js | 1 - .../core-js/modules/library/_collection.js | 59 - .../core-js/modules/library/_export.js | 62 - .../core-js/modules/library/_library.js | 1 - node_modules/core-js/modules/library/_path.js | 1 - .../core-js/modules/library/_redefine-all.js | 7 - .../core-js/modules/library/_redefine.js | 1 - .../core-js/modules/library/_set-species.js | 14 - .../modules/library/es6.date.to-json.js | 19 - .../modules/library/es6.date.to-primitive.js | 0 .../modules/library/es6.date.to-string.js | 0 .../modules/library/es6.function.name.js | 0 .../modules/library/es6.number.constructor.js | 0 .../modules/library/es6.object.to-string.js | 0 .../modules/library/es6.regexp.constructor.js | 1 - .../modules/library/es6.regexp.flags.js | 0 .../modules/library/es6.regexp.match.js | 0 .../modules/library/es6.regexp.replace.js | 0 .../modules/library/es6.regexp.search.js | 0 .../modules/library/es6.regexp.split.js | 0 .../modules/library/es6.regexp.to-string.js | 0 .../modules/library/web.dom.iterable.js | 19 - .../core-js/modules/web.dom.iterable.js | 58 - node_modules/core-js/modules/web.immediate.js | 6 - node_modules/core-js/modules/web.timers.js | 20 - node_modules/core-js/package.json | 101 - node_modules/core-js/shim.js | 197 - node_modules/core-js/stage/0.js | 10 - node_modules/core-js/stage/1.js | 23 - node_modules/core-js/stage/2.js | 4 - node_modules/core-js/stage/3.js | 4 - node_modules/core-js/stage/4.js | 11 - node_modules/core-js/stage/index.js | 1 - node_modules/core-js/stage/pre.js | 10 - node_modules/core-js/web/dom-collections.js | 2 - node_modules/core-js/web/immediate.js | 2 - node_modules/core-js/web/index.js | 4 - node_modules/core-js/web/timers.js | 2 - node_modules/core-util-is/LICENSE | 19 - node_modules/core-util-is/README.md | 3 - node_modules/core-util-is/float.patch | 604 - node_modules/core-util-is/lib/util.js | 107 - node_modules/core-util-is/package.json | 64 - node_modules/core-util-is/test.js | 68 - node_modules/create-ecdh/.travis.yml | 7 - node_modules/create-ecdh/LICENSE | 21 - node_modules/create-ecdh/browser.js | 124 - node_modules/create-ecdh/index.js | 3 - node_modules/create-ecdh/package.json | 62 - node_modules/create-ecdh/readme.md | 4 - node_modules/create-hash/.travis.yml | 17 - node_modules/create-hash/LICENSE | 21 - node_modules/create-hash/README.md | 19 - node_modules/create-hash/browser.js | 30 - node_modules/create-hash/index.js | 1 - node_modules/create-hash/md5.js | 5 - node_modules/create-hash/package.json | 70 - node_modules/create-hash/test.js | 41 - node_modules/create-hmac/LICENSE | 21 - node_modules/create-hmac/README.md | 20 - node_modules/create-hmac/browser.js | 62 - node_modules/create-hmac/index.js | 1 - node_modules/create-hmac/legacy.js | 46 - node_modules/create-hmac/package.json | 72 - node_modules/cross-spawn/CHANGELOG.md | 100 - node_modules/cross-spawn/LICENSE | 21 - node_modules/cross-spawn/README.md | 94 - node_modules/cross-spawn/index.js | 39 - node_modules/cross-spawn/lib/enoent.js | 59 - node_modules/cross-spawn/lib/parse.js | 125 - node_modules/cross-spawn/lib/util/escape.js | 45 - .../cross-spawn/lib/util/readShebang.js | 32 - .../cross-spawn/lib/util/resolveCommand.js | 47 - node_modules/cross-spawn/package.json | 107 - node_modules/crypt/LICENSE.mkd | 27 - node_modules/crypt/README.mkd | 1 - node_modules/crypt/crypt.js | 96 - node_modules/crypt/package.json | 52 - node_modules/crypto-browserify/.travis.yml | 27 - node_modules/crypto-browserify/.zuul.yml | 1 - node_modules/crypto-browserify/LICENSE | 24 - node_modules/crypto-browserify/README.md | 50 - .../crypto-browserify/example/bundle.js | 637 - .../crypto-browserify/example/index.html | 12 - .../crypto-browserify/example/test.js | 4 - node_modules/crypto-browserify/index.js | 97 - node_modules/crypto-browserify/package.json | 78 - node_modules/crypto-browserify/test/aes.js | 49 - .../crypto-browserify/test/create-hash.js | 50 - .../crypto-browserify/test/create-hmac.js | 50 - node_modules/crypto-browserify/test/dh.js | 49 - node_modules/crypto-browserify/test/ecdh.js | 61 - node_modules/crypto-browserify/test/index.js | 19 - .../crypto-browserify/test/node/dh.js | 51 - node_modules/crypto-browserify/test/pbkdf2.js | 21 - .../crypto-browserify/test/public-encrypt.js | 36 - .../crypto-browserify/test/random-bytes.js | 60 - .../crypto-browserify/test/random-fill.js | 53 - node_modules/crypto-browserify/test/sign.js | 59 - node_modules/csjs-inject/.npmignore | 2 - node_modules/csjs-inject/LICENSE | 22 - node_modules/csjs-inject/README.md | 3 - node_modules/csjs-inject/csjs.js | 15 - node_modules/csjs-inject/get-css.js | 3 - node_modules/csjs-inject/index.js | 7 - node_modules/csjs-inject/package.json | 55 - node_modules/csjs/.istanbul.yml | 4 - node_modules/csjs/.npmignore | 3 - node_modules/csjs/.travis.yml | 8 - node_modules/csjs/.zuul.yml | 16 - node_modules/csjs/LICENSE | 22 - node_modules/csjs/README.md | 245 - node_modules/csjs/csjs.js | 3 - .../csjs/docs/automatic-vendor-prefixing.md | 10 - node_modules/csjs/docs/comments.md | 37 - node_modules/csjs/docs/keyframe-animations.md | 44 - node_modules/csjs/get-css.js | 3 - node_modules/csjs/index.js | 8 - node_modules/csjs/lib/base62-encode.js | 20 - node_modules/csjs/lib/build-exports.js | 42 - node_modules/csjs/lib/composition.js | 78 - node_modules/csjs/lib/csjs.js | 76 - node_modules/csjs/lib/css-extract-extends.js | 51 - node_modules/csjs/lib/css-key.js | 8 - node_modules/csjs/lib/extract-exports.js | 25 - node_modules/csjs/lib/get-css.js | 7 - node_modules/csjs/lib/hash-string.js | 16 - node_modules/csjs/lib/regex.js | 14 - node_modules/csjs/lib/replace-animations.js | 29 - node_modules/csjs/lib/scoped-name.js | 12 - node_modules/csjs/lib/scopeify.js | 39 - node_modules/csjs/package.json | 73 - .../test/animation-as-pseudo.expected.css | 13 - .../test/animation-as-pseudo.expected.json | 4 - .../animation-as-pseudo.noscope.expected.css | 13 - .../animation-as-pseudo.noscope.expected.json | 4 - .../animation-as-pseudo.noscope.source.js | 16 - .../csjs/test/animation-as-pseudo.source.js | 16 - node_modules/csjs/test/basic.expected.css | 6 - node_modules/csjs/test/basic.expected.json | 3 - .../csjs/test/basic.noscope.expected.css | 6 - .../csjs/test/basic.noscope.expected.json | 3 - .../csjs/test/basic.noscope.source.js | 9 - node_modules/csjs/test/basic.source.js | 9 - node_modules/csjs/test/comments.expected.css | 38 - node_modules/csjs/test/comments.expected.json | 4 - .../csjs/test/comments.noscope.expected.css | 38 - .../csjs/test/comments.noscope.expected.json | 4 - node_modules/csjs/test/comments.source.js | 41 - .../csjs/test/comments.source.noscope.js | 41 - .../csjs/test/dot-in-values.expected.css | 8 - .../csjs/test/dot-in-values.expected.json | 5 - .../test/dot-in-values.noscope.expected.css | 8 - .../test/dot-in-values.noscope.expected.json | 5 - .../csjs/test/dot-in-values.noscope.source.js | 11 - .../csjs/test/dot-in-values.source.js | 11 - .../test/extends-in-media-query.expected.css | 30 - .../test/extends-in-media-query.expected.json | 6 - ...xtends-in-media-query.noscope.expected.css | 30 - ...tends-in-media-query.noscope.expected.json | 6 - .../extends-in-media-query.noscope.source.js | 35 - .../test/extends-in-media-query.source.js | 35 - .../csjs/test/extensions.expected.css | 18 - .../csjs/test/extensions.expected.json | 6 - .../csjs/test/extensions.noscope.expected.css | 18 - .../test/extensions.noscope.expected.json | 6 - .../csjs/test/extensions.noscope.source.js | 21 - node_modules/csjs/test/extensions.source.js | 21 - node_modules/csjs/test/index.js | 84 - .../csjs/test/keyframes-usage.expected.css | 10 - .../csjs/test/keyframes-usage.expected.json | 4 - .../test/keyframes-usage.noscope.expected.css | 10 - .../keyframes-usage.noscope.expected.json | 4 - .../test/keyframes-usage.noscope.source.js | 15 - .../csjs/test/keyframes-usage.source.js | 15 - .../test/keyframes-with-decimal.expected.css | 8 - .../test/keyframes-with-decimal.expected.json | 3 - ...eyframes-with-decimal.noscope.expected.css | 8 - ...yframes-with-decimal.noscope.expected.json | 3 - .../keyframes-with-decimal.noscope.source.js | 11 - .../test/keyframes-with-decimal.source.js | 11 - node_modules/csjs/test/keyframes.expected.css | 20 - .../csjs/test/keyframes.expected.json | 6 - .../csjs/test/keyframes.noscope.expected.css | 20 - .../csjs/test/keyframes.noscope.expected.json | 6 - .../csjs/test/keyframes.noscope.source.js | 23 - node_modules/csjs/test/keyframes.source.js | 23 - .../csjs/test/media-query.expected.css | 12 - .../csjs/test/media-query.expected.json | 3 - .../test/media-query.noscope.expected.css | 12 - .../test/media-query.noscope.expected.json | 3 - .../csjs/test/media-query.noscope.source.js | 15 - node_modules/csjs/test/media-query.source.js | 15 - .../test/multiple-extensions.expected.css | 14 - .../test/multiple-extensions.expected.json | 5 - .../multiple-extensions.noscope.expected.css | 14 - .../multiple-extensions.noscope.expected.json | 5 - .../multiple-extensions.noscope.source.js | 19 - .../csjs/test/multiple-extensions.source.js | 19 - node_modules/csjs/test/non-class.expected.css | 6 - .../csjs/test/non-class.expected.json | 1 - .../csjs/test/non-class.noscope.expected.css | 6 - .../csjs/test/non-class.noscope.expected.json | 1 - .../csjs/test/non-class.noscope.source.js | 9 - node_modules/csjs/test/non-class.source.js | 9 - .../csjs/test/not-pseudo.expected.css | 8 - .../csjs/test/not-pseudo.expected.json | 4 - .../csjs/test/not-pseudo.noscope.expected.css | 8 - .../test/not-pseudo.noscope.expected.json | 4 - .../csjs/test/not-pseudo.noscope.source.js | 11 - node_modules/csjs/test/not-pseudo.source.js | 11 - node_modules/cytoscape/.babelrc | 3 - node_modules/cytoscape/.eslintrc.json | 16 - node_modules/cytoscape/.travis.yml | 9 - node_modules/cytoscape/ISSUE_TEMPLATE.md | 74 - node_modules/cytoscape/LICENSE | 21 - node_modules/cytoscape/README.md | 115 - node_modules/cytoscape/dist/cytoscape.cjs.js | 29144 --------------- node_modules/cytoscape/dist/cytoscape.js | 29906 ---------------- node_modules/cytoscape/dist/cytoscape.min.js | 10 - node_modules/cytoscape/package.json | 171 - node_modules/cytoscape/src/animation.js | 233 - .../src/collection/algorithms/a-star.js | 206 - .../src/collection/algorithms/bellman-ford.js | 192 - .../algorithms/betweenness-centrality.js | 190 - .../src/collection/algorithms/bfs-dfs.js | 130 - .../algorithms/closeness-centrality.js | 128 - .../algorithms/degree-centrality.js | 194 - .../src/collection/algorithms/dijkstra.js | 129 - .../collection/algorithms/floyd-warshall.js | 192 - .../src/collection/algorithms/index.js | 21 - .../src/collection/algorithms/kerger-stein.js | 170 - .../src/collection/algorithms/kruskal.js | 62 - .../src/collection/algorithms/page-rank.js | 179 - .../cytoscape/src/collection/animation.js | 13 - .../cytoscape/src/collection/class.js | 131 - .../cytoscape/src/collection/comparators.js | 90 - .../cytoscape/src/collection/compounds.js | 214 - node_modules/cytoscape/src/collection/data.js | 85 - .../cytoscape/src/collection/degree.js | 119 - .../src/collection/dimensions/bounds.js | 766 - .../src/collection/dimensions/edge-points.js | 23 - .../src/collection/dimensions/index.js | 7 - .../src/collection/dimensions/position.js | 235 - .../src/collection/dimensions/width-height.js | 106 - .../cytoscape/src/collection/element.js | 105 - .../cytoscape/src/collection/events.js | 142 - .../cytoscape/src/collection/filter.js | 368 - .../cytoscape/src/collection/group.js | 28 - .../cytoscape/src/collection/index.js | 731 - .../cytoscape/src/collection/iteration.js | 124 - .../cytoscape/src/collection/layout.js | 193 - .../cytoscape/src/collection/style.js | 443 - .../src/collection/switch-functions.js | 149 - .../cytoscape/src/collection/traversing.js | 440 - .../cytoscape/src/collection/zsort.js | 57 - node_modules/cytoscape/src/core/add-remove.js | 82 - .../src/core/animation/cubic-bezier.js | 158 - .../cytoscape/src/core/animation/ease.js | 78 - .../cytoscape/src/core/animation/easings.js | 76 - .../cytoscape/src/core/animation/index.js | 60 - .../cytoscape/src/core/animation/spring.js | 88 - .../cytoscape/src/core/animation/start.js | 34 - .../cytoscape/src/core/animation/step-all.js | 133 - .../cytoscape/src/core/animation/step.js | 161 - node_modules/cytoscape/src/core/events.js | 93 - node_modules/cytoscape/src/core/export.js | 23 - node_modules/cytoscape/src/core/index.js | 446 - node_modules/cytoscape/src/core/layout.js | 46 - .../cytoscape/src/core/notification.js | 118 - node_modules/cytoscape/src/core/renderer.js | 79 - node_modules/cytoscape/src/core/search.js | 69 - node_modules/cytoscape/src/core/style.js | 36 - node_modules/cytoscape/src/core/viewport.js | 573 - .../cytoscape/src/define/animation.js | 240 - node_modules/cytoscape/src/define/data.js | 194 - node_modules/cytoscape/src/define/events.js | 34 - node_modules/cytoscape/src/define/index.js | 19 - node_modules/cytoscape/src/emitter.js | 226 - node_modules/cytoscape/src/event.js | 111 - node_modules/cytoscape/src/extension.js | 243 - .../cytoscape/src/extensions/index.js | 11 - .../src/extensions/layout/breadthfirst.js | 439 - .../cytoscape/src/extensions/layout/circle.js | 105 - .../src/extensions/layout/concentric.js | 200 - .../cytoscape/src/extensions/layout/cose.js | 1414 - .../cytoscape/src/extensions/layout/grid.js | 247 - .../cytoscape/src/extensions/layout/index.js | 10 - .../cytoscape/src/extensions/layout/null.js | 50 - .../cytoscape/src/extensions/layout/preset.js | 61 - .../cytoscape/src/extensions/layout/random.js | 43 - .../extensions/renderer/base/arrow-shapes.js | 312 - .../renderer/base/coord-ele-math/coords.js | 400 - .../base/coord-ele-math/edge-arrows.js | 179 - .../coord-ele-math/edge-control-points.js | 815 - .../base/coord-ele-math/edge-endpoints.js | 229 - .../base/coord-ele-math/edge-projection.js | 62 - .../renderer/base/coord-ele-math/index.js | 19 - .../renderer/base/coord-ele-math/labels.js | 499 - .../renderer/base/coord-ele-math/nodes.js | 27 - .../base/coord-ele-math/rendered-style.js | 182 - .../base/coord-ele-math/z-ordering.js | 65 - .../src/extensions/renderer/base/images.js | 36 - .../src/extensions/renderer/base/index.js | 210 - .../renderer/base/load-listeners.js | 2085 -- .../extensions/renderer/base/node-shapes.js | 560 - .../src/extensions/renderer/base/redraw.js | 101 - .../renderer/canvas/arrow-shapes.js | 89 - .../renderer/canvas/drawing-edges.js | 293 - .../renderer/canvas/drawing-elements.js | 112 - .../renderer/canvas/drawing-images.js | 148 - .../renderer/canvas/drawing-label-text.js | 351 - .../renderer/canvas/drawing-nodes.js | 377 - .../renderer/canvas/drawing-redraw.js | 579 - .../renderer/canvas/drawing-shapes.js | 168 - .../renderer/canvas/ele-texture-cache.js | 500 - .../renderer/canvas/export-image.js | 154 - .../src/extensions/renderer/canvas/index.js | 171 - .../renderer/canvas/layered-texture-cache.js | 686 - .../extensions/renderer/canvas/node-shapes.js | 20 - .../renderer/canvas/texture-cache-defs.js | 85 - .../src/extensions/renderer/index.js | 5 - .../src/extensions/renderer/null/index.js | 14 - node_modules/cytoscape/src/heap.js | 1 - node_modules/cytoscape/src/index.js | 40 - node_modules/cytoscape/src/is.js | 179 - node_modules/cytoscape/src/map.js | 25 - node_modules/cytoscape/src/math.js | 1109 - node_modules/cytoscape/src/promise.js | 211 - .../cytoscape/src/selector/expressions.js | 230 - node_modules/cytoscape/src/selector/index.js | 200 - .../cytoscape/src/selector/matching.js | 310 - .../cytoscape/src/selector/new-query.js | 27 - node_modules/cytoscape/src/selector/parse.js | 128 - node_modules/cytoscape/src/selector/state.js | 139 - node_modules/cytoscape/src/selector/tokens.js | 46 - node_modules/cytoscape/src/set.js | 59 - node_modules/cytoscape/src/style/apply.js | 671 - node_modules/cytoscape/src/style/bypass.js | 174 - node_modules/cytoscape/src/style/container.js | 26 - .../cytoscape/src/style/get-for-ele.js | 119 - node_modules/cytoscape/src/style/index.js | 181 - node_modules/cytoscape/src/style/json.js | 59 - node_modules/cytoscape/src/style/parse.js | 423 - .../cytoscape/src/style/properties.js | 578 - .../cytoscape/src/style/string-sheet.js | 136 - node_modules/cytoscape/src/stylesheet.js | 96 - node_modules/cytoscape/src/test.js | 14 - node_modules/cytoscape/src/util/colors.js | 291 - node_modules/cytoscape/src/util/index.js | 169 - node_modules/cytoscape/src/util/maps.js | 116 - node_modules/cytoscape/src/util/memoize.js | 37 - node_modules/cytoscape/src/util/regex.js | 22 - node_modules/cytoscape/src/util/sort.js | 20 - node_modules/cytoscape/src/util/strings.js | 32 - node_modules/cytoscape/src/util/timing.js | 42 - node_modules/cytoscape/src/version.js | 1 - node_modules/cytoscape/src/version.json | 1 - node_modules/cytoscape/src/window.js | 1 - node_modules/cytoscape/webpack.config.js | 59 - node_modules/date-now/.npmignore | 14 - node_modules/date-now/.testem.json | 14 - node_modules/date-now/.travis.yml | 4 - node_modules/date-now/LICENCE | 19 - node_modules/date-now/README.md | 45 - node_modules/date-now/index.js | 5 - node_modules/date-now/package.json | 94 - node_modules/date-now/seed.js | 16 - node_modules/date-now/test/index.js | 28 - node_modules/date-now/test/static/index.html | 10 - node_modules/debounce/History.md | 50 - node_modules/debounce/Makefile | 11 - node_modules/debounce/Readme.md | 69 - node_modules/debounce/component.json | 18 - node_modules/debounce/index.js | 70 - node_modules/debounce/package.json | 59 - node_modules/debounce/test.html | 32 - node_modules/debounce/test.js | 170 - node_modules/debug/.coveralls.yml | 1 - node_modules/debug/.eslintrc | 11 - node_modules/debug/.npmignore | 9 - node_modules/debug/.travis.yml | 14 - node_modules/debug/CHANGELOG.md | 362 - node_modules/debug/LICENSE | 19 - node_modules/debug/Makefile | 50 - node_modules/debug/README.md | 312 - node_modules/debug/component.json | 19 - node_modules/debug/karma.conf.js | 70 - node_modules/debug/node.js | 1 - node_modules/debug/package.json | 91 - node_modules/debug/src/browser.js | 185 - node_modules/debug/src/debug.js | 202 - node_modules/debug/src/index.js | 10 - node_modules/debug/src/inspector-log.js | 15 - node_modules/debug/src/node.js | 248 - node_modules/decode-uri-component/index.js | 94 - node_modules/decode-uri-component/license | 21 - .../decode-uri-component/package.json | 69 - node_modules/decode-uri-component/readme.md | 70 - node_modules/default-gateway/LICENSE | 22 - node_modules/default-gateway/README.md | 50 - node_modules/default-gateway/android.js | 46 - node_modules/default-gateway/darwin.js | 48 - node_modules/default-gateway/freebsd.js | 48 - node_modules/default-gateway/index.js | 25 - node_modules/default-gateway/linux.js | 58 - node_modules/default-gateway/openbsd.js | 48 - node_modules/default-gateway/package.json | 85 - node_modules/default-gateway/sunos.js | 48 - node_modules/default-gateway/win32.js | 67 - node_modules/define-property/CHANGELOG.md | 82 - node_modules/define-property/LICENSE | 21 - node_modules/define-property/README.md | 117 - node_modules/define-property/index.js | 38 - .../is-accessor-descriptor/LICENSE | 21 - .../is-accessor-descriptor/README.md | 144 - .../is-accessor-descriptor/index.js | 69 - .../is-accessor-descriptor/package.json | 110 - .../node_modules/is-data-descriptor/LICENSE | 21 - .../node_modules/is-data-descriptor/README.md | 161 - .../node_modules/is-data-descriptor/index.js | 49 - .../is-data-descriptor/package.json | 109 - .../node_modules/is-descriptor/LICENSE | 21 - .../node_modules/is-descriptor/README.md | 193 - .../node_modules/is-descriptor/index.js | 22 - .../node_modules/is-descriptor/package.json | 114 - .../node_modules/isobject/LICENSE | 21 - .../node_modules/isobject/README.md | 122 - .../node_modules/isobject/index.d.ts | 5 - .../node_modules/isobject/index.js | 12 - .../node_modules/isobject/package.json | 119 - .../node_modules/kind-of/CHANGELOG.md | 157 - .../node_modules/kind-of/LICENSE | 21 - .../node_modules/kind-of/README.md | 365 - .../node_modules/kind-of/index.js | 129 - .../node_modules/kind-of/package.json | 145 - node_modules/define-property/package.json | 106 - node_modules/defined/.travis.yml | 4 - node_modules/defined/LICENSE | 18 - node_modules/defined/example/defined.js | 4 - node_modules/defined/index.js | 5 - node_modules/defined/package.json | 94 - node_modules/defined/readme.markdown | 53 - node_modules/defined/test/def.js | 22 - node_modules/defined/test/falsy.js | 9 - node_modules/depd/History.md | 96 - node_modules/depd/LICENSE | 22 - node_modules/depd/Readme.md | 280 - node_modules/depd/index.js | 522 - node_modules/depd/lib/browser/index.js | 77 - .../depd/lib/compat/callsite-tostring.js | 103 - .../depd/lib/compat/event-listener-count.js | 22 - node_modules/depd/lib/compat/index.js | 79 - node_modules/depd/package.json | 77 - node_modules/deps-sort/.travis.yml | 5 - node_modules/deps-sort/LICENSE | 18 - node_modules/deps-sort/bin/cmd.js | 10 - node_modules/deps-sort/example/sort.js | 6 - node_modules/deps-sort/index.js | 122 - node_modules/deps-sort/package.json | 70 - node_modules/deps-sort/readme.markdown | 83 - .../deps-sort/test/dedupe-deps-of-deps.js | 71 - node_modules/deps-sort/test/dedupe.js | 39 - node_modules/deps-sort/test/dedupe_index.js | 56 - node_modules/deps-sort/test/dedupe_undef.js | 37 - node_modules/deps-sort/test/expose.js | 38 - node_modules/deps-sort/test/expose_str.js | 44 - node_modules/deps-sort/test/indexed.js | 38 - node_modules/deps-sort/test/sort.js | 23 - node_modules/des.js/.jscsrc | 46 - node_modules/des.js/.jshintrc | 89 - node_modules/des.js/.npmignore | 2 - node_modules/des.js/README.md | 26 - node_modules/des.js/lib/des.js | 7 - node_modules/des.js/lib/des/cbc.js | 65 - node_modules/des.js/lib/des/cipher.js | 141 - node_modules/des.js/lib/des/des.js | 143 - node_modules/des.js/lib/des/ede.js | 55 - node_modules/des.js/lib/des/utils.js | 256 - node_modules/des.js/package.json | 62 - node_modules/des.js/test/cbc-test.js | 73 - node_modules/des.js/test/des-test.js | 139 - node_modules/des.js/test/ede-test.js | 73 - node_modules/des.js/test/fixtures.js | 5 - node_modules/des.js/test/utils-test.js | 169 - node_modules/destroy/LICENSE | 22 - node_modules/destroy/README.md | 60 - node_modules/destroy/index.js | 75 - node_modules/destroy/package.json | 71 - node_modules/detective/.travis.yml | 15 - node_modules/detective/CHANGELOG.md | 17 - node_modules/detective/LICENSE | 18 - node_modules/detective/bench/detect.js | 7 - .../detective/bench/esprima_v_acorn.txt | 18 - node_modules/detective/bin/detective.js | 11 - node_modules/detective/example/strings.js | 6 - node_modules/detective/example/strings_src.js | 3 - node_modules/detective/index.js | 80 - node_modules/detective/package.json | 68 - node_modules/detective/readme.markdown | 81 - node_modules/detective/test/both.js | 26 - node_modules/detective/test/chained.js | 9 - node_modules/detective/test/complicated.js | 58 - node_modules/detective/test/es6-module.js | 9 - node_modules/detective/test/files/both.js | 4 - node_modules/detective/test/files/chained.js | 5 - .../detective/test/files/es6-module.js | 5 - .../detective/test/files/generators.js | 5 - .../detective/test/files/isrequire.js | 14 - node_modules/detective/test/files/nested.js | 22 - .../detective/test/files/rest-spread.js | 9 - .../test/files/set-in-object-pattern.js | 10 - node_modules/detective/test/files/shebang.js | 5 - .../detective/test/files/sparse-array.js | 3 - node_modules/detective/test/files/strings.js | 13 - node_modules/detective/test/files/word.js | 13 - node_modules/detective/test/files/yield.js | 4 - node_modules/detective/test/generators.js | 9 - node_modules/detective/test/isrequire.js | 20 - node_modules/detective/test/nested.js | 9 - node_modules/detective/test/noargs.js | 26 - node_modules/detective/test/parseopts.js | 62 - node_modules/detective/test/rest-spread.js | 9 - node_modules/detective/test/return.js | 9 - .../detective/test/set-in-object-pattern.js | 12 - node_modules/detective/test/shebang.js | 9 - node_modules/detective/test/sparse-array.js | 14 - node_modules/detective/test/strings.js | 9 - node_modules/detective/test/word.js | 12 - node_modules/detective/test/yield.js | 9 - node_modules/diffie-hellman/.travis.yml | 10 - node_modules/diffie-hellman/LICENSE | 19 - node_modules/diffie-hellman/browser.js | 42 - node_modules/diffie-hellman/index.js | 10 - node_modules/diffie-hellman/lib/dh.js | 164 - .../diffie-hellman/lib/generatePrime.js | 105 - node_modules/diffie-hellman/lib/primes.json | 34 - node_modules/diffie-hellman/package.json | 62 - node_modules/diffie-hellman/readme.md | 4 - node_modules/domain-browser/HISTORY.md | 46 - node_modules/domain-browser/LICENSE.md | 23 - node_modules/domain-browser/README.md | 121 - node_modules/domain-browser/package.json | 172 - node_modules/domain-browser/source/index.js | 70 - node_modules/duplexer2/LICENSE.md | 26 - node_modules/duplexer2/README.md | 115 - node_modules/duplexer2/index.js | 76 - node_modules/duplexer2/package.json | 66 - node_modules/ee-first/LICENSE | 22 - node_modules/ee-first/README.md | 80 - node_modules/ee-first/index.js | 95 - node_modules/ee-first/package.json | 63 - node_modules/elliptic/README.md | 238 - node_modules/elliptic/lib/elliptic.js | 13 - .../elliptic/lib/elliptic/curve/base.js | 375 - .../elliptic/lib/elliptic/curve/edwards.js | 433 - .../elliptic/lib/elliptic/curve/index.js | 8 - .../elliptic/lib/elliptic/curve/mont.js | 180 - .../elliptic/lib/elliptic/curve/short.js | 937 - node_modules/elliptic/lib/elliptic/curves.js | 205 - .../elliptic/lib/elliptic/ec/index.js | 240 - node_modules/elliptic/lib/elliptic/ec/key.js | 119 - .../elliptic/lib/elliptic/ec/signature.js | 135 - .../elliptic/lib/elliptic/eddsa/index.js | 118 - .../elliptic/lib/elliptic/eddsa/key.js | 96 - .../elliptic/lib/elliptic/eddsa/signature.js | 66 - .../lib/elliptic/precomputed/secp256k1.js | 780 - node_modules/elliptic/lib/elliptic/utils.js | 120 - node_modules/elliptic/package.json | 87 - node_modules/encodeurl/HISTORY.md | 14 - node_modules/encodeurl/LICENSE | 22 - node_modules/encodeurl/README.md | 128 - node_modules/encodeurl/index.js | 60 - node_modules/encodeurl/package.json | 76 - node_modules/es6-promisify/LICENSE | 19 - node_modules/es6-promisify/README.md | 93 - node_modules/es6-promisify/dist/promisify.js | 84 - node_modules/es6-promisify/package.json | 73 - node_modules/escape-html/LICENSE | 24 - node_modules/escape-html/Readme.md | 43 - node_modules/escape-html/index.js | 78 - node_modules/escape-html/package.json | 58 - node_modules/escape-string-regexp/index.js | 11 - node_modules/escape-string-regexp/license | 21 - .../escape-string-regexp/package.json | 81 - node_modules/escape-string-regexp/readme.md | 27 - node_modules/etag/HISTORY.md | 83 - node_modules/etag/LICENSE | 22 - node_modules/etag/README.md | 159 - node_modules/etag/index.js | 131 - node_modules/etag/package.json | 85 - node_modules/events/.npmignore | 1 - node_modules/events/.travis.yml | 8 - node_modules/events/.zuul.yml | 12 - node_modules/events/History.md | 42 - node_modules/events/LICENSE | 22 - node_modules/events/Readme.md | 19 - node_modules/events/events.js | 302 - node_modules/events/package.json | 64 - node_modules/events/tests/add-listeners.js | 63 - .../events/tests/check-listener-leaks.js | 86 - node_modules/events/tests/common.js | 42 - node_modules/events/tests/index.js | 25 - node_modules/events/tests/legacy-compat.js | 18 - node_modules/events/tests/listener-count.js | 36 - .../events/tests/listeners-side-effects.js | 55 - node_modules/events/tests/listeners.js | 51 - node_modules/events/tests/max-listeners.js | 50 - node_modules/events/tests/modify-in-emit.js | 76 - node_modules/events/tests/num-args.js | 44 - node_modules/events/tests/once.js | 59 - .../events/tests/remove-all-listeners.js | 80 - node_modules/events/tests/remove-listeners.js | 84 - .../tests/set-max-listeners-side-effects.js | 29 - node_modules/events/tests/subclass.js | 51 - node_modules/evp_bytestokey/LICENSE | 21 - node_modules/evp_bytestokey/README.md | 51 - node_modules/evp_bytestokey/index.js | 45 - node_modules/evp_bytestokey/package.json | 78 - node_modules/execa/index.js | 366 - node_modules/execa/lib/errname.js | 39 - node_modules/execa/lib/stdio.js | 41 - node_modules/execa/license | 9 - node_modules/execa/package.json | 108 - node_modules/execa/readme.md | 304 - node_modules/expand-brackets/LICENSE | 21 - node_modules/expand-brackets/README.md | 107 - node_modules/expand-brackets/index.js | 163 - node_modules/expand-brackets/package.json | 93 - node_modules/expand-range/LICENSE | 24 - node_modules/expand-range/README.md | 145 - node_modules/expand-range/index.js | 43 - node_modules/expand-range/package.json | 104 - node_modules/extend-shallow/LICENSE | 21 - node_modules/extend-shallow/README.md | 97 - node_modules/extend-shallow/index.js | 60 - .../node_modules/is-extendable/LICENSE | 21 - .../node_modules/is-extendable/README.md | 88 - .../node_modules/is-extendable/index.d.ts | 5 - .../node_modules/is-extendable/index.js | 14 - .../node_modules/is-extendable/package.json | 98 - node_modules/extend-shallow/package.json | 126 - node_modules/extglob/LICENSE | 21 - node_modules/extglob/README.md | 88 - node_modules/extglob/index.js | 178 - node_modules/extglob/package.json | 85 - node_modules/filename-regex/LICENSE | 21 - node_modules/filename-regex/README.md | 63 - node_modules/filename-regex/index.js | 10 - node_modules/filename-regex/package.json | 81 - node_modules/fill-range/LICENSE | 21 - node_modules/fill-range/README.md | 317 - node_modules/fill-range/index.js | 408 - node_modules/fill-range/package.json | 109 - node_modules/for-in/LICENSE | 21 - node_modules/for-in/README.md | 85 - node_modules/for-in/index.js | 16 - node_modules/for-in/package.json | 107 - node_modules/for-own/LICENSE | 21 - node_modules/for-own/README.md | 85 - node_modules/for-own/index.js | 19 - node_modules/for-own/package.json | 109 - node_modules/fragment-cache/LICENSE | 21 - node_modules/fragment-cache/README.md | 156 - node_modules/fragment-cache/index.js | 128 - node_modules/fragment-cache/package.json | 93 - node_modules/fresh/HISTORY.md | 70 - node_modules/fresh/LICENSE | 23 - node_modules/fresh/README.md | 119 - node_modules/fresh/index.js | 137 - node_modules/fresh/package.json | 89 - node_modules/from2-string/LICENSE | 21 - node_modules/from2-string/README.md | 44 - node_modules/from2-string/index.js | 19 - node_modules/from2-string/package.json | 68 - node_modules/from2/.travis.yml | 8 - node_modules/from2/LICENSE.md | 21 - node_modules/from2/README.md | 70 - node_modules/from2/index.js | 103 - node_modules/from2/package.json | 69 - node_modules/from2/test.js | 123 - node_modules/fs.realpath/LICENSE | 43 - node_modules/fs.realpath/README.md | 33 - node_modules/fs.realpath/index.js | 66 - node_modules/fs.realpath/old.js | 303 - node_modules/fs.realpath/package.json | 59 - node_modules/function-bind/.editorconfig | 20 - node_modules/function-bind/.eslintrc | 15 - node_modules/function-bind/.jscs.json | 176 - node_modules/function-bind/.npmignore | 22 - node_modules/function-bind/.travis.yml | 168 - node_modules/function-bind/LICENSE | 20 - node_modules/function-bind/README.md | 48 - node_modules/function-bind/implementation.js | 52 - node_modules/function-bind/index.js | 5 - node_modules/function-bind/package.json | 94 - node_modules/function-bind/test/.eslintrc | 9 - node_modules/function-bind/test/index.js | 252 - node_modules/garnish/LICENSE.md | 21 - node_modules/garnish/README.md | 119 - node_modules/garnish/bin/cmd.js | 15 - node_modules/garnish/index.js | 59 - node_modules/garnish/lib/levels.js | 34 - node_modules/garnish/lib/renderer.js | 192 - node_modules/garnish/package.json | 86 - .../get-assigned-identifiers/.travis.yml | 8 - .../get-assigned-identifiers/CHANGELOG.md | 17 - .../get-assigned-identifiers/LICENSE.md | 15 - .../get-assigned-identifiers/README.md | 45 - .../get-assigned-identifiers/index.js | 57 - .../get-assigned-identifiers/package.json | 61 - .../get-assigned-identifiers/test/index.js | 122 - node_modules/get-ports/LICENSE.md | 21 - node_modules/get-ports/README.md | 48 - node_modules/get-ports/index.js | 50 - node_modules/get-ports/package.json | 68 - node_modules/get-stream/buffer-stream.js | 51 - node_modules/get-stream/index.js | 51 - node_modules/get-stream/license | 21 - node_modules/get-stream/package.json | 80 - node_modules/get-stream/readme.md | 117 - node_modules/get-value/LICENSE | 21 - node_modules/get-value/index.js | 50 - node_modules/get-value/package.json | 113 - node_modules/glob-base/LICENSE | 21 - node_modules/glob-base/README.md | 158 - node_modules/glob-base/index.js | 51 - node_modules/glob-base/package.json | 77 - node_modules/glob-parent/.npmignore | 4 - node_modules/glob-parent/.travis.yml | 8 - node_modules/glob-parent/LICENSE | 15 - node_modules/glob-parent/README.md | 43 - node_modules/glob-parent/index.js | 10 - node_modules/glob-parent/package.json | 63 - node_modules/glob-parent/test.js | 28 - node_modules/glob/LICENSE | 15 - node_modules/glob/README.md | 368 - node_modules/glob/changelog.md | 67 - node_modules/glob/common.js | 240 - node_modules/glob/glob.js | 790 - node_modules/glob/package.json | 76 - node_modules/glob/sync.js | 486 - node_modules/graceful-fs/LICENSE | 15 - node_modules/graceful-fs/README.md | 133 - node_modules/graceful-fs/fs.js | 21 - node_modules/graceful-fs/graceful-fs.js | 262 - node_modules/graceful-fs/legacy-streams.js | 118 - node_modules/graceful-fs/package.json | 76 - node_modules/graceful-fs/polyfills.js | 330 - node_modules/has-ansi/cli.js | 53 - node_modules/has-ansi/index.js | 4 - node_modules/has-ansi/package.json | 89 - node_modules/has-ansi/readme.md | 45 - node_modules/has-value/LICENSE | 21 - node_modules/has-value/README.md | 149 - node_modules/has-value/index.js | 16 - .../has-value/node_modules/isobject/LICENSE | 21 - .../has-value/node_modules/isobject/README.md | 122 - .../node_modules/isobject/index.d.ts | 5 - .../has-value/node_modules/isobject/index.js | 12 - .../node_modules/isobject/package.json | 119 - node_modules/has-value/package.json | 120 - node_modules/has-values/LICENSE | 21 - node_modules/has-values/README.md | 129 - node_modules/has-values/index.js | 60 - .../has-values/node_modules/is-number/LICENSE | 21 - .../node_modules/is-number/README.md | 115 - .../node_modules/is-number/index.js | 22 - .../is-number/node_modules/kind-of/LICENSE | 21 - .../is-number/node_modules/kind-of/README.md | 261 - .../is-number/node_modules/kind-of/index.js | 116 - .../node_modules/kind-of/package.json | 139 - .../node_modules/is-number/package.json | 123 - .../has-values/node_modules/kind-of/LICENSE | 21 - .../has-values/node_modules/kind-of/README.md | 267 - .../has-values/node_modules/kind-of/index.js | 119 - .../node_modules/kind-of/package.json | 139 - node_modules/has-values/package.json | 115 - node_modules/has/LICENSE-MIT | 22 - node_modules/has/README.md | 18 - node_modules/has/package.json | 73 - node_modules/has/src/index.js | 5 - node_modules/has/test/index.js | 10 - node_modules/hash-base/LICENSE | 21 - node_modules/hash-base/README.md | 48 - node_modules/hash-base/index.js | 95 - node_modules/hash-base/package.json | 71 - node_modules/hash.js/.eslintrc.js | 41 - node_modules/hash.js/.travis.yml | 9 - node_modules/hash.js/README.md | 48 - node_modules/hash.js/lib/hash.d.ts | 106 - node_modules/hash.js/lib/hash.js | 15 - node_modules/hash.js/lib/hash/common.js | 92 - node_modules/hash.js/lib/hash/hmac.js | 47 - node_modules/hash.js/lib/hash/ripemd.js | 146 - node_modules/hash.js/lib/hash/sha.js | 7 - node_modules/hash.js/lib/hash/sha/1.js | 74 - node_modules/hash.js/lib/hash/sha/224.js | 30 - node_modules/hash.js/lib/hash/sha/256.js | 105 - node_modules/hash.js/lib/hash/sha/384.js | 35 - node_modules/hash.js/lib/hash/sha/512.js | 330 - node_modules/hash.js/lib/hash/sha/common.js | 49 - node_modules/hash.js/lib/hash/utils.js | 253 - node_modules/hash.js/package.json | 64 - node_modules/hash.js/test/hash-test.js | 124 - node_modules/hash.js/test/hmac-test.js | 62 - node_modules/heap/.npmignore | 2 - node_modules/heap/.travis.yml | 4 - node_modules/heap/Makefile | 17 - node_modules/heap/README.md | 211 - node_modules/heap/bower.json | 19 - node_modules/heap/index.js | 1 - node_modules/heap/lib/heap.js | 375 - node_modules/heap/package.json | 63 - node_modules/heap/src/heap.coffee | 218 - node_modules/heap/test/heap.test.coffee | 100 - node_modules/hmac-drbg/.npmignore | 2 - node_modules/hmac-drbg/.travis.yml | 11 - node_modules/hmac-drbg/README.md | 48 - node_modules/hmac-drbg/lib/hmac-drbg.js | 113 - node_modules/hmac-drbg/package.json | 60 - node_modules/hmac-drbg/test/drbg-test.js | 91 - .../test/fixtures/hmac-drbg-nist.json | 332 - node_modules/htmlescape/.npmignore | 4 - node_modules/htmlescape/CHANGELOG.md | 9 - node_modules/htmlescape/LICENSE | 9 - node_modules/htmlescape/README.md | 30 - node_modules/htmlescape/htmlescape.js | 42 - node_modules/htmlescape/package.json | 61 - node_modules/http-errors/HISTORY.md | 132 - node_modules/http-errors/LICENSE | 23 - node_modules/http-errors/README.md | 135 - node_modules/http-errors/index.js | 260 - node_modules/http-errors/package.json | 90 - node_modules/https-browserify/LICENSE | 20 - node_modules/https-browserify/index.js | 31 - node_modules/https-browserify/package.json | 56 - node_modules/https-browserify/readme.markdown | 22 - .../hyperscript-attribute-to-property/LICENSE | 20 - .../README.md | 53 - .../index.js | 19 - .../package.json | 64 - node_modules/hyperx/.travis.yml | 6 - node_modules/hyperx/LICENSE | 23 - node_modules/hyperx/bench/loop.js | 22 - node_modules/hyperx/bench/raw.js | 22 - node_modules/hyperx/example/deku/index.html | 6 - node_modules/hyperx/example/deku/main.js | 23 - node_modules/hyperx/example/deku/package.json | 6 - node_modules/hyperx/example/hyperscript.js | 15 - .../hyperx/example/main_loop/index.html | 6 - node_modules/hyperx/example/main_loop/main.js | 18 - .../hyperx/example/main_loop/package.json | 6 - node_modules/hyperx/example/react.js | 16 - .../hyperx/example/react_browser/index.html | 6 - .../hyperx/example/react_browser/main.js | 18 - .../hyperx/example/react_browser/package.json | 6 - node_modules/hyperx/example/vdom.js | 15 - node_modules/hyperx/index.js | 294 - node_modules/hyperx/package.json | 70 - node_modules/hyperx/readme.markdown | 203 - node_modules/hyperx/test/attr.js | 76 - node_modules/hyperx/test/attr_to_prop.js | 29 - node_modules/hyperx/test/br.js | 10 - node_modules/hyperx/test/children.js | 42 - node_modules/hyperx/test/comment.js | 51 - node_modules/hyperx/test/concat.js | 49 - node_modules/hyperx/test/esc.js | 24 - .../test/ignore_surounding_whitespace.js | 19 - node_modules/hyperx/test/key.js | 72 - node_modules/hyperx/test/multi_elem_error.js | 12 - node_modules/hyperx/test/style.js | 17 - node_modules/hyperx/test/svg.js | 21 - node_modules/hyperx/test/tags.js | 23 - node_modules/hyperx/test/title.js | 10 - node_modules/hyperx/test/types.js | 28 - node_modules/hyperx/test/value.js | 36 - node_modules/hyperx/test/vdom.js | 26 - node_modules/hyperx/test/z_hyperscript.js | 27 - node_modules/ieee754/LICENSE | 28 - node_modules/ieee754/README.md | 51 - node_modules/ieee754/index.js | 84 - node_modules/ieee754/package.json | 69 - node_modules/individual/.npmignore | 4 - node_modules/individual/.travis.yml | 7 - node_modules/individual/LICENCE | 19 - node_modules/individual/README.md | 69 - node_modules/individual/index.js | 19 - node_modules/individual/one-version.js | 22 - node_modules/individual/package.json | 84 - node_modules/individual/test.js | 25 - node_modules/inflight/LICENSE | 15 - node_modules/inflight/README.md | 37 - node_modules/inflight/inflight.js | 54 - node_modules/inflight/package.json | 58 - node_modules/inherits/LICENSE | 16 - node_modules/inherits/README.md | 42 - node_modules/inherits/inherits.js | 7 - node_modules/inherits/inherits_browser.js | 23 - node_modules/inherits/package.json | 89 - node_modules/inject-lr-script/LICENSE.md | 21 - node_modules/inject-lr-script/index.js | 42 - node_modules/inject-lr-script/package.json | 68 - node_modules/inline-source-map/.npmignore | 16 - node_modules/inline-source-map/.travis.yml | 8 - node_modules/inline-source-map/LICENSE | 23 - node_modules/inline-source-map/README.md | 89 - .../inline-source-map/example/foo-bar.js | 8 - node_modules/inline-source-map/index.js | 135 - node_modules/inline-source-map/package.json | 72 - .../test/inline-source-map.js | 342 - .../inline-source-map/test/source-content.js | 143 - node_modules/insert-css/LICENSE | 18 - node_modules/insert-css/example/bundle.js | 31 - node_modules/insert-css/example/index.html | 6 - node_modules/insert-css/example/insert.js | 5 - node_modules/insert-css/example/style.css | 4 - node_modules/insert-css/index.js | 22 - node_modules/insert-css/package.json | 69 - node_modules/insert-css/readme.markdown | 53 - node_modules/insert-css/test/insert.js | 48 - .../insert-module-globals/.travis.yml | 5 - node_modules/insert-module-globals/LICENSE | 18 - .../insert-module-globals/appveyor.yml | 18 - .../bench/.gitattributes | 1 - .../insert-module-globals/bench/index.js | 15 - node_modules/insert-module-globals/bin/cmd.js | 26 - .../example/files/foo/index.js | 6 - .../example/files/main.js | 6 - .../insert-module-globals/example/insert.js | 12 - node_modules/insert-module-globals/index.js | 194 - .../insert-module-globals/package.json | 81 - .../insert-module-globals/readme.markdown | 146 - .../insert-module-globals/test/always.js | 108 - .../always/custom_globals_without_defaults.js | 7 - .../test/always/hidden_from_quick_test.js | 1 - .../insert-module-globals/test/always/main.js | 10 - .../insert-module-globals/test/global.js | 64 - .../test/global/filename.js | 2 - .../insert-module-globals/test/global/main.js | 2 - .../insert-module-globals/test/immediate.js | 30 - .../test/immediate/main.js | 8 - .../insert-module-globals/test/insert.js | 46 - .../test/insert/buffer.js | 1 - .../test/insert/foo/buf.js | 4 - .../test/insert/foo/index.js | 4 - .../insert-module-globals/test/insert/main.js | 4 - .../insert-module-globals/test/isbuffer.js | 64 - .../test/isbuffer/both.js | 6 - .../test/isbuffer/main.js | 3 - .../test/isbuffer/new.js | 6 - .../insert-module-globals/test/return.js | 27 - .../test/return/foo/index.js | 4 - .../insert-module-globals/test/return/main.js | 6 - .../insert-module-globals/test/roots.js | 35 - .../insert-module-globals/test/roots/main.js | 1 - .../insert-module-globals/test/sourcemap.js | 41 - .../test/sourcemap/main.js | 3 - .../test/sourcemap/main_es6.js | 1 - .../insert-module-globals/test/subdir.js | 37 - .../insert-module-globals/test/subdir/main.js | 1 - .../subdir/node_modules/is-buffer/index.js | 21 - .../insert-module-globals/test/unprefix.js | 34 - .../test/unprefix/hello.js | 2 - .../test/unprefix/main.js | 3 - node_modules/internal-ip/index.js | 47 - node_modules/internal-ip/license | 9 - node_modules/internal-ip/package.json | 82 - node_modules/internal-ip/readme.md | 49 - node_modules/ip-regex/index.js | 24 - node_modules/ip-regex/license | 21 - node_modules/ip-regex/package.json | 77 - node_modules/ip-regex/readme.md | 63 - node_modules/ipaddr.js/README.md | 233 - node_modules/ipaddr.js/ipaddr.min.js | 1 - node_modules/ipaddr.js/lib/ipaddr.js | 636 - node_modules/ipaddr.js/lib/ipaddr.js.d.ts | 71 - node_modules/ipaddr.js/package.json | 69 - node_modules/is-accessor-descriptor/LICENSE | 21 - node_modules/is-accessor-descriptor/README.md | 123 - node_modules/is-accessor-descriptor/index.js | 69 - .../is-accessor-descriptor/package.json | 92 - node_modules/is-binary-path/index.js | 12 - node_modules/is-binary-path/license | 21 - node_modules/is-binary-path/package.json | 71 - node_modules/is-binary-path/readme.md | 34 - node_modules/is-buffer/LICENSE | 21 - node_modules/is-buffer/README.md | 53 - node_modules/is-buffer/index.js | 21 - node_modules/is-buffer/package.json | 84 - node_modules/is-buffer/test/basic.js | 24 - node_modules/is-data-descriptor/LICENSE | 21 - node_modules/is-data-descriptor/README.md | 128 - node_modules/is-data-descriptor/index.js | 55 - node_modules/is-data-descriptor/package.json | 91 - node_modules/is-descriptor/LICENSE | 21 - node_modules/is-descriptor/README.md | 193 - node_modules/is-descriptor/index.js | 22 - .../node_modules/kind-of/LICENSE | 21 - .../node_modules/kind-of/README.md | 342 - .../node_modules/kind-of/index.js | 147 - .../node_modules/kind-of/package.json | 146 - node_modules/is-descriptor/package.json | 117 - node_modules/is-dotfile/LICENSE | 21 - node_modules/is-dotfile/README.md | 95 - node_modules/is-dotfile/index.js | 14 - node_modules/is-dotfile/package.json | 106 - node_modules/is-electron/LICENSE | 21 - node_modules/is-electron/README.md | 25 - node_modules/is-electron/index.js | 21 - node_modules/is-electron/package.json | 64 - node_modules/is-equal-shallow/LICENSE | 21 - node_modules/is-equal-shallow/README.md | 90 - node_modules/is-equal-shallow/index.js | 27 - node_modules/is-equal-shallow/package.json | 85 - node_modules/is-extendable/LICENSE | 21 - node_modules/is-extendable/README.md | 72 - node_modules/is-extendable/index.js | 13 - node_modules/is-extendable/package.json | 92 - node_modules/is-extglob/LICENSE | 21 - node_modules/is-extglob/README.md | 75 - node_modules/is-extglob/index.js | 11 - node_modules/is-extglob/package.json | 79 - node_modules/is-finite/index.js | 6 - node_modules/is-finite/license | 21 - node_modules/is-finite/package.json | 68 - node_modules/is-finite/readme.md | 28 - node_modules/is-glob/LICENSE | 21 - node_modules/is-glob/README.md | 105 - node_modules/is-glob/index.js | 14 - node_modules/is-glob/package.json | 92 - node_modules/is-number/LICENSE | 21 - node_modules/is-number/README.md | 103 - node_modules/is-number/index.js | 19 - node_modules/is-number/package.json | 90 - node_modules/is-plain-object/LICENSE | 21 - node_modules/is-plain-object/README.md | 104 - node_modules/is-plain-object/index.d.ts | 5 - node_modules/is-plain-object/index.js | 37 - .../node_modules/isobject/LICENSE | 21 - .../node_modules/isobject/README.md | 122 - .../node_modules/isobject/index.d.ts | 5 - .../node_modules/isobject/index.js | 12 - .../node_modules/isobject/package.json | 119 - node_modules/is-plain-object/package.json | 124 - node_modules/is-posix-bracket/LICENSE | 21 - node_modules/is-posix-bracket/README.md | 88 - node_modules/is-posix-bracket/index.js | 10 - node_modules/is-posix-bracket/package.json | 95 - node_modules/is-primitive/LICENSE | 21 - node_modules/is-primitive/README.md | 57 - node_modules/is-primitive/index.js | 13 - node_modules/is-primitive/package.json | 71 - node_modules/is-stream/index.js | 21 - node_modules/is-stream/license | 21 - node_modules/is-stream/package.json | 70 - node_modules/is-stream/readme.md | 42 - node_modules/is-windows/LICENSE | 21 - node_modules/is-windows/README.md | 95 - node_modules/is-windows/index.js | 27 - node_modules/is-windows/package.json | 111 - node_modules/isarray/.npmignore | 1 - node_modules/isarray/.travis.yml | 4 - node_modules/isarray/Makefile | 6 - node_modules/isarray/README.md | 60 - node_modules/isarray/component.json | 19 - node_modules/isarray/index.js | 5 - node_modules/isarray/package.json | 75 - node_modules/isarray/test.js | 20 - node_modules/isexe/.npmignore | 2 - node_modules/isexe/LICENSE | 15 - node_modules/isexe/README.md | 51 - node_modules/isexe/index.js | 57 - node_modules/isexe/mode.js | 41 - node_modules/isexe/package.json | 60 - node_modules/isexe/test/basic.js | 221 - node_modules/isexe/windows.js | 42 - node_modules/isobject/LICENSE | 21 - node_modules/isobject/README.md | 112 - node_modules/isobject/index.js | 14 - node_modules/isobject/package.json | 98 - .../json-stable-stringify/.travis.yml | 4 - node_modules/json-stable-stringify/LICENSE | 18 - .../json-stable-stringify/example/key_cmp.js | 7 - .../json-stable-stringify/example/nested.js | 3 - .../json-stable-stringify/example/str.js | 3 - .../example/value_cmp.js | 7 - node_modules/json-stable-stringify/index.js | 50 - .../json-stable-stringify/package.json | 74 - .../json-stable-stringify/readme.markdown | 90 - .../json-stable-stringify/test/cmp.js | 11 - .../json-stable-stringify/test/nested.js | 8 - .../json-stable-stringify/test/str.js | 8 - node_modules/json-stringify-safe/.npmignore | 1 - node_modules/json-stringify-safe/CHANGELOG.md | 14 - node_modules/json-stringify-safe/LICENSE | 15 - node_modules/json-stringify-safe/Makefile | 35 - node_modules/json-stringify-safe/README.md | 52 - node_modules/json-stringify-safe/package.json | 66 - node_modules/json-stringify-safe/stringify.js | 27 - .../json-stringify-safe/test/mocha.opts | 2 - .../test/stringify_test.js | 246 - node_modules/jsonify/README.markdown | 34 - node_modules/jsonify/index.js | 2 - node_modules/jsonify/lib/parse.js | 273 - node_modules/jsonify/lib/stringify.js | 154 - node_modules/jsonify/package.json | 63 - node_modules/jsonify/test/parse.js | 16 - node_modules/jsonify/test/stringify.js | 15 - node_modules/jsonparse/.npmignore | 1 - node_modules/jsonparse/LICENSE | 24 - node_modules/jsonparse/README.markdown | 11 - node_modules/jsonparse/bench.js | 26 - .../jsonparse/examples/twitterfeed.js | 30 - node_modules/jsonparse/jsonparse.js | 413 - node_modules/jsonparse/package.json | 58 - node_modules/jsonparse/samplejson/basic.json | 167 - node_modules/jsonparse/samplejson/basic2.json | 180 - node_modules/jsonparse/test/big-token.js | 24 - node_modules/jsonparse/test/boundary.js | 110 - node_modules/jsonparse/test/offset.js | 67 - node_modules/jsonparse/test/primitives.js | 57 - node_modules/jsonparse/test/surrogate.js | 26 - node_modules/jsonparse/test/unvalid.js | 15 - node_modules/jsonparse/test/utf8.js | 38 - node_modules/kind-of/LICENSE | 21 - node_modules/kind-of/README.md | 261 - node_modules/kind-of/index.js | 116 - node_modules/kind-of/package.json | 146 - .../labeled-stream-splicer/.travis.yml | 6 - node_modules/labeled-stream-splicer/LICENSE | 18 - .../example/browser/bar.js | 3 - .../example/browser/foo.js | 5 - .../example/browser/main.js | 2 - .../example/browser/xyz.js | 2 - .../labeled-stream-splicer/example/bundle.js | 16 - node_modules/labeled-stream-splicer/index.js | 65 - .../node_modules/isarray/README.md | 62 - .../node_modules/isarray/index.js | 5 - .../node_modules/isarray/package.json | 76 - .../labeled-stream-splicer/package.json | 67 - .../labeled-stream-splicer/readme.markdown | 124 - .../labeled-stream-splicer/test/bundle.js | 27 - .../labeled-stream-splicer/test/bundle/bar.js | 3 - .../labeled-stream-splicer/test/bundle/foo.js | 5 - .../test/bundle/main.js | 2 - .../labeled-stream-splicer/test/bundle/xyz.js | 2 - node_modules/lodash.debounce/LICENSE | 47 - node_modules/lodash.debounce/README.md | 18 - node_modules/lodash.debounce/index.js | 377 - node_modules/lodash.debounce/package.json | 69 - node_modules/lodash.memoize/LICENSE.txt | 22 - node_modules/lodash.memoize/README.md | 20 - node_modules/lodash.memoize/index.js | 167 - node_modules/lodash.memoize/package.json | 81 - node_modules/map-cache/LICENSE | 21 - node_modules/map-cache/README.md | 145 - node_modules/map-cache/index.js | 100 - node_modules/map-cache/package.json | 91 - node_modules/map-limit/LICENSE.md | 21 - node_modules/map-limit/README.md | 32 - node_modules/map-limit/index.js | 54 - .../map-limit/node_modules/once/LICENSE | 15 - .../map-limit/node_modules/once/README.md | 51 - .../map-limit/node_modules/once/once.js | 21 - .../map-limit/node_modules/once/package.json | 66 - node_modules/map-limit/package.json | 62 - node_modules/map-limit/test.js | 39 - node_modules/map-visit/LICENSE | 21 - node_modules/map-visit/README.md | 155 - node_modules/map-visit/index.js | 37 - node_modules/map-visit/package.json | 113 - node_modules/math-random/.npmignore | 1 - node_modules/math-random/.travis.yml | 6 - node_modules/math-random/browser.js | 17 - node_modules/math-random/node.js | 13 - node_modules/math-random/package.json | 58 - node_modules/math-random/readme.md | 26 - node_modules/math-random/test.js | 26 - node_modules/md5.js/LICENSE | 21 - node_modules/md5.js/README.md | 29 - node_modules/md5.js/index.js | 146 - node_modules/md5.js/package.json | 68 - node_modules/md5/.npmignore | 1 - node_modules/md5/.travis.yml | 4 - node_modules/md5/LICENSE | 27 - node_modules/md5/README.md | 108 - node_modules/md5/md5.js | 160 - node_modules/md5/package.json | 68 - node_modules/md5/test.js | 45 - node_modules/micromatch/LICENSE | 21 - node_modules/micromatch/README.md | 689 - node_modules/micromatch/index.js | 431 - node_modules/micromatch/lib/chars.js | 67 - node_modules/micromatch/lib/expand.js | 304 - node_modules/micromatch/lib/glob.js | 193 - node_modules/micromatch/lib/utils.js | 149 - node_modules/micromatch/package.json | 146 - node_modules/miller-rabin/.npmignore | 2 - node_modules/miller-rabin/1.js | 7 - node_modules/miller-rabin/README.md | 26 - node_modules/miller-rabin/bin/miller-rabin | 29 - node_modules/miller-rabin/lib/mr.js | 115 - node_modules/miller-rabin/package.json | 62 - node_modules/miller-rabin/test.js | 25 - node_modules/miller-rabin/test/api-test.js | 18 - node_modules/mime/LICENSE | 21 - node_modules/mime/README.md | 90 - node_modules/mime/build/build.js | 11 - node_modules/mime/build/test.js | 60 - node_modules/mime/cli.js | 8 - node_modules/mime/mime.js | 108 - node_modules/mime/package.json | 67 - node_modules/mime/types.json | 1 - node_modules/minimalistic-assert/LICENSE | 13 - node_modules/minimalistic-assert/index.js | 11 - node_modules/minimalistic-assert/package.json | 48 - node_modules/minimalistic-assert/readme.md | 4 - .../minimalistic-crypto-utils/.npmignore | 2 - .../minimalistic-crypto-utils/.travis.yml | 11 - .../minimalistic-crypto-utils/README.md | 47 - .../minimalistic-crypto-utils/lib/utils.js | 58 - .../minimalistic-crypto-utils/package.json | 56 - .../test/utils-test.js | 28 - node_modules/minimatch/LICENSE | 15 - node_modules/minimatch/README.md | 209 - node_modules/minimatch/minimatch.js | 923 - node_modules/minimatch/package.json | 64 - node_modules/minimist/.travis.yml | 8 - node_modules/minimist/LICENSE | 18 - node_modules/minimist/example/parse.js | 2 - node_modules/minimist/index.js | 236 - node_modules/minimist/package.json | 75 - node_modules/minimist/readme.markdown | 91 - node_modules/minimist/test/all_bool.js | 32 - node_modules/minimist/test/bool.js | 166 - node_modules/minimist/test/dash.js | 31 - node_modules/minimist/test/default_bool.js | 35 - node_modules/minimist/test/dotted.js | 22 - node_modules/minimist/test/kv_short.js | 16 - node_modules/minimist/test/long.js | 31 - node_modules/minimist/test/num.js | 36 - node_modules/minimist/test/parse.js | 197 - node_modules/minimist/test/parse_modified.js | 9 - node_modules/minimist/test/short.js | 67 - node_modules/minimist/test/stop_early.js | 15 - node_modules/minimist/test/unknown.js | 102 - node_modules/minimist/test/whitespace.js | 8 - node_modules/mixin-deep/LICENSE | 21 - node_modules/mixin-deep/README.md | 80 - node_modules/mixin-deep/index.js | 53 - .../node_modules/is-extendable/LICENSE | 21 - .../node_modules/is-extendable/README.md | 88 - .../node_modules/is-extendable/index.d.ts | 5 - .../node_modules/is-extendable/index.js | 14 - .../node_modules/is-extendable/package.json | 98 - node_modules/mixin-deep/package.json | 98 - node_modules/mkdirp/.travis.yml | 8 - node_modules/mkdirp/LICENSE | 21 - node_modules/mkdirp/bin/cmd.js | 33 - node_modules/mkdirp/bin/usage.txt | 12 - node_modules/mkdirp/examples/pow.js | 6 - node_modules/mkdirp/index.js | 98 - .../mkdirp/node_modules/minimist/.travis.yml | 4 - .../mkdirp/node_modules/minimist/LICENSE | 18 - .../node_modules/minimist/example/parse.js | 2 - .../mkdirp/node_modules/minimist/index.js | 187 - .../mkdirp/node_modules/minimist/package.json | 71 - .../node_modules/minimist/readme.markdown | 73 - .../mkdirp/node_modules/minimist/test/dash.js | 24 - .../minimist/test/default_bool.js | 20 - .../node_modules/minimist/test/dotted.js | 16 - .../mkdirp/node_modules/minimist/test/long.js | 31 - .../node_modules/minimist/test/parse.js | 318 - .../minimist/test/parse_modified.js | 9 - .../node_modules/minimist/test/short.js | 67 - .../node_modules/minimist/test/whitespace.js | 8 - node_modules/mkdirp/package.json | 62 - node_modules/mkdirp/readme.markdown | 100 - node_modules/mkdirp/test/chmod.js | 41 - node_modules/mkdirp/test/clobber.js | 38 - node_modules/mkdirp/test/mkdirp.js | 28 - node_modules/mkdirp/test/opts_fs.js | 29 - node_modules/mkdirp/test/opts_fs_sync.js | 27 - node_modules/mkdirp/test/perm.js | 32 - node_modules/mkdirp/test/perm_sync.js | 36 - node_modules/mkdirp/test/race.js | 37 - node_modules/mkdirp/test/rel.js | 32 - node_modules/mkdirp/test/return.js | 25 - node_modules/mkdirp/test/return_sync.js | 24 - node_modules/mkdirp/test/root.js | 19 - node_modules/mkdirp/test/sync.js | 32 - node_modules/mkdirp/test/umask.js | 28 - node_modules/mkdirp/test/umask_sync.js | 32 - node_modules/module-deps/.travis.yml | 17 - node_modules/module-deps/CHANGELOG.md | 26 - node_modules/module-deps/LICENSE | 18 - node_modules/module-deps/bin/cmd.js | 28 - node_modules/module-deps/bin/usage.txt | 9 - node_modules/module-deps/example/deps.js | 6 - node_modules/module-deps/example/files/bar.js | 3 - node_modules/module-deps/example/files/foo.js | 5 - .../module-deps/example/files/main.js | 2 - node_modules/module-deps/example/files/xyz.js | 2 - node_modules/module-deps/index.js | 625 - node_modules/module-deps/package.json | 84 - node_modules/module-deps/readme.markdown | 312 - node_modules/module-deps/test/bundle.js | 23 - node_modules/module-deps/test/cache.js | 50 - node_modules/module-deps/test/cache_expose.js | 54 - .../module-deps/test/cache_partial.js | 47 - .../module-deps/test/cache_partial_expose.js | 104 - .../module-deps/test/cache_persistent.js | 122 - .../test/cache_persistent/error_transform.js | 6 - node_modules/module-deps/test/cycle.js | 19 - node_modules/module-deps/test/cycle/bar.js | 3 - node_modules/module-deps/test/cycle/foo.js | 4 - node_modules/module-deps/test/cycle/main.js | 4 - node_modules/module-deps/test/deps.js | 49 - node_modules/module-deps/test/detect.js | 32 - node_modules/module-deps/test/dotdot.js | 20 - .../module-deps/test/dotdot/abc/index.js | 2 - node_modules/module-deps/test/dotdot/index.js | 1 - node_modules/module-deps/test/expose.js | 41 - node_modules/module-deps/test/expose/bar.js | 1 - node_modules/module-deps/test/expose/foo.js | 1 - .../module-deps/test/expose/lib/abc.js | 1 - .../module-deps/test/expose/lib/xyz.js | 2 - node_modules/module-deps/test/expose/main.js | 3 - node_modules/module-deps/test/file_cache.js | 58 - node_modules/module-deps/test/files/bar.js | 3 - node_modules/module-deps/test/files/extra.js | 1 - .../module-deps/test/files/filterable.js | 10 - node_modules/module-deps/test/files/foo.js | 5 - node_modules/module-deps/test/files/main.js | 2 - .../module-deps/test/files/pkg_filter/one.js | 1 - .../test/files/pkg_filter/package.json | 3 - .../module-deps/test/files/pkg_filter/test.js | 1 - .../module-deps/test/files/pkg_filter/two.js | 1 - .../module-deps/test/files/quotes/bar.js | 1 - .../module-deps/test/files/quotes/baz.js | 1 - .../module-deps/test/files/quotes/foo.js | 1 - .../module-deps/test/files/quotes/main.js | 3 - .../module-deps/test/files/syntax_error.js | 2 - .../test/files/tr_2dep_module/f.js | 1 - .../test/files/tr_2dep_module/main.js | 7 - .../module-deps/test/files/tr_global/main.js | 1 - .../test/files/tr_global/package.json | 5 - .../module-deps/test/files/tr_module/f.js | 1 - .../module-deps/test/files/tr_module/index.js | 8 - .../module-deps/test/files/tr_module/main.js | 8 - .../test/files/tr_module/package.json | 5 - .../module-deps/test/files/tr_module/xxx.js | 8 - .../test/files/tr_no_entry/main.js | 1 - .../test/files/tr_rel/package.json | 5 - .../test/files/tr_rel/subdir/main.js | 1 - .../module-deps/test/files/tr_rel/xxx.js | 8 - .../module-deps/test/files/tr_sh/f.js | 1 - .../module-deps/test/files/tr_sh/main.js | 7 - .../module-deps/test/files/tr_sh/tr_a.js | 7 - .../module-deps/test/files/tr_sh/tr_b.js | 7 - .../test/files/tr_whole_package/f.js | 3 - .../test/files/tr_whole_package/main.js | 3 - .../module-deps/test/files/transformdeps.js | 1 - .../module-deps/test/files/unicode/bar.js | 3 - .../module-deps/test/files/unicode/foo.js | 5 - .../module-deps/test/files/unicode/main.js | 2 - node_modules/module-deps/test/files/xyz.js | 2 - node_modules/module-deps/test/filter.js | 36 - .../module-deps/test/ignore_missing.js | 60 - .../module-deps/test/ignore_missing/main.js | 1 - .../module-deps/test/ignore_missing/other.js | 1 - .../module-deps/test/ignore_missing_cache.js | 52 - node_modules/module-deps/test/invalid_pkg.js | 16 - .../module-deps/test/invalid_pkg/file.js | 1 - .../module-deps/test/invalid_pkg/index.js | 1 - .../module-deps/test/invalid_pkg/package.json | 1 - node_modules/module-deps/test/noparse.js | 43 - node_modules/module-deps/test/noparse_row.js | 39 - node_modules/module-deps/test/pkg.js | 20 - node_modules/module-deps/test/pkg/main.js | 2 - .../module-deps/test/pkg/package.json | 4 - node_modules/module-deps/test/pkg_filter.js | 26 - node_modules/module-deps/test/quotes.js | 42 - node_modules/module-deps/test/row_expose.js | 24 - .../test/row_expose_name_is_file_transform.js | 32 - .../module-deps/test/row_expose_transform.js | 31 - node_modules/module-deps/test/source.js | 61 - node_modules/module-deps/test/syntax.js | 23 - .../module-deps/test/tr_2dep_module.js | 23 - node_modules/module-deps/test/tr_deps.js | 60 - node_modules/module-deps/test/tr_err.js | 21 - node_modules/module-deps/test/tr_flags.js | 44 - .../module-deps/test/tr_flags/empty.js | 0 node_modules/module-deps/test/tr_fn.js | 32 - node_modules/module-deps/test/tr_global.js | 29 - node_modules/module-deps/test/tr_module.js | 23 - node_modules/module-deps/test/tr_no_entry.js | 31 - node_modules/module-deps/test/tr_opts.js | 21 - node_modules/module-deps/test/tr_opts/main.js | 1 - .../module-deps/test/tr_opts/package.json | 7 - node_modules/module-deps/test/tr_rel.js | 24 - node_modules/module-deps/test/tr_sh.js | 23 - .../module-deps/test/tr_whole_package.js | 22 - node_modules/module-deps/test/tr_write.js | 32 - .../module-deps/test/tr_write/main.js | 1 - node_modules/module-deps/test/undef_file.js | 49 - node_modules/module-deps/test/unicode.js | 49 - node_modules/ms/index.js | 152 - node_modules/ms/license.md | 21 - node_modules/ms/package.json | 70 - node_modules/ms/readme.md | 51 - node_modules/nanomatch/CHANGELOG.md | 57 - node_modules/nanomatch/LICENSE | 21 - node_modules/nanomatch/README.md | 1148 - node_modules/nanomatch/index.js | 838 - node_modules/nanomatch/lib/cache.js | 1 - node_modules/nanomatch/lib/compilers.js | 339 - node_modules/nanomatch/lib/parsers.js | 386 - node_modules/nanomatch/lib/utils.js | 379 - .../nanomatch/node_modules/arr-diff/LICENSE | 21 - .../nanomatch/node_modules/arr-diff/README.md | 130 - .../nanomatch/node_modules/arr-diff/index.js | 47 - .../node_modules/arr-diff/package.json | 108 - .../node_modules/array-unique/LICENSE | 21 - .../node_modules/array-unique/README.md | 77 - .../node_modules/array-unique/index.js | 43 - .../node_modules/array-unique/package.json | 93 - .../node_modules/kind-of/CHANGELOG.md | 157 - .../nanomatch/node_modules/kind-of/LICENSE | 21 - .../nanomatch/node_modules/kind-of/README.md | 365 - .../nanomatch/node_modules/kind-of/index.js | 129 - .../node_modules/kind-of/package.json | 143 - node_modules/nanomatch/package.json | 171 - node_modules/nice-try/CHANGELOG.md | 21 - node_modules/nice-try/LICENSE | 21 - node_modules/nice-try/README.md | 32 - node_modules/nice-try/package.json | 61 - node_modules/nice-try/src/index.js | 12 - node_modules/normalize-path/LICENSE | 21 - node_modules/normalize-path/README.md | 92 - node_modules/normalize-path/index.js | 19 - node_modules/normalize-path/package.json | 118 - node_modules/npm-run-path/index.js | 39 - node_modules/npm-run-path/license | 21 - node_modules/npm-run-path/package.json | 77 - node_modules/npm-run-path/readme.md | 81 - node_modules/number-is-nan/index.js | 4 - node_modules/number-is-nan/license | 21 - node_modules/number-is-nan/package.json | 67 - node_modules/number-is-nan/readme.md | 28 - node_modules/object-assign/index.js | 90 - node_modules/object-assign/license | 21 - node_modules/object-assign/package.json | 76 - node_modules/object-assign/readme.md | 61 - node_modules/object-copy/LICENSE | 21 - node_modules/object-copy/index.js | 174 - .../node_modules/define-property/LICENSE | 21 - .../node_modules/define-property/README.md | 77 - .../node_modules/define-property/index.js | 31 - .../node_modules/define-property/package.json | 82 - node_modules/object-copy/package.json | 80 - node_modules/object-visit/LICENSE | 21 - node_modules/object-visit/README.md | 83 - node_modules/object-visit/index.js | 33 - .../node_modules/isobject/LICENSE | 21 - .../node_modules/isobject/README.md | 122 - .../node_modules/isobject/index.d.ts | 5 - .../node_modules/isobject/index.js | 12 - .../node_modules/isobject/package.json | 119 - node_modules/object-visit/package.json | 97 - node_modules/object.omit/LICENSE | 21 - node_modules/object.omit/README.md | 118 - node_modules/object.omit/index.js | 40 - node_modules/object.omit/package.json | 98 - node_modules/object.pick/LICENSE | 21 - node_modules/object.pick/README.md | 76 - node_modules/object.pick/index.js | 35 - .../object.pick/node_modules/isobject/LICENSE | 21 - .../node_modules/isobject/README.md | 122 - .../node_modules/isobject/index.d.ts | 5 - .../node_modules/isobject/index.js | 12 - .../node_modules/isobject/package.json | 119 - node_modules/object.pick/package.json | 92 - node_modules/on-finished/HISTORY.md | 88 - node_modules/on-finished/LICENSE | 23 - node_modules/on-finished/README.md | 154 - node_modules/on-finished/index.js | 196 - node_modules/on-finished/package.json | 71 - node_modules/on-headers/HISTORY.md | 16 - node_modules/on-headers/LICENSE | 22 - node_modules/on-headers/README.md | 76 - node_modules/on-headers/index.js | 93 - node_modules/on-headers/package.json | 69 - node_modules/once/LICENSE | 15 - node_modules/once/README.md | 79 - node_modules/once/once.js | 42 - node_modules/once/package.json | 68 - node_modules/opn/index.js | 97 - node_modules/opn/license | 21 - node_modules/opn/package.json | 87 - node_modules/opn/readme.md | 93 - node_modules/opn/xdg-open | 861 - node_modules/options/.npmignore | 7 - node_modules/options/Makefile | 12 - node_modules/options/README.md | 69 - node_modules/options/lib/options.js | 86 - node_modules/options/package.json | 54 - node_modules/os-browserify/.npmignore | 14 - node_modules/os-browserify/LICENSE | 21 - node_modules/os-browserify/README.md | 5 - node_modules/os-browserify/browser.js | 49 - node_modules/os-browserify/main.js | 1 - node_modules/os-browserify/package.json | 53 - node_modules/os-tmpdir/index.js | 25 - node_modules/os-tmpdir/license | 21 - node_modules/os-tmpdir/package.json | 73 - node_modules/os-tmpdir/readme.md | 32 - node_modules/outpipe/.npmignore | 2 - node_modules/outpipe/LICENSE | 18 - node_modules/outpipe/bin/echo.js | 2 - node_modules/outpipe/example/input/x.js | 4 - node_modules/outpipe/example/input/y.js | 5 - node_modules/outpipe/example/input/z.js | 2 - node_modules/outpipe/example/watch.js | 19 - node_modules/outpipe/index.js | 34 - node_modules/outpipe/package.json | 69 - node_modules/outpipe/readme.markdown | 117 - node_modules/outpipe/test/cmd.js | 19 - node_modules/outpipe/test/outfile.js | 19 - node_modules/p-finally/index.js | 15 - node_modules/p-finally/license | 21 - node_modules/p-finally/package.json | 74 - node_modules/p-finally/readme.md | 47 - node_modules/pad-left/LICENSE | 21 - node_modules/pad-left/README.md | 134 - node_modules/pad-left/index.js | 28 - node_modules/pad-left/package.json | 119 - node_modules/pad-right/LICENSE | 21 - node_modules/pad-right/README.md | 71 - node_modules/pad-right/index.js | 20 - node_modules/pad-right/package.json | 95 - node_modules/pako/CHANGELOG.md | 118 - node_modules/pako/LICENSE | 21 - node_modules/pako/README.md | 182 - node_modules/pako/dist/pako.js | 6809 ---- node_modules/pako/dist/pako.min.js | 1 - node_modules/pako/dist/pako_deflate.js | 3993 --- node_modules/pako/dist/pako_deflate.min.js | 1 - node_modules/pako/dist/pako_inflate.js | 3293 -- node_modules/pako/dist/pako_inflate.min.js | 1 - node_modules/pako/index.js | 14 - node_modules/pako/lib/deflate.js | 400 - node_modules/pako/lib/inflate.js | 418 - node_modules/pako/lib/utils/common.js | 105 - node_modules/pako/lib/utils/strings.js | 185 - node_modules/pako/lib/zlib/README | 59 - node_modules/pako/lib/zlib/adler32.js | 51 - node_modules/pako/lib/zlib/constants.js | 68 - node_modules/pako/lib/zlib/crc32.js | 59 - node_modules/pako/lib/zlib/deflate.js | 1874 - node_modules/pako/lib/zlib/gzheader.js | 58 - node_modules/pako/lib/zlib/inffast.js | 345 - node_modules/pako/lib/zlib/inflate.js | 1556 - node_modules/pako/lib/zlib/inftrees.js | 343 - node_modules/pako/lib/zlib/messages.js | 32 - node_modules/pako/lib/zlib/trees.js | 1220 - node_modules/pako/lib/zlib/zstream.js | 47 - node_modules/pako/package.json | 95 - node_modules/parents/.travis.yml | 4 - node_modules/parents/LICENSE | 18 - node_modules/parents/example/dirname.js | 3 - node_modules/parents/example/win32.js | 5 - node_modules/parents/index.js | 48 - node_modules/parents/package.json | 69 - node_modules/parents/readme.markdown | 75 - node_modules/parents/test/dirname.js | 20 - node_modules/parents/test/win32.js | 34 - node_modules/parse-asn1/.travis.yml | 9 - node_modules/parse-asn1/LICENSE | 13 - node_modules/parse-asn1/README.md | 8 - node_modules/parse-asn1/aesid.json | 13 - node_modules/parse-asn1/asn1.js | 122 - node_modules/parse-asn1/certificate.js | 88 - node_modules/parse-asn1/fixProc.js | 30 - node_modules/parse-asn1/index.js | 106 - .../parse-asn1/package-lock.json.1909017369 | 0 node_modules/parse-asn1/package.json | 58 - node_modules/parse-asn1/test/1024.priv | 16 - node_modules/parse-asn1/test/1024.pub | 6 - node_modules/parse-asn1/test/dsa.1024.priv | 18 - node_modules/parse-asn1/test/dsa.1024.pub | 12 - node_modules/parse-asn1/test/dsa.2048.priv | 20 - node_modules/parse-asn1/test/dsa.2048.pub | 20 - node_modules/parse-asn1/test/ec.pass.priv | 7 - node_modules/parse-asn1/test/ec.priv | 5 - node_modules/parse-asn1/test/ec.pub | 4 - node_modules/parse-asn1/test/index.js | 138 - node_modules/parse-asn1/test/node.cert | 20 - node_modules/parse-asn1/test/pass.1024.priv | 18 - node_modules/parse-asn1/test/pass.1024.pub | 6 - .../parse-asn1/test/pass.dsa.1024.priv | 11 - .../parse-asn1/test/pass.dsa.1024.pub | 12 - .../parse-asn1/test/pass.rsa.1024.priv | 18 - .../parse-asn1/test/pass.rsa.1024.pub | 6 - .../parse-asn1/test/pass.rsa.2028.priv | 30 - .../parse-asn1/test/pass.rsa.2028.pub | 9 - .../parse-asn1/test/pass2.dsa.1024.priv | 15 - .../parse-asn1/test/pass2.dsa.1024.pub | 12 - node_modules/parse-asn1/test/rsa.1024.priv | 15 - node_modules/parse-asn1/test/rsa.1024.pub | 5 - node_modules/parse-asn1/test/rsa.2028.priv | 27 - node_modules/parse-asn1/test/rsa.2028.pub | 8 - node_modules/parse-asn1/test/vector.js | 7 - node_modules/parse-asn1/test/vector.priv | 12 - node_modules/parse-asn1/test/vector2.priv | 19 - node_modules/parse-glob/LICENSE | 21 - node_modules/parse-glob/README.md | 115 - node_modules/parse-glob/index.js | 156 - node_modules/parse-glob/package.json | 93 - node_modules/parse-ms/index.js | 16 - node_modules/parse-ms/license | 21 - node_modules/parse-ms/package.json | 66 - node_modules/parse-ms/readme.md | 23 - node_modules/parseurl/HISTORY.md | 53 - node_modules/parseurl/LICENSE | 24 - node_modules/parseurl/README.md | 124 - node_modules/parseurl/index.js | 154 - node_modules/parseurl/package.json | 79 - node_modules/pascalcase/LICENSE | 21 - node_modules/pascalcase/README.md | 80 - node_modules/pascalcase/index.js | 21 - node_modules/pascalcase/package.json | 77 - node_modules/path-browserify/LICENSE | 18 - node_modules/path-browserify/index.js | 302 - node_modules/path-browserify/package.json | 57 - node_modules/path-browserify/readme.markdown | 3 - .../path-browserify/test/test-path.js | 424 - node_modules/path-is-absolute/index.js | 20 - node_modules/path-is-absolute/license | 21 - node_modules/path-is-absolute/package.json | 78 - node_modules/path-is-absolute/readme.md | 59 - node_modules/path-key/index.js | 13 - node_modules/path-key/license | 21 - node_modules/path-key/package.json | 72 - node_modules/path-key/readme.md | 51 - node_modules/path-parse/.travis.yml | 9 - node_modules/path-parse/LICENSE | 21 - node_modules/path-parse/README.md | 42 - node_modules/path-parse/index.js | 93 - node_modules/path-parse/package.json | 61 - node_modules/path-parse/test.js | 77 - node_modules/path-platform/LICENSE | 3 - node_modules/path-platform/README.md | 5 - node_modules/path-platform/package.json | 54 - node_modules/path-platform/path.js | 643 - node_modules/pbkdf2/LICENSE | 21 - node_modules/pbkdf2/README.md | 30 - node_modules/pbkdf2/browser.js | 2 - node_modules/pbkdf2/index.js | 31 - node_modules/pbkdf2/lib/async.js | 100 - node_modules/pbkdf2/lib/default-encoding.js | 10 - node_modules/pbkdf2/lib/precondition.js | 28 - node_modules/pbkdf2/lib/sync-browser.js | 104 - node_modules/pbkdf2/lib/sync.js | 51 - node_modules/pbkdf2/package.json | 98 - node_modules/pelo/README.md | 56 - node_modules/pelo/app.js | 67 - node_modules/pelo/bundle.js | 1053 - node_modules/pelo/client.js | 14 - node_modules/pelo/index.js | 106 - node_modules/pelo/package.json | 59 - node_modules/pelo/server.js | 55 - node_modules/pelo/yarn.lock | 2049 -- node_modules/pem/.eslintignore | 2 - node_modules/pem/.eslintrc.js | 11 - node_modules/pem/.travis.yml | 63 - node_modules/pem/CHANGELOG.md | 38 - node_modules/pem/CODE_OF_CONDUCT.md | 84 - node_modules/pem/CONTRIBUTING.md | 78 - node_modules/pem/HISTORY.md | 96 - node_modules/pem/LICENSE | 17 - node_modules/pem/README.md | 332 - node_modules/pem/bin/test_build_openssl.sh | 73 - node_modules/pem/jsdoc.json | 44 - node_modules/pem/lib/convert.js | 278 - node_modules/pem/lib/helper.js | 137 - node_modules/pem/lib/openssl.js | 257 - node_modules/pem/lib/pem.js | 1288 - node_modules/pem/mocha.opts | 6 - node_modules/pem/package.json | 135 - node_modules/pem/test/convert.spec.js | 255 - .../pem/test/fixtures/GeoTrust_Primary_CA.pem | 21 - node_modules/pem/test/fixtures/cn_openssl.crt | 34 - node_modules/pem/test/fixtures/cn_openssl.csr | 19 - node_modules/pem/test/fixtures/cn_openssl.key | 52 - .../pem/test/fixtures/cn_openssl_config.conf | 38 - node_modules/pem/test/fixtures/google.com.pem | 68 - node_modules/pem/test/fixtures/idsrv3test.pfx | Bin 3395 -> 0 bytes node_modules/pem/test/fixtures/inclpkey.pem | 86 - node_modules/pem/test/fixtures/nopkey.der | Bin 965 -> 0 bytes node_modules/pem/test/fixtures/nopkey.pem | 23 - node_modules/pem/test/fixtures/pem196.pem | 35 - node_modules/pem/test/fixtures/ru_openssl.crt | 36 - node_modules/pem/test/fixtures/ru_openssl.csr | 20 - node_modules/pem/test/fixtures/ru_openssl.key | 52 - .../pem/test/fixtures/ru_openssl_config.conf | 40 - node_modules/pem/test/fixtures/test.cnf | 26 - node_modules/pem/test/fixtures/test.crt | 16 - node_modules/pem/test/fixtures/test.csr | 13 - node_modules/pem/test/fixtures/test.dh | 5 - node_modules/pem/test/fixtures/test.key | 18 - node_modules/pem/test/fixtures/test.p7b | 17 - node_modules/pem/test/fixtures/testnopw.key | 15 - node_modules/pem/test/helper.spec.js | 77 - node_modules/pem/test/openssl.spec.js | 47 - node_modules/pem/test/pem.helper.js | 132 - node_modules/pem/test/pem.spec.js | 963 - node_modules/plur/index.js | 9 - node_modules/plur/license | 21 - node_modules/plur/package.json | 69 - node_modules/plur/readme.md | 52 - node_modules/posix-character-classes/LICENSE | 21 - .../posix-character-classes/README.md | 103 - node_modules/posix-character-classes/index.js | 22 - .../posix-character-classes/package.json | 85 - node_modules/preserve/.gitattributes | 14 - node_modules/preserve/.jshintrc | 24 - node_modules/preserve/.npmignore | 53 - node_modules/preserve/.travis.yml | 3 - node_modules/preserve/.verb.md | 59 - node_modules/preserve/LICENSE | 24 - node_modules/preserve/README.md | 90 - node_modules/preserve/index.js | 54 - node_modules/preserve/package.json | 73 - node_modules/preserve/test.js | 48 - node_modules/prettier-bytes/.npmignore | 27 - node_modules/prettier-bytes/.travis.yml | 9 - node_modules/prettier-bytes/CHANGELOG.md | 7 - node_modules/prettier-bytes/CONTRIBUTING.md | 61 - node_modules/prettier-bytes/LICENSE | 5 - node_modules/prettier-bytes/README.md | 64 - node_modules/prettier-bytes/index.js | 30 - node_modules/prettier-bytes/package.json | 59 - node_modules/prettier-bytes/test/index.js | 44 - node_modules/pretty-ms/index.js | 47 - node_modules/pretty-ms/license | 21 - node_modules/pretty-ms/package.json | 80 - node_modules/pretty-ms/readme.md | 89 - node_modules/process-nextick-args/index.js | 44 - node_modules/process-nextick-args/license.md | 19 - .../process-nextick-args/package.json | 50 - node_modules/process-nextick-args/readme.md | 18 - node_modules/process/.eslintrc | 21 - node_modules/process/LICENSE | 22 - node_modules/process/README.md | 26 - node_modules/process/browser.js | 184 - node_modules/process/index.js | 2 - node_modules/process/package.json | 61 - node_modules/process/test.js | 199 - node_modules/public-encrypt/.travis.yml | 6 - node_modules/public-encrypt/LICENSE | 19 - node_modules/public-encrypt/browser.js | 10 - node_modules/public-encrypt/index.js | 18 - node_modules/public-encrypt/mgf.js | 19 - node_modules/public-encrypt/package.json | 64 - node_modules/public-encrypt/privateDecrypt.js | 105 - node_modules/public-encrypt/publicEncrypt.js | 88 - node_modules/public-encrypt/readme.md | 8 - node_modules/public-encrypt/test/1024.priv | 16 - node_modules/public-encrypt/test/1024.pub | 6 - node_modules/public-encrypt/test/ec.pass.priv | 7 - node_modules/public-encrypt/test/ec.priv | 5 - node_modules/public-encrypt/test/ec.pub | 4 - node_modules/public-encrypt/test/index.js | 113 - node_modules/public-encrypt/test/nodeTests.js | 51 - .../public-encrypt/test/pass.1024.priv | 18 - .../public-encrypt/test/pass.1024.pub | 6 - .../public-encrypt/test/rsa.1024.priv | 15 - node_modules/public-encrypt/test/rsa.1024.pub | 5 - .../public-encrypt/test/rsa.2028.priv | 27 - node_modules/public-encrypt/test/rsa.2028.pub | 8 - .../public-encrypt/test/rsa.pass.priv | 30 - node_modules/public-encrypt/test/rsa.pass.pub | 9 - .../public-encrypt/test/test_cert.pem | 20 - node_modules/public-encrypt/test/test_key.pem | 15 - .../public-encrypt/test/test_rsa_privkey.pem | 15 - .../test/test_rsa_privkey_encrypted.pem | 18 - .../public-encrypt/test/test_rsa_pubkey.pem | 6 - node_modules/public-encrypt/withPublic.js | 12 - node_modules/public-encrypt/xor.js | 8 - node_modules/punycode/LICENSE-MIT.txt | 20 - node_modules/punycode/README.md | 176 - node_modules/punycode/package.json | 87 - node_modules/punycode/punycode.js | 533 - node_modules/query-string/index.js | 205 - node_modules/query-string/license | 21 - node_modules/query-string/package.json | 76 - node_modules/query-string/readme.md | 184 - node_modules/querystring-es3/.travis.yml | 4 - node_modules/querystring-es3/History.md | 20 - node_modules/querystring-es3/License.md | 19 - node_modules/querystring-es3/Readme.md | 15 - node_modules/querystring-es3/decode.js | 84 - node_modules/querystring-es3/encode.js | 85 - node_modules/querystring-es3/index.js | 4 - node_modules/querystring-es3/package.json | 100 - .../querystring-es3/test/common-index.js | 3 - node_modules/querystring-es3/test/index.js | 210 - .../querystring-es3/test/tap-index.js | 3 - node_modules/querystring/.History.md.un~ | Bin 7960 -> 0 bytes node_modules/querystring/.Readme.md.un~ | Bin 3225 -> 0 bytes node_modules/querystring/.package.json.un~ | Bin 5710 -> 0 bytes node_modules/querystring/.travis.yml | 4 - node_modules/querystring/History.md | 20 - node_modules/querystring/License.md | 19 - node_modules/querystring/Readme.md | 15 - node_modules/querystring/decode.js | 80 - node_modules/querystring/encode.js | 64 - node_modules/querystring/index.js | 4 - node_modules/querystring/package.json | 100 - node_modules/querystring/test/.index.js.un~ | Bin 975 -> 0 bytes node_modules/querystring/test/common-index.js | 3 - node_modules/querystring/test/index.js | 210 - node_modules/querystring/test/tap-index.js | 3 - node_modules/randomatic/LICENSE | 21 - node_modules/randomatic/README.md | 193 - node_modules/randomatic/index.js | 95 - .../randomatic/node_modules/is-number/LICENSE | 21 - .../node_modules/is-number/README.md | 135 - .../node_modules/is-number/index.js | 21 - .../node_modules/is-number/package.json | 113 - .../node_modules/kind-of/CHANGELOG.md | 157 - .../randomatic/node_modules/kind-of/LICENSE | 21 - .../randomatic/node_modules/kind-of/README.md | 365 - .../randomatic/node_modules/kind-of/index.js | 129 - .../node_modules/kind-of/package.json | 143 - node_modules/randomatic/package.json | 135 - node_modules/randombytes/.travis.yml | 15 - node_modules/randombytes/.zuul.yml | 1 - node_modules/randombytes/LICENSE | 21 - node_modules/randombytes/README.md | 14 - node_modules/randombytes/browser.js | 38 - node_modules/randombytes/index.js | 1 - node_modules/randombytes/package.json | 65 - node_modules/randombytes/test.js | 56 - node_modules/randomfill/.travis.yml | 15 - node_modules/randomfill/.zuul.yml | 1 - node_modules/randomfill/LICENSE | 21 - node_modules/randomfill/README.md | 15 - node_modules/randomfill/browser.js | 108 - node_modules/randomfill/index.js | 7 - node_modules/randomfill/package.json | 62 - node_modules/randomfill/test.js | 28 - node_modules/range-parser/HISTORY.md | 51 - node_modules/range-parser/LICENSE | 23 - node_modules/range-parser/README.md | 75 - node_modules/range-parser/index.js | 158 - node_modules/range-parser/package.json | 86 - node_modules/read-only-stream/.travis.yml | 6 - node_modules/read-only-stream/LICENSE | 18 - node_modules/read-only-stream/example/main.js | 3 - node_modules/read-only-stream/example/wrap.js | 8 - node_modules/read-only-stream/index.js | 30 - node_modules/read-only-stream/package.json | 63 - node_modules/read-only-stream/readme.markdown | 60 - node_modules/read-only-stream/test/error.js | 15 - node_modules/read-only-stream/test/ro.js | 22 - .../read-only-stream/test/streams1.js | 21 - node_modules/readable-stream/.travis.yml | 55 - node_modules/readable-stream/CONTRIBUTING.md | 38 - node_modules/readable-stream/GOVERNANCE.md | 136 - node_modules/readable-stream/LICENSE | 47 - node_modules/readable-stream/README.md | 58 - .../doc/wg-meetings/2015-01-30.md | 60 - .../readable-stream/duplex-browser.js | 1 - node_modules/readable-stream/duplex.js | 1 - .../readable-stream/lib/_stream_duplex.js | 131 - .../lib/_stream_passthrough.js | 47 - .../readable-stream/lib/_stream_readable.js | 1019 - .../readable-stream/lib/_stream_transform.js | 214 - .../readable-stream/lib/_stream_writable.js | 687 - .../lib/internal/streams/BufferList.js | 79 - .../lib/internal/streams/destroy.js | 74 - .../lib/internal/streams/stream-browser.js | 1 - .../lib/internal/streams/stream.js | 1 - node_modules/readable-stream/package.json | 93 - node_modules/readable-stream/passthrough.js | 1 - .../readable-stream/readable-browser.js | 7 - node_modules/readable-stream/readable.js | 19 - node_modules/readable-stream/transform.js | 1 - .../readable-stream/writable-browser.js | 1 - node_modules/readable-stream/writable.js | 8 - node_modules/readdirp/LICENSE | 20 - node_modules/readdirp/README.md | 204 - .../readdirp/node_modules/arr-diff/LICENSE | 21 - .../readdirp/node_modules/arr-diff/README.md | 130 - .../readdirp/node_modules/arr-diff/index.js | 47 - .../node_modules/arr-diff/package.json | 108 - .../node_modules/array-unique/LICENSE | 21 - .../node_modules/array-unique/README.md | 77 - .../node_modules/array-unique/index.js | 43 - .../node_modules/array-unique/package.json | 95 - .../readdirp/node_modules/braces/LICENSE | 21 - .../readdirp/node_modules/braces/README.md | 640 - .../readdirp/node_modules/braces/index.js | 318 - .../node_modules/braces/lib/braces.js | 104 - .../node_modules/braces/lib/compilers.js | 282 - .../node_modules/braces/lib/parsers.js | 360 - .../readdirp/node_modules/braces/lib/utils.js | 343 - .../node_modules/extend-shallow/LICENSE | 21 - .../node_modules/extend-shallow/README.md | 61 - .../node_modules/extend-shallow/index.js | 33 - .../node_modules/extend-shallow/package.json | 87 - .../readdirp/node_modules/braces/package.json | 156 - .../node_modules/expand-brackets/LICENSE | 21 - .../node_modules/expand-brackets/README.md | 302 - .../node_modules/expand-brackets/changelog.md | 35 - .../node_modules/expand-brackets/index.js | 211 - .../expand-brackets/lib/compilers.js | 87 - .../expand-brackets/lib/parsers.js | 219 - .../node_modules/expand-brackets/lib/utils.js | 34 - .../node_modules/define-property/LICENSE | 21 - .../node_modules/define-property/README.md | 77 - .../node_modules/define-property/index.js | 31 - .../node_modules/define-property/package.json | 82 - .../node_modules/extend-shallow/LICENSE | 21 - .../node_modules/extend-shallow/README.md | 61 - .../node_modules/extend-shallow/index.js | 33 - .../node_modules/extend-shallow/package.json | 87 - .../is-accessor-descriptor/LICENSE | 21 - .../is-accessor-descriptor/README.md | 123 - .../is-accessor-descriptor/index.js | 69 - .../node_modules/kind-of/LICENSE | 21 - .../node_modules/kind-of/README.md | 261 - .../node_modules/kind-of/index.js | 116 - .../node_modules/kind-of/package.json | 139 - .../is-accessor-descriptor/package.json | 94 - .../node_modules/is-data-descriptor/LICENSE | 21 - .../node_modules/is-data-descriptor/README.md | 128 - .../node_modules/is-data-descriptor/index.js | 55 - .../node_modules/kind-of/LICENSE | 21 - .../node_modules/kind-of/README.md | 261 - .../node_modules/kind-of/index.js | 116 - .../node_modules/kind-of/package.json | 139 - .../is-data-descriptor/package.json | 93 - .../node_modules/is-descriptor/LICENSE | 21 - .../node_modules/is-descriptor/README.md | 193 - .../node_modules/is-descriptor/index.js | 22 - .../node_modules/is-descriptor/package.json | 114 - .../node_modules/kind-of/LICENSE | 21 - .../node_modules/kind-of/README.md | 342 - .../node_modules/kind-of/index.js | 147 - .../node_modules/kind-of/package.json | 146 - .../node_modules/expand-brackets/package.json | 133 - .../readdirp/node_modules/extglob/LICENSE | 21 - .../readdirp/node_modules/extglob/README.md | 362 - .../node_modules/extglob/changelog.md | 25 - .../readdirp/node_modules/extglob/index.js | 331 - .../node_modules/extglob/lib/.DS_Store | Bin 6148 -> 0 bytes .../node_modules/extglob/lib/compilers.js | 169 - .../node_modules/extglob/lib/extglob.js | 78 - .../node_modules/extglob/lib/parsers.js | 156 - .../node_modules/extglob/lib/utils.js | 69 - .../node_modules/define-property/LICENSE | 21 - .../node_modules/define-property/README.md | 95 - .../node_modules/define-property/index.js | 31 - .../node_modules/define-property/package.json | 93 - .../node_modules/extend-shallow/LICENSE | 21 - .../node_modules/extend-shallow/README.md | 61 - .../node_modules/extend-shallow/index.js | 33 - .../node_modules/extend-shallow/package.json | 87 - .../node_modules/extglob/package.json | 160 - .../readdirp/node_modules/fill-range/LICENSE | 21 - .../node_modules/fill-range/README.md | 250 - .../readdirp/node_modules/fill-range/index.js | 208 - .../node_modules/extend-shallow/LICENSE | 21 - .../node_modules/extend-shallow/README.md | 61 - .../node_modules/extend-shallow/index.js | 33 - .../node_modules/extend-shallow/package.json | 87 - .../node_modules/fill-range/package.json | 130 - .../is-accessor-descriptor/LICENSE | 21 - .../is-accessor-descriptor/README.md | 144 - .../is-accessor-descriptor/index.js | 69 - .../is-accessor-descriptor/package.json | 110 - .../node_modules/is-data-descriptor/LICENSE | 21 - .../node_modules/is-data-descriptor/README.md | 161 - .../node_modules/is-data-descriptor/index.js | 49 - .../is-data-descriptor/package.json | 109 - .../node_modules/is-descriptor/LICENSE | 21 - .../node_modules/is-descriptor/README.md | 193 - .../node_modules/is-descriptor/index.js | 22 - .../node_modules/is-descriptor/package.json | 114 - .../readdirp/node_modules/is-number/LICENSE | 21 - .../readdirp/node_modules/is-number/README.md | 115 - .../readdirp/node_modules/is-number/index.js | 22 - .../is-number/node_modules/kind-of/LICENSE | 21 - .../is-number/node_modules/kind-of/README.md | 261 - .../is-number/node_modules/kind-of/index.js | 116 - .../node_modules/kind-of/package.json | 139 - .../node_modules/is-number/package.json | 123 - .../readdirp/node_modules/isobject/LICENSE | 21 - .../readdirp/node_modules/isobject/README.md | 122 - .../readdirp/node_modules/isobject/index.d.ts | 5 - .../readdirp/node_modules/isobject/index.js | 12 - .../node_modules/isobject/package.json | 119 - .../node_modules/kind-of/CHANGELOG.md | 157 - .../readdirp/node_modules/kind-of/LICENSE | 21 - .../readdirp/node_modules/kind-of/README.md | 365 - .../readdirp/node_modules/kind-of/index.js | 129 - .../node_modules/kind-of/package.json | 146 - .../node_modules/micromatch/CHANGELOG.md | 37 - .../readdirp/node_modules/micromatch/LICENSE | 21 - .../node_modules/micromatch/README.md | 1150 - .../readdirp/node_modules/micromatch/index.js | 877 - .../node_modules/micromatch/lib/.DS_Store | Bin 6148 -> 0 bytes .../node_modules/micromatch/lib/cache.js | 1 - .../node_modules/micromatch/lib/compilers.js | 77 - .../node_modules/micromatch/lib/parsers.js | 83 - .../node_modules/micromatch/lib/utils.js | 309 - .../node_modules/micromatch/package.json | 216 - node_modules/readdirp/package.json | 101 - node_modules/readdirp/readdirp.js | 294 - node_modules/readdirp/stream-api.js | 98 - node_modules/regenerator-runtime/README.md | 31 - node_modules/regenerator-runtime/package.json | 46 - node_modules/regenerator-runtime/path.js | 11 - .../regenerator-runtime/runtime-module.js | 35 - node_modules/regenerator-runtime/runtime.js | 727 - node_modules/regex-cache/LICENSE | 21 - node_modules/regex-cache/README.md | 166 - node_modules/regex-cache/index.js | 68 - node_modules/regex-cache/package.json | 101 - node_modules/regex-not/LICENSE | 21 - node_modules/regex-not/README.md | 133 - node_modules/regex-not/index.js | 72 - node_modules/regex-not/package.json | 98 - node_modules/reload-css/LICENSE.md | 21 - node_modules/reload-css/README.md | 31 - node_modules/reload-css/index.js | 244 - node_modules/reload-css/lib/url.js | 21 - node_modules/reload-css/package.json | 66 - .../remove-trailing-separator/history.md | 17 - .../remove-trailing-separator/index.js | 17 - .../remove-trailing-separator/license | 3 - .../remove-trailing-separator/package.json | 64 - .../remove-trailing-separator/readme.md | 51 - node_modules/repeat-element/LICENSE | 21 - node_modules/repeat-element/README.md | 99 - node_modules/repeat-element/index.js | 18 - node_modules/repeat-element/package.json | 82 - node_modules/repeat-string/LICENSE | 21 - node_modules/repeat-string/README.md | 136 - node_modules/repeat-string/index.js | 70 - node_modules/repeat-string/package.json | 132 - node_modules/resolve-url/.jshintrc | 44 - node_modules/resolve-url/LICENSE | 21 - node_modules/resolve-url/bower.json | 15 - node_modules/resolve-url/changelog.md | 15 - node_modules/resolve-url/component.json | 15 - node_modules/resolve-url/package.json | 68 - node_modules/resolve-url/readme.md | 83 - node_modules/resolve-url/resolve-url.js | 47 - node_modules/resolve-url/test/resolve-url.js | 70 - node_modules/resolve/.editorconfig | 20 - node_modules/resolve/.eslintignore | 1 - node_modules/resolve/.eslintrc | 30 - node_modules/resolve/.travis.yml | 219 - node_modules/resolve/LICENSE | 18 - node_modules/resolve/appveyor.yml | 47 - node_modules/resolve/example/async.js | 5 - node_modules/resolve/example/sync.js | 3 - node_modules/resolve/index.js | 8 - node_modules/resolve/lib/async.js | 206 - node_modules/resolve/lib/caller.js | 8 - node_modules/resolve/lib/core.js | 53 - node_modules/resolve/lib/core.json | 72 - .../resolve/lib/node-modules-paths.js | 45 - node_modules/resolve/lib/sync.js | 132 - node_modules/resolve/package.json | 71 - node_modules/resolve/readme.markdown | 173 - node_modules/resolve/test/.eslintrc | 5 - node_modules/resolve/test/core.js | 82 - node_modules/resolve/test/dotdot.js | 29 - node_modules/resolve/test/dotdot/abc/index.js | 2 - node_modules/resolve/test/dotdot/index.js | 1 - node_modules/resolve/test/faulty_basedir.js | 13 - node_modules/resolve/test/filter.js | 34 - node_modules/resolve/test/filter_sync.js | 26 - node_modules/resolve/test/mock.js | 143 - node_modules/resolve/test/mock_sync.js | 67 - node_modules/resolve/test/module_dir.js | 56 - .../test/module_dir/xmodules/aaa/index.js | 1 - .../test/module_dir/ymodules/aaa/index.js | 1 - .../test/module_dir/zmodules/bbb/main.js | 1 - .../test/module_dir/zmodules/bbb/package.json | 3 - .../resolve/test/node-modules-paths.js | 93 - node_modules/resolve/test/node_path.js | 49 - .../resolve/test/node_path/x/aaa/index.js | 1 - .../resolve/test/node_path/x/ccc/index.js | 1 - .../resolve/test/node_path/y/bbb/index.js | 1 - .../resolve/test/node_path/y/ccc/index.js | 1 - node_modules/resolve/test/nonstring.js | 9 - node_modules/resolve/test/pathfilter.js | 75 - .../resolve/test/pathfilter/deep_ref/main.js | 0 node_modules/resolve/test/precedence.js | 23 - node_modules/resolve/test/precedence/aaa.js | 1 - .../resolve/test/precedence/aaa/index.js | 1 - .../resolve/test/precedence/aaa/main.js | 1 - node_modules/resolve/test/precedence/bbb.js | 1 - .../resolve/test/precedence/bbb/main.js | 1 - node_modules/resolve/test/resolver.js | 402 - .../resolve/test/resolver/baz/doom.js | 0 .../resolve/test/resolver/baz/package.json | 3 - .../resolve/test/resolver/baz/quux.js | 1 - .../resolve/test/resolver/browser_field/a.js | 0 .../resolve/test/resolver/browser_field/b.js | 0 .../test/resolver/browser_field/package.json | 5 - node_modules/resolve/test/resolver/cup.coffee | 1 - .../resolve/test/resolver/dot_main/index.js | 1 - .../test/resolver/dot_main/package.json | 3 - .../test/resolver/dot_slash_main/index.js | 1 - .../test/resolver/dot_slash_main/package.json | 3 - node_modules/resolve/test/resolver/foo.js | 1 - .../test/resolver/incorrect_main/index.js | 2 - .../test/resolver/incorrect_main/package.json | 3 - node_modules/resolve/test/resolver/mug.coffee | 0 node_modules/resolve/test/resolver/mug.js | 0 .../test/resolver/other_path/lib/other-lib.js | 0 .../resolve/test/resolver/other_path/root.js | 0 .../resolve/test/resolver/quux/foo/index.js | 1 - .../resolve/test/resolver/same_names/foo.js | 1 - .../test/resolver/same_names/foo/index.js | 1 - .../resolver/symlinked/_/node_modules/foo.js | 0 .../symlinked/_/symlink_target/.gitkeep | 0 .../test/resolver/without_basedir/main.js | 5 - node_modules/resolve/test/resolver_sync.js | 311 - node_modules/resolve/test/subdirs.js | 13 - node_modules/resolve/test/symlinks.js | 56 - node_modules/resp-modifier/README.md | 14 - node_modules/resp-modifier/index.js | 186 - node_modules/resp-modifier/lib/utils.js | 157 - node_modules/resp-modifier/package.json | 73 - node_modules/ret/LICENSE | 19 - node_modules/ret/README.md | 183 - node_modules/ret/lib/index.js | 282 - node_modules/ret/lib/positions.js | 17 - node_modules/ret/lib/sets.js | 82 - node_modules/ret/lib/types.js | 10 - node_modules/ret/lib/util.js | 111 - node_modules/ret/package.json | 67 - node_modules/right-now/LICENSE.md | 18 - node_modules/right-now/README.md | 28 - node_modules/right-now/browser.js | 7 - node_modules/right-now/index.js | 4 - node_modules/right-now/package.json | 60 - node_modules/ripemd160/CHANGELOG.md | 72 - node_modules/ripemd160/LICENSE | 21 - node_modules/ripemd160/README.md | 27 - node_modules/ripemd160/index.js | 163 - node_modules/ripemd160/package.json | 68 - node_modules/safe-buffer/LICENSE | 21 - node_modules/safe-buffer/README.md | 584 - node_modules/safe-buffer/index.d.ts | 187 - node_modules/safe-buffer/index.js | 62 - node_modules/safe-buffer/package.json | 76 - node_modules/safe-regex/.travis.yml | 4 - node_modules/safe-regex/LICENSE | 18 - node_modules/safe-regex/example/safe.js | 3 - node_modules/safe-regex/index.js | 43 - node_modules/safe-regex/package.json | 74 - node_modules/safe-regex/readme.markdown | 65 - node_modules/safe-regex/test/regex.js | 50 - node_modules/semver/LICENSE | 15 - node_modules/semver/README.md | 399 - node_modules/semver/bin/semver | 153 - node_modules/semver/package.json | 54 - node_modules/semver/range.bnf | 16 - node_modules/semver/semver.js | 1352 - node_modules/send/HISTORY.md | 462 - node_modules/send/LICENSE | 23 - node_modules/send/README.md | 306 - node_modules/send/index.js | 1130 - node_modules/send/package.json | 105 - node_modules/serve-static/HISTORY.md | 433 - node_modules/serve-static/LICENSE | 25 - node_modules/serve-static/README.md | 258 - node_modules/serve-static/index.js | 210 - node_modules/serve-static/package.json | 75 - node_modules/set-value/LICENSE | 21 - node_modules/set-value/README.md | 150 - node_modules/set-value/index.js | 51 - .../node_modules/extend-shallow/LICENSE | 21 - .../node_modules/extend-shallow/README.md | 61 - .../node_modules/extend-shallow/index.js | 33 - .../node_modules/extend-shallow/package.json | 87 - node_modules/set-value/package.json | 120 - node_modules/setprototypeof/LICENSE | 13 - node_modules/setprototypeof/README.md | 26 - node_modules/setprototypeof/index.d.ts | 2 - node_modules/setprototypeof/index.js | 15 - node_modules/setprototypeof/package.json | 52 - node_modules/sha.js/.travis.yml | 17 - node_modules/sha.js/LICENSE | 49 - node_modules/sha.js/README.md | 44 - node_modules/sha.js/bin.js | 41 - node_modules/sha.js/hash.js | 81 - node_modules/sha.js/index.js | 15 - node_modules/sha.js/package.json | 67 - node_modules/sha.js/sha.js | 94 - node_modules/sha.js/sha1.js | 99 - node_modules/sha.js/sha224.js | 53 - node_modules/sha.js/sha256.js | 135 - node_modules/sha.js/sha384.js | 57 - node_modules/sha.js/sha512.js | 260 - node_modules/sha.js/test/hash.js | 75 - node_modules/sha.js/test/test.js | 100 - node_modules/sha.js/test/vectors.js | 72 - node_modules/shasum/.npmignore | 3 - node_modules/shasum/.travis.yml | 4 - node_modules/shasum/LICENSE | 22 - node_modules/shasum/README.md | 15 - node_modules/shasum/browser.js | 13 - node_modules/shasum/index.js | 13 - node_modules/shasum/package.json | 56 - node_modules/shasum/test/index.js | 18 - node_modules/shebang-command/index.js | 19 - node_modules/shebang-command/license | 21 - node_modules/shebang-command/package.json | 71 - node_modules/shebang-command/readme.md | 39 - node_modules/shebang-regex/index.js | 2 - node_modules/shebang-regex/license | 21 - node_modules/shebang-regex/package.json | 64 - node_modules/shebang-regex/readme.md | 29 - node_modules/shell-quote/.travis.yml | 4 - node_modules/shell-quote/LICENSE | 24 - node_modules/shell-quote/example/env.js | 3 - node_modules/shell-quote/example/op.js | 3 - node_modules/shell-quote/example/parse.js | 3 - node_modules/shell-quote/example/quote.js | 3 - node_modules/shell-quote/index.js | 199 - node_modules/shell-quote/package.json | 81 - node_modules/shell-quote/readme.markdown | 142 - node_modules/shell-quote/test/comment.js | 14 - node_modules/shell-quote/test/env.js | 39 - node_modules/shell-quote/test/env_fn.js | 19 - node_modules/shell-quote/test/op.js | 67 - node_modules/shell-quote/test/parse.js | 23 - node_modules/shell-quote/test/quote.js | 33 - node_modules/shell-quote/test/set.js | 29 - node_modules/signal-exit/CHANGELOG.md | 27 - node_modules/signal-exit/LICENSE.txt | 16 - node_modules/signal-exit/README.md | 40 - node_modules/signal-exit/index.js | 157 - node_modules/signal-exit/package.json | 66 - node_modules/signal-exit/signals.js | 53 - node_modules/simple-concat/.travis.yml | 3 - node_modules/simple-concat/LICENSE | 20 - node_modules/simple-concat/README.md | 42 - node_modules/simple-concat/index.js | 14 - node_modules/simple-concat/package.json | 58 - node_modules/simple-concat/test/basic.js | 41 - node_modules/simple-html-index/LICENSE.md | 21 - node_modules/simple-html-index/README.md | 71 - node_modules/simple-html-index/index.js | 24 - node_modules/simple-html-index/package.json | 63 - node_modules/snapdragon-node/LICENSE | 21 - node_modules/snapdragon-node/README.md | 453 - node_modules/snapdragon-node/index.js | 492 - .../node_modules/define-property/LICENSE | 21 - .../node_modules/define-property/README.md | 95 - .../node_modules/define-property/index.js | 31 - .../node_modules/define-property/package.json | 93 - .../is-accessor-descriptor/LICENSE | 21 - .../is-accessor-descriptor/README.md | 144 - .../is-accessor-descriptor/index.js | 69 - .../is-accessor-descriptor/package.json | 110 - .../node_modules/is-data-descriptor/LICENSE | 21 - .../node_modules/is-data-descriptor/README.md | 161 - .../node_modules/is-data-descriptor/index.js | 49 - .../is-data-descriptor/package.json | 109 - .../node_modules/is-descriptor/LICENSE | 21 - .../node_modules/is-descriptor/README.md | 193 - .../node_modules/is-descriptor/index.js | 22 - .../node_modules/is-descriptor/package.json | 114 - .../node_modules/isobject/LICENSE | 21 - .../node_modules/isobject/README.md | 122 - .../node_modules/isobject/index.d.ts | 5 - .../node_modules/isobject/index.js | 12 - .../node_modules/isobject/package.json | 119 - .../node_modules/kind-of/CHANGELOG.md | 157 - .../node_modules/kind-of/LICENSE | 21 - .../node_modules/kind-of/README.md | 365 - .../node_modules/kind-of/index.js | 129 - .../node_modules/kind-of/package.json | 145 - node_modules/snapdragon-node/package.json | 107 - node_modules/snapdragon-util/LICENSE | 21 - node_modules/snapdragon-util/README.md | 807 - node_modules/snapdragon-util/index.js | 1019 - node_modules/snapdragon-util/package.json | 96 - node_modules/snapdragon/LICENSE | 21 - node_modules/snapdragon/README.md | 321 - node_modules/snapdragon/index.js | 174 - node_modules/snapdragon/lib/compiler.js | 177 - node_modules/snapdragon/lib/parser.js | 533 - node_modules/snapdragon/lib/position.js | 14 - node_modules/snapdragon/lib/source-maps.js | 145 - node_modules/snapdragon/lib/utils.js | 48 - .../node_modules/define-property/LICENSE | 21 - .../node_modules/define-property/README.md | 77 - .../node_modules/define-property/index.js | 31 - .../node_modules/define-property/package.json | 82 - .../node_modules/extend-shallow/LICENSE | 21 - .../node_modules/extend-shallow/README.md | 61 - .../node_modules/extend-shallow/index.js | 33 - .../node_modules/extend-shallow/package.json | 87 - node_modules/snapdragon/package.json | 126 - node_modules/source-map-resolve/.jshintrc | 46 - node_modules/source-map-resolve/.travis.yml | 3 - node_modules/source-map-resolve/LICENSE | 21 - node_modules/source-map-resolve/bower.json | 30 - node_modules/source-map-resolve/changelog.md | 100 - .../source-map-resolve/component.json | 29 - .../generate-source-map-resolve.js | 28 - .../lib/decode-uri-component.js | 11 - .../source-map-resolve/lib/resolve-url.js | 12 - .../lib/source-map-resolve-node.js | 302 - node_modules/source-map-resolve/package.json | 77 - node_modules/source-map-resolve/readme.md | 231 - .../source-map-resolve/source-map-resolve.js | 309 - .../source-map-resolve.js.template | 22 - .../source-map-resolve/test/common.js | 27 - node_modules/source-map-resolve/test/read.js | 105 - .../test/source-map-resolve.js | 1162 - .../source-map-resolve/test/windows.js | 166 - .../source-map-resolve/x-package.json5 | 68 - node_modules/source-map-url/.jshintrc | 43 - node_modules/source-map-url/LICENSE | 21 - node_modules/source-map-url/bower.json | 20 - node_modules/source-map-url/changelog.md | 52 - node_modules/source-map-url/component.json | 18 - node_modules/source-map-url/package.json | 73 - node_modules/source-map-url/readme.md | 97 - node_modules/source-map-url/source-map-url.js | 57 - .../source-map-url/test/source-map-url.js | 402 - node_modules/source-map-url/x-package.json5 | 55 - node_modules/source-map/CHANGELOG.md | 301 - node_modules/source-map/LICENSE | 28 - node_modules/source-map/README.md | 729 - .../source-map/dist/source-map.debug.js | 3091 -- node_modules/source-map/dist/source-map.js | 3090 -- .../source-map/dist/source-map.min.js | 2 - .../source-map/dist/source-map.min.js.map | 1 - node_modules/source-map/lib/array-set.js | 121 - node_modules/source-map/lib/base64-vlq.js | 140 - node_modules/source-map/lib/base64.js | 67 - node_modules/source-map/lib/binary-search.js | 111 - node_modules/source-map/lib/mapping-list.js | 79 - node_modules/source-map/lib/quick-sort.js | 114 - .../source-map/lib/source-map-consumer.js | 1082 - .../source-map/lib/source-map-generator.js | 416 - node_modules/source-map/lib/source-node.js | 413 - node_modules/source-map/lib/util.js | 417 - node_modules/source-map/package.json | 213 - node_modules/source-map/source-map.js | 8 - node_modules/split-string/LICENSE | 21 - node_modules/split-string/README.md | 321 - node_modules/split-string/index.js | 171 - node_modules/split-string/package.json | 103 - node_modules/split2/.README.md.un~ | Bin 33830 -> 0 bytes node_modules/split2/.index.js.un~ | Bin 108894 -> 0 bytes node_modules/split2/.npmignore | 7 - node_modules/split2/.package.json.un~ | Bin 6123 -> 0 bytes node_modules/split2/.test.js.un~ | Bin 96451 -> 0 bytes node_modules/split2/.travis.yml | 3 - node_modules/split2/LICENSE | 13 - node_modules/split2/README.md | 74 - node_modules/split2/index.js | 83 - .../split2/node_modules/isarray/README.md | 54 - .../node_modules/isarray/build/build.js | 209 - .../node_modules/isarray/component.json | 19 - .../split2/node_modules/isarray/index.js | 3 - .../split2/node_modules/isarray/package.json | 57 - .../node_modules/readable-stream/.npmignore | 5 - .../node_modules/readable-stream/LICENSE | 18 - .../node_modules/readable-stream/README.md | 15 - .../node_modules/readable-stream/duplex.js | 1 - .../readable-stream/lib/_stream_duplex.js | 89 - .../lib/_stream_passthrough.js | 46 - .../readable-stream/lib/_stream_readable.js | 982 - .../readable-stream/lib/_stream_transform.js | 210 - .../readable-stream/lib/_stream_writable.js | 386 - .../node_modules/readable-stream/package.json | 65 - .../readable-stream/passthrough.js | 1 - .../node_modules/readable-stream/readable.js | 11 - .../node_modules/readable-stream/transform.js | 1 - .../node_modules/readable-stream/writable.js | 1 - .../node_modules/string_decoder/.npmignore | 2 - .../node_modules/string_decoder/LICENSE | 20 - .../node_modules/string_decoder/README.md | 7 - .../node_modules/string_decoder/index.js | 221 - .../node_modules/string_decoder/package.json | 53 - .../split2/node_modules/through2/.npmignore | 3 - .../split2/node_modules/through2/LICENSE | 39 - .../split2/node_modules/through2/README.md | 132 - .../split2/node_modules/through2/package.json | 64 - .../split2/node_modules/through2/through2.js | 96 - node_modules/split2/package.json | 63 - node_modules/split2/test.js | 149 - node_modules/stacked/.jshintrc | 24 - node_modules/stacked/.npmignore | 2 - node_modules/stacked/.travis.yml | 3 - node_modules/stacked/README.md | 71 - node_modules/stacked/package.json | 57 - node_modules/stacked/stacked.js | 67 - node_modules/stacked/test/stacked.js | 111 - node_modules/static-extend/LICENSE | 21 - node_modules/static-extend/index.js | 90 - .../node_modules/define-property/LICENSE | 21 - .../node_modules/define-property/README.md | 77 - .../node_modules/define-property/index.js | 31 - .../node_modules/define-property/package.json | 82 - node_modules/static-extend/package.json | 96 - node_modules/statuses/HISTORY.md | 60 - node_modules/statuses/LICENSE | 23 - node_modules/statuses/README.md | 127 - node_modules/statuses/codes.json | 65 - node_modules/statuses/index.js | 113 - node_modules/statuses/package.json | 88 - node_modules/stdout-stream/.travis.yml | 6 - node_modules/stdout-stream/LICENSE | 20 - node_modules/stdout-stream/README.md | 45 - node_modules/stdout-stream/index.js | 53 - node_modules/stdout-stream/package.json | 49 - .../stdout-stream/test/fixtures/end.js | 8 - .../test/fixtures/hello-world.js | 4 - node_modules/stdout-stream/test/index.js | 33 - node_modules/stream-browserify/.npmignore | 1 - node_modules/stream-browserify/.travis.yml | 9 - node_modules/stream-browserify/LICENSE | 18 - node_modules/stream-browserify/index.js | 127 - node_modules/stream-browserify/package.json | 79 - .../stream-browserify/readme.markdown | 25 - node_modules/stream-browserify/test/buf.js | 32 - node_modules/stream-combiner2/.npmignore | 3 - node_modules/stream-combiner2/.travis.yml | 6 - node_modules/stream-combiner2/LICENSE | 22 - node_modules/stream-combiner2/README.md | 37 - node_modules/stream-combiner2/index.js | 68 - node_modules/stream-combiner2/package.json | 56 - node_modules/stream-combiner2/test/index.js | 98 - node_modules/stream-http/.airtap.yml | 23 - node_modules/stream-http/.travis.yml | 7 - node_modules/stream-http/LICENSE | 24 - node_modules/stream-http/README.md | 144 - node_modules/stream-http/ie8-polyfill.js | 168 - node_modules/stream-http/index.js | 85 - node_modules/stream-http/lib/capability.js | 73 - node_modules/stream-http/lib/request.js | 327 - node_modules/stream-http/lib/response.js | 224 - node_modules/stream-http/package.json | 73 - .../stream-http/test/browser/abort.js | 55 - node_modules/stream-http/test/browser/auth.js | 22 - .../test/browser/binary-streaming.js | 71 - .../stream-http/test/browser/binary.js | 32 - .../stream-http/test/browser/body-empty.js | 29 - .../stream-http/test/browser/cookie.js | 25 - .../stream-http/test/browser/disable-fetch.js | 37 - .../test/browser/error.js.disabled | 12 - .../stream-http/test/browser/headers.js | 116 - .../test/browser/lib/webworker-worker.js | 20 - .../stream-http/test/browser/package.json | 5 - .../stream-http/test/browser/post-binary.js | 41 - .../stream-http/test/browser/post-text.js | 48 - .../test/browser/text-streaming.js | 43 - node_modules/stream-http/test/browser/text.js | 43 - .../stream-http/test/browser/timeout.js | 43 - .../stream-http/test/browser/webworker.js | 31 - .../stream-http/test/node/http-browserify.js | 147 - node_modules/stream-http/test/server/index.js | 137 - .../stream-http/test/server/static/basic.txt | 19 - .../test/server/static/browserify.png | Bin 31422 -> 0 bytes .../test/server/static/test-polyfill.js | 9 - node_modules/stream-splicer/.travis.yml | 8 - node_modules/stream-splicer/LICENSE | 18 - node_modules/stream-splicer/example/header.js | 22 - node_modules/stream-splicer/index.js | 196 - node_modules/stream-splicer/package.json | 64 - node_modules/stream-splicer/readme.markdown | 139 - node_modules/stream-splicer/test/combiner.js | 31 - .../stream-splicer/test/combiner_stream.js | 29 - node_modules/stream-splicer/test/empty.js | 17 - .../stream-splicer/test/empty_no_data.js | 13 - node_modules/stream-splicer/test/get.js | 41 - node_modules/stream-splicer/test/multipush.js | 31 - .../stream-splicer/test/multiunshift.js | 31 - node_modules/stream-splicer/test/nested.js | 36 - .../stream-splicer/test/nested_middle.js | 42 - node_modules/stream-splicer/test/pop.js | 46 - node_modules/stream-splicer/test/push.js | 57 - node_modules/stream-splicer/test/shift.js | 46 - node_modules/stream-splicer/test/splice.js | 58 - node_modules/stream-splicer/test/unshift.js | 46 - node_modules/strict-uri-encode/index.js | 6 - node_modules/strict-uri-encode/license | 21 - node_modules/strict-uri-encode/package.json | 62 - node_modules/strict-uri-encode/readme.md | 40 - node_modules/string_decoder/.travis.yml | 50 - node_modules/string_decoder/LICENSE | 48 - node_modules/string_decoder/README.md | 47 - .../string_decoder/lib/string_decoder.js | 296 - node_modules/string_decoder/package.json | 60 - node_modules/strip-ansi/index.js | 6 - node_modules/strip-ansi/license | 21 - .../node_modules/ansi-regex/index.js | 4 - .../node_modules/ansi-regex/license | 21 - .../node_modules/ansi-regex/package.json | 108 - .../node_modules/ansi-regex/readme.md | 39 - node_modules/strip-ansi/package.json | 102 - node_modules/strip-ansi/readme.md | 33 - node_modules/strip-eof/index.js | 15 - node_modules/strip-eof/license | 21 - node_modules/strip-eof/package.json | 71 - node_modules/strip-eof/readme.md | 28 - node_modules/subarg/.travis.yml | 4 - node_modules/subarg/LICENSE | 18 - node_modules/subarg/example/show.js | 3 - node_modules/subarg/index.js | 35 - node_modules/subarg/package.json | 83 - node_modules/subarg/readme.markdown | 55 - node_modules/subarg/test/arg.js | 31 - node_modules/subarg/test/recursive.js | 24 - node_modules/supports-color/cli.js | 28 - node_modules/supports-color/index.js | 32 - node_modules/supports-color/package.json | 82 - node_modules/supports-color/readme.md | 44 - node_modules/syntax-error/.travis.yml | 12 - node_modules/syntax-error/LICENSE | 18 - node_modules/syntax-error/example/check.js | 12 - node_modules/syntax-error/example/src.js | 9 - node_modules/syntax-error/index.js | 57 - node_modules/syntax-error/package.json | 65 - node_modules/syntax-error/readme.markdown | 90 - node_modules/syntax-error/test/check.js | 17 - node_modules/syntax-error/test/esm.js | 23 - node_modules/syntax-error/test/html.js | 16 - node_modules/syntax-error/test/ok.js | 13 - node_modules/syntax-error/test/run.js | 12 - node_modules/syntax-error/test/run2.js | 12 - node_modules/syntax-error/test/shebang.js | 13 - .../syntax-error/test/sources/check.js | 9 - node_modules/syntax-error/test/sources/esm.js | 2 - node_modules/syntax-error/test/sources/ok.js | 1 - node_modules/syntax-error/test/sources/run.js | 1 - .../syntax-error/test/sources/run2.js | 3 - .../syntax-error/test/sources/shebang.js | 2 - .../syntax-error/test/sources/spread.js | 2 - .../syntax-error/test/sources/yield.js | 13 - node_modules/syntax-error/test/spread.js | 13 - node_modules/syntax-error/test/yield.js | 13 - node_modules/term-color/.jshintrc | 35 - node_modules/term-color/.npmignore | 64 - node_modules/term-color/.travis.yml | 7 - node_modules/term-color/LICENSE | 19 - node_modules/term-color/README.md | 99 - node_modules/term-color/index.js | 48 - .../node_modules/.bin/supports-color | 1 - .../node_modules/ansi-styles/index.js | 56 - .../node_modules/ansi-styles/license | 21 - .../node_modules/ansi-styles/package.json | 90 - .../node_modules/ansi-styles/readme.md | 86 - .../node_modules/supports-color/cli.js | 29 - .../node_modules/supports-color/index.js | 43 - .../node_modules/supports-color/license | 21 - .../node_modules/supports-color/package.json | 95 - .../node_modules/supports-color/readme.md | 46 - node_modules/term-color/package.json | 83 - node_modules/term-color/test/index.js | 19 - node_modules/through/.travis.yml | 5 - node_modules/through/LICENSE.APACHE2 | 15 - node_modules/through/LICENSE.MIT | 24 - node_modules/through/index.js | 108 - node_modules/through/package.json | 68 - node_modules/through/readme.markdown | 64 - node_modules/through/test/async.js | 28 - node_modules/through/test/auto-destroy.js | 30 - node_modules/through/test/buffering.js | 71 - node_modules/through/test/end.js | 45 - node_modules/through/test/index.js | 133 - node_modules/through2/.npmignore | 3 - node_modules/through2/LICENSE.html | 336 - node_modules/through2/LICENSE.md | 9 - node_modules/through2/README.md | 136 - node_modules/through2/package.json | 70 - node_modules/through2/through2.js | 96 - node_modules/timers-browserify/.npmignore | 2 - node_modules/timers-browserify/CHANGELOG.md | 58 - node_modules/timers-browserify/LICENSE.md | 46 - node_modules/timers-browserify/README.md | 40 - .../timers-browserify/example/enroll/build.sh | 3 - .../example/enroll/index.html | 8 - .../example/enroll/js/browserify.js | 233 - .../example/enroll/js/main.js | 14 - .../example/enroll/server.js | 11 - node_modules/timers-browserify/main.js | 76 - node_modules/timers-browserify/package.json | 103 - node_modules/to-arraybuffer/.npmignore | 4 - node_modules/to-arraybuffer/.travis.yml | 3 - node_modules/to-arraybuffer/.zuul.yml | 16 - node_modules/to-arraybuffer/LICENSE | 24 - node_modules/to-arraybuffer/README.md | 27 - node_modules/to-arraybuffer/index.js | 27 - node_modules/to-arraybuffer/package.json | 61 - node_modules/to-arraybuffer/test.js | 57 - node_modules/to-object-path/LICENSE | 21 - node_modules/to-object-path/README.md | 71 - node_modules/to-object-path/index.js | 33 - node_modules/to-object-path/package.json | 80 - node_modules/to-regex-range/LICENSE | 21 - node_modules/to-regex-range/README.md | 281 - node_modules/to-regex-range/index.js | 294 - .../node_modules/is-number/LICENSE | 21 - .../node_modules/is-number/README.md | 115 - .../node_modules/is-number/index.js | 22 - .../node_modules/is-number/package.json | 121 - node_modules/to-regex-range/package.json | 119 - node_modules/to-regex/LICENSE | 21 - node_modules/to-regex/README.md | 205 - node_modules/to-regex/index.js | 155 - node_modules/to-regex/package.json | 97 - node_modules/tty-browserify/LICENSE | 18 - node_modules/tty-browserify/index.js | 11 - node_modules/tty-browserify/package.json | 57 - node_modules/tty-browserify/readme.markdown | 1 - node_modules/typedarray/.travis.yml | 4 - node_modules/typedarray/LICENSE | 35 - node_modules/typedarray/example/tarray.js | 4 - node_modules/typedarray/index.js | 630 - node_modules/typedarray/package.json | 83 - node_modules/typedarray/readme.markdown | 61 - .../typedarray/test/server/undef_globals.js | 19 - node_modules/typedarray/test/tarray.js | 10 - node_modules/ultron/.npmignore | 3 - node_modules/ultron/.travis.yml | 21 - node_modules/ultron/LICENSE | 22 - node_modules/ultron/README.md | 97 - node_modules/ultron/index.js | 129 - node_modules/ultron/package.json | 68 - node_modules/ultron/test.js | 327 - node_modules/umd/HISTORY.md | 64 - node_modules/umd/LICENSE | 19 - node_modules/umd/README.md | 82 - node_modules/umd/bin/cli.js | 43 - node_modules/umd/index.js | 78 - node_modules/umd/package.json | 61 - .../undeclared-identifiers/.travis.yml | 9 - .../undeclared-identifiers/CHANGELOG.md | 19 - .../undeclared-identifiers/LICENSE.md | 15 - node_modules/undeclared-identifiers/README.md | 55 - .../undeclared-identifiers/bench/index.js | 44 - node_modules/undeclared-identifiers/bin.js | 29 - node_modules/undeclared-identifiers/index.js | 127 - .../undeclared-identifiers/package.json | 72 - .../undeclared-identifiers/test/index.js | 198 - node_modules/union-value/LICENSE | 21 - node_modules/union-value/README.md | 73 - node_modules/union-value/index.js | 30 - .../node_modules/extend-shallow/LICENSE | 21 - .../node_modules/extend-shallow/README.md | 61 - .../node_modules/extend-shallow/index.js | 33 - .../node_modules/extend-shallow/package.json | 87 - .../node_modules/set-value/LICENSE | 21 - .../node_modules/set-value/README.md | 81 - .../node_modules/set-value/index.js | 63 - .../node_modules/set-value/package.json | 121 - node_modules/union-value/package.json | 105 - node_modules/unset-value/LICENSE | 21 - node_modules/unset-value/README.md | 131 - node_modules/unset-value/index.js | 32 - .../node_modules/has-value/LICENSE | 21 - .../node_modules/has-value/README.md | 130 - .../node_modules/has-value/index.js | 19 - .../has-value/node_modules/isobject/LICENSE | 21 - .../has-value/node_modules/isobject/README.md | 112 - .../has-value/node_modules/isobject/index.js | 14 - .../node_modules/isobject/package.json | 98 - .../node_modules/has-value/package.json | 114 - .../node_modules/has-values/LICENSE | 21 - .../node_modules/has-values/README.md | 114 - .../node_modules/has-values/index.js | 36 - .../node_modules/has-values/package.json | 106 - .../unset-value/node_modules/isobject/LICENSE | 21 - .../node_modules/isobject/README.md | 122 - .../node_modules/isobject/index.d.ts | 5 - .../node_modules/isobject/index.js | 12 - .../node_modules/isobject/package.json | 119 - node_modules/unset-value/package.json | 112 - node_modules/urix/.jshintrc | 42 - node_modules/urix/LICENSE | 21 - node_modules/urix/index.js | 17 - node_modules/urix/package.json | 59 - node_modules/urix/readme.md | 46 - node_modules/urix/test/index.js | 43 - node_modules/url-trim/LICENSE.md | 21 - node_modules/url-trim/README.md | 37 - node_modules/url-trim/index.js | 13 - node_modules/url-trim/package.json | 70 - node_modules/url/.npmignore | 1 - node_modules/url/.travis.yml | 7 - node_modules/url/.zuul.yml | 16 - node_modules/url/LICENSE | 21 - node_modules/url/README.md | 108 - .../url/node_modules/punycode/LICENSE-MIT.txt | 20 - .../url/node_modules/punycode/README.md | 176 - .../url/node_modules/punycode/package.json | 80 - .../url/node_modules/punycode/punycode.js | 530 - node_modules/url/package.json | 53 - node_modules/url/test.js | 1599 - node_modules/url/url.js | 732 - node_modules/url/util.js | 16 - node_modules/use/LICENSE | 21 - node_modules/use/README.md | 90 - node_modules/use/index.js | 155 - node_modules/use/package.json | 108 - node_modules/util-deprecate/History.md | 16 - node_modules/util-deprecate/LICENSE | 24 - node_modules/util-deprecate/README.md | 53 - node_modules/util-deprecate/browser.js | 67 - node_modules/util-deprecate/node.js | 6 - node_modules/util-deprecate/package.json | 56 - node_modules/util/LICENSE | 18 - node_modules/util/README.md | 15 - node_modules/util/package.json | 63 - node_modules/util/support/isBuffer.js | 3 - node_modules/util/support/isBufferBrowser.js | 6 - node_modules/util/util.js | 586 - node_modules/vm-browserify/.travis.yml | 6 - node_modules/vm-browserify/CHANGELOG.md | 16 - node_modules/vm-browserify/LICENSE | 18 - .../vm-browserify/example/run/bundle.js | 473 - .../vm-browserify/example/run/entry.js | 6 - .../vm-browserify/example/run/index.html | 9 - .../vm-browserify/example/run/server.js | 6 - node_modules/vm-browserify/index.js | 149 - node_modules/vm-browserify/package.json | 59 - node_modules/vm-browserify/readme.markdown | 67 - node_modules/vm-browserify/test/vm.js | 35 - node_modules/watchify-middleware/LICENSE.md | 21 - node_modules/watchify-middleware/README.md | 154 - .../watchify-middleware/example/app.js | 5 - .../watchify-middleware/example/server.js | 49 - node_modules/watchify-middleware/index.js | 57 - .../watchify-middleware/lib/bundler.js | 133 - .../watchify-middleware/lib/parse-error.js | 9 - node_modules/watchify-middleware/package.json | 84 - node_modules/watchify/.travis.yml | 6 - node_modules/watchify/LICENSE | 18 - node_modules/watchify/bin/args.js | 16 - node_modules/watchify/bin/cmd.js | 69 - node_modules/watchify/example/files/main.js | 2 - node_modules/watchify/example/files/one.js | 3 - node_modules/watchify/example/files/two.js | 1 - node_modules/watchify/index.js | 165 - node_modules/watchify/package.json | 76 - node_modules/watchify/readme.markdown | 233 - node_modules/watchify/test/api.js | 44 - node_modules/watchify/test/api_brfs.js | 53 - .../watchify/test/api_ignore_watch.js | 60 - .../watchify/test/api_ignore_watch_default.js | 60 - .../test/api_ignore_watch_multiple.js | 60 - .../watchify/test/api_implicit_cache.js | 44 - node_modules/watchify/test/bin.js | 52 - node_modules/watchify/test/bin_brfs.js | 62 - .../watchify/test/bin_ignore_watch.js | 71 - .../watchify/test/bin_ignore_watch_default.js | 71 - .../test/bin_ignore_watch_multiple.js | 72 - node_modules/watchify/test/bin_pipe.js | 56 - .../bin_plugins_pipelining_multiple_errors.js | 56 - node_modules/watchify/test/bin_standalone.js | 52 - node_modules/watchify/test/errors.js | 56 - .../watchify/test/errors_transform.js | 83 - node_modules/watchify/test/expose.js | 72 - node_modules/watchify/test/many.js | 101 - node_modules/watchify/test/many_immediate.js | 99 - node_modules/watchify/test/zzz.js | 10 - node_modules/which/CHANGELOG.md | 152 - node_modules/which/LICENSE | 15 - node_modules/which/README.md | 51 - node_modules/which/bin/which | 52 - node_modules/which/package.json | 66 - node_modules/which/which.js | 135 - node_modules/wrappy/LICENSE | 15 - node_modules/wrappy/README.md | 36 - node_modules/wrappy/package.json | 60 - node_modules/wrappy/wrappy.js | 33 - node_modules/ws/README.md | 235 - node_modules/ws/index.js | 49 - node_modules/ws/lib/.DS_Store | Bin 6148 -> 0 bytes node_modules/ws/lib/BufferPool.js | 63 - node_modules/ws/lib/BufferUtil.fallback.js | 47 - node_modules/ws/lib/BufferUtil.js | 17 - node_modules/ws/lib/ErrorCodes.js | 24 - node_modules/ws/lib/Extensions.js | 81 - node_modules/ws/lib/PerMessageDeflate.js | 337 - node_modules/ws/lib/Receiver.hixie.js | 194 - node_modules/ws/lib/Receiver.js | 793 - node_modules/ws/lib/Sender.hixie.js | 124 - node_modules/ws/lib/Sender.js | 310 - node_modules/ws/lib/Validation.fallback.js | 11 - node_modules/ws/lib/Validation.js | 19 - node_modules/ws/lib/WebSocket.js | 987 - node_modules/ws/lib/WebSocketServer.js | 554 - node_modules/ws/package.json | 76 - node_modules/xtend/.jshintrc | 30 - node_modules/xtend/.npmignore | 1 - node_modules/xtend/LICENCE | 19 - node_modules/xtend/Makefile | 4 - node_modules/xtend/README.md | 32 - node_modules/xtend/immutable.js | 19 - node_modules/xtend/mutable.js | 17 - node_modules/xtend/package.json | 95 - node_modules/xtend/test.js | 83 - 5434 files changed, 433434 deletions(-) delete mode 120000 node_modules/.bin/JSONStream delete mode 120000 node_modules/.bin/acorn delete mode 120000 node_modules/.bin/atob delete mode 120000 node_modules/.bin/browser-pack delete mode 120000 node_modules/.bin/browserify delete mode 120000 node_modules/.bin/budo delete mode 120000 node_modules/.bin/deps-sort delete mode 120000 node_modules/.bin/detective delete mode 120000 node_modules/.bin/garnish delete mode 120000 node_modules/.bin/has-ansi delete mode 120000 node_modules/.bin/insert-module-globals delete mode 120000 node_modules/.bin/miller-rabin delete mode 120000 node_modules/.bin/mime delete mode 120000 node_modules/.bin/mkdirp delete mode 120000 node_modules/.bin/module-deps delete mode 120000 node_modules/.bin/semver delete mode 120000 node_modules/.bin/sha.js delete mode 120000 node_modules/.bin/supports-color delete mode 120000 node_modules/.bin/umd delete mode 120000 node_modules/.bin/undeclared-identifiers delete mode 120000 node_modules/.bin/watchify delete mode 120000 node_modules/.bin/which delete mode 100644 node_modules/@babel/polyfill/LICENSE delete mode 100644 node_modules/@babel/polyfill/README.md delete mode 100644 node_modules/@babel/polyfill/browser.js delete mode 100644 node_modules/@babel/polyfill/dist/polyfill.js delete mode 100644 node_modules/@babel/polyfill/dist/polyfill.min.js delete mode 100644 node_modules/@babel/polyfill/lib/index.js delete mode 100644 node_modules/@babel/polyfill/lib/noConflict.js delete mode 100644 node_modules/@babel/polyfill/noConflict.js delete mode 100644 node_modules/@babel/polyfill/package.json delete mode 100755 node_modules/@babel/polyfill/scripts/build-dist.sh delete mode 100644 node_modules/@babel/polyfill/scripts/postpublish.js delete mode 100644 node_modules/@babel/polyfill/scripts/prepublish.js delete mode 100644 node_modules/JSONStream/.travis.yml delete mode 100644 node_modules/JSONStream/LICENSE.APACHE2 delete mode 100644 node_modules/JSONStream/LICENSE.MIT delete mode 100755 node_modules/JSONStream/bin.js delete mode 100644 node_modules/JSONStream/examples/all_docs.js delete mode 100755 node_modules/JSONStream/index.js delete mode 100644 node_modules/JSONStream/package.json delete mode 100644 node_modules/JSONStream/readme.markdown delete mode 100644 node_modules/JSONStream/test/bool.js delete mode 100644 node_modules/JSONStream/test/browser.js delete mode 100644 node_modules/JSONStream/test/destroy_missing.js delete mode 100644 node_modules/JSONStream/test/doubledot1.js delete mode 100644 node_modules/JSONStream/test/doubledot2.js delete mode 100644 node_modules/JSONStream/test/empty.js delete mode 100644 node_modules/JSONStream/test/error_contents.js delete mode 100644 node_modules/JSONStream/test/fixtures/all_npm.json delete mode 100644 node_modules/JSONStream/test/fixtures/couch_sample.json delete mode 100644 node_modules/JSONStream/test/fixtures/depth.json delete mode 100644 node_modules/JSONStream/test/fixtures/error.json delete mode 100644 node_modules/JSONStream/test/fixtures/header_footer.json delete mode 100644 node_modules/JSONStream/test/fn.js delete mode 100644 node_modules/JSONStream/test/gen.js delete mode 100644 node_modules/JSONStream/test/header_footer.js delete mode 100644 node_modules/JSONStream/test/issues.js delete mode 100644 node_modules/JSONStream/test/keys.js delete mode 100644 node_modules/JSONStream/test/map.js delete mode 100644 node_modules/JSONStream/test/multiple_objects.js delete mode 100644 node_modules/JSONStream/test/multiple_objects_error.js delete mode 100644 node_modules/JSONStream/test/null.js delete mode 100644 node_modules/JSONStream/test/parsejson.js delete mode 100644 node_modules/JSONStream/test/run.js delete mode 100644 node_modules/JSONStream/test/stringify.js delete mode 100644 node_modules/JSONStream/test/stringify_object.js delete mode 100644 node_modules/JSONStream/test/test.js delete mode 100644 node_modules/JSONStream/test/test2.js delete mode 100644 node_modules/JSONStream/test/two-ways.js delete mode 100644 node_modules/acorn-dynamic-import/CHANGELOG.md delete mode 100755 node_modules/acorn-dynamic-import/LICENSE delete mode 100755 node_modules/acorn-dynamic-import/README.md delete mode 100644 node_modules/acorn-dynamic-import/lib/index.js delete mode 100644 node_modules/acorn-dynamic-import/lib/walk.js delete mode 100644 node_modules/acorn-dynamic-import/package.json delete mode 100644 node_modules/acorn-dynamic-import/src/index.js delete mode 100644 node_modules/acorn-dynamic-import/src/walk.js delete mode 100644 node_modules/acorn-node/.travis.yml delete mode 100644 node_modules/acorn-node/CHANGELOG.md delete mode 100644 node_modules/acorn-node/LICENSE.md delete mode 100644 node_modules/acorn-node/README.md delete mode 100644 node_modules/acorn-node/build.js delete mode 100644 node_modules/acorn-node/index.js delete mode 100644 node_modules/acorn-node/lib/bigint/index.js delete mode 100644 node_modules/acorn-node/lib/import-meta/index.js delete mode 100644 node_modules/acorn-node/package.json delete mode 100644 node_modules/acorn-node/test/index.js delete mode 100644 node_modules/acorn-node/walk.js delete mode 100644 node_modules/acorn-walk/CHANGELOG.md delete mode 100644 node_modules/acorn-walk/LICENSE delete mode 100644 node_modules/acorn-walk/README.md delete mode 100644 node_modules/acorn-walk/dist/walk.es.js delete mode 100644 node_modules/acorn-walk/dist/walk.es.js.map delete mode 100644 node_modules/acorn-walk/dist/walk.js delete mode 100644 node_modules/acorn-walk/dist/walk.js.map delete mode 100644 node_modules/acorn-walk/package.json delete mode 100644 node_modules/acorn/CHANGELOG.md delete mode 100644 node_modules/acorn/LICENSE delete mode 100644 node_modules/acorn/README.md delete mode 100755 node_modules/acorn/bin/acorn delete mode 100644 node_modules/acorn/dist/acorn.d.ts delete mode 100644 node_modules/acorn/dist/acorn.js delete mode 100644 node_modules/acorn/dist/acorn.js.map delete mode 100644 node_modules/acorn/dist/acorn.mjs delete mode 100644 node_modules/acorn/dist/acorn.mjs.map delete mode 100644 node_modules/acorn/dist/bin.js delete mode 100644 node_modules/acorn/package.json delete mode 100644 node_modules/ansi-regex/index.js delete mode 100644 node_modules/ansi-regex/package.json delete mode 100644 node_modules/ansi-regex/readme.md delete mode 100644 node_modules/ansi-styles/index.js delete mode 100644 node_modules/ansi-styles/package.json delete mode 100644 node_modules/ansi-styles/readme.md delete mode 100644 node_modules/anymatch/LICENSE delete mode 100644 node_modules/anymatch/README.md delete mode 100644 node_modules/anymatch/index.js delete mode 100644 node_modules/anymatch/package.json delete mode 100755 node_modules/arr-diff/LICENSE delete mode 100644 node_modules/arr-diff/README.md delete mode 100644 node_modules/arr-diff/index.js delete mode 100644 node_modules/arr-diff/package.json delete mode 100755 node_modules/arr-flatten/LICENSE delete mode 100755 node_modules/arr-flatten/README.md delete mode 100644 node_modules/arr-flatten/index.js delete mode 100644 node_modules/arr-flatten/package.json delete mode 100644 node_modules/arr-union/LICENSE delete mode 100644 node_modules/arr-union/README.md delete mode 100644 node_modules/arr-union/index.js delete mode 100644 node_modules/arr-union/package.json delete mode 100644 node_modules/array-filter/.npmignore delete mode 100644 node_modules/array-filter/.travis.yml delete mode 100644 node_modules/array-filter/README.md delete mode 100644 node_modules/array-filter/index.js delete mode 100644 node_modules/array-filter/package.json delete mode 100644 node_modules/array-filter/test/filter.js delete mode 100644 node_modules/array-filter/test/holes.js delete mode 100644 node_modules/array-map/.travis.yml delete mode 100644 node_modules/array-map/LICENSE delete mode 100644 node_modules/array-map/example/map.js delete mode 100644 node_modules/array-map/index.js delete mode 100644 node_modules/array-map/package.json delete mode 100644 node_modules/array-map/readme.markdown delete mode 100644 node_modules/array-map/test/map.js delete mode 100644 node_modules/array-reduce/.travis.yml delete mode 100644 node_modules/array-reduce/LICENSE delete mode 100644 node_modules/array-reduce/example/sum.js delete mode 100644 node_modules/array-reduce/index.js delete mode 100644 node_modules/array-reduce/package.json delete mode 100644 node_modules/array-reduce/readme.markdown delete mode 100644 node_modules/array-reduce/test/reduce.js delete mode 100755 node_modules/array-unique/LICENSE delete mode 100755 node_modules/array-unique/README.md delete mode 100755 node_modules/array-unique/index.js delete mode 100755 node_modules/array-unique/package.json delete mode 100644 node_modules/asn1.js/README.md delete mode 100644 node_modules/asn1.js/lib/asn1.js delete mode 100644 node_modules/asn1.js/lib/asn1/api.js delete mode 100644 node_modules/asn1.js/lib/asn1/base/buffer.js delete mode 100644 node_modules/asn1.js/lib/asn1/base/index.js delete mode 100644 node_modules/asn1.js/lib/asn1/base/node.js delete mode 100644 node_modules/asn1.js/lib/asn1/base/reporter.js delete mode 100644 node_modules/asn1.js/lib/asn1/constants/der.js delete mode 100644 node_modules/asn1.js/lib/asn1/constants/index.js delete mode 100644 node_modules/asn1.js/lib/asn1/decoders/der.js delete mode 100644 node_modules/asn1.js/lib/asn1/decoders/index.js delete mode 100644 node_modules/asn1.js/lib/asn1/decoders/pem.js delete mode 100644 node_modules/asn1.js/lib/asn1/encoders/der.js delete mode 100644 node_modules/asn1.js/lib/asn1/encoders/index.js delete mode 100644 node_modules/asn1.js/lib/asn1/encoders/pem.js delete mode 100644 node_modules/asn1.js/package.json delete mode 100644 node_modules/assert/.npmignore delete mode 100644 node_modules/assert/.travis.yml delete mode 100644 node_modules/assert/.zuul.yml delete mode 100644 node_modules/assert/LICENSE delete mode 100644 node_modules/assert/README.md delete mode 100644 node_modules/assert/assert.js delete mode 100644 node_modules/assert/node_modules/inherits/LICENSE delete mode 100644 node_modules/assert/node_modules/inherits/README.md delete mode 100644 node_modules/assert/node_modules/inherits/inherits.js delete mode 100644 node_modules/assert/node_modules/inherits/inherits_browser.js delete mode 100644 node_modules/assert/node_modules/inherits/package.json delete mode 100644 node_modules/assert/node_modules/inherits/test.js delete mode 100644 node_modules/assert/node_modules/util/.npmignore delete mode 100644 node_modules/assert/node_modules/util/.travis.yml delete mode 100644 node_modules/assert/node_modules/util/.zuul.yml delete mode 100644 node_modules/assert/node_modules/util/LICENSE delete mode 100644 node_modules/assert/node_modules/util/README.md delete mode 100644 node_modules/assert/node_modules/util/package.json delete mode 100644 node_modules/assert/node_modules/util/support/isBuffer.js delete mode 100644 node_modules/assert/node_modules/util/support/isBufferBrowser.js delete mode 100644 node_modules/assert/node_modules/util/test/browser/inspect.js delete mode 100644 node_modules/assert/node_modules/util/test/browser/is.js delete mode 100644 node_modules/assert/node_modules/util/test/node/debug.js delete mode 100644 node_modules/assert/node_modules/util/test/node/format.js delete mode 100644 node_modules/assert/node_modules/util/test/node/inspect.js delete mode 100644 node_modules/assert/node_modules/util/test/node/log.js delete mode 100644 node_modules/assert/node_modules/util/test/node/util.js delete mode 100644 node_modules/assert/node_modules/util/util.js delete mode 100644 node_modules/assert/package.json delete mode 100644 node_modules/assert/test.js delete mode 100644 node_modules/assign-symbols/LICENSE delete mode 100644 node_modules/assign-symbols/README.md delete mode 100644 node_modules/assign-symbols/index.js delete mode 100644 node_modules/assign-symbols/package.json delete mode 100644 node_modules/async-each/.npmignore delete mode 100644 node_modules/async-each/CHANGELOG.md delete mode 100644 node_modules/async-each/README.md delete mode 100644 node_modules/async-each/index.js delete mode 100644 node_modules/async-each/package.json delete mode 100644 node_modules/atob/LICENSE delete mode 100644 node_modules/atob/LICENSE.DOCS delete mode 100644 node_modules/atob/README.md delete mode 100755 node_modules/atob/bin/atob.js delete mode 100644 node_modules/atob/bower.json delete mode 100644 node_modules/atob/browser-atob.js delete mode 100644 node_modules/atob/node-atob.js delete mode 100644 node_modules/atob/package.json delete mode 100644 node_modules/atob/test.js delete mode 100644 node_modules/balanced-match/.npmignore delete mode 100644 node_modules/balanced-match/LICENSE.md delete mode 100644 node_modules/balanced-match/README.md delete mode 100644 node_modules/balanced-match/index.js delete mode 100644 node_modules/balanced-match/package.json delete mode 100644 node_modules/base/LICENSE delete mode 100644 node_modules/base/README.md delete mode 100644 node_modules/base/index.js delete mode 100644 node_modules/base/node_modules/define-property/LICENSE delete mode 100644 node_modules/base/node_modules/define-property/README.md delete mode 100644 node_modules/base/node_modules/define-property/index.js delete mode 100644 node_modules/base/node_modules/define-property/package.json delete mode 100644 node_modules/base/node_modules/is-accessor-descriptor/LICENSE delete mode 100644 node_modules/base/node_modules/is-accessor-descriptor/README.md delete mode 100644 node_modules/base/node_modules/is-accessor-descriptor/index.js delete mode 100644 node_modules/base/node_modules/is-accessor-descriptor/package.json delete mode 100644 node_modules/base/node_modules/is-data-descriptor/LICENSE delete mode 100644 node_modules/base/node_modules/is-data-descriptor/README.md delete mode 100644 node_modules/base/node_modules/is-data-descriptor/index.js delete mode 100644 node_modules/base/node_modules/is-data-descriptor/package.json delete mode 100644 node_modules/base/node_modules/is-descriptor/LICENSE delete mode 100644 node_modules/base/node_modules/is-descriptor/README.md delete mode 100644 node_modules/base/node_modules/is-descriptor/index.js delete mode 100644 node_modules/base/node_modules/is-descriptor/package.json delete mode 100644 node_modules/base/node_modules/isobject/LICENSE delete mode 100644 node_modules/base/node_modules/isobject/README.md delete mode 100644 node_modules/base/node_modules/isobject/index.d.ts delete mode 100644 node_modules/base/node_modules/isobject/index.js delete mode 100644 node_modules/base/node_modules/isobject/package.json delete mode 100644 node_modules/base/node_modules/kind-of/CHANGELOG.md delete mode 100644 node_modules/base/node_modules/kind-of/LICENSE delete mode 100644 node_modules/base/node_modules/kind-of/README.md delete mode 100644 node_modules/base/node_modules/kind-of/index.js delete mode 100644 node_modules/base/node_modules/kind-of/package.json delete mode 100644 node_modules/base/package.json delete mode 100644 node_modules/base64-js/LICENSE delete mode 100644 node_modules/base64-js/README.md delete mode 100644 node_modules/base64-js/base64js.min.js delete mode 100644 node_modules/base64-js/index.js delete mode 100644 node_modules/base64-js/package.json delete mode 100644 node_modules/base64-js/test/big-data.js delete mode 100644 node_modules/base64-js/test/convert.js delete mode 100644 node_modules/base64-js/test/corrupt.js delete mode 100644 node_modules/base64-js/test/url-safe.js delete mode 100644 node_modules/bel/.travis.yml delete mode 100644 node_modules/bel/README.md delete mode 100644 node_modules/bel/appendChild.js delete mode 100644 node_modules/bel/bel.d.ts delete mode 100644 node_modules/bel/bench/bench.js delete mode 100644 node_modules/bel/bench/create-trees.js delete mode 100644 node_modules/bel/bench/index.js delete mode 100644 node_modules/bel/browser.js delete mode 100644 node_modules/bel/index.js delete mode 100644 node_modules/bel/package.json delete mode 100644 node_modules/bel/raw.js delete mode 100644 node_modules/bel/test/api.js delete mode 100644 node_modules/bel/test/elements.js delete mode 100644 node_modules/bel/test/events.js delete mode 100644 node_modules/bel/test/index.js delete mode 100644 node_modules/bel/test/raw.js delete mode 100644 node_modules/bel/test/server.js delete mode 100644 node_modules/binary-extensions/binary-extensions.json delete mode 100644 node_modules/binary-extensions/license delete mode 100644 node_modules/binary-extensions/package.json delete mode 100644 node_modules/binary-extensions/readme.md delete mode 100644 node_modules/bn.js/.npmignore delete mode 100644 node_modules/bn.js/README.md delete mode 100644 node_modules/bn.js/lib/bn.js delete mode 100644 node_modules/bn.js/package.json delete mode 100644 node_modules/bn.js/util/genCombMulTo.js delete mode 100644 node_modules/bn.js/util/genCombMulTo10.js delete mode 100644 node_modules/bole/.jshintrc delete mode 100644 node_modules/bole/.npmignore delete mode 100644 node_modules/bole/LICENSE.md delete mode 100644 node_modules/bole/README.md delete mode 100644 node_modules/bole/bole.js delete mode 100644 node_modules/bole/package.json delete mode 100644 node_modules/bole/test.js delete mode 100644 node_modules/brace-expansion/LICENSE delete mode 100644 node_modules/brace-expansion/README.md delete mode 100644 node_modules/brace-expansion/index.js delete mode 100644 node_modules/brace-expansion/package.json delete mode 100644 node_modules/braces/LICENSE delete mode 100644 node_modules/braces/README.md delete mode 100644 node_modules/braces/index.js delete mode 100644 node_modules/braces/package.json delete mode 100644 node_modules/brorand/.npmignore delete mode 100644 node_modules/brorand/README.md delete mode 100644 node_modules/brorand/index.js delete mode 100644 node_modules/brorand/package.json delete mode 100644 node_modules/brorand/test/api-test.js delete mode 100644 node_modules/browser-pack/.travis.yml delete mode 100644 node_modules/browser-pack/CHANGELOG.md delete mode 100644 node_modules/browser-pack/LICENSE delete mode 100644 node_modules/browser-pack/_prelude.js delete mode 100755 node_modules/browser-pack/bin/cmd.js delete mode 100755 node_modules/browser-pack/bin/prepublish.js delete mode 100644 node_modules/browser-pack/example/input.json delete mode 100644 node_modules/browser-pack/example/output.js delete mode 100644 node_modules/browser-pack/example/sourcemap/input.json delete mode 100644 node_modules/browser-pack/example/sourcemap/output.js delete mode 100644 node_modules/browser-pack/index.js delete mode 100644 node_modules/browser-pack/package.json delete mode 100644 node_modules/browser-pack/prelude.js delete mode 100644 node_modules/browser-pack/readme.markdown delete mode 100644 node_modules/browser-pack/test/comment.js delete mode 100644 node_modules/browser-pack/test/empty.js delete mode 100644 node_modules/browser-pack/test/not_found.js delete mode 100644 node_modules/browser-pack/test/only_execute_entries.js delete mode 100644 node_modules/browser-pack/test/order.js delete mode 100644 node_modules/browser-pack/test/pack.js delete mode 100644 node_modules/browser-pack/test/raw.js delete mode 100644 node_modules/browser-pack/test/source-maps-existing.js delete mode 100644 node_modules/browser-pack/test/source-maps.js delete mode 100644 node_modules/browser-pack/test/this.js delete mode 100644 node_modules/browser-pack/test/unicode.js delete mode 100644 node_modules/browser-resolve/LICENSE delete mode 100644 node_modules/browser-resolve/README.md delete mode 100644 node_modules/browser-resolve/empty.js delete mode 100644 node_modules/browser-resolve/index.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/.travis.yml delete mode 100644 node_modules/browser-resolve/node_modules/resolve/LICENSE delete mode 100644 node_modules/browser-resolve/node_modules/resolve/example/async.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/example/sync.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/index.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/lib/async.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/lib/caller.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/lib/core.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/lib/core.json delete mode 100644 node_modules/browser-resolve/node_modules/resolve/lib/node-modules-paths.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/lib/sync.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/package.json delete mode 100644 node_modules/browser-resolve/node_modules/resolve/readme.markdown delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/core.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/dotdot.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/dotdot/abc/index.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/dotdot/index.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/faulty_basedir.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/filter.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/filter_sync.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/mock.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/mock_sync.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/module_dir.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/module_dir/xmodules/aaa/index.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/module_dir/ymodules/aaa/index.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/module_dir/zmodules/bbb/main.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/module_dir/zmodules/bbb/package.json delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/node_path.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/node_path/x/aaa/index.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/node_path/x/ccc/index.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/node_path/y/bbb/index.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/node_path/y/ccc/index.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/nonstring.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/pathfilter.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/pathfilter/deep_ref/main.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/alt.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/deeper/ref.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/package.json delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/ref.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/precedence.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/precedence/aaa.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/precedence/aaa/index.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/precedence/aaa/main.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/precedence/bbb.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/precedence/bbb/main.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/bar/node_modules/foo/index.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/baz/doom.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/baz/package.json delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/baz/quux.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/biz/node_modules/garply/lib/index.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/biz/node_modules/garply/package.json delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/biz/node_modules/grux/index.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/biz/node_modules/tiv/index.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/cup.coffee delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/foo.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/incorrect_main/index.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/incorrect_main/package.json delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/mug.coffee delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/mug.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/other_path/lib/other-lib.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/other_path/root.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/punycode/node_modules/punycode/index.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/quux/foo/index.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/without_basedir/main.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver/without_basedir/node_modules/mymodule.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/resolver_sync.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/subdirs.js delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json delete mode 100644 node_modules/browser-resolve/node_modules/resolve/test/subdirs/node_modules/a/package.json delete mode 100644 node_modules/browser-resolve/package.json delete mode 100644 node_modules/browserify-aes/.travis.yml delete mode 100644 node_modules/browserify-aes/LICENSE delete mode 100644 node_modules/browserify-aes/README.md delete mode 100644 node_modules/browserify-aes/aes.js delete mode 100644 node_modules/browserify-aes/authCipher.js delete mode 100644 node_modules/browserify-aes/browser.js delete mode 100644 node_modules/browserify-aes/decrypter.js delete mode 100644 node_modules/browserify-aes/encrypter.js delete mode 100644 node_modules/browserify-aes/ghash.js delete mode 100644 node_modules/browserify-aes/incr32.js delete mode 100644 node_modules/browserify-aes/index.js delete mode 100644 node_modules/browserify-aes/modes/cbc.js delete mode 100644 node_modules/browserify-aes/modes/cfb.js delete mode 100644 node_modules/browserify-aes/modes/cfb1.js delete mode 100644 node_modules/browserify-aes/modes/cfb8.js delete mode 100644 node_modules/browserify-aes/modes/ctr.js delete mode 100644 node_modules/browserify-aes/modes/ecb.js delete mode 100644 node_modules/browserify-aes/modes/index.js delete mode 100644 node_modules/browserify-aes/modes/list.json delete mode 100644 node_modules/browserify-aes/modes/ofb.js delete mode 100644 node_modules/browserify-aes/package.json delete mode 100644 node_modules/browserify-aes/streamCipher.js delete mode 100644 node_modules/browserify-cipher/.travis.yml delete mode 100644 node_modules/browserify-cipher/LICENSE delete mode 100644 node_modules/browserify-cipher/README.md delete mode 100644 node_modules/browserify-cipher/browser.js delete mode 100644 node_modules/browserify-cipher/index.js delete mode 100644 node_modules/browserify-cipher/package.json delete mode 100644 node_modules/browserify-cipher/test.js delete mode 100644 node_modules/browserify-des/.travis.yml delete mode 100644 node_modules/browserify-des/index.js delete mode 100644 node_modules/browserify-des/license delete mode 100644 node_modules/browserify-des/modes.js delete mode 100644 node_modules/browserify-des/package.json delete mode 100644 node_modules/browserify-des/readme.md delete mode 100644 node_modules/browserify-des/test.js delete mode 100644 node_modules/browserify-rsa/.travis.yml delete mode 100644 node_modules/browserify-rsa/LICENSE delete mode 100644 node_modules/browserify-rsa/index.js delete mode 100644 node_modules/browserify-rsa/package.json delete mode 100644 node_modules/browserify-rsa/readme.md delete mode 100644 node_modules/browserify-rsa/test.js delete mode 100644 node_modules/browserify-sign/LICENSE delete mode 100644 node_modules/browserify-sign/README.md delete mode 100644 node_modules/browserify-sign/algos.js delete mode 100644 node_modules/browserify-sign/browser/algorithms.json delete mode 100644 node_modules/browserify-sign/browser/curves.json delete mode 100644 node_modules/browserify-sign/browser/index.js delete mode 100644 node_modules/browserify-sign/browser/sign.js delete mode 100644 node_modules/browserify-sign/browser/verify.js delete mode 100644 node_modules/browserify-sign/index.js delete mode 100644 node_modules/browserify-sign/package.json delete mode 100644 node_modules/browserify-zlib/.npmignore delete mode 100644 node_modules/browserify-zlib/.travis.yml delete mode 100644 node_modules/browserify-zlib/LICENSE delete mode 100644 node_modules/browserify-zlib/README.md delete mode 100644 node_modules/browserify-zlib/karma.conf.js delete mode 100644 node_modules/browserify-zlib/lib/binding.js delete mode 100644 node_modules/browserify-zlib/lib/index.js delete mode 100644 node_modules/browserify-zlib/package.json delete mode 100644 node_modules/browserify-zlib/src/binding.js delete mode 100644 node_modules/browserify-zlib/src/index.js delete mode 100644 node_modules/browserify-zlib/yarn.lock delete mode 100644 node_modules/browserify/.travis.yml delete mode 100644 node_modules/browserify/LICENSE delete mode 100644 node_modules/browserify/appveyor.yml delete mode 100644 node_modules/browserify/assets/browserify.png delete mode 100644 node_modules/browserify/assets/logo.png delete mode 100644 node_modules/browserify/bin/advanced.txt delete mode 100644 node_modules/browserify/bin/args.js delete mode 100755 node_modules/browserify/bin/cmd.js delete mode 100644 node_modules/browserify/bin/usage.txt delete mode 100644 node_modules/browserify/changelog.markdown delete mode 100644 node_modules/browserify/code-of-conduct.md delete mode 100644 node_modules/browserify/example/api/browser/bar.js delete mode 100644 node_modules/browserify/example/api/browser/foo.js delete mode 100644 node_modules/browserify/example/api/browser/main.js delete mode 100644 node_modules/browserify/example/api/build.js delete mode 100644 node_modules/browserify/example/multiple_bundles/beep.js delete mode 100644 node_modules/browserify/example/multiple_bundles/boop.js delete mode 100755 node_modules/browserify/example/multiple_bundles/build.sh delete mode 100644 node_modules/browserify/example/multiple_bundles/robot.js delete mode 100644 node_modules/browserify/example/multiple_bundles/static/beep.html delete mode 100644 node_modules/browserify/example/multiple_bundles/static/boop.html delete mode 100644 node_modules/browserify/example/source_maps/build.js delete mode 100755 node_modules/browserify/example/source_maps/build.sh delete mode 100644 node_modules/browserify/example/source_maps/index.html delete mode 100644 node_modules/browserify/example/source_maps/js/build/.npmignore delete mode 100644 node_modules/browserify/example/source_maps/js/build/bundle.js delete mode 100644 node_modules/browserify/example/source_maps/js/foo.js delete mode 100644 node_modules/browserify/example/source_maps/js/main.js delete mode 100644 node_modules/browserify/example/source_maps/js/wunder/bar.js delete mode 100644 node_modules/browserify/index.js delete mode 100644 node_modules/browserify/lib/_empty.js delete mode 100644 node_modules/browserify/lib/builtins.js delete mode 100644 node_modules/browserify/node_modules/events/.travis.yml delete mode 100644 node_modules/browserify/node_modules/events/.zuul.yml delete mode 100644 node_modules/browserify/node_modules/events/History.md delete mode 100644 node_modules/browserify/node_modules/events/LICENSE delete mode 100644 node_modules/browserify/node_modules/events/Readme.md delete mode 100644 node_modules/browserify/node_modules/events/events.js delete mode 100644 node_modules/browserify/node_modules/events/package.json delete mode 100644 node_modules/browserify/node_modules/events/tests/add-listeners.js delete mode 100644 node_modules/browserify/node_modules/events/tests/check-listener-leaks.js delete mode 100644 node_modules/browserify/node_modules/events/tests/common.js delete mode 100644 node_modules/browserify/node_modules/events/tests/index.js delete mode 100644 node_modules/browserify/node_modules/events/tests/legacy-compat.js delete mode 100644 node_modules/browserify/node_modules/events/tests/listener-count.js delete mode 100644 node_modules/browserify/node_modules/events/tests/listeners-side-effects.js delete mode 100644 node_modules/browserify/node_modules/events/tests/listeners.js delete mode 100644 node_modules/browserify/node_modules/events/tests/max-listeners.js delete mode 100644 node_modules/browserify/node_modules/events/tests/modify-in-emit.js delete mode 100644 node_modules/browserify/node_modules/events/tests/num-args.js delete mode 100644 node_modules/browserify/node_modules/events/tests/once.js delete mode 100644 node_modules/browserify/node_modules/events/tests/remove-all-listeners.js delete mode 100644 node_modules/browserify/node_modules/events/tests/remove-listeners.js delete mode 100644 node_modules/browserify/node_modules/events/tests/set-max-listeners-side-effects.js delete mode 100644 node_modules/browserify/node_modules/events/tests/subclass.js delete mode 100644 node_modules/browserify/package.json delete mode 100644 node_modules/browserify/readme.markdown delete mode 100644 node_modules/browserify/test/args.js delete mode 100644 node_modules/browserify/test/array.js delete mode 100644 node_modules/browserify/test/array/one.js delete mode 100644 node_modules/browserify/test/array/three.js delete mode 100644 node_modules/browserify/test/array/two.js delete mode 100644 node_modules/browserify/test/async.js delete mode 100644 node_modules/browserify/test/async/src.js delete mode 100644 node_modules/browserify/test/backbone.js delete mode 100644 node_modules/browserify/test/bare.js delete mode 100644 node_modules/browserify/test/bare/dirname-filename.js delete mode 100644 node_modules/browserify/test/bare/main.js delete mode 100644 node_modules/browserify/test/bare_shebang.js delete mode 100644 node_modules/browserify/test/bin.js delete mode 100644 node_modules/browserify/test/bin_entry.js delete mode 100644 node_modules/browserify/test/bin_tr_error.js delete mode 100644 node_modules/browserify/test/bin_tr_error/main.js delete mode 100644 node_modules/browserify/test/bin_tr_error/tr.js delete mode 100644 node_modules/browserify/test/bom.js delete mode 100644 node_modules/browserify/test/bom/hello.js delete mode 100644 node_modules/browserify/test/browser_field_file.js delete mode 100644 node_modules/browserify/test/browser_field_file/package.json delete mode 100644 node_modules/browserify/test/browser_field_file/wow.js delete mode 100644 node_modules/browserify/test/browser_field_resolve.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/a/main.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/a/node_modules/aaa/main.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/a/node_modules/aaa/package.json delete mode 100644 node_modules/browserify/test/browser_field_resolve/a/package.json delete mode 100644 node_modules/browserify/test/browser_field_resolve/b/main.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/b/package.json delete mode 100644 node_modules/browserify/test/browser_field_resolve/b/x.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/c/main.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/c/package.json delete mode 100644 node_modules/browserify/test/browser_field_resolve/c/x.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/d/main.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/d/package.json delete mode 100644 node_modules/browserify/test/browser_field_resolve/d/x.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/e/main.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/e/package.json delete mode 100644 node_modules/browserify/test/browser_field_resolve/e/x.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/f/main.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/f/package.json delete mode 100644 node_modules/browserify/test/browser_field_resolve/f/x.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/g/main.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/g/package.json delete mode 100644 node_modules/browserify/test/browser_field_resolve/g/x.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/h/main.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/h/package.json delete mode 100644 node_modules/browserify/test/browser_field_resolve/h/x.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/i/browser.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/i/main.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/i/package.json delete mode 100644 node_modules/browserify/test/browser_field_resolve/i/x.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/j/browser.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/j/main.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/j/package.json delete mode 100644 node_modules/browserify/test/browser_field_resolve/j/x.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/k/main.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/k/node_modules/x/hey.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/k/node_modules/x/package.json delete mode 100644 node_modules/browserify/test/browser_field_resolve/l/main.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/l/node_modules/x/hey.js delete mode 100644 node_modules/browserify/test/browser_field_resolve/l/node_modules/x/package.json delete mode 100644 node_modules/browserify/test/buffer.js delete mode 100644 node_modules/browserify/test/bundle-bundle-external.js delete mode 100644 node_modules/browserify/test/bundle-bundle-external/bar.js delete mode 100644 node_modules/browserify/test/bundle-bundle-external/baz.js delete mode 100644 node_modules/browserify/test/bundle-bundle-external/foo.js delete mode 100644 node_modules/browserify/test/bundle-stream.js delete mode 100644 node_modules/browserify/test/bundle.js delete mode 100644 node_modules/browserify/test/bundle_external.js delete mode 100644 node_modules/browserify/test/bundle_external/boop.js delete mode 100644 node_modules/browserify/test/bundle_external/main.js delete mode 100644 node_modules/browserify/test/bundle_external/robot.js delete mode 100644 node_modules/browserify/test/bundle_external_global.js delete mode 100644 node_modules/browserify/test/bundle_sourcemap.js delete mode 100644 node_modules/browserify/test/catch.js delete mode 100644 node_modules/browserify/test/catch/main.js delete mode 100644 node_modules/browserify/test/circular.js delete mode 100644 node_modules/browserify/test/circular/a.js delete mode 100644 node_modules/browserify/test/circular/b.js delete mode 100644 node_modules/browserify/test/circular/main.js delete mode 100644 node_modules/browserify/test/coffee_bin.js delete mode 100644 node_modules/browserify/test/coffee_bin/main.coffee delete mode 100644 node_modules/browserify/test/coffee_bin/x.coffee delete mode 100644 node_modules/browserify/test/coffeeify.js delete mode 100644 node_modules/browserify/test/coffeeify/main.coffee delete mode 100644 node_modules/browserify/test/comment.js delete mode 100644 node_modules/browserify/test/comment/main.js delete mode 100644 node_modules/browserify/test/constants.js delete mode 100644 node_modules/browserify/test/crypto.js delete mode 100644 node_modules/browserify/test/crypto_ig.js delete mode 100644 node_modules/browserify/test/cycle.js delete mode 100644 node_modules/browserify/test/cycle/README.md delete mode 100644 node_modules/browserify/test/cycle/entry.js delete mode 100644 node_modules/browserify/test/cycle/mod1/a.js delete mode 100644 node_modules/browserify/test/cycle/mod1/b.js delete mode 100644 node_modules/browserify/test/cycle/mod2/a.js delete mode 100644 node_modules/browserify/test/cycle/mod2/b.js delete mode 100644 node_modules/browserify/test/debug_standalone.js delete mode 100644 node_modules/browserify/test/debug_standalone/x.js delete mode 100644 node_modules/browserify/test/dedupe-deps.js delete mode 100644 node_modules/browserify/test/dedupe-nomap.js delete mode 100644 node_modules/browserify/test/delay.js delete mode 100644 node_modules/browserify/test/delay/diverted.js delete mode 100644 node_modules/browserify/test/delay/main.js delete mode 100644 node_modules/browserify/test/dep.js delete mode 100644 node_modules/browserify/test/dollar.js delete mode 100644 node_modules/browserify/test/dollar/dollar/index.js delete mode 100644 node_modules/browserify/test/double_buffer.js delete mode 100644 node_modules/browserify/test/double_buffer/explicit.js delete mode 100644 node_modules/browserify/test/double_buffer/implicit.js delete mode 100644 node_modules/browserify/test/double_buffer/main.js delete mode 100644 node_modules/browserify/test/double_bundle.js delete mode 100644 node_modules/browserify/test/double_bundle_error.js delete mode 100644 node_modules/browserify/test/double_bundle_error/main.js delete mode 100644 node_modules/browserify/test/double_bundle_error/needs_three.js delete mode 100644 node_modules/browserify/test/double_bundle_error/one.js delete mode 100644 node_modules/browserify/test/double_bundle_error/package.json delete mode 100644 node_modules/browserify/test/double_bundle_error/three.js delete mode 100644 node_modules/browserify/test/double_bundle_error/two.js delete mode 100644 node_modules/browserify/test/double_bundle_json.js delete mode 100644 node_modules/browserify/test/double_bundle_json/a.json delete mode 100644 node_modules/browserify/test/double_bundle_json/b.json delete mode 100644 node_modules/browserify/test/double_bundle_json/index.js delete mode 100644 node_modules/browserify/test/double_bundle_parallel.js delete mode 100644 node_modules/browserify/test/double_bundle_parallel_cache.js delete mode 100644 node_modules/browserify/test/dup/foo-dup.js delete mode 100644 node_modules/browserify/test/dup/foo.js delete mode 100644 node_modules/browserify/test/dup/index.js delete mode 100644 node_modules/browserify/test/entry.js delete mode 100644 node_modules/browserify/test/entry/main.js delete mode 100644 node_modules/browserify/test/entry/needs_three.js delete mode 100644 node_modules/browserify/test/entry/one.js delete mode 100644 node_modules/browserify/test/entry/package.json delete mode 100644 node_modules/browserify/test/entry/three.js delete mode 100644 node_modules/browserify/test/entry/two.js delete mode 100644 node_modules/browserify/test/entry_exec.js delete mode 100644 node_modules/browserify/test/entry_exec/fail.js delete mode 100644 node_modules/browserify/test/entry_exec/main.js delete mode 100644 node_modules/browserify/test/entry_expose.js delete mode 100644 node_modules/browserify/test/entry_expose/main.js delete mode 100644 node_modules/browserify/test/entry_relative.js delete mode 100644 node_modules/browserify/test/error_code.js delete mode 100644 node_modules/browserify/test/error_code/src.js delete mode 100644 node_modules/browserify/test/exclude.js delete mode 100644 node_modules/browserify/test/exclude/array.js delete mode 100644 node_modules/browserify/test/exclude/skip.js delete mode 100644 node_modules/browserify/test/exclude/skip2.js delete mode 100644 node_modules/browserify/test/export.js delete mode 100644 node_modules/browserify/test/export/entry.js delete mode 100644 node_modules/browserify/test/external.js delete mode 100644 node_modules/browserify/test/external/main.js delete mode 100644 node_modules/browserify/test/external/x.js delete mode 100644 node_modules/browserify/test/external_args/main.js delete mode 100644 node_modules/browserify/test/external_shim.js delete mode 100644 node_modules/browserify/test/external_shim/bundle1.js delete mode 100644 node_modules/browserify/test/external_shim/bundle2.js delete mode 100644 node_modules/browserify/test/external_shim/package.json delete mode 100644 node_modules/browserify/test/external_shim/shim.js delete mode 100644 node_modules/browserify/test/externalize.js delete mode 100644 node_modules/browserify/test/externalize/beep.js delete mode 100644 node_modules/browserify/test/externalize/boop.js delete mode 100644 node_modules/browserify/test/externalize/robot.js delete mode 100644 node_modules/browserify/test/fake.js delete mode 100644 node_modules/browserify/test/fake/fake_fs.js delete mode 100644 node_modules/browserify/test/fake/main.js delete mode 100644 node_modules/browserify/test/field.js delete mode 100644 node_modules/browserify/test/field/miss.js delete mode 100644 node_modules/browserify/test/field/node_modules/z-miss/browser.js delete mode 100644 node_modules/browserify/test/field/node_modules/z-miss/main.js delete mode 100644 node_modules/browserify/test/field/node_modules/z-miss/package.json delete mode 100644 node_modules/browserify/test/field/node_modules/z-object/browser.js delete mode 100644 node_modules/browserify/test/field/node_modules/z-object/main.js delete mode 100644 node_modules/browserify/test/field/node_modules/z-object/package.json delete mode 100644 node_modules/browserify/test/field/node_modules/z-string/browser.js delete mode 100644 node_modules/browserify/test/field/node_modules/z-string/main.js delete mode 100644 node_modules/browserify/test/field/node_modules/z-string/package.json delete mode 100644 node_modules/browserify/test/field/node_modules/z-sub/browser/a.js delete mode 100644 node_modules/browserify/test/field/node_modules/z-sub/browser/b.js delete mode 100644 node_modules/browserify/test/field/node_modules/z-sub/main.js delete mode 100644 node_modules/browserify/test/field/node_modules/z-sub/package.json delete mode 100644 node_modules/browserify/test/field/object.js delete mode 100644 node_modules/browserify/test/field/string.js delete mode 100644 node_modules/browserify/test/field/sub.js delete mode 100644 node_modules/browserify/test/file_event.js delete mode 100644 node_modules/browserify/test/five_bundle.js delete mode 100644 node_modules/browserify/test/full_paths.js delete mode 100644 node_modules/browserify/test/glob.js delete mode 100644 node_modules/browserify/test/glob/a.js delete mode 100644 node_modules/browserify/test/glob/b.js delete mode 100644 node_modules/browserify/test/glob/lib/z.js delete mode 100644 node_modules/browserify/test/glob/vendor/x.js delete mode 100644 node_modules/browserify/test/glob/vendor/y.js delete mode 100644 node_modules/browserify/test/global.js delete mode 100644 node_modules/browserify/test/global/buffer.js delete mode 100644 node_modules/browserify/test/global/filename.js delete mode 100644 node_modules/browserify/test/global/main.js delete mode 100644 node_modules/browserify/test/global/node_modules/aaa/index.js delete mode 100644 node_modules/browserify/test/global/node_modules/robot/index.js delete mode 100644 node_modules/browserify/test/global/node_modules/robot/lib/beep.js delete mode 100644 node_modules/browserify/test/global/tick.js delete mode 100644 node_modules/browserify/test/global_coffeeify.js delete mode 100644 node_modules/browserify/test/global_noparse.js delete mode 100644 node_modules/browserify/test/global_recorder.js delete mode 100644 node_modules/browserify/test/global_recorder/main.js delete mode 100644 node_modules/browserify/test/hash.js delete mode 100644 node_modules/browserify/test/hash/foo/other.js delete mode 100644 node_modules/browserify/test/hash/foo/two.js delete mode 100644 node_modules/browserify/test/hash/main.js delete mode 100644 node_modules/browserify/test/hash/one.js delete mode 100644 node_modules/browserify/test/hash/other.js delete mode 100644 node_modules/browserify/test/hash_instance_context.js delete mode 100644 node_modules/browserify/test/hash_instance_context/main.js delete mode 100644 node_modules/browserify/test/hash_instance_context/one/dir/f.js delete mode 100644 node_modules/browserify/test/hash_instance_context/one/dir/g.js delete mode 100644 node_modules/browserify/test/hash_instance_context/one/f.js delete mode 100644 node_modules/browserify/test/hash_instance_context/one/g.js delete mode 100644 node_modules/browserify/test/hash_instance_context/three/dir/f.js delete mode 100644 node_modules/browserify/test/hash_instance_context/three/dir/g.js delete mode 100644 node_modules/browserify/test/hash_instance_context/three/dir/h.js delete mode 100644 node_modules/browserify/test/hash_instance_context/three/f.js delete mode 100644 node_modules/browserify/test/hash_instance_context/three/g.js delete mode 100644 node_modules/browserify/test/hash_instance_context/three/h.js delete mode 100644 node_modules/browserify/test/hash_instance_context/two/dir/f.js delete mode 100644 node_modules/browserify/test/hash_instance_context/two/dir/g.js delete mode 100644 node_modules/browserify/test/hash_instance_context/two/dir/h.js delete mode 100644 node_modules/browserify/test/hash_instance_context/two/f.js delete mode 100644 node_modules/browserify/test/hash_instance_context/two/g.js delete mode 100644 node_modules/browserify/test/hash_instance_context/two/h.js delete mode 100644 node_modules/browserify/test/identical.js delete mode 100644 node_modules/browserify/test/identical/main.js delete mode 100644 node_modules/browserify/test/identical/x.js delete mode 100644 node_modules/browserify/test/identical/y.js delete mode 100644 node_modules/browserify/test/identical_different.js delete mode 100644 node_modules/browserify/test/identical_different/main.js delete mode 100644 node_modules/browserify/test/identical_different/node_modules/op/index.js delete mode 100644 node_modules/browserify/test/identical_different/wow/node_modules/op/index.js delete mode 100644 node_modules/browserify/test/identical_different/wow/y.js delete mode 100644 node_modules/browserify/test/identical_different/x.js delete mode 100644 node_modules/browserify/test/ignore.js delete mode 100644 node_modules/browserify/test/ignore/array.js delete mode 100644 node_modules/browserify/test/ignore/by-id.js delete mode 100644 node_modules/browserify/test/ignore/by-relative.js delete mode 100644 node_modules/browserify/test/ignore/double-skip.js delete mode 100644 node_modules/browserify/test/ignore/double-skip/index.js delete mode 100644 node_modules/browserify/test/ignore/double-skip/skip.js delete mode 100644 node_modules/browserify/test/ignore/ignored/skip.js delete mode 100644 node_modules/browserify/test/ignore/main.js delete mode 100644 node_modules/browserify/test/ignore/relative/index.js delete mode 100644 node_modules/browserify/test/ignore/skip.js delete mode 100644 node_modules/browserify/test/ignore/skip2.js delete mode 100644 node_modules/browserify/test/ignore_browser_field.js delete mode 100644 node_modules/browserify/test/ignore_browser_field/main.js delete mode 100644 node_modules/browserify/test/ignore_browser_field/node_modules/a/browser.js delete mode 100644 node_modules/browserify/test/ignore_browser_field/node_modules/a/main.js delete mode 100644 node_modules/browserify/test/ignore_browser_field/node_modules/a/package.json delete mode 100644 node_modules/browserify/test/ignore_browser_field/node_modules/b/browser-x.js delete mode 100644 node_modules/browserify/test/ignore_browser_field/node_modules/b/main.js delete mode 100644 node_modules/browserify/test/ignore_browser_field/node_modules/b/package.json delete mode 100644 node_modules/browserify/test/ignore_browser_field/node_modules/b/x.js delete mode 100644 node_modules/browserify/test/ignore_missing.js delete mode 100644 node_modules/browserify/test/ignore_missing/main.js delete mode 100644 node_modules/browserify/test/ignore_transform_key.js delete mode 100644 node_modules/browserify/test/ignore_transform_key/main.js delete mode 100644 node_modules/browserify/test/ignore_transform_key/node_modules/a/index.js delete mode 100644 node_modules/browserify/test/ignore_transform_key/node_modules/a/package.json delete mode 100644 node_modules/browserify/test/ignore_transform_key/node_modules/evil-transform/index.js delete mode 100644 node_modules/browserify/test/ignore_transform_key/node_modules/evil-transform/package.json delete mode 100644 node_modules/browserify/test/json.js delete mode 100644 node_modules/browserify/test/json/beep.json delete mode 100644 node_modules/browserify/test/json/evil-chars.json delete mode 100644 node_modules/browserify/test/json/evil.js delete mode 100644 node_modules/browserify/test/json/main.js delete mode 100644 node_modules/browserify/test/leak.js delete mode 100644 node_modules/browserify/test/maxlisteners.js delete mode 100644 node_modules/browserify/test/maxlisteners/main.js delete mode 100644 node_modules/browserify/test/multi_bundle.js delete mode 100644 node_modules/browserify/test/multi_bundle/_prelude.js delete mode 100644 node_modules/browserify/test/multi_bundle/a.js delete mode 100644 node_modules/browserify/test/multi_bundle/b.js delete mode 100644 node_modules/browserify/test/multi_bundle/c.js delete mode 100644 node_modules/browserify/test/multi_bundle_unique.js delete mode 100644 node_modules/browserify/test/multi_entry.js delete mode 100644 node_modules/browserify/test/multi_entry/a.js delete mode 100644 node_modules/browserify/test/multi_entry/b.js delete mode 100644 node_modules/browserify/test/multi_entry/c.js delete mode 100644 node_modules/browserify/test/multi_entry_cross_require.js delete mode 100644 node_modules/browserify/test/multi_entry_cross_require/a.js delete mode 100644 node_modules/browserify/test/multi_entry_cross_require/c.js delete mode 100644 node_modules/browserify/test/multi_entry_cross_require/lib/b.js delete mode 100644 node_modules/browserify/test/multi_require.js delete mode 100644 node_modules/browserify/test/multi_require/a.js delete mode 100644 node_modules/browserify/test/multi_require/main.js delete mode 100644 node_modules/browserify/test/multi_symlink.js delete mode 100644 node_modules/browserify/test/multi_symlink/main.js delete mode 100644 node_modules/browserify/test/multi_symlink/x.js delete mode 100644 node_modules/browserify/test/no_builtins.js delete mode 100644 node_modules/browserify/test/no_builtins/extra/fs.js delete mode 100644 node_modules/browserify/test/no_builtins/extra/tls.js delete mode 100644 node_modules/browserify/test/no_builtins/main.js delete mode 100644 node_modules/browserify/test/no_builtins/x.txt delete mode 100644 node_modules/browserify/test/node_modules/beep/index.js delete mode 100644 node_modules/browserify/test/node_modules/plugin-foo/index.js delete mode 100644 node_modules/browserify/test/node_modules/tr/index.js delete mode 100644 node_modules/browserify/test/noparse.js delete mode 100644 node_modules/browserify/test/noparse/a.js delete mode 100644 node_modules/browserify/test/noparse/b.js delete mode 100644 node_modules/browserify/test/noparse/dir1/1.js delete mode 100644 node_modules/browserify/test/noparse/dir1/dir2/2.js delete mode 100644 node_modules/browserify/test/noparse/node_modules/robot/lib/beep.js delete mode 100644 node_modules/browserify/test/noparse/node_modules/robot/lib/boop.js delete mode 100644 node_modules/browserify/test/noparse/node_modules/robot/main.js delete mode 100644 node_modules/browserify/test/noparse/node_modules/robot/package.json delete mode 100644 node_modules/browserify/test/pack.js delete mode 100644 node_modules/browserify/test/paths.js delete mode 100644 node_modules/browserify/test/paths/main.js delete mode 100644 node_modules/browserify/test/paths/x/aaa/index.js delete mode 100644 node_modules/browserify/test/paths/x/ccc/index.js delete mode 100644 node_modules/browserify/test/paths/y/bbb/index.js delete mode 100644 node_modules/browserify/test/paths/y/ccc/index.js delete mode 100644 node_modules/browserify/test/paths_transform.js delete mode 100644 node_modules/browserify/test/pipeline_deps.js delete mode 100644 node_modules/browserify/test/pipeline_deps/bar.js delete mode 100644 node_modules/browserify/test/pipeline_deps/foo.js delete mode 100644 node_modules/browserify/test/pipeline_deps/main.js delete mode 100644 node_modules/browserify/test/pipeline_deps/xyz.js delete mode 100644 node_modules/browserify/test/pkg.js delete mode 100644 node_modules/browserify/test/pkg/main.js delete mode 100644 node_modules/browserify/test/pkg/package.json delete mode 100644 node_modules/browserify/test/pkg_event.js delete mode 100644 node_modules/browserify/test/pkg_event/main.js delete mode 100644 node_modules/browserify/test/pkg_event/node_modules/aaa/lib/butts.js delete mode 100644 node_modules/browserify/test/pkg_event/node_modules/aaa/lib/package.json delete mode 100644 node_modules/browserify/test/pkg_event/node_modules/aaa/lib/woo.js delete mode 100644 node_modules/browserify/test/pkg_event/node_modules/aaa/main.js delete mode 100644 node_modules/browserify/test/pkg_event/node_modules/aaa/package.json delete mode 100644 node_modules/browserify/test/pkg_event/package.json delete mode 100644 node_modules/browserify/test/plugin.js delete mode 100644 node_modules/browserify/test/plugin/main.js delete mode 100644 node_modules/browserify/test/preserve-symlinks.js delete mode 100644 node_modules/browserify/test/preserve_symlinks/a/index.js delete mode 100644 node_modules/browserify/test/preserve_symlinks/a/node_modules/b/index.js delete mode 100644 node_modules/browserify/test/preserve_symlinks/a/node_modules/c/index.js delete mode 100644 node_modules/browserify/test/preserve_symlinks/b/index.js delete mode 100644 node_modules/browserify/test/process.js delete mode 100644 node_modules/browserify/test/process/main.js delete mode 100644 node_modules/browserify/test/process/one.js delete mode 100644 node_modules/browserify/test/process/two.js delete mode 100644 node_modules/browserify/test/quotes.js delete mode 100644 node_modules/browserify/test/quotes/backtick.js delete mode 100644 node_modules/browserify/test/quotes/main.js delete mode 100644 node_modules/browserify/test/quotes/one.js delete mode 100644 node_modules/browserify/test/quotes/three.js delete mode 100644 node_modules/browserify/test/quotes/two.js delete mode 100644 node_modules/browserify/test/relative_dedupe.js delete mode 100644 node_modules/browserify/test/relative_dedupe/a/a.js delete mode 100644 node_modules/browserify/test/relative_dedupe/a/b.js delete mode 100644 node_modules/browserify/test/relative_dedupe/a/index.js delete mode 100644 node_modules/browserify/test/relative_dedupe/b/a.js delete mode 100644 node_modules/browserify/test/relative_dedupe/b/b.js delete mode 100644 node_modules/browserify/test/relative_dedupe/b/index.js delete mode 100644 node_modules/browserify/test/relative_dedupe/index.js delete mode 100644 node_modules/browserify/test/relative_dedupe/main.js delete mode 100644 node_modules/browserify/test/require_cache.js delete mode 100644 node_modules/browserify/test/require_expose.js delete mode 100644 node_modules/browserify/test/require_expose/main.js delete mode 100644 node_modules/browserify/test/require_expose/some_dep.js delete mode 100644 node_modules/browserify/test/reset.js delete mode 100644 node_modules/browserify/test/resolve_exposed.js delete mode 100644 node_modules/browserify/test/resolve_exposed/main.js delete mode 100644 node_modules/browserify/test/resolve_exposed/x.js delete mode 100644 node_modules/browserify/test/retarget.js delete mode 100644 node_modules/browserify/test/reverse_multi_bundle.js delete mode 100644 node_modules/browserify/test/reverse_multi_bundle/app.js delete mode 100644 node_modules/browserify/test/reverse_multi_bundle/arbitrary.js delete mode 100644 node_modules/browserify/test/reverse_multi_bundle/lazy.js delete mode 100644 node_modules/browserify/test/reverse_multi_bundle/shared.js delete mode 100644 node_modules/browserify/test/shared_symlink.js delete mode 100644 node_modules/browserify/test/shared_symlink/app/index.js delete mode 100644 node_modules/browserify/test/shared_symlink/app/node_modules/foo/index.js delete mode 100644 node_modules/browserify/test/shared_symlink/app/node_modules/shared/index.js delete mode 100644 node_modules/browserify/test/shared_symlink/main.js delete mode 100644 node_modules/browserify/test/shared_symlink/shared/index.js delete mode 100644 node_modules/browserify/test/shebang.js delete mode 100644 node_modules/browserify/test/shebang/foo.js delete mode 100644 node_modules/browserify/test/shebang/main.js delete mode 100644 node_modules/browserify/test/spread.js delete mode 100644 node_modules/browserify/test/spread/main.js delete mode 100644 node_modules/browserify/test/standalone.js delete mode 100644 node_modules/browserify/test/standalone/main.js delete mode 100644 node_modules/browserify/test/standalone/one.js delete mode 100644 node_modules/browserify/test/standalone/two.js delete mode 100644 node_modules/browserify/test/standalone_events.js delete mode 100644 node_modules/browserify/test/standalone_sourcemap.js delete mode 100644 node_modules/browserify/test/stdin.js delete mode 100644 node_modules/browserify/test/stream.js delete mode 100644 node_modules/browserify/test/stream/bar.js delete mode 100644 node_modules/browserify/test/stream/foo.js delete mode 100644 node_modules/browserify/test/stream/main.js delete mode 100644 node_modules/browserify/test/stream_file.js delete mode 100644 node_modules/browserify/test/subdep.js delete mode 100644 node_modules/browserify/test/subdep/index.js delete mode 100644 node_modules/browserify/test/subdep/node_modules/qq/b.js delete mode 100644 node_modules/browserify/test/subdep/node_modules/qq/ignore_me.js delete mode 100644 node_modules/browserify/test/subdep/node_modules/qq/node_modules/a/index.js delete mode 100644 node_modules/browserify/test/subdep/node_modules/qq/node_modules/a/package.json delete mode 100644 node_modules/browserify/test/subdep/node_modules/qq/node_modules/c/index.js delete mode 100644 node_modules/browserify/test/subdep/node_modules/qq/node_modules/c/package.json delete mode 100644 node_modules/browserify/test/subdep/node_modules/qq/node_modules/f/index.js delete mode 100644 node_modules/browserify/test/subdep/node_modules/qq/node_modules/z/index.js delete mode 100644 node_modules/browserify/test/subdep/node_modules/qq/package.json delete mode 100644 node_modules/browserify/test/subdep/package.json delete mode 100644 node_modules/browserify/test/symlink_dedupe.js delete mode 100644 node_modules/browserify/test/symlink_dedupe/main.js delete mode 100644 node_modules/browserify/test/symlink_dedupe/one/f.js delete mode 100644 node_modules/browserify/test/symlink_dedupe/one/g.js delete mode 100644 node_modules/browserify/test/syntax_cache.js delete mode 100644 node_modules/browserify/test/syntax_cache/invalid.js delete mode 100644 node_modules/browserify/test/syntax_cache/valid.js delete mode 100644 node_modules/browserify/test/tr.js delete mode 100644 node_modules/browserify/test/tr/f.js delete mode 100644 node_modules/browserify/test/tr/main.js delete mode 100644 node_modules/browserify/test/tr/node_modules/g/index.js delete mode 100644 node_modules/browserify/test/tr/node_modules/g/node_modules/insert-ggg/index.js delete mode 100644 node_modules/browserify/test/tr/node_modules/g/package.json delete mode 100644 node_modules/browserify/test/tr/node_modules/insert-aaa/index.js delete mode 100644 node_modules/browserify/test/tr/node_modules/insert-bbb/index.js delete mode 100644 node_modules/browserify/test/tr/node_modules/m/index.js delete mode 100644 node_modules/browserify/test/tr/node_modules/xyz/index.js delete mode 100644 node_modules/browserify/test/tr/package.json delete mode 100644 node_modules/browserify/test/tr/subdir/g.js delete mode 100644 node_modules/browserify/test/tr_args.js delete mode 100644 node_modules/browserify/test/tr_args/main.js delete mode 100644 node_modules/browserify/test/tr_args/tr.js delete mode 100644 node_modules/browserify/test/tr_error.js delete mode 100644 node_modules/browserify/test/tr_flags.js delete mode 100644 node_modules/browserify/test/tr_global.js delete mode 100644 node_modules/browserify/test/tr_global/main.js delete mode 100644 node_modules/browserify/test/tr_global/node_modules/tr/index.js delete mode 100644 node_modules/browserify/test/tr_global/node_modules/x/index.js delete mode 100644 node_modules/browserify/test/tr_global/node_modules/x/node_modules/tr/index.js delete mode 100644 node_modules/browserify/test/tr_no_entry.js delete mode 100644 node_modules/browserify/test/tr_no_entry/main.js delete mode 100644 node_modules/browserify/test/tr_once.js delete mode 100644 node_modules/browserify/test/tr_once/main.js delete mode 100644 node_modules/browserify/test/tr_order.js delete mode 100644 node_modules/browserify/test/tr_order/replace_aaa.js delete mode 100644 node_modules/browserify/test/tr_order/replace_bbb.js delete mode 100644 node_modules/browserify/test/tr_symlink.js delete mode 100644 node_modules/browserify/test/tr_symlink/a-module/index.js delete mode 100644 node_modules/browserify/test/tr_symlink/app/main.js delete mode 100644 node_modules/browserify/test/tr_symlink/app/node_modules/aaa/index.js delete mode 100644 node_modules/browserify/test/tr_symlink/app/node_modules/bbb/ext.js delete mode 100644 node_modules/browserify/test/tr_symlink/app/node_modules/bbb/index.js delete mode 100644 node_modules/browserify/test/tr_symlink/app/node_modules/tr/index.js delete mode 100644 node_modules/browserify/test/tr_symlink/app/package.json delete mode 100644 node_modules/browserify/test/tr_symlink/b-module/ext.js delete mode 100644 node_modules/browserify/test/tr_symlink/b-module/index.js delete mode 100644 node_modules/browserify/test/unicode.js delete mode 100644 node_modules/browserify/test/unicode/main.js delete mode 100644 node_modules/browserify/test/unicode/one.js delete mode 100644 node_modules/browserify/test/unicode/two.js delete mode 100644 node_modules/browserify/test/util.js delete mode 100644 node_modules/browserify/test/yield.js delete mode 100644 node_modules/browserify/test/yield/f.js delete mode 100644 node_modules/browserify/test/yield/main.js delete mode 100644 node_modules/budo/.travis.yml delete mode 100644 node_modules/budo/CHANGELOG.md delete mode 100644 node_modules/budo/LICENSE.md delete mode 100644 node_modules/budo/README.md delete mode 100644 node_modules/budo/bin/bundle-livereload-client.js delete mode 100755 node_modules/budo/bin/cmd.js delete mode 100644 node_modules/budo/bin/help.txt delete mode 100644 node_modules/budo/build/bundled-livereload-client.js delete mode 100644 node_modules/budo/index.js delete mode 100644 node_modules/budo/lib/budo.js delete mode 100644 node_modules/budo/lib/bundler.js delete mode 100644 node_modules/budo/lib/error-handler.js delete mode 100644 node_modules/budo/lib/file-watch.js delete mode 100644 node_modules/budo/lib/get-ports.js delete mode 100644 node_modules/budo/lib/map-entry.js delete mode 100644 node_modules/budo/lib/middleware.js delete mode 100644 node_modules/budo/lib/parse-args.js delete mode 100644 node_modules/budo/lib/reload/client.js delete mode 100644 node_modules/budo/lib/reload/error-popup.js delete mode 100644 node_modules/budo/lib/reload/server.js delete mode 100644 node_modules/budo/lib/server.js delete mode 100644 node_modules/budo/lib/simple-http-logger.js delete mode 100644 node_modules/budo/package.json delete mode 100644 node_modules/buffer-from/LICENSE delete mode 100644 node_modules/buffer-from/index.js delete mode 100644 node_modules/buffer-from/package.json delete mode 100644 node_modules/buffer-from/readme.md delete mode 100644 node_modules/buffer-xor/.npmignore delete mode 100644 node_modules/buffer-xor/.travis.yml delete mode 100644 node_modules/buffer-xor/LICENSE delete mode 100644 node_modules/buffer-xor/README.md delete mode 100644 node_modules/buffer-xor/index.js delete mode 100644 node_modules/buffer-xor/inline.js delete mode 100644 node_modules/buffer-xor/inplace.js delete mode 100644 node_modules/buffer-xor/package.json delete mode 100644 node_modules/buffer-xor/test/fixtures.json delete mode 100644 node_modules/buffer-xor/test/index.js delete mode 100644 node_modules/buffer/AUTHORS.md delete mode 100644 node_modules/buffer/LICENSE delete mode 100644 node_modules/buffer/README.md delete mode 100644 node_modules/buffer/index.d.ts delete mode 100644 node_modules/buffer/index.js delete mode 100644 node_modules/buffer/package.json delete mode 100644 node_modules/builtin-status-codes/browser.js delete mode 100644 node_modules/builtin-status-codes/build.js delete mode 100644 node_modules/builtin-status-codes/index.js delete mode 100644 node_modules/builtin-status-codes/license delete mode 100644 node_modules/builtin-status-codes/package.json delete mode 100644 node_modules/builtin-status-codes/readme.md delete mode 100644 node_modules/cache-base/LICENSE delete mode 100644 node_modules/cache-base/README.md delete mode 100644 node_modules/cache-base/index.js delete mode 100644 node_modules/cache-base/node_modules/isobject/LICENSE delete mode 100644 node_modules/cache-base/node_modules/isobject/README.md delete mode 100644 node_modules/cache-base/node_modules/isobject/index.d.ts delete mode 100644 node_modules/cache-base/node_modules/isobject/index.js delete mode 100644 node_modules/cache-base/node_modules/isobject/package.json delete mode 100644 node_modules/cache-base/package.json delete mode 100644 node_modules/cached-path-relative/.npmignore delete mode 100644 node_modules/cached-path-relative/History.md delete mode 100644 node_modules/cached-path-relative/Makefile delete mode 100644 node_modules/cached-path-relative/Readme.md delete mode 100644 node_modules/cached-path-relative/lib/index.js delete mode 100644 node_modules/cached-path-relative/package.json delete mode 100644 node_modules/cached-path-relative/shim.js delete mode 100644 node_modules/cached-path-relative/test/index.js delete mode 100644 node_modules/chalk/index.js delete mode 120000 node_modules/chalk/node_modules/.bin/strip-ansi delete mode 100755 node_modules/chalk/node_modules/strip-ansi/cli.js delete mode 100644 node_modules/chalk/node_modules/strip-ansi/index.js delete mode 100644 node_modules/chalk/node_modules/strip-ansi/package.json delete mode 100644 node_modules/chalk/node_modules/strip-ansi/readme.md delete mode 100644 node_modules/chalk/package.json delete mode 100644 node_modules/chalk/readme.md delete mode 100644 node_modules/charenc/LICENSE.mkd delete mode 100644 node_modules/charenc/README.js delete mode 100644 node_modules/charenc/charenc.js delete mode 100644 node_modules/charenc/package.json delete mode 100644 node_modules/chokidar/CHANGELOG.md delete mode 100644 node_modules/chokidar/README.md delete mode 100644 node_modules/chokidar/index.js delete mode 100644 node_modules/chokidar/lib/fsevents-handler.js delete mode 100644 node_modules/chokidar/lib/nodefs-handler.js delete mode 100644 node_modules/chokidar/package.json delete mode 100644 node_modules/cipher-base/.eslintrc delete mode 100644 node_modules/cipher-base/.npmignore delete mode 100644 node_modules/cipher-base/.travis.yml delete mode 100644 node_modules/cipher-base/LICENSE delete mode 100644 node_modules/cipher-base/README.md delete mode 100644 node_modules/cipher-base/index.js delete mode 100644 node_modules/cipher-base/package.json delete mode 100644 node_modules/cipher-base/test.js delete mode 100644 node_modules/class-utils/LICENSE delete mode 100644 node_modules/class-utils/README.md delete mode 100644 node_modules/class-utils/index.js delete mode 100644 node_modules/class-utils/node_modules/define-property/LICENSE delete mode 100644 node_modules/class-utils/node_modules/define-property/README.md delete mode 100644 node_modules/class-utils/node_modules/define-property/index.js delete mode 100644 node_modules/class-utils/node_modules/define-property/package.json delete mode 100644 node_modules/class-utils/node_modules/isobject/LICENSE delete mode 100644 node_modules/class-utils/node_modules/isobject/README.md delete mode 100644 node_modules/class-utils/node_modules/isobject/index.d.ts delete mode 100644 node_modules/class-utils/node_modules/isobject/index.js delete mode 100644 node_modules/class-utils/node_modules/isobject/package.json delete mode 100644 node_modules/class-utils/package.json delete mode 100644 node_modules/collection-visit/LICENSE delete mode 100644 node_modules/collection-visit/README.md delete mode 100644 node_modules/collection-visit/index.js delete mode 100644 node_modules/collection-visit/package.json delete mode 100644 node_modules/combine-source-map/.npmignore delete mode 100644 node_modules/combine-source-map/.travis.yml delete mode 100644 node_modules/combine-source-map/LICENSE delete mode 100644 node_modules/combine-source-map/README.md delete mode 100644 node_modules/combine-source-map/example/two-files-short.js delete mode 100644 node_modules/combine-source-map/example/two-files.js delete mode 100644 node_modules/combine-source-map/index.js delete mode 100644 node_modules/combine-source-map/lib/mappings-from-map.js delete mode 100644 node_modules/combine-source-map/lib/path-is-absolute.js delete mode 100644 node_modules/combine-source-map/lib/path-is-absolute.license delete mode 100644 node_modules/combine-source-map/package.json delete mode 100644 node_modules/combine-source-map/test/combine-source-map.js delete mode 100644 node_modules/component-emitter/History.md delete mode 100644 node_modules/component-emitter/LICENSE delete mode 100644 node_modules/component-emitter/Readme.md delete mode 100644 node_modules/component-emitter/index.js delete mode 100644 node_modules/component-emitter/package.json delete mode 100644 node_modules/concat-map/.travis.yml delete mode 100644 node_modules/concat-map/LICENSE delete mode 100644 node_modules/concat-map/README.markdown delete mode 100644 node_modules/concat-map/example/map.js delete mode 100644 node_modules/concat-map/index.js delete mode 100644 node_modules/concat-map/package.json delete mode 100644 node_modules/concat-map/test/map.js delete mode 100644 node_modules/concat-stream/LICENSE delete mode 100644 node_modules/concat-stream/index.js delete mode 100644 node_modules/concat-stream/package.json delete mode 100644 node_modules/concat-stream/readme.md delete mode 100644 node_modules/connect-pushstate/.jshintrc delete mode 100644 node_modules/connect-pushstate/.npmignore delete mode 100644 node_modules/connect-pushstate/Gruntfile.js delete mode 100644 node_modules/connect-pushstate/LICENSE delete mode 100644 node_modules/connect-pushstate/README.md delete mode 100755 node_modules/connect-pushstate/examples/server.js delete mode 100644 node_modules/connect-pushstate/index.js delete mode 100644 node_modules/connect-pushstate/package.json delete mode 100644 node_modules/connect-pushstate/test/fixtures/www/images/image.png delete mode 100644 node_modules/connect-pushstate/test/fixtures/www/index.html delete mode 100644 node_modules/connect-pushstate/test/fixtures/www/other/index.html delete mode 100644 node_modules/connect-pushstate/test/pushstate-test.js delete mode 100644 node_modules/console-browserify/.npmignore delete mode 100644 node_modules/console-browserify/.testem.json delete mode 100644 node_modules/console-browserify/.travis.yml delete mode 100644 node_modules/console-browserify/LICENCE delete mode 100644 node_modules/console-browserify/README.md delete mode 100644 node_modules/console-browserify/index.js delete mode 100644 node_modules/console-browserify/package.json delete mode 100644 node_modules/console-browserify/test/index.js delete mode 100644 node_modules/console-browserify/test/static/index.html delete mode 100644 node_modules/console-browserify/test/static/test-adapter.js delete mode 100644 node_modules/constants-browserify/README.md delete mode 100755 node_modules/constants-browserify/build.sh delete mode 100644 node_modules/constants-browserify/constants.json delete mode 100644 node_modules/constants-browserify/package.json delete mode 100644 node_modules/constants-browserify/test.js delete mode 100644 node_modules/convert-source-map/.npmignore delete mode 100644 node_modules/convert-source-map/.travis.yml delete mode 100644 node_modules/convert-source-map/LICENSE delete mode 100644 node_modules/convert-source-map/README.md delete mode 100644 node_modules/convert-source-map/example/comment-to-json.js delete mode 100644 node_modules/convert-source-map/index.js delete mode 100644 node_modules/convert-source-map/package.json delete mode 100644 node_modules/convert-source-map/test/comment-regex.js delete mode 100644 node_modules/convert-source-map/test/convert-source-map.js delete mode 100644 node_modules/convert-source-map/test/fixtures/map-file-comment-double-slash.css delete mode 100644 node_modules/convert-source-map/test/fixtures/map-file-comment-inline.css delete mode 100644 node_modules/convert-source-map/test/fixtures/map-file-comment.css delete mode 100644 node_modules/convert-source-map/test/fixtures/map-file-comment.css.map delete mode 100644 node_modules/convert-source-map/test/map-file-comment.js delete mode 100644 node_modules/copy-descriptor/LICENSE delete mode 100644 node_modules/copy-descriptor/index.js delete mode 100644 node_modules/copy-descriptor/package.json delete mode 100644 node_modules/core-js/CHANGELOG.md delete mode 100644 node_modules/core-js/Gruntfile.js delete mode 100644 node_modules/core-js/LICENSE delete mode 100644 node_modules/core-js/README.md delete mode 100644 node_modules/core-js/bower.json delete mode 100644 node_modules/core-js/build/Gruntfile.ls delete mode 100644 node_modules/core-js/build/build.ls delete mode 100644 node_modules/core-js/build/config.js delete mode 100644 node_modules/core-js/build/index.js delete mode 100644 node_modules/core-js/client/core.js delete mode 100644 node_modules/core-js/client/core.min.js delete mode 100644 node_modules/core-js/client/core.min.js.map delete mode 100644 node_modules/core-js/client/library.js delete mode 100644 node_modules/core-js/client/library.min.js delete mode 100644 node_modules/core-js/client/library.min.js.map delete mode 100644 node_modules/core-js/client/shim.js delete mode 100644 node_modules/core-js/client/shim.min.js delete mode 100644 node_modules/core-js/client/shim.min.js.map delete mode 100644 node_modules/core-js/core/_.js delete mode 100644 node_modules/core-js/core/delay.js delete mode 100644 node_modules/core-js/core/dict.js delete mode 100644 node_modules/core-js/core/function.js delete mode 100644 node_modules/core-js/core/index.js delete mode 100644 node_modules/core-js/core/number.js delete mode 100644 node_modules/core-js/core/object.js delete mode 100644 node_modules/core-js/core/regexp.js delete mode 100644 node_modules/core-js/core/string.js delete mode 100644 node_modules/core-js/es5/index.js delete mode 100644 node_modules/core-js/es6/array.js delete mode 100644 node_modules/core-js/es6/date.js delete mode 100644 node_modules/core-js/es6/function.js delete mode 100644 node_modules/core-js/es6/index.js delete mode 100644 node_modules/core-js/es6/map.js delete mode 100644 node_modules/core-js/es6/math.js delete mode 100644 node_modules/core-js/es6/number.js delete mode 100644 node_modules/core-js/es6/object.js delete mode 100644 node_modules/core-js/es6/parse-float.js delete mode 100644 node_modules/core-js/es6/parse-int.js delete mode 100644 node_modules/core-js/es6/promise.js delete mode 100644 node_modules/core-js/es6/reflect.js delete mode 100644 node_modules/core-js/es6/regexp.js delete mode 100644 node_modules/core-js/es6/set.js delete mode 100644 node_modules/core-js/es6/string.js delete mode 100644 node_modules/core-js/es6/symbol.js delete mode 100644 node_modules/core-js/es6/typed.js delete mode 100644 node_modules/core-js/es6/weak-map.js delete mode 100644 node_modules/core-js/es6/weak-set.js delete mode 100644 node_modules/core-js/es7/array.js delete mode 100644 node_modules/core-js/es7/asap.js delete mode 100644 node_modules/core-js/es7/error.js delete mode 100644 node_modules/core-js/es7/global.js delete mode 100644 node_modules/core-js/es7/index.js delete mode 100644 node_modules/core-js/es7/map.js delete mode 100644 node_modules/core-js/es7/math.js delete mode 100644 node_modules/core-js/es7/object.js delete mode 100644 node_modules/core-js/es7/observable.js delete mode 100644 node_modules/core-js/es7/promise.js delete mode 100644 node_modules/core-js/es7/reflect.js delete mode 100644 node_modules/core-js/es7/set.js delete mode 100644 node_modules/core-js/es7/string.js delete mode 100644 node_modules/core-js/es7/symbol.js delete mode 100644 node_modules/core-js/es7/system.js delete mode 100644 node_modules/core-js/es7/weak-map.js delete mode 100644 node_modules/core-js/es7/weak-set.js delete mode 100644 node_modules/core-js/fn/_.js delete mode 100644 node_modules/core-js/fn/array/concat.js delete mode 100644 node_modules/core-js/fn/array/copy-within.js delete mode 100644 node_modules/core-js/fn/array/entries.js delete mode 100644 node_modules/core-js/fn/array/every.js delete mode 100644 node_modules/core-js/fn/array/fill.js delete mode 100644 node_modules/core-js/fn/array/filter.js delete mode 100644 node_modules/core-js/fn/array/find-index.js delete mode 100644 node_modules/core-js/fn/array/find.js delete mode 100644 node_modules/core-js/fn/array/flat-map.js delete mode 100644 node_modules/core-js/fn/array/flatten.js delete mode 100644 node_modules/core-js/fn/array/for-each.js delete mode 100644 node_modules/core-js/fn/array/from.js delete mode 100644 node_modules/core-js/fn/array/includes.js delete mode 100644 node_modules/core-js/fn/array/index-of.js delete mode 100644 node_modules/core-js/fn/array/index.js delete mode 100644 node_modules/core-js/fn/array/is-array.js delete mode 100644 node_modules/core-js/fn/array/iterator.js delete mode 100644 node_modules/core-js/fn/array/join.js delete mode 100644 node_modules/core-js/fn/array/keys.js delete mode 100644 node_modules/core-js/fn/array/last-index-of.js delete mode 100644 node_modules/core-js/fn/array/map.js delete mode 100644 node_modules/core-js/fn/array/of.js delete mode 100644 node_modules/core-js/fn/array/pop.js delete mode 100644 node_modules/core-js/fn/array/push.js delete mode 100644 node_modules/core-js/fn/array/reduce-right.js delete mode 100644 node_modules/core-js/fn/array/reduce.js delete mode 100644 node_modules/core-js/fn/array/reverse.js delete mode 100644 node_modules/core-js/fn/array/shift.js delete mode 100644 node_modules/core-js/fn/array/slice.js delete mode 100644 node_modules/core-js/fn/array/some.js delete mode 100644 node_modules/core-js/fn/array/sort.js delete mode 100644 node_modules/core-js/fn/array/splice.js delete mode 100644 node_modules/core-js/fn/array/unshift.js delete mode 100644 node_modules/core-js/fn/array/values.js delete mode 100644 node_modules/core-js/fn/array/virtual/copy-within.js delete mode 100644 node_modules/core-js/fn/array/virtual/entries.js delete mode 100644 node_modules/core-js/fn/array/virtual/every.js delete mode 100644 node_modules/core-js/fn/array/virtual/fill.js delete mode 100644 node_modules/core-js/fn/array/virtual/filter.js delete mode 100644 node_modules/core-js/fn/array/virtual/find-index.js delete mode 100644 node_modules/core-js/fn/array/virtual/find.js delete mode 100644 node_modules/core-js/fn/array/virtual/flat-map.js delete mode 100644 node_modules/core-js/fn/array/virtual/flatten.js delete mode 100644 node_modules/core-js/fn/array/virtual/for-each.js delete mode 100644 node_modules/core-js/fn/array/virtual/includes.js delete mode 100644 node_modules/core-js/fn/array/virtual/index-of.js delete mode 100644 node_modules/core-js/fn/array/virtual/index.js delete mode 100644 node_modules/core-js/fn/array/virtual/iterator.js delete mode 100644 node_modules/core-js/fn/array/virtual/join.js delete mode 100644 node_modules/core-js/fn/array/virtual/keys.js delete mode 100644 node_modules/core-js/fn/array/virtual/last-index-of.js delete mode 100644 node_modules/core-js/fn/array/virtual/map.js delete mode 100644 node_modules/core-js/fn/array/virtual/reduce-right.js delete mode 100644 node_modules/core-js/fn/array/virtual/reduce.js delete mode 100644 node_modules/core-js/fn/array/virtual/slice.js delete mode 100644 node_modules/core-js/fn/array/virtual/some.js delete mode 100644 node_modules/core-js/fn/array/virtual/sort.js delete mode 100644 node_modules/core-js/fn/array/virtual/values.js delete mode 100644 node_modules/core-js/fn/asap.js delete mode 100644 node_modules/core-js/fn/clear-immediate.js delete mode 100644 node_modules/core-js/fn/date/index.js delete mode 100644 node_modules/core-js/fn/date/now.js delete mode 100644 node_modules/core-js/fn/date/to-iso-string.js delete mode 100644 node_modules/core-js/fn/date/to-json.js delete mode 100644 node_modules/core-js/fn/date/to-primitive.js delete mode 100644 node_modules/core-js/fn/date/to-string.js delete mode 100644 node_modules/core-js/fn/delay.js delete mode 100644 node_modules/core-js/fn/dict.js delete mode 100644 node_modules/core-js/fn/dom-collections/index.js delete mode 100644 node_modules/core-js/fn/dom-collections/iterator.js delete mode 100644 node_modules/core-js/fn/error/index.js delete mode 100644 node_modules/core-js/fn/error/is-error.js delete mode 100644 node_modules/core-js/fn/function/bind.js delete mode 100644 node_modules/core-js/fn/function/has-instance.js delete mode 100644 node_modules/core-js/fn/function/index.js delete mode 100644 node_modules/core-js/fn/function/name.js delete mode 100644 node_modules/core-js/fn/function/part.js delete mode 100644 node_modules/core-js/fn/function/virtual/bind.js delete mode 100644 node_modules/core-js/fn/function/virtual/index.js delete mode 100644 node_modules/core-js/fn/function/virtual/part.js delete mode 100644 node_modules/core-js/fn/get-iterator-method.js delete mode 100644 node_modules/core-js/fn/get-iterator.js delete mode 100644 node_modules/core-js/fn/global.js delete mode 100644 node_modules/core-js/fn/is-iterable.js delete mode 100644 node_modules/core-js/fn/json/index.js delete mode 100644 node_modules/core-js/fn/json/stringify.js delete mode 100644 node_modules/core-js/fn/map.js delete mode 100644 node_modules/core-js/fn/map/from.js delete mode 100644 node_modules/core-js/fn/map/index.js delete mode 100644 node_modules/core-js/fn/map/of.js delete mode 100644 node_modules/core-js/fn/math/acosh.js delete mode 100644 node_modules/core-js/fn/math/asinh.js delete mode 100644 node_modules/core-js/fn/math/atanh.js delete mode 100644 node_modules/core-js/fn/math/cbrt.js delete mode 100644 node_modules/core-js/fn/math/clamp.js delete mode 100644 node_modules/core-js/fn/math/clz32.js delete mode 100644 node_modules/core-js/fn/math/cosh.js delete mode 100644 node_modules/core-js/fn/math/deg-per-rad.js delete mode 100644 node_modules/core-js/fn/math/degrees.js delete mode 100644 node_modules/core-js/fn/math/expm1.js delete mode 100644 node_modules/core-js/fn/math/fround.js delete mode 100644 node_modules/core-js/fn/math/fscale.js delete mode 100644 node_modules/core-js/fn/math/hypot.js delete mode 100644 node_modules/core-js/fn/math/iaddh.js delete mode 100644 node_modules/core-js/fn/math/imul.js delete mode 100644 node_modules/core-js/fn/math/imulh.js delete mode 100644 node_modules/core-js/fn/math/index.js delete mode 100644 node_modules/core-js/fn/math/isubh.js delete mode 100644 node_modules/core-js/fn/math/log10.js delete mode 100644 node_modules/core-js/fn/math/log1p.js delete mode 100644 node_modules/core-js/fn/math/log2.js delete mode 100644 node_modules/core-js/fn/math/rad-per-deg.js delete mode 100644 node_modules/core-js/fn/math/radians.js delete mode 100644 node_modules/core-js/fn/math/scale.js delete mode 100644 node_modules/core-js/fn/math/sign.js delete mode 100644 node_modules/core-js/fn/math/signbit.js delete mode 100644 node_modules/core-js/fn/math/sinh.js delete mode 100644 node_modules/core-js/fn/math/tanh.js delete mode 100644 node_modules/core-js/fn/math/trunc.js delete mode 100644 node_modules/core-js/fn/math/umulh.js delete mode 100644 node_modules/core-js/fn/number/constructor.js delete mode 100644 node_modules/core-js/fn/number/epsilon.js delete mode 100644 node_modules/core-js/fn/number/index.js delete mode 100644 node_modules/core-js/fn/number/is-finite.js delete mode 100644 node_modules/core-js/fn/number/is-integer.js delete mode 100644 node_modules/core-js/fn/number/is-nan.js delete mode 100644 node_modules/core-js/fn/number/is-safe-integer.js delete mode 100644 node_modules/core-js/fn/number/iterator.js delete mode 100644 node_modules/core-js/fn/number/max-safe-integer.js delete mode 100644 node_modules/core-js/fn/number/min-safe-integer.js delete mode 100644 node_modules/core-js/fn/number/parse-float.js delete mode 100644 node_modules/core-js/fn/number/parse-int.js delete mode 100644 node_modules/core-js/fn/number/to-fixed.js delete mode 100644 node_modules/core-js/fn/number/to-precision.js delete mode 100644 node_modules/core-js/fn/number/virtual/index.js delete mode 100644 node_modules/core-js/fn/number/virtual/iterator.js delete mode 100644 node_modules/core-js/fn/number/virtual/to-fixed.js delete mode 100644 node_modules/core-js/fn/number/virtual/to-precision.js delete mode 100644 node_modules/core-js/fn/object/assign.js delete mode 100644 node_modules/core-js/fn/object/classof.js delete mode 100644 node_modules/core-js/fn/object/create.js delete mode 100644 node_modules/core-js/fn/object/define-getter.js delete mode 100644 node_modules/core-js/fn/object/define-properties.js delete mode 100644 node_modules/core-js/fn/object/define-property.js delete mode 100644 node_modules/core-js/fn/object/define-setter.js delete mode 100644 node_modules/core-js/fn/object/define.js delete mode 100644 node_modules/core-js/fn/object/entries.js delete mode 100644 node_modules/core-js/fn/object/freeze.js delete mode 100644 node_modules/core-js/fn/object/get-own-property-descriptor.js delete mode 100644 node_modules/core-js/fn/object/get-own-property-descriptors.js delete mode 100644 node_modules/core-js/fn/object/get-own-property-names.js delete mode 100644 node_modules/core-js/fn/object/get-own-property-symbols.js delete mode 100644 node_modules/core-js/fn/object/get-prototype-of.js delete mode 100644 node_modules/core-js/fn/object/index.js delete mode 100644 node_modules/core-js/fn/object/is-extensible.js delete mode 100644 node_modules/core-js/fn/object/is-frozen.js delete mode 100644 node_modules/core-js/fn/object/is-object.js delete mode 100644 node_modules/core-js/fn/object/is-sealed.js delete mode 100644 node_modules/core-js/fn/object/is.js delete mode 100644 node_modules/core-js/fn/object/keys.js delete mode 100644 node_modules/core-js/fn/object/lookup-getter.js delete mode 100644 node_modules/core-js/fn/object/lookup-setter.js delete mode 100644 node_modules/core-js/fn/object/make.js delete mode 100644 node_modules/core-js/fn/object/prevent-extensions.js delete mode 100644 node_modules/core-js/fn/object/seal.js delete mode 100644 node_modules/core-js/fn/object/set-prototype-of.js delete mode 100644 node_modules/core-js/fn/object/values.js delete mode 100644 node_modules/core-js/fn/observable.js delete mode 100644 node_modules/core-js/fn/parse-float.js delete mode 100644 node_modules/core-js/fn/parse-int.js delete mode 100644 node_modules/core-js/fn/promise.js delete mode 100644 node_modules/core-js/fn/promise/finally.js delete mode 100644 node_modules/core-js/fn/promise/index.js delete mode 100644 node_modules/core-js/fn/promise/try.js delete mode 100644 node_modules/core-js/fn/reflect/apply.js delete mode 100644 node_modules/core-js/fn/reflect/construct.js delete mode 100644 node_modules/core-js/fn/reflect/define-metadata.js delete mode 100644 node_modules/core-js/fn/reflect/define-property.js delete mode 100644 node_modules/core-js/fn/reflect/delete-metadata.js delete mode 100644 node_modules/core-js/fn/reflect/delete-property.js delete mode 100644 node_modules/core-js/fn/reflect/enumerate.js delete mode 100644 node_modules/core-js/fn/reflect/get-metadata-keys.js delete mode 100644 node_modules/core-js/fn/reflect/get-metadata.js delete mode 100644 node_modules/core-js/fn/reflect/get-own-metadata-keys.js delete mode 100644 node_modules/core-js/fn/reflect/get-own-metadata.js delete mode 100644 node_modules/core-js/fn/reflect/get-own-property-descriptor.js delete mode 100644 node_modules/core-js/fn/reflect/get-prototype-of.js delete mode 100644 node_modules/core-js/fn/reflect/get.js delete mode 100644 node_modules/core-js/fn/reflect/has-metadata.js delete mode 100644 node_modules/core-js/fn/reflect/has-own-metadata.js delete mode 100644 node_modules/core-js/fn/reflect/has.js delete mode 100644 node_modules/core-js/fn/reflect/index.js delete mode 100644 node_modules/core-js/fn/reflect/is-extensible.js delete mode 100644 node_modules/core-js/fn/reflect/metadata.js delete mode 100644 node_modules/core-js/fn/reflect/own-keys.js delete mode 100644 node_modules/core-js/fn/reflect/prevent-extensions.js delete mode 100644 node_modules/core-js/fn/reflect/set-prototype-of.js delete mode 100644 node_modules/core-js/fn/reflect/set.js delete mode 100644 node_modules/core-js/fn/regexp/constructor.js delete mode 100644 node_modules/core-js/fn/regexp/escape.js delete mode 100644 node_modules/core-js/fn/regexp/flags.js delete mode 100644 node_modules/core-js/fn/regexp/index.js delete mode 100644 node_modules/core-js/fn/regexp/match.js delete mode 100644 node_modules/core-js/fn/regexp/replace.js delete mode 100644 node_modules/core-js/fn/regexp/search.js delete mode 100644 node_modules/core-js/fn/regexp/split.js delete mode 100644 node_modules/core-js/fn/regexp/to-string.js delete mode 100644 node_modules/core-js/fn/set-immediate.js delete mode 100644 node_modules/core-js/fn/set-interval.js delete mode 100644 node_modules/core-js/fn/set-timeout.js delete mode 100644 node_modules/core-js/fn/set.js delete mode 100644 node_modules/core-js/fn/set/from.js delete mode 100644 node_modules/core-js/fn/set/index.js delete mode 100644 node_modules/core-js/fn/set/of.js delete mode 100644 node_modules/core-js/fn/string/anchor.js delete mode 100644 node_modules/core-js/fn/string/at.js delete mode 100644 node_modules/core-js/fn/string/big.js delete mode 100644 node_modules/core-js/fn/string/blink.js delete mode 100644 node_modules/core-js/fn/string/bold.js delete mode 100644 node_modules/core-js/fn/string/code-point-at.js delete mode 100644 node_modules/core-js/fn/string/ends-with.js delete mode 100644 node_modules/core-js/fn/string/escape-html.js delete mode 100644 node_modules/core-js/fn/string/fixed.js delete mode 100644 node_modules/core-js/fn/string/fontcolor.js delete mode 100644 node_modules/core-js/fn/string/fontsize.js delete mode 100644 node_modules/core-js/fn/string/from-code-point.js delete mode 100644 node_modules/core-js/fn/string/includes.js delete mode 100644 node_modules/core-js/fn/string/index.js delete mode 100644 node_modules/core-js/fn/string/italics.js delete mode 100644 node_modules/core-js/fn/string/iterator.js delete mode 100644 node_modules/core-js/fn/string/link.js delete mode 100644 node_modules/core-js/fn/string/match-all.js delete mode 100644 node_modules/core-js/fn/string/pad-end.js delete mode 100644 node_modules/core-js/fn/string/pad-start.js delete mode 100644 node_modules/core-js/fn/string/raw.js delete mode 100644 node_modules/core-js/fn/string/repeat.js delete mode 100644 node_modules/core-js/fn/string/small.js delete mode 100644 node_modules/core-js/fn/string/starts-with.js delete mode 100644 node_modules/core-js/fn/string/strike.js delete mode 100644 node_modules/core-js/fn/string/sub.js delete mode 100644 node_modules/core-js/fn/string/sup.js delete mode 100644 node_modules/core-js/fn/string/trim-end.js delete mode 100644 node_modules/core-js/fn/string/trim-left.js delete mode 100644 node_modules/core-js/fn/string/trim-right.js delete mode 100644 node_modules/core-js/fn/string/trim-start.js delete mode 100644 node_modules/core-js/fn/string/trim.js delete mode 100644 node_modules/core-js/fn/string/unescape-html.js delete mode 100644 node_modules/core-js/fn/string/virtual/anchor.js delete mode 100644 node_modules/core-js/fn/string/virtual/at.js delete mode 100644 node_modules/core-js/fn/string/virtual/big.js delete mode 100644 node_modules/core-js/fn/string/virtual/blink.js delete mode 100644 node_modules/core-js/fn/string/virtual/bold.js delete mode 100644 node_modules/core-js/fn/string/virtual/code-point-at.js delete mode 100644 node_modules/core-js/fn/string/virtual/ends-with.js delete mode 100644 node_modules/core-js/fn/string/virtual/escape-html.js delete mode 100644 node_modules/core-js/fn/string/virtual/fixed.js delete mode 100644 node_modules/core-js/fn/string/virtual/fontcolor.js delete mode 100644 node_modules/core-js/fn/string/virtual/fontsize.js delete mode 100644 node_modules/core-js/fn/string/virtual/includes.js delete mode 100644 node_modules/core-js/fn/string/virtual/index.js delete mode 100644 node_modules/core-js/fn/string/virtual/italics.js delete mode 100644 node_modules/core-js/fn/string/virtual/iterator.js delete mode 100644 node_modules/core-js/fn/string/virtual/link.js delete mode 100644 node_modules/core-js/fn/string/virtual/match-all.js delete mode 100644 node_modules/core-js/fn/string/virtual/pad-end.js delete mode 100644 node_modules/core-js/fn/string/virtual/pad-start.js delete mode 100644 node_modules/core-js/fn/string/virtual/repeat.js delete mode 100644 node_modules/core-js/fn/string/virtual/small.js delete mode 100644 node_modules/core-js/fn/string/virtual/starts-with.js delete mode 100644 node_modules/core-js/fn/string/virtual/strike.js delete mode 100644 node_modules/core-js/fn/string/virtual/sub.js delete mode 100644 node_modules/core-js/fn/string/virtual/sup.js delete mode 100644 node_modules/core-js/fn/string/virtual/trim-end.js delete mode 100644 node_modules/core-js/fn/string/virtual/trim-left.js delete mode 100644 node_modules/core-js/fn/string/virtual/trim-right.js delete mode 100644 node_modules/core-js/fn/string/virtual/trim-start.js delete mode 100644 node_modules/core-js/fn/string/virtual/trim.js delete mode 100644 node_modules/core-js/fn/string/virtual/unescape-html.js delete mode 100644 node_modules/core-js/fn/symbol/async-iterator.js delete mode 100644 node_modules/core-js/fn/symbol/for.js delete mode 100644 node_modules/core-js/fn/symbol/has-instance.js delete mode 100644 node_modules/core-js/fn/symbol/index.js delete mode 100644 node_modules/core-js/fn/symbol/is-concat-spreadable.js delete mode 100644 node_modules/core-js/fn/symbol/iterator.js delete mode 100644 node_modules/core-js/fn/symbol/key-for.js delete mode 100644 node_modules/core-js/fn/symbol/match.js delete mode 100644 node_modules/core-js/fn/symbol/observable.js delete mode 100644 node_modules/core-js/fn/symbol/replace.js delete mode 100644 node_modules/core-js/fn/symbol/search.js delete mode 100644 node_modules/core-js/fn/symbol/species.js delete mode 100644 node_modules/core-js/fn/symbol/split.js delete mode 100644 node_modules/core-js/fn/symbol/to-primitive.js delete mode 100644 node_modules/core-js/fn/symbol/to-string-tag.js delete mode 100644 node_modules/core-js/fn/symbol/unscopables.js delete mode 100644 node_modules/core-js/fn/system/global.js delete mode 100644 node_modules/core-js/fn/system/index.js delete mode 100644 node_modules/core-js/fn/typed/array-buffer.js delete mode 100644 node_modules/core-js/fn/typed/data-view.js delete mode 100644 node_modules/core-js/fn/typed/float32-array.js delete mode 100644 node_modules/core-js/fn/typed/float64-array.js delete mode 100644 node_modules/core-js/fn/typed/index.js delete mode 100644 node_modules/core-js/fn/typed/int16-array.js delete mode 100644 node_modules/core-js/fn/typed/int32-array.js delete mode 100644 node_modules/core-js/fn/typed/int8-array.js delete mode 100644 node_modules/core-js/fn/typed/uint16-array.js delete mode 100644 node_modules/core-js/fn/typed/uint32-array.js delete mode 100644 node_modules/core-js/fn/typed/uint8-array.js delete mode 100644 node_modules/core-js/fn/typed/uint8-clamped-array.js delete mode 100644 node_modules/core-js/fn/weak-map.js delete mode 100644 node_modules/core-js/fn/weak-map/from.js delete mode 100644 node_modules/core-js/fn/weak-map/index.js delete mode 100644 node_modules/core-js/fn/weak-map/of.js delete mode 100644 node_modules/core-js/fn/weak-set.js delete mode 100644 node_modules/core-js/fn/weak-set/from.js delete mode 100644 node_modules/core-js/fn/weak-set/index.js delete mode 100644 node_modules/core-js/fn/weak-set/of.js delete mode 100644 node_modules/core-js/index.js delete mode 100644 node_modules/core-js/library/core/_.js delete mode 100644 node_modules/core-js/library/core/delay.js delete mode 100644 node_modules/core-js/library/core/dict.js delete mode 100644 node_modules/core-js/library/core/function.js delete mode 100644 node_modules/core-js/library/core/index.js delete mode 100644 node_modules/core-js/library/core/number.js delete mode 100644 node_modules/core-js/library/core/object.js delete mode 100644 node_modules/core-js/library/core/regexp.js delete mode 100644 node_modules/core-js/library/core/string.js delete mode 100644 node_modules/core-js/library/es5/index.js delete mode 100644 node_modules/core-js/library/es6/array.js delete mode 100644 node_modules/core-js/library/es6/date.js delete mode 100644 node_modules/core-js/library/es6/function.js delete mode 100644 node_modules/core-js/library/es6/index.js delete mode 100644 node_modules/core-js/library/es6/map.js delete mode 100644 node_modules/core-js/library/es6/math.js delete mode 100644 node_modules/core-js/library/es6/number.js delete mode 100644 node_modules/core-js/library/es6/object.js delete mode 100644 node_modules/core-js/library/es6/parse-float.js delete mode 100644 node_modules/core-js/library/es6/parse-int.js delete mode 100644 node_modules/core-js/library/es6/promise.js delete mode 100644 node_modules/core-js/library/es6/reflect.js delete mode 100644 node_modules/core-js/library/es6/regexp.js delete mode 100644 node_modules/core-js/library/es6/set.js delete mode 100644 node_modules/core-js/library/es6/string.js delete mode 100644 node_modules/core-js/library/es6/symbol.js delete mode 100644 node_modules/core-js/library/es6/typed.js delete mode 100644 node_modules/core-js/library/es6/weak-map.js delete mode 100644 node_modules/core-js/library/es6/weak-set.js delete mode 100644 node_modules/core-js/library/es7/array.js delete mode 100644 node_modules/core-js/library/es7/asap.js delete mode 100644 node_modules/core-js/library/es7/error.js delete mode 100644 node_modules/core-js/library/es7/global.js delete mode 100644 node_modules/core-js/library/es7/index.js delete mode 100644 node_modules/core-js/library/es7/map.js delete mode 100644 node_modules/core-js/library/es7/math.js delete mode 100644 node_modules/core-js/library/es7/object.js delete mode 100644 node_modules/core-js/library/es7/observable.js delete mode 100644 node_modules/core-js/library/es7/promise.js delete mode 100644 node_modules/core-js/library/es7/reflect.js delete mode 100644 node_modules/core-js/library/es7/set.js delete mode 100644 node_modules/core-js/library/es7/string.js delete mode 100644 node_modules/core-js/library/es7/symbol.js delete mode 100644 node_modules/core-js/library/es7/system.js delete mode 100644 node_modules/core-js/library/es7/weak-map.js delete mode 100644 node_modules/core-js/library/es7/weak-set.js delete mode 100644 node_modules/core-js/library/fn/_.js delete mode 100644 node_modules/core-js/library/fn/array/concat.js delete mode 100644 node_modules/core-js/library/fn/array/copy-within.js delete mode 100644 node_modules/core-js/library/fn/array/entries.js delete mode 100644 node_modules/core-js/library/fn/array/every.js delete mode 100644 node_modules/core-js/library/fn/array/fill.js delete mode 100644 node_modules/core-js/library/fn/array/filter.js delete mode 100644 node_modules/core-js/library/fn/array/find-index.js delete mode 100644 node_modules/core-js/library/fn/array/find.js delete mode 100644 node_modules/core-js/library/fn/array/flat-map.js delete mode 100644 node_modules/core-js/library/fn/array/flatten.js delete mode 100644 node_modules/core-js/library/fn/array/for-each.js delete mode 100644 node_modules/core-js/library/fn/array/from.js delete mode 100644 node_modules/core-js/library/fn/array/includes.js delete mode 100644 node_modules/core-js/library/fn/array/index-of.js delete mode 100644 node_modules/core-js/library/fn/array/index.js delete mode 100644 node_modules/core-js/library/fn/array/is-array.js delete mode 100644 node_modules/core-js/library/fn/array/iterator.js delete mode 100644 node_modules/core-js/library/fn/array/join.js delete mode 100644 node_modules/core-js/library/fn/array/keys.js delete mode 100644 node_modules/core-js/library/fn/array/last-index-of.js delete mode 100644 node_modules/core-js/library/fn/array/map.js delete mode 100644 node_modules/core-js/library/fn/array/of.js delete mode 100644 node_modules/core-js/library/fn/array/pop.js delete mode 100644 node_modules/core-js/library/fn/array/push.js delete mode 100644 node_modules/core-js/library/fn/array/reduce-right.js delete mode 100644 node_modules/core-js/library/fn/array/reduce.js delete mode 100644 node_modules/core-js/library/fn/array/reverse.js delete mode 100644 node_modules/core-js/library/fn/array/shift.js delete mode 100644 node_modules/core-js/library/fn/array/slice.js delete mode 100644 node_modules/core-js/library/fn/array/some.js delete mode 100644 node_modules/core-js/library/fn/array/sort.js delete mode 100644 node_modules/core-js/library/fn/array/splice.js delete mode 100644 node_modules/core-js/library/fn/array/unshift.js delete mode 100644 node_modules/core-js/library/fn/array/values.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/copy-within.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/entries.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/every.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/fill.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/filter.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/find-index.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/find.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/flat-map.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/flatten.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/for-each.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/includes.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/index-of.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/index.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/iterator.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/join.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/keys.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/last-index-of.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/map.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/reduce-right.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/reduce.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/slice.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/some.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/sort.js delete mode 100644 node_modules/core-js/library/fn/array/virtual/values.js delete mode 100644 node_modules/core-js/library/fn/asap.js delete mode 100644 node_modules/core-js/library/fn/clear-immediate.js delete mode 100644 node_modules/core-js/library/fn/date/index.js delete mode 100644 node_modules/core-js/library/fn/date/now.js delete mode 100644 node_modules/core-js/library/fn/date/to-iso-string.js delete mode 100644 node_modules/core-js/library/fn/date/to-json.js delete mode 100644 node_modules/core-js/library/fn/date/to-primitive.js delete mode 100644 node_modules/core-js/library/fn/date/to-string.js delete mode 100644 node_modules/core-js/library/fn/delay.js delete mode 100644 node_modules/core-js/library/fn/dict.js delete mode 100644 node_modules/core-js/library/fn/dom-collections/index.js delete mode 100644 node_modules/core-js/library/fn/dom-collections/iterator.js delete mode 100644 node_modules/core-js/library/fn/error/index.js delete mode 100644 node_modules/core-js/library/fn/error/is-error.js delete mode 100644 node_modules/core-js/library/fn/function/bind.js delete mode 100644 node_modules/core-js/library/fn/function/has-instance.js delete mode 100644 node_modules/core-js/library/fn/function/index.js delete mode 100644 node_modules/core-js/library/fn/function/name.js delete mode 100644 node_modules/core-js/library/fn/function/part.js delete mode 100644 node_modules/core-js/library/fn/function/virtual/bind.js delete mode 100644 node_modules/core-js/library/fn/function/virtual/index.js delete mode 100644 node_modules/core-js/library/fn/function/virtual/part.js delete mode 100644 node_modules/core-js/library/fn/get-iterator-method.js delete mode 100644 node_modules/core-js/library/fn/get-iterator.js delete mode 100644 node_modules/core-js/library/fn/global.js delete mode 100644 node_modules/core-js/library/fn/is-iterable.js delete mode 100644 node_modules/core-js/library/fn/json/index.js delete mode 100644 node_modules/core-js/library/fn/json/stringify.js delete mode 100644 node_modules/core-js/library/fn/map.js delete mode 100644 node_modules/core-js/library/fn/map/from.js delete mode 100644 node_modules/core-js/library/fn/map/index.js delete mode 100644 node_modules/core-js/library/fn/map/of.js delete mode 100644 node_modules/core-js/library/fn/math/acosh.js delete mode 100644 node_modules/core-js/library/fn/math/asinh.js delete mode 100644 node_modules/core-js/library/fn/math/atanh.js delete mode 100644 node_modules/core-js/library/fn/math/cbrt.js delete mode 100644 node_modules/core-js/library/fn/math/clamp.js delete mode 100644 node_modules/core-js/library/fn/math/clz32.js delete mode 100644 node_modules/core-js/library/fn/math/cosh.js delete mode 100644 node_modules/core-js/library/fn/math/deg-per-rad.js delete mode 100644 node_modules/core-js/library/fn/math/degrees.js delete mode 100644 node_modules/core-js/library/fn/math/expm1.js delete mode 100644 node_modules/core-js/library/fn/math/fround.js delete mode 100644 node_modules/core-js/library/fn/math/fscale.js delete mode 100644 node_modules/core-js/library/fn/math/hypot.js delete mode 100644 node_modules/core-js/library/fn/math/iaddh.js delete mode 100644 node_modules/core-js/library/fn/math/imul.js delete mode 100644 node_modules/core-js/library/fn/math/imulh.js delete mode 100644 node_modules/core-js/library/fn/math/index.js delete mode 100644 node_modules/core-js/library/fn/math/isubh.js delete mode 100644 node_modules/core-js/library/fn/math/log10.js delete mode 100644 node_modules/core-js/library/fn/math/log1p.js delete mode 100644 node_modules/core-js/library/fn/math/log2.js delete mode 100644 node_modules/core-js/library/fn/math/rad-per-deg.js delete mode 100644 node_modules/core-js/library/fn/math/radians.js delete mode 100644 node_modules/core-js/library/fn/math/scale.js delete mode 100644 node_modules/core-js/library/fn/math/sign.js delete mode 100644 node_modules/core-js/library/fn/math/signbit.js delete mode 100644 node_modules/core-js/library/fn/math/sinh.js delete mode 100644 node_modules/core-js/library/fn/math/tanh.js delete mode 100644 node_modules/core-js/library/fn/math/trunc.js delete mode 100644 node_modules/core-js/library/fn/math/umulh.js delete mode 100644 node_modules/core-js/library/fn/number/constructor.js delete mode 100644 node_modules/core-js/library/fn/number/epsilon.js delete mode 100644 node_modules/core-js/library/fn/number/index.js delete mode 100644 node_modules/core-js/library/fn/number/is-finite.js delete mode 100644 node_modules/core-js/library/fn/number/is-integer.js delete mode 100644 node_modules/core-js/library/fn/number/is-nan.js delete mode 100644 node_modules/core-js/library/fn/number/is-safe-integer.js delete mode 100644 node_modules/core-js/library/fn/number/iterator.js delete mode 100644 node_modules/core-js/library/fn/number/max-safe-integer.js delete mode 100644 node_modules/core-js/library/fn/number/min-safe-integer.js delete mode 100644 node_modules/core-js/library/fn/number/parse-float.js delete mode 100644 node_modules/core-js/library/fn/number/parse-int.js delete mode 100644 node_modules/core-js/library/fn/number/to-fixed.js delete mode 100644 node_modules/core-js/library/fn/number/to-precision.js delete mode 100644 node_modules/core-js/library/fn/number/virtual/index.js delete mode 100644 node_modules/core-js/library/fn/number/virtual/iterator.js delete mode 100644 node_modules/core-js/library/fn/number/virtual/to-fixed.js delete mode 100644 node_modules/core-js/library/fn/number/virtual/to-precision.js delete mode 100644 node_modules/core-js/library/fn/object/assign.js delete mode 100644 node_modules/core-js/library/fn/object/classof.js delete mode 100644 node_modules/core-js/library/fn/object/create.js delete mode 100644 node_modules/core-js/library/fn/object/define-getter.js delete mode 100644 node_modules/core-js/library/fn/object/define-properties.js delete mode 100644 node_modules/core-js/library/fn/object/define-property.js delete mode 100644 node_modules/core-js/library/fn/object/define-setter.js delete mode 100644 node_modules/core-js/library/fn/object/define.js delete mode 100644 node_modules/core-js/library/fn/object/entries.js delete mode 100644 node_modules/core-js/library/fn/object/freeze.js delete mode 100644 node_modules/core-js/library/fn/object/get-own-property-descriptor.js delete mode 100644 node_modules/core-js/library/fn/object/get-own-property-descriptors.js delete mode 100644 node_modules/core-js/library/fn/object/get-own-property-names.js delete mode 100644 node_modules/core-js/library/fn/object/get-own-property-symbols.js delete mode 100644 node_modules/core-js/library/fn/object/get-prototype-of.js delete mode 100644 node_modules/core-js/library/fn/object/index.js delete mode 100644 node_modules/core-js/library/fn/object/is-extensible.js delete mode 100644 node_modules/core-js/library/fn/object/is-frozen.js delete mode 100644 node_modules/core-js/library/fn/object/is-object.js delete mode 100644 node_modules/core-js/library/fn/object/is-sealed.js delete mode 100644 node_modules/core-js/library/fn/object/is.js delete mode 100644 node_modules/core-js/library/fn/object/keys.js delete mode 100644 node_modules/core-js/library/fn/object/lookup-getter.js delete mode 100644 node_modules/core-js/library/fn/object/lookup-setter.js delete mode 100644 node_modules/core-js/library/fn/object/make.js delete mode 100644 node_modules/core-js/library/fn/object/prevent-extensions.js delete mode 100644 node_modules/core-js/library/fn/object/seal.js delete mode 100644 node_modules/core-js/library/fn/object/set-prototype-of.js delete mode 100644 node_modules/core-js/library/fn/object/values.js delete mode 100644 node_modules/core-js/library/fn/observable.js delete mode 100644 node_modules/core-js/library/fn/parse-float.js delete mode 100644 node_modules/core-js/library/fn/parse-int.js delete mode 100644 node_modules/core-js/library/fn/promise.js delete mode 100644 node_modules/core-js/library/fn/promise/finally.js delete mode 100644 node_modules/core-js/library/fn/promise/index.js delete mode 100644 node_modules/core-js/library/fn/promise/try.js delete mode 100644 node_modules/core-js/library/fn/reflect/apply.js delete mode 100644 node_modules/core-js/library/fn/reflect/construct.js delete mode 100644 node_modules/core-js/library/fn/reflect/define-metadata.js delete mode 100644 node_modules/core-js/library/fn/reflect/define-property.js delete mode 100644 node_modules/core-js/library/fn/reflect/delete-metadata.js delete mode 100644 node_modules/core-js/library/fn/reflect/delete-property.js delete mode 100644 node_modules/core-js/library/fn/reflect/enumerate.js delete mode 100644 node_modules/core-js/library/fn/reflect/get-metadata-keys.js delete mode 100644 node_modules/core-js/library/fn/reflect/get-metadata.js delete mode 100644 node_modules/core-js/library/fn/reflect/get-own-metadata-keys.js delete mode 100644 node_modules/core-js/library/fn/reflect/get-own-metadata.js delete mode 100644 node_modules/core-js/library/fn/reflect/get-own-property-descriptor.js delete mode 100644 node_modules/core-js/library/fn/reflect/get-prototype-of.js delete mode 100644 node_modules/core-js/library/fn/reflect/get.js delete mode 100644 node_modules/core-js/library/fn/reflect/has-metadata.js delete mode 100644 node_modules/core-js/library/fn/reflect/has-own-metadata.js delete mode 100644 node_modules/core-js/library/fn/reflect/has.js delete mode 100644 node_modules/core-js/library/fn/reflect/index.js delete mode 100644 node_modules/core-js/library/fn/reflect/is-extensible.js delete mode 100644 node_modules/core-js/library/fn/reflect/metadata.js delete mode 100644 node_modules/core-js/library/fn/reflect/own-keys.js delete mode 100644 node_modules/core-js/library/fn/reflect/prevent-extensions.js delete mode 100644 node_modules/core-js/library/fn/reflect/set-prototype-of.js delete mode 100644 node_modules/core-js/library/fn/reflect/set.js delete mode 100644 node_modules/core-js/library/fn/regexp/constructor.js delete mode 100644 node_modules/core-js/library/fn/regexp/escape.js delete mode 100644 node_modules/core-js/library/fn/regexp/flags.js delete mode 100644 node_modules/core-js/library/fn/regexp/index.js delete mode 100644 node_modules/core-js/library/fn/regexp/match.js delete mode 100644 node_modules/core-js/library/fn/regexp/replace.js delete mode 100644 node_modules/core-js/library/fn/regexp/search.js delete mode 100644 node_modules/core-js/library/fn/regexp/split.js delete mode 100644 node_modules/core-js/library/fn/regexp/to-string.js delete mode 100644 node_modules/core-js/library/fn/set-immediate.js delete mode 100644 node_modules/core-js/library/fn/set-interval.js delete mode 100644 node_modules/core-js/library/fn/set-timeout.js delete mode 100644 node_modules/core-js/library/fn/set.js delete mode 100644 node_modules/core-js/library/fn/set/from.js delete mode 100644 node_modules/core-js/library/fn/set/index.js delete mode 100644 node_modules/core-js/library/fn/set/of.js delete mode 100644 node_modules/core-js/library/fn/string/anchor.js delete mode 100644 node_modules/core-js/library/fn/string/at.js delete mode 100644 node_modules/core-js/library/fn/string/big.js delete mode 100644 node_modules/core-js/library/fn/string/blink.js delete mode 100644 node_modules/core-js/library/fn/string/bold.js delete mode 100644 node_modules/core-js/library/fn/string/code-point-at.js delete mode 100644 node_modules/core-js/library/fn/string/ends-with.js delete mode 100644 node_modules/core-js/library/fn/string/escape-html.js delete mode 100644 node_modules/core-js/library/fn/string/fixed.js delete mode 100644 node_modules/core-js/library/fn/string/fontcolor.js delete mode 100644 node_modules/core-js/library/fn/string/fontsize.js delete mode 100644 node_modules/core-js/library/fn/string/from-code-point.js delete mode 100644 node_modules/core-js/library/fn/string/includes.js delete mode 100644 node_modules/core-js/library/fn/string/index.js delete mode 100644 node_modules/core-js/library/fn/string/italics.js delete mode 100644 node_modules/core-js/library/fn/string/iterator.js delete mode 100644 node_modules/core-js/library/fn/string/link.js delete mode 100644 node_modules/core-js/library/fn/string/match-all.js delete mode 100644 node_modules/core-js/library/fn/string/pad-end.js delete mode 100644 node_modules/core-js/library/fn/string/pad-start.js delete mode 100644 node_modules/core-js/library/fn/string/raw.js delete mode 100644 node_modules/core-js/library/fn/string/repeat.js delete mode 100644 node_modules/core-js/library/fn/string/small.js delete mode 100644 node_modules/core-js/library/fn/string/starts-with.js delete mode 100644 node_modules/core-js/library/fn/string/strike.js delete mode 100644 node_modules/core-js/library/fn/string/sub.js delete mode 100644 node_modules/core-js/library/fn/string/sup.js delete mode 100644 node_modules/core-js/library/fn/string/trim-end.js delete mode 100644 node_modules/core-js/library/fn/string/trim-left.js delete mode 100644 node_modules/core-js/library/fn/string/trim-right.js delete mode 100644 node_modules/core-js/library/fn/string/trim-start.js delete mode 100644 node_modules/core-js/library/fn/string/trim.js delete mode 100644 node_modules/core-js/library/fn/string/unescape-html.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/anchor.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/at.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/big.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/blink.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/bold.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/code-point-at.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/ends-with.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/escape-html.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/fixed.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/fontcolor.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/fontsize.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/includes.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/index.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/italics.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/iterator.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/link.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/match-all.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/pad-end.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/pad-start.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/repeat.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/small.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/starts-with.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/strike.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/sub.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/sup.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/trim-end.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/trim-left.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/trim-right.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/trim-start.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/trim.js delete mode 100644 node_modules/core-js/library/fn/string/virtual/unescape-html.js delete mode 100644 node_modules/core-js/library/fn/symbol/async-iterator.js delete mode 100644 node_modules/core-js/library/fn/symbol/for.js delete mode 100644 node_modules/core-js/library/fn/symbol/has-instance.js delete mode 100644 node_modules/core-js/library/fn/symbol/index.js delete mode 100644 node_modules/core-js/library/fn/symbol/is-concat-spreadable.js delete mode 100644 node_modules/core-js/library/fn/symbol/iterator.js delete mode 100644 node_modules/core-js/library/fn/symbol/key-for.js delete mode 100644 node_modules/core-js/library/fn/symbol/match.js delete mode 100644 node_modules/core-js/library/fn/symbol/observable.js delete mode 100644 node_modules/core-js/library/fn/symbol/replace.js delete mode 100644 node_modules/core-js/library/fn/symbol/search.js delete mode 100644 node_modules/core-js/library/fn/symbol/species.js delete mode 100644 node_modules/core-js/library/fn/symbol/split.js delete mode 100644 node_modules/core-js/library/fn/symbol/to-primitive.js delete mode 100644 node_modules/core-js/library/fn/symbol/to-string-tag.js delete mode 100644 node_modules/core-js/library/fn/symbol/unscopables.js delete mode 100644 node_modules/core-js/library/fn/system/global.js delete mode 100644 node_modules/core-js/library/fn/system/index.js delete mode 100644 node_modules/core-js/library/fn/typed/array-buffer.js delete mode 100644 node_modules/core-js/library/fn/typed/data-view.js delete mode 100644 node_modules/core-js/library/fn/typed/float32-array.js delete mode 100644 node_modules/core-js/library/fn/typed/float64-array.js delete mode 100644 node_modules/core-js/library/fn/typed/index.js delete mode 100644 node_modules/core-js/library/fn/typed/int16-array.js delete mode 100644 node_modules/core-js/library/fn/typed/int32-array.js delete mode 100644 node_modules/core-js/library/fn/typed/int8-array.js delete mode 100644 node_modules/core-js/library/fn/typed/uint16-array.js delete mode 100644 node_modules/core-js/library/fn/typed/uint32-array.js delete mode 100644 node_modules/core-js/library/fn/typed/uint8-array.js delete mode 100644 node_modules/core-js/library/fn/typed/uint8-clamped-array.js delete mode 100644 node_modules/core-js/library/fn/weak-map.js delete mode 100644 node_modules/core-js/library/fn/weak-map/from.js delete mode 100644 node_modules/core-js/library/fn/weak-map/index.js delete mode 100644 node_modules/core-js/library/fn/weak-map/of.js delete mode 100644 node_modules/core-js/library/fn/weak-set.js delete mode 100644 node_modules/core-js/library/fn/weak-set/from.js delete mode 100644 node_modules/core-js/library/fn/weak-set/index.js delete mode 100644 node_modules/core-js/library/fn/weak-set/of.js delete mode 100644 node_modules/core-js/library/index.js delete mode 100644 node_modules/core-js/library/modules/_a-function.js delete mode 100644 node_modules/core-js/library/modules/_a-number-value.js delete mode 100644 node_modules/core-js/library/modules/_add-to-unscopables.js delete mode 100644 node_modules/core-js/library/modules/_an-instance.js delete mode 100644 node_modules/core-js/library/modules/_an-object.js delete mode 100644 node_modules/core-js/library/modules/_array-copy-within.js delete mode 100644 node_modules/core-js/library/modules/_array-fill.js delete mode 100644 node_modules/core-js/library/modules/_array-from-iterable.js delete mode 100644 node_modules/core-js/library/modules/_array-includes.js delete mode 100644 node_modules/core-js/library/modules/_array-methods.js delete mode 100644 node_modules/core-js/library/modules/_array-reduce.js delete mode 100644 node_modules/core-js/library/modules/_array-species-constructor.js delete mode 100644 node_modules/core-js/library/modules/_array-species-create.js delete mode 100644 node_modules/core-js/library/modules/_bind.js delete mode 100644 node_modules/core-js/library/modules/_classof.js delete mode 100644 node_modules/core-js/library/modules/_cof.js delete mode 100644 node_modules/core-js/library/modules/_collection-strong.js delete mode 100644 node_modules/core-js/library/modules/_collection-to-json.js delete mode 100644 node_modules/core-js/library/modules/_collection-weak.js delete mode 100644 node_modules/core-js/library/modules/_collection.js delete mode 100644 node_modules/core-js/library/modules/_core.js delete mode 100644 node_modules/core-js/library/modules/_create-property.js delete mode 100644 node_modules/core-js/library/modules/_ctx.js delete mode 100644 node_modules/core-js/library/modules/_date-to-iso-string.js delete mode 100644 node_modules/core-js/library/modules/_date-to-primitive.js delete mode 100644 node_modules/core-js/library/modules/_defined.js delete mode 100644 node_modules/core-js/library/modules/_descriptors.js delete mode 100644 node_modules/core-js/library/modules/_dom-create.js delete mode 100644 node_modules/core-js/library/modules/_entry-virtual.js delete mode 100644 node_modules/core-js/library/modules/_enum-bug-keys.js delete mode 100644 node_modules/core-js/library/modules/_enum-keys.js delete mode 100644 node_modules/core-js/library/modules/_export.js delete mode 100644 node_modules/core-js/library/modules/_fails-is-regexp.js delete mode 100644 node_modules/core-js/library/modules/_fails.js delete mode 100644 node_modules/core-js/library/modules/_fix-re-wks.js delete mode 100644 node_modules/core-js/library/modules/_flags.js delete mode 100644 node_modules/core-js/library/modules/_flatten-into-array.js delete mode 100644 node_modules/core-js/library/modules/_for-of.js delete mode 100644 node_modules/core-js/library/modules/_global.js delete mode 100644 node_modules/core-js/library/modules/_has.js delete mode 100644 node_modules/core-js/library/modules/_hide.js delete mode 100644 node_modules/core-js/library/modules/_html.js delete mode 100644 node_modules/core-js/library/modules/_ie8-dom-define.js delete mode 100644 node_modules/core-js/library/modules/_inherit-if-required.js delete mode 100644 node_modules/core-js/library/modules/_invoke.js delete mode 100644 node_modules/core-js/library/modules/_iobject.js delete mode 100644 node_modules/core-js/library/modules/_is-array-iter.js delete mode 100644 node_modules/core-js/library/modules/_is-array.js delete mode 100644 node_modules/core-js/library/modules/_is-integer.js delete mode 100644 node_modules/core-js/library/modules/_is-object.js delete mode 100644 node_modules/core-js/library/modules/_is-regexp.js delete mode 100644 node_modules/core-js/library/modules/_iter-call.js delete mode 100644 node_modules/core-js/library/modules/_iter-create.js delete mode 100644 node_modules/core-js/library/modules/_iter-define.js delete mode 100644 node_modules/core-js/library/modules/_iter-detect.js delete mode 100644 node_modules/core-js/library/modules/_iter-step.js delete mode 100644 node_modules/core-js/library/modules/_iterators.js delete mode 100644 node_modules/core-js/library/modules/_keyof.js delete mode 100644 node_modules/core-js/library/modules/_library.js delete mode 100644 node_modules/core-js/library/modules/_math-expm1.js delete mode 100644 node_modules/core-js/library/modules/_math-fround.js delete mode 100644 node_modules/core-js/library/modules/_math-log1p.js delete mode 100644 node_modules/core-js/library/modules/_math-scale.js delete mode 100644 node_modules/core-js/library/modules/_math-sign.js delete mode 100644 node_modules/core-js/library/modules/_meta.js delete mode 100644 node_modules/core-js/library/modules/_metadata.js delete mode 100644 node_modules/core-js/library/modules/_microtask.js delete mode 100644 node_modules/core-js/library/modules/_new-promise-capability.js delete mode 100644 node_modules/core-js/library/modules/_object-assign.js delete mode 100644 node_modules/core-js/library/modules/_object-create.js delete mode 100644 node_modules/core-js/library/modules/_object-define.js delete mode 100644 node_modules/core-js/library/modules/_object-dp.js delete mode 100644 node_modules/core-js/library/modules/_object-dps.js delete mode 100644 node_modules/core-js/library/modules/_object-forced-pam.js delete mode 100644 node_modules/core-js/library/modules/_object-gopd.js delete mode 100644 node_modules/core-js/library/modules/_object-gopn-ext.js delete mode 100644 node_modules/core-js/library/modules/_object-gopn.js delete mode 100644 node_modules/core-js/library/modules/_object-gops.js delete mode 100644 node_modules/core-js/library/modules/_object-gpo.js delete mode 100644 node_modules/core-js/library/modules/_object-keys-internal.js delete mode 100644 node_modules/core-js/library/modules/_object-keys.js delete mode 100644 node_modules/core-js/library/modules/_object-pie.js delete mode 100644 node_modules/core-js/library/modules/_object-sap.js delete mode 100644 node_modules/core-js/library/modules/_object-to-array.js delete mode 100644 node_modules/core-js/library/modules/_own-keys.js delete mode 100644 node_modules/core-js/library/modules/_parse-float.js delete mode 100644 node_modules/core-js/library/modules/_parse-int.js delete mode 100644 node_modules/core-js/library/modules/_partial.js delete mode 100644 node_modules/core-js/library/modules/_path.js delete mode 100644 node_modules/core-js/library/modules/_perform.js delete mode 100644 node_modules/core-js/library/modules/_promise-resolve.js delete mode 100644 node_modules/core-js/library/modules/_property-desc.js delete mode 100644 node_modules/core-js/library/modules/_redefine-all.js delete mode 100644 node_modules/core-js/library/modules/_redefine.js delete mode 100644 node_modules/core-js/library/modules/_replacer.js delete mode 100644 node_modules/core-js/library/modules/_same-value.js delete mode 100644 node_modules/core-js/library/modules/_set-collection-from.js delete mode 100644 node_modules/core-js/library/modules/_set-collection-of.js delete mode 100644 node_modules/core-js/library/modules/_set-proto.js delete mode 100644 node_modules/core-js/library/modules/_set-species.js delete mode 100644 node_modules/core-js/library/modules/_set-to-string-tag.js delete mode 100644 node_modules/core-js/library/modules/_shared-key.js delete mode 100644 node_modules/core-js/library/modules/_shared.js delete mode 100644 node_modules/core-js/library/modules/_species-constructor.js delete mode 100644 node_modules/core-js/library/modules/_strict-method.js delete mode 100644 node_modules/core-js/library/modules/_string-at.js delete mode 100644 node_modules/core-js/library/modules/_string-context.js delete mode 100644 node_modules/core-js/library/modules/_string-html.js delete mode 100644 node_modules/core-js/library/modules/_string-pad.js delete mode 100644 node_modules/core-js/library/modules/_string-repeat.js delete mode 100644 node_modules/core-js/library/modules/_string-trim.js delete mode 100644 node_modules/core-js/library/modules/_string-ws.js delete mode 100644 node_modules/core-js/library/modules/_task.js delete mode 100644 node_modules/core-js/library/modules/_to-absolute-index.js delete mode 100644 node_modules/core-js/library/modules/_to-index.js delete mode 100644 node_modules/core-js/library/modules/_to-integer.js delete mode 100644 node_modules/core-js/library/modules/_to-iobject.js delete mode 100644 node_modules/core-js/library/modules/_to-length.js delete mode 100644 node_modules/core-js/library/modules/_to-object.js delete mode 100644 node_modules/core-js/library/modules/_to-primitive.js delete mode 100644 node_modules/core-js/library/modules/_typed-array.js delete mode 100644 node_modules/core-js/library/modules/_typed-buffer.js delete mode 100644 node_modules/core-js/library/modules/_typed.js delete mode 100644 node_modules/core-js/library/modules/_uid.js delete mode 100644 node_modules/core-js/library/modules/_user-agent.js delete mode 100644 node_modules/core-js/library/modules/_validate-collection.js delete mode 100644 node_modules/core-js/library/modules/_wks-define.js delete mode 100644 node_modules/core-js/library/modules/_wks-ext.js delete mode 100644 node_modules/core-js/library/modules/_wks.js delete mode 100644 node_modules/core-js/library/modules/core.delay.js delete mode 100644 node_modules/core-js/library/modules/core.dict.js delete mode 100644 node_modules/core-js/library/modules/core.function.part.js delete mode 100644 node_modules/core-js/library/modules/core.get-iterator-method.js delete mode 100644 node_modules/core-js/library/modules/core.get-iterator.js delete mode 100644 node_modules/core-js/library/modules/core.is-iterable.js delete mode 100644 node_modules/core-js/library/modules/core.number.iterator.js delete mode 100644 node_modules/core-js/library/modules/core.object.classof.js delete mode 100644 node_modules/core-js/library/modules/core.object.define.js delete mode 100644 node_modules/core-js/library/modules/core.object.is-object.js delete mode 100644 node_modules/core-js/library/modules/core.object.make.js delete mode 100644 node_modules/core-js/library/modules/core.regexp.escape.js delete mode 100644 node_modules/core-js/library/modules/core.string.escape-html.js delete mode 100644 node_modules/core-js/library/modules/core.string.unescape-html.js delete mode 100644 node_modules/core-js/library/modules/es5.js delete mode 100644 node_modules/core-js/library/modules/es6.array.copy-within.js delete mode 100644 node_modules/core-js/library/modules/es6.array.every.js delete mode 100644 node_modules/core-js/library/modules/es6.array.fill.js delete mode 100644 node_modules/core-js/library/modules/es6.array.filter.js delete mode 100644 node_modules/core-js/library/modules/es6.array.find-index.js delete mode 100644 node_modules/core-js/library/modules/es6.array.find.js delete mode 100644 node_modules/core-js/library/modules/es6.array.for-each.js delete mode 100644 node_modules/core-js/library/modules/es6.array.from.js delete mode 100644 node_modules/core-js/library/modules/es6.array.index-of.js delete mode 100644 node_modules/core-js/library/modules/es6.array.is-array.js delete mode 100644 node_modules/core-js/library/modules/es6.array.iterator.js delete mode 100644 node_modules/core-js/library/modules/es6.array.join.js delete mode 100644 node_modules/core-js/library/modules/es6.array.last-index-of.js delete mode 100644 node_modules/core-js/library/modules/es6.array.map.js delete mode 100644 node_modules/core-js/library/modules/es6.array.of.js delete mode 100644 node_modules/core-js/library/modules/es6.array.reduce-right.js delete mode 100644 node_modules/core-js/library/modules/es6.array.reduce.js delete mode 100644 node_modules/core-js/library/modules/es6.array.slice.js delete mode 100644 node_modules/core-js/library/modules/es6.array.some.js delete mode 100644 node_modules/core-js/library/modules/es6.array.sort.js delete mode 100644 node_modules/core-js/library/modules/es6.array.species.js delete mode 100644 node_modules/core-js/library/modules/es6.date.now.js delete mode 100644 node_modules/core-js/library/modules/es6.date.to-iso-string.js delete mode 100644 node_modules/core-js/library/modules/es6.date.to-json.js delete mode 100644 node_modules/core-js/library/modules/es6.date.to-primitive.js delete mode 100644 node_modules/core-js/library/modules/es6.date.to-string.js delete mode 100644 node_modules/core-js/library/modules/es6.function.bind.js delete mode 100644 node_modules/core-js/library/modules/es6.function.has-instance.js delete mode 100644 node_modules/core-js/library/modules/es6.function.name.js delete mode 100644 node_modules/core-js/library/modules/es6.map.js delete mode 100644 node_modules/core-js/library/modules/es6.math.acosh.js delete mode 100644 node_modules/core-js/library/modules/es6.math.asinh.js delete mode 100644 node_modules/core-js/library/modules/es6.math.atanh.js delete mode 100644 node_modules/core-js/library/modules/es6.math.cbrt.js delete mode 100644 node_modules/core-js/library/modules/es6.math.clz32.js delete mode 100644 node_modules/core-js/library/modules/es6.math.cosh.js delete mode 100644 node_modules/core-js/library/modules/es6.math.expm1.js delete mode 100644 node_modules/core-js/library/modules/es6.math.fround.js delete mode 100644 node_modules/core-js/library/modules/es6.math.hypot.js delete mode 100644 node_modules/core-js/library/modules/es6.math.imul.js delete mode 100644 node_modules/core-js/library/modules/es6.math.log10.js delete mode 100644 node_modules/core-js/library/modules/es6.math.log1p.js delete mode 100644 node_modules/core-js/library/modules/es6.math.log2.js delete mode 100644 node_modules/core-js/library/modules/es6.math.sign.js delete mode 100644 node_modules/core-js/library/modules/es6.math.sinh.js delete mode 100644 node_modules/core-js/library/modules/es6.math.tanh.js delete mode 100644 node_modules/core-js/library/modules/es6.math.trunc.js delete mode 100644 node_modules/core-js/library/modules/es6.number.constructor.js delete mode 100644 node_modules/core-js/library/modules/es6.number.epsilon.js delete mode 100644 node_modules/core-js/library/modules/es6.number.is-finite.js delete mode 100644 node_modules/core-js/library/modules/es6.number.is-integer.js delete mode 100644 node_modules/core-js/library/modules/es6.number.is-nan.js delete mode 100644 node_modules/core-js/library/modules/es6.number.is-safe-integer.js delete mode 100644 node_modules/core-js/library/modules/es6.number.max-safe-integer.js delete mode 100644 node_modules/core-js/library/modules/es6.number.min-safe-integer.js delete mode 100644 node_modules/core-js/library/modules/es6.number.parse-float.js delete mode 100644 node_modules/core-js/library/modules/es6.number.parse-int.js delete mode 100644 node_modules/core-js/library/modules/es6.number.to-fixed.js delete mode 100644 node_modules/core-js/library/modules/es6.number.to-precision.js delete mode 100644 node_modules/core-js/library/modules/es6.object.assign.js delete mode 100644 node_modules/core-js/library/modules/es6.object.create.js delete mode 100644 node_modules/core-js/library/modules/es6.object.define-properties.js delete mode 100644 node_modules/core-js/library/modules/es6.object.define-property.js delete mode 100644 node_modules/core-js/library/modules/es6.object.freeze.js delete mode 100644 node_modules/core-js/library/modules/es6.object.get-own-property-descriptor.js delete mode 100644 node_modules/core-js/library/modules/es6.object.get-own-property-names.js delete mode 100644 node_modules/core-js/library/modules/es6.object.get-prototype-of.js delete mode 100644 node_modules/core-js/library/modules/es6.object.is-extensible.js delete mode 100644 node_modules/core-js/library/modules/es6.object.is-frozen.js delete mode 100644 node_modules/core-js/library/modules/es6.object.is-sealed.js delete mode 100644 node_modules/core-js/library/modules/es6.object.is.js delete mode 100644 node_modules/core-js/library/modules/es6.object.keys.js delete mode 100644 node_modules/core-js/library/modules/es6.object.prevent-extensions.js delete mode 100644 node_modules/core-js/library/modules/es6.object.seal.js delete mode 100644 node_modules/core-js/library/modules/es6.object.set-prototype-of.js delete mode 100644 node_modules/core-js/library/modules/es6.object.to-string.js delete mode 100644 node_modules/core-js/library/modules/es6.parse-float.js delete mode 100644 node_modules/core-js/library/modules/es6.parse-int.js delete mode 100644 node_modules/core-js/library/modules/es6.promise.js delete mode 100644 node_modules/core-js/library/modules/es6.reflect.apply.js delete mode 100644 node_modules/core-js/library/modules/es6.reflect.construct.js delete mode 100644 node_modules/core-js/library/modules/es6.reflect.define-property.js delete mode 100644 node_modules/core-js/library/modules/es6.reflect.delete-property.js delete mode 100644 node_modules/core-js/library/modules/es6.reflect.enumerate.js delete mode 100644 node_modules/core-js/library/modules/es6.reflect.get-own-property-descriptor.js delete mode 100644 node_modules/core-js/library/modules/es6.reflect.get-prototype-of.js delete mode 100644 node_modules/core-js/library/modules/es6.reflect.get.js delete mode 100644 node_modules/core-js/library/modules/es6.reflect.has.js delete mode 100644 node_modules/core-js/library/modules/es6.reflect.is-extensible.js delete mode 100644 node_modules/core-js/library/modules/es6.reflect.own-keys.js delete mode 100644 node_modules/core-js/library/modules/es6.reflect.prevent-extensions.js delete mode 100644 node_modules/core-js/library/modules/es6.reflect.set-prototype-of.js delete mode 100644 node_modules/core-js/library/modules/es6.reflect.set.js delete mode 100644 node_modules/core-js/library/modules/es6.regexp.constructor.js delete mode 100644 node_modules/core-js/library/modules/es6.regexp.flags.js delete mode 100644 node_modules/core-js/library/modules/es6.regexp.match.js delete mode 100644 node_modules/core-js/library/modules/es6.regexp.replace.js delete mode 100644 node_modules/core-js/library/modules/es6.regexp.search.js delete mode 100644 node_modules/core-js/library/modules/es6.regexp.split.js delete mode 100644 node_modules/core-js/library/modules/es6.regexp.to-string.js delete mode 100644 node_modules/core-js/library/modules/es6.set.js delete mode 100644 node_modules/core-js/library/modules/es6.string.anchor.js delete mode 100644 node_modules/core-js/library/modules/es6.string.big.js delete mode 100644 node_modules/core-js/library/modules/es6.string.blink.js delete mode 100644 node_modules/core-js/library/modules/es6.string.bold.js delete mode 100644 node_modules/core-js/library/modules/es6.string.code-point-at.js delete mode 100644 node_modules/core-js/library/modules/es6.string.ends-with.js delete mode 100644 node_modules/core-js/library/modules/es6.string.fixed.js delete mode 100644 node_modules/core-js/library/modules/es6.string.fontcolor.js delete mode 100644 node_modules/core-js/library/modules/es6.string.fontsize.js delete mode 100644 node_modules/core-js/library/modules/es6.string.from-code-point.js delete mode 100644 node_modules/core-js/library/modules/es6.string.includes.js delete mode 100644 node_modules/core-js/library/modules/es6.string.italics.js delete mode 100644 node_modules/core-js/library/modules/es6.string.iterator.js delete mode 100644 node_modules/core-js/library/modules/es6.string.link.js delete mode 100644 node_modules/core-js/library/modules/es6.string.raw.js delete mode 100644 node_modules/core-js/library/modules/es6.string.repeat.js delete mode 100644 node_modules/core-js/library/modules/es6.string.small.js delete mode 100644 node_modules/core-js/library/modules/es6.string.starts-with.js delete mode 100644 node_modules/core-js/library/modules/es6.string.strike.js delete mode 100644 node_modules/core-js/library/modules/es6.string.sub.js delete mode 100644 node_modules/core-js/library/modules/es6.string.sup.js delete mode 100644 node_modules/core-js/library/modules/es6.string.trim.js delete mode 100644 node_modules/core-js/library/modules/es6.symbol.js delete mode 100644 node_modules/core-js/library/modules/es6.typed.array-buffer.js delete mode 100644 node_modules/core-js/library/modules/es6.typed.data-view.js delete mode 100644 node_modules/core-js/library/modules/es6.typed.float32-array.js delete mode 100644 node_modules/core-js/library/modules/es6.typed.float64-array.js delete mode 100644 node_modules/core-js/library/modules/es6.typed.int16-array.js delete mode 100644 node_modules/core-js/library/modules/es6.typed.int32-array.js delete mode 100644 node_modules/core-js/library/modules/es6.typed.int8-array.js delete mode 100644 node_modules/core-js/library/modules/es6.typed.uint16-array.js delete mode 100644 node_modules/core-js/library/modules/es6.typed.uint32-array.js delete mode 100644 node_modules/core-js/library/modules/es6.typed.uint8-array.js delete mode 100644 node_modules/core-js/library/modules/es6.typed.uint8-clamped-array.js delete mode 100644 node_modules/core-js/library/modules/es6.weak-map.js delete mode 100644 node_modules/core-js/library/modules/es6.weak-set.js delete mode 100644 node_modules/core-js/library/modules/es7.array.flat-map.js delete mode 100644 node_modules/core-js/library/modules/es7.array.flatten.js delete mode 100644 node_modules/core-js/library/modules/es7.array.includes.js delete mode 100644 node_modules/core-js/library/modules/es7.asap.js delete mode 100644 node_modules/core-js/library/modules/es7.error.is-error.js delete mode 100644 node_modules/core-js/library/modules/es7.global.js delete mode 100644 node_modules/core-js/library/modules/es7.map.from.js delete mode 100644 node_modules/core-js/library/modules/es7.map.of.js delete mode 100644 node_modules/core-js/library/modules/es7.map.to-json.js delete mode 100644 node_modules/core-js/library/modules/es7.math.clamp.js delete mode 100644 node_modules/core-js/library/modules/es7.math.deg-per-rad.js delete mode 100644 node_modules/core-js/library/modules/es7.math.degrees.js delete mode 100644 node_modules/core-js/library/modules/es7.math.fscale.js delete mode 100644 node_modules/core-js/library/modules/es7.math.iaddh.js delete mode 100644 node_modules/core-js/library/modules/es7.math.imulh.js delete mode 100644 node_modules/core-js/library/modules/es7.math.isubh.js delete mode 100644 node_modules/core-js/library/modules/es7.math.rad-per-deg.js delete mode 100644 node_modules/core-js/library/modules/es7.math.radians.js delete mode 100644 node_modules/core-js/library/modules/es7.math.scale.js delete mode 100644 node_modules/core-js/library/modules/es7.math.signbit.js delete mode 100644 node_modules/core-js/library/modules/es7.math.umulh.js delete mode 100644 node_modules/core-js/library/modules/es7.object.define-getter.js delete mode 100644 node_modules/core-js/library/modules/es7.object.define-setter.js delete mode 100644 node_modules/core-js/library/modules/es7.object.entries.js delete mode 100644 node_modules/core-js/library/modules/es7.object.get-own-property-descriptors.js delete mode 100644 node_modules/core-js/library/modules/es7.object.lookup-getter.js delete mode 100644 node_modules/core-js/library/modules/es7.object.lookup-setter.js delete mode 100644 node_modules/core-js/library/modules/es7.object.values.js delete mode 100644 node_modules/core-js/library/modules/es7.observable.js delete mode 100644 node_modules/core-js/library/modules/es7.promise.finally.js delete mode 100644 node_modules/core-js/library/modules/es7.promise.try.js delete mode 100644 node_modules/core-js/library/modules/es7.reflect.define-metadata.js delete mode 100644 node_modules/core-js/library/modules/es7.reflect.delete-metadata.js delete mode 100644 node_modules/core-js/library/modules/es7.reflect.get-metadata-keys.js delete mode 100644 node_modules/core-js/library/modules/es7.reflect.get-metadata.js delete mode 100644 node_modules/core-js/library/modules/es7.reflect.get-own-metadata-keys.js delete mode 100644 node_modules/core-js/library/modules/es7.reflect.get-own-metadata.js delete mode 100644 node_modules/core-js/library/modules/es7.reflect.has-metadata.js delete mode 100644 node_modules/core-js/library/modules/es7.reflect.has-own-metadata.js delete mode 100644 node_modules/core-js/library/modules/es7.reflect.metadata.js delete mode 100644 node_modules/core-js/library/modules/es7.set.from.js delete mode 100644 node_modules/core-js/library/modules/es7.set.of.js delete mode 100644 node_modules/core-js/library/modules/es7.set.to-json.js delete mode 100644 node_modules/core-js/library/modules/es7.string.at.js delete mode 100644 node_modules/core-js/library/modules/es7.string.match-all.js delete mode 100644 node_modules/core-js/library/modules/es7.string.pad-end.js delete mode 100644 node_modules/core-js/library/modules/es7.string.pad-start.js delete mode 100644 node_modules/core-js/library/modules/es7.string.trim-left.js delete mode 100644 node_modules/core-js/library/modules/es7.string.trim-right.js delete mode 100644 node_modules/core-js/library/modules/es7.symbol.async-iterator.js delete mode 100644 node_modules/core-js/library/modules/es7.symbol.observable.js delete mode 100644 node_modules/core-js/library/modules/es7.system.global.js delete mode 100644 node_modules/core-js/library/modules/es7.weak-map.from.js delete mode 100644 node_modules/core-js/library/modules/es7.weak-map.of.js delete mode 100644 node_modules/core-js/library/modules/es7.weak-set.from.js delete mode 100644 node_modules/core-js/library/modules/es7.weak-set.of.js delete mode 100644 node_modules/core-js/library/modules/web.dom.iterable.js delete mode 100644 node_modules/core-js/library/modules/web.immediate.js delete mode 100644 node_modules/core-js/library/modules/web.timers.js delete mode 100644 node_modules/core-js/library/shim.js delete mode 100644 node_modules/core-js/library/stage/0.js delete mode 100644 node_modules/core-js/library/stage/1.js delete mode 100644 node_modules/core-js/library/stage/2.js delete mode 100644 node_modules/core-js/library/stage/3.js delete mode 100644 node_modules/core-js/library/stage/4.js delete mode 100644 node_modules/core-js/library/stage/index.js delete mode 100644 node_modules/core-js/library/stage/pre.js delete mode 100644 node_modules/core-js/library/web/dom-collections.js delete mode 100644 node_modules/core-js/library/web/immediate.js delete mode 100644 node_modules/core-js/library/web/index.js delete mode 100644 node_modules/core-js/library/web/timers.js delete mode 100644 node_modules/core-js/modules/_a-function.js delete mode 100644 node_modules/core-js/modules/_a-number-value.js delete mode 100644 node_modules/core-js/modules/_add-to-unscopables.js delete mode 100644 node_modules/core-js/modules/_an-instance.js delete mode 100644 node_modules/core-js/modules/_an-object.js delete mode 100644 node_modules/core-js/modules/_array-copy-within.js delete mode 100644 node_modules/core-js/modules/_array-fill.js delete mode 100644 node_modules/core-js/modules/_array-from-iterable.js delete mode 100644 node_modules/core-js/modules/_array-includes.js delete mode 100644 node_modules/core-js/modules/_array-methods.js delete mode 100644 node_modules/core-js/modules/_array-reduce.js delete mode 100644 node_modules/core-js/modules/_array-species-constructor.js delete mode 100644 node_modules/core-js/modules/_array-species-create.js delete mode 100644 node_modules/core-js/modules/_bind.js delete mode 100644 node_modules/core-js/modules/_classof.js delete mode 100644 node_modules/core-js/modules/_cof.js delete mode 100644 node_modules/core-js/modules/_collection-strong.js delete mode 100644 node_modules/core-js/modules/_collection-to-json.js delete mode 100644 node_modules/core-js/modules/_collection-weak.js delete mode 100644 node_modules/core-js/modules/_collection.js delete mode 100644 node_modules/core-js/modules/_core.js delete mode 100644 node_modules/core-js/modules/_create-property.js delete mode 100644 node_modules/core-js/modules/_ctx.js delete mode 100644 node_modules/core-js/modules/_date-to-iso-string.js delete mode 100644 node_modules/core-js/modules/_date-to-primitive.js delete mode 100644 node_modules/core-js/modules/_defined.js delete mode 100644 node_modules/core-js/modules/_descriptors.js delete mode 100644 node_modules/core-js/modules/_dom-create.js delete mode 100644 node_modules/core-js/modules/_entry-virtual.js delete mode 100644 node_modules/core-js/modules/_enum-bug-keys.js delete mode 100644 node_modules/core-js/modules/_enum-keys.js delete mode 100644 node_modules/core-js/modules/_export.js delete mode 100644 node_modules/core-js/modules/_fails-is-regexp.js delete mode 100644 node_modules/core-js/modules/_fails.js delete mode 100644 node_modules/core-js/modules/_fix-re-wks.js delete mode 100644 node_modules/core-js/modules/_flags.js delete mode 100644 node_modules/core-js/modules/_flatten-into-array.js delete mode 100644 node_modules/core-js/modules/_for-of.js delete mode 100644 node_modules/core-js/modules/_global.js delete mode 100644 node_modules/core-js/modules/_has.js delete mode 100644 node_modules/core-js/modules/_hide.js delete mode 100644 node_modules/core-js/modules/_html.js delete mode 100644 node_modules/core-js/modules/_ie8-dom-define.js delete mode 100644 node_modules/core-js/modules/_inherit-if-required.js delete mode 100644 node_modules/core-js/modules/_invoke.js delete mode 100644 node_modules/core-js/modules/_iobject.js delete mode 100644 node_modules/core-js/modules/_is-array-iter.js delete mode 100644 node_modules/core-js/modules/_is-array.js delete mode 100644 node_modules/core-js/modules/_is-integer.js delete mode 100644 node_modules/core-js/modules/_is-object.js delete mode 100644 node_modules/core-js/modules/_is-regexp.js delete mode 100644 node_modules/core-js/modules/_iter-call.js delete mode 100644 node_modules/core-js/modules/_iter-create.js delete mode 100644 node_modules/core-js/modules/_iter-define.js delete mode 100644 node_modules/core-js/modules/_iter-detect.js delete mode 100644 node_modules/core-js/modules/_iter-step.js delete mode 100644 node_modules/core-js/modules/_iterators.js delete mode 100644 node_modules/core-js/modules/_keyof.js delete mode 100644 node_modules/core-js/modules/_library.js delete mode 100644 node_modules/core-js/modules/_math-expm1.js delete mode 100644 node_modules/core-js/modules/_math-fround.js delete mode 100644 node_modules/core-js/modules/_math-log1p.js delete mode 100644 node_modules/core-js/modules/_math-scale.js delete mode 100644 node_modules/core-js/modules/_math-sign.js delete mode 100644 node_modules/core-js/modules/_meta.js delete mode 100644 node_modules/core-js/modules/_metadata.js delete mode 100644 node_modules/core-js/modules/_microtask.js delete mode 100644 node_modules/core-js/modules/_new-promise-capability.js delete mode 100644 node_modules/core-js/modules/_object-assign.js delete mode 100644 node_modules/core-js/modules/_object-create.js delete mode 100644 node_modules/core-js/modules/_object-define.js delete mode 100644 node_modules/core-js/modules/_object-dp.js delete mode 100644 node_modules/core-js/modules/_object-dps.js delete mode 100644 node_modules/core-js/modules/_object-forced-pam.js delete mode 100644 node_modules/core-js/modules/_object-gopd.js delete mode 100644 node_modules/core-js/modules/_object-gopn-ext.js delete mode 100644 node_modules/core-js/modules/_object-gopn.js delete mode 100644 node_modules/core-js/modules/_object-gops.js delete mode 100644 node_modules/core-js/modules/_object-gpo.js delete mode 100644 node_modules/core-js/modules/_object-keys-internal.js delete mode 100644 node_modules/core-js/modules/_object-keys.js delete mode 100644 node_modules/core-js/modules/_object-pie.js delete mode 100644 node_modules/core-js/modules/_object-sap.js delete mode 100644 node_modules/core-js/modules/_object-to-array.js delete mode 100644 node_modules/core-js/modules/_own-keys.js delete mode 100644 node_modules/core-js/modules/_parse-float.js delete mode 100644 node_modules/core-js/modules/_parse-int.js delete mode 100644 node_modules/core-js/modules/_partial.js delete mode 100644 node_modules/core-js/modules/_path.js delete mode 100644 node_modules/core-js/modules/_perform.js delete mode 100644 node_modules/core-js/modules/_promise-resolve.js delete mode 100644 node_modules/core-js/modules/_property-desc.js delete mode 100644 node_modules/core-js/modules/_redefine-all.js delete mode 100644 node_modules/core-js/modules/_redefine.js delete mode 100644 node_modules/core-js/modules/_replacer.js delete mode 100644 node_modules/core-js/modules/_same-value.js delete mode 100644 node_modules/core-js/modules/_set-collection-from.js delete mode 100644 node_modules/core-js/modules/_set-collection-of.js delete mode 100644 node_modules/core-js/modules/_set-proto.js delete mode 100644 node_modules/core-js/modules/_set-species.js delete mode 100644 node_modules/core-js/modules/_set-to-string-tag.js delete mode 100644 node_modules/core-js/modules/_shared-key.js delete mode 100644 node_modules/core-js/modules/_shared.js delete mode 100644 node_modules/core-js/modules/_species-constructor.js delete mode 100644 node_modules/core-js/modules/_strict-method.js delete mode 100644 node_modules/core-js/modules/_string-at.js delete mode 100644 node_modules/core-js/modules/_string-context.js delete mode 100644 node_modules/core-js/modules/_string-html.js delete mode 100644 node_modules/core-js/modules/_string-pad.js delete mode 100644 node_modules/core-js/modules/_string-repeat.js delete mode 100644 node_modules/core-js/modules/_string-trim.js delete mode 100644 node_modules/core-js/modules/_string-ws.js delete mode 100644 node_modules/core-js/modules/_task.js delete mode 100644 node_modules/core-js/modules/_to-absolute-index.js delete mode 100644 node_modules/core-js/modules/_to-index.js delete mode 100644 node_modules/core-js/modules/_to-integer.js delete mode 100644 node_modules/core-js/modules/_to-iobject.js delete mode 100644 node_modules/core-js/modules/_to-length.js delete mode 100644 node_modules/core-js/modules/_to-object.js delete mode 100644 node_modules/core-js/modules/_to-primitive.js delete mode 100644 node_modules/core-js/modules/_typed-array.js delete mode 100644 node_modules/core-js/modules/_typed-buffer.js delete mode 100644 node_modules/core-js/modules/_typed.js delete mode 100644 node_modules/core-js/modules/_uid.js delete mode 100644 node_modules/core-js/modules/_user-agent.js delete mode 100644 node_modules/core-js/modules/_validate-collection.js delete mode 100644 node_modules/core-js/modules/_wks-define.js delete mode 100644 node_modules/core-js/modules/_wks-ext.js delete mode 100644 node_modules/core-js/modules/_wks.js delete mode 100644 node_modules/core-js/modules/core.delay.js delete mode 100644 node_modules/core-js/modules/core.dict.js delete mode 100644 node_modules/core-js/modules/core.function.part.js delete mode 100644 node_modules/core-js/modules/core.get-iterator-method.js delete mode 100644 node_modules/core-js/modules/core.get-iterator.js delete mode 100644 node_modules/core-js/modules/core.is-iterable.js delete mode 100644 node_modules/core-js/modules/core.number.iterator.js delete mode 100644 node_modules/core-js/modules/core.object.classof.js delete mode 100644 node_modules/core-js/modules/core.object.define.js delete mode 100644 node_modules/core-js/modules/core.object.is-object.js delete mode 100644 node_modules/core-js/modules/core.object.make.js delete mode 100644 node_modules/core-js/modules/core.regexp.escape.js delete mode 100644 node_modules/core-js/modules/core.string.escape-html.js delete mode 100644 node_modules/core-js/modules/core.string.unescape-html.js delete mode 100644 node_modules/core-js/modules/es5.js delete mode 100644 node_modules/core-js/modules/es6.array.copy-within.js delete mode 100644 node_modules/core-js/modules/es6.array.every.js delete mode 100644 node_modules/core-js/modules/es6.array.fill.js delete mode 100644 node_modules/core-js/modules/es6.array.filter.js delete mode 100644 node_modules/core-js/modules/es6.array.find-index.js delete mode 100644 node_modules/core-js/modules/es6.array.find.js delete mode 100644 node_modules/core-js/modules/es6.array.for-each.js delete mode 100644 node_modules/core-js/modules/es6.array.from.js delete mode 100644 node_modules/core-js/modules/es6.array.index-of.js delete mode 100644 node_modules/core-js/modules/es6.array.is-array.js delete mode 100644 node_modules/core-js/modules/es6.array.iterator.js delete mode 100644 node_modules/core-js/modules/es6.array.join.js delete mode 100644 node_modules/core-js/modules/es6.array.last-index-of.js delete mode 100644 node_modules/core-js/modules/es6.array.map.js delete mode 100644 node_modules/core-js/modules/es6.array.of.js delete mode 100644 node_modules/core-js/modules/es6.array.reduce-right.js delete mode 100644 node_modules/core-js/modules/es6.array.reduce.js delete mode 100644 node_modules/core-js/modules/es6.array.slice.js delete mode 100644 node_modules/core-js/modules/es6.array.some.js delete mode 100644 node_modules/core-js/modules/es6.array.sort.js delete mode 100644 node_modules/core-js/modules/es6.array.species.js delete mode 100644 node_modules/core-js/modules/es6.date.now.js delete mode 100644 node_modules/core-js/modules/es6.date.to-iso-string.js delete mode 100644 node_modules/core-js/modules/es6.date.to-json.js delete mode 100644 node_modules/core-js/modules/es6.date.to-primitive.js delete mode 100644 node_modules/core-js/modules/es6.date.to-string.js delete mode 100644 node_modules/core-js/modules/es6.function.bind.js delete mode 100644 node_modules/core-js/modules/es6.function.has-instance.js delete mode 100644 node_modules/core-js/modules/es6.function.name.js delete mode 100644 node_modules/core-js/modules/es6.map.js delete mode 100644 node_modules/core-js/modules/es6.math.acosh.js delete mode 100644 node_modules/core-js/modules/es6.math.asinh.js delete mode 100644 node_modules/core-js/modules/es6.math.atanh.js delete mode 100644 node_modules/core-js/modules/es6.math.cbrt.js delete mode 100644 node_modules/core-js/modules/es6.math.clz32.js delete mode 100644 node_modules/core-js/modules/es6.math.cosh.js delete mode 100644 node_modules/core-js/modules/es6.math.expm1.js delete mode 100644 node_modules/core-js/modules/es6.math.fround.js delete mode 100644 node_modules/core-js/modules/es6.math.hypot.js delete mode 100644 node_modules/core-js/modules/es6.math.imul.js delete mode 100644 node_modules/core-js/modules/es6.math.log10.js delete mode 100644 node_modules/core-js/modules/es6.math.log1p.js delete mode 100644 node_modules/core-js/modules/es6.math.log2.js delete mode 100644 node_modules/core-js/modules/es6.math.sign.js delete mode 100644 node_modules/core-js/modules/es6.math.sinh.js delete mode 100644 node_modules/core-js/modules/es6.math.tanh.js delete mode 100644 node_modules/core-js/modules/es6.math.trunc.js delete mode 100644 node_modules/core-js/modules/es6.number.constructor.js delete mode 100644 node_modules/core-js/modules/es6.number.epsilon.js delete mode 100644 node_modules/core-js/modules/es6.number.is-finite.js delete mode 100644 node_modules/core-js/modules/es6.number.is-integer.js delete mode 100644 node_modules/core-js/modules/es6.number.is-nan.js delete mode 100644 node_modules/core-js/modules/es6.number.is-safe-integer.js delete mode 100644 node_modules/core-js/modules/es6.number.max-safe-integer.js delete mode 100644 node_modules/core-js/modules/es6.number.min-safe-integer.js delete mode 100644 node_modules/core-js/modules/es6.number.parse-float.js delete mode 100644 node_modules/core-js/modules/es6.number.parse-int.js delete mode 100644 node_modules/core-js/modules/es6.number.to-fixed.js delete mode 100644 node_modules/core-js/modules/es6.number.to-precision.js delete mode 100644 node_modules/core-js/modules/es6.object.assign.js delete mode 100644 node_modules/core-js/modules/es6.object.create.js delete mode 100644 node_modules/core-js/modules/es6.object.define-properties.js delete mode 100644 node_modules/core-js/modules/es6.object.define-property.js delete mode 100644 node_modules/core-js/modules/es6.object.freeze.js delete mode 100644 node_modules/core-js/modules/es6.object.get-own-property-descriptor.js delete mode 100644 node_modules/core-js/modules/es6.object.get-own-property-names.js delete mode 100644 node_modules/core-js/modules/es6.object.get-prototype-of.js delete mode 100644 node_modules/core-js/modules/es6.object.is-extensible.js delete mode 100644 node_modules/core-js/modules/es6.object.is-frozen.js delete mode 100644 node_modules/core-js/modules/es6.object.is-sealed.js delete mode 100644 node_modules/core-js/modules/es6.object.is.js delete mode 100644 node_modules/core-js/modules/es6.object.keys.js delete mode 100644 node_modules/core-js/modules/es6.object.prevent-extensions.js delete mode 100644 node_modules/core-js/modules/es6.object.seal.js delete mode 100644 node_modules/core-js/modules/es6.object.set-prototype-of.js delete mode 100644 node_modules/core-js/modules/es6.object.to-string.js delete mode 100644 node_modules/core-js/modules/es6.parse-float.js delete mode 100644 node_modules/core-js/modules/es6.parse-int.js delete mode 100644 node_modules/core-js/modules/es6.promise.js delete mode 100644 node_modules/core-js/modules/es6.reflect.apply.js delete mode 100644 node_modules/core-js/modules/es6.reflect.construct.js delete mode 100644 node_modules/core-js/modules/es6.reflect.define-property.js delete mode 100644 node_modules/core-js/modules/es6.reflect.delete-property.js delete mode 100644 node_modules/core-js/modules/es6.reflect.enumerate.js delete mode 100644 node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js delete mode 100644 node_modules/core-js/modules/es6.reflect.get-prototype-of.js delete mode 100644 node_modules/core-js/modules/es6.reflect.get.js delete mode 100644 node_modules/core-js/modules/es6.reflect.has.js delete mode 100644 node_modules/core-js/modules/es6.reflect.is-extensible.js delete mode 100644 node_modules/core-js/modules/es6.reflect.own-keys.js delete mode 100644 node_modules/core-js/modules/es6.reflect.prevent-extensions.js delete mode 100644 node_modules/core-js/modules/es6.reflect.set-prototype-of.js delete mode 100644 node_modules/core-js/modules/es6.reflect.set.js delete mode 100644 node_modules/core-js/modules/es6.regexp.constructor.js delete mode 100644 node_modules/core-js/modules/es6.regexp.flags.js delete mode 100644 node_modules/core-js/modules/es6.regexp.match.js delete mode 100644 node_modules/core-js/modules/es6.regexp.replace.js delete mode 100644 node_modules/core-js/modules/es6.regexp.search.js delete mode 100644 node_modules/core-js/modules/es6.regexp.split.js delete mode 100644 node_modules/core-js/modules/es6.regexp.to-string.js delete mode 100644 node_modules/core-js/modules/es6.set.js delete mode 100644 node_modules/core-js/modules/es6.string.anchor.js delete mode 100644 node_modules/core-js/modules/es6.string.big.js delete mode 100644 node_modules/core-js/modules/es6.string.blink.js delete mode 100644 node_modules/core-js/modules/es6.string.bold.js delete mode 100644 node_modules/core-js/modules/es6.string.code-point-at.js delete mode 100644 node_modules/core-js/modules/es6.string.ends-with.js delete mode 100644 node_modules/core-js/modules/es6.string.fixed.js delete mode 100644 node_modules/core-js/modules/es6.string.fontcolor.js delete mode 100644 node_modules/core-js/modules/es6.string.fontsize.js delete mode 100644 node_modules/core-js/modules/es6.string.from-code-point.js delete mode 100644 node_modules/core-js/modules/es6.string.includes.js delete mode 100644 node_modules/core-js/modules/es6.string.italics.js delete mode 100644 node_modules/core-js/modules/es6.string.iterator.js delete mode 100644 node_modules/core-js/modules/es6.string.link.js delete mode 100644 node_modules/core-js/modules/es6.string.raw.js delete mode 100644 node_modules/core-js/modules/es6.string.repeat.js delete mode 100644 node_modules/core-js/modules/es6.string.small.js delete mode 100644 node_modules/core-js/modules/es6.string.starts-with.js delete mode 100644 node_modules/core-js/modules/es6.string.strike.js delete mode 100644 node_modules/core-js/modules/es6.string.sub.js delete mode 100644 node_modules/core-js/modules/es6.string.sup.js delete mode 100644 node_modules/core-js/modules/es6.string.trim.js delete mode 100644 node_modules/core-js/modules/es6.symbol.js delete mode 100644 node_modules/core-js/modules/es6.typed.array-buffer.js delete mode 100644 node_modules/core-js/modules/es6.typed.data-view.js delete mode 100644 node_modules/core-js/modules/es6.typed.float32-array.js delete mode 100644 node_modules/core-js/modules/es6.typed.float64-array.js delete mode 100644 node_modules/core-js/modules/es6.typed.int16-array.js delete mode 100644 node_modules/core-js/modules/es6.typed.int32-array.js delete mode 100644 node_modules/core-js/modules/es6.typed.int8-array.js delete mode 100644 node_modules/core-js/modules/es6.typed.uint16-array.js delete mode 100644 node_modules/core-js/modules/es6.typed.uint32-array.js delete mode 100644 node_modules/core-js/modules/es6.typed.uint8-array.js delete mode 100644 node_modules/core-js/modules/es6.typed.uint8-clamped-array.js delete mode 100644 node_modules/core-js/modules/es6.weak-map.js delete mode 100644 node_modules/core-js/modules/es6.weak-set.js delete mode 100644 node_modules/core-js/modules/es7.array.flat-map.js delete mode 100644 node_modules/core-js/modules/es7.array.flatten.js delete mode 100644 node_modules/core-js/modules/es7.array.includes.js delete mode 100644 node_modules/core-js/modules/es7.asap.js delete mode 100644 node_modules/core-js/modules/es7.error.is-error.js delete mode 100644 node_modules/core-js/modules/es7.global.js delete mode 100644 node_modules/core-js/modules/es7.map.from.js delete mode 100644 node_modules/core-js/modules/es7.map.of.js delete mode 100644 node_modules/core-js/modules/es7.map.to-json.js delete mode 100644 node_modules/core-js/modules/es7.math.clamp.js delete mode 100644 node_modules/core-js/modules/es7.math.deg-per-rad.js delete mode 100644 node_modules/core-js/modules/es7.math.degrees.js delete mode 100644 node_modules/core-js/modules/es7.math.fscale.js delete mode 100644 node_modules/core-js/modules/es7.math.iaddh.js delete mode 100644 node_modules/core-js/modules/es7.math.imulh.js delete mode 100644 node_modules/core-js/modules/es7.math.isubh.js delete mode 100644 node_modules/core-js/modules/es7.math.rad-per-deg.js delete mode 100644 node_modules/core-js/modules/es7.math.radians.js delete mode 100644 node_modules/core-js/modules/es7.math.scale.js delete mode 100644 node_modules/core-js/modules/es7.math.signbit.js delete mode 100644 node_modules/core-js/modules/es7.math.umulh.js delete mode 100644 node_modules/core-js/modules/es7.object.define-getter.js delete mode 100644 node_modules/core-js/modules/es7.object.define-setter.js delete mode 100644 node_modules/core-js/modules/es7.object.entries.js delete mode 100644 node_modules/core-js/modules/es7.object.get-own-property-descriptors.js delete mode 100644 node_modules/core-js/modules/es7.object.lookup-getter.js delete mode 100644 node_modules/core-js/modules/es7.object.lookup-setter.js delete mode 100644 node_modules/core-js/modules/es7.object.values.js delete mode 100644 node_modules/core-js/modules/es7.observable.js delete mode 100644 node_modules/core-js/modules/es7.promise.finally.js delete mode 100644 node_modules/core-js/modules/es7.promise.try.js delete mode 100644 node_modules/core-js/modules/es7.reflect.define-metadata.js delete mode 100644 node_modules/core-js/modules/es7.reflect.delete-metadata.js delete mode 100644 node_modules/core-js/modules/es7.reflect.get-metadata-keys.js delete mode 100644 node_modules/core-js/modules/es7.reflect.get-metadata.js delete mode 100644 node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js delete mode 100644 node_modules/core-js/modules/es7.reflect.get-own-metadata.js delete mode 100644 node_modules/core-js/modules/es7.reflect.has-metadata.js delete mode 100644 node_modules/core-js/modules/es7.reflect.has-own-metadata.js delete mode 100644 node_modules/core-js/modules/es7.reflect.metadata.js delete mode 100644 node_modules/core-js/modules/es7.set.from.js delete mode 100644 node_modules/core-js/modules/es7.set.of.js delete mode 100644 node_modules/core-js/modules/es7.set.to-json.js delete mode 100644 node_modules/core-js/modules/es7.string.at.js delete mode 100644 node_modules/core-js/modules/es7.string.match-all.js delete mode 100644 node_modules/core-js/modules/es7.string.pad-end.js delete mode 100644 node_modules/core-js/modules/es7.string.pad-start.js delete mode 100644 node_modules/core-js/modules/es7.string.trim-left.js delete mode 100644 node_modules/core-js/modules/es7.string.trim-right.js delete mode 100644 node_modules/core-js/modules/es7.symbol.async-iterator.js delete mode 100644 node_modules/core-js/modules/es7.symbol.observable.js delete mode 100644 node_modules/core-js/modules/es7.system.global.js delete mode 100644 node_modules/core-js/modules/es7.weak-map.from.js delete mode 100644 node_modules/core-js/modules/es7.weak-map.of.js delete mode 100644 node_modules/core-js/modules/es7.weak-set.from.js delete mode 100644 node_modules/core-js/modules/es7.weak-set.of.js delete mode 100644 node_modules/core-js/modules/library/_add-to-unscopables.js delete mode 100644 node_modules/core-js/modules/library/_collection.js delete mode 100644 node_modules/core-js/modules/library/_export.js delete mode 100644 node_modules/core-js/modules/library/_library.js delete mode 100644 node_modules/core-js/modules/library/_path.js delete mode 100644 node_modules/core-js/modules/library/_redefine-all.js delete mode 100644 node_modules/core-js/modules/library/_redefine.js delete mode 100644 node_modules/core-js/modules/library/_set-species.js delete mode 100644 node_modules/core-js/modules/library/es6.date.to-json.js delete mode 100644 node_modules/core-js/modules/library/es6.date.to-primitive.js delete mode 100644 node_modules/core-js/modules/library/es6.date.to-string.js delete mode 100644 node_modules/core-js/modules/library/es6.function.name.js delete mode 100644 node_modules/core-js/modules/library/es6.number.constructor.js delete mode 100644 node_modules/core-js/modules/library/es6.object.to-string.js delete mode 100644 node_modules/core-js/modules/library/es6.regexp.constructor.js delete mode 100644 node_modules/core-js/modules/library/es6.regexp.flags.js delete mode 100644 node_modules/core-js/modules/library/es6.regexp.match.js delete mode 100644 node_modules/core-js/modules/library/es6.regexp.replace.js delete mode 100644 node_modules/core-js/modules/library/es6.regexp.search.js delete mode 100644 node_modules/core-js/modules/library/es6.regexp.split.js delete mode 100644 node_modules/core-js/modules/library/es6.regexp.to-string.js delete mode 100644 node_modules/core-js/modules/library/web.dom.iterable.js delete mode 100644 node_modules/core-js/modules/web.dom.iterable.js delete mode 100644 node_modules/core-js/modules/web.immediate.js delete mode 100644 node_modules/core-js/modules/web.timers.js delete mode 100644 node_modules/core-js/package.json delete mode 100644 node_modules/core-js/shim.js delete mode 100644 node_modules/core-js/stage/0.js delete mode 100644 node_modules/core-js/stage/1.js delete mode 100644 node_modules/core-js/stage/2.js delete mode 100644 node_modules/core-js/stage/3.js delete mode 100644 node_modules/core-js/stage/4.js delete mode 100644 node_modules/core-js/stage/index.js delete mode 100644 node_modules/core-js/stage/pre.js delete mode 100644 node_modules/core-js/web/dom-collections.js delete mode 100644 node_modules/core-js/web/immediate.js delete mode 100644 node_modules/core-js/web/index.js delete mode 100644 node_modules/core-js/web/timers.js delete mode 100644 node_modules/core-util-is/LICENSE delete mode 100644 node_modules/core-util-is/README.md delete mode 100644 node_modules/core-util-is/float.patch delete mode 100644 node_modules/core-util-is/lib/util.js delete mode 100644 node_modules/core-util-is/package.json delete mode 100644 node_modules/core-util-is/test.js delete mode 100644 node_modules/create-ecdh/.travis.yml delete mode 100644 node_modules/create-ecdh/LICENSE delete mode 100644 node_modules/create-ecdh/browser.js delete mode 100644 node_modules/create-ecdh/index.js delete mode 100644 node_modules/create-ecdh/package.json delete mode 100644 node_modules/create-ecdh/readme.md delete mode 100644 node_modules/create-hash/.travis.yml delete mode 100644 node_modules/create-hash/LICENSE delete mode 100644 node_modules/create-hash/README.md delete mode 100644 node_modules/create-hash/browser.js delete mode 100644 node_modules/create-hash/index.js delete mode 100644 node_modules/create-hash/md5.js delete mode 100644 node_modules/create-hash/package.json delete mode 100644 node_modules/create-hash/test.js delete mode 100644 node_modules/create-hmac/LICENSE delete mode 100644 node_modules/create-hmac/README.md delete mode 100644 node_modules/create-hmac/browser.js delete mode 100644 node_modules/create-hmac/index.js delete mode 100644 node_modules/create-hmac/legacy.js delete mode 100644 node_modules/create-hmac/package.json delete mode 100644 node_modules/cross-spawn/CHANGELOG.md delete mode 100644 node_modules/cross-spawn/LICENSE delete mode 100644 node_modules/cross-spawn/README.md delete mode 100644 node_modules/cross-spawn/index.js delete mode 100644 node_modules/cross-spawn/lib/enoent.js delete mode 100644 node_modules/cross-spawn/lib/parse.js delete mode 100644 node_modules/cross-spawn/lib/util/escape.js delete mode 100644 node_modules/cross-spawn/lib/util/readShebang.js delete mode 100644 node_modules/cross-spawn/lib/util/resolveCommand.js delete mode 100644 node_modules/cross-spawn/package.json delete mode 100644 node_modules/crypt/LICENSE.mkd delete mode 100644 node_modules/crypt/README.mkd delete mode 100644 node_modules/crypt/crypt.js delete mode 100644 node_modules/crypt/package.json delete mode 100644 node_modules/crypto-browserify/.travis.yml delete mode 100644 node_modules/crypto-browserify/.zuul.yml delete mode 100644 node_modules/crypto-browserify/LICENSE delete mode 100644 node_modules/crypto-browserify/README.md delete mode 100644 node_modules/crypto-browserify/example/bundle.js delete mode 100644 node_modules/crypto-browserify/example/index.html delete mode 100644 node_modules/crypto-browserify/example/test.js delete mode 100644 node_modules/crypto-browserify/index.js delete mode 100644 node_modules/crypto-browserify/package.json delete mode 100644 node_modules/crypto-browserify/test/aes.js delete mode 100644 node_modules/crypto-browserify/test/create-hash.js delete mode 100644 node_modules/crypto-browserify/test/create-hmac.js delete mode 100644 node_modules/crypto-browserify/test/dh.js delete mode 100644 node_modules/crypto-browserify/test/ecdh.js delete mode 100644 node_modules/crypto-browserify/test/index.js delete mode 100644 node_modules/crypto-browserify/test/node/dh.js delete mode 100644 node_modules/crypto-browserify/test/pbkdf2.js delete mode 100644 node_modules/crypto-browserify/test/public-encrypt.js delete mode 100644 node_modules/crypto-browserify/test/random-bytes.js delete mode 100644 node_modules/crypto-browserify/test/random-fill.js delete mode 100644 node_modules/crypto-browserify/test/sign.js delete mode 100644 node_modules/csjs-inject/.npmignore delete mode 100644 node_modules/csjs-inject/LICENSE delete mode 100644 node_modules/csjs-inject/README.md delete mode 100644 node_modules/csjs-inject/csjs.js delete mode 100644 node_modules/csjs-inject/get-css.js delete mode 100644 node_modules/csjs-inject/index.js delete mode 100644 node_modules/csjs-inject/package.json delete mode 100644 node_modules/csjs/.istanbul.yml delete mode 100644 node_modules/csjs/.npmignore delete mode 100644 node_modules/csjs/.travis.yml delete mode 100644 node_modules/csjs/.zuul.yml delete mode 100644 node_modules/csjs/LICENSE delete mode 100644 node_modules/csjs/README.md delete mode 100644 node_modules/csjs/csjs.js delete mode 100644 node_modules/csjs/docs/automatic-vendor-prefixing.md delete mode 100644 node_modules/csjs/docs/comments.md delete mode 100644 node_modules/csjs/docs/keyframe-animations.md delete mode 100644 node_modules/csjs/get-css.js delete mode 100644 node_modules/csjs/index.js delete mode 100644 node_modules/csjs/lib/base62-encode.js delete mode 100644 node_modules/csjs/lib/build-exports.js delete mode 100644 node_modules/csjs/lib/composition.js delete mode 100644 node_modules/csjs/lib/csjs.js delete mode 100644 node_modules/csjs/lib/css-extract-extends.js delete mode 100644 node_modules/csjs/lib/css-key.js delete mode 100644 node_modules/csjs/lib/extract-exports.js delete mode 100644 node_modules/csjs/lib/get-css.js delete mode 100644 node_modules/csjs/lib/hash-string.js delete mode 100644 node_modules/csjs/lib/regex.js delete mode 100644 node_modules/csjs/lib/replace-animations.js delete mode 100644 node_modules/csjs/lib/scoped-name.js delete mode 100644 node_modules/csjs/lib/scopeify.js delete mode 100644 node_modules/csjs/package.json delete mode 100644 node_modules/csjs/test/animation-as-pseudo.expected.css delete mode 100644 node_modules/csjs/test/animation-as-pseudo.expected.json delete mode 100644 node_modules/csjs/test/animation-as-pseudo.noscope.expected.css delete mode 100644 node_modules/csjs/test/animation-as-pseudo.noscope.expected.json delete mode 100644 node_modules/csjs/test/animation-as-pseudo.noscope.source.js delete mode 100644 node_modules/csjs/test/animation-as-pseudo.source.js delete mode 100644 node_modules/csjs/test/basic.expected.css delete mode 100644 node_modules/csjs/test/basic.expected.json delete mode 100644 node_modules/csjs/test/basic.noscope.expected.css delete mode 100644 node_modules/csjs/test/basic.noscope.expected.json delete mode 100644 node_modules/csjs/test/basic.noscope.source.js delete mode 100644 node_modules/csjs/test/basic.source.js delete mode 100644 node_modules/csjs/test/comments.expected.css delete mode 100644 node_modules/csjs/test/comments.expected.json delete mode 100644 node_modules/csjs/test/comments.noscope.expected.css delete mode 100644 node_modules/csjs/test/comments.noscope.expected.json delete mode 100644 node_modules/csjs/test/comments.source.js delete mode 100644 node_modules/csjs/test/comments.source.noscope.js delete mode 100644 node_modules/csjs/test/dot-in-values.expected.css delete mode 100644 node_modules/csjs/test/dot-in-values.expected.json delete mode 100644 node_modules/csjs/test/dot-in-values.noscope.expected.css delete mode 100644 node_modules/csjs/test/dot-in-values.noscope.expected.json delete mode 100644 node_modules/csjs/test/dot-in-values.noscope.source.js delete mode 100644 node_modules/csjs/test/dot-in-values.source.js delete mode 100644 node_modules/csjs/test/extends-in-media-query.expected.css delete mode 100644 node_modules/csjs/test/extends-in-media-query.expected.json delete mode 100644 node_modules/csjs/test/extends-in-media-query.noscope.expected.css delete mode 100644 node_modules/csjs/test/extends-in-media-query.noscope.expected.json delete mode 100644 node_modules/csjs/test/extends-in-media-query.noscope.source.js delete mode 100644 node_modules/csjs/test/extends-in-media-query.source.js delete mode 100644 node_modules/csjs/test/extensions.expected.css delete mode 100644 node_modules/csjs/test/extensions.expected.json delete mode 100644 node_modules/csjs/test/extensions.noscope.expected.css delete mode 100644 node_modules/csjs/test/extensions.noscope.expected.json delete mode 100644 node_modules/csjs/test/extensions.noscope.source.js delete mode 100644 node_modules/csjs/test/extensions.source.js delete mode 100644 node_modules/csjs/test/index.js delete mode 100644 node_modules/csjs/test/keyframes-usage.expected.css delete mode 100644 node_modules/csjs/test/keyframes-usage.expected.json delete mode 100644 node_modules/csjs/test/keyframes-usage.noscope.expected.css delete mode 100644 node_modules/csjs/test/keyframes-usage.noscope.expected.json delete mode 100644 node_modules/csjs/test/keyframes-usage.noscope.source.js delete mode 100644 node_modules/csjs/test/keyframes-usage.source.js delete mode 100644 node_modules/csjs/test/keyframes-with-decimal.expected.css delete mode 100644 node_modules/csjs/test/keyframes-with-decimal.expected.json delete mode 100644 node_modules/csjs/test/keyframes-with-decimal.noscope.expected.css delete mode 100644 node_modules/csjs/test/keyframes-with-decimal.noscope.expected.json delete mode 100644 node_modules/csjs/test/keyframes-with-decimal.noscope.source.js delete mode 100644 node_modules/csjs/test/keyframes-with-decimal.source.js delete mode 100644 node_modules/csjs/test/keyframes.expected.css delete mode 100644 node_modules/csjs/test/keyframes.expected.json delete mode 100644 node_modules/csjs/test/keyframes.noscope.expected.css delete mode 100644 node_modules/csjs/test/keyframes.noscope.expected.json delete mode 100644 node_modules/csjs/test/keyframes.noscope.source.js delete mode 100644 node_modules/csjs/test/keyframes.source.js delete mode 100644 node_modules/csjs/test/media-query.expected.css delete mode 100644 node_modules/csjs/test/media-query.expected.json delete mode 100644 node_modules/csjs/test/media-query.noscope.expected.css delete mode 100644 node_modules/csjs/test/media-query.noscope.expected.json delete mode 100644 node_modules/csjs/test/media-query.noscope.source.js delete mode 100644 node_modules/csjs/test/media-query.source.js delete mode 100644 node_modules/csjs/test/multiple-extensions.expected.css delete mode 100644 node_modules/csjs/test/multiple-extensions.expected.json delete mode 100644 node_modules/csjs/test/multiple-extensions.noscope.expected.css delete mode 100644 node_modules/csjs/test/multiple-extensions.noscope.expected.json delete mode 100644 node_modules/csjs/test/multiple-extensions.noscope.source.js delete mode 100644 node_modules/csjs/test/multiple-extensions.source.js delete mode 100644 node_modules/csjs/test/non-class.expected.css delete mode 100644 node_modules/csjs/test/non-class.expected.json delete mode 100644 node_modules/csjs/test/non-class.noscope.expected.css delete mode 100644 node_modules/csjs/test/non-class.noscope.expected.json delete mode 100644 node_modules/csjs/test/non-class.noscope.source.js delete mode 100644 node_modules/csjs/test/non-class.source.js delete mode 100644 node_modules/csjs/test/not-pseudo.expected.css delete mode 100644 node_modules/csjs/test/not-pseudo.expected.json delete mode 100644 node_modules/csjs/test/not-pseudo.noscope.expected.css delete mode 100644 node_modules/csjs/test/not-pseudo.noscope.expected.json delete mode 100644 node_modules/csjs/test/not-pseudo.noscope.source.js delete mode 100644 node_modules/csjs/test/not-pseudo.source.js delete mode 100644 node_modules/cytoscape/.babelrc delete mode 100644 node_modules/cytoscape/.eslintrc.json delete mode 100644 node_modules/cytoscape/.travis.yml delete mode 100644 node_modules/cytoscape/ISSUE_TEMPLATE.md delete mode 100644 node_modules/cytoscape/LICENSE delete mode 100644 node_modules/cytoscape/README.md delete mode 100644 node_modules/cytoscape/dist/cytoscape.cjs.js delete mode 100644 node_modules/cytoscape/dist/cytoscape.js delete mode 100644 node_modules/cytoscape/dist/cytoscape.min.js delete mode 100644 node_modules/cytoscape/package.json delete mode 100644 node_modules/cytoscape/src/animation.js delete mode 100644 node_modules/cytoscape/src/collection/algorithms/a-star.js delete mode 100644 node_modules/cytoscape/src/collection/algorithms/bellman-ford.js delete mode 100644 node_modules/cytoscape/src/collection/algorithms/betweenness-centrality.js delete mode 100644 node_modules/cytoscape/src/collection/algorithms/bfs-dfs.js delete mode 100644 node_modules/cytoscape/src/collection/algorithms/closeness-centrality.js delete mode 100644 node_modules/cytoscape/src/collection/algorithms/degree-centrality.js delete mode 100644 node_modules/cytoscape/src/collection/algorithms/dijkstra.js delete mode 100644 node_modules/cytoscape/src/collection/algorithms/floyd-warshall.js delete mode 100644 node_modules/cytoscape/src/collection/algorithms/index.js delete mode 100644 node_modules/cytoscape/src/collection/algorithms/kerger-stein.js delete mode 100644 node_modules/cytoscape/src/collection/algorithms/kruskal.js delete mode 100644 node_modules/cytoscape/src/collection/algorithms/page-rank.js delete mode 100644 node_modules/cytoscape/src/collection/animation.js delete mode 100644 node_modules/cytoscape/src/collection/class.js delete mode 100644 node_modules/cytoscape/src/collection/comparators.js delete mode 100644 node_modules/cytoscape/src/collection/compounds.js delete mode 100644 node_modules/cytoscape/src/collection/data.js delete mode 100644 node_modules/cytoscape/src/collection/degree.js delete mode 100644 node_modules/cytoscape/src/collection/dimensions/bounds.js delete mode 100644 node_modules/cytoscape/src/collection/dimensions/edge-points.js delete mode 100644 node_modules/cytoscape/src/collection/dimensions/index.js delete mode 100644 node_modules/cytoscape/src/collection/dimensions/position.js delete mode 100644 node_modules/cytoscape/src/collection/dimensions/width-height.js delete mode 100644 node_modules/cytoscape/src/collection/element.js delete mode 100644 node_modules/cytoscape/src/collection/events.js delete mode 100644 node_modules/cytoscape/src/collection/filter.js delete mode 100644 node_modules/cytoscape/src/collection/group.js delete mode 100644 node_modules/cytoscape/src/collection/index.js delete mode 100644 node_modules/cytoscape/src/collection/iteration.js delete mode 100644 node_modules/cytoscape/src/collection/layout.js delete mode 100644 node_modules/cytoscape/src/collection/style.js delete mode 100644 node_modules/cytoscape/src/collection/switch-functions.js delete mode 100644 node_modules/cytoscape/src/collection/traversing.js delete mode 100644 node_modules/cytoscape/src/collection/zsort.js delete mode 100644 node_modules/cytoscape/src/core/add-remove.js delete mode 100644 node_modules/cytoscape/src/core/animation/cubic-bezier.js delete mode 100644 node_modules/cytoscape/src/core/animation/ease.js delete mode 100644 node_modules/cytoscape/src/core/animation/easings.js delete mode 100644 node_modules/cytoscape/src/core/animation/index.js delete mode 100644 node_modules/cytoscape/src/core/animation/spring.js delete mode 100644 node_modules/cytoscape/src/core/animation/start.js delete mode 100644 node_modules/cytoscape/src/core/animation/step-all.js delete mode 100644 node_modules/cytoscape/src/core/animation/step.js delete mode 100644 node_modules/cytoscape/src/core/events.js delete mode 100644 node_modules/cytoscape/src/core/export.js delete mode 100644 node_modules/cytoscape/src/core/index.js delete mode 100644 node_modules/cytoscape/src/core/layout.js delete mode 100644 node_modules/cytoscape/src/core/notification.js delete mode 100644 node_modules/cytoscape/src/core/renderer.js delete mode 100644 node_modules/cytoscape/src/core/search.js delete mode 100644 node_modules/cytoscape/src/core/style.js delete mode 100644 node_modules/cytoscape/src/core/viewport.js delete mode 100644 node_modules/cytoscape/src/define/animation.js delete mode 100644 node_modules/cytoscape/src/define/data.js delete mode 100644 node_modules/cytoscape/src/define/events.js delete mode 100644 node_modules/cytoscape/src/define/index.js delete mode 100644 node_modules/cytoscape/src/emitter.js delete mode 100644 node_modules/cytoscape/src/event.js delete mode 100644 node_modules/cytoscape/src/extension.js delete mode 100644 node_modules/cytoscape/src/extensions/index.js delete mode 100644 node_modules/cytoscape/src/extensions/layout/breadthfirst.js delete mode 100644 node_modules/cytoscape/src/extensions/layout/circle.js delete mode 100644 node_modules/cytoscape/src/extensions/layout/concentric.js delete mode 100644 node_modules/cytoscape/src/extensions/layout/cose.js delete mode 100644 node_modules/cytoscape/src/extensions/layout/grid.js delete mode 100644 node_modules/cytoscape/src/extensions/layout/index.js delete mode 100644 node_modules/cytoscape/src/extensions/layout/null.js delete mode 100644 node_modules/cytoscape/src/extensions/layout/preset.js delete mode 100644 node_modules/cytoscape/src/extensions/layout/random.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/base/arrow-shapes.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/coords.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-arrows.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-control-points.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-endpoints.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-projection.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/index.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/labels.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/nodes.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/rendered-style.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/z-ordering.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/base/images.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/base/index.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/base/load-listeners.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/base/node-shapes.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/base/redraw.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/arrow-shapes.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/drawing-edges.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/drawing-elements.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/drawing-images.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/drawing-label-text.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/drawing-nodes.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/drawing-redraw.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/drawing-shapes.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/ele-texture-cache.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/export-image.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/index.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/layered-texture-cache.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/node-shapes.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/canvas/texture-cache-defs.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/index.js delete mode 100644 node_modules/cytoscape/src/extensions/renderer/null/index.js delete mode 100644 node_modules/cytoscape/src/heap.js delete mode 100644 node_modules/cytoscape/src/index.js delete mode 100644 node_modules/cytoscape/src/is.js delete mode 100644 node_modules/cytoscape/src/map.js delete mode 100644 node_modules/cytoscape/src/math.js delete mode 100644 node_modules/cytoscape/src/promise.js delete mode 100644 node_modules/cytoscape/src/selector/expressions.js delete mode 100644 node_modules/cytoscape/src/selector/index.js delete mode 100644 node_modules/cytoscape/src/selector/matching.js delete mode 100644 node_modules/cytoscape/src/selector/new-query.js delete mode 100644 node_modules/cytoscape/src/selector/parse.js delete mode 100644 node_modules/cytoscape/src/selector/state.js delete mode 100644 node_modules/cytoscape/src/selector/tokens.js delete mode 100644 node_modules/cytoscape/src/set.js delete mode 100644 node_modules/cytoscape/src/style/apply.js delete mode 100644 node_modules/cytoscape/src/style/bypass.js delete mode 100644 node_modules/cytoscape/src/style/container.js delete mode 100644 node_modules/cytoscape/src/style/get-for-ele.js delete mode 100644 node_modules/cytoscape/src/style/index.js delete mode 100644 node_modules/cytoscape/src/style/json.js delete mode 100644 node_modules/cytoscape/src/style/parse.js delete mode 100644 node_modules/cytoscape/src/style/properties.js delete mode 100644 node_modules/cytoscape/src/style/string-sheet.js delete mode 100644 node_modules/cytoscape/src/stylesheet.js delete mode 100644 node_modules/cytoscape/src/test.js delete mode 100644 node_modules/cytoscape/src/util/colors.js delete mode 100644 node_modules/cytoscape/src/util/index.js delete mode 100644 node_modules/cytoscape/src/util/maps.js delete mode 100644 node_modules/cytoscape/src/util/memoize.js delete mode 100644 node_modules/cytoscape/src/util/regex.js delete mode 100644 node_modules/cytoscape/src/util/sort.js delete mode 100644 node_modules/cytoscape/src/util/strings.js delete mode 100644 node_modules/cytoscape/src/util/timing.js delete mode 100644 node_modules/cytoscape/src/version.js delete mode 100644 node_modules/cytoscape/src/version.json delete mode 100644 node_modules/cytoscape/src/window.js delete mode 100644 node_modules/cytoscape/webpack.config.js delete mode 100644 node_modules/date-now/.npmignore delete mode 100644 node_modules/date-now/.testem.json delete mode 100644 node_modules/date-now/.travis.yml delete mode 100644 node_modules/date-now/LICENCE delete mode 100644 node_modules/date-now/README.md delete mode 100644 node_modules/date-now/index.js delete mode 100644 node_modules/date-now/package.json delete mode 100644 node_modules/date-now/seed.js delete mode 100644 node_modules/date-now/test/index.js delete mode 100644 node_modules/date-now/test/static/index.html delete mode 100644 node_modules/debounce/History.md delete mode 100644 node_modules/debounce/Makefile delete mode 100644 node_modules/debounce/Readme.md delete mode 100644 node_modules/debounce/component.json delete mode 100644 node_modules/debounce/index.js delete mode 100644 node_modules/debounce/package.json delete mode 100644 node_modules/debounce/test.html delete mode 100644 node_modules/debounce/test.js delete mode 100644 node_modules/debug/.coveralls.yml delete mode 100644 node_modules/debug/.eslintrc delete mode 100644 node_modules/debug/.npmignore delete mode 100644 node_modules/debug/.travis.yml delete mode 100644 node_modules/debug/CHANGELOG.md delete mode 100644 node_modules/debug/LICENSE delete mode 100644 node_modules/debug/Makefile delete mode 100644 node_modules/debug/README.md delete mode 100644 node_modules/debug/component.json delete mode 100644 node_modules/debug/karma.conf.js delete mode 100644 node_modules/debug/node.js delete mode 100644 node_modules/debug/package.json delete mode 100644 node_modules/debug/src/browser.js delete mode 100644 node_modules/debug/src/debug.js delete mode 100644 node_modules/debug/src/index.js delete mode 100644 node_modules/debug/src/inspector-log.js delete mode 100644 node_modules/debug/src/node.js delete mode 100644 node_modules/decode-uri-component/index.js delete mode 100644 node_modules/decode-uri-component/license delete mode 100644 node_modules/decode-uri-component/package.json delete mode 100644 node_modules/decode-uri-component/readme.md delete mode 100644 node_modules/default-gateway/LICENSE delete mode 100644 node_modules/default-gateway/README.md delete mode 100644 node_modules/default-gateway/android.js delete mode 100644 node_modules/default-gateway/darwin.js delete mode 100644 node_modules/default-gateway/freebsd.js delete mode 100644 node_modules/default-gateway/index.js delete mode 100644 node_modules/default-gateway/linux.js delete mode 100644 node_modules/default-gateway/openbsd.js delete mode 100644 node_modules/default-gateway/package.json delete mode 100644 node_modules/default-gateway/sunos.js delete mode 100644 node_modules/default-gateway/win32.js delete mode 100644 node_modules/define-property/CHANGELOG.md delete mode 100644 node_modules/define-property/LICENSE delete mode 100644 node_modules/define-property/README.md delete mode 100644 node_modules/define-property/index.js delete mode 100644 node_modules/define-property/node_modules/is-accessor-descriptor/LICENSE delete mode 100644 node_modules/define-property/node_modules/is-accessor-descriptor/README.md delete mode 100644 node_modules/define-property/node_modules/is-accessor-descriptor/index.js delete mode 100644 node_modules/define-property/node_modules/is-accessor-descriptor/package.json delete mode 100644 node_modules/define-property/node_modules/is-data-descriptor/LICENSE delete mode 100644 node_modules/define-property/node_modules/is-data-descriptor/README.md delete mode 100644 node_modules/define-property/node_modules/is-data-descriptor/index.js delete mode 100644 node_modules/define-property/node_modules/is-data-descriptor/package.json delete mode 100644 node_modules/define-property/node_modules/is-descriptor/LICENSE delete mode 100644 node_modules/define-property/node_modules/is-descriptor/README.md delete mode 100644 node_modules/define-property/node_modules/is-descriptor/index.js delete mode 100644 node_modules/define-property/node_modules/is-descriptor/package.json delete mode 100644 node_modules/define-property/node_modules/isobject/LICENSE delete mode 100644 node_modules/define-property/node_modules/isobject/README.md delete mode 100644 node_modules/define-property/node_modules/isobject/index.d.ts delete mode 100644 node_modules/define-property/node_modules/isobject/index.js delete mode 100644 node_modules/define-property/node_modules/isobject/package.json delete mode 100644 node_modules/define-property/node_modules/kind-of/CHANGELOG.md delete mode 100644 node_modules/define-property/node_modules/kind-of/LICENSE delete mode 100644 node_modules/define-property/node_modules/kind-of/README.md delete mode 100644 node_modules/define-property/node_modules/kind-of/index.js delete mode 100644 node_modules/define-property/node_modules/kind-of/package.json delete mode 100644 node_modules/define-property/package.json delete mode 100644 node_modules/defined/.travis.yml delete mode 100644 node_modules/defined/LICENSE delete mode 100644 node_modules/defined/example/defined.js delete mode 100644 node_modules/defined/index.js delete mode 100644 node_modules/defined/package.json delete mode 100644 node_modules/defined/readme.markdown delete mode 100644 node_modules/defined/test/def.js delete mode 100644 node_modules/defined/test/falsy.js delete mode 100644 node_modules/depd/History.md delete mode 100644 node_modules/depd/LICENSE delete mode 100644 node_modules/depd/Readme.md delete mode 100644 node_modules/depd/index.js delete mode 100644 node_modules/depd/lib/browser/index.js delete mode 100644 node_modules/depd/lib/compat/callsite-tostring.js delete mode 100644 node_modules/depd/lib/compat/event-listener-count.js delete mode 100644 node_modules/depd/lib/compat/index.js delete mode 100644 node_modules/depd/package.json delete mode 100644 node_modules/deps-sort/.travis.yml delete mode 100644 node_modules/deps-sort/LICENSE delete mode 100755 node_modules/deps-sort/bin/cmd.js delete mode 100644 node_modules/deps-sort/example/sort.js delete mode 100644 node_modules/deps-sort/index.js delete mode 100644 node_modules/deps-sort/package.json delete mode 100644 node_modules/deps-sort/readme.markdown delete mode 100644 node_modules/deps-sort/test/dedupe-deps-of-deps.js delete mode 100644 node_modules/deps-sort/test/dedupe.js delete mode 100644 node_modules/deps-sort/test/dedupe_index.js delete mode 100644 node_modules/deps-sort/test/dedupe_undef.js delete mode 100644 node_modules/deps-sort/test/expose.js delete mode 100644 node_modules/deps-sort/test/expose_str.js delete mode 100644 node_modules/deps-sort/test/indexed.js delete mode 100644 node_modules/deps-sort/test/sort.js delete mode 100644 node_modules/des.js/.jscsrc delete mode 100644 node_modules/des.js/.jshintrc delete mode 100644 node_modules/des.js/.npmignore delete mode 100644 node_modules/des.js/README.md delete mode 100644 node_modules/des.js/lib/des.js delete mode 100644 node_modules/des.js/lib/des/cbc.js delete mode 100644 node_modules/des.js/lib/des/cipher.js delete mode 100644 node_modules/des.js/lib/des/des.js delete mode 100644 node_modules/des.js/lib/des/ede.js delete mode 100644 node_modules/des.js/lib/des/utils.js delete mode 100644 node_modules/des.js/package.json delete mode 100644 node_modules/des.js/test/cbc-test.js delete mode 100644 node_modules/des.js/test/des-test.js delete mode 100644 node_modules/des.js/test/ede-test.js delete mode 100644 node_modules/des.js/test/fixtures.js delete mode 100644 node_modules/des.js/test/utils-test.js delete mode 100644 node_modules/destroy/LICENSE delete mode 100644 node_modules/destroy/README.md delete mode 100644 node_modules/destroy/index.js delete mode 100644 node_modules/destroy/package.json delete mode 100644 node_modules/detective/.travis.yml delete mode 100644 node_modules/detective/CHANGELOG.md delete mode 100644 node_modules/detective/LICENSE delete mode 100644 node_modules/detective/bench/detect.js delete mode 100644 node_modules/detective/bench/esprima_v_acorn.txt delete mode 100755 node_modules/detective/bin/detective.js delete mode 100644 node_modules/detective/example/strings.js delete mode 100644 node_modules/detective/example/strings_src.js delete mode 100644 node_modules/detective/index.js delete mode 100644 node_modules/detective/package.json delete mode 100644 node_modules/detective/readme.markdown delete mode 100644 node_modules/detective/test/both.js delete mode 100644 node_modules/detective/test/chained.js delete mode 100644 node_modules/detective/test/complicated.js delete mode 100644 node_modules/detective/test/es6-module.js delete mode 100644 node_modules/detective/test/files/both.js delete mode 100644 node_modules/detective/test/files/chained.js delete mode 100644 node_modules/detective/test/files/es6-module.js delete mode 100644 node_modules/detective/test/files/generators.js delete mode 100644 node_modules/detective/test/files/isrequire.js delete mode 100644 node_modules/detective/test/files/nested.js delete mode 100644 node_modules/detective/test/files/rest-spread.js delete mode 100644 node_modules/detective/test/files/set-in-object-pattern.js delete mode 100644 node_modules/detective/test/files/shebang.js delete mode 100644 node_modules/detective/test/files/sparse-array.js delete mode 100644 node_modules/detective/test/files/strings.js delete mode 100644 node_modules/detective/test/files/word.js delete mode 100644 node_modules/detective/test/files/yield.js delete mode 100644 node_modules/detective/test/generators.js delete mode 100644 node_modules/detective/test/isrequire.js delete mode 100644 node_modules/detective/test/nested.js delete mode 100644 node_modules/detective/test/noargs.js delete mode 100644 node_modules/detective/test/parseopts.js delete mode 100644 node_modules/detective/test/rest-spread.js delete mode 100644 node_modules/detective/test/return.js delete mode 100644 node_modules/detective/test/set-in-object-pattern.js delete mode 100644 node_modules/detective/test/shebang.js delete mode 100644 node_modules/detective/test/sparse-array.js delete mode 100644 node_modules/detective/test/strings.js delete mode 100644 node_modules/detective/test/word.js delete mode 100644 node_modules/detective/test/yield.js delete mode 100644 node_modules/diffie-hellman/.travis.yml delete mode 100644 node_modules/diffie-hellman/LICENSE delete mode 100644 node_modules/diffie-hellman/browser.js delete mode 100644 node_modules/diffie-hellman/index.js delete mode 100644 node_modules/diffie-hellman/lib/dh.js delete mode 100644 node_modules/diffie-hellman/lib/generatePrime.js delete mode 100644 node_modules/diffie-hellman/lib/primes.json delete mode 100644 node_modules/diffie-hellman/package.json delete mode 100644 node_modules/diffie-hellman/readme.md delete mode 100644 node_modules/domain-browser/HISTORY.md delete mode 100644 node_modules/domain-browser/LICENSE.md delete mode 100644 node_modules/domain-browser/README.md delete mode 100644 node_modules/domain-browser/package.json delete mode 100644 node_modules/domain-browser/source/index.js delete mode 100644 node_modules/duplexer2/LICENSE.md delete mode 100644 node_modules/duplexer2/README.md delete mode 100644 node_modules/duplexer2/index.js delete mode 100644 node_modules/duplexer2/package.json delete mode 100644 node_modules/ee-first/LICENSE delete mode 100644 node_modules/ee-first/README.md delete mode 100644 node_modules/ee-first/index.js delete mode 100644 node_modules/ee-first/package.json delete mode 100644 node_modules/elliptic/README.md delete mode 100644 node_modules/elliptic/lib/elliptic.js delete mode 100644 node_modules/elliptic/lib/elliptic/curve/base.js delete mode 100644 node_modules/elliptic/lib/elliptic/curve/edwards.js delete mode 100644 node_modules/elliptic/lib/elliptic/curve/index.js delete mode 100644 node_modules/elliptic/lib/elliptic/curve/mont.js delete mode 100644 node_modules/elliptic/lib/elliptic/curve/short.js delete mode 100644 node_modules/elliptic/lib/elliptic/curves.js delete mode 100644 node_modules/elliptic/lib/elliptic/ec/index.js delete mode 100644 node_modules/elliptic/lib/elliptic/ec/key.js delete mode 100644 node_modules/elliptic/lib/elliptic/ec/signature.js delete mode 100644 node_modules/elliptic/lib/elliptic/eddsa/index.js delete mode 100644 node_modules/elliptic/lib/elliptic/eddsa/key.js delete mode 100644 node_modules/elliptic/lib/elliptic/eddsa/signature.js delete mode 100644 node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js delete mode 100644 node_modules/elliptic/lib/elliptic/utils.js delete mode 100644 node_modules/elliptic/package.json delete mode 100644 node_modules/encodeurl/HISTORY.md delete mode 100644 node_modules/encodeurl/LICENSE delete mode 100644 node_modules/encodeurl/README.md delete mode 100644 node_modules/encodeurl/index.js delete mode 100644 node_modules/encodeurl/package.json delete mode 100644 node_modules/es6-promisify/LICENSE delete mode 100644 node_modules/es6-promisify/README.md delete mode 100644 node_modules/es6-promisify/dist/promisify.js delete mode 100644 node_modules/es6-promisify/package.json delete mode 100644 node_modules/escape-html/LICENSE delete mode 100644 node_modules/escape-html/Readme.md delete mode 100644 node_modules/escape-html/index.js delete mode 100644 node_modules/escape-html/package.json delete mode 100644 node_modules/escape-string-regexp/index.js delete mode 100644 node_modules/escape-string-regexp/license delete mode 100644 node_modules/escape-string-regexp/package.json delete mode 100644 node_modules/escape-string-regexp/readme.md delete mode 100644 node_modules/etag/HISTORY.md delete mode 100644 node_modules/etag/LICENSE delete mode 100644 node_modules/etag/README.md delete mode 100644 node_modules/etag/index.js delete mode 100644 node_modules/etag/package.json delete mode 100644 node_modules/events/.npmignore delete mode 100644 node_modules/events/.travis.yml delete mode 100644 node_modules/events/.zuul.yml delete mode 100644 node_modules/events/History.md delete mode 100644 node_modules/events/LICENSE delete mode 100644 node_modules/events/Readme.md delete mode 100644 node_modules/events/events.js delete mode 100644 node_modules/events/package.json delete mode 100644 node_modules/events/tests/add-listeners.js delete mode 100644 node_modules/events/tests/check-listener-leaks.js delete mode 100644 node_modules/events/tests/common.js delete mode 100644 node_modules/events/tests/index.js delete mode 100644 node_modules/events/tests/legacy-compat.js delete mode 100644 node_modules/events/tests/listener-count.js delete mode 100644 node_modules/events/tests/listeners-side-effects.js delete mode 100644 node_modules/events/tests/listeners.js delete mode 100644 node_modules/events/tests/max-listeners.js delete mode 100644 node_modules/events/tests/modify-in-emit.js delete mode 100644 node_modules/events/tests/num-args.js delete mode 100644 node_modules/events/tests/once.js delete mode 100644 node_modules/events/tests/remove-all-listeners.js delete mode 100644 node_modules/events/tests/remove-listeners.js delete mode 100644 node_modules/events/tests/set-max-listeners-side-effects.js delete mode 100644 node_modules/events/tests/subclass.js delete mode 100644 node_modules/evp_bytestokey/LICENSE delete mode 100644 node_modules/evp_bytestokey/README.md delete mode 100644 node_modules/evp_bytestokey/index.js delete mode 100644 node_modules/evp_bytestokey/package.json delete mode 100644 node_modules/execa/index.js delete mode 100644 node_modules/execa/lib/errname.js delete mode 100644 node_modules/execa/lib/stdio.js delete mode 100644 node_modules/execa/license delete mode 100644 node_modules/execa/package.json delete mode 100644 node_modules/execa/readme.md delete mode 100644 node_modules/expand-brackets/LICENSE delete mode 100644 node_modules/expand-brackets/README.md delete mode 100644 node_modules/expand-brackets/index.js delete mode 100644 node_modules/expand-brackets/package.json delete mode 100644 node_modules/expand-range/LICENSE delete mode 100644 node_modules/expand-range/README.md delete mode 100644 node_modules/expand-range/index.js delete mode 100644 node_modules/expand-range/package.json delete mode 100644 node_modules/extend-shallow/LICENSE delete mode 100644 node_modules/extend-shallow/README.md delete mode 100644 node_modules/extend-shallow/index.js delete mode 100644 node_modules/extend-shallow/node_modules/is-extendable/LICENSE delete mode 100644 node_modules/extend-shallow/node_modules/is-extendable/README.md delete mode 100644 node_modules/extend-shallow/node_modules/is-extendable/index.d.ts delete mode 100644 node_modules/extend-shallow/node_modules/is-extendable/index.js delete mode 100644 node_modules/extend-shallow/node_modules/is-extendable/package.json delete mode 100644 node_modules/extend-shallow/package.json delete mode 100644 node_modules/extglob/LICENSE delete mode 100644 node_modules/extglob/README.md delete mode 100644 node_modules/extglob/index.js delete mode 100644 node_modules/extglob/package.json delete mode 100644 node_modules/filename-regex/LICENSE delete mode 100644 node_modules/filename-regex/README.md delete mode 100644 node_modules/filename-regex/index.js delete mode 100644 node_modules/filename-regex/package.json delete mode 100644 node_modules/fill-range/LICENSE delete mode 100644 node_modules/fill-range/README.md delete mode 100644 node_modules/fill-range/index.js delete mode 100644 node_modules/fill-range/package.json delete mode 100644 node_modules/for-in/LICENSE delete mode 100644 node_modules/for-in/README.md delete mode 100644 node_modules/for-in/index.js delete mode 100644 node_modules/for-in/package.json delete mode 100644 node_modules/for-own/LICENSE delete mode 100644 node_modules/for-own/README.md delete mode 100644 node_modules/for-own/index.js delete mode 100644 node_modules/for-own/package.json delete mode 100644 node_modules/fragment-cache/LICENSE delete mode 100644 node_modules/fragment-cache/README.md delete mode 100644 node_modules/fragment-cache/index.js delete mode 100644 node_modules/fragment-cache/package.json delete mode 100644 node_modules/fresh/HISTORY.md delete mode 100644 node_modules/fresh/LICENSE delete mode 100644 node_modules/fresh/README.md delete mode 100644 node_modules/fresh/index.js delete mode 100644 node_modules/fresh/package.json delete mode 100644 node_modules/from2-string/LICENSE delete mode 100644 node_modules/from2-string/README.md delete mode 100644 node_modules/from2-string/index.js delete mode 100644 node_modules/from2-string/package.json delete mode 100644 node_modules/from2/.travis.yml delete mode 100644 node_modules/from2/LICENSE.md delete mode 100644 node_modules/from2/README.md delete mode 100644 node_modules/from2/index.js delete mode 100644 node_modules/from2/package.json delete mode 100644 node_modules/from2/test.js delete mode 100644 node_modules/fs.realpath/LICENSE delete mode 100644 node_modules/fs.realpath/README.md delete mode 100644 node_modules/fs.realpath/index.js delete mode 100644 node_modules/fs.realpath/old.js delete mode 100644 node_modules/fs.realpath/package.json delete mode 100644 node_modules/function-bind/.editorconfig delete mode 100644 node_modules/function-bind/.eslintrc delete mode 100644 node_modules/function-bind/.jscs.json delete mode 100644 node_modules/function-bind/.npmignore delete mode 100644 node_modules/function-bind/.travis.yml delete mode 100644 node_modules/function-bind/LICENSE delete mode 100644 node_modules/function-bind/README.md delete mode 100644 node_modules/function-bind/implementation.js delete mode 100644 node_modules/function-bind/index.js delete mode 100644 node_modules/function-bind/package.json delete mode 100644 node_modules/function-bind/test/.eslintrc delete mode 100644 node_modules/function-bind/test/index.js delete mode 100644 node_modules/garnish/LICENSE.md delete mode 100644 node_modules/garnish/README.md delete mode 100755 node_modules/garnish/bin/cmd.js delete mode 100644 node_modules/garnish/index.js delete mode 100644 node_modules/garnish/lib/levels.js delete mode 100644 node_modules/garnish/lib/renderer.js delete mode 100644 node_modules/garnish/package.json delete mode 100644 node_modules/get-assigned-identifiers/.travis.yml delete mode 100644 node_modules/get-assigned-identifiers/CHANGELOG.md delete mode 100644 node_modules/get-assigned-identifiers/LICENSE.md delete mode 100644 node_modules/get-assigned-identifiers/README.md delete mode 100644 node_modules/get-assigned-identifiers/index.js delete mode 100644 node_modules/get-assigned-identifiers/package.json delete mode 100644 node_modules/get-assigned-identifiers/test/index.js delete mode 100644 node_modules/get-ports/LICENSE.md delete mode 100644 node_modules/get-ports/README.md delete mode 100644 node_modules/get-ports/index.js delete mode 100644 node_modules/get-ports/package.json delete mode 100644 node_modules/get-stream/buffer-stream.js delete mode 100644 node_modules/get-stream/index.js delete mode 100644 node_modules/get-stream/license delete mode 100644 node_modules/get-stream/package.json delete mode 100644 node_modules/get-stream/readme.md delete mode 100644 node_modules/get-value/LICENSE delete mode 100644 node_modules/get-value/index.js delete mode 100644 node_modules/get-value/package.json delete mode 100644 node_modules/glob-base/LICENSE delete mode 100644 node_modules/glob-base/README.md delete mode 100644 node_modules/glob-base/index.js delete mode 100644 node_modules/glob-base/package.json delete mode 100644 node_modules/glob-parent/.npmignore delete mode 100644 node_modules/glob-parent/.travis.yml delete mode 100644 node_modules/glob-parent/LICENSE delete mode 100644 node_modules/glob-parent/README.md delete mode 100644 node_modules/glob-parent/index.js delete mode 100644 node_modules/glob-parent/package.json delete mode 100644 node_modules/glob-parent/test.js delete mode 100644 node_modules/glob/LICENSE delete mode 100644 node_modules/glob/README.md delete mode 100644 node_modules/glob/changelog.md delete mode 100644 node_modules/glob/common.js delete mode 100644 node_modules/glob/glob.js delete mode 100644 node_modules/glob/package.json delete mode 100644 node_modules/glob/sync.js delete mode 100644 node_modules/graceful-fs/LICENSE delete mode 100644 node_modules/graceful-fs/README.md delete mode 100644 node_modules/graceful-fs/fs.js delete mode 100644 node_modules/graceful-fs/graceful-fs.js delete mode 100644 node_modules/graceful-fs/legacy-streams.js delete mode 100644 node_modules/graceful-fs/package.json delete mode 100644 node_modules/graceful-fs/polyfills.js delete mode 100755 node_modules/has-ansi/cli.js delete mode 100644 node_modules/has-ansi/index.js delete mode 100644 node_modules/has-ansi/package.json delete mode 100644 node_modules/has-ansi/readme.md delete mode 100644 node_modules/has-value/LICENSE delete mode 100644 node_modules/has-value/README.md delete mode 100644 node_modules/has-value/index.js delete mode 100644 node_modules/has-value/node_modules/isobject/LICENSE delete mode 100644 node_modules/has-value/node_modules/isobject/README.md delete mode 100644 node_modules/has-value/node_modules/isobject/index.d.ts delete mode 100644 node_modules/has-value/node_modules/isobject/index.js delete mode 100644 node_modules/has-value/node_modules/isobject/package.json delete mode 100644 node_modules/has-value/package.json delete mode 100644 node_modules/has-values/LICENSE delete mode 100644 node_modules/has-values/README.md delete mode 100644 node_modules/has-values/index.js delete mode 100644 node_modules/has-values/node_modules/is-number/LICENSE delete mode 100644 node_modules/has-values/node_modules/is-number/README.md delete mode 100644 node_modules/has-values/node_modules/is-number/index.js delete mode 100644 node_modules/has-values/node_modules/is-number/node_modules/kind-of/LICENSE delete mode 100644 node_modules/has-values/node_modules/is-number/node_modules/kind-of/README.md delete mode 100644 node_modules/has-values/node_modules/is-number/node_modules/kind-of/index.js delete mode 100644 node_modules/has-values/node_modules/is-number/node_modules/kind-of/package.json delete mode 100644 node_modules/has-values/node_modules/is-number/package.json delete mode 100644 node_modules/has-values/node_modules/kind-of/LICENSE delete mode 100644 node_modules/has-values/node_modules/kind-of/README.md delete mode 100644 node_modules/has-values/node_modules/kind-of/index.js delete mode 100644 node_modules/has-values/node_modules/kind-of/package.json delete mode 100644 node_modules/has-values/package.json delete mode 100644 node_modules/has/LICENSE-MIT delete mode 100644 node_modules/has/README.md delete mode 100644 node_modules/has/package.json delete mode 100644 node_modules/has/src/index.js delete mode 100644 node_modules/has/test/index.js delete mode 100644 node_modules/hash-base/LICENSE delete mode 100644 node_modules/hash-base/README.md delete mode 100644 node_modules/hash-base/index.js delete mode 100644 node_modules/hash-base/package.json delete mode 100644 node_modules/hash.js/.eslintrc.js delete mode 100644 node_modules/hash.js/.travis.yml delete mode 100644 node_modules/hash.js/README.md delete mode 100644 node_modules/hash.js/lib/hash.d.ts delete mode 100644 node_modules/hash.js/lib/hash.js delete mode 100644 node_modules/hash.js/lib/hash/common.js delete mode 100644 node_modules/hash.js/lib/hash/hmac.js delete mode 100644 node_modules/hash.js/lib/hash/ripemd.js delete mode 100644 node_modules/hash.js/lib/hash/sha.js delete mode 100644 node_modules/hash.js/lib/hash/sha/1.js delete mode 100644 node_modules/hash.js/lib/hash/sha/224.js delete mode 100644 node_modules/hash.js/lib/hash/sha/256.js delete mode 100644 node_modules/hash.js/lib/hash/sha/384.js delete mode 100644 node_modules/hash.js/lib/hash/sha/512.js delete mode 100644 node_modules/hash.js/lib/hash/sha/common.js delete mode 100644 node_modules/hash.js/lib/hash/utils.js delete mode 100644 node_modules/hash.js/package.json delete mode 100644 node_modules/hash.js/test/hash-test.js delete mode 100644 node_modules/hash.js/test/hmac-test.js delete mode 100644 node_modules/heap/.npmignore delete mode 100644 node_modules/heap/.travis.yml delete mode 100644 node_modules/heap/Makefile delete mode 100644 node_modules/heap/README.md delete mode 100644 node_modules/heap/bower.json delete mode 100644 node_modules/heap/index.js delete mode 100644 node_modules/heap/lib/heap.js delete mode 100644 node_modules/heap/package.json delete mode 100644 node_modules/heap/src/heap.coffee delete mode 100644 node_modules/heap/test/heap.test.coffee delete mode 100644 node_modules/hmac-drbg/.npmignore delete mode 100644 node_modules/hmac-drbg/.travis.yml delete mode 100644 node_modules/hmac-drbg/README.md delete mode 100644 node_modules/hmac-drbg/lib/hmac-drbg.js delete mode 100644 node_modules/hmac-drbg/package.json delete mode 100644 node_modules/hmac-drbg/test/drbg-test.js delete mode 100644 node_modules/hmac-drbg/test/fixtures/hmac-drbg-nist.json delete mode 100644 node_modules/htmlescape/.npmignore delete mode 100644 node_modules/htmlescape/CHANGELOG.md delete mode 100644 node_modules/htmlescape/LICENSE delete mode 100644 node_modules/htmlescape/README.md delete mode 100644 node_modules/htmlescape/htmlescape.js delete mode 100644 node_modules/htmlescape/package.json delete mode 100644 node_modules/http-errors/HISTORY.md delete mode 100644 node_modules/http-errors/LICENSE delete mode 100644 node_modules/http-errors/README.md delete mode 100644 node_modules/http-errors/index.js delete mode 100644 node_modules/http-errors/package.json delete mode 100644 node_modules/https-browserify/LICENSE delete mode 100644 node_modules/https-browserify/index.js delete mode 100644 node_modules/https-browserify/package.json delete mode 100644 node_modules/https-browserify/readme.markdown delete mode 100644 node_modules/hyperscript-attribute-to-property/LICENSE delete mode 100644 node_modules/hyperscript-attribute-to-property/README.md delete mode 100644 node_modules/hyperscript-attribute-to-property/index.js delete mode 100644 node_modules/hyperscript-attribute-to-property/package.json delete mode 100644 node_modules/hyperx/.travis.yml delete mode 100644 node_modules/hyperx/LICENSE delete mode 100644 node_modules/hyperx/bench/loop.js delete mode 100644 node_modules/hyperx/bench/raw.js delete mode 100644 node_modules/hyperx/example/deku/index.html delete mode 100644 node_modules/hyperx/example/deku/main.js delete mode 100644 node_modules/hyperx/example/deku/package.json delete mode 100644 node_modules/hyperx/example/hyperscript.js delete mode 100644 node_modules/hyperx/example/main_loop/index.html delete mode 100644 node_modules/hyperx/example/main_loop/main.js delete mode 100644 node_modules/hyperx/example/main_loop/package.json delete mode 100644 node_modules/hyperx/example/react.js delete mode 100644 node_modules/hyperx/example/react_browser/index.html delete mode 100644 node_modules/hyperx/example/react_browser/main.js delete mode 100644 node_modules/hyperx/example/react_browser/package.json delete mode 100644 node_modules/hyperx/example/vdom.js delete mode 100644 node_modules/hyperx/index.js delete mode 100644 node_modules/hyperx/package.json delete mode 100644 node_modules/hyperx/readme.markdown delete mode 100644 node_modules/hyperx/test/attr.js delete mode 100644 node_modules/hyperx/test/attr_to_prop.js delete mode 100644 node_modules/hyperx/test/br.js delete mode 100644 node_modules/hyperx/test/children.js delete mode 100644 node_modules/hyperx/test/comment.js delete mode 100644 node_modules/hyperx/test/concat.js delete mode 100644 node_modules/hyperx/test/esc.js delete mode 100644 node_modules/hyperx/test/ignore_surounding_whitespace.js delete mode 100644 node_modules/hyperx/test/key.js delete mode 100644 node_modules/hyperx/test/multi_elem_error.js delete mode 100644 node_modules/hyperx/test/style.js delete mode 100644 node_modules/hyperx/test/svg.js delete mode 100644 node_modules/hyperx/test/tags.js delete mode 100644 node_modules/hyperx/test/title.js delete mode 100644 node_modules/hyperx/test/types.js delete mode 100644 node_modules/hyperx/test/value.js delete mode 100644 node_modules/hyperx/test/vdom.js delete mode 100644 node_modules/hyperx/test/z_hyperscript.js delete mode 100644 node_modules/ieee754/LICENSE delete mode 100644 node_modules/ieee754/README.md delete mode 100644 node_modules/ieee754/index.js delete mode 100644 node_modules/ieee754/package.json delete mode 100644 node_modules/individual/.npmignore delete mode 100644 node_modules/individual/.travis.yml delete mode 100644 node_modules/individual/LICENCE delete mode 100644 node_modules/individual/README.md delete mode 100644 node_modules/individual/index.js delete mode 100644 node_modules/individual/one-version.js delete mode 100644 node_modules/individual/package.json delete mode 100644 node_modules/individual/test.js delete mode 100644 node_modules/inflight/LICENSE delete mode 100644 node_modules/inflight/README.md delete mode 100644 node_modules/inflight/inflight.js delete mode 100644 node_modules/inflight/package.json delete mode 100644 node_modules/inherits/LICENSE delete mode 100644 node_modules/inherits/README.md delete mode 100644 node_modules/inherits/inherits.js delete mode 100644 node_modules/inherits/inherits_browser.js delete mode 100644 node_modules/inherits/package.json delete mode 100644 node_modules/inject-lr-script/LICENSE.md delete mode 100644 node_modules/inject-lr-script/index.js delete mode 100644 node_modules/inject-lr-script/package.json delete mode 100644 node_modules/inline-source-map/.npmignore delete mode 100644 node_modules/inline-source-map/.travis.yml delete mode 100644 node_modules/inline-source-map/LICENSE delete mode 100644 node_modules/inline-source-map/README.md delete mode 100644 node_modules/inline-source-map/example/foo-bar.js delete mode 100644 node_modules/inline-source-map/index.js delete mode 100644 node_modules/inline-source-map/package.json delete mode 100644 node_modules/inline-source-map/test/inline-source-map.js delete mode 100644 node_modules/inline-source-map/test/source-content.js delete mode 100644 node_modules/insert-css/LICENSE delete mode 100644 node_modules/insert-css/example/bundle.js delete mode 100644 node_modules/insert-css/example/index.html delete mode 100644 node_modules/insert-css/example/insert.js delete mode 100644 node_modules/insert-css/example/style.css delete mode 100644 node_modules/insert-css/index.js delete mode 100644 node_modules/insert-css/package.json delete mode 100644 node_modules/insert-css/readme.markdown delete mode 100644 node_modules/insert-css/test/insert.js delete mode 100644 node_modules/insert-module-globals/.travis.yml delete mode 100644 node_modules/insert-module-globals/LICENSE delete mode 100644 node_modules/insert-module-globals/appveyor.yml delete mode 100644 node_modules/insert-module-globals/bench/.gitattributes delete mode 100644 node_modules/insert-module-globals/bench/index.js delete mode 100755 node_modules/insert-module-globals/bin/cmd.js delete mode 100644 node_modules/insert-module-globals/example/files/foo/index.js delete mode 100644 node_modules/insert-module-globals/example/files/main.js delete mode 100644 node_modules/insert-module-globals/example/insert.js delete mode 100644 node_modules/insert-module-globals/index.js delete mode 100644 node_modules/insert-module-globals/package.json delete mode 100644 node_modules/insert-module-globals/readme.markdown delete mode 100644 node_modules/insert-module-globals/test/always.js delete mode 100644 node_modules/insert-module-globals/test/always/custom_globals_without_defaults.js delete mode 100644 node_modules/insert-module-globals/test/always/hidden_from_quick_test.js delete mode 100644 node_modules/insert-module-globals/test/always/main.js delete mode 100644 node_modules/insert-module-globals/test/global.js delete mode 100644 node_modules/insert-module-globals/test/global/filename.js delete mode 100644 node_modules/insert-module-globals/test/global/main.js delete mode 100644 node_modules/insert-module-globals/test/immediate.js delete mode 100644 node_modules/insert-module-globals/test/immediate/main.js delete mode 100644 node_modules/insert-module-globals/test/insert.js delete mode 100644 node_modules/insert-module-globals/test/insert/buffer.js delete mode 100644 node_modules/insert-module-globals/test/insert/foo/buf.js delete mode 100644 node_modules/insert-module-globals/test/insert/foo/index.js delete mode 100644 node_modules/insert-module-globals/test/insert/main.js delete mode 100644 node_modules/insert-module-globals/test/isbuffer.js delete mode 100644 node_modules/insert-module-globals/test/isbuffer/both.js delete mode 100644 node_modules/insert-module-globals/test/isbuffer/main.js delete mode 100644 node_modules/insert-module-globals/test/isbuffer/new.js delete mode 100644 node_modules/insert-module-globals/test/return.js delete mode 100644 node_modules/insert-module-globals/test/return/foo/index.js delete mode 100644 node_modules/insert-module-globals/test/return/main.js delete mode 100644 node_modules/insert-module-globals/test/roots.js delete mode 100644 node_modules/insert-module-globals/test/roots/main.js delete mode 100644 node_modules/insert-module-globals/test/sourcemap.js delete mode 100644 node_modules/insert-module-globals/test/sourcemap/main.js delete mode 100644 node_modules/insert-module-globals/test/sourcemap/main_es6.js delete mode 100644 node_modules/insert-module-globals/test/subdir.js delete mode 100644 node_modules/insert-module-globals/test/subdir/main.js delete mode 100644 node_modules/insert-module-globals/test/subdir/node_modules/is-buffer/index.js delete mode 100644 node_modules/insert-module-globals/test/unprefix.js delete mode 100644 node_modules/insert-module-globals/test/unprefix/hello.js delete mode 100644 node_modules/insert-module-globals/test/unprefix/main.js delete mode 100644 node_modules/internal-ip/index.js delete mode 100644 node_modules/internal-ip/license delete mode 100644 node_modules/internal-ip/package.json delete mode 100644 node_modules/internal-ip/readme.md delete mode 100644 node_modules/ip-regex/index.js delete mode 100644 node_modules/ip-regex/license delete mode 100644 node_modules/ip-regex/package.json delete mode 100644 node_modules/ip-regex/readme.md delete mode 100644 node_modules/ipaddr.js/README.md delete mode 100644 node_modules/ipaddr.js/ipaddr.min.js delete mode 100644 node_modules/ipaddr.js/lib/ipaddr.js delete mode 100644 node_modules/ipaddr.js/lib/ipaddr.js.d.ts delete mode 100644 node_modules/ipaddr.js/package.json delete mode 100644 node_modules/is-accessor-descriptor/LICENSE delete mode 100644 node_modules/is-accessor-descriptor/README.md delete mode 100644 node_modules/is-accessor-descriptor/index.js delete mode 100644 node_modules/is-accessor-descriptor/package.json delete mode 100644 node_modules/is-binary-path/index.js delete mode 100644 node_modules/is-binary-path/license delete mode 100644 node_modules/is-binary-path/package.json delete mode 100644 node_modules/is-binary-path/readme.md delete mode 100644 node_modules/is-buffer/LICENSE delete mode 100644 node_modules/is-buffer/README.md delete mode 100644 node_modules/is-buffer/index.js delete mode 100644 node_modules/is-buffer/package.json delete mode 100644 node_modules/is-buffer/test/basic.js delete mode 100644 node_modules/is-data-descriptor/LICENSE delete mode 100644 node_modules/is-data-descriptor/README.md delete mode 100644 node_modules/is-data-descriptor/index.js delete mode 100644 node_modules/is-data-descriptor/package.json delete mode 100644 node_modules/is-descriptor/LICENSE delete mode 100644 node_modules/is-descriptor/README.md delete mode 100644 node_modules/is-descriptor/index.js delete mode 100644 node_modules/is-descriptor/node_modules/kind-of/LICENSE delete mode 100644 node_modules/is-descriptor/node_modules/kind-of/README.md delete mode 100644 node_modules/is-descriptor/node_modules/kind-of/index.js delete mode 100644 node_modules/is-descriptor/node_modules/kind-of/package.json delete mode 100644 node_modules/is-descriptor/package.json delete mode 100644 node_modules/is-dotfile/LICENSE delete mode 100644 node_modules/is-dotfile/README.md delete mode 100644 node_modules/is-dotfile/index.js delete mode 100644 node_modules/is-dotfile/package.json delete mode 100644 node_modules/is-electron/LICENSE delete mode 100644 node_modules/is-electron/README.md delete mode 100644 node_modules/is-electron/index.js delete mode 100644 node_modules/is-electron/package.json delete mode 100644 node_modules/is-equal-shallow/LICENSE delete mode 100644 node_modules/is-equal-shallow/README.md delete mode 100644 node_modules/is-equal-shallow/index.js delete mode 100644 node_modules/is-equal-shallow/package.json delete mode 100644 node_modules/is-extendable/LICENSE delete mode 100644 node_modules/is-extendable/README.md delete mode 100644 node_modules/is-extendable/index.js delete mode 100644 node_modules/is-extendable/package.json delete mode 100644 node_modules/is-extglob/LICENSE delete mode 100644 node_modules/is-extglob/README.md delete mode 100644 node_modules/is-extglob/index.js delete mode 100644 node_modules/is-extglob/package.json delete mode 100644 node_modules/is-finite/index.js delete mode 100644 node_modules/is-finite/license delete mode 100644 node_modules/is-finite/package.json delete mode 100644 node_modules/is-finite/readme.md delete mode 100644 node_modules/is-glob/LICENSE delete mode 100644 node_modules/is-glob/README.md delete mode 100644 node_modules/is-glob/index.js delete mode 100644 node_modules/is-glob/package.json delete mode 100644 node_modules/is-number/LICENSE delete mode 100644 node_modules/is-number/README.md delete mode 100644 node_modules/is-number/index.js delete mode 100644 node_modules/is-number/package.json delete mode 100644 node_modules/is-plain-object/LICENSE delete mode 100644 node_modules/is-plain-object/README.md delete mode 100644 node_modules/is-plain-object/index.d.ts delete mode 100644 node_modules/is-plain-object/index.js delete mode 100644 node_modules/is-plain-object/node_modules/isobject/LICENSE delete mode 100644 node_modules/is-plain-object/node_modules/isobject/README.md delete mode 100644 node_modules/is-plain-object/node_modules/isobject/index.d.ts delete mode 100644 node_modules/is-plain-object/node_modules/isobject/index.js delete mode 100644 node_modules/is-plain-object/node_modules/isobject/package.json delete mode 100644 node_modules/is-plain-object/package.json delete mode 100644 node_modules/is-posix-bracket/LICENSE delete mode 100644 node_modules/is-posix-bracket/README.md delete mode 100644 node_modules/is-posix-bracket/index.js delete mode 100644 node_modules/is-posix-bracket/package.json delete mode 100644 node_modules/is-primitive/LICENSE delete mode 100644 node_modules/is-primitive/README.md delete mode 100644 node_modules/is-primitive/index.js delete mode 100644 node_modules/is-primitive/package.json delete mode 100644 node_modules/is-stream/index.js delete mode 100644 node_modules/is-stream/license delete mode 100644 node_modules/is-stream/package.json delete mode 100644 node_modules/is-stream/readme.md delete mode 100644 node_modules/is-windows/LICENSE delete mode 100644 node_modules/is-windows/README.md delete mode 100644 node_modules/is-windows/index.js delete mode 100644 node_modules/is-windows/package.json delete mode 100644 node_modules/isarray/.npmignore delete mode 100644 node_modules/isarray/.travis.yml delete mode 100644 node_modules/isarray/Makefile delete mode 100644 node_modules/isarray/README.md delete mode 100644 node_modules/isarray/component.json delete mode 100644 node_modules/isarray/index.js delete mode 100644 node_modules/isarray/package.json delete mode 100644 node_modules/isarray/test.js delete mode 100644 node_modules/isexe/.npmignore delete mode 100644 node_modules/isexe/LICENSE delete mode 100644 node_modules/isexe/README.md delete mode 100644 node_modules/isexe/index.js delete mode 100644 node_modules/isexe/mode.js delete mode 100644 node_modules/isexe/package.json delete mode 100644 node_modules/isexe/test/basic.js delete mode 100644 node_modules/isexe/windows.js delete mode 100644 node_modules/isobject/LICENSE delete mode 100644 node_modules/isobject/README.md delete mode 100644 node_modules/isobject/index.js delete mode 100644 node_modules/isobject/package.json delete mode 100644 node_modules/json-stable-stringify/.travis.yml delete mode 100644 node_modules/json-stable-stringify/LICENSE delete mode 100644 node_modules/json-stable-stringify/example/key_cmp.js delete mode 100644 node_modules/json-stable-stringify/example/nested.js delete mode 100644 node_modules/json-stable-stringify/example/str.js delete mode 100644 node_modules/json-stable-stringify/example/value_cmp.js delete mode 100644 node_modules/json-stable-stringify/index.js delete mode 100644 node_modules/json-stable-stringify/package.json delete mode 100644 node_modules/json-stable-stringify/readme.markdown delete mode 100644 node_modules/json-stable-stringify/test/cmp.js delete mode 100644 node_modules/json-stable-stringify/test/nested.js delete mode 100644 node_modules/json-stable-stringify/test/str.js delete mode 100644 node_modules/json-stringify-safe/.npmignore delete mode 100644 node_modules/json-stringify-safe/CHANGELOG.md delete mode 100644 node_modules/json-stringify-safe/LICENSE delete mode 100644 node_modules/json-stringify-safe/Makefile delete mode 100644 node_modules/json-stringify-safe/README.md delete mode 100644 node_modules/json-stringify-safe/package.json delete mode 100644 node_modules/json-stringify-safe/stringify.js delete mode 100644 node_modules/json-stringify-safe/test/mocha.opts delete mode 100644 node_modules/json-stringify-safe/test/stringify_test.js delete mode 100644 node_modules/jsonify/README.markdown delete mode 100644 node_modules/jsonify/index.js delete mode 100644 node_modules/jsonify/lib/parse.js delete mode 100644 node_modules/jsonify/lib/stringify.js delete mode 100644 node_modules/jsonify/package.json delete mode 100644 node_modules/jsonify/test/parse.js delete mode 100644 node_modules/jsonify/test/stringify.js delete mode 100644 node_modules/jsonparse/.npmignore delete mode 100644 node_modules/jsonparse/LICENSE delete mode 100644 node_modules/jsonparse/README.markdown delete mode 100644 node_modules/jsonparse/bench.js delete mode 100644 node_modules/jsonparse/examples/twitterfeed.js delete mode 100644 node_modules/jsonparse/jsonparse.js delete mode 100644 node_modules/jsonparse/package.json delete mode 100644 node_modules/jsonparse/samplejson/basic.json delete mode 100644 node_modules/jsonparse/samplejson/basic2.json delete mode 100644 node_modules/jsonparse/test/big-token.js delete mode 100644 node_modules/jsonparse/test/boundary.js delete mode 100644 node_modules/jsonparse/test/offset.js delete mode 100644 node_modules/jsonparse/test/primitives.js delete mode 100644 node_modules/jsonparse/test/surrogate.js delete mode 100644 node_modules/jsonparse/test/unvalid.js delete mode 100644 node_modules/jsonparse/test/utf8.js delete mode 100644 node_modules/kind-of/LICENSE delete mode 100644 node_modules/kind-of/README.md delete mode 100644 node_modules/kind-of/index.js delete mode 100644 node_modules/kind-of/package.json delete mode 100644 node_modules/labeled-stream-splicer/.travis.yml delete mode 100644 node_modules/labeled-stream-splicer/LICENSE delete mode 100644 node_modules/labeled-stream-splicer/example/browser/bar.js delete mode 100644 node_modules/labeled-stream-splicer/example/browser/foo.js delete mode 100644 node_modules/labeled-stream-splicer/example/browser/main.js delete mode 100644 node_modules/labeled-stream-splicer/example/browser/xyz.js delete mode 100644 node_modules/labeled-stream-splicer/example/bundle.js delete mode 100644 node_modules/labeled-stream-splicer/index.js delete mode 100644 node_modules/labeled-stream-splicer/node_modules/isarray/README.md delete mode 100644 node_modules/labeled-stream-splicer/node_modules/isarray/index.js delete mode 100644 node_modules/labeled-stream-splicer/node_modules/isarray/package.json delete mode 100644 node_modules/labeled-stream-splicer/package.json delete mode 100644 node_modules/labeled-stream-splicer/readme.markdown delete mode 100644 node_modules/labeled-stream-splicer/test/bundle.js delete mode 100644 node_modules/labeled-stream-splicer/test/bundle/bar.js delete mode 100644 node_modules/labeled-stream-splicer/test/bundle/foo.js delete mode 100644 node_modules/labeled-stream-splicer/test/bundle/main.js delete mode 100644 node_modules/labeled-stream-splicer/test/bundle/xyz.js delete mode 100644 node_modules/lodash.debounce/LICENSE delete mode 100644 node_modules/lodash.debounce/README.md delete mode 100644 node_modules/lodash.debounce/index.js delete mode 100644 node_modules/lodash.debounce/package.json delete mode 100644 node_modules/lodash.memoize/LICENSE.txt delete mode 100644 node_modules/lodash.memoize/README.md delete mode 100644 node_modules/lodash.memoize/index.js delete mode 100644 node_modules/lodash.memoize/package.json delete mode 100644 node_modules/map-cache/LICENSE delete mode 100644 node_modules/map-cache/README.md delete mode 100644 node_modules/map-cache/index.js delete mode 100644 node_modules/map-cache/package.json delete mode 100644 node_modules/map-limit/LICENSE.md delete mode 100644 node_modules/map-limit/README.md delete mode 100644 node_modules/map-limit/index.js delete mode 100644 node_modules/map-limit/node_modules/once/LICENSE delete mode 100644 node_modules/map-limit/node_modules/once/README.md delete mode 100644 node_modules/map-limit/node_modules/once/once.js delete mode 100644 node_modules/map-limit/node_modules/once/package.json delete mode 100644 node_modules/map-limit/package.json delete mode 100644 node_modules/map-limit/test.js delete mode 100644 node_modules/map-visit/LICENSE delete mode 100644 node_modules/map-visit/README.md delete mode 100644 node_modules/map-visit/index.js delete mode 100644 node_modules/map-visit/package.json delete mode 100644 node_modules/math-random/.npmignore delete mode 100644 node_modules/math-random/.travis.yml delete mode 100644 node_modules/math-random/browser.js delete mode 100644 node_modules/math-random/node.js delete mode 100644 node_modules/math-random/package.json delete mode 100644 node_modules/math-random/readme.md delete mode 100644 node_modules/math-random/test.js delete mode 100644 node_modules/md5.js/LICENSE delete mode 100644 node_modules/md5.js/README.md delete mode 100644 node_modules/md5.js/index.js delete mode 100644 node_modules/md5.js/package.json delete mode 100644 node_modules/md5/.npmignore delete mode 100644 node_modules/md5/.travis.yml delete mode 100644 node_modules/md5/LICENSE delete mode 100644 node_modules/md5/README.md delete mode 100644 node_modules/md5/md5.js delete mode 100644 node_modules/md5/package.json delete mode 100644 node_modules/md5/test.js delete mode 100755 node_modules/micromatch/LICENSE delete mode 100644 node_modules/micromatch/README.md delete mode 100755 node_modules/micromatch/index.js delete mode 100644 node_modules/micromatch/lib/chars.js delete mode 100644 node_modules/micromatch/lib/expand.js delete mode 100644 node_modules/micromatch/lib/glob.js delete mode 100644 node_modules/micromatch/lib/utils.js delete mode 100644 node_modules/micromatch/package.json delete mode 100644 node_modules/miller-rabin/.npmignore delete mode 100644 node_modules/miller-rabin/1.js delete mode 100644 node_modules/miller-rabin/README.md delete mode 100755 node_modules/miller-rabin/bin/miller-rabin delete mode 100644 node_modules/miller-rabin/lib/mr.js delete mode 100644 node_modules/miller-rabin/package.json delete mode 100644 node_modules/miller-rabin/test.js delete mode 100644 node_modules/miller-rabin/test/api-test.js delete mode 100644 node_modules/mime/LICENSE delete mode 100644 node_modules/mime/README.md delete mode 100644 node_modules/mime/build/build.js delete mode 100644 node_modules/mime/build/test.js delete mode 100755 node_modules/mime/cli.js delete mode 100644 node_modules/mime/mime.js delete mode 100644 node_modules/mime/package.json delete mode 100644 node_modules/mime/types.json delete mode 100644 node_modules/minimalistic-assert/LICENSE delete mode 100644 node_modules/minimalistic-assert/index.js delete mode 100644 node_modules/minimalistic-assert/package.json delete mode 100644 node_modules/minimalistic-assert/readme.md delete mode 100644 node_modules/minimalistic-crypto-utils/.npmignore delete mode 100644 node_modules/minimalistic-crypto-utils/.travis.yml delete mode 100644 node_modules/minimalistic-crypto-utils/README.md delete mode 100644 node_modules/minimalistic-crypto-utils/lib/utils.js delete mode 100644 node_modules/minimalistic-crypto-utils/package.json delete mode 100644 node_modules/minimalistic-crypto-utils/test/utils-test.js delete mode 100644 node_modules/minimatch/LICENSE delete mode 100644 node_modules/minimatch/README.md delete mode 100644 node_modules/minimatch/minimatch.js delete mode 100644 node_modules/minimatch/package.json delete mode 100644 node_modules/minimist/.travis.yml delete mode 100644 node_modules/minimist/LICENSE delete mode 100644 node_modules/minimist/example/parse.js delete mode 100644 node_modules/minimist/index.js delete mode 100644 node_modules/minimist/package.json delete mode 100644 node_modules/minimist/readme.markdown delete mode 100644 node_modules/minimist/test/all_bool.js delete mode 100644 node_modules/minimist/test/bool.js delete mode 100644 node_modules/minimist/test/dash.js delete mode 100644 node_modules/minimist/test/default_bool.js delete mode 100644 node_modules/minimist/test/dotted.js delete mode 100644 node_modules/minimist/test/kv_short.js delete mode 100644 node_modules/minimist/test/long.js delete mode 100644 node_modules/minimist/test/num.js delete mode 100644 node_modules/minimist/test/parse.js delete mode 100644 node_modules/minimist/test/parse_modified.js delete mode 100644 node_modules/minimist/test/short.js delete mode 100644 node_modules/minimist/test/stop_early.js delete mode 100644 node_modules/minimist/test/unknown.js delete mode 100644 node_modules/minimist/test/whitespace.js delete mode 100644 node_modules/mixin-deep/LICENSE delete mode 100644 node_modules/mixin-deep/README.md delete mode 100644 node_modules/mixin-deep/index.js delete mode 100644 node_modules/mixin-deep/node_modules/is-extendable/LICENSE delete mode 100644 node_modules/mixin-deep/node_modules/is-extendable/README.md delete mode 100644 node_modules/mixin-deep/node_modules/is-extendable/index.d.ts delete mode 100644 node_modules/mixin-deep/node_modules/is-extendable/index.js delete mode 100644 node_modules/mixin-deep/node_modules/is-extendable/package.json delete mode 100644 node_modules/mixin-deep/package.json delete mode 100644 node_modules/mkdirp/.travis.yml delete mode 100644 node_modules/mkdirp/LICENSE delete mode 100755 node_modules/mkdirp/bin/cmd.js delete mode 100644 node_modules/mkdirp/bin/usage.txt delete mode 100644 node_modules/mkdirp/examples/pow.js delete mode 100644 node_modules/mkdirp/index.js delete mode 100644 node_modules/mkdirp/node_modules/minimist/.travis.yml delete mode 100644 node_modules/mkdirp/node_modules/minimist/LICENSE delete mode 100644 node_modules/mkdirp/node_modules/minimist/example/parse.js delete mode 100644 node_modules/mkdirp/node_modules/minimist/index.js delete mode 100644 node_modules/mkdirp/node_modules/minimist/package.json delete mode 100644 node_modules/mkdirp/node_modules/minimist/readme.markdown delete mode 100644 node_modules/mkdirp/node_modules/minimist/test/dash.js delete mode 100644 node_modules/mkdirp/node_modules/minimist/test/default_bool.js delete mode 100644 node_modules/mkdirp/node_modules/minimist/test/dotted.js delete mode 100644 node_modules/mkdirp/node_modules/minimist/test/long.js delete mode 100644 node_modules/mkdirp/node_modules/minimist/test/parse.js delete mode 100644 node_modules/mkdirp/node_modules/minimist/test/parse_modified.js delete mode 100644 node_modules/mkdirp/node_modules/minimist/test/short.js delete mode 100644 node_modules/mkdirp/node_modules/minimist/test/whitespace.js delete mode 100644 node_modules/mkdirp/package.json delete mode 100644 node_modules/mkdirp/readme.markdown delete mode 100644 node_modules/mkdirp/test/chmod.js delete mode 100644 node_modules/mkdirp/test/clobber.js delete mode 100644 node_modules/mkdirp/test/mkdirp.js delete mode 100644 node_modules/mkdirp/test/opts_fs.js delete mode 100644 node_modules/mkdirp/test/opts_fs_sync.js delete mode 100644 node_modules/mkdirp/test/perm.js delete mode 100644 node_modules/mkdirp/test/perm_sync.js delete mode 100644 node_modules/mkdirp/test/race.js delete mode 100644 node_modules/mkdirp/test/rel.js delete mode 100644 node_modules/mkdirp/test/return.js delete mode 100644 node_modules/mkdirp/test/return_sync.js delete mode 100644 node_modules/mkdirp/test/root.js delete mode 100644 node_modules/mkdirp/test/sync.js delete mode 100644 node_modules/mkdirp/test/umask.js delete mode 100644 node_modules/mkdirp/test/umask_sync.js delete mode 100644 node_modules/module-deps/.travis.yml delete mode 100644 node_modules/module-deps/CHANGELOG.md delete mode 100644 node_modules/module-deps/LICENSE delete mode 100755 node_modules/module-deps/bin/cmd.js delete mode 100644 node_modules/module-deps/bin/usage.txt delete mode 100644 node_modules/module-deps/example/deps.js delete mode 100644 node_modules/module-deps/example/files/bar.js delete mode 100644 node_modules/module-deps/example/files/foo.js delete mode 100644 node_modules/module-deps/example/files/main.js delete mode 100644 node_modules/module-deps/example/files/xyz.js delete mode 100644 node_modules/module-deps/index.js delete mode 100644 node_modules/module-deps/package.json delete mode 100644 node_modules/module-deps/readme.markdown delete mode 100644 node_modules/module-deps/test/bundle.js delete mode 100644 node_modules/module-deps/test/cache.js delete mode 100644 node_modules/module-deps/test/cache_expose.js delete mode 100644 node_modules/module-deps/test/cache_partial.js delete mode 100644 node_modules/module-deps/test/cache_partial_expose.js delete mode 100644 node_modules/module-deps/test/cache_persistent.js delete mode 100644 node_modules/module-deps/test/cache_persistent/error_transform.js delete mode 100644 node_modules/module-deps/test/cycle.js delete mode 100644 node_modules/module-deps/test/cycle/bar.js delete mode 100644 node_modules/module-deps/test/cycle/foo.js delete mode 100644 node_modules/module-deps/test/cycle/main.js delete mode 100644 node_modules/module-deps/test/deps.js delete mode 100644 node_modules/module-deps/test/detect.js delete mode 100644 node_modules/module-deps/test/dotdot.js delete mode 100644 node_modules/module-deps/test/dotdot/abc/index.js delete mode 100644 node_modules/module-deps/test/dotdot/index.js delete mode 100644 node_modules/module-deps/test/expose.js delete mode 100644 node_modules/module-deps/test/expose/bar.js delete mode 100644 node_modules/module-deps/test/expose/foo.js delete mode 100644 node_modules/module-deps/test/expose/lib/abc.js delete mode 100644 node_modules/module-deps/test/expose/lib/xyz.js delete mode 100644 node_modules/module-deps/test/expose/main.js delete mode 100644 node_modules/module-deps/test/file_cache.js delete mode 100644 node_modules/module-deps/test/files/bar.js delete mode 100644 node_modules/module-deps/test/files/extra.js delete mode 100644 node_modules/module-deps/test/files/filterable.js delete mode 100644 node_modules/module-deps/test/files/foo.js delete mode 100644 node_modules/module-deps/test/files/main.js delete mode 100644 node_modules/module-deps/test/files/pkg_filter/one.js delete mode 100644 node_modules/module-deps/test/files/pkg_filter/package.json delete mode 100644 node_modules/module-deps/test/files/pkg_filter/test.js delete mode 100644 node_modules/module-deps/test/files/pkg_filter/two.js delete mode 100644 node_modules/module-deps/test/files/quotes/bar.js delete mode 100644 node_modules/module-deps/test/files/quotes/baz.js delete mode 100644 node_modules/module-deps/test/files/quotes/foo.js delete mode 100644 node_modules/module-deps/test/files/quotes/main.js delete mode 100644 node_modules/module-deps/test/files/syntax_error.js delete mode 100644 node_modules/module-deps/test/files/tr_2dep_module/f.js delete mode 100644 node_modules/module-deps/test/files/tr_2dep_module/main.js delete mode 100644 node_modules/module-deps/test/files/tr_global/main.js delete mode 100644 node_modules/module-deps/test/files/tr_global/package.json delete mode 100644 node_modules/module-deps/test/files/tr_module/f.js delete mode 100644 node_modules/module-deps/test/files/tr_module/index.js delete mode 100644 node_modules/module-deps/test/files/tr_module/main.js delete mode 100644 node_modules/module-deps/test/files/tr_module/package.json delete mode 100644 node_modules/module-deps/test/files/tr_module/xxx.js delete mode 100644 node_modules/module-deps/test/files/tr_no_entry/main.js delete mode 100644 node_modules/module-deps/test/files/tr_rel/package.json delete mode 100644 node_modules/module-deps/test/files/tr_rel/subdir/main.js delete mode 100644 node_modules/module-deps/test/files/tr_rel/xxx.js delete mode 100644 node_modules/module-deps/test/files/tr_sh/f.js delete mode 100644 node_modules/module-deps/test/files/tr_sh/main.js delete mode 100644 node_modules/module-deps/test/files/tr_sh/tr_a.js delete mode 100644 node_modules/module-deps/test/files/tr_sh/tr_b.js delete mode 100644 node_modules/module-deps/test/files/tr_whole_package/f.js delete mode 100644 node_modules/module-deps/test/files/tr_whole_package/main.js delete mode 100644 node_modules/module-deps/test/files/transformdeps.js delete mode 100644 node_modules/module-deps/test/files/unicode/bar.js delete mode 100644 node_modules/module-deps/test/files/unicode/foo.js delete mode 100644 node_modules/module-deps/test/files/unicode/main.js delete mode 100644 node_modules/module-deps/test/files/xyz.js delete mode 100644 node_modules/module-deps/test/filter.js delete mode 100644 node_modules/module-deps/test/ignore_missing.js delete mode 100644 node_modules/module-deps/test/ignore_missing/main.js delete mode 100644 node_modules/module-deps/test/ignore_missing/other.js delete mode 100644 node_modules/module-deps/test/ignore_missing_cache.js delete mode 100644 node_modules/module-deps/test/invalid_pkg.js delete mode 100644 node_modules/module-deps/test/invalid_pkg/file.js delete mode 100644 node_modules/module-deps/test/invalid_pkg/index.js delete mode 100644 node_modules/module-deps/test/invalid_pkg/package.json delete mode 100644 node_modules/module-deps/test/noparse.js delete mode 100644 node_modules/module-deps/test/noparse_row.js delete mode 100644 node_modules/module-deps/test/pkg.js delete mode 100644 node_modules/module-deps/test/pkg/main.js delete mode 100644 node_modules/module-deps/test/pkg/package.json delete mode 100644 node_modules/module-deps/test/pkg_filter.js delete mode 100644 node_modules/module-deps/test/quotes.js delete mode 100644 node_modules/module-deps/test/row_expose.js delete mode 100644 node_modules/module-deps/test/row_expose_name_is_file_transform.js delete mode 100644 node_modules/module-deps/test/row_expose_transform.js delete mode 100644 node_modules/module-deps/test/source.js delete mode 100644 node_modules/module-deps/test/syntax.js delete mode 100644 node_modules/module-deps/test/tr_2dep_module.js delete mode 100644 node_modules/module-deps/test/tr_deps.js delete mode 100644 node_modules/module-deps/test/tr_err.js delete mode 100644 node_modules/module-deps/test/tr_flags.js delete mode 100644 node_modules/module-deps/test/tr_flags/empty.js delete mode 100644 node_modules/module-deps/test/tr_fn.js delete mode 100644 node_modules/module-deps/test/tr_global.js delete mode 100644 node_modules/module-deps/test/tr_module.js delete mode 100644 node_modules/module-deps/test/tr_no_entry.js delete mode 100644 node_modules/module-deps/test/tr_opts.js delete mode 100644 node_modules/module-deps/test/tr_opts/main.js delete mode 100644 node_modules/module-deps/test/tr_opts/package.json delete mode 100644 node_modules/module-deps/test/tr_rel.js delete mode 100644 node_modules/module-deps/test/tr_sh.js delete mode 100644 node_modules/module-deps/test/tr_whole_package.js delete mode 100644 node_modules/module-deps/test/tr_write.js delete mode 100644 node_modules/module-deps/test/tr_write/main.js delete mode 100644 node_modules/module-deps/test/undef_file.js delete mode 100644 node_modules/module-deps/test/unicode.js delete mode 100644 node_modules/ms/index.js delete mode 100644 node_modules/ms/license.md delete mode 100644 node_modules/ms/package.json delete mode 100644 node_modules/ms/readme.md delete mode 100644 node_modules/nanomatch/CHANGELOG.md delete mode 100644 node_modules/nanomatch/LICENSE delete mode 100644 node_modules/nanomatch/README.md delete mode 100644 node_modules/nanomatch/index.js delete mode 100644 node_modules/nanomatch/lib/cache.js delete mode 100644 node_modules/nanomatch/lib/compilers.js delete mode 100644 node_modules/nanomatch/lib/parsers.js delete mode 100644 node_modules/nanomatch/lib/utils.js delete mode 100755 node_modules/nanomatch/node_modules/arr-diff/LICENSE delete mode 100644 node_modules/nanomatch/node_modules/arr-diff/README.md delete mode 100644 node_modules/nanomatch/node_modules/arr-diff/index.js delete mode 100644 node_modules/nanomatch/node_modules/arr-diff/package.json delete mode 100755 node_modules/nanomatch/node_modules/array-unique/LICENSE delete mode 100755 node_modules/nanomatch/node_modules/array-unique/README.md delete mode 100644 node_modules/nanomatch/node_modules/array-unique/index.js delete mode 100644 node_modules/nanomatch/node_modules/array-unique/package.json delete mode 100644 node_modules/nanomatch/node_modules/kind-of/CHANGELOG.md delete mode 100644 node_modules/nanomatch/node_modules/kind-of/LICENSE delete mode 100644 node_modules/nanomatch/node_modules/kind-of/README.md delete mode 100644 node_modules/nanomatch/node_modules/kind-of/index.js delete mode 100644 node_modules/nanomatch/node_modules/kind-of/package.json delete mode 100644 node_modules/nanomatch/package.json delete mode 100644 node_modules/nice-try/CHANGELOG.md delete mode 100644 node_modules/nice-try/LICENSE delete mode 100644 node_modules/nice-try/README.md delete mode 100644 node_modules/nice-try/package.json delete mode 100644 node_modules/nice-try/src/index.js delete mode 100644 node_modules/normalize-path/LICENSE delete mode 100644 node_modules/normalize-path/README.md delete mode 100644 node_modules/normalize-path/index.js delete mode 100644 node_modules/normalize-path/package.json delete mode 100644 node_modules/npm-run-path/index.js delete mode 100644 node_modules/npm-run-path/license delete mode 100644 node_modules/npm-run-path/package.json delete mode 100644 node_modules/npm-run-path/readme.md delete mode 100644 node_modules/number-is-nan/index.js delete mode 100644 node_modules/number-is-nan/license delete mode 100644 node_modules/number-is-nan/package.json delete mode 100644 node_modules/number-is-nan/readme.md delete mode 100644 node_modules/object-assign/index.js delete mode 100644 node_modules/object-assign/license delete mode 100644 node_modules/object-assign/package.json delete mode 100644 node_modules/object-assign/readme.md delete mode 100644 node_modules/object-copy/LICENSE delete mode 100644 node_modules/object-copy/index.js delete mode 100644 node_modules/object-copy/node_modules/define-property/LICENSE delete mode 100644 node_modules/object-copy/node_modules/define-property/README.md delete mode 100644 node_modules/object-copy/node_modules/define-property/index.js delete mode 100644 node_modules/object-copy/node_modules/define-property/package.json delete mode 100644 node_modules/object-copy/package.json delete mode 100644 node_modules/object-visit/LICENSE delete mode 100644 node_modules/object-visit/README.md delete mode 100644 node_modules/object-visit/index.js delete mode 100644 node_modules/object-visit/node_modules/isobject/LICENSE delete mode 100644 node_modules/object-visit/node_modules/isobject/README.md delete mode 100644 node_modules/object-visit/node_modules/isobject/index.d.ts delete mode 100644 node_modules/object-visit/node_modules/isobject/index.js delete mode 100644 node_modules/object-visit/node_modules/isobject/package.json delete mode 100644 node_modules/object-visit/package.json delete mode 100644 node_modules/object.omit/LICENSE delete mode 100644 node_modules/object.omit/README.md delete mode 100644 node_modules/object.omit/index.js delete mode 100644 node_modules/object.omit/package.json delete mode 100644 node_modules/object.pick/LICENSE delete mode 100644 node_modules/object.pick/README.md delete mode 100644 node_modules/object.pick/index.js delete mode 100644 node_modules/object.pick/node_modules/isobject/LICENSE delete mode 100644 node_modules/object.pick/node_modules/isobject/README.md delete mode 100644 node_modules/object.pick/node_modules/isobject/index.d.ts delete mode 100644 node_modules/object.pick/node_modules/isobject/index.js delete mode 100644 node_modules/object.pick/node_modules/isobject/package.json delete mode 100644 node_modules/object.pick/package.json delete mode 100644 node_modules/on-finished/HISTORY.md delete mode 100644 node_modules/on-finished/LICENSE delete mode 100644 node_modules/on-finished/README.md delete mode 100644 node_modules/on-finished/index.js delete mode 100644 node_modules/on-finished/package.json delete mode 100644 node_modules/on-headers/HISTORY.md delete mode 100644 node_modules/on-headers/LICENSE delete mode 100644 node_modules/on-headers/README.md delete mode 100644 node_modules/on-headers/index.js delete mode 100644 node_modules/on-headers/package.json delete mode 100644 node_modules/once/LICENSE delete mode 100644 node_modules/once/README.md delete mode 100644 node_modules/once/once.js delete mode 100644 node_modules/once/package.json delete mode 100644 node_modules/opn/index.js delete mode 100644 node_modules/opn/license delete mode 100644 node_modules/opn/package.json delete mode 100644 node_modules/opn/readme.md delete mode 100755 node_modules/opn/xdg-open delete mode 100644 node_modules/options/.npmignore delete mode 100644 node_modules/options/Makefile delete mode 100644 node_modules/options/README.md delete mode 100644 node_modules/options/lib/options.js delete mode 100644 node_modules/options/package.json delete mode 100644 node_modules/os-browserify/.npmignore delete mode 100644 node_modules/os-browserify/LICENSE delete mode 100644 node_modules/os-browserify/README.md delete mode 100644 node_modules/os-browserify/browser.js delete mode 100644 node_modules/os-browserify/main.js delete mode 100644 node_modules/os-browserify/package.json delete mode 100644 node_modules/os-tmpdir/index.js delete mode 100644 node_modules/os-tmpdir/license delete mode 100644 node_modules/os-tmpdir/package.json delete mode 100644 node_modules/os-tmpdir/readme.md delete mode 100644 node_modules/outpipe/.npmignore delete mode 100644 node_modules/outpipe/LICENSE delete mode 100755 node_modules/outpipe/bin/echo.js delete mode 100644 node_modules/outpipe/example/input/x.js delete mode 100644 node_modules/outpipe/example/input/y.js delete mode 100644 node_modules/outpipe/example/input/z.js delete mode 100644 node_modules/outpipe/example/watch.js delete mode 100644 node_modules/outpipe/index.js delete mode 100644 node_modules/outpipe/package.json delete mode 100644 node_modules/outpipe/readme.markdown delete mode 100644 node_modules/outpipe/test/cmd.js delete mode 100644 node_modules/outpipe/test/outfile.js delete mode 100644 node_modules/p-finally/index.js delete mode 100644 node_modules/p-finally/license delete mode 100644 node_modules/p-finally/package.json delete mode 100644 node_modules/p-finally/readme.md delete mode 100644 node_modules/pad-left/LICENSE delete mode 100644 node_modules/pad-left/README.md delete mode 100755 node_modules/pad-left/index.js delete mode 100644 node_modules/pad-left/package.json delete mode 100644 node_modules/pad-right/LICENSE delete mode 100644 node_modules/pad-right/README.md delete mode 100644 node_modules/pad-right/index.js delete mode 100644 node_modules/pad-right/package.json delete mode 100644 node_modules/pako/CHANGELOG.md delete mode 100644 node_modules/pako/LICENSE delete mode 100644 node_modules/pako/README.md delete mode 100644 node_modules/pako/dist/pako.js delete mode 100644 node_modules/pako/dist/pako.min.js delete mode 100644 node_modules/pako/dist/pako_deflate.js delete mode 100644 node_modules/pako/dist/pako_deflate.min.js delete mode 100644 node_modules/pako/dist/pako_inflate.js delete mode 100644 node_modules/pako/dist/pako_inflate.min.js delete mode 100644 node_modules/pako/index.js delete mode 100644 node_modules/pako/lib/deflate.js delete mode 100644 node_modules/pako/lib/inflate.js delete mode 100644 node_modules/pako/lib/utils/common.js delete mode 100644 node_modules/pako/lib/utils/strings.js delete mode 100644 node_modules/pako/lib/zlib/README delete mode 100644 node_modules/pako/lib/zlib/adler32.js delete mode 100644 node_modules/pako/lib/zlib/constants.js delete mode 100644 node_modules/pako/lib/zlib/crc32.js delete mode 100644 node_modules/pako/lib/zlib/deflate.js delete mode 100644 node_modules/pako/lib/zlib/gzheader.js delete mode 100644 node_modules/pako/lib/zlib/inffast.js delete mode 100644 node_modules/pako/lib/zlib/inflate.js delete mode 100644 node_modules/pako/lib/zlib/inftrees.js delete mode 100644 node_modules/pako/lib/zlib/messages.js delete mode 100644 node_modules/pako/lib/zlib/trees.js delete mode 100644 node_modules/pako/lib/zlib/zstream.js delete mode 100644 node_modules/pako/package.json delete mode 100644 node_modules/parents/.travis.yml delete mode 100644 node_modules/parents/LICENSE delete mode 100644 node_modules/parents/example/dirname.js delete mode 100644 node_modules/parents/example/win32.js delete mode 100644 node_modules/parents/index.js delete mode 100644 node_modules/parents/package.json delete mode 100644 node_modules/parents/readme.markdown delete mode 100644 node_modules/parents/test/dirname.js delete mode 100644 node_modules/parents/test/win32.js delete mode 100644 node_modules/parse-asn1/.travis.yml delete mode 100644 node_modules/parse-asn1/LICENSE delete mode 100644 node_modules/parse-asn1/README.md delete mode 100644 node_modules/parse-asn1/aesid.json delete mode 100644 node_modules/parse-asn1/asn1.js delete mode 100644 node_modules/parse-asn1/certificate.js delete mode 100644 node_modules/parse-asn1/fixProc.js delete mode 100644 node_modules/parse-asn1/index.js delete mode 100644 node_modules/parse-asn1/package-lock.json.1909017369 delete mode 100644 node_modules/parse-asn1/package.json delete mode 100644 node_modules/parse-asn1/test/1024.priv delete mode 100644 node_modules/parse-asn1/test/1024.pub delete mode 100644 node_modules/parse-asn1/test/dsa.1024.priv delete mode 100644 node_modules/parse-asn1/test/dsa.1024.pub delete mode 100644 node_modules/parse-asn1/test/dsa.2048.priv delete mode 100644 node_modules/parse-asn1/test/dsa.2048.pub delete mode 100644 node_modules/parse-asn1/test/ec.pass.priv delete mode 100644 node_modules/parse-asn1/test/ec.priv delete mode 100644 node_modules/parse-asn1/test/ec.pub delete mode 100644 node_modules/parse-asn1/test/index.js delete mode 100644 node_modules/parse-asn1/test/node.cert delete mode 100644 node_modules/parse-asn1/test/pass.1024.priv delete mode 100644 node_modules/parse-asn1/test/pass.1024.pub delete mode 100644 node_modules/parse-asn1/test/pass.dsa.1024.priv delete mode 100644 node_modules/parse-asn1/test/pass.dsa.1024.pub delete mode 100644 node_modules/parse-asn1/test/pass.rsa.1024.priv delete mode 100644 node_modules/parse-asn1/test/pass.rsa.1024.pub delete mode 100644 node_modules/parse-asn1/test/pass.rsa.2028.priv delete mode 100644 node_modules/parse-asn1/test/pass.rsa.2028.pub delete mode 100644 node_modules/parse-asn1/test/pass2.dsa.1024.priv delete mode 100644 node_modules/parse-asn1/test/pass2.dsa.1024.pub delete mode 100644 node_modules/parse-asn1/test/rsa.1024.priv delete mode 100644 node_modules/parse-asn1/test/rsa.1024.pub delete mode 100644 node_modules/parse-asn1/test/rsa.2028.priv delete mode 100644 node_modules/parse-asn1/test/rsa.2028.pub delete mode 100644 node_modules/parse-asn1/test/vector.js delete mode 100644 node_modules/parse-asn1/test/vector.priv delete mode 100644 node_modules/parse-asn1/test/vector2.priv delete mode 100644 node_modules/parse-glob/LICENSE delete mode 100644 node_modules/parse-glob/README.md delete mode 100644 node_modules/parse-glob/index.js delete mode 100644 node_modules/parse-glob/package.json delete mode 100644 node_modules/parse-ms/index.js delete mode 100644 node_modules/parse-ms/license delete mode 100644 node_modules/parse-ms/package.json delete mode 100644 node_modules/parse-ms/readme.md delete mode 100644 node_modules/parseurl/HISTORY.md delete mode 100644 node_modules/parseurl/LICENSE delete mode 100644 node_modules/parseurl/README.md delete mode 100644 node_modules/parseurl/index.js delete mode 100644 node_modules/parseurl/package.json delete mode 100644 node_modules/pascalcase/LICENSE delete mode 100644 node_modules/pascalcase/README.md delete mode 100644 node_modules/pascalcase/index.js delete mode 100644 node_modules/pascalcase/package.json delete mode 100644 node_modules/path-browserify/LICENSE delete mode 100644 node_modules/path-browserify/index.js delete mode 100644 node_modules/path-browserify/package.json delete mode 100644 node_modules/path-browserify/readme.markdown delete mode 100644 node_modules/path-browserify/test/test-path.js delete mode 100644 node_modules/path-is-absolute/index.js delete mode 100644 node_modules/path-is-absolute/license delete mode 100644 node_modules/path-is-absolute/package.json delete mode 100644 node_modules/path-is-absolute/readme.md delete mode 100644 node_modules/path-key/index.js delete mode 100644 node_modules/path-key/license delete mode 100644 node_modules/path-key/package.json delete mode 100644 node_modules/path-key/readme.md delete mode 100644 node_modules/path-parse/.travis.yml delete mode 100644 node_modules/path-parse/LICENSE delete mode 100644 node_modules/path-parse/README.md delete mode 100644 node_modules/path-parse/index.js delete mode 100644 node_modules/path-parse/package.json delete mode 100644 node_modules/path-parse/test.js delete mode 100644 node_modules/path-platform/LICENSE delete mode 100644 node_modules/path-platform/README.md delete mode 100644 node_modules/path-platform/package.json delete mode 100644 node_modules/path-platform/path.js delete mode 100644 node_modules/pbkdf2/LICENSE delete mode 100644 node_modules/pbkdf2/README.md delete mode 100644 node_modules/pbkdf2/browser.js delete mode 100644 node_modules/pbkdf2/index.js delete mode 100644 node_modules/pbkdf2/lib/async.js delete mode 100644 node_modules/pbkdf2/lib/default-encoding.js delete mode 100644 node_modules/pbkdf2/lib/precondition.js delete mode 100644 node_modules/pbkdf2/lib/sync-browser.js delete mode 100644 node_modules/pbkdf2/lib/sync.js delete mode 100644 node_modules/pbkdf2/package.json delete mode 100644 node_modules/pelo/README.md delete mode 100644 node_modules/pelo/app.js delete mode 100644 node_modules/pelo/bundle.js delete mode 100644 node_modules/pelo/client.js delete mode 100644 node_modules/pelo/index.js delete mode 100644 node_modules/pelo/package.json delete mode 100644 node_modules/pelo/server.js delete mode 100644 node_modules/pelo/yarn.lock delete mode 100644 node_modules/pem/.eslintignore delete mode 100644 node_modules/pem/.eslintrc.js delete mode 100644 node_modules/pem/.travis.yml delete mode 100644 node_modules/pem/CHANGELOG.md delete mode 100644 node_modules/pem/CODE_OF_CONDUCT.md delete mode 100644 node_modules/pem/CONTRIBUTING.md delete mode 100644 node_modules/pem/HISTORY.md delete mode 100644 node_modules/pem/LICENSE delete mode 100644 node_modules/pem/README.md delete mode 100755 node_modules/pem/bin/test_build_openssl.sh delete mode 100644 node_modules/pem/jsdoc.json delete mode 100644 node_modules/pem/lib/convert.js delete mode 100644 node_modules/pem/lib/helper.js delete mode 100644 node_modules/pem/lib/openssl.js delete mode 100644 node_modules/pem/lib/pem.js delete mode 100644 node_modules/pem/mocha.opts delete mode 100644 node_modules/pem/package.json delete mode 100644 node_modules/pem/test/convert.spec.js delete mode 100644 node_modules/pem/test/fixtures/GeoTrust_Primary_CA.pem delete mode 100644 node_modules/pem/test/fixtures/cn_openssl.crt delete mode 100644 node_modules/pem/test/fixtures/cn_openssl.csr delete mode 100644 node_modules/pem/test/fixtures/cn_openssl.key delete mode 100644 node_modules/pem/test/fixtures/cn_openssl_config.conf delete mode 100644 node_modules/pem/test/fixtures/google.com.pem delete mode 100644 node_modules/pem/test/fixtures/idsrv3test.pfx delete mode 100644 node_modules/pem/test/fixtures/inclpkey.pem delete mode 100644 node_modules/pem/test/fixtures/nopkey.der delete mode 100644 node_modules/pem/test/fixtures/nopkey.pem delete mode 100644 node_modules/pem/test/fixtures/pem196.pem delete mode 100644 node_modules/pem/test/fixtures/ru_openssl.crt delete mode 100644 node_modules/pem/test/fixtures/ru_openssl.csr delete mode 100644 node_modules/pem/test/fixtures/ru_openssl.key delete mode 100644 node_modules/pem/test/fixtures/ru_openssl_config.conf delete mode 100644 node_modules/pem/test/fixtures/test.cnf delete mode 100644 node_modules/pem/test/fixtures/test.crt delete mode 100644 node_modules/pem/test/fixtures/test.csr delete mode 100644 node_modules/pem/test/fixtures/test.dh delete mode 100644 node_modules/pem/test/fixtures/test.key delete mode 100644 node_modules/pem/test/fixtures/test.p7b delete mode 100644 node_modules/pem/test/fixtures/testnopw.key delete mode 100644 node_modules/pem/test/helper.spec.js delete mode 100644 node_modules/pem/test/openssl.spec.js delete mode 100644 node_modules/pem/test/pem.helper.js delete mode 100644 node_modules/pem/test/pem.spec.js delete mode 100644 node_modules/plur/index.js delete mode 100644 node_modules/plur/license delete mode 100644 node_modules/plur/package.json delete mode 100644 node_modules/plur/readme.md delete mode 100644 node_modules/posix-character-classes/LICENSE delete mode 100644 node_modules/posix-character-classes/README.md delete mode 100644 node_modules/posix-character-classes/index.js delete mode 100644 node_modules/posix-character-classes/package.json delete mode 100644 node_modules/preserve/.gitattributes delete mode 100644 node_modules/preserve/.jshintrc delete mode 100644 node_modules/preserve/.npmignore delete mode 100644 node_modules/preserve/.travis.yml delete mode 100644 node_modules/preserve/.verb.md delete mode 100644 node_modules/preserve/LICENSE delete mode 100644 node_modules/preserve/README.md delete mode 100644 node_modules/preserve/index.js delete mode 100644 node_modules/preserve/package.json delete mode 100644 node_modules/preserve/test.js delete mode 100644 node_modules/prettier-bytes/.npmignore delete mode 100644 node_modules/prettier-bytes/.travis.yml delete mode 100644 node_modules/prettier-bytes/CHANGELOG.md delete mode 100644 node_modules/prettier-bytes/CONTRIBUTING.md delete mode 100644 node_modules/prettier-bytes/LICENSE delete mode 100644 node_modules/prettier-bytes/README.md delete mode 100644 node_modules/prettier-bytes/index.js delete mode 100644 node_modules/prettier-bytes/package.json delete mode 100644 node_modules/prettier-bytes/test/index.js delete mode 100644 node_modules/pretty-ms/index.js delete mode 100644 node_modules/pretty-ms/license delete mode 100644 node_modules/pretty-ms/package.json delete mode 100644 node_modules/pretty-ms/readme.md delete mode 100644 node_modules/process-nextick-args/index.js delete mode 100644 node_modules/process-nextick-args/license.md delete mode 100644 node_modules/process-nextick-args/package.json delete mode 100644 node_modules/process-nextick-args/readme.md delete mode 100644 node_modules/process/.eslintrc delete mode 100644 node_modules/process/LICENSE delete mode 100644 node_modules/process/README.md delete mode 100644 node_modules/process/browser.js delete mode 100644 node_modules/process/index.js delete mode 100644 node_modules/process/package.json delete mode 100644 node_modules/process/test.js delete mode 100644 node_modules/public-encrypt/.travis.yml delete mode 100644 node_modules/public-encrypt/LICENSE delete mode 100644 node_modules/public-encrypt/browser.js delete mode 100644 node_modules/public-encrypt/index.js delete mode 100644 node_modules/public-encrypt/mgf.js delete mode 100644 node_modules/public-encrypt/package.json delete mode 100644 node_modules/public-encrypt/privateDecrypt.js delete mode 100644 node_modules/public-encrypt/publicEncrypt.js delete mode 100644 node_modules/public-encrypt/readme.md delete mode 100644 node_modules/public-encrypt/test/1024.priv delete mode 100644 node_modules/public-encrypt/test/1024.pub delete mode 100644 node_modules/public-encrypt/test/ec.pass.priv delete mode 100644 node_modules/public-encrypt/test/ec.priv delete mode 100644 node_modules/public-encrypt/test/ec.pub delete mode 100644 node_modules/public-encrypt/test/index.js delete mode 100644 node_modules/public-encrypt/test/nodeTests.js delete mode 100644 node_modules/public-encrypt/test/pass.1024.priv delete mode 100644 node_modules/public-encrypt/test/pass.1024.pub delete mode 100644 node_modules/public-encrypt/test/rsa.1024.priv delete mode 100644 node_modules/public-encrypt/test/rsa.1024.pub delete mode 100644 node_modules/public-encrypt/test/rsa.2028.priv delete mode 100644 node_modules/public-encrypt/test/rsa.2028.pub delete mode 100644 node_modules/public-encrypt/test/rsa.pass.priv delete mode 100644 node_modules/public-encrypt/test/rsa.pass.pub delete mode 100644 node_modules/public-encrypt/test/test_cert.pem delete mode 100644 node_modules/public-encrypt/test/test_key.pem delete mode 100644 node_modules/public-encrypt/test/test_rsa_privkey.pem delete mode 100644 node_modules/public-encrypt/test/test_rsa_privkey_encrypted.pem delete mode 100644 node_modules/public-encrypt/test/test_rsa_pubkey.pem delete mode 100644 node_modules/public-encrypt/withPublic.js delete mode 100644 node_modules/public-encrypt/xor.js delete mode 100644 node_modules/punycode/LICENSE-MIT.txt delete mode 100644 node_modules/punycode/README.md delete mode 100644 node_modules/punycode/package.json delete mode 100644 node_modules/punycode/punycode.js delete mode 100644 node_modules/query-string/index.js delete mode 100644 node_modules/query-string/license delete mode 100644 node_modules/query-string/package.json delete mode 100644 node_modules/query-string/readme.md delete mode 100644 node_modules/querystring-es3/.travis.yml delete mode 100644 node_modules/querystring-es3/History.md delete mode 100644 node_modules/querystring-es3/License.md delete mode 100644 node_modules/querystring-es3/Readme.md delete mode 100644 node_modules/querystring-es3/decode.js delete mode 100644 node_modules/querystring-es3/encode.js delete mode 100644 node_modules/querystring-es3/index.js delete mode 100644 node_modules/querystring-es3/package.json delete mode 100644 node_modules/querystring-es3/test/common-index.js delete mode 100644 node_modules/querystring-es3/test/index.js delete mode 100644 node_modules/querystring-es3/test/tap-index.js delete mode 100644 node_modules/querystring/.History.md.un~ delete mode 100644 node_modules/querystring/.Readme.md.un~ delete mode 100644 node_modules/querystring/.package.json.un~ delete mode 100644 node_modules/querystring/.travis.yml delete mode 100644 node_modules/querystring/History.md delete mode 100644 node_modules/querystring/License.md delete mode 100644 node_modules/querystring/Readme.md delete mode 100644 node_modules/querystring/decode.js delete mode 100644 node_modules/querystring/encode.js delete mode 100644 node_modules/querystring/index.js delete mode 100644 node_modules/querystring/package.json delete mode 100644 node_modules/querystring/test/.index.js.un~ delete mode 100644 node_modules/querystring/test/common-index.js delete mode 100644 node_modules/querystring/test/index.js delete mode 100644 node_modules/querystring/test/tap-index.js delete mode 100644 node_modules/randomatic/LICENSE delete mode 100644 node_modules/randomatic/README.md delete mode 100644 node_modules/randomatic/index.js delete mode 100644 node_modules/randomatic/node_modules/is-number/LICENSE delete mode 100644 node_modules/randomatic/node_modules/is-number/README.md delete mode 100644 node_modules/randomatic/node_modules/is-number/index.js delete mode 100644 node_modules/randomatic/node_modules/is-number/package.json delete mode 100644 node_modules/randomatic/node_modules/kind-of/CHANGELOG.md delete mode 100644 node_modules/randomatic/node_modules/kind-of/LICENSE delete mode 100644 node_modules/randomatic/node_modules/kind-of/README.md delete mode 100644 node_modules/randomatic/node_modules/kind-of/index.js delete mode 100644 node_modules/randomatic/node_modules/kind-of/package.json delete mode 100644 node_modules/randomatic/package.json delete mode 100644 node_modules/randombytes/.travis.yml delete mode 100644 node_modules/randombytes/.zuul.yml delete mode 100644 node_modules/randombytes/LICENSE delete mode 100644 node_modules/randombytes/README.md delete mode 100644 node_modules/randombytes/browser.js delete mode 100644 node_modules/randombytes/index.js delete mode 100644 node_modules/randombytes/package.json delete mode 100644 node_modules/randombytes/test.js delete mode 100644 node_modules/randomfill/.travis.yml delete mode 100644 node_modules/randomfill/.zuul.yml delete mode 100644 node_modules/randomfill/LICENSE delete mode 100644 node_modules/randomfill/README.md delete mode 100644 node_modules/randomfill/browser.js delete mode 100644 node_modules/randomfill/index.js delete mode 100644 node_modules/randomfill/package.json delete mode 100644 node_modules/randomfill/test.js delete mode 100644 node_modules/range-parser/HISTORY.md delete mode 100644 node_modules/range-parser/LICENSE delete mode 100644 node_modules/range-parser/README.md delete mode 100644 node_modules/range-parser/index.js delete mode 100644 node_modules/range-parser/package.json delete mode 100644 node_modules/read-only-stream/.travis.yml delete mode 100644 node_modules/read-only-stream/LICENSE delete mode 100644 node_modules/read-only-stream/example/main.js delete mode 100644 node_modules/read-only-stream/example/wrap.js delete mode 100644 node_modules/read-only-stream/index.js delete mode 100644 node_modules/read-only-stream/package.json delete mode 100644 node_modules/read-only-stream/readme.markdown delete mode 100644 node_modules/read-only-stream/test/error.js delete mode 100644 node_modules/read-only-stream/test/ro.js delete mode 100644 node_modules/read-only-stream/test/streams1.js delete mode 100644 node_modules/readable-stream/.travis.yml delete mode 100644 node_modules/readable-stream/CONTRIBUTING.md delete mode 100644 node_modules/readable-stream/GOVERNANCE.md delete mode 100644 node_modules/readable-stream/LICENSE delete mode 100644 node_modules/readable-stream/README.md delete mode 100644 node_modules/readable-stream/doc/wg-meetings/2015-01-30.md delete mode 100644 node_modules/readable-stream/duplex-browser.js delete mode 100644 node_modules/readable-stream/duplex.js delete mode 100644 node_modules/readable-stream/lib/_stream_duplex.js delete mode 100644 node_modules/readable-stream/lib/_stream_passthrough.js delete mode 100644 node_modules/readable-stream/lib/_stream_readable.js delete mode 100644 node_modules/readable-stream/lib/_stream_transform.js delete mode 100644 node_modules/readable-stream/lib/_stream_writable.js delete mode 100644 node_modules/readable-stream/lib/internal/streams/BufferList.js delete mode 100644 node_modules/readable-stream/lib/internal/streams/destroy.js delete mode 100644 node_modules/readable-stream/lib/internal/streams/stream-browser.js delete mode 100644 node_modules/readable-stream/lib/internal/streams/stream.js delete mode 100644 node_modules/readable-stream/package.json delete mode 100644 node_modules/readable-stream/passthrough.js delete mode 100644 node_modules/readable-stream/readable-browser.js delete mode 100644 node_modules/readable-stream/readable.js delete mode 100644 node_modules/readable-stream/transform.js delete mode 100644 node_modules/readable-stream/writable-browser.js delete mode 100644 node_modules/readable-stream/writable.js delete mode 100644 node_modules/readdirp/LICENSE delete mode 100644 node_modules/readdirp/README.md delete mode 100755 node_modules/readdirp/node_modules/arr-diff/LICENSE delete mode 100644 node_modules/readdirp/node_modules/arr-diff/README.md delete mode 100644 node_modules/readdirp/node_modules/arr-diff/index.js delete mode 100644 node_modules/readdirp/node_modules/arr-diff/package.json delete mode 100755 node_modules/readdirp/node_modules/array-unique/LICENSE delete mode 100755 node_modules/readdirp/node_modules/array-unique/README.md delete mode 100644 node_modules/readdirp/node_modules/array-unique/index.js delete mode 100644 node_modules/readdirp/node_modules/array-unique/package.json delete mode 100644 node_modules/readdirp/node_modules/braces/LICENSE delete mode 100644 node_modules/readdirp/node_modules/braces/README.md delete mode 100644 node_modules/readdirp/node_modules/braces/index.js delete mode 100644 node_modules/readdirp/node_modules/braces/lib/braces.js delete mode 100644 node_modules/readdirp/node_modules/braces/lib/compilers.js delete mode 100644 node_modules/readdirp/node_modules/braces/lib/parsers.js delete mode 100644 node_modules/readdirp/node_modules/braces/lib/utils.js delete mode 100644 node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/LICENSE delete mode 100644 node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/README.md delete mode 100644 node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/index.js delete mode 100644 node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/package.json delete mode 100644 node_modules/readdirp/node_modules/braces/package.json delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/LICENSE delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/README.md delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/changelog.md delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/index.js delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/lib/compilers.js delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/lib/parsers.js delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/lib/utils.js delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/LICENSE delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/README.md delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/index.js delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/package.json delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/LICENSE delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/README.md delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/index.js delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/package.json delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/LICENSE delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/README.md delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/index.js delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/LICENSE delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/README.md delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/index.js delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/package.json delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/package.json delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/LICENSE delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/README.md delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/index.js delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/LICENSE delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/README.md delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/index.js delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/package.json delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/package.json delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/LICENSE delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/README.md delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/index.js delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/package.json delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/LICENSE delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/README.md delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/index.js delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/package.json delete mode 100644 node_modules/readdirp/node_modules/expand-brackets/package.json delete mode 100644 node_modules/readdirp/node_modules/extglob/LICENSE delete mode 100644 node_modules/readdirp/node_modules/extglob/README.md delete mode 100644 node_modules/readdirp/node_modules/extglob/changelog.md delete mode 100644 node_modules/readdirp/node_modules/extglob/index.js delete mode 100644 node_modules/readdirp/node_modules/extglob/lib/.DS_Store delete mode 100644 node_modules/readdirp/node_modules/extglob/lib/compilers.js delete mode 100644 node_modules/readdirp/node_modules/extglob/lib/extglob.js delete mode 100644 node_modules/readdirp/node_modules/extglob/lib/parsers.js delete mode 100644 node_modules/readdirp/node_modules/extglob/lib/utils.js delete mode 100644 node_modules/readdirp/node_modules/extglob/node_modules/define-property/LICENSE delete mode 100644 node_modules/readdirp/node_modules/extglob/node_modules/define-property/README.md delete mode 100644 node_modules/readdirp/node_modules/extglob/node_modules/define-property/index.js delete mode 100644 node_modules/readdirp/node_modules/extglob/node_modules/define-property/package.json delete mode 100644 node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/LICENSE delete mode 100644 node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/README.md delete mode 100644 node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/index.js delete mode 100644 node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/package.json delete mode 100644 node_modules/readdirp/node_modules/extglob/package.json delete mode 100644 node_modules/readdirp/node_modules/fill-range/LICENSE delete mode 100644 node_modules/readdirp/node_modules/fill-range/README.md delete mode 100644 node_modules/readdirp/node_modules/fill-range/index.js delete mode 100644 node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/LICENSE delete mode 100644 node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/README.md delete mode 100644 node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/index.js delete mode 100644 node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/package.json delete mode 100644 node_modules/readdirp/node_modules/fill-range/package.json delete mode 100644 node_modules/readdirp/node_modules/is-accessor-descriptor/LICENSE delete mode 100644 node_modules/readdirp/node_modules/is-accessor-descriptor/README.md delete mode 100644 node_modules/readdirp/node_modules/is-accessor-descriptor/index.js delete mode 100644 node_modules/readdirp/node_modules/is-accessor-descriptor/package.json delete mode 100644 node_modules/readdirp/node_modules/is-data-descriptor/LICENSE delete mode 100644 node_modules/readdirp/node_modules/is-data-descriptor/README.md delete mode 100644 node_modules/readdirp/node_modules/is-data-descriptor/index.js delete mode 100644 node_modules/readdirp/node_modules/is-data-descriptor/package.json delete mode 100644 node_modules/readdirp/node_modules/is-descriptor/LICENSE delete mode 100644 node_modules/readdirp/node_modules/is-descriptor/README.md delete mode 100644 node_modules/readdirp/node_modules/is-descriptor/index.js delete mode 100644 node_modules/readdirp/node_modules/is-descriptor/package.json delete mode 100644 node_modules/readdirp/node_modules/is-number/LICENSE delete mode 100644 node_modules/readdirp/node_modules/is-number/README.md delete mode 100644 node_modules/readdirp/node_modules/is-number/index.js delete mode 100644 node_modules/readdirp/node_modules/is-number/node_modules/kind-of/LICENSE delete mode 100644 node_modules/readdirp/node_modules/is-number/node_modules/kind-of/README.md delete mode 100644 node_modules/readdirp/node_modules/is-number/node_modules/kind-of/index.js delete mode 100644 node_modules/readdirp/node_modules/is-number/node_modules/kind-of/package.json delete mode 100644 node_modules/readdirp/node_modules/is-number/package.json delete mode 100644 node_modules/readdirp/node_modules/isobject/LICENSE delete mode 100644 node_modules/readdirp/node_modules/isobject/README.md delete mode 100644 node_modules/readdirp/node_modules/isobject/index.d.ts delete mode 100644 node_modules/readdirp/node_modules/isobject/index.js delete mode 100644 node_modules/readdirp/node_modules/isobject/package.json delete mode 100644 node_modules/readdirp/node_modules/kind-of/CHANGELOG.md delete mode 100644 node_modules/readdirp/node_modules/kind-of/LICENSE delete mode 100644 node_modules/readdirp/node_modules/kind-of/README.md delete mode 100644 node_modules/readdirp/node_modules/kind-of/index.js delete mode 100644 node_modules/readdirp/node_modules/kind-of/package.json delete mode 100644 node_modules/readdirp/node_modules/micromatch/CHANGELOG.md delete mode 100755 node_modules/readdirp/node_modules/micromatch/LICENSE delete mode 100644 node_modules/readdirp/node_modules/micromatch/README.md delete mode 100644 node_modules/readdirp/node_modules/micromatch/index.js delete mode 100644 node_modules/readdirp/node_modules/micromatch/lib/.DS_Store delete mode 100644 node_modules/readdirp/node_modules/micromatch/lib/cache.js delete mode 100644 node_modules/readdirp/node_modules/micromatch/lib/compilers.js delete mode 100644 node_modules/readdirp/node_modules/micromatch/lib/parsers.js delete mode 100644 node_modules/readdirp/node_modules/micromatch/lib/utils.js delete mode 100644 node_modules/readdirp/node_modules/micromatch/package.json delete mode 100644 node_modules/readdirp/package.json delete mode 100644 node_modules/readdirp/readdirp.js delete mode 100644 node_modules/readdirp/stream-api.js delete mode 100644 node_modules/regenerator-runtime/README.md delete mode 100644 node_modules/regenerator-runtime/package.json delete mode 100644 node_modules/regenerator-runtime/path.js delete mode 100644 node_modules/regenerator-runtime/runtime-module.js delete mode 100644 node_modules/regenerator-runtime/runtime.js delete mode 100644 node_modules/regex-cache/LICENSE delete mode 100644 node_modules/regex-cache/README.md delete mode 100644 node_modules/regex-cache/index.js delete mode 100644 node_modules/regex-cache/package.json delete mode 100644 node_modules/regex-not/LICENSE delete mode 100644 node_modules/regex-not/README.md delete mode 100644 node_modules/regex-not/index.js delete mode 100644 node_modules/regex-not/package.json delete mode 100644 node_modules/reload-css/LICENSE.md delete mode 100644 node_modules/reload-css/README.md delete mode 100644 node_modules/reload-css/index.js delete mode 100644 node_modules/reload-css/lib/url.js delete mode 100644 node_modules/reload-css/package.json delete mode 100644 node_modules/remove-trailing-separator/history.md delete mode 100644 node_modules/remove-trailing-separator/index.js delete mode 100644 node_modules/remove-trailing-separator/license delete mode 100644 node_modules/remove-trailing-separator/package.json delete mode 100644 node_modules/remove-trailing-separator/readme.md delete mode 100644 node_modules/repeat-element/LICENSE delete mode 100644 node_modules/repeat-element/README.md delete mode 100644 node_modules/repeat-element/index.js delete mode 100644 node_modules/repeat-element/package.json delete mode 100644 node_modules/repeat-string/LICENSE delete mode 100644 node_modules/repeat-string/README.md delete mode 100644 node_modules/repeat-string/index.js delete mode 100644 node_modules/repeat-string/package.json delete mode 100644 node_modules/resolve-url/.jshintrc delete mode 100644 node_modules/resolve-url/LICENSE delete mode 100644 node_modules/resolve-url/bower.json delete mode 100644 node_modules/resolve-url/changelog.md delete mode 100644 node_modules/resolve-url/component.json delete mode 100644 node_modules/resolve-url/package.json delete mode 100644 node_modules/resolve-url/readme.md delete mode 100644 node_modules/resolve-url/resolve-url.js delete mode 100644 node_modules/resolve-url/test/resolve-url.js delete mode 100644 node_modules/resolve/.editorconfig delete mode 100644 node_modules/resolve/.eslintignore delete mode 100644 node_modules/resolve/.eslintrc delete mode 100644 node_modules/resolve/.travis.yml delete mode 100644 node_modules/resolve/LICENSE delete mode 100644 node_modules/resolve/appveyor.yml delete mode 100644 node_modules/resolve/example/async.js delete mode 100644 node_modules/resolve/example/sync.js delete mode 100644 node_modules/resolve/index.js delete mode 100644 node_modules/resolve/lib/async.js delete mode 100644 node_modules/resolve/lib/caller.js delete mode 100644 node_modules/resolve/lib/core.js delete mode 100644 node_modules/resolve/lib/core.json delete mode 100644 node_modules/resolve/lib/node-modules-paths.js delete mode 100644 node_modules/resolve/lib/sync.js delete mode 100644 node_modules/resolve/package.json delete mode 100644 node_modules/resolve/readme.markdown delete mode 100644 node_modules/resolve/test/.eslintrc delete mode 100644 node_modules/resolve/test/core.js delete mode 100644 node_modules/resolve/test/dotdot.js delete mode 100644 node_modules/resolve/test/dotdot/abc/index.js delete mode 100644 node_modules/resolve/test/dotdot/index.js delete mode 100644 node_modules/resolve/test/faulty_basedir.js delete mode 100644 node_modules/resolve/test/filter.js delete mode 100644 node_modules/resolve/test/filter_sync.js delete mode 100644 node_modules/resolve/test/mock.js delete mode 100644 node_modules/resolve/test/mock_sync.js delete mode 100644 node_modules/resolve/test/module_dir.js delete mode 100644 node_modules/resolve/test/module_dir/xmodules/aaa/index.js delete mode 100644 node_modules/resolve/test/module_dir/ymodules/aaa/index.js delete mode 100644 node_modules/resolve/test/module_dir/zmodules/bbb/main.js delete mode 100644 node_modules/resolve/test/module_dir/zmodules/bbb/package.json delete mode 100644 node_modules/resolve/test/node-modules-paths.js delete mode 100644 node_modules/resolve/test/node_path.js delete mode 100644 node_modules/resolve/test/node_path/x/aaa/index.js delete mode 100644 node_modules/resolve/test/node_path/x/ccc/index.js delete mode 100644 node_modules/resolve/test/node_path/y/bbb/index.js delete mode 100644 node_modules/resolve/test/node_path/y/ccc/index.js delete mode 100644 node_modules/resolve/test/nonstring.js delete mode 100644 node_modules/resolve/test/pathfilter.js delete mode 100644 node_modules/resolve/test/pathfilter/deep_ref/main.js delete mode 100644 node_modules/resolve/test/precedence.js delete mode 100644 node_modules/resolve/test/precedence/aaa.js delete mode 100644 node_modules/resolve/test/precedence/aaa/index.js delete mode 100644 node_modules/resolve/test/precedence/aaa/main.js delete mode 100644 node_modules/resolve/test/precedence/bbb.js delete mode 100644 node_modules/resolve/test/precedence/bbb/main.js delete mode 100644 node_modules/resolve/test/resolver.js delete mode 100644 node_modules/resolve/test/resolver/baz/doom.js delete mode 100644 node_modules/resolve/test/resolver/baz/package.json delete mode 100644 node_modules/resolve/test/resolver/baz/quux.js delete mode 100644 node_modules/resolve/test/resolver/browser_field/a.js delete mode 100644 node_modules/resolve/test/resolver/browser_field/b.js delete mode 100644 node_modules/resolve/test/resolver/browser_field/package.json delete mode 100644 node_modules/resolve/test/resolver/cup.coffee delete mode 100644 node_modules/resolve/test/resolver/dot_main/index.js delete mode 100644 node_modules/resolve/test/resolver/dot_main/package.json delete mode 100644 node_modules/resolve/test/resolver/dot_slash_main/index.js delete mode 100644 node_modules/resolve/test/resolver/dot_slash_main/package.json delete mode 100644 node_modules/resolve/test/resolver/foo.js delete mode 100644 node_modules/resolve/test/resolver/incorrect_main/index.js delete mode 100644 node_modules/resolve/test/resolver/incorrect_main/package.json delete mode 100644 node_modules/resolve/test/resolver/mug.coffee delete mode 100644 node_modules/resolve/test/resolver/mug.js delete mode 100644 node_modules/resolve/test/resolver/other_path/lib/other-lib.js delete mode 100644 node_modules/resolve/test/resolver/other_path/root.js delete mode 100644 node_modules/resolve/test/resolver/quux/foo/index.js delete mode 100644 node_modules/resolve/test/resolver/same_names/foo.js delete mode 100644 node_modules/resolve/test/resolver/same_names/foo/index.js delete mode 100644 node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js delete mode 100644 node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep delete mode 100644 node_modules/resolve/test/resolver/without_basedir/main.js delete mode 100644 node_modules/resolve/test/resolver_sync.js delete mode 100644 node_modules/resolve/test/subdirs.js delete mode 100644 node_modules/resolve/test/symlinks.js delete mode 100644 node_modules/resp-modifier/README.md delete mode 100644 node_modules/resp-modifier/index.js delete mode 100644 node_modules/resp-modifier/lib/utils.js delete mode 100644 node_modules/resp-modifier/package.json delete mode 100644 node_modules/ret/LICENSE delete mode 100644 node_modules/ret/README.md delete mode 100644 node_modules/ret/lib/index.js delete mode 100644 node_modules/ret/lib/positions.js delete mode 100644 node_modules/ret/lib/sets.js delete mode 100644 node_modules/ret/lib/types.js delete mode 100644 node_modules/ret/lib/util.js delete mode 100644 node_modules/ret/package.json delete mode 100644 node_modules/right-now/LICENSE.md delete mode 100644 node_modules/right-now/README.md delete mode 100644 node_modules/right-now/browser.js delete mode 100644 node_modules/right-now/index.js delete mode 100644 node_modules/right-now/package.json delete mode 100644 node_modules/ripemd160/CHANGELOG.md delete mode 100644 node_modules/ripemd160/LICENSE delete mode 100644 node_modules/ripemd160/README.md delete mode 100644 node_modules/ripemd160/index.js delete mode 100644 node_modules/ripemd160/package.json delete mode 100644 node_modules/safe-buffer/LICENSE delete mode 100644 node_modules/safe-buffer/README.md delete mode 100644 node_modules/safe-buffer/index.d.ts delete mode 100644 node_modules/safe-buffer/index.js delete mode 100644 node_modules/safe-buffer/package.json delete mode 100644 node_modules/safe-regex/.travis.yml delete mode 100644 node_modules/safe-regex/LICENSE delete mode 100644 node_modules/safe-regex/example/safe.js delete mode 100644 node_modules/safe-regex/index.js delete mode 100644 node_modules/safe-regex/package.json delete mode 100644 node_modules/safe-regex/readme.markdown delete mode 100644 node_modules/safe-regex/test/regex.js delete mode 100644 node_modules/semver/LICENSE delete mode 100644 node_modules/semver/README.md delete mode 100755 node_modules/semver/bin/semver delete mode 100644 node_modules/semver/package.json delete mode 100644 node_modules/semver/range.bnf delete mode 100644 node_modules/semver/semver.js delete mode 100644 node_modules/send/HISTORY.md delete mode 100644 node_modules/send/LICENSE delete mode 100644 node_modules/send/README.md delete mode 100644 node_modules/send/index.js delete mode 100644 node_modules/send/package.json delete mode 100644 node_modules/serve-static/HISTORY.md delete mode 100644 node_modules/serve-static/LICENSE delete mode 100644 node_modules/serve-static/README.md delete mode 100644 node_modules/serve-static/index.js delete mode 100644 node_modules/serve-static/package.json delete mode 100644 node_modules/set-value/LICENSE delete mode 100644 node_modules/set-value/README.md delete mode 100644 node_modules/set-value/index.js delete mode 100644 node_modules/set-value/node_modules/extend-shallow/LICENSE delete mode 100644 node_modules/set-value/node_modules/extend-shallow/README.md delete mode 100644 node_modules/set-value/node_modules/extend-shallow/index.js delete mode 100644 node_modules/set-value/node_modules/extend-shallow/package.json delete mode 100644 node_modules/set-value/package.json delete mode 100644 node_modules/setprototypeof/LICENSE delete mode 100644 node_modules/setprototypeof/README.md delete mode 100644 node_modules/setprototypeof/index.d.ts delete mode 100644 node_modules/setprototypeof/index.js delete mode 100644 node_modules/setprototypeof/package.json delete mode 100644 node_modules/sha.js/.travis.yml delete mode 100644 node_modules/sha.js/LICENSE delete mode 100644 node_modules/sha.js/README.md delete mode 100755 node_modules/sha.js/bin.js delete mode 100644 node_modules/sha.js/hash.js delete mode 100644 node_modules/sha.js/index.js delete mode 100644 node_modules/sha.js/package.json delete mode 100644 node_modules/sha.js/sha.js delete mode 100644 node_modules/sha.js/sha1.js delete mode 100644 node_modules/sha.js/sha224.js delete mode 100644 node_modules/sha.js/sha256.js delete mode 100644 node_modules/sha.js/sha384.js delete mode 100644 node_modules/sha.js/sha512.js delete mode 100644 node_modules/sha.js/test/hash.js delete mode 100644 node_modules/sha.js/test/test.js delete mode 100644 node_modules/sha.js/test/vectors.js delete mode 100644 node_modules/shasum/.npmignore delete mode 100644 node_modules/shasum/.travis.yml delete mode 100644 node_modules/shasum/LICENSE delete mode 100644 node_modules/shasum/README.md delete mode 100644 node_modules/shasum/browser.js delete mode 100644 node_modules/shasum/index.js delete mode 100644 node_modules/shasum/package.json delete mode 100644 node_modules/shasum/test/index.js delete mode 100644 node_modules/shebang-command/index.js delete mode 100644 node_modules/shebang-command/license delete mode 100644 node_modules/shebang-command/package.json delete mode 100644 node_modules/shebang-command/readme.md delete mode 100644 node_modules/shebang-regex/index.js delete mode 100644 node_modules/shebang-regex/license delete mode 100644 node_modules/shebang-regex/package.json delete mode 100644 node_modules/shebang-regex/readme.md delete mode 100644 node_modules/shell-quote/.travis.yml delete mode 100644 node_modules/shell-quote/LICENSE delete mode 100644 node_modules/shell-quote/example/env.js delete mode 100644 node_modules/shell-quote/example/op.js delete mode 100644 node_modules/shell-quote/example/parse.js delete mode 100644 node_modules/shell-quote/example/quote.js delete mode 100644 node_modules/shell-quote/index.js delete mode 100644 node_modules/shell-quote/package.json delete mode 100644 node_modules/shell-quote/readme.markdown delete mode 100644 node_modules/shell-quote/test/comment.js delete mode 100644 node_modules/shell-quote/test/env.js delete mode 100644 node_modules/shell-quote/test/env_fn.js delete mode 100644 node_modules/shell-quote/test/op.js delete mode 100644 node_modules/shell-quote/test/parse.js delete mode 100644 node_modules/shell-quote/test/quote.js delete mode 100644 node_modules/shell-quote/test/set.js delete mode 100644 node_modules/signal-exit/CHANGELOG.md delete mode 100644 node_modules/signal-exit/LICENSE.txt delete mode 100644 node_modules/signal-exit/README.md delete mode 100644 node_modules/signal-exit/index.js delete mode 100644 node_modules/signal-exit/package.json delete mode 100644 node_modules/signal-exit/signals.js delete mode 100644 node_modules/simple-concat/.travis.yml delete mode 100644 node_modules/simple-concat/LICENSE delete mode 100644 node_modules/simple-concat/README.md delete mode 100644 node_modules/simple-concat/index.js delete mode 100644 node_modules/simple-concat/package.json delete mode 100644 node_modules/simple-concat/test/basic.js delete mode 100644 node_modules/simple-html-index/LICENSE.md delete mode 100644 node_modules/simple-html-index/README.md delete mode 100644 node_modules/simple-html-index/index.js delete mode 100644 node_modules/simple-html-index/package.json delete mode 100644 node_modules/snapdragon-node/LICENSE delete mode 100644 node_modules/snapdragon-node/README.md delete mode 100644 node_modules/snapdragon-node/index.js delete mode 100644 node_modules/snapdragon-node/node_modules/define-property/LICENSE delete mode 100644 node_modules/snapdragon-node/node_modules/define-property/README.md delete mode 100644 node_modules/snapdragon-node/node_modules/define-property/index.js delete mode 100644 node_modules/snapdragon-node/node_modules/define-property/package.json delete mode 100644 node_modules/snapdragon-node/node_modules/is-accessor-descriptor/LICENSE delete mode 100644 node_modules/snapdragon-node/node_modules/is-accessor-descriptor/README.md delete mode 100644 node_modules/snapdragon-node/node_modules/is-accessor-descriptor/index.js delete mode 100644 node_modules/snapdragon-node/node_modules/is-accessor-descriptor/package.json delete mode 100644 node_modules/snapdragon-node/node_modules/is-data-descriptor/LICENSE delete mode 100644 node_modules/snapdragon-node/node_modules/is-data-descriptor/README.md delete mode 100644 node_modules/snapdragon-node/node_modules/is-data-descriptor/index.js delete mode 100644 node_modules/snapdragon-node/node_modules/is-data-descriptor/package.json delete mode 100644 node_modules/snapdragon-node/node_modules/is-descriptor/LICENSE delete mode 100644 node_modules/snapdragon-node/node_modules/is-descriptor/README.md delete mode 100644 node_modules/snapdragon-node/node_modules/is-descriptor/index.js delete mode 100644 node_modules/snapdragon-node/node_modules/is-descriptor/package.json delete mode 100644 node_modules/snapdragon-node/node_modules/isobject/LICENSE delete mode 100644 node_modules/snapdragon-node/node_modules/isobject/README.md delete mode 100644 node_modules/snapdragon-node/node_modules/isobject/index.d.ts delete mode 100644 node_modules/snapdragon-node/node_modules/isobject/index.js delete mode 100644 node_modules/snapdragon-node/node_modules/isobject/package.json delete mode 100644 node_modules/snapdragon-node/node_modules/kind-of/CHANGELOG.md delete mode 100644 node_modules/snapdragon-node/node_modules/kind-of/LICENSE delete mode 100644 node_modules/snapdragon-node/node_modules/kind-of/README.md delete mode 100644 node_modules/snapdragon-node/node_modules/kind-of/index.js delete mode 100644 node_modules/snapdragon-node/node_modules/kind-of/package.json delete mode 100644 node_modules/snapdragon-node/package.json delete mode 100644 node_modules/snapdragon-util/LICENSE delete mode 100644 node_modules/snapdragon-util/README.md delete mode 100644 node_modules/snapdragon-util/index.js delete mode 100644 node_modules/snapdragon-util/package.json delete mode 100644 node_modules/snapdragon/LICENSE delete mode 100644 node_modules/snapdragon/README.md delete mode 100644 node_modules/snapdragon/index.js delete mode 100644 node_modules/snapdragon/lib/compiler.js delete mode 100644 node_modules/snapdragon/lib/parser.js delete mode 100644 node_modules/snapdragon/lib/position.js delete mode 100644 node_modules/snapdragon/lib/source-maps.js delete mode 100644 node_modules/snapdragon/lib/utils.js delete mode 100644 node_modules/snapdragon/node_modules/define-property/LICENSE delete mode 100644 node_modules/snapdragon/node_modules/define-property/README.md delete mode 100644 node_modules/snapdragon/node_modules/define-property/index.js delete mode 100644 node_modules/snapdragon/node_modules/define-property/package.json delete mode 100644 node_modules/snapdragon/node_modules/extend-shallow/LICENSE delete mode 100644 node_modules/snapdragon/node_modules/extend-shallow/README.md delete mode 100644 node_modules/snapdragon/node_modules/extend-shallow/index.js delete mode 100644 node_modules/snapdragon/node_modules/extend-shallow/package.json delete mode 100644 node_modules/snapdragon/package.json delete mode 100644 node_modules/source-map-resolve/.jshintrc delete mode 100644 node_modules/source-map-resolve/.travis.yml delete mode 100644 node_modules/source-map-resolve/LICENSE delete mode 100644 node_modules/source-map-resolve/bower.json delete mode 100644 node_modules/source-map-resolve/changelog.md delete mode 100644 node_modules/source-map-resolve/component.json delete mode 100644 node_modules/source-map-resolve/generate-source-map-resolve.js delete mode 100644 node_modules/source-map-resolve/lib/decode-uri-component.js delete mode 100644 node_modules/source-map-resolve/lib/resolve-url.js delete mode 100644 node_modules/source-map-resolve/lib/source-map-resolve-node.js delete mode 100644 node_modules/source-map-resolve/package.json delete mode 100644 node_modules/source-map-resolve/readme.md delete mode 100644 node_modules/source-map-resolve/source-map-resolve.js delete mode 100644 node_modules/source-map-resolve/source-map-resolve.js.template delete mode 100644 node_modules/source-map-resolve/test/common.js delete mode 100644 node_modules/source-map-resolve/test/read.js delete mode 100644 node_modules/source-map-resolve/test/source-map-resolve.js delete mode 100644 node_modules/source-map-resolve/test/windows.js delete mode 100644 node_modules/source-map-resolve/x-package.json5 delete mode 100644 node_modules/source-map-url/.jshintrc delete mode 100644 node_modules/source-map-url/LICENSE delete mode 100644 node_modules/source-map-url/bower.json delete mode 100644 node_modules/source-map-url/changelog.md delete mode 100644 node_modules/source-map-url/component.json delete mode 100644 node_modules/source-map-url/package.json delete mode 100644 node_modules/source-map-url/readme.md delete mode 100644 node_modules/source-map-url/source-map-url.js delete mode 100644 node_modules/source-map-url/test/source-map-url.js delete mode 100644 node_modules/source-map-url/x-package.json5 delete mode 100644 node_modules/source-map/CHANGELOG.md delete mode 100644 node_modules/source-map/LICENSE delete mode 100644 node_modules/source-map/README.md delete mode 100644 node_modules/source-map/dist/source-map.debug.js delete mode 100644 node_modules/source-map/dist/source-map.js delete mode 100644 node_modules/source-map/dist/source-map.min.js delete mode 100644 node_modules/source-map/dist/source-map.min.js.map delete mode 100644 node_modules/source-map/lib/array-set.js delete mode 100644 node_modules/source-map/lib/base64-vlq.js delete mode 100644 node_modules/source-map/lib/base64.js delete mode 100644 node_modules/source-map/lib/binary-search.js delete mode 100644 node_modules/source-map/lib/mapping-list.js delete mode 100644 node_modules/source-map/lib/quick-sort.js delete mode 100644 node_modules/source-map/lib/source-map-consumer.js delete mode 100644 node_modules/source-map/lib/source-map-generator.js delete mode 100644 node_modules/source-map/lib/source-node.js delete mode 100644 node_modules/source-map/lib/util.js delete mode 100644 node_modules/source-map/package.json delete mode 100644 node_modules/source-map/source-map.js delete mode 100644 node_modules/split-string/LICENSE delete mode 100644 node_modules/split-string/README.md delete mode 100644 node_modules/split-string/index.js delete mode 100644 node_modules/split-string/package.json delete mode 100644 node_modules/split2/.README.md.un~ delete mode 100644 node_modules/split2/.index.js.un~ delete mode 100644 node_modules/split2/.npmignore delete mode 100644 node_modules/split2/.package.json.un~ delete mode 100644 node_modules/split2/.test.js.un~ delete mode 100644 node_modules/split2/.travis.yml delete mode 100644 node_modules/split2/LICENSE delete mode 100644 node_modules/split2/README.md delete mode 100644 node_modules/split2/index.js delete mode 100644 node_modules/split2/node_modules/isarray/README.md delete mode 100644 node_modules/split2/node_modules/isarray/build/build.js delete mode 100644 node_modules/split2/node_modules/isarray/component.json delete mode 100644 node_modules/split2/node_modules/isarray/index.js delete mode 100644 node_modules/split2/node_modules/isarray/package.json delete mode 100644 node_modules/split2/node_modules/readable-stream/.npmignore delete mode 100644 node_modules/split2/node_modules/readable-stream/LICENSE delete mode 100644 node_modules/split2/node_modules/readable-stream/README.md delete mode 100644 node_modules/split2/node_modules/readable-stream/duplex.js delete mode 100644 node_modules/split2/node_modules/readable-stream/lib/_stream_duplex.js delete mode 100644 node_modules/split2/node_modules/readable-stream/lib/_stream_passthrough.js delete mode 100644 node_modules/split2/node_modules/readable-stream/lib/_stream_readable.js delete mode 100644 node_modules/split2/node_modules/readable-stream/lib/_stream_transform.js delete mode 100644 node_modules/split2/node_modules/readable-stream/lib/_stream_writable.js delete mode 100644 node_modules/split2/node_modules/readable-stream/package.json delete mode 100644 node_modules/split2/node_modules/readable-stream/passthrough.js delete mode 100644 node_modules/split2/node_modules/readable-stream/readable.js delete mode 100644 node_modules/split2/node_modules/readable-stream/transform.js delete mode 100644 node_modules/split2/node_modules/readable-stream/writable.js delete mode 100644 node_modules/split2/node_modules/string_decoder/.npmignore delete mode 100644 node_modules/split2/node_modules/string_decoder/LICENSE delete mode 100644 node_modules/split2/node_modules/string_decoder/README.md delete mode 100644 node_modules/split2/node_modules/string_decoder/index.js delete mode 100644 node_modules/split2/node_modules/string_decoder/package.json delete mode 100644 node_modules/split2/node_modules/through2/.npmignore delete mode 100644 node_modules/split2/node_modules/through2/LICENSE delete mode 100644 node_modules/split2/node_modules/through2/README.md delete mode 100644 node_modules/split2/node_modules/through2/package.json delete mode 100644 node_modules/split2/node_modules/through2/through2.js delete mode 100644 node_modules/split2/package.json delete mode 100644 node_modules/split2/test.js delete mode 100644 node_modules/stacked/.jshintrc delete mode 100644 node_modules/stacked/.npmignore delete mode 100644 node_modules/stacked/.travis.yml delete mode 100644 node_modules/stacked/README.md delete mode 100644 node_modules/stacked/package.json delete mode 100644 node_modules/stacked/stacked.js delete mode 100644 node_modules/stacked/test/stacked.js delete mode 100644 node_modules/static-extend/LICENSE delete mode 100644 node_modules/static-extend/index.js delete mode 100644 node_modules/static-extend/node_modules/define-property/LICENSE delete mode 100644 node_modules/static-extend/node_modules/define-property/README.md delete mode 100644 node_modules/static-extend/node_modules/define-property/index.js delete mode 100644 node_modules/static-extend/node_modules/define-property/package.json delete mode 100644 node_modules/static-extend/package.json delete mode 100644 node_modules/statuses/HISTORY.md delete mode 100644 node_modules/statuses/LICENSE delete mode 100644 node_modules/statuses/README.md delete mode 100644 node_modules/statuses/codes.json delete mode 100644 node_modules/statuses/index.js delete mode 100644 node_modules/statuses/package.json delete mode 100644 node_modules/stdout-stream/.travis.yml delete mode 100644 node_modules/stdout-stream/LICENSE delete mode 100644 node_modules/stdout-stream/README.md delete mode 100644 node_modules/stdout-stream/index.js delete mode 100644 node_modules/stdout-stream/package.json delete mode 100644 node_modules/stdout-stream/test/fixtures/end.js delete mode 100644 node_modules/stdout-stream/test/fixtures/hello-world.js delete mode 100644 node_modules/stdout-stream/test/index.js delete mode 100644 node_modules/stream-browserify/.npmignore delete mode 100644 node_modules/stream-browserify/.travis.yml delete mode 100644 node_modules/stream-browserify/LICENSE delete mode 100644 node_modules/stream-browserify/index.js delete mode 100644 node_modules/stream-browserify/package.json delete mode 100644 node_modules/stream-browserify/readme.markdown delete mode 100644 node_modules/stream-browserify/test/buf.js delete mode 100644 node_modules/stream-combiner2/.npmignore delete mode 100644 node_modules/stream-combiner2/.travis.yml delete mode 100644 node_modules/stream-combiner2/LICENSE delete mode 100644 node_modules/stream-combiner2/README.md delete mode 100644 node_modules/stream-combiner2/index.js delete mode 100644 node_modules/stream-combiner2/package.json delete mode 100644 node_modules/stream-combiner2/test/index.js delete mode 100644 node_modules/stream-http/.airtap.yml delete mode 100644 node_modules/stream-http/.travis.yml delete mode 100644 node_modules/stream-http/LICENSE delete mode 100644 node_modules/stream-http/README.md delete mode 100644 node_modules/stream-http/ie8-polyfill.js delete mode 100644 node_modules/stream-http/index.js delete mode 100644 node_modules/stream-http/lib/capability.js delete mode 100644 node_modules/stream-http/lib/request.js delete mode 100644 node_modules/stream-http/lib/response.js delete mode 100644 node_modules/stream-http/package.json delete mode 100644 node_modules/stream-http/test/browser/abort.js delete mode 100644 node_modules/stream-http/test/browser/auth.js delete mode 100644 node_modules/stream-http/test/browser/binary-streaming.js delete mode 100644 node_modules/stream-http/test/browser/binary.js delete mode 100644 node_modules/stream-http/test/browser/body-empty.js delete mode 100644 node_modules/stream-http/test/browser/cookie.js delete mode 100644 node_modules/stream-http/test/browser/disable-fetch.js delete mode 100644 node_modules/stream-http/test/browser/error.js.disabled delete mode 100644 node_modules/stream-http/test/browser/headers.js delete mode 100644 node_modules/stream-http/test/browser/lib/webworker-worker.js delete mode 100644 node_modules/stream-http/test/browser/package.json delete mode 100644 node_modules/stream-http/test/browser/post-binary.js delete mode 100644 node_modules/stream-http/test/browser/post-text.js delete mode 100644 node_modules/stream-http/test/browser/text-streaming.js delete mode 100644 node_modules/stream-http/test/browser/text.js delete mode 100644 node_modules/stream-http/test/browser/timeout.js delete mode 100644 node_modules/stream-http/test/browser/webworker.js delete mode 100644 node_modules/stream-http/test/node/http-browserify.js delete mode 100644 node_modules/stream-http/test/server/index.js delete mode 100644 node_modules/stream-http/test/server/static/basic.txt delete mode 100644 node_modules/stream-http/test/server/static/browserify.png delete mode 100644 node_modules/stream-http/test/server/static/test-polyfill.js delete mode 100644 node_modules/stream-splicer/.travis.yml delete mode 100644 node_modules/stream-splicer/LICENSE delete mode 100644 node_modules/stream-splicer/example/header.js delete mode 100644 node_modules/stream-splicer/index.js delete mode 100644 node_modules/stream-splicer/package.json delete mode 100644 node_modules/stream-splicer/readme.markdown delete mode 100644 node_modules/stream-splicer/test/combiner.js delete mode 100644 node_modules/stream-splicer/test/combiner_stream.js delete mode 100644 node_modules/stream-splicer/test/empty.js delete mode 100644 node_modules/stream-splicer/test/empty_no_data.js delete mode 100644 node_modules/stream-splicer/test/get.js delete mode 100644 node_modules/stream-splicer/test/multipush.js delete mode 100644 node_modules/stream-splicer/test/multiunshift.js delete mode 100644 node_modules/stream-splicer/test/nested.js delete mode 100644 node_modules/stream-splicer/test/nested_middle.js delete mode 100644 node_modules/stream-splicer/test/pop.js delete mode 100644 node_modules/stream-splicer/test/push.js delete mode 100644 node_modules/stream-splicer/test/shift.js delete mode 100644 node_modules/stream-splicer/test/splice.js delete mode 100644 node_modules/stream-splicer/test/unshift.js delete mode 100644 node_modules/strict-uri-encode/index.js delete mode 100644 node_modules/strict-uri-encode/license delete mode 100644 node_modules/strict-uri-encode/package.json delete mode 100644 node_modules/strict-uri-encode/readme.md delete mode 100644 node_modules/string_decoder/.travis.yml delete mode 100644 node_modules/string_decoder/LICENSE delete mode 100644 node_modules/string_decoder/README.md delete mode 100644 node_modules/string_decoder/lib/string_decoder.js delete mode 100644 node_modules/string_decoder/package.json delete mode 100644 node_modules/strip-ansi/index.js delete mode 100644 node_modules/strip-ansi/license delete mode 100644 node_modules/strip-ansi/node_modules/ansi-regex/index.js delete mode 100644 node_modules/strip-ansi/node_modules/ansi-regex/license delete mode 100644 node_modules/strip-ansi/node_modules/ansi-regex/package.json delete mode 100644 node_modules/strip-ansi/node_modules/ansi-regex/readme.md delete mode 100644 node_modules/strip-ansi/package.json delete mode 100644 node_modules/strip-ansi/readme.md delete mode 100644 node_modules/strip-eof/index.js delete mode 100644 node_modules/strip-eof/license delete mode 100644 node_modules/strip-eof/package.json delete mode 100644 node_modules/strip-eof/readme.md delete mode 100644 node_modules/subarg/.travis.yml delete mode 100644 node_modules/subarg/LICENSE delete mode 100644 node_modules/subarg/example/show.js delete mode 100644 node_modules/subarg/index.js delete mode 100644 node_modules/subarg/package.json delete mode 100644 node_modules/subarg/readme.markdown delete mode 100644 node_modules/subarg/test/arg.js delete mode 100644 node_modules/subarg/test/recursive.js delete mode 100755 node_modules/supports-color/cli.js delete mode 100644 node_modules/supports-color/index.js delete mode 100644 node_modules/supports-color/package.json delete mode 100644 node_modules/supports-color/readme.md delete mode 100644 node_modules/syntax-error/.travis.yml delete mode 100644 node_modules/syntax-error/LICENSE delete mode 100644 node_modules/syntax-error/example/check.js delete mode 100644 node_modules/syntax-error/example/src.js delete mode 100644 node_modules/syntax-error/index.js delete mode 100644 node_modules/syntax-error/package.json delete mode 100644 node_modules/syntax-error/readme.markdown delete mode 100644 node_modules/syntax-error/test/check.js delete mode 100644 node_modules/syntax-error/test/esm.js delete mode 100644 node_modules/syntax-error/test/html.js delete mode 100644 node_modules/syntax-error/test/ok.js delete mode 100644 node_modules/syntax-error/test/run.js delete mode 100644 node_modules/syntax-error/test/run2.js delete mode 100644 node_modules/syntax-error/test/shebang.js delete mode 100644 node_modules/syntax-error/test/sources/check.js delete mode 100644 node_modules/syntax-error/test/sources/esm.js delete mode 100644 node_modules/syntax-error/test/sources/ok.js delete mode 100644 node_modules/syntax-error/test/sources/run.js delete mode 100644 node_modules/syntax-error/test/sources/run2.js delete mode 100644 node_modules/syntax-error/test/sources/shebang.js delete mode 100644 node_modules/syntax-error/test/sources/spread.js delete mode 100644 node_modules/syntax-error/test/sources/yield.js delete mode 100644 node_modules/syntax-error/test/spread.js delete mode 100644 node_modules/syntax-error/test/yield.js delete mode 100644 node_modules/term-color/.jshintrc delete mode 100644 node_modules/term-color/.npmignore delete mode 100644 node_modules/term-color/.travis.yml delete mode 100644 node_modules/term-color/LICENSE delete mode 100644 node_modules/term-color/README.md delete mode 100644 node_modules/term-color/index.js delete mode 120000 node_modules/term-color/node_modules/.bin/supports-color delete mode 100644 node_modules/term-color/node_modules/ansi-styles/index.js delete mode 100644 node_modules/term-color/node_modules/ansi-styles/license delete mode 100644 node_modules/term-color/node_modules/ansi-styles/package.json delete mode 100644 node_modules/term-color/node_modules/ansi-styles/readme.md delete mode 100755 node_modules/term-color/node_modules/supports-color/cli.js delete mode 100644 node_modules/term-color/node_modules/supports-color/index.js delete mode 100644 node_modules/term-color/node_modules/supports-color/license delete mode 100644 node_modules/term-color/node_modules/supports-color/package.json delete mode 100644 node_modules/term-color/node_modules/supports-color/readme.md delete mode 100644 node_modules/term-color/package.json delete mode 100644 node_modules/term-color/test/index.js delete mode 100644 node_modules/through/.travis.yml delete mode 100644 node_modules/through/LICENSE.APACHE2 delete mode 100644 node_modules/through/LICENSE.MIT delete mode 100644 node_modules/through/index.js delete mode 100644 node_modules/through/package.json delete mode 100644 node_modules/through/readme.markdown delete mode 100644 node_modules/through/test/async.js delete mode 100644 node_modules/through/test/auto-destroy.js delete mode 100644 node_modules/through/test/buffering.js delete mode 100644 node_modules/through/test/end.js delete mode 100644 node_modules/through/test/index.js delete mode 100644 node_modules/through2/.npmignore delete mode 100644 node_modules/through2/LICENSE.html delete mode 100644 node_modules/through2/LICENSE.md delete mode 100644 node_modules/through2/README.md delete mode 100644 node_modules/through2/package.json delete mode 100644 node_modules/through2/through2.js delete mode 100644 node_modules/timers-browserify/.npmignore delete mode 100644 node_modules/timers-browserify/CHANGELOG.md delete mode 100644 node_modules/timers-browserify/LICENSE.md delete mode 100644 node_modules/timers-browserify/README.md delete mode 100755 node_modules/timers-browserify/example/enroll/build.sh delete mode 100644 node_modules/timers-browserify/example/enroll/index.html delete mode 100644 node_modules/timers-browserify/example/enroll/js/browserify.js delete mode 100644 node_modules/timers-browserify/example/enroll/js/main.js delete mode 100644 node_modules/timers-browserify/example/enroll/server.js delete mode 100644 node_modules/timers-browserify/main.js delete mode 100644 node_modules/timers-browserify/package.json delete mode 100644 node_modules/to-arraybuffer/.npmignore delete mode 100644 node_modules/to-arraybuffer/.travis.yml delete mode 100644 node_modules/to-arraybuffer/.zuul.yml delete mode 100644 node_modules/to-arraybuffer/LICENSE delete mode 100644 node_modules/to-arraybuffer/README.md delete mode 100644 node_modules/to-arraybuffer/index.js delete mode 100644 node_modules/to-arraybuffer/package.json delete mode 100644 node_modules/to-arraybuffer/test.js delete mode 100644 node_modules/to-object-path/LICENSE delete mode 100644 node_modules/to-object-path/README.md delete mode 100644 node_modules/to-object-path/index.js delete mode 100644 node_modules/to-object-path/package.json delete mode 100644 node_modules/to-regex-range/LICENSE delete mode 100644 node_modules/to-regex-range/README.md delete mode 100644 node_modules/to-regex-range/index.js delete mode 100644 node_modules/to-regex-range/node_modules/is-number/LICENSE delete mode 100644 node_modules/to-regex-range/node_modules/is-number/README.md delete mode 100644 node_modules/to-regex-range/node_modules/is-number/index.js delete mode 100644 node_modules/to-regex-range/node_modules/is-number/package.json delete mode 100644 node_modules/to-regex-range/package.json delete mode 100644 node_modules/to-regex/LICENSE delete mode 100644 node_modules/to-regex/README.md delete mode 100644 node_modules/to-regex/index.js delete mode 100644 node_modules/to-regex/package.json delete mode 100644 node_modules/tty-browserify/LICENSE delete mode 100644 node_modules/tty-browserify/index.js delete mode 100644 node_modules/tty-browserify/package.json delete mode 100644 node_modules/tty-browserify/readme.markdown delete mode 100644 node_modules/typedarray/.travis.yml delete mode 100644 node_modules/typedarray/LICENSE delete mode 100644 node_modules/typedarray/example/tarray.js delete mode 100644 node_modules/typedarray/index.js delete mode 100644 node_modules/typedarray/package.json delete mode 100644 node_modules/typedarray/readme.markdown delete mode 100644 node_modules/typedarray/test/server/undef_globals.js delete mode 100644 node_modules/typedarray/test/tarray.js delete mode 100644 node_modules/ultron/.npmignore delete mode 100644 node_modules/ultron/.travis.yml delete mode 100644 node_modules/ultron/LICENSE delete mode 100644 node_modules/ultron/README.md delete mode 100644 node_modules/ultron/index.js delete mode 100644 node_modules/ultron/package.json delete mode 100644 node_modules/ultron/test.js delete mode 100644 node_modules/umd/HISTORY.md delete mode 100644 node_modules/umd/LICENSE delete mode 100644 node_modules/umd/README.md delete mode 100755 node_modules/umd/bin/cli.js delete mode 100644 node_modules/umd/index.js delete mode 100644 node_modules/umd/package.json delete mode 100644 node_modules/undeclared-identifiers/.travis.yml delete mode 100644 node_modules/undeclared-identifiers/CHANGELOG.md delete mode 100644 node_modules/undeclared-identifiers/LICENSE.md delete mode 100644 node_modules/undeclared-identifiers/README.md delete mode 100644 node_modules/undeclared-identifiers/bench/index.js delete mode 100755 node_modules/undeclared-identifiers/bin.js delete mode 100644 node_modules/undeclared-identifiers/index.js delete mode 100644 node_modules/undeclared-identifiers/package.json delete mode 100644 node_modules/undeclared-identifiers/test/index.js delete mode 100644 node_modules/union-value/LICENSE delete mode 100644 node_modules/union-value/README.md delete mode 100644 node_modules/union-value/index.js delete mode 100644 node_modules/union-value/node_modules/extend-shallow/LICENSE delete mode 100644 node_modules/union-value/node_modules/extend-shallow/README.md delete mode 100644 node_modules/union-value/node_modules/extend-shallow/index.js delete mode 100644 node_modules/union-value/node_modules/extend-shallow/package.json delete mode 100644 node_modules/union-value/node_modules/set-value/LICENSE delete mode 100644 node_modules/union-value/node_modules/set-value/README.md delete mode 100644 node_modules/union-value/node_modules/set-value/index.js delete mode 100644 node_modules/union-value/node_modules/set-value/package.json delete mode 100644 node_modules/union-value/package.json delete mode 100644 node_modules/unset-value/LICENSE delete mode 100644 node_modules/unset-value/README.md delete mode 100644 node_modules/unset-value/index.js delete mode 100644 node_modules/unset-value/node_modules/has-value/LICENSE delete mode 100644 node_modules/unset-value/node_modules/has-value/README.md delete mode 100644 node_modules/unset-value/node_modules/has-value/index.js delete mode 100644 node_modules/unset-value/node_modules/has-value/node_modules/isobject/LICENSE delete mode 100644 node_modules/unset-value/node_modules/has-value/node_modules/isobject/README.md delete mode 100644 node_modules/unset-value/node_modules/has-value/node_modules/isobject/index.js delete mode 100644 node_modules/unset-value/node_modules/has-value/node_modules/isobject/package.json delete mode 100644 node_modules/unset-value/node_modules/has-value/package.json delete mode 100644 node_modules/unset-value/node_modules/has-values/LICENSE delete mode 100644 node_modules/unset-value/node_modules/has-values/README.md delete mode 100644 node_modules/unset-value/node_modules/has-values/index.js delete mode 100644 node_modules/unset-value/node_modules/has-values/package.json delete mode 100644 node_modules/unset-value/node_modules/isobject/LICENSE delete mode 100644 node_modules/unset-value/node_modules/isobject/README.md delete mode 100644 node_modules/unset-value/node_modules/isobject/index.d.ts delete mode 100644 node_modules/unset-value/node_modules/isobject/index.js delete mode 100644 node_modules/unset-value/node_modules/isobject/package.json delete mode 100644 node_modules/unset-value/package.json delete mode 100644 node_modules/urix/.jshintrc delete mode 100644 node_modules/urix/LICENSE delete mode 100644 node_modules/urix/index.js delete mode 100644 node_modules/urix/package.json delete mode 100644 node_modules/urix/readme.md delete mode 100644 node_modules/urix/test/index.js delete mode 100644 node_modules/url-trim/LICENSE.md delete mode 100644 node_modules/url-trim/README.md delete mode 100644 node_modules/url-trim/index.js delete mode 100644 node_modules/url-trim/package.json delete mode 100644 node_modules/url/.npmignore delete mode 100644 node_modules/url/.travis.yml delete mode 100644 node_modules/url/.zuul.yml delete mode 100644 node_modules/url/LICENSE delete mode 100644 node_modules/url/README.md delete mode 100644 node_modules/url/node_modules/punycode/LICENSE-MIT.txt delete mode 100644 node_modules/url/node_modules/punycode/README.md delete mode 100644 node_modules/url/node_modules/punycode/package.json delete mode 100644 node_modules/url/node_modules/punycode/punycode.js delete mode 100644 node_modules/url/package.json delete mode 100644 node_modules/url/test.js delete mode 100644 node_modules/url/url.js delete mode 100644 node_modules/url/util.js delete mode 100644 node_modules/use/LICENSE delete mode 100644 node_modules/use/README.md delete mode 100644 node_modules/use/index.js delete mode 100644 node_modules/use/package.json delete mode 100644 node_modules/util-deprecate/History.md delete mode 100644 node_modules/util-deprecate/LICENSE delete mode 100644 node_modules/util-deprecate/README.md delete mode 100644 node_modules/util-deprecate/browser.js delete mode 100644 node_modules/util-deprecate/node.js delete mode 100644 node_modules/util-deprecate/package.json delete mode 100644 node_modules/util/LICENSE delete mode 100644 node_modules/util/README.md delete mode 100644 node_modules/util/package.json delete mode 100644 node_modules/util/support/isBuffer.js delete mode 100644 node_modules/util/support/isBufferBrowser.js delete mode 100644 node_modules/util/util.js delete mode 100644 node_modules/vm-browserify/.travis.yml delete mode 100644 node_modules/vm-browserify/CHANGELOG.md delete mode 100644 node_modules/vm-browserify/LICENSE delete mode 100644 node_modules/vm-browserify/example/run/bundle.js delete mode 100644 node_modules/vm-browserify/example/run/entry.js delete mode 100644 node_modules/vm-browserify/example/run/index.html delete mode 100644 node_modules/vm-browserify/example/run/server.js delete mode 100644 node_modules/vm-browserify/index.js delete mode 100644 node_modules/vm-browserify/package.json delete mode 100644 node_modules/vm-browserify/readme.markdown delete mode 100644 node_modules/vm-browserify/test/vm.js delete mode 100644 node_modules/watchify-middleware/LICENSE.md delete mode 100644 node_modules/watchify-middleware/README.md delete mode 100644 node_modules/watchify-middleware/example/app.js delete mode 100644 node_modules/watchify-middleware/example/server.js delete mode 100644 node_modules/watchify-middleware/index.js delete mode 100644 node_modules/watchify-middleware/lib/bundler.js delete mode 100644 node_modules/watchify-middleware/lib/parse-error.js delete mode 100644 node_modules/watchify-middleware/package.json delete mode 100644 node_modules/watchify/.travis.yml delete mode 100644 node_modules/watchify/LICENSE delete mode 100644 node_modules/watchify/bin/args.js delete mode 100755 node_modules/watchify/bin/cmd.js delete mode 100644 node_modules/watchify/example/files/main.js delete mode 100644 node_modules/watchify/example/files/one.js delete mode 100644 node_modules/watchify/example/files/two.js delete mode 100644 node_modules/watchify/index.js delete mode 100644 node_modules/watchify/package.json delete mode 100644 node_modules/watchify/readme.markdown delete mode 100644 node_modules/watchify/test/api.js delete mode 100644 node_modules/watchify/test/api_brfs.js delete mode 100644 node_modules/watchify/test/api_ignore_watch.js delete mode 100644 node_modules/watchify/test/api_ignore_watch_default.js delete mode 100644 node_modules/watchify/test/api_ignore_watch_multiple.js delete mode 100644 node_modules/watchify/test/api_implicit_cache.js delete mode 100644 node_modules/watchify/test/bin.js delete mode 100644 node_modules/watchify/test/bin_brfs.js delete mode 100644 node_modules/watchify/test/bin_ignore_watch.js delete mode 100644 node_modules/watchify/test/bin_ignore_watch_default.js delete mode 100644 node_modules/watchify/test/bin_ignore_watch_multiple.js delete mode 100644 node_modules/watchify/test/bin_pipe.js delete mode 100644 node_modules/watchify/test/bin_plugins_pipelining_multiple_errors.js delete mode 100644 node_modules/watchify/test/bin_standalone.js delete mode 100644 node_modules/watchify/test/errors.js delete mode 100644 node_modules/watchify/test/errors_transform.js delete mode 100644 node_modules/watchify/test/expose.js delete mode 100644 node_modules/watchify/test/many.js delete mode 100644 node_modules/watchify/test/many_immediate.js delete mode 100644 node_modules/watchify/test/zzz.js delete mode 100644 node_modules/which/CHANGELOG.md delete mode 100644 node_modules/which/LICENSE delete mode 100644 node_modules/which/README.md delete mode 100755 node_modules/which/bin/which delete mode 100644 node_modules/which/package.json delete mode 100644 node_modules/which/which.js delete mode 100644 node_modules/wrappy/LICENSE delete mode 100644 node_modules/wrappy/README.md delete mode 100644 node_modules/wrappy/package.json delete mode 100644 node_modules/wrappy/wrappy.js delete mode 100644 node_modules/ws/README.md delete mode 100644 node_modules/ws/index.js delete mode 100644 node_modules/ws/lib/.DS_Store delete mode 100644 node_modules/ws/lib/BufferPool.js delete mode 100644 node_modules/ws/lib/BufferUtil.fallback.js delete mode 100644 node_modules/ws/lib/BufferUtil.js delete mode 100644 node_modules/ws/lib/ErrorCodes.js delete mode 100644 node_modules/ws/lib/Extensions.js delete mode 100644 node_modules/ws/lib/PerMessageDeflate.js delete mode 100644 node_modules/ws/lib/Receiver.hixie.js delete mode 100644 node_modules/ws/lib/Receiver.js delete mode 100644 node_modules/ws/lib/Sender.hixie.js delete mode 100644 node_modules/ws/lib/Sender.js delete mode 100644 node_modules/ws/lib/Validation.fallback.js delete mode 100644 node_modules/ws/lib/Validation.js delete mode 100644 node_modules/ws/lib/WebSocket.js delete mode 100644 node_modules/ws/lib/WebSocketServer.js delete mode 100644 node_modules/ws/package.json delete mode 100644 node_modules/xtend/.jshintrc delete mode 100644 node_modules/xtend/.npmignore delete mode 100644 node_modules/xtend/LICENCE delete mode 100644 node_modules/xtend/Makefile delete mode 100644 node_modules/xtend/README.md delete mode 100644 node_modules/xtend/immutable.js delete mode 100644 node_modules/xtend/mutable.js delete mode 100644 node_modules/xtend/package.json delete mode 100644 node_modules/xtend/test.js diff --git a/node_modules/.bin/JSONStream b/node_modules/.bin/JSONStream deleted file mode 120000 index 3983a36c6..000000000 --- a/node_modules/.bin/JSONStream +++ /dev/null @@ -1 +0,0 @@ -../JSONStream/bin.js \ No newline at end of file diff --git a/node_modules/.bin/acorn b/node_modules/.bin/acorn deleted file mode 120000 index cf7676038..000000000 --- a/node_modules/.bin/acorn +++ /dev/null @@ -1 +0,0 @@ -../acorn/bin/acorn \ No newline at end of file diff --git a/node_modules/.bin/atob b/node_modules/.bin/atob deleted file mode 120000 index a68344a38..000000000 --- a/node_modules/.bin/atob +++ /dev/null @@ -1 +0,0 @@ -../atob/bin/atob.js \ No newline at end of file diff --git a/node_modules/.bin/browser-pack b/node_modules/.bin/browser-pack deleted file mode 120000 index 1d047b955..000000000 --- a/node_modules/.bin/browser-pack +++ /dev/null @@ -1 +0,0 @@ -../browser-pack/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/browserify b/node_modules/.bin/browserify deleted file mode 120000 index ab156b35c..000000000 --- a/node_modules/.bin/browserify +++ /dev/null @@ -1 +0,0 @@ -../browserify/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/budo b/node_modules/.bin/budo deleted file mode 120000 index da99a43b5..000000000 --- a/node_modules/.bin/budo +++ /dev/null @@ -1 +0,0 @@ -../budo/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/deps-sort b/node_modules/.bin/deps-sort deleted file mode 120000 index b2dda9ef1..000000000 --- a/node_modules/.bin/deps-sort +++ /dev/null @@ -1 +0,0 @@ -../deps-sort/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/detective b/node_modules/.bin/detective deleted file mode 120000 index 8c3093afd..000000000 --- a/node_modules/.bin/detective +++ /dev/null @@ -1 +0,0 @@ -../detective/bin/detective.js \ No newline at end of file diff --git a/node_modules/.bin/garnish b/node_modules/.bin/garnish deleted file mode 120000 index facb2e0eb..000000000 --- a/node_modules/.bin/garnish +++ /dev/null @@ -1 +0,0 @@ -../garnish/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/has-ansi b/node_modules/.bin/has-ansi deleted file mode 120000 index c1e7413f1..000000000 --- a/node_modules/.bin/has-ansi +++ /dev/null @@ -1 +0,0 @@ -../has-ansi/cli.js \ No newline at end of file diff --git a/node_modules/.bin/insert-module-globals b/node_modules/.bin/insert-module-globals deleted file mode 120000 index 68af3a916..000000000 --- a/node_modules/.bin/insert-module-globals +++ /dev/null @@ -1 +0,0 @@ -../insert-module-globals/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/miller-rabin b/node_modules/.bin/miller-rabin deleted file mode 120000 index c175fe9f9..000000000 --- a/node_modules/.bin/miller-rabin +++ /dev/null @@ -1 +0,0 @@ -../miller-rabin/bin/miller-rabin \ No newline at end of file diff --git a/node_modules/.bin/mime b/node_modules/.bin/mime deleted file mode 120000 index fbb7ee0ee..000000000 --- a/node_modules/.bin/mime +++ /dev/null @@ -1 +0,0 @@ -../mime/cli.js \ No newline at end of file diff --git a/node_modules/.bin/mkdirp b/node_modules/.bin/mkdirp deleted file mode 120000 index 017896ceb..000000000 --- a/node_modules/.bin/mkdirp +++ /dev/null @@ -1 +0,0 @@ -../mkdirp/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/module-deps b/node_modules/.bin/module-deps deleted file mode 120000 index 66a1f2461..000000000 --- a/node_modules/.bin/module-deps +++ /dev/null @@ -1 +0,0 @@ -../module-deps/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver deleted file mode 120000 index 317eb293d..000000000 --- a/node_modules/.bin/semver +++ /dev/null @@ -1 +0,0 @@ -../semver/bin/semver \ No newline at end of file diff --git a/node_modules/.bin/sha.js b/node_modules/.bin/sha.js deleted file mode 120000 index 3c761051a..000000000 --- a/node_modules/.bin/sha.js +++ /dev/null @@ -1 +0,0 @@ -../sha.js/bin.js \ No newline at end of file diff --git a/node_modules/.bin/supports-color b/node_modules/.bin/supports-color deleted file mode 120000 index af0f05efe..000000000 --- a/node_modules/.bin/supports-color +++ /dev/null @@ -1 +0,0 @@ -../supports-color/cli.js \ No newline at end of file diff --git a/node_modules/.bin/umd b/node_modules/.bin/umd deleted file mode 120000 index 69767ed8c..000000000 --- a/node_modules/.bin/umd +++ /dev/null @@ -1 +0,0 @@ -../umd/bin/cli.js \ No newline at end of file diff --git a/node_modules/.bin/undeclared-identifiers b/node_modules/.bin/undeclared-identifiers deleted file mode 120000 index c95efdb46..000000000 --- a/node_modules/.bin/undeclared-identifiers +++ /dev/null @@ -1 +0,0 @@ -../undeclared-identifiers/bin.js \ No newline at end of file diff --git a/node_modules/.bin/watchify b/node_modules/.bin/watchify deleted file mode 120000 index 994b7318b..000000000 --- a/node_modules/.bin/watchify +++ /dev/null @@ -1 +0,0 @@ -../watchify/bin/cmd.js \ No newline at end of file diff --git a/node_modules/.bin/which b/node_modules/.bin/which deleted file mode 120000 index f62471c85..000000000 --- a/node_modules/.bin/which +++ /dev/null @@ -1 +0,0 @@ -../which/bin/which \ No newline at end of file diff --git a/node_modules/@babel/polyfill/LICENSE b/node_modules/@babel/polyfill/LICENSE deleted file mode 100644 index 620366eb9..000000000 --- a/node_modules/@babel/polyfill/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-2018 Sebastian McKenzie - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/polyfill/README.md b/node_modules/@babel/polyfill/README.md deleted file mode 100644 index 5f29e0f5a..000000000 --- a/node_modules/@babel/polyfill/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/polyfill - -> Provides polyfills necessary for a full ES2015+ environment - -See our website [@babel/polyfill](https://babeljs.io/docs/en/next/babel-polyfill.html) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20polyfill%22+is%3Aopen) associated with this package. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/polyfill -``` - -or using yarn: - -```sh -yarn add @babel/polyfill --dev -``` diff --git a/node_modules/@babel/polyfill/browser.js b/node_modules/@babel/polyfill/browser.js deleted file mode 100644 index 08a010af8..000000000 --- a/node_modules/@babel/polyfill/browser.js +++ /dev/null @@ -1,3 +0,0 @@ -!function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var c="function"==typeof require&&require;if(!u&&c)return c(o,!0);if(i)return i(o,!0);var a=new Error("Cannot find module '"+o+"'");throw a.code="MODULE_NOT_FOUND",a}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(n){var r=t[o][1][n];return s(r||n)},f,f.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o2?arguments[2]:void 0,s=Math.min((void 0===f?u:i(f,u))-a,u-c),l=1;for(a0;)a in r?r[c]=r[a]:delete r[c],c+=l,a+=l;return r}},{110:110,114:114,115:115}],17:[function(t,n,r){"use strict";var e=t(115),i=t(110),o=t(114);n.exports=function fill(t){for(var n=e(this),r=o(n.length),u=arguments.length,c=i(u>1?arguments[1]:void 0,r),a=u>2?arguments[2]:void 0,f=void 0===a?r:i(a,r);f>c;)n[c++]=t;return n}},{110:110,114:114,115:115}],18:[function(t,n,r){var e=t(113),i=t(114),o=t(110);n.exports=function(t){return function(n,r,u){var c,a=e(n),f=i(a.length),s=o(u,f);if(t&&r!=r){for(;f>s;)if((c=a[s++])!=c)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===r)return t||s||0;return!t&&-1}}},{110:110,113:113,114:114}],19:[function(t,n,r){var e=t(31),i=t(52),o=t(115),u=t(114),c=t(22);n.exports=function(t,n){var r=1==t,a=2==t,f=3==t,s=4==t,l=6==t,h=5==t||l,p=n||c;return function(n,c,v){for(var y,d,g=o(n),m=i(g),x=e(c,v,3),b=u(m.length),w=0,S=r?p(n,b):a?p(n,0):void 0;b>w;w++)if((h||w in m)&&(y=m[w],d=x(y,w,g),t))if(r)S[w]=d;else if(d)switch(t){case 3:return!0;case 5:return y;case 6:return w;case 2:S.push(y)}else if(s)return!1;return l?-1:f||s?s:S}}},{114:114,115:115,22:22,31:31,52:52}],20:[function(t,n,r){var e=t(11),i=t(115),o=t(52),u=t(114);n.exports=function(t,n,r,c,a){e(n);var f=i(t),s=o(f),l=u(f.length),h=a?l-1:0,p=a?-1:1;if(r<2)for(;;){if(h in s){c=s[h],h+=p;break}if(h+=p,a?h<0:l<=h)throw TypeError("Reduce of empty array with no initial value")}for(;a?h>=0:l>h;h+=p)h in s&&(c=n(c,s[h],h,f));return c}},{11:11,114:114,115:115,52:52}],21:[function(t,n,r){var e=t(56),i=t(54),o=t(125)("species");n.exports=function(t){var n;return i(t)&&(n=t.constructor,"function"!=typeof n||n!==Array&&!i(n.prototype)||(n=void 0),e(n)&&null===(n=n[o])&&(n=void 0)),void 0===n?Array:n}},{125:125,54:54,56:56}],22:[function(t,n,r){var e=t(21);n.exports=function(t,n){return new(e(t))(n)}},{21:21}],23:[function(t,n,r){"use strict";var e=t(11),i=t(56),o=t(51),u=[].slice,c={},a=function(t,n,r){if(!(n in c)){for(var e=[],i=0;i1?arguments[1]:void 0,3);r=r?r.n:this._f;)for(e(r.v,r.k,this);r&&r.r;)r=r.p},has:function has(t){return!!d(v(this,n),t)}}),h&&e(s.prototype,"size",{get:function(){return v(this,n)[y]}}),s},def:function(t,n,r){var e,i,o=d(t,n);return o?o.v=r:(t._l=o={i:i=p(n,!0),k:n,v:r,p:e=t._l,n:void 0,r:!1},t._f||(t._f=o),e&&(e.n=o),t[y]++,"F"!==i&&(t._i[i]=o)),t},getEntry:d,setStrong:function(t,n,r){f(t,n,function(t,r){this._t=v(t,n),this._k=r,this._l=void 0},function(){for(var t=this,n=t._k,r=t._l;r&&r.r;)r=r.p;return t._t&&(t._l=r=r?r.n:t._t._f)?"keys"==n?s(0,r.k):"values"==n?s(0,r.v):s(0,[r.k,r.v]):(t._t=void 0,s(1))},r?"entries":"values",!r,!0),l(n)}}},{122:122,14:14,31:31,35:35,44:44,60:60,62:62,69:69,73:73,74:74,92:92,96:96}],27:[function(t,n,r){"use strict";var e=t(92),i=t(69).getWeak,o=t(15),u=t(56),c=t(14),a=t(44),f=t(19),s=t(46),l=t(122),h=f(5),p=f(6),v=0,y=function(t){return t._l||(t._l=new d)},d=function(){this.a=[]},g=function(t,n){return h(t.a,function(t){return t[0]===n})};d.prototype={get:function(t){var n=g(this,t);if(n)return n[1]},has:function(t){return!!g(this,t)},set:function(t,n){var r=g(this,t);r?r[1]=n:this.a.push([t,n])},delete:function(t){var n=p(this.a,function(n){return n[0]===t});return~n&&this.a.splice(n,1),!!~n}},n.exports={getConstructor:function(t,n,r,o){var f=t(function(t,e){c(t,f,n,"_i"),t._t=n,t._i=v++,t._l=void 0,void 0!=e&&a(e,r,t[o],t)});return e(f.prototype,{delete:function(t){if(!u(t))return!1;var r=i(t);return!0===r?y(l(this,n)).delete(t):r&&s(r,this._i)&&delete r[this._i]},has:function has(t){if(!u(t))return!1;var r=i(t);return!0===r?y(l(this,n)).has(t):r&&s(r,this._i)}}),f},def:function(t,n,r){var e=i(o(n),!0);return!0===e?y(t).set(n,r):e[t._i]=r,t},ufstore:y}},{122:122,14:14,15:15,19:19,44:44,46:46,56:56,69:69,92:92}],28:[function(t,n,r){"use strict";var e=t(45),i=t(39),o=t(93),u=t(92),c=t(69),a=t(44),f=t(14),s=t(56),l=t(41),h=t(61),p=t(97),v=t(50);n.exports=function(t,n,r,y,d,g){var m=e[t],x=m,b=d?"set":"add",w=x&&x.prototype,S={},_=function(t){var n=w[t];o(w,t,"delete"==t?function(t){return!(g&&!s(t))&&n.call(this,0===t?0:t)}:"has"==t?function has(t){return!(g&&!s(t))&&n.call(this,0===t?0:t)}:"get"==t?function get(t){return g&&!s(t)?void 0:n.call(this,0===t?0:t)}:"add"==t?function add(t){return n.call(this,0===t?0:t),this}:function set(t,r){return n.call(this,0===t?0:t,r),this})};if("function"==typeof x&&(g||w.forEach&&!l(function(){(new x).entries().next()}))){var E=new x,F=E[b](g?{}:-0,1)!=E,O=l(function(){E.has(1)}),P=h(function(t){new x(t)}),I=!g&&l(function(){for(var t=new x,n=5;n--;)t[b](n,n);return!t.has(-0)});P||(x=n(function(n,r){f(n,x,t);var e=v(new m,n,x);return void 0!=r&&a(r,d,e[b],e),e}),x.prototype=w,w.constructor=x),(O||I)&&(_("delete"),_("has"),d&&_("get")),(I||F)&&_(b),g&&w.clear&&delete w.clear}else x=y.getConstructor(n,t,d,b),u(x.prototype,r),c.NEED=!0;return p(x,t),S[t]=x,i(i.G+i.W+i.F*(x!=m),S),g||y.setStrong(x,t,d),x}},{14:14,39:39,41:41,44:44,45:45,50:50,56:56,61:61,69:69,92:92,93:93,97:97}],29:[function(t,n,r){var e=n.exports={version:"2.5.7"};"number"==typeof __e&&(__e=e)},{}],30:[function(t,n,r){"use strict";var e=t(74),i=t(91);n.exports=function(t,n,r){n in t?e.f(t,n,i(0,r)):t[n]=r}},{74:74,91:91}],31:[function(t,n,r){var e=t(11);n.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,i){return t.call(n,r,e,i)}}return function(){return t.apply(n,arguments)}}},{11:11}],32:[function(t,n,r){"use strict";var e=t(41),i=Date.prototype.getTime,o=Date.prototype.toISOString,u=function(t){return t>9?t:"0"+t};n.exports=e(function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-5e13-1))})||!e(function(){o.call(new Date(NaN))})?function toISOString(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var t=this,n=t.getUTCFullYear(),r=t.getUTCMilliseconds(),e=n<0?"-":n>9999?"+":"";return e+("00000"+Math.abs(n)).slice(e?-6:-4)+"-"+u(t.getUTCMonth()+1)+"-"+u(t.getUTCDate())+"T"+u(t.getUTCHours())+":"+u(t.getUTCMinutes())+":"+u(t.getUTCSeconds())+"."+(r>99?r:"0"+u(r))+"Z"}:o},{41:41}],33:[function(t,n,r){"use strict";var e=t(15),i=t(116);n.exports=function(t){if("string"!==t&&"number"!==t&&"default"!==t)throw TypeError("Incorrect hint");return i(e(this),"number"!=t)}},{116:116,15:15}],34:[function(t,n,r){n.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},{}],35:[function(t,n,r){n.exports=!t(41)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{41:41}],36:[function(t,n,r){var e=t(56),i=t(45).document,o=e(i)&&e(i.createElement);n.exports=function(t){return o?i.createElement(t):{}}},{45:45,56:56}],37:[function(t,n,r){n.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],38:[function(t,n,r){var e=t(82),i=t(79),o=t(83);n.exports=function(t){var n=e(t),r=i.f;if(r)for(var u,c=r(t),a=o.f,f=0;c.length>f;)a.call(t,u=c[f++])&&n.push(u);return n}},{79:79,82:82,83:83}],39:[function(t,n,r){var e=t(45),i=t(29),o=t(47),u=t(93),c=t(31),a=function(t,n,r){var f,s,l,h,p=t&a.F,v=t&a.G,y=t&a.S,d=t&a.P,g=t&a.B,m=v?e:y?e[n]||(e[n]={}):(e[n]||{}).prototype,x=v?i:i[n]||(i[n]={}),b=x.prototype||(x.prototype={});v&&(r=n);for(f in r)s=!p&&m&&void 0!==m[f],l=(s?m:r)[f],h=g&&s?c(l,e):d&&"function"==typeof l?c(Function.call,l):l,m&&u(m,f,l,t&a.U),x[f]!=l&&o(x,f,h),d&&b[f]!=l&&(b[f]=l)};e.core=i,a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,n.exports=a},{29:29,31:31,45:45,47:47,93:93}],40:[function(t,n,r){var e=t(125)("match");n.exports=function(t){var n=/./;try{"/./"[t](n)}catch(r){try{return n[e]=!1,!"/./"[t](n)}catch(t){}}return!0}},{125:125}],41:[function(t,n,r){n.exports=function(t){try{return!!t()}catch(t){return!0}}},{}],42:[function(t,n,r){"use strict";var e=t(47),i=t(93),o=t(41),u=t(34),c=t(125);n.exports=function(t,n,r){var a=c(t),f=r(u,a,""[t]),s=f[0],l=f[1];o(function(){var n={};return n[a]=function(){return 7},7!=""[t](n)})&&(i(String.prototype,t,s),e(RegExp.prototype,a,2==n?function(t,n){return l.call(t,this,n)}:function(t){return l.call(t,this)}))}},{125:125,34:34,41:41,47:47,93:93}],43:[function(t,n,r){"use strict";var e=t(15);n.exports=function(){var t=e(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}},{15:15}],44:[function(t,n,r){var e=t(31),i=t(58),o=t(53),u=t(15),c=t(114),a=t(126),f={},s={},r=n.exports=function(t,n,r,l,h){var p,v,y,d,g=h?function(){return t}:a(t),m=e(r,l,n?2:1),x=0;if("function"!=typeof g)throw TypeError(t+" is not iterable!");if(o(g)){for(p=c(t.length);p>x;x++)if((d=n?m(u(v=t[x])[0],v[1]):m(t[x]))===f||d===s)return d}else for(y=g.call(t);!(v=y.next()).done;)if((d=i(y,m,v.value,n))===f||d===s)return d};r.BREAK=f,r.RETURN=s},{114:114,126:126,15:15,31:31,53:53,58:58}],45:[function(t,n,r){var e=n.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},{}],46:[function(t,n,r){var e={}.hasOwnProperty;n.exports=function(t,n){return e.call(t,n)}},{}],47:[function(t,n,r){var e=t(74),i=t(91);n.exports=t(35)?function(t,n,r){return e.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},{35:35,74:74,91:91}],48:[function(t,n,r){var e=t(45).document;n.exports=e&&e.documentElement},{45:45}],49:[function(t,n,r){n.exports=!t(35)&&!t(41)(function(){return 7!=Object.defineProperty(t(36)("div"),"a",{get:function(){return 7}}).a})},{35:35,36:36,41:41}],50:[function(t,n,r){var e=t(56),i=t(95).set;n.exports=function(t,n,r){var o,u=n.constructor;return u!==r&&"function"==typeof u&&(o=u.prototype)!==r.prototype&&e(o)&&i&&i(t,o),t}},{56:56,95:95}],51:[function(t,n,r){n.exports=function(t,n,r){var e=void 0===r;switch(n.length){case 0:return e?t():t.call(r);case 1:return e?t(n[0]):t.call(r,n[0]);case 2:return e?t(n[0],n[1]):t.call(r,n[0],n[1]);case 3:return e?t(n[0],n[1],n[2]):t.call(r,n[0],n[1],n[2]);case 4:return e?t(n[0],n[1],n[2],n[3]):t.call(r,n[0],n[1],n[2],n[3])}return t.apply(r,n)}},{}],52:[function(t,n,r){var e=t(25);n.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}},{25:25}],53:[function(t,n,r){var e=t(63),i=t(125)("iterator"),o=Array.prototype;n.exports=function(t){return void 0!==t&&(e.Array===t||o[i]===t)}},{125:125,63:63}],54:[function(t,n,r){var e=t(25);n.exports=Array.isArray||function isArray(t){return"Array"==e(t)}},{25:25}],55:[function(t,n,r){var e=t(56),i=Math.floor;n.exports=function isInteger(t){return!e(t)&&isFinite(t)&&i(t)===t}},{56:56}],56:[function(t,n,r){n.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},{}],57:[function(t,n,r){var e=t(56),i=t(25),o=t(125)("match");n.exports=function(t){var n;return e(t)&&(void 0!==(n=t[o])?!!n:"RegExp"==i(t))}},{125:125,25:25,56:56}],58:[function(t,n,r){var e=t(15);n.exports=function(t,n,r,i){try{return i?n(e(r)[0],r[1]):n(r)}catch(n){var o=t.return;throw void 0!==o&&e(o.call(t)),n}}},{15:15}],59:[function(t,n,r){"use strict";var e=t(73),i=t(91),o=t(97),u={};t(47)(u,t(125)("iterator"),function(){return this}),n.exports=function(t,n,r){t.prototype=e(u,{next:i(1,r)}),o(t,n+" Iterator")}},{125:125,47:47,73:73,91:91,97:97}],60:[function(t,n,r){"use strict";var e=t(64),i=t(39),o=t(93),u=t(47),c=t(63),a=t(59),f=t(97),s=t(80),l=t(125)("iterator"),h=!([].keys&&"next"in[].keys()),p=function(){return this};n.exports=function(t,n,r,v,y,d,g){a(r,n,v);var m,x,b,w=function(t){if(!h&&t in F)return F[t];switch(t){case"keys":return function keys(){return new r(this,t)};case"values":return function values(){return new r(this,t)}}return function entries(){return new r(this,t)}},S=n+" Iterator",_="values"==y,E=!1,F=t.prototype,O=F[l]||F["@@iterator"]||y&&F[y],P=O||w(y),I=y?_?w("entries"):P:void 0,A="Array"==n?F.entries||O:O;if(A&&(b=s(A.call(new t)))!==Object.prototype&&b.next&&(f(b,S,!0),e||"function"==typeof b[l]||u(b,l,p)),_&&O&&"values"!==O.name&&(E=!0,P=function values(){return O.call(this)}),e&&!g||!h&&!E&&F[l]||u(F,l,P),c[n]=P,c[S]=p,y)if(m={values:_?P:w("values"),keys:d?P:w("keys"),entries:I},g)for(x in m)x in F||o(F,x,m[x]);else i(i.P+i.F*(h||E),n,m);return m}},{125:125,39:39,47:47,59:59,63:63,64:64,80:80,93:93,97:97}],61:[function(t,n,r){var e=t(125)("iterator"),i=!1;try{var o=[7][e]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(t){}n.exports=function(t,n){if(!n&&!i)return!1;var r=!1;try{var o=[7],u=o[e]();u.next=function(){return{done:r=!0}},o[e]=function(){return u},t(o)}catch(t){}return r}},{125:125}],62:[function(t,n,r){n.exports=function(t,n){return{value:n,done:!!t}}},{}],63:[function(t,n,r){n.exports={}},{}],64:[function(t,n,r){n.exports=!1},{}],65:[function(t,n,r){var e=Math.expm1;n.exports=!e||e(10)>22025.465794806718||e(10)<22025.465794806718||-2e-17!=e(-2e-17)?function expm1(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:e},{}],66:[function(t,n,r){var e=t(68),i=Math.pow,o=i(2,-52),u=i(2,-23),c=i(2,127)*(2-u),a=i(2,-126),f=function(t){return t+1/o-1/o};n.exports=Math.fround||function fround(t){var n,r,i=Math.abs(t),s=e(t);return ic||r!=r?s*(1/0):s*r)}},{68:68}],67:[function(t,n,r){n.exports=Math.log1p||function log1p(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},{}],68:[function(t,n,r){n.exports=Math.sign||function sign(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},{}],69:[function(t,n,r){var e=t(120)("meta"),i=t(56),o=t(46),u=t(74).f,c=0,a=Object.isExtensible||function(){return!0},f=!t(41)(function(){return a(Object.preventExtensions({}))}),s=function(t){u(t,e,{value:{i:"O"+ ++c,w:{}}})},l=function(t,n){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,e)){if(!a(t))return"F";if(!n)return"E";s(t)}return t[e].i},h=function(t,n){if(!o(t,e)){if(!a(t))return!0;if(!n)return!1;s(t)}return t[e].w},p=function(t){return f&&v.NEED&&a(t)&&!o(t,e)&&s(t),t},v=n.exports={KEY:e,NEED:!1,fastKey:l,getWeak:h,onFreeze:p}},{120:120,41:41,46:46,56:56,74:74}],70:[function(t,n,r){var e=t(45),i=t(109).set,o=e.MutationObserver||e.WebKitMutationObserver,u=e.process,c=e.Promise,a="process"==t(25)(u);n.exports=function(){var t,n,r,f=function(){var e,i;for(a&&(e=u.domain)&&e.exit();t;){i=t.fn,t=t.next;try{i()}catch(e){throw t?r():n=void 0,e}}n=void 0,e&&e.enter()};if(a)r=function(){u.nextTick(f)};else if(!o||e.navigator&&e.navigator.standalone)if(c&&c.resolve){var s=c.resolve(void 0);r=function(){s.then(f)}}else r=function(){i.call(e,f)};else{var l=!0,h=document.createTextNode("");new o(f).observe(h,{characterData:!0}),r=function(){h.data=l=!l}}return function(e){var i={fn:e,next:void 0};n&&(n.next=i),t||(t=i,r()),n=i}}},{109:109,25:25,45:45}],71:[function(t,n,r){"use strict";function PromiseCapability(t){var n,r;this.promise=new t(function(t,e){if(void 0!==n||void 0!==r)throw TypeError("Bad Promise constructor");n=t,r=e}),this.resolve=e(n),this.reject=e(r)}var e=t(11);n.exports.f=function(t){return new PromiseCapability(t)}},{11:11}],72:[function(t,n,r){"use strict";var e=t(82),i=t(79),o=t(83),u=t(115),c=t(52),a=Object.assign;n.exports=!a||t(41)(function(){var t={},n={},r=Symbol(),e="abcdefghijklmnopqrst";return t[r]=7,e.split("").forEach(function(t){n[t]=t}),7!=a({},t)[r]||Object.keys(a({},n)).join("")!=e})?function assign(t,n){for(var r=u(t),a=arguments.length,f=1,s=i.f,l=o.f;a>f;)for(var h,p=c(arguments[f++]),v=s?e(p).concat(s(p)):e(p),y=v.length,d=0;y>d;)l.call(p,h=v[d++])&&(r[h]=p[h]);return r}:a},{115:115,41:41,52:52,79:79,82:82,83:83}],73:[function(t,n,r){var e=t(15),i=t(75),o=t(37),u=t(98)("IE_PROTO"),c=function(){},a=function(){var n,r=t(36)("iframe"),e=o.length;for(r.style.display="none",t(48).appendChild(r),r.src="javascript:",n=r.contentWindow.document,n.open(),n.write(" - diff --git a/node_modules/browserify/example/multiple_bundles/static/boop.html b/node_modules/browserify/example/multiple_bundles/static/boop.html deleted file mode 100644 index 13dab7e84..000000000 --- a/node_modules/browserify/example/multiple_bundles/static/boop.html +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/node_modules/browserify/example/source_maps/build.js b/node_modules/browserify/example/source_maps/build.js deleted file mode 100644 index e65bc7e62..000000000 --- a/node_modules/browserify/example/source_maps/build.js +++ /dev/null @@ -1,13 +0,0 @@ -var browserify = require('../..'), - path = require('path'), - fs = require('fs'), - bundlePath = path.join(__dirname, 'js', 'build', 'bundle.js'); - -browserify() - .require(require.resolve('./js/main.js'), { - entry: true, - debug: true - }) - .bundle() - .on('error', function (err) { console.error(err); }) - .pipe(fs.createWriteStream(bundlePath)); diff --git a/node_modules/browserify/example/source_maps/build.sh b/node_modules/browserify/example/source_maps/build.sh deleted file mode 100755 index 6ae19fb06..000000000 --- a/node_modules/browserify/example/source_maps/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -../../bin/cmd.js --debug -e ./js/main.js > js/build/bundle.js - -echo bundle was generated with source maps, you can now open index.html diff --git a/node_modules/browserify/example/source_maps/index.html b/node_modules/browserify/example/source_maps/index.html deleted file mode 100644 index d06c889dd..000000000 --- a/node_modules/browserify/example/source_maps/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - -

    Open your dev tools ;)

    - - diff --git a/node_modules/browserify/example/source_maps/js/build/.npmignore b/node_modules/browserify/example/source_maps/js/build/.npmignore deleted file mode 100644 index f935021a8..000000000 --- a/node_modules/browserify/example/source_maps/js/build/.npmignore +++ /dev/null @@ -1 +0,0 @@ -!.gitignore diff --git a/node_modules/browserify/example/source_maps/js/build/bundle.js b/node_modules/browserify/example/source_maps/js/build/bundle.js deleted file mode 100644 index a807c46f8..000000000 --- a/node_modules/browserify/example/source_maps/js/build/bundle.js +++ /dev/null @@ -1,28 +0,0 @@ -;(function(e,t,n,r){function i(r){if(!n[r]){if(!t[r]){if(e)return e(r);throw new Error("Cannot find module '"+r+"'")}var s=n[r]={exports:{}};t[r][0](function(e){var n=t[r][1][e];return i(n?n:e)},s,s.exports)}return n[r].exports}for(var s=0;s= 0) return next(); - if (self._external.indexOf(row.file) >= 0) return next(); - - if (isAbsolutePath(row.id)) { - row.id = '/' + relativePath(basedir, row.file); - } - Object.keys(row.deps || {}).forEach(function (key) { - row.deps[key] = '/' + relativePath(basedir, row.deps[key]); - }); - this.push(row); - next(); - })); - } - return pipeline; -}; - -Browserify.prototype._createDeps = function (opts) { - var self = this; - var mopts = xtend(opts); - var basedir = defined(opts.basedir, process.cwd()); - - // Let mdeps populate these values since it will be resolving file paths - // anyway. - mopts.expose = this._expose; - mopts.extensions = [ '.js', '.json' ].concat(mopts.extensions || []); - self._extensions = mopts.extensions; - - mopts.transform = []; - mopts.transformKey = defined(opts.transformKey, [ 'browserify', 'transform' ]); - mopts.postFilter = function (id, file, pkg) { - if (opts.postFilter && !opts.postFilter(id, file, pkg)) return false; - if (self._external.indexOf(file) >= 0) return false; - if (self._exclude.indexOf(file) >= 0) return false; - - //filter transforms on module dependencies - if (pkg && pkg.browserify && pkg.browserify.transform) { - //In edge cases it may be a string - pkg.browserify.transform = [].concat(pkg.browserify.transform) - .filter(Boolean) - .filter(self._filterTransform); - } - return true; - }; - mopts.filter = function (id) { - if (opts.filter && !opts.filter(id)) return false; - if (self._external.indexOf(id) >= 0) return false; - if (self._exclude.indexOf(id) >= 0) return false; - if (opts.bundleExternal === false && isExternalModule(id)) { - return false; - } - return true; - }; - mopts.resolve = function (id, parent, cb) { - if (self._ignore.indexOf(id) >= 0) return cb(null, paths.empty, {}); - - self._bresolve(id, parent, function (err, file, pkg) { - if (file && self._ignore.indexOf(file) >= 0) { - return cb(null, paths.empty, {}); - } - if (file && self._ignore.length) { - var nm = file.replace(/\\/g, '/').split('/node_modules/')[1]; - if (nm) { - nm = nm.split('/')[0]; - if (self._ignore.indexOf(nm) >= 0) { - return cb(null, paths.empty, {}); - } - } - } - - if (file) { - var ex = '/' + relativePath(basedir, file); - if (self._external.indexOf(ex) >= 0) { - return cb(null, ex); - } - if (self._exclude.indexOf(ex) >= 0) { - return cb(null, ex); - } - if (self._ignore.indexOf(ex) >= 0) { - return cb(null, paths.empty, {}); - } - } - if (err) cb(err, file, pkg) - else if (file) { - if (opts.preserveSymlinks && parent.id !== self._mdeps.top.id) { - return cb(err, path.resolve(file), pkg, file) - } - - fs.realpath(file, function (err, res) { - cb(err, res, pkg, file); - }); - } else cb(err, null, pkg) - }); - }; - - if (opts.builtins === false) { - mopts.modules = {}; - self._exclude.push.apply(self._exclude, Object.keys(builtins)); - } - else if (opts.builtins && isArray(opts.builtins)) { - mopts.modules = {}; - opts.builtins.forEach(function (key) { - mopts.modules[key] = builtins[key]; - }); - } - else if (opts.builtins && typeof opts.builtins === 'object') { - mopts.modules = opts.builtins; - } - else mopts.modules = xtend(builtins); - - Object.keys(builtins).forEach(function (key) { - if (!has(mopts.modules, key)) self._exclude.push(key); - }); - - mopts.globalTransform = []; - if (!this._bundled) { - this.once('bundle', function () { - self.pipeline.write({ - transform: globalTr, - global: true, - options: {} - }); - }); - } - - var no = [].concat(opts.noParse).filter(Boolean); - var absno = no.filter(function(x) { - return typeof x === 'string'; - }).map(function (x) { - return path.resolve(basedir, x); - }); - - function globalTr (file) { - if (opts.detectGlobals === false) return through(); - - if (opts.noParse === true) return through(); - if (no.indexOf(file) >= 0) return through(); - if (absno.indexOf(file) >= 0) return through(); - - var parts = file.replace(/\\/g, '/').split('/node_modules/'); - for (var i = 0; i < no.length; i++) { - if (typeof no[i] === 'function' && no[i](file)) { - return through(); - } - else if (no[i] === parts[parts.length-1].split('/')[0]) { - return through(); - } - else if (no[i] === parts[parts.length-1]) { - return through(); - } - } - - if (opts.commondir === false && opts.builtins === false) { - opts.insertGlobalVars = xtend({ - __dirname: function(file, basedir) { - var dir = path.dirname(path.relative(basedir, file)); - return 'require("path").join(__dirname,' + dir.split(path.sep).map(JSON.stringify).join(',') + ')'; - }, - __filename: function(file, basedir) { - var filename = path.relative(basedir, file); - return 'require("path").join(__dirname,' + filename.split(path.sep).map(JSON.stringify).join(',') + ')'; - } - }, opts.insertGlobalVars); - } - - var vars = xtend({ - process: function () { return "require('_process')" }, - }, opts.insertGlobalVars); - - if (opts.bundleExternal === false) { - vars.process = undefined; - vars.buffer = undefined; - } - - return insertGlobals(file, xtend(opts, { - debug: opts.debug, - always: opts.insertGlobals, - basedir: opts.commondir === false && isArray(opts.builtins) - ? '/' - : opts.basedir || process.cwd() - , - vars: vars - })); - } - return mdeps(mopts); -}; - -Browserify.prototype._recorder = function (opts) { - var self = this; - var ended = false; - this._recorded = []; - - if (!this._ticked) { - process.nextTick(function () { - self._ticked = true; - self._recorded.forEach(function (row) { - stream.push(row); - }); - if (ended) stream.push(null); - }); - } - - var stream = through.obj(write, end); - return stream; - - function write (row, enc, next) { - self._recorded.push(row); - if (self._ticked) this.push(row); - next(); - } - function end () { - ended = true; - if (self._ticked) this.push(null); - } -}; - -Browserify.prototype._json = function () { - return through.obj(function (row, enc, next) { - if (/\.json$/.test(row.file)) { - row.source = 'module.exports=' + sanitize(row.source); - } - this.push(row); - next(); - }); -}; - -Browserify.prototype._unbom = function () { - return through.obj(function (row, enc, next) { - if (/^\ufeff/.test(row.source)) { - row.source = row.source.replace(/^\ufeff/, ''); - } - this.push(row); - next(); - }); -}; - -Browserify.prototype._unshebang = function () { - return through.obj(function (row, enc, next) { - if (/^#!/.test(row.source)) { - row.source = row.source.replace(/^#![^\n]*\n/, ''); - } - this.push(row); - next(); - }); -}; - -Browserify.prototype._syntax = function () { - var self = this; - return through.obj(function (row, enc, next) { - var h = shasum(row.source); - if (typeof self._syntaxCache[h] === 'undefined') { - var err = syntaxError(row.source, row.file || row.id); - if (err) return this.emit('error', err); - self._syntaxCache[h] = true; - } - this.push(row); - next(); - }); -}; - -Browserify.prototype._dedupe = function () { - return through.obj(function (row, enc, next) { - if (!row.dedupeIndex && row.dedupe) { - row.source = 'arguments[4][' - + JSON.stringify(row.dedupe) - + '][0].apply(exports,arguments)' - ; - row.nomap = true; - } - else if (row.dedupeIndex) { - row.source = 'arguments[4][' - + JSON.stringify(row.dedupeIndex) - + '][0].apply(exports,arguments)' - ; - row.nomap = true; - } - if (row.dedupeIndex && row.indexDeps) { - row.indexDeps.dup = row.dedupeIndex; - } - this.push(row); - next(); - }); -}; - -Browserify.prototype._label = function (opts) { - var self = this; - var basedir = defined(opts.basedir, process.cwd()); - - return through.obj(function (row, enc, next) { - var prev = row.id; - - if (self._external.indexOf(row.id) >= 0) return next(); - if (self._external.indexOf('/' + relativePath(basedir, row.id)) >= 0) { - return next(); - } - if (self._external.indexOf(row.file) >= 0) return next(); - - if (row.index) row.id = row.index; - - self.emit('label', prev, row.id); - if (row.indexDeps) row.deps = row.indexDeps || {}; - - Object.keys(row.deps).forEach(function (key) { - if (self._expose[key]) { - row.deps[key] = key; - return; - } - - var afile = path.resolve(path.dirname(row.file), key); - var rfile = '/' + relativePath(basedir, afile); - if (self._external.indexOf(rfile) >= 0) { - row.deps[key] = rfile; - } - if (self._external.indexOf(afile) >= 0) { - row.deps[key] = rfile; - } - if (self._external.indexOf(key) >= 0) { - row.deps[key] = key; - return; - } - - for (var i = 0; i < self._extensions.length; i++) { - var ex = self._extensions[i]; - if (self._external.indexOf(rfile + ex) >= 0) { - row.deps[key] = rfile + ex; - break; - } - } - }); - - if (row.entry || row.expose) { - self._bpack.standaloneModule = row.id; - } - this.push(row); - next(); - }); -}; - -Browserify.prototype._emitDeps = function () { - var self = this; - return through.obj(function (row, enc, next) { - self.emit('dep', row); - this.push(row); - next(); - }) -}; - -Browserify.prototype._debug = function (opts) { - var basedir = defined(opts.basedir, process.cwd()); - return through.obj(function (row, enc, next) { - if (opts.debug) { - row.sourceRoot = 'file://localhost'; - row.sourceFile = relativePath(basedir, row.file); - } - this.push(row); - next(); - }); -}; - -Browserify.prototype.reset = function (opts) { - if (!opts) opts = {}; - var hadExports = this._bpack.hasExports; - this.pipeline = this._createPipeline(xtend(opts, this._options)); - this._bpack.hasExports = hadExports; - this._entryOrder = 0; - this._bundled = false; - this.emit('reset'); -}; - -Browserify.prototype.bundle = function (cb) { - var self = this; - if (cb && typeof cb === 'object') { - throw new Error( - 'bundle() no longer accepts option arguments.\n' - + 'Move all option arguments to the browserify() constructor.' - ); - } - if (this._bundled) { - var recorded = this._recorded; - this.reset(); - recorded.forEach(function (x) { - self.pipeline.write(x); - }); - } - var output = readonly(this.pipeline); - if (cb) { - output.on('error', cb); - output.pipe(concat(function (body) { - cb(null, body); - })); - } - - function ready () { - self.emit('bundle', output); - self.pipeline.end(); - } - - if (this._pending === 0) ready(); - else this.once('_ready', ready); - - this._bundled = true; - return output; -}; - -function isStream (s) { return s && typeof s.pipe === 'function' } -function isAbsolutePath (file) { - var regexp = process.platform === 'win32' ? - /^\w:/ : - /^\//; - return regexp.test(file); -} -function isExternalModule (file) { - var regexp = process.platform === 'win32' ? - /^(\.|\w:)/ : - /^[\/.]/; - return !regexp.test(file); -} -function relativePath (from, to) { - // Replace \ with / for OS-independent behavior - return cachedPathRelative(from, to).replace(/\\/g, '/'); -} diff --git a/node_modules/browserify/lib/_empty.js b/node_modules/browserify/lib/_empty.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/browserify/lib/builtins.js b/node_modules/browserify/lib/builtins.js deleted file mode 100644 index 3aaa280e6..000000000 --- a/node_modules/browserify/lib/builtins.js +++ /dev/null @@ -1,40 +0,0 @@ -exports.assert = require.resolve('assert/'); -exports.buffer = require.resolve('buffer/'); -exports.child_process = require.resolve('./_empty.js'); -exports.cluster = require.resolve('./_empty.js'); -exports.console = require.resolve('console-browserify'); -exports.constants = require.resolve('constants-browserify'); -exports.crypto = require.resolve('crypto-browserify'); -exports.dgram = require.resolve('./_empty.js'); -exports.dns = require.resolve('./_empty.js'); -exports.domain = require.resolve('domain-browser'); -exports.events = require.resolve('events/'); -exports.fs = require.resolve('./_empty.js'); -exports.http = require.resolve('stream-http'); -exports.https = require.resolve('https-browserify'); -exports.inspector = require.resolve('./_empty.js'); -exports.module = require.resolve('./_empty.js'); -exports.net = require.resolve('./_empty.js'); -exports.os = require.resolve('os-browserify/browser.js'); -exports.path = require.resolve('path-browserify'); -exports.perf_hooks = require.resolve('./_empty.js') -exports.punycode = require.resolve('punycode/'); -exports.querystring = require.resolve('querystring-es3/'); -exports.readline = require.resolve('./_empty.js'); -exports.repl = require.resolve('./_empty.js'); -exports.stream = require.resolve('stream-browserify'); -exports._stream_duplex = require.resolve('readable-stream/duplex.js'); -exports._stream_passthrough = require.resolve('readable-stream/passthrough.js'); -exports._stream_readable = require.resolve('readable-stream/readable.js'); -exports._stream_transform = require.resolve('readable-stream/transform.js'); -exports._stream_writable = require.resolve('readable-stream/writable.js'); -exports.string_decoder = require.resolve('string_decoder/'); -exports.sys = require.resolve('util/util.js'); -exports.timers = require.resolve('timers-browserify'); -exports.tls = require.resolve('./_empty.js'); -exports.tty = require.resolve('tty-browserify'); -exports.url = require.resolve('url/'); -exports.util = require.resolve('util/util.js'); -exports.vm = require.resolve('vm-browserify'); -exports.zlib = require.resolve('browserify-zlib'); -exports._process = require.resolve('process/browser'); diff --git a/node_modules/browserify/node_modules/events/.travis.yml b/node_modules/browserify/node_modules/events/.travis.yml deleted file mode 100644 index 54d7e0485..000000000 --- a/node_modules/browserify/node_modules/events/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -sudo: false -language: node_js -node_js: - - '0.10' -script: - - npm test - - if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then npm run test:browsers; fi -env: - global: - - secure: XcBiD8yReflut9q7leKsigDZ0mI3qTKH+QrNVY8DaqlomJOZw8aOrVuX9Jz12l86ZJ41nbxmKnRNkFzcVr9mbP9YaeTb3DpeOBWmvaoSfud9Wnc16VfXtc1FCcwDhSVcSiM3UtnrmFU5cH+Dw1LPh5PbfylYOS/nJxUvG0FFLqI= - - secure: jNWtEbqhUdQ0xXDHvCYfUbKYeJCi6a7B4LsrcxYCyWWn4NIgncE5x2YbB+FSUUFVYfz0dsn5RKP1oHB99f0laUEo18HBNkrAS/rtyOdVzcpJjbQ6kgSILGjnJD/Ty1B57Rcz3iyev5Y7bLZ6Y1FbDnk/i9/l0faOGz8vTC3Vdkc= diff --git a/node_modules/browserify/node_modules/events/.zuul.yml b/node_modules/browserify/node_modules/events/.zuul.yml deleted file mode 100644 index 216b335e2..000000000 --- a/node_modules/browserify/node_modules/events/.zuul.yml +++ /dev/null @@ -1,13 +0,0 @@ -ui: mocha-qunit -concurrency: 1 -browsers: - - name: chrome - version: latest - - name: firefox - version: latest - - name: safari - version: 7..latest - - name: iphone - version: latest - - name: ie - version: 8..latest diff --git a/node_modules/browserify/node_modules/events/History.md b/node_modules/browserify/node_modules/events/History.md deleted file mode 100644 index aa9af52ca..000000000 --- a/node_modules/browserify/node_modules/events/History.md +++ /dev/null @@ -1,58 +0,0 @@ -# 2.1.0 (2018-05-25) - - - add Emitter#rawListeners from Node.js v9.4 - -# 2.0.0 (2018-02-02) - - - Update to events code from node.js 8.x - - Adds `prependListener()` and `prependOnceListener()` - - Adds `eventNames()` method - - (semver major) Unwrap `once()` listeners in `listeners()` - - copy tests from node.js - -Note that this version doubles the gzipped size, jumping from 1.1KB to 2.1KB, -due to new methods and runtime performance improvements. Be aware of that when -upgrading. - -# 1.1.1 (2016-06-22) - - - add more context to errors if they are not instanceof Error - -# 1.1.0 (2015-09-29) - - - add Emitter#listerCount (to match node v4 api) - -# 1.0.2 (2014-08-28) - - - remove un-reachable code - - update devDeps - -## 1.0.1 / 2014-05-11 - - - check for console.trace before using it - -## 1.0.0 / 2013-12-10 - - - Update to latest events code from node.js 0.10 - - copy tests from node.js - -## 0.4.0 / 2011-07-03 ## - - - Switching to graphquire@0.8.0 - -## 0.3.0 / 2011-07-03 ## - - - Switching to URL based module require. - -## 0.2.0 / 2011-06-10 ## - - - Simplified package structure. - - Graphquire for dependency management. - -## 0.1.1 / 2011-05-16 ## - - - Unhandled errors are logged via console.error - -## 0.1.0 / 2011-04-22 ## - - - Initial release diff --git a/node_modules/browserify/node_modules/events/LICENSE b/node_modules/browserify/node_modules/events/LICENSE deleted file mode 100644 index 52ed3b0a6..000000000 --- a/node_modules/browserify/node_modules/events/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT - -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. diff --git a/node_modules/browserify/node_modules/events/Readme.md b/node_modules/browserify/node_modules/events/Readme.md deleted file mode 100644 index 4fae92256..000000000 --- a/node_modules/browserify/node_modules/events/Readme.md +++ /dev/null @@ -1,21 +0,0 @@ -# Status: [Maintainer Needed](https://github.com/Gozala/events/issues/43) - -# events [![Build Status](https://travis-ci.org/Gozala/events.png?branch=master)](https://travis-ci.org/Gozala/events) - -Node's event emitter for all engines. - -## Install ## - -``` -npm install events -``` - -## Require ## - -```javascript -var EventEmitter = require('events') -``` - -## Usage ## - -See the [node.js event emitter docs](http://nodejs.org/api/events.html) diff --git a/node_modules/browserify/node_modules/events/events.js b/node_modules/browserify/node_modules/events/events.js deleted file mode 100644 index a17bcba6b..000000000 --- a/node_modules/browserify/node_modules/events/events.js +++ /dev/null @@ -1,523 +0,0 @@ -// 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 objectCreate = Object.create || objectCreatePolyfill -var objectKeys = Object.keys || objectKeysPolyfill -var bind = Function.prototype.bind || functionBindPolyfill - -function EventEmitter() { - if (!this._events || !Object.prototype.hasOwnProperty.call(this, '_events')) { - this._events = objectCreate(null); - this._eventsCount = 0; - } - - this._maxListeners = this._maxListeners || undefined; -} -module.exports = EventEmitter; - -// Backwards-compat with node 0.10.x -EventEmitter.EventEmitter = EventEmitter; - -EventEmitter.prototype._events = undefined; -EventEmitter.prototype._maxListeners = undefined; - -// By default EventEmitters will print a warning if more than 10 listeners are -// added to it. This is a useful default which helps finding memory leaks. -var defaultMaxListeners = 10; - -var hasDefineProperty; -try { - var o = {}; - if (Object.defineProperty) Object.defineProperty(o, 'x', { value: 0 }); - hasDefineProperty = o.x === 0; -} catch (err) { hasDefineProperty = false } -if (hasDefineProperty) { - Object.defineProperty(EventEmitter, 'defaultMaxListeners', { - enumerable: true, - get: function() { - return defaultMaxListeners; - }, - set: function(arg) { - // check whether the input is a positive number (whose value is zero or - // greater and not a NaN). - if (typeof arg !== 'number' || arg < 0 || arg !== arg) - throw new TypeError('"defaultMaxListeners" must be a positive number'); - defaultMaxListeners = arg; - } - }); -} else { - EventEmitter.defaultMaxListeners = defaultMaxListeners; -} - -// Obviously not all Emitters should be limited to 10. This function allows -// that to be increased. Set to zero for unlimited. -EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { - if (typeof n !== 'number' || n < 0 || isNaN(n)) - throw new TypeError('"n" argument must be a positive number'); - this._maxListeners = n; - return this; -}; - -function $getMaxListeners(that) { - if (that._maxListeners === undefined) - return EventEmitter.defaultMaxListeners; - return that._maxListeners; -} - -EventEmitter.prototype.getMaxListeners = function getMaxListeners() { - return $getMaxListeners(this); -}; - -// These standalone emit* functions are used to optimize calling of event -// handlers for fast cases because emit() itself often has a variable number of -// arguments and can be deoptimized because of that. These functions always have -// the same number of arguments and thus do not get deoptimized, so the code -// inside them can execute faster. -function emitNone(handler, isFn, self) { - if (isFn) - handler.call(self); - else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - listeners[i].call(self); - } -} -function emitOne(handler, isFn, self, arg1) { - if (isFn) - handler.call(self, arg1); - else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - listeners[i].call(self, arg1); - } -} -function emitTwo(handler, isFn, self, arg1, arg2) { - if (isFn) - handler.call(self, arg1, arg2); - else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - listeners[i].call(self, arg1, arg2); - } -} -function emitThree(handler, isFn, self, arg1, arg2, arg3) { - if (isFn) - handler.call(self, arg1, arg2, arg3); - else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - listeners[i].call(self, arg1, arg2, arg3); - } -} - -function emitMany(handler, isFn, self, args) { - if (isFn) - handler.apply(self, args); - else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - listeners[i].apply(self, args); - } -} - -EventEmitter.prototype.emit = function emit(type) { - var er, handler, len, args, i, events; - var doError = (type === 'error'); - - events = this._events; - if (events) - doError = (doError && events.error == null); - else if (!doError) - return false; - - // If there is no 'error' event listener then throw. - if (doError) { - if (arguments.length > 1) - er = arguments[1]; - if (er instanceof Error) { - throw er; // Unhandled 'error' event - } else { - // At least give some kind of context to the user - var err = new Error('Unhandled "error" event. (' + er + ')'); - err.context = er; - throw err; - } - return false; - } - - handler = events[type]; - - if (!handler) - return false; - - var isFn = typeof handler === 'function'; - len = arguments.length; - switch (len) { - // fast cases - case 1: - emitNone(handler, isFn, this); - break; - case 2: - emitOne(handler, isFn, this, arguments[1]); - break; - case 3: - emitTwo(handler, isFn, this, arguments[1], arguments[2]); - break; - case 4: - emitThree(handler, isFn, this, arguments[1], arguments[2], arguments[3]); - break; - // slower - default: - args = new Array(len - 1); - for (i = 1; i < len; i++) - args[i - 1] = arguments[i]; - emitMany(handler, isFn, this, args); - } - - return true; -}; - -function _addListener(target, type, listener, prepend) { - var m; - var events; - var existing; - - if (typeof listener !== 'function') - throw new TypeError('"listener" argument must be a function'); - - events = target._events; - if (!events) { - events = target._events = objectCreate(null); - target._eventsCount = 0; - } else { - // To avoid recursion in the case that type === "newListener"! Before - // adding it to the listeners, first emit "newListener". - if (events.newListener) { - target.emit('newListener', type, - listener.listener ? listener.listener : listener); - - // Re-assign `events` because a newListener handler could have caused the - // this._events to be assigned to a new object - events = target._events; - } - existing = events[type]; - } - - if (!existing) { - // Optimize the case of one listener. Don't need the extra array object. - existing = events[type] = listener; - ++target._eventsCount; - } else { - if (typeof existing === 'function') { - // Adding the second element, need to change to array. - existing = events[type] = - prepend ? [listener, existing] : [existing, listener]; - } else { - // If we've already got an array, just append. - if (prepend) { - existing.unshift(listener); - } else { - existing.push(listener); - } - } - - // Check for listener leak - if (!existing.warned) { - m = $getMaxListeners(target); - if (m && m > 0 && existing.length > m) { - existing.warned = true; - var w = new Error('Possible EventEmitter memory leak detected. ' + - existing.length + ' "' + String(type) + '" listeners ' + - 'added. Use emitter.setMaxListeners() to ' + - 'increase limit.'); - w.name = 'MaxListenersExceededWarning'; - w.emitter = target; - w.type = type; - w.count = existing.length; - if (typeof console === 'object' && console.warn) { - console.warn('%s: %s', w.name, w.message); - } - } - } - } - - return target; -} - -EventEmitter.prototype.addListener = function addListener(type, listener) { - return _addListener(this, type, listener, false); -}; - -EventEmitter.prototype.on = EventEmitter.prototype.addListener; - -EventEmitter.prototype.prependListener = - function prependListener(type, listener) { - return _addListener(this, type, listener, true); - }; - -function onceWrapper() { - if (!this.fired) { - this.target.removeListener(this.type, this.wrapFn); - this.fired = true; - switch (arguments.length) { - case 0: - return this.listener.call(this.target); - case 1: - return this.listener.call(this.target, arguments[0]); - case 2: - return this.listener.call(this.target, arguments[0], arguments[1]); - case 3: - return this.listener.call(this.target, arguments[0], arguments[1], - arguments[2]); - default: - var args = new Array(arguments.length); - for (var i = 0; i < args.length; ++i) - args[i] = arguments[i]; - this.listener.apply(this.target, args); - } - } -} - -function _onceWrap(target, type, listener) { - var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; - var wrapped = bind.call(onceWrapper, state); - wrapped.listener = listener; - state.wrapFn = wrapped; - return wrapped; -} - -EventEmitter.prototype.once = function once(type, listener) { - if (typeof listener !== 'function') - throw new TypeError('"listener" argument must be a function'); - this.on(type, _onceWrap(this, type, listener)); - return this; -}; - -EventEmitter.prototype.prependOnceListener = - function prependOnceListener(type, listener) { - if (typeof listener !== 'function') - throw new TypeError('"listener" argument must be a function'); - this.prependListener(type, _onceWrap(this, type, listener)); - return this; - }; - -// Emits a 'removeListener' event if and only if the listener was removed. -EventEmitter.prototype.removeListener = - function removeListener(type, listener) { - var list, events, position, i, originalListener; - - if (typeof listener !== 'function') - throw new TypeError('"listener" argument must be a function'); - - events = this._events; - if (!events) - return this; - - list = events[type]; - if (!list) - return this; - - if (list === listener || list.listener === listener) { - if (--this._eventsCount === 0) - this._events = objectCreate(null); - else { - delete events[type]; - if (events.removeListener) - this.emit('removeListener', type, list.listener || listener); - } - } else if (typeof list !== 'function') { - position = -1; - - for (i = list.length - 1; i >= 0; i--) { - if (list[i] === listener || list[i].listener === listener) { - originalListener = list[i].listener; - position = i; - break; - } - } - - if (position < 0) - return this; - - if (position === 0) - list.shift(); - else - spliceOne(list, position); - - if (list.length === 1) - events[type] = list[0]; - - if (events.removeListener) - this.emit('removeListener', type, originalListener || listener); - } - - return this; - }; - -EventEmitter.prototype.removeAllListeners = - function removeAllListeners(type) { - var listeners, events, i; - - events = this._events; - if (!events) - return this; - - // not listening for removeListener, no need to emit - if (!events.removeListener) { - if (arguments.length === 0) { - this._events = objectCreate(null); - this._eventsCount = 0; - } else if (events[type]) { - if (--this._eventsCount === 0) - this._events = objectCreate(null); - else - delete events[type]; - } - return this; - } - - // emit removeListener for all listeners on all events - if (arguments.length === 0) { - var keys = objectKeys(events); - var key; - for (i = 0; i < keys.length; ++i) { - key = keys[i]; - if (key === 'removeListener') continue; - this.removeAllListeners(key); - } - this.removeAllListeners('removeListener'); - this._events = objectCreate(null); - this._eventsCount = 0; - return this; - } - - listeners = events[type]; - - if (typeof listeners === 'function') { - this.removeListener(type, listeners); - } else if (listeners) { - // LIFO order - for (i = listeners.length - 1; i >= 0; i--) { - this.removeListener(type, listeners[i]); - } - } - - return this; - }; - -function _listeners(target, type, unwrap) { - var events = target._events; - - if (!events) - return []; - - var evlistener = events[type]; - if (!evlistener) - return []; - - if (typeof evlistener === 'function') - return unwrap ? [evlistener.listener || evlistener] : [evlistener]; - - return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); -} - -EventEmitter.prototype.listeners = function listeners(type) { - return _listeners(this, type, true); -}; - -EventEmitter.prototype.rawListeners = function rawListeners(type) { - return _listeners(this, type, false); -}; - -EventEmitter.listenerCount = function(emitter, type) { - if (typeof emitter.listenerCount === 'function') { - return emitter.listenerCount(type); - } else { - return listenerCount.call(emitter, type); - } -}; - -EventEmitter.prototype.listenerCount = listenerCount; -function listenerCount(type) { - var events = this._events; - - if (events) { - var evlistener = events[type]; - - if (typeof evlistener === 'function') { - return 1; - } else if (evlistener) { - return evlistener.length; - } - } - - return 0; -} - -EventEmitter.prototype.eventNames = function eventNames() { - return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : []; -}; - -// About 1.5x faster than the two-arg version of Array#splice(). -function spliceOne(list, index) { - for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) - list[i] = list[k]; - list.pop(); -} - -function arrayClone(arr, n) { - var copy = new Array(n); - for (var i = 0; i < n; ++i) - copy[i] = arr[i]; - return copy; -} - -function unwrapListeners(arr) { - var ret = new Array(arr.length); - for (var i = 0; i < ret.length; ++i) { - ret[i] = arr[i].listener || arr[i]; - } - return ret; -} - -function objectCreatePolyfill(proto) { - var F = function() {}; - F.prototype = proto; - return new F; -} -function objectKeysPolyfill(obj) { - var keys = []; - for (var k in obj) if (Object.prototype.hasOwnProperty.call(obj, k)) { - keys.push(k); - } - return k; -} -function functionBindPolyfill(context) { - var fn = this; - return function () { - return fn.apply(context, arguments); - }; -} diff --git a/node_modules/browserify/node_modules/events/package.json b/node_modules/browserify/node_modules/events/package.json deleted file mode 100644 index dc8853db5..000000000 --- a/node_modules/browserify/node_modules/events/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_from": "events@^2.0.0", - "_id": "events@2.1.0", - "_inBundle": false, - "_integrity": "sha512-3Zmiobend8P9DjmKAty0Era4jV8oJ0yGYe2nJJAxgymF9+N8F2m0hhZiMoWtcfepExzNKZumFU3ksdQbInGWCg==", - "_location": "/browserify/events", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "events@^2.0.0", - "name": "events", - "escapedName": "events", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/browserify" - ], - "_resolved": "https://registry.npmjs.org/events/-/events-2.1.0.tgz", - "_shasum": "2a9a1e18e6106e0e812aa9ebd4a819b3c29c0ba5", - "_spec": "events@^2.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "Irakli Gozalishvili", - "email": "rfobic@gmail.com", - "url": "http://jeditoolkit.com" - }, - "bugs": { - "url": "http://github.com/Gozala/events/issues/" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Node's event emitter for all engines.", - "devDependencies": { - "isarray": "^2.0.2", - "mocha": "^3.5.3", - "object-keys": "^1.0.11", - "zuul": "^3.11.1" - }, - "engines": { - "node": ">=0.4.x" - }, - "homepage": "https://github.com/Gozala/events#readme", - "id": "events", - "keywords": [ - "events", - "eventEmitter", - "eventDispatcher", - "listeners" - ], - "license": "MIT", - "main": "./events.js", - "name": "events", - "repository": { - "type": "git", - "url": "git://github.com/Gozala/events.git", - "web": "https://github.com/Gozala/events" - }, - "scripts": { - "test": "mocha --ui qunit -- tests/index.js", - "test:browsers": "zuul -- tests/index.js" - }, - "version": "2.1.0" -} diff --git a/node_modules/browserify/node_modules/events/tests/add-listeners.js b/node_modules/browserify/node_modules/events/tests/add-listeners.js deleted file mode 100644 index 6682862f2..000000000 --- a/node_modules/browserify/node_modules/events/tests/add-listeners.js +++ /dev/null @@ -1,111 +0,0 @@ -// 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 common = require('./common'); -var assert = require('assert'); -var EventEmitter = require('../'); - -{ - var ee = new EventEmitter(); - var events_new_listener_emitted = []; - var listeners_new_listener_emitted = []; - - // Sanity check - assert.strictEqual(ee.addListener, ee.on); - - ee.on('newListener', function(event, listener) { - // Don't track newListener listeners. - if (event === 'newListener') - return; - - events_new_listener_emitted.push(event); - listeners_new_listener_emitted.push(listener); - }); - - var hello = common.mustCall(function(a, b) { - assert.strictEqual('a', a); - assert.strictEqual('b', b); - }); - - ee.once('newListener', function(name, listener) { - assert.strictEqual(name, 'hello'); - assert.strictEqual(listener, hello); - - var listeners = this.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); - }); - - ee.on('hello', hello); - ee.once('foo', assert.fail); - - assert.ok(Array.isArray(events_new_listener_emitted)); - assert.strictEqual(events_new_listener_emitted.length, 2); - assert.strictEqual(events_new_listener_emitted[0], 'hello'); - assert.strictEqual(events_new_listener_emitted[1], 'foo'); - - assert.ok(Array.isArray(listeners_new_listener_emitted)); - assert.strictEqual(listeners_new_listener_emitted.length, 2); - assert.strictEqual(listeners_new_listener_emitted[0], hello); - assert.strictEqual(listeners_new_listener_emitted[1], assert.fail); - - ee.emit('hello', 'a', 'b'); -} - -// just make sure that this doesn't throw: -{ - var f = new EventEmitter(); - - f.setMaxListeners(0); -} - -{ - var listen1 = function() {}; - var listen2 = function() {}; - var ee = new EventEmitter(); - - ee.once('newListener', function() { - var listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); - ee.once('newListener', function() { - var listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); - }); - ee.on('hello', listen2); - }); - ee.on('hello', listen1); - // The order of listeners on an event is not always the order in which the - // listeners were added. - var listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 2); - assert.strictEqual(listeners[0], listen2); - assert.strictEqual(listeners[1], listen1); -} - -// Verify that the listener must be a function -assert.throws(function() { - var ee = new EventEmitter(); - - ee.on('foo', null); -}, /^TypeError: "listener" argument must be a function$/); diff --git a/node_modules/browserify/node_modules/events/tests/check-listener-leaks.js b/node_modules/browserify/node_modules/events/tests/check-listener-leaks.js deleted file mode 100644 index 3cd0aa2e0..000000000 --- a/node_modules/browserify/node_modules/events/tests/check-listener-leaks.js +++ /dev/null @@ -1,93 +0,0 @@ -// 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 common = require('./common'); -var assert = require('assert'); -var events = require('../'); - -// default -{ - var e = new events.EventEmitter(); - - for (var i = 0; i < 10; i++) { - e.on('default', common.mustNotCall()); - } - assert.ok(!e._events['default'].hasOwnProperty('warned')); - e.on('default', common.mustNotCall()); - assert.ok(e._events['default'].warned); - - // specific - e.setMaxListeners(5); - for (var i = 0; i < 5; i++) { - e.on('specific', common.mustNotCall()); - } - assert.ok(!e._events['specific'].hasOwnProperty('warned')); - e.on('specific', common.mustNotCall()); - assert.ok(e._events['specific'].warned); - - // only one - e.setMaxListeners(1); - e.on('only one', common.mustNotCall()); - assert.ok(!e._events['only one'].hasOwnProperty('warned')); - e.on('only one', common.mustNotCall()); - assert.ok(e._events['only one'].hasOwnProperty('warned')); - - // unlimited - e.setMaxListeners(0); - for (var i = 0; i < 1000; i++) { - e.on('unlimited', common.mustNotCall()); - } - assert.ok(!e._events['unlimited'].hasOwnProperty('warned')); -} - -// process-wide -{ - events.EventEmitter.defaultMaxListeners = 42; - var e = new events.EventEmitter(); - - for (var i = 0; i < 42; ++i) { - e.on('fortytwo', common.mustNotCall()); - } - assert.ok(!e._events['fortytwo'].hasOwnProperty('warned')); - e.on('fortytwo', common.mustNotCall()); - assert.ok(e._events['fortytwo'].hasOwnProperty('warned')); - delete e._events['fortytwo'].warned; - - events.EventEmitter.defaultMaxListeners = 44; - e.on('fortytwo', common.mustNotCall()); - assert.ok(!e._events['fortytwo'].hasOwnProperty('warned')); - e.on('fortytwo', common.mustNotCall()); - assert.ok(e._events['fortytwo'].hasOwnProperty('warned')); -} - -// but _maxListeners still has precedence over defaultMaxListeners -{ - events.EventEmitter.defaultMaxListeners = 42; - var e = new events.EventEmitter(); - e.setMaxListeners(1); - e.on('uno', common.mustNotCall()); - assert.ok(!e._events['uno'].hasOwnProperty('warned')); - e.on('uno', common.mustNotCall()); - assert.ok(e._events['uno'].hasOwnProperty('warned')); - - // chainable - assert.strictEqual(e, e.setMaxListeners(1)); -} diff --git a/node_modules/browserify/node_modules/events/tests/common.js b/node_modules/browserify/node_modules/events/tests/common.js deleted file mode 100644 index cdd5aeac6..000000000 --- a/node_modules/browserify/node_modules/events/tests/common.js +++ /dev/null @@ -1,103 +0,0 @@ -// 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 assert = require('assert'); - -var noop = function() {}; - -var mustCallChecks = []; - -function runCallChecks(exitCode) { - if (exitCode !== 0) return; - - var failed = filter(mustCallChecks, function(context) { - if ('minimum' in context) { - context.messageSegment = 'at least ' + context.minimum; - return context.actual < context.minimum; - } else { - context.messageSegment = 'exactly ' + context.exact; - return context.actual !== context.exact; - } - }); - - for (var i = 0; i < failed.length; i++) { - var context = failed[i]; - console.log('Mismatched %s function calls. Expected %s, actual %d.', - context.name, - context.messageSegment, - context.actual); - // IE8 has no .stack - if (context.stack) console.log(context.stack.split('\n').slice(2).join('\n')); - } - - assert.strictEqual(failed.length, 0); -} - -exports.mustCall = function(fn, exact) { - return _mustCallInner(fn, exact, 'exact'); -}; - -function _mustCallInner(fn, criteria, field) { - if (typeof criteria == 'undefined') criteria = 1; - - if (typeof fn === 'number') { - criteria = fn; - fn = noop; - } else if (fn === undefined) { - fn = noop; - } - - if (typeof criteria !== 'number') - throw new TypeError('Invalid ' + field + ' value: ' + criteria); - - var context = { - actual: 0, - stack: (new Error()).stack, - name: fn.name || '' - }; - - context[field] = criteria; - - // add the exit listener only once to avoid listener leak warnings - if (mustCallChecks.length === 0) after(function() { runCallChecks(0); }); - - mustCallChecks.push(context); - - return function() { - context.actual++; - return fn.apply(this, arguments); - }; -} - -exports.mustNotCall = function(msg) { - return function mustNotCall() { - assert.fail(msg || 'function should not have been called'); - }; -}; - -function filter(arr, fn) { - if (arr.filter) return arr.filter(fn); - var filtered = []; - for (var i = 0; i < arr.length; i++) { - if (fn(arr[i], i, arr)) filtered.push(arr[i]); - } - return filtered -} diff --git a/node_modules/browserify/node_modules/events/tests/index.js b/node_modules/browserify/node_modules/events/tests/index.js deleted file mode 100644 index f71bc98a1..000000000 --- a/node_modules/browserify/node_modules/events/tests/index.js +++ /dev/null @@ -1,25 +0,0 @@ - -require('./legacy-compat'); - -// we do this to easily wrap each file in a mocha test -// and also have browserify be able to statically analyze this file -var orig_require = require; -var require = function(file) { - test(file, function() { - orig_require(file); - }); -}; - -require('./add-listeners.js'); -require('./check-listener-leaks.js'); -require('./listener-count.js'); -require('./listeners-side-effects.js'); -require('./listeners.js'); -require('./max-listeners.js'); -require('./modify-in-emit.js'); -require('./num-args.js'); -require('./once.js'); -require('./set-max-listeners-side-effects.js'); -require('./subclass.js'); -require('./remove-all-listeners.js'); -require('./remove-listeners.js'); diff --git a/node_modules/browserify/node_modules/events/tests/legacy-compat.js b/node_modules/browserify/node_modules/events/tests/legacy-compat.js deleted file mode 100644 index a402be6e2..000000000 --- a/node_modules/browserify/node_modules/events/tests/legacy-compat.js +++ /dev/null @@ -1,16 +0,0 @@ -// sigh... life is hard -if (!global.console) { - console = {} -} - -var fns = ['log', 'error', 'trace']; -for (var i=0 ; ifoo should not be emitted'); -} - -e.once('foo', remove); -e.removeListener('foo', remove); -e.emit('foo'); - -e.once('e', common.mustCall(function() { - e.emit('e'); -})); - -e.once('e', common.mustCall()); - -e.emit('e'); - -// Verify that the listener must be a function -assert.throws(function() { - var ee = new EventEmitter(); - - ee.once('foo', null); -}, /^TypeError: "listener" argument must be a function$/); - -{ - // once() has different code paths based on the number of arguments being - // emitted. Verify that all of the cases are covered. - var maxArgs = 4; - - for (var i = 0; i <= maxArgs; ++i) { - var ee = new EventEmitter(); - var args = ['foo']; - - for (var j = 0; j < i; ++j) - args.push(j); - - ee.once('foo', common.mustCall(function() { - var params = Array.prototype.slice.call(arguments); - var restArgs = args.slice(1); - assert.ok(Array.isArray(params)); - assert.strictEqual(params.length, restArgs.length); - for (var index = 0; index < params.length; index++) { - var param = params[index]; - assert.strictEqual(param, restArgs[index]); - } - })); - - EventEmitter.prototype.emit.apply(ee, args); - } -} diff --git a/node_modules/browserify/node_modules/events/tests/remove-all-listeners.js b/node_modules/browserify/node_modules/events/tests/remove-all-listeners.js deleted file mode 100644 index df2999807..000000000 --- a/node_modules/browserify/node_modules/events/tests/remove-all-listeners.js +++ /dev/null @@ -1,139 +0,0 @@ -// 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 common = require('./common'); -var assert = require('assert'); -var events = require('../'); - -var after_checks = []; -after(function() { - for (var i = 0 ; i < after_checks.length ; ++i) { - after_checks[i](); - } -}); - -function expect(expected) { - var actual = []; - after_checks.push(function() { - var sortedActual = actual.sort(); - var sortedExpected = expected.sort(); - assert.strictEqual(sortedActual.length, sortedExpected.length); - for (var index = 0; index < sortedActual.length; index++) { - var value = sortedActual[index]; - assert.strictEqual(value, sortedExpected[index]); - } - }); - function listener(name) { - actual.push(name); - } - return common.mustCall(listener, expected.length); -} - -{ - var ee = new events.EventEmitter(); - var noop = common.mustNotCall(); - ee.on('foo', noop); - ee.on('bar', noop); - ee.on('baz', noop); - ee.on('baz', noop); - var fooListeners = ee.listeners('foo'); - var barListeners = ee.listeners('bar'); - var bazListeners = ee.listeners('baz'); - ee.on('removeListener', expect(['bar', 'baz', 'baz'])); - ee.removeAllListeners('bar'); - ee.removeAllListeners('baz'); - - var listeners = ee.listeners('foo'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 1); - assert.strictEqual(listeners[0], noop); - - listeners = ee.listeners('bar'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); - listeners = ee.listeners('baz'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); - // After calling removeAllListeners(), - // the old listeners array should stay unchanged. - assert.strictEqual(fooListeners.length, 1); - assert.strictEqual(fooListeners[0], noop); - assert.strictEqual(barListeners.length, 1); - assert.strictEqual(barListeners[0], noop); - assert.strictEqual(bazListeners.length, 2); - assert.strictEqual(bazListeners[0], noop); - assert.strictEqual(bazListeners[1], noop); - // After calling removeAllListeners(), - // new listeners arrays is different from the old. - assert.notStrictEqual(ee.listeners('bar'), barListeners); - assert.notStrictEqual(ee.listeners('baz'), bazListeners); -} - -{ - var ee = new events.EventEmitter(); - ee.on('foo', common.mustNotCall()); - ee.on('bar', common.mustNotCall()); - // Expect LIFO order - ee.on('removeListener', expect(['foo', 'bar', 'removeListener'])); - ee.on('removeListener', expect(['foo', 'bar'])); - ee.removeAllListeners(); - - var listeners = ee.listeners('foo'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); - listeners = ee.listeners('bar'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); -} - -{ - var ee = new events.EventEmitter(); - ee.on('removeListener', common.mustNotCall()); - // Check for regression where removeAllListeners() throws when - // there exists a 'removeListener' listener, but there exists - // no listeners for the provided event type. - assert.doesNotThrow(function () { ee.removeAllListeners(ee, 'foo') }); -} - -{ - var ee = new events.EventEmitter(); - var expectLength = 2; - ee.on('removeListener', function() { - assert.strictEqual(expectLength--, this.listeners('baz').length); - }); - ee.on('baz', common.mustNotCall()); - ee.on('baz', common.mustNotCall()); - ee.on('baz', common.mustNotCall()); - assert.strictEqual(ee.listeners('baz').length, expectLength + 1); - ee.removeAllListeners('baz'); - assert.strictEqual(ee.listeners('baz').length, 0); -} - -{ - var ee = new events.EventEmitter(); - assert.strictEqual(ee, ee.removeAllListeners()); -} - -{ - var ee = new events.EventEmitter(); - ee._events = undefined; - assert.strictEqual(ee, ee.removeAllListeners()); -} diff --git a/node_modules/browserify/node_modules/events/tests/remove-listeners.js b/node_modules/browserify/node_modules/events/tests/remove-listeners.js deleted file mode 100644 index 6cccd9697..000000000 --- a/node_modules/browserify/node_modules/events/tests/remove-listeners.js +++ /dev/null @@ -1,212 +0,0 @@ -// 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 common = require('./common'); -var assert = require('assert'); -var EventEmitter = require('../'); - -var listener1 = function listener1() {}; -var listener2 = function listener2() {}; - -{ - var ee = new EventEmitter(); - ee.on('hello', listener1); - ee.on('removeListener', common.mustCall(function(name, cb) { - assert.strictEqual(name, 'hello'); - assert.strictEqual(cb, listener1); - })); - ee.removeListener('hello', listener1); - var listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); -} - -{ - var ee = new EventEmitter(); - ee.on('hello', listener1); - ee.on('removeListener', common.mustNotCall()); - ee.removeListener('hello', listener2); - - var listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 1); - assert.strictEqual(listeners[0], listener1); -} - -{ - var ee = new EventEmitter(); - ee.on('hello', listener1); - ee.on('hello', listener2); - - var listeners; - ee.once('removeListener', common.mustCall(function(name, cb) { - assert.strictEqual(name, 'hello'); - assert.strictEqual(cb, listener1); - listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 1); - assert.strictEqual(listeners[0], listener2); - })); - ee.removeListener('hello', listener1); - listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 1); - assert.strictEqual(listeners[0], listener2); - ee.once('removeListener', common.mustCall(function(name, cb) { - assert.strictEqual(name, 'hello'); - assert.strictEqual(cb, listener2); - listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); - })); - ee.removeListener('hello', listener2); - listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); -} - -{ - var ee = new EventEmitter(); - - function remove1() { - assert.fail('remove1 should not have been called'); - } - - function remove2() { - assert.fail('remove2 should not have been called'); - } - - ee.on('removeListener', common.mustCall(function(name, cb) { - if (cb !== remove1) return; - this.removeListener('quux', remove2); - this.emit('quux'); - }, 2)); - ee.on('quux', remove1); - ee.on('quux', remove2); - ee.removeListener('quux', remove1); -} - -{ - var ee = new EventEmitter(); - ee.on('hello', listener1); - ee.on('hello', listener2); - - var listeners; - ee.once('removeListener', common.mustCall(function(name, cb) { - assert.strictEqual(name, 'hello'); - assert.strictEqual(cb, listener1); - listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 1); - assert.strictEqual(listeners[0], listener2); - ee.once('removeListener', common.mustCall(function(name, cb) { - assert.strictEqual(name, 'hello'); - assert.strictEqual(cb, listener2); - listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); - })); - ee.removeListener('hello', listener2); - listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); - })); - ee.removeListener('hello', listener1); - listeners = ee.listeners('hello'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 0); -} - -{ - var ee = new EventEmitter(); - var listener3 = common.mustCall(function() { - ee.removeListener('hello', listener4); - }, 2); - var listener4 = common.mustCall(); - - ee.on('hello', listener3); - ee.on('hello', listener4); - - // listener4 will still be called although it is removed by listener 3. - ee.emit('hello'); - // This is so because the interal listener array at time of emit - // was [listener3,listener4] - - // Interal listener array [listener3] - ee.emit('hello'); -} - -{ - var ee = new EventEmitter(); - - ee.once('hello', listener1); - ee.on('removeListener', common.mustCall(function(eventName, listener) { - assert.strictEqual(eventName, 'hello'); - assert.strictEqual(listener, listener1); - })); - ee.emit('hello'); -} - -{ - var ee = new EventEmitter(); - - assert.strictEqual(ee, ee.removeListener('foo', function() {})); -} - -// Verify that the removed listener must be a function -assert.throws(function() { - var ee = new EventEmitter(); - - ee.removeListener('foo', null); -}, /^TypeError: "listener" argument must be a function$/); - -{ - var ee = new EventEmitter(); - var listener = function() {}; - ee._events = undefined; - var e = ee.removeListener('foo', listener); - assert.strictEqual(e, ee); -} - -{ - var ee = new EventEmitter(); - - ee.on('foo', listener1); - ee.on('foo', listener2); - var listeners = ee.listeners('foo'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 2); - assert.strictEqual(listeners[0], listener1); - assert.strictEqual(listeners[1], listener2); - - ee.removeListener('foo', listener1); - assert.strictEqual(ee._events.foo, listener2); - - ee.on('foo', listener1); - listeners = ee.listeners('foo'); - assert.ok(Array.isArray(listeners)); - assert.strictEqual(listeners.length, 2); - assert.strictEqual(listeners[0], listener2); - assert.strictEqual(listeners[1], listener1); - - ee.removeListener('foo', listener1); - assert.strictEqual(ee._events.foo, listener2); -} diff --git a/node_modules/browserify/node_modules/events/tests/set-max-listeners-side-effects.js b/node_modules/browserify/node_modules/events/tests/set-max-listeners-side-effects.js deleted file mode 100644 index 99471db73..000000000 --- a/node_modules/browserify/node_modules/events/tests/set-max-listeners-side-effects.js +++ /dev/null @@ -1,32 +0,0 @@ -// 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. - -require('./common'); -var assert = require('assert'); -var events = require('../'); -var objectKeys = require('object-keys'); - -var e = new events.EventEmitter(); - -if (Object.create) assert.ok(!(e._events instanceof Object)); -assert.strictEqual(objectKeys(e._events).length, 0); -e.setMaxListeners(5); -assert.strictEqual(objectKeys(e._events).length, 0); diff --git a/node_modules/browserify/node_modules/events/tests/subclass.js b/node_modules/browserify/node_modules/events/tests/subclass.js deleted file mode 100644 index 6c2ae642b..000000000 --- a/node_modules/browserify/node_modules/events/tests/subclass.js +++ /dev/null @@ -1,73 +0,0 @@ -// 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 common = require('./common'); -var assert = require('assert'); -var EventEmitter = require('../').EventEmitter; -var util = require('util'); -var objectKeys = require('object-keys'); - -var after_checks = []; -after(function() { - for (var i = 0 ; i < after_checks.length ; ++i) { - after_checks[i](); - } -}); - -util.inherits(MyEE, EventEmitter); - -function MyEE(cb) { - this.once(1, cb); - this.emit(1); - this.removeAllListeners(); - EventEmitter.call(this); -} - -var myee = new MyEE(common.mustCall()); - - -util.inherits(ErrorEE, EventEmitter); -function ErrorEE() { - this.emit('error', new Error('blerg')); -} - -assert.throws(function() { - new ErrorEE(); -}, /blerg/); - -after_checks.push(function() { - if (Object.create) assert.ok(!(myee._events instanceof Object)); - assert.strictEqual(objectKeys(myee._events).length, 0); -}); - - -function MyEE2() { - EventEmitter.call(this); -} - -MyEE2.prototype = new EventEmitter(); - -var ee1 = new MyEE2(); -var ee2 = new MyEE2(); - -ee1.on('x', function() {}); - -assert.strictEqual(ee2.listenerCount('x'), 0); diff --git a/node_modules/browserify/package.json b/node_modules/browserify/package.json deleted file mode 100644 index 09ce978ad..000000000 --- a/node_modules/browserify/package.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "_from": "browserify@^16.1.0", - "_id": "browserify@16.2.3", - "_inBundle": false, - "_integrity": "sha512-zQt/Gd1+W+IY+h/xX2NYMW4orQWhqSwyV+xsblycTtpOuB27h1fZhhNQuipJ4t79ohw4P4mMem0jp/ZkISQtjQ==", - "_location": "/browserify", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "browserify@^16.1.0", - "name": "browserify", - "escapedName": "browserify", - "rawSpec": "^16.1.0", - "saveSpec": null, - "fetchSpec": "^16.1.0" - }, - "_requiredBy": [ - "/budo", - "/watchify" - ], - "_resolved": "https://registry.npmjs.org/browserify/-/browserify-16.2.3.tgz", - "_shasum": "7ee6e654ba4f92bce6ab3599c3485b1cc7a0ad0b", - "_spec": "browserify@^16.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bin": { - "browserify": "bin/cmd.js" - }, - "bugs": { - "url": "https://github.com/browserify/browserify/issues" - }, - "bundleDependencies": false, - "dependencies": { - "JSONStream": "^1.0.3", - "assert": "^1.4.0", - "browser-pack": "^6.0.1", - "browser-resolve": "^1.11.0", - "browserify-zlib": "~0.2.0", - "buffer": "^5.0.2", - "cached-path-relative": "^1.0.0", - "concat-stream": "^1.6.0", - "console-browserify": "^1.1.0", - "constants-browserify": "~1.0.0", - "crypto-browserify": "^3.0.0", - "defined": "^1.0.0", - "deps-sort": "^2.0.0", - "domain-browser": "^1.2.0", - "duplexer2": "~0.1.2", - "events": "^2.0.0", - "glob": "^7.1.0", - "has": "^1.0.0", - "htmlescape": "^1.1.0", - "https-browserify": "^1.0.0", - "inherits": "~2.0.1", - "insert-module-globals": "^7.0.0", - "labeled-stream-splicer": "^2.0.0", - "mkdirp": "^0.5.0", - "module-deps": "^6.0.0", - "os-browserify": "~0.3.0", - "parents": "^1.0.1", - "path-browserify": "~0.0.0", - "process": "~0.11.0", - "punycode": "^1.3.2", - "querystring-es3": "~0.2.0", - "read-only-stream": "^2.0.0", - "readable-stream": "^2.0.2", - "resolve": "^1.1.4", - "shasum": "^1.0.0", - "shell-quote": "^1.6.1", - "stream-browserify": "^2.0.0", - "stream-http": "^2.0.0", - "string_decoder": "^1.1.1", - "subarg": "^1.0.0", - "syntax-error": "^1.1.1", - "through2": "^2.0.0", - "timers-browserify": "^1.0.1", - "tty-browserify": "0.0.1", - "url": "~0.11.0", - "util": "~0.10.1", - "vm-browserify": "^1.0.0", - "xtend": "^4.0.0" - }, - "deprecated": false, - "description": "browser-side require() the node way", - "devDependencies": { - "backbone": "~0.9.2", - "browser-unpack": "^1.1.1", - "coffee-script": "~1.10.0", - "coffeeify": "~1.1.0", - "has-object-spread": "^1.0.0", - "has-template-literals": "^1.0.0", - "isstream": "^0.1.2", - "make-generator-function": "^1.1.0", - "semver": "^5.5.0", - "seq": "0.3.5", - "tap": "^10.7.2", - "temp": "^0.8.1", - "through": "^2.3.4" - }, - "engines": { - "node": ">= 0.8" - }, - "homepage": "https://github.com/browserify/browserify#readme", - "keywords": [ - "browser", - "require", - "commonjs", - "commonj-esque", - "bundle", - "npm", - "javascript" - ], - "license": "MIT", - "main": "index.js", - "name": "browserify", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/browserify/browserify.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "16.2.3" -} diff --git a/node_modules/browserify/readme.markdown b/node_modules/browserify/readme.markdown deleted file mode 100644 index 7d6f87e62..000000000 --- a/node_modules/browserify/readme.markdown +++ /dev/null @@ -1,829 +0,0 @@ -# browserify - -`require('modules')` in the browser - -Use a [node](http://nodejs.org)-style `require()` to organize your browser code -and load modules installed by [npm](https://www.npmjs.com). - -browserify will recursively analyze all the `require()` calls in your app in -order to build a bundle you can serve up to the browser in a single `` into your -html! - -# install - -With [npm](https://www.npmjs.com/) do: - -``` -npm install -g browserify -``` - -# usage - -``` -Usage: browserify [entry files] {OPTIONS} - -Standard Options: - - --outfile, -o Write the browserify bundle to this file. - If unspecified, browserify prints to stdout. - - --require, -r A module name or file to bundle.require() - Optionally use a colon separator to set the target. - - --entry, -e An entry point of your app - - --ignore, -i Replace a file with an empty stub. Files can be globs. - - --exclude, -u Omit a file from the output bundle. Files can be globs. - - --external, -x Reference a file from another bundle. Files can be globs. - - --transform, -t Use a transform module on top-level files. - - --command, -c Use a transform command on top-level files. - - --standalone -s Generate a UMD bundle for the supplied export name. - This bundle works with other module systems and sets the name - given as a window global if no module system is found. - - --debug -d Enable source maps that allow you to debug your files - separately. - - --help, -h Show this message - -For advanced options, type `browserify --help advanced`. - -Specify a parameter. -``` - -``` -Advanced Options: - - --insert-globals, --ig, --fast [default: false] - - Skip detection and always insert definitions for process, global, - __filename, and __dirname. - - benefit: faster builds - cost: extra bytes - - --insert-global-vars, --igv - - Comma-separated list of global variables to detect and define. - Default: __filename,__dirname,process,Buffer,global - - --detect-globals, --dg [default: true] - - Detect the presence of process, global, __filename, and __dirname and define - these values when present. - - benefit: npm modules more likely to work - cost: slower builds - - --ignore-missing, --im [default: false] - - Ignore `require()` statements that don't resolve to anything. - - --noparse=FILE - - Don't parse FILE at all. This will make bundling much, much faster for giant - libs like jquery or threejs. - - --no-builtins - - Turn off builtins. This is handy when you want to run a bundle in node which - provides the core builtins. - - --no-commondir - - Turn off setting a commondir. This is useful if you want to preserve the - original paths that a bundle was generated with. - - --no-bundle-external - - Turn off bundling of all external modules. This is useful if you only want - to bundle your local files. - - --bare - - Alias for both --no-builtins, --no-commondir, and sets --insert-global-vars - to just "__filename,__dirname". This is handy if you want to run bundles in - node. - - --no-browser-field, --no-bf - - Turn off package.json browser field resolution. This is also handy if you - need to run a bundle in node. - - --transform-key - - Instead of the default package.json#browserify#transform field to list - all transforms to apply when running browserify, a custom field, like, e.g. - package.json#browserify#production or package.json#browserify#staging - can be used, by for example running: - * `browserify index.js --transform-key=production > bundle.js` - * `browserify index.js --transform-key=staging > bundle.js` - - --node - - Alias for --bare and --no-browser-field. - - --full-paths - - Turn off converting module ids into numerical indexes. This is useful for - preserving the original paths that a bundle was generated with. - - --deps - - Instead of standard bundle output, print the dependency array generated by - module-deps. - - --no-dedupe - - Turn off deduping. - - --list - - Print each file in the dependency graph. Useful for makefiles. - - --extension=EXTENSION - - Consider files with specified EXTENSION as modules, this option can used - multiple times. - - --global-transform=MODULE, -g MODULE - - Use a transform module on all files after any ordinary transforms have run. - - --ignore-transform=MODULE, -it MODULE - - Do not run certain transformations, even if specified elsewhere. - - --plugin=MODULE, -p MODULE - - Register MODULE as a plugin. - -Passing arguments to transforms and plugins: - - For -t, -g, and -p, you may use subarg syntax to pass options to the - transforms or plugin function as the second parameter. For example: - - -t [ foo -x 3 --beep ] - - will call the `foo` transform for each applicable file by calling: - - foo(file, { x: 3, beep: true }) - -``` - -# compatibility - -Many [npm](https://www.npmjs.com/) modules that don't do IO will just work after being -browserified. Others take more work. - -Many node built-in modules have been wrapped to work in the browser, but only -when you explicitly `require()` or use their functionality. - -When you `require()` any of these modules, you will get a browser-specific shim: - -* [assert](https://www.npmjs.com/package/assert) -* [buffer](https://www.npmjs.com/package/buffer) -* [console](https://www.npmjs.com/package/console-browserify) -* [constants](https://www.npmjs.com/package/constants-browserify) -* [crypto](https://www.npmjs.com/package/crypto-browserify) -* [domain](https://www.npmjs.com/package/domain-browser) -* [events](https://www.npmjs.com/package/events) -* [http](https://www.npmjs.com/package/stream-http) -* [https](https://www.npmjs.com/package/https-browserify) -* [os](https://www.npmjs.com/package/os-browserify) -* [path](https://www.npmjs.com/package/path-browserify) -* [punycode](https://www.npmjs.com/package/punycode) -* [querystring](https://www.npmjs.com/package/querystring-es3) -* [stream](https://www.npmjs.com/package/stream-browserify) -* [string_decoder](https://www.npmjs.com/package/string_decoder) -* [timers](https://www.npmjs.com/package/timers-browserify) -* [tty](https://www.npmjs.com/package/tty-browserify) -* [url](https://www.npmjs.com/package/url) -* [util](https://www.npmjs.com/package/util) -* [vm](https://www.npmjs.com/package/vm-browserify) -* [zlib](https://www.npmjs.com/package/browserify-zlib) - -Additionally, if you use any of these variables, they -[will be defined](https://github.com/browserify/insert-module-globals) -in the bundled output in a browser-appropriate way: - -* [process](https://www.npmjs.com/package/process) -* [Buffer](https://www.npmjs.com/package/buffer) -* global - top-level scope object (window) -* __filename - file path of the currently executing file -* __dirname - directory path of the currently executing file - -# more examples - -## external requires - -You can just as easily create a bundle that will export a `require()` function so -you can `require()` modules from another script tag. Here we'll create a -`bundle.js` with the [through](https://www.npmjs.com/package/through) -and [duplexer](https://www.npmjs.com/package/duplexer) modules. - -``` -$ browserify -r through -r duplexer -r ./my-file.js:my-module > bundle.js -``` - -Then in your page you can do: - -``` html - - -``` - -## external source maps - -If you prefer the source maps be saved to a separate `.js.map` source map file, you may use -[exorcist](https://github.com/thlorenz/exorcist) in order to achieve that. It's as simple as: - -``` -$ browserify main.js --debug | exorcist bundle.js.map > bundle.js -``` - -Learn about additional options [here](https://github.com/thlorenz/exorcist#usage). - -## multiple bundles - -If browserify finds a `require`d function already defined in the page scope, it -will fall back to that function if it didn't find any matches in its own set of -bundled modules. - -In this way, you can use browserify to split up bundles among multiple pages to -get the benefit of caching for shared, infrequently-changing modules, while -still being able to use `require()`. Just use a combination of `--external` and -`--require` to factor out common dependencies. - -For example, if a website with 2 pages, `beep.js`: - -``` js -var robot = require('./robot.js'); -console.log(robot('beep')); -``` - -and `boop.js`: - -``` js -var robot = require('./robot.js'); -console.log(robot('boop')); -``` - -both depend on `robot.js`: - -``` js -module.exports = function (s) { return s.toUpperCase() + '!' }; -``` - -``` -$ browserify -r ./robot.js > static/common.js -$ browserify -x ./robot.js beep.js > static/beep.js -$ browserify -x ./robot.js boop.js > static/boop.js -``` - -Then on the beep page you can have: - -``` html - - -``` - -while the boop page can have: - -``` html - - -``` - -This approach using `-r` and `-x` works fine for a small number of split assets, -but there are plugins for automatically factoring out components which are -described in the -[partitioning section of the browserify handbook](https://github.com/browserify/browserify-handbook#partitioning). - -## api example - -You can use the API directly too: - -``` js -var browserify = require('browserify'); -var b = browserify(); -b.add('./browser/main.js'); -b.bundle().pipe(process.stdout); -``` - -# methods - -``` js -var browserify = require('browserify') -``` - -## `browserify([files] [, opts])` - -Returns a new browserify instance. - -
    -
    -files -
    - -
    -String, file object, or array of those types (they may be mixed) specifying entry file(s). -
    - -
    -opts -
    - -
    -Object. -
    -
    - -`files` and `opts` are both optional, but must be in the order shown if both are -passed. - -Entry files may be passed in `files` and / or `opts.entries`. - -External requires may be specified in `opts.require`, accepting the same formats -that the `files` argument does. - -If an entry file is a stream, its contents will be used. You should pass -`opts.basedir` when using streaming files so that relative requires can be -resolved. - -`opts.entries` has the same definition as `files`. - -`opts.noParse` is an array which will skip all require() and global parsing for -each file in the array. Use this for giant libs like jquery or threejs that -don't have any requires or node-style globals but take forever to parse. - -`opts.transform` is an array of transform functions or modules names which will -transform the source code before the parsing. - -`opts.ignoreTransform` is an array of transformations that will not be run, -even if specified elsewhere. - -`opts.plugin` is an array of plugin functions or module names to use. See the -plugins section below for details. - -`opts.extensions` is an array of optional extra extensions for the module lookup -machinery to use when the extension has not been specified. -By default browserify considers only `.js` and `.json` files in such cases. - -`opts.basedir` is the directory that browserify starts bundling from for -filenames that start with `.`. - -`opts.paths` is an array of directories that browserify searches when looking -for modules which are not referenced using relative path. Can be absolute or -relative to `basedir`. Equivalent of setting `NODE_PATH` environmental variable -when calling `browserify` command. - -`opts.commondir` sets the algorithm used to parse out the common paths. Use -`false` to turn this off, otherwise it uses the -[commondir](https://www.npmjs.com/package/commondir) module. - -`opts.fullPaths` disables converting module ids into numerical indexes. This is -useful for preserving the original paths that a bundle was generated with. - -`opts.builtins` sets the list of built-ins to use, which by default is set in -`lib/builtins.js` in this distribution. - -`opts.bundleExternal` boolean option to set if external modules should be -bundled. Defaults to true. - -When `opts.browserField` is false, the package.json browser field will be ignored. - -When `opts.insertGlobals` is true, always insert `process`, `global`, -`__filename`, and `__dirname` without analyzing the AST for faster builds but -larger output bundles. Default false. - -When `opts.detectGlobals` is true, scan all files for `process`, `global`, -`__filename`, and `__dirname`, defining as necessary. With this option npm -modules are more likely to work but bundling takes longer. Default true. - -When `opts.ignoreMissing` is true, ignore `require()` statements that don't -resolve to anything. - -When `opts.debug` is true, add a source map inline to the end of the bundle. -This makes debugging easier because you can see all the original files if -you are in a modern enough browser. - -When `opts.standalone` is a non-empty string, a standalone module is created -with that name and a [umd](https://github.com/forbeslindesay/umd) wrapper. -You can use namespaces in the standalone global export using a `.` in the string -name as a separator, for example `'A.B.C'`. The global export will be [sanitized -and camel cased](https://github.com/ForbesLindesay/umd#name-casing-and-characters). - -Note that in standalone mode the `require()` calls from the original source will -still be around, which may trip up AMD loaders scanning for `require()` calls. -You can remove these calls with -[derequire](https://www.npmjs.com/package/derequire): - -``` -$ npm install -g derequire -$ browserify main.js --standalone Foo | derequire > bundle.js -``` - -`opts.insertGlobalVars` will be passed to -[insert-module-globals](https://www.npmjs.com/package/insert-module-globals) -as the `opts.vars` parameter. - -`opts.externalRequireName` defaults to `'require'` in `expose` mode but you can -use another name. - -`opts.bare` creates a bundle that does not include Node builtins, and does not -replace global Node variables except for `__dirname` and `__filename`. - -`opts.node` creates a bundle that runs in Node and does not use the browser -versions of dependencies. Same as passing `{ bare: true, browserField: false }`. - -Note that if files do not contain javascript source code then you also need to -specify a corresponding transform for them. - -All other options are forwarded along to -[module-deps](https://www.npmjs.com/package/module-deps) -and [browser-pack](https://www.npmjs.com/package/browser-pack) directly. - -## b.add(file, opts) - -Add an entry file from `file` that will be executed when the bundle loads. - -If `file` is an array, each item in `file` will be added as an entry file. - -## b.require(file, opts) - -Make `file` available from outside the bundle with `require(file)`. - -The `file` param is anything that can be resolved by `require.resolve()`, -including files from `node_modules`. Like with `require.resolve()`, you must -prefix `file` with `./` to require a local file (not in `node_modules`). - -`file` can also be a stream, but you should also use `opts.basedir` so that -relative requires will be resolvable. - -If `file` is an array, each item in `file` will be required. -In `file` array form, you can use a string or object for each item. Object items -should have a `file` property and the rest of the parameters will be used for -the `opts`. - -Use the `expose` property of opts to specify a custom dependency name. -`require('./vendor/angular/angular.js', {expose: 'angular'})` enables `require('angular')` - -## b.bundle(cb) - -Bundle the files and their dependencies into a single javascript file. - -Return a readable stream with the javascript file contents or -optionally specify a `cb(err, buf)` to get the buffered results. - -## b.external(file) - -Prevent `file` from being loaded into the current bundle, instead referencing -from another bundle. - -If `file` is an array, each item in `file` will be externalized. - -If `file` is another bundle, that bundle's contents will be read and excluded -from the current bundle as the bundle in `file` gets bundled. - -## b.ignore(file) - -Prevent the module name or file at `file` from showing up in the output bundle. - -If `file` is an array, each item in `file` will be ignored. - -Instead you will get a file with `module.exports = {}`. - -## b.exclude(file) - -Prevent the module name or file at `file` from showing up in the output bundle. - -If `file` is an array, each item in `file` will be excluded. - -If your code tries to `require()` that file it will throw unless you've provided -another mechanism for loading it. - -## b.transform(tr, opts={}) - -Transform source code before parsing it for `require()` calls with the transform -function or module name `tr`. - -If `tr` is a function, it will be called with `tr(file)` and it should return a -[through-stream](https://github.com/substack/stream-handbook#through) -that takes the raw file contents and produces the transformed source. - -If `tr` is a string, it should be a module name or file path of a -[transform module](https://github.com/browserify/module-deps#transforms) -with a signature of: - -``` js -var through = require('through'); -module.exports = function (file) { return through() }; -``` - -You don't need to necessarily use the -[through](https://www.npmjs.com/package/through) module. -Browserify is compatible with the newer, more verbose -[Transform streams](http://nodejs.org/api/stream.html#stream_class_stream_transform_1) -built into Node v0.10. - -Here's how you might compile coffee script on the fly using `.transform()`: - -``` js -var coffee = require('coffee-script'); -var through = require('through'); - -b.transform(function (file) { - var data = ''; - return through(write, end); - - function write (buf) { data += buf } - function end () { - this.queue(coffee.compile(data)); - this.queue(null); - } -}); -``` - -Note that on the command-line with the `-c` flag you can just do: - -``` -$ browserify -c 'coffee -sc' main.coffee > bundle.js -``` - -Or better still, use the [coffeeify](https://github.com/jnordberg/coffeeify) -module: - -``` -$ npm install coffeeify -$ browserify -t coffeeify main.coffee > bundle.js -``` - -If `opts.global` is `true`, the transform will operate on ALL files, despite -whether they exist up a level in a `node_modules/` directory. Use global -transforms cautiously and sparingly, since most of the time an ordinary -transform will suffice. You can also not configure global transforms in a -`package.json` like you can with ordinary transforms. - -Global transforms always run after any ordinary transforms have run. - -Transforms may obtain options from the command-line with -[subarg](https://www.npmjs.com/package/subarg) syntax: - -``` -$ browserify -t [ foo --bar=555 ] main.js -``` - -or from the api: - -``` -b.transform('foo', { bar: 555 }) -``` - -In both cases, these options are provided as the second argument to the -transform function: - -``` -module.exports = function (file, opts) { /* opts.bar === 555 */ } -``` - -Options sent to the browserify constructor are also provided under -`opts._flags`. These browserify options are sometimes required if your transform -needs to do something different when browserify is run in debug mode, for -example. - -## b.plugin(plugin, opts) - -Register a `plugin` with `opts`. Plugins can be a string module name or a -function the same as transforms. - -`plugin(b, opts)` is called with the browserify instance `b`. - -For more information, consult the plugins section below. - -## b.pipeline - -There is an internal -[labeled-stream-splicer](https://www.npmjs.com/package/labeled-stream-splicer) -pipeline with these labels: - -* `'record'` - save inputs to play back later on subsequent `bundle()` calls -* `'deps'` - [module-deps](https://www.npmjs.com/package/module-deps) -* `'json'` - adds `module.exports=` to the beginning of json files -* `'unbom'` - remove byte-order markers -* `'unshebang'` - remove #! labels on the first line -* `'syntax'` - check for syntax errors -* `'sort'` - sort the dependencies for deterministic bundles -* `'dedupe'` - remove duplicate source contents -* `'label'` - apply integer labels to files -* `'emit-deps'` - emit `'dep'` event -* `'debug'` - apply source maps -* `'pack'` - [browser-pack](https://www.npmjs.com/package/browser-pack) -* `'wrap'` - apply final wrapping, `require=` and a newline and semicolon - -You can call `b.pipeline.get()` with a label name to get a handle on a stream pipeline -that you can `push()`, `unshift()`, or `splice()` to insert your own transform -streams. - -## b.reset(opts) - -Reset the pipeline back to a normal state. This function is called automatically -when `bundle()` is called multiple times. - -This function triggers a 'reset' event. - -# package.json - -browserify uses the `package.json` in its module resolution algorithm, just like -node. If there is a `"main"` field, browserify will start resolving the package -at that point. If there is no `"main"` field, browserify will look for an -`"index.js"` file in the module root directory. Here are some more -sophisticated things you can do in the package.json: - -## browser field - -There is a special "[browser](https://github.com/defunctzombie/package-browser-field-spec)" field you can -set in your package.json on a per-module basis to override file resolution for -browser-specific versions of files. - -For example, if you want to have a browser-specific module entry point for your -`"main"` field you can just set the `"browser"` field to a string: - -``` json -"browser": "./browser.js" -``` - -or you can have overrides on a per-file basis: - -``` json -"browser": { - "fs": "level-fs", - "./lib/ops.js": "./browser/opts.js" -} -``` - -Note that the browser field only applies to files in the local module, and like -transforms, it doesn't apply into `node_modules` directories. - -## browserify.transform - -You can specify source transforms in the package.json in the -`browserify.transform` field. There is more information about how source -transforms work in package.json on the -[module-deps readme](https://github.com/browserify/module-deps#transforms). - -For example, if your module requires [brfs](https://www.npmjs.com/package/brfs), you -can add - -``` json -"browserify": { "transform": [ "brfs" ] } -``` - -to your package.json. Now when somebody `require()`s your module, brfs will -automatically be applied to the files in your module without explicit -intervention by the person using your module. Make sure to add transforms to -your package.json dependencies field. - -# events - -## b.on('file', function (file, id, parent) {}) -## b.pipeline.on('file', function (file, id, parent) {}) - -When a file is resolved for the bundle, the bundle emits a `'file'` event with -the full `file` path, the `id` string passed to `require()`, and the `parent` -object used by -[browser-resolve](https://github.com/defunctzombie/node-browser-resolve). - -You could use the `file` event to implement a file watcher to regenerate bundles -when files change. - -## b.on('package', function (pkg) {}) -## b.pipeline.on('package', function (pkg) {}) - -When a package file is read, this event fires with the contents. The package -directory is available at `pkg.__dirname`. - -## b.on('bundle', function (bundle) {}) - -When `.bundle()` is called, this event fires with the `bundle` output stream. - -## b.on('reset', function () {}) - -When the `.reset()` method is called or implicitly called by another call to -`.bundle()`, this event fires. - -## b.on('transform', function (tr, file) {}) -## b.pipeline.on('transform', function (tr, file) {}) - -When a transform is applied to a file, the `'transform'` event fires on the -bundle stream with the transform stream `tr` and the `file` that the transform -is being applied to. - -# plugins - -For some more advanced use-cases, a transform is not sufficiently extensible. -Plugins are modules that take the bundle instance as their first parameter and -an option hash as their second. - -Plugins can be used to do perform some fancy features that transforms can't do. -For example, [factor-bundle](https://www.npmjs.com/package/factor-bundle) is a -plugin that can factor out common dependencies from multiple entry-points into a -common bundle. Use plugins with `-p` and pass options to plugins with -[subarg](https://www.npmjs.com/package/subarg) syntax: - -``` -browserify x.js y.js -p [ factor-bundle -o bundle/x.js -o bundle/y.js ] \ - > bundle/common.js -``` - -For a list of plugins, consult the -[browserify-plugin tag](https://www.npmjs.com/browse/keyword/browserify-plugin) -on npm. - -# list of source transforms - -There is a [wiki page that lists the known browserify -transforms](https://github.com/browserify/browserify/wiki/list-of-transforms). - -If you write a transform, make sure to add your transform to that wiki page and -add a package.json keyword of `browserify-transform` so that -[people can browse for all the browserify -transforms](https://www.npmjs.com/browse/keyword/browserify-transform) on npmjs.org. - -# third-party tools - -There is a [wiki page that lists the known browserify -tools](https://github.com/browserify/browserify/wiki/browserify-tools). - -If you write a tool, make sure to add it to that wiki page and -add a package.json keyword of `browserify-tool` so that -[people can browse for all the browserify -tools](https://www.npmjs.com/browse/keyword/browserify-tool) on npmjs.org. - -# changelog - -Releases are documented in -[changelog.markdown](changelog.markdown) and on the -[browserify twitter feed](https://twitter.com/browserify). - -# license - -[MIT](./LICENSE) - -![browserify!](./assets/browserify.png) diff --git a/node_modules/browserify/test/args.js b/node_modules/browserify/test/args.js deleted file mode 100644 index 6f8cb0216..000000000 --- a/node_modules/browserify/test/args.js +++ /dev/null @@ -1,72 +0,0 @@ -var test = require('tap').test; -var fromArgs = require('../bin/args.js'); -var path = require('path'); -var vm = require('vm'); - -test('bundle from an arguments array', function (t) { - t.plan(2); - - var b = fromArgs([ __dirname + '/entry/two.js', '-s', 'XYZ' ]); - b.bundle(function (err, src) { - t.ifError(err); - var c = { window: {} }; - vm.runInNewContext(src, c); - t.equal(c.window.XYZ, 2); - }); -}); - -test('external flag for node modules', function(t) { - t.plan(2); - - var b = fromArgs([ __dirname + '/external_args/main.js', '-x', 'backbone' ]); - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src, {t: t}); - }); -}); - -test('bundle from an arguments with --insert-global-vars', function (t) { - t.plan(4); - - var b = fromArgs([ - __dirname + '/global/filename.js', - '--insert-global-vars=__filename,__dirname', - '--basedir', __dirname - ]); - b.require(__dirname + '/global/filename.js', { expose: 'x' }); - b.bundle(function (err, src) { - t.ifError(err, 'b.bundle()'); - var c = {}, x; - vm.runInNewContext(src, c); - t.doesNotThrow(function() { - x = c.require('x'); - }, 'x = c.require(\'x\')'); - t.equal(x && x.filename, '/global/filename.js', 'x.filename'); - t.equal(x && x.dirname, '/global', 'x.dirname'); - }) -}); - -test('numeric module names', function(t) { - t.plan(1); - - var b = fromArgs([ '-x', '1337' ]); - b.bundle(function (err, src) { - t.ifError(err); - }); -}); - -test('entry expose', function (t) { - t.plan(3) - - var b = fromArgs([ - path.join(__dirname, '/entry_expose/main.js'), - '--require', path.join(__dirname, '/entry_expose/main.js') + ':x', - ]); - b.bundle(function (err, src) { - t.ifError(err); - var c = { console: { log: log } }; - function log (msg) { t.equal(msg, 'wow') } - vm.runInNewContext(src, c); - t.equal(c.require('x'), 555); - }) -}); diff --git a/node_modules/browserify/test/array.js b/node_modules/browserify/test/array.js deleted file mode 100644 index 31d4c89ee..000000000 --- a/node_modules/browserify/test/array.js +++ /dev/null @@ -1,74 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('array add', function (t) { - var expected = [ 'ONE', 'TWO', 'THREE' ]; - t.plan(expected.length); - - var b = browserify(); - var files = [ - __dirname + '/array/one.js', - __dirname + '/array/two.js', - __dirname + '/array/three.js' - ]; - b.add(files); - b.bundle(function (err, src) { - vm.runInNewContext(src, { console: { log: log } }); - function log (msg) { - t.equal(msg, expected.shift()); - } - }); -}); - -test('array require', function (t) { - t.plan(3); - - var b = browserify(); - var files = [ 'defined', 'subarg' ]; - b.require(files); - b.bundle(function (err, src) { - var c = {}; - vm.runInNewContext(src, c); - - t.equal(c.require('defined')(undefined, true), true); - t.equal(c.require('defined')(undefined, false), false); - t.deepEqual(c.require('subarg')(['-x', '3']), { x: 3, _: [] }); - }); -}); - -test('array require opts', function (t) { - t.plan(3); - - var b = browserify(); - var files = [ - { file: require.resolve('defined'), expose: 'abc' }, - { file: require.resolve('subarg'), expose: 'def' } - ]; - b.require(files); - b.bundle(function (err, src) { - var c = {}; - vm.runInNewContext(src, c); - - t.equal(c.require('abc')(undefined, true), true); - t.equal(c.require('abc')(undefined, false), false); - t.deepEqual(c.require('def')(['-x', '3']), { x: 3, _: [] }); - }); -}); - -test('array external', function (t) { - t.plan(2); - - var b = browserify(__dirname + '/external/main.js'); - b.external(['util','freelist']); - b.bundle(function (err, src) { - if (err) return t.fail(err); - vm.runInNewContext( - 'function require (x) {' - + 'if (x==="freelist") return function (n) { return n + 1000 }' - + '}' - + src, - { t: t } - ); - }); -}); diff --git a/node_modules/browserify/test/array/one.js b/node_modules/browserify/test/array/one.js deleted file mode 100644 index c6312fd4c..000000000 --- a/node_modules/browserify/test/array/one.js +++ /dev/null @@ -1 +0,0 @@ -console.log('ONE'); diff --git a/node_modules/browserify/test/array/three.js b/node_modules/browserify/test/array/three.js deleted file mode 100644 index 77a6c3afb..000000000 --- a/node_modules/browserify/test/array/three.js +++ /dev/null @@ -1 +0,0 @@ -console.log('THREE'); diff --git a/node_modules/browserify/test/array/two.js b/node_modules/browserify/test/array/two.js deleted file mode 100644 index fa60b5ad7..000000000 --- a/node_modules/browserify/test/array/two.js +++ /dev/null @@ -1 +0,0 @@ -console.log('TWO'); diff --git a/node_modules/browserify/test/async.js b/node_modules/browserify/test/async.js deleted file mode 100644 index e9bd246aa..000000000 --- a/node_modules/browserify/test/async.js +++ /dev/null @@ -1,24 +0,0 @@ -var browserify = require('../'); -var fs = require('fs'); -var vm = require('vm'); -var test = require('tap').test; - -var src = fs.readFileSync(__dirname + '/async/src.js','utf8'); -var canAsync = true; -try { Function(src) } catch (err) { canAsync = false } - -if (!canAsync) console.error('# async/await unsupported in this environment') -else test('async/await', function (t) { - t.plan(2); - var b = browserify(__dirname + '/async/src.js'); - b.bundle(function (err, src) { - t.error(err) - var c = { - console: { log: log }, - setTimeout: setTimeout, - clearTimeout: clearTimeout - } - vm.runInNewContext(src, c); - function log (msg) { t.equal(msg, 60) } - }); -}); diff --git a/node_modules/browserify/test/async/src.js b/node_modules/browserify/test/async/src.js deleted file mode 100644 index 7a50fbcd5..000000000 --- a/node_modules/browserify/test/async/src.js +++ /dev/null @@ -1,8 +0,0 @@ -function f (x) { return new Promise(resolve => { - process.nextTick(() => { resolve(x) }) }) } - -async function add (x) { - return x + await f(20) + await f(30) -} - -add(10).then(v => { console.log(v) }) diff --git a/node_modules/browserify/test/backbone.js b/node_modules/browserify/test/backbone.js deleted file mode 100644 index 03e6f690d..000000000 --- a/node_modules/browserify/test/backbone.js +++ /dev/null @@ -1,23 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var backbone = require('backbone'); -var test = require('tap').test; - -test('backbone', function (t) { - t.plan(3); - var b = browserify(); - b.require('backbone'); - b.bundle(function (err, buf) { - t.ok(Buffer.isBuffer(buf)); - var src = buf.toString('utf8'); - t.ok(src.length > 0); - - var c = { console: console }; - vm.runInNewContext(src, c); - t.deepEqual( - Object.keys(backbone).sort(), - Object.keys(c.require('backbone')).sort() - ); - t.end(); - }); -}); diff --git a/node_modules/browserify/test/bare.js b/node_modules/browserify/test/bare.js deleted file mode 100644 index 039c587a8..000000000 --- a/node_modules/browserify/test/bare.js +++ /dev/null @@ -1,173 +0,0 @@ -var test = require('tap').test; -var spawn = require('child_process').spawn; -var browserify = require('../'); -var path = require('path'); -var concat = require('concat-stream'); -var vm = require('vm'); -var fs = require('fs'); -var through = require('through2'); -var temp = require('temp'); -temp.track(); -var tmpdir = temp.mkdirSync({prefix: 'browserify-test'}); - -test('bare', function (t) { - t.plan(4); - - var cwd = process.cwd(); - process.chdir(__dirname); - - var ps = spawn(process.execPath, [ - path.resolve(__dirname, '../bin/cmd.js'), - '-', '--bare' - ]); - ps.stdout.pipe(concat(function (body) { - vm.runInNewContext(body, { - Buffer: function (s) { return s.toLowerCase() }, - console: { - log: function (msg) { t.equal(msg, 'abc') } - } - }); - vm.runInNewContext(body, { - Buffer: Buffer, - console: { - log: function (msg) { - t.ok(Buffer.isBuffer(msg)); - t.equal(msg.toString('utf8'), 'ABC') - } - } - }); - })); - ps.stdin.end('console.log(Buffer("ABC"))'); - - ps.on('exit', function (code) { - t.equal(code, 0); - }); -}); - -test('bare api', function (t) { - t.plan(3); - - var input = through(); - var b = browserify(input, { bare: true }); - b.bundle().pipe(concat(function (body) { - vm.runInNewContext(body, { - Buffer: function (s) { return s.toLowerCase() }, - console: { - log: function (msg) { t.equal(msg, 'abc') } - } - }); - vm.runInNewContext(body, { - Buffer: Buffer, - console: { - log: function (msg) { - t.ok(Buffer.isBuffer(msg)); - t.equal(msg.toString('utf8'), 'ABC') - } - } - }); - })); - input.end('console.log(Buffer("ABC"))'); -}); - -test('bare inserts __filename,__dirname but not process,global,Buffer', function (t) { - t.plan(2); - - var file = path.resolve(__dirname, 'bare/main.js'); - var ps = spawn(process.execPath, [ - path.resolve(__dirname, '../bin/cmd.js'), - file, - '--bare' - ]); - - ps.stdout.pipe(concat(function (body) { - vm.runInNewContext(body, { - require: require, - __dirname: process.cwd(), - console: { - log: function (msg) { - t.same(msg, [ - path.join(__dirname, 'bare'), - path.join(__dirname, 'bare/main.js'), - 'undefined', - 'undefined', - 'undefined' - ]); - } - } - }); - })); - ps.stdin.end(); - - ps.on('exit', function (code) { - t.equal(code, 0); - }); -}); - -test('bare inserts dynamic __filename,__dirname', function (t) { - t.plan(2); - - var file = path.join(tmpdir, 'dirname-filename.js'); - - fs.writeFileSync( - file, - fs.readFileSync(path.resolve(__dirname, 'bare/dirname-filename.js')) - ); - - var ps = spawn(process.execPath, [ - path.resolve(__dirname, '../bin/cmd.js'), - file, - '--bare' - ]); - - ps.stdout.pipe(concat(function (body) { - vm.runInNewContext(body, { - require: require, - __dirname: process.cwd(), - console: { - log: function (msg) { - t.same(msg, [ - path.dirname(file), - file - ]); - } - } - }); - })); - ps.stdin.end(); - - ps.on('exit', function (code) { - t.equal(code, 0); - }); -}); - -test('bare inserts dynamic __filename,__dirname with basedir', function (t) { - t.plan(2); - - var file = 'dirname-filename.js'; - var ps = spawn(process.execPath, [ - path.resolve(__dirname, '../bin/cmd.js'), - file, - '--bare', - '--basedir=' + path.join(__dirname, 'bare') - ]); - - ps.stdout.pipe(concat(function (body) { - vm.runInNewContext(body, { - require: require, - __dirname: process.cwd(), - console: { - log: function (msg) { - t.same(msg, [ - __dirname, - path.join(__dirname, file) - ]); - } - } - }); - })); - ps.stdin.end(); - - ps.on('exit', function (code) { - t.equal(code, 0); - }); -}); diff --git a/node_modules/browserify/test/bare/dirname-filename.js b/node_modules/browserify/test/bare/dirname-filename.js deleted file mode 100644 index c10337d07..000000000 --- a/node_modules/browserify/test/bare/dirname-filename.js +++ /dev/null @@ -1,4 +0,0 @@ -console.log([ - __dirname, - __filename -]); diff --git a/node_modules/browserify/test/bare/main.js b/node_modules/browserify/test/bare/main.js deleted file mode 100644 index e79174303..000000000 --- a/node_modules/browserify/test/bare/main.js +++ /dev/null @@ -1,7 +0,0 @@ -console.log([ - __dirname, - __filename, - typeof process, - typeof global, - typeof Buffer -]); diff --git a/node_modules/browserify/test/bare_shebang.js b/node_modules/browserify/test/bare_shebang.js deleted file mode 100644 index c47bf44d0..000000000 --- a/node_modules/browserify/test/bare_shebang.js +++ /dev/null @@ -1,37 +0,0 @@ -var test = require('tap').test; -var spawn = require('child_process').spawn; -var path = require('path'); -var concat = require('concat-stream'); -var vm = require('vm'); - -test('bare shebang', function (t) { - t.plan(4); - - var ps = spawn(process.execPath, [ - path.resolve(__dirname, '../bin/cmd.js'), - '-', '--bare' - ]); - ps.stderr.pipe(process.stderr); - ps.stdout.pipe(concat(function (body) { - vm.runInNewContext(body, { - Buffer: function (s) { return s.toLowerCase() }, - console: { - log: function (msg) { t.equal(msg, 'woo') } - } - }); - vm.runInNewContext(body, { - Buffer: Buffer, - console: { - log: function (msg) { - t.ok(Buffer.isBuffer(msg)); - t.equal(msg.toString('utf8'), 'WOO') - } - } - }); - })); - ps.stdin.end('#!/usr/bin/env node\nconsole.log(Buffer("WOO"))'); - - ps.on('exit', function (code) { - t.equal(code, 0); - }); -}); diff --git a/node_modules/browserify/test/bin.js b/node_modules/browserify/test/bin.js deleted file mode 100644 index cb7b17aab..000000000 --- a/node_modules/browserify/test/bin.js +++ /dev/null @@ -1,31 +0,0 @@ -var test = require('tap').test; -var spawn = require('child_process').spawn; -var path = require('path'); -var vm = require('vm'); - -test('bin', function (t) { - t.plan(3); - - var cwd = process.cwd(); - process.chdir(__dirname); - - var ps = spawn(process.execPath, [ - path.resolve(__dirname, '../bin/cmd.js'), - 'entry/main.js' - ]); - var src = ''; - var err = ''; - ps.stdout.on('data', function (buf) { src += buf }); - ps.stderr.on('data', function (buf) { err += buf }); - - ps.on('exit', function (code) { - t.equal(code, 0); - t.equal(err, ''); - - var allDone = false; - var c = { done : function () { allDone = true } }; - - vm.runInNewContext(src, c); - t.ok(allDone); - }); -}); diff --git a/node_modules/browserify/test/bin_entry.js b/node_modules/browserify/test/bin_entry.js deleted file mode 100644 index f7e9af322..000000000 --- a/node_modules/browserify/test/bin_entry.js +++ /dev/null @@ -1,31 +0,0 @@ -var test = require('tap').test; -var spawn = require('child_process').spawn; -var path = require('path'); -var vm = require('vm'); - -test('bin --entry', function (t) { - t.plan(3); - - var cwd = process.cwd(); - process.chdir(__dirname); - - var ps = spawn(process.execPath, [ - path.resolve(__dirname, '../bin/cmd.js'), - '--entry', 'entry/main.js' - ]); - var src = ''; - var err = ''; - ps.stdout.on('data', function (buf) { src += buf }); - ps.stderr.on('data', function (buf) { err += buf }); - - ps.on('exit', function (code) { - t.equal(code, 0); - t.equal(err, ''); - - var allDone = false; - var c = { done : function () { allDone = true } }; - - vm.runInNewContext(src, c); - t.ok(allDone); - }); -}); diff --git a/node_modules/browserify/test/bin_tr_error.js b/node_modules/browserify/test/bin_tr_error.js deleted file mode 100644 index a68127545..000000000 --- a/node_modules/browserify/test/bin_tr_error.js +++ /dev/null @@ -1,27 +0,0 @@ -var browserify = require('../'); -var spawn = require('child_process').spawn; -var test = require('tap').test; -var path = require('path') -var semver = require('semver'); - -// TODO this should be fixable I guess -var flaky = process.platform === 'win32' && semver.satisfies(process.version, 'v0.10.x'); - -test('function transform', { skip: flaky }, function (t) { - t.plan(3); - var ps = spawn(process.execPath, [ - path.resolve(__dirname, '../bin/cmd.js'), - '-t', './tr.js', './main.js' - ], {cwd: path.resolve(__dirname, 'bin_tr_error')}); - var src = ''; - var err = ''; - ps.stdout.on('data', function (buf) { src += buf }); - ps.stderr.on('data', function (buf) { err += buf }); - - ps.on('exit', function (code) { - t.notEqual(code, 0); - var errorFile = path.resolve(__dirname, 'bin_tr_error', 'tr.js'); - t.notEqual(err.indexOf('there was error'), -1, 'Error should contain error message') - t.notEqual(err.indexOf(errorFile), -1, 'Error should contain stack trace') - }); -}); diff --git a/node_modules/browserify/test/bin_tr_error/main.js b/node_modules/browserify/test/bin_tr_error/main.js deleted file mode 100644 index ec448ae83..000000000 --- a/node_modules/browserify/test/bin_tr_error/main.js +++ /dev/null @@ -1 +0,0 @@ -t.equal(XXX * 5, 555); diff --git a/node_modules/browserify/test/bin_tr_error/tr.js b/node_modules/browserify/test/bin_tr_error/tr.js deleted file mode 100644 index c4e537e1d..000000000 --- a/node_modules/browserify/test/bin_tr_error/tr.js +++ /dev/null @@ -1,12 +0,0 @@ -var through = require('through2'); - -module.exports = function (file, opts) { - var data = ''; - return through(write, end); - - function write (buf, enc, next) { data += buf; next() } - function end () { - this.emit('error', new Error('there was error')) - this.push(null); - } -}; diff --git a/node_modules/browserify/test/bom.js b/node_modules/browserify/test/bom.js deleted file mode 100644 index 78cca51e6..000000000 --- a/node_modules/browserify/test/bom.js +++ /dev/null @@ -1,19 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('byte order marker', function (t) { - t.plan(2); - - var b = browserify(__dirname + '/bom/hello.js'); - b.bundle(function (err, src) { - if (err) t.fail(err); - var c = { - console: { log: function (msg) { - t.equal(msg, 'hello'); - } } - }; - vm.runInNewContext(src, c); - t.notOk(/\ufeff/.test(src.toString('utf8'))); - }); -}); diff --git a/node_modules/browserify/test/bom/hello.js b/node_modules/browserify/test/bom/hello.js deleted file mode 100644 index 03b374a1e..000000000 --- a/node_modules/browserify/test/bom/hello.js +++ /dev/null @@ -1 +0,0 @@ -console.log('hello') diff --git a/node_modules/browserify/test/browser_field_file.js b/node_modules/browserify/test/browser_field_file.js deleted file mode 100644 index cecaef227..000000000 --- a/node_modules/browserify/test/browser_field_file.js +++ /dev/null @@ -1,13 +0,0 @@ -var test = require('tap').test; -var vm = require('vm'); -var browserify = require('../'); - -test('browser field file no ext', function (t) { - t.plan(2); - var b = browserify(__dirname + '/browser_field_file/xyz'); - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src, { console: { log: log } }); - function log (msg) { t.equal(msg, 'cool beans') } - }); -}); diff --git a/node_modules/browserify/test/browser_field_file/package.json b/node_modules/browserify/test/browser_field_file/package.json deleted file mode 100644 index f146bccdb..000000000 --- a/node_modules/browserify/test/browser_field_file/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./xyz": "wow.js" - } -} diff --git a/node_modules/browserify/test/browser_field_file/wow.js b/node_modules/browserify/test/browser_field_file/wow.js deleted file mode 100644 index eca0d7591..000000000 --- a/node_modules/browserify/test/browser_field_file/wow.js +++ /dev/null @@ -1 +0,0 @@ -console.log('cool beans'); diff --git a/node_modules/browserify/test/browser_field_resolve.js b/node_modules/browserify/test/browser_field_resolve.js deleted file mode 100644 index 0b26fef4a..000000000 --- a/node_modules/browserify/test/browser_field_resolve.js +++ /dev/null @@ -1,124 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('browser field resolve (a)', function (t) { - t.plan(2); - var b = browserify(__dirname + '/browser_field_resolve/a/main.js'); - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src, { console: { log: log } }); - function log (x) { t.equal(x, 555) } - }); -}); - -test('browser field resolve (b)', function (t) { - t.plan(2); - var b = browserify(__dirname + '/browser_field_resolve/b/main.js'); - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src, { console: { log: log } }); - function log (x) { t.equal(x, 444) } - }); -}); - -test('browser field resolve (c)', function (t) { - t.plan(2); - var b = browserify(__dirname + '/browser_field_resolve/c/main.js'); - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src, { console: { log: log } }); - function log (x) { t.equal(x, 333) } - }); - -}); - -test('browser field resolve (d)', function (t) { - t.plan(2); - var b = browserify(__dirname + '/browser_field_resolve/d/main.js'); - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src, { console: { log: log } }); - function log (x) { t.equal(x, 222) } - }); -}); - -test('browser field resolve (e)', function (t) { - t.plan(2); - var b = browserify(__dirname + '/browser_field_resolve/e/main.js'); - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src, { console: { log: log } }); - function log (x) { t.equal(x, 111) } - }); -}); - -test('browser field resolve (f)', function (t) { - t.plan(2); - var b = browserify(__dirname + '/browser_field_resolve/f/main.js'); - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src, { console: { log: log } }); - function log (x) { t.equal(x, 999) } - }); -}); - -test('browser field resolve (g)', function (t) { - t.plan(2); - var b = browserify(__dirname + '/browser_field_resolve/g/main.js'); - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src, { console: { log: log } }); - function log (x) { t.deepEqual(x, {}) } - }); -}); - -test('browser field resolve (h)', function (t) { - t.plan(2); - var b = browserify(__dirname + '/browser_field_resolve/h/main.js'); - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src, { console: { log: log } }); - function log (x) { t.deepEqual(x, {}) } - }); -}); - -test('browser field resolve (i)', function (t) { - t.plan(2); - var b = browserify(__dirname + '/browser_field_resolve/i/main.js'); - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src, { console: { log: log } }); - function log (x) { t.deepEqual(x, 5000) } - }); -}); - -test('browser field resolve (j)', function (t) { - t.plan(2); - var b = browserify(__dirname + '/browser_field_resolve/j/main.js'); - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src, { console: { log: log } }); - function log (x) { t.deepEqual(x, 5000) } - }); -}); - -test('browser field resolve (k)', function (t) { - t.plan(2); - var b = browserify(__dirname + '/browser_field_resolve/k/main.js'); - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src, { console: { log: log } }); - function log (x) { t.deepEqual(x, 3000) } - }); -}); - -test('browser field resolve (l)', function (t) { - t.plan(2); - var b = browserify(__dirname + '/browser_field_resolve/l/main.js'); - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src, { console: { log: log } }); - function log (x) { t.deepEqual(x, 3000) } - }); -}); diff --git a/node_modules/browserify/test/browser_field_resolve/a/main.js b/node_modules/browserify/test/browser_field_resolve/a/main.js deleted file mode 100644 index 04798b6ba..000000000 --- a/node_modules/browserify/test/browser_field_resolve/a/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log(require('zzz')) diff --git a/node_modules/browserify/test/browser_field_resolve/a/node_modules/aaa/main.js b/node_modules/browserify/test/browser_field_resolve/a/node_modules/aaa/main.js deleted file mode 100644 index 3e842e734..000000000 --- a/node_modules/browserify/test/browser_field_resolve/a/node_modules/aaa/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 555 diff --git a/node_modules/browserify/test/browser_field_resolve/a/node_modules/aaa/package.json b/node_modules/browserify/test/browser_field_resolve/a/node_modules/aaa/package.json deleted file mode 100644 index c13b8cf6a..000000000 --- a/node_modules/browserify/test/browser_field_resolve/a/node_modules/aaa/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "main.js" -} diff --git a/node_modules/browserify/test/browser_field_resolve/a/package.json b/node_modules/browserify/test/browser_field_resolve/a/package.json deleted file mode 100644 index 36ad48686..000000000 --- a/node_modules/browserify/test/browser_field_resolve/a/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "zzz": "aaa" - } -} diff --git a/node_modules/browserify/test/browser_field_resolve/b/main.js b/node_modules/browserify/test/browser_field_resolve/b/main.js deleted file mode 100644 index 04798b6ba..000000000 --- a/node_modules/browserify/test/browser_field_resolve/b/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log(require('zzz')) diff --git a/node_modules/browserify/test/browser_field_resolve/b/package.json b/node_modules/browserify/test/browser_field_resolve/b/package.json deleted file mode 100644 index ed91400b5..000000000 --- a/node_modules/browserify/test/browser_field_resolve/b/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "zzz": "./x" - } -} diff --git a/node_modules/browserify/test/browser_field_resolve/b/x.js b/node_modules/browserify/test/browser_field_resolve/b/x.js deleted file mode 100644 index 41a4973b3..000000000 --- a/node_modules/browserify/test/browser_field_resolve/b/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 444 diff --git a/node_modules/browserify/test/browser_field_resolve/c/main.js b/node_modules/browserify/test/browser_field_resolve/c/main.js deleted file mode 100644 index d2bbb5368..000000000 --- a/node_modules/browserify/test/browser_field_resolve/c/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log(require('./z.js')) diff --git a/node_modules/browserify/test/browser_field_resolve/c/package.json b/node_modules/browserify/test/browser_field_resolve/c/package.json deleted file mode 100644 index 2bd5e9ded..000000000 --- a/node_modules/browserify/test/browser_field_resolve/c/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./z": "./x" - } -} diff --git a/node_modules/browserify/test/browser_field_resolve/c/x.js b/node_modules/browserify/test/browser_field_resolve/c/x.js deleted file mode 100644 index 91238822e..000000000 --- a/node_modules/browserify/test/browser_field_resolve/c/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 333 diff --git a/node_modules/browserify/test/browser_field_resolve/d/main.js b/node_modules/browserify/test/browser_field_resolve/d/main.js deleted file mode 100644 index d2bbb5368..000000000 --- a/node_modules/browserify/test/browser_field_resolve/d/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log(require('./z.js')) diff --git a/node_modules/browserify/test/browser_field_resolve/d/package.json b/node_modules/browserify/test/browser_field_resolve/d/package.json deleted file mode 100644 index deeed5621..000000000 --- a/node_modules/browserify/test/browser_field_resolve/d/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./z.js": "./x.js" - } -} diff --git a/node_modules/browserify/test/browser_field_resolve/d/x.js b/node_modules/browserify/test/browser_field_resolve/d/x.js deleted file mode 100644 index fb98b131b..000000000 --- a/node_modules/browserify/test/browser_field_resolve/d/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 222 diff --git a/node_modules/browserify/test/browser_field_resolve/e/main.js b/node_modules/browserify/test/browser_field_resolve/e/main.js deleted file mode 100644 index d2bbb5368..000000000 --- a/node_modules/browserify/test/browser_field_resolve/e/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log(require('./z.js')) diff --git a/node_modules/browserify/test/browser_field_resolve/e/package.json b/node_modules/browserify/test/browser_field_resolve/e/package.json deleted file mode 100644 index 8538725e4..000000000 --- a/node_modules/browserify/test/browser_field_resolve/e/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./z": "./x.js" - } -} diff --git a/node_modules/browserify/test/browser_field_resolve/e/x.js b/node_modules/browserify/test/browser_field_resolve/e/x.js deleted file mode 100644 index 409ecf48a..000000000 --- a/node_modules/browserify/test/browser_field_resolve/e/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 111 diff --git a/node_modules/browserify/test/browser_field_resolve/f/main.js b/node_modules/browserify/test/browser_field_resolve/f/main.js deleted file mode 100644 index 9e1be0024..000000000 --- a/node_modules/browserify/test/browser_field_resolve/f/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log(require('aaa/what.js')) diff --git a/node_modules/browserify/test/browser_field_resolve/f/package.json b/node_modules/browserify/test/browser_field_resolve/f/package.json deleted file mode 100644 index 339004096..000000000 --- a/node_modules/browserify/test/browser_field_resolve/f/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "aaa/what": "./x.js" - } -} diff --git a/node_modules/browserify/test/browser_field_resolve/f/x.js b/node_modules/browserify/test/browser_field_resolve/f/x.js deleted file mode 100644 index 95c041e1a..000000000 --- a/node_modules/browserify/test/browser_field_resolve/f/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 999 diff --git a/node_modules/browserify/test/browser_field_resolve/g/main.js b/node_modules/browserify/test/browser_field_resolve/g/main.js deleted file mode 100644 index 3100f1d9b..000000000 --- a/node_modules/browserify/test/browser_field_resolve/g/main.js +++ /dev/null @@ -1,2 +0,0 @@ -try { var x = require('./x') } catch (err) {} -console.log(x) diff --git a/node_modules/browserify/test/browser_field_resolve/g/package.json b/node_modules/browserify/test/browser_field_resolve/g/package.json deleted file mode 100644 index 3d0142ce6..000000000 --- a/node_modules/browserify/test/browser_field_resolve/g/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./x.js": false - } -} diff --git a/node_modules/browserify/test/browser_field_resolve/g/x.js b/node_modules/browserify/test/browser_field_resolve/g/x.js deleted file mode 100644 index ae629b69b..000000000 --- a/node_modules/browserify/test/browser_field_resolve/g/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1000 diff --git a/node_modules/browserify/test/browser_field_resolve/h/main.js b/node_modules/browserify/test/browser_field_resolve/h/main.js deleted file mode 100644 index 29ad627e9..000000000 --- a/node_modules/browserify/test/browser_field_resolve/h/main.js +++ /dev/null @@ -1,2 +0,0 @@ -try { var x = require('./x.js') } catch (err) {} -console.log(x) diff --git a/node_modules/browserify/test/browser_field_resolve/h/package.json b/node_modules/browserify/test/browser_field_resolve/h/package.json deleted file mode 100644 index d8bf9d12e..000000000 --- a/node_modules/browserify/test/browser_field_resolve/h/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./x": false - } -} diff --git a/node_modules/browserify/test/browser_field_resolve/h/x.js b/node_modules/browserify/test/browser_field_resolve/h/x.js deleted file mode 100644 index ae629b69b..000000000 --- a/node_modules/browserify/test/browser_field_resolve/h/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1000 diff --git a/node_modules/browserify/test/browser_field_resolve/i/browser.js b/node_modules/browserify/test/browser_field_resolve/i/browser.js deleted file mode 100644 index 7651b1ab7..000000000 --- a/node_modules/browserify/test/browser_field_resolve/i/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 5000 diff --git a/node_modules/browserify/test/browser_field_resolve/i/main.js b/node_modules/browserify/test/browser_field_resolve/i/main.js deleted file mode 100644 index 164cd233e..000000000 --- a/node_modules/browserify/test/browser_field_resolve/i/main.js +++ /dev/null @@ -1,2 +0,0 @@ -var x = require('./x.js') -console.log(x) diff --git a/node_modules/browserify/test/browser_field_resolve/i/package.json b/node_modules/browserify/test/browser_field_resolve/i/package.json deleted file mode 100644 index aac08b068..000000000 --- a/node_modules/browserify/test/browser_field_resolve/i/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./x": "./browser" - } -} diff --git a/node_modules/browserify/test/browser_field_resolve/i/x.js b/node_modules/browserify/test/browser_field_resolve/i/x.js deleted file mode 100644 index ae629b69b..000000000 --- a/node_modules/browserify/test/browser_field_resolve/i/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1000 diff --git a/node_modules/browserify/test/browser_field_resolve/j/browser.js b/node_modules/browserify/test/browser_field_resolve/j/browser.js deleted file mode 100644 index 7651b1ab7..000000000 --- a/node_modules/browserify/test/browser_field_resolve/j/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 5000 diff --git a/node_modules/browserify/test/browser_field_resolve/j/main.js b/node_modules/browserify/test/browser_field_resolve/j/main.js deleted file mode 100644 index b9f40553b..000000000 --- a/node_modules/browserify/test/browser_field_resolve/j/main.js +++ /dev/null @@ -1,2 +0,0 @@ -var x = require('./x') -console.log(x) diff --git a/node_modules/browserify/test/browser_field_resolve/j/package.json b/node_modules/browserify/test/browser_field_resolve/j/package.json deleted file mode 100644 index 8f617288f..000000000 --- a/node_modules/browserify/test/browser_field_resolve/j/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./x.js": "./browser.js" - } -} diff --git a/node_modules/browserify/test/browser_field_resolve/j/x.js b/node_modules/browserify/test/browser_field_resolve/j/x.js deleted file mode 100644 index ae629b69b..000000000 --- a/node_modules/browserify/test/browser_field_resolve/j/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1000 diff --git a/node_modules/browserify/test/browser_field_resolve/k/main.js b/node_modules/browserify/test/browser_field_resolve/k/main.js deleted file mode 100644 index 993b834eb..000000000 --- a/node_modules/browserify/test/browser_field_resolve/k/main.js +++ /dev/null @@ -1,2 +0,0 @@ -var zzz = require('x/zzz') -console.log(zzz) diff --git a/node_modules/browserify/test/browser_field_resolve/k/node_modules/x/hey.js b/node_modules/browserify/test/browser_field_resolve/k/node_modules/x/hey.js deleted file mode 100644 index 6202b34c2..000000000 --- a/node_modules/browserify/test/browser_field_resolve/k/node_modules/x/hey.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 3000 diff --git a/node_modules/browserify/test/browser_field_resolve/k/node_modules/x/package.json b/node_modules/browserify/test/browser_field_resolve/k/node_modules/x/package.json deleted file mode 100644 index cf1ec93f4..000000000 --- a/node_modules/browserify/test/browser_field_resolve/k/node_modules/x/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./zzz": "./hey" - } -} diff --git a/node_modules/browserify/test/browser_field_resolve/l/main.js b/node_modules/browserify/test/browser_field_resolve/l/main.js deleted file mode 100644 index 993b834eb..000000000 --- a/node_modules/browserify/test/browser_field_resolve/l/main.js +++ /dev/null @@ -1,2 +0,0 @@ -var zzz = require('x/zzz') -console.log(zzz) diff --git a/node_modules/browserify/test/browser_field_resolve/l/node_modules/x/hey.js b/node_modules/browserify/test/browser_field_resolve/l/node_modules/x/hey.js deleted file mode 100644 index 6202b34c2..000000000 --- a/node_modules/browserify/test/browser_field_resolve/l/node_modules/x/hey.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 3000 diff --git a/node_modules/browserify/test/browser_field_resolve/l/node_modules/x/package.json b/node_modules/browserify/test/browser_field_resolve/l/node_modules/x/package.json deleted file mode 100644 index aa9ac588b..000000000 --- a/node_modules/browserify/test/browser_field_resolve/l/node_modules/x/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "./zzz.js": "./hey" - } -} diff --git a/node_modules/browserify/test/buffer.js b/node_modules/browserify/test/buffer.js deleted file mode 100644 index 7cfdb1c0f..000000000 --- a/node_modules/browserify/test/buffer.js +++ /dev/null @@ -1,144 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; -var vm = require('vm'); - -if (!ArrayBuffer.isView) ArrayBuffer.isView = function () { return false; }; - -test('utf8 buffer to base64', function (t) { - t.plan(1); - var b = browserify(); - b.require('buffer'); - b.bundle(function (err, src) { - if (err) return t.fail(err); - var c = context(); - vm.runInNewContext(src, c); - t.equal( - new c.require('buffer').Buffer("Ձאab", "utf8").toString("base64"), - new Buffer("Ձאab", "utf8").toString("base64") - ); - }); -}); - -test('utf8 buffer to hex', function (t) { - t.plan(1); - var b = browserify(); - b.require('buffer'); - b.bundle(function (err, src) { - var c = context(); - vm.runInNewContext(src, c); - t.equal( - new c.require('buffer').Buffer("Ձאab", "utf8").toString("hex"), - new Buffer("Ձאab", "utf8").toString("hex") - ); - }); -}); - -test('ascii buffer to base64', function (t) { - t.plan(1); - var b = browserify(); - b.require('buffer'); - - b.bundle(function (err, src) { - var c = context(); - vm.runInNewContext(src, c); - t.equal( - new c.require('buffer').Buffer("123456!@#$%^", "ascii").toString("base64"), - new Buffer("123456!@#$%^", "ascii").toString("base64") - ); - }); -}); - -test('ascii buffer to hex', function (t) { - t.plan(1); - var b = browserify(); - b.require('buffer'); - b.bundle(function (err, src) { - var c = context(); - vm.runInNewContext(src, c); - t.equal( - new c.require('buffer').Buffer("123456!@#$%^", "ascii").toString("hex"), - new Buffer("123456!@#$%^", "ascii").toString("hex") - ); - }); -}); - -test('base64 buffer to utf8', function (t) { - t.plan(1); - var b = browserify(); - b.require('buffer'); - b.bundle(function (err, src) { - var c = context(); - vm.runInNewContext(src, c); - t.equal( - new c.require('buffer').Buffer("1YHXkGFi", "base64").toString("utf8"), - new Buffer("1YHXkGFi", "base64").toString("utf8") - ); - }); -}); - -test('hex buffer to utf8', function (t) { - t.plan(1); - var b = browserify(); - b.require('buffer'); - b.bundle(function (err, src) { - var c = context(); - vm.runInNewContext(src, c); - var B = c.require('buffer'); - t.equal( - new B.Buffer("d581d7906162", "hex").toString("utf8"), - new Buffer("d581d7906162", "hex").toString("utf8") - ); - }); -}); - -test('base64 buffer to ascii', function (t) { - t.plan(1); - var b = browserify(); - b.require('buffer'); - b.bundle(function (err, src) { - var c = context(); - vm.runInNewContext(src, c); - t.equal( - new c.require('buffer').Buffer("MTIzNDU2IUAjJCVe", "base64").toString("ascii"), - new Buffer("MTIzNDU2IUAjJCVe", "base64").toString("ascii") - ); - }); -}); - -test('hex buffer to ascii', function (t) { - t.plan(1); - var b = browserify(); - b.require('buffer'); - b.bundle(function (err, src) { - var c = context(); - vm.runInNewContext(src, c); - t.equal( - new c.require('buffer').Buffer("31323334353621402324255e", "hex").toString("ascii"), - new Buffer("31323334353621402324255e", "hex").toString("ascii") - ); - }); -}); - -test('indexing a buffer', function (t) { - t.plan(5); - var b = browserify(); - b.require('buffer'); - b.bundle(function (err, src) { - var c = context(); - vm.runInNewContext(src, c); - var buf = c.require('buffer').Buffer('abc'); - t.equal(buf[0], 97); - t.equal(buf[1], 98); - t.equal(buf[2], 99); - t.equal(buf[3], undefined); - t.equal(buf.toString('utf8'), 'abc'); - }); -}); - -function context () { - return { - ArrayBuffer: ArrayBuffer, - Uint8Array: Uint8Array, - DataView: DataView - }; -} diff --git a/node_modules/browserify/test/bundle-bundle-external.js b/node_modules/browserify/test/bundle-bundle-external.js deleted file mode 100644 index 559e7f1fc..000000000 --- a/node_modules/browserify/test/bundle-bundle-external.js +++ /dev/null @@ -1,31 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; - -var pubdir = __dirname; -var dir = pubdir + '/bundle-bundle-external'; - -var opt = { - debug: true, - basedir: pubdir, - exposeAll: true -}; - -test('bundle bundle external', function (t) { - t.plan(1); - var bundle1 = browserify(opt); - var name = dir + '/foo.js'; - bundle1.require(name, { entry: true, expose: name, basedir: pubdir }); - - var bundle2 = browserify({ - debug: true, - basedir: pubdir, - entries: [ dir + '/baz.js' ] - }); - - // adding and removing this line causes failure // - //bundle2.external(bundle1); - - bundle2.bundle(function(err, src) { - t.ifError(err); - }); -}); diff --git a/node_modules/browserify/test/bundle-bundle-external/bar.js b/node_modules/browserify/test/bundle-bundle-external/bar.js deleted file mode 100644 index 8079379c1..000000000 --- a/node_modules/browserify/test/bundle-bundle-external/bar.js +++ /dev/null @@ -1,2 +0,0 @@ -module.exports = 'bar'; -done(); diff --git a/node_modules/browserify/test/bundle-bundle-external/baz.js b/node_modules/browserify/test/bundle-bundle-external/baz.js deleted file mode 100644 index 1dda5de34..000000000 --- a/node_modules/browserify/test/bundle-bundle-external/baz.js +++ /dev/null @@ -1,3 +0,0 @@ -var foo = require('./foo'); -assert.equal(foo, 'foo'); -done(); diff --git a/node_modules/browserify/test/bundle-bundle-external/foo.js b/node_modules/browserify/test/bundle-bundle-external/foo.js deleted file mode 100644 index 99cf946d2..000000000 --- a/node_modules/browserify/test/bundle-bundle-external/foo.js +++ /dev/null @@ -1,5 +0,0 @@ -var bar = require('./bar'); -assert.equal(bar, 'bar'); - -module.exports = 'foo'; -done(); diff --git a/node_modules/browserify/test/bundle-stream.js b/node_modules/browserify/test/bundle-stream.js deleted file mode 100644 index 4193b3342..000000000 --- a/node_modules/browserify/test/bundle-stream.js +++ /dev/null @@ -1,18 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; - -var isReadable = require('isstream').isReadable; -var isWritable = require('isstream').isWritable; - -test('bundle is readable stream', function (t) { - t.plan(4); - var b = browserify(__dirname + '/entry/main.js'); - b.on('bundle', function(bundle) { - t.ok(isReadable(bundle)); - t.notok(isWritable(bundle)); - }); - - var stream = b.bundle(); - t.ok(isReadable(stream)); - t.notok(isWritable(stream)); -}); diff --git a/node_modules/browserify/test/bundle.js b/node_modules/browserify/test/bundle.js deleted file mode 100644 index 115317a61..000000000 --- a/node_modules/browserify/test/bundle.js +++ /dev/null @@ -1,33 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('bundle', function (t) { - var b = browserify(); - b.require('seq'); - b.bundle(function (err, src) { - t.plan(3); - - t.ifError(err); - t.ok(src.length > 0); - - var c = { - setTimeout : setTimeout, - clearTimeout : clearTimeout, - console : console - }; - vm.runInNewContext(src, c); - - c.require('seq')([1,2,3]) - .parMap_(function (next, x) { - setTimeout(function () { - next.ok(x * 100) - }, 10) - }) - .seq(function (x,y,z) { - t.deepEqual([x,y,z], [100,200,300]); - t.end(); - }) - ; - }); -}); diff --git a/node_modules/browserify/test/bundle_external.js b/node_modules/browserify/test/bundle_external.js deleted file mode 100644 index 05a0ac272..000000000 --- a/node_modules/browserify/test/bundle_external.js +++ /dev/null @@ -1,26 +0,0 @@ -var test = require('tap').test; -var browserify = require('../'); -var vm = require('vm'); - -test('bundle external', function (t) { - t.plan(3); - - var expected = [ - { name: 'beep', value: 111 }, - { name: 't-rex', value: 5 } - ]; - - var b = browserify({ bundleExternal: false }); - b.add(__dirname + '/bundle_external/main.js'); - b.bundle(function (err, src) { - var c = { - t: t, - require: function (name) { - var r = expected.shift(); - t.equal(name, r.name); - return r.value; - } - }; - vm.runInNewContext(src, c); - }); -}); diff --git a/node_modules/browserify/test/bundle_external/boop.js b/node_modules/browserify/test/bundle_external/boop.js deleted file mode 100644 index e785264e0..000000000 --- a/node_modules/browserify/test/bundle_external/boop.js +++ /dev/null @@ -1,4 +0,0 @@ -var robot = require('./robot.js'); -var trex = require('t-rex'); - -module.exports = function (n) { return robot(n) * trex }; diff --git a/node_modules/browserify/test/bundle_external/main.js b/node_modules/browserify/test/bundle_external/main.js deleted file mode 100644 index 88e3f1d75..000000000 --- a/node_modules/browserify/test/bundle_external/main.js +++ /dev/null @@ -1,4 +0,0 @@ -var beep = require('beep'); -var boop = require('./boop.js'); - -t.equal(boop(beep), 560); diff --git a/node_modules/browserify/test/bundle_external/robot.js b/node_modules/browserify/test/bundle_external/robot.js deleted file mode 100644 index 2a569dd9c..000000000 --- a/node_modules/browserify/test/bundle_external/robot.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = function (n) { return n + 1 }; diff --git a/node_modules/browserify/test/bundle_external_global.js b/node_modules/browserify/test/bundle_external_global.js deleted file mode 100644 index ae02b8105..000000000 --- a/node_modules/browserify/test/bundle_external_global.js +++ /dev/null @@ -1,24 +0,0 @@ -var test = require('tap').test; -var browserify = require('../'); -var through = require('through2'); -var vm = require('vm'); - -test('bundle external global', function (t) { - t.plan(1); - - var stream = through(); - stream.push('console.log(process)'); - stream.push(null); - - var b = browserify({ bundleExternal: false }); - b.add(stream); - b.bundle(function (err, src) { - vm.runInNewContext(src, { - console: { log: log }, - process: process - }); - function log (msg) { - t.equal(msg, process); - } - }); -}); diff --git a/node_modules/browserify/test/bundle_sourcemap.js b/node_modules/browserify/test/bundle_sourcemap.js deleted file mode 100644 index 02b8f4323..000000000 --- a/node_modules/browserify/test/bundle_sourcemap.js +++ /dev/null @@ -1,32 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; - -test('bundle in debug mode', function (t) { - t.plan(3); - - var b = browserify({ debug: true }); - b.require('seq'); - b.bundle(function (err, buf) { - var src = buf.toString('utf8'); - var secondtolastLine = src.split('\n').slice(-2); - - t.ok(typeof src === 'string'); - t.ok(src.length > 0); - t.ok(/^\/\/# sourceMappingURL=/.test(secondtolastLine), 'includes sourcemap'); - }); -}); - -test('bundle in non debug mode', function (t) { - t.plan(3); - - var b = browserify(); - b.require('seq'); - b.bundle(function (err, buf) { - var src = buf.toString('utf8'); - var secondtolastLine = src.split('\n').slice(-2); - - t.ok(typeof src === 'string'); - t.ok(src.length > 0); - t.notOk(/^\/\/# sourceMappingURL=/.test(secondtolastLine), 'includes no sourcemap'); - }); -}); diff --git a/node_modules/browserify/test/catch.js b/node_modules/browserify/test/catch.js deleted file mode 100644 index f85b67baf..000000000 --- a/node_modules/browserify/test/catch.js +++ /dev/null @@ -1,22 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; - -test('catch pipeline errors with a callback', function (t) { - t.plan(2); - - var b = browserify(__dirname + '/catch/main.js'); - b.bundle(function (err, src) { - t.ok(err); - t.ok(/no_such_file/.test(err)); - }); -}); - -test('catch pipeline errors with an event', function (t) { - t.plan(2); - - var b = browserify(__dirname + '/catch/main.js').bundle(); - b.on('error', function (err) { - t.ok(err); - t.ok(/no_such_file/.test(err)); - }); -}); diff --git a/node_modules/browserify/test/catch/main.js b/node_modules/browserify/test/catch/main.js deleted file mode 100644 index a522a65cb..000000000 --- a/node_modules/browserify/test/catch/main.js +++ /dev/null @@ -1 +0,0 @@ -require('./no_such_file'); diff --git a/node_modules/browserify/test/circular.js b/node_modules/browserify/test/circular.js deleted file mode 100644 index 92efadee3..000000000 --- a/node_modules/browserify/test/circular.js +++ /dev/null @@ -1,34 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('circular', function (t) { - t.plan(1); - - var b = browserify(__dirname + '/circular/main.js'); - b.bundle(function (err, src) { - vm.runInNewContext(src, { t: t }); - }); -}); - -test('circular expose', function (t) { - t.plan(1); - - var b = browserify(__dirname + '/circular/main.js'); - b.require(__dirname + '/circular/a.js', { expose: './a.js' }); - b.require(__dirname + '/circular/b.js', { expose: './b.js' }); - b.bundle(function (err, src) { - vm.runInNewContext(src, { t: t }); - }); -}); - -test('circular require', function (t) { - t.plan(1); - - var b = browserify(__dirname + '/circular/main.js'); - b.require(__dirname + '/circular/a.js'); - b.require(__dirname + '/circular/b.js'); - b.bundle(function (err, src) { - vm.runInNewContext(src, { t: t }); - }); -}); diff --git a/node_modules/browserify/test/circular/a.js b/node_modules/browserify/test/circular/a.js deleted file mode 100644 index f3adf1da0..000000000 --- a/node_modules/browserify/test/circular/a.js +++ /dev/null @@ -1,3 +0,0 @@ -exports.a = 1; -exports.b = require('./b'); -exports.a = 5; diff --git a/node_modules/browserify/test/circular/b.js b/node_modules/browserify/test/circular/b.js deleted file mode 100644 index f342a8420..000000000 --- a/node_modules/browserify/test/circular/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 2 + require('./a').a diff --git a/node_modules/browserify/test/circular/main.js b/node_modules/browserify/test/circular/main.js deleted file mode 100644 index cbabf9710..000000000 --- a/node_modules/browserify/test/circular/main.js +++ /dev/null @@ -1 +0,0 @@ -t.deepEqual(require('./a.js'), { a: 5, b: 3 }); diff --git a/node_modules/browserify/test/coffee_bin.js b/node_modules/browserify/test/coffee_bin.js deleted file mode 100644 index e50569236..000000000 --- a/node_modules/browserify/test/coffee_bin.js +++ /dev/null @@ -1,36 +0,0 @@ -var test = require('tap').test; -var spawn = require('child_process').spawn; -var path = require('path'); -var vm = require('vm'); - -test('compiling coffee with -c', function (t) { - t.plan(4); - - var cwd = process.cwd(); - process.chdir(__dirname); - - var ps = spawn(process.execPath, [ - path.resolve(__dirname, '../bin/cmd.js'), - '-c', '"' + process.execPath + '" "' + __dirname + '/../node_modules/coffee-script/bin/coffee" -sc', - 'coffee_bin/main.coffee' - ]); - var src = ''; - var err = ''; - ps.stdout.on('data', function (buf) { src += buf }); - ps.stderr.on('data', function (buf) { err += buf }); - - ps.on('exit', function (code) { - t.equal(code, 0); - t.equal(err, ''); - - var msgs = [ 'hello world!', 'from x!' ]; - var c = { - console: { - log: function (msg) { - t.equal(msg, msgs.shift()); - } - } - }; - vm.runInNewContext(src, c); - }); -}); diff --git a/node_modules/browserify/test/coffee_bin/main.coffee b/node_modules/browserify/test/coffee_bin/main.coffee deleted file mode 100644 index e9b9dc923..000000000 --- a/node_modules/browserify/test/coffee_bin/main.coffee +++ /dev/null @@ -1,2 +0,0 @@ -console.log "hello world!" -require './x.coffee' diff --git a/node_modules/browserify/test/coffee_bin/x.coffee b/node_modules/browserify/test/coffee_bin/x.coffee deleted file mode 100644 index 3bbf3ca33..000000000 --- a/node_modules/browserify/test/coffee_bin/x.coffee +++ /dev/null @@ -1 +0,0 @@ -console.log "from x!" diff --git a/node_modules/browserify/test/coffeeify.js b/node_modules/browserify/test/coffeeify.js deleted file mode 100644 index 176008c00..000000000 --- a/node_modules/browserify/test/coffeeify.js +++ /dev/null @@ -1,19 +0,0 @@ -var test = require('tap').test; -var browserify = require('../'); -var vm = require('vm'); - -test('coffeeify with an implicit global', function (t) { - t.plan(1); - - var b = browserify(__dirname + '/coffeeify/main.coffee'); - b.transform('coffeeify'); - b.bundle(function (err, src) { - if (err) t.fail(err); - vm.runInNewContext(src, { - console: { log: log }, - setTimeout: setTimeout, - clearTimeout: clearTimeout - }); - function log (msg) { t.equal(msg, 'eyo') } - }); -}); diff --git a/node_modules/browserify/test/coffeeify/main.coffee b/node_modules/browserify/test/coffeeify/main.coffee deleted file mode 100644 index 3e6a9e823..000000000 --- a/node_modules/browserify/test/coffeeify/main.coffee +++ /dev/null @@ -1,2 +0,0 @@ -process.nextTick -> - console.log 'eyo' diff --git a/node_modules/browserify/test/comment.js b/node_modules/browserify/test/comment.js deleted file mode 100644 index f22278f4e..000000000 --- a/node_modules/browserify/test/comment.js +++ /dev/null @@ -1,16 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('trailing comment', function (t) { - t.plan(1); - var b = browserify(__dirname + '/comment/main.js'); - b.bundle(function (err, src) { - var c = { - ex : function (obj) { - t.same(obj, 1234); - } - }; - vm.runInNewContext(src, c); - }); -}); diff --git a/node_modules/browserify/test/comment/main.js b/node_modules/browserify/test/comment/main.js deleted file mode 100644 index 2eca52644..000000000 --- a/node_modules/browserify/test/comment/main.js +++ /dev/null @@ -1,2 +0,0 @@ -ex(1234) -// test \ No newline at end of file diff --git a/node_modules/browserify/test/constants.js b/node_modules/browserify/test/constants.js deleted file mode 100644 index 0efbc6d2d..000000000 --- a/node_modules/browserify/test/constants.js +++ /dev/null @@ -1,18 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; -var vm = require('vm'); -var through = require('through2'); - -test('constants', function (t) { - t.plan(2); - var stream = through(); - stream.push('console.log(require("constants").ENOENT)'); - stream.push(null); - var b = browserify(stream); - - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src, { console: { log: log } }); - function log (msg) { t.equal(msg, 2) } - }); -}); diff --git a/node_modules/browserify/test/crypto.js b/node_modules/browserify/test/crypto.js deleted file mode 100644 index 7edb25594..000000000 --- a/node_modules/browserify/test/crypto.js +++ /dev/null @@ -1,41 +0,0 @@ -var test = require('tap').test; -var spawn = require('child_process').spawn; -var path = require('path'); -var fs = require('fs'); -var vm = require('vm'); -var concat = require('concat-stream'); - -var temp = require('temp'); -temp.track(); -var tmpdir = temp.mkdirSync({prefix: 'browserify-test'}); - -fs.writeFileSync(tmpdir + '/main.js', 'beep(require("crypto"))\n'); - -if (!ArrayBuffer.isView) ArrayBuffer.isView = function () { return false; }; - -test('*-browserify libs from node_modules/', function (t) { - t.plan(2); - - var bin = __dirname + '/../bin/cmd.js'; - var ps = spawn(process.execPath, [ bin, 'main.js' ], { cwd : tmpdir }); - - ps.stderr.pipe(process.stderr, { end : false }); - - ps.on('exit', function (code) { - t.equal(code, 0); - }); - - ps.stdout.pipe(concat(function (src) { - var c = { - Int32Array: Int32Array, - ArrayBuffer: ArrayBuffer, - Uint8Array: Uint8Array, - DataView: DataView, - beep : function (c) { - t.equal(typeof c.createHash, 'function'); - }, - require: function () {} - }; - vm.runInNewContext(src.toString('utf8'), c); - })); -}); diff --git a/node_modules/browserify/test/crypto_ig.js b/node_modules/browserify/test/crypto_ig.js deleted file mode 100644 index c60b5bf60..000000000 --- a/node_modules/browserify/test/crypto_ig.js +++ /dev/null @@ -1,41 +0,0 @@ -var test = require('tap').test; -var spawn = require('child_process').spawn; -var path = require('path'); -var fs = require('fs'); -var vm = require('vm'); -var concat = require('concat-stream'); - -var temp = require('temp'); -temp.track(); -var tmpdir = temp.mkdirSync({prefix: 'browserify-test'}); - -fs.writeFileSync(tmpdir + '/main.js', 'beep(require("crypto"))\n'); - -if (!ArrayBuffer.isView) ArrayBuffer.isView = function () { return false; }; - -test('crypto --insertGlobals', function (t) { - t.plan(2); - - var bin = __dirname + '/../bin/cmd.js'; - var ps = spawn(process.execPath, [ bin, 'main.js', '--ig' ], { cwd : tmpdir }); - - ps.stderr.pipe(process.stderr, { end : false }); - - ps.on('exit', function (code) { - t.equal(code, 0); - }); - - ps.stdout.pipe(concat(function (src) { - var c = { - Int32Array: Int32Array, - ArrayBuffer: ArrayBuffer, - Uint8Array: Uint8Array, - DataView: DataView, - beep : function (c) { - t.equal(typeof c.createHash, 'function'); - }, - require: function () {} - }; - vm.runInNewContext(src.toString('utf8'), c); - })); -}); diff --git a/node_modules/browserify/test/cycle.js b/node_modules/browserify/test/cycle.js deleted file mode 100644 index 6cfd3c259..000000000 --- a/node_modules/browserify/test/cycle.js +++ /dev/null @@ -1,13 +0,0 @@ -var test = require('tap').test; -var browserify = require('../'); -var vm = require('vm'); - -test('cycle', function (t) { - t.plan(2); - var b = browserify(__dirname + '/cycle/entry.js'); - b.bundle(function (err, body) { - t.ifError(err); - vm.runInNewContext(body); - t.ok(true); - }); -}); diff --git a/node_modules/browserify/test/cycle/README.md b/node_modules/browserify/test/cycle/README.md deleted file mode 100644 index d41c39739..000000000 --- a/node_modules/browserify/test/cycle/README.md +++ /dev/null @@ -1,16 +0,0 @@ -browserify-bug-713 -================== - -substack/node-browserify#713 breaks resolving an identical module multiple time from different locations when the module has a circular require. - -## Reproduce - -Module requires two copies of the same module (identical apart from path) and the sub module has a circular require. - -## Example - -This is the case with [readable-stream](https://github.com/isaacs/readable-stream). If two different modules depend on the same version readable-stream (and no npm dedupe), then both of those modules are required in the same project, browserify throws a `RangeError: Maximum call stack size exceeded` - -See https://github.com/isaacs/readable-stream/blob/master/lib/_stream_writable.js#L134 and https://github.com/isaacs/readable-stream/blob/master/lib/_stream_duplex.js#L44 - -This issue is most likely related: substack/node-browserify#735 diff --git a/node_modules/browserify/test/cycle/entry.js b/node_modules/browserify/test/cycle/entry.js deleted file mode 100644 index 6a8dd8ebd..000000000 --- a/node_modules/browserify/test/cycle/entry.js +++ /dev/null @@ -1,15 +0,0 @@ -// RE: substack/node-browserify#713 - -// https://github.com/substack/node-browserify/pull/713 breaks resolving -// an identical module multiple time from different locations when the -// module has a circular require. - -// other than path, mod1 and mod2 are identical - -require('./mod1/a') -require('./mod2/a') - -// browserify entry.js - -// works in 3.37.2 -// >= 3.38 throws RangeError: Maximum call stack size exceeded \ No newline at end of file diff --git a/node_modules/browserify/test/cycle/mod1/a.js b/node_modules/browserify/test/cycle/mod1/a.js deleted file mode 100644 index c40d2fed2..000000000 --- a/node_modules/browserify/test/cycle/mod1/a.js +++ /dev/null @@ -1 +0,0 @@ -require('./b') \ No newline at end of file diff --git a/node_modules/browserify/test/cycle/mod1/b.js b/node_modules/browserify/test/cycle/mod1/b.js deleted file mode 100644 index 54c7b9c11..000000000 --- a/node_modules/browserify/test/cycle/mod1/b.js +++ /dev/null @@ -1 +0,0 @@ -require('./a') \ No newline at end of file diff --git a/node_modules/browserify/test/cycle/mod2/a.js b/node_modules/browserify/test/cycle/mod2/a.js deleted file mode 100644 index c40d2fed2..000000000 --- a/node_modules/browserify/test/cycle/mod2/a.js +++ /dev/null @@ -1 +0,0 @@ -require('./b') \ No newline at end of file diff --git a/node_modules/browserify/test/cycle/mod2/b.js b/node_modules/browserify/test/cycle/mod2/b.js deleted file mode 100644 index 54c7b9c11..000000000 --- a/node_modules/browserify/test/cycle/mod2/b.js +++ /dev/null @@ -1 +0,0 @@ -require('./a') \ No newline at end of file diff --git a/node_modules/browserify/test/debug_standalone.js b/node_modules/browserify/test/debug_standalone.js deleted file mode 100644 index 207090c3a..000000000 --- a/node_modules/browserify/test/debug_standalone.js +++ /dev/null @@ -1,64 +0,0 @@ -var test = require('tap').test; -var browserify = require('../'); -var through = require('through2'); -var vm = require('vm'); - -test('ordinary debug', function (t) { - t.plan(1); - - var stream = through(); - stream.push('console.log(1+2)'); - stream.push(null); - - var b = browserify({ debug: true }); - b.add(stream); - b.bundle(function (err, buf) { - var src = buf.toString('utf8'); - var last = src.split('\n').slice(-2)[0]; - t.ok( - /\/\/# sourceMappingURL=data:application\/json;charset=utf-8;base64,[\w+\/=]+$/ - .test(last) - ); - }); -}); - -test('debug standalone', function (t) { - t.plan(1); - - var stream = through(); - stream.push('console.log(1+2)'); - stream.push(null); - - var b = browserify({ debug: true, standalone: 'xyz' }); - b.add(stream); - b.bundle(function (err, buf) { - var src = buf.toString('utf8'); - var last = src.split('\n').slice(-2)[0]; - t.ok( - /\/\/# sourceMappingURL=data:application\/json;charset=utf-8;base64,[\w+\/=]+$/ - .test(last) - ); - }); -}); - -test('debug standalone exposed', function (t) { - t.plan(2); - - var stream = through(); - stream.push('console.log(1+2)'); - stream.push(null); - - var b = browserify({ debug: true, standalone: 'xyz' }); - b.require(__dirname + '/debug_standalone/x.js', { expose: 'xxx' }); - b.bundle(function (err, buf) { - var src = buf.toString('utf8'); - var last = src.split('\n').slice(-2)[0]; - t.ok( - /\/\/# sourceMappingURL=data:application\/json;charset=utf-8;base64,[\w+\/=]+$/ - .test(last) - ); - var c = { window: {} }; - vm.runInNewContext(src, c); - t.equal(c.window.xyz, 555); - }); -}); diff --git a/node_modules/browserify/test/debug_standalone/x.js b/node_modules/browserify/test/debug_standalone/x.js deleted file mode 100644 index 3e842e734..000000000 --- a/node_modules/browserify/test/debug_standalone/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 555 diff --git a/node_modules/browserify/test/dedupe-deps.js b/node_modules/browserify/test/dedupe-deps.js deleted file mode 100644 index ebb6dedc2..000000000 --- a/node_modules/browserify/test/dedupe-deps.js +++ /dev/null @@ -1,59 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; - -test('identical content gets deduped and the row gets an implicit dep on the original source', function (t) { - t.plan(1) - - var rows = []; - browserify() - .on('dep', [].push.bind(rows)) - .require(require.resolve('./dup'), { entry: true }) - .bundle(check); - - function check(err, src) { - if (err) return t.fail(err); - var deduped = rows.filter(function (x) { return x.dedupeIndex }); - var d = deduped[0]; - - t.deepEqual(d.deps, { 'dup': d.dedupeIndex }, "adds implicit dep"); - } -}) - -test('identical content gets deduped with fullPaths', function (t) { - t.plan(1) - - var rows = []; - browserify({fullPaths: true}) - .on('dep', [].push.bind(rows)) - .require(require.resolve('./dup'), { entry: true }) - .bundle(check); - - function check(err, src) { - if (err) return t.fail(err); - var deduped = rows.filter(function (x) { return x.dedupe }); - var d = deduped[0]; - - t.deepEqual( - d.source, - 'arguments[4]['+ JSON.stringify(d.dedupe) + '][0]' - + '.apply(exports,arguments)', - "dedupes content" - ); - } -}) - -test('identical content does not get deduped with dedupe option false', function (t) { - t.plan(1) - - var rows = []; - browserify({fullPaths: true, dedupe: false}) - .on('dep', [].push.bind(rows)) - .require(require.resolve('./dup'), { entry: true }) - .bundle(check); - - function check(err, src) { - if (err) return t.fail(err); - var deduped = rows.filter(function (x) { return x.dedupe }); - t.equal(deduped.length, 0, 'does not dedupe'); - } -}) diff --git a/node_modules/browserify/test/dedupe-nomap.js b/node_modules/browserify/test/dedupe-nomap.js deleted file mode 100644 index 906fadc0e..000000000 --- a/node_modules/browserify/test/dedupe-nomap.js +++ /dev/null @@ -1,64 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; - -test('identical content gets deduped and the row gets a "nomap" flag set when sourcemaps are turned on', function (t) { - t.plan(4) - - var rows = []; - browserify({ debug: true }) - .on('dep', [].push.bind(rows)) - .require(require.resolve('./dup'), { entry: true }) - .bundle(check); - - function check(err, src) { - if (err) return t.fail(err); - var nomappeds = rows.filter(function (x) { return x.nomap }); - var nm = nomappeds[0]; - - t.equal(rows.length, 3, 'packs 3 rows'); - t.equal(nomappeds.length, 1, 'one of has nomapped flag set'); - t.equal( - rows.filter(function (x) { - return x.id == nm.dedupeIndex - }).length, - 1, - '2 rows with the same hash as the duplicate exist' - ); - t.similar( - nm.source, - /arguments\[4\]\[.+\]\[0\]\.apply\(exports,arguments\)$/, - 'redirects duplicate to original via require call' - ); - } -}) - -test('identical content gets deduped and the row gets a "nomap" flag set when sourcemaps are turned off', function (t) { - t.plan(4) - - var rows = []; - browserify({ debug: false }) - .on('dep', [].push.bind(rows)) - .require(require.resolve('./dup'), { entry: true }) - .bundle(check); - - function check(err, src) { - if (err) return t.fail(err); - var nomappeds = rows.filter(function (x) { return x.nomap }); - var nm = nomappeds[0]; - - t.equal(rows.length, 3, 'packs 3 rows'); - t.equal(nomappeds.length, 1, 'one of has nomapped flag set'); - t.equal( - rows.filter(function (x) { - return x.id == nm.dedupeIndex - }).length, - 1, - '2 rows with the same hash as the duplicate exist' - ); - t.similar( - nm.source, - /arguments\[4\]\[.+\]\[0\]\.apply\(exports,arguments\)$/, - 'redirects duplicate to original via require call' - ); - } -}) diff --git a/node_modules/browserify/test/delay.js b/node_modules/browserify/test/delay.js deleted file mode 100644 index 63c1d8785..000000000 --- a/node_modules/browserify/test/delay.js +++ /dev/null @@ -1,25 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var path = require('path'); -var test = require('tap').test; -var through = require('through2'); - -test('delay for pipelines', function (t) { - t.plan(3); - - var b = browserify(__dirname + '/delay/main.js'); - b.pipeline.get('record').push(through.obj(function (row, enc, next) { - if (row.file) { - t.equal(row.file, path.join(__dirname, 'delay/main.js')); - row.file = path.join(__dirname, 'delay/diverted.js'); - } - this.push(row); - next(); - })); - - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src, { console: { log: log } }); - function log (msg) { t.equal(msg, 900) } - }); -}); diff --git a/node_modules/browserify/test/delay/diverted.js b/node_modules/browserify/test/delay/diverted.js deleted file mode 100644 index 3037cd95e..000000000 --- a/node_modules/browserify/test/delay/diverted.js +++ /dev/null @@ -1 +0,0 @@ -console.log(900) diff --git a/node_modules/browserify/test/delay/main.js b/node_modules/browserify/test/delay/main.js deleted file mode 100644 index 67eaa257b..000000000 --- a/node_modules/browserify/test/delay/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log(500) diff --git a/node_modules/browserify/test/dep.js b/node_modules/browserify/test/dep.js deleted file mode 100644 index 13ee026e4..000000000 --- a/node_modules/browserify/test/dep.js +++ /dev/null @@ -1,25 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('dependency events', function (t) { - t.plan(4); - var b = browserify(__dirname + '/entry/main.js'); - var deps = []; - b.on('dep', function (row) { - deps.push({ id: row.id, deps: row.deps }); - t.equal(typeof row.source, 'string'); - }); - - b.bundle(function (err, src) { - t.deepEqual(deps.sort(cmp), [ - { id: 1, deps: { './one': 2, './two': 3 } }, - { id: 2, deps: {} }, - { id: 3, deps: {} } - ]); - }); - - function cmp (a, b) { - return a.id < b.id ? -1 : 1; - } -}); diff --git a/node_modules/browserify/test/dollar.js b/node_modules/browserify/test/dollar.js deleted file mode 100644 index 872cee535..000000000 --- a/node_modules/browserify/test/dollar.js +++ /dev/null @@ -1,17 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('dollar', function (t) { - t.plan(2); - var b = browserify(); - b.require(__dirname + '/dollar/dollar/index.js', { expose: 'dollar' }); - b.bundle(function (err, src) { - t.ok(src.length > 0); - - var c = {}; - vm.runInNewContext(src, c); - var res = vm.runInNewContext('require("dollar")(100)', c); - t.equal(res, 10000); - }); -}); diff --git a/node_modules/browserify/test/dollar/dollar/index.js b/node_modules/browserify/test/dollar/dollar/index.js deleted file mode 100644 index a6012aa6b..000000000 --- a/node_modules/browserify/test/dollar/dollar/index.js +++ /dev/null @@ -1,7 +0,0 @@ -// foo $ bar $ baz - -var $ = function (x) { - return x * 100; -}; - -module.exports = $; diff --git a/node_modules/browserify/test/double_buffer.js b/node_modules/browserify/test/double_buffer.js deleted file mode 100644 index dfda808f9..000000000 --- a/node_modules/browserify/test/double_buffer.js +++ /dev/null @@ -1,16 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; -var vm = require('vm'); - -if (!ArrayBuffer.isView) ArrayBuffer.isView = function () { return false; }; - -test('double buffer', function (t) { - t.plan(1); - - var b = browserify(__dirname + '/double_buffer/main.js'); - b.require('buffer'); - b.bundle(function (err, src) { - if (err) return t.fail(err); - vm.runInNewContext(src, { t: t, Uint8Array: Uint8Array }); - }); -}); diff --git a/node_modules/browserify/test/double_buffer/explicit.js b/node_modules/browserify/test/double_buffer/explicit.js deleted file mode 100644 index fa76b1f45..000000000 --- a/node_modules/browserify/test/double_buffer/explicit.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('buffer').Buffer diff --git a/node_modules/browserify/test/double_buffer/implicit.js b/node_modules/browserify/test/double_buffer/implicit.js deleted file mode 100644 index 70c9e753b..000000000 --- a/node_modules/browserify/test/double_buffer/implicit.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = Buffer diff --git a/node_modules/browserify/test/double_buffer/main.js b/node_modules/browserify/test/double_buffer/main.js deleted file mode 100644 index bf124fd81..000000000 --- a/node_modules/browserify/test/double_buffer/main.js +++ /dev/null @@ -1,4 +0,0 @@ -var implicit = require('./implicit.js'); -var explicit = require('./explicit.js'); - -t.equal(implicit, explicit); diff --git a/node_modules/browserify/test/double_bundle.js b/node_modules/browserify/test/double_bundle.js deleted file mode 100644 index d5b9a1b41..000000000 --- a/node_modules/browserify/test/double_bundle.js +++ /dev/null @@ -1,24 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('double bundle', function (t) { - t.plan(5); - - var b = browserify(__dirname + '/entry/main.js'); - b.bundle(function (err, src0) { - t.ifError(err); - var c = { - done : function (one, two) { - t.equal(one, 1); - t.equal(two, 2); - } - }; - vm.runInNewContext(src0, c); - - b.bundle(function (err, src1) { - t.ifError(err); - t.equal(src1.toString('utf8'), src0.toString('utf8')); - }); - }); -}); diff --git a/node_modules/browserify/test/double_bundle_error.js b/node_modules/browserify/test/double_bundle_error.js deleted file mode 100644 index 02ff015e7..000000000 --- a/node_modules/browserify/test/double_bundle_error.js +++ /dev/null @@ -1,17 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('double bundle error', function (t) { - t.plan(2); - - var b = browserify(__dirname + '/double_bundle_error/main.js'); - var x = b.bundle(); - x.on('error', function (err) { - t.ok(err); - var y = b.bundle(); - y.on('error', function (err) { - t.ok(err); - }); - }); -}); diff --git a/node_modules/browserify/test/double_bundle_error/main.js b/node_modules/browserify/test/double_bundle_error/main.js deleted file mode 100644 index 89bb8a036..000000000 --- a/node_modules/browserify/test/double_bundle_error/main.js +++ /dev/null @@ -1 +0,0 @@ -done(require('./one'), require('./two')); \ No newline at end of file diff --git a/node_modules/browserify/test/double_bundle_error/needs_three.js b/node_modules/browserify/test/double_bundle_error/needs_three.js deleted file mode 100644 index 9def415e6..000000000 --- a/node_modules/browserify/test/double_bundle_error/needs_three.js +++ /dev/null @@ -1 +0,0 @@ -require("three"); diff --git a/node_modules/browserify/test/double_bundle_error/one.js b/node_modules/browserify/test/double_bundle_error/one.js deleted file mode 100644 index bd816eaba..000000000 --- a/node_modules/browserify/test/double_bundle_error/one.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/node_modules/browserify/test/double_bundle_error/package.json b/node_modules/browserify/test/double_bundle_error/package.json deleted file mode 100644 index ad2f40384..000000000 --- a/node_modules/browserify/test/double_bundle_error/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "three": "./three.js" - } -} diff --git a/node_modules/browserify/test/double_bundle_error/three.js b/node_modules/browserify/test/double_bundle_error/three.js deleted file mode 100644 index b15da2728..000000000 --- a/node_modules/browserify/test/double_bundle_error/three.js +++ /dev/null @@ -1,3 +0,0 @@ -require('./nosuchfile.js'); - -module.exports = 3; diff --git a/node_modules/browserify/test/double_bundle_error/two.js b/node_modules/browserify/test/double_bundle_error/two.js deleted file mode 100644 index 72461a5d3..000000000 --- a/node_modules/browserify/test/double_bundle_error/two.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./three.js') - 1; diff --git a/node_modules/browserify/test/double_bundle_json.js b/node_modules/browserify/test/double_bundle_json.js deleted file mode 100644 index ac72709b7..000000000 --- a/node_modules/browserify/test/double_bundle_json.js +++ /dev/null @@ -1,37 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; -var through = require('through2'); -var xtend = require('xtend'); - -test('double bundle json', function (t) { - t.plan(6); - var expected0 = [ 'a=500', 'b=500' ]; - var expected1 = [ 'a=500', 'b=500' ]; - - function log0 (msg) { t.equal(msg, expected0.shift()) } - function log1 (msg) { t.equal(msg, expected1.shift()) } - - var cache = {}; - var b = browserify(__dirname + '/double_bundle_json/index.js', { - cache: cache - }); - b.pipeline.get('deps').push(through.obj(function(row, enc, next) { - cache[row.file] = { - source: row.source, - deps: xtend(row.deps) - }; - this.push(row); - next(); - })); - b.bundle(function (err, src0) { - t.ifError(err); - vm.runInNewContext(src0, { console: { log: log0 } }); - delete cache[__dirname + '/double_bundle_json/index.js']; - - b.bundle(function (err, src1) { - t.ifError(err); - vm.runInNewContext(src1, { console: { log: log1 } }); - }); - }); -}); diff --git a/node_modules/browserify/test/double_bundle_json/a.json b/node_modules/browserify/test/double_bundle_json/a.json deleted file mode 100644 index bf0cf63b8..000000000 --- a/node_modules/browserify/test/double_bundle_json/a.json +++ /dev/null @@ -1 +0,0 @@ -{"x":500} diff --git a/node_modules/browserify/test/double_bundle_json/b.json b/node_modules/browserify/test/double_bundle_json/b.json deleted file mode 100644 index bf0cf63b8..000000000 --- a/node_modules/browserify/test/double_bundle_json/b.json +++ /dev/null @@ -1 +0,0 @@ -{"x":500} diff --git a/node_modules/browserify/test/double_bundle_json/index.js b/node_modules/browserify/test/double_bundle_json/index.js deleted file mode 100644 index fd8f6820d..000000000 --- a/node_modules/browserify/test/double_bundle_json/index.js +++ /dev/null @@ -1,5 +0,0 @@ -var a = require('./a.json'); -var b = require('./b.json'); - -console.log('a=' + a.x); -console.log('b=' + b.x); diff --git a/node_modules/browserify/test/double_bundle_parallel.js b/node_modules/browserify/test/double_bundle_parallel.js deleted file mode 100644 index ffeed20ad..000000000 --- a/node_modules/browserify/test/double_bundle_parallel.js +++ /dev/null @@ -1,33 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('double bundle parallel', function (t) { - t.plan(7); - - var sources = []; - var b = browserify(__dirname + '/entry/main.js'); - - var pending = 2; - b.bundle(check(0)); - b.bundle(check(1)); - - function check (index) { - return function (err, src) { - t.ifError(err); - var c = { - done : function (one, two) { - t.equal(one, 1); - t.equal(two, 2); - } - }; - vm.runInNewContext(src, c); - sources[index] = src.toString('utf8'); - if (--pending === 0) done(); - }; - } - - function done () { - t.equal(sources[0], sources[1]); - } -}); diff --git a/node_modules/browserify/test/double_bundle_parallel_cache.js b/node_modules/browserify/test/double_bundle_parallel_cache.js deleted file mode 100644 index 521eda4dc..000000000 --- a/node_modules/browserify/test/double_bundle_parallel_cache.js +++ /dev/null @@ -1,35 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('double bundle parallel cached', function (t) { - t.plan(7); - - var sources = []; - var b = browserify(__dirname + '/entry/main.js', { - cache: {} - }); - - var pending = 2; - b.bundle(check(0)); - b.bundle(check(1)); - - function check (index) { - return function (err, src) { - t.ifError(err); - var c = { - done : function (one, two) { - t.equal(one, 1); - t.equal(two, 2); - } - }; - vm.runInNewContext(src, c); - sources[index] = src.toString('utf8'); - if (--pending === 0) done(); - }; - } - - function done () { - t.equal(sources[0], sources[1]); - } -}); diff --git a/node_modules/browserify/test/dup/foo-dup.js b/node_modules/browserify/test/dup/foo-dup.js deleted file mode 100644 index 8fadf8895..000000000 --- a/node_modules/browserify/test/dup/foo-dup.js +++ /dev/null @@ -1,4 +0,0 @@ -// something on first line -module.exports = function () { - console.log('I like to duplicate myself'); -}; diff --git a/node_modules/browserify/test/dup/foo.js b/node_modules/browserify/test/dup/foo.js deleted file mode 100644 index 8fadf8895..000000000 --- a/node_modules/browserify/test/dup/foo.js +++ /dev/null @@ -1,4 +0,0 @@ -// something on first line -module.exports = function () { - console.log('I like to duplicate myself'); -}; diff --git a/node_modules/browserify/test/dup/index.js b/node_modules/browserify/test/dup/index.js deleted file mode 100644 index ea4428877..000000000 --- a/node_modules/browserify/test/dup/index.js +++ /dev/null @@ -1,5 +0,0 @@ -var foo = require('./foo'); -var foodup = require('./foo-dup'); - -foo(); -foodup(); diff --git a/node_modules/browserify/test/entry.js b/node_modules/browserify/test/entry.js deleted file mode 100644 index 23a2ee254..000000000 --- a/node_modules/browserify/test/entry.js +++ /dev/null @@ -1,43 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var path = require('path'); -var test = require('tap').test; - -test('entry', function (t) { - t.plan(3); - - var b = browserify(__dirname + '/entry/main.js'); - b.on('dep', function(row) { - if (row.entry) t.equal(row.file, path.join(__dirname, 'entry/main.js')); - }); - b.bundle(function (err, src) { - var c = { - done : function (one, two) { - t.equal(one, 1); - t.equal(two, 2); - t.end(); - } - }; - vm.runInNewContext(src, c); - }); -}); - -test('entry via add', function (t) { - t.plan(3); - - var b = browserify(); - b.add(__dirname + '/entry/main.js'); - b.on('dep', function(row) { - if (row.entry) t.equal(row.file, path.join(__dirname, 'entry/main.js')); - }); - b.bundle(function (err, src) { - var c = { - done : function (one, two) { - t.equal(one, 1); - t.equal(two, 2); - t.end(); - } - }; - vm.runInNewContext(src, c); - }); -}); diff --git a/node_modules/browserify/test/entry/main.js b/node_modules/browserify/test/entry/main.js deleted file mode 100644 index 89bb8a036..000000000 --- a/node_modules/browserify/test/entry/main.js +++ /dev/null @@ -1 +0,0 @@ -done(require('./one'), require('./two')); \ No newline at end of file diff --git a/node_modules/browserify/test/entry/needs_three.js b/node_modules/browserify/test/entry/needs_three.js deleted file mode 100644 index 9def415e6..000000000 --- a/node_modules/browserify/test/entry/needs_three.js +++ /dev/null @@ -1 +0,0 @@ -require("three"); diff --git a/node_modules/browserify/test/entry/one.js b/node_modules/browserify/test/entry/one.js deleted file mode 100644 index bd816eaba..000000000 --- a/node_modules/browserify/test/entry/one.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/node_modules/browserify/test/entry/package.json b/node_modules/browserify/test/entry/package.json deleted file mode 100644 index ad2f40384..000000000 --- a/node_modules/browserify/test/entry/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "three": "./three.js" - } -} diff --git a/node_modules/browserify/test/entry/three.js b/node_modules/browserify/test/entry/three.js deleted file mode 100644 index 690aad34a..000000000 --- a/node_modules/browserify/test/entry/three.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 3; diff --git a/node_modules/browserify/test/entry/two.js b/node_modules/browserify/test/entry/two.js deleted file mode 100644 index 4bbffde10..000000000 --- a/node_modules/browserify/test/entry/two.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 2; diff --git a/node_modules/browserify/test/entry_exec.js b/node_modules/browserify/test/entry_exec.js deleted file mode 100644 index c70281e55..000000000 --- a/node_modules/browserify/test/entry_exec.js +++ /dev/null @@ -1,15 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('only execute entry files', function (t) { - t.plan(1); - - var b = browserify(); - b.add(__dirname + '/entry_exec/main.js'); - b.require(__dirname + '/entry_exec/fail.js'); - b.bundle(function (err, src) { - var c = { t: t }; - vm.runInNewContext(src, c); - }); -}); diff --git a/node_modules/browserify/test/entry_exec/fail.js b/node_modules/browserify/test/entry_exec/fail.js deleted file mode 100644 index 8da5557b6..000000000 --- a/node_modules/browserify/test/entry_exec/fail.js +++ /dev/null @@ -1 +0,0 @@ -t.fail('only entry files should get executed right away'); diff --git a/node_modules/browserify/test/entry_exec/main.js b/node_modules/browserify/test/entry_exec/main.js deleted file mode 100644 index 98331f475..000000000 --- a/node_modules/browserify/test/entry_exec/main.js +++ /dev/null @@ -1 +0,0 @@ -t.ok(true); diff --git a/node_modules/browserify/test/entry_expose.js b/node_modules/browserify/test/entry_expose.js deleted file mode 100644 index 381bdc5f5..000000000 --- a/node_modules/browserify/test/entry_expose.js +++ /dev/null @@ -1,18 +0,0 @@ -var test = require('tap').test; -var browserify = require('../'); -var vm = require('vm'); - -test('entry expose', function (t) { - t.plan(3) - - var b = browserify(); - b.add(__dirname + '/entry_expose/main.js'); - b.require(__dirname + '/entry_expose/main.js', { expose: 'x' }); - b.bundle(function (err, src) { - t.ifError(err); - var c = { console: { log: log } }; - function log (msg) { t.equal(msg, 'wow') } - vm.runInNewContext(src, c); - t.equal(c.require('x'), 555); - }) -}); diff --git a/node_modules/browserify/test/entry_expose/main.js b/node_modules/browserify/test/entry_expose/main.js deleted file mode 100644 index bf2b2d6fe..000000000 --- a/node_modules/browserify/test/entry_expose/main.js +++ /dev/null @@ -1,2 +0,0 @@ -console.log('wow'); -module.exports = 555; diff --git a/node_modules/browserify/test/entry_relative.js b/node_modules/browserify/test/entry_relative.js deleted file mode 100644 index 178a8ac1b..000000000 --- a/node_modules/browserify/test/entry_relative.js +++ /dev/null @@ -1,45 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var path = require('path'); -var test = require('tap').test; - -test('entry - relative path', function (t) { - process.chdir(__dirname); - - t.plan(3); - - var b = browserify('entry/main.js'); - b.on('dep', function(row) { - if (row.entry) t.equal(row.file, path.join(__dirname, 'entry/main.js')); - }); - b.bundle(function (err, src) { - var c = { - done : function (one, two) { - t.equal(one, 1); - t.equal(two, 2); - t.end(); - } - }; - vm.runInNewContext(src, c); - }); -}); - -test('entry - relative path via add', function (t) { - t.plan(3); - - var b = browserify({basedir: __dirname}); - b.add('entry/main.js'); - b.on('dep', function(row) { - if (row.entry) t.equal(row.file, path.join(__dirname, 'entry/main.js')); - }); - b.bundle(function (err, src) { - var c = { - done : function (one, two) { - t.equal(one, 1); - t.equal(two, 2); - t.end(); - } - }; - vm.runInNewContext(src, c); - }); -}); diff --git a/node_modules/browserify/test/error_code.js b/node_modules/browserify/test/error_code.js deleted file mode 100644 index 5d0b2b1d7..000000000 --- a/node_modules/browserify/test/error_code.js +++ /dev/null @@ -1,28 +0,0 @@ -var test = require('tap').test; -var spawn = require('child_process').spawn; -var path = require('path'); -var semver = require('semver'); - -// TODO this should be fixable I guess -var knownFailure = process.platform === 'win32' && semver.satisfies(process.version, 'v0.10.x'); - -test('error code', { skip: knownFailure }, function (t) { - t.plan(2); - - var cwd = process.cwd(); - process.chdir(__dirname); - - var ps = spawn(process.execPath, [ - path.resolve(__dirname, '../bin/cmd.js'), - path.resolve(__dirname, 'error_code/src.js') - ]); - var err = ''; - ps.stderr.on('data', function (buf) { err += buf }); - ps.stderr.on('end', function () { - t.ok(/^(Syntax|Parse)Error:/m.test(err)); - }); - - ps.on('exit', function (code) { - t.notEqual(code, 0); - }); -}); diff --git a/node_modules/browserify/test/error_code/src.js b/node_modules/browserify/test/error_code/src.js deleted file mode 100644 index e85c07cca..000000000 --- a/node_modules/browserify/test/error_code/src.js +++ /dev/null @@ -1,2 +0,0 @@ -var x = { -var y = 6; diff --git a/node_modules/browserify/test/exclude.js b/node_modules/browserify/test/exclude.js deleted file mode 100644 index 382967737..000000000 --- a/node_modules/browserify/test/exclude.js +++ /dev/null @@ -1,21 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; -var vm = require('vm'); - -test('exclude array', function(t) { - t.plan(2); - - var b = browserify(); - b.add(__dirname + '/exclude/array.js'); - b.exclude([ - __dirname + '/exclude/skip.js', - __dirname + '/exclude/skip2.js' - ]); - - b.bundle(function (err, src) { - if (err) { - t.fail(err); - } - vm.runInNewContext(src, { t: t }); - }); -}); diff --git a/node_modules/browserify/test/exclude/array.js b/node_modules/browserify/test/exclude/array.js deleted file mode 100644 index de417c40e..000000000 --- a/node_modules/browserify/test/exclude/array.js +++ /dev/null @@ -1,2 +0,0 @@ -t.throws(function () { require('./skip.js') }); -t.throws(function () { require('./skip2.js') }); diff --git a/node_modules/browserify/test/exclude/skip.js b/node_modules/browserify/test/exclude/skip.js deleted file mode 100644 index 006521e56..000000000 --- a/node_modules/browserify/test/exclude/skip.js +++ /dev/null @@ -1 +0,0 @@ -t.fail('this file should have been skipped'); diff --git a/node_modules/browserify/test/exclude/skip2.js b/node_modules/browserify/test/exclude/skip2.js deleted file mode 100644 index 006521e56..000000000 --- a/node_modules/browserify/test/exclude/skip2.js +++ /dev/null @@ -1 +0,0 @@ -t.fail('this file should have been skipped'); diff --git a/node_modules/browserify/test/export.js b/node_modules/browserify/test/export.js deleted file mode 100644 index def4dfd85..000000000 --- a/node_modules/browserify/test/export.js +++ /dev/null @@ -1,35 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('no exports when no files are loaded', function (t) { - t.plan(1); - var b = browserify(); - b.bundle(function (err, src) { - var c = {}; - vm.runInNewContext(src, c); - t.same(Object.keys(c), []); - }); -}); - -test('no exports when entries are defined', function (t) { - t.plan(1); - var b = browserify(); - b.add(__dirname + '/export/entry.js'); - b.bundle(function (err, src) { - var c = {}; - vm.runInNewContext(src, c); - t.same(c, {}); - }); -}); - -test('require export when files are required', function (t) { - t.plan(1); - var b = browserify(); - b.require(__dirname + '/export/entry.js'); - b.bundle(function (err, src) { - var c = {}; - vm.runInNewContext(src, c); - t.same(Object.keys(c), [ 'require' ]); - }); -}); diff --git a/node_modules/browserify/test/export/entry.js b/node_modules/browserify/test/export/entry.js deleted file mode 100644 index 6f037f8a9..000000000 --- a/node_modules/browserify/test/export/entry.js +++ /dev/null @@ -1 +0,0 @@ -// nop diff --git a/node_modules/browserify/test/external.js b/node_modules/browserify/test/external.js deleted file mode 100644 index a107a4cfc..000000000 --- a/node_modules/browserify/test/external.js +++ /dev/null @@ -1,20 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('external', function (t) { - t.plan(2); - - var b = browserify(__dirname + '/external/main.js'); - b.external('freelist'); - b.bundle(function (err, src) { - if (err) return t.fail(err); - vm.runInNewContext( - 'function require (x) {' - + 'if (x==="freelist") return function (n) { return n + 1000 }' - + '}' - + src, - { t: t } - ); - }); -}); diff --git a/node_modules/browserify/test/external/main.js b/node_modules/browserify/test/external/main.js deleted file mode 100644 index 82ceeda83..000000000 --- a/node_modules/browserify/test/external/main.js +++ /dev/null @@ -1,2 +0,0 @@ -t.equal(require('freelist')(5), 1005); -t.equal(require('./x.js')(6), 1016); diff --git a/node_modules/browserify/test/external/x.js b/node_modules/browserify/test/external/x.js deleted file mode 100644 index a587ef44a..000000000 --- a/node_modules/browserify/test/external/x.js +++ /dev/null @@ -1,3 +0,0 @@ -var fl = require('freelist'); - -module.exports = function (n) { return fl(n) + 10 }; diff --git a/node_modules/browserify/test/external_args/main.js b/node_modules/browserify/test/external_args/main.js deleted file mode 100644 index b19e6c112..000000000 --- a/node_modules/browserify/test/external_args/main.js +++ /dev/null @@ -1,10 +0,0 @@ -try { - var Backbone = require('backbone'); - throw new Error('module included'); -} catch (e) { - if (e.message === 'module included') { - throw e; - } else { - t.ok(true); - } -} \ No newline at end of file diff --git a/node_modules/browserify/test/external_shim.js b/node_modules/browserify/test/external_shim.js deleted file mode 100644 index 1c251242a..000000000 --- a/node_modules/browserify/test/external_shim.js +++ /dev/null @@ -1,27 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('requiring a shimmed module name from an external bundle', function (t) { - t.plan(1); - var b1 = browserify(); - var b2 = browserify(); - - b1.require(__dirname + '/external_shim/bundle1.js', { expose: 'bundle1' }); - b2.external(b1); - b2.require(__dirname + '/external_shim/bundle2.js', { expose: 'bundle2' }); - - b1.bundle(function (err, src1) { - b2.bundle(function (err, src2) { - - var c = { - console: console, - setTimeout: setTimeout, - clearTimeout: clearTimeout - }; - vm.runInNewContext(src1 + src2, c); - - t.ok(c.require('bundle1').shim === c.require('bundle2').shim); - }); - }); -}); diff --git a/node_modules/browserify/test/external_shim/bundle1.js b/node_modules/browserify/test/external_shim/bundle1.js deleted file mode 100644 index 4753f09b7..000000000 --- a/node_modules/browserify/test/external_shim/bundle1.js +++ /dev/null @@ -1 +0,0 @@ -exports.shim = require('shim'); diff --git a/node_modules/browserify/test/external_shim/bundle2.js b/node_modules/browserify/test/external_shim/bundle2.js deleted file mode 100644 index 4753f09b7..000000000 --- a/node_modules/browserify/test/external_shim/bundle2.js +++ /dev/null @@ -1 +0,0 @@ -exports.shim = require('shim'); diff --git a/node_modules/browserify/test/external_shim/package.json b/node_modules/browserify/test/external_shim/package.json deleted file mode 100644 index 2047ac699..000000000 --- a/node_modules/browserify/test/external_shim/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browser": { - "shim": "./shim.js" - } -} \ No newline at end of file diff --git a/node_modules/browserify/test/external_shim/shim.js b/node_modules/browserify/test/external_shim/shim.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/browserify/test/externalize.js b/node_modules/browserify/test/externalize.js deleted file mode 100644 index 8d76055bb..000000000 --- a/node_modules/browserify/test/externalize.js +++ /dev/null @@ -1,59 +0,0 @@ -var test = require('tap').test; -var spawn = require('child_process').spawn; -var concat = require('concat-stream'); -var path = require('path'); -var fs = require('fs'); -var vm = require('vm'); - -var temp = require('temp'); -temp.track(); -var tmpdir = temp.mkdirSync({prefix: 'browserify-test'}); -var pubdir = path.join(tmpdir, 'public'); - -fs.mkdirSync(pubdir); -fs.writeFileSync( - path.join(tmpdir, 'robot.js'), - fs.readFileSync(path.join(__dirname, 'externalize/robot.js')) -); -fs.writeFileSync( - path.join(tmpdir, 'beep.js'), - fs.readFileSync(path.join(__dirname, 'externalize/beep.js')) -); -fs.writeFileSync( - path.join(tmpdir, 'boop.js'), - fs.readFileSync(path.join(__dirname, 'externalize/boop.js')) -); - -test('externalize bin', function (t) { - t.plan(5); - - var commands = [ - [ '-r', './robot.js', '-o', path.join(pubdir, 'common.js') ], - [ '-x', './robot.js', 'beep.js', '-o', path.join(pubdir, 'beep.js') ], - [ '-x', './robot.js', 'boop.js', '-o', path.join(pubdir, 'boop/bop.js') ] - ]; - (function next () { - if (commands.length === 0) { - var common = fs.readFileSync(path.join(pubdir, 'common.js')); - var beep = fs.readFileSync(path.join(pubdir, 'beep.js')); - var boop = fs.readFileSync(path.join(pubdir, 'boop/bop.js')); - - vm.runInNewContext(common + beep, { - console: { log: function (msg) { t.equal(msg, 'BEEP!') } } - }); - vm.runInNewContext(common + boop, { - console: { log: function (msg) { t.equal(msg, 'BOOP!') } } - }); - } - else { - var args = commands.shift(); - args.unshift(path.join(__dirname, '../bin/cmd.js')); - var ps = spawn(process.execPath, args, { cwd: tmpdir }); - ps.stderr.pipe(process.stderr); - ps.on('exit', function (code) { - t.equal(code, 0, 'exit code'); - next() - }); - } - })(); -}); diff --git a/node_modules/browserify/test/externalize/beep.js b/node_modules/browserify/test/externalize/beep.js deleted file mode 100644 index 4daf2bdd5..000000000 --- a/node_modules/browserify/test/externalize/beep.js +++ /dev/null @@ -1,2 +0,0 @@ -var robot = require('./robot.js'); -console.log(robot('beep')); \ No newline at end of file diff --git a/node_modules/browserify/test/externalize/boop.js b/node_modules/browserify/test/externalize/boop.js deleted file mode 100644 index 586e87fcd..000000000 --- a/node_modules/browserify/test/externalize/boop.js +++ /dev/null @@ -1,2 +0,0 @@ -var robot = require('./robot.js'); -console.log(robot('boop')); \ No newline at end of file diff --git a/node_modules/browserify/test/externalize/robot.js b/node_modules/browserify/test/externalize/robot.js deleted file mode 100644 index 8a7ccd883..000000000 --- a/node_modules/browserify/test/externalize/robot.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = function (s) { return s.toUpperCase() + '!' }; \ No newline at end of file diff --git a/node_modules/browserify/test/fake.js b/node_modules/browserify/test/fake.js deleted file mode 100644 index a62fb933b..000000000 --- a/node_modules/browserify/test/fake.js +++ /dev/null @@ -1,15 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('fake', function (t) { - t.plan(1); - - var b = browserify(); - b.require(__dirname + '/fake/fake_fs.js', { expose: 'fs' }); - b.add(__dirname + '/fake/main.js'); - b.bundle(function (err, src) { - var c = { t: t }; - vm.runInNewContext(src, c); - }); -}); diff --git a/node_modules/browserify/test/fake/fake_fs.js b/node_modules/browserify/test/fake/fake_fs.js deleted file mode 100644 index 1ebc261c7..000000000 --- a/node_modules/browserify/test/fake/fake_fs.js +++ /dev/null @@ -1 +0,0 @@ -exports.party = function () { return 'PaRtY!1!1!' }; diff --git a/node_modules/browserify/test/fake/main.js b/node_modules/browserify/test/fake/main.js deleted file mode 100644 index fd4339a06..000000000 --- a/node_modules/browserify/test/fake/main.js +++ /dev/null @@ -1,2 +0,0 @@ -var fs = require('fs'); -t.equal(fs.party(), 'PaRtY!1!1!'); diff --git a/node_modules/browserify/test/field.js b/node_modules/browserify/test/field.js deleted file mode 100644 index 83535046b..000000000 --- a/node_modules/browserify/test/field.js +++ /dev/null @@ -1,72 +0,0 @@ -var assert = require('assert'); -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('fieldString', function (t) { - t.plan(1); - - var b = browserify(); - b.require(__dirname + '/field/string.js', { expose: './string.js' }); - b.bundle(function (err, src) { - if (err) return t.fail(err); - - var c = {}; - vm.runInNewContext(src, c); - t.equal( - c.require('./string.js'), - 'browser' - ); - }); -}); - -test('fieldObject', function (t) { - t.plan(1); - - var b = browserify(); - b.require(__dirname + '/field/object.js', { expose: './object.js' }); - b.bundle(function (err, src) { - if (err) return t.fail(err); - - var c = {}; - vm.runInNewContext(src, c); - t.equal( - c.require('./object.js'), - '!browser' - ); - }); -}); - -test('missObject', function (t) { - t.plan(1); - - var b = browserify(); - b.require(__dirname + '/field/miss.js', { expose: './miss.js' }); - b.bundle(function (err, src) { - if (err) return t.fail(err); - - var c = {}; - vm.runInNewContext(src, c); - t.equal( - c.require('./miss.js'), - '!browser' - ); - }); -}); - -test('fieldSub', function (t) { - t.plan(1); - - var b = browserify(); - b.require(__dirname + '/field/sub.js', { expose: './sub.js' }); - b.bundle(function (err, src) { - if (err) return t.fail(err); - - var c = {}; - vm.runInNewContext(src, c); - t.equal( - c.require('./sub.js'), - 'browser' - ); - }); -}); diff --git a/node_modules/browserify/test/field/miss.js b/node_modules/browserify/test/field/miss.js deleted file mode 100644 index 361999048..000000000 --- a/node_modules/browserify/test/field/miss.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('z-miss') diff --git a/node_modules/browserify/test/field/node_modules/z-miss/browser.js b/node_modules/browserify/test/field/node_modules/z-miss/browser.js deleted file mode 100644 index 842765579..000000000 --- a/node_modules/browserify/test/field/node_modules/z-miss/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'browser'; diff --git a/node_modules/browserify/test/field/node_modules/z-miss/main.js b/node_modules/browserify/test/field/node_modules/z-miss/main.js deleted file mode 100644 index 219e0f97d..000000000 --- a/node_modules/browserify/test/field/node_modules/z-miss/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = '!browser'; diff --git a/node_modules/browserify/test/field/node_modules/z-miss/package.json b/node_modules/browserify/test/field/node_modules/z-miss/package.json deleted file mode 100644 index c1b67aedd..000000000 --- a/node_modules/browserify/test/field/node_modules/z-miss/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main" : "main.js", - "browserify" : {} -} diff --git a/node_modules/browserify/test/field/node_modules/z-object/browser.js b/node_modules/browserify/test/field/node_modules/z-object/browser.js deleted file mode 100644 index 842765579..000000000 --- a/node_modules/browserify/test/field/node_modules/z-object/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'browser'; diff --git a/node_modules/browserify/test/field/node_modules/z-object/main.js b/node_modules/browserify/test/field/node_modules/z-object/main.js deleted file mode 100644 index 219e0f97d..000000000 --- a/node_modules/browserify/test/field/node_modules/z-object/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = '!browser'; diff --git a/node_modules/browserify/test/field/node_modules/z-object/package.json b/node_modules/browserify/test/field/node_modules/z-object/package.json deleted file mode 100644 index dee081b31..000000000 --- a/node_modules/browserify/test/field/node_modules/z-object/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main" : "main.js", - "browserify" : { "main.js" : "browser.js" } -} diff --git a/node_modules/browserify/test/field/node_modules/z-string/browser.js b/node_modules/browserify/test/field/node_modules/z-string/browser.js deleted file mode 100644 index 842765579..000000000 --- a/node_modules/browserify/test/field/node_modules/z-string/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'browser'; diff --git a/node_modules/browserify/test/field/node_modules/z-string/main.js b/node_modules/browserify/test/field/node_modules/z-string/main.js deleted file mode 100644 index 219e0f97d..000000000 --- a/node_modules/browserify/test/field/node_modules/z-string/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = '!browser'; diff --git a/node_modules/browserify/test/field/node_modules/z-string/package.json b/node_modules/browserify/test/field/node_modules/z-string/package.json deleted file mode 100644 index 8647c0fb0..000000000 --- a/node_modules/browserify/test/field/node_modules/z-string/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main" : "main.js", - "browserify" : "browser.js" -} diff --git a/node_modules/browserify/test/field/node_modules/z-sub/browser/a.js b/node_modules/browserify/test/field/node_modules/z-sub/browser/a.js deleted file mode 100644 index 0952f7666..000000000 --- a/node_modules/browserify/test/field/node_modules/z-sub/browser/a.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./b'); diff --git a/node_modules/browserify/test/field/node_modules/z-sub/browser/b.js b/node_modules/browserify/test/field/node_modules/z-sub/browser/b.js deleted file mode 100644 index 842765579..000000000 --- a/node_modules/browserify/test/field/node_modules/z-sub/browser/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'browser'; diff --git a/node_modules/browserify/test/field/node_modules/z-sub/main.js b/node_modules/browserify/test/field/node_modules/z-sub/main.js deleted file mode 100644 index 219e0f97d..000000000 --- a/node_modules/browserify/test/field/node_modules/z-sub/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = '!browser'; diff --git a/node_modules/browserify/test/field/node_modules/z-sub/package.json b/node_modules/browserify/test/field/node_modules/z-sub/package.json deleted file mode 100644 index 4f4ed6291..000000000 --- a/node_modules/browserify/test/field/node_modules/z-sub/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "main" : "main.js", - "browserify" : "browser/a.js" -} diff --git a/node_modules/browserify/test/field/object.js b/node_modules/browserify/test/field/object.js deleted file mode 100644 index c373dc9e4..000000000 --- a/node_modules/browserify/test/field/object.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('z-object') diff --git a/node_modules/browserify/test/field/string.js b/node_modules/browserify/test/field/string.js deleted file mode 100644 index ee4c65d36..000000000 --- a/node_modules/browserify/test/field/string.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('z-string') diff --git a/node_modules/browserify/test/field/sub.js b/node_modules/browserify/test/field/sub.js deleted file mode 100644 index 8c662a97f..000000000 --- a/node_modules/browserify/test/field/sub.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('z-sub') diff --git a/node_modules/browserify/test/file_event.js b/node_modules/browserify/test/file_event.js deleted file mode 100644 index 33ac36ce5..000000000 --- a/node_modules/browserify/test/file_event.js +++ /dev/null @@ -1,33 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; -var path = require('path'); - -test('file event', function (t) { - t.plan(8); - - var b = browserify(__dirname + '/entry/main.js'); - var files = { - 'main.js': path.join(__dirname, 'entry/main.js'), - 'one.js': './one', - 'two.js': './two' - }; - - b.on('file', function (file, id) { - var key = path.basename(file); - t.equal(file, path.join(__dirname, 'entry', key)); - t.equal(id, files[key]); - delete files[key]; - }); - - b.bundle(function (err, src) { - var c = { - done : function (one, two) { - t.equal(one, 1); - t.equal(two, 2); - t.end(); - } - }; - vm.runInNewContext(src, c); - }); -}); diff --git a/node_modules/browserify/test/five_bundle.js b/node_modules/browserify/test/five_bundle.js deleted file mode 100644 index 473f037de..000000000 --- a/node_modules/browserify/test/five_bundle.js +++ /dev/null @@ -1,30 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('five bundle', function (t) { - t.plan(3+4*2); - - var b = browserify(__dirname + '/entry/main.js'); - var source; - - b.bundle(function (err, src0) { - t.ifError(err); - var c = { - done : function (one, two) { - t.equal(one, 1); - t.equal(two, 2); - } - }; - vm.runInNewContext(src0, c); - - (function next (count) { - if (count === 5) return; - b.bundle(function (err, src1) { - t.ifError(err); - t.equal(src1.toString('utf8'), src0.toString('utf8')); - next(count+1); - }); - })(1); - }); -}); diff --git a/node_modules/browserify/test/full_paths.js b/node_modules/browserify/test/full_paths.js deleted file mode 100644 index 11431beb2..000000000 --- a/node_modules/browserify/test/full_paths.js +++ /dev/null @@ -1,58 +0,0 @@ -var unpack = require('browser-unpack'); -var browserify = require('../'); -var test = require('tap').test; -var vm = require('vm'); -var path = require('path'); - -var deps = [ - path.join(__dirname, '/entry/main.js'), - path.join(__dirname, '/entry/one.js'), - path.join(__dirname, '/entry/two.js') -]; - -test('fullPaths enabled', function (t) { - t.plan(3); - - var b = browserify({ - entries: [ deps[0] ], - fullPaths: true - }); - - b.bundle(function (err, src) { - unpack(src).forEach(function(dep) { - t.notEqual(deps.indexOf(dep.id), -1, 'full path name for dep.id'); - }); - }); -}); - -test('fullPaths disabled', function (t) { - t.plan(3); - - var b = browserify({ - entries: [ deps[0] ], - fullPaths: false - }); - - b.bundle(function (err, src) { - unpack(src).forEach(function(dep) { - t.equal(deps.indexOf(dep.id), -1, 'full path name no longer available'); - }); - }); -}); - -test('fullPaths enabled, with custom exposed dependency name', function (t) { - t.plan(1); - - var b = browserify({ - entries: [__dirname + '/entry/needs_three.js'], - fullPaths: true - }); - - b.require(__dirname + '/entry/three.js', { expose: 'three' }); - - b.bundle(function (err, src) { - t.doesNotThrow(function () { - vm.runInNewContext(src, { console: console, t: t }); - }); - }); -}); diff --git a/node_modules/browserify/test/glob.js b/node_modules/browserify/test/glob.js deleted file mode 100644 index 4ac8093ca..000000000 --- a/node_modules/browserify/test/glob.js +++ /dev/null @@ -1,29 +0,0 @@ -var test = require('tap').test; -var spawn = require('child_process').spawn; -var path = require('path'); -var concat = require('concat-stream'); -var vm = require('vm'); - -test('glob', function (t) { - var expected = [ 'a', '!x', 'z', 'b', '!y' ]; - t.plan(expected.length + 1); - - var cwd = process.cwd(); - process.chdir(__dirname); - - var ps = spawn(process.execPath, [ - path.resolve(__dirname, '../bin/cmd.js'), - 'a.js', 'b.js', - '-u', 'vendor/*.js' - ], { cwd: __dirname + '/glob' }); - ps.stderr.pipe(process.stderr); - ps.stdout.pipe(concat(function (body) { - var c = { console: { log: log } }; - vm.runInNewContext(body.toString('utf8'), c); - function log (msg) { t.equal(msg, expected.shift()) } - })); - - ps.on('exit', function (code) { - t.equal(code, 0); - }); -}); diff --git a/node_modules/browserify/test/glob/a.js b/node_modules/browserify/test/glob/a.js deleted file mode 100644 index 97fe11aa9..000000000 --- a/node_modules/browserify/test/glob/a.js +++ /dev/null @@ -1,6 +0,0 @@ -console.log('a'); - -try { require('./vendor/x.js') } -catch (err) { console.log('!x') } - -require('./lib/z.js') diff --git a/node_modules/browserify/test/glob/b.js b/node_modules/browserify/test/glob/b.js deleted file mode 100644 index fedd5f44d..000000000 --- a/node_modules/browserify/test/glob/b.js +++ /dev/null @@ -1,5 +0,0 @@ -console.log('b'); - -try { require('./vendor/y.js') } -catch (err) { console.log('!y') } - diff --git a/node_modules/browserify/test/glob/lib/z.js b/node_modules/browserify/test/glob/lib/z.js deleted file mode 100644 index 0475609d4..000000000 --- a/node_modules/browserify/test/glob/lib/z.js +++ /dev/null @@ -1 +0,0 @@ -console.log('z'); diff --git a/node_modules/browserify/test/glob/vendor/x.js b/node_modules/browserify/test/glob/vendor/x.js deleted file mode 100644 index 5eee8647d..000000000 --- a/node_modules/browserify/test/glob/vendor/x.js +++ /dev/null @@ -1 +0,0 @@ -console.log('x'); diff --git a/node_modules/browserify/test/glob/vendor/y.js b/node_modules/browserify/test/glob/vendor/y.js deleted file mode 100644 index 78a89b3a2..000000000 --- a/node_modules/browserify/test/glob/vendor/y.js +++ /dev/null @@ -1 +0,0 @@ -console.log('y'); diff --git a/node_modules/browserify/test/global.js b/node_modules/browserify/test/global.js deleted file mode 100644 index 8026bcfb3..000000000 --- a/node_modules/browserify/test/global.js +++ /dev/null @@ -1,92 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -if (!ArrayBuffer.isView) ArrayBuffer.isView = function () { return false; }; - -test('global', function (t) { - t.plan(2); - - var b = browserify(); - b.add(__dirname + '/global/main.js'); - b.bundle(function (err, src) { - var c = { - t : t, - a : 555, - }; - c.self = c; - vm.runInNewContext(src, c); - }); -}); - -test('__filename and __dirname with insertGlobals: true', function (t) { - t.plan(2); - - var b = browserify({ - insertGlobals: true, - basedir: __dirname + '/global' - }); - b.require(__dirname + '/global/filename.js', { expose: 'x' }); - b.bundle(function (err, src) { - var c = { Uint8Array: Uint8Array }; - c.self = c; - vm.runInNewContext(src, c); - var x = c.require('x'); - t.equal(x.filename, '/filename.js'); - t.equal(x.dirname, '/'); - }); -}); - -test('__filename and __dirname', function (t) { - t.plan(2); - - var b = browserify({ basedir: __dirname + '/global' }); - b.require(__dirname + '/global/filename.js', { expose: 'x' }); - b.bundle(function (err, src) { - var c = {}; - vm.runInNewContext(src, c); - var x = c.require('x'); - t.equal(x.filename, '/filename.js'); - t.equal(x.dirname, '/'); - }); -}); - -test('__filename and __dirname with basedir', function (t) { - t.plan(2); - - var b = browserify({ basedir: __dirname }); - b.require(__dirname + '/global/filename.js', { expose: 'x' }); - b.bundle(function (err, src) { - var c = {}; - vm.runInNewContext(src, c); - var x = c.require('x'); - t.equal(x.filename, '/global/filename.js'); - t.equal(x.dirname, '/global'); - }); -}); - -test('process.nextTick', function (t) { - t.plan(1); - - var b = browserify(); - b.add(__dirname + '/global/tick.js'); - b.bundle(function (err, src) { - var c = { t: t, setTimeout: setTimeout, clearTimeout: clearTimeout }; - vm.runInNewContext(src, c); - }); -}); - -test('Buffer', function (t) { - t.plan(2); - - var b = browserify(); - b.add(__dirname + '/global/buffer.js'); - b.bundle(function (err, src) { - var c = { - t: t, - Uint8Array: Uint8Array, - ArrayBuffer: ArrayBuffer - }; - vm.runInNewContext(src, c); - }); -}); diff --git a/node_modules/browserify/test/global/buffer.js b/node_modules/browserify/test/global/buffer.js deleted file mode 100644 index fec6eeb8a..000000000 --- a/node_modules/browserify/test/global/buffer.js +++ /dev/null @@ -1,2 +0,0 @@ -t.equal(Buffer('xyz').toString('base64'), 'eHl6'); -t.equal(Buffer('eHl6', 'base64').toString(), 'xyz'); diff --git a/node_modules/browserify/test/global/filename.js b/node_modules/browserify/test/global/filename.js deleted file mode 100644 index 85dc112bf..000000000 --- a/node_modules/browserify/test/global/filename.js +++ /dev/null @@ -1,2 +0,0 @@ -exports.filename = __filename; -exports.dirname = __dirname; diff --git a/node_modules/browserify/test/global/main.js b/node_modules/browserify/test/global/main.js deleted file mode 100644 index d77852b23..000000000 --- a/node_modules/browserify/test/global/main.js +++ /dev/null @@ -1,2 +0,0 @@ -t.equal(a, 555); -t.equal(a, global.a); diff --git a/node_modules/browserify/test/global/node_modules/aaa/index.js b/node_modules/browserify/test/global/node_modules/aaa/index.js deleted file mode 100644 index 85dc112bf..000000000 --- a/node_modules/browserify/test/global/node_modules/aaa/index.js +++ /dev/null @@ -1,2 +0,0 @@ -exports.filename = __filename; -exports.dirname = __dirname; diff --git a/node_modules/browserify/test/global/node_modules/robot/index.js b/node_modules/browserify/test/global/node_modules/robot/index.js deleted file mode 100644 index dc8377968..000000000 --- a/node_modules/browserify/test/global/node_modules/robot/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/beep'); diff --git a/node_modules/browserify/test/global/node_modules/robot/lib/beep.js b/node_modules/browserify/test/global/node_modules/robot/lib/beep.js deleted file mode 100644 index 85dc112bf..000000000 --- a/node_modules/browserify/test/global/node_modules/robot/lib/beep.js +++ /dev/null @@ -1,2 +0,0 @@ -exports.filename = __filename; -exports.dirname = __dirname; diff --git a/node_modules/browserify/test/global/tick.js b/node_modules/browserify/test/global/tick.js deleted file mode 100644 index 428f3efc5..000000000 --- a/node_modules/browserify/test/global/tick.js +++ /dev/null @@ -1,3 +0,0 @@ -process.nextTick(function () { - t.ok(true); -}); diff --git a/node_modules/browserify/test/global_coffeeify.js b/node_modules/browserify/test/global_coffeeify.js deleted file mode 100644 index 00aa54a1d..000000000 --- a/node_modules/browserify/test/global_coffeeify.js +++ /dev/null @@ -1,19 +0,0 @@ -var test = require('tap').test; -var browserify = require('../'); -var vm = require('vm'); - -test('coffeeify globally', function (t) { - t.plan(1); - - var b = browserify(__dirname + '/coffeeify/main.coffee'); - b.transform('coffeeify', { global: true }); - b.bundle(function (err, src) { - if (err) t.fail(err); - vm.runInNewContext(src, { - console: { log: log }, - setTimeout: setTimeout, - clearTimeout: clearTimeout - }); - function log (msg) { t.equal(msg, 'eyo') } - }); -}); diff --git a/node_modules/browserify/test/global_noparse.js b/node_modules/browserify/test/global_noparse.js deleted file mode 100644 index a4e5a7051..000000000 --- a/node_modules/browserify/test/global_noparse.js +++ /dev/null @@ -1,102 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var path = require('path'); -var test = require('tap').test; - -test('global noparse module', function (t) { - t.plan(2); - - var b = browserify({ - noParse: 'aaa' - }); - b.require(__dirname + '/global/node_modules/aaa', { expose: 'x' }); - b.bundle(function (err, src) { - var c = { - __filename: __filename, - __dirname: __dirname - }; - vm.runInNewContext(src, c); - var x = c.require('x'); - t.equal(x.filename, __filename); - t.equal(x.dirname, __dirname); - }); -}); - -test('global noparse module file', function (t) { - t.plan(2); - - var b = browserify({ - noParse: 'aaa/index.js' - }); - b.require(__dirname + '/global/node_modules/aaa', { expose: 'x' }); - b.bundle(function (err, src) { - var c = { - __filename: __filename, - __dirname: __dirname - }; - vm.runInNewContext(src, c); - var x = c.require('x'); - t.equal(x.filename, __filename); - t.equal(x.dirname, __dirname); - }); -}); - -test('global noparse module deep file', function (t) { - t.plan(2); - - var b = browserify({ - noParse: 'robot/lib/beep.js' - }); - b.require(__dirname + '/global/node_modules/robot', { expose: 'x' }); - b.bundle(function (err, src) { - var c = { - __filename: __filename, - __dirname: __dirname - }; - vm.runInNewContext(src, c); - var x = c.require('x'); - t.equal(x.filename, __filename); - t.equal(x.dirname, __dirname); - }); -}); - -test('global noparse basedir', function (t) { - t.plan(2); - - var b = browserify({ - basedir: __dirname + '/global', - noParse: 'filename.js' - }); - b.require(__dirname + '/global/filename.js', { expose: 'x' }); - b.bundle(function (err, src) { - var c = { - __filename: __filename, - __dirname: __dirname - }; - vm.runInNewContext(src, c); - var x = c.require('x'); - t.equal(x.filename, __filename); - t.equal(x.dirname, __dirname); - }); -}); - -test('global noparse function', function (t) { - t.plan(2); - - var b = browserify({ - noParse: function(file) { - return file === path.join(__dirname, 'global/filename.js'); - } - }); - b.require(__dirname + '/global/filename.js', { expose: 'x' }); - b.bundle(function (err, src) { - var c = { - __filename: __filename, - __dirname: __dirname - }; - vm.runInNewContext(src, c); - var x = c.require('x'); - t.equal(x.filename, __filename); - t.equal(x.dirname, __dirname); - }); -}); diff --git a/node_modules/browserify/test/global_recorder.js b/node_modules/browserify/test/global_recorder.js deleted file mode 100644 index 7fdc07fb3..000000000 --- a/node_modules/browserify/test/global_recorder.js +++ /dev/null @@ -1,22 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('recorded global tr', function (t) { - t.plan(6); - - var b = browserify(__dirname + '/global_recorder/main.js'); - var context = { - console: { log: function (msg) { t.equal(msg, 'wow') } } - }; - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src, context); - t.equal(b._recorded.length, 2); - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src, context); - t.equal(b._recorded.length, 2); - }); - }); -}); diff --git a/node_modules/browserify/test/global_recorder/main.js b/node_modules/browserify/test/global_recorder/main.js deleted file mode 100644 index 6036bec63..000000000 --- a/node_modules/browserify/test/global_recorder/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log('wow'); diff --git a/node_modules/browserify/test/hash.js b/node_modules/browserify/test/hash.js deleted file mode 100644 index a459a40a6..000000000 --- a/node_modules/browserify/test/hash.js +++ /dev/null @@ -1,15 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('hash', function (t) { - t.plan(3); - - var b = browserify(__dirname + '/hash/main.js'); - b.bundle(function (err, buf) { - var c = { t: t }; - var src = buf.toString('utf8'); - t.equal(src.match(RegExp('// FILE CONTENTS', 'g')).length, 1); - vm.runInNewContext(src, c); - }); -}); diff --git a/node_modules/browserify/test/hash/foo/other.js b/node_modules/browserify/test/hash/foo/other.js deleted file mode 100644 index f4e8d9d29..000000000 --- a/node_modules/browserify/test/hash/foo/other.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 5; diff --git a/node_modules/browserify/test/hash/foo/two.js b/node_modules/browserify/test/hash/foo/two.js deleted file mode 100644 index 86c05b925..000000000 --- a/node_modules/browserify/test/hash/foo/two.js +++ /dev/null @@ -1,2 +0,0 @@ -// FILE CONTENTS -module.exports = 111 * require('./other.js'); diff --git a/node_modules/browserify/test/hash/main.js b/node_modules/browserify/test/hash/main.js deleted file mode 100644 index b37dd8831..000000000 --- a/node_modules/browserify/test/hash/main.js +++ /dev/null @@ -1,2 +0,0 @@ -t.equal(require('./foo/two.js'), 555); -t.equal(require('./one.js'), 333); diff --git a/node_modules/browserify/test/hash/one.js b/node_modules/browserify/test/hash/one.js deleted file mode 100644 index 86c05b925..000000000 --- a/node_modules/browserify/test/hash/one.js +++ /dev/null @@ -1,2 +0,0 @@ -// FILE CONTENTS -module.exports = 111 * require('./other.js'); diff --git a/node_modules/browserify/test/hash/other.js b/node_modules/browserify/test/hash/other.js deleted file mode 100644 index 690aad34a..000000000 --- a/node_modules/browserify/test/hash/other.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 3; diff --git a/node_modules/browserify/test/hash_instance_context.js b/node_modules/browserify/test/hash_instance_context.js deleted file mode 100644 index dda45aa47..000000000 --- a/node_modules/browserify/test/hash_instance_context.js +++ /dev/null @@ -1,25 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('hash instances with hashed contexts', function (t) { - t.plan(17); - - var b = browserify(__dirname + '/hash_instance_context/main.js'); - b.bundle(function (err, buf) { - var c = { t: t }; - var src = buf.toString('utf8'); - t.equal(src.match(RegExp('// FILE F ONE', 'g')).length, 1); - t.equal(src.match(RegExp('// FILE G ONE', 'g')).length, 2); - - t.equal(src.match(RegExp('// FILE F TWO', 'g')).length, 1); - t.equal(src.match(RegExp('// FILE G TWO', 'g')).length, 1); - t.equal(src.match(RegExp('// FILE H TWO', 'g')).length, 2); - - t.equal(src.match(RegExp('// FILE F THREE', 'g')).length, 1); - t.equal(src.match(RegExp('// FILE G THREE', 'g')).length, 1); - t.equal(src.match(RegExp('// FILE H THREE', 'g')).length, 1); - - vm.runInNewContext(src, c); - }); -}); diff --git a/node_modules/browserify/test/hash_instance_context/main.js b/node_modules/browserify/test/hash_instance_context/main.js deleted file mode 100644 index db1e23e97..000000000 --- a/node_modules/browserify/test/hash_instance_context/main.js +++ /dev/null @@ -1,17 +0,0 @@ -var A = require('./one/f.js'); -var B = require('./one/dir/f.js'); -t.notEqual(A, B); -t.equal(A(), 555); -t.equal(B(), 333); - -var C = require('./two/f.js'); -var D = require('./two/dir/f.js'); -t.notEqual(C, D); -t.equal(C(), 555); -t.equal(D(), 333); - -var E = require('./three/f.js'); -var F = require('./three/dir/f.js'); -t.notEqual(E, F); -t.equal(E(), 555); -t.equal(F(), 555); diff --git a/node_modules/browserify/test/hash_instance_context/one/dir/f.js b/node_modules/browserify/test/hash_instance_context/one/dir/f.js deleted file mode 100644 index a315c1e7d..000000000 --- a/node_modules/browserify/test/hash_instance_context/one/dir/f.js +++ /dev/null @@ -1,3 +0,0 @@ -// FILE F ONE -var G = require('./g.js'); -module.exports = function () { return 111 * G }; diff --git a/node_modules/browserify/test/hash_instance_context/one/dir/g.js b/node_modules/browserify/test/hash_instance_context/one/dir/g.js deleted file mode 100644 index 9cab61b8d..000000000 --- a/node_modules/browserify/test/hash_instance_context/one/dir/g.js +++ /dev/null @@ -1,2 +0,0 @@ -// FILE G ONE -module.exports = 3 diff --git a/node_modules/browserify/test/hash_instance_context/one/f.js b/node_modules/browserify/test/hash_instance_context/one/f.js deleted file mode 100644 index a315c1e7d..000000000 --- a/node_modules/browserify/test/hash_instance_context/one/f.js +++ /dev/null @@ -1,3 +0,0 @@ -// FILE F ONE -var G = require('./g.js'); -module.exports = function () { return 111 * G }; diff --git a/node_modules/browserify/test/hash_instance_context/one/g.js b/node_modules/browserify/test/hash_instance_context/one/g.js deleted file mode 100644 index 837303206..000000000 --- a/node_modules/browserify/test/hash_instance_context/one/g.js +++ /dev/null @@ -1,2 +0,0 @@ -// FILE G ONE -module.exports = 5 diff --git a/node_modules/browserify/test/hash_instance_context/three/dir/f.js b/node_modules/browserify/test/hash_instance_context/three/dir/f.js deleted file mode 100644 index 51b1e7327..000000000 --- a/node_modules/browserify/test/hash_instance_context/three/dir/f.js +++ /dev/null @@ -1,3 +0,0 @@ -// FILE F THREE -var G = require('./g.js'); -module.exports = function () { return 111 * G }; diff --git a/node_modules/browserify/test/hash_instance_context/three/dir/g.js b/node_modules/browserify/test/hash_instance_context/three/dir/g.js deleted file mode 100644 index 654f021c3..000000000 --- a/node_modules/browserify/test/hash_instance_context/three/dir/g.js +++ /dev/null @@ -1,2 +0,0 @@ -// FILE G THREE -module.exports = require('./h.js') + 1; diff --git a/node_modules/browserify/test/hash_instance_context/three/dir/h.js b/node_modules/browserify/test/hash_instance_context/three/dir/h.js deleted file mode 100644 index afcc80fd3..000000000 --- a/node_modules/browserify/test/hash_instance_context/three/dir/h.js +++ /dev/null @@ -1,2 +0,0 @@ -// FILE H THREE -module.exports = 4 diff --git a/node_modules/browserify/test/hash_instance_context/three/f.js b/node_modules/browserify/test/hash_instance_context/three/f.js deleted file mode 100644 index 51b1e7327..000000000 --- a/node_modules/browserify/test/hash_instance_context/three/f.js +++ /dev/null @@ -1,3 +0,0 @@ -// FILE F THREE -var G = require('./g.js'); -module.exports = function () { return 111 * G }; diff --git a/node_modules/browserify/test/hash_instance_context/three/g.js b/node_modules/browserify/test/hash_instance_context/three/g.js deleted file mode 100644 index 654f021c3..000000000 --- a/node_modules/browserify/test/hash_instance_context/three/g.js +++ /dev/null @@ -1,2 +0,0 @@ -// FILE G THREE -module.exports = require('./h.js') + 1; diff --git a/node_modules/browserify/test/hash_instance_context/three/h.js b/node_modules/browserify/test/hash_instance_context/three/h.js deleted file mode 100644 index afcc80fd3..000000000 --- a/node_modules/browserify/test/hash_instance_context/three/h.js +++ /dev/null @@ -1,2 +0,0 @@ -// FILE H THREE -module.exports = 4 diff --git a/node_modules/browserify/test/hash_instance_context/two/dir/f.js b/node_modules/browserify/test/hash_instance_context/two/dir/f.js deleted file mode 100644 index 1178f93fb..000000000 --- a/node_modules/browserify/test/hash_instance_context/two/dir/f.js +++ /dev/null @@ -1,3 +0,0 @@ -// FILE F TWO -var G = require('./g.js'); -module.exports = function () { return 111 * G }; diff --git a/node_modules/browserify/test/hash_instance_context/two/dir/g.js b/node_modules/browserify/test/hash_instance_context/two/dir/g.js deleted file mode 100644 index b940ee76f..000000000 --- a/node_modules/browserify/test/hash_instance_context/two/dir/g.js +++ /dev/null @@ -1,2 +0,0 @@ -// FILE G TWO -module.exports = require('./h.js') + 1; diff --git a/node_modules/browserify/test/hash_instance_context/two/dir/h.js b/node_modules/browserify/test/hash_instance_context/two/dir/h.js deleted file mode 100644 index 74a8a7a47..000000000 --- a/node_modules/browserify/test/hash_instance_context/two/dir/h.js +++ /dev/null @@ -1,2 +0,0 @@ -// FILE H TWO -module.exports = 2 diff --git a/node_modules/browserify/test/hash_instance_context/two/f.js b/node_modules/browserify/test/hash_instance_context/two/f.js deleted file mode 100644 index 1178f93fb..000000000 --- a/node_modules/browserify/test/hash_instance_context/two/f.js +++ /dev/null @@ -1,3 +0,0 @@ -// FILE F TWO -var G = require('./g.js'); -module.exports = function () { return 111 * G }; diff --git a/node_modules/browserify/test/hash_instance_context/two/g.js b/node_modules/browserify/test/hash_instance_context/two/g.js deleted file mode 100644 index b940ee76f..000000000 --- a/node_modules/browserify/test/hash_instance_context/two/g.js +++ /dev/null @@ -1,2 +0,0 @@ -// FILE G TWO -module.exports = require('./h.js') + 1; diff --git a/node_modules/browserify/test/hash_instance_context/two/h.js b/node_modules/browserify/test/hash_instance_context/two/h.js deleted file mode 100644 index 42684f036..000000000 --- a/node_modules/browserify/test/hash_instance_context/two/h.js +++ /dev/null @@ -1,2 +0,0 @@ -// FILE H TWO -module.exports = 4 diff --git a/node_modules/browserify/test/identical.js b/node_modules/browserify/test/identical.js deleted file mode 100644 index 7d0deaeb9..000000000 --- a/node_modules/browserify/test/identical.js +++ /dev/null @@ -1,19 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; -var vm = require('vm'); - -test('identical', function (t) { - var expected = [ 0, 1, 0, 1 ]; - t.plan(expected.length + 1); - - var b = browserify(__dirname + '/identical/main.js'); - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src.toString('utf8'), { - console: { log: log } - }); - function log (msg) { - t.equal(msg, expected.shift()); - } - }); -}); diff --git a/node_modules/browserify/test/identical/main.js b/node_modules/browserify/test/identical/main.js deleted file mode 100644 index c2e83ed20..000000000 --- a/node_modules/browserify/test/identical/main.js +++ /dev/null @@ -1,6 +0,0 @@ -var x = require('./x'); -var y = require('./y'); -console.log(x()); -console.log(x()); -console.log(y()); -console.log(y()); diff --git a/node_modules/browserify/test/identical/x.js b/node_modules/browserify/test/identical/x.js deleted file mode 100644 index 13c441d79..000000000 --- a/node_modules/browserify/test/identical/x.js +++ /dev/null @@ -1,2 +0,0 @@ -var i = 0; -module.exports = function () { return i++ }; diff --git a/node_modules/browserify/test/identical/y.js b/node_modules/browserify/test/identical/y.js deleted file mode 100644 index 13c441d79..000000000 --- a/node_modules/browserify/test/identical/y.js +++ /dev/null @@ -1,2 +0,0 @@ -var i = 0; -module.exports = function () { return i++ }; diff --git a/node_modules/browserify/test/identical_different.js b/node_modules/browserify/test/identical_different.js deleted file mode 100644 index a2e7911d3..000000000 --- a/node_modules/browserify/test/identical_different.js +++ /dev/null @@ -1,19 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; -var vm = require('vm'); - -test('identical', function (t) { - var expected = [ 1, 2, 10, 110 ]; - t.plan(expected.length + 1); - - var b = browserify(__dirname + '/identical_different/main.js'); - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src.toString('utf8'), { - console: { log: log } - }); - function log (msg) { - t.equal(msg, expected.shift()); - } - }); -}); diff --git a/node_modules/browserify/test/identical_different/main.js b/node_modules/browserify/test/identical_different/main.js deleted file mode 100644 index 5a4154b1d..000000000 --- a/node_modules/browserify/test/identical_different/main.js +++ /dev/null @@ -1,6 +0,0 @@ -var x = require('./x'); -var y = require('./wow/y'); -console.log(x()); -console.log(x()); -console.log(y()); -console.log(y()); diff --git a/node_modules/browserify/test/identical_different/node_modules/op/index.js b/node_modules/browserify/test/identical_different/node_modules/op/index.js deleted file mode 100644 index 7014688aa..000000000 --- a/node_modules/browserify/test/identical_different/node_modules/op/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function (n) { - return n + 1; -}; diff --git a/node_modules/browserify/test/identical_different/wow/node_modules/op/index.js b/node_modules/browserify/test/identical_different/wow/node_modules/op/index.js deleted file mode 100644 index e08a1ce12..000000000 --- a/node_modules/browserify/test/identical_different/wow/node_modules/op/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function (n) { - return (n+1) * 10; -}; diff --git a/node_modules/browserify/test/identical_different/wow/y.js b/node_modules/browserify/test/identical_different/wow/y.js deleted file mode 100644 index 0b8636f5c..000000000 --- a/node_modules/browserify/test/identical_different/wow/y.js +++ /dev/null @@ -1,3 +0,0 @@ -var op = require('op'); -var i = 0; -module.exports = function () { i = op(i); return i }; diff --git a/node_modules/browserify/test/identical_different/x.js b/node_modules/browserify/test/identical_different/x.js deleted file mode 100644 index 0b8636f5c..000000000 --- a/node_modules/browserify/test/identical_different/x.js +++ /dev/null @@ -1,3 +0,0 @@ -var op = require('op'); -var i = 0; -module.exports = function () { i = op(i); return i }; diff --git a/node_modules/browserify/test/ignore.js b/node_modules/browserify/test/ignore.js deleted file mode 100644 index 4cb70971f..000000000 --- a/node_modules/browserify/test/ignore.js +++ /dev/null @@ -1,91 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; -var vm = require('vm'); -var path = require('path'); - -test('ignore', function (t) { - t.plan(1); - - var b = browserify(); - b.add(__dirname + '/ignore/main.js'); - b.ignore(path.join(__dirname, 'ignore/skip.js')); - - b.bundle(function (err, src) { - if (err) t.fail(err); - vm.runInNewContext(src, { t: t }); - }); -}); - -test('ignore array', function(t) { - t.plan(2); - - var b = browserify(); - b.add(__dirname + '/ignore/array.js'); - b.ignore([ - path.join(__dirname, 'ignore/skip.js'), - path.join(__dirname, 'ignore/skip2.js') - ]); - - b.bundle(function (err, src) { - if (err) { - t.fail(err); - } - vm.runInNewContext(src, { t: t }); - }); -}); - -test('ignore by package or id', function (t) { - t.plan(3); - - var b = browserify(); - b.add(__dirname + '/ignore/by-id.js'); - b.ignore('events'); - b.ignore('beep'); - b.ignore('bad id'); - - b.bundle(function (err, src) { - if (err) t.fail(err); - vm.runInNewContext(src, { t: t }); - }); -}); - -test('ignore files referenced by relative path', function (t) { - // Change the current working directory relative to this file - var cwd = process.cwd(); - process.chdir(__dirname); - - t.plan(1); - - var b = browserify(); - b.add(__dirname + '/ignore/by-relative.js'); - b.ignore('./ignore/ignored/skip.js'); - - b.bundle(function (err, src) { - if (err) t.fail(err); - vm.runInNewContext(src, { t: t }); - }); - - // Revert CWD - process.chdir(cwd); -}); - -test('do not ignore files with relative paths that do not resolve', function (t) { - // Change the current working directory to the ignore folder - var cwd = process.cwd(); - process.chdir(__dirname + '/ignore'); - - t.plan(2); - - var b = browserify(); - b.add(__dirname + '/ignore/double-skip.js'); - - b.ignore('./skip.js'); - - b.bundle(function (err, src) { - if (err) t.fail(err); - vm.runInNewContext(src, { t: t }); - }); - - // Revert CWD - process.chdir(cwd); -}); diff --git a/node_modules/browserify/test/ignore/array.js b/node_modules/browserify/test/ignore/array.js deleted file mode 100644 index 837e179b5..000000000 --- a/node_modules/browserify/test/ignore/array.js +++ /dev/null @@ -1,2 +0,0 @@ -t.deepEqual(require('./skip.js'), {}); -t.deepEqual(require('./skip2.js'), {}); diff --git a/node_modules/browserify/test/ignore/by-id.js b/node_modules/browserify/test/ignore/by-id.js deleted file mode 100644 index 61c0baaba..000000000 --- a/node_modules/browserify/test/ignore/by-id.js +++ /dev/null @@ -1,3 +0,0 @@ -t.deepEqual(require('events'), {}); -t.deepEqual(require('bad id'), {}); -t.deepEqual(require('beep'), {}); \ No newline at end of file diff --git a/node_modules/browserify/test/ignore/by-relative.js b/node_modules/browserify/test/ignore/by-relative.js deleted file mode 100644 index e50676efb..000000000 --- a/node_modules/browserify/test/ignore/by-relative.js +++ /dev/null @@ -1,5 +0,0 @@ -/** - * This test is to check to make sure that files that are ignored do not get - * bundled when referenced with a nested relative path. - */ -t.deepEqual(require('./relative'), {}); diff --git a/node_modules/browserify/test/ignore/double-skip.js b/node_modules/browserify/test/ignore/double-skip.js deleted file mode 100644 index ad61cce9f..000000000 --- a/node_modules/browserify/test/ignore/double-skip.js +++ /dev/null @@ -1,2 +0,0 @@ -t.deepEqual(require('./skip.js'), {}); -t.deepEqual(require('./double-skip/index'), {foo: 'bar'}); \ No newline at end of file diff --git a/node_modules/browserify/test/ignore/double-skip/index.js b/node_modules/browserify/test/ignore/double-skip/index.js deleted file mode 100644 index affe2f2d8..000000000 --- a/node_modules/browserify/test/ignore/double-skip/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./skip.js'); \ No newline at end of file diff --git a/node_modules/browserify/test/ignore/double-skip/skip.js b/node_modules/browserify/test/ignore/double-skip/skip.js deleted file mode 100644 index 1922194b8..000000000 --- a/node_modules/browserify/test/ignore/double-skip/skip.js +++ /dev/null @@ -1,5 +0,0 @@ -// this module should return something - -module.exports = { - foo: 'bar' -}; diff --git a/node_modules/browserify/test/ignore/ignored/skip.js b/node_modules/browserify/test/ignore/ignored/skip.js deleted file mode 100644 index 006521e56..000000000 --- a/node_modules/browserify/test/ignore/ignored/skip.js +++ /dev/null @@ -1 +0,0 @@ -t.fail('this file should have been skipped'); diff --git a/node_modules/browserify/test/ignore/main.js b/node_modules/browserify/test/ignore/main.js deleted file mode 100644 index 0149b755c..000000000 --- a/node_modules/browserify/test/ignore/main.js +++ /dev/null @@ -1 +0,0 @@ -t.deepEqual(require('./skip.js'), {}); diff --git a/node_modules/browserify/test/ignore/relative/index.js b/node_modules/browserify/test/ignore/relative/index.js deleted file mode 100644 index 3f73c326a..000000000 --- a/node_modules/browserify/test/ignore/relative/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../ignored/skip.js'); \ No newline at end of file diff --git a/node_modules/browserify/test/ignore/skip.js b/node_modules/browserify/test/ignore/skip.js deleted file mode 100644 index 006521e56..000000000 --- a/node_modules/browserify/test/ignore/skip.js +++ /dev/null @@ -1 +0,0 @@ -t.fail('this file should have been skipped'); diff --git a/node_modules/browserify/test/ignore/skip2.js b/node_modules/browserify/test/ignore/skip2.js deleted file mode 100644 index 006521e56..000000000 --- a/node_modules/browserify/test/ignore/skip2.js +++ /dev/null @@ -1 +0,0 @@ -t.fail('this file should have been skipped'); diff --git a/node_modules/browserify/test/ignore_browser_field.js b/node_modules/browserify/test/ignore_browser_field.js deleted file mode 100644 index a925f2e62..000000000 --- a/node_modules/browserify/test/ignore_browser_field.js +++ /dev/null @@ -1,21 +0,0 @@ -var test = require('tap').test; -var browserify = require('../'); -var path = require('path'); -var mainfile = path.join(__dirname, 'ignore_browser_field/main.js'); -var vm = require('vm'); - -test('ignore browser field', function (t) { - t.plan(3); - var b = browserify(mainfile, { browserField: false }); - var expected = [ 'A:NODE', 'B:X.JS' ]; - - b.bundle(function (err, src) { - t.ifError(err); - var c = { console: { log: log } }; - vm.runInNewContext(src, c); - - function log (msg) { - t.equal(msg, expected.shift()); - } - }); -}); diff --git a/node_modules/browserify/test/ignore_browser_field/main.js b/node_modules/browserify/test/ignore_browser_field/main.js deleted file mode 100644 index bae4a2290..000000000 --- a/node_modules/browserify/test/ignore_browser_field/main.js +++ /dev/null @@ -1,2 +0,0 @@ -console.log(require('a')); -console.log(require('b')); diff --git a/node_modules/browserify/test/ignore_browser_field/node_modules/a/browser.js b/node_modules/browserify/test/ignore_browser_field/node_modules/a/browser.js deleted file mode 100644 index 229aa83cb..000000000 --- a/node_modules/browserify/test/ignore_browser_field/node_modules/a/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'A:BROWSER' diff --git a/node_modules/browserify/test/ignore_browser_field/node_modules/a/main.js b/node_modules/browserify/test/ignore_browser_field/node_modules/a/main.js deleted file mode 100644 index 1f95fc3c3..000000000 --- a/node_modules/browserify/test/ignore_browser_field/node_modules/a/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'A:NODE' diff --git a/node_modules/browserify/test/ignore_browser_field/node_modules/a/package.json b/node_modules/browserify/test/ignore_browser_field/node_modules/a/package.json deleted file mode 100644 index d7572b6f9..000000000 --- a/node_modules/browserify/test/ignore_browser_field/node_modules/a/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "a", - "version": "1.0.0", - "main": "main.js", - "browser": "browser.js" -} diff --git a/node_modules/browserify/test/ignore_browser_field/node_modules/b/browser-x.js b/node_modules/browserify/test/ignore_browser_field/node_modules/b/browser-x.js deleted file mode 100644 index aca586288..000000000 --- a/node_modules/browserify/test/ignore_browser_field/node_modules/b/browser-x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'browser-x.js' diff --git a/node_modules/browserify/test/ignore_browser_field/node_modules/b/main.js b/node_modules/browserify/test/ignore_browser_field/node_modules/b/main.js deleted file mode 100644 index 5b7a8817b..000000000 --- a/node_modules/browserify/test/ignore_browser_field/node_modules/b/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = ('b:' + require('./x.js')).toUpperCase(); diff --git a/node_modules/browserify/test/ignore_browser_field/node_modules/b/package.json b/node_modules/browserify/test/ignore_browser_field/node_modules/b/package.json deleted file mode 100644 index 021d8bb38..000000000 --- a/node_modules/browserify/test/ignore_browser_field/node_modules/b/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "b", - "version": "1.0.0", - "main": "main.js", - "browser": { - "./x.js": "./browser-x.js" - } -} diff --git a/node_modules/browserify/test/ignore_browser_field/node_modules/b/x.js b/node_modules/browserify/test/ignore_browser_field/node_modules/b/x.js deleted file mode 100644 index 43396403b..000000000 --- a/node_modules/browserify/test/ignore_browser_field/node_modules/b/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'x.js'; diff --git a/node_modules/browserify/test/ignore_missing.js b/node_modules/browserify/test/ignore_missing.js deleted file mode 100644 index ddf72ed20..000000000 --- a/node_modules/browserify/test/ignore_missing.js +++ /dev/null @@ -1,41 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; - -test('ignoreMissing option', function (t) { - t.test('on browserify', function(t) { - t.plan(1); - - var ignored = browserify({ - entries: [__dirname + '/ignore_missing/main.js'], - ignoreMissing: true - }); - - ignored.bundle(function(err) { - t.ok(!err, "bundle completed with missing file ignored"); - }); - }); - - t.test('on .bundle', function(t) { - t.plan(1); - - var ignored = browserify(__dirname + '/ignore_missing/main.js', { - ignoreMissing: true - }); - - ignored.bundle(function(err) { - t.ok(!err, "bundle completed with missing file ignored"); - }); - }); - - t.test('defaults to false', function (t) { - t.plan(1); - - var expected = browserify(__dirname + '/ignore_missing/main.js'); - - expected.bundle(function(err) { - t.ok(err, 'ignoreMissing was false, an error was raised'); - }); - }); - - t.end(); -}); diff --git a/node_modules/browserify/test/ignore_missing/main.js b/node_modules/browserify/test/ignore_missing/main.js deleted file mode 100644 index a522a65cb..000000000 --- a/node_modules/browserify/test/ignore_missing/main.js +++ /dev/null @@ -1 +0,0 @@ -require('./no_such_file'); diff --git a/node_modules/browserify/test/ignore_transform_key.js b/node_modules/browserify/test/ignore_transform_key.js deleted file mode 100644 index 253f64051..000000000 --- a/node_modules/browserify/test/ignore_transform_key.js +++ /dev/null @@ -1,17 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; -var vm = require('vm'); - -test('ignore transform', function(t) { - t.plan(1); - - var b = browserify({ - transformKey: false - }); - b.add(__dirname + '/ignore_transform_key/main.js'); - - b.bundle(function(err, src) { - if (err) t.fail(err); - vm.runInNewContext(src, {t: t}); - }); -}); diff --git a/node_modules/browserify/test/ignore_transform_key/main.js b/node_modules/browserify/test/ignore_transform_key/main.js deleted file mode 100644 index 97be0ea7c..000000000 --- a/node_modules/browserify/test/ignore_transform_key/main.js +++ /dev/null @@ -1,3 +0,0 @@ -var a = require('a'); - -t.equal(a, 'good'); diff --git a/node_modules/browserify/test/ignore_transform_key/node_modules/a/index.js b/node_modules/browserify/test/ignore_transform_key/node_modules/a/index.js deleted file mode 100644 index 1f9bee291..000000000 --- a/node_modules/browserify/test/ignore_transform_key/node_modules/a/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'good'; diff --git a/node_modules/browserify/test/ignore_transform_key/node_modules/a/package.json b/node_modules/browserify/test/ignore_transform_key/node_modules/a/package.json deleted file mode 100644 index 7d9c4b3d5..000000000 --- a/node_modules/browserify/test/ignore_transform_key/node_modules/a/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "a", - "version": "1.0.0", - "private": true, - "browserify": { - "transform": [ - "evil-transform" - ] - } -} diff --git a/node_modules/browserify/test/ignore_transform_key/node_modules/evil-transform/index.js b/node_modules/browserify/test/ignore_transform_key/node_modules/evil-transform/index.js deleted file mode 100644 index a4dd44451..000000000 --- a/node_modules/browserify/test/ignore_transform_key/node_modules/evil-transform/index.js +++ /dev/null @@ -1,12 +0,0 @@ -const through2 = require('through2'); - -module.exports = function() { - - return through2.obj(function(row, enc, next) { - return next(); - }, - function(next) { - next(null, "module.exports = 'evil';"); - } - ) -}; diff --git a/node_modules/browserify/test/ignore_transform_key/node_modules/evil-transform/package.json b/node_modules/browserify/test/ignore_transform_key/node_modules/evil-transform/package.json deleted file mode 100644 index 81ca8df1a..000000000 --- a/node_modules/browserify/test/ignore_transform_key/node_modules/evil-transform/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "evil-transform", - "version": "1.0.0", - "private": true -} diff --git a/node_modules/browserify/test/json.js b/node_modules/browserify/test/json.js deleted file mode 100644 index e0f2e27ea..000000000 --- a/node_modules/browserify/test/json.js +++ /dev/null @@ -1,48 +0,0 @@ -var browserify = require('../'); -var fs = require('fs'); -var vm = require('vm'); -var semver = require('semver'); -var test = require('tap').test; - -test('json', function (t) { - t.plan(2); - var b = browserify(); - b.add(__dirname + '/json/main.js'); - b.bundle(function (err, src) { - if (err) t.fail(err); - var c = { - ex : function (obj) { - t.same(obj, { beep : 'boop', x : 555 }); - } - }; - vm.runInNewContext(src, c); - }); -}); - -// This works in Node v10 and up thanks to the JSON superset proposal, which -// allows the evil chars in javascript strings. -// https://github.com/tc39/proposal-json-superset -test('verify evil json', { skip: semver.gte(process.version, 'v10.0.0') }, function(t) { - t.plan(1); - fs.readFile(__dirname + '/json/evil-chars.json', function(err, data) { - if (err) t.fail(err); - t.throws(function() { - vm.runInNewContext('(' + data.toString() + ')'); - }); - }); -}); - -test('evil json', function (t) { - t.plan(2); - var b = browserify(); - b.add(__dirname + '/json/evil.js'); - b.bundle(function (err, src) { - if (err) t.fail(err); - var c = { - ex : function (obj) { - t.same(obj, { evil : '\u2028\u2029' }); - } - }; - vm.runInNewContext(src, c); - }); -}); diff --git a/node_modules/browserify/test/json/beep.json b/node_modules/browserify/test/json/beep.json deleted file mode 100644 index d85cfe565..000000000 --- a/node_modules/browserify/test/json/beep.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "beep" : "boop", - "x" : 555 -} diff --git a/node_modules/browserify/test/json/evil-chars.json b/node_modules/browserify/test/json/evil-chars.json deleted file mode 100644 index 4a5851bb6..000000000 --- a/node_modules/browserify/test/json/evil-chars.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "evil": "

" -} diff --git a/node_modules/browserify/test/json/evil.js b/node_modules/browserify/test/json/evil.js deleted file mode 100644 index 767e9cb27..000000000 --- a/node_modules/browserify/test/json/evil.js +++ /dev/null @@ -1,2 +0,0 @@ -ex(require('./evil-chars.json')); -ex(require('./evil-chars')); diff --git a/node_modules/browserify/test/json/main.js b/node_modules/browserify/test/json/main.js deleted file mode 100644 index f459f30f2..000000000 --- a/node_modules/browserify/test/json/main.js +++ /dev/null @@ -1,2 +0,0 @@ -ex(require('./beep.json')); -ex(require('./beep')); diff --git a/node_modules/browserify/test/leak.js b/node_modules/browserify/test/leak.js deleted file mode 100644 index 06881655d..000000000 --- a/node_modules/browserify/test/leak.js +++ /dev/null @@ -1,59 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; -var path = require('path'); -var through = require('through2'); - -var os = require('os'); -var tmpdir = (os.tmpdir || os.tmpDir)(); -var dir = path.join( - tmpdir, - 'browserify-test-' + Math.random(), - 'aaabbbzzz' -); -var dirstring = dir.split(path.sep).slice(-2).join(path.sep); - -if (!ArrayBuffer.isView) ArrayBuffer.isView = function () { return false; }; - -test('leaking information about system paths (process)', function (t) { - t.plan(4); - - var b = browserify({ basedir: dir }); - var stream = through(); - stream.push('process.nextTick(function () {' - + 't.ok(true)' - + '})' - ); - stream.push(null); - b.add(stream); - - b.bundle(function (err, buf) { - var src = buf.toString('utf8'); - t.equal(src.indexOf(dirstring), -1, 'temp directory visible'); - t.equal(src.indexOf(process.cwd()), -1, 'cwd directory visible'); - t.equal(src.indexOf('/home'), -1, 'home directory visible'); - vm.runInNewContext(src, { - t: t, - setTimeout: setTimeout, - clearTimeout: clearTimeout - }); - }); -}); - -test('leaking information about system paths (Buffer)', function (t) { - t.plan(4); - - var b = browserify({ basedir: dir }); - var stream = through(); - stream.push('t.equal(Buffer("eHl6", "base64").toString(), "xyz")'); - stream.push(null); - b.add(stream); - - b.bundle(function (err, buf) { - var src = buf.toString('utf8'); - t.equal(src.indexOf(dirstring), -1, 'temp directory visible'); - t.equal(src.indexOf(process.cwd()), -1, 'cwd directory visible'); - t.equal(src.indexOf('/home'), -1, 'home directory visible'); - vm.runInNewContext(src, { t: t, setTimeout: setTimeout, Uint8Array: Uint8Array, ArrayBuffer: ArrayBuffer }); - }); -}); diff --git a/node_modules/browserify/test/maxlisteners.js b/node_modules/browserify/test/maxlisteners.js deleted file mode 100644 index 11cfd825c..000000000 --- a/node_modules/browserify/test/maxlisteners.js +++ /dev/null @@ -1,13 +0,0 @@ -var test = require('tap').test; -var browserify = require('../'); -var vm = require('vm'); - -test('setMaxListener', function (t) { - t.plan(1); - var b = browserify(); - b.add(__dirname + '/maxlisteners/main.js'); - b.bundle(function (err, src) { - vm.runInNewContext(src); - t.ok(true); // didn't crash - }); -}); diff --git a/node_modules/browserify/test/maxlisteners/main.js b/node_modules/browserify/test/maxlisteners/main.js deleted file mode 100644 index a5496a613..000000000 --- a/node_modules/browserify/test/maxlisteners/main.js +++ /dev/null @@ -1,3 +0,0 @@ -var EventEmitter = require('events').EventEmitter -var ee = new EventEmitter; -ee.setMaxListeners(5); diff --git a/node_modules/browserify/test/multi_bundle.js b/node_modules/browserify/test/multi_bundle.js deleted file mode 100644 index 05411d328..000000000 --- a/node_modules/browserify/test/multi_bundle.js +++ /dev/null @@ -1,86 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('multi bundle', function (t) { - t.plan(5); - - var core = browserify(); - core.require(__dirname + '/multi_bundle/b.js', { expose: true }); - - var app = browserify([__dirname + '/multi_bundle/a.js']); - // inform this bundle that b exists in another bundle - app.external(__dirname + '/multi_bundle/b.js'); - - core.bundle(function (err, src) { - var c = { - console: console, - t : t, - baton: { - times: 0 - } - }; - - // loading core will cause no require to run - vm.runInNewContext(src, c); - t.equal(c.baton.times, 0); - - // loading the app will require - app.bundle(function (err, src) { - vm.runInNewContext(src, c); - - // b required for the first time - t.equal(c.baton.times, 1); - - // running the file again - // because it is using the same b, no reloading - vm.runInNewContext(src, c); - - // b should not have been required again - // because it was part of the core bundle - t.equal(c.baton.times, 1); - }); - }); -}); - -// re-enable this in future releases -test('multi bundle', function (t) { - t.plan(8); - - var core = browserify({ exposeAll: true }); - core.require(__dirname + '/multi_bundle/a.js', { expose: true }); - - var app = browserify([__dirname + '/multi_bundle/c.js']); - // inform this bundle that b exists in another bundle - app.external(core); - - core.bundle(function (err, src) { - var c = { - console: console, - t : t, - baton: { - times: 0 - } - }; - - // loading core will cause no require to run - vm.runInNewContext(src, c); - t.equal(c.baton.times, 0); - - // loading the app will require - app.bundle(function (err, src) { - vm.runInNewContext(src, c); - - // b required for the first time - t.equal(c.baton.times, 1); - - // running the file again - // because it is using the same b, no reloading - vm.runInNewContext(src, c); - - // b should not have been required again - // because it was part of the core bundle - t.equal(c.baton.times, 1); - }); - }); -}); diff --git a/node_modules/browserify/test/multi_bundle/_prelude.js b/node_modules/browserify/test/multi_bundle/_prelude.js deleted file mode 100644 index 95eb4bc84..000000000 --- a/node_modules/browserify/test/multi_bundle/_prelude.js +++ /dev/null @@ -1 +0,0 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof unique_require=="function"&&unique_require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof unique_require=="function"&&unique_require;for(var o=0;o -1, 'should contain full entry path'); - } - }); - - b.bundle(function (err, src) { - var c = { - times : 0, - t : t - }; - vm.runInNewContext(src, c); - }); -}); - -test('multi entry relative', function (t) { - t.plan(6); - - var rTestFiles = testFiles.map(function(x) { - return x.replace(__dirname + '/', ''); - }); - - var b = browserify({ - entries: [rTestFiles[0], rTestFiles[1]], - basedir: __dirname - }); - b.add(rTestFiles[2]); - - b.on('dep', function(row) { - if (row.entry) { - t.ok(testFiles.indexOf(row.file) > -1, 'should contain full entry path'); - } - }); - - b.bundle(function (err, src) { - var c = { - times : 0, - t : t - }; - vm.runInNewContext(src, c); - }); -}); - -test('multi entry relative cwd', function (t) { - t.plan(6); - - var rTestFiles = testFiles.map(function(x) { - return x.replace(__dirname + '/', './'); - }); - - var b = browserify({ - entries: [rTestFiles[0], rTestFiles[1]], - basedir: __dirname - }); - b.add(rTestFiles[2]); - - b.on('dep', function(row) { - if (row.entry) { - t.ok(testFiles.indexOf(row.file) > -1, 'should contain full entry path'); - } - }); - - b.bundle(function (err, src) { - var c = { - times : 0, - t : t - }; - vm.runInNewContext(src, c); - }); -}); - -test('entries as streams', function (t) { - t.plan(6); - - // commondir blows up with streams and without basedir - var opts = { basedir: __dirname + '/multi_entry' }; - - var b = browserify([ - fs.createReadStream(testFiles[0]), - fs.createReadStream(testFiles[1]) - ], opts); - b.add(fs.createReadStream(testFiles[2])); - - b.on('dep', function(row) { - if (row.entry) { - t.similar( - row.file, - RegExp(path.join(__dirname, 'multi_entry/_stream_').replace(/\\/g, '\\\\') + '[\\d].js'), - 'should be full entry path' - ); - } - }); - - b.bundle(function (err, src) { - var c = { - times : 0, - t : t - }; - vm.runInNewContext(src, c); - }); -}); diff --git a/node_modules/browserify/test/multi_entry/a.js b/node_modules/browserify/test/multi_entry/a.js deleted file mode 100644 index d4e250ee9..000000000 --- a/node_modules/browserify/test/multi_entry/a.js +++ /dev/null @@ -1,2 +0,0 @@ -times ++; -t.equal(times, 1); diff --git a/node_modules/browserify/test/multi_entry/b.js b/node_modules/browserify/test/multi_entry/b.js deleted file mode 100644 index bed7bbbaf..000000000 --- a/node_modules/browserify/test/multi_entry/b.js +++ /dev/null @@ -1,2 +0,0 @@ -times ++; -t.equal(times, 2); diff --git a/node_modules/browserify/test/multi_entry/c.js b/node_modules/browserify/test/multi_entry/c.js deleted file mode 100644 index ac3c174da..000000000 --- a/node_modules/browserify/test/multi_entry/c.js +++ /dev/null @@ -1,2 +0,0 @@ -times ++; -t.equal(times, 3); diff --git a/node_modules/browserify/test/multi_entry_cross_require.js b/node_modules/browserify/test/multi_entry_cross_require.js deleted file mode 100644 index 43f04ea51..000000000 --- a/node_modules/browserify/test/multi_entry_cross_require.js +++ /dev/null @@ -1,93 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var path = require('path'); -var test = require('tap').test; - -var testFiles = [ - path.join(__dirname, 'multi_entry_cross_require/a.js'), - path.join(__dirname, 'multi_entry_cross_require/lib/b.js'), - path.join(__dirname, 'multi_entry_cross_require/c.js') -]; - -test('multi entry cross require', function (t) { - t.plan(8); - - var b = browserify([ - testFiles[0], - testFiles[1] - ]); - b.add(testFiles[2]); - - b.on('dep', function(row) { - if (row.entry) { - t.ok(testFiles.indexOf(row.file) > -1, 'should contain full entry path'); - } - }); - - b.bundle(function (err, src) { - if (err) throw err; - var c = { - times : 0, - t : t - }; - vm.runInNewContext(src, c); - }); -}); - -test('multi entry cross require - relative cwd', function (t) { - t.plan(8); - - var dsTestFiles = testFiles.map(function(x) { - return x.replace(__dirname + '/', './'); - }); - - var b = browserify({ - entries: [dsTestFiles[0], dsTestFiles[1]], - basedir: __dirname - }); - b.add(dsTestFiles[2]); - - b.on('dep', function(row) { - if (row.entry) { - t.ok(testFiles.indexOf(row.file) > -1, 'should contain full entry path'); - } - }); - - b.bundle(function (err, src) { - if (err) throw err; - var c = { - times : 0, - t : t - }; - vm.runInNewContext(src, c); - }); -}); - -test('multi entry cross require - relative', function (t) { - t.plan(8); - - var rTestFiles = testFiles.map(function(x) { - return x.replace(__dirname + '/', ''); - }); - - var b = browserify({ - entries: [rTestFiles[0], rTestFiles[1]], - basedir: __dirname - }); - b.add(rTestFiles[2]); - - b.on('dep', function(row) { - if (row.entry) { - t.ok(testFiles.indexOf(row.file) > -1, 'should contain full entry path'); - } - }); - - b.bundle(function (err, src) { - if (err) throw err; - var c = { - times : 0, - t : t - }; - vm.runInNewContext(src, c); - }); -}); diff --git a/node_modules/browserify/test/multi_entry_cross_require/a.js b/node_modules/browserify/test/multi_entry_cross_require/a.js deleted file mode 100644 index 0223dafc0..000000000 --- a/node_modules/browserify/test/multi_entry_cross_require/a.js +++ /dev/null @@ -1,8 +0,0 @@ -times ++; -t.equal(times, 1); - -var b = require('./lib/b'); -t.equal(times, 2); - -b.foo(); -t.equal(times, 3); diff --git a/node_modules/browserify/test/multi_entry_cross_require/c.js b/node_modules/browserify/test/multi_entry_cross_require/c.js deleted file mode 100644 index e1918384b..000000000 --- a/node_modules/browserify/test/multi_entry_cross_require/c.js +++ /dev/null @@ -1,7 +0,0 @@ -times++; -t.equal(times, 4); - -var b = require('./lib/b'); -b.foo(); - -t.equal(times, 5); diff --git a/node_modules/browserify/test/multi_entry_cross_require/lib/b.js b/node_modules/browserify/test/multi_entry_cross_require/lib/b.js deleted file mode 100644 index e7d2dad1f..000000000 --- a/node_modules/browserify/test/multi_entry_cross_require/lib/b.js +++ /dev/null @@ -1,5 +0,0 @@ -times++; - -module.exports.foo = function() { - times++; -}; diff --git a/node_modules/browserify/test/multi_require.js b/node_modules/browserify/test/multi_require.js deleted file mode 100644 index a1b3f64e1..000000000 --- a/node_modules/browserify/test/multi_require.js +++ /dev/null @@ -1,18 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; -var vm = require('vm'); - -test('require same file locally and globally', function (t) { - t.plan(2); - - var b = browserify(__dirname + '/multi_require/main.js', { - basedir: __dirname - }); - b.require('./multi_require/a.js', {expose: 'a'}); - - b.bundle(function (err, src) { - t.ifError(err); - var c = {t: t}; - vm.runInNewContext(src, c); - }); -}); diff --git a/node_modules/browserify/test/multi_require/a.js b/node_modules/browserify/test/multi_require/a.js deleted file mode 100644 index 18dea6747..000000000 --- a/node_modules/browserify/test/multi_require/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function() { - return 'a'; -} diff --git a/node_modules/browserify/test/multi_require/main.js b/node_modules/browserify/test/multi_require/main.js deleted file mode 100644 index 6f548ec96..000000000 --- a/node_modules/browserify/test/multi_require/main.js +++ /dev/null @@ -1,4 +0,0 @@ -var localA = require('./a.js'); -var globalA = require('a'); - -t.equal(localA, globalA); diff --git a/node_modules/browserify/test/multi_symlink.js b/node_modules/browserify/test/multi_symlink.js deleted file mode 100644 index 08a5b1dd6..000000000 --- a/node_modules/browserify/test/multi_symlink.js +++ /dev/null @@ -1,13 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('multiple symlink execution', { skip: process.platform === 'win32' }, function (t) { - t.plan(1); - var b = browserify(__dirname + '/multi_symlink/main.js'); - b.bundle(function (err, src) { - var c = { console: { log: log } }; - vm.runInNewContext(src, c); - function log (msg) { t.equal(msg, 'X') } - }); -}); diff --git a/node_modules/browserify/test/multi_symlink/main.js b/node_modules/browserify/test/multi_symlink/main.js deleted file mode 100644 index 0f904dc91..000000000 --- a/node_modules/browserify/test/multi_symlink/main.js +++ /dev/null @@ -1,2 +0,0 @@ -require('./x.js'); -require('./y.js'); diff --git a/node_modules/browserify/test/multi_symlink/x.js b/node_modules/browserify/test/multi_symlink/x.js deleted file mode 100644 index e894542cb..000000000 --- a/node_modules/browserify/test/multi_symlink/x.js +++ /dev/null @@ -1 +0,0 @@ -console.log('X'); diff --git a/node_modules/browserify/test/no_builtins.js b/node_modules/browserify/test/no_builtins.js deleted file mode 100644 index 4a25c93f2..000000000 --- a/node_modules/browserify/test/no_builtins.js +++ /dev/null @@ -1,66 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; -var path = require('path'); -var vm = require('vm'); - -test('builtins false', function (t) { - t.plan(1); - - var file = __dirname + '/no_builtins/main.js'; - var b = browserify({ - entries: [ file ], - commondir: false, - builtins: false - }); - b.bundle(function (err, src) { - var c = { - console: { log: function (msg) { - t.equal(msg, 'beep boop\n'); - } }, - require: require, - __dirname: process.cwd() - }; - vm.runInNewContext(src, c); - }); -}); - -test('builtins []', function (t) { - t.plan(1); - var b = browserify({ - entries: [ __dirname + '/no_builtins/main.js' ], - commondir: false, - builtins: [] - }); - b.bundle(function (err, src) { - var c = { - console: { log: function (msg) { - t.equal(msg, 'beep boop\n'); - } }, - require: require - }; - vm.runInNewContext(src, c); - }); -}); - -test('builtins object', function (t) { - t.plan(2); - var b = browserify({ - entries: [ __dirname + '/no_builtins/main.js' ], - commondir: false, - builtins: { - fs: require.resolve('./no_builtins/extra/fs.js'), - tls: require.resolve('./no_builtins/extra/tls.js') - } - }); - var expected = [ - 'WRITE CODE EVERY DAY', - 'WHATEVER' - ]; - b.bundle(function (err, src) { - var c = { console: { log: log }, require: require }; - function log (msg) { - t.equal(msg, expected.shift()); - } - vm.runInNewContext(src, c); - }); -}); diff --git a/node_modules/browserify/test/no_builtins/extra/fs.js b/node_modules/browserify/test/no_builtins/extra/fs.js deleted file mode 100644 index b8bdd44e2..000000000 --- a/node_modules/browserify/test/no_builtins/extra/fs.js +++ /dev/null @@ -1 +0,0 @@ -exports.readFileSync = function () { return 'WHATEVER' }; diff --git a/node_modules/browserify/test/no_builtins/extra/tls.js b/node_modules/browserify/test/no_builtins/extra/tls.js deleted file mode 100644 index ceea2a64a..000000000 --- a/node_modules/browserify/test/no_builtins/extra/tls.js +++ /dev/null @@ -1 +0,0 @@ -console.log('WRITE CODE EVERY DAY'); diff --git a/node_modules/browserify/test/no_builtins/main.js b/node_modules/browserify/test/no_builtins/main.js deleted file mode 100644 index f2dadc653..000000000 --- a/node_modules/browserify/test/no_builtins/main.js +++ /dev/null @@ -1,4 +0,0 @@ -var fs = require('fs'); -var tls = require('tls'); - -console.log(fs.readFileSync(__dirname + '/x.txt', 'utf8')); diff --git a/node_modules/browserify/test/no_builtins/x.txt b/node_modules/browserify/test/no_builtins/x.txt deleted file mode 100644 index fae06e349..000000000 --- a/node_modules/browserify/test/no_builtins/x.txt +++ /dev/null @@ -1 +0,0 @@ -beep boop diff --git a/node_modules/browserify/test/node_modules/beep/index.js b/node_modules/browserify/test/node_modules/beep/index.js deleted file mode 100644 index 2d3c19425..000000000 --- a/node_modules/browserify/test/node_modules/beep/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'boop' diff --git a/node_modules/browserify/test/node_modules/plugin-foo/index.js b/node_modules/browserify/test/node_modules/plugin-foo/index.js deleted file mode 100644 index a2dde3e7e..000000000 --- a/node_modules/browserify/test/node_modules/plugin-foo/index.js +++ /dev/null @@ -1,9 +0,0 @@ -var through = require('through2'); - -module.exports = function (b, opts) { - var stream = through(function () {}, function () {}); - stream.push(opts.msg); - stream.push(null); - - b.pipeline.get('wrap').splice(0,1,stream); -}; diff --git a/node_modules/browserify/test/node_modules/tr/index.js b/node_modules/browserify/test/node_modules/tr/index.js deleted file mode 100644 index b3c484f22..000000000 --- a/node_modules/browserify/test/node_modules/tr/index.js +++ /dev/null @@ -1,8 +0,0 @@ -var through = require('through2'); - -module.exports = function () { - return through(function (buf, enc, next) { - this.push(buf.toString('utf8').replace(/X/g, 'Z')); - next(); - }); -}; diff --git a/node_modules/browserify/test/noparse.js b/node_modules/browserify/test/noparse.js deleted file mode 100644 index ddb024df1..000000000 --- a/node_modules/browserify/test/noparse.js +++ /dev/null @@ -1,31 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; -var path = require('path'); - -test('noParse array', function (t) { - process.chdir(__dirname); - - t.plan(2); - - var actual = []; - var expected = [ - 'noparse/a.js', - 'noparse/b.js', - 'noparse/dir1/1.js', - 'noparse/node_modules/robot/main.js' - ].map(function (x) {return path.resolve(x);}).sort(); - - var b = browserify({ - entries: [ __dirname + '/noparse/a.js' ], - noParse: [ - path.join(__dirname, 'noparse/dir1/1.js'), - path.join(__dirname, 'noparse/node_modules/robot/main.js') - ] - }); - b.on('dep', function(dep) { actual.push(dep.file); }); - b.bundle(function (err, src) { - actual.sort(); - t.ifError(err); - t.deepEqual(actual, expected); - }); -}); diff --git a/node_modules/browserify/test/noparse/a.js b/node_modules/browserify/test/noparse/a.js deleted file mode 100644 index 076812a66..000000000 --- a/node_modules/browserify/test/noparse/a.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - a: true, - b: require('./b') -}; diff --git a/node_modules/browserify/test/noparse/b.js b/node_modules/browserify/test/noparse/b.js deleted file mode 100644 index de0ba559a..000000000 --- a/node_modules/browserify/test/noparse/b.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - b: true, - 1: require('./dir1/1'), - robot: require('robot') -}; diff --git a/node_modules/browserify/test/noparse/dir1/1.js b/node_modules/browserify/test/noparse/dir1/1.js deleted file mode 100644 index 960968b0b..000000000 --- a/node_modules/browserify/test/noparse/dir1/1.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - 1: true, - 2: require('./dir2/2') -}; diff --git a/node_modules/browserify/test/noparse/dir1/dir2/2.js b/node_modules/browserify/test/noparse/dir1/dir2/2.js deleted file mode 100644 index ef4ba1962..000000000 --- a/node_modules/browserify/test/noparse/dir1/dir2/2.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - 2: true -}; diff --git a/node_modules/browserify/test/noparse/node_modules/robot/lib/beep.js b/node_modules/browserify/test/noparse/node_modules/robot/lib/beep.js deleted file mode 100644 index 6529dd85c..000000000 --- a/node_modules/browserify/test/noparse/node_modules/robot/lib/beep.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - beep: true, - boop: require('./boop') -}; diff --git a/node_modules/browserify/test/noparse/node_modules/robot/lib/boop.js b/node_modules/browserify/test/noparse/node_modules/robot/lib/boop.js deleted file mode 100644 index 696a67245..000000000 --- a/node_modules/browserify/test/noparse/node_modules/robot/lib/boop.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - boop: true -}; diff --git a/node_modules/browserify/test/noparse/node_modules/robot/main.js b/node_modules/browserify/test/noparse/node_modules/robot/main.js deleted file mode 100644 index 87af6096a..000000000 --- a/node_modules/browserify/test/noparse/node_modules/robot/main.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - robot: true, - beep: require('./lib/beep') -}; diff --git a/node_modules/browserify/test/noparse/node_modules/robot/package.json b/node_modules/browserify/test/noparse/node_modules/robot/package.json deleted file mode 100644 index c13b8cf6a..000000000 --- a/node_modules/browserify/test/noparse/node_modules/robot/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "main.js" -} diff --git a/node_modules/browserify/test/pack.js b/node_modules/browserify/test/pack.js deleted file mode 100644 index 68a6e2c69..000000000 --- a/node_modules/browserify/test/pack.js +++ /dev/null @@ -1,33 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var through = require('through2'); -var test = require('tap').test; - -var fs = require('fs'); -var sources = { - 1: fs.readFileSync(__dirname + '/entry/main.js', 'utf8'), - 2: fs.readFileSync(__dirname + '/entry/one.js', 'utf8'), - 3: fs.readFileSync(__dirname + '/entry/two.js', 'utf8') -}; - -var deps = { - 1: { './two': 3, './one': 2 }, - 2: {}, - 3: {} -}; - -test('custom packer', function (t) { - t.plan(7); - - var b = browserify(__dirname + '/entry/main.js'); - b.pipeline.get('pack').splice(0,1, through.obj(function (row, enc, next) { - t.equal(sources[row.id], row.source); - t.deepEqual(deps[row.id], row.deps); - this.push(row.id + '\n'); - next(); - })); - b.pipeline.get('wrap').splice(0); - b.bundle(function (err, src) { - t.equal(src.toString('utf8'), '1\n2\n3\n'); - }); -}); diff --git a/node_modules/browserify/test/paths.js b/node_modules/browserify/test/paths.js deleted file mode 100644 index c3d5728fa..000000000 --- a/node_modules/browserify/test/paths.js +++ /dev/null @@ -1,32 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('$NODE_PATHS', function (t) { - t.plan(3); - var paths = [ __dirname + '/paths/x', __dirname + '/paths/y' ]; - var sep = /^win/i.test(process.platform) ? ';' : ':'; - - process.env.NODE_PATH = (process.env.NODE_PATHS || '') - .split(sep).concat(paths).join(sep) - ; - - var b = browserify(__dirname + '/paths/main.js'); - b.bundle(function (err, src) { - if (err) t.fail(err); - vm.runInNewContext(src, { t: t }); - }); -}); - -test('opts.paths', function (t) { - t.plan(3); - - var b = browserify({ - paths: [ __dirname + '/paths/x', __dirname + '/paths/y' ], - entries: __dirname + '/paths/main.js' - }); - b.bundle(function (err, src) { - if (err) t.fail(err); - vm.runInNewContext(src, { t: t }); - }); -}); diff --git a/node_modules/browserify/test/paths/main.js b/node_modules/browserify/test/paths/main.js deleted file mode 100644 index ec0d8a18d..000000000 --- a/node_modules/browserify/test/paths/main.js +++ /dev/null @@ -1,3 +0,0 @@ -t.equal(require('aaa'), 'AX'); -t.equal(require('bbb'), 'BY'); -t.equal(require('ccc'), 'CX'); diff --git a/node_modules/browserify/test/paths/x/aaa/index.js b/node_modules/browserify/test/paths/x/aaa/index.js deleted file mode 100644 index b76ce87ec..000000000 --- a/node_modules/browserify/test/paths/x/aaa/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'AX' diff --git a/node_modules/browserify/test/paths/x/ccc/index.js b/node_modules/browserify/test/paths/x/ccc/index.js deleted file mode 100644 index 882058e33..000000000 --- a/node_modules/browserify/test/paths/x/ccc/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'CX' diff --git a/node_modules/browserify/test/paths/y/bbb/index.js b/node_modules/browserify/test/paths/y/bbb/index.js deleted file mode 100644 index 5dbca4475..000000000 --- a/node_modules/browserify/test/paths/y/bbb/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'BY' diff --git a/node_modules/browserify/test/paths/y/ccc/index.js b/node_modules/browserify/test/paths/y/ccc/index.js deleted file mode 100644 index d0043d1ec..000000000 --- a/node_modules/browserify/test/paths/y/ccc/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'CY' diff --git a/node_modules/browserify/test/paths_transform.js b/node_modules/browserify/test/paths_transform.js deleted file mode 100644 index bd0607052..000000000 --- a/node_modules/browserify/test/paths_transform.js +++ /dev/null @@ -1,76 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -function ensureTransform(t, buf) { - var srcAsString = (buf||'').toString('utf-8'), - containsAX = srcAsString.indexOf('AX') > -1, - containsAZ = srcAsString.indexOf('AZ') > -1; - t.notOk(containsAX,"should not contain AX's"); - t.ok(containsAZ,"should contain AZ's"); -} - -test('absolute paths with transform property', function (t) { - t.plan(6); - - var b = browserify({ - transform: ['tr'], - basedir: __dirname, - paths: [ __dirname + '/paths/x', __dirname + '/paths/y' ], - entries: __dirname + '/paths/main.js' - }); - b.bundle(function (err, src) { - t.ifError(err); - ensureTransform(t,src); - vm.runInNewContext(src, { t: t }); - }); -}); - -test('relative paths with transform property', function (t) { - t.plan(6); - - var b = browserify({ - transform: ['tr'], - basedir: __dirname, - paths: [ './paths/x', './paths/y' ], - entries: __dirname + '/paths/main.js' - }); - b.bundle(function (err, src) { - t.ifError(err); - ensureTransform(t,src); - vm.runInNewContext(src, { t: t }); - }); -}); - - -test('absolute paths with transform method', function (t) { - t.plan(6); - - var b = browserify({ - basedir: __dirname, - paths: [ __dirname + '/paths/x', __dirname + '/paths/y' ], - entries: __dirname + '/paths/main.js' - }); - b.transform('tr'); - b.bundle(function (err, src) { - t.ifError(err); - ensureTransform(t,src); - vm.runInNewContext(src, { t: t }); - }); -}); - - -test('relative paths with transform method', function (t) { - t.plan(6); - var b = browserify({ - basedir: __dirname, - paths: ['./paths/x', './paths/y' ], - entries: __dirname + '/paths/main.js' - }); - b.transform('tr'); - b.bundle(function (err, src) { - t.ifError(err); - ensureTransform(t,src); - vm.runInNewContext(src, { t: t }); - }); -}); diff --git a/node_modules/browserify/test/pipeline_deps.js b/node_modules/browserify/test/pipeline_deps.js deleted file mode 100644 index 8f847a755..000000000 --- a/node_modules/browserify/test/pipeline_deps.js +++ /dev/null @@ -1,22 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; -var through = require('through2'); - -test('deps pipeline', function (t) { - t.plan(1); - - var b = browserify(__dirname + '/pipeline_deps/main.js'); - b.pipeline.get('deps').push(through.obj(function (row, enc, next) { - row.source = row.source.replace(/111/g, '11111'); - this.push(row); - next(); - })); - - b.bundle(function (err, src) { - Function([ 'console' ], src)({ log: log }); - function log (msg) { - t.equal(msg, 'main: 56055'); - } - }); -}); diff --git a/node_modules/browserify/test/pipeline_deps/bar.js b/node_modules/browserify/test/pipeline_deps/bar.js deleted file mode 100644 index c57fa530a..000000000 --- a/node_modules/browserify/test/pipeline_deps/bar.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function (n) { - return n * 100; -}; diff --git a/node_modules/browserify/test/pipeline_deps/foo.js b/node_modules/browserify/test/pipeline_deps/foo.js deleted file mode 100644 index c62e63856..000000000 --- a/node_modules/browserify/test/pipeline_deps/foo.js +++ /dev/null @@ -1,5 +0,0 @@ -var bar = require('./bar'); - -module.exports = function (n) { - return n * 111 + bar(n); -}; diff --git a/node_modules/browserify/test/pipeline_deps/main.js b/node_modules/browserify/test/pipeline_deps/main.js deleted file mode 100644 index 8c71d7997..000000000 --- a/node_modules/browserify/test/pipeline_deps/main.js +++ /dev/null @@ -1,2 +0,0 @@ -var foo = require('./foo'); -console.log('main: ' + foo(5)); diff --git a/node_modules/browserify/test/pipeline_deps/xyz.js b/node_modules/browserify/test/pipeline_deps/xyz.js deleted file mode 100644 index dff6877a8..000000000 --- a/node_modules/browserify/test/pipeline_deps/xyz.js +++ /dev/null @@ -1,2 +0,0 @@ -var foo = require('./foo'); -console.log('xyz: ' + foo(6)); diff --git a/node_modules/browserify/test/pkg.js b/node_modules/browserify/test/pkg.js deleted file mode 100644 index 753e6d8c0..000000000 --- a/node_modules/browserify/test/pkg.js +++ /dev/null @@ -1,20 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; -var path = require('path'); - -var pkg = require('./pkg/package.json'); -pkg.__dirname = path.join(__dirname, 'pkg'); - -test('package', function (t) { - t.plan(2); - - var b = browserify(__dirname + '/pkg/main.js'); - b.on('package', function (pkg_) { - t.deepEqual(pkg_, pkg); - }); - - b.bundle(function (err) { - t.ifError(err); - }); -}); diff --git a/node_modules/browserify/test/pkg/main.js b/node_modules/browserify/test/pkg/main.js deleted file mode 100644 index 07a8fbf2c..000000000 --- a/node_modules/browserify/test/pkg/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log(555) diff --git a/node_modules/browserify/test/pkg/package.json b/node_modules/browserify/test/pkg/package.json deleted file mode 100644 index cc806a70a..000000000 --- a/node_modules/browserify/test/pkg/package.json +++ /dev/null @@ -1 +0,0 @@ -{ "beep": "boop" } diff --git a/node_modules/browserify/test/pkg_event.js b/node_modules/browserify/test/pkg_event.js deleted file mode 100644 index 77ada96bf..000000000 --- a/node_modules/browserify/test/pkg_event.js +++ /dev/null @@ -1,31 +0,0 @@ -var browserify = require('../'); -var path = require('path'); -var vm = require('vm'); -var test = require('tap').test; - -var expected = [ - readpkg('pkg_event'), - readpkg('pkg_event/node_modules/aaa'), - readpkg('pkg_event/node_modules/aaa/lib') -]; - -test('package event', function (t) { - t.plan(2 + expected.length); - - var b = browserify(__dirname + '/pkg_event/main.js'); - b.on('package', function (pkg) { - t.deepEqual(pkg, expected.shift()); - }); - - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src, { console: { log: log } }); - function log (msg) { t.equal(msg, 555) } - }); -}); - -function readpkg (dir) { - var pkg = require(path.join(__dirname, dir, 'package.json')); - pkg.__dirname = path.join(__dirname, dir); - return pkg; -} diff --git a/node_modules/browserify/test/pkg_event/main.js b/node_modules/browserify/test/pkg_event/main.js deleted file mode 100644 index bef366aec..000000000 --- a/node_modules/browserify/test/pkg_event/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log(require('aaa')) diff --git a/node_modules/browserify/test/pkg_event/node_modules/aaa/lib/butts.js b/node_modules/browserify/test/pkg_event/node_modules/aaa/lib/butts.js deleted file mode 100644 index f4e8d9d29..000000000 --- a/node_modules/browserify/test/pkg_event/node_modules/aaa/lib/butts.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 5; diff --git a/node_modules/browserify/test/pkg_event/node_modules/aaa/lib/package.json b/node_modules/browserify/test/pkg_event/node_modules/aaa/lib/package.json deleted file mode 100644 index b47402f55..000000000 --- a/node_modules/browserify/test/pkg_event/node_modules/aaa/lib/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "aaa-lib", - "main": "woo.js" -} diff --git a/node_modules/browserify/test/pkg_event/node_modules/aaa/lib/woo.js b/node_modules/browserify/test/pkg_event/node_modules/aaa/lib/woo.js deleted file mode 100644 index 82cef514e..000000000 --- a/node_modules/browserify/test/pkg_event/node_modules/aaa/lib/woo.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./butts.js'); diff --git a/node_modules/browserify/test/pkg_event/node_modules/aaa/main.js b/node_modules/browserify/test/pkg_event/node_modules/aaa/main.js deleted file mode 100644 index 822d064da..000000000 --- a/node_modules/browserify/test/pkg_event/node_modules/aaa/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib') * 111; diff --git a/node_modules/browserify/test/pkg_event/node_modules/aaa/package.json b/node_modules/browserify/test/pkg_event/node_modules/aaa/package.json deleted file mode 100644 index e9f2198f4..000000000 --- a/node_modules/browserify/test/pkg_event/node_modules/aaa/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "aaa", - "main": "main.js" -} diff --git a/node_modules/browserify/test/pkg_event/package.json b/node_modules/browserify/test/pkg_event/package.json deleted file mode 100644 index 21d82d8e6..000000000 --- a/node_modules/browserify/test/pkg_event/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "pkg_event" -} diff --git a/node_modules/browserify/test/plugin.js b/node_modules/browserify/test/plugin.js deleted file mode 100644 index be143a3ed..000000000 --- a/node_modules/browserify/test/plugin.js +++ /dev/null @@ -1,28 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('plugin fn', function (t) { - t.plan(2); - - var b = browserify(__dirname + '/plugin/main.js', { basedir: __dirname }); - b.plugin(function (b_) { - t.equal(b, b_); - }); - - b.bundle(function (err, src) { - t.ifError(err); - }); -}); - -test('plugin module', function (t) { - t.plan(2); - - var b = browserify(__dirname + '/plugin/main.js', { basedir: __dirname }); - b.plugin('plugin-foo', { msg: 'beep boop' }); - - b.bundle(function (err, src) { - t.ifError(err); - t.equal(src.toString('utf8'), 'beep boop'); - }); -}); diff --git a/node_modules/browserify/test/plugin/main.js b/node_modules/browserify/test/plugin/main.js deleted file mode 100644 index 3e842e734..000000000 --- a/node_modules/browserify/test/plugin/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 555 diff --git a/node_modules/browserify/test/preserve-symlinks.js b/node_modules/browserify/test/preserve-symlinks.js deleted file mode 100644 index 83940ddc4..000000000 --- a/node_modules/browserify/test/preserve-symlinks.js +++ /dev/null @@ -1,27 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('optionally preserves symlinks', { skip: process.platform === 'win32' }, function (t) { - t.plan(2); - - var b = browserify(__dirname + '/preserve_symlinks/a/index.js', {preserveSymlinks: true}); - b.bundle(function (err, buf) { - t.ifError(err); - t.ok(buf); - var src = buf.toString('utf8'); - vm.runInNewContext(src, {}); - }); -}); - -test('always resolve entry point symlink', { skip: process.platform === 'win32' }, function (t) { - t.plan(2); - - var b = browserify(__dirname + '/preserve_symlinks/linked-entry.js', {preserveSymlinks: true}); - b.bundle(function (err, buf) { - t.ifError(err); - t.ok(buf); - var src = buf.toString('utf8'); - vm.runInNewContext(src, {}); - }); -}) diff --git a/node_modules/browserify/test/preserve_symlinks/a/index.js b/node_modules/browserify/test/preserve_symlinks/a/index.js deleted file mode 100644 index 5f6937c38..000000000 --- a/node_modules/browserify/test/preserve_symlinks/a/index.js +++ /dev/null @@ -1 +0,0 @@ -require('b'); diff --git a/node_modules/browserify/test/preserve_symlinks/a/node_modules/b/index.js b/node_modules/browserify/test/preserve_symlinks/a/node_modules/b/index.js deleted file mode 100644 index a56a50847..000000000 --- a/node_modules/browserify/test/preserve_symlinks/a/node_modules/b/index.js +++ /dev/null @@ -1 +0,0 @@ -require('c'); diff --git a/node_modules/browserify/test/preserve_symlinks/a/node_modules/c/index.js b/node_modules/browserify/test/preserve_symlinks/a/node_modules/c/index.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/browserify/test/preserve_symlinks/b/index.js b/node_modules/browserify/test/preserve_symlinks/b/index.js deleted file mode 100644 index a56a50847..000000000 --- a/node_modules/browserify/test/preserve_symlinks/b/index.js +++ /dev/null @@ -1 +0,0 @@ -require('c'); diff --git a/node_modules/browserify/test/process.js b/node_modules/browserify/test/process.js deleted file mode 100644 index 83ffa14ff..000000000 --- a/node_modules/browserify/test/process.js +++ /dev/null @@ -1,21 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('implicit process global', function (t) { - t.plan(2); - - var b = browserify(__dirname + '/process/main.js'); - b.bundle(function (err, src) { - var c = { - done : function (one, two) { - t.equal(one, 1); - t.equal(two, 2); - t.end(); - }, - setTimeout: setTimeout, - clearTimeout: clearTimeout - }; - vm.runInNewContext(src, c); - }); -}); diff --git a/node_modules/browserify/test/process/main.js b/node_modules/browserify/test/process/main.js deleted file mode 100644 index 089557918..000000000 --- a/node_modules/browserify/test/process/main.js +++ /dev/null @@ -1,3 +0,0 @@ -process.nextTick(function () { - done(require('./one'), require('./two')); -}); diff --git a/node_modules/browserify/test/process/one.js b/node_modules/browserify/test/process/one.js deleted file mode 100644 index bd816eaba..000000000 --- a/node_modules/browserify/test/process/one.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/node_modules/browserify/test/process/two.js b/node_modules/browserify/test/process/two.js deleted file mode 100644 index 4bbffde10..000000000 --- a/node_modules/browserify/test/process/two.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 2; diff --git a/node_modules/browserify/test/quotes.js b/node_modules/browserify/test/quotes.js deleted file mode 100644 index 4c82b7ebe..000000000 --- a/node_modules/browserify/test/quotes.js +++ /dev/null @@ -1,38 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -var hasTemplateLiterals = require('has-template-literals')(); - -test('quotes', function (t) { - t.plan(2); - - var b = browserify(__dirname + '/quotes/main.js'); - b.bundle(function (err, src) { - var c = { - done : function (single, double) { - t.equal(single, 'success', 'single quotes'); - t.equal(double, 'success', 'double quotes'); - t.end(); - } - }; - vm.runInNewContext(src, c); - }); -}); - -test('interpolation literals', { skip: !hasTemplateLiterals }, function (t) { - t.plan(3); - - var b = browserify(__dirname + '/quotes/backtick.js'); - b.bundle(function (err, src) { - var c = { - done : function (single, double, backtick) { - t.equal(single, 'success', 'single quotes'); - t.equal(double, 'success', 'double quotes'); - t.equal(backtick, 'success', 'backtick quotes'); - t.end(); - } - }; - vm.runInNewContext(src, c); - }); -}); diff --git a/node_modules/browserify/test/quotes/backtick.js b/node_modules/browserify/test/quotes/backtick.js deleted file mode 100644 index 7dd85f1f3..000000000 --- a/node_modules/browserify/test/quotes/backtick.js +++ /dev/null @@ -1 +0,0 @@ -done(require('./one.js'), require("./two.js"), require(`./three.js`)); diff --git a/node_modules/browserify/test/quotes/main.js b/node_modules/browserify/test/quotes/main.js deleted file mode 100644 index 327b5826b..000000000 --- a/node_modules/browserify/test/quotes/main.js +++ /dev/null @@ -1 +0,0 @@ -done(require('./one.js'), require("./two.js")); diff --git a/node_modules/browserify/test/quotes/one.js b/node_modules/browserify/test/quotes/one.js deleted file mode 100644 index 52b5cbb33..000000000 --- a/node_modules/browserify/test/quotes/one.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'success'; diff --git a/node_modules/browserify/test/quotes/three.js b/node_modules/browserify/test/quotes/three.js deleted file mode 100644 index 52b5cbb33..000000000 --- a/node_modules/browserify/test/quotes/three.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'success'; diff --git a/node_modules/browserify/test/quotes/two.js b/node_modules/browserify/test/quotes/two.js deleted file mode 100644 index 52b5cbb33..000000000 --- a/node_modules/browserify/test/quotes/two.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'success'; diff --git a/node_modules/browserify/test/relative_dedupe.js b/node_modules/browserify/test/relative_dedupe.js deleted file mode 100644 index 5a4a25250..000000000 --- a/node_modules/browserify/test/relative_dedupe.js +++ /dev/null @@ -1,17 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('relative dedupe', function (t) { - var expected = [ 'a a', 'a b', 'b a', 'b b' ]; - t.plan(expected.length + 1); - - var b = browserify(__dirname + '/relative_dedupe/main.js'); - b.bundle(function (err, src) { - t.ifError(err); - var c = { console: { log: log } }; - vm.runInNewContext(src, c); - }); - - function log (msg) { t.equal(msg, expected.shift()) } -}); diff --git a/node_modules/browserify/test/relative_dedupe/a/a.js b/node_modules/browserify/test/relative_dedupe/a/a.js deleted file mode 100644 index fd6bd9491..000000000 --- a/node_modules/browserify/test/relative_dedupe/a/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function() { - console.log("a a") -}; diff --git a/node_modules/browserify/test/relative_dedupe/a/b.js b/node_modules/browserify/test/relative_dedupe/a/b.js deleted file mode 100644 index 3bdfe50d3..000000000 --- a/node_modules/browserify/test/relative_dedupe/a/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function() { - console.log("a b") -}; diff --git a/node_modules/browserify/test/relative_dedupe/a/index.js b/node_modules/browserify/test/relative_dedupe/a/index.js deleted file mode 100644 index 5002ffcb1..000000000 --- a/node_modules/browserify/test/relative_dedupe/a/index.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - a: require("./a"), - b: require("./b") -}; diff --git a/node_modules/browserify/test/relative_dedupe/b/a.js b/node_modules/browserify/test/relative_dedupe/b/a.js deleted file mode 100644 index eb66e54be..000000000 --- a/node_modules/browserify/test/relative_dedupe/b/a.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function() { - console.log("b a") -}; diff --git a/node_modules/browserify/test/relative_dedupe/b/b.js b/node_modules/browserify/test/relative_dedupe/b/b.js deleted file mode 100644 index 94faa6281..000000000 --- a/node_modules/browserify/test/relative_dedupe/b/b.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function() { - console.log("b b") -}; diff --git a/node_modules/browserify/test/relative_dedupe/b/index.js b/node_modules/browserify/test/relative_dedupe/b/index.js deleted file mode 100644 index 5002ffcb1..000000000 --- a/node_modules/browserify/test/relative_dedupe/b/index.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - a: require("./a"), - b: require("./b") -}; diff --git a/node_modules/browserify/test/relative_dedupe/index.js b/node_modules/browserify/test/relative_dedupe/index.js deleted file mode 100644 index 69ce41bf9..000000000 --- a/node_modules/browserify/test/relative_dedupe/index.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - a: require("./a"), - b: require("./b") -}; diff --git a/node_modules/browserify/test/relative_dedupe/main.js b/node_modules/browserify/test/relative_dedupe/main.js deleted file mode 100644 index deb937044..000000000 --- a/node_modules/browserify/test/relative_dedupe/main.js +++ /dev/null @@ -1,5 +0,0 @@ -var ix = require('./'); -ix.a.a(); -ix.a.b(); -ix.b.a(); -ix.b.b(); diff --git a/node_modules/browserify/test/require_cache.js b/node_modules/browserify/test/require_cache.js deleted file mode 100644 index 871e05500..000000000 --- a/node_modules/browserify/test/require_cache.js +++ /dev/null @@ -1,19 +0,0 @@ -var vm = require('vm'); -var browserify = require('../'); -var test = require('tap').test; - -test('cached require results', function (t) { - t.plan(1); - - var b = browserify(); - b.require('seq'); - b.bundle(function (err, src) { - var c = {}; - vm.runInNewContext(src, c); - - var seq0 = c.require('seq'); - var seq1 = c.require('seq'); - - t.ok(seq0 === seq1); - }); -}); diff --git a/node_modules/browserify/test/require_expose.js b/node_modules/browserify/test/require_expose.js deleted file mode 100644 index 60f9383f4..000000000 --- a/node_modules/browserify/test/require_expose.js +++ /dev/null @@ -1,53 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; -var vm = require('vm'); - -test('require expose external module', function (t) { - t.plan(2); - - var b = browserify({ basedir: __dirname }); - b.require('beep', { expose: 'bip' }); - b.bundle(function (err, src) { - t.ifError(err); - var c = { }; - vm.runInNewContext(src, c); - t.equal(c.require('bip'), 'boop'); - }) -}); - -test('renaming builtin', function (t) { - t.plan(2); - - var b = browserify({ basedir: __dirname }); - b.require('os', { expose: 'bone' }); - b.bundle(function (err, src) { - t.ifError(err); - var c = { }; - vm.runInNewContext(src, c); - t.equal(c.require('bone').platform(), 'browser'); - }) -}); - -test('exposed modules do not leak across bundles', function (t) { - var bundle1, bundle2; - - bundle1 = browserify(); - bundle1.add(__dirname + '/require_expose/main.js'); - bundle1.require(__dirname + '/require_expose/some_dep.js', { expose: 'foo' }); - - bundle1.bundle(function (err, src) { - if (err) t.fail(err); - - var c = {}; - vm.runInNewContext(src, c); - t.equal(c.foo, 'some_dep'); - - bundle2 = browserify(); - bundle2.add(__dirname + '/require_expose/main.js'); - - bundle2.bundle(function (err) { - t.ok(err && err.message.match(/Cannot find module 'foo'/), 'should fail with missing module'); - t.end(); - }); - }); -}); diff --git a/node_modules/browserify/test/require_expose/main.js b/node_modules/browserify/test/require_expose/main.js deleted file mode 100644 index f99908f64..000000000 --- a/node_modules/browserify/test/require_expose/main.js +++ /dev/null @@ -1 +0,0 @@ -foo = require('foo'); diff --git a/node_modules/browserify/test/require_expose/some_dep.js b/node_modules/browserify/test/require_expose/some_dep.js deleted file mode 100644 index 353c90dbf..000000000 --- a/node_modules/browserify/test/require_expose/some_dep.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'some_dep'; diff --git a/node_modules/browserify/test/reset.js b/node_modules/browserify/test/reset.js deleted file mode 100644 index dad18b3af..000000000 --- a/node_modules/browserify/test/reset.js +++ /dev/null @@ -1,31 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('reset', function (t) { - t.plan(4); - - var b = browserify(); - b.require('path'); - b.bundle(function (err, src) { - check(err, src); - b.bundle(function (err, src) { - check(err, src); - }); - }); - - function check (err, src) { - t.ifError(err); - var c = { - setTimeout : setTimeout, - clearTimeout : clearTimeout, - console : console - }; - vm.runInNewContext(src, c); - - t.equal( - c.require('path').join('/a', 'b'), - '/a/b' - ); - } -}); diff --git a/node_modules/browserify/test/resolve_exposed.js b/node_modules/browserify/test/resolve_exposed.js deleted file mode 100644 index 0d3efc24b..000000000 --- a/node_modules/browserify/test/resolve_exposed.js +++ /dev/null @@ -1,20 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('resolve exposed files', function (t) { - t.plan(2); - - var b = browserify(__dirname + '/resolve_exposed/main.js', { - basedir: __dirname + '/resolve_exposed' - }); - b.require('./x.js', { expose: 'xyz' }); - b.bundle(function (err, src) { - t.ifError(err); - var c = { console: { log: log } }; - vm.runInNewContext(src, c); - function log (x) { - t.equal(x, 333); - } - }); -}); diff --git a/node_modules/browserify/test/resolve_exposed/main.js b/node_modules/browserify/test/resolve_exposed/main.js deleted file mode 100644 index 08a137dc7..000000000 --- a/node_modules/browserify/test/resolve_exposed/main.js +++ /dev/null @@ -1,2 +0,0 @@ -var xyz = require('xyz'); -console.log(xyz * 111); diff --git a/node_modules/browserify/test/resolve_exposed/x.js b/node_modules/browserify/test/resolve_exposed/x.js deleted file mode 100644 index 6887896a4..000000000 --- a/node_modules/browserify/test/resolve_exposed/x.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 3 diff --git a/node_modules/browserify/test/retarget.js b/node_modules/browserify/test/retarget.js deleted file mode 100644 index 7670bc098..000000000 --- a/node_modules/browserify/test/retarget.js +++ /dev/null @@ -1,25 +0,0 @@ -var test = require('tap').test; -var spawn = require('child_process').spawn; -var path = require('path'); -var vm = require('vm'); - -test('retarget with -r', function (t) { - t.plan(2); - - var ps = spawn(process.execPath, [ - path.resolve(__dirname, '../bin/cmd.js'), - '-r', 'beep' - ], { cwd: __dirname }); - var src = ''; - ps.stdout.on('data', function (buf) { src += buf }); - ps.stderr.pipe(process.stderr); - - ps.on('exit', function (code) { - t.equal(code, 0); - - var c = {}; - vm.runInNewContext(src, c); - t.equal(c.require('beep'), 'boop'); - }); - ps.stdin.end(); -}); diff --git a/node_modules/browserify/test/reverse_multi_bundle.js b/node_modules/browserify/test/reverse_multi_bundle.js deleted file mode 100644 index 8d9f8325f..000000000 --- a/node_modules/browserify/test/reverse_multi_bundle.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - * To be able to lazy load bundles with script loaders the loaded bundles - * must have access to modules exposed by previous bundles. - * - * In effect this is the same as adding the bundles in reverse order - **/ - -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('reverse multi bundle', function (t) { - t.plan(5); - - // Main app bundle has the main app code and the shared libarary code - var app = browserify([__dirname + '/reverse_multi_bundle/app.js']) - .external(__dirname + '/reverse_multi_bundle/lazy.js') - .require(__dirname + '/reverse_multi_bundle/shared.js', { expose: true }) - .require(__dirname + '/reverse_multi_bundle/arbitrary.js', {expose: 'not/real'}); - - // Lazily loaded bundle has only its own code even it uses code from the - // shared library. - var lazy = browserify({ - filter: function (id) { - return id !== 'not/real'; - } - }) - .require(__dirname + '/reverse_multi_bundle/lazy.js', { expose: true }) - .external(__dirname + '/reverse_multi_bundle/shared.js') - .external('not/real'); - - - app.bundle(function (err, appSrc) { - if (err) throw err; - lazy.bundle(function(err, lazySrc) { - if (err) throw err; - - var src = appSrc + ';' + lazySrc; - var c = { - setTimeout: setTimeout, - clearTimeout: clearTimeout, - t: t - }; - vm.runInNewContext(src, c); - }); - }); -}); diff --git a/node_modules/browserify/test/reverse_multi_bundle/app.js b/node_modules/browserify/test/reverse_multi_bundle/app.js deleted file mode 100644 index ab6b10147..000000000 --- a/node_modules/browserify/test/reverse_multi_bundle/app.js +++ /dev/null @@ -1,22 +0,0 @@ - -t.equal( - require("./shared")(), 1, - "the main app bundle can already use the shared library" -); - -t.throws(function() { - require("./lazy"); -}, "lazy bundle is not executed yet so the lazy module cannot be required yet"); - -// Use setTimeout as script loader simulator as in real use case this would be -// a call to one. Now we just let the rest of the source code string we build -// to execute. -setTimeout(function() { - // After lazy bundle is executed we can require the lazy.js module - require("./lazy"); - t.equal( - require("./shared")(),3, - "lazy module was able to use shared code" - ); -}, 1); - diff --git a/node_modules/browserify/test/reverse_multi_bundle/arbitrary.js b/node_modules/browserify/test/reverse_multi_bundle/arbitrary.js deleted file mode 100644 index ba7d87215..000000000 --- a/node_modules/browserify/test/reverse_multi_bundle/arbitrary.js +++ /dev/null @@ -1,6 +0,0 @@ -var i = 0; -module.exports = function() { - return ++i; -}; - -// 175e62 diff --git a/node_modules/browserify/test/reverse_multi_bundle/lazy.js b/node_modules/browserify/test/reverse_multi_bundle/lazy.js deleted file mode 100644 index 012cdeb73..000000000 --- a/node_modules/browserify/test/reverse_multi_bundle/lazy.js +++ /dev/null @@ -1,9 +0,0 @@ -t.equal( - require("./shared")(),2, - "lazy.js can use the shared library" -); -t.equal( - require("not/real")(),1, - "lazy.js can use library code with arbitrary names" -); - diff --git a/node_modules/browserify/test/reverse_multi_bundle/shared.js b/node_modules/browserify/test/reverse_multi_bundle/shared.js deleted file mode 100644 index 6bb03fbba..000000000 --- a/node_modules/browserify/test/reverse_multi_bundle/shared.js +++ /dev/null @@ -1,6 +0,0 @@ -var i = 0; -module.exports = function() { - return ++i; -}; - -// 77aa70 diff --git a/node_modules/browserify/test/shared_symlink.js b/node_modules/browserify/test/shared_symlink.js deleted file mode 100644 index f10d57339..000000000 --- a/node_modules/browserify/test/shared_symlink.js +++ /dev/null @@ -1,16 +0,0 @@ -// https://github.com/substack/node-browserify/issues/1325 - -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('shared symlink', { skip: process.platform === 'win32' }, function (t) { - t.plan(1); - var b = browserify(__dirname + '/shared_symlink/main.js'); - b.bundle(function (err, src) { - // does the same thing as node: crashes - t.equal(err.message, "Cannot find module 'foo' from '" - + __dirname + "/shared_symlink/shared'" - ); - }); -}); diff --git a/node_modules/browserify/test/shared_symlink/app/index.js b/node_modules/browserify/test/shared_symlink/app/index.js deleted file mode 100644 index 489c017f6..000000000 --- a/node_modules/browserify/test/shared_symlink/app/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('shared') + require('foo') diff --git a/node_modules/browserify/test/shared_symlink/app/node_modules/foo/index.js b/node_modules/browserify/test/shared_symlink/app/node_modules/foo/index.js deleted file mode 100644 index 7afe02674..000000000 --- a/node_modules/browserify/test/shared_symlink/app/node_modules/foo/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1234 diff --git a/node_modules/browserify/test/shared_symlink/app/node_modules/shared/index.js b/node_modules/browserify/test/shared_symlink/app/node_modules/shared/index.js deleted file mode 100644 index 176676407..000000000 --- a/node_modules/browserify/test/shared_symlink/app/node_modules/shared/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('foo') * 2 diff --git a/node_modules/browserify/test/shared_symlink/main.js b/node_modules/browserify/test/shared_symlink/main.js deleted file mode 100644 index a13f52481..000000000 --- a/node_modules/browserify/test/shared_symlink/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log(require('./app')) diff --git a/node_modules/browserify/test/shared_symlink/shared/index.js b/node_modules/browserify/test/shared_symlink/shared/index.js deleted file mode 100644 index 176676407..000000000 --- a/node_modules/browserify/test/shared_symlink/shared/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('foo') * 2 diff --git a/node_modules/browserify/test/shebang.js b/node_modules/browserify/test/shebang.js deleted file mode 100644 index 5965ac949..000000000 --- a/node_modules/browserify/test/shebang.js +++ /dev/null @@ -1,11 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('files with shebangs', function (t) { - t.plan(1); - var b = browserify(__dirname + '/shebang/main.js'); - b.bundle(function (err, src) { - vm.runInNewContext(src, { t: t }); - }); -}); diff --git a/node_modules/browserify/test/shebang/foo.js b/node_modules/browserify/test/shebang/foo.js deleted file mode 100644 index 3ec10cd5e..000000000 --- a/node_modules/browserify/test/shebang/foo.js +++ /dev/null @@ -1,2 +0,0 @@ -#!/blah -module.exports = 1234; diff --git a/node_modules/browserify/test/shebang/main.js b/node_modules/browserify/test/shebang/main.js deleted file mode 100644 index eb41711b4..000000000 --- a/node_modules/browserify/test/shebang/main.js +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env node - -var foo = require('./foo'); -t.equal(foo, 1234); diff --git a/node_modules/browserify/test/spread.js b/node_modules/browserify/test/spread.js deleted file mode 100644 index ba4fd3745..000000000 --- a/node_modules/browserify/test/spread.js +++ /dev/null @@ -1,14 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; -var vm = require('vm'); -var hasObjectSpread = require('has-object-spread')(); - -test('yield', { skip: !hasObjectSpread }, function (t) { - t.plan(2); - var b = browserify(__dirname + '/spread/main.js'); - - b.bundle(function (err, src) { - t.error(err); - t.notEqual(src.indexOf('...b'), -1, 'passed through spread syntax') - }); -}); diff --git a/node_modules/browserify/test/spread/main.js b/node_modules/browserify/test/spread/main.js deleted file mode 100644 index c3e1a4008..000000000 --- a/node_modules/browserify/test/spread/main.js +++ /dev/null @@ -1 +0,0 @@ -var a = { ...b } diff --git a/node_modules/browserify/test/standalone.js b/node_modules/browserify/test/standalone.js deleted file mode 100644 index 16c105a71..000000000 --- a/node_modules/browserify/test/standalone.js +++ /dev/null @@ -1,85 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('standalone', function (t) { - t.plan(3); - - var b = browserify(__dirname + '/standalone/main.js', { - standalone: 'stand-test' - }); - b.bundle(function (err, src) { - t.test('window global', function (t) { - t.plan(2); - var c = { - window: {}, - done : done(t) - }; - vm.runInNewContext(src + 'window.standTest(done)', c); - }); - t.test('CommonJS', function (t) { - t.plan(2); - var exp = {}; - var c = { - module: { exports: exp }, - exports: exp, - done : done(t) - }; - vm.runInNewContext(src + 'module.exports(done)', c); - }); - t.test('RequireJS', function (t) { - t.plan(2); - var c = { - define: function (dependencies, fn) { - fn()(done(t)); - } - }; - c.define.amd = true; - vm.runInNewContext(src, c); - }); - }); -}); - -test('A.B.C standalone', function (t) { - t.plan(3); - - var b = browserify(__dirname + '/standalone/main.js', { - standalone: 'A.B.C' - }); - b.bundle(function (err, src) { - t.test('window global', function (t) { - t.plan(2); - var c = { window: {} }; - vm.runInNewContext(src, c); - c.window.A.B.C(done(t)); - }); - t.test('CommonJS', function (t) { - t.plan(2); - var exp = {}; - var c = { - module: { exports: exp }, - exports: exp - }; - vm.runInNewContext(src, c); - c.module.exports(done(t)); - }); - t.test('RequireJS', function (t) { - t.plan(2); - var c = { - define: function (dependencies, fn) { - fn()(done(t)); - } - }; - c.define.amd = true; - vm.runInNewContext(src, c); - }); - }); -}); - -function done(t) { - return function (one, two) { - t.equal(one, 1); - t.equal(two, 2); - t.end(); - }; -} diff --git a/node_modules/browserify/test/standalone/main.js b/node_modules/browserify/test/standalone/main.js deleted file mode 100644 index 400038d6a..000000000 --- a/node_modules/browserify/test/standalone/main.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function (cb) { - cb(require('./one'), require('./two')); -}; \ No newline at end of file diff --git a/node_modules/browserify/test/standalone/one.js b/node_modules/browserify/test/standalone/one.js deleted file mode 100644 index bd816eaba..000000000 --- a/node_modules/browserify/test/standalone/one.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/node_modules/browserify/test/standalone/two.js b/node_modules/browserify/test/standalone/two.js deleted file mode 100644 index 4bbffde10..000000000 --- a/node_modules/browserify/test/standalone/two.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 2; diff --git a/node_modules/browserify/test/standalone_events.js b/node_modules/browserify/test/standalone_events.js deleted file mode 100644 index eb42afb4b..000000000 --- a/node_modules/browserify/test/standalone_events.js +++ /dev/null @@ -1,19 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; - -test('standalone bundle close event', {timeout: 1000}, function (t) { - t.plan(1); - - var ended = false; - - var b = browserify(__dirname + '/standalone/main.js', { - standalone: 'stand-test' - }); - var r = b.bundle(); - r.resume(); - r.on('end', function() { - t.ok(!ended); - ended = true; - t.end(); - }); -}); diff --git a/node_modules/browserify/test/standalone_sourcemap.js b/node_modules/browserify/test/standalone_sourcemap.js deleted file mode 100644 index a11c4542d..000000000 --- a/node_modules/browserify/test/standalone_sourcemap.js +++ /dev/null @@ -1,55 +0,0 @@ -var browserify = require('../'); -var fs = require('fs'); -var vm = require('vm'); -var test = require('tap').test; - -test('standalone in debug mode', function (t) { - t.plan(3); - - var main = fs.readFileSync(__dirname + '/standalone/main.js'); - - var b = browserify(__dirname + '/standalone/main.js', { - standalone: 'stand-test', - debug: true - }); - b.bundle(function (err, buf) { - var src = buf.toString('utf8'); - t.test('window global', function (t) { - t.plan(2); - var c = { - window: {}, - done : done(t) - }; - vm.runInNewContext(src + '\nwindow.standTest(done)', c); - }); - t.test('CommonJS', function (t) { - t.plan(2); - var exp = {}; - var c = { - module: { exports: exp }, - exports: exp, - done : done(t) - }; - vm.runInNewContext(src + '\nmodule.exports(done)', c); - }); - t.test('RequireJS', function (t) { - t.plan(2); - var c = { - define: function (dependencies, fn) { - fn()(done(t)); - } - }; - c.define.amd = true; - vm.runInNewContext(src, c); - }); - }); -}); - -function done(t) { - return function (one, two) { - t.equal(one, 1); - t.equal(two, 2); - t.end(); - }; -} - diff --git a/node_modules/browserify/test/stdin.js b/node_modules/browserify/test/stdin.js deleted file mode 100644 index da5415d49..000000000 --- a/node_modules/browserify/test/stdin.js +++ /dev/null @@ -1,35 +0,0 @@ -var test = require('tap').test; -var spawn = require('child_process').spawn; -var concat = require('concat-stream'); -var path = require('path'); -var vm = require('vm'); - -test('stdin', function (t) { - t.plan(2); - - var cwd = process.cwd(); - process.chdir(__dirname); - - var ps = spawn(process.execPath, [ - path.resolve(__dirname, '../bin/cmd.js'), - '-' - ]); - - ps.stdout.pipe(concat(function (body) { - var c = { console: { - log: function (msg) { - t.equal(msg, 'hello'); - } - } }; - vm.runInNewContext(body, c); - })); - ps.stderr.pipe(process.stderr); - - ps.on('exit', function (code) { - t.equal(code, 0); - }); - - ps.stdin.write("console.log('hello')"); - ps.stdin.end(); - -}); diff --git a/node_modules/browserify/test/stream.js b/node_modules/browserify/test/stream.js deleted file mode 100644 index a15a5ee91..000000000 --- a/node_modules/browserify/test/stream.js +++ /dev/null @@ -1,15 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; -var fs = require('fs'); - -test('stream', function (t) { - t.plan(2); - - var stream = fs.createReadStream(__dirname + '/stream/main.js'); - var b = browserify(stream, { basedir: __dirname + '/stream' }); - - b.bundle(function (err, src) { - vm.runInNewContext(src, { t: t }); - }); -}); diff --git a/node_modules/browserify/test/stream/bar.js b/node_modules/browserify/test/stream/bar.js deleted file mode 100644 index 5828b13ee..000000000 --- a/node_modules/browserify/test/stream/bar.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./foo.js') * 4 / 3 diff --git a/node_modules/browserify/test/stream/foo.js b/node_modules/browserify/test/stream/foo.js deleted file mode 100644 index 91238822e..000000000 --- a/node_modules/browserify/test/stream/foo.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 333 diff --git a/node_modules/browserify/test/stream/main.js b/node_modules/browserify/test/stream/main.js deleted file mode 100644 index 33063b271..000000000 --- a/node_modules/browserify/test/stream/main.js +++ /dev/null @@ -1,2 +0,0 @@ -t.equal(require('./foo.js'), 333); -t.equal(require('./bar.js'), 444); diff --git a/node_modules/browserify/test/stream_file.js b/node_modules/browserify/test/stream_file.js deleted file mode 100644 index 100471ce8..000000000 --- a/node_modules/browserify/test/stream_file.js +++ /dev/null @@ -1,29 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; -var fs = require('fs'); -var through = require('through2'); -var path = require('path'); - -test('stream file', function (t) { - var expected = {}; - expected[ path.join(__dirname, 'stream/fake.js') ] = true; - expected[ path.join(__dirname, 'stream/bar.js' ) ] = true; - expected[ path.join(__dirname, 'stream/foo.js' ) ] = true; - - t.plan(5); - - var stream = fs.createReadStream(__dirname + '/stream/main.js'); - stream.file = path.join(__dirname, '/stream/fake.js'); - - var b = browserify(stream, { basedir: __dirname + '/stream' }); - b.transform(function (file) { - t.ok(expected[file]); - delete expected[file]; - return through(); - }); - - b.bundle(function (err, src) { - vm.runInNewContext(src, { t: t }); - }); -}); diff --git a/node_modules/browserify/test/subdep.js b/node_modules/browserify/test/subdep.js deleted file mode 100644 index fd58d6ec7..000000000 --- a/node_modules/browserify/test/subdep.js +++ /dev/null @@ -1,16 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('subdep', function (t) { - t.plan(1); - - var b = browserify(); - b.require(__dirname + '/subdep/index.js', { expose: 'subdep' }); - - b.bundle(function (err, src) { - var c = {}; - vm.runInNewContext(src, c); - t.equal(c.require('subdep'), 'zzz'); - }); -}); diff --git a/node_modules/browserify/test/subdep/index.js b/node_modules/browserify/test/subdep/index.js deleted file mode 100644 index f05301b7f..000000000 --- a/node_modules/browserify/test/subdep/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('qq'); diff --git a/node_modules/browserify/test/subdep/node_modules/qq/b.js b/node_modules/browserify/test/subdep/node_modules/qq/b.js deleted file mode 100644 index 015ad7e1f..000000000 --- a/node_modules/browserify/test/subdep/node_modules/qq/b.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('a'); diff --git a/node_modules/browserify/test/subdep/node_modules/qq/ignore_me.js b/node_modules/browserify/test/subdep/node_modules/qq/ignore_me.js deleted file mode 100644 index 498930331..000000000 --- a/node_modules/browserify/test/subdep/node_modules/qq/ignore_me.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'IGNORE ME'; diff --git a/node_modules/browserify/test/subdep/node_modules/qq/node_modules/a/index.js b/node_modules/browserify/test/subdep/node_modules/qq/node_modules/a/index.js deleted file mode 100644 index aecaca26f..000000000 --- a/node_modules/browserify/test/subdep/node_modules/qq/node_modules/a/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('z'); diff --git a/node_modules/browserify/test/subdep/node_modules/qq/node_modules/a/package.json b/node_modules/browserify/test/subdep/node_modules/qq/node_modules/a/package.json deleted file mode 100644 index ea2ec7205..000000000 --- a/node_modules/browserify/test/subdep/node_modules/qq/node_modules/a/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies" : { - "z" : "*" - } -} diff --git a/node_modules/browserify/test/subdep/node_modules/qq/node_modules/c/index.js b/node_modules/browserify/test/subdep/node_modules/qq/node_modules/c/index.js deleted file mode 100644 index b192ca258..000000000 --- a/node_modules/browserify/test/subdep/node_modules/qq/node_modules/c/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'ccc'; diff --git a/node_modules/browserify/test/subdep/node_modules/qq/node_modules/c/package.json b/node_modules/browserify/test/subdep/node_modules/qq/node_modules/c/package.json deleted file mode 100644 index 0d0cfd59d..000000000 --- a/node_modules/browserify/test/subdep/node_modules/qq/node_modules/c/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies" : { - "f" : "*" - } -} diff --git a/node_modules/browserify/test/subdep/node_modules/qq/node_modules/f/index.js b/node_modules/browserify/test/subdep/node_modules/qq/node_modules/f/index.js deleted file mode 100644 index b5cf2e10b..000000000 --- a/node_modules/browserify/test/subdep/node_modules/qq/node_modules/f/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'fff'; diff --git a/node_modules/browserify/test/subdep/node_modules/qq/node_modules/z/index.js b/node_modules/browserify/test/subdep/node_modules/qq/node_modules/z/index.js deleted file mode 100644 index c27268eb5..000000000 --- a/node_modules/browserify/test/subdep/node_modules/qq/node_modules/z/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'zzz'; diff --git a/node_modules/browserify/test/subdep/node_modules/qq/package.json b/node_modules/browserify/test/subdep/node_modules/qq/package.json deleted file mode 100644 index d693ab598..000000000 --- a/node_modules/browserify/test/subdep/node_modules/qq/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main" : "./b.js" -} diff --git a/node_modules/browserify/test/subdep/package.json b/node_modules/browserify/test/subdep/package.json deleted file mode 100644 index 518d22aa9..000000000 --- a/node_modules/browserify/test/subdep/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "dependencies" : { - "qq" : "*" - }, - "main" : "index.js" -} diff --git a/node_modules/browserify/test/symlink_dedupe.js b/node_modules/browserify/test/symlink_dedupe.js deleted file mode 100644 index dbc7afe63..000000000 --- a/node_modules/browserify/test/symlink_dedupe.js +++ /dev/null @@ -1,16 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('hash instances with hashed contexts', { skip: process.platform === 'win32' }, function (t) { - t.plan(5); - - var b = browserify(__dirname + '/symlink_dedupe/main.js'); - b.bundle(function (err, buf) { - var c = { t: t }; - var src = buf.toString('utf8'); - t.equal(src.match(RegExp('// FILE F ONE', 'g')).length, 1); - t.equal(src.match(RegExp('// FILE G ONE', 'g')).length, 1); - vm.runInNewContext(src, c); - }); -}); diff --git a/node_modules/browserify/test/symlink_dedupe/main.js b/node_modules/browserify/test/symlink_dedupe/main.js deleted file mode 100644 index 92ff18df1..000000000 --- a/node_modules/browserify/test/symlink_dedupe/main.js +++ /dev/null @@ -1,6 +0,0 @@ -var A = require('./one/f.js'); -var B = require('./one/dir/f.js'); -t.equal(A, B); -t.equal(A(), 555); -t.equal(B(), 555); - diff --git a/node_modules/browserify/test/symlink_dedupe/one/f.js b/node_modules/browserify/test/symlink_dedupe/one/f.js deleted file mode 100644 index a315c1e7d..000000000 --- a/node_modules/browserify/test/symlink_dedupe/one/f.js +++ /dev/null @@ -1,3 +0,0 @@ -// FILE F ONE -var G = require('./g.js'); -module.exports = function () { return 111 * G }; diff --git a/node_modules/browserify/test/symlink_dedupe/one/g.js b/node_modules/browserify/test/symlink_dedupe/one/g.js deleted file mode 100644 index 837303206..000000000 --- a/node_modules/browserify/test/symlink_dedupe/one/g.js +++ /dev/null @@ -1,2 +0,0 @@ -// FILE G ONE -module.exports = 5 diff --git a/node_modules/browserify/test/syntax_cache.js b/node_modules/browserify/test/syntax_cache.js deleted file mode 100644 index ff2a5deec..000000000 --- a/node_modules/browserify/test/syntax_cache.js +++ /dev/null @@ -1,47 +0,0 @@ -var Seq = require('seq'); -var browserify = require('../'); -var test = require('tap').test; -var shasum = require('shasum'); - -test('syntax cache - valid', function (t) { - t.plan(2); - - var expectedCache = {} - var cacheKey; - - var b = browserify(__dirname + '/syntax_cache/valid.js'); - b.once('dep', function(row) { - cacheKey = shasum(row.source); - expectedCache[cacheKey] = true; - }); - - Seq() - .seq(function() { b.bundle(this); }) - .seq(function() { - t.deepEqual(b._syntaxCache, expectedCache); - b._syntaxCache[cacheKey] = expectedCache[cacheKey] = 'beep'; - b.bundle(function(err, src) { - // if the cache worked, the "cacheKey" - // should not be reset to "true" - t.deepEqual(b._syntaxCache, expectedCache); - }); - }); -}); - -test('syntax cache - skip invalid', function (t) { - t.plan(5); - - var b = browserify(__dirname + '/syntax_cache/invalid.js'); - - Seq() - .seq(function() { b.bundle(this); }) - .catch(function(lastErr) { - t.deepEqual(b._syntaxCache, {}); - t.similar(String(lastErr), /ParseError/); - b.bundle(function(err, src) { - t.deepEqual(b._syntaxCache, {}); - t.similar(String(err), /ParseError/); - t.notEqual(lastErr, err, 'errors should be unique'); - }); - }); -}); diff --git a/node_modules/browserify/test/syntax_cache/invalid.js b/node_modules/browserify/test/syntax_cache/invalid.js deleted file mode 100644 index e85c07cca..000000000 --- a/node_modules/browserify/test/syntax_cache/invalid.js +++ /dev/null @@ -1,2 +0,0 @@ -var x = { -var y = 6; diff --git a/node_modules/browserify/test/syntax_cache/valid.js b/node_modules/browserify/test/syntax_cache/valid.js deleted file mode 100644 index cf4f426f5..000000000 --- a/node_modules/browserify/test/syntax_cache/valid.js +++ /dev/null @@ -1,2 +0,0 @@ -var x = {}; -var y = 6; diff --git a/node_modules/browserify/test/tr.js b/node_modules/browserify/test/tr.js deleted file mode 100644 index 69c72488f..000000000 --- a/node_modules/browserify/test/tr.js +++ /dev/null @@ -1,28 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; -var through = require('through2'); - -test('function transform', function (t) { - t.plan(7); - - var b = browserify(__dirname + '/tr/main.js'); - b.transform({ global: true }, function (file) { - return through(function (buf, enc, next) { - this.push(String(buf).replace(/ZZZ/g, '1')); - next(); - }); - }); - b.transform(function (file) { - return through(function (buf, enc, next) { - this.push(String(buf) - .replace(/AAA/g, '5') - .replace(/BBB/g, '50') - ); - next(); - }) - }); - b.bundle(function (err, src) { - vm.runInNewContext(src, { t: t }); - }); -}); diff --git a/node_modules/browserify/test/tr/f.js b/node_modules/browserify/test/tr/f.js deleted file mode 100644 index a56a0975c..000000000 --- a/node_modules/browserify/test/tr/f.js +++ /dev/null @@ -1,2 +0,0 @@ -t.equal(XYZ, 909); -module.exports = function (x) { return x + BBB } diff --git a/node_modules/browserify/test/tr/main.js b/node_modules/browserify/test/tr/main.js deleted file mode 100644 index 8503c470f..000000000 --- a/node_modules/browserify/test/tr/main.js +++ /dev/null @@ -1,9 +0,0 @@ -var f = require('./f.js'); -var m = require('m'); -var g = require('g'); -t.equal(require('./subdir/g.js'), 999); - -t.equal(m(f(AAA)), 555, 'transformation scope'); -t.equal(g(3), 332, 'sub-transformation applied'); -t.equal(typeof GGG, 'undefined', 'GGG leak'); -t.equal(XYZ, 909); diff --git a/node_modules/browserify/test/tr/node_modules/g/index.js b/node_modules/browserify/test/tr/node_modules/g/index.js deleted file mode 100644 index 84ad716aa..000000000 --- a/node_modules/browserify/test/tr/node_modules/g/index.js +++ /dev/null @@ -1,2 +0,0 @@ -t.equal(typeof XYZ, 'undefined'); -module.exports = function (x) { return x * GGG - ZZZ } diff --git a/node_modules/browserify/test/tr/node_modules/g/node_modules/insert-ggg/index.js b/node_modules/browserify/test/tr/node_modules/g/node_modules/insert-ggg/index.js deleted file mode 100644 index d0e4862f6..000000000 --- a/node_modules/browserify/test/tr/node_modules/g/node_modules/insert-ggg/index.js +++ /dev/null @@ -1,7 +0,0 @@ -var through = require('through'); - -module.exports = function (file) { - return through(function (buf) { - this.queue(String(buf).replace(/GGG/g, '111')); - }); -}; diff --git a/node_modules/browserify/test/tr/node_modules/g/package.json b/node_modules/browserify/test/tr/node_modules/g/package.json deleted file mode 100644 index 3a16bd458..000000000 --- a/node_modules/browserify/test/tr/node_modules/g/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "main": "index.js", - "browserify": { - "transform": "insert-ggg" - } -} diff --git a/node_modules/browserify/test/tr/node_modules/insert-aaa/index.js b/node_modules/browserify/test/tr/node_modules/insert-aaa/index.js deleted file mode 100644 index 0394d4e8b..000000000 --- a/node_modules/browserify/test/tr/node_modules/insert-aaa/index.js +++ /dev/null @@ -1,7 +0,0 @@ -var through = require('through'); - -module.exports = function (file) { - return through(function (buf) { - this.queue(String(buf).replace(/AAA/g, '5')); - }); -}; diff --git a/node_modules/browserify/test/tr/node_modules/insert-bbb/index.js b/node_modules/browserify/test/tr/node_modules/insert-bbb/index.js deleted file mode 100644 index d48906a82..000000000 --- a/node_modules/browserify/test/tr/node_modules/insert-bbb/index.js +++ /dev/null @@ -1,7 +0,0 @@ -var through = require('through'); - -module.exports = function (file) { - return through(function (buf) { - this.queue(String(buf).replace(/BBB/g, '50')); - }); -}; diff --git a/node_modules/browserify/test/tr/node_modules/m/index.js b/node_modules/browserify/test/tr/node_modules/m/index.js deleted file mode 100644 index 4cd0ff36e..000000000 --- a/node_modules/browserify/test/tr/node_modules/m/index.js +++ /dev/null @@ -1,3 +0,0 @@ -var AAA = 200, BBB = 300; - -module.exports = function (x) { return AAA + BBB + x } diff --git a/node_modules/browserify/test/tr/node_modules/xyz/index.js b/node_modules/browserify/test/tr/node_modules/xyz/index.js deleted file mode 100644 index 8c5ccabaa..000000000 --- a/node_modules/browserify/test/tr/node_modules/xyz/index.js +++ /dev/null @@ -1,7 +0,0 @@ -var through = require('through'); - -module.exports = function (file) { - return through(function (buf) { - this.queue(String(buf).replace(/XYZ/g, '909')); - }); -}; diff --git a/node_modules/browserify/test/tr/package.json b/node_modules/browserify/test/tr/package.json deleted file mode 100644 index 6687fa119..000000000 --- a/node_modules/browserify/test/tr/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browserify": { - "transform": [ "xyz" ] - } -} diff --git a/node_modules/browserify/test/tr/subdir/g.js b/node_modules/browserify/test/tr/subdir/g.js deleted file mode 100644 index 047280d04..000000000 --- a/node_modules/browserify/test/tr/subdir/g.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = XYZ + 90; diff --git a/node_modules/browserify/test/tr_args.js b/node_modules/browserify/test/tr_args.js deleted file mode 100644 index ace453043..000000000 --- a/node_modules/browserify/test/tr_args.js +++ /dev/null @@ -1,24 +0,0 @@ -var test = require('tap').test; -var spawn = require('child_process').spawn; -var path = require('path'); -var concat = require('concat-stream'); -var vm = require('vm'); - -test('transform arguments', function (t) { - t.plan(2); - - var ps = spawn(process.execPath, [ - path.resolve(__dirname, '../bin/cmd.js'), - __dirname + '/tr_args/main.js', - '-t', '[', __dirname + '/tr_args/tr.js', '-x', '1', ']' - ]); - - ps.stderr.pipe(process.stderr); - ps.stdout.pipe(concat(function (body) { - vm.runInNewContext(body.toString('utf8'), { t: t }); - })); - - ps.on('exit', function (code) { - t.equal(code, 0); - }); -}); diff --git a/node_modules/browserify/test/tr_args/main.js b/node_modules/browserify/test/tr_args/main.js deleted file mode 100644 index ec448ae83..000000000 --- a/node_modules/browserify/test/tr_args/main.js +++ /dev/null @@ -1 +0,0 @@ -t.equal(XXX * 5, 555); diff --git a/node_modules/browserify/test/tr_args/tr.js b/node_modules/browserify/test/tr_args/tr.js deleted file mode 100644 index 6d0a1a875..000000000 --- a/node_modules/browserify/test/tr_args/tr.js +++ /dev/null @@ -1,12 +0,0 @@ -var through = require('through2'); - -module.exports = function (file, opts) { - var data = ''; - return through(write, end); - - function write (buf, enc, next) { data += buf; next() } - function end () { - this.push(data.replace(/X/g, opts.x)); - this.push(null); - } -}; diff --git a/node_modules/browserify/test/tr_error.js b/node_modules/browserify/test/tr_error.js deleted file mode 100644 index e7d857c09..000000000 --- a/node_modules/browserify/test/tr_error.js +++ /dev/null @@ -1,33 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; -var through = require('through2'); - -test('transform errors errback', function (t) { - t.plan(2); - - var b = browserify(__dirname + '/tr/main.js'); - b.transform(function (file) { - return through(function (buf) { - this.emit('error', new Error('blah')); - }) - }); - b.bundle(function (err, src) { - t.ok(/^blah/.test(err.message)); - t.equal(src, undefined); - }); -}); - -test('transform errors propagate', function (t) { - t.plan(1); - - var b = browserify(__dirname + '/tr/main.js'); - b.transform(function (file) { - return through(function (buf) { - this.emit('error', new Error('blah')); - }); - }); - b.bundle().on('error', function (err) { - t.ok(/^blah/.test(err.message)); - }); -}); diff --git a/node_modules/browserify/test/tr_flags.js b/node_modules/browserify/test/tr_flags.js deleted file mode 100644 index b6bff9201..000000000 --- a/node_modules/browserify/test/tr_flags.js +++ /dev/null @@ -1,36 +0,0 @@ -var through = require('through2'); -var browserify = require('../'); -var test = require('tap').test; -var vm = require('vm'); - -test('--debug passed to transforms', function (t) { - var empty = require.resolve('../lib/_empty'); - - t.plan(3); - - [true, false].forEach(function(debug) { - var b = browserify(empty, { debug: debug }); - - b.transform(function(file, opts) { - t.equal(opts._flags.debug, debug, 'debug: ' + debug); - return through(); - }); - - b.bundle(function (err, src) { - if (err) return t.fail(err.message); - }); - }); - - var b = browserify(empty, { debug: true }); - - b.transform({ - _flags: Infinity - }, function(file, opts) { - t.equal(opts._flags, Infinity, 'transform arguents are preserved'); - return through(); - }); - - b.bundle(function(err, src) { - if (err) return t.fail(err.message); - }); -}); diff --git a/node_modules/browserify/test/tr_global.js b/node_modules/browserify/test/tr_global.js deleted file mode 100644 index 941eaf4f3..000000000 --- a/node_modules/browserify/test/tr_global.js +++ /dev/null @@ -1,17 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; -var through = require('through2'); - -test('global transform precedence', function (t) { - t.plan(1); - - var b = browserify(__dirname + '/tr_global/main.js', { - basedir: __dirname + '/tr_global' - }); - b.transform('tr', { global: true }); - b.bundle(function (err, src) { - vm.runInNewContext(src, { console: { log: log } }); - function log (msg) { t.equal(msg, 444) } - }); -}); diff --git a/node_modules/browserify/test/tr_global/main.js b/node_modules/browserify/test/tr_global/main.js deleted file mode 100644 index 208d369bf..000000000 --- a/node_modules/browserify/test/tr_global/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log(require('x')); diff --git a/node_modules/browserify/test/tr_global/node_modules/tr/index.js b/node_modules/browserify/test/tr_global/node_modules/tr/index.js deleted file mode 100644 index b11f32dcb..000000000 --- a/node_modules/browserify/test/tr_global/node_modules/tr/index.js +++ /dev/null @@ -1,8 +0,0 @@ -var through = require('through2'); - -module.exports = function () { - return through(function (buf, enc, next) { - this.push(buf.toString('utf8').replace(/VAR/, 4)); - next(); - }); -}; diff --git a/node_modules/browserify/test/tr_global/node_modules/x/index.js b/node_modules/browserify/test/tr_global/node_modules/x/index.js deleted file mode 100644 index 1e8d9e3c0..000000000 --- a/node_modules/browserify/test/tr_global/node_modules/x/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 111 * VAR diff --git a/node_modules/browserify/test/tr_global/node_modules/x/node_modules/tr/index.js b/node_modules/browserify/test/tr_global/node_modules/x/node_modules/tr/index.js deleted file mode 100644 index 597e4f81a..000000000 --- a/node_modules/browserify/test/tr_global/node_modules/x/node_modules/tr/index.js +++ /dev/null @@ -1,8 +0,0 @@ -var through = require('through2'); - -module.exports = function () { - return through(function (buf, enc, next) { - this.push(buf.toString('utf8').replace(/VAR/, 5)); - next(); - }); -}; diff --git a/node_modules/browserify/test/tr_no_entry.js b/node_modules/browserify/test/tr_no_entry.js deleted file mode 100644 index f41d9ceb5..000000000 --- a/node_modules/browserify/test/tr_no_entry.js +++ /dev/null @@ -1,20 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; -var path = require('path') - -test('transform with no entry files', function (t) { - process.chdir(__dirname); - - t.plan(2); - var b = browserify(); - b.transform('tr'); - b.require(path.join(__dirname, 'tr_no_entry/main.js'), { - expose: 'yoyo' - }); - b.bundle(function (err, body) { - t.ifError(err); - var src = body.toString('utf8') + 'require("yoyo")'; - var con = { log: function (msg) { t.equal(msg, 'ZZZ') } }; - Function('console', src)(con); - }); -}); diff --git a/node_modules/browserify/test/tr_no_entry/main.js b/node_modules/browserify/test/tr_no_entry/main.js deleted file mode 100644 index 3dce90898..000000000 --- a/node_modules/browserify/test/tr_no_entry/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log('XXX'); diff --git a/node_modules/browserify/test/tr_once.js b/node_modules/browserify/test/tr_once.js deleted file mode 100644 index a892189e2..000000000 --- a/node_modules/browserify/test/tr_once.js +++ /dev/null @@ -1,21 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; -var through = require('through2'); -var path = require('path'); - -test('transform exactly once', function (t) { - t.plan(3); - - var b = browserify(__dirname + '/tr_once/main.js', { - transform: function (file) { - t.equal(file, path.join(__dirname, 'tr_once/main.js') ); - return through(); - } - }); - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src, { console: { log: log } }); - function log (msg) { t.equal(msg, 'wow') } - }); -}); diff --git a/node_modules/browserify/test/tr_once/main.js b/node_modules/browserify/test/tr_once/main.js deleted file mode 100644 index 6036bec63..000000000 --- a/node_modules/browserify/test/tr_once/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log('wow'); diff --git a/node_modules/browserify/test/tr_order.js b/node_modules/browserify/test/tr_order.js deleted file mode 100644 index 020b86e32..000000000 --- a/node_modules/browserify/test/tr_order.js +++ /dev/null @@ -1,23 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; -var through = require('through2'); - -test('function transform', function (t) { - debugger; - t.plan(8); - - var b = browserify(__dirname + '/tr/main.js'); - b.transform({ global: true }, function (file) { - return through(function (buf, enc, next) { - this.push(String(buf).replace(/ZZZ/g, '1')); - next(); - }); - }); - b.transform(__dirname + '/tr_order/replace_aaa'); - b.transform(__dirname + '/tr_order/replace_bbb.js'); - b.bundle(function (err, src) { - t.ifError(err); - vm.runInNewContext(src, { t: t }); - }); -}); diff --git a/node_modules/browserify/test/tr_order/replace_aaa.js b/node_modules/browserify/test/tr_order/replace_aaa.js deleted file mode 100644 index f1af976c0..000000000 --- a/node_modules/browserify/test/tr_order/replace_aaa.js +++ /dev/null @@ -1,10 +0,0 @@ -var through = require('through2'); - -module.exports = function(file) { - return through(function (buf, enc, next) { - this.push(String(buf) - .replace(/AAA/g, '5') - ); - next(); - }) -} diff --git a/node_modules/browserify/test/tr_order/replace_bbb.js b/node_modules/browserify/test/tr_order/replace_bbb.js deleted file mode 100644 index cf57725cd..000000000 --- a/node_modules/browserify/test/tr_order/replace_bbb.js +++ /dev/null @@ -1,11 +0,0 @@ -var through = require('through2'); - -module.exports = function(file) { - return through(function (buf, enc, next) { - this.push(String(buf) - .replace(/AAA/g, '6') - .replace(/BBB/g, '50') - ); - next(); - }) -} diff --git a/node_modules/browserify/test/tr_symlink.js b/node_modules/browserify/test/tr_symlink.js deleted file mode 100644 index 9fcca56de..000000000 --- a/node_modules/browserify/test/tr_symlink.js +++ /dev/null @@ -1,27 +0,0 @@ -// based on this scenario: -// https://github.com/substack/node-browserify/pull/831#issuecomment-49546902 - -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; -var through = require('through2'); - -test('transform symlink', { skip: process.platform === 'win32' }, function (t) { - t.plan(4); - var expected = [ 9, 555, 777 ]; - var b = browserify(__dirname + '/tr_symlink/app/main.js', { - basedir: __dirname + '/tr_symlink/app' - }); - b.transform(function (file) { - return through(function (buf, enc, next) { - this.push(String(buf).replace(/7/g, 9)); - next(); - }) - }); - b.bundle(function (err, src) { - t.ifError(err); - var c = { console: { log: log } }; - vm.runInNewContext(src, c); - function log (msg) { t.equal(msg, expected.shift()) } - }); -}); diff --git a/node_modules/browserify/test/tr_symlink/a-module/index.js b/node_modules/browserify/test/tr_symlink/a-module/index.js deleted file mode 100644 index 3e842e734..000000000 --- a/node_modules/browserify/test/tr_symlink/a-module/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 555 diff --git a/node_modules/browserify/test/tr_symlink/app/main.js b/node_modules/browserify/test/tr_symlink/app/main.js deleted file mode 100644 index da0ac769b..000000000 --- a/node_modules/browserify/test/tr_symlink/app/main.js +++ /dev/null @@ -1,6 +0,0 @@ -var a = require('aaa'); -var b = require('bbb'); - -console.log(5); -console.log(a); -console.log(b); diff --git a/node_modules/browserify/test/tr_symlink/app/node_modules/aaa/index.js b/node_modules/browserify/test/tr_symlink/app/node_modules/aaa/index.js deleted file mode 100644 index 3e842e734..000000000 --- a/node_modules/browserify/test/tr_symlink/app/node_modules/aaa/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 555 diff --git a/node_modules/browserify/test/tr_symlink/app/node_modules/bbb/ext.js b/node_modules/browserify/test/tr_symlink/app/node_modules/bbb/ext.js deleted file mode 100644 index 2fad98701..000000000 --- a/node_modules/browserify/test/tr_symlink/app/node_modules/bbb/ext.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 777; diff --git a/node_modules/browserify/test/tr_symlink/app/node_modules/bbb/index.js b/node_modules/browserify/test/tr_symlink/app/node_modules/bbb/index.js deleted file mode 100644 index dae6275e7..000000000 --- a/node_modules/browserify/test/tr_symlink/app/node_modules/bbb/index.js +++ /dev/null @@ -1,2 +0,0 @@ -var ext = require('./ext'); -module.exports = ext; diff --git a/node_modules/browserify/test/tr_symlink/app/node_modules/tr/index.js b/node_modules/browserify/test/tr_symlink/app/node_modules/tr/index.js deleted file mode 100644 index f9d056885..000000000 --- a/node_modules/browserify/test/tr_symlink/app/node_modules/tr/index.js +++ /dev/null @@ -1,14 +0,0 @@ -var through = require('through2'); - -module.exports = function () { - var bufs = []; - return through(write, end); - function write (buf, enc, next) { - bufs.push(buf); - next(); - } - function end () { - this.push(Buffer.concat(bufs).toString().replace(/5/g, 9)); - this.push(null); - } -}; diff --git a/node_modules/browserify/test/tr_symlink/app/package.json b/node_modules/browserify/test/tr_symlink/app/package.json deleted file mode 100644 index 2f2bbfff8..000000000 --- a/node_modules/browserify/test/tr_symlink/app/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browserify": { - "transform": [ "tr" ] - } -} diff --git a/node_modules/browserify/test/tr_symlink/b-module/ext.js b/node_modules/browserify/test/tr_symlink/b-module/ext.js deleted file mode 100644 index 2fad98701..000000000 --- a/node_modules/browserify/test/tr_symlink/b-module/ext.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 777; diff --git a/node_modules/browserify/test/tr_symlink/b-module/index.js b/node_modules/browserify/test/tr_symlink/b-module/index.js deleted file mode 100644 index dae6275e7..000000000 --- a/node_modules/browserify/test/tr_symlink/b-module/index.js +++ /dev/null @@ -1,2 +0,0 @@ -var ext = require('./ext'); -module.exports = ext; diff --git a/node_modules/browserify/test/unicode.js b/node_modules/browserify/test/unicode.js deleted file mode 100644 index 2b68515ec..000000000 --- a/node_modules/browserify/test/unicode.js +++ /dev/null @@ -1,19 +0,0 @@ -var browserify = require('../'); -var vm = require('vm'); -var test = require('tap').test; - -test('unicode entry', function (t) { - t.plan(2); - - var b = browserify(__dirname + '/unicode/main.js'); - b.bundle(function (err, src) { - var c = { - done : function (one, two) { - t.equal(one, 1); - t.equal(two, 2); - t.end(); - } - }; - vm.runInNewContext(src, c); - }); -}); diff --git a/node_modules/browserify/test/unicode/main.js b/node_modules/browserify/test/unicode/main.js deleted file mode 100644 index 89bb8a036..000000000 --- a/node_modules/browserify/test/unicode/main.js +++ /dev/null @@ -1 +0,0 @@ -done(require('./one'), require('./two')); \ No newline at end of file diff --git a/node_modules/browserify/test/unicode/one.js b/node_modules/browserify/test/unicode/one.js deleted file mode 100644 index bd816eaba..000000000 --- a/node_modules/browserify/test/unicode/one.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1; diff --git a/node_modules/browserify/test/unicode/two.js b/node_modules/browserify/test/unicode/two.js deleted file mode 100644 index 4bbffde10..000000000 --- a/node_modules/browserify/test/unicode/two.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 2; diff --git a/node_modules/browserify/test/util.js b/node_modules/browserify/test/util.js deleted file mode 100644 index 760acf1e3..000000000 --- a/node_modules/browserify/test/util.js +++ /dev/null @@ -1,62 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; -var util = require('util'); -var vm = require('vm'); - -test('util.inspect', function (t) { - t.plan(1); - - var b = browserify(); - b.require('util'); - b.bundle(function (err ,src) { - var c = {}; - vm.runInNewContext(src, c); - t.equal( - c.require('util').inspect([1,2,3]), - util.inspect([1,2,3]) - ); - }); -}); - -test('util.inherits', function (t) { - t.plan(2); - - var b = browserify(); - b.require('util'); - b.require('events'); - - b.bundle(function (err, src) { - var c = {}; - vm.runInNewContext(src, c); - var EE = c.require('events').EventEmitter; - - function Beep () {} - c.require('util').inherits(Beep, EE); - var beep = new Beep; - - t.ok(beep instanceof Beep); - t.ok(beep instanceof EE); - }); -}); - -test('util.inherits without Object.create', function (t) { - t.plan(2); - var b = browserify(); - b.require('util'); - b.require('events'); - - b.bundle(function (err, src) { - var c = { Object : { prototype: Object.prototype } }; - vm.runInNewContext(src, c); - var EE = c.require('events').EventEmitter; - - function Beep () {} - Beep.prototype = {}; - - c.require('util').inherits(Beep, EE); - var beep = new Beep; - - t.ok(beep instanceof Beep); - t.ok(beep instanceof EE); - }); -}); diff --git a/node_modules/browserify/test/yield.js b/node_modules/browserify/test/yield.js deleted file mode 100644 index 164a5aaf7..000000000 --- a/node_modules/browserify/test/yield.js +++ /dev/null @@ -1,20 +0,0 @@ -var browserify = require('../'); -var test = require('tap').test; -var vm = require('vm'); -var generatorFunction = require('make-generator-function'); - -test('yield', { skip: !generatorFunction }, function (t) { - t.plan(6); - var b = browserify(__dirname + '/yield/main.js'); - - b.bundle(function (err, src) { - t.error(err); - var c = { console: { log: log } }; - var index = 0; - vm.runInNewContext(src, c); - - function log (msg) { - t.equal(index++, msg); - } - }); -}); diff --git a/node_modules/browserify/test/yield/f.js b/node_modules/browserify/test/yield/f.js deleted file mode 100644 index 8bb123b8d..000000000 --- a/node_modules/browserify/test/yield/f.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = function *() { - for (var i = 0; i < 5; i++) { - yield i; - } -} diff --git a/node_modules/browserify/test/yield/main.js b/node_modules/browserify/test/yield/main.js deleted file mode 100644 index 5a2e6bbb7..000000000 --- a/node_modules/browserify/test/yield/main.js +++ /dev/null @@ -1,4 +0,0 @@ -var f = require('./f.js')(); -for (var r = f.next(); !r.done; r = f.next()) { - console.log(r.value); -} diff --git a/node_modules/budo/.travis.yml b/node_modules/budo/.travis.yml deleted file mode 100644 index 7067e1aed..000000000 --- a/node_modules/budo/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - "5.0" - - "6.0" - - "7.0" - - "8.0" -before_install: - - npm install -g npm@~2.14.5 diff --git a/node_modules/budo/CHANGELOG.md b/node_modules/budo/CHANGELOG.md deleted file mode 100644 index 9da6fedb8..000000000 --- a/node_modules/budo/CHANGELOG.md +++ /dev/null @@ -1,244 +0,0 @@ -# 11.x - -#### Breaking Changes - -- Upgraded to `browserify@15`, set supported node version to `>= 4` - -# 10.x - -:tada: - -#### Breaking Changes - -- Upgraded to `browserify@14` -- The `--pushstate` boolean argument should now come *after* entries in the CLI, as it supports subarg options. Using it before entries will still work but may log a warning. -- Major overhaul to LiveReload backend to make it faster and more robust [#194](https://github.com/mattdesl/budo/issues/194) - - No longer uses `tiny-lr` or the old school LiveReload stuff, so it no longer supports some of the feature set from that tool - - No longer supports the LiveReload browser plugin - - Budo runs everything on a single port/server instead of a second server for LiveReload - - `/budo/livereload.js` now serves the LiveReload client - -#### Other Changes - -- `opts.staticOptions` is now passed onto `serve-static` module -- `opts.pushstate` (boolean or object) is now passed onto `connect-pushstate` module -- CLI now supports subarg syntax for commands like `--static-options` and `--pushstate` -- `defaultIndex` function now accepts a `req` as the second parameter - -# 9.4.7 - -- Make HTTP logging more accurate: previously the time and byte size was not correct - -# 9.4.5 .. 9.4.6 - -- Small tweaks to frontend build error styling -- Add `pushstate` flag as a boolean so it doesn't swallow entry - -# 9.4.3 - -- Disable cache control for `serve-static`, I've found this greatly reduces load time -- Slight change to `package.json` scripts so they work on Windows - -# 9.4.2 - -- Improve Windows terminal color support, fixes [#179](https://github.com/mattdesl/budo/issues/179) - -# 9.4.0 - -- Improve build error parsing and rendering - -# 9.3.0 - -- Add `force-default-index` to CLI [#188](https://github.com/mattdesl/budo/pull/188) - -# 9.2.2 - -- Minimize XSS risks in URLs on 404 [#182](https://github.com/mattdesl/budo/pull/183) - -# 9.2.0 - -- Improved `--cors` flag in middleware stack [#172](https://github.com/mattdesl/budo/pull/172) - -# 9.1.0 - -- Support `browserify: { entries: [] }` in API options [#167](https://github.com/mattdesl/budo/pull/167) -- The `connect` event also returns a `server` instance, so you can use it with things like SocketIO - -# 9.0.0 - -When `--ssl` is specified without a `--cert` and `--key` option, budo will use [pem](https://www.npmjs.com/package/pem) to generate a self-signed certificate. This is a breaking change from previous versions, but more convenient for most users. - -Also updated docs with more SSL info. - -# 8.4.0 - -Add `--base` flag for working with push state servers. - -# 8.3.0 - -Bump to latest browserify. - -# 8.2.2 - -Fix shorthand for `--serve` (`-s`). - -# 8.2.0 - -Add support for SSL (HTTPS) with `--ssl`, `--cert` and `--key` options. - -# 8.1.0 - -Add `--cors` flag to enable `Access-Control-Allow-Origin: *` - -# 8.0.4 - -Bump required deps. - -# 8.0.3 - -Fix `opts.live` as a string, allowing an array of options to be passed to filter file names. - -# 8.0.2 - -Fix flow so that bundling events start after server connects, also updated upstream in watchify-middleware. - -# 8.0.1 - -Fix parsing issue with LiveReload resp modifier. - -# 8.0.0 - -The server code has been refactored to use connect/express-style middleware stacking. Fixes [#80](https://github.com/mattdesl/budo/issues/80), [#79](https://github.com/mattdesl/budo/issues/79), [#124](https://github.com/mattdesl/budo/issues/124), [#128](https://github.com/mattdesl/budo/issues/128). - -##### Major Changes - -Functions for `opts.middleware` now assumes the following signature, and will not behave differently based on the number of arguments you specify: - - - `middleware(req, res, next)` - -##### Minor Changes - -The `middleware` options can now be an array of functions, or a single function. - -# 7.1.0 - -Added `--watch-glob` option which allows you to override the default watch glob without having to go through the `live()` / `watch()` API - -# 7.0.4 - -Small patch [#117](https://github.com/mattdesl/budo/pull/117) to fix a failing test in 7.0.3. - -# 7.0.3 - -- Bole no longer double-logs on shut-down and re-start. -- Fixed issue with request sizes being logged incorrectly in terminal - -# 7.0.1 .. 7.0.2 - -Small patches for [#110](https://github.com/mattdesl/budo/pull/110) and [#111](https://github.com/mattdesl/budo/pull/111). - -# 7.0.0 - -Fixes previous patch and also updates to garnish redesign, leading to new log styles. - -Since various ndjson flags have changed, this is a potentially breaking change. - -Also added a `--verbose` / `-v` option like watchify, which adds some additional debug messages. - -# 6.1.1 - -Fixes live reload for directory routes like `localhost:9966/mydir`. - -# 6.1.0 - -Search for `index.html` across all static `--dir` folders, finding the first one. - -# 6.0.0 - -##### Major Changes - -- `garnish` is now included by default in CLI and API - - you can use `--ndjson` and `ndjson: true` to have raw output (for custom pretty-printers) - -##### Minor Changes - -- added `--title` option for the default HTML title -- added `--css` option for a default style sheet - -# 5.0.0 - -##### Major Changes - -- you can just type `budo . | garnish` for the entry point (or `index.js`) -- added `--onupdate` for things like linting, see [the docs](docs/command-line-usage.md#--onupdate) -- if no `--host` is specified, resolves to internal IP - - you can still hit `localhost:9966` and it will work -- the ` - - - - - - diff --git a/node_modules/console-browserify/test/static/test-adapter.js b/node_modules/console-browserify/test/static/test-adapter.js deleted file mode 100644 index 8b4c12dc5..000000000 --- a/node_modules/console-browserify/test/static/test-adapter.js +++ /dev/null @@ -1,53 +0,0 @@ -(function () { - var Testem = window.Testem - var regex = /^((?:not )?ok) (\d+) (.+)$/ - - Testem.useCustomAdapter(tapAdapter) - - function tapAdapter(socket){ - var results = { - failed: 0 - , passed: 0 - , total: 0 - , tests: [] - } - - socket.emit('tests-start') - - Testem.handleConsoleMessage = function(msg){ - var m = msg.match(regex) - if (m) { - var passed = m[1] === 'ok' - var test = { - passed: passed ? 1 : 0, - failed: passed ? 0 : 1, - total: 1, - id: m[2], - name: m[3], - items: [] - } - - if (passed) { - results.passed++ - } else { - console.error("failure", m) - - results.failed++ - } - - results.total++ - - // console.log("emitted test", test) - socket.emit('test-result', test) - results.tests.push(test) - } else if (msg === '# ok' || msg.match(/^# tests \d+/)){ - // console.log("emitted all test") - socket.emit('all-test-results', results) - } - - // return false if you want to prevent the console message from - // going to the console - // return false - } - } -}()) diff --git a/node_modules/constants-browserify/README.md b/node_modules/constants-browserify/README.md deleted file mode 100644 index 9dd5a46fe..000000000 --- a/node_modules/constants-browserify/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -# constants-browserify - -Node's `constants` module for the browser. - -[![downloads](https://img.shields.io/npm/dm/constants-browserify.svg)](https://www.npmjs.org/package/constants-browserify) - -## Usage - -To use with browserify cli: - -```bash -$ browserify -r constants:constants-browserify script.js -``` - -To use with browserify api: - -```js -browserify() - .require('constants-browserify', { expose: 'constants' }) - .add(__dirname + '/script.js') - .bundle() - // ... -``` - -## Installation - -With [npm](http://npmjs.org) do - -```bash -$ npm install constants-browserify -``` - -## License - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/constants-browserify/build.sh b/node_modules/constants-browserify/build.sh deleted file mode 100755 index 60012d667..000000000 --- a/node_modules/constants-browserify/build.sh +++ /dev/null @@ -1 +0,0 @@ -node -pe 'JSON.stringify(require("constants"), null, " ")' > constants.json diff --git a/node_modules/constants-browserify/constants.json b/node_modules/constants-browserify/constants.json deleted file mode 100644 index 9a69b858d..000000000 --- a/node_modules/constants-browserify/constants.json +++ /dev/null @@ -1,209 +0,0 @@ -{ - "O_RDONLY": 0, - "O_WRONLY": 1, - "O_RDWR": 2, - "S_IFMT": 61440, - "S_IFREG": 32768, - "S_IFDIR": 16384, - "S_IFCHR": 8192, - "S_IFBLK": 24576, - "S_IFIFO": 4096, - "S_IFLNK": 40960, - "S_IFSOCK": 49152, - "O_CREAT": 512, - "O_EXCL": 2048, - "O_NOCTTY": 131072, - "O_TRUNC": 1024, - "O_APPEND": 8, - "O_DIRECTORY": 1048576, - "O_NOFOLLOW": 256, - "O_SYNC": 128, - "O_SYMLINK": 2097152, - "O_NONBLOCK": 4, - "S_IRWXU": 448, - "S_IRUSR": 256, - "S_IWUSR": 128, - "S_IXUSR": 64, - "S_IRWXG": 56, - "S_IRGRP": 32, - "S_IWGRP": 16, - "S_IXGRP": 8, - "S_IRWXO": 7, - "S_IROTH": 4, - "S_IWOTH": 2, - "S_IXOTH": 1, - "E2BIG": 7, - "EACCES": 13, - "EADDRINUSE": 48, - "EADDRNOTAVAIL": 49, - "EAFNOSUPPORT": 47, - "EAGAIN": 35, - "EALREADY": 37, - "EBADF": 9, - "EBADMSG": 94, - "EBUSY": 16, - "ECANCELED": 89, - "ECHILD": 10, - "ECONNABORTED": 53, - "ECONNREFUSED": 61, - "ECONNRESET": 54, - "EDEADLK": 11, - "EDESTADDRREQ": 39, - "EDOM": 33, - "EDQUOT": 69, - "EEXIST": 17, - "EFAULT": 14, - "EFBIG": 27, - "EHOSTUNREACH": 65, - "EIDRM": 90, - "EILSEQ": 92, - "EINPROGRESS": 36, - "EINTR": 4, - "EINVAL": 22, - "EIO": 5, - "EISCONN": 56, - "EISDIR": 21, - "ELOOP": 62, - "EMFILE": 24, - "EMLINK": 31, - "EMSGSIZE": 40, - "EMULTIHOP": 95, - "ENAMETOOLONG": 63, - "ENETDOWN": 50, - "ENETRESET": 52, - "ENETUNREACH": 51, - "ENFILE": 23, - "ENOBUFS": 55, - "ENODATA": 96, - "ENODEV": 19, - "ENOENT": 2, - "ENOEXEC": 8, - "ENOLCK": 77, - "ENOLINK": 97, - "ENOMEM": 12, - "ENOMSG": 91, - "ENOPROTOOPT": 42, - "ENOSPC": 28, - "ENOSR": 98, - "ENOSTR": 99, - "ENOSYS": 78, - "ENOTCONN": 57, - "ENOTDIR": 20, - "ENOTEMPTY": 66, - "ENOTSOCK": 38, - "ENOTSUP": 45, - "ENOTTY": 25, - "ENXIO": 6, - "EOPNOTSUPP": 102, - "EOVERFLOW": 84, - "EPERM": 1, - "EPIPE": 32, - "EPROTO": 100, - "EPROTONOSUPPORT": 43, - "EPROTOTYPE": 41, - "ERANGE": 34, - "EROFS": 30, - "ESPIPE": 29, - "ESRCH": 3, - "ESTALE": 70, - "ETIME": 101, - "ETIMEDOUT": 60, - "ETXTBSY": 26, - "EWOULDBLOCK": 35, - "EXDEV": 18, - "SIGHUP": 1, - "SIGINT": 2, - "SIGQUIT": 3, - "SIGILL": 4, - "SIGTRAP": 5, - "SIGABRT": 6, - "SIGIOT": 6, - "SIGBUS": 10, - "SIGFPE": 8, - "SIGKILL": 9, - "SIGUSR1": 30, - "SIGSEGV": 11, - "SIGUSR2": 31, - "SIGPIPE": 13, - "SIGALRM": 14, - "SIGTERM": 15, - "SIGCHLD": 20, - "SIGCONT": 19, - "SIGSTOP": 17, - "SIGTSTP": 18, - "SIGTTIN": 21, - "SIGTTOU": 22, - "SIGURG": 16, - "SIGXCPU": 24, - "SIGXFSZ": 25, - "SIGVTALRM": 26, - "SIGPROF": 27, - "SIGWINCH": 28, - "SIGIO": 23, - "SIGSYS": 12, - "SSL_OP_ALL": 2147486719, - "SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION": 262144, - "SSL_OP_CIPHER_SERVER_PREFERENCE": 4194304, - "SSL_OP_CISCO_ANYCONNECT": 32768, - "SSL_OP_COOKIE_EXCHANGE": 8192, - "SSL_OP_CRYPTOPRO_TLSEXT_BUG": 2147483648, - "SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS": 2048, - "SSL_OP_EPHEMERAL_RSA": 0, - "SSL_OP_LEGACY_SERVER_CONNECT": 4, - "SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER": 32, - "SSL_OP_MICROSOFT_SESS_ID_BUG": 1, - "SSL_OP_MSIE_SSLV2_RSA_PADDING": 0, - "SSL_OP_NETSCAPE_CA_DN_BUG": 536870912, - "SSL_OP_NETSCAPE_CHALLENGE_BUG": 2, - "SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG": 1073741824, - "SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG": 8, - "SSL_OP_NO_COMPRESSION": 131072, - "SSL_OP_NO_QUERY_MTU": 4096, - "SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION": 65536, - "SSL_OP_NO_SSLv2": 16777216, - "SSL_OP_NO_SSLv3": 33554432, - "SSL_OP_NO_TICKET": 16384, - "SSL_OP_NO_TLSv1": 67108864, - "SSL_OP_NO_TLSv1_1": 268435456, - "SSL_OP_NO_TLSv1_2": 134217728, - "SSL_OP_PKCS1_CHECK_1": 0, - "SSL_OP_PKCS1_CHECK_2": 0, - "SSL_OP_SINGLE_DH_USE": 1048576, - "SSL_OP_SINGLE_ECDH_USE": 524288, - "SSL_OP_SSLEAY_080_CLIENT_DH_BUG": 128, - "SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG": 0, - "SSL_OP_TLS_BLOCK_PADDING_BUG": 512, - "SSL_OP_TLS_D5_BUG": 256, - "SSL_OP_TLS_ROLLBACK_BUG": 8388608, - "ENGINE_METHOD_DSA": 2, - "ENGINE_METHOD_DH": 4, - "ENGINE_METHOD_RAND": 8, - "ENGINE_METHOD_ECDH": 16, - "ENGINE_METHOD_ECDSA": 32, - "ENGINE_METHOD_CIPHERS": 64, - "ENGINE_METHOD_DIGESTS": 128, - "ENGINE_METHOD_STORE": 256, - "ENGINE_METHOD_PKEY_METHS": 512, - "ENGINE_METHOD_PKEY_ASN1_METHS": 1024, - "ENGINE_METHOD_ALL": 65535, - "ENGINE_METHOD_NONE": 0, - "DH_CHECK_P_NOT_SAFE_PRIME": 2, - "DH_CHECK_P_NOT_PRIME": 1, - "DH_UNABLE_TO_CHECK_GENERATOR": 4, - "DH_NOT_SUITABLE_GENERATOR": 8, - "NPN_ENABLED": 1, - "RSA_PKCS1_PADDING": 1, - "RSA_SSLV23_PADDING": 2, - "RSA_NO_PADDING": 3, - "RSA_PKCS1_OAEP_PADDING": 4, - "RSA_X931_PADDING": 5, - "RSA_PKCS1_PSS_PADDING": 6, - "POINT_CONVERSION_COMPRESSED": 2, - "POINT_CONVERSION_UNCOMPRESSED": 4, - "POINT_CONVERSION_HYBRID": 6, - "F_OK": 0, - "R_OK": 4, - "W_OK": 2, - "X_OK": 1, - "UV_UDP_REUSEADDR": 4 -} diff --git a/node_modules/constants-browserify/package.json b/node_modules/constants-browserify/package.json deleted file mode 100644 index 50d7ad11e..000000000 --- a/node_modules/constants-browserify/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_from": "constants-browserify@~1.0.0", - "_id": "constants-browserify@1.0.0", - "_inBundle": false, - "_integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", - "_location": "/constants-browserify", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "constants-browserify@~1.0.0", - "name": "constants-browserify", - "escapedName": "constants-browserify", - "rawSpec": "~1.0.0", - "saveSpec": null, - "fetchSpec": "~1.0.0" - }, - "_requiredBy": [ - "/browserify" - ], - "_resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "_shasum": "c20b96d8c617748aaf1c16021760cd27fcb8cb75", - "_spec": "constants-browserify@~1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "Julian Gruber", - "email": "julian@juliangruber.com", - "url": "http://juliangruber.com" - }, - "bugs": { - "url": "https://github.com/juliangruber/constants-browserify/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "James J. Womack", - "email": "james@womack.io", - "url": "http://netflix.com" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "node's constants module for the browser", - "homepage": "https://github.com/juliangruber/constants-browserify", - "keywords": [ - "constants", - "node", - "browser", - "browserify" - ], - "license": "MIT", - "main": "constants.json", - "name": "constants-browserify", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/constants-browserify.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.0.0" -} diff --git a/node_modules/constants-browserify/test.js b/node_modules/constants-browserify/test.js deleted file mode 100644 index 58cc30198..000000000 --- a/node_modules/constants-browserify/test.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -var Assert = require('assert') -var Constants = require('./') - -try { - var nodeConstants = require('constants') - - Assert.deepEqual(nodeConstants, Constants, 'The constants file was not equal') -} - -catch (e) { - console.error(e) - console.error('\nTests failed!') - process.exit(1) -} - -console.info('Tests passed!') diff --git a/node_modules/convert-source-map/.npmignore b/node_modules/convert-source-map/.npmignore deleted file mode 100644 index de78e273f..000000000 --- a/node_modules/convert-source-map/.npmignore +++ /dev/null @@ -1,16 +0,0 @@ -lib-cov -*.seed -*.log -*.csv -*.dat -*.out -*.pid -*.gz - -pids -logs -results - -node_modules -npm-debug.log -tmp diff --git a/node_modules/convert-source-map/.travis.yml b/node_modules/convert-source-map/.travis.yml deleted file mode 100644 index a55b235f9..000000000 --- a/node_modules/convert-source-map/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.8 - - 0.10 - - 0.11 \ No newline at end of file diff --git a/node_modules/convert-source-map/LICENSE b/node_modules/convert-source-map/LICENSE deleted file mode 100644 index 41702c504..000000000 --- a/node_modules/convert-source-map/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2013 Thorsten Lorenz. -All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/convert-source-map/README.md b/node_modules/convert-source-map/README.md deleted file mode 100644 index e415fecc9..000000000 --- a/node_modules/convert-source-map/README.md +++ /dev/null @@ -1,121 +0,0 @@ -# convert-source-map [![build status](https://secure.travis-ci.org/thlorenz/convert-source-map.png)](http://travis-ci.org/thlorenz/convert-source-map) - -[![NPM](https://nodei.co/npm/convert-source-map.png?downloads=true&stars=true)](https://nodei.co/npm/convert-source-map/) - -Converts a source-map from/to different formats and allows adding/changing properties. - -```js -var convert = require('convert-source-map'); - -var json = convert - .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9vLmpzIiwic291cmNlcyI6WyJjb25zb2xlLmxvZyhcImhpXCIpOyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') - .toJSON(); - -var modified = convert - .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9vLmpzIiwic291cmNlcyI6WyJjb25zb2xlLmxvZyhcImhpXCIpOyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') - .setProperty('sources', [ 'CONSOLE.LOG("HI");' ]) - .toJSON(); - -console.log(json); -console.log(modified); -``` - -```json -{"version":3,"file":"foo.js","sources":["console.log(\"hi\");"],"names":[],"mappings":"AAAA","sourceRoot":"/"} -{"version":3,"file":"foo.js","sources":["CONSOLE.LOG(\"HI\");"],"names":[],"mappings":"AAAA","sourceRoot":"/"} -``` - -## API - -### fromObject(obj) - -Returns source map converter from given object. - -### fromJSON(json) - -Returns source map converter from given json string. - -### fromBase64(base64) - -Returns source map converter from given base64 encoded json string. - -### fromComment(comment) - -Returns source map converter from given base64 encoded json string prefixed with `//# sourceMappingURL=...`. - -### fromMapFileComment(comment, mapFileDir) - -Returns source map converter from given `filename` by parsing `//# sourceMappingURL=filename`. - -`filename` must point to a file that is found inside the `mapFileDir`. Most tools store this file right next to the -generated file, i.e. the one containing the source map. - -### fromSource(source[, largeSource]) - -Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was found. - -If `largeSource` is set to `true`, an algorithm that does not use regex is applied to find the source map. This is faster and especially useful if you're running into "call stack size exceeded" errors with the default algorithm. - -However, it is less accurate and may match content that isn't a source map comment. - -### fromMapFileSource(source, mapFileDir) - -Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was -found. - -The sourcemap will be read from the map file found by parsing `# sourceMappingURL=file` comment. For more info see -fromMapFileComment. - -### toObject() - -Returns a copy of the underlying source map. - -### toJSON([space]) - -Converts source map to json string. If `space` is given (optional), this will be passed to -[JSON.stringify](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/stringify) when the -JSON string is generated. - -### toBase64() - -Converts source map to base64 encoded json string. - -### toComment([options]) - -Converts source map to an inline comment that can be appended to the source-file. - -By default, the comment is formatted like: `//# sourceMappingURL=...`, which you would -normally see in a JS source file. - -When `options.multiline == true`, the comment is formatted like: `/*# sourceMappingURL=... */`, which you would find in a CSS source file. - -### addProperty(key, value) - -Adds given property to the source map. Throws an error if property already exists. - -### setProperty(key, value) - -Sets given property to the source map. If property doesn't exist it is added, otherwise its value is updated. - -### getProperty(key) - -Gets given property of the source map. - -### removeComments(src) - -Returns `src` with all source map comments removed - -### removeMapFileComments(src) - -Returns `src` with all source map comments pointing to map files removed. - -### commentRegex - -Returns the regex used to find source map comments. - -### mapFileCommentRegex - -Returns the regex used to find source map comments pointing to map files. - - -[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/thlorenz/convert-source-map/trend.png)](https://bitdeli.com/free "Bitdeli Badge") diff --git a/node_modules/convert-source-map/example/comment-to-json.js b/node_modules/convert-source-map/example/comment-to-json.js deleted file mode 100644 index dfab18617..000000000 --- a/node_modules/convert-source-map/example/comment-to-json.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -var convert = require('..'); - -var json = convert - .fromComment('//@ sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9vLmpzIiwic291cmNlcyI6WyJjb25zb2xlLmxvZyhcImhpXCIpOyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') - .toJSON(); - -var modified = convert - .fromComment('//@ sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9vLmpzIiwic291cmNlcyI6WyJjb25zb2xlLmxvZyhcImhpXCIpOyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') - .setProperty('sources', [ 'CONSOLE.LOG("HI");' ]) - .toJSON(); - -console.log(json); -console.log(modified); diff --git a/node_modules/convert-source-map/index.js b/node_modules/convert-source-map/index.js deleted file mode 100644 index bfe92d1e2..000000000 --- a/node_modules/convert-source-map/index.js +++ /dev/null @@ -1,156 +0,0 @@ -'use strict'; -var fs = require('fs'); -var path = require('path'); - -var commentRx = /^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+;)?base64,(.*)$/mg; -var mapFileCommentRx = - //Example (Extra space between slashes added to solve Safari bug. Exclude space in production): - // / /# sourceMappingURL=foo.js.map /*# sourceMappingURL=foo.js.map */ - /(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/mg - -function decodeBase64(base64) { - return new Buffer(base64, 'base64').toString(); -} - -function stripComment(sm) { - return sm.split(',').pop(); -} - -function readFromFileMap(sm, dir) { - // NOTE: this will only work on the server since it attempts to read the map file - - var r = mapFileCommentRx.exec(sm); - mapFileCommentRx.lastIndex = 0; - - // for some odd reason //# .. captures in 1 and /* .. */ in 2 - var filename = r[1] || r[2]; - var filepath = path.join(dir, filename); - - try { - return fs.readFileSync(filepath, 'utf8'); - } catch (e) { - throw new Error('An error occurred while trying to read the map file at ' + filepath + '\n' + e); - } -} - -function Converter (sm, opts) { - opts = opts || {}; - - if (opts.isFileComment) sm = readFromFileMap(sm, opts.commentFileDir); - if (opts.hasComment) sm = stripComment(sm); - if (opts.isEncoded) sm = decodeBase64(sm); - if (opts.isJSON || opts.isEncoded) sm = JSON.parse(sm); - - this.sourcemap = sm; -} - -function convertFromLargeSource(content){ - var lines = content.split('\n'); - var line; - // find first line which contains a source map starting at end of content - for (var i = lines.length - 1; i > 0; i--) { - line = lines[i] - if (~line.indexOf('sourceMappingURL=data:')) return exports.fromComment(line); - } -} - -Converter.prototype.toJSON = function (space) { - return JSON.stringify(this.sourcemap, null, space); -}; - -Converter.prototype.toBase64 = function () { - var json = this.toJSON(); - return new Buffer(json).toString('base64'); -}; - -Converter.prototype.toComment = function (options) { - var base64 = this.toBase64(); - var data = 'sourceMappingURL=data:application/json;base64,' + base64; - return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; -}; - -// returns copy instead of original -Converter.prototype.toObject = function () { - return JSON.parse(this.toJSON()); -}; - -Converter.prototype.addProperty = function (key, value) { - if (this.sourcemap.hasOwnProperty(key)) throw new Error('property %s already exists on the sourcemap, use set property instead'); - return this.setProperty(key, value); -}; - -Converter.prototype.setProperty = function (key, value) { - this.sourcemap[key] = value; - return this; -}; - -Converter.prototype.getProperty = function (key) { - return this.sourcemap[key]; -}; - -exports.fromObject = function (obj) { - return new Converter(obj); -}; - -exports.fromJSON = function (json) { - return new Converter(json, { isJSON: true }); -}; - -exports.fromBase64 = function (base64) { - return new Converter(base64, { isEncoded: true }); -}; - -exports.fromComment = function (comment) { - comment = comment - .replace(/^\/\*/g, '//') - .replace(/\*\/$/g, ''); - - return new Converter(comment, { isEncoded: true, hasComment: true }); -}; - -exports.fromMapFileComment = function (comment, dir) { - return new Converter(comment, { commentFileDir: dir, isFileComment: true, isJSON: true }); -}; - -// Finds last sourcemap comment in file or returns null if none was found -exports.fromSource = function (content, largeSource) { - if (largeSource) { - var res = convertFromLargeSource(content); - return res ? res : null; - } - - var m = content.match(commentRx); - commentRx.lastIndex = 0; - return m ? exports.fromComment(m.pop()) : null; -}; - -// Finds last sourcemap comment in file or returns null if none was found -exports.fromMapFileSource = function (content, dir) { - var m = content.match(mapFileCommentRx); - mapFileCommentRx.lastIndex = 0; - return m ? exports.fromMapFileComment(m.pop(), dir) : null; -}; - -exports.removeComments = function (src) { - commentRx.lastIndex = 0; - return src.replace(commentRx, ''); -}; - -exports.removeMapFileComments = function (src) { - mapFileCommentRx.lastIndex = 0; - return src.replace(mapFileCommentRx, ''); -}; - -Object.defineProperty(exports, 'commentRegex', { - get: function getCommentRegex () { - commentRx.lastIndex = 0; - return commentRx; - } -}); - -Object.defineProperty(exports, 'mapFileCommentRegex', { - get: function getMapFileCommentRegex () { - mapFileCommentRx.lastIndex = 0; - return mapFileCommentRx; - } -}); diff --git a/node_modules/convert-source-map/package.json b/node_modules/convert-source-map/package.json deleted file mode 100644 index 170417d55..000000000 --- a/node_modules/convert-source-map/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "_from": "convert-source-map@~1.1.0", - "_id": "convert-source-map@1.1.3", - "_inBundle": false, - "_integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", - "_location": "/convert-source-map", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "convert-source-map@~1.1.0", - "name": "convert-source-map", - "escapedName": "convert-source-map", - "rawSpec": "~1.1.0", - "saveSpec": null, - "fetchSpec": "~1.1.0" - }, - "_requiredBy": [ - "/combine-source-map" - ], - "_resolved": "http://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", - "_shasum": "4829c877e9fe49b3161f3bf3673888e204699860", - "_spec": "convert-source-map@~1.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/combine-source-map", - "author": { - "name": "Thorsten Lorenz", - "email": "thlorenz@gmx.de", - "url": "http://thlorenz.com" - }, - "bugs": { - "url": "https://github.com/thlorenz/convert-source-map/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Converts a source-map from/to different formats and allows adding/changing properties.", - "devDependencies": { - "inline-source-map": "~0.3.1", - "tap": "~0.4.13" - }, - "engine": { - "node": ">=0.6" - }, - "homepage": "https://github.com/thlorenz/convert-source-map", - "keywords": [ - "convert", - "sourcemap", - "source", - "map", - "browser", - "debug" - ], - "license": "MIT", - "main": "index.js", - "name": "convert-source-map", - "repository": { - "type": "git", - "url": "git://github.com/thlorenz/convert-source-map.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "1.1.3" -} diff --git a/node_modules/convert-source-map/test/comment-regex.js b/node_modules/convert-source-map/test/comment-regex.js deleted file mode 100644 index 16331ccb8..000000000 --- a/node_modules/convert-source-map/test/comment-regex.js +++ /dev/null @@ -1,138 +0,0 @@ -'use strict'; -/*jshint asi: true */ - -var test = require('tap').test - , generator = require('inline-source-map') - , rx = require('..').commentRegex - , mapFileRx = require('..').mapFileCommentRegex - -function comment(prefix, suffix) { - rx.lastIndex = 0; - return rx.test(prefix + 'sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' + suffix) -} - -function commentWithCharSet(prefix, suffix, sep) { - sep = sep || ':'; - rx.lastIndex = 0; - return rx.test(prefix + 'sourceMappingURL=data:application/json;charset' + sep +'utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' + suffix) -} - -// Source Map v2 Tests -test('comment regex old spec - @', function (t) { - [ - '//@ ', - ' //@ ', // with leading space - '\t//@ ', // with leading tab - '//@ ', // with leading text - '/*@ ', // multi line style - ' /*@ ', // multi line style with leading spaces - '\t/*@ ', // multi line style with leading tab - '/*@ ', // multi line style with leading text - ].forEach(function (x) { - t.ok(comment(x, ''), 'matches ' + x) - t.ok(commentWithCharSet(x, ''), 'matches ' + x + ' with charset') - t.ok(commentWithCharSet(x, '', '='), 'matches ' + x + ' with charset') - }); - - [ - ' @// @', - ' @/* @', - ].forEach(function (x) { t.ok(!comment(x, ''), 'should not match ' + x) }) - - t.end() -}) - -test('comment regex new spec - #', function (t) { - [ - ' //# ', // with leading spaces - '\t//# ', // with leading tab - '//# ', // with leading text - '/*# ', // multi line style - ' /*# ', // multi line style with leading spaces - '\t/*# ', // multi line style with leading tab - '/*# ', // multi line style with leading text - ].forEach(function (x) { - t.ok(comment(x, ''), 'matches ' + x) - t.ok(commentWithCharSet(x, ''), 'matches ' + x + ' with charset') - t.ok(commentWithCharSet(x, '', '='), 'matches ' + x + ' with charset') - }); - - [ - ' #// #', - ' #/* #', - ].forEach(function (x) { t.ok(!comment(x, ''), 'should not match ' + x) }) - - t.end() -}) - -function mapFileCommentWrap(s1, s2) { - mapFileRx.lastIndex = 0; - return mapFileRx.test(s1 + 'sourceMappingURL=foo.js.map' + s2) -} - -test('mapFileComment regex old spec - @', function (t) { - - [ - ['//@ ', ''], - [' //@ ', ''], // with leading spaces - ['\t//@ ', ''], // with a leading tab - ['///@ ', ''], // with a leading text - [';//@ ', ''], // with a leading text - ['return//@ ', ''], // with a leading text - ].forEach(function (x) { t.ok(mapFileCommentWrap(x[0], x[1]), 'matches ' + x.join(' :: ')) }); - - [ - [' @// @', ''], - ['var sm = "//@ ', '"'], // not inside a string - ['var sm = \'//@ ', '\''], // not inside a string - ['var sm = \' //@ ', '\''], // not inside a string - ].forEach(function (x) { t.ok(!mapFileCommentWrap(x[0], x[1]), 'does not match ' + x.join(' :: ')) }) - t.end() -}) - -test('mapFileComment regex new spec - #', function (t) { - [ - ['//# ', ''], - [' //# ', ''], // with leading space - ['\t//# ', ''], // with leading tab - ['///# ', ''], // with leading text - [';//# ', ''], // with leading text - ['return//# ', ''], // with leading text - ].forEach(function (x) { t.ok(mapFileCommentWrap(x[0], x[1]), 'matches ' + x.join(' :: ')) }); - - [ - [' #// #', ''], - ['var sm = "//# ', '"'], // not inside a string - ['var sm = \'//# ', '\''], // not inside a string - ['var sm = \' //# ', '\''], // not inside a string - ].forEach(function (x) { t.ok(!mapFileCommentWrap(x[0], x[1]), 'does not match ' + x.join(' :: ')) }) - t.end() -}) - -test('mapFileComment regex /* */ old spec - @', function (t) { - [ [ '/*@ ', '*/' ] - , [' /*@ ', ' */ ' ] // with leading spaces - , [ '\t/*@ ', ' \t*/\t '] // with a leading tab - , [ 'leading string/*@ ', '*/' ] // with a leading string - , [ '/*@ ', ' \t*/\t '] // with trailing whitespace - ].forEach(function (x) { t.ok(mapFileCommentWrap(x[0], x[1]), 'matches ' + x.join(' :: ')) }); - - [ ['/*@ ', ' */ */ ' ], // not the last thing on its line - ['/*@ ', ' */ more text ' ] // not the last thing on its line - ].forEach(function (x) { t.ok(!mapFileCommentWrap(x[0], x[1]), 'does not match ' + x.join(' :: ')) }); - t.end() -}) - -test('mapFileComment regex /* */ new spec - #', function (t) { - [ [ '/*# ', '*/' ] - , [' /*# ', ' */ ' ] // with leading spaces - , [ '\t/*# ', ' \t*/\t '] // with a leading tab - , [ 'leading string/*# ', '*/' ] // with a leading string - , [ '/*# ', ' \t*/\t '] // with trailing whitespace - ].forEach(function (x) { t.ok(mapFileCommentWrap(x[0], x[1]), 'matches ' + x.join(' :: ')) }); - - [ ['/*# ', ' */ */ ' ], // not the last thing on its line - ['/*# ', ' */ more text ' ] // not the last thing on its line - ].forEach(function (x) { t.ok(!mapFileCommentWrap(x[0], x[1]), 'does not match ' + x.join(' :: ')) }); - t.end() -}) diff --git a/node_modules/convert-source-map/test/convert-source-map.js b/node_modules/convert-source-map/test/convert-source-map.js deleted file mode 100644 index 9bd3ba91e..000000000 --- a/node_modules/convert-source-map/test/convert-source-map.js +++ /dev/null @@ -1,207 +0,0 @@ -'use strict'; -/*jshint asi: true */ - -var test = require('tap').test - , generator = require('inline-source-map') - , convert = require('..') - -var gen = generator() - .addMappings('foo.js', [{ original: { line: 2, column: 3 } , generated: { line: 5, column: 10 } }], { line: 5 }) - .addGeneratedMappings('bar.js', 'var a = 2;\nconsole.log(a)', { line: 23, column: 22 }) - - , base64 = gen.base64Encode() - , comment = gen.inlineMappingUrl() - , json = gen.toString() - , obj = JSON.parse(json) - -test('different formats', function (t) { - - t.equal(convert.fromComment(comment).toComment(), comment, 'comment -> comment') - t.equal(convert.fromComment(comment).toBase64(), base64, 'comment -> base64') - t.equal(convert.fromComment(comment).toJSON(), json, 'comment -> json') - t.deepEqual(convert.fromComment(comment).toObject(), obj, 'comment -> object') - - t.equal(convert.fromBase64(base64).toBase64(), base64, 'base64 -> base64') - t.equal(convert.fromBase64(base64).toComment(), comment, 'base64 -> comment') - t.equal(convert.fromBase64(base64).toJSON(), json, 'base64 -> json') - t.deepEqual(convert.fromBase64(base64).toObject(), obj, 'base64 -> object') - - t.equal(convert.fromJSON(json).toJSON(), json, 'json -> json') - t.equal(convert.fromJSON(json).toBase64(), base64, 'json -> base64') - t.equal(convert.fromJSON(json).toComment(), comment, 'json -> comment') - t.deepEqual(convert.fromJSON(json).toObject(), obj, 'json -> object') - t.end() -}) - -test('to object returns a copy', function (t) { - var c = convert.fromJSON(json) - var o = c.toObject() - o.version = '99'; - t.equal(c.toObject().version, 3, 'setting property on returned object does not affect original') - t.end() -}) - -test('to multi-line map', function (t) { - var c = convert.fromObject(obj); - var s = c.toComment({ multiline: true }); - t.similar(s, /^\/\*# sourceMappingURL=.+ \*\/$/); - t.end(); -}) - -test('from source', function (t) { - var foo = [ - 'function foo() {' - , ' console.log("hello I am foo");' - , ' console.log("who are you");' - , '}' - , '' - , 'foo();' - , '' - ].join('\n') - , map = '//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' - , otherMap = '//# sourceMappingURL=data:application/json;base64,otherZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' - - function getComment(src) { - var map = convert.fromSource(src); - return map ? map.toComment() : null; - } - - t.equal(getComment(foo), null, 'no comment returns null') - t.equal(getComment(foo + map), map, 'beginning of last line') - t.equal(getComment(foo + ' ' + map), map, 'indented of last line') - t.equal(getComment(foo + ' ' + map + '\n\n'), map, 'indented on last non empty line') - t.equal(getComment(foo + map + '\nconsole.log("more code");\nfoo()\n'), map, 'in the middle of code') - t.equal(getComment(foo + otherMap + '\n' + map), map, 'finds last map in source') - t.end() -}) - -test('from source with a large source', function (t) { - var foo = [ - 'function foo() {' - , ' console.log("hello I am foo");' - , ' console.log("who are you");' - , '}' - , '' - , 'foo();' - , '' - ].join('\n') - , map = '//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' - , otherMap = '//# sourceMappingURL=data:application/json;base64,otherZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' - - function getComment(src) { - var map = convert.fromSource(src, true); - return map ? map.toComment() : null; - } - - t.equal(getComment(foo), null, 'no comment returns null') - t.equal(getComment(foo + map), map, 'beginning of last line') - t.equal(getComment(foo + ' ' + map), map, 'indented of last line') - t.equal(getComment(foo + ' ' + map + '\n\n'), map, 'indented on last non empty line') - t.equal(getComment(foo + map + '\nconsole.log("more code");\nfoo()\n'), map, 'in the middle of code') - t.equal(getComment(foo + otherMap + '\n' + map), map, 'finds last map in source') - t.end() -}) - -test('remove comments', function (t) { - var foo = [ - 'function foo() {' - , ' console.log("hello I am foo");' - , ' console.log("who are you");' - , '}' - , '' - , 'foo();' - , '' - ].join('\n') - // this one is old spec on purpose - , map = '//@ sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' - , otherMap = '//# sourceMappingURL=data:application/json;base64,ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmdW5jdGlvbiBmb28oKSB7XG4gY29uc29sZS5sb2coXCJoZWxsbyBJIGFtIGZvb1wiKTtcbiBjb25zb2xlLmxvZyhcIndobyBhcmUgeW91XCIpO1xufVxuXG5mb28oKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9' - , extraCode = '\nconsole.log("more code");\nfoo()\n' - - t.equal(convert.removeComments(foo + map), foo, 'from last line') - t.equal(convert.removeComments(foo + map + extraCode), foo + extraCode, 'from the middle of code') - t.equal(convert.removeComments(foo + otherMap + extraCode + map), foo + extraCode, 'multiple comments from the middle of code') - t.end() -}) - -test('remove map file comments', function (t) { - var foo = [ - 'function foo() {' - , ' console.log("hello I am foo");' - , ' console.log("who are you");' - , '}' - , '' - , 'foo();' - , '' - ].join('\n') - , fileMap1 = '//# sourceMappingURL=foo.js.map' - , fileMap2 = '/*# sourceMappingURL=foo.js.map */'; - - t.equal(convert.removeMapFileComments(foo + fileMap1), foo, '// style filemap comment') - t.equal(convert.removeMapFileComments(foo + fileMap2), foo, '/* */ style filemap comment') - t.end() -}) - -test('pretty json', function (t) { - var mod = convert.fromJSON(json).toJSON(2) - , expected = JSON.stringify(obj, null, 2); - - t.equal( - mod - , expected - , 'pretty prints json when space is given') - t.end() -}) - -test('adding properties', function (t) { - var mod = convert - .fromJSON(json) - .addProperty('foo', 'bar') - .toJSON() - , expected = JSON.parse(json); - expected.foo = 'bar'; - t.equal( - mod - , JSON.stringify(expected) - , 'includes added property' - ) - t.end() -}) - -test('setting properties', function (t) { - var mod = convert - .fromJSON(json) - .setProperty('version', '2') - .setProperty('mappings', ';;;UACG') - .setProperty('should add', 'this') - .toJSON() - , expected = JSON.parse(json); - expected.version = '2'; - expected.mappings = ';;;UACG'; - expected['should add'] = 'this'; - t.equal( - mod - , JSON.stringify(expected) - , 'includes new property and changes existing properties' - ) - t.end() -}) - -test('getting properties', function (t) { - var sm = convert.fromJSON(json) - - t.equal(sm.getProperty('version'), 3, 'gets version') - t.deepEqual(sm.getProperty('sources'), ['foo.js', 'bar.js'], 'gets sources') - t.end() -}) - -test('return null fromSource when largeSource is true', function(t) { - var mod = convert.fromSource('', true) - , expected = null; - - t.equal( - mod - , expected - , 'return value should be null' - ) - t.end() -}) diff --git a/node_modules/convert-source-map/test/fixtures/map-file-comment-double-slash.css b/node_modules/convert-source-map/test/fixtures/map-file-comment-double-slash.css deleted file mode 100644 index e77799167..000000000 --- a/node_modules/convert-source-map/test/fixtures/map-file-comment-double-slash.css +++ /dev/null @@ -1,14 +0,0 @@ -.header { - background: #444; - border: solid; - padding: 10px; - border-radius: 10px 5px 10px 5px; - color: #b4b472; } - -#main li { - color: green; - margin: 10px; - padding: 10px; - font-size: 18px; } - -//# sourceMappingURL=map-file-comment.css.map diff --git a/node_modules/convert-source-map/test/fixtures/map-file-comment-inline.css b/node_modules/convert-source-map/test/fixtures/map-file-comment-inline.css deleted file mode 100644 index 1e61b2417..000000000 --- a/node_modules/convert-source-map/test/fixtures/map-file-comment-inline.css +++ /dev/null @@ -1,14 +0,0 @@ -.header { - background: #444; - border: solid; - padding: 10px; - border-radius: 10px 5px 10px 5px; - color: #b4b472; } - -#main li { - color: green; - margin: 10px; - padding: 10px; - font-size: 18px; } - -/*# sourceMappingURL=data:application/json;base64,ewoidmVyc2lvbiI6ICIzIiwKIm1hcHBpbmdzIjogIkFBQUEsd0JBQXlCO0VBQ3ZCLFVBQVUsRUFBRSxJQUFJO0VBQ2hCLE1BQU0sRUFBRSxLQUFLO0VBQ2IsT0FBTyxFQUFFLElBQUk7RUFDYixhQUFhLEVBQUUsaUJBQWlCO0VBQ2hDLEtBQUssRUFBRSxPQUFrQjs7QUFHM0Isd0JBQXlCO0VBQ3ZCLE9BQU8sRUFBRSxJQUFJOztBQ1RmLGdCQUFpQjtFQUNmLFVBQVUsRUFBRSxJQUFJO0VBQ2hCLEtBQUssRUFBRSxNQUFNOztBQUdmLGtCQUFtQjtFQUNqQixNQUFNLEVBQUUsSUFBSTtFQUNaLE9BQU8sRUFBRSxJQUFJO0VBQ2IsVUFBVSxFQUFFLEtBQUs7RUFDakIsYUFBYSxFQUFFLEdBQUc7RUFDbEIsS0FBSyxFQUFFLEtBQUs7O0FBRWQsa0JBQW1CO0VBQ2pCLEtBQUssRUFBRSxLQUFLOztBQUdkLG1CQUFvQjtFQUNsQixLQUFLLEVBQUUsS0FBSztFQUNaLE1BQU0sRUFBRSxJQUFJO0VBQ1osT0FBTyxFQUFFLElBQUk7RUFDYixTQUFTLEVBQUUsSUFBSSIsCiJzb3VyY2VzIjogWyIuL2NsaWVudC9zYXNzL2NvcmUuc2NzcyIsIi4vY2xpZW50L3Nhc3MvbWFpbi5zY3NzIl0sCiJmaWxlIjogIm1hcC1maWxlLWNvbW1lbnQuY3NzIgp9 */ diff --git a/node_modules/convert-source-map/test/fixtures/map-file-comment.css b/node_modules/convert-source-map/test/fixtures/map-file-comment.css deleted file mode 100644 index 8b282680a..000000000 --- a/node_modules/convert-source-map/test/fixtures/map-file-comment.css +++ /dev/null @@ -1,14 +0,0 @@ -.header { - background: #444; - border: solid; - padding: 10px; - border-radius: 10px 5px 10px 5px; - color: #b4b472; } - -#main li { - color: green; - margin: 10px; - padding: 10px; - font-size: 18px; } - -/*# sourceMappingURL=map-file-comment.css.map */ diff --git a/node_modules/convert-source-map/test/fixtures/map-file-comment.css.map b/node_modules/convert-source-map/test/fixtures/map-file-comment.css.map deleted file mode 100644 index 25950ea24..000000000 --- a/node_modules/convert-source-map/test/fixtures/map-file-comment.css.map +++ /dev/null @@ -1,6 +0,0 @@ -{ -"version": "3", -"mappings": "AAAA,wBAAyB;EACvB,UAAU,EAAE,IAAI;EAChB,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,IAAI;EACb,aAAa,EAAE,iBAAiB;EAChC,KAAK,EAAE,OAAkB;;AAG3B,wBAAyB;EACvB,OAAO,EAAE,IAAI;;ACTf,gBAAiB;EACf,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,MAAM;;AAGf,kBAAmB;EACjB,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,UAAU,EAAE,KAAK;EACjB,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,KAAK;;AAEd,kBAAmB;EACjB,KAAK,EAAE,KAAK;;AAGd,mBAAoB;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,SAAS,EAAE,IAAI", -"sources": ["./client/sass/core.scss","./client/sass/main.scss"], -"file": "map-file-comment.css" -} diff --git a/node_modules/convert-source-map/test/map-file-comment.js b/node_modules/convert-source-map/test/map-file-comment.js deleted file mode 100644 index b41678777..000000000 --- a/node_modules/convert-source-map/test/map-file-comment.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict'; -/*jshint asi: true */ - -var test = require('tap').test - , rx = require('..') - , fs = require('fs') - , convert = require('..') - -test('\nresolving a "/*# sourceMappingURL=map-file-comment.css.map*/" style comment inside a given css content', function (t) { - var css = fs.readFileSync(__dirname + '/fixtures/map-file-comment.css', 'utf8') - var conv = convert.fromMapFileSource(css, __dirname + '/fixtures'); - var sm = conv.toObject(); - - t.deepEqual( - sm.sources - , [ './client/sass/core.scss', - './client/sass/main.scss' ] - , 'resolves paths of original sources' - ) - - t.equal(sm.file, 'map-file-comment.css', 'includes filename of generated file') - t.equal( - sm.mappings - , 'AAAA,wBAAyB;EACvB,UAAU,EAAE,IAAI;EAChB,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,IAAI;EACb,aAAa,EAAE,iBAAiB;EAChC,KAAK,EAAE,OAAkB;;AAG3B,wBAAyB;EACvB,OAAO,EAAE,IAAI;;ACTf,gBAAiB;EACf,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,MAAM;;AAGf,kBAAmB;EACjB,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,UAAU,EAAE,KAAK;EACjB,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,KAAK;;AAEd,kBAAmB;EACjB,KAAK,EAAE,KAAK;;AAGd,mBAAoB;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,SAAS,EAAE,IAAI' - , 'includes mappings' - ) - t.end() -}) - -test('\nresolving a "//# sourceMappingURL=map-file-comment.css.map" style comment inside a given css content', function (t) { - var css = fs.readFileSync(__dirname + '/fixtures/map-file-comment-double-slash.css', 'utf8') - var conv = convert.fromMapFileSource(css, __dirname + '/fixtures'); - var sm = conv.toObject(); - - t.deepEqual( - sm.sources - , [ './client/sass/core.scss', - './client/sass/main.scss' ] - , 'resolves paths of original sources' - ) - - t.equal(sm.file, 'map-file-comment.css', 'includes filename of generated file') - t.equal( - sm.mappings - , 'AAAA,wBAAyB;EACvB,UAAU,EAAE,IAAI;EAChB,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,IAAI;EACb,aAAa,EAAE,iBAAiB;EAChC,KAAK,EAAE,OAAkB;;AAG3B,wBAAyB;EACvB,OAAO,EAAE,IAAI;;ACTf,gBAAiB;EACf,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,MAAM;;AAGf,kBAAmB;EACjB,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,UAAU,EAAE,KAAK;EACjB,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,KAAK;;AAEd,kBAAmB;EACjB,KAAK,EAAE,KAAK;;AAGd,mBAAoB;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,SAAS,EAAE,IAAI' - , 'includes mappings' - ) - t.end() -}) - -test('\nresolving a /*# sourceMappingURL=data:application/json;base64,... */ style comment inside a given css content', function(t) { - var css = fs.readFileSync(__dirname + '/fixtures/map-file-comment-inline.css', 'utf8') - var conv = convert.fromSource(css, __dirname + '/fixtures') - var sm = conv.toObject() - - t.deepEqual( - sm.sources - , [ './client/sass/core.scss', - './client/sass/main.scss' ] - , 'resolves paths of original sources' - ) - - t.equal(sm.file, 'map-file-comment.css', 'includes filename of generated file') - t.equal( - sm.mappings - , 'AAAA,wBAAyB;EACvB,UAAU,EAAE,IAAI;EAChB,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,IAAI;EACb,aAAa,EAAE,iBAAiB;EAChC,KAAK,EAAE,OAAkB;;AAG3B,wBAAyB;EACvB,OAAO,EAAE,IAAI;;ACTf,gBAAiB;EACf,UAAU,EAAE,IAAI;EAChB,KAAK,EAAE,MAAM;;AAGf,kBAAmB;EACjB,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,UAAU,EAAE,KAAK;EACjB,aAAa,EAAE,GAAG;EAClB,KAAK,EAAE,KAAK;;AAEd,kBAAmB;EACjB,KAAK,EAAE,KAAK;;AAGd,mBAAoB;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,IAAI;EACb,SAAS,EAAE,IAAI' - , 'includes mappings' - ) - t.end() -}) diff --git a/node_modules/copy-descriptor/LICENSE b/node_modules/copy-descriptor/LICENSE deleted file mode 100644 index 652517172..000000000 --- a/node_modules/copy-descriptor/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2016, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/copy-descriptor/index.js b/node_modules/copy-descriptor/index.js deleted file mode 100644 index 6da21b1b0..000000000 --- a/node_modules/copy-descriptor/index.js +++ /dev/null @@ -1,81 +0,0 @@ -/*! - * copy-descriptor - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -/** - * Copy a descriptor from one object to another. - * - * ```js - * function App() { - * this.cache = {}; - * } - * App.prototype.set = function(key, val) { - * this.cache[key] = val; - * return this; - * }; - * Object.defineProperty(App.prototype, 'count', { - * get: function() { - * return Object.keys(this.cache).length; - * } - * }); - * - * copy(App.prototype, 'count', 'len'); - * - * // create an instance - * var app = new App(); - * - * app.set('a', true); - * app.set('b', true); - * app.set('c', true); - * - * console.log(app.count); - * //=> 3 - * console.log(app.len); - * //=> 3 - * ``` - * @name copy - * @param {Object} `receiver` The target object - * @param {Object} `provider` The provider object - * @param {String} `from` The key to copy on provider. - * @param {String} `to` Optionally specify a new key name to use. - * @return {Object} - * @api public - */ - -module.exports = function copyDescriptor(receiver, provider, from, to) { - if (!isObject(provider) && typeof provider !== 'function') { - to = from; - from = provider; - provider = receiver; - } - if (!isObject(receiver) && typeof receiver !== 'function') { - throw new TypeError('expected the first argument to be an object'); - } - if (!isObject(provider) && typeof provider !== 'function') { - throw new TypeError('expected provider to be an object'); - } - - if (typeof to !== 'string') { - to = from; - } - if (typeof from !== 'string') { - throw new TypeError('expected key to be a string'); - } - - if (!(from in provider)) { - throw new Error('property "' + from + '" does not exist'); - } - - var val = Object.getOwnPropertyDescriptor(provider, from); - if (val) Object.defineProperty(receiver, to, val); -}; - -function isObject(val) { - return {}.toString.call(val) === '[object Object]'; -} - diff --git a/node_modules/copy-descriptor/package.json b/node_modules/copy-descriptor/package.json deleted file mode 100644 index 7d4fc0298..000000000 --- a/node_modules/copy-descriptor/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_from": "copy-descriptor@^0.1.0", - "_id": "copy-descriptor@0.1.1", - "_inBundle": false, - "_integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "_location": "/copy-descriptor", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "copy-descriptor@^0.1.0", - "name": "copy-descriptor", - "escapedName": "copy-descriptor", - "rawSpec": "^0.1.0", - "saveSpec": null, - "fetchSpec": "^0.1.0" - }, - "_requiredBy": [ - "/object-copy" - ], - "_resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "_shasum": "676f6eb3c39997c2ee1ac3a924fd6124748f578d", - "_spec": "copy-descriptor@^0.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/object-copy", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/copy-descriptor/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Copy a descriptor from object A to object B", - "devDependencies": { - "gulp-format-md": "^0.1.9", - "mocha": "^2.5.3" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/copy-descriptor", - "keywords": [ - "copy", - "descriptor" - ], - "license": "MIT", - "main": "index.js", - "name": "copy-descriptor", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/copy-descriptor.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "is-accessor-descriptor", - "is-data-descriptor", - "is-descriptor", - "is-plain-object", - "isobject" - ] - }, - "lint": { - "reflinks": true - }, - "reflinks": [ - "verb-readme-generator", - "verb" - ] - }, - "version": "0.1.1" -} diff --git a/node_modules/core-js/CHANGELOG.md b/node_modules/core-js/CHANGELOG.md deleted file mode 100644 index 382c3c2d5..000000000 --- a/node_modules/core-js/CHANGELOG.md +++ /dev/null @@ -1,667 +0,0 @@ -## Changelog -##### 2.5.7 - 2018.05.26 -- Get rid of reserved variable name `final`, related [#400](https://github.com/zloirock/core-js/issues/400) - -##### 2.5.6 - 2018.05.07 -- Forced replace native `Promise` in V8 6.6 (Node 10 and Chrome 66) because of [a bug with resolving custom thenables](https://bugs.chromium.org/p/chromium/issues/detail?id=830565) -- Added a workaround for usage buggy native LG WebOS 2 `Promise` in microtask implementation, [#396](https://github.com/zloirock/core-js/issues/396) -- Added modern version internal debugging information about used versions - -##### 2.5.5 - 2018.04.08 -- Fix some edge cases of `Reflect.set`, [#392](https://github.com/zloirock/core-js/issues/392) and [#393](https://github.com/zloirock/core-js/issues/393) - -##### 2.5.4 - 2018.03.27 -- Fixed one case of deoptimization built-in iterators in V8, related [#377](https://github.com/zloirock/core-js/issues/377) -- Fixed some cases of iterators feature detection, [#368](https://github.com/zloirock/core-js/issues/368) -- Fixed manually entered NodeJS domains issue in `Promise`, [#367](https://github.com/zloirock/core-js/issues/367) -- Fixed `Number.{parseInt, parseFloat}` entry points -- Fixed `__(define|lookup)[GS]etter__` import in the `library` version - -##### 2.5.3 - 2017.12.12 -- Fixed calling `onunhandledrejectionhandler` multiple times for one `Promise` chain, [#318](https://github.com/zloirock/core-js/issues/318) -- Forced replacement of `String#{padStart, padEnd}` in Safari 10 because of [a bug](https://bugs.webkit.org/show_bug.cgi?id=161944), [#280](https://github.com/zloirock/core-js/issues/280) -- Fixed `Array#@@iterator` in a very rare version of `WebKit`, [#236](https://github.com/zloirock/core-js/issues/236) and [#237](https://github.com/zloirock/core-js/issues/237) -- One more [#345](https://github.com/zloirock/core-js/issues/345)-related fix - -##### 2.5.2 - 2017.12.09 -- `MutationObserver` no longer used for microtask implementation in iOS Safari because of bug with scrolling, [#339](https://github.com/zloirock/core-js/issues/339) -- Fixed `JSON.stringify(undefined, replacer)` case in the wrapper from the `Symbol` polyfill, [#345](https://github.com/zloirock/core-js/issues/345) -- `Array()` calls changed to `new Array()` for V8 optimisation - -##### 2.5.1 - 2017.09.01 -- Updated `Promise#finally` per [tc39/proposal-promise-finally#37](https://github.com/tc39/proposal-promise-finally/issues/37) -- Optimized usage of some internal helpers for reducing size of `shim` version -- Fixed some entry points for virtual methods - -##### 2.5.0 - 2017.08.05 -- Added `Promise#finally` [stage 3 proposal](https://github.com/tc39/proposal-promise-finally), [#225](https://github.com/zloirock/core-js/issues/225) -- Added `Promise.try` [stage 1 proposal](https://github.com/tc39/proposal-promise-try) -- Added `Array#flatten` and `Array#flatMap` [stage 1 proposal](https://tc39.github.io/proposal-flatMap) -- Added `.of` and `.from` methods on collection constructors [stage 1 proposal](https://github.com/tc39/proposal-setmap-offrom): - - `Map.of` - - `Set.of` - - `WeakSet.of` - - `WeakMap.of` - - `Map.from` - - `Set.from` - - `WeakSet.from` - - `WeakMap.from` -- Added `Math` extensions [stage 1 proposal](https://github.com/rwaldron/proposal-math-extensions), [#226](https://github.com/zloirock/core-js/issues/226): - - `Math.clamp` - - `Math.DEG_PER_RAD` - - `Math.degrees` - - `Math.fscale` - - `Math.RAD_PER_DEG` - - `Math.radians` - - `Math.scale` -- Added `Math.signbit` [stage 1 proposal](http://jfbastien.github.io/papers/Math.signbit.html) -- Updated `global` [stage 3 proposal](https://github.com/tc39/proposal-global) - added `global` global object, `System.global` deprecated -- Updated `Object.getOwnPropertyDescriptors` to the [final version](https://tc39.github.io/ecma262/2017/#sec-object.getownpropertydescriptors) - it should not create properties if descriptors are `undefined` -- Updated the list of iterable DOM collections, [#249](https://github.com/zloirock/core-js/issues/249), added: - - `CSSStyleDeclaration#@@iterator` - - `CSSValueList#@@iterator` - - `ClientRectList#@@iterator` - - `DOMRectList#@@iterator` - - `DOMStringList#@@iterator` - - `DataTransferItemList#@@iterator` - - `FileList#@@iterator` - - `HTMLAllCollection#@@iterator` - - `HTMLCollection#@@iterator` - - `HTMLFormElement#@@iterator` - - `HTMLSelectElement#@@iterator` - - `MimeTypeArray#@@iterator` - - `NamedNodeMap#@@iterator` - - `PaintRequestList#@@iterator` - - `Plugin#@@iterator` - - `PluginArray#@@iterator` - - `SVGLengthList#@@iterator` - - `SVGNumberList#@@iterator` - - `SVGPathSegList#@@iterator` - - `SVGPointList#@@iterator` - - `SVGStringList#@@iterator` - - `SVGTransformList#@@iterator` - - `SourceBufferList#@@iterator` - - `TextTrackCueList#@@iterator` - - `TextTrackList#@@iterator` - - `TouchList#@@iterator` -- Updated stages of proposals: - - [`Object.getOwnPropertyDescriptors`](https://github.com/tc39/proposal-object-getownpropertydescriptors) to [stage 4 (ES2017)](https://tc39.github.io/ecma262/2017/#sec-object.getownpropertydescriptors) - - [String padding](https://github.com/tc39/proposal-string-pad-start-end) to [stage 4 (ES2017)](https://tc39.github.io/ecma262/2017/#sec-string.prototype.padend) - - [`global`](https://github.com/tc39/proposal-global) to [stage 3](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-09/sept-28.md#revisit-systemglobal--global) - - [String trimming](https://github.com/tc39/proposal-string-left-right-trim) to [stage 2](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-07/jul-27.md#10iic-trimstarttrimend) -- Updated typed arrays to the modern (ES2016+) arguments validation, -[#293](https://github.com/zloirock/core-js/pull/293) -- Fixed `%TypedArray%.from` Safari bug, [#285](https://github.com/zloirock/core-js/issues/285) -- Fixed compatibility with old version of Prototype.js, [#278](https://github.com/zloirock/core-js/issues/278), [#289](https://github.com/zloirock/core-js/issues/289) -- `Function#name` no longer cache the result for correct behaviour with inherited constructors, [#296](https://github.com/zloirock/core-js/issues/296) -- Added errors on incorrect context of collection methods, [#272](https://github.com/zloirock/core-js/issues/272) -- Fixed conversion typed array constructors to string, fix [#300](https://github.com/zloirock/core-js/issues/300) -- Fixed `Set#size` with debugger ReactNative for Android, [#297](https://github.com/zloirock/core-js/issues/297) -- Fixed an issue with Electron-based debugger, [#230](https://github.com/zloirock/core-js/issues/230) -- Fixed compatibility with incomplete third-party `WeakMap` polyfills, [#252](https://github.com/zloirock/core-js/pull/252) -- Added a fallback for `Date#toJSON` in engines without native `Date#toISOString`, [#220](https://github.com/zloirock/core-js/issues/220) -- Added support for Sphere Dispatch API, [#286](https://github.com/zloirock/core-js/pull/286) -- Seriously changed the coding style and the [ESLint config](https://github.com/zloirock/core-js/blob/master/.eslintrc.js) -- Updated many dev dependencies (`webpack`, `uglify`, etc) -- Some other minor fixes and optimizations - -##### 2.4.1 - 2016.07.18 -- Fixed `script` tag for some parsers, [#204](https://github.com/zloirock/core-js/issues/204), [#216](https://github.com/zloirock/core-js/issues/216) -- Removed some unused variables, [#217](https://github.com/zloirock/core-js/issues/217), [#218](https://github.com/zloirock/core-js/issues/218) -- Fixed MS Edge `Reflect.construct` and `Reflect.apply` - they should not allow primitive as `argumentsList` argument - -##### 1.2.7 [LEGACY] - 2016.07.18 -- Some fixes for issues like [#159](https://github.com/zloirock/core-js/issues/159), [#186](https://github.com/zloirock/core-js/issues/186), [#194](https://github.com/zloirock/core-js/issues/194), [#207](https://github.com/zloirock/core-js/issues/207) - -##### 2.4.0 - 2016.05.08 -- Added `Observable`, [stage 1 proposal](https://github.com/zenparsing/es-observable) -- Fixed behavior `Object.{getOwnPropertySymbols, getOwnPropertyDescriptor}` and `Object#propertyIsEnumerable` on `Object.prototype` -- `Reflect.construct` and `Reflect.apply` should throw an error if `argumentsList` argument is not an object, [#194](https://github.com/zloirock/core-js/issues/194) - -##### 2.3.0 - 2016.04.24 -- Added `asap` for enqueuing microtasks, [stage 0 proposal](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask) -- Added well-known symbol `Symbol.asyncIterator` for [stage 2 async iteration proposal](https://github.com/tc39/proposal-async-iteration) -- Added well-known symbol `Symbol.observable` for [stage 1 observables proposal](https://github.com/zenparsing/es-observable) -- `String#{padStart, padEnd}` returns original string if filler is empty string, [TC39 meeting notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-03/march-29.md#stringprototypepadstartpadend) -- `Object.values` and `Object.entries` moved to stage 4 from 3, [TC39 meeting notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-03/march-29.md#objectvalues--objectentries) -- `System.global` moved to stage 2 from 1, [TC39 meeting notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-03/march-29.md#systemglobal) -- `Map#toJSON` and `Set#toJSON` rejected and will be removed from the next major release, [TC39 meeting notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-03/march-31.md#mapprototypetojsonsetprototypetojson) -- `Error.isError` withdrawn and will be removed from the next major release, [TC39 meeting notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-03/march-29.md#erroriserror) -- Added fallback for `Function#name` on non-extensible functions and functions with broken `toString` conversion, [#193](https://github.com/zloirock/core-js/issues/193) - -##### 2.2.2 - 2016.04.06 -- Added conversion `-0` to `+0` to `Array#{indexOf, lastIndexOf}`, [ES2016 fix](https://github.com/tc39/ecma262/pull/316) -- Added fixes for some `Math` methods in Tor Browser -- `Array.{from, of}` no longer calls prototype setters -- Added workaround over Chrome DevTools strange behavior, [#186](https://github.com/zloirock/core-js/issues/186) - -##### 2.2.1 - 2016.03.19 -- Fixed `Object.getOwnPropertyNames(window)` `2.1+` versions bug, [#181](https://github.com/zloirock/core-js/issues/181) - -##### 2.2.0 - 2016.03.15 -- Added `String#matchAll`, [proposal](https://github.com/tc39/String.prototype.matchAll) -- Added `Object#__(define|lookup)[GS]etter__`, [annex B ES2017](https://github.com/tc39/ecma262/pull/381) -- Added `@@toPrimitive` methods to `Date` and `Symbol` -- Fixed `%TypedArray%#slice` in Edge ~ 13 (throws with `@@species` and wrapped / inherited constructor) -- Some other minor fixes - -##### 2.1.5 - 2016.03.12 -- Improved support NodeJS domains in `Promise#then`, [#180](https://github.com/zloirock/core-js/issues/180) -- Added fallback for `Date#toJSON` bug in Qt Script, [#173](https://github.com/zloirock/core-js/issues/173#issuecomment-193972502) - -##### 2.1.4 - 2016.03.08 -- Added fallback for `Symbol` polyfill in Qt Script, [#173](https://github.com/zloirock/core-js/issues/173) -- Added one more fallback for IE11 `Script Access Denied` error with iframes, [#165](https://github.com/zloirock/core-js/issues/165) - -##### 2.1.3 - 2016.02.29 -- Added fallback for [`es6-promise` package bug](https://github.com/stefanpenner/es6-promise/issues/169), [#176](https://github.com/zloirock/core-js/issues/176) - -##### 2.1.2 - 2016.02.29 -- Some minor `Promise` fixes: - - Browsers `rejectionhandled` event better HTML spec complaint - - Errors in unhandled rejection handlers should not cause any problems - - Fixed typo in feature detection - -##### 2.1.1 - 2016.02.22 -- Some `Promise` improvements: - - Feature detection: - - **Added detection unhandled rejection tracking support - now it's available everywhere**, [#140](https://github.com/zloirock/core-js/issues/140) - - Added detection `@@species` pattern support for completely correct subclassing - - Removed usage `Object.setPrototypeOf` from feature detection and noisy console message about it in FF - - `Promise.all` fixed for some very specific cases - -##### 2.1.0 - 2016.02.09 -- **API**: - - ES5 polyfills are split and logic, used in other polyfills, moved to internal modules - - **All entry point works in ES3 environment like IE8- without `core-js/(library/)es5`** - - **Added all missed single entry points for ES5 polyfills** - - Separated ES5 polyfills moved to the ES6 namespace. Why? - - Mainly, for prevent duplication features in different namespaces - logic of most required ES5 polyfills changed in ES6+: - - Already added changes for: `Object` statics - should accept primitives, new whitespaces lists in `String#trim`, `parse(Int|float)`, `RegExp#toString` logic, `String#split`, etc - - Should be changed in the future: `@@species` and `ToLength` logic in `Array` methods, `Date` parsing, `Function#bind`, etc - - Should not be changed only several features like `Array.isArray` and `Date.now` - - Some ES5 polyfills required for modern engines - - All old entry points should work fine, but in the next major release API can be changed - - `Object.getOwnPropertyDescriptors` moved to the stage 3, [January TC39 meeting](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-01/2016-01-28.md#objectgetownpropertydescriptors-to-stage-3-jordan-harband-low-priority-but-super-quick) - - Added `umd` option for [custom build process](https://github.com/zloirock/core-js#custom-build-from-external-scripts), [#169](https://github.com/zloirock/core-js/issues/169) - - Returned entry points for `Array` statics, removed in `2.0`, for compatibility with `babel` `6` and for future fixes -- **Deprecated**: - - `Reflect.enumerate` deprecated and will be removed from the next major release, [January TC39 meeting](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-01/2016-01-28.md#5xix-revisit-proxy-enumerate---revisit-decision-to-exhaust-iterator) -- **New Features**: - - Added [`Reflect` metadata API](https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md) as a pre-strawman feature, [#152](https://github.com/zloirock/core-js/issues/152): - - `Reflect.defineMetadata` - - `Reflect.deleteMetadata` - - `Reflect.getMetadata` - - `Reflect.getMetadataKeys` - - `Reflect.getOwnMetadata` - - `Reflect.getOwnMetadataKeys` - - `Reflect.hasMetadata` - - `Reflect.hasOwnMetadata` - - `Reflect.metadata` - - Implementation / fixes `Date#toJSON` - - Fixes for `parseInt` and `Number.parseInt` - - Fixes for `parseFloat` and `Number.parseFloat` - - Fixes for `RegExp#toString` - - Fixes for `Array#sort` - - Fixes for `Number#toFixed` - - Fixes for `Number#toPrecision` - - Additional fixes for `String#split` (`RegExp#@@split`) -- **Improvements**: - - Correct subclassing wrapped collections, `Number` and `RegExp` constructors with native class syntax - - Correct support `SharedArrayBuffer` and buffers from other realms in typed arrays wrappers - - Additional validations for `Object.{defineProperty, getOwnPropertyDescriptor}` and `Reflect.defineProperty` -- **Bug Fixes**: - - Fixed some cases `Array#lastIndexOf` with negative second argument - -##### 2.0.3 - 2016.01.11 -- Added fallback for V8 ~ Chrome 49 `Promise` subclassing bug causes unhandled rejection on feature detection, [#159](https://github.com/zloirock/core-js/issues/159) -- Added fix for very specific environments with global `window === null` - -##### 2.0.2 - 2016.01.04 -- Temporarily removed `length` validation from `Uint8Array` constructor wrapper. Reason - [bug in `ws` module](https://github.com/websockets/ws/pull/645) (-> `socket.io`) which passes to `Buffer` constructor -> `Uint8Array` float and uses [the `V8` bug](https://code.google.com/p/v8/issues/detail?id=4552) for conversion to int (by the spec should be thrown an error). [It creates problems for many people.](https://github.com/karma-runner/karma/issues/1768) I hope, it will be returned after fixing this bug in `V8`. - -##### 2.0.1 - 2015.12.31 -- Forced usage `Promise.resolve` polyfill in the `library` version for correct work with wrapper -- `Object.assign` should be defined in the strict mode -> throw an error on extension non-extensible objects, [#154](https://github.com/zloirock/core-js/issues/154) - -##### 2.0.0 - 2015.12.24 -- Added implementations and fixes [Typed Arrays](https://github.com/zloirock/core-js#ecmascript-6-typed-arrays)-related features - - `ArrayBuffer`, `ArrayBuffer.isView`, `ArrayBuffer#slice` - - `DataView` with all getter / setter methods - - `Int8Array`, `Uint8Array`, `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, `Int32Array`, `Uint32Array`, `Float32Array` and `Float64Array` constructors - - `%TypedArray%.{for, of}`, `%TypedArray%#{copyWithin, every, fill, filter, find, findIndex, forEach, indexOf, includes, join, lastIndexOf, map, reduce, reduceRight, reverse, set, slice, some, sort, subarray, values, keys, entries, @@iterator, ...}` -- Added [`System.global`](https://github.com/zloirock/core-js#ecmascript-7-proposals), [proposal](https://github.com/tc39/proposal-global), [November TC39 meeting](https://github.com/rwaldron/tc39-notes/tree/master/es7/2015-11/nov-19.md#systemglobal-jhd) -- Added [`Error.isError`](https://github.com/zloirock/core-js#ecmascript-7-proposals), [proposal](https://github.com/ljharb/proposal-is-error), [November TC39 meeting](https://github.com/rwaldron/tc39-notes/tree/master/es7/2015-11/nov-19.md#jhd-erroriserror) -- Added [`Math.{iaddh, isubh, imulh, umulh}`](https://github.com/zloirock/core-js#ecmascript-7-proposals), [proposal](https://gist.github.com/BrendanEich/4294d5c212a6d2254703) -- `RegExp.escape` moved from the `es7` to the non-standard `core` namespace, [July TC39 meeting](https://github.com/rwaldron/tc39-notes/blob/master/es7/2015-07/july-28.md#62-regexpescape) - too slow, but it's condition of stability, [#116](https://github.com/zloirock/core-js/issues/116) -- [`Promise`](https://github.com/zloirock/core-js#ecmascript-6-promise) - - Some performance optimisations - - Added basic support [`rejectionHandled` event / `onrejectionhandled` handler](https://github.com/zloirock/core-js#unhandled-rejection-tracking) to the polyfill - - Removed usage `@@species` from `Promise.{all, race}`, [November TC39 meeting](https://github.com/rwaldron/tc39-notes/tree/master/es7/2015-11/nov-18.md#conclusionresolution-2) -- Some improvements [collections polyfills](https://github.com/zloirock/core-js#ecmascript-6-collections) - - `O(1)` and preventing possible leaks with frozen keys, [#134](https://github.com/zloirock/core-js/issues/134) - - Correct observable state object keys -- Renamed `String#{padLeft, padRight}` -> [`String#{padStart, padEnd}`](https://github.com/zloirock/core-js#ecmascript-7-proposals), [proposal](https://github.com/tc39/proposal-string-pad-start-end), [November TC39 meeting](https://github.com/rwaldron/tc39-notes/tree/master/es7/2015-11/nov-17.md#conclusionresolution-2) (they want to rename it on each meeting?O_o), [#132](https://github.com/zloirock/core-js/issues/132) -- Added [`String#{trimStart, trimEnd}` as aliases for `String#{trimLeft, trimRight}`](https://github.com/zloirock/core-js#ecmascript-7-proposals), [proposal](https://github.com/sebmarkbage/ecmascript-string-left-right-trim), [November TC39 meeting](https://github.com/rwaldron/tc39-notes/tree/master/es7/2015-11/nov-17.md#conclusionresolution-2) -- Added [annex B HTML methods](https://github.com/zloirock/core-js#ecmascript-6-string) - ugly, but also [the part of the spec](http://www.ecma-international.org/ecma-262/6.0/#sec-string.prototype.anchor) -- Added little fix for [`Date#toString`](https://github.com/zloirock/core-js#ecmascript-6-date) - `new Date(NaN).toString()` [should be `'Invalid Date'`](http://www.ecma-international.org/ecma-262/6.0/#sec-todatestring) -- Added [`{keys, values, entries, @@iterator}` methods to DOM collections](https://github.com/zloirock/core-js#iterable-dom-collections) which should have [iterable interface](https://heycam.github.io/webidl/#idl-iterable) or should be [inherited from `Array`](https://heycam.github.io/webidl/#LegacyArrayClass) - `NodeList`, `DOMTokenList`, `MediaList`, `StyleSheetList`, `CSSRuleList`. -- Removed Mozilla `Array` generics - [deprecated and will be removed from FF](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#Array_generic_methods), [looks like strawman is dead](http://wiki.ecmascript.org/doku.php?id=strawman:array_statics), available [alternative shim](https://github.com/plusdude/array-generics) -- Removed `core.log` module -- CommonJS API - - Added entry points for [virtual methods](https://github.com/zloirock/core-js#commonjs-and-prototype-methods-without-global-namespace-pollution) - - Added entry points for [stages proposals](https://github.com/zloirock/core-js#ecmascript-7-proposals) - - Some other minor changes -- [Custom build from external scripts](https://github.com/zloirock/core-js#custom-build-from-external-scripts) moved to the separate package for preventing problems with dependencies -- Changed `$` prefix for internal modules file names because Team Foundation Server does not support it, [#129](https://github.com/zloirock/core-js/issues/129) -- Additional fix for `SameValueZero` in V8 ~ Chromium 39-42 collections -- Additional fix for FF27 `Array` iterator -- Removed usage shortcuts for `arguments` object - old WebKit bug, [#150](https://github.com/zloirock/core-js/issues/150) -- `{Map, Set}#forEach` non-generic, [#144](https://github.com/zloirock/core-js/issues/144) -- Many other improvements - -##### 1.2.6 - 2015.11.09 -* Reject with `TypeError` on attempt resolve promise itself -* Correct behavior with broken `Promise` subclass constructors / methods -* Added `Promise`-based fallback for microtask -* Fixed V8 and FF `Array#{values, @@iterator}.name` -* Fixed IE7- `[1, 2].join(undefined) -> '1,2'` -* Some other fixes / improvements / optimizations - -##### 1.2.5 - 2015.11.02 -* Some more `Number` constructor fixes: - * Fixed V8 ~ Node 0.8 bug: `Number('+0x1')` should be `NaN` - * Fixed `Number(' 0b1\n')` case, should be `1` - * Fixed `Number()` case, should be `0` - -##### 1.2.4 - 2015.11.01 -* Fixed `Number('0b12') -> NaN` case in the shim -* Fixed V8 ~ Chromium 40- bug - `Weak(Map|Set)#{delete, get, has}` should not throw errors [#124](https://github.com/zloirock/core-js/issues/124) -* Some other fixes and optimizations - -##### 1.2.3 - 2015.10.23 -* Fixed some problems related old V8 bug `Object('a').propertyIsEnumerable(0) // => false`, for example, `Object.assign({}, 'qwe')` from the last release -* Fixed `.name` property and `Function#toString` conversion some polyfilled methods -* Fixed `Math.imul` arity in Safari 8- - -##### 1.2.2 - 2015.10.18 -* Improved optimisations for V8 -* Fixed build process from external packages, [#120](https://github.com/zloirock/core-js/pull/120) -* One more `Object.{assign, values, entries}` fix for [**very** specific case](https://github.com/ljharb/proposal-object-values-entries/issues/5) - -##### 1.2.1 - 2015.10.02 -* Replaced fix `JSON.stringify` + `Symbol` behavior from `.toJSON` method to wrapping `JSON.stringify` - little more correct, [compat-table/642](https://github.com/kangax/compat-table/pull/642) -* Fixed typo which broke tasks scheduler in WebWorkers in old FF, [#114](https://github.com/zloirock/core-js/pull/114) - -##### 1.2.0 - 2015.09.27 -* Added browser [`Promise` rejection hook](#unhandled-rejection-tracking), [#106](https://github.com/zloirock/core-js/issues/106) -* Added correct [`IsRegExp`](http://www.ecma-international.org/ecma-262/6.0/#sec-isregexp) logic to [`String#{includes, startsWith, endsWith}`](https://github.com/zloirock/core-js/#ecmascript-6-string) and [`RegExp` constructor](https://github.com/zloirock/core-js/#ecmascript-6-regexp), `@@match` case, [example](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/match#Disabling_the_isRegExp_check) -* Updated [`String#leftPad`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) [with proposal](https://github.com/ljharb/proposal-string-pad-left-right/issues/6): string filler truncated from the right side -* Replaced V8 [`Object.assign`](https://github.com/zloirock/core-js/#ecmascript-6-object) - its properties order not only [incorrect](https://github.com/sindresorhus/object-assign/issues/22), it is non-deterministic and it causes some problems -* Fixed behavior with deleted in getters properties for `Object.{`[`assign`](https://github.com/zloirock/core-js/#ecmascript-6-object)`, `[`entries, values`](https://github.com/zloirock/core-js/#ecmascript-7-proposals)`}`, [example](http://goo.gl/iQE01c) -* Fixed [`Math.sinh`](https://github.com/zloirock/core-js/#ecmascript-6-math) with very small numbers in V8 near Chromium 38 -* Some other fixes and optimizations - -##### 1.1.4 - 2015.09.05 -* Fixed support symbols in FF34-35 [`Object.assign`](https://github.com/zloirock/core-js/#ecmascript-6-object) -* Fixed [collections iterators](https://github.com/zloirock/core-js/#ecmascript-6-iterators) in FF25-26 -* Fixed non-generic WebKit [`Array.of`](https://github.com/zloirock/core-js/#ecmascript-6-array) -* Some other fixes and optimizations - -##### 1.1.3 - 2015.08.29 -* Fixed support Node.js domains in [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise), [#103](https://github.com/zloirock/core-js/issues/103) - -##### 1.1.2 - 2015.08.28 -* Added `toJSON` method to [`Symbol`](https://github.com/zloirock/core-js/#ecmascript-6-symbol) polyfill and to MS Edge implementation for expected `JSON.stringify` result w/o patching this method -* Replaced [`Reflect.construct`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) implementations w/o correct support third argument -* Fixed `global` detection with changed `document.domain` in ~IE8, [#100](https://github.com/zloirock/core-js/issues/100) - -##### 1.1.1 - 2015.08.20 -* Added more correct microtask implementation for [`Promise`](#ecmascript-6-promise) - -##### 1.1.0 - 2015.08.17 -* Updated [string padding](https://github.com/zloirock/core-js/#ecmascript-7-proposals) to [actual proposal](https://github.com/ljharb/proposal-string-pad-left-right) - renamed, minor internal changes: - * `String#lpad` -> `String#padLeft` - * `String#rpad` -> `String#padRight` -* Added [string trim functions](#ecmascript-7-proposals) - [proposal](https://github.com/sebmarkbage/ecmascript-string-left-right-trim), defacto standard - required only for IE11- and fixed for some old engines: - * `String#trimLeft` - * `String#trimRight` -* [`String#trim`](https://github.com/zloirock/core-js/#ecmascript-6-string) fixed for some engines by es6 spec and moved from `es5` to single `es6` module -* Splitted [`es6.object.statics-accept-primitives`](https://github.com/zloirock/core-js/#ecmascript-6-object) -* Caps for `freeze`-family `Object` methods moved from `es5` to `es6` namespace and joined with [es6 wrappers](https://github.com/zloirock/core-js/#ecmascript-6-object) -* `es5` [namespace](https://github.com/zloirock/core-js/#commonjs) also includes modules, moved to `es6` namespace - you can use it as before -* Increased `MessageChannel` priority in `$.task`, [#95](https://github.com/zloirock/core-js/issues/95) -* Does not get `global.Symbol` on each getting iterator, if you wanna use alternative `Symbol` shim - add it before `core-js` -* [`Reflect.construct`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) optimized and fixed for some cases -* Simplified [`Reflect.enumerate`](https://github.com/zloirock/core-js/#ecmascript-6-reflect), see [this question](https://esdiscuss.org/topic/question-about-enumerate-and-property-decision-timing) -* Some corrections in [`Math.acosh`](https://github.com/zloirock/core-js/#ecmascript-6-math) -* Fixed [`Math.imul`](https://github.com/zloirock/core-js/#ecmascript-6-math) for old WebKit -* Some fixes in string / RegExp [well-known symbols](https://github.com/zloirock/core-js/#ecmascript-6-regexp) logic -* Some other fixes and optimizations - -##### 1.0.1 - 2015.07.31 -* Some fixes for final MS Edge, replaced broken native `Reflect.defineProperty` -* Some minor fixes and optimizations -* Changed compression `client/*.min.js` options for safe `Function#name` and `Function#length`, should be fixed [#92](https://github.com/zloirock/core-js/issues/92) - -##### 1.0.0 - 2015.07.22 -* Added logic for [well-known symbols](https://github.com/zloirock/core-js/#ecmascript-6-regexp): - * `Symbol.match` - * `Symbol.replace` - * `Symbol.split` - * `Symbol.search` -* Actualized and optimized work with iterables: - * Optimized [`Map`, `Set`, `WeakMap`, `WeakSet` constructors](https://github.com/zloirock/core-js/#ecmascript-6-collections), [`Promise.all`, `Promise.race`](https://github.com/zloirock/core-js/#ecmascript-6-promise) for default `Array Iterator` - * Optimized [`Array.from`](https://github.com/zloirock/core-js/#ecmascript-6-array) for default `Array Iterator` - * Added [`core.getIteratorMethod`](https://github.com/zloirock/core-js/#ecmascript-6-iterators) helper -* Uses enumerable properties in shimmed instances - collections, iterators, etc for optimize performance -* Added support native constructors to [`Reflect.construct`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) with 2 arguments -* Added support native constructors to [`Function#bind`](https://github.com/zloirock/core-js/#ecmascript-5) shim with `new` -* Removed obsolete `.clear` methods native [`Weak`-collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) -* Maximum modularity, reduced minimal custom build size, separated into submodules: - * [`es6.reflect`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) - * [`es6.regexp`](https://github.com/zloirock/core-js/#ecmascript-6-regexp) - * [`es6.math`](https://github.com/zloirock/core-js/#ecmascript-6-math) - * [`es6.number`](https://github.com/zloirock/core-js/#ecmascript-6-number) - * [`es7.object.to-array`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) - * [`core.object`](https://github.com/zloirock/core-js/#object) - * [`core.string`](https://github.com/zloirock/core-js/#escaping-strings) - * [`core.iter-helpers`](https://github.com/zloirock/core-js/#ecmascript-6-iterators) - * Internal modules (`$`, `$.iter`, etc) -* Many other optimizations -* Final cleaning non-standard features - * Moved `$for` to [separate library](https://github.com/zloirock/forof). This work for syntax - `for-of` loop and comprehensions - * Moved `Date#{format, formatUTC}` to [separate library](https://github.com/zloirock/dtf). Standard way for this - `ECMA-402` - * Removed `Math` methods from `Number.prototype`. Slight sugar for simple `Math` methods calling - * Removed `{Array#, Array, Dict}.turn` - * Removed `core.global` -* Uses `ToNumber` instead of `ToLength` in [`Number Iterator`](https://github.com/zloirock/core-js/#number-iterator), `Array.from(2.5)` will be `[0, 1, 2]` instead of `[0, 1]` -* Fixed [#85](https://github.com/zloirock/core-js/issues/85) - invalid `Promise` unhandled rejection message in nested `setTimeout` -* Fixed [#86](https://github.com/zloirock/core-js/issues/86) - support FF extensions -* Fixed [#89](https://github.com/zloirock/core-js/issues/89) - behavior `Number` constructor in strange case - -##### 0.9.18 - 2015.06.17 -* Removed `/` from [`RegExp.escape`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) escaped characters - -##### 0.9.17 - 2015.06.14 -* Updated [`RegExp.escape`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) to the [latest proposal](https://github.com/benjamingr/RexExp.escape) -* Fixed conflict with webpack dev server + IE buggy behavior - -##### 0.9.16 - 2015.06.11 -* More correct order resolving thenable in [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) polyfill -* Uses polyfill instead of [buggy V8 `Promise`](https://github.com/zloirock/core-js/issues/78) - -##### 0.9.15 - 2015.06.09 -* [Collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) from `library` version return wrapped native instances -* Fixed collections prototype methods in `library` version -* Optimized [`Math.hypot`](https://github.com/zloirock/core-js/#ecmascript-6-math) - -##### 0.9.14 - 2015.06.04 -* Updated [`Promise.resolve` behavior](https://esdiscuss.org/topic/fixing-promise-resolve) -* Added fallback for IE11 buggy `Object.getOwnPropertyNames` + iframe -* Some other fixes - -##### 0.9.13 - 2015.05.25 -* Added fallback for [`Symbol` polyfill](https://github.com/zloirock/core-js/#ecmascript-6-symbol) for old Android -* Some other fixes - -##### 0.9.12 - 2015.05.24 -* Different instances `core-js` should use / recognize the same symbols -* Some fixes - -##### 0.9.11 - 2015.05.18 -* Simplified [custom build](https://github.com/zloirock/core-js/#custom-build) - * Added custom build js api - * Added `grunt-cli` to `devDependencies` for `npm run grunt` -* Some fixes - -##### 0.9.10 - 2015.05.16 -* Wrapped `Function#toString` for correct work wrapped methods / constructors with methods similar to the [`lodash` `isNative`](https://github.com/lodash/lodash/issues/1197) -* Added proto versions of methods to export object in `default` version for consistency with `library` version - -##### 0.9.9 - 2015.05.14 -* Wrapped `Object#propertyIsEnumerable` for [`Symbol` polyfill](https://github.com/zloirock/core-js/#ecmascript-6-symbol) -* [Added proto versions of methods to `library` for ES7 bind syntax](https://github.com/zloirock/core-js/issues/65) -* Some other fixes - -##### 0.9.8 - 2015.05.12 -* Fixed [`Math.hypot`](https://github.com/zloirock/core-js/#ecmascript-6-math) with negative arguments -* Added `Object#toString.toString` as fallback for [`lodash` `isNative`](https://github.com/lodash/lodash/issues/1197) - -##### 0.9.7 - 2015.05.07 -* Added [support DOM collections](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice#Streamlining_cross-browser_behavior) to IE8- `Array#slice` - -##### 0.9.6 - 2015.05.01 -* Added [`String#lpad`, `String#rpad`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) - -##### 0.9.5 - 2015.04.30 -* Added cap for `Function#@@hasInstance` -* Some fixes and optimizations - -##### 0.9.4 - 2015.04.27 -* Fixed `RegExp` constructor - -##### 0.9.3 - 2015.04.26 -* Some fixes and optimizations - -##### 0.9.2 - 2015.04.25 -* More correct [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) unhandled rejection tracking and resolving / rejection priority - -##### 0.9.1 - 2015.04.25 -* Fixed `__proto__`-based [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) subclassing in some environments - -##### 0.9.0 - 2015.04.24 -* Added correct [symbols](https://github.com/zloirock/core-js/#ecmascript-6-symbol) descriptors - * Fixed behavior `Object.{assign, create, defineProperty, defineProperties, getOwnPropertyDescriptor, getOwnPropertyDescriptors}` with symbols - * Added [single entry points](https://github.com/zloirock/core-js/#commonjs) for `Object.{create, defineProperty, defineProperties}` -* Added [`Map#toJSON`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) -* Removed non-standard methods `Object#[_]` and `Function#only` - they solves syntax problems, but now in compilers available arrows and ~~in near future will be available~~ [available](http://babeljs.io/blog/2015/05/14/function-bind/) [bind syntax](https://github.com/zenparsing/es-function-bind) -* Removed non-standard undocumented methods `Symbol.{pure, set}` -* Some fixes and internal changes - -##### 0.8.4 - 2015.04.18 -* Uses `webpack` instead of `browserify` for browser builds - more compression-friendly result - -##### 0.8.3 - 2015.04.14 -* Fixed `Array` statics with single entry points - -##### 0.8.2 - 2015.04.13 -* [`Math.fround`](https://github.com/zloirock/core-js/#ecmascript-6-math) now also works in IE9- -* Added [`Set#toJSON`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) -* Some optimizations and fixes - -##### 0.8.1 - 2015.04.03 -* Fixed `Symbol.keyFor` - -##### 0.8.0 - 2015.04.02 -* Changed [CommonJS API](https://github.com/zloirock/core-js/#commonjs) -* Splitted and renamed some modules -* Added support ES3 environment (ES5 polyfill) to **all** default versions - size increases slightly (+ ~4kb w/o gzip), many issues disappear, if you don't need it - [simply include only required namespaces / features / modules](https://github.com/zloirock/core-js/#commonjs) -* Removed [abstract references](https://github.com/zenparsing/es-abstract-refs) support - proposal has been superseded =\ -* [`$for.isIterable` -> `core.isIterable`, `$for.getIterator` -> `core.getIterator`](https://github.com/zloirock/core-js/#ecmascript-6-iterators), temporary available in old namespace -* Fixed iterators support in v8 `Promise.all` and `Promise.race` -* Many other fixes - -##### 0.7.2 - 2015.03.09 -* Some fixes - -##### 0.7.1 - 2015.03.07 -* Some fixes - -##### 0.7.0 - 2015.03.06 -* Rewritten and splitted into [CommonJS modules](https://github.com/zloirock/core-js/#commonjs) - -##### 0.6.1 - 2015.02.24 -* Fixed support [`Object.defineProperty`](https://github.com/zloirock/core-js/#ecmascript-5) with accessors on DOM elements on IE8 - -##### 0.6.0 - 2015.02.23 -* Added support safe closing iteration - calling `iterator.return` on abort iteration, if it exists -* Added basic support [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) unhandled rejection tracking in shim -* Added [`Object.getOwnPropertyDescriptors`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) -* Removed `console` cap - creates too many problems -* Restructuring [namespaces](https://github.com/zloirock/core-js/#custom-build) -* Some fixes - -##### 0.5.4 - 2015.02.15 -* Some fixes - -##### 0.5.3 - 2015.02.14 -* Added [support binary and octal literals](https://github.com/zloirock/core-js/#ecmascript-6-number) to `Number` constructor -* Added [`Date#toISOString`](https://github.com/zloirock/core-js/#ecmascript-5) - -##### 0.5.2 - 2015.02.10 -* Some fixes - -##### 0.5.1 - 2015.02.09 -* Some fixes - -##### 0.5.0 - 2015.02.08 -* Systematization of modules -* Splitted [`es6` module](https://github.com/zloirock/core-js/#ecmascript-6) -* Splitted `console` module: `web.console` - only cap for missing methods, `core.log` - bound methods & additional features -* Added [`delay` method](https://github.com/zloirock/core-js/#delay) -* Some fixes - -##### 0.4.10 - 2015.01.28 -* [`Object.getOwnPropertySymbols`](https://github.com/zloirock/core-js/#ecmascript-6-symbol) polyfill returns array of wrapped keys - -##### 0.4.9 - 2015.01.27 -* FF20-24 fix - -##### 0.4.8 - 2015.01.25 -* Some [collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) fixes - -##### 0.4.7 - 2015.01.25 -* Added support frozen objects as [collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) keys - -##### 0.4.6 - 2015.01.21 -* Added [`Object.getOwnPropertySymbols`](https://github.com/zloirock/core-js/#ecmascript-6-symbol) -* Added [`NodeList.prototype[@@iterator]`](https://github.com/zloirock/core-js/#ecmascript-6-iterators) -* Added basic `@@species` logic - getter in native constructors -* Removed `Function#by` -* Some fixes - -##### 0.4.5 - 2015.01.16 -* Some fixes - -##### 0.4.4 - 2015.01.11 -* Enabled CSP support - -##### 0.4.3 - 2015.01.10 -* Added `Function` instances `name` property for IE9+ - -##### 0.4.2 - 2015.01.10 -* `Object` static methods accept primitives -* `RegExp` constructor can alter flags (IE9+) -* Added `Array.prototype[Symbol.unscopables]` - -##### 0.4.1 - 2015.01.05 -* Some fixes - -##### 0.4.0 - 2015.01.03 -* Added [`es6.reflect`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) module: - * Added `Reflect.apply` - * Added `Reflect.construct` - * Added `Reflect.defineProperty` - * Added `Reflect.deleteProperty` - * Added `Reflect.enumerate` - * Added `Reflect.get` - * Added `Reflect.getOwnPropertyDescriptor` - * Added `Reflect.getPrototypeOf` - * Added `Reflect.has` - * Added `Reflect.isExtensible` - * Added `Reflect.preventExtensions` - * Added `Reflect.set` - * Added `Reflect.setPrototypeOf` -* `core-js` methods now can use external `Symbol.iterator` polyfill -* Some fixes - -##### 0.3.3 - 2014.12.28 -* [Console cap](https://github.com/zloirock/core-js/#console) excluded from node.js default builds - -##### 0.3.2 - 2014.12.25 -* Added cap for [ES5](https://github.com/zloirock/core-js/#ecmascript-5) freeze-family methods -* Fixed `console` bug - -##### 0.3.1 - 2014.12.23 -* Some fixes - -##### 0.3.0 - 2014.12.23 -* Optimize [`Map` & `Set`](https://github.com/zloirock/core-js/#ecmascript-6-collections): - * Use entries chain on hash table - * Fast & correct iteration - * Iterators moved to [`es6`](https://github.com/zloirock/core-js/#ecmascript-6) and [`es6.collections`](https://github.com/zloirock/core-js/#ecmascript-6-collections) modules - -##### 0.2.5 - 2014.12.20 -* `console` no longer shortcut for `console.log` (compatibility problems) -* Some fixes - -##### 0.2.4 - 2014.12.17 -* Better compliance of ES6 -* Added [`Math.fround`](https://github.com/zloirock/core-js/#ecmascript-6-math) (IE10+) -* Some fixes - -##### 0.2.3 - 2014.12.15 -* [Symbols](https://github.com/zloirock/core-js/#ecmascript-6-symbol): - * Added option to disable addition setter to `Object.prototype` for Symbol polyfill: - * Added `Symbol.useSimple` - * Added `Symbol.useSetter` - * Added cap for well-known Symbols: - * Added `Symbol.hasInstance` - * Added `Symbol.isConcatSpreadable` - * Added `Symbol.match` - * Added `Symbol.replace` - * Added `Symbol.search` - * Added `Symbol.species` - * Added `Symbol.split` - * Added `Symbol.toPrimitive` - * Added `Symbol.unscopables` - -##### 0.2.2 - 2014.12.13 -* Added [`RegExp#flags`](https://github.com/zloirock/core-js/#ecmascript-6-regexp) ([December 2014 Draft Rev 29](http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#december_6_2014_draft_rev_29)) -* Added [`String.raw`](https://github.com/zloirock/core-js/#ecmascript-6-string) - -##### 0.2.1 - 2014.12.12 -* Repair converting -0 to +0 in [native collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) - -##### 0.2.0 - 2014.12.06 -* Added [`es7.proposals`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) and [`es7.abstract-refs`](https://github.com/zenparsing/es-abstract-refs) modules -* Added [`String#at`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) -* Added real [`String Iterator`](https://github.com/zloirock/core-js/#ecmascript-6-iterators), older versions used Array Iterator -* Added abstract references support: - * Added `Symbol.referenceGet` - * Added `Symbol.referenceSet` - * Added `Symbol.referenceDelete` - * Added `Function#@@referenceGet` - * Added `Map#@@referenceGet` - * Added `Map#@@referenceSet` - * Added `Map#@@referenceDelete` - * Added `WeakMap#@@referenceGet` - * Added `WeakMap#@@referenceSet` - * Added `WeakMap#@@referenceDelete` - * Added `Dict.{...methods}[@@referenceGet]` -* Removed deprecated `.contains` methods -* Some fixes - -##### 0.1.5 - 2014.12.01 -* Added [`Array#copyWithin`](https://github.com/zloirock/core-js/#ecmascript-6-array) -* Added [`String#codePointAt`](https://github.com/zloirock/core-js/#ecmascript-6-string) -* Added [`String.fromCodePoint`](https://github.com/zloirock/core-js/#ecmascript-6-string) - -##### 0.1.4 - 2014.11.27 -* Added [`Dict.mapPairs`](https://github.com/zloirock/core-js/#dict) - -##### 0.1.3 - 2014.11.20 -* [TC39 November meeting](https://github.com/rwaldron/tc39-notes/tree/master/es6/2014-11): - * [`.contains` -> `.includes`](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-11/nov-18.md#51--44-arrayprototypecontains-and-stringprototypecontains) - * `String#contains` -> [`String#includes`](https://github.com/zloirock/core-js/#ecmascript-6-string) - * `Array#contains` -> [`Array#includes`](https://github.com/zloirock/core-js/#ecmascript-7-proposals) - * `Dict.contains` -> [`Dict.includes`](https://github.com/zloirock/core-js/#dict) - * [Removed `WeakMap#clear`](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-11/nov-19.md#412-should-weakmapweakset-have-a-clear-method-markm) - * [Removed `WeakSet#clear`](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-11/nov-19.md#412-should-weakmapweakset-have-a-clear-method-markm) - -##### 0.1.2 - 2014.11.19 -* `Map` & `Set` bug fix - -##### 0.1.1 - 2014.11.18 -* Public release \ No newline at end of file diff --git a/node_modules/core-js/Gruntfile.js b/node_modules/core-js/Gruntfile.js deleted file mode 100644 index 02b832c75..000000000 --- a/node_modules/core-js/Gruntfile.js +++ /dev/null @@ -1,3 +0,0 @@ -require('LiveScript'); -// eslint-disable-next-line import/no-unresolved -module.exports = require('./build/Gruntfile'); diff --git a/node_modules/core-js/LICENSE b/node_modules/core-js/LICENSE deleted file mode 100644 index 44ff6d0ea..000000000 --- a/node_modules/core-js/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2014-2018 Denis Pushkarev - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/core-js/README.md b/node_modules/core-js/README.md deleted file mode 100644 index 7cfbe89d5..000000000 --- a/node_modules/core-js/README.md +++ /dev/null @@ -1,2289 +0,0 @@ -# core-js - -[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/zloirock/core-js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![version](https://img.shields.io/npm/v/core-js.svg)](https://www.npmjs.com/package/core-js) [![npm downloads](https://img.shields.io/npm/dm/core-js.svg)](http://npm-stat.com/charts.html?package=core-js&author=&from=2014-11-18) [![Build Status](https://travis-ci.org/zloirock/core-js.svg)](https://travis-ci.org/zloirock/core-js) [![devDependency status](https://david-dm.org/zloirock/core-js/dev-status.svg)](https://david-dm.org/zloirock/core-js?type=dev) -#### As advertising: the author is looking for a good job :) - -Modular standard library for JavaScript. Includes polyfills for [ECMAScript 5](#ecmascript-5), [ECMAScript 6](#ecmascript-6): [promises](#ecmascript-6-promise), [symbols](#ecmascript-6-symbol), [collections](#ecmascript-6-collections), iterators, [typed arrays](#ecmascript-6-typed-arrays), [ECMAScript 7+ proposals](#ecmascript-7-proposals), [setImmediate](#setimmediate), etc. Some additional features such as [dictionaries](#dict) or [extended partial application](#partial-application). You can require only needed features or use it without global namespace pollution. - -[*Example*](http://goo.gl/a2xexl): -```js -Array.from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3] -'*'.repeat(10); // => '**********' -Promise.resolve(32).then(x => console.log(x)); // => 32 -setImmediate(x => console.log(x), 42); // => 42 -``` - -[*Without global namespace pollution*](http://goo.gl/paOHb0): -```js -var core = require('core-js/library'); // With a modular system, otherwise use global `core` -core.Array.from(new core.Set([1, 2, 3, 2, 1])); // => [1, 2, 3] -core.String.repeat('*', 10); // => '**********' -core.Promise.resolve(32).then(x => console.log(x)); // => 32 -core.setImmediate(x => console.log(x), 42); // => 42 -``` - -### Index -- [Usage](#usage) - - [Basic](#basic) - - [CommonJS](#commonjs) - - [Custom build](#custom-build-from-the-command-line) -- [Supported engines](#supported-engines) -- [Features](#features) - - [ECMAScript 5](#ecmascript-5) - - [ECMAScript 6](#ecmascript-6) - - [ECMAScript 6: Object](#ecmascript-6-object) - - [ECMAScript 6: Function](#ecmascript-6-function) - - [ECMAScript 6: Array](#ecmascript-6-array) - - [ECMAScript 6: String](#ecmascript-6-string) - - [ECMAScript 6: RegExp](#ecmascript-6-regexp) - - [ECMAScript 6: Number](#ecmascript-6-number) - - [ECMAScript 6: Math](#ecmascript-6-math) - - [ECMAScript 6: Date](#ecmascript-6-date) - - [ECMAScript 6: Promise](#ecmascript-6-promise) - - [ECMAScript 6: Symbol](#ecmascript-6-symbol) - - [ECMAScript 6: Collections](#ecmascript-6-collections) - - [ECMAScript 6: Typed Arrays](#ecmascript-6-typed-arrays) - - [ECMAScript 6: Reflect](#ecmascript-6-reflect) - - [ECMAScript 7+ proposals](#ecmascript-7-proposals) - - [stage 4 proposals](#stage-4-proposals) - - [stage 3 proposals](#stage-3-proposals) - - [stage 2 proposals](#stage-2-proposals) - - [stage 1 proposals](#stage-1-proposals) - - [stage 0 proposals](#stage-0-proposals) - - [pre-stage 0 proposals](#pre-stage-0-proposals) - - [Web standards](#web-standards) - - [setTimeout / setInterval](#settimeout--setinterval) - - [setImmediate](#setimmediate) - - [iterable DOM collections](#iterable-dom-collections) - - [Non-standard](#non-standard) - - [Object](#object) - - [Dict](#dict) - - [partial application](#partial-application) - - [Number Iterator](#number-iterator) - - [escaping strings](#escaping-strings) - - [delay](#delay) - - [helpers for iterators](#helpers-for-iterators) -- [Missing polyfills](#missing-polyfills) -- [Changelog](./CHANGELOG.md) - -## Usage -### Basic -``` -npm i core-js -bower install core.js -``` - -```js -// Default -require('core-js'); -// Without global namespace pollution -var core = require('core-js/library'); -// Shim only -require('core-js/shim'); -``` -If you need complete build for browser, use builds from `core-js/client` path: - -* [default](https://raw.githack.com/zloirock/core-js/v2.5.7/client/core.min.js): Includes all features, standard and non-standard. -* [as a library](https://raw.githack.com/zloirock/core-js/v2.5.7/client/library.min.js): Like "default", but does not pollute the global namespace (see [2nd example at the top](#core-js)). -* [shim only](https://raw.githack.com/zloirock/core-js/v2.5.7/client/shim.min.js): Only includes the standard methods. - -Warning: if you use `core-js` with the extension of native objects, require all needed `core-js` modules at the beginning of entry point of your application, otherwise, conflicts may occur. - -### CommonJS -You can require only needed modules. - -```js -require('core-js/fn/set'); -require('core-js/fn/array/from'); -require('core-js/fn/array/find-index'); -Array.from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3] -[1, 2, NaN, 3, 4].findIndex(isNaN); // => 2 - -// or, w/o global namespace pollution: - -var Set = require('core-js/library/fn/set'); -var from = require('core-js/library/fn/array/from'); -var findIndex = require('core-js/library/fn/array/find-index'); -from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3] -findIndex([1, 2, NaN, 3, 4], isNaN); // => 2 -``` -Available entry points for methods / constructors, as above examples, and namespaces: for example, `core-js/es6/array` (`core-js/library/es6/array`) contains all [ES6 `Array` features](#ecmascript-6-array), `core-js/es6` (`core-js/library/es6`) contains all ES6 features. - -##### Caveats when using CommonJS API: - -* `modules` path is internal API, does not inject all required dependencies and can be changed in minor or patch releases. Use it only for a custom build and / or if you know what are you doing. -* `core-js` is extremely modular and uses a lot of very tiny modules, because of that for usage in browsers bundle up `core-js` instead of usage loader for each file, otherwise, you will have hundreds of requests. - -#### CommonJS and prototype methods without global namespace pollution -In the `library` version, we can't pollute prototypes of native constructors. Because of that, prototype methods transformed to static methods like in examples above. `babel` `runtime` transformer also can't transform them. But with transpilers we can use one more trick - [bind operator and virtual methods](https://github.com/zenparsing/es-function-bind). Special for that, available `/virtual/` entry points. Example: -```js -import fill from 'core-js/library/fn/array/virtual/fill'; -import findIndex from 'core-js/library/fn/array/virtual/find-index'; - -Array(10)::fill(0).map((a, b) => b * b)::findIndex(it => it && !(it % 8)); // => 4 - -// or - -import {fill, findIndex} from 'core-js/library/fn/array/virtual'; - -Array(10)::fill(0).map((a, b) => b * b)::findIndex(it => it && !(it % 8)); // => 4 - -``` - -### Custom build (from the command-line) -``` -npm i core-js && cd node_modules/core-js && npm i -npm run grunt build:core.dict,es6 -- --blacklist=es6.promise,es6.math --library=on --path=custom uglify -``` -Where `core.dict` and `es6` are modules (namespaces) names, which will be added to the build, `es6.promise` and `es6.math` are modules (namespaces) names, which will be excluded from the build, `--library=on` is flag for build without global namespace pollution and `custom` is target file name. - -Available namespaces: for example, `es6.array` contains [ES6 `Array` features](#ecmascript-6-array), `es6` contains all modules whose names start with `es6`. - -### Custom build (from external scripts) - -[`core-js-builder`](https://www.npmjs.com/package/core-js-builder) package exports a function that takes the same parameters as the `build` target from the previous section. This will conditionally include or exclude certain parts of `core-js`: - -```js -require('core-js-builder')({ - modules: ['es6', 'core.dict'], // modules / namespaces - blacklist: ['es6.reflect'], // blacklist of modules / namespaces, by default - empty list - library: false, // flag for build without global namespace pollution, by default - false - umd: true // use UMD wrapper for export `core` object, by default - true -}).then(code => { - // ... -}).catch(error => { - // ... -}); -``` -## Supported engines -**Tested in:** -- Chrome 26+ -- Firefox 4+ -- Safari 5+ -- Opera 12+ -- Internet Explorer 6+ (sure, IE8- with ES3 limitations) -- Edge -- Android Browser 2.3+ -- iOS Safari 5.1+ -- PhantomJS 1.9 / 2.1 -- NodeJS 0.8+ - -...and it doesn't mean `core-js` will not work in other engines, they just have not been tested. - -## Features: -[*CommonJS entry points:*](#commonjs) -``` -core-js(/library) <- all features -core-js(/library)/shim <- only polyfills -``` -### ECMAScript 5 -All features moved to the [`es6` namespace](#ecmascript-6), here just a list of features: -```js -Object - .create(proto | null, descriptors?) -> object - .getPrototypeOf(object) -> proto | null - .defineProperty(target, key, desc) -> target, cap for ie8- - .defineProperties(target, descriptors) -> target, cap for ie8- - .getOwnPropertyDescriptor(object, key) -> desc - .getOwnPropertyNames(object) -> array - .keys(object) -> array - .seal(object) -> object, cap for ie8- - .freeze(object) -> object, cap for ie8- - .preventExtensions(object) -> object, cap for ie8- - .isSealed(object) -> bool, cap for ie8- - .isFrozen(object) -> bool, cap for ie8- - .isExtensible(object) -> bool, cap for ie8- -Array - .isArray(var) -> bool - #slice(start?, end?) -> array, fix for ie7- - #join(string = ',') -> string, fix for ie7- - #indexOf(var, from?) -> int - #lastIndexOf(var, from?) -> int - #every(fn(val, index, @), that) -> bool - #some(fn(val, index, @), that) -> bool - #forEach(fn(val, index, @), that) -> void - #map(fn(val, index, @), that) -> array - #filter(fn(val, index, @), that) -> array - #reduce(fn(memo, val, index, @), memo?) -> var - #reduceRight(fn(memo, val, index, @), memo?) -> var - #sort(fn?) -> @, fixes for some engines -Function - #bind(object, ...args) -> boundFn(...args) -String - #split(separator, limit) -> array - #trim() -> str -RegExp - #toString() -> str -Number - #toFixed(digits) -> string - #toPrecision(precision) -> string -parseInt(str, radix) -> int -parseFloat(str) -> num -Date - .now() -> int - #toISOString() -> string - #toJSON() -> string -``` -[*CommonJS entry points:*](#commonjs) -``` -core-js(/library)/es5 -``` - -### ECMAScript 6 -[*CommonJS entry points:*](#commonjs) -``` -core-js(/library)/es6 -``` -#### ECMAScript 6: Object -Modules [`es6.object.assign`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.assign.js), [`es6.object.is`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.is.js), [`es6.object.set-prototype-of`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.set-prototype-of.js) and [`es6.object.to-string`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.to-string.js). - -In ES6 most `Object` static methods should work with primitives. Modules [`es6.object.freeze`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.freeze.js), [`es6.object.seal`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.seal.js), [`es6.object.prevent-extensions`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.prevent-extensions.js), [`es6.object.is-frozen`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.is-frozen.js), [`es6.object.is-sealed`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.is-sealed.js), [`es6.object.is-extensible`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.is-extensible.js), [`es6.object.get-own-property-descriptor`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.get-own-property-descriptor.js), [`es6.object.get-prototype-of`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.get-prototype-of.js), [`es6.object.keys`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.keys.js) and [`es6.object.get-own-property-names`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.get-own-property-names.js). - -Just ES5 features: [`es6.object.create`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.create.js), [`es6.object.define-property`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.define-property.js) and [`es6.object.define-properties`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.object.es6.object.define-properties.js). -```js -Object - .assign(target, ...src) -> target - .is(a, b) -> bool - .setPrototypeOf(target, proto | null) -> target (required __proto__ - IE11+) - .create(object | null, descriptors?) -> object - .getPrototypeOf(var) -> object | null - .defineProperty(object, key, desc) -> target - .defineProperties(object, descriptors) -> target - .getOwnPropertyDescriptor(var, key) -> desc | undefined - .keys(var) -> array - .getOwnPropertyNames(var) -> array - .freeze(var) -> var - .seal(var) -> var - .preventExtensions(var) -> var - .isFrozen(var) -> bool - .isSealed(var) -> bool - .isExtensible(var) -> bool - #toString() -> string, ES6 fix: @@toStringTag support -``` -[*CommonJS entry points:*](#commonjs) -``` -core-js(/library)/es6/object -core-js(/library)/fn/object/assign -core-js(/library)/fn/object/is -core-js(/library)/fn/object/set-prototype-of -core-js(/library)/fn/object/get-prototype-of -core-js(/library)/fn/object/create -core-js(/library)/fn/object/define-property -core-js(/library)/fn/object/define-properties -core-js(/library)/fn/object/get-own-property-descriptor -core-js(/library)/fn/object/keys -core-js(/library)/fn/object/get-own-property-names -core-js(/library)/fn/object/freeze -core-js(/library)/fn/object/seal -core-js(/library)/fn/object/prevent-extensions -core-js(/library)/fn/object/is-frozen -core-js(/library)/fn/object/is-sealed -core-js(/library)/fn/object/is-extensible -core-js/fn/object/to-string -``` -[*Examples*](http://goo.gl/ywdwPz): -```js -var foo = {q: 1, w: 2} - , bar = {e: 3, r: 4} - , baz = {t: 5, y: 6}; -Object.assign(foo, bar, baz); // => foo = {q: 1, w: 2, e: 3, r: 4, t: 5, y: 6} - -Object.is(NaN, NaN); // => true -Object.is(0, -0); // => false -Object.is(42, 42); // => true -Object.is(42, '42'); // => false - -function Parent(){} -function Child(){} -Object.setPrototypeOf(Child.prototype, Parent.prototype); -new Child instanceof Child; // => true -new Child instanceof Parent; // => true - -var O = {}; -O[Symbol.toStringTag] = 'Foo'; -'' + O; // => '[object Foo]' - -Object.keys('qwe'); // => ['0', '1', '2'] -Object.getPrototypeOf('qwe') === String.prototype; // => true -``` -#### ECMAScript 6: Function -Modules [`es6.function.name`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.function.name.js), [`es6.function.has-instance`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.function.has-instance.js). Just ES5: [`es6.function.bind`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.function.bind.js). -```js -Function - #bind(object, ...args) -> boundFn(...args) - #name -> string (IE9+) - #@@hasInstance(var) -> bool -``` -[*CommonJS entry points:*](#commonjs) -``` -core-js/es6/function -core-js/fn/function/name -core-js/fn/function/has-instance -core-js/fn/function/bind -core-js/fn/function/virtual/bind -``` -[*Example*](http://goo.gl/zqu3Wp): -```js -(function foo(){}).name // => 'foo' - -console.log.bind(console, 42)(43); // => 42 43 -``` -#### ECMAScript 6: Array -Modules [`es6.array.from`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.from.js), [`es6.array.of`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.of.js), [`es6.array.copy-within`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.copy-within.js), [`es6.array.fill`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.fill.js), [`es6.array.find`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.find.js), [`es6.array.find-index`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.find-index.js), [`es6.array.iterator`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.iterator.js). ES5 features with fixes: [`es6.array.is-array`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.is-array.js), [`es6.array.slice`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.slice.js), [`es6.array.join`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.join.js), [`es6.array.index-of`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.index-of.js), [`es6.array.last-index-of`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.last-index-of.js), [`es6.array.every`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.every.js), [`es6.array.some`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.some.js), [`es6.array.for-each`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.for-each.js), [`es6.array.map`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.map.js), [`es6.array.filter`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.filter.js), [`es6.array.reduce`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.reduce.js), [`es6.array.reduce-right`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.reduce-right.js), [`es6.array.sort`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.array.sort.js). -```js -Array - .from(iterable | array-like, mapFn(val, index)?, that) -> array - .of(...args) -> array - .isArray(var) -> bool - #copyWithin(target = 0, start = 0, end = @length) -> @ - #fill(val, start = 0, end = @length) -> @ - #find(fn(val, index, @), that) -> val - #findIndex(fn(val, index, @), that) -> index | -1 - #values() -> iterator - #keys() -> iterator - #entries() -> iterator - #join(string = ',') -> string, fix for ie7- - #slice(start?, end?) -> array, fix for ie7- - #indexOf(var, from?) -> index | -1 - #lastIndexOf(var, from?) -> index | -1 - #every(fn(val, index, @), that) -> bool - #some(fn(val, index, @), that) -> bool - #forEach(fn(val, index, @), that) -> void - #map(fn(val, index, @), that) -> array - #filter(fn(val, index, @), that) -> array - #reduce(fn(memo, val, index, @), memo?) -> var - #reduceRight(fn(memo, val, index, @), memo?) -> var - #sort(fn?) -> @, invalid arguments fix - #@@iterator() -> iterator (values) - #@@unscopables -> object (cap) -Arguments - #@@iterator() -> iterator (values, available only in core-js methods) -``` -[*CommonJS entry points:*](#commonjs) -``` -core-js(/library)/es6/array -core-js(/library)/fn/array/from -core-js(/library)/fn/array/of -core-js(/library)/fn/array/is-array -core-js(/library)/fn/array/iterator -core-js(/library)/fn/array/copy-within -core-js(/library)/fn/array/fill -core-js(/library)/fn/array/find -core-js(/library)/fn/array/find-index -core-js(/library)/fn/array/values -core-js(/library)/fn/array/keys -core-js(/library)/fn/array/entries -core-js(/library)/fn/array/slice -core-js(/library)/fn/array/join -core-js(/library)/fn/array/index-of -core-js(/library)/fn/array/last-index-of -core-js(/library)/fn/array/every -core-js(/library)/fn/array/some -core-js(/library)/fn/array/for-each -core-js(/library)/fn/array/map -core-js(/library)/fn/array/filter -core-js(/library)/fn/array/reduce -core-js(/library)/fn/array/reduce-right -core-js(/library)/fn/array/sort -core-js(/library)/fn/array/virtual/iterator -core-js(/library)/fn/array/virtual/copy-within -core-js(/library)/fn/array/virtual/fill -core-js(/library)/fn/array/virtual/find -core-js(/library)/fn/array/virtual/find-index -core-js(/library)/fn/array/virtual/values -core-js(/library)/fn/array/virtual/keys -core-js(/library)/fn/array/virtual/entries -core-js(/library)/fn/array/virtual/slice -core-js(/library)/fn/array/virtual/join -core-js(/library)/fn/array/virtual/index-of -core-js(/library)/fn/array/virtual/last-index-of -core-js(/library)/fn/array/virtual/every -core-js(/library)/fn/array/virtual/some -core-js(/library)/fn/array/virtual/for-each -core-js(/library)/fn/array/virtual/map -core-js(/library)/fn/array/virtual/filter -core-js(/library)/fn/array/virtual/reduce -core-js(/library)/fn/array/virtual/reduce-right -core-js(/library)/fn/array/virtual/sort -``` -[*Examples*](http://goo.gl/oaUFUf): -```js -Array.from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3] -Array.from({0: 1, 1: 2, 2: 3, length: 3}); // => [1, 2, 3] -Array.from('123', Number); // => [1, 2, 3] -Array.from('123', function(it){ - return it * it; -}); // => [1, 4, 9] - -Array.of(1); // => [1] -Array.of(1, 2, 3); // => [1, 2, 3] - -var array = ['a', 'b', 'c']; - -for(var val of array)console.log(val); // => 'a', 'b', 'c' -for(var val of array.values())console.log(val); // => 'a', 'b', 'c' -for(var key of array.keys())console.log(key); // => 0, 1, 2 -for(var [key, val] of array.entries()){ - console.log(key); // => 0, 1, 2 - console.log(val); // => 'a', 'b', 'c' -} - -function isOdd(val){ - return val % 2; -} -[4, 8, 15, 16, 23, 42].find(isOdd); // => 15 -[4, 8, 15, 16, 23, 42].findIndex(isOdd); // => 2 -[4, 8, 15, 16, 23, 42].find(isNaN); // => undefined -[4, 8, 15, 16, 23, 42].findIndex(isNaN); // => -1 - -Array(5).fill(42); // => [42, 42, 42, 42, 42] - -[1, 2, 3, 4, 5].copyWithin(0, 3); // => [4, 5, 3, 4, 5] -``` -#### ECMAScript 6: String -Modules [`es6.string.from-code-point`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.from-code-point.js), [`es6.string.raw`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.raw.js), [`es6.string.iterator`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.iterator.js), [`es6.string.code-point-at`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.code-point-at.js), [`es6.string.ends-with`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.ends-with.js), [`es6.string.includes`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.includes.js), [`es6.string.repeat`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.repeat.js), [`es6.string.starts-with`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.starts-with.js) and [`es6.string.trim`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.trim.js). - -Annex B HTML methods. Ugly, but it's also the part of the spec. Modules [`es6.string.anchor`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.anchor.js), [`es6.string.big`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.big.js), [`es6.string.blink`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.blink.js), [`es6.string.bold`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.bold.js), [`es6.string.fixed`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.fixed.js), [`es6.string.fontcolor`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.fontcolor.js), [`es6.string.fontsize`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.fontsize.js), [`es6.string.italics`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.italics.js), [`es6.string.link`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.link.js), [`es6.string.small`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.small.js), [`es6.string.strike`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.strike.js), [`es6.string.sub`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.sub.js) and [`es6.string.sup`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.string.sup.js). -```js -String - .fromCodePoint(...codePoints) -> str - .raw({raw}, ...substitutions) -> str - #includes(str, from?) -> bool - #startsWith(str, from?) -> bool - #endsWith(str, from?) -> bool - #repeat(num) -> str - #codePointAt(pos) -> uint - #trim() -> str, ES6 fix - #anchor(name) -> str - #big() -> str - #blink() -> str - #bold() -> str - #fixed() -> str - #fontcolor(color) -> str - #fontsize(size) -> str - #italics() -> str - #link(url) -> str - #small() -> str - #strike() -> str - #sub() -> str - #sup() -> str - #@@iterator() -> iterator (code points) -``` -[*CommonJS entry points:*](#commonjs) -``` -core-js(/library)/es6/string -core-js(/library)/fn/string/from-code-point -core-js(/library)/fn/string/raw -core-js(/library)/fn/string/includes -core-js(/library)/fn/string/starts-with -core-js(/library)/fn/string/ends-with -core-js(/library)/fn/string/repeat -core-js(/library)/fn/string/code-point-at -core-js(/library)/fn/string/trim -core-js(/library)/fn/string/anchor -core-js(/library)/fn/string/big -core-js(/library)/fn/string/blink -core-js(/library)/fn/string/bold -core-js(/library)/fn/string/fixed -core-js(/library)/fn/string/fontcolor -core-js(/library)/fn/string/fontsize -core-js(/library)/fn/string/italics -core-js(/library)/fn/string/link -core-js(/library)/fn/string/small -core-js(/library)/fn/string/strike -core-js(/library)/fn/string/sub -core-js(/library)/fn/string/sup -core-js(/library)/fn/string/iterator -core-js(/library)/fn/string/virtual/includes -core-js(/library)/fn/string/virtual/starts-with -core-js(/library)/fn/string/virtual/ends-with -core-js(/library)/fn/string/virtual/repeat -core-js(/library)/fn/string/virtual/code-point-at -core-js(/library)/fn/string/virtual/trim -core-js(/library)/fn/string/virtual/anchor -core-js(/library)/fn/string/virtual/big -core-js(/library)/fn/string/virtual/blink -core-js(/library)/fn/string/virtual/bold -core-js(/library)/fn/string/virtual/fixed -core-js(/library)/fn/string/virtual/fontcolor -core-js(/library)/fn/string/virtual/fontsize -core-js(/library)/fn/string/virtual/italics -core-js(/library)/fn/string/virtual/link -core-js(/library)/fn/string/virtual/small -core-js(/library)/fn/string/virtual/strike -core-js(/library)/fn/string/virtual/sub -core-js(/library)/fn/string/virtual/sup -core-js(/library)/fn/string/virtual/iterator -``` -[*Examples*](http://goo.gl/3UaQ93): -```js -for(var val of 'a𠮷b'){ - console.log(val); // => 'a', '𠮷', 'b' -} - -'foobarbaz'.includes('bar'); // => true -'foobarbaz'.includes('bar', 4); // => false -'foobarbaz'.startsWith('foo'); // => true -'foobarbaz'.startsWith('bar', 3); // => true -'foobarbaz'.endsWith('baz'); // => true -'foobarbaz'.endsWith('bar', 6); // => true - -'string'.repeat(3); // => 'stringstringstring' - -'𠮷'.codePointAt(0); // => 134071 -String.fromCodePoint(97, 134071, 98); // => 'a𠮷b' - -var name = 'Bob'; -String.raw`Hi\n${name}!`; // => 'Hi\\nBob!' (ES6 template string syntax) -String.raw({raw: 'test'}, 0, 1, 2); // => 't0e1s2t' - -'foo'.bold(); // => 'foo' -'bar'.anchor('a"b'); // => 'bar' -'baz'.link('http://example.com'); // => 'baz' -``` -#### ECMAScript 6: RegExp -Modules [`es6.regexp.constructor`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.regexp.constructor.js) and [`es6.regexp.flags`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.regexp.flags.js). - -Support well-known [symbols](#ecmascript-6-symbol) `@@match`, `@@replace`, `@@search` and `@@split`, modules [`es6.regexp.match`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.regexp.match.js), [`es6.regexp.replace`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.regexp.replace.js), [`es6.regexp.search`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.regexp.search.js) and [`es6.regexp.split`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.regexp.split.js). -``` -[new] RegExp(pattern, flags?) -> regexp, ES6 fix: can alter flags (IE9+) - #flags -> str (IE9+) - #toString() -> str, ES6 fixes - #@@match(str) -> array | null - #@@replace(str, replacer) -> string - #@@search(str) -> index - #@@split(str, limit) -> array -String - #match(tpl) -> var, ES6 fix for support @@match - #replace(tpl, replacer) -> var, ES6 fix for support @@replace - #search(tpl) -> var, ES6 fix for support @@search - #split(tpl, limit) -> var, ES6 fix for support @@split, some fixes for old engines -``` -[*CommonJS entry points:*](#commonjs) -``` -core-js/es6/regexp -core-js/fn/regexp/constructor -core-js(/library)/fn/regexp/flags -core-js/fn/regexp/to-string -core-js/fn/regexp/match -core-js/fn/regexp/replace -core-js/fn/regexp/search -core-js/fn/regexp/split -``` -[*Examples*](http://goo.gl/PiJxBD): -```js -RegExp(/./g, 'm'); // => /./m - -/foo/.flags; // => '' -/foo/gim.flags; // => 'gim' - -'foo'.match({[Symbol.match]: _ => 1}); // => 1 -'foo'.replace({[Symbol.replace]: _ => 2}); // => 2 -'foo'.search({[Symbol.search]: _ => 3}); // => 3 -'foo'.split({[Symbol.split]: _ => 4}); // => 4 - -RegExp.prototype.toString.call({source: 'foo', flags: 'bar'}); // => '/foo/bar' -``` -#### ECMAScript 6: Number -Module [`es6.number.constructor`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.constructor.js). `Number` constructor support binary and octal literals, [*example*](http://goo.gl/jRd6b3): -```js -Number('0b1010101'); // => 85 -Number('0o7654321'); // => 2054353 -``` -Modules [`es6.number.epsilon`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.epsilon.js), [`es6.number.is-finite`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.is-finite.js), [`es6.number.is-integer`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.is-integer.js), [`es6.number.is-nan`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.is-nan.js), [`es6.number.is-safe-integer`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.is-safe-integer.js), [`es6.number.max-safe-integer`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.max-safe-integer.js), [`es6.number.min-safe-integer`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.min-safe-integer.js), [`es6.number.parse-float`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.parse-float.js), [`es6.number.parse-int`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.parse-int.js), [`es6.number.to-fixed`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.to-fixed.js), [`es6.number.to-precision`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.number.to-precision.js), [`es6.parse-int`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.parse-int.js), [`es6.parse-float`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.parse-float.js). -```js -[new] Number(var) -> number | number object - .isFinite(num) -> bool - .isNaN(num) -> bool - .isInteger(num) -> bool - .isSafeInteger(num) -> bool - .parseFloat(str) -> num - .parseInt(str) -> int - .EPSILON -> num - .MAX_SAFE_INTEGER -> int - .MIN_SAFE_INTEGER -> int - #toFixed(digits) -> string, fixes - #toPrecision(precision) -> string, fixes -parseFloat(str) -> num, fixes -parseInt(str) -> int, fixes -``` -[*CommonJS entry points:*](#commonjs) -``` -core-js(/library)/es6/number -core-js/es6/number/constructor -core-js(/library)/fn/number/is-finite -core-js(/library)/fn/number/is-nan -core-js(/library)/fn/number/is-integer -core-js(/library)/fn/number/is-safe-integer -core-js(/library)/fn/number/parse-float -core-js(/library)/fn/number/parse-int -core-js(/library)/fn/number/epsilon -core-js(/library)/fn/number/max-safe-integer -core-js(/library)/fn/number/min-safe-integer -core-js(/library)/fn/number/to-fixed -core-js(/library)/fn/number/to-precision -core-js(/library)/fn/parse-float -core-js(/library)/fn/parse-int -``` -#### ECMAScript 6: Math -Modules [`es6.math.acosh`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.acosh.js), [`es6.math.asinh`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.asinh.js), [`es6.math.atanh`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.atanh.js), [`es6.math.cbrt`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.cbrt.js), [`es6.math.clz32`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.clz32.js), [`es6.math.cosh`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.cosh.js), [`es6.math.expm1`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.expm1.js), [`es6.math.fround`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.fround.js), [`es6.math.hypot`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.hypot.js), [`es6.math.imul`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.imul.js), [`es6.math.log10`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.log10.js), [`es6.math.log1p`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.log1p.js), [`es6.math.log2`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.log2.js), [`es6.math.sign`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.sign.js), [`es6.math.sinh`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.sinh.js), [`es6.math.tanh`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.tanh.js), [`es6.math.trunc`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.math.trunc.js). -```js -Math - .acosh(num) -> num - .asinh(num) -> num - .atanh(num) -> num - .cbrt(num) -> num - .clz32(num) -> uint - .cosh(num) -> num - .expm1(num) -> num - .fround(num) -> num - .hypot(...args) -> num - .imul(num, num) -> int - .log1p(num) -> num - .log10(num) -> num - .log2(num) -> num - .sign(num) -> 1 | -1 | 0 | -0 | NaN - .sinh(num) -> num - .tanh(num) -> num - .trunc(num) -> num -``` -[*CommonJS entry points:*](#commonjs) -``` -core-js(/library)/es6/math -core-js(/library)/fn/math/acosh -core-js(/library)/fn/math/asinh -core-js(/library)/fn/math/atanh -core-js(/library)/fn/math/cbrt -core-js(/library)/fn/math/clz32 -core-js(/library)/fn/math/cosh -core-js(/library)/fn/math/expm1 -core-js(/library)/fn/math/fround -core-js(/library)/fn/math/hypot -core-js(/library)/fn/math/imul -core-js(/library)/fn/math/log1p -core-js(/library)/fn/math/log10 -core-js(/library)/fn/math/log2 -core-js(/library)/fn/math/sign -core-js(/library)/fn/math/sinh -core-js(/library)/fn/math/tanh -core-js(/library)/fn/math/trunc -``` -#### ECMAScript 6: Date -Modules [`es6.date.to-string`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.date.to-string.js), ES5 features with fixes: [`es6.date.now`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.date.now.js), [`es6.date.to-iso-string`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.date.to-iso-string.js), [`es6.date.to-json`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.date.to-json.js) and [`es6.date.to-primitive`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.date.to-primitive.js). -```js -Date - .now() -> int - #toISOString() -> string - #toJSON() -> string - #toString() -> string - #@@toPrimitive(hint) -> primitive -``` -[*CommonJS entry points:*](#commonjs) -``` -core-js/es6/date -core-js/fn/date/to-string -core-js(/library)/fn/date/now -core-js(/library)/fn/date/to-iso-string -core-js(/library)/fn/date/to-json -core-js(/library)/fn/date/to-primitive -``` -[*Example*](http://goo.gl/haeHLR): -```js -new Date(NaN).toString(); // => 'Invalid Date' -``` - -#### ECMAScript 6: Promise -Module [`es6.promise`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.promise.js). -```js -new Promise(executor(resolve(var), reject(var))) -> promise - #then(resolved(var), rejected(var)) -> promise - #catch(rejected(var)) -> promise - .resolve(promise | var) -> promise - .reject(var) -> promise - .all(iterable) -> promise - .race(iterable) -> promise -``` -[*CommonJS entry points:*](#commonjs) -``` -core-js(/library)/es6/promise -core-js(/library)/fn/promise -``` -Basic [*example*](http://goo.gl/vGrtUC): -```js -function sleepRandom(time){ - return new Promise(function(resolve, reject){ - setTimeout(resolve, time * 1e3, 0 | Math.random() * 1e3); - }); -} - -console.log('Run'); // => Run -sleepRandom(5).then(function(result){ - console.log(result); // => 869, after 5 sec. - return sleepRandom(10); -}).then(function(result){ - console.log(result); // => 202, after 10 sec. -}).then(function(){ - console.log('immediately after'); // => immediately after - throw Error('Irror!'); -}).then(function(){ - console.log('will not be displayed'); -}).catch(x => console.log(x)); // => => Error: Irror! -``` -`Promise.resolve` and `Promise.reject` [*example*](http://goo.gl/vr8TN3): -```js -Promise.resolve(42).then(x => console.log(x)); // => 42 -Promise.reject(42).catch(x => console.log(x)); // => 42 - -Promise.resolve($.getJSON('/data.json')); // => ES6 promise -``` -`Promise.all` [*example*](http://goo.gl/RdoDBZ): -```js -Promise.all([ - 'foo', - sleepRandom(5), - sleepRandom(15), - sleepRandom(10) // after 15 sec: -]).then(x => console.log(x)); // => ['foo', 956, 85, 382] -``` -`Promise.race` [*example*](http://goo.gl/L8ovkJ): -```js -function timeLimit(promise, time){ - return Promise.race([promise, new Promise(function(resolve, reject){ - setTimeout(reject, time * 1e3, Error('Await > ' + time + ' sec')); - })]); -} - -timeLimit(sleepRandom(5), 10).then(x => console.log(x)); // => 853, after 5 sec. -timeLimit(sleepRandom(15), 10).catch(x => console.log(x)); // Error: Await > 10 sec -``` -ECMAScript 7 [async functions](https://tc39.github.io/ecmascript-asyncawait) [example](http://goo.gl/wnQS4j): -```js -var delay = time => new Promise(resolve => setTimeout(resolve, time)) - -async function sleepRandom(time){ - await delay(time * 1e3); - return 0 | Math.random() * 1e3; -}; -async function sleepError(time, msg){ - await delay(time * 1e3); - throw Error(msg); -}; - -(async () => { - try { - console.log('Run'); // => Run - console.log(await sleepRandom(5)); // => 936, after 5 sec. - var [a, b, c] = await Promise.all([ - sleepRandom(5), - sleepRandom(15), - sleepRandom(10) - ]); - console.log(a, b, c); // => 210 445 71, after 15 sec. - await sleepError(5, 'Irror!'); - console.log('Will not be displayed'); - } catch(e){ - console.log(e); // => Error: 'Irror!', after 5 sec. - } -})(); -``` - -##### Unhandled rejection tracking - -In Node.js, like in native implementation, available events [`unhandledRejection`](https://nodejs.org/api/process.html#process_event_unhandledrejection) and [`rejectionHandled`](https://nodejs.org/api/process.html#process_event_rejectionhandled): -```js -process.on('unhandledRejection', (reason, promise) => console.log('unhandled', reason, promise)); -process.on('rejectionHandled', (promise) => console.log('handled', promise)); - -var p = Promise.reject(42); -// unhandled 42 [object Promise] - -setTimeout(() => p.catch(_ => _), 1e3); -// handled [object Promise] -``` -In a browser on rejection, by default, you will see notify in the console, or you can add a custom handler and a handler on handling unhandled, [*example*](http://goo.gl/Wozskl): -```js -window.onunhandledrejection = e => console.log('unhandled', e.reason, e.promise); -window.onrejectionhandled = e => console.log('handled', e.reason, e.promise); - -var p = Promise.reject(42); -// unhandled 42 [object Promise] - -setTimeout(() => p.catch(_ => _), 1e3); -// handled 42 [object Promise] -``` - -#### ECMAScript 6: Symbol -Module [`es6.symbol`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.symbol.js). -```js -Symbol(description?) -> symbol - .hasInstance -> @@hasInstance - .isConcatSpreadable -> @@isConcatSpreadable - .iterator -> @@iterator - .match -> @@match - .replace -> @@replace - .search -> @@search - .species -> @@species - .split -> @@split - .toPrimitive -> @@toPrimitive - .toStringTag -> @@toStringTag - .unscopables -> @@unscopables - .for(key) -> symbol - .keyFor(symbol) -> key - .useSimple() -> void - .useSetter() -> void -Object - .getOwnPropertySymbols(object) -> array -``` -Also wrapped some methods for correct work with `Symbol` polyfill. -```js -Object - .create(proto | null, descriptors?) -> object - .defineProperty(target, key, desc) -> target - .defineProperties(target, descriptors) -> target - .getOwnPropertyDescriptor(var, key) -> desc | undefined - .getOwnPropertyNames(var) -> array - #propertyIsEnumerable(key) -> bool -JSON - .stringify(target, replacer?, space?) -> string | undefined -``` -[*CommonJS entry points:*](#commonjs) -``` -core-js(/library)/es6/symbol -core-js(/library)/fn/symbol -core-js(/library)/fn/symbol/has-instance -core-js(/library)/fn/symbol/is-concat-spreadable -core-js(/library)/fn/symbol/iterator -core-js(/library)/fn/symbol/match -core-js(/library)/fn/symbol/replace -core-js(/library)/fn/symbol/search -core-js(/library)/fn/symbol/species -core-js(/library)/fn/symbol/split -core-js(/library)/fn/symbol/to-primitive -core-js(/library)/fn/symbol/to-string-tag -core-js(/library)/fn/symbol/unscopables -core-js(/library)/fn/symbol/for -core-js(/library)/fn/symbol/key-for -``` -[*Basic example*](http://goo.gl/BbvWFc): -```js -var Person = (function(){ - var NAME = Symbol('name'); - function Person(name){ - this[NAME] = name; - } - Person.prototype.getName = function(){ - return this[NAME]; - }; - return Person; -})(); - -var person = new Person('Vasya'); -console.log(person.getName()); // => 'Vasya' -console.log(person['name']); // => undefined -console.log(person[Symbol('name')]); // => undefined, symbols are uniq -for(var key in person)console.log(key); // => only 'getName', symbols are not enumerable -``` -`Symbol.for` & `Symbol.keyFor` [*example*](http://goo.gl/0pdJjX): -```js -var symbol = Symbol.for('key'); -symbol === Symbol.for('key'); // true -Symbol.keyFor(symbol); // 'key' -``` -[*Example*](http://goo.gl/mKVOQJ) with methods for getting own object keys: -```js -var O = {a: 1}; -Object.defineProperty(O, 'b', {value: 2}); -O[Symbol('c')] = 3; -Object.keys(O); // => ['a'] -Object.getOwnPropertyNames(O); // => ['a', 'b'] -Object.getOwnPropertySymbols(O); // => [Symbol(c)] -Reflect.ownKeys(O); // => ['a', 'b', Symbol(c)] -``` -##### Caveats when using `Symbol` polyfill: - -* We can't add new primitive type, `Symbol` returns object. -* `Symbol.for` and `Symbol.keyFor` can't be shimmed cross-realm. -* By default, to hide the keys, `Symbol` polyfill defines setter in `Object.prototype`. For this reason, uncontrolled creation of symbols can cause memory leak and the `in` operator is not working correctly with `Symbol` polyfill: `Symbol() in {} // => true`. - -You can disable defining setters in `Object.prototype`. [Example](http://goo.gl/N5UD7J): -```js -Symbol.useSimple(); -var s1 = Symbol('s1') - , o1 = {}; -o1[s1] = true; -for(var key in o1)console.log(key); // => 'Symbol(s1)_t.qamkg9f3q', w/o native Symbol - -Symbol.useSetter(); -var s2 = Symbol('s2') - , o2 = {}; -o2[s2] = true; -for(var key in o2)console.log(key); // nothing -``` -* Currently, `core-js` not adds setters to `Object.prototype` for well-known symbols for correct work something like `Symbol.iterator in foo`. It can cause problems with their enumerability. -* Some problems possible with environment exotic objects (for example, IE `localStorage`). - -#### ECMAScript 6: Collections -`core-js` uses native collections in most case, just fixes methods / constructor, if it's required, and in old environment uses fast polyfill (O(1) lookup). -#### Map -Module [`es6.map`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.map.js). -```js -new Map(iterable (entries) ?) -> map - #clear() -> void - #delete(key) -> bool - #forEach(fn(val, key, @), that) -> void - #get(key) -> val - #has(key) -> bool - #set(key, val) -> @ - #size -> uint - #values() -> iterator - #keys() -> iterator - #entries() -> iterator - #@@iterator() -> iterator (entries) -``` -[*CommonJS entry points:*](#commonjs) -``` -core-js(/library)/es6/map -core-js(/library)/fn/map -``` -[*Examples*](http://goo.gl/GWR7NI): -```js -var a = [1]; - -var map = new Map([['a', 1], [42, 2]]); -map.set(a, 3).set(true, 4); - -console.log(map.size); // => 4 -console.log(map.has(a)); // => true -console.log(map.has([1])); // => false -console.log(map.get(a)); // => 3 -map.forEach(function(val, key){ - console.log(val); // => 1, 2, 3, 4 - console.log(key); // => 'a', 42, [1], true -}); -map.delete(a); -console.log(map.size); // => 3 -console.log(map.get(a)); // => undefined -console.log(Array.from(map)); // => [['a', 1], [42, 2], [true, 4]] - -var map = new Map([['a', 1], ['b', 2], ['c', 3]]); - -for(var [key, val] of map){ - console.log(key); // => 'a', 'b', 'c' - console.log(val); // => 1, 2, 3 -} -for(var val of map.values())console.log(val); // => 1, 2, 3 -for(var key of map.keys())console.log(key); // => 'a', 'b', 'c' -for(var [key, val] of map.entries()){ - console.log(key); // => 'a', 'b', 'c' - console.log(val); // => 1, 2, 3 -} -``` -#### Set -Module [`es6.set`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.set.js). -```js -new Set(iterable?) -> set - #add(key) -> @ - #clear() -> void - #delete(key) -> bool - #forEach(fn(el, el, @), that) -> void - #has(key) -> bool - #size -> uint - #values() -> iterator - #keys() -> iterator - #entries() -> iterator - #@@iterator() -> iterator (values) -``` -[*CommonJS entry points:*](#commonjs) -``` -core-js(/library)/es6/set -core-js(/library)/fn/set -``` -[*Examples*](http://goo.gl/bmhLwg): -```js -var set = new Set(['a', 'b', 'a', 'c']); -set.add('d').add('b').add('e'); -console.log(set.size); // => 5 -console.log(set.has('b')); // => true -set.forEach(function(it){ - console.log(it); // => 'a', 'b', 'c', 'd', 'e' -}); -set.delete('b'); -console.log(set.size); // => 4 -console.log(set.has('b')); // => false -console.log(Array.from(set)); // => ['a', 'c', 'd', 'e'] - -var set = new Set([1, 2, 3, 2, 1]); - -for(var val of set)console.log(val); // => 1, 2, 3 -for(var val of set.values())console.log(val); // => 1, 2, 3 -for(var key of set.keys())console.log(key); // => 1, 2, 3 -for(var [key, val] of set.entries()){ - console.log(key); // => 1, 2, 3 - console.log(val); // => 1, 2, 3 -} -``` -#### WeakMap -Module [`es6.weak-map`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.weak-map.js). -```js -new WeakMap(iterable (entries) ?) -> weakmap - #delete(key) -> bool - #get(key) -> val - #has(key) -> bool - #set(key, val) -> @ -``` -[*CommonJS entry points:*](#commonjs) -``` -core-js(/library)/es6/weak-map -core-js(/library)/fn/weak-map -``` -[*Examples*](http://goo.gl/SILXyw): -```js -var a = [1] - , b = [2] - , c = [3]; - -var wmap = new WeakMap([[a, 1], [b, 2]]); -wmap.set(c, 3).set(b, 4); -console.log(wmap.has(a)); // => true -console.log(wmap.has([1])); // => false -console.log(wmap.get(a)); // => 1 -wmap.delete(a); -console.log(wmap.get(a)); // => undefined - -// Private properties store: -var Person = (function(){ - var names = new WeakMap; - function Person(name){ - names.set(this, name); - } - Person.prototype.getName = function(){ - return names.get(this); - }; - return Person; -})(); - -var person = new Person('Vasya'); -console.log(person.getName()); // => 'Vasya' -for(var key in person)console.log(key); // => only 'getName' -``` -#### WeakSet -Module [`es6.weak-set`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.weak-set.js). -```js -new WeakSet(iterable?) -> weakset - #add(key) -> @ - #delete(key) -> bool - #has(key) -> bool -``` -[*CommonJS entry points:*](#commonjs) -``` -core-js(/library)/es6/weak-set -core-js(/library)/fn/weak-set -``` -[*Examples*](http://goo.gl/TdFbEx): -```js -var a = [1] - , b = [2] - , c = [3]; - -var wset = new WeakSet([a, b, a]); -wset.add(c).add(b).add(c); -console.log(wset.has(b)); // => true -console.log(wset.has([2])); // => false -wset.delete(b); -console.log(wset.has(b)); // => false -``` -##### Caveats when using collections polyfill: - -* Weak-collections polyfill stores values as hidden properties of keys. It works correct and not leak in most cases. However, it is desirable to store a collection longer than its keys. - -#### ECMAScript 6: Typed Arrays -Implementations and fixes `ArrayBuffer`, `DataView`, typed arrays constructors, static and prototype methods. Typed Arrays work only in environments with support descriptors (IE9+), `ArrayBuffer` and `DataView` should work anywhere. - -Modules [`es6.typed.array-buffer`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.typed.array-buffer.js), [`es6.typed.data-view`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.typed.data-view.js), [`es6.typed.int8-array`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.typed.int8-array.js), [`es6.typed.uint8-array`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.typed.uint8-array.js), [`es6.typed.uint8-clamped-array`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.typed.uint8-clamped-array.js), [`es6.typed.int16-array`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.typed.int16-array.js), [`es6.typed.uint16-array`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.typed.uint16-array.js), [`es6.typed.int32-array`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.typed.int32-array.js), [`es6.typed.uint32-array`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.typed.uint32-array.js), [`es6.typed.float32-array`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.typed.float32-array.js) and [`es6.typed.float64-array`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.typed.float64-array.js). -```js -new ArrayBuffer(length) -> buffer - .isView(var) -> bool - #slice(start = 0, end = @length) -> buffer - #byteLength -> uint - -new DataView(buffer, byteOffset = 0, byteLength = buffer.byteLength - byteOffset) -> view - #getInt8(offset) -> int8 - #getUint8(offset) -> uint8 - #getInt16(offset, littleEndian = false) -> int16 - #getUint16(offset, littleEndian = false) -> uint16 - #getInt32(offset, littleEndian = false) -> int32 - #getUint32(offset, littleEndian = false) -> uint32 - #getFloat32(offset, littleEndian = false) -> float32 - #getFloat64(offset, littleEndian = false) -> float64 - #setInt8(offset, value) -> void - #setUint8(offset, value) -> void - #setInt16(offset, value, littleEndian = false) -> void - #setUint16(offset, value, littleEndian = false) -> void - #setInt32(offset, value, littleEndian = false) -> void - #setUint32(offset, value, littleEndian = false) -> void - #setFloat32(offset, value, littleEndian = false) -> void - #setFloat64(offset, value, littleEndian = false) -> void - #buffer -> buffer - #byteLength -> uint - #byteOffset -> uint - -{ - Int8Array, - Uint8Array, - Uint8ClampedArray, - Int16Array, - Uint16Array, - Int32Array, - Uint32Array, - Float32Array, - Float64Array -} - new %TypedArray%(length) -> typed - new %TypedArray%(typed) -> typed - new %TypedArray%(arrayLike) -> typed - new %TypedArray%(iterable) -> typed - new %TypedArray%(buffer, byteOffset = 0, length = (buffer.byteLength - byteOffset) / @BYTES_PER_ELEMENT) -> typed - .BYTES_PER_ELEMENT -> uint - .from(arrayLike | iterable, mapFn(val, index)?, that) -> typed - .of(...args) -> typed - #BYTES_PER_ELEMENT -> uint - #copyWithin(target = 0, start = 0, end = @length) -> @ - #every(fn(val, index, @), that) -> bool - #fill(val, start = 0, end = @length) -> @ - #filter(fn(val, index, @), that) -> typed - #find(fn(val, index, @), that) -> val - #findIndex(fn(val, index, @), that) -> index - #forEach(fn(val, index, @), that) -> void - #indexOf(var, from?) -> int - #join(string = ',') -> string - #lastIndexOf(var, from?) -> int - #map(fn(val, index, @), that) -> typed - #reduce(fn(memo, val, index, @), memo?) -> var - #reduceRight(fn(memo, val, index, @), memo?) -> var - #reverse() -> @ - #set(arrayLike, offset = 0) -> void - #slice(start = 0, end = @length) -> typed - #some(fn(val, index, @), that) -> bool - #sort(fn(a, b)?) -> @ - #subarray(start = 0, end = @length) -> typed - #toString() -> string - #toLocaleString() -> string - #values() -> iterator - #keys() -> iterator - #entries() -> iterator - #@@iterator() -> iterator (values) - #buffer -> buffer - #byteLength -> uint - #byteOffset -> uint - #length -> uint -``` -[*CommonJS entry points:*](#commonjs) -``` -core-js(/library)/es6/typed -core-js(/library)/fn/typed -core-js(/library)/fn/typed/array-buffer -core-js(/library)/fn/typed/data-view -core-js(/library)/fn/typed/int8-array -core-js(/library)/fn/typed/uint8-array -core-js(/library)/fn/typed/uint8-clamped-array -core-js(/library)/fn/typed/int16-array -core-js(/library)/fn/typed/uint16-array -core-js(/library)/fn/typed/int32-array -core-js(/library)/fn/typed/uint32-array -core-js(/library)/fn/typed/float32-array -core-js(/library)/fn/typed/float64-array -``` -[*Examples*](http://goo.gl/yla75z): -```js -new Int32Array(4); // => [0, 0, 0, 0] -new Uint8ClampedArray([1, 2, 3, 666]); // => [1, 2, 3, 255] -new Float32Array(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3] - -var buffer = new ArrayBuffer(8); -var view = new DataView(buffer); -view.setFloat64(0, 123.456, true); -new Uint8Array(buffer.slice(4)); // => [47, 221, 94, 64] - -Int8Array.of(1, 1.5, 5.7, 745); // => [1, 1, 5, -23] -Uint8Array.from([1, 1.5, 5.7, 745]); // => [1, 1, 5, 233] - -var typed = new Uint8Array([1, 2, 3]); - -var a = typed.slice(1); // => [2, 3] -typed.buffer === a.buffer; // => false -var b = typed.subarray(1); // => [2, 3] -typed.buffer === b.buffer; // => true - -typed.filter(it => it % 2); // => [1, 3] -typed.map(it => it * 1.5); // => [1, 3, 4] - -for(var val of typed)console.log(val); // => 1, 2, 3 -for(var val of typed.values())console.log(val); // => 1, 2, 3 -for(var key of typed.keys())console.log(key); // => 0, 1, 2 -for(var [key, val] of typed.entries()){ - console.log(key); // => 0, 1, 2 - console.log(val); // => 1, 2, 3 -} -``` -##### Caveats when using typed arrays: - -* Typed Arrays polyfills works completely how should work by the spec, but because of internal use getter / setters on each instance, is slow and consumes significant memory. However, typed arrays polyfills required mainly for IE9 (and for `Uint8ClampedArray` in IE10 and early IE11), all modern engines have native typed arrays and requires only constructors fixes and methods. -* The current version hasn't special entry points for methods, they can be added only with constructors. It can be added in the future. -* In the `library` version we can't pollute native prototypes, so prototype methods available as constructors static. - -#### ECMAScript 6: Reflect -Modules [`es6.reflect.apply`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.apply.js), [`es6.reflect.construct`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.construct.js), [`es6.reflect.define-property`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.define-property.js), [`es6.reflect.delete-property`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.delete-property.js), [`es6.reflect.enumerate`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.enumerate.js), [`es6.reflect.get`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.get.js), [`es6.reflect.get-own-property-descriptor`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.get-own-property-descriptor.js), [`es6.reflect.get-prototype-of`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.get-prototype-of.js), [`es6.reflect.has`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.has.js), [`es6.reflect.is-extensible`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.is-extensible.js), [`es6.reflect.own-keys`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.own-keys.js), [`es6.reflect.prevent-extensions`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.prevent-extensions.js), [`es6.reflect.set`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.set.js), [`es6.reflect.set-prototype-of`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es6.reflect.set-prototype-of.js). -```js -Reflect - .apply(target, thisArgument, argumentsList) -> var - .construct(target, argumentsList, newTarget?) -> object - .defineProperty(target, propertyKey, attributes) -> bool - .deleteProperty(target, propertyKey) -> bool - .enumerate(target) -> iterator (removed from the spec and will be removed from core-js@3) - .get(target, propertyKey, receiver?) -> var - .getOwnPropertyDescriptor(target, propertyKey) -> desc - .getPrototypeOf(target) -> object | null - .has(target, propertyKey) -> bool - .isExtensible(target) -> bool - .ownKeys(target) -> array - .preventExtensions(target) -> bool - .set(target, propertyKey, V, receiver?) -> bool - .setPrototypeOf(target, proto) -> bool (required __proto__ - IE11+) -``` -[*CommonJS entry points:*](#commonjs) -``` -core-js(/library)/es6/reflect -core-js(/library)/fn/reflect -core-js(/library)/fn/reflect/apply -core-js(/library)/fn/reflect/construct -core-js(/library)/fn/reflect/define-property -core-js(/library)/fn/reflect/delete-property -core-js(/library)/fn/reflect/enumerate (deprecated and will be removed from the next major release) -core-js(/library)/fn/reflect/get -core-js(/library)/fn/reflect/get-own-property-descriptor -core-js(/library)/fn/reflect/get-prototype-of -core-js(/library)/fn/reflect/has -core-js(/library)/fn/reflect/is-extensible -core-js(/library)/fn/reflect/own-keys -core-js(/library)/fn/reflect/prevent-extensions -core-js(/library)/fn/reflect/set -core-js(/library)/fn/reflect/set-prototype-of -``` -[*Examples*](http://goo.gl/gVT0cH): -```js -var O = {a: 1}; -Object.defineProperty(O, 'b', {value: 2}); -O[Symbol('c')] = 3; -Reflect.ownKeys(O); // => ['a', 'b', Symbol(c)] - -function C(a, b){ - this.c = a + b; -} - -var instance = Reflect.construct(C, [20, 22]); -instance.c; // => 42 -``` - -### ECMAScript 7+ proposals -[The TC39 process.](https://tc39.github.io/process-document/) - -[*CommonJS entry points:*](#commonjs) -``` -core-js(/library)/es7 -core-js(/library)/es7/array -core-js(/library)/es7/global -core-js(/library)/es7/string -core-js(/library)/es7/map -core-js(/library)/es7/set -core-js(/library)/es7/error -core-js(/library)/es7/math -core-js(/library)/es7/system -core-js(/library)/es7/symbol -core-js(/library)/es7/reflect -core-js(/library)/es7/observable -``` -`core-js/stage/4` entry point contains only stage 4 proposals, `core-js/stage/3` - stage 3 and stage 4, etc. -#### Stage 4 proposals - -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/stage/4 -``` -* `{Array, %TypedArray%}#includes` [proposal](https://github.com/tc39/Array.prototype.includes) - module [`es7.array.includes`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.array.includes.js), `%TypedArray%` version in modules from [this section](#ecmascript-6-typed-arrays). -```js -Array - #includes(var, from?) -> bool -{ - Int8Array, - Uint8Array, - Uint8ClampedArray, - Int16Array, - Uint16Array, - Int32Array, - Uint32Array, - Float32Array, - Float64Array -} - #includes(var, from?) -> bool -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/array/includes -``` -[*Examples*](http://goo.gl/2Gq4ma): -```js -[1, 2, 3].includes(2); // => true -[1, 2, 3].includes(4); // => false -[1, 2, 3].includes(2, 2); // => false - -[NaN].indexOf(NaN); // => -1 -[NaN].includes(NaN); // => true -Array(1).indexOf(undefined); // => -1 -Array(1).includes(undefined); // => true -``` -* `Object.values`, `Object.entries` [proposal](https://github.com/tc39/proposal-object-values-entries) - modules [`es7.object.values`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.object.values.js), [`es7.object.entries`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.object.entries.js) -```js -Object - .values(object) -> array - .entries(object) -> array -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/object/values -core-js(/library)/fn/object/entries -``` -[*Examples*](http://goo.gl/6kuGOn): -```js -Object.values({a: 1, b: 2, c: 3}); // => [1, 2, 3] -Object.entries({a: 1, b: 2, c: 3}); // => [['a', 1], ['b', 2], ['c', 3]] - -for(let [key, value] of Object.entries({a: 1, b: 2, c: 3})){ - console.log(key); // => 'a', 'b', 'c' - console.log(value); // => 1, 2, 3 -} -``` -* `Object.getOwnPropertyDescriptors` [proposal](https://github.com/tc39/proposal-object-getownpropertydescriptors) - module [`es7.object.get-own-property-descriptors`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.object.get-own-property-descriptors.js) -```js -Object - .getOwnPropertyDescriptors(object) -> object -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/object/get-own-property-descriptors -``` -*Examples*: -```js -// Shallow object cloning with prototype and descriptors: -var copy = Object.create(Object.getPrototypeOf(O), Object.getOwnPropertyDescriptors(O)); -// Mixin: -Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); -``` -* `String#padStart`, `String#padEnd` [proposal](https://github.com/tc39/proposal-string-pad-start-end) - modules [`es7.string.pad-start`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.string.pad-start.js), [`es7.string.pad-end`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.string.pad-end.js) -```js -String - #padStart(length, fillStr = ' ') -> string - #padEnd(length, fillStr = ' ') -> string -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/string/pad-start -core-js(/library)/fn/string/pad-end -core-js(/library)/fn/string/virtual/pad-start -core-js(/library)/fn/string/virtual/pad-end -``` -[*Examples*](http://goo.gl/hK5ccv): -```js -'hello'.padStart(10); // => ' hello' -'hello'.padStart(10, '1234'); // => '12341hello' -'hello'.padEnd(10); // => 'hello ' -'hello'.padEnd(10, '1234'); // => 'hello12341' -``` -* `Object#__(define|lookup)[GS]etter__`, [annex B ES2017](https://github.com/tc39/ecma262/pull/381), but we haven't special namespace for that - modules [`es7.object.define-setter`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.object.define-setter.js), [`es7.object.define-getter`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.object.define-getter.js), [`es7.object.lookup-setter`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.object.lookup-setter.js) and [`es7.object.lookup-getter`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.object.lookup-getter.js). -```js -Object - #__defineSetter__(key, fn) -> void - #__defineGetter__(key, fn) -> void - #__lookupSetter__(key) -> fn | void - #__lookupGetter__(key) -> fn | void -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/object/define-getter -core-js(/library)/fn/object/define-setter -core-js(/library)/fn/object/lookup-getter -core-js(/library)/fn/object/lookup-setter -``` - -#### Stage 3 proposals -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/stage/3 -``` -* `global` [proposal](https://github.com/tc39/proposal-global) - modules [`es7.global`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.global.js) and [`es7.system.global`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.system.global.js) (obsolete) -```js -global -> object -System - .global -> object (obsolete) -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/global -core-js(/library)/fn/system/global (obsolete) -``` -[*Examples*](http://goo.gl/gEqMl7): -```js -global.Array === Array; // => true -``` -* `Promise#finally` [proposal](https://github.com/tc39/proposal-promise-finally) - module [`es7.promise.finally`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.promise.finally.js) -```js -Promise - #finally(onFinally()) -> promise -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/promise/finally -``` -[*Examples*](https://goo.gl/AhyBbJ): -```js -Promise.resolve(42).finally(() => console.log('You will see it anyway')); - -Promise.reject(42).finally(() => console.log('You will see it anyway')); - -#### Stage 2 proposals -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/stage/2 -``` -* `String#trimLeft`, `String#trimRight` / `String#trimStart`, `String#trimEnd` [proposal](https://github.com/sebmarkbage/ecmascript-string-left-right-trim) - modules [`es7.string.trim-left`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.string.trim-right.js), [`es7.string.trim-right`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.string.trim-right.js) -```js -String - #trimLeft() -> string - #trimRight() -> string - #trimStart() -> string - #trimEnd() -> string -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/string/trim-start -core-js(/library)/fn/string/trim-end -core-js(/library)/fn/string/trim-left -core-js(/library)/fn/string/trim-right -core-js(/library)/fn/string/virtual/trim-start -core-js(/library)/fn/string/virtual/trim-end -core-js(/library)/fn/string/virtual/trim-left -core-js(/library)/fn/string/virtual/trim-right -``` -[*Examples*](http://goo.gl/Er5lMJ): -```js -' hello '.trimLeft(); // => 'hello ' -' hello '.trimRight(); // => ' hello' -``` -``` -* `Symbol.asyncIterator` for [async iteration proposal](https://github.com/tc39/proposal-async-iteration) - module [`es7.symbol.async-iterator`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.symbol.async-iterator.js) -```js -Symbol - .asyncIterator -> @@asyncIterator -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/symbol/async-iterator -``` - -#### Stage 1 proposals -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/stage/1 -``` -* `Promise.try` [proposal](https://github.com/tc39/proposal-promise-try) - module [`es7.promise.try`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.promise.try.js) -```js -Promise - .try(function()) -> promise -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/promise/try -``` -[*Examples*](https://goo.gl/k5GGRo): -```js -Promise.try(() => 42).then(it => console.log(`Promise, resolved as ${it}`)); - -Promise.try(() => { throw 42; }).catch(it => console.log(`Promise, rejected as ${it}`)); -``` -* `Array#flatten` and `Array#flatMap` [proposal](https://tc39.github.io/proposal-flatMap) - modules [`es7.array.flatten`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.array.flatten.js) and [`es7.array.flat-map`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.array.flat-map.js) -```js -Array - #flatten(depthArg = 1) -> array - #flatMap(fn(val, key, @), that) -> array -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/array/flatten -core-js(/library)/fn/array/flat-map -core-js(/library)/fn/array/virtual/flatten -core-js(/library)/fn/array/virtual/flat-map -``` -[*Examples*](https://goo.gl/jTXsZi): -```js -[1, [2, 3], [4, 5]].flatten(); // => [1, 2, 3, 4, 5] -[1, [2, [3, [4]]], 5].flatten(); // => [1, 2, [3, [4]], 5] -[1, [2, [3, [4]]], 5].flatten(3); // => [1, 2, 3, 4, 5] - -[{a: 1, b: 2}, {a: 3, b: 4}, {a: 5, b: 6}].flatMap(it => [it.a, it.b]); // => [1, 2, 3, 4, 5, 6] -``` -* `.of` and `.from` methods on collection constructors [proposal](https://github.com/tc39/proposal-setmap-offrom) - modules [`es7.set.of`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.set.of.js), [`es7.set.from`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.set.from.js), [`es7.map.of`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.map.of.js), [`es7.map.from`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.map.from.js), [`es7.weak-set.of`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.weak-set.of.js), [`es7.weak-set.from`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.weak-set.from.js), [`es7.weak-map.of`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.weak-map.of.js), [`es7.weak-map.from`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.weak-map.from.js) -```js -Set - .of(...args) -> set - .from(iterable, mapFn(val, index)?, that?) -> set -Map - .of(...args) -> map - .from(iterable, mapFn(val, index)?, that?) -> map -WeakSet - .of(...args) -> weakset - .from(iterable, mapFn(val, index)?, that?) -> weakset -WeakMap - .of(...args) -> weakmap - .from(iterable, mapFn(val, index)?, that?) -> weakmap -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/set/of -core-js(/library)/fn/set/from -core-js(/library)/fn/map/of -core-js(/library)/fn/map/from -core-js(/library)/fn/weak-set/of -core-js(/library)/fn/weak-set/from -core-js(/library)/fn/weak-map/of -core-js(/library)/fn/weak-map/from -``` -[*Examples*](https://goo.gl/mSC7eU): -```js -Set.of(1, 2, 3, 2, 1); // => Set {1, 2, 3} - -Map.from([[1, 2], [3, 4]], ([key, val]) => [key ** 2, val ** 2]); // => Map {1: 4, 9: 16} -``` -* `String#matchAll` [proposal](https://github.com/tc39/String.prototype.matchAll) - module [`es7.string.match-all`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.string.match-all.js) -```js -String - #matchAll(regexp) -> iterator -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/string/match-all -core-js(/library)/fn/string/virtual/match-all -``` -[*Examples*](http://goo.gl/6kp9EB): -```js -for(let [_, d, D] of '1111a2b3cccc'.matchAll(/(\d)(\D)/)){ - console.log(d, D); // => 1 a, 2 b, 3 c -} -``` -* `Observable` [proposal](https://github.com/zenparsing/es-observable) - modules [`es7.observable`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.observable.js) and [`es7.symbol.observable`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.symbol.observable.js) -```js -new Observable(fn) -> observable - #subscribe(observer) -> subscription - #forEach(fn) -> promise - #@@observable() -> @ - .of(...items) -> observable - .from(observable | iterable) -> observable - .@@species -> @ -Symbol - .observable -> @@observable -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/observable -core-js(/library)/fn/symbol/observable -``` -[*Examples*](http://goo.gl/1LDywi): -```js -new Observable(observer => { - observer.next('hello'); - observer.next('world'); - observer.complete(); -}).forEach(it => console.log(it)) - .then(_ => console.log('!')); -``` -* `Math.{clamp, DEG_PER_RAD, degrees, fscale, rad-per-deg, radians, scale}` - [proposal](https://github.com/rwaldron/proposal-math-extensions) - modules - [`es7.math.clamp`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.clamp.js), - [`es7.math.DEG_PER_RAD`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.DEG_PER_RAD.js), - [`es7.math.degrees`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.degrees.js), - [`es7.math.fscale`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.fscale.js), - [`es7.math.RAD_PER_DEG`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.RAD_PER_DEG.js), - [`es7.math.radians`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.radians.js) and - [`es7.math.scale`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.scale.js) -```js -Math - .DEG_PER_RAD -> number - .RAD_PER_DEG -> number - .clamp(x, lower, upper) -> number - .degrees(radians) -> number - .fscale(x, inLow, inHigh, outLow, outHigh) -> number - .radians(degrees) -> number - .scale(x, inLow, inHigh, outLow, outHigh) -> number -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/math/clamp -core-js(/library)/fn/math/deg-per-rad -core-js(/library)/fn/math/degrees -core-js(/library)/fn/math/fscale -core-js(/library)/fn/math/rad-per-deg -core-js(/library)/fn/math/radians -core-js(/library)/fn/math/scale -``` -* `Math.signbit` [proposal](http://jfbastien.github.io/papers/Math.signbit.html) - module [`es7.math.signbit`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.signbit.js) -```js -Math - .signbit(x) -> bool -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/math/signbit -``` -[*Examples*](http://es6.zloirock.ru/): -```js -Math.signbit(NaN); // => NaN -Math.signbit(1); // => true -Math.signbit(-1); // => false -Math.signbit(0); // => true -Math.signbit(-0); // => false -``` - -#### Stage 0 proposals -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/stage/0 -``` -* `String#at` [proposal](https://github.com/mathiasbynens/String.prototype.at) - module [`es7.string.at`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.string.at.js) -```js -String - #at(index) -> string -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/string/at -core-js(/library)/fn/string/virtual/at -``` -[*Examples*](http://goo.gl/XluXI8): -```js -'a𠮷b'.at(1); // => '𠮷' -'a𠮷b'.at(1).length; // => 2 -``` -* `Map#toJSON`, `Set#toJSON` [proposal](https://github.com/DavidBruant/Map-Set.prototype.toJSON) - modules [`es7.map.to-json`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.map.to-json.js), [`es7.set.to-json`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.set.to-json.js) (rejected and will be removed from `core-js@3`) -```js -Map - #toJSON() -> array (rejected and will be removed from core-js@3) -Set - #toJSON() -> array (rejected and will be removed from core-js@3) -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/map -core-js(/library)/fn/set -``` -* `Error.isError` [proposal](https://github.com/ljharb/proposal-is-error) - module [`es7.error.is-error`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.error.is-error.js) (withdrawn and will be removed from `core-js@3`) -```js -Error - .isError(it) -> bool (withdrawn and will be removed from core-js@3) -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/error/is-error -``` -* `Math.{iaddh, isubh, imulh, umulh}` [proposal](https://gist.github.com/BrendanEich/4294d5c212a6d2254703) - modules [`es7.math.iaddh`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.iaddh.js), [`es7.math.isubh`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.isubh.js), [`es7.math.imulh`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.imulh.js) and [`es7.math.umulh`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.math.umulh.js) -```js -Math - .iaddh(lo0, hi0, lo1, hi1) -> int32 - .isubh(lo0, hi0, lo1, hi1) -> int32 - .imulh(a, b) -> int32 - .umulh(a, b) -> uint32 -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/math/iaddh -core-js(/library)/fn/math/isubh -core-js(/library)/fn/math/imulh -core-js(/library)/fn/math/umulh -``` -* `global.asap`, [TC39 discussion](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask), module [`es7.asap`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.asap.js) -```js -asap(fn) -> void -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/asap -``` -[*Examples*](http://goo.gl/tx3SRK): -```js -asap(() => console.log('called as microtask')); -``` - -#### Pre-stage 0 proposals -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/stage/pre -``` -* `Reflect` metadata [proposal](https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md) - modules [`es7.reflect.define-metadata`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.reflect.define-metadata.js), [`es7.reflect.delete-metadata`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.reflect.delete-metadata.js), [`es7.reflect.get-metadata`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.reflect.get-metadata.js), [`es7.reflect.get-metadata-keys`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.reflect.get-metadata-keys.js), [`es7.reflect.get-own-metadata`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.reflect.get-own-metadata.js), [`es7.reflect.get-own-metadata-keys`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.reflect.get-own-metadata-keys.js), [`es7.reflect.has-metadata`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.reflect.has-metadata.js), [`es7.reflect.has-own-metadata`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.reflect.has-own-metadata.js) and [`es7.reflect.metadata`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/es7.reflect.metadata.js). -```js -Reflect - .defineMetadata(metadataKey, metadataValue, target, propertyKey?) -> void - .getMetadata(metadataKey, target, propertyKey?) -> var - .getOwnMetadata(metadataKey, target, propertyKey?) -> var - .hasMetadata(metadataKey, target, propertyKey?) -> bool - .hasOwnMetadata(metadataKey, target, propertyKey?) -> bool - .deleteMetadata(metadataKey, target, propertyKey?) -> bool - .getMetadataKeys(target, propertyKey?) -> array - .getOwnMetadataKeys(target, propertyKey?) -> array - .metadata(metadataKey, metadataValue) -> decorator(target, targetKey?) -> void -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/reflect/define-metadata -core-js(/library)/fn/reflect/delete-metadata -core-js(/library)/fn/reflect/get-metadata -core-js(/library)/fn/reflect/get-metadata-keys -core-js(/library)/fn/reflect/get-own-metadata -core-js(/library)/fn/reflect/get-own-metadata-keys -core-js(/library)/fn/reflect/has-metadata -core-js(/library)/fn/reflect/has-own-metadata -core-js(/library)/fn/reflect/metadata -``` -[*Examples*](http://goo.gl/KCo3PS): -```js -var O = {}; -Reflect.defineMetadata('foo', 'bar', O); -Reflect.ownKeys(O); // => [] -Reflect.getOwnMetadataKeys(O); // => ['foo'] -Reflect.getOwnMetadata('foo', O); // => 'bar' -``` - -### Web standards -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/web -``` -#### setTimeout / setInterval -Module [`web.timers`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/web.timers.js). Additional arguments fix for IE9-. -```js -setTimeout(fn(...args), time, ...args) -> id -setInterval(fn(...args), time, ...args) -> id -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/web/timers -core-js(/library)/fn/set-timeout -core-js(/library)/fn/set-interval -``` -```js -// Before: -setTimeout(log.bind(null, 42), 1000); -// After: -setTimeout(log, 1000, 42); -``` -#### setImmediate -Module [`web.immediate`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/web.immediate.js). [`setImmediate` proposal](https://developer.mozilla.org/en-US/docs/Web/API/Window.setImmediate) polyfill. -```js -setImmediate(fn(...args), ...args) -> id -clearImmediate(id) -> void -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/web/immediate -core-js(/library)/fn/set-immediate -core-js(/library)/fn/clear-immediate -``` -[*Examples*](http://goo.gl/6nXGrx): -```js -setImmediate(function(arg1, arg2){ - console.log(arg1, arg2); // => Message will be displayed with minimum delay -}, 'Message will be displayed', 'with minimum delay'); - -clearImmediate(setImmediate(function(){ - console.log('Message will not be displayed'); -})); -``` -#### Iterable DOM collections -Some DOM collections should have [iterable interface](https://heycam.github.io/webidl/#idl-iterable) or should be [inherited from `Array`](https://heycam.github.io/webidl/#LegacyArrayClass). That mean they should have `keys`, `values`, `entries` and `@@iterator` methods for iteration. So add them. Module [`web.dom.iterable`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/web.dom.iterable.js): -```js -{ - 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 -} - #@@iterator() -> iterator (values) - -{ - DOMTokenList, - NodeList -} - #values() -> iterator - #keys() -> iterator - #entries() -> iterator -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/web/dom-collections -core-js(/library)/fn/dom-collections/iterator -``` -[*Examples*](http://goo.gl/lfXVFl): -```js -for(var {id} of document.querySelectorAll('*')){ - if(id)console.log(id); -} - -for(var [index, {id}] of document.querySelectorAll('*').entries()){ - if(id)console.log(index, id); -} -``` -### Non-standard -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/core -``` -#### Object -Modules [`core.object.is-object`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.object.is-object.js), [`core.object.classof`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.object.classof.js), [`core.object.define`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.object.define.js), [`core.object.make`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.object.make.js). -```js -Object - .isObject(var) -> bool - .classof(var) -> string - .define(target, mixin) -> target - .make(proto | null, mixin?) -> object -``` - -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/core/object -core-js(/library)/fn/object/is-object -core-js(/library)/fn/object/define -core-js(/library)/fn/object/make -``` -Object classify [*examples*](http://goo.gl/YZQmGo): -```js -Object.isObject({}); // => true -Object.isObject(isNaN); // => true -Object.isObject(null); // => false - -var classof = Object.classof; - -classof(null); // => 'Null' -classof(undefined); // => 'Undefined' -classof(1); // => 'Number' -classof(true); // => 'Boolean' -classof('string'); // => 'String' -classof(Symbol()); // => 'Symbol' - -classof(new Number(1)); // => 'Number' -classof(new Boolean(true)); // => 'Boolean' -classof(new String('string')); // => 'String' - -var fn = function(){} - , list = (function(){return arguments})(1, 2, 3); - -classof({}); // => 'Object' -classof(fn); // => 'Function' -classof([]); // => 'Array' -classof(list); // => 'Arguments' -classof(/./); // => 'RegExp' -classof(new TypeError); // => 'Error' - -classof(new Set); // => 'Set' -classof(new Map); // => 'Map' -classof(new WeakSet); // => 'WeakSet' -classof(new WeakMap); // => 'WeakMap' -classof(new Promise(fn)); // => 'Promise' - -classof([].values()); // => 'Array Iterator' -classof(new Set().values()); // => 'Set Iterator' -classof(new Map().values()); // => 'Map Iterator' - -classof(Math); // => 'Math' -classof(JSON); // => 'JSON' - -function Example(){} -Example.prototype[Symbol.toStringTag] = 'Example'; - -classof(new Example); // => 'Example' -``` -`Object.define` and `Object.make` [*examples*](http://goo.gl/rtpD5Z): -```js -// Before: -Object.defineProperty(target, 'c', { - enumerable: true, - configurable: true, - get: function(){ - return this.a + this.b; - } -}); - -// After: -Object.define(target, { - get c(){ - return this.a + this.b; - } -}); - -// Shallow object cloning with prototype and descriptors: -var copy = Object.make(Object.getPrototypeOf(src), src); - -// Simple inheritance: -function Vector2D(x, y){ - this.x = x; - this.y = y; -} -Object.define(Vector2D.prototype, { - get xy(){ - return Math.hypot(this.x, this.y); - } -}); -function Vector3D(x, y, z){ - Vector2D.apply(this, arguments); - this.z = z; -} -Vector3D.prototype = Object.make(Vector2D.prototype, { - constructor: Vector3D, - get xyz(){ - return Math.hypot(this.x, this.y, this.z); - } -}); - -var vector = new Vector3D(9, 12, 20); -console.log(vector.xy); // => 15 -console.log(vector.xyz); // => 25 -vector.y++; -console.log(vector.xy); // => 15.811388300841896 -console.log(vector.xyz); // => 25.495097567963924 -``` -#### Dict -Module [`core.dict`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.dict.js). Based on [TC39 discuss](https://github.com/rwaldron/tc39-notes/blob/master/es6/2012-11/nov-29.md#collection-apis-review) / [strawman](http://wiki.ecmascript.org/doku.php?id=harmony:modules_standard#dictionaries). -```js -[new] Dict(iterable (entries) | object ?) -> dict - .isDict(var) -> bool - .values(object) -> iterator - .keys(object) -> iterator - .entries(object) -> iterator (entries) - .has(object, key) -> bool - .get(object, key) -> val - .set(object, key, value) -> object - .forEach(object, fn(val, key, @), that) -> void - .map(object, fn(val, key, @), that) -> new @ - .mapPairs(object, fn(val, key, @), that) -> new @ - .filter(object, fn(val, key, @), that) -> new @ - .some(object, fn(val, key, @), that) -> bool - .every(object, fn(val, key, @), that) -> bool - .find(object, fn(val, key, @), that) -> val - .findKey(object, fn(val, key, @), that) -> key - .keyOf(object, var) -> key - .includes(object, var) -> bool - .reduce(object, fn(memo, val, key, @), memo?) -> var -``` - -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/core/dict -core-js(/library)/fn/dict -``` -`Dict` create object without prototype from iterable or simple object. - -[*Examples*](http://goo.gl/pnp8Vr): -```js -var map = new Map([['a', 1], ['b', 2], ['c', 3]]); - -Dict(); // => {__proto__: null} -Dict({a: 1, b: 2, c: 3}); // => {__proto__: null, a: 1, b: 2, c: 3} -Dict(map); // => {__proto__: null, a: 1, b: 2, c: 3} -Dict([1, 2, 3].entries()); // => {__proto__: null, 0: 1, 1: 2, 2: 3} - -var dict = Dict({a: 42}); -dict instanceof Object; // => false -dict.a; // => 42 -dict.toString; // => undefined -'a' in dict; // => true -'hasOwnProperty' in dict; // => false - -Dict.isDict({}); // => false -Dict.isDict(Dict()); // => true -``` -`Dict.keys`, `Dict.values` and `Dict.entries` returns iterators for objects. - -[*Examples*](http://goo.gl/xAvECH): -```js -var dict = {a: 1, b: 2, c: 3}; - -for(var key of Dict.keys(dict))console.log(key); // => 'a', 'b', 'c' - -for(var val of Dict.values(dict))console.log(val); // => 1, 2, 3 - -for(var [key, val] of Dict.entries(dict)){ - console.log(key); // => 'a', 'b', 'c' - console.log(val); // => 1, 2, 3 -} - -new Map(Dict.entries(dict)); // => Map {a: 1, b: 2, c: 3} -``` -Basic dict operations for objects with prototype [*examples*](http://goo.gl/B28UnG): -```js -'q' in {q: 1}; // => true -'toString' in {}; // => true - -Dict.has({q: 1}, 'q'); // => true -Dict.has({}, 'toString'); // => false - -({q: 1})['q']; // => 1 -({}).toString; // => function toString(){ [native code] } - -Dict.get({q: 1}, 'q'); // => 1 -Dict.get({}, 'toString'); // => undefined - -var O = {}; -O['q'] = 1; -O['q']; // => 1 -O['__proto__'] = {w: 2}; -O['__proto__']; // => {w: 2} -O['w']; // => 2 - -var O = {}; -Dict.set(O, 'q', 1); -O['q']; // => 1 -Dict.set(O, '__proto__', {w: 2}); -O['__proto__']; // => {w: 2} -O['w']; // => undefined -``` -Other methods of `Dict` module are static equivalents of `Array.prototype` methods for dictionaries. - -[*Examples*](http://goo.gl/xFi1RH): -```js -var dict = {a: 1, b: 2, c: 3}; - -Dict.forEach(dict, console.log, console); -// => 1, 'a', {a: 1, b: 2, c: 3} -// => 2, 'b', {a: 1, b: 2, c: 3} -// => 3, 'c', {a: 1, b: 2, c: 3} - -Dict.map(dict, function(it){ - return it * it; -}); // => {a: 1, b: 4, c: 9} - -Dict.mapPairs(dict, function(val, key){ - if(key != 'b')return [key + key, val * val]; -}); // => {aa: 1, cc: 9} - -Dict.filter(dict, function(it){ - return it % 2; -}); // => {a: 1, c: 3} - -Dict.some(dict, function(it){ - return it === 2; -}); // => true - -Dict.every(dict, function(it){ - return it === 2; -}); // => false - -Dict.find(dict, function(it){ - return it > 2; -}); // => 3 -Dict.find(dict, function(it){ - return it > 4; -}); // => undefined - -Dict.findKey(dict, function(it){ - return it > 2; -}); // => 'c' -Dict.findKey(dict, function(it){ - return it > 4; -}); // => undefined - -Dict.keyOf(dict, 2); // => 'b' -Dict.keyOf(dict, 4); // => undefined - -Dict.includes(dict, 2); // => true -Dict.includes(dict, 4); // => false - -Dict.reduce(dict, function(memo, it){ - return memo + it; -}); // => 6 -Dict.reduce(dict, function(memo, it){ - return memo + it; -}, ''); // => '123' -``` -#### Partial application -Module [`core.function.part`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.function.part.js). -```js -Function - #part(...args | _) -> fn(...args) -``` - -[*CommonJS entry points:*](#commonjs) -```js -core-js/core/function -core-js(/library)/fn/function/part -core-js(/library)/fn/function/virtual/part -core-js(/library)/fn/_ -``` -`Function#part` partial apply function without `this` binding. Uses global variable `_` (`core._` for builds without global namespace pollution) as placeholder and not conflict with `Underscore` / `LoDash`. - -[*Examples*](http://goo.gl/p9ZJ8K): -```js -var fn1 = log.part(1, 2); -fn1(3, 4); // => 1, 2, 3, 4 - -var fn2 = log.part(_, 2, _, 4); -fn2(1, 3); // => 1, 2, 3, 4 - -var fn3 = log.part(1, _, _, 4); -fn3(2, 3); // => 1, 2, 3, 4 - -fn2(1, 3, 5); // => 1, 2, 3, 4, 5 -fn2(1); // => 1, 2, undefined, 4 -``` -#### Number Iterator -Module [`core.number.iterator`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.number.iterator.js). -```js -Number - #@@iterator() -> iterator -``` - -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/core/number -core-js(/library)/fn/number/iterator -core-js(/library)/fn/number/virtual/iterator -``` -[*Examples*](http://goo.gl/o45pCN): -```js -for(var i of 3)console.log(i); // => 0, 1, 2 - -[...10]; // => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - -Array.from(10, Math.random); // => [0.9817775336559862, 0.02720663254149258, ...] - -Array.from(10, function(it){ - return this + it * it; -}, .42); // => [0.42, 1.42, 4.42, 9.42, 16.42, 25.42, 36.42, 49.42, 64.42, 81.42] -``` -#### Escaping strings -Modules [`core.regexp.escape`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.regexp.escape.js), [`core.string.escape-html`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.string.escape-html.js) and [`core.string.unescape-html`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.string.unescape-html.js). -```js -RegExp - .escape(str) -> str -String - #escapeHTML() -> str - #unescapeHTML() -> str -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/core/regexp -core-js(/library)/core/string -core-js(/library)/fn/regexp/escape -core-js(/library)/fn/string/escape-html -core-js(/library)/fn/string/unescape-html -core-js(/library)/fn/string/virtual/escape-html -core-js(/library)/fn/string/virtual/unescape-html -``` -[*Examples*](http://goo.gl/6bOvsQ): -```js -RegExp.escape('Hello, []{}()*+?.\\^$|!'); // => 'Hello, \[\]\{\}\(\)\*\+\?\.\\\^\$\|!' - -''.escapeHTML(); // => '<script>doSomething();</script>' -'<script>doSomething();</script>'.unescapeHTML(); // => '' -``` -#### delay -Module [`core.delay`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.delay.js). [Promise](#ecmascript-6-promise)-returning delay function, [esdiscuss](https://esdiscuss.org/topic/promise-returning-delay-function). -```js -delay(ms) -> promise -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/core/delay -core-js(/library)/fn/delay -``` -[*Examples*](http://goo.gl/lbucba): -```js -delay(1e3).then(() => console.log('after 1 sec')); - -(async () => { - await delay(3e3); - console.log('after 3 sec'); - - while(await delay(3e3))console.log('each 3 sec'); -})(); -``` -#### Helpers for iterators -Modules [`core.is-iterable`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.is-iterable.js), [`core.get-iterator`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.get-iterator.js), [`core.get-iterator-method`](https://github.com/zloirock/core-js/blob/v2.5.7/modules/core.get-iterator-method.js) - helpers for check iterability / get iterator in the `library` version or, for example, for `arguments` object: -```js -core - .isIterable(var) -> bool - .getIterator(iterable) -> iterator - .getIteratorMethod(var) -> function | undefined -``` -[*CommonJS entry points:*](#commonjs) -```js -core-js(/library)/fn/is-iterable -core-js(/library)/fn/get-iterator -core-js(/library)/fn/get-iterator-method -``` -[*Examples*](http://goo.gl/SXsM6D): -```js -var list = (function(){ - return arguments; -})(1, 2, 3); - -console.log(core.isIterable(list)); // true; - -var iter = core.getIterator(list); -console.log(iter.next().value); // 1 -console.log(iter.next().value); // 2 -console.log(iter.next().value); // 3 -console.log(iter.next().value); // undefined - -core.getIterator({}); // TypeError: [object Object] is not iterable! - -var iterFn = core.getIteratorMethod(list); -console.log(typeof iterFn); // 'function' -var iter = iterFn.call(list); -console.log(iter.next().value); // 1 -console.log(iter.next().value); // 2 -console.log(iter.next().value); // 3 -console.log(iter.next().value); // undefined - -console.log(core.getIteratorMethod({})); // undefined -``` - -## Missing polyfills -- ES5 `JSON` is missing now only in IE7- and never will it be added to `core-js`, if you need it in these old browsers, many implementations are available, for example, [json3](https://github.com/bestiejs/json3). -- ES6 `String#normalize` is not a very useful feature, but this polyfill will be very large. If you need it, you can use [unorm](https://github.com/walling/unorm/). -- ES6 `Proxy` can't be polyfilled, but for Node.js / Chromium with additional flags you can try [harmony-reflect](https://github.com/tvcutsem/harmony-reflect) for adapt old style `Proxy` API to final ES6 version. -- ES6 logic for `@@isConcatSpreadable` and `@@species` (in most places) can be polyfilled without problems, but it will cause a serious slowdown in popular cases in some engines. It will be polyfilled when it will be implemented in modern engines. -- ES7 `SIMD`. `core-js` doesn't add polyfill of this feature because of large size and some other reasons. You can use [this polyfill](https://github.com/tc39/ecmascript_simd/blob/master/src/ecmascript_simd.js). -- `window.fetch` is not a cross-platform feature, in some environments it makes no sense. For this reason, I don't think it should be in `core-js`. Looking at a large number of requests it *may be* added in the future. Now you can use, for example, [this polyfill](https://github.com/github/fetch). -- ECMA-402 `Intl` is missed because of size. You can use [this polyfill](https://github.com/andyearnshaw/Intl.js/). diff --git a/node_modules/core-js/bower.json b/node_modules/core-js/bower.json deleted file mode 100644 index 0700602a0..000000000 --- a/node_modules/core-js/bower.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "core.js", - "main": "client/core.js", - "version": "2.5.7", - "description": "Standard Library", - "keywords": [ - "ES3", - "ES5", - "ES6", - "ES7", - "ES2015", - "ES2016", - "ES2017", - "ECMAScript 3", - "ECMAScript 5", - "ECMAScript 6", - "ECMAScript 7", - "ECMAScript 2015", - "ECMAScript 2016", - "ECMAScript 2017", - "Harmony", - "Strawman", - "Map", - "Set", - "WeakMap", - "WeakSet", - "Promise", - "Symbol", - "TypedArray", - "setImmediate", - "Dict", - "polyfill", - "shim" - ], - "authors": [ - "Denis Pushkarev (http://zloirock.ru/)" - ], - "license": "MIT", - "homepage": "https://github.com/zloirock/core-js", - "repository": { - "type": "git", - "url": "https://github.com/zloirock/core-js.git" - }, - "ignore": [ - "build", - "node_modules", - "tests" - ] -} diff --git a/node_modules/core-js/build/Gruntfile.ls b/node_modules/core-js/build/Gruntfile.ls deleted file mode 100644 index 7b8e46562..000000000 --- a/node_modules/core-js/build/Gruntfile.ls +++ /dev/null @@ -1,86 +0,0 @@ -require! <[./build fs ./config]> -module.exports = (grunt)-> - grunt.loadNpmTasks \grunt-contrib-clean - grunt.loadNpmTasks \grunt-contrib-copy - grunt.loadNpmTasks \grunt-contrib-uglify - grunt.loadNpmTasks \grunt-contrib-watch - grunt.loadNpmTasks \grunt-livescript - grunt.loadNpmTasks \grunt-karma - grunt.initConfig do - pkg: grunt.file.readJSON './package.json' - uglify: build: - files: '<%=grunt.option("path")%>.min.js': '<%=grunt.option("path")%>.js' - options: - mangle: {+keep_fnames} - compress: {+keep_fnames, +pure_getters} - output: {max_line_len: 32000} - ie8: on - sourceMap: on - banner: config.banner - livescript: src: files: - './tests/helpers.js': './tests/helpers/*' - './tests/tests.js': './tests/tests/*' - './tests/library.js': './tests/library/*' - './tests/es.js': './tests/tests/es*' - './tests/experimental.js': './tests/experimental/*' - './build/index.js': './build/build.ls*' - clean: <[./library]> - copy: lib: files: - * expand: on - cwd: './' - src: <[es5/** es6/** es7/** stage/** web/** core/** fn/** index.js shim.js]> - dest: './library/' - * expand: on - cwd: './' - src: <[modules/*]> - dest: './library/' - filter: \isFile - * expand: on - cwd: './modules/library/' - src: '*' - dest: './library/modules/' - watch: - core: - files: './modules/*' - tasks: \default - tests: - files: './tests/tests/*' - tasks: \livescript - karma: - 'options': - configFile: './tests/karma.conf.js' - browsers: <[PhantomJS]> - singleRun: on - 'default': {} - 'library': files: <[client/library.js tests/helpers.js tests/library.js]>map -> src: it - grunt.registerTask \build (options)-> - done = @async! - build { - modules: (options || 'es5,es6,es7,js,web,core')split \, - blacklist: (grunt.option(\blacklist) || '')split \, - library: grunt.option(\library) in <[yes on true]> - umd: grunt.option(\umd) not in <[no off false]> - } - .then !-> - grunt.option(\path) || grunt.option(\path, './custom') - fs.writeFile grunt.option(\path) + '.js', it, done - .catch !-> - console.error it - process.exit 1 - grunt.registerTask \client -> - grunt.option \library '' - grunt.option \path './client/core' - grunt.task.run <[build:es5,es6,es7,js,web,core uglify]> - grunt.registerTask \library -> - grunt.option \library 'true' - grunt.option \path './client/library' - grunt.task.run <[build:es5,es6,es7,js,web,core uglify]> - grunt.registerTask \shim -> - grunt.option \library '' - grunt.option \path './client/shim' - grunt.task.run <[build:es5,es6,es7,js,web uglify]> - grunt.registerTask \e -> - grunt.option \library ''> - grunt.option \path './client/core' - grunt.task.run <[build:es5,es6,es7,js,web,core,exp uglify]> - grunt.registerTask \default <[clean copy client library shim]> \ No newline at end of file diff --git a/node_modules/core-js/build/build.ls b/node_modules/core-js/build/build.ls deleted file mode 100644 index 6dbfa5825..000000000 --- a/node_modules/core-js/build/build.ls +++ /dev/null @@ -1,62 +0,0 @@ -require! { - '../library/fn/promise': Promise - './config': {list, experimental, libraryBlacklist, es5SpecialCase, banner} - fs: {readFile, writeFile, unlink} - path: {basename, dirname, join} - webpack, temp -} - -module.exports = ({modules = [], blacklist = [], library = no, umd = on})-> - resolve, reject <~! new Promise _ - let @ = modules.reduce ((memo, it)-> memo[it] = on; memo), {} - if @exp => for experimental => @[..] = on - if @es5 => for es5SpecialCase => @[..] = on - for ns of @ - if @[ns] - for name in list - if name.indexOf("#ns.") is 0 and name not in experimental - @[name] = on - - if library => blacklist ++= libraryBlacklist - for ns in blacklist - for name in list - if name is ns or name.indexOf("#ns.") is 0 - @[name] = no - - TARGET = temp.path {suffix: '.js'} - - err, info <~! webpack do - entry: list.filter(~> @[it]).map ~> - if library => join __dirname, '..', 'library', 'modules', it - else join __dirname, '..', 'modules', it - output: - path: dirname TARGET - filename: basename "./#TARGET" - if err => return reject err - - err, script <~! readFile TARGET - if err => return reject err - - err <~! unlink TARGET - if err => return reject err - - if umd - exportScript = """ - // CommonJS export - if (typeof module != 'undefined' && module.exports) module.exports = __e; - // RequireJS export - else if (typeof define == 'function' && define.amd) define(function () { return __e; }); - // Export to global object - else __g.core = __e; - """ - else - exportScript = "" - - resolve """ - #banner - !function(__e, __g, undefined){ - 'use strict'; - #script - #exportScript - }(1, 1); - """ \ No newline at end of file diff --git a/node_modules/core-js/build/config.js b/node_modules/core-js/build/config.js deleted file mode 100644 index 062d81058..000000000 --- a/node_modules/core-js/build/config.js +++ /dev/null @@ -1,274 +0,0 @@ -module.exports = { - list: [ - 'es6.symbol', - 'es6.object.define-property', - 'es6.object.define-properties', - 'es6.object.get-own-property-descriptor', - 'es6.object.create', - 'es6.object.get-prototype-of', - 'es6.object.keys', - 'es6.object.get-own-property-names', - 'es6.object.freeze', - 'es6.object.seal', - 'es6.object.prevent-extensions', - 'es6.object.is-frozen', - 'es6.object.is-sealed', - 'es6.object.is-extensible', - 'es6.object.assign', - 'es6.object.is', - 'es6.object.set-prototype-of', - 'es6.object.to-string', - 'es6.function.bind', - 'es6.function.name', - 'es6.function.has-instance', - 'es6.number.constructor', - 'es6.number.to-fixed', - 'es6.number.to-precision', - 'es6.number.epsilon', - 'es6.number.is-finite', - 'es6.number.is-integer', - 'es6.number.is-nan', - 'es6.number.is-safe-integer', - 'es6.number.max-safe-integer', - 'es6.number.min-safe-integer', - 'es6.number.parse-float', - 'es6.number.parse-int', - 'es6.parse-int', - 'es6.parse-float', - 'es6.math.acosh', - 'es6.math.asinh', - 'es6.math.atanh', - 'es6.math.cbrt', - 'es6.math.clz32', - 'es6.math.cosh', - 'es6.math.expm1', - 'es6.math.fround', - 'es6.math.hypot', - 'es6.math.imul', - 'es6.math.log10', - 'es6.math.log1p', - 'es6.math.log2', - 'es6.math.sign', - 'es6.math.sinh', - 'es6.math.tanh', - 'es6.math.trunc', - 'es6.string.from-code-point', - 'es6.string.raw', - 'es6.string.trim', - 'es6.string.code-point-at', - 'es6.string.ends-with', - 'es6.string.includes', - 'es6.string.repeat', - 'es6.string.starts-with', - 'es6.string.iterator', - 'es6.string.anchor', - 'es6.string.big', - 'es6.string.blink', - 'es6.string.bold', - 'es6.string.fixed', - 'es6.string.fontcolor', - 'es6.string.fontsize', - 'es6.string.italics', - 'es6.string.link', - 'es6.string.small', - 'es6.string.strike', - 'es6.string.sub', - 'es6.string.sup', - 'es6.array.is-array', - 'es6.array.from', - 'es6.array.of', - 'es6.array.join', - 'es6.array.slice', - 'es6.array.sort', - 'es6.array.for-each', - 'es6.array.map', - 'es6.array.filter', - 'es6.array.some', - 'es6.array.every', - 'es6.array.reduce', - 'es6.array.reduce-right', - 'es6.array.index-of', - 'es6.array.last-index-of', - 'es6.array.copy-within', - 'es6.array.fill', - 'es6.array.find', - 'es6.array.find-index', - 'es6.array.iterator', - 'es6.array.species', - 'es6.regexp.constructor', - 'es6.regexp.to-string', - 'es6.regexp.flags', - 'es6.regexp.match', - 'es6.regexp.replace', - 'es6.regexp.search', - 'es6.regexp.split', - 'es6.promise', - 'es6.map', - 'es6.set', - 'es6.weak-map', - 'es6.weak-set', - 'es6.reflect.apply', - 'es6.reflect.construct', - 'es6.reflect.define-property', - 'es6.reflect.delete-property', - 'es6.reflect.enumerate', - 'es6.reflect.get', - 'es6.reflect.get-own-property-descriptor', - 'es6.reflect.get-prototype-of', - 'es6.reflect.has', - 'es6.reflect.is-extensible', - 'es6.reflect.own-keys', - 'es6.reflect.prevent-extensions', - 'es6.reflect.set', - 'es6.reflect.set-prototype-of', - 'es6.date.now', - 'es6.date.to-json', - 'es6.date.to-iso-string', - 'es6.date.to-string', - 'es6.date.to-primitive', - 'es6.typed.array-buffer', - 'es6.typed.data-view', - 'es6.typed.int8-array', - 'es6.typed.uint8-array', - 'es6.typed.uint8-clamped-array', - 'es6.typed.int16-array', - 'es6.typed.uint16-array', - 'es6.typed.int32-array', - 'es6.typed.uint32-array', - 'es6.typed.float32-array', - 'es6.typed.float64-array', - 'es7.array.includes', - 'es7.array.flat-map', - 'es7.array.flatten', - 'es7.string.at', - 'es7.string.pad-start', - 'es7.string.pad-end', - 'es7.string.trim-left', - 'es7.string.trim-right', - 'es7.string.match-all', - 'es7.symbol.async-iterator', - 'es7.symbol.observable', - 'es7.object.get-own-property-descriptors', - 'es7.object.values', - 'es7.object.entries', - 'es7.object.define-getter', - 'es7.object.define-setter', - 'es7.object.lookup-getter', - 'es7.object.lookup-setter', - 'es7.map.to-json', - 'es7.set.to-json', - 'es7.map.of', - 'es7.set.of', - 'es7.weak-map.of', - 'es7.weak-set.of', - 'es7.map.from', - 'es7.set.from', - 'es7.weak-map.from', - 'es7.weak-set.from', - 'es7.global', - 'es7.system.global', - 'es7.error.is-error', - 'es7.math.clamp', - 'es7.math.deg-per-rad', - 'es7.math.degrees', - 'es7.math.fscale', - 'es7.math.iaddh', - 'es7.math.isubh', - 'es7.math.imulh', - 'es7.math.rad-per-deg', - 'es7.math.radians', - 'es7.math.scale', - 'es7.math.umulh', - 'es7.math.signbit', - 'es7.promise.finally', - 'es7.promise.try', - 'es7.reflect.define-metadata', - 'es7.reflect.delete-metadata', - 'es7.reflect.get-metadata', - 'es7.reflect.get-metadata-keys', - 'es7.reflect.get-own-metadata', - 'es7.reflect.get-own-metadata-keys', - 'es7.reflect.has-metadata', - 'es7.reflect.has-own-metadata', - 'es7.reflect.metadata', - 'es7.asap', - 'es7.observable', - 'web.immediate', - 'web.dom.iterable', - 'web.timers', - 'core.dict', - 'core.get-iterator-method', - 'core.get-iterator', - 'core.is-iterable', - 'core.delay', - 'core.function.part', - 'core.object.is-object', - 'core.object.classof', - 'core.object.define', - 'core.object.make', - 'core.number.iterator', - 'core.regexp.escape', - 'core.string.escape-html', - 'core.string.unescape-html', - ], - experimental: [ - ], - libraryBlacklist: [ - 'es6.object.to-string', - 'es6.function.name', - 'es6.regexp.constructor', - 'es6.regexp.to-string', - 'es6.regexp.flags', - 'es6.regexp.match', - 'es6.regexp.replace', - 'es6.regexp.search', - 'es6.regexp.split', - 'es6.number.constructor', - 'es6.date.to-string', - 'es6.date.to-primitive', - ], - es5SpecialCase: [ - 'es6.object.create', - 'es6.object.define-property', - 'es6.object.define-properties', - 'es6.object.get-own-property-descriptor', - 'es6.object.get-prototype-of', - 'es6.object.keys', - 'es6.object.get-own-property-names', - 'es6.object.freeze', - 'es6.object.seal', - 'es6.object.prevent-extensions', - 'es6.object.is-frozen', - 'es6.object.is-sealed', - 'es6.object.is-extensible', - 'es6.function.bind', - 'es6.array.is-array', - 'es6.array.join', - 'es6.array.slice', - 'es6.array.sort', - 'es6.array.for-each', - 'es6.array.map', - 'es6.array.filter', - 'es6.array.some', - 'es6.array.every', - 'es6.array.reduce', - 'es6.array.reduce-right', - 'es6.array.index-of', - 'es6.array.last-index-of', - 'es6.number.to-fixed', - 'es6.number.to-precision', - 'es6.date.now', - 'es6.date.to-iso-string', - 'es6.date.to-json', - 'es6.string.trim', - 'es6.regexp.to-string', - 'es6.parse-int', - 'es6.parse-float', - ], - banner: '/**\n' + - ' * core-js ' + require('../package').version + '\n' + - ' * https://github.com/zloirock/core-js\n' + - ' * License: http://rock.mit-license.org\n' + - ' * © ' + new Date().getFullYear() + ' Denis Pushkarev\n' + - ' */', -}; diff --git a/node_modules/core-js/build/index.js b/node_modules/core-js/build/index.js deleted file mode 100644 index 1df7f10cc..000000000 --- a/node_modules/core-js/build/index.js +++ /dev/null @@ -1,104 +0,0 @@ -// Generated by LiveScript 1.4.0 -(function(){ - var Promise, ref$, list, experimental, libraryBlacklist, es5SpecialCase, banner, readFile, writeFile, unlink, basename, dirname, join, webpack, temp; - Promise = require('../library/fn/promise'); - ref$ = require('./config'), list = ref$.list, experimental = ref$.experimental, libraryBlacklist = ref$.libraryBlacklist, es5SpecialCase = ref$.es5SpecialCase, banner = ref$.banner; - ref$ = require('fs'), readFile = ref$.readFile, writeFile = ref$.writeFile, unlink = ref$.unlink; - ref$ = require('path'), basename = ref$.basename, dirname = ref$.dirname, join = ref$.join; - webpack = require('webpack'); - temp = require('temp'); - module.exports = function(arg$){ - var modules, ref$, blacklist, library, umd, this$ = this; - modules = (ref$ = arg$.modules) != null - ? ref$ - : [], blacklist = (ref$ = arg$.blacklist) != null - ? ref$ - : [], library = (ref$ = arg$.library) != null ? ref$ : false, umd = (ref$ = arg$.umd) != null ? ref$ : true; - return new Promise(function(resolve, reject){ - (function(){ - var i$, x$, ref$, len$, y$, ns, name, j$, len1$, TARGET, this$ = this; - if (this.exp) { - for (i$ = 0, len$ = (ref$ = experimental).length; i$ < len$; ++i$) { - x$ = ref$[i$]; - this[x$] = true; - } - } - if (this.es5) { - for (i$ = 0, len$ = (ref$ = es5SpecialCase).length; i$ < len$; ++i$) { - y$ = ref$[i$]; - this[y$] = true; - } - } - for (ns in this) { - if (this[ns]) { - for (i$ = 0, len$ = (ref$ = list).length; i$ < len$; ++i$) { - name = ref$[i$]; - if (name.indexOf(ns + ".") === 0 && !in$(name, experimental)) { - this[name] = true; - } - } - } - } - if (library) { - blacklist = blacklist.concat(libraryBlacklist); - } - for (i$ = 0, len$ = blacklist.length; i$ < len$; ++i$) { - ns = blacklist[i$]; - for (j$ = 0, len1$ = (ref$ = list).length; j$ < len1$; ++j$) { - name = ref$[j$]; - if (name === ns || name.indexOf(ns + ".") === 0) { - this[name] = false; - } - } - } - TARGET = temp.path({ - suffix: '.js' - }); - webpack({ - entry: list.filter(function(it){ - return this$[it]; - }).map(function(it){ - if (library) { - return join(__dirname, '..', 'library', 'modules', it); - } else { - return join(__dirname, '..', 'modules', it); - } - }), - output: { - path: dirname(TARGET), - filename: basename("./" + TARGET) - } - }, function(err, info){ - if (err) { - return reject(err); - } - readFile(TARGET, function(err, script){ - if (err) { - return reject(err); - } - unlink(TARGET, function(err){ - var exportScript; - if (err) { - return reject(err); - } - if (umd) { - exportScript = "// CommonJS export\nif (typeof module != 'undefined' && module.exports) module.exports = __e;\n// RequireJS export\nelse if (typeof define == 'function' && define.amd) define(function () { return __e; });\n// Export to global object\nelse __g.core = __e;"; - } else { - exportScript = ""; - } - resolve("" + banner + "\n!function(__e, __g, undefined){\n'use strict';\n" + script + "\n" + exportScript + "\n}(1, 1);"); - }); - }); - }); - }.call(modules.reduce(function(memo, it){ - memo[it] = true; - return memo; - }, {}))); - }); - }; - function in$(x, xs){ - var i = -1, l = xs.length >>> 0; - while (++i < l) if (x === xs[i]) return true; - return false; - } -}).call(this); diff --git a/node_modules/core-js/client/core.js b/node_modules/core-js/client/core.js deleted file mode 100644 index 61090772b..000000000 --- a/node_modules/core-js/client/core.js +++ /dev/null @@ -1,8645 +0,0 @@ -/** - * core-js 2.5.7 - * https://github.com/zloirock/core-js - * License: http://rock.mit-license.org - * © 2018 Denis Pushkarev - */ -!function(__e, __g, undefined){ -'use strict'; -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 129); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(2); -var core = __webpack_require__(13); -var hide = __webpack_require__(14); -var redefine = __webpack_require__(15); -var ctx = __webpack_require__(19); -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 target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; - var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); - var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); - var key, own, out, exp; - if (IS_GLOBAL) source = name; - for (key in source) { - // contains in native - own = !IS_FORCED && target && target[key] !== undefined; - // export native or passed - out = (own ? target : source)[key]; - // bind timers to global for call from export context - exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; - // extend global - if (target) redefine(target, key, out, type & $export.U); - // export - if (exports[key] != out) hide(exports, key, exp); - if (IS_PROTO && expProto[key] != out) expProto[key] = out; - } -}; -global.core = core; -// 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; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(3); -module.exports = function (it) { - if (!isObject(it)) throw TypeError(it + ' is not an object!'); - return it; -}; - - -/***/ }), -/* 2 */ -/***/ (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 - - -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - -module.exports = function (it) { - return typeof it === 'object' ? it !== null : typeof it === 'function'; -}; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - -module.exports = function (exec) { - try { - return !!exec(); - } catch (e) { - return true; - } -}; - - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -var store = __webpack_require__(50)('wks'); -var uid = __webpack_require__(36); -var Symbol = __webpack_require__(2).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; - - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -var anObject = __webpack_require__(1); -var IE8_DOM_DEFINE = __webpack_require__(95); -var toPrimitive = __webpack_require__(22); -var dP = Object.defineProperty; - -exports.f = __webpack_require__(7) ? 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; -}; - - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -// Thank's IE8 for his funny defineProperty -module.exports = !__webpack_require__(4)(function () { - return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; -}); - - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.15 ToLength -var toInteger = __webpack_require__(24); -var min = Math.min; -module.exports = function (it) { - return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 -}; - - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.13 ToObject(argument) -var defined = __webpack_require__(23); -module.exports = function (it) { - return Object(defined(it)); -}; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports) { - -module.exports = function (it) { - if (typeof it != 'function') throw TypeError(it + ' is not a function!'); - return it; -}; - - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -// to indexed object, toObject with fallback for non-array-like ES3 strings -var IObject = __webpack_require__(47); -var defined = __webpack_require__(23); -module.exports = function (it) { - return IObject(defined(it)); -}; - - -/***/ }), -/* 12 */ -/***/ (function(module, exports) { - -var hasOwnProperty = {}.hasOwnProperty; -module.exports = function (it, key) { - return hasOwnProperty.call(it, key); -}; - - -/***/ }), -/* 13 */ -/***/ (function(module, exports) { - -var core = module.exports = { version: '2.5.7' }; -if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef - - -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - -var dP = __webpack_require__(6); -var createDesc = __webpack_require__(31); -module.exports = __webpack_require__(7) ? function (object, key, value) { - return dP.f(object, key, createDesc(1, value)); -} : function (object, key, value) { - object[key] = value; - return object; -}; - - -/***/ }), -/* 15 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(2); -var hide = __webpack_require__(14); -var has = __webpack_require__(12); -var SRC = __webpack_require__(36)('src'); -var TO_STRING = 'toString'; -var $toString = Function[TO_STRING]; -var TPL = ('' + $toString).split(TO_STRING); - -__webpack_require__(13).inspectSource = function (it) { - return $toString.call(it); -}; - -(module.exports = function (O, key, val, safe) { - var isFunction = typeof val == 'function'; - if (isFunction) has(val, 'name') || hide(val, 'name', key); - if (O[key] === val) return; - if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); - if (O === global) { - O[key] = val; - } else if (!safe) { - delete O[key]; - hide(O, key, val); - } else if (O[key]) { - O[key] = val; - } else { - hide(O, key, val); - } -// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative -})(Function.prototype, TO_STRING, function toString() { - return typeof this == 'function' && this[SRC] || $toString.call(this); -}); - - -/***/ }), -/* 16 */ -/***/ (function(module, exports, __webpack_require__) { - -var pIE = __webpack_require__(48); -var createDesc = __webpack_require__(31); -var toIObject = __webpack_require__(11); -var toPrimitive = __webpack_require__(22); -var has = __webpack_require__(12); -var IE8_DOM_DEFINE = __webpack_require__(95); -var gOPD = Object.getOwnPropertyDescriptor; - -exports.f = __webpack_require__(7) ? 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]); -}; - - -/***/ }), -/* 17 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) -var has = __webpack_require__(12); -var toObject = __webpack_require__(9); -var IE_PROTO = __webpack_require__(69)('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; -}; - - -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var fails = __webpack_require__(4); -var defined = __webpack_require__(23); -var quot = /"/g; -// B.2.3.2.1 CreateHTML(string, tag, attribute, value) -var createHTML = function (string, tag, attribute, value) { - var S = String(defined(string)); - var p1 = '<' + tag; - if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; - return p1 + '>' + S + ''; -}; -module.exports = function (NAME, exec) { - var O = {}; - O[NAME] = exec(createHTML); - $export($export.P + $export.F * fails(function () { - var test = ''[NAME]('"'); - return test !== test.toLowerCase() || test.split('"').length > 3; - }), 'String', O); -}; - - -/***/ }), -/* 19 */ -/***/ (function(module, exports, __webpack_require__) { - -// optional / simple context binding -var aFunction = __webpack_require__(10); -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); - }; -}; - - -/***/ }), -/* 20 */ -/***/ (function(module, exports) { - -var toString = {}.toString; - -module.exports = function (it) { - return toString.call(it).slice(8, -1); -}; - - -/***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var fails = __webpack_require__(4); - -module.exports = function (method, arg) { - return !!method && fails(function () { - // eslint-disable-next-line no-useless-call - arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null); - }); -}; - - -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.1 ToPrimitive(input [, PreferredType]) -var isObject = __webpack_require__(3); -// 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"); -}; - - -/***/ }), -/* 23 */ -/***/ (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; -}; - - -/***/ }), -/* 24 */ -/***/ (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); -}; - - -/***/ }), -/* 25 */ -/***/ (function(module, exports, __webpack_require__) { - -// most Object methods by ES6 should accept primitives -var $export = __webpack_require__(0); -var core = __webpack_require__(13); -var fails = __webpack_require__(4); -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); -}; - - -/***/ }), -/* 26 */ -/***/ (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__(19); -var IObject = __webpack_require__(47); -var toObject = __webpack_require__(9); -var toLength = __webpack_require__(8); -var asc = __webpack_require__(85); -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; - }; -}; - - -/***/ }), -/* 27 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.14 / 15.2.3.14 Object.keys(O) -var $keys = __webpack_require__(97); -var enumBugKeys = __webpack_require__(70); - -module.exports = Object.keys || function keys(O) { - return $keys(O, enumBugKeys); -}; - - -/***/ }), -/* 28 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -var anObject = __webpack_require__(1); -var dPs = __webpack_require__(98); -var enumBugKeys = __webpack_require__(70); -var IE_PROTO = __webpack_require__(69)('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__(67)('iframe'); - var i = enumBugKeys.length; - var lt = '<'; - var gt = '>'; - var iframeDocument; - iframe.style.display = 'none'; - __webpack_require__(71).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); -}; - - -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -if (__webpack_require__(7)) { - var LIBRARY = __webpack_require__(33); - var global = __webpack_require__(2); - var fails = __webpack_require__(4); - var $export = __webpack_require__(0); - var $typed = __webpack_require__(63); - var $buffer = __webpack_require__(93); - var ctx = __webpack_require__(19); - var anInstance = __webpack_require__(42); - var propertyDesc = __webpack_require__(31); - var hide = __webpack_require__(14); - var redefineAll = __webpack_require__(43); - var toInteger = __webpack_require__(24); - var toLength = __webpack_require__(8); - var toIndex = __webpack_require__(118); - var toAbsoluteIndex = __webpack_require__(37); - var toPrimitive = __webpack_require__(22); - var has = __webpack_require__(12); - var classof = __webpack_require__(39); - var isObject = __webpack_require__(3); - var toObject = __webpack_require__(9); - var isArrayIter = __webpack_require__(83); - var create = __webpack_require__(28); - var getPrototypeOf = __webpack_require__(17); - var gOPN = __webpack_require__(38).f; - var getIterFn = __webpack_require__(49); - var uid = __webpack_require__(36); - var wks = __webpack_require__(5); - var createArrayMethod = __webpack_require__(26); - var createArrayIncludes = __webpack_require__(51); - var speciesConstructor = __webpack_require__(60); - var ArrayIterators = __webpack_require__(87); - var Iterators = __webpack_require__(40); - var $iterDetect = __webpack_require__(57); - var setSpecies = __webpack_require__(41); - var arrayFill = __webpack_require__(86); - var arrayCopyWithin = __webpack_require__(109); - var $DP = __webpack_require__(6); - var $GOPD = __webpack_require__(16); - var dP = $DP.f; - var gOPD = $GOPD.f; - var RangeError = global.RangeError; - var TypeError = global.TypeError; - var Uint8Array = global.Uint8Array; - var ARRAY_BUFFER = 'ArrayBuffer'; - var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER; - var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; - var PROTOTYPE = 'prototype'; - var ArrayProto = Array[PROTOTYPE]; - var $ArrayBuffer = $buffer.ArrayBuffer; - var $DataView = $buffer.DataView; - var arrayForEach = createArrayMethod(0); - var arrayFilter = createArrayMethod(2); - var arraySome = createArrayMethod(3); - var arrayEvery = createArrayMethod(4); - var arrayFind = createArrayMethod(5); - var arrayFindIndex = createArrayMethod(6); - var arrayIncludes = createArrayIncludes(true); - var arrayIndexOf = createArrayIncludes(false); - var arrayValues = ArrayIterators.values; - var arrayKeys = ArrayIterators.keys; - var arrayEntries = ArrayIterators.entries; - var arrayLastIndexOf = ArrayProto.lastIndexOf; - var arrayReduce = ArrayProto.reduce; - var arrayReduceRight = ArrayProto.reduceRight; - var arrayJoin = ArrayProto.join; - var arraySort = ArrayProto.sort; - var arraySlice = ArrayProto.slice; - var arrayToString = ArrayProto.toString; - var arrayToLocaleString = ArrayProto.toLocaleString; - var ITERATOR = wks('iterator'); - var TAG = wks('toStringTag'); - var TYPED_CONSTRUCTOR = uid('typed_constructor'); - var DEF_CONSTRUCTOR = uid('def_constructor'); - var ALL_CONSTRUCTORS = $typed.CONSTR; - var TYPED_ARRAY = $typed.TYPED; - var VIEW = $typed.VIEW; - var WRONG_LENGTH = 'Wrong length!'; - - var $map = createArrayMethod(1, function (O, length) { - return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); - }); - - var LITTLE_ENDIAN = fails(function () { - // eslint-disable-next-line no-undef - return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; - }); - - var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () { - new Uint8Array(1).set({}); - }); - - var toOffset = function (it, BYTES) { - var offset = toInteger(it); - if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!'); - return offset; - }; - - var validate = function (it) { - if (isObject(it) && TYPED_ARRAY in it) return it; - throw TypeError(it + ' is not a typed array!'); - }; - - var allocate = function (C, length) { - if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) { - throw TypeError('It is not a typed array constructor!'); - } return new C(length); - }; - - var speciesFromList = function (O, list) { - return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); - }; - - var fromList = function (C, list) { - var index = 0; - var length = list.length; - var result = allocate(C, length); - while (length > index) result[index] = list[index++]; - return result; - }; - - var addGetter = function (it, key, internal) { - dP(it, key, { get: function () { return this._d[internal]; } }); - }; - - var $from = function from(source /* , mapfn, thisArg */) { - var O = toObject(source); - var aLen = arguments.length; - var mapfn = aLen > 1 ? arguments[1] : undefined; - var mapping = mapfn !== undefined; - var iterFn = getIterFn(O); - var i, length, values, result, step, iterator; - if (iterFn != undefined && !isArrayIter(iterFn)) { - for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) { - values.push(step.value); - } O = values; - } - if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2); - for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) { - result[i] = mapping ? mapfn(O[i], i) : O[i]; - } - return result; - }; - - var $of = function of(/* ...items */) { - var index = 0; - var length = arguments.length; - var result = allocate(this, length); - while (length > index) result[index] = arguments[index++]; - return result; - }; - - // iOS Safari 6.x fails here - var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); }); - - var $toLocaleString = function toLocaleString() { - return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); - }; - - var proto = { - copyWithin: function copyWithin(target, start /* , end */) { - return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); - }, - every: function every(callbackfn /* , thisArg */) { - return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }, - fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars - return arrayFill.apply(validate(this), arguments); - }, - filter: function filter(callbackfn /* , thisArg */) { - return speciesFromList(this, arrayFilter(validate(this), callbackfn, - arguments.length > 1 ? arguments[1] : undefined)); - }, - find: function find(predicate /* , thisArg */) { - return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); - }, - findIndex: function findIndex(predicate /* , thisArg */) { - return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); - }, - forEach: function forEach(callbackfn /* , thisArg */) { - arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }, - indexOf: function indexOf(searchElement /* , fromIndex */) { - return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); - }, - includes: function includes(searchElement /* , fromIndex */) { - return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); - }, - join: function join(separator) { // eslint-disable-line no-unused-vars - return arrayJoin.apply(validate(this), arguments); - }, - lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars - return arrayLastIndexOf.apply(validate(this), arguments); - }, - map: function map(mapfn /* , thisArg */) { - return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); - }, - reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars - return arrayReduce.apply(validate(this), arguments); - }, - reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars - return arrayReduceRight.apply(validate(this), arguments); - }, - reverse: function reverse() { - var that = this; - var length = validate(that).length; - var middle = Math.floor(length / 2); - var index = 0; - var value; - while (index < middle) { - value = that[index]; - that[index++] = that[--length]; - that[length] = value; - } return that; - }, - some: function some(callbackfn /* , thisArg */) { - return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }, - sort: function sort(comparefn) { - return arraySort.call(validate(this), comparefn); - }, - subarray: function subarray(begin, end) { - var O = validate(this); - var length = O.length; - var $begin = toAbsoluteIndex(begin, length); - return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( - O.buffer, - O.byteOffset + $begin * O.BYTES_PER_ELEMENT, - toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin) - ); - } - }; - - var $slice = function slice(start, end) { - return speciesFromList(this, arraySlice.call(validate(this), start, end)); - }; - - var $set = function set(arrayLike /* , offset */) { - validate(this); - var offset = toOffset(arguments[1], 1); - var length = this.length; - var src = toObject(arrayLike); - var len = toLength(src.length); - var index = 0; - if (len + offset > length) throw RangeError(WRONG_LENGTH); - while (index < len) this[offset + index] = src[index++]; - }; - - var $iterators = { - entries: function entries() { - return arrayEntries.call(validate(this)); - }, - keys: function keys() { - return arrayKeys.call(validate(this)); - }, - values: function values() { - return arrayValues.call(validate(this)); - } - }; - - var isTAIndex = function (target, key) { - return isObject(target) - && target[TYPED_ARRAY] - && typeof key != 'symbol' - && key in target - && String(+key) == String(key); - }; - var $getDesc = function getOwnPropertyDescriptor(target, key) { - return isTAIndex(target, key = toPrimitive(key, true)) - ? propertyDesc(2, target[key]) - : gOPD(target, key); - }; - var $setDesc = function defineProperty(target, key, desc) { - if (isTAIndex(target, key = toPrimitive(key, true)) - && isObject(desc) - && has(desc, 'value') - && !has(desc, 'get') - && !has(desc, 'set') - // TODO: add validation descriptor w/o calling accessors - && !desc.configurable - && (!has(desc, 'writable') || desc.writable) - && (!has(desc, 'enumerable') || desc.enumerable) - ) { - target[key] = desc.value; - return target; - } return dP(target, key, desc); - }; - - if (!ALL_CONSTRUCTORS) { - $GOPD.f = $getDesc; - $DP.f = $setDesc; - } - - $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { - getOwnPropertyDescriptor: $getDesc, - defineProperty: $setDesc - }); - - if (fails(function () { arrayToString.call({}); })) { - arrayToString = arrayToLocaleString = function toString() { - return arrayJoin.call(this); - }; - } - - var $TypedArrayPrototype$ = redefineAll({}, proto); - redefineAll($TypedArrayPrototype$, $iterators); - hide($TypedArrayPrototype$, ITERATOR, $iterators.values); - redefineAll($TypedArrayPrototype$, { - slice: $slice, - set: $set, - constructor: function () { /* noop */ }, - toString: arrayToString, - toLocaleString: $toLocaleString - }); - addGetter($TypedArrayPrototype$, 'buffer', 'b'); - addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); - addGetter($TypedArrayPrototype$, 'byteLength', 'l'); - addGetter($TypedArrayPrototype$, 'length', 'e'); - dP($TypedArrayPrototype$, TAG, { - get: function () { return this[TYPED_ARRAY]; } - }); - - // eslint-disable-next-line max-statements - module.exports = function (KEY, BYTES, wrapper, CLAMPED) { - CLAMPED = !!CLAMPED; - var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'; - var GETTER = 'get' + KEY; - var SETTER = 'set' + KEY; - var TypedArray = global[NAME]; - var Base = TypedArray || {}; - var TAC = TypedArray && getPrototypeOf(TypedArray); - var FORCED = !TypedArray || !$typed.ABV; - var O = {}; - var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; - var getter = function (that, index) { - var data = that._d; - return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); - }; - var setter = function (that, index, value) { - var data = that._d; - if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; - data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); - }; - var addElement = function (that, index) { - dP(that, index, { - get: function () { - return getter(this, index); - }, - set: function (value) { - return setter(this, index, value); - }, - enumerable: true - }); - }; - if (FORCED) { - TypedArray = wrapper(function (that, data, $offset, $length) { - anInstance(that, TypedArray, NAME, '_d'); - var index = 0; - var offset = 0; - var buffer, byteLength, length, klass; - if (!isObject(data)) { - length = toIndex(data); - byteLength = length * BYTES; - buffer = new $ArrayBuffer(byteLength); - } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { - buffer = data; - offset = toOffset($offset, BYTES); - var $len = data.byteLength; - if ($length === undefined) { - if ($len % BYTES) throw RangeError(WRONG_LENGTH); - byteLength = $len - offset; - if (byteLength < 0) throw RangeError(WRONG_LENGTH); - } else { - byteLength = toLength($length) * BYTES; - if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH); - } - length = byteLength / BYTES; - } else if (TYPED_ARRAY in data) { - return fromList(TypedArray, data); - } else { - return $from.call(TypedArray, data); - } - hide(that, '_d', { - b: buffer, - o: offset, - l: byteLength, - e: length, - v: new $DataView(buffer) - }); - while (index < length) addElement(that, index++); - }); - TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); - hide(TypedArrayPrototype, 'constructor', TypedArray); - } else if (!fails(function () { - TypedArray(1); - }) || !fails(function () { - new TypedArray(-1); // eslint-disable-line no-new - }) || !$iterDetect(function (iter) { - new TypedArray(); // eslint-disable-line no-new - new TypedArray(null); // eslint-disable-line no-new - new TypedArray(1.5); // eslint-disable-line no-new - new TypedArray(iter); // eslint-disable-line no-new - }, true)) { - TypedArray = wrapper(function (that, data, $offset, $length) { - anInstance(that, TypedArray, NAME); - var klass; - // `ws` module bug, temporarily remove validation length for Uint8Array - // https://github.com/websockets/ws/pull/645 - if (!isObject(data)) return new Base(toIndex(data)); - if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { - return $length !== undefined - ? new Base(data, toOffset($offset, BYTES), $length) - : $offset !== undefined - ? new Base(data, toOffset($offset, BYTES)) - : new Base(data); - } - if (TYPED_ARRAY in data) return fromList(TypedArray, data); - return $from.call(TypedArray, data); - }); - arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) { - if (!(key in TypedArray)) hide(TypedArray, key, Base[key]); - }); - TypedArray[PROTOTYPE] = TypedArrayPrototype; - if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray; - } - var $nativeIterator = TypedArrayPrototype[ITERATOR]; - var CORRECT_ITER_NAME = !!$nativeIterator - && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined); - var $iterator = $iterators.values; - hide(TypedArray, TYPED_CONSTRUCTOR, true); - hide(TypedArrayPrototype, TYPED_ARRAY, NAME); - hide(TypedArrayPrototype, VIEW, true); - hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); - - if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) { - dP(TypedArrayPrototype, TAG, { - get: function () { return NAME; } - }); - } - - O[NAME] = TypedArray; - - $export($export.G + $export.W + $export.F * (TypedArray != Base), O); - - $export($export.S, NAME, { - BYTES_PER_ELEMENT: BYTES - }); - - $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, { - from: $from, - of: $of - }); - - if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); - - $export($export.P, NAME, proto); - - setSpecies(NAME); - - $export($export.P + $export.F * FORCED_SET, NAME, { set: $set }); - - $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); - - if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString; - - $export($export.P + $export.F * fails(function () { - new TypedArray(1).slice(); - }), NAME, { slice: $slice }); - - $export($export.P + $export.F * (fails(function () { - return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString(); - }) || !fails(function () { - TypedArrayPrototype.toLocaleString.call([1, 2]); - })), NAME, { toLocaleString: $toLocaleString }); - - Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; - if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator); - }; -} else module.exports = function () { /* empty */ }; - - -/***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { - -var Map = __webpack_require__(113); -var $export = __webpack_require__(0); -var shared = __webpack_require__(50)('metadata'); -var store = shared.store || (shared.store = new (__webpack_require__(116))()); - -var getOrCreateMetadataMap = function (target, targetKey, create) { - var targetMetadata = store.get(target); - if (!targetMetadata) { - if (!create) return undefined; - store.set(target, targetMetadata = new Map()); - } - var keyMetadata = targetMetadata.get(targetKey); - if (!keyMetadata) { - if (!create) return undefined; - targetMetadata.set(targetKey, keyMetadata = new Map()); - } return keyMetadata; -}; -var ordinaryHasOwnMetadata = function (MetadataKey, O, P) { - var metadataMap = getOrCreateMetadataMap(O, P, false); - return metadataMap === undefined ? false : metadataMap.has(MetadataKey); -}; -var ordinaryGetOwnMetadata = function (MetadataKey, O, P) { - var metadataMap = getOrCreateMetadataMap(O, P, false); - return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); -}; -var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) { - getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); -}; -var ordinaryOwnMetadataKeys = function (target, targetKey) { - var metadataMap = getOrCreateMetadataMap(target, targetKey, false); - var keys = []; - if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); }); - return keys; -}; -var toMetaKey = function (it) { - return it === undefined || typeof it == 'symbol' ? it : String(it); -}; -var exp = function (O) { - $export($export.S, 'Reflect', O); -}; - -module.exports = { - store: store, - map: getOrCreateMetadataMap, - has: ordinaryHasOwnMetadata, - get: ordinaryGetOwnMetadata, - set: ordinaryDefineOwnMetadata, - keys: ordinaryOwnMetadataKeys, - key: toMetaKey, - exp: exp -}; - - -/***/ }), -/* 31 */ -/***/ (function(module, exports) { - -module.exports = function (bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value: value - }; -}; - - -/***/ }), -/* 32 */ -/***/ (function(module, exports, __webpack_require__) { - -var META = __webpack_require__(36)('meta'); -var isObject = __webpack_require__(3); -var has = __webpack_require__(12); -var setDesc = __webpack_require__(6).f; -var id = 0; -var isExtensible = Object.isExtensible || function () { - return true; -}; -var FREEZE = !__webpack_require__(4)(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 -}; - - -/***/ }), -/* 33 */ -/***/ (function(module, exports) { - -module.exports = false; - - -/***/ }), -/* 34 */ -/***/ (function(module, exports, __webpack_require__) { - -// 22.1.3.31 Array.prototype[@@unscopables] -var UNSCOPABLES = __webpack_require__(5)('unscopables'); -var ArrayProto = Array.prototype; -if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(14)(ArrayProto, UNSCOPABLES, {}); -module.exports = function (key) { - ArrayProto[UNSCOPABLES][key] = true; -}; - - -/***/ }), -/* 35 */ -/***/ (function(module, exports, __webpack_require__) { - -var ctx = __webpack_require__(19); -var call = __webpack_require__(107); -var isArrayIter = __webpack_require__(83); -var anObject = __webpack_require__(1); -var toLength = __webpack_require__(8); -var getIterFn = __webpack_require__(49); -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; - - -/***/ }), -/* 36 */ -/***/ (function(module, exports) { - -var id = 0; -var px = Math.random(); -module.exports = function (key) { - return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); -}; - - -/***/ }), -/* 37 */ -/***/ (function(module, exports, __webpack_require__) { - -var toInteger = __webpack_require__(24); -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); -}; - - -/***/ }), -/* 38 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) -var $keys = __webpack_require__(97); -var hiddenKeys = __webpack_require__(70).concat('length', 'prototype'); - -exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { - return $keys(O, hiddenKeys); -}; - - -/***/ }), -/* 39 */ -/***/ (function(module, exports, __webpack_require__) { - -// getting tag from 19.1.3.6 Object.prototype.toString() -var cof = __webpack_require__(20); -var TAG = __webpack_require__(5)('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; -}; - - -/***/ }), -/* 40 */ -/***/ (function(module, exports) { - -module.exports = {}; - - -/***/ }), -/* 41 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var global = __webpack_require__(2); -var dP = __webpack_require__(6); -var DESCRIPTORS = __webpack_require__(7); -var SPECIES = __webpack_require__(5)('species'); - -module.exports = function (KEY) { - var C = global[KEY]; - if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { - configurable: true, - get: function () { return this; } - }); -}; - - -/***/ }), -/* 42 */ -/***/ (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; -}; - - -/***/ }), -/* 43 */ -/***/ (function(module, exports, __webpack_require__) { - -var redefine = __webpack_require__(15); -module.exports = function (target, src, safe) { - for (var key in src) redefine(target, key, src[key], safe); - return target; -}; - - -/***/ }), -/* 44 */ -/***/ (function(module, exports, __webpack_require__) { - -var def = __webpack_require__(6).f; -var has = __webpack_require__(12); -var TAG = __webpack_require__(5)('toStringTag'); - -module.exports = function (it, tag, stat) { - if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); -}; - - -/***/ }), -/* 45 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var defined = __webpack_require__(23); -var fails = __webpack_require__(4); -var spaces = __webpack_require__(76); -var space = '[' + spaces + ']'; -var non = '\u200b\u0085'; -var ltrim = RegExp('^' + space + space + '*'); -var rtrim = RegExp(space + space + '*$'); - -var exporter = function (KEY, exec, ALIAS) { - var exp = {}; - var FORCE = fails(function () { - return !!spaces[KEY]() || non[KEY]() != non; - }); - var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; - if (ALIAS) exp[ALIAS] = fn; - $export($export.P + $export.F * FORCE, 'String', exp); -}; - -// 1 -> String#trimLeft -// 2 -> String#trimRight -// 3 -> String#trim -var trim = exporter.trim = function (string, TYPE) { - string = String(defined(string)); - if (TYPE & 1) string = string.replace(ltrim, ''); - if (TYPE & 2) string = string.replace(rtrim, ''); - return string; -}; - -module.exports = exporter; - - -/***/ }), -/* 46 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(3); -module.exports = function (it, TYPE) { - if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); - return it; -}; - - -/***/ }), -/* 47 */ -/***/ (function(module, exports, __webpack_require__) { - -// fallback for non-array-like ES3 and non-enumerable old V8 strings -var cof = __webpack_require__(20); -// eslint-disable-next-line no-prototype-builtins -module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { - return cof(it) == 'String' ? it.split('') : Object(it); -}; - - -/***/ }), -/* 48 */ -/***/ (function(module, exports) { - -exports.f = {}.propertyIsEnumerable; - - -/***/ }), -/* 49 */ -/***/ (function(module, exports, __webpack_require__) { - -var classof = __webpack_require__(39); -var ITERATOR = __webpack_require__(5)('iterator'); -var Iterators = __webpack_require__(40); -module.exports = __webpack_require__(13).getIteratorMethod = function (it) { - if (it != undefined) return it[ITERATOR] - || it['@@iterator'] - || Iterators[classof(it)]; -}; - - -/***/ }), -/* 50 */ -/***/ (function(module, exports, __webpack_require__) { - -var core = __webpack_require__(13); -var global = __webpack_require__(2); -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__(33) ? 'pure' : 'global', - copyright: '© 2018 Denis Pushkarev (zloirock.ru)' -}); - - -/***/ }), -/* 51 */ -/***/ (function(module, exports, __webpack_require__) { - -// false -> Array#indexOf -// true -> Array#includes -var toIObject = __webpack_require__(11); -var toLength = __webpack_require__(8); -var toAbsoluteIndex = __webpack_require__(37); -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; - }; -}; - - -/***/ }), -/* 52 */ -/***/ (function(module, exports) { - -exports.f = Object.getOwnPropertySymbols; - - -/***/ }), -/* 53 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.2.2 IsArray(argument) -var cof = __webpack_require__(20); -module.exports = Array.isArray || function isArray(arg) { - return cof(arg) == 'Array'; -}; - - -/***/ }), -/* 54 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.2.8 IsRegExp(argument) -var isObject = __webpack_require__(3); -var cof = __webpack_require__(20); -var MATCH = __webpack_require__(5)('match'); -module.exports = function (it) { - var isRegExp; - return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); -}; - - -/***/ }), -/* 55 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var LIBRARY = __webpack_require__(33); -var $export = __webpack_require__(0); -var redefine = __webpack_require__(15); -var hide = __webpack_require__(14); -var Iterators = __webpack_require__(40); -var $iterCreate = __webpack_require__(56); -var setToStringTag = __webpack_require__(44); -var getPrototypeOf = __webpack_require__(17); -var ITERATOR = __webpack_require__(5)('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; -}; - - -/***/ }), -/* 56 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var create = __webpack_require__(28); -var descriptor = __webpack_require__(31); -var setToStringTag = __webpack_require__(44); -var IteratorPrototype = {}; - -// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() -__webpack_require__(14)(IteratorPrototype, __webpack_require__(5)('iterator'), function () { return this; }); - -module.exports = function (Constructor, NAME, next) { - Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); - setToStringTag(Constructor, NAME + ' Iterator'); -}; - - -/***/ }), -/* 57 */ -/***/ (function(module, exports, __webpack_require__) { - -var ITERATOR = __webpack_require__(5)('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; -}; - - -/***/ }), -/* 58 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 21.2.5.3 get RegExp.prototype.flags -var anObject = __webpack_require__(1); -module.exports = function () { - var that = anObject(this); - var result = ''; - if (that.global) result += 'g'; - if (that.ignoreCase) result += 'i'; - if (that.multiline) result += 'm'; - if (that.unicode) result += 'u'; - if (that.sticky) result += 'y'; - return result; -}; - - -/***/ }), -/* 59 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var hide = __webpack_require__(14); -var redefine = __webpack_require__(15); -var fails = __webpack_require__(4); -var defined = __webpack_require__(23); -var wks = __webpack_require__(5); - -module.exports = function (KEY, length, exec) { - var SYMBOL = wks(KEY); - var fns = exec(defined, SYMBOL, ''[KEY]); - var strfn = fns[0]; - var rxfn = fns[1]; - if (fails(function () { - var O = {}; - O[SYMBOL] = function () { return 7; }; - return ''[KEY](O) != 7; - })) { - redefine(String.prototype, KEY, strfn); - hide(RegExp.prototype, SYMBOL, length == 2 - // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) - // 21.2.5.11 RegExp.prototype[@@split](string, limit) - ? function (string, arg) { return rxfn.call(string, this, arg); } - // 21.2.5.6 RegExp.prototype[@@match](string) - // 21.2.5.9 RegExp.prototype[@@search](string) - : function (string) { return rxfn.call(string, this); } - ); - } -}; - - -/***/ }), -/* 60 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.3.20 SpeciesConstructor(O, defaultConstructor) -var anObject = __webpack_require__(1); -var aFunction = __webpack_require__(10); -var SPECIES = __webpack_require__(5)('species'); -module.exports = function (O, D) { - var C = anObject(O).constructor; - var S; - return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); -}; - - -/***/ }), -/* 61 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(2); -var navigator = global.navigator; - -module.exports = navigator && navigator.userAgent || ''; - - -/***/ }), -/* 62 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var global = __webpack_require__(2); -var $export = __webpack_require__(0); -var redefine = __webpack_require__(15); -var redefineAll = __webpack_require__(43); -var meta = __webpack_require__(32); -var forOf = __webpack_require__(35); -var anInstance = __webpack_require__(42); -var isObject = __webpack_require__(3); -var fails = __webpack_require__(4); -var $iterDetect = __webpack_require__(57); -var setToStringTag = __webpack_require__(44); -var inheritIfRequired = __webpack_require__(75); - -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 = {}; - var fixMethod = function (KEY) { - var fn = proto[KEY]; - redefine(proto, KEY, - KEY == 'delete' ? function (a) { - return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); - } : KEY == 'has' ? function has(a) { - return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); - } : KEY == 'get' ? function get(a) { - return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); - } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; } - : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; } - ); - }; - if (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 { - var instance = new C(); - // early implementations not supports chaining - var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; - // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false - var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); - // most early implementations doesn't supports iterables, most modern - not close it correctly - var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new - // for early implementations -0 and +0 not the same - var BUGGY_ZERO = !IS_WEAK && fails(function () { - // V8 ~ Chromium 42- fails only with 5+ elements - var $instance = new C(); - var index = 5; - while (index--) $instance[ADDER](index, index); - return !$instance.has(-0); - }); - if (!ACCEPT_ITERABLES) { - C = wrapper(function (target, iterable) { - anInstance(target, C, NAME); - var that = inheritIfRequired(new Base(), target, C); - if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); - return that; - }); - C.prototype = proto; - proto.constructor = C; - } - if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { - fixMethod('delete'); - fixMethod('has'); - IS_MAP && fixMethod('get'); - } - if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); - // weak collections should not contains .clear method - if (IS_WEAK && proto.clear) delete proto.clear; - } - - setToStringTag(C, NAME); - - O[NAME] = C; - $export($export.G + $export.W + $export.F * (C != Base), O); - - if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); - - return C; -}; - - -/***/ }), -/* 63 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(2); -var hide = __webpack_require__(14); -var uid = __webpack_require__(36); -var TYPED = uid('typed_array'); -var VIEW = uid('view'); -var ABV = !!(global.ArrayBuffer && global.DataView); -var CONSTR = ABV; -var i = 0; -var l = 9; -var Typed; - -var TypedArrayConstructors = ( - 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' -).split(','); - -while (i < l) { - if (Typed = global[TypedArrayConstructors[i++]]) { - hide(Typed.prototype, TYPED, true); - hide(Typed.prototype, VIEW, true); - } else CONSTR = false; -} - -module.exports = { - ABV: ABV, - CONSTR: CONSTR, - TYPED: TYPED, - VIEW: VIEW -}; - - -/***/ }), -/* 64 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// Forced replacement prototype accessors methods -module.exports = __webpack_require__(33) || !__webpack_require__(4)(function () { - var K = Math.random(); - // In FF throws only define methods - // eslint-disable-next-line no-undef, no-useless-call - __defineSetter__.call(null, K, function () { /* empty */ }); - delete __webpack_require__(2)[K]; -}); - - -/***/ }), -/* 65 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://tc39.github.io/proposal-setmap-offrom/ -var $export = __webpack_require__(0); - -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); - } }); -}; - - -/***/ }), -/* 66 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://tc39.github.io/proposal-setmap-offrom/ -var $export = __webpack_require__(0); -var aFunction = __webpack_require__(10); -var ctx = __webpack_require__(19); -var forOf = __webpack_require__(35); - -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); - } }); -}; - - -/***/ }), -/* 67 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(3); -var document = __webpack_require__(2).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) : {}; -}; - - -/***/ }), -/* 68 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(2); -var core = __webpack_require__(13); -var LIBRARY = __webpack_require__(33); -var wksExt = __webpack_require__(96); -var defineProperty = __webpack_require__(6).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) }); -}; - - -/***/ }), -/* 69 */ -/***/ (function(module, exports, __webpack_require__) { - -var shared = __webpack_require__(50)('keys'); -var uid = __webpack_require__(36); -module.exports = function (key) { - return shared[key] || (shared[key] = uid(key)); -}; - - -/***/ }), -/* 70 */ -/***/ (function(module, exports) { - -// IE 8- don't enum bug keys -module.exports = ( - 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' -).split(','); - - -/***/ }), -/* 71 */ -/***/ (function(module, exports, __webpack_require__) { - -var document = __webpack_require__(2).document; -module.exports = document && document.documentElement; - - -/***/ }), -/* 72 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 19.1.2.1 Object.assign(target, source, ...) -var getKeys = __webpack_require__(27); -var gOPS = __webpack_require__(52); -var pIE = __webpack_require__(48); -var toObject = __webpack_require__(9); -var IObject = __webpack_require__(47); -var $assign = Object.assign; - -// should work with symbols and should have deterministic property order (V8 bug) -module.exports = !$assign || __webpack_require__(4)(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) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; - } return T; -} : $assign; - - -/***/ }), -/* 73 */ -/***/ (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__(3); -var anObject = __webpack_require__(1); -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__(19)(Function.call, __webpack_require__(16).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 -}; - - -/***/ }), -/* 74 */ -/***/ (function(module, exports) { - -// fast apply, http://jsperf.lnkit.com/fast-apply/5 -module.exports = function (fn, args, that) { - var un = that === undefined; - switch (args.length) { - case 0: return un ? fn() - : fn.call(that); - case 1: return un ? fn(args[0]) - : fn.call(that, args[0]); - case 2: return un ? fn(args[0], args[1]) - : fn.call(that, args[0], args[1]); - case 3: return un ? fn(args[0], args[1], args[2]) - : fn.call(that, args[0], args[1], args[2]); - case 4: return un ? fn(args[0], args[1], args[2], args[3]) - : fn.call(that, args[0], args[1], args[2], args[3]); - } return fn.apply(that, args); -}; - - -/***/ }), -/* 75 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(3); -var setPrototypeOf = __webpack_require__(73).set; -module.exports = function (that, target, C) { - var S = target.constructor; - var P; - if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { - setPrototypeOf(that, P); - } return that; -}; - - -/***/ }), -/* 76 */ -/***/ (function(module, exports) { - -module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + - '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; - - -/***/ }), -/* 77 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var toInteger = __webpack_require__(24); -var defined = __webpack_require__(23); - -module.exports = function repeat(count) { - var str = String(defined(this)); - var res = ''; - var n = toInteger(count); - if (n < 0 || n == Infinity) throw RangeError("Count can't be negative"); - for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str; - return res; -}; - - -/***/ }), -/* 78 */ -/***/ (function(module, exports) { - -// 20.2.2.28 Math.sign(x) -module.exports = Math.sign || function sign(x) { - // eslint-disable-next-line no-self-compare - return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; -}; - - -/***/ }), -/* 79 */ -/***/ (function(module, exports) { - -// 20.2.2.14 Math.expm1(x) -var $expm1 = Math.expm1; -module.exports = (!$expm1 - // Old FF bug - || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 - // Tor Browser bug - || $expm1(-2e-17) != -2e-17 -) ? function expm1(x) { - return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; -} : $expm1; - - -/***/ }), -/* 80 */ -/***/ (function(module, exports, __webpack_require__) { - -var toInteger = __webpack_require__(24); -var defined = __webpack_require__(23); -// 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; - }; -}; - - -/***/ }), -/* 81 */ -/***/ (function(module, exports, __webpack_require__) { - -// helper for String#{startsWith, endsWith, includes} -var isRegExp = __webpack_require__(54); -var defined = __webpack_require__(23); - -module.exports = function (that, searchString, NAME) { - if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); - return String(defined(that)); -}; - - -/***/ }), -/* 82 */ -/***/ (function(module, exports, __webpack_require__) { - -var MATCH = __webpack_require__(5)('match'); -module.exports = function (KEY) { - var re = /./; - try { - '/./'[KEY](re); - } catch (e) { - try { - re[MATCH] = false; - return !'/./'[KEY](re); - } catch (f) { /* empty */ } - } return true; -}; - - -/***/ }), -/* 83 */ -/***/ (function(module, exports, __webpack_require__) { - -// check on default Array iterator -var Iterators = __webpack_require__(40); -var ITERATOR = __webpack_require__(5)('iterator'); -var ArrayProto = Array.prototype; - -module.exports = function (it) { - return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); -}; - - -/***/ }), -/* 84 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $defineProperty = __webpack_require__(6); -var createDesc = __webpack_require__(31); - -module.exports = function (object, index, value) { - if (index in object) $defineProperty.f(object, index, createDesc(0, value)); - else object[index] = value; -}; - - -/***/ }), -/* 85 */ -/***/ (function(module, exports, __webpack_require__) { - -// 9.4.2.3 ArraySpeciesCreate(originalArray, length) -var speciesConstructor = __webpack_require__(213); - -module.exports = function (original, length) { - return new (speciesConstructor(original))(length); -}; - - -/***/ }), -/* 86 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) - -var toObject = __webpack_require__(9); -var toAbsoluteIndex = __webpack_require__(37); -var toLength = __webpack_require__(8); -module.exports = function fill(value /* , start = 0, end = @length */) { - var O = toObject(this); - var length = toLength(O.length); - var aLen = arguments.length; - var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); - var end = aLen > 2 ? arguments[2] : undefined; - var endPos = end === undefined ? length : toAbsoluteIndex(end, length); - while (endPos > index) O[index++] = value; - return O; -}; - - -/***/ }), -/* 87 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var addToUnscopables = __webpack_require__(34); -var step = __webpack_require__(88); -var Iterators = __webpack_require__(40); -var toIObject = __webpack_require__(11); - -// 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__(55)(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'); - - -/***/ }), -/* 88 */ -/***/ (function(module, exports) { - -module.exports = function (done, value) { - return { value: value, done: !!done }; -}; - - -/***/ }), -/* 89 */ -/***/ (function(module, exports, __webpack_require__) { - -var ctx = __webpack_require__(19); -var invoke = __webpack_require__(74); -var html = __webpack_require__(71); -var cel = __webpack_require__(67); -var global = __webpack_require__(2); -var process = global.process; -var setTask = global.setImmediate; -var clearTask = global.clearImmediate; -var MessageChannel = global.MessageChannel; -var Dispatch = global.Dispatch; -var counter = 0; -var queue = {}; -var ONREADYSTATECHANGE = 'onreadystatechange'; -var defer, channel, port; -var run = function () { - var id = +this; - // eslint-disable-next-line no-prototype-builtins - if (queue.hasOwnProperty(id)) { - var fn = queue[id]; - delete queue[id]; - fn(); - } -}; -var listener = function (event) { - run.call(event.data); -}; -// Node.js 0.9+ & IE10+ has setImmediate, otherwise: -if (!setTask || !clearTask) { - setTask = function setImmediate(fn) { - var args = []; - var i = 1; - while (arguments.length > i) args.push(arguments[i++]); - queue[++counter] = function () { - // eslint-disable-next-line no-new-func - invoke(typeof fn == 'function' ? fn : Function(fn), args); - }; - defer(counter); - return counter; - }; - clearTask = function clearImmediate(id) { - delete queue[id]; - }; - // Node.js 0.8- - if (__webpack_require__(20)(process) == 'process') { - defer = function (id) { - process.nextTick(ctx(run, id, 1)); - }; - // Sphere (JS game engine) Dispatch API - } else if (Dispatch && Dispatch.now) { - defer = function (id) { - Dispatch.now(ctx(run, id, 1)); - }; - // Browsers with MessageChannel, includes WebWorkers - } else if (MessageChannel) { - channel = new MessageChannel(); - port = channel.port2; - channel.port1.onmessage = listener; - defer = ctx(port.postMessage, port, 1); - // Browsers with postMessage, skip WebWorkers - // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' - } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { - defer = function (id) { - global.postMessage(id + '', '*'); - }; - global.addEventListener('message', listener, false); - // IE8- - } else if (ONREADYSTATECHANGE in cel('script')) { - defer = function (id) { - html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { - html.removeChild(this); - run.call(id); - }; - }; - // Rest old browsers - } else { - defer = function (id) { - setTimeout(ctx(run, id, 1), 0); - }; - } -} -module.exports = { - set: setTask, - clear: clearTask -}; - - -/***/ }), -/* 90 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(2); -var macrotask = __webpack_require__(89).set; -var Observer = global.MutationObserver || global.WebKitMutationObserver; -var process = global.process; -var Promise = global.Promise; -var isNode = __webpack_require__(20)(process) == 'process'; - -module.exports = function () { - var head, last, notify; - - var flush = function () { - var parent, fn; - if (isNode && (parent = process.domain)) parent.exit(); - while (head) { - fn = head.fn; - head = head.next; - try { - fn(); - } catch (e) { - if (head) notify(); - else last = undefined; - throw e; - } - } last = undefined; - if (parent) parent.enter(); - }; - - // Node.js - if (isNode) { - notify = function () { - process.nextTick(flush); - }; - // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 - } else if (Observer && !(global.navigator && global.navigator.standalone)) { - var toggle = true; - var node = document.createTextNode(''); - new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new - notify = function () { - node.data = toggle = !toggle; - }; - // environments with maybe non-completely correct, but existent Promise - } else if (Promise && Promise.resolve) { - // Promise.resolve without an argument throws an error in LG WebOS 2 - var promise = Promise.resolve(undefined); - notify = function () { - promise.then(flush); - }; - // for other environments - macrotask based on: - // - setImmediate - // - MessageChannel - // - window.postMessag - // - onreadystatechange - // - setTimeout - } else { - notify = function () { - // strange IE + webpack dev server bug - use .call(global) - macrotask.call(global, flush); - }; - } - - return function (fn) { - var task = { fn: fn, next: undefined }; - if (last) last.next = task; - if (!head) { - head = task; - notify(); - } last = task; - }; -}; - - -/***/ }), -/* 91 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 25.4.1.5 NewPromiseCapability(C) -var aFunction = __webpack_require__(10); - -function PromiseCapability(C) { - var resolve, reject; - this.promise = new C(function ($$resolve, $$reject) { - if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); - resolve = $$resolve; - reject = $$reject; - }); - this.resolve = aFunction(resolve); - this.reject = aFunction(reject); -} - -module.exports.f = function (C) { - return new PromiseCapability(C); -}; - - -/***/ }), -/* 92 */ -/***/ (function(module, exports, __webpack_require__) { - -// all object keys, includes non-enumerable and symbols -var gOPN = __webpack_require__(38); -var gOPS = __webpack_require__(52); -var anObject = __webpack_require__(1); -var Reflect = __webpack_require__(2).Reflect; -module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { - var keys = gOPN.f(anObject(it)); - var getSymbols = gOPS.f; - return getSymbols ? keys.concat(getSymbols(it)) : keys; -}; - - -/***/ }), -/* 93 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var global = __webpack_require__(2); -var DESCRIPTORS = __webpack_require__(7); -var LIBRARY = __webpack_require__(33); -var $typed = __webpack_require__(63); -var hide = __webpack_require__(14); -var redefineAll = __webpack_require__(43); -var fails = __webpack_require__(4); -var anInstance = __webpack_require__(42); -var toInteger = __webpack_require__(24); -var toLength = __webpack_require__(8); -var toIndex = __webpack_require__(118); -var gOPN = __webpack_require__(38).f; -var dP = __webpack_require__(6).f; -var arrayFill = __webpack_require__(86); -var setToStringTag = __webpack_require__(44); -var ARRAY_BUFFER = 'ArrayBuffer'; -var DATA_VIEW = 'DataView'; -var PROTOTYPE = 'prototype'; -var WRONG_LENGTH = 'Wrong length!'; -var WRONG_INDEX = 'Wrong index!'; -var $ArrayBuffer = global[ARRAY_BUFFER]; -var $DataView = global[DATA_VIEW]; -var Math = global.Math; -var RangeError = global.RangeError; -// eslint-disable-next-line no-shadow-restricted-names -var Infinity = global.Infinity; -var BaseBuffer = $ArrayBuffer; -var abs = Math.abs; -var pow = Math.pow; -var floor = Math.floor; -var log = Math.log; -var LN2 = Math.LN2; -var BUFFER = 'buffer'; -var BYTE_LENGTH = 'byteLength'; -var BYTE_OFFSET = 'byteOffset'; -var $BUFFER = DESCRIPTORS ? '_b' : BUFFER; -var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH; -var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; - -// IEEE754 conversions based on https://github.com/feross/ieee754 -function packIEEE754(value, mLen, nBytes) { - var buffer = new Array(nBytes); - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0; - var i = 0; - var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; - var e, m, c; - value = abs(value); - // eslint-disable-next-line no-self-compare - if (value != value || value === Infinity) { - // eslint-disable-next-line no-self-compare - m = value != value ? 1 : 0; - e = eMax; - } else { - e = floor(log(value) / LN2); - if (value * (c = pow(2, -e)) < 1) { - e--; - c *= 2; - } - if (e + eBias >= 1) { - value += rt / c; - } else { - value += rt * pow(2, 1 - eBias); - } - if (value * c >= 2) { - e++; - c /= 2; - } - if (e + eBias >= eMax) { - m = 0; - e = eMax; - } else if (e + eBias >= 1) { - m = (value * c - 1) * pow(2, mLen); - e = e + eBias; - } else { - m = value * pow(2, eBias - 1) * pow(2, mLen); - e = 0; - } - } - for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); - e = e << mLen | m; - eLen += mLen; - for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); - buffer[--i] |= s * 128; - return buffer; -} -function unpackIEEE754(buffer, mLen, nBytes) { - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var nBits = eLen - 7; - var i = nBytes - 1; - var s = buffer[i--]; - var e = s & 127; - var m; - s >>= 7; - for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); - m = e & (1 << -nBits) - 1; - e >>= -nBits; - nBits += mLen; - for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); - if (e === 0) { - e = 1 - eBias; - } else if (e === eMax) { - return m ? NaN : s ? -Infinity : Infinity; - } else { - m = m + pow(2, mLen); - e = e - eBias; - } return (s ? -1 : 1) * m * pow(2, e - mLen); -} - -function unpackI32(bytes) { - return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; -} -function packI8(it) { - return [it & 0xff]; -} -function packI16(it) { - return [it & 0xff, it >> 8 & 0xff]; -} -function packI32(it) { - return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; -} -function packF64(it) { - return packIEEE754(it, 52, 8); -} -function packF32(it) { - return packIEEE754(it, 23, 4); -} - -function addGetter(C, key, internal) { - dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } }); -} - -function get(view, bytes, index, isLittleEndian) { - var numIndex = +index; - var intIndex = toIndex(numIndex); - if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); - var store = view[$BUFFER]._b; - var start = intIndex + view[$OFFSET]; - var pack = store.slice(start, start + bytes); - return isLittleEndian ? pack : pack.reverse(); -} -function set(view, bytes, index, conversion, value, isLittleEndian) { - var numIndex = +index; - var intIndex = toIndex(numIndex); - if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); - var store = view[$BUFFER]._b; - var start = intIndex + view[$OFFSET]; - var pack = conversion(+value); - for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; -} - -if (!$typed.ABV) { - $ArrayBuffer = function ArrayBuffer(length) { - anInstance(this, $ArrayBuffer, ARRAY_BUFFER); - var byteLength = toIndex(length); - this._b = arrayFill.call(new Array(byteLength), 0); - this[$LENGTH] = byteLength; - }; - - $DataView = function DataView(buffer, byteOffset, byteLength) { - anInstance(this, $DataView, DATA_VIEW); - anInstance(buffer, $ArrayBuffer, DATA_VIEW); - var bufferLength = buffer[$LENGTH]; - var offset = toInteger(byteOffset); - if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!'); - byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); - if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); - this[$BUFFER] = buffer; - this[$OFFSET] = offset; - this[$LENGTH] = byteLength; - }; - - if (DESCRIPTORS) { - addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); - addGetter($DataView, BUFFER, '_b'); - addGetter($DataView, BYTE_LENGTH, '_l'); - addGetter($DataView, BYTE_OFFSET, '_o'); - } - - redefineAll($DataView[PROTOTYPE], { - getInt8: function getInt8(byteOffset) { - return get(this, 1, byteOffset)[0] << 24 >> 24; - }, - getUint8: function getUint8(byteOffset) { - return get(this, 1, byteOffset)[0]; - }, - getInt16: function getInt16(byteOffset /* , littleEndian */) { - var bytes = get(this, 2, byteOffset, arguments[1]); - return (bytes[1] << 8 | bytes[0]) << 16 >> 16; - }, - getUint16: function getUint16(byteOffset /* , littleEndian */) { - var bytes = get(this, 2, byteOffset, arguments[1]); - return bytes[1] << 8 | bytes[0]; - }, - getInt32: function getInt32(byteOffset /* , littleEndian */) { - return unpackI32(get(this, 4, byteOffset, arguments[1])); - }, - getUint32: function getUint32(byteOffset /* , littleEndian */) { - return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; - }, - getFloat32: function getFloat32(byteOffset /* , littleEndian */) { - return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); - }, - getFloat64: function getFloat64(byteOffset /* , littleEndian */) { - return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); - }, - setInt8: function setInt8(byteOffset, value) { - set(this, 1, byteOffset, packI8, value); - }, - setUint8: function setUint8(byteOffset, value) { - set(this, 1, byteOffset, packI8, value); - }, - setInt16: function setInt16(byteOffset, value /* , littleEndian */) { - set(this, 2, byteOffset, packI16, value, arguments[2]); - }, - setUint16: function setUint16(byteOffset, value /* , littleEndian */) { - set(this, 2, byteOffset, packI16, value, arguments[2]); - }, - setInt32: function setInt32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packI32, value, arguments[2]); - }, - setUint32: function setUint32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packI32, value, arguments[2]); - }, - setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packF32, value, arguments[2]); - }, - setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { - set(this, 8, byteOffset, packF64, value, arguments[2]); - } - }); -} else { - if (!fails(function () { - $ArrayBuffer(1); - }) || !fails(function () { - new $ArrayBuffer(-1); // eslint-disable-line no-new - }) || fails(function () { - new $ArrayBuffer(); // eslint-disable-line no-new - new $ArrayBuffer(1.5); // eslint-disable-line no-new - new $ArrayBuffer(NaN); // eslint-disable-line no-new - return $ArrayBuffer.name != ARRAY_BUFFER; - })) { - $ArrayBuffer = function ArrayBuffer(length) { - anInstance(this, $ArrayBuffer); - return new BaseBuffer(toIndex(length)); - }; - var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; - for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) { - if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]); - } - if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer; - } - // iOS Safari 7.x bug - var view = new $DataView(new $ArrayBuffer(2)); - var $setInt8 = $DataView[PROTOTYPE].setInt8; - view.setInt8(0, 2147483648); - view.setInt8(1, 2147483649); - if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], { - setInt8: function setInt8(byteOffset, value) { - $setInt8.call(this, byteOffset, value << 24 >> 24); - }, - setUint8: function setUint8(byteOffset, value) { - $setInt8.call(this, byteOffset, value << 24 >> 24); - } - }, true); -} -setToStringTag($ArrayBuffer, ARRAY_BUFFER); -setToStringTag($DataView, DATA_VIEW); -hide($DataView[PROTOTYPE], $typed.VIEW, true); -exports[ARRAY_BUFFER] = $ArrayBuffer; -exports[DATA_VIEW] = $DataView; - - -/***/ }), -/* 94 */ -/***/ (function(module, exports) { - -module.exports = function (regExp, replace) { - var replacer = replace === Object(replace) ? function (part) { - return replace[part]; - } : replace; - return function (it) { - return String(it).replace(regExp, replacer); - }; -}; - - -/***/ }), -/* 95 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = !__webpack_require__(7) && !__webpack_require__(4)(function () { - return Object.defineProperty(__webpack_require__(67)('div'), 'a', { get: function () { return 7; } }).a != 7; -}); - - -/***/ }), -/* 96 */ -/***/ (function(module, exports, __webpack_require__) { - -exports.f = __webpack_require__(5); - - -/***/ }), -/* 97 */ -/***/ (function(module, exports, __webpack_require__) { - -var has = __webpack_require__(12); -var toIObject = __webpack_require__(11); -var arrayIndexOf = __webpack_require__(51)(false); -var IE_PROTO = __webpack_require__(69)('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; -}; - - -/***/ }), -/* 98 */ -/***/ (function(module, exports, __webpack_require__) { - -var dP = __webpack_require__(6); -var anObject = __webpack_require__(1); -var getKeys = __webpack_require__(27); - -module.exports = __webpack_require__(7) ? 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; -}; - - -/***/ }), -/* 99 */ -/***/ (function(module, exports, __webpack_require__) { - -// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window -var toIObject = __webpack_require__(11); -var gOPN = __webpack_require__(38).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)); -}; - - -/***/ }), -/* 100 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var aFunction = __webpack_require__(10); -var isObject = __webpack_require__(3); -var invoke = __webpack_require__(74); -var arraySlice = [].slice; -var factories = {}; - -var construct = function (F, len, args) { - if (!(len in factories)) { - for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']'; - // eslint-disable-next-line no-new-func - factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); - } return factories[len](F, args); -}; - -module.exports = Function.bind || function bind(that /* , ...args */) { - var fn = aFunction(this); - var partArgs = arraySlice.call(arguments, 1); - var bound = function (/* args... */) { - var args = partArgs.concat(arraySlice.call(arguments)); - return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); - }; - if (isObject(fn.prototype)) bound.prototype = fn.prototype; - return bound; -}; - - -/***/ }), -/* 101 */ -/***/ (function(module, exports, __webpack_require__) { - -var cof = __webpack_require__(20); -module.exports = function (it, msg) { - if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg); - return +it; -}; - - -/***/ }), -/* 102 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.3 Number.isInteger(number) -var isObject = __webpack_require__(3); -var floor = Math.floor; -module.exports = function isInteger(it) { - return !isObject(it) && isFinite(it) && floor(it) === it; -}; - - -/***/ }), -/* 103 */ -/***/ (function(module, exports, __webpack_require__) { - -var $parseFloat = __webpack_require__(2).parseFloat; -var $trim = __webpack_require__(45).trim; - -module.exports = 1 / $parseFloat(__webpack_require__(76) + '-0') !== -Infinity ? function parseFloat(str) { - var string = $trim(String(str), 3); - var result = $parseFloat(string); - return result === 0 && string.charAt(0) == '-' ? -0 : result; -} : $parseFloat; - - -/***/ }), -/* 104 */ -/***/ (function(module, exports, __webpack_require__) { - -var $parseInt = __webpack_require__(2).parseInt; -var $trim = __webpack_require__(45).trim; -var ws = __webpack_require__(76); -var hex = /^[-+]?0[xX]/; - -module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) { - var string = $trim(String(str), 3); - return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); -} : $parseInt; - - -/***/ }), -/* 105 */ -/***/ (function(module, exports) { - -// 20.2.2.20 Math.log1p(x) -module.exports = Math.log1p || function log1p(x) { - return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); -}; - - -/***/ }), -/* 106 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.16 Math.fround(x) -var sign = __webpack_require__(78); -var pow = Math.pow; -var EPSILON = pow(2, -52); -var EPSILON32 = pow(2, -23); -var MAX32 = pow(2, 127) * (2 - EPSILON32); -var MIN32 = pow(2, -126); - -var roundTiesToEven = function (n) { - return n + 1 / EPSILON - 1 / EPSILON; -}; - -module.exports = Math.fround || function fround(x) { - var $abs = Math.abs(x); - var $sign = sign(x); - var a, result; - if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; - a = (1 + EPSILON32 / EPSILON) * $abs; - result = a - (a - $abs); - // eslint-disable-next-line no-self-compare - if (result > MAX32 || result != result) return $sign * Infinity; - return $sign * result; -}; - - -/***/ }), -/* 107 */ -/***/ (function(module, exports, __webpack_require__) { - -// call something on iterator step with safe closing on error -var anObject = __webpack_require__(1); -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; - } -}; - - -/***/ }), -/* 108 */ -/***/ (function(module, exports, __webpack_require__) { - -var aFunction = __webpack_require__(10); -var toObject = __webpack_require__(9); -var IObject = __webpack_require__(47); -var toLength = __webpack_require__(8); - -module.exports = function (that, callbackfn, aLen, memo, isRight) { - aFunction(callbackfn); - var O = toObject(that); - var self = IObject(O); - var length = toLength(O.length); - var index = isRight ? length - 1 : 0; - var i = isRight ? -1 : 1; - if (aLen < 2) for (;;) { - if (index in self) { - memo = self[index]; - index += i; - break; - } - index += i; - if (isRight ? index < 0 : length <= index) { - throw TypeError('Reduce of empty array with no initial value'); - } - } - for (;isRight ? index >= 0 : length > index; index += i) if (index in self) { - memo = callbackfn(memo, self[index], index, O); - } - return memo; -}; - - -/***/ }), -/* 109 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) - -var toObject = __webpack_require__(9); -var toAbsoluteIndex = __webpack_require__(37); -var toLength = __webpack_require__(8); - -module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { - var O = toObject(this); - var len = toLength(O.length); - var to = toAbsoluteIndex(target, len); - var from = toAbsoluteIndex(start, len); - var end = arguments.length > 2 ? arguments[2] : undefined; - var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); - var inc = 1; - if (from < to && to < from + count) { - inc = -1; - from += count - 1; - to += count - 1; - } - while (count-- > 0) { - if (from in O) O[to] = O[from]; - else delete O[to]; - to += inc; - from += inc; - } return O; -}; - - -/***/ }), -/* 110 */ -/***/ (function(module, exports, __webpack_require__) { - -// 21.2.5.3 get RegExp.prototype.flags() -if (__webpack_require__(7) && /./g.flags != 'g') __webpack_require__(6).f(RegExp.prototype, 'flags', { - configurable: true, - get: __webpack_require__(58) -}); - - -/***/ }), -/* 111 */ -/***/ (function(module, exports) { - -module.exports = function (exec) { - try { - return { e: false, v: exec() }; - } catch (e) { - return { e: true, v: e }; - } -}; - - -/***/ }), -/* 112 */ -/***/ (function(module, exports, __webpack_require__) { - -var anObject = __webpack_require__(1); -var isObject = __webpack_require__(3); -var newPromiseCapability = __webpack_require__(91); - -module.exports = function (C, x) { - anObject(C); - if (isObject(x) && x.constructor === C) return x; - var promiseCapability = newPromiseCapability.f(C); - var resolve = promiseCapability.resolve; - resolve(x); - return promiseCapability.promise; -}; - - -/***/ }), -/* 113 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var strong = __webpack_require__(114); -var validate = __webpack_require__(46); -var MAP = 'Map'; - -// 23.1 Map Objects -module.exports = __webpack_require__(62)(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); - - -/***/ }), -/* 114 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var dP = __webpack_require__(6).f; -var create = __webpack_require__(28); -var redefineAll = __webpack_require__(43); -var ctx = __webpack_require__(19); -var anInstance = __webpack_require__(42); -var forOf = __webpack_require__(35); -var $iterDefine = __webpack_require__(55); -var step = __webpack_require__(88); -var setSpecies = __webpack_require__(41); -var DESCRIPTORS = __webpack_require__(7); -var fastKey = __webpack_require__(32).fastKey; -var validate = __webpack_require__(46); -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); - } -}; - - -/***/ }), -/* 115 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var strong = __webpack_require__(114); -var validate = __webpack_require__(46); -var SET = 'Set'; - -// 23.2 Set Objects -module.exports = __webpack_require__(62)(SET, function (get) { - return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; -}, { - // 23.2.3.1 Set.prototype.add(value) - add: function add(value) { - return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value); - } -}, strong); - - -/***/ }), -/* 116 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var each = __webpack_require__(26)(0); -var redefine = __webpack_require__(15); -var meta = __webpack_require__(32); -var assign = __webpack_require__(72); -var weak = __webpack_require__(117); -var isObject = __webpack_require__(3); -var fails = __webpack_require__(4); -var validate = __webpack_require__(46); -var WEAK_MAP = 'WeakMap'; -var getWeak = meta.getWeak; -var isExtensible = Object.isExtensible; -var uncaughtFrozenStore = weak.ufstore; -var tmp = {}; -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__(62)(WEAK_MAP, wrapper, methods, weak, true, true); - -// IE11 WeakMap frozen keys fix -if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) { - 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); - }); - }); -} - - -/***/ }), -/* 117 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var redefineAll = __webpack_require__(43); -var getWeak = __webpack_require__(32).getWeak; -var anObject = __webpack_require__(1); -var isObject = __webpack_require__(3); -var anInstance = __webpack_require__(42); -var forOf = __webpack_require__(35); -var createArrayMethod = __webpack_require__(26); -var $has = __webpack_require__(12); -var validate = __webpack_require__(46); -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 -}; - - -/***/ }), -/* 118 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/ecma262/#sec-toindex -var toInteger = __webpack_require__(24); -var toLength = __webpack_require__(8); -module.exports = function (it) { - if (it === undefined) return 0; - var number = toInteger(it); - var length = toLength(number); - if (number !== length) throw RangeError('Wrong length!'); - return length; -}; - - -/***/ }), -/* 119 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray -var isArray = __webpack_require__(53); -var isObject = __webpack_require__(3); -var toLength = __webpack_require__(8); -var ctx = __webpack_require__(19); -var IS_CONCAT_SPREADABLE = __webpack_require__(5)('isConcatSpreadable'); - -function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) { - var targetIndex = start; - var sourceIndex = 0; - var mapFn = mapper ? ctx(mapper, thisArg, 3) : false; - var element, spreadable; - - while (sourceIndex < sourceLen) { - if (sourceIndex in source) { - element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; - - spreadable = false; - if (isObject(element)) { - spreadable = element[IS_CONCAT_SPREADABLE]; - spreadable = spreadable !== undefined ? !!spreadable : isArray(element); - } - - if (spreadable && depth > 0) { - targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1; - } else { - if (targetIndex >= 0x1fffffffffffff) throw TypeError(); - target[targetIndex] = element; - } - - targetIndex++; - } - sourceIndex++; - } - return targetIndex; -} - -module.exports = flattenIntoArray; - - -/***/ }), -/* 120 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/tc39/proposal-string-pad-start-end -var toLength = __webpack_require__(8); -var repeat = __webpack_require__(77); -var defined = __webpack_require__(23); - -module.exports = function (that, maxLength, fillString, left) { - var S = String(defined(that)); - var stringLength = S.length; - var fillStr = fillString === undefined ? ' ' : String(fillString); - var intMaxLength = toLength(maxLength); - if (intMaxLength <= stringLength || fillStr == '') return S; - var fillLen = intMaxLength - stringLength; - var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); - if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); - return left ? stringFiller + S : S + stringFiller; -}; - - -/***/ }), -/* 121 */ -/***/ (function(module, exports, __webpack_require__) { - -var getKeys = __webpack_require__(27); -var toIObject = __webpack_require__(11); -var isEnum = __webpack_require__(48).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) if (isEnum.call(O, key = keys[i++])) { - result.push(isEntries ? [key, O[key]] : O[key]); - } return result; - }; -}; - - -/***/ }), -/* 122 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/DavidBruant/Map-Set.prototype.toJSON -var classof = __webpack_require__(39); -var from = __webpack_require__(123); -module.exports = function (NAME) { - return function toJSON() { - if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); - return from(this); - }; -}; - - -/***/ }), -/* 123 */ -/***/ (function(module, exports, __webpack_require__) { - -var forOf = __webpack_require__(35); - -module.exports = function (iter, ITERATOR) { - var result = []; - forOf(iter, false, result.push, result, ITERATOR); - return result; -}; - - -/***/ }), -/* 124 */ -/***/ (function(module, exports) { - -// https://rwaldron.github.io/proposal-math-extensions/ -module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) { - if ( - arguments.length === 0 - // eslint-disable-next-line no-self-compare - || x != x - // eslint-disable-next-line no-self-compare - || inLow != inLow - // eslint-disable-next-line no-self-compare - || inHigh != inHigh - // eslint-disable-next-line no-self-compare - || outLow != outLow - // eslint-disable-next-line no-self-compare - || outHigh != outHigh - ) return NaN; - if (x === Infinity || x === -Infinity) return x; - return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow; -}; - - -/***/ }), -/* 125 */ -/***/ (function(module, exports, __webpack_require__) { - -var classof = __webpack_require__(39); -var ITERATOR = __webpack_require__(5)('iterator'); -var Iterators = __webpack_require__(40); -module.exports = __webpack_require__(13).isIterable = function (it) { - var O = Object(it); - return O[ITERATOR] !== undefined - || '@@iterator' in O - // eslint-disable-next-line no-prototype-builtins - || Iterators.hasOwnProperty(classof(O)); -}; - - -/***/ }), -/* 126 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var path = __webpack_require__(127); -var invoke = __webpack_require__(74); -var aFunction = __webpack_require__(10); -module.exports = function (/* ...pargs */) { - var fn = aFunction(this); - var length = arguments.length; - var pargs = new Array(length); - var i = 0; - var _ = path._; - var holder = false; - while (length > i) if ((pargs[i] = arguments[i++]) === _) holder = true; - return function (/* ...args */) { - var that = this; - var aLen = arguments.length; - var j = 0; - var k = 0; - var args; - if (!holder && !aLen) return invoke(fn, pargs, that); - args = pargs.slice(); - if (holder) for (;length > j; j++) if (args[j] === _) args[j] = arguments[k++]; - while (aLen > k) args.push(arguments[k++]); - return invoke(fn, args, that); - }; -}; - - -/***/ }), -/* 127 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(2); - - -/***/ }), -/* 128 */ -/***/ (function(module, exports, __webpack_require__) { - -var dP = __webpack_require__(6); -var gOPD = __webpack_require__(16); -var ownKeys = __webpack_require__(92); -var toIObject = __webpack_require__(11); - -module.exports = function define(target, mixin) { - var keys = ownKeys(toIObject(mixin)); - var length = keys.length; - var i = 0; - var key; - while (length > i) dP.f(target, key = keys[i++], gOPD.f(mixin, key)); - return target; -}; - - -/***/ }), -/* 129 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(130); -__webpack_require__(132); -__webpack_require__(133); -__webpack_require__(134); -__webpack_require__(135); -__webpack_require__(136); -__webpack_require__(137); -__webpack_require__(138); -__webpack_require__(139); -__webpack_require__(140); -__webpack_require__(141); -__webpack_require__(142); -__webpack_require__(143); -__webpack_require__(144); -__webpack_require__(145); -__webpack_require__(146); -__webpack_require__(148); -__webpack_require__(149); -__webpack_require__(150); -__webpack_require__(151); -__webpack_require__(152); -__webpack_require__(153); -__webpack_require__(154); -__webpack_require__(155); -__webpack_require__(156); -__webpack_require__(157); -__webpack_require__(158); -__webpack_require__(159); -__webpack_require__(160); -__webpack_require__(161); -__webpack_require__(162); -__webpack_require__(163); -__webpack_require__(164); -__webpack_require__(165); -__webpack_require__(166); -__webpack_require__(167); -__webpack_require__(168); -__webpack_require__(169); -__webpack_require__(170); -__webpack_require__(171); -__webpack_require__(172); -__webpack_require__(173); -__webpack_require__(174); -__webpack_require__(175); -__webpack_require__(176); -__webpack_require__(177); -__webpack_require__(178); -__webpack_require__(179); -__webpack_require__(180); -__webpack_require__(181); -__webpack_require__(182); -__webpack_require__(183); -__webpack_require__(184); -__webpack_require__(185); -__webpack_require__(186); -__webpack_require__(187); -__webpack_require__(188); -__webpack_require__(189); -__webpack_require__(190); -__webpack_require__(191); -__webpack_require__(192); -__webpack_require__(193); -__webpack_require__(194); -__webpack_require__(195); -__webpack_require__(196); -__webpack_require__(197); -__webpack_require__(198); -__webpack_require__(199); -__webpack_require__(200); -__webpack_require__(201); -__webpack_require__(202); -__webpack_require__(203); -__webpack_require__(204); -__webpack_require__(205); -__webpack_require__(206); -__webpack_require__(207); -__webpack_require__(208); -__webpack_require__(209); -__webpack_require__(210); -__webpack_require__(211); -__webpack_require__(212); -__webpack_require__(214); -__webpack_require__(215); -__webpack_require__(216); -__webpack_require__(217); -__webpack_require__(218); -__webpack_require__(219); -__webpack_require__(220); -__webpack_require__(221); -__webpack_require__(222); -__webpack_require__(223); -__webpack_require__(224); -__webpack_require__(225); -__webpack_require__(87); -__webpack_require__(226); -__webpack_require__(227); -__webpack_require__(228); -__webpack_require__(110); -__webpack_require__(229); -__webpack_require__(230); -__webpack_require__(231); -__webpack_require__(232); -__webpack_require__(233); -__webpack_require__(113); -__webpack_require__(115); -__webpack_require__(116); -__webpack_require__(234); -__webpack_require__(235); -__webpack_require__(236); -__webpack_require__(237); -__webpack_require__(238); -__webpack_require__(239); -__webpack_require__(240); -__webpack_require__(241); -__webpack_require__(242); -__webpack_require__(243); -__webpack_require__(244); -__webpack_require__(245); -__webpack_require__(246); -__webpack_require__(247); -__webpack_require__(248); -__webpack_require__(249); -__webpack_require__(250); -__webpack_require__(251); -__webpack_require__(253); -__webpack_require__(254); -__webpack_require__(256); -__webpack_require__(257); -__webpack_require__(258); -__webpack_require__(259); -__webpack_require__(260); -__webpack_require__(261); -__webpack_require__(262); -__webpack_require__(263); -__webpack_require__(264); -__webpack_require__(265); -__webpack_require__(266); -__webpack_require__(267); -__webpack_require__(268); -__webpack_require__(269); -__webpack_require__(270); -__webpack_require__(271); -__webpack_require__(272); -__webpack_require__(273); -__webpack_require__(274); -__webpack_require__(275); -__webpack_require__(276); -__webpack_require__(277); -__webpack_require__(278); -__webpack_require__(279); -__webpack_require__(280); -__webpack_require__(281); -__webpack_require__(282); -__webpack_require__(283); -__webpack_require__(284); -__webpack_require__(285); -__webpack_require__(286); -__webpack_require__(287); -__webpack_require__(288); -__webpack_require__(289); -__webpack_require__(290); -__webpack_require__(291); -__webpack_require__(292); -__webpack_require__(293); -__webpack_require__(294); -__webpack_require__(295); -__webpack_require__(296); -__webpack_require__(297); -__webpack_require__(298); -__webpack_require__(299); -__webpack_require__(300); -__webpack_require__(301); -__webpack_require__(302); -__webpack_require__(303); -__webpack_require__(304); -__webpack_require__(305); -__webpack_require__(306); -__webpack_require__(307); -__webpack_require__(308); -__webpack_require__(309); -__webpack_require__(310); -__webpack_require__(311); -__webpack_require__(312); -__webpack_require__(313); -__webpack_require__(314); -__webpack_require__(315); -__webpack_require__(316); -__webpack_require__(317); -__webpack_require__(318); -__webpack_require__(319); -__webpack_require__(320); -__webpack_require__(321); -__webpack_require__(322); -__webpack_require__(323); -__webpack_require__(324); -__webpack_require__(325); -__webpack_require__(326); -__webpack_require__(49); -__webpack_require__(328); -__webpack_require__(125); -__webpack_require__(329); -__webpack_require__(330); -__webpack_require__(331); -__webpack_require__(332); -__webpack_require__(333); -__webpack_require__(334); -__webpack_require__(335); -__webpack_require__(336); -__webpack_require__(337); -module.exports = __webpack_require__(338); - - -/***/ }), -/* 130 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// ECMAScript 6 symbols shim -var global = __webpack_require__(2); -var has = __webpack_require__(12); -var DESCRIPTORS = __webpack_require__(7); -var $export = __webpack_require__(0); -var redefine = __webpack_require__(15); -var META = __webpack_require__(32).KEY; -var $fails = __webpack_require__(4); -var shared = __webpack_require__(50); -var setToStringTag = __webpack_require__(44); -var uid = __webpack_require__(36); -var wks = __webpack_require__(5); -var wksExt = __webpack_require__(96); -var wksDefine = __webpack_require__(68); -var enumKeys = __webpack_require__(131); -var isArray = __webpack_require__(53); -var anObject = __webpack_require__(1); -var isObject = __webpack_require__(3); -var toIObject = __webpack_require__(11); -var toPrimitive = __webpack_require__(22); -var createDesc = __webpack_require__(31); -var _create = __webpack_require__(28); -var gOPNExt = __webpack_require__(99); -var $GOPD = __webpack_require__(16); -var $DP = __webpack_require__(6); -var $keys = __webpack_require__(27); -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'; -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__(38).f = gOPNExt.f = $getOwnPropertyNames; - __webpack_require__(48).f = $propertyIsEnumerable; - __webpack_require__(52).f = $getOwnPropertySymbols; - - if (DESCRIPTORS && !__webpack_require__(33)) { - 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 -}); - -// 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__(14)($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); - - -/***/ }), -/* 131 */ -/***/ (function(module, exports, __webpack_require__) { - -// all enumerable object keys, includes symbols -var getKeys = __webpack_require__(27); -var gOPS = __webpack_require__(52); -var pIE = __webpack_require__(48); -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; -}; - - -/***/ }), -/* 132 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) -$export($export.S + $export.F * !__webpack_require__(7), 'Object', { defineProperty: __webpack_require__(6).f }); - - -/***/ }), -/* 133 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) -$export($export.S + $export.F * !__webpack_require__(7), 'Object', { defineProperties: __webpack_require__(98) }); - - -/***/ }), -/* 134 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) -var toIObject = __webpack_require__(11); -var $getOwnPropertyDescriptor = __webpack_require__(16).f; - -__webpack_require__(25)('getOwnPropertyDescriptor', function () { - return function getOwnPropertyDescriptor(it, key) { - return $getOwnPropertyDescriptor(toIObject(it), key); - }; -}); - - -/***/ }), -/* 135 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -$export($export.S, 'Object', { create: __webpack_require__(28) }); - - -/***/ }), -/* 136 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.9 Object.getPrototypeOf(O) -var toObject = __webpack_require__(9); -var $getPrototypeOf = __webpack_require__(17); - -__webpack_require__(25)('getPrototypeOf', function () { - return function getPrototypeOf(it) { - return $getPrototypeOf(toObject(it)); - }; -}); - - -/***/ }), -/* 137 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.14 Object.keys(O) -var toObject = __webpack_require__(9); -var $keys = __webpack_require__(27); - -__webpack_require__(25)('keys', function () { - return function keys(it) { - return $keys(toObject(it)); - }; -}); - - -/***/ }), -/* 138 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.7 Object.getOwnPropertyNames(O) -__webpack_require__(25)('getOwnPropertyNames', function () { - return __webpack_require__(99).f; -}); - - -/***/ }), -/* 139 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.5 Object.freeze(O) -var isObject = __webpack_require__(3); -var meta = __webpack_require__(32).onFreeze; - -__webpack_require__(25)('freeze', function ($freeze) { - return function freeze(it) { - return $freeze && isObject(it) ? $freeze(meta(it)) : it; - }; -}); - - -/***/ }), -/* 140 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.17 Object.seal(O) -var isObject = __webpack_require__(3); -var meta = __webpack_require__(32).onFreeze; - -__webpack_require__(25)('seal', function ($seal) { - return function seal(it) { - return $seal && isObject(it) ? $seal(meta(it)) : it; - }; -}); - - -/***/ }), -/* 141 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.15 Object.preventExtensions(O) -var isObject = __webpack_require__(3); -var meta = __webpack_require__(32).onFreeze; - -__webpack_require__(25)('preventExtensions', function ($preventExtensions) { - return function preventExtensions(it) { - return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; - }; -}); - - -/***/ }), -/* 142 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.12 Object.isFrozen(O) -var isObject = __webpack_require__(3); - -__webpack_require__(25)('isFrozen', function ($isFrozen) { - return function isFrozen(it) { - return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; - }; -}); - - -/***/ }), -/* 143 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.13 Object.isSealed(O) -var isObject = __webpack_require__(3); - -__webpack_require__(25)('isSealed', function ($isSealed) { - return function isSealed(it) { - return isObject(it) ? $isSealed ? $isSealed(it) : false : true; - }; -}); - - -/***/ }), -/* 144 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.11 Object.isExtensible(O) -var isObject = __webpack_require__(3); - -__webpack_require__(25)('isExtensible', function ($isExtensible) { - return function isExtensible(it) { - return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; - }; -}); - - -/***/ }), -/* 145 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.3.1 Object.assign(target, source) -var $export = __webpack_require__(0); - -$export($export.S + $export.F, 'Object', { assign: __webpack_require__(72) }); - - -/***/ }), -/* 146 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.3.10 Object.is(value1, value2) -var $export = __webpack_require__(0); -$export($export.S, 'Object', { is: __webpack_require__(147) }); - - -/***/ }), -/* 147 */ -/***/ (function(module, exports) { - -// 7.2.9 SameValue(x, y) -module.exports = Object.is || function is(x, y) { - // eslint-disable-next-line no-self-compare - return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; -}; - - -/***/ }), -/* 148 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.3.19 Object.setPrototypeOf(O, proto) -var $export = __webpack_require__(0); -$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(73).set }); - - -/***/ }), -/* 149 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 19.1.3.6 Object.prototype.toString() -var classof = __webpack_require__(39); -var test = {}; -test[__webpack_require__(5)('toStringTag')] = 'z'; -if (test + '' != '[object z]') { - __webpack_require__(15)(Object.prototype, 'toString', function toString() { - return '[object ' + classof(this) + ']'; - }, true); -} - - -/***/ }), -/* 150 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) -var $export = __webpack_require__(0); - -$export($export.P, 'Function', { bind: __webpack_require__(100) }); - - -/***/ }), -/* 151 */ -/***/ (function(module, exports, __webpack_require__) { - -var dP = __webpack_require__(6).f; -var FProto = Function.prototype; -var nameRE = /^\s*function ([^ (]*)/; -var NAME = 'name'; - -// 19.2.4.2 name -NAME in FProto || __webpack_require__(7) && dP(FProto, NAME, { - configurable: true, - get: function () { - try { - return ('' + this).match(nameRE)[1]; - } catch (e) { - return ''; - } - } -}); - - -/***/ }), -/* 152 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var isObject = __webpack_require__(3); -var getPrototypeOf = __webpack_require__(17); -var HAS_INSTANCE = __webpack_require__(5)('hasInstance'); -var FunctionProto = Function.prototype; -// 19.2.3.6 Function.prototype[@@hasInstance](V) -if (!(HAS_INSTANCE in FunctionProto)) __webpack_require__(6).f(FunctionProto, HAS_INSTANCE, { value: function (O) { - if (typeof this != 'function' || !isObject(O)) return false; - if (!isObject(this.prototype)) return O instanceof this; - // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: - while (O = getPrototypeOf(O)) if (this.prototype === O) return true; - return false; -} }); - - -/***/ }), -/* 153 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var global = __webpack_require__(2); -var has = __webpack_require__(12); -var cof = __webpack_require__(20); -var inheritIfRequired = __webpack_require__(75); -var toPrimitive = __webpack_require__(22); -var fails = __webpack_require__(4); -var gOPN = __webpack_require__(38).f; -var gOPD = __webpack_require__(16).f; -var dP = __webpack_require__(6).f; -var $trim = __webpack_require__(45).trim; -var NUMBER = 'Number'; -var $Number = global[NUMBER]; -var Base = $Number; -var proto = $Number.prototype; -// Opera ~12 has broken Object#toString -var BROKEN_COF = cof(__webpack_require__(28)(proto)) == NUMBER; -var TRIM = 'trim' in String.prototype; - -// 7.1.3 ToNumber(argument) -var toNumber = function (argument) { - var it = toPrimitive(argument, false); - if (typeof it == 'string' && it.length > 2) { - it = TRIM ? it.trim() : $trim(it, 3); - var first = it.charCodeAt(0); - var third, radix, maxCode; - if (first === 43 || first === 45) { - third = it.charCodeAt(2); - if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix - } else if (first === 48) { - switch (it.charCodeAt(1)) { - case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i - case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i - default: return +it; - } - for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) { - code = digits.charCodeAt(i); - // parseInt parses a string to a first unavailable symbol - // but ToNumber should return NaN if a string contains unavailable symbols - if (code < 48 || code > maxCode) return NaN; - } return parseInt(digits, radix); - } - } return +it; -}; - -if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) { - $Number = function Number(value) { - var it = arguments.length < 1 ? 0 : value; - var that = this; - return that instanceof $Number - // check on 1..constructor(foo) case - && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER) - ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it); - }; - for (var keys = __webpack_require__(7) ? gOPN(Base) : ( - // ES3: - 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + - // ES6 (in case, if modules with ES6 Number statics required before): - 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + - 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' - ).split(','), j = 0, key; keys.length > j; j++) { - if (has(Base, key = keys[j]) && !has($Number, key)) { - dP($Number, key, gOPD(Base, key)); - } - } - $Number.prototype = proto; - proto.constructor = $Number; - __webpack_require__(15)(global, NUMBER, $Number); -} - - -/***/ }), -/* 154 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var toInteger = __webpack_require__(24); -var aNumberValue = __webpack_require__(101); -var repeat = __webpack_require__(77); -var $toFixed = 1.0.toFixed; -var floor = Math.floor; -var data = [0, 0, 0, 0, 0, 0]; -var ERROR = 'Number.toFixed: incorrect invocation!'; -var ZERO = '0'; - -var multiply = function (n, c) { - var i = -1; - var c2 = c; - while (++i < 6) { - c2 += n * data[i]; - data[i] = c2 % 1e7; - c2 = floor(c2 / 1e7); - } -}; -var divide = function (n) { - var i = 6; - var c = 0; - while (--i >= 0) { - c += data[i]; - data[i] = floor(c / n); - c = (c % n) * 1e7; - } -}; -var numToString = function () { - var i = 6; - var s = ''; - while (--i >= 0) { - if (s !== '' || i === 0 || data[i] !== 0) { - var t = String(data[i]); - s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; - } - } return s; -}; -var pow = function (x, n, acc) { - return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); -}; -var log = function (x) { - var n = 0; - var x2 = x; - while (x2 >= 4096) { - n += 12; - x2 /= 4096; - } - while (x2 >= 2) { - n += 1; - x2 /= 2; - } return n; -}; - -$export($export.P + $export.F * (!!$toFixed && ( - 0.00008.toFixed(3) !== '0.000' || - 0.9.toFixed(0) !== '1' || - 1.255.toFixed(2) !== '1.25' || - 1000000000000000128.0.toFixed(0) !== '1000000000000000128' -) || !__webpack_require__(4)(function () { - // V8 ~ Android 4.3- - $toFixed.call({}); -})), 'Number', { - toFixed: function toFixed(fractionDigits) { - var x = aNumberValue(this, ERROR); - var f = toInteger(fractionDigits); - var s = ''; - var m = ZERO; - var e, z, j, k; - if (f < 0 || f > 20) throw RangeError(ERROR); - // eslint-disable-next-line no-self-compare - if (x != x) return 'NaN'; - if (x <= -1e21 || x >= 1e21) return String(x); - if (x < 0) { - s = '-'; - x = -x; - } - if (x > 1e-21) { - e = log(x * pow(2, 69, 1)) - 69; - z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); - z *= 0x10000000000000; - e = 52 - e; - if (e > 0) { - multiply(0, z); - j = f; - while (j >= 7) { - multiply(1e7, 0); - j -= 7; - } - multiply(pow(10, j, 1), 0); - j = e - 1; - while (j >= 23) { - divide(1 << 23); - j -= 23; - } - divide(1 << j); - multiply(1, 1); - divide(2); - m = numToString(); - } else { - multiply(0, z); - multiply(1 << -e, 0); - m = numToString() + repeat.call(ZERO, f); - } - } - if (f > 0) { - k = m.length; - m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); - } else { - m = s + m; - } return m; - } -}); - - -/***/ }), -/* 155 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $fails = __webpack_require__(4); -var aNumberValue = __webpack_require__(101); -var $toPrecision = 1.0.toPrecision; - -$export($export.P + $export.F * ($fails(function () { - // IE7- - return $toPrecision.call(1, undefined) !== '1'; -}) || !$fails(function () { - // V8 ~ Android 4.3- - $toPrecision.call({}); -})), 'Number', { - toPrecision: function toPrecision(precision) { - var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); - return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); - } -}); - - -/***/ }), -/* 156 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.1 Number.EPSILON -var $export = __webpack_require__(0); - -$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) }); - - -/***/ }), -/* 157 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.2 Number.isFinite(number) -var $export = __webpack_require__(0); -var _isFinite = __webpack_require__(2).isFinite; - -$export($export.S, 'Number', { - isFinite: function isFinite(it) { - return typeof it == 'number' && _isFinite(it); - } -}); - - -/***/ }), -/* 158 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.3 Number.isInteger(number) -var $export = __webpack_require__(0); - -$export($export.S, 'Number', { isInteger: __webpack_require__(102) }); - - -/***/ }), -/* 159 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.4 Number.isNaN(number) -var $export = __webpack_require__(0); - -$export($export.S, 'Number', { - isNaN: function isNaN(number) { - // eslint-disable-next-line no-self-compare - return number != number; - } -}); - - -/***/ }), -/* 160 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.5 Number.isSafeInteger(number) -var $export = __webpack_require__(0); -var isInteger = __webpack_require__(102); -var abs = Math.abs; - -$export($export.S, 'Number', { - isSafeInteger: function isSafeInteger(number) { - return isInteger(number) && abs(number) <= 0x1fffffffffffff; - } -}); - - -/***/ }), -/* 161 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.6 Number.MAX_SAFE_INTEGER -var $export = __webpack_require__(0); - -$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); - - -/***/ }), -/* 162 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.10 Number.MIN_SAFE_INTEGER -var $export = __webpack_require__(0); - -$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff }); - - -/***/ }), -/* 163 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var $parseFloat = __webpack_require__(103); -// 20.1.2.12 Number.parseFloat(string) -$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat }); - - -/***/ }), -/* 164 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var $parseInt = __webpack_require__(104); -// 20.1.2.13 Number.parseInt(string, radix) -$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt }); - - -/***/ }), -/* 165 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var $parseInt = __webpack_require__(104); -// 18.2.5 parseInt(string, radix) -$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt }); - - -/***/ }), -/* 166 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var $parseFloat = __webpack_require__(103); -// 18.2.4 parseFloat(string) -$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat }); - - -/***/ }), -/* 167 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.3 Math.acosh(x) -var $export = __webpack_require__(0); -var log1p = __webpack_require__(105); -var sqrt = Math.sqrt; -var $acosh = Math.acosh; - -$export($export.S + $export.F * !($acosh - // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 - && Math.floor($acosh(Number.MAX_VALUE)) == 710 - // Tor Browser bug: Math.acosh(Infinity) -> NaN - && $acosh(Infinity) == Infinity -), 'Math', { - acosh: function acosh(x) { - return (x = +x) < 1 ? NaN : x > 94906265.62425156 - ? Math.log(x) + Math.LN2 - : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); - } -}); - - -/***/ }), -/* 168 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.5 Math.asinh(x) -var $export = __webpack_require__(0); -var $asinh = Math.asinh; - -function asinh(x) { - return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); -} - -// Tor Browser bug: Math.asinh(0) -> -0 -$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh }); - - -/***/ }), -/* 169 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.7 Math.atanh(x) -var $export = __webpack_require__(0); -var $atanh = Math.atanh; - -// Tor Browser bug: Math.atanh(-0) -> 0 -$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { - atanh: function atanh(x) { - return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; - } -}); - - -/***/ }), -/* 170 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.9 Math.cbrt(x) -var $export = __webpack_require__(0); -var sign = __webpack_require__(78); - -$export($export.S, 'Math', { - cbrt: function cbrt(x) { - return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); - } -}); - - -/***/ }), -/* 171 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.11 Math.clz32(x) -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - clz32: function clz32(x) { - return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; - } -}); - - -/***/ }), -/* 172 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.12 Math.cosh(x) -var $export = __webpack_require__(0); -var exp = Math.exp; - -$export($export.S, 'Math', { - cosh: function cosh(x) { - return (exp(x = +x) + exp(-x)) / 2; - } -}); - - -/***/ }), -/* 173 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.14 Math.expm1(x) -var $export = __webpack_require__(0); -var $expm1 = __webpack_require__(79); - -$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 }); - - -/***/ }), -/* 174 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.16 Math.fround(x) -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { fround: __webpack_require__(106) }); - - -/***/ }), -/* 175 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) -var $export = __webpack_require__(0); -var abs = Math.abs; - -$export($export.S, 'Math', { - hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars - var sum = 0; - var i = 0; - var aLen = arguments.length; - var larg = 0; - var arg, div; - while (i < aLen) { - arg = abs(arguments[i++]); - if (larg < arg) { - div = larg / arg; - sum = sum * div * div + 1; - larg = arg; - } else if (arg > 0) { - div = arg / larg; - sum += div * div; - } else sum += arg; - } - return larg === Infinity ? Infinity : larg * Math.sqrt(sum); - } -}); - - -/***/ }), -/* 176 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.18 Math.imul(x, y) -var $export = __webpack_require__(0); -var $imul = Math.imul; - -// some WebKit versions fails with big numbers, some has wrong arity -$export($export.S + $export.F * __webpack_require__(4)(function () { - return $imul(0xffffffff, 5) != -5 || $imul.length != 2; -}), 'Math', { - imul: function imul(x, y) { - var UINT16 = 0xffff; - var xn = +x; - var yn = +y; - var xl = UINT16 & xn; - var yl = UINT16 & yn; - return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); - } -}); - - -/***/ }), -/* 177 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.21 Math.log10(x) -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - log10: function log10(x) { - return Math.log(x) * Math.LOG10E; - } -}); - - -/***/ }), -/* 178 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.20 Math.log1p(x) -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { log1p: __webpack_require__(105) }); - - -/***/ }), -/* 179 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.22 Math.log2(x) -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - log2: function log2(x) { - return Math.log(x) / Math.LN2; - } -}); - - -/***/ }), -/* 180 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.28 Math.sign(x) -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { sign: __webpack_require__(78) }); - - -/***/ }), -/* 181 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.30 Math.sinh(x) -var $export = __webpack_require__(0); -var expm1 = __webpack_require__(79); -var exp = Math.exp; - -// V8 near Chromium 38 has a problem with very small numbers -$export($export.S + $export.F * __webpack_require__(4)(function () { - return !Math.sinh(-2e-17) != -2e-17; -}), 'Math', { - sinh: function sinh(x) { - return Math.abs(x = +x) < 1 - ? (expm1(x) - expm1(-x)) / 2 - : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); - } -}); - - -/***/ }), -/* 182 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.33 Math.tanh(x) -var $export = __webpack_require__(0); -var expm1 = __webpack_require__(79); -var exp = Math.exp; - -$export($export.S, 'Math', { - tanh: function tanh(x) { - var a = expm1(x = +x); - var b = expm1(-x); - return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); - } -}); - - -/***/ }), -/* 183 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.34 Math.trunc(x) -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - trunc: function trunc(it) { - return (it > 0 ? Math.floor : Math.ceil)(it); - } -}); - - -/***/ }), -/* 184 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var toAbsoluteIndex = __webpack_require__(37); -var fromCharCode = String.fromCharCode; -var $fromCodePoint = String.fromCodePoint; - -// length should be 1, old FF problem -$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { - // 21.1.2.2 String.fromCodePoint(...codePoints) - fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars - var res = []; - var aLen = arguments.length; - var i = 0; - var code; - while (aLen > i) { - code = +arguments[i++]; - if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); - res.push(code < 0x10000 - ? fromCharCode(code) - : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) - ); - } return res.join(''); - } -}); - - -/***/ }), -/* 185 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var toIObject = __webpack_require__(11); -var toLength = __webpack_require__(8); - -$export($export.S, 'String', { - // 21.1.2.4 String.raw(callSite, ...substitutions) - raw: function raw(callSite) { - var tpl = toIObject(callSite.raw); - var len = toLength(tpl.length); - var aLen = arguments.length; - var res = []; - var i = 0; - while (len > i) { - res.push(String(tpl[i++])); - if (i < aLen) res.push(String(arguments[i])); - } return res.join(''); - } -}); - - -/***/ }), -/* 186 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 21.1.3.25 String.prototype.trim() -__webpack_require__(45)('trim', function ($trim) { - return function trim() { - return $trim(this, 3); - }; -}); - - -/***/ }), -/* 187 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $at = __webpack_require__(80)(false); -$export($export.P, 'String', { - // 21.1.3.3 String.prototype.codePointAt(pos) - codePointAt: function codePointAt(pos) { - return $at(this, pos); - } -}); - - -/***/ }), -/* 188 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) - -var $export = __webpack_require__(0); -var toLength = __webpack_require__(8); -var context = __webpack_require__(81); -var ENDS_WITH = 'endsWith'; -var $endsWith = ''[ENDS_WITH]; - -$export($export.P + $export.F * __webpack_require__(82)(ENDS_WITH), 'String', { - endsWith: function endsWith(searchString /* , endPosition = @length */) { - var that = context(this, searchString, ENDS_WITH); - var endPosition = arguments.length > 1 ? arguments[1] : undefined; - var len = toLength(that.length); - var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); - var search = String(searchString); - return $endsWith - ? $endsWith.call(that, search, end) - : that.slice(end - search.length, end) === search; - } -}); - - -/***/ }), -/* 189 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// 21.1.3.7 String.prototype.includes(searchString, position = 0) - -var $export = __webpack_require__(0); -var context = __webpack_require__(81); -var INCLUDES = 'includes'; - -$export($export.P + $export.F * __webpack_require__(82)(INCLUDES), 'String', { - includes: function includes(searchString /* , position = 0 */) { - return !!~context(this, searchString, INCLUDES) - .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); - } -}); - - -/***/ }), -/* 190 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); - -$export($export.P, 'String', { - // 21.1.3.13 String.prototype.repeat(count) - repeat: __webpack_require__(77) -}); - - -/***/ }), -/* 191 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// 21.1.3.18 String.prototype.startsWith(searchString [, position ]) - -var $export = __webpack_require__(0); -var toLength = __webpack_require__(8); -var context = __webpack_require__(81); -var STARTS_WITH = 'startsWith'; -var $startsWith = ''[STARTS_WITH]; - -$export($export.P + $export.F * __webpack_require__(82)(STARTS_WITH), 'String', { - startsWith: function startsWith(searchString /* , position = 0 */) { - var that = context(this, searchString, STARTS_WITH); - var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); - var search = String(searchString); - return $startsWith - ? $startsWith.call(that, search, index) - : that.slice(index, index + search.length) === search; - } -}); - - -/***/ }), -/* 192 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $at = __webpack_require__(80)(true); - -// 21.1.3.27 String.prototype[@@iterator]() -__webpack_require__(55)(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 }; -}); - - -/***/ }), -/* 193 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.2 String.prototype.anchor(name) -__webpack_require__(18)('anchor', function (createHTML) { - return function anchor(name) { - return createHTML(this, 'a', 'name', name); - }; -}); - - -/***/ }), -/* 194 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.3 String.prototype.big() -__webpack_require__(18)('big', function (createHTML) { - return function big() { - return createHTML(this, 'big', '', ''); - }; -}); - - -/***/ }), -/* 195 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.4 String.prototype.blink() -__webpack_require__(18)('blink', function (createHTML) { - return function blink() { - return createHTML(this, 'blink', '', ''); - }; -}); - - -/***/ }), -/* 196 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.5 String.prototype.bold() -__webpack_require__(18)('bold', function (createHTML) { - return function bold() { - return createHTML(this, 'b', '', ''); - }; -}); - - -/***/ }), -/* 197 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.6 String.prototype.fixed() -__webpack_require__(18)('fixed', function (createHTML) { - return function fixed() { - return createHTML(this, 'tt', '', ''); - }; -}); - - -/***/ }), -/* 198 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.7 String.prototype.fontcolor(color) -__webpack_require__(18)('fontcolor', function (createHTML) { - return function fontcolor(color) { - return createHTML(this, 'font', 'color', color); - }; -}); - - -/***/ }), -/* 199 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.8 String.prototype.fontsize(size) -__webpack_require__(18)('fontsize', function (createHTML) { - return function fontsize(size) { - return createHTML(this, 'font', 'size', size); - }; -}); - - -/***/ }), -/* 200 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.9 String.prototype.italics() -__webpack_require__(18)('italics', function (createHTML) { - return function italics() { - return createHTML(this, 'i', '', ''); - }; -}); - - -/***/ }), -/* 201 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.10 String.prototype.link(url) -__webpack_require__(18)('link', function (createHTML) { - return function link(url) { - return createHTML(this, 'a', 'href', url); - }; -}); - - -/***/ }), -/* 202 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.11 String.prototype.small() -__webpack_require__(18)('small', function (createHTML) { - return function small() { - return createHTML(this, 'small', '', ''); - }; -}); - - -/***/ }), -/* 203 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.12 String.prototype.strike() -__webpack_require__(18)('strike', function (createHTML) { - return function strike() { - return createHTML(this, 'strike', '', ''); - }; -}); - - -/***/ }), -/* 204 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.13 String.prototype.sub() -__webpack_require__(18)('sub', function (createHTML) { - return function sub() { - return createHTML(this, 'sub', '', ''); - }; -}); - - -/***/ }), -/* 205 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.14 String.prototype.sup() -__webpack_require__(18)('sup', function (createHTML) { - return function sup() { - return createHTML(this, 'sup', '', ''); - }; -}); - - -/***/ }), -/* 206 */ -/***/ (function(module, exports, __webpack_require__) { - -// 22.1.2.2 / 15.4.3.2 Array.isArray(arg) -var $export = __webpack_require__(0); - -$export($export.S, 'Array', { isArray: __webpack_require__(53) }); - - -/***/ }), -/* 207 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var ctx = __webpack_require__(19); -var $export = __webpack_require__(0); -var toObject = __webpack_require__(9); -var call = __webpack_require__(107); -var isArrayIter = __webpack_require__(83); -var toLength = __webpack_require__(8); -var createProperty = __webpack_require__(84); -var getIterFn = __webpack_require__(49); - -$export($export.S + $export.F * !__webpack_require__(57)(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; - } -}); - - -/***/ }), -/* 208 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var createProperty = __webpack_require__(84); - -// WebKit Array.of isn't generic -$export($export.S + $export.F * __webpack_require__(4)(function () { - function F() { /* empty */ } - return !(Array.of.call(F) instanceof F); -}), 'Array', { - // 22.1.2.3 Array.of( ...items) - of: function of(/* ...args */) { - var index = 0; - var aLen = arguments.length; - var result = new (typeof this == 'function' ? this : Array)(aLen); - while (aLen > index) createProperty(result, index, arguments[index++]); - result.length = aLen; - return result; - } -}); - - -/***/ }), -/* 209 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 22.1.3.13 Array.prototype.join(separator) -var $export = __webpack_require__(0); -var toIObject = __webpack_require__(11); -var arrayJoin = [].join; - -// fallback for not array-like strings -$export($export.P + $export.F * (__webpack_require__(47) != Object || !__webpack_require__(21)(arrayJoin)), 'Array', { - join: function join(separator) { - return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); - } -}); - - -/***/ }), -/* 210 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var html = __webpack_require__(71); -var cof = __webpack_require__(20); -var toAbsoluteIndex = __webpack_require__(37); -var toLength = __webpack_require__(8); -var arraySlice = [].slice; - -// fallback for not array-like ES3 strings and DOM objects -$export($export.P + $export.F * __webpack_require__(4)(function () { - if (html) arraySlice.call(html); -}), 'Array', { - slice: function slice(begin, end) { - var len = toLength(this.length); - var klass = cof(this); - end = end === undefined ? len : end; - if (klass == 'Array') return arraySlice.call(this, begin, end); - var start = toAbsoluteIndex(begin, len); - var upTo = toAbsoluteIndex(end, len); - var size = toLength(upTo - start); - var cloned = new Array(size); - var i = 0; - for (; i < size; i++) cloned[i] = klass == 'String' - ? this.charAt(start + i) - : this[start + i]; - return cloned; - } -}); - - -/***/ }), -/* 211 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var aFunction = __webpack_require__(10); -var toObject = __webpack_require__(9); -var fails = __webpack_require__(4); -var $sort = [].sort; -var test = [1, 2, 3]; - -$export($export.P + $export.F * (fails(function () { - // IE8- - test.sort(undefined); -}) || !fails(function () { - // V8 bug - test.sort(null); - // Old WebKit -}) || !__webpack_require__(21)($sort)), 'Array', { - // 22.1.3.25 Array.prototype.sort(comparefn) - sort: function sort(comparefn) { - return comparefn === undefined - ? $sort.call(toObject(this)) - : $sort.call(toObject(this), aFunction(comparefn)); - } -}); - - -/***/ }), -/* 212 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $forEach = __webpack_require__(26)(0); -var STRICT = __webpack_require__(21)([].forEach, true); - -$export($export.P + $export.F * !STRICT, 'Array', { - // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) - forEach: function forEach(callbackfn /* , thisArg */) { - return $forEach(this, callbackfn, arguments[1]); - } -}); - - -/***/ }), -/* 213 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(3); -var isArray = __webpack_require__(53); -var SPECIES = __webpack_require__(5)('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; -}; - - -/***/ }), -/* 214 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $map = __webpack_require__(26)(1); - -$export($export.P + $export.F * !__webpack_require__(21)([].map, true), 'Array', { - // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) - map: function map(callbackfn /* , thisArg */) { - return $map(this, callbackfn, arguments[1]); - } -}); - - -/***/ }), -/* 215 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $filter = __webpack_require__(26)(2); - -$export($export.P + $export.F * !__webpack_require__(21)([].filter, true), 'Array', { - // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) - filter: function filter(callbackfn /* , thisArg */) { - return $filter(this, callbackfn, arguments[1]); - } -}); - - -/***/ }), -/* 216 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $some = __webpack_require__(26)(3); - -$export($export.P + $export.F * !__webpack_require__(21)([].some, true), 'Array', { - // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) - some: function some(callbackfn /* , thisArg */) { - return $some(this, callbackfn, arguments[1]); - } -}); - - -/***/ }), -/* 217 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $every = __webpack_require__(26)(4); - -$export($export.P + $export.F * !__webpack_require__(21)([].every, true), 'Array', { - // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) - every: function every(callbackfn /* , thisArg */) { - return $every(this, callbackfn, arguments[1]); - } -}); - - -/***/ }), -/* 218 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $reduce = __webpack_require__(108); - -$export($export.P + $export.F * !__webpack_require__(21)([].reduce, true), 'Array', { - // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) - reduce: function reduce(callbackfn /* , initialValue */) { - return $reduce(this, callbackfn, arguments.length, arguments[1], false); - } -}); - - -/***/ }), -/* 219 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $reduce = __webpack_require__(108); - -$export($export.P + $export.F * !__webpack_require__(21)([].reduceRight, true), 'Array', { - // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) - reduceRight: function reduceRight(callbackfn /* , initialValue */) { - return $reduce(this, callbackfn, arguments.length, arguments[1], true); - } -}); - - -/***/ }), -/* 220 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $indexOf = __webpack_require__(51)(false); -var $native = [].indexOf; -var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; - -$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(21)($native)), 'Array', { - // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) - indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { - return NEGATIVE_ZERO - // convert -0 to +0 - ? $native.apply(this, arguments) || 0 - : $indexOf(this, searchElement, arguments[1]); - } -}); - - -/***/ }), -/* 221 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var toIObject = __webpack_require__(11); -var toInteger = __webpack_require__(24); -var toLength = __webpack_require__(8); -var $native = [].lastIndexOf; -var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; - -$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(21)($native)), 'Array', { - // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) - lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { - // convert -0 to +0 - if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0; - var O = toIObject(this); - var length = toLength(O.length); - var index = length - 1; - if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1])); - if (index < 0) index = length + index; - for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0; - return -1; - } -}); - - -/***/ }), -/* 222 */ -/***/ (function(module, exports, __webpack_require__) { - -// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) -var $export = __webpack_require__(0); - -$export($export.P, 'Array', { copyWithin: __webpack_require__(109) }); - -__webpack_require__(34)('copyWithin'); - - -/***/ }), -/* 223 */ -/***/ (function(module, exports, __webpack_require__) { - -// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) -var $export = __webpack_require__(0); - -$export($export.P, 'Array', { fill: __webpack_require__(86) }); - -__webpack_require__(34)('fill'); - - -/***/ }), -/* 224 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) -var $export = __webpack_require__(0); -var $find = __webpack_require__(26)(5); -var KEY = 'find'; -var forced = true; -// Shouldn't skip holes -if (KEY in []) Array(1)[KEY](function () { forced = false; }); -$export($export.P + $export.F * forced, 'Array', { - find: function find(callbackfn /* , that = undefined */) { - return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } -}); -__webpack_require__(34)(KEY); - - -/***/ }), -/* 225 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) -var $export = __webpack_require__(0); -var $find = __webpack_require__(26)(6); -var KEY = 'findIndex'; -var forced = true; -// Shouldn't skip holes -if (KEY in []) Array(1)[KEY](function () { forced = false; }); -$export($export.P + $export.F * forced, 'Array', { - findIndex: function findIndex(callbackfn /* , that = undefined */) { - return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } -}); -__webpack_require__(34)(KEY); - - -/***/ }), -/* 226 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(41)('Array'); - - -/***/ }), -/* 227 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(2); -var inheritIfRequired = __webpack_require__(75); -var dP = __webpack_require__(6).f; -var gOPN = __webpack_require__(38).f; -var isRegExp = __webpack_require__(54); -var $flags = __webpack_require__(58); -var $RegExp = global.RegExp; -var Base = $RegExp; -var proto = $RegExp.prototype; -var re1 = /a/g; -var re2 = /a/g; -// "new" creates a new object, old webkit buggy here -var CORRECT_NEW = new $RegExp(re1) !== re1; - -if (__webpack_require__(7) && (!CORRECT_NEW || __webpack_require__(4)(function () { - re2[__webpack_require__(5)('match')] = false; - // RegExp constructor can alter flags and IsRegExp works correct with @@match - return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i'; -}))) { - $RegExp = function RegExp(p, f) { - var tiRE = this instanceof $RegExp; - var piRE = isRegExp(p); - var fiU = f === undefined; - return !tiRE && piRE && p.constructor === $RegExp && fiU ? p - : inheritIfRequired(CORRECT_NEW - ? new Base(piRE && !fiU ? p.source : p, f) - : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f) - , tiRE ? this : proto, $RegExp); - }; - var proxy = function (key) { - key in $RegExp || dP($RegExp, key, { - configurable: true, - get: function () { return Base[key]; }, - set: function (it) { Base[key] = it; } - }); - }; - for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]); - proto.constructor = $RegExp; - $RegExp.prototype = proto; - __webpack_require__(15)(global, 'RegExp', $RegExp); -} - -__webpack_require__(41)('RegExp'); - - -/***/ }), -/* 228 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -__webpack_require__(110); -var anObject = __webpack_require__(1); -var $flags = __webpack_require__(58); -var DESCRIPTORS = __webpack_require__(7); -var TO_STRING = 'toString'; -var $toString = /./[TO_STRING]; - -var define = function (fn) { - __webpack_require__(15)(RegExp.prototype, TO_STRING, fn, true); -}; - -// 21.2.5.14 RegExp.prototype.toString() -if (__webpack_require__(4)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) { - define(function toString() { - var R = anObject(this); - return '/'.concat(R.source, '/', - 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined); - }); -// FF44- RegExp#toString has a wrong name -} else if ($toString.name != TO_STRING) { - define(function toString() { - return $toString.call(this); - }); -} - - -/***/ }), -/* 229 */ -/***/ (function(module, exports, __webpack_require__) { - -// @@match logic -__webpack_require__(59)('match', 1, function (defined, MATCH, $match) { - // 21.1.3.11 String.prototype.match(regexp) - return [function match(regexp) { - 'use strict'; - var O = defined(this); - var fn = regexp == undefined ? undefined : regexp[MATCH]; - return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); - }, $match]; -}); - - -/***/ }), -/* 230 */ -/***/ (function(module, exports, __webpack_require__) { - -// @@replace logic -__webpack_require__(59)('replace', 2, function (defined, REPLACE, $replace) { - // 21.1.3.14 String.prototype.replace(searchValue, replaceValue) - return [function replace(searchValue, replaceValue) { - 'use strict'; - var O = defined(this); - var fn = searchValue == undefined ? undefined : searchValue[REPLACE]; - return fn !== undefined - ? fn.call(searchValue, O, replaceValue) - : $replace.call(String(O), searchValue, replaceValue); - }, $replace]; -}); - - -/***/ }), -/* 231 */ -/***/ (function(module, exports, __webpack_require__) { - -// @@search logic -__webpack_require__(59)('search', 1, function (defined, SEARCH, $search) { - // 21.1.3.15 String.prototype.search(regexp) - return [function search(regexp) { - 'use strict'; - var O = defined(this); - var fn = regexp == undefined ? undefined : regexp[SEARCH]; - return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); - }, $search]; -}); - - -/***/ }), -/* 232 */ -/***/ (function(module, exports, __webpack_require__) { - -// @@split logic -__webpack_require__(59)('split', 2, function (defined, SPLIT, $split) { - 'use strict'; - var isRegExp = __webpack_require__(54); - var _split = $split; - var $push = [].push; - var $SPLIT = 'split'; - var LENGTH = 'length'; - var LAST_INDEX = 'lastIndex'; - if ( - 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || - 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || - 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || - '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || - '.'[$SPLIT](/()()/)[LENGTH] > 1 || - ''[$SPLIT](/.?/)[LENGTH] - ) { - var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group - // based on es5-shim implementation, need to rework it - $split = function (separator, limit) { - var string = String(this); - if (separator === undefined && limit === 0) return []; - // If `separator` is not a regex, use native split - if (!isRegExp(separator)) return _split.call(string, separator, limit); - var output = []; - var flags = (separator.ignoreCase ? 'i' : '') + - (separator.multiline ? 'm' : '') + - (separator.unicode ? 'u' : '') + - (separator.sticky ? 'y' : ''); - var lastLastIndex = 0; - var splitLimit = limit === undefined ? 4294967295 : limit >>> 0; - // Make `global` and avoid `lastIndex` issues by working with a copy - var separatorCopy = new RegExp(separator.source, flags + 'g'); - var separator2, match, lastIndex, lastLength, i; - // Doesn't need flags gy, but they don't hurt - if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags); - while (match = separatorCopy.exec(string)) { - // `separatorCopy.lastIndex` is not reliable cross-browser - lastIndex = match.index + match[0][LENGTH]; - if (lastIndex > lastLastIndex) { - output.push(string.slice(lastLastIndex, match.index)); - // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG - // eslint-disable-next-line no-loop-func - if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () { - for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined; - }); - if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1)); - lastLength = match[0][LENGTH]; - lastLastIndex = lastIndex; - if (output[LENGTH] >= splitLimit) break; - } - if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop - } - if (lastLastIndex === string[LENGTH]) { - if (lastLength || !separatorCopy.test('')) output.push(''); - } else output.push(string.slice(lastLastIndex)); - return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; - }; - // Chakra, V8 - } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) { - $split = function (separator, limit) { - return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit); - }; - } - // 21.1.3.17 String.prototype.split(separator, limit) - return [function split(separator, limit) { - var O = defined(this); - var fn = separator == undefined ? undefined : separator[SPLIT]; - return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit); - }, $split]; -}); - - -/***/ }), -/* 233 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var LIBRARY = __webpack_require__(33); -var global = __webpack_require__(2); -var ctx = __webpack_require__(19); -var classof = __webpack_require__(39); -var $export = __webpack_require__(0); -var isObject = __webpack_require__(3); -var aFunction = __webpack_require__(10); -var anInstance = __webpack_require__(42); -var forOf = __webpack_require__(35); -var speciesConstructor = __webpack_require__(60); -var task = __webpack_require__(89).set; -var microtask = __webpack_require__(90)(); -var newPromiseCapabilityModule = __webpack_require__(91); -var perform = __webpack_require__(111); -var userAgent = __webpack_require__(61); -var promiseResolve = __webpack_require__(112); -var PROMISE = 'Promise'; -var TypeError = global.TypeError; -var process = global.process; -var versions = process && process.versions; -var v8 = versions && versions.v8 || ''; -var $Promise = global[PROMISE]; -var isNode = classof(process) == 'process'; -var empty = function () { /* empty */ }; -var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; -var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; - -var USE_NATIVE = !!function () { - try { - // correct subclassing with @@species support - var promise = $Promise.resolve(1); - var FakePromise = (promise.constructor = {})[__webpack_require__(5)('species')] = function (exec) { - exec(empty, empty); - }; - // unhandled rejections tracking support, NodeJS Promise without it fails @@species test - return (isNode || typeof PromiseRejectionEvent == 'function') - && promise.then(empty) instanceof FakePromise - // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables - // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 - // we can't detect it synchronously, so just check versions - && v8.indexOf('6.6') !== 0 - && userAgent.indexOf('Chrome/66') === -1; - } catch (e) { /* empty */ } -}(); - -// helpers -var isThenable = function (it) { - var then; - return isObject(it) && typeof (then = it.then) == 'function' ? then : false; -}; -var notify = function (promise, isReject) { - if (promise._n) return; - promise._n = true; - var chain = promise._c; - microtask(function () { - var value = promise._v; - var ok = promise._s == 1; - var i = 0; - var run = function (reaction) { - var handler = ok ? reaction.ok : reaction.fail; - var resolve = reaction.resolve; - var reject = reaction.reject; - var domain = reaction.domain; - var result, then, exited; - try { - if (handler) { - if (!ok) { - if (promise._h == 2) onHandleUnhandled(promise); - promise._h = 1; - } - if (handler === true) result = value; - else { - if (domain) domain.enter(); - result = handler(value); // may throw - if (domain) { - domain.exit(); - exited = true; - } - } - if (result === reaction.promise) { - reject(TypeError('Promise-chain cycle')); - } else if (then = isThenable(result)) { - then.call(result, resolve, reject); - } else resolve(result); - } else reject(value); - } catch (e) { - if (domain && !exited) domain.exit(); - reject(e); - } - }; - while (chain.length > i) run(chain[i++]); // variable length - can't use forEach - promise._c = []; - promise._n = false; - if (isReject && !promise._h) onUnhandled(promise); - }); -}; -var onUnhandled = function (promise) { - task.call(global, function () { - var value = promise._v; - var unhandled = isUnhandled(promise); - var result, handler, console; - if (unhandled) { - result = perform(function () { - if (isNode) { - process.emit('unhandledRejection', value, promise); - } else if (handler = global.onunhandledrejection) { - handler({ promise: promise, reason: value }); - } else if ((console = global.console) && console.error) { - console.error('Unhandled promise rejection', value); - } - }); - // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should - promise._h = isNode || isUnhandled(promise) ? 2 : 1; - } promise._a = undefined; - if (unhandled && result.e) throw result.v; - }); -}; -var isUnhandled = function (promise) { - return promise._h !== 1 && (promise._a || promise._c).length === 0; -}; -var onHandleUnhandled = function (promise) { - task.call(global, function () { - var handler; - if (isNode) { - process.emit('rejectionHandled', promise); - } else if (handler = global.onrejectionhandled) { - handler({ promise: promise, reason: promise._v }); - } - }); -}; -var $reject = function (value) { - var promise = this; - if (promise._d) return; - promise._d = true; - promise = promise._w || promise; // unwrap - promise._v = value; - promise._s = 2; - if (!promise._a) promise._a = promise._c.slice(); - notify(promise, true); -}; -var $resolve = function (value) { - var promise = this; - var then; - if (promise._d) return; - promise._d = true; - promise = promise._w || promise; // unwrap - try { - if (promise === value) throw TypeError("Promise can't be resolved itself"); - if (then = isThenable(value)) { - microtask(function () { - var wrapper = { _w: promise, _d: false }; // wrap - try { - then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); - } catch (e) { - $reject.call(wrapper, e); - } - }); - } else { - promise._v = value; - promise._s = 1; - notify(promise, false); - } - } catch (e) { - $reject.call({ _w: promise, _d: false }, e); // wrap - } -}; - -// constructor polyfill -if (!USE_NATIVE) { - // 25.4.3.1 Promise(executor) - $Promise = function Promise(executor) { - anInstance(this, $Promise, PROMISE, '_h'); - aFunction(executor); - Internal.call(this); - try { - executor(ctx($resolve, this, 1), ctx($reject, this, 1)); - } catch (err) { - $reject.call(this, err); - } - }; - // eslint-disable-next-line no-unused-vars - Internal = function Promise(executor) { - this._c = []; // <- awaiting reactions - this._a = undefined; // <- checked in isUnhandled reactions - this._s = 0; // <- state - this._d = false; // <- done - this._v = undefined; // <- value - this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled - this._n = false; // <- notify - }; - Internal.prototype = __webpack_require__(43)($Promise.prototype, { - // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) - then: function then(onFulfilled, onRejected) { - var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); - reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; - reaction.fail = typeof onRejected == 'function' && onRejected; - reaction.domain = isNode ? process.domain : undefined; - this._c.push(reaction); - if (this._a) this._a.push(reaction); - if (this._s) notify(this, false); - return reaction.promise; - }, - // 25.4.5.1 Promise.prototype.catch(onRejected) - 'catch': function (onRejected) { - return this.then(undefined, onRejected); - } - }); - OwnPromiseCapability = function () { - var promise = new Internal(); - this.promise = promise; - this.resolve = ctx($resolve, promise, 1); - this.reject = ctx($reject, promise, 1); - }; - newPromiseCapabilityModule.f = newPromiseCapability = function (C) { - return C === $Promise || C === Wrapper - ? new OwnPromiseCapability(C) - : newGenericPromiseCapability(C); - }; -} - -$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); -__webpack_require__(44)($Promise, PROMISE); -__webpack_require__(41)(PROMISE); -Wrapper = __webpack_require__(13)[PROMISE]; - -// statics -$export($export.S + $export.F * !USE_NATIVE, PROMISE, { - // 25.4.4.5 Promise.reject(r) - reject: function reject(r) { - var capability = newPromiseCapability(this); - var $$reject = capability.reject; - $$reject(r); - return capability.promise; - } -}); -$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { - // 25.4.4.6 Promise.resolve(x) - resolve: function resolve(x) { - return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); - } -}); -$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(57)(function (iter) { - $Promise.all(iter)['catch'](empty); -})), PROMISE, { - // 25.4.4.1 Promise.all(iterable) - all: function all(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var resolve = capability.resolve; - var reject = capability.reject; - var result = perform(function () { - var values = []; - var index = 0; - var remaining = 1; - forOf(iterable, false, function (promise) { - var $index = index++; - var alreadyCalled = false; - values.push(undefined); - remaining++; - C.resolve(promise).then(function (value) { - if (alreadyCalled) return; - alreadyCalled = true; - values[$index] = value; - --remaining || resolve(values); - }, reject); - }); - --remaining || resolve(values); - }); - if (result.e) reject(result.v); - return capability.promise; - }, - // 25.4.4.4 Promise.race(iterable) - race: function race(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var reject = capability.reject; - var result = perform(function () { - forOf(iterable, false, function (promise) { - C.resolve(promise).then(capability.resolve, reject); - }); - }); - if (result.e) reject(result.v); - return capability.promise; - } -}); - - -/***/ }), -/* 234 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var weak = __webpack_require__(117); -var validate = __webpack_require__(46); -var WEAK_SET = 'WeakSet'; - -// 23.4 WeakSet Objects -__webpack_require__(62)(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); - - -/***/ }), -/* 235 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.1 Reflect.apply(target, thisArgument, argumentsList) -var $export = __webpack_require__(0); -var aFunction = __webpack_require__(10); -var anObject = __webpack_require__(1); -var rApply = (__webpack_require__(2).Reflect || {}).apply; -var fApply = Function.apply; -// MS Edge argumentsList argument is optional -$export($export.S + $export.F * !__webpack_require__(4)(function () { - rApply(function () { /* empty */ }); -}), 'Reflect', { - apply: function apply(target, thisArgument, argumentsList) { - var T = aFunction(target); - var L = anObject(argumentsList); - return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); - } -}); - - -/***/ }), -/* 236 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) -var $export = __webpack_require__(0); -var create = __webpack_require__(28); -var aFunction = __webpack_require__(10); -var anObject = __webpack_require__(1); -var isObject = __webpack_require__(3); -var fails = __webpack_require__(4); -var bind = __webpack_require__(100); -var rConstruct = (__webpack_require__(2).Reflect || {}).construct; - -// MS Edge supports only 2 arguments and argumentsList argument is optional -// FF Nightly sets third argument as `new.target`, but does not create `this` from it -var NEW_TARGET_BUG = fails(function () { - function F() { /* empty */ } - return !(rConstruct(function () { /* empty */ }, [], F) instanceof F); -}); -var ARGS_BUG = !fails(function () { - rConstruct(function () { /* empty */ }); -}); - -$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { - construct: function construct(Target, args /* , newTarget */) { - aFunction(Target); - anObject(args); - var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); - if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget); - if (Target == newTarget) { - // w/o altered newTarget, optimization for 0-4 arguments - switch (args.length) { - case 0: return new Target(); - case 1: return new Target(args[0]); - case 2: return new Target(args[0], args[1]); - case 3: return new Target(args[0], args[1], args[2]); - case 4: return new Target(args[0], args[1], args[2], args[3]); - } - // w/o altered newTarget, lot of arguments case - var $args = [null]; - $args.push.apply($args, args); - return new (bind.apply(Target, $args))(); - } - // with altered newTarget, not support built-in constructors - var proto = newTarget.prototype; - var instance = create(isObject(proto) ? proto : Object.prototype); - var result = Function.apply.call(Target, instance, args); - return isObject(result) ? result : instance; - } -}); - - -/***/ }), -/* 237 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) -var dP = __webpack_require__(6); -var $export = __webpack_require__(0); -var anObject = __webpack_require__(1); -var toPrimitive = __webpack_require__(22); - -// MS Edge has broken Reflect.defineProperty - throwing instead of returning false -$export($export.S + $export.F * __webpack_require__(4)(function () { - // eslint-disable-next-line no-undef - Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 }); -}), 'Reflect', { - defineProperty: function defineProperty(target, propertyKey, attributes) { - anObject(target); - propertyKey = toPrimitive(propertyKey, true); - anObject(attributes); - try { - dP.f(target, propertyKey, attributes); - return true; - } catch (e) { - return false; - } - } -}); - - -/***/ }), -/* 238 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.4 Reflect.deleteProperty(target, propertyKey) -var $export = __webpack_require__(0); -var gOPD = __webpack_require__(16).f; -var anObject = __webpack_require__(1); - -$export($export.S, 'Reflect', { - deleteProperty: function deleteProperty(target, propertyKey) { - var desc = gOPD(anObject(target), propertyKey); - return desc && !desc.configurable ? false : delete target[propertyKey]; - } -}); - - -/***/ }), -/* 239 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 26.1.5 Reflect.enumerate(target) -var $export = __webpack_require__(0); -var anObject = __webpack_require__(1); -var Enumerate = function (iterated) { - this._t = anObject(iterated); // target - this._i = 0; // next index - var keys = this._k = []; // keys - var key; - for (key in iterated) keys.push(key); -}; -__webpack_require__(56)(Enumerate, 'Object', function () { - var that = this; - var keys = that._k; - var key; - do { - if (that._i >= keys.length) return { value: undefined, done: true }; - } while (!((key = keys[that._i++]) in that._t)); - return { value: key, done: false }; -}); - -$export($export.S, 'Reflect', { - enumerate: function enumerate(target) { - return new Enumerate(target); - } -}); - - -/***/ }), -/* 240 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.6 Reflect.get(target, propertyKey [, receiver]) -var gOPD = __webpack_require__(16); -var getPrototypeOf = __webpack_require__(17); -var has = __webpack_require__(12); -var $export = __webpack_require__(0); -var isObject = __webpack_require__(3); -var anObject = __webpack_require__(1); - -function get(target, propertyKey /* , receiver */) { - var receiver = arguments.length < 3 ? target : arguments[2]; - var desc, proto; - if (anObject(target) === receiver) return target[propertyKey]; - if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value') - ? desc.value - : desc.get !== undefined - ? desc.get.call(receiver) - : undefined; - if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver); -} - -$export($export.S, 'Reflect', { get: get }); - - -/***/ }), -/* 241 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) -var gOPD = __webpack_require__(16); -var $export = __webpack_require__(0); -var anObject = __webpack_require__(1); - -$export($export.S, 'Reflect', { - getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { - return gOPD.f(anObject(target), propertyKey); - } -}); - - -/***/ }), -/* 242 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.8 Reflect.getPrototypeOf(target) -var $export = __webpack_require__(0); -var getProto = __webpack_require__(17); -var anObject = __webpack_require__(1); - -$export($export.S, 'Reflect', { - getPrototypeOf: function getPrototypeOf(target) { - return getProto(anObject(target)); - } -}); - - -/***/ }), -/* 243 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.9 Reflect.has(target, propertyKey) -var $export = __webpack_require__(0); - -$export($export.S, 'Reflect', { - has: function has(target, propertyKey) { - return propertyKey in target; - } -}); - - -/***/ }), -/* 244 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.10 Reflect.isExtensible(target) -var $export = __webpack_require__(0); -var anObject = __webpack_require__(1); -var $isExtensible = Object.isExtensible; - -$export($export.S, 'Reflect', { - isExtensible: function isExtensible(target) { - anObject(target); - return $isExtensible ? $isExtensible(target) : true; - } -}); - - -/***/ }), -/* 245 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.11 Reflect.ownKeys(target) -var $export = __webpack_require__(0); - -$export($export.S, 'Reflect', { ownKeys: __webpack_require__(92) }); - - -/***/ }), -/* 246 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.12 Reflect.preventExtensions(target) -var $export = __webpack_require__(0); -var anObject = __webpack_require__(1); -var $preventExtensions = Object.preventExtensions; - -$export($export.S, 'Reflect', { - preventExtensions: function preventExtensions(target) { - anObject(target); - try { - if ($preventExtensions) $preventExtensions(target); - return true; - } catch (e) { - return false; - } - } -}); - - -/***/ }), -/* 247 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) -var dP = __webpack_require__(6); -var gOPD = __webpack_require__(16); -var getPrototypeOf = __webpack_require__(17); -var has = __webpack_require__(12); -var $export = __webpack_require__(0); -var createDesc = __webpack_require__(31); -var anObject = __webpack_require__(1); -var isObject = __webpack_require__(3); - -function set(target, propertyKey, V /* , receiver */) { - var receiver = arguments.length < 4 ? target : arguments[3]; - var ownDesc = gOPD.f(anObject(target), propertyKey); - var existingDescriptor, proto; - if (!ownDesc) { - if (isObject(proto = getPrototypeOf(target))) { - return set(proto, propertyKey, V, receiver); - } - ownDesc = createDesc(0); - } - if (has(ownDesc, 'value')) { - if (ownDesc.writable === false || !isObject(receiver)) return false; - if (existingDescriptor = gOPD.f(receiver, propertyKey)) { - if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false; - existingDescriptor.value = V; - dP.f(receiver, propertyKey, existingDescriptor); - } else dP.f(receiver, propertyKey, createDesc(0, V)); - return true; - } - return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); -} - -$export($export.S, 'Reflect', { set: set }); - - -/***/ }), -/* 248 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.14 Reflect.setPrototypeOf(target, proto) -var $export = __webpack_require__(0); -var setProto = __webpack_require__(73); - -if (setProto) $export($export.S, 'Reflect', { - setPrototypeOf: function setPrototypeOf(target, proto) { - setProto.check(target, proto); - try { - setProto.set(target, proto); - return true; - } catch (e) { - return false; - } - } -}); - - -/***/ }), -/* 249 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.3.3.1 / 15.9.4.4 Date.now() -var $export = __webpack_require__(0); - -$export($export.S, 'Date', { now: function () { return new Date().getTime(); } }); - - -/***/ }), -/* 250 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var toObject = __webpack_require__(9); -var toPrimitive = __webpack_require__(22); - -$export($export.P + $export.F * __webpack_require__(4)(function () { - return new Date(NaN).toJSON() !== null - || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; -}), 'Date', { - // eslint-disable-next-line no-unused-vars - toJSON: function toJSON(key) { - var O = toObject(this); - var pv = toPrimitive(O); - return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); - } -}); - - -/***/ }), -/* 251 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() -var $export = __webpack_require__(0); -var toISOString = __webpack_require__(252); - -// PhantomJS / old WebKit has a broken implementations -$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', { - toISOString: toISOString -}); - - -/***/ }), -/* 252 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() -var fails = __webpack_require__(4); -var getTime = Date.prototype.getTime; -var $toISOString = Date.prototype.toISOString; - -var lz = function (num) { - return num > 9 ? num : '0' + num; -}; - -// PhantomJS / old WebKit has a broken implementations -module.exports = (fails(function () { - return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; -}) || !fails(function () { - $toISOString.call(new Date(NaN)); -})) ? function toISOString() { - if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value'); - var d = this; - var y = d.getUTCFullYear(); - var m = d.getUTCMilliseconds(); - var s = y < 0 ? '-' : y > 9999 ? '+' : ''; - return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + - '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + - 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + - ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; -} : $toISOString; - - -/***/ }), -/* 253 */ -/***/ (function(module, exports, __webpack_require__) { - -var DateProto = Date.prototype; -var INVALID_DATE = 'Invalid Date'; -var TO_STRING = 'toString'; -var $toString = DateProto[TO_STRING]; -var getTime = DateProto.getTime; -if (new Date(NaN) + '' != INVALID_DATE) { - __webpack_require__(15)(DateProto, TO_STRING, function toString() { - var value = getTime.call(this); - // eslint-disable-next-line no-self-compare - return value === value ? $toString.call(this) : INVALID_DATE; - }); -} - - -/***/ }), -/* 254 */ -/***/ (function(module, exports, __webpack_require__) { - -var TO_PRIMITIVE = __webpack_require__(5)('toPrimitive'); -var proto = Date.prototype; - -if (!(TO_PRIMITIVE in proto)) __webpack_require__(14)(proto, TO_PRIMITIVE, __webpack_require__(255)); - - -/***/ }), -/* 255 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var anObject = __webpack_require__(1); -var toPrimitive = __webpack_require__(22); -var NUMBER = 'number'; - -module.exports = function (hint) { - if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint'); - return toPrimitive(anObject(this), hint != NUMBER); -}; - - -/***/ }), -/* 256 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $typed = __webpack_require__(63); -var buffer = __webpack_require__(93); -var anObject = __webpack_require__(1); -var toAbsoluteIndex = __webpack_require__(37); -var toLength = __webpack_require__(8); -var isObject = __webpack_require__(3); -var ArrayBuffer = __webpack_require__(2).ArrayBuffer; -var speciesConstructor = __webpack_require__(60); -var $ArrayBuffer = buffer.ArrayBuffer; -var $DataView = buffer.DataView; -var $isView = $typed.ABV && ArrayBuffer.isView; -var $slice = $ArrayBuffer.prototype.slice; -var VIEW = $typed.VIEW; -var ARRAY_BUFFER = 'ArrayBuffer'; - -$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer }); - -$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { - // 24.1.3.1 ArrayBuffer.isView(arg) - isView: function isView(it) { - return $isView && $isView(it) || isObject(it) && VIEW in it; - } -}); - -$export($export.P + $export.U + $export.F * __webpack_require__(4)(function () { - return !new $ArrayBuffer(2).slice(1, undefined).byteLength; -}), ARRAY_BUFFER, { - // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) - slice: function slice(start, end) { - if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix - var len = anObject(this).byteLength; - var first = toAbsoluteIndex(start, len); - var fin = toAbsoluteIndex(end === undefined ? len : end, len); - var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first)); - var viewS = new $DataView(this); - var viewT = new $DataView(result); - var index = 0; - while (first < fin) { - viewT.setUint8(index++, viewS.getUint8(first++)); - } return result; - } -}); - -__webpack_require__(41)(ARRAY_BUFFER); - - -/***/ }), -/* 257 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -$export($export.G + $export.W + $export.F * !__webpack_require__(63).ABV, { - DataView: __webpack_require__(93).DataView -}); - - -/***/ }), -/* 258 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(29)('Int8', 1, function (init) { - return function Int8Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 259 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(29)('Uint8', 1, function (init) { - return function Uint8Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 260 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(29)('Uint8', 1, function (init) { - return function Uint8ClampedArray(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}, true); - - -/***/ }), -/* 261 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(29)('Int16', 2, function (init) { - return function Int16Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 262 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(29)('Uint16', 2, function (init) { - return function Uint16Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 263 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(29)('Int32', 4, function (init) { - return function Int32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 264 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(29)('Uint32', 4, function (init) { - return function Uint32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 265 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(29)('Float32', 4, function (init) { - return function Float32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 266 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(29)('Float64', 8, function (init) { - return function Float64Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 267 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/tc39/Array.prototype.includes -var $export = __webpack_require__(0); -var $includes = __webpack_require__(51)(true); - -$export($export.P, 'Array', { - includes: function includes(el /* , fromIndex = 0 */) { - return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); - } -}); - -__webpack_require__(34)('includes'); - - -/***/ }), -/* 268 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap -var $export = __webpack_require__(0); -var flattenIntoArray = __webpack_require__(119); -var toObject = __webpack_require__(9); -var toLength = __webpack_require__(8); -var aFunction = __webpack_require__(10); -var arraySpeciesCreate = __webpack_require__(85); - -$export($export.P, 'Array', { - flatMap: function flatMap(callbackfn /* , thisArg */) { - var O = toObject(this); - var sourceLen, A; - aFunction(callbackfn); - sourceLen = toLength(O.length); - A = arraySpeciesCreate(O, 0); - flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]); - return A; - } -}); - -__webpack_require__(34)('flatMap'); - - -/***/ }), -/* 269 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten -var $export = __webpack_require__(0); -var flattenIntoArray = __webpack_require__(119); -var toObject = __webpack_require__(9); -var toLength = __webpack_require__(8); -var toInteger = __webpack_require__(24); -var arraySpeciesCreate = __webpack_require__(85); - -$export($export.P, 'Array', { - flatten: function flatten(/* depthArg = 1 */) { - var depthArg = arguments[0]; - var O = toObject(this); - var sourceLen = toLength(O.length); - var A = arraySpeciesCreate(O, 0); - flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg)); - return A; - } -}); - -__webpack_require__(34)('flatten'); - - -/***/ }), -/* 270 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/mathiasbynens/String.prototype.at -var $export = __webpack_require__(0); -var $at = __webpack_require__(80)(true); - -$export($export.P, 'String', { - at: function at(pos) { - return $at(this, pos); - } -}); - - -/***/ }), -/* 271 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/tc39/proposal-string-pad-start-end -var $export = __webpack_require__(0); -var $pad = __webpack_require__(120); -var userAgent = __webpack_require__(61); - -// https://github.com/zloirock/core-js/issues/280 -$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { - padStart: function padStart(maxLength /* , fillString = ' ' */) { - return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); - } -}); - - -/***/ }), -/* 272 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/tc39/proposal-string-pad-start-end -var $export = __webpack_require__(0); -var $pad = __webpack_require__(120); -var userAgent = __webpack_require__(61); - -// https://github.com/zloirock/core-js/issues/280 -$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { - padEnd: function padEnd(maxLength /* , fillString = ' ' */) { - return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); - } -}); - - -/***/ }), -/* 273 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/sebmarkbage/ecmascript-string-left-right-trim -__webpack_require__(45)('trimLeft', function ($trim) { - return function trimLeft() { - return $trim(this, 1); - }; -}, 'trimStart'); - - -/***/ }), -/* 274 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/sebmarkbage/ecmascript-string-left-right-trim -__webpack_require__(45)('trimRight', function ($trim) { - return function trimRight() { - return $trim(this, 2); - }; -}, 'trimEnd'); - - -/***/ }), -/* 275 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://tc39.github.io/String.prototype.matchAll/ -var $export = __webpack_require__(0); -var defined = __webpack_require__(23); -var toLength = __webpack_require__(8); -var isRegExp = __webpack_require__(54); -var getFlags = __webpack_require__(58); -var RegExpProto = RegExp.prototype; - -var $RegExpStringIterator = function (regexp, string) { - this._r = regexp; - this._s = string; -}; - -__webpack_require__(56)($RegExpStringIterator, 'RegExp String', function next() { - var match = this._r.exec(this._s); - return { value: match, done: match === null }; -}); - -$export($export.P, 'String', { - matchAll: function matchAll(regexp) { - defined(this); - if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!'); - var S = String(this); - var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp); - var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags); - rx.lastIndex = toLength(regexp.lastIndex); - return new $RegExpStringIterator(rx, S); - } -}); - - -/***/ }), -/* 276 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(68)('asyncIterator'); - - -/***/ }), -/* 277 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(68)('observable'); - - -/***/ }), -/* 278 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/tc39/proposal-object-getownpropertydescriptors -var $export = __webpack_require__(0); -var ownKeys = __webpack_require__(92); -var toIObject = __webpack_require__(11); -var gOPD = __webpack_require__(16); -var createProperty = __webpack_require__(84); - -$export($export.S, 'Object', { - getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { - var O = toIObject(object); - var getDesc = gOPD.f; - var keys = ownKeys(O); - var result = {}; - var i = 0; - var key, desc; - while (keys.length > i) { - desc = getDesc(O, key = keys[i++]); - if (desc !== undefined) createProperty(result, key, desc); - } - return result; - } -}); - - -/***/ }), -/* 279 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/tc39/proposal-object-values-entries -var $export = __webpack_require__(0); -var $values = __webpack_require__(121)(false); - -$export($export.S, 'Object', { - values: function values(it) { - return $values(it); - } -}); - - -/***/ }), -/* 280 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/tc39/proposal-object-values-entries -var $export = __webpack_require__(0); -var $entries = __webpack_require__(121)(true); - -$export($export.S, 'Object', { - entries: function entries(it) { - return $entries(it); - } -}); - - -/***/ }), -/* 281 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var toObject = __webpack_require__(9); -var aFunction = __webpack_require__(10); -var $defineProperty = __webpack_require__(6); - -// B.2.2.2 Object.prototype.__defineGetter__(P, getter) -__webpack_require__(7) && $export($export.P + __webpack_require__(64), 'Object', { - __defineGetter__: function __defineGetter__(P, getter) { - $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true }); - } -}); - - -/***/ }), -/* 282 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var toObject = __webpack_require__(9); -var aFunction = __webpack_require__(10); -var $defineProperty = __webpack_require__(6); - -// B.2.2.3 Object.prototype.__defineSetter__(P, setter) -__webpack_require__(7) && $export($export.P + __webpack_require__(64), 'Object', { - __defineSetter__: function __defineSetter__(P, setter) { - $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true }); - } -}); - - -/***/ }), -/* 283 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var toObject = __webpack_require__(9); -var toPrimitive = __webpack_require__(22); -var getPrototypeOf = __webpack_require__(17); -var getOwnPropertyDescriptor = __webpack_require__(16).f; - -// B.2.2.4 Object.prototype.__lookupGetter__(P) -__webpack_require__(7) && $export($export.P + __webpack_require__(64), 'Object', { - __lookupGetter__: function __lookupGetter__(P) { - var O = toObject(this); - var K = toPrimitive(P, true); - var D; - do { - if (D = getOwnPropertyDescriptor(O, K)) return D.get; - } while (O = getPrototypeOf(O)); - } -}); - - -/***/ }), -/* 284 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var toObject = __webpack_require__(9); -var toPrimitive = __webpack_require__(22); -var getPrototypeOf = __webpack_require__(17); -var getOwnPropertyDescriptor = __webpack_require__(16).f; - -// B.2.2.5 Object.prototype.__lookupSetter__(P) -__webpack_require__(7) && $export($export.P + __webpack_require__(64), 'Object', { - __lookupSetter__: function __lookupSetter__(P) { - var O = toObject(this); - var K = toPrimitive(P, true); - var D; - do { - if (D = getOwnPropertyDescriptor(O, K)) return D.set; - } while (O = getPrototypeOf(O)); - } -}); - - -/***/ }), -/* 285 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/DavidBruant/Map-Set.prototype.toJSON -var $export = __webpack_require__(0); - -$export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(122)('Map') }); - - -/***/ }), -/* 286 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/DavidBruant/Map-Set.prototype.toJSON -var $export = __webpack_require__(0); - -$export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(122)('Set') }); - - -/***/ }), -/* 287 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of -__webpack_require__(65)('Map'); - - -/***/ }), -/* 288 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of -__webpack_require__(65)('Set'); - - -/***/ }), -/* 289 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of -__webpack_require__(65)('WeakMap'); - - -/***/ }), -/* 290 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of -__webpack_require__(65)('WeakSet'); - - -/***/ }), -/* 291 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from -__webpack_require__(66)('Map'); - - -/***/ }), -/* 292 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from -__webpack_require__(66)('Set'); - - -/***/ }), -/* 293 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from -__webpack_require__(66)('WeakMap'); - - -/***/ }), -/* 294 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from -__webpack_require__(66)('WeakSet'); - - -/***/ }), -/* 295 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/tc39/proposal-global -var $export = __webpack_require__(0); - -$export($export.G, { global: __webpack_require__(2) }); - - -/***/ }), -/* 296 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/tc39/proposal-global -var $export = __webpack_require__(0); - -$export($export.S, 'System', { global: __webpack_require__(2) }); - - -/***/ }), -/* 297 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/ljharb/proposal-is-error -var $export = __webpack_require__(0); -var cof = __webpack_require__(20); - -$export($export.S, 'Error', { - isError: function isError(it) { - return cof(it) === 'Error'; - } -}); - - -/***/ }), -/* 298 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - clamp: function clamp(x, lower, upper) { - return Math.min(upper, Math.max(lower, x)); - } -}); - - -/***/ }), -/* 299 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 }); - - -/***/ }), -/* 300 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __webpack_require__(0); -var RAD_PER_DEG = 180 / Math.PI; - -$export($export.S, 'Math', { - degrees: function degrees(radians) { - return radians * RAD_PER_DEG; - } -}); - - -/***/ }), -/* 301 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __webpack_require__(0); -var scale = __webpack_require__(124); -var fround = __webpack_require__(106); - -$export($export.S, 'Math', { - fscale: function fscale(x, inLow, inHigh, outLow, outHigh) { - return fround(scale(x, inLow, inHigh, outLow, outHigh)); - } -}); - - -/***/ }), -/* 302 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - iaddh: function iaddh(x0, x1, y0, y1) { - var $x0 = x0 >>> 0; - var $x1 = x1 >>> 0; - var $y0 = y0 >>> 0; - return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; - } -}); - - -/***/ }), -/* 303 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - isubh: function isubh(x0, x1, y0, y1) { - var $x0 = x0 >>> 0; - var $x1 = x1 >>> 0; - var $y0 = y0 >>> 0; - return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; - } -}); - - -/***/ }), -/* 304 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - imulh: function imulh(u, v) { - var UINT16 = 0xffff; - var $u = +u; - var $v = +v; - var u0 = $u & UINT16; - var v0 = $v & UINT16; - var u1 = $u >> 16; - var v1 = $v >> 16; - var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); - return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); - } -}); - - -/***/ }), -/* 305 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI }); - - -/***/ }), -/* 306 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __webpack_require__(0); -var DEG_PER_RAD = Math.PI / 180; - -$export($export.S, 'Math', { - radians: function radians(degrees) { - return degrees * DEG_PER_RAD; - } -}); - - -/***/ }), -/* 307 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { scale: __webpack_require__(124) }); - - -/***/ }), -/* 308 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - umulh: function umulh(u, v) { - var UINT16 = 0xffff; - var $u = +u; - var $v = +v; - var u0 = $u & UINT16; - var v0 = $v & UINT16; - var u1 = $u >>> 16; - var v1 = $v >>> 16; - var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); - return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); - } -}); - - -/***/ }), -/* 309 */ -/***/ (function(module, exports, __webpack_require__) { - -// http://jfbastien.github.io/papers/Math.signbit.html -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { signbit: function signbit(x) { - // eslint-disable-next-line no-self-compare - return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0; -} }); - - -/***/ }), -/* 310 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// https://github.com/tc39/proposal-promise-finally - -var $export = __webpack_require__(0); -var core = __webpack_require__(13); -var global = __webpack_require__(2); -var speciesConstructor = __webpack_require__(60); -var promiseResolve = __webpack_require__(112); - -$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { - var C = speciesConstructor(this, core.Promise || global.Promise); - var isFunction = typeof onFinally == 'function'; - return this.then( - isFunction ? function (x) { - return promiseResolve(C, onFinally()).then(function () { return x; }); - } : onFinally, - isFunction ? function (e) { - return promiseResolve(C, onFinally()).then(function () { throw e; }); - } : onFinally - ); -} }); - - -/***/ }), -/* 311 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/tc39/proposal-promise-try -var $export = __webpack_require__(0); -var newPromiseCapability = __webpack_require__(91); -var perform = __webpack_require__(111); - -$export($export.S, 'Promise', { 'try': function (callbackfn) { - var promiseCapability = newPromiseCapability.f(this); - var result = perform(callbackfn); - (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); - return promiseCapability.promise; -} }); - - -/***/ }), -/* 312 */ -/***/ (function(module, exports, __webpack_require__) { - -var metadata = __webpack_require__(30); -var anObject = __webpack_require__(1); -var toMetaKey = metadata.key; -var ordinaryDefineOwnMetadata = metadata.set; - -metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) { - ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); -} }); - - -/***/ }), -/* 313 */ -/***/ (function(module, exports, __webpack_require__) { - -var metadata = __webpack_require__(30); -var anObject = __webpack_require__(1); -var toMetaKey = metadata.key; -var getOrCreateMetadataMap = metadata.map; -var store = metadata.store; - -metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) { - var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]); - var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); - if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false; - if (metadataMap.size) return true; - var targetMetadata = store.get(target); - targetMetadata['delete'](targetKey); - return !!targetMetadata.size || store['delete'](target); -} }); - - -/***/ }), -/* 314 */ -/***/ (function(module, exports, __webpack_require__) { - -var metadata = __webpack_require__(30); -var anObject = __webpack_require__(1); -var getPrototypeOf = __webpack_require__(17); -var ordinaryHasOwnMetadata = metadata.has; -var ordinaryGetOwnMetadata = metadata.get; -var toMetaKey = metadata.key; - -var ordinaryGetMetadata = function (MetadataKey, O, P) { - var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); - if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P); - var parent = getPrototypeOf(O); - return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; -}; - -metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) { - return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); - - -/***/ }), -/* 315 */ -/***/ (function(module, exports, __webpack_require__) { - -var Set = __webpack_require__(115); -var from = __webpack_require__(123); -var metadata = __webpack_require__(30); -var anObject = __webpack_require__(1); -var getPrototypeOf = __webpack_require__(17); -var ordinaryOwnMetadataKeys = metadata.keys; -var toMetaKey = metadata.key; - -var ordinaryMetadataKeys = function (O, P) { - var oKeys = ordinaryOwnMetadataKeys(O, P); - var parent = getPrototypeOf(O); - if (parent === null) return oKeys; - var pKeys = ordinaryMetadataKeys(parent, P); - return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys; -}; - -metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) { - return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); -} }); - - -/***/ }), -/* 316 */ -/***/ (function(module, exports, __webpack_require__) { - -var metadata = __webpack_require__(30); -var anObject = __webpack_require__(1); -var ordinaryGetOwnMetadata = metadata.get; -var toMetaKey = metadata.key; - -metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) { - return ordinaryGetOwnMetadata(metadataKey, anObject(target) - , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); - - -/***/ }), -/* 317 */ -/***/ (function(module, exports, __webpack_require__) { - -var metadata = __webpack_require__(30); -var anObject = __webpack_require__(1); -var ordinaryOwnMetadataKeys = metadata.keys; -var toMetaKey = metadata.key; - -metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) { - return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); -} }); - - -/***/ }), -/* 318 */ -/***/ (function(module, exports, __webpack_require__) { - -var metadata = __webpack_require__(30); -var anObject = __webpack_require__(1); -var getPrototypeOf = __webpack_require__(17); -var ordinaryHasOwnMetadata = metadata.has; -var toMetaKey = metadata.key; - -var ordinaryHasMetadata = function (MetadataKey, O, P) { - var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); - if (hasOwn) return true; - var parent = getPrototypeOf(O); - return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; -}; - -metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) { - return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); - - -/***/ }), -/* 319 */ -/***/ (function(module, exports, __webpack_require__) { - -var metadata = __webpack_require__(30); -var anObject = __webpack_require__(1); -var ordinaryHasOwnMetadata = metadata.has; -var toMetaKey = metadata.key; - -metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) { - return ordinaryHasOwnMetadata(metadataKey, anObject(target) - , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); - - -/***/ }), -/* 320 */ -/***/ (function(module, exports, __webpack_require__) { - -var $metadata = __webpack_require__(30); -var anObject = __webpack_require__(1); -var aFunction = __webpack_require__(10); -var toMetaKey = $metadata.key; -var ordinaryDefineOwnMetadata = $metadata.set; - -$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) { - return function decorator(target, targetKey) { - ordinaryDefineOwnMetadata( - metadataKey, metadataValue, - (targetKey !== undefined ? anObject : aFunction)(target), - toMetaKey(targetKey) - ); - }; -} }); - - -/***/ }), -/* 321 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask -var $export = __webpack_require__(0); -var microtask = __webpack_require__(90)(); -var process = __webpack_require__(2).process; -var isNode = __webpack_require__(20)(process) == 'process'; - -$export($export.G, { - asap: function asap(fn) { - var domain = isNode && process.domain; - microtask(domain ? domain.bind(fn) : fn); - } -}); - - -/***/ }), -/* 322 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/zenparsing/es-observable -var $export = __webpack_require__(0); -var global = __webpack_require__(2); -var core = __webpack_require__(13); -var microtask = __webpack_require__(90)(); -var OBSERVABLE = __webpack_require__(5)('observable'); -var aFunction = __webpack_require__(10); -var anObject = __webpack_require__(1); -var anInstance = __webpack_require__(42); -var redefineAll = __webpack_require__(43); -var hide = __webpack_require__(14); -var forOf = __webpack_require__(35); -var RETURN = forOf.RETURN; - -var getMethod = function (fn) { - return fn == null ? undefined : aFunction(fn); -}; - -var cleanupSubscription = function (subscription) { - var cleanup = subscription._c; - if (cleanup) { - subscription._c = undefined; - cleanup(); - } -}; - -var subscriptionClosed = function (subscription) { - return subscription._o === undefined; -}; - -var closeSubscription = function (subscription) { - if (!subscriptionClosed(subscription)) { - subscription._o = undefined; - cleanupSubscription(subscription); - } -}; - -var Subscription = function (observer, subscriber) { - anObject(observer); - this._c = undefined; - this._o = observer; - observer = new SubscriptionObserver(this); - try { - var cleanup = subscriber(observer); - var subscription = cleanup; - if (cleanup != null) { - if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); }; - else aFunction(cleanup); - this._c = cleanup; - } - } catch (e) { - observer.error(e); - return; - } if (subscriptionClosed(this)) cleanupSubscription(this); -}; - -Subscription.prototype = redefineAll({}, { - unsubscribe: function unsubscribe() { closeSubscription(this); } -}); - -var SubscriptionObserver = function (subscription) { - this._s = subscription; -}; - -SubscriptionObserver.prototype = redefineAll({}, { - next: function next(value) { - var subscription = this._s; - if (!subscriptionClosed(subscription)) { - var observer = subscription._o; - try { - var m = getMethod(observer.next); - if (m) return m.call(observer, value); - } catch (e) { - try { - closeSubscription(subscription); - } finally { - throw e; - } - } - } - }, - error: function error(value) { - var subscription = this._s; - if (subscriptionClosed(subscription)) throw value; - var observer = subscription._o; - subscription._o = undefined; - try { - var m = getMethod(observer.error); - if (!m) throw value; - value = m.call(observer, value); - } catch (e) { - try { - cleanupSubscription(subscription); - } finally { - throw e; - } - } cleanupSubscription(subscription); - return value; - }, - complete: function complete(value) { - var subscription = this._s; - if (!subscriptionClosed(subscription)) { - var observer = subscription._o; - subscription._o = undefined; - try { - var m = getMethod(observer.complete); - value = m ? m.call(observer, value) : undefined; - } catch (e) { - try { - cleanupSubscription(subscription); - } finally { - throw e; - } - } cleanupSubscription(subscription); - return value; - } - } -}); - -var $Observable = function Observable(subscriber) { - anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber); -}; - -redefineAll($Observable.prototype, { - subscribe: function subscribe(observer) { - return new Subscription(observer, this._f); - }, - forEach: function forEach(fn) { - var that = this; - return new (core.Promise || global.Promise)(function (resolve, reject) { - aFunction(fn); - var subscription = that.subscribe({ - next: function (value) { - try { - return fn(value); - } catch (e) { - reject(e); - subscription.unsubscribe(); - } - }, - error: reject, - complete: resolve - }); - }); - } -}); - -redefineAll($Observable, { - from: function from(x) { - var C = typeof this === 'function' ? this : $Observable; - var method = getMethod(anObject(x)[OBSERVABLE]); - if (method) { - var observable = anObject(method.call(x)); - return observable.constructor === C ? observable : new C(function (observer) { - return observable.subscribe(observer); - }); - } - return new C(function (observer) { - var done = false; - microtask(function () { - if (!done) { - try { - if (forOf(x, false, function (it) { - observer.next(it); - if (done) return RETURN; - }) === RETURN) return; - } catch (e) { - if (done) throw e; - observer.error(e); - return; - } observer.complete(); - } - }); - return function () { done = true; }; - }); - }, - of: function of() { - for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++]; - return new (typeof this === 'function' ? this : $Observable)(function (observer) { - var done = false; - microtask(function () { - if (!done) { - for (var j = 0; j < items.length; ++j) { - observer.next(items[j]); - if (done) return; - } observer.complete(); - } - }); - return function () { done = true; }; - }); - } -}); - -hide($Observable.prototype, OBSERVABLE, function () { return this; }); - -$export($export.G, { Observable: $Observable }); - -__webpack_require__(41)('Observable'); - - -/***/ }), -/* 323 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var $task = __webpack_require__(89); -$export($export.G + $export.B, { - setImmediate: $task.set, - clearImmediate: $task.clear -}); - - -/***/ }), -/* 324 */ -/***/ (function(module, exports, __webpack_require__) { - -var $iterators = __webpack_require__(87); -var getKeys = __webpack_require__(27); -var redefine = __webpack_require__(15); -var global = __webpack_require__(2); -var hide = __webpack_require__(14); -var Iterators = __webpack_require__(40); -var wks = __webpack_require__(5); -var ITERATOR = wks('iterator'); -var TO_STRING_TAG = wks('toStringTag'); -var ArrayValues = Iterators.Array; - -var DOMIterables = { - CSSRuleList: true, // TODO: Not spec compliant, should be false. - CSSStyleDeclaration: false, - CSSValueList: false, - ClientRectList: false, - DOMRectList: false, - DOMStringList: false, - DOMTokenList: true, - DataTransferItemList: false, - FileList: false, - HTMLAllCollection: false, - HTMLCollection: false, - HTMLFormElement: false, - HTMLSelectElement: false, - MediaList: true, // TODO: Not spec compliant, should be false. - MimeTypeArray: false, - NamedNodeMap: false, - NodeList: true, - PaintRequestList: false, - Plugin: false, - PluginArray: false, - SVGLengthList: false, - SVGNumberList: false, - SVGPathSegList: false, - SVGPointList: false, - SVGStringList: false, - SVGTransformList: false, - SourceBufferList: false, - StyleSheetList: true, // TODO: Not spec compliant, should be false. - TextTrackCueList: false, - TextTrackList: false, - TouchList: false -}; - -for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) { - var NAME = collections[i]; - var explicit = DOMIterables[NAME]; - var Collection = global[NAME]; - var proto = Collection && Collection.prototype; - var key; - if (proto) { - if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues); - if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); - Iterators[NAME] = ArrayValues; - if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true); - } -} - - -/***/ }), -/* 325 */ -/***/ (function(module, exports, __webpack_require__) { - -// ie9- setTimeout & setInterval additional parameters fix -var global = __webpack_require__(2); -var $export = __webpack_require__(0); -var userAgent = __webpack_require__(61); -var slice = [].slice; -var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check -var wrap = function (set) { - return function (fn, time /* , ...args */) { - var boundArgs = arguments.length > 2; - var args = boundArgs ? slice.call(arguments, 2) : false; - return set(boundArgs ? function () { - // eslint-disable-next-line no-new-func - (typeof fn == 'function' ? fn : Function(fn)).apply(this, args); - } : fn, time); - }; -}; -$export($export.G + $export.B + $export.F * MSIE, { - setTimeout: wrap(global.setTimeout), - setInterval: wrap(global.setInterval) -}); - - -/***/ }), -/* 326 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var ctx = __webpack_require__(19); -var $export = __webpack_require__(0); -var createDesc = __webpack_require__(31); -var assign = __webpack_require__(72); -var create = __webpack_require__(28); -var getPrototypeOf = __webpack_require__(17); -var getKeys = __webpack_require__(27); -var dP = __webpack_require__(6); -var keyOf = __webpack_require__(327); -var aFunction = __webpack_require__(10); -var forOf = __webpack_require__(35); -var isIterable = __webpack_require__(125); -var $iterCreate = __webpack_require__(56); -var step = __webpack_require__(88); -var isObject = __webpack_require__(3); -var toIObject = __webpack_require__(11); -var DESCRIPTORS = __webpack_require__(7); -var has = __webpack_require__(12); - -// 0 -> Dict.forEach -// 1 -> Dict.map -// 2 -> Dict.filter -// 3 -> Dict.some -// 4 -> Dict.every -// 5 -> Dict.find -// 6 -> Dict.findKey -// 7 -> Dict.mapPairs -var createDictMethod = function (TYPE) { - var IS_MAP = TYPE == 1; - var IS_EVERY = TYPE == 4; - return function (object, callbackfn, that /* = undefined */) { - var f = ctx(callbackfn, that, 3); - var O = toIObject(object); - var result = IS_MAP || TYPE == 7 || TYPE == 2 - ? new (typeof this == 'function' ? this : Dict)() : undefined; - var key, val, res; - for (key in O) if (has(O, key)) { - val = O[key]; - res = f(val, key, object); - if (TYPE) { - if (IS_MAP) result[key] = res; // map - else if (res) switch (TYPE) { - case 2: result[key] = val; break; // filter - case 3: return true; // some - case 5: return val; // find - case 6: return key; // findKey - case 7: result[res[0]] = res[1]; // mapPairs - } else if (IS_EVERY) return false; // every - } - } - return TYPE == 3 || IS_EVERY ? IS_EVERY : result; - }; -}; -var findKey = createDictMethod(6); - -var createDictIter = function (kind) { - return function (it) { - return new DictIterator(it, kind); - }; -}; -var DictIterator = function (iterated, kind) { - this._t = toIObject(iterated); // target - this._a = getKeys(iterated); // keys - this._i = 0; // next index - this._k = kind; // kind -}; -$iterCreate(DictIterator, 'Dict', function () { - var that = this; - var O = that._t; - var keys = that._a; - var kind = that._k; - var key; - do { - if (that._i >= keys.length) { - that._t = undefined; - return step(1); - } - } while (!has(O, key = keys[that._i++])); - if (kind == 'keys') return step(0, key); - if (kind == 'values') return step(0, O[key]); - return step(0, [key, O[key]]); -}); - -function Dict(iterable) { - var dict = create(null); - if (iterable != undefined) { - if (isIterable(iterable)) { - forOf(iterable, true, function (key, value) { - dict[key] = value; - }); - } else assign(dict, iterable); - } - return dict; -} -Dict.prototype = null; - -function reduce(object, mapfn, init) { - aFunction(mapfn); - var O = toIObject(object); - var keys = getKeys(O); - var length = keys.length; - var i = 0; - var memo, key; - if (arguments.length < 3) { - if (!length) throw TypeError('Reduce of empty object with no initial value'); - memo = O[keys[i++]]; - } else memo = Object(init); - while (length > i) if (has(O, key = keys[i++])) { - memo = mapfn(memo, O[key], key, object); - } - return memo; -} - -function includes(object, el) { - // eslint-disable-next-line no-self-compare - return (el == el ? keyOf(object, el) : findKey(object, function (it) { - // eslint-disable-next-line no-self-compare - return it != it; - })) !== undefined; -} - -function get(object, key) { - if (has(object, key)) return object[key]; -} -function set(object, key, value) { - if (DESCRIPTORS && key in Object) dP.f(object, key, createDesc(0, value)); - else object[key] = value; - return object; -} - -function isDict(it) { - return isObject(it) && getPrototypeOf(it) === Dict.prototype; -} - -$export($export.G + $export.F, { Dict: Dict }); - -$export($export.S, 'Dict', { - keys: createDictIter('keys'), - values: createDictIter('values'), - entries: createDictIter('entries'), - forEach: createDictMethod(0), - map: createDictMethod(1), - filter: createDictMethod(2), - some: createDictMethod(3), - every: createDictMethod(4), - find: createDictMethod(5), - findKey: findKey, - mapPairs: createDictMethod(7), - reduce: reduce, - keyOf: keyOf, - includes: includes, - has: has, - get: get, - set: set, - isDict: isDict -}); - - -/***/ }), -/* 327 */ -/***/ (function(module, exports, __webpack_require__) { - -var getKeys = __webpack_require__(27); -var toIObject = __webpack_require__(11); -module.exports = function (object, el) { - var O = toIObject(object); - var keys = getKeys(O); - var length = keys.length; - var index = 0; - var key; - while (length > index) if (O[key = keys[index++]] === el) return key; -}; - - -/***/ }), -/* 328 */ -/***/ (function(module, exports, __webpack_require__) { - -var anObject = __webpack_require__(1); -var get = __webpack_require__(49); -module.exports = __webpack_require__(13).getIterator = function (it) { - var iterFn = get(it); - if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!'); - return anObject(iterFn.call(it)); -}; - - -/***/ }), -/* 329 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(2); -var core = __webpack_require__(13); -var $export = __webpack_require__(0); -var partial = __webpack_require__(126); -// https://esdiscuss.org/topic/promise-returning-delay-function -$export($export.G + $export.F, { - delay: function delay(time) { - return new (core.Promise || global.Promise)(function (resolve) { - setTimeout(partial.call(resolve, true), time); - }); - } -}); - - -/***/ }), -/* 330 */ -/***/ (function(module, exports, __webpack_require__) { - -var path = __webpack_require__(127); -var $export = __webpack_require__(0); - -// Placeholder -__webpack_require__(13)._ = path._ = path._ || {}; - -$export($export.P + $export.F, 'Function', { part: __webpack_require__(126) }); - - -/***/ }), -/* 331 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); - -$export($export.S + $export.F, 'Object', { isObject: __webpack_require__(3) }); - - -/***/ }), -/* 332 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); - -$export($export.S + $export.F, 'Object', { classof: __webpack_require__(39) }); - - -/***/ }), -/* 333 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var define = __webpack_require__(128); - -$export($export.S + $export.F, 'Object', { define: define }); - - -/***/ }), -/* 334 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var define = __webpack_require__(128); -var create = __webpack_require__(28); - -$export($export.S + $export.F, 'Object', { - make: function (proto, mixin) { - return define(create(proto), mixin); - } -}); - - -/***/ }), -/* 335 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -__webpack_require__(55)(Number, 'Number', function (iterated) { - this._l = +iterated; - this._i = 0; -}, function () { - var i = this._i++; - var done = !(i < this._l); - return { done: done, value: done ? undefined : i }; -}); - - -/***/ }), -/* 336 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/benjamingr/RexExp.escape -var $export = __webpack_require__(0); -var $re = __webpack_require__(94)(/[\\^$*+?.()|[\]{}]/g, '\\$&'); - -$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } }); - - -/***/ }), -/* 337 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $re = __webpack_require__(94)(/[&<>"']/g, { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' -}); - -$export($export.P + $export.F, 'String', { escapeHTML: function escapeHTML() { return $re(this); } }); - - -/***/ }), -/* 338 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $re = __webpack_require__(94)(/&(?:amp|lt|gt|quot|apos);/g, { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'" -}); - -$export($export.P + $export.F, 'String', { unescapeHTML: function unescapeHTML() { return $re(this); } }); - - -/***/ }) -/******/ ]); -// CommonJS export -if (typeof module != 'undefined' && module.exports) module.exports = __e; -// RequireJS export -else if (typeof define == 'function' && define.amd) define(function () { return __e; }); -// Export to global object -else __g.core = __e; -}(1, 1); \ No newline at end of file diff --git a/node_modules/core-js/client/core.min.js b/node_modules/core-js/client/core.min.js deleted file mode 100644 index eb4d971f1..000000000 --- a/node_modules/core-js/client/core.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * core-js 2.5.7 - * https://github.com/zloirock/core-js - * License: http://rock.mit-license.org - * © 2018 Denis Pushkarev - */ -!function(e,i,Jt){"use strict";!function(r){var e={};function __webpack_require__(t){if(e[t])return e[t].exports;var n=e[t]={i:t,l:!1,exports:{}};return r[t].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}__webpack_require__.m=r,__webpack_require__.c=e,__webpack_require__.d=function(t,n,r){__webpack_require__.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},__webpack_require__.n=function(t){var n=t&&t.__esModule?function getDefault(){return t["default"]}:function getModuleExports(){return t};return __webpack_require__.d(n,"a",n),n},__webpack_require__.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=129)}([function(t,n,r){var v=r(2),g=r(13),y=r(14),d=r(15),_=r(19),b="prototype",S=function(t,n,r){var e,i,o,u,c=t&S.F,f=t&S.G,a=t&S.P,s=t&S.B,l=f?v:t&S.S?v[n]||(v[n]={}):(v[n]||{})[b],h=f?g:g[n]||(g[n]={}),p=h[b]||(h[b]={});for(e in f&&(r=n),r)o=((i=!c&&l&&l[e]!==Jt)?l:r)[e],u=s&&i?_(o,v):a&&"function"==typeof o?_(Function.call,o):o,l&&d(l,e,o,t&S.U),h[e]!=o&&y(h,e,u),a&&p[e]!=o&&(p[e]=o)};v.core=g,S.F=1,S.G=2,S.S=4,S.P=8,S.B=16,S.W=32,S.U=64,S.R=128,t.exports=S},function(t,n,r){var e=r(3);t.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof i&&(i=r)},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},function(t,n,r){var e=r(50)("wks"),i=r(36),o=r(2).Symbol,u="function"==typeof o;(t.exports=function(t){return e[t]||(e[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=e},function(t,n,r){var i=r(1),o=r(95),u=r(22),c=Object.defineProperty;n.f=r(7)?Object.defineProperty:function defineProperty(t,n,r){if(i(t),n=u(n,!0),i(r),o)try{return c(t,n,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[n]=r.value),t}},function(t,n,r){t.exports=!r(4)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n,r){var e=r(24),i=Math.min;t.exports=function(t){return 0"+i+""};t.exports=function(n,t){var r={};r[n]=t(o),e(e.P+e.F*i(function(){var t=""[n]('"');return t!==t.toLowerCase()||3document.F=Object<\/script>"),t.close(),s=t.F;r--;)delete s[a][u[r]];return s()};t.exports=Object.create||function create(t,n){var r;return null!==t?(f[a]=i(t),r=new f,f[a]=null,r[c]=t):r=s(),n===Jt?r:o(r,n)}},function(t,n,r){if(r(7)){var y=r(33),d=r(2),_=r(4),b=r(0),S=r(63),e=r(93),h=r(19),m=r(42),i=r(31),x=r(14),o=r(43),u=r(24),w=r(8),E=r(118),c=r(37),f=r(22),a=r(12),O=r(39),P=r(3),p=r(9),v=r(83),M=r(28),F=r(17),I=r(38).f,g=r(49),s=r(36),l=r(5),A=r(26),k=r(51),j=r(60),N=r(87),T=r(40),R=r(57),D=r(41),L=r(86),C=r(109),U=r(6),W=r(16),G=U.f,V=W.f,B=d.RangeError,q=d.TypeError,z=d.Uint8Array,K="ArrayBuffer",J="Shared"+K,H="BYTES_PER_ELEMENT",Y="prototype",X=Array[Y],$=e.ArrayBuffer,Z=e.DataView,Q=A(0),tt=A(2),nt=A(3),rt=A(4),et=A(5),it=A(6),ot=k(!0),ut=k(!1),ct=N.values,ft=N.keys,at=N.entries,st=X.lastIndexOf,lt=X.reduce,ht=X.reduceRight,pt=X.join,vt=X.sort,gt=X.slice,yt=X.toString,dt=X.toLocaleString,_t=l("iterator"),bt=l("toStringTag"),St=s("typed_constructor"),mt=s("def_constructor"),xt=S.CONSTR,wt=S.TYPED,Et=S.VIEW,Ot="Wrong length!",Pt=A(1,function(t,n){return kt(j(t,t[mt]),n)}),Mt=_(function(){return 1===new z(new Uint16Array([1]).buffer)[0]}),Ft=!!z&&!!z[Y].set&&_(function(){new z(1).set({})}),It=function(t,n){var r=u(t);if(r<0||r%n)throw B("Wrong offset!");return r},At=function(t){if(P(t)&&wt in t)return t;throw q(t+" is not a typed array!")},kt=function(t,n){if(!(P(t)&&St in t))throw q("It is not a typed array constructor!");return new t(n)},jt=function(t,n){return Nt(j(t,t[mt]),n)},Nt=function(t,n){for(var r=0,e=n.length,i=kt(t,e);r>>=1)&&(n+=n))1&e&&(r+=n);return r}},function(t,n){t.exports=Math.sign||function sign(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,n){var r=Math.expm1;t.exports=!r||22025.465794806718>1,s=23===n?I(2,-24)-I(2,-77):0,l=0,h=t<0||0===t&&1/t<0?1:0;for((t=F(t))!=t||t===P?(i=t!=t?1:0,e=f):(e=A(k(t)/j),t*(o=I(2,-e))<1&&(e--,o*=2),2<=(t+=1<=e+a?s/o:s*I(2,1-a))*o&&(e++,o/=2),f<=e+a?(i=0,e=f):1<=e+a?(i=(t*o-1)*I(2,n),e+=a):(i=t*I(2,a-1)*I(2,n),e=0));8<=n;u[l++]=255&i,i/=256,n-=8);for(e=e<>1,c=i-7,f=r-1,a=t[f--],s=127&a;for(a>>=7;0>=-c,c+=n;0>8&255]}function packI32(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function packF64(t){return packIEEE754(t,52,8)}function packF32(t){return packIEEE754(t,23,4)}function addGetter(t,n,r){g(t[S],n,{get:function(){return this[r]}})}function get(t,n,r,e){var i=p(+r);if(t[D]>24)},setUint8:function setUint8(t,n){B.call(this,t,n<<24>>24)}},!0)}else x=function ArrayBuffer(t){s(this,x,_);var n=p(t);this._b=y.call(new Array(n),0),this[D]=n},w=function DataView(t,n,r){s(this,w,b),s(t,x,b);var e=t[D],i=l(n);if(i<0||e>24},getUint8:function getUint8(t){return get(this,1,t)[0]},getInt16:function getInt16(t){var n=get(this,2,t,arguments[1]);return(n[1]<<8|n[0])<<16>>16},getUint16:function getUint16(t){var n=get(this,2,t,arguments[1]);return n[1]<<8|n[0]},getInt32:function getInt32(t){return unpackI32(get(this,4,t,arguments[1]))},getUint32:function getUint32(t){return unpackI32(get(this,4,t,arguments[1]))>>>0},getFloat32:function getFloat32(t){return unpackIEEE754(get(this,4,t,arguments[1]),23,4)},getFloat64:function getFloat64(t){return unpackIEEE754(get(this,8,t,arguments[1]),52,8)},setInt8:function setInt8(t,n){set(this,1,t,packI8,n)},setUint8:function setUint8(t,n){set(this,1,t,packI8,n)},setInt16:function setInt16(t,n){set(this,2,t,packI16,n,arguments[2])},setUint16:function setUint16(t,n){set(this,2,t,packI16,n,arguments[2])},setInt32:function setInt32(t,n){set(this,4,t,packI32,n,arguments[2])},setUint32:function setUint32(t,n){set(this,4,t,packI32,n,arguments[2])},setFloat32:function setFloat32(t,n){set(this,4,t,packF32,n,arguments[2])},setFloat64:function setFloat64(t,n){set(this,8,t,packF64,n,arguments[2])}});d(x,_),d(w,b),c(w[S],u.VIEW,!0),n[_]=x,n[b]=w},function(t,n){t.exports=function(n,r){var e=r===Object(r)?function(t){return r[t]}:r;return function(t){return String(t).replace(n,e)}}},function(t,n,r){t.exports=!r(7)&&!r(4)(function(){return 7!=Object.defineProperty(r(67)("div"),"a",{get:function(){return 7}}).a})},function(t,n,r){n.f=r(5)},function(t,n,r){var u=r(12),c=r(11),f=r(51)(!1),a=r(69)("IE_PROTO");t.exports=function(t,n){var r,e=c(t),i=0,o=[];for(r in e)r!=a&&u(e,r)&&o.push(r);for(;i>>0||(u.test(r)?16:10))}:e},function(t,n){t.exports=Math.log1p||function log1p(t){return-1e-8<(t=+t)&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,n,r){var o=r(78),e=Math.pow,u=e(2,-52),c=e(2,-23),f=e(2,127)*(2-c),a=e(2,-126);t.exports=Math.fround||function fround(t){var n,r,e=Math.abs(t),i=o(t);return e>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,n,r){var e=r(0),i=Math.exp;e(e.S,"Math",{cosh:function cosh(t){return(i(t=+t)+i(-t))/2}})},function(t,n,r){var e=r(0),i=r(79);e(e.S+e.F*(i!=Math.expm1),"Math",{expm1:i})},function(t,n,r){var e=r(0);e(e.S,"Math",{fround:r(106)})},function(t,n,r){var e=r(0),f=Math.abs;e(e.S,"Math",{hypot:function hypot(t,n){for(var r,e,i=0,o=0,u=arguments.length,c=0;o>>16)*u+o*(r&i>>>16)<<16>>>0)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{log10:function log10(t){return Math.log(t)*Math.LOG10E}})},function(t,n,r){var e=r(0);e(e.S,"Math",{log1p:r(105)})},function(t,n,r){var e=r(0);e(e.S,"Math",{log2:function log2(t){return Math.log(t)/Math.LN2}})},function(t,n,r){var e=r(0);e(e.S,"Math",{sign:r(78)})},function(t,n,r){var e=r(0),i=r(79),o=Math.exp;e(e.S+e.F*r(4)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function sinh(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},function(t,n,r){var e=r(0),i=r(79),o=Math.exp;e(e.S,"Math",{tanh:function tanh(t){var n=i(t=+t),r=i(-t);return n==Infinity?1:r==Infinity?-1:(n-r)/(o(t)+o(-t))}})},function(t,n,r){var e=r(0);e(e.S,"Math",{trunc:function trunc(t){return(0>10),n%1024+56320))}return r.join("")}})},function(t,n,r){var e=r(0),u=r(11),c=r(8);e(e.S,"String",{raw:function raw(t){for(var n=u(t.raw),r=c(n.length),e=arguments.length,i=[],o=0;o>>0,h=new RegExp(t.source,a+"g");for(_||(e=new RegExp("^"+h.source+"$(?!\\s)",a));(i=h.exec(r))&&!(s<(o=i.index+i[0][y])&&(f.push(r.slice(s,i.index)),!_&&1>>0,o=r>>>0;return(n>>>0)+(e>>>0)+((i&o|(i|o)&~(i+o>>>0))>>>31)|0}})},function(t,n,r){var e=r(0);e(e.S,"Math",{isubh:function isubh(t,n,r,e){var i=t>>>0,o=r>>>0;return(n>>>0)-(e>>>0)-((~i&o|~(i^o)&i-o>>>0)>>>31)|0}})},function(t,n,r){var e=r(0);e(e.S,"Math",{imulh:function imulh(t,n){var r=+t,e=+n,i=65535&r,o=65535&e,u=r>>16,c=e>>16,f=(u*o>>>0)+(i*o>>>16);return u*c+(f>>16)+((i*c>>>0)+(65535&f)>>16)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{RAD_PER_DEG:180/Math.PI})},function(t,n,r){var e=r(0),i=Math.PI/180;e(e.S,"Math",{radians:function radians(t){return t*i}})},function(t,n,r){var e=r(0);e(e.S,"Math",{scale:r(124)})},function(t,n,r){var e=r(0);e(e.S,"Math",{umulh:function umulh(t,n){var r=+t,e=+n,i=65535&r,o=65535&e,u=r>>>16,c=e>>>16,f=(u*o>>>0)+(i*o>>>16);return u*c+(f>>>16)+((i*c>>>0)+(65535&f)>>>16)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{signbit:function signbit(t){return(t=+t)!=t?t:0==t?1/t==Infinity:0"']/g,{"&":"&","<":"<",">":">",'"':""","'":"'"});e(e.P+e.F,"String",{escapeHTML:function escapeHTML(){return i(this)}})},function(t,n,r){var e=r(0),i=r(94)(/&(?:amp|lt|gt|quot|apos);/g,{"&":"&","<":"<",">":">",""":'"',"'":"'"});e(e.P+e.F,"String",{unescapeHTML:function unescapeHTML(){return i(this)}})}]),"undefined"!=typeof module&&module.exports?module.exports=e:"function"==typeof define&&define.amd?define(function(){return e}):i.core=e}(1,1); -//# sourceMappingURL=core.min.js.map \ No newline at end of file diff --git a/node_modules/core-js/client/core.min.js.map b/node_modules/core-js/client/core.min.js.map deleted file mode 100644 index 3d7880299..000000000 --- a/node_modules/core-js/client/core.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["core.js"],"names":["__e","__g","undefined","modules","installedModules","__webpack_require__","moduleId","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","getDefault","getModuleExports","object","property","prototype","hasOwnProperty","p","s","global","core","hide","redefine","ctx","PROTOTYPE","$export","type","source","key","own","out","exp","IS_FORCED","F","IS_GLOBAL","G","IS_PROTO","P","IS_BIND","B","target","S","expProto","Function","U","W","R","isObject","it","TypeError","window","Math","self","exec","e","store","uid","Symbol","USE_SYMBOL","anObject","IE8_DOM_DEFINE","toPrimitive","dP","f","O","Attributes","value","a","toInteger","min","defined","IObject","version","createDesc","has","SRC","TO_STRING","$toString","TPL","split","inspectSource","val","safe","isFunction","join","String","toString","this","pIE","toIObject","gOPD","getOwnPropertyDescriptor","toObject","IE_PROTO","ObjectProto","getPrototypeOf","constructor","fails","quot","createHTML","string","tag","attribute","p1","replace","NAME","test","toLowerCase","length","aFunction","fn","that","b","apply","arguments","slice","method","arg","valueOf","ceil","floor","isNaN","KEY","toLength","asc","TYPE","$create","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","create","$this","callbackfn","res","index","result","push","$keys","enumBugKeys","keys","dPs","Empty","createDict","iframeDocument","iframe","style","display","appendChild","src","contentWindow","document","open","write","lt","close","Properties","LIBRARY","$typed","$buffer","anInstance","propertyDesc","redefineAll","toIndex","toAbsoluteIndex","classof","isArrayIter","gOPN","getIterFn","wks","createArrayMethod","createArrayIncludes","speciesConstructor","ArrayIterators","Iterators","$iterDetect","setSpecies","arrayFill","arrayCopyWithin","$DP","$GOPD","RangeError","Uint8Array","ARRAY_BUFFER","SHARED_BUFFER","BYTES_PER_ELEMENT","ArrayProto","Array","$ArrayBuffer","ArrayBuffer","$DataView","DataView","arrayForEach","arrayFilter","arraySome","arrayEvery","arrayFind","arrayFindIndex","arrayIncludes","arrayIndexOf","arrayValues","values","arrayKeys","arrayEntries","entries","arrayLastIndexOf","lastIndexOf","arrayReduce","reduce","arrayReduceRight","reduceRight","arrayJoin","arraySort","sort","arraySlice","arrayToString","arrayToLocaleString","toLocaleString","ITERATOR","TAG","TYPED_CONSTRUCTOR","DEF_CONSTRUCTOR","ALL_CONSTRUCTORS","CONSTR","TYPED_ARRAY","TYPED","VIEW","WRONG_LENGTH","$map","allocate","LITTLE_ENDIAN","Uint16Array","buffer","FORCED_SET","set","toOffset","BYTES","offset","validate","C","speciesFromList","list","fromList","addGetter","internal","_d","$from","from","step","iterator","aLen","mapfn","mapping","iterFn","next","done","$of","of","TO_LOCALE_BUG","$toLocaleString","proto","copyWithin","start","every","fill","filter","find","predicate","findIndex","forEach","indexOf","searchElement","includes","separator","map","reverse","middle","some","comparefn","subarray","begin","end","$begin","byteOffset","$slice","$set","arrayLike","len","$iterators","isTAIndex","$getDesc","$setDesc","desc","writable","$TypedArrayPrototype$","wrapper","CLAMPED","GETTER","SETTER","TypedArray","Base","TAC","TypedArrayPrototype","addElement","data","v","round","ABV","$offset","$length","byteLength","klass","$len","iter","concat","$nativeIterator","CORRECT_ITER_NAME","$iterator","Map","shared","getOrCreateMetadataMap","targetKey","targetMetadata","keyMetadata","MetadataKey","metadataMap","MetadataValue","_","bitmap","META","setDesc","id","isExtensible","FREEZE","preventExtensions","setMeta","w","meta","NEED","fastKey","getWeak","onFreeze","UNSCOPABLES","BREAK","RETURN","iterable","px","random","max","hiddenKeys","getOwnPropertyNames","cof","ARG","T","tryGet","callee","DESCRIPTORS","SPECIES","Constructor","forbiddenField","def","stat","spaces","space","ltrim","RegExp","rtrim","exporter","ALIAS","FORCE","trim","_t","propertyIsEnumerable","getIteratorMethod","SHARED","mode","copyright","IS_INCLUDES","el","fromIndex","getOwnPropertySymbols","isArray","MATCH","isRegExp","$iterCreate","setToStringTag","BUGGY","VALUES","returnThis","DEFAULT","IS_SET","FORCED","methods","IteratorPrototype","getMethod","kind","DEF_VALUES","VALUES_BUG","$native","$default","$entries","$anyNative","descriptor","SAFE_CLOSING","riter","skipClosing","arr","ignoreCase","multiline","unicode","sticky","SYMBOL","fns","strfn","rxfn","D","navigator","userAgent","forOf","inheritIfRequired","common","IS_WEAK","ADDER","fixMethod","add","instance","HASNT_CHAINING","THROWS_ON_PRIMITIVES","ACCEPT_ITERABLES","BUGGY_ZERO","$instance","clear","getConstructor","setStrong","Typed","TypedArrayConstructors","K","__defineSetter__","COLLECTION","A","cb","mapFn","nextItem","is","createElement","wksExt","$Symbol","charAt","documentElement","getKeys","gOPS","$assign","assign","k","getSymbols","isEnum","j","check","setPrototypeOf","buggy","__proto__","args","un","repeat","count","str","Infinity","sign","x","$expm1","expm1","pos","charCodeAt","searchString","re","$defineProperty","original","endPos","addToUnscopables","iterated","_i","_k","Arguments","defer","channel","port","invoke","html","cel","process","setTask","setImmediate","clearTask","clearImmediate","MessageChannel","Dispatch","counter","queue","ONREADYSTATECHANGE","run","listener","event","nextTick","now","port2","port1","onmessage","postMessage","addEventListener","importScripts","removeChild","setTimeout","macrotask","Observer","MutationObserver","WebKitMutationObserver","Promise","isNode","head","last","notify","flush","parent","domain","exit","enter","standalone","resolve","promise","then","toggle","node","createTextNode","observe","characterData","task","PromiseCapability","reject","$$resolve","$$reject","Reflect","ownKeys","DATA_VIEW","WRONG_INDEX","BaseBuffer","abs","pow","log","LN2","BYTE_LENGTH","BYTE_OFFSET","$BUFFER","$LENGTH","$OFFSET","packIEEE754","mLen","nBytes","eLen","eMax","eBias","rt","unpackIEEE754","nBits","NaN","unpackI32","bytes","packI8","packI16","packI32","packF64","packF32","view","isLittleEndian","intIndex","pack","_b","conversion","ArrayBufferProto","$setInt8","setInt8","getInt8","setUint8","bufferLength","getUint8","getInt16","getUint16","getInt32","getUint32","getFloat32","getFloat64","setInt16","setUint16","setInt32","setUint32","setFloat32","setFloat64","regExp","replacer","part","names","defineProperties","windowNames","getWindowNames","factories","bind","partArgs","bound","construct","msg","isInteger","isFinite","$parseFloat","parseFloat","$trim","$parseInt","parseInt","ws","hex","radix","log1p","EPSILON","EPSILON32","MAX32","MIN32","fround","$abs","$sign","ret","memo","isRight","to","inc","flags","newPromiseCapability","promiseCapability","strong","entry","getEntry","$iterDefine","SIZE","_f","_l","r","delete","prev","Set","InternalMap","each","weak","WEAK_MAP","uncaughtFrozenStore","ufstore","tmp","WeakMap","$WeakMap","freeze","$has","UncaughtFrozenStore","findUncaughtFrozen","splice","number","IS_CONCAT_SPREADABLE","flattenIntoArray","sourceLen","depth","mapper","thisArg","element","spreadable","targetIndex","sourceIndex","maxLength","fillString","left","stringLength","fillStr","intMaxLength","fillLen","stringFiller","isEntries","toJSON","scale","inLow","inHigh","outLow","outHigh","isIterable","path","pargs","holder","define","mixin","$fails","wksDefine","enumKeys","_create","gOPNExt","$JSON","JSON","_stringify","stringify","HIDDEN","TO_PRIMITIVE","SymbolRegistry","AllSymbols","OPSymbols","USE_NATIVE","QObject","setter","findChild","setSymbolDesc","protoDesc","wrap","sym","isSymbol","$defineProperties","$propertyIsEnumerable","E","$getOwnPropertyDescriptor","$getOwnPropertyNames","$getOwnPropertySymbols","IS_OP","es6Symbols","wellKnownSymbols","for","keyFor","useSetter","useSimple","$replacer","symbols","$getPrototypeOf","$freeze","$seal","seal","$preventExtensions","$isFrozen","isFrozen","$isSealed","isSealed","$isExtensible","y","FProto","nameRE","match","HAS_INSTANCE","FunctionProto","NUMBER","$Number","BROKEN_COF","TRIM","toNumber","argument","third","maxCode","first","code","digits","Number","aNumberValue","$toFixed","toFixed","ERROR","multiply","c2","divide","numToString","t","acc","fractionDigits","z","x2","$toPrecision","toPrecision","precision","_isFinite","isSafeInteger","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","sqrt","$acosh","acosh","MAX_VALUE","$asinh","asinh","$atanh","atanh","cbrt","clz32","LOG2E","cosh","hypot","value1","value2","div","sum","larg","$imul","imul","UINT16","xn","yn","xl","yl","log10","LOG10E","log2","sinh","tanh","trunc","fromCharCode","$fromCodePoint","fromCodePoint","raw","callSite","tpl","$at","codePointAt","context","ENDS_WITH","$endsWith","endsWith","endPosition","search","INCLUDES","STARTS_WITH","$startsWith","startsWith","point","anchor","big","blink","bold","fixed","fontcolor","color","fontsize","size","italics","link","url","small","strike","sub","sup","createProperty","upTo","cloned","$sort","$forEach","STRICT","$filter","$some","$every","$reduce","$indexOf","NEGATIVE_ZERO","$find","forced","$flags","$RegExp","re1","re2","CORRECT_NEW","tiRE","piRE","fiU","proxy","$match","regexp","REPLACE","$replace","searchValue","replaceValue","SEARCH","$search","SPLIT","$split","_split","$push","$SPLIT","LENGTH","LAST_INDEX","NPCG","limit","separator2","lastIndex","lastLength","output","lastLastIndex","splitLimit","separatorCopy","Internal","newGenericPromiseCapability","OwnPromiseCapability","Wrapper","microtask","newPromiseCapabilityModule","perform","promiseResolve","PROMISE","versions","v8","$Promise","empty","FakePromise","PromiseRejectionEvent","isThenable","isReject","_n","chain","_c","_v","ok","_s","reaction","exited","handler","fail","_h","onHandleUnhandled","onUnhandled","console","unhandled","isUnhandled","emit","onunhandledrejection","reason","error","_a","onrejectionhandled","$reject","_w","$resolve","executor","err","onFulfilled","onRejected","catch","capability","all","remaining","$index","alreadyCalled","race","WEAK_SET","WeakSet","rApply","fApply","thisArgument","argumentsList","L","rConstruct","NEW_TARGET_BUG","ARGS_BUG","Target","newTarget","$args","propertyKey","attributes","deleteProperty","Enumerate","enumerate","receiver","getProto","V","existingDescriptor","ownDesc","setProto","Date","getTime","toISOString","pv","$toISOString","lz","num","getUTCFullYear","getUTCMilliseconds","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","DateProto","INVALID_DATE","hint","$isView","isView","fin","viewS","viewT","init","Int8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint32Array","Float32Array","Float64Array","$includes","arraySpeciesCreate","flatMap","flatten","depthArg","at","$pad","padStart","padEnd","trimLeft","trimRight","getFlags","RegExpProto","$RegExpStringIterator","_r","matchAll","rx","getOwnPropertyDescriptors","getDesc","$values","__defineGetter__","__lookupGetter__","__lookupSetter__","isError","clamp","lower","upper","DEG_PER_RAD","PI","RAD_PER_DEG","degrees","radians","fscale","iaddh","x0","x1","y0","y1","$x0","$y0","isubh","imulh","u","$u","$v","u0","v0","u1","v1","umulh","signbit","finally","onFinally","try","metadata","toMetaKey","ordinaryDefineOwnMetadata","defineMetadata","metadataKey","metadataValue","deleteMetadata","ordinaryHasOwnMetadata","ordinaryGetOwnMetadata","ordinaryGetMetadata","getMetadata","ordinaryOwnMetadataKeys","ordinaryMetadataKeys","oKeys","pKeys","getMetadataKeys","getOwnMetadata","getOwnMetadataKeys","ordinaryHasMetadata","hasMetadata","hasOwnMetadata","$metadata","decorator","asap","OBSERVABLE","cleanupSubscription","subscription","cleanup","subscriptionClosed","_o","closeSubscription","Subscription","observer","subscriber","SubscriptionObserver","unsubscribe","complete","$Observable","Observable","subscribe","observable","items","$task","TO_STRING_TAG","ArrayValues","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","collections","explicit","Collection","MSIE","time","boundArgs","setInterval","keyOf","createDictMethod","Dict","findKey","createDictIter","DictIterator","dict","mapPairs","isDict","getIterator","partial","delay","make","$re","escape","&","<",">","\"","'","escapeHTML","&","<",">",""","'","unescapeHTML","amd"],"mappings":";;;;;;CAMC,SAASA,EAAKC,EAAKC,IACpB,cACS,SAAUC,GAET,IAAIC,EAAmB,GAGvB,SAASC,oBAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAJ,EAAQG,GAAUK,KAAKH,EAAOD,QAASC,EAAQA,EAAOD,QAASF,qBAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,oBAAoBO,EAAIT,EAGxBE,oBAAoBQ,EAAIT,EAGxBC,oBAAoBS,EAAI,SAASP,EAASQ,EAAMC,GAC3CX,oBAAoBY,EAAEV,EAASQ,IAClCG,OAAOC,eAAeZ,EAASQ,EAAM,CACpCK,cAAc,EACdC,YAAY,EACZC,IAAKN,KAMRX,oBAAoBkB,EAAI,SAASf,GAChC,IAAIQ,EAASR,GAAUA,EAAOgB,WAC7B,SAASC,aAAe,OAAOjB,EAAgB,YAC/C,SAASkB,mBAAqB,OAAOlB,GAEtC,OADAH,oBAAoBS,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRX,oBAAoBY,EAAI,SAASU,EAAQC,GAAY,OAAOV,OAAOW,UAAUC,eAAenB,KAAKgB,EAAQC,IAGzGvB,oBAAoB0B,EAAI,GAGjB1B,oBAAoBA,oBAAoB2B,EAAI,KA9DpD,CAiEC,CAEJ,SAAUxB,EAAQD,EAASF,GAEjC,IAAI4B,EAAS5B,EAAoB,GAC7B6B,EAAO7B,EAAoB,IAC3B8B,EAAO9B,EAAoB,IAC3B+B,EAAW/B,EAAoB,IAC/BgC,EAAMhC,EAAoB,IAC1BiC,EAAY,YAEZC,EAAU,SAAUC,EAAMzB,EAAM0B,GAClC,IAQIC,EAAKC,EAAKC,EAAKC,EARfC,EAAYN,EAAOD,EAAQQ,EAC3BC,EAAYR,EAAOD,EAAQU,EAE3BC,EAAWV,EAAOD,EAAQY,EAC1BC,EAAUZ,EAAOD,EAAQc,EACzBC,EAASN,EAAYf,EAHTO,EAAOD,EAAQgB,EAGetB,EAAOlB,KAAUkB,EAAOlB,GAAQ,KAAOkB,EAAOlB,IAAS,IAAIuB,GACrG/B,EAAUyC,EAAYd,EAAOA,EAAKnB,KAAUmB,EAAKnB,GAAQ,IACzDyC,EAAWjD,EAAQ+B,KAAe/B,EAAQ+B,GAAa,IAG3D,IAAKI,KADDM,IAAWP,EAAS1B,GACZ0B,EAIVG,IAFAD,GAAOG,GAAaQ,GAAUA,EAAOZ,KAASxC,IAEjCoD,EAASb,GAAQC,GAE9BG,EAAMO,GAAWT,EAAMN,EAAIO,EAAKX,GAAUiB,GAA0B,mBAAPN,EAAoBP,EAAIoB,SAAS9C,KAAMiC,GAAOA,EAEvGU,GAAQlB,EAASkB,EAAQZ,EAAKE,EAAKJ,EAAOD,EAAQmB,GAElDnD,EAAQmC,IAAQE,GAAKT,EAAK5B,EAASmC,EAAKG,GACxCK,GAAYM,EAASd,IAAQE,IAAKY,EAASd,GAAOE,IAG1DX,EAAOC,KAAOA,EAEdK,EAAQQ,EAAI,EACZR,EAAQU,EAAI,EACZV,EAAQgB,EAAI,EACZhB,EAAQY,EAAI,EACZZ,EAAQc,EAAI,GACZd,EAAQoB,EAAI,GACZpB,EAAQmB,EAAI,GACZnB,EAAQqB,EAAI,IACZpD,EAAOD,QAAUgC,GAKX,SAAU/B,EAAQD,EAASF,GAEjC,IAAIwD,EAAWxD,EAAoB,GACnCG,EAAOD,QAAU,SAAUuD,GACzB,IAAKD,EAASC,GAAK,MAAMC,UAAUD,EAAK,sBACxC,OAAOA,IAMH,SAAUtD,EAAQD,GAGxB,IAAI0B,EAASzB,EAAOD,QAA2B,oBAAVyD,QAAyBA,OAAOC,MAAQA,KACzED,OAAwB,oBAARE,MAAuBA,KAAKD,MAAQA,KAAOC,KAE3DT,SAAS,cAATA,GACc,iBAAPxD,IAAiBA,EAAMgC,IAK5B,SAAUzB,EAAQD,GAExBC,EAAOD,QAAU,SAAUuD,GACzB,MAAqB,iBAAPA,EAAyB,OAAPA,EAA4B,mBAAPA,IAMjD,SAAUtD,EAAQD,GAExBC,EAAOD,QAAU,SAAU4D,GACzB,IACE,QAASA,IACT,MAAOC,GACP,OAAO,KAOL,SAAU5D,EAAQD,EAASF,GAEjC,IAAIgE,EAAQhE,EAAoB,GAApBA,CAAwB,OAChCiE,EAAMjE,EAAoB,IAC1BkE,EAASlE,EAAoB,GAAGkE,OAChCC,EAA8B,mBAAVD,GAET/D,EAAOD,QAAU,SAAUQ,GACxC,OAAOsD,EAAMtD,KAAUsD,EAAMtD,GAC3ByD,GAAcD,EAAOxD,KAAUyD,EAAaD,EAASD,GAAK,UAAYvD,MAGjEsD,MAAQA,GAKX,SAAU7D,EAAQD,EAASF,GAEjC,IAAIoE,EAAWpE,EAAoB,GAC/BqE,EAAiBrE,EAAoB,IACrCsE,EAActE,EAAoB,IAClCuE,EAAK1D,OAAOC,eAEhBZ,EAAQsE,EAAIxE,EAAoB,GAAKa,OAAOC,eAAiB,SAASA,eAAe2D,EAAG3B,EAAG4B,GAIzF,GAHAN,EAASK,GACT3B,EAAIwB,EAAYxB,GAAG,GACnBsB,EAASM,GACLL,EAAgB,IAClB,OAAOE,EAAGE,EAAG3B,EAAG4B,GAChB,MAAOX,IACT,GAAI,QAASW,GAAc,QAASA,EAAY,MAAMhB,UAAU,4BAEhE,MADI,UAAWgB,IAAYD,EAAE3B,GAAK4B,EAAWC,OACtCF,IAMH,SAAUtE,EAAQD,EAASF,GAGjCG,EAAOD,SAAWF,EAAoB,EAApBA,CAAuB,WACvC,OAA+E,GAAxEa,OAAOC,eAAe,GAAI,IAAK,CAAEG,IAAK,WAAc,OAAO,KAAQ2D,KAMtE,SAAUzE,EAAQD,EAASF,GAGjC,IAAI6E,EAAY7E,EAAoB,IAChC8E,EAAMlB,KAAKkB,IACf3E,EAAOD,QAAU,SAAUuD,GACzB,OAAY,EAALA,EAASqB,EAAID,EAAUpB,GAAK,kBAAoB,IAMnD,SAAUtD,EAAQD,EAASF,GAGjC,IAAI+E,EAAU/E,EAAoB,IAClCG,EAAOD,QAAU,SAAUuD,GACzB,OAAO5C,OAAOkE,EAAQtB,MAMlB,SAAUtD,EAAQD,GAExBC,EAAOD,QAAU,SAAUuD,GACzB,GAAiB,mBAANA,EAAkB,MAAMC,UAAUD,EAAK,uBAClD,OAAOA,IAMH,SAAUtD,EAAQD,EAASF,GAGjC,IAAIgF,EAAUhF,EAAoB,IAC9B+E,EAAU/E,EAAoB,IAClCG,EAAOD,QAAU,SAAUuD,GACzB,OAAOuB,EAAQD,EAAQtB,MAMnB,SAAUtD,EAAQD,GAExB,IAAIuB,EAAiB,GAAGA,eACxBtB,EAAOD,QAAU,SAAUuD,EAAIpB,GAC7B,OAAOZ,EAAenB,KAAKmD,EAAIpB,KAM3B,SAAUlC,EAAQD,GAExB,IAAI2B,EAAO1B,EAAOD,QAAU,CAAE+E,QAAS,SACrB,iBAAPtF,IAAiBA,EAAMkC,IAK5B,SAAU1B,EAAQD,EAASF,GAEjC,IAAIuE,EAAKvE,EAAoB,GACzBkF,EAAalF,EAAoB,IACrCG,EAAOD,QAAUF,EAAoB,GAAK,SAAUsB,EAAQe,EAAKsC,GAC/D,OAAOJ,EAAGC,EAAElD,EAAQe,EAAK6C,EAAW,EAAGP,KACrC,SAAUrD,EAAQe,EAAKsC,GAEzB,OADArD,EAAOe,GAAOsC,EACPrD,IAMH,SAAUnB,EAAQD,EAASF,GAEjC,IAAI4B,EAAS5B,EAAoB,GAC7B8B,EAAO9B,EAAoB,IAC3BmF,EAAMnF,EAAoB,IAC1BoF,EAAMpF,EAAoB,GAApBA,CAAwB,OAC9BqF,EAAY,WACZC,EAAYlC,SAASiC,GACrBE,GAAO,GAAKD,GAAWE,MAAMH,GAEjCrF,EAAoB,IAAIyF,cAAgB,SAAUhC,GAChD,OAAO6B,EAAUhF,KAAKmD,KAGvBtD,EAAOD,QAAU,SAAUuE,EAAGpC,EAAKqD,EAAKC,GACvC,IAAIC,EAA2B,mBAAPF,EACpBE,IAAYT,EAAIO,EAAK,SAAW5D,EAAK4D,EAAK,OAAQrD,IAClDoC,EAAEpC,KAASqD,IACXE,IAAYT,EAAIO,EAAKN,IAAQtD,EAAK4D,EAAKN,EAAKX,EAAEpC,GAAO,GAAKoC,EAAEpC,GAAOkD,EAAIM,KAAKC,OAAOzD,MACnFoC,IAAM7C,EACR6C,EAAEpC,GAAOqD,EACCC,EAGDlB,EAAEpC,GACXoC,EAAEpC,GAAOqD,EAET5D,EAAK2C,EAAGpC,EAAKqD,WALNjB,EAAEpC,GACTP,EAAK2C,EAAGpC,EAAKqD,OAOdtC,SAAS5B,UAAW6D,EAAW,SAASU,WACzC,MAAsB,mBAARC,MAAsBA,KAAKZ,IAAQE,EAAUhF,KAAK0F,SAM5D,SAAU7F,EAAQD,EAASF,GAEjC,IAAIiG,EAAMjG,EAAoB,IAC1BkF,EAAalF,EAAoB,IACjCkG,EAAYlG,EAAoB,IAChCsE,EAActE,EAAoB,IAClCmF,EAAMnF,EAAoB,IAC1BqE,EAAiBrE,EAAoB,IACrCmG,EAAOtF,OAAOuF,yBAElBlG,EAAQsE,EAAIxE,EAAoB,GAAKmG,EAAO,SAASC,yBAAyB3B,EAAG3B,GAG/E,GAFA2B,EAAIyB,EAAUzB,GACd3B,EAAIwB,EAAYxB,GAAG,GACfuB,EAAgB,IAClB,OAAO8B,EAAK1B,EAAG3B,GACf,MAAOiB,IACT,GAAIoB,EAAIV,EAAG3B,GAAI,OAAOoC,GAAYe,EAAIzB,EAAElE,KAAKmE,EAAG3B,GAAI2B,EAAE3B,MAMlD,SAAU3C,EAAQD,EAASF,GAGjC,IAAImF,EAAMnF,EAAoB,IAC1BqG,EAAWrG,EAAoB,GAC/BsG,EAAWtG,EAAoB,GAApBA,CAAwB,YACnCuG,EAAc1F,OAAOW,UAEzBrB,EAAOD,QAAUW,OAAO2F,gBAAkB,SAAU/B,GAElD,OADAA,EAAI4B,EAAS5B,GACTU,EAAIV,EAAG6B,GAAkB7B,EAAE6B,GACH,mBAAjB7B,EAAEgC,aAA6BhC,aAAaA,EAAEgC,YAChDhC,EAAEgC,YAAYjF,UACdiD,aAAa5D,OAAS0F,EAAc,OAMzC,SAAUpG,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B0G,EAAQ1G,EAAoB,GAC5B+E,EAAU/E,EAAoB,IAC9B2G,EAAO,KAEPC,EAAa,SAAUC,EAAQC,EAAKC,EAAWpC,GACjD,IAAIzB,EAAI4C,OAAOf,EAAQ8B,IACnBG,EAAK,IAAMF,EAEf,MADkB,KAAdC,IAAkBC,GAAM,IAAMD,EAAY,KAAOjB,OAAOnB,GAAOsC,QAAQN,EAAM,UAAY,KACtFK,EAAK,IAAM9D,EAAI,KAAO4D,EAAM,KAErC3G,EAAOD,QAAU,SAAUgH,EAAMpD,GAC/B,IAAIW,EAAI,GACRA,EAAEyC,GAAQpD,EAAK8C,GACf1E,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAIgE,EAAM,WACpC,IAAIS,EAAO,GAAGD,GAAM,KACpB,OAAOC,IAASA,EAAKC,eAA0C,EAAzBD,EAAK3B,MAAM,KAAK6B,SACpD,SAAU5C,KAMV,SAAUtE,EAAQD,EAASF,GAGjC,IAAIsH,EAAYtH,EAAoB,IACpCG,EAAOD,QAAU,SAAUqH,EAAIC,EAAMH,GAEnC,GADAC,EAAUC,GACNC,IAAS3H,GAAW,OAAO0H,EAC/B,OAAQF,GACN,KAAK,EAAG,OAAO,SAAUzC,GACvB,OAAO2C,EAAGjH,KAAKkH,EAAM5C,IAEvB,KAAK,EAAG,OAAO,SAAUA,EAAG6C,GAC1B,OAAOF,EAAGjH,KAAKkH,EAAM5C,EAAG6C,IAE1B,KAAK,EAAG,OAAO,SAAU7C,EAAG6C,EAAGjH,GAC7B,OAAO+G,EAAGjH,KAAKkH,EAAM5C,EAAG6C,EAAGjH,IAG/B,OAAO,WACL,OAAO+G,EAAGG,MAAMF,EAAMG,cAOpB,SAAUxH,EAAQD,GAExB,IAAI6F,EAAW,GAAGA,SAElB5F,EAAOD,QAAU,SAAUuD,GACzB,OAAOsC,EAASzF,KAAKmD,GAAImE,MAAM,GAAI,KAM/B,SAAUzH,EAAQD,EAASF,GAIjC,IAAI0G,EAAQ1G,EAAoB,GAEhCG,EAAOD,QAAU,SAAU2H,EAAQC,GACjC,QAASD,GAAUnB,EAAM,WAEvBoB,EAAMD,EAAOvH,KAAK,KAAM,aAA6B,GAAKuH,EAAOvH,KAAK,UAOpE,SAAUH,EAAQD,EAASF,GAGjC,IAAIwD,EAAWxD,EAAoB,GAGnCG,EAAOD,QAAU,SAAUuD,EAAIP,GAC7B,IAAKM,EAASC,GAAK,OAAOA,EAC1B,IAAI8D,EAAI7B,EACR,GAAIxC,GAAkC,mBAArBqE,EAAK9D,EAAGsC,YAA4BvC,EAASkC,EAAM6B,EAAGjH,KAAKmD,IAAM,OAAOiC,EACzF,GAAgC,mBAApB6B,EAAK9D,EAAGsE,WAA2BvE,EAASkC,EAAM6B,EAAGjH,KAAKmD,IAAM,OAAOiC,EACnF,IAAKxC,GAAkC,mBAArBqE,EAAK9D,EAAGsC,YAA4BvC,EAASkC,EAAM6B,EAAGjH,KAAKmD,IAAM,OAAOiC,EAC1F,MAAMhC,UAAU,6CAMZ,SAAUvD,EAAQD,GAGxBC,EAAOD,QAAU,SAAUuD,GACzB,GAAIA,GAAM5D,GAAW,MAAM6D,UAAU,yBAA2BD,GAChE,OAAOA,IAMH,SAAUtD,EAAQD,GAGxB,IAAI8H,EAAOpE,KAAKoE,KACZC,EAAQrE,KAAKqE,MACjB9H,EAAOD,QAAU,SAAUuD,GACzB,OAAOyE,MAAMzE,GAAMA,GAAM,GAAU,EAALA,EAASwE,EAAQD,GAAMvE,KAMjD,SAAUtD,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B6B,EAAO7B,EAAoB,IAC3B0G,EAAQ1G,EAAoB,GAChCG,EAAOD,QAAU,SAAUiI,EAAKrE,GAC9B,IAAIyD,GAAM1F,EAAKhB,QAAU,IAAIsH,IAAQtH,OAAOsH,GACxC3F,EAAM,GACVA,EAAI2F,GAAOrE,EAAKyD,GAChBrF,EAAQA,EAAQgB,EAAIhB,EAAQQ,EAAIgE,EAAM,WAAca,EAAG,KAAQ,SAAU/E,KAMrE,SAAUrC,EAAQD,EAASF,GASjC,IAAIgC,EAAMhC,EAAoB,IAC1BgF,EAAUhF,EAAoB,IAC9BqG,EAAWrG,EAAoB,GAC/BoI,EAAWpI,EAAoB,GAC/BqI,EAAMrI,EAAoB,IAC9BG,EAAOD,QAAU,SAAUoI,EAAMC,GAC/B,IAAIC,EAAiB,GAARF,EACTG,EAAoB,GAARH,EACZI,EAAkB,GAARJ,EACVK,EAAmB,GAARL,EACXM,EAAwB,GAARN,EAChBO,EAAmB,GAARP,GAAaM,EACxBE,EAASP,GAAWF,EACxB,OAAO,SAAUU,EAAOC,EAAYxB,GAQlC,IAPA,IAMI9B,EAAKuD,EANLxE,EAAI4B,EAAS0C,GACblF,EAAOmB,EAAQP,GACfD,EAAIxC,EAAIgH,EAAYxB,EAAM,GAC1BH,EAASe,EAASvE,EAAKwD,QACvB6B,EAAQ,EACRC,EAASX,EAASM,EAAOC,EAAO1B,GAAUoB,EAAYK,EAAOC,EAAO,GAAKlJ,GAE9DqJ,EAAT7B,EAAgB6B,IAAS,IAAIL,GAAYK,KAASrF,KAEtDoF,EAAMzE,EADNkB,EAAM7B,EAAKqF,GACEA,EAAOzE,GAChB6D,GACF,GAAIE,EAAQW,EAAOD,GAASD,OACvB,GAAIA,EAAK,OAAQX,GACpB,KAAK,EAAG,OAAO,EACf,KAAK,EAAG,OAAO5C,EACf,KAAK,EAAG,OAAOwD,EACf,KAAK,EAAGC,EAAOC,KAAK1D,QACf,GAAIiD,EAAU,OAAO,EAGhC,OAAOC,GAAiB,EAAIF,GAAWC,EAAWA,EAAWQ,KAO3D,SAAUhJ,EAAQD,EAASF,GAGjC,IAAIqJ,EAAQrJ,EAAoB,IAC5BsJ,EAActJ,EAAoB,IAEtCG,EAAOD,QAAUW,OAAO0I,MAAQ,SAASA,KAAK9E,GAC5C,OAAO4E,EAAM5E,EAAG6E,KAMZ,SAAUnJ,EAAQD,EAASF,GAGjC,IAAIoE,EAAWpE,EAAoB,GAC/BwJ,EAAMxJ,EAAoB,IAC1BsJ,EAActJ,EAAoB,IAClCsG,EAAWtG,EAAoB,GAApBA,CAAwB,YACnCyJ,EAAQ,aACRxH,EAAY,YAGZyH,EAAa,WAEf,IAIIC,EAJAC,EAAS5J,EAAoB,GAApBA,CAAwB,UACjCI,EAAIkJ,EAAYjC,OAcpB,IAVAuC,EAAOC,MAAMC,QAAU,OACvB9J,EAAoB,IAAI+J,YAAYH,GACpCA,EAAOI,IAAM,eAGbL,EAAiBC,EAAOK,cAAcC,UACvBC,OACfR,EAAeS,MAAMC,uCACrBV,EAAeW,QACfZ,EAAaC,EAAejH,EACrBtC,YAAYsJ,EAAWzH,GAAWqH,EAAYlJ,IACrD,OAAOsJ,KAGTvJ,EAAOD,QAAUW,OAAOiI,QAAU,SAASA,OAAOrE,EAAG8F,GACnD,IAAIpB,EAQJ,OAPU,OAAN1E,GACFgF,EAAMxH,GAAamC,EAASK,GAC5B0E,EAAS,IAAIM,EACbA,EAAMxH,GAAa,KAEnBkH,EAAO7C,GAAY7B,GACd0E,EAASO,IACTa,IAAe1K,GAAYsJ,EAASK,EAAIL,EAAQoB,KAMnD,SAAUpK,EAAQD,EAASF,GAIjC,GAAIA,EAAoB,GAAI,CAC1B,IAAIwK,EAAUxK,EAAoB,IAC9B4B,EAAS5B,EAAoB,GAC7B0G,EAAQ1G,EAAoB,GAC5BkC,EAAUlC,EAAoB,GAC9ByK,EAASzK,EAAoB,IAC7B0K,EAAU1K,EAAoB,IAC9BgC,EAAMhC,EAAoB,IAC1B2K,EAAa3K,EAAoB,IACjC4K,EAAe5K,EAAoB,IACnC8B,EAAO9B,EAAoB,IAC3B6K,EAAc7K,EAAoB,IAClC6E,EAAY7E,EAAoB,IAChCoI,EAAWpI,EAAoB,GAC/B8K,EAAU9K,EAAoB,KAC9B+K,EAAkB/K,EAAoB,IACtCsE,EAActE,EAAoB,IAClCmF,EAAMnF,EAAoB,IAC1BgL,EAAUhL,EAAoB,IAC9BwD,EAAWxD,EAAoB,GAC/BqG,EAAWrG,EAAoB,GAC/BiL,EAAcjL,EAAoB,IAClC8I,EAAS9I,EAAoB,IAC7BwG,EAAiBxG,EAAoB,IACrCkL,EAAOlL,EAAoB,IAAIwE,EAC/B2G,EAAYnL,EAAoB,IAChCiE,EAAMjE,EAAoB,IAC1BoL,EAAMpL,EAAoB,GAC1BqL,EAAoBrL,EAAoB,IACxCsL,EAAsBtL,EAAoB,IAC1CuL,EAAqBvL,EAAoB,IACzCwL,EAAiBxL,EAAoB,IACrCyL,EAAYzL,EAAoB,IAChC0L,EAAc1L,EAAoB,IAClC2L,EAAa3L,EAAoB,IACjC4L,EAAY5L,EAAoB,IAChC6L,EAAkB7L,EAAoB,KACtC8L,EAAM9L,EAAoB,GAC1B+L,EAAQ/L,EAAoB,IAC5BuE,EAAKuH,EAAItH,EACT2B,EAAO4F,EAAMvH,EACbwH,EAAapK,EAAOoK,WACpBtI,EAAY9B,EAAO8B,UACnBuI,EAAarK,EAAOqK,WACpBC,EAAe,cACfC,EAAgB,SAAWD,EAC3BE,EAAoB,oBACpBnK,EAAY,YACZoK,EAAaC,MAAMrK,GACnBsK,EAAe7B,EAAQ8B,YACvBC,EAAY/B,EAAQgC,SACpBC,EAAetB,EAAkB,GACjCuB,GAAcvB,EAAkB,GAChCwB,GAAYxB,EAAkB,GAC9ByB,GAAazB,EAAkB,GAC/B0B,GAAY1B,EAAkB,GAC9B2B,GAAiB3B,EAAkB,GACnC4B,GAAgB3B,GAAoB,GACpC4B,GAAe5B,GAAoB,GACnC6B,GAAc3B,EAAe4B,OAC7BC,GAAY7B,EAAejC,KAC3B+D,GAAe9B,EAAe+B,QAC9BC,GAAmBnB,EAAWoB,YAC9BC,GAAcrB,EAAWsB,OACzBC,GAAmBvB,EAAWwB,YAC9BC,GAAYzB,EAAWxG,KACvBkI,GAAY1B,EAAW2B,KACvBC,GAAa5B,EAAWzE,MACxBsG,GAAgB7B,EAAWtG,SAC3BoI,GAAsB9B,EAAW+B,eACjCC,GAAWjD,EAAI,YACfkD,GAAMlD,EAAI,eACVmD,GAAoBtK,EAAI,qBACxBuK,GAAkBvK,EAAI,mBACtBwK,GAAmBhE,EAAOiE,OAC1BC,GAAclE,EAAOmE,MACrBC,GAAOpE,EAAOoE,KACdC,GAAe,gBAEfC,GAAO1D,EAAkB,EAAG,SAAU5G,EAAG4C,GAC3C,OAAO2H,GAASzD,EAAmB9G,EAAGA,EAAE+J,KAAmBnH,KAGzD4H,GAAgBvI,EAAM,WAExB,OAA0D,IAAnD,IAAIuF,EAAW,IAAIiD,YAAY,CAAC,IAAIC,QAAQ,KAGjDC,KAAenD,KAAgBA,EAAWhK,GAAWoN,KAAO3I,EAAM,WACpE,IAAIuF,EAAW,GAAGoD,IAAI,MAGpBC,GAAW,SAAU7L,EAAI8L,GAC3B,IAAIC,EAAS3K,EAAUpB,GACvB,GAAI+L,EAAS,GAAKA,EAASD,EAAO,MAAMvD,EAAW,iBACnD,OAAOwD,GAGLC,GAAW,SAAUhM,GACvB,GAAID,EAASC,IAAOkL,MAAelL,EAAI,OAAOA,EAC9C,MAAMC,EAAUD,EAAK,2BAGnBuL,GAAW,SAAUU,EAAGrI,GAC1B,KAAM7D,EAASkM,IAAMnB,MAAqBmB,GACxC,MAAMhM,EAAU,wCAChB,OAAO,IAAIgM,EAAErI,IAGbsI,GAAkB,SAAUlL,EAAGmL,GACjC,OAAOC,GAAStE,EAAmB9G,EAAGA,EAAE+J,KAAmBoB,IAGzDC,GAAW,SAAUH,EAAGE,GAI1B,IAHA,IAAI1G,EAAQ,EACR7B,EAASuI,EAAKvI,OACd8B,EAAS6F,GAASU,EAAGrI,GACT6B,EAAT7B,GAAgB8B,EAAOD,GAAS0G,EAAK1G,KAC5C,OAAOC,GAGL2G,GAAY,SAAUrM,EAAIpB,EAAK0N,GACjCxL,EAAGd,EAAIpB,EAAK,CAAEpB,IAAK,WAAc,OAAO+E,KAAKgK,GAAGD,OAG9CE,GAAQ,SAASC,KAAK9N,GACxB,IAKIhC,EAAGiH,EAAQ+F,EAAQjE,EAAQgH,EAAMC,EALjC3L,EAAI4B,EAASjE,GACbiO,EAAO1I,UAAUN,OACjBiJ,EAAe,EAAPD,EAAW1I,UAAU,GAAK9H,GAClC0Q,EAAUD,IAAUzQ,GACpB2Q,EAASrF,EAAU1G,GAEvB,GAAI+L,GAAU3Q,KAAcoL,EAAYuF,GAAS,CAC/C,IAAKJ,EAAWI,EAAOlQ,KAAKmE,GAAI2I,EAAS,GAAIhN,EAAI,IAAK+P,EAAOC,EAASK,QAAQC,KAAMtQ,IAClFgN,EAAOhE,KAAK+G,EAAKxL,OACjBF,EAAI2I,EAGR,IADImD,GAAkB,EAAPF,IAAUC,EAAQtO,EAAIsO,EAAO3I,UAAU,GAAI,IACrDvH,EAAI,EAAGiH,EAASe,EAAS3D,EAAE4C,QAAS8B,EAAS6F,GAAShJ,KAAMqB,GAAkBjH,EAATiH,EAAYjH,IACpF+I,EAAO/I,GAAKmQ,EAAUD,EAAM7L,EAAErE,GAAIA,GAAKqE,EAAErE,GAE3C,OAAO+I,GAGLwH,GAAM,SAASC,KAIjB,IAHA,IAAI1H,EAAQ,EACR7B,EAASM,UAAUN,OACnB8B,EAAS6F,GAAShJ,KAAMqB,GACZ6B,EAAT7B,GAAgB8B,EAAOD,GAASvB,UAAUuB,KACjD,OAAOC,GAIL0H,KAAkB5E,GAAcvF,EAAM,WAAcyH,GAAoB7N,KAAK,IAAI2L,EAAW,MAE5F6E,GAAkB,SAAS1C,iBAC7B,OAAOD,GAAoBzG,MAAMmJ,GAAgB5C,GAAW3N,KAAKmP,GAASzJ,OAASyJ,GAASzJ,MAAO2B,YAGjGoJ,GAAQ,CACVC,WAAY,SAASA,WAAW/N,EAAQgO,GACtC,OAAOpF,EAAgBvL,KAAKmP,GAASzJ,MAAO/C,EAAQgO,EAA0B,EAAnBtJ,UAAUN,OAAaM,UAAU,GAAK9H,KAEnGqR,MAAO,SAASA,MAAMlI,GACpB,OAAO8D,GAAW2C,GAASzJ,MAAOgD,EAA+B,EAAnBrB,UAAUN,OAAaM,UAAU,GAAK9H,KAEtFsR,KAAM,SAASA,KAAKxM,GAClB,OAAOiH,EAAUlE,MAAM+H,GAASzJ,MAAO2B,YAEzCyJ,OAAQ,SAASA,OAAOpI,GACtB,OAAO2G,GAAgB3J,KAAM4G,GAAY6C,GAASzJ,MAAOgD,EACpC,EAAnBrB,UAAUN,OAAaM,UAAU,GAAK9H,MAE1CwR,KAAM,SAASA,KAAKC,GAClB,OAAOvE,GAAU0C,GAASzJ,MAAOsL,EAA8B,EAAnB3J,UAAUN,OAAaM,UAAU,GAAK9H,KAEpF0R,UAAW,SAASA,UAAUD,GAC5B,OAAOtE,GAAeyC,GAASzJ,MAAOsL,EAA8B,EAAnB3J,UAAUN,OAAaM,UAAU,GAAK9H,KAEzF2R,QAAS,SAASA,QAAQxI,GACxB2D,EAAa8C,GAASzJ,MAAOgD,EAA+B,EAAnBrB,UAAUN,OAAaM,UAAU,GAAK9H,KAEjF4R,QAAS,SAASA,QAAQC,GACxB,OAAOxE,GAAauC,GAASzJ,MAAO0L,EAAkC,EAAnB/J,UAAUN,OAAaM,UAAU,GAAK9H,KAE3F8R,SAAU,SAASA,SAASD,GAC1B,OAAOzE,GAAcwC,GAASzJ,MAAO0L,EAAkC,EAAnB/J,UAAUN,OAAaM,UAAU,GAAK9H,KAE5FgG,KAAM,SAASA,KAAK+L,GAClB,OAAO9D,GAAUpG,MAAM+H,GAASzJ,MAAO2B,YAEzC8F,YAAa,SAASA,YAAYiE,GAChC,OAAOlE,GAAiB9F,MAAM+H,GAASzJ,MAAO2B,YAEhDkK,IAAK,SAASA,IAAIvB,GAChB,OAAOvB,GAAKU,GAASzJ,MAAOsK,EAA0B,EAAnB3I,UAAUN,OAAaM,UAAU,GAAK9H,KAE3E8N,OAAQ,SAASA,OAAO3E,GACtB,OAAO0E,GAAYhG,MAAM+H,GAASzJ,MAAO2B,YAE3CkG,YAAa,SAASA,YAAY7E,GAChC,OAAO4E,GAAiBlG,MAAM+H,GAASzJ,MAAO2B,YAEhDmK,QAAS,SAASA,UAMhB,IALA,IAIInN,EAJA6C,EAAOxB,KACPqB,EAASoI,GAASjI,GAAMH,OACxB0K,EAASnO,KAAKqE,MAAMZ,EAAS,GAC7B6B,EAAQ,EAELA,EAAQ6I,GACbpN,EAAQ6C,EAAK0B,GACb1B,EAAK0B,KAAW1B,IAAOH,GACvBG,EAAKH,GAAU1C,EACf,OAAO6C,GAEXwK,KAAM,SAASA,KAAKhJ,GAClB,OAAO6D,GAAU4C,GAASzJ,MAAOgD,EAA+B,EAAnBrB,UAAUN,OAAaM,UAAU,GAAK9H,KAErFmO,KAAM,SAASA,KAAKiE,GAClB,OAAOlE,GAAUzN,KAAKmP,GAASzJ,MAAOiM,IAExCC,SAAU,SAASA,SAASC,EAAOC,GACjC,IAAI3N,EAAIgL,GAASzJ,MACbqB,EAAS5C,EAAE4C,OACXgL,EAAStH,EAAgBoH,EAAO9K,GACpC,OAAO,IAAKkE,EAAmB9G,EAAGA,EAAE+J,KAA7B,CACL/J,EAAE0K,OACF1K,EAAE6N,WAAaD,EAAS5N,EAAE2H,kBAC1BhE,GAAUgK,IAAQvS,GAAYwH,EAAS0D,EAAgBqH,EAAK/K,IAAWgL,MAKzEE,GAAS,SAAS3K,MAAMqJ,EAAOmB,GACjC,OAAOzC,GAAgB3J,KAAMiI,GAAW3N,KAAKmP,GAASzJ,MAAOiL,EAAOmB,KAGlEI,GAAO,SAASnD,IAAIoD,GACtBhD,GAASzJ,MACT,IAAIwJ,EAASF,GAAS3H,UAAU,GAAI,GAChCN,EAASrB,KAAKqB,OACd2C,EAAM3D,EAASoM,GACfC,EAAMtK,EAAS4B,EAAI3C,QACnB6B,EAAQ,EACZ,GAAmB7B,EAAfqL,EAAMlD,EAAiB,MAAMxD,EAAW8C,IAC5C,KAAO5F,EAAQwJ,GAAK1M,KAAKwJ,EAAStG,GAASc,EAAId,MAG7CyJ,GAAa,CACfpF,QAAS,SAASA,UAChB,OAAOD,GAAahN,KAAKmP,GAASzJ,QAEpCuD,KAAM,SAASA,OACb,OAAO8D,GAAU/M,KAAKmP,GAASzJ,QAEjCoH,OAAQ,SAASA,SACf,OAAOD,GAAY7M,KAAKmP,GAASzJ,SAIjC4M,GAAY,SAAU3P,EAAQZ,GAChC,OAAOmB,EAASP,IACXA,EAAO0L,KACO,iBAAPtM,GACPA,KAAOY,GACP6C,QAAQzD,IAAQyD,OAAOzD,IAE1BwQ,GAAW,SAASzM,yBAAyBnD,EAAQZ,GACvD,OAAOuQ,GAAU3P,EAAQZ,EAAMiC,EAAYjC,GAAK,IAC5CuI,EAAa,EAAG3H,EAAOZ,IACvB8D,EAAKlD,EAAQZ,IAEfyQ,GAAW,SAAShS,eAAemC,EAAQZ,EAAK0Q,GAClD,QAAIH,GAAU3P,EAAQZ,EAAMiC,EAAYjC,GAAK,KACxCmB,EAASuP,IACT5N,EAAI4N,EAAM,WACT5N,EAAI4N,EAAM,QACV5N,EAAI4N,EAAM,QAEVA,EAAKhS,cACJoE,EAAI4N,EAAM,cAAeA,EAAKC,UAC9B7N,EAAI4N,EAAM,gBAAiBA,EAAK/R,WAI9BuD,EAAGtB,EAAQZ,EAAK0Q,IAFvB9P,EAAOZ,GAAO0Q,EAAKpO,MACZ1B,IAINwL,KACH1C,EAAMvH,EAAIqO,GACV/G,EAAItH,EAAIsO,IAGV5Q,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAK+L,GAAkB,SAAU,CAC3DrI,yBAA0ByM,GAC1B/R,eAAgBgS,KAGdpM,EAAM,WAAcwH,GAAc5N,KAAK,QACzC4N,GAAgBC,GAAsB,SAASpI,WAC7C,OAAO+H,GAAUxN,KAAK0F,QAI1B,IAAIiN,GAAwBpI,EAAY,GAAIkG,IAC5ClG,EAAYoI,GAAuBN,IACnC7Q,EAAKmR,GAAuB5E,GAAUsE,GAAWvF,QACjDvC,EAAYoI,GAAuB,CACjCrL,MAAO2K,GACPlD,IAAKmD,GACL/L,YAAa,aACbV,SAAUmI,GACVE,eAAgB0C,KAElBhB,GAAUmD,GAAuB,SAAU,KAC3CnD,GAAUmD,GAAuB,aAAc,KAC/CnD,GAAUmD,GAAuB,aAAc,KAC/CnD,GAAUmD,GAAuB,SAAU,KAC3C1O,EAAG0O,GAAuB3E,GAAK,CAC7BrN,IAAK,WAAc,OAAO+E,KAAK2I,OAIjCxO,EAAOD,QAAU,SAAUiI,EAAKoH,EAAO2D,EAASC,GAE9C,IAAIjM,EAAOiB,IADXgL,IAAYA,GACgB,UAAY,IAAM,QAC1CC,EAAS,MAAQjL,EACjBkL,EAAS,MAAQlL,EACjBmL,EAAa1R,EAAOsF,GACpBqM,EAAOD,GAAc,GACrBE,EAAMF,GAAc9M,EAAe8M,GAEnC7O,EAAI,GACJgP,EAAsBH,GAAcA,EAAWrR,GAU/CyR,EAAa,SAAUlM,EAAM0B,GAC/B3E,EAAGiD,EAAM0B,EAAO,CACdjI,IAAK,WACH,OAXA0S,EAWc3N,KAXFgK,IACJ4D,EAAER,GAUUlK,EAVMqG,EAAQoE,EAAK/S,EAAGqO,IAFnC,IACP0E,GAaFtE,IAAK,SAAU1K,GACb,OAXuBuE,EAWHA,EAXUvE,EAWHA,EAV3BgP,EAUc3N,KAVFgK,GACZmD,IAASxO,GAASA,EAAQf,KAAKiQ,MAAMlP,IAAU,EAAI,EAAY,IAARA,EAAe,IAAe,IAARA,QACjFgP,EAAKC,EAAEP,GAAQnK,EAAQqG,EAAQoE,EAAK/S,EAAG+D,EAAOsK,IAHnC,IAAgB/F,EAAOvE,EAC9BgP,GAYF3S,YAAY,MApBFsS,IAAe7I,EAAOqJ,KAwBlCR,EAAaJ,EAAQ,SAAU1L,EAAMmM,EAAMI,EAASC,GAClDrJ,EAAWnD,EAAM8L,EAAYpM,EAAM,MACnC,IAEIiI,EAAQ8E,EAAY5M,EAAQ6M,EAF5BhL,EAAQ,EACRsG,EAAS,EAEb,GAAKhM,EAASmQ,GAIP,CAAA,KAAIA,aAAgBpH,IAAiB2H,EAAQlJ,EAAQ2I,KAAUzH,GAAgBgI,GAAS/H,GAaxF,OAAIwC,MAAegF,EACjB9D,GAASyD,EAAYK,GAErB1D,GAAM3P,KAAKgT,EAAYK,GAf9BxE,EAASwE,EACTnE,EAASF,GAASyE,EAASxE,GAC3B,IAAI4E,EAAOR,EAAKM,WAChB,GAAID,IAAYnU,GAAW,CACzB,GAAIsU,EAAO5E,EAAO,MAAMvD,EAAW8C,IAEnC,IADAmF,EAAaE,EAAO3E,GACH,EAAG,MAAMxD,EAAW8C,SAGrC,GAA0BqF,GAD1BF,EAAa7L,EAAS4L,GAAWzE,GAChBC,EAAe,MAAMxD,EAAW8C,IAEnDzH,EAAS4M,EAAa1E,OAftBlI,EAASyD,EAAQ6I,GAEjBxE,EAAS,IAAI5C,EADb0H,EAAa5M,EAASkI,GA2BxB,IAPAzN,EAAK0F,EAAM,KAAM,CACfC,EAAG0H,EACHvO,EAAG4O,EACHnP,EAAG4T,EACHlQ,EAAGsD,EACHuM,EAAG,IAAInH,EAAU0C,KAEZjG,EAAQ7B,GAAQqM,EAAWlM,EAAM0B,OAE1CuK,EAAsBH,EAAWrR,GAAa6G,EAAOmK,IACrDnR,EAAK2R,EAAqB,cAAeH,IAC/B5M,EAAM,WAChB4M,EAAW,MACN5M,EAAM,WACX,IAAI4M,GAAY,MACX5H,EAAY,SAAU0I,GAC3B,IAAId,EACJ,IAAIA,EAAW,MACf,IAAIA,EAAW,KACf,IAAIA,EAAWc,KACd,KACDd,EAAaJ,EAAQ,SAAU1L,EAAMmM,EAAMI,EAASC,GAElD,IAAIE,EAGJ,OAJAvJ,EAAWnD,EAAM8L,EAAYpM,GAIxB1D,EAASmQ,GACVA,aAAgBpH,IAAiB2H,EAAQlJ,EAAQ2I,KAAUzH,GAAgBgI,GAAS/H,EAC/E6H,IAAYnU,GACf,IAAI0T,EAAKI,EAAMrE,GAASyE,EAASxE,GAAQyE,GACzCD,IAAYlU,GACV,IAAI0T,EAAKI,EAAMrE,GAASyE,EAASxE,IACjC,IAAIgE,EAAKI,GAEbhF,MAAegF,EAAa9D,GAASyD,EAAYK,GAC9C1D,GAAM3P,KAAKgT,EAAYK,GATF,IAAIJ,EAAKzI,EAAQ6I,MAW/ChH,EAAa6G,IAAQpQ,SAAS5B,UAAY0J,EAAKqI,GAAMc,OAAOnJ,EAAKsI,IAAQtI,EAAKqI,GAAO,SAAUlR,GACvFA,KAAOiR,GAAaxR,EAAKwR,EAAYjR,EAAKkR,EAAKlR,MAEvDiR,EAAWrR,GAAawR,EACnBjJ,IAASiJ,EAAoBhN,YAAc6M,IAElD,IAAIgB,EAAkBb,EAAoBpF,IACtCkG,IAAsBD,IACI,UAAxBA,EAAgB5T,MAAoB4T,EAAgB5T,MAAQb,IAC9D2U,EAAY7B,GAAWvF,OAC3BtL,EAAKwR,EAAY/E,IAAmB,GACpCzM,EAAK2R,EAAqB9E,GAAazH,GACvCpF,EAAK2R,EAAqB5E,IAAM,GAChC/M,EAAK2R,EAAqBjF,GAAiB8E,IAEvCH,EAAU,IAAIG,EAAW,GAAGhF,KAAQpH,EAASoH,MAAOmF,IACtDlP,EAAGkP,EAAqBnF,GAAK,CAC3BrN,IAAK,WAAc,OAAOiG,KAM9BhF,EAAQA,EAAQU,EAAIV,EAAQoB,EAAIpB,EAAQQ,IAFxC+B,EAAEyC,GAAQoM,IAEiDC,GAAO9O,GAElEvC,EAAQA,EAAQgB,EAAGgE,EAAM,CACvBkF,kBAAmBmD,IAGrBrN,EAAQA,EAAQgB,EAAIhB,EAAQQ,EAAIgE,EAAM,WAAc6M,EAAK3C,GAAGtQ,KAAKgT,EAAY,KAAQpM,EAAM,CACzFgJ,KAAMD,GACNW,GAAID,KAGAvE,KAAqBqH,GAAsB3R,EAAK2R,EAAqBrH,EAAmBmD,GAE9FrN,EAAQA,EAAQY,EAAGoE,EAAM6J,IAEzBpF,EAAWzE,GAEXhF,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAI0M,GAAYlI,EAAM,CAAEmI,IAAKmD,KAEzDtQ,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAK6R,EAAmBrN,EAAMyL,IAErDnI,GAAWiJ,EAAoB1N,UAAYmI,KAAeuF,EAAoB1N,SAAWmI,IAE9FhM,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAIgE,EAAM,WACpC,IAAI4M,EAAW,GAAG1L,UAChBV,EAAM,CAAEU,MAAO2K,KAEnBrQ,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAKgE,EAAM,WACrC,MAAO,CAAC,EAAG,GAAG0H,kBAAoB,IAAIkF,EAAW,CAAC,EAAG,IAAIlF,qBACpD1H,EAAM,WACX+M,EAAoBrF,eAAe9N,KAAK,CAAC,EAAG,OACzC4G,EAAM,CAAEkH,eAAgB0C,KAE7BrF,EAAUvE,GAAQqN,EAAoBD,EAAkBE,EACnDhK,GAAY+J,GAAmBzS,EAAK2R,EAAqBpF,GAAUmG,SAErErU,EAAOD,QAAU,cAKlB,SAAUC,EAAQD,EAASF,GAEjC,IAAIyU,EAAMzU,EAAoB,KAC1BkC,EAAUlC,EAAoB,GAC9B0U,EAAS1U,EAAoB,GAApBA,CAAwB,YACjCgE,EAAQ0Q,EAAO1Q,QAAU0Q,EAAO1Q,MAAQ,IAAKhE,EAAoB,OAEjE2U,EAAyB,SAAU1R,EAAQ2R,EAAW9L,GACxD,IAAI+L,EAAiB7Q,EAAM/C,IAAIgC,GAC/B,IAAK4R,EAAgB,CACnB,IAAK/L,EAAQ,OAAOjJ,GACpBmE,EAAMqL,IAAIpM,EAAQ4R,EAAiB,IAAIJ,GAEzC,IAAIK,EAAcD,EAAe5T,IAAI2T,GACrC,IAAKE,EAAa,CAChB,IAAKhM,EAAQ,OAAOjJ,GACpBgV,EAAexF,IAAIuF,EAAWE,EAAc,IAAIL,GAChD,OAAOK,GA0BX3U,EAAOD,QAAU,CACf8D,MAAOA,EACP6N,IAAK8C,EACLxP,IA3B2B,SAAU4P,EAAatQ,EAAG3B,GACrD,IAAIkS,EAAcL,EAAuBlQ,EAAG3B,GAAG,GAC/C,OAAOkS,IAAgBnV,IAAoBmV,EAAY7P,IAAI4P,IA0B3D9T,IAxB2B,SAAU8T,EAAatQ,EAAG3B,GACrD,IAAIkS,EAAcL,EAAuBlQ,EAAG3B,GAAG,GAC/C,OAAOkS,IAAgBnV,GAAYA,GAAYmV,EAAY/T,IAAI8T,IAuB/D1F,IArB8B,SAAU0F,EAAaE,EAAexQ,EAAG3B,GACvE6R,EAAuBlQ,EAAG3B,GAAG,GAAMuM,IAAI0F,EAAaE,IAqBpD1L,KAnB4B,SAAUtG,EAAQ2R,GAC9C,IAAII,EAAcL,EAAuB1R,EAAQ2R,GAAW,GACxDrL,EAAO,GAEX,OADIyL,GAAaA,EAAYxD,QAAQ,SAAU0D,EAAG7S,GAAOkH,EAAKH,KAAK/G,KAC5DkH,GAgBPlH,IAdc,SAAUoB,GACxB,OAAOA,IAAO5D,IAA0B,iBAAN4D,EAAiBA,EAAKqC,OAAOrC,IAc/DjB,IAZQ,SAAUiC,GAClBvC,EAAQA,EAAQgB,EAAG,UAAWuB,MAiB1B,SAAUtE,EAAQD,GAExBC,EAAOD,QAAU,SAAUiV,EAAQxQ,GACjC,MAAO,CACL3D,aAAuB,EAATmU,GACdpU,eAAyB,EAAToU,GAChBnC,WAAqB,EAATmC,GACZxQ,MAAOA,KAOL,SAAUxE,EAAQD,EAASF,GAEjC,IAAIoV,EAAOpV,EAAoB,GAApBA,CAAwB,QAC/BwD,EAAWxD,EAAoB,GAC/BmF,EAAMnF,EAAoB,IAC1BqV,EAAUrV,EAAoB,GAAGwE,EACjC8Q,EAAK,EACLC,EAAe1U,OAAO0U,cAAgB,WACxC,OAAO,GAELC,GAAUxV,EAAoB,EAApBA,CAAuB,WACnC,OAAOuV,EAAa1U,OAAO4U,kBAAkB,OAE3CC,EAAU,SAAUjS,GACtB4R,EAAQ5R,EAAI2R,EAAM,CAAEzQ,MAAO,CACzBvE,EAAG,OAAQkV,EACXK,EAAG,OAgCHC,EAAOzV,EAAOD,QAAU,CAC1BiI,IAAKiN,EACLS,MAAM,EACNC,QAhCY,SAAUrS,EAAIqF,GAE1B,IAAKtF,EAASC,GAAK,MAAoB,iBAANA,EAAiBA,GAAmB,iBAANA,EAAiB,IAAM,KAAOA,EAC7F,IAAK0B,EAAI1B,EAAI2R,GAAO,CAElB,IAAKG,EAAa9R,GAAK,MAAO,IAE9B,IAAKqF,EAAQ,MAAO,IAEpB4M,EAAQjS,GAER,OAAOA,EAAG2R,GAAMhV,GAsBlB2V,QApBY,SAAUtS,EAAIqF,GAC1B,IAAK3D,EAAI1B,EAAI2R,GAAO,CAElB,IAAKG,EAAa9R,GAAK,OAAO,EAE9B,IAAKqF,EAAQ,OAAO,EAEpB4M,EAAQjS,GAER,OAAOA,EAAG2R,GAAMO,GAYlBK,SATa,SAAUvS,GAEvB,OADI+R,GAAUI,EAAKC,MAAQN,EAAa9R,KAAQ0B,EAAI1B,EAAI2R,IAAOM,EAAQjS,GAChEA,KAaH,SAAUtD,EAAQD,GAExBC,EAAOD,SAAU,GAKX,SAAUC,EAAQD,EAASF,GAGjC,IAAIiW,EAAcjW,EAAoB,EAApBA,CAAuB,eACrCqM,EAAaC,MAAM9K,UACnB6K,EAAW4J,IAAgBpW,IAAWG,EAAoB,GAApBA,CAAwBqM,EAAY4J,EAAa,IAC3F9V,EAAOD,QAAU,SAAUmC,GACzBgK,EAAW4J,GAAa5T,IAAO,IAM3B,SAAUlC,EAAQD,EAASF,GAEjC,IAAIgC,EAAMhC,EAAoB,IAC1BM,EAAON,EAAoB,KAC3BiL,EAAcjL,EAAoB,IAClCoE,EAAWpE,EAAoB,GAC/BoI,EAAWpI,EAAoB,GAC/BmL,EAAYnL,EAAoB,IAChCkW,EAAQ,GACRC,EAAS,IACTjW,EAAUC,EAAOD,QAAU,SAAUkW,EAAU7I,EAAShG,EAAIC,EAAM6G,GACpE,IAGIhH,EAAQ8I,EAAMC,EAAUjH,EAHxBqH,EAASnC,EAAW,WAAc,OAAO+H,GAAcjL,EAAUiL,GACjE5R,EAAIxC,EAAIuF,EAAIC,EAAM+F,EAAU,EAAI,GAChCrE,EAAQ,EAEZ,GAAqB,mBAAVsH,EAAsB,MAAM9M,UAAU0S,EAAW,qBAE5D,GAAInL,EAAYuF,IAAS,IAAKnJ,EAASe,EAASgO,EAAS/O,QAAkB6B,EAAT7B,EAAgB6B,IAEhF,IADAC,EAASoE,EAAU/I,EAAEJ,EAAS+L,EAAOiG,EAASlN,IAAQ,GAAIiH,EAAK,IAAM3L,EAAE4R,EAASlN,OACjEgN,GAAS/M,IAAWgN,EAAQ,OAAOhN,OAC7C,IAAKiH,EAAWI,EAAOlQ,KAAK8V,KAAajG,EAAOC,EAASK,QAAQC,MAEtE,IADAvH,EAAS7I,EAAK8P,EAAU5L,EAAG2L,EAAKxL,MAAO4I,MACxB2I,GAAS/M,IAAWgN,EAAQ,OAAOhN,IAG9C+M,MAAQA,EAChBhW,EAAQiW,OAASA,GAKX,SAAUhW,EAAQD,GAExB,IAAIoV,EAAK,EACLe,EAAKzS,KAAK0S,SACdnW,EAAOD,QAAU,SAAUmC,GACzB,MAAO,UAAUgS,OAAOhS,IAAQxC,GAAY,GAAKwC,EAAK,QAASiT,EAAKe,GAAItQ,SAAS,OAM7E,SAAU5F,EAAQD,EAASF,GAEjC,IAAI6E,EAAY7E,EAAoB,IAChCuW,EAAM3S,KAAK2S,IACXzR,EAAMlB,KAAKkB,IACf3E,EAAOD,QAAU,SAAUgJ,EAAO7B,GAEhC,OADA6B,EAAQrE,EAAUqE,IACH,EAAIqN,EAAIrN,EAAQ7B,EAAQ,GAAKvC,EAAIoE,EAAO7B,KAMnD,SAAUlH,EAAQD,EAASF,GAGjC,IAAIqJ,EAAQrJ,EAAoB,IAC5BwW,EAAaxW,EAAoB,IAAIqU,OAAO,SAAU,aAE1DnU,EAAQsE,EAAI3D,OAAO4V,qBAAuB,SAASA,oBAAoBhS,GACrE,OAAO4E,EAAM5E,EAAG+R,KAMZ,SAAUrW,EAAQD,EAASF,GAGjC,IAAI0W,EAAM1W,EAAoB,IAC1BsO,EAAMtO,EAAoB,EAApBA,CAAuB,eAE7B2W,EAAkD,aAA5CD,EAAI,WAAc,OAAO/O,UAArB,IASdxH,EAAOD,QAAU,SAAUuD,GACzB,IAAIgB,EAAGmS,EAAG5T,EACV,OAAOS,IAAO5D,GAAY,YAAqB,OAAP4D,EAAc,OAEN,iBAApCmT,EAVD,SAAUnT,EAAIpB,GACzB,IACE,OAAOoB,EAAGpB,GACV,MAAO0B,KAOO8S,CAAOpS,EAAI5D,OAAO4C,GAAK6K,IAAoBsI,EAEvDD,EAAMD,EAAIjS,GAEM,WAAfzB,EAAI0T,EAAIjS,KAAsC,mBAAZA,EAAEqS,OAAuB,YAAc9T,IAM1E,SAAU7C,EAAQD,GAExBC,EAAOD,QAAU,IAKX,SAAUC,EAAQD,EAASF,GAIjC,IAAI4B,EAAS5B,EAAoB,GAC7BuE,EAAKvE,EAAoB,GACzB+W,EAAc/W,EAAoB,GAClCgX,EAAUhX,EAAoB,EAApBA,CAAuB,WAErCG,EAAOD,QAAU,SAAUiI,GACzB,IAAIuH,EAAI9N,EAAOuG,GACX4O,GAAerH,IAAMA,EAAEsH,IAAUzS,EAAGC,EAAEkL,EAAGsH,EAAS,CACpDjW,cAAc,EACdE,IAAK,WAAc,OAAO+E,UAOxB,SAAU7F,EAAQD,GAExBC,EAAOD,QAAU,SAAUuD,EAAIwT,EAAavW,EAAMwW,GAChD,KAAMzT,aAAcwT,IAAiBC,IAAmBrX,IAAaqX,KAAkBzT,EACrF,MAAMC,UAAUhD,EAAO,2BACvB,OAAO+C,IAML,SAAUtD,EAAQD,EAASF,GAEjC,IAAI+B,EAAW/B,EAAoB,IACnCG,EAAOD,QAAU,SAAU+C,EAAQ+G,EAAKrE,GACtC,IAAK,IAAItD,KAAO2H,EAAKjI,EAASkB,EAAQZ,EAAK2H,EAAI3H,GAAMsD,GACrD,OAAO1C,IAMH,SAAU9C,EAAQD,EAASF,GAEjC,IAAImX,EAAMnX,EAAoB,GAAGwE,EAC7BW,EAAMnF,EAAoB,IAC1BsO,EAAMtO,EAAoB,EAApBA,CAAuB,eAEjCG,EAAOD,QAAU,SAAUuD,EAAIqD,EAAKsQ,GAC9B3T,IAAO0B,EAAI1B,EAAK2T,EAAO3T,EAAKA,EAAGjC,UAAW8M,IAAM6I,EAAI1T,EAAI6K,EAAK,CAAEvN,cAAc,EAAM4D,MAAOmC,MAM1F,SAAU3G,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B+E,EAAU/E,EAAoB,IAC9B0G,EAAQ1G,EAAoB,GAC5BqX,EAASrX,EAAoB,IAC7BsX,EAAQ,IAAMD,EAAS,IAEvBE,EAAQC,OAAO,IAAMF,EAAQA,EAAQ,KACrCG,EAAQD,OAAOF,EAAQA,EAAQ,MAE/BI,EAAW,SAAUvP,EAAKrE,EAAM6T,GAClC,IAAInV,EAAM,GACNoV,EAAQlR,EAAM,WAChB,QAAS2Q,EAAOlP,MAPV,MAAA,KAOwBA,OAE5BZ,EAAK/E,EAAI2F,GAAOyP,EAAQ9T,EAAK+T,GAAQR,EAAOlP,GAC5CwP,IAAOnV,EAAImV,GAASpQ,GACxBrF,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAIkV,EAAO,SAAUpV,IAM/CqV,EAAOH,EAASG,KAAO,SAAUhR,EAAQyB,GAI3C,OAHAzB,EAASf,OAAOf,EAAQ8B,IACb,EAAPyB,IAAUzB,EAASA,EAAOI,QAAQsQ,EAAO,KAClC,EAAPjP,IAAUzB,EAASA,EAAOI,QAAQwQ,EAAO,KACtC5Q,GAGT1G,EAAOD,QAAUwX,GAKX,SAAUvX,EAAQD,EAASF,GAEjC,IAAIwD,EAAWxD,EAAoB,GACnCG,EAAOD,QAAU,SAAUuD,EAAI6E,GAC7B,IAAK9E,EAASC,IAAOA,EAAGqU,KAAOxP,EAAM,MAAM5E,UAAU,0BAA4B4E,EAAO,cACxF,OAAO7E,IAMH,SAAUtD,EAAQD,EAASF,GAGjC,IAAI0W,EAAM1W,EAAoB,IAE9BG,EAAOD,QAAUW,OAAO,KAAKkX,qBAAqB,GAAKlX,OAAS,SAAU4C,GACxE,MAAkB,UAAXiT,EAAIjT,GAAkBA,EAAG+B,MAAM,IAAM3E,OAAO4C,KAM/C,SAAUtD,EAAQD,GAExBA,EAAQsE,EAAI,GAAGuT,sBAKT,SAAU5X,EAAQD,EAASF,GAEjC,IAAIgL,EAAUhL,EAAoB,IAC9BqO,EAAWrO,EAAoB,EAApBA,CAAuB,YAClCyL,EAAYzL,EAAoB,IACpCG,EAAOD,QAAUF,EAAoB,IAAIgY,kBAAoB,SAAUvU,GACrE,GAAIA,GAAM5D,GAAW,OAAO4D,EAAG4K,IAC1B5K,EAAG,eACHgI,EAAUT,EAAQvH,MAMnB,SAAUtD,EAAQD,EAASF,GAEjC,IAAI6B,EAAO7B,EAAoB,IAC3B4B,EAAS5B,EAAoB,GAC7BiY,EAAS,qBACTjU,EAAQpC,EAAOqW,KAAYrW,EAAOqW,GAAU,KAE/C9X,EAAOD,QAAU,SAAUmC,EAAKsC,GAC/B,OAAOX,EAAM3B,KAAS2B,EAAM3B,GAAOsC,IAAU9E,GAAY8E,EAAQ,MAChE,WAAY,IAAIyE,KAAK,CACtBnE,QAASpD,EAAKoD,QACdiT,KAAMlY,EAAoB,IAAM,OAAS,SACzCmY,UAAW,0CAMP,SAAUhY,EAAQD,EAASF,GAIjC,IAAIkG,EAAYlG,EAAoB,IAChCoI,EAAWpI,EAAoB,GAC/B+K,EAAkB/K,EAAoB,IAC1CG,EAAOD,QAAU,SAAUkY,GACzB,OAAO,SAAUrP,EAAOsP,EAAIC,GAC1B,IAGI3T,EAHAF,EAAIyB,EAAU6C,GACd1B,EAASe,EAAS3D,EAAE4C,QACpB6B,EAAQ6B,EAAgBuN,EAAWjR,GAIvC,GAAI+Q,GAAeC,GAAMA,GAAI,KAAgBnP,EAAT7B,GAGlC,IAFA1C,EAAQF,EAAEyE,OAEGvE,EAAO,OAAO,OAEtB,KAAeuE,EAAT7B,EAAgB6B,IAAS,IAAIkP,GAAelP,KAASzE,IAC5DA,EAAEyE,KAAWmP,EAAI,OAAOD,GAAelP,GAAS,EACpD,OAAQkP,IAAgB,KAOxB,SAAUjY,EAAQD,GAExBA,EAAQsE,EAAI3D,OAAO0X,uBAKb,SAAUpY,EAAQD,EAASF,GAGjC,IAAI0W,EAAM1W,EAAoB,IAC9BG,EAAOD,QAAUoM,MAAMkM,SAAW,SAASA,QAAQ1Q,GACjD,MAAmB,SAAZ4O,EAAI5O,KAMP,SAAU3H,EAAQD,EAASF,GAGjC,IAAIwD,EAAWxD,EAAoB,GAC/B0W,EAAM1W,EAAoB,IAC1ByY,EAAQzY,EAAoB,EAApBA,CAAuB,SACnCG,EAAOD,QAAU,SAAUuD,GACzB,IAAIiV,EACJ,OAAOlV,EAASC,MAASiV,EAAWjV,EAAGgV,MAAY5Y,KAAc6Y,EAAsB,UAAXhC,EAAIjT,MAM5E,SAAUtD,EAAQD,EAASF,GAIjC,IAAIwK,EAAUxK,EAAoB,IAC9BkC,EAAUlC,EAAoB,GAC9B+B,EAAW/B,EAAoB,IAC/B8B,EAAO9B,EAAoB,IAC3ByL,EAAYzL,EAAoB,IAChC2Y,EAAc3Y,EAAoB,IAClC4Y,EAAiB5Y,EAAoB,IACrCwG,EAAiBxG,EAAoB,IACrCqO,EAAWrO,EAAoB,EAApBA,CAAuB,YAClC6Y,IAAU,GAAGtP,MAAQ,QAAU,GAAGA,QAGlCuP,EAAS,SAETC,EAAa,WAAc,OAAO/S,MAEtC7F,EAAOD,QAAU,SAAUqT,EAAMrM,EAAM+P,EAAaxG,EAAMuI,EAASC,EAAQC,GACzEP,EAAY1B,EAAa/P,EAAMuJ,GAC/B,IAeI0I,EAAS9W,EAAK+W,EAfdC,EAAY,SAAUC,GACxB,IAAKT,GAASS,KAAQvI,EAAO,OAAOA,EAAMuI,GAC1C,OAAQA,GACN,IAVK,OAUM,OAAO,SAAS/P,OAAS,OAAO,IAAI0N,EAAYjR,KAAMsT,IACjE,KAAKR,EAAQ,OAAO,SAAS1L,SAAW,OAAO,IAAI6J,EAAYjR,KAAMsT,IACrE,OAAO,SAAS/L,UAAY,OAAO,IAAI0J,EAAYjR,KAAMsT,KAEzDhL,EAAMpH,EAAO,YACbqS,EAAaP,GAAWF,EACxBU,GAAa,EACbzI,EAAQwC,EAAK/R,UACbiY,EAAU1I,EAAM1C,IAAa0C,EAnBjB,eAmBuCiI,GAAWjI,EAAMiI,GACpEU,EAAWD,GAAWJ,EAAUL,GAChCW,EAAWX,EAAWO,EAAwBF,EAAU,WAArBK,EAAkC7Z,GACrE+Z,EAAqB,SAAR1S,GAAkB6J,EAAMxD,SAAqBkM,EAwB9D,GArBIG,IACFR,EAAoB5S,EAAeoT,EAAWtZ,KAAK,IAAIiT,OAC7B1S,OAAOW,WAAa4X,EAAkB3I,OAE9DmI,EAAeQ,EAAmB9K,GAAK,GAElC9D,GAAiD,mBAA/B4O,EAAkB/K,IAAyBvM,EAAKsX,EAAmB/K,EAAU0K,IAIpGQ,GAAcE,GAAWA,EAAQ/Y,OAASoY,IAC5CU,GAAa,EACbE,EAAW,SAAStM,SAAW,OAAOqM,EAAQnZ,KAAK0F,QAG/CwE,IAAW0O,IAAYL,IAASW,GAAezI,EAAM1C,IACzDvM,EAAKiP,EAAO1C,EAAUqL,GAGxBjO,EAAUvE,GAAQwS,EAClBjO,EAAU6C,GAAOyK,EACbC,EAMF,GALAG,EAAU,CACR/L,OAAQmM,EAAaG,EAAWL,EAAUP,GAC1CvP,KAAM0P,EAASS,EAAWL,EAhDrB,QAiDL9L,QAASoM,GAEPT,EAAQ,IAAK7W,KAAO8W,EAChB9W,KAAO0O,GAAQhP,EAASgP,EAAO1O,EAAK8W,EAAQ9W,SAC7CH,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAKmW,GAASW,GAAatS,EAAMiS,GAEtE,OAAOA,IAMH,SAAUhZ,EAAQD,EAASF,GAIjC,IAAI8I,EAAS9I,EAAoB,IAC7B6Z,EAAa7Z,EAAoB,IACjC4Y,EAAiB5Y,EAAoB,IACrCoZ,EAAoB,GAGxBpZ,EAAoB,GAApBA,CAAwBoZ,EAAmBpZ,EAAoB,EAApBA,CAAuB,YAAa,WAAc,OAAOgG,OAEpG7F,EAAOD,QAAU,SAAU+W,EAAa/P,EAAMuJ,GAC5CwG,EAAYzV,UAAYsH,EAAOsQ,EAAmB,CAAE3I,KAAMoJ,EAAW,EAAGpJ,KACxEmI,EAAe3B,EAAa/P,EAAO,eAM/B,SAAU/G,EAAQD,EAASF,GAEjC,IAAIqO,EAAWrO,EAAoB,EAApBA,CAAuB,YAClC8Z,GAAe,EAEnB,IACE,IAAIC,EAAQ,CAAC,GAAG1L,KAChB0L,EAAc,UAAI,WAAcD,GAAe,GAE/CxN,MAAM4D,KAAK6J,EAAO,WAAc,MAAM,IACtC,MAAOhW,IAET5D,EAAOD,QAAU,SAAU4D,EAAMkW,GAC/B,IAAKA,IAAgBF,EAAc,OAAO,EAC1C,IAAInU,GAAO,EACX,IACE,IAAIsU,EAAM,CAAC,GACP7F,EAAO6F,EAAI5L,KACf+F,EAAK3D,KAAO,WAAc,MAAO,CAAEC,KAAM/K,GAAO,IAChDsU,EAAI5L,GAAY,WAAc,OAAO+F,GACrCtQ,EAAKmW,GACL,MAAOlW,IACT,OAAO4B,IAMH,SAAUxF,EAAQD,EAASF,GAKjC,IAAIoE,EAAWpE,EAAoB,GACnCG,EAAOD,QAAU,WACf,IAAIsH,EAAOpD,EAAS4B,MAChBmD,EAAS,GAMb,OALI3B,EAAK5F,SAAQuH,GAAU,KACvB3B,EAAK0S,aAAY/Q,GAAU,KAC3B3B,EAAK2S,YAAWhR,GAAU,KAC1B3B,EAAK4S,UAASjR,GAAU,KACxB3B,EAAK6S,SAAQlR,GAAU,KACpBA,IAMH,SAAUhJ,EAAQD,EAASF,GAIjC,IAAI8B,EAAO9B,EAAoB,IAC3B+B,EAAW/B,EAAoB,IAC/B0G,EAAQ1G,EAAoB,GAC5B+E,EAAU/E,EAAoB,IAC9BoL,EAAMpL,EAAoB,GAE9BG,EAAOD,QAAU,SAAUiI,EAAKd,EAAQvD,GACtC,IAAIwW,EAASlP,EAAIjD,GACboS,EAAMzW,EAAKiB,EAASuV,EAAQ,GAAGnS,IAC/BqS,EAAQD,EAAI,GACZE,EAAOF,EAAI,GACX7T,EAAM,WACR,IAAIjC,EAAI,GAER,OADAA,EAAE6V,GAAU,WAAc,OAAO,GACZ,GAAd,GAAGnS,GAAK1D,OAEf1C,EAAS+D,OAAOtE,UAAW2G,EAAKqS,GAChC1Y,EAAK0V,OAAOhW,UAAW8Y,EAAkB,GAAVjT,EAG3B,SAAUR,EAAQiB,GAAO,OAAO2S,EAAKna,KAAKuG,EAAQb,KAAM8B,IAGxD,SAAUjB,GAAU,OAAO4T,EAAKna,KAAKuG,EAAQb,WAQ/C,SAAU7F,EAAQD,EAASF,GAGjC,IAAIoE,EAAWpE,EAAoB,GAC/BsH,EAAYtH,EAAoB,IAChCgX,EAAUhX,EAAoB,EAApBA,CAAuB,WACrCG,EAAOD,QAAU,SAAUuE,EAAGiW,GAC5B,IACIxX,EADAwM,EAAItL,EAASK,GAAGgC,YAEpB,OAAOiJ,IAAM7P,KAAcqD,EAAIkB,EAASsL,GAAGsH,KAAanX,GAAY6a,EAAIpT,EAAUpE,KAM9E,SAAU/C,EAAQD,EAASF,GAEjC,IACI2a,EADS3a,EAAoB,GACV2a,UAEvBxa,EAAOD,QAAUya,GAAaA,EAAUC,WAAa,IAK/C,SAAUza,EAAQD,EAASF,GAIjC,IAAI4B,EAAS5B,EAAoB,GAC7BkC,EAAUlC,EAAoB,GAC9B+B,EAAW/B,EAAoB,IAC/B6K,EAAc7K,EAAoB,IAClC4V,EAAO5V,EAAoB,IAC3B6a,EAAQ7a,EAAoB,IAC5B2K,EAAa3K,EAAoB,IACjCwD,EAAWxD,EAAoB,GAC/B0G,EAAQ1G,EAAoB,GAC5B0L,EAAc1L,EAAoB,IAClC4Y,EAAiB5Y,EAAoB,IACrC8a,EAAoB9a,EAAoB,IAE5CG,EAAOD,QAAU,SAAUgH,EAAMgM,EAASiG,EAAS4B,EAAQvS,EAAQwS,GACjE,IAAIzH,EAAO3R,EAAOsF,GACdwI,EAAI6D,EACJ0H,EAAQzS,EAAS,MAAQ,MACzBuI,EAAQrB,GAAKA,EAAElO,UACfiD,EAAI,GACJyW,EAAY,SAAU/S,GACxB,IAAIZ,EAAKwJ,EAAM5I,GACfpG,EAASgP,EAAO5I,EACP,UAAPA,EAAkB,SAAUvD,GAC1B,QAAOoW,IAAYxX,EAASoB,KAAa2C,EAAGjH,KAAK0F,KAAY,IAANpB,EAAU,EAAIA,IAC5D,OAAPuD,EAAe,SAAShD,IAAIP,GAC9B,QAAOoW,IAAYxX,EAASoB,KAAa2C,EAAGjH,KAAK0F,KAAY,IAANpB,EAAU,EAAIA,IAC5D,OAAPuD,EAAe,SAASlH,IAAI2D,GAC9B,OAAOoW,IAAYxX,EAASoB,GAAK/E,GAAY0H,EAAGjH,KAAK0F,KAAY,IAANpB,EAAU,EAAIA,IAChE,OAAPuD,EAAe,SAASgT,IAAIvW,GAAqC,OAAhC2C,EAAGjH,KAAK0F,KAAY,IAANpB,EAAU,EAAIA,GAAWoB,MACxE,SAASqJ,IAAIzK,EAAG6C,GAAwC,OAAnCF,EAAGjH,KAAK0F,KAAY,IAANpB,EAAU,EAAIA,EAAG6C,GAAWzB,QAGvE,GAAgB,mBAAL0J,IAAqBsL,GAAWjK,EAAMS,UAAY9K,EAAM,YACjE,IAAIgJ,GAAInC,UAAUkD,UAMb,CACL,IAAI2K,EAAW,IAAI1L,EAEf2L,EAAiBD,EAASH,GAAOD,EAAU,IAAM,EAAG,IAAMI,EAE1DE,EAAuB5U,EAAM,WAAc0U,EAASjW,IAAI,KAExDoW,EAAmB7P,EAAY,SAAU0I,GAAQ,IAAI1E,EAAE0E,KAEvDoH,GAAcR,GAAWtU,EAAM,WAIjC,IAFA,IAAI+U,EAAY,IAAI/L,EAChBxG,EAAQ,EACLA,KAASuS,EAAUR,GAAO/R,EAAOA,GACxC,OAAQuS,EAAUtW,KAAK,KAEpBoW,MACH7L,EAAIwD,EAAQ,SAAUjQ,EAAQmT,GAC5BzL,EAAW1H,EAAQyM,EAAGxI,GACtB,IAAIM,EAAOsT,EAAkB,IAAIvH,EAAQtQ,EAAQyM,GAEjD,OADI0G,GAAYvW,IAAWgb,EAAMzE,EAAU5N,EAAQhB,EAAKyT,GAAQzT,GACzDA,KAEPhG,UAAYuP,GACRtK,YAAciJ,IAElB4L,GAAwBE,KAC1BN,EAAU,UACVA,EAAU,OACV1S,GAAU0S,EAAU,SAElBM,GAAcH,IAAgBH,EAAUD,GAExCD,GAAWjK,EAAM2K,cAAc3K,EAAM2K,WApCzChM,EAAIqL,EAAOY,eAAezI,EAAShM,EAAMsB,EAAQyS,GACjDpQ,EAAY6E,EAAElO,UAAW2X,GACzBvD,EAAKC,MAAO,EA4Cd,OAPA+C,EAAelJ,EAAGxI,GAGlBhF,EAAQA,EAAQU,EAAIV,EAAQoB,EAAIpB,EAAQQ,IADxC+B,EAAEyC,GAAQwI,IACwC6D,GAAO9O,GAEpDuW,GAASD,EAAOa,UAAUlM,EAAGxI,EAAMsB,GAEjCkH,IAMH,SAAUvP,EAAQD,EAASF,GAiBjC,IAfA,IASI6b,EATAja,EAAS5B,EAAoB,GAC7B8B,EAAO9B,EAAoB,IAC3BiE,EAAMjE,EAAoB,IAC1B4O,EAAQ3K,EAAI,eACZ4K,EAAO5K,EAAI,QACX6P,KAASlS,EAAO4K,cAAe5K,EAAO8K,UACtCgC,EAASoF,EACT1T,EAAI,EAIJ0b,EAAyB,iHAE3BtW,MAAM,KAEDpF,EAPC,IAQFyb,EAAQja,EAAOka,EAAuB1b,QACxC0B,EAAK+Z,EAAMra,UAAWoN,GAAO,GAC7B9M,EAAK+Z,EAAMra,UAAWqN,GAAM,IACvBH,GAAS,EAGlBvO,EAAOD,QAAU,CACf4T,IAAKA,EACLpF,OAAQA,EACRE,MAAOA,EACPC,KAAMA,IAMF,SAAU1O,EAAQD,EAASF,GAKjCG,EAAOD,QAAUF,EAAoB,MAAQA,EAAoB,EAApBA,CAAuB,WAClE,IAAI+b,EAAInY,KAAK0S,SAGb0F,iBAAiB1b,KAAK,KAAMyb,EAAG,qBACxB/b,EAAoB,GAAG+b,MAM1B,SAAU5b,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAElCG,EAAOD,QAAU,SAAU+b,GACzB/Z,EAAQA,EAAQgB,EAAG+Y,EAAY,CAAErL,GAAI,SAASA,KAG5C,IAFA,IAAIvJ,EAASM,UAAUN,OACnB6U,EAAI,IAAI5P,MAAMjF,GACXA,KAAU6U,EAAE7U,GAAUM,UAAUN,GACvC,OAAO,IAAIrB,KAAKkW,QAOd,SAAU/b,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BsH,EAAYtH,EAAoB,IAChCgC,EAAMhC,EAAoB,IAC1B6a,EAAQ7a,EAAoB,IAEhCG,EAAOD,QAAU,SAAU+b,GACzB/Z,EAAQA,EAAQgB,EAAG+Y,EAAY,CAAE/L,KAAM,SAASA,KAAK9N,GACnD,IACImO,EAAS2L,EAAGhb,EAAGib,EADfC,EAAQzU,UAAU,GAKtB,OAHAL,EAAUtB,OACVuK,EAAU6L,IAAUvc,KACPyH,EAAU8U,GACnBha,GAAUvC,GAAkB,IAAImG,MACpCkW,EAAI,GACA3L,GACFrP,EAAI,EACJib,EAAKna,EAAIoa,EAAOzU,UAAU,GAAI,GAC9BkT,EAAMzY,GAAQ,EAAO,SAAUia,GAC7BH,EAAE9S,KAAK+S,EAAGE,EAAUnb,SAGtB2Z,EAAMzY,GAAQ,EAAO8Z,EAAE9S,KAAM8S,GAExB,IAAIlW,KAAKkW,SAOd,SAAU/b,EAAQD,EAASF,GAEjC,IAAIwD,EAAWxD,EAAoB,GAC/BkK,EAAWlK,EAAoB,GAAGkK,SAElCoS,EAAK9Y,EAAS0G,IAAa1G,EAAS0G,EAASqS,eACjDpc,EAAOD,QAAU,SAAUuD,GACzB,OAAO6Y,EAAKpS,EAASqS,cAAc9Y,GAAM,KAMrC,SAAUtD,EAAQD,EAASF,GAEjC,IAAI4B,EAAS5B,EAAoB,GAC7B6B,EAAO7B,EAAoB,IAC3BwK,EAAUxK,EAAoB,IAC9Bwc,EAASxc,EAAoB,IAC7Bc,EAAiBd,EAAoB,GAAGwE,EAC5CrE,EAAOD,QAAU,SAAUQ,GACzB,IAAI+b,EAAU5a,EAAKqC,SAAWrC,EAAKqC,OAASsG,EAAU,GAAK5I,EAAOsC,QAAU,IACtD,KAAlBxD,EAAKgc,OAAO,IAAehc,KAAQ+b,GAAU3b,EAAe2b,EAAS/b,EAAM,CAAEiE,MAAO6X,EAAOhY,EAAE9D,OAM7F,SAAUP,EAAQD,EAASF,GAEjC,IAAI0U,EAAS1U,EAAoB,GAApBA,CAAwB,QACjCiE,EAAMjE,EAAoB,IAC9BG,EAAOD,QAAU,SAAUmC,GACzB,OAAOqS,EAAOrS,KAASqS,EAAOrS,GAAO4B,EAAI5B,MAMrC,SAAUlC,EAAQD,GAGxBC,EAAOD,QAAU,gGAEfsF,MAAM,MAKF,SAAUrF,EAAQD,EAASF,GAEjC,IAAIkK,EAAWlK,EAAoB,GAAGkK,SACtC/J,EAAOD,QAAUgK,GAAYA,EAASyS,iBAKhC,SAAUxc,EAAQD,EAASF,GAKjC,IAAI4c,EAAU5c,EAAoB,IAC9B6c,EAAO7c,EAAoB,IAC3BiG,EAAMjG,EAAoB,IAC1BqG,EAAWrG,EAAoB,GAC/BgF,EAAUhF,EAAoB,IAC9B8c,EAAUjc,OAAOkc,OAGrB5c,EAAOD,SAAW4c,GAAW9c,EAAoB,EAApBA,CAAuB,WAClD,IAAIkc,EAAI,GACJlZ,EAAI,GAEJE,EAAIgB,SACJ6X,EAAI,uBAGR,OAFAG,EAAEhZ,GAAK,EACP6Y,EAAEvW,MAAM,IAAIgM,QAAQ,SAAUwL,GAAKha,EAAEga,GAAKA,IACd,GAArBF,EAAQ,GAAIZ,GAAGhZ,IAAWrC,OAAO0I,KAAKuT,EAAQ,GAAI9Z,IAAI6C,KAAK,KAAOkW,IACtE,SAASgB,OAAO9Z,EAAQb,GAM3B,IALA,IAAIwU,EAAIvQ,EAASpD,GACboN,EAAO1I,UAAUN,OACjB6B,EAAQ,EACR+T,EAAaJ,EAAKrY,EAClB0Y,EAASjX,EAAIzB,EACH0E,EAAPmH,GAML,IALA,IAIIhO,EAJAa,EAAI8B,EAAQ2C,UAAUuB,MACtBK,EAAO0T,EAAaL,EAAQ1Z,GAAGmR,OAAO4I,EAAW/Z,IAAM0Z,EAAQ1Z,GAC/DmE,EAASkC,EAAKlC,OACd8V,EAAI,EAEQA,EAAT9V,GAAgB6V,EAAO5c,KAAK4C,EAAGb,EAAMkH,EAAK4T,QAAOvG,EAAEvU,GAAOa,EAAEb,IACnE,OAAOuU,GACPkG,GAKE,SAAU3c,EAAQD,EAASF,GAIjC,IAAIwD,EAAWxD,EAAoB,GAC/BoE,EAAWpE,EAAoB,GAC/Bod,EAAQ,SAAU3Y,EAAGsM,GAEvB,GADA3M,EAASK,IACJjB,EAASuN,IAAoB,OAAVA,EAAgB,MAAMrN,UAAUqN,EAAQ,8BAElE5Q,EAAOD,QAAU,CACfmP,IAAKxO,OAAOwc,iBAAmB,aAAe,GAC5C,SAAUlW,EAAMmW,EAAOjO,GACrB,KACEA,EAAMrP,EAAoB,GAApBA,CAAwBoD,SAAS9C,KAAMN,EAAoB,IAAIwE,EAAE3D,OAAOW,UAAW,aAAa6N,IAAK,IACvGlI,EAAM,IACVmW,IAAUnW,aAAgBmF,OAC1B,MAAOvI,GAAKuZ,GAAQ,EACtB,OAAO,SAASD,eAAe5Y,EAAGsM,GAIhC,OAHAqM,EAAM3Y,EAAGsM,GACLuM,EAAO7Y,EAAE8Y,UAAYxM,EACpB1B,EAAI5K,EAAGsM,GACLtM,GAVX,CAYE,IAAI,GAAS5E,IACjBud,MAAOA,IAMH,SAAUjd,EAAQD,GAGxBC,EAAOD,QAAU,SAAUqH,EAAIiW,EAAMhW,GACnC,IAAIiW,EAAKjW,IAAS3H,GAClB,OAAQ2d,EAAKnW,QACX,KAAK,EAAG,OAAOoW,EAAKlW,IACAA,EAAGjH,KAAKkH,GAC5B,KAAK,EAAG,OAAOiW,EAAKlW,EAAGiW,EAAK,IACRjW,EAAGjH,KAAKkH,EAAMgW,EAAK,IACvC,KAAK,EAAG,OAAOC,EAAKlW,EAAGiW,EAAK,GAAIA,EAAK,IACjBjW,EAAGjH,KAAKkH,EAAMgW,EAAK,GAAIA,EAAK,IAChD,KAAK,EAAG,OAAOC,EAAKlW,EAAGiW,EAAK,GAAIA,EAAK,GAAIA,EAAK,IAC1BjW,EAAGjH,KAAKkH,EAAMgW,EAAK,GAAIA,EAAK,GAAIA,EAAK,IACzD,KAAK,EAAG,OAAOC,EAAKlW,EAAGiW,EAAK,GAAIA,EAAK,GAAIA,EAAK,GAAIA,EAAK,IACnCjW,EAAGjH,KAAKkH,EAAMgW,EAAK,GAAIA,EAAK,GAAIA,EAAK,GAAIA,EAAK,IAClE,OAAOjW,EAAGG,MAAMF,EAAMgW,KAMpB,SAAUrd,EAAQD,EAASF,GAEjC,IAAIwD,EAAWxD,EAAoB,GAC/Bqd,EAAiBrd,EAAoB,IAAIqP,IAC7ClP,EAAOD,QAAU,SAAUsH,EAAMvE,EAAQyM,GACvC,IACI5M,EADAI,EAAID,EAAOwD,YAIb,OAFEvD,IAAMwM,GAAiB,mBAALxM,IAAoBJ,EAAII,EAAE1B,aAAekO,EAAElO,WAAagC,EAASV,IAAMua,GAC3FA,EAAe7V,EAAM1E,GACd0E,IAML,SAAUrH,EAAQD,GAExBC,EAAOD,QAAU,oDAMX,SAAUC,EAAQD,EAASF,GAIjC,IAAI6E,EAAY7E,EAAoB,IAChC+E,EAAU/E,EAAoB,IAElCG,EAAOD,QAAU,SAASwd,OAAOC,GAC/B,IAAIC,EAAM9X,OAAOf,EAAQiB,OACrBiD,EAAM,GACN/H,EAAI2D,EAAU8Y,GAClB,GAAIzc,EAAI,GAAKA,GAAK2c,SAAU,MAAM7R,WAAW,2BAC7C,KAAU,EAAJ9K,GAAQA,KAAO,KAAO0c,GAAOA,GAAc,EAAJ1c,IAAO+H,GAAO2U,GAC3D,OAAO3U,IAMH,SAAU9I,EAAQD,GAGxBC,EAAOD,QAAU0D,KAAKka,MAAQ,SAASA,KAAKC,GAE1C,OAAmB,IAAXA,GAAKA,IAAWA,GAAKA,EAAIA,EAAIA,EAAI,GAAK,EAAI,IAM9C,SAAU5d,EAAQD,GAGxB,IAAI8d,EAASpa,KAAKqa,MAClB9d,EAAOD,SAAY8d,GAED,mBAAbA,EAAO,KAA4BA,EAAO,IAAM,qBAE7B,OAAnBA,GAAQ,OACT,SAASC,MAAMF,GACjB,OAAmB,IAAXA,GAAKA,GAAUA,GAAS,KAALA,GAAaA,EAAI,KAAOA,EAAIA,EAAIA,EAAI,EAAIna,KAAKpB,IAAIub,GAAK,GAC/EC,GAKE,SAAU7d,EAAQD,EAASF,GAEjC,IAAI6E,EAAY7E,EAAoB,IAChC+E,EAAU/E,EAAoB,IAGlCG,EAAOD,QAAU,SAAUmF,GACzB,OAAO,SAAUmC,EAAM0W,GACrB,IAGItZ,EAAG6C,EAHH9F,EAAImE,OAAOf,EAAQyC,IACnBpH,EAAIyE,EAAUqZ,GACd7d,EAAIsB,EAAE0F,OAEV,OAAIjH,EAAI,GAAUC,GAALD,EAAeiF,EAAY,GAAKxF,IAC7C+E,EAAIjD,EAAEwc,WAAW/d,IACN,OAAc,MAAJwE,GAAcxE,EAAI,IAAMC,IAAMoH,EAAI9F,EAAEwc,WAAW/d,EAAI,IAAM,OAAc,MAAJqH,EACpFpC,EAAY1D,EAAE+a,OAAOtc,GAAKwE,EAC1BS,EAAY1D,EAAEiG,MAAMxH,EAAGA,EAAI,GAA2BqH,EAAI,OAAzB7C,EAAI,OAAU,IAAqB,SAOtE,SAAUzE,EAAQD,EAASF,GAGjC,IAAI0Y,EAAW1Y,EAAoB,IAC/B+E,EAAU/E,EAAoB,IAElCG,EAAOD,QAAU,SAAUsH,EAAM4W,EAAclX,GAC7C,GAAIwR,EAAS0F,GAAe,MAAM1a,UAAU,UAAYwD,EAAO,0BAC/D,OAAOpB,OAAOf,EAAQyC,MAMlB,SAAUrH,EAAQD,EAASF,GAEjC,IAAIyY,EAAQzY,EAAoB,EAApBA,CAAuB,SACnCG,EAAOD,QAAU,SAAUiI,GACzB,IAAIkW,EAAK,IACT,IACE,MAAMlW,GAAKkW,GACX,MAAOta,GACP,IAEE,OADAsa,EAAG5F,IAAS,GACJ,MAAMtQ,GAAKkW,GACnB,MAAO7Z,KACT,OAAO,IAML,SAAUrE,EAAQD,EAASF,GAGjC,IAAIyL,EAAYzL,EAAoB,IAChCqO,EAAWrO,EAAoB,EAApBA,CAAuB,YAClCqM,EAAaC,MAAM9K,UAEvBrB,EAAOD,QAAU,SAAUuD,GACzB,OAAOA,IAAO5D,KAAc4L,EAAUa,QAAU7I,GAAM4I,EAAWgC,KAAc5K,KAM3E,SAAUtD,EAAQD,EAASF,GAIjC,IAAIse,EAAkBte,EAAoB,GACtCkF,EAAalF,EAAoB,IAErCG,EAAOD,QAAU,SAAUoB,EAAQ4H,EAAOvE,GACpCuE,KAAS5H,EAAQgd,EAAgB9Z,EAAElD,EAAQ4H,EAAOhE,EAAW,EAAGP,IAC/DrD,EAAO4H,GAASvE,IAMjB,SAAUxE,EAAQD,EAASF,GAGjC,IAAIuL,EAAqBvL,EAAoB,KAE7CG,EAAOD,QAAU,SAAUqe,EAAUlX,GACnC,OAAO,IAAKkE,EAAmBgT,GAAxB,CAAmClX,KAMtC,SAAUlH,EAAQD,EAASF,GAKjC,IAAIqG,EAAWrG,EAAoB,GAC/B+K,EAAkB/K,EAAoB,IACtCoI,EAAWpI,EAAoB,GACnCG,EAAOD,QAAU,SAASiR,KAAKxM,GAO7B,IANA,IAAIF,EAAI4B,EAASL,MACbqB,EAASe,EAAS3D,EAAE4C,QACpBgJ,EAAO1I,UAAUN,OACjB6B,EAAQ6B,EAAuB,EAAPsF,EAAW1I,UAAU,GAAK9H,GAAWwH,GAC7D+K,EAAa,EAAP/B,EAAW1I,UAAU,GAAK9H,GAChC2e,EAASpM,IAAQvS,GAAYwH,EAAS0D,EAAgBqH,EAAK/K,GAC/C6B,EAATsV,GAAgB/Z,EAAEyE,KAAWvE,EACpC,OAAOF,IAMH,SAAUtE,EAAQD,EAASF,GAIjC,IAAIye,EAAmBze,EAAoB,IACvCmQ,EAAOnQ,EAAoB,IAC3ByL,EAAYzL,EAAoB,IAChCkG,EAAYlG,EAAoB,IAMpCG,EAAOD,QAAUF,EAAoB,GAApBA,CAAwBsM,MAAO,QAAS,SAAUoS,EAAUpF,GAC3EtT,KAAK8R,GAAK5R,EAAUwY,GACpB1Y,KAAK2Y,GAAK,EACV3Y,KAAK4Y,GAAKtF,GAET,WACD,IAAI7U,EAAIuB,KAAK8R,GACTwB,EAAOtT,KAAK4Y,GACZ1V,EAAQlD,KAAK2Y,KACjB,OAAKla,GAAcA,EAAE4C,QAAX6B,GACRlD,KAAK8R,GAAKjY,GACHsQ,EAAK,IAEaA,EAAK,EAApB,QAARmJ,EAA+BpQ,EACvB,UAARoQ,EAAiC7U,EAAEyE,GACxB,CAACA,EAAOzE,EAAEyE,MACxB,UAGHuC,EAAUoT,UAAYpT,EAAUa,MAEhCmS,EAAiB,QACjBA,EAAiB,UACjBA,EAAiB,YAKX,SAAUte,EAAQD,GAExBC,EAAOD,QAAU,SAAUwQ,EAAM/L,GAC/B,MAAO,CAAEA,MAAOA,EAAO+L,OAAQA,KAM3B,SAAUvQ,EAAQD,EAASF,GAEjC,IAaI8e,EAAOC,EAASC,EAbhBhd,EAAMhC,EAAoB,IAC1Bif,EAASjf,EAAoB,IAC7Bkf,EAAOlf,EAAoB,IAC3Bmf,EAAMnf,EAAoB,IAC1B4B,EAAS5B,EAAoB,GAC7Bof,EAAUxd,EAAOwd,QACjBC,EAAUzd,EAAO0d,aACjBC,EAAY3d,EAAO4d,eACnBC,EAAiB7d,EAAO6d,eACxBC,EAAW9d,EAAO8d,SAClBC,EAAU,EACVC,EAAQ,GACRC,EAAqB,qBAErBC,EAAM,WACR,IAAIxK,GAAMtP,KAEV,GAAI4Z,EAAMne,eAAe6T,GAAK,CAC5B,IAAI/N,EAAKqY,EAAMtK,UACRsK,EAAMtK,GACb/N,MAGAwY,EAAW,SAAUC,GACvBF,EAAIxf,KAAK0f,EAAMrM,OAGZ0L,GAAYE,IACfF,EAAU,SAASC,aAAa/X,GAG9B,IAFA,IAAIiW,EAAO,GACPpd,EAAI,EACkBA,EAAnBuH,UAAUN,QAAYmW,EAAKpU,KAAKzB,UAAUvH,MAMjD,OALAwf,IAAQD,GAAW,WAEjBV,EAAoB,mBAAN1X,EAAmBA,EAAKnE,SAASmE,GAAKiW,IAEtDsB,EAAMa,GACCA,GAETJ,EAAY,SAASC,eAAelK,UAC3BsK,EAAMtK,IAGyB,WAApCtV,EAAoB,GAApBA,CAAwBof,GAC1BN,EAAQ,SAAUxJ,GAChB8J,EAAQa,SAASje,EAAI8d,EAAKxK,EAAI,KAGvBoK,GAAYA,EAASQ,IAC9BpB,EAAQ,SAAUxJ,GAChBoK,EAASQ,IAAIle,EAAI8d,EAAKxK,EAAI,KAGnBmK,GAETT,GADAD,EAAU,IAAIU,GACCU,MACfpB,EAAQqB,MAAMC,UAAYN,EAC1BjB,EAAQ9c,EAAIgd,EAAKsB,YAAatB,EAAM,IAG3Bpd,EAAO2e,kBAA0C,mBAAfD,cAA8B1e,EAAO4e,eAChF1B,EAAQ,SAAUxJ,GAChB1T,EAAO0e,YAAYhL,EAAK,GAAI,MAE9B1T,EAAO2e,iBAAiB,UAAWR,GAAU,IAG7CjB,EADSe,KAAsBV,EAAI,UAC3B,SAAU7J,GAChB4J,EAAKnV,YAAYoV,EAAI,WAAWU,GAAsB,WACpDX,EAAKuB,YAAYza,MACjB8Z,EAAIxf,KAAKgV,KAKL,SAAUA,GAChBoL,WAAW1e,EAAI8d,EAAKxK,EAAI,GAAI,KAIlCnV,EAAOD,QAAU,CACfmP,IAAKgQ,EACL3D,MAAO6D,IAMH,SAAUpf,EAAQD,EAASF,GAEjC,IAAI4B,EAAS5B,EAAoB,GAC7B2gB,EAAY3gB,EAAoB,IAAIqP,IACpCuR,EAAWhf,EAAOif,kBAAoBjf,EAAOkf,uBAC7C1B,EAAUxd,EAAOwd,QACjB2B,EAAUnf,EAAOmf,QACjBC,EAA6C,WAApChhB,EAAoB,GAApBA,CAAwBof,GAErCjf,EAAOD,QAAU,WACf,IAAI+gB,EAAMC,EAAMC,EAEZC,EAAQ,WACV,IAAIC,EAAQ9Z,EAEZ,IADIyZ,IAAWK,EAASjC,EAAQkC,SAASD,EAAOE,OACzCN,GAAM,CACX1Z,EAAK0Z,EAAK1Z,GACV0Z,EAAOA,EAAKxQ,KACZ,IACElJ,IACA,MAAOxD,GAGP,MAFIkd,EAAME,IACLD,EAAOrhB,GACNkE,GAERmd,EAAOrhB,GACLwhB,GAAQA,EAAOG,SAIrB,GAAIR,EACFG,EAAS,WACP/B,EAAQa,SAASmB,SAGd,IAAIR,GAAchf,EAAO+Y,WAAa/Y,EAAO+Y,UAAU8G,WAQvD,GAAIV,GAAWA,EAAQW,QAAS,CAErC,IAAIC,EAAUZ,EAAQW,QAAQ7hB,IAC9BshB,EAAS,WACPQ,EAAQC,KAAKR,SASfD,EAAS,WAEPR,EAAUrgB,KAAKsB,EAAQwf,QAvBgD,CACzE,IAAIS,GAAS,EACTC,EAAO5X,SAAS6X,eAAe,IACnC,IAAInB,EAASQ,GAAOY,QAAQF,EAAM,CAAEG,eAAe,IACnDd,EAAS,WACPW,EAAKnO,KAAOkO,GAAUA,GAsB1B,OAAO,SAAUta,GACf,IAAI2a,EAAO,CAAE3a,GAAIA,EAAIkJ,KAAM5Q,IACvBqhB,IAAMA,EAAKzQ,KAAOyR,GACjBjB,IACHA,EAAOiB,EACPf,KACAD,EAAOgB,KAOP,SAAU/hB,EAAQD,EAASF,GAKjC,IAAIsH,EAAYtH,EAAoB,IAEpC,SAASmiB,kBAAkBzS,GACzB,IAAIgS,EAASU,EACbpc,KAAK2b,QAAU,IAAIjS,EAAE,SAAU2S,EAAWC,GACxC,GAAIZ,IAAY7hB,IAAauiB,IAAWviB,GAAW,MAAM6D,UAAU,2BACnEge,EAAUW,EACVD,EAASE,IAEXtc,KAAK0b,QAAUpa,EAAUoa,GACzB1b,KAAKoc,OAAS9a,EAAU8a,GAG1BjiB,EAAOD,QAAQsE,EAAI,SAAUkL,GAC3B,OAAO,IAAIyS,kBAAkBzS,KAMzB,SAAUvP,EAAQD,EAASF,GAGjC,IAAIkL,EAAOlL,EAAoB,IAC3B6c,EAAO7c,EAAoB,IAC3BoE,EAAWpE,EAAoB,GAC/BuiB,EAAUviB,EAAoB,GAAGuiB,QACrCpiB,EAAOD,QAAUqiB,GAAWA,EAAQC,SAAW,SAASA,QAAQ/e,GAC9D,IAAI8F,EAAO2B,EAAK1G,EAAEJ,EAASX,IACvBwZ,EAAaJ,EAAKrY,EACtB,OAAOyY,EAAa1T,EAAK8K,OAAO4I,EAAWxZ,IAAO8F,IAM9C,SAAUpJ,EAAQD,EAASF,GAIjC,IAAI4B,EAAS5B,EAAoB,GAC7B+W,EAAc/W,EAAoB,GAClCwK,EAAUxK,EAAoB,IAC9ByK,EAASzK,EAAoB,IAC7B8B,EAAO9B,EAAoB,IAC3B6K,EAAc7K,EAAoB,IAClC0G,EAAQ1G,EAAoB,GAC5B2K,EAAa3K,EAAoB,IACjC6E,EAAY7E,EAAoB,IAChCoI,EAAWpI,EAAoB,GAC/B8K,EAAU9K,EAAoB,KAC9BkL,EAAOlL,EAAoB,IAAIwE,EAC/BD,EAAKvE,EAAoB,GAAGwE,EAC5BoH,EAAY5L,EAAoB,IAChC4Y,EAAiB5Y,EAAoB,IACrCkM,EAAe,cACfuW,EAAY,WACZxgB,EAAY,YAEZygB,EAAc,eACdnW,EAAe3K,EAAOsK,GACtBO,EAAY7K,EAAO6gB,GACnB7e,EAAOhC,EAAOgC,KACdoI,EAAapK,EAAOoK,WAEpB6R,EAAWjc,EAAOic,SAClB8E,EAAapW,EACbqW,EAAMhf,EAAKgf,IACXC,EAAMjf,EAAKif,IACX5a,EAAQrE,EAAKqE,MACb6a,EAAMlf,EAAKkf,IACXC,EAAMnf,EAAKmf,IAEXC,EAAc,aACdC,EAAc,aACdC,EAAUnM,EAAc,KAHf,SAIToM,EAAUpM,EAAc,KAAOiM,EAC/BI,EAAUrM,EAAc,KAAOkM,EAGnC,SAASI,YAAY1e,EAAO2e,EAAMC,GAChC,IAOIxf,EAAGxD,EAAGC,EAPN2O,EAAS,IAAI7C,MAAMiX,GACnBC,EAAgB,EAATD,EAAaD,EAAO,EAC3BG,GAAQ,GAAKD,GAAQ,EACrBE,EAAQD,GAAQ,EAChBE,EAAc,KAATL,EAAcT,EAAI,GAAI,IAAMA,EAAI,GAAI,IAAM,EAC/CziB,EAAI,EACJuB,EAAIgD,EAAQ,GAAe,IAAVA,GAAe,EAAIA,EAAQ,EAAI,EAAI,EAkCxD,KAhCAA,EAAQie,EAAIje,KAECA,GAASA,IAAUkZ,GAE9Btd,EAAIoE,GAASA,EAAQ,EAAI,EACzBZ,EAAI0f,IAEJ1f,EAAIkE,EAAM6a,EAAIne,GAASoe,GACnBpe,GAASnE,EAAIqiB,EAAI,GAAI9e,IAAM,IAC7BA,IACAvD,GAAK,GAOU,IAJfmE,GADe,GAAbZ,EAAI2f,EACGC,EAAKnjB,EAELmjB,EAAKd,EAAI,EAAG,EAAIa,IAEfljB,IACVuD,IACAvD,GAAK,GAEUijB,GAAb1f,EAAI2f,GACNnjB,EAAI,EACJwD,EAAI0f,GACkB,GAAb1f,EAAI2f,GACbnjB,GAAKoE,EAAQnE,EAAI,GAAKqiB,EAAI,EAAGS,GAC7Bvf,GAAQ2f,IAERnjB,EAAIoE,EAAQke,EAAI,EAAGa,EAAQ,GAAKb,EAAI,EAAGS,GACvCvf,EAAI,IAGO,GAARuf,EAAWnU,EAAO/O,KAAW,IAAJG,EAASA,GAAK,IAAK+iB,GAAQ,GAG3D,IAFAvf,EAAIA,GAAKuf,EAAO/iB,EAChBijB,GAAQF,EACM,EAAPE,EAAUrU,EAAO/O,KAAW,IAAJ2D,EAASA,GAAK,IAAKyf,GAAQ,GAE1D,OADArU,IAAS/O,IAAU,IAAJuB,EACRwN,EAET,SAASyU,cAAczU,EAAQmU,EAAMC,GACnC,IAOIhjB,EAPAijB,EAAgB,EAATD,EAAaD,EAAO,EAC3BG,GAAQ,GAAKD,GAAQ,EACrBE,EAAQD,GAAQ,EAChBI,EAAQL,EAAO,EACfpjB,EAAImjB,EAAS,EACb5hB,EAAIwN,EAAO/O,KACX2D,EAAQ,IAAJpC,EAGR,IADAA,IAAM,EACS,EAARkiB,EAAW9f,EAAQ,IAAJA,EAAUoL,EAAO/O,GAAIA,IAAKyjB,GAAS,GAIzD,IAHAtjB,EAAIwD,GAAK,IAAM8f,GAAS,EACxB9f,KAAO8f,EACPA,GAASP,EACM,EAARO,EAAWtjB,EAAQ,IAAJA,EAAU4O,EAAO/O,GAAIA,IAAKyjB,GAAS,GACzD,GAAU,IAAN9f,EACFA,EAAI,EAAI2f,MACH,CAAA,GAAI3f,IAAM0f,EACf,OAAOljB,EAAIujB,IAAMniB,GAAKkc,EAAWA,EAEjCtd,GAAQsiB,EAAI,EAAGS,GACfvf,GAAQ2f,EACR,OAAQ/hB,GAAK,EAAI,GAAKpB,EAAIsiB,EAAI,EAAG9e,EAAIuf,GAGzC,SAASS,UAAUC,GACjB,OAAOA,EAAM,IAAM,GAAKA,EAAM,IAAM,GAAKA,EAAM,IAAM,EAAIA,EAAM,GAEjE,SAASC,OAAOxgB,GACd,MAAO,CAAM,IAALA,GAEV,SAASygB,QAAQzgB,GACf,MAAO,CAAM,IAALA,EAAWA,GAAM,EAAI,KAE/B,SAAS0gB,QAAQ1gB,GACf,MAAO,CAAM,IAALA,EAAWA,GAAM,EAAI,IAAMA,GAAM,GAAK,IAAMA,GAAM,GAAK,KAEjE,SAAS2gB,QAAQ3gB,GACf,OAAO4f,YAAY5f,EAAI,GAAI,GAE7B,SAAS4gB,QAAQ5gB,GACf,OAAO4f,YAAY5f,EAAI,GAAI,GAG7B,SAASqM,UAAUJ,EAAGrN,EAAK0N,GACzBxL,EAAGmL,EAAEzN,GAAYI,EAAK,CAAEpB,IAAK,WAAc,OAAO+E,KAAK+J,MAGzD,SAAS9O,IAAIqjB,EAAMN,EAAO9a,EAAOqb,GAC/B,IACIC,EAAW1Z,GADC5B,GAEhB,GAAuBob,EAAKnB,GAAxBqB,EAAWR,EAAuB,MAAMhY,EAAW0W,GACvD,IACIzR,EAAQuT,EAAWF,EAAKlB,GACxBqB,EAFQH,EAAKpB,GAASwB,GAET9c,MAAMqJ,EAAOA,EAAQ+S,GACtC,OAAOO,EAAiBE,EAAOA,EAAK3S,UAEtC,SAASzC,IAAIiV,EAAMN,EAAO9a,EAAOyb,EAAYhgB,EAAO4f,GAClD,IACIC,EAAW1Z,GADC5B,GAEhB,GAAuBob,EAAKnB,GAAxBqB,EAAWR,EAAuB,MAAMhY,EAAW0W,GAIvD,IAHA,IAAI1e,EAAQsgB,EAAKpB,GAASwB,GACtBzT,EAAQuT,EAAWF,EAAKlB,GACxBqB,EAAOE,GAAYhgB,GACdvE,EAAI,EAAGA,EAAI4jB,EAAO5jB,IAAK4D,EAAMiN,EAAQ7Q,GAAKqkB,EAAKF,EAAiBnkB,EAAI4jB,EAAQ5jB,EAAI,GAG3F,GAAKqK,EAAOqJ,IAgFL,CACL,IAAKpN,EAAM,WACT6F,EAAa,OACR7F,EAAM,WACX,IAAI6F,GAAc,MACd7F,EAAM,WAIV,OAHA,IAAI6F,EACJ,IAAIA,EAAa,KACjB,IAAIA,EAAauX,KACVvX,EAAa7L,MAAQwL,IAC1B,CAMF,IADA,IACyC7J,EADrCuiB,GAJJrY,EAAe,SAASC,YAAYnF,GAElC,OADAsD,EAAW3E,KAAMuG,GACV,IAAIoW,EAAW7X,EAAQzD,MAEIpF,GAAa0gB,EAAW1gB,GACnDsH,EAAO2B,EAAKyX,GAAaxF,EAAI,EAAsBA,EAAd5T,EAAKlC,SAC1ChF,EAAMkH,EAAK4T,QAAS5Q,GAAezK,EAAKyK,EAAclK,EAAKsgB,EAAWtgB,IAE1EmI,IAASoa,EAAiBne,YAAc8F,GAG/C,IAAI+X,EAAO,IAAI7X,EAAU,IAAIF,EAAa,IACtCsY,EAAWpY,EAAUxK,GAAW6iB,QACpCR,EAAKQ,QAAQ,EAAG,YAChBR,EAAKQ,QAAQ,EAAG,aACZR,EAAKS,QAAQ,IAAOT,EAAKS,QAAQ,IAAIla,EAAY4B,EAAUxK,GAAY,CACzE6iB,QAAS,SAASA,QAAQxS,EAAY3N,GACpCkgB,EAASvkB,KAAK0F,KAAMsM,EAAY3N,GAAS,IAAM,KAEjDqgB,SAAU,SAASA,SAAS1S,EAAY3N,GACtCkgB,EAASvkB,KAAK0F,KAAMsM,EAAY3N,GAAS,IAAM,OAEhD,QAhHH4H,EAAe,SAASC,YAAYnF,GAClCsD,EAAW3E,KAAMuG,EAAcL,GAC/B,IAAI+H,EAAanJ,EAAQzD,GACzBrB,KAAK0e,GAAK9Y,EAAUtL,KAAK,IAAIgM,MAAM2H,GAAa,GAChDjO,KAAKmd,GAAWlP,GAGlBxH,EAAY,SAASC,SAASyC,EAAQmD,EAAY2B,GAChDtJ,EAAW3E,KAAMyG,EAAWgW,GAC5B9X,EAAWwE,EAAQ5C,EAAckW,GACjC,IAAIwC,EAAe9V,EAAOgU,GACtB3T,EAAS3K,EAAUyN,GACvB,GAAI9C,EAAS,GAAcyV,EAATzV,EAAuB,MAAMxD,EAAW,iBAE1D,GAA0BiZ,EAAtBzV,GADJyE,EAAaA,IAAepU,GAAYolB,EAAezV,EAASpH,EAAS6L,IACjC,MAAMjI,EAxJ/B,iBAyJfhG,KAAKkd,GAAW/T,EAChBnJ,KAAKod,GAAW5T,EAChBxJ,KAAKmd,GAAWlP,GAGd8C,IACFjH,UAAUvD,EAAcyW,EAAa,MACrClT,UAAUrD,EAlJD,SAkJoB,MAC7BqD,UAAUrD,EAAWuW,EAAa,MAClClT,UAAUrD,EAAWwW,EAAa,OAGpCpY,EAAY4B,EAAUxK,GAAY,CAChC8iB,QAAS,SAASA,QAAQzS,GACxB,OAAOrR,IAAI+E,KAAM,EAAGsM,GAAY,IAAM,IAAM,IAE9C4S,SAAU,SAASA,SAAS5S,GAC1B,OAAOrR,IAAI+E,KAAM,EAAGsM,GAAY,IAElC6S,SAAU,SAASA,SAAS7S,GAC1B,IAAI0R,EAAQ/iB,IAAI+E,KAAM,EAAGsM,EAAY3K,UAAU,IAC/C,OAAQqc,EAAM,IAAM,EAAIA,EAAM,KAAO,IAAM,IAE7CoB,UAAW,SAASA,UAAU9S,GAC5B,IAAI0R,EAAQ/iB,IAAI+E,KAAM,EAAGsM,EAAY3K,UAAU,IAC/C,OAAOqc,EAAM,IAAM,EAAIA,EAAM,IAE/BqB,SAAU,SAASA,SAAS/S,GAC1B,OAAOyR,UAAU9iB,IAAI+E,KAAM,EAAGsM,EAAY3K,UAAU,MAEtD2d,UAAW,SAASA,UAAUhT,GAC5B,OAAOyR,UAAU9iB,IAAI+E,KAAM,EAAGsM,EAAY3K,UAAU,OAAS,GAE/D4d,WAAY,SAASA,WAAWjT,GAC9B,OAAOsR,cAAc3iB,IAAI+E,KAAM,EAAGsM,EAAY3K,UAAU,IAAK,GAAI,IAEnE6d,WAAY,SAASA,WAAWlT,GAC9B,OAAOsR,cAAc3iB,IAAI+E,KAAM,EAAGsM,EAAY3K,UAAU,IAAK,GAAI,IAEnEmd,QAAS,SAASA,QAAQxS,EAAY3N,GACpC0K,IAAIrJ,KAAM,EAAGsM,EAAY2R,OAAQtf,IAEnCqgB,SAAU,SAASA,SAAS1S,EAAY3N,GACtC0K,IAAIrJ,KAAM,EAAGsM,EAAY2R,OAAQtf,IAEnC8gB,SAAU,SAASA,SAASnT,EAAY3N,GACtC0K,IAAIrJ,KAAM,EAAGsM,EAAY4R,QAASvf,EAAOgD,UAAU,KAErD+d,UAAW,SAASA,UAAUpT,EAAY3N,GACxC0K,IAAIrJ,KAAM,EAAGsM,EAAY4R,QAASvf,EAAOgD,UAAU,KAErDge,SAAU,SAASA,SAASrT,EAAY3N,GACtC0K,IAAIrJ,KAAM,EAAGsM,EAAY6R,QAASxf,EAAOgD,UAAU,KAErDie,UAAW,SAASA,UAAUtT,EAAY3N,GACxC0K,IAAIrJ,KAAM,EAAGsM,EAAY6R,QAASxf,EAAOgD,UAAU,KAErDke,WAAY,SAASA,WAAWvT,EAAY3N,GAC1C0K,IAAIrJ,KAAM,EAAGsM,EAAY+R,QAAS1f,EAAOgD,UAAU,KAErDme,WAAY,SAASA,WAAWxT,EAAY3N,GAC1C0K,IAAIrJ,KAAM,EAAGsM,EAAY8R,QAASzf,EAAOgD,UAAU,OAsCzDiR,EAAerM,EAAcL,GAC7B0M,EAAenM,EAAWgW,GAC1B3gB,EAAK2K,EAAUxK,GAAYwI,EAAOoE,MAAM,GACxC3O,EAAQgM,GAAgBK,EACxBrM,EAAQuiB,GAAahW,GAKf,SAAUtM,EAAQD,GAExBC,EAAOD,QAAU,SAAU6lB,EAAQ9e,GACjC,IAAI+e,EAAW/e,IAAYpG,OAAOoG,GAAW,SAAUgf,GACrD,OAAOhf,EAAQgf,IACbhf,EACJ,OAAO,SAAUxD,GACf,OAAOqC,OAAOrC,GAAIwD,QAAQ8e,EAAQC,MAOhC,SAAU7lB,EAAQD,EAASF,GAEjCG,EAAOD,SAAWF,EAAoB,KAAOA,EAAoB,EAApBA,CAAuB,WAClE,OAA2G,GAApGa,OAAOC,eAAed,EAAoB,GAApBA,CAAwB,OAAQ,IAAK,CAAEiB,IAAK,WAAc,OAAO,KAAQ2D,KAMlG,SAAUzE,EAAQD,EAASF,GAEjCE,EAAQsE,EAAIxE,EAAoB,IAK1B,SAAUG,EAAQD,EAASF,GAEjC,IAAImF,EAAMnF,EAAoB,IAC1BkG,EAAYlG,EAAoB,IAChCkN,EAAelN,EAAoB,GAApBA,EAAwB,GACvCsG,EAAWtG,EAAoB,GAApBA,CAAwB,YAEvCG,EAAOD,QAAU,SAAUoB,EAAQ4kB,GACjC,IAGI7jB,EAHAoC,EAAIyB,EAAU5E,GACdlB,EAAI,EACJ+I,EAAS,GAEb,IAAK9G,KAAOoC,EAAOpC,GAAOiE,GAAUnB,EAAIV,EAAGpC,IAAQ8G,EAAOC,KAAK/G,GAE/D,KAAsBjC,EAAf8lB,EAAM7e,QAAgBlC,EAAIV,EAAGpC,EAAM6jB,EAAM9lB;KAC7C8M,EAAa/D,EAAQ9G,IAAQ8G,EAAOC,KAAK/G,IAE5C,OAAO8G,IAMH,SAAUhJ,EAAQD,EAASF,GAEjC,IAAIuE,EAAKvE,EAAoB,GACzBoE,EAAWpE,EAAoB,GAC/B4c,EAAU5c,EAAoB,IAElCG,EAAOD,QAAUF,EAAoB,GAAKa,OAAOslB,iBAAmB,SAASA,iBAAiB1hB,EAAG8F,GAC/FnG,EAASK,GAKT,IAJA,IAGI3B,EAHAyG,EAAOqT,EAAQrS,GACflD,EAASkC,EAAKlC,OACdjH,EAAI,EAEQA,EAATiH,GAAY9C,EAAGC,EAAEC,EAAG3B,EAAIyG,EAAKnJ,KAAMmK,EAAWzH,IACrD,OAAO2B,IAMH,SAAUtE,EAAQD,EAASF,GAGjC,IAAIkG,EAAYlG,EAAoB,IAChCkL,EAAOlL,EAAoB,IAAIwE,EAC/BuB,EAAW,GAAGA,SAEdqgB,EAA+B,iBAAVziB,QAAsBA,QAAU9C,OAAO4V,oBAC5D5V,OAAO4V,oBAAoB9S,QAAU,GAUzCxD,EAAOD,QAAQsE,EAAI,SAASiS,oBAAoBhT,GAC9C,OAAO2iB,GAAoC,mBAArBrgB,EAASzF,KAAKmD,GATjB,SAAUA,GAC7B,IACE,OAAOyH,EAAKzH,GACZ,MAAOM,GACP,OAAOqiB,EAAYxe,SAK0Cye,CAAe5iB,GAAMyH,EAAKhF,EAAUzC,MAM/F,SAAUtD,EAAQD,EAASF,GAIjC,IAAIsH,EAAYtH,EAAoB,IAChCwD,EAAWxD,EAAoB,GAC/Bif,EAASjf,EAAoB,IAC7BiO,EAAa,GAAGrG,MAChB0e,EAAY,GAUhBnmB,EAAOD,QAAUkD,SAASmjB,MAAQ,SAASA,KAAK/e,GAC9C,IAAID,EAAKD,EAAUtB,MACfwgB,EAAWvY,EAAW3N,KAAKqH,UAAW,GACtC8e,EAAQ,WACV,IAAIjJ,EAAOgJ,EAASnS,OAAOpG,EAAW3N,KAAKqH,YAC3C,OAAO3B,gBAAgBygB,EAbX,SAAU/jB,EAAGgQ,EAAK8K,GAChC,KAAM9K,KAAO4T,GAAY,CACvB,IAAK,IAAIplB,EAAI,GAAId,EAAI,EAAGA,EAAIsS,EAAKtS,IAAKc,EAAEd,GAAK,KAAOA,EAAI,IAExDkmB,EAAU5T,GAAOtP,SAAS,MAAO,gBAAkBlC,EAAE2E,KAAK,KAAO,KACjE,OAAOygB,EAAU5T,GAAKhQ,EAAG8a,GAQMkJ,CAAUnf,EAAIiW,EAAKnW,OAAQmW,GAAQyB,EAAO1X,EAAIiW,EAAMhW,IAGrF,OADIhE,EAAS+D,EAAG/F,aAAYilB,EAAMjlB,UAAY+F,EAAG/F,WAC1CilB,IAMH,SAAUtmB,EAAQD,EAASF,GAEjC,IAAI0W,EAAM1W,EAAoB,IAC9BG,EAAOD,QAAU,SAAUuD,EAAIkjB,GAC7B,GAAiB,iBAANljB,GAA6B,UAAXiT,EAAIjT,GAAiB,MAAMC,UAAUijB,GAClE,OAAQljB,IAMJ,SAAUtD,EAAQD,EAASF,GAGjC,IAAIwD,EAAWxD,EAAoB,GAC/BiI,EAAQrE,KAAKqE,MACjB9H,EAAOD,QAAU,SAAS0mB,UAAUnjB,GAClC,OAAQD,EAASC,IAAOojB,SAASpjB,IAAOwE,EAAMxE,KAAQA,IAMlD,SAAUtD,EAAQD,EAASF,GAEjC,IAAI8mB,EAAc9mB,EAAoB,GAAG+mB,WACrCC,EAAQhnB,EAAoB,IAAI6X,KAEpC1X,EAAOD,QAAU,EAAI4mB,EAAY9mB,EAAoB,IAAM,QAAW6d,SAAW,SAASkJ,WAAWnJ,GACnG,IAAI/W,EAASmgB,EAAMlhB,OAAO8X,GAAM,GAC5BzU,EAAS2d,EAAYjgB,GACzB,OAAkB,IAAXsC,GAAoC,KAApBtC,EAAO6V,OAAO,IAAa,EAAIvT,GACpD2d,GAKE,SAAU3mB,EAAQD,EAASF,GAEjC,IAAIinB,EAAYjnB,EAAoB,GAAGknB,SACnCF,EAAQhnB,EAAoB,IAAI6X,KAChCsP,EAAKnnB,EAAoB,IACzBonB,EAAM,cAEVjnB,EAAOD,QAAmC,IAAzB+mB,EAAUE,EAAK,OAA0C,KAA3BF,EAAUE,EAAK,QAAiB,SAASD,SAAStJ,EAAKyJ,GACpG,IAAIxgB,EAASmgB,EAAMlhB,OAAO8X,GAAM,GAChC,OAAOqJ,EAAUpgB,EAASwgB,IAAU,IAAOD,EAAIjgB,KAAKN,GAAU,GAAK,MACjEogB,GAKE,SAAU9mB,EAAQD,GAGxBC,EAAOD,QAAU0D,KAAK0jB,OAAS,SAASA,MAAMvJ,GAC5C,OAAmB,MAAXA,GAAKA,IAAcA,EAAI,KAAOA,EAAIA,EAAIA,EAAI,EAAIna,KAAKkf,IAAI,EAAI/E,KAM/D,SAAU5d,EAAQD,EAASF,GAGjC,IAAI8d,EAAO9d,EAAoB,IAC3B6iB,EAAMjf,KAAKif,IACX0E,EAAU1E,EAAI,GAAI,IAClB2E,EAAY3E,EAAI,GAAI,IACpB4E,EAAQ5E,EAAI,EAAG,MAAQ,EAAI2E,GAC3BE,EAAQ7E,EAAI,GAAI,KAMpB1iB,EAAOD,QAAU0D,KAAK+jB,QAAU,SAASA,OAAO5J,GAC9C,IAEInZ,EAAGuE,EAFHye,EAAOhkB,KAAKgf,IAAI7E,GAChB8J,EAAQ/J,EAAKC,GAEjB,OAAI6J,EAAOF,EAAcG,GAAwBD,EAAOF,EAAQF,EAPrD,EAAID,EAAU,EAAIA,GAOgDG,EAAQF,EAIxEC,GAFbte,GADAvE,GAAK,EAAI4iB,EAAYD,GAAWK,IAClBhjB,EAAIgjB,KAEIze,GAAUA,EAAe0e,EAAQhK,SAChDgK,EAAQ1e,IAMX,SAAUhJ,EAAQD,EAASF,GAGjC,IAAIoE,EAAWpE,EAAoB,GACnCG,EAAOD,QAAU,SAAUkQ,EAAU7I,EAAI5C,EAAO4I,GAC9C,IACE,OAAOA,EAAUhG,EAAGnD,EAASO,GAAO,GAAIA,EAAM,IAAM4C,EAAG5C,GAEvD,MAAOZ,GACP,IAAI+jB,EAAM1X,EAAiB,UAE3B,MADI0X,IAAQjoB,IAAWuE,EAAS0jB,EAAIxnB,KAAK8P,IACnCrM,KAOJ,SAAU5D,EAAQD,EAASF,GAEjC,IAAIsH,EAAYtH,EAAoB,IAChCqG,EAAWrG,EAAoB,GAC/BgF,EAAUhF,EAAoB,IAC9BoI,EAAWpI,EAAoB,GAEnCG,EAAOD,QAAU,SAAUsH,EAAMwB,EAAYqH,EAAM0X,EAAMC,GACvD1gB,EAAU0B,GACV,IAAIvE,EAAI4B,EAASmB,GACb3D,EAAOmB,EAAQP,GACf4C,EAASe,EAAS3D,EAAE4C,QACpB6B,EAAQ8e,EAAU3gB,EAAS,EAAI,EAC/BjH,EAAI4nB,GAAW,EAAI,EACvB,GAAI3X,EAAO,EAAG,OAAS,CACrB,GAAInH,KAASrF,EAAM,CACjBkkB,EAAOlkB,EAAKqF,GACZA,GAAS9I,EACT,MAGF,GADA8I,GAAS9I,EACL4nB,EAAU9e,EAAQ,EAAI7B,GAAU6B,EAClC,MAAMxF,UAAU,+CAGpB,KAAMskB,EAAmB,GAAT9e,EAAsBA,EAAT7B,EAAgB6B,GAAS9I,EAAO8I,KAASrF,IACpEkkB,EAAO/e,EAAW+e,EAAMlkB,EAAKqF,GAAQA,EAAOzE,IAE9C,OAAOsjB,IAMH,SAAU5nB,EAAQD,EAASF,GAKjC,IAAIqG,EAAWrG,EAAoB,GAC/B+K,EAAkB/K,EAAoB,IACtCoI,EAAWpI,EAAoB,GAEnCG,EAAOD,QAAU,GAAG8Q,YAAc,SAASA,WAAW/N,EAAkBgO,GACtE,IAAIxM,EAAI4B,EAASL,MACb0M,EAAMtK,EAAS3D,EAAE4C,QACjB4gB,EAAKld,EAAgB9H,EAAQyP,GAC7BxC,EAAOnF,EAAgBkG,EAAOyB,GAC9BN,EAAyB,EAAnBzK,UAAUN,OAAaM,UAAU,GAAK9H,GAC5C8d,EAAQ/Z,KAAKkB,KAAKsN,IAAQvS,GAAY6S,EAAM3H,EAAgBqH,EAAKM,IAAQxC,EAAMwC,EAAMuV,GACrFC,EAAM,EAMV,IALIhY,EAAO+X,GAAMA,EAAK/X,EAAOyN,IAC3BuK,GAAO,EACPhY,GAAQyN,EAAQ,EAChBsK,GAAMtK,EAAQ,GAEC,EAAVA,KACDzN,KAAQzL,EAAGA,EAAEwjB,GAAMxjB,EAAEyL,UACbzL,EAAEwjB,GACdA,GAAMC,EACNhY,GAAQgY,EACR,OAAOzjB,IAML,SAAUtE,EAAQD,EAASF,GAG7BA,EAAoB,IAAoB,KAAd,KAAKmoB,OAAcnoB,EAAoB,GAAGwE,EAAEgT,OAAOhW,UAAW,QAAS,CACnGT,cAAc,EACdE,IAAKjB,EAAoB,OAMrB,SAAUG,EAAQD,GAExBC,EAAOD,QAAU,SAAU4D,GACzB,IACE,MAAO,CAAEC,GAAG,EAAO6P,EAAG9P,KACtB,MAAOC,GACP,MAAO,CAAEA,GAAG,EAAM6P,EAAG7P,MAOnB,SAAU5D,EAAQD,EAASF,GAEjC,IAAIoE,EAAWpE,EAAoB,GAC/BwD,EAAWxD,EAAoB,GAC/BooB,EAAuBpoB,EAAoB,IAE/CG,EAAOD,QAAU,SAAUwP,EAAGqO,GAE5B,GADA3Z,EAASsL,GACLlM,EAASua,IAAMA,EAAEtX,cAAgBiJ,EAAG,OAAOqO,EAC/C,IAAIsK,EAAoBD,EAAqB5jB,EAAEkL,GAG/C,OADAgS,EADc2G,EAAkB3G,SACxB3D,GACDsK,EAAkB1G,UAMrB,SAAUxhB,EAAQD,EAASF,GAIjC,IAAIsoB,EAAStoB,EAAoB,KAC7ByP,EAAWzP,EAAoB,IAInCG,EAAOD,QAAUF,EAAoB,GAApBA,CAHP,MAGoC,SAAUiB,GACtD,OAAO,SAASwT,MAAQ,OAAOxT,EAAI+E,KAAyB,EAAnB2B,UAAUN,OAAaM,UAAU,GAAK9H,MAC9E,CAEDoB,IAAK,SAASA,IAAIoB,GAChB,IAAIkmB,EAAQD,EAAOE,SAAS/Y,EAASzJ,KAR/B,OAQ2C3D,GACjD,OAAOkmB,GAASA,EAAM3U,GAGxBvE,IAAK,SAASA,IAAIhN,EAAKsC,GACrB,OAAO2jB,EAAOnR,IAAI1H,EAASzJ,KAbrB,OAayC,IAAR3D,EAAY,EAAIA,EAAKsC,KAE7D2jB,GAAQ,IAKL,SAAUnoB,EAAQD,EAASF,GAIjC,IAAIuE,EAAKvE,EAAoB,GAAGwE,EAC5BsE,EAAS9I,EAAoB,IAC7B6K,EAAc7K,EAAoB,IAClCgC,EAAMhC,EAAoB,IAC1B2K,EAAa3K,EAAoB,IACjC6a,EAAQ7a,EAAoB,IAC5ByoB,EAAczoB,EAAoB,IAClCmQ,EAAOnQ,EAAoB,IAC3B2L,EAAa3L,EAAoB,IACjC+W,EAAc/W,EAAoB,GAClC8V,EAAU9V,EAAoB,IAAI8V,QAClCrG,EAAWzP,EAAoB,IAC/B0oB,EAAO3R,EAAc,KAAO,OAE5ByR,EAAW,SAAUhhB,EAAMnF,GAE7B,IACIkmB,EADArf,EAAQ4M,EAAQzT,GAEpB,GAAc,MAAV6G,EAAe,OAAO1B,EAAKmX,GAAGzV,GAElC,IAAKqf,EAAQ/gB,EAAKmhB,GAAIJ,EAAOA,EAAQA,EAAMrnB,EACzC,GAAIqnB,EAAMvL,GAAK3a,EAAK,OAAOkmB,GAI/BpoB,EAAOD,QAAU,CACfyb,eAAgB,SAAUzI,EAAShM,EAAMsB,EAAQyS,GAC/C,IAAIvL,EAAIwD,EAAQ,SAAU1L,EAAM4O,GAC9BzL,EAAWnD,EAAMkI,EAAGxI,EAAM,MAC1BM,EAAKsQ,GAAK5Q,EACVM,EAAKmX,GAAK7V,EAAO,MACjBtB,EAAKmhB,GAAK9oB,GACV2H,EAAKohB,GAAK/oB,GACV2H,EAAKkhB,GAAQ,EACTtS,GAAYvW,IAAWgb,EAAMzE,EAAU5N,EAAQhB,EAAKyT,GAAQzT,KAsDlE,OApDAqD,EAAY6E,EAAElO,UAAW,CAGvBka,MAAO,SAASA,QACd,IAAK,IAAIlU,EAAOiI,EAASzJ,KAAMkB,GAAOyM,EAAOnM,EAAKmX,GAAI4J,EAAQ/gB,EAAKmhB,GAAIJ,EAAOA,EAAQA,EAAMrnB,EAC1FqnB,EAAMM,GAAI,EACNN,EAAM7mB,IAAG6mB,EAAM7mB,EAAI6mB,EAAM7mB,EAAER,EAAIrB,WAC5B8T,EAAK4U,EAAMnoB,GAEpBoH,EAAKmhB,GAAKnhB,EAAKohB,GAAK/oB,GACpB2H,EAAKkhB,GAAQ,GAIfI,SAAU,SAAUzmB,GAClB,IAAImF,EAAOiI,EAASzJ,KAAMkB,GACtBqhB,EAAQC,EAAShhB,EAAMnF,GAC3B,GAAIkmB,EAAO,CACT,IAAI9X,EAAO8X,EAAMrnB,EACb6nB,EAAOR,EAAM7mB,SACV8F,EAAKmX,GAAG4J,EAAMnoB,GACrBmoB,EAAMM,GAAI,EACNE,IAAMA,EAAK7nB,EAAIuP,GACfA,IAAMA,EAAK/O,EAAIqnB,GACfvhB,EAAKmhB,IAAMJ,IAAO/gB,EAAKmhB,GAAKlY,GAC5BjJ,EAAKohB,IAAML,IAAO/gB,EAAKohB,GAAKG,GAChCvhB,EAAKkhB,KACL,QAASH,GAIb/W,QAAS,SAASA,QAAQxI,GACxByG,EAASzJ,KAAMkB,GAGf,IAFA,IACIqhB,EADA/jB,EAAIxC,EAAIgH,EAA+B,EAAnBrB,UAAUN,OAAaM,UAAU,GAAK9H,GAAW,GAElE0oB,EAAQA,EAAQA,EAAMrnB,EAAI8E,KAAK2iB,IAGpC,IAFAnkB,EAAE+jB,EAAM3U,EAAG2U,EAAMvL,EAAGhX,MAEbuiB,GAASA,EAAMM,GAAGN,EAAQA,EAAM7mB,GAK3CyD,IAAK,SAASA,IAAI9C,GAChB,QAASmmB,EAAS/Y,EAASzJ,KAAMkB,GAAO7E,MAGxC0U,GAAaxS,EAAGmL,EAAElO,UAAW,OAAQ,CACvCP,IAAK,WACH,OAAOwO,EAASzJ,KAAMkB,GAAMwhB,MAGzBhZ,GAETyH,IAAK,SAAU3P,EAAMnF,EAAKsC,GACxB,IACIokB,EAAM7f,EADNqf,EAAQC,EAAShhB,EAAMnF,GAoBzB,OAjBEkmB,EACFA,EAAM3U,EAAIjP,GAGV6C,EAAKohB,GAAKL,EAAQ,CAChBnoB,EAAG8I,EAAQ4M,EAAQzT,GAAK,GACxB2a,EAAG3a,EACHuR,EAAGjP,EACHjD,EAAGqnB,EAAOvhB,EAAKohB,GACf1nB,EAAGrB,GACHgpB,GAAG,GAEArhB,EAAKmhB,KAAInhB,EAAKmhB,GAAKJ,GACpBQ,IAAMA,EAAK7nB,EAAIqnB,GACnB/gB,EAAKkhB,KAES,MAAVxf,IAAe1B,EAAKmX,GAAGzV,GAASqf,IAC7B/gB,GAEXghB,SAAUA,EACV5M,UAAW,SAAUlM,EAAGxI,EAAMsB,GAG5BigB,EAAY/Y,EAAGxI,EAAM,SAAUwX,EAAUpF,GACvCtT,KAAK8R,GAAKrI,EAASiP,EAAUxX,GAC7BlB,KAAK4Y,GAAKtF,EACVtT,KAAK4iB,GAAK/oB,IACT,WAKD,IAJA,IAAI2H,EAAOxB,KACPsT,EAAO9R,EAAKoX,GACZ2J,EAAQ/gB,EAAKohB,GAEVL,GAASA,EAAMM,GAAGN,EAAQA,EAAM7mB,EAEvC,OAAK8F,EAAKsQ,KAAQtQ,EAAKohB,GAAKL,EAAQA,EAAQA,EAAMrnB,EAAIsG,EAAKsQ,GAAG6Q,IAMnCxY,EAAK,EAApB,QAARmJ,EAA+BiP,EAAMvL,EAC7B,UAAR1D,EAAiCiP,EAAM3U,EAC5B,CAAC2U,EAAMvL,EAAGuL,EAAM3U,KAN7BpM,EAAKsQ,GAAKjY,GACHsQ,EAAK,KAMb3H,EAAS,UAAY,UAAWA,GAAQ,GAG3CmD,EAAWzE,MAOT,SAAU/G,EAAQD,EAASF,GAIjC,IAAIsoB,EAAStoB,EAAoB,KAC7ByP,EAAWzP,EAAoB,IAInCG,EAAOD,QAAUF,EAAoB,GAApBA,CAHP,MAGoC,SAAUiB,GACtD,OAAO,SAAS+nB,MAAQ,OAAO/nB,EAAI+E,KAAyB,EAAnB2B,UAAUN,OAAaM,UAAU,GAAK9H,MAC9E,CAEDsb,IAAK,SAASA,IAAIxW,GAChB,OAAO2jB,EAAOnR,IAAI1H,EAASzJ,KARrB,OAQiCrB,EAAkB,IAAVA,EAAc,EAAIA,EAAOA,KAEzE2jB,IAKG,SAAUnoB,EAAQD,EAASF,GAIjC,IAaIipB,EAbAC,EAAOlpB,EAAoB,GAApBA,CAAwB,GAC/B+B,EAAW/B,EAAoB,IAC/B4V,EAAO5V,EAAoB,IAC3B+c,EAAS/c,EAAoB,IAC7BmpB,EAAOnpB,EAAoB,KAC3BwD,EAAWxD,EAAoB,GAC/B0G,EAAQ1G,EAAoB,GAC5ByP,EAAWzP,EAAoB,IAC/BopB,EAAW,UACXrT,EAAUH,EAAKG,QACfR,EAAe1U,OAAO0U,aACtB8T,EAAsBF,EAAKG,QAC3BC,EAAM,GAGNrW,EAAU,SAAUjS,GACtB,OAAO,SAASuoB,UACd,OAAOvoB,EAAI+E,KAAyB,EAAnB2B,UAAUN,OAAaM,UAAU,GAAK9H,MAIvDsZ,EAAU,CAEZlY,IAAK,SAASA,IAAIoB,GAChB,GAAImB,EAASnB,GAAM,CACjB,IAAIsR,EAAOoC,EAAQ1T,GACnB,OAAa,IAATsR,EAAsB0V,EAAoB5Z,EAASzJ,KAAMojB,IAAWnoB,IAAIoB,GACrEsR,EAAOA,EAAK3N,KAAK2Y,IAAM9e,KAIlCwP,IAAK,SAASA,IAAIhN,EAAKsC,GACrB,OAAOwkB,EAAKhS,IAAI1H,EAASzJ,KAAMojB,GAAW/mB,EAAKsC,KAK/C8kB,EAAWtpB,EAAOD,QAAUF,EAAoB,GAApBA,CAAwBopB,EAAUlW,EAASiG,EAASgQ,GAAM,GAAM,GAG5FziB,EAAM,WAAc,OAAyE,IAAlE,IAAI+iB,GAAWpa,KAAKxO,OAAO6oB,QAAU7oB,QAAQ0oB,GAAM,GAAGtoB,IAAIsoB,OAEvFxM,GADAkM,EAAcE,EAAKxN,eAAezI,EAASkW,IACxB5nB,UAAW2X,GAC9BvD,EAAKC,MAAO,EACZqT,EAAK,CAAC,SAAU,MAAO,MAAO,OAAQ,SAAU7mB,GAC9C,IAAI0O,EAAQ0Y,EAASjoB,UACjBqG,EAASkJ,EAAM1O,GACnBN,EAASgP,EAAO1O,EAAK,SAAUuC,EAAG6C,GAEhC,GAAIjE,EAASoB,KAAO2Q,EAAa3Q,GAAI,CAC9BoB,KAAK2iB,KAAI3iB,KAAK2iB,GAAK,IAAIM,GAC5B,IAAI9f,EAASnD,KAAK2iB,GAAGtmB,GAAKuC,EAAG6C,GAC7B,MAAc,OAAPpF,EAAe2D,KAAOmD,EAE7B,OAAOtB,EAAOvH,KAAK0F,KAAMpB,EAAG6C,SAQ9B,SAAUtH,EAAQD,EAASF,GAIjC,IAAI6K,EAAc7K,EAAoB,IAClC+V,EAAU/V,EAAoB,IAAI+V,QAClC3R,EAAWpE,EAAoB,GAC/BwD,EAAWxD,EAAoB,GAC/B2K,EAAa3K,EAAoB,IACjC6a,EAAQ7a,EAAoB,IAC5BqL,EAAoBrL,EAAoB,IACxC2pB,EAAO3pB,EAAoB,IAC3ByP,EAAWzP,EAAoB,IAC/B+M,EAAY1B,EAAkB,GAC9B2B,EAAiB3B,EAAkB,GACnCiK,EAAK,EAGL+T,EAAsB,SAAU7hB,GAClC,OAAOA,EAAKohB,KAAOphB,EAAKohB,GAAK,IAAIgB,IAE/BA,EAAsB,WACxB5jB,KAAKpB,EAAI,IAEPilB,EAAqB,SAAU7lB,EAAO3B,GACxC,OAAO0K,EAAU/I,EAAMY,EAAG,SAAUnB,GAClC,OAAOA,EAAG,KAAOpB,KAGrBunB,EAAoBpoB,UAAY,CAC9BP,IAAK,SAAUoB,GACb,IAAIkmB,EAAQsB,EAAmB7jB,KAAM3D,GACrC,GAAIkmB,EAAO,OAAOA,EAAM,IAE1BpjB,IAAK,SAAU9C,GACb,QAASwnB,EAAmB7jB,KAAM3D,IAEpCgN,IAAK,SAAUhN,EAAKsC,GAClB,IAAI4jB,EAAQsB,EAAmB7jB,KAAM3D,GACjCkmB,EAAOA,EAAM,GAAK5jB,EACjBqB,KAAKpB,EAAEwE,KAAK,CAAC/G,EAAKsC,KAEzBmkB,SAAU,SAAUzmB,GAClB,IAAI6G,EAAQ8D,EAAehH,KAAKpB,EAAG,SAAUnB,GAC3C,OAAOA,EAAG,KAAOpB,IAGnB,OADK6G,GAAOlD,KAAKpB,EAAEklB,OAAO5gB,EAAO,MACvBA,IAId/I,EAAOD,QAAU,CACfyb,eAAgB,SAAUzI,EAAShM,EAAMsB,EAAQyS,GAC/C,IAAIvL,EAAIwD,EAAQ,SAAU1L,EAAM4O,GAC9BzL,EAAWnD,EAAMkI,EAAGxI,EAAM,MAC1BM,EAAKsQ,GAAK5Q,EACVM,EAAKmX,GAAKrJ,IAENc,IADJ5O,EAAKohB,GAAK/oB,KACiBgb,EAAMzE,EAAU5N,EAAQhB,EAAKyT,GAAQzT,KAoBlE,OAlBAqD,EAAY6E,EAAElO,UAAW,CAGvBsnB,SAAU,SAAUzmB,GAClB,IAAKmB,EAASnB,GAAM,OAAO,EAC3B,IAAIsR,EAAOoC,EAAQ1T,GACnB,OAAa,IAATsR,EAAsB0V,EAAoB5Z,EAASzJ,KAAMkB,IAAe,UAAE7E,GACvEsR,GAAQgW,EAAKhW,EAAM3N,KAAK2Y,YAAchL,EAAK3N,KAAK2Y,KAIzDxZ,IAAK,SAASA,IAAI9C,GAChB,IAAKmB,EAASnB,GAAM,OAAO,EAC3B,IAAIsR,EAAOoC,EAAQ1T,GACnB,OAAa,IAATsR,EAAsB0V,EAAoB5Z,EAASzJ,KAAMkB,IAAO/B,IAAI9C,GACjEsR,GAAQgW,EAAKhW,EAAM3N,KAAK2Y,OAG5BjP,GAETyH,IAAK,SAAU3P,EAAMnF,EAAKsC,GACxB,IAAIgP,EAAOoC,EAAQ3R,EAAS/B,IAAM,GAGlC,OAFa,IAATsR,EAAe0V,EAAoB7hB,GAAM6H,IAAIhN,EAAKsC,GACjDgP,EAAKnM,EAAKmX,IAAMha,EACd6C,GAET8hB,QAASD,IAML,SAAUlpB,EAAQD,EAASF,GAGjC,IAAI6E,EAAY7E,EAAoB,IAChCoI,EAAWpI,EAAoB,GACnCG,EAAOD,QAAU,SAAUuD,GACzB,GAAIA,IAAO5D,GAAW,OAAO,EAC7B,IAAIkqB,EAASllB,EAAUpB,GACnB4D,EAASe,EAAS2hB,GACtB,GAAIA,IAAW1iB,EAAQ,MAAM2E,WAAW,iBACxC,OAAO3E,IAMH,SAAUlH,EAAQD,EAASF,GAKjC,IAAIwY,EAAUxY,EAAoB,IAC9BwD,EAAWxD,EAAoB,GAC/BoI,EAAWpI,EAAoB,GAC/BgC,EAAMhC,EAAoB,IAC1BgqB,EAAuBhqB,EAAoB,EAApBA,CAAuB,sBAgClDG,EAAOD,QA9BP,SAAS+pB,iBAAiBhnB,EAAQsb,EAAUnc,EAAQ8nB,EAAWjZ,EAAOkZ,EAAOC,EAAQC,GAMnF,IALA,IAGIC,EAASC,EAHTC,EAAcvZ,EACdwZ,EAAc,EACdrO,IAAQgO,GAASpoB,EAAIooB,EAAQC,EAAS,GAGnCI,EAAcP,GAAW,CAC9B,GAAIO,KAAeroB,EAAQ,CASzB,GARAkoB,EAAUlO,EAAQA,EAAMha,EAAOqoB,GAAcA,EAAalM,GAAYnc,EAAOqoB,GAE7EF,GAAa,EACT/mB,EAAS8mB,KAEXC,GADAA,EAAaD,EAAQN,MACOnqB,KAAc0qB,EAAa/R,EAAQ8R,IAG7DC,GAAsB,EAARJ,EAChBK,EAAcP,iBAAiBhnB,EAAQsb,EAAU+L,EAASliB,EAASkiB,EAAQjjB,QAASmjB,EAAaL,EAAQ,GAAK,MACzG,CACL,GAAmB,kBAAfK,EAAiC,MAAM9mB,YAC3CT,EAAOunB,GAAeF,EAGxBE,IAEFC,IAEF,OAAOD,IAQH,SAAUrqB,EAAQD,EAASF,GAGjC,IAAIoI,EAAWpI,EAAoB,GAC/B0d,EAAS1d,EAAoB,IAC7B+E,EAAU/E,EAAoB,IAElCG,EAAOD,QAAU,SAAUsH,EAAMkjB,EAAWC,EAAYC,GACtD,IAAI1nB,EAAI4C,OAAOf,EAAQyC,IACnBqjB,EAAe3nB,EAAEmE,OACjByjB,EAAUH,IAAe9qB,GAAY,IAAMiG,OAAO6kB,GAClDI,EAAe3iB,EAASsiB,GAC5B,GAAIK,GAAgBF,GAA2B,IAAXC,EAAe,OAAO5nB,EAC1D,IAAI8nB,EAAUD,EAAeF,EACzBI,EAAevN,EAAOpd,KAAKwqB,EAASlnB,KAAKoE,KAAKgjB,EAAUF,EAAQzjB,SAEpE,OAD0B2jB,EAAtBC,EAAa5jB,SAAkB4jB,EAAeA,EAAarjB,MAAM,EAAGojB,IACjEJ,EAAOK,EAAe/nB,EAAIA,EAAI+nB,IAMjC,SAAU9qB,EAAQD,EAASF,GAEjC,IAAI4c,EAAU5c,EAAoB,IAC9BkG,EAAYlG,EAAoB,IAChCkd,EAASld,EAAoB,IAAIwE,EACrCrE,EAAOD,QAAU,SAAUgrB,GACzB,OAAO,SAAUznB,GAOf,IANA,IAKIpB,EALAoC,EAAIyB,EAAUzC,GACd8F,EAAOqT,EAAQnY,GACf4C,EAASkC,EAAKlC,OACdjH,EAAI,EACJ+I,EAAS,GAEG/I,EAATiH,GAAgB6V,EAAO5c,KAAKmE,EAAGpC,EAAMkH,EAAKnJ,OAC/C+I,EAAOC,KAAK8hB,EAAY,CAAC7oB,EAAKoC,EAAEpC,IAAQoC,EAAEpC,IAC1C,OAAO8G,KAOP,SAAUhJ,EAAQD,EAASF,GAGjC,IAAIgL,EAAUhL,EAAoB,IAC9BkQ,EAAOlQ,EAAoB,KAC/BG,EAAOD,QAAU,SAAUgH,GACzB,OAAO,SAASikB,SACd,GAAIngB,EAAQhF,OAASkB,EAAM,MAAMxD,UAAUwD,EAAO,yBAClD,OAAOgJ,EAAKlK,SAOV,SAAU7F,EAAQD,EAASF,GAEjC,IAAI6a,EAAQ7a,EAAoB,IAEhCG,EAAOD,QAAU,SAAUkU,EAAM/F,GAC/B,IAAIlF,EAAS,GAEb,OADA0R,EAAMzG,GAAM,EAAOjL,EAAOC,KAAMD,EAAQkF,GACjClF,IAMH,SAAUhJ,EAAQD,GAGxBC,EAAOD,QAAU0D,KAAKwnB,OAAS,SAASA,MAAMrN,EAAGsN,EAAOC,EAAQC,EAAQC,GACtE,OACuB,IAArB7jB,UAAUN,QAEL0W,GAAKA,GAELsN,GAASA,GAETC,GAAUA,GAEVC,GAAUA,GAEVC,GAAWA,EACT1H,IACL/F,IAAMF,UAAYE,KAAOF,SAAiBE,GACtCA,EAAIsN,IAAUG,EAAUD,IAAWD,EAASD,GAASE,IAMzD,SAAUprB,EAAQD,EAASF,GAEjC,IAAIgL,EAAUhL,EAAoB,IAC9BqO,EAAWrO,EAAoB,EAApBA,CAAuB,YAClCyL,EAAYzL,EAAoB,IACpCG,EAAOD,QAAUF,EAAoB,IAAIyrB,WAAa,SAAUhoB,GAC9D,IAAIgB,EAAI5D,OAAO4C,GACf,OAAOgB,EAAE4J,KAAcxO,IAClB,eAAgB4E,GAEhBgH,EAAUhK,eAAeuJ,EAAQvG,MAMlC,SAAUtE,EAAQD,EAASF,GAIjC,IAAI0rB,EAAO1rB,EAAoB,KAC3Bif,EAASjf,EAAoB,IAC7BsH,EAAYtH,EAAoB,IACpCG,EAAOD,QAAU,WAOf,IANA,IAAIqH,EAAKD,EAAUtB,MACfqB,EAASM,UAAUN,OACnBskB,EAAQ,IAAIrf,MAAMjF,GAClBjH,EAAI,EACJ8U,EAAIwW,EAAKxW,EACT0W,GAAS,EACGxrB,EAATiH,IAAiBskB,EAAMvrB,GAAKuH,UAAUvH,QAAU8U,IAAG0W,GAAS,GACnE,OAAO,WACL,IAIIpO,EAHAnN,EAAO1I,UAAUN,OACjB8V,EAAI,EACJH,EAAI,EAER,IAAK4O,IAAWvb,EAAM,OAAO4O,EAAO1X,EAAIokB,EAL7B3lB,MAOX,GADAwX,EAAOmO,EAAM/jB,QACTgkB,EAAQ,KAAezO,EAAT9V,EAAY8V,IAASK,EAAKL,KAAOjI,IAAGsI,EAAKL,GAAKxV,UAAUqV,MAC1E,KAAcA,EAAP3M,GAAUmN,EAAKpU,KAAKzB,UAAUqV,MACrC,OAAOiC,EAAO1X,EAAIiW,EATPxX,SAgBT,SAAU7F,EAAQD,EAASF,GAEjCG,EAAOD,QAAUF,EAAoB,IAK/B,SAAUG,EAAQD,EAASF,GAEjC,IAAIuE,EAAKvE,EAAoB,GACzBmG,EAAOnG,EAAoB,IAC3BwiB,EAAUxiB,EAAoB,IAC9BkG,EAAYlG,EAAoB,IAEpCG,EAAOD,QAAU,SAAS2rB,OAAO5oB,EAAQ6oB,GAKvC,IAJA,IAGIzpB,EAHAkH,EAAOiZ,EAAQtc,EAAU4lB,IACzBzkB,EAASkC,EAAKlC,OACdjH,EAAI,EAEQA,EAATiH,GAAY9C,EAAGC,EAAEvB,EAAQZ,EAAMkH,EAAKnJ,KAAM+F,EAAK3B,EAAEsnB,EAAOzpB,IAC/D,OAAOY,IAMH,SAAU9C,EAAQD,EAASF,GAEjCA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,IACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,IACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBG,EAAOD,QAAUF,EAAoB,MAK/B,SAAUG,EAAQD,EAASF,GAKjC,IAAI4B,EAAS5B,EAAoB,GAC7BmF,EAAMnF,EAAoB,IAC1B+W,EAAc/W,EAAoB,GAClCkC,EAAUlC,EAAoB,GAC9B+B,EAAW/B,EAAoB,IAC/BoV,EAAOpV,EAAoB,IAAImI,IAC/B4jB,EAAS/rB,EAAoB,GAC7B0U,EAAS1U,EAAoB,IAC7B4Y,EAAiB5Y,EAAoB,IACrCiE,EAAMjE,EAAoB,IAC1BoL,EAAMpL,EAAoB,GAC1Bwc,EAASxc,EAAoB,IAC7BgsB,EAAYhsB,EAAoB,IAChCisB,EAAWjsB,EAAoB,KAC/BwY,EAAUxY,EAAoB,IAC9BoE,EAAWpE,EAAoB,GAC/BwD,EAAWxD,EAAoB,GAC/BkG,EAAYlG,EAAoB,IAChCsE,EAActE,EAAoB,IAClCkF,EAAalF,EAAoB,IACjCksB,EAAUlsB,EAAoB,IAC9BmsB,EAAUnsB,EAAoB,IAC9B+L,EAAQ/L,EAAoB,IAC5B8L,EAAM9L,EAAoB,GAC1BqJ,EAAQrJ,EAAoB,IAC5BmG,EAAO4F,EAAMvH,EACbD,EAAKuH,EAAItH,EACT0G,EAAOihB,EAAQ3nB,EACfiY,EAAU7a,EAAOsC,OACjBkoB,EAAQxqB,EAAOyqB,KACfC,EAAaF,GAASA,EAAMG,UAC5BtqB,EAAY,YACZuqB,EAASphB,EAAI,WACbqhB,EAAerhB,EAAI,eACnB8R,EAAS,GAAGnF,qBACZ2U,EAAiBhY,EAAO,mBACxBiY,EAAajY,EAAO,WACpBkY,EAAYlY,EAAO,cACnBnO,EAAc1F,OAAOoB,GACrB4qB,EAA+B,mBAAXpQ,EACpBqQ,EAAUlrB,EAAOkrB,QAEjBC,GAAUD,IAAYA,EAAQ7qB,KAAe6qB,EAAQ7qB,GAAW+qB,UAGhEC,EAAgBlW,GAAegV,EAAO,WACxC,OAES,GAFFG,EAAQ3nB,EAAG,GAAI,IAAK,CACzBtD,IAAK,WAAc,OAAOsD,EAAGyB,KAAM,IAAK,CAAErB,MAAO,IAAKC,MACpDA,IACD,SAAUnB,EAAIpB,EAAKqY,GACtB,IAAIwS,EAAY/mB,EAAKI,EAAalE,GAC9B6qB,UAAkB3mB,EAAYlE,GAClCkC,EAAGd,EAAIpB,EAAKqY,GACRwS,GAAazpB,IAAO8C,GAAahC,EAAGgC,EAAalE,EAAK6qB,IACxD3oB,EAEA4oB,EAAO,SAAUrmB,GACnB,IAAIsmB,EAAMT,EAAW7lB,GAAOolB,EAAQzP,EAAQxa,IAE5C,OADAmrB,EAAIxO,GAAK9X,EACFsmB,GAGLC,EAAWR,GAAyC,iBAApBpQ,EAAQrM,SAAuB,SAAU3M,GAC3E,MAAoB,iBAANA,GACZ,SAAUA,GACZ,OAAOA,aAAcgZ,GAGnB6B,EAAkB,SAASxd,eAAe2C,EAAIpB,EAAKqY,GAKrD,OAJIjX,IAAO8C,GAAa+X,EAAgBsO,EAAWvqB,EAAKqY,GACxDtW,EAASX,GACTpB,EAAMiC,EAAYjC,GAAK,GACvB+B,EAASsW,GACLvV,EAAIwnB,EAAYtqB,IACbqY,EAAE1Z,YAIDmE,EAAI1B,EAAI+oB,IAAW/oB,EAAG+oB,GAAQnqB,KAAMoB,EAAG+oB,GAAQnqB,IAAO,GAC1DqY,EAAIwR,EAAQxR,EAAG,CAAE1Z,WAAYkE,EAAW,GAAG,OAJtCC,EAAI1B,EAAI+oB,IAASjoB,EAAGd,EAAI+oB,EAAQtnB,EAAW,EAAG,KACnDzB,EAAG+oB,GAAQnqB,IAAO,GAIX4qB,EAAcxpB,EAAIpB,EAAKqY,IACzBnW,EAAGd,EAAIpB,EAAKqY,IAEnB4S,EAAoB,SAASnH,iBAAiB1iB,EAAIX,GACpDsB,EAASX,GAKT,IAJA,IAGIpB,EAHAkH,EAAO0iB,EAASnpB,EAAIoD,EAAUpD,IAC9B1C,EAAI,EACJC,EAAIkJ,EAAKlC,OAEFjH,EAAJC,GAAOie,EAAgB7a,EAAIpB,EAAMkH,EAAKnJ,KAAM0C,EAAET,IACrD,OAAOoB,GAKL8pB,EAAwB,SAASxV,qBAAqB1V,GACxD,IAAImrB,EAAItQ,EAAO5c,KAAK0F,KAAM3D,EAAMiC,EAAYjC,GAAK,IACjD,QAAI2D,OAASO,GAAepB,EAAIwnB,EAAYtqB,KAAS8C,EAAIynB,EAAWvqB,QAC7DmrB,IAAMroB,EAAIa,KAAM3D,KAAS8C,EAAIwnB,EAAYtqB,IAAQ8C,EAAIa,KAAMwmB,IAAWxmB,KAAKwmB,GAAQnqB,KAAOmrB,IAE/FC,EAA4B,SAASrnB,yBAAyB3C,EAAIpB,GAGpE,GAFAoB,EAAKyC,EAAUzC,GACfpB,EAAMiC,EAAYjC,GAAK,GACnBoB,IAAO8C,IAAepB,EAAIwnB,EAAYtqB,IAAS8C,EAAIynB,EAAWvqB,GAAlE,CACA,IAAIqY,EAAIvU,EAAK1C,EAAIpB,GAEjB,OADIqY,IAAKvV,EAAIwnB,EAAYtqB,IAAU8C,EAAI1B,EAAI+oB,IAAW/oB,EAAG+oB,GAAQnqB,KAAOqY,EAAE1Z,YAAa,GAChF0Z,IAELgT,EAAuB,SAASjX,oBAAoBhT,GAKtD,IAJA,IAGIpB,EAHA6jB,EAAQhb,EAAKhF,EAAUzC,IACvB0F,EAAS,GACT/I,EAAI,EAEcA,EAAf8lB,EAAM7e,QACNlC,EAAIwnB,EAAYtqB,EAAM6jB,EAAM9lB,OAASiC,GAAOmqB,GAAUnqB,GAAO+S,GAAMjM,EAAOC,KAAK/G,GACpF,OAAO8G,GAEPwkB,EAAyB,SAASpV,sBAAsB9U,GAM1D,IALA,IAIIpB,EAJAurB,EAAQnqB,IAAO8C,EACf2f,EAAQhb,EAAK0iB,EAAQhB,EAAY1mB,EAAUzC,IAC3C0F,EAAS,GACT/I,EAAI,EAEcA,EAAf8lB,EAAM7e,SACPlC,EAAIwnB,EAAYtqB,EAAM6jB,EAAM9lB,OAAUwtB,IAAQzoB,EAAIoB,EAAalE,IAAc8G,EAAOC,KAAKujB,EAAWtqB,IACxG,OAAO8G,GAIN0jB,IAYH9qB,GAXA0a,EAAU,SAASvY,SACjB,GAAI8B,gBAAgByW,EAAS,MAAM/Y,UAAU,gCAC7C,IAAIoD,EAAM7C,EAAuB,EAAnB0D,UAAUN,OAAaM,UAAU,GAAK9H,IAChD2S,EAAO,SAAU7N,GACfqB,OAASO,GAAaiM,EAAKlS,KAAKssB,EAAWjoB,GAC3CQ,EAAIa,KAAMwmB,IAAWrnB,EAAIa,KAAKwmB,GAAS1lB,KAAMd,KAAKwmB,GAAQ1lB,IAAO,GACrEmmB,EAAcjnB,KAAMc,EAAK5B,EAAW,EAAGP,KAGzC,OADIoS,GAAegW,GAAQE,EAAc1mB,EAAaO,EAAK,CAAE/F,cAAc,EAAMsO,IAAKmD,IAC/E2a,EAAKrmB,KAEG7E,GAAY,WAAY,SAAS8D,WAChD,OAAOC,KAAK4Y,KAGd7S,EAAMvH,EAAIipB,EACV3hB,EAAItH,EAAI8Z,EACRte,EAAoB,IAAIwE,EAAI2nB,EAAQ3nB,EAAIkpB,EACxC1tB,EAAoB,IAAIwE,EAAI+oB,EAC5BvtB,EAAoB,IAAIwE,EAAImpB,EAExB5W,IAAgB/W,EAAoB,KACtC+B,EAASwE,EAAa,uBAAwBgnB,GAAuB,GAGvE/Q,EAAOhY,EAAI,SAAU9D,GACnB,OAAOysB,EAAK/hB,EAAI1K,MAIpBwB,EAAQA,EAAQU,EAAIV,EAAQoB,EAAIpB,EAAQQ,GAAKmqB,EAAY,CAAE3oB,OAAQuY,IAEnE,IAAK,IAAIoR,GAAa,iHAGpBroB,MAAM,KAAM2X,GAAI,EAAuBA,GAApB0Q,GAAWxmB,QAAY+D,EAAIyiB,GAAW1Q,OAE3D,IAAK,IAAI2Q,GAAmBzkB,EAAM+B,EAAIpH,OAAQgZ,GAAI,EAA6BA,GAA1B8Q,GAAiBzmB,QAAa2kB,EAAU8B,GAAiB9Q,OAE9G9a,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAKmqB,EAAY,SAAU,CAErDkB,MAAO,SAAU1rB,GACf,OAAO8C,EAAIunB,EAAgBrqB,GAAO,IAC9BqqB,EAAerqB,GACfqqB,EAAerqB,GAAOoa,EAAQpa,IAGpC2rB,OAAQ,SAASA,OAAOZ,GACtB,IAAKC,EAASD,GAAM,MAAM1pB,UAAU0pB,EAAM,qBAC1C,IAAK,IAAI/qB,KAAOqqB,EAAgB,GAAIA,EAAerqB,KAAS+qB,EAAK,OAAO/qB,GAE1E4rB,UAAW,WAAclB,GAAS,GAClCmB,UAAW,WAAcnB,GAAS,KAGpC7qB,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAKmqB,EAAY,SAAU,CAErD/jB,OA/FY,SAASA,OAAOrF,EAAIX,GAChC,OAAOA,IAAMjD,GAAYqsB,EAAQzoB,GAAM6pB,EAAkBpB,EAAQzoB,GAAKX,IAgGtEhC,eAAgBwd,EAEhB6H,iBAAkBmH,EAElBlnB,yBAA0BqnB,EAE1BhX,oBAAqBiX,EAErBnV,sBAAuBoV,IAIzBvB,GAASlqB,EAAQA,EAAQgB,EAAIhB,EAAQQ,IAAMmqB,GAAcd,EAAO,WAC9D,IAAI7oB,EAAIuZ,IAIR,MAA0B,UAAnB6P,EAAW,CAACppB,KAA2C,MAAxBopB,EAAW,CAAE1nB,EAAG1B,KAAyC,MAAzBopB,EAAWzrB,OAAOqC,OACrF,OAAQ,CACXqpB,UAAW,SAASA,UAAU9oB,GAI5B,IAHA,IAEIuiB,EAAUmI,EAFV3Q,EAAO,CAAC/Z,GACRrD,EAAI,EAEkBA,EAAnBuH,UAAUN,QAAYmW,EAAKpU,KAAKzB,UAAUvH,MAEjD,GADA+tB,EAAYnI,EAAWxI,EAAK,IACvBha,EAASwiB,IAAaviB,IAAO5D,MAAawtB,EAAS5pB,GAMxD,OALK+U,EAAQwN,KAAWA,EAAW,SAAU3jB,EAAKsC,GAEhD,GADwB,mBAAbwpB,IAAyBxpB,EAAQwpB,EAAU7tB,KAAK0F,KAAM3D,EAAKsC,KACjE0oB,EAAS1oB,GAAQ,OAAOA,IAE/B6Y,EAAK,GAAKwI,EACHsG,EAAW5kB,MAAM0kB,EAAO5O,MAKnCf,EAAQxa,GAAWwqB,IAAiBzsB,EAAoB,GAApBA,CAAwByc,EAAQxa,GAAYwqB,EAAchQ,EAAQxa,GAAW8F,SAEjH6Q,EAAe6D,EAAS,UAExB7D,EAAehV,KAAM,QAAQ,GAE7BgV,EAAehX,EAAOyqB,KAAM,QAAQ,IAK9B,SAAUlsB,EAAQD,EAASF,GAGjC,IAAI4c,EAAU5c,EAAoB,IAC9B6c,EAAO7c,EAAoB,IAC3BiG,EAAMjG,EAAoB,IAC9BG,EAAOD,QAAU,SAAUuD,GACzB,IAAI0F,EAASyT,EAAQnZ,GACjBwZ,EAAaJ,EAAKrY,EACtB,GAAIyY,EAKF,IAJA,IAGI5a,EAHA+rB,EAAUnR,EAAWxZ,GACrByZ,EAASjX,EAAIzB,EACbpE,EAAI,EAEgBA,EAAjBguB,EAAQ/mB,QAAgB6V,EAAO5c,KAAKmD,EAAIpB,EAAM+rB,EAAQhuB,OAAO+I,EAAOC,KAAK/G,GAChF,OAAO8G,IAML,SAAUhJ,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAK1C,EAAoB,GAAI,SAAU,CAAEc,eAAgBd,EAAoB,GAAGwE,KAKtG,SAAUrE,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAK1C,EAAoB,GAAI,SAAU,CAAEmmB,iBAAkBnmB,EAAoB,OAKrG,SAAUG,EAAQD,EAASF,GAGjC,IAAIkG,EAAYlG,EAAoB,IAChCytB,EAA4BztB,EAAoB,IAAIwE,EAExDxE,EAAoB,GAApBA,CAAwB,2BAA4B,WAClD,OAAO,SAASoG,yBAAyB3C,EAAIpB,GAC3C,OAAOorB,EAA0BvnB,EAAUzC,GAAKpB,OAO9C,SAAUlC,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,SAAU,CAAE4F,OAAQ9I,EAAoB,OAKrD,SAAUG,EAAQD,EAASF,GAGjC,IAAIqG,EAAWrG,EAAoB,GAC/BquB,EAAkBruB,EAAoB,IAE1CA,EAAoB,GAApBA,CAAwB,iBAAkB,WACxC,OAAO,SAASwG,eAAe/C,GAC7B,OAAO4qB,EAAgBhoB,EAAS5C,QAO9B,SAAUtD,EAAQD,EAASF,GAGjC,IAAIqG,EAAWrG,EAAoB,GAC/BqJ,EAAQrJ,EAAoB,IAEhCA,EAAoB,GAApBA,CAAwB,OAAQ,WAC9B,OAAO,SAASuJ,KAAK9F,GACnB,OAAO4F,EAAMhD,EAAS5C,QAOpB,SAAUtD,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,sBAAuB,WAC7C,OAAOA,EAAoB,IAAIwE,KAM3B,SAAUrE,EAAQD,EAASF,GAGjC,IAAIwD,EAAWxD,EAAoB,GAC/B4V,EAAO5V,EAAoB,IAAIgW,SAEnChW,EAAoB,GAApBA,CAAwB,SAAU,SAAUsuB,GAC1C,OAAO,SAAS5E,OAAOjmB,GACrB,OAAO6qB,GAAW9qB,EAASC,GAAM6qB,EAAQ1Y,EAAKnS,IAAOA,MAOnD,SAAUtD,EAAQD,EAASF,GAGjC,IAAIwD,EAAWxD,EAAoB,GAC/B4V,EAAO5V,EAAoB,IAAIgW,SAEnChW,EAAoB,GAApBA,CAAwB,OAAQ,SAAUuuB,GACxC,OAAO,SAASC,KAAK/qB,GACnB,OAAO8qB,GAAS/qB,EAASC,GAAM8qB,EAAM3Y,EAAKnS,IAAOA,MAO/C,SAAUtD,EAAQD,EAASF,GAGjC,IAAIwD,EAAWxD,EAAoB,GAC/B4V,EAAO5V,EAAoB,IAAIgW,SAEnChW,EAAoB,GAApBA,CAAwB,oBAAqB,SAAUyuB,GACrD,OAAO,SAAShZ,kBAAkBhS,GAChC,OAAOgrB,GAAsBjrB,EAASC,GAAMgrB,EAAmB7Y,EAAKnS,IAAOA,MAOzE,SAAUtD,EAAQD,EAASF,GAGjC,IAAIwD,EAAWxD,EAAoB,GAEnCA,EAAoB,GAApBA,CAAwB,WAAY,SAAU0uB,GAC5C,OAAO,SAASC,SAASlrB,GACvB,OAAOD,EAASC,MAAMirB,GAAYA,EAAUjrB,OAO1C,SAAUtD,EAAQD,EAASF,GAGjC,IAAIwD,EAAWxD,EAAoB,GAEnCA,EAAoB,GAApBA,CAAwB,WAAY,SAAU4uB,GAC5C,OAAO,SAASC,SAASprB,GACvB,OAAOD,EAASC,MAAMmrB,GAAYA,EAAUnrB,OAO1C,SAAUtD,EAAQD,EAASF,GAGjC,IAAIwD,EAAWxD,EAAoB,GAEnCA,EAAoB,GAApBA,CAAwB,eAAgB,SAAU8uB,GAChD,OAAO,SAASvZ,aAAa9R,GAC3B,QAAOD,EAASC,MAAMqrB,GAAgBA,EAAcrrB,QAOlD,SAAUtD,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,EAAG,SAAU,CAAEqa,OAAQ/c,EAAoB,OAKjE,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAClCkC,EAAQA,EAAQgB,EAAG,SAAU,CAAEoZ,GAAItc,EAAoB,QAKjD,SAAUG,EAAQD,GAGxBC,EAAOD,QAAUW,OAAOyb,IAAM,SAASA,GAAGyB,EAAGgR,GAE3C,OAAOhR,IAAMgR,EAAU,IAANhR,GAAW,EAAIA,GAAM,EAAIgR,EAAIhR,GAAKA,GAAKgR,GAAKA,IAMzD,SAAU5uB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAClCkC,EAAQA,EAAQgB,EAAG,SAAU,CAAEma,eAAgBrd,EAAoB,IAAIqP,OAKjE,SAAUlP,EAAQD,EAASF,GAKjC,IAAIgL,EAAUhL,EAAoB,IAC9BmH,EAAO,GACXA,EAAKnH,EAAoB,EAApBA,CAAuB,gBAAkB,IAC1CmH,EAAO,IAAM,cACfnH,EAAoB,GAApBA,CAAwBa,OAAOW,UAAW,WAAY,SAASuE,WAC7D,MAAO,WAAaiF,EAAQhF,MAAQ,MACnC,IAMC,SAAU7F,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQY,EAAG,WAAY,CAAEyjB,KAAMvmB,EAAoB,QAKrD,SAAUG,EAAQD,EAASF,GAEjC,IAAIuE,EAAKvE,EAAoB,GAAGwE,EAC5BwqB,EAAS5rB,SAAS5B,UAClBytB,EAAS,wBACF,SAGHD,GAAUhvB,EAAoB,IAAMuE,EAAGyqB,EAHpC,OAGkD,CAC3DjuB,cAAc,EACdE,IAAK,WACH,IACE,OAAQ,GAAK+E,MAAMkpB,MAAMD,GAAQ,GACjC,MAAOlrB,GACP,MAAO,QAQP,SAAU5D,EAAQD,EAASF,GAIjC,IAAIwD,EAAWxD,EAAoB,GAC/BwG,EAAiBxG,EAAoB,IACrCmvB,EAAenvB,EAAoB,EAApBA,CAAuB,eACtCovB,EAAgBhsB,SAAS5B,UAEvB2tB,KAAgBC,GAAgBpvB,EAAoB,GAAGwE,EAAE4qB,EAAeD,EAAc,CAAExqB,MAAO,SAAUF,GAC7G,GAAmB,mBAARuB,OAAuBxC,EAASiB,GAAI,OAAO,EACtD,IAAKjB,EAASwC,KAAKxE,WAAY,OAAOiD,aAAauB,KAEnD,KAAOvB,EAAI+B,EAAe/B,IAAI,GAAIuB,KAAKxE,YAAciD,EAAG,OAAO,EAC/D,OAAO,MAMH,SAAUtE,EAAQD,EAASF,GAIjC,IAAI4B,EAAS5B,EAAoB,GAC7BmF,EAAMnF,EAAoB,IAC1B0W,EAAM1W,EAAoB,IAC1B8a,EAAoB9a,EAAoB,IACxCsE,EAActE,EAAoB,IAClC0G,EAAQ1G,EAAoB,GAC5BkL,EAAOlL,EAAoB,IAAIwE,EAC/B2B,EAAOnG,EAAoB,IAAIwE,EAC/BD,EAAKvE,EAAoB,GAAGwE,EAC5BwiB,EAAQhnB,EAAoB,IAAI6X,KAChCwX,EAAS,SACTC,EAAU1tB,EAAOytB,GACjB9b,EAAO+b,EACPve,EAAQue,EAAQ9tB,UAEhB+tB,EAAa7Y,EAAI1W,EAAoB,GAApBA,CAAwB+Q,KAAWse,EACpDG,EAAO,SAAU1pB,OAAOtE,UAGxBiuB,EAAW,SAAUC,GACvB,IAAIjsB,EAAKa,EAAYorB,GAAU,GAC/B,GAAiB,iBAANjsB,GAA8B,EAAZA,EAAG4D,OAAY,CAE1C,IACIsoB,EAAOtI,EAAOuI,EADdC,GADJpsB,EAAK+rB,EAAO/rB,EAAGoU,OAASmP,EAAMvjB,EAAI,IACnB0a,WAAW,GAE1B,GAAc,KAAV0R,GAA0B,KAAVA,GAElB,GAAc,MADdF,EAAQlsB,EAAG0a,WAAW,KACQ,MAAVwR,EAAe,OAAO7L,SACrC,GAAc,KAAV+L,EAAc,CACvB,OAAQpsB,EAAG0a,WAAW,IACpB,KAAK,GAAI,KAAK,GAAIkJ,EAAQ,EAAGuI,EAAU,GAAI,MAC3C,KAAK,GAAI,KAAK,IAAKvI,EAAQ,EAAGuI,EAAU,GAAI,MAC5C,QAAS,OAAQnsB,EAEnB,IAAK,IAAoDqsB,EAAhDC,EAAStsB,EAAGmE,MAAM,GAAIxH,EAAI,EAAGC,EAAI0vB,EAAO1oB,OAAcjH,EAAIC,EAAGD,IAIpE,IAHA0vB,EAAOC,EAAO5R,WAAW/d,IAGd,IAAawvB,EAAPE,EAAgB,OAAOhM,IACxC,OAAOoD,SAAS6I,EAAQ1I,IAE5B,OAAQ5jB,GAGZ,IAAK6rB,EAAQ,UAAYA,EAAQ,QAAUA,EAAQ,QAAS,CAC1DA,EAAU,SAASU,OAAOrrB,GACxB,IAAIlB,EAAKkE,UAAUN,OAAS,EAAI,EAAI1C,EAChC6C,EAAOxB,KACX,OAAOwB,aAAgB8nB,IAEjBC,EAAa7oB,EAAM,WAAcqK,EAAMhJ,QAAQzH,KAAKkH,KAAYkP,EAAIlP,IAAS6nB,GAC7EvU,EAAkB,IAAIvH,EAAKkc,EAAShsB,IAAM+D,EAAM8nB,GAAWG,EAAShsB,IAE5E,IAAK,IAMgBpB,EANZkH,EAAOvJ,EAAoB,GAAKkL,EAAKqI,GAAQ,6KAMpD/N,MAAM,KAAM2X,EAAI,EAAsBA,EAAd5T,EAAKlC,OAAY8V,IACrChY,EAAIoO,EAAMlR,EAAMkH,EAAK4T,MAAQhY,EAAImqB,EAASjtB,IAC5CkC,EAAG+qB,EAASjtB,EAAK8D,EAAKoN,EAAMlR,KAGhCitB,EAAQ9tB,UAAYuP,GACdtK,YAAc6oB,EACpBtvB,EAAoB,GAApBA,CAAwB4B,EAAQytB,EAAQC,KAMpC,SAAUnvB,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B6E,EAAY7E,EAAoB,IAChCiwB,EAAejwB,EAAoB,KACnC0d,EAAS1d,EAAoB,IAC7BkwB,EAAW,GAAIC,QACfloB,EAAQrE,KAAKqE,MACb0L,EAAO,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,GACvByc,EAAQ,wCAGRC,EAAW,SAAUnvB,EAAGV,GAG1B,IAFA,IAAIJ,GAAK,EACLkwB,EAAK9vB,IACAJ,EAAI,GAEXuT,EAAKvT,IADLkwB,GAAMpvB,EAAIyS,EAAKvT,IACA,IACfkwB,EAAKroB,EAAMqoB,EAAK,MAGhBC,EAAS,SAAUrvB,GAGrB,IAFA,IAAId,EAAI,EACJI,EAAI,EACM,KAALJ,GAEPuT,EAAKvT,GAAK6H,GADVzH,GAAKmT,EAAKvT,IACUc,GACpBV,EAAKA,EAAIU,EAAK,KAGdsvB,EAAc,WAGhB,IAFA,IAAIpwB,EAAI,EACJuB,EAAI,GACM,KAALvB,GACP,GAAU,KAANuB,GAAkB,IAANvB,GAAuB,IAAZuT,EAAKvT,GAAU,CACxC,IAAIqwB,EAAI3qB,OAAO6N,EAAKvT,IACpBuB,EAAU,KAANA,EAAW8uB,EAAI9uB,EAAI+b,EAAOpd,KA1BzB,IA0BoC,EAAImwB,EAAEppB,QAAUopB,EAE3D,OAAO9uB,GAEPkhB,EAAM,SAAU9E,EAAG7c,EAAGwvB,GACxB,OAAa,IAANxvB,EAAUwvB,EAAMxvB,EAAI,GAAM,EAAI2hB,EAAI9E,EAAG7c,EAAI,EAAGwvB,EAAM3S,GAAK8E,EAAI9E,EAAIA,EAAG7c,EAAI,EAAGwvB,IAelFxuB,EAAQA,EAAQY,EAAIZ,EAAQQ,KAAOwtB,IACV,UAAvB,KAAQC,QAAQ,IACG,MAAnB,GAAIA,QAAQ,IACS,SAArB,MAAMA,QAAQ,IACuB,yBAArC,mBAAsBA,QAAQ,MAC1BnwB,EAAoB,EAApBA,CAAuB,WAE3BkwB,EAAS5vB,KAAK,OACX,SAAU,CACb6vB,QAAS,SAASA,QAAQQ,GACxB,IAII5sB,EAAG6sB,EAAGzT,EAAGH,EAJTe,EAAIkS,EAAajqB,KAAMoqB,GACvB5rB,EAAIK,EAAU8rB,GACdhvB,EAAI,GACJpB,EA3DG,IA6DP,GAAIiE,EAAI,GAAS,GAAJA,EAAQ,MAAMwH,WAAWokB,GAEtC,GAAIrS,GAAKA,EAAG,MAAO,MACnB,GAAIA,IAAM,MAAa,MAALA,EAAW,OAAOjY,OAAOiY,GAK3C,GAJIA,EAAI,IACNpc,EAAI,IACJoc,GAAKA,GAEC,MAAJA,EAKF,GAHA6S,GADA7sB,EArCI,SAAUga,GAGlB,IAFA,IAAI7c,EAAI,EACJ2vB,EAAK9S,EACI,MAAN8S,GACL3vB,GAAK,GACL2vB,GAAM,KAER,KAAa,GAANA,GACL3vB,GAAK,EACL2vB,GAAM,EACN,OAAO3vB,EA2BD4hB,CAAI/E,EAAI8E,EAAI,EAAG,GAAI,IAAM,IACrB,EAAI9E,EAAI8E,EAAI,GAAI9e,EAAG,GAAKga,EAAI8E,EAAI,EAAG9e,EAAG,GAC9C6sB,GAAK,iBAEG,GADR7sB,EAAI,GAAKA,GACE,CAGT,IAFAssB,EAAS,EAAGO,GACZzT,EAAI3Y,EACQ,GAAL2Y,GACLkT,EAAS,IAAK,GACdlT,GAAK,EAIP,IAFAkT,EAASxN,EAAI,GAAI1F,EAAG,GAAI,GACxBA,EAAIpZ,EAAI,EACI,IAALoZ,GACLoT,EAAO,GAAK,IACZpT,GAAK,GAEPoT,EAAO,GAAKpT,GACZkT,EAAS,EAAG,GACZE,EAAO,GACPhwB,EAAIiwB,SAEJH,EAAS,EAAGO,GACZP,EAAS,IAAMtsB,EAAG,GAClBxD,EAAIiwB,IAAgB9S,EAAOpd,KA9FxB,IA8FmCkE,GAQxC,OAHAjE,EAFM,EAAJiE,EAEE7C,IADJqb,EAAIzc,EAAE8G,SACQ7C,EAAI,KAAOkZ,EAAOpd,KAnG3B,IAmGsCkE,EAAIwY,GAAKzc,EAAIA,EAAEqH,MAAM,EAAGoV,EAAIxY,GAAK,IAAMjE,EAAEqH,MAAMoV,EAAIxY,IAE1F7C,EAAIpB,MAQR,SAAUJ,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B+rB,EAAS/rB,EAAoB,GAC7BiwB,EAAejwB,EAAoB,KACnC8wB,EAAe,GAAIC,YAEvB7uB,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAKqpB,EAAO,WAEtC,MAA2C,MAApC+E,EAAaxwB,KAAK,EAAGT,QACvBksB,EAAO,WAEZ+E,EAAaxwB,KAAK,OACf,SAAU,CACbywB,YAAa,SAASA,YAAYC,GAChC,IAAIxpB,EAAOyoB,EAAajqB,KAAM,6CAC9B,OAAOgrB,IAAcnxB,GAAYixB,EAAaxwB,KAAKkH,GAAQspB,EAAaxwB,KAAKkH,EAAMwpB,OAOjF,SAAU7wB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,SAAU,CAAEqkB,QAAS3jB,KAAKif,IAAI,GAAI,OAK/C,SAAU1iB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BixB,EAAYjxB,EAAoB,GAAG6mB,SAEvC3kB,EAAQA,EAAQgB,EAAG,SAAU,CAC3B2jB,SAAU,SAASA,SAASpjB,GAC1B,MAAoB,iBAANA,GAAkBwtB,EAAUxtB,OAOxC,SAAUtD,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,SAAU,CAAE0jB,UAAW5mB,EAAoB,QAKxD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,SAAU,CAC3BgF,MAAO,SAASA,MAAM6hB,GAEpB,OAAOA,GAAUA,MAOf,SAAU5pB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B4mB,EAAY5mB,EAAoB,KAChC4iB,EAAMhf,KAAKgf,IAEf1gB,EAAQA,EAAQgB,EAAG,SAAU,CAC3BguB,cAAe,SAASA,cAAcnH,GACpC,OAAOnD,EAAUmD,IAAWnH,EAAImH,IAAW,qBAOzC,SAAU5pB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,SAAU,CAAEiuB,iBAAkB,oBAK3C,SAAUhxB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,SAAU,CAAEkuB,kBAAmB,oBAK5C,SAAUjxB,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B8mB,EAAc9mB,EAAoB,KAEtCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAKstB,OAAOjJ,YAAcD,GAAc,SAAU,CAAEC,WAAYD,KAKtF,SAAU3mB,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9BinB,EAAYjnB,EAAoB,KAEpCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAKstB,OAAO9I,UAAYD,GAAY,SAAU,CAAEC,SAAUD,KAKhF,SAAU9mB,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9BinB,EAAYjnB,EAAoB,KAEpCkC,EAAQA,EAAQU,EAAIV,EAAQQ,GAAKwkB,UAAYD,GAAY,CAAEC,SAAUD,KAK/D,SAAU9mB,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B8mB,EAAc9mB,EAAoB,KAEtCkC,EAAQA,EAAQU,EAAIV,EAAQQ,GAAKqkB,YAAcD,GAAc,CAAEC,WAAYD,KAKrE,SAAU3mB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BsnB,EAAQtnB,EAAoB,KAC5BqxB,EAAOztB,KAAKytB,KACZC,EAAS1tB,KAAK2tB,MAElBrvB,EAAQA,EAAQgB,EAAIhB,EAAQQ,IAAM4uB,GAEW,KAAxC1tB,KAAKqE,MAAMqpB,EAAOtB,OAAOwB,aAEzBF,EAAOzT,WAAaA,UACtB,OAAQ,CACT0T,MAAO,SAASA,MAAMxT,GACpB,OAAQA,GAAKA,GAAK,EAAI+F,IAAU,kBAAJ/F,EACxBna,KAAKkf,IAAI/E,GAAKna,KAAKmf,IACnBuE,EAAMvJ,EAAI,EAAIsT,EAAKtT,EAAI,GAAKsT,EAAKtT,EAAI,QAOvC,SAAU5d,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9ByxB,EAAS7tB,KAAK8tB,MAOlBxvB,EAAQA,EAAQgB,EAAIhB,EAAQQ,IAAM+uB,GAA0B,EAAhB,EAAIA,EAAO,IAAS,OAAQ,CAAEC,MAL1E,SAASA,MAAM3T,GACb,OAAQ8I,SAAS9I,GAAKA,IAAW,GAALA,EAAaA,EAAI,GAAK2T,OAAO3T,GAAKna,KAAKkf,IAAI/E,EAAIna,KAAKytB,KAAKtT,EAAIA,EAAI,IAAxDA,MASjC,SAAU5d,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B2xB,EAAS/tB,KAAKguB,MAGlB1vB,EAAQA,EAAQgB,EAAIhB,EAAQQ,IAAMivB,GAAU,EAAIA,GAAQ,GAAK,GAAI,OAAQ,CACvEC,MAAO,SAASA,MAAM7T,GACpB,OAAmB,IAAXA,GAAKA,GAAUA,EAAIna,KAAKkf,KAAK,EAAI/E,IAAM,EAAIA,IAAM,MAOvD,SAAU5d,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B8d,EAAO9d,EAAoB,IAE/BkC,EAAQA,EAAQgB,EAAG,OAAQ,CACzB2uB,KAAM,SAASA,KAAK9T,GAClB,OAAOD,EAAKC,GAAKA,GAAKna,KAAKif,IAAIjf,KAAKgf,IAAI7E,GAAI,EAAI,OAO9C,SAAU5d,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CACzB4uB,MAAO,SAASA,MAAM/T,GACpB,OAAQA,KAAO,GAAK,GAAKna,KAAKqE,MAAMrE,KAAKkf,IAAI/E,EAAI,IAAOna,KAAKmuB,OAAS,OAOpE,SAAU5xB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BwC,EAAMoB,KAAKpB,IAEfN,EAAQA,EAAQgB,EAAG,OAAQ,CACzB8uB,KAAM,SAASA,KAAKjU,GAClB,OAAQvb,EAAIub,GAAKA,GAAKvb,GAAKub,IAAM,MAO/B,SAAU5d,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Bge,EAAShe,EAAoB,IAEjCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAKsb,GAAUpa,KAAKqa,OAAQ,OAAQ,CAAEA,MAAOD,KAKnE,SAAU7d,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CAAEykB,OAAQ3nB,EAAoB,QAKnD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B4iB,EAAMhf,KAAKgf,IAEf1gB,EAAQA,EAAQgB,EAAG,OAAQ,CACzB+uB,MAAO,SAASA,MAAMC,EAAQC,GAM5B,IALA,IAIIrqB,EAAKsqB,EAJLC,EAAM,EACNjyB,EAAI,EACJiQ,EAAO1I,UAAUN,OACjBirB,EAAO,EAEJlyB,EAAIiQ,GAELiiB,GADJxqB,EAAM8a,EAAIjb,UAAUvH,QAGlBiyB,EAAMA,GADND,EAAME,EAAOxqB,GACKsqB,EAAM,EACxBE,EAAOxqB,GAGPuqB,GAFe,EAANvqB,GACTsqB,EAAMtqB,EAAMwqB,GACCF,EACDtqB,EAEhB,OAAOwqB,IAASzU,SAAWA,SAAWyU,EAAO1uB,KAAKytB,KAAKgB,OAOrD,SAAUlyB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BuyB,EAAQ3uB,KAAK4uB,KAGjBtwB,EAAQA,EAAQgB,EAAIhB,EAAQQ,EAAI1C,EAAoB,EAApBA,CAAuB,WACrD,OAAgC,GAAzBuyB,EAAM,WAAY,IAA4B,GAAhBA,EAAMlrB,SACzC,OAAQ,CACVmrB,KAAM,SAASA,KAAKzU,EAAGgR,GACrB,IAAI0D,EAAS,MACTC,GAAM3U,EACN4U,GAAM5D,EACN6D,EAAKH,EAASC,EACdG,EAAKJ,EAASE,EAClB,OAAO,EAAIC,EAAKC,IAAOJ,EAASC,IAAO,IAAMG,EAAKD,GAAMH,EAASE,IAAO,KAAO,KAAO,OAOpF,SAAUxyB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CACzB4vB,MAAO,SAASA,MAAM/U,GACpB,OAAOna,KAAKkf,IAAI/E,GAAKna,KAAKmvB,WAOxB,SAAU5yB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CAAEokB,MAAOtnB,EAAoB,QAKlD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CACzB8vB,KAAM,SAASA,KAAKjV,GAClB,OAAOna,KAAKkf,IAAI/E,GAAKna,KAAKmf,QAOxB,SAAU5iB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CAAE4a,KAAM9d,EAAoB,OAKjD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Bie,EAAQje,EAAoB,IAC5BwC,EAAMoB,KAAKpB,IAGfN,EAAQA,EAAQgB,EAAIhB,EAAQQ,EAAI1C,EAAoB,EAApBA,CAAuB,WACrD,OAA8B,QAAtB4D,KAAKqvB,MAAM,SACjB,OAAQ,CACVA,KAAM,SAASA,KAAKlV,GAClB,OAAOna,KAAKgf,IAAI7E,GAAKA,GAAK,GACrBE,EAAMF,GAAKE,GAAOF,IAAM,GACxBvb,EAAIub,EAAI,GAAKvb,GAAKub,EAAI,KAAOna,KAAK4pB,EAAI,OAOzC,SAAUrtB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Bie,EAAQje,EAAoB,IAC5BwC,EAAMoB,KAAKpB,IAEfN,EAAQA,EAAQgB,EAAG,OAAQ,CACzBgwB,KAAM,SAASA,KAAKnV,GAClB,IAAInZ,EAAIqZ,EAAMF,GAAKA,GACftW,EAAIwW,GAAOF,GACf,OAAOnZ,GAAKiZ,SAAW,EAAIpW,GAAKoW,UAAY,GAAKjZ,EAAI6C,IAAMjF,EAAIub,GAAKvb,GAAKub,QAOvE,SAAU5d,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CACzBiwB,MAAO,SAASA,MAAM1vB,GACpB,OAAa,EAALA,EAASG,KAAKqE,MAAQrE,KAAKoE,MAAMvE,OAOvC,SAAUtD,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B+K,EAAkB/K,EAAoB,IACtCozB,EAAettB,OAAOstB,aACtBC,EAAiBvtB,OAAOwtB,cAG5BpxB,EAAQA,EAAQgB,EAAIhB,EAAQQ,KAAO2wB,GAA2C,GAAzBA,EAAehsB,QAAc,SAAU,CAE1FisB,cAAe,SAASA,cAAcvV,GAKpC,IAJA,IAGI+R,EAHA7mB,EAAM,GACNoH,EAAO1I,UAAUN,OACjBjH,EAAI,EAEMA,EAAPiQ,GAAU,CAEf,GADAyf,GAAQnoB,UAAUvH,KACd2K,EAAgB+kB,EAAM,WAAcA,EAAM,MAAM9jB,WAAW8jB,EAAO,8BACtE7mB,EAAIG,KAAK0mB,EAAO,MACZsD,EAAatD,GACbsD,EAAyC,QAA1BtD,GAAQ,QAAY,IAAcA,EAAO,KAAQ,QAEpE,OAAO7mB,EAAIpD,KAAK,QAOhB,SAAU1F,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9BkG,EAAYlG,EAAoB,IAChCoI,EAAWpI,EAAoB,GAEnCkC,EAAQA,EAAQgB,EAAG,SAAU,CAE3BqwB,IAAK,SAASA,IAAIC,GAMhB,IALA,IAAIC,EAAMvtB,EAAUstB,EAASD,KACzB7gB,EAAMtK,EAASqrB,EAAIpsB,QACnBgJ,EAAO1I,UAAUN,OACjB4B,EAAM,GACN7I,EAAI,EACKA,EAANsS,GACLzJ,EAAIG,KAAKtD,OAAO2tB,EAAIrzB,OAChBA,EAAIiQ,GAAMpH,EAAIG,KAAKtD,OAAO6B,UAAUvH,KACxC,OAAO6I,EAAIpD,KAAK,QAOhB,SAAU1F,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,OAAQ,SAAUgnB,GACxC,OAAO,SAASnP,OACd,OAAOmP,EAAMhhB,KAAM,OAOjB,SAAU7F,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B0zB,EAAM1zB,EAAoB,GAApBA,EAAwB,GAClCkC,EAAQA,EAAQY,EAAG,SAAU,CAE3B6wB,YAAa,SAASA,YAAYzV,GAChC,OAAOwV,EAAI1tB,KAAMkY,OAOf,SAAU/d,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BoI,EAAWpI,EAAoB,GAC/B4zB,EAAU5zB,EAAoB,IAC9B6zB,EAAY,WACZC,EAAY,GAAGD,GAEnB3xB,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAI1C,EAAoB,GAApBA,CAAwB6zB,GAAY,SAAU,CAC5EE,SAAU,SAASA,SAAS3V,GAC1B,IAAI5W,EAAOosB,EAAQ5tB,KAAMoY,EAAcyV,GACnCG,EAAiC,EAAnBrsB,UAAUN,OAAaM,UAAU,GAAK9H,GACpD6S,EAAMtK,EAASZ,EAAKH,QACpB+K,EAAM4hB,IAAgBn0B,GAAY6S,EAAM9O,KAAKkB,IAAIsD,EAAS4rB,GAActhB,GACxEuhB,EAASnuB,OAAOsY,GACpB,OAAO0V,EACHA,EAAUxzB,KAAKkH,EAAMysB,EAAQ7hB,GAC7B5K,EAAKI,MAAMwK,EAAM6hB,EAAO5sB,OAAQ+K,KAAS6hB,MAO3C,SAAU9zB,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B4zB,EAAU5zB,EAAoB,IAC9Bk0B,EAAW,WAEfhyB,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAI1C,EAAoB,GAApBA,CAAwBk0B,GAAW,SAAU,CAC3EviB,SAAU,SAASA,SAASyM,GAC1B,SAAUwV,EAAQ5tB,KAAMoY,EAAc8V,GACnCziB,QAAQ2M,EAAiC,EAAnBzW,UAAUN,OAAaM,UAAU,GAAK9H,QAO7D,SAAUM,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQY,EAAG,SAAU,CAE3B4a,OAAQ1d,EAAoB,OAMxB,SAAUG,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BoI,EAAWpI,EAAoB,GAC/B4zB,EAAU5zB,EAAoB,IAC9Bm0B,EAAc,aACdC,EAAc,GAAGD,GAErBjyB,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAI1C,EAAoB,GAApBA,CAAwBm0B,GAAc,SAAU,CAC9EE,WAAY,SAASA,WAAWjW,GAC9B,IAAI5W,EAAOosB,EAAQ5tB,KAAMoY,EAAc+V,GACnCjrB,EAAQd,EAASxE,KAAKkB,IAAuB,EAAnB6C,UAAUN,OAAaM,UAAU,GAAK9H,GAAW2H,EAAKH,SAChF4sB,EAASnuB,OAAOsY,GACpB,OAAOgW,EACHA,EAAY9zB,KAAKkH,EAAMysB,EAAQ/qB,GAC/B1B,EAAKI,MAAMsB,EAAOA,EAAQ+qB,EAAO5sB,UAAY4sB,MAO/C,SAAU9zB,EAAQD,EAASF,GAIjC,IAAI0zB,EAAM1zB,EAAoB,GAApBA,EAAwB,GAGlCA,EAAoB,GAApBA,CAAwB8F,OAAQ,SAAU,SAAU4Y,GAClD1Y,KAAK8R,GAAKhS,OAAO4Y,GACjB1Y,KAAK2Y,GAAK,GAET,WACD,IAEI2V,EAFA7vB,EAAIuB,KAAK8R,GACT5O,EAAQlD,KAAK2Y,GAEjB,OAAala,EAAE4C,QAAX6B,EAA0B,CAAEvE,MAAO9E,GAAW6Q,MAAM,IACxD4jB,EAAQZ,EAAIjvB,EAAGyE,GACflD,KAAK2Y,IAAM2V,EAAMjtB,OACV,CAAE1C,MAAO2vB,EAAO5jB,MAAM,OAMzB,SAAUvQ,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,SAAU,SAAU4G,GAC1C,OAAO,SAAS2tB,OAAO7zB,GACrB,OAAOkG,EAAWZ,KAAM,IAAK,OAAQtF,OAOnC,SAAUP,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,MAAO,SAAU4G,GACvC,OAAO,SAAS4tB,MACd,OAAO5tB,EAAWZ,KAAM,MAAO,GAAI,QAOjC,SAAU7F,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,QAAS,SAAU4G,GACzC,OAAO,SAAS6tB,QACd,OAAO7tB,EAAWZ,KAAM,QAAS,GAAI,QAOnC,SAAU7F,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,OAAQ,SAAU4G,GACxC,OAAO,SAAS8tB,OACd,OAAO9tB,EAAWZ,KAAM,IAAK,GAAI,QAO/B,SAAU7F,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,QAAS,SAAU4G,GACzC,OAAO,SAAS+tB,QACd,OAAO/tB,EAAWZ,KAAM,KAAM,GAAI,QAOhC,SAAU7F,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,YAAa,SAAU4G,GAC7C,OAAO,SAASguB,UAAUC,GACxB,OAAOjuB,EAAWZ,KAAM,OAAQ,QAAS6uB,OAOvC,SAAU10B,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,WAAY,SAAU4G,GAC5C,OAAO,SAASkuB,SAASC,GACvB,OAAOnuB,EAAWZ,KAAM,OAAQ,OAAQ+uB,OAOtC,SAAU50B,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,UAAW,SAAU4G,GAC3C,OAAO,SAASouB,UACd,OAAOpuB,EAAWZ,KAAM,IAAK,GAAI,QAO/B,SAAU7F,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,OAAQ,SAAU4G,GACxC,OAAO,SAASquB,KAAKC,GACnB,OAAOtuB,EAAWZ,KAAM,IAAK,OAAQkvB,OAOnC,SAAU/0B,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,QAAS,SAAU4G,GACzC,OAAO,SAASuuB,QACd,OAAOvuB,EAAWZ,KAAM,QAAS,GAAI,QAOnC,SAAU7F,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,SAAU,SAAU4G,GAC1C,OAAO,SAASwuB,SACd,OAAOxuB,EAAWZ,KAAM,SAAU,GAAI,QAOpC,SAAU7F,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,MAAO,SAAU4G,GACvC,OAAO,SAASyuB,MACd,OAAOzuB,EAAWZ,KAAM,MAAO,GAAI,QAOjC,SAAU7F,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,MAAO,SAAU4G,GACvC,OAAO,SAAS0uB,MACd,OAAO1uB,EAAWZ,KAAM,MAAO,GAAI,QAOjC,SAAU7F,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,QAAS,CAAEsV,QAASxY,EAAoB,OAKrD,SAAUG,EAAQD,EAASF,GAIjC,IAAIgC,EAAMhC,EAAoB,IAC1BkC,EAAUlC,EAAoB,GAC9BqG,EAAWrG,EAAoB,GAC/BM,EAAON,EAAoB,KAC3BiL,EAAcjL,EAAoB,IAClCoI,EAAWpI,EAAoB,GAC/Bu1B,EAAiBv1B,EAAoB,IACrCmL,EAAYnL,EAAoB,IAEpCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAK1C,EAAoB,GAApBA,CAAwB,SAAUoU,GAAQ9H,MAAM4D,KAAKkE,KAAW,QAAS,CAExGlE,KAAM,SAASA,KAAKuC,GAClB,IAOIpL,EAAQ8B,EAAQgH,EAAMC,EAPtB3L,EAAI4B,EAASoM,GACb/C,EAAmB,mBAAR1J,KAAqBA,KAAOsG,MACvC+D,EAAO1I,UAAUN,OACjBiJ,EAAe,EAAPD,EAAW1I,UAAU,GAAK9H,GAClC0Q,EAAUD,IAAUzQ,GACpBqJ,EAAQ,EACRsH,EAASrF,EAAU1G,GAIvB,GAFI8L,IAASD,EAAQtO,EAAIsO,EAAc,EAAPD,EAAW1I,UAAU,GAAK9H,GAAW,IAEjE2Q,GAAU3Q,IAAe6P,GAAKpD,OAASrB,EAAYuF,GAMrD,IAAKrH,EAAS,IAAIuG,EADlBrI,EAASe,EAAS3D,EAAE4C,SACkB6B,EAAT7B,EAAgB6B,IAC3CqsB,EAAepsB,EAAQD,EAAOqH,EAAUD,EAAM7L,EAAEyE,GAAQA,GAASzE,EAAEyE,SANrE,IAAKkH,EAAWI,EAAOlQ,KAAKmE,GAAI0E,EAAS,IAAIuG,IAAOS,EAAOC,EAASK,QAAQC,KAAMxH,IAChFqsB,EAAepsB,EAAQD,EAAOqH,EAAUjQ,EAAK8P,EAAUE,EAAO,CAACH,EAAKxL,MAAOuE,IAAQ,GAAQiH,EAAKxL,OASpG,OADAwE,EAAO9B,OAAS6B,EACTC,MAOL,SAAUhJ,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9Bu1B,EAAiBv1B,EAAoB,IAGzCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,EAAI1C,EAAoB,EAApBA,CAAuB,WACrD,SAAS0C,KACT,QAAS4J,MAAMsE,GAAGtQ,KAAKoC,aAAcA,KACnC,QAAS,CAEXkO,GAAI,SAASA,KAIX,IAHA,IAAI1H,EAAQ,EACRmH,EAAO1I,UAAUN,OACjB8B,EAAS,IAAoB,mBAARnD,KAAqBA,KAAOsG,OAAO+D,GAC9CnH,EAAPmH,GAAcklB,EAAepsB,EAAQD,EAAOvB,UAAUuB,MAE7D,OADAC,EAAO9B,OAASgJ,EACTlH,MAOL,SAAUhJ,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BkG,EAAYlG,EAAoB,IAChC8N,EAAY,GAAGjI,KAGnB3D,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAK1C,EAAoB,KAAOa,SAAWb,EAAoB,GAApBA,CAAwB8N,IAAa,QAAS,CACnHjI,KAAM,SAASA,KAAK+L,GAClB,OAAO9D,EAAUxN,KAAK4F,EAAUF,MAAO4L,IAAc/R,GAAY,IAAM+R,OAOrE,SAAUzR,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9Bkf,EAAOlf,EAAoB,IAC3B0W,EAAM1W,EAAoB,IAC1B+K,EAAkB/K,EAAoB,IACtCoI,EAAWpI,EAAoB,GAC/BiO,EAAa,GAAGrG,MAGpB1F,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAI1C,EAAoB,EAApBA,CAAuB,WACjDkf,GAAMjR,EAAW3N,KAAK4e,KACxB,QAAS,CACXtX,MAAO,SAASA,MAAMuK,EAAOC,GAC3B,IAAIM,EAAMtK,EAASpC,KAAKqB,QACpB6M,EAAQwC,EAAI1Q,MAEhB,GADAoM,EAAMA,IAAQvS,GAAY6S,EAAMN,EACnB,SAAT8B,EAAkB,OAAOjG,EAAW3N,KAAK0F,KAAMmM,EAAOC,GAM1D,IALA,IAAInB,EAAQlG,EAAgBoH,EAAOO,GAC/B8iB,EAAOzqB,EAAgBqH,EAAKM,GAC5BqiB,EAAO3sB,EAASotB,EAAOvkB,GACvBwkB,EAAS,IAAInpB,MAAMyoB,GACnB30B,EAAI,EACDA,EAAI20B,EAAM30B,IAAKq1B,EAAOr1B,GAAc,UAAT8T,EAC9BlO,KAAK0W,OAAOzL,EAAQ7Q,GACpB4F,KAAKiL,EAAQ7Q,GACjB,OAAOq1B,MAOL,SAAUt1B,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BsH,EAAYtH,EAAoB,IAChCqG,EAAWrG,EAAoB,GAC/B0G,EAAQ1G,EAAoB,GAC5B01B,EAAQ,GAAG1nB,KACX7G,EAAO,CAAC,EAAG,EAAG,GAElBjF,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAKgE,EAAM,WAErCS,EAAK6G,KAAKnO,QACL6G,EAAM,WAEXS,EAAK6G,KAAK,UAELhO,EAAoB,GAApBA,CAAwB01B,IAAS,QAAS,CAE/C1nB,KAAM,SAASA,KAAKiE,GAClB,OAAOA,IAAcpS,GACjB61B,EAAMp1B,KAAK+F,EAASL,OACpB0vB,EAAMp1B,KAAK+F,EAASL,MAAOsB,EAAU2K,QAOvC,SAAU9R,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B21B,EAAW31B,EAAoB,GAApBA,CAAwB,GACnC41B,EAAS51B,EAAoB,GAApBA,CAAwB,GAAGwR,SAAS,GAEjDtP,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAKkzB,EAAQ,QAAS,CAEhDpkB,QAAS,SAASA,QAAQxI,GACxB,OAAO2sB,EAAS3vB,KAAMgD,EAAYrB,UAAU,QAO1C,SAAUxH,EAAQD,EAASF,GAEjC,IAAIwD,EAAWxD,EAAoB,GAC/BwY,EAAUxY,EAAoB,IAC9BgX,EAAUhX,EAAoB,EAApBA,CAAuB,WAErCG,EAAOD,QAAU,SAAUqe,GACzB,IAAI7O,EASF,OARE8I,EAAQ+F,KAGM,mBAFhB7O,EAAI6O,EAAS9X,cAEkBiJ,IAAMpD,QAASkM,EAAQ9I,EAAElO,aAAakO,EAAI7P,IACrE2D,EAASkM,IAED,QADVA,EAAIA,EAAEsH,MACUtH,EAAI7P,KAEf6P,IAAM7P,GAAYyM,MAAQoD,IAM/B,SAAUvP,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B+O,EAAO/O,EAAoB,GAApBA,CAAwB,GAEnCkC,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAK1C,EAAoB,GAApBA,CAAwB,GAAG6R,KAAK,GAAO,QAAS,CAE/EA,IAAK,SAASA,IAAI7I,GAChB,OAAO+F,EAAK/I,KAAMgD,EAAYrB,UAAU,QAOtC,SAAUxH,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B61B,EAAU71B,EAAoB,GAApBA,CAAwB,GAEtCkC,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAK1C,EAAoB,GAApBA,CAAwB,GAAGoR,QAAQ,GAAO,QAAS,CAElFA,OAAQ,SAASA,OAAOpI,GACtB,OAAO6sB,EAAQ7vB,KAAMgD,EAAYrB,UAAU,QAOzC,SAAUxH,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B81B,EAAQ91B,EAAoB,GAApBA,CAAwB,GAEpCkC,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAK1C,EAAoB,GAApBA,CAAwB,GAAGgS,MAAM,GAAO,QAAS,CAEhFA,KAAM,SAASA,KAAKhJ,GAClB,OAAO8sB,EAAM9vB,KAAMgD,EAAYrB,UAAU,QAOvC,SAAUxH,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B+1B,EAAS/1B,EAAoB,GAApBA,CAAwB,GAErCkC,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAK1C,EAAoB,GAApBA,CAAwB,GAAGkR,OAAO,GAAO,QAAS,CAEjFA,MAAO,SAASA,MAAMlI,GACpB,OAAO+sB,EAAO/vB,KAAMgD,EAAYrB,UAAU,QAOxC,SAAUxH,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9Bg2B,EAAUh2B,EAAoB,KAElCkC,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAK1C,EAAoB,GAApBA,CAAwB,GAAG2N,QAAQ,GAAO,QAAS,CAElFA,OAAQ,SAASA,OAAO3E,GACtB,OAAOgtB,EAAQhwB,KAAMgD,EAAYrB,UAAUN,OAAQM,UAAU,IAAI,OAO/D,SAAUxH,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9Bg2B,EAAUh2B,EAAoB,KAElCkC,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAK1C,EAAoB,GAApBA,CAAwB,GAAG6N,aAAa,GAAO,QAAS,CAEvFA,YAAa,SAASA,YAAY7E,GAChC,OAAOgtB,EAAQhwB,KAAMgD,EAAYrB,UAAUN,OAAQM,UAAU,IAAI,OAO/D,SAAUxH,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9Bi2B,EAAWj2B,EAAoB,GAApBA,EAAwB,GACnCyZ,EAAU,GAAGhI,QACbykB,IAAkBzc,GAAW,EAAI,CAAC,GAAGhI,QAAQ,GAAI,GAAK,EAE1DvP,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAKwzB,IAAkBl2B,EAAoB,GAApBA,CAAwByZ,IAAW,QAAS,CAE7FhI,QAAS,SAASA,QAAQC,GACxB,OAAOwkB,EAEHzc,EAAQ/R,MAAM1B,KAAM2B,YAAc,EAClCsuB,EAASjwB,KAAM0L,EAAe/J,UAAU,QAO1C,SAAUxH,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BkG,EAAYlG,EAAoB,IAChC6E,EAAY7E,EAAoB,IAChCoI,EAAWpI,EAAoB,GAC/ByZ,EAAU,GAAGhM,YACbyoB,IAAkBzc,GAAW,EAAI,CAAC,GAAGhM,YAAY,GAAI,GAAK,EAE9DvL,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAKwzB,IAAkBl2B,EAAoB,GAApBA,CAAwByZ,IAAW,QAAS,CAE7FhM,YAAa,SAASA,YAAYiE,GAEhC,GAAIwkB,EAAe,OAAOzc,EAAQ/R,MAAM1B,KAAM2B,YAAc,EAC5D,IAAIlD,EAAIyB,EAAUF,MACdqB,EAASe,EAAS3D,EAAE4C,QACpB6B,EAAQ7B,EAAS,EAGrB,IAFuB,EAAnBM,UAAUN,SAAY6B,EAAQtF,KAAKkB,IAAIoE,EAAOrE,EAAU8C,UAAU,MAClEuB,EAAQ,IAAGA,EAAQ7B,EAAS6B,GACjB,GAATA,EAAYA,IAAS,GAAIA,KAASzE,GAAOA,EAAEyE,KAAWwI,EAAe,OAAOxI,GAAS,EAC3F,OAAQ,MAON,SAAU/I,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQY,EAAG,QAAS,CAAEkO,WAAYhR,EAAoB,OAE9DA,EAAoB,GAApBA,CAAwB,eAKlB,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQY,EAAG,QAAS,CAAEqO,KAAMnR,EAAoB,MAExDA,EAAoB,GAApBA,CAAwB,SAKlB,SAAUG,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9Bm2B,EAAQn2B,EAAoB,GAApBA,CAAwB,GAChCmI,EAAM,OACNiuB,GAAS,EAETjuB,IAAO,IAAImE,MAAM,GAAGnE,GAAK,WAAciuB,GAAS,IACpDl0B,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAI0zB,EAAQ,QAAS,CAC/C/kB,KAAM,SAASA,KAAKrI,GAClB,OAAOmtB,EAAMnwB,KAAMgD,EAA+B,EAAnBrB,UAAUN,OAAaM,UAAU,GAAK9H,OAGzEG,EAAoB,GAApBA,CAAwBmI,IAKlB,SAAUhI,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9Bm2B,EAAQn2B,EAAoB,GAApBA,CAAwB,GAChCmI,EAAM,YACNiuB,GAAS,EAETjuB,IAAO,IAAImE,MAAM,GAAGnE,GAAK,WAAciuB,GAAS,IACpDl0B,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAI0zB,EAAQ,QAAS,CAC/C7kB,UAAW,SAASA,UAAUvI,GAC5B,OAAOmtB,EAAMnwB,KAAMgD,EAA+B,EAAnBrB,UAAUN,OAAaM,UAAU,GAAK9H,OAGzEG,EAAoB,GAApBA,CAAwBmI,IAKlB,SAAUhI,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,UAKlB,SAAUG,EAAQD,EAASF,GAEjC,IAAI4B,EAAS5B,EAAoB,GAC7B8a,EAAoB9a,EAAoB,IACxCuE,EAAKvE,EAAoB,GAAGwE,EAC5B0G,EAAOlL,EAAoB,IAAIwE,EAC/BkU,EAAW1Y,EAAoB,IAC/Bq2B,EAASr2B,EAAoB,IAC7Bs2B,EAAU10B,EAAO4V,OACjBjE,EAAO+iB,EACPvlB,EAAQulB,EAAQ90B,UAChB+0B,EAAM,KACNC,EAAM,KAENC,EAAc,IAAIH,EAAQC,KAASA,EAEvC,GAAIv2B,EAAoB,MAAQy2B,GAAez2B,EAAoB,EAApBA,CAAuB,WAGpE,OAFAw2B,EAAIx2B,EAAoB,EAApBA,CAAuB,WAAY,EAEhCs2B,EAAQC,IAAQA,GAAOD,EAAQE,IAAQA,GAA4B,QAArBF,EAAQC,EAAK,QAC/D,CACHD,EAAU,SAAS9e,OAAO9V,EAAG8C,GAC3B,IAAIkyB,EAAO1wB,gBAAgBswB,EACvBK,EAAOje,EAAShX,GAChBk1B,EAAMpyB,IAAM3E,GAChB,OAAQ62B,GAAQC,GAAQj1B,EAAE+E,cAAgB6vB,GAAWM,EAAMl1B,EACvDoZ,EAAkB2b,EAChB,IAAIljB,EAAKojB,IAASC,EAAMl1B,EAAEU,OAASV,EAAG8C,GACtC+O,GAAMojB,EAAOj1B,aAAa40B,GAAW50B,EAAEU,OAASV,EAAGi1B,GAAQC,EAAMP,EAAO/1B,KAAKoB,GAAK8C,GACpFkyB,EAAO1wB,KAAO+K,EAAOulB,IAS3B,IAPA,IAAIO,EAAQ,SAAUx0B,GACpBA,KAAOi0B,GAAW/xB,EAAG+xB,EAASj0B,EAAK,CACjCtB,cAAc,EACdE,IAAK,WAAc,OAAOsS,EAAKlR,IAC/BgN,IAAK,SAAU5L,GAAM8P,EAAKlR,GAAOoB,MAG5B8F,EAAO2B,EAAKqI,GAAOnT,EAAI,EAAiBA,EAAdmJ,EAAKlC,QAAawvB,EAAMttB,EAAKnJ,OAChE2Q,EAAMtK,YAAc6vB,GACZ90B,UAAYuP,EACpB/Q,EAAoB,GAApBA,CAAwB4B,EAAQ,SAAU00B,GAG5Ct2B,EAAoB,GAApBA,CAAwB,WAKlB,SAAUG,EAAQD,EAASF,GAIjCA,EAAoB,KACpB,IAAIoE,EAAWpE,EAAoB,GAC/Bq2B,EAASr2B,EAAoB,IAC7B+W,EAAc/W,EAAoB,GAClCqF,EAAY,WACZC,EAAY,IAAID,GAEhBwmB,EAAS,SAAUtkB,GACrBvH,EAAoB,GAApBA,CAAwBwX,OAAOhW,UAAW6D,EAAWkC,GAAI,IAIvDvH,EAAoB,EAApBA,CAAuB,WAAc,MAAsD,QAA/CsF,EAAUhF,KAAK,CAAE8B,OAAQ,IAAK+lB,MAAO,QACnF0D,EAAO,SAAS9lB,WACd,IAAIxC,EAAIa,EAAS4B,MACjB,MAAO,IAAIqO,OAAO9Q,EAAEnB,OAAQ,IAC1B,UAAWmB,EAAIA,EAAE4kB,OAASpR,GAAexT,aAAaiU,OAAS6e,EAAO/1B,KAAKiD,GAAK1D,MAG3EyF,EAAU5E,MAAQ2E,GAC3BwmB,EAAO,SAAS9lB,WACd,OAAOT,EAAUhF,KAAK0F,SAOpB,SAAU7F,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,QAAS,EAAG,SAAU+E,EAAS0T,EAAOqe,GAE5D,MAAO,CAAC,SAAS5H,MAAM6H,GAErB,IAAItyB,EAAIM,EAAQiB,MACZuB,EAAKwvB,GAAUl3B,GAAYA,GAAYk3B,EAAOte,GAClD,OAAOlR,IAAO1H,GAAY0H,EAAGjH,KAAKy2B,EAAQtyB,GAAK,IAAI+S,OAAOuf,GAAQte,GAAO3S,OAAOrB,KAC/EqyB,MAMC,SAAU32B,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,UAAW,EAAG,SAAU+E,EAASiyB,EAASC,GAEhE,MAAO,CAAC,SAAShwB,QAAQiwB,EAAaC,GAEpC,IAAI1yB,EAAIM,EAAQiB,MACZuB,EAAK2vB,GAAer3B,GAAYA,GAAYq3B,EAAYF,GAC5D,OAAOzvB,IAAO1H,GACV0H,EAAGjH,KAAK42B,EAAazyB,EAAG0yB,GACxBF,EAAS32B,KAAKwF,OAAOrB,GAAIyyB,EAAaC,IACzCF,MAMC,SAAU92B,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,SAAU,EAAG,SAAU+E,EAASqyB,EAAQC,GAE9D,MAAO,CAAC,SAASpD,OAAO8C,GAEtB,IAAItyB,EAAIM,EAAQiB,MACZuB,EAAKwvB,GAAUl3B,GAAYA,GAAYk3B,EAAOK,GAClD,OAAO7vB,IAAO1H,GAAY0H,EAAGjH,KAAKy2B,EAAQtyB,GAAK,IAAI+S,OAAOuf,GAAQK,GAAQtxB,OAAOrB,KAChF4yB,MAMC,SAAUl3B,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,QAAS,EAAG,SAAU+E,EAASuyB,EAAOC,GAE5D,IAAI7e,EAAW1Y,EAAoB,IAC/Bw3B,EAASD,EACTE,EAAQ,GAAGruB,KACXsuB,EAAS,QACTC,EAAS,SACTC,EAAa,YACjB,GAC+B,KAA7B,OAAOF,GAAQ,QAAQ,IACe,GAAtC,OAAOA,GAAQ,QAAS,GAAGC,IACQ,GAAnC,KAAKD,GAAQ,WAAWC,IACW,GAAnC,IAAID,GAAQ,YAAYC,IACM,EAA9B,IAAID,GAAQ,QAAQC,IACpB,GAAGD,GAAQ,MAAMC,GACjB,CACA,IAAIE,EAAO,OAAO/zB,KAAK,IAAI,KAAOjE,GAElC03B,EAAS,SAAU3lB,EAAWkmB,GAC5B,IAAIjxB,EAASf,OAAOE,MACpB,GAAI4L,IAAc/R,IAAuB,IAAVi4B,EAAa,MAAO,GAEnD,IAAKpf,EAAS9G,GAAY,OAAO4lB,EAAOl3B,KAAKuG,EAAQ+K,EAAWkmB,GAChE,IASIC,EAAY7I,EAAO8I,EAAWC,EAAY73B,EAT1C83B,EAAS,GACT/P,GAASvW,EAAUsI,WAAa,IAAM,KAC7BtI,EAAUuI,UAAY,IAAM,KAC5BvI,EAAUwI,QAAU,IAAM,KAC1BxI,EAAUyI,OAAS,IAAM,IAClC8d,EAAgB,EAChBC,EAAaN,IAAUj4B,GAAY,WAAai4B,IAAU,EAE1DO,EAAgB,IAAI7gB,OAAO5F,EAAUxP,OAAQ+lB,EAAQ,KAIzD,IADK0P,IAAME,EAAa,IAAIvgB,OAAO,IAAM6gB,EAAcj2B,OAAS,WAAY+lB,KACrE+G,EAAQmJ,EAAcv0B,KAAK+C,OAGhBsxB,GADhBH,EAAY9I,EAAMhmB,MAAQgmB,EAAM,GAAGyI,MAEjCO,EAAO9uB,KAAKvC,EAAOe,MAAMuwB,EAAejJ,EAAMhmB,SAGzC2uB,GAAwB,EAAhB3I,EAAMyI,IAAazI,EAAM,GAAGjoB,QAAQ8wB,EAAY,WAC3D,IAAK33B,EAAI,EAAGA,EAAIuH,UAAUgwB,GAAU,EAAGv3B,IAASuH,UAAUvH,KAAOP,KAAWqvB,EAAM9uB,GAAKP,MAErE,EAAhBqvB,EAAMyI,IAAezI,EAAMhmB,MAAQrC,EAAO8wB,IAASF,EAAM/vB,MAAMwwB,EAAQhJ,EAAMtnB,MAAM,IACvFqwB,EAAa/I,EAAM,GAAGyI,GACtBQ,EAAgBH,EACMI,GAAlBF,EAAOP,MAETU,EAAcT,KAAgB1I,EAAMhmB,OAAOmvB,EAAcT,KAK/D,OAHIO,IAAkBtxB,EAAO8wB,IACvBM,GAAeI,EAAclxB,KAAK,KAAK+wB,EAAO9uB,KAAK,IAClD8uB,EAAO9uB,KAAKvC,EAAOe,MAAMuwB,IACRC,EAAjBF,EAAOP,GAAuBO,EAAOtwB,MAAM,EAAGwwB,GAAcF,OAG5D,IAAIR,GAAQ73B,GAAW,GAAG83B,KACnCJ,EAAS,SAAU3lB,EAAWkmB,GAC5B,OAAOlmB,IAAc/R,IAAuB,IAAVi4B,EAAc,GAAKN,EAAOl3B,KAAK0F,KAAM4L,EAAWkmB,KAItF,MAAO,CAAC,SAAStyB,MAAMoM,EAAWkmB,GAChC,IAAIrzB,EAAIM,EAAQiB,MACZuB,EAAKqK,GAAa/R,GAAYA,GAAY+R,EAAU0lB,GACxD,OAAO/vB,IAAO1H,GAAY0H,EAAGjH,KAAKsR,EAAWnN,EAAGqzB,GAASP,EAAOj3B,KAAKwF,OAAOrB,GAAImN,EAAWkmB,IAC1FP,MAMC,SAAUp3B,EAAQD,EAASF,GAIjC,IAwBIs4B,EAAUC,EAA6BC,EAAsBC,EAxB7DjuB,EAAUxK,EAAoB,IAC9B4B,EAAS5B,EAAoB,GAC7BgC,EAAMhC,EAAoB,IAC1BgL,EAAUhL,EAAoB,IAC9BkC,EAAUlC,EAAoB,GAC9BwD,EAAWxD,EAAoB,GAC/BsH,EAAYtH,EAAoB,IAChC2K,EAAa3K,EAAoB,IACjC6a,EAAQ7a,EAAoB,IAC5BuL,EAAqBvL,EAAoB,IACzCkiB,EAAOliB,EAAoB,IAAIqP,IAC/BqpB,EAAY14B,EAAoB,GAApBA,GACZ24B,EAA6B34B,EAAoB,IACjD44B,EAAU54B,EAAoB,KAC9B4a,EAAY5a,EAAoB,IAChC64B,EAAiB74B,EAAoB,KACrC84B,EAAU,UACVp1B,EAAY9B,EAAO8B,UACnB0b,EAAUxd,EAAOwd,QACjB2Z,EAAW3Z,GAAWA,EAAQ2Z,SAC9BC,EAAKD,GAAYA,EAASC,IAAM,GAChCC,EAAWr3B,EAAOk3B,GAClB9X,EAA6B,WAApBhW,EAAQoU,GACjB8Z,EAAQ,aAER9Q,EAAuBmQ,EAA8BI,EAA2Bn0B,EAEhFqoB,IAAe,WACjB,IAEE,IAAIlL,EAAUsX,EAASvX,QAAQ,GAC3ByX;AAAexX,EAAQlb,YAAc,IAAIzG,EAAoB,EAApBA,CAAuB,YAAc,SAAU8D,GAC1FA,EAAKo1B,EAAOA,IAGd,OAAQlY,GAA0C,mBAAzBoY,wBACpBzX,EAAQC,KAAKsX,aAAkBC,GAIT,IAAtBH,EAAGvnB,QAAQ,SACyB,IAApCmJ,EAAUnJ,QAAQ,aACvB,MAAO1N,KAfQ,GAmBfs1B,EAAa,SAAU51B,GACzB,IAAIme,EACJ,SAAOpe,EAASC,IAAkC,mBAAnBme,EAAOne,EAAGme,QAAsBA,GAE7DT,EAAS,SAAUQ,EAAS2X,GAC9B,IAAI3X,EAAQ4X,GAAZ,CACA5X,EAAQ4X,IAAK,EACb,IAAIC,EAAQ7X,EAAQ8X,GACpBf,EAAU,WAoCR,IAnCA,IAAI/zB,EAAQgd,EAAQ+X,GAChBC,EAAmB,GAAdhY,EAAQiY,GACbx5B,EAAI,EACJ0f,EAAM,SAAU+Z,GAClB,IAII1wB,EAAQyY,EAAMkY,EAJdC,EAAUJ,EAAKE,EAASF,GAAKE,EAASG,KACtCtY,EAAUmY,EAASnY,QACnBU,EAASyX,EAASzX,OAClBd,EAASuY,EAASvY,OAEtB,IACMyY,GACGJ,IACe,GAAdhY,EAAQsY,IAASC,EAAkBvY,GACvCA,EAAQsY,GAAK,IAEC,IAAZF,EAAkB5wB,EAASxE,GAEzB2c,GAAQA,EAAOE,QACnBrY,EAAS4wB,EAAQp1B,GACb2c,IACFA,EAAOC,OACPuY,GAAS,IAGT3wB,IAAW0wB,EAASlY,QACtBS,EAAO1e,EAAU,yBACRke,EAAOyX,EAAWlwB,IAC3ByY,EAAKthB,KAAK6I,EAAQuY,EAASU,GACtBV,EAAQvY,IACViZ,EAAOzd,GACd,MAAOZ,GACHud,IAAWwY,GAAQxY,EAAOC,OAC9Ba,EAAOre,KAGW3D,EAAfo5B,EAAMnyB,QAAYyY,EAAI0Z,EAAMp5B,MACnCuhB,EAAQ8X,GAAK,GACb9X,EAAQ4X,IAAK,EACTD,IAAa3X,EAAQsY,IAAIE,EAAYxY,OAGzCwY,EAAc,SAAUxY,GAC1BO,EAAK5hB,KAAKsB,EAAQ,WAChB,IAEIuH,EAAQ4wB,EAASK,EAFjBz1B,EAAQgd,EAAQ+X,GAChBW,EAAYC,EAAY3Y,GAe5B,GAbI0Y,IACFlxB,EAASyvB,EAAQ,WACX5X,EACF5B,EAAQmb,KAAK,qBAAsB51B,EAAOgd,IACjCoY,EAAUn4B,EAAO44B,sBAC1BT,EAAQ,CAAEpY,QAASA,EAAS8Y,OAAQ91B,KAC1By1B,EAAUx4B,EAAOw4B,UAAYA,EAAQM,OAC/CN,EAAQM,MAAM,8BAA+B/1B,KAIjDgd,EAAQsY,GAAKjZ,GAAUsZ,EAAY3Y,GAAW,EAAI,GAClDA,EAAQgZ,GAAK96B,GACXw6B,GAAalxB,EAAOpF,EAAG,MAAMoF,EAAOyK,KAGxC0mB,EAAc,SAAU3Y,GAC1B,OAAsB,IAAfA,EAAQsY,IAAkD,KAArCtY,EAAQgZ,IAAMhZ,EAAQ8X,IAAIpyB,QAEpD6yB,EAAoB,SAAUvY,GAChCO,EAAK5hB,KAAKsB,EAAQ,WAChB,IAAIm4B,EACA/Y,EACF5B,EAAQmb,KAAK,mBAAoB5Y,IACxBoY,EAAUn4B,EAAOg5B,qBAC1Bb,EAAQ,CAAEpY,QAASA,EAAS8Y,OAAQ9Y,EAAQ+X,QAI9CmB,EAAU,SAAUl2B,GACtB,IAAIgd,EAAU3b,KACV2b,EAAQ3R,KACZ2R,EAAQ3R,IAAK,GACb2R,EAAUA,EAAQmZ,IAAMnZ,GAChB+X,GAAK/0B,EACbgd,EAAQiY,GAAK,EACRjY,EAAQgZ,KAAIhZ,EAAQgZ,GAAKhZ,EAAQ8X,GAAG7xB,SACzCuZ,EAAOQ,GAAS,KAEdoZ,EAAW,SAAUp2B,GACvB,IACIid,EADAD,EAAU3b,KAEd,IAAI2b,EAAQ3R,GAAZ,CACA2R,EAAQ3R,IAAK,EACb2R,EAAUA,EAAQmZ,IAAMnZ,EACxB,IACE,GAAIA,IAAYhd,EAAO,MAAMjB,EAAU,qCACnCke,EAAOyX,EAAW10B,IACpB+zB,EAAU,WACR,IAAIxlB,EAAU,CAAE4nB,GAAInZ,EAAS3R,IAAI,GACjC,IACE4R,EAAKthB,KAAKqE,EAAO3C,EAAI+4B,EAAU7nB,EAAS,GAAIlR,EAAI64B,EAAS3nB,EAAS,IAClE,MAAOnP,GACP82B,EAAQv6B,KAAK4S,EAASnP,OAI1B4d,EAAQ+X,GAAK/0B,EACbgd,EAAQiY,GAAK,EACbzY,EAAOQ,GAAS,IAElB,MAAO5d,GACP82B,EAAQv6B,KAAK,CAAEw6B,GAAInZ,EAAS3R,IAAI,GAASjM,MAKxC8oB,IAEHoM,EAAW,SAASlY,QAAQia,GAC1BrwB,EAAW3E,KAAMizB,EAAUH,EAAS,MACpCxxB,EAAU0zB,GACV1C,EAASh4B,KAAK0F,MACd,IACEg1B,EAASh5B,EAAI+4B,EAAU/0B,KAAM,GAAIhE,EAAI64B,EAAS70B,KAAM,IACpD,MAAOi1B,GACPJ,EAAQv6B,KAAK0F,KAAMi1B,MAIvB3C,EAAW,SAASvX,QAAQia,GAC1Bh1B,KAAKyzB,GAAK,GACVzzB,KAAK20B,GAAK96B,GACVmG,KAAK4zB,GAAK,EACV5zB,KAAKgK,IAAK,EACVhK,KAAK0zB,GAAK75B,GACVmG,KAAKi0B,GAAK,EACVj0B,KAAKuzB,IAAK,IAEH/3B,UAAYxB,EAAoB,GAApBA,CAAwBi5B,EAASz3B,UAAW,CAE/DogB,KAAM,SAASA,KAAKsZ,EAAaC,GAC/B,IAAItB,EAAWzR,EAAqB7c,EAAmBvF,KAAMizB,IAO7D,OANAY,EAASF,GAA2B,mBAAfuB,GAA4BA,EACjDrB,EAASG,KAA4B,mBAAdmB,GAA4BA,EACnDtB,EAASvY,OAASN,EAAS5B,EAAQkC,OAASzhB,GAC5CmG,KAAKyzB,GAAGrwB,KAAKywB,GACT7zB,KAAK20B,IAAI30B,KAAK20B,GAAGvxB,KAAKywB,GACtB7zB,KAAK4zB,IAAIzY,EAAOnb,MAAM,GACnB6zB,EAASlY,SAGlByZ,QAAS,SAAUD,GACjB,OAAOn1B,KAAK4b,KAAK/hB,GAAWs7B,MAGhC3C,EAAuB,WACrB,IAAI7W,EAAU,IAAI2W,EAClBtyB,KAAK2b,QAAUA,EACf3b,KAAK0b,QAAU1f,EAAI+4B,EAAUpZ,EAAS,GACtC3b,KAAKoc,OAASpgB,EAAI64B,EAASlZ,EAAS,IAEtCgX,EAA2Bn0B,EAAI4jB,EAAuB,SAAU1Y,GAC9D,OAAOA,IAAMupB,GAAYvpB,IAAM+oB,EAC3B,IAAID,EAAqB9oB,GACzB6oB,EAA4B7oB,KAIpCxN,EAAQA,EAAQU,EAAIV,EAAQoB,EAAIpB,EAAQQ,GAAKmqB,EAAY,CAAE9L,QAASkY,IACpEj5B,EAAoB,GAApBA,CAAwBi5B,EAAUH,GAClC94B,EAAoB,GAApBA,CAAwB84B,GACxBL,EAAUz4B,EAAoB,IAAI84B,GAGlC52B,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAKmqB,EAAYiM,EAAS,CAEpD1W,OAAQ,SAASA,OAAOyG,GACtB,IAAIwS,EAAajT,EAAqBpiB,MAGtC,OADAsc,EADe+Y,EAAWjZ,QACjByG,GACFwS,EAAW1Z,WAGtBzf,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAK8H,IAAYqiB,GAAaiM,EAAS,CAEjEpX,QAAS,SAASA,QAAQ3D,GACxB,OAAO8a,EAAeruB,GAAWxE,OAASyyB,EAAUQ,EAAWjzB,KAAM+X,MAGzE7b,EAAQA,EAAQgB,EAAIhB,EAAQQ,IAAMmqB,GAAc7sB,EAAoB,GAApBA,CAAwB,SAAUoU,GAChF6kB,EAASqC,IAAIlnB,GAAa,SAAE8kB,MACzBJ,EAAS,CAEZwC,IAAK,SAASA,IAAIllB,GAChB,IAAI1G,EAAI1J,KACJq1B,EAAajT,EAAqB1Y,GAClCgS,EAAU2Z,EAAW3Z,QACrBU,EAASiZ,EAAWjZ,OACpBjZ,EAASyvB,EAAQ,WACnB,IAAIxrB,EAAS,GACTlE,EAAQ,EACRqyB,EAAY,EAChB1gB,EAAMzE,GAAU,EAAO,SAAUuL,GAC/B,IAAI6Z,EAAStyB,IACTuyB,GAAgB,EACpBruB,EAAOhE,KAAKvJ,IACZ07B,IACA7rB,EAAEgS,QAAQC,GAASC,KAAK,SAAUjd,GAC5B82B,IACJA,GAAgB,EAChBruB,EAAOouB,GAAU72B,IACf42B,GAAa7Z,EAAQtU,KACtBgV,OAEHmZ,GAAa7Z,EAAQtU,KAGzB,OADIjE,EAAOpF,GAAGqe,EAAOjZ,EAAOyK,GACrBynB,EAAW1Z,SAGpB+Z,KAAM,SAASA,KAAKtlB,GAClB,IAAI1G,EAAI1J,KACJq1B,EAAajT,EAAqB1Y,GAClC0S,EAASiZ,EAAWjZ,OACpBjZ,EAASyvB,EAAQ,WACnB/d,EAAMzE,GAAU,EAAO,SAAUuL,GAC/BjS,EAAEgS,QAAQC,GAASC,KAAKyZ,EAAW3Z,QAASU,OAIhD,OADIjZ,EAAOpF,GAAGqe,EAAOjZ,EAAOyK,GACrBynB,EAAW1Z,YAOhB,SAAUxhB,EAAQD,EAASF,GAIjC,IAAImpB,EAAOnpB,EAAoB,KAC3ByP,EAAWzP,EAAoB,IAC/B27B,EAAW,UAGf37B,EAAoB,GAApBA,CAAwB27B,EAAU,SAAU16B,GAC1C,OAAO,SAAS26B,UAAY,OAAO36B,EAAI+E,KAAyB,EAAnB2B,UAAUN,OAAaM,UAAU,GAAK9H,MAClF,CAEDsb,IAAK,SAASA,IAAIxW,GAChB,OAAOwkB,EAAKhS,IAAI1H,EAASzJ,KAAM21B,GAAWh3B,GAAO,KAElDwkB,GAAM,GAAO,IAKV,SAAUhpB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BsH,EAAYtH,EAAoB,IAChCoE,EAAWpE,EAAoB,GAC/B67B,GAAU77B,EAAoB,GAAGuiB,SAAW,IAAI7a,MAChDo0B,EAAS14B,SAASsE,MAEtBxF,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAK1C,EAAoB,EAApBA,CAAuB,WACtD67B,EAAO,gBACL,UAAW,CACbn0B,MAAO,SAASA,MAAMzE,EAAQ84B,EAAcC,GAC1C,IAAIplB,EAAItP,EAAUrE,GACdg5B,EAAI73B,EAAS43B,GACjB,OAAOH,EAASA,EAAOjlB,EAAGmlB,EAAcE,GAAKH,EAAOx7B,KAAKsW,EAAGmlB,EAAcE,OAOxE,SAAU97B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B8I,EAAS9I,EAAoB,IAC7BsH,EAAYtH,EAAoB,IAChCoE,EAAWpE,EAAoB,GAC/BwD,EAAWxD,EAAoB,GAC/B0G,EAAQ1G,EAAoB,GAC5BumB,EAAOvmB,EAAoB,KAC3Bk8B,GAAcl8B,EAAoB,GAAGuiB,SAAW,IAAImE,UAIpDyV,EAAiBz1B,EAAM,WACzB,SAAShE,KACT,QAASw5B,EAAW,aAA6B,GAAIx5B,aAAcA,KAEjE05B,GAAY11B,EAAM,WACpBw1B,EAAW,gBAGbh6B,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAKy5B,GAAkBC,GAAW,UAAW,CACvE1V,UAAW,SAASA,UAAU2V,EAAQ7e,GACpClW,EAAU+0B,GACVj4B,EAASoZ,GACT,IAAI8e,EAAY30B,UAAUN,OAAS,EAAIg1B,EAAS/0B,EAAUK,UAAU,IACpE,GAAIy0B,IAAaD,EAAgB,OAAOD,EAAWG,EAAQ7e,EAAM8e,GACjE,GAAID,GAAUC,EAAW,CAEvB,OAAQ9e,EAAKnW,QACX,KAAK,EAAG,OAAO,IAAIg1B,EACnB,KAAK,EAAG,OAAO,IAAIA,EAAO7e,EAAK,IAC/B,KAAK,EAAG,OAAO,IAAI6e,EAAO7e,EAAK,GAAIA,EAAK,IACxC,KAAK,EAAG,OAAO,IAAI6e,EAAO7e,EAAK,GAAIA,EAAK,GAAIA,EAAK,IACjD,KAAK,EAAG,OAAO,IAAI6e,EAAO7e,EAAK,GAAIA,EAAK,GAAIA,EAAK,GAAIA,EAAK,IAG5D,IAAI+e,EAAQ,CAAC,MAEb,OADAA,EAAMnzB,KAAK1B,MAAM60B,EAAO/e,GACjB,IAAK+I,EAAK7e,MAAM20B,EAAQE,IAGjC,IAAIxrB,EAAQurB,EAAU96B,UAClB4Z,EAAWtS,EAAOtF,EAASuN,GAASA,EAAQlQ,OAAOW,WACnD2H,EAAS/F,SAASsE,MAAMpH,KAAK+7B,EAAQjhB,EAAUoC,GACnD,OAAOha,EAAS2F,GAAUA,EAASiS,MAOjC,SAAUjb,EAAQD,EAASF,GAGjC,IAAIuE,EAAKvE,EAAoB,GACzBkC,EAAUlC,EAAoB,GAC9BoE,EAAWpE,EAAoB,GAC/BsE,EAActE,EAAoB,IAGtCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,EAAI1C,EAAoB,EAApBA,CAAuB,WAErDuiB,QAAQzhB,eAAeyD,EAAGC,EAAE,GAAI,EAAG,CAAEG,MAAO,IAAM,EAAG,CAAEA,MAAO,MAC5D,UAAW,CACb7D,eAAgB,SAASA,eAAemC,EAAQu5B,EAAaC,GAC3Dr4B,EAASnB,GACTu5B,EAAcl4B,EAAYk4B,GAAa,GACvCp4B,EAASq4B,GACT,IAEE,OADAl4B,EAAGC,EAAEvB,EAAQu5B,EAAaC,IACnB,EACP,MAAO14B,GACP,OAAO,OAQP,SAAU5D,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BmG,EAAOnG,EAAoB,IAAIwE,EAC/BJ,EAAWpE,EAAoB,GAEnCkC,EAAQA,EAAQgB,EAAG,UAAW,CAC5Bw5B,eAAgB,SAASA,eAAez5B,EAAQu5B,GAC9C,IAAIzpB,EAAO5M,EAAK/B,EAASnB,GAASu5B,GAClC,QAAOzpB,IAASA,EAAKhS,sBAA8BkC,EAAOu5B,OAOxD,SAAUr8B,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BoE,EAAWpE,EAAoB,GAC/B28B,EAAY,SAAUje,GACxB1Y,KAAK8R,GAAK1T,EAASsa,GACnB1Y,KAAK2Y,GAAK,EACV,IACItc,EADAkH,EAAOvD,KAAK4Y,GAAK,GAErB,IAAKvc,KAAOqc,EAAUnV,EAAKH,KAAK/G,IAElCrC,EAAoB,GAApBA,CAAwB28B,EAAW,SAAU,WAC3C,IAEIt6B,EADAkH,EADOvD,KACK4Y,GAEhB,GACE,GAAerV,EAAKlC,QAJXrB,KAIA2Y,GAAmB,MAAO,CAAEha,MAAO9E,GAAW6Q,MAAM,YACnDrO,EAAMkH,EALPvD,KAKiB2Y,SALjB3Y,KAKgC8R,KAC3C,MAAO,CAAEnT,MAAOtC,EAAKqO,MAAM,KAG7BxO,EAAQA,EAAQgB,EAAG,UAAW,CAC5B05B,UAAW,SAASA,UAAU35B,GAC5B,OAAO,IAAI05B,EAAU15B,OAOnB,SAAU9C,EAAQD,EAASF,GAGjC,IAAImG,EAAOnG,EAAoB,IAC3BwG,EAAiBxG,EAAoB,IACrCmF,EAAMnF,EAAoB,IAC1BkC,EAAUlC,EAAoB,GAC9BwD,EAAWxD,EAAoB,GAC/BoE,EAAWpE,EAAoB,GAcnCkC,EAAQA,EAAQgB,EAAG,UAAW,CAAEjC,IAZhC,SAASA,IAAIgC,EAAQu5B,GACnB,IACIzpB,EAAMhC,EADN8rB,EAAWl1B,UAAUN,OAAS,EAAIpE,EAAS0E,UAAU,GAEzD,OAAIvD,EAASnB,KAAY45B,EAAiB55B,EAAOu5B,IAC7CzpB,EAAO5M,EAAK3B,EAAEvB,EAAQu5B,IAAqBr3B,EAAI4N,EAAM,SACrDA,EAAKpO,MACLoO,EAAK9R,MAAQpB,GACXkT,EAAK9R,IAAIX,KAAKu8B,GACdh9B,GACF2D,EAASuN,EAAQvK,EAAevD,IAAiBhC,IAAI8P,EAAOyrB,EAAaK,QAA7E,MAQI,SAAU18B,EAAQD,EAASF,GAGjC,IAAImG,EAAOnG,EAAoB,IAC3BkC,EAAUlC,EAAoB,GAC9BoE,EAAWpE,EAAoB,GAEnCkC,EAAQA,EAAQgB,EAAG,UAAW,CAC5BkD,yBAA0B,SAASA,yBAAyBnD,EAAQu5B,GAClE,OAAOr2B,EAAK3B,EAAEJ,EAASnB,GAASu5B,OAO9B,SAAUr8B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B88B,EAAW98B,EAAoB,IAC/BoE,EAAWpE,EAAoB,GAEnCkC,EAAQA,EAAQgB,EAAG,UAAW,CAC5BsD,eAAgB,SAASA,eAAevD,GACtC,OAAO65B,EAAS14B,EAASnB,QAOvB,SAAU9C,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,UAAW,CAC5BiC,IAAK,SAASA,IAAIlC,EAAQu5B,GACxB,OAAOA,KAAev5B,MAOpB,SAAU9C,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BoE,EAAWpE,EAAoB,GAC/B8uB,EAAgBjuB,OAAO0U,aAE3BrT,EAAQA,EAAQgB,EAAG,UAAW,CAC5BqS,aAAc,SAASA,aAAatS,GAElC,OADAmB,EAASnB,IACF6rB,GAAgBA,EAAc7rB,OAOnC,SAAU9C,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,UAAW,CAAEsf,QAASxiB,EAAoB,OAKvD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BoE,EAAWpE,EAAoB,GAC/ByuB,EAAqB5tB,OAAO4U,kBAEhCvT,EAAQA,EAAQgB,EAAG,UAAW,CAC5BuS,kBAAmB,SAASA,kBAAkBxS,GAC5CmB,EAASnB,GACT,IAEE,OADIwrB,GAAoBA,EAAmBxrB,IACpC,EACP,MAAOc,GACP,OAAO,OAQP,SAAU5D,EAAQD,EAASF,GAGjC,IAAIuE,EAAKvE,EAAoB,GACzBmG,EAAOnG,EAAoB,IAC3BwG,EAAiBxG,EAAoB,IACrCmF,EAAMnF,EAAoB,IAC1BkC,EAAUlC,EAAoB,GAC9BkF,EAAalF,EAAoB,IACjCoE,EAAWpE,EAAoB,GAC/BwD,EAAWxD,EAAoB,GAwBnCkC,EAAQA,EAAQgB,EAAG,UAAW,CAAEmM,IAtBhC,SAASA,IAAIpM,EAAQu5B,EAAaO,GAChC,IAEIC,EAAoBjsB,EAFpB8rB,EAAWl1B,UAAUN,OAAS,EAAIpE,EAAS0E,UAAU,GACrDs1B,EAAU92B,EAAK3B,EAAEJ,EAASnB,GAASu5B,GAEvC,IAAKS,EAAS,CACZ,GAAIz5B,EAASuN,EAAQvK,EAAevD,IAClC,OAAOoM,IAAI0B,EAAOyrB,EAAaO,EAAGF,GAEpCI,EAAU/3B,EAAW,GAEvB,GAAIC,EAAI83B,EAAS,SAAU,CACzB,IAAyB,IAArBA,EAAQjqB,WAAuBxP,EAASq5B,GAAW,OAAO,EAC9D,GAAIG,EAAqB72B,EAAK3B,EAAEq4B,EAAUL,GAAc,CACtD,GAAIQ,EAAmB/7B,KAAO+7B,EAAmB3tB,MAAuC,IAAhC2tB,EAAmBhqB,SAAoB,OAAO,EACtGgqB,EAAmBr4B,MAAQo4B,EAC3Bx4B,EAAGC,EAAEq4B,EAAUL,EAAaQ,QACvBz4B,EAAGC,EAAEq4B,EAAUL,EAAat3B,EAAW,EAAG63B,IACjD,OAAO,EAET,OAAOE,EAAQ5tB,MAAQxP,KAAqBo9B,EAAQ5tB,IAAI/O,KAAKu8B,EAAUE,IAAI,OAQvE,SAAU58B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Bk9B,EAAWl9B,EAAoB,IAE/Bk9B,GAAUh7B,EAAQA,EAAQgB,EAAG,UAAW,CAC1Cma,eAAgB,SAASA,eAAepa,EAAQ8N,GAC9CmsB,EAAS9f,MAAMna,EAAQ8N,GACvB,IAEE,OADAmsB,EAAS7tB,IAAIpM,EAAQ8N,IACd,EACP,MAAOhN,GACP,OAAO,OAQP,SAAU5D,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CAAEgd,IAAK,WAAc,OAAO,IAAIid,MAAOC,cAK5D,SAAUj9B,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BqG,EAAWrG,EAAoB,GAC/BsE,EAActE,EAAoB,IAEtCkC,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAI1C,EAAoB,EAApBA,CAAuB,WACrD,OAAkC,OAA3B,IAAIm9B,KAAKrZ,KAAKqH,UAC2D,IAA3EgS,KAAK37B,UAAU2pB,OAAO7qB,KAAK,CAAE+8B,YAAa,WAAc,OAAO,OAClE,OAAQ,CAEVlS,OAAQ,SAASA,OAAO9oB,GACtB,IAAIoC,EAAI4B,EAASL,MACbs3B,EAAKh5B,EAAYG,GACrB,MAAoB,iBAAN64B,GAAmBzW,SAASyW,GAAa74B,EAAE44B,cAAT,SAO9C,SAAUl9B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Bq9B,EAAcr9B,EAAoB,KAGtCkC,EAAQA,EAAQY,EAAIZ,EAAQQ,GAAKy6B,KAAK37B,UAAU67B,cAAgBA,GAAc,OAAQ,CACpFA,YAAaA,KAMT,SAAUl9B,EAAQD,EAASF,GAKjC,IAAI0G,EAAQ1G,EAAoB,GAC5Bo9B,EAAUD,KAAK37B,UAAU47B,QACzBG,EAAeJ,KAAK37B,UAAU67B,YAE9BG,EAAK,SAAUC,GACjB,OAAa,EAANA,EAAUA,EAAM,IAAMA,GAI/Bt9B,EAAOD,QAAWwG,EAAM,WACtB,MAAiD,4BAA1C62B,EAAaj9B,KAAK,IAAI68B,MAAM,KAAO,QACrCz2B,EAAM,WACX62B,EAAaj9B,KAAK,IAAI68B,KAAKrZ,QACvB,SAASuZ,cACb,IAAKxW,SAASuW,EAAQ98B,KAAK0F,OAAQ,MAAMgG,WAAW,sBACpD,IAAIvL,EAAIuF,KACJ+oB,EAAItuB,EAAEi9B,iBACNn9B,EAAIE,EAAEk9B,qBACNh8B,EAAIotB,EAAI,EAAI,IAAU,KAAJA,EAAW,IAAM,GACvC,OAAOptB,GAAK,QAAUiC,KAAKgf,IAAImM,IAAInnB,MAAMjG,GAAK,GAAK,GACjD,IAAM67B,EAAG/8B,EAAEm9B,cAAgB,GAAK,IAAMJ,EAAG/8B,EAAEo9B,cAC3C,IAAML,EAAG/8B,EAAEq9B,eAAiB,IAAMN,EAAG/8B,EAAEs9B,iBACvC,IAAMP,EAAG/8B,EAAEu9B,iBAAmB,KAAW,GAAJz9B,EAASA,EAAI,IAAMi9B,EAAGj9B,IAAM,KACjEg9B,GAKE,SAAUp9B,EAAQD,EAASF,GAEjC,IAAIi+B,EAAYd,KAAK37B,UACjB08B,EAAe,eACf74B,EAAY,WACZC,EAAY24B,EAAU54B,GACtB+3B,EAAUa,EAAUb,QACpB,IAAID,KAAKrZ,KAAO,IAAMoa,GACxBl+B,EAAoB,GAApBA,CAAwBi+B,EAAW54B,EAAW,SAASU,WACrD,IAAIpB,EAAQy4B,EAAQ98B,KAAK0F,MAEzB,OAAOrB,GAAUA,EAAQW,EAAUhF,KAAK0F,MAAQk4B,KAO9C,SAAU/9B,EAAQD,EAASF,GAEjC,IAAIysB,EAAezsB,EAAoB,EAApBA,CAAuB,eACtC+Q,EAAQosB,KAAK37B,UAEXirB,KAAgB1b,GAAQ/Q,EAAoB,GAApBA,CAAwB+Q,EAAO0b,EAAczsB,EAAoB,OAKzF,SAAUG,EAAQD,EAASF,GAIjC,IAAIoE,EAAWpE,EAAoB,GAC/BsE,EAActE,EAAoB,IAGtCG,EAAOD,QAAU,SAAUi+B,GACzB,GAAa,WAATA,GAHO,WAGcA,GAA4B,YAATA,EAAoB,MAAMz6B,UAAU,kBAChF,OAAOY,EAAYF,EAAS4B,MAJjB,UAIwBm4B,KAM/B,SAAUh+B,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9ByK,EAASzK,EAAoB,IAC7BmP,EAASnP,EAAoB,IAC7BoE,EAAWpE,EAAoB,GAC/B+K,EAAkB/K,EAAoB,IACtCoI,EAAWpI,EAAoB,GAC/BwD,EAAWxD,EAAoB,GAC/BwM,EAAcxM,EAAoB,GAAGwM,YACrCjB,EAAqBvL,EAAoB,IACzCuM,EAAe4C,EAAO3C,YACtBC,EAAY0C,EAAOzC,SACnB0xB,EAAU3zB,EAAOqJ,KAAOtH,EAAY6xB,OACpC9rB,EAAShG,EAAa/K,UAAUoG,MAChCiH,EAAOpE,EAAOoE,KACd3C,EAAe,cAEnBhK,EAAQA,EAAQU,EAAIV,EAAQoB,EAAIpB,EAAQQ,GAAK8J,IAAgBD,GAAe,CAAEC,YAAaD,IAE3FrK,EAAQA,EAAQgB,EAAIhB,EAAQQ,GAAK+H,EAAOiE,OAAQxC,EAAc,CAE5DmyB,OAAQ,SAASA,OAAO56B,GACtB,OAAO26B,GAAWA,EAAQ36B,IAAOD,EAASC,IAAOoL,KAAQpL,KAI7DvB,EAAQA,EAAQY,EAAIZ,EAAQmB,EAAInB,EAAQQ,EAAI1C,EAAoB,EAApBA,CAAuB,WACjE,OAAQ,IAAIuM,EAAa,GAAG3E,MAAM,EAAG/H,IAAWoU,aAC9C/H,EAAc,CAEhBtE,MAAO,SAASA,MAAMqJ,EAAOmB,GAC3B,GAAIG,IAAW1S,IAAauS,IAAQvS,GAAW,OAAO0S,EAAOjS,KAAK8D,EAAS4B,MAAOiL,GAQlF,IAPA,IAAIyB,EAAMtO,EAAS4B,MAAMiO,WACrB4b,EAAQ9kB,EAAgBkG,EAAOyB,GAC/B4rB,EAAMvzB,EAAgBqH,IAAQvS,GAAY6S,EAAMN,EAAKM,GACrDvJ,EAAS,IAAKoC,EAAmBvF,KAAMuG,GAA9B,CAA6CnE,EAASk2B,EAAMzO,IACrE0O,EAAQ,IAAI9xB,EAAUzG,MACtBw4B,EAAQ,IAAI/xB,EAAUtD,GACtBD,EAAQ,EACL2mB,EAAQyO,GACbE,EAAMxZ,SAAS9b,IAASq1B,EAAMrZ,SAAS2K,MACvC,OAAO1mB,KAIbnJ,EAAoB,GAApBA,CAAwBkM,IAKlB,SAAU/L,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAClCkC,EAAQA,EAAQU,EAAIV,EAAQoB,EAAIpB,EAAQQ,GAAK1C,EAAoB,IAAI8T,IAAK,CACxEpH,SAAU1M,EAAoB,IAAI0M,YAM9B,SAAUvM,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,OAAQ,EAAG,SAAUy+B,GAC3C,OAAO,SAASC,UAAU/qB,EAAMrB,EAAYjL,GAC1C,OAAOo3B,EAAKz4B,KAAM2N,EAAMrB,EAAYjL,OAOlC,SAAUlH,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,QAAS,EAAG,SAAUy+B,GAC5C,OAAO,SAASxyB,WAAW0H,EAAMrB,EAAYjL,GAC3C,OAAOo3B,EAAKz4B,KAAM2N,EAAMrB,EAAYjL,OAOlC,SAAUlH,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,QAAS,EAAG,SAAUy+B,GAC5C,OAAO,SAASE,kBAAkBhrB,EAAMrB,EAAYjL,GAClD,OAAOo3B,EAAKz4B,KAAM2N,EAAMrB,EAAYjL,MAErC,IAKG,SAAUlH,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,QAAS,EAAG,SAAUy+B,GAC5C,OAAO,SAASG,WAAWjrB,EAAMrB,EAAYjL,GAC3C,OAAOo3B,EAAKz4B,KAAM2N,EAAMrB,EAAYjL,OAOlC,SAAUlH,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,SAAU,EAAG,SAAUy+B,GAC7C,OAAO,SAASvvB,YAAYyE,EAAMrB,EAAYjL,GAC5C,OAAOo3B,EAAKz4B,KAAM2N,EAAMrB,EAAYjL,OAOlC,SAAUlH,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,QAAS,EAAG,SAAUy+B,GAC5C,OAAO,SAASI,WAAWlrB,EAAMrB,EAAYjL,GAC3C,OAAOo3B,EAAKz4B,KAAM2N,EAAMrB,EAAYjL,OAOlC,SAAUlH,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,SAAU,EAAG,SAAUy+B,GAC7C,OAAO,SAASK,YAAYnrB,EAAMrB,EAAYjL,GAC5C,OAAOo3B,EAAKz4B,KAAM2N,EAAMrB,EAAYjL,OAOlC,SAAUlH,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,UAAW,EAAG,SAAUy+B,GAC9C,OAAO,SAASM,aAAaprB,EAAMrB,EAAYjL,GAC7C,OAAOo3B,EAAKz4B,KAAM2N,EAAMrB,EAAYjL,OAOlC,SAAUlH,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,UAAW,EAAG,SAAUy+B,GAC9C,OAAO,SAASO,aAAarrB,EAAMrB,EAAYjL,GAC7C,OAAOo3B,EAAKz4B,KAAM2N,EAAMrB,EAAYjL,OAOlC,SAAUlH,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9Bi/B,EAAYj/B,EAAoB,GAApBA,EAAwB,GAExCkC,EAAQA,EAAQY,EAAG,QAAS,CAC1B6O,SAAU,SAASA,SAAS0G,GAC1B,OAAO4mB,EAAUj5B,KAAMqS,EAAuB,EAAnB1Q,UAAUN,OAAaM,UAAU,GAAK9H,OAIrEG,EAAoB,GAApBA,CAAwB,aAKlB,SAAUG,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BiqB,EAAmBjqB,EAAoB,KACvCqG,EAAWrG,EAAoB,GAC/BoI,EAAWpI,EAAoB,GAC/BsH,EAAYtH,EAAoB,IAChCk/B,EAAqBl/B,EAAoB,IAE7CkC,EAAQA,EAAQY,EAAG,QAAS,CAC1Bq8B,QAAS,SAASA,QAAQn2B,GACxB,IACIkhB,EAAWhO,EADXzX,EAAI4B,EAASL,MAMjB,OAJAsB,EAAU0B,GACVkhB,EAAY9hB,EAAS3D,EAAE4C,QACvB6U,EAAIgjB,EAAmBz6B,EAAG,GAC1BwlB,EAAiB/N,EAAGzX,EAAGA,EAAGylB,EAAW,EAAG,EAAGlhB,EAAYrB,UAAU,IAC1DuU,KAIXlc,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BiqB,EAAmBjqB,EAAoB,KACvCqG,EAAWrG,EAAoB,GAC/BoI,EAAWpI,EAAoB,GAC/B6E,EAAY7E,EAAoB,IAChCk/B,EAAqBl/B,EAAoB,IAE7CkC,EAAQA,EAAQY,EAAG,QAAS,CAC1Bs8B,QAAS,SAASA,UAChB,IAAIC,EAAW13B,UAAU,GACrBlD,EAAI4B,EAASL,MACbkkB,EAAY9hB,EAAS3D,EAAE4C,QACvB6U,EAAIgjB,EAAmBz6B,EAAG,GAE9B,OADAwlB,EAAiB/N,EAAGzX,EAAGA,EAAGylB,EAAW,EAAGmV,IAAax/B,GAAY,EAAIgF,EAAUw6B,IACxEnjB,KAIXlc,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B0zB,EAAM1zB,EAAoB,GAApBA,EAAwB,GAElCkC,EAAQA,EAAQY,EAAG,SAAU,CAC3Bw8B,GAAI,SAASA,GAAGphB,GACd,OAAOwV,EAAI1tB,KAAMkY,OAOf,SAAU/d,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9Bu/B,EAAOv/B,EAAoB,KAC3B4a,EAAY5a,EAAoB,IAGpCkC,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAI,oCAAoCyE,KAAKyT,GAAY,SAAU,CAC7F4kB,SAAU,SAASA,SAAS9U,GAC1B,OAAO6U,EAAKv5B,KAAM0kB,EAA8B,EAAnB/iB,UAAUN,OAAaM,UAAU,GAAK9H,IAAW,OAO5E,SAAUM,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9Bu/B,EAAOv/B,EAAoB,KAC3B4a,EAAY5a,EAAoB,IAGpCkC,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAI,oCAAoCyE,KAAKyT,GAAY,SAAU,CAC7F6kB,OAAQ,SAASA,OAAO/U,GACtB,OAAO6U,EAAKv5B,KAAM0kB,EAA8B,EAAnB/iB,UAAUN,OAAaM,UAAU,GAAK9H,IAAW,OAO5E,SAAUM,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,WAAY,SAAUgnB,GAC5C,OAAO,SAAS0Y,WACd,OAAO1Y,EAAMhhB,KAAM,KAEpB,cAKG,SAAU7F,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,YAAa,SAAUgnB,GAC7C,OAAO,SAAS2Y,YACd,OAAO3Y,EAAMhhB,KAAM,KAEpB,YAKG,SAAU7F,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B+E,EAAU/E,EAAoB,IAC9BoI,EAAWpI,EAAoB,GAC/B0Y,EAAW1Y,EAAoB,IAC/B4/B,EAAW5/B,EAAoB,IAC/B6/B,EAAcroB,OAAOhW,UAErBs+B,EAAwB,SAAU/I,EAAQlwB,GAC5Cb,KAAK+5B,GAAKhJ,EACV/wB,KAAK4zB,GAAK/yB,GAGZ7G,EAAoB,GAApBA,CAAwB8/B,EAAuB,gBAAiB,SAASrvB,OACvE,IAAIye,EAAQlpB,KAAK+5B,GAAGj8B,KAAKkC,KAAK4zB,IAC9B,MAAO,CAAEj1B,MAAOuqB,EAAOxe,KAAgB,OAAVwe,KAG/BhtB,EAAQA,EAAQY,EAAG,SAAU,CAC3Bk9B,SAAU,SAASA,SAASjJ,GAE1B,GADAhyB,EAAQiB,OACH0S,EAASqe,GAAS,MAAMrzB,UAAUqzB,EAAS,qBAChD,IAAI7zB,EAAI4C,OAAOE,MACXmiB,EAAQ,UAAW0X,EAAc/5B,OAAOixB,EAAO5O,OAASyX,EAASt/B,KAAKy2B,GACtEkJ,EAAK,IAAIzoB,OAAOuf,EAAO30B,QAAS+lB,EAAM1W,QAAQ,KAAO0W,EAAQ,IAAMA,GAEvE,OADA8X,EAAGjI,UAAY5vB,EAAS2uB,EAAOiB,WACxB,IAAI8H,EAAsBG,EAAI/8B,OAOnC,SAAU/C,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,kBAKlB,SAAUG,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,eAKlB,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BwiB,EAAUxiB,EAAoB,IAC9BkG,EAAYlG,EAAoB,IAChCmG,EAAOnG,EAAoB,IAC3Bu1B,EAAiBv1B,EAAoB,IAEzCkC,EAAQA,EAAQgB,EAAG,SAAU,CAC3Bg9B,0BAA2B,SAASA,0BAA0B5+B,GAO5D,IANA,IAKIe,EAAK0Q,EALLtO,EAAIyB,EAAU5E,GACd6+B,EAAUh6B,EAAK3B,EACf+E,EAAOiZ,EAAQ/d,GACf0E,EAAS,GACT/I,EAAI,EAEaA,EAAdmJ,EAAKlC,SACV0L,EAAOotB,EAAQ17B,EAAGpC,EAAMkH,EAAKnJ,SAChBP,IAAW01B,EAAepsB,EAAQ9G,EAAK0Q,GAEtD,OAAO5J,MAOL,SAAUhJ,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BogC,EAAUpgC,EAAoB,IAApBA,EAAyB,GAEvCkC,EAAQA,EAAQgB,EAAG,SAAU,CAC3BkK,OAAQ,SAASA,OAAO3J,GACtB,OAAO28B,EAAQ38B,OAOb,SAAUtD,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B2Z,EAAW3Z,EAAoB,IAApBA,EAAyB,GAExCkC,EAAQA,EAAQgB,EAAG,SAAU,CAC3BqK,QAAS,SAASA,QAAQ9J,GACxB,OAAOkW,EAASlW,OAOd,SAAUtD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BqG,EAAWrG,EAAoB,GAC/BsH,EAAYtH,EAAoB,IAChCse,EAAkBte,EAAoB,GAG1CA,EAAoB,IAAMkC,EAAQA,EAAQY,EAAI9C,EAAoB,IAAK,SAAU,CAC/EqgC,iBAAkB,SAASA,iBAAiBv9B,EAAGnC,GAC7C2d,EAAgB9Z,EAAE6B,EAASL,MAAOlD,EAAG,CAAE7B,IAAKqG,EAAU3G,GAASK,YAAY,EAAMD,cAAc,QAO7F,SAAUZ,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BqG,EAAWrG,EAAoB,GAC/BsH,EAAYtH,EAAoB,IAChCse,EAAkBte,EAAoB,GAG1CA,EAAoB,IAAMkC,EAAQA,EAAQY,EAAI9C,EAAoB,IAAK,SAAU,CAC/Egc,iBAAkB,SAASA,iBAAiBlZ,EAAGiqB,GAC7CzO,EAAgB9Z,EAAE6B,EAASL,MAAOlD,EAAG,CAAEuM,IAAK/H,EAAUylB,GAAS/rB,YAAY,EAAMD,cAAc,QAO7F,SAAUZ,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BqG,EAAWrG,EAAoB,GAC/BsE,EAActE,EAAoB,IAClCwG,EAAiBxG,EAAoB,IACrCoG,EAA2BpG,EAAoB,IAAIwE,EAGvDxE,EAAoB,IAAMkC,EAAQA,EAAQY,EAAI9C,EAAoB,IAAK,SAAU,CAC/EsgC,iBAAkB,SAASA,iBAAiBx9B,GAC1C,IAEI4X,EAFAjW,EAAI4B,EAASL,MACb+V,EAAIzX,EAAYxB,GAAG,GAEvB,GACE,GAAI4X,EAAItU,EAAyB3B,EAAGsX,GAAI,OAAOrB,EAAEzZ,UAC1CwD,EAAI+B,EAAe/B,QAO1B,SAAUtE,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BqG,EAAWrG,EAAoB,GAC/BsE,EAActE,EAAoB,IAClCwG,EAAiBxG,EAAoB,IACrCoG,EAA2BpG,EAAoB,IAAIwE,EAGvDxE,EAAoB,IAAMkC,EAAQA,EAAQY,EAAI9C,EAAoB,IAAK,SAAU,CAC/EugC,iBAAkB,SAASA,iBAAiBz9B,GAC1C,IAEI4X,EAFAjW,EAAI4B,EAASL,MACb+V,EAAIzX,EAAYxB,GAAG,GAEvB,GACE,GAAI4X,EAAItU,EAAyB3B,EAAGsX,GAAI,OAAOrB,EAAErL,UAC1C5K,EAAI+B,EAAe/B,QAO1B,SAAUtE,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQY,EAAIZ,EAAQqB,EAAG,MAAO,CAAE4nB,OAAQnrB,EAAoB,IAApBA,CAAyB,UAKnE,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQY,EAAIZ,EAAQqB,EAAG,MAAO,CAAE4nB,OAAQnrB,EAAoB,IAApBA,CAAyB,UAKnE,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,QAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,QAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,QAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,QAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQU,EAAG,CAAEhB,OAAQ5B,EAAoB,MAK3C,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,SAAU,CAAEtB,OAAQ5B,EAAoB,MAKrD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B0W,EAAM1W,EAAoB,IAE9BkC,EAAQA,EAAQgB,EAAG,QAAS,CAC1Bs9B,QAAS,SAASA,QAAQ/8B,GACxB,MAAmB,UAAZiT,EAAIjT,OAOT,SAAUtD,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CACzBu9B,MAAO,SAASA,MAAM1iB,EAAG2iB,EAAOC,GAC9B,OAAO/8B,KAAKkB,IAAI67B,EAAO/8B,KAAK2S,IAAImqB,EAAO3iB,QAOrC,SAAU5d,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CAAE09B,YAAah9B,KAAKi9B,GAAK,OAK9C,SAAU1gC,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B8gC,EAAc,IAAMl9B,KAAKi9B,GAE7B3+B,EAAQA,EAAQgB,EAAG,OAAQ,CACzB69B,QAAS,SAASA,QAAQC,GACxB,OAAOA,EAAUF,MAOf,SAAU3gC,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BorB,EAAQprB,EAAoB,KAC5B2nB,EAAS3nB,EAAoB,KAEjCkC,EAAQA,EAAQgB,EAAG,OAAQ,CACzB+9B,OAAQ,SAASA,OAAOljB,EAAGsN,EAAOC,EAAQC,EAAQC,GAChD,OAAO7D,EAAOyD,EAAMrN,EAAGsN,EAAOC,EAAQC,EAAQC,QAO5C,SAAUrrB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CACzBg+B,MAAO,SAASA,MAAMC,EAAIC,EAAIC,EAAIC,GAChC,IAAIC,EAAMJ,IAAO,EAEbK,EAAMH,IAAO,EACjB,OAFUD,IAAO,IAEHE,IAAO,KAAOC,EAAMC,GAAOD,EAAMC,KAASD,EAAMC,IAAQ,MAAQ,IAAM,MAOlF,SAAUrhC,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CACzBu+B,MAAO,SAASA,MAAMN,EAAIC,EAAIC,EAAIC,GAChC,IAAIC,EAAMJ,IAAO,EAEbK,EAAMH,IAAO,EACjB,OAFUD,IAAO,IAEHE,IAAO,MAAQC,EAAMC,IAAQD,EAAMC,GAAOD,EAAMC,IAAQ,KAAO,IAAM,MAOjF,SAAUrhC,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CACzBw+B,MAAO,SAASA,MAAMC,EAAG/tB,GACvB,IACIguB,GAAMD,EACNE,GAAMjuB,EACNkuB,EAHS,MAGJF,EACLG,EAJS,MAIJF,EACLG,EAAKJ,GAAM,GACXK,EAAKJ,GAAM,GACXpR,GAAKuR,EAAKD,IAAO,IAAMD,EAAKC,IAAO,IACvC,OAAOC,EAAKC,GAAMxR,GAAK,MAAQqR,EAAKG,IAAO,IAR9B,MAQoCxR,IAAe,QAO9D,SAAUtwB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CAAE49B,YAAa,IAAMl9B,KAAKi9B,MAK/C,SAAU1gC,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B4gC,EAAch9B,KAAKi9B,GAAK,IAE5B3+B,EAAQA,EAAQgB,EAAG,OAAQ,CACzB89B,QAAS,SAASA,QAAQD,GACxB,OAAOA,EAAUH,MAOf,SAAUzgC,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CAAEkoB,MAAOprB,EAAoB,QAKlD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CACzBg/B,MAAO,SAASA,MAAMP,EAAG/tB,GACvB,IACIguB,GAAMD,EACNE,GAAMjuB,EACNkuB,EAHS,MAGJF,EACLG,EAJS,MAIJF,EACLG,EAAKJ,IAAO,GACZK,EAAKJ,IAAO,GACZpR,GAAKuR,EAAKD,IAAO,IAAMD,EAAKC,IAAO,IACvC,OAAOC,EAAKC,GAAMxR,IAAM,MAAQqR,EAAKG,IAAO,IAR/B,MAQqCxR,KAAgB,QAOhE,SAAUtwB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAG,OAAQ,CAAEi/B,QAAS,SAASA,QAAQpkB,GAErD,OAAQA,GAAKA,IAAMA,EAAIA,EAAS,GAALA,EAAS,EAAIA,GAAKF,SAAe,EAAJE,MAMpD,SAAU5d,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B6B,EAAO7B,EAAoB,IAC3B4B,EAAS5B,EAAoB,GAC7BuL,EAAqBvL,EAAoB,IACzC64B,EAAiB74B,EAAoB,KAEzCkC,EAAQA,EAAQY,EAAIZ,EAAQqB,EAAG,UAAW,CAAE6+B,UAAW,SAAUC,GAC/D,IAAI3yB,EAAInE,EAAmBvF,KAAMnE,EAAKkf,SAAWnf,EAAOmf,SACpDnb,EAAiC,mBAAby8B,EACxB,OAAOr8B,KAAK4b,KACVhc,EAAa,SAAUmY,GACrB,OAAO8a,EAAenpB,EAAG2yB,KAAazgB,KAAK,WAAc,OAAO7D,KAC9DskB,EACJz8B,EAAa,SAAU7B,GACrB,OAAO80B,EAAenpB,EAAG2yB,KAAazgB,KAAK,WAAc,MAAM7d,KAC7Ds+B,OAOF,SAAUliC,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BooB,EAAuBpoB,EAAoB,IAC3C44B,EAAU54B,EAAoB,KAElCkC,EAAQA,EAAQgB,EAAG,UAAW,CAAEo/B,MAAO,SAAUt5B,GAC/C,IAAIqf,EAAoBD,EAAqB5jB,EAAEwB,MAC3CmD,EAASyvB,EAAQ5vB,GAErB,OADCG,EAAOpF,EAAIskB,EAAkBjG,OAASiG,EAAkB3G,SAASvY,EAAOyK,GAClEyU,EAAkB1G,YAMrB,SAAUxhB,EAAQD,EAASF,GAEjC,IAAIuiC,EAAWviC,EAAoB,IAC/BoE,EAAWpE,EAAoB,GAC/BwiC,EAAYD,EAASlgC,IACrBogC,EAA4BF,EAASlzB,IAEzCkzB,EAAS//B,IAAI,CAAEkgC,eAAgB,SAASA,eAAeC,EAAaC,EAAe3/B,EAAQ2R,GACzF6tB,EAA0BE,EAAaC,EAAex+B,EAASnB,GAASu/B,EAAU5tB,QAM9E,SAAUzU,EAAQD,EAASF,GAEjC,IAAIuiC,EAAWviC,EAAoB,IAC/BoE,EAAWpE,EAAoB,GAC/BwiC,EAAYD,EAASlgC,IACrBsS,EAAyB4tB,EAAS1wB,IAClC7N,EAAQu+B,EAASv+B,MAErBu+B,EAAS//B,IAAI,CAAEqgC,eAAgB,SAASA,eAAeF,EAAa1/B,GAClE,IAAI2R,EAAYjN,UAAUN,OAAS,EAAIxH,GAAY2iC,EAAU76B,UAAU,IACnEqN,EAAcL,EAAuBvQ,EAASnB,GAAS2R,GAAW,GACtE,GAAII,IAAgBnV,KAAcmV,EAAoB,UAAE2tB,GAAc,OAAO,EAC7E,GAAI3tB,EAAY+f,KAAM,OAAO,EAC7B,IAAIlgB,EAAiB7Q,EAAM/C,IAAIgC,GAE/B,OADA4R,EAAuB,UAAED,KAChBC,EAAekgB,MAAQ/wB,EAAc,UAAEf,OAM5C,SAAU9C,EAAQD,EAASF,GAEjC,IAAIuiC,EAAWviC,EAAoB,IAC/BoE,EAAWpE,EAAoB,GAC/BwG,EAAiBxG,EAAoB,IACrC8iC,EAAyBP,EAASp9B,IAClC49B,EAAyBR,EAASthC,IAClCuhC,EAAYD,EAASlgC,IAErB2gC,EAAsB,SAAUjuB,EAAatQ,EAAG3B,GAElD,GADaggC,EAAuB/tB,EAAatQ,EAAG3B,GACxC,OAAOigC,EAAuBhuB,EAAatQ,EAAG3B,GAC1D,IAAIue,EAAS7a,EAAe/B,GAC5B,OAAkB,OAAX4c,EAAkB2hB,EAAoBjuB,EAAasM,EAAQve,GAAKjD,IAGzE0iC,EAAS//B,IAAI,CAAEygC,YAAa,SAASA,YAAYN,EAAa1/B,GAC5D,OAAO+/B,EAAoBL,EAAav+B,EAASnB,GAAS0E,UAAUN,OAAS,EAAIxH,GAAY2iC,EAAU76B,UAAU,SAM7G,SAAUxH,EAAQD,EAASF,GAEjC,IAAIgpB,EAAMhpB,EAAoB,KAC1BkQ,EAAOlQ,EAAoB,KAC3BuiC,EAAWviC,EAAoB,IAC/BoE,EAAWpE,EAAoB,GAC/BwG,EAAiBxG,EAAoB,IACrCkjC,EAA0BX,EAASh5B,KACnCi5B,EAAYD,EAASlgC,IAErB8gC,EAAuB,SAAU1+B,EAAG3B,GACtC,IAAIsgC,EAAQF,EAAwBz+B,EAAG3B,GACnCue,EAAS7a,EAAe/B,GAC5B,GAAe,OAAX4c,EAAiB,OAAO+hB,EAC5B,IAAIC,EAAQF,EAAqB9hB,EAAQve,GACzC,OAAOugC,EAAMh8B,OAAS+7B,EAAM/7B,OAAS6I,EAAK,IAAI8Y,EAAIoa,EAAM/uB,OAAOgvB,KAAWA,EAAQD,GAGpFb,EAAS//B,IAAI,CAAE8gC,gBAAiB,SAASA,gBAAgBrgC,GACvD,OAAOkgC,EAAqB/+B,EAASnB,GAAS0E,UAAUN,OAAS,EAAIxH,GAAY2iC,EAAU76B,UAAU,SAMjG,SAAUxH,EAAQD,EAASF,GAEjC,IAAIuiC,EAAWviC,EAAoB,IAC/BoE,EAAWpE,EAAoB,GAC/B+iC,EAAyBR,EAASthC,IAClCuhC,EAAYD,EAASlgC,IAEzBkgC,EAAS//B,IAAI,CAAE+gC,eAAgB,SAASA,eAAeZ,EAAa1/B,GAClE,OAAO8/B,EAAuBJ,EAAav+B,EAASnB,GAChD0E,UAAUN,OAAS,EAAIxH,GAAY2iC,EAAU76B,UAAU,SAMvD,SAAUxH,EAAQD,EAASF,GAEjC,IAAIuiC,EAAWviC,EAAoB,IAC/BoE,EAAWpE,EAAoB,GAC/BkjC,EAA0BX,EAASh5B,KACnCi5B,EAAYD,EAASlgC,IAEzBkgC,EAAS//B,IAAI,CAAEghC,mBAAoB,SAASA,mBAAmBvgC,GAC7D,OAAOigC,EAAwB9+B,EAASnB,GAAS0E,UAAUN,OAAS,EAAIxH,GAAY2iC,EAAU76B,UAAU,SAMpG,SAAUxH,EAAQD,EAASF,GAEjC,IAAIuiC,EAAWviC,EAAoB,IAC/BoE,EAAWpE,EAAoB,GAC/BwG,EAAiBxG,EAAoB,IACrC8iC,EAAyBP,EAASp9B,IAClCq9B,EAAYD,EAASlgC,IAErBohC,EAAsB,SAAU1uB,EAAatQ,EAAG3B,GAElD,GADaggC,EAAuB/tB,EAAatQ,EAAG3B,GACxC,OAAO,EACnB,IAAIue,EAAS7a,EAAe/B,GAC5B,OAAkB,OAAX4c,GAAkBoiB,EAAoB1uB,EAAasM,EAAQve,IAGpEy/B,EAAS//B,IAAI,CAAEkhC,YAAa,SAASA,YAAYf,EAAa1/B,GAC5D,OAAOwgC,EAAoBd,EAAav+B,EAASnB,GAAS0E,UAAUN,OAAS,EAAIxH,GAAY2iC,EAAU76B,UAAU,SAM7G,SAAUxH,EAAQD,EAASF,GAEjC,IAAIuiC,EAAWviC,EAAoB,IAC/BoE,EAAWpE,EAAoB,GAC/B8iC,EAAyBP,EAASp9B,IAClCq9B,EAAYD,EAASlgC,IAEzBkgC,EAAS//B,IAAI,CAAEmhC,eAAgB,SAASA,eAAehB,EAAa1/B,GAClE,OAAO6/B,EAAuBH,EAAav+B,EAASnB,GAChD0E,UAAUN,OAAS,EAAIxH,GAAY2iC,EAAU76B,UAAU,SAMvD,SAAUxH,EAAQD,EAASF,GAEjC,IAAI4jC,EAAY5jC,EAAoB,IAChCoE,EAAWpE,EAAoB,GAC/BsH,EAAYtH,EAAoB,IAChCwiC,EAAYoB,EAAUvhC,IACtBogC,EAA4BmB,EAAUv0B,IAE1Cu0B,EAAUphC,IAAI,CAAE+/B,SAAU,SAASA,SAASI,EAAaC,GACvD,OAAO,SAASiB,UAAU5gC,EAAQ2R,GAChC6tB,EACEE,EAAaC,GACZhuB,IAAc/U,GAAYuE,EAAWkD,GAAWrE,GACjDu/B,EAAU5tB,SAQV,SAAUzU,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B04B,EAAY14B,EAAoB,GAApBA,GACZof,EAAUpf,EAAoB,GAAGof,QACjC4B,EAA6C,WAApChhB,EAAoB,GAApBA,CAAwBof,GAErCld,EAAQA,EAAQU,EAAG,CACjBkhC,KAAM,SAASA,KAAKv8B,GAClB,IAAI+Z,EAASN,GAAU5B,EAAQkC,OAC/BoX,EAAUpX,EAASA,EAAOiF,KAAKhf,GAAMA,OAOnC,SAAUpH,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B4B,EAAS5B,EAAoB,GAC7B6B,EAAO7B,EAAoB,IAC3B04B,EAAY14B,EAAoB,GAApBA,GACZ+jC,EAAa/jC,EAAoB,EAApBA,CAAuB,cACpCsH,EAAYtH,EAAoB,IAChCoE,EAAWpE,EAAoB,GAC/B2K,EAAa3K,EAAoB,IACjC6K,EAAc7K,EAAoB,IAClC8B,EAAO9B,EAAoB,IAC3B6a,EAAQ7a,EAAoB,IAC5BmW,EAAS0E,EAAM1E,OAEfkD,EAAY,SAAU9R,GACxB,OAAa,MAANA,EAAa1H,GAAYyH,EAAUC,IAGxCy8B,EAAsB,SAAUC,GAClC,IAAIC,EAAUD,EAAaxK,GACvByK,IACFD,EAAaxK,GAAK55B,GAClBqkC,MAIAC,EAAqB,SAAUF,GACjC,OAAOA,EAAaG,KAAOvkC,IAGzBwkC,EAAoB,SAAUJ,GAC3BE,EAAmBF,KACtBA,EAAaG,GAAKvkC,GAClBmkC,EAAoBC,KAIpBK,EAAe,SAAUC,EAAUC,GACrCpgC,EAASmgC,GACTv+B,KAAKyzB,GAAK55B,GACVmG,KAAKo+B,GAAKG,EACVA,EAAW,IAAIE,EAAqBz+B,MACpC,IACE,IAAIk+B,EAAUM,EAAWD,GACrBN,EAAeC,EACJ,MAAXA,IACiC,mBAAxBA,EAAQQ,YAA4BR,EAAU,WAAcD,EAAaS,eAC/Ep9B,EAAU48B,GACfl+B,KAAKyzB,GAAKyK,GAEZ,MAAOngC,GAEP,YADAwgC,EAAS7J,MAAM32B,GAEXogC,EAAmBn+B,OAAOg+B,EAAoBh+B,OAGtDs+B,EAAa9iC,UAAYqJ,EAAY,GAAI,CACvC65B,YAAa,SAASA,cAAgBL,EAAkBr+B,SAG1D,IAAIy+B,EAAuB,SAAUR,GACnCj+B,KAAK4zB,GAAKqK,GAGZQ,EAAqBjjC,UAAYqJ,EAAY,GAAI,CAC/C4F,KAAM,SAASA,KAAK9L,GAClB,IAAIs/B,EAAej+B,KAAK4zB,GACxB,IAAKuK,EAAmBF,GAAe,CACrC,IAAIM,EAAWN,EAAaG,GAC5B,IACE,IAAI7jC,EAAI8Y,EAAUkrB,EAAS9zB,MAC3B,GAAIlQ,EAAG,OAAOA,EAAED,KAAKikC,EAAU5/B,GAC/B,MAAOZ,GACP,IACEsgC,EAAkBJ,GAClB,QACA,MAAMlgC,MAKd22B,MAAO,SAASA,MAAM/1B,GACpB,IAAIs/B,EAAej+B,KAAK4zB,GACxB,GAAIuK,EAAmBF,GAAe,MAAMt/B,EAC5C,IAAI4/B,EAAWN,EAAaG,GAC5BH,EAAaG,GAAKvkC,GAClB,IACE,IAAIU,EAAI8Y,EAAUkrB,EAAS7J,OAC3B,IAAKn6B,EAAG,MAAMoE,EACdA,EAAQpE,EAAED,KAAKikC,EAAU5/B,GACzB,MAAOZ,GACP,IACEigC,EAAoBC,GACpB,QACA,MAAMlgC,GAGV,OADEigC,EAAoBC,GACft/B,GAETggC,SAAU,SAASA,SAAShgC,GAC1B,IAAIs/B,EAAej+B,KAAK4zB,GACxB,IAAKuK,EAAmBF,GAAe,CACrC,IAAIM,EAAWN,EAAaG,GAC5BH,EAAaG,GAAKvkC,GAClB,IACE,IAAIU,EAAI8Y,EAAUkrB,EAASI,UAC3BhgC,EAAQpE,EAAIA,EAAED,KAAKikC,EAAU5/B,GAAS9E,GACtC,MAAOkE,GACP,IACEigC,EAAoBC,GACpB,QACA,MAAMlgC,GAGV,OADEigC,EAAoBC,GACft/B,MAKb,IAAIigC,EAAc,SAASC,WAAWL,GACpC75B,EAAW3E,KAAM4+B,EAAa,aAAc,MAAMjc,GAAKrhB,EAAUk9B,IAGnE35B,EAAY+5B,EAAYpjC,UAAW,CACjCsjC,UAAW,SAASA,UAAUP,GAC5B,OAAO,IAAID,EAAaC,EAAUv+B,KAAK2iB,KAEzCnX,QAAS,SAASA,QAAQjK,GACxB,IAAIC,EAAOxB,KACX,OAAO,IAAKnE,EAAKkf,SAAWnf,EAAOmf,SAAS,SAAUW,EAASU,GAC7D9a,EAAUC,GACV,IAAI08B,EAAez8B,EAAKs9B,UAAU,CAChCr0B,KAAM,SAAU9L,GACd,IACE,OAAO4C,EAAG5C,GACV,MAAOZ,GACPqe,EAAOre,GACPkgC,EAAaS,gBAGjBhK,MAAOtY,EACPuiB,SAAUjjB,SAMlB7W,EAAY+5B,EAAa,CACvB10B,KAAM,SAASA,KAAK6N,GAClB,IAAIrO,EAAoB,mBAAT1J,KAAsBA,KAAO4+B,EACxC/8B,EAASwR,EAAUjV,EAAS2Z,GAAGgmB,IACnC,GAAIl8B,EAAQ,CACV,IAAIk9B,EAAa3gC,EAASyD,EAAOvH,KAAKyd,IACtC,OAAOgnB,EAAWt+B,cAAgBiJ,EAAIq1B,EAAa,IAAIr1B,EAAE,SAAU60B,GACjE,OAAOQ,EAAWD,UAAUP,KAGhC,OAAO,IAAI70B,EAAE,SAAU60B,GACrB,IAAI7zB,GAAO,EAeX,OAdAgoB,EAAU,WACR,IAAKhoB,EAAM,CACT,IACE,GAAImK,EAAMkD,GAAG,EAAO,SAAUta,GAE5B,GADA8gC,EAAS9zB,KAAKhN,GACViN,EAAM,OAAOyF,MACZA,EAAQ,OACf,MAAOpS,GACP,GAAI2M,EAAM,MAAM3M,EAEhB,YADAwgC,EAAS7J,MAAM32B,GAEfwgC,EAASI,cAGR,WAAcj0B,GAAO,MAGhCE,GAAI,SAASA,KACX,IAAK,IAAIxQ,EAAI,EAAGC,EAAIsH,UAAUN,OAAQ29B,EAAQ,IAAI14B,MAAMjM,GAAID,EAAIC,GAAI2kC,EAAM5kC,GAAKuH,UAAUvH,KACzF,OAAO,IAAqB,mBAAT4F,KAAsBA,KAAO4+B,GAAa,SAAUL,GACrE,IAAI7zB,GAAO,EASX,OARAgoB,EAAU,WACR,IAAKhoB,EAAM,CACT,IAAK,IAAIyM,EAAI,EAAGA,EAAI6nB,EAAM39B,SAAU8V,EAElC,GADAonB,EAAS9zB,KAAKu0B,EAAM7nB,IAChBzM,EAAM,OACV6zB,EAASI,cAGR,WAAcj0B,GAAO,QAKlC5O,EAAK8iC,EAAYpjC,UAAWuiC,EAAY,WAAc,OAAO/9B,OAE7D9D,EAAQA,EAAQU,EAAG,CAAEiiC,WAAYD,IAEjC5kC,EAAoB,GAApBA,CAAwB,eAKlB,SAAUG,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9BilC,EAAQjlC,EAAoB,IAChCkC,EAAQA,EAAQU,EAAIV,EAAQc,EAAG,CAC7Bsc,aAAc2lB,EAAM51B,IACpBmQ,eAAgBylB,EAAMvpB,SAMlB,SAAUvb,EAAQD,EAASF,GA+CjC,IA7CA,IAAI2S,EAAa3S,EAAoB,IACjC4c,EAAU5c,EAAoB,IAC9B+B,EAAW/B,EAAoB,IAC/B4B,EAAS5B,EAAoB,GAC7B8B,EAAO9B,EAAoB,IAC3ByL,EAAYzL,EAAoB,IAChCoL,EAAMpL,EAAoB,GAC1BqO,EAAWjD,EAAI,YACf85B,EAAgB95B,EAAI,eACpB+5B,EAAc15B,EAAUa,MAExB84B,EAAe,CACjBC,aAAa,EACbC,qBAAqB,EACrBC,cAAc,EACdC,gBAAgB,EAChBC,aAAa,EACbC,eAAe,EACfC,cAAc,EACdC,sBAAsB,EACtBC,UAAU,EACVC,mBAAmB,EACnBC,gBAAgB,EAChBC,iBAAiB,EACjBC,mBAAmB,EACnBC,WAAW,EACXC,eAAe,EACfC,cAAc,EACdC,UAAU,EACVC,kBAAkB,EAClBC,QAAQ,EACRC,aAAa,EACbC,eAAe,EACfC,eAAe,EACfC,gBAAgB,EAChBC,cAAc,EACdC,eAAe,EACfC,kBAAkB,EAClBC,kBAAkB,EAClBC,gBAAgB,EAChBC,kBAAkB,EAClBC,eAAe,EACfC,WAAW,GAGJC,EAAcxqB,EAAQwoB,GAAehlC,EAAI,EAAGA,EAAIgnC,EAAY//B,OAAQjH,IAAK,CAChF,IAIIiC,EAJA6E,EAAOkgC,EAAYhnC,GACnBinC,EAAWjC,EAAal+B,GACxBogC,EAAa1lC,EAAOsF,GACpB6J,EAAQu2B,GAAcA,EAAW9lC,UAErC,GAAIuP,IACGA,EAAM1C,IAAWvM,EAAKiP,EAAO1C,EAAU82B,GACvCp0B,EAAMm0B,IAAgBpjC,EAAKiP,EAAOm0B,EAAeh+B,GACtDuE,EAAUvE,GAAQi+B,EACdkC,GAAU,IAAKhlC,KAAOsQ,EAAiB5B,EAAM1O,IAAMN,EAASgP,EAAO1O,EAAKsQ,EAAWtQ,IAAM,KAO3F,SAAUlC,EAAQD,EAASF,GAGjC,IAAI4B,EAAS5B,EAAoB,GAC7BkC,EAAUlC,EAAoB,GAC9B4a,EAAY5a,EAAoB,IAChC4H,EAAQ,GAAGA,MACX2/B,EAAO,WAAWpgC,KAAKyT,GACvBuS,EAAO,SAAU9d,GACnB,OAAO,SAAU9H,EAAIigC,GACnB,IAAIC,EAA+B,EAAnB9/B,UAAUN,OACtBmW,IAAOiqB,GAAY7/B,EAAMtH,KAAKqH,UAAW,GAC7C,OAAO0H,EAAIo4B,EAAY,YAEP,mBAANlgC,EAAmBA,EAAKnE,SAASmE,IAAKG,MAAM1B,KAAMwX,IACxDjW,EAAIigC,KAGZtlC,EAAQA,EAAQU,EAAIV,EAAQc,EAAId,EAAQQ,EAAI6kC,EAAM,CAChD7mB,WAAYyM,EAAKvrB,EAAO8e,YACxBgnB,YAAava,EAAKvrB,EAAO8lC,gBAMrB,SAAUvnC,EAAQD,EAASF,GAIjC,IAAIgC,EAAMhC,EAAoB,IAC1BkC,EAAUlC,EAAoB,GAC9BkF,EAAalF,EAAoB,IACjC+c,EAAS/c,EAAoB,IAC7B8I,EAAS9I,EAAoB,IAC7BwG,EAAiBxG,EAAoB,IACrC4c,EAAU5c,EAAoB,IAC9BuE,EAAKvE,EAAoB,GACzB2nC,EAAQ3nC,EAAoB,KAC5BsH,EAAYtH,EAAoB,IAChC6a,EAAQ7a,EAAoB,IAC5ByrB,EAAazrB,EAAoB,KACjC2Y,EAAc3Y,EAAoB,IAClCmQ,EAAOnQ,EAAoB,IAC3BwD,EAAWxD,EAAoB,GAC/BkG,EAAYlG,EAAoB,IAChC+W,EAAc/W,EAAoB,GAClCmF,EAAMnF,EAAoB,IAU1B4nC,EAAmB,SAAUt/B,GAC/B,IAAIE,EAAiB,GAARF,EACTK,EAAmB,GAARL,EACf,OAAO,SAAUhH,EAAQ0H,EAAYxB,GACnC,IAIInF,EAAKqD,EAAKuD,EAJVzE,EAAIxC,EAAIgH,EAAYxB,EAAM,GAC1B/C,EAAIyB,EAAU5E,GACd6H,EAASX,GAAkB,GAARF,GAAqB,GAARA,EAC5B,IAAoB,mBAARtC,KAAqBA,KAAO6hC,MAAUhoC,GAE1D,IAAKwC,KAAOoC,EAAG,GAAIU,EAAIV,EAAGpC,KAExB4G,EAAMzE,EADNkB,EAAMjB,EAAEpC,GACKA,EAAKf,GACdgH,GACF,GAAIE,EAAQW,EAAO9G,GAAO4G,OACrB,GAAIA,EAAK,OAAQX,GACpB,KAAK,EAAGa,EAAO9G,GAAOqD,EAAK,MAC3B,KAAK,EAAG,OAAO,EACf,KAAK,EAAG,OAAOA,EACf,KAAK,EAAG,OAAOrD,EACf,KAAK,EAAG8G,EAAOF,EAAI,IAAMA,EAAI,QACxB,GAAIN,EAAU,OAAO,EAGhC,OAAe,GAARL,GAAaK,EAAWA,EAAWQ,IAG1C2+B,EAAUF,EAAiB,GAE3BG,EAAiB,SAAUzuB,GAC7B,OAAO,SAAU7V,GACf,OAAO,IAAIukC,EAAavkC,EAAI6V,KAG5B0uB,EAAe,SAAUtpB,EAAUpF,GACrCtT,KAAK8R,GAAK5R,EAAUwY,GACpB1Y,KAAK20B,GAAK/d,EAAQ8B,GAClB1Y,KAAK2Y,GAAK,EACV3Y,KAAK4Y,GAAKtF,GAmBZ,SAASuuB,KAAKzxB,GACZ,IAAI6xB,EAAOn/B,EAAO,MAQlB,OAPIsN,GAAYvW,KACV4rB,EAAWrV,GACbyE,EAAMzE,GAAU,EAAM,SAAU/T,EAAKsC,GACnCsjC,EAAK5lC,GAAOsC,IAEToY,EAAOkrB,EAAM7xB,IAEf6xB,EA1BTtvB,EAAYqvB,EAAc,OAAQ,WAChC,IAII3lC,EAHAoC,EADOuB,KACE8R,GACTvO,EAFOvD,KAEK20B,GACZrhB,EAHOtT,KAGK4Y,GAEhB,GACE,GAAerV,EAAKlC,QANXrB,KAMA2Y,GAEP,OARO3Y,KAOF8R,GAAKjY,GACHsQ,EAAK,UAENhL,EAAIV,EAAGpC,EAAMkH,EAVZvD,KAUsB2Y,QACjC,OAA2BxO,EAAK,EAApB,QAARmJ,EAA+BjX,EACvB,UAARiX,EAAiC7U,EAAEpC,GACxB,CAACA,EAAKoC,EAAEpC,OAczBwlC,KAAKrmC,UAAY,KAwCjBU,EAAQA,EAAQU,EAAIV,EAAQQ,EAAG,CAAEmlC,KAAMA,OAEvC3lC,EAAQA,EAAQgB,EAAG,OAAQ,CACzBqG,KAAMw+B,EAAe,QACrB36B,OAAQ26B,EAAe,UACvBx6B,QAASw6B,EAAe,WACxBv2B,QAASo2B,EAAiB,GAC1B/1B,IAAK+1B,EAAiB,GACtBx2B,OAAQw2B,EAAiB,GACzB51B,KAAM41B,EAAiB,GACvB12B,MAAO02B,EAAiB,GACxBv2B,KAAMu2B,EAAiB,GACvBE,QAASA,EACTI,SAAUN,EAAiB,GAC3Bj6B,OApDF,SAASA,OAAOrM,EAAQgP,EAAOmuB,GAC7Bn3B,EAAUgJ,GACV,IAIIyX,EAAM1lB,EAJNoC,EAAIyB,EAAU5E,GACdiI,EAAOqT,EAAQnY,GACf4C,EAASkC,EAAKlC,OACdjH,EAAI,EAER,GAAIuH,UAAUN,OAAS,EAAG,CACxB,IAAKA,EAAQ,MAAM3D,UAAU,gDAC7BqkB,EAAOtjB,EAAE8E,EAAKnJ,WACT2nB,EAAOlnB,OAAO49B,GACrB,KAAgBr+B,EAATiH,GAAgBlC,EAAIV,EAAGpC,EAAMkH,EAAKnJ,QACvC2nB,EAAOzX,EAAMyX,EAAMtjB,EAAEpC,GAAMA,EAAKf,IAElC,OAAOymB,GAuCP4f,MAAOA,EACPh2B,SArCF,SAASA,SAASrQ,EAAQ+W,GAExB,OAAQA,GAAMA,EAAKsvB,EAAMrmC,EAAQ+W,GAAMyvB,EAAQxmC,EAAQ,SAAUmC,GAE/D,OAAOA,GAAMA,OACP5D,IAiCRsF,IAAKA,EACLlE,IA/BF,SAASA,IAAIK,EAAQe,GACnB,GAAI8C,EAAI7D,EAAQe,GAAM,OAAOf,EAAOe,IA+BpCgN,IA7BF,SAASA,IAAI/N,EAAQe,EAAKsC,GAGxB,OAFIoS,GAAe1U,KAAOxB,OAAQ0D,EAAGC,EAAElD,EAAQe,EAAK6C,EAAW,EAAGP,IAC7DrD,EAAOe,GAAOsC,EACZrD,GA2BP6mC,OAxBF,SAASA,OAAO1kC,GACd,OAAOD,EAASC,IAAO+C,EAAe/C,KAAQokC,KAAKrmC,cA6B/C,SAAUrB,EAAQD,EAASF,GAEjC,IAAI4c,EAAU5c,EAAoB,IAC9BkG,EAAYlG,EAAoB,IACpCG,EAAOD,QAAU,SAAUoB,EAAQ+W,GAMjC,IALA,IAIIhW,EAJAoC,EAAIyB,EAAU5E,GACdiI,EAAOqT,EAAQnY,GACf4C,EAASkC,EAAKlC,OACd6B,EAAQ,EAEIA,EAAT7B,GAAgB,GAAI5C,EAAEpC,EAAMkH,EAAKL,QAAcmP,EAAI,OAAOhW,IAM7D,SAAUlC,EAAQD,EAASF,GAEjC,IAAIoE,EAAWpE,EAAoB,GAC/BiB,EAAMjB,EAAoB,IAC9BG,EAAOD,QAAUF,EAAoB,IAAIooC,YAAc,SAAU3kC,GAC/D,IAAI+M,EAASvP,EAAIwC,GACjB,GAAqB,mBAAV+M,EAAsB,MAAM9M,UAAUD,EAAK,qBACtD,OAAOW,EAASoM,EAAOlQ,KAAKmD,MAMxB,SAAUtD,EAAQD,EAASF,GAEjC,IAAI4B,EAAS5B,EAAoB,GAC7B6B,EAAO7B,EAAoB,IAC3BkC,EAAUlC,EAAoB,GAC9BqoC,EAAUroC,EAAoB,KAElCkC,EAAQA,EAAQU,EAAIV,EAAQQ,EAAG,CAC7B4lC,MAAO,SAASA,MAAMd,GACpB,OAAO,IAAK3lC,EAAKkf,SAAWnf,EAAOmf,SAAS,SAAUW,GACpDhB,WAAW2nB,EAAQ/nC,KAAKohB,GAAS,GAAO8lB,SAQxC,SAAUrnC,EAAQD,EAASF,GAEjC,IAAI0rB,EAAO1rB,EAAoB,KAC3BkC,EAAUlC,EAAoB,GAGlCA,EAAoB,IAAIkV,EAAIwW,EAAKxW,EAAIwW,EAAKxW,GAAK,GAE/ChT,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAG,WAAY,CAAEujB,KAAMjmB,EAAoB,QAKjE,SAAUG,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,EAAG,SAAU,CAAEc,SAAUxD,EAAoB,MAKnE,SAAUG,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,EAAG,SAAU,CAAEsI,QAAShL,EAAoB,OAKlE,SAAUG,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B6rB,EAAS7rB,EAAoB,KAEjCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,EAAG,SAAU,CAAEmpB,OAAQA,KAK7C,SAAU1rB,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B6rB,EAAS7rB,EAAoB,KAC7B8I,EAAS9I,EAAoB,IAEjCkC,EAAQA,EAAQgB,EAAIhB,EAAQQ,EAAG,SAAU,CACvC6lC,KAAM,SAAUx3B,EAAO+a,GACrB,OAAOD,EAAO/iB,EAAOiI,GAAQ+a,OAO3B,SAAU3rB,EAAQD,EAASF,GAIjCA,EAAoB,GAApBA,CAAwBgwB,OAAQ,SAAU,SAAUtR,GAClD1Y,KAAK4iB,IAAMlK,EACX1Y,KAAK2Y,GAAK,GACT,WACD,IAAIve,EAAI4F,KAAK2Y,KACTjO,IAAStQ,EAAI4F,KAAK4iB,IACtB,MAAO,CAAElY,KAAMA,EAAM/L,MAAO+L,EAAO7Q,GAAYO,MAM3C,SAAUD,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BwoC,EAAMxoC,EAAoB,GAApBA,CAAwB,sBAAuB,QAEzDkC,EAAQA,EAAQgB,EAAG,SAAU,CAAEulC,OAAQ,SAASA,OAAOhlC,GAAM,OAAO+kC,EAAI/kC,OAKlE,SAAUtD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BwoC,EAAMxoC,EAAoB,GAApBA,CAAwB,WAAY,CAC5C0oC,IAAK,QACLC,IAAK,OACLC,IAAK,OACLC,IAAK,SACLC,IAAK,WAGP5mC,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAG,SAAU,CAAEqmC,WAAY,SAASA,aAAe,OAAOP,EAAIxiC,UAKpF,SAAU7F,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BwoC,EAAMxoC,EAAoB,GAApBA,CAAwB,6BAA8B,CAC9DgpC,QAAS,IACTC,OAAQ,IACRC,OAAQ,IACRC,SAAU,IACVC,SAAU,MAGZlnC,EAAQA,EAAQY,EAAIZ,EAAQQ,EAAG,SAAU,CAAE2mC,aAAc,SAASA,eAAiB,OAAOb,EAAIxiC,YAMzE,oBAAV7F,QAAyBA,OAAOD,QAASC,OAAOD,QAAUP,EAE3C,mBAAVksB,QAAwBA,OAAOyd,IAAKzd,OAAO,WAAc,OAAOlsB,IAE3EC,EAAIiC,KAAOlC,EA77Qf,CA87QC,EAAG","file":"core.min.js"} \ No newline at end of file diff --git a/node_modules/core-js/client/library.js b/node_modules/core-js/client/library.js deleted file mode 100644 index 7179088e5..000000000 --- a/node_modules/core-js/client/library.js +++ /dev/null @@ -1,8129 +0,0 @@ -/** - * core-js 2.5.7 - * https://github.com/zloirock/core-js - * License: http://rock.mit-license.org - * © 2018 Denis Pushkarev - */ -!function(__e, __g, undefined){ -'use strict'; -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 126); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(2); -var core = __webpack_require__(12); -var ctx = __webpack_require__(16); -var hide = __webpack_require__(17); -var has = __webpack_require__(15); -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; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(3); -module.exports = function (it) { - if (!isObject(it)) throw TypeError(it + ' is not an object!'); - return it; -}; - - -/***/ }), -/* 2 */ -/***/ (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 - - -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - -module.exports = function (it) { - return typeof it === 'object' ? it !== null : typeof it === 'function'; -}; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - -module.exports = function (exec) { - try { - return !!exec(); - } catch (e) { - return true; - } -}; - - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -var store = __webpack_require__(49)('wks'); -var uid = __webpack_require__(40); -var Symbol = __webpack_require__(2).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; - - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.15 ToLength -var toInteger = __webpack_require__(22); -var min = Math.min; -module.exports = function (it) { - return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 -}; - - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -var anObject = __webpack_require__(1); -var IE8_DOM_DEFINE = __webpack_require__(90); -var toPrimitive = __webpack_require__(27); -var dP = Object.defineProperty; - -exports.f = __webpack_require__(8) ? 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; -}; - - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -// Thank's IE8 for his funny defineProperty -module.exports = !__webpack_require__(4)(function () { - return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; -}); - - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.13 ToObject(argument) -var defined = __webpack_require__(24); -module.exports = function (it) { - return Object(defined(it)); -}; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports) { - -module.exports = function (it) { - if (typeof it != 'function') throw TypeError(it + ' is not a function!'); - return it; -}; - - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -// to indexed object, toObject with fallback for non-array-like ES3 strings -var IObject = __webpack_require__(44); -var defined = __webpack_require__(24); -module.exports = function (it) { - return IObject(defined(it)); -}; - - -/***/ }), -/* 12 */ -/***/ (function(module, exports) { - -var core = module.exports = { version: '2.5.7' }; -if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef - - -/***/ }), -/* 13 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) -var has = __webpack_require__(15); -var toObject = __webpack_require__(9); -var IE_PROTO = __webpack_require__(65)('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; -}; - - -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var fails = __webpack_require__(4); -var defined = __webpack_require__(24); -var quot = /"/g; -// B.2.3.2.1 CreateHTML(string, tag, attribute, value) -var createHTML = function (string, tag, attribute, value) { - var S = String(defined(string)); - var p1 = '<' + tag; - if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; - return p1 + '>' + S + ''; -}; -module.exports = function (NAME, exec) { - var O = {}; - O[NAME] = exec(createHTML); - $export($export.P + $export.F * fails(function () { - var test = ''[NAME]('"'); - return test !== test.toLowerCase() || test.split('"').length > 3; - }), 'String', O); -}; - - -/***/ }), -/* 15 */ -/***/ (function(module, exports) { - -var hasOwnProperty = {}.hasOwnProperty; -module.exports = function (it, key) { - return hasOwnProperty.call(it, key); -}; - - -/***/ }), -/* 16 */ -/***/ (function(module, exports, __webpack_require__) { - -// optional / simple context binding -var aFunction = __webpack_require__(10); -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); - }; -}; - - -/***/ }), -/* 17 */ -/***/ (function(module, exports, __webpack_require__) { - -var dP = __webpack_require__(7); -var createDesc = __webpack_require__(28); -module.exports = __webpack_require__(8) ? function (object, key, value) { - return dP.f(object, key, createDesc(1, value)); -} : function (object, key, value) { - object[key] = value; - return object; -}; - - -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { - -var pIE = __webpack_require__(45); -var createDesc = __webpack_require__(28); -var toIObject = __webpack_require__(11); -var toPrimitive = __webpack_require__(27); -var has = __webpack_require__(15); -var IE8_DOM_DEFINE = __webpack_require__(90); -var gOPD = Object.getOwnPropertyDescriptor; - -exports.f = __webpack_require__(8) ? 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]); -}; - - -/***/ }), -/* 19 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var fails = __webpack_require__(4); - -module.exports = function (method, arg) { - return !!method && fails(function () { - // eslint-disable-next-line no-useless-call - arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null); - }); -}; - - -/***/ }), -/* 20 */ -/***/ (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__(16); -var IObject = __webpack_require__(44); -var toObject = __webpack_require__(9); -var toLength = __webpack_require__(6); -var asc = __webpack_require__(80); -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; - }; -}; - - -/***/ }), -/* 21 */ -/***/ (function(module, exports) { - -var toString = {}.toString; - -module.exports = function (it) { - return toString.call(it).slice(8, -1); -}; - - -/***/ }), -/* 22 */ -/***/ (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); -}; - - -/***/ }), -/* 23 */ -/***/ (function(module, exports, __webpack_require__) { - -// most Object methods by ES6 should accept primitives -var $export = __webpack_require__(0); -var core = __webpack_require__(12); -var fails = __webpack_require__(4); -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); -}; - - -/***/ }), -/* 24 */ -/***/ (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; -}; - - -/***/ }), -/* 25 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -if (__webpack_require__(8)) { - var LIBRARY = __webpack_require__(30); - var global = __webpack_require__(2); - var fails = __webpack_require__(4); - var $export = __webpack_require__(0); - var $typed = __webpack_require__(58); - var $buffer = __webpack_require__(88); - var ctx = __webpack_require__(16); - var anInstance = __webpack_require__(38); - var propertyDesc = __webpack_require__(28); - var hide = __webpack_require__(17); - var redefineAll = __webpack_require__(39); - var toInteger = __webpack_require__(22); - var toLength = __webpack_require__(6); - var toIndex = __webpack_require__(115); - var toAbsoluteIndex = __webpack_require__(35); - var toPrimitive = __webpack_require__(27); - var has = __webpack_require__(15); - var classof = __webpack_require__(37); - var isObject = __webpack_require__(3); - var toObject = __webpack_require__(9); - var isArrayIter = __webpack_require__(77); - var create = __webpack_require__(32); - var getPrototypeOf = __webpack_require__(13); - var gOPN = __webpack_require__(46).f; - var getIterFn = __webpack_require__(48); - var uid = __webpack_require__(40); - var wks = __webpack_require__(5); - var createArrayMethod = __webpack_require__(20); - var createArrayIncludes = __webpack_require__(50); - var speciesConstructor = __webpack_require__(55); - var ArrayIterators = __webpack_require__(82); - var Iterators = __webpack_require__(36); - var $iterDetect = __webpack_require__(79); - var setSpecies = __webpack_require__(42); - var arrayFill = __webpack_require__(81); - var arrayCopyWithin = __webpack_require__(106); - var $DP = __webpack_require__(7); - var $GOPD = __webpack_require__(18); - var dP = $DP.f; - var gOPD = $GOPD.f; - var RangeError = global.RangeError; - var TypeError = global.TypeError; - var Uint8Array = global.Uint8Array; - var ARRAY_BUFFER = 'ArrayBuffer'; - var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER; - var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; - var PROTOTYPE = 'prototype'; - var ArrayProto = Array[PROTOTYPE]; - var $ArrayBuffer = $buffer.ArrayBuffer; - var $DataView = $buffer.DataView; - var arrayForEach = createArrayMethod(0); - var arrayFilter = createArrayMethod(2); - var arraySome = createArrayMethod(3); - var arrayEvery = createArrayMethod(4); - var arrayFind = createArrayMethod(5); - var arrayFindIndex = createArrayMethod(6); - var arrayIncludes = createArrayIncludes(true); - var arrayIndexOf = createArrayIncludes(false); - var arrayValues = ArrayIterators.values; - var arrayKeys = ArrayIterators.keys; - var arrayEntries = ArrayIterators.entries; - var arrayLastIndexOf = ArrayProto.lastIndexOf; - var arrayReduce = ArrayProto.reduce; - var arrayReduceRight = ArrayProto.reduceRight; - var arrayJoin = ArrayProto.join; - var arraySort = ArrayProto.sort; - var arraySlice = ArrayProto.slice; - var arrayToString = ArrayProto.toString; - var arrayToLocaleString = ArrayProto.toLocaleString; - var ITERATOR = wks('iterator'); - var TAG = wks('toStringTag'); - var TYPED_CONSTRUCTOR = uid('typed_constructor'); - var DEF_CONSTRUCTOR = uid('def_constructor'); - var ALL_CONSTRUCTORS = $typed.CONSTR; - var TYPED_ARRAY = $typed.TYPED; - var VIEW = $typed.VIEW; - var WRONG_LENGTH = 'Wrong length!'; - - var $map = createArrayMethod(1, function (O, length) { - return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); - }); - - var LITTLE_ENDIAN = fails(function () { - // eslint-disable-next-line no-undef - return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; - }); - - var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () { - new Uint8Array(1).set({}); - }); - - var toOffset = function (it, BYTES) { - var offset = toInteger(it); - if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!'); - return offset; - }; - - var validate = function (it) { - if (isObject(it) && TYPED_ARRAY in it) return it; - throw TypeError(it + ' is not a typed array!'); - }; - - var allocate = function (C, length) { - if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) { - throw TypeError('It is not a typed array constructor!'); - } return new C(length); - }; - - var speciesFromList = function (O, list) { - return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); - }; - - var fromList = function (C, list) { - var index = 0; - var length = list.length; - var result = allocate(C, length); - while (length > index) result[index] = list[index++]; - return result; - }; - - var addGetter = function (it, key, internal) { - dP(it, key, { get: function () { return this._d[internal]; } }); - }; - - var $from = function from(source /* , mapfn, thisArg */) { - var O = toObject(source); - var aLen = arguments.length; - var mapfn = aLen > 1 ? arguments[1] : undefined; - var mapping = mapfn !== undefined; - var iterFn = getIterFn(O); - var i, length, values, result, step, iterator; - if (iterFn != undefined && !isArrayIter(iterFn)) { - for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) { - values.push(step.value); - } O = values; - } - if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2); - for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) { - result[i] = mapping ? mapfn(O[i], i) : O[i]; - } - return result; - }; - - var $of = function of(/* ...items */) { - var index = 0; - var length = arguments.length; - var result = allocate(this, length); - while (length > index) result[index] = arguments[index++]; - return result; - }; - - // iOS Safari 6.x fails here - var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); }); - - var $toLocaleString = function toLocaleString() { - return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); - }; - - var proto = { - copyWithin: function copyWithin(target, start /* , end */) { - return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); - }, - every: function every(callbackfn /* , thisArg */) { - return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }, - fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars - return arrayFill.apply(validate(this), arguments); - }, - filter: function filter(callbackfn /* , thisArg */) { - return speciesFromList(this, arrayFilter(validate(this), callbackfn, - arguments.length > 1 ? arguments[1] : undefined)); - }, - find: function find(predicate /* , thisArg */) { - return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); - }, - findIndex: function findIndex(predicate /* , thisArg */) { - return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); - }, - forEach: function forEach(callbackfn /* , thisArg */) { - arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }, - indexOf: function indexOf(searchElement /* , fromIndex */) { - return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); - }, - includes: function includes(searchElement /* , fromIndex */) { - return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); - }, - join: function join(separator) { // eslint-disable-line no-unused-vars - return arrayJoin.apply(validate(this), arguments); - }, - lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars - return arrayLastIndexOf.apply(validate(this), arguments); - }, - map: function map(mapfn /* , thisArg */) { - return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); - }, - reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars - return arrayReduce.apply(validate(this), arguments); - }, - reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars - return arrayReduceRight.apply(validate(this), arguments); - }, - reverse: function reverse() { - var that = this; - var length = validate(that).length; - var middle = Math.floor(length / 2); - var index = 0; - var value; - while (index < middle) { - value = that[index]; - that[index++] = that[--length]; - that[length] = value; - } return that; - }, - some: function some(callbackfn /* , thisArg */) { - return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }, - sort: function sort(comparefn) { - return arraySort.call(validate(this), comparefn); - }, - subarray: function subarray(begin, end) { - var O = validate(this); - var length = O.length; - var $begin = toAbsoluteIndex(begin, length); - return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( - O.buffer, - O.byteOffset + $begin * O.BYTES_PER_ELEMENT, - toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin) - ); - } - }; - - var $slice = function slice(start, end) { - return speciesFromList(this, arraySlice.call(validate(this), start, end)); - }; - - var $set = function set(arrayLike /* , offset */) { - validate(this); - var offset = toOffset(arguments[1], 1); - var length = this.length; - var src = toObject(arrayLike); - var len = toLength(src.length); - var index = 0; - if (len + offset > length) throw RangeError(WRONG_LENGTH); - while (index < len) this[offset + index] = src[index++]; - }; - - var $iterators = { - entries: function entries() { - return arrayEntries.call(validate(this)); - }, - keys: function keys() { - return arrayKeys.call(validate(this)); - }, - values: function values() { - return arrayValues.call(validate(this)); - } - }; - - var isTAIndex = function (target, key) { - return isObject(target) - && target[TYPED_ARRAY] - && typeof key != 'symbol' - && key in target - && String(+key) == String(key); - }; - var $getDesc = function getOwnPropertyDescriptor(target, key) { - return isTAIndex(target, key = toPrimitive(key, true)) - ? propertyDesc(2, target[key]) - : gOPD(target, key); - }; - var $setDesc = function defineProperty(target, key, desc) { - if (isTAIndex(target, key = toPrimitive(key, true)) - && isObject(desc) - && has(desc, 'value') - && !has(desc, 'get') - && !has(desc, 'set') - // TODO: add validation descriptor w/o calling accessors - && !desc.configurable - && (!has(desc, 'writable') || desc.writable) - && (!has(desc, 'enumerable') || desc.enumerable) - ) { - target[key] = desc.value; - return target; - } return dP(target, key, desc); - }; - - if (!ALL_CONSTRUCTORS) { - $GOPD.f = $getDesc; - $DP.f = $setDesc; - } - - $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { - getOwnPropertyDescriptor: $getDesc, - defineProperty: $setDesc - }); - - if (fails(function () { arrayToString.call({}); })) { - arrayToString = arrayToLocaleString = function toString() { - return arrayJoin.call(this); - }; - } - - var $TypedArrayPrototype$ = redefineAll({}, proto); - redefineAll($TypedArrayPrototype$, $iterators); - hide($TypedArrayPrototype$, ITERATOR, $iterators.values); - redefineAll($TypedArrayPrototype$, { - slice: $slice, - set: $set, - constructor: function () { /* noop */ }, - toString: arrayToString, - toLocaleString: $toLocaleString - }); - addGetter($TypedArrayPrototype$, 'buffer', 'b'); - addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); - addGetter($TypedArrayPrototype$, 'byteLength', 'l'); - addGetter($TypedArrayPrototype$, 'length', 'e'); - dP($TypedArrayPrototype$, TAG, { - get: function () { return this[TYPED_ARRAY]; } - }); - - // eslint-disable-next-line max-statements - module.exports = function (KEY, BYTES, wrapper, CLAMPED) { - CLAMPED = !!CLAMPED; - var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'; - var GETTER = 'get' + KEY; - var SETTER = 'set' + KEY; - var TypedArray = global[NAME]; - var Base = TypedArray || {}; - var TAC = TypedArray && getPrototypeOf(TypedArray); - var FORCED = !TypedArray || !$typed.ABV; - var O = {}; - var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; - var getter = function (that, index) { - var data = that._d; - return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); - }; - var setter = function (that, index, value) { - var data = that._d; - if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; - data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); - }; - var addElement = function (that, index) { - dP(that, index, { - get: function () { - return getter(this, index); - }, - set: function (value) { - return setter(this, index, value); - }, - enumerable: true - }); - }; - if (FORCED) { - TypedArray = wrapper(function (that, data, $offset, $length) { - anInstance(that, TypedArray, NAME, '_d'); - var index = 0; - var offset = 0; - var buffer, byteLength, length, klass; - if (!isObject(data)) { - length = toIndex(data); - byteLength = length * BYTES; - buffer = new $ArrayBuffer(byteLength); - } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { - buffer = data; - offset = toOffset($offset, BYTES); - var $len = data.byteLength; - if ($length === undefined) { - if ($len % BYTES) throw RangeError(WRONG_LENGTH); - byteLength = $len - offset; - if (byteLength < 0) throw RangeError(WRONG_LENGTH); - } else { - byteLength = toLength($length) * BYTES; - if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH); - } - length = byteLength / BYTES; - } else if (TYPED_ARRAY in data) { - return fromList(TypedArray, data); - } else { - return $from.call(TypedArray, data); - } - hide(that, '_d', { - b: buffer, - o: offset, - l: byteLength, - e: length, - v: new $DataView(buffer) - }); - while (index < length) addElement(that, index++); - }); - TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); - hide(TypedArrayPrototype, 'constructor', TypedArray); - } else if (!fails(function () { - TypedArray(1); - }) || !fails(function () { - new TypedArray(-1); // eslint-disable-line no-new - }) || !$iterDetect(function (iter) { - new TypedArray(); // eslint-disable-line no-new - new TypedArray(null); // eslint-disable-line no-new - new TypedArray(1.5); // eslint-disable-line no-new - new TypedArray(iter); // eslint-disable-line no-new - }, true)) { - TypedArray = wrapper(function (that, data, $offset, $length) { - anInstance(that, TypedArray, NAME); - var klass; - // `ws` module bug, temporarily remove validation length for Uint8Array - // https://github.com/websockets/ws/pull/645 - if (!isObject(data)) return new Base(toIndex(data)); - if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { - return $length !== undefined - ? new Base(data, toOffset($offset, BYTES), $length) - : $offset !== undefined - ? new Base(data, toOffset($offset, BYTES)) - : new Base(data); - } - if (TYPED_ARRAY in data) return fromList(TypedArray, data); - return $from.call(TypedArray, data); - }); - arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) { - if (!(key in TypedArray)) hide(TypedArray, key, Base[key]); - }); - TypedArray[PROTOTYPE] = TypedArrayPrototype; - if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray; - } - var $nativeIterator = TypedArrayPrototype[ITERATOR]; - var CORRECT_ITER_NAME = !!$nativeIterator - && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined); - var $iterator = $iterators.values; - hide(TypedArray, TYPED_CONSTRUCTOR, true); - hide(TypedArrayPrototype, TYPED_ARRAY, NAME); - hide(TypedArrayPrototype, VIEW, true); - hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); - - if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) { - dP(TypedArrayPrototype, TAG, { - get: function () { return NAME; } - }); - } - - O[NAME] = TypedArray; - - $export($export.G + $export.W + $export.F * (TypedArray != Base), O); - - $export($export.S, NAME, { - BYTES_PER_ELEMENT: BYTES - }); - - $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, { - from: $from, - of: $of - }); - - if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); - - $export($export.P, NAME, proto); - - setSpecies(NAME); - - $export($export.P + $export.F * FORCED_SET, NAME, { set: $set }); - - $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); - - if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString; - - $export($export.P + $export.F * fails(function () { - new TypedArray(1).slice(); - }), NAME, { slice: $slice }); - - $export($export.P + $export.F * (fails(function () { - return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString(); - }) || !fails(function () { - TypedArrayPrototype.toLocaleString.call([1, 2]); - })), NAME, { toLocaleString: $toLocaleString }); - - Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; - if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator); - }; -} else module.exports = function () { /* empty */ }; - - -/***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { - -var Map = __webpack_require__(109); -var $export = __webpack_require__(0); -var shared = __webpack_require__(49)('metadata'); -var store = shared.store || (shared.store = new (__webpack_require__(112))()); - -var getOrCreateMetadataMap = function (target, targetKey, create) { - var targetMetadata = store.get(target); - if (!targetMetadata) { - if (!create) return undefined; - store.set(target, targetMetadata = new Map()); - } - var keyMetadata = targetMetadata.get(targetKey); - if (!keyMetadata) { - if (!create) return undefined; - targetMetadata.set(targetKey, keyMetadata = new Map()); - } return keyMetadata; -}; -var ordinaryHasOwnMetadata = function (MetadataKey, O, P) { - var metadataMap = getOrCreateMetadataMap(O, P, false); - return metadataMap === undefined ? false : metadataMap.has(MetadataKey); -}; -var ordinaryGetOwnMetadata = function (MetadataKey, O, P) { - var metadataMap = getOrCreateMetadataMap(O, P, false); - return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); -}; -var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) { - getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); -}; -var ordinaryOwnMetadataKeys = function (target, targetKey) { - var metadataMap = getOrCreateMetadataMap(target, targetKey, false); - var keys = []; - if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); }); - return keys; -}; -var toMetaKey = function (it) { - return it === undefined || typeof it == 'symbol' ? it : String(it); -}; -var exp = function (O) { - $export($export.S, 'Reflect', O); -}; - -module.exports = { - store: store, - map: getOrCreateMetadataMap, - has: ordinaryHasOwnMetadata, - get: ordinaryGetOwnMetadata, - set: ordinaryDefineOwnMetadata, - keys: ordinaryOwnMetadataKeys, - key: toMetaKey, - exp: exp -}; - - -/***/ }), -/* 27 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.1 ToPrimitive(input [, PreferredType]) -var isObject = __webpack_require__(3); -// 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"); -}; - - -/***/ }), -/* 28 */ -/***/ (function(module, exports) { - -module.exports = function (bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value: value - }; -}; - - -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { - -var META = __webpack_require__(40)('meta'); -var isObject = __webpack_require__(3); -var has = __webpack_require__(15); -var setDesc = __webpack_require__(7).f; -var id = 0; -var isExtensible = Object.isExtensible || function () { - return true; -}; -var FREEZE = !__webpack_require__(4)(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 -}; - - -/***/ }), -/* 30 */ -/***/ (function(module, exports) { - -module.exports = true; - - -/***/ }), -/* 31 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.14 / 15.2.3.14 Object.keys(O) -var $keys = __webpack_require__(92); -var enumBugKeys = __webpack_require__(66); - -module.exports = Object.keys || function keys(O) { - return $keys(O, enumBugKeys); -}; - - -/***/ }), -/* 32 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -var anObject = __webpack_require__(1); -var dPs = __webpack_require__(93); -var enumBugKeys = __webpack_require__(66); -var IE_PROTO = __webpack_require__(65)('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__(62)('iframe'); - var i = enumBugKeys.length; - var lt = '<'; - var gt = '>'; - var iframeDocument; - iframe.style.display = 'none'; - __webpack_require__(67).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); -}; - - -/***/ }), -/* 33 */ -/***/ (function(module, exports) { - -module.exports = function () { /* empty */ }; - - -/***/ }), -/* 34 */ -/***/ (function(module, exports, __webpack_require__) { - -var ctx = __webpack_require__(16); -var call = __webpack_require__(104); -var isArrayIter = __webpack_require__(77); -var anObject = __webpack_require__(1); -var toLength = __webpack_require__(6); -var getIterFn = __webpack_require__(48); -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; - - -/***/ }), -/* 35 */ -/***/ (function(module, exports, __webpack_require__) { - -var toInteger = __webpack_require__(22); -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); -}; - - -/***/ }), -/* 36 */ -/***/ (function(module, exports) { - -module.exports = {}; - - -/***/ }), -/* 37 */ -/***/ (function(module, exports, __webpack_require__) { - -// getting tag from 19.1.3.6 Object.prototype.toString() -var cof = __webpack_require__(21); -var TAG = __webpack_require__(5)('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; -}; - - -/***/ }), -/* 38 */ -/***/ (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; -}; - - -/***/ }), -/* 39 */ -/***/ (function(module, exports, __webpack_require__) { - -var hide = __webpack_require__(17); -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; -}; - - -/***/ }), -/* 40 */ -/***/ (function(module, exports) { - -var id = 0; -var px = Math.random(); -module.exports = function (key) { - return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); -}; - - -/***/ }), -/* 41 */ -/***/ (function(module, exports, __webpack_require__) { - -var def = __webpack_require__(7).f; -var has = __webpack_require__(15); -var TAG = __webpack_require__(5)('toStringTag'); - -module.exports = function (it, tag, stat) { - if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); -}; - - -/***/ }), -/* 42 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var global = __webpack_require__(2); -var core = __webpack_require__(12); -var dP = __webpack_require__(7); -var DESCRIPTORS = __webpack_require__(8); -var SPECIES = __webpack_require__(5)('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; } - }); -}; - - -/***/ }), -/* 43 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(3); -module.exports = function (it, TYPE) { - if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); - return it; -}; - - -/***/ }), -/* 44 */ -/***/ (function(module, exports, __webpack_require__) { - -// fallback for non-array-like ES3 and non-enumerable old V8 strings -var cof = __webpack_require__(21); -// eslint-disable-next-line no-prototype-builtins -module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { - return cof(it) == 'String' ? it.split('') : Object(it); -}; - - -/***/ }), -/* 45 */ -/***/ (function(module, exports) { - -exports.f = {}.propertyIsEnumerable; - - -/***/ }), -/* 46 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) -var $keys = __webpack_require__(92); -var hiddenKeys = __webpack_require__(66).concat('length', 'prototype'); - -exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { - return $keys(O, hiddenKeys); -}; - - -/***/ }), -/* 47 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var defined = __webpack_require__(24); -var fails = __webpack_require__(4); -var spaces = __webpack_require__(71); -var space = '[' + spaces + ']'; -var non = '\u200b\u0085'; -var ltrim = RegExp('^' + space + space + '*'); -var rtrim = RegExp(space + space + '*$'); - -var exporter = function (KEY, exec, ALIAS) { - var exp = {}; - var FORCE = fails(function () { - return !!spaces[KEY]() || non[KEY]() != non; - }); - var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; - if (ALIAS) exp[ALIAS] = fn; - $export($export.P + $export.F * FORCE, 'String', exp); -}; - -// 1 -> String#trimLeft -// 2 -> String#trimRight -// 3 -> String#trim -var trim = exporter.trim = function (string, TYPE) { - string = String(defined(string)); - if (TYPE & 1) string = string.replace(ltrim, ''); - if (TYPE & 2) string = string.replace(rtrim, ''); - return string; -}; - -module.exports = exporter; - - -/***/ }), -/* 48 */ -/***/ (function(module, exports, __webpack_require__) { - -var classof = __webpack_require__(37); -var ITERATOR = __webpack_require__(5)('iterator'); -var Iterators = __webpack_require__(36); -module.exports = __webpack_require__(12).getIteratorMethod = function (it) { - if (it != undefined) return it[ITERATOR] - || it['@@iterator'] - || Iterators[classof(it)]; -}; - - -/***/ }), -/* 49 */ -/***/ (function(module, exports, __webpack_require__) { - -var core = __webpack_require__(12); -var global = __webpack_require__(2); -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__(30) ? 'pure' : 'global', - copyright: '© 2018 Denis Pushkarev (zloirock.ru)' -}); - - -/***/ }), -/* 50 */ -/***/ (function(module, exports, __webpack_require__) { - -// false -> Array#indexOf -// true -> Array#includes -var toIObject = __webpack_require__(11); -var toLength = __webpack_require__(6); -var toAbsoluteIndex = __webpack_require__(35); -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; - }; -}; - - -/***/ }), -/* 51 */ -/***/ (function(module, exports) { - -exports.f = Object.getOwnPropertySymbols; - - -/***/ }), -/* 52 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.2.2 IsArray(argument) -var cof = __webpack_require__(21); -module.exports = Array.isArray || function isArray(arg) { - return cof(arg) == 'Array'; -}; - - -/***/ }), -/* 53 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var LIBRARY = __webpack_require__(30); -var $export = __webpack_require__(0); -var redefine = __webpack_require__(63); -var hide = __webpack_require__(17); -var Iterators = __webpack_require__(36); -var $iterCreate = __webpack_require__(54); -var setToStringTag = __webpack_require__(41); -var getPrototypeOf = __webpack_require__(13); -var ITERATOR = __webpack_require__(5)('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; -}; - - -/***/ }), -/* 54 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var create = __webpack_require__(32); -var descriptor = __webpack_require__(28); -var setToStringTag = __webpack_require__(41); -var IteratorPrototype = {}; - -// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() -__webpack_require__(17)(IteratorPrototype, __webpack_require__(5)('iterator'), function () { return this; }); - -module.exports = function (Constructor, NAME, next) { - Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); - setToStringTag(Constructor, NAME + ' Iterator'); -}; - - -/***/ }), -/* 55 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.3.20 SpeciesConstructor(O, defaultConstructor) -var anObject = __webpack_require__(1); -var aFunction = __webpack_require__(10); -var SPECIES = __webpack_require__(5)('species'); -module.exports = function (O, D) { - var C = anObject(O).constructor; - var S; - return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); -}; - - -/***/ }), -/* 56 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(2); -var navigator = global.navigator; - -module.exports = navigator && navigator.userAgent || ''; - - -/***/ }), -/* 57 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var global = __webpack_require__(2); -var $export = __webpack_require__(0); -var meta = __webpack_require__(29); -var fails = __webpack_require__(4); -var hide = __webpack_require__(17); -var redefineAll = __webpack_require__(39); -var forOf = __webpack_require__(34); -var anInstance = __webpack_require__(38); -var isObject = __webpack_require__(3); -var setToStringTag = __webpack_require__(41); -var dP = __webpack_require__(7).f; -var each = __webpack_require__(20)(0); -var DESCRIPTORS = __webpack_require__(8); - -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; -}; - - -/***/ }), -/* 58 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(2); -var hide = __webpack_require__(17); -var uid = __webpack_require__(40); -var TYPED = uid('typed_array'); -var VIEW = uid('view'); -var ABV = !!(global.ArrayBuffer && global.DataView); -var CONSTR = ABV; -var i = 0; -var l = 9; -var Typed; - -var TypedArrayConstructors = ( - 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' -).split(','); - -while (i < l) { - if (Typed = global[TypedArrayConstructors[i++]]) { - hide(Typed.prototype, TYPED, true); - hide(Typed.prototype, VIEW, true); - } else CONSTR = false; -} - -module.exports = { - ABV: ABV, - CONSTR: CONSTR, - TYPED: TYPED, - VIEW: VIEW -}; - - -/***/ }), -/* 59 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// Forced replacement prototype accessors methods -module.exports = __webpack_require__(30) || !__webpack_require__(4)(function () { - var K = Math.random(); - // In FF throws only define methods - // eslint-disable-next-line no-undef, no-useless-call - __defineSetter__.call(null, K, function () { /* empty */ }); - delete __webpack_require__(2)[K]; -}); - - -/***/ }), -/* 60 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://tc39.github.io/proposal-setmap-offrom/ -var $export = __webpack_require__(0); - -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); - } }); -}; - - -/***/ }), -/* 61 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://tc39.github.io/proposal-setmap-offrom/ -var $export = __webpack_require__(0); -var aFunction = __webpack_require__(10); -var ctx = __webpack_require__(16); -var forOf = __webpack_require__(34); - -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); - } }); -}; - - -/***/ }), -/* 62 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(3); -var document = __webpack_require__(2).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) : {}; -}; - - -/***/ }), -/* 63 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(17); - - -/***/ }), -/* 64 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(2); -var core = __webpack_require__(12); -var LIBRARY = __webpack_require__(30); -var wksExt = __webpack_require__(91); -var defineProperty = __webpack_require__(7).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) }); -}; - - -/***/ }), -/* 65 */ -/***/ (function(module, exports, __webpack_require__) { - -var shared = __webpack_require__(49)('keys'); -var uid = __webpack_require__(40); -module.exports = function (key) { - return shared[key] || (shared[key] = uid(key)); -}; - - -/***/ }), -/* 66 */ -/***/ (function(module, exports) { - -// IE 8- don't enum bug keys -module.exports = ( - 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' -).split(','); - - -/***/ }), -/* 67 */ -/***/ (function(module, exports, __webpack_require__) { - -var document = __webpack_require__(2).document; -module.exports = document && document.documentElement; - - -/***/ }), -/* 68 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 19.1.2.1 Object.assign(target, source, ...) -var getKeys = __webpack_require__(31); -var gOPS = __webpack_require__(51); -var pIE = __webpack_require__(45); -var toObject = __webpack_require__(9); -var IObject = __webpack_require__(44); -var $assign = Object.assign; - -// should work with symbols and should have deterministic property order (V8 bug) -module.exports = !$assign || __webpack_require__(4)(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) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; - } return T; -} : $assign; - - -/***/ }), -/* 69 */ -/***/ (function(module, exports) { - -// fast apply, http://jsperf.lnkit.com/fast-apply/5 -module.exports = function (fn, args, that) { - var un = that === undefined; - switch (args.length) { - case 0: return un ? fn() - : fn.call(that); - case 1: return un ? fn(args[0]) - : fn.call(that, args[0]); - case 2: return un ? fn(args[0], args[1]) - : fn.call(that, args[0], args[1]); - case 3: return un ? fn(args[0], args[1], args[2]) - : fn.call(that, args[0], args[1], args[2]); - case 4: return un ? fn(args[0], args[1], args[2], args[3]) - : fn.call(that, args[0], args[1], args[2], args[3]); - } return fn.apply(that, args); -}; - - -/***/ }), -/* 70 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var toInteger = __webpack_require__(22); -var defined = __webpack_require__(24); - -module.exports = function repeat(count) { - var str = String(defined(this)); - var res = ''; - var n = toInteger(count); - if (n < 0 || n == Infinity) throw RangeError("Count can't be negative"); - for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str; - return res; -}; - - -/***/ }), -/* 71 */ -/***/ (function(module, exports) { - -module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + - '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; - - -/***/ }), -/* 72 */ -/***/ (function(module, exports) { - -// 20.2.2.28 Math.sign(x) -module.exports = Math.sign || function sign(x) { - // eslint-disable-next-line no-self-compare - return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; -}; - - -/***/ }), -/* 73 */ -/***/ (function(module, exports) { - -// 20.2.2.14 Math.expm1(x) -var $expm1 = Math.expm1; -module.exports = (!$expm1 - // Old FF bug - || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 - // Tor Browser bug - || $expm1(-2e-17) != -2e-17 -) ? function expm1(x) { - return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; -} : $expm1; - - -/***/ }), -/* 74 */ -/***/ (function(module, exports, __webpack_require__) { - -var toInteger = __webpack_require__(22); -var defined = __webpack_require__(24); -// 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; - }; -}; - - -/***/ }), -/* 75 */ -/***/ (function(module, exports, __webpack_require__) { - -// helper for String#{startsWith, endsWith, includes} -var isRegExp = __webpack_require__(103); -var defined = __webpack_require__(24); - -module.exports = function (that, searchString, NAME) { - if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); - return String(defined(that)); -}; - - -/***/ }), -/* 76 */ -/***/ (function(module, exports, __webpack_require__) { - -var MATCH = __webpack_require__(5)('match'); -module.exports = function (KEY) { - var re = /./; - try { - '/./'[KEY](re); - } catch (e) { - try { - re[MATCH] = false; - return !'/./'[KEY](re); - } catch (f) { /* empty */ } - } return true; -}; - - -/***/ }), -/* 77 */ -/***/ (function(module, exports, __webpack_require__) { - -// check on default Array iterator -var Iterators = __webpack_require__(36); -var ITERATOR = __webpack_require__(5)('iterator'); -var ArrayProto = Array.prototype; - -module.exports = function (it) { - return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); -}; - - -/***/ }), -/* 78 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $defineProperty = __webpack_require__(7); -var createDesc = __webpack_require__(28); - -module.exports = function (object, index, value) { - if (index in object) $defineProperty.f(object, index, createDesc(0, value)); - else object[index] = value; -}; - - -/***/ }), -/* 79 */ -/***/ (function(module, exports, __webpack_require__) { - -var ITERATOR = __webpack_require__(5)('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; -}; - - -/***/ }), -/* 80 */ -/***/ (function(module, exports, __webpack_require__) { - -// 9.4.2.3 ArraySpeciesCreate(originalArray, length) -var speciesConstructor = __webpack_require__(207); - -module.exports = function (original, length) { - return new (speciesConstructor(original))(length); -}; - - -/***/ }), -/* 81 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) - -var toObject = __webpack_require__(9); -var toAbsoluteIndex = __webpack_require__(35); -var toLength = __webpack_require__(6); -module.exports = function fill(value /* , start = 0, end = @length */) { - var O = toObject(this); - var length = toLength(O.length); - var aLen = arguments.length; - var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); - var end = aLen > 2 ? arguments[2] : undefined; - var endPos = end === undefined ? length : toAbsoluteIndex(end, length); - while (endPos > index) O[index++] = value; - return O; -}; - - -/***/ }), -/* 82 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var addToUnscopables = __webpack_require__(33); -var step = __webpack_require__(83); -var Iterators = __webpack_require__(36); -var toIObject = __webpack_require__(11); - -// 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__(53)(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'); - - -/***/ }), -/* 83 */ -/***/ (function(module, exports) { - -module.exports = function (done, value) { - return { value: value, done: !!done }; -}; - - -/***/ }), -/* 84 */ -/***/ (function(module, exports, __webpack_require__) { - -var ctx = __webpack_require__(16); -var invoke = __webpack_require__(69); -var html = __webpack_require__(67); -var cel = __webpack_require__(62); -var global = __webpack_require__(2); -var process = global.process; -var setTask = global.setImmediate; -var clearTask = global.clearImmediate; -var MessageChannel = global.MessageChannel; -var Dispatch = global.Dispatch; -var counter = 0; -var queue = {}; -var ONREADYSTATECHANGE = 'onreadystatechange'; -var defer, channel, port; -var run = function () { - var id = +this; - // eslint-disable-next-line no-prototype-builtins - if (queue.hasOwnProperty(id)) { - var fn = queue[id]; - delete queue[id]; - fn(); - } -}; -var listener = function (event) { - run.call(event.data); -}; -// Node.js 0.9+ & IE10+ has setImmediate, otherwise: -if (!setTask || !clearTask) { - setTask = function setImmediate(fn) { - var args = []; - var i = 1; - while (arguments.length > i) args.push(arguments[i++]); - queue[++counter] = function () { - // eslint-disable-next-line no-new-func - invoke(typeof fn == 'function' ? fn : Function(fn), args); - }; - defer(counter); - return counter; - }; - clearTask = function clearImmediate(id) { - delete queue[id]; - }; - // Node.js 0.8- - if (__webpack_require__(21)(process) == 'process') { - defer = function (id) { - process.nextTick(ctx(run, id, 1)); - }; - // Sphere (JS game engine) Dispatch API - } else if (Dispatch && Dispatch.now) { - defer = function (id) { - Dispatch.now(ctx(run, id, 1)); - }; - // Browsers with MessageChannel, includes WebWorkers - } else if (MessageChannel) { - channel = new MessageChannel(); - port = channel.port2; - channel.port1.onmessage = listener; - defer = ctx(port.postMessage, port, 1); - // Browsers with postMessage, skip WebWorkers - // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' - } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { - defer = function (id) { - global.postMessage(id + '', '*'); - }; - global.addEventListener('message', listener, false); - // IE8- - } else if (ONREADYSTATECHANGE in cel('script')) { - defer = function (id) { - html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { - html.removeChild(this); - run.call(id); - }; - }; - // Rest old browsers - } else { - defer = function (id) { - setTimeout(ctx(run, id, 1), 0); - }; - } -} -module.exports = { - set: setTask, - clear: clearTask -}; - - -/***/ }), -/* 85 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(2); -var macrotask = __webpack_require__(84).set; -var Observer = global.MutationObserver || global.WebKitMutationObserver; -var process = global.process; -var Promise = global.Promise; -var isNode = __webpack_require__(21)(process) == 'process'; - -module.exports = function () { - var head, last, notify; - - var flush = function () { - var parent, fn; - if (isNode && (parent = process.domain)) parent.exit(); - while (head) { - fn = head.fn; - head = head.next; - try { - fn(); - } catch (e) { - if (head) notify(); - else last = undefined; - throw e; - } - } last = undefined; - if (parent) parent.enter(); - }; - - // Node.js - if (isNode) { - notify = function () { - process.nextTick(flush); - }; - // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 - } else if (Observer && !(global.navigator && global.navigator.standalone)) { - var toggle = true; - var node = document.createTextNode(''); - new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new - notify = function () { - node.data = toggle = !toggle; - }; - // environments with maybe non-completely correct, but existent Promise - } else if (Promise && Promise.resolve) { - // Promise.resolve without an argument throws an error in LG WebOS 2 - var promise = Promise.resolve(undefined); - notify = function () { - promise.then(flush); - }; - // for other environments - macrotask based on: - // - setImmediate - // - MessageChannel - // - window.postMessag - // - onreadystatechange - // - setTimeout - } else { - notify = function () { - // strange IE + webpack dev server bug - use .call(global) - macrotask.call(global, flush); - }; - } - - return function (fn) { - var task = { fn: fn, next: undefined }; - if (last) last.next = task; - if (!head) { - head = task; - notify(); - } last = task; - }; -}; - - -/***/ }), -/* 86 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 25.4.1.5 NewPromiseCapability(C) -var aFunction = __webpack_require__(10); - -function PromiseCapability(C) { - var resolve, reject; - this.promise = new C(function ($$resolve, $$reject) { - if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); - resolve = $$resolve; - reject = $$reject; - }); - this.resolve = aFunction(resolve); - this.reject = aFunction(reject); -} - -module.exports.f = function (C) { - return new PromiseCapability(C); -}; - - -/***/ }), -/* 87 */ -/***/ (function(module, exports, __webpack_require__) { - -// all object keys, includes non-enumerable and symbols -var gOPN = __webpack_require__(46); -var gOPS = __webpack_require__(51); -var anObject = __webpack_require__(1); -var Reflect = __webpack_require__(2).Reflect; -module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { - var keys = gOPN.f(anObject(it)); - var getSymbols = gOPS.f; - return getSymbols ? keys.concat(getSymbols(it)) : keys; -}; - - -/***/ }), -/* 88 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var global = __webpack_require__(2); -var DESCRIPTORS = __webpack_require__(8); -var LIBRARY = __webpack_require__(30); -var $typed = __webpack_require__(58); -var hide = __webpack_require__(17); -var redefineAll = __webpack_require__(39); -var fails = __webpack_require__(4); -var anInstance = __webpack_require__(38); -var toInteger = __webpack_require__(22); -var toLength = __webpack_require__(6); -var toIndex = __webpack_require__(115); -var gOPN = __webpack_require__(46).f; -var dP = __webpack_require__(7).f; -var arrayFill = __webpack_require__(81); -var setToStringTag = __webpack_require__(41); -var ARRAY_BUFFER = 'ArrayBuffer'; -var DATA_VIEW = 'DataView'; -var PROTOTYPE = 'prototype'; -var WRONG_LENGTH = 'Wrong length!'; -var WRONG_INDEX = 'Wrong index!'; -var $ArrayBuffer = global[ARRAY_BUFFER]; -var $DataView = global[DATA_VIEW]; -var Math = global.Math; -var RangeError = global.RangeError; -// eslint-disable-next-line no-shadow-restricted-names -var Infinity = global.Infinity; -var BaseBuffer = $ArrayBuffer; -var abs = Math.abs; -var pow = Math.pow; -var floor = Math.floor; -var log = Math.log; -var LN2 = Math.LN2; -var BUFFER = 'buffer'; -var BYTE_LENGTH = 'byteLength'; -var BYTE_OFFSET = 'byteOffset'; -var $BUFFER = DESCRIPTORS ? '_b' : BUFFER; -var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH; -var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; - -// IEEE754 conversions based on https://github.com/feross/ieee754 -function packIEEE754(value, mLen, nBytes) { - var buffer = new Array(nBytes); - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0; - var i = 0; - var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; - var e, m, c; - value = abs(value); - // eslint-disable-next-line no-self-compare - if (value != value || value === Infinity) { - // eslint-disable-next-line no-self-compare - m = value != value ? 1 : 0; - e = eMax; - } else { - e = floor(log(value) / LN2); - if (value * (c = pow(2, -e)) < 1) { - e--; - c *= 2; - } - if (e + eBias >= 1) { - value += rt / c; - } else { - value += rt * pow(2, 1 - eBias); - } - if (value * c >= 2) { - e++; - c /= 2; - } - if (e + eBias >= eMax) { - m = 0; - e = eMax; - } else if (e + eBias >= 1) { - m = (value * c - 1) * pow(2, mLen); - e = e + eBias; - } else { - m = value * pow(2, eBias - 1) * pow(2, mLen); - e = 0; - } - } - for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); - e = e << mLen | m; - eLen += mLen; - for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); - buffer[--i] |= s * 128; - return buffer; -} -function unpackIEEE754(buffer, mLen, nBytes) { - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var nBits = eLen - 7; - var i = nBytes - 1; - var s = buffer[i--]; - var e = s & 127; - var m; - s >>= 7; - for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); - m = e & (1 << -nBits) - 1; - e >>= -nBits; - nBits += mLen; - for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); - if (e === 0) { - e = 1 - eBias; - } else if (e === eMax) { - return m ? NaN : s ? -Infinity : Infinity; - } else { - m = m + pow(2, mLen); - e = e - eBias; - } return (s ? -1 : 1) * m * pow(2, e - mLen); -} - -function unpackI32(bytes) { - return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; -} -function packI8(it) { - return [it & 0xff]; -} -function packI16(it) { - return [it & 0xff, it >> 8 & 0xff]; -} -function packI32(it) { - return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; -} -function packF64(it) { - return packIEEE754(it, 52, 8); -} -function packF32(it) { - return packIEEE754(it, 23, 4); -} - -function addGetter(C, key, internal) { - dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } }); -} - -function get(view, bytes, index, isLittleEndian) { - var numIndex = +index; - var intIndex = toIndex(numIndex); - if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); - var store = view[$BUFFER]._b; - var start = intIndex + view[$OFFSET]; - var pack = store.slice(start, start + bytes); - return isLittleEndian ? pack : pack.reverse(); -} -function set(view, bytes, index, conversion, value, isLittleEndian) { - var numIndex = +index; - var intIndex = toIndex(numIndex); - if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); - var store = view[$BUFFER]._b; - var start = intIndex + view[$OFFSET]; - var pack = conversion(+value); - for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; -} - -if (!$typed.ABV) { - $ArrayBuffer = function ArrayBuffer(length) { - anInstance(this, $ArrayBuffer, ARRAY_BUFFER); - var byteLength = toIndex(length); - this._b = arrayFill.call(new Array(byteLength), 0); - this[$LENGTH] = byteLength; - }; - - $DataView = function DataView(buffer, byteOffset, byteLength) { - anInstance(this, $DataView, DATA_VIEW); - anInstance(buffer, $ArrayBuffer, DATA_VIEW); - var bufferLength = buffer[$LENGTH]; - var offset = toInteger(byteOffset); - if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!'); - byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); - if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); - this[$BUFFER] = buffer; - this[$OFFSET] = offset; - this[$LENGTH] = byteLength; - }; - - if (DESCRIPTORS) { - addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); - addGetter($DataView, BUFFER, '_b'); - addGetter($DataView, BYTE_LENGTH, '_l'); - addGetter($DataView, BYTE_OFFSET, '_o'); - } - - redefineAll($DataView[PROTOTYPE], { - getInt8: function getInt8(byteOffset) { - return get(this, 1, byteOffset)[0] << 24 >> 24; - }, - getUint8: function getUint8(byteOffset) { - return get(this, 1, byteOffset)[0]; - }, - getInt16: function getInt16(byteOffset /* , littleEndian */) { - var bytes = get(this, 2, byteOffset, arguments[1]); - return (bytes[1] << 8 | bytes[0]) << 16 >> 16; - }, - getUint16: function getUint16(byteOffset /* , littleEndian */) { - var bytes = get(this, 2, byteOffset, arguments[1]); - return bytes[1] << 8 | bytes[0]; - }, - getInt32: function getInt32(byteOffset /* , littleEndian */) { - return unpackI32(get(this, 4, byteOffset, arguments[1])); - }, - getUint32: function getUint32(byteOffset /* , littleEndian */) { - return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; - }, - getFloat32: function getFloat32(byteOffset /* , littleEndian */) { - return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); - }, - getFloat64: function getFloat64(byteOffset /* , littleEndian */) { - return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); - }, - setInt8: function setInt8(byteOffset, value) { - set(this, 1, byteOffset, packI8, value); - }, - setUint8: function setUint8(byteOffset, value) { - set(this, 1, byteOffset, packI8, value); - }, - setInt16: function setInt16(byteOffset, value /* , littleEndian */) { - set(this, 2, byteOffset, packI16, value, arguments[2]); - }, - setUint16: function setUint16(byteOffset, value /* , littleEndian */) { - set(this, 2, byteOffset, packI16, value, arguments[2]); - }, - setInt32: function setInt32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packI32, value, arguments[2]); - }, - setUint32: function setUint32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packI32, value, arguments[2]); - }, - setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packF32, value, arguments[2]); - }, - setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { - set(this, 8, byteOffset, packF64, value, arguments[2]); - } - }); -} else { - if (!fails(function () { - $ArrayBuffer(1); - }) || !fails(function () { - new $ArrayBuffer(-1); // eslint-disable-line no-new - }) || fails(function () { - new $ArrayBuffer(); // eslint-disable-line no-new - new $ArrayBuffer(1.5); // eslint-disable-line no-new - new $ArrayBuffer(NaN); // eslint-disable-line no-new - return $ArrayBuffer.name != ARRAY_BUFFER; - })) { - $ArrayBuffer = function ArrayBuffer(length) { - anInstance(this, $ArrayBuffer); - return new BaseBuffer(toIndex(length)); - }; - var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; - for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) { - if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]); - } - if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer; - } - // iOS Safari 7.x bug - var view = new $DataView(new $ArrayBuffer(2)); - var $setInt8 = $DataView[PROTOTYPE].setInt8; - view.setInt8(0, 2147483648); - view.setInt8(1, 2147483649); - if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], { - setInt8: function setInt8(byteOffset, value) { - $setInt8.call(this, byteOffset, value << 24 >> 24); - }, - setUint8: function setUint8(byteOffset, value) { - $setInt8.call(this, byteOffset, value << 24 >> 24); - } - }, true); -} -setToStringTag($ArrayBuffer, ARRAY_BUFFER); -setToStringTag($DataView, DATA_VIEW); -hide($DataView[PROTOTYPE], $typed.VIEW, true); -exports[ARRAY_BUFFER] = $ArrayBuffer; -exports[DATA_VIEW] = $DataView; - - -/***/ }), -/* 89 */ -/***/ (function(module, exports) { - -module.exports = function (regExp, replace) { - var replacer = replace === Object(replace) ? function (part) { - return replace[part]; - } : replace; - return function (it) { - return String(it).replace(regExp, replacer); - }; -}; - - -/***/ }), -/* 90 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = !__webpack_require__(8) && !__webpack_require__(4)(function () { - return Object.defineProperty(__webpack_require__(62)('div'), 'a', { get: function () { return 7; } }).a != 7; -}); - - -/***/ }), -/* 91 */ -/***/ (function(module, exports, __webpack_require__) { - -exports.f = __webpack_require__(5); - - -/***/ }), -/* 92 */ -/***/ (function(module, exports, __webpack_require__) { - -var has = __webpack_require__(15); -var toIObject = __webpack_require__(11); -var arrayIndexOf = __webpack_require__(50)(false); -var IE_PROTO = __webpack_require__(65)('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; -}; - - -/***/ }), -/* 93 */ -/***/ (function(module, exports, __webpack_require__) { - -var dP = __webpack_require__(7); -var anObject = __webpack_require__(1); -var getKeys = __webpack_require__(31); - -module.exports = __webpack_require__(8) ? 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; -}; - - -/***/ }), -/* 94 */ -/***/ (function(module, exports, __webpack_require__) { - -// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window -var toIObject = __webpack_require__(11); -var gOPN = __webpack_require__(46).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)); -}; - - -/***/ }), -/* 95 */ -/***/ (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__(3); -var anObject = __webpack_require__(1); -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__(16)(Function.call, __webpack_require__(18).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 -}; - - -/***/ }), -/* 96 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var aFunction = __webpack_require__(10); -var isObject = __webpack_require__(3); -var invoke = __webpack_require__(69); -var arraySlice = [].slice; -var factories = {}; - -var construct = function (F, len, args) { - if (!(len in factories)) { - for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']'; - // eslint-disable-next-line no-new-func - factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); - } return factories[len](F, args); -}; - -module.exports = Function.bind || function bind(that /* , ...args */) { - var fn = aFunction(this); - var partArgs = arraySlice.call(arguments, 1); - var bound = function (/* args... */) { - var args = partArgs.concat(arraySlice.call(arguments)); - return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); - }; - if (isObject(fn.prototype)) bound.prototype = fn.prototype; - return bound; -}; - - -/***/ }), -/* 97 */ -/***/ (function(module, exports, __webpack_require__) { - -var cof = __webpack_require__(21); -module.exports = function (it, msg) { - if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg); - return +it; -}; - - -/***/ }), -/* 98 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.3 Number.isInteger(number) -var isObject = __webpack_require__(3); -var floor = Math.floor; -module.exports = function isInteger(it) { - return !isObject(it) && isFinite(it) && floor(it) === it; -}; - - -/***/ }), -/* 99 */ -/***/ (function(module, exports, __webpack_require__) { - -var $parseFloat = __webpack_require__(2).parseFloat; -var $trim = __webpack_require__(47).trim; - -module.exports = 1 / $parseFloat(__webpack_require__(71) + '-0') !== -Infinity ? function parseFloat(str) { - var string = $trim(String(str), 3); - var result = $parseFloat(string); - return result === 0 && string.charAt(0) == '-' ? -0 : result; -} : $parseFloat; - - -/***/ }), -/* 100 */ -/***/ (function(module, exports, __webpack_require__) { - -var $parseInt = __webpack_require__(2).parseInt; -var $trim = __webpack_require__(47).trim; -var ws = __webpack_require__(71); -var hex = /^[-+]?0[xX]/; - -module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) { - var string = $trim(String(str), 3); - return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); -} : $parseInt; - - -/***/ }), -/* 101 */ -/***/ (function(module, exports) { - -// 20.2.2.20 Math.log1p(x) -module.exports = Math.log1p || function log1p(x) { - return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); -}; - - -/***/ }), -/* 102 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.16 Math.fround(x) -var sign = __webpack_require__(72); -var pow = Math.pow; -var EPSILON = pow(2, -52); -var EPSILON32 = pow(2, -23); -var MAX32 = pow(2, 127) * (2 - EPSILON32); -var MIN32 = pow(2, -126); - -var roundTiesToEven = function (n) { - return n + 1 / EPSILON - 1 / EPSILON; -}; - -module.exports = Math.fround || function fround(x) { - var $abs = Math.abs(x); - var $sign = sign(x); - var a, result; - if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; - a = (1 + EPSILON32 / EPSILON) * $abs; - result = a - (a - $abs); - // eslint-disable-next-line no-self-compare - if (result > MAX32 || result != result) return $sign * Infinity; - return $sign * result; -}; - - -/***/ }), -/* 103 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.2.8 IsRegExp(argument) -var isObject = __webpack_require__(3); -var cof = __webpack_require__(21); -var MATCH = __webpack_require__(5)('match'); -module.exports = function (it) { - var isRegExp; - return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); -}; - - -/***/ }), -/* 104 */ -/***/ (function(module, exports, __webpack_require__) { - -// call something on iterator step with safe closing on error -var anObject = __webpack_require__(1); -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; - } -}; - - -/***/ }), -/* 105 */ -/***/ (function(module, exports, __webpack_require__) { - -var aFunction = __webpack_require__(10); -var toObject = __webpack_require__(9); -var IObject = __webpack_require__(44); -var toLength = __webpack_require__(6); - -module.exports = function (that, callbackfn, aLen, memo, isRight) { - aFunction(callbackfn); - var O = toObject(that); - var self = IObject(O); - var length = toLength(O.length); - var index = isRight ? length - 1 : 0; - var i = isRight ? -1 : 1; - if (aLen < 2) for (;;) { - if (index in self) { - memo = self[index]; - index += i; - break; - } - index += i; - if (isRight ? index < 0 : length <= index) { - throw TypeError('Reduce of empty array with no initial value'); - } - } - for (;isRight ? index >= 0 : length > index; index += i) if (index in self) { - memo = callbackfn(memo, self[index], index, O); - } - return memo; -}; - - -/***/ }), -/* 106 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) - -var toObject = __webpack_require__(9); -var toAbsoluteIndex = __webpack_require__(35); -var toLength = __webpack_require__(6); - -module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { - var O = toObject(this); - var len = toLength(O.length); - var to = toAbsoluteIndex(target, len); - var from = toAbsoluteIndex(start, len); - var end = arguments.length > 2 ? arguments[2] : undefined; - var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); - var inc = 1; - if (from < to && to < from + count) { - inc = -1; - from += count - 1; - to += count - 1; - } - while (count-- > 0) { - if (from in O) O[to] = O[from]; - else delete O[to]; - to += inc; - from += inc; - } return O; -}; - - -/***/ }), -/* 107 */ -/***/ (function(module, exports) { - -module.exports = function (exec) { - try { - return { e: false, v: exec() }; - } catch (e) { - return { e: true, v: e }; - } -}; - - -/***/ }), -/* 108 */ -/***/ (function(module, exports, __webpack_require__) { - -var anObject = __webpack_require__(1); -var isObject = __webpack_require__(3); -var newPromiseCapability = __webpack_require__(86); - -module.exports = function (C, x) { - anObject(C); - if (isObject(x) && x.constructor === C) return x; - var promiseCapability = newPromiseCapability.f(C); - var resolve = promiseCapability.resolve; - resolve(x); - return promiseCapability.promise; -}; - - -/***/ }), -/* 109 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var strong = __webpack_require__(110); -var validate = __webpack_require__(43); -var MAP = 'Map'; - -// 23.1 Map Objects -module.exports = __webpack_require__(57)(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); - - -/***/ }), -/* 110 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var dP = __webpack_require__(7).f; -var create = __webpack_require__(32); -var redefineAll = __webpack_require__(39); -var ctx = __webpack_require__(16); -var anInstance = __webpack_require__(38); -var forOf = __webpack_require__(34); -var $iterDefine = __webpack_require__(53); -var step = __webpack_require__(83); -var setSpecies = __webpack_require__(42); -var DESCRIPTORS = __webpack_require__(8); -var fastKey = __webpack_require__(29).fastKey; -var validate = __webpack_require__(43); -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); - } -}; - - -/***/ }), -/* 111 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var strong = __webpack_require__(110); -var validate = __webpack_require__(43); -var SET = 'Set'; - -// 23.2 Set Objects -module.exports = __webpack_require__(57)(SET, function (get) { - return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; -}, { - // 23.2.3.1 Set.prototype.add(value) - add: function add(value) { - return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value); - } -}, strong); - - -/***/ }), -/* 112 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var each = __webpack_require__(20)(0); -var redefine = __webpack_require__(63); -var meta = __webpack_require__(29); -var assign = __webpack_require__(68); -var weak = __webpack_require__(113); -var isObject = __webpack_require__(3); -var fails = __webpack_require__(4); -var validate = __webpack_require__(43); -var WEAK_MAP = 'WeakMap'; -var getWeak = meta.getWeak; -var isExtensible = Object.isExtensible; -var uncaughtFrozenStore = weak.ufstore; -var tmp = {}; -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__(57)(WEAK_MAP, wrapper, methods, weak, true, true); - -// IE11 WeakMap frozen keys fix -if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) { - 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); - }); - }); -} - - -/***/ }), -/* 113 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var redefineAll = __webpack_require__(39); -var getWeak = __webpack_require__(29).getWeak; -var anObject = __webpack_require__(1); -var isObject = __webpack_require__(3); -var anInstance = __webpack_require__(38); -var forOf = __webpack_require__(34); -var createArrayMethod = __webpack_require__(20); -var $has = __webpack_require__(15); -var validate = __webpack_require__(43); -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 -}; - - -/***/ }), -/* 114 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() -var fails = __webpack_require__(4); -var getTime = Date.prototype.getTime; -var $toISOString = Date.prototype.toISOString; - -var lz = function (num) { - return num > 9 ? num : '0' + num; -}; - -// PhantomJS / old WebKit has a broken implementations -module.exports = (fails(function () { - return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; -}) || !fails(function () { - $toISOString.call(new Date(NaN)); -})) ? function toISOString() { - if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value'); - var d = this; - var y = d.getUTCFullYear(); - var m = d.getUTCMilliseconds(); - var s = y < 0 ? '-' : y > 9999 ? '+' : ''; - return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + - '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + - 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + - ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; -} : $toISOString; - - -/***/ }), -/* 115 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/ecma262/#sec-toindex -var toInteger = __webpack_require__(22); -var toLength = __webpack_require__(6); -module.exports = function (it) { - if (it === undefined) return 0; - var number = toInteger(it); - var length = toLength(number); - if (number !== length) throw RangeError('Wrong length!'); - return length; -}; - - -/***/ }), -/* 116 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray -var isArray = __webpack_require__(52); -var isObject = __webpack_require__(3); -var toLength = __webpack_require__(6); -var ctx = __webpack_require__(16); -var IS_CONCAT_SPREADABLE = __webpack_require__(5)('isConcatSpreadable'); - -function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) { - var targetIndex = start; - var sourceIndex = 0; - var mapFn = mapper ? ctx(mapper, thisArg, 3) : false; - var element, spreadable; - - while (sourceIndex < sourceLen) { - if (sourceIndex in source) { - element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; - - spreadable = false; - if (isObject(element)) { - spreadable = element[IS_CONCAT_SPREADABLE]; - spreadable = spreadable !== undefined ? !!spreadable : isArray(element); - } - - if (spreadable && depth > 0) { - targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1; - } else { - if (targetIndex >= 0x1fffffffffffff) throw TypeError(); - target[targetIndex] = element; - } - - targetIndex++; - } - sourceIndex++; - } - return targetIndex; -} - -module.exports = flattenIntoArray; - - -/***/ }), -/* 117 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/tc39/proposal-string-pad-start-end -var toLength = __webpack_require__(6); -var repeat = __webpack_require__(70); -var defined = __webpack_require__(24); - -module.exports = function (that, maxLength, fillString, left) { - var S = String(defined(that)); - var stringLength = S.length; - var fillStr = fillString === undefined ? ' ' : String(fillString); - var intMaxLength = toLength(maxLength); - if (intMaxLength <= stringLength || fillStr == '') return S; - var fillLen = intMaxLength - stringLength; - var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); - if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); - return left ? stringFiller + S : S + stringFiller; -}; - - -/***/ }), -/* 118 */ -/***/ (function(module, exports, __webpack_require__) { - -var getKeys = __webpack_require__(31); -var toIObject = __webpack_require__(11); -var isEnum = __webpack_require__(45).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) if (isEnum.call(O, key = keys[i++])) { - result.push(isEntries ? [key, O[key]] : O[key]); - } return result; - }; -}; - - -/***/ }), -/* 119 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/DavidBruant/Map-Set.prototype.toJSON -var classof = __webpack_require__(37); -var from = __webpack_require__(120); -module.exports = function (NAME) { - return function toJSON() { - if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); - return from(this); - }; -}; - - -/***/ }), -/* 120 */ -/***/ (function(module, exports, __webpack_require__) { - -var forOf = __webpack_require__(34); - -module.exports = function (iter, ITERATOR) { - var result = []; - forOf(iter, false, result.push, result, ITERATOR); - return result; -}; - - -/***/ }), -/* 121 */ -/***/ (function(module, exports) { - -// https://rwaldron.github.io/proposal-math-extensions/ -module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) { - if ( - arguments.length === 0 - // eslint-disable-next-line no-self-compare - || x != x - // eslint-disable-next-line no-self-compare - || inLow != inLow - // eslint-disable-next-line no-self-compare - || inHigh != inHigh - // eslint-disable-next-line no-self-compare - || outLow != outLow - // eslint-disable-next-line no-self-compare - || outHigh != outHigh - ) return NaN; - if (x === Infinity || x === -Infinity) return x; - return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow; -}; - - -/***/ }), -/* 122 */ -/***/ (function(module, exports, __webpack_require__) { - -var classof = __webpack_require__(37); -var ITERATOR = __webpack_require__(5)('iterator'); -var Iterators = __webpack_require__(36); -module.exports = __webpack_require__(12).isIterable = function (it) { - var O = Object(it); - return O[ITERATOR] !== undefined - || '@@iterator' in O - // eslint-disable-next-line no-prototype-builtins - || Iterators.hasOwnProperty(classof(O)); -}; - - -/***/ }), -/* 123 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var path = __webpack_require__(124); -var invoke = __webpack_require__(69); -var aFunction = __webpack_require__(10); -module.exports = function (/* ...pargs */) { - var fn = aFunction(this); - var length = arguments.length; - var pargs = new Array(length); - var i = 0; - var _ = path._; - var holder = false; - while (length > i) if ((pargs[i] = arguments[i++]) === _) holder = true; - return function (/* ...args */) { - var that = this; - var aLen = arguments.length; - var j = 0; - var k = 0; - var args; - if (!holder && !aLen) return invoke(fn, pargs, that); - args = pargs.slice(); - if (holder) for (;length > j; j++) if (args[j] === _) args[j] = arguments[k++]; - while (aLen > k) args.push(arguments[k++]); - return invoke(fn, args, that); - }; -}; - - -/***/ }), -/* 124 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(12); - - -/***/ }), -/* 125 */ -/***/ (function(module, exports, __webpack_require__) { - -var dP = __webpack_require__(7); -var gOPD = __webpack_require__(18); -var ownKeys = __webpack_require__(87); -var toIObject = __webpack_require__(11); - -module.exports = function define(target, mixin) { - var keys = ownKeys(toIObject(mixin)); - var length = keys.length; - var i = 0; - var key; - while (length > i) dP.f(target, key = keys[i++], gOPD.f(mixin, key)); - return target; -}; - - -/***/ }), -/* 126 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(127); -__webpack_require__(129); -__webpack_require__(130); -__webpack_require__(131); -__webpack_require__(132); -__webpack_require__(133); -__webpack_require__(134); -__webpack_require__(135); -__webpack_require__(136); -__webpack_require__(137); -__webpack_require__(138); -__webpack_require__(139); -__webpack_require__(140); -__webpack_require__(141); -__webpack_require__(142); -__webpack_require__(143); -__webpack_require__(145); -__webpack_require__(146); -__webpack_require__(147); -__webpack_require__(148); -__webpack_require__(149); -__webpack_require__(150); -__webpack_require__(151); -__webpack_require__(152); -__webpack_require__(153); -__webpack_require__(154); -__webpack_require__(155); -__webpack_require__(156); -__webpack_require__(157); -__webpack_require__(158); -__webpack_require__(159); -__webpack_require__(160); -__webpack_require__(161); -__webpack_require__(162); -__webpack_require__(163); -__webpack_require__(164); -__webpack_require__(165); -__webpack_require__(166); -__webpack_require__(167); -__webpack_require__(168); -__webpack_require__(169); -__webpack_require__(170); -__webpack_require__(171); -__webpack_require__(172); -__webpack_require__(173); -__webpack_require__(174); -__webpack_require__(175); -__webpack_require__(176); -__webpack_require__(177); -__webpack_require__(178); -__webpack_require__(179); -__webpack_require__(180); -__webpack_require__(181); -__webpack_require__(182); -__webpack_require__(183); -__webpack_require__(184); -__webpack_require__(185); -__webpack_require__(186); -__webpack_require__(187); -__webpack_require__(188); -__webpack_require__(189); -__webpack_require__(190); -__webpack_require__(191); -__webpack_require__(192); -__webpack_require__(193); -__webpack_require__(194); -__webpack_require__(195); -__webpack_require__(196); -__webpack_require__(197); -__webpack_require__(198); -__webpack_require__(199); -__webpack_require__(200); -__webpack_require__(201); -__webpack_require__(202); -__webpack_require__(203); -__webpack_require__(204); -__webpack_require__(205); -__webpack_require__(206); -__webpack_require__(208); -__webpack_require__(209); -__webpack_require__(210); -__webpack_require__(211); -__webpack_require__(212); -__webpack_require__(213); -__webpack_require__(214); -__webpack_require__(215); -__webpack_require__(216); -__webpack_require__(217); -__webpack_require__(218); -__webpack_require__(219); -__webpack_require__(82); -__webpack_require__(220); -__webpack_require__(221); -__webpack_require__(109); -__webpack_require__(111); -__webpack_require__(112); -__webpack_require__(222); -__webpack_require__(223); -__webpack_require__(224); -__webpack_require__(225); -__webpack_require__(226); -__webpack_require__(227); -__webpack_require__(228); -__webpack_require__(229); -__webpack_require__(230); -__webpack_require__(231); -__webpack_require__(232); -__webpack_require__(233); -__webpack_require__(234); -__webpack_require__(235); -__webpack_require__(236); -__webpack_require__(237); -__webpack_require__(238); -__webpack_require__(239); -__webpack_require__(240); -__webpack_require__(241); -__webpack_require__(242); -__webpack_require__(243); -__webpack_require__(244); -__webpack_require__(245); -__webpack_require__(246); -__webpack_require__(247); -__webpack_require__(248); -__webpack_require__(249); -__webpack_require__(250); -__webpack_require__(251); -__webpack_require__(252); -__webpack_require__(253); -__webpack_require__(254); -__webpack_require__(255); -__webpack_require__(256); -__webpack_require__(257); -__webpack_require__(258); -__webpack_require__(259); -__webpack_require__(261); -__webpack_require__(262); -__webpack_require__(263); -__webpack_require__(264); -__webpack_require__(265); -__webpack_require__(266); -__webpack_require__(267); -__webpack_require__(268); -__webpack_require__(269); -__webpack_require__(270); -__webpack_require__(271); -__webpack_require__(272); -__webpack_require__(273); -__webpack_require__(274); -__webpack_require__(275); -__webpack_require__(276); -__webpack_require__(277); -__webpack_require__(278); -__webpack_require__(279); -__webpack_require__(280); -__webpack_require__(281); -__webpack_require__(282); -__webpack_require__(283); -__webpack_require__(284); -__webpack_require__(285); -__webpack_require__(286); -__webpack_require__(287); -__webpack_require__(288); -__webpack_require__(289); -__webpack_require__(290); -__webpack_require__(291); -__webpack_require__(292); -__webpack_require__(293); -__webpack_require__(294); -__webpack_require__(295); -__webpack_require__(296); -__webpack_require__(297); -__webpack_require__(298); -__webpack_require__(299); -__webpack_require__(300); -__webpack_require__(301); -__webpack_require__(302); -__webpack_require__(303); -__webpack_require__(304); -__webpack_require__(305); -__webpack_require__(306); -__webpack_require__(307); -__webpack_require__(308); -__webpack_require__(309); -__webpack_require__(310); -__webpack_require__(311); -__webpack_require__(48); -__webpack_require__(313); -__webpack_require__(122); -__webpack_require__(314); -__webpack_require__(315); -__webpack_require__(316); -__webpack_require__(317); -__webpack_require__(318); -__webpack_require__(319); -__webpack_require__(320); -__webpack_require__(321); -__webpack_require__(322); -module.exports = __webpack_require__(323); - - -/***/ }), -/* 127 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// ECMAScript 6 symbols shim -var global = __webpack_require__(2); -var has = __webpack_require__(15); -var DESCRIPTORS = __webpack_require__(8); -var $export = __webpack_require__(0); -var redefine = __webpack_require__(63); -var META = __webpack_require__(29).KEY; -var $fails = __webpack_require__(4); -var shared = __webpack_require__(49); -var setToStringTag = __webpack_require__(41); -var uid = __webpack_require__(40); -var wks = __webpack_require__(5); -var wksExt = __webpack_require__(91); -var wksDefine = __webpack_require__(64); -var enumKeys = __webpack_require__(128); -var isArray = __webpack_require__(52); -var anObject = __webpack_require__(1); -var isObject = __webpack_require__(3); -var toIObject = __webpack_require__(11); -var toPrimitive = __webpack_require__(27); -var createDesc = __webpack_require__(28); -var _create = __webpack_require__(32); -var gOPNExt = __webpack_require__(94); -var $GOPD = __webpack_require__(18); -var $DP = __webpack_require__(7); -var $keys = __webpack_require__(31); -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'; -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__(46).f = gOPNExt.f = $getOwnPropertyNames; - __webpack_require__(45).f = $propertyIsEnumerable; - __webpack_require__(51).f = $getOwnPropertySymbols; - - if (DESCRIPTORS && !__webpack_require__(30)) { - 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 -}); - -// 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__(17)($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); - - -/***/ }), -/* 128 */ -/***/ (function(module, exports, __webpack_require__) { - -// all enumerable object keys, includes symbols -var getKeys = __webpack_require__(31); -var gOPS = __webpack_require__(51); -var pIE = __webpack_require__(45); -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; -}; - - -/***/ }), -/* 129 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) -$export($export.S + $export.F * !__webpack_require__(8), 'Object', { defineProperty: __webpack_require__(7).f }); - - -/***/ }), -/* 130 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) -$export($export.S + $export.F * !__webpack_require__(8), 'Object', { defineProperties: __webpack_require__(93) }); - - -/***/ }), -/* 131 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) -var toIObject = __webpack_require__(11); -var $getOwnPropertyDescriptor = __webpack_require__(18).f; - -__webpack_require__(23)('getOwnPropertyDescriptor', function () { - return function getOwnPropertyDescriptor(it, key) { - return $getOwnPropertyDescriptor(toIObject(it), key); - }; -}); - - -/***/ }), -/* 132 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -$export($export.S, 'Object', { create: __webpack_require__(32) }); - - -/***/ }), -/* 133 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.9 Object.getPrototypeOf(O) -var toObject = __webpack_require__(9); -var $getPrototypeOf = __webpack_require__(13); - -__webpack_require__(23)('getPrototypeOf', function () { - return function getPrototypeOf(it) { - return $getPrototypeOf(toObject(it)); - }; -}); - - -/***/ }), -/* 134 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.14 Object.keys(O) -var toObject = __webpack_require__(9); -var $keys = __webpack_require__(31); - -__webpack_require__(23)('keys', function () { - return function keys(it) { - return $keys(toObject(it)); - }; -}); - - -/***/ }), -/* 135 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.7 Object.getOwnPropertyNames(O) -__webpack_require__(23)('getOwnPropertyNames', function () { - return __webpack_require__(94).f; -}); - - -/***/ }), -/* 136 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.5 Object.freeze(O) -var isObject = __webpack_require__(3); -var meta = __webpack_require__(29).onFreeze; - -__webpack_require__(23)('freeze', function ($freeze) { - return function freeze(it) { - return $freeze && isObject(it) ? $freeze(meta(it)) : it; - }; -}); - - -/***/ }), -/* 137 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.17 Object.seal(O) -var isObject = __webpack_require__(3); -var meta = __webpack_require__(29).onFreeze; - -__webpack_require__(23)('seal', function ($seal) { - return function seal(it) { - return $seal && isObject(it) ? $seal(meta(it)) : it; - }; -}); - - -/***/ }), -/* 138 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.15 Object.preventExtensions(O) -var isObject = __webpack_require__(3); -var meta = __webpack_require__(29).onFreeze; - -__webpack_require__(23)('preventExtensions', function ($preventExtensions) { - return function preventExtensions(it) { - return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; - }; -}); - - -/***/ }), -/* 139 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.12 Object.isFrozen(O) -var isObject = __webpack_require__(3); - -__webpack_require__(23)('isFrozen', function ($isFrozen) { - return function isFrozen(it) { - return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; - }; -}); - - -/***/ }), -/* 140 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.13 Object.isSealed(O) -var isObject = __webpack_require__(3); - -__webpack_require__(23)('isSealed', function ($isSealed) { - return function isSealed(it) { - return isObject(it) ? $isSealed ? $isSealed(it) : false : true; - }; -}); - - -/***/ }), -/* 141 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.11 Object.isExtensible(O) -var isObject = __webpack_require__(3); - -__webpack_require__(23)('isExtensible', function ($isExtensible) { - return function isExtensible(it) { - return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; - }; -}); - - -/***/ }), -/* 142 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.3.1 Object.assign(target, source) -var $export = __webpack_require__(0); - -$export($export.S + $export.F, 'Object', { assign: __webpack_require__(68) }); - - -/***/ }), -/* 143 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.3.10 Object.is(value1, value2) -var $export = __webpack_require__(0); -$export($export.S, 'Object', { is: __webpack_require__(144) }); - - -/***/ }), -/* 144 */ -/***/ (function(module, exports) { - -// 7.2.9 SameValue(x, y) -module.exports = Object.is || function is(x, y) { - // eslint-disable-next-line no-self-compare - return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; -}; - - -/***/ }), -/* 145 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.3.19 Object.setPrototypeOf(O, proto) -var $export = __webpack_require__(0); -$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(95).set }); - - -/***/ }), -/* 146 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) -var $export = __webpack_require__(0); - -$export($export.P, 'Function', { bind: __webpack_require__(96) }); - - -/***/ }), -/* 147 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var isObject = __webpack_require__(3); -var getPrototypeOf = __webpack_require__(13); -var HAS_INSTANCE = __webpack_require__(5)('hasInstance'); -var FunctionProto = Function.prototype; -// 19.2.3.6 Function.prototype[@@hasInstance](V) -if (!(HAS_INSTANCE in FunctionProto)) __webpack_require__(7).f(FunctionProto, HAS_INSTANCE, { value: function (O) { - if (typeof this != 'function' || !isObject(O)) return false; - if (!isObject(this.prototype)) return O instanceof this; - // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: - while (O = getPrototypeOf(O)) if (this.prototype === O) return true; - return false; -} }); - - -/***/ }), -/* 148 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var toInteger = __webpack_require__(22); -var aNumberValue = __webpack_require__(97); -var repeat = __webpack_require__(70); -var $toFixed = 1.0.toFixed; -var floor = Math.floor; -var data = [0, 0, 0, 0, 0, 0]; -var ERROR = 'Number.toFixed: incorrect invocation!'; -var ZERO = '0'; - -var multiply = function (n, c) { - var i = -1; - var c2 = c; - while (++i < 6) { - c2 += n * data[i]; - data[i] = c2 % 1e7; - c2 = floor(c2 / 1e7); - } -}; -var divide = function (n) { - var i = 6; - var c = 0; - while (--i >= 0) { - c += data[i]; - data[i] = floor(c / n); - c = (c % n) * 1e7; - } -}; -var numToString = function () { - var i = 6; - var s = ''; - while (--i >= 0) { - if (s !== '' || i === 0 || data[i] !== 0) { - var t = String(data[i]); - s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; - } - } return s; -}; -var pow = function (x, n, acc) { - return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); -}; -var log = function (x) { - var n = 0; - var x2 = x; - while (x2 >= 4096) { - n += 12; - x2 /= 4096; - } - while (x2 >= 2) { - n += 1; - x2 /= 2; - } return n; -}; - -$export($export.P + $export.F * (!!$toFixed && ( - 0.00008.toFixed(3) !== '0.000' || - 0.9.toFixed(0) !== '1' || - 1.255.toFixed(2) !== '1.25' || - 1000000000000000128.0.toFixed(0) !== '1000000000000000128' -) || !__webpack_require__(4)(function () { - // V8 ~ Android 4.3- - $toFixed.call({}); -})), 'Number', { - toFixed: function toFixed(fractionDigits) { - var x = aNumberValue(this, ERROR); - var f = toInteger(fractionDigits); - var s = ''; - var m = ZERO; - var e, z, j, k; - if (f < 0 || f > 20) throw RangeError(ERROR); - // eslint-disable-next-line no-self-compare - if (x != x) return 'NaN'; - if (x <= -1e21 || x >= 1e21) return String(x); - if (x < 0) { - s = '-'; - x = -x; - } - if (x > 1e-21) { - e = log(x * pow(2, 69, 1)) - 69; - z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); - z *= 0x10000000000000; - e = 52 - e; - if (e > 0) { - multiply(0, z); - j = f; - while (j >= 7) { - multiply(1e7, 0); - j -= 7; - } - multiply(pow(10, j, 1), 0); - j = e - 1; - while (j >= 23) { - divide(1 << 23); - j -= 23; - } - divide(1 << j); - multiply(1, 1); - divide(2); - m = numToString(); - } else { - multiply(0, z); - multiply(1 << -e, 0); - m = numToString() + repeat.call(ZERO, f); - } - } - if (f > 0) { - k = m.length; - m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); - } else { - m = s + m; - } return m; - } -}); - - -/***/ }), -/* 149 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $fails = __webpack_require__(4); -var aNumberValue = __webpack_require__(97); -var $toPrecision = 1.0.toPrecision; - -$export($export.P + $export.F * ($fails(function () { - // IE7- - return $toPrecision.call(1, undefined) !== '1'; -}) || !$fails(function () { - // V8 ~ Android 4.3- - $toPrecision.call({}); -})), 'Number', { - toPrecision: function toPrecision(precision) { - var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); - return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); - } -}); - - -/***/ }), -/* 150 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.1 Number.EPSILON -var $export = __webpack_require__(0); - -$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) }); - - -/***/ }), -/* 151 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.2 Number.isFinite(number) -var $export = __webpack_require__(0); -var _isFinite = __webpack_require__(2).isFinite; - -$export($export.S, 'Number', { - isFinite: function isFinite(it) { - return typeof it == 'number' && _isFinite(it); - } -}); - - -/***/ }), -/* 152 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.3 Number.isInteger(number) -var $export = __webpack_require__(0); - -$export($export.S, 'Number', { isInteger: __webpack_require__(98) }); - - -/***/ }), -/* 153 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.4 Number.isNaN(number) -var $export = __webpack_require__(0); - -$export($export.S, 'Number', { - isNaN: function isNaN(number) { - // eslint-disable-next-line no-self-compare - return number != number; - } -}); - - -/***/ }), -/* 154 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.5 Number.isSafeInteger(number) -var $export = __webpack_require__(0); -var isInteger = __webpack_require__(98); -var abs = Math.abs; - -$export($export.S, 'Number', { - isSafeInteger: function isSafeInteger(number) { - return isInteger(number) && abs(number) <= 0x1fffffffffffff; - } -}); - - -/***/ }), -/* 155 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.6 Number.MAX_SAFE_INTEGER -var $export = __webpack_require__(0); - -$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); - - -/***/ }), -/* 156 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.10 Number.MIN_SAFE_INTEGER -var $export = __webpack_require__(0); - -$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff }); - - -/***/ }), -/* 157 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var $parseFloat = __webpack_require__(99); -// 20.1.2.12 Number.parseFloat(string) -$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat }); - - -/***/ }), -/* 158 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var $parseInt = __webpack_require__(100); -// 20.1.2.13 Number.parseInt(string, radix) -$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt }); - - -/***/ }), -/* 159 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var $parseInt = __webpack_require__(100); -// 18.2.5 parseInt(string, radix) -$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt }); - - -/***/ }), -/* 160 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var $parseFloat = __webpack_require__(99); -// 18.2.4 parseFloat(string) -$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat }); - - -/***/ }), -/* 161 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.3 Math.acosh(x) -var $export = __webpack_require__(0); -var log1p = __webpack_require__(101); -var sqrt = Math.sqrt; -var $acosh = Math.acosh; - -$export($export.S + $export.F * !($acosh - // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 - && Math.floor($acosh(Number.MAX_VALUE)) == 710 - // Tor Browser bug: Math.acosh(Infinity) -> NaN - && $acosh(Infinity) == Infinity -), 'Math', { - acosh: function acosh(x) { - return (x = +x) < 1 ? NaN : x > 94906265.62425156 - ? Math.log(x) + Math.LN2 - : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); - } -}); - - -/***/ }), -/* 162 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.5 Math.asinh(x) -var $export = __webpack_require__(0); -var $asinh = Math.asinh; - -function asinh(x) { - return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); -} - -// Tor Browser bug: Math.asinh(0) -> -0 -$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh }); - - -/***/ }), -/* 163 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.7 Math.atanh(x) -var $export = __webpack_require__(0); -var $atanh = Math.atanh; - -// Tor Browser bug: Math.atanh(-0) -> 0 -$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { - atanh: function atanh(x) { - return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; - } -}); - - -/***/ }), -/* 164 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.9 Math.cbrt(x) -var $export = __webpack_require__(0); -var sign = __webpack_require__(72); - -$export($export.S, 'Math', { - cbrt: function cbrt(x) { - return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); - } -}); - - -/***/ }), -/* 165 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.11 Math.clz32(x) -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - clz32: function clz32(x) { - return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; - } -}); - - -/***/ }), -/* 166 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.12 Math.cosh(x) -var $export = __webpack_require__(0); -var exp = Math.exp; - -$export($export.S, 'Math', { - cosh: function cosh(x) { - return (exp(x = +x) + exp(-x)) / 2; - } -}); - - -/***/ }), -/* 167 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.14 Math.expm1(x) -var $export = __webpack_require__(0); -var $expm1 = __webpack_require__(73); - -$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 }); - - -/***/ }), -/* 168 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.16 Math.fround(x) -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { fround: __webpack_require__(102) }); - - -/***/ }), -/* 169 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) -var $export = __webpack_require__(0); -var abs = Math.abs; - -$export($export.S, 'Math', { - hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars - var sum = 0; - var i = 0; - var aLen = arguments.length; - var larg = 0; - var arg, div; - while (i < aLen) { - arg = abs(arguments[i++]); - if (larg < arg) { - div = larg / arg; - sum = sum * div * div + 1; - larg = arg; - } else if (arg > 0) { - div = arg / larg; - sum += div * div; - } else sum += arg; - } - return larg === Infinity ? Infinity : larg * Math.sqrt(sum); - } -}); - - -/***/ }), -/* 170 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.18 Math.imul(x, y) -var $export = __webpack_require__(0); -var $imul = Math.imul; - -// some WebKit versions fails with big numbers, some has wrong arity -$export($export.S + $export.F * __webpack_require__(4)(function () { - return $imul(0xffffffff, 5) != -5 || $imul.length != 2; -}), 'Math', { - imul: function imul(x, y) { - var UINT16 = 0xffff; - var xn = +x; - var yn = +y; - var xl = UINT16 & xn; - var yl = UINT16 & yn; - return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); - } -}); - - -/***/ }), -/* 171 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.21 Math.log10(x) -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - log10: function log10(x) { - return Math.log(x) * Math.LOG10E; - } -}); - - -/***/ }), -/* 172 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.20 Math.log1p(x) -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { log1p: __webpack_require__(101) }); - - -/***/ }), -/* 173 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.22 Math.log2(x) -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - log2: function log2(x) { - return Math.log(x) / Math.LN2; - } -}); - - -/***/ }), -/* 174 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.28 Math.sign(x) -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { sign: __webpack_require__(72) }); - - -/***/ }), -/* 175 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.30 Math.sinh(x) -var $export = __webpack_require__(0); -var expm1 = __webpack_require__(73); -var exp = Math.exp; - -// V8 near Chromium 38 has a problem with very small numbers -$export($export.S + $export.F * __webpack_require__(4)(function () { - return !Math.sinh(-2e-17) != -2e-17; -}), 'Math', { - sinh: function sinh(x) { - return Math.abs(x = +x) < 1 - ? (expm1(x) - expm1(-x)) / 2 - : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); - } -}); - - -/***/ }), -/* 176 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.33 Math.tanh(x) -var $export = __webpack_require__(0); -var expm1 = __webpack_require__(73); -var exp = Math.exp; - -$export($export.S, 'Math', { - tanh: function tanh(x) { - var a = expm1(x = +x); - var b = expm1(-x); - return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); - } -}); - - -/***/ }), -/* 177 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.34 Math.trunc(x) -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - trunc: function trunc(it) { - return (it > 0 ? Math.floor : Math.ceil)(it); - } -}); - - -/***/ }), -/* 178 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var toAbsoluteIndex = __webpack_require__(35); -var fromCharCode = String.fromCharCode; -var $fromCodePoint = String.fromCodePoint; - -// length should be 1, old FF problem -$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { - // 21.1.2.2 String.fromCodePoint(...codePoints) - fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars - var res = []; - var aLen = arguments.length; - var i = 0; - var code; - while (aLen > i) { - code = +arguments[i++]; - if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); - res.push(code < 0x10000 - ? fromCharCode(code) - : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) - ); - } return res.join(''); - } -}); - - -/***/ }), -/* 179 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var toIObject = __webpack_require__(11); -var toLength = __webpack_require__(6); - -$export($export.S, 'String', { - // 21.1.2.4 String.raw(callSite, ...substitutions) - raw: function raw(callSite) { - var tpl = toIObject(callSite.raw); - var len = toLength(tpl.length); - var aLen = arguments.length; - var res = []; - var i = 0; - while (len > i) { - res.push(String(tpl[i++])); - if (i < aLen) res.push(String(arguments[i])); - } return res.join(''); - } -}); - - -/***/ }), -/* 180 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 21.1.3.25 String.prototype.trim() -__webpack_require__(47)('trim', function ($trim) { - return function trim() { - return $trim(this, 3); - }; -}); - - -/***/ }), -/* 181 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $at = __webpack_require__(74)(false); -$export($export.P, 'String', { - // 21.1.3.3 String.prototype.codePointAt(pos) - codePointAt: function codePointAt(pos) { - return $at(this, pos); - } -}); - - -/***/ }), -/* 182 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) - -var $export = __webpack_require__(0); -var toLength = __webpack_require__(6); -var context = __webpack_require__(75); -var ENDS_WITH = 'endsWith'; -var $endsWith = ''[ENDS_WITH]; - -$export($export.P + $export.F * __webpack_require__(76)(ENDS_WITH), 'String', { - endsWith: function endsWith(searchString /* , endPosition = @length */) { - var that = context(this, searchString, ENDS_WITH); - var endPosition = arguments.length > 1 ? arguments[1] : undefined; - var len = toLength(that.length); - var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); - var search = String(searchString); - return $endsWith - ? $endsWith.call(that, search, end) - : that.slice(end - search.length, end) === search; - } -}); - - -/***/ }), -/* 183 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// 21.1.3.7 String.prototype.includes(searchString, position = 0) - -var $export = __webpack_require__(0); -var context = __webpack_require__(75); -var INCLUDES = 'includes'; - -$export($export.P + $export.F * __webpack_require__(76)(INCLUDES), 'String', { - includes: function includes(searchString /* , position = 0 */) { - return !!~context(this, searchString, INCLUDES) - .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); - } -}); - - -/***/ }), -/* 184 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); - -$export($export.P, 'String', { - // 21.1.3.13 String.prototype.repeat(count) - repeat: __webpack_require__(70) -}); - - -/***/ }), -/* 185 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// 21.1.3.18 String.prototype.startsWith(searchString [, position ]) - -var $export = __webpack_require__(0); -var toLength = __webpack_require__(6); -var context = __webpack_require__(75); -var STARTS_WITH = 'startsWith'; -var $startsWith = ''[STARTS_WITH]; - -$export($export.P + $export.F * __webpack_require__(76)(STARTS_WITH), 'String', { - startsWith: function startsWith(searchString /* , position = 0 */) { - var that = context(this, searchString, STARTS_WITH); - var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); - var search = String(searchString); - return $startsWith - ? $startsWith.call(that, search, index) - : that.slice(index, index + search.length) === search; - } -}); - - -/***/ }), -/* 186 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $at = __webpack_require__(74)(true); - -// 21.1.3.27 String.prototype[@@iterator]() -__webpack_require__(53)(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 }; -}); - - -/***/ }), -/* 187 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.2 String.prototype.anchor(name) -__webpack_require__(14)('anchor', function (createHTML) { - return function anchor(name) { - return createHTML(this, 'a', 'name', name); - }; -}); - - -/***/ }), -/* 188 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.3 String.prototype.big() -__webpack_require__(14)('big', function (createHTML) { - return function big() { - return createHTML(this, 'big', '', ''); - }; -}); - - -/***/ }), -/* 189 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.4 String.prototype.blink() -__webpack_require__(14)('blink', function (createHTML) { - return function blink() { - return createHTML(this, 'blink', '', ''); - }; -}); - - -/***/ }), -/* 190 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.5 String.prototype.bold() -__webpack_require__(14)('bold', function (createHTML) { - return function bold() { - return createHTML(this, 'b', '', ''); - }; -}); - - -/***/ }), -/* 191 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.6 String.prototype.fixed() -__webpack_require__(14)('fixed', function (createHTML) { - return function fixed() { - return createHTML(this, 'tt', '', ''); - }; -}); - - -/***/ }), -/* 192 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.7 String.prototype.fontcolor(color) -__webpack_require__(14)('fontcolor', function (createHTML) { - return function fontcolor(color) { - return createHTML(this, 'font', 'color', color); - }; -}); - - -/***/ }), -/* 193 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.8 String.prototype.fontsize(size) -__webpack_require__(14)('fontsize', function (createHTML) { - return function fontsize(size) { - return createHTML(this, 'font', 'size', size); - }; -}); - - -/***/ }), -/* 194 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.9 String.prototype.italics() -__webpack_require__(14)('italics', function (createHTML) { - return function italics() { - return createHTML(this, 'i', '', ''); - }; -}); - - -/***/ }), -/* 195 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.10 String.prototype.link(url) -__webpack_require__(14)('link', function (createHTML) { - return function link(url) { - return createHTML(this, 'a', 'href', url); - }; -}); - - -/***/ }), -/* 196 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.11 String.prototype.small() -__webpack_require__(14)('small', function (createHTML) { - return function small() { - return createHTML(this, 'small', '', ''); - }; -}); - - -/***/ }), -/* 197 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.12 String.prototype.strike() -__webpack_require__(14)('strike', function (createHTML) { - return function strike() { - return createHTML(this, 'strike', '', ''); - }; -}); - - -/***/ }), -/* 198 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.13 String.prototype.sub() -__webpack_require__(14)('sub', function (createHTML) { - return function sub() { - return createHTML(this, 'sub', '', ''); - }; -}); - - -/***/ }), -/* 199 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.14 String.prototype.sup() -__webpack_require__(14)('sup', function (createHTML) { - return function sup() { - return createHTML(this, 'sup', '', ''); - }; -}); - - -/***/ }), -/* 200 */ -/***/ (function(module, exports, __webpack_require__) { - -// 22.1.2.2 / 15.4.3.2 Array.isArray(arg) -var $export = __webpack_require__(0); - -$export($export.S, 'Array', { isArray: __webpack_require__(52) }); - - -/***/ }), -/* 201 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var ctx = __webpack_require__(16); -var $export = __webpack_require__(0); -var toObject = __webpack_require__(9); -var call = __webpack_require__(104); -var isArrayIter = __webpack_require__(77); -var toLength = __webpack_require__(6); -var createProperty = __webpack_require__(78); -var getIterFn = __webpack_require__(48); - -$export($export.S + $export.F * !__webpack_require__(79)(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; - } -}); - - -/***/ }), -/* 202 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var createProperty = __webpack_require__(78); - -// WebKit Array.of isn't generic -$export($export.S + $export.F * __webpack_require__(4)(function () { - function F() { /* empty */ } - return !(Array.of.call(F) instanceof F); -}), 'Array', { - // 22.1.2.3 Array.of( ...items) - of: function of(/* ...args */) { - var index = 0; - var aLen = arguments.length; - var result = new (typeof this == 'function' ? this : Array)(aLen); - while (aLen > index) createProperty(result, index, arguments[index++]); - result.length = aLen; - return result; - } -}); - - -/***/ }), -/* 203 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 22.1.3.13 Array.prototype.join(separator) -var $export = __webpack_require__(0); -var toIObject = __webpack_require__(11); -var arrayJoin = [].join; - -// fallback for not array-like strings -$export($export.P + $export.F * (__webpack_require__(44) != Object || !__webpack_require__(19)(arrayJoin)), 'Array', { - join: function join(separator) { - return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); - } -}); - - -/***/ }), -/* 204 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var html = __webpack_require__(67); -var cof = __webpack_require__(21); -var toAbsoluteIndex = __webpack_require__(35); -var toLength = __webpack_require__(6); -var arraySlice = [].slice; - -// fallback for not array-like ES3 strings and DOM objects -$export($export.P + $export.F * __webpack_require__(4)(function () { - if (html) arraySlice.call(html); -}), 'Array', { - slice: function slice(begin, end) { - var len = toLength(this.length); - var klass = cof(this); - end = end === undefined ? len : end; - if (klass == 'Array') return arraySlice.call(this, begin, end); - var start = toAbsoluteIndex(begin, len); - var upTo = toAbsoluteIndex(end, len); - var size = toLength(upTo - start); - var cloned = new Array(size); - var i = 0; - for (; i < size; i++) cloned[i] = klass == 'String' - ? this.charAt(start + i) - : this[start + i]; - return cloned; - } -}); - - -/***/ }), -/* 205 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var aFunction = __webpack_require__(10); -var toObject = __webpack_require__(9); -var fails = __webpack_require__(4); -var $sort = [].sort; -var test = [1, 2, 3]; - -$export($export.P + $export.F * (fails(function () { - // IE8- - test.sort(undefined); -}) || !fails(function () { - // V8 bug - test.sort(null); - // Old WebKit -}) || !__webpack_require__(19)($sort)), 'Array', { - // 22.1.3.25 Array.prototype.sort(comparefn) - sort: function sort(comparefn) { - return comparefn === undefined - ? $sort.call(toObject(this)) - : $sort.call(toObject(this), aFunction(comparefn)); - } -}); - - -/***/ }), -/* 206 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $forEach = __webpack_require__(20)(0); -var STRICT = __webpack_require__(19)([].forEach, true); - -$export($export.P + $export.F * !STRICT, 'Array', { - // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) - forEach: function forEach(callbackfn /* , thisArg */) { - return $forEach(this, callbackfn, arguments[1]); - } -}); - - -/***/ }), -/* 207 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(3); -var isArray = __webpack_require__(52); -var SPECIES = __webpack_require__(5)('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; -}; - - -/***/ }), -/* 208 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $map = __webpack_require__(20)(1); - -$export($export.P + $export.F * !__webpack_require__(19)([].map, true), 'Array', { - // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) - map: function map(callbackfn /* , thisArg */) { - return $map(this, callbackfn, arguments[1]); - } -}); - - -/***/ }), -/* 209 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $filter = __webpack_require__(20)(2); - -$export($export.P + $export.F * !__webpack_require__(19)([].filter, true), 'Array', { - // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) - filter: function filter(callbackfn /* , thisArg */) { - return $filter(this, callbackfn, arguments[1]); - } -}); - - -/***/ }), -/* 210 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $some = __webpack_require__(20)(3); - -$export($export.P + $export.F * !__webpack_require__(19)([].some, true), 'Array', { - // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) - some: function some(callbackfn /* , thisArg */) { - return $some(this, callbackfn, arguments[1]); - } -}); - - -/***/ }), -/* 211 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $every = __webpack_require__(20)(4); - -$export($export.P + $export.F * !__webpack_require__(19)([].every, true), 'Array', { - // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) - every: function every(callbackfn /* , thisArg */) { - return $every(this, callbackfn, arguments[1]); - } -}); - - -/***/ }), -/* 212 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $reduce = __webpack_require__(105); - -$export($export.P + $export.F * !__webpack_require__(19)([].reduce, true), 'Array', { - // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) - reduce: function reduce(callbackfn /* , initialValue */) { - return $reduce(this, callbackfn, arguments.length, arguments[1], false); - } -}); - - -/***/ }), -/* 213 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $reduce = __webpack_require__(105); - -$export($export.P + $export.F * !__webpack_require__(19)([].reduceRight, true), 'Array', { - // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) - reduceRight: function reduceRight(callbackfn /* , initialValue */) { - return $reduce(this, callbackfn, arguments.length, arguments[1], true); - } -}); - - -/***/ }), -/* 214 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $indexOf = __webpack_require__(50)(false); -var $native = [].indexOf; -var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; - -$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(19)($native)), 'Array', { - // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) - indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { - return NEGATIVE_ZERO - // convert -0 to +0 - ? $native.apply(this, arguments) || 0 - : $indexOf(this, searchElement, arguments[1]); - } -}); - - -/***/ }), -/* 215 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var toIObject = __webpack_require__(11); -var toInteger = __webpack_require__(22); -var toLength = __webpack_require__(6); -var $native = [].lastIndexOf; -var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; - -$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(19)($native)), 'Array', { - // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) - lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { - // convert -0 to +0 - if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0; - var O = toIObject(this); - var length = toLength(O.length); - var index = length - 1; - if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1])); - if (index < 0) index = length + index; - for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0; - return -1; - } -}); - - -/***/ }), -/* 216 */ -/***/ (function(module, exports, __webpack_require__) { - -// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) -var $export = __webpack_require__(0); - -$export($export.P, 'Array', { copyWithin: __webpack_require__(106) }); - -__webpack_require__(33)('copyWithin'); - - -/***/ }), -/* 217 */ -/***/ (function(module, exports, __webpack_require__) { - -// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) -var $export = __webpack_require__(0); - -$export($export.P, 'Array', { fill: __webpack_require__(81) }); - -__webpack_require__(33)('fill'); - - -/***/ }), -/* 218 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) -var $export = __webpack_require__(0); -var $find = __webpack_require__(20)(5); -var KEY = 'find'; -var forced = true; -// Shouldn't skip holes -if (KEY in []) Array(1)[KEY](function () { forced = false; }); -$export($export.P + $export.F * forced, 'Array', { - find: function find(callbackfn /* , that = undefined */) { - return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } -}); -__webpack_require__(33)(KEY); - - -/***/ }), -/* 219 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) -var $export = __webpack_require__(0); -var $find = __webpack_require__(20)(6); -var KEY = 'findIndex'; -var forced = true; -// Shouldn't skip holes -if (KEY in []) Array(1)[KEY](function () { forced = false; }); -$export($export.P + $export.F * forced, 'Array', { - findIndex: function findIndex(callbackfn /* , that = undefined */) { - return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } -}); -__webpack_require__(33)(KEY); - - -/***/ }), -/* 220 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(42)('Array'); - - -/***/ }), -/* 221 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var LIBRARY = __webpack_require__(30); -var global = __webpack_require__(2); -var ctx = __webpack_require__(16); -var classof = __webpack_require__(37); -var $export = __webpack_require__(0); -var isObject = __webpack_require__(3); -var aFunction = __webpack_require__(10); -var anInstance = __webpack_require__(38); -var forOf = __webpack_require__(34); -var speciesConstructor = __webpack_require__(55); -var task = __webpack_require__(84).set; -var microtask = __webpack_require__(85)(); -var newPromiseCapabilityModule = __webpack_require__(86); -var perform = __webpack_require__(107); -var userAgent = __webpack_require__(56); -var promiseResolve = __webpack_require__(108); -var PROMISE = 'Promise'; -var TypeError = global.TypeError; -var process = global.process; -var versions = process && process.versions; -var v8 = versions && versions.v8 || ''; -var $Promise = global[PROMISE]; -var isNode = classof(process) == 'process'; -var empty = function () { /* empty */ }; -var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; -var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; - -var USE_NATIVE = !!function () { - try { - // correct subclassing with @@species support - var promise = $Promise.resolve(1); - var FakePromise = (promise.constructor = {})[__webpack_require__(5)('species')] = function (exec) { - exec(empty, empty); - }; - // unhandled rejections tracking support, NodeJS Promise without it fails @@species test - return (isNode || typeof PromiseRejectionEvent == 'function') - && promise.then(empty) instanceof FakePromise - // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables - // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 - // we can't detect it synchronously, so just check versions - && v8.indexOf('6.6') !== 0 - && userAgent.indexOf('Chrome/66') === -1; - } catch (e) { /* empty */ } -}(); - -// helpers -var isThenable = function (it) { - var then; - return isObject(it) && typeof (then = it.then) == 'function' ? then : false; -}; -var notify = function (promise, isReject) { - if (promise._n) return; - promise._n = true; - var chain = promise._c; - microtask(function () { - var value = promise._v; - var ok = promise._s == 1; - var i = 0; - var run = function (reaction) { - var handler = ok ? reaction.ok : reaction.fail; - var resolve = reaction.resolve; - var reject = reaction.reject; - var domain = reaction.domain; - var result, then, exited; - try { - if (handler) { - if (!ok) { - if (promise._h == 2) onHandleUnhandled(promise); - promise._h = 1; - } - if (handler === true) result = value; - else { - if (domain) domain.enter(); - result = handler(value); // may throw - if (domain) { - domain.exit(); - exited = true; - } - } - if (result === reaction.promise) { - reject(TypeError('Promise-chain cycle')); - } else if (then = isThenable(result)) { - then.call(result, resolve, reject); - } else resolve(result); - } else reject(value); - } catch (e) { - if (domain && !exited) domain.exit(); - reject(e); - } - }; - while (chain.length > i) run(chain[i++]); // variable length - can't use forEach - promise._c = []; - promise._n = false; - if (isReject && !promise._h) onUnhandled(promise); - }); -}; -var onUnhandled = function (promise) { - task.call(global, function () { - var value = promise._v; - var unhandled = isUnhandled(promise); - var result, handler, console; - if (unhandled) { - result = perform(function () { - if (isNode) { - process.emit('unhandledRejection', value, promise); - } else if (handler = global.onunhandledrejection) { - handler({ promise: promise, reason: value }); - } else if ((console = global.console) && console.error) { - console.error('Unhandled promise rejection', value); - } - }); - // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should - promise._h = isNode || isUnhandled(promise) ? 2 : 1; - } promise._a = undefined; - if (unhandled && result.e) throw result.v; - }); -}; -var isUnhandled = function (promise) { - return promise._h !== 1 && (promise._a || promise._c).length === 0; -}; -var onHandleUnhandled = function (promise) { - task.call(global, function () { - var handler; - if (isNode) { - process.emit('rejectionHandled', promise); - } else if (handler = global.onrejectionhandled) { - handler({ promise: promise, reason: promise._v }); - } - }); -}; -var $reject = function (value) { - var promise = this; - if (promise._d) return; - promise._d = true; - promise = promise._w || promise; // unwrap - promise._v = value; - promise._s = 2; - if (!promise._a) promise._a = promise._c.slice(); - notify(promise, true); -}; -var $resolve = function (value) { - var promise = this; - var then; - if (promise._d) return; - promise._d = true; - promise = promise._w || promise; // unwrap - try { - if (promise === value) throw TypeError("Promise can't be resolved itself"); - if (then = isThenable(value)) { - microtask(function () { - var wrapper = { _w: promise, _d: false }; // wrap - try { - then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); - } catch (e) { - $reject.call(wrapper, e); - } - }); - } else { - promise._v = value; - promise._s = 1; - notify(promise, false); - } - } catch (e) { - $reject.call({ _w: promise, _d: false }, e); // wrap - } -}; - -// constructor polyfill -if (!USE_NATIVE) { - // 25.4.3.1 Promise(executor) - $Promise = function Promise(executor) { - anInstance(this, $Promise, PROMISE, '_h'); - aFunction(executor); - Internal.call(this); - try { - executor(ctx($resolve, this, 1), ctx($reject, this, 1)); - } catch (err) { - $reject.call(this, err); - } - }; - // eslint-disable-next-line no-unused-vars - Internal = function Promise(executor) { - this._c = []; // <- awaiting reactions - this._a = undefined; // <- checked in isUnhandled reactions - this._s = 0; // <- state - this._d = false; // <- done - this._v = undefined; // <- value - this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled - this._n = false; // <- notify - }; - Internal.prototype = __webpack_require__(39)($Promise.prototype, { - // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) - then: function then(onFulfilled, onRejected) { - var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); - reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; - reaction.fail = typeof onRejected == 'function' && onRejected; - reaction.domain = isNode ? process.domain : undefined; - this._c.push(reaction); - if (this._a) this._a.push(reaction); - if (this._s) notify(this, false); - return reaction.promise; - }, - // 25.4.5.1 Promise.prototype.catch(onRejected) - 'catch': function (onRejected) { - return this.then(undefined, onRejected); - } - }); - OwnPromiseCapability = function () { - var promise = new Internal(); - this.promise = promise; - this.resolve = ctx($resolve, promise, 1); - this.reject = ctx($reject, promise, 1); - }; - newPromiseCapabilityModule.f = newPromiseCapability = function (C) { - return C === $Promise || C === Wrapper - ? new OwnPromiseCapability(C) - : newGenericPromiseCapability(C); - }; -} - -$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); -__webpack_require__(41)($Promise, PROMISE); -__webpack_require__(42)(PROMISE); -Wrapper = __webpack_require__(12)[PROMISE]; - -// statics -$export($export.S + $export.F * !USE_NATIVE, PROMISE, { - // 25.4.4.5 Promise.reject(r) - reject: function reject(r) { - var capability = newPromiseCapability(this); - var $$reject = capability.reject; - $$reject(r); - return capability.promise; - } -}); -$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { - // 25.4.4.6 Promise.resolve(x) - resolve: function resolve(x) { - return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); - } -}); -$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(79)(function (iter) { - $Promise.all(iter)['catch'](empty); -})), PROMISE, { - // 25.4.4.1 Promise.all(iterable) - all: function all(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var resolve = capability.resolve; - var reject = capability.reject; - var result = perform(function () { - var values = []; - var index = 0; - var remaining = 1; - forOf(iterable, false, function (promise) { - var $index = index++; - var alreadyCalled = false; - values.push(undefined); - remaining++; - C.resolve(promise).then(function (value) { - if (alreadyCalled) return; - alreadyCalled = true; - values[$index] = value; - --remaining || resolve(values); - }, reject); - }); - --remaining || resolve(values); - }); - if (result.e) reject(result.v); - return capability.promise; - }, - // 25.4.4.4 Promise.race(iterable) - race: function race(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var reject = capability.reject; - var result = perform(function () { - forOf(iterable, false, function (promise) { - C.resolve(promise).then(capability.resolve, reject); - }); - }); - if (result.e) reject(result.v); - return capability.promise; - } -}); - - -/***/ }), -/* 222 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var weak = __webpack_require__(113); -var validate = __webpack_require__(43); -var WEAK_SET = 'WeakSet'; - -// 23.4 WeakSet Objects -__webpack_require__(57)(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); - - -/***/ }), -/* 223 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.1 Reflect.apply(target, thisArgument, argumentsList) -var $export = __webpack_require__(0); -var aFunction = __webpack_require__(10); -var anObject = __webpack_require__(1); -var rApply = (__webpack_require__(2).Reflect || {}).apply; -var fApply = Function.apply; -// MS Edge argumentsList argument is optional -$export($export.S + $export.F * !__webpack_require__(4)(function () { - rApply(function () { /* empty */ }); -}), 'Reflect', { - apply: function apply(target, thisArgument, argumentsList) { - var T = aFunction(target); - var L = anObject(argumentsList); - return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); - } -}); - - -/***/ }), -/* 224 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) -var $export = __webpack_require__(0); -var create = __webpack_require__(32); -var aFunction = __webpack_require__(10); -var anObject = __webpack_require__(1); -var isObject = __webpack_require__(3); -var fails = __webpack_require__(4); -var bind = __webpack_require__(96); -var rConstruct = (__webpack_require__(2).Reflect || {}).construct; - -// MS Edge supports only 2 arguments and argumentsList argument is optional -// FF Nightly sets third argument as `new.target`, but does not create `this` from it -var NEW_TARGET_BUG = fails(function () { - function F() { /* empty */ } - return !(rConstruct(function () { /* empty */ }, [], F) instanceof F); -}); -var ARGS_BUG = !fails(function () { - rConstruct(function () { /* empty */ }); -}); - -$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { - construct: function construct(Target, args /* , newTarget */) { - aFunction(Target); - anObject(args); - var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); - if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget); - if (Target == newTarget) { - // w/o altered newTarget, optimization for 0-4 arguments - switch (args.length) { - case 0: return new Target(); - case 1: return new Target(args[0]); - case 2: return new Target(args[0], args[1]); - case 3: return new Target(args[0], args[1], args[2]); - case 4: return new Target(args[0], args[1], args[2], args[3]); - } - // w/o altered newTarget, lot of arguments case - var $args = [null]; - $args.push.apply($args, args); - return new (bind.apply(Target, $args))(); - } - // with altered newTarget, not support built-in constructors - var proto = newTarget.prototype; - var instance = create(isObject(proto) ? proto : Object.prototype); - var result = Function.apply.call(Target, instance, args); - return isObject(result) ? result : instance; - } -}); - - -/***/ }), -/* 225 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) -var dP = __webpack_require__(7); -var $export = __webpack_require__(0); -var anObject = __webpack_require__(1); -var toPrimitive = __webpack_require__(27); - -// MS Edge has broken Reflect.defineProperty - throwing instead of returning false -$export($export.S + $export.F * __webpack_require__(4)(function () { - // eslint-disable-next-line no-undef - Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 }); -}), 'Reflect', { - defineProperty: function defineProperty(target, propertyKey, attributes) { - anObject(target); - propertyKey = toPrimitive(propertyKey, true); - anObject(attributes); - try { - dP.f(target, propertyKey, attributes); - return true; - } catch (e) { - return false; - } - } -}); - - -/***/ }), -/* 226 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.4 Reflect.deleteProperty(target, propertyKey) -var $export = __webpack_require__(0); -var gOPD = __webpack_require__(18).f; -var anObject = __webpack_require__(1); - -$export($export.S, 'Reflect', { - deleteProperty: function deleteProperty(target, propertyKey) { - var desc = gOPD(anObject(target), propertyKey); - return desc && !desc.configurable ? false : delete target[propertyKey]; - } -}); - - -/***/ }), -/* 227 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 26.1.5 Reflect.enumerate(target) -var $export = __webpack_require__(0); -var anObject = __webpack_require__(1); -var Enumerate = function (iterated) { - this._t = anObject(iterated); // target - this._i = 0; // next index - var keys = this._k = []; // keys - var key; - for (key in iterated) keys.push(key); -}; -__webpack_require__(54)(Enumerate, 'Object', function () { - var that = this; - var keys = that._k; - var key; - do { - if (that._i >= keys.length) return { value: undefined, done: true }; - } while (!((key = keys[that._i++]) in that._t)); - return { value: key, done: false }; -}); - -$export($export.S, 'Reflect', { - enumerate: function enumerate(target) { - return new Enumerate(target); - } -}); - - -/***/ }), -/* 228 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.6 Reflect.get(target, propertyKey [, receiver]) -var gOPD = __webpack_require__(18); -var getPrototypeOf = __webpack_require__(13); -var has = __webpack_require__(15); -var $export = __webpack_require__(0); -var isObject = __webpack_require__(3); -var anObject = __webpack_require__(1); - -function get(target, propertyKey /* , receiver */) { - var receiver = arguments.length < 3 ? target : arguments[2]; - var desc, proto; - if (anObject(target) === receiver) return target[propertyKey]; - if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value') - ? desc.value - : desc.get !== undefined - ? desc.get.call(receiver) - : undefined; - if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver); -} - -$export($export.S, 'Reflect', { get: get }); - - -/***/ }), -/* 229 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) -var gOPD = __webpack_require__(18); -var $export = __webpack_require__(0); -var anObject = __webpack_require__(1); - -$export($export.S, 'Reflect', { - getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { - return gOPD.f(anObject(target), propertyKey); - } -}); - - -/***/ }), -/* 230 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.8 Reflect.getPrototypeOf(target) -var $export = __webpack_require__(0); -var getProto = __webpack_require__(13); -var anObject = __webpack_require__(1); - -$export($export.S, 'Reflect', { - getPrototypeOf: function getPrototypeOf(target) { - return getProto(anObject(target)); - } -}); - - -/***/ }), -/* 231 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.9 Reflect.has(target, propertyKey) -var $export = __webpack_require__(0); - -$export($export.S, 'Reflect', { - has: function has(target, propertyKey) { - return propertyKey in target; - } -}); - - -/***/ }), -/* 232 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.10 Reflect.isExtensible(target) -var $export = __webpack_require__(0); -var anObject = __webpack_require__(1); -var $isExtensible = Object.isExtensible; - -$export($export.S, 'Reflect', { - isExtensible: function isExtensible(target) { - anObject(target); - return $isExtensible ? $isExtensible(target) : true; - } -}); - - -/***/ }), -/* 233 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.11 Reflect.ownKeys(target) -var $export = __webpack_require__(0); - -$export($export.S, 'Reflect', { ownKeys: __webpack_require__(87) }); - - -/***/ }), -/* 234 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.12 Reflect.preventExtensions(target) -var $export = __webpack_require__(0); -var anObject = __webpack_require__(1); -var $preventExtensions = Object.preventExtensions; - -$export($export.S, 'Reflect', { - preventExtensions: function preventExtensions(target) { - anObject(target); - try { - if ($preventExtensions) $preventExtensions(target); - return true; - } catch (e) { - return false; - } - } -}); - - -/***/ }), -/* 235 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) -var dP = __webpack_require__(7); -var gOPD = __webpack_require__(18); -var getPrototypeOf = __webpack_require__(13); -var has = __webpack_require__(15); -var $export = __webpack_require__(0); -var createDesc = __webpack_require__(28); -var anObject = __webpack_require__(1); -var isObject = __webpack_require__(3); - -function set(target, propertyKey, V /* , receiver */) { - var receiver = arguments.length < 4 ? target : arguments[3]; - var ownDesc = gOPD.f(anObject(target), propertyKey); - var existingDescriptor, proto; - if (!ownDesc) { - if (isObject(proto = getPrototypeOf(target))) { - return set(proto, propertyKey, V, receiver); - } - ownDesc = createDesc(0); - } - if (has(ownDesc, 'value')) { - if (ownDesc.writable === false || !isObject(receiver)) return false; - if (existingDescriptor = gOPD.f(receiver, propertyKey)) { - if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false; - existingDescriptor.value = V; - dP.f(receiver, propertyKey, existingDescriptor); - } else dP.f(receiver, propertyKey, createDesc(0, V)); - return true; - } - return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); -} - -$export($export.S, 'Reflect', { set: set }); - - -/***/ }), -/* 236 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.14 Reflect.setPrototypeOf(target, proto) -var $export = __webpack_require__(0); -var setProto = __webpack_require__(95); - -if (setProto) $export($export.S, 'Reflect', { - setPrototypeOf: function setPrototypeOf(target, proto) { - setProto.check(target, proto); - try { - setProto.set(target, proto); - return true; - } catch (e) { - return false; - } - } -}); - - -/***/ }), -/* 237 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.3.3.1 / 15.9.4.4 Date.now() -var $export = __webpack_require__(0); - -$export($export.S, 'Date', { now: function () { return new Date().getTime(); } }); - - -/***/ }), -/* 238 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var toObject = __webpack_require__(9); -var toPrimitive = __webpack_require__(27); -var toISOString = __webpack_require__(114); -var classof = __webpack_require__(37); - -$export($export.P + $export.F * __webpack_require__(4)(function () { - return new Date(NaN).toJSON() !== null - || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; -}), 'Date', { - // eslint-disable-next-line no-unused-vars - toJSON: function toJSON(key) { - var O = toObject(this); - var pv = toPrimitive(O); - return typeof pv == 'number' && !isFinite(pv) ? null : - (!('toISOString' in O) && classof(O) == 'Date') ? toISOString.call(O) : O.toISOString(); - } -}); - - -/***/ }), -/* 239 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() -var $export = __webpack_require__(0); -var toISOString = __webpack_require__(114); - -// PhantomJS / old WebKit has a broken implementations -$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', { - toISOString: toISOString -}); - - -/***/ }), -/* 240 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $typed = __webpack_require__(58); -var buffer = __webpack_require__(88); -var anObject = __webpack_require__(1); -var toAbsoluteIndex = __webpack_require__(35); -var toLength = __webpack_require__(6); -var isObject = __webpack_require__(3); -var ArrayBuffer = __webpack_require__(2).ArrayBuffer; -var speciesConstructor = __webpack_require__(55); -var $ArrayBuffer = buffer.ArrayBuffer; -var $DataView = buffer.DataView; -var $isView = $typed.ABV && ArrayBuffer.isView; -var $slice = $ArrayBuffer.prototype.slice; -var VIEW = $typed.VIEW; -var ARRAY_BUFFER = 'ArrayBuffer'; - -$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer }); - -$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { - // 24.1.3.1 ArrayBuffer.isView(arg) - isView: function isView(it) { - return $isView && $isView(it) || isObject(it) && VIEW in it; - } -}); - -$export($export.P + $export.U + $export.F * __webpack_require__(4)(function () { - return !new $ArrayBuffer(2).slice(1, undefined).byteLength; -}), ARRAY_BUFFER, { - // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) - slice: function slice(start, end) { - if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix - var len = anObject(this).byteLength; - var first = toAbsoluteIndex(start, len); - var fin = toAbsoluteIndex(end === undefined ? len : end, len); - var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first)); - var viewS = new $DataView(this); - var viewT = new $DataView(result); - var index = 0; - while (first < fin) { - viewT.setUint8(index++, viewS.getUint8(first++)); - } return result; - } -}); - -__webpack_require__(42)(ARRAY_BUFFER); - - -/***/ }), -/* 241 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -$export($export.G + $export.W + $export.F * !__webpack_require__(58).ABV, { - DataView: __webpack_require__(88).DataView -}); - - -/***/ }), -/* 242 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(25)('Int8', 1, function (init) { - return function Int8Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 243 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(25)('Uint8', 1, function (init) { - return function Uint8Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 244 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(25)('Uint8', 1, function (init) { - return function Uint8ClampedArray(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}, true); - - -/***/ }), -/* 245 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(25)('Int16', 2, function (init) { - return function Int16Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 246 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(25)('Uint16', 2, function (init) { - return function Uint16Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 247 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(25)('Int32', 4, function (init) { - return function Int32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 248 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(25)('Uint32', 4, function (init) { - return function Uint32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 249 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(25)('Float32', 4, function (init) { - return function Float32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 250 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(25)('Float64', 8, function (init) { - return function Float64Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 251 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/tc39/Array.prototype.includes -var $export = __webpack_require__(0); -var $includes = __webpack_require__(50)(true); - -$export($export.P, 'Array', { - includes: function includes(el /* , fromIndex = 0 */) { - return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); - } -}); - -__webpack_require__(33)('includes'); - - -/***/ }), -/* 252 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap -var $export = __webpack_require__(0); -var flattenIntoArray = __webpack_require__(116); -var toObject = __webpack_require__(9); -var toLength = __webpack_require__(6); -var aFunction = __webpack_require__(10); -var arraySpeciesCreate = __webpack_require__(80); - -$export($export.P, 'Array', { - flatMap: function flatMap(callbackfn /* , thisArg */) { - var O = toObject(this); - var sourceLen, A; - aFunction(callbackfn); - sourceLen = toLength(O.length); - A = arraySpeciesCreate(O, 0); - flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]); - return A; - } -}); - -__webpack_require__(33)('flatMap'); - - -/***/ }), -/* 253 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten -var $export = __webpack_require__(0); -var flattenIntoArray = __webpack_require__(116); -var toObject = __webpack_require__(9); -var toLength = __webpack_require__(6); -var toInteger = __webpack_require__(22); -var arraySpeciesCreate = __webpack_require__(80); - -$export($export.P, 'Array', { - flatten: function flatten(/* depthArg = 1 */) { - var depthArg = arguments[0]; - var O = toObject(this); - var sourceLen = toLength(O.length); - var A = arraySpeciesCreate(O, 0); - flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg)); - return A; - } -}); - -__webpack_require__(33)('flatten'); - - -/***/ }), -/* 254 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/mathiasbynens/String.prototype.at -var $export = __webpack_require__(0); -var $at = __webpack_require__(74)(true); - -$export($export.P, 'String', { - at: function at(pos) { - return $at(this, pos); - } -}); - - -/***/ }), -/* 255 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/tc39/proposal-string-pad-start-end -var $export = __webpack_require__(0); -var $pad = __webpack_require__(117); -var userAgent = __webpack_require__(56); - -// https://github.com/zloirock/core-js/issues/280 -$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { - padStart: function padStart(maxLength /* , fillString = ' ' */) { - return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); - } -}); - - -/***/ }), -/* 256 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/tc39/proposal-string-pad-start-end -var $export = __webpack_require__(0); -var $pad = __webpack_require__(117); -var userAgent = __webpack_require__(56); - -// https://github.com/zloirock/core-js/issues/280 -$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { - padEnd: function padEnd(maxLength /* , fillString = ' ' */) { - return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); - } -}); - - -/***/ }), -/* 257 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/sebmarkbage/ecmascript-string-left-right-trim -__webpack_require__(47)('trimLeft', function ($trim) { - return function trimLeft() { - return $trim(this, 1); - }; -}, 'trimStart'); - - -/***/ }), -/* 258 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/sebmarkbage/ecmascript-string-left-right-trim -__webpack_require__(47)('trimRight', function ($trim) { - return function trimRight() { - return $trim(this, 2); - }; -}, 'trimEnd'); - - -/***/ }), -/* 259 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://tc39.github.io/String.prototype.matchAll/ -var $export = __webpack_require__(0); -var defined = __webpack_require__(24); -var toLength = __webpack_require__(6); -var isRegExp = __webpack_require__(103); -var getFlags = __webpack_require__(260); -var RegExpProto = RegExp.prototype; - -var $RegExpStringIterator = function (regexp, string) { - this._r = regexp; - this._s = string; -}; - -__webpack_require__(54)($RegExpStringIterator, 'RegExp String', function next() { - var match = this._r.exec(this._s); - return { value: match, done: match === null }; -}); - -$export($export.P, 'String', { - matchAll: function matchAll(regexp) { - defined(this); - if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!'); - var S = String(this); - var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp); - var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags); - rx.lastIndex = toLength(regexp.lastIndex); - return new $RegExpStringIterator(rx, S); - } -}); - - -/***/ }), -/* 260 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 21.2.5.3 get RegExp.prototype.flags -var anObject = __webpack_require__(1); -module.exports = function () { - var that = anObject(this); - var result = ''; - if (that.global) result += 'g'; - if (that.ignoreCase) result += 'i'; - if (that.multiline) result += 'm'; - if (that.unicode) result += 'u'; - if (that.sticky) result += 'y'; - return result; -}; - - -/***/ }), -/* 261 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(64)('asyncIterator'); - - -/***/ }), -/* 262 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(64)('observable'); - - -/***/ }), -/* 263 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/tc39/proposal-object-getownpropertydescriptors -var $export = __webpack_require__(0); -var ownKeys = __webpack_require__(87); -var toIObject = __webpack_require__(11); -var gOPD = __webpack_require__(18); -var createProperty = __webpack_require__(78); - -$export($export.S, 'Object', { - getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { - var O = toIObject(object); - var getDesc = gOPD.f; - var keys = ownKeys(O); - var result = {}; - var i = 0; - var key, desc; - while (keys.length > i) { - desc = getDesc(O, key = keys[i++]); - if (desc !== undefined) createProperty(result, key, desc); - } - return result; - } -}); - - -/***/ }), -/* 264 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/tc39/proposal-object-values-entries -var $export = __webpack_require__(0); -var $values = __webpack_require__(118)(false); - -$export($export.S, 'Object', { - values: function values(it) { - return $values(it); - } -}); - - -/***/ }), -/* 265 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/tc39/proposal-object-values-entries -var $export = __webpack_require__(0); -var $entries = __webpack_require__(118)(true); - -$export($export.S, 'Object', { - entries: function entries(it) { - return $entries(it); - } -}); - - -/***/ }), -/* 266 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var toObject = __webpack_require__(9); -var aFunction = __webpack_require__(10); -var $defineProperty = __webpack_require__(7); - -// B.2.2.2 Object.prototype.__defineGetter__(P, getter) -__webpack_require__(8) && $export($export.P + __webpack_require__(59), 'Object', { - __defineGetter__: function __defineGetter__(P, getter) { - $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true }); - } -}); - - -/***/ }), -/* 267 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var toObject = __webpack_require__(9); -var aFunction = __webpack_require__(10); -var $defineProperty = __webpack_require__(7); - -// B.2.2.3 Object.prototype.__defineSetter__(P, setter) -__webpack_require__(8) && $export($export.P + __webpack_require__(59), 'Object', { - __defineSetter__: function __defineSetter__(P, setter) { - $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true }); - } -}); - - -/***/ }), -/* 268 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var toObject = __webpack_require__(9); -var toPrimitive = __webpack_require__(27); -var getPrototypeOf = __webpack_require__(13); -var getOwnPropertyDescriptor = __webpack_require__(18).f; - -// B.2.2.4 Object.prototype.__lookupGetter__(P) -__webpack_require__(8) && $export($export.P + __webpack_require__(59), 'Object', { - __lookupGetter__: function __lookupGetter__(P) { - var O = toObject(this); - var K = toPrimitive(P, true); - var D; - do { - if (D = getOwnPropertyDescriptor(O, K)) return D.get; - } while (O = getPrototypeOf(O)); - } -}); - - -/***/ }), -/* 269 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var toObject = __webpack_require__(9); -var toPrimitive = __webpack_require__(27); -var getPrototypeOf = __webpack_require__(13); -var getOwnPropertyDescriptor = __webpack_require__(18).f; - -// B.2.2.5 Object.prototype.__lookupSetter__(P) -__webpack_require__(8) && $export($export.P + __webpack_require__(59), 'Object', { - __lookupSetter__: function __lookupSetter__(P) { - var O = toObject(this); - var K = toPrimitive(P, true); - var D; - do { - if (D = getOwnPropertyDescriptor(O, K)) return D.set; - } while (O = getPrototypeOf(O)); - } -}); - - -/***/ }), -/* 270 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/DavidBruant/Map-Set.prototype.toJSON -var $export = __webpack_require__(0); - -$export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(119)('Map') }); - - -/***/ }), -/* 271 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/DavidBruant/Map-Set.prototype.toJSON -var $export = __webpack_require__(0); - -$export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(119)('Set') }); - - -/***/ }), -/* 272 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of -__webpack_require__(60)('Map'); - - -/***/ }), -/* 273 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of -__webpack_require__(60)('Set'); - - -/***/ }), -/* 274 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of -__webpack_require__(60)('WeakMap'); - - -/***/ }), -/* 275 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of -__webpack_require__(60)('WeakSet'); - - -/***/ }), -/* 276 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from -__webpack_require__(61)('Map'); - - -/***/ }), -/* 277 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from -__webpack_require__(61)('Set'); - - -/***/ }), -/* 278 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from -__webpack_require__(61)('WeakMap'); - - -/***/ }), -/* 279 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from -__webpack_require__(61)('WeakSet'); - - -/***/ }), -/* 280 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/tc39/proposal-global -var $export = __webpack_require__(0); - -$export($export.G, { global: __webpack_require__(2) }); - - -/***/ }), -/* 281 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/tc39/proposal-global -var $export = __webpack_require__(0); - -$export($export.S, 'System', { global: __webpack_require__(2) }); - - -/***/ }), -/* 282 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/ljharb/proposal-is-error -var $export = __webpack_require__(0); -var cof = __webpack_require__(21); - -$export($export.S, 'Error', { - isError: function isError(it) { - return cof(it) === 'Error'; - } -}); - - -/***/ }), -/* 283 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - clamp: function clamp(x, lower, upper) { - return Math.min(upper, Math.max(lower, x)); - } -}); - - -/***/ }), -/* 284 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 }); - - -/***/ }), -/* 285 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __webpack_require__(0); -var RAD_PER_DEG = 180 / Math.PI; - -$export($export.S, 'Math', { - degrees: function degrees(radians) { - return radians * RAD_PER_DEG; - } -}); - - -/***/ }), -/* 286 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __webpack_require__(0); -var scale = __webpack_require__(121); -var fround = __webpack_require__(102); - -$export($export.S, 'Math', { - fscale: function fscale(x, inLow, inHigh, outLow, outHigh) { - return fround(scale(x, inLow, inHigh, outLow, outHigh)); - } -}); - - -/***/ }), -/* 287 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - iaddh: function iaddh(x0, x1, y0, y1) { - var $x0 = x0 >>> 0; - var $x1 = x1 >>> 0; - var $y0 = y0 >>> 0; - return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; - } -}); - - -/***/ }), -/* 288 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - isubh: function isubh(x0, x1, y0, y1) { - var $x0 = x0 >>> 0; - var $x1 = x1 >>> 0; - var $y0 = y0 >>> 0; - return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; - } -}); - - -/***/ }), -/* 289 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - imulh: function imulh(u, v) { - var UINT16 = 0xffff; - var $u = +u; - var $v = +v; - var u0 = $u & UINT16; - var v0 = $v & UINT16; - var u1 = $u >> 16; - var v1 = $v >> 16; - var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); - return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); - } -}); - - -/***/ }), -/* 290 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI }); - - -/***/ }), -/* 291 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __webpack_require__(0); -var DEG_PER_RAD = Math.PI / 180; - -$export($export.S, 'Math', { - radians: function radians(degrees) { - return degrees * DEG_PER_RAD; - } -}); - - -/***/ }), -/* 292 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { scale: __webpack_require__(121) }); - - -/***/ }), -/* 293 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - umulh: function umulh(u, v) { - var UINT16 = 0xffff; - var $u = +u; - var $v = +v; - var u0 = $u & UINT16; - var v0 = $v & UINT16; - var u1 = $u >>> 16; - var v1 = $v >>> 16; - var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); - return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); - } -}); - - -/***/ }), -/* 294 */ -/***/ (function(module, exports, __webpack_require__) { - -// http://jfbastien.github.io/papers/Math.signbit.html -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { signbit: function signbit(x) { - // eslint-disable-next-line no-self-compare - return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0; -} }); - - -/***/ }), -/* 295 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// https://github.com/tc39/proposal-promise-finally - -var $export = __webpack_require__(0); -var core = __webpack_require__(12); -var global = __webpack_require__(2); -var speciesConstructor = __webpack_require__(55); -var promiseResolve = __webpack_require__(108); - -$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { - var C = speciesConstructor(this, core.Promise || global.Promise); - var isFunction = typeof onFinally == 'function'; - return this.then( - isFunction ? function (x) { - return promiseResolve(C, onFinally()).then(function () { return x; }); - } : onFinally, - isFunction ? function (e) { - return promiseResolve(C, onFinally()).then(function () { throw e; }); - } : onFinally - ); -} }); - - -/***/ }), -/* 296 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/tc39/proposal-promise-try -var $export = __webpack_require__(0); -var newPromiseCapability = __webpack_require__(86); -var perform = __webpack_require__(107); - -$export($export.S, 'Promise', { 'try': function (callbackfn) { - var promiseCapability = newPromiseCapability.f(this); - var result = perform(callbackfn); - (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); - return promiseCapability.promise; -} }); - - -/***/ }), -/* 297 */ -/***/ (function(module, exports, __webpack_require__) { - -var metadata = __webpack_require__(26); -var anObject = __webpack_require__(1); -var toMetaKey = metadata.key; -var ordinaryDefineOwnMetadata = metadata.set; - -metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) { - ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); -} }); - - -/***/ }), -/* 298 */ -/***/ (function(module, exports, __webpack_require__) { - -var metadata = __webpack_require__(26); -var anObject = __webpack_require__(1); -var toMetaKey = metadata.key; -var getOrCreateMetadataMap = metadata.map; -var store = metadata.store; - -metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) { - var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]); - var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); - if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false; - if (metadataMap.size) return true; - var targetMetadata = store.get(target); - targetMetadata['delete'](targetKey); - return !!targetMetadata.size || store['delete'](target); -} }); - - -/***/ }), -/* 299 */ -/***/ (function(module, exports, __webpack_require__) { - -var metadata = __webpack_require__(26); -var anObject = __webpack_require__(1); -var getPrototypeOf = __webpack_require__(13); -var ordinaryHasOwnMetadata = metadata.has; -var ordinaryGetOwnMetadata = metadata.get; -var toMetaKey = metadata.key; - -var ordinaryGetMetadata = function (MetadataKey, O, P) { - var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); - if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P); - var parent = getPrototypeOf(O); - return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; -}; - -metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) { - return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); - - -/***/ }), -/* 300 */ -/***/ (function(module, exports, __webpack_require__) { - -var Set = __webpack_require__(111); -var from = __webpack_require__(120); -var metadata = __webpack_require__(26); -var anObject = __webpack_require__(1); -var getPrototypeOf = __webpack_require__(13); -var ordinaryOwnMetadataKeys = metadata.keys; -var toMetaKey = metadata.key; - -var ordinaryMetadataKeys = function (O, P) { - var oKeys = ordinaryOwnMetadataKeys(O, P); - var parent = getPrototypeOf(O); - if (parent === null) return oKeys; - var pKeys = ordinaryMetadataKeys(parent, P); - return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys; -}; - -metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) { - return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); -} }); - - -/***/ }), -/* 301 */ -/***/ (function(module, exports, __webpack_require__) { - -var metadata = __webpack_require__(26); -var anObject = __webpack_require__(1); -var ordinaryGetOwnMetadata = metadata.get; -var toMetaKey = metadata.key; - -metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) { - return ordinaryGetOwnMetadata(metadataKey, anObject(target) - , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); - - -/***/ }), -/* 302 */ -/***/ (function(module, exports, __webpack_require__) { - -var metadata = __webpack_require__(26); -var anObject = __webpack_require__(1); -var ordinaryOwnMetadataKeys = metadata.keys; -var toMetaKey = metadata.key; - -metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) { - return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); -} }); - - -/***/ }), -/* 303 */ -/***/ (function(module, exports, __webpack_require__) { - -var metadata = __webpack_require__(26); -var anObject = __webpack_require__(1); -var getPrototypeOf = __webpack_require__(13); -var ordinaryHasOwnMetadata = metadata.has; -var toMetaKey = metadata.key; - -var ordinaryHasMetadata = function (MetadataKey, O, P) { - var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); - if (hasOwn) return true; - var parent = getPrototypeOf(O); - return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; -}; - -metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) { - return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); - - -/***/ }), -/* 304 */ -/***/ (function(module, exports, __webpack_require__) { - -var metadata = __webpack_require__(26); -var anObject = __webpack_require__(1); -var ordinaryHasOwnMetadata = metadata.has; -var toMetaKey = metadata.key; - -metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) { - return ordinaryHasOwnMetadata(metadataKey, anObject(target) - , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); - - -/***/ }), -/* 305 */ -/***/ (function(module, exports, __webpack_require__) { - -var $metadata = __webpack_require__(26); -var anObject = __webpack_require__(1); -var aFunction = __webpack_require__(10); -var toMetaKey = $metadata.key; -var ordinaryDefineOwnMetadata = $metadata.set; - -$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) { - return function decorator(target, targetKey) { - ordinaryDefineOwnMetadata( - metadataKey, metadataValue, - (targetKey !== undefined ? anObject : aFunction)(target), - toMetaKey(targetKey) - ); - }; -} }); - - -/***/ }), -/* 306 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask -var $export = __webpack_require__(0); -var microtask = __webpack_require__(85)(); -var process = __webpack_require__(2).process; -var isNode = __webpack_require__(21)(process) == 'process'; - -$export($export.G, { - asap: function asap(fn) { - var domain = isNode && process.domain; - microtask(domain ? domain.bind(fn) : fn); - } -}); - - -/***/ }), -/* 307 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/zenparsing/es-observable -var $export = __webpack_require__(0); -var global = __webpack_require__(2); -var core = __webpack_require__(12); -var microtask = __webpack_require__(85)(); -var OBSERVABLE = __webpack_require__(5)('observable'); -var aFunction = __webpack_require__(10); -var anObject = __webpack_require__(1); -var anInstance = __webpack_require__(38); -var redefineAll = __webpack_require__(39); -var hide = __webpack_require__(17); -var forOf = __webpack_require__(34); -var RETURN = forOf.RETURN; - -var getMethod = function (fn) { - return fn == null ? undefined : aFunction(fn); -}; - -var cleanupSubscription = function (subscription) { - var cleanup = subscription._c; - if (cleanup) { - subscription._c = undefined; - cleanup(); - } -}; - -var subscriptionClosed = function (subscription) { - return subscription._o === undefined; -}; - -var closeSubscription = function (subscription) { - if (!subscriptionClosed(subscription)) { - subscription._o = undefined; - cleanupSubscription(subscription); - } -}; - -var Subscription = function (observer, subscriber) { - anObject(observer); - this._c = undefined; - this._o = observer; - observer = new SubscriptionObserver(this); - try { - var cleanup = subscriber(observer); - var subscription = cleanup; - if (cleanup != null) { - if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); }; - else aFunction(cleanup); - this._c = cleanup; - } - } catch (e) { - observer.error(e); - return; - } if (subscriptionClosed(this)) cleanupSubscription(this); -}; - -Subscription.prototype = redefineAll({}, { - unsubscribe: function unsubscribe() { closeSubscription(this); } -}); - -var SubscriptionObserver = function (subscription) { - this._s = subscription; -}; - -SubscriptionObserver.prototype = redefineAll({}, { - next: function next(value) { - var subscription = this._s; - if (!subscriptionClosed(subscription)) { - var observer = subscription._o; - try { - var m = getMethod(observer.next); - if (m) return m.call(observer, value); - } catch (e) { - try { - closeSubscription(subscription); - } finally { - throw e; - } - } - } - }, - error: function error(value) { - var subscription = this._s; - if (subscriptionClosed(subscription)) throw value; - var observer = subscription._o; - subscription._o = undefined; - try { - var m = getMethod(observer.error); - if (!m) throw value; - value = m.call(observer, value); - } catch (e) { - try { - cleanupSubscription(subscription); - } finally { - throw e; - } - } cleanupSubscription(subscription); - return value; - }, - complete: function complete(value) { - var subscription = this._s; - if (!subscriptionClosed(subscription)) { - var observer = subscription._o; - subscription._o = undefined; - try { - var m = getMethod(observer.complete); - value = m ? m.call(observer, value) : undefined; - } catch (e) { - try { - cleanupSubscription(subscription); - } finally { - throw e; - } - } cleanupSubscription(subscription); - return value; - } - } -}); - -var $Observable = function Observable(subscriber) { - anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber); -}; - -redefineAll($Observable.prototype, { - subscribe: function subscribe(observer) { - return new Subscription(observer, this._f); - }, - forEach: function forEach(fn) { - var that = this; - return new (core.Promise || global.Promise)(function (resolve, reject) { - aFunction(fn); - var subscription = that.subscribe({ - next: function (value) { - try { - return fn(value); - } catch (e) { - reject(e); - subscription.unsubscribe(); - } - }, - error: reject, - complete: resolve - }); - }); - } -}); - -redefineAll($Observable, { - from: function from(x) { - var C = typeof this === 'function' ? this : $Observable; - var method = getMethod(anObject(x)[OBSERVABLE]); - if (method) { - var observable = anObject(method.call(x)); - return observable.constructor === C ? observable : new C(function (observer) { - return observable.subscribe(observer); - }); - } - return new C(function (observer) { - var done = false; - microtask(function () { - if (!done) { - try { - if (forOf(x, false, function (it) { - observer.next(it); - if (done) return RETURN; - }) === RETURN) return; - } catch (e) { - if (done) throw e; - observer.error(e); - return; - } observer.complete(); - } - }); - return function () { done = true; }; - }); - }, - of: function of() { - for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++]; - return new (typeof this === 'function' ? this : $Observable)(function (observer) { - var done = false; - microtask(function () { - if (!done) { - for (var j = 0; j < items.length; ++j) { - observer.next(items[j]); - if (done) return; - } observer.complete(); - } - }); - return function () { done = true; }; - }); - } -}); - -hide($Observable.prototype, OBSERVABLE, function () { return this; }); - -$export($export.G, { Observable: $Observable }); - -__webpack_require__(42)('Observable'); - - -/***/ }), -/* 308 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var $task = __webpack_require__(84); -$export($export.G + $export.B, { - setImmediate: $task.set, - clearImmediate: $task.clear -}); - - -/***/ }), -/* 309 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(82); -var global = __webpack_require__(2); -var hide = __webpack_require__(17); -var Iterators = __webpack_require__(36); -var TO_STRING_TAG = __webpack_require__(5)('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; -} - - -/***/ }), -/* 310 */ -/***/ (function(module, exports, __webpack_require__) { - -// ie9- setTimeout & setInterval additional parameters fix -var global = __webpack_require__(2); -var $export = __webpack_require__(0); -var userAgent = __webpack_require__(56); -var slice = [].slice; -var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check -var wrap = function (set) { - return function (fn, time /* , ...args */) { - var boundArgs = arguments.length > 2; - var args = boundArgs ? slice.call(arguments, 2) : false; - return set(boundArgs ? function () { - // eslint-disable-next-line no-new-func - (typeof fn == 'function' ? fn : Function(fn)).apply(this, args); - } : fn, time); - }; -}; -$export($export.G + $export.B + $export.F * MSIE, { - setTimeout: wrap(global.setTimeout), - setInterval: wrap(global.setInterval) -}); - - -/***/ }), -/* 311 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var ctx = __webpack_require__(16); -var $export = __webpack_require__(0); -var createDesc = __webpack_require__(28); -var assign = __webpack_require__(68); -var create = __webpack_require__(32); -var getPrototypeOf = __webpack_require__(13); -var getKeys = __webpack_require__(31); -var dP = __webpack_require__(7); -var keyOf = __webpack_require__(312); -var aFunction = __webpack_require__(10); -var forOf = __webpack_require__(34); -var isIterable = __webpack_require__(122); -var $iterCreate = __webpack_require__(54); -var step = __webpack_require__(83); -var isObject = __webpack_require__(3); -var toIObject = __webpack_require__(11); -var DESCRIPTORS = __webpack_require__(8); -var has = __webpack_require__(15); - -// 0 -> Dict.forEach -// 1 -> Dict.map -// 2 -> Dict.filter -// 3 -> Dict.some -// 4 -> Dict.every -// 5 -> Dict.find -// 6 -> Dict.findKey -// 7 -> Dict.mapPairs -var createDictMethod = function (TYPE) { - var IS_MAP = TYPE == 1; - var IS_EVERY = TYPE == 4; - return function (object, callbackfn, that /* = undefined */) { - var f = ctx(callbackfn, that, 3); - var O = toIObject(object); - var result = IS_MAP || TYPE == 7 || TYPE == 2 - ? new (typeof this == 'function' ? this : Dict)() : undefined; - var key, val, res; - for (key in O) if (has(O, key)) { - val = O[key]; - res = f(val, key, object); - if (TYPE) { - if (IS_MAP) result[key] = res; // map - else if (res) switch (TYPE) { - case 2: result[key] = val; break; // filter - case 3: return true; // some - case 5: return val; // find - case 6: return key; // findKey - case 7: result[res[0]] = res[1]; // mapPairs - } else if (IS_EVERY) return false; // every - } - } - return TYPE == 3 || IS_EVERY ? IS_EVERY : result; - }; -}; -var findKey = createDictMethod(6); - -var createDictIter = function (kind) { - return function (it) { - return new DictIterator(it, kind); - }; -}; -var DictIterator = function (iterated, kind) { - this._t = toIObject(iterated); // target - this._a = getKeys(iterated); // keys - this._i = 0; // next index - this._k = kind; // kind -}; -$iterCreate(DictIterator, 'Dict', function () { - var that = this; - var O = that._t; - var keys = that._a; - var kind = that._k; - var key; - do { - if (that._i >= keys.length) { - that._t = undefined; - return step(1); - } - } while (!has(O, key = keys[that._i++])); - if (kind == 'keys') return step(0, key); - if (kind == 'values') return step(0, O[key]); - return step(0, [key, O[key]]); -}); - -function Dict(iterable) { - var dict = create(null); - if (iterable != undefined) { - if (isIterable(iterable)) { - forOf(iterable, true, function (key, value) { - dict[key] = value; - }); - } else assign(dict, iterable); - } - return dict; -} -Dict.prototype = null; - -function reduce(object, mapfn, init) { - aFunction(mapfn); - var O = toIObject(object); - var keys = getKeys(O); - var length = keys.length; - var i = 0; - var memo, key; - if (arguments.length < 3) { - if (!length) throw TypeError('Reduce of empty object with no initial value'); - memo = O[keys[i++]]; - } else memo = Object(init); - while (length > i) if (has(O, key = keys[i++])) { - memo = mapfn(memo, O[key], key, object); - } - return memo; -} - -function includes(object, el) { - // eslint-disable-next-line no-self-compare - return (el == el ? keyOf(object, el) : findKey(object, function (it) { - // eslint-disable-next-line no-self-compare - return it != it; - })) !== undefined; -} - -function get(object, key) { - if (has(object, key)) return object[key]; -} -function set(object, key, value) { - if (DESCRIPTORS && key in Object) dP.f(object, key, createDesc(0, value)); - else object[key] = value; - return object; -} - -function isDict(it) { - return isObject(it) && getPrototypeOf(it) === Dict.prototype; -} - -$export($export.G + $export.F, { Dict: Dict }); - -$export($export.S, 'Dict', { - keys: createDictIter('keys'), - values: createDictIter('values'), - entries: createDictIter('entries'), - forEach: createDictMethod(0), - map: createDictMethod(1), - filter: createDictMethod(2), - some: createDictMethod(3), - every: createDictMethod(4), - find: createDictMethod(5), - findKey: findKey, - mapPairs: createDictMethod(7), - reduce: reduce, - keyOf: keyOf, - includes: includes, - has: has, - get: get, - set: set, - isDict: isDict -}); - - -/***/ }), -/* 312 */ -/***/ (function(module, exports, __webpack_require__) { - -var getKeys = __webpack_require__(31); -var toIObject = __webpack_require__(11); -module.exports = function (object, el) { - var O = toIObject(object); - var keys = getKeys(O); - var length = keys.length; - var index = 0; - var key; - while (length > index) if (O[key = keys[index++]] === el) return key; -}; - - -/***/ }), -/* 313 */ -/***/ (function(module, exports, __webpack_require__) { - -var anObject = __webpack_require__(1); -var get = __webpack_require__(48); -module.exports = __webpack_require__(12).getIterator = function (it) { - var iterFn = get(it); - if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!'); - return anObject(iterFn.call(it)); -}; - - -/***/ }), -/* 314 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(2); -var core = __webpack_require__(12); -var $export = __webpack_require__(0); -var partial = __webpack_require__(123); -// https://esdiscuss.org/topic/promise-returning-delay-function -$export($export.G + $export.F, { - delay: function delay(time) { - return new (core.Promise || global.Promise)(function (resolve) { - setTimeout(partial.call(resolve, true), time); - }); - } -}); - - -/***/ }), -/* 315 */ -/***/ (function(module, exports, __webpack_require__) { - -var path = __webpack_require__(124); -var $export = __webpack_require__(0); - -// Placeholder -__webpack_require__(12)._ = path._ = path._ || {}; - -$export($export.P + $export.F, 'Function', { part: __webpack_require__(123) }); - - -/***/ }), -/* 316 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); - -$export($export.S + $export.F, 'Object', { isObject: __webpack_require__(3) }); - - -/***/ }), -/* 317 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); - -$export($export.S + $export.F, 'Object', { classof: __webpack_require__(37) }); - - -/***/ }), -/* 318 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var define = __webpack_require__(125); - -$export($export.S + $export.F, 'Object', { define: define }); - - -/***/ }), -/* 319 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var define = __webpack_require__(125); -var create = __webpack_require__(32); - -$export($export.S + $export.F, 'Object', { - make: function (proto, mixin) { - return define(create(proto), mixin); - } -}); - - -/***/ }), -/* 320 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -__webpack_require__(53)(Number, 'Number', function (iterated) { - this._l = +iterated; - this._i = 0; -}, function () { - var i = this._i++; - var done = !(i < this._l); - return { done: done, value: done ? undefined : i }; -}); - - -/***/ }), -/* 321 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/benjamingr/RexExp.escape -var $export = __webpack_require__(0); -var $re = __webpack_require__(89)(/[\\^$*+?.()|[\]{}]/g, '\\$&'); - -$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } }); - - -/***/ }), -/* 322 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $re = __webpack_require__(89)(/[&<>"']/g, { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' -}); - -$export($export.P + $export.F, 'String', { escapeHTML: function escapeHTML() { return $re(this); } }); - - -/***/ }), -/* 323 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $re = __webpack_require__(89)(/&(?:amp|lt|gt|quot|apos);/g, { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'" -}); - -$export($export.P + $export.F, 'String', { unescapeHTML: function unescapeHTML() { return $re(this); } }); - - -/***/ }) -/******/ ]); -// CommonJS export -if (typeof module != 'undefined' && module.exports) module.exports = __e; -// RequireJS export -else if (typeof define == 'function' && define.amd) define(function () { return __e; }); -// Export to global object -else __g.core = __e; -}(1, 1); \ No newline at end of file diff --git a/node_modules/core-js/client/library.min.js b/node_modules/core-js/client/library.min.js deleted file mode 100644 index f49c0a021..000000000 --- a/node_modules/core-js/client/library.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * core-js 2.5.7 - * https://github.com/zloirock/core-js - * License: http://rock.mit-license.org - * © 2018 Denis Pushkarev - */ -!function(e,i,Jt){"use strict";!function(r){var e={};function __webpack_require__(t){if(e[t])return e[t].exports;var n=e[t]={i:t,l:!1,exports:{}};return r[t].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}__webpack_require__.m=r,__webpack_require__.c=e,__webpack_require__.d=function(t,n,r){__webpack_require__.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},__webpack_require__.n=function(t){var n=t&&t.__esModule?function getDefault(){return t["default"]}:function getModuleExports(){return t};return __webpack_require__.d(n,"a",n),n},__webpack_require__.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=126)}([function(t,n,r){var y=r(2),g=r(12),d=r(16),_=r(17),b=r(15),S="prototype",m=function(t,n,r){var e,i,o,u=t&m.F,c=t&m.G,f=t&m.S,a=t&m.P,s=t&m.B,l=t&m.W,h=c?g:g[n]||(g[n]={}),p=h[S],v=c?y:f?y[n]:(y[n]||{})[S];for(e in c&&(r=n),r)(i=!u&&v&&v[e]!==Jt)&&b(h,e)||(o=i?v[e]:r[e],h[e]=c&&"function"!=typeof v[e]?r[e]:s&&i?d(o,y):l&&v[e]==o?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t[S]=e[S],t}(o):a&&"function"==typeof o?d(Function.call,o):o,a&&((h.virtual||(h.virtual={}))[e]=o,t&m.R&&p&&!p[e]&&_(p,e,o)))};m.F=1,m.G=2,m.S=4,m.P=8,m.B=16,m.W=32,m.U=64,m.R=128,t.exports=m},function(t,n,r){var e=r(3);t.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof i&&(i=r)},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},function(t,n,r){var e=r(49)("wks"),i=r(40),o=r(2).Symbol,u="function"==typeof o;(t.exports=function(t){return e[t]||(e[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=e},function(t,n,r){var e=r(22),i=Math.min;t.exports=function(t){return 0"+i+""};t.exports=function(n,t){var r={};r[n]=t(o),e(e.P+e.F*i(function(){var t=""[n]('"');return t!==t.toLowerCase()||3document.F=Object<\/script>"),t.close(),s=t.F;r--;)delete s[a][u[r]];return s()};t.exports=Object.create||function create(t,n){var r;return null!==t?(f[a]=i(t),r=new f,f[a]=null,r[c]=t):r=s(),n===Jt?r:o(r,n)}},function(t,n){t.exports=function(){}},function(t,n,r){var h=r(16),p=r(104),v=r(77),y=r(1),g=r(6),d=r(48),_={},b={};(n=t.exports=function(t,n,r,e,i){var o,u,c,f,a=i?function(){return t}:d(t),s=h(r,e,n?2:1),l=0;if("function"!=typeof a)throw TypeError(t+" is not iterable!");if(v(a)){for(o=g(t.length);l>>=1)&&(n+=n))1&e&&(r+=n);return r}},function(t,n){t.exports="\t\n\x0B\f\r   ᠎              \u2028\u2029\ufeff"},function(t,n){t.exports=Math.sign||function sign(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,n){var r=Math.expm1;t.exports=!r||22025.465794806718>1,s=23===n?I(2,-24)-I(2,-77):0,l=0,h=t<0||0===t&&1/t<0?1:0;for((t=F(t))!=t||t===M?(i=t!=t?1:0,e=f):(e=k(A(t)/j),t*(o=I(2,-e))<1&&(e--,o*=2),2<=(t+=1<=e+a?s/o:s*I(2,1-a))*o&&(e++,o/=2),f<=e+a?(i=0,e=f):1<=e+a?(i=(t*o-1)*I(2,n),e+=a):(i=t*I(2,a-1)*I(2,n),e=0));8<=n;u[l++]=255&i,i/=256,n-=8);for(e=e<>1,c=i-7,f=r-1,a=t[f--],s=127&a;for(a>>=7;0>=-c,c+=n;0>8&255]}function packI32(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function packF64(t){return packIEEE754(t,52,8)}function packF32(t){return packIEEE754(t,23,4)}function addGetter(t,n,r){y(t[S],n,{get:function(){return this[r]}})}function get(t,n,r,e){var i=p(+r);if(t[D]>24)},setUint8:function setUint8(t,n){B.call(this,t,n<<24>>24)}},!0)}else w=function ArrayBuffer(t){s(this,w,_);var n=p(t);this._b=g.call(new Array(n),0),this[D]=n},x=function DataView(t,n,r){s(this,x,b),s(t,w,b);var e=t[D],i=l(n);if(i<0||e>24},getUint8:function getUint8(t){return get(this,1,t)[0]},getInt16:function getInt16(t){var n=get(this,2,t,arguments[1]);return(n[1]<<8|n[0])<<16>>16},getUint16:function getUint16(t){var n=get(this,2,t,arguments[1]);return n[1]<<8|n[0]},getInt32:function getInt32(t){return unpackI32(get(this,4,t,arguments[1]))},getUint32:function getUint32(t){return unpackI32(get(this,4,t,arguments[1]))>>>0},getFloat32:function getFloat32(t){return unpackIEEE754(get(this,4,t,arguments[1]),23,4)},getFloat64:function getFloat64(t){return unpackIEEE754(get(this,8,t,arguments[1]),52,8)},setInt8:function setInt8(t,n){set(this,1,t,packI8,n)},setUint8:function setUint8(t,n){set(this,1,t,packI8,n)},setInt16:function setInt16(t,n){set(this,2,t,packI16,n,arguments[2])},setUint16:function setUint16(t,n){set(this,2,t,packI16,n,arguments[2])},setInt32:function setInt32(t,n){set(this,4,t,packI32,n,arguments[2])},setUint32:function setUint32(t,n){set(this,4,t,packI32,n,arguments[2])},setFloat32:function setFloat32(t,n){set(this,4,t,packF32,n,arguments[2])},setFloat64:function setFloat64(t,n){set(this,8,t,packF64,n,arguments[2])}});d(w,_),d(x,b),c(x[S],u.VIEW,!0),n[_]=w,n[b]=x},function(t,n){t.exports=function(n,r){var e=r===Object(r)?function(t){return r[t]}:r;return function(t){return String(t).replace(n,e)}}},function(t,n,r){t.exports=!r(8)&&!r(4)(function(){return 7!=Object.defineProperty(r(62)("div"),"a",{get:function(){return 7}}).a})},function(t,n,r){n.f=r(5)},function(t,n,r){var u=r(15),c=r(11),f=r(50)(!1),a=r(65)("IE_PROTO");t.exports=function(t,n){var r,e=c(t),i=0,o=[];for(r in e)r!=a&&u(e,r)&&o.push(r);for(;i>>0||(u.test(r)?16:10))}:e},function(t,n){t.exports=Math.log1p||function log1p(t){return-1e-8<(t=+t)&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,n,r){var o=r(72),e=Math.pow,u=e(2,-52),c=e(2,-23),f=e(2,127)*(2-c),a=e(2,-126);t.exports=Math.fround||function fround(t){var n,r,e=Math.abs(t),i=o(t);return e>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,n,r){var e=r(0),i=Math.exp;e(e.S,"Math",{cosh:function cosh(t){return(i(t=+t)+i(-t))/2}})},function(t,n,r){var e=r(0),i=r(73);e(e.S+e.F*(i!=Math.expm1),"Math",{expm1:i})},function(t,n,r){var e=r(0);e(e.S,"Math",{fround:r(102)})},function(t,n,r){var e=r(0),f=Math.abs;e(e.S,"Math",{hypot:function hypot(t,n){for(var r,e,i=0,o=0,u=arguments.length,c=0;o>>16)*u+o*(r&i>>>16)<<16>>>0)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{log10:function log10(t){return Math.log(t)*Math.LOG10E}})},function(t,n,r){var e=r(0);e(e.S,"Math",{log1p:r(101)})},function(t,n,r){var e=r(0);e(e.S,"Math",{log2:function log2(t){return Math.log(t)/Math.LN2}})},function(t,n,r){var e=r(0);e(e.S,"Math",{sign:r(72)})},function(t,n,r){var e=r(0),i=r(73),o=Math.exp;e(e.S+e.F*r(4)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function sinh(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},function(t,n,r){var e=r(0),i=r(73),o=Math.exp;e(e.S,"Math",{tanh:function tanh(t){var n=i(t=+t),r=i(-t);return n==Infinity?1:r==Infinity?-1:(n-r)/(o(t)+o(-t))}})},function(t,n,r){var e=r(0);e(e.S,"Math",{trunc:function trunc(t){return(0>10),n%1024+56320))}return r.join("")}})},function(t,n,r){var e=r(0),u=r(11),c=r(6);e(e.S,"String",{raw:function raw(t){for(var n=u(t.raw),r=c(n.length),e=arguments.length,i=[],o=0;o>>0,o=r>>>0;return(n>>>0)+(e>>>0)+((i&o|(i|o)&~(i+o>>>0))>>>31)|0}})},function(t,n,r){var e=r(0);e(e.S,"Math",{isubh:function isubh(t,n,r,e){var i=t>>>0,o=r>>>0;return(n>>>0)-(e>>>0)-((~i&o|~(i^o)&i-o>>>0)>>>31)|0}})},function(t,n,r){var e=r(0);e(e.S,"Math",{imulh:function imulh(t,n){var r=+t,e=+n,i=65535&r,o=65535&e,u=r>>16,c=e>>16,f=(u*o>>>0)+(i*o>>>16);return u*c+(f>>16)+((i*c>>>0)+(65535&f)>>16)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{RAD_PER_DEG:180/Math.PI})},function(t,n,r){var e=r(0),i=Math.PI/180;e(e.S,"Math",{radians:function radians(t){return t*i}})},function(t,n,r){var e=r(0);e(e.S,"Math",{scale:r(121)})},function(t,n,r){var e=r(0);e(e.S,"Math",{umulh:function umulh(t,n){var r=+t,e=+n,i=65535&r,o=65535&e,u=r>>>16,c=e>>>16,f=(u*o>>>0)+(i*o>>>16);return u*c+(f>>>16)+((i*c>>>0)+(65535&f)>>>16)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{signbit:function signbit(t){return(t=+t)!=t?t:0==t?1/t==Infinity:0"']/g,{"&":"&","<":"<",">":">",'"':""","'":"'"});e(e.P+e.F,"String",{escapeHTML:function escapeHTML(){return i(this)}})},function(t,n,r){var e=r(0),i=r(89)(/&(?:amp|lt|gt|quot|apos);/g,{"&":"&","<":"<",">":">",""":'"',"'":"'"});e(e.P+e.F,"String",{unescapeHTML:function unescapeHTML(){return i(this)}})}]),"undefined"!=typeof module&&module.exports?module.exports=e:"function"==typeof define&&define.amd?define(function(){return e}):i.core=e}(1,1); -//# sourceMappingURL=library.min.js.map \ No newline at end of file diff --git a/node_modules/core-js/client/library.min.js.map b/node_modules/core-js/client/library.min.js.map deleted file mode 100644 index eda6ec32c..000000000 --- a/node_modules/core-js/client/library.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["library.js"],"names":["__e","__g","undefined","modules","installedModules","__webpack_require__","moduleId","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","getDefault","getModuleExports","object","property","prototype","hasOwnProperty","p","s","global","core","ctx","hide","has","PROTOTYPE","$export","type","source","key","own","out","IS_FORCED","F","IS_GLOBAL","G","IS_STATIC","S","IS_PROTO","P","IS_BIND","B","IS_WRAP","W","expProto","target","C","a","b","this","arguments","length","apply","Function","virtual","R","U","isObject","it","TypeError","window","Math","self","exec","e","store","uid","Symbol","USE_SYMBOL","toInteger","min","anObject","IE8_DOM_DEFINE","toPrimitive","dP","f","O","Attributes","value","defined","IObject","version","toObject","IE_PROTO","ObjectProto","getPrototypeOf","constructor","fails","quot","createHTML","string","tag","attribute","String","p1","replace","NAME","test","toLowerCase","split","aFunction","fn","that","createDesc","pIE","toIObject","gOPD","getOwnPropertyDescriptor","method","arg","toLength","asc","TYPE","$create","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","create","$this","callbackfn","val","res","index","result","push","toString","slice","ceil","floor","isNaN","KEY","exp","LIBRARY","$typed","$buffer","anInstance","propertyDesc","redefineAll","toIndex","toAbsoluteIndex","classof","isArrayIter","gOPN","getIterFn","wks","createArrayMethod","createArrayIncludes","speciesConstructor","ArrayIterators","Iterators","$iterDetect","setSpecies","arrayFill","arrayCopyWithin","$DP","$GOPD","RangeError","Uint8Array","ARRAY_BUFFER","SHARED_BUFFER","BYTES_PER_ELEMENT","ArrayProto","Array","$ArrayBuffer","ArrayBuffer","$DataView","DataView","arrayForEach","arrayFilter","arraySome","arrayEvery","arrayFind","arrayFindIndex","arrayIncludes","arrayIndexOf","arrayValues","values","arrayKeys","keys","arrayEntries","entries","arrayLastIndexOf","lastIndexOf","arrayReduce","reduce","arrayReduceRight","reduceRight","arrayJoin","join","arraySort","sort","arraySlice","arrayToString","arrayToLocaleString","toLocaleString","ITERATOR","TAG","TYPED_CONSTRUCTOR","DEF_CONSTRUCTOR","ALL_CONSTRUCTORS","CONSTR","TYPED_ARRAY","TYPED","VIEW","WRONG_LENGTH","$map","allocate","LITTLE_ENDIAN","Uint16Array","buffer","FORCED_SET","set","toOffset","BYTES","offset","validate","speciesFromList","list","fromList","addGetter","internal","_d","$from","from","step","iterator","aLen","mapfn","mapping","iterFn","next","done","$of","of","TO_LOCALE_BUG","$toLocaleString","proto","copyWithin","start","every","fill","filter","find","predicate","findIndex","forEach","indexOf","searchElement","includes","separator","map","reverse","middle","some","comparefn","subarray","begin","end","$begin","byteOffset","$slice","$set","arrayLike","src","len","$iterators","isTAIndex","$getDesc","$setDesc","desc","writable","$TypedArrayPrototype$","wrapper","CLAMPED","GETTER","SETTER","TypedArray","Base","TAC","TypedArrayPrototype","addElement","data","v","round","ABV","$offset","$length","byteLength","klass","$len","iter","concat","$nativeIterator","CORRECT_ITER_NAME","$iterator","Map","shared","getOrCreateMetadataMap","targetKey","targetMetadata","keyMetadata","MetadataKey","metadataMap","MetadataValue","_","valueOf","bitmap","META","setDesc","id","isExtensible","FREEZE","preventExtensions","setMeta","w","meta","NEED","fastKey","getWeak","onFreeze","$keys","enumBugKeys","dPs","Empty","createDict","iframeDocument","iframe","style","display","appendChild","contentWindow","document","open","write","lt","close","Properties","BREAK","RETURN","iterable","max","cof","ARG","T","tryGet","callee","Constructor","forbiddenField","safe","px","random","def","stat","DESCRIPTORS","SPECIES","_t","propertyIsEnumerable","hiddenKeys","getOwnPropertyNames","spaces","space","ltrim","RegExp","rtrim","exporter","ALIAS","FORCE","trim","getIteratorMethod","SHARED","mode","copyright","IS_INCLUDES","el","fromIndex","getOwnPropertySymbols","isArray","redefine","$iterCreate","setToStringTag","BUGGY","VALUES","returnThis","DEFAULT","IS_SET","FORCED","methods","IteratorPrototype","getMethod","kind","DEF_VALUES","VALUES_BUG","$native","$default","$entries","$anyNative","descriptor","D","navigator","userAgent","forOf","each","common","IS_WEAK","ADDER","_c","IS_ADDER","size","getConstructor","setStrong","Typed","TypedArrayConstructors","K","__defineSetter__","COLLECTION","A","cb","mapFn","nextItem","is","createElement","wksExt","$Symbol","charAt","documentElement","getKeys","gOPS","$assign","assign","k","getSymbols","isEnum","j","args","un","repeat","count","str","Infinity","sign","x","$expm1","expm1","TO_STRING","pos","charCodeAt","isRegExp","searchString","MATCH","re","$defineProperty","SAFE_CLOSING","riter","skipClosing","arr","original","endPos","addToUnscopables","iterated","_i","_k","Arguments","defer","channel","port","invoke","html","cel","process","setTask","setImmediate","clearTask","clearImmediate","MessageChannel","Dispatch","counter","queue","ONREADYSTATECHANGE","run","listener","event","nextTick","now","port2","port1","onmessage","postMessage","addEventListener","importScripts","removeChild","setTimeout","clear","macrotask","Observer","MutationObserver","WebKitMutationObserver","Promise","isNode","head","last","notify","flush","parent","domain","exit","enter","standalone","resolve","promise","then","toggle","node","createTextNode","observe","characterData","task","PromiseCapability","reject","$$resolve","$$reject","Reflect","ownKeys","DATA_VIEW","WRONG_INDEX","BaseBuffer","abs","pow","log","LN2","BYTE_LENGTH","BYTE_OFFSET","$BUFFER","$LENGTH","$OFFSET","packIEEE754","mLen","nBytes","eLen","eMax","eBias","rt","unpackIEEE754","nBits","NaN","unpackI32","bytes","packI8","packI16","packI32","packF64","packF32","view","isLittleEndian","intIndex","pack","_b","conversion","ArrayBufferProto","$setInt8","setInt8","getInt8","setUint8","bufferLength","getUint8","getInt16","getUint16","getInt32","getUint32","getFloat32","getFloat64","setInt16","setUint16","setInt32","setUint32","setFloat32","setFloat64","regExp","replacer","part","names","defineProperties","windowNames","getWindowNames","check","setPrototypeOf","buggy","__proto__","factories","bind","partArgs","bound","construct","msg","isInteger","isFinite","$parseFloat","parseFloat","$trim","$parseInt","parseInt","ws","hex","radix","log1p","EPSILON","EPSILON32","MAX32","MIN32","fround","$abs","$sign","ret","memo","isRight","to","inc","newPromiseCapability","promiseCapability","strong","entry","getEntry","$iterDefine","SIZE","_f","_l","r","delete","prev","Set","add","InternalMap","weak","WEAK_MAP","uncaughtFrozenStore","ufstore","tmp","WeakMap","$WeakMap","freeze","$has","UncaughtFrozenStore","findUncaughtFrozen","splice","getTime","Date","$toISOString","toISOString","lz","num","y","getUTCFullYear","getUTCMilliseconds","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","number","IS_CONCAT_SPREADABLE","flattenIntoArray","sourceLen","depth","mapper","thisArg","element","spreadable","targetIndex","sourceIndex","maxLength","fillString","left","stringLength","fillStr","intMaxLength","fillLen","stringFiller","isEntries","toJSON","scale","inLow","inHigh","outLow","outHigh","isIterable","path","pargs","holder","define","mixin","$fails","wksDefine","enumKeys","_create","gOPNExt","$JSON","JSON","_stringify","stringify","HIDDEN","TO_PRIMITIVE","SymbolRegistry","AllSymbols","OPSymbols","USE_NATIVE","QObject","setter","findChild","setSymbolDesc","protoDesc","wrap","sym","isSymbol","$defineProperties","$propertyIsEnumerable","E","$getOwnPropertyDescriptor","$getOwnPropertyNames","$getOwnPropertySymbols","IS_OP","es6Symbols","wellKnownSymbols","for","keyFor","useSetter","useSimple","$replacer","symbols","$getPrototypeOf","$freeze","$seal","seal","$preventExtensions","$isFrozen","isFrozen","$isSealed","isSealed","$isExtensible","HAS_INSTANCE","FunctionProto","aNumberValue","$toFixed","toFixed","ERROR","multiply","c2","divide","numToString","t","acc","fractionDigits","z","x2","$toPrecision","toPrecision","precision","_isFinite","isSafeInteger","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","Number","sqrt","$acosh","acosh","MAX_VALUE","$asinh","asinh","$atanh","atanh","cbrt","clz32","LOG2E","cosh","hypot","value1","value2","div","sum","larg","$imul","imul","UINT16","xn","yn","xl","yl","log10","LOG10E","log2","sinh","tanh","trunc","fromCharCode","$fromCodePoint","fromCodePoint","code","raw","callSite","tpl","$at","codePointAt","context","ENDS_WITH","$endsWith","endsWith","endPosition","search","INCLUDES","STARTS_WITH","$startsWith","startsWith","point","anchor","big","blink","bold","fixed","fontcolor","color","fontsize","italics","link","url","small","strike","sub","sup","createProperty","upTo","cloned","$sort","$forEach","STRICT","$filter","$some","$every","$reduce","$indexOf","NEGATIVE_ZERO","$find","forced","Internal","newGenericPromiseCapability","OwnPromiseCapability","Wrapper","microtask","newPromiseCapabilityModule","perform","promiseResolve","PROMISE","versions","v8","$Promise","empty","FakePromise","PromiseRejectionEvent","isThenable","isReject","_n","chain","_v","ok","_s","reaction","exited","handler","fail","_h","onHandleUnhandled","onUnhandled","console","unhandled","isUnhandled","emit","onunhandledrejection","reason","error","_a","onrejectionhandled","$reject","_w","$resolve","executor","err","onFulfilled","onRejected","catch","capability","all","remaining","$index","alreadyCalled","race","WEAK_SET","WeakSet","rApply","fApply","thisArgument","argumentsList","L","rConstruct","NEW_TARGET_BUG","ARGS_BUG","Target","newTarget","$args","instance","propertyKey","attributes","deleteProperty","Enumerate","enumerate","receiver","getProto","V","existingDescriptor","ownDesc","setProto","pv","$isView","isView","first","fin","viewS","viewT","init","Int8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint32Array","Float32Array","Float64Array","$includes","arraySpeciesCreate","flatMap","flatten","depthArg","at","$pad","padStart","padEnd","trimLeft","trimRight","getFlags","RegExpProto","$RegExpStringIterator","regexp","_r","match","matchAll","flags","rx","lastIndex","ignoreCase","multiline","unicode","sticky","getOwnPropertyDescriptors","getDesc","$values","__defineGetter__","__lookupGetter__","__lookupSetter__","isError","clamp","lower","upper","DEG_PER_RAD","PI","RAD_PER_DEG","degrees","radians","fscale","iaddh","x0","x1","y0","y1","$x0","$y0","isubh","imulh","u","$u","$v","u0","v0","u1","v1","umulh","signbit","finally","onFinally","isFunction","try","metadata","toMetaKey","ordinaryDefineOwnMetadata","defineMetadata","metadataKey","metadataValue","deleteMetadata","ordinaryHasOwnMetadata","ordinaryGetOwnMetadata","ordinaryGetMetadata","getMetadata","ordinaryOwnMetadataKeys","ordinaryMetadataKeys","oKeys","pKeys","getMetadataKeys","getOwnMetadata","getOwnMetadataKeys","ordinaryHasMetadata","hasMetadata","hasOwnMetadata","$metadata","decorator","asap","OBSERVABLE","cleanupSubscription","subscription","cleanup","subscriptionClosed","_o","closeSubscription","Subscription","observer","subscriber","SubscriptionObserver","unsubscribe","complete","$Observable","Observable","subscribe","observable","items","$task","TO_STRING_TAG","DOMIterables","Collection","MSIE","time","boundArgs","setInterval","keyOf","createDictMethod","Dict","findKey","createDictIter","DictIterator","dict","mapPairs","isDict","getIterator","partial","delay","make","$re","escape","&","<",">","\"","'","escapeHTML","&","<",">",""","'","unescapeHTML","amd"],"mappings":";;;;;;CAMC,SAASA,EAAKC,EAAKC,IACpB,cACS,SAAUC,GAET,IAAIC,EAAmB,GAGvB,SAASC,oBAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAJ,EAAQG,GAAUK,KAAKH,EAAOD,QAASC,EAAQA,EAAOD,QAASF,qBAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,oBAAoBO,EAAIT,EAGxBE,oBAAoBQ,EAAIT,EAGxBC,oBAAoBS,EAAI,SAASP,EAASQ,EAAMC,GAC3CX,oBAAoBY,EAAEV,EAASQ,IAClCG,OAAOC,eAAeZ,EAASQ,EAAM,CACpCK,cAAc,EACdC,YAAY,EACZC,IAAKN,KAMRX,oBAAoBkB,EAAI,SAASf,GAChC,IAAIQ,EAASR,GAAUA,EAAOgB,WAC7B,SAASC,aAAe,OAAOjB,EAAgB,YAC/C,SAASkB,mBAAqB,OAAOlB,GAEtC,OADAH,oBAAoBS,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRX,oBAAoBY,EAAI,SAASU,EAAQC,GAAY,OAAOV,OAAOW,UAAUC,eAAenB,KAAKgB,EAAQC,IAGzGvB,oBAAoB0B,EAAI,GAGjB1B,oBAAoBA,oBAAoB2B,EAAI,KA9DpD,CAiEC,CAEJ,SAAUxB,EAAQD,EAASF,GAEjC,IAAI4B,EAAS5B,EAAoB,GAC7B6B,EAAO7B,EAAoB,IAC3B8B,EAAM9B,EAAoB,IAC1B+B,EAAO/B,EAAoB,IAC3BgC,EAAMhC,EAAoB,IAC1BiC,EAAY,YAEZC,EAAU,SAAUC,EAAMzB,EAAM0B,GAClC,IASIC,EAAKC,EAAKC,EATVC,EAAYL,EAAOD,EAAQO,EAC3BC,EAAYP,EAAOD,EAAQS,EAC3BC,EAAYT,EAAOD,EAAQW,EAC3BC,EAAWX,EAAOD,EAAQa,EAC1BC,EAAUb,EAAOD,EAAQe,EACzBC,EAAUf,EAAOD,EAAQiB,EACzBjD,EAAUwC,EAAYb,EAAOA,EAAKnB,KAAUmB,EAAKnB,GAAQ,IACzD0C,EAAWlD,EAAQ+B,GACnBoB,EAASX,EAAYd,EAASgB,EAAYhB,EAAOlB,IAASkB,EAAOlB,IAAS,IAAIuB,GAGlF,IAAKI,KADDK,IAAWN,EAAS1B,GACZ0B,GAEVE,GAAOE,GAAaa,GAAUA,EAAOhB,KAASxC,KACnCmC,EAAI9B,EAASmC,KAExBE,EAAMD,EAAMe,EAAOhB,GAAOD,EAAOC,GAEjCnC,EAAQmC,GAAOK,GAAmC,mBAAfW,EAAOhB,GAAqBD,EAAOC,GAEpEW,GAAWV,EAAMR,EAAIS,EAAKX,GAE1BsB,GAAWG,EAAOhB,IAAQE,EAAM,SAAWe,GAC3C,IAAIb,EAAI,SAAUc,EAAGC,EAAGhD,GACtB,GAAIiD,gBAAgBH,EAAG,CACrB,OAAQI,UAAUC,QAChB,KAAK,EAAG,OAAO,IAAIL,EACnB,KAAK,EAAG,OAAO,IAAIA,EAAEC,GACrB,KAAK,EAAG,OAAO,IAAID,EAAEC,EAAGC,GACxB,OAAO,IAAIF,EAAEC,EAAGC,EAAGhD,GACrB,OAAO8C,EAAEM,MAAMH,KAAMC,YAGzB,OADAjB,EAAER,GAAaqB,EAAErB,GACVQ,EAXyB,CAa/BF,GAAOO,GAA0B,mBAAPP,EAAoBT,EAAI+B,SAASvD,KAAMiC,GAAOA,EAEvEO,KACD5C,EAAQ4D,UAAY5D,EAAQ4D,QAAU,KAAKzB,GAAOE,EAE/CJ,EAAOD,EAAQ6B,GAAKX,IAAaA,EAASf,IAAMN,EAAKqB,EAAUf,EAAKE,MAK9EL,EAAQO,EAAI,EACZP,EAAQS,EAAI,EACZT,EAAQW,EAAI,EACZX,EAAQa,EAAI,EACZb,EAAQe,EAAI,GACZf,EAAQiB,EAAI,GACZjB,EAAQ8B,EAAI,GACZ9B,EAAQ6B,EAAI,IACZ5D,EAAOD,QAAUgC,GAKX,SAAU/B,EAAQD,EAASF,GAEjC,IAAIiE,EAAWjE,EAAoB,GACnCG,EAAOD,QAAU,SAAUgE,GACzB,IAAKD,EAASC,GAAK,MAAMC,UAAUD,EAAK,sBACxC,OAAOA,IAMH,SAAU/D,EAAQD,GAGxB,IAAI0B,EAASzB,EAAOD,QAA2B,oBAAVkE,QAAyBA,OAAOC,MAAQA,KACzED,OAAwB,oBAARE,MAAuBA,KAAKD,MAAQA,KAAOC,KAE3DT,SAAS,cAATA,GACc,iBAAPjE,IAAiBA,EAAMgC,IAK5B,SAAUzB,EAAQD,GAExBC,EAAOD,QAAU,SAAUgE,GACzB,MAAqB,iBAAPA,EAAyB,OAAPA,EAA4B,mBAAPA,IAMjD,SAAU/D,EAAQD,GAExBC,EAAOD,QAAU,SAAUqE,GACzB,IACE,QAASA,IACT,MAAOC,GACP,OAAO,KAOL,SAAUrE,EAAQD,EAASF,GAEjC,IAAIyE,EAAQzE,EAAoB,GAApBA,CAAwB,OAChC0E,EAAM1E,EAAoB,IAC1B2E,EAAS3E,EAAoB,GAAG2E,OAChCC,EAA8B,mBAAVD,GAETxE,EAAOD,QAAU,SAAUQ,GACxC,OAAO+D,EAAM/D,KAAU+D,EAAM/D,GAC3BkE,GAAcD,EAAOjE,KAAUkE,EAAaD,EAASD,GAAK,UAAYhE,MAGjE+D,MAAQA,GAKX,SAAUtE,EAAQD,EAASF,GAGjC,IAAI6E,EAAY7E,EAAoB,IAChC8E,EAAMT,KAAKS,IACf3E,EAAOD,QAAU,SAAUgE,GACzB,OAAY,EAALA,EAASY,EAAID,EAAUX,GAAK,kBAAoB,IAMnD,SAAU/D,EAAQD,EAASF,GAEjC,IAAI+E,EAAW/E,EAAoB,GAC/BgF,EAAiBhF,EAAoB,IACrCiF,EAAcjF,EAAoB,IAClCkF,EAAKrE,OAAOC,eAEhBZ,EAAQiF,EAAInF,EAAoB,GAAKa,OAAOC,eAAiB,SAASA,eAAesE,EAAGrC,EAAGsC,GAIzF,GAHAN,EAASK,GACTrC,EAAIkC,EAAYlC,GAAG,GACnBgC,EAASM,GACLL,EAAgB,IAClB,OAAOE,EAAGE,EAAGrC,EAAGsC,GAChB,MAAOb,IACT,GAAI,QAASa,GAAc,QAASA,EAAY,MAAMlB,UAAU,4BAEhE,MADI,UAAWkB,IAAYD,EAAErC,GAAKsC,EAAWC,OACtCF,IAMH,SAAUjF,EAAQD,EAASF,GAGjCG,EAAOD,SAAWF,EAAoB,EAApBA,CAAuB,WACvC,OAA+E,GAAxEa,OAAOC,eAAe,GAAI,IAAK,CAAEG,IAAK,WAAc,OAAO,KAAQsC,KAMtE,SAAUpD,EAAQD,EAASF,GAGjC,IAAIuF,EAAUvF,EAAoB,IAClCG,EAAOD,QAAU,SAAUgE,GACzB,OAAOrD,OAAO0E,EAAQrB,MAMlB,SAAU/D,EAAQD,GAExBC,EAAOD,QAAU,SAAUgE,GACzB,GAAiB,mBAANA,EAAkB,MAAMC,UAAUD,EAAK,uBAClD,OAAOA,IAMH,SAAU/D,EAAQD,EAASF,GAGjC,IAAIwF,EAAUxF,EAAoB,IAC9BuF,EAAUvF,EAAoB,IAClCG,EAAOD,QAAU,SAAUgE,GACzB,OAAOsB,EAAQD,EAAQrB,MAMnB,SAAU/D,EAAQD,GAExB,IAAI2B,EAAO1B,EAAOD,QAAU,CAAEuF,QAAS,SACrB,iBAAP9F,IAAiBA,EAAMkC,IAK5B,SAAU1B,EAAQD,EAASF,GAGjC,IAAIgC,EAAMhC,EAAoB,IAC1B0F,EAAW1F,EAAoB,GAC/B2F,EAAW3F,EAAoB,GAApBA,CAAwB,YACnC4F,EAAc/E,OAAOW,UAEzBrB,EAAOD,QAAUW,OAAOgF,gBAAkB,SAAUT,GAElD,OADAA,EAAIM,EAASN,GACTpD,EAAIoD,EAAGO,GAAkBP,EAAEO,GACH,mBAAjBP,EAAEU,aAA6BV,aAAaA,EAAEU,YAChDV,EAAEU,YAAYtE,UACd4D,aAAavE,OAAS+E,EAAc,OAMzC,SAAUzF,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B+F,EAAQ/F,EAAoB,GAC5BuF,EAAUvF,EAAoB,IAC9BgG,EAAO,KAEPC,EAAa,SAAUC,EAAQC,EAAKC,EAAWd,GACjD,IAAIzC,EAAIwD,OAAOd,EAAQW,IACnBI,EAAK,IAAMH,EAEf,MADkB,KAAdC,IAAkBE,GAAM,IAAMF,EAAY,KAAOC,OAAOf,GAAOiB,QAAQP,EAAM,UAAY,KACtFM,EAAK,IAAMzD,EAAI,KAAOsD,EAAM,KAErChG,EAAOD,QAAU,SAAUsG,EAAMjC,GAC/B,IAAIa,EAAI,GACRA,EAAEoB,GAAQjC,EAAK0B,GACf/D,EAAQA,EAAQa,EAAIb,EAAQO,EAAIsD,EAAM,WACpC,IAAIU,EAAO,GAAGD,GAAM,KACpB,OAAOC,IAASA,EAAKC,eAA0C,EAAzBD,EAAKE,MAAM,KAAKhD,SACpD,SAAUyB,KAMV,SAAUjF,EAAQD,GAExB,IAAIuB,EAAiB,GAAGA,eACxBtB,EAAOD,QAAU,SAAUgE,EAAI7B,GAC7B,OAAOZ,EAAenB,KAAK4D,EAAI7B,KAM3B,SAAUlC,EAAQD,EAASF,GAGjC,IAAI4G,EAAY5G,EAAoB,IACpCG,EAAOD,QAAU,SAAU2G,EAAIC,EAAMnD,GAEnC,GADAiD,EAAUC,GACNC,IAASjH,GAAW,OAAOgH,EAC/B,OAAQlD,GACN,KAAK,EAAG,OAAO,SAAUJ,GACvB,OAAOsD,EAAGvG,KAAKwG,EAAMvD,IAEvB,KAAK,EAAG,OAAO,SAAUA,EAAGC,GAC1B,OAAOqD,EAAGvG,KAAKwG,EAAMvD,EAAGC,IAE1B,KAAK,EAAG,OAAO,SAAUD,EAAGC,EAAGhD,GAC7B,OAAOqG,EAAGvG,KAAKwG,EAAMvD,EAAGC,EAAGhD,IAG/B,OAAO,WACL,OAAOqG,EAAGjD,MAAMkD,EAAMpD,cAOpB,SAAUvD,EAAQD,EAASF,GAEjC,IAAIkF,EAAKlF,EAAoB,GACzB+G,EAAa/G,EAAoB,IACrCG,EAAOD,QAAUF,EAAoB,GAAK,SAAUsB,EAAQe,EAAKiD,GAC/D,OAAOJ,EAAGC,EAAE7D,EAAQe,EAAK0E,EAAW,EAAGzB,KACrC,SAAUhE,EAAQe,EAAKiD,GAEzB,OADAhE,EAAOe,GAAOiD,EACPhE,IAMH,SAAUnB,EAAQD,EAASF,GAEjC,IAAIgH,EAAMhH,EAAoB,IAC1B+G,EAAa/G,EAAoB,IACjCiH,EAAYjH,EAAoB,IAChCiF,EAAcjF,EAAoB,IAClCgC,EAAMhC,EAAoB,IAC1BgF,EAAiBhF,EAAoB,IACrCkH,EAAOrG,OAAOsG,yBAElBjH,EAAQiF,EAAInF,EAAoB,GAAKkH,EAAO,SAASC,yBAAyB/B,EAAGrC,GAG/E,GAFAqC,EAAI6B,EAAU7B,GACdrC,EAAIkC,EAAYlC,GAAG,GACfiC,EAAgB,IAClB,OAAOkC,EAAK9B,EAAGrC,GACf,MAAOyB,IACT,GAAIxC,EAAIoD,EAAGrC,GAAI,OAAOgE,GAAYC,EAAI7B,EAAE7E,KAAK8E,EAAGrC,GAAIqC,EAAErC,MAMlD,SAAU5C,EAAQD,EAASF,GAIjC,IAAI+F,EAAQ/F,EAAoB,GAEhCG,EAAOD,QAAU,SAAUkH,EAAQC,GACjC,QAASD,GAAUrB,EAAM,WAEvBsB,EAAMD,EAAO9G,KAAK,KAAM,aAA6B,GAAK8G,EAAO9G,KAAK,UAOpE,SAAUH,EAAQD,EAASF,GASjC,IAAI8B,EAAM9B,EAAoB,IAC1BwF,EAAUxF,EAAoB,IAC9B0F,EAAW1F,EAAoB,GAC/BsH,EAAWtH,EAAoB,GAC/BuH,EAAMvH,EAAoB,IAC9BG,EAAOD,QAAU,SAAUsH,EAAMC,GAC/B,IAAIC,EAAiB,GAARF,EACTG,EAAoB,GAARH,EACZI,EAAkB,GAARJ,EACVK,EAAmB,GAARL,EACXM,EAAwB,GAARN,EAChBO,EAAmB,GAARP,GAAaM,EACxBE,EAASP,GAAWF,EACxB,OAAO,SAAUU,EAAOC,EAAYpB,GAQlC,IAPA,IAMIqB,EAAKC,EANLhD,EAAIM,EAASuC,GACb3D,EAAOkB,EAAQJ,GACfD,EAAIrD,EAAIoG,EAAYpB,EAAM,GAC1BnD,EAAS2D,EAAShD,EAAKX,QACvB0E,EAAQ,EACRC,EAASZ,EAASM,EAAOC,EAAOtE,GAAUgE,EAAYK,EAAOC,EAAO,GAAKpI,GAE9DwI,EAAT1E,EAAgB0E,IAAS,IAAIN,GAAYM,KAAS/D,KAEtD8D,EAAMjD,EADNgD,EAAM7D,EAAK+D,GACEA,EAAOjD,GAChBoC,GACF,GAAIE,EAAQY,EAAOD,GAASD,OACvB,GAAIA,EAAK,OAAQZ,GACpB,KAAK,EAAG,OAAO,EACf,KAAK,EAAG,OAAOW,EACf,KAAK,EAAG,OAAOE,EACf,KAAK,EAAGC,EAAOC,KAAKJ,QACf,GAAIN,EAAU,OAAO,EAGhC,OAAOC,GAAiB,EAAIF,GAAWC,EAAWA,EAAWS,KAO3D,SAAUnI,EAAQD,GAExB,IAAIsI,EAAW,GAAGA,SAElBrI,EAAOD,QAAU,SAAUgE,GACzB,OAAOsE,EAASlI,KAAK4D,GAAIuE,MAAM,GAAI,KAM/B,SAAUtI,EAAQD,GAGxB,IAAIwI,EAAOrE,KAAKqE,KACZC,EAAQtE,KAAKsE,MACjBxI,EAAOD,QAAU,SAAUgE,GACzB,OAAO0E,MAAM1E,GAAMA,GAAM,GAAU,EAALA,EAASyE,EAAQD,GAAMxE,KAMjD,SAAU/D,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B6B,EAAO7B,EAAoB,IAC3B+F,EAAQ/F,EAAoB,GAChCG,EAAOD,QAAU,SAAU2I,EAAKtE,GAC9B,IAAIsC,GAAMhF,EAAKhB,QAAU,IAAIgI,IAAQhI,OAAOgI,GACxCC,EAAM,GACVA,EAAID,GAAOtE,EAAKsC,GAChB3E,EAAQA,EAAQW,EAAIX,EAAQO,EAAIsD,EAAM,WAAcc,EAAG,KAAQ,SAAUiC,KAMrE,SAAU3I,EAAQD,GAGxBC,EAAOD,QAAU,SAAUgE,GACzB,GAAIA,GAAMrE,GAAW,MAAMsE,UAAU,yBAA2BD,GAChE,OAAOA,IAMH,SAAU/D,EAAQD,EAASF,GAIjC,GAAIA,EAAoB,GAAI,CAC1B,IAAI+I,EAAU/I,EAAoB,IAC9B4B,EAAS5B,EAAoB,GAC7B+F,EAAQ/F,EAAoB,GAC5BkC,EAAUlC,EAAoB,GAC9BgJ,EAAShJ,EAAoB,IAC7BiJ,EAAUjJ,EAAoB,IAC9B8B,EAAM9B,EAAoB,IAC1BkJ,EAAalJ,EAAoB,IACjCmJ,EAAenJ,EAAoB,IACnC+B,EAAO/B,EAAoB,IAC3BoJ,EAAcpJ,EAAoB,IAClC6E,EAAY7E,EAAoB,IAChCsH,EAAWtH,EAAoB,GAC/BqJ,EAAUrJ,EAAoB,KAC9BsJ,EAAkBtJ,EAAoB,IACtCiF,EAAcjF,EAAoB,IAClCgC,EAAMhC,EAAoB,IAC1BuJ,EAAUvJ,EAAoB,IAC9BiE,EAAWjE,EAAoB,GAC/B0F,EAAW1F,EAAoB,GAC/BwJ,EAAcxJ,EAAoB,IAClCgI,EAAShI,EAAoB,IAC7B6F,EAAiB7F,EAAoB,IACrCyJ,EAAOzJ,EAAoB,IAAImF,EAC/BuE,EAAY1J,EAAoB,IAChC0E,EAAM1E,EAAoB,IAC1B2J,EAAM3J,EAAoB,GAC1B4J,EAAoB5J,EAAoB,IACxC6J,EAAsB7J,EAAoB,IAC1C8J,EAAqB9J,EAAoB,IACzC+J,EAAiB/J,EAAoB,IACrCgK,EAAYhK,EAAoB,IAChCiK,EAAcjK,EAAoB,IAClCkK,EAAalK,EAAoB,IACjCmK,EAAYnK,EAAoB,IAChCoK,EAAkBpK,EAAoB,KACtCqK,EAAMrK,EAAoB,GAC1BsK,EAAQtK,EAAoB,IAC5BkF,EAAKmF,EAAIlF,EACT+B,EAAOoD,EAAMnF,EACboF,EAAa3I,EAAO2I,WACpBpG,EAAYvC,EAAOuC,UACnBqG,EAAa5I,EAAO4I,WACpBC,EAAe,cACfC,EAAgB,SAAWD,EAC3BE,EAAoB,oBACpB1I,EAAY,YACZ2I,EAAaC,MAAM5I,GACnB6I,EAAe7B,EAAQ8B,YACvBC,EAAY/B,EAAQgC,SACpBC,EAAetB,EAAkB,GACjCuB,GAAcvB,EAAkB,GAChCwB,GAAYxB,EAAkB,GAC9ByB,GAAazB,EAAkB,GAC/B0B,GAAY1B,EAAkB,GAC9B2B,GAAiB3B,EAAkB,GACnC4B,GAAgB3B,GAAoB,GACpC4B,GAAe5B,GAAoB,GACnC6B,GAAc3B,EAAe4B,OAC7BC,GAAY7B,EAAe8B,KAC3BC,GAAe/B,EAAegC,QAC9BC,GAAmBpB,EAAWqB,YAC9BC,GAActB,EAAWuB,OACzBC,GAAmBxB,EAAWyB,YAC9BC,GAAY1B,EAAW2B,KACvBC,GAAY5B,EAAW6B,KACvBC,GAAa9B,EAAWnC,MACxBkE,GAAgB/B,EAAWpC,SAC3BoE,GAAsBhC,EAAWiC,eACjCC,GAAWnD,EAAI,YACfoD,GAAMpD,EAAI,eACVqD,GAAoBtI,EAAI,qBACxBuI,GAAkBvI,EAAI,mBACtBwI,GAAmBlE,EAAOmE,OAC1BC,GAAcpE,EAAOqE,MACrBC,GAAOtE,EAAOsE,KACdC,GAAe,gBAEfC,GAAO5D,EAAkB,EAAG,SAAUxE,EAAGzB,GAC3C,OAAO8J,GAAS3D,EAAmB1E,EAAGA,EAAE6H,KAAmBtJ,KAGzD+J,GAAgB3H,EAAM,WAExB,OAA0D,IAAnD,IAAIyE,EAAW,IAAImD,YAAY,CAAC,IAAIC,QAAQ,KAGjDC,KAAerD,KAAgBA,EAAWvI,GAAW6L,KAAO/H,EAAM,WACpE,IAAIyE,EAAW,GAAGsD,IAAI,MAGpBC,GAAW,SAAU7J,EAAI8J,GAC3B,IAAIC,EAASpJ,EAAUX,GACvB,GAAI+J,EAAS,GAAKA,EAASD,EAAO,MAAMzD,EAAW,iBACnD,OAAO0D,GAGLC,GAAW,SAAUhK,GACvB,GAAID,EAASC,IAAOkJ,MAAelJ,EAAI,OAAOA,EAC9C,MAAMC,EAAUD,EAAK,2BAGnBuJ,GAAW,SAAUnK,EAAGK,GAC1B,KAAMM,EAASX,IAAM0J,MAAqB1J,GACxC,MAAMa,EAAU,wCAChB,OAAO,IAAIb,EAAEK,IAGbwK,GAAkB,SAAU/I,EAAGgJ,GACjC,OAAOC,GAASvE,EAAmB1E,EAAGA,EAAE6H,KAAmBmB,IAGzDC,GAAW,SAAU/K,EAAG8K,GAI1B,IAHA,IAAI/F,EAAQ,EACR1E,EAASyK,EAAKzK,OACd2E,EAASmF,GAASnK,EAAGK,GACT0E,EAAT1E,GAAgB2E,EAAOD,GAAS+F,EAAK/F,KAC5C,OAAOC,GAGLgG,GAAY,SAAUpK,EAAI7B,EAAKkM,GACjCrJ,EAAGhB,EAAI7B,EAAK,CAAEpB,IAAK,WAAc,OAAOwC,KAAK+K,GAAGD,OAG9CE,GAAQ,SAASC,KAAKtM,GACxB,IAKIhC,EAAGuD,EAAQgI,EAAQrD,EAAQqG,EAAMC,EALjCxJ,EAAIM,EAAStD,GACbyM,EAAOnL,UAAUC,OACjBmL,EAAe,EAAPD,EAAWnL,UAAU,GAAK7D,GAClCkP,EAAUD,IAAUjP,GACpBmP,EAAStF,EAAUtE,GAEvB,GAAI4J,GAAUnP,KAAc2J,EAAYwF,GAAS,CAC/C,IAAKJ,EAAWI,EAAO1O,KAAK8E,GAAIuG,EAAS,GAAIvL,EAAI,IAAKuO,EAAOC,EAASK,QAAQC,KAAM9O,IAClFuL,EAAOpD,KAAKoG,EAAKrJ,OACjBF,EAAIuG,EAGR,IADIoD,GAAkB,EAAPF,IAAUC,EAAQhN,EAAIgN,EAAOpL,UAAU,GAAI,IACrDtD,EAAI,EAAGuD,EAAS2D,EAASlC,EAAEzB,QAAS2E,EAASmF,GAAShK,KAAME,GAAkBvD,EAATuD,EAAYvD,IACpFkI,EAAOlI,GAAK2O,EAAUD,EAAM1J,EAAEhF,GAAIA,GAAKgF,EAAEhF,GAE3C,OAAOkI,GAGL6G,GAAM,SAASC,KAIjB,IAHA,IAAI/G,EAAQ,EACR1E,EAASD,UAAUC,OACnB2E,EAASmF,GAAShK,KAAME,GACZ0E,EAAT1E,GAAgB2E,EAAOD,GAAS3E,UAAU2E,KACjD,OAAOC,GAIL+G,KAAkB7E,GAAczE,EAAM,WAAc6G,GAAoBtM,KAAK,IAAIkK,EAAW,MAE5F8E,GAAkB,SAASzC,iBAC7B,OAAOD,GAAoBhJ,MAAMyL,GAAgB3C,GAAWpM,KAAK4N,GAASzK,OAASyK,GAASzK,MAAOC,YAGjG6L,GAAQ,CACVC,WAAY,SAASA,WAAWnM,EAAQoM,GACtC,OAAOrF,EAAgB9J,KAAK4N,GAASzK,MAAOJ,EAAQoM,EAA0B,EAAnB/L,UAAUC,OAAaD,UAAU,GAAK7D,KAEnG6P,MAAO,SAASA,MAAMxH,GACpB,OAAOmD,GAAW6C,GAASzK,MAAOyE,EAA+B,EAAnBxE,UAAUC,OAAaD,UAAU,GAAK7D,KAEtF8P,KAAM,SAASA,KAAKrK,GAClB,OAAO6E,EAAUvG,MAAMsK,GAASzK,MAAOC,YAEzCkM,OAAQ,SAASA,OAAO1H,GACtB,OAAOiG,GAAgB1K,KAAM0H,GAAY+C,GAASzK,MAAOyE,EACpC,EAAnBxE,UAAUC,OAAaD,UAAU,GAAK7D,MAE1CgQ,KAAM,SAASA,KAAKC,GAClB,OAAOxE,GAAU4C,GAASzK,MAAOqM,EAA8B,EAAnBpM,UAAUC,OAAaD,UAAU,GAAK7D,KAEpFkQ,UAAW,SAASA,UAAUD,GAC5B,OAAOvE,GAAe2C,GAASzK,MAAOqM,EAA8B,EAAnBpM,UAAUC,OAAaD,UAAU,GAAK7D,KAEzFmQ,QAAS,SAASA,QAAQ9H,GACxBgD,EAAagD,GAASzK,MAAOyE,EAA+B,EAAnBxE,UAAUC,OAAaD,UAAU,GAAK7D,KAEjFoQ,QAAS,SAASA,QAAQC,GACxB,OAAOzE,GAAayC,GAASzK,MAAOyM,EAAkC,EAAnBxM,UAAUC,OAAaD,UAAU,GAAK7D,KAE3FsQ,SAAU,SAASA,SAASD,GAC1B,OAAO1E,GAAc0C,GAASzK,MAAOyM,EAAkC,EAAnBxM,UAAUC,OAAaD,UAAU,GAAK7D,KAE5F0M,KAAM,SAASA,KAAK6D,GAClB,OAAO9D,GAAU1I,MAAMsK,GAASzK,MAAOC,YAEzCuI,YAAa,SAASA,YAAYiE,GAChC,OAAOlE,GAAiBpI,MAAMsK,GAASzK,MAAOC,YAEhD2M,IAAK,SAASA,IAAIvB,GAChB,OAAOtB,GAAKU,GAASzK,MAAOqL,EAA0B,EAAnBpL,UAAUC,OAAaD,UAAU,GAAK7D,KAE3EsM,OAAQ,SAASA,OAAOjE,GACtB,OAAOgE,GAAYtI,MAAMsK,GAASzK,MAAOC,YAE3C2I,YAAa,SAASA,YAAYnE,GAChC,OAAOkE,GAAiBxI,MAAMsK,GAASzK,MAAOC,YAEhD4M,QAAS,SAASA,UAMhB,IALA,IAIIhL,EAJAwB,EAAOrD,KACPE,EAASuK,GAASpH,GAAMnD,OACxB4M,EAASlM,KAAKsE,MAAMhF,EAAS,GAC7B0E,EAAQ,EAELA,EAAQkI,GACbjL,EAAQwB,EAAKuB,GACbvB,EAAKuB,KAAWvB,IAAOnD,GACvBmD,EAAKnD,GAAU2B,EACf,OAAOwB,GAEX0J,KAAM,SAASA,KAAKtI,GAClB,OAAOkD,GAAU8C,GAASzK,MAAOyE,EAA+B,EAAnBxE,UAAUC,OAAaD,UAAU,GAAK7D,KAErF4M,KAAM,SAASA,KAAKgE,GAClB,OAAOjE,GAAUlM,KAAK4N,GAASzK,MAAOgN,IAExCC,SAAU,SAASA,SAASC,EAAOC,GACjC,IAAIxL,EAAI8I,GAASzK,MACbE,EAASyB,EAAEzB,OACXkN,EAASvH,EAAgBqH,EAAOhN,GACpC,OAAO,IAAKmG,EAAmB1E,EAAGA,EAAE6H,KAA7B,CACL7H,EAAEwI,OACFxI,EAAE0L,WAAaD,EAASzL,EAAEuF,kBAC1BrD,GAAUsJ,IAAQ/Q,GAAY8D,EAAS2F,EAAgBsH,EAAKjN,IAAWkN,MAKzEE,GAAS,SAAStI,MAAMgH,EAAOmB,GACjC,OAAOzC,GAAgB1K,KAAMiJ,GAAWpM,KAAK4N,GAASzK,MAAOgM,EAAOmB,KAGlEI,GAAO,SAASlD,IAAImD,GACtB/C,GAASzK,MACT,IAAIwK,EAASF,GAASrK,UAAU,GAAI,GAChCC,EAASF,KAAKE,OACduN,EAAMxL,EAASuL,GACfE,EAAM7J,EAAS4J,EAAIvN,QACnB0E,EAAQ,EACZ,GAAmB1E,EAAfwN,EAAMlD,EAAiB,MAAM1D,EAAWgD,IAC5C,KAAOlF,EAAQ8I,GAAK1N,KAAKwK,EAAS5F,GAAS6I,EAAI7I,MAG7C+I,GAAa,CACfrF,QAAS,SAASA,UAChB,OAAOD,GAAaxL,KAAK4N,GAASzK,QAEpCoI,KAAM,SAASA,OACb,OAAOD,GAAUtL,KAAK4N,GAASzK,QAEjCkI,OAAQ,SAASA,SACf,OAAOD,GAAYpL,KAAK4N,GAASzK,SAIjC4N,GAAY,SAAUhO,EAAQhB,GAChC,OAAO4B,EAASZ,IACXA,EAAO+J,KACO,iBAAP/K,GACPA,KAAOgB,GACPgD,QAAQhE,IAAQgE,OAAOhE,IAE1BiP,GAAW,SAASnK,yBAAyB9D,EAAQhB,GACvD,OAAOgP,GAAUhO,EAAQhB,EAAM4C,EAAY5C,GAAK,IAC5C8G,EAAa,EAAG9F,EAAOhB,IACvB6E,EAAK7D,EAAQhB,IAEfkP,GAAW,SAASzQ,eAAeuC,EAAQhB,EAAKmP,GAClD,QAAIH,GAAUhO,EAAQhB,EAAM4C,EAAY5C,GAAK,KACxC4B,EAASuN,IACTxP,EAAIwP,EAAM,WACTxP,EAAIwP,EAAM,QACVxP,EAAIwP,EAAM,QAEVA,EAAKzQ,cACJiB,EAAIwP,EAAM,cAAeA,EAAKC,UAC9BzP,EAAIwP,EAAM,gBAAiBA,EAAKxQ,WAI9BkE,EAAG7B,EAAQhB,EAAKmP,IAFvBnO,EAAOhB,GAAOmP,EAAKlM,MACZjC,IAIN6J,KACH5C,EAAMnF,EAAImM,GACVjH,EAAIlF,EAAIoM,IAGVrP,EAAQA,EAAQW,EAAIX,EAAQO,GAAKyK,GAAkB,SAAU,CAC3D/F,yBAA0BmK,GAC1BxQ,eAAgByQ,KAGdxL,EAAM,WAAc4G,GAAcrM,KAAK,QACzCqM,GAAgBC,GAAsB,SAASpE,WAC7C,OAAO8D,GAAUhM,KAAKmD,QAI1B,IAAIiO,GAAwBtI,EAAY,GAAImG,IAC5CnG,EAAYsI,GAAuBN,IACnCrP,EAAK2P,GAAuB5E,GAAUsE,GAAWzF,QACjDvC,EAAYsI,GAAuB,CACjCjJ,MAAOsI,GACPjD,IAAKkD,GACLlL,YAAa,aACb0C,SAAUmE,GACVE,eAAgByC,KAElBhB,GAAUoD,GAAuB,SAAU,KAC3CpD,GAAUoD,GAAuB,aAAc,KAC/CpD,GAAUoD,GAAuB,aAAc,KAC/CpD,GAAUoD,GAAuB,SAAU,KAC3CxM,EAAGwM,GAAuB3E,GAAK,CAC7B9L,IAAK,WAAc,OAAOwC,KAAK2J,OAIjCjN,EAAOD,QAAU,SAAU2I,EAAKmF,EAAO2D,EAASC,GAE9C,IAAIpL,EAAOqC,IADX+I,IAAYA,GACgB,UAAY,IAAM,QAC1CC,EAAS,MAAQhJ,EACjBiJ,EAAS,MAAQjJ,EACjBkJ,EAAanQ,EAAO4E,GACpBwL,EAAOD,GAAc,GACrBE,EAAMF,GAAclM,EAAekM,GAEnC3M,EAAI,GACJ8M,EAAsBH,GAAcA,EAAW9P,GAU/CkQ,EAAa,SAAUrL,EAAMuB,GAC/BnD,EAAG4B,EAAMuB,EAAO,CACdpH,IAAK,WACH,OAXAmR,EAWc3O,KAXF+K,IACJ6D,EAAER,GAUUxJ,EAVM2F,EAAQoE,EAAKxR,EAAG8M,IAFnC,IACP0E,GAaFtE,IAAK,SAAUxI,GACb,OAXuB+C,EAWHA,EAXU/C,EAWHA,EAV3B8M,EAUc3O,KAVF+K,GACZoD,IAAStM,GAASA,EAAQjB,KAAKiO,MAAMhN,IAAU,EAAI,EAAY,IAARA,EAAe,IAAe,IAARA,QACjF8M,EAAKC,EAAEP,GAAQzJ,EAAQ2F,EAAQoE,EAAKxR,EAAG0E,EAAOoI,IAHnC,IAAgBrF,EAAO/C,EAC9B8M,GAYFpR,YAAY,MApBF+Q,IAAe/I,EAAOuJ,KAwBlCR,EAAaJ,EAAQ,SAAU7K,EAAMsL,EAAMI,EAASC,GAClDvJ,EAAWpC,EAAMiL,EAAYvL,EAAM,MACnC,IAEIoH,EAAQ8E,EAAY/O,EAAQgP,EAF5BtK,EAAQ,EACR4F,EAAS,EAEb,GAAKhK,EAASmO,GAIP,CAAA,KAAIA,aAAgBtH,IAAiB6H,EAAQpJ,EAAQ6I,KAAU3H,GAAgBkI,GAASjI,GAaxF,OAAI0C,MAAegF,EACjB/D,GAAS0D,EAAYK,GAErB3D,GAAMnO,KAAKyR,EAAYK,GAf9BxE,EAASwE,EACTnE,EAASF,GAASyE,EAASxE,GAC3B,IAAI4E,EAAOR,EAAKM,WAChB,GAAID,IAAY5S,GAAW,CACzB,GAAI+S,EAAO5E,EAAO,MAAMzD,EAAWgD,IAEnC,IADAmF,EAAaE,EAAO3E,GACH,EAAG,MAAM1D,EAAWgD,SAGrC,GAA0BqF,GAD1BF,EAAapL,EAASmL,GAAWzE,GAChBC,EAAe,MAAM1D,EAAWgD,IAEnD5J,EAAS+O,EAAa1E,OAftBrK,EAAS0F,EAAQ+I,GAEjBxE,EAAS,IAAI9C,EADb4H,EAAa/O,EAASqK,GA2BxB,IAPAjM,EAAK+E,EAAM,KAAM,CACftD,EAAGoK,EACHhN,EAAGqN,EACH5N,EAAGqS,EACHlO,EAAGb,EACH0O,EAAG,IAAIrH,EAAU4C,KAEZvF,EAAQ1E,GAAQwO,EAAWrL,EAAMuB,OAE1C6J,EAAsBH,EAAW9P,GAAa+F,EAAO0J,IACrD3P,EAAKmQ,EAAqB,cAAeH,IAC/BhM,EAAM,WAChBgM,EAAW,MACNhM,EAAM,WACX,IAAIgM,GAAY,MACX9H,EAAY,SAAU4I,GAC3B,IAAId,EACJ,IAAIA,EAAW,MACf,IAAIA,EAAW,KACf,IAAIA,EAAWc,KACd,KACDd,EAAaJ,EAAQ,SAAU7K,EAAMsL,EAAMI,EAASC,GAElD,IAAIE,EAGJ,OAJAzJ,EAAWpC,EAAMiL,EAAYvL,GAIxBvC,EAASmO,GACVA,aAAgBtH,IAAiB6H,EAAQpJ,EAAQ6I,KAAU3H,GAAgBkI,GAASjI,EAC/E+H,IAAY5S,GACf,IAAImS,EAAKI,EAAMrE,GAASyE,EAASxE,GAAQyE,GACzCD,IAAY3S,GACV,IAAImS,EAAKI,EAAMrE,GAASyE,EAASxE,IACjC,IAAIgE,EAAKI,GAEbhF,MAAegF,EAAa/D,GAAS0D,EAAYK,GAC9C3D,GAAMnO,KAAKyR,EAAYK,GATF,IAAIJ,EAAK3I,EAAQ+I,MAW/ClH,EAAa+G,IAAQpO,SAASrC,UAAYiI,EAAKuI,GAAMc,OAAOrJ,EAAKwI,IAAQxI,EAAKuI,GAAO,SAAU3P,GACvFA,KAAO0P,GAAahQ,EAAKgQ,EAAY1P,EAAK2P,EAAK3P,MAEvD0P,EAAW9P,GAAaiQ,EACnBnJ,IAASmJ,EAAoBpM,YAAciM,IAElD,IAAIgB,EAAkBb,EAAoBpF,IACtCkG,IAAsBD,IACI,UAAxBA,EAAgBrS,MAAoBqS,EAAgBrS,MAAQb,IAC9DoT,EAAY7B,GAAWzF,OAC3B5J,EAAKgQ,EAAY/E,IAAmB,GACpCjL,EAAKmQ,EAAqB9E,GAAa5G,GACvCzE,EAAKmQ,EAAqB5E,IAAM,GAChCvL,EAAKmQ,EAAqBjF,GAAiB8E,IAEvCH,EAAU,IAAIG,EAAW,GAAGhF,KAAQvG,EAASuG,MAAOmF,IACtDhN,EAAGgN,EAAqBnF,GAAK,CAC3B9L,IAAK,WAAc,OAAOuF,KAM9BtE,EAAQA,EAAQS,EAAIT,EAAQiB,EAAIjB,EAAQO,IAFxC2C,EAAEoB,GAAQuL,IAEiDC,GAAO5M,GAElElD,EAAQA,EAAQW,EAAG2D,EAAM,CACvBmE,kBAAmBqD,IAGrB9L,EAAQA,EAAQW,EAAIX,EAAQO,EAAIsD,EAAM,WAAciM,EAAK5C,GAAG9O,KAAKyR,EAAY,KAAQvL,EAAM,CACzFkI,KAAMD,GACNW,GAAID,KAGAxE,KAAqBuH,GAAsBnQ,EAAKmQ,EAAqBvH,EAAmBqD,GAE9F9L,EAAQA,EAAQa,EAAGyD,EAAM+I,IAEzBrF,EAAW1D,GAEXtE,EAAQA,EAAQa,EAAIb,EAAQO,EAAIoL,GAAYrH,EAAM,CAAEsH,IAAKkD,KAEzD9O,EAAQA,EAAQa,EAAIb,EAAQO,GAAKuQ,EAAmBxM,EAAM4K,IAErDrI,GAAWmJ,EAAoB1J,UAAYmE,KAAeuF,EAAoB1J,SAAWmE,IAE9FzK,EAAQA,EAAQa,EAAIb,EAAQO,EAAIsD,EAAM,WACpC,IAAIgM,EAAW,GAAGtJ,UAChBjC,EAAM,CAAEiC,MAAOsI,KAEnB7O,EAAQA,EAAQa,EAAIb,EAAQO,GAAKsD,EAAM,WACrC,MAAO,CAAC,EAAG,GAAG8G,kBAAoB,IAAIkF,EAAW,CAAC,EAAG,IAAIlF,qBACpD9G,EAAM,WACXmM,EAAoBrF,eAAevM,KAAK,CAAC,EAAG,OACzCkG,EAAM,CAAEqG,eAAgByC,KAE7BtF,EAAUxD,GAAQwM,EAAoBD,EAAkBE,EACnDlK,GAAYiK,GAAmBjR,EAAKmQ,EAAqBpF,GAAUmG,SAErE9S,EAAOD,QAAU,cAKlB,SAAUC,EAAQD,EAASF,GAEjC,IAAIkT,EAAMlT,EAAoB,KAC1BkC,EAAUlC,EAAoB,GAC9BmT,EAASnT,EAAoB,GAApBA,CAAwB,YACjCyE,EAAQ0O,EAAO1O,QAAU0O,EAAO1O,MAAQ,IAAKzE,EAAoB,OAEjEoT,EAAyB,SAAU/P,EAAQgQ,EAAWrL,GACxD,IAAIsL,EAAiB7O,EAAMxD,IAAIoC,GAC/B,IAAKiQ,EAAgB,CACnB,IAAKtL,EAAQ,OAAOnI,GACpB4E,EAAMqJ,IAAIzK,EAAQiQ,EAAiB,IAAIJ,GAEzC,IAAIK,EAAcD,EAAerS,IAAIoS,GACrC,IAAKE,EAAa,CAChB,IAAKvL,EAAQ,OAAOnI,GACpByT,EAAexF,IAAIuF,EAAWE,EAAc,IAAIL,GAChD,OAAOK,GA0BXpT,EAAOD,QAAU,CACfuE,MAAOA,EACP4L,IAAK+C,EACLpR,IA3B2B,SAAUwR,EAAapO,EAAGrC,GACrD,IAAI0Q,EAAcL,EAAuBhO,EAAGrC,GAAG,GAC/C,OAAO0Q,IAAgB5T,IAAoB4T,EAAYzR,IAAIwR,IA0B3DvS,IAxB2B,SAAUuS,EAAapO,EAAGrC,GACrD,IAAI0Q,EAAcL,EAAuBhO,EAAGrC,GAAG,GAC/C,OAAO0Q,IAAgB5T,GAAYA,GAAY4T,EAAYxS,IAAIuS,IAuB/D1F,IArB8B,SAAU0F,EAAaE,EAAetO,EAAGrC,GACvEqQ,EAAuBhO,EAAGrC,GAAG,GAAM+K,IAAI0F,EAAaE,IAqBpD7H,KAnB4B,SAAUxI,EAAQgQ,GAC9C,IAAII,EAAcL,EAAuB/P,EAAQgQ,GAAW,GACxDxH,EAAO,GAEX,OADI4H,GAAaA,EAAYzD,QAAQ,SAAU2D,EAAGtR,GAAOwJ,EAAKtD,KAAKlG,KAC5DwJ,GAgBPxJ,IAdc,SAAU6B,GACxB,OAAOA,IAAOrE,IAA0B,iBAANqE,EAAiBA,EAAKmC,OAAOnC,IAc/D4E,IAZQ,SAAU1D,GAClBlD,EAAQA,EAAQW,EAAG,UAAWuC,MAiB1B,SAAUjF,EAAQD,EAASF,GAGjC,IAAIiE,EAAWjE,EAAoB,GAGnCG,EAAOD,QAAU,SAAUgE,EAAIrB,GAC7B,IAAKoB,EAASC,GAAK,OAAOA,EAC1B,IAAI2C,EAAIsB,EACR,GAAItF,GAAkC,mBAArBgE,EAAK3C,EAAGsE,YAA4BvE,EAASkE,EAAMtB,EAAGvG,KAAK4D,IAAM,OAAOiE,EACzF,GAAgC,mBAApBtB,EAAK3C,EAAG0P,WAA2B3P,EAASkE,EAAMtB,EAAGvG,KAAK4D,IAAM,OAAOiE,EACnF,IAAKtF,GAAkC,mBAArBgE,EAAK3C,EAAGsE,YAA4BvE,EAASkE,EAAMtB,EAAGvG,KAAK4D,IAAM,OAAOiE,EAC1F,MAAMhE,UAAU,6CAMZ,SAAUhE,EAAQD,GAExBC,EAAOD,QAAU,SAAU2T,EAAQvO,GACjC,MAAO,CACLtE,aAAuB,EAAT6S,GACd9S,eAAyB,EAAT8S,GAChBpC,WAAqB,EAAToC,GACZvO,MAAOA,KAOL,SAAUnF,EAAQD,EAASF,GAEjC,IAAI8T,EAAO9T,EAAoB,GAApBA,CAAwB,QAC/BiE,EAAWjE,EAAoB,GAC/BgC,EAAMhC,EAAoB,IAC1B+T,EAAU/T,EAAoB,GAAGmF,EACjC6O,EAAK,EACLC,EAAepT,OAAOoT,cAAgB,WACxC,OAAO,GAELC,GAAUlU,EAAoB,EAApBA,CAAuB,WACnC,OAAOiU,EAAapT,OAAOsT,kBAAkB,OAE3CC,EAAU,SAAUlQ,GACtB6P,EAAQ7P,EAAI4P,EAAM,CAAExO,MAAO,CACzBlF,EAAG,OAAQ4T,EACXK,EAAG,OAgCHC,EAAOnU,EAAOD,QAAU,CAC1B2I,IAAKiL,EACLS,MAAM,EACNC,QAhCY,SAAUtQ,EAAI8D,GAE1B,IAAK/D,EAASC,GAAK,MAAoB,iBAANA,EAAiBA,GAAmB,iBAANA,EAAiB,IAAM,KAAOA,EAC7F,IAAKlC,EAAIkC,EAAI4P,GAAO,CAElB,IAAKG,EAAa/P,GAAK,MAAO,IAE9B,IAAK8D,EAAQ,MAAO,IAEpBoM,EAAQlQ,GAER,OAAOA,EAAG4P,GAAM1T,GAsBlBqU,QApBY,SAAUvQ,EAAI8D,GAC1B,IAAKhG,EAAIkC,EAAI4P,GAAO,CAElB,IAAKG,EAAa/P,GAAK,OAAO,EAE9B,IAAK8D,EAAQ,OAAO,EAEpBoM,EAAQlQ,GAER,OAAOA,EAAG4P,GAAMO,GAYlBK,SATa,SAAUxQ,GAEvB,OADIgQ,GAAUI,EAAKC,MAAQN,EAAa/P,KAAQlC,EAAIkC,EAAI4P,IAAOM,EAAQlQ,GAChEA,KAaH,SAAU/D,EAAQD,GAExBC,EAAOD,SAAU,GAKX,SAAUC,EAAQD,EAASF,GAGjC,IAAI2U,EAAQ3U,EAAoB,IAC5B4U,EAAc5U,EAAoB,IAEtCG,EAAOD,QAAUW,OAAOgL,MAAQ,SAASA,KAAKzG,GAC5C,OAAOuP,EAAMvP,EAAGwP,KAMZ,SAAUzU,EAAQD,EAASF,GAGjC,IAAI+E,EAAW/E,EAAoB,GAC/B6U,EAAM7U,EAAoB,IAC1B4U,EAAc5U,EAAoB,IAClC2F,EAAW3F,EAAoB,GAApBA,CAAwB,YACnC8U,EAAQ,aACR7S,EAAY,YAGZ8S,EAAa,WAEf,IAIIC,EAJAC,EAASjV,EAAoB,GAApBA,CAAwB,UACjCI,EAAIwU,EAAYjR,OAcpB,IAVAsR,EAAOC,MAAMC,QAAU,OACvBnV,EAAoB,IAAIoV,YAAYH,GACpCA,EAAO/D,IAAM,eAGb8D,EAAiBC,EAAOI,cAAcC,UACvBC,OACfP,EAAeQ,MAAMC,uCACrBT,EAAeU,QACfX,EAAaC,EAAevS,EACrBrC,YAAY2U,EAAW9S,GAAW2S,EAAYxU,IACrD,OAAO2U,KAGT5U,EAAOD,QAAUW,OAAOmH,QAAU,SAASA,OAAO5C,EAAGuQ,GACnD,IAAIrN,EAQJ,OAPU,OAANlD,GACF0P,EAAM7S,GAAa8C,EAASK,GAC5BkD,EAAS,IAAIwM,EACbA,EAAM7S,GAAa,KAEnBqG,EAAO3C,GAAYP,GACdkD,EAASyM,IACTY,IAAe9V,GAAYyI,EAASuM,EAAIvM,EAAQqN,KAMnD,SAAUxV,EAAQD,GAExBC,EAAOD,QAAU,cAKX,SAAUC,EAAQD,EAASF,GAEjC,IAAI8B,EAAM9B,EAAoB,IAC1BM,EAAON,EAAoB,KAC3BwJ,EAAcxJ,EAAoB,IAClC+E,EAAW/E,EAAoB,GAC/BsH,EAAWtH,EAAoB,GAC/B0J,EAAY1J,EAAoB,IAChC4V,EAAQ,GACRC,EAAS,IACT3V,EAAUC,EAAOD,QAAU,SAAU4V,EAAU/J,EAASlF,EAAIC,EAAMgG,GACpE,IAGInJ,EAAQgL,EAAMC,EAAUtG,EAHxB0G,EAASlC,EAAW,WAAc,OAAOgJ,GAAcpM,EAAUoM,GACjE3Q,EAAIrD,EAAI+E,EAAIC,EAAMiF,EAAU,EAAI,GAChC1D,EAAQ,EAEZ,GAAqB,mBAAV2G,EAAsB,MAAM7K,UAAU2R,EAAW,qBAE5D,GAAItM,EAAYwF,IAAS,IAAKrL,EAAS2D,EAASwO,EAASnS,QAAkB0E,EAAT1E,EAAgB0E,IAEhF,IADAC,EAASyD,EAAU5G,EAAEJ,EAAS4J,EAAOmH,EAASzN,IAAQ,GAAIsG,EAAK,IAAMxJ,EAAE2Q,EAASzN,OACjEuN,GAAStN,IAAWuN,EAAQ,OAAOvN,OAC7C,IAAKsG,EAAWI,EAAO1O,KAAKwV,KAAanH,EAAOC,EAASK,QAAQC,MAEtE,IADA5G,EAAShI,EAAKsO,EAAUzJ,EAAGwJ,EAAKrJ,MAAOyG,MACxB6J,GAAStN,IAAWuN,EAAQ,OAAOvN,IAG9CsN,MAAQA,EAChB1V,EAAQ2V,OAASA,GAKX,SAAU1V,EAAQD,EAASF,GAEjC,IAAI6E,EAAY7E,EAAoB,IAChC+V,EAAM1R,KAAK0R,IACXjR,EAAMT,KAAKS,IACf3E,EAAOD,QAAU,SAAUmI,EAAO1E,GAEhC,OADA0E,EAAQxD,EAAUwD,IACH,EAAI0N,EAAI1N,EAAQ1E,EAAQ,GAAKmB,EAAIuD,EAAO1E,KAMnD,SAAUxD,EAAQD,GAExBC,EAAOD,QAAU,IAKX,SAAUC,EAAQD,EAASF,GAGjC,IAAIgW,EAAMhW,EAAoB,IAC1B+M,EAAM/M,EAAoB,EAApBA,CAAuB,eAE7BiW,EAAkD,aAA5CD,EAAI,WAAc,OAAOtS,UAArB,IASdvD,EAAOD,QAAU,SAAUgE,GACzB,IAAIkB,EAAG8Q,EAAGjT,EACV,OAAOiB,IAAOrE,GAAY,YAAqB,OAAPqE,EAAc,OAEN,iBAApCgS,EAVD,SAAUhS,EAAI7B,GACzB,IACE,OAAO6B,EAAG7B,GACV,MAAOmC,KAOO2R,CAAO/Q,EAAIvE,OAAOqD,GAAK6I,IAAoBmJ,EAEvDD,EAAMD,EAAI5Q,GAEM,WAAfnC,EAAI+S,EAAI5Q,KAAsC,mBAAZA,EAAEgR,OAAuB,YAAcnT,IAM1E,SAAU9C,EAAQD,GAExBC,EAAOD,QAAU,SAAUgE,EAAImS,EAAa3V,EAAM4V,GAChD,KAAMpS,aAAcmS,IAAiBC,IAAmBzW,IAAayW,KAAkBpS,EACrF,MAAMC,UAAUzD,EAAO,2BACvB,OAAOwD,IAML,SAAU/D,EAAQD,EAASF,GAEjC,IAAI+B,EAAO/B,EAAoB,IAC/BG,EAAOD,QAAU,SAAUmD,EAAQ6N,EAAKqF,GACtC,IAAK,IAAIlU,KAAO6O,EACVqF,GAAQlT,EAAOhB,GAAMgB,EAAOhB,GAAO6O,EAAI7O,GACtCN,EAAKsB,EAAQhB,EAAK6O,EAAI7O,IAC3B,OAAOgB,IAML,SAAUlD,EAAQD,GAExB,IAAI8T,EAAK,EACLwC,EAAKnS,KAAKoS,SACdtW,EAAOD,QAAU,SAAUmC,GACzB,MAAO,UAAUyQ,OAAOzQ,IAAQxC,GAAY,GAAKwC,EAAK,QAAS2R,EAAKwC,GAAIhO,SAAS,OAM7E,SAAUrI,EAAQD,EAASF,GAEjC,IAAI0W,EAAM1W,EAAoB,GAAGmF,EAC7BnD,EAAMhC,EAAoB,IAC1B+M,EAAM/M,EAAoB,EAApBA,CAAuB,eAEjCG,EAAOD,QAAU,SAAUgE,EAAIiC,EAAKwQ,GAC9BzS,IAAOlC,EAAIkC,EAAKyS,EAAOzS,EAAKA,EAAG1C,UAAWuL,IAAM2J,EAAIxS,EAAI6I,EAAK,CAAEhM,cAAc,EAAMuE,MAAOa,MAM1F,SAAUhG,EAAQD,EAASF,GAIjC,IAAI4B,EAAS5B,EAAoB,GAC7B6B,EAAO7B,EAAoB,IAC3BkF,EAAKlF,EAAoB,GACzB4W,EAAc5W,EAAoB,GAClC6W,EAAU7W,EAAoB,EAApBA,CAAuB,WAErCG,EAAOD,QAAU,SAAU2I,GACzB,IAAIvF,EAAwB,mBAAbzB,EAAKgH,GAAqBhH,EAAKgH,GAAOjH,EAAOiH,GACxD+N,GAAetT,IAAMA,EAAEuT,IAAU3R,EAAGC,EAAE7B,EAAGuT,EAAS,CACpD9V,cAAc,EACdE,IAAK,WAAc,OAAOwC,UAOxB,SAAUtD,EAAQD,EAASF,GAEjC,IAAIiE,EAAWjE,EAAoB,GACnCG,EAAOD,QAAU,SAAUgE,EAAIsD,GAC7B,IAAKvD,EAASC,IAAOA,EAAG4S,KAAOtP,EAAM,MAAMrD,UAAU,0BAA4BqD,EAAO,cACxF,OAAOtD,IAMH,SAAU/D,EAAQD,EAASF,GAGjC,IAAIgW,EAAMhW,EAAoB,IAE9BG,EAAOD,QAAUW,OAAO,KAAKkW,qBAAqB,GAAKlW,OAAS,SAAUqD,GACxE,MAAkB,UAAX8R,EAAI9R,GAAkBA,EAAGyC,MAAM,IAAM9F,OAAOqD,KAM/C,SAAU/D,EAAQD,GAExBA,EAAQiF,EAAI,GAAG4R,sBAKT,SAAU5W,EAAQD,EAASF,GAGjC,IAAI2U,EAAQ3U,EAAoB,IAC5BgX,EAAahX,EAAoB,IAAI8S,OAAO,SAAU,aAE1D5S,EAAQiF,EAAItE,OAAOoW,qBAAuB,SAASA,oBAAoB7R,GACrE,OAAOuP,EAAMvP,EAAG4R,KAMZ,SAAU7W,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9BuF,EAAUvF,EAAoB,IAC9B+F,EAAQ/F,EAAoB,GAC5BkX,EAASlX,EAAoB,IAC7BmX,EAAQ,IAAMD,EAAS,IAEvBE,EAAQC,OAAO,IAAMF,EAAQA,EAAQ,KACrCG,EAAQD,OAAOF,EAAQA,EAAQ,MAE/BI,EAAW,SAAU1O,EAAKtE,EAAMiT,GAClC,IAAI1O,EAAM,GACN2O,EAAQ1R,EAAM,WAChB,QAASmR,EAAOrO,MAPV,MAAA,KAOwBA,OAE5BhC,EAAKiC,EAAID,GAAO4O,EAAQlT,EAAKmT,GAAQR,EAAOrO,GAC5C2O,IAAO1O,EAAI0O,GAAS3Q,GACxB3E,EAAQA,EAAQa,EAAIb,EAAQO,EAAIgV,EAAO,SAAU3O,IAM/C4O,EAAOH,EAASG,KAAO,SAAUxR,EAAQsB,GAI3C,OAHAtB,EAASG,OAAOd,EAAQW,IACb,EAAPsB,IAAUtB,EAASA,EAAOK,QAAQ6Q,EAAO,KAClC,EAAP5P,IAAUtB,EAASA,EAAOK,QAAQ+Q,EAAO,KACtCpR,GAGT/F,EAAOD,QAAUqX,GAKX,SAAUpX,EAAQD,EAASF,GAEjC,IAAIuJ,EAAUvJ,EAAoB,IAC9B8M,EAAW9M,EAAoB,EAApBA,CAAuB,YAClCgK,EAAYhK,EAAoB,IACpCG,EAAOD,QAAUF,EAAoB,IAAI2X,kBAAoB,SAAUzT,GACrE,GAAIA,GAAMrE,GAAW,OAAOqE,EAAG4I,IAC1B5I,EAAG,eACH8F,EAAUT,EAAQrF,MAMnB,SAAU/D,EAAQD,EAASF,GAEjC,IAAI6B,EAAO7B,EAAoB,IAC3B4B,EAAS5B,EAAoB,GAC7B4X,EAAS,qBACTnT,EAAQ7C,EAAOgW,KAAYhW,EAAOgW,GAAU,KAE/CzX,EAAOD,QAAU,SAAUmC,EAAKiD,GAC/B,OAAOb,EAAMpC,KAASoC,EAAMpC,GAAOiD,IAAUzF,GAAYyF,EAAQ,MAChE,WAAY,IAAIiD,KAAK,CACtB9C,QAAS5D,EAAK4D,QACdoS,KAAM7X,EAAoB,IAAM,OAAS,SACzC8X,UAAW,0CAMP,SAAU3X,EAAQD,EAASF,GAIjC,IAAIiH,EAAYjH,EAAoB,IAChCsH,EAAWtH,EAAoB,GAC/BsJ,EAAkBtJ,EAAoB,IAC1CG,EAAOD,QAAU,SAAU6X,GACzB,OAAO,SAAU9P,EAAO+P,EAAIC,GAC1B,IAGI3S,EAHAF,EAAI6B,EAAUgB,GACdtE,EAAS2D,EAASlC,EAAEzB,QACpB0E,EAAQiB,EAAgB2O,EAAWtU,GAIvC,GAAIoU,GAAeC,GAAMA,GAAI,KAAgB3P,EAAT1E,GAGlC,IAFA2B,EAAQF,EAAEiD,OAEG/C,EAAO,OAAO,OAEtB,KAAe+C,EAAT1E,EAAgB0E,IAAS,IAAI0P,GAAe1P,KAASjD,IAC5DA,EAAEiD,KAAW2P,EAAI,OAAOD,GAAe1P,GAAS,EACpD,OAAQ0P,IAAgB,KAOxB,SAAU5X,EAAQD,GAExBA,EAAQiF,EAAItE,OAAOqX,uBAKb,SAAU/X,EAAQD,EAASF,GAGjC,IAAIgW,EAAMhW,EAAoB,IAC9BG,EAAOD,QAAU2K,MAAMsN,SAAW,SAASA,QAAQ9Q,GACjD,MAAmB,SAAZ2O,EAAI3O,KAMP,SAAUlH,EAAQD,EAASF,GAIjC,IAAI+I,EAAU/I,EAAoB,IAC9BkC,EAAUlC,EAAoB,GAC9BoY,EAAWpY,EAAoB,IAC/B+B,EAAO/B,EAAoB,IAC3BgK,EAAYhK,EAAoB,IAChCqY,EAAcrY,EAAoB,IAClCsY,EAAiBtY,EAAoB,IACrC6F,EAAiB7F,EAAoB,IACrC8M,EAAW9M,EAAoB,EAApBA,CAAuB,YAClCuY,IAAU,GAAG1M,MAAQ,QAAU,GAAGA,QAGlC2M,EAAS,SAETC,EAAa,WAAc,OAAOhV,MAEtCtD,EAAOD,QAAU,SAAU8R,EAAMxL,EAAM6P,EAAapH,EAAMyJ,EAASC,EAAQC,GACzEP,EAAYhC,EAAa7P,EAAMyI,GAC/B,IAeI4J,EAASxW,EAAKyW,EAfdC,EAAY,SAAUC,GACxB,IAAKT,GAASS,KAAQzJ,EAAO,OAAOA,EAAMyJ,GAC1C,OAAQA,GACN,IAVK,OAUM,OAAO,SAASnN,OAAS,OAAO,IAAIwK,EAAY5S,KAAMuV,IACjE,KAAKR,EAAQ,OAAO,SAAS7M,SAAW,OAAO,IAAI0K,EAAY5S,KAAMuV,IACrE,OAAO,SAASjN,UAAY,OAAO,IAAIsK,EAAY5S,KAAMuV,KAEzDjM,EAAMvG,EAAO,YACbyS,EAAaP,GAAWF,EACxBU,GAAa,EACb3J,EAAQyC,EAAKxQ,UACb2X,EAAU5J,EAAMzC,IAAayC,EAnBjB,eAmBuCmJ,GAAWnJ,EAAMmJ,GACpEU,EAAWD,GAAWJ,EAAUL,GAChCW,EAAWX,EAAWO,EAAwBF,EAAU,WAArBK,EAAkCvZ,GACrEyZ,EAAqB,SAAR9S,GAAkB+I,EAAMxD,SAAqBoN,EAwB9D,GArBIG,IACFR,EAAoBjT,EAAeyT,EAAWhZ,KAAK,IAAI0R,OAC7BnR,OAAOW,WAAasX,EAAkB7J,OAE9DqJ,EAAeQ,EAAmB/L,GAAK,GAElChE,GAAiD,mBAA/B+P,EAAkBhM,IAAyB/K,EAAK+W,EAAmBhM,EAAU2L,IAIpGQ,GAAcE,GAAWA,EAAQzY,OAAS8X,IAC5CU,GAAa,EACbE,EAAW,SAASzN,SAAW,OAAOwN,EAAQ7Y,KAAKmD,QAG/CsF,IAAW6P,IAAYL,IAASW,GAAe3J,EAAMzC,IACzD/K,EAAKwN,EAAOzC,EAAUsM,GAGxBpP,EAAUxD,GAAQ4S,EAClBpP,EAAU+C,GAAO0L,EACbC,EAMF,GALAG,EAAU,CACRlN,OAAQsN,EAAaG,EAAWL,EAAUP,GAC1C3M,KAAM8M,EAASS,EAAWL,EAhDrB,QAiDLhN,QAASsN,GAEPT,EAAQ,IAAKvW,KAAOwW,EAChBxW,KAAOkN,GAAQ6I,EAAS7I,EAAOlN,EAAKwW,EAAQxW,SAC7CH,EAAQA,EAAQa,EAAIb,EAAQO,GAAK8V,GAASW,GAAa1S,EAAMqS,GAEtE,OAAOA,IAMH,SAAU1Y,EAAQD,EAASF,GAIjC,IAAIgI,EAAShI,EAAoB,IAC7BuZ,EAAavZ,EAAoB,IACjCsY,EAAiBtY,EAAoB,IACrC8Y,EAAoB,GAGxB9Y,EAAoB,GAApBA,CAAwB8Y,EAAmB9Y,EAAoB,EAApBA,CAAuB,YAAa,WAAc,OAAOyD,OAEpGtD,EAAOD,QAAU,SAAUmW,EAAa7P,EAAMyI,GAC5CoH,EAAY7U,UAAYwG,EAAO8Q,EAAmB,CAAE7J,KAAMsK,EAAW,EAAGtK,KACxEqJ,EAAejC,EAAa7P,EAAO,eAM/B,SAAUrG,EAAQD,EAASF,GAGjC,IAAI+E,EAAW/E,EAAoB,GAC/B4G,EAAY5G,EAAoB,IAChC6W,EAAU7W,EAAoB,EAApBA,CAAuB,WACrCG,EAAOD,QAAU,SAAUkF,EAAGoU,GAC5B,IACI3W,EADAS,EAAIyB,EAASK,GAAGU,YAEpB,OAAOxC,IAAMzD,KAAcgD,EAAIkC,EAASzB,GAAGuT,KAAahX,GAAY2Z,EAAI5S,EAAU/D,KAM9E,SAAU1C,EAAQD,EAASF,GAEjC,IACIyZ,EADSzZ,EAAoB,GACVyZ,UAEvBtZ,EAAOD,QAAUuZ,GAAaA,EAAUC,WAAa,IAK/C,SAAUvZ,EAAQD,EAASF,GAIjC,IAAI4B,EAAS5B,EAAoB,GAC7BkC,EAAUlC,EAAoB,GAC9BsU,EAAOtU,EAAoB,IAC3B+F,EAAQ/F,EAAoB,GAC5B+B,EAAO/B,EAAoB,IAC3BoJ,EAAcpJ,EAAoB,IAClC2Z,EAAQ3Z,EAAoB,IAC5BkJ,EAAalJ,EAAoB,IACjCiE,EAAWjE,EAAoB,GAC/BsY,EAAiBtY,EAAoB,IACrCkF,EAAKlF,EAAoB,GAAGmF,EAC5ByU,EAAO5Z,EAAoB,GAApBA,CAAwB,GAC/B4W,EAAc5W,EAAoB,GAEtCG,EAAOD,QAAU,SAAUsG,EAAMmL,EAASkH,EAASgB,EAAQnS,EAAQoS,GACjE,IAAI9H,EAAOpQ,EAAO4E,GACdlD,EAAI0O,EACJ+H,EAAQrS,EAAS,MAAQ,MACzB6H,EAAQjM,GAAKA,EAAE9B,UACf4D,EAAI,GAqCR,OApCKwR,GAA2B,mBAALtT,IAAqBwW,GAAWvK,EAAMS,UAAYjK,EAAM,YACjF,IAAIzC,GAAIyI,UAAUkD,WAOlB3L,EAAIqO,EAAQ,SAAUtO,EAAQyS,GAC5B5M,EAAW7F,EAAQC,EAAGkD,EAAM,MAC5BnD,EAAO2W,GAAK,IAAIhI,EACZ8D,GAAYjW,IAAW8Z,EAAM7D,EAAUpO,EAAQrE,EAAO0W,GAAQ1W,KAEpEuW,EAAK,kEAAkEjT,MAAM,KAAM,SAAUkC,GAC3F,IAAIoR,EAAkB,OAAPpR,GAAuB,OAAPA,EAC3BA,KAAO0G,KAAWuK,GAAkB,SAAPjR,IAAiB9G,EAAKuB,EAAE9B,UAAWqH,EAAK,SAAUtF,EAAGC,GAEpF,GADA0F,EAAWzF,KAAMH,EAAGuF,IACfoR,GAAYH,IAAY7V,EAASV,GAAI,MAAc,OAAPsF,GAAehJ,GAChE,IAAIyI,EAAS7E,KAAKuW,GAAGnR,GAAW,IAANtF,EAAU,EAAIA,EAAGC,GAC3C,OAAOyW,EAAWxW,KAAO6E,MAG7BwR,GAAW5U,EAAG5B,EAAE9B,UAAW,OAAQ,CACjCP,IAAK,WACH,OAAOwC,KAAKuW,GAAGE,UApBnB5W,EAAIuW,EAAOM,eAAexI,EAASnL,EAAMkB,EAAQqS,GACjD3Q,EAAY9F,EAAE9B,UAAWqX,GACzBvE,EAAKC,MAAO,GAuBd+D,EAAehV,EAAGkD,GAElBpB,EAAEoB,GAAQlD,EACVpB,EAAQA,EAAQS,EAAIT,EAAQiB,EAAIjB,EAAQO,EAAG2C,GAEtC0U,GAASD,EAAOO,UAAU9W,EAAGkD,EAAMkB,GAEjCpE,IAMH,SAAUnD,EAAQD,EAASF,GAiBjC,IAfA,IASIqa,EATAzY,EAAS5B,EAAoB,GAC7B+B,EAAO/B,EAAoB,IAC3B0E,EAAM1E,EAAoB,IAC1BqN,EAAQ3I,EAAI,eACZ4I,EAAO5I,EAAI,QACX6N,KAAS3Q,EAAOmJ,cAAenJ,EAAOqJ,UACtCkC,EAASoF,EACTnS,EAAI,EAIJka,EAAyB,iHAE3B3T,MAAM,KAEDvG,EAPC,IAQFia,EAAQzY,EAAO0Y,EAAuBla,QACxC2B,EAAKsY,EAAM7Y,UAAW6L,GAAO,GAC7BtL,EAAKsY,EAAM7Y,UAAW8L,GAAM,IACvBH,GAAS,EAGlBhN,EAAOD,QAAU,CACfqS,IAAKA,EACLpF,OAAQA,EACRE,MAAOA,EACPC,KAAMA,IAMF,SAAUnN,EAAQD,EAASF,GAKjCG,EAAOD,QAAUF,EAAoB,MAAQA,EAAoB,EAApBA,CAAuB,WAClE,IAAIua,EAAIlW,KAAKoS,SAGb+D,iBAAiBla,KAAK,KAAMia,EAAG,qBACxBva,EAAoB,GAAGua,MAM1B,SAAUpa,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAElCG,EAAOD,QAAU,SAAUua,GACzBvY,EAAQA,EAAQW,EAAG4X,EAAY,CAAErL,GAAI,SAASA,KAG5C,IAFA,IAAIzL,EAASD,UAAUC,OACnB+W,EAAI,IAAI7P,MAAMlH,GACXA,KAAU+W,EAAE/W,GAAUD,UAAUC,GACvC,OAAO,IAAIF,KAAKiX,QAOd,SAAUva,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B4G,EAAY5G,EAAoB,IAChC8B,EAAM9B,EAAoB,IAC1B2Z,EAAQ3Z,EAAoB,IAEhCG,EAAOD,QAAU,SAAUua,GACzBvY,EAAQA,EAAQW,EAAG4X,EAAY,CAAE/L,KAAM,SAASA,KAAKtM,GACnD,IACI2M,EAAS2L,EAAGxZ,EAAGyZ,EADfC,EAAQlX,UAAU,GAKtB,OAHAkD,EAAUnD,OACVsL,EAAU6L,IAAU/a,KACP+G,EAAUgU,GACnBxY,GAAUvC,GAAkB,IAAI4D,MACpCiX,EAAI,GACA3L,GACF7N,EAAI,EACJyZ,EAAK7Y,EAAI8Y,EAAOlX,UAAU,GAAI,GAC9BiW,EAAMvX,GAAQ,EAAO,SAAUyY,GAC7BH,EAAEnS,KAAKoS,EAAGE,EAAU3Z,SAGtByY,EAAMvX,GAAQ,EAAOsY,EAAEnS,KAAMmS,GAExB,IAAIjX,KAAKiX,SAOd,SAAUva,EAAQD,EAASF,GAEjC,IAAIiE,EAAWjE,EAAoB,GAC/BsV,EAAWtV,EAAoB,GAAGsV,SAElCwF,EAAK7W,EAASqR,IAAarR,EAASqR,EAASyF,eACjD5a,EAAOD,QAAU,SAAUgE,GACzB,OAAO4W,EAAKxF,EAASyF,cAAc7W,GAAM,KAMrC,SAAU/D,EAAQD,EAASF,GAEjCG,EAAOD,QAAUF,EAAoB,KAK/B,SAAUG,EAAQD,EAASF,GAEjC,IAAI4B,EAAS5B,EAAoB,GAC7B6B,EAAO7B,EAAoB,IAC3B+I,EAAU/I,EAAoB,IAC9Bgb,EAAShb,EAAoB,IAC7Bc,EAAiBd,EAAoB,GAAGmF,EAC5ChF,EAAOD,QAAU,SAAUQ,GACzB,IAAIua,EAAUpZ,EAAK8C,SAAW9C,EAAK8C,OAASoE,EAAU,GAAKnH,EAAO+C,QAAU,IACtD,KAAlBjE,EAAKwa,OAAO,IAAexa,KAAQua,GAAUna,EAAema,EAASva,EAAM,CAAE4E,MAAO0V,EAAO7V,EAAEzE,OAM7F,SAAUP,EAAQD,EAASF,GAEjC,IAAImT,EAASnT,EAAoB,GAApBA,CAAwB,QACjC0E,EAAM1E,EAAoB,IAC9BG,EAAOD,QAAU,SAAUmC,GACzB,OAAO8Q,EAAO9Q,KAAS8Q,EAAO9Q,GAAOqC,EAAIrC,MAMrC,SAAUlC,EAAQD,GAGxBC,EAAOD,QAAU,gGAEfyG,MAAM,MAKF,SAAUxG,EAAQD,EAASF,GAEjC,IAAIsV,EAAWtV,EAAoB,GAAGsV,SACtCnV,EAAOD,QAAUoV,GAAYA,EAAS6F,iBAKhC,SAAUhb,EAAQD,EAASF,GAKjC,IAAIob,EAAUpb,EAAoB,IAC9Bqb,EAAOrb,EAAoB,IAC3BgH,EAAMhH,EAAoB,IAC1B0F,EAAW1F,EAAoB,GAC/BwF,EAAUxF,EAAoB,IAC9Bsb,EAAUza,OAAO0a,OAGrBpb,EAAOD,SAAWob,GAAWtb,EAAoB,EAApBA,CAAuB,WAClD,IAAI0a,EAAI,GACJzX,EAAI,GAEJJ,EAAI8B,SACJ4V,EAAI,uBAGR,OAFAG,EAAE7X,GAAK,EACP0X,EAAE5T,MAAM,IAAIqJ,QAAQ,SAAUwL,GAAKvY,EAAEuY,GAAKA,IACd,GAArBF,EAAQ,GAAIZ,GAAG7X,IAAWhC,OAAOgL,KAAKyP,EAAQ,GAAIrY,IAAIsJ,KAAK,KAAOgO,IACtE,SAASgB,OAAOlY,EAAQjB,GAM3B,IALA,IAAI8T,EAAIxQ,EAASrC,GACbwL,EAAOnL,UAAUC,OACjB0E,EAAQ,EACRoT,EAAaJ,EAAKlW,EAClBuW,EAAS1U,EAAI7B,EACHkD,EAAPwG,GAML,IALA,IAIIxM,EAJAQ,EAAI2C,EAAQ9B,UAAU2E,MACtBwD,EAAO4P,EAAaL,EAAQvY,GAAGiQ,OAAO2I,EAAW5Y,IAAMuY,EAAQvY,GAC/Dc,EAASkI,EAAKlI,OACdgY,EAAI,EAEQA,EAAThY,GAAgB+X,EAAOpb,KAAKuC,EAAGR,EAAMwJ,EAAK8P,QAAOzF,EAAE7T,GAAOQ,EAAER,IACnE,OAAO6T,GACPoF,GAKE,SAAUnb,EAAQD,GAGxBC,EAAOD,QAAU,SAAU2G,EAAI+U,EAAM9U,GACnC,IAAI+U,EAAK/U,IAASjH,GAClB,OAAQ+b,EAAKjY,QACX,KAAK,EAAG,OAAOkY,EAAKhV,IACAA,EAAGvG,KAAKwG,GAC5B,KAAK,EAAG,OAAO+U,EAAKhV,EAAG+U,EAAK,IACR/U,EAAGvG,KAAKwG,EAAM8U,EAAK,IACvC,KAAK,EAAG,OAAOC,EAAKhV,EAAG+U,EAAK,GAAIA,EAAK,IACjB/U,EAAGvG,KAAKwG,EAAM8U,EAAK,GAAIA,EAAK,IAChD,KAAK,EAAG,OAAOC,EAAKhV,EAAG+U,EAAK,GAAIA,EAAK,GAAIA,EAAK,IAC1B/U,EAAGvG,KAAKwG,EAAM8U,EAAK,GAAIA,EAAK,GAAIA,EAAK,IACzD,KAAK,EAAG,OAAOC,EAAKhV,EAAG+U,EAAK,GAAIA,EAAK,GAAIA,EAAK,GAAIA,EAAK,IACnC/U,EAAGvG,KAAKwG,EAAM8U,EAAK,GAAIA,EAAK,GAAIA,EAAK,GAAIA,EAAK,IAClE,OAAO/U,EAAGjD,MAAMkD,EAAM8U,KAMpB,SAAUzb,EAAQD,EAASF,GAIjC,IAAI6E,EAAY7E,EAAoB,IAChCuF,EAAUvF,EAAoB,IAElCG,EAAOD,QAAU,SAAS4b,OAAOC,GAC/B,IAAIC,EAAM3V,OAAOd,EAAQ9B,OACrB2E,EAAM,GACNlH,EAAI2D,EAAUkX,GAClB,GAAI7a,EAAI,GAAKA,GAAK+a,SAAU,MAAM1R,WAAW,2BAC7C,KAAU,EAAJrJ,GAAQA,KAAO,KAAO8a,GAAOA,GAAc,EAAJ9a,IAAOkH,GAAO4T,GAC3D,OAAO5T,IAMH,SAAUjI,EAAQD,GAExBC,EAAOD,QAAU,oDAMX,SAAUC,EAAQD,GAGxBC,EAAOD,QAAUmE,KAAK6X,MAAQ,SAASA,KAAKC,GAE1C,OAAmB,IAAXA,GAAKA,IAAWA,GAAKA,EAAIA,EAAIA,EAAI,GAAK,EAAI,IAM9C,SAAUhc,EAAQD,GAGxB,IAAIkc,EAAS/X,KAAKgY,MAClBlc,EAAOD,SAAYkc,GAED,mBAAbA,EAAO,KAA4BA,EAAO,IAAM,qBAE7B,OAAnBA,GAAQ,OACT,SAASC,MAAMF,GACjB,OAAmB,IAAXA,GAAKA,GAAUA,GAAS,KAALA,GAAaA,EAAI,KAAOA,EAAIA,EAAIA,EAAI,EAAI9X,KAAKyE,IAAIqT,GAAK,GAC/EC,GAKE,SAAUjc,EAAQD,EAASF,GAEjC,IAAI6E,EAAY7E,EAAoB,IAChCuF,EAAUvF,EAAoB,IAGlCG,EAAOD,QAAU,SAAUoc,GACzB,OAAO,SAAUxV,EAAMyV,GACrB,IAGIhZ,EAAGC,EAHH7B,EAAI0E,OAAOd,EAAQuB,IACnB1G,EAAIyE,EAAU0X,GACdlc,EAAIsB,EAAEgC,OAEV,OAAIvD,EAAI,GAAUC,GAALD,EAAekc,EAAY,GAAKzc,IAC7C0D,EAAI5B,EAAE6a,WAAWpc,IACN,OAAc,MAAJmD,GAAcnD,EAAI,IAAMC,IAAMmD,EAAI7B,EAAE6a,WAAWpc,EAAI,IAAM,OAAc,MAAJoD,EACpF8Y,EAAY3a,EAAEuZ,OAAO9a,GAAKmD,EAC1B+Y,EAAY3a,EAAE8G,MAAMrI,EAAGA,EAAI,GAA2BoD,EAAI,OAAzBD,EAAI,OAAU,IAAqB,SAOtE,SAAUpD,EAAQD,EAASF,GAGjC,IAAIyc,EAAWzc,EAAoB,KAC/BuF,EAAUvF,EAAoB,IAElCG,EAAOD,QAAU,SAAU4G,EAAM4V,EAAclW,GAC7C,GAAIiW,EAASC,GAAe,MAAMvY,UAAU,UAAYqC,EAAO,0BAC/D,OAAOH,OAAOd,EAAQuB,MAMlB,SAAU3G,EAAQD,EAASF,GAEjC,IAAI2c,EAAQ3c,EAAoB,EAApBA,CAAuB,SACnCG,EAAOD,QAAU,SAAU2I,GACzB,IAAI+T,EAAK,IACT,IACE,MAAM/T,GAAK+T,GACX,MAAOpY,GACP,IAEE,OADAoY,EAAGD,IAAS,GACJ,MAAM9T,GAAK+T,GACnB,MAAOzX,KACT,OAAO,IAML,SAAUhF,EAAQD,EAASF,GAGjC,IAAIgK,EAAYhK,EAAoB,IAChC8M,EAAW9M,EAAoB,EAApBA,CAAuB,YAClC4K,EAAaC,MAAMrJ,UAEvBrB,EAAOD,QAAU,SAAUgE,GACzB,OAAOA,IAAOrE,KAAcmK,EAAUa,QAAU3G,GAAM0G,EAAWkC,KAAc5I,KAM3E,SAAU/D,EAAQD,EAASF,GAIjC,IAAI6c,EAAkB7c,EAAoB,GACtC+G,EAAa/G,EAAoB,IAErCG,EAAOD,QAAU,SAAUoB,EAAQ+G,EAAO/C,GACpC+C,KAAS/G,EAAQub,EAAgB1X,EAAE7D,EAAQ+G,EAAOtB,EAAW,EAAGzB,IAC/DhE,EAAO+G,GAAS/C,IAMjB,SAAUnF,EAAQD,EAASF,GAEjC,IAAI8M,EAAW9M,EAAoB,EAApBA,CAAuB,YAClC8c,GAAe,EAEnB,IACE,IAAIC,EAAQ,CAAC,GAAGjQ,KAChBiQ,EAAc,UAAI,WAAcD,GAAe,GAE/CjS,MAAM6D,KAAKqO,EAAO,WAAc,MAAM,IACtC,MAAOvY,IAETrE,EAAOD,QAAU,SAAUqE,EAAMyY,GAC/B,IAAKA,IAAgBF,EAAc,OAAO,EAC1C,IAAIvG,GAAO,EACX,IACE,IAAI0G,EAAM,CAAC,GACPpK,EAAOoK,EAAInQ,KACf+F,EAAK5D,KAAO,WAAc,MAAO,CAAEC,KAAMqH,GAAO,IAChD0G,EAAInQ,GAAY,WAAc,OAAO+F,GACrCtO,EAAK0Y,GACL,MAAOzY,IACT,OAAO+R,IAMH,SAAUpW,EAAQD,EAASF,GAGjC,IAAI8J,EAAqB9J,EAAoB,KAE7CG,EAAOD,QAAU,SAAUgd,EAAUvZ,GACnC,OAAO,IAAKmG,EAAmBoT,GAAxB,CAAmCvZ,KAMtC,SAAUxD,EAAQD,EAASF,GAKjC,IAAI0F,EAAW1F,EAAoB,GAC/BsJ,EAAkBtJ,EAAoB,IACtCsH,EAAWtH,EAAoB,GACnCG,EAAOD,QAAU,SAASyP,KAAKrK,GAO7B,IANA,IAAIF,EAAIM,EAASjC,MACbE,EAAS2D,EAASlC,EAAEzB,QACpBkL,EAAOnL,UAAUC,OACjB0E,EAAQiB,EAAuB,EAAPuF,EAAWnL,UAAU,GAAK7D,GAAW8D,GAC7DiN,EAAa,EAAP/B,EAAWnL,UAAU,GAAK7D,GAChCsd,EAASvM,IAAQ/Q,GAAY8D,EAAS2F,EAAgBsH,EAAKjN,GAC/C0E,EAAT8U,GAAgB/X,EAAEiD,KAAW/C,EACpC,OAAOF,IAMH,SAAUjF,EAAQD,EAASF,GAIjC,IAAIod,EAAmBpd,EAAoB,IACvC2O,EAAO3O,EAAoB,IAC3BgK,EAAYhK,EAAoB,IAChCiH,EAAYjH,EAAoB,IAMpCG,EAAOD,QAAUF,EAAoB,GAApBA,CAAwB6K,MAAO,QAAS,SAAUwS,EAAUrE,GAC3EvV,KAAKqT,GAAK7P,EAAUoW,GACpB5Z,KAAK6Z,GAAK,EACV7Z,KAAK8Z,GAAKvE,GAET,WACD,IAAI5T,EAAI3B,KAAKqT,GACTkC,EAAOvV,KAAK8Z,GACZlV,EAAQ5E,KAAK6Z,KACjB,OAAKlY,GAAcA,EAAEzB,QAAX0E,GACR5E,KAAKqT,GAAKjX,GACH8O,EAAK,IAEaA,EAAK,EAApB,QAARqK,EAA+B3Q,EACvB,UAAR2Q,EAAiC5T,EAAEiD,GACxB,CAACA,EAAOjD,EAAEiD,MACxB,UAGH2B,EAAUwT,UAAYxT,EAAUa,MAEhCuS,EAAiB,QACjBA,EAAiB,UACjBA,EAAiB,YAKX,SAAUjd,EAAQD,GAExBC,EAAOD,QAAU,SAAUgP,EAAM5J,GAC/B,MAAO,CAAEA,MAAOA,EAAO4J,OAAQA,KAM3B,SAAU/O,EAAQD,EAASF,GAEjC,IAaIyd,EAAOC,EAASC,EAbhB7b,EAAM9B,EAAoB,IAC1B4d,EAAS5d,EAAoB,IAC7B6d,EAAO7d,EAAoB,IAC3B8d,EAAM9d,EAAoB,IAC1B4B,EAAS5B,EAAoB,GAC7B+d,EAAUnc,EAAOmc,QACjBC,EAAUpc,EAAOqc,aACjBC,EAAYtc,EAAOuc,eACnBC,EAAiBxc,EAAOwc,eACxBC,EAAWzc,EAAOyc,SAClBC,EAAU,EACVC,EAAQ,GACRC,EAAqB,qBAErBC,EAAM,WACR,IAAIzK,GAAMvQ,KAEV,GAAI8a,EAAM9c,eAAeuS,GAAK,CAC5B,IAAInN,EAAK0X,EAAMvK,UACRuK,EAAMvK,GACbnN,MAGA6X,EAAW,SAAUC,GACvBF,EAAIne,KAAKqe,EAAMvM,OAGZ4L,GAAYE,IACfF,EAAU,SAASC,aAAapX,GAG9B,IAFA,IAAI+U,EAAO,GACPxb,EAAI,EACkBA,EAAnBsD,UAAUC,QAAYiY,EAAKrT,KAAK7E,UAAUtD,MAMjD,OALAme,IAAQD,GAAW,WAEjBV,EAAoB,mBAAN/W,EAAmBA,EAAKhD,SAASgD,GAAK+U,IAEtD6B,EAAMa,GACCA,GAETJ,EAAY,SAASC,eAAenK,UAC3BuK,EAAMvK,IAGyB,WAApChU,EAAoB,GAApBA,CAAwB+d,GAC1BN,EAAQ,SAAUzJ,GAChB+J,EAAQa,SAAS9c,EAAI2c,EAAKzK,EAAI,KAGvBqK,GAAYA,EAASQ,IAC9BpB,EAAQ,SAAUzJ,GAChBqK,EAASQ,IAAI/c,EAAI2c,EAAKzK,EAAI,KAGnBoK,GAETT,GADAD,EAAU,IAAIU,GACCU,MACfpB,EAAQqB,MAAMC,UAAYN,EAC1BjB,EAAQ3b,EAAI6b,EAAKsB,YAAatB,EAAM,IAG3B/b,EAAOsd,kBAA0C,mBAAfD,cAA8Brd,EAAOud,eAChF1B,EAAQ,SAAUzJ,GAChBpS,EAAOqd,YAAYjL,EAAK,GAAI,MAE9BpS,EAAOsd,iBAAiB,UAAWR,GAAU,IAG7CjB,EADSe,KAAsBV,EAAI,UAC3B,SAAU9J,GAChB6J,EAAKzI,YAAY0I,EAAI,WAAWU,GAAsB,WACpDX,EAAKuB,YAAY3b,MACjBgb,EAAIne,KAAK0T,KAKL,SAAUA,GAChBqL,WAAWvd,EAAI2c,EAAKzK,EAAI,GAAI,KAIlC7T,EAAOD,QAAU,CACf4N,IAAKkQ,EACLsB,MAAOpB,IAMH,SAAU/d,EAAQD,EAASF,GAEjC,IAAI4B,EAAS5B,EAAoB,GAC7Buf,EAAYvf,EAAoB,IAAI8N,IACpC0R,EAAW5d,EAAO6d,kBAAoB7d,EAAO8d,uBAC7C3B,EAAUnc,EAAOmc,QACjB4B,EAAU/d,EAAO+d,QACjBC,EAA6C,WAApC5f,EAAoB,GAApBA,CAAwB+d,GAErC5d,EAAOD,QAAU,WACf,IAAI2f,EAAMC,EAAMC,EAEZC,EAAQ,WACV,IAAIC,EAAQpZ,EAEZ,IADI+Y,IAAWK,EAASlC,EAAQmC,SAASD,EAAOE,OACzCN,GAAM,CACXhZ,EAAKgZ,EAAKhZ,GACVgZ,EAAOA,EAAK5Q,KACZ,IACEpI,IACA,MAAOrC,GAGP,MAFIqb,EAAME,IACLD,EAAOjgB,GACN2E,GAERsb,EAAOjgB,GACLogB,GAAQA,EAAOG,SAIrB,GAAIR,EACFG,EAAS,WACPhC,EAAQa,SAASoB,SAGd,IAAIR,GAAc5d,EAAO6X,WAAa7X,EAAO6X,UAAU4G,WAQvD,GAAIV,GAAWA,EAAQW,QAAS,CAErC,IAAIC,EAAUZ,EAAQW,QAAQzgB,IAC9BkgB,EAAS,WACPQ,EAAQC,KAAKR,SASfD,EAAS,WAEPR,EAAUjf,KAAKsB,EAAQoe,QAvBgD,CACzE,IAAIS,GAAS,EACTC,EAAOpL,SAASqL,eAAe,IACnC,IAAInB,EAASQ,GAAOY,QAAQF,EAAM,CAAEG,eAAe,IACnDd,EAAS,WACPW,EAAKtO,KAAOqO,GAAUA,GAsB1B,OAAO,SAAU5Z,GACf,IAAIia,EAAO,CAAEja,GAAIA,EAAIoI,KAAMpP,IACvBigB,IAAMA,EAAK7Q,KAAO6R,GACjBjB,IACHA,EAAOiB,EACPf,KACAD,EAAOgB,KAOP,SAAU3gB,EAAQD,EAASF,GAKjC,IAAI4G,EAAY5G,EAAoB,IAEpC,SAAS+gB,kBAAkBzd,GACzB,IAAIgd,EAASU,EACbvd,KAAK8c,QAAU,IAAIjd,EAAE,SAAU2d,EAAWC,GACxC,GAAIZ,IAAYzgB,IAAamhB,IAAWnhB,GAAW,MAAMsE,UAAU,2BACnEmc,EAAUW,EACVD,EAASE,IAEXzd,KAAK6c,QAAU1Z,EAAU0Z,GACzB7c,KAAKud,OAASpa,EAAUoa,GAG1B7gB,EAAOD,QAAQiF,EAAI,SAAU7B,GAC3B,OAAO,IAAIyd,kBAAkBzd,KAMzB,SAAUnD,EAAQD,EAASF,GAGjC,IAAIyJ,EAAOzJ,EAAoB,IAC3Bqb,EAAOrb,EAAoB,IAC3B+E,EAAW/E,EAAoB,GAC/BmhB,EAAUnhB,EAAoB,GAAGmhB,QACrChhB,EAAOD,QAAUihB,GAAWA,EAAQC,SAAW,SAASA,QAAQld,GAC9D,IAAI2H,EAAOpC,EAAKtE,EAAEJ,EAASb,IACvBuX,EAAaJ,EAAKlW,EACtB,OAAOsW,EAAa5P,EAAKiH,OAAO2I,EAAWvX,IAAO2H,IAM9C,SAAU1L,EAAQD,EAASF,GAIjC,IAAI4B,EAAS5B,EAAoB,GAC7B4W,EAAc5W,EAAoB,GAClC+I,EAAU/I,EAAoB,IAC9BgJ,EAAShJ,EAAoB,IAC7B+B,EAAO/B,EAAoB,IAC3BoJ,EAAcpJ,EAAoB,IAClC+F,EAAQ/F,EAAoB,GAC5BkJ,EAAalJ,EAAoB,IACjC6E,EAAY7E,EAAoB,IAChCsH,EAAWtH,EAAoB,GAC/BqJ,EAAUrJ,EAAoB,KAC9ByJ,EAAOzJ,EAAoB,IAAImF,EAC/BD,EAAKlF,EAAoB,GAAGmF,EAC5BgF,EAAYnK,EAAoB,IAChCsY,EAAiBtY,EAAoB,IACrCyK,EAAe,cACf4W,EAAY,WACZpf,EAAY,YAEZqf,EAAc,eACdxW,EAAelJ,EAAO6I,GACtBO,EAAYpJ,EAAOyf,GACnBhd,EAAOzC,EAAOyC,KACdkG,EAAa3I,EAAO2I,WAEpB0R,EAAWra,EAAOqa,SAClBsF,EAAazW,EACb0W,EAAMnd,EAAKmd,IACXC,EAAMpd,EAAKod,IACX9Y,EAAQtE,EAAKsE,MACb+Y,EAAMrd,EAAKqd,IACXC,EAAMtd,EAAKsd,IAEXC,EAAc,aACdC,EAAc,aACdC,EAAUlL,EAAc,KAHf,SAITmL,EAAUnL,EAAc,KAAOgL,EAC/BI,EAAUpL,EAAc,KAAOiL,EAGnC,SAASI,YAAY3c,EAAO4c,EAAMC,GAChC,IAOI3d,EAAGjE,EAAGC,EAPNoN,EAAS,IAAI/C,MAAMsX,GACnBC,EAAgB,EAATD,EAAaD,EAAO,EAC3BG,GAAQ,GAAKD,GAAQ,EACrBE,EAAQD,GAAQ,EAChBE,EAAc,KAATL,EAAcT,EAAI,GAAI,IAAMA,EAAI,GAAI,IAAM,EAC/CrhB,EAAI,EACJuB,EAAI2D,EAAQ,GAAe,IAAVA,GAAe,EAAIA,EAAQ,EAAI,EAAI,EAkCxD,KAhCAA,EAAQkc,EAAIlc,KAECA,GAASA,IAAU2W,GAE9B1b,EAAI+E,GAASA,EAAQ,EAAI,EACzBd,EAAI6d,IAEJ7d,EAAImE,EAAM+Y,EAAIpc,GAASqc,GACnBrc,GAAS9E,EAAIihB,EAAI,GAAIjd,IAAM,IAC7BA,IACAhE,GAAK,GAOU,IAJf8E,GADe,GAAbd,EAAI8d,EACGC,EAAK/hB,EAEL+hB,EAAKd,EAAI,EAAG,EAAIa,IAEf9hB,IACVgE,IACAhE,GAAK,GAEU6hB,GAAb7d,EAAI8d,GACN/hB,EAAI,EACJiE,EAAI6d,GACkB,GAAb7d,EAAI8d,GACb/hB,GAAK+E,EAAQ9E,EAAI,GAAKihB,EAAI,EAAGS,GAC7B1d,GAAQ8d,IAER/hB,EAAI+E,EAAQmc,EAAI,EAAGa,EAAQ,GAAKb,EAAI,EAAGS,GACvC1d,EAAI,IAGO,GAAR0d,EAAWtU,EAAOxN,KAAW,IAAJG,EAASA,GAAK,IAAK2hB,GAAQ,GAG3D,IAFA1d,EAAIA,GAAK0d,EAAO3hB,EAChB6hB,GAAQF,EACM,EAAPE,EAAUxU,EAAOxN,KAAW,IAAJoE,EAASA,GAAK,IAAK4d,GAAQ,GAE1D,OADAxU,IAASxN,IAAU,IAAJuB,EACRiM,EAET,SAAS4U,cAAc5U,EAAQsU,EAAMC,GACnC,IAOI5hB,EAPA6hB,EAAgB,EAATD,EAAaD,EAAO,EAC3BG,GAAQ,GAAKD,GAAQ,EACrBE,EAAQD,GAAQ,EAChBI,EAAQL,EAAO,EACfhiB,EAAI+hB,EAAS,EACbxgB,EAAIiM,EAAOxN,KACXoE,EAAQ,IAAJ7C,EAGR,IADAA,IAAM,EACS,EAAR8gB,EAAWje,EAAQ,IAAJA,EAAUoJ,EAAOxN,GAAIA,IAAKqiB,GAAS,GAIzD,IAHAliB,EAAIiE,GAAK,IAAMie,GAAS,EACxBje,KAAOie,EACPA,GAASP,EACM,EAARO,EAAWliB,EAAQ,IAAJA,EAAUqN,EAAOxN,GAAIA,IAAKqiB,GAAS,GACzD,GAAU,IAANje,EACFA,EAAI,EAAI8d,MACH,CAAA,GAAI9d,IAAM6d,EACf,OAAO9hB,EAAImiB,IAAM/gB,GAAKsa,EAAWA,EAEjC1b,GAAQkhB,EAAI,EAAGS,GACf1d,GAAQ8d,EACR,OAAQ3gB,GAAK,EAAI,GAAKpB,EAAIkhB,EAAI,EAAGjd,EAAI0d,GAGzC,SAASS,UAAUC,GACjB,OAAOA,EAAM,IAAM,GAAKA,EAAM,IAAM,GAAKA,EAAM,IAAM,EAAIA,EAAM,GAEjE,SAASC,OAAO3e,GACd,MAAO,CAAM,IAALA,GAEV,SAAS4e,QAAQ5e,GACf,MAAO,CAAM,IAALA,EAAWA,GAAM,EAAI,KAE/B,SAAS6e,QAAQ7e,GACf,MAAO,CAAM,IAALA,EAAWA,GAAM,EAAI,IAAMA,GAAM,GAAK,IAAMA,GAAM,GAAK,KAEjE,SAAS8e,QAAQ9e,GACf,OAAO+d,YAAY/d,EAAI,GAAI,GAE7B,SAAS+e,QAAQ/e,GACf,OAAO+d,YAAY/d,EAAI,GAAI,GAG7B,SAASoK,UAAUhL,EAAGjB,EAAKkM,GACzBrJ,EAAG5B,EAAErB,GAAYI,EAAK,CAAEpB,IAAK,WAAc,OAAOwC,KAAK8K,MAGzD,SAAStN,IAAIiiB,EAAMN,EAAOva,EAAO8a,GAC/B,IACIC,EAAW/Z,GADChB,GAEhB,GAAuB6a,EAAKnB,GAAxBqB,EAAWR,EAAuB,MAAMrY,EAAW+W,GACvD,IACI7R,EAAQ2T,EAAWF,EAAKlB,GACxBqB,EAFQH,EAAKpB,GAASwB,GAET7a,MAAMgH,EAAOA,EAAQmT,GACtC,OAAOO,EAAiBE,EAAOA,EAAK/S,UAEtC,SAASxC,IAAIoV,EAAMN,EAAOva,EAAOkb,EAAYje,EAAO6d,GAClD,IACIC,EAAW/Z,GADChB,GAEhB,GAAuB6a,EAAKnB,GAAxBqB,EAAWR,EAAuB,MAAMrY,EAAW+W,GAIvD,IAHA,IAAI7c,EAAQye,EAAKpB,GAASwB,GACtB7T,EAAQ2T,EAAWF,EAAKlB,GACxBqB,EAAOE,GAAYje,GACdlF,EAAI,EAAGA,EAAIwiB,EAAOxiB,IAAKqE,EAAMgL,EAAQrP,GAAKijB,EAAKF,EAAiB/iB,EAAIwiB,EAAQxiB,EAAI,GAG3F,GAAK4I,EAAOuJ,IAgFL,CACL,IAAKxM,EAAM,WACT+E,EAAa,OACR/E,EAAM,WACX,IAAI+E,GAAc,MACd/E,EAAM,WAIV,OAHA,IAAI+E,EACJ,IAAIA,EAAa,KACjB,IAAIA,EAAa4X,KACV5X,EAAapK,MAAQ+J,IAC1B,CAMF,IADA,IACyCpI,EADrCmhB,GAJJ1Y,EAAe,SAASC,YAAYpH,GAElC,OADAuF,EAAWzF,KAAMqH,GACV,IAAIyW,EAAWlY,EAAQ1F,MAEI1B,GAAasf,EAAWtf,GACnD4J,EAAOpC,EAAK8X,GAAa5F,EAAI,EAAsBA,EAAd9P,EAAKlI,SAC1CtB,EAAMwJ,EAAK8P,QAAS7Q,GAAe/I,EAAK+I,EAAczI,EAAKkf,EAAWlf,IAE1E0G,IAASya,EAAiB1d,YAAcgF,GAG/C,IAAIoY,EAAO,IAAIlY,EAAU,IAAIF,EAAa,IACtC2Y,EAAWzY,EAAU/I,GAAWyhB,QACpCR,EAAKQ,QAAQ,EAAG,YAChBR,EAAKQ,QAAQ,EAAG,aACZR,EAAKS,QAAQ,IAAOT,EAAKS,QAAQ,IAAIva,EAAY4B,EAAU/I,GAAY,CACzEyhB,QAAS,SAASA,QAAQ5S,EAAYxL,GACpCme,EAASnjB,KAAKmD,KAAMqN,EAAYxL,GAAS,IAAM,KAEjDse,SAAU,SAASA,SAAS9S,EAAYxL,GACtCme,EAASnjB,KAAKmD,KAAMqN,EAAYxL,GAAS,IAAM,OAEhD,QAhHHwF,EAAe,SAASC,YAAYpH,GAClCuF,EAAWzF,KAAMqH,EAAcL,GAC/B,IAAIiI,EAAarJ,EAAQ1F,GACzBF,KAAK6f,GAAKnZ,EAAU7J,KAAK,IAAIuK,MAAM6H,GAAa,GAChDjP,KAAKse,GAAWrP,GAGlB1H,EAAY,SAASC,SAAS2C,EAAQkD,EAAY4B,GAChDxJ,EAAWzF,KAAMuH,EAAWqW,GAC5BnY,EAAW0E,EAAQ9C,EAAcuW,GACjC,IAAIwC,EAAejW,EAAOmU,GACtB9T,EAASpJ,EAAUiM,GACvB,GAAI7C,EAAS,GAAc4V,EAAT5V,EAAuB,MAAM1D,EAAW,iBAE1D,GAA0BsZ,EAAtB5V,GADJyE,EAAaA,IAAe7S,GAAYgkB,EAAe5V,EAAS3G,EAASoL,IACjC,MAAMnI,EAxJ/B,iBAyJf9G,KAAKqe,GAAWlU,EAChBnK,KAAKue,GAAW/T,EAChBxK,KAAKse,GAAWrP,GAGdkE,IACFtI,UAAUxD,EAAc8W,EAAa,MACrCtT,UAAUtD,EAlJD,SAkJoB,MAC7BsD,UAAUtD,EAAW4W,EAAa,MAClCtT,UAAUtD,EAAW6W,EAAa,OAGpCzY,EAAY4B,EAAU/I,GAAY,CAChC0hB,QAAS,SAASA,QAAQ7S,GACxB,OAAO7P,IAAIwC,KAAM,EAAGqN,GAAY,IAAM,IAAM,IAE9CgT,SAAU,SAASA,SAAShT,GAC1B,OAAO7P,IAAIwC,KAAM,EAAGqN,GAAY,IAElCiT,SAAU,SAASA,SAASjT,GAC1B,IAAI8R,EAAQ3hB,IAAIwC,KAAM,EAAGqN,EAAYpN,UAAU,IAC/C,OAAQkf,EAAM,IAAM,EAAIA,EAAM,KAAO,IAAM,IAE7CoB,UAAW,SAASA,UAAUlT,GAC5B,IAAI8R,EAAQ3hB,IAAIwC,KAAM,EAAGqN,EAAYpN,UAAU,IAC/C,OAAOkf,EAAM,IAAM,EAAIA,EAAM,IAE/BqB,SAAU,SAASA,SAASnT,GAC1B,OAAO6R,UAAU1hB,IAAIwC,KAAM,EAAGqN,EAAYpN,UAAU,MAEtDwgB,UAAW,SAASA,UAAUpT,GAC5B,OAAO6R,UAAU1hB,IAAIwC,KAAM,EAAGqN,EAAYpN,UAAU,OAAS,GAE/DygB,WAAY,SAASA,WAAWrT,GAC9B,OAAO0R,cAAcvhB,IAAIwC,KAAM,EAAGqN,EAAYpN,UAAU,IAAK,GAAI,IAEnE0gB,WAAY,SAASA,WAAWtT,GAC9B,OAAO0R,cAAcvhB,IAAIwC,KAAM,EAAGqN,EAAYpN,UAAU,IAAK,GAAI,IAEnEggB,QAAS,SAASA,QAAQ5S,EAAYxL,GACpCwI,IAAIrK,KAAM,EAAGqN,EAAY+R,OAAQvd,IAEnCse,SAAU,SAASA,SAAS9S,EAAYxL,GACtCwI,IAAIrK,KAAM,EAAGqN,EAAY+R,OAAQvd,IAEnC+e,SAAU,SAASA,SAASvT,EAAYxL,GACtCwI,IAAIrK,KAAM,EAAGqN,EAAYgS,QAASxd,EAAO5B,UAAU,KAErD4gB,UAAW,SAASA,UAAUxT,EAAYxL,GACxCwI,IAAIrK,KAAM,EAAGqN,EAAYgS,QAASxd,EAAO5B,UAAU,KAErD6gB,SAAU,SAASA,SAASzT,EAAYxL,GACtCwI,IAAIrK,KAAM,EAAGqN,EAAYiS,QAASzd,EAAO5B,UAAU,KAErD8gB,UAAW,SAASA,UAAU1T,EAAYxL,GACxCwI,IAAIrK,KAAM,EAAGqN,EAAYiS,QAASzd,EAAO5B,UAAU,KAErD+gB,WAAY,SAASA,WAAW3T,EAAYxL,GAC1CwI,IAAIrK,KAAM,EAAGqN,EAAYmS,QAAS3d,EAAO5B,UAAU,KAErDghB,WAAY,SAASA,WAAW5T,EAAYxL,GAC1CwI,IAAIrK,KAAM,EAAGqN,EAAYkS,QAAS1d,EAAO5B,UAAU,OAsCzD4U,EAAexN,EAAcL,GAC7B6N,EAAetN,EAAWqW,GAC1Btf,EAAKiJ,EAAU/I,GAAY+G,EAAOsE,MAAM,GACxCpN,EAAQuK,GAAgBK,EACxB5K,EAAQmhB,GAAarW,GAKf,SAAU7K,EAAQD,GAExBC,EAAOD,QAAU,SAAUykB,EAAQpe,GACjC,IAAIqe,EAAWre,IAAY1F,OAAO0F,GAAW,SAAUse,GACrD,OAAOte,EAAQse,IACbte,EACJ,OAAO,SAAUrC,GACf,OAAOmC,OAAOnC,GAAIqC,QAAQoe,EAAQC,MAOhC,SAAUzkB,EAAQD,EAASF,GAEjCG,EAAOD,SAAWF,EAAoB,KAAOA,EAAoB,EAApBA,CAAuB,WAClE,OAA2G,GAApGa,OAAOC,eAAed,EAAoB,GAApBA,CAAwB,OAAQ,IAAK,CAAEiB,IAAK,WAAc,OAAO,KAAQsC,KAMlG,SAAUpD,EAAQD,EAASF,GAEjCE,EAAQiF,EAAInF,EAAoB,IAK1B,SAAUG,EAAQD,EAASF,GAEjC,IAAIgC,EAAMhC,EAAoB,IAC1BiH,EAAYjH,EAAoB,IAChCyL,EAAezL,EAAoB,GAApBA,EAAwB,GACvC2F,EAAW3F,EAAoB,GAApBA,CAAwB,YAEvCG,EAAOD,QAAU,SAAUoB,EAAQwjB,GACjC,IAGIziB,EAHA+C,EAAI6B,EAAU3F,GACdlB,EAAI,EACJkI,EAAS,GAEb,IAAKjG,KAAO+C,EAAO/C,GAAOsD,GAAU3D,EAAIoD,EAAG/C,IAAQiG,EAAOC,KAAKlG,GAE/D,KAAsBjC,EAAf0kB,EAAMnhB,QAAgB3B,EAAIoD,EAAG/C,EAAMyiB,EAAM1kB,SAC7CqL,EAAanD,EAAQjG,IAAQiG,EAAOC,KAAKlG,IAE5C,OAAOiG,IAMH,SAAUnI,EAAQD,EAASF,GAEjC,IAAIkF,EAAKlF,EAAoB,GACzB+E,EAAW/E,EAAoB,GAC/Bob,EAAUpb,EAAoB,IAElCG,EAAOD,QAAUF,EAAoB,GAAKa,OAAOkkB,iBAAmB,SAASA,iBAAiB3f,EAAGuQ,GAC/F5Q,EAASK,GAKT,IAJA,IAGIrC,EAHA8I,EAAOuP,EAAQzF,GACfhS,EAASkI,EAAKlI,OACdvD,EAAI,EAEQA,EAATuD,GAAYuB,EAAGC,EAAEC,EAAGrC,EAAI8I,EAAKzL,KAAMuV,EAAW5S,IACrD,OAAOqC,IAMH,SAAUjF,EAAQD,EAASF,GAGjC,IAAIiH,EAAYjH,EAAoB,IAChCyJ,EAAOzJ,EAAoB,IAAImF,EAC/BqD,EAAW,GAAGA,SAEdwc,EAA+B,iBAAV5gB,QAAsBA,QAAUvD,OAAOoW,oBAC5DpW,OAAOoW,oBAAoB7S,QAAU,GAUzCjE,EAAOD,QAAQiF,EAAI,SAAS8R,oBAAoB/S,GAC9C,OAAO8gB,GAAoC,mBAArBxc,EAASlI,KAAK4D,GATjB,SAAUA,GAC7B,IACE,OAAOuF,EAAKvF,GACZ,MAAOM,GACP,OAAOwgB,EAAYvc,SAK0Cwc,CAAe/gB,GAAMuF,EAAKxC,EAAU/C,MAM/F,SAAU/D,EAAQD,EAASF,GAIjC,IAAIiE,EAAWjE,EAAoB,GAC/B+E,EAAW/E,EAAoB,GAC/BklB,EAAQ,SAAU9f,EAAGmK,GAEvB,GADAxK,EAASK,IACJnB,EAASsL,IAAoB,OAAVA,EAAgB,MAAMpL,UAAUoL,EAAQ,8BAElEpP,EAAOD,QAAU,CACf4N,IAAKjN,OAAOskB,iBAAmB,aAAe,GAC5C,SAAU1e,EAAM2e,EAAOtX,GACrB,KACEA,EAAM9N,EAAoB,GAApBA,CAAwB6D,SAASvD,KAAMN,EAAoB,IAAImF,EAAEtE,OAAOW,UAAW,aAAasM,IAAK,IACvGrH,EAAM,IACV2e,IAAU3e,aAAgBoE,OAC1B,MAAOrG,GAAK4gB,GAAQ,EACtB,OAAO,SAASD,eAAe/f,EAAGmK,GAIhC,OAHA2V,EAAM9f,EAAGmK,GACL6V,EAAOhgB,EAAEigB,UAAY9V,EACpBzB,EAAI1I,EAAGmK,GACLnK,GAVX,CAYE,IAAI,GAASvF,IACjBqlB,MAAOA,IAMH,SAAU/kB,EAAQD,EAASF,GAIjC,IAAI4G,EAAY5G,EAAoB,IAChCiE,EAAWjE,EAAoB,GAC/B4d,EAAS5d,EAAoB,IAC7B0M,EAAa,GAAGjE,MAChB6c,EAAY,GAUhBnlB,EAAOD,QAAU2D,SAAS0hB,MAAQ,SAASA,KAAKze,GAC9C,IAAID,EAAKD,EAAUnD,MACf+hB,EAAW9Y,EAAWpM,KAAKoD,UAAW,GACtC+hB,EAAQ,WACV,IAAI7J,EAAO4J,EAAS1S,OAAOpG,EAAWpM,KAAKoD,YAC3C,OAAOD,gBAAgBgiB,EAbX,SAAUhjB,EAAG0O,EAAKyK,GAChC,KAAMzK,KAAOmU,GAAY,CACvB,IAAK,IAAIpkB,EAAI,GAAId,EAAI,EAAGA,EAAI+Q,EAAK/Q,IAAKc,EAAEd,GAAK,KAAOA,EAAI,IAExDklB,EAAUnU,GAAOtN,SAAS,MAAO,gBAAkB3C,EAAEqL,KAAK,KAAO,KACjE,OAAO+Y,EAAUnU,GAAK1O,EAAGmZ,GAQM8J,CAAU7e,EAAI+U,EAAKjY,OAAQiY,GAAQgC,EAAO/W,EAAI+U,EAAM9U,IAGrF,OADI7C,EAAS4C,EAAGrF,aAAYikB,EAAMjkB,UAAYqF,EAAGrF,WAC1CikB,IAMH,SAAUtlB,EAAQD,EAASF,GAEjC,IAAIgW,EAAMhW,EAAoB,IAC9BG,EAAOD,QAAU,SAAUgE,EAAIyhB,GAC7B,GAAiB,iBAANzhB,GAA6B,UAAX8R,EAAI9R,GAAiB,MAAMC,UAAUwhB,GAClE,OAAQzhB,IAMJ,SAAU/D,EAAQD,EAASF,GAGjC,IAAIiE,EAAWjE,EAAoB,GAC/B2I,EAAQtE,KAAKsE,MACjBxI,EAAOD,QAAU,SAAS0lB,UAAU1hB,GAClC,OAAQD,EAASC,IAAO2hB,SAAS3hB,IAAOyE,EAAMzE,KAAQA,IAMlD,SAAU/D,EAAQD,EAASF,GAEjC,IAAI8lB,EAAc9lB,EAAoB,GAAG+lB,WACrCC,EAAQhmB,EAAoB,IAAI0X,KAEpCvX,EAAOD,QAAU,EAAI4lB,EAAY9lB,EAAoB,IAAM,QAAWic,SAAW,SAAS8J,WAAW/J,GACnG,IAAI9V,EAAS8f;AAAM3f,OAAO2V,GAAM,GAC5B1T,EAASwd,EAAY5f,GACzB,OAAkB,IAAXoC,GAAoC,KAApBpC,EAAOgV,OAAO,IAAa,EAAI5S,GACpDwd,GAKE,SAAU3lB,EAAQD,EAASF,GAEjC,IAAIimB,EAAYjmB,EAAoB,GAAGkmB,SACnCF,EAAQhmB,EAAoB,IAAI0X,KAChCyO,EAAKnmB,EAAoB,IACzBomB,EAAM,cAEVjmB,EAAOD,QAAmC,IAAzB+lB,EAAUE,EAAK,OAA0C,KAA3BF,EAAUE,EAAK,QAAiB,SAASD,SAASlK,EAAKqK,GACpG,IAAIngB,EAAS8f,EAAM3f,OAAO2V,GAAM,GAChC,OAAOiK,EAAU/f,EAASmgB,IAAU,IAAOD,EAAI3f,KAAKP,GAAU,GAAK,MACjE+f,GAKE,SAAU9lB,EAAQD,GAGxBC,EAAOD,QAAUmE,KAAKiiB,OAAS,SAASA,MAAMnK,GAC5C,OAAmB,MAAXA,GAAKA,IAAcA,EAAI,KAAOA,EAAIA,EAAIA,EAAI,EAAI9X,KAAKqd,IAAI,EAAIvF,KAM/D,SAAUhc,EAAQD,EAASF,GAGjC,IAAIkc,EAAOlc,EAAoB,IAC3ByhB,EAAMpd,KAAKod,IACX8E,EAAU9E,EAAI,GAAI,IAClB+E,EAAY/E,EAAI,GAAI,IACpBgF,EAAQhF,EAAI,EAAG,MAAQ,EAAI+E,GAC3BE,EAAQjF,EAAI,GAAI,KAMpBthB,EAAOD,QAAUmE,KAAKsiB,QAAU,SAASA,OAAOxK,GAC9C,IAEI5Y,EAAG+E,EAFHse,EAAOviB,KAAKmd,IAAIrF,GAChB0K,EAAQ3K,EAAKC,GAEjB,OAAIyK,EAAOF,EAAcG,GAAwBD,EAAOF,EAAQF,EAPrD,EAAID,EAAU,EAAIA,GAOgDG,EAAQF,EAIxEC,GAFbne,GADA/E,GAAK,EAAIijB,EAAYD,GAAWK,IAClBrjB,EAAIqjB,KAEIte,GAAUA,EAAeue,EAAQ5K,SAChD4K,EAAQve,IAMX,SAAUnI,EAAQD,EAASF,GAGjC,IAAIiE,EAAWjE,EAAoB,GAC/BgW,EAAMhW,EAAoB,IAC1B2c,EAAQ3c,EAAoB,EAApBA,CAAuB,SACnCG,EAAOD,QAAU,SAAUgE,GACzB,IAAIuY,EACJ,OAAOxY,EAASC,MAASuY,EAAWvY,EAAGyY,MAAY9c,KAAc4c,EAAsB,UAAXzG,EAAI9R,MAM5E,SAAU/D,EAAQD,EAASF,GAGjC,IAAI+E,EAAW/E,EAAoB,GACnCG,EAAOD,QAAU,SAAU0O,EAAU/H,EAAIvB,EAAOyG,GAC9C,IACE,OAAOA,EAAUlF,EAAG9B,EAASO,GAAO,GAAIA,EAAM,IAAMuB,EAAGvB,GAEvD,MAAOd,GACP,IAAIsiB,EAAMlY,EAAiB,UAE3B,MADIkY,IAAQjnB,IAAWkF,EAAS+hB,EAAIxmB,KAAKsO,IACnCpK,KAOJ,SAAUrE,EAAQD,EAASF,GAEjC,IAAI4G,EAAY5G,EAAoB,IAChC0F,EAAW1F,EAAoB,GAC/BwF,EAAUxF,EAAoB,IAC9BsH,EAAWtH,EAAoB,GAEnCG,EAAOD,QAAU,SAAU4G,EAAMoB,EAAY2G,EAAMkY,EAAMC,GACvDpgB,EAAUsB,GACV,IAAI9C,EAAIM,EAASoB,GACbxC,EAAOkB,EAAQJ,GACfzB,EAAS2D,EAASlC,EAAEzB,QACpB0E,EAAQ2e,EAAUrjB,EAAS,EAAI,EAC/BvD,EAAI4mB,GAAW,EAAI,EACvB,GAAInY,EAAO,EAAG,OAAS,CACrB,GAAIxG,KAAS/D,EAAM,CACjByiB,EAAOziB,EAAK+D,GACZA,GAASjI,EACT,MAGF,GADAiI,GAASjI,EACL4mB,EAAU3e,EAAQ,EAAI1E,GAAU0E,EAClC,MAAMlE,UAAU,+CAGpB,KAAM6iB,EAAmB,GAAT3e,EAAsBA,EAAT1E,EAAgB0E,GAASjI,EAAOiI,KAAS/D,IACpEyiB,EAAO7e,EAAW6e,EAAMziB,EAAK+D,GAAQA,EAAOjD,IAE9C,OAAO2hB,IAMH,SAAU5mB,EAAQD,EAASF,GAKjC,IAAI0F,EAAW1F,EAAoB,GAC/BsJ,EAAkBtJ,EAAoB,IACtCsH,EAAWtH,EAAoB,GAEnCG,EAAOD,QAAU,GAAGsP,YAAc,SAASA,WAAWnM,EAAkBoM,GACtE,IAAIrK,EAAIM,EAASjC,MACb0N,EAAM7J,EAASlC,EAAEzB,QACjBsjB,EAAK3d,EAAgBjG,EAAQ8N,GAC7BzC,EAAOpF,EAAgBmG,EAAO0B,GAC9BP,EAAyB,EAAnBlN,UAAUC,OAAaD,UAAU,GAAK7D,GAC5Ckc,EAAQ1X,KAAKS,KAAK8L,IAAQ/Q,GAAYsR,EAAM7H,EAAgBsH,EAAKO,IAAQzC,EAAMyC,EAAM8V,GACrFC,EAAM,EAMV,IALIxY,EAAOuY,GAAMA,EAAKvY,EAAOqN,IAC3BmL,GAAO,EACPxY,GAAQqN,EAAQ,EAChBkL,GAAMlL,EAAQ,GAEC,EAAVA,KACDrN,KAAQtJ,EAAGA,EAAE6hB,GAAM7hB,EAAEsJ,UACbtJ,EAAE6hB,GACdA,GAAMC,EACNxY,GAAQwY,EACR,OAAO9hB,IAML,SAAUjF,EAAQD,GAExBC,EAAOD,QAAU,SAAUqE,GACzB,IACE,MAAO,CAAEC,GAAG,EAAO6N,EAAG9N,KACtB,MAAOC,GACP,MAAO,CAAEA,GAAG,EAAM6N,EAAG7N,MAOnB,SAAUrE,EAAQD,EAASF,GAEjC,IAAI+E,EAAW/E,EAAoB,GAC/BiE,EAAWjE,EAAoB,GAC/BmnB,EAAuBnnB,EAAoB,IAE/CG,EAAOD,QAAU,SAAUoD,EAAG6Y,GAE5B,GADApX,EAASzB,GACLW,EAASkY,IAAMA,EAAErW,cAAgBxC,EAAG,OAAO6Y,EAC/C,IAAIiL,EAAoBD,EAAqBhiB,EAAE7B,GAG/C,OADAgd,EADc8G,EAAkB9G,SACxBnE,GACDiL,EAAkB7G,UAMrB,SAAUpgB,EAAQD,EAASF,GAIjC,IAAIqnB,EAASrnB,EAAoB,KAC7BkO,EAAWlO,EAAoB,IAInCG,EAAOD,QAAUF,EAAoB,GAApBA,CAHP,MAGoC,SAAUiB,GACtD,OAAO,SAASiS,MAAQ,OAAOjS,EAAIwC,KAAyB,EAAnBC,UAAUC,OAAaD,UAAU,GAAK7D,MAC9E,CAEDoB,IAAK,SAASA,IAAIoB,GAChB,IAAIilB,EAAQD,EAAOE,SAASrZ,EAASzK,KAR/B,OAQ2CpB,GACjD,OAAOilB,GAASA,EAAMjV,GAGxBvE,IAAK,SAASA,IAAIzL,EAAKiD,GACrB,OAAO+hB,EAAO3Q,IAAIxI,EAASzK,KAbrB,OAayC,IAARpB,EAAY,EAAIA,EAAKiD,KAE7D+hB,GAAQ,IAKL,SAAUlnB,EAAQD,EAASF,GAIjC,IAAIkF,EAAKlF,EAAoB,GAAGmF,EAC5B6C,EAAShI,EAAoB,IAC7BoJ,EAAcpJ,EAAoB,IAClC8B,EAAM9B,EAAoB,IAC1BkJ,EAAalJ,EAAoB,IACjC2Z,EAAQ3Z,EAAoB,IAC5BwnB,EAAcxnB,EAAoB,IAClC2O,EAAO3O,EAAoB,IAC3BkK,EAAalK,EAAoB,IACjC4W,EAAc5W,EAAoB,GAClCwU,EAAUxU,EAAoB,IAAIwU,QAClCtG,EAAWlO,EAAoB,IAC/BynB,EAAO7Q,EAAc,KAAO,OAE5B2Q,EAAW,SAAUzgB,EAAMzE,GAE7B,IACIilB,EADAjf,EAAQmM,EAAQnS,GAEpB,GAAc,MAAVgG,EAAe,OAAOvB,EAAKwW,GAAGjV,GAElC,IAAKif,EAAQxgB,EAAK4gB,GAAIJ,EAAOA,EAAQA,EAAMpmB,EACzC,GAAIomB,EAAM9L,GAAKnZ,EAAK,OAAOilB,GAI/BnnB,EAAOD,QAAU,CACfia,eAAgB,SAAUxI,EAASnL,EAAMkB,EAAQqS,GAC/C,IAAIzW,EAAIqO,EAAQ,SAAU7K,EAAMgP,GAC9B5M,EAAWpC,EAAMxD,EAAGkD,EAAM,MAC1BM,EAAKgQ,GAAKtQ,EACVM,EAAKwW,GAAKtV,EAAO,MACjBlB,EAAK4gB,GAAK7nB,GACViH,EAAK6gB,GAAK9nB,GACViH,EAAK2gB,GAAQ,EACT3R,GAAYjW,IAAW8Z,EAAM7D,EAAUpO,EAAQZ,EAAKiT,GAAQjT,KAsDlE,OApDAsC,EAAY9F,EAAE9B,UAAW,CAGvB8d,MAAO,SAASA,QACd,IAAK,IAAIxY,EAAOoH,EAASzK,KAAM+C,GAAO4L,EAAOtL,EAAKwW,GAAIgK,EAAQxgB,EAAK4gB,GAAIJ,EAAOA,EAAQA,EAAMpmB,EAC1FomB,EAAMM,GAAI,EACNN,EAAM5lB,IAAG4lB,EAAM5lB,EAAI4lB,EAAM5lB,EAAER,EAAIrB,WAC5BuS,EAAKkV,EAAMlnB,GAEpB0G,EAAK4gB,GAAK5gB,EAAK6gB,GAAK9nB,GACpBiH,EAAK2gB,GAAQ,GAIfI,SAAU,SAAUxlB,GAClB,IAAIyE,EAAOoH,EAASzK,KAAM+C,GACtB8gB,EAAQC,EAASzgB,EAAMzE,GAC3B,GAAIilB,EAAO,CACT,IAAIrY,EAAOqY,EAAMpmB,EACb4mB,EAAOR,EAAM5lB,SACVoF,EAAKwW,GAAGgK,EAAMlnB,GACrBknB,EAAMM,GAAI,EACNE,IAAMA,EAAK5mB,EAAI+N,GACfA,IAAMA,EAAKvN,EAAIomB,GACfhhB,EAAK4gB,IAAMJ,IAAOxgB,EAAK4gB,GAAKzY,GAC5BnI,EAAK6gB,IAAML,IAAOxgB,EAAK6gB,GAAKG,GAChChhB,EAAK2gB,KACL,QAASH,GAIbtX,QAAS,SAASA,QAAQ9H,GACxBgG,EAASzK,KAAM+C,GAGf,IAFA,IACI8gB,EADAniB,EAAIrD,EAAIoG,EAA+B,EAAnBxE,UAAUC,OAAaD,UAAU,GAAK7D,GAAW,GAElEynB,EAAQA,EAAQA,EAAMpmB,EAAIuC,KAAKikB,IAGpC,IAFAviB,EAAEmiB,EAAMjV,EAAGiV,EAAM9L,EAAG/X,MAEb6jB,GAASA,EAAMM,GAAGN,EAAQA,EAAM5lB,GAK3CM,IAAK,SAASA,IAAIK,GAChB,QAASklB,EAASrZ,EAASzK,KAAM+C,GAAOnE,MAGxCuU,GAAa1R,EAAG5B,EAAE9B,UAAW,OAAQ,CACvCP,IAAK,WACH,OAAOiN,EAASzK,KAAM+C,GAAMihB,MAGzBnkB,GAEToT,IAAK,SAAU5P,EAAMzE,EAAKiD,GACxB,IACIwiB,EAAMzf,EADNif,EAAQC,EAASzgB,EAAMzE,GAoBzB,OAjBEilB,EACFA,EAAMjV,EAAI/M,GAGVwB,EAAK6gB,GAAKL,EAAQ,CAChBlnB,EAAGiI,EAAQmM,EAAQnS,GAAK,GACxBmZ,EAAGnZ,EACHgQ,EAAG/M,EACH5D,EAAGomB,EAAOhhB,EAAK6gB,GACfzmB,EAAGrB,GACH+nB,GAAG,GAEA9gB,EAAK4gB,KAAI5gB,EAAK4gB,GAAKJ,GACpBQ,IAAMA,EAAK5mB,EAAIomB,GACnBxgB,EAAK2gB,KAES,MAAVpf,IAAevB,EAAKwW,GAAGjV,GAASif,IAC7BxgB,GAEXygB,SAAUA,EACVnN,UAAW,SAAU9W,EAAGkD,EAAMkB,GAG5B8f,EAAYlkB,EAAGkD,EAAM,SAAU6W,EAAUrE,GACvCvV,KAAKqT,GAAK5I,EAASmP,EAAU7W,GAC7B/C,KAAK8Z,GAAKvE,EACVvV,KAAKkkB,GAAK9nB,IACT,WAKD,IAJA,IAAIiH,EAAOrD,KACPuV,EAAOlS,EAAKyW,GACZ+J,EAAQxgB,EAAK6gB,GAEVL,GAASA,EAAMM,GAAGN,EAAQA,EAAM5lB,EAEvC,OAAKoF,EAAKgQ,KAAQhQ,EAAK6gB,GAAKL,EAAQA,EAAQA,EAAMpmB,EAAI4F,EAAKgQ,GAAG4Q,IAMnC/Y,EAAK,EAApB,QAARqK,EAA+BsO,EAAM9L,EAC7B,UAARxC,EAAiCsO,EAAMjV,EAC5B,CAACiV,EAAM9L,EAAG8L,EAAMjV,KAN7BvL,EAAKgQ,GAAKjX,GACH8O,EAAK,KAMbjH,EAAS,UAAY,UAAWA,GAAQ,GAG3CwC,EAAW1D,MAOT,SAAUrG,EAAQD,EAASF,GAIjC,IAAIqnB,EAASrnB,EAAoB,KAC7BkO,EAAWlO,EAAoB,IAInCG,EAAOD,QAAUF,EAAoB,GAApBA,CAHP,MAGoC,SAAUiB,GACtD,OAAO,SAAS8mB,MAAQ,OAAO9mB,EAAIwC,KAAyB,EAAnBC,UAAUC,OAAaD,UAAU,GAAK7D,MAC9E,CAEDmoB,IAAK,SAASA,IAAI1iB,GAChB,OAAO+hB,EAAO3Q,IAAIxI,EAASzK,KARrB,OAQiC6B,EAAkB,IAAVA,EAAc,EAAIA,EAAOA,KAEzE+hB,IAKG,SAAUlnB,EAAQD,EAASF,GAIjC,IAaIioB,EAbArO,EAAO5Z,EAAoB,GAApBA,CAAwB,GAC/BoY,EAAWpY,EAAoB,IAC/BsU,EAAOtU,EAAoB,IAC3Bub,EAASvb,EAAoB,IAC7BkoB,EAAOloB,EAAoB,KAC3BiE,EAAWjE,EAAoB,GAC/B+F,EAAQ/F,EAAoB,GAC5BkO,EAAWlO,EAAoB,IAC/BmoB,EAAW,UACX1T,EAAUH,EAAKG,QACfR,EAAepT,OAAOoT,aACtBmU,EAAsBF,EAAKG,QAC3BC,EAAM,GAGN3W,EAAU,SAAU1Q,GACtB,OAAO,SAASsnB,UACd,OAAOtnB,EAAIwC,KAAyB,EAAnBC,UAAUC,OAAaD,UAAU,GAAK7D,MAIvDgZ,EAAU,CAEZ5X,IAAK,SAASA,IAAIoB,GAChB,GAAI4B,EAAS5B,GAAM,CACjB,IAAI+P,EAAOqC,EAAQpS,GACnB,OAAa,IAAT+P,EAAsBgW,EAAoBla,EAASzK,KAAM0kB,IAAWlnB,IAAIoB,GACrE+P,EAAOA,EAAK3O,KAAK6Z,IAAMzd,KAIlCiO,IAAK,SAASA,IAAIzL,EAAKiD,GACrB,OAAO4iB,EAAKxR,IAAIxI,EAASzK,KAAM0kB,GAAW9lB,EAAKiD,KAK/CkjB,EAAWroB,EAAOD,QAAUF,EAAoB,GAApBA,CAAwBmoB,EAAUxW,EAASkH,EAASqP,GAAM,GAAM,GAG5FniB,EAAM,WAAc,OAAyE,IAAlE,IAAIyiB,GAAW1a,KAAKjN,OAAO4nB,QAAU5nB,QAAQynB,GAAM,GAAGrnB,IAAIqnB,OAEvF/M,GADA0M,EAAcC,EAAK/N,eAAexI,EAASwW,IACxB3mB,UAAWqX,GAC9BvE,EAAKC,MAAO,EACZqF,EAAK,CAAC,SAAU,MAAO,MAAO,OAAQ,SAAUvX,GAC9C,IAAIkN,EAAQiZ,EAAShnB,UACjB4F,EAASmI,EAAMlN,GACnB+V,EAAS7I,EAAOlN,EAAK,SAAUkB,EAAGC,GAEhC,GAAIS,EAASV,KAAO0Q,EAAa1Q,GAAI,CAC9BE,KAAKikB,KAAIjkB,KAAKikB,GAAK,IAAIO,GAC5B,IAAI3f,EAAS7E,KAAKikB,GAAGrlB,GAAKkB,EAAGC,GAC7B,MAAc,OAAPnB,EAAeoB,KAAO6E,EAE7B,OAAOlB,EAAO9G,KAAKmD,KAAMF,EAAGC,SAQ9B,SAAUrD,EAAQD,EAASF,GAIjC,IAAIoJ,EAAcpJ,EAAoB,IAClCyU,EAAUzU,EAAoB,IAAIyU,QAClC1P,EAAW/E,EAAoB,GAC/BiE,EAAWjE,EAAoB,GAC/BkJ,EAAalJ,EAAoB,IACjC2Z,EAAQ3Z,EAAoB,IAC5B4J,EAAoB5J,EAAoB,IACxC0oB,EAAO1oB,EAAoB,IAC3BkO,EAAWlO,EAAoB,IAC/BsL,EAAY1B,EAAkB,GAC9B2B,EAAiB3B,EAAkB,GACnCoK,EAAK,EAGLoU,EAAsB,SAAUthB,GAClC,OAAOA,EAAK6gB,KAAO7gB,EAAK6gB,GAAK,IAAIgB,IAE/BA,EAAsB,WACxBllB,KAAKF,EAAI,IAEPqlB,EAAqB,SAAUnkB,EAAOpC,GACxC,OAAOiJ,EAAU7G,EAAMlB,EAAG,SAAUW,GAClC,OAAOA,EAAG,KAAO7B,KAGrBsmB,EAAoBnnB,UAAY,CAC9BP,IAAK,SAAUoB,GACb,IAAIilB,EAAQsB,EAAmBnlB,KAAMpB,GACrC,GAAIilB,EAAO,OAAOA,EAAM,IAE1BtlB,IAAK,SAAUK,GACb,QAASumB,EAAmBnlB,KAAMpB,IAEpCyL,IAAK,SAAUzL,EAAKiD,GAClB,IAAIgiB,EAAQsB,EAAmBnlB,KAAMpB,GACjCilB,EAAOA,EAAM,GAAKhiB,EACjB7B,KAAKF,EAAEgF,KAAK,CAAClG,EAAKiD,KAEzBuiB,SAAU,SAAUxlB,GAClB,IAAIgG,EAAQkD,EAAe9H,KAAKF,EAAG,SAAUW,GAC3C,OAAOA,EAAG,KAAO7B,IAGnB,OADKgG,GAAO5E,KAAKF,EAAEslB,OAAOxgB,EAAO,MACvBA,IAIdlI,EAAOD,QAAU,CACfia,eAAgB,SAAUxI,EAASnL,EAAMkB,EAAQqS,GAC/C,IAAIzW,EAAIqO,EAAQ,SAAU7K,EAAMgP,GAC9B5M,EAAWpC,EAAMxD,EAAGkD,EAAM,MAC1BM,EAAKgQ,GAAKtQ,EACVM,EAAKwW,GAAKtJ,IAEN8B,IADJhP,EAAK6gB,GAAK9nB,KACiB8Z,EAAM7D,EAAUpO,EAAQZ,EAAKiT,GAAQjT,KAoBlE,OAlBAsC,EAAY9F,EAAE9B,UAAW,CAGvBqmB,SAAU,SAAUxlB,GAClB,IAAK4B,EAAS5B,GAAM,OAAO,EAC3B,IAAI+P,EAAOqC,EAAQpS,GACnB,OAAa,IAAT+P,EAAsBgW,EAAoBla,EAASzK,KAAM+C,IAAe,UAAEnE,GACvE+P,GAAQsW,EAAKtW,EAAM3O,KAAK6Z,YAAclL,EAAK3O,KAAK6Z,KAIzDtb,IAAK,SAASA,IAAIK,GAChB,IAAK4B,EAAS5B,GAAM,OAAO,EAC3B,IAAI+P,EAAOqC,EAAQpS,GACnB,OAAa,IAAT+P,EAAsBgW,EAAoBla,EAASzK,KAAM+C,IAAOxE,IAAIK,GACjE+P,GAAQsW,EAAKtW,EAAM3O,KAAK6Z,OAG5Bha,GAEToT,IAAK,SAAU5P,EAAMzE,EAAKiD,GACxB,IAAI8M,EAAOqC,EAAQ1P,EAAS1C,IAAM,GAGlC,OAFa,IAAT+P,EAAegW,EAAoBthB,GAAMgH,IAAIzL,EAAKiD,GACjD8M,EAAKtL,EAAKwW,IAAMhY,EACdwB,GAETuhB,QAASD,IAML,SAAUjoB,EAAQD,EAASF,GAKjC,IAAI+F,EAAQ/F,EAAoB,GAC5B8oB,EAAUC,KAAKvnB,UAAUsnB,QACzBE,EAAeD,KAAKvnB,UAAUynB,YAE9BC,EAAK,SAAUC,GACjB,OAAa,EAANA,EAAUA,EAAM,IAAMA,GAI/BhpB,EAAOD,QAAW6F,EAAM,WACtB,MAAiD,4BAA1CijB,EAAa1oB,KAAK,IAAIyoB,MAAM,KAAO,QACrChjB,EAAM,WACXijB,EAAa1oB,KAAK,IAAIyoB,KAAKrG,QACvB,SAASuG,cACb,IAAKpD,SAASiD,EAAQxoB,KAAKmD,OAAQ,MAAM8G,WAAW,sBACpD,IAAI9J,EAAIgD,KACJ2lB,EAAI3oB,EAAE4oB,iBACN9oB,EAAIE,EAAE6oB,qBACN3nB,EAAIynB,EAAI,EAAI,IAAU,KAAJA,EAAW,IAAM,GACvC,OAAOznB,GAAK,QAAU0C,KAAKmd,IAAI4H,IAAI3gB,MAAM9G,GAAK,GAAK,GACjD,IAAMunB,EAAGzoB,EAAE8oB,cAAgB,GAAK,IAAML,EAAGzoB,EAAE+oB,cAC3C,IAAMN,EAAGzoB,EAAEgpB,eAAiB,IAAMP,EAAGzoB,EAAEipB,iBACvC,IAAMR,EAAGzoB,EAAEkpB,iBAAmB,KAAW,GAAJppB,EAASA,EAAI,IAAM2oB,EAAG3oB,IAAM,KACjEyoB,GAKE,SAAU7oB,EAAQD,EAASF,GAGjC,IAAI6E,EAAY7E,EAAoB,IAChCsH,EAAWtH,EAAoB,GACnCG,EAAOD,QAAU,SAAUgE,GACzB,GAAIA,IAAOrE,GAAW,OAAO,EAC7B,IAAI+pB,EAAS/kB,EAAUX,GACnBP,EAAS2D,EAASsiB,GACtB,GAAIA,IAAWjmB,EAAQ,MAAM4G,WAAW,iBACxC,OAAO5G,IAMH,SAAUxD,EAAQD,EAASF,GAKjC,IAAImY,EAAUnY,EAAoB,IAC9BiE,EAAWjE,EAAoB,GAC/BsH,EAAWtH,EAAoB,GAC/B8B,EAAM9B,EAAoB,IAC1B6pB,EAAuB7pB,EAAoB,EAApBA,CAAuB,sBAgClDG,EAAOD,QA9BP,SAAS4pB,iBAAiBzmB,EAAQ6Z,EAAU9a,EAAQ2nB,EAAWta,EAAOua,EAAOC,EAAQC,GAMnF,IALA,IAGIC,EAASC,EAHTC,EAAc5a,EACd6a,EAAc,EACd1P,IAAQqP,GAASnoB,EAAImoB,EAAQC,EAAS,GAGnCI,EAAcP,GAAW,CAC9B,GAAIO,KAAeloB,EAAQ,CASzB,GARA+nB,EAAUvP,EAAQA,EAAMxY,EAAOkoB,GAAcA,EAAapN,GAAY9a,EAAOkoB,GAE7EF,GAAa,EACTnmB,EAASkmB,KAEXC,GADAA,EAAaD,EAAQN,MACOhqB,KAAcuqB,EAAajS,EAAQgS,IAG7DC,GAAsB,EAARJ,EAChBK,EAAcP,iBAAiBzmB,EAAQ6Z,EAAUiN,EAAS7iB,EAAS6iB,EAAQxmB,QAAS0mB,EAAaL,EAAQ,GAAK,MACzG,CACL,GAAmB,kBAAfK,EAAiC,MAAMlmB,YAC3Cd,EAAOgnB,GAAeF,EAGxBE,IAEFC,IAEF,OAAOD,IAQH,SAAUlqB,EAAQD,EAASF,GAGjC,IAAIsH,EAAWtH,EAAoB,GAC/B8b,EAAS9b,EAAoB,IAC7BuF,EAAUvF,EAAoB,IAElCG,EAAOD,QAAU,SAAU4G,EAAMyjB,EAAWC,EAAYC,GACtD,IAAI5nB,EAAIwD,OAAOd,EAAQuB,IACnB4jB,EAAe7nB,EAAEc,OACjBgnB,EAAUH,IAAe3qB,GAAY,IAAMwG,OAAOmkB,GAClDI,EAAetjB,EAASijB,GAC5B,GAAIK,GAAgBF,GAA2B,IAAXC,EAAe,OAAO9nB,EAC1D,IAAIgoB,EAAUD,EAAeF,EACzBI,EAAehP,EAAOxb,KAAKqqB,EAAStmB,KAAKqE,KAAKmiB,EAAUF,EAAQhnB,SAEpE,OAD0BknB,EAAtBC,EAAannB,SAAkBmnB,EAAeA,EAAariB,MAAM,EAAGoiB,IACjEJ,EAAOK,EAAejoB,EAAIA,EAAIioB,IAMjC,SAAU3qB,EAAQD,EAASF,GAEjC,IAAIob,EAAUpb,EAAoB,IAC9BiH,EAAYjH,EAAoB,IAChC0b,EAAS1b,EAAoB,IAAImF,EACrChF,EAAOD,QAAU,SAAU6qB,GACzB,OAAO,SAAU7mB,GAOf,IANA,IAKI7B,EALA+C,EAAI6B,EAAU/C,GACd2H,EAAOuP,EAAQhW,GACfzB,EAASkI,EAAKlI,OACdvD,EAAI,EACJkI,EAAS,GAEGlI,EAATuD,GAAgB+X,EAAOpb,KAAK8E,EAAG/C,EAAMwJ,EAAKzL,OAC/CkI,EAAOC,KAAKwiB,EAAY,CAAC1oB,EAAK+C,EAAE/C,IAAQ+C,EAAE/C,IAC1C,OAAOiG,KAOP,SAAUnI,EAAQD,EAASF,GAGjC,IAAIuJ,EAAUvJ,EAAoB,IAC9B0O,EAAO1O,EAAoB,KAC/BG,EAAOD,QAAU,SAAUsG,GACzB,OAAO,SAASwkB,SACd,GAAIzhB,EAAQ9F,OAAS+C,EAAM,MAAMrC,UAAUqC,EAAO,yBAClD,OAAOkI,EAAKjL,SAOV,SAAUtD,EAAQD,EAASF,GAEjC,IAAI2Z,EAAQ3Z,EAAoB,IAEhCG,EAAOD,QAAU,SAAU2S,EAAM/F,GAC/B,IAAIxE,EAAS,GAEb,OADAqR,EAAM9G,GAAM,EAAOvK,EAAOC,KAAMD,EAAQwE,GACjCxE,IAMH,SAAUnI,EAAQD,GAGxBC,EAAOD,QAAUmE,KAAK4mB,OAAS,SAASA,MAAM9O,EAAG+O,EAAOC,EAAQC,EAAQC,GACtE,OACuB,IAArB3nB,UAAUC,QAELwY,GAAKA,GAEL+O,GAASA,GAETC,GAAUA,GAEVC,GAAUA,GAEVC,GAAWA,EACT3I,IACLvG,IAAMF,UAAYE,KAAOF,SAAiBE,GACtCA,EAAI+O,IAAUG,EAAUD,IAAWD,EAASD,GAASE,IAMzD,SAAUjrB,EAAQD,EAASF,GAEjC,IAAIuJ,EAAUvJ,EAAoB,IAC9B8M,EAAW9M,EAAoB,EAApBA,CAAuB,YAClCgK,EAAYhK,EAAoB,IACpCG,EAAOD,QAAUF,EAAoB,IAAIsrB,WAAa,SAAUpnB,GAC9D,IAAIkB,EAAIvE,OAAOqD,GACf,OAAOkB,EAAE0H,KAAcjN,IAClB,eAAgBuF,GAEhB4E,EAAUvI,eAAe8H,EAAQnE,MAMlC,SAAUjF,EAAQD,EAASF,GAIjC,IAAIurB,EAAOvrB,EAAoB,KAC3B4d,EAAS5d,EAAoB,IAC7B4G,EAAY5G,EAAoB,IACpCG,EAAOD,QAAU,WAOf,IANA,IAAI2G,EAAKD,EAAUnD,MACfE,EAASD,UAAUC,OACnB6nB,EAAQ,IAAI3gB,MAAMlH,GAClBvD,EAAI,EACJuT,EAAI4X,EAAK5X,EACT8X,GAAS,EACGrrB,EAATuD,IAAiB6nB,EAAMprB,GAAKsD,UAAUtD,QAAUuT,IAAG8X,GAAS,GACnE,OAAO,WACL,IAII7P,EAHA/M,EAAOnL,UAAUC,OACjBgY,EAAI,EACJH,EAAI,EAER,IAAKiQ,IAAW5c,EAAM,OAAO+O,EAAO/W,EAAI2kB,EAL7B/nB,MAOX,GADAmY,EAAO4P,EAAM/iB,QACTgjB,EAAQ,KAAe9P,EAAThY,EAAYgY,IAASC,EAAKD,KAAOhI,IAAGiI,EAAKD,GAAKjY,UAAU8X,MAC1E,KAAcA,EAAP3M,GAAU+M,EAAKrT,KAAK7E,UAAU8X,MACrC,OAAOoC,EAAO/W,EAAI+U,EATPnY,SAgBT,SAAUtD,EAAQD,EAASF,GAEjCG,EAAOD,QAAUF,EAAoB,KAK/B,SAAUG,EAAQD,EAASF,GAEjC,IAAIkF,EAAKlF,EAAoB,GACzBkH,EAAOlH,EAAoB,IAC3BohB,EAAUphB,EAAoB,IAC9BiH,EAAYjH,EAAoB,IAEpCG,EAAOD,QAAU,SAASwrB,OAAOroB,EAAQsoB,GAKvC,IAJA,IAGItpB,EAHAwJ,EAAOuV,EAAQna,EAAU0kB,IACzBhoB,EAASkI,EAAKlI,OACdvD,EAAI,EAEQA,EAATuD,GAAYuB,EAAGC,EAAE9B,EAAQhB,EAAMwJ,EAAKzL,KAAM8G,EAAK/B,EAAEwmB,EAAOtpB,IAC/D,OAAOgB,IAMH,SAAUlD,EAAQD,EAASF,GAEjCA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,IACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,IACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,KACpBG,EAAOD,QAAUF,EAAoB,MAK/B,SAAUG,EAAQD,EAASF,GAKjC,IAAI4B,EAAS5B,EAAoB,GAC7BgC,EAAMhC,EAAoB,IAC1B4W,EAAc5W,EAAoB,GAClCkC,EAAUlC,EAAoB,GAC9BoY,EAAWpY,EAAoB,IAC/B8T,EAAO9T,EAAoB,IAAI6I,IAC/B+iB,EAAS5rB,EAAoB,GAC7BmT,EAASnT,EAAoB,IAC7BsY,EAAiBtY,EAAoB,IACrC0E,EAAM1E,EAAoB,IAC1B2J,EAAM3J,EAAoB,GAC1Bgb,EAAShb,EAAoB,IAC7B6rB,EAAY7rB,EAAoB,IAChC8rB,EAAW9rB,EAAoB,KAC/BmY,EAAUnY,EAAoB,IAC9B+E,EAAW/E,EAAoB,GAC/BiE,EAAWjE,EAAoB,GAC/BiH,EAAYjH,EAAoB,IAChCiF,EAAcjF,EAAoB,IAClC+G,EAAa/G,EAAoB,IACjC+rB,EAAU/rB,EAAoB,IAC9BgsB,EAAUhsB,EAAoB,IAC9BsK,EAAQtK,EAAoB,IAC5BqK,EAAMrK,EAAoB,GAC1B2U,EAAQ3U,EAAoB,IAC5BkH,EAAOoD,EAAMnF,EACbD,EAAKmF,EAAIlF,EACTsE,EAAOuiB,EAAQ7mB,EACf8V,EAAUrZ,EAAO+C,OACjBsnB,EAAQrqB,EAAOsqB,KACfC,EAAaF,GAASA,EAAMG,UAC5BnqB,EAAY,YACZoqB,EAAS1iB,EAAI,WACb2iB,EAAe3iB,EAAI,eACnB+R,EAAS,GAAG3E,qBACZwV,EAAiBpZ,EAAO,mBACxBqZ,EAAarZ,EAAO,WACpBsZ,EAAYtZ,EAAO,cACnBvN,EAAc/E,OAAOoB,GACrByqB,EAA+B,mBAAXzR,EACpB0R,EAAU/qB,EAAO+qB,QAEjBC,GAAUD,IAAYA,EAAQ1qB,KAAe0qB,EAAQ1qB,GAAW4qB,UAGhEC,EAAgBlW,GAAegV,EAAO,WACxC,OAES,GAFFG,EAAQ7mB,EAAG,GAAI,IAAK,CACzBjE,IAAK,WAAc,OAAOiE,EAAGzB,KAAM,IAAK,CAAE6B,MAAO,IAAK/B,MACpDA,IACD,SAAUW,EAAI7B,EAAKmX,GACtB,IAAIuT,EAAY7lB,EAAKtB,EAAavD,GAC9B0qB,UAAkBnnB,EAAYvD,GAClC6C,EAAGhB,EAAI7B,EAAKmX,GACRuT,GAAa7oB,IAAO0B,GAAaV,EAAGU,EAAavD,EAAK0qB,IACxD7nB,EAEA8nB,EAAO,SAAU7mB,GACnB,IAAI8mB,EAAMT,EAAWrmB,GAAO4lB,EAAQ9Q,EAAQhZ,IAE5C,OADAgrB,EAAI1P,GAAKpX,EACF8mB,GAGLC,EAAWR,GAAyC,iBAApBzR,EAAQrM,SAAuB,SAAU1K,GAC3E,MAAoB,iBAANA,GACZ,SAAUA,GACZ,OAAOA,aAAc+W,GAGnB4B,EAAkB,SAAS/b,eAAeoD,EAAI7B,EAAKmX,GAKrD,OAJItV,IAAO0B,GAAaiX,EAAgB4P,EAAWpqB,EAAKmX,GACxDzU,EAASb,GACT7B,EAAM4C,EAAY5C,GAAK,GACvB0C,EAASyU,GACLxX,EAAIwqB,EAAYnqB,IACbmX,EAAExY,YAIDgB,EAAIkC,EAAImoB,IAAWnoB,EAAGmoB,GAAQhqB,KAAM6B,EAAGmoB,GAAQhqB,IAAO,GAC1DmX,EAAIuS,EAAQvS,EAAG,CAAExY,WAAY+F,EAAW,GAAG,OAJtC/E,EAAIkC,EAAImoB,IAASnnB,EAAGhB,EAAImoB,EAAQtlB,EAAW,EAAG,KACnD7C,EAAGmoB,GAAQhqB,IAAO,GAIXyqB,EAAc5oB,EAAI7B,EAAKmX,IACzBtU,EAAGhB,EAAI7B,EAAKmX,IAEnB2T,EAAoB,SAASpI,iBAAiB7gB,EAAInB,GACpDgC,EAASb,GAKT,IAJA,IAGI7B,EAHAwJ,EAAOigB,EAAS/oB,EAAIkE,EAAUlE,IAC9B3C,EAAI,EACJC,EAAIwL,EAAKlI,OAEFvD,EAAJC,GAAOwc,EAAgB3Y,EAAI7B,EAAMwJ,EAAKzL,KAAM2C,EAAEV,IACrD,OAAO6B,GAKLkpB,EAAwB,SAASrW,qBAAqB1U,GACxD,IAAIgrB,EAAI3R,EAAOpb,KAAKmD,KAAMpB,EAAM4C,EAAY5C,GAAK,IACjD,QAAIoB,OAASmC,GAAe5D,EAAIwqB,EAAYnqB,KAASL,EAAIyqB,EAAWpqB,QAC7DgrB,IAAMrrB,EAAIyB,KAAMpB,KAASL,EAAIwqB,EAAYnqB,IAAQL,EAAIyB,KAAM4oB,IAAW5oB,KAAK4oB,GAAQhqB,KAAOgrB,IAE/FC,EAA4B,SAASnmB,yBAAyBjD,EAAI7B,GAGpE,GAFA6B,EAAK+C,EAAU/C,GACf7B,EAAM4C,EAAY5C,GAAK,GACnB6B,IAAO0B,IAAe5D,EAAIwqB,EAAYnqB,IAASL,EAAIyqB,EAAWpqB,GAAlE,CACA,IAAImX,EAAItS,EAAKhD,EAAI7B,GAEjB,OADImX,IAAKxX,EAAIwqB,EAAYnqB,IAAUL,EAAIkC,EAAImoB,IAAWnoB,EAAGmoB,GAAQhqB,KAAOmX,EAAExY,YAAa,GAChFwY,IAEL+T,EAAuB,SAAStW,oBAAoB/S,GAKtD,IAJA,IAGI7B,EAHAyiB,EAAQrb,EAAKxC,EAAU/C,IACvBoE,EAAS,GACTlI,EAAI,EAEcA,EAAf0kB,EAAMnhB,QACN3B,EAAIwqB,EAAYnqB,EAAMyiB,EAAM1kB,OAASiC,GAAOgqB,GAAUhqB,GAAOyR,GAAMxL,EAAOC,KAAKlG,GACpF,OAAOiG,GAEPklB,EAAyB,SAAStV,sBAAsBhU,GAM1D,IALA,IAII7B,EAJAorB,EAAQvpB,IAAO0B,EACfkf,EAAQrb,EAAKgkB,EAAQhB,EAAYxlB,EAAU/C,IAC3CoE,EAAS,GACTlI,EAAI,EAEcA,EAAf0kB,EAAMnhB,SACP3B,EAAIwqB,EAAYnqB,EAAMyiB,EAAM1kB,OAAUqtB,IAAQzrB,EAAI4D,EAAavD,IAAciG,EAAOC,KAAKikB,EAAWnqB,IACxG,OAAOiG,GAINokB,IAYHtU,GAXA6C,EAAU,SAAStW,SACjB,GAAIlB,gBAAgBwX,EAAS,MAAM9W,UAAU,gCAC7C,IAAIgC,EAAMzB,EAAuB,EAAnBhB,UAAUC,OAAaD,UAAU,GAAK7D,IAChDmR,EAAO,SAAU1L,GACf7B,OAASmC,GAAaoL,EAAK1Q,KAAKmsB,EAAWnnB,GAC3CtD,EAAIyB,KAAM4oB,IAAWrqB,EAAIyB,KAAK4oB,GAASlmB,KAAM1C,KAAK4oB,GAAQlmB,IAAO,GACrE2mB,EAAcrpB,KAAM0C,EAAKY,EAAW,EAAGzB,KAGzC,OADIsR,GAAegW,GAAQE,EAAclnB,EAAaO,EAAK,CAAEpF,cAAc,EAAM+M,IAAKkD,IAC/Egc,EAAK7mB,KAEGlE,GAAY,WAAY,SAASuG,WAChD,OAAO/E,KAAK8Z,KAGdjT,EAAMnF,EAAImoB,EACVjjB,EAAIlF,EAAI0X,EACR7c,EAAoB,IAAImF,EAAI6mB,EAAQ7mB,EAAIooB,EACxCvtB,EAAoB,IAAImF,EAAIioB,EAC5BptB,EAAoB,IAAImF,EAAIqoB,EAExB5W,IAAgB5W,EAAoB,KACtCoY,EAASxS,EAAa,uBAAwBwnB,GAAuB,GAGvEpS,EAAO7V,EAAI,SAAUzE,GACnB,OAAOssB,EAAKrjB,EAAIjJ,MAIpBwB,EAAQA,EAAQS,EAAIT,EAAQiB,EAAIjB,EAAQO,GAAKiqB,EAAY,CAAE/nB,OAAQsW,IAEnE,IAAK,IAAIyS,GAAa,iHAGpB/mB,MAAM,KAAMgV,GAAI,EAAuBA,GAApB+R,GAAW/pB,QAAYgG,EAAI+jB,GAAW/R,OAE3D,IAAK,IAAIgS,GAAmBhZ,EAAMhL,EAAIlF,OAAQ+W,GAAI,EAA6BA,GAA1BmS,GAAiBhqB,QAAakoB,EAAU8B,GAAiBnS,OAE9GtZ,EAAQA,EAAQW,EAAIX,EAAQO,GAAKiqB,EAAY,SAAU,CAErDkB,MAAO,SAAUvrB,GACf,OAAOL,EAAIuqB,EAAgBlqB,GAAO,IAC9BkqB,EAAelqB,GACfkqB,EAAelqB,GAAO4Y,EAAQ5Y,IAGpCwrB,OAAQ,SAASA,OAAOZ,GACtB,IAAKC,EAASD,GAAM,MAAM9oB,UAAU8oB,EAAM,qBAC1C,IAAK,IAAI5qB,KAAOkqB,EAAgB,GAAIA,EAAelqB,KAAS4qB,EAAK,OAAO5qB,GAE1EyrB,UAAW,WAAclB,GAAS,GAClCmB,UAAW,WAAcnB,GAAS,KAGpC1qB,EAAQA,EAAQW,EAAIX,EAAQO,GAAKiqB,EAAY,SAAU,CAErD1kB,OA/FY,SAASA,OAAO9D,EAAInB,GAChC,OAAOA,IAAMlD,GAAYksB,EAAQ7nB,GAAMipB,EAAkBpB,EAAQ7nB,GAAKnB,IAgGtEjC,eAAgB+b,EAEhBkI,iBAAkBoI,EAElBhmB,yBAA0BmmB,EAE1BrW,oBAAqBsW,EAErBrV,sBAAuBsV,IAIzBvB,GAAS/pB,EAAQA,EAAQW,EAAIX,EAAQO,IAAMiqB,GAAcd,EAAO,WAC9D,IAAI/oB,EAAIoY,IAIR,MAA0B,UAAnBkR,EAAW,CAACtpB,KAA2C,MAAxBspB,EAAW,CAAE5oB,EAAGV,KAAyC,MAAzBspB,EAAWtrB,OAAOgC,OACrF,OAAQ,CACXupB,UAAW,SAASA,UAAUloB,GAI5B,IAHA,IAEI0gB,EAAUoJ,EAFVpS,EAAO,CAAC1X,GACR9D,EAAI,EAEkBA,EAAnBsD,UAAUC,QAAYiY,EAAKrT,KAAK7E,UAAUtD,MAEjD,GADA4tB,EAAYpJ,EAAWhJ,EAAK,IACvB3X,EAAS2gB,IAAa1gB,IAAOrE,MAAaqtB,EAAShpB,GAMxD,OALKiU,EAAQyM,KAAWA,EAAW,SAAUviB,EAAKiD,GAEhD,GADwB,mBAAb0oB,IAAyB1oB,EAAQ0oB,EAAU1tB,KAAKmD,KAAMpB,EAAKiD,KACjE4nB,EAAS5nB,GAAQ,OAAOA,IAE/BsW,EAAK,GAAKgJ,EACHuH,EAAWvoB,MAAMqoB,EAAOrQ,MAKnCX,EAAQhZ,GAAWqqB,IAAiBtsB,EAAoB,GAApBA,CAAwBib,EAAQhZ,GAAYqqB,EAAcrR,EAAQhZ,GAAW2R,SAEjH0E,EAAe2C,EAAS,UAExB3C,EAAejU,KAAM,QAAQ,GAE7BiU,EAAe1W,EAAOsqB,KAAM,QAAQ,IAK9B,SAAU/rB,EAAQD,EAASF,GAGjC,IAAIob,EAAUpb,EAAoB,IAC9Bqb,EAAOrb,EAAoB,IAC3BgH,EAAMhH,EAAoB,IAC9BG,EAAOD,QAAU,SAAUgE,GACzB,IAAIoE,EAAS8S,EAAQlX,GACjBuX,EAAaJ,EAAKlW,EACtB,GAAIsW,EAKF,IAJA,IAGIpZ,EAHA4rB,EAAUxS,EAAWvX,GACrBwX,EAAS1U,EAAI7B,EACb/E,EAAI,EAEgBA,EAAjB6tB,EAAQtqB,QAAgB+X,EAAOpb,KAAK4D,EAAI7B,EAAM4rB,EAAQ7tB,OAAOkI,EAAOC,KAAKlG,GAChF,OAAOiG,IAML,SAAUnI,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAIX,EAAQO,GAAKzC,EAAoB,GAAI,SAAU,CAAEc,eAAgBd,EAAoB,GAAGmF,KAKtG,SAAUhF,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAIX,EAAQO,GAAKzC,EAAoB,GAAI,SAAU,CAAE+kB,iBAAkB/kB,EAAoB,OAKrG,SAAUG,EAAQD,EAASF,GAGjC,IAAIiH,EAAYjH,EAAoB,IAChCstB,EAA4BttB,EAAoB,IAAImF,EAExDnF,EAAoB,GAApBA,CAAwB,2BAA4B,WAClD,OAAO,SAASmH,yBAAyBjD,EAAI7B,GAC3C,OAAOirB,EAA0BrmB,EAAU/C,GAAK7B,OAO9C,SAAUlC,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,SAAU,CAAEmF,OAAQhI,EAAoB,OAKrD,SAAUG,EAAQD,EAASF,GAGjC,IAAI0F,EAAW1F,EAAoB,GAC/BkuB,EAAkBluB,EAAoB,IAE1CA,EAAoB,GAApBA,CAAwB,iBAAkB,WACxC,OAAO,SAAS6F,eAAe3B,GAC7B,OAAOgqB,EAAgBxoB,EAASxB,QAO9B,SAAU/D,EAAQD,EAASF,GAGjC,IAAI0F,EAAW1F,EAAoB,GAC/B2U,EAAQ3U,EAAoB,IAEhCA,EAAoB,GAApBA,CAAwB,OAAQ,WAC9B,OAAO,SAAS6L,KAAK3H,GACnB,OAAOyQ,EAAMjP,EAASxB,QAOpB,SAAU/D,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,sBAAuB,WAC7C,OAAOA,EAAoB,IAAImF,KAM3B,SAAUhF,EAAQD,EAASF,GAGjC,IAAIiE,EAAWjE,EAAoB,GAC/BsU,EAAOtU,EAAoB,IAAI0U,SAEnC1U,EAAoB,GAApBA,CAAwB,SAAU,SAAUmuB,GAC1C,OAAO,SAAS1F,OAAOvkB,GACrB,OAAOiqB,GAAWlqB,EAASC,GAAMiqB,EAAQ7Z,EAAKpQ,IAAOA,MAOnD,SAAU/D,EAAQD,EAASF,GAGjC,IAAIiE,EAAWjE,EAAoB,GAC/BsU,EAAOtU,EAAoB,IAAI0U,SAEnC1U,EAAoB,GAApBA,CAAwB,OAAQ,SAAUouB,GACxC,OAAO,SAASC,KAAKnqB,GACnB,OAAOkqB,GAASnqB,EAASC,GAAMkqB,EAAM9Z,EAAKpQ,IAAOA,MAO/C,SAAU/D,EAAQD,EAASF,GAGjC,IAAIiE,EAAWjE,EAAoB,GAC/BsU,EAAOtU,EAAoB,IAAI0U,SAEnC1U,EAAoB,GAApBA,CAAwB,oBAAqB,SAAUsuB,GACrD,OAAO,SAASna,kBAAkBjQ,GAChC,OAAOoqB,GAAsBrqB,EAASC,GAAMoqB,EAAmBha,EAAKpQ,IAAOA,MAOzE,SAAU/D,EAAQD,EAASF,GAGjC,IAAIiE,EAAWjE,EAAoB,GAEnCA,EAAoB,GAApBA,CAAwB,WAAY,SAAUuuB,GAC5C,OAAO,SAASC,SAAStqB,GACvB,OAAOD,EAASC,MAAMqqB,GAAYA,EAAUrqB,OAO1C,SAAU/D,EAAQD,EAASF,GAGjC,IAAIiE,EAAWjE,EAAoB,GAEnCA,EAAoB,GAApBA,CAAwB,WAAY,SAAUyuB,GAC5C,OAAO,SAASC,SAASxqB,GACvB,OAAOD,EAASC,MAAMuqB,GAAYA,EAAUvqB,OAO1C,SAAU/D,EAAQD,EAASF,GAGjC,IAAIiE,EAAWjE,EAAoB,GAEnCA,EAAoB,GAApBA,CAAwB,eAAgB,SAAU2uB,GAChD,OAAO,SAAS1a,aAAa/P,GAC3B,QAAOD,EAASC,MAAMyqB,GAAgBA,EAAczqB,QAOlD,SAAU/D,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAIX,EAAQO,EAAG,SAAU,CAAE8Y,OAAQvb,EAAoB,OAKjE,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAClCkC,EAAQA,EAAQW,EAAG,SAAU,CAAEiY,GAAI9a,EAAoB,QAKjD,SAAUG,EAAQD,GAGxBC,EAAOD,QAAUW,OAAOia,IAAM,SAASA,GAAGqB,EAAGiN,GAE3C,OAAOjN,IAAMiN,EAAU,IAANjN,GAAW,EAAIA,GAAM,EAAIiN,EAAIjN,GAAKA,GAAKiN,GAAKA,IAMzD,SAAUjpB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAClCkC,EAAQA,EAAQW,EAAG,SAAU,CAAEsiB,eAAgBnlB,EAAoB,IAAI8N,OAKjE,SAAU3N,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQa,EAAG,WAAY,CAAEwiB,KAAMvlB,EAAoB,OAKrD,SAAUG,EAAQD,EAASF,GAIjC,IAAIiE,EAAWjE,EAAoB,GAC/B6F,EAAiB7F,EAAoB,IACrC4uB,EAAe5uB,EAAoB,EAApBA,CAAuB,eACtC6uB,EAAgBhrB,SAASrC,UAEvBotB,KAAgBC,GAAgB7uB,EAAoB,GAAGmF,EAAE0pB,EAAeD,EAAc,CAAEtpB,MAAO,SAAUF,GAC7G,GAAmB,mBAAR3B,OAAuBQ,EAASmB,GAAI,OAAO,EACtD,IAAKnB,EAASR,KAAKjC,WAAY,OAAO4D,aAAa3B,KAEnD,KAAO2B,EAAIS,EAAeT,IAAI,GAAI3B,KAAKjC,YAAc4D,EAAG,OAAO,EAC/D,OAAO,MAMH,SAAUjF,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B6E,EAAY7E,EAAoB,IAChC8uB,EAAe9uB,EAAoB,IACnC8b,EAAS9b,EAAoB,IAC7B+uB,EAAW,GAAIC,QACfrmB,EAAQtE,KAAKsE,MACbyJ,EAAO,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,GACvB6c,EAAQ,wCAGRC,EAAW,SAAUhuB,EAAGV,GAG1B,IAFA,IAAIJ,GAAK,EACL+uB,EAAK3uB,IACAJ,EAAI,GAEXgS,EAAKhS,IADL+uB,GAAMjuB,EAAIkR,EAAKhS,IACA,IACf+uB,EAAKxmB,EAAMwmB,EAAK,MAGhBC,EAAS,SAAUluB,GAGrB,IAFA,IAAId,EAAI,EACJI,EAAI,EACM,KAALJ,GAEPgS,EAAKhS,GAAKuI,GADVnI,GAAK4R,EAAKhS,IACUc,GACpBV,EAAKA,EAAIU,EAAK,KAGdmuB,EAAc,WAGhB,IAFA,IAAIjvB,EAAI,EACJuB,EAAI,GACM,KAALvB,GACP,GAAU,KAANuB,GAAkB,IAANvB,GAAuB,IAAZgS,EAAKhS,GAAU,CACxC,IAAIkvB,EAAIjpB,OAAO+L,EAAKhS,IACpBuB,EAAU,KAANA,EAAW2tB,EAAI3tB,EAAIma,EAAOxb,KA1BzB,IA0BoC,EAAIgvB,EAAE3rB,QAAU2rB,EAE3D,OAAO3tB,GAEP8f,EAAM,SAAUtF,EAAGjb,EAAGquB,GACxB,OAAa,IAANruB,EAAUquB,EAAMruB,EAAI,GAAM,EAAIugB,EAAItF,EAAGjb,EAAI,EAAGquB,EAAMpT,GAAKsF,EAAItF,EAAIA,EAAGjb,EAAI,EAAGquB,IAelFrtB,EAAQA,EAAQa,EAAIb,EAAQO,KAAOssB,IACV,UAAvB,KAAQC,QAAQ,IACG,MAAnB,GAAIA,QAAQ,IACS,SAArB,MAAMA,QAAQ,IACuB,yBAArC,mBAAsBA,QAAQ,MAC1BhvB,EAAoB,EAApBA,CAAuB,WAE3B+uB,EAASzuB,KAAK,OACX,SAAU,CACb0uB,QAAS,SAASA,QAAQQ,GACxB,IAIIhrB,EAAGirB,EAAG9T,EAAGH,EAJTW,EAAI2S,EAAarrB,KAAMwrB,GACvB9pB,EAAIN,EAAU2qB,GACd7tB,EAAI,GACJpB,EA3DG,IA6DP,GAAI4E,EAAI,GAAS,GAAJA,EAAQ,MAAMoF,WAAW0kB,GAEtC,GAAI9S,GAAKA,EAAG,MAAO,MACnB,GAAIA,IAAM,MAAa,MAALA,EAAW,OAAO9V,OAAO8V,GAK3C,GAJIA,EAAI,IACNxa,EAAI,IACJwa,GAAKA,GAEC,MAAJA,EAKF,GAHAsT,GADAjrB,EArCI,SAAU2X,GAGlB,IAFA,IAAIjb,EAAI,EACJwuB,EAAKvT,EACI,MAANuT,GACLxuB,GAAK,GACLwuB,GAAM,KAER,KAAa,GAANA,GACLxuB,GAAK,EACLwuB,GAAM,EACN,OAAOxuB,EA2BDwgB,CAAIvF,EAAIsF,EAAI,EAAG,GAAI,IAAM,IACrB,EAAItF,EAAIsF,EAAI,GAAIjd,EAAG,GAAK2X,EAAIsF,EAAI,EAAGjd,EAAG,GAC9CirB,GAAK,iBAEG,GADRjrB,EAAI,GAAKA,GACE,CAGT,IAFA0qB,EAAS,EAAGO,GACZ9T,EAAIxW,EACQ,GAALwW,GACLuT,EAAS,IAAK,GACdvT,GAAK,EAIP,IAFAuT,EAASzN,EAAI,GAAI9F,EAAG,GAAI,GACxBA,EAAInX,EAAI,EACI,IAALmX,GACLyT,EAAO,GAAK,IACZzT,GAAK,GAEPyT,EAAO,GAAKzT,GACZuT,EAAS,EAAG,GACZE,EAAO,GACP7uB,EAAI8uB,SAEJH,EAAS,EAAGO,GACZP,EAAS,IAAM1qB,EAAG,GAClBjE,EAAI8uB,IAAgBvT,EAAOxb,KA9FxB,IA8FmC6E,GAQxC,OAHA5E,EAFM,EAAJ4E,EAEExD,IADJ6Z,EAAIjb,EAAEoD,SACQwB,EAAI,KAAO2W,EAAOxb,KAnG3B,IAmGsC6E,EAAIqW,GAAKjb,EAAIA,EAAEkI,MAAM,EAAG+S,EAAIrW,GAAK,IAAM5E,EAAEkI,MAAM+S,EAAIrW,IAE1FxD,EAAIpB,MAQR,SAAUJ,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B4rB,EAAS5rB,EAAoB,GAC7B8uB,EAAe9uB,EAAoB,IACnC2vB,EAAe,GAAIC,YAEvB1tB,EAAQA,EAAQa,EAAIb,EAAQO,GAAKmpB,EAAO,WAEtC,MAA2C,MAApC+D,EAAarvB,KAAK,EAAGT,QACvB+rB,EAAO,WAEZ+D,EAAarvB,KAAK,OACf,SAAU,CACbsvB,YAAa,SAASA,YAAYC,GAChC,IAAI/oB,EAAOgoB,EAAarrB,KAAM,6CAC9B,OAAOosB,IAAchwB,GAAY8vB,EAAarvB,KAAKwG,GAAQ6oB,EAAarvB,KAAKwG,EAAM+oB,OAOjF,SAAU1vB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,SAAU,CAAE0jB,QAASliB,KAAKod,IAAI,GAAI,OAK/C,SAAUthB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B8vB,EAAY9vB,EAAoB,GAAG6lB,SAEvC3jB,EAAQA,EAAQW,EAAG,SAAU,CAC3BgjB,SAAU,SAASA,SAAS3hB,GAC1B,MAAoB,iBAANA,GAAkB4rB,EAAU5rB,OAOxC,SAAU/D,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,SAAU,CAAE+iB,UAAW5lB,EAAoB,OAKxD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,SAAU,CAC3B+F,MAAO,SAASA,MAAMghB,GAEpB,OAAOA,GAAUA,MAOf,SAAUzpB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B4lB,EAAY5lB,EAAoB,IAChCwhB,EAAMnd,KAAKmd,IAEftf,EAAQA,EAAQW,EAAG,SAAU,CAC3BktB,cAAe,SAASA,cAAcnG,GACpC,OAAOhE,EAAUgE,IAAWpI,EAAIoI,IAAW,qBAOzC,SAAUzpB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,SAAU,CAAEmtB,iBAAkB,oBAK3C,SAAU7vB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,SAAU,CAAEotB,kBAAmB,oBAK5C,SAAU9vB,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B8lB,EAAc9lB,EAAoB,IAEtCkC,EAAQA,EAAQW,EAAIX,EAAQO,GAAKytB,OAAOnK,YAAcD,GAAc,SAAU,CAAEC,WAAYD,KAKtF,SAAU3lB,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9BimB,EAAYjmB,EAAoB,KAEpCkC,EAAQA,EAAQW,EAAIX,EAAQO,GAAKytB,OAAOhK,UAAYD,GAAY,SAAU,CAAEC,SAAUD,KAKhF,SAAU9lB,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9BimB,EAAYjmB,EAAoB,KAEpCkC,EAAQA,EAAQS,EAAIT,EAAQO,GAAKyjB,UAAYD,GAAY,CAAEC,SAAUD,KAK/D,SAAU9lB,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B8lB,EAAc9lB,EAAoB,IAEtCkC,EAAQA,EAAQS,EAAIT,EAAQO,GAAKsjB,YAAcD,GAAc,CAAEC,WAAYD,KAKrE,SAAU3lB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BsmB,EAAQtmB,EAAoB,KAC5BmwB,EAAO9rB,KAAK8rB,KACZC,EAAS/rB,KAAKgsB,MAElBnuB,EAAQA,EAAQW,EAAIX,EAAQO,IAAM2tB,GAEW,KAAxC/rB,KAAKsE,MAAMynB,EAAOF,OAAOI,aAEzBF,EAAOnU,WAAaA,UACtB,OAAQ,CACToU,MAAO,SAASA,MAAMlU,GACpB,OAAQA,GAAKA,GAAK,EAAIuG,IAAU,kBAAJvG,EACxB9X,KAAKqd,IAAIvF,GAAK9X,KAAKsd,IACnB2E,EAAMnK,EAAI,EAAIgU,EAAKhU,EAAI,GAAKgU,EAAKhU,EAAI,QAOvC,SAAUhc,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BuwB,EAASlsB,KAAKmsB,MAOlBtuB,EAAQA,EAAQW,EAAIX,EAAQO,IAAM8tB,GAA0B,EAAhB,EAAIA,EAAO,IAAS,OAAQ,CAAEC,MAL1E,SAASA,MAAMrU,GACb,OAAQ0J,SAAS1J,GAAKA,IAAW,GAALA,EAAaA,EAAI,GAAKqU,OAAOrU,GAAK9X,KAAKqd,IAAIvF,EAAI9X,KAAK8rB,KAAKhU,EAAIA,EAAI,IAAxDA,MASjC,SAAUhc,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BywB,EAASpsB,KAAKqsB,MAGlBxuB,EAAQA,EAAQW,EAAIX,EAAQO,IAAMguB,GAAU,EAAIA,GAAQ,GAAK,GAAI,OAAQ,CACvEC,MAAO,SAASA,MAAMvU,GACpB,OAAmB,IAAXA,GAAKA,GAAUA,EAAI9X,KAAKqd,KAAK,EAAIvF,IAAM,EAAIA,IAAM,MAOvD,SAAUhc,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Bkc,EAAOlc,EAAoB,IAE/BkC,EAAQA,EAAQW,EAAG,OAAQ,CACzB8tB,KAAM,SAASA,KAAKxU,GAClB,OAAOD,EAAKC,GAAKA,GAAK9X,KAAKod,IAAIpd,KAAKmd,IAAIrF,GAAI,EAAI,OAO9C,SAAUhc,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CACzB+tB,MAAO,SAASA,MAAMzU,GACpB,OAAQA,KAAO,GAAK,GAAK9X,KAAKsE,MAAMtE,KAAKqd,IAAIvF,EAAI,IAAO9X,KAAKwsB,OAAS,OAOpE,SAAU1wB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B8I,EAAMzE,KAAKyE,IAEf5G,EAAQA,EAAQW,EAAG,OAAQ,CACzBiuB,KAAM,SAASA,KAAK3U,GAClB,OAAQrT,EAAIqT,GAAKA,GAAKrT,GAAKqT,IAAM,MAO/B,SAAUhc,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Boc,EAASpc,EAAoB,IAEjCkC,EAAQA,EAAQW,EAAIX,EAAQO,GAAK2Z,GAAU/X,KAAKgY,OAAQ,OAAQ,CAAEA,MAAOD,KAKnE,SAAUjc,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CAAE8jB,OAAQ3mB,EAAoB,QAKnD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BwhB,EAAMnd,KAAKmd,IAEftf,EAAQA,EAAQW,EAAG,OAAQ,CACzBkuB,MAAO,SAASA,MAAMC,EAAQC,GAM5B,IALA,IAII5pB,EAAK6pB,EAJLC,EAAM,EACN/wB,EAAI,EACJyO,EAAOnL,UAAUC,OACjBytB,EAAO,EAEJhxB,EAAIyO,GAELuiB,GADJ/pB,EAAMma,EAAI9d,UAAUtD,QAGlB+wB,EAAMA,GADND,EAAME,EAAO/pB,GACK6pB,EAAM,EACxBE,EAAO/pB,GAGP8pB,GAFe,EAAN9pB,GACT6pB,EAAM7pB,EAAM+pB,GACCF,EACD7pB,EAEhB,OAAO+pB,IAASnV,SAAWA,SAAWmV,EAAO/sB,KAAK8rB,KAAKgB,OAOrD,SAAUhxB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BqxB,EAAQhtB,KAAKitB,KAGjBpvB,EAAQA,EAAQW,EAAIX,EAAQO,EAAIzC,EAAoB,EAApBA,CAAuB,WACrD,OAAgC,GAAzBqxB,EAAM,WAAY,IAA4B,GAAhBA,EAAM1tB,SACzC,OAAQ,CACV2tB,KAAM,SAASA,KAAKnV,EAAGiN,GACrB,IAAImI,EAAS,MACTC,GAAMrV,EACNsV,GAAMrI,EACNsI,EAAKH,EAASC,EACdG,EAAKJ,EAASE,EAClB,OAAO,EAAIC,EAAKC,IAAOJ,EAASC,IAAO,IAAMG,EAAKD,GAAMH,EAASE,IAAO,KAAO,KAAO,OAOpF,SAAUtxB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CACzB+uB,MAAO,SAASA,MAAMzV,GACpB,OAAO9X,KAAKqd,IAAIvF,GAAK9X,KAAKwtB,WAOxB,SAAU1xB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CAAEyjB,MAAOtmB,EAAoB,QAKlD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CACzBivB,KAAM,SAASA,KAAK3V,GAClB,OAAO9X,KAAKqd,IAAIvF,GAAK9X,KAAKsd,QAOxB,SAAUxhB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CAAEqZ,KAAMlc,EAAoB,OAKjD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Bqc,EAAQrc,EAAoB,IAC5B8I,EAAMzE,KAAKyE,IAGf5G,EAAQA,EAAQW,EAAIX,EAAQO,EAAIzC,EAAoB,EAApBA,CAAuB,WACrD,OAA8B,QAAtBqE,KAAK0tB,MAAM,SACjB,OAAQ,CACVA,KAAM,SAASA,KAAK5V,GAClB,OAAO9X,KAAKmd,IAAIrF,GAAKA,GAAK,GACrBE,EAAMF,GAAKE,GAAOF,IAAM,GACxBrT,EAAIqT,EAAI,GAAKrT,GAAKqT,EAAI,KAAO9X,KAAKgpB,EAAI,OAOzC,SAAUltB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Bqc,EAAQrc,EAAoB,IAC5B8I,EAAMzE,KAAKyE,IAEf5G,EAAQA,EAAQW,EAAG,OAAQ,CACzBmvB,KAAM,SAASA,KAAK7V,GAClB,IAAI5Y,EAAI8Y,EAAMF,GAAKA,GACf3Y,EAAI6Y,GAAOF,GACf,OAAO5Y,GAAK0Y,SAAW,EAAIzY,GAAKyY,UAAY,GAAK1Y,EAAIC,IAAMsF,EAAIqT,GAAKrT,GAAKqT,QAOvE,SAAUhc,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CACzBovB,MAAO,SAASA,MAAM/tB,GACpB,OAAa,EAALA,EAASG,KAAKsE,MAAQtE,KAAKqE,MAAMxE,OAOvC,SAAU/D,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9BsJ,EAAkBtJ,EAAoB,IACtCkyB,EAAe7rB,OAAO6rB,aACtBC,EAAiB9rB,OAAO+rB,cAG5BlwB,EAAQA,EAAQW,EAAIX,EAAQO,KAAO0vB,GAA2C,GAAzBA,EAAexuB,QAAc,SAAU,CAE1FyuB,cAAe,SAASA,cAAcjW,GAKpC,IAJA,IAGIkW,EAHAjqB,EAAM,GACNyG,EAAOnL,UAAUC,OACjBvD,EAAI,EAEMA,EAAPyO,GAAU,CAEf,GADAwjB,GAAQ3uB,UAAUtD,KACdkJ,EAAgB+oB,EAAM,WAAcA,EAAM,MAAM9nB,WAAW8nB,EAAO,8BACtEjqB,EAAIG,KAAK8pB,EAAO,MACZH,EAAaG,GACbH,EAAyC,QAA1BG,GAAQ,QAAY,IAAcA,EAAO,KAAQ,QAEpE,OAAOjqB,EAAImE,KAAK,QAOhB,SAAUpM,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9BiH,EAAYjH,EAAoB,IAChCsH,EAAWtH,EAAoB,GAEnCkC,EAAQA,EAAQW,EAAG,SAAU,CAE3ByvB,IAAK,SAASA,IAAIC,GAMhB,IALA,IAAIC,EAAMvrB,EAAUsrB,EAASD,KACzBnhB,EAAM7J,EAASkrB,EAAI7uB,QACnBkL,EAAOnL,UAAUC,OACjByE,EAAM,GACNhI,EAAI,EACKA,EAAN+Q,GACL/I,EAAIG,KAAKlC,OAAOmsB,EAAIpyB,OAChBA,EAAIyO,GAAMzG,EAAIG,KAAKlC,OAAO3C,UAAUtD,KACxC,OAAOgI,EAAImE,KAAK,QAOhB,SAAUpM,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,OAAQ,SAAUgmB,GACxC,OAAO,SAAStO,OACd,OAAOsO,EAAMviB,KAAM,OAOjB,SAAUtD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9ByyB,EAAMzyB,EAAoB,GAApBA,EAAwB,GAClCkC,EAAQA,EAAQa,EAAG,SAAU,CAE3B2vB,YAAa,SAASA,YAAYnW,GAChC,OAAOkW,EAAIhvB,KAAM8Y,OAOf,SAAUpc,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BsH,EAAWtH,EAAoB,GAC/B2yB,EAAU3yB,EAAoB,IAC9B4yB,EAAY,WACZC,EAAY,GAAGD,GAEnB1wB,EAAQA,EAAQa,EAAIb,EAAQO,EAAIzC,EAAoB,GAApBA,CAAwB4yB,GAAY,SAAU,CAC5EE,SAAU,SAASA,SAASpW,GAC1B,IAAI5V,EAAO6rB,EAAQlvB,KAAMiZ,EAAckW,GACnCG,EAAiC,EAAnBrvB,UAAUC,OAAaD,UAAU,GAAK7D,GACpDsR,EAAM7J,EAASR,EAAKnD,QACpBiN,EAAMmiB,IAAgBlzB,GAAYsR,EAAM9M,KAAKS,IAAIwC,EAASyrB,GAAc5hB,GACxE6hB,EAAS3sB,OAAOqW,GACpB,OAAOmW,EACHA,EAAUvyB,KAAKwG,EAAMksB,EAAQpiB,GAC7B9J,EAAK2B,MAAMmI,EAAMoiB,EAAOrvB,OAAQiN,KAASoiB,MAO3C,SAAU7yB,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B2yB,EAAU3yB,EAAoB,IAC9BizB,EAAW,WAEf/wB,EAAQA,EAAQa,EAAIb,EAAQO,EAAIzC,EAAoB,GAApBA,CAAwBizB,GAAW,SAAU,CAC3E9iB,SAAU,SAASA,SAASuM,GAC1B,SAAUiW,EAAQlvB,KAAMiZ,EAAcuW,GACnChjB,QAAQyM,EAAiC,EAAnBhZ,UAAUC,OAAaD,UAAU,GAAK7D,QAO7D,SAAUM,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQa,EAAG,SAAU,CAE3B+Y,OAAQ9b,EAAoB,OAMxB,SAAUG,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BsH,EAAWtH,EAAoB,GAC/B2yB,EAAU3yB,EAAoB,IAC9BkzB,EAAc,aACdC,EAAc,GAAGD,GAErBhxB,EAAQA,EAAQa,EAAIb,EAAQO,EAAIzC,EAAoB,GAApBA,CAAwBkzB,GAAc,SAAU,CAC9EE,WAAY,SAASA,WAAW1W,GAC9B,IAAI5V,EAAO6rB,EAAQlvB,KAAMiZ,EAAcwW,GACnC7qB,EAAQf,EAASjD,KAAKS,IAAuB,EAAnBpB,UAAUC,OAAaD,UAAU,GAAK7D,GAAWiH,EAAKnD,SAChFqvB,EAAS3sB,OAAOqW,GACpB,OAAOyW,EACHA,EAAY7yB,KAAKwG,EAAMksB,EAAQ3qB,GAC/BvB,EAAK2B,MAAMJ,EAAOA,EAAQ2qB,EAAOrvB,UAAYqvB,MAO/C,SAAU7yB,EAAQD,EAASF,GAIjC,IAAIyyB,EAAMzyB,EAAoB,GAApBA,EAAwB,GAGlCA,EAAoB,GAApBA,CAAwBqG,OAAQ,SAAU,SAAUgX,GAClD5Z,KAAKqT,GAAKzQ,OAAOgX,GACjB5Z,KAAK6Z,GAAK,GAET,WACD,IAEI+V,EAFAjuB,EAAI3B,KAAKqT,GACTzO,EAAQ5E,KAAK6Z,GAEjB,OAAalY,EAAEzB,QAAX0E,EAA0B,CAAE/C,MAAOzF,GAAWqP,MAAM,IACxDmkB,EAAQZ,EAAIrtB,EAAGiD,GACf5E,KAAK6Z,IAAM+V,EAAM1vB,OACV,CAAE2B,MAAO+tB,EAAOnkB,MAAM,OAMzB,SAAU/O,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,SAAU,SAAUiG,GAC1C,OAAO,SAASqtB,OAAO5yB,GACrB,OAAOuF,EAAWxC,KAAM,IAAK,OAAQ/C,OAOnC,SAAUP,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,MAAO,SAAUiG,GACvC,OAAO,SAASstB,MACd,OAAOttB,EAAWxC,KAAM,MAAO,GAAI,QAOjC,SAAUtD,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,QAAS,SAAUiG,GACzC,OAAO,SAASutB,QACd,OAAOvtB,EAAWxC,KAAM,QAAS,GAAI,QAOnC,SAAUtD,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,OAAQ,SAAUiG,GACxC,OAAO,SAASwtB,OACd,OAAOxtB,EAAWxC,KAAM,IAAK,GAAI,QAO/B,SAAUtD,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,QAAS,SAAUiG,GACzC,OAAO,SAASytB,QACd,OAAOztB,EAAWxC,KAAM,KAAM,GAAI,QAOhC,SAAUtD,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,YAAa,SAAUiG,GAC7C,OAAO,SAAS0tB,UAAUC,GACxB,OAAO3tB,EAAWxC,KAAM,OAAQ,QAASmwB,OAOvC,SAAUzzB,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,WAAY,SAAUiG,GAC5C,OAAO,SAAS4tB,SAAS3Z,GACvB,OAAOjU,EAAWxC,KAAM,OAAQ,OAAQyW,OAOtC,SAAU/Z,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,UAAW,SAAUiG,GAC3C,OAAO,SAAS6tB,UACd,OAAO7tB,EAAWxC,KAAM,IAAK,GAAI,QAO/B,SAAUtD,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,OAAQ,SAAUiG,GACxC,OAAO,SAAS8tB,KAAKC,GACnB,OAAO/tB,EAAWxC,KAAM,IAAK,OAAQuwB,OAOnC,SAAU7zB,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,QAAS,SAAUiG,GACzC,OAAO,SAASguB,QACd,OAAOhuB,EAAWxC,KAAM,QAAS,GAAI,QAOnC,SAAUtD,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,SAAU,SAAUiG,GAC1C,OAAO,SAASiuB,SACd,OAAOjuB,EAAWxC,KAAM,SAAU,GAAI,QAOpC,SAAUtD,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,MAAO,SAAUiG,GACvC,OAAO,SAASkuB,MACd,OAAOluB,EAAWxC,KAAM,MAAO,GAAI,QAOjC,SAAUtD,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,MAAO,SAAUiG,GACvC,OAAO,SAASmuB,MACd,OAAOnuB,EAAWxC,KAAM,MAAO,GAAI,QAOjC,SAAUtD,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,QAAS,CAAEsV,QAASnY,EAAoB,OAKrD,SAAUG,EAAQD,EAASF,GAIjC,IAAI8B,EAAM9B,EAAoB,IAC1BkC,EAAUlC,EAAoB,GAC9B0F,EAAW1F,EAAoB,GAC/BM,EAAON,EAAoB,KAC3BwJ,EAAcxJ,EAAoB,IAClCsH,EAAWtH,EAAoB,GAC/Bq0B,EAAiBr0B,EAAoB,IACrC0J,EAAY1J,EAAoB,IAEpCkC,EAAQA,EAAQW,EAAIX,EAAQO,GAAKzC,EAAoB,GAApBA,CAAwB,SAAU6S,GAAQhI,MAAM6D,KAAKmE,KAAW,QAAS,CAExGnE,KAAM,SAASA,KAAKuC,GAClB,IAOItN,EAAQ2E,EAAQqG,EAAMC,EAPtBxJ,EAAIM,EAASuL,GACb3N,EAAmB,mBAARG,KAAqBA,KAAOoH,MACvCgE,EAAOnL,UAAUC,OACjBmL,EAAe,EAAPD,EAAWnL,UAAU,GAAK7D,GAClCkP,EAAUD,IAAUjP,GACpBwI,EAAQ,EACR2G,EAAStF,EAAUtE,GAIvB,GAFI2J,IAASD,EAAQhN,EAAIgN,EAAc,EAAPD,EAAWnL,UAAU,GAAK7D,GAAW,IAEjEmP,GAAUnP,IAAeyD,GAAKuH,OAASrB,EAAYwF,GAMrD,IAAK1G,EAAS,IAAIhF,EADlBK,EAAS2D,EAASlC,EAAEzB,SACkB0E,EAAT1E,EAAgB0E,IAC3CgsB,EAAe/rB,EAAQD,EAAO0G,EAAUD,EAAM1J,EAAEiD,GAAQA,GAASjD,EAAEiD,SANrE,IAAKuG,EAAWI,EAAO1O,KAAK8E,GAAIkD,EAAS,IAAIhF,IAAOqL,EAAOC,EAASK,QAAQC,KAAM7G,IAChFgsB,EAAe/rB,EAAQD,EAAO0G,EAAUzO,EAAKsO,EAAUE,EAAO,CAACH,EAAKrJ,MAAO+C,IAAQ,GAAQsG,EAAKrJ,OASpG,OADAgD,EAAO3E,OAAS0E,EACTC,MAOL,SAAUnI,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9Bq0B,EAAiBr0B,EAAoB,IAGzCkC,EAAQA,EAAQW,EAAIX,EAAQO,EAAIzC,EAAoB,EAApBA,CAAuB,WACrD,SAASyC,KACT,QAASoI,MAAMuE,GAAG9O,KAAKmC,aAAcA,KACnC,QAAS,CAEX2M,GAAI,SAASA,KAIX,IAHA,IAAI/G,EAAQ,EACRwG,EAAOnL,UAAUC,OACjB2E,EAAS,IAAoB,mBAAR7E,KAAqBA,KAAOoH,OAAOgE,GAC9CxG,EAAPwG,GAAcwlB,EAAe/rB,EAAQD,EAAO3E,UAAU2E,MAE7D,OADAC,EAAO3E,OAASkL,EACTvG,MAOL,SAAUnI,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BiH,EAAYjH,EAAoB,IAChCsM,EAAY,GAAGC,KAGnBrK,EAAQA,EAAQa,EAAIb,EAAQO,GAAKzC,EAAoB,KAAOa,SAAWb,EAAoB,GAApBA,CAAwBsM,IAAa,QAAS,CACnHC,KAAM,SAASA,KAAK6D,GAClB,OAAO9D,EAAUhM,KAAK2G,EAAUxD,MAAO2M,IAAcvQ,GAAY,IAAMuQ,OAOrE,SAAUjQ,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B6d,EAAO7d,EAAoB,IAC3BgW,EAAMhW,EAAoB,IAC1BsJ,EAAkBtJ,EAAoB,IACtCsH,EAAWtH,EAAoB,GAC/B0M,EAAa,GAAGjE,MAGpBvG,EAAQA,EAAQa,EAAIb,EAAQO,EAAIzC,EAAoB,EAApBA,CAAuB,WACjD6d,GAAMnR,EAAWpM,KAAKud,KACxB,QAAS,CACXpV,MAAO,SAASA,MAAMkI,EAAOC,GAC3B,IAAIO,EAAM7J,EAAS7D,KAAKE,QACpBgP,EAAQqD,EAAIvS,MAEhB,GADAmN,EAAMA,IAAQ/Q,GAAYsR,EAAMP,EACnB,SAAT+B,EAAkB,OAAOjG,EAAWpM,KAAKmD,KAAMkN,EAAOC,GAM1D,IALA,IAAInB,EAAQnG,EAAgBqH,EAAOQ,GAC/BmjB,EAAOhrB,EAAgBsH,EAAKO,GAC5B+I,EAAO5S,EAASgtB,EAAO7kB,GACvB8kB,EAAS,IAAI1pB,MAAMqP,GACnB9Z,EAAI,EACDA,EAAI8Z,EAAM9Z,IAAKm0B,EAAOn0B,GAAc,UAATuS,EAC9BlP,KAAKyX,OAAOzL,EAAQrP,GACpBqD,KAAKgM,EAAQrP,GACjB,OAAOm0B,MAOL,SAAUp0B,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B4G,EAAY5G,EAAoB,IAChC0F,EAAW1F,EAAoB,GAC/B+F,EAAQ/F,EAAoB,GAC5Bw0B,EAAQ,GAAG/nB,KACXhG,EAAO,CAAC,EAAG,EAAG,GAElBvE,EAAQA,EAAQa,EAAIb,EAAQO,GAAKsD,EAAM,WAErCU,EAAKgG,KAAK5M,QACLkG,EAAM,WAEXU,EAAKgG,KAAK,UAELzM,EAAoB,GAApBA,CAAwBw0B,IAAS,QAAS,CAE/C/nB,KAAM,SAASA,KAAKgE,GAClB,OAAOA,IAAc5Q,GACjB20B,EAAMl0B,KAAKoF,EAASjC,OACpB+wB,EAAMl0B,KAAKoF,EAASjC,MAAOmD,EAAU6J,QAOvC,SAAUtQ,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9By0B,EAAWz0B,EAAoB,GAApBA,CAAwB,GACnC00B,EAAS10B,EAAoB,GAApBA,CAAwB,GAAGgQ,SAAS,GAEjD9N,EAAQA,EAAQa,EAAIb,EAAQO,GAAKiyB,EAAQ,QAAS,CAEhD1kB,QAAS,SAASA,QAAQ9H,GACxB,OAAOusB,EAAShxB,KAAMyE,EAAYxE,UAAU,QAO1C,SAAUvD,EAAQD,EAASF,GAEjC,IAAIiE,EAAWjE,EAAoB,GAC/BmY,EAAUnY,EAAoB,IAC9B6W,EAAU7W,EAAoB,EAApBA,CAAuB,WAErCG,EAAOD,QAAU,SAAUgd,GACzB,IAAI5Z,EASF,OARE6U,EAAQ+E,KAGM,mBAFhB5Z,EAAI4Z,EAASpX,cAEkBxC,IAAMuH,QAASsN,EAAQ7U,EAAE9B,aAAa8B,EAAIzD,IACrEoE,EAASX,IAED,QADVA,EAAIA,EAAEuT,MACUvT,EAAIzD,KAEfyD,IAAMzD,GAAYgL,MAAQvH,IAM/B,SAAUnD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BwN,EAAOxN,EAAoB,GAApBA,CAAwB,GAEnCkC,EAAQA,EAAQa,EAAIb,EAAQO,GAAKzC,EAAoB,GAApBA,CAAwB,GAAGqQ,KAAK,GAAO,QAAS,CAE/EA,IAAK,SAASA,IAAInI,GAChB,OAAOsF,EAAK/J,KAAMyE,EAAYxE,UAAU,QAOtC,SAAUvD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B20B,EAAU30B,EAAoB,GAApBA,CAAwB,GAEtCkC,EAAQA,EAAQa,EAAIb,EAAQO,GAAKzC,EAAoB,GAApBA,CAAwB,GAAG4P,QAAQ,GAAO,QAAS,CAElFA,OAAQ,SAASA,OAAO1H,GACtB,OAAOysB,EAAQlxB,KAAMyE,EAAYxE,UAAU,QAOzC,SAAUvD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B40B,EAAQ50B,EAAoB,GAApBA,CAAwB,GAEpCkC,EAAQA,EAAQa,EAAIb,EAAQO,GAAKzC,EAAoB,GAApBA,CAAwB,GAAGwQ,MAAM,GAAO,QAAS,CAEhFA,KAAM,SAASA,KAAKtI,GAClB,OAAO0sB,EAAMnxB,KAAMyE,EAAYxE,UAAU,QAOvC,SAAUvD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B60B,EAAS70B,EAAoB,GAApBA,CAAwB,GAErCkC,EAAQA,EAAQa,EAAIb,EAAQO,GAAKzC,EAAoB,GAApBA,CAAwB,GAAG0P,OAAO,GAAO,QAAS,CAEjFA,MAAO,SAASA,MAAMxH,GACpB,OAAO2sB,EAAOpxB,KAAMyE,EAAYxE,UAAU,QAOxC,SAAUvD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B80B,EAAU90B,EAAoB,KAElCkC,EAAQA,EAAQa,EAAIb,EAAQO,GAAKzC,EAAoB,GAApBA,CAAwB,GAAGmM,QAAQ,GAAO,QAAS,CAElFA,OAAQ,SAASA,OAAOjE,GACtB,OAAO4sB,EAAQrxB,KAAMyE,EAAYxE,UAAUC,OAAQD,UAAU,IAAI,OAO/D,SAAUvD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B80B,EAAU90B,EAAoB,KAElCkC,EAAQA,EAAQa,EAAIb,EAAQO,GAAKzC,EAAoB,GAApBA,CAAwB,GAAGqM,aAAa,GAAO,QAAS,CAEvFA,YAAa,SAASA,YAAYnE,GAChC,OAAO4sB,EAAQrxB,KAAMyE,EAAYxE,UAAUC,OAAQD,UAAU,IAAI,OAO/D,SAAUvD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B+0B,EAAW/0B,EAAoB,GAApBA,EAAwB,GACnCmZ,EAAU,GAAGlJ,QACb+kB,IAAkB7b,GAAW,EAAI,CAAC,GAAGlJ,QAAQ,GAAI,GAAK,EAE1D/N,EAAQA,EAAQa,EAAIb,EAAQO,GAAKuyB,IAAkBh1B,EAAoB,GAApBA,CAAwBmZ,IAAW,QAAS,CAE7FlJ,QAAS,SAASA,QAAQC,GACxB,OAAO8kB,EAEH7b,EAAQvV,MAAMH,KAAMC,YAAc,EAClCqxB,EAAStxB,KAAMyM,EAAexM,UAAU,QAO1C,SAAUvD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BiH,EAAYjH,EAAoB,IAChC6E,EAAY7E,EAAoB,IAChCsH,EAAWtH,EAAoB,GAC/BmZ,EAAU,GAAGlN,YACb+oB,IAAkB7b,GAAW,EAAI,CAAC,GAAGlN,YAAY,GAAI,GAAK,EAE9D/J,EAAQA,EAAQa,EAAIb,EAAQO,GAAKuyB,IAAkBh1B,EAAoB,GAApBA,CAAwBmZ,IAAW,QAAS,CAE7FlN,YAAa,SAASA,YAAYiE,GAEhC,GAAI8kB,EAAe,OAAO7b,EAAQvV,MAAMH,KAAMC,YAAc,EAC5D,IAAI0B,EAAI6B,EAAUxD,MACdE,EAAS2D,EAASlC,EAAEzB,QACpB0E,EAAQ1E,EAAS,EAGrB,IAFuB,EAAnBD,UAAUC,SAAY0E,EAAQhE,KAAKS,IAAIuD,EAAOxD,EAAUnB,UAAU,MAClE2E,EAAQ,IAAGA,EAAQ1E,EAAS0E,GACjB,GAATA,EAAYA,IAAS,GAAIA,KAASjD,GAAOA,EAAEiD,KAAW6H,EAAe,OAAO7H,GAAS,EAC3F,OAAQ,MAON,SAAUlI,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQa,EAAG,QAAS,CAAEyM,WAAYxP,EAAoB,OAE9DA,EAAoB,GAApBA,CAAwB,eAKlB,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQa,EAAG,QAAS,CAAE4M,KAAM3P,EAAoB,MAExDA,EAAoB,GAApBA,CAAwB,SAKlB,SAAUG,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9Bi1B,EAAQj1B,EAAoB,GAApBA,CAAwB,GAChC6I,EAAM,OACNqsB,GAAS,EAETrsB,IAAO,IAAIgC,MAAM,GAAGhC,GAAK,WAAcqsB,GAAS,IACpDhzB,EAAQA,EAAQa,EAAIb,EAAQO,EAAIyyB,EAAQ,QAAS,CAC/CrlB,KAAM,SAASA,KAAK3H,GAClB,OAAO+sB,EAAMxxB,KAAMyE,EAA+B,EAAnBxE,UAAUC,OAAaD,UAAU,GAAK7D,OAGzEG,EAAoB,GAApBA,CAAwB6I,IAKlB,SAAU1I,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9Bi1B,EAAQj1B,EAAoB,GAApBA,CAAwB,GAChC6I,EAAM,YACNqsB,GAAS,EAETrsB,IAAO,IAAIgC,MAAM,GAAGhC,GAAK,WAAcqsB,GAAS,IACpDhzB,EAAQA,EAAQa,EAAIb,EAAQO,EAAIyyB,EAAQ,QAAS,CAC/CnlB,UAAW,SAASA,UAAU7H,GAC5B,OAAO+sB,EAAMxxB,KAAMyE,EAA+B,EAAnBxE,UAAUC,OAAaD,UAAU,GAAK7D,OAGzEG,EAAoB,GAApBA,CAAwB6I,IAKlB,SAAU1I,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,UAKlB,SAAUG,EAAQD,EAASF,GAIjC,IAwBIm1B,EAAUC,EAA6BC,EAAsBC,EAxB7DvsB,EAAU/I,EAAoB,IAC9B4B,EAAS5B,EAAoB,GAC7B8B,EAAM9B,EAAoB,IAC1BuJ,EAAUvJ,EAAoB,IAC9BkC,EAAUlC,EAAoB,GAC9BiE,EAAWjE,EAAoB,GAC/B4G,EAAY5G,EAAoB,IAChCkJ,EAAalJ,EAAoB,IACjC2Z,EAAQ3Z,EAAoB,IAC5B8J,EAAqB9J,EAAoB,IACzC8gB,EAAO9gB,EAAoB,IAAI8N,IAC/BynB,EAAYv1B,EAAoB,GAApBA,GACZw1B,EAA6Bx1B,EAAoB,IACjDy1B,EAAUz1B,EAAoB,KAC9B0Z,EAAY1Z,EAAoB,IAChC01B,EAAiB11B,EAAoB,KACrC21B,EAAU,UACVxxB,EAAYvC,EAAOuC,UACnB4Z,EAAUnc,EAAOmc,QACjB6X,EAAW7X,GAAWA,EAAQ6X,SAC9BC,EAAKD,GAAYA,EAASC,IAAM,GAChCC,EAAWl0B,EAAO+zB,GAClB/V,EAA6B,WAApBrW,EAAQwU,GACjBgY,EAAQ,aAER5O,EAAuBiO,EAA8BI,EAA2BrwB,EAEhFunB,IAAe,WACjB,IAEE,IAAInM,EAAUuV,EAASxV,QAAQ,GAC3B0V,GAAezV,EAAQza,YAAc,IAAI9F,EAAoB,EAApBA,CAAuB,YAAc,SAAUuE,GAC1FA,EAAKwxB,EAAOA,IAGd,OAAQnW,GAA0C,mBAAzBqW,wBACpB1V,EAAQC,KAAKuV,aAAkBC,GAIT,IAAtBH,EAAG5lB,QAAQ,SACyB,IAApCyJ,EAAUzJ,QAAQ,aACvB,MAAOzL,KAfQ,GAmBf0xB,EAAa,SAAUhyB,GACzB,IAAIsc,EACJ,SAAOvc,EAASC,IAAkC,mBAAnBsc,EAAOtc,EAAGsc,QAAsBA,GAE7DT,EAAS,SAAUQ,EAAS4V,GAC9B,IAAI5V,EAAQ6V,GAAZ,CACA7V,EAAQ6V,IAAK,EACb,IAAIC,EAAQ9V,EAAQvG,GACpBub,EAAU,WAoCR,IAnCA,IAAIjwB,EAAQib,EAAQ+V,GAChBC,EAAmB,GAAdhW,EAAQiW,GACbp2B,EAAI,EACJqe,EAAM,SAAUgY,GAClB,IAIInuB,EAAQkY,EAAMkW,EAJdC,EAAUJ,EAAKE,EAASF,GAAKE,EAASG,KACtCtW,EAAUmW,EAASnW,QACnBU,EAASyV,EAASzV,OAClBd,EAASuW,EAASvW,OAEtB,IACMyW,GACGJ,IACe,GAAdhW,EAAQsW,IAASC,EAAkBvW,GACvCA,EAAQsW,GAAK,IAEC,IAAZF,EAAkBruB,EAAShD,GAEzB4a,GAAQA,EAAOE,QACnB9X,EAASquB,EAAQrxB,GACb4a,IACFA,EAAOC,OACPuW,GAAS,IAGTpuB,IAAWmuB,EAASlW,QACtBS,EAAO7c,EAAU,yBACRqc,EAAO0V,EAAW5tB,IAC3BkY,EAAKlgB,KAAKgI,EAAQgY,EAASU,GACtBV,EAAQhY,IACV0Y,EAAO1b,GACd,MAAOd,GACH0b,IAAWwW,GAAQxW,EAAOC,OAC9Ba,EAAOxc,KAGWpE,EAAfi2B,EAAM1yB,QAAY8a,EAAI4X,EAAMj2B,MACnCmgB,EAAQvG,GAAK,GACbuG,EAAQ6V,IAAK,EACTD,IAAa5V,EAAQsW,IAAIE,EAAYxW,OAGzCwW,EAAc,SAAUxW,GAC1BO,EAAKxgB,KAAKsB,EAAQ,WAChB,IAEI0G,EAAQquB,EAASK,EAFjB1xB,EAAQib,EAAQ+V,GAChBW,EAAYC,EAAY3W,GAe5B,GAbI0W,IACF3uB,EAASmtB,EAAQ,WACX7V,EACF7B,EAAQoZ,KAAK,qBAAsB7xB,EAAOib,IACjCoW,EAAU/0B,EAAOw1B,sBAC1BT,EAAQ,CAAEpW,QAASA,EAAS8W,OAAQ/xB,KAC1B0xB,EAAUp1B,EAAOo1B,UAAYA,EAAQM,OAC/CN,EAAQM,MAAM,8BAA+BhyB,KAIjDib,EAAQsW,GAAKjX,GAAUsX,EAAY3W,GAAW,EAAI,GAClDA,EAAQgX,GAAK13B,GACXo3B,GAAa3uB,EAAO9D,EAAG,MAAM8D,EAAO+J,KAGxC6kB,EAAc,SAAU3W,GAC1B,OAAsB,IAAfA,EAAQsW,IAAkD,KAArCtW,EAAQgX,IAAMhX,EAAQvG,IAAIrW,QAEpDmzB,EAAoB,SAAUvW,GAChCO,EAAKxgB,KAAKsB,EAAQ,WAChB,IAAI+0B,EACA/W,EACF7B,EAAQoZ,KAAK,mBAAoB5W,IACxBoW,EAAU/0B,EAAO41B,qBAC1Bb,EAAQ,CAAEpW,QAASA,EAAS8W,OAAQ9W,EAAQ+V,QAI9CmB,EAAU,SAAUnyB,GACtB,IAAIib,EAAU9c,KACV8c,EAAQ/R,KACZ+R,EAAQ/R,IAAK,GACb+R,EAAUA,EAAQmX,IAAMnX,GAChB+V,GAAKhxB,EACbib,EAAQiW,GAAK,EACRjW,EAAQgX,KAAIhX,EAAQgX,GAAKhX,EAAQvG,GAAGvR,SACzCsX,EAAOQ,GAAS,KAEdoX,EAAW,SAAUryB,GACvB,IACIkb,EADAD,EAAU9c,KAEd,IAAI8c,EAAQ/R,GAAZ,CACA+R,EAAQ/R,IAAK,EACb+R,EAAUA,EAAQmX,IAAMnX,EACxB,IACE,GAAIA,IAAYjb,EAAO,MAAMnB,EAAU,qCACnCqc,EAAO0V,EAAW5wB,IACpBiwB,EAAU,WACR,IAAI5jB,EAAU,CAAE+lB,GAAInX,EAAS/R,IAAI,GACjC,IACEgS,EAAKlgB,KAAKgF,EAAOxD,EAAI61B,EAAUhmB,EAAS,GAAI7P,EAAI21B,EAAS9lB,EAAS,IAClE,MAAOnN,GACPizB,EAAQn3B,KAAKqR,EAASnN,OAI1B+b,EAAQ+V,GAAKhxB,EACbib,EAAQiW,GAAK,EACbzW,EAAOQ,GAAS,IAElB,MAAO/b,GACPizB,EAAQn3B,KAAK,CAAEo3B,GAAInX,EAAS/R,IAAI,GAAShK,MAKxCkoB,IAEHoJ,EAAW,SAASnW,QAAQiY,GAC1B1uB,EAAWzF,KAAMqyB,EAAUH,EAAS,MACpC/uB,EAAUgxB,GACVzC,EAAS70B,KAAKmD,MACd,IACEm0B,EAAS91B,EAAI61B,EAAUl0B,KAAM,GAAI3B,EAAI21B,EAASh0B,KAAM,IACpD,MAAOo0B,GACPJ,EAAQn3B,KAAKmD,KAAMo0B,MAIvB1C,EAAW,SAASxV,QAAQiY,GAC1Bn0B,KAAKuW,GAAK,GACVvW,KAAK8zB,GAAK13B,GACV4D,KAAK+yB,GAAK,EACV/yB,KAAK+K,IAAK,EACV/K,KAAK6yB,GAAKz2B,GACV4D,KAAKozB,GAAK,EACVpzB,KAAK2yB,IAAK,IAEH50B,UAAYxB,EAAoB,GAApBA,CAAwB81B,EAASt0B,UAAW,CAE/Dgf,KAAM,SAASA,KAAKsX,EAAaC,GAC/B,IAAItB,EAAWtP,EAAqBrd,EAAmBrG,KAAMqyB,IAO7D,OANAW,EAASF,GAA2B,mBAAfuB,GAA4BA,EACjDrB,EAASG,KAA4B,mBAAdmB,GAA4BA,EACnDtB,EAASvW,OAASN,EAAS7B,EAAQmC,OAASrgB,GAC5C4D,KAAKuW,GAAGzR,KAAKkuB,GACThzB,KAAK8zB,IAAI9zB,KAAK8zB,GAAGhvB,KAAKkuB,GACtBhzB,KAAK+yB,IAAIzW,EAAOtc,MAAM,GACnBgzB,EAASlW,SAGlByX,QAAS,SAAUD,GACjB,OAAOt0B,KAAK+c,KAAK3gB,GAAWk4B,MAGhC1C,EAAuB,WACrB,IAAI9U,EAAU,IAAI4U,EAClB1xB,KAAK8c,QAAUA,EACf9c,KAAK6c,QAAUxe,EAAI61B,EAAUpX,EAAS,GACtC9c,KAAKud,OAASlf,EAAI21B,EAASlX,EAAS,IAEtCiV,EAA2BrwB,EAAIgiB,EAAuB,SAAU7jB,GAC9D,OAAOA,IAAMwyB,GAAYxyB,IAAMgyB,EAC3B,IAAID,EAAqB/xB,GACzB8xB,EAA4B9xB,KAIpCpB,EAAQA,EAAQS,EAAIT,EAAQiB,EAAIjB,EAAQO,GAAKiqB,EAAY,CAAE/M,QAASmW,IACpE91B,EAAoB,GAApBA,CAAwB81B,EAAUH,GAClC31B,EAAoB,GAApBA,CAAwB21B,GACxBL,EAAUt1B,EAAoB,IAAI21B,GAGlCzzB,EAAQA,EAAQW,EAAIX,EAAQO,GAAKiqB,EAAYiJ,EAAS,CAEpD3U,OAAQ,SAASA,OAAO4G,GACtB,IAAIqQ,EAAa9Q,EAAqB1jB,MAGtC,OADAyd,EADe+W,EAAWjX,QACjB4G,GACFqQ,EAAW1X,WAGtBre,EAAQA,EAAQW,EAAIX,EAAQO,GAAKsG,IAAY2jB,GAAaiJ,EAAS,CAEjErV,QAAS,SAASA,QAAQnE,GACxB,OAAOuZ,EAAe3sB,GAAWtF,OAAS6xB,EAAUQ,EAAWryB,KAAM0Y,MAGzEja,EAAQA,EAAQW,EAAIX,EAAQO,IAAMiqB,GAAc1sB,EAAoB,GAApBA,CAAwB,SAAU6S,GAChFijB,EAASoC,IAAIrlB,GAAa,SAAEkjB,MACzBJ,EAAS,CAEZuC,IAAK,SAASA,IAAIpiB,GAChB,IAAIxS,EAAIG,KACJw0B,EAAa9Q,EAAqB7jB,GAClCgd,EAAU2X,EAAW3X,QACrBU,EAASiX,EAAWjX,OACpB1Y,EAASmtB,EAAQ,WACnB,IAAI9pB,EAAS,GACTtD,EAAQ,EACR8vB,EAAY,EAChBxe,EAAM7D,GAAU,EAAO,SAAUyK,GAC/B,IAAI6X,EAAS/vB,IACTgwB,GAAgB,EACpB1sB,EAAOpD,KAAK1I,IACZs4B,IACA70B,EAAEgd,QAAQC,GAASC,KAAK,SAAUlb,GAC5B+yB,IACJA,GAAgB,EAChB1sB,EAAOysB,GAAU9yB,IACf6yB,GAAa7X,EAAQ3U,KACtBqV,OAEHmX,GAAa7X,EAAQ3U,KAGzB,OADIrD,EAAO9D,GAAGwc,EAAO1Y,EAAO+J,GACrB4lB,EAAW1X,SAGpB+X,KAAM,SAASA,KAAKxiB,GAClB,IAAIxS,EAAIG,KACJw0B,EAAa9Q,EAAqB7jB,GAClC0d,EAASiX,EAAWjX,OACpB1Y,EAASmtB,EAAQ,WACnB9b,EAAM7D,GAAU,EAAO,SAAUyK,GAC/Bjd,EAAEgd,QAAQC,GAASC,KAAKyX,EAAW3X,QAASU,OAIhD,OADI1Y,EAAO9D,GAAGwc,EAAO1Y,EAAO+J,GACrB4lB,EAAW1X,YAOhB,SAAUpgB,EAAQD,EAASF,GAIjC,IAAIkoB,EAAOloB,EAAoB,KAC3BkO,EAAWlO,EAAoB,IAC/Bu4B,EAAW,UAGfv4B,EAAoB,GAApBA,CAAwBu4B,EAAU,SAAUt3B,GAC1C,OAAO,SAASu3B,UAAY,OAAOv3B,EAAIwC,KAAyB,EAAnBC,UAAUC,OAAaD,UAAU,GAAK7D,MAClF,CAEDmoB,IAAK,SAASA,IAAI1iB,GAChB,OAAO4iB,EAAKxR,IAAIxI,EAASzK,KAAM80B,GAAWjzB,GAAO,KAElD4iB,GAAM,GAAO,IAKV,SAAU/nB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B4G,EAAY5G,EAAoB,IAChC+E,EAAW/E,EAAoB,GAC/By4B,GAAUz4B,EAAoB,GAAGmhB,SAAW,IAAIvd,MAChD80B,EAAS70B,SAASD,MAEtB1B,EAAQA,EAAQW,EAAIX,EAAQO,GAAKzC,EAAoB,EAApBA,CAAuB,WACtDy4B,EAAO,gBACL,UAAW,CACb70B,MAAO,SAASA,MAAMP,EAAQs1B,EAAcC,GAC1C,IAAI1iB,EAAItP,EAAUvD,GACdw1B,EAAI9zB,EAAS6zB,GACjB,OAAOH,EAASA,EAAOviB,EAAGyiB,EAAcE,GAAKH,EAAOp4B,KAAK4V,EAAGyiB,EAAcE,OAOxE,SAAU14B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BgI,EAAShI,EAAoB,IAC7B4G,EAAY5G,EAAoB,IAChC+E,EAAW/E,EAAoB,GAC/BiE,EAAWjE,EAAoB,GAC/B+F,EAAQ/F,EAAoB,GAC5BulB,EAAOvlB,EAAoB,IAC3B84B,GAAc94B,EAAoB,GAAGmhB,SAAW,IAAIuE,UAIpDqT,EAAiBhzB,EAAM,WACzB,SAAStD,KACT,QAASq2B,EAAW,aAA6B,GAAIr2B,aAAcA,KAEjEu2B,GAAYjzB,EAAM,WACpB+yB,EAAW,gBAGb52B,EAAQA,EAAQW,EAAIX,EAAQO,GAAKs2B,GAAkBC,GAAW,UAAW,CACvEtT,UAAW,SAASA,UAAUuT,EAAQrd,GACpChV,EAAUqyB,GACVl0B,EAAS6W,GACT,IAAIsd,EAAYx1B,UAAUC,OAAS,EAAIs1B,EAASryB,EAAUlD,UAAU,IACpE,GAAIs1B,IAAaD,EAAgB,OAAOD,EAAWG,EAAQrd,EAAMsd,GACjE,GAAID,GAAUC,EAAW,CAEvB,OAAQtd,EAAKjY,QACX,KAAK,EAAG,OAAO,IAAIs1B,EACnB,KAAK,EAAG,OAAO,IAAIA,EAAOrd,EAAK,IAC/B,KAAK,EAAG,OAAO,IAAIqd,EAAOrd,EAAK,GAAIA,EAAK,IACxC,KAAK,EAAG,OAAO,IAAIqd,EAAOrd,EAAK,GAAIA,EAAK,GAAIA,EAAK,IACjD,KAAK,EAAG,OAAO,IAAIqd,EAAOrd,EAAK,GAAIA,EAAK,GAAIA,EAAK,GAAIA,EAAK,IAG5D,IAAIud,EAAQ,CAAC,MAEb,OADAA,EAAM5wB,KAAK3E,MAAMu1B,EAAOvd,GACjB,IAAK2J,EAAK3hB,MAAMq1B,EAAQE,IAGjC,IAAI5pB,EAAQ2pB,EAAU13B,UAClB43B,EAAWpxB,EAAO/D,EAASsL,GAASA,EAAQ1O,OAAOW,WACnD8G,EAASzE,SAASD,MAAMtD,KAAK24B,EAAQG,EAAUxd,GACnD,OAAO3X,EAASqE,GAAUA,EAAS8wB,MAOjC,SAAUj5B,EAAQD,EAASF,GAGjC,IAAIkF,EAAKlF,EAAoB,GACzBkC,EAAUlC,EAAoB,GAC9B+E,EAAW/E,EAAoB,GAC/BiF,EAAcjF,EAAoB,IAGtCkC,EAAQA,EAAQW,EAAIX,EAAQO,EAAIzC,EAAoB,EAApBA,CAAuB,WAErDmhB,QAAQrgB,eAAeoE,EAAGC,EAAE,GAAI,EAAG,CAAEG,MAAO,IAAM,EAAG,CAAEA,MAAO,MAC5D,UAAW,CACbxE,eAAgB,SAASA,eAAeuC,EAAQg2B,EAAaC,GAC3Dv0B,EAAS1B,GACTg2B,EAAcp0B,EAAYo0B,GAAa,GACvCt0B,EAASu0B,GACT,IAEE,OADAp0B,EAAGC,EAAE9B,EAAQg2B,EAAaC,IACnB,EACP,MAAO90B,GACP,OAAO,OAQP,SAAUrE,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BkH,EAAOlH,EAAoB,IAAImF,EAC/BJ,EAAW/E,EAAoB,GAEnCkC,EAAQA,EAAQW,EAAG,UAAW,CAC5B02B,eAAgB,SAASA,eAAel2B,EAAQg2B,GAC9C,IAAI7nB,EAAOtK,EAAKnC,EAAS1B,GAASg2B,GAClC,QAAO7nB,IAASA,EAAKzQ,sBAA8BsC,EAAOg2B,OAOxD,SAAUl5B,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B+E,EAAW/E,EAAoB,GAC/Bw5B,EAAY,SAAUnc,GACxB5Z,KAAKqT,GAAK/R,EAASsY,GACnB5Z,KAAK6Z,GAAK,EACV,IACIjb,EADAwJ,EAAOpI,KAAK8Z,GAAK,GAErB,IAAKlb,KAAOgb,EAAUxR,EAAKtD,KAAKlG,IAElCrC,EAAoB,GAApBA,CAAwBw5B,EAAW,SAAU,WAC3C,IAEIn3B,EADAwJ,EADOpI,KACK8Z,GAEhB,GACE,GAAe1R,EAAKlI,QAJXF,KAIA6Z,GAAmB,MAAO,CAAEhY,MAAOzF,GAAWqP,MAAM,YACnD7M,EAAMwJ,EALPpI,KAKiB6Z,SALjB7Z,KAKgCqT,KAC3C,MAAO,CAAExR,MAAOjD,EAAK6M,MAAM,KAG7BhN,EAAQA,EAAQW,EAAG,UAAW,CAC5B42B,UAAW,SAASA,UAAUp2B,GAC5B,OAAO,IAAIm2B,EAAUn2B,OAOnB,SAAUlD,EAAQD,EAASF,GAGjC,IAAIkH,EAAOlH,EAAoB,IAC3B6F,EAAiB7F,EAAoB,IACrCgC,EAAMhC,EAAoB,IAC1BkC,EAAUlC,EAAoB,GAC9BiE,EAAWjE,EAAoB,GAC/B+E,EAAW/E,EAAoB,GAcnCkC,EAAQA,EAAQW,EAAG,UAAW,CAAE5B,IAZhC,SAASA,IAAIoC,EAAQg2B,GACnB,IACI7nB,EAAMjC;AADNmqB,EAAWh2B,UAAUC,OAAS,EAAIN,EAASK,UAAU,GAEzD,OAAIqB,EAAS1B,KAAYq2B,EAAiBr2B,EAAOg2B,IAC7C7nB,EAAOtK,EAAK/B,EAAE9B,EAAQg2B,IAAqBr3B,EAAIwP,EAAM,SACrDA,EAAKlM,MACLkM,EAAKvQ,MAAQpB,GACX2R,EAAKvQ,IAAIX,KAAKo5B,GACd75B,GACFoE,EAASsL,EAAQ1J,EAAexC,IAAiBpC,IAAIsO,EAAO8pB,EAAaK,QAA7E,MAQI,SAAUv5B,EAAQD,EAASF,GAGjC,IAAIkH,EAAOlH,EAAoB,IAC3BkC,EAAUlC,EAAoB,GAC9B+E,EAAW/E,EAAoB,GAEnCkC,EAAQA,EAAQW,EAAG,UAAW,CAC5BsE,yBAA0B,SAASA,yBAAyB9D,EAAQg2B,GAClE,OAAOnyB,EAAK/B,EAAEJ,EAAS1B,GAASg2B,OAO9B,SAAUl5B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B25B,EAAW35B,EAAoB,IAC/B+E,EAAW/E,EAAoB,GAEnCkC,EAAQA,EAAQW,EAAG,UAAW,CAC5BgD,eAAgB,SAASA,eAAexC,GACtC,OAAOs2B,EAAS50B,EAAS1B,QAOvB,SAAUlD,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,UAAW,CAC5Bb,IAAK,SAASA,IAAIqB,EAAQg2B,GACxB,OAAOA,KAAeh2B,MAOpB,SAAUlD,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B+E,EAAW/E,EAAoB,GAC/B2uB,EAAgB9tB,OAAOoT,aAE3B/R,EAAQA,EAAQW,EAAG,UAAW,CAC5BoR,aAAc,SAASA,aAAa5Q,GAElC,OADA0B,EAAS1B,IACFsrB,GAAgBA,EAActrB,OAOnC,SAAUlD,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,UAAW,CAAEue,QAASphB,EAAoB,OAKvD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B+E,EAAW/E,EAAoB,GAC/BsuB,EAAqBztB,OAAOsT,kBAEhCjS,EAAQA,EAAQW,EAAG,UAAW,CAC5BsR,kBAAmB,SAASA,kBAAkB9Q,GAC5C0B,EAAS1B,GACT,IAEE,OADIirB,GAAoBA,EAAmBjrB,IACpC,EACP,MAAOmB,GACP,OAAO,OAQP,SAAUrE,EAAQD,EAASF,GAGjC,IAAIkF,EAAKlF,EAAoB,GACzBkH,EAAOlH,EAAoB,IAC3B6F,EAAiB7F,EAAoB,IACrCgC,EAAMhC,EAAoB,IAC1BkC,EAAUlC,EAAoB,GAC9B+G,EAAa/G,EAAoB,IACjC+E,EAAW/E,EAAoB,GAC/BiE,EAAWjE,EAAoB,GAwBnCkC,EAAQA,EAAQW,EAAG,UAAW,CAAEiL,IAtBhC,SAASA,IAAIzK,EAAQg2B,EAAaO,GAChC,IAEIC,EAAoBtqB,EAFpBmqB,EAAWh2B,UAAUC,OAAS,EAAIN,EAASK,UAAU,GACrDo2B,EAAU5yB,EAAK/B,EAAEJ,EAAS1B,GAASg2B,GAEvC,IAAKS,EAAS,CACZ,GAAI71B,EAASsL,EAAQ1J,EAAexC,IAClC,OAAOyK,IAAIyB,EAAO8pB,EAAaO,EAAGF,GAEpCI,EAAU/yB,EAAW,GAEvB,GAAI/E,EAAI83B,EAAS,SAAU,CACzB,IAAyB,IAArBA,EAAQroB,WAAuBxN,EAASy1B,GAAW,OAAO,EAC9D,GAAIG,EAAqB3yB,EAAK/B,EAAEu0B,EAAUL,GAAc,CACtD,GAAIQ,EAAmB54B,KAAO44B,EAAmB/rB,MAAuC,IAAhC+rB,EAAmBpoB,SAAoB,OAAO,EACtGooB,EAAmBv0B,MAAQs0B,EAC3B10B,EAAGC,EAAEu0B,EAAUL,EAAaQ,QACvB30B,EAAGC,EAAEu0B,EAAUL,EAAatyB,EAAW,EAAG6yB,IACjD,OAAO,EAET,OAAOE,EAAQhsB,MAAQjO,KAAqBi6B,EAAQhsB,IAAIxN,KAAKo5B,EAAUE,IAAI,OAQvE,SAAUz5B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B+5B,EAAW/5B,EAAoB,IAE/B+5B,GAAU73B,EAAQA,EAAQW,EAAG,UAAW,CAC1CsiB,eAAgB,SAASA,eAAe9hB,EAAQkM,GAC9CwqB,EAAS7U,MAAM7hB,EAAQkM,GACvB,IAEE,OADAwqB,EAASjsB,IAAIzK,EAAQkM,IACd,EACP,MAAO/K,GACP,OAAO,OAQP,SAAUrE,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CAAEgc,IAAK,WAAc,OAAO,IAAIkK,MAAOD,cAK5D,SAAU3oB,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B0F,EAAW1F,EAAoB,GAC/BiF,EAAcjF,EAAoB,IAClCipB,EAAcjpB,EAAoB,KAClCuJ,EAAUvJ,EAAoB,IAElCkC,EAAQA,EAAQa,EAAIb,EAAQO,EAAIzC,EAAoB,EAApBA,CAAuB,WACrD,OAAkC,OAA3B,IAAI+oB,KAAKrG,KAAKsI,UAC2D,IAA3EjC,KAAKvnB,UAAUwpB,OAAO1qB,KAAK,CAAE2oB,YAAa,WAAc,OAAO,OAClE,OAAQ,CAEV+B,OAAQ,SAASA,OAAO3oB,GACtB,IAAI+C,EAAIM,EAASjC,MACbu2B,EAAK/0B,EAAYG,GACrB,MAAoB,iBAAN40B,GAAmBnU,SAASmU,GACrC,gBAAiB50B,GAAoB,QAAdmE,EAAQnE,GAAsCA,EAAE6jB,cAAxBA,EAAY3oB,KAAK8E,GADrB,SAQ9C,SAAUjF,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BipB,EAAcjpB,EAAoB,KAGtCkC,EAAQA,EAAQa,EAAIb,EAAQO,GAAKsmB,KAAKvnB,UAAUynB,cAAgBA,GAAc,OAAQ,CACpFA,YAAaA,KAMT,SAAU9oB,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9BgJ,EAAShJ,EAAoB,IAC7B4N,EAAS5N,EAAoB,IAC7B+E,EAAW/E,EAAoB,GAC/BsJ,EAAkBtJ,EAAoB,IACtCsH,EAAWtH,EAAoB,GAC/BiE,EAAWjE,EAAoB,GAC/B+K,EAAc/K,EAAoB,GAAG+K,YACrCjB,EAAqB9J,EAAoB,IACzC8K,EAAe8C,EAAO7C,YACtBC,EAAY4C,EAAO3C,SACnBgvB,EAAUjxB,EAAOuJ,KAAOxH,EAAYmvB,OACpCnpB,EAASjG,EAAatJ,UAAUiH,MAChC6E,EAAOtE,EAAOsE,KACd7C,EAAe,cAEnBvI,EAAQA,EAAQS,EAAIT,EAAQiB,EAAIjB,EAAQO,GAAKsI,IAAgBD,GAAe,CAAEC,YAAaD,IAE3F5I,EAAQA,EAAQW,EAAIX,EAAQO,GAAKuG,EAAOmE,OAAQ1C,EAAc,CAE5DyvB,OAAQ,SAASA,OAAOh2B,GACtB,OAAO+1B,GAAWA,EAAQ/1B,IAAOD,EAASC,IAAOoJ,KAAQpJ,KAI7DhC,EAAQA,EAAQa,EAAIb,EAAQ8B,EAAI9B,EAAQO,EAAIzC,EAAoB,EAApBA,CAAuB,WACjE,OAAQ,IAAI8K,EAAa,GAAGrC,MAAM,EAAG5I,IAAW6S,aAC9CjI,EAAc,CAEhBhC,MAAO,SAASA,MAAMgH,EAAOmB,GAC3B,GAAIG,IAAWlR,IAAa+Q,IAAQ/Q,GAAW,OAAOkR,EAAOzQ,KAAKyE,EAAStB,MAAOgM,GAQlF,IAPA,IAAI0B,EAAMpM,EAAStB,MAAMiP,WACrBynB,EAAQ7wB,EAAgBmG,EAAO0B,GAC/BipB,EAAM9wB,EAAgBsH,IAAQ/Q,GAAYsR,EAAMP,EAAKO,GACrD7I,EAAS,IAAKwB,EAAmBrG,KAAMqH,GAA9B,CAA6CxD,EAAS8yB,EAAMD,IACrEE,EAAQ,IAAIrvB,EAAUvH,MACtB62B,EAAQ,IAAItvB,EAAU1C,GACtBD,EAAQ,EACL8xB,EAAQC,GACbE,EAAM1W,SAASvb,IAASgyB,EAAMvW,SAASqW,MACvC,OAAO7xB,KAIbtI,EAAoB,GAApBA,CAAwByK,IAKlB,SAAUtK,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAClCkC,EAAQA,EAAQS,EAAIT,EAAQiB,EAAIjB,EAAQO,GAAKzC,EAAoB,IAAIuS,IAAK,CACxEtH,SAAUjL,EAAoB,IAAIiL,YAM9B,SAAU9K,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,OAAQ,EAAG,SAAUu6B,GAC3C,OAAO,SAASC,UAAUpoB,EAAMtB,EAAYnN,GAC1C,OAAO42B,EAAK92B,KAAM2O,EAAMtB,EAAYnN,OAOlC,SAAUxD,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,QAAS,EAAG,SAAUu6B,GAC5C,OAAO,SAAS/vB,WAAW4H,EAAMtB,EAAYnN,GAC3C,OAAO42B,EAAK92B,KAAM2O,EAAMtB,EAAYnN,OAOlC,SAAUxD,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,QAAS,EAAG,SAAUu6B,GAC5C,OAAO,SAASE,kBAAkBroB,EAAMtB,EAAYnN,GAClD,OAAO42B,EAAK92B,KAAM2O,EAAMtB,EAAYnN,MAErC,IAKG,SAAUxD,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,QAAS,EAAG,SAAUu6B,GAC5C,OAAO,SAASG,WAAWtoB,EAAMtB,EAAYnN,GAC3C,OAAO42B,EAAK92B,KAAM2O,EAAMtB,EAAYnN,OAOlC,SAAUxD,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,SAAU,EAAG,SAAUu6B,GAC7C,OAAO,SAAS5sB,YAAYyE,EAAMtB,EAAYnN,GAC5C,OAAO42B,EAAK92B,KAAM2O,EAAMtB,EAAYnN,OAOlC,SAAUxD,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,QAAS,EAAG,SAAUu6B,GAC5C,OAAO,SAASI,WAAWvoB,EAAMtB,EAAYnN,GAC3C,OAAO42B,EAAK92B,KAAM2O,EAAMtB,EAAYnN,OAOlC,SAAUxD,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,SAAU,EAAG,SAAUu6B,GAC7C,OAAO,SAASK,YAAYxoB,EAAMtB,EAAYnN,GAC5C,OAAO42B,EAAK92B,KAAM2O,EAAMtB,EAAYnN,OAOlC,SAAUxD,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,UAAW,EAAG,SAAUu6B,GAC9C,OAAO,SAASM,aAAazoB,EAAMtB,EAAYnN,GAC7C,OAAO42B,EAAK92B,KAAM2O,EAAMtB,EAAYnN,OAOlC,SAAUxD,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,UAAW,EAAG,SAAUu6B,GAC9C,OAAO,SAASO,aAAa1oB,EAAMtB,EAAYnN,GAC7C,OAAO42B,EAAK92B,KAAM2O,EAAMtB,EAAYnN,OAOlC,SAAUxD,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B+6B,EAAY/6B,EAAoB,GAApBA,EAAwB,GAExCkC,EAAQA,EAAQa,EAAG,QAAS,CAC1BoN,SAAU,SAASA,SAAS6H,GAC1B,OAAO+iB,EAAUt3B,KAAMuU,EAAuB,EAAnBtU,UAAUC,OAAaD,UAAU,GAAK7D,OAIrEG,EAAoB,GAApBA,CAAwB,aAKlB,SAAUG,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B8pB,EAAmB9pB,EAAoB,KACvC0F,EAAW1F,EAAoB,GAC/BsH,EAAWtH,EAAoB,GAC/B4G,EAAY5G,EAAoB,IAChCg7B,EAAqBh7B,EAAoB,IAE7CkC,EAAQA,EAAQa,EAAG,QAAS,CAC1Bk4B,QAAS,SAASA,QAAQ/yB,GACxB,IACI6hB,EAAWrP,EADXtV,EAAIM,EAASjC,MAMjB,OAJAmD,EAAUsB,GACV6hB,EAAYziB,EAASlC,EAAEzB,QACvB+W,EAAIsgB,EAAmB51B,EAAG,GAC1B0kB,EAAiBpP,EAAGtV,EAAGA,EAAG2kB,EAAW,EAAG,EAAG7hB,EAAYxE,UAAU,IAC1DgX,KAIX1a,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B8pB,EAAmB9pB,EAAoB,KACvC0F,EAAW1F,EAAoB,GAC/BsH,EAAWtH,EAAoB,GAC/B6E,EAAY7E,EAAoB,IAChCg7B,EAAqBh7B,EAAoB,IAE7CkC,EAAQA,EAAQa,EAAG,QAAS,CAC1Bm4B,QAAS,SAASA,UAChB,IAAIC,EAAWz3B,UAAU,GACrB0B,EAAIM,EAASjC,MACbsmB,EAAYziB,EAASlC,EAAEzB,QACvB+W,EAAIsgB,EAAmB51B,EAAG,GAE9B,OADA0kB,EAAiBpP,EAAGtV,EAAGA,EAAG2kB,EAAW,EAAGoR,IAAat7B,GAAY,EAAIgF,EAAUs2B,IACxEzgB,KAIX1a,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9ByyB,EAAMzyB,EAAoB,GAApBA,EAAwB,GAElCkC,EAAQA,EAAQa,EAAG,SAAU,CAC3Bq4B,GAAI,SAASA,GAAG7e,GACd,OAAOkW,EAAIhvB,KAAM8Y,OAOf,SAAUpc,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9Bq7B,EAAOr7B,EAAoB,KAC3B0Z,EAAY1Z,EAAoB,IAGpCkC,EAAQA,EAAQa,EAAIb,EAAQO,EAAI,oCAAoCgE,KAAKiT,GAAY,SAAU,CAC7F4hB,SAAU,SAASA,SAAS/Q,GAC1B,OAAO8Q,EAAK53B,KAAM8mB,EAA8B,EAAnB7mB,UAAUC,OAAaD,UAAU,GAAK7D,IAAW,OAO5E,SAAUM,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9Bq7B,EAAOr7B,EAAoB,KAC3B0Z,EAAY1Z,EAAoB,IAGpCkC,EAAQA,EAAQa,EAAIb,EAAQO,EAAI,oCAAoCgE,KAAKiT,GAAY,SAAU,CAC7F6hB,OAAQ,SAASA,OAAOhR,GACtB,OAAO8Q,EAAK53B,KAAM8mB,EAA8B,EAAnB7mB,UAAUC,OAAaD,UAAU,GAAK7D,IAAW,OAO5E,SAAUM,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,WAAY,SAAUgmB,GAC5C,OAAO,SAASwV,WACd,OAAOxV,EAAMviB,KAAM,KAEpB,cAKG,SAAUtD,EAAQD,EAASF,GAKjCA,EAAoB,GAApBA,CAAwB,YAAa,SAAUgmB,GAC7C,OAAO,SAASyV,YACd,OAAOzV,EAAMviB,KAAM,KAEpB,YAKG,SAAUtD,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BuF,EAAUvF,EAAoB,IAC9BsH,EAAWtH,EAAoB,GAC/Byc,EAAWzc,EAAoB,KAC/B07B,EAAW17B,EAAoB,KAC/B27B,EAActkB,OAAO7V,UAErBo6B,EAAwB,SAAUC,EAAQ31B,GAC5CzC,KAAKq4B,GAAKD,EACVp4B,KAAK+yB,GAAKtwB,GAGZlG,EAAoB,GAApBA,CAAwB47B,EAAuB,gBAAiB,SAAS3sB,OACvE,IAAI8sB,EAAQt4B,KAAKq4B,GAAGv3B,KAAKd,KAAK+yB,IAC9B,MAAO,CAAElxB,MAAOy2B,EAAO7sB,KAAgB,OAAV6sB,KAG/B75B,EAAQA,EAAQa,EAAG,SAAU,CAC3Bi5B,SAAU,SAASA,SAASH,GAE1B,GADAt2B,EAAQ9B,OACHgZ,EAASof,GAAS,MAAM13B,UAAU03B,EAAS,qBAChD,IAAIh5B,EAAIwD,OAAO5C,MACXw4B,EAAQ,UAAWN,EAAct1B,OAAOw1B,EAAOI,OAASP,EAASp7B,KAAKu7B,GACtEK,EAAK,IAAI7kB,OAAOwkB,EAAOz5B,QAAS65B,EAAMhsB,QAAQ,KAAOgsB,EAAQ,IAAMA,GAEvE,OADAC,EAAGC,UAAY70B,EAASu0B,EAAOM,WACxB,IAAIP,EAAsBM,EAAIr5B,OAOnC,SAAU1C,EAAQD,EAASF,GAKjC,IAAI+E,EAAW/E,EAAoB,GACnCG,EAAOD,QAAU,WACf,IAAI4G,EAAO/B,EAAStB,MAChB6E,EAAS,GAMb,OALIxB,EAAKlF,SAAQ0G,GAAU,KACvBxB,EAAKs1B,aAAY9zB,GAAU,KAC3BxB,EAAKu1B,YAAW/zB,GAAU,KAC1BxB,EAAKw1B,UAASh0B,GAAU,KACxBxB,EAAKy1B,SAAQj0B,GAAU,KACpBA,IAMH,SAAUnI,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,kBAKlB,SAAUG,EAAQD,EAASF,GAEjCA,EAAoB,GAApBA,CAAwB,eAKlB,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BohB,EAAUphB,EAAoB,IAC9BiH,EAAYjH,EAAoB,IAChCkH,EAAOlH,EAAoB,IAC3Bq0B,EAAiBr0B,EAAoB,IAEzCkC,EAAQA,EAAQW,EAAG,SAAU,CAC3B25B,0BAA2B,SAASA,0BAA0Bl7B,GAO5D,IANA,IAKIe,EAAKmP,EALLpM,EAAI6B,EAAU3F,GACdm7B,EAAUv1B,EAAK/B,EACf0G,EAAOuV,EAAQhc,GACfkD,EAAS,GACTlI,EAAI,EAEaA,EAAdyL,EAAKlI,SACV6N,EAAOirB,EAAQr3B,EAAG/C,EAAMwJ,EAAKzL,SAChBP,IAAWw0B,EAAe/rB,EAAQjG,EAAKmP,GAEtD,OAAOlJ,MAOL,SAAUnI,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B08B,EAAU18B,EAAoB,IAApBA,EAAyB,GAEvCkC,EAAQA,EAAQW,EAAG,SAAU,CAC3B8I,OAAQ,SAASA,OAAOzH,GACtB,OAAOw4B,EAAQx4B,OAOb,SAAU/D,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BqZ,EAAWrZ,EAAoB,IAApBA,EAAyB,GAExCkC,EAAQA,EAAQW,EAAG,SAAU,CAC3BkJ,QAAS,SAASA,QAAQ7H,GACxB,OAAOmV,EAASnV,OAOd,SAAU/D,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B0F,EAAW1F,EAAoB,GAC/B4G,EAAY5G,EAAoB,IAChC6c,EAAkB7c,EAAoB,GAG1CA,EAAoB,IAAMkC,EAAQA,EAAQa,EAAI/C,EAAoB,IAAK,SAAU,CAC/E28B,iBAAkB,SAASA,iBAAiB55B,EAAGpC,GAC7Ckc,EAAgB1X,EAAEO,EAASjC,MAAOV,EAAG,CAAE9B,IAAK2F,EAAUjG,GAASK,YAAY,EAAMD,cAAc,QAO7F,SAAUZ,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B0F,EAAW1F,EAAoB,GAC/B4G,EAAY5G,EAAoB,IAChC6c,EAAkB7c,EAAoB,GAG1CA,EAAoB,IAAMkC,EAAQA,EAAQa,EAAI/C,EAAoB,IAAK,SAAU,CAC/Ewa,iBAAkB,SAASA,iBAAiBzX,EAAG6pB,GAC7C/P,EAAgB1X,EAAEO,EAASjC,MAAOV,EAAG,CAAE+K,IAAKlH,EAAUgmB,GAAS5rB,YAAY,EAAMD,cAAc,QAO7F,SAAUZ,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B0F,EAAW1F,EAAoB,GAC/BiF,EAAcjF,EAAoB,IAClC6F,EAAiB7F,EAAoB,IACrCmH,EAA2BnH,EAAoB,IAAImF,EAGvDnF,EAAoB,IAAMkC,EAAQA,EAAQa,EAAI/C,EAAoB,IAAK,SAAU,CAC/E48B,iBAAkB,SAASA,iBAAiB75B,GAC1C,IAEIyW,EAFApU,EAAIM,EAASjC,MACb8W,EAAItV,EAAYlC,GAAG,GAEvB,GACE,GAAIyW,EAAIrS,EAAyB/B,EAAGmV,GAAI,OAAOf,EAAEvY,UAC1CmE,EAAIS,EAAeT,QAO1B,SAAUjF,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B0F,EAAW1F,EAAoB,GAC/BiF,EAAcjF,EAAoB,IAClC6F,EAAiB7F,EAAoB,IACrCmH,EAA2BnH,EAAoB,IAAImF,EAGvDnF,EAAoB,IAAMkC,EAAQA,EAAQa,EAAI/C,EAAoB,IAAK,SAAU,CAC/E68B,iBAAkB,SAASA,iBAAiB95B,GAC1C,IAEIyW,EAFApU,EAAIM,EAASjC,MACb8W,EAAItV,EAAYlC,GAAG,GAEvB,GACE,GAAIyW,EAAIrS,EAAyB/B,EAAGmV,GAAI,OAAOf,EAAE1L,UAC1C1I,EAAIS,EAAeT,QAO1B,SAAUjF,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQa,EAAIb,EAAQ6B,EAAG,MAAO,CAAEinB,OAAQhrB,EAAoB,IAApBA,CAAyB,UAKnE,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQa,EAAIb,EAAQ6B,EAAG,MAAO,CAAEinB,OAAQhrB,EAAoB,IAApBA,CAAyB,UAKnE,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,QAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,QAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,QAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,QAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAGjCA,EAAoB,GAApBA,CAAwB,YAKlB,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQS,EAAG,CAAEf,OAAQ5B,EAAoB,MAK3C,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,SAAU,CAAEjB,OAAQ5B,EAAoB,MAKrD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BgW,EAAMhW,EAAoB,IAE9BkC,EAAQA,EAAQW,EAAG,QAAS,CAC1Bi6B,QAAS,SAASA,QAAQ54B,GACxB,MAAmB,UAAZ8R,EAAI9R,OAOT,SAAU/D,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CACzBk6B,MAAO,SAASA,MAAM5gB,EAAG6gB,EAAOC,GAC9B,OAAO54B,KAAKS,IAAIm4B,EAAO54B,KAAK0R,IAAIinB,EAAO7gB,QAOrC,SAAUhc,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CAAEq6B,YAAa74B,KAAK84B,GAAK,OAK9C,SAAUh9B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Bo9B,EAAc,IAAM/4B,KAAK84B,GAE7Bj7B,EAAQA,EAAQW,EAAG,OAAQ,CACzBw6B,QAAS,SAASA,QAAQC,GACxB,OAAOA,EAAUF,MAOf,SAAUj9B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9BirB,EAAQjrB,EAAoB,KAC5B2mB,EAAS3mB,EAAoB,KAEjCkC,EAAQA,EAAQW,EAAG,OAAQ,CACzB06B,OAAQ,SAASA,OAAOphB,EAAG+O,EAAOC,EAAQC,EAAQC,GAChD,OAAO1E,EAAOsE,EAAM9O,EAAG+O,EAAOC,EAAQC,EAAQC,QAO5C,SAAUlrB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CACzB26B,MAAO,SAASA,MAAMC,EAAIC,EAAIC,EAAIC,GAChC,IAAIC,EAAMJ,IAAO,EAEbK,EAAMH,IAAO,EACjB,OAFUD,IAAO,IAEHE,IAAO,KAAOC,EAAMC,GAAOD,EAAMC,KAASD,EAAMC,IAAQ,MAAQ,IAAM,MAOlF,SAAU39B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CACzBk7B,MAAO,SAASA,MAAMN,EAAIC,EAAIC,EAAIC,GAChC,IAAIC,EAAMJ,IAAO,EAEbK,EAAMH,IAAO,EACjB,OAFUD,IAAO,IAEHE,IAAO,MAAQC,EAAMC,IAAQD,EAAMC,GAAOD,EAAMC,IAAQ,KAAO,IAAM,MAOjF,SAAU39B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CACzBm7B,MAAO,SAASA,MAAMC,EAAG5rB,GACvB,IACI6rB,GAAMD,EACNE,GAAM9rB,EACN+rB,EAHS,MAGJF,EACLG,EAJS,MAIJF,EACLG,EAAKJ,GAAM,GACXK,EAAKJ,GAAM,GACX7O,GAAKgP,EAAKD,IAAO,IAAMD,EAAKC,IAAO,IACvC,OAAOC,EAAKC,GAAMjP,GAAK,MAAQ8O,EAAKG,IAAO,IAR9B,MAQoCjP,IAAe,QAO9D,SAAUnvB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CAAEu6B,YAAa,IAAM/4B,KAAK84B,MAK/C,SAAUh9B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Bk9B,EAAc74B,KAAK84B,GAAK,IAE5Bj7B,EAAQA,EAAQW,EAAG,OAAQ,CACzBy6B,QAAS,SAASA,QAAQD,GACxB,OAAOA,EAAUH,MAOf,SAAU/8B,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CAAEooB,MAAOjrB,EAAoB,QAKlD,SAAUG,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CACzB27B,MAAO,SAASA,MAAMP,EAAG5rB,GACvB,IACI6rB,GAAMD,EACNE,GAAM9rB,EACN+rB,EAHS,MAGJF,EACLG,EAJS,MAIJF,EACLG,EAAKJ,IAAO,GACZK,EAAKJ,IAAO,GACZ7O,GAAKgP,EAAKD,IAAO,IAAMD,EAAKC,IAAO,IACvC,OAAOC,EAAKC,GAAMjP,IAAM,MAAQ8O,EAAKG,IAAO,IAR/B,MAQqCjP,KAAgB,QAOhE,SAAUnvB,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAG,OAAQ,CAAE47B,QAAS,SAASA,QAAQtiB,GAErD,OAAQA,GAAKA,IAAMA,EAAIA,EAAS,GAALA,EAAS,EAAIA,GAAKF,SAAe,EAAJE,MAMpD,SAAUhc,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B6B,EAAO7B,EAAoB,IAC3B4B,EAAS5B,EAAoB,GAC7B8J,EAAqB9J,EAAoB,IACzC01B,EAAiB11B,EAAoB,KAEzCkC,EAAQA,EAAQa,EAAIb,EAAQ6B,EAAG,UAAW,CAAE26B,UAAW,SAAUC,GAC/D,IAAIr7B,EAAIwG,EAAmBrG,KAAM5B,EAAK8d,SAAW/d,EAAO+d,SACpDif,EAAiC,mBAAbD,EACxB,OAAOl7B,KAAK+c,KACVoe,EAAa,SAAUziB,GACrB,OAAOuZ,EAAepyB,EAAGq7B,KAAane,KAAK,WAAc,OAAOrE,KAC9DwiB,EACJC,EAAa,SAAUp6B,GACrB,OAAOkxB,EAAepyB,EAAGq7B,KAAane,KAAK,WAAc,MAAMhc,KAC7Dm6B,OAOF,SAAUx+B,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9BmnB,EAAuBnnB,EAAoB,IAC3Cy1B,EAAUz1B,EAAoB,KAElCkC,EAAQA,EAAQW,EAAG,UAAW,CAAEg8B,MAAO,SAAU32B,GAC/C,IAAIkf,EAAoBD,EAAqBhiB,EAAE1B,MAC3C6E,EAASmtB,EAAQvtB,GAErB,OADCI,EAAO9D,EAAI4iB,EAAkBpG,OAASoG,EAAkB9G,SAAShY,EAAO+J,GAClE+U,EAAkB7G,YAMrB,SAAUpgB,EAAQD,EAASF,GAEjC,IAAI8+B,EAAW9+B,EAAoB,IAC/B+E,EAAW/E,EAAoB,GAC/B++B,EAAYD,EAASz8B,IACrB28B,EAA4BF,EAAShxB,IAEzCgxB,EAASh2B,IAAI,CAAEm2B,eAAgB,SAASA,eAAeC,EAAaC,EAAe97B,EAAQgQ,GACzF2rB,EAA0BE,EAAaC,EAAep6B,EAAS1B,GAAS07B,EAAU1rB,QAM9E,SAAUlT,EAAQD,EAASF,GAEjC,IAAI8+B,EAAW9+B,EAAoB,IAC/B+E,EAAW/E,EAAoB,GAC/B++B,EAAYD,EAASz8B,IACrB+Q,EAAyB0rB,EAASzuB,IAClC5L,EAAQq6B,EAASr6B,MAErBq6B,EAASh2B,IAAI,CAAEs2B,eAAgB,SAASA,eAAeF,EAAa77B,GAClE,IAAIgQ,EAAY3P,UAAUC,OAAS,EAAI9D,GAAYk/B,EAAUr7B,UAAU,IACnE+P,EAAcL,EAAuBrO,EAAS1B,GAASgQ,GAAW,GACtE,GAAII,IAAgB5T,KAAc4T,EAAoB,UAAEyrB,GAAc,OAAO,EAC7E,GAAIzrB,EAAYyG,KAAM,OAAO,EAC7B,IAAI5G,EAAiB7O,EAAMxD,IAAIoC,GAE/B,OADAiQ,EAAuB,UAAED,KAChBC,EAAe4G,MAAQzV,EAAc,UAAEpB,OAM5C,SAAUlD,EAAQD,EAASF,GAEjC,IAAI8+B,EAAW9+B,EAAoB,IAC/B+E,EAAW/E,EAAoB,GAC/B6F,EAAiB7F,EAAoB,IACrCq/B,EAAyBP,EAAS98B,IAClCs9B,EAAyBR,EAAS79B,IAClC89B,EAAYD,EAASz8B,IAErBk9B,EAAsB,SAAU/rB,EAAapO,EAAGrC,GAElD,GADas8B,EAAuB7rB,EAAapO,EAAGrC,GACxC,OAAOu8B,EAAuB9rB,EAAapO,EAAGrC,GAC1D,IAAIkd,EAASpa,EAAeT,GAC5B,OAAkB,OAAX6a,EAAkBsf,EAAoB/rB,EAAayM,EAAQld,GAAKlD,IAGzEi/B,EAASh2B,IAAI,CAAE02B,YAAa,SAASA,YAAYN,EAAa77B,GAC5D,OAAOk8B,EAAoBL,EAAan6B,EAAS1B,GAASK,UAAUC,OAAS,EAAI9D,GAAYk/B,EAAUr7B,UAAU,SAM7G,SAAUvD,EAAQD,EAASF,GAEjC,IAAI+nB,EAAM/nB,EAAoB,KAC1B0O,EAAO1O,EAAoB,KAC3B8+B,EAAW9+B,EAAoB,IAC/B+E,EAAW/E,EAAoB,GAC/B6F,EAAiB7F,EAAoB,IACrCy/B,EAA0BX,EAASjzB,KACnCkzB,EAAYD,EAASz8B,IAErBq9B,EAAuB,SAAUt6B,EAAGrC,GACtC,IAAI48B,EAAQF,EAAwBr6B,EAAGrC,GACnCkd,EAASpa,EAAeT,GAC5B,GAAe,OAAX6a,EAAiB,OAAO0f,EAC5B,IAAIC,EAAQF,EAAqBzf,EAAQld,GACzC,OAAO68B,EAAMj8B,OAASg8B,EAAMh8B,OAAS+K,EAAK,IAAIqZ,EAAI4X,EAAM7sB,OAAO8sB,KAAWA,EAAQD,GAGpFb,EAASh2B,IAAI,CAAE+2B,gBAAiB,SAASA,gBAAgBx8B,GACvD,OAAOq8B,EAAqB36B,EAAS1B,GAASK,UAAUC,OAAS,EAAI9D,GAAYk/B,EAAUr7B,UAAU,SAMjG,SAAUvD,EAAQD,EAASF,GAEjC,IAAI8+B,EAAW9+B,EAAoB,IAC/B+E,EAAW/E,EAAoB,GAC/Bs/B,EAAyBR,EAAS79B,IAClC89B,EAAYD,EAASz8B,IAEzBy8B,EAASh2B,IAAI,CAAEg3B,eAAgB,SAASA,eAAeZ,EAAa77B,GAClE,OAAOi8B,EAAuBJ,EAAan6B,EAAS1B,GAChDK,UAAUC,OAAS,EAAI9D,GAAYk/B,EAAUr7B,UAAU,SAMvD,SAAUvD,EAAQD,EAASF,GAEjC,IAAI8+B,EAAW9+B,EAAoB,IAC/B+E,EAAW/E,EAAoB,GAC/By/B,EAA0BX,EAASjzB,KACnCkzB,EAAYD,EAASz8B,IAEzBy8B,EAASh2B,IAAI,CAAEi3B,mBAAoB,SAASA,mBAAmB18B,GAC7D,OAAOo8B,EAAwB16B,EAAS1B,GAASK,UAAUC,OAAS,EAAI9D,GAAYk/B,EAAUr7B,UAAU,SAMpG,SAAUvD,EAAQD,EAASF,GAEjC,IAAI8+B,EAAW9+B,EAAoB,IAC/B+E,EAAW/E,EAAoB,GAC/B6F,EAAiB7F,EAAoB,IACrCq/B,EAAyBP,EAAS98B,IAClC+8B,EAAYD,EAASz8B,IAErB29B,EAAsB,SAAUxsB,EAAapO,EAAGrC,GAElD,GADas8B,EAAuB7rB,EAAapO,EAAGrC,GACxC,OAAO,EACnB,IAAIkd,EAASpa,EAAeT,GAC5B,OAAkB,OAAX6a,GAAkB+f,EAAoBxsB,EAAayM,EAAQld,IAGpE+7B,EAASh2B,IAAI,CAAEm3B,YAAa,SAASA,YAAYf,EAAa77B,GAC5D,OAAO28B,EAAoBd,EAAan6B,EAAS1B,GAASK,UAAUC,OAAS,EAAI9D,GAAYk/B,EAAUr7B,UAAU,SAM7G,SAAUvD,EAAQD,EAASF,GAEjC,IAAI8+B,EAAW9+B,EAAoB,IAC/B+E,EAAW/E,EAAoB,GAC/Bq/B,EAAyBP,EAAS98B,IAClC+8B,EAAYD,EAASz8B,IAEzBy8B,EAASh2B,IAAI,CAAEo3B,eAAgB,SAASA,eAAehB,EAAa77B,GAClE,OAAOg8B,EAAuBH,EAAan6B,EAAS1B,GAChDK,UAAUC,OAAS,EAAI9D,GAAYk/B,EAAUr7B,UAAU,SAMvD,SAAUvD,EAAQD,EAASF,GAEjC,IAAImgC,EAAYngC,EAAoB,IAChC+E,EAAW/E,EAAoB,GAC/B4G,EAAY5G,EAAoB,IAChC++B,EAAYoB,EAAU99B,IACtB28B,EAA4BmB,EAAUryB,IAE1CqyB,EAAUr3B,IAAI,CAAEg2B,SAAU,SAASA,SAASI,EAAaC,GACvD,OAAO,SAASiB,UAAU/8B,EAAQgQ,GAChC2rB,EACEE,EAAaC,GACZ9rB,IAAcxT,GAAYkF,EAAW6B,GAAWvD,GACjD07B,EAAU1rB,SAQV,SAAUlT,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9Bu1B,EAAYv1B,EAAoB,GAApBA,GACZ+d,EAAU/d,EAAoB,GAAG+d,QACjC6B,EAA6C,WAApC5f,EAAoB,GAApBA,CAAwB+d,GAErC7b,EAAQA,EAAQS,EAAG,CACjB09B,KAAM,SAASA,KAAKx5B,GAClB,IAAIqZ,EAASN,GAAU7B,EAAQmC,OAC/BqV,EAAUrV,EAASA,EAAOqF,KAAK1e,GAAMA,OAOnC,SAAU1G,EAAQD,EAASF,GAKjC,IAAIkC,EAAUlC,EAAoB,GAC9B4B,EAAS5B,EAAoB,GAC7B6B,EAAO7B,EAAoB,IAC3Bu1B,EAAYv1B,EAAoB,GAApBA,GACZsgC,EAAatgC,EAAoB,EAApBA,CAAuB,cACpC4G,EAAY5G,EAAoB,IAChC+E,EAAW/E,EAAoB,GAC/BkJ,EAAalJ,EAAoB,IACjCoJ,EAAcpJ,EAAoB,IAClC+B,EAAO/B,EAAoB,IAC3B2Z,EAAQ3Z,EAAoB,IAC5B6V,EAAS8D,EAAM9D,OAEfkD,EAAY,SAAUlS,GACxB,OAAa,MAANA,EAAahH,GAAY+G,EAAUC,IAGxC05B,EAAsB,SAAUC,GAClC,IAAIC,EAAUD,EAAaxmB,GACvBymB,IACFD,EAAaxmB,GAAKna,GAClB4gC,MAIAC,EAAqB,SAAUF,GACjC,OAAOA,EAAaG,KAAO9gC,IAGzB+gC,EAAoB,SAAUJ,GAC3BE,EAAmBF,KACtBA,EAAaG,GAAK9gC,GAClB0gC,EAAoBC,KAIpBK,EAAe,SAAUC,EAAUC,GACrCh8B,EAAS+7B,GACTr9B,KAAKuW,GAAKna,GACV4D,KAAKk9B,GAAKG,EACVA,EAAW,IAAIE,EAAqBv9B,MACpC,IACE,IAAIg9B,EAAUM,EAAWD,GACrBN,EAAeC,EACJ,MAAXA,IACiC,mBAAxBA,EAAQQ,YAA4BR,EAAU,WAAcD,EAAaS,eAC/Er6B,EAAU65B,GACfh9B,KAAKuW,GAAKymB,GAEZ,MAAOj8B,GAEP,YADAs8B,EAASxJ,MAAM9yB,GAEXk8B,EAAmBj9B,OAAO88B,EAAoB98B,OAGtDo9B,EAAar/B,UAAY4H,EAAY,GAAI,CACvC63B,YAAa,SAASA,cAAgBL,EAAkBn9B,SAG1D,IAAIu9B,EAAuB,SAAUR,GACnC/8B,KAAK+yB,GAAKgK,GAGZQ,EAAqBx/B,UAAY4H,EAAY,GAAI,CAC/C6F,KAAM,SAASA,KAAK3J,GAClB,IAAIk7B,EAAe/8B,KAAK+yB,GACxB,IAAKkK,EAAmBF,GAAe,CACrC,IAAIM,EAAWN,EAAaG,GAC5B,IACE,IAAIpgC,EAAIwY,EAAU+nB,EAAS7xB,MAC3B,GAAI1O,EAAG,OAAOA,EAAED,KAAKwgC,EAAUx7B,GAC/B,MAAOd,GACP,IACEo8B,EAAkBJ,GAClB,QACA,MAAMh8B,MAKd8yB,MAAO,SAASA,MAAMhyB,GACpB,IAAIk7B,EAAe/8B,KAAK+yB,GACxB,GAAIkK,EAAmBF,GAAe,MAAMl7B,EAC5C,IAAIw7B,EAAWN,EAAaG,GAC5BH,EAAaG,GAAK9gC,GAClB,IACE,IAAIU,EAAIwY,EAAU+nB,EAASxJ,OAC3B,IAAK/2B,EAAG,MAAM+E,EACdA,EAAQ/E,EAAED,KAAKwgC,EAAUx7B,GACzB,MAAOd,GACP,IACE+7B,EAAoBC,GACpB,QACA,MAAMh8B,GAGV,OADE+7B,EAAoBC,GACfl7B,GAET47B,SAAU,SAASA,SAAS57B,GAC1B,IAAIk7B,EAAe/8B,KAAK+yB,GACxB,IAAKkK,EAAmBF,GAAe,CACrC,IAAIM,EAAWN,EAAaG,GAC5BH,EAAaG,GAAK9gC,GAClB,IACE,IAAIU,EAAIwY,EAAU+nB,EAASI,UAC3B57B,EAAQ/E,EAAIA,EAAED,KAAKwgC,EAAUx7B,GAASzF,GACtC,MAAO2E,GACP,IACE+7B,EAAoBC,GACpB,QACA,MAAMh8B,GAGV,OADE+7B,EAAoBC,GACfl7B,MAKb,IAAI67B,EAAc,SAASC,WAAWL,GACpC73B,EAAWzF,KAAM09B,EAAa,aAAc,MAAMzZ,GAAK9gB,EAAUm6B,IAGnE33B,EAAY+3B,EAAY3/B,UAAW,CACjC6/B,UAAW,SAASA,UAAUP,GAC5B,OAAO,IAAID,EAAaC,EAAUr9B,KAAKikB,KAEzC1X,QAAS,SAASA,QAAQnJ,GACxB,IAAIC,EAAOrD,KACX,OAAO,IAAK5B,EAAK8d,SAAW/d,EAAO+d,SAAS,SAAUW,EAASU,GAC7Dpa,EAAUC,GACV,IAAI25B,EAAe15B,EAAKu6B,UAAU,CAChCpyB,KAAM,SAAU3J,GACd,IACE,OAAOuB,EAAGvB,GACV,MAAOd,GACPwc,EAAOxc,GACPg8B,EAAaS,gBAGjB3J,MAAOtW,EACPkgB,SAAU5gB,SAMlBlX,EAAY+3B,EAAa,CACvBzyB,KAAM,SAASA,KAAKyN,GAClB,IAAI7Y,EAAoB,mBAATG,KAAsBA,KAAO09B,EACxC/5B,EAAS2R,EAAUhU,EAASoX,GAAGmkB,IACnC,GAAIl5B,EAAQ,CACV,IAAIk6B,EAAav8B,EAASqC,EAAO9G,KAAK6b,IACtC,OAAOmlB,EAAWx7B,cAAgBxC,EAAIg+B,EAAa,IAAIh+B,EAAE,SAAUw9B,GACjE,OAAOQ,EAAWD,UAAUP,KAGhC,OAAO,IAAIx9B,EAAE,SAAUw9B,GACrB,IAAI5xB,GAAO,EAeX,OAdAqmB,EAAU,WACR,IAAKrmB,EAAM,CACT,IACE,GAAIyK,EAAMwC,GAAG,EAAO,SAAUjY,GAE5B,GADA48B,EAAS7xB,KAAK/K,GACVgL,EAAM,OAAO2G,MACZA,EAAQ,OACf,MAAOrR,GACP,GAAI0K,EAAM,MAAM1K,EAEhB,YADAs8B,EAASxJ,MAAM9yB,GAEfs8B,EAASI,cAGR,WAAchyB,GAAO,MAGhCE,GAAI,SAASA,KACX,IAAK,IAAIhP,EAAI,EAAGC,EAAIqD,UAAUC,OAAQ49B,EAAQ,IAAI12B,MAAMxK,GAAID,EAAIC,GAAIkhC,EAAMnhC,GAAKsD,UAAUtD,KACzF,OAAO,IAAqB,mBAATqD,KAAsBA,KAAO09B,GAAa,SAAUL,GACrE,IAAI5xB,GAAO,EASX,OARAqmB,EAAU,WACR,IAAKrmB,EAAM,CACT,IAAK,IAAIyM,EAAI,EAAGA,EAAI4lB,EAAM59B,SAAUgY,EAElC,GADAmlB,EAAS7xB,KAAKsyB,EAAM5lB,IAChBzM,EAAM,OACV4xB,EAASI,cAGR,WAAchyB,GAAO,QAKlCnN,EAAKo/B,EAAY3/B,UAAW8+B,EAAY,WAAc,OAAO78B,OAE7DvB,EAAQA,EAAQS,EAAG,CAAEy+B,WAAYD,IAEjCnhC,EAAoB,GAApBA,CAAwB,eAKlB,SAAUG,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9BwhC,EAAQxhC,EAAoB,IAChCkC,EAAQA,EAAQS,EAAIT,EAAQe,EAAG,CAC7Bgb,aAAcujB,EAAM1zB,IACpBqQ,eAAgBqjB,EAAMliB,SAMlB,SAAUnf,EAAQD,EAASF,GAEjCA,EAAoB,IAYpB,IAXA,IAAI4B,EAAS5B,EAAoB,GAC7B+B,EAAO/B,EAAoB,IAC3BgK,EAAYhK,EAAoB,IAChCyhC,EAAgBzhC,EAAoB,EAApBA,CAAuB,eAEvC0hC,EAAe,wbAIU/6B,MAAM,KAE1BvG,EAAI,EAAGA,EAAIshC,EAAa/9B,OAAQvD,IAAK,CAC5C,IAAIoG,EAAOk7B,EAAathC,GACpBuhC,EAAa//B,EAAO4E,GACpB+I,EAAQoyB,GAAcA,EAAWngC,UACjC+N,IAAUA,EAAMkyB,IAAgB1/B,EAAKwN,EAAOkyB,EAAej7B,GAC/DwD,EAAUxD,GAAQwD,EAAUa,QAMxB,SAAU1K,EAAQD,EAASF,GAGjC,IAAI4B,EAAS5B,EAAoB,GAC7BkC,EAAUlC,EAAoB,GAC9B0Z,EAAY1Z,EAAoB,IAChCyI,EAAQ,GAAGA,MACXm5B,EAAO,WAAWn7B,KAAKiT,GACvBsT,EAAO,SAAUlf,GACnB,OAAO,SAAUjH,EAAIg7B,GACnB,IAAIC,EAA+B,EAAnBp+B,UAAUC,OACtBiY,IAAOkmB,GAAYr5B,EAAMnI,KAAKoD,UAAW,GAC7C,OAAOoK,EAAIg0B,EAAY,YAEP,mBAANj7B,EAAmBA,EAAKhD,SAASgD,IAAKjD,MAAMH,KAAMmY,IACxD/U,EAAIg7B,KAGZ3/B,EAAQA,EAAQS,EAAIT,EAAQe,EAAIf,EAAQO,EAAIm/B,EAAM,CAChDviB,WAAY2N,EAAKprB,EAAOyd,YACxB0iB,YAAa/U,EAAKprB,EAAOmgC,gBAMrB,SAAU5hC,EAAQD,EAASF,GAIjC,IAAI8B,EAAM9B,EAAoB,IAC1BkC,EAAUlC,EAAoB,GAC9B+G,EAAa/G,EAAoB,IACjCub,EAASvb,EAAoB,IAC7BgI,EAAShI,EAAoB,IAC7B6F,EAAiB7F,EAAoB,IACrCob,EAAUpb,EAAoB,IAC9BkF,EAAKlF,EAAoB,GACzBgiC,EAAQhiC,EAAoB,KAC5B4G,EAAY5G,EAAoB,IAChC2Z,EAAQ3Z,EAAoB,IAC5BsrB,EAAatrB,EAAoB,KACjCqY,EAAcrY,EAAoB,IAClC2O,EAAO3O,EAAoB,IAC3BiE,EAAWjE,EAAoB,GAC/BiH,EAAYjH,EAAoB,IAChC4W,EAAc5W,EAAoB,GAClCgC,EAAMhC,EAAoB,IAU1BiiC,EAAmB,SAAUz6B,GAC/B,IAAIE,EAAiB,GAARF,EACTK,EAAmB,GAARL,EACf,OAAO,SAAUlG,EAAQ4G,EAAYpB,GACnC,IAIIzE,EAAK8F,EAAKC,EAJVjD,EAAIrD,EAAIoG,EAAYpB,EAAM,GAC1B1B,EAAI6B,EAAU3F,GACdgH,EAASZ,GAAkB,GAARF,GAAqB,GAARA,EAC5B,IAAoB,mBAAR/D,KAAqBA,KAAOy+B,MAAUriC,GAE1D,IAAKwC,KAAO+C,EAAG,GAAIpD,EAAIoD,EAAG/C,KAExB+F,EAAMjD,EADNgD,EAAM/C,EAAE/C,GACKA,EAAKf,GACdkG,GACF,GAAIE,EAAQY,EAAOjG,GAAO+F,OACrB,GAAIA,EAAK,OAAQZ,GACpB,KAAK,EAAGc,EAAOjG,GAAO8F,EAAK,MAC3B,KAAK,EAAG,OAAO,EACf,KAAK,EAAG,OAAOA,EACf,KAAK,EAAG,OAAO9F,EACf,KAAK,EAAGiG,EAAOF,EAAI,IAAMA,EAAI,QACxB,GAAIP,EAAU,OAAO,EAGhC,OAAe,GAARL,GAAaK,EAAWA,EAAWS,IAG1C65B,EAAUF,EAAiB,GAE3BG,EAAiB,SAAUppB,GAC7B,OAAO,SAAU9U,GACf,OAAO,IAAIm+B,EAAan+B,EAAI8U,KAG5BqpB,EAAe,SAAUhlB,EAAUrE,GACrCvV,KAAKqT,GAAK7P,EAAUoW,GACpB5Z,KAAK8zB,GAAKnc,EAAQiC,GAClB5Z,KAAK6Z,GAAK,EACV7Z,KAAK8Z,GAAKvE,GAmBZ,SAASkpB,KAAKpsB,GACZ,IAAIwsB,EAAOt6B,EAAO,MAQlB,OAPI8N,GAAYjW,KACVyrB,EAAWxV,GACb6D,EAAM7D,GAAU,EAAM,SAAUzT,EAAKiD,GACnCg9B,EAAKjgC,GAAOiD,IAETiW,EAAO+mB,EAAMxsB,IAEfwsB,EA1BTjqB,EAAYgqB,EAAc,OAAQ,WAChC,IAIIhgC,EAJAyE,EAAOrD,KACP2B,EAAI0B,EAAKgQ,GACTjL,EAAO/E,EAAKywB,GACZve,EAAOlS,EAAKyW,GAEhB,GACE,GAAe1R,EAAKlI,QAAhBmD,EAAKwW,GAEP,OADAxW,EAAKgQ,GAAKjX,GACH8O,EAAK,UAEN3M,EAAIoD,EAAG/C,EAAMwJ,EAAK/E,EAAKwW,QACjC,OAA2B3O,EAAK,EAApB,QAARqK,EAA+B3W,EACvB,UAAR2W,EAAiC5T,EAAE/C,GACxB,CAACA,EAAK+C,EAAE/C,OAczB6/B,KAAK1gC,UAAY,KAwCjBU,EAAQA,EAAQS,EAAIT,EAAQO,EAAG,CAAEy/B,KAAMA,OAEvChgC,EAAQA,EAAQW,EAAG,OAAQ,CACzBgJ,KAAMu2B,EAAe,QACrBz2B,OAAQy2B,EAAe,UACvBr2B,QAASq2B,EAAe,WACxBpyB,QAASiyB,EAAiB,GAC1B5xB,IAAK4xB,EAAiB,GACtBryB,OAAQqyB,EAAiB,GACzBzxB,KAAMyxB,EAAiB,GACvBvyB,MAAOuyB,EAAiB,GACxBpyB,KAAMoyB,EAAiB,GACvBE,QAASA,EACTI,SAAUN,EAAiB,GAC3B91B,OApDF,SAASA,OAAO7K,EAAQwN,EAAOyrB,GAC7B3zB,EAAUkI,GACV,IAIIiY,EAAM1kB,EAJN+C,EAAI6B,EAAU3F,GACduK,EAAOuP,EAAQhW,GACfzB,EAASkI,EAAKlI,OACdvD,EAAI,EAER,GAAIsD,UAAUC,OAAS,EAAG,CACxB,IAAKA,EAAQ,MAAMQ,UAAU,gDAC7B4iB,EAAO3hB,EAAEyG,EAAKzL,WACT2mB,EAAOlmB,OAAO05B,GACrB,KAAgBn6B,EAATuD,GAAgB3B,EAAIoD,EAAG/C,EAAMwJ,EAAKzL,QACvC2mB,EAAOjY,EAAMiY,EAAM3hB,EAAE/C,GAAMA,EAAKf,IAElC,OAAOylB,GAuCPib,MAAOA,EACP7xB,SArCF,SAASA,SAAS7O,EAAQ0W,GAExB,OAAQA,GAAMA,EAAKgqB,EAAM1gC,EAAQ0W,GAAMmqB,EAAQ7gC,EAAQ,SAAU4C,GAE/D,OAAOA,GAAMA,OACPrE,IAiCRmC,IAAKA,EACLf,IA/BF,SAASA,IAAIK,EAAQe,GACnB,GAAIL,EAAIV,EAAQe,GAAM,OAAOf,EAAOe,IA+BpCyL,IA7BF,SAASA,IAAIxM,EAAQe,EAAKiD,GAGxB,OAFIsR,GAAevU,KAAOxB,OAAQqE,EAAGC,EAAE7D,EAAQe,EAAK0E,EAAW,EAAGzB,IAC7DhE,EAAOe,GAAOiD,EACZhE,GA2BPkhC,OAxBF,SAASA,OAAOt+B,GACd,OAAOD,EAASC,IAAO2B,EAAe3B,KAAQg+B,KAAK1gC,cA6B/C,SAAUrB,EAAQD,EAASF,GAEjC,IAAIob,EAAUpb,EAAoB,IAC9BiH,EAAYjH,EAAoB,IACpCG,EAAOD,QAAU,SAAUoB,EAAQ0W,GAMjC,IALA,IAII3V,EAJA+C,EAAI6B,EAAU3F,GACduK,EAAOuP,EAAQhW,GACfzB,EAASkI,EAAKlI,OACd0E,EAAQ,EAEIA,EAAT1E,GAAgB,GAAIyB,EAAE/C,EAAMwJ,EAAKxD,QAAc2P,EAAI,OAAO3V,IAM7D,SAAUlC,EAAQD,EAASF,GAEjC,IAAI+E,EAAW/E,EAAoB,GAC/BiB,EAAMjB,EAAoB,IAC9BG,EAAOD,QAAUF,EAAoB,IAAIyiC,YAAc,SAAUv+B,GAC/D,IAAI8K,EAAS/N,EAAIiD,GACjB,GAAqB,mBAAV8K,EAAsB,MAAM7K,UAAUD,EAAK,qBACtD,OAAOa,EAASiK,EAAO1O,KAAK4D,MAMxB,SAAU/D,EAAQD,EAASF,GAEjC,IAAI4B,EAAS5B,EAAoB,GAC7B6B,EAAO7B,EAAoB,IAC3BkC,EAAUlC,EAAoB,GAC9B0iC,EAAU1iC,EAAoB,KAElCkC,EAAQA,EAAQS,EAAIT,EAAQO,EAAG,CAC7BkgC,MAAO,SAASA,MAAMd,GACpB,OAAO,IAAKhgC,EAAK8d,SAAW/d,EAAO+d,SAAS,SAAUW,GACpDjB,WAAWqjB,EAAQpiC,KAAKggB,GAAS,GAAOuhB,SAQxC,SAAU1hC,EAAQD,EAASF,GAEjC,IAAIurB,EAAOvrB,EAAoB,KAC3BkC,EAAUlC,EAAoB,GAGlCA,EAAoB,IAAI2T,EAAI4X,EAAK5X,EAAI4X,EAAK5X,GAAK,GAE/CzR,EAAQA,EAAQa,EAAIb,EAAQO,EAAG,WAAY,CAAEoiB,KAAM7kB,EAAoB,QAKjE,SAAUG,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAIX,EAAQO,EAAG,SAAU,CAAEwB,SAAUjE,EAAoB,MAKnE,SAAUG,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAElCkC,EAAQA,EAAQW,EAAIX,EAAQO,EAAG,SAAU,CAAE8G,QAASvJ,EAAoB,OAKlE,SAAUG,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B0rB,EAAS1rB,EAAoB,KAEjCkC,EAAQA,EAAQW,EAAIX,EAAQO,EAAG,SAAU,CAAEipB,OAAQA,KAK7C,SAAUvrB,EAAQD,EAASF,GAEjC,IAAIkC,EAAUlC,EAAoB,GAC9B0rB,EAAS1rB,EAAoB,KAC7BgI,EAAShI,EAAoB,IAEjCkC,EAAQA,EAAQW,EAAIX,EAAQO,EAAG,SAAU,CACvCmgC,KAAM,SAAUrzB,EAAOoc,GACrB,OAAOD,EAAO1jB,EAAOuH,GAAQoc,OAO3B,SAAUxrB,EAAQD,EAASF,GAIjCA,EAAoB,GAApBA,CAAwBkwB,OAAQ,SAAU,SAAU7S,GAClD5Z,KAAKkkB,IAAMtK,EACX5Z,KAAK6Z,GAAK,GACT,WACD,IAAIld,EAAIqD,KAAK6Z,KACTpO,IAAS9O,EAAIqD,KAAKkkB,IACtB,MAAO,CAAEzY,KAAMA,EAAM5J,MAAO4J,EAAOrP,GAAYO,MAM3C,SAAUD,EAAQD,EAASF,GAGjC,IAAIkC,EAAUlC,EAAoB,GAC9B6iC,EAAM7iC,EAAoB,GAApBA,CAAwB,sBAAuB,QAEzDkC,EAAQA,EAAQW,EAAG,SAAU,CAAEigC,OAAQ,SAASA,OAAO5+B,GAAM,OAAO2+B,EAAI3+B,OAKlE,SAAU/D,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B6iC,EAAM7iC,EAAoB,GAApBA,CAAwB,WAAY,CAC5C+iC,IAAK,QACLC,IAAK,OACLC,IAAK,OACLC,IAAK,SACLC,IAAK,WAGPjhC,EAAQA,EAAQa,EAAIb,EAAQO,EAAG,SAAU,CAAE2gC,WAAY,SAASA,aAAe,OAAOP,EAAIp/B,UAKpF,SAAUtD,EAAQD,EAASF,GAIjC,IAAIkC,EAAUlC,EAAoB,GAC9B6iC,EAAM7iC,EAAoB,GAApBA,CAAwB,6BAA8B,CAC9DqjC,QAAS,IACTC,OAAQ,IACRC,OAAQ,IACRC,SAAU,IACVC,SAAU,MAGZvhC,EAAQA,EAAQa,EAAIb,EAAQO,EAAG,SAAU,CAAEihC,aAAc,SAASA,eAAiB,OAAOb,EAAIp/B,YAMzE,oBAAVtD,QAAyBA,OAAOD,QAASC,OAAOD,QAAUP,EAE3C,mBAAV+rB,QAAwBA,OAAOiY,IAAKjY,OAAO,WAAc,OAAO/rB,IAE3EC,EAAIiC,KAAOlC,EAz7Pf,CA07PC,EAAG","file":"library.min.js"} \ No newline at end of file diff --git a/node_modules/core-js/client/shim.js b/node_modules/core-js/client/shim.js deleted file mode 100644 index 0fd6a20e2..000000000 --- a/node_modules/core-js/client/shim.js +++ /dev/null @@ -1,8213 +0,0 @@ -/** - * core-js 2.5.7 - * https://github.com/zloirock/core-js - * License: http://rock.mit-license.org - * © 2018 Denis Pushkarev - */ -!function(__e, __g, undefined){ -'use strict'; -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 124); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(2); -var core = __webpack_require__(26); -var hide = __webpack_require__(11); -var redefine = __webpack_require__(12); -var ctx = __webpack_require__(18); -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 target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; - var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); - var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); - var key, own, out, exp; - if (IS_GLOBAL) source = name; - for (key in source) { - // contains in native - own = !IS_FORCED && target && target[key] !== undefined; - // export native or passed - out = (own ? target : source)[key]; - // bind timers to global for call from export context - exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; - // extend global - if (target) redefine(target, key, out, type & $export.U); - // export - if (exports[key] != out) hide(exports, key, exp); - if (IS_PROTO && expProto[key] != out) expProto[key] = out; - } -}; -global.core = core; -// 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; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(4); -module.exports = function (it) { - if (!isObject(it)) throw TypeError(it + ' is not an object!'); - return it; -}; - - -/***/ }), -/* 2 */ -/***/ (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 - - -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - -module.exports = function (exec) { - try { - return !!exec(); - } catch (e) { - return true; - } -}; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - -module.exports = function (it) { - return typeof it === 'object' ? it !== null : typeof it === 'function'; -}; - - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -var store = __webpack_require__(49)('wks'); -var uid = __webpack_require__(33); -var Symbol = __webpack_require__(2).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; - - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -// Thank's IE8 for his funny defineProperty -module.exports = !__webpack_require__(3)(function () { - return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; -}); - - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -var anObject = __webpack_require__(1); -var IE8_DOM_DEFINE = __webpack_require__(90); -var toPrimitive = __webpack_require__(21); -var dP = Object.defineProperty; - -exports.f = __webpack_require__(6) ? 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; -}; - - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.15 ToLength -var toInteger = __webpack_require__(23); -var min = Math.min; -module.exports = function (it) { - return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 -}; - - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.13 ToObject(argument) -var defined = __webpack_require__(22); -module.exports = function (it) { - return Object(defined(it)); -}; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports) { - -module.exports = function (it) { - if (typeof it != 'function') throw TypeError(it + ' is not a function!'); - return it; -}; - - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -var dP = __webpack_require__(7); -var createDesc = __webpack_require__(32); -module.exports = __webpack_require__(6) ? function (object, key, value) { - return dP.f(object, key, createDesc(1, value)); -} : function (object, key, value) { - object[key] = value; - return object; -}; - - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(2); -var hide = __webpack_require__(11); -var has = __webpack_require__(14); -var SRC = __webpack_require__(33)('src'); -var TO_STRING = 'toString'; -var $toString = Function[TO_STRING]; -var TPL = ('' + $toString).split(TO_STRING); - -__webpack_require__(26).inspectSource = function (it) { - return $toString.call(it); -}; - -(module.exports = function (O, key, val, safe) { - var isFunction = typeof val == 'function'; - if (isFunction) has(val, 'name') || hide(val, 'name', key); - if (O[key] === val) return; - if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); - if (O === global) { - O[key] = val; - } else if (!safe) { - delete O[key]; - hide(O, key, val); - } else if (O[key]) { - O[key] = val; - } else { - hide(O, key, val); - } -// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative -})(Function.prototype, TO_STRING, function toString() { - return typeof this == 'function' && this[SRC] || $toString.call(this); -}); - - -/***/ }), -/* 13 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var fails = __webpack_require__(3); -var defined = __webpack_require__(22); -var quot = /"/g; -// B.2.3.2.1 CreateHTML(string, tag, attribute, value) -var createHTML = function (string, tag, attribute, value) { - var S = String(defined(string)); - var p1 = '<' + tag; - if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; - return p1 + '>' + S + ''; -}; -module.exports = function (NAME, exec) { - var O = {}; - O[NAME] = exec(createHTML); - $export($export.P + $export.F * fails(function () { - var test = ''[NAME]('"'); - return test !== test.toLowerCase() || test.split('"').length > 3; - }), 'String', O); -}; - - -/***/ }), -/* 14 */ -/***/ (function(module, exports) { - -var hasOwnProperty = {}.hasOwnProperty; -module.exports = function (it, key) { - return hasOwnProperty.call(it, key); -}; - - -/***/ }), -/* 15 */ -/***/ (function(module, exports, __webpack_require__) { - -// to indexed object, toObject with fallback for non-array-like ES3 strings -var IObject = __webpack_require__(46); -var defined = __webpack_require__(22); -module.exports = function (it) { - return IObject(defined(it)); -}; - - -/***/ }), -/* 16 */ -/***/ (function(module, exports, __webpack_require__) { - -var pIE = __webpack_require__(47); -var createDesc = __webpack_require__(32); -var toIObject = __webpack_require__(15); -var toPrimitive = __webpack_require__(21); -var has = __webpack_require__(14); -var IE8_DOM_DEFINE = __webpack_require__(90); -var gOPD = Object.getOwnPropertyDescriptor; - -exports.f = __webpack_require__(6) ? 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]); -}; - - -/***/ }), -/* 17 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) -var has = __webpack_require__(14); -var toObject = __webpack_require__(9); -var IE_PROTO = __webpack_require__(66)('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; -}; - - -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { - -// optional / simple context binding -var aFunction = __webpack_require__(10); -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); - }; -}; - - -/***/ }), -/* 19 */ -/***/ (function(module, exports) { - -var toString = {}.toString; - -module.exports = function (it) { - return toString.call(it).slice(8, -1); -}; - - -/***/ }), -/* 20 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var fails = __webpack_require__(3); - -module.exports = function (method, arg) { - return !!method && fails(function () { - // eslint-disable-next-line no-useless-call - arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null); - }); -}; - - -/***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.1 ToPrimitive(input [, PreferredType]) -var isObject = __webpack_require__(4); -// 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"); -}; - - -/***/ }), -/* 22 */ -/***/ (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; -}; - - -/***/ }), -/* 23 */ -/***/ (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); -}; - - -/***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { - -// most Object methods by ES6 should accept primitives -var $export = __webpack_require__(0); -var core = __webpack_require__(26); -var fails = __webpack_require__(3); -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); -}; - - -/***/ }), -/* 25 */ -/***/ (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__(18); -var IObject = __webpack_require__(46); -var toObject = __webpack_require__(9); -var toLength = __webpack_require__(8); -var asc = __webpack_require__(83); -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; - }; -}; - - -/***/ }), -/* 26 */ -/***/ (function(module, exports) { - -var core = module.exports = { version: '2.5.7' }; -if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef - - -/***/ }), -/* 27 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -if (__webpack_require__(6)) { - var LIBRARY = __webpack_require__(30); - var global = __webpack_require__(2); - var fails = __webpack_require__(3); - var $export = __webpack_require__(0); - var $typed = __webpack_require__(60); - var $buffer = __webpack_require__(89); - var ctx = __webpack_require__(18); - var anInstance = __webpack_require__(39); - var propertyDesc = __webpack_require__(32); - var hide = __webpack_require__(11); - var redefineAll = __webpack_require__(41); - var toInteger = __webpack_require__(23); - var toLength = __webpack_require__(8); - var toIndex = __webpack_require__(117); - var toAbsoluteIndex = __webpack_require__(35); - var toPrimitive = __webpack_require__(21); - var has = __webpack_require__(14); - var classof = __webpack_require__(48); - var isObject = __webpack_require__(4); - var toObject = __webpack_require__(9); - var isArrayIter = __webpack_require__(80); - var create = __webpack_require__(36); - var getPrototypeOf = __webpack_require__(17); - var gOPN = __webpack_require__(37).f; - var getIterFn = __webpack_require__(82); - var uid = __webpack_require__(33); - var wks = __webpack_require__(5); - var createArrayMethod = __webpack_require__(25); - var createArrayIncludes = __webpack_require__(50); - var speciesConstructor = __webpack_require__(57); - var ArrayIterators = __webpack_require__(85); - var Iterators = __webpack_require__(44); - var $iterDetect = __webpack_require__(54); - var setSpecies = __webpack_require__(38); - var arrayFill = __webpack_require__(84); - var arrayCopyWithin = __webpack_require__(106); - var $DP = __webpack_require__(7); - var $GOPD = __webpack_require__(16); - var dP = $DP.f; - var gOPD = $GOPD.f; - var RangeError = global.RangeError; - var TypeError = global.TypeError; - var Uint8Array = global.Uint8Array; - var ARRAY_BUFFER = 'ArrayBuffer'; - var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER; - var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; - var PROTOTYPE = 'prototype'; - var ArrayProto = Array[PROTOTYPE]; - var $ArrayBuffer = $buffer.ArrayBuffer; - var $DataView = $buffer.DataView; - var arrayForEach = createArrayMethod(0); - var arrayFilter = createArrayMethod(2); - var arraySome = createArrayMethod(3); - var arrayEvery = createArrayMethod(4); - var arrayFind = createArrayMethod(5); - var arrayFindIndex = createArrayMethod(6); - var arrayIncludes = createArrayIncludes(true); - var arrayIndexOf = createArrayIncludes(false); - var arrayValues = ArrayIterators.values; - var arrayKeys = ArrayIterators.keys; - var arrayEntries = ArrayIterators.entries; - var arrayLastIndexOf = ArrayProto.lastIndexOf; - var arrayReduce = ArrayProto.reduce; - var arrayReduceRight = ArrayProto.reduceRight; - var arrayJoin = ArrayProto.join; - var arraySort = ArrayProto.sort; - var arraySlice = ArrayProto.slice; - var arrayToString = ArrayProto.toString; - var arrayToLocaleString = ArrayProto.toLocaleString; - var ITERATOR = wks('iterator'); - var TAG = wks('toStringTag'); - var TYPED_CONSTRUCTOR = uid('typed_constructor'); - var DEF_CONSTRUCTOR = uid('def_constructor'); - var ALL_CONSTRUCTORS = $typed.CONSTR; - var TYPED_ARRAY = $typed.TYPED; - var VIEW = $typed.VIEW; - var WRONG_LENGTH = 'Wrong length!'; - - var $map = createArrayMethod(1, function (O, length) { - return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); - }); - - var LITTLE_ENDIAN = fails(function () { - // eslint-disable-next-line no-undef - return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; - }); - - var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () { - new Uint8Array(1).set({}); - }); - - var toOffset = function (it, BYTES) { - var offset = toInteger(it); - if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!'); - return offset; - }; - - var validate = function (it) { - if (isObject(it) && TYPED_ARRAY in it) return it; - throw TypeError(it + ' is not a typed array!'); - }; - - var allocate = function (C, length) { - if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) { - throw TypeError('It is not a typed array constructor!'); - } return new C(length); - }; - - var speciesFromList = function (O, list) { - return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); - }; - - var fromList = function (C, list) { - var index = 0; - var length = list.length; - var result = allocate(C, length); - while (length > index) result[index] = list[index++]; - return result; - }; - - var addGetter = function (it, key, internal) { - dP(it, key, { get: function () { return this._d[internal]; } }); - }; - - var $from = function from(source /* , mapfn, thisArg */) { - var O = toObject(source); - var aLen = arguments.length; - var mapfn = aLen > 1 ? arguments[1] : undefined; - var mapping = mapfn !== undefined; - var iterFn = getIterFn(O); - var i, length, values, result, step, iterator; - if (iterFn != undefined && !isArrayIter(iterFn)) { - for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) { - values.push(step.value); - } O = values; - } - if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2); - for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) { - result[i] = mapping ? mapfn(O[i], i) : O[i]; - } - return result; - }; - - var $of = function of(/* ...items */) { - var index = 0; - var length = arguments.length; - var result = allocate(this, length); - while (length > index) result[index] = arguments[index++]; - return result; - }; - - // iOS Safari 6.x fails here - var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); }); - - var $toLocaleString = function toLocaleString() { - return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); - }; - - var proto = { - copyWithin: function copyWithin(target, start /* , end */) { - return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); - }, - every: function every(callbackfn /* , thisArg */) { - return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }, - fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars - return arrayFill.apply(validate(this), arguments); - }, - filter: function filter(callbackfn /* , thisArg */) { - return speciesFromList(this, arrayFilter(validate(this), callbackfn, - arguments.length > 1 ? arguments[1] : undefined)); - }, - find: function find(predicate /* , thisArg */) { - return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); - }, - findIndex: function findIndex(predicate /* , thisArg */) { - return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); - }, - forEach: function forEach(callbackfn /* , thisArg */) { - arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }, - indexOf: function indexOf(searchElement /* , fromIndex */) { - return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); - }, - includes: function includes(searchElement /* , fromIndex */) { - return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); - }, - join: function join(separator) { // eslint-disable-line no-unused-vars - return arrayJoin.apply(validate(this), arguments); - }, - lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars - return arrayLastIndexOf.apply(validate(this), arguments); - }, - map: function map(mapfn /* , thisArg */) { - return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); - }, - reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars - return arrayReduce.apply(validate(this), arguments); - }, - reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars - return arrayReduceRight.apply(validate(this), arguments); - }, - reverse: function reverse() { - var that = this; - var length = validate(that).length; - var middle = Math.floor(length / 2); - var index = 0; - var value; - while (index < middle) { - value = that[index]; - that[index++] = that[--length]; - that[length] = value; - } return that; - }, - some: function some(callbackfn /* , thisArg */) { - return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }, - sort: function sort(comparefn) { - return arraySort.call(validate(this), comparefn); - }, - subarray: function subarray(begin, end) { - var O = validate(this); - var length = O.length; - var $begin = toAbsoluteIndex(begin, length); - return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( - O.buffer, - O.byteOffset + $begin * O.BYTES_PER_ELEMENT, - toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin) - ); - } - }; - - var $slice = function slice(start, end) { - return speciesFromList(this, arraySlice.call(validate(this), start, end)); - }; - - var $set = function set(arrayLike /* , offset */) { - validate(this); - var offset = toOffset(arguments[1], 1); - var length = this.length; - var src = toObject(arrayLike); - var len = toLength(src.length); - var index = 0; - if (len + offset > length) throw RangeError(WRONG_LENGTH); - while (index < len) this[offset + index] = src[index++]; - }; - - var $iterators = { - entries: function entries() { - return arrayEntries.call(validate(this)); - }, - keys: function keys() { - return arrayKeys.call(validate(this)); - }, - values: function values() { - return arrayValues.call(validate(this)); - } - }; - - var isTAIndex = function (target, key) { - return isObject(target) - && target[TYPED_ARRAY] - && typeof key != 'symbol' - && key in target - && String(+key) == String(key); - }; - var $getDesc = function getOwnPropertyDescriptor(target, key) { - return isTAIndex(target, key = toPrimitive(key, true)) - ? propertyDesc(2, target[key]) - : gOPD(target, key); - }; - var $setDesc = function defineProperty(target, key, desc) { - if (isTAIndex(target, key = toPrimitive(key, true)) - && isObject(desc) - && has(desc, 'value') - && !has(desc, 'get') - && !has(desc, 'set') - // TODO: add validation descriptor w/o calling accessors - && !desc.configurable - && (!has(desc, 'writable') || desc.writable) - && (!has(desc, 'enumerable') || desc.enumerable) - ) { - target[key] = desc.value; - return target; - } return dP(target, key, desc); - }; - - if (!ALL_CONSTRUCTORS) { - $GOPD.f = $getDesc; - $DP.f = $setDesc; - } - - $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { - getOwnPropertyDescriptor: $getDesc, - defineProperty: $setDesc - }); - - if (fails(function () { arrayToString.call({}); })) { - arrayToString = arrayToLocaleString = function toString() { - return arrayJoin.call(this); - }; - } - - var $TypedArrayPrototype$ = redefineAll({}, proto); - redefineAll($TypedArrayPrototype$, $iterators); - hide($TypedArrayPrototype$, ITERATOR, $iterators.values); - redefineAll($TypedArrayPrototype$, { - slice: $slice, - set: $set, - constructor: function () { /* noop */ }, - toString: arrayToString, - toLocaleString: $toLocaleString - }); - addGetter($TypedArrayPrototype$, 'buffer', 'b'); - addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); - addGetter($TypedArrayPrototype$, 'byteLength', 'l'); - addGetter($TypedArrayPrototype$, 'length', 'e'); - dP($TypedArrayPrototype$, TAG, { - get: function () { return this[TYPED_ARRAY]; } - }); - - // eslint-disable-next-line max-statements - module.exports = function (KEY, BYTES, wrapper, CLAMPED) { - CLAMPED = !!CLAMPED; - var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'; - var GETTER = 'get' + KEY; - var SETTER = 'set' + KEY; - var TypedArray = global[NAME]; - var Base = TypedArray || {}; - var TAC = TypedArray && getPrototypeOf(TypedArray); - var FORCED = !TypedArray || !$typed.ABV; - var O = {}; - var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; - var getter = function (that, index) { - var data = that._d; - return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); - }; - var setter = function (that, index, value) { - var data = that._d; - if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; - data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); - }; - var addElement = function (that, index) { - dP(that, index, { - get: function () { - return getter(this, index); - }, - set: function (value) { - return setter(this, index, value); - }, - enumerable: true - }); - }; - if (FORCED) { - TypedArray = wrapper(function (that, data, $offset, $length) { - anInstance(that, TypedArray, NAME, '_d'); - var index = 0; - var offset = 0; - var buffer, byteLength, length, klass; - if (!isObject(data)) { - length = toIndex(data); - byteLength = length * BYTES; - buffer = new $ArrayBuffer(byteLength); - } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { - buffer = data; - offset = toOffset($offset, BYTES); - var $len = data.byteLength; - if ($length === undefined) { - if ($len % BYTES) throw RangeError(WRONG_LENGTH); - byteLength = $len - offset; - if (byteLength < 0) throw RangeError(WRONG_LENGTH); - } else { - byteLength = toLength($length) * BYTES; - if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH); - } - length = byteLength / BYTES; - } else if (TYPED_ARRAY in data) { - return fromList(TypedArray, data); - } else { - return $from.call(TypedArray, data); - } - hide(that, '_d', { - b: buffer, - o: offset, - l: byteLength, - e: length, - v: new $DataView(buffer) - }); - while (index < length) addElement(that, index++); - }); - TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); - hide(TypedArrayPrototype, 'constructor', TypedArray); - } else if (!fails(function () { - TypedArray(1); - }) || !fails(function () { - new TypedArray(-1); // eslint-disable-line no-new - }) || !$iterDetect(function (iter) { - new TypedArray(); // eslint-disable-line no-new - new TypedArray(null); // eslint-disable-line no-new - new TypedArray(1.5); // eslint-disable-line no-new - new TypedArray(iter); // eslint-disable-line no-new - }, true)) { - TypedArray = wrapper(function (that, data, $offset, $length) { - anInstance(that, TypedArray, NAME); - var klass; - // `ws` module bug, temporarily remove validation length for Uint8Array - // https://github.com/websockets/ws/pull/645 - if (!isObject(data)) return new Base(toIndex(data)); - if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { - return $length !== undefined - ? new Base(data, toOffset($offset, BYTES), $length) - : $offset !== undefined - ? new Base(data, toOffset($offset, BYTES)) - : new Base(data); - } - if (TYPED_ARRAY in data) return fromList(TypedArray, data); - return $from.call(TypedArray, data); - }); - arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) { - if (!(key in TypedArray)) hide(TypedArray, key, Base[key]); - }); - TypedArray[PROTOTYPE] = TypedArrayPrototype; - if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray; - } - var $nativeIterator = TypedArrayPrototype[ITERATOR]; - var CORRECT_ITER_NAME = !!$nativeIterator - && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined); - var $iterator = $iterators.values; - hide(TypedArray, TYPED_CONSTRUCTOR, true); - hide(TypedArrayPrototype, TYPED_ARRAY, NAME); - hide(TypedArrayPrototype, VIEW, true); - hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); - - if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) { - dP(TypedArrayPrototype, TAG, { - get: function () { return NAME; } - }); - } - - O[NAME] = TypedArray; - - $export($export.G + $export.W + $export.F * (TypedArray != Base), O); - - $export($export.S, NAME, { - BYTES_PER_ELEMENT: BYTES - }); - - $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, { - from: $from, - of: $of - }); - - if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); - - $export($export.P, NAME, proto); - - setSpecies(NAME); - - $export($export.P + $export.F * FORCED_SET, NAME, { set: $set }); - - $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); - - if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString; - - $export($export.P + $export.F * fails(function () { - new TypedArray(1).slice(); - }), NAME, { slice: $slice }); - - $export($export.P + $export.F * (fails(function () { - return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString(); - }) || !fails(function () { - TypedArrayPrototype.toLocaleString.call([1, 2]); - })), NAME, { toLocaleString: $toLocaleString }); - - Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; - if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator); - }; -} else module.exports = function () { /* empty */ }; - - -/***/ }), -/* 28 */ -/***/ (function(module, exports, __webpack_require__) { - -var Map = __webpack_require__(111); -var $export = __webpack_require__(0); -var shared = __webpack_require__(49)('metadata'); -var store = shared.store || (shared.store = new (__webpack_require__(114))()); - -var getOrCreateMetadataMap = function (target, targetKey, create) { - var targetMetadata = store.get(target); - if (!targetMetadata) { - if (!create) return undefined; - store.set(target, targetMetadata = new Map()); - } - var keyMetadata = targetMetadata.get(targetKey); - if (!keyMetadata) { - if (!create) return undefined; - targetMetadata.set(targetKey, keyMetadata = new Map()); - } return keyMetadata; -}; -var ordinaryHasOwnMetadata = function (MetadataKey, O, P) { - var metadataMap = getOrCreateMetadataMap(O, P, false); - return metadataMap === undefined ? false : metadataMap.has(MetadataKey); -}; -var ordinaryGetOwnMetadata = function (MetadataKey, O, P) { - var metadataMap = getOrCreateMetadataMap(O, P, false); - return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); -}; -var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) { - getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); -}; -var ordinaryOwnMetadataKeys = function (target, targetKey) { - var metadataMap = getOrCreateMetadataMap(target, targetKey, false); - var keys = []; - if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); }); - return keys; -}; -var toMetaKey = function (it) { - return it === undefined || typeof it == 'symbol' ? it : String(it); -}; -var exp = function (O) { - $export($export.S, 'Reflect', O); -}; - -module.exports = { - store: store, - map: getOrCreateMetadataMap, - has: ordinaryHasOwnMetadata, - get: ordinaryGetOwnMetadata, - set: ordinaryDefineOwnMetadata, - keys: ordinaryOwnMetadataKeys, - key: toMetaKey, - exp: exp -}; - - -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { - -var META = __webpack_require__(33)('meta'); -var isObject = __webpack_require__(4); -var has = __webpack_require__(14); -var setDesc = __webpack_require__(7).f; -var id = 0; -var isExtensible = Object.isExtensible || function () { - return true; -}; -var FREEZE = !__webpack_require__(3)(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 -}; - - -/***/ }), -/* 30 */ -/***/ (function(module, exports) { - -module.exports = false; - - -/***/ }), -/* 31 */ -/***/ (function(module, exports, __webpack_require__) { - -// 22.1.3.31 Array.prototype[@@unscopables] -var UNSCOPABLES = __webpack_require__(5)('unscopables'); -var ArrayProto = Array.prototype; -if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(11)(ArrayProto, UNSCOPABLES, {}); -module.exports = function (key) { - ArrayProto[UNSCOPABLES][key] = true; -}; - - -/***/ }), -/* 32 */ -/***/ (function(module, exports) { - -module.exports = function (bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value: value - }; -}; - - -/***/ }), -/* 33 */ -/***/ (function(module, exports) { - -var id = 0; -var px = Math.random(); -module.exports = function (key) { - return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); -}; - - -/***/ }), -/* 34 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.14 / 15.2.3.14 Object.keys(O) -var $keys = __webpack_require__(92); -var enumBugKeys = __webpack_require__(67); - -module.exports = Object.keys || function keys(O) { - return $keys(O, enumBugKeys); -}; - - -/***/ }), -/* 35 */ -/***/ (function(module, exports, __webpack_require__) { - -var toInteger = __webpack_require__(23); -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); -}; - - -/***/ }), -/* 36 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -var anObject = __webpack_require__(1); -var dPs = __webpack_require__(93); -var enumBugKeys = __webpack_require__(67); -var IE_PROTO = __webpack_require__(66)('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__(64)('iframe'); - var i = enumBugKeys.length; - var lt = '<'; - var gt = '>'; - var iframeDocument; - iframe.style.display = 'none'; - __webpack_require__(68).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); -}; - - -/***/ }), -/* 37 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) -var $keys = __webpack_require__(92); -var hiddenKeys = __webpack_require__(67).concat('length', 'prototype'); - -exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { - return $keys(O, hiddenKeys); -}; - - -/***/ }), -/* 38 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var global = __webpack_require__(2); -var dP = __webpack_require__(7); -var DESCRIPTORS = __webpack_require__(6); -var SPECIES = __webpack_require__(5)('species'); - -module.exports = function (KEY) { - var C = global[KEY]; - if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { - configurable: true, - get: function () { return this; } - }); -}; - - -/***/ }), -/* 39 */ -/***/ (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; -}; - - -/***/ }), -/* 40 */ -/***/ (function(module, exports, __webpack_require__) { - -var ctx = __webpack_require__(18); -var call = __webpack_require__(104); -var isArrayIter = __webpack_require__(80); -var anObject = __webpack_require__(1); -var toLength = __webpack_require__(8); -var getIterFn = __webpack_require__(82); -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; - - -/***/ }), -/* 41 */ -/***/ (function(module, exports, __webpack_require__) { - -var redefine = __webpack_require__(12); -module.exports = function (target, src, safe) { - for (var key in src) redefine(target, key, src[key], safe); - return target; -}; - - -/***/ }), -/* 42 */ -/***/ (function(module, exports, __webpack_require__) { - -var def = __webpack_require__(7).f; -var has = __webpack_require__(14); -var TAG = __webpack_require__(5)('toStringTag'); - -module.exports = function (it, tag, stat) { - if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); -}; - - -/***/ }), -/* 43 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var defined = __webpack_require__(22); -var fails = __webpack_require__(3); -var spaces = __webpack_require__(71); -var space = '[' + spaces + ']'; -var non = '\u200b\u0085'; -var ltrim = RegExp('^' + space + space + '*'); -var rtrim = RegExp(space + space + '*$'); - -var exporter = function (KEY, exec, ALIAS) { - var exp = {}; - var FORCE = fails(function () { - return !!spaces[KEY]() || non[KEY]() != non; - }); - var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; - if (ALIAS) exp[ALIAS] = fn; - $export($export.P + $export.F * FORCE, 'String', exp); -}; - -// 1 -> String#trimLeft -// 2 -> String#trimRight -// 3 -> String#trim -var trim = exporter.trim = function (string, TYPE) { - string = String(defined(string)); - if (TYPE & 1) string = string.replace(ltrim, ''); - if (TYPE & 2) string = string.replace(rtrim, ''); - return string; -}; - -module.exports = exporter; - - -/***/ }), -/* 44 */ -/***/ (function(module, exports) { - -module.exports = {}; - - -/***/ }), -/* 45 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(4); -module.exports = function (it, TYPE) { - if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); - return it; -}; - - -/***/ }), -/* 46 */ -/***/ (function(module, exports, __webpack_require__) { - -// fallback for non-array-like ES3 and non-enumerable old V8 strings -var cof = __webpack_require__(19); -// eslint-disable-next-line no-prototype-builtins -module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { - return cof(it) == 'String' ? it.split('') : Object(it); -}; - - -/***/ }), -/* 47 */ -/***/ (function(module, exports) { - -exports.f = {}.propertyIsEnumerable; - - -/***/ }), -/* 48 */ -/***/ (function(module, exports, __webpack_require__) { - -// getting tag from 19.1.3.6 Object.prototype.toString() -var cof = __webpack_require__(19); -var TAG = __webpack_require__(5)('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; -}; - - -/***/ }), -/* 49 */ -/***/ (function(module, exports, __webpack_require__) { - -var core = __webpack_require__(26); -var global = __webpack_require__(2); -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__(30) ? 'pure' : 'global', - copyright: '© 2018 Denis Pushkarev (zloirock.ru)' -}); - - -/***/ }), -/* 50 */ -/***/ (function(module, exports, __webpack_require__) { - -// false -> Array#indexOf -// true -> Array#includes -var toIObject = __webpack_require__(15); -var toLength = __webpack_require__(8); -var toAbsoluteIndex = __webpack_require__(35); -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; - }; -}; - - -/***/ }), -/* 51 */ -/***/ (function(module, exports) { - -exports.f = Object.getOwnPropertySymbols; - - -/***/ }), -/* 52 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.2.2 IsArray(argument) -var cof = __webpack_require__(19); -module.exports = Array.isArray || function isArray(arg) { - return cof(arg) == 'Array'; -}; - - -/***/ }), -/* 53 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.2.8 IsRegExp(argument) -var isObject = __webpack_require__(4); -var cof = __webpack_require__(19); -var MATCH = __webpack_require__(5)('match'); -module.exports = function (it) { - var isRegExp; - return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); -}; - - -/***/ }), -/* 54 */ -/***/ (function(module, exports, __webpack_require__) { - -var ITERATOR = __webpack_require__(5)('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; -}; - - -/***/ }), -/* 55 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 21.2.5.3 get RegExp.prototype.flags -var anObject = __webpack_require__(1); -module.exports = function () { - var that = anObject(this); - var result = ''; - if (that.global) result += 'g'; - if (that.ignoreCase) result += 'i'; - if (that.multiline) result += 'm'; - if (that.unicode) result += 'u'; - if (that.sticky) result += 'y'; - return result; -}; - - -/***/ }), -/* 56 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var hide = __webpack_require__(11); -var redefine = __webpack_require__(12); -var fails = __webpack_require__(3); -var defined = __webpack_require__(22); -var wks = __webpack_require__(5); - -module.exports = function (KEY, length, exec) { - var SYMBOL = wks(KEY); - var fns = exec(defined, SYMBOL, ''[KEY]); - var strfn = fns[0]; - var rxfn = fns[1]; - if (fails(function () { - var O = {}; - O[SYMBOL] = function () { return 7; }; - return ''[KEY](O) != 7; - })) { - redefine(String.prototype, KEY, strfn); - hide(RegExp.prototype, SYMBOL, length == 2 - // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) - // 21.2.5.11 RegExp.prototype[@@split](string, limit) - ? function (string, arg) { return rxfn.call(string, this, arg); } - // 21.2.5.6 RegExp.prototype[@@match](string) - // 21.2.5.9 RegExp.prototype[@@search](string) - : function (string) { return rxfn.call(string, this); } - ); - } -}; - - -/***/ }), -/* 57 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.3.20 SpeciesConstructor(O, defaultConstructor) -var anObject = __webpack_require__(1); -var aFunction = __webpack_require__(10); -var SPECIES = __webpack_require__(5)('species'); -module.exports = function (O, D) { - var C = anObject(O).constructor; - var S; - return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); -}; - - -/***/ }), -/* 58 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(2); -var navigator = global.navigator; - -module.exports = navigator && navigator.userAgent || ''; - - -/***/ }), -/* 59 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var global = __webpack_require__(2); -var $export = __webpack_require__(0); -var redefine = __webpack_require__(12); -var redefineAll = __webpack_require__(41); -var meta = __webpack_require__(29); -var forOf = __webpack_require__(40); -var anInstance = __webpack_require__(39); -var isObject = __webpack_require__(4); -var fails = __webpack_require__(3); -var $iterDetect = __webpack_require__(54); -var setToStringTag = __webpack_require__(42); -var inheritIfRequired = __webpack_require__(70); - -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 = {}; - var fixMethod = function (KEY) { - var fn = proto[KEY]; - redefine(proto, KEY, - KEY == 'delete' ? function (a) { - return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); - } : KEY == 'has' ? function has(a) { - return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); - } : KEY == 'get' ? function get(a) { - return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); - } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; } - : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; } - ); - }; - if (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 { - var instance = new C(); - // early implementations not supports chaining - var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; - // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false - var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); - // most early implementations doesn't supports iterables, most modern - not close it correctly - var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new - // for early implementations -0 and +0 not the same - var BUGGY_ZERO = !IS_WEAK && fails(function () { - // V8 ~ Chromium 42- fails only with 5+ elements - var $instance = new C(); - var index = 5; - while (index--) $instance[ADDER](index, index); - return !$instance.has(-0); - }); - if (!ACCEPT_ITERABLES) { - C = wrapper(function (target, iterable) { - anInstance(target, C, NAME); - var that = inheritIfRequired(new Base(), target, C); - if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); - return that; - }); - C.prototype = proto; - proto.constructor = C; - } - if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { - fixMethod('delete'); - fixMethod('has'); - IS_MAP && fixMethod('get'); - } - if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); - // weak collections should not contains .clear method - if (IS_WEAK && proto.clear) delete proto.clear; - } - - setToStringTag(C, NAME); - - O[NAME] = C; - $export($export.G + $export.W + $export.F * (C != Base), O); - - if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); - - return C; -}; - - -/***/ }), -/* 60 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(2); -var hide = __webpack_require__(11); -var uid = __webpack_require__(33); -var TYPED = uid('typed_array'); -var VIEW = uid('view'); -var ABV = !!(global.ArrayBuffer && global.DataView); -var CONSTR = ABV; -var i = 0; -var l = 9; -var Typed; - -var TypedArrayConstructors = ( - 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' -).split(','); - -while (i < l) { - if (Typed = global[TypedArrayConstructors[i++]]) { - hide(Typed.prototype, TYPED, true); - hide(Typed.prototype, VIEW, true); - } else CONSTR = false; -} - -module.exports = { - ABV: ABV, - CONSTR: CONSTR, - TYPED: TYPED, - VIEW: VIEW -}; - - -/***/ }), -/* 61 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// Forced replacement prototype accessors methods -module.exports = __webpack_require__(30) || !__webpack_require__(3)(function () { - var K = Math.random(); - // In FF throws only define methods - // eslint-disable-next-line no-undef, no-useless-call - __defineSetter__.call(null, K, function () { /* empty */ }); - delete __webpack_require__(2)[K]; -}); - - -/***/ }), -/* 62 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://tc39.github.io/proposal-setmap-offrom/ -var $export = __webpack_require__(0); - -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); - } }); -}; - - -/***/ }), -/* 63 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://tc39.github.io/proposal-setmap-offrom/ -var $export = __webpack_require__(0); -var aFunction = __webpack_require__(10); -var ctx = __webpack_require__(18); -var forOf = __webpack_require__(40); - -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); - } }); -}; - - -/***/ }), -/* 64 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(4); -var document = __webpack_require__(2).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) : {}; -}; - - -/***/ }), -/* 65 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(2); -var core = __webpack_require__(26); -var LIBRARY = __webpack_require__(30); -var wksExt = __webpack_require__(91); -var defineProperty = __webpack_require__(7).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) }); -}; - - -/***/ }), -/* 66 */ -/***/ (function(module, exports, __webpack_require__) { - -var shared = __webpack_require__(49)('keys'); -var uid = __webpack_require__(33); -module.exports = function (key) { - return shared[key] || (shared[key] = uid(key)); -}; - - -/***/ }), -/* 67 */ -/***/ (function(module, exports) { - -// IE 8- don't enum bug keys -module.exports = ( - 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' -).split(','); - - -/***/ }), -/* 68 */ -/***/ (function(module, exports, __webpack_require__) { - -var document = __webpack_require__(2).document; -module.exports = document && document.documentElement; - - -/***/ }), -/* 69 */ -/***/ (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__(4); -var anObject = __webpack_require__(1); -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__(18)(Function.call, __webpack_require__(16).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 -}; - - -/***/ }), -/* 70 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(4); -var setPrototypeOf = __webpack_require__(69).set; -module.exports = function (that, target, C) { - var S = target.constructor; - var P; - if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { - setPrototypeOf(that, P); - } return that; -}; - - -/***/ }), -/* 71 */ -/***/ (function(module, exports) { - -module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + - '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; - - -/***/ }), -/* 72 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var toInteger = __webpack_require__(23); -var defined = __webpack_require__(22); - -module.exports = function repeat(count) { - var str = String(defined(this)); - var res = ''; - var n = toInteger(count); - if (n < 0 || n == Infinity) throw RangeError("Count can't be negative"); - for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str; - return res; -}; - - -/***/ }), -/* 73 */ -/***/ (function(module, exports) { - -// 20.2.2.28 Math.sign(x) -module.exports = Math.sign || function sign(x) { - // eslint-disable-next-line no-self-compare - return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; -}; - - -/***/ }), -/* 74 */ -/***/ (function(module, exports) { - -// 20.2.2.14 Math.expm1(x) -var $expm1 = Math.expm1; -module.exports = (!$expm1 - // Old FF bug - || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 - // Tor Browser bug - || $expm1(-2e-17) != -2e-17 -) ? function expm1(x) { - return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; -} : $expm1; - - -/***/ }), -/* 75 */ -/***/ (function(module, exports, __webpack_require__) { - -var toInteger = __webpack_require__(23); -var defined = __webpack_require__(22); -// 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; - }; -}; - - -/***/ }), -/* 76 */ -/***/ (function(module, exports, __webpack_require__) { - -// helper for String#{startsWith, endsWith, includes} -var isRegExp = __webpack_require__(53); -var defined = __webpack_require__(22); - -module.exports = function (that, searchString, NAME) { - if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); - return String(defined(that)); -}; - - -/***/ }), -/* 77 */ -/***/ (function(module, exports, __webpack_require__) { - -var MATCH = __webpack_require__(5)('match'); -module.exports = function (KEY) { - var re = /./; - try { - '/./'[KEY](re); - } catch (e) { - try { - re[MATCH] = false; - return !'/./'[KEY](re); - } catch (f) { /* empty */ } - } return true; -}; - - -/***/ }), -/* 78 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var LIBRARY = __webpack_require__(30); -var $export = __webpack_require__(0); -var redefine = __webpack_require__(12); -var hide = __webpack_require__(11); -var Iterators = __webpack_require__(44); -var $iterCreate = __webpack_require__(79); -var setToStringTag = __webpack_require__(42); -var getPrototypeOf = __webpack_require__(17); -var ITERATOR = __webpack_require__(5)('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; -}; - - -/***/ }), -/* 79 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var create = __webpack_require__(36); -var descriptor = __webpack_require__(32); -var setToStringTag = __webpack_require__(42); -var IteratorPrototype = {}; - -// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() -__webpack_require__(11)(IteratorPrototype, __webpack_require__(5)('iterator'), function () { return this; }); - -module.exports = function (Constructor, NAME, next) { - Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); - setToStringTag(Constructor, NAME + ' Iterator'); -}; - - -/***/ }), -/* 80 */ -/***/ (function(module, exports, __webpack_require__) { - -// check on default Array iterator -var Iterators = __webpack_require__(44); -var ITERATOR = __webpack_require__(5)('iterator'); -var ArrayProto = Array.prototype; - -module.exports = function (it) { - return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); -}; - - -/***/ }), -/* 81 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $defineProperty = __webpack_require__(7); -var createDesc = __webpack_require__(32); - -module.exports = function (object, index, value) { - if (index in object) $defineProperty.f(object, index, createDesc(0, value)); - else object[index] = value; -}; - - -/***/ }), -/* 82 */ -/***/ (function(module, exports, __webpack_require__) { - -var classof = __webpack_require__(48); -var ITERATOR = __webpack_require__(5)('iterator'); -var Iterators = __webpack_require__(44); -module.exports = __webpack_require__(26).getIteratorMethod = function (it) { - if (it != undefined) return it[ITERATOR] - || it['@@iterator'] - || Iterators[classof(it)]; -}; - - -/***/ }), -/* 83 */ -/***/ (function(module, exports, __webpack_require__) { - -// 9.4.2.3 ArraySpeciesCreate(originalArray, length) -var speciesConstructor = __webpack_require__(208); - -module.exports = function (original, length) { - return new (speciesConstructor(original))(length); -}; - - -/***/ }), -/* 84 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) - -var toObject = __webpack_require__(9); -var toAbsoluteIndex = __webpack_require__(35); -var toLength = __webpack_require__(8); -module.exports = function fill(value /* , start = 0, end = @length */) { - var O = toObject(this); - var length = toLength(O.length); - var aLen = arguments.length; - var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); - var end = aLen > 2 ? arguments[2] : undefined; - var endPos = end === undefined ? length : toAbsoluteIndex(end, length); - while (endPos > index) O[index++] = value; - return O; -}; - - -/***/ }), -/* 85 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var addToUnscopables = __webpack_require__(31); -var step = __webpack_require__(107); -var Iterators = __webpack_require__(44); -var toIObject = __webpack_require__(15); - -// 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__(78)(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'); - - -/***/ }), -/* 86 */ -/***/ (function(module, exports, __webpack_require__) { - -var ctx = __webpack_require__(18); -var invoke = __webpack_require__(97); -var html = __webpack_require__(68); -var cel = __webpack_require__(64); -var global = __webpack_require__(2); -var process = global.process; -var setTask = global.setImmediate; -var clearTask = global.clearImmediate; -var MessageChannel = global.MessageChannel; -var Dispatch = global.Dispatch; -var counter = 0; -var queue = {}; -var ONREADYSTATECHANGE = 'onreadystatechange'; -var defer, channel, port; -var run = function () { - var id = +this; - // eslint-disable-next-line no-prototype-builtins - if (queue.hasOwnProperty(id)) { - var fn = queue[id]; - delete queue[id]; - fn(); - } -}; -var listener = function (event) { - run.call(event.data); -}; -// Node.js 0.9+ & IE10+ has setImmediate, otherwise: -if (!setTask || !clearTask) { - setTask = function setImmediate(fn) { - var args = []; - var i = 1; - while (arguments.length > i) args.push(arguments[i++]); - queue[++counter] = function () { - // eslint-disable-next-line no-new-func - invoke(typeof fn == 'function' ? fn : Function(fn), args); - }; - defer(counter); - return counter; - }; - clearTask = function clearImmediate(id) { - delete queue[id]; - }; - // Node.js 0.8- - if (__webpack_require__(19)(process) == 'process') { - defer = function (id) { - process.nextTick(ctx(run, id, 1)); - }; - // Sphere (JS game engine) Dispatch API - } else if (Dispatch && Dispatch.now) { - defer = function (id) { - Dispatch.now(ctx(run, id, 1)); - }; - // Browsers with MessageChannel, includes WebWorkers - } else if (MessageChannel) { - channel = new MessageChannel(); - port = channel.port2; - channel.port1.onmessage = listener; - defer = ctx(port.postMessage, port, 1); - // Browsers with postMessage, skip WebWorkers - // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' - } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { - defer = function (id) { - global.postMessage(id + '', '*'); - }; - global.addEventListener('message', listener, false); - // IE8- - } else if (ONREADYSTATECHANGE in cel('script')) { - defer = function (id) { - html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { - html.removeChild(this); - run.call(id); - }; - }; - // Rest old browsers - } else { - defer = function (id) { - setTimeout(ctx(run, id, 1), 0); - }; - } -} -module.exports = { - set: setTask, - clear: clearTask -}; - - -/***/ }), -/* 87 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(2); -var macrotask = __webpack_require__(86).set; -var Observer = global.MutationObserver || global.WebKitMutationObserver; -var process = global.process; -var Promise = global.Promise; -var isNode = __webpack_require__(19)(process) == 'process'; - -module.exports = function () { - var head, last, notify; - - var flush = function () { - var parent, fn; - if (isNode && (parent = process.domain)) parent.exit(); - while (head) { - fn = head.fn; - head = head.next; - try { - fn(); - } catch (e) { - if (head) notify(); - else last = undefined; - throw e; - } - } last = undefined; - if (parent) parent.enter(); - }; - - // Node.js - if (isNode) { - notify = function () { - process.nextTick(flush); - }; - // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 - } else if (Observer && !(global.navigator && global.navigator.standalone)) { - var toggle = true; - var node = document.createTextNode(''); - new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new - notify = function () { - node.data = toggle = !toggle; - }; - // environments with maybe non-completely correct, but existent Promise - } else if (Promise && Promise.resolve) { - // Promise.resolve without an argument throws an error in LG WebOS 2 - var promise = Promise.resolve(undefined); - notify = function () { - promise.then(flush); - }; - // for other environments - macrotask based on: - // - setImmediate - // - MessageChannel - // - window.postMessag - // - onreadystatechange - // - setTimeout - } else { - notify = function () { - // strange IE + webpack dev server bug - use .call(global) - macrotask.call(global, flush); - }; - } - - return function (fn) { - var task = { fn: fn, next: undefined }; - if (last) last.next = task; - if (!head) { - head = task; - notify(); - } last = task; - }; -}; - - -/***/ }), -/* 88 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 25.4.1.5 NewPromiseCapability(C) -var aFunction = __webpack_require__(10); - -function PromiseCapability(C) { - var resolve, reject; - this.promise = new C(function ($$resolve, $$reject) { - if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); - resolve = $$resolve; - reject = $$reject; - }); - this.resolve = aFunction(resolve); - this.reject = aFunction(reject); -} - -module.exports.f = function (C) { - return new PromiseCapability(C); -}; - - -/***/ }), -/* 89 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var global = __webpack_require__(2); -var DESCRIPTORS = __webpack_require__(6); -var LIBRARY = __webpack_require__(30); -var $typed = __webpack_require__(60); -var hide = __webpack_require__(11); -var redefineAll = __webpack_require__(41); -var fails = __webpack_require__(3); -var anInstance = __webpack_require__(39); -var toInteger = __webpack_require__(23); -var toLength = __webpack_require__(8); -var toIndex = __webpack_require__(117); -var gOPN = __webpack_require__(37).f; -var dP = __webpack_require__(7).f; -var arrayFill = __webpack_require__(84); -var setToStringTag = __webpack_require__(42); -var ARRAY_BUFFER = 'ArrayBuffer'; -var DATA_VIEW = 'DataView'; -var PROTOTYPE = 'prototype'; -var WRONG_LENGTH = 'Wrong length!'; -var WRONG_INDEX = 'Wrong index!'; -var $ArrayBuffer = global[ARRAY_BUFFER]; -var $DataView = global[DATA_VIEW]; -var Math = global.Math; -var RangeError = global.RangeError; -// eslint-disable-next-line no-shadow-restricted-names -var Infinity = global.Infinity; -var BaseBuffer = $ArrayBuffer; -var abs = Math.abs; -var pow = Math.pow; -var floor = Math.floor; -var log = Math.log; -var LN2 = Math.LN2; -var BUFFER = 'buffer'; -var BYTE_LENGTH = 'byteLength'; -var BYTE_OFFSET = 'byteOffset'; -var $BUFFER = DESCRIPTORS ? '_b' : BUFFER; -var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH; -var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; - -// IEEE754 conversions based on https://github.com/feross/ieee754 -function packIEEE754(value, mLen, nBytes) { - var buffer = new Array(nBytes); - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0; - var i = 0; - var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; - var e, m, c; - value = abs(value); - // eslint-disable-next-line no-self-compare - if (value != value || value === Infinity) { - // eslint-disable-next-line no-self-compare - m = value != value ? 1 : 0; - e = eMax; - } else { - e = floor(log(value) / LN2); - if (value * (c = pow(2, -e)) < 1) { - e--; - c *= 2; - } - if (e + eBias >= 1) { - value += rt / c; - } else { - value += rt * pow(2, 1 - eBias); - } - if (value * c >= 2) { - e++; - c /= 2; - } - if (e + eBias >= eMax) { - m = 0; - e = eMax; - } else if (e + eBias >= 1) { - m = (value * c - 1) * pow(2, mLen); - e = e + eBias; - } else { - m = value * pow(2, eBias - 1) * pow(2, mLen); - e = 0; - } - } - for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); - e = e << mLen | m; - eLen += mLen; - for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); - buffer[--i] |= s * 128; - return buffer; -} -function unpackIEEE754(buffer, mLen, nBytes) { - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var nBits = eLen - 7; - var i = nBytes - 1; - var s = buffer[i--]; - var e = s & 127; - var m; - s >>= 7; - for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); - m = e & (1 << -nBits) - 1; - e >>= -nBits; - nBits += mLen; - for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); - if (e === 0) { - e = 1 - eBias; - } else if (e === eMax) { - return m ? NaN : s ? -Infinity : Infinity; - } else { - m = m + pow(2, mLen); - e = e - eBias; - } return (s ? -1 : 1) * m * pow(2, e - mLen); -} - -function unpackI32(bytes) { - return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; -} -function packI8(it) { - return [it & 0xff]; -} -function packI16(it) { - return [it & 0xff, it >> 8 & 0xff]; -} -function packI32(it) { - return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; -} -function packF64(it) { - return packIEEE754(it, 52, 8); -} -function packF32(it) { - return packIEEE754(it, 23, 4); -} - -function addGetter(C, key, internal) { - dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } }); -} - -function get(view, bytes, index, isLittleEndian) { - var numIndex = +index; - var intIndex = toIndex(numIndex); - if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); - var store = view[$BUFFER]._b; - var start = intIndex + view[$OFFSET]; - var pack = store.slice(start, start + bytes); - return isLittleEndian ? pack : pack.reverse(); -} -function set(view, bytes, index, conversion, value, isLittleEndian) { - var numIndex = +index; - var intIndex = toIndex(numIndex); - if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); - var store = view[$BUFFER]._b; - var start = intIndex + view[$OFFSET]; - var pack = conversion(+value); - for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; -} - -if (!$typed.ABV) { - $ArrayBuffer = function ArrayBuffer(length) { - anInstance(this, $ArrayBuffer, ARRAY_BUFFER); - var byteLength = toIndex(length); - this._b = arrayFill.call(new Array(byteLength), 0); - this[$LENGTH] = byteLength; - }; - - $DataView = function DataView(buffer, byteOffset, byteLength) { - anInstance(this, $DataView, DATA_VIEW); - anInstance(buffer, $ArrayBuffer, DATA_VIEW); - var bufferLength = buffer[$LENGTH]; - var offset = toInteger(byteOffset); - if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!'); - byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); - if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); - this[$BUFFER] = buffer; - this[$OFFSET] = offset; - this[$LENGTH] = byteLength; - }; - - if (DESCRIPTORS) { - addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); - addGetter($DataView, BUFFER, '_b'); - addGetter($DataView, BYTE_LENGTH, '_l'); - addGetter($DataView, BYTE_OFFSET, '_o'); - } - - redefineAll($DataView[PROTOTYPE], { - getInt8: function getInt8(byteOffset) { - return get(this, 1, byteOffset)[0] << 24 >> 24; - }, - getUint8: function getUint8(byteOffset) { - return get(this, 1, byteOffset)[0]; - }, - getInt16: function getInt16(byteOffset /* , littleEndian */) { - var bytes = get(this, 2, byteOffset, arguments[1]); - return (bytes[1] << 8 | bytes[0]) << 16 >> 16; - }, - getUint16: function getUint16(byteOffset /* , littleEndian */) { - var bytes = get(this, 2, byteOffset, arguments[1]); - return bytes[1] << 8 | bytes[0]; - }, - getInt32: function getInt32(byteOffset /* , littleEndian */) { - return unpackI32(get(this, 4, byteOffset, arguments[1])); - }, - getUint32: function getUint32(byteOffset /* , littleEndian */) { - return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; - }, - getFloat32: function getFloat32(byteOffset /* , littleEndian */) { - return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); - }, - getFloat64: function getFloat64(byteOffset /* , littleEndian */) { - return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); - }, - setInt8: function setInt8(byteOffset, value) { - set(this, 1, byteOffset, packI8, value); - }, - setUint8: function setUint8(byteOffset, value) { - set(this, 1, byteOffset, packI8, value); - }, - setInt16: function setInt16(byteOffset, value /* , littleEndian */) { - set(this, 2, byteOffset, packI16, value, arguments[2]); - }, - setUint16: function setUint16(byteOffset, value /* , littleEndian */) { - set(this, 2, byteOffset, packI16, value, arguments[2]); - }, - setInt32: function setInt32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packI32, value, arguments[2]); - }, - setUint32: function setUint32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packI32, value, arguments[2]); - }, - setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packF32, value, arguments[2]); - }, - setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { - set(this, 8, byteOffset, packF64, value, arguments[2]); - } - }); -} else { - if (!fails(function () { - $ArrayBuffer(1); - }) || !fails(function () { - new $ArrayBuffer(-1); // eslint-disable-line no-new - }) || fails(function () { - new $ArrayBuffer(); // eslint-disable-line no-new - new $ArrayBuffer(1.5); // eslint-disable-line no-new - new $ArrayBuffer(NaN); // eslint-disable-line no-new - return $ArrayBuffer.name != ARRAY_BUFFER; - })) { - $ArrayBuffer = function ArrayBuffer(length) { - anInstance(this, $ArrayBuffer); - return new BaseBuffer(toIndex(length)); - }; - var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; - for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) { - if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]); - } - if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer; - } - // iOS Safari 7.x bug - var view = new $DataView(new $ArrayBuffer(2)); - var $setInt8 = $DataView[PROTOTYPE].setInt8; - view.setInt8(0, 2147483648); - view.setInt8(1, 2147483649); - if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], { - setInt8: function setInt8(byteOffset, value) { - $setInt8.call(this, byteOffset, value << 24 >> 24); - }, - setUint8: function setUint8(byteOffset, value) { - $setInt8.call(this, byteOffset, value << 24 >> 24); - } - }, true); -} -setToStringTag($ArrayBuffer, ARRAY_BUFFER); -setToStringTag($DataView, DATA_VIEW); -hide($DataView[PROTOTYPE], $typed.VIEW, true); -exports[ARRAY_BUFFER] = $ArrayBuffer; -exports[DATA_VIEW] = $DataView; - - -/***/ }), -/* 90 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = !__webpack_require__(6) && !__webpack_require__(3)(function () { - return Object.defineProperty(__webpack_require__(64)('div'), 'a', { get: function () { return 7; } }).a != 7; -}); - - -/***/ }), -/* 91 */ -/***/ (function(module, exports, __webpack_require__) { - -exports.f = __webpack_require__(5); - - -/***/ }), -/* 92 */ -/***/ (function(module, exports, __webpack_require__) { - -var has = __webpack_require__(14); -var toIObject = __webpack_require__(15); -var arrayIndexOf = __webpack_require__(50)(false); -var IE_PROTO = __webpack_require__(66)('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; -}; - - -/***/ }), -/* 93 */ -/***/ (function(module, exports, __webpack_require__) { - -var dP = __webpack_require__(7); -var anObject = __webpack_require__(1); -var getKeys = __webpack_require__(34); - -module.exports = __webpack_require__(6) ? 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; -}; - - -/***/ }), -/* 94 */ -/***/ (function(module, exports, __webpack_require__) { - -// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window -var toIObject = __webpack_require__(15); -var gOPN = __webpack_require__(37).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)); -}; - - -/***/ }), -/* 95 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 19.1.2.1 Object.assign(target, source, ...) -var getKeys = __webpack_require__(34); -var gOPS = __webpack_require__(51); -var pIE = __webpack_require__(47); -var toObject = __webpack_require__(9); -var IObject = __webpack_require__(46); -var $assign = Object.assign; - -// should work with symbols and should have deterministic property order (V8 bug) -module.exports = !$assign || __webpack_require__(3)(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) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; - } return T; -} : $assign; - - -/***/ }), -/* 96 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var aFunction = __webpack_require__(10); -var isObject = __webpack_require__(4); -var invoke = __webpack_require__(97); -var arraySlice = [].slice; -var factories = {}; - -var construct = function (F, len, args) { - if (!(len in factories)) { - for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']'; - // eslint-disable-next-line no-new-func - factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); - } return factories[len](F, args); -}; - -module.exports = Function.bind || function bind(that /* , ...args */) { - var fn = aFunction(this); - var partArgs = arraySlice.call(arguments, 1); - var bound = function (/* args... */) { - var args = partArgs.concat(arraySlice.call(arguments)); - return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); - }; - if (isObject(fn.prototype)) bound.prototype = fn.prototype; - return bound; -}; - - -/***/ }), -/* 97 */ -/***/ (function(module, exports) { - -// fast apply, http://jsperf.lnkit.com/fast-apply/5 -module.exports = function (fn, args, that) { - var un = that === undefined; - switch (args.length) { - case 0: return un ? fn() - : fn.call(that); - case 1: return un ? fn(args[0]) - : fn.call(that, args[0]); - case 2: return un ? fn(args[0], args[1]) - : fn.call(that, args[0], args[1]); - case 3: return un ? fn(args[0], args[1], args[2]) - : fn.call(that, args[0], args[1], args[2]); - case 4: return un ? fn(args[0], args[1], args[2], args[3]) - : fn.call(that, args[0], args[1], args[2], args[3]); - } return fn.apply(that, args); -}; - - -/***/ }), -/* 98 */ -/***/ (function(module, exports, __webpack_require__) { - -var cof = __webpack_require__(19); -module.exports = function (it, msg) { - if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg); - return +it; -}; - - -/***/ }), -/* 99 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.3 Number.isInteger(number) -var isObject = __webpack_require__(4); -var floor = Math.floor; -module.exports = function isInteger(it) { - return !isObject(it) && isFinite(it) && floor(it) === it; -}; - - -/***/ }), -/* 100 */ -/***/ (function(module, exports, __webpack_require__) { - -var $parseFloat = __webpack_require__(2).parseFloat; -var $trim = __webpack_require__(43).trim; - -module.exports = 1 / $parseFloat(__webpack_require__(71) + '-0') !== -Infinity ? function parseFloat(str) { - var string = $trim(String(str), 3); - var result = $parseFloat(string); - return result === 0 && string.charAt(0) == '-' ? -0 : result; -} : $parseFloat; - - -/***/ }), -/* 101 */ -/***/ (function(module, exports, __webpack_require__) { - -var $parseInt = __webpack_require__(2).parseInt; -var $trim = __webpack_require__(43).trim; -var ws = __webpack_require__(71); -var hex = /^[-+]?0[xX]/; - -module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) { - var string = $trim(String(str), 3); - return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); -} : $parseInt; - - -/***/ }), -/* 102 */ -/***/ (function(module, exports) { - -// 20.2.2.20 Math.log1p(x) -module.exports = Math.log1p || function log1p(x) { - return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); -}; - - -/***/ }), -/* 103 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.16 Math.fround(x) -var sign = __webpack_require__(73); -var pow = Math.pow; -var EPSILON = pow(2, -52); -var EPSILON32 = pow(2, -23); -var MAX32 = pow(2, 127) * (2 - EPSILON32); -var MIN32 = pow(2, -126); - -var roundTiesToEven = function (n) { - return n + 1 / EPSILON - 1 / EPSILON; -}; - -module.exports = Math.fround || function fround(x) { - var $abs = Math.abs(x); - var $sign = sign(x); - var a, result; - if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; - a = (1 + EPSILON32 / EPSILON) * $abs; - result = a - (a - $abs); - // eslint-disable-next-line no-self-compare - if (result > MAX32 || result != result) return $sign * Infinity; - return $sign * result; -}; - - -/***/ }), -/* 104 */ -/***/ (function(module, exports, __webpack_require__) { - -// call something on iterator step with safe closing on error -var anObject = __webpack_require__(1); -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; - } -}; - - -/***/ }), -/* 105 */ -/***/ (function(module, exports, __webpack_require__) { - -var aFunction = __webpack_require__(10); -var toObject = __webpack_require__(9); -var IObject = __webpack_require__(46); -var toLength = __webpack_require__(8); - -module.exports = function (that, callbackfn, aLen, memo, isRight) { - aFunction(callbackfn); - var O = toObject(that); - var self = IObject(O); - var length = toLength(O.length); - var index = isRight ? length - 1 : 0; - var i = isRight ? -1 : 1; - if (aLen < 2) for (;;) { - if (index in self) { - memo = self[index]; - index += i; - break; - } - index += i; - if (isRight ? index < 0 : length <= index) { - throw TypeError('Reduce of empty array with no initial value'); - } - } - for (;isRight ? index >= 0 : length > index; index += i) if (index in self) { - memo = callbackfn(memo, self[index], index, O); - } - return memo; -}; - - -/***/ }), -/* 106 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) - -var toObject = __webpack_require__(9); -var toAbsoluteIndex = __webpack_require__(35); -var toLength = __webpack_require__(8); - -module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { - var O = toObject(this); - var len = toLength(O.length); - var to = toAbsoluteIndex(target, len); - var from = toAbsoluteIndex(start, len); - var end = arguments.length > 2 ? arguments[2] : undefined; - var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); - var inc = 1; - if (from < to && to < from + count) { - inc = -1; - from += count - 1; - to += count - 1; - } - while (count-- > 0) { - if (from in O) O[to] = O[from]; - else delete O[to]; - to += inc; - from += inc; - } return O; -}; - - -/***/ }), -/* 107 */ -/***/ (function(module, exports) { - -module.exports = function (done, value) { - return { value: value, done: !!done }; -}; - - -/***/ }), -/* 108 */ -/***/ (function(module, exports, __webpack_require__) { - -// 21.2.5.3 get RegExp.prototype.flags() -if (__webpack_require__(6) && /./g.flags != 'g') __webpack_require__(7).f(RegExp.prototype, 'flags', { - configurable: true, - get: __webpack_require__(55) -}); - - -/***/ }), -/* 109 */ -/***/ (function(module, exports) { - -module.exports = function (exec) { - try { - return { e: false, v: exec() }; - } catch (e) { - return { e: true, v: e }; - } -}; - - -/***/ }), -/* 110 */ -/***/ (function(module, exports, __webpack_require__) { - -var anObject = __webpack_require__(1); -var isObject = __webpack_require__(4); -var newPromiseCapability = __webpack_require__(88); - -module.exports = function (C, x) { - anObject(C); - if (isObject(x) && x.constructor === C) return x; - var promiseCapability = newPromiseCapability.f(C); - var resolve = promiseCapability.resolve; - resolve(x); - return promiseCapability.promise; -}; - - -/***/ }), -/* 111 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var strong = __webpack_require__(112); -var validate = __webpack_require__(45); -var MAP = 'Map'; - -// 23.1 Map Objects -module.exports = __webpack_require__(59)(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); - - -/***/ }), -/* 112 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var dP = __webpack_require__(7).f; -var create = __webpack_require__(36); -var redefineAll = __webpack_require__(41); -var ctx = __webpack_require__(18); -var anInstance = __webpack_require__(39); -var forOf = __webpack_require__(40); -var $iterDefine = __webpack_require__(78); -var step = __webpack_require__(107); -var setSpecies = __webpack_require__(38); -var DESCRIPTORS = __webpack_require__(6); -var fastKey = __webpack_require__(29).fastKey; -var validate = __webpack_require__(45); -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); - } -}; - - -/***/ }), -/* 113 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var strong = __webpack_require__(112); -var validate = __webpack_require__(45); -var SET = 'Set'; - -// 23.2 Set Objects -module.exports = __webpack_require__(59)(SET, function (get) { - return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; -}, { - // 23.2.3.1 Set.prototype.add(value) - add: function add(value) { - return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value); - } -}, strong); - - -/***/ }), -/* 114 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var each = __webpack_require__(25)(0); -var redefine = __webpack_require__(12); -var meta = __webpack_require__(29); -var assign = __webpack_require__(95); -var weak = __webpack_require__(115); -var isObject = __webpack_require__(4); -var fails = __webpack_require__(3); -var validate = __webpack_require__(45); -var WEAK_MAP = 'WeakMap'; -var getWeak = meta.getWeak; -var isExtensible = Object.isExtensible; -var uncaughtFrozenStore = weak.ufstore; -var tmp = {}; -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__(59)(WEAK_MAP, wrapper, methods, weak, true, true); - -// IE11 WeakMap frozen keys fix -if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) { - 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); - }); - }); -} - - -/***/ }), -/* 115 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var redefineAll = __webpack_require__(41); -var getWeak = __webpack_require__(29).getWeak; -var anObject = __webpack_require__(1); -var isObject = __webpack_require__(4); -var anInstance = __webpack_require__(39); -var forOf = __webpack_require__(40); -var createArrayMethod = __webpack_require__(25); -var $has = __webpack_require__(14); -var validate = __webpack_require__(45); -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 -}; - - -/***/ }), -/* 116 */ -/***/ (function(module, exports, __webpack_require__) { - -// all object keys, includes non-enumerable and symbols -var gOPN = __webpack_require__(37); -var gOPS = __webpack_require__(51); -var anObject = __webpack_require__(1); -var Reflect = __webpack_require__(2).Reflect; -module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { - var keys = gOPN.f(anObject(it)); - var getSymbols = gOPS.f; - return getSymbols ? keys.concat(getSymbols(it)) : keys; -}; - - -/***/ }), -/* 117 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/ecma262/#sec-toindex -var toInteger = __webpack_require__(23); -var toLength = __webpack_require__(8); -module.exports = function (it) { - if (it === undefined) return 0; - var number = toInteger(it); - var length = toLength(number); - if (number !== length) throw RangeError('Wrong length!'); - return length; -}; - - -/***/ }), -/* 118 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray -var isArray = __webpack_require__(52); -var isObject = __webpack_require__(4); -var toLength = __webpack_require__(8); -var ctx = __webpack_require__(18); -var IS_CONCAT_SPREADABLE = __webpack_require__(5)('isConcatSpreadable'); - -function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) { - var targetIndex = start; - var sourceIndex = 0; - var mapFn = mapper ? ctx(mapper, thisArg, 3) : false; - var element, spreadable; - - while (sourceIndex < sourceLen) { - if (sourceIndex in source) { - element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; - - spreadable = false; - if (isObject(element)) { - spreadable = element[IS_CONCAT_SPREADABLE]; - spreadable = spreadable !== undefined ? !!spreadable : isArray(element); - } - - if (spreadable && depth > 0) { - targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1; - } else { - if (targetIndex >= 0x1fffffffffffff) throw TypeError(); - target[targetIndex] = element; - } - - targetIndex++; - } - sourceIndex++; - } - return targetIndex; -} - -module.exports = flattenIntoArray; - - -/***/ }), -/* 119 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/tc39/proposal-string-pad-start-end -var toLength = __webpack_require__(8); -var repeat = __webpack_require__(72); -var defined = __webpack_require__(22); - -module.exports = function (that, maxLength, fillString, left) { - var S = String(defined(that)); - var stringLength = S.length; - var fillStr = fillString === undefined ? ' ' : String(fillString); - var intMaxLength = toLength(maxLength); - if (intMaxLength <= stringLength || fillStr == '') return S; - var fillLen = intMaxLength - stringLength; - var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); - if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); - return left ? stringFiller + S : S + stringFiller; -}; - - -/***/ }), -/* 120 */ -/***/ (function(module, exports, __webpack_require__) { - -var getKeys = __webpack_require__(34); -var toIObject = __webpack_require__(15); -var isEnum = __webpack_require__(47).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) if (isEnum.call(O, key = keys[i++])) { - result.push(isEntries ? [key, O[key]] : O[key]); - } return result; - }; -}; - - -/***/ }), -/* 121 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/DavidBruant/Map-Set.prototype.toJSON -var classof = __webpack_require__(48); -var from = __webpack_require__(122); -module.exports = function (NAME) { - return function toJSON() { - if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); - return from(this); - }; -}; - - -/***/ }), -/* 122 */ -/***/ (function(module, exports, __webpack_require__) { - -var forOf = __webpack_require__(40); - -module.exports = function (iter, ITERATOR) { - var result = []; - forOf(iter, false, result.push, result, ITERATOR); - return result; -}; - - -/***/ }), -/* 123 */ -/***/ (function(module, exports) { - -// https://rwaldron.github.io/proposal-math-extensions/ -module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) { - if ( - arguments.length === 0 - // eslint-disable-next-line no-self-compare - || x != x - // eslint-disable-next-line no-self-compare - || inLow != inLow - // eslint-disable-next-line no-self-compare - || inHigh != inHigh - // eslint-disable-next-line no-self-compare - || outLow != outLow - // eslint-disable-next-line no-self-compare - || outHigh != outHigh - ) return NaN; - if (x === Infinity || x === -Infinity) return x; - return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow; -}; - - -/***/ }), -/* 124 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(125); -__webpack_require__(127); -__webpack_require__(128); -__webpack_require__(129); -__webpack_require__(130); -__webpack_require__(131); -__webpack_require__(132); -__webpack_require__(133); -__webpack_require__(134); -__webpack_require__(135); -__webpack_require__(136); -__webpack_require__(137); -__webpack_require__(138); -__webpack_require__(139); -__webpack_require__(140); -__webpack_require__(141); -__webpack_require__(143); -__webpack_require__(144); -__webpack_require__(145); -__webpack_require__(146); -__webpack_require__(147); -__webpack_require__(148); -__webpack_require__(149); -__webpack_require__(150); -__webpack_require__(151); -__webpack_require__(152); -__webpack_require__(153); -__webpack_require__(154); -__webpack_require__(155); -__webpack_require__(156); -__webpack_require__(157); -__webpack_require__(158); -__webpack_require__(159); -__webpack_require__(160); -__webpack_require__(161); -__webpack_require__(162); -__webpack_require__(163); -__webpack_require__(164); -__webpack_require__(165); -__webpack_require__(166); -__webpack_require__(167); -__webpack_require__(168); -__webpack_require__(169); -__webpack_require__(170); -__webpack_require__(171); -__webpack_require__(172); -__webpack_require__(173); -__webpack_require__(174); -__webpack_require__(175); -__webpack_require__(176); -__webpack_require__(177); -__webpack_require__(178); -__webpack_require__(179); -__webpack_require__(180); -__webpack_require__(181); -__webpack_require__(182); -__webpack_require__(183); -__webpack_require__(184); -__webpack_require__(185); -__webpack_require__(186); -__webpack_require__(187); -__webpack_require__(188); -__webpack_require__(189); -__webpack_require__(190); -__webpack_require__(191); -__webpack_require__(192); -__webpack_require__(193); -__webpack_require__(194); -__webpack_require__(195); -__webpack_require__(196); -__webpack_require__(197); -__webpack_require__(198); -__webpack_require__(199); -__webpack_require__(200); -__webpack_require__(201); -__webpack_require__(202); -__webpack_require__(203); -__webpack_require__(204); -__webpack_require__(205); -__webpack_require__(206); -__webpack_require__(207); -__webpack_require__(209); -__webpack_require__(210); -__webpack_require__(211); -__webpack_require__(212); -__webpack_require__(213); -__webpack_require__(214); -__webpack_require__(215); -__webpack_require__(216); -__webpack_require__(217); -__webpack_require__(218); -__webpack_require__(219); -__webpack_require__(220); -__webpack_require__(85); -__webpack_require__(221); -__webpack_require__(222); -__webpack_require__(223); -__webpack_require__(108); -__webpack_require__(224); -__webpack_require__(225); -__webpack_require__(226); -__webpack_require__(227); -__webpack_require__(228); -__webpack_require__(111); -__webpack_require__(113); -__webpack_require__(114); -__webpack_require__(229); -__webpack_require__(230); -__webpack_require__(231); -__webpack_require__(232); -__webpack_require__(233); -__webpack_require__(234); -__webpack_require__(235); -__webpack_require__(236); -__webpack_require__(237); -__webpack_require__(238); -__webpack_require__(239); -__webpack_require__(240); -__webpack_require__(241); -__webpack_require__(242); -__webpack_require__(243); -__webpack_require__(244); -__webpack_require__(245); -__webpack_require__(246); -__webpack_require__(248); -__webpack_require__(249); -__webpack_require__(251); -__webpack_require__(252); -__webpack_require__(253); -__webpack_require__(254); -__webpack_require__(255); -__webpack_require__(256); -__webpack_require__(257); -__webpack_require__(258); -__webpack_require__(259); -__webpack_require__(260); -__webpack_require__(261); -__webpack_require__(262); -__webpack_require__(263); -__webpack_require__(264); -__webpack_require__(265); -__webpack_require__(266); -__webpack_require__(267); -__webpack_require__(268); -__webpack_require__(269); -__webpack_require__(270); -__webpack_require__(271); -__webpack_require__(272); -__webpack_require__(273); -__webpack_require__(274); -__webpack_require__(275); -__webpack_require__(276); -__webpack_require__(277); -__webpack_require__(278); -__webpack_require__(279); -__webpack_require__(280); -__webpack_require__(281); -__webpack_require__(282); -__webpack_require__(283); -__webpack_require__(284); -__webpack_require__(285); -__webpack_require__(286); -__webpack_require__(287); -__webpack_require__(288); -__webpack_require__(289); -__webpack_require__(290); -__webpack_require__(291); -__webpack_require__(292); -__webpack_require__(293); -__webpack_require__(294); -__webpack_require__(295); -__webpack_require__(296); -__webpack_require__(297); -__webpack_require__(298); -__webpack_require__(299); -__webpack_require__(300); -__webpack_require__(301); -__webpack_require__(302); -__webpack_require__(303); -__webpack_require__(304); -__webpack_require__(305); -__webpack_require__(306); -__webpack_require__(307); -__webpack_require__(308); -__webpack_require__(309); -__webpack_require__(310); -__webpack_require__(311); -__webpack_require__(312); -__webpack_require__(313); -__webpack_require__(314); -__webpack_require__(315); -__webpack_require__(316); -__webpack_require__(317); -__webpack_require__(318); -__webpack_require__(319); -module.exports = __webpack_require__(320); - - -/***/ }), -/* 125 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// ECMAScript 6 symbols shim -var global = __webpack_require__(2); -var has = __webpack_require__(14); -var DESCRIPTORS = __webpack_require__(6); -var $export = __webpack_require__(0); -var redefine = __webpack_require__(12); -var META = __webpack_require__(29).KEY; -var $fails = __webpack_require__(3); -var shared = __webpack_require__(49); -var setToStringTag = __webpack_require__(42); -var uid = __webpack_require__(33); -var wks = __webpack_require__(5); -var wksExt = __webpack_require__(91); -var wksDefine = __webpack_require__(65); -var enumKeys = __webpack_require__(126); -var isArray = __webpack_require__(52); -var anObject = __webpack_require__(1); -var isObject = __webpack_require__(4); -var toIObject = __webpack_require__(15); -var toPrimitive = __webpack_require__(21); -var createDesc = __webpack_require__(32); -var _create = __webpack_require__(36); -var gOPNExt = __webpack_require__(94); -var $GOPD = __webpack_require__(16); -var $DP = __webpack_require__(7); -var $keys = __webpack_require__(34); -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'; -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__(37).f = gOPNExt.f = $getOwnPropertyNames; - __webpack_require__(47).f = $propertyIsEnumerable; - __webpack_require__(51).f = $getOwnPropertySymbols; - - if (DESCRIPTORS && !__webpack_require__(30)) { - 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 -}); - -// 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__(11)($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); - - -/***/ }), -/* 126 */ -/***/ (function(module, exports, __webpack_require__) { - -// all enumerable object keys, includes symbols -var getKeys = __webpack_require__(34); -var gOPS = __webpack_require__(51); -var pIE = __webpack_require__(47); -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; -}; - - -/***/ }), -/* 127 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) -$export($export.S + $export.F * !__webpack_require__(6), 'Object', { defineProperty: __webpack_require__(7).f }); - - -/***/ }), -/* 128 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) -$export($export.S + $export.F * !__webpack_require__(6), 'Object', { defineProperties: __webpack_require__(93) }); - - -/***/ }), -/* 129 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) -var toIObject = __webpack_require__(15); -var $getOwnPropertyDescriptor = __webpack_require__(16).f; - -__webpack_require__(24)('getOwnPropertyDescriptor', function () { - return function getOwnPropertyDescriptor(it, key) { - return $getOwnPropertyDescriptor(toIObject(it), key); - }; -}); - - -/***/ }), -/* 130 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -$export($export.S, 'Object', { create: __webpack_require__(36) }); - - -/***/ }), -/* 131 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.9 Object.getPrototypeOf(O) -var toObject = __webpack_require__(9); -var $getPrototypeOf = __webpack_require__(17); - -__webpack_require__(24)('getPrototypeOf', function () { - return function getPrototypeOf(it) { - return $getPrototypeOf(toObject(it)); - }; -}); - - -/***/ }), -/* 132 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.14 Object.keys(O) -var toObject = __webpack_require__(9); -var $keys = __webpack_require__(34); - -__webpack_require__(24)('keys', function () { - return function keys(it) { - return $keys(toObject(it)); - }; -}); - - -/***/ }), -/* 133 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.7 Object.getOwnPropertyNames(O) -__webpack_require__(24)('getOwnPropertyNames', function () { - return __webpack_require__(94).f; -}); - - -/***/ }), -/* 134 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.5 Object.freeze(O) -var isObject = __webpack_require__(4); -var meta = __webpack_require__(29).onFreeze; - -__webpack_require__(24)('freeze', function ($freeze) { - return function freeze(it) { - return $freeze && isObject(it) ? $freeze(meta(it)) : it; - }; -}); - - -/***/ }), -/* 135 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.17 Object.seal(O) -var isObject = __webpack_require__(4); -var meta = __webpack_require__(29).onFreeze; - -__webpack_require__(24)('seal', function ($seal) { - return function seal(it) { - return $seal && isObject(it) ? $seal(meta(it)) : it; - }; -}); - - -/***/ }), -/* 136 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.15 Object.preventExtensions(O) -var isObject = __webpack_require__(4); -var meta = __webpack_require__(29).onFreeze; - -__webpack_require__(24)('preventExtensions', function ($preventExtensions) { - return function preventExtensions(it) { - return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; - }; -}); - - -/***/ }), -/* 137 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.12 Object.isFrozen(O) -var isObject = __webpack_require__(4); - -__webpack_require__(24)('isFrozen', function ($isFrozen) { - return function isFrozen(it) { - return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; - }; -}); - - -/***/ }), -/* 138 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.13 Object.isSealed(O) -var isObject = __webpack_require__(4); - -__webpack_require__(24)('isSealed', function ($isSealed) { - return function isSealed(it) { - return isObject(it) ? $isSealed ? $isSealed(it) : false : true; - }; -}); - - -/***/ }), -/* 139 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.11 Object.isExtensible(O) -var isObject = __webpack_require__(4); - -__webpack_require__(24)('isExtensible', function ($isExtensible) { - return function isExtensible(it) { - return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; - }; -}); - - -/***/ }), -/* 140 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.3.1 Object.assign(target, source) -var $export = __webpack_require__(0); - -$export($export.S + $export.F, 'Object', { assign: __webpack_require__(95) }); - - -/***/ }), -/* 141 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.3.10 Object.is(value1, value2) -var $export = __webpack_require__(0); -$export($export.S, 'Object', { is: __webpack_require__(142) }); - - -/***/ }), -/* 142 */ -/***/ (function(module, exports) { - -// 7.2.9 SameValue(x, y) -module.exports = Object.is || function is(x, y) { - // eslint-disable-next-line no-self-compare - return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; -}; - - -/***/ }), -/* 143 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.3.19 Object.setPrototypeOf(O, proto) -var $export = __webpack_require__(0); -$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(69).set }); - - -/***/ }), -/* 144 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 19.1.3.6 Object.prototype.toString() -var classof = __webpack_require__(48); -var test = {}; -test[__webpack_require__(5)('toStringTag')] = 'z'; -if (test + '' != '[object z]') { - __webpack_require__(12)(Object.prototype, 'toString', function toString() { - return '[object ' + classof(this) + ']'; - }, true); -} - - -/***/ }), -/* 145 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) -var $export = __webpack_require__(0); - -$export($export.P, 'Function', { bind: __webpack_require__(96) }); - - -/***/ }), -/* 146 */ -/***/ (function(module, exports, __webpack_require__) { - -var dP = __webpack_require__(7).f; -var FProto = Function.prototype; -var nameRE = /^\s*function ([^ (]*)/; -var NAME = 'name'; - -// 19.2.4.2 name -NAME in FProto || __webpack_require__(6) && dP(FProto, NAME, { - configurable: true, - get: function () { - try { - return ('' + this).match(nameRE)[1]; - } catch (e) { - return ''; - } - } -}); - - -/***/ }), -/* 147 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var isObject = __webpack_require__(4); -var getPrototypeOf = __webpack_require__(17); -var HAS_INSTANCE = __webpack_require__(5)('hasInstance'); -var FunctionProto = Function.prototype; -// 19.2.3.6 Function.prototype[@@hasInstance](V) -if (!(HAS_INSTANCE in FunctionProto)) __webpack_require__(7).f(FunctionProto, HAS_INSTANCE, { value: function (O) { - if (typeof this != 'function' || !isObject(O)) return false; - if (!isObject(this.prototype)) return O instanceof this; - // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: - while (O = getPrototypeOf(O)) if (this.prototype === O) return true; - return false; -} }); - - -/***/ }), -/* 148 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var global = __webpack_require__(2); -var has = __webpack_require__(14); -var cof = __webpack_require__(19); -var inheritIfRequired = __webpack_require__(70); -var toPrimitive = __webpack_require__(21); -var fails = __webpack_require__(3); -var gOPN = __webpack_require__(37).f; -var gOPD = __webpack_require__(16).f; -var dP = __webpack_require__(7).f; -var $trim = __webpack_require__(43).trim; -var NUMBER = 'Number'; -var $Number = global[NUMBER]; -var Base = $Number; -var proto = $Number.prototype; -// Opera ~12 has broken Object#toString -var BROKEN_COF = cof(__webpack_require__(36)(proto)) == NUMBER; -var TRIM = 'trim' in String.prototype; - -// 7.1.3 ToNumber(argument) -var toNumber = function (argument) { - var it = toPrimitive(argument, false); - if (typeof it == 'string' && it.length > 2) { - it = TRIM ? it.trim() : $trim(it, 3); - var first = it.charCodeAt(0); - var third, radix, maxCode; - if (first === 43 || first === 45) { - third = it.charCodeAt(2); - if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix - } else if (first === 48) { - switch (it.charCodeAt(1)) { - case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i - case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i - default: return +it; - } - for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) { - code = digits.charCodeAt(i); - // parseInt parses a string to a first unavailable symbol - // but ToNumber should return NaN if a string contains unavailable symbols - if (code < 48 || code > maxCode) return NaN; - } return parseInt(digits, radix); - } - } return +it; -}; - -if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) { - $Number = function Number(value) { - var it = arguments.length < 1 ? 0 : value; - var that = this; - return that instanceof $Number - // check on 1..constructor(foo) case - && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER) - ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it); - }; - for (var keys = __webpack_require__(6) ? gOPN(Base) : ( - // ES3: - 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + - // ES6 (in case, if modules with ES6 Number statics required before): - 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + - 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' - ).split(','), j = 0, key; keys.length > j; j++) { - if (has(Base, key = keys[j]) && !has($Number, key)) { - dP($Number, key, gOPD(Base, key)); - } - } - $Number.prototype = proto; - proto.constructor = $Number; - __webpack_require__(12)(global, NUMBER, $Number); -} - - -/***/ }), -/* 149 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var toInteger = __webpack_require__(23); -var aNumberValue = __webpack_require__(98); -var repeat = __webpack_require__(72); -var $toFixed = 1.0.toFixed; -var floor = Math.floor; -var data = [0, 0, 0, 0, 0, 0]; -var ERROR = 'Number.toFixed: incorrect invocation!'; -var ZERO = '0'; - -var multiply = function (n, c) { - var i = -1; - var c2 = c; - while (++i < 6) { - c2 += n * data[i]; - data[i] = c2 % 1e7; - c2 = floor(c2 / 1e7); - } -}; -var divide = function (n) { - var i = 6; - var c = 0; - while (--i >= 0) { - c += data[i]; - data[i] = floor(c / n); - c = (c % n) * 1e7; - } -}; -var numToString = function () { - var i = 6; - var s = ''; - while (--i >= 0) { - if (s !== '' || i === 0 || data[i] !== 0) { - var t = String(data[i]); - s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; - } - } return s; -}; -var pow = function (x, n, acc) { - return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); -}; -var log = function (x) { - var n = 0; - var x2 = x; - while (x2 >= 4096) { - n += 12; - x2 /= 4096; - } - while (x2 >= 2) { - n += 1; - x2 /= 2; - } return n; -}; - -$export($export.P + $export.F * (!!$toFixed && ( - 0.00008.toFixed(3) !== '0.000' || - 0.9.toFixed(0) !== '1' || - 1.255.toFixed(2) !== '1.25' || - 1000000000000000128.0.toFixed(0) !== '1000000000000000128' -) || !__webpack_require__(3)(function () { - // V8 ~ Android 4.3- - $toFixed.call({}); -})), 'Number', { - toFixed: function toFixed(fractionDigits) { - var x = aNumberValue(this, ERROR); - var f = toInteger(fractionDigits); - var s = ''; - var m = ZERO; - var e, z, j, k; - if (f < 0 || f > 20) throw RangeError(ERROR); - // eslint-disable-next-line no-self-compare - if (x != x) return 'NaN'; - if (x <= -1e21 || x >= 1e21) return String(x); - if (x < 0) { - s = '-'; - x = -x; - } - if (x > 1e-21) { - e = log(x * pow(2, 69, 1)) - 69; - z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); - z *= 0x10000000000000; - e = 52 - e; - if (e > 0) { - multiply(0, z); - j = f; - while (j >= 7) { - multiply(1e7, 0); - j -= 7; - } - multiply(pow(10, j, 1), 0); - j = e - 1; - while (j >= 23) { - divide(1 << 23); - j -= 23; - } - divide(1 << j); - multiply(1, 1); - divide(2); - m = numToString(); - } else { - multiply(0, z); - multiply(1 << -e, 0); - m = numToString() + repeat.call(ZERO, f); - } - } - if (f > 0) { - k = m.length; - m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); - } else { - m = s + m; - } return m; - } -}); - - -/***/ }), -/* 150 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $fails = __webpack_require__(3); -var aNumberValue = __webpack_require__(98); -var $toPrecision = 1.0.toPrecision; - -$export($export.P + $export.F * ($fails(function () { - // IE7- - return $toPrecision.call(1, undefined) !== '1'; -}) || !$fails(function () { - // V8 ~ Android 4.3- - $toPrecision.call({}); -})), 'Number', { - toPrecision: function toPrecision(precision) { - var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); - return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); - } -}); - - -/***/ }), -/* 151 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.1 Number.EPSILON -var $export = __webpack_require__(0); - -$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) }); - - -/***/ }), -/* 152 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.2 Number.isFinite(number) -var $export = __webpack_require__(0); -var _isFinite = __webpack_require__(2).isFinite; - -$export($export.S, 'Number', { - isFinite: function isFinite(it) { - return typeof it == 'number' && _isFinite(it); - } -}); - - -/***/ }), -/* 153 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.3 Number.isInteger(number) -var $export = __webpack_require__(0); - -$export($export.S, 'Number', { isInteger: __webpack_require__(99) }); - - -/***/ }), -/* 154 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.4 Number.isNaN(number) -var $export = __webpack_require__(0); - -$export($export.S, 'Number', { - isNaN: function isNaN(number) { - // eslint-disable-next-line no-self-compare - return number != number; - } -}); - - -/***/ }), -/* 155 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.5 Number.isSafeInteger(number) -var $export = __webpack_require__(0); -var isInteger = __webpack_require__(99); -var abs = Math.abs; - -$export($export.S, 'Number', { - isSafeInteger: function isSafeInteger(number) { - return isInteger(number) && abs(number) <= 0x1fffffffffffff; - } -}); - - -/***/ }), -/* 156 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.6 Number.MAX_SAFE_INTEGER -var $export = __webpack_require__(0); - -$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); - - -/***/ }), -/* 157 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.10 Number.MIN_SAFE_INTEGER -var $export = __webpack_require__(0); - -$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff }); - - -/***/ }), -/* 158 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var $parseFloat = __webpack_require__(100); -// 20.1.2.12 Number.parseFloat(string) -$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat }); - - -/***/ }), -/* 159 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var $parseInt = __webpack_require__(101); -// 20.1.2.13 Number.parseInt(string, radix) -$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt }); - - -/***/ }), -/* 160 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var $parseInt = __webpack_require__(101); -// 18.2.5 parseInt(string, radix) -$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt }); - - -/***/ }), -/* 161 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var $parseFloat = __webpack_require__(100); -// 18.2.4 parseFloat(string) -$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat }); - - -/***/ }), -/* 162 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.3 Math.acosh(x) -var $export = __webpack_require__(0); -var log1p = __webpack_require__(102); -var sqrt = Math.sqrt; -var $acosh = Math.acosh; - -$export($export.S + $export.F * !($acosh - // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 - && Math.floor($acosh(Number.MAX_VALUE)) == 710 - // Tor Browser bug: Math.acosh(Infinity) -> NaN - && $acosh(Infinity) == Infinity -), 'Math', { - acosh: function acosh(x) { - return (x = +x) < 1 ? NaN : x > 94906265.62425156 - ? Math.log(x) + Math.LN2 - : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); - } -}); - - -/***/ }), -/* 163 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.5 Math.asinh(x) -var $export = __webpack_require__(0); -var $asinh = Math.asinh; - -function asinh(x) { - return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); -} - -// Tor Browser bug: Math.asinh(0) -> -0 -$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh }); - - -/***/ }), -/* 164 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.7 Math.atanh(x) -var $export = __webpack_require__(0); -var $atanh = Math.atanh; - -// Tor Browser bug: Math.atanh(-0) -> 0 -$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { - atanh: function atanh(x) { - return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; - } -}); - - -/***/ }), -/* 165 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.9 Math.cbrt(x) -var $export = __webpack_require__(0); -var sign = __webpack_require__(73); - -$export($export.S, 'Math', { - cbrt: function cbrt(x) { - return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); - } -}); - - -/***/ }), -/* 166 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.11 Math.clz32(x) -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - clz32: function clz32(x) { - return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; - } -}); - - -/***/ }), -/* 167 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.12 Math.cosh(x) -var $export = __webpack_require__(0); -var exp = Math.exp; - -$export($export.S, 'Math', { - cosh: function cosh(x) { - return (exp(x = +x) + exp(-x)) / 2; - } -}); - - -/***/ }), -/* 168 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.14 Math.expm1(x) -var $export = __webpack_require__(0); -var $expm1 = __webpack_require__(74); - -$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 }); - - -/***/ }), -/* 169 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.16 Math.fround(x) -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { fround: __webpack_require__(103) }); - - -/***/ }), -/* 170 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) -var $export = __webpack_require__(0); -var abs = Math.abs; - -$export($export.S, 'Math', { - hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars - var sum = 0; - var i = 0; - var aLen = arguments.length; - var larg = 0; - var arg, div; - while (i < aLen) { - arg = abs(arguments[i++]); - if (larg < arg) { - div = larg / arg; - sum = sum * div * div + 1; - larg = arg; - } else if (arg > 0) { - div = arg / larg; - sum += div * div; - } else sum += arg; - } - return larg === Infinity ? Infinity : larg * Math.sqrt(sum); - } -}); - - -/***/ }), -/* 171 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.18 Math.imul(x, y) -var $export = __webpack_require__(0); -var $imul = Math.imul; - -// some WebKit versions fails with big numbers, some has wrong arity -$export($export.S + $export.F * __webpack_require__(3)(function () { - return $imul(0xffffffff, 5) != -5 || $imul.length != 2; -}), 'Math', { - imul: function imul(x, y) { - var UINT16 = 0xffff; - var xn = +x; - var yn = +y; - var xl = UINT16 & xn; - var yl = UINT16 & yn; - return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); - } -}); - - -/***/ }), -/* 172 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.21 Math.log10(x) -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - log10: function log10(x) { - return Math.log(x) * Math.LOG10E; - } -}); - - -/***/ }), -/* 173 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.20 Math.log1p(x) -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { log1p: __webpack_require__(102) }); - - -/***/ }), -/* 174 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.22 Math.log2(x) -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - log2: function log2(x) { - return Math.log(x) / Math.LN2; - } -}); - - -/***/ }), -/* 175 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.28 Math.sign(x) -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { sign: __webpack_require__(73) }); - - -/***/ }), -/* 176 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.30 Math.sinh(x) -var $export = __webpack_require__(0); -var expm1 = __webpack_require__(74); -var exp = Math.exp; - -// V8 near Chromium 38 has a problem with very small numbers -$export($export.S + $export.F * __webpack_require__(3)(function () { - return !Math.sinh(-2e-17) != -2e-17; -}), 'Math', { - sinh: function sinh(x) { - return Math.abs(x = +x) < 1 - ? (expm1(x) - expm1(-x)) / 2 - : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); - } -}); - - -/***/ }), -/* 177 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.33 Math.tanh(x) -var $export = __webpack_require__(0); -var expm1 = __webpack_require__(74); -var exp = Math.exp; - -$export($export.S, 'Math', { - tanh: function tanh(x) { - var a = expm1(x = +x); - var b = expm1(-x); - return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); - } -}); - - -/***/ }), -/* 178 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.2.2.34 Math.trunc(x) -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - trunc: function trunc(it) { - return (it > 0 ? Math.floor : Math.ceil)(it); - } -}); - - -/***/ }), -/* 179 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var toAbsoluteIndex = __webpack_require__(35); -var fromCharCode = String.fromCharCode; -var $fromCodePoint = String.fromCodePoint; - -// length should be 1, old FF problem -$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { - // 21.1.2.2 String.fromCodePoint(...codePoints) - fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars - var res = []; - var aLen = arguments.length; - var i = 0; - var code; - while (aLen > i) { - code = +arguments[i++]; - if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); - res.push(code < 0x10000 - ? fromCharCode(code) - : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) - ); - } return res.join(''); - } -}); - - -/***/ }), -/* 180 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var toIObject = __webpack_require__(15); -var toLength = __webpack_require__(8); - -$export($export.S, 'String', { - // 21.1.2.4 String.raw(callSite, ...substitutions) - raw: function raw(callSite) { - var tpl = toIObject(callSite.raw); - var len = toLength(tpl.length); - var aLen = arguments.length; - var res = []; - var i = 0; - while (len > i) { - res.push(String(tpl[i++])); - if (i < aLen) res.push(String(arguments[i])); - } return res.join(''); - } -}); - - -/***/ }), -/* 181 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 21.1.3.25 String.prototype.trim() -__webpack_require__(43)('trim', function ($trim) { - return function trim() { - return $trim(this, 3); - }; -}); - - -/***/ }), -/* 182 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $at = __webpack_require__(75)(false); -$export($export.P, 'String', { - // 21.1.3.3 String.prototype.codePointAt(pos) - codePointAt: function codePointAt(pos) { - return $at(this, pos); - } -}); - - -/***/ }), -/* 183 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) - -var $export = __webpack_require__(0); -var toLength = __webpack_require__(8); -var context = __webpack_require__(76); -var ENDS_WITH = 'endsWith'; -var $endsWith = ''[ENDS_WITH]; - -$export($export.P + $export.F * __webpack_require__(77)(ENDS_WITH), 'String', { - endsWith: function endsWith(searchString /* , endPosition = @length */) { - var that = context(this, searchString, ENDS_WITH); - var endPosition = arguments.length > 1 ? arguments[1] : undefined; - var len = toLength(that.length); - var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); - var search = String(searchString); - return $endsWith - ? $endsWith.call(that, search, end) - : that.slice(end - search.length, end) === search; - } -}); - - -/***/ }), -/* 184 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// 21.1.3.7 String.prototype.includes(searchString, position = 0) - -var $export = __webpack_require__(0); -var context = __webpack_require__(76); -var INCLUDES = 'includes'; - -$export($export.P + $export.F * __webpack_require__(77)(INCLUDES), 'String', { - includes: function includes(searchString /* , position = 0 */) { - return !!~context(this, searchString, INCLUDES) - .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); - } -}); - - -/***/ }), -/* 185 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); - -$export($export.P, 'String', { - // 21.1.3.13 String.prototype.repeat(count) - repeat: __webpack_require__(72) -}); - - -/***/ }), -/* 186 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// 21.1.3.18 String.prototype.startsWith(searchString [, position ]) - -var $export = __webpack_require__(0); -var toLength = __webpack_require__(8); -var context = __webpack_require__(76); -var STARTS_WITH = 'startsWith'; -var $startsWith = ''[STARTS_WITH]; - -$export($export.P + $export.F * __webpack_require__(77)(STARTS_WITH), 'String', { - startsWith: function startsWith(searchString /* , position = 0 */) { - var that = context(this, searchString, STARTS_WITH); - var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); - var search = String(searchString); - return $startsWith - ? $startsWith.call(that, search, index) - : that.slice(index, index + search.length) === search; - } -}); - - -/***/ }), -/* 187 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $at = __webpack_require__(75)(true); - -// 21.1.3.27 String.prototype[@@iterator]() -__webpack_require__(78)(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 }; -}); - - -/***/ }), -/* 188 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.2 String.prototype.anchor(name) -__webpack_require__(13)('anchor', function (createHTML) { - return function anchor(name) { - return createHTML(this, 'a', 'name', name); - }; -}); - - -/***/ }), -/* 189 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.3 String.prototype.big() -__webpack_require__(13)('big', function (createHTML) { - return function big() { - return createHTML(this, 'big', '', ''); - }; -}); - - -/***/ }), -/* 190 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.4 String.prototype.blink() -__webpack_require__(13)('blink', function (createHTML) { - return function blink() { - return createHTML(this, 'blink', '', ''); - }; -}); - - -/***/ }), -/* 191 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.5 String.prototype.bold() -__webpack_require__(13)('bold', function (createHTML) { - return function bold() { - return createHTML(this, 'b', '', ''); - }; -}); - - -/***/ }), -/* 192 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.6 String.prototype.fixed() -__webpack_require__(13)('fixed', function (createHTML) { - return function fixed() { - return createHTML(this, 'tt', '', ''); - }; -}); - - -/***/ }), -/* 193 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.7 String.prototype.fontcolor(color) -__webpack_require__(13)('fontcolor', function (createHTML) { - return function fontcolor(color) { - return createHTML(this, 'font', 'color', color); - }; -}); - - -/***/ }), -/* 194 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.8 String.prototype.fontsize(size) -__webpack_require__(13)('fontsize', function (createHTML) { - return function fontsize(size) { - return createHTML(this, 'font', 'size', size); - }; -}); - - -/***/ }), -/* 195 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.9 String.prototype.italics() -__webpack_require__(13)('italics', function (createHTML) { - return function italics() { - return createHTML(this, 'i', '', ''); - }; -}); - - -/***/ }), -/* 196 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.10 String.prototype.link(url) -__webpack_require__(13)('link', function (createHTML) { - return function link(url) { - return createHTML(this, 'a', 'href', url); - }; -}); - - -/***/ }), -/* 197 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.11 String.prototype.small() -__webpack_require__(13)('small', function (createHTML) { - return function small() { - return createHTML(this, 'small', '', ''); - }; -}); - - -/***/ }), -/* 198 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.12 String.prototype.strike() -__webpack_require__(13)('strike', function (createHTML) { - return function strike() { - return createHTML(this, 'strike', '', ''); - }; -}); - - -/***/ }), -/* 199 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.13 String.prototype.sub() -__webpack_require__(13)('sub', function (createHTML) { - return function sub() { - return createHTML(this, 'sub', '', ''); - }; -}); - - -/***/ }), -/* 200 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// B.2.3.14 String.prototype.sup() -__webpack_require__(13)('sup', function (createHTML) { - return function sup() { - return createHTML(this, 'sup', '', ''); - }; -}); - - -/***/ }), -/* 201 */ -/***/ (function(module, exports, __webpack_require__) { - -// 22.1.2.2 / 15.4.3.2 Array.isArray(arg) -var $export = __webpack_require__(0); - -$export($export.S, 'Array', { isArray: __webpack_require__(52) }); - - -/***/ }), -/* 202 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var ctx = __webpack_require__(18); -var $export = __webpack_require__(0); -var toObject = __webpack_require__(9); -var call = __webpack_require__(104); -var isArrayIter = __webpack_require__(80); -var toLength = __webpack_require__(8); -var createProperty = __webpack_require__(81); -var getIterFn = __webpack_require__(82); - -$export($export.S + $export.F * !__webpack_require__(54)(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; - } -}); - - -/***/ }), -/* 203 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var createProperty = __webpack_require__(81); - -// WebKit Array.of isn't generic -$export($export.S + $export.F * __webpack_require__(3)(function () { - function F() { /* empty */ } - return !(Array.of.call(F) instanceof F); -}), 'Array', { - // 22.1.2.3 Array.of( ...items) - of: function of(/* ...args */) { - var index = 0; - var aLen = arguments.length; - var result = new (typeof this == 'function' ? this : Array)(aLen); - while (aLen > index) createProperty(result, index, arguments[index++]); - result.length = aLen; - return result; - } -}); - - -/***/ }), -/* 204 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 22.1.3.13 Array.prototype.join(separator) -var $export = __webpack_require__(0); -var toIObject = __webpack_require__(15); -var arrayJoin = [].join; - -// fallback for not array-like strings -$export($export.P + $export.F * (__webpack_require__(46) != Object || !__webpack_require__(20)(arrayJoin)), 'Array', { - join: function join(separator) { - return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); - } -}); - - -/***/ }), -/* 205 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var html = __webpack_require__(68); -var cof = __webpack_require__(19); -var toAbsoluteIndex = __webpack_require__(35); -var toLength = __webpack_require__(8); -var arraySlice = [].slice; - -// fallback for not array-like ES3 strings and DOM objects -$export($export.P + $export.F * __webpack_require__(3)(function () { - if (html) arraySlice.call(html); -}), 'Array', { - slice: function slice(begin, end) { - var len = toLength(this.length); - var klass = cof(this); - end = end === undefined ? len : end; - if (klass == 'Array') return arraySlice.call(this, begin, end); - var start = toAbsoluteIndex(begin, len); - var upTo = toAbsoluteIndex(end, len); - var size = toLength(upTo - start); - var cloned = new Array(size); - var i = 0; - for (; i < size; i++) cloned[i] = klass == 'String' - ? this.charAt(start + i) - : this[start + i]; - return cloned; - } -}); - - -/***/ }), -/* 206 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var aFunction = __webpack_require__(10); -var toObject = __webpack_require__(9); -var fails = __webpack_require__(3); -var $sort = [].sort; -var test = [1, 2, 3]; - -$export($export.P + $export.F * (fails(function () { - // IE8- - test.sort(undefined); -}) || !fails(function () { - // V8 bug - test.sort(null); - // Old WebKit -}) || !__webpack_require__(20)($sort)), 'Array', { - // 22.1.3.25 Array.prototype.sort(comparefn) - sort: function sort(comparefn) { - return comparefn === undefined - ? $sort.call(toObject(this)) - : $sort.call(toObject(this), aFunction(comparefn)); - } -}); - - -/***/ }), -/* 207 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $forEach = __webpack_require__(25)(0); -var STRICT = __webpack_require__(20)([].forEach, true); - -$export($export.P + $export.F * !STRICT, 'Array', { - // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) - forEach: function forEach(callbackfn /* , thisArg */) { - return $forEach(this, callbackfn, arguments[1]); - } -}); - - -/***/ }), -/* 208 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(4); -var isArray = __webpack_require__(52); -var SPECIES = __webpack_require__(5)('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; -}; - - -/***/ }), -/* 209 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $map = __webpack_require__(25)(1); - -$export($export.P + $export.F * !__webpack_require__(20)([].map, true), 'Array', { - // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) - map: function map(callbackfn /* , thisArg */) { - return $map(this, callbackfn, arguments[1]); - } -}); - - -/***/ }), -/* 210 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $filter = __webpack_require__(25)(2); - -$export($export.P + $export.F * !__webpack_require__(20)([].filter, true), 'Array', { - // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) - filter: function filter(callbackfn /* , thisArg */) { - return $filter(this, callbackfn, arguments[1]); - } -}); - - -/***/ }), -/* 211 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $some = __webpack_require__(25)(3); - -$export($export.P + $export.F * !__webpack_require__(20)([].some, true), 'Array', { - // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) - some: function some(callbackfn /* , thisArg */) { - return $some(this, callbackfn, arguments[1]); - } -}); - - -/***/ }), -/* 212 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $every = __webpack_require__(25)(4); - -$export($export.P + $export.F * !__webpack_require__(20)([].every, true), 'Array', { - // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) - every: function every(callbackfn /* , thisArg */) { - return $every(this, callbackfn, arguments[1]); - } -}); - - -/***/ }), -/* 213 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $reduce = __webpack_require__(105); - -$export($export.P + $export.F * !__webpack_require__(20)([].reduce, true), 'Array', { - // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) - reduce: function reduce(callbackfn /* , initialValue */) { - return $reduce(this, callbackfn, arguments.length, arguments[1], false); - } -}); - - -/***/ }), -/* 214 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $reduce = __webpack_require__(105); - -$export($export.P + $export.F * !__webpack_require__(20)([].reduceRight, true), 'Array', { - // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) - reduceRight: function reduceRight(callbackfn /* , initialValue */) { - return $reduce(this, callbackfn, arguments.length, arguments[1], true); - } -}); - - -/***/ }), -/* 215 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $indexOf = __webpack_require__(50)(false); -var $native = [].indexOf; -var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; - -$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(20)($native)), 'Array', { - // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) - indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { - return NEGATIVE_ZERO - // convert -0 to +0 - ? $native.apply(this, arguments) || 0 - : $indexOf(this, searchElement, arguments[1]); - } -}); - - -/***/ }), -/* 216 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var toIObject = __webpack_require__(15); -var toInteger = __webpack_require__(23); -var toLength = __webpack_require__(8); -var $native = [].lastIndexOf; -var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; - -$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(20)($native)), 'Array', { - // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) - lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { - // convert -0 to +0 - if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0; - var O = toIObject(this); - var length = toLength(O.length); - var index = length - 1; - if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1])); - if (index < 0) index = length + index; - for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0; - return -1; - } -}); - - -/***/ }), -/* 217 */ -/***/ (function(module, exports, __webpack_require__) { - -// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) -var $export = __webpack_require__(0); - -$export($export.P, 'Array', { copyWithin: __webpack_require__(106) }); - -__webpack_require__(31)('copyWithin'); - - -/***/ }), -/* 218 */ -/***/ (function(module, exports, __webpack_require__) { - -// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) -var $export = __webpack_require__(0); - -$export($export.P, 'Array', { fill: __webpack_require__(84) }); - -__webpack_require__(31)('fill'); - - -/***/ }), -/* 219 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) -var $export = __webpack_require__(0); -var $find = __webpack_require__(25)(5); -var KEY = 'find'; -var forced = true; -// Shouldn't skip holes -if (KEY in []) Array(1)[KEY](function () { forced = false; }); -$export($export.P + $export.F * forced, 'Array', { - find: function find(callbackfn /* , that = undefined */) { - return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } -}); -__webpack_require__(31)(KEY); - - -/***/ }), -/* 220 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) -var $export = __webpack_require__(0); -var $find = __webpack_require__(25)(6); -var KEY = 'findIndex'; -var forced = true; -// Shouldn't skip holes -if (KEY in []) Array(1)[KEY](function () { forced = false; }); -$export($export.P + $export.F * forced, 'Array', { - findIndex: function findIndex(callbackfn /* , that = undefined */) { - return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } -}); -__webpack_require__(31)(KEY); - - -/***/ }), -/* 221 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(38)('Array'); - - -/***/ }), -/* 222 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(2); -var inheritIfRequired = __webpack_require__(70); -var dP = __webpack_require__(7).f; -var gOPN = __webpack_require__(37).f; -var isRegExp = __webpack_require__(53); -var $flags = __webpack_require__(55); -var $RegExp = global.RegExp; -var Base = $RegExp; -var proto = $RegExp.prototype; -var re1 = /a/g; -var re2 = /a/g; -// "new" creates a new object, old webkit buggy here -var CORRECT_NEW = new $RegExp(re1) !== re1; - -if (__webpack_require__(6) && (!CORRECT_NEW || __webpack_require__(3)(function () { - re2[__webpack_require__(5)('match')] = false; - // RegExp constructor can alter flags and IsRegExp works correct with @@match - return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i'; -}))) { - $RegExp = function RegExp(p, f) { - var tiRE = this instanceof $RegExp; - var piRE = isRegExp(p); - var fiU = f === undefined; - return !tiRE && piRE && p.constructor === $RegExp && fiU ? p - : inheritIfRequired(CORRECT_NEW - ? new Base(piRE && !fiU ? p.source : p, f) - : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f) - , tiRE ? this : proto, $RegExp); - }; - var proxy = function (key) { - key in $RegExp || dP($RegExp, key, { - configurable: true, - get: function () { return Base[key]; }, - set: function (it) { Base[key] = it; } - }); - }; - for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]); - proto.constructor = $RegExp; - $RegExp.prototype = proto; - __webpack_require__(12)(global, 'RegExp', $RegExp); -} - -__webpack_require__(38)('RegExp'); - - -/***/ }), -/* 223 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -__webpack_require__(108); -var anObject = __webpack_require__(1); -var $flags = __webpack_require__(55); -var DESCRIPTORS = __webpack_require__(6); -var TO_STRING = 'toString'; -var $toString = /./[TO_STRING]; - -var define = function (fn) { - __webpack_require__(12)(RegExp.prototype, TO_STRING, fn, true); -}; - -// 21.2.5.14 RegExp.prototype.toString() -if (__webpack_require__(3)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) { - define(function toString() { - var R = anObject(this); - return '/'.concat(R.source, '/', - 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined); - }); -// FF44- RegExp#toString has a wrong name -} else if ($toString.name != TO_STRING) { - define(function toString() { - return $toString.call(this); - }); -} - - -/***/ }), -/* 224 */ -/***/ (function(module, exports, __webpack_require__) { - -// @@match logic -__webpack_require__(56)('match', 1, function (defined, MATCH, $match) { - // 21.1.3.11 String.prototype.match(regexp) - return [function match(regexp) { - 'use strict'; - var O = defined(this); - var fn = regexp == undefined ? undefined : regexp[MATCH]; - return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); - }, $match]; -}); - - -/***/ }), -/* 225 */ -/***/ (function(module, exports, __webpack_require__) { - -// @@replace logic -__webpack_require__(56)('replace', 2, function (defined, REPLACE, $replace) { - // 21.1.3.14 String.prototype.replace(searchValue, replaceValue) - return [function replace(searchValue, replaceValue) { - 'use strict'; - var O = defined(this); - var fn = searchValue == undefined ? undefined : searchValue[REPLACE]; - return fn !== undefined - ? fn.call(searchValue, O, replaceValue) - : $replace.call(String(O), searchValue, replaceValue); - }, $replace]; -}); - - -/***/ }), -/* 226 */ -/***/ (function(module, exports, __webpack_require__) { - -// @@search logic -__webpack_require__(56)('search', 1, function (defined, SEARCH, $search) { - // 21.1.3.15 String.prototype.search(regexp) - return [function search(regexp) { - 'use strict'; - var O = defined(this); - var fn = regexp == undefined ? undefined : regexp[SEARCH]; - return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); - }, $search]; -}); - - -/***/ }), -/* 227 */ -/***/ (function(module, exports, __webpack_require__) { - -// @@split logic -__webpack_require__(56)('split', 2, function (defined, SPLIT, $split) { - 'use strict'; - var isRegExp = __webpack_require__(53); - var _split = $split; - var $push = [].push; - var $SPLIT = 'split'; - var LENGTH = 'length'; - var LAST_INDEX = 'lastIndex'; - if ( - 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || - 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || - 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || - '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || - '.'[$SPLIT](/()()/)[LENGTH] > 1 || - ''[$SPLIT](/.?/)[LENGTH] - ) { - var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group - // based on es5-shim implementation, need to rework it - $split = function (separator, limit) { - var string = String(this); - if (separator === undefined && limit === 0) return []; - // If `separator` is not a regex, use native split - if (!isRegExp(separator)) return _split.call(string, separator, limit); - var output = []; - var flags = (separator.ignoreCase ? 'i' : '') + - (separator.multiline ? 'm' : '') + - (separator.unicode ? 'u' : '') + - (separator.sticky ? 'y' : ''); - var lastLastIndex = 0; - var splitLimit = limit === undefined ? 4294967295 : limit >>> 0; - // Make `global` and avoid `lastIndex` issues by working with a copy - var separatorCopy = new RegExp(separator.source, flags + 'g'); - var separator2, match, lastIndex, lastLength, i; - // Doesn't need flags gy, but they don't hurt - if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags); - while (match = separatorCopy.exec(string)) { - // `separatorCopy.lastIndex` is not reliable cross-browser - lastIndex = match.index + match[0][LENGTH]; - if (lastIndex > lastLastIndex) { - output.push(string.slice(lastLastIndex, match.index)); - // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG - // eslint-disable-next-line no-loop-func - if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () { - for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined; - }); - if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1)); - lastLength = match[0][LENGTH]; - lastLastIndex = lastIndex; - if (output[LENGTH] >= splitLimit) break; - } - if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop - } - if (lastLastIndex === string[LENGTH]) { - if (lastLength || !separatorCopy.test('')) output.push(''); - } else output.push(string.slice(lastLastIndex)); - return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; - }; - // Chakra, V8 - } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) { - $split = function (separator, limit) { - return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit); - }; - } - // 21.1.3.17 String.prototype.split(separator, limit) - return [function split(separator, limit) { - var O = defined(this); - var fn = separator == undefined ? undefined : separator[SPLIT]; - return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit); - }, $split]; -}); - - -/***/ }), -/* 228 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var LIBRARY = __webpack_require__(30); -var global = __webpack_require__(2); -var ctx = __webpack_require__(18); -var classof = __webpack_require__(48); -var $export = __webpack_require__(0); -var isObject = __webpack_require__(4); -var aFunction = __webpack_require__(10); -var anInstance = __webpack_require__(39); -var forOf = __webpack_require__(40); -var speciesConstructor = __webpack_require__(57); -var task = __webpack_require__(86).set; -var microtask = __webpack_require__(87)(); -var newPromiseCapabilityModule = __webpack_require__(88); -var perform = __webpack_require__(109); -var userAgent = __webpack_require__(58); -var promiseResolve = __webpack_require__(110); -var PROMISE = 'Promise'; -var TypeError = global.TypeError; -var process = global.process; -var versions = process && process.versions; -var v8 = versions && versions.v8 || ''; -var $Promise = global[PROMISE]; -var isNode = classof(process) == 'process'; -var empty = function () { /* empty */ }; -var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; -var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; - -var USE_NATIVE = !!function () { - try { - // correct subclassing with @@species support - var promise = $Promise.resolve(1); - var FakePromise = (promise.constructor = {})[__webpack_require__(5)('species')] = function (exec) { - exec(empty, empty); - }; - // unhandled rejections tracking support, NodeJS Promise without it fails @@species test - return (isNode || typeof PromiseRejectionEvent == 'function') - && promise.then(empty) instanceof FakePromise - // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables - // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 - // we can't detect it synchronously, so just check versions - && v8.indexOf('6.6') !== 0 - && userAgent.indexOf('Chrome/66') === -1; - } catch (e) { /* empty */ } -}(); - -// helpers -var isThenable = function (it) { - var then; - return isObject(it) && typeof (then = it.then) == 'function' ? then : false; -}; -var notify = function (promise, isReject) { - if (promise._n) return; - promise._n = true; - var chain = promise._c; - microtask(function () { - var value = promise._v; - var ok = promise._s == 1; - var i = 0; - var run = function (reaction) { - var handler = ok ? reaction.ok : reaction.fail; - var resolve = reaction.resolve; - var reject = reaction.reject; - var domain = reaction.domain; - var result, then, exited; - try { - if (handler) { - if (!ok) { - if (promise._h == 2) onHandleUnhandled(promise); - promise._h = 1; - } - if (handler === true) result = value; - else { - if (domain) domain.enter(); - result = handler(value); // may throw - if (domain) { - domain.exit(); - exited = true; - } - } - if (result === reaction.promise) { - reject(TypeError('Promise-chain cycle')); - } else if (then = isThenable(result)) { - then.call(result, resolve, reject); - } else resolve(result); - } else reject(value); - } catch (e) { - if (domain && !exited) domain.exit(); - reject(e); - } - }; - while (chain.length > i) run(chain[i++]); // variable length - can't use forEach - promise._c = []; - promise._n = false; - if (isReject && !promise._h) onUnhandled(promise); - }); -}; -var onUnhandled = function (promise) { - task.call(global, function () { - var value = promise._v; - var unhandled = isUnhandled(promise); - var result, handler, console; - if (unhandled) { - result = perform(function () { - if (isNode) { - process.emit('unhandledRejection', value, promise); - } else if (handler = global.onunhandledrejection) { - handler({ promise: promise, reason: value }); - } else if ((console = global.console) && console.error) { - console.error('Unhandled promise rejection', value); - } - }); - // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should - promise._h = isNode || isUnhandled(promise) ? 2 : 1; - } promise._a = undefined; - if (unhandled && result.e) throw result.v; - }); -}; -var isUnhandled = function (promise) { - return promise._h !== 1 && (promise._a || promise._c).length === 0; -}; -var onHandleUnhandled = function (promise) { - task.call(global, function () { - var handler; - if (isNode) { - process.emit('rejectionHandled', promise); - } else if (handler = global.onrejectionhandled) { - handler({ promise: promise, reason: promise._v }); - } - }); -}; -var $reject = function (value) { - var promise = this; - if (promise._d) return; - promise._d = true; - promise = promise._w || promise; // unwrap - promise._v = value; - promise._s = 2; - if (!promise._a) promise._a = promise._c.slice(); - notify(promise, true); -}; -var $resolve = function (value) { - var promise = this; - var then; - if (promise._d) return; - promise._d = true; - promise = promise._w || promise; // unwrap - try { - if (promise === value) throw TypeError("Promise can't be resolved itself"); - if (then = isThenable(value)) { - microtask(function () { - var wrapper = { _w: promise, _d: false }; // wrap - try { - then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); - } catch (e) { - $reject.call(wrapper, e); - } - }); - } else { - promise._v = value; - promise._s = 1; - notify(promise, false); - } - } catch (e) { - $reject.call({ _w: promise, _d: false }, e); // wrap - } -}; - -// constructor polyfill -if (!USE_NATIVE) { - // 25.4.3.1 Promise(executor) - $Promise = function Promise(executor) { - anInstance(this, $Promise, PROMISE, '_h'); - aFunction(executor); - Internal.call(this); - try { - executor(ctx($resolve, this, 1), ctx($reject, this, 1)); - } catch (err) { - $reject.call(this, err); - } - }; - // eslint-disable-next-line no-unused-vars - Internal = function Promise(executor) { - this._c = []; // <- awaiting reactions - this._a = undefined; // <- checked in isUnhandled reactions - this._s = 0; // <- state - this._d = false; // <- done - this._v = undefined; // <- value - this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled - this._n = false; // <- notify - }; - Internal.prototype = __webpack_require__(41)($Promise.prototype, { - // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) - then: function then(onFulfilled, onRejected) { - var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); - reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; - reaction.fail = typeof onRejected == 'function' && onRejected; - reaction.domain = isNode ? process.domain : undefined; - this._c.push(reaction); - if (this._a) this._a.push(reaction); - if (this._s) notify(this, false); - return reaction.promise; - }, - // 25.4.5.1 Promise.prototype.catch(onRejected) - 'catch': function (onRejected) { - return this.then(undefined, onRejected); - } - }); - OwnPromiseCapability = function () { - var promise = new Internal(); - this.promise = promise; - this.resolve = ctx($resolve, promise, 1); - this.reject = ctx($reject, promise, 1); - }; - newPromiseCapabilityModule.f = newPromiseCapability = function (C) { - return C === $Promise || C === Wrapper - ? new OwnPromiseCapability(C) - : newGenericPromiseCapability(C); - }; -} - -$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); -__webpack_require__(42)($Promise, PROMISE); -__webpack_require__(38)(PROMISE); -Wrapper = __webpack_require__(26)[PROMISE]; - -// statics -$export($export.S + $export.F * !USE_NATIVE, PROMISE, { - // 25.4.4.5 Promise.reject(r) - reject: function reject(r) { - var capability = newPromiseCapability(this); - var $$reject = capability.reject; - $$reject(r); - return capability.promise; - } -}); -$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { - // 25.4.4.6 Promise.resolve(x) - resolve: function resolve(x) { - return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); - } -}); -$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(54)(function (iter) { - $Promise.all(iter)['catch'](empty); -})), PROMISE, { - // 25.4.4.1 Promise.all(iterable) - all: function all(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var resolve = capability.resolve; - var reject = capability.reject; - var result = perform(function () { - var values = []; - var index = 0; - var remaining = 1; - forOf(iterable, false, function (promise) { - var $index = index++; - var alreadyCalled = false; - values.push(undefined); - remaining++; - C.resolve(promise).then(function (value) { - if (alreadyCalled) return; - alreadyCalled = true; - values[$index] = value; - --remaining || resolve(values); - }, reject); - }); - --remaining || resolve(values); - }); - if (result.e) reject(result.v); - return capability.promise; - }, - // 25.4.4.4 Promise.race(iterable) - race: function race(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var reject = capability.reject; - var result = perform(function () { - forOf(iterable, false, function (promise) { - C.resolve(promise).then(capability.resolve, reject); - }); - }); - if (result.e) reject(result.v); - return capability.promise; - } -}); - - -/***/ }), -/* 229 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var weak = __webpack_require__(115); -var validate = __webpack_require__(45); -var WEAK_SET = 'WeakSet'; - -// 23.4 WeakSet Objects -__webpack_require__(59)(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); - - -/***/ }), -/* 230 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.1 Reflect.apply(target, thisArgument, argumentsList) -var $export = __webpack_require__(0); -var aFunction = __webpack_require__(10); -var anObject = __webpack_require__(1); -var rApply = (__webpack_require__(2).Reflect || {}).apply; -var fApply = Function.apply; -// MS Edge argumentsList argument is optional -$export($export.S + $export.F * !__webpack_require__(3)(function () { - rApply(function () { /* empty */ }); -}), 'Reflect', { - apply: function apply(target, thisArgument, argumentsList) { - var T = aFunction(target); - var L = anObject(argumentsList); - return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); - } -}); - - -/***/ }), -/* 231 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) -var $export = __webpack_require__(0); -var create = __webpack_require__(36); -var aFunction = __webpack_require__(10); -var anObject = __webpack_require__(1); -var isObject = __webpack_require__(4); -var fails = __webpack_require__(3); -var bind = __webpack_require__(96); -var rConstruct = (__webpack_require__(2).Reflect || {}).construct; - -// MS Edge supports only 2 arguments and argumentsList argument is optional -// FF Nightly sets third argument as `new.target`, but does not create `this` from it -var NEW_TARGET_BUG = fails(function () { - function F() { /* empty */ } - return !(rConstruct(function () { /* empty */ }, [], F) instanceof F); -}); -var ARGS_BUG = !fails(function () { - rConstruct(function () { /* empty */ }); -}); - -$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { - construct: function construct(Target, args /* , newTarget */) { - aFunction(Target); - anObject(args); - var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); - if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget); - if (Target == newTarget) { - // w/o altered newTarget, optimization for 0-4 arguments - switch (args.length) { - case 0: return new Target(); - case 1: return new Target(args[0]); - case 2: return new Target(args[0], args[1]); - case 3: return new Target(args[0], args[1], args[2]); - case 4: return new Target(args[0], args[1], args[2], args[3]); - } - // w/o altered newTarget, lot of arguments case - var $args = [null]; - $args.push.apply($args, args); - return new (bind.apply(Target, $args))(); - } - // with altered newTarget, not support built-in constructors - var proto = newTarget.prototype; - var instance = create(isObject(proto) ? proto : Object.prototype); - var result = Function.apply.call(Target, instance, args); - return isObject(result) ? result : instance; - } -}); - - -/***/ }), -/* 232 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) -var dP = __webpack_require__(7); -var $export = __webpack_require__(0); -var anObject = __webpack_require__(1); -var toPrimitive = __webpack_require__(21); - -// MS Edge has broken Reflect.defineProperty - throwing instead of returning false -$export($export.S + $export.F * __webpack_require__(3)(function () { - // eslint-disable-next-line no-undef - Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 }); -}), 'Reflect', { - defineProperty: function defineProperty(target, propertyKey, attributes) { - anObject(target); - propertyKey = toPrimitive(propertyKey, true); - anObject(attributes); - try { - dP.f(target, propertyKey, attributes); - return true; - } catch (e) { - return false; - } - } -}); - - -/***/ }), -/* 233 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.4 Reflect.deleteProperty(target, propertyKey) -var $export = __webpack_require__(0); -var gOPD = __webpack_require__(16).f; -var anObject = __webpack_require__(1); - -$export($export.S, 'Reflect', { - deleteProperty: function deleteProperty(target, propertyKey) { - var desc = gOPD(anObject(target), propertyKey); - return desc && !desc.configurable ? false : delete target[propertyKey]; - } -}); - - -/***/ }), -/* 234 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 26.1.5 Reflect.enumerate(target) -var $export = __webpack_require__(0); -var anObject = __webpack_require__(1); -var Enumerate = function (iterated) { - this._t = anObject(iterated); // target - this._i = 0; // next index - var keys = this._k = []; // keys - var key; - for (key in iterated) keys.push(key); -}; -__webpack_require__(79)(Enumerate, 'Object', function () { - var that = this; - var keys = that._k; - var key; - do { - if (that._i >= keys.length) return { value: undefined, done: true }; - } while (!((key = keys[that._i++]) in that._t)); - return { value: key, done: false }; -}); - -$export($export.S, 'Reflect', { - enumerate: function enumerate(target) { - return new Enumerate(target); - } -}); - - -/***/ }), -/* 235 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.6 Reflect.get(target, propertyKey [, receiver]) -var gOPD = __webpack_require__(16); -var getPrototypeOf = __webpack_require__(17); -var has = __webpack_require__(14); -var $export = __webpack_require__(0); -var isObject = __webpack_require__(4); -var anObject = __webpack_require__(1); - -function get(target, propertyKey /* , receiver */) { - var receiver = arguments.length < 3 ? target : arguments[2]; - var desc, proto; - if (anObject(target) === receiver) return target[propertyKey]; - if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value') - ? desc.value - : desc.get !== undefined - ? desc.get.call(receiver) - : undefined; - if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver); -} - -$export($export.S, 'Reflect', { get: get }); - - -/***/ }), -/* 236 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) -var gOPD = __webpack_require__(16); -var $export = __webpack_require__(0); -var anObject = __webpack_require__(1); - -$export($export.S, 'Reflect', { - getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { - return gOPD.f(anObject(target), propertyKey); - } -}); - - -/***/ }), -/* 237 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.8 Reflect.getPrototypeOf(target) -var $export = __webpack_require__(0); -var getProto = __webpack_require__(17); -var anObject = __webpack_require__(1); - -$export($export.S, 'Reflect', { - getPrototypeOf: function getPrototypeOf(target) { - return getProto(anObject(target)); - } -}); - - -/***/ }), -/* 238 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.9 Reflect.has(target, propertyKey) -var $export = __webpack_require__(0); - -$export($export.S, 'Reflect', { - has: function has(target, propertyKey) { - return propertyKey in target; - } -}); - - -/***/ }), -/* 239 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.10 Reflect.isExtensible(target) -var $export = __webpack_require__(0); -var anObject = __webpack_require__(1); -var $isExtensible = Object.isExtensible; - -$export($export.S, 'Reflect', { - isExtensible: function isExtensible(target) { - anObject(target); - return $isExtensible ? $isExtensible(target) : true; - } -}); - - -/***/ }), -/* 240 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.11 Reflect.ownKeys(target) -var $export = __webpack_require__(0); - -$export($export.S, 'Reflect', { ownKeys: __webpack_require__(116) }); - - -/***/ }), -/* 241 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.12 Reflect.preventExtensions(target) -var $export = __webpack_require__(0); -var anObject = __webpack_require__(1); -var $preventExtensions = Object.preventExtensions; - -$export($export.S, 'Reflect', { - preventExtensions: function preventExtensions(target) { - anObject(target); - try { - if ($preventExtensions) $preventExtensions(target); - return true; - } catch (e) { - return false; - } - } -}); - - -/***/ }), -/* 242 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) -var dP = __webpack_require__(7); -var gOPD = __webpack_require__(16); -var getPrototypeOf = __webpack_require__(17); -var has = __webpack_require__(14); -var $export = __webpack_require__(0); -var createDesc = __webpack_require__(32); -var anObject = __webpack_require__(1); -var isObject = __webpack_require__(4); - -function set(target, propertyKey, V /* , receiver */) { - var receiver = arguments.length < 4 ? target : arguments[3]; - var ownDesc = gOPD.f(anObject(target), propertyKey); - var existingDescriptor, proto; - if (!ownDesc) { - if (isObject(proto = getPrototypeOf(target))) { - return set(proto, propertyKey, V, receiver); - } - ownDesc = createDesc(0); - } - if (has(ownDesc, 'value')) { - if (ownDesc.writable === false || !isObject(receiver)) return false; - if (existingDescriptor = gOPD.f(receiver, propertyKey)) { - if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false; - existingDescriptor.value = V; - dP.f(receiver, propertyKey, existingDescriptor); - } else dP.f(receiver, propertyKey, createDesc(0, V)); - return true; - } - return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); -} - -$export($export.S, 'Reflect', { set: set }); - - -/***/ }), -/* 243 */ -/***/ (function(module, exports, __webpack_require__) { - -// 26.1.14 Reflect.setPrototypeOf(target, proto) -var $export = __webpack_require__(0); -var setProto = __webpack_require__(69); - -if (setProto) $export($export.S, 'Reflect', { - setPrototypeOf: function setPrototypeOf(target, proto) { - setProto.check(target, proto); - try { - setProto.set(target, proto); - return true; - } catch (e) { - return false; - } - } -}); - - -/***/ }), -/* 244 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.3.3.1 / 15.9.4.4 Date.now() -var $export = __webpack_require__(0); - -$export($export.S, 'Date', { now: function () { return new Date().getTime(); } }); - - -/***/ }), -/* 245 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var toObject = __webpack_require__(9); -var toPrimitive = __webpack_require__(21); - -$export($export.P + $export.F * __webpack_require__(3)(function () { - return new Date(NaN).toJSON() !== null - || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; -}), 'Date', { - // eslint-disable-next-line no-unused-vars - toJSON: function toJSON(key) { - var O = toObject(this); - var pv = toPrimitive(O); - return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); - } -}); - - -/***/ }), -/* 246 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() -var $export = __webpack_require__(0); -var toISOString = __webpack_require__(247); - -// PhantomJS / old WebKit has a broken implementations -$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', { - toISOString: toISOString -}); - - -/***/ }), -/* 247 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() -var fails = __webpack_require__(3); -var getTime = Date.prototype.getTime; -var $toISOString = Date.prototype.toISOString; - -var lz = function (num) { - return num > 9 ? num : '0' + num; -}; - -// PhantomJS / old WebKit has a broken implementations -module.exports = (fails(function () { - return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; -}) || !fails(function () { - $toISOString.call(new Date(NaN)); -})) ? function toISOString() { - if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value'); - var d = this; - var y = d.getUTCFullYear(); - var m = d.getUTCMilliseconds(); - var s = y < 0 ? '-' : y > 9999 ? '+' : ''; - return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + - '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + - 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + - ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; -} : $toISOString; - - -/***/ }), -/* 248 */ -/***/ (function(module, exports, __webpack_require__) { - -var DateProto = Date.prototype; -var INVALID_DATE = 'Invalid Date'; -var TO_STRING = 'toString'; -var $toString = DateProto[TO_STRING]; -var getTime = DateProto.getTime; -if (new Date(NaN) + '' != INVALID_DATE) { - __webpack_require__(12)(DateProto, TO_STRING, function toString() { - var value = getTime.call(this); - // eslint-disable-next-line no-self-compare - return value === value ? $toString.call(this) : INVALID_DATE; - }); -} - - -/***/ }), -/* 249 */ -/***/ (function(module, exports, __webpack_require__) { - -var TO_PRIMITIVE = __webpack_require__(5)('toPrimitive'); -var proto = Date.prototype; - -if (!(TO_PRIMITIVE in proto)) __webpack_require__(11)(proto, TO_PRIMITIVE, __webpack_require__(250)); - - -/***/ }), -/* 250 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var anObject = __webpack_require__(1); -var toPrimitive = __webpack_require__(21); -var NUMBER = 'number'; - -module.exports = function (hint) { - if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint'); - return toPrimitive(anObject(this), hint != NUMBER); -}; - - -/***/ }), -/* 251 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var $typed = __webpack_require__(60); -var buffer = __webpack_require__(89); -var anObject = __webpack_require__(1); -var toAbsoluteIndex = __webpack_require__(35); -var toLength = __webpack_require__(8); -var isObject = __webpack_require__(4); -var ArrayBuffer = __webpack_require__(2).ArrayBuffer; -var speciesConstructor = __webpack_require__(57); -var $ArrayBuffer = buffer.ArrayBuffer; -var $DataView = buffer.DataView; -var $isView = $typed.ABV && ArrayBuffer.isView; -var $slice = $ArrayBuffer.prototype.slice; -var VIEW = $typed.VIEW; -var ARRAY_BUFFER = 'ArrayBuffer'; - -$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer }); - -$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { - // 24.1.3.1 ArrayBuffer.isView(arg) - isView: function isView(it) { - return $isView && $isView(it) || isObject(it) && VIEW in it; - } -}); - -$export($export.P + $export.U + $export.F * __webpack_require__(3)(function () { - return !new $ArrayBuffer(2).slice(1, undefined).byteLength; -}), ARRAY_BUFFER, { - // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) - slice: function slice(start, end) { - if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix - var len = anObject(this).byteLength; - var first = toAbsoluteIndex(start, len); - var fin = toAbsoluteIndex(end === undefined ? len : end, len); - var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first)); - var viewS = new $DataView(this); - var viewT = new $DataView(result); - var index = 0; - while (first < fin) { - viewT.setUint8(index++, viewS.getUint8(first++)); - } return result; - } -}); - -__webpack_require__(38)(ARRAY_BUFFER); - - -/***/ }), -/* 252 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -$export($export.G + $export.W + $export.F * !__webpack_require__(60).ABV, { - DataView: __webpack_require__(89).DataView -}); - - -/***/ }), -/* 253 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(27)('Int8', 1, function (init) { - return function Int8Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 254 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(27)('Uint8', 1, function (init) { - return function Uint8Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 255 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(27)('Uint8', 1, function (init) { - return function Uint8ClampedArray(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}, true); - - -/***/ }), -/* 256 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(27)('Int16', 2, function (init) { - return function Int16Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 257 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(27)('Uint16', 2, function (init) { - return function Uint16Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 258 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(27)('Int32', 4, function (init) { - return function Int32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 259 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(27)('Uint32', 4, function (init) { - return function Uint32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 260 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(27)('Float32', 4, function (init) { - return function Float32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 261 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(27)('Float64', 8, function (init) { - return function Float64Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); - - -/***/ }), -/* 262 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/tc39/Array.prototype.includes -var $export = __webpack_require__(0); -var $includes = __webpack_require__(50)(true); - -$export($export.P, 'Array', { - includes: function includes(el /* , fromIndex = 0 */) { - return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); - } -}); - -__webpack_require__(31)('includes'); - - -/***/ }), -/* 263 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap -var $export = __webpack_require__(0); -var flattenIntoArray = __webpack_require__(118); -var toObject = __webpack_require__(9); -var toLength = __webpack_require__(8); -var aFunction = __webpack_require__(10); -var arraySpeciesCreate = __webpack_require__(83); - -$export($export.P, 'Array', { - flatMap: function flatMap(callbackfn /* , thisArg */) { - var O = toObject(this); - var sourceLen, A; - aFunction(callbackfn); - sourceLen = toLength(O.length); - A = arraySpeciesCreate(O, 0); - flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]); - return A; - } -}); - -__webpack_require__(31)('flatMap'); - - -/***/ }), -/* 264 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten -var $export = __webpack_require__(0); -var flattenIntoArray = __webpack_require__(118); -var toObject = __webpack_require__(9); -var toLength = __webpack_require__(8); -var toInteger = __webpack_require__(23); -var arraySpeciesCreate = __webpack_require__(83); - -$export($export.P, 'Array', { - flatten: function flatten(/* depthArg = 1 */) { - var depthArg = arguments[0]; - var O = toObject(this); - var sourceLen = toLength(O.length); - var A = arraySpeciesCreate(O, 0); - flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg)); - return A; - } -}); - -__webpack_require__(31)('flatten'); - - -/***/ }), -/* 265 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/mathiasbynens/String.prototype.at -var $export = __webpack_require__(0); -var $at = __webpack_require__(75)(true); - -$export($export.P, 'String', { - at: function at(pos) { - return $at(this, pos); - } -}); - - -/***/ }), -/* 266 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/tc39/proposal-string-pad-start-end -var $export = __webpack_require__(0); -var $pad = __webpack_require__(119); -var userAgent = __webpack_require__(58); - -// https://github.com/zloirock/core-js/issues/280 -$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { - padStart: function padStart(maxLength /* , fillString = ' ' */) { - return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); - } -}); - - -/***/ }), -/* 267 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/tc39/proposal-string-pad-start-end -var $export = __webpack_require__(0); -var $pad = __webpack_require__(119); -var userAgent = __webpack_require__(58); - -// https://github.com/zloirock/core-js/issues/280 -$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { - padEnd: function padEnd(maxLength /* , fillString = ' ' */) { - return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); - } -}); - - -/***/ }), -/* 268 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/sebmarkbage/ecmascript-string-left-right-trim -__webpack_require__(43)('trimLeft', function ($trim) { - return function trimLeft() { - return $trim(this, 1); - }; -}, 'trimStart'); - - -/***/ }), -/* 269 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/sebmarkbage/ecmascript-string-left-right-trim -__webpack_require__(43)('trimRight', function ($trim) { - return function trimRight() { - return $trim(this, 2); - }; -}, 'trimEnd'); - - -/***/ }), -/* 270 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://tc39.github.io/String.prototype.matchAll/ -var $export = __webpack_require__(0); -var defined = __webpack_require__(22); -var toLength = __webpack_require__(8); -var isRegExp = __webpack_require__(53); -var getFlags = __webpack_require__(55); -var RegExpProto = RegExp.prototype; - -var $RegExpStringIterator = function (regexp, string) { - this._r = regexp; - this._s = string; -}; - -__webpack_require__(79)($RegExpStringIterator, 'RegExp String', function next() { - var match = this._r.exec(this._s); - return { value: match, done: match === null }; -}); - -$export($export.P, 'String', { - matchAll: function matchAll(regexp) { - defined(this); - if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!'); - var S = String(this); - var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp); - var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags); - rx.lastIndex = toLength(regexp.lastIndex); - return new $RegExpStringIterator(rx, S); - } -}); - - -/***/ }), -/* 271 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(65)('asyncIterator'); - - -/***/ }), -/* 272 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(65)('observable'); - - -/***/ }), -/* 273 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/tc39/proposal-object-getownpropertydescriptors -var $export = __webpack_require__(0); -var ownKeys = __webpack_require__(116); -var toIObject = __webpack_require__(15); -var gOPD = __webpack_require__(16); -var createProperty = __webpack_require__(81); - -$export($export.S, 'Object', { - getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { - var O = toIObject(object); - var getDesc = gOPD.f; - var keys = ownKeys(O); - var result = {}; - var i = 0; - var key, desc; - while (keys.length > i) { - desc = getDesc(O, key = keys[i++]); - if (desc !== undefined) createProperty(result, key, desc); - } - return result; - } -}); - - -/***/ }), -/* 274 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/tc39/proposal-object-values-entries -var $export = __webpack_require__(0); -var $values = __webpack_require__(120)(false); - -$export($export.S, 'Object', { - values: function values(it) { - return $values(it); - } -}); - - -/***/ }), -/* 275 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/tc39/proposal-object-values-entries -var $export = __webpack_require__(0); -var $entries = __webpack_require__(120)(true); - -$export($export.S, 'Object', { - entries: function entries(it) { - return $entries(it); - } -}); - - -/***/ }), -/* 276 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var toObject = __webpack_require__(9); -var aFunction = __webpack_require__(10); -var $defineProperty = __webpack_require__(7); - -// B.2.2.2 Object.prototype.__defineGetter__(P, getter) -__webpack_require__(6) && $export($export.P + __webpack_require__(61), 'Object', { - __defineGetter__: function __defineGetter__(P, getter) { - $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true }); - } -}); - - -/***/ }), -/* 277 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var toObject = __webpack_require__(9); -var aFunction = __webpack_require__(10); -var $defineProperty = __webpack_require__(7); - -// B.2.2.3 Object.prototype.__defineSetter__(P, setter) -__webpack_require__(6) && $export($export.P + __webpack_require__(61), 'Object', { - __defineSetter__: function __defineSetter__(P, setter) { - $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true }); - } -}); - - -/***/ }), -/* 278 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var toObject = __webpack_require__(9); -var toPrimitive = __webpack_require__(21); -var getPrototypeOf = __webpack_require__(17); -var getOwnPropertyDescriptor = __webpack_require__(16).f; - -// B.2.2.4 Object.prototype.__lookupGetter__(P) -__webpack_require__(6) && $export($export.P + __webpack_require__(61), 'Object', { - __lookupGetter__: function __lookupGetter__(P) { - var O = toObject(this); - var K = toPrimitive(P, true); - var D; - do { - if (D = getOwnPropertyDescriptor(O, K)) return D.get; - } while (O = getPrototypeOf(O)); - } -}); - - -/***/ }), -/* 279 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $export = __webpack_require__(0); -var toObject = __webpack_require__(9); -var toPrimitive = __webpack_require__(21); -var getPrototypeOf = __webpack_require__(17); -var getOwnPropertyDescriptor = __webpack_require__(16).f; - -// B.2.2.5 Object.prototype.__lookupSetter__(P) -__webpack_require__(6) && $export($export.P + __webpack_require__(61), 'Object', { - __lookupSetter__: function __lookupSetter__(P) { - var O = toObject(this); - var K = toPrimitive(P, true); - var D; - do { - if (D = getOwnPropertyDescriptor(O, K)) return D.set; - } while (O = getPrototypeOf(O)); - } -}); - - -/***/ }), -/* 280 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/DavidBruant/Map-Set.prototype.toJSON -var $export = __webpack_require__(0); - -$export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(121)('Map') }); - - -/***/ }), -/* 281 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/DavidBruant/Map-Set.prototype.toJSON -var $export = __webpack_require__(0); - -$export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(121)('Set') }); - - -/***/ }), -/* 282 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of -__webpack_require__(62)('Map'); - - -/***/ }), -/* 283 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of -__webpack_require__(62)('Set'); - - -/***/ }), -/* 284 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of -__webpack_require__(62)('WeakMap'); - - -/***/ }), -/* 285 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of -__webpack_require__(62)('WeakSet'); - - -/***/ }), -/* 286 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from -__webpack_require__(63)('Map'); - - -/***/ }), -/* 287 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from -__webpack_require__(63)('Set'); - - -/***/ }), -/* 288 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from -__webpack_require__(63)('WeakMap'); - - -/***/ }), -/* 289 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from -__webpack_require__(63)('WeakSet'); - - -/***/ }), -/* 290 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/tc39/proposal-global -var $export = __webpack_require__(0); - -$export($export.G, { global: __webpack_require__(2) }); - - -/***/ }), -/* 291 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/tc39/proposal-global -var $export = __webpack_require__(0); - -$export($export.S, 'System', { global: __webpack_require__(2) }); - - -/***/ }), -/* 292 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/ljharb/proposal-is-error -var $export = __webpack_require__(0); -var cof = __webpack_require__(19); - -$export($export.S, 'Error', { - isError: function isError(it) { - return cof(it) === 'Error'; - } -}); - - -/***/ }), -/* 293 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - clamp: function clamp(x, lower, upper) { - return Math.min(upper, Math.max(lower, x)); - } -}); - - -/***/ }), -/* 294 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 }); - - -/***/ }), -/* 295 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __webpack_require__(0); -var RAD_PER_DEG = 180 / Math.PI; - -$export($export.S, 'Math', { - degrees: function degrees(radians) { - return radians * RAD_PER_DEG; - } -}); - - -/***/ }), -/* 296 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __webpack_require__(0); -var scale = __webpack_require__(123); -var fround = __webpack_require__(103); - -$export($export.S, 'Math', { - fscale: function fscale(x, inLow, inHigh, outLow, outHigh) { - return fround(scale(x, inLow, inHigh, outLow, outHigh)); - } -}); - - -/***/ }), -/* 297 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - iaddh: function iaddh(x0, x1, y0, y1) { - var $x0 = x0 >>> 0; - var $x1 = x1 >>> 0; - var $y0 = y0 >>> 0; - return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; - } -}); - - -/***/ }), -/* 298 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - isubh: function isubh(x0, x1, y0, y1) { - var $x0 = x0 >>> 0; - var $x1 = x1 >>> 0; - var $y0 = y0 >>> 0; - return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; - } -}); - - -/***/ }), -/* 299 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - imulh: function imulh(u, v) { - var UINT16 = 0xffff; - var $u = +u; - var $v = +v; - var u0 = $u & UINT16; - var v0 = $v & UINT16; - var u1 = $u >> 16; - var v1 = $v >> 16; - var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); - return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); - } -}); - - -/***/ }), -/* 300 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI }); - - -/***/ }), -/* 301 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __webpack_require__(0); -var DEG_PER_RAD = Math.PI / 180; - -$export($export.S, 'Math', { - radians: function radians(degrees) { - return degrees * DEG_PER_RAD; - } -}); - - -/***/ }), -/* 302 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { scale: __webpack_require__(123) }); - - -/***/ }), -/* 303 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { - umulh: function umulh(u, v) { - var UINT16 = 0xffff; - var $u = +u; - var $v = +v; - var u0 = $u & UINT16; - var v0 = $v & UINT16; - var u1 = $u >>> 16; - var v1 = $v >>> 16; - var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); - return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); - } -}); - - -/***/ }), -/* 304 */ -/***/ (function(module, exports, __webpack_require__) { - -// http://jfbastien.github.io/papers/Math.signbit.html -var $export = __webpack_require__(0); - -$export($export.S, 'Math', { signbit: function signbit(x) { - // eslint-disable-next-line no-self-compare - return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0; -} }); - - -/***/ }), -/* 305 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// https://github.com/tc39/proposal-promise-finally - -var $export = __webpack_require__(0); -var core = __webpack_require__(26); -var global = __webpack_require__(2); -var speciesConstructor = __webpack_require__(57); -var promiseResolve = __webpack_require__(110); - -$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { - var C = speciesConstructor(this, core.Promise || global.Promise); - var isFunction = typeof onFinally == 'function'; - return this.then( - isFunction ? function (x) { - return promiseResolve(C, onFinally()).then(function () { return x; }); - } : onFinally, - isFunction ? function (e) { - return promiseResolve(C, onFinally()).then(function () { throw e; }); - } : onFinally - ); -} }); - - -/***/ }), -/* 306 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/tc39/proposal-promise-try -var $export = __webpack_require__(0); -var newPromiseCapability = __webpack_require__(88); -var perform = __webpack_require__(109); - -$export($export.S, 'Promise', { 'try': function (callbackfn) { - var promiseCapability = newPromiseCapability.f(this); - var result = perform(callbackfn); - (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); - return promiseCapability.promise; -} }); - - -/***/ }), -/* 307 */ -/***/ (function(module, exports, __webpack_require__) { - -var metadata = __webpack_require__(28); -var anObject = __webpack_require__(1); -var toMetaKey = metadata.key; -var ordinaryDefineOwnMetadata = metadata.set; - -metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) { - ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); -} }); - - -/***/ }), -/* 308 */ -/***/ (function(module, exports, __webpack_require__) { - -var metadata = __webpack_require__(28); -var anObject = __webpack_require__(1); -var toMetaKey = metadata.key; -var getOrCreateMetadataMap = metadata.map; -var store = metadata.store; - -metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) { - var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]); - var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); - if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false; - if (metadataMap.size) return true; - var targetMetadata = store.get(target); - targetMetadata['delete'](targetKey); - return !!targetMetadata.size || store['delete'](target); -} }); - - -/***/ }), -/* 309 */ -/***/ (function(module, exports, __webpack_require__) { - -var metadata = __webpack_require__(28); -var anObject = __webpack_require__(1); -var getPrototypeOf = __webpack_require__(17); -var ordinaryHasOwnMetadata = metadata.has; -var ordinaryGetOwnMetadata = metadata.get; -var toMetaKey = metadata.key; - -var ordinaryGetMetadata = function (MetadataKey, O, P) { - var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); - if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P); - var parent = getPrototypeOf(O); - return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; -}; - -metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) { - return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); - - -/***/ }), -/* 310 */ -/***/ (function(module, exports, __webpack_require__) { - -var Set = __webpack_require__(113); -var from = __webpack_require__(122); -var metadata = __webpack_require__(28); -var anObject = __webpack_require__(1); -var getPrototypeOf = __webpack_require__(17); -var ordinaryOwnMetadataKeys = metadata.keys; -var toMetaKey = metadata.key; - -var ordinaryMetadataKeys = function (O, P) { - var oKeys = ordinaryOwnMetadataKeys(O, P); - var parent = getPrototypeOf(O); - if (parent === null) return oKeys; - var pKeys = ordinaryMetadataKeys(parent, P); - return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys; -}; - -metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) { - return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); -} }); - - -/***/ }), -/* 311 */ -/***/ (function(module, exports, __webpack_require__) { - -var metadata = __webpack_require__(28); -var anObject = __webpack_require__(1); -var ordinaryGetOwnMetadata = metadata.get; -var toMetaKey = metadata.key; - -metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) { - return ordinaryGetOwnMetadata(metadataKey, anObject(target) - , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); - - -/***/ }), -/* 312 */ -/***/ (function(module, exports, __webpack_require__) { - -var metadata = __webpack_require__(28); -var anObject = __webpack_require__(1); -var ordinaryOwnMetadataKeys = metadata.keys; -var toMetaKey = metadata.key; - -metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) { - return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); -} }); - - -/***/ }), -/* 313 */ -/***/ (function(module, exports, __webpack_require__) { - -var metadata = __webpack_require__(28); -var anObject = __webpack_require__(1); -var getPrototypeOf = __webpack_require__(17); -var ordinaryHasOwnMetadata = metadata.has; -var toMetaKey = metadata.key; - -var ordinaryHasMetadata = function (MetadataKey, O, P) { - var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); - if (hasOwn) return true; - var parent = getPrototypeOf(O); - return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; -}; - -metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) { - return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); - - -/***/ }), -/* 314 */ -/***/ (function(module, exports, __webpack_require__) { - -var metadata = __webpack_require__(28); -var anObject = __webpack_require__(1); -var ordinaryHasOwnMetadata = metadata.has; -var toMetaKey = metadata.key; - -metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) { - return ordinaryHasOwnMetadata(metadataKey, anObject(target) - , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); - - -/***/ }), -/* 315 */ -/***/ (function(module, exports, __webpack_require__) { - -var $metadata = __webpack_require__(28); -var anObject = __webpack_require__(1); -var aFunction = __webpack_require__(10); -var toMetaKey = $metadata.key; -var ordinaryDefineOwnMetadata = $metadata.set; - -$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) { - return function decorator(target, targetKey) { - ordinaryDefineOwnMetadata( - metadataKey, metadataValue, - (targetKey !== undefined ? anObject : aFunction)(target), - toMetaKey(targetKey) - ); - }; -} }); - - -/***/ }), -/* 316 */ -/***/ (function(module, exports, __webpack_require__) { - -// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask -var $export = __webpack_require__(0); -var microtask = __webpack_require__(87)(); -var process = __webpack_require__(2).process; -var isNode = __webpack_require__(19)(process) == 'process'; - -$export($export.G, { - asap: function asap(fn) { - var domain = isNode && process.domain; - microtask(domain ? domain.bind(fn) : fn); - } -}); - - -/***/ }), -/* 317 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/zenparsing/es-observable -var $export = __webpack_require__(0); -var global = __webpack_require__(2); -var core = __webpack_require__(26); -var microtask = __webpack_require__(87)(); -var OBSERVABLE = __webpack_require__(5)('observable'); -var aFunction = __webpack_require__(10); -var anObject = __webpack_require__(1); -var anInstance = __webpack_require__(39); -var redefineAll = __webpack_require__(41); -var hide = __webpack_require__(11); -var forOf = __webpack_require__(40); -var RETURN = forOf.RETURN; - -var getMethod = function (fn) { - return fn == null ? undefined : aFunction(fn); -}; - -var cleanupSubscription = function (subscription) { - var cleanup = subscription._c; - if (cleanup) { - subscription._c = undefined; - cleanup(); - } -}; - -var subscriptionClosed = function (subscription) { - return subscription._o === undefined; -}; - -var closeSubscription = function (subscription) { - if (!subscriptionClosed(subscription)) { - subscription._o = undefined; - cleanupSubscription(subscription); - } -}; - -var Subscription = function (observer, subscriber) { - anObject(observer); - this._c = undefined; - this._o = observer; - observer = new SubscriptionObserver(this); - try { - var cleanup = subscriber(observer); - var subscription = cleanup; - if (cleanup != null) { - if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); }; - else aFunction(cleanup); - this._c = cleanup; - } - } catch (e) { - observer.error(e); - return; - } if (subscriptionClosed(this)) cleanupSubscription(this); -}; - -Subscription.prototype = redefineAll({}, { - unsubscribe: function unsubscribe() { closeSubscription(this); } -}); - -var SubscriptionObserver = function (subscription) { - this._s = subscription; -}; - -SubscriptionObserver.prototype = redefineAll({}, { - next: function next(value) { - var subscription = this._s; - if (!subscriptionClosed(subscription)) { - var observer = subscription._o; - try { - var m = getMethod(observer.next); - if (m) return m.call(observer, value); - } catch (e) { - try { - closeSubscription(subscription); - } finally { - throw e; - } - } - } - }, - error: function error(value) { - var subscription = this._s; - if (subscriptionClosed(subscription)) throw value; - var observer = subscription._o; - subscription._o = undefined; - try { - var m = getMethod(observer.error); - if (!m) throw value; - value = m.call(observer, value); - } catch (e) { - try { - cleanupSubscription(subscription); - } finally { - throw e; - } - } cleanupSubscription(subscription); - return value; - }, - complete: function complete(value) { - var subscription = this._s; - if (!subscriptionClosed(subscription)) { - var observer = subscription._o; - subscription._o = undefined; - try { - var m = getMethod(observer.complete); - value = m ? m.call(observer, value) : undefined; - } catch (e) { - try { - cleanupSubscription(subscription); - } finally { - throw e; - } - } cleanupSubscription(subscription); - return value; - } - } -}); - -var $Observable = function Observable(subscriber) { - anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber); -}; - -redefineAll($Observable.prototype, { - subscribe: function subscribe(observer) { - return new Subscription(observer, this._f); - }, - forEach: function forEach(fn) { - var that = this; - return new (core.Promise || global.Promise)(function (resolve, reject) { - aFunction(fn); - var subscription = that.subscribe({ - next: function (value) { - try { - return fn(value); - } catch (e) { - reject(e); - subscription.unsubscribe(); - } - }, - error: reject, - complete: resolve - }); - }); - } -}); - -redefineAll($Observable, { - from: function from(x) { - var C = typeof this === 'function' ? this : $Observable; - var method = getMethod(anObject(x)[OBSERVABLE]); - if (method) { - var observable = anObject(method.call(x)); - return observable.constructor === C ? observable : new C(function (observer) { - return observable.subscribe(observer); - }); - } - return new C(function (observer) { - var done = false; - microtask(function () { - if (!done) { - try { - if (forOf(x, false, function (it) { - observer.next(it); - if (done) return RETURN; - }) === RETURN) return; - } catch (e) { - if (done) throw e; - observer.error(e); - return; - } observer.complete(); - } - }); - return function () { done = true; }; - }); - }, - of: function of() { - for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++]; - return new (typeof this === 'function' ? this : $Observable)(function (observer) { - var done = false; - microtask(function () { - if (!done) { - for (var j = 0; j < items.length; ++j) { - observer.next(items[j]); - if (done) return; - } observer.complete(); - } - }); - return function () { done = true; }; - }); - } -}); - -hide($Observable.prototype, OBSERVABLE, function () { return this; }); - -$export($export.G, { Observable: $Observable }); - -__webpack_require__(38)('Observable'); - - -/***/ }), -/* 318 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(0); -var $task = __webpack_require__(86); -$export($export.G + $export.B, { - setImmediate: $task.set, - clearImmediate: $task.clear -}); - - -/***/ }), -/* 319 */ -/***/ (function(module, exports, __webpack_require__) { - -var $iterators = __webpack_require__(85); -var getKeys = __webpack_require__(34); -var redefine = __webpack_require__(12); -var global = __webpack_require__(2); -var hide = __webpack_require__(11); -var Iterators = __webpack_require__(44); -var wks = __webpack_require__(5); -var ITERATOR = wks('iterator'); -var TO_STRING_TAG = wks('toStringTag'); -var ArrayValues = Iterators.Array; - -var DOMIterables = { - CSSRuleList: true, // TODO: Not spec compliant, should be false. - CSSStyleDeclaration: false, - CSSValueList: false, - ClientRectList: false, - DOMRectList: false, - DOMStringList: false, - DOMTokenList: true, - DataTransferItemList: false, - FileList: false, - HTMLAllCollection: false, - HTMLCollection: false, - HTMLFormElement: false, - HTMLSelectElement: false, - MediaList: true, // TODO: Not spec compliant, should be false. - MimeTypeArray: false, - NamedNodeMap: false, - NodeList: true, - PaintRequestList: false, - Plugin: false, - PluginArray: false, - SVGLengthList: false, - SVGNumberList: false, - SVGPathSegList: false, - SVGPointList: false, - SVGStringList: false, - SVGTransformList: false, - SourceBufferList: false, - StyleSheetList: true, // TODO: Not spec compliant, should be false. - TextTrackCueList: false, - TextTrackList: false, - TouchList: false -}; - -for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) { - var NAME = collections[i]; - var explicit = DOMIterables[NAME]; - var Collection = global[NAME]; - var proto = Collection && Collection.prototype; - var key; - if (proto) { - if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues); - if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); - Iterators[NAME] = ArrayValues; - if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true); - } -} - - -/***/ }), -/* 320 */ -/***/ (function(module, exports, __webpack_require__) { - -// ie9- setTimeout & setInterval additional parameters fix -var global = __webpack_require__(2); -var $export = __webpack_require__(0); -var userAgent = __webpack_require__(58); -var slice = [].slice; -var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check -var wrap = function (set) { - return function (fn, time /* , ...args */) { - var boundArgs = arguments.length > 2; - var args = boundArgs ? slice.call(arguments, 2) : false; - return set(boundArgs ? function () { - // eslint-disable-next-line no-new-func - (typeof fn == 'function' ? fn : Function(fn)).apply(this, args); - } : fn, time); - }; -}; -$export($export.G + $export.B + $export.F * MSIE, { - setTimeout: wrap(global.setTimeout), - setInterval: wrap(global.setInterval) -}); - - -/***/ }) -/******/ ]); -// CommonJS export -if (typeof module != 'undefined' && module.exports) module.exports = __e; -// RequireJS export -else if (typeof define == 'function' && define.amd) define(function () { return __e; }); -// Export to global object -else __g.core = __e; -}(1, 1); \ No newline at end of file diff --git a/node_modules/core-js/client/shim.min.js b/node_modules/core-js/client/shim.min.js deleted file mode 100644 index bc9b13fb8..000000000 --- a/node_modules/core-js/client/shim.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * core-js 2.5.7 - * https://github.com/zloirock/core-js - * License: http://rock.mit-license.org - * © 2018 Denis Pushkarev - */ -!function(e,i,Jt){"use strict";!function(r){var e={};function __webpack_require__(t){if(e[t])return e[t].exports;var n=e[t]={i:t,l:!1,exports:{}};return r[t].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}__webpack_require__.m=r,__webpack_require__.c=e,__webpack_require__.d=function(t,n,r){__webpack_require__.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},__webpack_require__.n=function(t){var n=t&&t.__esModule?function getDefault(){return t["default"]}:function getModuleExports(){return t};return __webpack_require__.d(n,"a",n),n},__webpack_require__.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=124)}([function(t,n,r){var v=r(2),g=r(26),y=r(11),d=r(12),_=r(18),b="prototype",S=function(t,n,r){var e,i,o,u,c=t&S.F,f=t&S.G,a=t&S.P,s=t&S.B,l=f?v:t&S.S?v[n]||(v[n]={}):(v[n]||{})[b],h=f?g:g[n]||(g[n]={}),p=h[b]||(h[b]={});for(e in f&&(r=n),r)o=((i=!c&&l&&l[e]!==Jt)?l:r)[e],u=s&&i?_(o,v):a&&"function"==typeof o?_(Function.call,o):o,l&&d(l,e,o,t&S.U),h[e]!=o&&y(h,e,u),a&&p[e]!=o&&(p[e]=o)};v.core=g,S.F=1,S.G=2,S.S=4,S.P=8,S.B=16,S.W=32,S.U=64,S.R=128,t.exports=S},function(t,n,r){var e=r(4);t.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof i&&(i=r)},function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,r){var e=r(49)("wks"),i=r(33),o=r(2).Symbol,u="function"==typeof o;(t.exports=function(t){return e[t]||(e[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=e},function(t,n,r){t.exports=!r(3)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n,r){var i=r(1),o=r(90),u=r(21),c=Object.defineProperty;n.f=r(6)?Object.defineProperty:function defineProperty(t,n,r){if(i(t),n=u(n,!0),i(r),o)try{return c(t,n,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[n]=r.value),t}},function(t,n,r){var e=r(23),i=Math.min;t.exports=function(t){return 0"+i+""};t.exports=function(n,t){var r={};r[n]=t(o),e(e.P+e.F*i(function(){var t=""[n]('"');return t!==t.toLowerCase()||3document.F=Object<\/script>"),t.close(),s=t.F;r--;)delete s[a][u[r]];return s()};t.exports=Object.create||function create(t,n){var r;return null!==t?(f[a]=i(t),r=new f,f[a]=null,r[c]=t):r=s(),n===Jt?r:o(r,n)}},function(t,n,r){var e=r(92),i=r(67).concat("length","prototype");n.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return e(t,i)}},function(t,n,r){var e=r(2),i=r(7),o=r(6),u=r(5)("species");t.exports=function(t){var n=e[t];o&&n&&!n[u]&&i.f(n,u,{configurable:!0,get:function(){return this}})}},function(t,n){t.exports=function(t,n,r,e){if(!(t instanceof n)||e!==Jt&&e in t)throw TypeError(r+": incorrect invocation!");return t}},function(t,n,r){var h=r(18),p=r(104),v=r(80),g=r(1),y=r(8),d=r(82),_={},b={};(n=t.exports=function(t,n,r,e,i){var o,u,c,f,a=i?function(){return t}:d(t),s=h(r,e,n?2:1),l=0;if("function"!=typeof a)throw TypeError(t+" is not iterable!");if(v(a)){for(o=y(t.length);l>>=1)&&(n+=n))1&e&&(r+=n);return r}},function(t,n){t.exports=Math.sign||function sign(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,n){var r=Math.expm1;t.exports=!r||22025.465794806718>1,s=23===n?I(2,-24)-I(2,-77):0,l=0,h=t<0||0===t&&1/t<0?1:0;for((t=F(t))!=t||t===M?(i=t!=t?1:0,e=f):(e=A(k(t)/N),t*(o=I(2,-e))<1&&(e--,o*=2),2<=(t+=1<=e+a?s/o:s*I(2,1-a))*o&&(e++,o/=2),f<=e+a?(i=0,e=f):1<=e+a?(i=(t*o-1)*I(2,n),e+=a):(i=t*I(2,a-1)*I(2,n),e=0));8<=n;u[l++]=255&i,i/=256,n-=8);for(e=e<>1,c=i-7,f=r-1,a=t[f--],s=127&a;for(a>>=7;0>=-c,c+=n;0>8&255]}function packI32(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function packF64(t){return packIEEE754(t,52,8)}function packF32(t){return packIEEE754(t,23,4)}function addGetter(t,n,r){g(t[S],n,{get:function(){return this[r]}})}function get(t,n,r,e){var i=p(+r);if(t[L]>24)},setUint8:function setUint8(t,n){B.call(this,t,n<<24>>24)}},!0)}else x=function ArrayBuffer(t){s(this,x,_);var n=p(t);this._b=y.call(new Array(n),0),this[L]=n},w=function DataView(t,n,r){s(this,w,b),s(t,x,b);var e=t[L],i=l(n);if(i<0||e>24},getUint8:function getUint8(t){return get(this,1,t)[0]},getInt16:function getInt16(t){var n=get(this,2,t,arguments[1]);return(n[1]<<8|n[0])<<16>>16},getUint16:function getUint16(t){var n=get(this,2,t,arguments[1]);return n[1]<<8|n[0]},getInt32:function getInt32(t){return unpackI32(get(this,4,t,arguments[1]))},getUint32:function getUint32(t){return unpackI32(get(this,4,t,arguments[1]))>>>0},getFloat32:function getFloat32(t){return unpackIEEE754(get(this,4,t,arguments[1]),23,4)},getFloat64:function getFloat64(t){return unpackIEEE754(get(this,8,t,arguments[1]),52,8)},setInt8:function setInt8(t,n){set(this,1,t,packI8,n)},setUint8:function setUint8(t,n){set(this,1,t,packI8,n)},setInt16:function setInt16(t,n){set(this,2,t,packI16,n,arguments[2])},setUint16:function setUint16(t,n){set(this,2,t,packI16,n,arguments[2])},setInt32:function setInt32(t,n){set(this,4,t,packI32,n,arguments[2])},setUint32:function setUint32(t,n){set(this,4,t,packI32,n,arguments[2])},setFloat32:function setFloat32(t,n){set(this,4,t,packF32,n,arguments[2])},setFloat64:function setFloat64(t,n){set(this,8,t,packF64,n,arguments[2])}});d(x,_),d(w,b),c(w[S],u.VIEW,!0),n[_]=x,n[b]=w},function(t,n,r){t.exports=!r(6)&&!r(3)(function(){return 7!=Object.defineProperty(r(64)("div"),"a",{get:function(){return 7}}).a})},function(t,n,r){n.f=r(5)},function(t,n,r){var u=r(14),c=r(15),f=r(50)(!1),a=r(66)("IE_PROTO");t.exports=function(t,n){var r,e=c(t),i=0,o=[];for(r in e)r!=a&&u(e,r)&&o.push(r);for(;i>>0||(u.test(r)?16:10))}:e},function(t,n){t.exports=Math.log1p||function log1p(t){return-1e-8<(t=+t)&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,n,r){var o=r(73),e=Math.pow,u=e(2,-52),c=e(2,-23),f=e(2,127)*(2-c),a=e(2,-126);t.exports=Math.fround||function fround(t){var n,r,e=Math.abs(t),i=o(t);return e>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,n,r){var e=r(0),i=Math.exp;e(e.S,"Math",{cosh:function cosh(t){return(i(t=+t)+i(-t))/2}})},function(t,n,r){var e=r(0),i=r(74);e(e.S+e.F*(i!=Math.expm1),"Math",{expm1:i})},function(t,n,r){var e=r(0);e(e.S,"Math",{fround:r(103)})},function(t,n,r){var e=r(0),f=Math.abs;e(e.S,"Math",{hypot:function hypot(t,n){for(var r,e,i=0,o=0,u=arguments.length,c=0;o>>16)*u+o*(r&i>>>16)<<16>>>0)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{log10:function log10(t){return Math.log(t)*Math.LOG10E}})},function(t,n,r){var e=r(0);e(e.S,"Math",{log1p:r(102)})},function(t,n,r){var e=r(0);e(e.S,"Math",{log2:function log2(t){return Math.log(t)/Math.LN2}})},function(t,n,r){var e=r(0);e(e.S,"Math",{sign:r(73)})},function(t,n,r){var e=r(0),i=r(74),o=Math.exp;e(e.S+e.F*r(3)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function sinh(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},function(t,n,r){var e=r(0),i=r(74),o=Math.exp;e(e.S,"Math",{tanh:function tanh(t){var n=i(t=+t),r=i(-t);return n==Infinity?1:r==Infinity?-1:(n-r)/(o(t)+o(-t))}})},function(t,n,r){var e=r(0);e(e.S,"Math",{trunc:function trunc(t){return(0>10),n%1024+56320))}return r.join("")}})},function(t,n,r){var e=r(0),u=r(15),c=r(8);e(e.S,"String",{raw:function raw(t){for(var n=u(t.raw),r=c(n.length),e=arguments.length,i=[],o=0;o>>0,h=new RegExp(t.source,a+"g");for(_||(e=new RegExp("^"+h.source+"$(?!\\s)",a));(i=h.exec(r))&&!(s<(o=i.index+i[0][y])&&(f.push(r.slice(s,i.index)),!_&&1>>0,o=r>>>0;return(n>>>0)+(e>>>0)+((i&o|(i|o)&~(i+o>>>0))>>>31)|0}})},function(t,n,r){var e=r(0);e(e.S,"Math",{isubh:function isubh(t,n,r,e){var i=t>>>0,o=r>>>0;return(n>>>0)-(e>>>0)-((~i&o|~(i^o)&i-o>>>0)>>>31)|0}})},function(t,n,r){var e=r(0);e(e.S,"Math",{imulh:function imulh(t,n){var r=+t,e=+n,i=65535&r,o=65535&e,u=r>>16,c=e>>16,f=(u*o>>>0)+(i*o>>>16);return u*c+(f>>16)+((i*c>>>0)+(65535&f)>>16)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{RAD_PER_DEG:180/Math.PI})},function(t,n,r){var e=r(0),i=Math.PI/180;e(e.S,"Math",{radians:function radians(t){return t*i}})},function(t,n,r){var e=r(0);e(e.S,"Math",{scale:r(123)})},function(t,n,r){var e=r(0);e(e.S,"Math",{umulh:function umulh(t,n){var r=+t,e=+n,i=65535&r,o=65535&e,u=r>>>16,c=e>>>16,f=(u*o>>>0)+(i*o>>>16);return u*c+(f>>>16)+((i*c>>>0)+(65535&f)>>>16)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{signbit:function signbit(t){return(t=+t)!=t?t:0==t?1/t==Infinity:0 2 ? arguments[2] : undefined; - var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); - var inc = 1; - if (from < to && to < from + count) { - inc = -1; - from += count - 1; - to += count - 1; - } - while (count-- > 0) { - if (from in O) O[to] = O[from]; - else delete O[to]; - to += inc; - from += inc; - } return O; -}; diff --git a/node_modules/core-js/library/modules/_array-fill.js b/node_modules/core-js/library/modules/_array-fill.js deleted file mode 100644 index 0753c36ac..000000000 --- a/node_modules/core-js/library/modules/_array-fill.js +++ /dev/null @@ -1,15 +0,0 @@ -// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) -'use strict'; -var toObject = require('./_to-object'); -var toAbsoluteIndex = require('./_to-absolute-index'); -var toLength = require('./_to-length'); -module.exports = function fill(value /* , start = 0, end = @length */) { - var O = toObject(this); - var length = toLength(O.length); - var aLen = arguments.length; - var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); - var end = aLen > 2 ? arguments[2] : undefined; - var endPos = end === undefined ? length : toAbsoluteIndex(end, length); - while (endPos > index) O[index++] = value; - return O; -}; diff --git a/node_modules/core-js/library/modules/_array-from-iterable.js b/node_modules/core-js/library/modules/_array-from-iterable.js deleted file mode 100644 index 08be255f0..000000000 --- a/node_modules/core-js/library/modules/_array-from-iterable.js +++ /dev/null @@ -1,7 +0,0 @@ -var forOf = require('./_for-of'); - -module.exports = function (iter, ITERATOR) { - var result = []; - forOf(iter, false, result.push, result, ITERATOR); - return result; -}; diff --git a/node_modules/core-js/library/modules/_array-includes.js b/node_modules/core-js/library/modules/_array-includes.js deleted file mode 100644 index 0ef3efebe..000000000 --- a/node_modules/core-js/library/modules/_array-includes.js +++ /dev/null @@ -1,23 +0,0 @@ -// false -> Array#indexOf -// true -> Array#includes -var toIObject = require('./_to-iobject'); -var toLength = require('./_to-length'); -var toAbsoluteIndex = require('./_to-absolute-index'); -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; - }; -}; diff --git a/node_modules/core-js/library/modules/_array-methods.js b/node_modules/core-js/library/modules/_array-methods.js deleted file mode 100644 index ae7f447da..000000000 --- a/node_modules/core-js/library/modules/_array-methods.js +++ /dev/null @@ -1,44 +0,0 @@ -// 0 -> Array#forEach -// 1 -> Array#map -// 2 -> Array#filter -// 3 -> Array#some -// 4 -> Array#every -// 5 -> Array#find -// 6 -> Array#findIndex -var ctx = require('./_ctx'); -var IObject = require('./_iobject'); -var toObject = require('./_to-object'); -var toLength = require('./_to-length'); -var asc = require('./_array-species-create'); -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; - }; -}; diff --git a/node_modules/core-js/library/modules/_array-reduce.js b/node_modules/core-js/library/modules/_array-reduce.js deleted file mode 100644 index 8596ac70a..000000000 --- a/node_modules/core-js/library/modules/_array-reduce.js +++ /dev/null @@ -1,28 +0,0 @@ -var aFunction = require('./_a-function'); -var toObject = require('./_to-object'); -var IObject = require('./_iobject'); -var toLength = require('./_to-length'); - -module.exports = function (that, callbackfn, aLen, memo, isRight) { - aFunction(callbackfn); - var O = toObject(that); - var self = IObject(O); - var length = toLength(O.length); - var index = isRight ? length - 1 : 0; - var i = isRight ? -1 : 1; - if (aLen < 2) for (;;) { - if (index in self) { - memo = self[index]; - index += i; - break; - } - index += i; - if (isRight ? index < 0 : length <= index) { - throw TypeError('Reduce of empty array with no initial value'); - } - } - for (;isRight ? index >= 0 : length > index; index += i) if (index in self) { - memo = callbackfn(memo, self[index], index, O); - } - return memo; -}; diff --git a/node_modules/core-js/library/modules/_array-species-constructor.js b/node_modules/core-js/library/modules/_array-species-constructor.js deleted file mode 100644 index 0771c236d..000000000 --- a/node_modules/core-js/library/modules/_array-species-constructor.js +++ /dev/null @@ -1,16 +0,0 @@ -var isObject = require('./_is-object'); -var isArray = require('./_is-array'); -var SPECIES = require('./_wks')('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; -}; diff --git a/node_modules/core-js/library/modules/_array-species-create.js b/node_modules/core-js/library/modules/_array-species-create.js deleted file mode 100644 index 36ed58bd7..000000000 --- a/node_modules/core-js/library/modules/_array-species-create.js +++ /dev/null @@ -1,6 +0,0 @@ -// 9.4.2.3 ArraySpeciesCreate(originalArray, length) -var speciesConstructor = require('./_array-species-constructor'); - -module.exports = function (original, length) { - return new (speciesConstructor(original))(length); -}; diff --git a/node_modules/core-js/library/modules/_bind.js b/node_modules/core-js/library/modules/_bind.js deleted file mode 100644 index 3cf1e5ae5..000000000 --- a/node_modules/core-js/library/modules/_bind.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; -var aFunction = require('./_a-function'); -var isObject = require('./_is-object'); -var invoke = require('./_invoke'); -var arraySlice = [].slice; -var factories = {}; - -var construct = function (F, len, args) { - if (!(len in factories)) { - for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']'; - // eslint-disable-next-line no-new-func - factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); - } return factories[len](F, args); -}; - -module.exports = Function.bind || function bind(that /* , ...args */) { - var fn = aFunction(this); - var partArgs = arraySlice.call(arguments, 1); - var bound = function (/* args... */) { - var args = partArgs.concat(arraySlice.call(arguments)); - return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); - }; - if (isObject(fn.prototype)) bound.prototype = fn.prototype; - return bound; -}; diff --git a/node_modules/core-js/library/modules/_classof.js b/node_modules/core-js/library/modules/_classof.js deleted file mode 100644 index d106d5be6..000000000 --- a/node_modules/core-js/library/modules/_classof.js +++ /dev/null @@ -1,23 +0,0 @@ -// getting tag from 19.1.3.6 Object.prototype.toString() -var cof = require('./_cof'); -var TAG = require('./_wks')('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; -}; diff --git a/node_modules/core-js/library/modules/_cof.js b/node_modules/core-js/library/modules/_cof.js deleted file mode 100644 index 332c0bc0b..000000000 --- a/node_modules/core-js/library/modules/_cof.js +++ /dev/null @@ -1,5 +0,0 @@ -var toString = {}.toString; - -module.exports = function (it) { - return toString.call(it).slice(8, -1); -}; diff --git a/node_modules/core-js/library/modules/_collection-strong.js b/node_modules/core-js/library/modules/_collection-strong.js deleted file mode 100644 index 68ce63f0e..000000000 --- a/node_modules/core-js/library/modules/_collection-strong.js +++ /dev/null @@ -1,144 +0,0 @@ -'use strict'; -var dP = require('./_object-dp').f; -var create = require('./_object-create'); -var redefineAll = require('./_redefine-all'); -var ctx = require('./_ctx'); -var anInstance = require('./_an-instance'); -var forOf = require('./_for-of'); -var $iterDefine = require('./_iter-define'); -var step = require('./_iter-step'); -var setSpecies = require('./_set-species'); -var DESCRIPTORS = require('./_descriptors'); -var fastKey = require('./_meta').fastKey; -var validate = require('./_validate-collection'); -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); - } -}; diff --git a/node_modules/core-js/library/modules/_collection-to-json.js b/node_modules/core-js/library/modules/_collection-to-json.js deleted file mode 100644 index a6ee0029a..000000000 --- a/node_modules/core-js/library/modules/_collection-to-json.js +++ /dev/null @@ -1,9 +0,0 @@ -// https://github.com/DavidBruant/Map-Set.prototype.toJSON -var classof = require('./_classof'); -var from = require('./_array-from-iterable'); -module.exports = function (NAME) { - return function toJSON() { - if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); - return from(this); - }; -}; diff --git a/node_modules/core-js/library/modules/_collection-weak.js b/node_modules/core-js/library/modules/_collection-weak.js deleted file mode 100644 index 04d3af5af..000000000 --- a/node_modules/core-js/library/modules/_collection-weak.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict'; -var redefineAll = require('./_redefine-all'); -var getWeak = require('./_meta').getWeak; -var anObject = require('./_an-object'); -var isObject = require('./_is-object'); -var anInstance = require('./_an-instance'); -var forOf = require('./_for-of'); -var createArrayMethod = require('./_array-methods'); -var $has = require('./_has'); -var validate = require('./_validate-collection'); -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 -}; diff --git a/node_modules/core-js/library/modules/_collection.js b/node_modules/core-js/library/modules/_collection.js deleted file mode 100644 index 31a36b87a..000000000 --- a/node_modules/core-js/library/modules/_collection.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; -var global = require('./_global'); -var $export = require('./_export'); -var meta = require('./_meta'); -var fails = require('./_fails'); -var hide = require('./_hide'); -var redefineAll = require('./_redefine-all'); -var forOf = require('./_for-of'); -var anInstance = require('./_an-instance'); -var isObject = require('./_is-object'); -var setToStringTag = require('./_set-to-string-tag'); -var dP = require('./_object-dp').f; -var each = require('./_array-methods')(0); -var DESCRIPTORS = require('./_descriptors'); - -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; -}; diff --git a/node_modules/core-js/library/modules/_core.js b/node_modules/core-js/library/modules/_core.js deleted file mode 100644 index c61ad5100..000000000 --- a/node_modules/core-js/library/modules/_core.js +++ /dev/null @@ -1,2 +0,0 @@ -var core = module.exports = { version: '2.5.7' }; -if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef diff --git a/node_modules/core-js/library/modules/_create-property.js b/node_modules/core-js/library/modules/_create-property.js deleted file mode 100644 index fd0ea8c9a..000000000 --- a/node_modules/core-js/library/modules/_create-property.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; -var $defineProperty = require('./_object-dp'); -var createDesc = require('./_property-desc'); - -module.exports = function (object, index, value) { - if (index in object) $defineProperty.f(object, index, createDesc(0, value)); - else object[index] = value; -}; diff --git a/node_modules/core-js/library/modules/_ctx.js b/node_modules/core-js/library/modules/_ctx.js deleted file mode 100644 index 0a100ff3d..000000000 --- a/node_modules/core-js/library/modules/_ctx.js +++ /dev/null @@ -1,20 +0,0 @@ -// optional / simple context binding -var aFunction = require('./_a-function'); -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); - }; -}; diff --git a/node_modules/core-js/library/modules/_date-to-iso-string.js b/node_modules/core-js/library/modules/_date-to-iso-string.js deleted file mode 100644 index 95a02e224..000000000 --- a/node_modules/core-js/library/modules/_date-to-iso-string.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; -// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() -var fails = require('./_fails'); -var getTime = Date.prototype.getTime; -var $toISOString = Date.prototype.toISOString; - -var lz = function (num) { - return num > 9 ? num : '0' + num; -}; - -// PhantomJS / old WebKit has a broken implementations -module.exports = (fails(function () { - return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; -}) || !fails(function () { - $toISOString.call(new Date(NaN)); -})) ? function toISOString() { - if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value'); - var d = this; - var y = d.getUTCFullYear(); - var m = d.getUTCMilliseconds(); - var s = y < 0 ? '-' : y > 9999 ? '+' : ''; - return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + - '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + - 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + - ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; -} : $toISOString; diff --git a/node_modules/core-js/library/modules/_date-to-primitive.js b/node_modules/core-js/library/modules/_date-to-primitive.js deleted file mode 100644 index 57c32030c..000000000 --- a/node_modules/core-js/library/modules/_date-to-primitive.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; -var anObject = require('./_an-object'); -var toPrimitive = require('./_to-primitive'); -var NUMBER = 'number'; - -module.exports = function (hint) { - if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint'); - return toPrimitive(anObject(this), hint != NUMBER); -}; diff --git a/node_modules/core-js/library/modules/_defined.js b/node_modules/core-js/library/modules/_defined.js deleted file mode 100644 index 66c7ed323..000000000 --- a/node_modules/core-js/library/modules/_defined.js +++ /dev/null @@ -1,5 +0,0 @@ -// 7.2.1 RequireObjectCoercible(argument) -module.exports = function (it) { - if (it == undefined) throw TypeError("Can't call method on " + it); - return it; -}; diff --git a/node_modules/core-js/library/modules/_descriptors.js b/node_modules/core-js/library/modules/_descriptors.js deleted file mode 100644 index 046974066..000000000 --- a/node_modules/core-js/library/modules/_descriptors.js +++ /dev/null @@ -1,4 +0,0 @@ -// Thank's IE8 for his funny defineProperty -module.exports = !require('./_fails')(function () { - return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; -}); diff --git a/node_modules/core-js/library/modules/_dom-create.js b/node_modules/core-js/library/modules/_dom-create.js deleted file mode 100644 index 39ca2569d..000000000 --- a/node_modules/core-js/library/modules/_dom-create.js +++ /dev/null @@ -1,7 +0,0 @@ -var isObject = require('./_is-object'); -var document = require('./_global').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) : {}; -}; diff --git a/node_modules/core-js/library/modules/_entry-virtual.js b/node_modules/core-js/library/modules/_entry-virtual.js deleted file mode 100644 index 7a734390a..000000000 --- a/node_modules/core-js/library/modules/_entry-virtual.js +++ /dev/null @@ -1,5 +0,0 @@ -var core = require('./_core'); -module.exports = function (CONSTRUCTOR) { - var C = core[CONSTRUCTOR]; - return (C.virtual || C.prototype); -}; diff --git a/node_modules/core-js/library/modules/_enum-bug-keys.js b/node_modules/core-js/library/modules/_enum-bug-keys.js deleted file mode 100644 index d9ad85514..000000000 --- a/node_modules/core-js/library/modules/_enum-bug-keys.js +++ /dev/null @@ -1,4 +0,0 @@ -// IE 8- don't enum bug keys -module.exports = ( - 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' -).split(','); diff --git a/node_modules/core-js/library/modules/_enum-keys.js b/node_modules/core-js/library/modules/_enum-keys.js deleted file mode 100644 index 3e7053d13..000000000 --- a/node_modules/core-js/library/modules/_enum-keys.js +++ /dev/null @@ -1,15 +0,0 @@ -// all enumerable object keys, includes symbols -var getKeys = require('./_object-keys'); -var gOPS = require('./_object-gops'); -var pIE = require('./_object-pie'); -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; -}; diff --git a/node_modules/core-js/library/modules/_export.js b/node_modules/core-js/library/modules/_export.js deleted file mode 100644 index 02bddc0aa..000000000 --- a/node_modules/core-js/library/modules/_export.js +++ /dev/null @@ -1,62 +0,0 @@ -var global = require('./_global'); -var core = require('./_core'); -var ctx = require('./_ctx'); -var hide = require('./_hide'); -var has = require('./_has'); -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; diff --git a/node_modules/core-js/library/modules/_fails-is-regexp.js b/node_modules/core-js/library/modules/_fails-is-regexp.js deleted file mode 100644 index 8eec2e471..000000000 --- a/node_modules/core-js/library/modules/_fails-is-regexp.js +++ /dev/null @@ -1,12 +0,0 @@ -var MATCH = require('./_wks')('match'); -module.exports = function (KEY) { - var re = /./; - try { - '/./'[KEY](re); - } catch (e) { - try { - re[MATCH] = false; - return !'/./'[KEY](re); - } catch (f) { /* empty */ } - } return true; -}; diff --git a/node_modules/core-js/library/modules/_fails.js b/node_modules/core-js/library/modules/_fails.js deleted file mode 100644 index 3b4cdf674..000000000 --- a/node_modules/core-js/library/modules/_fails.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = function (exec) { - try { - return !!exec(); - } catch (e) { - return true; - } -}; diff --git a/node_modules/core-js/library/modules/_fix-re-wks.js b/node_modules/core-js/library/modules/_fix-re-wks.js deleted file mode 100644 index 9a62380b3..000000000 --- a/node_modules/core-js/library/modules/_fix-re-wks.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; -var hide = require('./_hide'); -var redefine = require('./_redefine'); -var fails = require('./_fails'); -var defined = require('./_defined'); -var wks = require('./_wks'); - -module.exports = function (KEY, length, exec) { - var SYMBOL = wks(KEY); - var fns = exec(defined, SYMBOL, ''[KEY]); - var strfn = fns[0]; - var rxfn = fns[1]; - if (fails(function () { - var O = {}; - O[SYMBOL] = function () { return 7; }; - return ''[KEY](O) != 7; - })) { - redefine(String.prototype, KEY, strfn); - hide(RegExp.prototype, SYMBOL, length == 2 - // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) - // 21.2.5.11 RegExp.prototype[@@split](string, limit) - ? function (string, arg) { return rxfn.call(string, this, arg); } - // 21.2.5.6 RegExp.prototype[@@match](string) - // 21.2.5.9 RegExp.prototype[@@search](string) - : function (string) { return rxfn.call(string, this); } - ); - } -}; diff --git a/node_modules/core-js/library/modules/_flags.js b/node_modules/core-js/library/modules/_flags.js deleted file mode 100644 index b6fc324bd..000000000 --- a/node_modules/core-js/library/modules/_flags.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; -// 21.2.5.3 get RegExp.prototype.flags -var anObject = require('./_an-object'); -module.exports = function () { - var that = anObject(this); - var result = ''; - if (that.global) result += 'g'; - if (that.ignoreCase) result += 'i'; - if (that.multiline) result += 'm'; - if (that.unicode) result += 'u'; - if (that.sticky) result += 'y'; - return result; -}; diff --git a/node_modules/core-js/library/modules/_flatten-into-array.js b/node_modules/core-js/library/modules/_flatten-into-array.js deleted file mode 100644 index 1838517ae..000000000 --- a/node_modules/core-js/library/modules/_flatten-into-array.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; -// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray -var isArray = require('./_is-array'); -var isObject = require('./_is-object'); -var toLength = require('./_to-length'); -var ctx = require('./_ctx'); -var IS_CONCAT_SPREADABLE = require('./_wks')('isConcatSpreadable'); - -function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) { - var targetIndex = start; - var sourceIndex = 0; - var mapFn = mapper ? ctx(mapper, thisArg, 3) : false; - var element, spreadable; - - while (sourceIndex < sourceLen) { - if (sourceIndex in source) { - element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; - - spreadable = false; - if (isObject(element)) { - spreadable = element[IS_CONCAT_SPREADABLE]; - spreadable = spreadable !== undefined ? !!spreadable : isArray(element); - } - - if (spreadable && depth > 0) { - targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1; - } else { - if (targetIndex >= 0x1fffffffffffff) throw TypeError(); - target[targetIndex] = element; - } - - targetIndex++; - } - sourceIndex++; - } - return targetIndex; -} - -module.exports = flattenIntoArray; diff --git a/node_modules/core-js/library/modules/_for-of.js b/node_modules/core-js/library/modules/_for-of.js deleted file mode 100644 index 9ed22818b..000000000 --- a/node_modules/core-js/library/modules/_for-of.js +++ /dev/null @@ -1,25 +0,0 @@ -var ctx = require('./_ctx'); -var call = require('./_iter-call'); -var isArrayIter = require('./_is-array-iter'); -var anObject = require('./_an-object'); -var toLength = require('./_to-length'); -var getIterFn = require('./core.get-iterator-method'); -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; diff --git a/node_modules/core-js/library/modules/_global.js b/node_modules/core-js/library/modules/_global.js deleted file mode 100644 index bf85b44a1..000000000 --- a/node_modules/core-js/library/modules/_global.js +++ /dev/null @@ -1,6 +0,0 @@ -// 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 diff --git a/node_modules/core-js/library/modules/_has.js b/node_modules/core-js/library/modules/_has.js deleted file mode 100644 index 2a37d8b7a..000000000 --- a/node_modules/core-js/library/modules/_has.js +++ /dev/null @@ -1,4 +0,0 @@ -var hasOwnProperty = {}.hasOwnProperty; -module.exports = function (it, key) { - return hasOwnProperty.call(it, key); -}; diff --git a/node_modules/core-js/library/modules/_hide.js b/node_modules/core-js/library/modules/_hide.js deleted file mode 100644 index cec258a0a..000000000 --- a/node_modules/core-js/library/modules/_hide.js +++ /dev/null @@ -1,8 +0,0 @@ -var dP = require('./_object-dp'); -var createDesc = require('./_property-desc'); -module.exports = require('./_descriptors') ? function (object, key, value) { - return dP.f(object, key, createDesc(1, value)); -} : function (object, key, value) { - object[key] = value; - return object; -}; diff --git a/node_modules/core-js/library/modules/_html.js b/node_modules/core-js/library/modules/_html.js deleted file mode 100644 index 7daff14ca..000000000 --- a/node_modules/core-js/library/modules/_html.js +++ /dev/null @@ -1,2 +0,0 @@ -var document = require('./_global').document; -module.exports = document && document.documentElement; diff --git a/node_modules/core-js/library/modules/_ie8-dom-define.js b/node_modules/core-js/library/modules/_ie8-dom-define.js deleted file mode 100644 index a3805cb7f..000000000 --- a/node_modules/core-js/library/modules/_ie8-dom-define.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = !require('./_descriptors') && !require('./_fails')(function () { - return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7; -}); diff --git a/node_modules/core-js/library/modules/_inherit-if-required.js b/node_modules/core-js/library/modules/_inherit-if-required.js deleted file mode 100644 index b95fcd984..000000000 --- a/node_modules/core-js/library/modules/_inherit-if-required.js +++ /dev/null @@ -1,9 +0,0 @@ -var isObject = require('./_is-object'); -var setPrototypeOf = require('./_set-proto').set; -module.exports = function (that, target, C) { - var S = target.constructor; - var P; - if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { - setPrototypeOf(that, P); - } return that; -}; diff --git a/node_modules/core-js/library/modules/_invoke.js b/node_modules/core-js/library/modules/_invoke.js deleted file mode 100644 index 6cccebdc1..000000000 --- a/node_modules/core-js/library/modules/_invoke.js +++ /dev/null @@ -1,16 +0,0 @@ -// fast apply, http://jsperf.lnkit.com/fast-apply/5 -module.exports = function (fn, args, that) { - var un = that === undefined; - switch (args.length) { - case 0: return un ? fn() - : fn.call(that); - case 1: return un ? fn(args[0]) - : fn.call(that, args[0]); - case 2: return un ? fn(args[0], args[1]) - : fn.call(that, args[0], args[1]); - case 3: return un ? fn(args[0], args[1], args[2]) - : fn.call(that, args[0], args[1], args[2]); - case 4: return un ? fn(args[0], args[1], args[2], args[3]) - : fn.call(that, args[0], args[1], args[2], args[3]); - } return fn.apply(that, args); -}; diff --git a/node_modules/core-js/library/modules/_iobject.js b/node_modules/core-js/library/modules/_iobject.js deleted file mode 100644 index 2b57c8a07..000000000 --- a/node_modules/core-js/library/modules/_iobject.js +++ /dev/null @@ -1,6 +0,0 @@ -// fallback for non-array-like ES3 and non-enumerable old V8 strings -var cof = require('./_cof'); -// eslint-disable-next-line no-prototype-builtins -module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { - return cof(it) == 'String' ? it.split('') : Object(it); -}; diff --git a/node_modules/core-js/library/modules/_is-array-iter.js b/node_modules/core-js/library/modules/_is-array-iter.js deleted file mode 100644 index 6f67d9052..000000000 --- a/node_modules/core-js/library/modules/_is-array-iter.js +++ /dev/null @@ -1,8 +0,0 @@ -// check on default Array iterator -var Iterators = require('./_iterators'); -var ITERATOR = require('./_wks')('iterator'); -var ArrayProto = Array.prototype; - -module.exports = function (it) { - return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); -}; diff --git a/node_modules/core-js/library/modules/_is-array.js b/node_modules/core-js/library/modules/_is-array.js deleted file mode 100644 index 0581dc2e7..000000000 --- a/node_modules/core-js/library/modules/_is-array.js +++ /dev/null @@ -1,5 +0,0 @@ -// 7.2.2 IsArray(argument) -var cof = require('./_cof'); -module.exports = Array.isArray || function isArray(arg) { - return cof(arg) == 'Array'; -}; diff --git a/node_modules/core-js/library/modules/_is-integer.js b/node_modules/core-js/library/modules/_is-integer.js deleted file mode 100644 index 0074ae975..000000000 --- a/node_modules/core-js/library/modules/_is-integer.js +++ /dev/null @@ -1,6 +0,0 @@ -// 20.1.2.3 Number.isInteger(number) -var isObject = require('./_is-object'); -var floor = Math.floor; -module.exports = function isInteger(it) { - return !isObject(it) && isFinite(it) && floor(it) === it; -}; diff --git a/node_modules/core-js/library/modules/_is-object.js b/node_modules/core-js/library/modules/_is-object.js deleted file mode 100644 index dda6e04d2..000000000 --- a/node_modules/core-js/library/modules/_is-object.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function (it) { - return typeof it === 'object' ? it !== null : typeof it === 'function'; -}; diff --git a/node_modules/core-js/library/modules/_is-regexp.js b/node_modules/core-js/library/modules/_is-regexp.js deleted file mode 100644 index 598d159d5..000000000 --- a/node_modules/core-js/library/modules/_is-regexp.js +++ /dev/null @@ -1,8 +0,0 @@ -// 7.2.8 IsRegExp(argument) -var isObject = require('./_is-object'); -var cof = require('./_cof'); -var MATCH = require('./_wks')('match'); -module.exports = function (it) { - var isRegExp; - return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); -}; diff --git a/node_modules/core-js/library/modules/_iter-call.js b/node_modules/core-js/library/modules/_iter-call.js deleted file mode 100644 index a7026e347..000000000 --- a/node_modules/core-js/library/modules/_iter-call.js +++ /dev/null @@ -1,12 +0,0 @@ -// call something on iterator step with safe closing on error -var anObject = require('./_an-object'); -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; - } -}; diff --git a/node_modules/core-js/library/modules/_iter-create.js b/node_modules/core-js/library/modules/_iter-create.js deleted file mode 100644 index 04708c83c..000000000 --- a/node_modules/core-js/library/modules/_iter-create.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; -var create = require('./_object-create'); -var descriptor = require('./_property-desc'); -var setToStringTag = require('./_set-to-string-tag'); -var IteratorPrototype = {}; - -// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() -require('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; }); - -module.exports = function (Constructor, NAME, next) { - Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); - setToStringTag(Constructor, NAME + ' Iterator'); -}; diff --git a/node_modules/core-js/library/modules/_iter-define.js b/node_modules/core-js/library/modules/_iter-define.js deleted file mode 100644 index 578dfb734..000000000 --- a/node_modules/core-js/library/modules/_iter-define.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict'; -var LIBRARY = require('./_library'); -var $export = require('./_export'); -var redefine = require('./_redefine'); -var hide = require('./_hide'); -var Iterators = require('./_iterators'); -var $iterCreate = require('./_iter-create'); -var setToStringTag = require('./_set-to-string-tag'); -var getPrototypeOf = require('./_object-gpo'); -var ITERATOR = require('./_wks')('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; -}; diff --git a/node_modules/core-js/library/modules/_iter-detect.js b/node_modules/core-js/library/modules/_iter-detect.js deleted file mode 100644 index 5cb34973c..000000000 --- a/node_modules/core-js/library/modules/_iter-detect.js +++ /dev/null @@ -1,22 +0,0 @@ -var ITERATOR = require('./_wks')('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; -}; diff --git a/node_modules/core-js/library/modules/_iter-step.js b/node_modules/core-js/library/modules/_iter-step.js deleted file mode 100644 index b0691c883..000000000 --- a/node_modules/core-js/library/modules/_iter-step.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function (done, value) { - return { value: value, done: !!done }; -}; diff --git a/node_modules/core-js/library/modules/_iterators.js b/node_modules/core-js/library/modules/_iterators.js deleted file mode 100644 index f053ebf79..000000000 --- a/node_modules/core-js/library/modules/_iterators.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = {}; diff --git a/node_modules/core-js/library/modules/_keyof.js b/node_modules/core-js/library/modules/_keyof.js deleted file mode 100644 index 0786096fd..000000000 --- a/node_modules/core-js/library/modules/_keyof.js +++ /dev/null @@ -1,10 +0,0 @@ -var getKeys = require('./_object-keys'); -var toIObject = require('./_to-iobject'); -module.exports = function (object, el) { - var O = toIObject(object); - var keys = getKeys(O); - var length = keys.length; - var index = 0; - var key; - while (length > index) if (O[key = keys[index++]] === el) return key; -}; diff --git a/node_modules/core-js/library/modules/_library.js b/node_modules/core-js/library/modules/_library.js deleted file mode 100644 index ec01c2c14..000000000 --- a/node_modules/core-js/library/modules/_library.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = true; diff --git a/node_modules/core-js/library/modules/_math-expm1.js b/node_modules/core-js/library/modules/_math-expm1.js deleted file mode 100644 index 75c685014..000000000 --- a/node_modules/core-js/library/modules/_math-expm1.js +++ /dev/null @@ -1,10 +0,0 @@ -// 20.2.2.14 Math.expm1(x) -var $expm1 = Math.expm1; -module.exports = (!$expm1 - // Old FF bug - || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 - // Tor Browser bug - || $expm1(-2e-17) != -2e-17 -) ? function expm1(x) { - return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; -} : $expm1; diff --git a/node_modules/core-js/library/modules/_math-fround.js b/node_modules/core-js/library/modules/_math-fround.js deleted file mode 100644 index c85eb4b7e..000000000 --- a/node_modules/core-js/library/modules/_math-fround.js +++ /dev/null @@ -1,23 +0,0 @@ -// 20.2.2.16 Math.fround(x) -var sign = require('./_math-sign'); -var pow = Math.pow; -var EPSILON = pow(2, -52); -var EPSILON32 = pow(2, -23); -var MAX32 = pow(2, 127) * (2 - EPSILON32); -var MIN32 = pow(2, -126); - -var roundTiesToEven = function (n) { - return n + 1 / EPSILON - 1 / EPSILON; -}; - -module.exports = Math.fround || function fround(x) { - var $abs = Math.abs(x); - var $sign = sign(x); - var a, result; - if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; - a = (1 + EPSILON32 / EPSILON) * $abs; - result = a - (a - $abs); - // eslint-disable-next-line no-self-compare - if (result > MAX32 || result != result) return $sign * Infinity; - return $sign * result; -}; diff --git a/node_modules/core-js/library/modules/_math-log1p.js b/node_modules/core-js/library/modules/_math-log1p.js deleted file mode 100644 index 16d5f4931..000000000 --- a/node_modules/core-js/library/modules/_math-log1p.js +++ /dev/null @@ -1,4 +0,0 @@ -// 20.2.2.20 Math.log1p(x) -module.exports = Math.log1p || function log1p(x) { - return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); -}; diff --git a/node_modules/core-js/library/modules/_math-scale.js b/node_modules/core-js/library/modules/_math-scale.js deleted file mode 100644 index ba3cdb20c..000000000 --- a/node_modules/core-js/library/modules/_math-scale.js +++ /dev/null @@ -1,18 +0,0 @@ -// https://rwaldron.github.io/proposal-math-extensions/ -module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) { - if ( - arguments.length === 0 - // eslint-disable-next-line no-self-compare - || x != x - // eslint-disable-next-line no-self-compare - || inLow != inLow - // eslint-disable-next-line no-self-compare - || inHigh != inHigh - // eslint-disable-next-line no-self-compare - || outLow != outLow - // eslint-disable-next-line no-self-compare - || outHigh != outHigh - ) return NaN; - if (x === Infinity || x === -Infinity) return x; - return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow; -}; diff --git a/node_modules/core-js/library/modules/_math-sign.js b/node_modules/core-js/library/modules/_math-sign.js deleted file mode 100644 index 7a46b9d08..000000000 --- a/node_modules/core-js/library/modules/_math-sign.js +++ /dev/null @@ -1,5 +0,0 @@ -// 20.2.2.28 Math.sign(x) -module.exports = Math.sign || function sign(x) { - // eslint-disable-next-line no-self-compare - return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; -}; diff --git a/node_modules/core-js/library/modules/_meta.js b/node_modules/core-js/library/modules/_meta.js deleted file mode 100644 index 2d4b32579..000000000 --- a/node_modules/core-js/library/modules/_meta.js +++ /dev/null @@ -1,53 +0,0 @@ -var META = require('./_uid')('meta'); -var isObject = require('./_is-object'); -var has = require('./_has'); -var setDesc = require('./_object-dp').f; -var id = 0; -var isExtensible = Object.isExtensible || function () { - return true; -}; -var FREEZE = !require('./_fails')(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 -}; diff --git a/node_modules/core-js/library/modules/_metadata.js b/node_modules/core-js/library/modules/_metadata.js deleted file mode 100644 index 759cfc445..000000000 --- a/node_modules/core-js/library/modules/_metadata.js +++ /dev/null @@ -1,51 +0,0 @@ -var Map = require('./es6.map'); -var $export = require('./_export'); -var shared = require('./_shared')('metadata'); -var store = shared.store || (shared.store = new (require('./es6.weak-map'))()); - -var getOrCreateMetadataMap = function (target, targetKey, create) { - var targetMetadata = store.get(target); - if (!targetMetadata) { - if (!create) return undefined; - store.set(target, targetMetadata = new Map()); - } - var keyMetadata = targetMetadata.get(targetKey); - if (!keyMetadata) { - if (!create) return undefined; - targetMetadata.set(targetKey, keyMetadata = new Map()); - } return keyMetadata; -}; -var ordinaryHasOwnMetadata = function (MetadataKey, O, P) { - var metadataMap = getOrCreateMetadataMap(O, P, false); - return metadataMap === undefined ? false : metadataMap.has(MetadataKey); -}; -var ordinaryGetOwnMetadata = function (MetadataKey, O, P) { - var metadataMap = getOrCreateMetadataMap(O, P, false); - return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); -}; -var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) { - getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); -}; -var ordinaryOwnMetadataKeys = function (target, targetKey) { - var metadataMap = getOrCreateMetadataMap(target, targetKey, false); - var keys = []; - if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); }); - return keys; -}; -var toMetaKey = function (it) { - return it === undefined || typeof it == 'symbol' ? it : String(it); -}; -var exp = function (O) { - $export($export.S, 'Reflect', O); -}; - -module.exports = { - store: store, - map: getOrCreateMetadataMap, - has: ordinaryHasOwnMetadata, - get: ordinaryGetOwnMetadata, - set: ordinaryDefineOwnMetadata, - keys: ordinaryOwnMetadataKeys, - key: toMetaKey, - exp: exp -}; diff --git a/node_modules/core-js/library/modules/_microtask.js b/node_modules/core-js/library/modules/_microtask.js deleted file mode 100644 index b321c648c..000000000 --- a/node_modules/core-js/library/modules/_microtask.js +++ /dev/null @@ -1,69 +0,0 @@ -var global = require('./_global'); -var macrotask = require('./_task').set; -var Observer = global.MutationObserver || global.WebKitMutationObserver; -var process = global.process; -var Promise = global.Promise; -var isNode = require('./_cof')(process) == 'process'; - -module.exports = function () { - var head, last, notify; - - var flush = function () { - var parent, fn; - if (isNode && (parent = process.domain)) parent.exit(); - while (head) { - fn = head.fn; - head = head.next; - try { - fn(); - } catch (e) { - if (head) notify(); - else last = undefined; - throw e; - } - } last = undefined; - if (parent) parent.enter(); - }; - - // Node.js - if (isNode) { - notify = function () { - process.nextTick(flush); - }; - // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 - } else if (Observer && !(global.navigator && global.navigator.standalone)) { - var toggle = true; - var node = document.createTextNode(''); - new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new - notify = function () { - node.data = toggle = !toggle; - }; - // environments with maybe non-completely correct, but existent Promise - } else if (Promise && Promise.resolve) { - // Promise.resolve without an argument throws an error in LG WebOS 2 - var promise = Promise.resolve(undefined); - notify = function () { - promise.then(flush); - }; - // for other environments - macrotask based on: - // - setImmediate - // - MessageChannel - // - window.postMessag - // - onreadystatechange - // - setTimeout - } else { - notify = function () { - // strange IE + webpack dev server bug - use .call(global) - macrotask.call(global, flush); - }; - } - - return function (fn) { - var task = { fn: fn, next: undefined }; - if (last) last.next = task; - if (!head) { - head = task; - notify(); - } last = task; - }; -}; diff --git a/node_modules/core-js/library/modules/_new-promise-capability.js b/node_modules/core-js/library/modules/_new-promise-capability.js deleted file mode 100644 index 82b74a331..000000000 --- a/node_modules/core-js/library/modules/_new-promise-capability.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; -// 25.4.1.5 NewPromiseCapability(C) -var aFunction = require('./_a-function'); - -function PromiseCapability(C) { - var resolve, reject; - this.promise = new C(function ($$resolve, $$reject) { - if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); - resolve = $$resolve; - reject = $$reject; - }); - this.resolve = aFunction(resolve); - this.reject = aFunction(reject); -} - -module.exports.f = function (C) { - return new PromiseCapability(C); -}; diff --git a/node_modules/core-js/library/modules/_object-assign.js b/node_modules/core-js/library/modules/_object-assign.js deleted file mode 100644 index 7d4943a2a..000000000 --- a/node_modules/core-js/library/modules/_object-assign.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; -// 19.1.2.1 Object.assign(target, source, ...) -var getKeys = require('./_object-keys'); -var gOPS = require('./_object-gops'); -var pIE = require('./_object-pie'); -var toObject = require('./_to-object'); -var IObject = require('./_iobject'); -var $assign = Object.assign; - -// should work with symbols and should have deterministic property order (V8 bug) -module.exports = !$assign || require('./_fails')(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) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; - } return T; -} : $assign; diff --git a/node_modules/core-js/library/modules/_object-create.js b/node_modules/core-js/library/modules/_object-create.js deleted file mode 100644 index a76808ea6..000000000 --- a/node_modules/core-js/library/modules/_object-create.js +++ /dev/null @@ -1,41 +0,0 @@ -// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -var anObject = require('./_an-object'); -var dPs = require('./_object-dps'); -var enumBugKeys = require('./_enum-bug-keys'); -var IE_PROTO = require('./_shared-key')('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 = require('./_dom-create')('iframe'); - var i = enumBugKeys.length; - var lt = '<'; - var gt = '>'; - var iframeDocument; - iframe.style.display = 'none'; - require('./_html').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); -}; diff --git a/node_modules/core-js/library/modules/_object-define.js b/node_modules/core-js/library/modules/_object-define.js deleted file mode 100644 index 4d131f331..000000000 --- a/node_modules/core-js/library/modules/_object-define.js +++ /dev/null @@ -1,13 +0,0 @@ -var dP = require('./_object-dp'); -var gOPD = require('./_object-gopd'); -var ownKeys = require('./_own-keys'); -var toIObject = require('./_to-iobject'); - -module.exports = function define(target, mixin) { - var keys = ownKeys(toIObject(mixin)); - var length = keys.length; - var i = 0; - var key; - while (length > i) dP.f(target, key = keys[i++], gOPD.f(mixin, key)); - return target; -}; diff --git a/node_modules/core-js/library/modules/_object-dp.js b/node_modules/core-js/library/modules/_object-dp.js deleted file mode 100644 index 0340a8308..000000000 --- a/node_modules/core-js/library/modules/_object-dp.js +++ /dev/null @@ -1,16 +0,0 @@ -var anObject = require('./_an-object'); -var IE8_DOM_DEFINE = require('./_ie8-dom-define'); -var toPrimitive = require('./_to-primitive'); -var dP = Object.defineProperty; - -exports.f = require('./_descriptors') ? 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; -}; diff --git a/node_modules/core-js/library/modules/_object-dps.js b/node_modules/core-js/library/modules/_object-dps.js deleted file mode 100644 index 173c338ff..000000000 --- a/node_modules/core-js/library/modules/_object-dps.js +++ /dev/null @@ -1,13 +0,0 @@ -var dP = require('./_object-dp'); -var anObject = require('./_an-object'); -var getKeys = require('./_object-keys'); - -module.exports = require('./_descriptors') ? 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; -}; diff --git a/node_modules/core-js/library/modules/_object-forced-pam.js b/node_modules/core-js/library/modules/_object-forced-pam.js deleted file mode 100644 index 71ede9225..000000000 --- a/node_modules/core-js/library/modules/_object-forced-pam.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; -// Forced replacement prototype accessors methods -module.exports = require('./_library') || !require('./_fails')(function () { - var K = Math.random(); - // In FF throws only define methods - // eslint-disable-next-line no-undef, no-useless-call - __defineSetter__.call(null, K, function () { /* empty */ }); - delete require('./_global')[K]; -}); diff --git a/node_modules/core-js/library/modules/_object-gopd.js b/node_modules/core-js/library/modules/_object-gopd.js deleted file mode 100644 index 555dd31a5..000000000 --- a/node_modules/core-js/library/modules/_object-gopd.js +++ /dev/null @@ -1,16 +0,0 @@ -var pIE = require('./_object-pie'); -var createDesc = require('./_property-desc'); -var toIObject = require('./_to-iobject'); -var toPrimitive = require('./_to-primitive'); -var has = require('./_has'); -var IE8_DOM_DEFINE = require('./_ie8-dom-define'); -var gOPD = Object.getOwnPropertyDescriptor; - -exports.f = require('./_descriptors') ? 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]); -}; diff --git a/node_modules/core-js/library/modules/_object-gopn-ext.js b/node_modules/core-js/library/modules/_object-gopn-ext.js deleted file mode 100644 index 4abb6ae83..000000000 --- a/node_modules/core-js/library/modules/_object-gopn-ext.js +++ /dev/null @@ -1,19 +0,0 @@ -// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window -var toIObject = require('./_to-iobject'); -var gOPN = require('./_object-gopn').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)); -}; diff --git a/node_modules/core-js/library/modules/_object-gopn.js b/node_modules/core-js/library/modules/_object-gopn.js deleted file mode 100644 index da82333f6..000000000 --- a/node_modules/core-js/library/modules/_object-gopn.js +++ /dev/null @@ -1,7 +0,0 @@ -// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) -var $keys = require('./_object-keys-internal'); -var hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype'); - -exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { - return $keys(O, hiddenKeys); -}; diff --git a/node_modules/core-js/library/modules/_object-gops.js b/node_modules/core-js/library/modules/_object-gops.js deleted file mode 100644 index bc0672905..000000000 --- a/node_modules/core-js/library/modules/_object-gops.js +++ /dev/null @@ -1 +0,0 @@ -exports.f = Object.getOwnPropertySymbols; diff --git a/node_modules/core-js/library/modules/_object-gpo.js b/node_modules/core-js/library/modules/_object-gpo.js deleted file mode 100644 index 27f2a94e8..000000000 --- a/node_modules/core-js/library/modules/_object-gpo.js +++ /dev/null @@ -1,13 +0,0 @@ -// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) -var has = require('./_has'); -var toObject = require('./_to-object'); -var IE_PROTO = require('./_shared-key')('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; -}; diff --git a/node_modules/core-js/library/modules/_object-keys-internal.js b/node_modules/core-js/library/modules/_object-keys-internal.js deleted file mode 100644 index 71abdd1a5..000000000 --- a/node_modules/core-js/library/modules/_object-keys-internal.js +++ /dev/null @@ -1,17 +0,0 @@ -var has = require('./_has'); -var toIObject = require('./_to-iobject'); -var arrayIndexOf = require('./_array-includes')(false); -var IE_PROTO = require('./_shared-key')('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; -}; diff --git a/node_modules/core-js/library/modules/_object-keys.js b/node_modules/core-js/library/modules/_object-keys.js deleted file mode 100644 index 62f73f91e..000000000 --- a/node_modules/core-js/library/modules/_object-keys.js +++ /dev/null @@ -1,7 +0,0 @@ -// 19.1.2.14 / 15.2.3.14 Object.keys(O) -var $keys = require('./_object-keys-internal'); -var enumBugKeys = require('./_enum-bug-keys'); - -module.exports = Object.keys || function keys(O) { - return $keys(O, enumBugKeys); -}; diff --git a/node_modules/core-js/library/modules/_object-pie.js b/node_modules/core-js/library/modules/_object-pie.js deleted file mode 100644 index 4cc71072d..000000000 --- a/node_modules/core-js/library/modules/_object-pie.js +++ /dev/null @@ -1 +0,0 @@ -exports.f = {}.propertyIsEnumerable; diff --git a/node_modules/core-js/library/modules/_object-sap.js b/node_modules/core-js/library/modules/_object-sap.js deleted file mode 100644 index 643535e0a..000000000 --- a/node_modules/core-js/library/modules/_object-sap.js +++ /dev/null @@ -1,10 +0,0 @@ -// most Object methods by ES6 should accept primitives -var $export = require('./_export'); -var core = require('./_core'); -var fails = require('./_fails'); -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); -}; diff --git a/node_modules/core-js/library/modules/_object-to-array.js b/node_modules/core-js/library/modules/_object-to-array.js deleted file mode 100644 index 120100d09..000000000 --- a/node_modules/core-js/library/modules/_object-to-array.js +++ /dev/null @@ -1,16 +0,0 @@ -var getKeys = require('./_object-keys'); -var toIObject = require('./_to-iobject'); -var isEnum = require('./_object-pie').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) if (isEnum.call(O, key = keys[i++])) { - result.push(isEntries ? [key, O[key]] : O[key]); - } return result; - }; -}; diff --git a/node_modules/core-js/library/modules/_own-keys.js b/node_modules/core-js/library/modules/_own-keys.js deleted file mode 100644 index 84faece8f..000000000 --- a/node_modules/core-js/library/modules/_own-keys.js +++ /dev/null @@ -1,10 +0,0 @@ -// all object keys, includes non-enumerable and symbols -var gOPN = require('./_object-gopn'); -var gOPS = require('./_object-gops'); -var anObject = require('./_an-object'); -var Reflect = require('./_global').Reflect; -module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { - var keys = gOPN.f(anObject(it)); - var getSymbols = gOPS.f; - return getSymbols ? keys.concat(getSymbols(it)) : keys; -}; diff --git a/node_modules/core-js/library/modules/_parse-float.js b/node_modules/core-js/library/modules/_parse-float.js deleted file mode 100644 index acfb350f9..000000000 --- a/node_modules/core-js/library/modules/_parse-float.js +++ /dev/null @@ -1,8 +0,0 @@ -var $parseFloat = require('./_global').parseFloat; -var $trim = require('./_string-trim').trim; - -module.exports = 1 / $parseFloat(require('./_string-ws') + '-0') !== -Infinity ? function parseFloat(str) { - var string = $trim(String(str), 3); - var result = $parseFloat(string); - return result === 0 && string.charAt(0) == '-' ? -0 : result; -} : $parseFloat; diff --git a/node_modules/core-js/library/modules/_parse-int.js b/node_modules/core-js/library/modules/_parse-int.js deleted file mode 100644 index ddd7172a9..000000000 --- a/node_modules/core-js/library/modules/_parse-int.js +++ /dev/null @@ -1,9 +0,0 @@ -var $parseInt = require('./_global').parseInt; -var $trim = require('./_string-trim').trim; -var ws = require('./_string-ws'); -var hex = /^[-+]?0[xX]/; - -module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) { - var string = $trim(String(str), 3); - return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); -} : $parseInt; diff --git a/node_modules/core-js/library/modules/_partial.js b/node_modules/core-js/library/modules/_partial.js deleted file mode 100644 index ca3f35bf8..000000000 --- a/node_modules/core-js/library/modules/_partial.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; -var path = require('./_path'); -var invoke = require('./_invoke'); -var aFunction = require('./_a-function'); -module.exports = function (/* ...pargs */) { - var fn = aFunction(this); - var length = arguments.length; - var pargs = new Array(length); - var i = 0; - var _ = path._; - var holder = false; - while (length > i) if ((pargs[i] = arguments[i++]) === _) holder = true; - return function (/* ...args */) { - var that = this; - var aLen = arguments.length; - var j = 0; - var k = 0; - var args; - if (!holder && !aLen) return invoke(fn, pargs, that); - args = pargs.slice(); - if (holder) for (;length > j; j++) if (args[j] === _) args[j] = arguments[k++]; - while (aLen > k) args.push(arguments[k++]); - return invoke(fn, args, that); - }; -}; diff --git a/node_modules/core-js/library/modules/_path.js b/node_modules/core-js/library/modules/_path.js deleted file mode 100644 index 2796ebcb9..000000000 --- a/node_modules/core-js/library/modules/_path.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./_core'); diff --git a/node_modules/core-js/library/modules/_perform.js b/node_modules/core-js/library/modules/_perform.js deleted file mode 100644 index bfc7b296d..000000000 --- a/node_modules/core-js/library/modules/_perform.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = function (exec) { - try { - return { e: false, v: exec() }; - } catch (e) { - return { e: true, v: e }; - } -}; diff --git a/node_modules/core-js/library/modules/_promise-resolve.js b/node_modules/core-js/library/modules/_promise-resolve.js deleted file mode 100644 index c3cac7646..000000000 --- a/node_modules/core-js/library/modules/_promise-resolve.js +++ /dev/null @@ -1,12 +0,0 @@ -var anObject = require('./_an-object'); -var isObject = require('./_is-object'); -var newPromiseCapability = require('./_new-promise-capability'); - -module.exports = function (C, x) { - anObject(C); - if (isObject(x) && x.constructor === C) return x; - var promiseCapability = newPromiseCapability.f(C); - var resolve = promiseCapability.resolve; - resolve(x); - return promiseCapability.promise; -}; diff --git a/node_modules/core-js/library/modules/_property-desc.js b/node_modules/core-js/library/modules/_property-desc.js deleted file mode 100644 index 090593405..000000000 --- a/node_modules/core-js/library/modules/_property-desc.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = function (bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value: value - }; -}; diff --git a/node_modules/core-js/library/modules/_redefine-all.js b/node_modules/core-js/library/modules/_redefine-all.js deleted file mode 100644 index bf8c0ea39..000000000 --- a/node_modules/core-js/library/modules/_redefine-all.js +++ /dev/null @@ -1,7 +0,0 @@ -var hide = require('./_hide'); -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; -}; diff --git a/node_modules/core-js/library/modules/_redefine.js b/node_modules/core-js/library/modules/_redefine.js deleted file mode 100644 index fde6108ef..000000000 --- a/node_modules/core-js/library/modules/_redefine.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./_hide'); diff --git a/node_modules/core-js/library/modules/_replacer.js b/node_modules/core-js/library/modules/_replacer.js deleted file mode 100644 index c37703dd2..000000000 --- a/node_modules/core-js/library/modules/_replacer.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = function (regExp, replace) { - var replacer = replace === Object(replace) ? function (part) { - return replace[part]; - } : replace; - return function (it) { - return String(it).replace(regExp, replacer); - }; -}; diff --git a/node_modules/core-js/library/modules/_same-value.js b/node_modules/core-js/library/modules/_same-value.js deleted file mode 100644 index c6d045e83..000000000 --- a/node_modules/core-js/library/modules/_same-value.js +++ /dev/null @@ -1,5 +0,0 @@ -// 7.2.9 SameValue(x, y) -module.exports = Object.is || function is(x, y) { - // eslint-disable-next-line no-self-compare - return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; -}; diff --git a/node_modules/core-js/library/modules/_set-collection-from.js b/node_modules/core-js/library/modules/_set-collection-from.js deleted file mode 100644 index d5001f93e..000000000 --- a/node_modules/core-js/library/modules/_set-collection-from.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; -// https://tc39.github.io/proposal-setmap-offrom/ -var $export = require('./_export'); -var aFunction = require('./_a-function'); -var ctx = require('./_ctx'); -var forOf = require('./_for-of'); - -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); - } }); -}; diff --git a/node_modules/core-js/library/modules/_set-collection-of.js b/node_modules/core-js/library/modules/_set-collection-of.js deleted file mode 100644 index f559af3fc..000000000 --- a/node_modules/core-js/library/modules/_set-collection-of.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; -// https://tc39.github.io/proposal-setmap-offrom/ -var $export = require('./_export'); - -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); - } }); -}; diff --git a/node_modules/core-js/library/modules/_set-proto.js b/node_modules/core-js/library/modules/_set-proto.js deleted file mode 100644 index c1990622e..000000000 --- a/node_modules/core-js/library/modules/_set-proto.js +++ /dev/null @@ -1,25 +0,0 @@ -// Works with __proto__ only. Old v8 can't work with null proto objects. -/* eslint-disable no-proto */ -var isObject = require('./_is-object'); -var anObject = require('./_an-object'); -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 = require('./_ctx')(Function.call, require('./_object-gopd').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 -}; diff --git a/node_modules/core-js/library/modules/_set-species.js b/node_modules/core-js/library/modules/_set-species.js deleted file mode 100644 index 1f25fde1e..000000000 --- a/node_modules/core-js/library/modules/_set-species.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; -var global = require('./_global'); -var core = require('./_core'); -var dP = require('./_object-dp'); -var DESCRIPTORS = require('./_descriptors'); -var SPECIES = require('./_wks')('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; } - }); -}; diff --git a/node_modules/core-js/library/modules/_set-to-string-tag.js b/node_modules/core-js/library/modules/_set-to-string-tag.js deleted file mode 100644 index 5bd64144f..000000000 --- a/node_modules/core-js/library/modules/_set-to-string-tag.js +++ /dev/null @@ -1,7 +0,0 @@ -var def = require('./_object-dp').f; -var has = require('./_has'); -var TAG = require('./_wks')('toStringTag'); - -module.exports = function (it, tag, stat) { - if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); -}; diff --git a/node_modules/core-js/library/modules/_shared-key.js b/node_modules/core-js/library/modules/_shared-key.js deleted file mode 100644 index d47fe7a28..000000000 --- a/node_modules/core-js/library/modules/_shared-key.js +++ /dev/null @@ -1,5 +0,0 @@ -var shared = require('./_shared')('keys'); -var uid = require('./_uid'); -module.exports = function (key) { - return shared[key] || (shared[key] = uid(key)); -}; diff --git a/node_modules/core-js/library/modules/_shared.js b/node_modules/core-js/library/modules/_shared.js deleted file mode 100644 index 2c6abc22e..000000000 --- a/node_modules/core-js/library/modules/_shared.js +++ /dev/null @@ -1,12 +0,0 @@ -var core = require('./_core'); -var global = require('./_global'); -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: require('./_library') ? 'pure' : 'global', - copyright: '© 2018 Denis Pushkarev (zloirock.ru)' -}); diff --git a/node_modules/core-js/library/modules/_species-constructor.js b/node_modules/core-js/library/modules/_species-constructor.js deleted file mode 100644 index 0cb4ffb8f..000000000 --- a/node_modules/core-js/library/modules/_species-constructor.js +++ /dev/null @@ -1,9 +0,0 @@ -// 7.3.20 SpeciesConstructor(O, defaultConstructor) -var anObject = require('./_an-object'); -var aFunction = require('./_a-function'); -var SPECIES = require('./_wks')('species'); -module.exports = function (O, D) { - var C = anObject(O).constructor; - var S; - return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); -}; diff --git a/node_modules/core-js/library/modules/_strict-method.js b/node_modules/core-js/library/modules/_strict-method.js deleted file mode 100644 index e68f41bb6..000000000 --- a/node_modules/core-js/library/modules/_strict-method.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; -var fails = require('./_fails'); - -module.exports = function (method, arg) { - return !!method && fails(function () { - // eslint-disable-next-line no-useless-call - arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null); - }); -}; diff --git a/node_modules/core-js/library/modules/_string-at.js b/node_modules/core-js/library/modules/_string-at.js deleted file mode 100644 index 88d66bd18..000000000 --- a/node_modules/core-js/library/modules/_string-at.js +++ /dev/null @@ -1,17 +0,0 @@ -var toInteger = require('./_to-integer'); -var defined = require('./_defined'); -// 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; - }; -}; diff --git a/node_modules/core-js/library/modules/_string-context.js b/node_modules/core-js/library/modules/_string-context.js deleted file mode 100644 index becf3fbeb..000000000 --- a/node_modules/core-js/library/modules/_string-context.js +++ /dev/null @@ -1,8 +0,0 @@ -// helper for String#{startsWith, endsWith, includes} -var isRegExp = require('./_is-regexp'); -var defined = require('./_defined'); - -module.exports = function (that, searchString, NAME) { - if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); - return String(defined(that)); -}; diff --git a/node_modules/core-js/library/modules/_string-html.js b/node_modules/core-js/library/modules/_string-html.js deleted file mode 100644 index 1dcc95bcd..000000000 --- a/node_modules/core-js/library/modules/_string-html.js +++ /dev/null @@ -1,19 +0,0 @@ -var $export = require('./_export'); -var fails = require('./_fails'); -var defined = require('./_defined'); -var quot = /"/g; -// B.2.3.2.1 CreateHTML(string, tag, attribute, value) -var createHTML = function (string, tag, attribute, value) { - var S = String(defined(string)); - var p1 = '<' + tag; - if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; - return p1 + '>' + S + ''; -}; -module.exports = function (NAME, exec) { - var O = {}; - O[NAME] = exec(createHTML); - $export($export.P + $export.F * fails(function () { - var test = ''[NAME]('"'); - return test !== test.toLowerCase() || test.split('"').length > 3; - }), 'String', O); -}; diff --git a/node_modules/core-js/library/modules/_string-pad.js b/node_modules/core-js/library/modules/_string-pad.js deleted file mode 100644 index ceb6077f0..000000000 --- a/node_modules/core-js/library/modules/_string-pad.js +++ /dev/null @@ -1,16 +0,0 @@ -// https://github.com/tc39/proposal-string-pad-start-end -var toLength = require('./_to-length'); -var repeat = require('./_string-repeat'); -var defined = require('./_defined'); - -module.exports = function (that, maxLength, fillString, left) { - var S = String(defined(that)); - var stringLength = S.length; - var fillStr = fillString === undefined ? ' ' : String(fillString); - var intMaxLength = toLength(maxLength); - if (intMaxLength <= stringLength || fillStr == '') return S; - var fillLen = intMaxLength - stringLength; - var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); - if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); - return left ? stringFiller + S : S + stringFiller; -}; diff --git a/node_modules/core-js/library/modules/_string-repeat.js b/node_modules/core-js/library/modules/_string-repeat.js deleted file mode 100644 index a69b9626b..000000000 --- a/node_modules/core-js/library/modules/_string-repeat.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; -var toInteger = require('./_to-integer'); -var defined = require('./_defined'); - -module.exports = function repeat(count) { - var str = String(defined(this)); - var res = ''; - var n = toInteger(count); - if (n < 0 || n == Infinity) throw RangeError("Count can't be negative"); - for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str; - return res; -}; diff --git a/node_modules/core-js/library/modules/_string-trim.js b/node_modules/core-js/library/modules/_string-trim.js deleted file mode 100644 index 6b54a81a8..000000000 --- a/node_modules/core-js/library/modules/_string-trim.js +++ /dev/null @@ -1,30 +0,0 @@ -var $export = require('./_export'); -var defined = require('./_defined'); -var fails = require('./_fails'); -var spaces = require('./_string-ws'); -var space = '[' + spaces + ']'; -var non = '\u200b\u0085'; -var ltrim = RegExp('^' + space + space + '*'); -var rtrim = RegExp(space + space + '*$'); - -var exporter = function (KEY, exec, ALIAS) { - var exp = {}; - var FORCE = fails(function () { - return !!spaces[KEY]() || non[KEY]() != non; - }); - var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; - if (ALIAS) exp[ALIAS] = fn; - $export($export.P + $export.F * FORCE, 'String', exp); -}; - -// 1 -> String#trimLeft -// 2 -> String#trimRight -// 3 -> String#trim -var trim = exporter.trim = function (string, TYPE) { - string = String(defined(string)); - if (TYPE & 1) string = string.replace(ltrim, ''); - if (TYPE & 2) string = string.replace(rtrim, ''); - return string; -}; - -module.exports = exporter; diff --git a/node_modules/core-js/library/modules/_string-ws.js b/node_modules/core-js/library/modules/_string-ws.js deleted file mode 100644 index 2c68cf9f4..000000000 --- a/node_modules/core-js/library/modules/_string-ws.js +++ /dev/null @@ -1,2 +0,0 @@ -module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + - '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; diff --git a/node_modules/core-js/library/modules/_task.js b/node_modules/core-js/library/modules/_task.js deleted file mode 100644 index 8777a6e28..000000000 --- a/node_modules/core-js/library/modules/_task.js +++ /dev/null @@ -1,84 +0,0 @@ -var ctx = require('./_ctx'); -var invoke = require('./_invoke'); -var html = require('./_html'); -var cel = require('./_dom-create'); -var global = require('./_global'); -var process = global.process; -var setTask = global.setImmediate; -var clearTask = global.clearImmediate; -var MessageChannel = global.MessageChannel; -var Dispatch = global.Dispatch; -var counter = 0; -var queue = {}; -var ONREADYSTATECHANGE = 'onreadystatechange'; -var defer, channel, port; -var run = function () { - var id = +this; - // eslint-disable-next-line no-prototype-builtins - if (queue.hasOwnProperty(id)) { - var fn = queue[id]; - delete queue[id]; - fn(); - } -}; -var listener = function (event) { - run.call(event.data); -}; -// Node.js 0.9+ & IE10+ has setImmediate, otherwise: -if (!setTask || !clearTask) { - setTask = function setImmediate(fn) { - var args = []; - var i = 1; - while (arguments.length > i) args.push(arguments[i++]); - queue[++counter] = function () { - // eslint-disable-next-line no-new-func - invoke(typeof fn == 'function' ? fn : Function(fn), args); - }; - defer(counter); - return counter; - }; - clearTask = function clearImmediate(id) { - delete queue[id]; - }; - // Node.js 0.8- - if (require('./_cof')(process) == 'process') { - defer = function (id) { - process.nextTick(ctx(run, id, 1)); - }; - // Sphere (JS game engine) Dispatch API - } else if (Dispatch && Dispatch.now) { - defer = function (id) { - Dispatch.now(ctx(run, id, 1)); - }; - // Browsers with MessageChannel, includes WebWorkers - } else if (MessageChannel) { - channel = new MessageChannel(); - port = channel.port2; - channel.port1.onmessage = listener; - defer = ctx(port.postMessage, port, 1); - // Browsers with postMessage, skip WebWorkers - // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' - } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { - defer = function (id) { - global.postMessage(id + '', '*'); - }; - global.addEventListener('message', listener, false); - // IE8- - } else if (ONREADYSTATECHANGE in cel('script')) { - defer = function (id) { - html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { - html.removeChild(this); - run.call(id); - }; - }; - // Rest old browsers - } else { - defer = function (id) { - setTimeout(ctx(run, id, 1), 0); - }; - } -} -module.exports = { - set: setTask, - clear: clearTask -}; diff --git a/node_modules/core-js/library/modules/_to-absolute-index.js b/node_modules/core-js/library/modules/_to-absolute-index.js deleted file mode 100644 index dfee02e8e..000000000 --- a/node_modules/core-js/library/modules/_to-absolute-index.js +++ /dev/null @@ -1,7 +0,0 @@ -var toInteger = require('./_to-integer'); -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); -}; diff --git a/node_modules/core-js/library/modules/_to-index.js b/node_modules/core-js/library/modules/_to-index.js deleted file mode 100644 index 8f51c32d2..000000000 --- a/node_modules/core-js/library/modules/_to-index.js +++ /dev/null @@ -1,10 +0,0 @@ -// https://tc39.github.io/ecma262/#sec-toindex -var toInteger = require('./_to-integer'); -var toLength = require('./_to-length'); -module.exports = function (it) { - if (it === undefined) return 0; - var number = toInteger(it); - var length = toLength(number); - if (number !== length) throw RangeError('Wrong length!'); - return length; -}; diff --git a/node_modules/core-js/library/modules/_to-integer.js b/node_modules/core-js/library/modules/_to-integer.js deleted file mode 100644 index 3d50f97dd..000000000 --- a/node_modules/core-js/library/modules/_to-integer.js +++ /dev/null @@ -1,6 +0,0 @@ -// 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); -}; diff --git a/node_modules/core-js/library/modules/_to-iobject.js b/node_modules/core-js/library/modules/_to-iobject.js deleted file mode 100644 index 7614503a2..000000000 --- a/node_modules/core-js/library/modules/_to-iobject.js +++ /dev/null @@ -1,6 +0,0 @@ -// to indexed object, toObject with fallback for non-array-like ES3 strings -var IObject = require('./_iobject'); -var defined = require('./_defined'); -module.exports = function (it) { - return IObject(defined(it)); -}; diff --git a/node_modules/core-js/library/modules/_to-length.js b/node_modules/core-js/library/modules/_to-length.js deleted file mode 100644 index a9db50173..000000000 --- a/node_modules/core-js/library/modules/_to-length.js +++ /dev/null @@ -1,6 +0,0 @@ -// 7.1.15 ToLength -var toInteger = require('./_to-integer'); -var min = Math.min; -module.exports = function (it) { - return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 -}; diff --git a/node_modules/core-js/library/modules/_to-object.js b/node_modules/core-js/library/modules/_to-object.js deleted file mode 100644 index 0efea4c69..000000000 --- a/node_modules/core-js/library/modules/_to-object.js +++ /dev/null @@ -1,5 +0,0 @@ -// 7.1.13 ToObject(argument) -var defined = require('./_defined'); -module.exports = function (it) { - return Object(defined(it)); -}; diff --git a/node_modules/core-js/library/modules/_to-primitive.js b/node_modules/core-js/library/modules/_to-primitive.js deleted file mode 100644 index de3dd6b19..000000000 --- a/node_modules/core-js/library/modules/_to-primitive.js +++ /dev/null @@ -1,12 +0,0 @@ -// 7.1.1 ToPrimitive(input [, PreferredType]) -var isObject = require('./_is-object'); -// 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"); -}; diff --git a/node_modules/core-js/library/modules/_typed-array.js b/node_modules/core-js/library/modules/_typed-array.js deleted file mode 100644 index 30d9c0ba5..000000000 --- a/node_modules/core-js/library/modules/_typed-array.js +++ /dev/null @@ -1,480 +0,0 @@ -'use strict'; -if (require('./_descriptors')) { - var LIBRARY = require('./_library'); - var global = require('./_global'); - var fails = require('./_fails'); - var $export = require('./_export'); - var $typed = require('./_typed'); - var $buffer = require('./_typed-buffer'); - var ctx = require('./_ctx'); - var anInstance = require('./_an-instance'); - var propertyDesc = require('./_property-desc'); - var hide = require('./_hide'); - var redefineAll = require('./_redefine-all'); - var toInteger = require('./_to-integer'); - var toLength = require('./_to-length'); - var toIndex = require('./_to-index'); - var toAbsoluteIndex = require('./_to-absolute-index'); - var toPrimitive = require('./_to-primitive'); - var has = require('./_has'); - var classof = require('./_classof'); - var isObject = require('./_is-object'); - var toObject = require('./_to-object'); - var isArrayIter = require('./_is-array-iter'); - var create = require('./_object-create'); - var getPrototypeOf = require('./_object-gpo'); - var gOPN = require('./_object-gopn').f; - var getIterFn = require('./core.get-iterator-method'); - var uid = require('./_uid'); - var wks = require('./_wks'); - var createArrayMethod = require('./_array-methods'); - var createArrayIncludes = require('./_array-includes'); - var speciesConstructor = require('./_species-constructor'); - var ArrayIterators = require('./es6.array.iterator'); - var Iterators = require('./_iterators'); - var $iterDetect = require('./_iter-detect'); - var setSpecies = require('./_set-species'); - var arrayFill = require('./_array-fill'); - var arrayCopyWithin = require('./_array-copy-within'); - var $DP = require('./_object-dp'); - var $GOPD = require('./_object-gopd'); - var dP = $DP.f; - var gOPD = $GOPD.f; - var RangeError = global.RangeError; - var TypeError = global.TypeError; - var Uint8Array = global.Uint8Array; - var ARRAY_BUFFER = 'ArrayBuffer'; - var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER; - var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; - var PROTOTYPE = 'prototype'; - var ArrayProto = Array[PROTOTYPE]; - var $ArrayBuffer = $buffer.ArrayBuffer; - var $DataView = $buffer.DataView; - var arrayForEach = createArrayMethod(0); - var arrayFilter = createArrayMethod(2); - var arraySome = createArrayMethod(3); - var arrayEvery = createArrayMethod(4); - var arrayFind = createArrayMethod(5); - var arrayFindIndex = createArrayMethod(6); - var arrayIncludes = createArrayIncludes(true); - var arrayIndexOf = createArrayIncludes(false); - var arrayValues = ArrayIterators.values; - var arrayKeys = ArrayIterators.keys; - var arrayEntries = ArrayIterators.entries; - var arrayLastIndexOf = ArrayProto.lastIndexOf; - var arrayReduce = ArrayProto.reduce; - var arrayReduceRight = ArrayProto.reduceRight; - var arrayJoin = ArrayProto.join; - var arraySort = ArrayProto.sort; - var arraySlice = ArrayProto.slice; - var arrayToString = ArrayProto.toString; - var arrayToLocaleString = ArrayProto.toLocaleString; - var ITERATOR = wks('iterator'); - var TAG = wks('toStringTag'); - var TYPED_CONSTRUCTOR = uid('typed_constructor'); - var DEF_CONSTRUCTOR = uid('def_constructor'); - var ALL_CONSTRUCTORS = $typed.CONSTR; - var TYPED_ARRAY = $typed.TYPED; - var VIEW = $typed.VIEW; - var WRONG_LENGTH = 'Wrong length!'; - - var $map = createArrayMethod(1, function (O, length) { - return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); - }); - - var LITTLE_ENDIAN = fails(function () { - // eslint-disable-next-line no-undef - return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; - }); - - var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () { - new Uint8Array(1).set({}); - }); - - var toOffset = function (it, BYTES) { - var offset = toInteger(it); - if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!'); - return offset; - }; - - var validate = function (it) { - if (isObject(it) && TYPED_ARRAY in it) return it; - throw TypeError(it + ' is not a typed array!'); - }; - - var allocate = function (C, length) { - if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) { - throw TypeError('It is not a typed array constructor!'); - } return new C(length); - }; - - var speciesFromList = function (O, list) { - return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); - }; - - var fromList = function (C, list) { - var index = 0; - var length = list.length; - var result = allocate(C, length); - while (length > index) result[index] = list[index++]; - return result; - }; - - var addGetter = function (it, key, internal) { - dP(it, key, { get: function () { return this._d[internal]; } }); - }; - - var $from = function from(source /* , mapfn, thisArg */) { - var O = toObject(source); - var aLen = arguments.length; - var mapfn = aLen > 1 ? arguments[1] : undefined; - var mapping = mapfn !== undefined; - var iterFn = getIterFn(O); - var i, length, values, result, step, iterator; - if (iterFn != undefined && !isArrayIter(iterFn)) { - for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) { - values.push(step.value); - } O = values; - } - if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2); - for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) { - result[i] = mapping ? mapfn(O[i], i) : O[i]; - } - return result; - }; - - var $of = function of(/* ...items */) { - var index = 0; - var length = arguments.length; - var result = allocate(this, length); - while (length > index) result[index] = arguments[index++]; - return result; - }; - - // iOS Safari 6.x fails here - var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); }); - - var $toLocaleString = function toLocaleString() { - return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); - }; - - var proto = { - copyWithin: function copyWithin(target, start /* , end */) { - return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); - }, - every: function every(callbackfn /* , thisArg */) { - return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }, - fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars - return arrayFill.apply(validate(this), arguments); - }, - filter: function filter(callbackfn /* , thisArg */) { - return speciesFromList(this, arrayFilter(validate(this), callbackfn, - arguments.length > 1 ? arguments[1] : undefined)); - }, - find: function find(predicate /* , thisArg */) { - return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); - }, - findIndex: function findIndex(predicate /* , thisArg */) { - return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); - }, - forEach: function forEach(callbackfn /* , thisArg */) { - arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }, - indexOf: function indexOf(searchElement /* , fromIndex */) { - return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); - }, - includes: function includes(searchElement /* , fromIndex */) { - return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); - }, - join: function join(separator) { // eslint-disable-line no-unused-vars - return arrayJoin.apply(validate(this), arguments); - }, - lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars - return arrayLastIndexOf.apply(validate(this), arguments); - }, - map: function map(mapfn /* , thisArg */) { - return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); - }, - reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars - return arrayReduce.apply(validate(this), arguments); - }, - reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars - return arrayReduceRight.apply(validate(this), arguments); - }, - reverse: function reverse() { - var that = this; - var length = validate(that).length; - var middle = Math.floor(length / 2); - var index = 0; - var value; - while (index < middle) { - value = that[index]; - that[index++] = that[--length]; - that[length] = value; - } return that; - }, - some: function some(callbackfn /* , thisArg */) { - return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }, - sort: function sort(comparefn) { - return arraySort.call(validate(this), comparefn); - }, - subarray: function subarray(begin, end) { - var O = validate(this); - var length = O.length; - var $begin = toAbsoluteIndex(begin, length); - return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( - O.buffer, - O.byteOffset + $begin * O.BYTES_PER_ELEMENT, - toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin) - ); - } - }; - - var $slice = function slice(start, end) { - return speciesFromList(this, arraySlice.call(validate(this), start, end)); - }; - - var $set = function set(arrayLike /* , offset */) { - validate(this); - var offset = toOffset(arguments[1], 1); - var length = this.length; - var src = toObject(arrayLike); - var len = toLength(src.length); - var index = 0; - if (len + offset > length) throw RangeError(WRONG_LENGTH); - while (index < len) this[offset + index] = src[index++]; - }; - - var $iterators = { - entries: function entries() { - return arrayEntries.call(validate(this)); - }, - keys: function keys() { - return arrayKeys.call(validate(this)); - }, - values: function values() { - return arrayValues.call(validate(this)); - } - }; - - var isTAIndex = function (target, key) { - return isObject(target) - && target[TYPED_ARRAY] - && typeof key != 'symbol' - && key in target - && String(+key) == String(key); - }; - var $getDesc = function getOwnPropertyDescriptor(target, key) { - return isTAIndex(target, key = toPrimitive(key, true)) - ? propertyDesc(2, target[key]) - : gOPD(target, key); - }; - var $setDesc = function defineProperty(target, key, desc) { - if (isTAIndex(target, key = toPrimitive(key, true)) - && isObject(desc) - && has(desc, 'value') - && !has(desc, 'get') - && !has(desc, 'set') - // TODO: add validation descriptor w/o calling accessors - && !desc.configurable - && (!has(desc, 'writable') || desc.writable) - && (!has(desc, 'enumerable') || desc.enumerable) - ) { - target[key] = desc.value; - return target; - } return dP(target, key, desc); - }; - - if (!ALL_CONSTRUCTORS) { - $GOPD.f = $getDesc; - $DP.f = $setDesc; - } - - $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { - getOwnPropertyDescriptor: $getDesc, - defineProperty: $setDesc - }); - - if (fails(function () { arrayToString.call({}); })) { - arrayToString = arrayToLocaleString = function toString() { - return arrayJoin.call(this); - }; - } - - var $TypedArrayPrototype$ = redefineAll({}, proto); - redefineAll($TypedArrayPrototype$, $iterators); - hide($TypedArrayPrototype$, ITERATOR, $iterators.values); - redefineAll($TypedArrayPrototype$, { - slice: $slice, - set: $set, - constructor: function () { /* noop */ }, - toString: arrayToString, - toLocaleString: $toLocaleString - }); - addGetter($TypedArrayPrototype$, 'buffer', 'b'); - addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); - addGetter($TypedArrayPrototype$, 'byteLength', 'l'); - addGetter($TypedArrayPrototype$, 'length', 'e'); - dP($TypedArrayPrototype$, TAG, { - get: function () { return this[TYPED_ARRAY]; } - }); - - // eslint-disable-next-line max-statements - module.exports = function (KEY, BYTES, wrapper, CLAMPED) { - CLAMPED = !!CLAMPED; - var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'; - var GETTER = 'get' + KEY; - var SETTER = 'set' + KEY; - var TypedArray = global[NAME]; - var Base = TypedArray || {}; - var TAC = TypedArray && getPrototypeOf(TypedArray); - var FORCED = !TypedArray || !$typed.ABV; - var O = {}; - var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; - var getter = function (that, index) { - var data = that._d; - return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); - }; - var setter = function (that, index, value) { - var data = that._d; - if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; - data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); - }; - var addElement = function (that, index) { - dP(that, index, { - get: function () { - return getter(this, index); - }, - set: function (value) { - return setter(this, index, value); - }, - enumerable: true - }); - }; - if (FORCED) { - TypedArray = wrapper(function (that, data, $offset, $length) { - anInstance(that, TypedArray, NAME, '_d'); - var index = 0; - var offset = 0; - var buffer, byteLength, length, klass; - if (!isObject(data)) { - length = toIndex(data); - byteLength = length * BYTES; - buffer = new $ArrayBuffer(byteLength); - } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { - buffer = data; - offset = toOffset($offset, BYTES); - var $len = data.byteLength; - if ($length === undefined) { - if ($len % BYTES) throw RangeError(WRONG_LENGTH); - byteLength = $len - offset; - if (byteLength < 0) throw RangeError(WRONG_LENGTH); - } else { - byteLength = toLength($length) * BYTES; - if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH); - } - length = byteLength / BYTES; - } else if (TYPED_ARRAY in data) { - return fromList(TypedArray, data); - } else { - return $from.call(TypedArray, data); - } - hide(that, '_d', { - b: buffer, - o: offset, - l: byteLength, - e: length, - v: new $DataView(buffer) - }); - while (index < length) addElement(that, index++); - }); - TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); - hide(TypedArrayPrototype, 'constructor', TypedArray); - } else if (!fails(function () { - TypedArray(1); - }) || !fails(function () { - new TypedArray(-1); // eslint-disable-line no-new - }) || !$iterDetect(function (iter) { - new TypedArray(); // eslint-disable-line no-new - new TypedArray(null); // eslint-disable-line no-new - new TypedArray(1.5); // eslint-disable-line no-new - new TypedArray(iter); // eslint-disable-line no-new - }, true)) { - TypedArray = wrapper(function (that, data, $offset, $length) { - anInstance(that, TypedArray, NAME); - var klass; - // `ws` module bug, temporarily remove validation length for Uint8Array - // https://github.com/websockets/ws/pull/645 - if (!isObject(data)) return new Base(toIndex(data)); - if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { - return $length !== undefined - ? new Base(data, toOffset($offset, BYTES), $length) - : $offset !== undefined - ? new Base(data, toOffset($offset, BYTES)) - : new Base(data); - } - if (TYPED_ARRAY in data) return fromList(TypedArray, data); - return $from.call(TypedArray, data); - }); - arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) { - if (!(key in TypedArray)) hide(TypedArray, key, Base[key]); - }); - TypedArray[PROTOTYPE] = TypedArrayPrototype; - if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray; - } - var $nativeIterator = TypedArrayPrototype[ITERATOR]; - var CORRECT_ITER_NAME = !!$nativeIterator - && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined); - var $iterator = $iterators.values; - hide(TypedArray, TYPED_CONSTRUCTOR, true); - hide(TypedArrayPrototype, TYPED_ARRAY, NAME); - hide(TypedArrayPrototype, VIEW, true); - hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); - - if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) { - dP(TypedArrayPrototype, TAG, { - get: function () { return NAME; } - }); - } - - O[NAME] = TypedArray; - - $export($export.G + $export.W + $export.F * (TypedArray != Base), O); - - $export($export.S, NAME, { - BYTES_PER_ELEMENT: BYTES - }); - - $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, { - from: $from, - of: $of - }); - - if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); - - $export($export.P, NAME, proto); - - setSpecies(NAME); - - $export($export.P + $export.F * FORCED_SET, NAME, { set: $set }); - - $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); - - if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString; - - $export($export.P + $export.F * fails(function () { - new TypedArray(1).slice(); - }), NAME, { slice: $slice }); - - $export($export.P + $export.F * (fails(function () { - return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString(); - }) || !fails(function () { - TypedArrayPrototype.toLocaleString.call([1, 2]); - })), NAME, { toLocaleString: $toLocaleString }); - - Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; - if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator); - }; -} else module.exports = function () { /* empty */ }; diff --git a/node_modules/core-js/library/modules/_typed-buffer.js b/node_modules/core-js/library/modules/_typed-buffer.js deleted file mode 100644 index c24cef38c..000000000 --- a/node_modules/core-js/library/modules/_typed-buffer.js +++ /dev/null @@ -1,276 +0,0 @@ -'use strict'; -var global = require('./_global'); -var DESCRIPTORS = require('./_descriptors'); -var LIBRARY = require('./_library'); -var $typed = require('./_typed'); -var hide = require('./_hide'); -var redefineAll = require('./_redefine-all'); -var fails = require('./_fails'); -var anInstance = require('./_an-instance'); -var toInteger = require('./_to-integer'); -var toLength = require('./_to-length'); -var toIndex = require('./_to-index'); -var gOPN = require('./_object-gopn').f; -var dP = require('./_object-dp').f; -var arrayFill = require('./_array-fill'); -var setToStringTag = require('./_set-to-string-tag'); -var ARRAY_BUFFER = 'ArrayBuffer'; -var DATA_VIEW = 'DataView'; -var PROTOTYPE = 'prototype'; -var WRONG_LENGTH = 'Wrong length!'; -var WRONG_INDEX = 'Wrong index!'; -var $ArrayBuffer = global[ARRAY_BUFFER]; -var $DataView = global[DATA_VIEW]; -var Math = global.Math; -var RangeError = global.RangeError; -// eslint-disable-next-line no-shadow-restricted-names -var Infinity = global.Infinity; -var BaseBuffer = $ArrayBuffer; -var abs = Math.abs; -var pow = Math.pow; -var floor = Math.floor; -var log = Math.log; -var LN2 = Math.LN2; -var BUFFER = 'buffer'; -var BYTE_LENGTH = 'byteLength'; -var BYTE_OFFSET = 'byteOffset'; -var $BUFFER = DESCRIPTORS ? '_b' : BUFFER; -var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH; -var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; - -// IEEE754 conversions based on https://github.com/feross/ieee754 -function packIEEE754(value, mLen, nBytes) { - var buffer = new Array(nBytes); - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0; - var i = 0; - var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; - var e, m, c; - value = abs(value); - // eslint-disable-next-line no-self-compare - if (value != value || value === Infinity) { - // eslint-disable-next-line no-self-compare - m = value != value ? 1 : 0; - e = eMax; - } else { - e = floor(log(value) / LN2); - if (value * (c = pow(2, -e)) < 1) { - e--; - c *= 2; - } - if (e + eBias >= 1) { - value += rt / c; - } else { - value += rt * pow(2, 1 - eBias); - } - if (value * c >= 2) { - e++; - c /= 2; - } - if (e + eBias >= eMax) { - m = 0; - e = eMax; - } else if (e + eBias >= 1) { - m = (value * c - 1) * pow(2, mLen); - e = e + eBias; - } else { - m = value * pow(2, eBias - 1) * pow(2, mLen); - e = 0; - } - } - for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); - e = e << mLen | m; - eLen += mLen; - for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); - buffer[--i] |= s * 128; - return buffer; -} -function unpackIEEE754(buffer, mLen, nBytes) { - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var nBits = eLen - 7; - var i = nBytes - 1; - var s = buffer[i--]; - var e = s & 127; - var m; - s >>= 7; - for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); - m = e & (1 << -nBits) - 1; - e >>= -nBits; - nBits += mLen; - for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); - if (e === 0) { - e = 1 - eBias; - } else if (e === eMax) { - return m ? NaN : s ? -Infinity : Infinity; - } else { - m = m + pow(2, mLen); - e = e - eBias; - } return (s ? -1 : 1) * m * pow(2, e - mLen); -} - -function unpackI32(bytes) { - return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; -} -function packI8(it) { - return [it & 0xff]; -} -function packI16(it) { - return [it & 0xff, it >> 8 & 0xff]; -} -function packI32(it) { - return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; -} -function packF64(it) { - return packIEEE754(it, 52, 8); -} -function packF32(it) { - return packIEEE754(it, 23, 4); -} - -function addGetter(C, key, internal) { - dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } }); -} - -function get(view, bytes, index, isLittleEndian) { - var numIndex = +index; - var intIndex = toIndex(numIndex); - if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); - var store = view[$BUFFER]._b; - var start = intIndex + view[$OFFSET]; - var pack = store.slice(start, start + bytes); - return isLittleEndian ? pack : pack.reverse(); -} -function set(view, bytes, index, conversion, value, isLittleEndian) { - var numIndex = +index; - var intIndex = toIndex(numIndex); - if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); - var store = view[$BUFFER]._b; - var start = intIndex + view[$OFFSET]; - var pack = conversion(+value); - for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; -} - -if (!$typed.ABV) { - $ArrayBuffer = function ArrayBuffer(length) { - anInstance(this, $ArrayBuffer, ARRAY_BUFFER); - var byteLength = toIndex(length); - this._b = arrayFill.call(new Array(byteLength), 0); - this[$LENGTH] = byteLength; - }; - - $DataView = function DataView(buffer, byteOffset, byteLength) { - anInstance(this, $DataView, DATA_VIEW); - anInstance(buffer, $ArrayBuffer, DATA_VIEW); - var bufferLength = buffer[$LENGTH]; - var offset = toInteger(byteOffset); - if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!'); - byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); - if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); - this[$BUFFER] = buffer; - this[$OFFSET] = offset; - this[$LENGTH] = byteLength; - }; - - if (DESCRIPTORS) { - addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); - addGetter($DataView, BUFFER, '_b'); - addGetter($DataView, BYTE_LENGTH, '_l'); - addGetter($DataView, BYTE_OFFSET, '_o'); - } - - redefineAll($DataView[PROTOTYPE], { - getInt8: function getInt8(byteOffset) { - return get(this, 1, byteOffset)[0] << 24 >> 24; - }, - getUint8: function getUint8(byteOffset) { - return get(this, 1, byteOffset)[0]; - }, - getInt16: function getInt16(byteOffset /* , littleEndian */) { - var bytes = get(this, 2, byteOffset, arguments[1]); - return (bytes[1] << 8 | bytes[0]) << 16 >> 16; - }, - getUint16: function getUint16(byteOffset /* , littleEndian */) { - var bytes = get(this, 2, byteOffset, arguments[1]); - return bytes[1] << 8 | bytes[0]; - }, - getInt32: function getInt32(byteOffset /* , littleEndian */) { - return unpackI32(get(this, 4, byteOffset, arguments[1])); - }, - getUint32: function getUint32(byteOffset /* , littleEndian */) { - return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; - }, - getFloat32: function getFloat32(byteOffset /* , littleEndian */) { - return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); - }, - getFloat64: function getFloat64(byteOffset /* , littleEndian */) { - return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); - }, - setInt8: function setInt8(byteOffset, value) { - set(this, 1, byteOffset, packI8, value); - }, - setUint8: function setUint8(byteOffset, value) { - set(this, 1, byteOffset, packI8, value); - }, - setInt16: function setInt16(byteOffset, value /* , littleEndian */) { - set(this, 2, byteOffset, packI16, value, arguments[2]); - }, - setUint16: function setUint16(byteOffset, value /* , littleEndian */) { - set(this, 2, byteOffset, packI16, value, arguments[2]); - }, - setInt32: function setInt32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packI32, value, arguments[2]); - }, - setUint32: function setUint32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packI32, value, arguments[2]); - }, - setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packF32, value, arguments[2]); - }, - setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { - set(this, 8, byteOffset, packF64, value, arguments[2]); - } - }); -} else { - if (!fails(function () { - $ArrayBuffer(1); - }) || !fails(function () { - new $ArrayBuffer(-1); // eslint-disable-line no-new - }) || fails(function () { - new $ArrayBuffer(); // eslint-disable-line no-new - new $ArrayBuffer(1.5); // eslint-disable-line no-new - new $ArrayBuffer(NaN); // eslint-disable-line no-new - return $ArrayBuffer.name != ARRAY_BUFFER; - })) { - $ArrayBuffer = function ArrayBuffer(length) { - anInstance(this, $ArrayBuffer); - return new BaseBuffer(toIndex(length)); - }; - var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; - for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) { - if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]); - } - if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer; - } - // iOS Safari 7.x bug - var view = new $DataView(new $ArrayBuffer(2)); - var $setInt8 = $DataView[PROTOTYPE].setInt8; - view.setInt8(0, 2147483648); - view.setInt8(1, 2147483649); - if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], { - setInt8: function setInt8(byteOffset, value) { - $setInt8.call(this, byteOffset, value << 24 >> 24); - }, - setUint8: function setUint8(byteOffset, value) { - $setInt8.call(this, byteOffset, value << 24 >> 24); - } - }, true); -} -setToStringTag($ArrayBuffer, ARRAY_BUFFER); -setToStringTag($DataView, DATA_VIEW); -hide($DataView[PROTOTYPE], $typed.VIEW, true); -exports[ARRAY_BUFFER] = $ArrayBuffer; -exports[DATA_VIEW] = $DataView; diff --git a/node_modules/core-js/library/modules/_typed.js b/node_modules/core-js/library/modules/_typed.js deleted file mode 100644 index 8747ffd71..000000000 --- a/node_modules/core-js/library/modules/_typed.js +++ /dev/null @@ -1,28 +0,0 @@ -var global = require('./_global'); -var hide = require('./_hide'); -var uid = require('./_uid'); -var TYPED = uid('typed_array'); -var VIEW = uid('view'); -var ABV = !!(global.ArrayBuffer && global.DataView); -var CONSTR = ABV; -var i = 0; -var l = 9; -var Typed; - -var TypedArrayConstructors = ( - 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' -).split(','); - -while (i < l) { - if (Typed = global[TypedArrayConstructors[i++]]) { - hide(Typed.prototype, TYPED, true); - hide(Typed.prototype, VIEW, true); - } else CONSTR = false; -} - -module.exports = { - ABV: ABV, - CONSTR: CONSTR, - TYPED: TYPED, - VIEW: VIEW -}; diff --git a/node_modules/core-js/library/modules/_uid.js b/node_modules/core-js/library/modules/_uid.js deleted file mode 100644 index ffbe7185f..000000000 --- a/node_modules/core-js/library/modules/_uid.js +++ /dev/null @@ -1,5 +0,0 @@ -var id = 0; -var px = Math.random(); -module.exports = function (key) { - return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); -}; diff --git a/node_modules/core-js/library/modules/_user-agent.js b/node_modules/core-js/library/modules/_user-agent.js deleted file mode 100644 index 363fedc25..000000000 --- a/node_modules/core-js/library/modules/_user-agent.js +++ /dev/null @@ -1,4 +0,0 @@ -var global = require('./_global'); -var navigator = global.navigator; - -module.exports = navigator && navigator.userAgent || ''; diff --git a/node_modules/core-js/library/modules/_validate-collection.js b/node_modules/core-js/library/modules/_validate-collection.js deleted file mode 100644 index cec1ceff7..000000000 --- a/node_modules/core-js/library/modules/_validate-collection.js +++ /dev/null @@ -1,5 +0,0 @@ -var isObject = require('./_is-object'); -module.exports = function (it, TYPE) { - if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); - return it; -}; diff --git a/node_modules/core-js/library/modules/_wks-define.js b/node_modules/core-js/library/modules/_wks-define.js deleted file mode 100644 index 7284d6ada..000000000 --- a/node_modules/core-js/library/modules/_wks-define.js +++ /dev/null @@ -1,9 +0,0 @@ -var global = require('./_global'); -var core = require('./_core'); -var LIBRARY = require('./_library'); -var wksExt = require('./_wks-ext'); -var defineProperty = require('./_object-dp').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) }); -}; diff --git a/node_modules/core-js/library/modules/_wks-ext.js b/node_modules/core-js/library/modules/_wks-ext.js deleted file mode 100644 index 13bd83b16..000000000 --- a/node_modules/core-js/library/modules/_wks-ext.js +++ /dev/null @@ -1 +0,0 @@ -exports.f = require('./_wks'); diff --git a/node_modules/core-js/library/modules/_wks.js b/node_modules/core-js/library/modules/_wks.js deleted file mode 100644 index e33f857a6..000000000 --- a/node_modules/core-js/library/modules/_wks.js +++ /dev/null @@ -1,11 +0,0 @@ -var store = require('./_shared')('wks'); -var uid = require('./_uid'); -var Symbol = require('./_global').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; diff --git a/node_modules/core-js/library/modules/core.delay.js b/node_modules/core-js/library/modules/core.delay.js deleted file mode 100644 index 73712c012..000000000 --- a/node_modules/core-js/library/modules/core.delay.js +++ /dev/null @@ -1,12 +0,0 @@ -var global = require('./_global'); -var core = require('./_core'); -var $export = require('./_export'); -var partial = require('./_partial'); -// https://esdiscuss.org/topic/promise-returning-delay-function -$export($export.G + $export.F, { - delay: function delay(time) { - return new (core.Promise || global.Promise)(function (resolve) { - setTimeout(partial.call(resolve, true), time); - }); - } -}); diff --git a/node_modules/core-js/library/modules/core.dict.js b/node_modules/core-js/library/modules/core.dict.js deleted file mode 100644 index 5422ad30d..000000000 --- a/node_modules/core-js/library/modules/core.dict.js +++ /dev/null @@ -1,157 +0,0 @@ -'use strict'; -var ctx = require('./_ctx'); -var $export = require('./_export'); -var createDesc = require('./_property-desc'); -var assign = require('./_object-assign'); -var create = require('./_object-create'); -var getPrototypeOf = require('./_object-gpo'); -var getKeys = require('./_object-keys'); -var dP = require('./_object-dp'); -var keyOf = require('./_keyof'); -var aFunction = require('./_a-function'); -var forOf = require('./_for-of'); -var isIterable = require('./core.is-iterable'); -var $iterCreate = require('./_iter-create'); -var step = require('./_iter-step'); -var isObject = require('./_is-object'); -var toIObject = require('./_to-iobject'); -var DESCRIPTORS = require('./_descriptors'); -var has = require('./_has'); - -// 0 -> Dict.forEach -// 1 -> Dict.map -// 2 -> Dict.filter -// 3 -> Dict.some -// 4 -> Dict.every -// 5 -> Dict.find -// 6 -> Dict.findKey -// 7 -> Dict.mapPairs -var createDictMethod = function (TYPE) { - var IS_MAP = TYPE == 1; - var IS_EVERY = TYPE == 4; - return function (object, callbackfn, that /* = undefined */) { - var f = ctx(callbackfn, that, 3); - var O = toIObject(object); - var result = IS_MAP || TYPE == 7 || TYPE == 2 - ? new (typeof this == 'function' ? this : Dict)() : undefined; - var key, val, res; - for (key in O) if (has(O, key)) { - val = O[key]; - res = f(val, key, object); - if (TYPE) { - if (IS_MAP) result[key] = res; // map - else if (res) switch (TYPE) { - case 2: result[key] = val; break; // filter - case 3: return true; // some - case 5: return val; // find - case 6: return key; // findKey - case 7: result[res[0]] = res[1]; // mapPairs - } else if (IS_EVERY) return false; // every - } - } - return TYPE == 3 || IS_EVERY ? IS_EVERY : result; - }; -}; -var findKey = createDictMethod(6); - -var createDictIter = function (kind) { - return function (it) { - return new DictIterator(it, kind); - }; -}; -var DictIterator = function (iterated, kind) { - this._t = toIObject(iterated); // target - this._a = getKeys(iterated); // keys - this._i = 0; // next index - this._k = kind; // kind -}; -$iterCreate(DictIterator, 'Dict', function () { - var that = this; - var O = that._t; - var keys = that._a; - var kind = that._k; - var key; - do { - if (that._i >= keys.length) { - that._t = undefined; - return step(1); - } - } while (!has(O, key = keys[that._i++])); - if (kind == 'keys') return step(0, key); - if (kind == 'values') return step(0, O[key]); - return step(0, [key, O[key]]); -}); - -function Dict(iterable) { - var dict = create(null); - if (iterable != undefined) { - if (isIterable(iterable)) { - forOf(iterable, true, function (key, value) { - dict[key] = value; - }); - } else assign(dict, iterable); - } - return dict; -} -Dict.prototype = null; - -function reduce(object, mapfn, init) { - aFunction(mapfn); - var O = toIObject(object); - var keys = getKeys(O); - var length = keys.length; - var i = 0; - var memo, key; - if (arguments.length < 3) { - if (!length) throw TypeError('Reduce of empty object with no initial value'); - memo = O[keys[i++]]; - } else memo = Object(init); - while (length > i) if (has(O, key = keys[i++])) { - memo = mapfn(memo, O[key], key, object); - } - return memo; -} - -function includes(object, el) { - // eslint-disable-next-line no-self-compare - return (el == el ? keyOf(object, el) : findKey(object, function (it) { - // eslint-disable-next-line no-self-compare - return it != it; - })) !== undefined; -} - -function get(object, key) { - if (has(object, key)) return object[key]; -} -function set(object, key, value) { - if (DESCRIPTORS && key in Object) dP.f(object, key, createDesc(0, value)); - else object[key] = value; - return object; -} - -function isDict(it) { - return isObject(it) && getPrototypeOf(it) === Dict.prototype; -} - -$export($export.G + $export.F, { Dict: Dict }); - -$export($export.S, 'Dict', { - keys: createDictIter('keys'), - values: createDictIter('values'), - entries: createDictIter('entries'), - forEach: createDictMethod(0), - map: createDictMethod(1), - filter: createDictMethod(2), - some: createDictMethod(3), - every: createDictMethod(4), - find: createDictMethod(5), - findKey: findKey, - mapPairs: createDictMethod(7), - reduce: reduce, - keyOf: keyOf, - includes: includes, - has: has, - get: get, - set: set, - isDict: isDict -}); diff --git a/node_modules/core-js/library/modules/core.function.part.js b/node_modules/core-js/library/modules/core.function.part.js deleted file mode 100644 index 050154f85..000000000 --- a/node_modules/core-js/library/modules/core.function.part.js +++ /dev/null @@ -1,7 +0,0 @@ -var path = require('./_path'); -var $export = require('./_export'); - -// Placeholder -require('./_core')._ = path._ = path._ || {}; - -$export($export.P + $export.F, 'Function', { part: require('./_partial') }); diff --git a/node_modules/core-js/library/modules/core.get-iterator-method.js b/node_modules/core-js/library/modules/core.get-iterator-method.js deleted file mode 100644 index 9b6fa62a5..000000000 --- a/node_modules/core-js/library/modules/core.get-iterator-method.js +++ /dev/null @@ -1,8 +0,0 @@ -var classof = require('./_classof'); -var ITERATOR = require('./_wks')('iterator'); -var Iterators = require('./_iterators'); -module.exports = require('./_core').getIteratorMethod = function (it) { - if (it != undefined) return it[ITERATOR] - || it['@@iterator'] - || Iterators[classof(it)]; -}; diff --git a/node_modules/core-js/library/modules/core.get-iterator.js b/node_modules/core-js/library/modules/core.get-iterator.js deleted file mode 100644 index 04568c86c..000000000 --- a/node_modules/core-js/library/modules/core.get-iterator.js +++ /dev/null @@ -1,7 +0,0 @@ -var anObject = require('./_an-object'); -var get = require('./core.get-iterator-method'); -module.exports = require('./_core').getIterator = function (it) { - var iterFn = get(it); - if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!'); - return anObject(iterFn.call(it)); -}; diff --git a/node_modules/core-js/library/modules/core.is-iterable.js b/node_modules/core-js/library/modules/core.is-iterable.js deleted file mode 100644 index 388e5e35b..000000000 --- a/node_modules/core-js/library/modules/core.is-iterable.js +++ /dev/null @@ -1,10 +0,0 @@ -var classof = require('./_classof'); -var ITERATOR = require('./_wks')('iterator'); -var Iterators = require('./_iterators'); -module.exports = require('./_core').isIterable = function (it) { - var O = Object(it); - return O[ITERATOR] !== undefined - || '@@iterator' in O - // eslint-disable-next-line no-prototype-builtins - || Iterators.hasOwnProperty(classof(O)); -}; diff --git a/node_modules/core-js/library/modules/core.number.iterator.js b/node_modules/core-js/library/modules/core.number.iterator.js deleted file mode 100644 index fa37791eb..000000000 --- a/node_modules/core-js/library/modules/core.number.iterator.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; -require('./_iter-define')(Number, 'Number', function (iterated) { - this._l = +iterated; - this._i = 0; -}, function () { - var i = this._i++; - var done = !(i < this._l); - return { done: done, value: done ? undefined : i }; -}); diff --git a/node_modules/core-js/library/modules/core.object.classof.js b/node_modules/core-js/library/modules/core.object.classof.js deleted file mode 100644 index fe16595a5..000000000 --- a/node_modules/core-js/library/modules/core.object.classof.js +++ /dev/null @@ -1,3 +0,0 @@ -var $export = require('./_export'); - -$export($export.S + $export.F, 'Object', { classof: require('./_classof') }); diff --git a/node_modules/core-js/library/modules/core.object.define.js b/node_modules/core-js/library/modules/core.object.define.js deleted file mode 100644 index e4e717b58..000000000 --- a/node_modules/core-js/library/modules/core.object.define.js +++ /dev/null @@ -1,4 +0,0 @@ -var $export = require('./_export'); -var define = require('./_object-define'); - -$export($export.S + $export.F, 'Object', { define: define }); diff --git a/node_modules/core-js/library/modules/core.object.is-object.js b/node_modules/core-js/library/modules/core.object.is-object.js deleted file mode 100644 index fea80b606..000000000 --- a/node_modules/core-js/library/modules/core.object.is-object.js +++ /dev/null @@ -1,3 +0,0 @@ -var $export = require('./_export'); - -$export($export.S + $export.F, 'Object', { isObject: require('./_is-object') }); diff --git a/node_modules/core-js/library/modules/core.object.make.js b/node_modules/core-js/library/modules/core.object.make.js deleted file mode 100644 index 51d47740a..000000000 --- a/node_modules/core-js/library/modules/core.object.make.js +++ /dev/null @@ -1,9 +0,0 @@ -var $export = require('./_export'); -var define = require('./_object-define'); -var create = require('./_object-create'); - -$export($export.S + $export.F, 'Object', { - make: function (proto, mixin) { - return define(create(proto), mixin); - } -}); diff --git a/node_modules/core-js/library/modules/core.regexp.escape.js b/node_modules/core-js/library/modules/core.regexp.escape.js deleted file mode 100644 index 3ddd748c0..000000000 --- a/node_modules/core-js/library/modules/core.regexp.escape.js +++ /dev/null @@ -1,5 +0,0 @@ -// https://github.com/benjamingr/RexExp.escape -var $export = require('./_export'); -var $re = require('./_replacer')(/[\\^$*+?.()|[\]{}]/g, '\\$&'); - -$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } }); diff --git a/node_modules/core-js/library/modules/core.string.escape-html.js b/node_modules/core-js/library/modules/core.string.escape-html.js deleted file mode 100644 index f96788614..000000000 --- a/node_modules/core-js/library/modules/core.string.escape-html.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $re = require('./_replacer')(/[&<>"']/g, { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' -}); - -$export($export.P + $export.F, 'String', { escapeHTML: function escapeHTML() { return $re(this); } }); diff --git a/node_modules/core-js/library/modules/core.string.unescape-html.js b/node_modules/core-js/library/modules/core.string.unescape-html.js deleted file mode 100644 index eb8a6cfbf..000000000 --- a/node_modules/core-js/library/modules/core.string.unescape-html.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $re = require('./_replacer')(/&(?:amp|lt|gt|quot|apos);/g, { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'" -}); - -$export($export.P + $export.F, 'String', { unescapeHTML: function unescapeHTML() { return $re(this); } }); diff --git a/node_modules/core-js/library/modules/es5.js b/node_modules/core-js/library/modules/es5.js deleted file mode 100644 index ca10612d1..000000000 --- a/node_modules/core-js/library/modules/es5.js +++ /dev/null @@ -1,35 +0,0 @@ -// This file still here for a legacy code and will be removed in a near time -require('./es6.object.create'); -require('./es6.object.define-property'); -require('./es6.object.define-properties'); -require('./es6.object.get-own-property-descriptor'); -require('./es6.object.get-prototype-of'); -require('./es6.object.keys'); -require('./es6.object.get-own-property-names'); -require('./es6.object.freeze'); -require('./es6.object.seal'); -require('./es6.object.prevent-extensions'); -require('./es6.object.is-frozen'); -require('./es6.object.is-sealed'); -require('./es6.object.is-extensible'); -require('./es6.function.bind'); -require('./es6.array.is-array'); -require('./es6.array.join'); -require('./es6.array.slice'); -require('./es6.array.sort'); -require('./es6.array.for-each'); -require('./es6.array.map'); -require('./es6.array.filter'); -require('./es6.array.some'); -require('./es6.array.every'); -require('./es6.array.reduce'); -require('./es6.array.reduce-right'); -require('./es6.array.index-of'); -require('./es6.array.last-index-of'); -require('./es6.date.now'); -require('./es6.date.to-iso-string'); -require('./es6.date.to-json'); -require('./es6.parse-int'); -require('./es6.parse-float'); -require('./es6.string.trim'); -require('./es6.regexp.to-string'); diff --git a/node_modules/core-js/library/modules/es6.array.copy-within.js b/node_modules/core-js/library/modules/es6.array.copy-within.js deleted file mode 100644 index f866a9591..000000000 --- a/node_modules/core-js/library/modules/es6.array.copy-within.js +++ /dev/null @@ -1,6 +0,0 @@ -// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) -var $export = require('./_export'); - -$export($export.P, 'Array', { copyWithin: require('./_array-copy-within') }); - -require('./_add-to-unscopables')('copyWithin'); diff --git a/node_modules/core-js/library/modules/es6.array.every.js b/node_modules/core-js/library/modules/es6.array.every.js deleted file mode 100644 index cfd448f5c..000000000 --- a/node_modules/core-js/library/modules/es6.array.every.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $every = require('./_array-methods')(4); - -$export($export.P + $export.F * !require('./_strict-method')([].every, true), 'Array', { - // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) - every: function every(callbackfn /* , thisArg */) { - return $every(this, callbackfn, arguments[1]); - } -}); diff --git a/node_modules/core-js/library/modules/es6.array.fill.js b/node_modules/core-js/library/modules/es6.array.fill.js deleted file mode 100644 index ac1714424..000000000 --- a/node_modules/core-js/library/modules/es6.array.fill.js +++ /dev/null @@ -1,6 +0,0 @@ -// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) -var $export = require('./_export'); - -$export($export.P, 'Array', { fill: require('./_array-fill') }); - -require('./_add-to-unscopables')('fill'); diff --git a/node_modules/core-js/library/modules/es6.array.filter.js b/node_modules/core-js/library/modules/es6.array.filter.js deleted file mode 100644 index 447ecf403..000000000 --- a/node_modules/core-js/library/modules/es6.array.filter.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $filter = require('./_array-methods')(2); - -$export($export.P + $export.F * !require('./_strict-method')([].filter, true), 'Array', { - // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) - filter: function filter(callbackfn /* , thisArg */) { - return $filter(this, callbackfn, arguments[1]); - } -}); diff --git a/node_modules/core-js/library/modules/es6.array.find-index.js b/node_modules/core-js/library/modules/es6.array.find-index.js deleted file mode 100644 index 374cadd77..000000000 --- a/node_modules/core-js/library/modules/es6.array.find-index.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; -// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) -var $export = require('./_export'); -var $find = require('./_array-methods')(6); -var KEY = 'findIndex'; -var forced = true; -// Shouldn't skip holes -if (KEY in []) Array(1)[KEY](function () { forced = false; }); -$export($export.P + $export.F * forced, 'Array', { - findIndex: function findIndex(callbackfn /* , that = undefined */) { - return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } -}); -require('./_add-to-unscopables')(KEY); diff --git a/node_modules/core-js/library/modules/es6.array.find.js b/node_modules/core-js/library/modules/es6.array.find.js deleted file mode 100644 index 4fbe76ce0..000000000 --- a/node_modules/core-js/library/modules/es6.array.find.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; -// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) -var $export = require('./_export'); -var $find = require('./_array-methods')(5); -var KEY = 'find'; -var forced = true; -// Shouldn't skip holes -if (KEY in []) Array(1)[KEY](function () { forced = false; }); -$export($export.P + $export.F * forced, 'Array', { - find: function find(callbackfn /* , that = undefined */) { - return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } -}); -require('./_add-to-unscopables')(KEY); diff --git a/node_modules/core-js/library/modules/es6.array.for-each.js b/node_modules/core-js/library/modules/es6.array.for-each.js deleted file mode 100644 index 525ba0740..000000000 --- a/node_modules/core-js/library/modules/es6.array.for-each.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $forEach = require('./_array-methods')(0); -var STRICT = require('./_strict-method')([].forEach, true); - -$export($export.P + $export.F * !STRICT, 'Array', { - // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) - forEach: function forEach(callbackfn /* , thisArg */) { - return $forEach(this, callbackfn, arguments[1]); - } -}); diff --git a/node_modules/core-js/library/modules/es6.array.from.js b/node_modules/core-js/library/modules/es6.array.from.js deleted file mode 100644 index 4db38017f..000000000 --- a/node_modules/core-js/library/modules/es6.array.from.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; -var ctx = require('./_ctx'); -var $export = require('./_export'); -var toObject = require('./_to-object'); -var call = require('./_iter-call'); -var isArrayIter = require('./_is-array-iter'); -var toLength = require('./_to-length'); -var createProperty = require('./_create-property'); -var getIterFn = require('./core.get-iterator-method'); - -$export($export.S + $export.F * !require('./_iter-detect')(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; - } -}); diff --git a/node_modules/core-js/library/modules/es6.array.index-of.js b/node_modules/core-js/library/modules/es6.array.index-of.js deleted file mode 100644 index 231c92e9c..000000000 --- a/node_modules/core-js/library/modules/es6.array.index-of.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $indexOf = require('./_array-includes')(false); -var $native = [].indexOf; -var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; - -$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', { - // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) - indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { - return NEGATIVE_ZERO - // convert -0 to +0 - ? $native.apply(this, arguments) || 0 - : $indexOf(this, searchElement, arguments[1]); - } -}); diff --git a/node_modules/core-js/library/modules/es6.array.is-array.js b/node_modules/core-js/library/modules/es6.array.is-array.js deleted file mode 100644 index 27ca6fc5b..000000000 --- a/node_modules/core-js/library/modules/es6.array.is-array.js +++ /dev/null @@ -1,4 +0,0 @@ -// 22.1.2.2 / 15.4.3.2 Array.isArray(arg) -var $export = require('./_export'); - -$export($export.S, 'Array', { isArray: require('./_is-array') }); diff --git a/node_modules/core-js/library/modules/es6.array.iterator.js b/node_modules/core-js/library/modules/es6.array.iterator.js deleted file mode 100644 index c64e88b1b..000000000 --- a/node_modules/core-js/library/modules/es6.array.iterator.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; -var addToUnscopables = require('./_add-to-unscopables'); -var step = require('./_iter-step'); -var Iterators = require('./_iterators'); -var toIObject = require('./_to-iobject'); - -// 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 = require('./_iter-define')(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'); diff --git a/node_modules/core-js/library/modules/es6.array.join.js b/node_modules/core-js/library/modules/es6.array.join.js deleted file mode 100644 index 48e55d2e3..000000000 --- a/node_modules/core-js/library/modules/es6.array.join.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; -// 22.1.3.13 Array.prototype.join(separator) -var $export = require('./_export'); -var toIObject = require('./_to-iobject'); -var arrayJoin = [].join; - -// fallback for not array-like strings -$export($export.P + $export.F * (require('./_iobject') != Object || !require('./_strict-method')(arrayJoin)), 'Array', { - join: function join(separator) { - return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); - } -}); diff --git a/node_modules/core-js/library/modules/es6.array.last-index-of.js b/node_modules/core-js/library/modules/es6.array.last-index-of.js deleted file mode 100644 index 1f70e340d..000000000 --- a/node_modules/core-js/library/modules/es6.array.last-index-of.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var toIObject = require('./_to-iobject'); -var toInteger = require('./_to-integer'); -var toLength = require('./_to-length'); -var $native = [].lastIndexOf; -var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; - -$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', { - // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) - lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { - // convert -0 to +0 - if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0; - var O = toIObject(this); - var length = toLength(O.length); - var index = length - 1; - if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1])); - if (index < 0) index = length + index; - for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0; - return -1; - } -}); diff --git a/node_modules/core-js/library/modules/es6.array.map.js b/node_modules/core-js/library/modules/es6.array.map.js deleted file mode 100644 index 1326033f1..000000000 --- a/node_modules/core-js/library/modules/es6.array.map.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $map = require('./_array-methods')(1); - -$export($export.P + $export.F * !require('./_strict-method')([].map, true), 'Array', { - // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) - map: function map(callbackfn /* , thisArg */) { - return $map(this, callbackfn, arguments[1]); - } -}); diff --git a/node_modules/core-js/library/modules/es6.array.of.js b/node_modules/core-js/library/modules/es6.array.of.js deleted file mode 100644 index b83e058c1..000000000 --- a/node_modules/core-js/library/modules/es6.array.of.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var createProperty = require('./_create-property'); - -// WebKit Array.of isn't generic -$export($export.S + $export.F * require('./_fails')(function () { - function F() { /* empty */ } - return !(Array.of.call(F) instanceof F); -}), 'Array', { - // 22.1.2.3 Array.of( ...items) - of: function of(/* ...args */) { - var index = 0; - var aLen = arguments.length; - var result = new (typeof this == 'function' ? this : Array)(aLen); - while (aLen > index) createProperty(result, index, arguments[index++]); - result.length = aLen; - return result; - } -}); diff --git a/node_modules/core-js/library/modules/es6.array.reduce-right.js b/node_modules/core-js/library/modules/es6.array.reduce-right.js deleted file mode 100644 index 168e421d8..000000000 --- a/node_modules/core-js/library/modules/es6.array.reduce-right.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $reduce = require('./_array-reduce'); - -$export($export.P + $export.F * !require('./_strict-method')([].reduceRight, true), 'Array', { - // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) - reduceRight: function reduceRight(callbackfn /* , initialValue */) { - return $reduce(this, callbackfn, arguments.length, arguments[1], true); - } -}); diff --git a/node_modules/core-js/library/modules/es6.array.reduce.js b/node_modules/core-js/library/modules/es6.array.reduce.js deleted file mode 100644 index f4e476121..000000000 --- a/node_modules/core-js/library/modules/es6.array.reduce.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $reduce = require('./_array-reduce'); - -$export($export.P + $export.F * !require('./_strict-method')([].reduce, true), 'Array', { - // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) - reduce: function reduce(callbackfn /* , initialValue */) { - return $reduce(this, callbackfn, arguments.length, arguments[1], false); - } -}); diff --git a/node_modules/core-js/library/modules/es6.array.slice.js b/node_modules/core-js/library/modules/es6.array.slice.js deleted file mode 100644 index bdd496ecb..000000000 --- a/node_modules/core-js/library/modules/es6.array.slice.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var html = require('./_html'); -var cof = require('./_cof'); -var toAbsoluteIndex = require('./_to-absolute-index'); -var toLength = require('./_to-length'); -var arraySlice = [].slice; - -// fallback for not array-like ES3 strings and DOM objects -$export($export.P + $export.F * require('./_fails')(function () { - if (html) arraySlice.call(html); -}), 'Array', { - slice: function slice(begin, end) { - var len = toLength(this.length); - var klass = cof(this); - end = end === undefined ? len : end; - if (klass == 'Array') return arraySlice.call(this, begin, end); - var start = toAbsoluteIndex(begin, len); - var upTo = toAbsoluteIndex(end, len); - var size = toLength(upTo - start); - var cloned = new Array(size); - var i = 0; - for (; i < size; i++) cloned[i] = klass == 'String' - ? this.charAt(start + i) - : this[start + i]; - return cloned; - } -}); diff --git a/node_modules/core-js/library/modules/es6.array.some.js b/node_modules/core-js/library/modules/es6.array.some.js deleted file mode 100644 index 14c5eec26..000000000 --- a/node_modules/core-js/library/modules/es6.array.some.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $some = require('./_array-methods')(3); - -$export($export.P + $export.F * !require('./_strict-method')([].some, true), 'Array', { - // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) - some: function some(callbackfn /* , thisArg */) { - return $some(this, callbackfn, arguments[1]); - } -}); diff --git a/node_modules/core-js/library/modules/es6.array.sort.js b/node_modules/core-js/library/modules/es6.array.sort.js deleted file mode 100644 index 39817ffae..000000000 --- a/node_modules/core-js/library/modules/es6.array.sort.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var aFunction = require('./_a-function'); -var toObject = require('./_to-object'); -var fails = require('./_fails'); -var $sort = [].sort; -var test = [1, 2, 3]; - -$export($export.P + $export.F * (fails(function () { - // IE8- - test.sort(undefined); -}) || !fails(function () { - // V8 bug - test.sort(null); - // Old WebKit -}) || !require('./_strict-method')($sort)), 'Array', { - // 22.1.3.25 Array.prototype.sort(comparefn) - sort: function sort(comparefn) { - return comparefn === undefined - ? $sort.call(toObject(this)) - : $sort.call(toObject(this), aFunction(comparefn)); - } -}); diff --git a/node_modules/core-js/library/modules/es6.array.species.js b/node_modules/core-js/library/modules/es6.array.species.js deleted file mode 100644 index ce0b8917f..000000000 --- a/node_modules/core-js/library/modules/es6.array.species.js +++ /dev/null @@ -1 +0,0 @@ -require('./_set-species')('Array'); diff --git a/node_modules/core-js/library/modules/es6.date.now.js b/node_modules/core-js/library/modules/es6.date.now.js deleted file mode 100644 index 65f134e56..000000000 --- a/node_modules/core-js/library/modules/es6.date.now.js +++ /dev/null @@ -1,4 +0,0 @@ -// 20.3.3.1 / 15.9.4.4 Date.now() -var $export = require('./_export'); - -$export($export.S, 'Date', { now: function () { return new Date().getTime(); } }); diff --git a/node_modules/core-js/library/modules/es6.date.to-iso-string.js b/node_modules/core-js/library/modules/es6.date.to-iso-string.js deleted file mode 100644 index 13b27818c..000000000 --- a/node_modules/core-js/library/modules/es6.date.to-iso-string.js +++ /dev/null @@ -1,8 +0,0 @@ -// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() -var $export = require('./_export'); -var toISOString = require('./_date-to-iso-string'); - -// PhantomJS / old WebKit has a broken implementations -$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', { - toISOString: toISOString -}); diff --git a/node_modules/core-js/library/modules/es6.date.to-json.js b/node_modules/core-js/library/modules/es6.date.to-json.js deleted file mode 100644 index 69b1f3018..000000000 --- a/node_modules/core-js/library/modules/es6.date.to-json.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var toObject = require('./_to-object'); -var toPrimitive = require('./_to-primitive'); -var toISOString = require('./_date-to-iso-string'); -var classof = require('./_classof'); - -$export($export.P + $export.F * require('./_fails')(function () { - return new Date(NaN).toJSON() !== null - || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; -}), 'Date', { - // eslint-disable-next-line no-unused-vars - toJSON: function toJSON(key) { - var O = toObject(this); - var pv = toPrimitive(O); - return typeof pv == 'number' && !isFinite(pv) ? null : - (!('toISOString' in O) && classof(O) == 'Date') ? toISOString.call(O) : O.toISOString(); - } -}); diff --git a/node_modules/core-js/library/modules/es6.date.to-primitive.js b/node_modules/core-js/library/modules/es6.date.to-primitive.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/core-js/library/modules/es6.date.to-string.js b/node_modules/core-js/library/modules/es6.date.to-string.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/core-js/library/modules/es6.function.bind.js b/node_modules/core-js/library/modules/es6.function.bind.js deleted file mode 100644 index 38e84e1ac..000000000 --- a/node_modules/core-js/library/modules/es6.function.bind.js +++ /dev/null @@ -1,4 +0,0 @@ -// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) -var $export = require('./_export'); - -$export($export.P, 'Function', { bind: require('./_bind') }); diff --git a/node_modules/core-js/library/modules/es6.function.has-instance.js b/node_modules/core-js/library/modules/es6.function.has-instance.js deleted file mode 100644 index 7556ed9bd..000000000 --- a/node_modules/core-js/library/modules/es6.function.has-instance.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; -var isObject = require('./_is-object'); -var getPrototypeOf = require('./_object-gpo'); -var HAS_INSTANCE = require('./_wks')('hasInstance'); -var FunctionProto = Function.prototype; -// 19.2.3.6 Function.prototype[@@hasInstance](V) -if (!(HAS_INSTANCE in FunctionProto)) require('./_object-dp').f(FunctionProto, HAS_INSTANCE, { value: function (O) { - if (typeof this != 'function' || !isObject(O)) return false; - if (!isObject(this.prototype)) return O instanceof this; - // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: - while (O = getPrototypeOf(O)) if (this.prototype === O) return true; - return false; -} }); diff --git a/node_modules/core-js/library/modules/es6.function.name.js b/node_modules/core-js/library/modules/es6.function.name.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/core-js/library/modules/es6.map.js b/node_modules/core-js/library/modules/es6.map.js deleted file mode 100644 index a282f0222..000000000 --- a/node_modules/core-js/library/modules/es6.map.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; -var strong = require('./_collection-strong'); -var validate = require('./_validate-collection'); -var MAP = 'Map'; - -// 23.1 Map Objects -module.exports = require('./_collection')(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); diff --git a/node_modules/core-js/library/modules/es6.math.acosh.js b/node_modules/core-js/library/modules/es6.math.acosh.js deleted file mode 100644 index 8a8989ebb..000000000 --- a/node_modules/core-js/library/modules/es6.math.acosh.js +++ /dev/null @@ -1,18 +0,0 @@ -// 20.2.2.3 Math.acosh(x) -var $export = require('./_export'); -var log1p = require('./_math-log1p'); -var sqrt = Math.sqrt; -var $acosh = Math.acosh; - -$export($export.S + $export.F * !($acosh - // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 - && Math.floor($acosh(Number.MAX_VALUE)) == 710 - // Tor Browser bug: Math.acosh(Infinity) -> NaN - && $acosh(Infinity) == Infinity -), 'Math', { - acosh: function acosh(x) { - return (x = +x) < 1 ? NaN : x > 94906265.62425156 - ? Math.log(x) + Math.LN2 - : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); - } -}); diff --git a/node_modules/core-js/library/modules/es6.math.asinh.js b/node_modules/core-js/library/modules/es6.math.asinh.js deleted file mode 100644 index ddf466628..000000000 --- a/node_modules/core-js/library/modules/es6.math.asinh.js +++ /dev/null @@ -1,10 +0,0 @@ -// 20.2.2.5 Math.asinh(x) -var $export = require('./_export'); -var $asinh = Math.asinh; - -function asinh(x) { - return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); -} - -// Tor Browser bug: Math.asinh(0) -> -0 -$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh }); diff --git a/node_modules/core-js/library/modules/es6.math.atanh.js b/node_modules/core-js/library/modules/es6.math.atanh.js deleted file mode 100644 index af3c3e809..000000000 --- a/node_modules/core-js/library/modules/es6.math.atanh.js +++ /dev/null @@ -1,10 +0,0 @@ -// 20.2.2.7 Math.atanh(x) -var $export = require('./_export'); -var $atanh = Math.atanh; - -// Tor Browser bug: Math.atanh(-0) -> 0 -$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { - atanh: function atanh(x) { - return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; - } -}); diff --git a/node_modules/core-js/library/modules/es6.math.cbrt.js b/node_modules/core-js/library/modules/es6.math.cbrt.js deleted file mode 100644 index e45ac4445..000000000 --- a/node_modules/core-js/library/modules/es6.math.cbrt.js +++ /dev/null @@ -1,9 +0,0 @@ -// 20.2.2.9 Math.cbrt(x) -var $export = require('./_export'); -var sign = require('./_math-sign'); - -$export($export.S, 'Math', { - cbrt: function cbrt(x) { - return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); - } -}); diff --git a/node_modules/core-js/library/modules/es6.math.clz32.js b/node_modules/core-js/library/modules/es6.math.clz32.js deleted file mode 100644 index 1e4d7e19c..000000000 --- a/node_modules/core-js/library/modules/es6.math.clz32.js +++ /dev/null @@ -1,8 +0,0 @@ -// 20.2.2.11 Math.clz32(x) -var $export = require('./_export'); - -$export($export.S, 'Math', { - clz32: function clz32(x) { - return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; - } -}); diff --git a/node_modules/core-js/library/modules/es6.math.cosh.js b/node_modules/core-js/library/modules/es6.math.cosh.js deleted file mode 100644 index 1e0cffc1a..000000000 --- a/node_modules/core-js/library/modules/es6.math.cosh.js +++ /dev/null @@ -1,9 +0,0 @@ -// 20.2.2.12 Math.cosh(x) -var $export = require('./_export'); -var exp = Math.exp; - -$export($export.S, 'Math', { - cosh: function cosh(x) { - return (exp(x = +x) + exp(-x)) / 2; - } -}); diff --git a/node_modules/core-js/library/modules/es6.math.expm1.js b/node_modules/core-js/library/modules/es6.math.expm1.js deleted file mode 100644 index da4c90df8..000000000 --- a/node_modules/core-js/library/modules/es6.math.expm1.js +++ /dev/null @@ -1,5 +0,0 @@ -// 20.2.2.14 Math.expm1(x) -var $export = require('./_export'); -var $expm1 = require('./_math-expm1'); - -$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 }); diff --git a/node_modules/core-js/library/modules/es6.math.fround.js b/node_modules/core-js/library/modules/es6.math.fround.js deleted file mode 100644 index 9c262f2ec..000000000 --- a/node_modules/core-js/library/modules/es6.math.fround.js +++ /dev/null @@ -1,4 +0,0 @@ -// 20.2.2.16 Math.fround(x) -var $export = require('./_export'); - -$export($export.S, 'Math', { fround: require('./_math-fround') }); diff --git a/node_modules/core-js/library/modules/es6.math.hypot.js b/node_modules/core-js/library/modules/es6.math.hypot.js deleted file mode 100644 index 41ffdb27a..000000000 --- a/node_modules/core-js/library/modules/es6.math.hypot.js +++ /dev/null @@ -1,25 +0,0 @@ -// 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) -var $export = require('./_export'); -var abs = Math.abs; - -$export($export.S, 'Math', { - hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars - var sum = 0; - var i = 0; - var aLen = arguments.length; - var larg = 0; - var arg, div; - while (i < aLen) { - arg = abs(arguments[i++]); - if (larg < arg) { - div = larg / arg; - sum = sum * div * div + 1; - larg = arg; - } else if (arg > 0) { - div = arg / larg; - sum += div * div; - } else sum += arg; - } - return larg === Infinity ? Infinity : larg * Math.sqrt(sum); - } -}); diff --git a/node_modules/core-js/library/modules/es6.math.imul.js b/node_modules/core-js/library/modules/es6.math.imul.js deleted file mode 100644 index 96e683d25..000000000 --- a/node_modules/core-js/library/modules/es6.math.imul.js +++ /dev/null @@ -1,17 +0,0 @@ -// 20.2.2.18 Math.imul(x, y) -var $export = require('./_export'); -var $imul = Math.imul; - -// some WebKit versions fails with big numbers, some has wrong arity -$export($export.S + $export.F * require('./_fails')(function () { - return $imul(0xffffffff, 5) != -5 || $imul.length != 2; -}), 'Math', { - imul: function imul(x, y) { - var UINT16 = 0xffff; - var xn = +x; - var yn = +y; - var xl = UINT16 & xn; - var yl = UINT16 & yn; - return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); - } -}); diff --git a/node_modules/core-js/library/modules/es6.math.log10.js b/node_modules/core-js/library/modules/es6.math.log10.js deleted file mode 100644 index 9ee8ae68f..000000000 --- a/node_modules/core-js/library/modules/es6.math.log10.js +++ /dev/null @@ -1,8 +0,0 @@ -// 20.2.2.21 Math.log10(x) -var $export = require('./_export'); - -$export($export.S, 'Math', { - log10: function log10(x) { - return Math.log(x) * Math.LOG10E; - } -}); diff --git a/node_modules/core-js/library/modules/es6.math.log1p.js b/node_modules/core-js/library/modules/es6.math.log1p.js deleted file mode 100644 index 62959800a..000000000 --- a/node_modules/core-js/library/modules/es6.math.log1p.js +++ /dev/null @@ -1,4 +0,0 @@ -// 20.2.2.20 Math.log1p(x) -var $export = require('./_export'); - -$export($export.S, 'Math', { log1p: require('./_math-log1p') }); diff --git a/node_modules/core-js/library/modules/es6.math.log2.js b/node_modules/core-js/library/modules/es6.math.log2.js deleted file mode 100644 index 03d127cba..000000000 --- a/node_modules/core-js/library/modules/es6.math.log2.js +++ /dev/null @@ -1,8 +0,0 @@ -// 20.2.2.22 Math.log2(x) -var $export = require('./_export'); - -$export($export.S, 'Math', { - log2: function log2(x) { - return Math.log(x) / Math.LN2; - } -}); diff --git a/node_modules/core-js/library/modules/es6.math.sign.js b/node_modules/core-js/library/modules/es6.math.sign.js deleted file mode 100644 index 981f69e56..000000000 --- a/node_modules/core-js/library/modules/es6.math.sign.js +++ /dev/null @@ -1,4 +0,0 @@ -// 20.2.2.28 Math.sign(x) -var $export = require('./_export'); - -$export($export.S, 'Math', { sign: require('./_math-sign') }); diff --git a/node_modules/core-js/library/modules/es6.math.sinh.js b/node_modules/core-js/library/modules/es6.math.sinh.js deleted file mode 100644 index 57606333c..000000000 --- a/node_modules/core-js/library/modules/es6.math.sinh.js +++ /dev/null @@ -1,15 +0,0 @@ -// 20.2.2.30 Math.sinh(x) -var $export = require('./_export'); -var expm1 = require('./_math-expm1'); -var exp = Math.exp; - -// V8 near Chromium 38 has a problem with very small numbers -$export($export.S + $export.F * require('./_fails')(function () { - return !Math.sinh(-2e-17) != -2e-17; -}), 'Math', { - sinh: function sinh(x) { - return Math.abs(x = +x) < 1 - ? (expm1(x) - expm1(-x)) / 2 - : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); - } -}); diff --git a/node_modules/core-js/library/modules/es6.math.tanh.js b/node_modules/core-js/library/modules/es6.math.tanh.js deleted file mode 100644 index 0d3135b0f..000000000 --- a/node_modules/core-js/library/modules/es6.math.tanh.js +++ /dev/null @@ -1,12 +0,0 @@ -// 20.2.2.33 Math.tanh(x) -var $export = require('./_export'); -var expm1 = require('./_math-expm1'); -var exp = Math.exp; - -$export($export.S, 'Math', { - tanh: function tanh(x) { - var a = expm1(x = +x); - var b = expm1(-x); - return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); - } -}); diff --git a/node_modules/core-js/library/modules/es6.math.trunc.js b/node_modules/core-js/library/modules/es6.math.trunc.js deleted file mode 100644 index 35ddb8086..000000000 --- a/node_modules/core-js/library/modules/es6.math.trunc.js +++ /dev/null @@ -1,8 +0,0 @@ -// 20.2.2.34 Math.trunc(x) -var $export = require('./_export'); - -$export($export.S, 'Math', { - trunc: function trunc(it) { - return (it > 0 ? Math.floor : Math.ceil)(it); - } -}); diff --git a/node_modules/core-js/library/modules/es6.number.constructor.js b/node_modules/core-js/library/modules/es6.number.constructor.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/core-js/library/modules/es6.number.epsilon.js b/node_modules/core-js/library/modules/es6.number.epsilon.js deleted file mode 100644 index 34a2ec5fa..000000000 --- a/node_modules/core-js/library/modules/es6.number.epsilon.js +++ /dev/null @@ -1,4 +0,0 @@ -// 20.1.2.1 Number.EPSILON -var $export = require('./_export'); - -$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) }); diff --git a/node_modules/core-js/library/modules/es6.number.is-finite.js b/node_modules/core-js/library/modules/es6.number.is-finite.js deleted file mode 100644 index 8719da971..000000000 --- a/node_modules/core-js/library/modules/es6.number.is-finite.js +++ /dev/null @@ -1,9 +0,0 @@ -// 20.1.2.2 Number.isFinite(number) -var $export = require('./_export'); -var _isFinite = require('./_global').isFinite; - -$export($export.S, 'Number', { - isFinite: function isFinite(it) { - return typeof it == 'number' && _isFinite(it); - } -}); diff --git a/node_modules/core-js/library/modules/es6.number.is-integer.js b/node_modules/core-js/library/modules/es6.number.is-integer.js deleted file mode 100644 index f1ab5dc4c..000000000 --- a/node_modules/core-js/library/modules/es6.number.is-integer.js +++ /dev/null @@ -1,4 +0,0 @@ -// 20.1.2.3 Number.isInteger(number) -var $export = require('./_export'); - -$export($export.S, 'Number', { isInteger: require('./_is-integer') }); diff --git a/node_modules/core-js/library/modules/es6.number.is-nan.js b/node_modules/core-js/library/modules/es6.number.is-nan.js deleted file mode 100644 index 01d76ba28..000000000 --- a/node_modules/core-js/library/modules/es6.number.is-nan.js +++ /dev/null @@ -1,9 +0,0 @@ -// 20.1.2.4 Number.isNaN(number) -var $export = require('./_export'); - -$export($export.S, 'Number', { - isNaN: function isNaN(number) { - // eslint-disable-next-line no-self-compare - return number != number; - } -}); diff --git a/node_modules/core-js/library/modules/es6.number.is-safe-integer.js b/node_modules/core-js/library/modules/es6.number.is-safe-integer.js deleted file mode 100644 index 004e7d16f..000000000 --- a/node_modules/core-js/library/modules/es6.number.is-safe-integer.js +++ /dev/null @@ -1,10 +0,0 @@ -// 20.1.2.5 Number.isSafeInteger(number) -var $export = require('./_export'); -var isInteger = require('./_is-integer'); -var abs = Math.abs; - -$export($export.S, 'Number', { - isSafeInteger: function isSafeInteger(number) { - return isInteger(number) && abs(number) <= 0x1fffffffffffff; - } -}); diff --git a/node_modules/core-js/library/modules/es6.number.max-safe-integer.js b/node_modules/core-js/library/modules/es6.number.max-safe-integer.js deleted file mode 100644 index a4f248f1b..000000000 --- a/node_modules/core-js/library/modules/es6.number.max-safe-integer.js +++ /dev/null @@ -1,4 +0,0 @@ -// 20.1.2.6 Number.MAX_SAFE_INTEGER -var $export = require('./_export'); - -$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); diff --git a/node_modules/core-js/library/modules/es6.number.min-safe-integer.js b/node_modules/core-js/library/modules/es6.number.min-safe-integer.js deleted file mode 100644 index 34df374bc..000000000 --- a/node_modules/core-js/library/modules/es6.number.min-safe-integer.js +++ /dev/null @@ -1,4 +0,0 @@ -// 20.1.2.10 Number.MIN_SAFE_INTEGER -var $export = require('./_export'); - -$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff }); diff --git a/node_modules/core-js/library/modules/es6.number.parse-float.js b/node_modules/core-js/library/modules/es6.number.parse-float.js deleted file mode 100644 index 317c43109..000000000 --- a/node_modules/core-js/library/modules/es6.number.parse-float.js +++ /dev/null @@ -1,4 +0,0 @@ -var $export = require('./_export'); -var $parseFloat = require('./_parse-float'); -// 20.1.2.12 Number.parseFloat(string) -$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat }); diff --git a/node_modules/core-js/library/modules/es6.number.parse-int.js b/node_modules/core-js/library/modules/es6.number.parse-int.js deleted file mode 100644 index cb48da28d..000000000 --- a/node_modules/core-js/library/modules/es6.number.parse-int.js +++ /dev/null @@ -1,4 +0,0 @@ -var $export = require('./_export'); -var $parseInt = require('./_parse-int'); -// 20.1.2.13 Number.parseInt(string, radix) -$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt }); diff --git a/node_modules/core-js/library/modules/es6.number.to-fixed.js b/node_modules/core-js/library/modules/es6.number.to-fixed.js deleted file mode 100644 index 2bf78af91..000000000 --- a/node_modules/core-js/library/modules/es6.number.to-fixed.js +++ /dev/null @@ -1,114 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var toInteger = require('./_to-integer'); -var aNumberValue = require('./_a-number-value'); -var repeat = require('./_string-repeat'); -var $toFixed = 1.0.toFixed; -var floor = Math.floor; -var data = [0, 0, 0, 0, 0, 0]; -var ERROR = 'Number.toFixed: incorrect invocation!'; -var ZERO = '0'; - -var multiply = function (n, c) { - var i = -1; - var c2 = c; - while (++i < 6) { - c2 += n * data[i]; - data[i] = c2 % 1e7; - c2 = floor(c2 / 1e7); - } -}; -var divide = function (n) { - var i = 6; - var c = 0; - while (--i >= 0) { - c += data[i]; - data[i] = floor(c / n); - c = (c % n) * 1e7; - } -}; -var numToString = function () { - var i = 6; - var s = ''; - while (--i >= 0) { - if (s !== '' || i === 0 || data[i] !== 0) { - var t = String(data[i]); - s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; - } - } return s; -}; -var pow = function (x, n, acc) { - return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); -}; -var log = function (x) { - var n = 0; - var x2 = x; - while (x2 >= 4096) { - n += 12; - x2 /= 4096; - } - while (x2 >= 2) { - n += 1; - x2 /= 2; - } return n; -}; - -$export($export.P + $export.F * (!!$toFixed && ( - 0.00008.toFixed(3) !== '0.000' || - 0.9.toFixed(0) !== '1' || - 1.255.toFixed(2) !== '1.25' || - 1000000000000000128.0.toFixed(0) !== '1000000000000000128' -) || !require('./_fails')(function () { - // V8 ~ Android 4.3- - $toFixed.call({}); -})), 'Number', { - toFixed: function toFixed(fractionDigits) { - var x = aNumberValue(this, ERROR); - var f = toInteger(fractionDigits); - var s = ''; - var m = ZERO; - var e, z, j, k; - if (f < 0 || f > 20) throw RangeError(ERROR); - // eslint-disable-next-line no-self-compare - if (x != x) return 'NaN'; - if (x <= -1e21 || x >= 1e21) return String(x); - if (x < 0) { - s = '-'; - x = -x; - } - if (x > 1e-21) { - e = log(x * pow(2, 69, 1)) - 69; - z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); - z *= 0x10000000000000; - e = 52 - e; - if (e > 0) { - multiply(0, z); - j = f; - while (j >= 7) { - multiply(1e7, 0); - j -= 7; - } - multiply(pow(10, j, 1), 0); - j = e - 1; - while (j >= 23) { - divide(1 << 23); - j -= 23; - } - divide(1 << j); - multiply(1, 1); - divide(2); - m = numToString(); - } else { - multiply(0, z); - multiply(1 << -e, 0); - m = numToString() + repeat.call(ZERO, f); - } - } - if (f > 0) { - k = m.length; - m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); - } else { - m = s + m; - } return m; - } -}); diff --git a/node_modules/core-js/library/modules/es6.number.to-precision.js b/node_modules/core-js/library/modules/es6.number.to-precision.js deleted file mode 100644 index 0d92527ff..000000000 --- a/node_modules/core-js/library/modules/es6.number.to-precision.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $fails = require('./_fails'); -var aNumberValue = require('./_a-number-value'); -var $toPrecision = 1.0.toPrecision; - -$export($export.P + $export.F * ($fails(function () { - // IE7- - return $toPrecision.call(1, undefined) !== '1'; -}) || !$fails(function () { - // V8 ~ Android 4.3- - $toPrecision.call({}); -})), 'Number', { - toPrecision: function toPrecision(precision) { - var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); - return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); - } -}); diff --git a/node_modules/core-js/library/modules/es6.object.assign.js b/node_modules/core-js/library/modules/es6.object.assign.js deleted file mode 100644 index d28085a7e..000000000 --- a/node_modules/core-js/library/modules/es6.object.assign.js +++ /dev/null @@ -1,4 +0,0 @@ -// 19.1.3.1 Object.assign(target, source) -var $export = require('./_export'); - -$export($export.S + $export.F, 'Object', { assign: require('./_object-assign') }); diff --git a/node_modules/core-js/library/modules/es6.object.create.js b/node_modules/core-js/library/modules/es6.object.create.js deleted file mode 100644 index 70627d69c..000000000 --- a/node_modules/core-js/library/modules/es6.object.create.js +++ /dev/null @@ -1,3 +0,0 @@ -var $export = require('./_export'); -// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -$export($export.S, 'Object', { create: require('./_object-create') }); diff --git a/node_modules/core-js/library/modules/es6.object.define-properties.js b/node_modules/core-js/library/modules/es6.object.define-properties.js deleted file mode 100644 index 5ec34214d..000000000 --- a/node_modules/core-js/library/modules/es6.object.define-properties.js +++ /dev/null @@ -1,3 +0,0 @@ -var $export = require('./_export'); -// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) -$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperties: require('./_object-dps') }); diff --git a/node_modules/core-js/library/modules/es6.object.define-property.js b/node_modules/core-js/library/modules/es6.object.define-property.js deleted file mode 100644 index 120685825..000000000 --- a/node_modules/core-js/library/modules/es6.object.define-property.js +++ /dev/null @@ -1,3 +0,0 @@ -var $export = require('./_export'); -// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) -$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperty: require('./_object-dp').f }); diff --git a/node_modules/core-js/library/modules/es6.object.freeze.js b/node_modules/core-js/library/modules/es6.object.freeze.js deleted file mode 100644 index 0856ce9d7..000000000 --- a/node_modules/core-js/library/modules/es6.object.freeze.js +++ /dev/null @@ -1,9 +0,0 @@ -// 19.1.2.5 Object.freeze(O) -var isObject = require('./_is-object'); -var meta = require('./_meta').onFreeze; - -require('./_object-sap')('freeze', function ($freeze) { - return function freeze(it) { - return $freeze && isObject(it) ? $freeze(meta(it)) : it; - }; -}); diff --git a/node_modules/core-js/library/modules/es6.object.get-own-property-descriptor.js b/node_modules/core-js/library/modules/es6.object.get-own-property-descriptor.js deleted file mode 100644 index 9df214172..000000000 --- a/node_modules/core-js/library/modules/es6.object.get-own-property-descriptor.js +++ /dev/null @@ -1,9 +0,0 @@ -// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) -var toIObject = require('./_to-iobject'); -var $getOwnPropertyDescriptor = require('./_object-gopd').f; - -require('./_object-sap')('getOwnPropertyDescriptor', function () { - return function getOwnPropertyDescriptor(it, key) { - return $getOwnPropertyDescriptor(toIObject(it), key); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.object.get-own-property-names.js b/node_modules/core-js/library/modules/es6.object.get-own-property-names.js deleted file mode 100644 index 172f51c73..000000000 --- a/node_modules/core-js/library/modules/es6.object.get-own-property-names.js +++ /dev/null @@ -1,4 +0,0 @@ -// 19.1.2.7 Object.getOwnPropertyNames(O) -require('./_object-sap')('getOwnPropertyNames', function () { - return require('./_object-gopn-ext').f; -}); diff --git a/node_modules/core-js/library/modules/es6.object.get-prototype-of.js b/node_modules/core-js/library/modules/es6.object.get-prototype-of.js deleted file mode 100644 index 8fe2728c0..000000000 --- a/node_modules/core-js/library/modules/es6.object.get-prototype-of.js +++ /dev/null @@ -1,9 +0,0 @@ -// 19.1.2.9 Object.getPrototypeOf(O) -var toObject = require('./_to-object'); -var $getPrototypeOf = require('./_object-gpo'); - -require('./_object-sap')('getPrototypeOf', function () { - return function getPrototypeOf(it) { - return $getPrototypeOf(toObject(it)); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.object.is-extensible.js b/node_modules/core-js/library/modules/es6.object.is-extensible.js deleted file mode 100644 index 5cd4575a5..000000000 --- a/node_modules/core-js/library/modules/es6.object.is-extensible.js +++ /dev/null @@ -1,8 +0,0 @@ -// 19.1.2.11 Object.isExtensible(O) -var isObject = require('./_is-object'); - -require('./_object-sap')('isExtensible', function ($isExtensible) { - return function isExtensible(it) { - return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; - }; -}); diff --git a/node_modules/core-js/library/modules/es6.object.is-frozen.js b/node_modules/core-js/library/modules/es6.object.is-frozen.js deleted file mode 100644 index 0ceeabbb0..000000000 --- a/node_modules/core-js/library/modules/es6.object.is-frozen.js +++ /dev/null @@ -1,8 +0,0 @@ -// 19.1.2.12 Object.isFrozen(O) -var isObject = require('./_is-object'); - -require('./_object-sap')('isFrozen', function ($isFrozen) { - return function isFrozen(it) { - return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; - }; -}); diff --git a/node_modules/core-js/library/modules/es6.object.is-sealed.js b/node_modules/core-js/library/modules/es6.object.is-sealed.js deleted file mode 100644 index 7fa8ddedd..000000000 --- a/node_modules/core-js/library/modules/es6.object.is-sealed.js +++ /dev/null @@ -1,8 +0,0 @@ -// 19.1.2.13 Object.isSealed(O) -var isObject = require('./_is-object'); - -require('./_object-sap')('isSealed', function ($isSealed) { - return function isSealed(it) { - return isObject(it) ? $isSealed ? $isSealed(it) : false : true; - }; -}); diff --git a/node_modules/core-js/library/modules/es6.object.is.js b/node_modules/core-js/library/modules/es6.object.is.js deleted file mode 100644 index 204d7030f..000000000 --- a/node_modules/core-js/library/modules/es6.object.is.js +++ /dev/null @@ -1,3 +0,0 @@ -// 19.1.3.10 Object.is(value1, value2) -var $export = require('./_export'); -$export($export.S, 'Object', { is: require('./_same-value') }); diff --git a/node_modules/core-js/library/modules/es6.object.keys.js b/node_modules/core-js/library/modules/es6.object.keys.js deleted file mode 100644 index e9dade7de..000000000 --- a/node_modules/core-js/library/modules/es6.object.keys.js +++ /dev/null @@ -1,9 +0,0 @@ -// 19.1.2.14 Object.keys(O) -var toObject = require('./_to-object'); -var $keys = require('./_object-keys'); - -require('./_object-sap')('keys', function () { - return function keys(it) { - return $keys(toObject(it)); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.object.prevent-extensions.js b/node_modules/core-js/library/modules/es6.object.prevent-extensions.js deleted file mode 100644 index 2f729181f..000000000 --- a/node_modules/core-js/library/modules/es6.object.prevent-extensions.js +++ /dev/null @@ -1,9 +0,0 @@ -// 19.1.2.15 Object.preventExtensions(O) -var isObject = require('./_is-object'); -var meta = require('./_meta').onFreeze; - -require('./_object-sap')('preventExtensions', function ($preventExtensions) { - return function preventExtensions(it) { - return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; - }; -}); diff --git a/node_modules/core-js/library/modules/es6.object.seal.js b/node_modules/core-js/library/modules/es6.object.seal.js deleted file mode 100644 index 12c3f6a3a..000000000 --- a/node_modules/core-js/library/modules/es6.object.seal.js +++ /dev/null @@ -1,9 +0,0 @@ -// 19.1.2.17 Object.seal(O) -var isObject = require('./_is-object'); -var meta = require('./_meta').onFreeze; - -require('./_object-sap')('seal', function ($seal) { - return function seal(it) { - return $seal && isObject(it) ? $seal(meta(it)) : it; - }; -}); diff --git a/node_modules/core-js/library/modules/es6.object.set-prototype-of.js b/node_modules/core-js/library/modules/es6.object.set-prototype-of.js deleted file mode 100644 index 461dbd2ed..000000000 --- a/node_modules/core-js/library/modules/es6.object.set-prototype-of.js +++ /dev/null @@ -1,3 +0,0 @@ -// 19.1.3.19 Object.setPrototypeOf(O, proto) -var $export = require('./_export'); -$export($export.S, 'Object', { setPrototypeOf: require('./_set-proto').set }); diff --git a/node_modules/core-js/library/modules/es6.object.to-string.js b/node_modules/core-js/library/modules/es6.object.to-string.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/core-js/library/modules/es6.parse-float.js b/node_modules/core-js/library/modules/es6.parse-float.js deleted file mode 100644 index cbf50ead5..000000000 --- a/node_modules/core-js/library/modules/es6.parse-float.js +++ /dev/null @@ -1,4 +0,0 @@ -var $export = require('./_export'); -var $parseFloat = require('./_parse-float'); -// 18.2.4 parseFloat(string) -$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat }); diff --git a/node_modules/core-js/library/modules/es6.parse-int.js b/node_modules/core-js/library/modules/es6.parse-int.js deleted file mode 100644 index 7ea358e84..000000000 --- a/node_modules/core-js/library/modules/es6.parse-int.js +++ /dev/null @@ -1,4 +0,0 @@ -var $export = require('./_export'); -var $parseInt = require('./_parse-int'); -// 18.2.5 parseInt(string, radix) -$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt }); diff --git a/node_modules/core-js/library/modules/es6.promise.js b/node_modules/core-js/library/modules/es6.promise.js deleted file mode 100644 index b0ff3bfcf..000000000 --- a/node_modules/core-js/library/modules/es6.promise.js +++ /dev/null @@ -1,286 +0,0 @@ -'use strict'; -var LIBRARY = require('./_library'); -var global = require('./_global'); -var ctx = require('./_ctx'); -var classof = require('./_classof'); -var $export = require('./_export'); -var isObject = require('./_is-object'); -var aFunction = require('./_a-function'); -var anInstance = require('./_an-instance'); -var forOf = require('./_for-of'); -var speciesConstructor = require('./_species-constructor'); -var task = require('./_task').set; -var microtask = require('./_microtask')(); -var newPromiseCapabilityModule = require('./_new-promise-capability'); -var perform = require('./_perform'); -var userAgent = require('./_user-agent'); -var promiseResolve = require('./_promise-resolve'); -var PROMISE = 'Promise'; -var TypeError = global.TypeError; -var process = global.process; -var versions = process && process.versions; -var v8 = versions && versions.v8 || ''; -var $Promise = global[PROMISE]; -var isNode = classof(process) == 'process'; -var empty = function () { /* empty */ }; -var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; -var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; - -var USE_NATIVE = !!function () { - try { - // correct subclassing with @@species support - var promise = $Promise.resolve(1); - var FakePromise = (promise.constructor = {})[require('./_wks')('species')] = function (exec) { - exec(empty, empty); - }; - // unhandled rejections tracking support, NodeJS Promise without it fails @@species test - return (isNode || typeof PromiseRejectionEvent == 'function') - && promise.then(empty) instanceof FakePromise - // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables - // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 - // we can't detect it synchronously, so just check versions - && v8.indexOf('6.6') !== 0 - && userAgent.indexOf('Chrome/66') === -1; - } catch (e) { /* empty */ } -}(); - -// helpers -var isThenable = function (it) { - var then; - return isObject(it) && typeof (then = it.then) == 'function' ? then : false; -}; -var notify = function (promise, isReject) { - if (promise._n) return; - promise._n = true; - var chain = promise._c; - microtask(function () { - var value = promise._v; - var ok = promise._s == 1; - var i = 0; - var run = function (reaction) { - var handler = ok ? reaction.ok : reaction.fail; - var resolve = reaction.resolve; - var reject = reaction.reject; - var domain = reaction.domain; - var result, then, exited; - try { - if (handler) { - if (!ok) { - if (promise._h == 2) onHandleUnhandled(promise); - promise._h = 1; - } - if (handler === true) result = value; - else { - if (domain) domain.enter(); - result = handler(value); // may throw - if (domain) { - domain.exit(); - exited = true; - } - } - if (result === reaction.promise) { - reject(TypeError('Promise-chain cycle')); - } else if (then = isThenable(result)) { - then.call(result, resolve, reject); - } else resolve(result); - } else reject(value); - } catch (e) { - if (domain && !exited) domain.exit(); - reject(e); - } - }; - while (chain.length > i) run(chain[i++]); // variable length - can't use forEach - promise._c = []; - promise._n = false; - if (isReject && !promise._h) onUnhandled(promise); - }); -}; -var onUnhandled = function (promise) { - task.call(global, function () { - var value = promise._v; - var unhandled = isUnhandled(promise); - var result, handler, console; - if (unhandled) { - result = perform(function () { - if (isNode) { - process.emit('unhandledRejection', value, promise); - } else if (handler = global.onunhandledrejection) { - handler({ promise: promise, reason: value }); - } else if ((console = global.console) && console.error) { - console.error('Unhandled promise rejection', value); - } - }); - // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should - promise._h = isNode || isUnhandled(promise) ? 2 : 1; - } promise._a = undefined; - if (unhandled && result.e) throw result.v; - }); -}; -var isUnhandled = function (promise) { - return promise._h !== 1 && (promise._a || promise._c).length === 0; -}; -var onHandleUnhandled = function (promise) { - task.call(global, function () { - var handler; - if (isNode) { - process.emit('rejectionHandled', promise); - } else if (handler = global.onrejectionhandled) { - handler({ promise: promise, reason: promise._v }); - } - }); -}; -var $reject = function (value) { - var promise = this; - if (promise._d) return; - promise._d = true; - promise = promise._w || promise; // unwrap - promise._v = value; - promise._s = 2; - if (!promise._a) promise._a = promise._c.slice(); - notify(promise, true); -}; -var $resolve = function (value) { - var promise = this; - var then; - if (promise._d) return; - promise._d = true; - promise = promise._w || promise; // unwrap - try { - if (promise === value) throw TypeError("Promise can't be resolved itself"); - if (then = isThenable(value)) { - microtask(function () { - var wrapper = { _w: promise, _d: false }; // wrap - try { - then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); - } catch (e) { - $reject.call(wrapper, e); - } - }); - } else { - promise._v = value; - promise._s = 1; - notify(promise, false); - } - } catch (e) { - $reject.call({ _w: promise, _d: false }, e); // wrap - } -}; - -// constructor polyfill -if (!USE_NATIVE) { - // 25.4.3.1 Promise(executor) - $Promise = function Promise(executor) { - anInstance(this, $Promise, PROMISE, '_h'); - aFunction(executor); - Internal.call(this); - try { - executor(ctx($resolve, this, 1), ctx($reject, this, 1)); - } catch (err) { - $reject.call(this, err); - } - }; - // eslint-disable-next-line no-unused-vars - Internal = function Promise(executor) { - this._c = []; // <- awaiting reactions - this._a = undefined; // <- checked in isUnhandled reactions - this._s = 0; // <- state - this._d = false; // <- done - this._v = undefined; // <- value - this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled - this._n = false; // <- notify - }; - Internal.prototype = require('./_redefine-all')($Promise.prototype, { - // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) - then: function then(onFulfilled, onRejected) { - var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); - reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; - reaction.fail = typeof onRejected == 'function' && onRejected; - reaction.domain = isNode ? process.domain : undefined; - this._c.push(reaction); - if (this._a) this._a.push(reaction); - if (this._s) notify(this, false); - return reaction.promise; - }, - // 25.4.5.1 Promise.prototype.catch(onRejected) - 'catch': function (onRejected) { - return this.then(undefined, onRejected); - } - }); - OwnPromiseCapability = function () { - var promise = new Internal(); - this.promise = promise; - this.resolve = ctx($resolve, promise, 1); - this.reject = ctx($reject, promise, 1); - }; - newPromiseCapabilityModule.f = newPromiseCapability = function (C) { - return C === $Promise || C === Wrapper - ? new OwnPromiseCapability(C) - : newGenericPromiseCapability(C); - }; -} - -$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); -require('./_set-to-string-tag')($Promise, PROMISE); -require('./_set-species')(PROMISE); -Wrapper = require('./_core')[PROMISE]; - -// statics -$export($export.S + $export.F * !USE_NATIVE, PROMISE, { - // 25.4.4.5 Promise.reject(r) - reject: function reject(r) { - var capability = newPromiseCapability(this); - var $$reject = capability.reject; - $$reject(r); - return capability.promise; - } -}); -$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { - // 25.4.4.6 Promise.resolve(x) - resolve: function resolve(x) { - return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); - } -}); -$export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(function (iter) { - $Promise.all(iter)['catch'](empty); -})), PROMISE, { - // 25.4.4.1 Promise.all(iterable) - all: function all(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var resolve = capability.resolve; - var reject = capability.reject; - var result = perform(function () { - var values = []; - var index = 0; - var remaining = 1; - forOf(iterable, false, function (promise) { - var $index = index++; - var alreadyCalled = false; - values.push(undefined); - remaining++; - C.resolve(promise).then(function (value) { - if (alreadyCalled) return; - alreadyCalled = true; - values[$index] = value; - --remaining || resolve(values); - }, reject); - }); - --remaining || resolve(values); - }); - if (result.e) reject(result.v); - return capability.promise; - }, - // 25.4.4.4 Promise.race(iterable) - race: function race(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var reject = capability.reject; - var result = perform(function () { - forOf(iterable, false, function (promise) { - C.resolve(promise).then(capability.resolve, reject); - }); - }); - if (result.e) reject(result.v); - return capability.promise; - } -}); diff --git a/node_modules/core-js/library/modules/es6.reflect.apply.js b/node_modules/core-js/library/modules/es6.reflect.apply.js deleted file mode 100644 index 3b9c03a91..000000000 --- a/node_modules/core-js/library/modules/es6.reflect.apply.js +++ /dev/null @@ -1,16 +0,0 @@ -// 26.1.1 Reflect.apply(target, thisArgument, argumentsList) -var $export = require('./_export'); -var aFunction = require('./_a-function'); -var anObject = require('./_an-object'); -var rApply = (require('./_global').Reflect || {}).apply; -var fApply = Function.apply; -// MS Edge argumentsList argument is optional -$export($export.S + $export.F * !require('./_fails')(function () { - rApply(function () { /* empty */ }); -}), 'Reflect', { - apply: function apply(target, thisArgument, argumentsList) { - var T = aFunction(target); - var L = anObject(argumentsList); - return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); - } -}); diff --git a/node_modules/core-js/library/modules/es6.reflect.construct.js b/node_modules/core-js/library/modules/es6.reflect.construct.js deleted file mode 100644 index 380addb57..000000000 --- a/node_modules/core-js/library/modules/es6.reflect.construct.js +++ /dev/null @@ -1,47 +0,0 @@ -// 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) -var $export = require('./_export'); -var create = require('./_object-create'); -var aFunction = require('./_a-function'); -var anObject = require('./_an-object'); -var isObject = require('./_is-object'); -var fails = require('./_fails'); -var bind = require('./_bind'); -var rConstruct = (require('./_global').Reflect || {}).construct; - -// MS Edge supports only 2 arguments and argumentsList argument is optional -// FF Nightly sets third argument as `new.target`, but does not create `this` from it -var NEW_TARGET_BUG = fails(function () { - function F() { /* empty */ } - return !(rConstruct(function () { /* empty */ }, [], F) instanceof F); -}); -var ARGS_BUG = !fails(function () { - rConstruct(function () { /* empty */ }); -}); - -$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { - construct: function construct(Target, args /* , newTarget */) { - aFunction(Target); - anObject(args); - var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); - if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget); - if (Target == newTarget) { - // w/o altered newTarget, optimization for 0-4 arguments - switch (args.length) { - case 0: return new Target(); - case 1: return new Target(args[0]); - case 2: return new Target(args[0], args[1]); - case 3: return new Target(args[0], args[1], args[2]); - case 4: return new Target(args[0], args[1], args[2], args[3]); - } - // w/o altered newTarget, lot of arguments case - var $args = [null]; - $args.push.apply($args, args); - return new (bind.apply(Target, $args))(); - } - // with altered newTarget, not support built-in constructors - var proto = newTarget.prototype; - var instance = create(isObject(proto) ? proto : Object.prototype); - var result = Function.apply.call(Target, instance, args); - return isObject(result) ? result : instance; - } -}); diff --git a/node_modules/core-js/library/modules/es6.reflect.define-property.js b/node_modules/core-js/library/modules/es6.reflect.define-property.js deleted file mode 100644 index be7fbde6b..000000000 --- a/node_modules/core-js/library/modules/es6.reflect.define-property.js +++ /dev/null @@ -1,23 +0,0 @@ -// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) -var dP = require('./_object-dp'); -var $export = require('./_export'); -var anObject = require('./_an-object'); -var toPrimitive = require('./_to-primitive'); - -// MS Edge has broken Reflect.defineProperty - throwing instead of returning false -$export($export.S + $export.F * require('./_fails')(function () { - // eslint-disable-next-line no-undef - Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 }); -}), 'Reflect', { - defineProperty: function defineProperty(target, propertyKey, attributes) { - anObject(target); - propertyKey = toPrimitive(propertyKey, true); - anObject(attributes); - try { - dP.f(target, propertyKey, attributes); - return true; - } catch (e) { - return false; - } - } -}); diff --git a/node_modules/core-js/library/modules/es6.reflect.delete-property.js b/node_modules/core-js/library/modules/es6.reflect.delete-property.js deleted file mode 100644 index 0902b38a9..000000000 --- a/node_modules/core-js/library/modules/es6.reflect.delete-property.js +++ /dev/null @@ -1,11 +0,0 @@ -// 26.1.4 Reflect.deleteProperty(target, propertyKey) -var $export = require('./_export'); -var gOPD = require('./_object-gopd').f; -var anObject = require('./_an-object'); - -$export($export.S, 'Reflect', { - deleteProperty: function deleteProperty(target, propertyKey) { - var desc = gOPD(anObject(target), propertyKey); - return desc && !desc.configurable ? false : delete target[propertyKey]; - } -}); diff --git a/node_modules/core-js/library/modules/es6.reflect.enumerate.js b/node_modules/core-js/library/modules/es6.reflect.enumerate.js deleted file mode 100644 index 9e7c76a34..000000000 --- a/node_modules/core-js/library/modules/es6.reflect.enumerate.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; -// 26.1.5 Reflect.enumerate(target) -var $export = require('./_export'); -var anObject = require('./_an-object'); -var Enumerate = function (iterated) { - this._t = anObject(iterated); // target - this._i = 0; // next index - var keys = this._k = []; // keys - var key; - for (key in iterated) keys.push(key); -}; -require('./_iter-create')(Enumerate, 'Object', function () { - var that = this; - var keys = that._k; - var key; - do { - if (that._i >= keys.length) return { value: undefined, done: true }; - } while (!((key = keys[that._i++]) in that._t)); - return { value: key, done: false }; -}); - -$export($export.S, 'Reflect', { - enumerate: function enumerate(target) { - return new Enumerate(target); - } -}); diff --git a/node_modules/core-js/library/modules/es6.reflect.get-own-property-descriptor.js b/node_modules/core-js/library/modules/es6.reflect.get-own-property-descriptor.js deleted file mode 100644 index e1299f906..000000000 --- a/node_modules/core-js/library/modules/es6.reflect.get-own-property-descriptor.js +++ /dev/null @@ -1,10 +0,0 @@ -// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) -var gOPD = require('./_object-gopd'); -var $export = require('./_export'); -var anObject = require('./_an-object'); - -$export($export.S, 'Reflect', { - getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { - return gOPD.f(anObject(target), propertyKey); - } -}); diff --git a/node_modules/core-js/library/modules/es6.reflect.get-prototype-of.js b/node_modules/core-js/library/modules/es6.reflect.get-prototype-of.js deleted file mode 100644 index 28351d410..000000000 --- a/node_modules/core-js/library/modules/es6.reflect.get-prototype-of.js +++ /dev/null @@ -1,10 +0,0 @@ -// 26.1.8 Reflect.getPrototypeOf(target) -var $export = require('./_export'); -var getProto = require('./_object-gpo'); -var anObject = require('./_an-object'); - -$export($export.S, 'Reflect', { - getPrototypeOf: function getPrototypeOf(target) { - return getProto(anObject(target)); - } -}); diff --git a/node_modules/core-js/library/modules/es6.reflect.get.js b/node_modules/core-js/library/modules/es6.reflect.get.js deleted file mode 100644 index a7ee76667..000000000 --- a/node_modules/core-js/library/modules/es6.reflect.get.js +++ /dev/null @@ -1,21 +0,0 @@ -// 26.1.6 Reflect.get(target, propertyKey [, receiver]) -var gOPD = require('./_object-gopd'); -var getPrototypeOf = require('./_object-gpo'); -var has = require('./_has'); -var $export = require('./_export'); -var isObject = require('./_is-object'); -var anObject = require('./_an-object'); - -function get(target, propertyKey /* , receiver */) { - var receiver = arguments.length < 3 ? target : arguments[2]; - var desc, proto; - if (anObject(target) === receiver) return target[propertyKey]; - if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value') - ? desc.value - : desc.get !== undefined - ? desc.get.call(receiver) - : undefined; - if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver); -} - -$export($export.S, 'Reflect', { get: get }); diff --git a/node_modules/core-js/library/modules/es6.reflect.has.js b/node_modules/core-js/library/modules/es6.reflect.has.js deleted file mode 100644 index 4f5efa992..000000000 --- a/node_modules/core-js/library/modules/es6.reflect.has.js +++ /dev/null @@ -1,8 +0,0 @@ -// 26.1.9 Reflect.has(target, propertyKey) -var $export = require('./_export'); - -$export($export.S, 'Reflect', { - has: function has(target, propertyKey) { - return propertyKey in target; - } -}); diff --git a/node_modules/core-js/library/modules/es6.reflect.is-extensible.js b/node_modules/core-js/library/modules/es6.reflect.is-extensible.js deleted file mode 100644 index 700f938ac..000000000 --- a/node_modules/core-js/library/modules/es6.reflect.is-extensible.js +++ /dev/null @@ -1,11 +0,0 @@ -// 26.1.10 Reflect.isExtensible(target) -var $export = require('./_export'); -var anObject = require('./_an-object'); -var $isExtensible = Object.isExtensible; - -$export($export.S, 'Reflect', { - isExtensible: function isExtensible(target) { - anObject(target); - return $isExtensible ? $isExtensible(target) : true; - } -}); diff --git a/node_modules/core-js/library/modules/es6.reflect.own-keys.js b/node_modules/core-js/library/modules/es6.reflect.own-keys.js deleted file mode 100644 index 9f2424ae8..000000000 --- a/node_modules/core-js/library/modules/es6.reflect.own-keys.js +++ /dev/null @@ -1,4 +0,0 @@ -// 26.1.11 Reflect.ownKeys(target) -var $export = require('./_export'); - -$export($export.S, 'Reflect', { ownKeys: require('./_own-keys') }); diff --git a/node_modules/core-js/library/modules/es6.reflect.prevent-extensions.js b/node_modules/core-js/library/modules/es6.reflect.prevent-extensions.js deleted file mode 100644 index e1037fa19..000000000 --- a/node_modules/core-js/library/modules/es6.reflect.prevent-extensions.js +++ /dev/null @@ -1,16 +0,0 @@ -// 26.1.12 Reflect.preventExtensions(target) -var $export = require('./_export'); -var anObject = require('./_an-object'); -var $preventExtensions = Object.preventExtensions; - -$export($export.S, 'Reflect', { - preventExtensions: function preventExtensions(target) { - anObject(target); - try { - if ($preventExtensions) $preventExtensions(target); - return true; - } catch (e) { - return false; - } - } -}); diff --git a/node_modules/core-js/library/modules/es6.reflect.set-prototype-of.js b/node_modules/core-js/library/modules/es6.reflect.set-prototype-of.js deleted file mode 100644 index 5dae90122..000000000 --- a/node_modules/core-js/library/modules/es6.reflect.set-prototype-of.js +++ /dev/null @@ -1,15 +0,0 @@ -// 26.1.14 Reflect.setPrototypeOf(target, proto) -var $export = require('./_export'); -var setProto = require('./_set-proto'); - -if (setProto) $export($export.S, 'Reflect', { - setPrototypeOf: function setPrototypeOf(target, proto) { - setProto.check(target, proto); - try { - setProto.set(target, proto); - return true; - } catch (e) { - return false; - } - } -}); diff --git a/node_modules/core-js/library/modules/es6.reflect.set.js b/node_modules/core-js/library/modules/es6.reflect.set.js deleted file mode 100644 index d809d7a4e..000000000 --- a/node_modules/core-js/library/modules/es6.reflect.set.js +++ /dev/null @@ -1,33 +0,0 @@ -// 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) -var dP = require('./_object-dp'); -var gOPD = require('./_object-gopd'); -var getPrototypeOf = require('./_object-gpo'); -var has = require('./_has'); -var $export = require('./_export'); -var createDesc = require('./_property-desc'); -var anObject = require('./_an-object'); -var isObject = require('./_is-object'); - -function set(target, propertyKey, V /* , receiver */) { - var receiver = arguments.length < 4 ? target : arguments[3]; - var ownDesc = gOPD.f(anObject(target), propertyKey); - var existingDescriptor, proto; - if (!ownDesc) { - if (isObject(proto = getPrototypeOf(target))) { - return set(proto, propertyKey, V, receiver); - } - ownDesc = createDesc(0); - } - if (has(ownDesc, 'value')) { - if (ownDesc.writable === false || !isObject(receiver)) return false; - if (existingDescriptor = gOPD.f(receiver, propertyKey)) { - if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false; - existingDescriptor.value = V; - dP.f(receiver, propertyKey, existingDescriptor); - } else dP.f(receiver, propertyKey, createDesc(0, V)); - return true; - } - return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); -} - -$export($export.S, 'Reflect', { set: set }); diff --git a/node_modules/core-js/library/modules/es6.regexp.constructor.js b/node_modules/core-js/library/modules/es6.regexp.constructor.js deleted file mode 100644 index e85e3141a..000000000 --- a/node_modules/core-js/library/modules/es6.regexp.constructor.js +++ /dev/null @@ -1 +0,0 @@ -require('./_set-species')('RegExp'); diff --git a/node_modules/core-js/library/modules/es6.regexp.flags.js b/node_modules/core-js/library/modules/es6.regexp.flags.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/core-js/library/modules/es6.regexp.match.js b/node_modules/core-js/library/modules/es6.regexp.match.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/core-js/library/modules/es6.regexp.replace.js b/node_modules/core-js/library/modules/es6.regexp.replace.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/core-js/library/modules/es6.regexp.search.js b/node_modules/core-js/library/modules/es6.regexp.search.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/core-js/library/modules/es6.regexp.split.js b/node_modules/core-js/library/modules/es6.regexp.split.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/core-js/library/modules/es6.regexp.to-string.js b/node_modules/core-js/library/modules/es6.regexp.to-string.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/core-js/library/modules/es6.set.js b/node_modules/core-js/library/modules/es6.set.js deleted file mode 100644 index 55b8bdd89..000000000 --- a/node_modules/core-js/library/modules/es6.set.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; -var strong = require('./_collection-strong'); -var validate = require('./_validate-collection'); -var SET = 'Set'; - -// 23.2 Set Objects -module.exports = require('./_collection')(SET, function (get) { - return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; -}, { - // 23.2.3.1 Set.prototype.add(value) - add: function add(value) { - return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value); - } -}, strong); diff --git a/node_modules/core-js/library/modules/es6.string.anchor.js b/node_modules/core-js/library/modules/es6.string.anchor.js deleted file mode 100644 index 3493e54c0..000000000 --- a/node_modules/core-js/library/modules/es6.string.anchor.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.2 String.prototype.anchor(name) -require('./_string-html')('anchor', function (createHTML) { - return function anchor(name) { - return createHTML(this, 'a', 'name', name); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.string.big.js b/node_modules/core-js/library/modules/es6.string.big.js deleted file mode 100644 index 38aab3414..000000000 --- a/node_modules/core-js/library/modules/es6.string.big.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.3 String.prototype.big() -require('./_string-html')('big', function (createHTML) { - return function big() { - return createHTML(this, 'big', '', ''); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.string.blink.js b/node_modules/core-js/library/modules/es6.string.blink.js deleted file mode 100644 index 6188d96e3..000000000 --- a/node_modules/core-js/library/modules/es6.string.blink.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.4 String.prototype.blink() -require('./_string-html')('blink', function (createHTML) { - return function blink() { - return createHTML(this, 'blink', '', ''); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.string.bold.js b/node_modules/core-js/library/modules/es6.string.bold.js deleted file mode 100644 index ff3ecb9cb..000000000 --- a/node_modules/core-js/library/modules/es6.string.bold.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.5 String.prototype.bold() -require('./_string-html')('bold', function (createHTML) { - return function bold() { - return createHTML(this, 'b', '', ''); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.string.code-point-at.js b/node_modules/core-js/library/modules/es6.string.code-point-at.js deleted file mode 100644 index e39b8c5ea..000000000 --- a/node_modules/core-js/library/modules/es6.string.code-point-at.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $at = require('./_string-at')(false); -$export($export.P, 'String', { - // 21.1.3.3 String.prototype.codePointAt(pos) - codePointAt: function codePointAt(pos) { - return $at(this, pos); - } -}); diff --git a/node_modules/core-js/library/modules/es6.string.ends-with.js b/node_modules/core-js/library/modules/es6.string.ends-with.js deleted file mode 100644 index 065688884..000000000 --- a/node_modules/core-js/library/modules/es6.string.ends-with.js +++ /dev/null @@ -1,20 +0,0 @@ -// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) -'use strict'; -var $export = require('./_export'); -var toLength = require('./_to-length'); -var context = require('./_string-context'); -var ENDS_WITH = 'endsWith'; -var $endsWith = ''[ENDS_WITH]; - -$export($export.P + $export.F * require('./_fails-is-regexp')(ENDS_WITH), 'String', { - endsWith: function endsWith(searchString /* , endPosition = @length */) { - var that = context(this, searchString, ENDS_WITH); - var endPosition = arguments.length > 1 ? arguments[1] : undefined; - var len = toLength(that.length); - var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); - var search = String(searchString); - return $endsWith - ? $endsWith.call(that, search, end) - : that.slice(end - search.length, end) === search; - } -}); diff --git a/node_modules/core-js/library/modules/es6.string.fixed.js b/node_modules/core-js/library/modules/es6.string.fixed.js deleted file mode 100644 index d4a60f37d..000000000 --- a/node_modules/core-js/library/modules/es6.string.fixed.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.6 String.prototype.fixed() -require('./_string-html')('fixed', function (createHTML) { - return function fixed() { - return createHTML(this, 'tt', '', ''); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.string.fontcolor.js b/node_modules/core-js/library/modules/es6.string.fontcolor.js deleted file mode 100644 index f7b95957c..000000000 --- a/node_modules/core-js/library/modules/es6.string.fontcolor.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.7 String.prototype.fontcolor(color) -require('./_string-html')('fontcolor', function (createHTML) { - return function fontcolor(color) { - return createHTML(this, 'font', 'color', color); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.string.fontsize.js b/node_modules/core-js/library/modules/es6.string.fontsize.js deleted file mode 100644 index f4cc20aec..000000000 --- a/node_modules/core-js/library/modules/es6.string.fontsize.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.8 String.prototype.fontsize(size) -require('./_string-html')('fontsize', function (createHTML) { - return function fontsize(size) { - return createHTML(this, 'font', 'size', size); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.string.from-code-point.js b/node_modules/core-js/library/modules/es6.string.from-code-point.js deleted file mode 100644 index bece66e29..000000000 --- a/node_modules/core-js/library/modules/es6.string.from-code-point.js +++ /dev/null @@ -1,23 +0,0 @@ -var $export = require('./_export'); -var toAbsoluteIndex = require('./_to-absolute-index'); -var fromCharCode = String.fromCharCode; -var $fromCodePoint = String.fromCodePoint; - -// length should be 1, old FF problem -$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { - // 21.1.2.2 String.fromCodePoint(...codePoints) - fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars - var res = []; - var aLen = arguments.length; - var i = 0; - var code; - while (aLen > i) { - code = +arguments[i++]; - if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); - res.push(code < 0x10000 - ? fromCharCode(code) - : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) - ); - } return res.join(''); - } -}); diff --git a/node_modules/core-js/library/modules/es6.string.includes.js b/node_modules/core-js/library/modules/es6.string.includes.js deleted file mode 100644 index 28d17416b..000000000 --- a/node_modules/core-js/library/modules/es6.string.includes.js +++ /dev/null @@ -1,12 +0,0 @@ -// 21.1.3.7 String.prototype.includes(searchString, position = 0) -'use strict'; -var $export = require('./_export'); -var context = require('./_string-context'); -var INCLUDES = 'includes'; - -$export($export.P + $export.F * require('./_fails-is-regexp')(INCLUDES), 'String', { - includes: function includes(searchString /* , position = 0 */) { - return !!~context(this, searchString, INCLUDES) - .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); - } -}); diff --git a/node_modules/core-js/library/modules/es6.string.italics.js b/node_modules/core-js/library/modules/es6.string.italics.js deleted file mode 100644 index ed4cc3bf0..000000000 --- a/node_modules/core-js/library/modules/es6.string.italics.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.9 String.prototype.italics() -require('./_string-html')('italics', function (createHTML) { - return function italics() { - return createHTML(this, 'i', '', ''); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.string.iterator.js b/node_modules/core-js/library/modules/es6.string.iterator.js deleted file mode 100644 index 5d84c7fde..000000000 --- a/node_modules/core-js/library/modules/es6.string.iterator.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; -var $at = require('./_string-at')(true); - -// 21.1.3.27 String.prototype[@@iterator]() -require('./_iter-define')(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 }; -}); diff --git a/node_modules/core-js/library/modules/es6.string.link.js b/node_modules/core-js/library/modules/es6.string.link.js deleted file mode 100644 index d0255edd6..000000000 --- a/node_modules/core-js/library/modules/es6.string.link.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.10 String.prototype.link(url) -require('./_string-html')('link', function (createHTML) { - return function link(url) { - return createHTML(this, 'a', 'href', url); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.string.raw.js b/node_modules/core-js/library/modules/es6.string.raw.js deleted file mode 100644 index aa40ff6fa..000000000 --- a/node_modules/core-js/library/modules/es6.string.raw.js +++ /dev/null @@ -1,18 +0,0 @@ -var $export = require('./_export'); -var toIObject = require('./_to-iobject'); -var toLength = require('./_to-length'); - -$export($export.S, 'String', { - // 21.1.2.4 String.raw(callSite, ...substitutions) - raw: function raw(callSite) { - var tpl = toIObject(callSite.raw); - var len = toLength(tpl.length); - var aLen = arguments.length; - var res = []; - var i = 0; - while (len > i) { - res.push(String(tpl[i++])); - if (i < aLen) res.push(String(arguments[i])); - } return res.join(''); - } -}); diff --git a/node_modules/core-js/library/modules/es6.string.repeat.js b/node_modules/core-js/library/modules/es6.string.repeat.js deleted file mode 100644 index 08412d91b..000000000 --- a/node_modules/core-js/library/modules/es6.string.repeat.js +++ /dev/null @@ -1,6 +0,0 @@ -var $export = require('./_export'); - -$export($export.P, 'String', { - // 21.1.3.13 String.prototype.repeat(count) - repeat: require('./_string-repeat') -}); diff --git a/node_modules/core-js/library/modules/es6.string.small.js b/node_modules/core-js/library/modules/es6.string.small.js deleted file mode 100644 index 941e4a767..000000000 --- a/node_modules/core-js/library/modules/es6.string.small.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.11 String.prototype.small() -require('./_string-html')('small', function (createHTML) { - return function small() { - return createHTML(this, 'small', '', ''); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.string.starts-with.js b/node_modules/core-js/library/modules/es6.string.starts-with.js deleted file mode 100644 index c1723767d..000000000 --- a/node_modules/core-js/library/modules/es6.string.starts-with.js +++ /dev/null @@ -1,18 +0,0 @@ -// 21.1.3.18 String.prototype.startsWith(searchString [, position ]) -'use strict'; -var $export = require('./_export'); -var toLength = require('./_to-length'); -var context = require('./_string-context'); -var STARTS_WITH = 'startsWith'; -var $startsWith = ''[STARTS_WITH]; - -$export($export.P + $export.F * require('./_fails-is-regexp')(STARTS_WITH), 'String', { - startsWith: function startsWith(searchString /* , position = 0 */) { - var that = context(this, searchString, STARTS_WITH); - var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); - var search = String(searchString); - return $startsWith - ? $startsWith.call(that, search, index) - : that.slice(index, index + search.length) === search; - } -}); diff --git a/node_modules/core-js/library/modules/es6.string.strike.js b/node_modules/core-js/library/modules/es6.string.strike.js deleted file mode 100644 index 66055bc00..000000000 --- a/node_modules/core-js/library/modules/es6.string.strike.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.12 String.prototype.strike() -require('./_string-html')('strike', function (createHTML) { - return function strike() { - return createHTML(this, 'strike', '', ''); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.string.sub.js b/node_modules/core-js/library/modules/es6.string.sub.js deleted file mode 100644 index e295a27b0..000000000 --- a/node_modules/core-js/library/modules/es6.string.sub.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.13 String.prototype.sub() -require('./_string-html')('sub', function (createHTML) { - return function sub() { - return createHTML(this, 'sub', '', ''); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.string.sup.js b/node_modules/core-js/library/modules/es6.string.sup.js deleted file mode 100644 index 125a989a7..000000000 --- a/node_modules/core-js/library/modules/es6.string.sup.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.14 String.prototype.sup() -require('./_string-html')('sup', function (createHTML) { - return function sup() { - return createHTML(this, 'sup', '', ''); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.string.trim.js b/node_modules/core-js/library/modules/es6.string.trim.js deleted file mode 100644 index 02b8a6c69..000000000 --- a/node_modules/core-js/library/modules/es6.string.trim.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// 21.1.3.25 String.prototype.trim() -require('./_string-trim')('trim', function ($trim) { - return function trim() { - return $trim(this, 3); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.symbol.js b/node_modules/core-js/library/modules/es6.symbol.js deleted file mode 100644 index 5bf7c4884..000000000 --- a/node_modules/core-js/library/modules/es6.symbol.js +++ /dev/null @@ -1,234 +0,0 @@ -'use strict'; -// ECMAScript 6 symbols shim -var global = require('./_global'); -var has = require('./_has'); -var DESCRIPTORS = require('./_descriptors'); -var $export = require('./_export'); -var redefine = require('./_redefine'); -var META = require('./_meta').KEY; -var $fails = require('./_fails'); -var shared = require('./_shared'); -var setToStringTag = require('./_set-to-string-tag'); -var uid = require('./_uid'); -var wks = require('./_wks'); -var wksExt = require('./_wks-ext'); -var wksDefine = require('./_wks-define'); -var enumKeys = require('./_enum-keys'); -var isArray = require('./_is-array'); -var anObject = require('./_an-object'); -var isObject = require('./_is-object'); -var toIObject = require('./_to-iobject'); -var toPrimitive = require('./_to-primitive'); -var createDesc = require('./_property-desc'); -var _create = require('./_object-create'); -var gOPNExt = require('./_object-gopn-ext'); -var $GOPD = require('./_object-gopd'); -var $DP = require('./_object-dp'); -var $keys = require('./_object-keys'); -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'; -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; - require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames; - require('./_object-pie').f = $propertyIsEnumerable; - require('./_object-gops').f = $getOwnPropertySymbols; - - if (DESCRIPTORS && !require('./_library')) { - 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 -}); - -// 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] || require('./_hide')($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); diff --git a/node_modules/core-js/library/modules/es6.typed.array-buffer.js b/node_modules/core-js/library/modules/es6.typed.array-buffer.js deleted file mode 100644 index b2473709c..000000000 --- a/node_modules/core-js/library/modules/es6.typed.array-buffer.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $typed = require('./_typed'); -var buffer = require('./_typed-buffer'); -var anObject = require('./_an-object'); -var toAbsoluteIndex = require('./_to-absolute-index'); -var toLength = require('./_to-length'); -var isObject = require('./_is-object'); -var ArrayBuffer = require('./_global').ArrayBuffer; -var speciesConstructor = require('./_species-constructor'); -var $ArrayBuffer = buffer.ArrayBuffer; -var $DataView = buffer.DataView; -var $isView = $typed.ABV && ArrayBuffer.isView; -var $slice = $ArrayBuffer.prototype.slice; -var VIEW = $typed.VIEW; -var ARRAY_BUFFER = 'ArrayBuffer'; - -$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer }); - -$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { - // 24.1.3.1 ArrayBuffer.isView(arg) - isView: function isView(it) { - return $isView && $isView(it) || isObject(it) && VIEW in it; - } -}); - -$export($export.P + $export.U + $export.F * require('./_fails')(function () { - return !new $ArrayBuffer(2).slice(1, undefined).byteLength; -}), ARRAY_BUFFER, { - // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) - slice: function slice(start, end) { - if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix - var len = anObject(this).byteLength; - var first = toAbsoluteIndex(start, len); - var fin = toAbsoluteIndex(end === undefined ? len : end, len); - var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first)); - var viewS = new $DataView(this); - var viewT = new $DataView(result); - var index = 0; - while (first < fin) { - viewT.setUint8(index++, viewS.getUint8(first++)); - } return result; - } -}); - -require('./_set-species')(ARRAY_BUFFER); diff --git a/node_modules/core-js/library/modules/es6.typed.data-view.js b/node_modules/core-js/library/modules/es6.typed.data-view.js deleted file mode 100644 index d0e23536b..000000000 --- a/node_modules/core-js/library/modules/es6.typed.data-view.js +++ /dev/null @@ -1,4 +0,0 @@ -var $export = require('./_export'); -$export($export.G + $export.W + $export.F * !require('./_typed').ABV, { - DataView: require('./_typed-buffer').DataView -}); diff --git a/node_modules/core-js/library/modules/es6.typed.float32-array.js b/node_modules/core-js/library/modules/es6.typed.float32-array.js deleted file mode 100644 index f49700617..000000000 --- a/node_modules/core-js/library/modules/es6.typed.float32-array.js +++ /dev/null @@ -1,5 +0,0 @@ -require('./_typed-array')('Float32', 4, function (init) { - return function Float32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.typed.float64-array.js b/node_modules/core-js/library/modules/es6.typed.float64-array.js deleted file mode 100644 index 85dedcd59..000000000 --- a/node_modules/core-js/library/modules/es6.typed.float64-array.js +++ /dev/null @@ -1,5 +0,0 @@ -require('./_typed-array')('Float64', 8, function (init) { - return function Float64Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.typed.int16-array.js b/node_modules/core-js/library/modules/es6.typed.int16-array.js deleted file mode 100644 index b20ed0413..000000000 --- a/node_modules/core-js/library/modules/es6.typed.int16-array.js +++ /dev/null @@ -1,5 +0,0 @@ -require('./_typed-array')('Int16', 2, function (init) { - return function Int16Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.typed.int32-array.js b/node_modules/core-js/library/modules/es6.typed.int32-array.js deleted file mode 100644 index c7e6ae06f..000000000 --- a/node_modules/core-js/library/modules/es6.typed.int32-array.js +++ /dev/null @@ -1,5 +0,0 @@ -require('./_typed-array')('Int32', 4, function (init) { - return function Int32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.typed.int8-array.js b/node_modules/core-js/library/modules/es6.typed.int8-array.js deleted file mode 100644 index 58ab9f36e..000000000 --- a/node_modules/core-js/library/modules/es6.typed.int8-array.js +++ /dev/null @@ -1,5 +0,0 @@ -require('./_typed-array')('Int8', 1, function (init) { - return function Int8Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.typed.uint16-array.js b/node_modules/core-js/library/modules/es6.typed.uint16-array.js deleted file mode 100644 index 992805d63..000000000 --- a/node_modules/core-js/library/modules/es6.typed.uint16-array.js +++ /dev/null @@ -1,5 +0,0 @@ -require('./_typed-array')('Uint16', 2, function (init) { - return function Uint16Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.typed.uint32-array.js b/node_modules/core-js/library/modules/es6.typed.uint32-array.js deleted file mode 100644 index 5c444246a..000000000 --- a/node_modules/core-js/library/modules/es6.typed.uint32-array.js +++ /dev/null @@ -1,5 +0,0 @@ -require('./_typed-array')('Uint32', 4, function (init) { - return function Uint32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.typed.uint8-array.js b/node_modules/core-js/library/modules/es6.typed.uint8-array.js deleted file mode 100644 index 465cdc806..000000000 --- a/node_modules/core-js/library/modules/es6.typed.uint8-array.js +++ /dev/null @@ -1,5 +0,0 @@ -require('./_typed-array')('Uint8', 1, function (init) { - return function Uint8Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); diff --git a/node_modules/core-js/library/modules/es6.typed.uint8-clamped-array.js b/node_modules/core-js/library/modules/es6.typed.uint8-clamped-array.js deleted file mode 100644 index a84a1c1ac..000000000 --- a/node_modules/core-js/library/modules/es6.typed.uint8-clamped-array.js +++ /dev/null @@ -1,5 +0,0 @@ -require('./_typed-array')('Uint8', 1, function (init) { - return function Uint8ClampedArray(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}, true); diff --git a/node_modules/core-js/library/modules/es6.weak-map.js b/node_modules/core-js/library/modules/es6.weak-map.js deleted file mode 100644 index f21556d7c..000000000 --- a/node_modules/core-js/library/modules/es6.weak-map.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; -var each = require('./_array-methods')(0); -var redefine = require('./_redefine'); -var meta = require('./_meta'); -var assign = require('./_object-assign'); -var weak = require('./_collection-weak'); -var isObject = require('./_is-object'); -var fails = require('./_fails'); -var validate = require('./_validate-collection'); -var WEAK_MAP = 'WeakMap'; -var getWeak = meta.getWeak; -var isExtensible = Object.isExtensible; -var uncaughtFrozenStore = weak.ufstore; -var tmp = {}; -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 = require('./_collection')(WEAK_MAP, wrapper, methods, weak, true, true); - -// IE11 WeakMap frozen keys fix -if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) { - 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); - }); - }); -} diff --git a/node_modules/core-js/library/modules/es6.weak-set.js b/node_modules/core-js/library/modules/es6.weak-set.js deleted file mode 100644 index 18a81e524..000000000 --- a/node_modules/core-js/library/modules/es6.weak-set.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; -var weak = require('./_collection-weak'); -var validate = require('./_validate-collection'); -var WEAK_SET = 'WeakSet'; - -// 23.4 WeakSet Objects -require('./_collection')(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); diff --git a/node_modules/core-js/library/modules/es7.array.flat-map.js b/node_modules/core-js/library/modules/es7.array.flat-map.js deleted file mode 100644 index 2a210cd35..000000000 --- a/node_modules/core-js/library/modules/es7.array.flat-map.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; -// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap -var $export = require('./_export'); -var flattenIntoArray = require('./_flatten-into-array'); -var toObject = require('./_to-object'); -var toLength = require('./_to-length'); -var aFunction = require('./_a-function'); -var arraySpeciesCreate = require('./_array-species-create'); - -$export($export.P, 'Array', { - flatMap: function flatMap(callbackfn /* , thisArg */) { - var O = toObject(this); - var sourceLen, A; - aFunction(callbackfn); - sourceLen = toLength(O.length); - A = arraySpeciesCreate(O, 0); - flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]); - return A; - } -}); - -require('./_add-to-unscopables')('flatMap'); diff --git a/node_modules/core-js/library/modules/es7.array.flatten.js b/node_modules/core-js/library/modules/es7.array.flatten.js deleted file mode 100644 index 9019b2d1c..000000000 --- a/node_modules/core-js/library/modules/es7.array.flatten.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; -// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten -var $export = require('./_export'); -var flattenIntoArray = require('./_flatten-into-array'); -var toObject = require('./_to-object'); -var toLength = require('./_to-length'); -var toInteger = require('./_to-integer'); -var arraySpeciesCreate = require('./_array-species-create'); - -$export($export.P, 'Array', { - flatten: function flatten(/* depthArg = 1 */) { - var depthArg = arguments[0]; - var O = toObject(this); - var sourceLen = toLength(O.length); - var A = arraySpeciesCreate(O, 0); - flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg)); - return A; - } -}); - -require('./_add-to-unscopables')('flatten'); diff --git a/node_modules/core-js/library/modules/es7.array.includes.js b/node_modules/core-js/library/modules/es7.array.includes.js deleted file mode 100644 index 1b77f0eb8..000000000 --- a/node_modules/core-js/library/modules/es7.array.includes.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; -// https://github.com/tc39/Array.prototype.includes -var $export = require('./_export'); -var $includes = require('./_array-includes')(true); - -$export($export.P, 'Array', { - includes: function includes(el /* , fromIndex = 0 */) { - return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); - } -}); - -require('./_add-to-unscopables')('includes'); diff --git a/node_modules/core-js/library/modules/es7.asap.js b/node_modules/core-js/library/modules/es7.asap.js deleted file mode 100644 index d36f7c760..000000000 --- a/node_modules/core-js/library/modules/es7.asap.js +++ /dev/null @@ -1,12 +0,0 @@ -// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask -var $export = require('./_export'); -var microtask = require('./_microtask')(); -var process = require('./_global').process; -var isNode = require('./_cof')(process) == 'process'; - -$export($export.G, { - asap: function asap(fn) { - var domain = isNode && process.domain; - microtask(domain ? domain.bind(fn) : fn); - } -}); diff --git a/node_modules/core-js/library/modules/es7.error.is-error.js b/node_modules/core-js/library/modules/es7.error.is-error.js deleted file mode 100644 index ba94f5d13..000000000 --- a/node_modules/core-js/library/modules/es7.error.is-error.js +++ /dev/null @@ -1,9 +0,0 @@ -// https://github.com/ljharb/proposal-is-error -var $export = require('./_export'); -var cof = require('./_cof'); - -$export($export.S, 'Error', { - isError: function isError(it) { - return cof(it) === 'Error'; - } -}); diff --git a/node_modules/core-js/library/modules/es7.global.js b/node_modules/core-js/library/modules/es7.global.js deleted file mode 100644 index a315fd430..000000000 --- a/node_modules/core-js/library/modules/es7.global.js +++ /dev/null @@ -1,4 +0,0 @@ -// https://github.com/tc39/proposal-global -var $export = require('./_export'); - -$export($export.G, { global: require('./_global') }); diff --git a/node_modules/core-js/library/modules/es7.map.from.js b/node_modules/core-js/library/modules/es7.map.from.js deleted file mode 100644 index a60573704..000000000 --- a/node_modules/core-js/library/modules/es7.map.from.js +++ /dev/null @@ -1,2 +0,0 @@ -// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from -require('./_set-collection-from')('Map'); diff --git a/node_modules/core-js/library/modules/es7.map.of.js b/node_modules/core-js/library/modules/es7.map.of.js deleted file mode 100644 index a2bf1fef7..000000000 --- a/node_modules/core-js/library/modules/es7.map.of.js +++ /dev/null @@ -1,2 +0,0 @@ -// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of -require('./_set-collection-of')('Map'); diff --git a/node_modules/core-js/library/modules/es7.map.to-json.js b/node_modules/core-js/library/modules/es7.map.to-json.js deleted file mode 100644 index 95a3569fa..000000000 --- a/node_modules/core-js/library/modules/es7.map.to-json.js +++ /dev/null @@ -1,4 +0,0 @@ -// https://github.com/DavidBruant/Map-Set.prototype.toJSON -var $export = require('./_export'); - -$export($export.P + $export.R, 'Map', { toJSON: require('./_collection-to-json')('Map') }); diff --git a/node_modules/core-js/library/modules/es7.math.clamp.js b/node_modules/core-js/library/modules/es7.math.clamp.js deleted file mode 100644 index 319cda609..000000000 --- a/node_modules/core-js/library/modules/es7.math.clamp.js +++ /dev/null @@ -1,8 +0,0 @@ -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = require('./_export'); - -$export($export.S, 'Math', { - clamp: function clamp(x, lower, upper) { - return Math.min(upper, Math.max(lower, x)); - } -}); diff --git a/node_modules/core-js/library/modules/es7.math.deg-per-rad.js b/node_modules/core-js/library/modules/es7.math.deg-per-rad.js deleted file mode 100644 index 99b95bba9..000000000 --- a/node_modules/core-js/library/modules/es7.math.deg-per-rad.js +++ /dev/null @@ -1,4 +0,0 @@ -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = require('./_export'); - -$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 }); diff --git a/node_modules/core-js/library/modules/es7.math.degrees.js b/node_modules/core-js/library/modules/es7.math.degrees.js deleted file mode 100644 index 6637d915e..000000000 --- a/node_modules/core-js/library/modules/es7.math.degrees.js +++ /dev/null @@ -1,9 +0,0 @@ -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = require('./_export'); -var RAD_PER_DEG = 180 / Math.PI; - -$export($export.S, 'Math', { - degrees: function degrees(radians) { - return radians * RAD_PER_DEG; - } -}); diff --git a/node_modules/core-js/library/modules/es7.math.fscale.js b/node_modules/core-js/library/modules/es7.math.fscale.js deleted file mode 100644 index ad660a058..000000000 --- a/node_modules/core-js/library/modules/es7.math.fscale.js +++ /dev/null @@ -1,10 +0,0 @@ -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = require('./_export'); -var scale = require('./_math-scale'); -var fround = require('./_math-fround'); - -$export($export.S, 'Math', { - fscale: function fscale(x, inLow, inHigh, outLow, outHigh) { - return fround(scale(x, inLow, inHigh, outLow, outHigh)); - } -}); diff --git a/node_modules/core-js/library/modules/es7.math.iaddh.js b/node_modules/core-js/library/modules/es7.math.iaddh.js deleted file mode 100644 index a331ba9b2..000000000 --- a/node_modules/core-js/library/modules/es7.math.iaddh.js +++ /dev/null @@ -1,11 +0,0 @@ -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = require('./_export'); - -$export($export.S, 'Math', { - iaddh: function iaddh(x0, x1, y0, y1) { - var $x0 = x0 >>> 0; - var $x1 = x1 >>> 0; - var $y0 = y0 >>> 0; - return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; - } -}); diff --git a/node_modules/core-js/library/modules/es7.math.imulh.js b/node_modules/core-js/library/modules/es7.math.imulh.js deleted file mode 100644 index 58d19f3ac..000000000 --- a/node_modules/core-js/library/modules/es7.math.imulh.js +++ /dev/null @@ -1,16 +0,0 @@ -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = require('./_export'); - -$export($export.S, 'Math', { - imulh: function imulh(u, v) { - var UINT16 = 0xffff; - var $u = +u; - var $v = +v; - var u0 = $u & UINT16; - var v0 = $v & UINT16; - var u1 = $u >> 16; - var v1 = $v >> 16; - var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); - return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); - } -}); diff --git a/node_modules/core-js/library/modules/es7.math.isubh.js b/node_modules/core-js/library/modules/es7.math.isubh.js deleted file mode 100644 index de22793c1..000000000 --- a/node_modules/core-js/library/modules/es7.math.isubh.js +++ /dev/null @@ -1,11 +0,0 @@ -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = require('./_export'); - -$export($export.S, 'Math', { - isubh: function isubh(x0, x1, y0, y1) { - var $x0 = x0 >>> 0; - var $x1 = x1 >>> 0; - var $y0 = y0 >>> 0; - return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; - } -}); diff --git a/node_modules/core-js/library/modules/es7.math.rad-per-deg.js b/node_modules/core-js/library/modules/es7.math.rad-per-deg.js deleted file mode 100644 index 6f702596a..000000000 --- a/node_modules/core-js/library/modules/es7.math.rad-per-deg.js +++ /dev/null @@ -1,4 +0,0 @@ -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = require('./_export'); - -$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI }); diff --git a/node_modules/core-js/library/modules/es7.math.radians.js b/node_modules/core-js/library/modules/es7.math.radians.js deleted file mode 100644 index abd9575fe..000000000 --- a/node_modules/core-js/library/modules/es7.math.radians.js +++ /dev/null @@ -1,9 +0,0 @@ -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = require('./_export'); -var DEG_PER_RAD = Math.PI / 180; - -$export($export.S, 'Math', { - radians: function radians(degrees) { - return degrees * DEG_PER_RAD; - } -}); diff --git a/node_modules/core-js/library/modules/es7.math.scale.js b/node_modules/core-js/library/modules/es7.math.scale.js deleted file mode 100644 index 2866dcd7c..000000000 --- a/node_modules/core-js/library/modules/es7.math.scale.js +++ /dev/null @@ -1,4 +0,0 @@ -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = require('./_export'); - -$export($export.S, 'Math', { scale: require('./_math-scale') }); diff --git a/node_modules/core-js/library/modules/es7.math.signbit.js b/node_modules/core-js/library/modules/es7.math.signbit.js deleted file mode 100644 index c25680486..000000000 --- a/node_modules/core-js/library/modules/es7.math.signbit.js +++ /dev/null @@ -1,7 +0,0 @@ -// http://jfbastien.github.io/papers/Math.signbit.html -var $export = require('./_export'); - -$export($export.S, 'Math', { signbit: function signbit(x) { - // eslint-disable-next-line no-self-compare - return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0; -} }); diff --git a/node_modules/core-js/library/modules/es7.math.umulh.js b/node_modules/core-js/library/modules/es7.math.umulh.js deleted file mode 100644 index 3ddfa4685..000000000 --- a/node_modules/core-js/library/modules/es7.math.umulh.js +++ /dev/null @@ -1,16 +0,0 @@ -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = require('./_export'); - -$export($export.S, 'Math', { - umulh: function umulh(u, v) { - var UINT16 = 0xffff; - var $u = +u; - var $v = +v; - var u0 = $u & UINT16; - var v0 = $v & UINT16; - var u1 = $u >>> 16; - var v1 = $v >>> 16; - var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); - return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); - } -}); diff --git a/node_modules/core-js/library/modules/es7.object.define-getter.js b/node_modules/core-js/library/modules/es7.object.define-getter.js deleted file mode 100644 index ffc6203fd..000000000 --- a/node_modules/core-js/library/modules/es7.object.define-getter.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var toObject = require('./_to-object'); -var aFunction = require('./_a-function'); -var $defineProperty = require('./_object-dp'); - -// B.2.2.2 Object.prototype.__defineGetter__(P, getter) -require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { - __defineGetter__: function __defineGetter__(P, getter) { - $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true }); - } -}); diff --git a/node_modules/core-js/library/modules/es7.object.define-setter.js b/node_modules/core-js/library/modules/es7.object.define-setter.js deleted file mode 100644 index 8ceefdd68..000000000 --- a/node_modules/core-js/library/modules/es7.object.define-setter.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var toObject = require('./_to-object'); -var aFunction = require('./_a-function'); -var $defineProperty = require('./_object-dp'); - -// B.2.2.3 Object.prototype.__defineSetter__(P, setter) -require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { - __defineSetter__: function __defineSetter__(P, setter) { - $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true }); - } -}); diff --git a/node_modules/core-js/library/modules/es7.object.entries.js b/node_modules/core-js/library/modules/es7.object.entries.js deleted file mode 100644 index 2f83437c8..000000000 --- a/node_modules/core-js/library/modules/es7.object.entries.js +++ /dev/null @@ -1,9 +0,0 @@ -// https://github.com/tc39/proposal-object-values-entries -var $export = require('./_export'); -var $entries = require('./_object-to-array')(true); - -$export($export.S, 'Object', { - entries: function entries(it) { - return $entries(it); - } -}); diff --git a/node_modules/core-js/library/modules/es7.object.get-own-property-descriptors.js b/node_modules/core-js/library/modules/es7.object.get-own-property-descriptors.js deleted file mode 100644 index b1ab72fde..000000000 --- a/node_modules/core-js/library/modules/es7.object.get-own-property-descriptors.js +++ /dev/null @@ -1,22 +0,0 @@ -// https://github.com/tc39/proposal-object-getownpropertydescriptors -var $export = require('./_export'); -var ownKeys = require('./_own-keys'); -var toIObject = require('./_to-iobject'); -var gOPD = require('./_object-gopd'); -var createProperty = require('./_create-property'); - -$export($export.S, 'Object', { - getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { - var O = toIObject(object); - var getDesc = gOPD.f; - var keys = ownKeys(O); - var result = {}; - var i = 0; - var key, desc; - while (keys.length > i) { - desc = getDesc(O, key = keys[i++]); - if (desc !== undefined) createProperty(result, key, desc); - } - return result; - } -}); diff --git a/node_modules/core-js/library/modules/es7.object.lookup-getter.js b/node_modules/core-js/library/modules/es7.object.lookup-getter.js deleted file mode 100644 index f80222916..000000000 --- a/node_modules/core-js/library/modules/es7.object.lookup-getter.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var toObject = require('./_to-object'); -var toPrimitive = require('./_to-primitive'); -var getPrototypeOf = require('./_object-gpo'); -var getOwnPropertyDescriptor = require('./_object-gopd').f; - -// B.2.2.4 Object.prototype.__lookupGetter__(P) -require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { - __lookupGetter__: function __lookupGetter__(P) { - var O = toObject(this); - var K = toPrimitive(P, true); - var D; - do { - if (D = getOwnPropertyDescriptor(O, K)) return D.get; - } while (O = getPrototypeOf(O)); - } -}); diff --git a/node_modules/core-js/library/modules/es7.object.lookup-setter.js b/node_modules/core-js/library/modules/es7.object.lookup-setter.js deleted file mode 100644 index 8bf8b64ea..000000000 --- a/node_modules/core-js/library/modules/es7.object.lookup-setter.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var toObject = require('./_to-object'); -var toPrimitive = require('./_to-primitive'); -var getPrototypeOf = require('./_object-gpo'); -var getOwnPropertyDescriptor = require('./_object-gopd').f; - -// B.2.2.5 Object.prototype.__lookupSetter__(P) -require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { - __lookupSetter__: function __lookupSetter__(P) { - var O = toObject(this); - var K = toPrimitive(P, true); - var D; - do { - if (D = getOwnPropertyDescriptor(O, K)) return D.set; - } while (O = getPrototypeOf(O)); - } -}); diff --git a/node_modules/core-js/library/modules/es7.object.values.js b/node_modules/core-js/library/modules/es7.object.values.js deleted file mode 100644 index d6f095275..000000000 --- a/node_modules/core-js/library/modules/es7.object.values.js +++ /dev/null @@ -1,9 +0,0 @@ -// https://github.com/tc39/proposal-object-values-entries -var $export = require('./_export'); -var $values = require('./_object-to-array')(false); - -$export($export.S, 'Object', { - values: function values(it) { - return $values(it); - } -}); diff --git a/node_modules/core-js/library/modules/es7.observable.js b/node_modules/core-js/library/modules/es7.observable.js deleted file mode 100644 index 6dcb2c8f2..000000000 --- a/node_modules/core-js/library/modules/es7.observable.js +++ /dev/null @@ -1,199 +0,0 @@ -'use strict'; -// https://github.com/zenparsing/es-observable -var $export = require('./_export'); -var global = require('./_global'); -var core = require('./_core'); -var microtask = require('./_microtask')(); -var OBSERVABLE = require('./_wks')('observable'); -var aFunction = require('./_a-function'); -var anObject = require('./_an-object'); -var anInstance = require('./_an-instance'); -var redefineAll = require('./_redefine-all'); -var hide = require('./_hide'); -var forOf = require('./_for-of'); -var RETURN = forOf.RETURN; - -var getMethod = function (fn) { - return fn == null ? undefined : aFunction(fn); -}; - -var cleanupSubscription = function (subscription) { - var cleanup = subscription._c; - if (cleanup) { - subscription._c = undefined; - cleanup(); - } -}; - -var subscriptionClosed = function (subscription) { - return subscription._o === undefined; -}; - -var closeSubscription = function (subscription) { - if (!subscriptionClosed(subscription)) { - subscription._o = undefined; - cleanupSubscription(subscription); - } -}; - -var Subscription = function (observer, subscriber) { - anObject(observer); - this._c = undefined; - this._o = observer; - observer = new SubscriptionObserver(this); - try { - var cleanup = subscriber(observer); - var subscription = cleanup; - if (cleanup != null) { - if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); }; - else aFunction(cleanup); - this._c = cleanup; - } - } catch (e) { - observer.error(e); - return; - } if (subscriptionClosed(this)) cleanupSubscription(this); -}; - -Subscription.prototype = redefineAll({}, { - unsubscribe: function unsubscribe() { closeSubscription(this); } -}); - -var SubscriptionObserver = function (subscription) { - this._s = subscription; -}; - -SubscriptionObserver.prototype = redefineAll({}, { - next: function next(value) { - var subscription = this._s; - if (!subscriptionClosed(subscription)) { - var observer = subscription._o; - try { - var m = getMethod(observer.next); - if (m) return m.call(observer, value); - } catch (e) { - try { - closeSubscription(subscription); - } finally { - throw e; - } - } - } - }, - error: function error(value) { - var subscription = this._s; - if (subscriptionClosed(subscription)) throw value; - var observer = subscription._o; - subscription._o = undefined; - try { - var m = getMethod(observer.error); - if (!m) throw value; - value = m.call(observer, value); - } catch (e) { - try { - cleanupSubscription(subscription); - } finally { - throw e; - } - } cleanupSubscription(subscription); - return value; - }, - complete: function complete(value) { - var subscription = this._s; - if (!subscriptionClosed(subscription)) { - var observer = subscription._o; - subscription._o = undefined; - try { - var m = getMethod(observer.complete); - value = m ? m.call(observer, value) : undefined; - } catch (e) { - try { - cleanupSubscription(subscription); - } finally { - throw e; - } - } cleanupSubscription(subscription); - return value; - } - } -}); - -var $Observable = function Observable(subscriber) { - anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber); -}; - -redefineAll($Observable.prototype, { - subscribe: function subscribe(observer) { - return new Subscription(observer, this._f); - }, - forEach: function forEach(fn) { - var that = this; - return new (core.Promise || global.Promise)(function (resolve, reject) { - aFunction(fn); - var subscription = that.subscribe({ - next: function (value) { - try { - return fn(value); - } catch (e) { - reject(e); - subscription.unsubscribe(); - } - }, - error: reject, - complete: resolve - }); - }); - } -}); - -redefineAll($Observable, { - from: function from(x) { - var C = typeof this === 'function' ? this : $Observable; - var method = getMethod(anObject(x)[OBSERVABLE]); - if (method) { - var observable = anObject(method.call(x)); - return observable.constructor === C ? observable : new C(function (observer) { - return observable.subscribe(observer); - }); - } - return new C(function (observer) { - var done = false; - microtask(function () { - if (!done) { - try { - if (forOf(x, false, function (it) { - observer.next(it); - if (done) return RETURN; - }) === RETURN) return; - } catch (e) { - if (done) throw e; - observer.error(e); - return; - } observer.complete(); - } - }); - return function () { done = true; }; - }); - }, - of: function of() { - for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++]; - return new (typeof this === 'function' ? this : $Observable)(function (observer) { - var done = false; - microtask(function () { - if (!done) { - for (var j = 0; j < items.length; ++j) { - observer.next(items[j]); - if (done) return; - } observer.complete(); - } - }); - return function () { done = true; }; - }); - } -}); - -hide($Observable.prototype, OBSERVABLE, function () { return this; }); - -$export($export.G, { Observable: $Observable }); - -require('./_set-species')('Observable'); diff --git a/node_modules/core-js/library/modules/es7.promise.finally.js b/node_modules/core-js/library/modules/es7.promise.finally.js deleted file mode 100644 index fa04b6399..000000000 --- a/node_modules/core-js/library/modules/es7.promise.finally.js +++ /dev/null @@ -1,20 +0,0 @@ -// https://github.com/tc39/proposal-promise-finally -'use strict'; -var $export = require('./_export'); -var core = require('./_core'); -var global = require('./_global'); -var speciesConstructor = require('./_species-constructor'); -var promiseResolve = require('./_promise-resolve'); - -$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { - var C = speciesConstructor(this, core.Promise || global.Promise); - var isFunction = typeof onFinally == 'function'; - return this.then( - isFunction ? function (x) { - return promiseResolve(C, onFinally()).then(function () { return x; }); - } : onFinally, - isFunction ? function (e) { - return promiseResolve(C, onFinally()).then(function () { throw e; }); - } : onFinally - ); -} }); diff --git a/node_modules/core-js/library/modules/es7.promise.try.js b/node_modules/core-js/library/modules/es7.promise.try.js deleted file mode 100644 index e8163720b..000000000 --- a/node_modules/core-js/library/modules/es7.promise.try.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; -// https://github.com/tc39/proposal-promise-try -var $export = require('./_export'); -var newPromiseCapability = require('./_new-promise-capability'); -var perform = require('./_perform'); - -$export($export.S, 'Promise', { 'try': function (callbackfn) { - var promiseCapability = newPromiseCapability.f(this); - var result = perform(callbackfn); - (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); - return promiseCapability.promise; -} }); diff --git a/node_modules/core-js/library/modules/es7.reflect.define-metadata.js b/node_modules/core-js/library/modules/es7.reflect.define-metadata.js deleted file mode 100644 index ebef52c24..000000000 --- a/node_modules/core-js/library/modules/es7.reflect.define-metadata.js +++ /dev/null @@ -1,8 +0,0 @@ -var metadata = require('./_metadata'); -var anObject = require('./_an-object'); -var toMetaKey = metadata.key; -var ordinaryDefineOwnMetadata = metadata.set; - -metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) { - ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); -} }); diff --git a/node_modules/core-js/library/modules/es7.reflect.delete-metadata.js b/node_modules/core-js/library/modules/es7.reflect.delete-metadata.js deleted file mode 100644 index 590ed53ce..000000000 --- a/node_modules/core-js/library/modules/es7.reflect.delete-metadata.js +++ /dev/null @@ -1,15 +0,0 @@ -var metadata = require('./_metadata'); -var anObject = require('./_an-object'); -var toMetaKey = metadata.key; -var getOrCreateMetadataMap = metadata.map; -var store = metadata.store; - -metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) { - var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]); - var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); - if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false; - if (metadataMap.size) return true; - var targetMetadata = store.get(target); - targetMetadata['delete'](targetKey); - return !!targetMetadata.size || store['delete'](target); -} }); diff --git a/node_modules/core-js/library/modules/es7.reflect.get-metadata-keys.js b/node_modules/core-js/library/modules/es7.reflect.get-metadata-keys.js deleted file mode 100644 index f344172b5..000000000 --- a/node_modules/core-js/library/modules/es7.reflect.get-metadata-keys.js +++ /dev/null @@ -1,19 +0,0 @@ -var Set = require('./es6.set'); -var from = require('./_array-from-iterable'); -var metadata = require('./_metadata'); -var anObject = require('./_an-object'); -var getPrototypeOf = require('./_object-gpo'); -var ordinaryOwnMetadataKeys = metadata.keys; -var toMetaKey = metadata.key; - -var ordinaryMetadataKeys = function (O, P) { - var oKeys = ordinaryOwnMetadataKeys(O, P); - var parent = getPrototypeOf(O); - if (parent === null) return oKeys; - var pKeys = ordinaryMetadataKeys(parent, P); - return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys; -}; - -metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) { - return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); -} }); diff --git a/node_modules/core-js/library/modules/es7.reflect.get-metadata.js b/node_modules/core-js/library/modules/es7.reflect.get-metadata.js deleted file mode 100644 index 58c278e98..000000000 --- a/node_modules/core-js/library/modules/es7.reflect.get-metadata.js +++ /dev/null @@ -1,17 +0,0 @@ -var metadata = require('./_metadata'); -var anObject = require('./_an-object'); -var getPrototypeOf = require('./_object-gpo'); -var ordinaryHasOwnMetadata = metadata.has; -var ordinaryGetOwnMetadata = metadata.get; -var toMetaKey = metadata.key; - -var ordinaryGetMetadata = function (MetadataKey, O, P) { - var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); - if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P); - var parent = getPrototypeOf(O); - return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; -}; - -metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) { - return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); diff --git a/node_modules/core-js/library/modules/es7.reflect.get-own-metadata-keys.js b/node_modules/core-js/library/modules/es7.reflect.get-own-metadata-keys.js deleted file mode 100644 index 03e3201bb..000000000 --- a/node_modules/core-js/library/modules/es7.reflect.get-own-metadata-keys.js +++ /dev/null @@ -1,8 +0,0 @@ -var metadata = require('./_metadata'); -var anObject = require('./_an-object'); -var ordinaryOwnMetadataKeys = metadata.keys; -var toMetaKey = metadata.key; - -metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) { - return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); -} }); diff --git a/node_modules/core-js/library/modules/es7.reflect.get-own-metadata.js b/node_modules/core-js/library/modules/es7.reflect.get-own-metadata.js deleted file mode 100644 index 4a18b0717..000000000 --- a/node_modules/core-js/library/modules/es7.reflect.get-own-metadata.js +++ /dev/null @@ -1,9 +0,0 @@ -var metadata = require('./_metadata'); -var anObject = require('./_an-object'); -var ordinaryGetOwnMetadata = metadata.get; -var toMetaKey = metadata.key; - -metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) { - return ordinaryGetOwnMetadata(metadataKey, anObject(target) - , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); diff --git a/node_modules/core-js/library/modules/es7.reflect.has-metadata.js b/node_modules/core-js/library/modules/es7.reflect.has-metadata.js deleted file mode 100644 index b934bb4ec..000000000 --- a/node_modules/core-js/library/modules/es7.reflect.has-metadata.js +++ /dev/null @@ -1,16 +0,0 @@ -var metadata = require('./_metadata'); -var anObject = require('./_an-object'); -var getPrototypeOf = require('./_object-gpo'); -var ordinaryHasOwnMetadata = metadata.has; -var toMetaKey = metadata.key; - -var ordinaryHasMetadata = function (MetadataKey, O, P) { - var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); - if (hasOwn) return true; - var parent = getPrototypeOf(O); - return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; -}; - -metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) { - return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); diff --git a/node_modules/core-js/library/modules/es7.reflect.has-own-metadata.js b/node_modules/core-js/library/modules/es7.reflect.has-own-metadata.js deleted file mode 100644 index 512850dd8..000000000 --- a/node_modules/core-js/library/modules/es7.reflect.has-own-metadata.js +++ /dev/null @@ -1,9 +0,0 @@ -var metadata = require('./_metadata'); -var anObject = require('./_an-object'); -var ordinaryHasOwnMetadata = metadata.has; -var toMetaKey = metadata.key; - -metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) { - return ordinaryHasOwnMetadata(metadataKey, anObject(target) - , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); diff --git a/node_modules/core-js/library/modules/es7.reflect.metadata.js b/node_modules/core-js/library/modules/es7.reflect.metadata.js deleted file mode 100644 index efb9a9e26..000000000 --- a/node_modules/core-js/library/modules/es7.reflect.metadata.js +++ /dev/null @@ -1,15 +0,0 @@ -var $metadata = require('./_metadata'); -var anObject = require('./_an-object'); -var aFunction = require('./_a-function'); -var toMetaKey = $metadata.key; -var ordinaryDefineOwnMetadata = $metadata.set; - -$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) { - return function decorator(target, targetKey) { - ordinaryDefineOwnMetadata( - metadataKey, metadataValue, - (targetKey !== undefined ? anObject : aFunction)(target), - toMetaKey(targetKey) - ); - }; -} }); diff --git a/node_modules/core-js/library/modules/es7.set.from.js b/node_modules/core-js/library/modules/es7.set.from.js deleted file mode 100644 index 26542b664..000000000 --- a/node_modules/core-js/library/modules/es7.set.from.js +++ /dev/null @@ -1,2 +0,0 @@ -// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from -require('./_set-collection-from')('Set'); diff --git a/node_modules/core-js/library/modules/es7.set.of.js b/node_modules/core-js/library/modules/es7.set.of.js deleted file mode 100644 index 2a50ad911..000000000 --- a/node_modules/core-js/library/modules/es7.set.of.js +++ /dev/null @@ -1,2 +0,0 @@ -// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of -require('./_set-collection-of')('Set'); diff --git a/node_modules/core-js/library/modules/es7.set.to-json.js b/node_modules/core-js/library/modules/es7.set.to-json.js deleted file mode 100644 index 95cbcfa51..000000000 --- a/node_modules/core-js/library/modules/es7.set.to-json.js +++ /dev/null @@ -1,4 +0,0 @@ -// https://github.com/DavidBruant/Map-Set.prototype.toJSON -var $export = require('./_export'); - -$export($export.P + $export.R, 'Set', { toJSON: require('./_collection-to-json')('Set') }); diff --git a/node_modules/core-js/library/modules/es7.string.at.js b/node_modules/core-js/library/modules/es7.string.at.js deleted file mode 100644 index 8b3ab98db..000000000 --- a/node_modules/core-js/library/modules/es7.string.at.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; -// https://github.com/mathiasbynens/String.prototype.at -var $export = require('./_export'); -var $at = require('./_string-at')(true); - -$export($export.P, 'String', { - at: function at(pos) { - return $at(this, pos); - } -}); diff --git a/node_modules/core-js/library/modules/es7.string.match-all.js b/node_modules/core-js/library/modules/es7.string.match-all.js deleted file mode 100644 index 78237036e..000000000 --- a/node_modules/core-js/library/modules/es7.string.match-all.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; -// https://tc39.github.io/String.prototype.matchAll/ -var $export = require('./_export'); -var defined = require('./_defined'); -var toLength = require('./_to-length'); -var isRegExp = require('./_is-regexp'); -var getFlags = require('./_flags'); -var RegExpProto = RegExp.prototype; - -var $RegExpStringIterator = function (regexp, string) { - this._r = regexp; - this._s = string; -}; - -require('./_iter-create')($RegExpStringIterator, 'RegExp String', function next() { - var match = this._r.exec(this._s); - return { value: match, done: match === null }; -}); - -$export($export.P, 'String', { - matchAll: function matchAll(regexp) { - defined(this); - if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!'); - var S = String(this); - var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp); - var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags); - rx.lastIndex = toLength(regexp.lastIndex); - return new $RegExpStringIterator(rx, S); - } -}); diff --git a/node_modules/core-js/library/modules/es7.string.pad-end.js b/node_modules/core-js/library/modules/es7.string.pad-end.js deleted file mode 100644 index df55ce70b..000000000 --- a/node_modules/core-js/library/modules/es7.string.pad-end.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; -// https://github.com/tc39/proposal-string-pad-start-end -var $export = require('./_export'); -var $pad = require('./_string-pad'); -var userAgent = require('./_user-agent'); - -// https://github.com/zloirock/core-js/issues/280 -$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { - padEnd: function padEnd(maxLength /* , fillString = ' ' */) { - return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); - } -}); diff --git a/node_modules/core-js/library/modules/es7.string.pad-start.js b/node_modules/core-js/library/modules/es7.string.pad-start.js deleted file mode 100644 index 61549121d..000000000 --- a/node_modules/core-js/library/modules/es7.string.pad-start.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; -// https://github.com/tc39/proposal-string-pad-start-end -var $export = require('./_export'); -var $pad = require('./_string-pad'); -var userAgent = require('./_user-agent'); - -// https://github.com/zloirock/core-js/issues/280 -$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { - padStart: function padStart(maxLength /* , fillString = ' ' */) { - return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); - } -}); diff --git a/node_modules/core-js/library/modules/es7.string.trim-left.js b/node_modules/core-js/library/modules/es7.string.trim-left.js deleted file mode 100644 index 39a4b47cf..000000000 --- a/node_modules/core-js/library/modules/es7.string.trim-left.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// https://github.com/sebmarkbage/ecmascript-string-left-right-trim -require('./_string-trim')('trimLeft', function ($trim) { - return function trimLeft() { - return $trim(this, 1); - }; -}, 'trimStart'); diff --git a/node_modules/core-js/library/modules/es7.string.trim-right.js b/node_modules/core-js/library/modules/es7.string.trim-right.js deleted file mode 100644 index 7b7c45298..000000000 --- a/node_modules/core-js/library/modules/es7.string.trim-right.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// https://github.com/sebmarkbage/ecmascript-string-left-right-trim -require('./_string-trim')('trimRight', function ($trim) { - return function trimRight() { - return $trim(this, 2); - }; -}, 'trimEnd'); diff --git a/node_modules/core-js/library/modules/es7.symbol.async-iterator.js b/node_modules/core-js/library/modules/es7.symbol.async-iterator.js deleted file mode 100644 index f56dc2a8e..000000000 --- a/node_modules/core-js/library/modules/es7.symbol.async-iterator.js +++ /dev/null @@ -1 +0,0 @@ -require('./_wks-define')('asyncIterator'); diff --git a/node_modules/core-js/library/modules/es7.symbol.observable.js b/node_modules/core-js/library/modules/es7.symbol.observable.js deleted file mode 100644 index fc9a23761..000000000 --- a/node_modules/core-js/library/modules/es7.symbol.observable.js +++ /dev/null @@ -1 +0,0 @@ -require('./_wks-define')('observable'); diff --git a/node_modules/core-js/library/modules/es7.system.global.js b/node_modules/core-js/library/modules/es7.system.global.js deleted file mode 100644 index 310a802ad..000000000 --- a/node_modules/core-js/library/modules/es7.system.global.js +++ /dev/null @@ -1,4 +0,0 @@ -// https://github.com/tc39/proposal-global -var $export = require('./_export'); - -$export($export.S, 'System', { global: require('./_global') }); diff --git a/node_modules/core-js/library/modules/es7.weak-map.from.js b/node_modules/core-js/library/modules/es7.weak-map.from.js deleted file mode 100644 index 1a0136576..000000000 --- a/node_modules/core-js/library/modules/es7.weak-map.from.js +++ /dev/null @@ -1,2 +0,0 @@ -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from -require('./_set-collection-from')('WeakMap'); diff --git a/node_modules/core-js/library/modules/es7.weak-map.of.js b/node_modules/core-js/library/modules/es7.weak-map.of.js deleted file mode 100644 index 52c3f66df..000000000 --- a/node_modules/core-js/library/modules/es7.weak-map.of.js +++ /dev/null @@ -1,2 +0,0 @@ -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of -require('./_set-collection-of')('WeakMap'); diff --git a/node_modules/core-js/library/modules/es7.weak-set.from.js b/node_modules/core-js/library/modules/es7.weak-set.from.js deleted file mode 100644 index 493e5bee0..000000000 --- a/node_modules/core-js/library/modules/es7.weak-set.from.js +++ /dev/null @@ -1,2 +0,0 @@ -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from -require('./_set-collection-from')('WeakSet'); diff --git a/node_modules/core-js/library/modules/es7.weak-set.of.js b/node_modules/core-js/library/modules/es7.weak-set.of.js deleted file mode 100644 index 5941e72aa..000000000 --- a/node_modules/core-js/library/modules/es7.weak-set.of.js +++ /dev/null @@ -1,2 +0,0 @@ -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of -require('./_set-collection-of')('WeakSet'); diff --git a/node_modules/core-js/library/modules/web.dom.iterable.js b/node_modules/core-js/library/modules/web.dom.iterable.js deleted file mode 100644 index fc00afac4..000000000 --- a/node_modules/core-js/library/modules/web.dom.iterable.js +++ /dev/null @@ -1,19 +0,0 @@ -require('./es6.array.iterator'); -var global = require('./_global'); -var hide = require('./_hide'); -var Iterators = require('./_iterators'); -var TO_STRING_TAG = require('./_wks')('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; -} diff --git a/node_modules/core-js/library/modules/web.immediate.js b/node_modules/core-js/library/modules/web.immediate.js deleted file mode 100644 index 70f3e70da..000000000 --- a/node_modules/core-js/library/modules/web.immediate.js +++ /dev/null @@ -1,6 +0,0 @@ -var $export = require('./_export'); -var $task = require('./_task'); -$export($export.G + $export.B, { - setImmediate: $task.set, - clearImmediate: $task.clear -}); diff --git a/node_modules/core-js/library/modules/web.timers.js b/node_modules/core-js/library/modules/web.timers.js deleted file mode 100644 index c87908304..000000000 --- a/node_modules/core-js/library/modules/web.timers.js +++ /dev/null @@ -1,20 +0,0 @@ -// ie9- setTimeout & setInterval additional parameters fix -var global = require('./_global'); -var $export = require('./_export'); -var userAgent = require('./_user-agent'); -var slice = [].slice; -var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check -var wrap = function (set) { - return function (fn, time /* , ...args */) { - var boundArgs = arguments.length > 2; - var args = boundArgs ? slice.call(arguments, 2) : false; - return set(boundArgs ? function () { - // eslint-disable-next-line no-new-func - (typeof fn == 'function' ? fn : Function(fn)).apply(this, args); - } : fn, time); - }; -}; -$export($export.G + $export.B + $export.F * MSIE, { - setTimeout: wrap(global.setTimeout), - setInterval: wrap(global.setInterval) -}); diff --git a/node_modules/core-js/library/shim.js b/node_modules/core-js/library/shim.js deleted file mode 100644 index d865a2a3e..000000000 --- a/node_modules/core-js/library/shim.js +++ /dev/null @@ -1,197 +0,0 @@ -require('./modules/es6.symbol'); -require('./modules/es6.object.create'); -require('./modules/es6.object.define-property'); -require('./modules/es6.object.define-properties'); -require('./modules/es6.object.get-own-property-descriptor'); -require('./modules/es6.object.get-prototype-of'); -require('./modules/es6.object.keys'); -require('./modules/es6.object.get-own-property-names'); -require('./modules/es6.object.freeze'); -require('./modules/es6.object.seal'); -require('./modules/es6.object.prevent-extensions'); -require('./modules/es6.object.is-frozen'); -require('./modules/es6.object.is-sealed'); -require('./modules/es6.object.is-extensible'); -require('./modules/es6.object.assign'); -require('./modules/es6.object.is'); -require('./modules/es6.object.set-prototype-of'); -require('./modules/es6.object.to-string'); -require('./modules/es6.function.bind'); -require('./modules/es6.function.name'); -require('./modules/es6.function.has-instance'); -require('./modules/es6.parse-int'); -require('./modules/es6.parse-float'); -require('./modules/es6.number.constructor'); -require('./modules/es6.number.to-fixed'); -require('./modules/es6.number.to-precision'); -require('./modules/es6.number.epsilon'); -require('./modules/es6.number.is-finite'); -require('./modules/es6.number.is-integer'); -require('./modules/es6.number.is-nan'); -require('./modules/es6.number.is-safe-integer'); -require('./modules/es6.number.max-safe-integer'); -require('./modules/es6.number.min-safe-integer'); -require('./modules/es6.number.parse-float'); -require('./modules/es6.number.parse-int'); -require('./modules/es6.math.acosh'); -require('./modules/es6.math.asinh'); -require('./modules/es6.math.atanh'); -require('./modules/es6.math.cbrt'); -require('./modules/es6.math.clz32'); -require('./modules/es6.math.cosh'); -require('./modules/es6.math.expm1'); -require('./modules/es6.math.fround'); -require('./modules/es6.math.hypot'); -require('./modules/es6.math.imul'); -require('./modules/es6.math.log10'); -require('./modules/es6.math.log1p'); -require('./modules/es6.math.log2'); -require('./modules/es6.math.sign'); -require('./modules/es6.math.sinh'); -require('./modules/es6.math.tanh'); -require('./modules/es6.math.trunc'); -require('./modules/es6.string.from-code-point'); -require('./modules/es6.string.raw'); -require('./modules/es6.string.trim'); -require('./modules/es6.string.iterator'); -require('./modules/es6.string.code-point-at'); -require('./modules/es6.string.ends-with'); -require('./modules/es6.string.includes'); -require('./modules/es6.string.repeat'); -require('./modules/es6.string.starts-with'); -require('./modules/es6.string.anchor'); -require('./modules/es6.string.big'); -require('./modules/es6.string.blink'); -require('./modules/es6.string.bold'); -require('./modules/es6.string.fixed'); -require('./modules/es6.string.fontcolor'); -require('./modules/es6.string.fontsize'); -require('./modules/es6.string.italics'); -require('./modules/es6.string.link'); -require('./modules/es6.string.small'); -require('./modules/es6.string.strike'); -require('./modules/es6.string.sub'); -require('./modules/es6.string.sup'); -require('./modules/es6.date.now'); -require('./modules/es6.date.to-json'); -require('./modules/es6.date.to-iso-string'); -require('./modules/es6.date.to-string'); -require('./modules/es6.date.to-primitive'); -require('./modules/es6.array.is-array'); -require('./modules/es6.array.from'); -require('./modules/es6.array.of'); -require('./modules/es6.array.join'); -require('./modules/es6.array.slice'); -require('./modules/es6.array.sort'); -require('./modules/es6.array.for-each'); -require('./modules/es6.array.map'); -require('./modules/es6.array.filter'); -require('./modules/es6.array.some'); -require('./modules/es6.array.every'); -require('./modules/es6.array.reduce'); -require('./modules/es6.array.reduce-right'); -require('./modules/es6.array.index-of'); -require('./modules/es6.array.last-index-of'); -require('./modules/es6.array.copy-within'); -require('./modules/es6.array.fill'); -require('./modules/es6.array.find'); -require('./modules/es6.array.find-index'); -require('./modules/es6.array.species'); -require('./modules/es6.array.iterator'); -require('./modules/es6.regexp.constructor'); -require('./modules/es6.regexp.to-string'); -require('./modules/es6.regexp.flags'); -require('./modules/es6.regexp.match'); -require('./modules/es6.regexp.replace'); -require('./modules/es6.regexp.search'); -require('./modules/es6.regexp.split'); -require('./modules/es6.promise'); -require('./modules/es6.map'); -require('./modules/es6.set'); -require('./modules/es6.weak-map'); -require('./modules/es6.weak-set'); -require('./modules/es6.typed.array-buffer'); -require('./modules/es6.typed.data-view'); -require('./modules/es6.typed.int8-array'); -require('./modules/es6.typed.uint8-array'); -require('./modules/es6.typed.uint8-clamped-array'); -require('./modules/es6.typed.int16-array'); -require('./modules/es6.typed.uint16-array'); -require('./modules/es6.typed.int32-array'); -require('./modules/es6.typed.uint32-array'); -require('./modules/es6.typed.float32-array'); -require('./modules/es6.typed.float64-array'); -require('./modules/es6.reflect.apply'); -require('./modules/es6.reflect.construct'); -require('./modules/es6.reflect.define-property'); -require('./modules/es6.reflect.delete-property'); -require('./modules/es6.reflect.enumerate'); -require('./modules/es6.reflect.get'); -require('./modules/es6.reflect.get-own-property-descriptor'); -require('./modules/es6.reflect.get-prototype-of'); -require('./modules/es6.reflect.has'); -require('./modules/es6.reflect.is-extensible'); -require('./modules/es6.reflect.own-keys'); -require('./modules/es6.reflect.prevent-extensions'); -require('./modules/es6.reflect.set'); -require('./modules/es6.reflect.set-prototype-of'); -require('./modules/es7.array.includes'); -require('./modules/es7.array.flat-map'); -require('./modules/es7.array.flatten'); -require('./modules/es7.string.at'); -require('./modules/es7.string.pad-start'); -require('./modules/es7.string.pad-end'); -require('./modules/es7.string.trim-left'); -require('./modules/es7.string.trim-right'); -require('./modules/es7.string.match-all'); -require('./modules/es7.symbol.async-iterator'); -require('./modules/es7.symbol.observable'); -require('./modules/es7.object.get-own-property-descriptors'); -require('./modules/es7.object.values'); -require('./modules/es7.object.entries'); -require('./modules/es7.object.define-getter'); -require('./modules/es7.object.define-setter'); -require('./modules/es7.object.lookup-getter'); -require('./modules/es7.object.lookup-setter'); -require('./modules/es7.map.to-json'); -require('./modules/es7.set.to-json'); -require('./modules/es7.map.of'); -require('./modules/es7.set.of'); -require('./modules/es7.weak-map.of'); -require('./modules/es7.weak-set.of'); -require('./modules/es7.map.from'); -require('./modules/es7.set.from'); -require('./modules/es7.weak-map.from'); -require('./modules/es7.weak-set.from'); -require('./modules/es7.global'); -require('./modules/es7.system.global'); -require('./modules/es7.error.is-error'); -require('./modules/es7.math.clamp'); -require('./modules/es7.math.deg-per-rad'); -require('./modules/es7.math.degrees'); -require('./modules/es7.math.fscale'); -require('./modules/es7.math.iaddh'); -require('./modules/es7.math.isubh'); -require('./modules/es7.math.imulh'); -require('./modules/es7.math.rad-per-deg'); -require('./modules/es7.math.radians'); -require('./modules/es7.math.scale'); -require('./modules/es7.math.umulh'); -require('./modules/es7.math.signbit'); -require('./modules/es7.promise.finally'); -require('./modules/es7.promise.try'); -require('./modules/es7.reflect.define-metadata'); -require('./modules/es7.reflect.delete-metadata'); -require('./modules/es7.reflect.get-metadata'); -require('./modules/es7.reflect.get-metadata-keys'); -require('./modules/es7.reflect.get-own-metadata'); -require('./modules/es7.reflect.get-own-metadata-keys'); -require('./modules/es7.reflect.has-metadata'); -require('./modules/es7.reflect.has-own-metadata'); -require('./modules/es7.reflect.metadata'); -require('./modules/es7.asap'); -require('./modules/es7.observable'); -require('./modules/web.timers'); -require('./modules/web.immediate'); -require('./modules/web.dom.iterable'); -module.exports = require('./modules/_core'); diff --git a/node_modules/core-js/library/stage/0.js b/node_modules/core-js/library/stage/0.js deleted file mode 100644 index 4aa50704c..000000000 --- a/node_modules/core-js/library/stage/0.js +++ /dev/null @@ -1,10 +0,0 @@ -require('../modules/es7.string.at'); -require('../modules/es7.map.to-json'); -require('../modules/es7.set.to-json'); -require('../modules/es7.error.is-error'); -require('../modules/es7.math.iaddh'); -require('../modules/es7.math.isubh'); -require('../modules/es7.math.imulh'); -require('../modules/es7.math.umulh'); -require('../modules/es7.asap'); -module.exports = require('./1'); diff --git a/node_modules/core-js/library/stage/1.js b/node_modules/core-js/library/stage/1.js deleted file mode 100644 index 5f634d80b..000000000 --- a/node_modules/core-js/library/stage/1.js +++ /dev/null @@ -1,23 +0,0 @@ -require('../modules/es7.map.of'); -require('../modules/es7.set.of'); -require('../modules/es7.weak-map.of'); -require('../modules/es7.weak-set.of'); -require('../modules/es7.map.from'); -require('../modules/es7.set.from'); -require('../modules/es7.weak-map.from'); -require('../modules/es7.weak-set.from'); -require('../modules/es7.math.clamp'); -require('../modules/es7.math.deg-per-rad'); -require('../modules/es7.math.degrees'); -require('../modules/es7.math.fscale'); -require('../modules/es7.math.rad-per-deg'); -require('../modules/es7.math.radians'); -require('../modules/es7.math.scale'); -require('../modules/es7.math.signbit'); -require('../modules/es7.promise.try'); -require('../modules/es7.string.match-all'); -require('../modules/es7.symbol.observable'); -require('../modules/es7.observable'); -require('../modules/es7.array.flat-map'); -require('../modules/es7.array.flatten'); -module.exports = require('./2'); diff --git a/node_modules/core-js/library/stage/2.js b/node_modules/core-js/library/stage/2.js deleted file mode 100644 index d7aaa0ef9..000000000 --- a/node_modules/core-js/library/stage/2.js +++ /dev/null @@ -1,4 +0,0 @@ -require('../modules/es7.string.trim-left'); -require('../modules/es7.string.trim-right'); -require('../modules/es7.symbol.async-iterator'); -module.exports = require('./3'); diff --git a/node_modules/core-js/library/stage/3.js b/node_modules/core-js/library/stage/3.js deleted file mode 100644 index 9afd07fe9..000000000 --- a/node_modules/core-js/library/stage/3.js +++ /dev/null @@ -1,4 +0,0 @@ -require('../modules/es7.global'); -require('../modules/es7.system.global'); -require('../modules/es7.promise.finally'); -module.exports = require('./4'); diff --git a/node_modules/core-js/library/stage/4.js b/node_modules/core-js/library/stage/4.js deleted file mode 100644 index 875762a23..000000000 --- a/node_modules/core-js/library/stage/4.js +++ /dev/null @@ -1,11 +0,0 @@ -require('../modules/es7.object.define-getter'); -require('../modules/es7.object.define-setter'); -require('../modules/es7.object.lookup-getter'); -require('../modules/es7.object.lookup-setter'); -require('../modules/es7.object.values'); -require('../modules/es7.object.entries'); -require('../modules/es7.object.get-own-property-descriptors'); -require('../modules/es7.array.includes'); -require('../modules/es7.string.pad-start'); -require('../modules/es7.string.pad-end'); -module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/library/stage/index.js b/node_modules/core-js/library/stage/index.js deleted file mode 100644 index 24dcf2e56..000000000 --- a/node_modules/core-js/library/stage/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./pre'); diff --git a/node_modules/core-js/library/stage/pre.js b/node_modules/core-js/library/stage/pre.js deleted file mode 100644 index ed197a8ba..000000000 --- a/node_modules/core-js/library/stage/pre.js +++ /dev/null @@ -1,10 +0,0 @@ -require('../modules/es7.reflect.define-metadata'); -require('../modules/es7.reflect.delete-metadata'); -require('../modules/es7.reflect.get-metadata'); -require('../modules/es7.reflect.get-metadata-keys'); -require('../modules/es7.reflect.get-own-metadata'); -require('../modules/es7.reflect.get-own-metadata-keys'); -require('../modules/es7.reflect.has-metadata'); -require('../modules/es7.reflect.has-own-metadata'); -require('../modules/es7.reflect.metadata'); -module.exports = require('./0'); diff --git a/node_modules/core-js/library/web/dom-collections.js b/node_modules/core-js/library/web/dom-collections.js deleted file mode 100644 index a138bb9dd..000000000 --- a/node_modules/core-js/library/web/dom-collections.js +++ /dev/null @@ -1,2 +0,0 @@ -require('../modules/web.dom.iterable'); -module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/library/web/immediate.js b/node_modules/core-js/library/web/immediate.js deleted file mode 100644 index 6866abdeb..000000000 --- a/node_modules/core-js/library/web/immediate.js +++ /dev/null @@ -1,2 +0,0 @@ -require('../modules/web.immediate'); -module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/library/web/index.js b/node_modules/core-js/library/web/index.js deleted file mode 100644 index 66db256d6..000000000 --- a/node_modules/core-js/library/web/index.js +++ /dev/null @@ -1,4 +0,0 @@ -require('../modules/web.timers'); -require('../modules/web.immediate'); -require('../modules/web.dom.iterable'); -module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/library/web/timers.js b/node_modules/core-js/library/web/timers.js deleted file mode 100644 index a3f528e4d..000000000 --- a/node_modules/core-js/library/web/timers.js +++ /dev/null @@ -1,2 +0,0 @@ -require('../modules/web.timers'); -module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/modules/_a-function.js b/node_modules/core-js/modules/_a-function.js deleted file mode 100644 index a9a5d84ff..000000000 --- a/node_modules/core-js/modules/_a-function.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = function (it) { - if (typeof it != 'function') throw TypeError(it + ' is not a function!'); - return it; -}; diff --git a/node_modules/core-js/modules/_a-number-value.js b/node_modules/core-js/modules/_a-number-value.js deleted file mode 100644 index 2723de4d0..000000000 --- a/node_modules/core-js/modules/_a-number-value.js +++ /dev/null @@ -1,5 +0,0 @@ -var cof = require('./_cof'); -module.exports = function (it, msg) { - if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg); - return +it; -}; diff --git a/node_modules/core-js/modules/_add-to-unscopables.js b/node_modules/core-js/modules/_add-to-unscopables.js deleted file mode 100644 index a2dd97d99..000000000 --- a/node_modules/core-js/modules/_add-to-unscopables.js +++ /dev/null @@ -1,7 +0,0 @@ -// 22.1.3.31 Array.prototype[@@unscopables] -var UNSCOPABLES = require('./_wks')('unscopables'); -var ArrayProto = Array.prototype; -if (ArrayProto[UNSCOPABLES] == undefined) require('./_hide')(ArrayProto, UNSCOPABLES, {}); -module.exports = function (key) { - ArrayProto[UNSCOPABLES][key] = true; -}; diff --git a/node_modules/core-js/modules/_an-instance.js b/node_modules/core-js/modules/_an-instance.js deleted file mode 100644 index c0a5f9200..000000000 --- a/node_modules/core-js/modules/_an-instance.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = function (it, Constructor, name, forbiddenField) { - if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { - throw TypeError(name + ': incorrect invocation!'); - } return it; -}; diff --git a/node_modules/core-js/modules/_an-object.js b/node_modules/core-js/modules/_an-object.js deleted file mode 100644 index b1c316cd2..000000000 --- a/node_modules/core-js/modules/_an-object.js +++ /dev/null @@ -1,5 +0,0 @@ -var isObject = require('./_is-object'); -module.exports = function (it) { - if (!isObject(it)) throw TypeError(it + ' is not an object!'); - return it; -}; diff --git a/node_modules/core-js/modules/_array-copy-within.js b/node_modules/core-js/modules/_array-copy-within.js deleted file mode 100644 index d331576c4..000000000 --- a/node_modules/core-js/modules/_array-copy-within.js +++ /dev/null @@ -1,26 +0,0 @@ -// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) -'use strict'; -var toObject = require('./_to-object'); -var toAbsoluteIndex = require('./_to-absolute-index'); -var toLength = require('./_to-length'); - -module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { - var O = toObject(this); - var len = toLength(O.length); - var to = toAbsoluteIndex(target, len); - var from = toAbsoluteIndex(start, len); - var end = arguments.length > 2 ? arguments[2] : undefined; - var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); - var inc = 1; - if (from < to && to < from + count) { - inc = -1; - from += count - 1; - to += count - 1; - } - while (count-- > 0) { - if (from in O) O[to] = O[from]; - else delete O[to]; - to += inc; - from += inc; - } return O; -}; diff --git a/node_modules/core-js/modules/_array-fill.js b/node_modules/core-js/modules/_array-fill.js deleted file mode 100644 index 0753c36ac..000000000 --- a/node_modules/core-js/modules/_array-fill.js +++ /dev/null @@ -1,15 +0,0 @@ -// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) -'use strict'; -var toObject = require('./_to-object'); -var toAbsoluteIndex = require('./_to-absolute-index'); -var toLength = require('./_to-length'); -module.exports = function fill(value /* , start = 0, end = @length */) { - var O = toObject(this); - var length = toLength(O.length); - var aLen = arguments.length; - var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); - var end = aLen > 2 ? arguments[2] : undefined; - var endPos = end === undefined ? length : toAbsoluteIndex(end, length); - while (endPos > index) O[index++] = value; - return O; -}; diff --git a/node_modules/core-js/modules/_array-from-iterable.js b/node_modules/core-js/modules/_array-from-iterable.js deleted file mode 100644 index 08be255f0..000000000 --- a/node_modules/core-js/modules/_array-from-iterable.js +++ /dev/null @@ -1,7 +0,0 @@ -var forOf = require('./_for-of'); - -module.exports = function (iter, ITERATOR) { - var result = []; - forOf(iter, false, result.push, result, ITERATOR); - return result; -}; diff --git a/node_modules/core-js/modules/_array-includes.js b/node_modules/core-js/modules/_array-includes.js deleted file mode 100644 index 0ef3efebe..000000000 --- a/node_modules/core-js/modules/_array-includes.js +++ /dev/null @@ -1,23 +0,0 @@ -// false -> Array#indexOf -// true -> Array#includes -var toIObject = require('./_to-iobject'); -var toLength = require('./_to-length'); -var toAbsoluteIndex = require('./_to-absolute-index'); -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; - }; -}; diff --git a/node_modules/core-js/modules/_array-methods.js b/node_modules/core-js/modules/_array-methods.js deleted file mode 100644 index ae7f447da..000000000 --- a/node_modules/core-js/modules/_array-methods.js +++ /dev/null @@ -1,44 +0,0 @@ -// 0 -> Array#forEach -// 1 -> Array#map -// 2 -> Array#filter -// 3 -> Array#some -// 4 -> Array#every -// 5 -> Array#find -// 6 -> Array#findIndex -var ctx = require('./_ctx'); -var IObject = require('./_iobject'); -var toObject = require('./_to-object'); -var toLength = require('./_to-length'); -var asc = require('./_array-species-create'); -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; - }; -}; diff --git a/node_modules/core-js/modules/_array-reduce.js b/node_modules/core-js/modules/_array-reduce.js deleted file mode 100644 index 8596ac70a..000000000 --- a/node_modules/core-js/modules/_array-reduce.js +++ /dev/null @@ -1,28 +0,0 @@ -var aFunction = require('./_a-function'); -var toObject = require('./_to-object'); -var IObject = require('./_iobject'); -var toLength = require('./_to-length'); - -module.exports = function (that, callbackfn, aLen, memo, isRight) { - aFunction(callbackfn); - var O = toObject(that); - var self = IObject(O); - var length = toLength(O.length); - var index = isRight ? length - 1 : 0; - var i = isRight ? -1 : 1; - if (aLen < 2) for (;;) { - if (index in self) { - memo = self[index]; - index += i; - break; - } - index += i; - if (isRight ? index < 0 : length <= index) { - throw TypeError('Reduce of empty array with no initial value'); - } - } - for (;isRight ? index >= 0 : length > index; index += i) if (index in self) { - memo = callbackfn(memo, self[index], index, O); - } - return memo; -}; diff --git a/node_modules/core-js/modules/_array-species-constructor.js b/node_modules/core-js/modules/_array-species-constructor.js deleted file mode 100644 index 0771c236d..000000000 --- a/node_modules/core-js/modules/_array-species-constructor.js +++ /dev/null @@ -1,16 +0,0 @@ -var isObject = require('./_is-object'); -var isArray = require('./_is-array'); -var SPECIES = require('./_wks')('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; -}; diff --git a/node_modules/core-js/modules/_array-species-create.js b/node_modules/core-js/modules/_array-species-create.js deleted file mode 100644 index 36ed58bd7..000000000 --- a/node_modules/core-js/modules/_array-species-create.js +++ /dev/null @@ -1,6 +0,0 @@ -// 9.4.2.3 ArraySpeciesCreate(originalArray, length) -var speciesConstructor = require('./_array-species-constructor'); - -module.exports = function (original, length) { - return new (speciesConstructor(original))(length); -}; diff --git a/node_modules/core-js/modules/_bind.js b/node_modules/core-js/modules/_bind.js deleted file mode 100644 index 3cf1e5ae5..000000000 --- a/node_modules/core-js/modules/_bind.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; -var aFunction = require('./_a-function'); -var isObject = require('./_is-object'); -var invoke = require('./_invoke'); -var arraySlice = [].slice; -var factories = {}; - -var construct = function (F, len, args) { - if (!(len in factories)) { - for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']'; - // eslint-disable-next-line no-new-func - factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); - } return factories[len](F, args); -}; - -module.exports = Function.bind || function bind(that /* , ...args */) { - var fn = aFunction(this); - var partArgs = arraySlice.call(arguments, 1); - var bound = function (/* args... */) { - var args = partArgs.concat(arraySlice.call(arguments)); - return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); - }; - if (isObject(fn.prototype)) bound.prototype = fn.prototype; - return bound; -}; diff --git a/node_modules/core-js/modules/_classof.js b/node_modules/core-js/modules/_classof.js deleted file mode 100644 index d106d5be6..000000000 --- a/node_modules/core-js/modules/_classof.js +++ /dev/null @@ -1,23 +0,0 @@ -// getting tag from 19.1.3.6 Object.prototype.toString() -var cof = require('./_cof'); -var TAG = require('./_wks')('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; -}; diff --git a/node_modules/core-js/modules/_cof.js b/node_modules/core-js/modules/_cof.js deleted file mode 100644 index 332c0bc0b..000000000 --- a/node_modules/core-js/modules/_cof.js +++ /dev/null @@ -1,5 +0,0 @@ -var toString = {}.toString; - -module.exports = function (it) { - return toString.call(it).slice(8, -1); -}; diff --git a/node_modules/core-js/modules/_collection-strong.js b/node_modules/core-js/modules/_collection-strong.js deleted file mode 100644 index 68ce63f0e..000000000 --- a/node_modules/core-js/modules/_collection-strong.js +++ /dev/null @@ -1,144 +0,0 @@ -'use strict'; -var dP = require('./_object-dp').f; -var create = require('./_object-create'); -var redefineAll = require('./_redefine-all'); -var ctx = require('./_ctx'); -var anInstance = require('./_an-instance'); -var forOf = require('./_for-of'); -var $iterDefine = require('./_iter-define'); -var step = require('./_iter-step'); -var setSpecies = require('./_set-species'); -var DESCRIPTORS = require('./_descriptors'); -var fastKey = require('./_meta').fastKey; -var validate = require('./_validate-collection'); -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); - } -}; diff --git a/node_modules/core-js/modules/_collection-to-json.js b/node_modules/core-js/modules/_collection-to-json.js deleted file mode 100644 index a6ee0029a..000000000 --- a/node_modules/core-js/modules/_collection-to-json.js +++ /dev/null @@ -1,9 +0,0 @@ -// https://github.com/DavidBruant/Map-Set.prototype.toJSON -var classof = require('./_classof'); -var from = require('./_array-from-iterable'); -module.exports = function (NAME) { - return function toJSON() { - if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); - return from(this); - }; -}; diff --git a/node_modules/core-js/modules/_collection-weak.js b/node_modules/core-js/modules/_collection-weak.js deleted file mode 100644 index 04d3af5af..000000000 --- a/node_modules/core-js/modules/_collection-weak.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict'; -var redefineAll = require('./_redefine-all'); -var getWeak = require('./_meta').getWeak; -var anObject = require('./_an-object'); -var isObject = require('./_is-object'); -var anInstance = require('./_an-instance'); -var forOf = require('./_for-of'); -var createArrayMethod = require('./_array-methods'); -var $has = require('./_has'); -var validate = require('./_validate-collection'); -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 -}; diff --git a/node_modules/core-js/modules/_collection.js b/node_modules/core-js/modules/_collection.js deleted file mode 100644 index 767dde506..000000000 --- a/node_modules/core-js/modules/_collection.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict'; -var global = require('./_global'); -var $export = require('./_export'); -var redefine = require('./_redefine'); -var redefineAll = require('./_redefine-all'); -var meta = require('./_meta'); -var forOf = require('./_for-of'); -var anInstance = require('./_an-instance'); -var isObject = require('./_is-object'); -var fails = require('./_fails'); -var $iterDetect = require('./_iter-detect'); -var setToStringTag = require('./_set-to-string-tag'); -var inheritIfRequired = require('./_inherit-if-required'); - -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 = {}; - var fixMethod = function (KEY) { - var fn = proto[KEY]; - redefine(proto, KEY, - KEY == 'delete' ? function (a) { - return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); - } : KEY == 'has' ? function has(a) { - return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); - } : KEY == 'get' ? function get(a) { - return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); - } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; } - : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; } - ); - }; - if (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 { - var instance = new C(); - // early implementations not supports chaining - var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; - // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false - var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); - // most early implementations doesn't supports iterables, most modern - not close it correctly - var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new - // for early implementations -0 and +0 not the same - var BUGGY_ZERO = !IS_WEAK && fails(function () { - // V8 ~ Chromium 42- fails only with 5+ elements - var $instance = new C(); - var index = 5; - while (index--) $instance[ADDER](index, index); - return !$instance.has(-0); - }); - if (!ACCEPT_ITERABLES) { - C = wrapper(function (target, iterable) { - anInstance(target, C, NAME); - var that = inheritIfRequired(new Base(), target, C); - if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); - return that; - }); - C.prototype = proto; - proto.constructor = C; - } - if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { - fixMethod('delete'); - fixMethod('has'); - IS_MAP && fixMethod('get'); - } - if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); - // weak collections should not contains .clear method - if (IS_WEAK && proto.clear) delete proto.clear; - } - - setToStringTag(C, NAME); - - O[NAME] = C; - $export($export.G + $export.W + $export.F * (C != Base), O); - - if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); - - return C; -}; diff --git a/node_modules/core-js/modules/_core.js b/node_modules/core-js/modules/_core.js deleted file mode 100644 index c61ad5100..000000000 --- a/node_modules/core-js/modules/_core.js +++ /dev/null @@ -1,2 +0,0 @@ -var core = module.exports = { version: '2.5.7' }; -if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef diff --git a/node_modules/core-js/modules/_create-property.js b/node_modules/core-js/modules/_create-property.js deleted file mode 100644 index fd0ea8c9a..000000000 --- a/node_modules/core-js/modules/_create-property.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; -var $defineProperty = require('./_object-dp'); -var createDesc = require('./_property-desc'); - -module.exports = function (object, index, value) { - if (index in object) $defineProperty.f(object, index, createDesc(0, value)); - else object[index] = value; -}; diff --git a/node_modules/core-js/modules/_ctx.js b/node_modules/core-js/modules/_ctx.js deleted file mode 100644 index 0a100ff3d..000000000 --- a/node_modules/core-js/modules/_ctx.js +++ /dev/null @@ -1,20 +0,0 @@ -// optional / simple context binding -var aFunction = require('./_a-function'); -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); - }; -}; diff --git a/node_modules/core-js/modules/_date-to-iso-string.js b/node_modules/core-js/modules/_date-to-iso-string.js deleted file mode 100644 index 95a02e224..000000000 --- a/node_modules/core-js/modules/_date-to-iso-string.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; -// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() -var fails = require('./_fails'); -var getTime = Date.prototype.getTime; -var $toISOString = Date.prototype.toISOString; - -var lz = function (num) { - return num > 9 ? num : '0' + num; -}; - -// PhantomJS / old WebKit has a broken implementations -module.exports = (fails(function () { - return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; -}) || !fails(function () { - $toISOString.call(new Date(NaN)); -})) ? function toISOString() { - if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value'); - var d = this; - var y = d.getUTCFullYear(); - var m = d.getUTCMilliseconds(); - var s = y < 0 ? '-' : y > 9999 ? '+' : ''; - return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + - '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + - 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + - ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; -} : $toISOString; diff --git a/node_modules/core-js/modules/_date-to-primitive.js b/node_modules/core-js/modules/_date-to-primitive.js deleted file mode 100644 index 57c32030c..000000000 --- a/node_modules/core-js/modules/_date-to-primitive.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; -var anObject = require('./_an-object'); -var toPrimitive = require('./_to-primitive'); -var NUMBER = 'number'; - -module.exports = function (hint) { - if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint'); - return toPrimitive(anObject(this), hint != NUMBER); -}; diff --git a/node_modules/core-js/modules/_defined.js b/node_modules/core-js/modules/_defined.js deleted file mode 100644 index 66c7ed323..000000000 --- a/node_modules/core-js/modules/_defined.js +++ /dev/null @@ -1,5 +0,0 @@ -// 7.2.1 RequireObjectCoercible(argument) -module.exports = function (it) { - if (it == undefined) throw TypeError("Can't call method on " + it); - return it; -}; diff --git a/node_modules/core-js/modules/_descriptors.js b/node_modules/core-js/modules/_descriptors.js deleted file mode 100644 index 046974066..000000000 --- a/node_modules/core-js/modules/_descriptors.js +++ /dev/null @@ -1,4 +0,0 @@ -// Thank's IE8 for his funny defineProperty -module.exports = !require('./_fails')(function () { - return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; -}); diff --git a/node_modules/core-js/modules/_dom-create.js b/node_modules/core-js/modules/_dom-create.js deleted file mode 100644 index 39ca2569d..000000000 --- a/node_modules/core-js/modules/_dom-create.js +++ /dev/null @@ -1,7 +0,0 @@ -var isObject = require('./_is-object'); -var document = require('./_global').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) : {}; -}; diff --git a/node_modules/core-js/modules/_entry-virtual.js b/node_modules/core-js/modules/_entry-virtual.js deleted file mode 100644 index 7a734390a..000000000 --- a/node_modules/core-js/modules/_entry-virtual.js +++ /dev/null @@ -1,5 +0,0 @@ -var core = require('./_core'); -module.exports = function (CONSTRUCTOR) { - var C = core[CONSTRUCTOR]; - return (C.virtual || C.prototype); -}; diff --git a/node_modules/core-js/modules/_enum-bug-keys.js b/node_modules/core-js/modules/_enum-bug-keys.js deleted file mode 100644 index d9ad85514..000000000 --- a/node_modules/core-js/modules/_enum-bug-keys.js +++ /dev/null @@ -1,4 +0,0 @@ -// IE 8- don't enum bug keys -module.exports = ( - 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' -).split(','); diff --git a/node_modules/core-js/modules/_enum-keys.js b/node_modules/core-js/modules/_enum-keys.js deleted file mode 100644 index 3e7053d13..000000000 --- a/node_modules/core-js/modules/_enum-keys.js +++ /dev/null @@ -1,15 +0,0 @@ -// all enumerable object keys, includes symbols -var getKeys = require('./_object-keys'); -var gOPS = require('./_object-gops'); -var pIE = require('./_object-pie'); -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; -}; diff --git a/node_modules/core-js/modules/_export.js b/node_modules/core-js/modules/_export.js deleted file mode 100644 index 3c907c6ea..000000000 --- a/node_modules/core-js/modules/_export.js +++ /dev/null @@ -1,43 +0,0 @@ -var global = require('./_global'); -var core = require('./_core'); -var hide = require('./_hide'); -var redefine = require('./_redefine'); -var ctx = require('./_ctx'); -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 target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; - var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); - var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); - var key, own, out, exp; - if (IS_GLOBAL) source = name; - for (key in source) { - // contains in native - own = !IS_FORCED && target && target[key] !== undefined; - // export native or passed - out = (own ? target : source)[key]; - // bind timers to global for call from export context - exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; - // extend global - if (target) redefine(target, key, out, type & $export.U); - // export - if (exports[key] != out) hide(exports, key, exp); - if (IS_PROTO && expProto[key] != out) expProto[key] = out; - } -}; -global.core = core; -// 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; diff --git a/node_modules/core-js/modules/_fails-is-regexp.js b/node_modules/core-js/modules/_fails-is-regexp.js deleted file mode 100644 index 8eec2e471..000000000 --- a/node_modules/core-js/modules/_fails-is-regexp.js +++ /dev/null @@ -1,12 +0,0 @@ -var MATCH = require('./_wks')('match'); -module.exports = function (KEY) { - var re = /./; - try { - '/./'[KEY](re); - } catch (e) { - try { - re[MATCH] = false; - return !'/./'[KEY](re); - } catch (f) { /* empty */ } - } return true; -}; diff --git a/node_modules/core-js/modules/_fails.js b/node_modules/core-js/modules/_fails.js deleted file mode 100644 index 3b4cdf674..000000000 --- a/node_modules/core-js/modules/_fails.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = function (exec) { - try { - return !!exec(); - } catch (e) { - return true; - } -}; diff --git a/node_modules/core-js/modules/_fix-re-wks.js b/node_modules/core-js/modules/_fix-re-wks.js deleted file mode 100644 index 9a62380b3..000000000 --- a/node_modules/core-js/modules/_fix-re-wks.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; -var hide = require('./_hide'); -var redefine = require('./_redefine'); -var fails = require('./_fails'); -var defined = require('./_defined'); -var wks = require('./_wks'); - -module.exports = function (KEY, length, exec) { - var SYMBOL = wks(KEY); - var fns = exec(defined, SYMBOL, ''[KEY]); - var strfn = fns[0]; - var rxfn = fns[1]; - if (fails(function () { - var O = {}; - O[SYMBOL] = function () { return 7; }; - return ''[KEY](O) != 7; - })) { - redefine(String.prototype, KEY, strfn); - hide(RegExp.prototype, SYMBOL, length == 2 - // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) - // 21.2.5.11 RegExp.prototype[@@split](string, limit) - ? function (string, arg) { return rxfn.call(string, this, arg); } - // 21.2.5.6 RegExp.prototype[@@match](string) - // 21.2.5.9 RegExp.prototype[@@search](string) - : function (string) { return rxfn.call(string, this); } - ); - } -}; diff --git a/node_modules/core-js/modules/_flags.js b/node_modules/core-js/modules/_flags.js deleted file mode 100644 index b6fc324bd..000000000 --- a/node_modules/core-js/modules/_flags.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; -// 21.2.5.3 get RegExp.prototype.flags -var anObject = require('./_an-object'); -module.exports = function () { - var that = anObject(this); - var result = ''; - if (that.global) result += 'g'; - if (that.ignoreCase) result += 'i'; - if (that.multiline) result += 'm'; - if (that.unicode) result += 'u'; - if (that.sticky) result += 'y'; - return result; -}; diff --git a/node_modules/core-js/modules/_flatten-into-array.js b/node_modules/core-js/modules/_flatten-into-array.js deleted file mode 100644 index 1838517ae..000000000 --- a/node_modules/core-js/modules/_flatten-into-array.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; -// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray -var isArray = require('./_is-array'); -var isObject = require('./_is-object'); -var toLength = require('./_to-length'); -var ctx = require('./_ctx'); -var IS_CONCAT_SPREADABLE = require('./_wks')('isConcatSpreadable'); - -function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) { - var targetIndex = start; - var sourceIndex = 0; - var mapFn = mapper ? ctx(mapper, thisArg, 3) : false; - var element, spreadable; - - while (sourceIndex < sourceLen) { - if (sourceIndex in source) { - element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; - - spreadable = false; - if (isObject(element)) { - spreadable = element[IS_CONCAT_SPREADABLE]; - spreadable = spreadable !== undefined ? !!spreadable : isArray(element); - } - - if (spreadable && depth > 0) { - targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1; - } else { - if (targetIndex >= 0x1fffffffffffff) throw TypeError(); - target[targetIndex] = element; - } - - targetIndex++; - } - sourceIndex++; - } - return targetIndex; -} - -module.exports = flattenIntoArray; diff --git a/node_modules/core-js/modules/_for-of.js b/node_modules/core-js/modules/_for-of.js deleted file mode 100644 index 9ed22818b..000000000 --- a/node_modules/core-js/modules/_for-of.js +++ /dev/null @@ -1,25 +0,0 @@ -var ctx = require('./_ctx'); -var call = require('./_iter-call'); -var isArrayIter = require('./_is-array-iter'); -var anObject = require('./_an-object'); -var toLength = require('./_to-length'); -var getIterFn = require('./core.get-iterator-method'); -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; diff --git a/node_modules/core-js/modules/_global.js b/node_modules/core-js/modules/_global.js deleted file mode 100644 index bf85b44a1..000000000 --- a/node_modules/core-js/modules/_global.js +++ /dev/null @@ -1,6 +0,0 @@ -// 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 diff --git a/node_modules/core-js/modules/_has.js b/node_modules/core-js/modules/_has.js deleted file mode 100644 index 2a37d8b7a..000000000 --- a/node_modules/core-js/modules/_has.js +++ /dev/null @@ -1,4 +0,0 @@ -var hasOwnProperty = {}.hasOwnProperty; -module.exports = function (it, key) { - return hasOwnProperty.call(it, key); -}; diff --git a/node_modules/core-js/modules/_hide.js b/node_modules/core-js/modules/_hide.js deleted file mode 100644 index cec258a0a..000000000 --- a/node_modules/core-js/modules/_hide.js +++ /dev/null @@ -1,8 +0,0 @@ -var dP = require('./_object-dp'); -var createDesc = require('./_property-desc'); -module.exports = require('./_descriptors') ? function (object, key, value) { - return dP.f(object, key, createDesc(1, value)); -} : function (object, key, value) { - object[key] = value; - return object; -}; diff --git a/node_modules/core-js/modules/_html.js b/node_modules/core-js/modules/_html.js deleted file mode 100644 index 7daff14ca..000000000 --- a/node_modules/core-js/modules/_html.js +++ /dev/null @@ -1,2 +0,0 @@ -var document = require('./_global').document; -module.exports = document && document.documentElement; diff --git a/node_modules/core-js/modules/_ie8-dom-define.js b/node_modules/core-js/modules/_ie8-dom-define.js deleted file mode 100644 index a3805cb7f..000000000 --- a/node_modules/core-js/modules/_ie8-dom-define.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = !require('./_descriptors') && !require('./_fails')(function () { - return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7; -}); diff --git a/node_modules/core-js/modules/_inherit-if-required.js b/node_modules/core-js/modules/_inherit-if-required.js deleted file mode 100644 index b95fcd984..000000000 --- a/node_modules/core-js/modules/_inherit-if-required.js +++ /dev/null @@ -1,9 +0,0 @@ -var isObject = require('./_is-object'); -var setPrototypeOf = require('./_set-proto').set; -module.exports = function (that, target, C) { - var S = target.constructor; - var P; - if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { - setPrototypeOf(that, P); - } return that; -}; diff --git a/node_modules/core-js/modules/_invoke.js b/node_modules/core-js/modules/_invoke.js deleted file mode 100644 index 6cccebdc1..000000000 --- a/node_modules/core-js/modules/_invoke.js +++ /dev/null @@ -1,16 +0,0 @@ -// fast apply, http://jsperf.lnkit.com/fast-apply/5 -module.exports = function (fn, args, that) { - var un = that === undefined; - switch (args.length) { - case 0: return un ? fn() - : fn.call(that); - case 1: return un ? fn(args[0]) - : fn.call(that, args[0]); - case 2: return un ? fn(args[0], args[1]) - : fn.call(that, args[0], args[1]); - case 3: return un ? fn(args[0], args[1], args[2]) - : fn.call(that, args[0], args[1], args[2]); - case 4: return un ? fn(args[0], args[1], args[2], args[3]) - : fn.call(that, args[0], args[1], args[2], args[3]); - } return fn.apply(that, args); -}; diff --git a/node_modules/core-js/modules/_iobject.js b/node_modules/core-js/modules/_iobject.js deleted file mode 100644 index 2b57c8a07..000000000 --- a/node_modules/core-js/modules/_iobject.js +++ /dev/null @@ -1,6 +0,0 @@ -// fallback for non-array-like ES3 and non-enumerable old V8 strings -var cof = require('./_cof'); -// eslint-disable-next-line no-prototype-builtins -module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { - return cof(it) == 'String' ? it.split('') : Object(it); -}; diff --git a/node_modules/core-js/modules/_is-array-iter.js b/node_modules/core-js/modules/_is-array-iter.js deleted file mode 100644 index 6f67d9052..000000000 --- a/node_modules/core-js/modules/_is-array-iter.js +++ /dev/null @@ -1,8 +0,0 @@ -// check on default Array iterator -var Iterators = require('./_iterators'); -var ITERATOR = require('./_wks')('iterator'); -var ArrayProto = Array.prototype; - -module.exports = function (it) { - return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); -}; diff --git a/node_modules/core-js/modules/_is-array.js b/node_modules/core-js/modules/_is-array.js deleted file mode 100644 index 0581dc2e7..000000000 --- a/node_modules/core-js/modules/_is-array.js +++ /dev/null @@ -1,5 +0,0 @@ -// 7.2.2 IsArray(argument) -var cof = require('./_cof'); -module.exports = Array.isArray || function isArray(arg) { - return cof(arg) == 'Array'; -}; diff --git a/node_modules/core-js/modules/_is-integer.js b/node_modules/core-js/modules/_is-integer.js deleted file mode 100644 index 0074ae975..000000000 --- a/node_modules/core-js/modules/_is-integer.js +++ /dev/null @@ -1,6 +0,0 @@ -// 20.1.2.3 Number.isInteger(number) -var isObject = require('./_is-object'); -var floor = Math.floor; -module.exports = function isInteger(it) { - return !isObject(it) && isFinite(it) && floor(it) === it; -}; diff --git a/node_modules/core-js/modules/_is-object.js b/node_modules/core-js/modules/_is-object.js deleted file mode 100644 index dda6e04d2..000000000 --- a/node_modules/core-js/modules/_is-object.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function (it) { - return typeof it === 'object' ? it !== null : typeof it === 'function'; -}; diff --git a/node_modules/core-js/modules/_is-regexp.js b/node_modules/core-js/modules/_is-regexp.js deleted file mode 100644 index 598d159d5..000000000 --- a/node_modules/core-js/modules/_is-regexp.js +++ /dev/null @@ -1,8 +0,0 @@ -// 7.2.8 IsRegExp(argument) -var isObject = require('./_is-object'); -var cof = require('./_cof'); -var MATCH = require('./_wks')('match'); -module.exports = function (it) { - var isRegExp; - return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); -}; diff --git a/node_modules/core-js/modules/_iter-call.js b/node_modules/core-js/modules/_iter-call.js deleted file mode 100644 index a7026e347..000000000 --- a/node_modules/core-js/modules/_iter-call.js +++ /dev/null @@ -1,12 +0,0 @@ -// call something on iterator step with safe closing on error -var anObject = require('./_an-object'); -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; - } -}; diff --git a/node_modules/core-js/modules/_iter-create.js b/node_modules/core-js/modules/_iter-create.js deleted file mode 100644 index 04708c83c..000000000 --- a/node_modules/core-js/modules/_iter-create.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; -var create = require('./_object-create'); -var descriptor = require('./_property-desc'); -var setToStringTag = require('./_set-to-string-tag'); -var IteratorPrototype = {}; - -// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() -require('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; }); - -module.exports = function (Constructor, NAME, next) { - Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); - setToStringTag(Constructor, NAME + ' Iterator'); -}; diff --git a/node_modules/core-js/modules/_iter-define.js b/node_modules/core-js/modules/_iter-define.js deleted file mode 100644 index 578dfb734..000000000 --- a/node_modules/core-js/modules/_iter-define.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict'; -var LIBRARY = require('./_library'); -var $export = require('./_export'); -var redefine = require('./_redefine'); -var hide = require('./_hide'); -var Iterators = require('./_iterators'); -var $iterCreate = require('./_iter-create'); -var setToStringTag = require('./_set-to-string-tag'); -var getPrototypeOf = require('./_object-gpo'); -var ITERATOR = require('./_wks')('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; -}; diff --git a/node_modules/core-js/modules/_iter-detect.js b/node_modules/core-js/modules/_iter-detect.js deleted file mode 100644 index 5cb34973c..000000000 --- a/node_modules/core-js/modules/_iter-detect.js +++ /dev/null @@ -1,22 +0,0 @@ -var ITERATOR = require('./_wks')('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; -}; diff --git a/node_modules/core-js/modules/_iter-step.js b/node_modules/core-js/modules/_iter-step.js deleted file mode 100644 index b0691c883..000000000 --- a/node_modules/core-js/modules/_iter-step.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function (done, value) { - return { value: value, done: !!done }; -}; diff --git a/node_modules/core-js/modules/_iterators.js b/node_modules/core-js/modules/_iterators.js deleted file mode 100644 index f053ebf79..000000000 --- a/node_modules/core-js/modules/_iterators.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = {}; diff --git a/node_modules/core-js/modules/_keyof.js b/node_modules/core-js/modules/_keyof.js deleted file mode 100644 index 0786096fd..000000000 --- a/node_modules/core-js/modules/_keyof.js +++ /dev/null @@ -1,10 +0,0 @@ -var getKeys = require('./_object-keys'); -var toIObject = require('./_to-iobject'); -module.exports = function (object, el) { - var O = toIObject(object); - var keys = getKeys(O); - var length = keys.length; - var index = 0; - var key; - while (length > index) if (O[key = keys[index++]] === el) return key; -}; diff --git a/node_modules/core-js/modules/_library.js b/node_modules/core-js/modules/_library.js deleted file mode 100644 index a5d30209b..000000000 --- a/node_modules/core-js/modules/_library.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = false; diff --git a/node_modules/core-js/modules/_math-expm1.js b/node_modules/core-js/modules/_math-expm1.js deleted file mode 100644 index 75c685014..000000000 --- a/node_modules/core-js/modules/_math-expm1.js +++ /dev/null @@ -1,10 +0,0 @@ -// 20.2.2.14 Math.expm1(x) -var $expm1 = Math.expm1; -module.exports = (!$expm1 - // Old FF bug - || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 - // Tor Browser bug - || $expm1(-2e-17) != -2e-17 -) ? function expm1(x) { - return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; -} : $expm1; diff --git a/node_modules/core-js/modules/_math-fround.js b/node_modules/core-js/modules/_math-fround.js deleted file mode 100644 index c85eb4b7e..000000000 --- a/node_modules/core-js/modules/_math-fround.js +++ /dev/null @@ -1,23 +0,0 @@ -// 20.2.2.16 Math.fround(x) -var sign = require('./_math-sign'); -var pow = Math.pow; -var EPSILON = pow(2, -52); -var EPSILON32 = pow(2, -23); -var MAX32 = pow(2, 127) * (2 - EPSILON32); -var MIN32 = pow(2, -126); - -var roundTiesToEven = function (n) { - return n + 1 / EPSILON - 1 / EPSILON; -}; - -module.exports = Math.fround || function fround(x) { - var $abs = Math.abs(x); - var $sign = sign(x); - var a, result; - if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; - a = (1 + EPSILON32 / EPSILON) * $abs; - result = a - (a - $abs); - // eslint-disable-next-line no-self-compare - if (result > MAX32 || result != result) return $sign * Infinity; - return $sign * result; -}; diff --git a/node_modules/core-js/modules/_math-log1p.js b/node_modules/core-js/modules/_math-log1p.js deleted file mode 100644 index 16d5f4931..000000000 --- a/node_modules/core-js/modules/_math-log1p.js +++ /dev/null @@ -1,4 +0,0 @@ -// 20.2.2.20 Math.log1p(x) -module.exports = Math.log1p || function log1p(x) { - return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); -}; diff --git a/node_modules/core-js/modules/_math-scale.js b/node_modules/core-js/modules/_math-scale.js deleted file mode 100644 index ba3cdb20c..000000000 --- a/node_modules/core-js/modules/_math-scale.js +++ /dev/null @@ -1,18 +0,0 @@ -// https://rwaldron.github.io/proposal-math-extensions/ -module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) { - if ( - arguments.length === 0 - // eslint-disable-next-line no-self-compare - || x != x - // eslint-disable-next-line no-self-compare - || inLow != inLow - // eslint-disable-next-line no-self-compare - || inHigh != inHigh - // eslint-disable-next-line no-self-compare - || outLow != outLow - // eslint-disable-next-line no-self-compare - || outHigh != outHigh - ) return NaN; - if (x === Infinity || x === -Infinity) return x; - return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow; -}; diff --git a/node_modules/core-js/modules/_math-sign.js b/node_modules/core-js/modules/_math-sign.js deleted file mode 100644 index 7a46b9d08..000000000 --- a/node_modules/core-js/modules/_math-sign.js +++ /dev/null @@ -1,5 +0,0 @@ -// 20.2.2.28 Math.sign(x) -module.exports = Math.sign || function sign(x) { - // eslint-disable-next-line no-self-compare - return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; -}; diff --git a/node_modules/core-js/modules/_meta.js b/node_modules/core-js/modules/_meta.js deleted file mode 100644 index 2d4b32579..000000000 --- a/node_modules/core-js/modules/_meta.js +++ /dev/null @@ -1,53 +0,0 @@ -var META = require('./_uid')('meta'); -var isObject = require('./_is-object'); -var has = require('./_has'); -var setDesc = require('./_object-dp').f; -var id = 0; -var isExtensible = Object.isExtensible || function () { - return true; -}; -var FREEZE = !require('./_fails')(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 -}; diff --git a/node_modules/core-js/modules/_metadata.js b/node_modules/core-js/modules/_metadata.js deleted file mode 100644 index 759cfc445..000000000 --- a/node_modules/core-js/modules/_metadata.js +++ /dev/null @@ -1,51 +0,0 @@ -var Map = require('./es6.map'); -var $export = require('./_export'); -var shared = require('./_shared')('metadata'); -var store = shared.store || (shared.store = new (require('./es6.weak-map'))()); - -var getOrCreateMetadataMap = function (target, targetKey, create) { - var targetMetadata = store.get(target); - if (!targetMetadata) { - if (!create) return undefined; - store.set(target, targetMetadata = new Map()); - } - var keyMetadata = targetMetadata.get(targetKey); - if (!keyMetadata) { - if (!create) return undefined; - targetMetadata.set(targetKey, keyMetadata = new Map()); - } return keyMetadata; -}; -var ordinaryHasOwnMetadata = function (MetadataKey, O, P) { - var metadataMap = getOrCreateMetadataMap(O, P, false); - return metadataMap === undefined ? false : metadataMap.has(MetadataKey); -}; -var ordinaryGetOwnMetadata = function (MetadataKey, O, P) { - var metadataMap = getOrCreateMetadataMap(O, P, false); - return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); -}; -var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) { - getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); -}; -var ordinaryOwnMetadataKeys = function (target, targetKey) { - var metadataMap = getOrCreateMetadataMap(target, targetKey, false); - var keys = []; - if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); }); - return keys; -}; -var toMetaKey = function (it) { - return it === undefined || typeof it == 'symbol' ? it : String(it); -}; -var exp = function (O) { - $export($export.S, 'Reflect', O); -}; - -module.exports = { - store: store, - map: getOrCreateMetadataMap, - has: ordinaryHasOwnMetadata, - get: ordinaryGetOwnMetadata, - set: ordinaryDefineOwnMetadata, - keys: ordinaryOwnMetadataKeys, - key: toMetaKey, - exp: exp -}; diff --git a/node_modules/core-js/modules/_microtask.js b/node_modules/core-js/modules/_microtask.js deleted file mode 100644 index b321c648c..000000000 --- a/node_modules/core-js/modules/_microtask.js +++ /dev/null @@ -1,69 +0,0 @@ -var global = require('./_global'); -var macrotask = require('./_task').set; -var Observer = global.MutationObserver || global.WebKitMutationObserver; -var process = global.process; -var Promise = global.Promise; -var isNode = require('./_cof')(process) == 'process'; - -module.exports = function () { - var head, last, notify; - - var flush = function () { - var parent, fn; - if (isNode && (parent = process.domain)) parent.exit(); - while (head) { - fn = head.fn; - head = head.next; - try { - fn(); - } catch (e) { - if (head) notify(); - else last = undefined; - throw e; - } - } last = undefined; - if (parent) parent.enter(); - }; - - // Node.js - if (isNode) { - notify = function () { - process.nextTick(flush); - }; - // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 - } else if (Observer && !(global.navigator && global.navigator.standalone)) { - var toggle = true; - var node = document.createTextNode(''); - new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new - notify = function () { - node.data = toggle = !toggle; - }; - // environments with maybe non-completely correct, but existent Promise - } else if (Promise && Promise.resolve) { - // Promise.resolve without an argument throws an error in LG WebOS 2 - var promise = Promise.resolve(undefined); - notify = function () { - promise.then(flush); - }; - // for other environments - macrotask based on: - // - setImmediate - // - MessageChannel - // - window.postMessag - // - onreadystatechange - // - setTimeout - } else { - notify = function () { - // strange IE + webpack dev server bug - use .call(global) - macrotask.call(global, flush); - }; - } - - return function (fn) { - var task = { fn: fn, next: undefined }; - if (last) last.next = task; - if (!head) { - head = task; - notify(); - } last = task; - }; -}; diff --git a/node_modules/core-js/modules/_new-promise-capability.js b/node_modules/core-js/modules/_new-promise-capability.js deleted file mode 100644 index 82b74a331..000000000 --- a/node_modules/core-js/modules/_new-promise-capability.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; -// 25.4.1.5 NewPromiseCapability(C) -var aFunction = require('./_a-function'); - -function PromiseCapability(C) { - var resolve, reject; - this.promise = new C(function ($$resolve, $$reject) { - if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); - resolve = $$resolve; - reject = $$reject; - }); - this.resolve = aFunction(resolve); - this.reject = aFunction(reject); -} - -module.exports.f = function (C) { - return new PromiseCapability(C); -}; diff --git a/node_modules/core-js/modules/_object-assign.js b/node_modules/core-js/modules/_object-assign.js deleted file mode 100644 index 7d4943a2a..000000000 --- a/node_modules/core-js/modules/_object-assign.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; -// 19.1.2.1 Object.assign(target, source, ...) -var getKeys = require('./_object-keys'); -var gOPS = require('./_object-gops'); -var pIE = require('./_object-pie'); -var toObject = require('./_to-object'); -var IObject = require('./_iobject'); -var $assign = Object.assign; - -// should work with symbols and should have deterministic property order (V8 bug) -module.exports = !$assign || require('./_fails')(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) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; - } return T; -} : $assign; diff --git a/node_modules/core-js/modules/_object-create.js b/node_modules/core-js/modules/_object-create.js deleted file mode 100644 index a76808ea6..000000000 --- a/node_modules/core-js/modules/_object-create.js +++ /dev/null @@ -1,41 +0,0 @@ -// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -var anObject = require('./_an-object'); -var dPs = require('./_object-dps'); -var enumBugKeys = require('./_enum-bug-keys'); -var IE_PROTO = require('./_shared-key')('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 = require('./_dom-create')('iframe'); - var i = enumBugKeys.length; - var lt = '<'; - var gt = '>'; - var iframeDocument; - iframe.style.display = 'none'; - require('./_html').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); -}; diff --git a/node_modules/core-js/modules/_object-define.js b/node_modules/core-js/modules/_object-define.js deleted file mode 100644 index 4d131f331..000000000 --- a/node_modules/core-js/modules/_object-define.js +++ /dev/null @@ -1,13 +0,0 @@ -var dP = require('./_object-dp'); -var gOPD = require('./_object-gopd'); -var ownKeys = require('./_own-keys'); -var toIObject = require('./_to-iobject'); - -module.exports = function define(target, mixin) { - var keys = ownKeys(toIObject(mixin)); - var length = keys.length; - var i = 0; - var key; - while (length > i) dP.f(target, key = keys[i++], gOPD.f(mixin, key)); - return target; -}; diff --git a/node_modules/core-js/modules/_object-dp.js b/node_modules/core-js/modules/_object-dp.js deleted file mode 100644 index 0340a8308..000000000 --- a/node_modules/core-js/modules/_object-dp.js +++ /dev/null @@ -1,16 +0,0 @@ -var anObject = require('./_an-object'); -var IE8_DOM_DEFINE = require('./_ie8-dom-define'); -var toPrimitive = require('./_to-primitive'); -var dP = Object.defineProperty; - -exports.f = require('./_descriptors') ? 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; -}; diff --git a/node_modules/core-js/modules/_object-dps.js b/node_modules/core-js/modules/_object-dps.js deleted file mode 100644 index 173c338ff..000000000 --- a/node_modules/core-js/modules/_object-dps.js +++ /dev/null @@ -1,13 +0,0 @@ -var dP = require('./_object-dp'); -var anObject = require('./_an-object'); -var getKeys = require('./_object-keys'); - -module.exports = require('./_descriptors') ? 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; -}; diff --git a/node_modules/core-js/modules/_object-forced-pam.js b/node_modules/core-js/modules/_object-forced-pam.js deleted file mode 100644 index 71ede9225..000000000 --- a/node_modules/core-js/modules/_object-forced-pam.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; -// Forced replacement prototype accessors methods -module.exports = require('./_library') || !require('./_fails')(function () { - var K = Math.random(); - // In FF throws only define methods - // eslint-disable-next-line no-undef, no-useless-call - __defineSetter__.call(null, K, function () { /* empty */ }); - delete require('./_global')[K]; -}); diff --git a/node_modules/core-js/modules/_object-gopd.js b/node_modules/core-js/modules/_object-gopd.js deleted file mode 100644 index 555dd31a5..000000000 --- a/node_modules/core-js/modules/_object-gopd.js +++ /dev/null @@ -1,16 +0,0 @@ -var pIE = require('./_object-pie'); -var createDesc = require('./_property-desc'); -var toIObject = require('./_to-iobject'); -var toPrimitive = require('./_to-primitive'); -var has = require('./_has'); -var IE8_DOM_DEFINE = require('./_ie8-dom-define'); -var gOPD = Object.getOwnPropertyDescriptor; - -exports.f = require('./_descriptors') ? 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]); -}; diff --git a/node_modules/core-js/modules/_object-gopn-ext.js b/node_modules/core-js/modules/_object-gopn-ext.js deleted file mode 100644 index 4abb6ae83..000000000 --- a/node_modules/core-js/modules/_object-gopn-ext.js +++ /dev/null @@ -1,19 +0,0 @@ -// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window -var toIObject = require('./_to-iobject'); -var gOPN = require('./_object-gopn').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)); -}; diff --git a/node_modules/core-js/modules/_object-gopn.js b/node_modules/core-js/modules/_object-gopn.js deleted file mode 100644 index da82333f6..000000000 --- a/node_modules/core-js/modules/_object-gopn.js +++ /dev/null @@ -1,7 +0,0 @@ -// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) -var $keys = require('./_object-keys-internal'); -var hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype'); - -exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { - return $keys(O, hiddenKeys); -}; diff --git a/node_modules/core-js/modules/_object-gops.js b/node_modules/core-js/modules/_object-gops.js deleted file mode 100644 index bc0672905..000000000 --- a/node_modules/core-js/modules/_object-gops.js +++ /dev/null @@ -1 +0,0 @@ -exports.f = Object.getOwnPropertySymbols; diff --git a/node_modules/core-js/modules/_object-gpo.js b/node_modules/core-js/modules/_object-gpo.js deleted file mode 100644 index 27f2a94e8..000000000 --- a/node_modules/core-js/modules/_object-gpo.js +++ /dev/null @@ -1,13 +0,0 @@ -// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) -var has = require('./_has'); -var toObject = require('./_to-object'); -var IE_PROTO = require('./_shared-key')('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; -}; diff --git a/node_modules/core-js/modules/_object-keys-internal.js b/node_modules/core-js/modules/_object-keys-internal.js deleted file mode 100644 index 71abdd1a5..000000000 --- a/node_modules/core-js/modules/_object-keys-internal.js +++ /dev/null @@ -1,17 +0,0 @@ -var has = require('./_has'); -var toIObject = require('./_to-iobject'); -var arrayIndexOf = require('./_array-includes')(false); -var IE_PROTO = require('./_shared-key')('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; -}; diff --git a/node_modules/core-js/modules/_object-keys.js b/node_modules/core-js/modules/_object-keys.js deleted file mode 100644 index 62f73f91e..000000000 --- a/node_modules/core-js/modules/_object-keys.js +++ /dev/null @@ -1,7 +0,0 @@ -// 19.1.2.14 / 15.2.3.14 Object.keys(O) -var $keys = require('./_object-keys-internal'); -var enumBugKeys = require('./_enum-bug-keys'); - -module.exports = Object.keys || function keys(O) { - return $keys(O, enumBugKeys); -}; diff --git a/node_modules/core-js/modules/_object-pie.js b/node_modules/core-js/modules/_object-pie.js deleted file mode 100644 index 4cc71072d..000000000 --- a/node_modules/core-js/modules/_object-pie.js +++ /dev/null @@ -1 +0,0 @@ -exports.f = {}.propertyIsEnumerable; diff --git a/node_modules/core-js/modules/_object-sap.js b/node_modules/core-js/modules/_object-sap.js deleted file mode 100644 index 643535e0a..000000000 --- a/node_modules/core-js/modules/_object-sap.js +++ /dev/null @@ -1,10 +0,0 @@ -// most Object methods by ES6 should accept primitives -var $export = require('./_export'); -var core = require('./_core'); -var fails = require('./_fails'); -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); -}; diff --git a/node_modules/core-js/modules/_object-to-array.js b/node_modules/core-js/modules/_object-to-array.js deleted file mode 100644 index 120100d09..000000000 --- a/node_modules/core-js/modules/_object-to-array.js +++ /dev/null @@ -1,16 +0,0 @@ -var getKeys = require('./_object-keys'); -var toIObject = require('./_to-iobject'); -var isEnum = require('./_object-pie').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) if (isEnum.call(O, key = keys[i++])) { - result.push(isEntries ? [key, O[key]] : O[key]); - } return result; - }; -}; diff --git a/node_modules/core-js/modules/_own-keys.js b/node_modules/core-js/modules/_own-keys.js deleted file mode 100644 index 84faece8f..000000000 --- a/node_modules/core-js/modules/_own-keys.js +++ /dev/null @@ -1,10 +0,0 @@ -// all object keys, includes non-enumerable and symbols -var gOPN = require('./_object-gopn'); -var gOPS = require('./_object-gops'); -var anObject = require('./_an-object'); -var Reflect = require('./_global').Reflect; -module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { - var keys = gOPN.f(anObject(it)); - var getSymbols = gOPS.f; - return getSymbols ? keys.concat(getSymbols(it)) : keys; -}; diff --git a/node_modules/core-js/modules/_parse-float.js b/node_modules/core-js/modules/_parse-float.js deleted file mode 100644 index acfb350f9..000000000 --- a/node_modules/core-js/modules/_parse-float.js +++ /dev/null @@ -1,8 +0,0 @@ -var $parseFloat = require('./_global').parseFloat; -var $trim = require('./_string-trim').trim; - -module.exports = 1 / $parseFloat(require('./_string-ws') + '-0') !== -Infinity ? function parseFloat(str) { - var string = $trim(String(str), 3); - var result = $parseFloat(string); - return result === 0 && string.charAt(0) == '-' ? -0 : result; -} : $parseFloat; diff --git a/node_modules/core-js/modules/_parse-int.js b/node_modules/core-js/modules/_parse-int.js deleted file mode 100644 index ddd7172a9..000000000 --- a/node_modules/core-js/modules/_parse-int.js +++ /dev/null @@ -1,9 +0,0 @@ -var $parseInt = require('./_global').parseInt; -var $trim = require('./_string-trim').trim; -var ws = require('./_string-ws'); -var hex = /^[-+]?0[xX]/; - -module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) { - var string = $trim(String(str), 3); - return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); -} : $parseInt; diff --git a/node_modules/core-js/modules/_partial.js b/node_modules/core-js/modules/_partial.js deleted file mode 100644 index ca3f35bf8..000000000 --- a/node_modules/core-js/modules/_partial.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; -var path = require('./_path'); -var invoke = require('./_invoke'); -var aFunction = require('./_a-function'); -module.exports = function (/* ...pargs */) { - var fn = aFunction(this); - var length = arguments.length; - var pargs = new Array(length); - var i = 0; - var _ = path._; - var holder = false; - while (length > i) if ((pargs[i] = arguments[i++]) === _) holder = true; - return function (/* ...args */) { - var that = this; - var aLen = arguments.length; - var j = 0; - var k = 0; - var args; - if (!holder && !aLen) return invoke(fn, pargs, that); - args = pargs.slice(); - if (holder) for (;length > j; j++) if (args[j] === _) args[j] = arguments[k++]; - while (aLen > k) args.push(arguments[k++]); - return invoke(fn, args, that); - }; -}; diff --git a/node_modules/core-js/modules/_path.js b/node_modules/core-js/modules/_path.js deleted file mode 100644 index 754592ada..000000000 --- a/node_modules/core-js/modules/_path.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./_global'); diff --git a/node_modules/core-js/modules/_perform.js b/node_modules/core-js/modules/_perform.js deleted file mode 100644 index bfc7b296d..000000000 --- a/node_modules/core-js/modules/_perform.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = function (exec) { - try { - return { e: false, v: exec() }; - } catch (e) { - return { e: true, v: e }; - } -}; diff --git a/node_modules/core-js/modules/_promise-resolve.js b/node_modules/core-js/modules/_promise-resolve.js deleted file mode 100644 index c3cac7646..000000000 --- a/node_modules/core-js/modules/_promise-resolve.js +++ /dev/null @@ -1,12 +0,0 @@ -var anObject = require('./_an-object'); -var isObject = require('./_is-object'); -var newPromiseCapability = require('./_new-promise-capability'); - -module.exports = function (C, x) { - anObject(C); - if (isObject(x) && x.constructor === C) return x; - var promiseCapability = newPromiseCapability.f(C); - var resolve = promiseCapability.resolve; - resolve(x); - return promiseCapability.promise; -}; diff --git a/node_modules/core-js/modules/_property-desc.js b/node_modules/core-js/modules/_property-desc.js deleted file mode 100644 index 090593405..000000000 --- a/node_modules/core-js/modules/_property-desc.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = function (bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value: value - }; -}; diff --git a/node_modules/core-js/modules/_redefine-all.js b/node_modules/core-js/modules/_redefine-all.js deleted file mode 100644 index dcf7944f5..000000000 --- a/node_modules/core-js/modules/_redefine-all.js +++ /dev/null @@ -1,5 +0,0 @@ -var redefine = require('./_redefine'); -module.exports = function (target, src, safe) { - for (var key in src) redefine(target, key, src[key], safe); - return target; -}; diff --git a/node_modules/core-js/modules/_redefine.js b/node_modules/core-js/modules/_redefine.js deleted file mode 100644 index b7ba9f30e..000000000 --- a/node_modules/core-js/modules/_redefine.js +++ /dev/null @@ -1,31 +0,0 @@ -var global = require('./_global'); -var hide = require('./_hide'); -var has = require('./_has'); -var SRC = require('./_uid')('src'); -var TO_STRING = 'toString'; -var $toString = Function[TO_STRING]; -var TPL = ('' + $toString).split(TO_STRING); - -require('./_core').inspectSource = function (it) { - return $toString.call(it); -}; - -(module.exports = function (O, key, val, safe) { - var isFunction = typeof val == 'function'; - if (isFunction) has(val, 'name') || hide(val, 'name', key); - if (O[key] === val) return; - if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); - if (O === global) { - O[key] = val; - } else if (!safe) { - delete O[key]; - hide(O, key, val); - } else if (O[key]) { - O[key] = val; - } else { - hide(O, key, val); - } -// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative -})(Function.prototype, TO_STRING, function toString() { - return typeof this == 'function' && this[SRC] || $toString.call(this); -}); diff --git a/node_modules/core-js/modules/_replacer.js b/node_modules/core-js/modules/_replacer.js deleted file mode 100644 index c37703dd2..000000000 --- a/node_modules/core-js/modules/_replacer.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = function (regExp, replace) { - var replacer = replace === Object(replace) ? function (part) { - return replace[part]; - } : replace; - return function (it) { - return String(it).replace(regExp, replacer); - }; -}; diff --git a/node_modules/core-js/modules/_same-value.js b/node_modules/core-js/modules/_same-value.js deleted file mode 100644 index c6d045e83..000000000 --- a/node_modules/core-js/modules/_same-value.js +++ /dev/null @@ -1,5 +0,0 @@ -// 7.2.9 SameValue(x, y) -module.exports = Object.is || function is(x, y) { - // eslint-disable-next-line no-self-compare - return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; -}; diff --git a/node_modules/core-js/modules/_set-collection-from.js b/node_modules/core-js/modules/_set-collection-from.js deleted file mode 100644 index d5001f93e..000000000 --- a/node_modules/core-js/modules/_set-collection-from.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; -// https://tc39.github.io/proposal-setmap-offrom/ -var $export = require('./_export'); -var aFunction = require('./_a-function'); -var ctx = require('./_ctx'); -var forOf = require('./_for-of'); - -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); - } }); -}; diff --git a/node_modules/core-js/modules/_set-collection-of.js b/node_modules/core-js/modules/_set-collection-of.js deleted file mode 100644 index f559af3fc..000000000 --- a/node_modules/core-js/modules/_set-collection-of.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; -// https://tc39.github.io/proposal-setmap-offrom/ -var $export = require('./_export'); - -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); - } }); -}; diff --git a/node_modules/core-js/modules/_set-proto.js b/node_modules/core-js/modules/_set-proto.js deleted file mode 100644 index c1990622e..000000000 --- a/node_modules/core-js/modules/_set-proto.js +++ /dev/null @@ -1,25 +0,0 @@ -// Works with __proto__ only. Old v8 can't work with null proto objects. -/* eslint-disable no-proto */ -var isObject = require('./_is-object'); -var anObject = require('./_an-object'); -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 = require('./_ctx')(Function.call, require('./_object-gopd').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 -}; diff --git a/node_modules/core-js/modules/_set-species.js b/node_modules/core-js/modules/_set-species.js deleted file mode 100644 index 2d505d2aa..000000000 --- a/node_modules/core-js/modules/_set-species.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; -var global = require('./_global'); -var dP = require('./_object-dp'); -var DESCRIPTORS = require('./_descriptors'); -var SPECIES = require('./_wks')('species'); - -module.exports = function (KEY) { - var C = global[KEY]; - if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { - configurable: true, - get: function () { return this; } - }); -}; diff --git a/node_modules/core-js/modules/_set-to-string-tag.js b/node_modules/core-js/modules/_set-to-string-tag.js deleted file mode 100644 index 5bd64144f..000000000 --- a/node_modules/core-js/modules/_set-to-string-tag.js +++ /dev/null @@ -1,7 +0,0 @@ -var def = require('./_object-dp').f; -var has = require('./_has'); -var TAG = require('./_wks')('toStringTag'); - -module.exports = function (it, tag, stat) { - if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); -}; diff --git a/node_modules/core-js/modules/_shared-key.js b/node_modules/core-js/modules/_shared-key.js deleted file mode 100644 index d47fe7a28..000000000 --- a/node_modules/core-js/modules/_shared-key.js +++ /dev/null @@ -1,5 +0,0 @@ -var shared = require('./_shared')('keys'); -var uid = require('./_uid'); -module.exports = function (key) { - return shared[key] || (shared[key] = uid(key)); -}; diff --git a/node_modules/core-js/modules/_shared.js b/node_modules/core-js/modules/_shared.js deleted file mode 100644 index 2c6abc22e..000000000 --- a/node_modules/core-js/modules/_shared.js +++ /dev/null @@ -1,12 +0,0 @@ -var core = require('./_core'); -var global = require('./_global'); -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: require('./_library') ? 'pure' : 'global', - copyright: '© 2018 Denis Pushkarev (zloirock.ru)' -}); diff --git a/node_modules/core-js/modules/_species-constructor.js b/node_modules/core-js/modules/_species-constructor.js deleted file mode 100644 index 0cb4ffb8f..000000000 --- a/node_modules/core-js/modules/_species-constructor.js +++ /dev/null @@ -1,9 +0,0 @@ -// 7.3.20 SpeciesConstructor(O, defaultConstructor) -var anObject = require('./_an-object'); -var aFunction = require('./_a-function'); -var SPECIES = require('./_wks')('species'); -module.exports = function (O, D) { - var C = anObject(O).constructor; - var S; - return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); -}; diff --git a/node_modules/core-js/modules/_strict-method.js b/node_modules/core-js/modules/_strict-method.js deleted file mode 100644 index e68f41bb6..000000000 --- a/node_modules/core-js/modules/_strict-method.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; -var fails = require('./_fails'); - -module.exports = function (method, arg) { - return !!method && fails(function () { - // eslint-disable-next-line no-useless-call - arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null); - }); -}; diff --git a/node_modules/core-js/modules/_string-at.js b/node_modules/core-js/modules/_string-at.js deleted file mode 100644 index 88d66bd18..000000000 --- a/node_modules/core-js/modules/_string-at.js +++ /dev/null @@ -1,17 +0,0 @@ -var toInteger = require('./_to-integer'); -var defined = require('./_defined'); -// 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; - }; -}; diff --git a/node_modules/core-js/modules/_string-context.js b/node_modules/core-js/modules/_string-context.js deleted file mode 100644 index becf3fbeb..000000000 --- a/node_modules/core-js/modules/_string-context.js +++ /dev/null @@ -1,8 +0,0 @@ -// helper for String#{startsWith, endsWith, includes} -var isRegExp = require('./_is-regexp'); -var defined = require('./_defined'); - -module.exports = function (that, searchString, NAME) { - if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); - return String(defined(that)); -}; diff --git a/node_modules/core-js/modules/_string-html.js b/node_modules/core-js/modules/_string-html.js deleted file mode 100644 index 1dcc95bcd..000000000 --- a/node_modules/core-js/modules/_string-html.js +++ /dev/null @@ -1,19 +0,0 @@ -var $export = require('./_export'); -var fails = require('./_fails'); -var defined = require('./_defined'); -var quot = /"/g; -// B.2.3.2.1 CreateHTML(string, tag, attribute, value) -var createHTML = function (string, tag, attribute, value) { - var S = String(defined(string)); - var p1 = '<' + tag; - if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; - return p1 + '>' + S + ''; -}; -module.exports = function (NAME, exec) { - var O = {}; - O[NAME] = exec(createHTML); - $export($export.P + $export.F * fails(function () { - var test = ''[NAME]('"'); - return test !== test.toLowerCase() || test.split('"').length > 3; - }), 'String', O); -}; diff --git a/node_modules/core-js/modules/_string-pad.js b/node_modules/core-js/modules/_string-pad.js deleted file mode 100644 index ceb6077f0..000000000 --- a/node_modules/core-js/modules/_string-pad.js +++ /dev/null @@ -1,16 +0,0 @@ -// https://github.com/tc39/proposal-string-pad-start-end -var toLength = require('./_to-length'); -var repeat = require('./_string-repeat'); -var defined = require('./_defined'); - -module.exports = function (that, maxLength, fillString, left) { - var S = String(defined(that)); - var stringLength = S.length; - var fillStr = fillString === undefined ? ' ' : String(fillString); - var intMaxLength = toLength(maxLength); - if (intMaxLength <= stringLength || fillStr == '') return S; - var fillLen = intMaxLength - stringLength; - var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); - if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); - return left ? stringFiller + S : S + stringFiller; -}; diff --git a/node_modules/core-js/modules/_string-repeat.js b/node_modules/core-js/modules/_string-repeat.js deleted file mode 100644 index a69b9626b..000000000 --- a/node_modules/core-js/modules/_string-repeat.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; -var toInteger = require('./_to-integer'); -var defined = require('./_defined'); - -module.exports = function repeat(count) { - var str = String(defined(this)); - var res = ''; - var n = toInteger(count); - if (n < 0 || n == Infinity) throw RangeError("Count can't be negative"); - for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str; - return res; -}; diff --git a/node_modules/core-js/modules/_string-trim.js b/node_modules/core-js/modules/_string-trim.js deleted file mode 100644 index 6b54a81a8..000000000 --- a/node_modules/core-js/modules/_string-trim.js +++ /dev/null @@ -1,30 +0,0 @@ -var $export = require('./_export'); -var defined = require('./_defined'); -var fails = require('./_fails'); -var spaces = require('./_string-ws'); -var space = '[' + spaces + ']'; -var non = '\u200b\u0085'; -var ltrim = RegExp('^' + space + space + '*'); -var rtrim = RegExp(space + space + '*$'); - -var exporter = function (KEY, exec, ALIAS) { - var exp = {}; - var FORCE = fails(function () { - return !!spaces[KEY]() || non[KEY]() != non; - }); - var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; - if (ALIAS) exp[ALIAS] = fn; - $export($export.P + $export.F * FORCE, 'String', exp); -}; - -// 1 -> String#trimLeft -// 2 -> String#trimRight -// 3 -> String#trim -var trim = exporter.trim = function (string, TYPE) { - string = String(defined(string)); - if (TYPE & 1) string = string.replace(ltrim, ''); - if (TYPE & 2) string = string.replace(rtrim, ''); - return string; -}; - -module.exports = exporter; diff --git a/node_modules/core-js/modules/_string-ws.js b/node_modules/core-js/modules/_string-ws.js deleted file mode 100644 index 2c68cf9f4..000000000 --- a/node_modules/core-js/modules/_string-ws.js +++ /dev/null @@ -1,2 +0,0 @@ -module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + - '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; diff --git a/node_modules/core-js/modules/_task.js b/node_modules/core-js/modules/_task.js deleted file mode 100644 index 8777a6e28..000000000 --- a/node_modules/core-js/modules/_task.js +++ /dev/null @@ -1,84 +0,0 @@ -var ctx = require('./_ctx'); -var invoke = require('./_invoke'); -var html = require('./_html'); -var cel = require('./_dom-create'); -var global = require('./_global'); -var process = global.process; -var setTask = global.setImmediate; -var clearTask = global.clearImmediate; -var MessageChannel = global.MessageChannel; -var Dispatch = global.Dispatch; -var counter = 0; -var queue = {}; -var ONREADYSTATECHANGE = 'onreadystatechange'; -var defer, channel, port; -var run = function () { - var id = +this; - // eslint-disable-next-line no-prototype-builtins - if (queue.hasOwnProperty(id)) { - var fn = queue[id]; - delete queue[id]; - fn(); - } -}; -var listener = function (event) { - run.call(event.data); -}; -// Node.js 0.9+ & IE10+ has setImmediate, otherwise: -if (!setTask || !clearTask) { - setTask = function setImmediate(fn) { - var args = []; - var i = 1; - while (arguments.length > i) args.push(arguments[i++]); - queue[++counter] = function () { - // eslint-disable-next-line no-new-func - invoke(typeof fn == 'function' ? fn : Function(fn), args); - }; - defer(counter); - return counter; - }; - clearTask = function clearImmediate(id) { - delete queue[id]; - }; - // Node.js 0.8- - if (require('./_cof')(process) == 'process') { - defer = function (id) { - process.nextTick(ctx(run, id, 1)); - }; - // Sphere (JS game engine) Dispatch API - } else if (Dispatch && Dispatch.now) { - defer = function (id) { - Dispatch.now(ctx(run, id, 1)); - }; - // Browsers with MessageChannel, includes WebWorkers - } else if (MessageChannel) { - channel = new MessageChannel(); - port = channel.port2; - channel.port1.onmessage = listener; - defer = ctx(port.postMessage, port, 1); - // Browsers with postMessage, skip WebWorkers - // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' - } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { - defer = function (id) { - global.postMessage(id + '', '*'); - }; - global.addEventListener('message', listener, false); - // IE8- - } else if (ONREADYSTATECHANGE in cel('script')) { - defer = function (id) { - html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { - html.removeChild(this); - run.call(id); - }; - }; - // Rest old browsers - } else { - defer = function (id) { - setTimeout(ctx(run, id, 1), 0); - }; - } -} -module.exports = { - set: setTask, - clear: clearTask -}; diff --git a/node_modules/core-js/modules/_to-absolute-index.js b/node_modules/core-js/modules/_to-absolute-index.js deleted file mode 100644 index dfee02e8e..000000000 --- a/node_modules/core-js/modules/_to-absolute-index.js +++ /dev/null @@ -1,7 +0,0 @@ -var toInteger = require('./_to-integer'); -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); -}; diff --git a/node_modules/core-js/modules/_to-index.js b/node_modules/core-js/modules/_to-index.js deleted file mode 100644 index 8f51c32d2..000000000 --- a/node_modules/core-js/modules/_to-index.js +++ /dev/null @@ -1,10 +0,0 @@ -// https://tc39.github.io/ecma262/#sec-toindex -var toInteger = require('./_to-integer'); -var toLength = require('./_to-length'); -module.exports = function (it) { - if (it === undefined) return 0; - var number = toInteger(it); - var length = toLength(number); - if (number !== length) throw RangeError('Wrong length!'); - return length; -}; diff --git a/node_modules/core-js/modules/_to-integer.js b/node_modules/core-js/modules/_to-integer.js deleted file mode 100644 index 3d50f97dd..000000000 --- a/node_modules/core-js/modules/_to-integer.js +++ /dev/null @@ -1,6 +0,0 @@ -// 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); -}; diff --git a/node_modules/core-js/modules/_to-iobject.js b/node_modules/core-js/modules/_to-iobject.js deleted file mode 100644 index 7614503a2..000000000 --- a/node_modules/core-js/modules/_to-iobject.js +++ /dev/null @@ -1,6 +0,0 @@ -// to indexed object, toObject with fallback for non-array-like ES3 strings -var IObject = require('./_iobject'); -var defined = require('./_defined'); -module.exports = function (it) { - return IObject(defined(it)); -}; diff --git a/node_modules/core-js/modules/_to-length.js b/node_modules/core-js/modules/_to-length.js deleted file mode 100644 index a9db50173..000000000 --- a/node_modules/core-js/modules/_to-length.js +++ /dev/null @@ -1,6 +0,0 @@ -// 7.1.15 ToLength -var toInteger = require('./_to-integer'); -var min = Math.min; -module.exports = function (it) { - return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 -}; diff --git a/node_modules/core-js/modules/_to-object.js b/node_modules/core-js/modules/_to-object.js deleted file mode 100644 index 0efea4c69..000000000 --- a/node_modules/core-js/modules/_to-object.js +++ /dev/null @@ -1,5 +0,0 @@ -// 7.1.13 ToObject(argument) -var defined = require('./_defined'); -module.exports = function (it) { - return Object(defined(it)); -}; diff --git a/node_modules/core-js/modules/_to-primitive.js b/node_modules/core-js/modules/_to-primitive.js deleted file mode 100644 index de3dd6b19..000000000 --- a/node_modules/core-js/modules/_to-primitive.js +++ /dev/null @@ -1,12 +0,0 @@ -// 7.1.1 ToPrimitive(input [, PreferredType]) -var isObject = require('./_is-object'); -// 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"); -}; diff --git a/node_modules/core-js/modules/_typed-array.js b/node_modules/core-js/modules/_typed-array.js deleted file mode 100644 index 30d9c0ba5..000000000 --- a/node_modules/core-js/modules/_typed-array.js +++ /dev/null @@ -1,480 +0,0 @@ -'use strict'; -if (require('./_descriptors')) { - var LIBRARY = require('./_library'); - var global = require('./_global'); - var fails = require('./_fails'); - var $export = require('./_export'); - var $typed = require('./_typed'); - var $buffer = require('./_typed-buffer'); - var ctx = require('./_ctx'); - var anInstance = require('./_an-instance'); - var propertyDesc = require('./_property-desc'); - var hide = require('./_hide'); - var redefineAll = require('./_redefine-all'); - var toInteger = require('./_to-integer'); - var toLength = require('./_to-length'); - var toIndex = require('./_to-index'); - var toAbsoluteIndex = require('./_to-absolute-index'); - var toPrimitive = require('./_to-primitive'); - var has = require('./_has'); - var classof = require('./_classof'); - var isObject = require('./_is-object'); - var toObject = require('./_to-object'); - var isArrayIter = require('./_is-array-iter'); - var create = require('./_object-create'); - var getPrototypeOf = require('./_object-gpo'); - var gOPN = require('./_object-gopn').f; - var getIterFn = require('./core.get-iterator-method'); - var uid = require('./_uid'); - var wks = require('./_wks'); - var createArrayMethod = require('./_array-methods'); - var createArrayIncludes = require('./_array-includes'); - var speciesConstructor = require('./_species-constructor'); - var ArrayIterators = require('./es6.array.iterator'); - var Iterators = require('./_iterators'); - var $iterDetect = require('./_iter-detect'); - var setSpecies = require('./_set-species'); - var arrayFill = require('./_array-fill'); - var arrayCopyWithin = require('./_array-copy-within'); - var $DP = require('./_object-dp'); - var $GOPD = require('./_object-gopd'); - var dP = $DP.f; - var gOPD = $GOPD.f; - var RangeError = global.RangeError; - var TypeError = global.TypeError; - var Uint8Array = global.Uint8Array; - var ARRAY_BUFFER = 'ArrayBuffer'; - var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER; - var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; - var PROTOTYPE = 'prototype'; - var ArrayProto = Array[PROTOTYPE]; - var $ArrayBuffer = $buffer.ArrayBuffer; - var $DataView = $buffer.DataView; - var arrayForEach = createArrayMethod(0); - var arrayFilter = createArrayMethod(2); - var arraySome = createArrayMethod(3); - var arrayEvery = createArrayMethod(4); - var arrayFind = createArrayMethod(5); - var arrayFindIndex = createArrayMethod(6); - var arrayIncludes = createArrayIncludes(true); - var arrayIndexOf = createArrayIncludes(false); - var arrayValues = ArrayIterators.values; - var arrayKeys = ArrayIterators.keys; - var arrayEntries = ArrayIterators.entries; - var arrayLastIndexOf = ArrayProto.lastIndexOf; - var arrayReduce = ArrayProto.reduce; - var arrayReduceRight = ArrayProto.reduceRight; - var arrayJoin = ArrayProto.join; - var arraySort = ArrayProto.sort; - var arraySlice = ArrayProto.slice; - var arrayToString = ArrayProto.toString; - var arrayToLocaleString = ArrayProto.toLocaleString; - var ITERATOR = wks('iterator'); - var TAG = wks('toStringTag'); - var TYPED_CONSTRUCTOR = uid('typed_constructor'); - var DEF_CONSTRUCTOR = uid('def_constructor'); - var ALL_CONSTRUCTORS = $typed.CONSTR; - var TYPED_ARRAY = $typed.TYPED; - var VIEW = $typed.VIEW; - var WRONG_LENGTH = 'Wrong length!'; - - var $map = createArrayMethod(1, function (O, length) { - return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); - }); - - var LITTLE_ENDIAN = fails(function () { - // eslint-disable-next-line no-undef - return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; - }); - - var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () { - new Uint8Array(1).set({}); - }); - - var toOffset = function (it, BYTES) { - var offset = toInteger(it); - if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!'); - return offset; - }; - - var validate = function (it) { - if (isObject(it) && TYPED_ARRAY in it) return it; - throw TypeError(it + ' is not a typed array!'); - }; - - var allocate = function (C, length) { - if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) { - throw TypeError('It is not a typed array constructor!'); - } return new C(length); - }; - - var speciesFromList = function (O, list) { - return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); - }; - - var fromList = function (C, list) { - var index = 0; - var length = list.length; - var result = allocate(C, length); - while (length > index) result[index] = list[index++]; - return result; - }; - - var addGetter = function (it, key, internal) { - dP(it, key, { get: function () { return this._d[internal]; } }); - }; - - var $from = function from(source /* , mapfn, thisArg */) { - var O = toObject(source); - var aLen = arguments.length; - var mapfn = aLen > 1 ? arguments[1] : undefined; - var mapping = mapfn !== undefined; - var iterFn = getIterFn(O); - var i, length, values, result, step, iterator; - if (iterFn != undefined && !isArrayIter(iterFn)) { - for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) { - values.push(step.value); - } O = values; - } - if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2); - for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) { - result[i] = mapping ? mapfn(O[i], i) : O[i]; - } - return result; - }; - - var $of = function of(/* ...items */) { - var index = 0; - var length = arguments.length; - var result = allocate(this, length); - while (length > index) result[index] = arguments[index++]; - return result; - }; - - // iOS Safari 6.x fails here - var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); }); - - var $toLocaleString = function toLocaleString() { - return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); - }; - - var proto = { - copyWithin: function copyWithin(target, start /* , end */) { - return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); - }, - every: function every(callbackfn /* , thisArg */) { - return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }, - fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars - return arrayFill.apply(validate(this), arguments); - }, - filter: function filter(callbackfn /* , thisArg */) { - return speciesFromList(this, arrayFilter(validate(this), callbackfn, - arguments.length > 1 ? arguments[1] : undefined)); - }, - find: function find(predicate /* , thisArg */) { - return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); - }, - findIndex: function findIndex(predicate /* , thisArg */) { - return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); - }, - forEach: function forEach(callbackfn /* , thisArg */) { - arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }, - indexOf: function indexOf(searchElement /* , fromIndex */) { - return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); - }, - includes: function includes(searchElement /* , fromIndex */) { - return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); - }, - join: function join(separator) { // eslint-disable-line no-unused-vars - return arrayJoin.apply(validate(this), arguments); - }, - lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars - return arrayLastIndexOf.apply(validate(this), arguments); - }, - map: function map(mapfn /* , thisArg */) { - return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); - }, - reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars - return arrayReduce.apply(validate(this), arguments); - }, - reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars - return arrayReduceRight.apply(validate(this), arguments); - }, - reverse: function reverse() { - var that = this; - var length = validate(that).length; - var middle = Math.floor(length / 2); - var index = 0; - var value; - while (index < middle) { - value = that[index]; - that[index++] = that[--length]; - that[length] = value; - } return that; - }, - some: function some(callbackfn /* , thisArg */) { - return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - }, - sort: function sort(comparefn) { - return arraySort.call(validate(this), comparefn); - }, - subarray: function subarray(begin, end) { - var O = validate(this); - var length = O.length; - var $begin = toAbsoluteIndex(begin, length); - return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( - O.buffer, - O.byteOffset + $begin * O.BYTES_PER_ELEMENT, - toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin) - ); - } - }; - - var $slice = function slice(start, end) { - return speciesFromList(this, arraySlice.call(validate(this), start, end)); - }; - - var $set = function set(arrayLike /* , offset */) { - validate(this); - var offset = toOffset(arguments[1], 1); - var length = this.length; - var src = toObject(arrayLike); - var len = toLength(src.length); - var index = 0; - if (len + offset > length) throw RangeError(WRONG_LENGTH); - while (index < len) this[offset + index] = src[index++]; - }; - - var $iterators = { - entries: function entries() { - return arrayEntries.call(validate(this)); - }, - keys: function keys() { - return arrayKeys.call(validate(this)); - }, - values: function values() { - return arrayValues.call(validate(this)); - } - }; - - var isTAIndex = function (target, key) { - return isObject(target) - && target[TYPED_ARRAY] - && typeof key != 'symbol' - && key in target - && String(+key) == String(key); - }; - var $getDesc = function getOwnPropertyDescriptor(target, key) { - return isTAIndex(target, key = toPrimitive(key, true)) - ? propertyDesc(2, target[key]) - : gOPD(target, key); - }; - var $setDesc = function defineProperty(target, key, desc) { - if (isTAIndex(target, key = toPrimitive(key, true)) - && isObject(desc) - && has(desc, 'value') - && !has(desc, 'get') - && !has(desc, 'set') - // TODO: add validation descriptor w/o calling accessors - && !desc.configurable - && (!has(desc, 'writable') || desc.writable) - && (!has(desc, 'enumerable') || desc.enumerable) - ) { - target[key] = desc.value; - return target; - } return dP(target, key, desc); - }; - - if (!ALL_CONSTRUCTORS) { - $GOPD.f = $getDesc; - $DP.f = $setDesc; - } - - $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { - getOwnPropertyDescriptor: $getDesc, - defineProperty: $setDesc - }); - - if (fails(function () { arrayToString.call({}); })) { - arrayToString = arrayToLocaleString = function toString() { - return arrayJoin.call(this); - }; - } - - var $TypedArrayPrototype$ = redefineAll({}, proto); - redefineAll($TypedArrayPrototype$, $iterators); - hide($TypedArrayPrototype$, ITERATOR, $iterators.values); - redefineAll($TypedArrayPrototype$, { - slice: $slice, - set: $set, - constructor: function () { /* noop */ }, - toString: arrayToString, - toLocaleString: $toLocaleString - }); - addGetter($TypedArrayPrototype$, 'buffer', 'b'); - addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); - addGetter($TypedArrayPrototype$, 'byteLength', 'l'); - addGetter($TypedArrayPrototype$, 'length', 'e'); - dP($TypedArrayPrototype$, TAG, { - get: function () { return this[TYPED_ARRAY]; } - }); - - // eslint-disable-next-line max-statements - module.exports = function (KEY, BYTES, wrapper, CLAMPED) { - CLAMPED = !!CLAMPED; - var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'; - var GETTER = 'get' + KEY; - var SETTER = 'set' + KEY; - var TypedArray = global[NAME]; - var Base = TypedArray || {}; - var TAC = TypedArray && getPrototypeOf(TypedArray); - var FORCED = !TypedArray || !$typed.ABV; - var O = {}; - var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; - var getter = function (that, index) { - var data = that._d; - return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); - }; - var setter = function (that, index, value) { - var data = that._d; - if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; - data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); - }; - var addElement = function (that, index) { - dP(that, index, { - get: function () { - return getter(this, index); - }, - set: function (value) { - return setter(this, index, value); - }, - enumerable: true - }); - }; - if (FORCED) { - TypedArray = wrapper(function (that, data, $offset, $length) { - anInstance(that, TypedArray, NAME, '_d'); - var index = 0; - var offset = 0; - var buffer, byteLength, length, klass; - if (!isObject(data)) { - length = toIndex(data); - byteLength = length * BYTES; - buffer = new $ArrayBuffer(byteLength); - } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { - buffer = data; - offset = toOffset($offset, BYTES); - var $len = data.byteLength; - if ($length === undefined) { - if ($len % BYTES) throw RangeError(WRONG_LENGTH); - byteLength = $len - offset; - if (byteLength < 0) throw RangeError(WRONG_LENGTH); - } else { - byteLength = toLength($length) * BYTES; - if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH); - } - length = byteLength / BYTES; - } else if (TYPED_ARRAY in data) { - return fromList(TypedArray, data); - } else { - return $from.call(TypedArray, data); - } - hide(that, '_d', { - b: buffer, - o: offset, - l: byteLength, - e: length, - v: new $DataView(buffer) - }); - while (index < length) addElement(that, index++); - }); - TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); - hide(TypedArrayPrototype, 'constructor', TypedArray); - } else if (!fails(function () { - TypedArray(1); - }) || !fails(function () { - new TypedArray(-1); // eslint-disable-line no-new - }) || !$iterDetect(function (iter) { - new TypedArray(); // eslint-disable-line no-new - new TypedArray(null); // eslint-disable-line no-new - new TypedArray(1.5); // eslint-disable-line no-new - new TypedArray(iter); // eslint-disable-line no-new - }, true)) { - TypedArray = wrapper(function (that, data, $offset, $length) { - anInstance(that, TypedArray, NAME); - var klass; - // `ws` module bug, temporarily remove validation length for Uint8Array - // https://github.com/websockets/ws/pull/645 - if (!isObject(data)) return new Base(toIndex(data)); - if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { - return $length !== undefined - ? new Base(data, toOffset($offset, BYTES), $length) - : $offset !== undefined - ? new Base(data, toOffset($offset, BYTES)) - : new Base(data); - } - if (TYPED_ARRAY in data) return fromList(TypedArray, data); - return $from.call(TypedArray, data); - }); - arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) { - if (!(key in TypedArray)) hide(TypedArray, key, Base[key]); - }); - TypedArray[PROTOTYPE] = TypedArrayPrototype; - if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray; - } - var $nativeIterator = TypedArrayPrototype[ITERATOR]; - var CORRECT_ITER_NAME = !!$nativeIterator - && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined); - var $iterator = $iterators.values; - hide(TypedArray, TYPED_CONSTRUCTOR, true); - hide(TypedArrayPrototype, TYPED_ARRAY, NAME); - hide(TypedArrayPrototype, VIEW, true); - hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); - - if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) { - dP(TypedArrayPrototype, TAG, { - get: function () { return NAME; } - }); - } - - O[NAME] = TypedArray; - - $export($export.G + $export.W + $export.F * (TypedArray != Base), O); - - $export($export.S, NAME, { - BYTES_PER_ELEMENT: BYTES - }); - - $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, { - from: $from, - of: $of - }); - - if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); - - $export($export.P, NAME, proto); - - setSpecies(NAME); - - $export($export.P + $export.F * FORCED_SET, NAME, { set: $set }); - - $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); - - if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString; - - $export($export.P + $export.F * fails(function () { - new TypedArray(1).slice(); - }), NAME, { slice: $slice }); - - $export($export.P + $export.F * (fails(function () { - return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString(); - }) || !fails(function () { - TypedArrayPrototype.toLocaleString.call([1, 2]); - })), NAME, { toLocaleString: $toLocaleString }); - - Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; - if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator); - }; -} else module.exports = function () { /* empty */ }; diff --git a/node_modules/core-js/modules/_typed-buffer.js b/node_modules/core-js/modules/_typed-buffer.js deleted file mode 100644 index c24cef38c..000000000 --- a/node_modules/core-js/modules/_typed-buffer.js +++ /dev/null @@ -1,276 +0,0 @@ -'use strict'; -var global = require('./_global'); -var DESCRIPTORS = require('./_descriptors'); -var LIBRARY = require('./_library'); -var $typed = require('./_typed'); -var hide = require('./_hide'); -var redefineAll = require('./_redefine-all'); -var fails = require('./_fails'); -var anInstance = require('./_an-instance'); -var toInteger = require('./_to-integer'); -var toLength = require('./_to-length'); -var toIndex = require('./_to-index'); -var gOPN = require('./_object-gopn').f; -var dP = require('./_object-dp').f; -var arrayFill = require('./_array-fill'); -var setToStringTag = require('./_set-to-string-tag'); -var ARRAY_BUFFER = 'ArrayBuffer'; -var DATA_VIEW = 'DataView'; -var PROTOTYPE = 'prototype'; -var WRONG_LENGTH = 'Wrong length!'; -var WRONG_INDEX = 'Wrong index!'; -var $ArrayBuffer = global[ARRAY_BUFFER]; -var $DataView = global[DATA_VIEW]; -var Math = global.Math; -var RangeError = global.RangeError; -// eslint-disable-next-line no-shadow-restricted-names -var Infinity = global.Infinity; -var BaseBuffer = $ArrayBuffer; -var abs = Math.abs; -var pow = Math.pow; -var floor = Math.floor; -var log = Math.log; -var LN2 = Math.LN2; -var BUFFER = 'buffer'; -var BYTE_LENGTH = 'byteLength'; -var BYTE_OFFSET = 'byteOffset'; -var $BUFFER = DESCRIPTORS ? '_b' : BUFFER; -var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH; -var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; - -// IEEE754 conversions based on https://github.com/feross/ieee754 -function packIEEE754(value, mLen, nBytes) { - var buffer = new Array(nBytes); - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0; - var i = 0; - var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; - var e, m, c; - value = abs(value); - // eslint-disable-next-line no-self-compare - if (value != value || value === Infinity) { - // eslint-disable-next-line no-self-compare - m = value != value ? 1 : 0; - e = eMax; - } else { - e = floor(log(value) / LN2); - if (value * (c = pow(2, -e)) < 1) { - e--; - c *= 2; - } - if (e + eBias >= 1) { - value += rt / c; - } else { - value += rt * pow(2, 1 - eBias); - } - if (value * c >= 2) { - e++; - c /= 2; - } - if (e + eBias >= eMax) { - m = 0; - e = eMax; - } else if (e + eBias >= 1) { - m = (value * c - 1) * pow(2, mLen); - e = e + eBias; - } else { - m = value * pow(2, eBias - 1) * pow(2, mLen); - e = 0; - } - } - for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); - e = e << mLen | m; - eLen += mLen; - for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); - buffer[--i] |= s * 128; - return buffer; -} -function unpackIEEE754(buffer, mLen, nBytes) { - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var nBits = eLen - 7; - var i = nBytes - 1; - var s = buffer[i--]; - var e = s & 127; - var m; - s >>= 7; - for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); - m = e & (1 << -nBits) - 1; - e >>= -nBits; - nBits += mLen; - for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); - if (e === 0) { - e = 1 - eBias; - } else if (e === eMax) { - return m ? NaN : s ? -Infinity : Infinity; - } else { - m = m + pow(2, mLen); - e = e - eBias; - } return (s ? -1 : 1) * m * pow(2, e - mLen); -} - -function unpackI32(bytes) { - return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; -} -function packI8(it) { - return [it & 0xff]; -} -function packI16(it) { - return [it & 0xff, it >> 8 & 0xff]; -} -function packI32(it) { - return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; -} -function packF64(it) { - return packIEEE754(it, 52, 8); -} -function packF32(it) { - return packIEEE754(it, 23, 4); -} - -function addGetter(C, key, internal) { - dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } }); -} - -function get(view, bytes, index, isLittleEndian) { - var numIndex = +index; - var intIndex = toIndex(numIndex); - if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); - var store = view[$BUFFER]._b; - var start = intIndex + view[$OFFSET]; - var pack = store.slice(start, start + bytes); - return isLittleEndian ? pack : pack.reverse(); -} -function set(view, bytes, index, conversion, value, isLittleEndian) { - var numIndex = +index; - var intIndex = toIndex(numIndex); - if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); - var store = view[$BUFFER]._b; - var start = intIndex + view[$OFFSET]; - var pack = conversion(+value); - for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; -} - -if (!$typed.ABV) { - $ArrayBuffer = function ArrayBuffer(length) { - anInstance(this, $ArrayBuffer, ARRAY_BUFFER); - var byteLength = toIndex(length); - this._b = arrayFill.call(new Array(byteLength), 0); - this[$LENGTH] = byteLength; - }; - - $DataView = function DataView(buffer, byteOffset, byteLength) { - anInstance(this, $DataView, DATA_VIEW); - anInstance(buffer, $ArrayBuffer, DATA_VIEW); - var bufferLength = buffer[$LENGTH]; - var offset = toInteger(byteOffset); - if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!'); - byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); - if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); - this[$BUFFER] = buffer; - this[$OFFSET] = offset; - this[$LENGTH] = byteLength; - }; - - if (DESCRIPTORS) { - addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); - addGetter($DataView, BUFFER, '_b'); - addGetter($DataView, BYTE_LENGTH, '_l'); - addGetter($DataView, BYTE_OFFSET, '_o'); - } - - redefineAll($DataView[PROTOTYPE], { - getInt8: function getInt8(byteOffset) { - return get(this, 1, byteOffset)[0] << 24 >> 24; - }, - getUint8: function getUint8(byteOffset) { - return get(this, 1, byteOffset)[0]; - }, - getInt16: function getInt16(byteOffset /* , littleEndian */) { - var bytes = get(this, 2, byteOffset, arguments[1]); - return (bytes[1] << 8 | bytes[0]) << 16 >> 16; - }, - getUint16: function getUint16(byteOffset /* , littleEndian */) { - var bytes = get(this, 2, byteOffset, arguments[1]); - return bytes[1] << 8 | bytes[0]; - }, - getInt32: function getInt32(byteOffset /* , littleEndian */) { - return unpackI32(get(this, 4, byteOffset, arguments[1])); - }, - getUint32: function getUint32(byteOffset /* , littleEndian */) { - return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; - }, - getFloat32: function getFloat32(byteOffset /* , littleEndian */) { - return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); - }, - getFloat64: function getFloat64(byteOffset /* , littleEndian */) { - return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); - }, - setInt8: function setInt8(byteOffset, value) { - set(this, 1, byteOffset, packI8, value); - }, - setUint8: function setUint8(byteOffset, value) { - set(this, 1, byteOffset, packI8, value); - }, - setInt16: function setInt16(byteOffset, value /* , littleEndian */) { - set(this, 2, byteOffset, packI16, value, arguments[2]); - }, - setUint16: function setUint16(byteOffset, value /* , littleEndian */) { - set(this, 2, byteOffset, packI16, value, arguments[2]); - }, - setInt32: function setInt32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packI32, value, arguments[2]); - }, - setUint32: function setUint32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packI32, value, arguments[2]); - }, - setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { - set(this, 4, byteOffset, packF32, value, arguments[2]); - }, - setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { - set(this, 8, byteOffset, packF64, value, arguments[2]); - } - }); -} else { - if (!fails(function () { - $ArrayBuffer(1); - }) || !fails(function () { - new $ArrayBuffer(-1); // eslint-disable-line no-new - }) || fails(function () { - new $ArrayBuffer(); // eslint-disable-line no-new - new $ArrayBuffer(1.5); // eslint-disable-line no-new - new $ArrayBuffer(NaN); // eslint-disable-line no-new - return $ArrayBuffer.name != ARRAY_BUFFER; - })) { - $ArrayBuffer = function ArrayBuffer(length) { - anInstance(this, $ArrayBuffer); - return new BaseBuffer(toIndex(length)); - }; - var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; - for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) { - if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]); - } - if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer; - } - // iOS Safari 7.x bug - var view = new $DataView(new $ArrayBuffer(2)); - var $setInt8 = $DataView[PROTOTYPE].setInt8; - view.setInt8(0, 2147483648); - view.setInt8(1, 2147483649); - if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], { - setInt8: function setInt8(byteOffset, value) { - $setInt8.call(this, byteOffset, value << 24 >> 24); - }, - setUint8: function setUint8(byteOffset, value) { - $setInt8.call(this, byteOffset, value << 24 >> 24); - } - }, true); -} -setToStringTag($ArrayBuffer, ARRAY_BUFFER); -setToStringTag($DataView, DATA_VIEW); -hide($DataView[PROTOTYPE], $typed.VIEW, true); -exports[ARRAY_BUFFER] = $ArrayBuffer; -exports[DATA_VIEW] = $DataView; diff --git a/node_modules/core-js/modules/_typed.js b/node_modules/core-js/modules/_typed.js deleted file mode 100644 index 8747ffd71..000000000 --- a/node_modules/core-js/modules/_typed.js +++ /dev/null @@ -1,28 +0,0 @@ -var global = require('./_global'); -var hide = require('./_hide'); -var uid = require('./_uid'); -var TYPED = uid('typed_array'); -var VIEW = uid('view'); -var ABV = !!(global.ArrayBuffer && global.DataView); -var CONSTR = ABV; -var i = 0; -var l = 9; -var Typed; - -var TypedArrayConstructors = ( - 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' -).split(','); - -while (i < l) { - if (Typed = global[TypedArrayConstructors[i++]]) { - hide(Typed.prototype, TYPED, true); - hide(Typed.prototype, VIEW, true); - } else CONSTR = false; -} - -module.exports = { - ABV: ABV, - CONSTR: CONSTR, - TYPED: TYPED, - VIEW: VIEW -}; diff --git a/node_modules/core-js/modules/_uid.js b/node_modules/core-js/modules/_uid.js deleted file mode 100644 index ffbe7185f..000000000 --- a/node_modules/core-js/modules/_uid.js +++ /dev/null @@ -1,5 +0,0 @@ -var id = 0; -var px = Math.random(); -module.exports = function (key) { - return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); -}; diff --git a/node_modules/core-js/modules/_user-agent.js b/node_modules/core-js/modules/_user-agent.js deleted file mode 100644 index 363fedc25..000000000 --- a/node_modules/core-js/modules/_user-agent.js +++ /dev/null @@ -1,4 +0,0 @@ -var global = require('./_global'); -var navigator = global.navigator; - -module.exports = navigator && navigator.userAgent || ''; diff --git a/node_modules/core-js/modules/_validate-collection.js b/node_modules/core-js/modules/_validate-collection.js deleted file mode 100644 index cec1ceff7..000000000 --- a/node_modules/core-js/modules/_validate-collection.js +++ /dev/null @@ -1,5 +0,0 @@ -var isObject = require('./_is-object'); -module.exports = function (it, TYPE) { - if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); - return it; -}; diff --git a/node_modules/core-js/modules/_wks-define.js b/node_modules/core-js/modules/_wks-define.js deleted file mode 100644 index 7284d6ada..000000000 --- a/node_modules/core-js/modules/_wks-define.js +++ /dev/null @@ -1,9 +0,0 @@ -var global = require('./_global'); -var core = require('./_core'); -var LIBRARY = require('./_library'); -var wksExt = require('./_wks-ext'); -var defineProperty = require('./_object-dp').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) }); -}; diff --git a/node_modules/core-js/modules/_wks-ext.js b/node_modules/core-js/modules/_wks-ext.js deleted file mode 100644 index 13bd83b16..000000000 --- a/node_modules/core-js/modules/_wks-ext.js +++ /dev/null @@ -1 +0,0 @@ -exports.f = require('./_wks'); diff --git a/node_modules/core-js/modules/_wks.js b/node_modules/core-js/modules/_wks.js deleted file mode 100644 index e33f857a6..000000000 --- a/node_modules/core-js/modules/_wks.js +++ /dev/null @@ -1,11 +0,0 @@ -var store = require('./_shared')('wks'); -var uid = require('./_uid'); -var Symbol = require('./_global').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; diff --git a/node_modules/core-js/modules/core.delay.js b/node_modules/core-js/modules/core.delay.js deleted file mode 100644 index 73712c012..000000000 --- a/node_modules/core-js/modules/core.delay.js +++ /dev/null @@ -1,12 +0,0 @@ -var global = require('./_global'); -var core = require('./_core'); -var $export = require('./_export'); -var partial = require('./_partial'); -// https://esdiscuss.org/topic/promise-returning-delay-function -$export($export.G + $export.F, { - delay: function delay(time) { - return new (core.Promise || global.Promise)(function (resolve) { - setTimeout(partial.call(resolve, true), time); - }); - } -}); diff --git a/node_modules/core-js/modules/core.dict.js b/node_modules/core-js/modules/core.dict.js deleted file mode 100644 index 5422ad30d..000000000 --- a/node_modules/core-js/modules/core.dict.js +++ /dev/null @@ -1,157 +0,0 @@ -'use strict'; -var ctx = require('./_ctx'); -var $export = require('./_export'); -var createDesc = require('./_property-desc'); -var assign = require('./_object-assign'); -var create = require('./_object-create'); -var getPrototypeOf = require('./_object-gpo'); -var getKeys = require('./_object-keys'); -var dP = require('./_object-dp'); -var keyOf = require('./_keyof'); -var aFunction = require('./_a-function'); -var forOf = require('./_for-of'); -var isIterable = require('./core.is-iterable'); -var $iterCreate = require('./_iter-create'); -var step = require('./_iter-step'); -var isObject = require('./_is-object'); -var toIObject = require('./_to-iobject'); -var DESCRIPTORS = require('./_descriptors'); -var has = require('./_has'); - -// 0 -> Dict.forEach -// 1 -> Dict.map -// 2 -> Dict.filter -// 3 -> Dict.some -// 4 -> Dict.every -// 5 -> Dict.find -// 6 -> Dict.findKey -// 7 -> Dict.mapPairs -var createDictMethod = function (TYPE) { - var IS_MAP = TYPE == 1; - var IS_EVERY = TYPE == 4; - return function (object, callbackfn, that /* = undefined */) { - var f = ctx(callbackfn, that, 3); - var O = toIObject(object); - var result = IS_MAP || TYPE == 7 || TYPE == 2 - ? new (typeof this == 'function' ? this : Dict)() : undefined; - var key, val, res; - for (key in O) if (has(O, key)) { - val = O[key]; - res = f(val, key, object); - if (TYPE) { - if (IS_MAP) result[key] = res; // map - else if (res) switch (TYPE) { - case 2: result[key] = val; break; // filter - case 3: return true; // some - case 5: return val; // find - case 6: return key; // findKey - case 7: result[res[0]] = res[1]; // mapPairs - } else if (IS_EVERY) return false; // every - } - } - return TYPE == 3 || IS_EVERY ? IS_EVERY : result; - }; -}; -var findKey = createDictMethod(6); - -var createDictIter = function (kind) { - return function (it) { - return new DictIterator(it, kind); - }; -}; -var DictIterator = function (iterated, kind) { - this._t = toIObject(iterated); // target - this._a = getKeys(iterated); // keys - this._i = 0; // next index - this._k = kind; // kind -}; -$iterCreate(DictIterator, 'Dict', function () { - var that = this; - var O = that._t; - var keys = that._a; - var kind = that._k; - var key; - do { - if (that._i >= keys.length) { - that._t = undefined; - return step(1); - } - } while (!has(O, key = keys[that._i++])); - if (kind == 'keys') return step(0, key); - if (kind == 'values') return step(0, O[key]); - return step(0, [key, O[key]]); -}); - -function Dict(iterable) { - var dict = create(null); - if (iterable != undefined) { - if (isIterable(iterable)) { - forOf(iterable, true, function (key, value) { - dict[key] = value; - }); - } else assign(dict, iterable); - } - return dict; -} -Dict.prototype = null; - -function reduce(object, mapfn, init) { - aFunction(mapfn); - var O = toIObject(object); - var keys = getKeys(O); - var length = keys.length; - var i = 0; - var memo, key; - if (arguments.length < 3) { - if (!length) throw TypeError('Reduce of empty object with no initial value'); - memo = O[keys[i++]]; - } else memo = Object(init); - while (length > i) if (has(O, key = keys[i++])) { - memo = mapfn(memo, O[key], key, object); - } - return memo; -} - -function includes(object, el) { - // eslint-disable-next-line no-self-compare - return (el == el ? keyOf(object, el) : findKey(object, function (it) { - // eslint-disable-next-line no-self-compare - return it != it; - })) !== undefined; -} - -function get(object, key) { - if (has(object, key)) return object[key]; -} -function set(object, key, value) { - if (DESCRIPTORS && key in Object) dP.f(object, key, createDesc(0, value)); - else object[key] = value; - return object; -} - -function isDict(it) { - return isObject(it) && getPrototypeOf(it) === Dict.prototype; -} - -$export($export.G + $export.F, { Dict: Dict }); - -$export($export.S, 'Dict', { - keys: createDictIter('keys'), - values: createDictIter('values'), - entries: createDictIter('entries'), - forEach: createDictMethod(0), - map: createDictMethod(1), - filter: createDictMethod(2), - some: createDictMethod(3), - every: createDictMethod(4), - find: createDictMethod(5), - findKey: findKey, - mapPairs: createDictMethod(7), - reduce: reduce, - keyOf: keyOf, - includes: includes, - has: has, - get: get, - set: set, - isDict: isDict -}); diff --git a/node_modules/core-js/modules/core.function.part.js b/node_modules/core-js/modules/core.function.part.js deleted file mode 100644 index 050154f85..000000000 --- a/node_modules/core-js/modules/core.function.part.js +++ /dev/null @@ -1,7 +0,0 @@ -var path = require('./_path'); -var $export = require('./_export'); - -// Placeholder -require('./_core')._ = path._ = path._ || {}; - -$export($export.P + $export.F, 'Function', { part: require('./_partial') }); diff --git a/node_modules/core-js/modules/core.get-iterator-method.js b/node_modules/core-js/modules/core.get-iterator-method.js deleted file mode 100644 index 9b6fa62a5..000000000 --- a/node_modules/core-js/modules/core.get-iterator-method.js +++ /dev/null @@ -1,8 +0,0 @@ -var classof = require('./_classof'); -var ITERATOR = require('./_wks')('iterator'); -var Iterators = require('./_iterators'); -module.exports = require('./_core').getIteratorMethod = function (it) { - if (it != undefined) return it[ITERATOR] - || it['@@iterator'] - || Iterators[classof(it)]; -}; diff --git a/node_modules/core-js/modules/core.get-iterator.js b/node_modules/core-js/modules/core.get-iterator.js deleted file mode 100644 index 04568c86c..000000000 --- a/node_modules/core-js/modules/core.get-iterator.js +++ /dev/null @@ -1,7 +0,0 @@ -var anObject = require('./_an-object'); -var get = require('./core.get-iterator-method'); -module.exports = require('./_core').getIterator = function (it) { - var iterFn = get(it); - if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!'); - return anObject(iterFn.call(it)); -}; diff --git a/node_modules/core-js/modules/core.is-iterable.js b/node_modules/core-js/modules/core.is-iterable.js deleted file mode 100644 index 388e5e35b..000000000 --- a/node_modules/core-js/modules/core.is-iterable.js +++ /dev/null @@ -1,10 +0,0 @@ -var classof = require('./_classof'); -var ITERATOR = require('./_wks')('iterator'); -var Iterators = require('./_iterators'); -module.exports = require('./_core').isIterable = function (it) { - var O = Object(it); - return O[ITERATOR] !== undefined - || '@@iterator' in O - // eslint-disable-next-line no-prototype-builtins - || Iterators.hasOwnProperty(classof(O)); -}; diff --git a/node_modules/core-js/modules/core.number.iterator.js b/node_modules/core-js/modules/core.number.iterator.js deleted file mode 100644 index fa37791eb..000000000 --- a/node_modules/core-js/modules/core.number.iterator.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; -require('./_iter-define')(Number, 'Number', function (iterated) { - this._l = +iterated; - this._i = 0; -}, function () { - var i = this._i++; - var done = !(i < this._l); - return { done: done, value: done ? undefined : i }; -}); diff --git a/node_modules/core-js/modules/core.object.classof.js b/node_modules/core-js/modules/core.object.classof.js deleted file mode 100644 index fe16595a5..000000000 --- a/node_modules/core-js/modules/core.object.classof.js +++ /dev/null @@ -1,3 +0,0 @@ -var $export = require('./_export'); - -$export($export.S + $export.F, 'Object', { classof: require('./_classof') }); diff --git a/node_modules/core-js/modules/core.object.define.js b/node_modules/core-js/modules/core.object.define.js deleted file mode 100644 index e4e717b58..000000000 --- a/node_modules/core-js/modules/core.object.define.js +++ /dev/null @@ -1,4 +0,0 @@ -var $export = require('./_export'); -var define = require('./_object-define'); - -$export($export.S + $export.F, 'Object', { define: define }); diff --git a/node_modules/core-js/modules/core.object.is-object.js b/node_modules/core-js/modules/core.object.is-object.js deleted file mode 100644 index fea80b606..000000000 --- a/node_modules/core-js/modules/core.object.is-object.js +++ /dev/null @@ -1,3 +0,0 @@ -var $export = require('./_export'); - -$export($export.S + $export.F, 'Object', { isObject: require('./_is-object') }); diff --git a/node_modules/core-js/modules/core.object.make.js b/node_modules/core-js/modules/core.object.make.js deleted file mode 100644 index 51d47740a..000000000 --- a/node_modules/core-js/modules/core.object.make.js +++ /dev/null @@ -1,9 +0,0 @@ -var $export = require('./_export'); -var define = require('./_object-define'); -var create = require('./_object-create'); - -$export($export.S + $export.F, 'Object', { - make: function (proto, mixin) { - return define(create(proto), mixin); - } -}); diff --git a/node_modules/core-js/modules/core.regexp.escape.js b/node_modules/core-js/modules/core.regexp.escape.js deleted file mode 100644 index 3ddd748c0..000000000 --- a/node_modules/core-js/modules/core.regexp.escape.js +++ /dev/null @@ -1,5 +0,0 @@ -// https://github.com/benjamingr/RexExp.escape -var $export = require('./_export'); -var $re = require('./_replacer')(/[\\^$*+?.()|[\]{}]/g, '\\$&'); - -$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } }); diff --git a/node_modules/core-js/modules/core.string.escape-html.js b/node_modules/core-js/modules/core.string.escape-html.js deleted file mode 100644 index f96788614..000000000 --- a/node_modules/core-js/modules/core.string.escape-html.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $re = require('./_replacer')(/[&<>"']/g, { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' -}); - -$export($export.P + $export.F, 'String', { escapeHTML: function escapeHTML() { return $re(this); } }); diff --git a/node_modules/core-js/modules/core.string.unescape-html.js b/node_modules/core-js/modules/core.string.unescape-html.js deleted file mode 100644 index eb8a6cfbf..000000000 --- a/node_modules/core-js/modules/core.string.unescape-html.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $re = require('./_replacer')(/&(?:amp|lt|gt|quot|apos);/g, { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'" -}); - -$export($export.P + $export.F, 'String', { unescapeHTML: function unescapeHTML() { return $re(this); } }); diff --git a/node_modules/core-js/modules/es5.js b/node_modules/core-js/modules/es5.js deleted file mode 100644 index ca10612d1..000000000 --- a/node_modules/core-js/modules/es5.js +++ /dev/null @@ -1,35 +0,0 @@ -// This file still here for a legacy code and will be removed in a near time -require('./es6.object.create'); -require('./es6.object.define-property'); -require('./es6.object.define-properties'); -require('./es6.object.get-own-property-descriptor'); -require('./es6.object.get-prototype-of'); -require('./es6.object.keys'); -require('./es6.object.get-own-property-names'); -require('./es6.object.freeze'); -require('./es6.object.seal'); -require('./es6.object.prevent-extensions'); -require('./es6.object.is-frozen'); -require('./es6.object.is-sealed'); -require('./es6.object.is-extensible'); -require('./es6.function.bind'); -require('./es6.array.is-array'); -require('./es6.array.join'); -require('./es6.array.slice'); -require('./es6.array.sort'); -require('./es6.array.for-each'); -require('./es6.array.map'); -require('./es6.array.filter'); -require('./es6.array.some'); -require('./es6.array.every'); -require('./es6.array.reduce'); -require('./es6.array.reduce-right'); -require('./es6.array.index-of'); -require('./es6.array.last-index-of'); -require('./es6.date.now'); -require('./es6.date.to-iso-string'); -require('./es6.date.to-json'); -require('./es6.parse-int'); -require('./es6.parse-float'); -require('./es6.string.trim'); -require('./es6.regexp.to-string'); diff --git a/node_modules/core-js/modules/es6.array.copy-within.js b/node_modules/core-js/modules/es6.array.copy-within.js deleted file mode 100644 index f866a9591..000000000 --- a/node_modules/core-js/modules/es6.array.copy-within.js +++ /dev/null @@ -1,6 +0,0 @@ -// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) -var $export = require('./_export'); - -$export($export.P, 'Array', { copyWithin: require('./_array-copy-within') }); - -require('./_add-to-unscopables')('copyWithin'); diff --git a/node_modules/core-js/modules/es6.array.every.js b/node_modules/core-js/modules/es6.array.every.js deleted file mode 100644 index cfd448f5c..000000000 --- a/node_modules/core-js/modules/es6.array.every.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $every = require('./_array-methods')(4); - -$export($export.P + $export.F * !require('./_strict-method')([].every, true), 'Array', { - // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) - every: function every(callbackfn /* , thisArg */) { - return $every(this, callbackfn, arguments[1]); - } -}); diff --git a/node_modules/core-js/modules/es6.array.fill.js b/node_modules/core-js/modules/es6.array.fill.js deleted file mode 100644 index ac1714424..000000000 --- a/node_modules/core-js/modules/es6.array.fill.js +++ /dev/null @@ -1,6 +0,0 @@ -// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) -var $export = require('./_export'); - -$export($export.P, 'Array', { fill: require('./_array-fill') }); - -require('./_add-to-unscopables')('fill'); diff --git a/node_modules/core-js/modules/es6.array.filter.js b/node_modules/core-js/modules/es6.array.filter.js deleted file mode 100644 index 447ecf403..000000000 --- a/node_modules/core-js/modules/es6.array.filter.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $filter = require('./_array-methods')(2); - -$export($export.P + $export.F * !require('./_strict-method')([].filter, true), 'Array', { - // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) - filter: function filter(callbackfn /* , thisArg */) { - return $filter(this, callbackfn, arguments[1]); - } -}); diff --git a/node_modules/core-js/modules/es6.array.find-index.js b/node_modules/core-js/modules/es6.array.find-index.js deleted file mode 100644 index 374cadd77..000000000 --- a/node_modules/core-js/modules/es6.array.find-index.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; -// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) -var $export = require('./_export'); -var $find = require('./_array-methods')(6); -var KEY = 'findIndex'; -var forced = true; -// Shouldn't skip holes -if (KEY in []) Array(1)[KEY](function () { forced = false; }); -$export($export.P + $export.F * forced, 'Array', { - findIndex: function findIndex(callbackfn /* , that = undefined */) { - return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } -}); -require('./_add-to-unscopables')(KEY); diff --git a/node_modules/core-js/modules/es6.array.find.js b/node_modules/core-js/modules/es6.array.find.js deleted file mode 100644 index 4fbe76ce0..000000000 --- a/node_modules/core-js/modules/es6.array.find.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; -// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) -var $export = require('./_export'); -var $find = require('./_array-methods')(5); -var KEY = 'find'; -var forced = true; -// Shouldn't skip holes -if (KEY in []) Array(1)[KEY](function () { forced = false; }); -$export($export.P + $export.F * forced, 'Array', { - find: function find(callbackfn /* , that = undefined */) { - return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - } -}); -require('./_add-to-unscopables')(KEY); diff --git a/node_modules/core-js/modules/es6.array.for-each.js b/node_modules/core-js/modules/es6.array.for-each.js deleted file mode 100644 index 525ba0740..000000000 --- a/node_modules/core-js/modules/es6.array.for-each.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $forEach = require('./_array-methods')(0); -var STRICT = require('./_strict-method')([].forEach, true); - -$export($export.P + $export.F * !STRICT, 'Array', { - // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) - forEach: function forEach(callbackfn /* , thisArg */) { - return $forEach(this, callbackfn, arguments[1]); - } -}); diff --git a/node_modules/core-js/modules/es6.array.from.js b/node_modules/core-js/modules/es6.array.from.js deleted file mode 100644 index 4db38017f..000000000 --- a/node_modules/core-js/modules/es6.array.from.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; -var ctx = require('./_ctx'); -var $export = require('./_export'); -var toObject = require('./_to-object'); -var call = require('./_iter-call'); -var isArrayIter = require('./_is-array-iter'); -var toLength = require('./_to-length'); -var createProperty = require('./_create-property'); -var getIterFn = require('./core.get-iterator-method'); - -$export($export.S + $export.F * !require('./_iter-detect')(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; - } -}); diff --git a/node_modules/core-js/modules/es6.array.index-of.js b/node_modules/core-js/modules/es6.array.index-of.js deleted file mode 100644 index 231c92e9c..000000000 --- a/node_modules/core-js/modules/es6.array.index-of.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $indexOf = require('./_array-includes')(false); -var $native = [].indexOf; -var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; - -$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', { - // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) - indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { - return NEGATIVE_ZERO - // convert -0 to +0 - ? $native.apply(this, arguments) || 0 - : $indexOf(this, searchElement, arguments[1]); - } -}); diff --git a/node_modules/core-js/modules/es6.array.is-array.js b/node_modules/core-js/modules/es6.array.is-array.js deleted file mode 100644 index 27ca6fc5b..000000000 --- a/node_modules/core-js/modules/es6.array.is-array.js +++ /dev/null @@ -1,4 +0,0 @@ -// 22.1.2.2 / 15.4.3.2 Array.isArray(arg) -var $export = require('./_export'); - -$export($export.S, 'Array', { isArray: require('./_is-array') }); diff --git a/node_modules/core-js/modules/es6.array.iterator.js b/node_modules/core-js/modules/es6.array.iterator.js deleted file mode 100644 index c64e88b1b..000000000 --- a/node_modules/core-js/modules/es6.array.iterator.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; -var addToUnscopables = require('./_add-to-unscopables'); -var step = require('./_iter-step'); -var Iterators = require('./_iterators'); -var toIObject = require('./_to-iobject'); - -// 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 = require('./_iter-define')(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'); diff --git a/node_modules/core-js/modules/es6.array.join.js b/node_modules/core-js/modules/es6.array.join.js deleted file mode 100644 index 48e55d2e3..000000000 --- a/node_modules/core-js/modules/es6.array.join.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; -// 22.1.3.13 Array.prototype.join(separator) -var $export = require('./_export'); -var toIObject = require('./_to-iobject'); -var arrayJoin = [].join; - -// fallback for not array-like strings -$export($export.P + $export.F * (require('./_iobject') != Object || !require('./_strict-method')(arrayJoin)), 'Array', { - join: function join(separator) { - return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); - } -}); diff --git a/node_modules/core-js/modules/es6.array.last-index-of.js b/node_modules/core-js/modules/es6.array.last-index-of.js deleted file mode 100644 index 1f70e340d..000000000 --- a/node_modules/core-js/modules/es6.array.last-index-of.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var toIObject = require('./_to-iobject'); -var toInteger = require('./_to-integer'); -var toLength = require('./_to-length'); -var $native = [].lastIndexOf; -var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; - -$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', { - // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) - lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { - // convert -0 to +0 - if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0; - var O = toIObject(this); - var length = toLength(O.length); - var index = length - 1; - if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1])); - if (index < 0) index = length + index; - for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0; - return -1; - } -}); diff --git a/node_modules/core-js/modules/es6.array.map.js b/node_modules/core-js/modules/es6.array.map.js deleted file mode 100644 index 1326033f1..000000000 --- a/node_modules/core-js/modules/es6.array.map.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $map = require('./_array-methods')(1); - -$export($export.P + $export.F * !require('./_strict-method')([].map, true), 'Array', { - // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) - map: function map(callbackfn /* , thisArg */) { - return $map(this, callbackfn, arguments[1]); - } -}); diff --git a/node_modules/core-js/modules/es6.array.of.js b/node_modules/core-js/modules/es6.array.of.js deleted file mode 100644 index b83e058c1..000000000 --- a/node_modules/core-js/modules/es6.array.of.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var createProperty = require('./_create-property'); - -// WebKit Array.of isn't generic -$export($export.S + $export.F * require('./_fails')(function () { - function F() { /* empty */ } - return !(Array.of.call(F) instanceof F); -}), 'Array', { - // 22.1.2.3 Array.of( ...items) - of: function of(/* ...args */) { - var index = 0; - var aLen = arguments.length; - var result = new (typeof this == 'function' ? this : Array)(aLen); - while (aLen > index) createProperty(result, index, arguments[index++]); - result.length = aLen; - return result; - } -}); diff --git a/node_modules/core-js/modules/es6.array.reduce-right.js b/node_modules/core-js/modules/es6.array.reduce-right.js deleted file mode 100644 index 168e421d8..000000000 --- a/node_modules/core-js/modules/es6.array.reduce-right.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $reduce = require('./_array-reduce'); - -$export($export.P + $export.F * !require('./_strict-method')([].reduceRight, true), 'Array', { - // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) - reduceRight: function reduceRight(callbackfn /* , initialValue */) { - return $reduce(this, callbackfn, arguments.length, arguments[1], true); - } -}); diff --git a/node_modules/core-js/modules/es6.array.reduce.js b/node_modules/core-js/modules/es6.array.reduce.js deleted file mode 100644 index f4e476121..000000000 --- a/node_modules/core-js/modules/es6.array.reduce.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $reduce = require('./_array-reduce'); - -$export($export.P + $export.F * !require('./_strict-method')([].reduce, true), 'Array', { - // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) - reduce: function reduce(callbackfn /* , initialValue */) { - return $reduce(this, callbackfn, arguments.length, arguments[1], false); - } -}); diff --git a/node_modules/core-js/modules/es6.array.slice.js b/node_modules/core-js/modules/es6.array.slice.js deleted file mode 100644 index bdd496ecb..000000000 --- a/node_modules/core-js/modules/es6.array.slice.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var html = require('./_html'); -var cof = require('./_cof'); -var toAbsoluteIndex = require('./_to-absolute-index'); -var toLength = require('./_to-length'); -var arraySlice = [].slice; - -// fallback for not array-like ES3 strings and DOM objects -$export($export.P + $export.F * require('./_fails')(function () { - if (html) arraySlice.call(html); -}), 'Array', { - slice: function slice(begin, end) { - var len = toLength(this.length); - var klass = cof(this); - end = end === undefined ? len : end; - if (klass == 'Array') return arraySlice.call(this, begin, end); - var start = toAbsoluteIndex(begin, len); - var upTo = toAbsoluteIndex(end, len); - var size = toLength(upTo - start); - var cloned = new Array(size); - var i = 0; - for (; i < size; i++) cloned[i] = klass == 'String' - ? this.charAt(start + i) - : this[start + i]; - return cloned; - } -}); diff --git a/node_modules/core-js/modules/es6.array.some.js b/node_modules/core-js/modules/es6.array.some.js deleted file mode 100644 index 14c5eec26..000000000 --- a/node_modules/core-js/modules/es6.array.some.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $some = require('./_array-methods')(3); - -$export($export.P + $export.F * !require('./_strict-method')([].some, true), 'Array', { - // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) - some: function some(callbackfn /* , thisArg */) { - return $some(this, callbackfn, arguments[1]); - } -}); diff --git a/node_modules/core-js/modules/es6.array.sort.js b/node_modules/core-js/modules/es6.array.sort.js deleted file mode 100644 index 39817ffae..000000000 --- a/node_modules/core-js/modules/es6.array.sort.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var aFunction = require('./_a-function'); -var toObject = require('./_to-object'); -var fails = require('./_fails'); -var $sort = [].sort; -var test = [1, 2, 3]; - -$export($export.P + $export.F * (fails(function () { - // IE8- - test.sort(undefined); -}) || !fails(function () { - // V8 bug - test.sort(null); - // Old WebKit -}) || !require('./_strict-method')($sort)), 'Array', { - // 22.1.3.25 Array.prototype.sort(comparefn) - sort: function sort(comparefn) { - return comparefn === undefined - ? $sort.call(toObject(this)) - : $sort.call(toObject(this), aFunction(comparefn)); - } -}); diff --git a/node_modules/core-js/modules/es6.array.species.js b/node_modules/core-js/modules/es6.array.species.js deleted file mode 100644 index ce0b8917f..000000000 --- a/node_modules/core-js/modules/es6.array.species.js +++ /dev/null @@ -1 +0,0 @@ -require('./_set-species')('Array'); diff --git a/node_modules/core-js/modules/es6.date.now.js b/node_modules/core-js/modules/es6.date.now.js deleted file mode 100644 index 65f134e56..000000000 --- a/node_modules/core-js/modules/es6.date.now.js +++ /dev/null @@ -1,4 +0,0 @@ -// 20.3.3.1 / 15.9.4.4 Date.now() -var $export = require('./_export'); - -$export($export.S, 'Date', { now: function () { return new Date().getTime(); } }); diff --git a/node_modules/core-js/modules/es6.date.to-iso-string.js b/node_modules/core-js/modules/es6.date.to-iso-string.js deleted file mode 100644 index 13b27818c..000000000 --- a/node_modules/core-js/modules/es6.date.to-iso-string.js +++ /dev/null @@ -1,8 +0,0 @@ -// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() -var $export = require('./_export'); -var toISOString = require('./_date-to-iso-string'); - -// PhantomJS / old WebKit has a broken implementations -$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', { - toISOString: toISOString -}); diff --git a/node_modules/core-js/modules/es6.date.to-json.js b/node_modules/core-js/modules/es6.date.to-json.js deleted file mode 100644 index 1508e0428..000000000 --- a/node_modules/core-js/modules/es6.date.to-json.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var toObject = require('./_to-object'); -var toPrimitive = require('./_to-primitive'); - -$export($export.P + $export.F * require('./_fails')(function () { - return new Date(NaN).toJSON() !== null - || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; -}), 'Date', { - // eslint-disable-next-line no-unused-vars - toJSON: function toJSON(key) { - var O = toObject(this); - var pv = toPrimitive(O); - return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); - } -}); diff --git a/node_modules/core-js/modules/es6.date.to-primitive.js b/node_modules/core-js/modules/es6.date.to-primitive.js deleted file mode 100644 index 41754b9c2..000000000 --- a/node_modules/core-js/modules/es6.date.to-primitive.js +++ /dev/null @@ -1,4 +0,0 @@ -var TO_PRIMITIVE = require('./_wks')('toPrimitive'); -var proto = Date.prototype; - -if (!(TO_PRIMITIVE in proto)) require('./_hide')(proto, TO_PRIMITIVE, require('./_date-to-primitive')); diff --git a/node_modules/core-js/modules/es6.date.to-string.js b/node_modules/core-js/modules/es6.date.to-string.js deleted file mode 100644 index 15ee75ac1..000000000 --- a/node_modules/core-js/modules/es6.date.to-string.js +++ /dev/null @@ -1,12 +0,0 @@ -var DateProto = Date.prototype; -var INVALID_DATE = 'Invalid Date'; -var TO_STRING = 'toString'; -var $toString = DateProto[TO_STRING]; -var getTime = DateProto.getTime; -if (new Date(NaN) + '' != INVALID_DATE) { - require('./_redefine')(DateProto, TO_STRING, function toString() { - var value = getTime.call(this); - // eslint-disable-next-line no-self-compare - return value === value ? $toString.call(this) : INVALID_DATE; - }); -} diff --git a/node_modules/core-js/modules/es6.function.bind.js b/node_modules/core-js/modules/es6.function.bind.js deleted file mode 100644 index 38e84e1ac..000000000 --- a/node_modules/core-js/modules/es6.function.bind.js +++ /dev/null @@ -1,4 +0,0 @@ -// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) -var $export = require('./_export'); - -$export($export.P, 'Function', { bind: require('./_bind') }); diff --git a/node_modules/core-js/modules/es6.function.has-instance.js b/node_modules/core-js/modules/es6.function.has-instance.js deleted file mode 100644 index 7556ed9bd..000000000 --- a/node_modules/core-js/modules/es6.function.has-instance.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; -var isObject = require('./_is-object'); -var getPrototypeOf = require('./_object-gpo'); -var HAS_INSTANCE = require('./_wks')('hasInstance'); -var FunctionProto = Function.prototype; -// 19.2.3.6 Function.prototype[@@hasInstance](V) -if (!(HAS_INSTANCE in FunctionProto)) require('./_object-dp').f(FunctionProto, HAS_INSTANCE, { value: function (O) { - if (typeof this != 'function' || !isObject(O)) return false; - if (!isObject(this.prototype)) return O instanceof this; - // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: - while (O = getPrototypeOf(O)) if (this.prototype === O) return true; - return false; -} }); diff --git a/node_modules/core-js/modules/es6.function.name.js b/node_modules/core-js/modules/es6.function.name.js deleted file mode 100644 index 05dd333f8..000000000 --- a/node_modules/core-js/modules/es6.function.name.js +++ /dev/null @@ -1,16 +0,0 @@ -var dP = require('./_object-dp').f; -var FProto = Function.prototype; -var nameRE = /^\s*function ([^ (]*)/; -var NAME = 'name'; - -// 19.2.4.2 name -NAME in FProto || require('./_descriptors') && dP(FProto, NAME, { - configurable: true, - get: function () { - try { - return ('' + this).match(nameRE)[1]; - } catch (e) { - return ''; - } - } -}); diff --git a/node_modules/core-js/modules/es6.map.js b/node_modules/core-js/modules/es6.map.js deleted file mode 100644 index a282f0222..000000000 --- a/node_modules/core-js/modules/es6.map.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; -var strong = require('./_collection-strong'); -var validate = require('./_validate-collection'); -var MAP = 'Map'; - -// 23.1 Map Objects -module.exports = require('./_collection')(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); diff --git a/node_modules/core-js/modules/es6.math.acosh.js b/node_modules/core-js/modules/es6.math.acosh.js deleted file mode 100644 index 8a8989ebb..000000000 --- a/node_modules/core-js/modules/es6.math.acosh.js +++ /dev/null @@ -1,18 +0,0 @@ -// 20.2.2.3 Math.acosh(x) -var $export = require('./_export'); -var log1p = require('./_math-log1p'); -var sqrt = Math.sqrt; -var $acosh = Math.acosh; - -$export($export.S + $export.F * !($acosh - // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 - && Math.floor($acosh(Number.MAX_VALUE)) == 710 - // Tor Browser bug: Math.acosh(Infinity) -> NaN - && $acosh(Infinity) == Infinity -), 'Math', { - acosh: function acosh(x) { - return (x = +x) < 1 ? NaN : x > 94906265.62425156 - ? Math.log(x) + Math.LN2 - : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); - } -}); diff --git a/node_modules/core-js/modules/es6.math.asinh.js b/node_modules/core-js/modules/es6.math.asinh.js deleted file mode 100644 index ddf466628..000000000 --- a/node_modules/core-js/modules/es6.math.asinh.js +++ /dev/null @@ -1,10 +0,0 @@ -// 20.2.2.5 Math.asinh(x) -var $export = require('./_export'); -var $asinh = Math.asinh; - -function asinh(x) { - return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); -} - -// Tor Browser bug: Math.asinh(0) -> -0 -$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh }); diff --git a/node_modules/core-js/modules/es6.math.atanh.js b/node_modules/core-js/modules/es6.math.atanh.js deleted file mode 100644 index af3c3e809..000000000 --- a/node_modules/core-js/modules/es6.math.atanh.js +++ /dev/null @@ -1,10 +0,0 @@ -// 20.2.2.7 Math.atanh(x) -var $export = require('./_export'); -var $atanh = Math.atanh; - -// Tor Browser bug: Math.atanh(-0) -> 0 -$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { - atanh: function atanh(x) { - return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; - } -}); diff --git a/node_modules/core-js/modules/es6.math.cbrt.js b/node_modules/core-js/modules/es6.math.cbrt.js deleted file mode 100644 index e45ac4445..000000000 --- a/node_modules/core-js/modules/es6.math.cbrt.js +++ /dev/null @@ -1,9 +0,0 @@ -// 20.2.2.9 Math.cbrt(x) -var $export = require('./_export'); -var sign = require('./_math-sign'); - -$export($export.S, 'Math', { - cbrt: function cbrt(x) { - return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); - } -}); diff --git a/node_modules/core-js/modules/es6.math.clz32.js b/node_modules/core-js/modules/es6.math.clz32.js deleted file mode 100644 index 1e4d7e19c..000000000 --- a/node_modules/core-js/modules/es6.math.clz32.js +++ /dev/null @@ -1,8 +0,0 @@ -// 20.2.2.11 Math.clz32(x) -var $export = require('./_export'); - -$export($export.S, 'Math', { - clz32: function clz32(x) { - return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; - } -}); diff --git a/node_modules/core-js/modules/es6.math.cosh.js b/node_modules/core-js/modules/es6.math.cosh.js deleted file mode 100644 index 1e0cffc1a..000000000 --- a/node_modules/core-js/modules/es6.math.cosh.js +++ /dev/null @@ -1,9 +0,0 @@ -// 20.2.2.12 Math.cosh(x) -var $export = require('./_export'); -var exp = Math.exp; - -$export($export.S, 'Math', { - cosh: function cosh(x) { - return (exp(x = +x) + exp(-x)) / 2; - } -}); diff --git a/node_modules/core-js/modules/es6.math.expm1.js b/node_modules/core-js/modules/es6.math.expm1.js deleted file mode 100644 index da4c90df8..000000000 --- a/node_modules/core-js/modules/es6.math.expm1.js +++ /dev/null @@ -1,5 +0,0 @@ -// 20.2.2.14 Math.expm1(x) -var $export = require('./_export'); -var $expm1 = require('./_math-expm1'); - -$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 }); diff --git a/node_modules/core-js/modules/es6.math.fround.js b/node_modules/core-js/modules/es6.math.fround.js deleted file mode 100644 index 9c262f2ec..000000000 --- a/node_modules/core-js/modules/es6.math.fround.js +++ /dev/null @@ -1,4 +0,0 @@ -// 20.2.2.16 Math.fround(x) -var $export = require('./_export'); - -$export($export.S, 'Math', { fround: require('./_math-fround') }); diff --git a/node_modules/core-js/modules/es6.math.hypot.js b/node_modules/core-js/modules/es6.math.hypot.js deleted file mode 100644 index 41ffdb27a..000000000 --- a/node_modules/core-js/modules/es6.math.hypot.js +++ /dev/null @@ -1,25 +0,0 @@ -// 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) -var $export = require('./_export'); -var abs = Math.abs; - -$export($export.S, 'Math', { - hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars - var sum = 0; - var i = 0; - var aLen = arguments.length; - var larg = 0; - var arg, div; - while (i < aLen) { - arg = abs(arguments[i++]); - if (larg < arg) { - div = larg / arg; - sum = sum * div * div + 1; - larg = arg; - } else if (arg > 0) { - div = arg / larg; - sum += div * div; - } else sum += arg; - } - return larg === Infinity ? Infinity : larg * Math.sqrt(sum); - } -}); diff --git a/node_modules/core-js/modules/es6.math.imul.js b/node_modules/core-js/modules/es6.math.imul.js deleted file mode 100644 index 96e683d25..000000000 --- a/node_modules/core-js/modules/es6.math.imul.js +++ /dev/null @@ -1,17 +0,0 @@ -// 20.2.2.18 Math.imul(x, y) -var $export = require('./_export'); -var $imul = Math.imul; - -// some WebKit versions fails with big numbers, some has wrong arity -$export($export.S + $export.F * require('./_fails')(function () { - return $imul(0xffffffff, 5) != -5 || $imul.length != 2; -}), 'Math', { - imul: function imul(x, y) { - var UINT16 = 0xffff; - var xn = +x; - var yn = +y; - var xl = UINT16 & xn; - var yl = UINT16 & yn; - return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); - } -}); diff --git a/node_modules/core-js/modules/es6.math.log10.js b/node_modules/core-js/modules/es6.math.log10.js deleted file mode 100644 index 9ee8ae68f..000000000 --- a/node_modules/core-js/modules/es6.math.log10.js +++ /dev/null @@ -1,8 +0,0 @@ -// 20.2.2.21 Math.log10(x) -var $export = require('./_export'); - -$export($export.S, 'Math', { - log10: function log10(x) { - return Math.log(x) * Math.LOG10E; - } -}); diff --git a/node_modules/core-js/modules/es6.math.log1p.js b/node_modules/core-js/modules/es6.math.log1p.js deleted file mode 100644 index 62959800a..000000000 --- a/node_modules/core-js/modules/es6.math.log1p.js +++ /dev/null @@ -1,4 +0,0 @@ -// 20.2.2.20 Math.log1p(x) -var $export = require('./_export'); - -$export($export.S, 'Math', { log1p: require('./_math-log1p') }); diff --git a/node_modules/core-js/modules/es6.math.log2.js b/node_modules/core-js/modules/es6.math.log2.js deleted file mode 100644 index 03d127cba..000000000 --- a/node_modules/core-js/modules/es6.math.log2.js +++ /dev/null @@ -1,8 +0,0 @@ -// 20.2.2.22 Math.log2(x) -var $export = require('./_export'); - -$export($export.S, 'Math', { - log2: function log2(x) { - return Math.log(x) / Math.LN2; - } -}); diff --git a/node_modules/core-js/modules/es6.math.sign.js b/node_modules/core-js/modules/es6.math.sign.js deleted file mode 100644 index 981f69e56..000000000 --- a/node_modules/core-js/modules/es6.math.sign.js +++ /dev/null @@ -1,4 +0,0 @@ -// 20.2.2.28 Math.sign(x) -var $export = require('./_export'); - -$export($export.S, 'Math', { sign: require('./_math-sign') }); diff --git a/node_modules/core-js/modules/es6.math.sinh.js b/node_modules/core-js/modules/es6.math.sinh.js deleted file mode 100644 index 57606333c..000000000 --- a/node_modules/core-js/modules/es6.math.sinh.js +++ /dev/null @@ -1,15 +0,0 @@ -// 20.2.2.30 Math.sinh(x) -var $export = require('./_export'); -var expm1 = require('./_math-expm1'); -var exp = Math.exp; - -// V8 near Chromium 38 has a problem with very small numbers -$export($export.S + $export.F * require('./_fails')(function () { - return !Math.sinh(-2e-17) != -2e-17; -}), 'Math', { - sinh: function sinh(x) { - return Math.abs(x = +x) < 1 - ? (expm1(x) - expm1(-x)) / 2 - : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); - } -}); diff --git a/node_modules/core-js/modules/es6.math.tanh.js b/node_modules/core-js/modules/es6.math.tanh.js deleted file mode 100644 index 0d3135b0f..000000000 --- a/node_modules/core-js/modules/es6.math.tanh.js +++ /dev/null @@ -1,12 +0,0 @@ -// 20.2.2.33 Math.tanh(x) -var $export = require('./_export'); -var expm1 = require('./_math-expm1'); -var exp = Math.exp; - -$export($export.S, 'Math', { - tanh: function tanh(x) { - var a = expm1(x = +x); - var b = expm1(-x); - return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); - } -}); diff --git a/node_modules/core-js/modules/es6.math.trunc.js b/node_modules/core-js/modules/es6.math.trunc.js deleted file mode 100644 index 35ddb8086..000000000 --- a/node_modules/core-js/modules/es6.math.trunc.js +++ /dev/null @@ -1,8 +0,0 @@ -// 20.2.2.34 Math.trunc(x) -var $export = require('./_export'); - -$export($export.S, 'Math', { - trunc: function trunc(it) { - return (it > 0 ? Math.floor : Math.ceil)(it); - } -}); diff --git a/node_modules/core-js/modules/es6.number.constructor.js b/node_modules/core-js/modules/es6.number.constructor.js deleted file mode 100644 index aee40e9ac..000000000 --- a/node_modules/core-js/modules/es6.number.constructor.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict'; -var global = require('./_global'); -var has = require('./_has'); -var cof = require('./_cof'); -var inheritIfRequired = require('./_inherit-if-required'); -var toPrimitive = require('./_to-primitive'); -var fails = require('./_fails'); -var gOPN = require('./_object-gopn').f; -var gOPD = require('./_object-gopd').f; -var dP = require('./_object-dp').f; -var $trim = require('./_string-trim').trim; -var NUMBER = 'Number'; -var $Number = global[NUMBER]; -var Base = $Number; -var proto = $Number.prototype; -// Opera ~12 has broken Object#toString -var BROKEN_COF = cof(require('./_object-create')(proto)) == NUMBER; -var TRIM = 'trim' in String.prototype; - -// 7.1.3 ToNumber(argument) -var toNumber = function (argument) { - var it = toPrimitive(argument, false); - if (typeof it == 'string' && it.length > 2) { - it = TRIM ? it.trim() : $trim(it, 3); - var first = it.charCodeAt(0); - var third, radix, maxCode; - if (first === 43 || first === 45) { - third = it.charCodeAt(2); - if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix - } else if (first === 48) { - switch (it.charCodeAt(1)) { - case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i - case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i - default: return +it; - } - for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) { - code = digits.charCodeAt(i); - // parseInt parses a string to a first unavailable symbol - // but ToNumber should return NaN if a string contains unavailable symbols - if (code < 48 || code > maxCode) return NaN; - } return parseInt(digits, radix); - } - } return +it; -}; - -if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) { - $Number = function Number(value) { - var it = arguments.length < 1 ? 0 : value; - var that = this; - return that instanceof $Number - // check on 1..constructor(foo) case - && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER) - ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it); - }; - for (var keys = require('./_descriptors') ? gOPN(Base) : ( - // ES3: - 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + - // ES6 (in case, if modules with ES6 Number statics required before): - 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + - 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' - ).split(','), j = 0, key; keys.length > j; j++) { - if (has(Base, key = keys[j]) && !has($Number, key)) { - dP($Number, key, gOPD(Base, key)); - } - } - $Number.prototype = proto; - proto.constructor = $Number; - require('./_redefine')(global, NUMBER, $Number); -} diff --git a/node_modules/core-js/modules/es6.number.epsilon.js b/node_modules/core-js/modules/es6.number.epsilon.js deleted file mode 100644 index 34a2ec5fa..000000000 --- a/node_modules/core-js/modules/es6.number.epsilon.js +++ /dev/null @@ -1,4 +0,0 @@ -// 20.1.2.1 Number.EPSILON -var $export = require('./_export'); - -$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) }); diff --git a/node_modules/core-js/modules/es6.number.is-finite.js b/node_modules/core-js/modules/es6.number.is-finite.js deleted file mode 100644 index 8719da971..000000000 --- a/node_modules/core-js/modules/es6.number.is-finite.js +++ /dev/null @@ -1,9 +0,0 @@ -// 20.1.2.2 Number.isFinite(number) -var $export = require('./_export'); -var _isFinite = require('./_global').isFinite; - -$export($export.S, 'Number', { - isFinite: function isFinite(it) { - return typeof it == 'number' && _isFinite(it); - } -}); diff --git a/node_modules/core-js/modules/es6.number.is-integer.js b/node_modules/core-js/modules/es6.number.is-integer.js deleted file mode 100644 index f1ab5dc4c..000000000 --- a/node_modules/core-js/modules/es6.number.is-integer.js +++ /dev/null @@ -1,4 +0,0 @@ -// 20.1.2.3 Number.isInteger(number) -var $export = require('./_export'); - -$export($export.S, 'Number', { isInteger: require('./_is-integer') }); diff --git a/node_modules/core-js/modules/es6.number.is-nan.js b/node_modules/core-js/modules/es6.number.is-nan.js deleted file mode 100644 index 01d76ba28..000000000 --- a/node_modules/core-js/modules/es6.number.is-nan.js +++ /dev/null @@ -1,9 +0,0 @@ -// 20.1.2.4 Number.isNaN(number) -var $export = require('./_export'); - -$export($export.S, 'Number', { - isNaN: function isNaN(number) { - // eslint-disable-next-line no-self-compare - return number != number; - } -}); diff --git a/node_modules/core-js/modules/es6.number.is-safe-integer.js b/node_modules/core-js/modules/es6.number.is-safe-integer.js deleted file mode 100644 index 004e7d16f..000000000 --- a/node_modules/core-js/modules/es6.number.is-safe-integer.js +++ /dev/null @@ -1,10 +0,0 @@ -// 20.1.2.5 Number.isSafeInteger(number) -var $export = require('./_export'); -var isInteger = require('./_is-integer'); -var abs = Math.abs; - -$export($export.S, 'Number', { - isSafeInteger: function isSafeInteger(number) { - return isInteger(number) && abs(number) <= 0x1fffffffffffff; - } -}); diff --git a/node_modules/core-js/modules/es6.number.max-safe-integer.js b/node_modules/core-js/modules/es6.number.max-safe-integer.js deleted file mode 100644 index a4f248f1b..000000000 --- a/node_modules/core-js/modules/es6.number.max-safe-integer.js +++ /dev/null @@ -1,4 +0,0 @@ -// 20.1.2.6 Number.MAX_SAFE_INTEGER -var $export = require('./_export'); - -$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); diff --git a/node_modules/core-js/modules/es6.number.min-safe-integer.js b/node_modules/core-js/modules/es6.number.min-safe-integer.js deleted file mode 100644 index 34df374bc..000000000 --- a/node_modules/core-js/modules/es6.number.min-safe-integer.js +++ /dev/null @@ -1,4 +0,0 @@ -// 20.1.2.10 Number.MIN_SAFE_INTEGER -var $export = require('./_export'); - -$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff }); diff --git a/node_modules/core-js/modules/es6.number.parse-float.js b/node_modules/core-js/modules/es6.number.parse-float.js deleted file mode 100644 index 317c43109..000000000 --- a/node_modules/core-js/modules/es6.number.parse-float.js +++ /dev/null @@ -1,4 +0,0 @@ -var $export = require('./_export'); -var $parseFloat = require('./_parse-float'); -// 20.1.2.12 Number.parseFloat(string) -$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat }); diff --git a/node_modules/core-js/modules/es6.number.parse-int.js b/node_modules/core-js/modules/es6.number.parse-int.js deleted file mode 100644 index cb48da28d..000000000 --- a/node_modules/core-js/modules/es6.number.parse-int.js +++ /dev/null @@ -1,4 +0,0 @@ -var $export = require('./_export'); -var $parseInt = require('./_parse-int'); -// 20.1.2.13 Number.parseInt(string, radix) -$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt }); diff --git a/node_modules/core-js/modules/es6.number.to-fixed.js b/node_modules/core-js/modules/es6.number.to-fixed.js deleted file mode 100644 index 2bf78af91..000000000 --- a/node_modules/core-js/modules/es6.number.to-fixed.js +++ /dev/null @@ -1,114 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var toInteger = require('./_to-integer'); -var aNumberValue = require('./_a-number-value'); -var repeat = require('./_string-repeat'); -var $toFixed = 1.0.toFixed; -var floor = Math.floor; -var data = [0, 0, 0, 0, 0, 0]; -var ERROR = 'Number.toFixed: incorrect invocation!'; -var ZERO = '0'; - -var multiply = function (n, c) { - var i = -1; - var c2 = c; - while (++i < 6) { - c2 += n * data[i]; - data[i] = c2 % 1e7; - c2 = floor(c2 / 1e7); - } -}; -var divide = function (n) { - var i = 6; - var c = 0; - while (--i >= 0) { - c += data[i]; - data[i] = floor(c / n); - c = (c % n) * 1e7; - } -}; -var numToString = function () { - var i = 6; - var s = ''; - while (--i >= 0) { - if (s !== '' || i === 0 || data[i] !== 0) { - var t = String(data[i]); - s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; - } - } return s; -}; -var pow = function (x, n, acc) { - return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); -}; -var log = function (x) { - var n = 0; - var x2 = x; - while (x2 >= 4096) { - n += 12; - x2 /= 4096; - } - while (x2 >= 2) { - n += 1; - x2 /= 2; - } return n; -}; - -$export($export.P + $export.F * (!!$toFixed && ( - 0.00008.toFixed(3) !== '0.000' || - 0.9.toFixed(0) !== '1' || - 1.255.toFixed(2) !== '1.25' || - 1000000000000000128.0.toFixed(0) !== '1000000000000000128' -) || !require('./_fails')(function () { - // V8 ~ Android 4.3- - $toFixed.call({}); -})), 'Number', { - toFixed: function toFixed(fractionDigits) { - var x = aNumberValue(this, ERROR); - var f = toInteger(fractionDigits); - var s = ''; - var m = ZERO; - var e, z, j, k; - if (f < 0 || f > 20) throw RangeError(ERROR); - // eslint-disable-next-line no-self-compare - if (x != x) return 'NaN'; - if (x <= -1e21 || x >= 1e21) return String(x); - if (x < 0) { - s = '-'; - x = -x; - } - if (x > 1e-21) { - e = log(x * pow(2, 69, 1)) - 69; - z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); - z *= 0x10000000000000; - e = 52 - e; - if (e > 0) { - multiply(0, z); - j = f; - while (j >= 7) { - multiply(1e7, 0); - j -= 7; - } - multiply(pow(10, j, 1), 0); - j = e - 1; - while (j >= 23) { - divide(1 << 23); - j -= 23; - } - divide(1 << j); - multiply(1, 1); - divide(2); - m = numToString(); - } else { - multiply(0, z); - multiply(1 << -e, 0); - m = numToString() + repeat.call(ZERO, f); - } - } - if (f > 0) { - k = m.length; - m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); - } else { - m = s + m; - } return m; - } -}); diff --git a/node_modules/core-js/modules/es6.number.to-precision.js b/node_modules/core-js/modules/es6.number.to-precision.js deleted file mode 100644 index 0d92527ff..000000000 --- a/node_modules/core-js/modules/es6.number.to-precision.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $fails = require('./_fails'); -var aNumberValue = require('./_a-number-value'); -var $toPrecision = 1.0.toPrecision; - -$export($export.P + $export.F * ($fails(function () { - // IE7- - return $toPrecision.call(1, undefined) !== '1'; -}) || !$fails(function () { - // V8 ~ Android 4.3- - $toPrecision.call({}); -})), 'Number', { - toPrecision: function toPrecision(precision) { - var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); - return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); - } -}); diff --git a/node_modules/core-js/modules/es6.object.assign.js b/node_modules/core-js/modules/es6.object.assign.js deleted file mode 100644 index d28085a7e..000000000 --- a/node_modules/core-js/modules/es6.object.assign.js +++ /dev/null @@ -1,4 +0,0 @@ -// 19.1.3.1 Object.assign(target, source) -var $export = require('./_export'); - -$export($export.S + $export.F, 'Object', { assign: require('./_object-assign') }); diff --git a/node_modules/core-js/modules/es6.object.create.js b/node_modules/core-js/modules/es6.object.create.js deleted file mode 100644 index 70627d69c..000000000 --- a/node_modules/core-js/modules/es6.object.create.js +++ /dev/null @@ -1,3 +0,0 @@ -var $export = require('./_export'); -// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -$export($export.S, 'Object', { create: require('./_object-create') }); diff --git a/node_modules/core-js/modules/es6.object.define-properties.js b/node_modules/core-js/modules/es6.object.define-properties.js deleted file mode 100644 index 5ec34214d..000000000 --- a/node_modules/core-js/modules/es6.object.define-properties.js +++ /dev/null @@ -1,3 +0,0 @@ -var $export = require('./_export'); -// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) -$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperties: require('./_object-dps') }); diff --git a/node_modules/core-js/modules/es6.object.define-property.js b/node_modules/core-js/modules/es6.object.define-property.js deleted file mode 100644 index 120685825..000000000 --- a/node_modules/core-js/modules/es6.object.define-property.js +++ /dev/null @@ -1,3 +0,0 @@ -var $export = require('./_export'); -// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) -$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperty: require('./_object-dp').f }); diff --git a/node_modules/core-js/modules/es6.object.freeze.js b/node_modules/core-js/modules/es6.object.freeze.js deleted file mode 100644 index 0856ce9d7..000000000 --- a/node_modules/core-js/modules/es6.object.freeze.js +++ /dev/null @@ -1,9 +0,0 @@ -// 19.1.2.5 Object.freeze(O) -var isObject = require('./_is-object'); -var meta = require('./_meta').onFreeze; - -require('./_object-sap')('freeze', function ($freeze) { - return function freeze(it) { - return $freeze && isObject(it) ? $freeze(meta(it)) : it; - }; -}); diff --git a/node_modules/core-js/modules/es6.object.get-own-property-descriptor.js b/node_modules/core-js/modules/es6.object.get-own-property-descriptor.js deleted file mode 100644 index 9df214172..000000000 --- a/node_modules/core-js/modules/es6.object.get-own-property-descriptor.js +++ /dev/null @@ -1,9 +0,0 @@ -// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) -var toIObject = require('./_to-iobject'); -var $getOwnPropertyDescriptor = require('./_object-gopd').f; - -require('./_object-sap')('getOwnPropertyDescriptor', function () { - return function getOwnPropertyDescriptor(it, key) { - return $getOwnPropertyDescriptor(toIObject(it), key); - }; -}); diff --git a/node_modules/core-js/modules/es6.object.get-own-property-names.js b/node_modules/core-js/modules/es6.object.get-own-property-names.js deleted file mode 100644 index 172f51c73..000000000 --- a/node_modules/core-js/modules/es6.object.get-own-property-names.js +++ /dev/null @@ -1,4 +0,0 @@ -// 19.1.2.7 Object.getOwnPropertyNames(O) -require('./_object-sap')('getOwnPropertyNames', function () { - return require('./_object-gopn-ext').f; -}); diff --git a/node_modules/core-js/modules/es6.object.get-prototype-of.js b/node_modules/core-js/modules/es6.object.get-prototype-of.js deleted file mode 100644 index 8fe2728c0..000000000 --- a/node_modules/core-js/modules/es6.object.get-prototype-of.js +++ /dev/null @@ -1,9 +0,0 @@ -// 19.1.2.9 Object.getPrototypeOf(O) -var toObject = require('./_to-object'); -var $getPrototypeOf = require('./_object-gpo'); - -require('./_object-sap')('getPrototypeOf', function () { - return function getPrototypeOf(it) { - return $getPrototypeOf(toObject(it)); - }; -}); diff --git a/node_modules/core-js/modules/es6.object.is-extensible.js b/node_modules/core-js/modules/es6.object.is-extensible.js deleted file mode 100644 index 5cd4575a5..000000000 --- a/node_modules/core-js/modules/es6.object.is-extensible.js +++ /dev/null @@ -1,8 +0,0 @@ -// 19.1.2.11 Object.isExtensible(O) -var isObject = require('./_is-object'); - -require('./_object-sap')('isExtensible', function ($isExtensible) { - return function isExtensible(it) { - return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; - }; -}); diff --git a/node_modules/core-js/modules/es6.object.is-frozen.js b/node_modules/core-js/modules/es6.object.is-frozen.js deleted file mode 100644 index 0ceeabbb0..000000000 --- a/node_modules/core-js/modules/es6.object.is-frozen.js +++ /dev/null @@ -1,8 +0,0 @@ -// 19.1.2.12 Object.isFrozen(O) -var isObject = require('./_is-object'); - -require('./_object-sap')('isFrozen', function ($isFrozen) { - return function isFrozen(it) { - return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; - }; -}); diff --git a/node_modules/core-js/modules/es6.object.is-sealed.js b/node_modules/core-js/modules/es6.object.is-sealed.js deleted file mode 100644 index 7fa8ddedd..000000000 --- a/node_modules/core-js/modules/es6.object.is-sealed.js +++ /dev/null @@ -1,8 +0,0 @@ -// 19.1.2.13 Object.isSealed(O) -var isObject = require('./_is-object'); - -require('./_object-sap')('isSealed', function ($isSealed) { - return function isSealed(it) { - return isObject(it) ? $isSealed ? $isSealed(it) : false : true; - }; -}); diff --git a/node_modules/core-js/modules/es6.object.is.js b/node_modules/core-js/modules/es6.object.is.js deleted file mode 100644 index 204d7030f..000000000 --- a/node_modules/core-js/modules/es6.object.is.js +++ /dev/null @@ -1,3 +0,0 @@ -// 19.1.3.10 Object.is(value1, value2) -var $export = require('./_export'); -$export($export.S, 'Object', { is: require('./_same-value') }); diff --git a/node_modules/core-js/modules/es6.object.keys.js b/node_modules/core-js/modules/es6.object.keys.js deleted file mode 100644 index e9dade7de..000000000 --- a/node_modules/core-js/modules/es6.object.keys.js +++ /dev/null @@ -1,9 +0,0 @@ -// 19.1.2.14 Object.keys(O) -var toObject = require('./_to-object'); -var $keys = require('./_object-keys'); - -require('./_object-sap')('keys', function () { - return function keys(it) { - return $keys(toObject(it)); - }; -}); diff --git a/node_modules/core-js/modules/es6.object.prevent-extensions.js b/node_modules/core-js/modules/es6.object.prevent-extensions.js deleted file mode 100644 index 2f729181f..000000000 --- a/node_modules/core-js/modules/es6.object.prevent-extensions.js +++ /dev/null @@ -1,9 +0,0 @@ -// 19.1.2.15 Object.preventExtensions(O) -var isObject = require('./_is-object'); -var meta = require('./_meta').onFreeze; - -require('./_object-sap')('preventExtensions', function ($preventExtensions) { - return function preventExtensions(it) { - return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; - }; -}); diff --git a/node_modules/core-js/modules/es6.object.seal.js b/node_modules/core-js/modules/es6.object.seal.js deleted file mode 100644 index 12c3f6a3a..000000000 --- a/node_modules/core-js/modules/es6.object.seal.js +++ /dev/null @@ -1,9 +0,0 @@ -// 19.1.2.17 Object.seal(O) -var isObject = require('./_is-object'); -var meta = require('./_meta').onFreeze; - -require('./_object-sap')('seal', function ($seal) { - return function seal(it) { - return $seal && isObject(it) ? $seal(meta(it)) : it; - }; -}); diff --git a/node_modules/core-js/modules/es6.object.set-prototype-of.js b/node_modules/core-js/modules/es6.object.set-prototype-of.js deleted file mode 100644 index 461dbd2ed..000000000 --- a/node_modules/core-js/modules/es6.object.set-prototype-of.js +++ /dev/null @@ -1,3 +0,0 @@ -// 19.1.3.19 Object.setPrototypeOf(O, proto) -var $export = require('./_export'); -$export($export.S, 'Object', { setPrototypeOf: require('./_set-proto').set }); diff --git a/node_modules/core-js/modules/es6.object.to-string.js b/node_modules/core-js/modules/es6.object.to-string.js deleted file mode 100644 index 1c7b85feb..000000000 --- a/node_modules/core-js/modules/es6.object.to-string.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; -// 19.1.3.6 Object.prototype.toString() -var classof = require('./_classof'); -var test = {}; -test[require('./_wks')('toStringTag')] = 'z'; -if (test + '' != '[object z]') { - require('./_redefine')(Object.prototype, 'toString', function toString() { - return '[object ' + classof(this) + ']'; - }, true); -} diff --git a/node_modules/core-js/modules/es6.parse-float.js b/node_modules/core-js/modules/es6.parse-float.js deleted file mode 100644 index cbf50ead5..000000000 --- a/node_modules/core-js/modules/es6.parse-float.js +++ /dev/null @@ -1,4 +0,0 @@ -var $export = require('./_export'); -var $parseFloat = require('./_parse-float'); -// 18.2.4 parseFloat(string) -$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat }); diff --git a/node_modules/core-js/modules/es6.parse-int.js b/node_modules/core-js/modules/es6.parse-int.js deleted file mode 100644 index 7ea358e84..000000000 --- a/node_modules/core-js/modules/es6.parse-int.js +++ /dev/null @@ -1,4 +0,0 @@ -var $export = require('./_export'); -var $parseInt = require('./_parse-int'); -// 18.2.5 parseInt(string, radix) -$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt }); diff --git a/node_modules/core-js/modules/es6.promise.js b/node_modules/core-js/modules/es6.promise.js deleted file mode 100644 index b0ff3bfcf..000000000 --- a/node_modules/core-js/modules/es6.promise.js +++ /dev/null @@ -1,286 +0,0 @@ -'use strict'; -var LIBRARY = require('./_library'); -var global = require('./_global'); -var ctx = require('./_ctx'); -var classof = require('./_classof'); -var $export = require('./_export'); -var isObject = require('./_is-object'); -var aFunction = require('./_a-function'); -var anInstance = require('./_an-instance'); -var forOf = require('./_for-of'); -var speciesConstructor = require('./_species-constructor'); -var task = require('./_task').set; -var microtask = require('./_microtask')(); -var newPromiseCapabilityModule = require('./_new-promise-capability'); -var perform = require('./_perform'); -var userAgent = require('./_user-agent'); -var promiseResolve = require('./_promise-resolve'); -var PROMISE = 'Promise'; -var TypeError = global.TypeError; -var process = global.process; -var versions = process && process.versions; -var v8 = versions && versions.v8 || ''; -var $Promise = global[PROMISE]; -var isNode = classof(process) == 'process'; -var empty = function () { /* empty */ }; -var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; -var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; - -var USE_NATIVE = !!function () { - try { - // correct subclassing with @@species support - var promise = $Promise.resolve(1); - var FakePromise = (promise.constructor = {})[require('./_wks')('species')] = function (exec) { - exec(empty, empty); - }; - // unhandled rejections tracking support, NodeJS Promise without it fails @@species test - return (isNode || typeof PromiseRejectionEvent == 'function') - && promise.then(empty) instanceof FakePromise - // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables - // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 - // we can't detect it synchronously, so just check versions - && v8.indexOf('6.6') !== 0 - && userAgent.indexOf('Chrome/66') === -1; - } catch (e) { /* empty */ } -}(); - -// helpers -var isThenable = function (it) { - var then; - return isObject(it) && typeof (then = it.then) == 'function' ? then : false; -}; -var notify = function (promise, isReject) { - if (promise._n) return; - promise._n = true; - var chain = promise._c; - microtask(function () { - var value = promise._v; - var ok = promise._s == 1; - var i = 0; - var run = function (reaction) { - var handler = ok ? reaction.ok : reaction.fail; - var resolve = reaction.resolve; - var reject = reaction.reject; - var domain = reaction.domain; - var result, then, exited; - try { - if (handler) { - if (!ok) { - if (promise._h == 2) onHandleUnhandled(promise); - promise._h = 1; - } - if (handler === true) result = value; - else { - if (domain) domain.enter(); - result = handler(value); // may throw - if (domain) { - domain.exit(); - exited = true; - } - } - if (result === reaction.promise) { - reject(TypeError('Promise-chain cycle')); - } else if (then = isThenable(result)) { - then.call(result, resolve, reject); - } else resolve(result); - } else reject(value); - } catch (e) { - if (domain && !exited) domain.exit(); - reject(e); - } - }; - while (chain.length > i) run(chain[i++]); // variable length - can't use forEach - promise._c = []; - promise._n = false; - if (isReject && !promise._h) onUnhandled(promise); - }); -}; -var onUnhandled = function (promise) { - task.call(global, function () { - var value = promise._v; - var unhandled = isUnhandled(promise); - var result, handler, console; - if (unhandled) { - result = perform(function () { - if (isNode) { - process.emit('unhandledRejection', value, promise); - } else if (handler = global.onunhandledrejection) { - handler({ promise: promise, reason: value }); - } else if ((console = global.console) && console.error) { - console.error('Unhandled promise rejection', value); - } - }); - // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should - promise._h = isNode || isUnhandled(promise) ? 2 : 1; - } promise._a = undefined; - if (unhandled && result.e) throw result.v; - }); -}; -var isUnhandled = function (promise) { - return promise._h !== 1 && (promise._a || promise._c).length === 0; -}; -var onHandleUnhandled = function (promise) { - task.call(global, function () { - var handler; - if (isNode) { - process.emit('rejectionHandled', promise); - } else if (handler = global.onrejectionhandled) { - handler({ promise: promise, reason: promise._v }); - } - }); -}; -var $reject = function (value) { - var promise = this; - if (promise._d) return; - promise._d = true; - promise = promise._w || promise; // unwrap - promise._v = value; - promise._s = 2; - if (!promise._a) promise._a = promise._c.slice(); - notify(promise, true); -}; -var $resolve = function (value) { - var promise = this; - var then; - if (promise._d) return; - promise._d = true; - promise = promise._w || promise; // unwrap - try { - if (promise === value) throw TypeError("Promise can't be resolved itself"); - if (then = isThenable(value)) { - microtask(function () { - var wrapper = { _w: promise, _d: false }; // wrap - try { - then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); - } catch (e) { - $reject.call(wrapper, e); - } - }); - } else { - promise._v = value; - promise._s = 1; - notify(promise, false); - } - } catch (e) { - $reject.call({ _w: promise, _d: false }, e); // wrap - } -}; - -// constructor polyfill -if (!USE_NATIVE) { - // 25.4.3.1 Promise(executor) - $Promise = function Promise(executor) { - anInstance(this, $Promise, PROMISE, '_h'); - aFunction(executor); - Internal.call(this); - try { - executor(ctx($resolve, this, 1), ctx($reject, this, 1)); - } catch (err) { - $reject.call(this, err); - } - }; - // eslint-disable-next-line no-unused-vars - Internal = function Promise(executor) { - this._c = []; // <- awaiting reactions - this._a = undefined; // <- checked in isUnhandled reactions - this._s = 0; // <- state - this._d = false; // <- done - this._v = undefined; // <- value - this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled - this._n = false; // <- notify - }; - Internal.prototype = require('./_redefine-all')($Promise.prototype, { - // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) - then: function then(onFulfilled, onRejected) { - var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); - reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; - reaction.fail = typeof onRejected == 'function' && onRejected; - reaction.domain = isNode ? process.domain : undefined; - this._c.push(reaction); - if (this._a) this._a.push(reaction); - if (this._s) notify(this, false); - return reaction.promise; - }, - // 25.4.5.1 Promise.prototype.catch(onRejected) - 'catch': function (onRejected) { - return this.then(undefined, onRejected); - } - }); - OwnPromiseCapability = function () { - var promise = new Internal(); - this.promise = promise; - this.resolve = ctx($resolve, promise, 1); - this.reject = ctx($reject, promise, 1); - }; - newPromiseCapabilityModule.f = newPromiseCapability = function (C) { - return C === $Promise || C === Wrapper - ? new OwnPromiseCapability(C) - : newGenericPromiseCapability(C); - }; -} - -$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); -require('./_set-to-string-tag')($Promise, PROMISE); -require('./_set-species')(PROMISE); -Wrapper = require('./_core')[PROMISE]; - -// statics -$export($export.S + $export.F * !USE_NATIVE, PROMISE, { - // 25.4.4.5 Promise.reject(r) - reject: function reject(r) { - var capability = newPromiseCapability(this); - var $$reject = capability.reject; - $$reject(r); - return capability.promise; - } -}); -$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { - // 25.4.4.6 Promise.resolve(x) - resolve: function resolve(x) { - return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); - } -}); -$export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(function (iter) { - $Promise.all(iter)['catch'](empty); -})), PROMISE, { - // 25.4.4.1 Promise.all(iterable) - all: function all(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var resolve = capability.resolve; - var reject = capability.reject; - var result = perform(function () { - var values = []; - var index = 0; - var remaining = 1; - forOf(iterable, false, function (promise) { - var $index = index++; - var alreadyCalled = false; - values.push(undefined); - remaining++; - C.resolve(promise).then(function (value) { - if (alreadyCalled) return; - alreadyCalled = true; - values[$index] = value; - --remaining || resolve(values); - }, reject); - }); - --remaining || resolve(values); - }); - if (result.e) reject(result.v); - return capability.promise; - }, - // 25.4.4.4 Promise.race(iterable) - race: function race(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var reject = capability.reject; - var result = perform(function () { - forOf(iterable, false, function (promise) { - C.resolve(promise).then(capability.resolve, reject); - }); - }); - if (result.e) reject(result.v); - return capability.promise; - } -}); diff --git a/node_modules/core-js/modules/es6.reflect.apply.js b/node_modules/core-js/modules/es6.reflect.apply.js deleted file mode 100644 index 3b9c03a91..000000000 --- a/node_modules/core-js/modules/es6.reflect.apply.js +++ /dev/null @@ -1,16 +0,0 @@ -// 26.1.1 Reflect.apply(target, thisArgument, argumentsList) -var $export = require('./_export'); -var aFunction = require('./_a-function'); -var anObject = require('./_an-object'); -var rApply = (require('./_global').Reflect || {}).apply; -var fApply = Function.apply; -// MS Edge argumentsList argument is optional -$export($export.S + $export.F * !require('./_fails')(function () { - rApply(function () { /* empty */ }); -}), 'Reflect', { - apply: function apply(target, thisArgument, argumentsList) { - var T = aFunction(target); - var L = anObject(argumentsList); - return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); - } -}); diff --git a/node_modules/core-js/modules/es6.reflect.construct.js b/node_modules/core-js/modules/es6.reflect.construct.js deleted file mode 100644 index 380addb57..000000000 --- a/node_modules/core-js/modules/es6.reflect.construct.js +++ /dev/null @@ -1,47 +0,0 @@ -// 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) -var $export = require('./_export'); -var create = require('./_object-create'); -var aFunction = require('./_a-function'); -var anObject = require('./_an-object'); -var isObject = require('./_is-object'); -var fails = require('./_fails'); -var bind = require('./_bind'); -var rConstruct = (require('./_global').Reflect || {}).construct; - -// MS Edge supports only 2 arguments and argumentsList argument is optional -// FF Nightly sets third argument as `new.target`, but does not create `this` from it -var NEW_TARGET_BUG = fails(function () { - function F() { /* empty */ } - return !(rConstruct(function () { /* empty */ }, [], F) instanceof F); -}); -var ARGS_BUG = !fails(function () { - rConstruct(function () { /* empty */ }); -}); - -$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { - construct: function construct(Target, args /* , newTarget */) { - aFunction(Target); - anObject(args); - var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); - if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget); - if (Target == newTarget) { - // w/o altered newTarget, optimization for 0-4 arguments - switch (args.length) { - case 0: return new Target(); - case 1: return new Target(args[0]); - case 2: return new Target(args[0], args[1]); - case 3: return new Target(args[0], args[1], args[2]); - case 4: return new Target(args[0], args[1], args[2], args[3]); - } - // w/o altered newTarget, lot of arguments case - var $args = [null]; - $args.push.apply($args, args); - return new (bind.apply(Target, $args))(); - } - // with altered newTarget, not support built-in constructors - var proto = newTarget.prototype; - var instance = create(isObject(proto) ? proto : Object.prototype); - var result = Function.apply.call(Target, instance, args); - return isObject(result) ? result : instance; - } -}); diff --git a/node_modules/core-js/modules/es6.reflect.define-property.js b/node_modules/core-js/modules/es6.reflect.define-property.js deleted file mode 100644 index be7fbde6b..000000000 --- a/node_modules/core-js/modules/es6.reflect.define-property.js +++ /dev/null @@ -1,23 +0,0 @@ -// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) -var dP = require('./_object-dp'); -var $export = require('./_export'); -var anObject = require('./_an-object'); -var toPrimitive = require('./_to-primitive'); - -// MS Edge has broken Reflect.defineProperty - throwing instead of returning false -$export($export.S + $export.F * require('./_fails')(function () { - // eslint-disable-next-line no-undef - Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 }); -}), 'Reflect', { - defineProperty: function defineProperty(target, propertyKey, attributes) { - anObject(target); - propertyKey = toPrimitive(propertyKey, true); - anObject(attributes); - try { - dP.f(target, propertyKey, attributes); - return true; - } catch (e) { - return false; - } - } -}); diff --git a/node_modules/core-js/modules/es6.reflect.delete-property.js b/node_modules/core-js/modules/es6.reflect.delete-property.js deleted file mode 100644 index 0902b38a9..000000000 --- a/node_modules/core-js/modules/es6.reflect.delete-property.js +++ /dev/null @@ -1,11 +0,0 @@ -// 26.1.4 Reflect.deleteProperty(target, propertyKey) -var $export = require('./_export'); -var gOPD = require('./_object-gopd').f; -var anObject = require('./_an-object'); - -$export($export.S, 'Reflect', { - deleteProperty: function deleteProperty(target, propertyKey) { - var desc = gOPD(anObject(target), propertyKey); - return desc && !desc.configurable ? false : delete target[propertyKey]; - } -}); diff --git a/node_modules/core-js/modules/es6.reflect.enumerate.js b/node_modules/core-js/modules/es6.reflect.enumerate.js deleted file mode 100644 index 9e7c76a34..000000000 --- a/node_modules/core-js/modules/es6.reflect.enumerate.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; -// 26.1.5 Reflect.enumerate(target) -var $export = require('./_export'); -var anObject = require('./_an-object'); -var Enumerate = function (iterated) { - this._t = anObject(iterated); // target - this._i = 0; // next index - var keys = this._k = []; // keys - var key; - for (key in iterated) keys.push(key); -}; -require('./_iter-create')(Enumerate, 'Object', function () { - var that = this; - var keys = that._k; - var key; - do { - if (that._i >= keys.length) return { value: undefined, done: true }; - } while (!((key = keys[that._i++]) in that._t)); - return { value: key, done: false }; -}); - -$export($export.S, 'Reflect', { - enumerate: function enumerate(target) { - return new Enumerate(target); - } -}); diff --git a/node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js b/node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js deleted file mode 100644 index e1299f906..000000000 --- a/node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js +++ /dev/null @@ -1,10 +0,0 @@ -// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) -var gOPD = require('./_object-gopd'); -var $export = require('./_export'); -var anObject = require('./_an-object'); - -$export($export.S, 'Reflect', { - getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { - return gOPD.f(anObject(target), propertyKey); - } -}); diff --git a/node_modules/core-js/modules/es6.reflect.get-prototype-of.js b/node_modules/core-js/modules/es6.reflect.get-prototype-of.js deleted file mode 100644 index 28351d410..000000000 --- a/node_modules/core-js/modules/es6.reflect.get-prototype-of.js +++ /dev/null @@ -1,10 +0,0 @@ -// 26.1.8 Reflect.getPrototypeOf(target) -var $export = require('./_export'); -var getProto = require('./_object-gpo'); -var anObject = require('./_an-object'); - -$export($export.S, 'Reflect', { - getPrototypeOf: function getPrototypeOf(target) { - return getProto(anObject(target)); - } -}); diff --git a/node_modules/core-js/modules/es6.reflect.get.js b/node_modules/core-js/modules/es6.reflect.get.js deleted file mode 100644 index a7ee76667..000000000 --- a/node_modules/core-js/modules/es6.reflect.get.js +++ /dev/null @@ -1,21 +0,0 @@ -// 26.1.6 Reflect.get(target, propertyKey [, receiver]) -var gOPD = require('./_object-gopd'); -var getPrototypeOf = require('./_object-gpo'); -var has = require('./_has'); -var $export = require('./_export'); -var isObject = require('./_is-object'); -var anObject = require('./_an-object'); - -function get(target, propertyKey /* , receiver */) { - var receiver = arguments.length < 3 ? target : arguments[2]; - var desc, proto; - if (anObject(target) === receiver) return target[propertyKey]; - if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value') - ? desc.value - : desc.get !== undefined - ? desc.get.call(receiver) - : undefined; - if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver); -} - -$export($export.S, 'Reflect', { get: get }); diff --git a/node_modules/core-js/modules/es6.reflect.has.js b/node_modules/core-js/modules/es6.reflect.has.js deleted file mode 100644 index 4f5efa992..000000000 --- a/node_modules/core-js/modules/es6.reflect.has.js +++ /dev/null @@ -1,8 +0,0 @@ -// 26.1.9 Reflect.has(target, propertyKey) -var $export = require('./_export'); - -$export($export.S, 'Reflect', { - has: function has(target, propertyKey) { - return propertyKey in target; - } -}); diff --git a/node_modules/core-js/modules/es6.reflect.is-extensible.js b/node_modules/core-js/modules/es6.reflect.is-extensible.js deleted file mode 100644 index 700f938ac..000000000 --- a/node_modules/core-js/modules/es6.reflect.is-extensible.js +++ /dev/null @@ -1,11 +0,0 @@ -// 26.1.10 Reflect.isExtensible(target) -var $export = require('./_export'); -var anObject = require('./_an-object'); -var $isExtensible = Object.isExtensible; - -$export($export.S, 'Reflect', { - isExtensible: function isExtensible(target) { - anObject(target); - return $isExtensible ? $isExtensible(target) : true; - } -}); diff --git a/node_modules/core-js/modules/es6.reflect.own-keys.js b/node_modules/core-js/modules/es6.reflect.own-keys.js deleted file mode 100644 index 9f2424ae8..000000000 --- a/node_modules/core-js/modules/es6.reflect.own-keys.js +++ /dev/null @@ -1,4 +0,0 @@ -// 26.1.11 Reflect.ownKeys(target) -var $export = require('./_export'); - -$export($export.S, 'Reflect', { ownKeys: require('./_own-keys') }); diff --git a/node_modules/core-js/modules/es6.reflect.prevent-extensions.js b/node_modules/core-js/modules/es6.reflect.prevent-extensions.js deleted file mode 100644 index e1037fa19..000000000 --- a/node_modules/core-js/modules/es6.reflect.prevent-extensions.js +++ /dev/null @@ -1,16 +0,0 @@ -// 26.1.12 Reflect.preventExtensions(target) -var $export = require('./_export'); -var anObject = require('./_an-object'); -var $preventExtensions = Object.preventExtensions; - -$export($export.S, 'Reflect', { - preventExtensions: function preventExtensions(target) { - anObject(target); - try { - if ($preventExtensions) $preventExtensions(target); - return true; - } catch (e) { - return false; - } - } -}); diff --git a/node_modules/core-js/modules/es6.reflect.set-prototype-of.js b/node_modules/core-js/modules/es6.reflect.set-prototype-of.js deleted file mode 100644 index 5dae90122..000000000 --- a/node_modules/core-js/modules/es6.reflect.set-prototype-of.js +++ /dev/null @@ -1,15 +0,0 @@ -// 26.1.14 Reflect.setPrototypeOf(target, proto) -var $export = require('./_export'); -var setProto = require('./_set-proto'); - -if (setProto) $export($export.S, 'Reflect', { - setPrototypeOf: function setPrototypeOf(target, proto) { - setProto.check(target, proto); - try { - setProto.set(target, proto); - return true; - } catch (e) { - return false; - } - } -}); diff --git a/node_modules/core-js/modules/es6.reflect.set.js b/node_modules/core-js/modules/es6.reflect.set.js deleted file mode 100644 index d809d7a4e..000000000 --- a/node_modules/core-js/modules/es6.reflect.set.js +++ /dev/null @@ -1,33 +0,0 @@ -// 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) -var dP = require('./_object-dp'); -var gOPD = require('./_object-gopd'); -var getPrototypeOf = require('./_object-gpo'); -var has = require('./_has'); -var $export = require('./_export'); -var createDesc = require('./_property-desc'); -var anObject = require('./_an-object'); -var isObject = require('./_is-object'); - -function set(target, propertyKey, V /* , receiver */) { - var receiver = arguments.length < 4 ? target : arguments[3]; - var ownDesc = gOPD.f(anObject(target), propertyKey); - var existingDescriptor, proto; - if (!ownDesc) { - if (isObject(proto = getPrototypeOf(target))) { - return set(proto, propertyKey, V, receiver); - } - ownDesc = createDesc(0); - } - if (has(ownDesc, 'value')) { - if (ownDesc.writable === false || !isObject(receiver)) return false; - if (existingDescriptor = gOPD.f(receiver, propertyKey)) { - if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false; - existingDescriptor.value = V; - dP.f(receiver, propertyKey, existingDescriptor); - } else dP.f(receiver, propertyKey, createDesc(0, V)); - return true; - } - return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); -} - -$export($export.S, 'Reflect', { set: set }); diff --git a/node_modules/core-js/modules/es6.regexp.constructor.js b/node_modules/core-js/modules/es6.regexp.constructor.js deleted file mode 100644 index 76247c32f..000000000 --- a/node_modules/core-js/modules/es6.regexp.constructor.js +++ /dev/null @@ -1,43 +0,0 @@ -var global = require('./_global'); -var inheritIfRequired = require('./_inherit-if-required'); -var dP = require('./_object-dp').f; -var gOPN = require('./_object-gopn').f; -var isRegExp = require('./_is-regexp'); -var $flags = require('./_flags'); -var $RegExp = global.RegExp; -var Base = $RegExp; -var proto = $RegExp.prototype; -var re1 = /a/g; -var re2 = /a/g; -// "new" creates a new object, old webkit buggy here -var CORRECT_NEW = new $RegExp(re1) !== re1; - -if (require('./_descriptors') && (!CORRECT_NEW || require('./_fails')(function () { - re2[require('./_wks')('match')] = false; - // RegExp constructor can alter flags and IsRegExp works correct with @@match - return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i'; -}))) { - $RegExp = function RegExp(p, f) { - var tiRE = this instanceof $RegExp; - var piRE = isRegExp(p); - var fiU = f === undefined; - return !tiRE && piRE && p.constructor === $RegExp && fiU ? p - : inheritIfRequired(CORRECT_NEW - ? new Base(piRE && !fiU ? p.source : p, f) - : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f) - , tiRE ? this : proto, $RegExp); - }; - var proxy = function (key) { - key in $RegExp || dP($RegExp, key, { - configurable: true, - get: function () { return Base[key]; }, - set: function (it) { Base[key] = it; } - }); - }; - for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]); - proto.constructor = $RegExp; - $RegExp.prototype = proto; - require('./_redefine')(global, 'RegExp', $RegExp); -} - -require('./_set-species')('RegExp'); diff --git a/node_modules/core-js/modules/es6.regexp.flags.js b/node_modules/core-js/modules/es6.regexp.flags.js deleted file mode 100644 index 47008680b..000000000 --- a/node_modules/core-js/modules/es6.regexp.flags.js +++ /dev/null @@ -1,5 +0,0 @@ -// 21.2.5.3 get RegExp.prototype.flags() -if (require('./_descriptors') && /./g.flags != 'g') require('./_object-dp').f(RegExp.prototype, 'flags', { - configurable: true, - get: require('./_flags') -}); diff --git a/node_modules/core-js/modules/es6.regexp.match.js b/node_modules/core-js/modules/es6.regexp.match.js deleted file mode 100644 index 4f71de091..000000000 --- a/node_modules/core-js/modules/es6.regexp.match.js +++ /dev/null @@ -1,10 +0,0 @@ -// @@match logic -require('./_fix-re-wks')('match', 1, function (defined, MATCH, $match) { - // 21.1.3.11 String.prototype.match(regexp) - return [function match(regexp) { - 'use strict'; - var O = defined(this); - var fn = regexp == undefined ? undefined : regexp[MATCH]; - return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); - }, $match]; -}); diff --git a/node_modules/core-js/modules/es6.regexp.replace.js b/node_modules/core-js/modules/es6.regexp.replace.js deleted file mode 100644 index 75ce2df74..000000000 --- a/node_modules/core-js/modules/es6.regexp.replace.js +++ /dev/null @@ -1,12 +0,0 @@ -// @@replace logic -require('./_fix-re-wks')('replace', 2, function (defined, REPLACE, $replace) { - // 21.1.3.14 String.prototype.replace(searchValue, replaceValue) - return [function replace(searchValue, replaceValue) { - 'use strict'; - var O = defined(this); - var fn = searchValue == undefined ? undefined : searchValue[REPLACE]; - return fn !== undefined - ? fn.call(searchValue, O, replaceValue) - : $replace.call(String(O), searchValue, replaceValue); - }, $replace]; -}); diff --git a/node_modules/core-js/modules/es6.regexp.search.js b/node_modules/core-js/modules/es6.regexp.search.js deleted file mode 100644 index df80ed9af..000000000 --- a/node_modules/core-js/modules/es6.regexp.search.js +++ /dev/null @@ -1,10 +0,0 @@ -// @@search logic -require('./_fix-re-wks')('search', 1, function (defined, SEARCH, $search) { - // 21.1.3.15 String.prototype.search(regexp) - return [function search(regexp) { - 'use strict'; - var O = defined(this); - var fn = regexp == undefined ? undefined : regexp[SEARCH]; - return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); - }, $search]; -}); diff --git a/node_modules/core-js/modules/es6.regexp.split.js b/node_modules/core-js/modules/es6.regexp.split.js deleted file mode 100644 index ce796b384..000000000 --- a/node_modules/core-js/modules/es6.regexp.split.js +++ /dev/null @@ -1,71 +0,0 @@ -// @@split logic -require('./_fix-re-wks')('split', 2, function (defined, SPLIT, $split) { - 'use strict'; - var isRegExp = require('./_is-regexp'); - var _split = $split; - var $push = [].push; - var $SPLIT = 'split'; - var LENGTH = 'length'; - var LAST_INDEX = 'lastIndex'; - if ( - 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || - 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || - 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || - '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || - '.'[$SPLIT](/()()/)[LENGTH] > 1 || - ''[$SPLIT](/.?/)[LENGTH] - ) { - var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group - // based on es5-shim implementation, need to rework it - $split = function (separator, limit) { - var string = String(this); - if (separator === undefined && limit === 0) return []; - // If `separator` is not a regex, use native split - if (!isRegExp(separator)) return _split.call(string, separator, limit); - var output = []; - var flags = (separator.ignoreCase ? 'i' : '') + - (separator.multiline ? 'm' : '') + - (separator.unicode ? 'u' : '') + - (separator.sticky ? 'y' : ''); - var lastLastIndex = 0; - var splitLimit = limit === undefined ? 4294967295 : limit >>> 0; - // Make `global` and avoid `lastIndex` issues by working with a copy - var separatorCopy = new RegExp(separator.source, flags + 'g'); - var separator2, match, lastIndex, lastLength, i; - // Doesn't need flags gy, but they don't hurt - if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags); - while (match = separatorCopy.exec(string)) { - // `separatorCopy.lastIndex` is not reliable cross-browser - lastIndex = match.index + match[0][LENGTH]; - if (lastIndex > lastLastIndex) { - output.push(string.slice(lastLastIndex, match.index)); - // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG - // eslint-disable-next-line no-loop-func - if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () { - for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined; - }); - if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1)); - lastLength = match[0][LENGTH]; - lastLastIndex = lastIndex; - if (output[LENGTH] >= splitLimit) break; - } - if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop - } - if (lastLastIndex === string[LENGTH]) { - if (lastLength || !separatorCopy.test('')) output.push(''); - } else output.push(string.slice(lastLastIndex)); - return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; - }; - // Chakra, V8 - } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) { - $split = function (separator, limit) { - return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit); - }; - } - // 21.1.3.17 String.prototype.split(separator, limit) - return [function split(separator, limit) { - var O = defined(this); - var fn = separator == undefined ? undefined : separator[SPLIT]; - return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit); - }, $split]; -}); diff --git a/node_modules/core-js/modules/es6.regexp.to-string.js b/node_modules/core-js/modules/es6.regexp.to-string.js deleted file mode 100644 index 33d6e6fe3..000000000 --- a/node_modules/core-js/modules/es6.regexp.to-string.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; -require('./es6.regexp.flags'); -var anObject = require('./_an-object'); -var $flags = require('./_flags'); -var DESCRIPTORS = require('./_descriptors'); -var TO_STRING = 'toString'; -var $toString = /./[TO_STRING]; - -var define = function (fn) { - require('./_redefine')(RegExp.prototype, TO_STRING, fn, true); -}; - -// 21.2.5.14 RegExp.prototype.toString() -if (require('./_fails')(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) { - define(function toString() { - var R = anObject(this); - return '/'.concat(R.source, '/', - 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined); - }); -// FF44- RegExp#toString has a wrong name -} else if ($toString.name != TO_STRING) { - define(function toString() { - return $toString.call(this); - }); -} diff --git a/node_modules/core-js/modules/es6.set.js b/node_modules/core-js/modules/es6.set.js deleted file mode 100644 index 55b8bdd89..000000000 --- a/node_modules/core-js/modules/es6.set.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; -var strong = require('./_collection-strong'); -var validate = require('./_validate-collection'); -var SET = 'Set'; - -// 23.2 Set Objects -module.exports = require('./_collection')(SET, function (get) { - return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; -}, { - // 23.2.3.1 Set.prototype.add(value) - add: function add(value) { - return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value); - } -}, strong); diff --git a/node_modules/core-js/modules/es6.string.anchor.js b/node_modules/core-js/modules/es6.string.anchor.js deleted file mode 100644 index 3493e54c0..000000000 --- a/node_modules/core-js/modules/es6.string.anchor.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.2 String.prototype.anchor(name) -require('./_string-html')('anchor', function (createHTML) { - return function anchor(name) { - return createHTML(this, 'a', 'name', name); - }; -}); diff --git a/node_modules/core-js/modules/es6.string.big.js b/node_modules/core-js/modules/es6.string.big.js deleted file mode 100644 index 38aab3414..000000000 --- a/node_modules/core-js/modules/es6.string.big.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.3 String.prototype.big() -require('./_string-html')('big', function (createHTML) { - return function big() { - return createHTML(this, 'big', '', ''); - }; -}); diff --git a/node_modules/core-js/modules/es6.string.blink.js b/node_modules/core-js/modules/es6.string.blink.js deleted file mode 100644 index 6188d96e3..000000000 --- a/node_modules/core-js/modules/es6.string.blink.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.4 String.prototype.blink() -require('./_string-html')('blink', function (createHTML) { - return function blink() { - return createHTML(this, 'blink', '', ''); - }; -}); diff --git a/node_modules/core-js/modules/es6.string.bold.js b/node_modules/core-js/modules/es6.string.bold.js deleted file mode 100644 index ff3ecb9cb..000000000 --- a/node_modules/core-js/modules/es6.string.bold.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.5 String.prototype.bold() -require('./_string-html')('bold', function (createHTML) { - return function bold() { - return createHTML(this, 'b', '', ''); - }; -}); diff --git a/node_modules/core-js/modules/es6.string.code-point-at.js b/node_modules/core-js/modules/es6.string.code-point-at.js deleted file mode 100644 index e39b8c5ea..000000000 --- a/node_modules/core-js/modules/es6.string.code-point-at.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $at = require('./_string-at')(false); -$export($export.P, 'String', { - // 21.1.3.3 String.prototype.codePointAt(pos) - codePointAt: function codePointAt(pos) { - return $at(this, pos); - } -}); diff --git a/node_modules/core-js/modules/es6.string.ends-with.js b/node_modules/core-js/modules/es6.string.ends-with.js deleted file mode 100644 index 065688884..000000000 --- a/node_modules/core-js/modules/es6.string.ends-with.js +++ /dev/null @@ -1,20 +0,0 @@ -// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) -'use strict'; -var $export = require('./_export'); -var toLength = require('./_to-length'); -var context = require('./_string-context'); -var ENDS_WITH = 'endsWith'; -var $endsWith = ''[ENDS_WITH]; - -$export($export.P + $export.F * require('./_fails-is-regexp')(ENDS_WITH), 'String', { - endsWith: function endsWith(searchString /* , endPosition = @length */) { - var that = context(this, searchString, ENDS_WITH); - var endPosition = arguments.length > 1 ? arguments[1] : undefined; - var len = toLength(that.length); - var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); - var search = String(searchString); - return $endsWith - ? $endsWith.call(that, search, end) - : that.slice(end - search.length, end) === search; - } -}); diff --git a/node_modules/core-js/modules/es6.string.fixed.js b/node_modules/core-js/modules/es6.string.fixed.js deleted file mode 100644 index d4a60f37d..000000000 --- a/node_modules/core-js/modules/es6.string.fixed.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.6 String.prototype.fixed() -require('./_string-html')('fixed', function (createHTML) { - return function fixed() { - return createHTML(this, 'tt', '', ''); - }; -}); diff --git a/node_modules/core-js/modules/es6.string.fontcolor.js b/node_modules/core-js/modules/es6.string.fontcolor.js deleted file mode 100644 index f7b95957c..000000000 --- a/node_modules/core-js/modules/es6.string.fontcolor.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.7 String.prototype.fontcolor(color) -require('./_string-html')('fontcolor', function (createHTML) { - return function fontcolor(color) { - return createHTML(this, 'font', 'color', color); - }; -}); diff --git a/node_modules/core-js/modules/es6.string.fontsize.js b/node_modules/core-js/modules/es6.string.fontsize.js deleted file mode 100644 index f4cc20aec..000000000 --- a/node_modules/core-js/modules/es6.string.fontsize.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.8 String.prototype.fontsize(size) -require('./_string-html')('fontsize', function (createHTML) { - return function fontsize(size) { - return createHTML(this, 'font', 'size', size); - }; -}); diff --git a/node_modules/core-js/modules/es6.string.from-code-point.js b/node_modules/core-js/modules/es6.string.from-code-point.js deleted file mode 100644 index bece66e29..000000000 --- a/node_modules/core-js/modules/es6.string.from-code-point.js +++ /dev/null @@ -1,23 +0,0 @@ -var $export = require('./_export'); -var toAbsoluteIndex = require('./_to-absolute-index'); -var fromCharCode = String.fromCharCode; -var $fromCodePoint = String.fromCodePoint; - -// length should be 1, old FF problem -$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { - // 21.1.2.2 String.fromCodePoint(...codePoints) - fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars - var res = []; - var aLen = arguments.length; - var i = 0; - var code; - while (aLen > i) { - code = +arguments[i++]; - if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); - res.push(code < 0x10000 - ? fromCharCode(code) - : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) - ); - } return res.join(''); - } -}); diff --git a/node_modules/core-js/modules/es6.string.includes.js b/node_modules/core-js/modules/es6.string.includes.js deleted file mode 100644 index 28d17416b..000000000 --- a/node_modules/core-js/modules/es6.string.includes.js +++ /dev/null @@ -1,12 +0,0 @@ -// 21.1.3.7 String.prototype.includes(searchString, position = 0) -'use strict'; -var $export = require('./_export'); -var context = require('./_string-context'); -var INCLUDES = 'includes'; - -$export($export.P + $export.F * require('./_fails-is-regexp')(INCLUDES), 'String', { - includes: function includes(searchString /* , position = 0 */) { - return !!~context(this, searchString, INCLUDES) - .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); - } -}); diff --git a/node_modules/core-js/modules/es6.string.italics.js b/node_modules/core-js/modules/es6.string.italics.js deleted file mode 100644 index ed4cc3bf0..000000000 --- a/node_modules/core-js/modules/es6.string.italics.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.9 String.prototype.italics() -require('./_string-html')('italics', function (createHTML) { - return function italics() { - return createHTML(this, 'i', '', ''); - }; -}); diff --git a/node_modules/core-js/modules/es6.string.iterator.js b/node_modules/core-js/modules/es6.string.iterator.js deleted file mode 100644 index 5d84c7fde..000000000 --- a/node_modules/core-js/modules/es6.string.iterator.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; -var $at = require('./_string-at')(true); - -// 21.1.3.27 String.prototype[@@iterator]() -require('./_iter-define')(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 }; -}); diff --git a/node_modules/core-js/modules/es6.string.link.js b/node_modules/core-js/modules/es6.string.link.js deleted file mode 100644 index d0255edd6..000000000 --- a/node_modules/core-js/modules/es6.string.link.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.10 String.prototype.link(url) -require('./_string-html')('link', function (createHTML) { - return function link(url) { - return createHTML(this, 'a', 'href', url); - }; -}); diff --git a/node_modules/core-js/modules/es6.string.raw.js b/node_modules/core-js/modules/es6.string.raw.js deleted file mode 100644 index aa40ff6fa..000000000 --- a/node_modules/core-js/modules/es6.string.raw.js +++ /dev/null @@ -1,18 +0,0 @@ -var $export = require('./_export'); -var toIObject = require('./_to-iobject'); -var toLength = require('./_to-length'); - -$export($export.S, 'String', { - // 21.1.2.4 String.raw(callSite, ...substitutions) - raw: function raw(callSite) { - var tpl = toIObject(callSite.raw); - var len = toLength(tpl.length); - var aLen = arguments.length; - var res = []; - var i = 0; - while (len > i) { - res.push(String(tpl[i++])); - if (i < aLen) res.push(String(arguments[i])); - } return res.join(''); - } -}); diff --git a/node_modules/core-js/modules/es6.string.repeat.js b/node_modules/core-js/modules/es6.string.repeat.js deleted file mode 100644 index 08412d91b..000000000 --- a/node_modules/core-js/modules/es6.string.repeat.js +++ /dev/null @@ -1,6 +0,0 @@ -var $export = require('./_export'); - -$export($export.P, 'String', { - // 21.1.3.13 String.prototype.repeat(count) - repeat: require('./_string-repeat') -}); diff --git a/node_modules/core-js/modules/es6.string.small.js b/node_modules/core-js/modules/es6.string.small.js deleted file mode 100644 index 941e4a767..000000000 --- a/node_modules/core-js/modules/es6.string.small.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.11 String.prototype.small() -require('./_string-html')('small', function (createHTML) { - return function small() { - return createHTML(this, 'small', '', ''); - }; -}); diff --git a/node_modules/core-js/modules/es6.string.starts-with.js b/node_modules/core-js/modules/es6.string.starts-with.js deleted file mode 100644 index c1723767d..000000000 --- a/node_modules/core-js/modules/es6.string.starts-with.js +++ /dev/null @@ -1,18 +0,0 @@ -// 21.1.3.18 String.prototype.startsWith(searchString [, position ]) -'use strict'; -var $export = require('./_export'); -var toLength = require('./_to-length'); -var context = require('./_string-context'); -var STARTS_WITH = 'startsWith'; -var $startsWith = ''[STARTS_WITH]; - -$export($export.P + $export.F * require('./_fails-is-regexp')(STARTS_WITH), 'String', { - startsWith: function startsWith(searchString /* , position = 0 */) { - var that = context(this, searchString, STARTS_WITH); - var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); - var search = String(searchString); - return $startsWith - ? $startsWith.call(that, search, index) - : that.slice(index, index + search.length) === search; - } -}); diff --git a/node_modules/core-js/modules/es6.string.strike.js b/node_modules/core-js/modules/es6.string.strike.js deleted file mode 100644 index 66055bc00..000000000 --- a/node_modules/core-js/modules/es6.string.strike.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.12 String.prototype.strike() -require('./_string-html')('strike', function (createHTML) { - return function strike() { - return createHTML(this, 'strike', '', ''); - }; -}); diff --git a/node_modules/core-js/modules/es6.string.sub.js b/node_modules/core-js/modules/es6.string.sub.js deleted file mode 100644 index e295a27b0..000000000 --- a/node_modules/core-js/modules/es6.string.sub.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.13 String.prototype.sub() -require('./_string-html')('sub', function (createHTML) { - return function sub() { - return createHTML(this, 'sub', '', ''); - }; -}); diff --git a/node_modules/core-js/modules/es6.string.sup.js b/node_modules/core-js/modules/es6.string.sup.js deleted file mode 100644 index 125a989a7..000000000 --- a/node_modules/core-js/modules/es6.string.sup.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// B.2.3.14 String.prototype.sup() -require('./_string-html')('sup', function (createHTML) { - return function sup() { - return createHTML(this, 'sup', '', ''); - }; -}); diff --git a/node_modules/core-js/modules/es6.string.trim.js b/node_modules/core-js/modules/es6.string.trim.js deleted file mode 100644 index 02b8a6c69..000000000 --- a/node_modules/core-js/modules/es6.string.trim.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// 21.1.3.25 String.prototype.trim() -require('./_string-trim')('trim', function ($trim) { - return function trim() { - return $trim(this, 3); - }; -}); diff --git a/node_modules/core-js/modules/es6.symbol.js b/node_modules/core-js/modules/es6.symbol.js deleted file mode 100644 index 5bf7c4884..000000000 --- a/node_modules/core-js/modules/es6.symbol.js +++ /dev/null @@ -1,234 +0,0 @@ -'use strict'; -// ECMAScript 6 symbols shim -var global = require('./_global'); -var has = require('./_has'); -var DESCRIPTORS = require('./_descriptors'); -var $export = require('./_export'); -var redefine = require('./_redefine'); -var META = require('./_meta').KEY; -var $fails = require('./_fails'); -var shared = require('./_shared'); -var setToStringTag = require('./_set-to-string-tag'); -var uid = require('./_uid'); -var wks = require('./_wks'); -var wksExt = require('./_wks-ext'); -var wksDefine = require('./_wks-define'); -var enumKeys = require('./_enum-keys'); -var isArray = require('./_is-array'); -var anObject = require('./_an-object'); -var isObject = require('./_is-object'); -var toIObject = require('./_to-iobject'); -var toPrimitive = require('./_to-primitive'); -var createDesc = require('./_property-desc'); -var _create = require('./_object-create'); -var gOPNExt = require('./_object-gopn-ext'); -var $GOPD = require('./_object-gopd'); -var $DP = require('./_object-dp'); -var $keys = require('./_object-keys'); -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'; -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; - require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames; - require('./_object-pie').f = $propertyIsEnumerable; - require('./_object-gops').f = $getOwnPropertySymbols; - - if (DESCRIPTORS && !require('./_library')) { - 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 -}); - -// 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] || require('./_hide')($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); diff --git a/node_modules/core-js/modules/es6.typed.array-buffer.js b/node_modules/core-js/modules/es6.typed.array-buffer.js deleted file mode 100644 index b2473709c..000000000 --- a/node_modules/core-js/modules/es6.typed.array-buffer.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var $typed = require('./_typed'); -var buffer = require('./_typed-buffer'); -var anObject = require('./_an-object'); -var toAbsoluteIndex = require('./_to-absolute-index'); -var toLength = require('./_to-length'); -var isObject = require('./_is-object'); -var ArrayBuffer = require('./_global').ArrayBuffer; -var speciesConstructor = require('./_species-constructor'); -var $ArrayBuffer = buffer.ArrayBuffer; -var $DataView = buffer.DataView; -var $isView = $typed.ABV && ArrayBuffer.isView; -var $slice = $ArrayBuffer.prototype.slice; -var VIEW = $typed.VIEW; -var ARRAY_BUFFER = 'ArrayBuffer'; - -$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer }); - -$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { - // 24.1.3.1 ArrayBuffer.isView(arg) - isView: function isView(it) { - return $isView && $isView(it) || isObject(it) && VIEW in it; - } -}); - -$export($export.P + $export.U + $export.F * require('./_fails')(function () { - return !new $ArrayBuffer(2).slice(1, undefined).byteLength; -}), ARRAY_BUFFER, { - // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) - slice: function slice(start, end) { - if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix - var len = anObject(this).byteLength; - var first = toAbsoluteIndex(start, len); - var fin = toAbsoluteIndex(end === undefined ? len : end, len); - var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first)); - var viewS = new $DataView(this); - var viewT = new $DataView(result); - var index = 0; - while (first < fin) { - viewT.setUint8(index++, viewS.getUint8(first++)); - } return result; - } -}); - -require('./_set-species')(ARRAY_BUFFER); diff --git a/node_modules/core-js/modules/es6.typed.data-view.js b/node_modules/core-js/modules/es6.typed.data-view.js deleted file mode 100644 index d0e23536b..000000000 --- a/node_modules/core-js/modules/es6.typed.data-view.js +++ /dev/null @@ -1,4 +0,0 @@ -var $export = require('./_export'); -$export($export.G + $export.W + $export.F * !require('./_typed').ABV, { - DataView: require('./_typed-buffer').DataView -}); diff --git a/node_modules/core-js/modules/es6.typed.float32-array.js b/node_modules/core-js/modules/es6.typed.float32-array.js deleted file mode 100644 index f49700617..000000000 --- a/node_modules/core-js/modules/es6.typed.float32-array.js +++ /dev/null @@ -1,5 +0,0 @@ -require('./_typed-array')('Float32', 4, function (init) { - return function Float32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); diff --git a/node_modules/core-js/modules/es6.typed.float64-array.js b/node_modules/core-js/modules/es6.typed.float64-array.js deleted file mode 100644 index 85dedcd59..000000000 --- a/node_modules/core-js/modules/es6.typed.float64-array.js +++ /dev/null @@ -1,5 +0,0 @@ -require('./_typed-array')('Float64', 8, function (init) { - return function Float64Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); diff --git a/node_modules/core-js/modules/es6.typed.int16-array.js b/node_modules/core-js/modules/es6.typed.int16-array.js deleted file mode 100644 index b20ed0413..000000000 --- a/node_modules/core-js/modules/es6.typed.int16-array.js +++ /dev/null @@ -1,5 +0,0 @@ -require('./_typed-array')('Int16', 2, function (init) { - return function Int16Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); diff --git a/node_modules/core-js/modules/es6.typed.int32-array.js b/node_modules/core-js/modules/es6.typed.int32-array.js deleted file mode 100644 index c7e6ae06f..000000000 --- a/node_modules/core-js/modules/es6.typed.int32-array.js +++ /dev/null @@ -1,5 +0,0 @@ -require('./_typed-array')('Int32', 4, function (init) { - return function Int32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); diff --git a/node_modules/core-js/modules/es6.typed.int8-array.js b/node_modules/core-js/modules/es6.typed.int8-array.js deleted file mode 100644 index 58ab9f36e..000000000 --- a/node_modules/core-js/modules/es6.typed.int8-array.js +++ /dev/null @@ -1,5 +0,0 @@ -require('./_typed-array')('Int8', 1, function (init) { - return function Int8Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); diff --git a/node_modules/core-js/modules/es6.typed.uint16-array.js b/node_modules/core-js/modules/es6.typed.uint16-array.js deleted file mode 100644 index 992805d63..000000000 --- a/node_modules/core-js/modules/es6.typed.uint16-array.js +++ /dev/null @@ -1,5 +0,0 @@ -require('./_typed-array')('Uint16', 2, function (init) { - return function Uint16Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); diff --git a/node_modules/core-js/modules/es6.typed.uint32-array.js b/node_modules/core-js/modules/es6.typed.uint32-array.js deleted file mode 100644 index 5c444246a..000000000 --- a/node_modules/core-js/modules/es6.typed.uint32-array.js +++ /dev/null @@ -1,5 +0,0 @@ -require('./_typed-array')('Uint32', 4, function (init) { - return function Uint32Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); diff --git a/node_modules/core-js/modules/es6.typed.uint8-array.js b/node_modules/core-js/modules/es6.typed.uint8-array.js deleted file mode 100644 index 465cdc806..000000000 --- a/node_modules/core-js/modules/es6.typed.uint8-array.js +++ /dev/null @@ -1,5 +0,0 @@ -require('./_typed-array')('Uint8', 1, function (init) { - return function Uint8Array(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}); diff --git a/node_modules/core-js/modules/es6.typed.uint8-clamped-array.js b/node_modules/core-js/modules/es6.typed.uint8-clamped-array.js deleted file mode 100644 index a84a1c1ac..000000000 --- a/node_modules/core-js/modules/es6.typed.uint8-clamped-array.js +++ /dev/null @@ -1,5 +0,0 @@ -require('./_typed-array')('Uint8', 1, function (init) { - return function Uint8ClampedArray(data, byteOffset, length) { - return init(this, data, byteOffset, length); - }; -}, true); diff --git a/node_modules/core-js/modules/es6.weak-map.js b/node_modules/core-js/modules/es6.weak-map.js deleted file mode 100644 index f21556d7c..000000000 --- a/node_modules/core-js/modules/es6.weak-map.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; -var each = require('./_array-methods')(0); -var redefine = require('./_redefine'); -var meta = require('./_meta'); -var assign = require('./_object-assign'); -var weak = require('./_collection-weak'); -var isObject = require('./_is-object'); -var fails = require('./_fails'); -var validate = require('./_validate-collection'); -var WEAK_MAP = 'WeakMap'; -var getWeak = meta.getWeak; -var isExtensible = Object.isExtensible; -var uncaughtFrozenStore = weak.ufstore; -var tmp = {}; -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 = require('./_collection')(WEAK_MAP, wrapper, methods, weak, true, true); - -// IE11 WeakMap frozen keys fix -if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) { - 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); - }); - }); -} diff --git a/node_modules/core-js/modules/es6.weak-set.js b/node_modules/core-js/modules/es6.weak-set.js deleted file mode 100644 index 18a81e524..000000000 --- a/node_modules/core-js/modules/es6.weak-set.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; -var weak = require('./_collection-weak'); -var validate = require('./_validate-collection'); -var WEAK_SET = 'WeakSet'; - -// 23.4 WeakSet Objects -require('./_collection')(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); diff --git a/node_modules/core-js/modules/es7.array.flat-map.js b/node_modules/core-js/modules/es7.array.flat-map.js deleted file mode 100644 index 2a210cd35..000000000 --- a/node_modules/core-js/modules/es7.array.flat-map.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; -// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap -var $export = require('./_export'); -var flattenIntoArray = require('./_flatten-into-array'); -var toObject = require('./_to-object'); -var toLength = require('./_to-length'); -var aFunction = require('./_a-function'); -var arraySpeciesCreate = require('./_array-species-create'); - -$export($export.P, 'Array', { - flatMap: function flatMap(callbackfn /* , thisArg */) { - var O = toObject(this); - var sourceLen, A; - aFunction(callbackfn); - sourceLen = toLength(O.length); - A = arraySpeciesCreate(O, 0); - flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]); - return A; - } -}); - -require('./_add-to-unscopables')('flatMap'); diff --git a/node_modules/core-js/modules/es7.array.flatten.js b/node_modules/core-js/modules/es7.array.flatten.js deleted file mode 100644 index 9019b2d1c..000000000 --- a/node_modules/core-js/modules/es7.array.flatten.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; -// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten -var $export = require('./_export'); -var flattenIntoArray = require('./_flatten-into-array'); -var toObject = require('./_to-object'); -var toLength = require('./_to-length'); -var toInteger = require('./_to-integer'); -var arraySpeciesCreate = require('./_array-species-create'); - -$export($export.P, 'Array', { - flatten: function flatten(/* depthArg = 1 */) { - var depthArg = arguments[0]; - var O = toObject(this); - var sourceLen = toLength(O.length); - var A = arraySpeciesCreate(O, 0); - flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg)); - return A; - } -}); - -require('./_add-to-unscopables')('flatten'); diff --git a/node_modules/core-js/modules/es7.array.includes.js b/node_modules/core-js/modules/es7.array.includes.js deleted file mode 100644 index 1b77f0eb8..000000000 --- a/node_modules/core-js/modules/es7.array.includes.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; -// https://github.com/tc39/Array.prototype.includes -var $export = require('./_export'); -var $includes = require('./_array-includes')(true); - -$export($export.P, 'Array', { - includes: function includes(el /* , fromIndex = 0 */) { - return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); - } -}); - -require('./_add-to-unscopables')('includes'); diff --git a/node_modules/core-js/modules/es7.asap.js b/node_modules/core-js/modules/es7.asap.js deleted file mode 100644 index d36f7c760..000000000 --- a/node_modules/core-js/modules/es7.asap.js +++ /dev/null @@ -1,12 +0,0 @@ -// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask -var $export = require('./_export'); -var microtask = require('./_microtask')(); -var process = require('./_global').process; -var isNode = require('./_cof')(process) == 'process'; - -$export($export.G, { - asap: function asap(fn) { - var domain = isNode && process.domain; - microtask(domain ? domain.bind(fn) : fn); - } -}); diff --git a/node_modules/core-js/modules/es7.error.is-error.js b/node_modules/core-js/modules/es7.error.is-error.js deleted file mode 100644 index ba94f5d13..000000000 --- a/node_modules/core-js/modules/es7.error.is-error.js +++ /dev/null @@ -1,9 +0,0 @@ -// https://github.com/ljharb/proposal-is-error -var $export = require('./_export'); -var cof = require('./_cof'); - -$export($export.S, 'Error', { - isError: function isError(it) { - return cof(it) === 'Error'; - } -}); diff --git a/node_modules/core-js/modules/es7.global.js b/node_modules/core-js/modules/es7.global.js deleted file mode 100644 index a315fd430..000000000 --- a/node_modules/core-js/modules/es7.global.js +++ /dev/null @@ -1,4 +0,0 @@ -// https://github.com/tc39/proposal-global -var $export = require('./_export'); - -$export($export.G, { global: require('./_global') }); diff --git a/node_modules/core-js/modules/es7.map.from.js b/node_modules/core-js/modules/es7.map.from.js deleted file mode 100644 index a60573704..000000000 --- a/node_modules/core-js/modules/es7.map.from.js +++ /dev/null @@ -1,2 +0,0 @@ -// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from -require('./_set-collection-from')('Map'); diff --git a/node_modules/core-js/modules/es7.map.of.js b/node_modules/core-js/modules/es7.map.of.js deleted file mode 100644 index a2bf1fef7..000000000 --- a/node_modules/core-js/modules/es7.map.of.js +++ /dev/null @@ -1,2 +0,0 @@ -// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of -require('./_set-collection-of')('Map'); diff --git a/node_modules/core-js/modules/es7.map.to-json.js b/node_modules/core-js/modules/es7.map.to-json.js deleted file mode 100644 index 95a3569fa..000000000 --- a/node_modules/core-js/modules/es7.map.to-json.js +++ /dev/null @@ -1,4 +0,0 @@ -// https://github.com/DavidBruant/Map-Set.prototype.toJSON -var $export = require('./_export'); - -$export($export.P + $export.R, 'Map', { toJSON: require('./_collection-to-json')('Map') }); diff --git a/node_modules/core-js/modules/es7.math.clamp.js b/node_modules/core-js/modules/es7.math.clamp.js deleted file mode 100644 index 319cda609..000000000 --- a/node_modules/core-js/modules/es7.math.clamp.js +++ /dev/null @@ -1,8 +0,0 @@ -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = require('./_export'); - -$export($export.S, 'Math', { - clamp: function clamp(x, lower, upper) { - return Math.min(upper, Math.max(lower, x)); - } -}); diff --git a/node_modules/core-js/modules/es7.math.deg-per-rad.js b/node_modules/core-js/modules/es7.math.deg-per-rad.js deleted file mode 100644 index 99b95bba9..000000000 --- a/node_modules/core-js/modules/es7.math.deg-per-rad.js +++ /dev/null @@ -1,4 +0,0 @@ -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = require('./_export'); - -$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 }); diff --git a/node_modules/core-js/modules/es7.math.degrees.js b/node_modules/core-js/modules/es7.math.degrees.js deleted file mode 100644 index 6637d915e..000000000 --- a/node_modules/core-js/modules/es7.math.degrees.js +++ /dev/null @@ -1,9 +0,0 @@ -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = require('./_export'); -var RAD_PER_DEG = 180 / Math.PI; - -$export($export.S, 'Math', { - degrees: function degrees(radians) { - return radians * RAD_PER_DEG; - } -}); diff --git a/node_modules/core-js/modules/es7.math.fscale.js b/node_modules/core-js/modules/es7.math.fscale.js deleted file mode 100644 index ad660a058..000000000 --- a/node_modules/core-js/modules/es7.math.fscale.js +++ /dev/null @@ -1,10 +0,0 @@ -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = require('./_export'); -var scale = require('./_math-scale'); -var fround = require('./_math-fround'); - -$export($export.S, 'Math', { - fscale: function fscale(x, inLow, inHigh, outLow, outHigh) { - return fround(scale(x, inLow, inHigh, outLow, outHigh)); - } -}); diff --git a/node_modules/core-js/modules/es7.math.iaddh.js b/node_modules/core-js/modules/es7.math.iaddh.js deleted file mode 100644 index a331ba9b2..000000000 --- a/node_modules/core-js/modules/es7.math.iaddh.js +++ /dev/null @@ -1,11 +0,0 @@ -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = require('./_export'); - -$export($export.S, 'Math', { - iaddh: function iaddh(x0, x1, y0, y1) { - var $x0 = x0 >>> 0; - var $x1 = x1 >>> 0; - var $y0 = y0 >>> 0; - return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; - } -}); diff --git a/node_modules/core-js/modules/es7.math.imulh.js b/node_modules/core-js/modules/es7.math.imulh.js deleted file mode 100644 index 58d19f3ac..000000000 --- a/node_modules/core-js/modules/es7.math.imulh.js +++ /dev/null @@ -1,16 +0,0 @@ -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = require('./_export'); - -$export($export.S, 'Math', { - imulh: function imulh(u, v) { - var UINT16 = 0xffff; - var $u = +u; - var $v = +v; - var u0 = $u & UINT16; - var v0 = $v & UINT16; - var u1 = $u >> 16; - var v1 = $v >> 16; - var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); - return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); - } -}); diff --git a/node_modules/core-js/modules/es7.math.isubh.js b/node_modules/core-js/modules/es7.math.isubh.js deleted file mode 100644 index de22793c1..000000000 --- a/node_modules/core-js/modules/es7.math.isubh.js +++ /dev/null @@ -1,11 +0,0 @@ -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = require('./_export'); - -$export($export.S, 'Math', { - isubh: function isubh(x0, x1, y0, y1) { - var $x0 = x0 >>> 0; - var $x1 = x1 >>> 0; - var $y0 = y0 >>> 0; - return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; - } -}); diff --git a/node_modules/core-js/modules/es7.math.rad-per-deg.js b/node_modules/core-js/modules/es7.math.rad-per-deg.js deleted file mode 100644 index 6f702596a..000000000 --- a/node_modules/core-js/modules/es7.math.rad-per-deg.js +++ /dev/null @@ -1,4 +0,0 @@ -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = require('./_export'); - -$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI }); diff --git a/node_modules/core-js/modules/es7.math.radians.js b/node_modules/core-js/modules/es7.math.radians.js deleted file mode 100644 index abd9575fe..000000000 --- a/node_modules/core-js/modules/es7.math.radians.js +++ /dev/null @@ -1,9 +0,0 @@ -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = require('./_export'); -var DEG_PER_RAD = Math.PI / 180; - -$export($export.S, 'Math', { - radians: function radians(degrees) { - return degrees * DEG_PER_RAD; - } -}); diff --git a/node_modules/core-js/modules/es7.math.scale.js b/node_modules/core-js/modules/es7.math.scale.js deleted file mode 100644 index 2866dcd7c..000000000 --- a/node_modules/core-js/modules/es7.math.scale.js +++ /dev/null @@ -1,4 +0,0 @@ -// https://rwaldron.github.io/proposal-math-extensions/ -var $export = require('./_export'); - -$export($export.S, 'Math', { scale: require('./_math-scale') }); diff --git a/node_modules/core-js/modules/es7.math.signbit.js b/node_modules/core-js/modules/es7.math.signbit.js deleted file mode 100644 index c25680486..000000000 --- a/node_modules/core-js/modules/es7.math.signbit.js +++ /dev/null @@ -1,7 +0,0 @@ -// http://jfbastien.github.io/papers/Math.signbit.html -var $export = require('./_export'); - -$export($export.S, 'Math', { signbit: function signbit(x) { - // eslint-disable-next-line no-self-compare - return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0; -} }); diff --git a/node_modules/core-js/modules/es7.math.umulh.js b/node_modules/core-js/modules/es7.math.umulh.js deleted file mode 100644 index 3ddfa4685..000000000 --- a/node_modules/core-js/modules/es7.math.umulh.js +++ /dev/null @@ -1,16 +0,0 @@ -// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 -var $export = require('./_export'); - -$export($export.S, 'Math', { - umulh: function umulh(u, v) { - var UINT16 = 0xffff; - var $u = +u; - var $v = +v; - var u0 = $u & UINT16; - var v0 = $v & UINT16; - var u1 = $u >>> 16; - var v1 = $v >>> 16; - var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); - return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); - } -}); diff --git a/node_modules/core-js/modules/es7.object.define-getter.js b/node_modules/core-js/modules/es7.object.define-getter.js deleted file mode 100644 index ffc6203fd..000000000 --- a/node_modules/core-js/modules/es7.object.define-getter.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var toObject = require('./_to-object'); -var aFunction = require('./_a-function'); -var $defineProperty = require('./_object-dp'); - -// B.2.2.2 Object.prototype.__defineGetter__(P, getter) -require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { - __defineGetter__: function __defineGetter__(P, getter) { - $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true }); - } -}); diff --git a/node_modules/core-js/modules/es7.object.define-setter.js b/node_modules/core-js/modules/es7.object.define-setter.js deleted file mode 100644 index 8ceefdd68..000000000 --- a/node_modules/core-js/modules/es7.object.define-setter.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var toObject = require('./_to-object'); -var aFunction = require('./_a-function'); -var $defineProperty = require('./_object-dp'); - -// B.2.2.3 Object.prototype.__defineSetter__(P, setter) -require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { - __defineSetter__: function __defineSetter__(P, setter) { - $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true }); - } -}); diff --git a/node_modules/core-js/modules/es7.object.entries.js b/node_modules/core-js/modules/es7.object.entries.js deleted file mode 100644 index 2f83437c8..000000000 --- a/node_modules/core-js/modules/es7.object.entries.js +++ /dev/null @@ -1,9 +0,0 @@ -// https://github.com/tc39/proposal-object-values-entries -var $export = require('./_export'); -var $entries = require('./_object-to-array')(true); - -$export($export.S, 'Object', { - entries: function entries(it) { - return $entries(it); - } -}); diff --git a/node_modules/core-js/modules/es7.object.get-own-property-descriptors.js b/node_modules/core-js/modules/es7.object.get-own-property-descriptors.js deleted file mode 100644 index b1ab72fde..000000000 --- a/node_modules/core-js/modules/es7.object.get-own-property-descriptors.js +++ /dev/null @@ -1,22 +0,0 @@ -// https://github.com/tc39/proposal-object-getownpropertydescriptors -var $export = require('./_export'); -var ownKeys = require('./_own-keys'); -var toIObject = require('./_to-iobject'); -var gOPD = require('./_object-gopd'); -var createProperty = require('./_create-property'); - -$export($export.S, 'Object', { - getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { - var O = toIObject(object); - var getDesc = gOPD.f; - var keys = ownKeys(O); - var result = {}; - var i = 0; - var key, desc; - while (keys.length > i) { - desc = getDesc(O, key = keys[i++]); - if (desc !== undefined) createProperty(result, key, desc); - } - return result; - } -}); diff --git a/node_modules/core-js/modules/es7.object.lookup-getter.js b/node_modules/core-js/modules/es7.object.lookup-getter.js deleted file mode 100644 index f80222916..000000000 --- a/node_modules/core-js/modules/es7.object.lookup-getter.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var toObject = require('./_to-object'); -var toPrimitive = require('./_to-primitive'); -var getPrototypeOf = require('./_object-gpo'); -var getOwnPropertyDescriptor = require('./_object-gopd').f; - -// B.2.2.4 Object.prototype.__lookupGetter__(P) -require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { - __lookupGetter__: function __lookupGetter__(P) { - var O = toObject(this); - var K = toPrimitive(P, true); - var D; - do { - if (D = getOwnPropertyDescriptor(O, K)) return D.get; - } while (O = getPrototypeOf(O)); - } -}); diff --git a/node_modules/core-js/modules/es7.object.lookup-setter.js b/node_modules/core-js/modules/es7.object.lookup-setter.js deleted file mode 100644 index 8bf8b64ea..000000000 --- a/node_modules/core-js/modules/es7.object.lookup-setter.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var toObject = require('./_to-object'); -var toPrimitive = require('./_to-primitive'); -var getPrototypeOf = require('./_object-gpo'); -var getOwnPropertyDescriptor = require('./_object-gopd').f; - -// B.2.2.5 Object.prototype.__lookupSetter__(P) -require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', { - __lookupSetter__: function __lookupSetter__(P) { - var O = toObject(this); - var K = toPrimitive(P, true); - var D; - do { - if (D = getOwnPropertyDescriptor(O, K)) return D.set; - } while (O = getPrototypeOf(O)); - } -}); diff --git a/node_modules/core-js/modules/es7.object.values.js b/node_modules/core-js/modules/es7.object.values.js deleted file mode 100644 index d6f095275..000000000 --- a/node_modules/core-js/modules/es7.object.values.js +++ /dev/null @@ -1,9 +0,0 @@ -// https://github.com/tc39/proposal-object-values-entries -var $export = require('./_export'); -var $values = require('./_object-to-array')(false); - -$export($export.S, 'Object', { - values: function values(it) { - return $values(it); - } -}); diff --git a/node_modules/core-js/modules/es7.observable.js b/node_modules/core-js/modules/es7.observable.js deleted file mode 100644 index 6dcb2c8f2..000000000 --- a/node_modules/core-js/modules/es7.observable.js +++ /dev/null @@ -1,199 +0,0 @@ -'use strict'; -// https://github.com/zenparsing/es-observable -var $export = require('./_export'); -var global = require('./_global'); -var core = require('./_core'); -var microtask = require('./_microtask')(); -var OBSERVABLE = require('./_wks')('observable'); -var aFunction = require('./_a-function'); -var anObject = require('./_an-object'); -var anInstance = require('./_an-instance'); -var redefineAll = require('./_redefine-all'); -var hide = require('./_hide'); -var forOf = require('./_for-of'); -var RETURN = forOf.RETURN; - -var getMethod = function (fn) { - return fn == null ? undefined : aFunction(fn); -}; - -var cleanupSubscription = function (subscription) { - var cleanup = subscription._c; - if (cleanup) { - subscription._c = undefined; - cleanup(); - } -}; - -var subscriptionClosed = function (subscription) { - return subscription._o === undefined; -}; - -var closeSubscription = function (subscription) { - if (!subscriptionClosed(subscription)) { - subscription._o = undefined; - cleanupSubscription(subscription); - } -}; - -var Subscription = function (observer, subscriber) { - anObject(observer); - this._c = undefined; - this._o = observer; - observer = new SubscriptionObserver(this); - try { - var cleanup = subscriber(observer); - var subscription = cleanup; - if (cleanup != null) { - if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); }; - else aFunction(cleanup); - this._c = cleanup; - } - } catch (e) { - observer.error(e); - return; - } if (subscriptionClosed(this)) cleanupSubscription(this); -}; - -Subscription.prototype = redefineAll({}, { - unsubscribe: function unsubscribe() { closeSubscription(this); } -}); - -var SubscriptionObserver = function (subscription) { - this._s = subscription; -}; - -SubscriptionObserver.prototype = redefineAll({}, { - next: function next(value) { - var subscription = this._s; - if (!subscriptionClosed(subscription)) { - var observer = subscription._o; - try { - var m = getMethod(observer.next); - if (m) return m.call(observer, value); - } catch (e) { - try { - closeSubscription(subscription); - } finally { - throw e; - } - } - } - }, - error: function error(value) { - var subscription = this._s; - if (subscriptionClosed(subscription)) throw value; - var observer = subscription._o; - subscription._o = undefined; - try { - var m = getMethod(observer.error); - if (!m) throw value; - value = m.call(observer, value); - } catch (e) { - try { - cleanupSubscription(subscription); - } finally { - throw e; - } - } cleanupSubscription(subscription); - return value; - }, - complete: function complete(value) { - var subscription = this._s; - if (!subscriptionClosed(subscription)) { - var observer = subscription._o; - subscription._o = undefined; - try { - var m = getMethod(observer.complete); - value = m ? m.call(observer, value) : undefined; - } catch (e) { - try { - cleanupSubscription(subscription); - } finally { - throw e; - } - } cleanupSubscription(subscription); - return value; - } - } -}); - -var $Observable = function Observable(subscriber) { - anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber); -}; - -redefineAll($Observable.prototype, { - subscribe: function subscribe(observer) { - return new Subscription(observer, this._f); - }, - forEach: function forEach(fn) { - var that = this; - return new (core.Promise || global.Promise)(function (resolve, reject) { - aFunction(fn); - var subscription = that.subscribe({ - next: function (value) { - try { - return fn(value); - } catch (e) { - reject(e); - subscription.unsubscribe(); - } - }, - error: reject, - complete: resolve - }); - }); - } -}); - -redefineAll($Observable, { - from: function from(x) { - var C = typeof this === 'function' ? this : $Observable; - var method = getMethod(anObject(x)[OBSERVABLE]); - if (method) { - var observable = anObject(method.call(x)); - return observable.constructor === C ? observable : new C(function (observer) { - return observable.subscribe(observer); - }); - } - return new C(function (observer) { - var done = false; - microtask(function () { - if (!done) { - try { - if (forOf(x, false, function (it) { - observer.next(it); - if (done) return RETURN; - }) === RETURN) return; - } catch (e) { - if (done) throw e; - observer.error(e); - return; - } observer.complete(); - } - }); - return function () { done = true; }; - }); - }, - of: function of() { - for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++]; - return new (typeof this === 'function' ? this : $Observable)(function (observer) { - var done = false; - microtask(function () { - if (!done) { - for (var j = 0; j < items.length; ++j) { - observer.next(items[j]); - if (done) return; - } observer.complete(); - } - }); - return function () { done = true; }; - }); - } -}); - -hide($Observable.prototype, OBSERVABLE, function () { return this; }); - -$export($export.G, { Observable: $Observable }); - -require('./_set-species')('Observable'); diff --git a/node_modules/core-js/modules/es7.promise.finally.js b/node_modules/core-js/modules/es7.promise.finally.js deleted file mode 100644 index fa04b6399..000000000 --- a/node_modules/core-js/modules/es7.promise.finally.js +++ /dev/null @@ -1,20 +0,0 @@ -// https://github.com/tc39/proposal-promise-finally -'use strict'; -var $export = require('./_export'); -var core = require('./_core'); -var global = require('./_global'); -var speciesConstructor = require('./_species-constructor'); -var promiseResolve = require('./_promise-resolve'); - -$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { - var C = speciesConstructor(this, core.Promise || global.Promise); - var isFunction = typeof onFinally == 'function'; - return this.then( - isFunction ? function (x) { - return promiseResolve(C, onFinally()).then(function () { return x; }); - } : onFinally, - isFunction ? function (e) { - return promiseResolve(C, onFinally()).then(function () { throw e; }); - } : onFinally - ); -} }); diff --git a/node_modules/core-js/modules/es7.promise.try.js b/node_modules/core-js/modules/es7.promise.try.js deleted file mode 100644 index e8163720b..000000000 --- a/node_modules/core-js/modules/es7.promise.try.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; -// https://github.com/tc39/proposal-promise-try -var $export = require('./_export'); -var newPromiseCapability = require('./_new-promise-capability'); -var perform = require('./_perform'); - -$export($export.S, 'Promise', { 'try': function (callbackfn) { - var promiseCapability = newPromiseCapability.f(this); - var result = perform(callbackfn); - (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); - return promiseCapability.promise; -} }); diff --git a/node_modules/core-js/modules/es7.reflect.define-metadata.js b/node_modules/core-js/modules/es7.reflect.define-metadata.js deleted file mode 100644 index ebef52c24..000000000 --- a/node_modules/core-js/modules/es7.reflect.define-metadata.js +++ /dev/null @@ -1,8 +0,0 @@ -var metadata = require('./_metadata'); -var anObject = require('./_an-object'); -var toMetaKey = metadata.key; -var ordinaryDefineOwnMetadata = metadata.set; - -metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) { - ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); -} }); diff --git a/node_modules/core-js/modules/es7.reflect.delete-metadata.js b/node_modules/core-js/modules/es7.reflect.delete-metadata.js deleted file mode 100644 index 590ed53ce..000000000 --- a/node_modules/core-js/modules/es7.reflect.delete-metadata.js +++ /dev/null @@ -1,15 +0,0 @@ -var metadata = require('./_metadata'); -var anObject = require('./_an-object'); -var toMetaKey = metadata.key; -var getOrCreateMetadataMap = metadata.map; -var store = metadata.store; - -metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) { - var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]); - var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); - if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false; - if (metadataMap.size) return true; - var targetMetadata = store.get(target); - targetMetadata['delete'](targetKey); - return !!targetMetadata.size || store['delete'](target); -} }); diff --git a/node_modules/core-js/modules/es7.reflect.get-metadata-keys.js b/node_modules/core-js/modules/es7.reflect.get-metadata-keys.js deleted file mode 100644 index f344172b5..000000000 --- a/node_modules/core-js/modules/es7.reflect.get-metadata-keys.js +++ /dev/null @@ -1,19 +0,0 @@ -var Set = require('./es6.set'); -var from = require('./_array-from-iterable'); -var metadata = require('./_metadata'); -var anObject = require('./_an-object'); -var getPrototypeOf = require('./_object-gpo'); -var ordinaryOwnMetadataKeys = metadata.keys; -var toMetaKey = metadata.key; - -var ordinaryMetadataKeys = function (O, P) { - var oKeys = ordinaryOwnMetadataKeys(O, P); - var parent = getPrototypeOf(O); - if (parent === null) return oKeys; - var pKeys = ordinaryMetadataKeys(parent, P); - return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys; -}; - -metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) { - return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); -} }); diff --git a/node_modules/core-js/modules/es7.reflect.get-metadata.js b/node_modules/core-js/modules/es7.reflect.get-metadata.js deleted file mode 100644 index 58c278e98..000000000 --- a/node_modules/core-js/modules/es7.reflect.get-metadata.js +++ /dev/null @@ -1,17 +0,0 @@ -var metadata = require('./_metadata'); -var anObject = require('./_an-object'); -var getPrototypeOf = require('./_object-gpo'); -var ordinaryHasOwnMetadata = metadata.has; -var ordinaryGetOwnMetadata = metadata.get; -var toMetaKey = metadata.key; - -var ordinaryGetMetadata = function (MetadataKey, O, P) { - var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); - if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P); - var parent = getPrototypeOf(O); - return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; -}; - -metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) { - return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); diff --git a/node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js b/node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js deleted file mode 100644 index 03e3201bb..000000000 --- a/node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js +++ /dev/null @@ -1,8 +0,0 @@ -var metadata = require('./_metadata'); -var anObject = require('./_an-object'); -var ordinaryOwnMetadataKeys = metadata.keys; -var toMetaKey = metadata.key; - -metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) { - return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); -} }); diff --git a/node_modules/core-js/modules/es7.reflect.get-own-metadata.js b/node_modules/core-js/modules/es7.reflect.get-own-metadata.js deleted file mode 100644 index 4a18b0717..000000000 --- a/node_modules/core-js/modules/es7.reflect.get-own-metadata.js +++ /dev/null @@ -1,9 +0,0 @@ -var metadata = require('./_metadata'); -var anObject = require('./_an-object'); -var ordinaryGetOwnMetadata = metadata.get; -var toMetaKey = metadata.key; - -metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) { - return ordinaryGetOwnMetadata(metadataKey, anObject(target) - , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); diff --git a/node_modules/core-js/modules/es7.reflect.has-metadata.js b/node_modules/core-js/modules/es7.reflect.has-metadata.js deleted file mode 100644 index b934bb4ec..000000000 --- a/node_modules/core-js/modules/es7.reflect.has-metadata.js +++ /dev/null @@ -1,16 +0,0 @@ -var metadata = require('./_metadata'); -var anObject = require('./_an-object'); -var getPrototypeOf = require('./_object-gpo'); -var ordinaryHasOwnMetadata = metadata.has; -var toMetaKey = metadata.key; - -var ordinaryHasMetadata = function (MetadataKey, O, P) { - var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); - if (hasOwn) return true; - var parent = getPrototypeOf(O); - return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; -}; - -metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) { - return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); diff --git a/node_modules/core-js/modules/es7.reflect.has-own-metadata.js b/node_modules/core-js/modules/es7.reflect.has-own-metadata.js deleted file mode 100644 index 512850dd8..000000000 --- a/node_modules/core-js/modules/es7.reflect.has-own-metadata.js +++ /dev/null @@ -1,9 +0,0 @@ -var metadata = require('./_metadata'); -var anObject = require('./_an-object'); -var ordinaryHasOwnMetadata = metadata.has; -var toMetaKey = metadata.key; - -metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) { - return ordinaryHasOwnMetadata(metadataKey, anObject(target) - , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); -} }); diff --git a/node_modules/core-js/modules/es7.reflect.metadata.js b/node_modules/core-js/modules/es7.reflect.metadata.js deleted file mode 100644 index efb9a9e26..000000000 --- a/node_modules/core-js/modules/es7.reflect.metadata.js +++ /dev/null @@ -1,15 +0,0 @@ -var $metadata = require('./_metadata'); -var anObject = require('./_an-object'); -var aFunction = require('./_a-function'); -var toMetaKey = $metadata.key; -var ordinaryDefineOwnMetadata = $metadata.set; - -$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) { - return function decorator(target, targetKey) { - ordinaryDefineOwnMetadata( - metadataKey, metadataValue, - (targetKey !== undefined ? anObject : aFunction)(target), - toMetaKey(targetKey) - ); - }; -} }); diff --git a/node_modules/core-js/modules/es7.set.from.js b/node_modules/core-js/modules/es7.set.from.js deleted file mode 100644 index 26542b664..000000000 --- a/node_modules/core-js/modules/es7.set.from.js +++ /dev/null @@ -1,2 +0,0 @@ -// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from -require('./_set-collection-from')('Set'); diff --git a/node_modules/core-js/modules/es7.set.of.js b/node_modules/core-js/modules/es7.set.of.js deleted file mode 100644 index 2a50ad911..000000000 --- a/node_modules/core-js/modules/es7.set.of.js +++ /dev/null @@ -1,2 +0,0 @@ -// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of -require('./_set-collection-of')('Set'); diff --git a/node_modules/core-js/modules/es7.set.to-json.js b/node_modules/core-js/modules/es7.set.to-json.js deleted file mode 100644 index 95cbcfa51..000000000 --- a/node_modules/core-js/modules/es7.set.to-json.js +++ /dev/null @@ -1,4 +0,0 @@ -// https://github.com/DavidBruant/Map-Set.prototype.toJSON -var $export = require('./_export'); - -$export($export.P + $export.R, 'Set', { toJSON: require('./_collection-to-json')('Set') }); diff --git a/node_modules/core-js/modules/es7.string.at.js b/node_modules/core-js/modules/es7.string.at.js deleted file mode 100644 index 8b3ab98db..000000000 --- a/node_modules/core-js/modules/es7.string.at.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; -// https://github.com/mathiasbynens/String.prototype.at -var $export = require('./_export'); -var $at = require('./_string-at')(true); - -$export($export.P, 'String', { - at: function at(pos) { - return $at(this, pos); - } -}); diff --git a/node_modules/core-js/modules/es7.string.match-all.js b/node_modules/core-js/modules/es7.string.match-all.js deleted file mode 100644 index 78237036e..000000000 --- a/node_modules/core-js/modules/es7.string.match-all.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; -// https://tc39.github.io/String.prototype.matchAll/ -var $export = require('./_export'); -var defined = require('./_defined'); -var toLength = require('./_to-length'); -var isRegExp = require('./_is-regexp'); -var getFlags = require('./_flags'); -var RegExpProto = RegExp.prototype; - -var $RegExpStringIterator = function (regexp, string) { - this._r = regexp; - this._s = string; -}; - -require('./_iter-create')($RegExpStringIterator, 'RegExp String', function next() { - var match = this._r.exec(this._s); - return { value: match, done: match === null }; -}); - -$export($export.P, 'String', { - matchAll: function matchAll(regexp) { - defined(this); - if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!'); - var S = String(this); - var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp); - var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags); - rx.lastIndex = toLength(regexp.lastIndex); - return new $RegExpStringIterator(rx, S); - } -}); diff --git a/node_modules/core-js/modules/es7.string.pad-end.js b/node_modules/core-js/modules/es7.string.pad-end.js deleted file mode 100644 index df55ce70b..000000000 --- a/node_modules/core-js/modules/es7.string.pad-end.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; -// https://github.com/tc39/proposal-string-pad-start-end -var $export = require('./_export'); -var $pad = require('./_string-pad'); -var userAgent = require('./_user-agent'); - -// https://github.com/zloirock/core-js/issues/280 -$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { - padEnd: function padEnd(maxLength /* , fillString = ' ' */) { - return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); - } -}); diff --git a/node_modules/core-js/modules/es7.string.pad-start.js b/node_modules/core-js/modules/es7.string.pad-start.js deleted file mode 100644 index 61549121d..000000000 --- a/node_modules/core-js/modules/es7.string.pad-start.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; -// https://github.com/tc39/proposal-string-pad-start-end -var $export = require('./_export'); -var $pad = require('./_string-pad'); -var userAgent = require('./_user-agent'); - -// https://github.com/zloirock/core-js/issues/280 -$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { - padStart: function padStart(maxLength /* , fillString = ' ' */) { - return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); - } -}); diff --git a/node_modules/core-js/modules/es7.string.trim-left.js b/node_modules/core-js/modules/es7.string.trim-left.js deleted file mode 100644 index 39a4b47cf..000000000 --- a/node_modules/core-js/modules/es7.string.trim-left.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// https://github.com/sebmarkbage/ecmascript-string-left-right-trim -require('./_string-trim')('trimLeft', function ($trim) { - return function trimLeft() { - return $trim(this, 1); - }; -}, 'trimStart'); diff --git a/node_modules/core-js/modules/es7.string.trim-right.js b/node_modules/core-js/modules/es7.string.trim-right.js deleted file mode 100644 index 7b7c45298..000000000 --- a/node_modules/core-js/modules/es7.string.trim-right.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -// https://github.com/sebmarkbage/ecmascript-string-left-right-trim -require('./_string-trim')('trimRight', function ($trim) { - return function trimRight() { - return $trim(this, 2); - }; -}, 'trimEnd'); diff --git a/node_modules/core-js/modules/es7.symbol.async-iterator.js b/node_modules/core-js/modules/es7.symbol.async-iterator.js deleted file mode 100644 index f56dc2a8e..000000000 --- a/node_modules/core-js/modules/es7.symbol.async-iterator.js +++ /dev/null @@ -1 +0,0 @@ -require('./_wks-define')('asyncIterator'); diff --git a/node_modules/core-js/modules/es7.symbol.observable.js b/node_modules/core-js/modules/es7.symbol.observable.js deleted file mode 100644 index fc9a23761..000000000 --- a/node_modules/core-js/modules/es7.symbol.observable.js +++ /dev/null @@ -1 +0,0 @@ -require('./_wks-define')('observable'); diff --git a/node_modules/core-js/modules/es7.system.global.js b/node_modules/core-js/modules/es7.system.global.js deleted file mode 100644 index 310a802ad..000000000 --- a/node_modules/core-js/modules/es7.system.global.js +++ /dev/null @@ -1,4 +0,0 @@ -// https://github.com/tc39/proposal-global -var $export = require('./_export'); - -$export($export.S, 'System', { global: require('./_global') }); diff --git a/node_modules/core-js/modules/es7.weak-map.from.js b/node_modules/core-js/modules/es7.weak-map.from.js deleted file mode 100644 index 1a0136576..000000000 --- a/node_modules/core-js/modules/es7.weak-map.from.js +++ /dev/null @@ -1,2 +0,0 @@ -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from -require('./_set-collection-from')('WeakMap'); diff --git a/node_modules/core-js/modules/es7.weak-map.of.js b/node_modules/core-js/modules/es7.weak-map.of.js deleted file mode 100644 index 52c3f66df..000000000 --- a/node_modules/core-js/modules/es7.weak-map.of.js +++ /dev/null @@ -1,2 +0,0 @@ -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of -require('./_set-collection-of')('WeakMap'); diff --git a/node_modules/core-js/modules/es7.weak-set.from.js b/node_modules/core-js/modules/es7.weak-set.from.js deleted file mode 100644 index 493e5bee0..000000000 --- a/node_modules/core-js/modules/es7.weak-set.from.js +++ /dev/null @@ -1,2 +0,0 @@ -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from -require('./_set-collection-from')('WeakSet'); diff --git a/node_modules/core-js/modules/es7.weak-set.of.js b/node_modules/core-js/modules/es7.weak-set.of.js deleted file mode 100644 index 5941e72aa..000000000 --- a/node_modules/core-js/modules/es7.weak-set.of.js +++ /dev/null @@ -1,2 +0,0 @@ -// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of -require('./_set-collection-of')('WeakSet'); diff --git a/node_modules/core-js/modules/library/_add-to-unscopables.js b/node_modules/core-js/modules/library/_add-to-unscopables.js deleted file mode 100644 index 02ef44ba4..000000000 --- a/node_modules/core-js/modules/library/_add-to-unscopables.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = function () { /* empty */ }; diff --git a/node_modules/core-js/modules/library/_collection.js b/node_modules/core-js/modules/library/_collection.js deleted file mode 100644 index 31a36b87a..000000000 --- a/node_modules/core-js/modules/library/_collection.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; -var global = require('./_global'); -var $export = require('./_export'); -var meta = require('./_meta'); -var fails = require('./_fails'); -var hide = require('./_hide'); -var redefineAll = require('./_redefine-all'); -var forOf = require('./_for-of'); -var anInstance = require('./_an-instance'); -var isObject = require('./_is-object'); -var setToStringTag = require('./_set-to-string-tag'); -var dP = require('./_object-dp').f; -var each = require('./_array-methods')(0); -var DESCRIPTORS = require('./_descriptors'); - -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; -}; diff --git a/node_modules/core-js/modules/library/_export.js b/node_modules/core-js/modules/library/_export.js deleted file mode 100644 index 02bddc0aa..000000000 --- a/node_modules/core-js/modules/library/_export.js +++ /dev/null @@ -1,62 +0,0 @@ -var global = require('./_global'); -var core = require('./_core'); -var ctx = require('./_ctx'); -var hide = require('./_hide'); -var has = require('./_has'); -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; diff --git a/node_modules/core-js/modules/library/_library.js b/node_modules/core-js/modules/library/_library.js deleted file mode 100644 index ec01c2c14..000000000 --- a/node_modules/core-js/modules/library/_library.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = true; diff --git a/node_modules/core-js/modules/library/_path.js b/node_modules/core-js/modules/library/_path.js deleted file mode 100644 index 2796ebcb9..000000000 --- a/node_modules/core-js/modules/library/_path.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./_core'); diff --git a/node_modules/core-js/modules/library/_redefine-all.js b/node_modules/core-js/modules/library/_redefine-all.js deleted file mode 100644 index bf8c0ea39..000000000 --- a/node_modules/core-js/modules/library/_redefine-all.js +++ /dev/null @@ -1,7 +0,0 @@ -var hide = require('./_hide'); -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; -}; diff --git a/node_modules/core-js/modules/library/_redefine.js b/node_modules/core-js/modules/library/_redefine.js deleted file mode 100644 index fde6108ef..000000000 --- a/node_modules/core-js/modules/library/_redefine.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./_hide'); diff --git a/node_modules/core-js/modules/library/_set-species.js b/node_modules/core-js/modules/library/_set-species.js deleted file mode 100644 index 1f25fde1e..000000000 --- a/node_modules/core-js/modules/library/_set-species.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; -var global = require('./_global'); -var core = require('./_core'); -var dP = require('./_object-dp'); -var DESCRIPTORS = require('./_descriptors'); -var SPECIES = require('./_wks')('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; } - }); -}; diff --git a/node_modules/core-js/modules/library/es6.date.to-json.js b/node_modules/core-js/modules/library/es6.date.to-json.js deleted file mode 100644 index 69b1f3018..000000000 --- a/node_modules/core-js/modules/library/es6.date.to-json.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; -var $export = require('./_export'); -var toObject = require('./_to-object'); -var toPrimitive = require('./_to-primitive'); -var toISOString = require('./_date-to-iso-string'); -var classof = require('./_classof'); - -$export($export.P + $export.F * require('./_fails')(function () { - return new Date(NaN).toJSON() !== null - || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; -}), 'Date', { - // eslint-disable-next-line no-unused-vars - toJSON: function toJSON(key) { - var O = toObject(this); - var pv = toPrimitive(O); - return typeof pv == 'number' && !isFinite(pv) ? null : - (!('toISOString' in O) && classof(O) == 'Date') ? toISOString.call(O) : O.toISOString(); - } -}); diff --git a/node_modules/core-js/modules/library/es6.date.to-primitive.js b/node_modules/core-js/modules/library/es6.date.to-primitive.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/core-js/modules/library/es6.date.to-string.js b/node_modules/core-js/modules/library/es6.date.to-string.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/core-js/modules/library/es6.function.name.js b/node_modules/core-js/modules/library/es6.function.name.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/core-js/modules/library/es6.number.constructor.js b/node_modules/core-js/modules/library/es6.number.constructor.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/core-js/modules/library/es6.object.to-string.js b/node_modules/core-js/modules/library/es6.object.to-string.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/core-js/modules/library/es6.regexp.constructor.js b/node_modules/core-js/modules/library/es6.regexp.constructor.js deleted file mode 100644 index e85e3141a..000000000 --- a/node_modules/core-js/modules/library/es6.regexp.constructor.js +++ /dev/null @@ -1 +0,0 @@ -require('./_set-species')('RegExp'); diff --git a/node_modules/core-js/modules/library/es6.regexp.flags.js b/node_modules/core-js/modules/library/es6.regexp.flags.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/core-js/modules/library/es6.regexp.match.js b/node_modules/core-js/modules/library/es6.regexp.match.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/core-js/modules/library/es6.regexp.replace.js b/node_modules/core-js/modules/library/es6.regexp.replace.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/core-js/modules/library/es6.regexp.search.js b/node_modules/core-js/modules/library/es6.regexp.search.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/core-js/modules/library/es6.regexp.split.js b/node_modules/core-js/modules/library/es6.regexp.split.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/core-js/modules/library/es6.regexp.to-string.js b/node_modules/core-js/modules/library/es6.regexp.to-string.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/core-js/modules/library/web.dom.iterable.js b/node_modules/core-js/modules/library/web.dom.iterable.js deleted file mode 100644 index fc00afac4..000000000 --- a/node_modules/core-js/modules/library/web.dom.iterable.js +++ /dev/null @@ -1,19 +0,0 @@ -require('./es6.array.iterator'); -var global = require('./_global'); -var hide = require('./_hide'); -var Iterators = require('./_iterators'); -var TO_STRING_TAG = require('./_wks')('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; -} diff --git a/node_modules/core-js/modules/web.dom.iterable.js b/node_modules/core-js/modules/web.dom.iterable.js deleted file mode 100644 index 40834b02b..000000000 --- a/node_modules/core-js/modules/web.dom.iterable.js +++ /dev/null @@ -1,58 +0,0 @@ -var $iterators = require('./es6.array.iterator'); -var getKeys = require('./_object-keys'); -var redefine = require('./_redefine'); -var global = require('./_global'); -var hide = require('./_hide'); -var Iterators = require('./_iterators'); -var wks = require('./_wks'); -var ITERATOR = wks('iterator'); -var TO_STRING_TAG = wks('toStringTag'); -var ArrayValues = Iterators.Array; - -var DOMIterables = { - CSSRuleList: true, // TODO: Not spec compliant, should be false. - CSSStyleDeclaration: false, - CSSValueList: false, - ClientRectList: false, - DOMRectList: false, - DOMStringList: false, - DOMTokenList: true, - DataTransferItemList: false, - FileList: false, - HTMLAllCollection: false, - HTMLCollection: false, - HTMLFormElement: false, - HTMLSelectElement: false, - MediaList: true, // TODO: Not spec compliant, should be false. - MimeTypeArray: false, - NamedNodeMap: false, - NodeList: true, - PaintRequestList: false, - Plugin: false, - PluginArray: false, - SVGLengthList: false, - SVGNumberList: false, - SVGPathSegList: false, - SVGPointList: false, - SVGStringList: false, - SVGTransformList: false, - SourceBufferList: false, - StyleSheetList: true, // TODO: Not spec compliant, should be false. - TextTrackCueList: false, - TextTrackList: false, - TouchList: false -}; - -for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) { - var NAME = collections[i]; - var explicit = DOMIterables[NAME]; - var Collection = global[NAME]; - var proto = Collection && Collection.prototype; - var key; - if (proto) { - if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues); - if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); - Iterators[NAME] = ArrayValues; - if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true); - } -} diff --git a/node_modules/core-js/modules/web.immediate.js b/node_modules/core-js/modules/web.immediate.js deleted file mode 100644 index 70f3e70da..000000000 --- a/node_modules/core-js/modules/web.immediate.js +++ /dev/null @@ -1,6 +0,0 @@ -var $export = require('./_export'); -var $task = require('./_task'); -$export($export.G + $export.B, { - setImmediate: $task.set, - clearImmediate: $task.clear -}); diff --git a/node_modules/core-js/modules/web.timers.js b/node_modules/core-js/modules/web.timers.js deleted file mode 100644 index c87908304..000000000 --- a/node_modules/core-js/modules/web.timers.js +++ /dev/null @@ -1,20 +0,0 @@ -// ie9- setTimeout & setInterval additional parameters fix -var global = require('./_global'); -var $export = require('./_export'); -var userAgent = require('./_user-agent'); -var slice = [].slice; -var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check -var wrap = function (set) { - return function (fn, time /* , ...args */) { - var boundArgs = arguments.length > 2; - var args = boundArgs ? slice.call(arguments, 2) : false; - return set(boundArgs ? function () { - // eslint-disable-next-line no-new-func - (typeof fn == 'function' ? fn : Function(fn)).apply(this, args); - } : fn, time); - }; -}; -$export($export.G + $export.B + $export.F * MSIE, { - setTimeout: wrap(global.setTimeout), - setInterval: wrap(global.setInterval) -}); diff --git a/node_modules/core-js/package.json b/node_modules/core-js/package.json deleted file mode 100644 index 910471c80..000000000 --- a/node_modules/core-js/package.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "_from": "core-js@^2.5.7", - "_id": "core-js@2.5.7", - "_inBundle": false, - "_integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==", - "_location": "/core-js", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "core-js@^2.5.7", - "name": "core-js", - "escapedName": "core-js", - "rawSpec": "^2.5.7", - "saveSpec": null, - "fetchSpec": "^2.5.7" - }, - "_requiredBy": [ - "/@babel/polyfill" - ], - "_resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", - "_shasum": "f972608ff0cead68b841a16a932d0b183791814e", - "_spec": "core-js@^2.5.7", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/@babel/polyfill", - "bugs": { - "url": "https://github.com/zloirock/core-js/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Standard library", - "devDependencies": { - "LiveScript": "1.3.x", - "es-observable-tests": "0.2.x", - "eslint": "4.19.x", - "eslint-plugin-import": "2.12.x", - "grunt": "^1.0.2", - "grunt-cli": "^1.2.0", - "grunt-contrib-clean": "^1.1.0", - "grunt-contrib-copy": "^1.0.0", - "grunt-contrib-uglify": "3.3.x", - "grunt-contrib-watch": "^1.0.0", - "grunt-karma": "^2.0.0", - "grunt-livescript": "0.6.x", - "karma": "^2.0.0", - "karma-chrome-launcher": "^2.2.0", - "karma-firefox-launcher": "^1.0.1", - "karma-ie-launcher": "^1.0.0", - "karma-phantomjs-launcher": "1.0.x", - "karma-qunit": "^2.1.0", - "phantomjs-prebuilt": "2.1.x", - "promises-aplus-tests": "^2.1.2", - "qunit": "2.6.x", - "temp": "^0.8.3", - "webpack": "^3.11.0" - }, - "homepage": "https://github.com/zloirock/core-js#readme", - "keywords": [ - "ES3", - "ES5", - "ES6", - "ES7", - "ES2015", - "ES2016", - "ES2017", - "ECMAScript 3", - "ECMAScript 5", - "ECMAScript 6", - "ECMAScript 7", - "ECMAScript 2015", - "ECMAScript 2016", - "ECMAScript 2017", - "Harmony", - "Strawman", - "Map", - "Set", - "WeakMap", - "WeakSet", - "Promise", - "Symbol", - "TypedArray", - "setImmediate", - "Dict", - "polyfill", - "shim" - ], - "license": "MIT", - "main": "index.js", - "name": "core-js", - "repository": { - "type": "git", - "url": "git+https://github.com/zloirock/core-js.git" - }, - "scripts": { - "grunt": "grunt", - "lint": "eslint ./", - "observables-tests": "node tests/observables/adapter && node tests/observables/adapter-library", - "promises-tests": "promises-aplus-tests tests/promises-aplus/adapter", - "test": "npm run grunt clean copy && npm run lint && npm run grunt livescript client karma:default && npm run grunt library karma:library && npm run promises-tests && npm run observables-tests && lsc tests/commonjs" - }, - "version": "2.5.7" -} diff --git a/node_modules/core-js/shim.js b/node_modules/core-js/shim.js deleted file mode 100644 index d865a2a3e..000000000 --- a/node_modules/core-js/shim.js +++ /dev/null @@ -1,197 +0,0 @@ -require('./modules/es6.symbol'); -require('./modules/es6.object.create'); -require('./modules/es6.object.define-property'); -require('./modules/es6.object.define-properties'); -require('./modules/es6.object.get-own-property-descriptor'); -require('./modules/es6.object.get-prototype-of'); -require('./modules/es6.object.keys'); -require('./modules/es6.object.get-own-property-names'); -require('./modules/es6.object.freeze'); -require('./modules/es6.object.seal'); -require('./modules/es6.object.prevent-extensions'); -require('./modules/es6.object.is-frozen'); -require('./modules/es6.object.is-sealed'); -require('./modules/es6.object.is-extensible'); -require('./modules/es6.object.assign'); -require('./modules/es6.object.is'); -require('./modules/es6.object.set-prototype-of'); -require('./modules/es6.object.to-string'); -require('./modules/es6.function.bind'); -require('./modules/es6.function.name'); -require('./modules/es6.function.has-instance'); -require('./modules/es6.parse-int'); -require('./modules/es6.parse-float'); -require('./modules/es6.number.constructor'); -require('./modules/es6.number.to-fixed'); -require('./modules/es6.number.to-precision'); -require('./modules/es6.number.epsilon'); -require('./modules/es6.number.is-finite'); -require('./modules/es6.number.is-integer'); -require('./modules/es6.number.is-nan'); -require('./modules/es6.number.is-safe-integer'); -require('./modules/es6.number.max-safe-integer'); -require('./modules/es6.number.min-safe-integer'); -require('./modules/es6.number.parse-float'); -require('./modules/es6.number.parse-int'); -require('./modules/es6.math.acosh'); -require('./modules/es6.math.asinh'); -require('./modules/es6.math.atanh'); -require('./modules/es6.math.cbrt'); -require('./modules/es6.math.clz32'); -require('./modules/es6.math.cosh'); -require('./modules/es6.math.expm1'); -require('./modules/es6.math.fround'); -require('./modules/es6.math.hypot'); -require('./modules/es6.math.imul'); -require('./modules/es6.math.log10'); -require('./modules/es6.math.log1p'); -require('./modules/es6.math.log2'); -require('./modules/es6.math.sign'); -require('./modules/es6.math.sinh'); -require('./modules/es6.math.tanh'); -require('./modules/es6.math.trunc'); -require('./modules/es6.string.from-code-point'); -require('./modules/es6.string.raw'); -require('./modules/es6.string.trim'); -require('./modules/es6.string.iterator'); -require('./modules/es6.string.code-point-at'); -require('./modules/es6.string.ends-with'); -require('./modules/es6.string.includes'); -require('./modules/es6.string.repeat'); -require('./modules/es6.string.starts-with'); -require('./modules/es6.string.anchor'); -require('./modules/es6.string.big'); -require('./modules/es6.string.blink'); -require('./modules/es6.string.bold'); -require('./modules/es6.string.fixed'); -require('./modules/es6.string.fontcolor'); -require('./modules/es6.string.fontsize'); -require('./modules/es6.string.italics'); -require('./modules/es6.string.link'); -require('./modules/es6.string.small'); -require('./modules/es6.string.strike'); -require('./modules/es6.string.sub'); -require('./modules/es6.string.sup'); -require('./modules/es6.date.now'); -require('./modules/es6.date.to-json'); -require('./modules/es6.date.to-iso-string'); -require('./modules/es6.date.to-string'); -require('./modules/es6.date.to-primitive'); -require('./modules/es6.array.is-array'); -require('./modules/es6.array.from'); -require('./modules/es6.array.of'); -require('./modules/es6.array.join'); -require('./modules/es6.array.slice'); -require('./modules/es6.array.sort'); -require('./modules/es6.array.for-each'); -require('./modules/es6.array.map'); -require('./modules/es6.array.filter'); -require('./modules/es6.array.some'); -require('./modules/es6.array.every'); -require('./modules/es6.array.reduce'); -require('./modules/es6.array.reduce-right'); -require('./modules/es6.array.index-of'); -require('./modules/es6.array.last-index-of'); -require('./modules/es6.array.copy-within'); -require('./modules/es6.array.fill'); -require('./modules/es6.array.find'); -require('./modules/es6.array.find-index'); -require('./modules/es6.array.species'); -require('./modules/es6.array.iterator'); -require('./modules/es6.regexp.constructor'); -require('./modules/es6.regexp.to-string'); -require('./modules/es6.regexp.flags'); -require('./modules/es6.regexp.match'); -require('./modules/es6.regexp.replace'); -require('./modules/es6.regexp.search'); -require('./modules/es6.regexp.split'); -require('./modules/es6.promise'); -require('./modules/es6.map'); -require('./modules/es6.set'); -require('./modules/es6.weak-map'); -require('./modules/es6.weak-set'); -require('./modules/es6.typed.array-buffer'); -require('./modules/es6.typed.data-view'); -require('./modules/es6.typed.int8-array'); -require('./modules/es6.typed.uint8-array'); -require('./modules/es6.typed.uint8-clamped-array'); -require('./modules/es6.typed.int16-array'); -require('./modules/es6.typed.uint16-array'); -require('./modules/es6.typed.int32-array'); -require('./modules/es6.typed.uint32-array'); -require('./modules/es6.typed.float32-array'); -require('./modules/es6.typed.float64-array'); -require('./modules/es6.reflect.apply'); -require('./modules/es6.reflect.construct'); -require('./modules/es6.reflect.define-property'); -require('./modules/es6.reflect.delete-property'); -require('./modules/es6.reflect.enumerate'); -require('./modules/es6.reflect.get'); -require('./modules/es6.reflect.get-own-property-descriptor'); -require('./modules/es6.reflect.get-prototype-of'); -require('./modules/es6.reflect.has'); -require('./modules/es6.reflect.is-extensible'); -require('./modules/es6.reflect.own-keys'); -require('./modules/es6.reflect.prevent-extensions'); -require('./modules/es6.reflect.set'); -require('./modules/es6.reflect.set-prototype-of'); -require('./modules/es7.array.includes'); -require('./modules/es7.array.flat-map'); -require('./modules/es7.array.flatten'); -require('./modules/es7.string.at'); -require('./modules/es7.string.pad-start'); -require('./modules/es7.string.pad-end'); -require('./modules/es7.string.trim-left'); -require('./modules/es7.string.trim-right'); -require('./modules/es7.string.match-all'); -require('./modules/es7.symbol.async-iterator'); -require('./modules/es7.symbol.observable'); -require('./modules/es7.object.get-own-property-descriptors'); -require('./modules/es7.object.values'); -require('./modules/es7.object.entries'); -require('./modules/es7.object.define-getter'); -require('./modules/es7.object.define-setter'); -require('./modules/es7.object.lookup-getter'); -require('./modules/es7.object.lookup-setter'); -require('./modules/es7.map.to-json'); -require('./modules/es7.set.to-json'); -require('./modules/es7.map.of'); -require('./modules/es7.set.of'); -require('./modules/es7.weak-map.of'); -require('./modules/es7.weak-set.of'); -require('./modules/es7.map.from'); -require('./modules/es7.set.from'); -require('./modules/es7.weak-map.from'); -require('./modules/es7.weak-set.from'); -require('./modules/es7.global'); -require('./modules/es7.system.global'); -require('./modules/es7.error.is-error'); -require('./modules/es7.math.clamp'); -require('./modules/es7.math.deg-per-rad'); -require('./modules/es7.math.degrees'); -require('./modules/es7.math.fscale'); -require('./modules/es7.math.iaddh'); -require('./modules/es7.math.isubh'); -require('./modules/es7.math.imulh'); -require('./modules/es7.math.rad-per-deg'); -require('./modules/es7.math.radians'); -require('./modules/es7.math.scale'); -require('./modules/es7.math.umulh'); -require('./modules/es7.math.signbit'); -require('./modules/es7.promise.finally'); -require('./modules/es7.promise.try'); -require('./modules/es7.reflect.define-metadata'); -require('./modules/es7.reflect.delete-metadata'); -require('./modules/es7.reflect.get-metadata'); -require('./modules/es7.reflect.get-metadata-keys'); -require('./modules/es7.reflect.get-own-metadata'); -require('./modules/es7.reflect.get-own-metadata-keys'); -require('./modules/es7.reflect.has-metadata'); -require('./modules/es7.reflect.has-own-metadata'); -require('./modules/es7.reflect.metadata'); -require('./modules/es7.asap'); -require('./modules/es7.observable'); -require('./modules/web.timers'); -require('./modules/web.immediate'); -require('./modules/web.dom.iterable'); -module.exports = require('./modules/_core'); diff --git a/node_modules/core-js/stage/0.js b/node_modules/core-js/stage/0.js deleted file mode 100644 index 4aa50704c..000000000 --- a/node_modules/core-js/stage/0.js +++ /dev/null @@ -1,10 +0,0 @@ -require('../modules/es7.string.at'); -require('../modules/es7.map.to-json'); -require('../modules/es7.set.to-json'); -require('../modules/es7.error.is-error'); -require('../modules/es7.math.iaddh'); -require('../modules/es7.math.isubh'); -require('../modules/es7.math.imulh'); -require('../modules/es7.math.umulh'); -require('../modules/es7.asap'); -module.exports = require('./1'); diff --git a/node_modules/core-js/stage/1.js b/node_modules/core-js/stage/1.js deleted file mode 100644 index 5f634d80b..000000000 --- a/node_modules/core-js/stage/1.js +++ /dev/null @@ -1,23 +0,0 @@ -require('../modules/es7.map.of'); -require('../modules/es7.set.of'); -require('../modules/es7.weak-map.of'); -require('../modules/es7.weak-set.of'); -require('../modules/es7.map.from'); -require('../modules/es7.set.from'); -require('../modules/es7.weak-map.from'); -require('../modules/es7.weak-set.from'); -require('../modules/es7.math.clamp'); -require('../modules/es7.math.deg-per-rad'); -require('../modules/es7.math.degrees'); -require('../modules/es7.math.fscale'); -require('../modules/es7.math.rad-per-deg'); -require('../modules/es7.math.radians'); -require('../modules/es7.math.scale'); -require('../modules/es7.math.signbit'); -require('../modules/es7.promise.try'); -require('../modules/es7.string.match-all'); -require('../modules/es7.symbol.observable'); -require('../modules/es7.observable'); -require('../modules/es7.array.flat-map'); -require('../modules/es7.array.flatten'); -module.exports = require('./2'); diff --git a/node_modules/core-js/stage/2.js b/node_modules/core-js/stage/2.js deleted file mode 100644 index d7aaa0ef9..000000000 --- a/node_modules/core-js/stage/2.js +++ /dev/null @@ -1,4 +0,0 @@ -require('../modules/es7.string.trim-left'); -require('../modules/es7.string.trim-right'); -require('../modules/es7.symbol.async-iterator'); -module.exports = require('./3'); diff --git a/node_modules/core-js/stage/3.js b/node_modules/core-js/stage/3.js deleted file mode 100644 index 9afd07fe9..000000000 --- a/node_modules/core-js/stage/3.js +++ /dev/null @@ -1,4 +0,0 @@ -require('../modules/es7.global'); -require('../modules/es7.system.global'); -require('../modules/es7.promise.finally'); -module.exports = require('./4'); diff --git a/node_modules/core-js/stage/4.js b/node_modules/core-js/stage/4.js deleted file mode 100644 index 875762a23..000000000 --- a/node_modules/core-js/stage/4.js +++ /dev/null @@ -1,11 +0,0 @@ -require('../modules/es7.object.define-getter'); -require('../modules/es7.object.define-setter'); -require('../modules/es7.object.lookup-getter'); -require('../modules/es7.object.lookup-setter'); -require('../modules/es7.object.values'); -require('../modules/es7.object.entries'); -require('../modules/es7.object.get-own-property-descriptors'); -require('../modules/es7.array.includes'); -require('../modules/es7.string.pad-start'); -require('../modules/es7.string.pad-end'); -module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/stage/index.js b/node_modules/core-js/stage/index.js deleted file mode 100644 index 24dcf2e56..000000000 --- a/node_modules/core-js/stage/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./pre'); diff --git a/node_modules/core-js/stage/pre.js b/node_modules/core-js/stage/pre.js deleted file mode 100644 index ed197a8ba..000000000 --- a/node_modules/core-js/stage/pre.js +++ /dev/null @@ -1,10 +0,0 @@ -require('../modules/es7.reflect.define-metadata'); -require('../modules/es7.reflect.delete-metadata'); -require('../modules/es7.reflect.get-metadata'); -require('../modules/es7.reflect.get-metadata-keys'); -require('../modules/es7.reflect.get-own-metadata'); -require('../modules/es7.reflect.get-own-metadata-keys'); -require('../modules/es7.reflect.has-metadata'); -require('../modules/es7.reflect.has-own-metadata'); -require('../modules/es7.reflect.metadata'); -module.exports = require('./0'); diff --git a/node_modules/core-js/web/dom-collections.js b/node_modules/core-js/web/dom-collections.js deleted file mode 100644 index a138bb9dd..000000000 --- a/node_modules/core-js/web/dom-collections.js +++ /dev/null @@ -1,2 +0,0 @@ -require('../modules/web.dom.iterable'); -module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/web/immediate.js b/node_modules/core-js/web/immediate.js deleted file mode 100644 index 6866abdeb..000000000 --- a/node_modules/core-js/web/immediate.js +++ /dev/null @@ -1,2 +0,0 @@ -require('../modules/web.immediate'); -module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/web/index.js b/node_modules/core-js/web/index.js deleted file mode 100644 index 66db256d6..000000000 --- a/node_modules/core-js/web/index.js +++ /dev/null @@ -1,4 +0,0 @@ -require('../modules/web.timers'); -require('../modules/web.immediate'); -require('../modules/web.dom.iterable'); -module.exports = require('../modules/_core'); diff --git a/node_modules/core-js/web/timers.js b/node_modules/core-js/web/timers.js deleted file mode 100644 index a3f528e4d..000000000 --- a/node_modules/core-js/web/timers.js +++ /dev/null @@ -1,2 +0,0 @@ -require('../modules/web.timers'); -module.exports = require('../modules/_core'); diff --git a/node_modules/core-util-is/LICENSE b/node_modules/core-util-is/LICENSE deleted file mode 100644 index d8d7f9437..000000000 --- a/node_modules/core-util-is/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. diff --git a/node_modules/core-util-is/README.md b/node_modules/core-util-is/README.md deleted file mode 100644 index 5a76b4149..000000000 --- a/node_modules/core-util-is/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# core-util-is - -The `util.is*` functions introduced in Node v0.12. diff --git a/node_modules/core-util-is/float.patch b/node_modules/core-util-is/float.patch deleted file mode 100644 index a06d5c05f..000000000 --- a/node_modules/core-util-is/float.patch +++ /dev/null @@ -1,604 +0,0 @@ -diff --git a/lib/util.js b/lib/util.js -index a03e874..9074e8e 100644 ---- a/lib/util.js -+++ b/lib/util.js -@@ -19,430 +19,6 @@ - // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - // USE OR OTHER DEALINGS IN THE SOFTWARE. - --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) { -- // Allow for deprecating things in the process of starting up. -- if (isUndefined(global.process)) { -- return function() { -- return exports.deprecate(fn, msg).apply(this, arguments); -- }; -- } -- -- if (process.noDeprecation === true) { -- return fn; -- } -- -- 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 = process.env.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); -- } -- -- // 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)) { -- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0, -- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 . -- if (value === 0 && 1 / value < 0) -- return ctx.stylize('-0', 'number'); -- 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) { -@@ -522,166 +98,10 @@ function isPrimitive(arg) { - exports.isPrimitive = isPrimitive; - - function isBuffer(arg) { -- return arg instanceof Buffer; -+ return Buffer.isBuffer(arg); - } - exports.isBuffer = isBuffer; - - 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 = function(ctor, superCtor) { -- ctor.super_ = superCtor; -- ctor.prototype = Object.create(superCtor.prototype, { -- constructor: { -- value: ctor, -- enumerable: false, -- writable: true, -- configurable: true -- } -- }); --}; -- --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); --} -- -- --// Deprecated old stuff. -- --exports.p = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- console.error(exports.inspect(arguments[i])); -- } --}, 'util.p: Use console.error() instead'); -- -- --exports.exec = exports.deprecate(function() { -- return require('child_process').exec.apply(this, arguments); --}, 'util.exec is now called `child_process.exec`.'); -- -- --exports.print = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stdout.write(String(arguments[i])); -- } --}, 'util.print: Use console.log instead'); -- -- --exports.puts = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stdout.write(arguments[i] + '\n'); -- } --}, 'util.puts: Use console.log instead'); -- -- --exports.debug = exports.deprecate(function(x) { -- process.stderr.write('DEBUG: ' + x + '\n'); --}, 'util.debug: Use console.error instead'); -- -- --exports.error = exports.deprecate(function(x) { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stderr.write(arguments[i] + '\n'); -- } --}, 'util.error: Use console.error instead'); -- -- --exports.pump = exports.deprecate(function(readStream, writeStream, callback) { -- var callbackCalled = false; -- -- function call(a, b, c) { -- if (callback && !callbackCalled) { -- callback(a, b, c); -- callbackCalled = true; -- } -- } -- -- readStream.addListener('data', function(chunk) { -- if (writeStream.write(chunk) === false) readStream.pause(); -- }); -- -- writeStream.addListener('drain', function() { -- readStream.resume(); -- }); -- -- readStream.addListener('end', function() { -- writeStream.end(); -- }); -- -- readStream.addListener('close', function() { -- call(); -- }); -- -- readStream.addListener('error', function(err) { -- writeStream.end(); -- call(err); -- }); -- -- writeStream.addListener('error', function(err) { -- readStream.destroy(); -- call(err); -- }); --}, 'util.pump(): Use readableStream.pipe() instead'); -- -- --var uv; --exports._errnoException = function(err, syscall) { -- if (isUndefined(uv)) uv = process.binding('uv'); -- var errname = uv.errname(err); -- var e = new Error(syscall + ' ' + errname); -- e.code = errname; -- e.errno = errname; -- e.syscall = syscall; -- return e; --}; -+} \ No newline at end of file diff --git a/node_modules/core-util-is/lib/util.js b/node_modules/core-util-is/lib/util.js deleted file mode 100644 index ff4c851c0..000000000 --- a/node_modules/core-util-is/lib/util.js +++ /dev/null @@ -1,107 +0,0 @@ -// 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. - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. - -function isArray(arg) { - if (Array.isArray) { - return Array.isArray(arg); - } - return objectToString(arg) === '[object Array]'; -} -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 objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return (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 = Buffer.isBuffer; - -function objectToString(o) { - return Object.prototype.toString.call(o); -} diff --git a/node_modules/core-util-is/package.json b/node_modules/core-util-is/package.json deleted file mode 100644 index b0b38e3f0..000000000 --- a/node_modules/core-util-is/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "_from": "core-util-is@>=1.0.1 <1.1.0-0", - "_id": "core-util-is@1.0.2", - "_inBundle": false, - "_integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "_location": "/core-util-is", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "core-util-is@>=1.0.1 <1.1.0-0", - "name": "core-util-is", - "escapedName": "core-util-is", - "rawSpec": ">=1.0.1 <1.1.0-0", - "saveSpec": null, - "fetchSpec": ">=1.0.1 <1.1.0-0" - }, - "_requiredBy": [ - "/bole", - "/readable-stream", - "/split2/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", - "_spec": "core-util-is@>=1.0.1 <1.1.0-0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/bole", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/core-util-is/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "The `util.is*` functions introduced in Node v0.12.", - "devDependencies": { - "tap": "^2.3.0" - }, - "homepage": "https://github.com/isaacs/core-util-is#readme", - "keywords": [ - "util", - "isBuffer", - "isArray", - "isNumber", - "isString", - "isRegExp", - "isThis", - "isThat", - "polyfill" - ], - "license": "MIT", - "main": "lib/util.js", - "name": "core-util-is", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/core-util-is.git" - }, - "scripts": { - "test": "tap test.js" - }, - "version": "1.0.2" -} diff --git a/node_modules/core-util-is/test.js b/node_modules/core-util-is/test.js deleted file mode 100644 index 1a490c65a..000000000 --- a/node_modules/core-util-is/test.js +++ /dev/null @@ -1,68 +0,0 @@ -var assert = require('tap'); - -var t = require('./lib/util'); - -assert.equal(t.isArray([]), true); -assert.equal(t.isArray({}), false); - -assert.equal(t.isBoolean(null), false); -assert.equal(t.isBoolean(true), true); -assert.equal(t.isBoolean(false), true); - -assert.equal(t.isNull(null), true); -assert.equal(t.isNull(undefined), false); -assert.equal(t.isNull(false), false); -assert.equal(t.isNull(), false); - -assert.equal(t.isNullOrUndefined(null), true); -assert.equal(t.isNullOrUndefined(undefined), true); -assert.equal(t.isNullOrUndefined(false), false); -assert.equal(t.isNullOrUndefined(), true); - -assert.equal(t.isNumber(null), false); -assert.equal(t.isNumber('1'), false); -assert.equal(t.isNumber(1), true); - -assert.equal(t.isString(null), false); -assert.equal(t.isString('1'), true); -assert.equal(t.isString(1), false); - -assert.equal(t.isSymbol(null), false); -assert.equal(t.isSymbol('1'), false); -assert.equal(t.isSymbol(1), false); -assert.equal(t.isSymbol(Symbol()), true); - -assert.equal(t.isUndefined(null), false); -assert.equal(t.isUndefined(undefined), true); -assert.equal(t.isUndefined(false), false); -assert.equal(t.isUndefined(), true); - -assert.equal(t.isRegExp(null), false); -assert.equal(t.isRegExp('1'), false); -assert.equal(t.isRegExp(new RegExp()), true); - -assert.equal(t.isObject({}), true); -assert.equal(t.isObject([]), true); -assert.equal(t.isObject(new RegExp()), true); -assert.equal(t.isObject(new Date()), true); - -assert.equal(t.isDate(null), false); -assert.equal(t.isDate('1'), false); -assert.equal(t.isDate(new Date()), true); - -assert.equal(t.isError(null), false); -assert.equal(t.isError({ err: true }), false); -assert.equal(t.isError(new Error()), true); - -assert.equal(t.isFunction(null), false); -assert.equal(t.isFunction({ }), false); -assert.equal(t.isFunction(function() {}), true); - -assert.equal(t.isPrimitive(null), true); -assert.equal(t.isPrimitive(''), true); -assert.equal(t.isPrimitive(0), true); -assert.equal(t.isPrimitive(new Date()), false); - -assert.equal(t.isBuffer(null), false); -assert.equal(t.isBuffer({}), false); -assert.equal(t.isBuffer(new Buffer(0)), true); diff --git a/node_modules/create-ecdh/.travis.yml b/node_modules/create-ecdh/.travis.yml deleted file mode 100644 index 4ceadcbea..000000000 --- a/node_modules/create-ecdh/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -sudo: false -node_js: - - 6 - - 8 - - 9 - - 10 diff --git a/node_modules/create-ecdh/LICENSE b/node_modules/create-ecdh/LICENSE deleted file mode 100644 index 58b3e845c..000000000 --- a/node_modules/create-ecdh/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017 createECDH 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. diff --git a/node_modules/create-ecdh/browser.js b/node_modules/create-ecdh/browser.js deleted file mode 100644 index 3613b4514..000000000 --- a/node_modules/create-ecdh/browser.js +++ /dev/null @@ -1,124 +0,0 @@ -var elliptic = require('elliptic') -var BN = require('bn.js') - -module.exports = function createECDH (curve) { - return new ECDH(curve) -} - -var aliases = { - secp256k1: { - name: 'secp256k1', - byteLength: 32 - }, - secp224r1: { - name: 'p224', - byteLength: 28 - }, - prime256v1: { - name: 'p256', - byteLength: 32 - }, - prime192v1: { - name: 'p192', - byteLength: 24 - }, - ed25519: { - name: 'ed25519', - byteLength: 32 - }, - secp384r1: { - name: 'p384', - byteLength: 48 - }, - secp521r1: { - name: 'p521', - byteLength: 66 - } -} - -aliases.p224 = aliases.secp224r1 -aliases.p256 = aliases.secp256r1 = aliases.prime256v1 -aliases.p192 = aliases.secp192r1 = aliases.prime192v1 -aliases.p384 = aliases.secp384r1 -aliases.p521 = aliases.secp521r1 - -function ECDH (curve) { - this.curveType = aliases[curve] - if (!this.curveType) { - this.curveType = { - name: curve - } - } - this.curve = new elliptic.ec(this.curveType.name) // eslint-disable-line new-cap - this.keys = void 0 -} - -ECDH.prototype.generateKeys = function (enc, format) { - this.keys = this.curve.genKeyPair() - return this.getPublicKey(enc, format) -} - -ECDH.prototype.computeSecret = function (other, inenc, enc) { - inenc = inenc || 'utf8' - if (!Buffer.isBuffer(other)) { - other = new Buffer(other, inenc) - } - var otherPub = this.curve.keyFromPublic(other).getPublic() - var out = otherPub.mul(this.keys.getPrivate()).getX() - return formatReturnValue(out, enc, this.curveType.byteLength) -} - -ECDH.prototype.getPublicKey = function (enc, format) { - var key = this.keys.getPublic(format === 'compressed', true) - if (format === 'hybrid') { - if (key[key.length - 1] % 2) { - key[0] = 7 - } else { - key[0] = 6 - } - } - return formatReturnValue(key, enc) -} - -ECDH.prototype.getPrivateKey = function (enc) { - return formatReturnValue(this.keys.getPrivate(), enc) -} - -ECDH.prototype.setPublicKey = function (pub, enc) { - enc = enc || 'utf8' - if (!Buffer.isBuffer(pub)) { - pub = new Buffer(pub, enc) - } - this.keys._importPublic(pub) - return this -} - -ECDH.prototype.setPrivateKey = function (priv, enc) { - enc = enc || 'utf8' - if (!Buffer.isBuffer(priv)) { - priv = new Buffer(priv, enc) - } - - var _priv = new BN(priv) - _priv = _priv.toString(16) - this.keys = this.curve.genKeyPair() - this.keys._importPrivate(_priv) - return this -} - -function formatReturnValue (bn, enc, len) { - if (!Array.isArray(bn)) { - bn = bn.toArray() - } - var buf = new Buffer(bn) - if (len && buf.length < len) { - var zeros = new Buffer(len - buf.length) - zeros.fill(0) - buf = Buffer.concat([zeros, buf]) - } - if (!enc) { - return buf - } else { - return buf.toString(enc) - } -} diff --git a/node_modules/create-ecdh/index.js b/node_modules/create-ecdh/index.js deleted file mode 100644 index 841d085ec..000000000 --- a/node_modules/create-ecdh/index.js +++ /dev/null @@ -1,3 +0,0 @@ -var createECDH = require('crypto').createECDH - -module.exports = createECDH || require('./browser') diff --git a/node_modules/create-ecdh/package.json b/node_modules/create-ecdh/package.json deleted file mode 100644 index addfb0743..000000000 --- a/node_modules/create-ecdh/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_from": "create-ecdh@^4.0.0", - "_id": "create-ecdh@4.0.3", - "_inBundle": false, - "_integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", - "_location": "/create-ecdh", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "create-ecdh@^4.0.0", - "name": "create-ecdh", - "escapedName": "create-ecdh", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/crypto-browserify" - ], - "_resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", - "_shasum": "c9111b6f33045c4697f144787f9254cdc77c45ff", - "_spec": "create-ecdh@^4.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/crypto-browserify", - "author": { - "name": "Calvin Metcalf" - }, - "browser": "browser.js", - "bugs": { - "url": "https://github.com/crypto-browserify/createECDH/issues" - }, - "bundleDependencies": false, - "dependencies": { - "bn.js": "^4.1.0", - "elliptic": "^6.0.0" - }, - "deprecated": false, - "description": "createECDH but browserifiable", - "devDependencies": { - "standard": "^5.4.1", - "tap-spec": "^1.0.1", - "tape": "^3.0.1" - }, - "homepage": "https://github.com/crypto-browserify/createECDH", - "keywords": [ - "diffie", - "hellman", - "diffiehellman", - "ECDH" - ], - "license": "MIT", - "main": "index.js", - "name": "create-ecdh", - "repository": { - "type": "git", - "url": "git+https://github.com/crypto-browserify/createECDH.git" - }, - "scripts": { - "test": "standard && node test.js | tspec" - }, - "version": "4.0.3" -} diff --git a/node_modules/create-ecdh/readme.md b/node_modules/create-ecdh/readme.md deleted file mode 100644 index 7e5ce47b5..000000000 --- a/node_modules/create-ecdh/readme.md +++ /dev/null @@ -1,4 +0,0 @@ -createECDH [![Build Status](https://travis-ci.org/crypto-browserify/createECDH.svg)](https://travis-ci.org/crypto-browserify/createECDH) -==== - -In io.js or node >= 0.11 this module is just a shortcut to crypto.createECDH. In node <= 0.11 or the browser this is a pure JavaScript implimentation, more specifically a wrapper around [elliptic](https://github.com/indutny/elliptic), to give it the same API as node. `secp256k1`, `secp224r1` (aka p224), `prime256v1` (aka p256, secp256r1), `prime192v1` (aka p192, secp192r1), `secp384r1` (aka p384), `secp521r1` (aka p521) curves all work in both this library and node (though only the highlighted name will work in node). diff --git a/node_modules/create-hash/.travis.yml b/node_modules/create-hash/.travis.yml deleted file mode 100644 index da59431d2..000000000 --- a/node_modules/create-hash/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -sudo: false -language: node_js -before_install: - - "npm install npm -g" -node_js: - - "4" - - "5" - - "6" - - "7" -env: - matrix: - - TEST_SUITE=unit -matrix: - include: - - node_js: "7" - env: TEST_SUITE=standard -script: npm run $TEST_SUITE diff --git a/node_modules/create-hash/LICENSE b/node_modules/create-hash/LICENSE deleted file mode 100644 index f06007ae3..000000000 --- a/node_modules/create-hash/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2017 crypto-browserify 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. diff --git a/node_modules/create-hash/README.md b/node_modules/create-hash/README.md deleted file mode 100644 index bad028d32..000000000 --- a/node_modules/create-hash/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# create-hash - -[![Build Status](https://travis-ci.org/crypto-browserify/createHash.svg)](https://travis-ci.org/crypto-browserify/createHash) - -Node style hashes for use in the browser, with native hash functions in node. - -API is the same as hashes in node: -```js -var createHash = require('create-hash') -var hash = createHash('sha224') -hash.update('synchronous write') // optional encoding parameter -hash.digest() // synchronously get result with optional encoding parameter - -hash.write('write to it as a stream') -hash.end() // remember it's a stream -hash.read() // only if you ended it as a stream though -``` - -To get the JavaScript version even in node do `require('create-hash/browser')` diff --git a/node_modules/create-hash/browser.js b/node_modules/create-hash/browser.js deleted file mode 100644 index 01841bb9b..000000000 --- a/node_modules/create-hash/browser.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict' -var inherits = require('inherits') -var MD5 = require('md5.js') -var RIPEMD160 = require('ripemd160') -var sha = require('sha.js') -var Base = require('cipher-base') - -function Hash (hash) { - Base.call(this, 'digest') - - this._hash = hash -} - -inherits(Hash, Base) - -Hash.prototype._update = function (data) { - this._hash.update(data) -} - -Hash.prototype._final = function () { - return this._hash.digest() -} - -module.exports = function createHash (alg) { - alg = alg.toLowerCase() - if (alg === 'md5') return new MD5() - if (alg === 'rmd160' || alg === 'ripemd160') return new RIPEMD160() - - return new Hash(sha(alg)) -} diff --git a/node_modules/create-hash/index.js b/node_modules/create-hash/index.js deleted file mode 100644 index 658f6a02e..000000000 --- a/node_modules/create-hash/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('crypto').createHash diff --git a/node_modules/create-hash/md5.js b/node_modules/create-hash/md5.js deleted file mode 100644 index 3643ee299..000000000 --- a/node_modules/create-hash/md5.js +++ /dev/null @@ -1,5 +0,0 @@ -var MD5 = require('md5.js') - -module.exports = function (buffer) { - return new MD5().update(buffer).digest() -} diff --git a/node_modules/create-hash/package.json b/node_modules/create-hash/package.json deleted file mode 100644 index 90e7a1e38..000000000 --- a/node_modules/create-hash/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_from": "create-hash@^1.1.0", - "_id": "create-hash@1.2.0", - "_inBundle": false, - "_integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "_location": "/create-hash", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "create-hash@^1.1.0", - "name": "create-hash", - "escapedName": "create-hash", - "rawSpec": "^1.1.0", - "saveSpec": null, - "fetchSpec": "^1.1.0" - }, - "_requiredBy": [ - "/browserify-aes", - "/browserify-sign", - "/create-hmac", - "/crypto-browserify", - "/parse-asn1", - "/pbkdf2", - "/public-encrypt" - ], - "_resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "_shasum": "889078af11a63756bcfb59bd221996be3a9ef196", - "_spec": "create-hash@^1.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/crypto-browserify", - "author": "", - "browser": "browser.js", - "bugs": { - "url": "https://github.com/crypto-browserify/createHash/issues" - }, - "bundleDependencies": false, - "dependencies": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - }, - "deprecated": false, - "description": "create hashes for browserify", - "devDependencies": { - "hash-test-vectors": "^1.3.2", - "safe-buffer": "^5.0.1", - "standard": "^10.0.2", - "tap-spec": "^2.1.2", - "tape": "^4.6.3" - }, - "homepage": "https://github.com/crypto-browserify/createHash", - "keywords": [ - "crypto" - ], - "license": "MIT", - "main": "index.js", - "name": "create-hash", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/crypto-browserify/createHash.git" - }, - "scripts": { - "standard": "standard", - "test": "npm run-script standard && npm run-script unit", - "unit": "node test.js | tspec" - }, - "version": "1.2.0" -} diff --git a/node_modules/create-hash/test.js b/node_modules/create-hash/test.js deleted file mode 100644 index 7c98f9fca..000000000 --- a/node_modules/create-hash/test.js +++ /dev/null @@ -1,41 +0,0 @@ -var test = require('tape') - -var Buffer = require('safe-buffer').Buffer -var algorithms = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160', 'ripemd160'] -var encodings = ['hex', 'base64'] // ignore binary -var vectors = require('hash-test-vectors') -vectors.forEach(function (vector) { - vector.ripemd160 = vector.rmd160 -}) -var createHash = require('./browser') - -algorithms.forEach(function (algorithm) { - test('test ' + algorithm + ' against test vectors', function (t) { - vectors.forEach(function (obj, i) { - var input = Buffer.from(obj.input, 'base64') - var node = obj[algorithm] - var js = createHash(algorithm).update(input).digest('hex') - t.equal(js, node, algorithm + '(testVector[' + i + ']) == ' + node) - }) - - encodings.forEach(function (encoding) { - vectors.forEach(function (obj, i) { - var input = Buffer.from(obj.input, 'base64').toString(encoding) - var node = obj[algorithm] - var js = createHash(algorithm).update(input, encoding).digest('hex') - t.equal(js, node, algorithm + '(testVector[' + i + '], ' + encoding + ') == ' + node) - }) - }) - - vectors.forEach(function (obj, i) { - var input = Buffer.from(obj.input, 'base64') - var node = obj[algorithm] - var hash = createHash(algorithm) - hash.end(input) - var js = hash.read().toString('hex') - t.equal(js, node, algorithm + '(testVector[' + i + ']) == ' + node) - }) - - t.end() - }) -}) diff --git a/node_modules/create-hmac/LICENSE b/node_modules/create-hmac/LICENSE deleted file mode 100644 index f06007ae3..000000000 --- a/node_modules/create-hmac/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2017 crypto-browserify 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. diff --git a/node_modules/create-hmac/README.md b/node_modules/create-hmac/README.md deleted file mode 100644 index e8de47f8a..000000000 --- a/node_modules/create-hmac/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# create-hmac - -[![NPM Package](https://img.shields.io/npm/v/create-hmac.svg?style=flat-square)](https://www.npmjs.org/package/create-hmac) -[![Build Status](https://img.shields.io/travis/crypto-browserify/createHmac.svg?branch=master&style=flat-square)](https://travis-ci.org/crypto-browserify/createHmac) -[![Dependency status](https://img.shields.io/david/crypto-browserify/createHmac.svg?style=flat-square)](https://david-dm.org/crypto-browserify/createHmac#info=dependencies) - -[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) - -Node style HMACs for use in the browser, with native HMAC functions in node. API is the same as HMACs in node: - -```js -var createHmac = require('create-hmac') -var hmac = createHmac('sha224', Buffer.from('secret key')) -hmac.update('synchronous write') //optional encoding parameter -hmac.digest() // synchronously get result with optional encoding parameter - -hmac.write('write to it as a stream') -hmac.end() //remember it's a stream -hmac.read() //only if you ended it as a stream though -``` diff --git a/node_modules/create-hmac/browser.js b/node_modules/create-hmac/browser.js deleted file mode 100644 index a5c9b61ea..000000000 --- a/node_modules/create-hmac/browser.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict' -var inherits = require('inherits') -var Legacy = require('./legacy') -var Base = require('cipher-base') -var Buffer = require('safe-buffer').Buffer -var md5 = require('create-hash/md5') -var RIPEMD160 = require('ripemd160') - -var sha = require('sha.js') - -var ZEROS = Buffer.alloc(128) - -function Hmac (alg, key) { - Base.call(this, 'digest') - if (typeof key === 'string') { - key = Buffer.from(key) - } - - var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64 - - this._alg = alg - this._key = key - if (key.length > blocksize) { - var hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg) - key = hash.update(key).digest() - } else if (key.length < blocksize) { - key = Buffer.concat([key, ZEROS], blocksize) - } - - var ipad = this._ipad = Buffer.allocUnsafe(blocksize) - var opad = this._opad = Buffer.allocUnsafe(blocksize) - - for (var i = 0; i < blocksize; i++) { - ipad[i] = key[i] ^ 0x36 - opad[i] = key[i] ^ 0x5C - } - this._hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg) - this._hash.update(ipad) -} - -inherits(Hmac, Base) - -Hmac.prototype._update = function (data) { - this._hash.update(data) -} - -Hmac.prototype._final = function () { - var h = this._hash.digest() - var hash = this._alg === 'rmd160' ? new RIPEMD160() : sha(this._alg) - return hash.update(this._opad).update(h).digest() -} - -module.exports = function createHmac (alg, key) { - alg = alg.toLowerCase() - if (alg === 'rmd160' || alg === 'ripemd160') { - return new Hmac('rmd160', key) - } - if (alg === 'md5') { - return new Legacy(md5, key) - } - return new Hmac(alg, key) -} diff --git a/node_modules/create-hmac/index.js b/node_modules/create-hmac/index.js deleted file mode 100644 index ec8c4f728..000000000 --- a/node_modules/create-hmac/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('crypto').createHmac diff --git a/node_modules/create-hmac/legacy.js b/node_modules/create-hmac/legacy.js deleted file mode 100644 index 5039c2a7a..000000000 --- a/node_modules/create-hmac/legacy.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict' -var inherits = require('inherits') -var Buffer = require('safe-buffer').Buffer - -var Base = require('cipher-base') - -var ZEROS = Buffer.alloc(128) -var blocksize = 64 - -function Hmac (alg, key) { - Base.call(this, 'digest') - if (typeof key === 'string') { - key = Buffer.from(key) - } - - this._alg = alg - this._key = key - - if (key.length > blocksize) { - key = alg(key) - } else if (key.length < blocksize) { - key = Buffer.concat([key, ZEROS], blocksize) - } - - var ipad = this._ipad = Buffer.allocUnsafe(blocksize) - var opad = this._opad = Buffer.allocUnsafe(blocksize) - - for (var i = 0; i < blocksize; i++) { - ipad[i] = key[i] ^ 0x36 - opad[i] = key[i] ^ 0x5C - } - - this._hash = [ipad] -} - -inherits(Hmac, Base) - -Hmac.prototype._update = function (data) { - this._hash.push(data) -} - -Hmac.prototype._final = function () { - var h = this._alg(Buffer.concat(this._hash)) - return this._alg(Buffer.concat([this._opad, h])) -} -module.exports = Hmac diff --git a/node_modules/create-hmac/package.json b/node_modules/create-hmac/package.json deleted file mode 100644 index abfd4d1c0..000000000 --- a/node_modules/create-hmac/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "_from": "create-hmac@^1.1.0", - "_id": "create-hmac@1.1.7", - "_inBundle": false, - "_integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "_location": "/create-hmac", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "create-hmac@^1.1.0", - "name": "create-hmac", - "escapedName": "create-hmac", - "rawSpec": "^1.1.0", - "saveSpec": null, - "fetchSpec": "^1.1.0" - }, - "_requiredBy": [ - "/browserify-sign", - "/crypto-browserify", - "/pbkdf2" - ], - "_resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "_shasum": "69170c78b3ab957147b2b8b04572e47ead2243ff", - "_spec": "create-hmac@^1.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/crypto-browserify", - "author": "", - "browser": "./browser.js", - "bugs": { - "url": "https://github.com/crypto-browserify/createHmac/issues" - }, - "bundleDependencies": false, - "dependencies": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - }, - "deprecated": false, - "description": "node style hmacs in the browser", - "devDependencies": { - "hash-test-vectors": "^1.3.2", - "standard": "^5.3.1", - "tap-spec": "^2.1.2", - "tape": "^3.0.3" - }, - "files": [ - "browser.js", - "index.js", - "legacy.js" - ], - "homepage": "https://github.com/crypto-browserify/createHmac", - "keywords": [ - "crypto", - "hmac" - ], - "license": "MIT", - "main": "index.js", - "name": "create-hmac", - "repository": { - "type": "git", - "url": "git+https://github.com/crypto-browserify/createHmac.git" - }, - "scripts": { - "standard": "standard", - "test": "npm run-script standard && npm run-script unit", - "unit": "node test.js | tspec" - }, - "version": "1.1.7" -} diff --git a/node_modules/cross-spawn/CHANGELOG.md b/node_modules/cross-spawn/CHANGELOG.md deleted file mode 100644 index ded9620b1..000000000 --- a/node_modules/cross-spawn/CHANGELOG.md +++ /dev/null @@ -1,100 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - - -## [6.0.5](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.4...v6.0.5) (2018-03-02) - - -### Bug Fixes - -* avoid using deprecated Buffer constructor ([#94](https://github.com/moxystudio/node-cross-spawn/issues/94)) ([d5770df](https://github.com/moxystudio/node-cross-spawn/commit/d5770df)), closes [/nodejs.org/api/deprecations.html#deprecations_dep0005](https://github.com//nodejs.org/api/deprecations.html/issues/deprecations_dep0005) - - - - -## [6.0.4](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.3...v6.0.4) (2018-01-31) - - -### Bug Fixes - -* fix paths being incorrectly normalized on unix ([06ee3c6](https://github.com/moxystudio/node-cross-spawn/commit/06ee3c6)), closes [#90](https://github.com/moxystudio/node-cross-spawn/issues/90) - - - - -## [6.0.3](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.2...v6.0.3) (2018-01-23) - - - - -## [6.0.2](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.1...v6.0.2) (2018-01-23) - - - - -## [6.0.1](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.0...v6.0.1) (2018-01-23) - - - - -# [6.0.0](https://github.com/moxystudio/node-cross-spawn/compare/5.1.0...6.0.0) (2018-01-23) - - -### Bug Fixes - -* fix certain arguments not being correctly escaped or causing batch syntax error ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10)), closes [#82](https://github.com/moxystudio/node-cross-spawn/issues/82) [#51](https://github.com/moxystudio/node-cross-spawn/issues/51) -* fix commands as posix relatixe paths not working correctly, e.g.: `./my-command` ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10)) -* fix `options` argument being mutated ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10)) -* fix commands resolution when PATH was actually Path ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10)) - - -### Features - -* improve compliance with node's ENOENT errors ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10)) -* improve detection of node's shell option support ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10)) - - -### Chores - -* upgrade tooling -* upgrate project to es6 (node v4) - - -### BREAKING CHANGES - -* remove support for older nodejs versions, only `node >= 4` is supported - - - -## [5.1.0](https://github.com/moxystudio/node-cross-spawn/compare/5.0.1...5.1.0) (2017-02-26) - - -### Bug Fixes - -* fix `options.shell` support for NodeJS [v4.8](https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V4.md#4.8.0) - - - -## [5.0.1](https://github.com/moxystudio/node-cross-spawn/compare/5.0.0...5.0.1) (2016-11-04) - - -### Bug Fixes - -* fix `options.shell` support for NodeJS v7 - - - -# [5.0.0](https://github.com/moxystudio/node-cross-spawn/compare/4.0.2...5.0.0) (2016-10-30) - - -## Features - -* add support for `options.shell` -* improve parsing of shebangs by using [`shebang-command`](https://github.com/kevva/shebang-command) module - - -## Chores - -* refactor some code to make it more clear -* update README caveats diff --git a/node_modules/cross-spawn/LICENSE b/node_modules/cross-spawn/LICENSE deleted file mode 100644 index 8407b9a30..000000000 --- a/node_modules/cross-spawn/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 Made With MOXY Lda - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/cross-spawn/README.md b/node_modules/cross-spawn/README.md deleted file mode 100644 index e895cd7a7..000000000 --- a/node_modules/cross-spawn/README.md +++ /dev/null @@ -1,94 +0,0 @@ -# cross-spawn - -[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Build status][appveyor-image]][appveyor-url] [![Coverage Status][codecov-image]][codecov-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url] [![Greenkeeper badge][greenkeeper-image]][greenkeeper-url] - -[npm-url]:https://npmjs.org/package/cross-spawn -[downloads-image]:http://img.shields.io/npm/dm/cross-spawn.svg -[npm-image]:http://img.shields.io/npm/v/cross-spawn.svg -[travis-url]:https://travis-ci.org/moxystudio/node-cross-spawn -[travis-image]:http://img.shields.io/travis/moxystudio/node-cross-spawn/master.svg -[appveyor-url]:https://ci.appveyor.com/project/satazor/node-cross-spawn -[appveyor-image]:https://img.shields.io/appveyor/ci/satazor/node-cross-spawn/master.svg -[codecov-url]:https://codecov.io/gh/moxystudio/node-cross-spawn -[codecov-image]:https://img.shields.io/codecov/c/github/moxystudio/node-cross-spawn/master.svg -[david-dm-url]:https://david-dm.org/moxystudio/node-cross-spawn -[david-dm-image]:https://img.shields.io/david/moxystudio/node-cross-spawn.svg -[david-dm-dev-url]:https://david-dm.org/moxystudio/node-cross-spawn?type=dev -[david-dm-dev-image]:https://img.shields.io/david/dev/moxystudio/node-cross-spawn.svg -[greenkeeper-image]:https://badges.greenkeeper.io/moxystudio/node-cross-spawn.svg -[greenkeeper-url]:https://greenkeeper.io/ - -A cross platform solution to node's spawn and spawnSync. - - -## Installation - -`$ npm install cross-spawn` - - -## Why - -Node has issues when using spawn on Windows: - -- It ignores [PATHEXT](https://github.com/joyent/node/issues/2318) -- It does not support [shebangs](https://en.wikipedia.org/wiki/Shebang_(Unix)) -- Has problems running commands with [spaces](https://github.com/nodejs/node/issues/7367) -- Has problems running commands with posix relative paths (e.g.: `./my-folder/my-executable`) -- Has an [issue](https://github.com/moxystudio/node-cross-spawn/issues/82) with command shims (files in `node_modules/.bin/`), where arguments with quotes and parenthesis would result in [invalid syntax error](https://github.com/moxystudio/node-cross-spawn/blob/e77b8f22a416db46b6196767bcd35601d7e11d54/test/index.test.js#L149) -- No `options.shell` support on node `` where `` must not contain any arguments. -If you would like to have the shebang support improved, feel free to contribute via a pull-request. - -Remember to always test your code on Windows! - - -## Tests - -`$ npm test` -`$ npm test -- --watch` during development - -## License - -Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php). diff --git a/node_modules/cross-spawn/index.js b/node_modules/cross-spawn/index.js deleted file mode 100644 index 5509742ca..000000000 --- a/node_modules/cross-spawn/index.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -const cp = require('child_process'); -const parse = require('./lib/parse'); -const enoent = require('./lib/enoent'); - -function spawn(command, args, options) { - // Parse the arguments - const parsed = parse(command, args, options); - - // Spawn the child process - const spawned = cp.spawn(parsed.command, parsed.args, parsed.options); - - // Hook into child process "exit" event to emit an error if the command - // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 - enoent.hookChildProcess(spawned, parsed); - - return spawned; -} - -function spawnSync(command, args, options) { - // Parse the arguments - const parsed = parse(command, args, options); - - // Spawn the child process - const result = cp.spawnSync(parsed.command, parsed.args, parsed.options); - - // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 - result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); - - return result; -} - -module.exports = spawn; -module.exports.spawn = spawn; -module.exports.sync = spawnSync; - -module.exports._parse = parse; -module.exports._enoent = enoent; diff --git a/node_modules/cross-spawn/lib/enoent.js b/node_modules/cross-spawn/lib/enoent.js deleted file mode 100644 index 14df9b623..000000000 --- a/node_modules/cross-spawn/lib/enoent.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; - -const isWin = process.platform === 'win32'; - -function notFoundError(original, syscall) { - return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), { - code: 'ENOENT', - errno: 'ENOENT', - syscall: `${syscall} ${original.command}`, - path: original.command, - spawnargs: original.args, - }); -} - -function hookChildProcess(cp, parsed) { - if (!isWin) { - return; - } - - const originalEmit = cp.emit; - - cp.emit = function (name, arg1) { - // If emitting "exit" event and exit code is 1, we need to check if - // the command exists and emit an "error" instead - // See https://github.com/IndigoUnited/node-cross-spawn/issues/16 - if (name === 'exit') { - const err = verifyENOENT(arg1, parsed, 'spawn'); - - if (err) { - return originalEmit.call(cp, 'error', err); - } - } - - return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params - }; -} - -function verifyENOENT(status, parsed) { - if (isWin && status === 1 && !parsed.file) { - return notFoundError(parsed.original, 'spawn'); - } - - return null; -} - -function verifyENOENTSync(status, parsed) { - if (isWin && status === 1 && !parsed.file) { - return notFoundError(parsed.original, 'spawnSync'); - } - - return null; -} - -module.exports = { - hookChildProcess, - verifyENOENT, - verifyENOENTSync, - notFoundError, -}; diff --git a/node_modules/cross-spawn/lib/parse.js b/node_modules/cross-spawn/lib/parse.js deleted file mode 100644 index 962827a94..000000000 --- a/node_modules/cross-spawn/lib/parse.js +++ /dev/null @@ -1,125 +0,0 @@ -'use strict'; - -const path = require('path'); -const niceTry = require('nice-try'); -const resolveCommand = require('./util/resolveCommand'); -const escape = require('./util/escape'); -const readShebang = require('./util/readShebang'); -const semver = require('semver'); - -const isWin = process.platform === 'win32'; -const isExecutableRegExp = /\.(?:com|exe)$/i; -const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; - -// `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0 -const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false; - -function detectShebang(parsed) { - parsed.file = resolveCommand(parsed); - - const shebang = parsed.file && readShebang(parsed.file); - - if (shebang) { - parsed.args.unshift(parsed.file); - parsed.command = shebang; - - return resolveCommand(parsed); - } - - return parsed.file; -} - -function parseNonShell(parsed) { - if (!isWin) { - return parsed; - } - - // Detect & add support for shebangs - const commandFile = detectShebang(parsed); - - // We don't need a shell if the command filename is an executable - const needsShell = !isExecutableRegExp.test(commandFile); - - // If a shell is required, use cmd.exe and take care of escaping everything correctly - // Note that `forceShell` is an hidden option used only in tests - if (parsed.options.forceShell || needsShell) { - // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/` - // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument - // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called, - // we need to double escape them - const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); - - // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar) - // This is necessary otherwise it will always fail with ENOENT in those cases - parsed.command = path.normalize(parsed.command); - - // Escape command & arguments - parsed.command = escape.command(parsed.command); - parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars)); - - const shellCommand = [parsed.command].concat(parsed.args).join(' '); - - parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`]; - parsed.command = process.env.comspec || 'cmd.exe'; - parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped - } - - return parsed; -} - -function parseShell(parsed) { - // If node supports the shell option, there's no need to mimic its behavior - if (supportsShellOption) { - return parsed; - } - - // Mimic node shell option - // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335 - const shellCommand = [parsed.command].concat(parsed.args).join(' '); - - if (isWin) { - parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe'; - parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`]; - parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped - } else { - if (typeof parsed.options.shell === 'string') { - parsed.command = parsed.options.shell; - } else if (process.platform === 'android') { - parsed.command = '/system/bin/sh'; - } else { - parsed.command = '/bin/sh'; - } - - parsed.args = ['-c', shellCommand]; - } - - return parsed; -} - -function parse(command, args, options) { - // Normalize arguments, similar to nodejs - if (args && !Array.isArray(args)) { - options = args; - args = null; - } - - args = args ? args.slice(0) : []; // Clone array to avoid changing the original - options = Object.assign({}, options); // Clone object to avoid changing the original - - // Build our parsed object - const parsed = { - command, - args, - options, - file: undefined, - original: { - command, - args, - }, - }; - - // Delegate further parsing to shell or non-shell - return options.shell ? parseShell(parsed) : parseNonShell(parsed); -} - -module.exports = parse; diff --git a/node_modules/cross-spawn/lib/util/escape.js b/node_modules/cross-spawn/lib/util/escape.js deleted file mode 100644 index b0bb84c3a..000000000 --- a/node_modules/cross-spawn/lib/util/escape.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -// See http://www.robvanderwoude.com/escapechars.php -const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g; - -function escapeCommand(arg) { - // Escape meta chars - arg = arg.replace(metaCharsRegExp, '^$1'); - - return arg; -} - -function escapeArgument(arg, doubleEscapeMetaChars) { - // Convert to string - arg = `${arg}`; - - // Algorithm below is based on https://qntm.org/cmd - - // Sequence of backslashes followed by a double quote: - // double up all the backslashes and escape the double quote - arg = arg.replace(/(\\*)"/g, '$1$1\\"'); - - // Sequence of backslashes followed by the end of the string - // (which will become a double quote later): - // double up all the backslashes - arg = arg.replace(/(\\*)$/, '$1$1'); - - // All other backslashes occur literally - - // Quote the whole thing: - arg = `"${arg}"`; - - // Escape meta chars - arg = arg.replace(metaCharsRegExp, '^$1'); - - // Double escape meta chars if necessary - if (doubleEscapeMetaChars) { - arg = arg.replace(metaCharsRegExp, '^$1'); - } - - return arg; -} - -module.exports.command = escapeCommand; -module.exports.argument = escapeArgument; diff --git a/node_modules/cross-spawn/lib/util/readShebang.js b/node_modules/cross-spawn/lib/util/readShebang.js deleted file mode 100644 index bd4f1280c..000000000 --- a/node_modules/cross-spawn/lib/util/readShebang.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -const fs = require('fs'); -const shebangCommand = require('shebang-command'); - -function readShebang(command) { - // Read the first 150 bytes from the file - const size = 150; - let buffer; - - if (Buffer.alloc) { - // Node.js v4.5+ / v5.10+ - buffer = Buffer.alloc(size); - } else { - // Old Node.js API - buffer = new Buffer(size); - buffer.fill(0); // zero-fill - } - - let fd; - - try { - fd = fs.openSync(command, 'r'); - fs.readSync(fd, buffer, 0, size, 0); - fs.closeSync(fd); - } catch (e) { /* Empty */ } - - // Attempt to extract shebang (null is returned if not a shebang) - return shebangCommand(buffer.toString()); -} - -module.exports = readShebang; diff --git a/node_modules/cross-spawn/lib/util/resolveCommand.js b/node_modules/cross-spawn/lib/util/resolveCommand.js deleted file mode 100644 index 2fd5ad270..000000000 --- a/node_modules/cross-spawn/lib/util/resolveCommand.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -const path = require('path'); -const which = require('which'); -const pathKey = require('path-key')(); - -function resolveCommandAttempt(parsed, withoutPathExt) { - const cwd = process.cwd(); - const hasCustomCwd = parsed.options.cwd != null; - - // If a custom `cwd` was specified, we need to change the process cwd - // because `which` will do stat calls but does not support a custom cwd - if (hasCustomCwd) { - try { - process.chdir(parsed.options.cwd); - } catch (err) { - /* Empty */ - } - } - - let resolved; - - try { - resolved = which.sync(parsed.command, { - path: (parsed.options.env || process.env)[pathKey], - pathExt: withoutPathExt ? path.delimiter : undefined, - }); - } catch (e) { - /* Empty */ - } finally { - process.chdir(cwd); - } - - // If we successfully resolved, ensure that an absolute path is returned - // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it - if (resolved) { - resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved); - } - - return resolved; -} - -function resolveCommand(parsed) { - return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true); -} - -module.exports = resolveCommand; diff --git a/node_modules/cross-spawn/package.json b/node_modules/cross-spawn/package.json deleted file mode 100644 index be4af8539..000000000 --- a/node_modules/cross-spawn/package.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "_from": "cross-spawn@^6.0.0", - "_id": "cross-spawn@6.0.5", - "_inBundle": false, - "_integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "_location": "/cross-spawn", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "cross-spawn@^6.0.0", - "name": "cross-spawn", - "escapedName": "cross-spawn", - "rawSpec": "^6.0.0", - "saveSpec": null, - "fetchSpec": "^6.0.0" - }, - "_requiredBy": [ - "/execa" - ], - "_resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "_shasum": "4a5ec7c64dfae22c3a14124dbacdee846d80cbc4", - "_spec": "cross-spawn@^6.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/execa", - "author": { - "name": "André Cruz", - "email": "andre@moxy.studio" - }, - "bugs": { - "url": "https://github.com/moxystudio/node-cross-spawn/issues" - }, - "bundleDependencies": false, - "commitlint": { - "extends": [ - "@commitlint/config-conventional" - ] - }, - "dependencies": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "deprecated": false, - "description": "Cross platform child_process#spawn and child_process#spawnSync", - "devDependencies": { - "@commitlint/cli": "^6.0.0", - "@commitlint/config-conventional": "^6.0.2", - "babel-core": "^6.26.0", - "babel-jest": "^22.1.0", - "babel-preset-moxy": "^2.2.1", - "eslint": "^4.3.0", - "eslint-config-moxy": "^5.0.0", - "husky": "^0.14.3", - "jest": "^22.0.0", - "lint-staged": "^7.0.0", - "mkdirp": "^0.5.1", - "regenerator-runtime": "^0.11.1", - "rimraf": "^2.6.2", - "standard-version": "^4.2.0" - }, - "engines": { - "node": ">=4.8" - }, - "files": [ - "lib" - ], - "homepage": "https://github.com/moxystudio/node-cross-spawn", - "keywords": [ - "spawn", - "spawnSync", - "windows", - "cross-platform", - "path-ext", - "shebang", - "cmd", - "execute" - ], - "license": "MIT", - "lint-staged": { - "*.js": [ - "eslint --fix", - "git add" - ] - }, - "main": "index.js", - "name": "cross-spawn", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/moxystudio/node-cross-spawn.git" - }, - "scripts": { - "commitmsg": "commitlint -e $GIT_PARAMS", - "lint": "eslint .", - "precommit": "lint-staged", - "prerelease": "npm t && npm run lint", - "release": "standard-version", - "test": "jest --env node --coverage" - }, - "standard-version": { - "scripts": { - "posttag": "git push --follow-tags origin master && npm publish" - } - }, - "version": "6.0.5" -} diff --git a/node_modules/crypt/LICENSE.mkd b/node_modules/crypt/LICENSE.mkd deleted file mode 100644 index 96d4c428e..000000000 --- a/node_modules/crypt/LICENSE.mkd +++ /dev/null @@ -1,27 +0,0 @@ -Copyright © 2011, Paul Vorbach. All rights reserved. -Copyright © 2009, Jeff Mott. All rights reserved. - -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 Crypto-JS 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 HOLDER 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. diff --git a/node_modules/crypt/README.mkd b/node_modules/crypt/README.mkd deleted file mode 100644 index 2b1169fc5..000000000 --- a/node_modules/crypt/README.mkd +++ /dev/null @@ -1 +0,0 @@ -**crypt** provides utilities for encryption and hashing diff --git a/node_modules/crypt/crypt.js b/node_modules/crypt/crypt.js deleted file mode 100644 index 4ec09076d..000000000 --- a/node_modules/crypt/crypt.js +++ /dev/null @@ -1,96 +0,0 @@ -(function() { - var base64map - = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', - - crypt = { - // Bit-wise rotation left - rotl: function(n, b) { - return (n << b) | (n >>> (32 - b)); - }, - - // Bit-wise rotation right - rotr: function(n, b) { - return (n << (32 - b)) | (n >>> b); - }, - - // Swap big-endian to little-endian and vice versa - endian: function(n) { - // If number given, swap endian - if (n.constructor == Number) { - return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00; - } - - // Else, assume array and swap all items - for (var i = 0; i < n.length; i++) - n[i] = crypt.endian(n[i]); - return n; - }, - - // Generate an array of any length of random bytes - randomBytes: function(n) { - for (var bytes = []; n > 0; n--) - bytes.push(Math.floor(Math.random() * 256)); - return bytes; - }, - - // Convert a byte array to big-endian 32-bit words - bytesToWords: function(bytes) { - for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8) - words[b >>> 5] |= bytes[i] << (24 - b % 32); - return words; - }, - - // Convert big-endian 32-bit words to a byte array - wordsToBytes: function(words) { - for (var bytes = [], b = 0; b < words.length * 32; b += 8) - bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF); - return bytes; - }, - - // Convert a byte array to a hex string - bytesToHex: function(bytes) { - for (var hex = [], i = 0; i < bytes.length; i++) { - hex.push((bytes[i] >>> 4).toString(16)); - hex.push((bytes[i] & 0xF).toString(16)); - } - return hex.join(''); - }, - - // Convert a hex string to a byte array - hexToBytes: function(hex) { - for (var bytes = [], c = 0; c < hex.length; c += 2) - bytes.push(parseInt(hex.substr(c, 2), 16)); - return bytes; - }, - - // Convert a byte array to a base-64 string - bytesToBase64: function(bytes) { - for (var base64 = [], i = 0; i < bytes.length; i += 3) { - var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2]; - for (var j = 0; j < 4; j++) - if (i * 8 + j * 6 <= bytes.length * 8) - base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F)); - else - base64.push('='); - } - return base64.join(''); - }, - - // Convert a base-64 string to a byte array - base64ToBytes: function(base64) { - // Remove non-base-64 characters - base64 = base64.replace(/[^A-Z0-9+\/]/ig, ''); - - for (var bytes = [], i = 0, imod4 = 0; i < base64.length; - imod4 = ++i % 4) { - if (imod4 == 0) continue; - bytes.push(((base64map.indexOf(base64.charAt(i - 1)) - & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2)) - | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2))); - } - return bytes; - } - }; - - module.exports = crypt; -})(); diff --git a/node_modules/crypt/package.json b/node_modules/crypt/package.json deleted file mode 100644 index 2a1dfce16..000000000 --- a/node_modules/crypt/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "_from": "crypt@~0.0.1", - "_id": "crypt@0.0.2", - "_inBundle": false, - "_integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=", - "_location": "/crypt", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "crypt@~0.0.1", - "name": "crypt", - "escapedName": "crypt", - "rawSpec": "~0.0.1", - "saveSpec": null, - "fetchSpec": "~0.0.1" - }, - "_requiredBy": [ - "/md5" - ], - "_resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", - "_shasum": "88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b", - "_spec": "crypt@~0.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/md5", - "author": { - "name": "Paul Vorbach", - "email": "paul@vorb.de", - "url": "http://vorb.de" - }, - "bugs": { - "url": "https://github.com/pvorb/node-crypt/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "utilities for encryption and hashing", - "engines": { - "node": "*" - }, - "homepage": "https://github.com/pvorb/node-crypt#readme", - "license": "BSD-3-Clause", - "main": "crypt.js", - "name": "crypt", - "repository": { - "type": "git", - "url": "git://github.com/pvorb/node-crypt.git" - }, - "tags": [ - "hash", - "security" - ], - "version": "0.0.2" -} diff --git a/node_modules/crypto-browserify/.travis.yml b/node_modules/crypto-browserify/.travis.yml deleted file mode 100644 index 5ad8439a8..000000000 --- a/node_modules/crypto-browserify/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -sudo: false -language: node_js -matrix: - include: - - node_js: '0.11' - env: TEST_SUITE=unit - - node_js: '0.12' - env: TEST_SUITE=unit - - node_js: '4' - env: TEST_SUITE=unit - - node_js: '4' - env: TEST_SUITE=standard - - node_js: '4' - env: TEST_SUITE=browser BROWSER_NAME=ie BROWSER_VERSION="10..latest" - - node_js: '4' - env: TEST_SUITE=browser BROWSER_NAME=chrome BROWSER_VERSION="-2..beta" - - node_js: '4' - env: TEST_SUITE=browser BROWSER_NAME=firefox BROWSER_VERSION="-2..latest" - - node_js: '4' - env: TEST_SUITE=browser BROWSER_NAME=safari BROWSER_VERSION="7..latest" - - node_js: '4' - env: TEST_SUITE=browser BROWSER_NAME=android BROWSER_VERSION="5.0..latest" -script: "npm run-script $TEST_SUITE" -env: - global: - - secure: YHNUDQmx/WiW3gmDcRCfb6KLDeio7Mr5tqPY2kHPdZlBSytsQjNk75ytM4U6Cu8Uk8iEIoj/aFlxiVMpJNA8J4QSUyW/YkbVaIz0+1oywoV0Ht8aRBfZ1jvXfX6789+1Q9c4xaMkYYbJpXSh9JcirsiwmqWd4+IDd7hcESodsDQ= - - secure: Nhj5yejKZxUbtHGZta+GjYWqXGaOZB7ainTkOuGcpXM+OwwjeDpYlTBrwS90Q7hqens7KXVzQM09aDbadpsDCsOo1nyaEigMtomAorZ1UC1CpEoVz1ZuikF9bEhb+/7M9pzuL1fX+Ke9Dx4mPPeb8sf/2SrAu1RqXkSwZV/duAc= diff --git a/node_modules/crypto-browserify/.zuul.yml b/node_modules/crypto-browserify/.zuul.yml deleted file mode 100644 index 96d9cfbd3..000000000 --- a/node_modules/crypto-browserify/.zuul.yml +++ /dev/null @@ -1 +0,0 @@ -ui: tape diff --git a/node_modules/crypto-browserify/LICENSE b/node_modules/crypto-browserify/LICENSE deleted file mode 100644 index 8abb57d65..000000000 --- a/node_modules/crypto-browserify/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -The MIT License - -Copyright (c) 2013 Dominic Tarr - -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. \ No newline at end of file diff --git a/node_modules/crypto-browserify/README.md b/node_modules/crypto-browserify/README.md deleted file mode 100644 index 1b9cf3b08..000000000 --- a/node_modules/crypto-browserify/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# crypto-browserify - -A port of node's `crypto` module to the browser. - -[![Build Status](https://travis-ci.org/crypto-browserify/crypto-browserify.svg?branch=master)](https://travis-ci.org/crypto-browserify/crypto-browserify) -[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) -[![Sauce Test Status](https://saucelabs.com/browser-matrix/crypto-browserify.svg)](https://saucelabs.com/u/crypto-browserify) - -The goal of this module is to reimplement node's crypto module, -in pure javascript so that it can run in the browser. - -Here is the subset that is currently implemented: - -* createHash (sha1, sha224, sha256, sha384, sha512, md5, rmd160) -* createHmac (sha1, sha224, sha256, sha384, sha512, md5, rmd160) -* pbkdf2 -* pbkdf2Sync -* randomBytes -* pseudoRandomBytes -* createCipher (aes) -* createDecipher (aes) -* createDiffieHellman -* createSign (rsa, ecdsa) -* createVerify (rsa, ecdsa) -* createECDH (secp256k1) -* publicEncrypt/privateDecrypt (rsa) -* privateEncrypt/publicDecrypt (rsa) - -## todo - -these features from node's `crypto` are still unimplemented. - -* createCredentials - -## contributions - -If you are interested in writing a feature, please implement as a new module, -which will be incorporated into crypto-browserify as a dependency. - -All deps must be compatible with node's crypto -(generate example inputs and outputs with node, -and save base64 strings inside JSON, so that tests can run in the browser. -see [sha.js](https://github.com/dominictarr/sha.js) - -Crypto is _extra serious_ so please do not hesitate to review the code, -and post comments if you do. - -## License - -MIT diff --git a/node_modules/crypto-browserify/example/bundle.js b/node_modules/crypto-browserify/example/bundle.js deleted file mode 100644 index 02698cc77..000000000 --- a/node_modules/crypto-browserify/example/bundle.js +++ /dev/null @@ -1,637 +0,0 @@ -var require = function (file, cwd) { - var resolved = require.resolve(file, cwd || '/'); - var mod = require.modules[resolved]; - if (!mod) throw new Error( - 'Failed to resolve module ' + file + ', tried ' + resolved - ); - var res = mod._cached ? mod._cached : mod(); - return res; -} - -require.paths = []; -require.modules = {}; -require.extensions = [".js",".coffee"]; - -require._core = { - 'assert': true, - 'events': true, - 'fs': true, - 'path': true, - 'vm': true -}; - -require.resolve = (function () { - return function (x, cwd) { - if (!cwd) cwd = '/'; - - if (require._core[x]) return x; - var path = require.modules.path(); - cwd = path.resolve('/', cwd); - var y = cwd || '/'; - - if (x.match(/^(?:\.\.?\/|\/)/)) { - var m = loadAsFileSync(path.resolve(y, x)) - || loadAsDirectorySync(path.resolve(y, x)); - if (m) return m; - } - - var n = loadNodeModulesSync(x, y); - if (n) return n; - - throw new Error("Cannot find module '" + x + "'"); - - function loadAsFileSync (x) { - if (require.modules[x]) { - return x; - } - - for (var i = 0; i < require.extensions.length; i++) { - var ext = require.extensions[i]; - if (require.modules[x + ext]) return x + ext; - } - } - - function loadAsDirectorySync (x) { - x = x.replace(/\/+$/, ''); - var pkgfile = x + '/package.json'; - if (require.modules[pkgfile]) { - var pkg = require.modules[pkgfile](); - var b = pkg.browserify; - if (typeof b === 'object' && b.main) { - var m = loadAsFileSync(path.resolve(x, b.main)); - if (m) return m; - } - else if (typeof b === 'string') { - var m = loadAsFileSync(path.resolve(x, b)); - if (m) return m; - } - else if (pkg.main) { - var m = loadAsFileSync(path.resolve(x, pkg.main)); - if (m) return m; - } - } - - return loadAsFileSync(x + '/index'); - } - - function loadNodeModulesSync (x, start) { - var dirs = nodeModulesPathsSync(start); - for (var i = 0; i < dirs.length; i++) { - var dir = dirs[i]; - var m = loadAsFileSync(dir + '/' + x); - if (m) return m; - var n = loadAsDirectorySync(dir + '/' + x); - if (n) return n; - } - - var m = loadAsFileSync(x); - if (m) return m; - } - - function nodeModulesPathsSync (start) { - var parts; - if (start === '/') parts = [ '' ]; - else parts = path.normalize(start).split('/'); - - var dirs = []; - for (var i = parts.length - 1; i >= 0; i--) { - if (parts[i] === 'node_modules') continue; - var dir = parts.slice(0, i + 1).join('/') + '/node_modules'; - dirs.push(dir); - } - - return dirs; - } - }; -})(); - -require.alias = function (from, to) { - var path = require.modules.path(); - var res = null; - try { - res = require.resolve(from + '/package.json', '/'); - } - catch (err) { - res = require.resolve(from, '/'); - } - var basedir = path.dirname(res); - - var keys = (Object.keys || function (obj) { - var res = []; - for (var key in obj) res.push(key) - return res; - })(require.modules); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (key.slice(0, basedir.length + 1) === basedir + '/') { - var f = key.slice(basedir.length); - require.modules[to + f] = require.modules[basedir + f]; - } - else if (key === basedir) { - require.modules[to] = require.modules[basedir]; - } - } -}; - -require.define = function (filename, fn) { - var dirname = require._core[filename] - ? '' - : require.modules.path().dirname(filename) - ; - - var require_ = function (file) { - return require(file, dirname) - }; - require_.resolve = function (name) { - return require.resolve(name, dirname); - }; - require_.modules = require.modules; - require_.define = require.define; - var module_ = { exports : {} }; - - require.modules[filename] = function () { - require.modules[filename]._cached = module_.exports; - fn.call( - module_.exports, - require_, - module_, - module_.exports, - dirname, - filename - ); - require.modules[filename]._cached = module_.exports; - return module_.exports; - }; -}; - -if (typeof process === 'undefined') process = {}; - -if (!process.nextTick) process.nextTick = (function () { - var queue = []; - var canPost = typeof window !== 'undefined' - && window.postMessage && window.addEventListener - ; - - if (canPost) { - window.addEventListener('message', function (ev) { - if (ev.source === window && ev.data === 'browserify-tick') { - ev.stopPropagation(); - if (queue.length > 0) { - var fn = queue.shift(); - fn(); - } - } - }, true); - } - - return function (fn) { - if (canPost) { - queue.push(fn); - window.postMessage('browserify-tick', '*'); - } - else setTimeout(fn, 0); - }; -})(); - -if (!process.title) process.title = 'browser'; - -if (!process.binding) process.binding = function (name) { - if (name === 'evals') return require('vm') - else throw new Error('No such module') -}; - -if (!process.cwd) process.cwd = function () { return '.' }; - -if (!process.env) process.env = {}; -if (!process.argv) process.argv = []; - -require.define("path", function (require, module, exports, __dirname, __filename) { -function filter (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - if (fn(xs[i], i, xs)) res.push(xs[i]); - } - return res; -} - -// 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; 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; -} - -// Regex to split a filename into [*, dir, basename, ext] -// posix version -var splitPathRe = /^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/; - -// path.resolve([from ...], to) -// posix version -exports.resolve = function() { -var resolvedPath = '', - resolvedAbsolute = false; - -for (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) { - var path = (i >= 0) - ? arguments[i] - : process.cwd(); - - // Skip empty and invalid entries - if (typeof path !== 'string' || !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 = path.charAt(0) === '/', - trailingSlash = path.slice(-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.join = function() { - var paths = Array.prototype.slice.call(arguments, 0); - return exports.normalize(filter(paths, function(p, index) { - return p && typeof p === 'string'; - }).join('/')); -}; - - -exports.dirname = function(path) { - var dir = splitPathRe.exec(path)[1] || ''; - var isWindows = false; - if (!dir) { - // No dirname - return '.'; - } else if (dir.length === 1 || - (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) { - // It is just a slash or a drive letter with a slash - return dir; - } else { - // It is a full dirname, strip trailing slash - return dir.substring(0, dir.length - 1); - } -}; - - -exports.basename = function(path, ext) { - var f = splitPathRe.exec(path)[2] || ''; - // TODO: make this comparison case-insensitive on windows? - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; -}; - - -exports.extname = function(path) { - return splitPathRe.exec(path)[3] || ''; -}; - -}); - -require.define("crypto", function (require, module, exports, __dirname, __filename) { -module.exports = require("crypto-browserify") -}); - -require.define("/node_modules/crypto-browserify/package.json", function (require, module, exports, __dirname, __filename) { -module.exports = {} -}); - -require.define("/node_modules/crypto-browserify/index.js", function (require, module, exports, __dirname, __filename) { -var sha = require('./sha') - -var algorithms = { - sha1: { - hex: sha.hex_sha1, - binary: sha.b64_sha1, - ascii: sha.str_sha1 - } -} - -function error () { - var m = [].slice.call(arguments).join(' ') - throw new Error([ - m, - 'we accept pull requests', - 'http://github.com/dominictarr/crypto-browserify' - ].join('\n')) -} - -exports.createHash = function (alg) { - alg = alg || 'sha1' - if(!algorithms[alg]) - error('algorithm:', alg, 'is not yet supported') - var s = '' - _alg = algorithms[alg] - return { - update: function (data) { - s += data - return this - }, - digest: function (enc) { - enc = enc || 'binary' - var fn - if(!(fn = _alg[enc])) - error('encoding:', enc , 'is not yet supported for algorithm', alg) - var r = fn(s) - s = null //not meant to use the hash after you've called digest. - return r - } - } -} -// the least I can do is make error messages for the rest of the node.js/crypto api. -;['createCredentials' -, 'createHmac' -, 'createCypher' -, 'createCypheriv' -, 'createDecipher' -, 'createDecipheriv' -, 'createSign' -, 'createVerify' -, 'createDeffieHellman', -, 'pbkdf2', -, 'randomBytes' ].forEach(function (name) { - exports[name] = function () { - error('sorry,', name, 'is not implemented yet') - } -}) - -}); - -require.define("/node_modules/crypto-browserify/sha.js", function (require, module, exports, __dirname, __filename) { -/* - * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined - * in FIPS PUB 180-1 - * Version 2.1a Copyright Paul Johnston 2000 - 2002. - * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet - * Distributed under the BSD License - * See http://pajhome.org.uk/crypt/md5 for details. - */ - -exports.hex_sha1 = hex_sha1; -exports.b64_sha1 = b64_sha1; -exports.str_sha1 = str_sha1; -exports.hex_hmac_sha1 = hex_hmac_sha1; -exports.b64_hmac_sha1 = b64_hmac_sha1; -exports.str_hmac_sha1 = str_hmac_sha1; - -/* - * Configurable variables. You may need to tweak these to be compatible with - * the server-side, but the defaults work in most cases. - */ -var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */ -var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */ -var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */ - -/* - * These are the functions you'll usually want to call - * They take string arguments and return either hex or base-64 encoded strings - */ -function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));} -function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));} -function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));} -function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));} -function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));} -function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));} - -/* - * Perform a simple self-test to see if the VM is working - */ -function sha1_vm_test() -{ - return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d"; -} - -/* - * Calculate the SHA-1 of an array of big-endian words, and a bit length - */ -function core_sha1(x, len) -{ - /* append padding */ - x[len >> 5] |= 0x80 << (24 - len % 32); - x[((len + 64 >> 9) << 4) + 15] = len; - - var w = Array(80); - var a = 1732584193; - var b = -271733879; - var c = -1732584194; - var d = 271733878; - var e = -1009589776; - - for(var i = 0; i < x.length; i += 16) - { - var olda = a; - var oldb = b; - var oldc = c; - var oldd = d; - var olde = e; - - for(var j = 0; j < 80; j++) - { - if(j < 16) w[j] = x[i + j]; - else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1); - var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)), - safe_add(safe_add(e, w[j]), sha1_kt(j))); - e = d; - d = c; - c = rol(b, 30); - b = a; - a = t; - } - - a = safe_add(a, olda); - b = safe_add(b, oldb); - c = safe_add(c, oldc); - d = safe_add(d, oldd); - e = safe_add(e, olde); - } - return Array(a, b, c, d, e); - -} - -/* - * Perform the appropriate triplet combination function for the current - * iteration - */ -function sha1_ft(t, b, c, d) -{ - if(t < 20) return (b & c) | ((~b) & d); - if(t < 40) return b ^ c ^ d; - if(t < 60) return (b & c) | (b & d) | (c & d); - return b ^ c ^ d; -} - -/* - * Determine the appropriate additive constant for the current iteration - */ -function sha1_kt(t) -{ - return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 : - (t < 60) ? -1894007588 : -899497514; -} - -/* - * Calculate the HMAC-SHA1 of a key and some data - */ -function core_hmac_sha1(key, data) -{ - var bkey = str2binb(key); - if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz); - - var ipad = Array(16), opad = Array(16); - for(var i = 0; i < 16; i++) - { - ipad[i] = bkey[i] ^ 0x36363636; - opad[i] = bkey[i] ^ 0x5C5C5C5C; - } - - var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz); - return core_sha1(opad.concat(hash), 512 + 160); -} - -/* - * Add integers, wrapping at 2^32. This uses 16-bit operations internally - * to work around bugs in some JS interpreters. - */ -function safe_add(x, y) -{ - var lsw = (x & 0xFFFF) + (y & 0xFFFF); - var msw = (x >> 16) + (y >> 16) + (lsw >> 16); - return (msw << 16) | (lsw & 0xFFFF); -} - -/* - * Bitwise rotate a 32-bit number to the left. - */ -function rol(num, cnt) -{ - return (num << cnt) | (num >>> (32 - cnt)); -} - -/* - * Convert an 8-bit or 16-bit string to an array of big-endian words - * In 8-bit function, characters >255 have their hi-byte silently ignored. - */ -function str2binb(str) -{ - var bin = Array(); - var mask = (1 << chrsz) - 1; - for(var i = 0; i < str.length * chrsz; i += chrsz) - bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i%32); - return bin; -} - -/* - * Convert an array of big-endian words to a string - */ -function binb2str(bin) -{ - var str = ""; - var mask = (1 << chrsz) - 1; - for(var i = 0; i < bin.length * 32; i += chrsz) - str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask); - return str; -} - -/* - * Convert an array of big-endian words to a hex string. - */ -function binb2hex(binarray) -{ - var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; - var str = ""; - for(var i = 0; i < binarray.length * 4; i++) - { - str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) + - hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF); - } - return str; -} - -/* - * Convert an array of big-endian words to a base-64 string - */ -function binb2b64(binarray) -{ - var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - var str = ""; - for(var i = 0; i < binarray.length * 4; i += 3) - { - var triplet = (((binarray[i >> 2] >> 8 * (3 - i %4)) & 0xFF) << 16) - | (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 ) - | ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF); - for(var j = 0; j < 4; j++) - { - if(i * 8 + j * 6 > binarray.length * 32) str += b64pad; - else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F); - } - } - return str; -} - - -}); - -require.define("/test.js", function (require, module, exports, __dirname, __filename) { - var crypto = require('crypto') -var abc = crypto.createHash('sha1').update('abc').digest('hex') -console.log(abc) -//require('hello').inlineCall().call2() - -}); -require("/test.js"); diff --git a/node_modules/crypto-browserify/example/index.html b/node_modules/crypto-browserify/example/index.html deleted file mode 100644 index 9d55c6d73..000000000 --- a/node_modules/crypto-browserify/example/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - -
    -  require('crypto').createHash('sha1').update('abc').digest('hex') == ''
    -  
    - - - diff --git a/node_modules/crypto-browserify/example/test.js b/node_modules/crypto-browserify/example/test.js deleted file mode 100644 index 0b76c0153..000000000 --- a/node_modules/crypto-browserify/example/test.js +++ /dev/null @@ -1,4 +0,0 @@ -var crypto = require('crypto') -var abc = crypto.createHash('sha1').update('abc').digest('hex') -console.log(abc) -// require('hello').inlineCall().call2() diff --git a/node_modules/crypto-browserify/index.js b/node_modules/crypto-browserify/index.js deleted file mode 100644 index b6d4d24e1..000000000 --- a/node_modules/crypto-browserify/index.js +++ /dev/null @@ -1,97 +0,0 @@ -'use strict' - -exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = require('randombytes') -exports.createHash = exports.Hash = require('create-hash') -exports.createHmac = exports.Hmac = require('create-hmac') - -var algos = require('browserify-sign/algos') -var algoKeys = Object.keys(algos) -var hashes = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160'].concat(algoKeys) -exports.getHashes = function () { - return hashes -} - -var p = require('pbkdf2') -exports.pbkdf2 = p.pbkdf2 -exports.pbkdf2Sync = p.pbkdf2Sync - -var aes = require('browserify-cipher') - -exports.Cipher = aes.Cipher -exports.createCipher = aes.createCipher -exports.Cipheriv = aes.Cipheriv -exports.createCipheriv = aes.createCipheriv -exports.Decipher = aes.Decipher -exports.createDecipher = aes.createDecipher -exports.Decipheriv = aes.Decipheriv -exports.createDecipheriv = aes.createDecipheriv -exports.getCiphers = aes.getCiphers -exports.listCiphers = aes.listCiphers - -var dh = require('diffie-hellman') - -exports.DiffieHellmanGroup = dh.DiffieHellmanGroup -exports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup -exports.getDiffieHellman = dh.getDiffieHellman -exports.createDiffieHellman = dh.createDiffieHellman -exports.DiffieHellman = dh.DiffieHellman - -var sign = require('browserify-sign') - -exports.createSign = sign.createSign -exports.Sign = sign.Sign -exports.createVerify = sign.createVerify -exports.Verify = sign.Verify - -exports.createECDH = require('create-ecdh') - -var publicEncrypt = require('public-encrypt') - -exports.publicEncrypt = publicEncrypt.publicEncrypt -exports.privateEncrypt = publicEncrypt.privateEncrypt -exports.publicDecrypt = publicEncrypt.publicDecrypt -exports.privateDecrypt = publicEncrypt.privateDecrypt - -// the least I can do is make error messages for the rest of the node.js/crypto api. -// ;[ -// 'createCredentials' -// ].forEach(function (name) { -// exports[name] = function () { -// throw new Error([ -// 'sorry, ' + name + ' is not implemented yet', -// 'we accept pull requests', -// 'https://github.com/crypto-browserify/crypto-browserify' -// ].join('\n')) -// } -// }) - -var rf = require('randomfill') - -exports.randomFill = rf.randomFill -exports.randomFillSync = rf.randomFillSync - -exports.createCredentials = function () { - throw new Error([ - 'sorry, createCredentials is not implemented yet', - 'we accept pull requests', - 'https://github.com/crypto-browserify/crypto-browserify' - ].join('\n')) -} - -exports.constants = { - 'DH_CHECK_P_NOT_SAFE_PRIME': 2, - 'DH_CHECK_P_NOT_PRIME': 1, - 'DH_UNABLE_TO_CHECK_GENERATOR': 4, - 'DH_NOT_SUITABLE_GENERATOR': 8, - 'NPN_ENABLED': 1, - 'ALPN_ENABLED': 1, - 'RSA_PKCS1_PADDING': 1, - 'RSA_SSLV23_PADDING': 2, - 'RSA_NO_PADDING': 3, - 'RSA_PKCS1_OAEP_PADDING': 4, - 'RSA_X931_PADDING': 5, - 'RSA_PKCS1_PSS_PADDING': 6, - 'POINT_CONVERSION_COMPRESSED': 2, - 'POINT_CONVERSION_UNCOMPRESSED': 4, - 'POINT_CONVERSION_HYBRID': 6 -} diff --git a/node_modules/crypto-browserify/package.json b/node_modules/crypto-browserify/package.json deleted file mode 100644 index 98b6eb346..000000000 --- a/node_modules/crypto-browserify/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_from": "crypto-browserify@^3.0.0", - "_id": "crypto-browserify@3.12.0", - "_inBundle": false, - "_integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "_location": "/crypto-browserify", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "crypto-browserify@^3.0.0", - "name": "crypto-browserify", - "escapedName": "crypto-browserify", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/browserify" - ], - "_resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "_shasum": "396cf9f3137f03e4b8e532c58f698254e00f80ec", - "_spec": "crypto-browserify@^3.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "Dominic Tarr", - "email": "dominic.tarr@gmail.com", - "url": "dominictarr.com" - }, - "browser": { - "crypto": false - }, - "bugs": { - "url": "https://github.com/crypto-browserify/crypto-browserify/issues" - }, - "bundleDependencies": false, - "dependencies": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - }, - "deprecated": false, - "description": "implementation of crypto for the browser", - "devDependencies": { - "hash-test-vectors": "~1.3.2", - "pseudorandombytes": "^2.0.0", - "safe-buffer": "^5.1.1", - "standard": "^5.0.2", - "tape": "~2.3.2", - "zuul": "^3.6.0" - }, - "engines": { - "node": "*" - }, - "homepage": "https://github.com/crypto-browserify/crypto-browserify", - "license": "MIT", - "name": "crypto-browserify", - "optionalDependencies": {}, - "repository": { - "type": "git", - "url": "git://github.com/crypto-browserify/crypto-browserify.git" - }, - "scripts": { - "browser": "zuul --browser-version $BROWSER_VERSION --browser-name $BROWSER_NAME -- test/index.js", - "standard": "standard", - "test": "npm run standard && npm run unit", - "unit": "node test/" - }, - "version": "3.12.0" -} diff --git a/node_modules/crypto-browserify/test/aes.js b/node_modules/crypto-browserify/test/aes.js deleted file mode 100644 index 916a0192d..000000000 --- a/node_modules/crypto-browserify/test/aes.js +++ /dev/null @@ -1,49 +0,0 @@ -var test = require('tape') -var crypto = require('browserify-cipher/browser') -var randomBytes = require('pseudorandombytes') - -function runIt (i) { - crypto.listCiphers().forEach(function (cipher) { - test('run: ' + i, function (t) { - t.test('ciphers: ' + cipher, function (t) { - t.plan(1) - var data = randomBytes(562) - var password = randomBytes(20) - var crypter = crypto.createCipher(cipher, password) - var decrypter = crypto.createDecipher(cipher, password) - var out = [] - out.push(decrypter.update(crypter.update(data))) - out.push(decrypter.update(crypter.final())) - if (cipher.indexOf('gcm') > -1) { - decrypter.setAuthTag(crypter.getAuthTag()) - } - out.push(decrypter.final()) - t.equals(data.toString('hex'), Buffer.concat(out).toString('hex')) - }) - }) - }) - if (i < 4) { - setTimeout(runIt, 0, i + 1) - } -} -runIt(1) -test('getCiphers', function (t) { - t.plan(1) - t.ok(crypto.getCiphers().length, 'get ciphers returns an array') -}) - -test('through crypto browserify works', function (t) { - t.plan(2) - var crypto = require('../') - var cipher = 'aes-128-ctr' - var data = randomBytes(562) - var password = randomBytes(20) - var crypter = crypto.createCipher(cipher, password) - var decrypter = crypto.createDecipher(cipher, password) - var out = [] - out.push(decrypter.update(crypter.update(data))) - out.push(decrypter.update(crypter.final())) - out.push(decrypter.final()) - t.equals(data.toString('hex'), Buffer.concat(out).toString('hex')) - t.ok(crypto.getCiphers().length, 'get ciphers returns an array') -}) diff --git a/node_modules/crypto-browserify/test/create-hash.js b/node_modules/crypto-browserify/test/create-hash.js deleted file mode 100644 index 33532fd7a..000000000 --- a/node_modules/crypto-browserify/test/create-hash.js +++ /dev/null @@ -1,50 +0,0 @@ -var test = require('tape') - -var algorithms = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160'] -var encodings = ['hex', 'base64'] // FIXME: test binary -var vectors = require('hash-test-vectors') - -testLib('createHash in crypto-browserify', require('../').createHash) -testLib('create-hash/browser', require('create-hash/browser')) - -function testLib (name, createHash) { - algorithms.forEach(function (algorithm) { - runTest(name, createHash, algorithm) - }) -} -function runTest (name, createHash, algorithm) { - test(name + ' test ' + algorithm + ' against test vectors', function (t) { - run(0) - function run (i) { - if (i >= vectors.length) { - return t.end() - } - var obj = vectors[i] - - var input = new Buffer(obj.input, 'base64') - var node = obj[algorithm] - var js = createHash(algorithm).update(input).digest('hex') - if (js !== node) { - t.equal(js, node, algorithm + '(testVector[' + i + ']) == ' + node) - } - - encodings.forEach(function (encoding) { - var input = new Buffer(obj.input, 'base64').toString(encoding) - var node = obj[algorithm] - var js = createHash(algorithm).update(input, encoding).digest('hex') - if (js !== node) { - t.equal(js, node, algorithm + '(testVector[' + i + '], ' + encoding + ') == ' + node) - } - }) - input = new Buffer(obj.input, 'base64') - node = obj[algorithm] - var hash = createHash(algorithm) - hash.end(input) - js = hash.read().toString('hex') - if (js !== node) { - t.equal(js, node, algorithm + '(testVector[' + i + ']) == ' + node) - } - setTimeout(run, 0, i + 1) - } - }) -} diff --git a/node_modules/crypto-browserify/test/create-hmac.js b/node_modules/crypto-browserify/test/create-hmac.js deleted file mode 100644 index 08488ab73..000000000 --- a/node_modules/crypto-browserify/test/create-hmac.js +++ /dev/null @@ -1,50 +0,0 @@ -var test = require('tape') - -var algorithms = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160'] -var vectors = require('hash-test-vectors/hmac') -testLib('createHmac in crypto-browserify', require('../').createHmac) -testLib('create-hmac/browser', require('create-hmac/browser')) - -function testLib (name, createHmac) { - algorithms.forEach(function (alg) { - test(name + ' hmac(' + alg + ')', function (t) { - run(0) - function run (i) { - if (i >= vectors.length) { - return t.end() - } - var input = vectors[i] - var output = createHmac(alg, new Buffer(input.key, 'hex')) - .update(input.data, 'hex').digest() - - output = input.truncate ? output.slice(0, input.truncate) : output - output = output.toString('hex') - if (output !== input[alg]) { - t.equal(output, input[alg]) - } - setTimeout(run, 0, i + 1) - } - }) - - test('hmac(' + alg + ')', function (t) { - run(0) - function run (i) { - if (i >= vectors.length) { - return t.end() - } - var input = vectors[i] - var hmac = createHmac(alg, new Buffer(input.key, 'hex')) - - hmac.end(input.data, 'hex') - var output = hmac.read() - - output = input.truncate ? output.slice(0, input.truncate) : output - output = output.toString('hex') - if (output !== input[alg]) { - t.equal(output, input[alg]) - } - setTimeout(run, 0, i + 1) - } - }) - }) -} diff --git a/node_modules/crypto-browserify/test/dh.js b/node_modules/crypto-browserify/test/dh.js deleted file mode 100644 index 61fd07443..000000000 --- a/node_modules/crypto-browserify/test/dh.js +++ /dev/null @@ -1,49 +0,0 @@ -var test = require('tape') -var crypto = require('diffie-hellman/browser') - -test('diffie-hellman mod groups', function (t) { - [ - 'modp1', 'modp2', 'modp5', 'modp14', 'modp15', 'modp16' - ].forEach(function (mod) { - t.test(mod, function (t) { - t.plan(3) - var dh1 = crypto.getDiffieHellman(mod) - var p1 = dh1.getPrime().toString('hex') - dh1.generateKeys() - var dh2 = crypto.getDiffieHellman(mod) - var p2 = dh2.getPrime().toString('hex') - dh2.generateKeys() - t.equals(p1, p2, 'equal primes') - var pubk1 = dh1.getPublicKey() - var pubk2 = dh2.getPublicKey() - t.notEquals(pubk1, pubk2, 'diff public keys') - var pub1 = dh1.computeSecret(pubk2).toString('hex') - var pub2 = dh2.computeSecret(dh1.getPublicKey()).toString('hex') - t.equals(pub1, pub2, 'equal secrets') - }) - }) -}) - -test('diffie-hellman key lengths', function (t) { - [ - 64, 65, 192 - ].forEach(function (len) { - t.test('' + len, function (t) { - t.plan(3) - var dh2 = crypto.createDiffieHellman(len) - var prime2 = dh2.getPrime() - var p2 = prime2.toString('hex') - var dh1 = crypto.createDiffieHellman(prime2) - var p1 = dh1.getPrime().toString('hex') - dh1.generateKeys() - dh2.generateKeys() - t.equals(p1, p2, 'equal primes') - var pubk1 = dh1.getPublicKey() - var pubk2 = dh2.getPublicKey() - t.notEquals(pubk1, pubk2, 'diff public keys') - var pub1 = dh1.computeSecret(pubk2).toString('hex') - var pub2 = dh2.computeSecret(dh1.getPublicKey()).toString('hex') - t.equals(pub1, pub2, 'equal secrets') - }) - }) -}) diff --git a/node_modules/crypto-browserify/test/ecdh.js b/node_modules/crypto-browserify/test/ecdh.js deleted file mode 100644 index 86b5aed5d..000000000 --- a/node_modules/crypto-browserify/test/ecdh.js +++ /dev/null @@ -1,61 +0,0 @@ -var mods = [ - 'secp256k1', - 'secp224r1', - 'prime256v1', - 'prime192v1' -] -var test = require('tape') -var _crypto = require('../') -var createECDH1 = _crypto.createECDH -var createECDH2 = require('create-ecdh/browser') - -mods.forEach(function (mod) { - test('createECDH: ' + mod + ' uncompressed', function (t) { - t.plan(2) - var dh1 = createECDH1(mod) - dh1.generateKeys() - var dh2 = createECDH2(mod) - dh2.generateKeys() - var pubk1 = dh1.getPublicKey() - var pubk2 = dh2.getPublicKey() - t.notEquals(pubk1.toString('hex'), pubk2.toString('hex'), 'diff public keys') - var pub1 = dh1.computeSecret(pubk2).toString('hex') - var pub2 = dh2.computeSecret(pubk1).toString('hex') - t.equals(pub1, pub2, 'equal secrets') - }) - - test('createECDH: ' + mod + ' compressed', function (t) { - t.plan(2) - var dh1 = createECDH1(mod) - dh1.generateKeys() - var dh2 = createECDH2(mod) - dh2.generateKeys() - var pubk1 = dh1.getPublicKey(null, 'compressed') - var pubk2 = dh2.getPublicKey(null, 'compressed') - t.notEquals(pubk1.toString('hex'), pubk2.toString('hex'), 'diff public keys') - var pub1 = dh1.computeSecret(pubk2).toString('hex') - var pub2 = dh2.computeSecret(pubk1).toString('hex') - t.equals(pub1, pub2, 'equal secrets') - }) - - test('createECDH: ' + mod + ' set stuff', function (t) { - t.plan(5) - var dh1 = createECDH1(mod) - var dh2 = createECDH2(mod) - dh1.generateKeys() - dh2.generateKeys() - dh1.setPrivateKey(dh2.getPrivateKey()) - dh1.setPublicKey(dh2.getPublicKey()) - var priv1 = dh1.getPrivateKey('hex') - var priv2 = dh2.getPrivateKey('hex') - t.equals(priv1, priv2, 'same private key') - var pubk1 = dh1.getPublicKey() - var pubk2 = dh2.getPublicKey() - t.equals(pubk1.toString('hex'), pubk2.toString('hex'), 'same public keys, uncompressed') - t.equals(dh1.getPublicKey('hex', 'compressed'), dh2.getPublicKey('hex', 'compressed'), 'same public keys compressed') - t.equals(dh1.getPublicKey('hex', 'hybrid'), dh2.getPublicKey('hex', 'hybrid'), 'same public keys hybrid') - var pub1 = dh1.computeSecret(pubk2).toString('hex') - var pub2 = dh2.computeSecret(pubk1).toString('hex') - t.equals(pub1, pub2, 'equal secrets') - }) -}) diff --git a/node_modules/crypto-browserify/test/index.js b/node_modules/crypto-browserify/test/index.js deleted file mode 100644 index 2ac709446..000000000 --- a/node_modules/crypto-browserify/test/index.js +++ /dev/null @@ -1,19 +0,0 @@ - -require('./create-hash') -require('./create-hmac') -if (!process.browser) { - require('./dh') -} - -require('./pbkdf2') -try { - require('randombytes')(8) - require('./ecdh') - require('./public-encrypt') - require('./random-bytes') - require('./sign') - require('./random-fill') -} catch (e) { - console.log('no secure rng avaiable') -} -require('./aes') diff --git a/node_modules/crypto-browserify/test/node/dh.js b/node_modules/crypto-browserify/test/node/dh.js deleted file mode 100644 index 0b3aa710e..000000000 --- a/node_modules/crypto-browserify/test/node/dh.js +++ /dev/null @@ -1,51 +0,0 @@ -var test = require('tape') -var cryptoB = require('../../') -var crypto = require('crypto') - -test('diffie-hellman mod groups', function (t) { - [ - 'modp1', 'modp2', 'modp5', 'modp14', 'modp15', 'modp16' - ].forEach(function (mod) { - t.test(mod, function (t) { - t.plan(3) - var dh1 = cryptoB.getDiffieHellman(mod) - var p1 = dh1.getPrime().toString('hex') - dh1.generateKeys() - - var dh2 = crypto.getDiffieHellman(mod) - var p2 = dh2.getPrime().toString('hex') - dh2.generateKeys() - t.equals(p1, p2, 'equal primes') - var pubk1 = dh1.getPublicKey() - var pubk2 = dh2.getPublicKey() - t.notEquals(pubk1, pubk2, 'diff public keys') - var pub1 = dh1.computeSecret(pubk2).toString('hex') - var pub2 = dh2.computeSecret(pubk1).toString('hex') - t.equals(pub1, pub2, 'equal secrets') - }) - }) -}) - -test('diffie-hellman key lengths', function (t) { - [ - 64, 65, 192 - ].forEach(function (len) { - t.test('' + len, function (t) { - t.plan(3) - var dh2 = cryptoB.createDiffieHellman(len) - var prime2 = dh2.getPrime() - var p2 = prime2.toString('hex') - var dh1 = crypto.createDiffieHellman(prime2) - var p1 = dh1.getPrime().toString('hex') - dh1.generateKeys() - dh2.generateKeys() - t.equals(p1, p2, 'equal primes') - var pubk1 = dh1.getPublicKey() - var pubk2 = dh2.getPublicKey() - t.notEquals(pubk1, pubk2, 'diff public keys') - var pub1 = dh1.computeSecret(pubk2).toString('hex') - var pub2 = dh2.computeSecret(dh1.getPublicKey()).toString('hex') - t.equals(pub1, pub2, 'equal secrets') - }) - }) -}) diff --git a/node_modules/crypto-browserify/test/pbkdf2.js b/node_modules/crypto-browserify/test/pbkdf2.js deleted file mode 100644 index 084014eed..000000000 --- a/node_modules/crypto-browserify/test/pbkdf2.js +++ /dev/null @@ -1,21 +0,0 @@ -var tape = require('tape') -var crypto = require('pbkdf2/browser') - -var vectors = require('hash-test-vectors/pbkdf2') - -tape('pbkdf2', function (t) { - vectors.forEach(function (input) { - // skip inputs that will take way too long - if (input.iterations > 10000) return - - var key = crypto.pbkdf2Sync(input.password, input.salt, input.iterations, input.length) - - if (key.toString('hex') !== input.sha1) { - console.log(input) - } - - t.equal(key.toString('hex'), input.sha1) - }) - - t.end() -}) diff --git a/node_modules/crypto-browserify/test/public-encrypt.js b/node_modules/crypto-browserify/test/public-encrypt.js deleted file mode 100644 index edb435c98..000000000 --- a/node_modules/crypto-browserify/test/public-encrypt.js +++ /dev/null @@ -1,36 +0,0 @@ -var test = require('tape') -var crypto1 = require('../') -var rsa = { - 'private': '2d2d2d2d2d424547494e205253412050524956415445204b45592d2d2d2d2d0a4d4949456a77494241414b422f6779376d6a615767506546645659445a5752434139424e69763370506230657332372b464b593068737a4c614f7734374578430a744157704473483438545841667948425977424c67756179666b344c4749757078622b43474d62526f337845703043626659314a62793236543976476a5243310a666f484444554a4738347561526279487161663469367a74346756522b786c4145496a6b614641414b38634f6f58415431435671474c4c6c6a554363684c38500a6a61486a2f7972695a2f53377264776c49334c6e41427877776d4c726d522f7637315774706d4f2f614e47384e2b31706f2b5177616768546b79513539452f5a0a7641754f6b4657486f6b32712f523650594161326a645a397a696d3046714f502b6e6b5161454452624246426d4271547635664647666b32577341664b662f520a47302f5646642b5a654d353235315465547658483639356e6c53476175566c3941674d42414145436766344c725748592f6c35346f7554685a577676627275670a70667a36734a583267396c3779586d576c455773504543566f2f375355627059467074364f5a7939397a53672b494b624771574b6664686f4b725477495674430a4c30595a304e6c6d646e414e53497a30726f785147375a786b4c352b764853772f506d443978345577662b437a38684154436d4e42763171633630646b7975570a34434c71653732716154695657526f4f316961675167684e634c6f6f36765379363545784c614344545068613779753276773468465a705769456a57346478660a7246644c696978353242433836596c416c784d452f724c6738494a5676696c62796f39615764586d784f6155544c527636506b4644312f6756647738563951720a534c4e39466c4b326b6b6a695830647a6f6962765a7733744d6e74337979644178305838372b734d5256616843316270336b56507a3448793045575834514a2f0a504d33317647697549546b324e43643531445874314c746e324f503546614a536d4361456a6830586b5534716f7559796a585774384275364254436c327675610a466730556a6939432b496b504c6d61554d624d494f7761546b386357714c74685378734c6537304a354f6b477267664b554d2f772b4248483150742f506a7a6a0a432b2b6c306b6946614f5644566141563947704c504c43426f4b2f50433952622f72784d4d6f43434e774a2f4e5a756564496e793277334c4d69693737682f540a7a53766572674e47686a5936526e7661386c4c584a36646c726b6350417970733367577778716a344e5230542b474d3062445550564c62374d303758563753580a7637564a476d35324a625247774d3173732b72385854544e656d65476b2b5752784737546774734d715947584c66423851786b2f66352f4d63633030546c38750a7758464e7366784a786d7436416273547233673336774a2f49684f6e69627a3941642b6e63686c426e4e3351655733434b48717a61523138766f717674566d320a6b4a66484b31357072482f7353476d786d6945476772434a545a78744462614e434f372f56426a6e4b756455554968434177734c747571302f7a7562397641640a384731736366497076357161534e7a6d4b6f5838624f77417276725336775037794b726354737557496c484438724a5649374945446e516f5470354738664b310a68774a2f4d4968384d35763072356455594576366f494a5747636c65364148314a6d73503557496166677137325a32323838704863434648774e59384467394a0a3736517377564c6e556850546c6d6d33454f4f50474574616d32694144357230416679746c62346c624e6f51736a32737a65584f4e4458422b366f7565616a680a564e454c55723848635350356c677a525a6a4a57366146497a6a394c44526d516e55414f6a475358564f517445774a2f4d43515a374e2f763464494b654452410a3864385545785a332b674748756d7a697a7447524a30745172795a483250616b50354937562b316c377145556e4a3263336d462b65317634314570394c4376680a627a72504b773964786831386734622b37624d707357506e7372614b6836697078633761614f615a5630447867657a347a635a753050316f6c4f30634e334b4d0a6e784a305064733352386241684e43446453324a5a61527035513d3d0a2d2d2d2d2d454e44205253412050524956415445204b45592d2d2d2d2d0a', - 'public': '2d2d2d2d2d424547494e20525341205055424c4943204b45592d2d2d2d2d0a4d49494242674b422f6779376d6a615767506546645659445a5752434139424e69763370506230657332372b464b593068737a4c614f773437457843744157700a4473483438545841667948425977424c67756179666b344c4749757078622b43474d62526f337845703043626659314a62793236543976476a524331666f48440a44554a4738347561526279487161663469367a74346756522b786c4145496a6b614641414b38634f6f58415431435671474c4c6c6a554363684c38506a61486a0a2f7972695a2f53377264776c49334c6e41427877776d4c726d522f7637315774706d4f2f614e47384e2b31706f2b5177616768546b79513539452f5a7641754f0a6b4657486f6b32712f523650594161326a645a397a696d3046714f502b6e6b5161454452624246426d4271547635664647666b32577341664b662f5247302f560a46642b5a654d353235315465547658483639356e6c53476175566c3941674d424141453d0a2d2d2d2d2d454e4420525341205055424c4943204b45592d2d2d2d2d0a' -} -var crypto2 = require('public-encrypt/browser') -rsa.private = new Buffer(rsa.private, 'hex') -rsa.public = new Buffer(rsa.public, 'hex') -var encrypted = '0bcd6462ad7a563be2d42b0b73e0b0a163886304e7723b025f97605144fe1781e84acdc4031327d6bccd67fe13183e8fbdc8c5fe947b49d011ce3ebb08b11e83b87a77328ca57ee77cfdc78743b0749366643d7a21b2abcd4aa32dee9832938445540ee3007b7a70191c8dc9ff2ad76fe8dfaa5362d9d2c4b31a67b816d7b7970a293cb95bf3437a301bedb9f431b7075aa2f9df77b4385bea2a37982beda467260b384a58258b5eb4e36a0e0bf7dff83589636f5f97bf542084f0f76868c9f3f989a27fee5b8cd2bfee0bae1eae958df7c3184e5a40fda101196214f371606feca4330b221f30577804bbd4f61578a84e85dcd298849f509e630d275280' - -test('publicEncrypt/privateDecrypt', function (t) { - t.test('can decrypt', function (t) { - t.plan(2) - // note encryption is ranomized so can't test to see if they encrypt the same - t.equals(crypto1.privateDecrypt(rsa.private, new Buffer(encrypted, 'hex')).toString(), 'hello there I am a nice message', 'decrypt it properly') - t.equals(crypto2.privateDecrypt(rsa.private, new Buffer(encrypted, 'hex')).toString(), 'hello there I am a nice message', 'decrypt it properly') - }) - t.test('can round trip', function (t) { - t.plan(2) - var msg = 'this is a message' - // note encryption is ranomized so can't test to see if they encrypt the same - t.equals(crypto1.privateDecrypt(rsa.private, crypto2.publicEncrypt(rsa.public, new Buffer(msg))).toString(), msg, 'round trip it') - t.equals(crypto2.privateDecrypt(rsa.private, crypto1.publicEncrypt(rsa.public, new Buffer(msg))).toString(), msg, 'round trip it') - }) -}) - -test('privateEncrypt/publicDecrypt', function (t) { - t.test('can round trip', function (t) { - t.plan(2) - var msg = 'this is a message' - // note encryption is ranomized so can't test to see if they encrypt the same - t.equals(crypto1.publicDecrypt(rsa.public, crypto2.privateEncrypt(rsa.private, new Buffer(msg))).toString(), msg, 'round trip it') - t.equals(crypto2.publicDecrypt(rsa.public, crypto1.privateEncrypt(rsa.private, new Buffer(msg))).toString(), msg, 'round trip it') - }) -}) diff --git a/node_modules/crypto-browserify/test/random-bytes.js b/node_modules/crypto-browserify/test/random-bytes.js deleted file mode 100644 index 398af24a5..000000000 --- a/node_modules/crypto-browserify/test/random-bytes.js +++ /dev/null @@ -1,60 +0,0 @@ -var test = require('tape') -var crypto = require('../') - -var randomBytesFunctions = { - randomBytes: require('randombytes'), - pseudoRandomBytes: crypto.pseudoRandomBytes -} - -for (var randomBytesName in randomBytesFunctions) { - // Both randomBytes and pseudoRandomBytes should provide the same interface - var randomBytes = randomBytesFunctions[randomBytesName] - - test('get error message', function (t) { - try { - var b = randomBytes(10) - t.ok(Buffer.isBuffer(b)) - t.end() - } catch (err) { - t.ok(/not supported/.test(err.message), '"not supported" is in error message') - t.end() - } - }) - - test(randomBytesName, function (t) { - t.plan(5) - t.equal(randomBytes(10).length, 10) - t.ok(Buffer.isBuffer(randomBytes(10))) - randomBytes(10, function (ex, bytes) { - t.error(ex) - t.equal(bytes.length, 10) - t.ok(Buffer.isBuffer(bytes)) - t.end() - }) - }) - - test(randomBytesName + ' seem random', function (t) { - var L = 1000 - var b = randomBytes(L) - - var mean = [].reduce.call(b, function (a, b) { return a + b }, 0) / L - - // test that the random numbers are plausably random. - // Math.random() will pass this, but this will catch - // terrible mistakes such as this blunder: - // https://github.com/dominictarr/crypto-browserify/commit/3267955e1df7edd1680e52aeede9a89506ed2464#commitcomment-7916835 - - // this doesn't check that the bytes are in a random *order* - // but it's better than nothing. - - var expected = 256 / 2 - var smean = Math.sqrt(mean) - - // console.log doesn't work right on testling, *grumble grumble* - console.log(JSON.stringify([expected - smean, mean, expected + smean])) - t.ok(mean < expected + smean) - t.ok(mean > expected - smean) - - t.end() - }) -} diff --git a/node_modules/crypto-browserify/test/random-fill.js b/node_modules/crypto-browserify/test/random-fill.js deleted file mode 100644 index 63c885add..000000000 --- a/node_modules/crypto-browserify/test/random-fill.js +++ /dev/null @@ -1,53 +0,0 @@ -var test = require('tape') -var crypto = require('../') -var Buffer = require('safe-buffer').Buffer - -test('get error message', function (t) { - try { - var b = crypto.randomFillSync(Buffer.alloc(10)) - t.ok(Buffer.isBuffer(b)) - t.end() - } catch (err) { - t.ok(/not supported/.test(err.message), '"not supported" is in error message') - t.end() - } -}) - -test('randomfill', function (t) { - t.plan(5) - t.equal(crypto.randomFillSync(Buffer.alloc(10)).length, 10) - t.ok(Buffer.isBuffer(crypto.randomFillSync(Buffer.alloc(10)))) - crypto.randomFill(Buffer.alloc(10), function (ex, bytes) { - t.error(ex) - t.equal(bytes.length, 10) - t.ok(Buffer.isBuffer(bytes)) - t.end() - }) -}) - -test('seems random', function (t) { - var L = 1000 - var b = crypto.randomFillSync(Buffer.alloc(L)) - - var mean = [].reduce.call(b, function (a, b) { - return a + b - }, 0) / L - - // test that the random numbers are plausably random. - // Math.random() will pass this, but this will catch - // terrible mistakes such as this blunder: - // https://github.com/dominictarr/crypto-browserify/commit/3267955e1df7edd1680e52aeede9a89506ed2464#commitcomment-7916835 - - // this doesn't check that the bytes are in a random *order* - // but it's better than nothing. - - var expected = 256 / 2 - var smean = Math.sqrt(mean) - - // console.log doesn't work right on testling, *grumble grumble* - console.log(JSON.stringify([expected - smean, mean, expected + smean])) - t.ok(mean < expected + smean) - t.ok(mean > expected - smean) - - t.end() -}) diff --git a/node_modules/crypto-browserify/test/sign.js b/node_modules/crypto-browserify/test/sign.js deleted file mode 100644 index 7d67685c7..000000000 --- a/node_modules/crypto-browserify/test/sign.js +++ /dev/null @@ -1,59 +0,0 @@ -var test = require('tape') -var nodeCrypto = require('../') -var ourCrypto = require('browserify-sign/browser') - -var rsa = { - 'private': '2d2d2d2d2d424547494e205253412050524956415445204b45592d2d2d2d2d0a4d4949456a77494241414b422f6779376d6a615767506546645659445a5752434139424e69763370506230657332372b464b593068737a4c614f7734374578430a744157704473483438545841667948425977424c67756179666b344c4749757078622b43474d62526f337845703043626659314a62793236543976476a5243310a666f484444554a4738347561526279487161663469367a74346756522b786c4145496a6b614641414b38634f6f58415431435671474c4c6c6a554363684c38500a6a61486a2f7972695a2f53377264776c49334c6e41427877776d4c726d522f7637315774706d4f2f614e47384e2b31706f2b5177616768546b79513539452f5a0a7641754f6b4657486f6b32712f523650594161326a645a397a696d3046714f502b6e6b5161454452624246426d4271547635664647666b32577341664b662f520a47302f5646642b5a654d353235315465547658483639356e6c53476175566c3941674d42414145436766344c725748592f6c35346f7554685a577676627275670a70667a36734a583267396c3779586d576c455773504543566f2f375355627059467074364f5a7939397a53672b494b624771574b6664686f4b725477495674430a4c30595a304e6c6d646e414e53497a30726f785147375a786b4c352b764853772f506d443978345577662b437a38684154436d4e42763171633630646b7975570a34434c71653732716154695657526f4f316961675167684e634c6f6f36765379363545784c614344545068613779753276773468465a705769456a57346478660a7246644c696978353242433836596c416c784d452f724c6738494a5676696c62796f39615764586d784f6155544c527636506b4644312f6756647738563951720a534c4e39466c4b326b6b6a695830647a6f6962765a7733744d6e74337979644178305838372b734d5256616843316270336b56507a3448793045575834514a2f0a504d33317647697549546b324e43643531445874314c746e324f503546614a536d4361456a6830586b5534716f7559796a585774384275364254436c327675610a466730556a6939432b496b504c6d61554d624d494f7761546b386357714c74685378734c6537304a354f6b477267664b554d2f772b4248483150742f506a7a6a0a432b2b6c306b6946614f5644566141563947704c504c43426f4b2f50433952622f72784d4d6f43434e774a2f4e5a756564496e793277334c4d69693737682f540a7a53766572674e47686a5936526e7661386c4c584a36646c726b6350417970733367577778716a344e5230542b474d3062445550564c62374d303758563753580a7637564a476d35324a625247774d3173732b72385854544e656d65476b2b5752784737546774734d715947584c66423851786b2f66352f4d63633030546c38750a7758464e7366784a786d7436416273547233673336774a2f49684f6e69627a3941642b6e63686c426e4e3351655733434b48717a61523138766f717674566d320a6b4a66484b31357072482f7353476d786d6945476772434a545a78744462614e434f372f56426a6e4b756455554968434177734c747571302f7a7562397641640a384731736366497076357161534e7a6d4b6f5838624f77417276725336775037794b726354737557496c484438724a5649374945446e516f5470354738664b310a68774a2f4d4968384d35763072356455594576366f494a5747636c65364148314a6d73503557496166677137325a32323838704863434648774e59384467394a0a3736517377564c6e556850546c6d6d33454f4f50474574616d32694144357230416679746c62346c624e6f51736a32737a65584f4e4458422b366f7565616a680a564e454c55723848635350356c677a525a6a4a57366146497a6a394c44526d516e55414f6a475358564f517445774a2f4d43515a374e2f763464494b654452410a3864385545785a332b674748756d7a697a7447524a30745172795a483250616b50354937562b316c377145556e4a3263336d462b65317634314570394c4376680a627a72504b773964786831386734622b37624d707357506e7372614b6836697078633761614f615a5630447867657a347a635a753050316f6c4f30634e334b4d0a6e784a305064733352386241684e43446453324a5a61527035513d3d0a2d2d2d2d2d454e44205253412050524956415445204b45592d2d2d2d2d0a', - 'public': '2d2d2d2d2d424547494e20525341205055424c4943204b45592d2d2d2d2d0a4d49494242674b422f6779376d6a615767506546645659445a5752434139424e69763370506230657332372b464b593068737a4c614f773437457843744157700a4473483438545841667948425977424c67756179666b344c4749757078622b43474d62526f337845703043626659314a62793236543976476a524331666f48440a44554a4738347561526279487161663469367a74346756522b786c4145496a6b614641414b38634f6f58415431435671474c4c6c6a554363684c38506a61486a0a2f7972695a2f53377264776c49334c6e41427877776d4c726d522f7637315774706d4f2f614e47384e2b31706f2b5177616768546b79513539452f5a7641754f0a6b4657486f6b32712f523650594161326a645a397a696d3046714f502b6e6b5161454452624246426d4271547635664647666b32577341664b662f5247302f560a46642b5a654d353235315465547658483639356e6c53476175566c3941674d424141453d0a2d2d2d2d2d454e4420525341205055424c4943204b45592d2d2d2d2d0a' -} - -var ec = { - 'private': '2d2d2d2d2d424547494e2045432050524956415445204b45592d2d2d2d2d0a4d485143415145454944463658763853762f2f77475557442b6337383070704772553051645a5743417a78415150515838722f756f416347425375424241414b0a6f55514451674145495a656f7744796c6c73344b2f7766426a4f313862596f37674778386e595152696a6134652f71454d696b4f484a616937676565557265550a7235586b792f4178377332644774656773504e7350674765354d705176673d3d0a2d2d2d2d2d454e442045432050524956415445204b45592d2d2d2d2d0a', - 'public': '2d2d2d2d2d424547494e205055424c4943204b45592d2d2d2d2d0a4d465977454159484b6f5a497a6a3043415159464b34454541416f4451674145495a656f7744796c6c73344b2f7766426a4f313862596f37674778386e5951520a696a6134652f71454d696b4f484a616937676565557265557235586b792f4178377332644774656773504e7350674765354d705176673d3d0a2d2d2d2d2d454e44205055424c4943204b45592d2d2d2d2d0a' -} - -rsa.private = new Buffer(rsa.private, 'hex') -rsa.public = new Buffer(rsa.public, 'hex') -ec.private = new Buffer(ec.private, 'hex') -ec.public = new Buffer(ec.public, 'hex') - -function testit (keys, message, scheme) { - var pub = keys.public - var priv = keys.private - test(message.toString(), function (t) { - t.test('js sign and verify', function (t) { - t.plan(t) - var mySign = ourCrypto.createSign(scheme) - var mySig = mySign.update(message).sign(priv) - var myVer = ourCrypto.createVerify(scheme) - t.ok(myVer.update(message).verify(pub, mySig), 'validates') - }) - - t.test('node sign and verify', function (t) { - t.plan(t) - var mySign = nodeCrypto.createSign(scheme) - var mySig = mySign.update(message).sign(priv) - var myVer = nodeCrypto.createVerify(scheme) - t.ok(myVer.update(message).verify(pub, mySig), 'validates') - }) - - t.test('node sign and js verify', function (t) { - t.plan(t) - var mySign = nodeCrypto.createSign(scheme) - var mySig = mySign.update(message).sign(priv) - var myVer = ourCrypto.createVerify(scheme) - t.ok(myVer.update(message).verify(pub, mySig), 'validates') - }) - - t.test('js sign and node verify', function (t) { - t.plan(t) - var mySign = ourCrypto.createSign(scheme) - var mySig = mySign.update(message).sign(priv) - var myVer = nodeCrypto.createVerify(scheme) - t.ok(myVer.update(message).verify(pub, mySig), 'validates') - }) - }) -} - -testit(rsa, new Buffer('rsa with sha256'), 'RSA-SHA256') -testit(ec, new Buffer('ec with sha1'), 'ecdsa-with-SHA1') diff --git a/node_modules/csjs-inject/.npmignore b/node_modules/csjs-inject/.npmignore deleted file mode 100644 index 1ca957177..000000000 --- a/node_modules/csjs-inject/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log diff --git a/node_modules/csjs-inject/LICENSE b/node_modules/csjs-inject/LICENSE deleted file mode 100644 index fdbdf2b8b..000000000 --- a/node_modules/csjs-inject/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Ryan Tsao - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/node_modules/csjs-inject/README.md b/node_modules/csjs-inject/README.md deleted file mode 100644 index 0fbe39dc5..000000000 --- a/node_modules/csjs-inject/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# csjs-inject - -A [CSJS](https://github.com/rtsao/csjs) wrapper module that works exactly like CSJS, but adds auto-injection of styles into the DOM. Powered by [substack/insert-css](https://github.com/substack/insert-css). diff --git a/node_modules/csjs-inject/csjs.js b/node_modules/csjs-inject/csjs.js deleted file mode 100644 index a5390aa83..000000000 --- a/node_modules/csjs-inject/csjs.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -var csjs = require('csjs'); -var insertCss = require('insert-css'); - -function csjsInserter() { - var args = Array.prototype.slice.call(arguments); - var result = csjs.apply(null, args); - if (global.document) { - insertCss(csjs.getCss(result)); - } - return result; -} - -module.exports = csjsInserter; diff --git a/node_modules/csjs-inject/get-css.js b/node_modules/csjs-inject/get-css.js deleted file mode 100644 index 72b61bd0b..000000000 --- a/node_modules/csjs-inject/get-css.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('csjs/get-css'); diff --git a/node_modules/csjs-inject/index.js b/node_modules/csjs-inject/index.js deleted file mode 100644 index 3d40ba159..000000000 --- a/node_modules/csjs-inject/index.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -var csjs = require('./csjs'); - -module.exports = csjs; -module.exports.csjs = csjs; -module.exports.getCss = require('./get-css'); diff --git a/node_modules/csjs-inject/package.json b/node_modules/csjs-inject/package.json deleted file mode 100644 index b8cf4755f..000000000 --- a/node_modules/csjs-inject/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "_from": "csjs-inject", - "_id": "csjs-inject@1.0.1", - "_inBundle": false, - "_integrity": "sha1-3iIRPEC0bP4X09YqAMd8nX2nUnw=", - "_location": "/csjs-inject", - "_phantomChildren": {}, - "_requested": { - "type": "tag", - "registry": true, - "raw": "csjs-inject", - "name": "csjs-inject", - "escapedName": "csjs-inject", - "rawSpec": "", - "saveSpec": null, - "fetchSpec": "latest" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/csjs-inject/-/csjs-inject-1.0.1.tgz", - "_shasum": "de22113c40b46cfe17d3d62a00c77c9d7da7527c", - "_spec": "csjs-inject", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon", - "author": { - "name": "Ryan Tsao", - "email": "ryan.j.tsao@gmail.com" - }, - "bugs": { - "url": "https://github.com/rtsao/csjs-inject/issues" - }, - "bundleDependencies": false, - "dependencies": { - "csjs": "^1.0.0", - "insert-css": "^0.2.0" - }, - "deprecated": false, - "description": "CSJS with auto-injection of styles", - "engines": { - "node": ">=4.0.0" - }, - "homepage": "https://github.com/rtsao/csjs-inject", - "keywords": [ - "csjs" - ], - "license": "MIT", - "main": "index.js", - "name": "csjs-inject", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/rtsao/csjs-inject.git" - }, - "version": "1.0.1" -} diff --git a/node_modules/csjs/.istanbul.yml b/node_modules/csjs/.istanbul.yml deleted file mode 100644 index 66ba183e5..000000000 --- a/node_modules/csjs/.istanbul.yml +++ /dev/null @@ -1,4 +0,0 @@ -instrumentation: - excludes: - - 'lib/base62-encode.js' - - 'lib/hash-string.js' diff --git a/node_modules/csjs/.npmignore b/node_modules/csjs/.npmignore deleted file mode 100644 index df9af16ba..000000000 --- a/node_modules/csjs/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -coverage -node_modules -npm-debug.log diff --git a/node_modules/csjs/.travis.yml b/node_modules/csjs/.travis.yml deleted file mode 100644 index 8ab39c6f2..000000000 --- a/node_modules/csjs/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: -- '4' -script: if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then npm run travis-test && npm run travis-test-browser; else npm run travis-test; fi -env: - global: - - secure: API1krUNaYB5ixJXZoNBKyEmyMqzAvfu/YG6DrVK69ITDCvg2RDbWkv9xm17DTWhX4htczvY0YPs1MX6NNJLwLdTOl3aelGXrbdJt0pGmOYg0KnNuw3hexCwm0std35iT2YOlF7Y5AwVLM5x3tqoPMIuc5WG5MVQoQXJ8yI7YbS2nqA5t9RaO9juaTiQeYTdNhJWMXn0LsFzay42HTi60jf0OQPjZsKYSseLYjsm/J7DU5TkMGed9UDIj8e4qf8CajHEOEUMHX1ZtU6L4TvX4y5H/5Ut5ACg7Fkh1Ojgc2NTb2fAdDrnU3DhpVo/DMhoJ+PYRSBU6+OtJaLuJgdOlg7ekShxMoYz9Y2iDnjiA6gs9/LLgMox3e5SNi7zZkpx0Q+7CtpRD19M4pVsw4EUHLKxuCBFCjwOb9/xGRnf0ow0gLjENPQ2K3XAxpwUtGH9EHO3APOUwBnaLGsz7bjuyrI1igMya/Az/Gzfj+L28dehXWVMK+AwnKwEJw4wvaZpiM0dKfgBFUVzA6/ujmKcwaQ/VgbR2+F0JkBboXCKkHXRItRzDvl44iJETMgkOZNZbQYJXzplqEDgPQ1XJPeg5f34YCuy24ask/CAkOIiEpsN9PJOHyLcWfZ/pX1SZq/NyJcMWXGZUSE/2kwJblLk0FlPZI0TCHxZqz7ALJenZ6E= - - secure: PSwziCwGTcLNqgqWv8iduHD4aJdPg8YTlPSAnMgyj7Q9Xjc1ino3kW9dDhUyAOi7nNSVWHpmSUcG7oFH7zDfHBLkvxW8yZTJJMDgPuUp5G/mDM2RSQINzwSduLhQvazvRS9gp6Dq5DBun9MxSTf4U+n4ZAwS4laPoweoCuFMa9ljo2dOJj8kDsiveXJAcOYIYxknaMoBhcdOWAkF/DS6I0jUO0WLb/TAqdT+SduWbPnC5RUn049xU6i3skaAnmXvaP+sqA1zuRHHF2qaycOo5qAv17HIfFp+51HstnMpjtt68NZI74SWunXbefwzgaFBWOrr/+kkHYw9svXPT34HmmU7BqlykcR8zlqJY6oFqjcQKZBNCaVSTzJaGhNgt6qjzTaPj71/WVmKL8++LNBIftGF78xq5iwq5D+1/a/iiZb4pGEOGuI3oUnT9nfBpE6sluEsufJnymucgC6T0oO9eUUo1iPUJWWhmlKfZrwLotV+8rtJOdLA1ZLQ/HonxSxU/odha0D+9Vm/rj9bXpgtWXkT/meD6wwScRE8m5CrZ7l/HOuO24u2zzsrV+M5Vsf/lTjrWUI7EHD9uAWgvV+Kb/CX/FAQSqTIOnT+sa3bzmqs9vuWNHJD3Giiumf2C77d1sk5SHF16V4y87IpF62ga8dVmxiFjrdWKmaK4EGUDvI= diff --git a/node_modules/csjs/.zuul.yml b/node_modules/csjs/.zuul.yml deleted file mode 100644 index 383861d29..000000000 --- a/node_modules/csjs/.zuul.yml +++ /dev/null @@ -1,16 +0,0 @@ -ui: tape -browsers: - - name: chrome - version: latest - - name: firefox - version: latest - - name: safari - version: latest - - name: iphone - version: latest - - name: microsoftedge - version: latest -browserify: - - transform: bulkify - - transform: brfs - - transform: folderify diff --git a/node_modules/csjs/LICENSE b/node_modules/csjs/LICENSE deleted file mode 100644 index fdbdf2b8b..000000000 --- a/node_modules/csjs/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Ryan Tsao - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/node_modules/csjs/README.md b/node_modules/csjs/README.md deleted file mode 100644 index 4ae145a7b..000000000 --- a/node_modules/csjs/README.md +++ /dev/null @@ -1,245 +0,0 @@ -# [![CSJS logo](https://cdn.rawgit.com/rtsao/csjs/logo/logo.svg "CSJS (Cascading Style JavaScripts)")](https://github.com/rtsao/csjs) - -[![build status][build-badge]][build-href] -[![coverage status][coverage-badge]][coverage-href] -[![dependencies status][deps-badge]][deps-href] -[![npm version][npm-badge]][npm-href] - -> CSJS allows you to write modular, scoped CSS with valid JavaScript. - -## Features -* Extremely simple and lightweight - * Zero dependencies, [~2KB minified and gzipped][csjs-bundle] -* Leverages native ES6 and CSS features [(1)] rather than reinventing the wheel - * Seamless modular, scoped styles with explicit dependencies powered by CommonJS/ES6 modules - * Dead-simple variables/mixins using tagged ES6 template strings - * Style composition with optimal reuse via natural class composition mechanics already in CSS/HTML[(2)] -* Works tooling-free; no required transpilation/compilation/build steps [(3)] -* Framework-agnostic (No React dependency; works with Web Components, etc.) -* Fully supported native CSS media queries, pseudo-classes, keyframe animations, etc. -* Server-rendered/universal JavaScript support - -## Quick Example -([Live editable codepen.io demo](http://codepen.io/rtsao/pen/jWRJZj?editors=0010)) -```javascript -const csjs = require('csjs'); -const {div, h1} = require('react').DOM; - -const green = '#33aa22'; - -const styles = csjs` - - .panel { - border: 1px solid black; - background-color: ${green}; - } - - .title { - padding: 4px; - font-size: 15px; - } - -`; - -const html = require('react-dom/server').renderToStaticMarkup( - div({className: styles.panel}, [ - h1({className: styles.title}, 'Hello World!') - ]) -); -/* -
    -

    Hello World!

    -
    -*/ - -const css = csjs.getCss(styles); -/* -.panel_4Eda43 { - border: 1px solid black; - background-color: #33aa22; -} - -.title_4Eda43 { - padding: 4px; - font-size: 15px; -} -*/ -``` - -### Simple, tooling-free - -CSJS runs in ES6 environments without transpilation, compilation, or build steps (including Node 4+ and latest stable Chrome/Firefox/Safari/Edge). - -[![sauce labs test status][sauce-badge]][sauce-href] - -Of course, you can always transpile ES6 template strings using Babel, allowing you to use CSJS in any ES5 environment. - -### Framework-agnostic - -CSJS works with any framework, be it React, native Web Components, or something else. - -### Full power of JavaScript in your CSS - -* Real, full-fledged JavaScript -* Obviates the need for Sass/Less or other preprocessors - * Proper imports/require - * Real variables, functions, loops, etc. - * As extensible as JavaScript itself - -### Class Composition Syntax - -CSJS also features class composition that works like [CSS Modules]: - -([Live editable codepen.io demo](http://codepen.io/rtsao/pen/RrmpdX?editors=0010)) - -**common-styles.js** -```javascript -const csjs = require('csjs'); - -module.exports = csjs` - - .border { - border: 1px solid black; - } - - .italic { - font-family: serif; - font-style: italic; - } - -`; - -``` - -**quote-styles.js** -```javascript -const csjs = require('csjs'); - -const common = require('./common-styles'); - -module.exports = csjs` - - .blockQuote extends ${common.italic} { - background: #ccc; - padding: 8px; - border-radius: 4px; - } - - .pullQuote extends .blockQuote, ${common.border} { - background: #eee; - font-weight: bold; - } - -`; - -``` - -**app.js** -```javascript -const getCss = require('csjs/get-css'); -const commonStyles = require('./common-styles'); -const quoteStyles = require('./quote-styles'); - -quoteStyles.blockQuote; -// => "blockQuote_2bVd7K italic_3YGtO7" - -quoteStyles.pullQuote; -// => "pullQuote_2bVd7K blockQuote_2bVd7K italic_3YGtO7 border_3YGtO7" - -getCss(quoteStyles); -/* -.blockQuote_2bVd7K { - background: #ccc; - padding: 8px; - border-radius: 4px; -} - -.pullQuote_2bVd7K { - background: #eee; - font-weight: bold; -} -*/ - -getCss(commonStyles); -/* -.border_3YGtO7 { - border: 1px solid black; -} - -.italic_3YGtO7 { - font-family: serif; - font-style: italic; -} -*/ -``` - -### Optional tooling - -#### Extracted static CSS bundles - -[csjs-extractify](https://github.com/rtsao/csjs-extractify) is a browserify plugin that allows you to extract your application's CSJS into a static CSS file at build time. - -#### Automatic CSS injection - -[csjs-injectify](https://github.com/rtsao/csjs-injectify) is a browserify transform that automatically replaces `csjs` with [`csjs-inject`](https://github.com/rtsao/csjs-inject), which automatically injects your scoped CSS into the `` at runtime. It is recommended to use this rather than the [csjs-inject](https://github.com/rtsao/csjs-inject) module directly. - -#### PostCSS - -[babel-plugin-csjs-postcss](https://github.com/rtsao/babel-plugin-csjs-postcss) is a Babel plugin that allows you to run PostCSS on the CSS contained within CSJS template string literals at build time. Works with plugins such as [Autoprefixer]. - -#### Syntax highlighting -[neurosnap](https://github.com/neurosnap) has created an [Atom plugin for syntax highlighting](https://github.com/neurosnap/language-csjs) CSS within CSJS tagged template strings. - - -## FAQ - -##### Why the name CSJS? - -CSJS is 100% valid JavaScript, hence the name Cascading Style JavaScripts. - -##### Why not Sass? - -Sass doesn't provide any way to scope CSS, thus encapsulation of styles in components isn't possible with Sass alone. Additionally, because Sass was designed for use in a global CSS namespace, many of its features just don't make sense when styles are scoped and encapsulated in components. `@extend` in Sass is extremely problematic, whereas CSJS has a proper mechanism for class composition that actually works like it should. Furthermore, with CSJS, you have the ability to use real JavaScript in CSS, which is significantly more powerful and extensible than the language features included in Sass, so there's not really any reason to use Sass at all. - -##### Why not CSS Modules? - -CSJS was inspired by [CSS Modules] and they are virtually identical in concept. However, unlike CSS Modules which attempts to reproduce an ES6-style module system into CSS itself, CSJS simply uses native JS modules. CSJS also uses normal JS variables whereas CSS Modules invents its own CSS variable syntax. - -Consquently, CSJS is merely plain JavaScript and works without any extra tooling (CSS Modules is not valid CSS). Furthermore, because CSJS is essentially an amalgamation of plain JavaScript and plain CSS, there's no any new syntax or semantics to learn (besides the optional composition syntactic sugar, which closely mimicks ES6 classes). - -##### Why not Radium? - -Inline styles are cool, but there are limitations to using pure inline styles. For example, CSS pseudo-classes and media queries aren't possible with inline styles. This is the premise behind Radium, which works around this by re-implementing these CSS features using JavaScript. - -Whereas Radium is wholly dependent on React and involves performance trade-offs in its JavaScript implementations of CSS features, CSJS works regardless of framework (or lack thereof) and allows for the use of all CSS features natively (including media queries and pseudo-classes). - -## See Also -* https://github.com/rtsao/csjs-example-app -* https://github.com/rtsao/csjs-extractify -* https://github.com/rtsao/csjs-injectify -* https://github.com/rtsao/csjs-inject -* https://github.com/rtsao/babel-plugin-csjs-postcss -* https://github.com/rtsao/scope-styles - -## License -MIT - -[(1)]: #full-power-of-javascript-in-your-css -[(2)]: #class-composition-syntax -[(3)]: #simple-tooling-free - -[CSS Modules]: https://github.com/css-modules/css-modules -[Autoprefixer]: https://github.com/postcss/autoprefixer - -[csjs-bundle]: https://wzrd.in/bundle/csjs@latest - -[npm-badge]: https://badge.fury.io/js/csjs.svg -[npm-href]: https://www.npmjs.com/package/csjs -[build-badge]: https://travis-ci.org/rtsao/csjs.svg?branch=master -[build-href]: https://travis-ci.org/rtsao/csjs -[coverage-badge]: https://coveralls.io/repos/rtsao/csjs/badge.svg?branch=master&service=github -[coverage-href]: https://coveralls.io/github/rtsao/csjs?branch=master -[deps-badge]: https://img.shields.io/badge/dependencies-none-brightgreen.svg -[deps-href]: https://david-dm.org/rtsao/csjs -[sauce-badge]: https://saucelabs.com/browser-matrix/csjs.svg -[sauce-href]: https://saucelabs.com/u/csjs diff --git a/node_modules/csjs/csjs.js b/node_modules/csjs/csjs.js deleted file mode 100644 index 6cdda6a45..000000000 --- a/node_modules/csjs/csjs.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./lib/csjs'); diff --git a/node_modules/csjs/docs/automatic-vendor-prefixing.md b/node_modules/csjs/docs/automatic-vendor-prefixing.md deleted file mode 100644 index 65bace24d..000000000 --- a/node_modules/csjs/docs/automatic-vendor-prefixing.md +++ /dev/null @@ -1,10 +0,0 @@ -# Automatic Vendor Prefixing - -## Runtime solutions - -* http://leaverou.github.io/prefixfree/ - -## Buildtime solutions - -* https://github.com/rtsao/babel-plugin-csjs-postcss w/ https://github.com/postcss/autoprefixer -* https://github.com/rtsao/csjs-extractify w/ https://github.com/postcss/autoprefixer diff --git a/node_modules/csjs/docs/comments.md b/node_modules/csjs/docs/comments.md deleted file mode 100644 index 8d0651fa5..000000000 --- a/node_modules/csjs/docs/comments.md +++ /dev/null @@ -1,37 +0,0 @@ -# CSS Comments - -CSJS will ignore everything inside CSS `/* */` comments, but preserve it in the output CSS. Note that CSJS will break if there are unbalanced comments. - -([Live editable codepen.io demo](http://codepen.io/rtsao/pen/MKNaPR?editors=0010)) - -```javascript -const csjs = require('csjs'); -const {h1} = require('react').DOM; - -const styles = csjs` - - /* - @keyframes fadeIn { - from { opacity: 0; } - to { opacity: 1; } - } - */ - - /* .foo { color: red; } */ - - .pulse { - animation: 1s ease-in-out infinite fadeIn alternate; - } - -`; - -const html = require('react-dom/server').renderToStaticMarkup( - h1({className: styles.title}, 'Hello World!') -); -/* -

    Hello World!

    -*/ - -console.log(styles); -// => {pulse: "pulse_1uRFrA"} -``` diff --git a/node_modules/csjs/docs/keyframe-animations.md b/node_modules/csjs/docs/keyframe-animations.md deleted file mode 100644 index 76c1621df..000000000 --- a/node_modules/csjs/docs/keyframe-animations.md +++ /dev/null @@ -1,44 +0,0 @@ -# CSS3 Keyframe Animations - -## Scoped Animations - -CSJS scopes your keyframe animations just like class names. Note that they occupy the same namespace, so you can't export a keyframe animation with the same name as a class in the same template string literal. - -([Live editable codepen.io demo](http://codepen.io/rtsao/pen/KVOdWB?editors=0010)) - -```javascript -const csjs = require('csjs'); -const {h1} = require('react').DOM; - -const styles = csjs` - - @keyframes fadeIn { - from { opacity: 0; } - to { opacity: 1; } - } - - .pulse { - animation: 1s ease-in-out infinite fadeIn alternate; - } - -`; - -const html = require('react-dom/server').renderToStaticMarkup( - h1({className: styles.title}, 'Hello World!') -); -/* -

    Hello World!

    -*/ - -const css = csjs.getCss(styles); -/* -@keyframes fadeIn_1G6o1t { - from { opacity: 0; } - to { opacity: 1; } -} - -.pulse_1G6o1t { - animation: 1s ease-in-out infinite fadeIn_1G6o1t alternate; -} - */ -``` diff --git a/node_modules/csjs/get-css.js b/node_modules/csjs/get-css.js deleted file mode 100644 index 5ba4d4245..000000000 --- a/node_modules/csjs/get-css.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./lib/get-css'); diff --git a/node_modules/csjs/index.js b/node_modules/csjs/index.js deleted file mode 100644 index bb5fe546b..000000000 --- a/node_modules/csjs/index.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var csjs = require('./csjs'); - -module.exports = csjs(); -module.exports.csjs = csjs; -module.exports.noScope = csjs({ noscope: true }); -module.exports.getCss = require('./get-css'); diff --git a/node_modules/csjs/lib/base62-encode.js b/node_modules/csjs/lib/base62-encode.js deleted file mode 100644 index 1da894978..000000000 --- a/node_modules/csjs/lib/base62-encode.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -/** - * base62 encode implementation based on base62 module: - * https://github.com/andrew/base62.js - */ - -var CHARS = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; - -module.exports = function encode(integer) { - if (integer === 0) { - return '0'; - } - var str = ''; - while (integer > 0) { - str = CHARS[integer % 62] + str; - integer = Math.floor(integer / 62); - } - return str; -}; diff --git a/node_modules/csjs/lib/build-exports.js b/node_modules/csjs/lib/build-exports.js deleted file mode 100644 index 6914cd4a7..000000000 --- a/node_modules/csjs/lib/build-exports.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict'; - -var makeComposition = require('./composition').makeComposition; - -module.exports = function createExports(classes, keyframes, compositions) { - var keyframesObj = Object.keys(keyframes).reduce(function(acc, key) { - var val = keyframes[key]; - acc[val] = makeComposition([key], [val], true); - return acc; - }, {}); - - var exports = Object.keys(classes).reduce(function(acc, key) { - var val = classes[key]; - var composition = compositions[key]; - var extended = composition ? getClassChain(composition) : []; - var allClasses = [key].concat(extended); - var unscoped = allClasses.map(function(name) { - return classes[name] ? classes[name] : name; - }); - acc[val] = makeComposition(allClasses, unscoped); - return acc; - }, keyframesObj); - - return exports; -} - -function getClassChain(obj) { - var visited = {}, acc = []; - - function traverse(obj) { - return Object.keys(obj).forEach(function(key) { - if (!visited[key]) { - visited[key] = true; - acc.push(key); - traverse(obj[key]); - } - }); - } - - traverse(obj); - return acc; -} diff --git a/node_modules/csjs/lib/composition.js b/node_modules/csjs/lib/composition.js deleted file mode 100644 index be1397222..000000000 --- a/node_modules/csjs/lib/composition.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -module.exports = { - makeComposition: makeComposition, - isComposition: isComposition, - ignoreComposition: ignoreComposition -}; - -/** - * Returns an immutable composition object containing the given class names - * @param {array} classNames - The input array of class names - * @return {Composition} - An immutable object that holds multiple - * representations of the class composition - */ -function makeComposition(classNames, unscoped, isAnimation) { - var classString = classNames.join(' '); - return Object.create(Composition.prototype, { - classNames: { // the original array of class names - value: Object.freeze(classNames), - configurable: false, - writable: false, - enumerable: true - }, - unscoped: { // the original array of class names - value: Object.freeze(unscoped), - configurable: false, - writable: false, - enumerable: true - }, - className: { // space-separated class string for use in HTML - value: classString, - configurable: false, - writable: false, - enumerable: true - }, - selector: { // comma-separated, period-prefixed string for use in CSS - value: classNames.map(function(name) { - return isAnimation ? name : '.' + name; - }).join(', '), - configurable: false, - writable: false, - enumerable: true - }, - toString: { // toString() method, returns class string for use in HTML - value: function() { - return classString; - }, - configurable: false, - writeable: false, - enumerable: false - } - }); -} - -/** - * Returns whether the input value is a Composition - * @param value - value to check - * @return {boolean} - whether value is a Composition or not - */ -function isComposition(value) { - return value instanceof Composition; -} - -function ignoreComposition(values) { - return values.reduce(function(acc, val) { - if (isComposition(val)) { - val.classNames.forEach(function(name, i) { - acc[name] = val.unscoped[i]; - }); - } - return acc; - }, {}); -} - -/** - * Private constructor for use in `instanceof` checks - */ -function Composition() {} diff --git a/node_modules/csjs/lib/csjs.js b/node_modules/csjs/lib/csjs.js deleted file mode 100644 index 59d3b5dd9..000000000 --- a/node_modules/csjs/lib/csjs.js +++ /dev/null @@ -1,76 +0,0 @@ -'use strict'; - -var extractExtends = require('./css-extract-extends'); -var composition = require('./composition'); -var isComposition = composition.isComposition; -var ignoreComposition = composition.ignoreComposition; -var buildExports = require('./build-exports'); -var scopify = require('./scopeify'); -var cssKey = require('./css-key'); -var extractExports = require('./extract-exports'); - -module.exports = function csjsTemplate(opts) { - opts = (typeof opts === 'undefined') ? {} : opts; - var noscope = (typeof opts.noscope === 'undefined') ? false : opts.noscope; - - return function csjsHandler(strings, values) { - // Fast path to prevent arguments deopt - var values = Array(arguments.length - 1); - for (var i = 1; i < arguments.length; i++) { - values[i - 1] = arguments[i]; - } - var css = joiner(strings, values.map(selectorize)); - var ignores = ignoreComposition(values); - - var scope = noscope ? extractExports(css) : scopify(css, ignores); - var extracted = extractExtends(scope.css); - var localClasses = without(scope.classes, ignores); - var localKeyframes = without(scope.keyframes, ignores); - var compositions = extracted.compositions; - - var exports = buildExports(localClasses, localKeyframes, compositions); - - return Object.defineProperty(exports, cssKey, { - enumerable: false, - configurable: false, - writeable: false, - value: extracted.css - }); - } -} - -/** - * Replaces class compositions with comma seperated class selectors - * @param value - the potential class composition - * @return - the original value or the selectorized class composition - */ -function selectorize(value) { - return isComposition(value) ? value.selector : value; -} - -/** - * Joins template string literals and values - * @param {array} strings - array of strings - * @param {array} values - array of values - * @return {string} - strings and values joined - */ -function joiner(strings, values) { - return strings.map(function(str, i) { - return (i !== values.length) ? str + values[i] : str; - }).join(''); -} - -/** - * Returns first object without keys of second - * @param {object} obj - source object - * @param {object} unwanted - object with unwanted keys - * @return {object} - first object without unwanted keys - */ -function without(obj, unwanted) { - return Object.keys(obj).reduce(function(acc, key) { - if (!unwanted[key]) { - acc[key] = obj[key]; - } - return acc; - }, {}); -} diff --git a/node_modules/csjs/lib/css-extract-extends.js b/node_modules/csjs/lib/css-extract-extends.js deleted file mode 100644 index da10c9d9b..000000000 --- a/node_modules/csjs/lib/css-extract-extends.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -var makeComposition = require('./composition').makeComposition; - -var regex = /\.([^\s]+)(\s+)(extends\s+)(\.[^{]+)/g; - -module.exports = function extractExtends(css) { - var found, matches = []; - while (found = regex.exec(css)) { - matches.unshift(found); - } - - function extractCompositions(acc, match) { - var extendee = getClassName(match[1]); - var keyword = match[3]; - var extended = match[4]; - - // remove from output css - var index = match.index + match[1].length + match[2].length; - var len = keyword.length + extended.length; - acc.css = acc.css.slice(0, index) + " " + acc.css.slice(index + len + 1); - - var extendedClasses = splitter(extended); - - extendedClasses.forEach(function(className) { - if (!acc.compositions[extendee]) { - acc.compositions[extendee] = {}; - } - if (!acc.compositions[className]) { - acc.compositions[className] = {}; - } - acc.compositions[extendee][className] = acc.compositions[className]; - }); - return acc; - } - - return matches.reduce(extractCompositions, { - css: css, - compositions: {} - }); - -}; - -function splitter(match) { - return match.split(',').map(getClassName); -} - -function getClassName(str) { - var trimmed = str.trim(); - return trimmed[0] === '.' ? trimmed.substr(1) : trimmed; -} diff --git a/node_modules/csjs/lib/css-key.js b/node_modules/csjs/lib/css-key.js deleted file mode 100644 index 64722b083..000000000 --- a/node_modules/csjs/lib/css-key.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -/** - * CSS identifiers with whitespace are invalid - * Hence this key will not cause a collision - */ - -module.exports = ' css '; diff --git a/node_modules/csjs/lib/extract-exports.js b/node_modules/csjs/lib/extract-exports.js deleted file mode 100644 index b0de09657..000000000 --- a/node_modules/csjs/lib/extract-exports.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -var regex = require('./regex'); -var classRegex = regex.classRegex; -var keyframesRegex = regex.keyframesRegex; - -module.exports = extractExports; - -function extractExports(css) { - return { - css: css, - keyframes: getExport(css, keyframesRegex), - classes: getExport(css, classRegex) - }; -} - -function getExport(css, regex) { - var prop = {}; - var match; - while((match = regex.exec(css)) !== null) { - var name = match[2]; - prop[name] = name; - } - return prop; -} diff --git a/node_modules/csjs/lib/get-css.js b/node_modules/csjs/lib/get-css.js deleted file mode 100644 index 36ecbd79d..000000000 --- a/node_modules/csjs/lib/get-css.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -var cssKey = require('./css-key'); - -module.exports = function getCss(csjs) { - return csjs[cssKey]; -}; diff --git a/node_modules/csjs/lib/hash-string.js b/node_modules/csjs/lib/hash-string.js deleted file mode 100644 index 926a24109..000000000 --- a/node_modules/csjs/lib/hash-string.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -/** - * djb2 string hash implementation based on string-hash module: - * https://github.com/darkskyapp/string-hash - */ - -module.exports = function hashStr(str) { - var hash = 5381; - var i = str.length; - - while (i) { - hash = (hash * 33) ^ str.charCodeAt(--i) - } - return hash >>> 0; -}; diff --git a/node_modules/csjs/lib/regex.js b/node_modules/csjs/lib/regex.js deleted file mode 100644 index 21a730a47..000000000 --- a/node_modules/csjs/lib/regex.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -var findClasses = /(\.)(?!\d)([^\s\.,{\[>+~#:)]*)(?![^{]*})/.source; -var findKeyframes = /(@\S*keyframes\s*)([^{\s]*)/.source; -var ignoreComments = /(?!(?:[^*/]|\*[^/]|\/[^*])*\*+\/)/.source; - -var classRegex = new RegExp(findClasses + ignoreComments, 'g'); -var keyframesRegex = new RegExp(findKeyframes + ignoreComments, 'g'); - -module.exports = { - classRegex: classRegex, - keyframesRegex: keyframesRegex, - ignoreComments: ignoreComments, -}; diff --git a/node_modules/csjs/lib/replace-animations.js b/node_modules/csjs/lib/replace-animations.js deleted file mode 100644 index a090bad13..000000000 --- a/node_modules/csjs/lib/replace-animations.js +++ /dev/null @@ -1,29 +0,0 @@ -var ignoreComments = require('./regex').ignoreComments; - -module.exports = replaceAnimations; - -function replaceAnimations(result) { - var animations = Object.keys(result.keyframes).reduce(function(acc, key) { - acc[result.keyframes[key]] = key; - return acc; - }, {}); - var unscoped = Object.keys(animations); - - if (unscoped.length) { - var regexStr = '((?:animation|animation-name)\\s*:[^};]*)(' - + unscoped.join('|') + ')([;\\s])' + ignoreComments; - var regex = new RegExp(regexStr, 'g'); - - var replaced = result.css.replace(regex, function(match, preamble, name, ending) { - return preamble + animations[name] + ending; - }); - - return { - css: replaced, - keyframes: result.keyframes, - classes: result.classes - } - } - - return result; -} diff --git a/node_modules/csjs/lib/scoped-name.js b/node_modules/csjs/lib/scoped-name.js deleted file mode 100644 index 6da19eaae..000000000 --- a/node_modules/csjs/lib/scoped-name.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -var encode = require('./base62-encode'); -var hash = require('./hash-string'); - -module.exports = function fileScoper(fileSrc) { - var suffix = encode(hash(fileSrc)); - - return function scopedName(name) { - return name + '_' + suffix; - } -}; diff --git a/node_modules/csjs/lib/scopeify.js b/node_modules/csjs/lib/scopeify.js deleted file mode 100644 index 1ffaa0de6..000000000 --- a/node_modules/csjs/lib/scopeify.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -var fileScoper = require('./scoped-name'); -var replaceAnimations = require('./replace-animations'); -var regex = require('./regex'); -var classRegex = regex.classRegex; -var keyframesRegex = regex.keyframesRegex; - -module.exports = scopify; - -function scopify(css, ignores) { - var makeScopedName = fileScoper(css); - var replacers = { - classes: classRegex, - keyframes: keyframesRegex - }; - - function scopeCss(result, key) { - var replacer = replacers[key]; - function replaceFn(fullMatch, prefix, name) { - var scopedName = ignores[name] ? name : makeScopedName(name); - result[key][scopedName] = name; - return prefix + scopedName; - } - return { - css: result.css.replace(replacer, replaceFn), - keyframes: result.keyframes, - classes: result.classes - }; - } - - var result = Object.keys(replacers).reduce(scopeCss, { - css: css, - keyframes: {}, - classes: {} - }); - - return replaceAnimations(result); -} diff --git a/node_modules/csjs/package.json b/node_modules/csjs/package.json deleted file mode 100644 index 6718af614..000000000 --- a/node_modules/csjs/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "_from": "csjs@^1.0.0", - "_id": "csjs@1.1.0", - "_inBundle": false, - "_integrity": "sha1-G1dTxr2QLaJp3rNpIVWFpdjx84A=", - "_location": "/csjs", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "csjs@^1.0.0", - "name": "csjs", - "escapedName": "csjs", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/csjs-inject" - ], - "_resolved": "https://registry.npmjs.org/csjs/-/csjs-1.1.0.tgz", - "_shasum": "1b5753c6bd902da269deb369215585a5d8f1f380", - "_spec": "csjs@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/csjs-inject", - "author": { - "name": "Ryan Tsao", - "email": "ryan.j.tsao@gmail.com" - }, - "bugs": { - "url": "https://github.com/rtsao/csjs/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Cascading Style JavaScripts", - "devDependencies": { - "brfs": "^1.4.2", - "bulk-require": "^0.2.1", - "bulkify": "^1.1.1", - "coveralls": "^2.11.4", - "folderify": "https://github.com/rtsao/folderify/tarball/patch-1", - "include-folder": "^1.0.0", - "istanbul": "^0.4.0", - "tape": "^4.2.0", - "zuul": "^3.8.0" - }, - "engines": { - "node": ">=4.0.0" - }, - "homepage": "https://github.com/rtsao/csjs", - "keywords": [ - "csjs", - "css-modules", - "scoped-css", - "css-in-js", - "modular-css", - "css" - ], - "license": "MIT", - "main": "index.js", - "name": "csjs", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/rtsao/csjs.git" - }, - "scripts": { - "cover": "istanbul cover test/index.js", - "test": "node test/index.js", - "travis-test": "npm run cover && ((cat coverage/lcov.info | coveralls) || exit 0)", - "travis-test-browser": "zuul -- test/index.js" - }, - "version": "1.1.0" -} diff --git a/node_modules/csjs/test/animation-as-pseudo.expected.css b/node_modules/csjs/test/animation-as-pseudo.expected.css deleted file mode 100644 index f671bf2b6..000000000 --- a/node_modules/csjs/test/animation-as-pseudo.expected.css +++ /dev/null @@ -1,13 +0,0 @@ - - - @keyframes hover_zz7qS { - 0% { opacity: 0.0; } - 100% { opacity: 0.5; } - } - - @media (max-width: 480px) { - .animation_zz7qS:hover { - background: green; - } - } - diff --git a/node_modules/csjs/test/animation-as-pseudo.expected.json b/node_modules/csjs/test/animation-as-pseudo.expected.json deleted file mode 100644 index c68d208ba..000000000 --- a/node_modules/csjs/test/animation-as-pseudo.expected.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "animation": "animation_zz7qS", - "hover": "hover_zz7qS" -} diff --git a/node_modules/csjs/test/animation-as-pseudo.noscope.expected.css b/node_modules/csjs/test/animation-as-pseudo.noscope.expected.css deleted file mode 100644 index 3e7c1c408..000000000 --- a/node_modules/csjs/test/animation-as-pseudo.noscope.expected.css +++ /dev/null @@ -1,13 +0,0 @@ - - - @keyframes hover { - 0% { opacity: 0.0; } - 100% { opacity: 0.5; } - } - - @media (max-width: 480px) { - .animation:hover { - background: green; - } - } - diff --git a/node_modules/csjs/test/animation-as-pseudo.noscope.expected.json b/node_modules/csjs/test/animation-as-pseudo.noscope.expected.json deleted file mode 100644 index 3d2a63b3c..000000000 --- a/node_modules/csjs/test/animation-as-pseudo.noscope.expected.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "animation": "animation", - "hover": "hover" -} diff --git a/node_modules/csjs/test/animation-as-pseudo.noscope.source.js b/node_modules/csjs/test/animation-as-pseudo.noscope.source.js deleted file mode 100644 index be34b0497..000000000 --- a/node_modules/csjs/test/animation-as-pseudo.noscope.source.js +++ /dev/null @@ -1,16 +0,0 @@ -const csjs = require('../').noScope; - -module.exports = csjs` - - @keyframes hover { - 0% { opacity: 0.0; } - 100% { opacity: 0.5; } - } - - @media (max-width: 480px) { - .animation:hover { - background: green; - } - } - -`; diff --git a/node_modules/csjs/test/animation-as-pseudo.source.js b/node_modules/csjs/test/animation-as-pseudo.source.js deleted file mode 100644 index afe32eaab..000000000 --- a/node_modules/csjs/test/animation-as-pseudo.source.js +++ /dev/null @@ -1,16 +0,0 @@ -const csjs = require('../'); - -module.exports = csjs` - - @keyframes hover { - 0% { opacity: 0.0; } - 100% { opacity: 0.5; } - } - - @media (max-width: 480px) { - .animation:hover { - background: green; - } - } - -`; diff --git a/node_modules/csjs/test/basic.expected.css b/node_modules/csjs/test/basic.expected.css deleted file mode 100644 index 40285bbbc..000000000 --- a/node_modules/csjs/test/basic.expected.css +++ /dev/null @@ -1,6 +0,0 @@ - - - .foo_4xZqpC { - color: red; - } - diff --git a/node_modules/csjs/test/basic.expected.json b/node_modules/csjs/test/basic.expected.json deleted file mode 100644 index 9abd204d7..000000000 --- a/node_modules/csjs/test/basic.expected.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "foo": "foo_4xZqpC" -} diff --git a/node_modules/csjs/test/basic.noscope.expected.css b/node_modules/csjs/test/basic.noscope.expected.css deleted file mode 100644 index d3da2a55d..000000000 --- a/node_modules/csjs/test/basic.noscope.expected.css +++ /dev/null @@ -1,6 +0,0 @@ - - - .foo { - color: red; - } - diff --git a/node_modules/csjs/test/basic.noscope.expected.json b/node_modules/csjs/test/basic.noscope.expected.json deleted file mode 100644 index abdd5202b..000000000 --- a/node_modules/csjs/test/basic.noscope.expected.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "foo": "foo" -} diff --git a/node_modules/csjs/test/basic.noscope.source.js b/node_modules/csjs/test/basic.noscope.source.js deleted file mode 100644 index 217776b2b..000000000 --- a/node_modules/csjs/test/basic.noscope.source.js +++ /dev/null @@ -1,9 +0,0 @@ -const csjs = require('../').noScope; - -module.exports = csjs` - - .foo { - color: red; - } - -`; diff --git a/node_modules/csjs/test/basic.source.js b/node_modules/csjs/test/basic.source.js deleted file mode 100644 index ccc3ec2cd..000000000 --- a/node_modules/csjs/test/basic.source.js +++ /dev/null @@ -1,9 +0,0 @@ -const csjs = require('../'); - -module.exports = csjs` - - .foo { - color: red; - } - -`; diff --git a/node_modules/csjs/test/comments.expected.css b/node_modules/csjs/test/comments.expected.css deleted file mode 100644 index f23bfb4b3..000000000 --- a/node_modules/csjs/test/comments.expected.css +++ /dev/null @@ -1,38 +0,0 @@ - - /* Here's a comment */ - /*squishedcomment*/ - /********crazycomment********/ - /* A comment with a period at the end. */ - /* A comment with a period followed by numbers v1.2.3 */ - /* A comment with a .className */ - /* - * Here's a comment - * A comment with a period at the end. - * A comment with a period followed by numbers v1.2.3 - * A comment with a .className - */ - /* .inlineCss { color: red; } */ - /* - .commentedOutCss { - color: blue; - } - */ - .foo_1LMZVZ { - color: red; /* comment on a line */ - animation-name: wow_1LMZVZ; - } - - @keyframes wow_1LMZVZ {} - - /* - @keyframes bam {} - */ - - /* .woot { - animation-name: bam; - } */ - - /* .hmm { - animation-name: wow; - } */ - diff --git a/node_modules/csjs/test/comments.expected.json b/node_modules/csjs/test/comments.expected.json deleted file mode 100644 index 3f853cad7..000000000 --- a/node_modules/csjs/test/comments.expected.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "foo": "foo_1LMZVZ", - "wow": "wow_1LMZVZ" -} diff --git a/node_modules/csjs/test/comments.noscope.expected.css b/node_modules/csjs/test/comments.noscope.expected.css deleted file mode 100644 index 29a2a02fa..000000000 --- a/node_modules/csjs/test/comments.noscope.expected.css +++ /dev/null @@ -1,38 +0,0 @@ - - /* Here's a comment */ - /*squishedcomment*/ - /********crazycomment********/ - /* A comment with a period at the end. */ - /* A comment with a period followed by numbers v1.2.3 */ - /* A comment with a .className */ - /* - * Here's a comment - * A comment with a period at the end. - * A comment with a period followed by numbers v1.2.3 - * A comment with a .className - */ - /* .inlineCss { color: red; } */ - /* - .commentedOutCss { - color: blue; - } - */ - .foo { - color: red; /* comment on a line */ - animation-name: wow; - } - - @keyframes wow {} - - /* - @keyframes bam {} - */ - - /* .woot { - animation-name: bam; - } */ - - /* .hmm { - animation-name: wow; - } */ - diff --git a/node_modules/csjs/test/comments.noscope.expected.json b/node_modules/csjs/test/comments.noscope.expected.json deleted file mode 100644 index 3f853cad7..000000000 --- a/node_modules/csjs/test/comments.noscope.expected.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "foo": "foo_1LMZVZ", - "wow": "wow_1LMZVZ" -} diff --git a/node_modules/csjs/test/comments.source.js b/node_modules/csjs/test/comments.source.js deleted file mode 100644 index c07e858e4..000000000 --- a/node_modules/csjs/test/comments.source.js +++ /dev/null @@ -1,41 +0,0 @@ -const csjs = require('../'); - -module.exports = csjs` - /* Here's a comment */ - /*squishedcomment*/ - /********crazycomment********/ - /* A comment with a period at the end. */ - /* A comment with a period followed by numbers v1.2.3 */ - /* A comment with a .className */ - /* - * Here's a comment - * A comment with a period at the end. - * A comment with a period followed by numbers v1.2.3 - * A comment with a .className - */ - /* .inlineCss { color: red; } */ - /* - .commentedOutCss { - color: blue; - } - */ - .foo { - color: red; /* comment on a line */ - animation-name: wow; - } - - @keyframes wow {} - - /* - @keyframes bam {} - */ - - /* .woot { - animation-name: bam; - } */ - - /* .hmm { - animation-name: wow; - } */ - -`; diff --git a/node_modules/csjs/test/comments.source.noscope.js b/node_modules/csjs/test/comments.source.noscope.js deleted file mode 100644 index 653622c48..000000000 --- a/node_modules/csjs/test/comments.source.noscope.js +++ /dev/null @@ -1,41 +0,0 @@ -const csjs = require('../').noScope; - -module.exports = csjs` - /* Here's a comment */ - /*squishedcomment*/ - /********crazycomment********/ - /* A comment with a period at the end. */ - /* A comment with a period followed by numbers v1.2.3 */ - /* A comment with a .className */ - /* - * Here's a comment - * A comment with a period at the end. - * A comment with a period followed by numbers v1.2.3 - * A comment with a .className - */ - /* .inlineCss { color: red; } */ - /* - .commentedOutCss { - color: blue; - } - */ - .foo { - color: red; /* comment on a line */ - animation-name: wow; - } - - @keyframes wow {} - - /* - @keyframes bam {} - */ - - /* .woot { - animation-name: bam; - } */ - - /* .hmm { - animation-name: wow; - } */ - -`; diff --git a/node_modules/csjs/test/dot-in-values.expected.css b/node_modules/csjs/test/dot-in-values.expected.css deleted file mode 100644 index 5198ccbb8..000000000 --- a/node_modules/csjs/test/dot-in-values.expected.css +++ /dev/null @@ -1,8 +0,0 @@ - - - .foo_1Veq6n { - font-size: 1.3em; - } - - .bar_1Veq6n { font-size: 12.5px; } .baz_1Veq6n { width: 33.3% } - diff --git a/node_modules/csjs/test/dot-in-values.expected.json b/node_modules/csjs/test/dot-in-values.expected.json deleted file mode 100644 index 4170531fa..000000000 --- a/node_modules/csjs/test/dot-in-values.expected.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "foo": "foo_1Veq6n", - "baz": "baz_1Veq6n", - "bar": "bar_1Veq6n" -} diff --git a/node_modules/csjs/test/dot-in-values.noscope.expected.css b/node_modules/csjs/test/dot-in-values.noscope.expected.css deleted file mode 100644 index 50fb90677..000000000 --- a/node_modules/csjs/test/dot-in-values.noscope.expected.css +++ /dev/null @@ -1,8 +0,0 @@ - - - .foo { - font-size: 1.3em; - } - - .bar { font-size: 12.5px; } .baz { width: 33.3% } - diff --git a/node_modules/csjs/test/dot-in-values.noscope.expected.json b/node_modules/csjs/test/dot-in-values.noscope.expected.json deleted file mode 100644 index 8c71ae57d..000000000 --- a/node_modules/csjs/test/dot-in-values.noscope.expected.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "foo": "foo", - "baz": "baz", - "bar": "bar" -} diff --git a/node_modules/csjs/test/dot-in-values.noscope.source.js b/node_modules/csjs/test/dot-in-values.noscope.source.js deleted file mode 100644 index 98ce1f904..000000000 --- a/node_modules/csjs/test/dot-in-values.noscope.source.js +++ /dev/null @@ -1,11 +0,0 @@ -const csjs = require('../').noScope; - -module.exports = csjs` - - .foo { - font-size: 1.3em; - } - - .bar { font-size: 12.5px; } .baz { width: 33.3% } - -`; diff --git a/node_modules/csjs/test/dot-in-values.source.js b/node_modules/csjs/test/dot-in-values.source.js deleted file mode 100644 index 065c92683..000000000 --- a/node_modules/csjs/test/dot-in-values.source.js +++ /dev/null @@ -1,11 +0,0 @@ -const csjs = require('../'); - -module.exports = csjs` - - .foo { - font-size: 1.3em; - } - - .bar { font-size: 12.5px; } .baz { width: 33.3% } - -`; diff --git a/node_modules/csjs/test/extends-in-media-query.expected.css b/node_modules/csjs/test/extends-in-media-query.expected.css deleted file mode 100644 index 3d4c9eeb5..000000000 --- a/node_modules/csjs/test/extends-in-media-query.expected.css +++ /dev/null @@ -1,30 +0,0 @@ - - - .woot_2XWyPW { - color: red; - } - - .hello_2XWyPW { - font-size: 10px; - } - - .yay_2XWyPW { - font-weight: bold; - } - - @media (max-width: 480px) { - .woot_2XWyPW { - color: blue; - } - } - - @media (max-width: 580px) { - .woot_2XWyPW { - color: green; - } - } - - .underline_2XWyPW { - text-decoration: underline; - } - diff --git a/node_modules/csjs/test/extends-in-media-query.expected.json b/node_modules/csjs/test/extends-in-media-query.expected.json deleted file mode 100644 index 33de78946..000000000 --- a/node_modules/csjs/test/extends-in-media-query.expected.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "hello": "hello_2XWyPW", - "underline": "underline_2XWyPW", - "woot": "woot_2XWyPW foo_4xZqpC underline_2XWyPW hello_2XWyPW yay_2XWyPW", - "yay": "yay_2XWyPW" -} diff --git a/node_modules/csjs/test/extends-in-media-query.noscope.expected.css b/node_modules/csjs/test/extends-in-media-query.noscope.expected.css deleted file mode 100644 index 68764b222..000000000 --- a/node_modules/csjs/test/extends-in-media-query.noscope.expected.css +++ /dev/null @@ -1,30 +0,0 @@ - - - .woot { - color: red; - } - - .hello { - font-size: 10px; - } - - .yay { - font-weight: bold; - } - - @media (max-width: 480px) { - .woot { - color: blue; - } - } - - @media (max-width: 580px) { - .woot { - color: green; - } - } - - .underline { - text-decoration: underline; - } - diff --git a/node_modules/csjs/test/extends-in-media-query.noscope.expected.json b/node_modules/csjs/test/extends-in-media-query.noscope.expected.json deleted file mode 100644 index 9a7413ebd..000000000 --- a/node_modules/csjs/test/extends-in-media-query.noscope.expected.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "hello": "hello", - "underline": "underline", - "woot": "woot foo underline hello yay", - "yay": "yay" -} diff --git a/node_modules/csjs/test/extends-in-media-query.noscope.source.js b/node_modules/csjs/test/extends-in-media-query.noscope.source.js deleted file mode 100644 index 152fdc924..000000000 --- a/node_modules/csjs/test/extends-in-media-query.noscope.source.js +++ /dev/null @@ -1,35 +0,0 @@ -const csjs = require('../').noScope; - -const basic = require('./basic.noscope.source'); - -module.exports = csjs` - - .woot { - color: red; - } - - .hello { - font-size: 10px; - } - - .yay { - font-weight: bold; - } - - @media (max-width: 480px) { - .woot extends .hello, .yay { - color: blue; - } - } - - @media (max-width: 580px) { - .woot extends ${basic.foo}, .underline { - color: green; - } - } - - .underline { - text-decoration: underline; - } - -`; diff --git a/node_modules/csjs/test/extends-in-media-query.source.js b/node_modules/csjs/test/extends-in-media-query.source.js deleted file mode 100644 index 553110cf3..000000000 --- a/node_modules/csjs/test/extends-in-media-query.source.js +++ /dev/null @@ -1,35 +0,0 @@ -const csjs = require('../'); - -const basic = require('./basic.source'); - -module.exports = csjs` - - .woot { - color: red; - } - - .hello { - font-size: 10px; - } - - .yay { - font-weight: bold; - } - - @media (max-width: 480px) { - .woot extends .hello, .yay { - color: blue; - } - } - - @media (max-width: 580px) { - .woot extends ${basic.foo}, .underline { - color: green; - } - } - - .underline { - text-decoration: underline; - } - -`; diff --git a/node_modules/csjs/test/extensions.expected.css b/node_modules/csjs/test/extensions.expected.css deleted file mode 100644 index d228f5e59..000000000 --- a/node_modules/csjs/test/extensions.expected.css +++ /dev/null @@ -1,18 +0,0 @@ - - - .foo_g7Bft { - color: red; - } - - .bar_g7Bft { - background: blue; - } - - .baz_g7Bft { - text-transform: uppercase; - } - - .bazz_g7Bft { - color: white; - } - diff --git a/node_modules/csjs/test/extensions.expected.json b/node_modules/csjs/test/extensions.expected.json deleted file mode 100644 index 971808b5c..000000000 --- a/node_modules/csjs/test/extensions.expected.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "foo": "foo_g7Bft", - "bar": "bar_g7Bft foo_g7Bft", - "baz": "baz_g7Bft bar_g7Bft foo_g7Bft", - "bazz": "bazz_g7Bft bar_g7Bft foo_g7Bft" -} diff --git a/node_modules/csjs/test/extensions.noscope.expected.css b/node_modules/csjs/test/extensions.noscope.expected.css deleted file mode 100644 index ae2d98611..000000000 --- a/node_modules/csjs/test/extensions.noscope.expected.css +++ /dev/null @@ -1,18 +0,0 @@ - - - .foo { - color: red; - } - - .bar { - background: blue; - } - - .baz { - text-transform: uppercase; - } - - .bazz { - color: white; - } - diff --git a/node_modules/csjs/test/extensions.noscope.expected.json b/node_modules/csjs/test/extensions.noscope.expected.json deleted file mode 100644 index ef57afcd2..000000000 --- a/node_modules/csjs/test/extensions.noscope.expected.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "foo": "foo", - "bar": "bar foo", - "baz": "baz bar foo", - "bazz": "bazz bar foo" -} diff --git a/node_modules/csjs/test/extensions.noscope.source.js b/node_modules/csjs/test/extensions.noscope.source.js deleted file mode 100644 index 45155b638..000000000 --- a/node_modules/csjs/test/extensions.noscope.source.js +++ /dev/null @@ -1,21 +0,0 @@ -const csjs = require('../').noScope; - -module.exports = csjs` - - .foo { - color: red; - } - - .bar extends .foo { - background: blue; - } - - .baz extends .bar { - text-transform: uppercase; - } - - .bazz extends .bar{ - color: white; - } - -`; diff --git a/node_modules/csjs/test/extensions.source.js b/node_modules/csjs/test/extensions.source.js deleted file mode 100644 index b6689a813..000000000 --- a/node_modules/csjs/test/extensions.source.js +++ /dev/null @@ -1,21 +0,0 @@ -const csjs = require('../'); - -module.exports = csjs` - - .foo { - color: red; - } - - .bar extends .foo { - background: blue; - } - - .baz extends .bar { - text-transform: uppercase; - } - - .bazz extends .bar{ - color: white; - } - -`; diff --git a/node_modules/csjs/test/index.js b/node_modules/csjs/test/index.js deleted file mode 100644 index 2c5c72994..000000000 --- a/node_modules/csjs/test/index.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict'; - -var fs = require('fs'); -var path = require('path'); -var test = require('tape'); - -var includeFolder = require('include-folder'); -var bulk = require('bulk-require'); - -var csjs = require('../'); - -var extensions = { - source: '.source.js', - json: '.expected.json', - css: '.expected.css' -}; - -var testFiles = fs.readdirSync('test'); - -var required = bulk(__dirname, [ - '*.source.js', - '*.expected.json' -]); - -var cssFiles = includeFolder('./test', /expected\.css$/, { - preserveFilenames: true -}); - -var fixtureRegex = new RegExp(extensions.source + '$'); -var matchesFixture = fixtureRegex.test.bind(fixtureRegex); - -var tests = testFiles - .filter(matchesFixture) - .map(function toName(file) { - return path.basename(file, extensions.source); - }); - -tests.forEach(testFromName); - -function testFromName(name) { - var fixtures = getFixtures(name); - runTest(name, fixtures.result, fixtures.expected); -} - -function runTest(name, result, expected) { - test('test ' + name, function t(assert) { - assert.equal(csjs.getCss(result), expected.css, 'css matches expected'); - assert.deepEqual(stringifyVals(result), expected.json, 'object matches expected'); - assert.end(); - }); -} - -function getFixtures(name) { - var sourcePath = name + '.source'; - var jsonPath = name + '.expected'; - var cssPath = name + extensions.css; - - return { - result: required[sourcePath], - expected: { - json: required[jsonPath], - css: cssFiles[cssPath] - } - } -} - -function moduleExists(name) { - try { - return Boolean(require.resolve(name)); - } catch(e) { - return false; - } -} - -function fixturePath(name, ext) { - return path.join(__dirname, name + ext); -} - -function stringifyVals(obj) { - return Object.keys(obj).reduce(function(acc, key) { - acc[key] = obj[key].toString(); - return acc; - }, {}); -} diff --git a/node_modules/csjs/test/keyframes-usage.expected.css b/node_modules/csjs/test/keyframes-usage.expected.css deleted file mode 100644 index 2d8cad6cf..000000000 --- a/node_modules/csjs/test/keyframes-usage.expected.css +++ /dev/null @@ -1,10 +0,0 @@ - - - .woo_2MFmAf { - animation: yolo_4lrRRM 5s infinite; - } - - .boo_2MFmAf { - animation-name: yoloYolo_4lrRRM; - } - diff --git a/node_modules/csjs/test/keyframes-usage.expected.json b/node_modules/csjs/test/keyframes-usage.expected.json deleted file mode 100644 index d80676587..000000000 --- a/node_modules/csjs/test/keyframes-usage.expected.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "boo": "boo_2MFmAf", - "woo": "woo_2MFmAf" -} diff --git a/node_modules/csjs/test/keyframes-usage.noscope.expected.css b/node_modules/csjs/test/keyframes-usage.noscope.expected.css deleted file mode 100644 index 6cd34f310..000000000 --- a/node_modules/csjs/test/keyframes-usage.noscope.expected.css +++ /dev/null @@ -1,10 +0,0 @@ - - - .woo { - animation: yolo 5s infinite; - } - - .boo { - animation-name: yoloYolo; - } - diff --git a/node_modules/csjs/test/keyframes-usage.noscope.expected.json b/node_modules/csjs/test/keyframes-usage.noscope.expected.json deleted file mode 100644 index 7b6ef07a9..000000000 --- a/node_modules/csjs/test/keyframes-usage.noscope.expected.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "boo": "boo", - "woo": "woo" -} diff --git a/node_modules/csjs/test/keyframes-usage.noscope.source.js b/node_modules/csjs/test/keyframes-usage.noscope.source.js deleted file mode 100644 index ad6ef61c1..000000000 --- a/node_modules/csjs/test/keyframes-usage.noscope.source.js +++ /dev/null @@ -1,15 +0,0 @@ -const csjs = require('../').noScope; - -const keyframes = require('./keyframes.noscope.source'); - -module.exports = csjs` - - .woo { - animation: ${keyframes.yolo} 5s infinite; - } - - .boo { - animation-name: ${keyframes.yoloYolo}; - } - -`; diff --git a/node_modules/csjs/test/keyframes-usage.source.js b/node_modules/csjs/test/keyframes-usage.source.js deleted file mode 100644 index 615b031c3..000000000 --- a/node_modules/csjs/test/keyframes-usage.source.js +++ /dev/null @@ -1,15 +0,0 @@ -const csjs = require('../'); - -const keyframes = require('./keyframes.source'); - -module.exports = csjs` - - .woo { - animation: ${keyframes.yolo} 5s infinite; - } - - .boo { - animation-name: ${keyframes.yoloYolo}; - } - -`; diff --git a/node_modules/csjs/test/keyframes-with-decimal.expected.css b/node_modules/csjs/test/keyframes-with-decimal.expected.css deleted file mode 100644 index b39fe8f84..000000000 --- a/node_modules/csjs/test/keyframes-with-decimal.expected.css +++ /dev/null @@ -1,8 +0,0 @@ - - - @keyframes woot_3xZGg2 { - 0% { opacity: 0; } - 33.3% { opacity: 0.333; } - 100% { opacity: 1; } - } - diff --git a/node_modules/csjs/test/keyframes-with-decimal.expected.json b/node_modules/csjs/test/keyframes-with-decimal.expected.json deleted file mode 100644 index 836b14d41..000000000 --- a/node_modules/csjs/test/keyframes-with-decimal.expected.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "woot": "woot_3xZGg2" -} diff --git a/node_modules/csjs/test/keyframes-with-decimal.noscope.expected.css b/node_modules/csjs/test/keyframes-with-decimal.noscope.expected.css deleted file mode 100644 index c56a4c694..000000000 --- a/node_modules/csjs/test/keyframes-with-decimal.noscope.expected.css +++ /dev/null @@ -1,8 +0,0 @@ - - - @keyframes woot { - 0% { opacity: 0; } - 33.3% { opacity: 0.333; } - 100% { opacity: 1; } - } - diff --git a/node_modules/csjs/test/keyframes-with-decimal.noscope.expected.json b/node_modules/csjs/test/keyframes-with-decimal.noscope.expected.json deleted file mode 100644 index 3c675bb45..000000000 --- a/node_modules/csjs/test/keyframes-with-decimal.noscope.expected.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "woot": "woot" -} diff --git a/node_modules/csjs/test/keyframes-with-decimal.noscope.source.js b/node_modules/csjs/test/keyframes-with-decimal.noscope.source.js deleted file mode 100644 index e9fe1f0f0..000000000 --- a/node_modules/csjs/test/keyframes-with-decimal.noscope.source.js +++ /dev/null @@ -1,11 +0,0 @@ -const csjs = require('../').noScope; - -module.exports = csjs` - - @keyframes woot { - 0% { opacity: 0; } - 33.3% { opacity: 0.333; } - 100% { opacity: 1; } - } - -`; diff --git a/node_modules/csjs/test/keyframes-with-decimal.source.js b/node_modules/csjs/test/keyframes-with-decimal.source.js deleted file mode 100644 index 36f80c413..000000000 --- a/node_modules/csjs/test/keyframes-with-decimal.source.js +++ /dev/null @@ -1,11 +0,0 @@ -const csjs = require('../'); - -module.exports = csjs` - - @keyframes woot { - 0% { opacity: 0; } - 33.3% { opacity: 0.333; } - 100% { opacity: 1; } - } - -`; diff --git a/node_modules/csjs/test/keyframes.expected.css b/node_modules/csjs/test/keyframes.expected.css deleted file mode 100644 index 43ff05548..000000000 --- a/node_modules/csjs/test/keyframes.expected.css +++ /dev/null @@ -1,20 +0,0 @@ - - - @keyframes yolo_4lrRRM { - 0% { opacity: 0; } - 100% { opacity: 1; } - } - - .foo_4lrRRM { - animation: yolo_4lrRRM 5s infinite; - } - - @keyframes yoloYolo_4lrRRM { - 0% { opacity: 0; } - 100% { opacity: 1; } - } - - .bar_4lrRRM { - animation: yoloYolo_4lrRRM 5s infinite; - } - diff --git a/node_modules/csjs/test/keyframes.expected.json b/node_modules/csjs/test/keyframes.expected.json deleted file mode 100644 index aadeee812..000000000 --- a/node_modules/csjs/test/keyframes.expected.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "yolo": "yolo_4lrRRM", - "yoloYolo": "yoloYolo_4lrRRM", - "foo": "foo_4lrRRM", - "bar": "bar_4lrRRM" -} diff --git a/node_modules/csjs/test/keyframes.noscope.expected.css b/node_modules/csjs/test/keyframes.noscope.expected.css deleted file mode 100644 index 69658896c..000000000 --- a/node_modules/csjs/test/keyframes.noscope.expected.css +++ /dev/null @@ -1,20 +0,0 @@ - - - @keyframes yolo { - 0% { opacity: 0; } - 100% { opacity: 1; } - } - - .foo { - animation: yolo 5s infinite; - } - - @keyframes yoloYolo { - 0% { opacity: 0; } - 100% { opacity: 1; } - } - - .bar { - animation: yoloYolo 5s infinite; - } - diff --git a/node_modules/csjs/test/keyframes.noscope.expected.json b/node_modules/csjs/test/keyframes.noscope.expected.json deleted file mode 100644 index e6c1cfa78..000000000 --- a/node_modules/csjs/test/keyframes.noscope.expected.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "yolo": "yolo", - "yoloYolo": "yoloYolo", - "foo": "foo", - "bar": "bar" -} diff --git a/node_modules/csjs/test/keyframes.noscope.source.js b/node_modules/csjs/test/keyframes.noscope.source.js deleted file mode 100644 index a5987312c..000000000 --- a/node_modules/csjs/test/keyframes.noscope.source.js +++ /dev/null @@ -1,23 +0,0 @@ -const csjs = require('../').noScope; - -module.exports = csjs` - - @keyframes yolo { - 0% { opacity: 0; } - 100% { opacity: 1; } - } - - .foo { - animation: yolo 5s infinite; - } - - @keyframes yoloYolo { - 0% { opacity: 0; } - 100% { opacity: 1; } - } - - .bar { - animation: yoloYolo 5s infinite; - } - -`; diff --git a/node_modules/csjs/test/keyframes.source.js b/node_modules/csjs/test/keyframes.source.js deleted file mode 100644 index 47db3de1c..000000000 --- a/node_modules/csjs/test/keyframes.source.js +++ /dev/null @@ -1,23 +0,0 @@ -const csjs = require('../'); - -module.exports = csjs` - - @keyframes yolo { - 0% { opacity: 0; } - 100% { opacity: 1; } - } - - .foo { - animation: yolo 5s infinite; - } - - @keyframes yoloYolo { - 0% { opacity: 0; } - 100% { opacity: 1; } - } - - .bar { - animation: yoloYolo 5s infinite; - } - -`; diff --git a/node_modules/csjs/test/media-query.expected.css b/node_modules/csjs/test/media-query.expected.css deleted file mode 100644 index 69fe4627c..000000000 --- a/node_modules/csjs/test/media-query.expected.css +++ /dev/null @@ -1,12 +0,0 @@ - - - .foo_nYfJE { - color: red; - } - - @media (max-width: 480px) { - .foo_nYfJE { - color: blue; - } - } - diff --git a/node_modules/csjs/test/media-query.expected.json b/node_modules/csjs/test/media-query.expected.json deleted file mode 100644 index a9b2eb56f..000000000 --- a/node_modules/csjs/test/media-query.expected.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "foo": "foo_nYfJE" -} diff --git a/node_modules/csjs/test/media-query.noscope.expected.css b/node_modules/csjs/test/media-query.noscope.expected.css deleted file mode 100644 index 4f8020a52..000000000 --- a/node_modules/csjs/test/media-query.noscope.expected.css +++ /dev/null @@ -1,12 +0,0 @@ - - - .foo { - color: red; - } - - @media (max-width: 480px) { - .foo { - color: blue; - } - } - diff --git a/node_modules/csjs/test/media-query.noscope.expected.json b/node_modules/csjs/test/media-query.noscope.expected.json deleted file mode 100644 index abdd5202b..000000000 --- a/node_modules/csjs/test/media-query.noscope.expected.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "foo": "foo" -} diff --git a/node_modules/csjs/test/media-query.noscope.source.js b/node_modules/csjs/test/media-query.noscope.source.js deleted file mode 100644 index 721f5a689..000000000 --- a/node_modules/csjs/test/media-query.noscope.source.js +++ /dev/null @@ -1,15 +0,0 @@ -const csjs = require('../').noScope; - -module.exports = csjs` - - .foo { - color: red; - } - - @media (max-width: 480px) { - .foo { - color: blue; - } - } - -`; diff --git a/node_modules/csjs/test/media-query.source.js b/node_modules/csjs/test/media-query.source.js deleted file mode 100644 index f37f8af1d..000000000 --- a/node_modules/csjs/test/media-query.source.js +++ /dev/null @@ -1,15 +0,0 @@ -const csjs = require('../'); - -module.exports = csjs` - - .foo { - color: red; - } - - @media (max-width: 480px) { - .foo { - color: blue; - } - } - -`; diff --git a/node_modules/csjs/test/multiple-extensions.expected.css b/node_modules/csjs/test/multiple-extensions.expected.css deleted file mode 100644 index 2719ebfca..000000000 --- a/node_modules/csjs/test/multiple-extensions.expected.css +++ /dev/null @@ -1,14 +0,0 @@ - - - .lol_IZbgA { - font-family: serif; - } - - .baz_IZbgA { - font-size: 12px; - } - - .fob_IZbgA { - font-weight: 500; - } - diff --git a/node_modules/csjs/test/multiple-extensions.expected.json b/node_modules/csjs/test/multiple-extensions.expected.json deleted file mode 100644 index cf4780bbe..000000000 --- a/node_modules/csjs/test/multiple-extensions.expected.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lol": "lol_IZbgA", - "baz": "baz_IZbgA lol_IZbgA bar_g7Bft foo_g7Bft", - "fob": "fob_IZbgA foo_g7Bft" -} diff --git a/node_modules/csjs/test/multiple-extensions.noscope.expected.css b/node_modules/csjs/test/multiple-extensions.noscope.expected.css deleted file mode 100644 index a4d69b6f0..000000000 --- a/node_modules/csjs/test/multiple-extensions.noscope.expected.css +++ /dev/null @@ -1,14 +0,0 @@ - - - .lol { - font-family: serif; - } - - .baz { - font-size: 12px; - } - - .fob { - font-weight: 500; - } - diff --git a/node_modules/csjs/test/multiple-extensions.noscope.expected.json b/node_modules/csjs/test/multiple-extensions.noscope.expected.json deleted file mode 100644 index 1f0dbb40f..000000000 --- a/node_modules/csjs/test/multiple-extensions.noscope.expected.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "lol": "lol", - "baz": "baz lol bar foo", - "fob": "fob foo" -} diff --git a/node_modules/csjs/test/multiple-extensions.noscope.source.js b/node_modules/csjs/test/multiple-extensions.noscope.source.js deleted file mode 100644 index 4653d0f7b..000000000 --- a/node_modules/csjs/test/multiple-extensions.noscope.source.js +++ /dev/null @@ -1,19 +0,0 @@ -const csjs = require('../').noScope; - -const external = require('./extensions.noscope.source'); - -module.exports = csjs` - - .lol { - font-family: serif; - } - - .baz extends .lol, ${external.bar} { - font-size: 12px; - } - - .fob extends ${external.foo} { - font-weight: 500; - } - -`; diff --git a/node_modules/csjs/test/multiple-extensions.source.js b/node_modules/csjs/test/multiple-extensions.source.js deleted file mode 100644 index 48bf5de1e..000000000 --- a/node_modules/csjs/test/multiple-extensions.source.js +++ /dev/null @@ -1,19 +0,0 @@ -const csjs = require('../'); - -const external = require('./extensions.source'); - -module.exports = csjs` - - .lol { - font-family: serif; - } - - .baz extends .lol, ${external.bar} { - font-size: 12px; - } - - .fob extends ${external.foo} { - font-weight: 500; - } - -`; diff --git a/node_modules/csjs/test/non-class.expected.css b/node_modules/csjs/test/non-class.expected.css deleted file mode 100644 index 6b73fc54e..000000000 --- a/node_modules/csjs/test/non-class.expected.css +++ /dev/null @@ -1,6 +0,0 @@ - - - #foo { - color: red; - } - diff --git a/node_modules/csjs/test/non-class.expected.json b/node_modules/csjs/test/non-class.expected.json deleted file mode 100644 index 0967ef424..000000000 --- a/node_modules/csjs/test/non-class.expected.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/node_modules/csjs/test/non-class.noscope.expected.css b/node_modules/csjs/test/non-class.noscope.expected.css deleted file mode 100644 index 6b73fc54e..000000000 --- a/node_modules/csjs/test/non-class.noscope.expected.css +++ /dev/null @@ -1,6 +0,0 @@ - - - #foo { - color: red; - } - diff --git a/node_modules/csjs/test/non-class.noscope.expected.json b/node_modules/csjs/test/non-class.noscope.expected.json deleted file mode 100644 index 0967ef424..000000000 --- a/node_modules/csjs/test/non-class.noscope.expected.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/node_modules/csjs/test/non-class.noscope.source.js b/node_modules/csjs/test/non-class.noscope.source.js deleted file mode 100644 index 4384c49b6..000000000 --- a/node_modules/csjs/test/non-class.noscope.source.js +++ /dev/null @@ -1,9 +0,0 @@ -const csjs = require('../').noScope; - -module.exports = csjs` - - #foo { - color: red; - } - -`; diff --git a/node_modules/csjs/test/non-class.source.js b/node_modules/csjs/test/non-class.source.js deleted file mode 100644 index 0e782ea24..000000000 --- a/node_modules/csjs/test/non-class.source.js +++ /dev/null @@ -1,9 +0,0 @@ -const csjs = require('../'); - -module.exports = csjs` - - #foo { - color: red; - } - -`; diff --git a/node_modules/csjs/test/not-pseudo.expected.css b/node_modules/csjs/test/not-pseudo.expected.css deleted file mode 100644 index 77c9598fd..000000000 --- a/node_modules/csjs/test/not-pseudo.expected.css +++ /dev/null @@ -1,8 +0,0 @@ - - - @media screen and (min-width: 769px) { - .foo_25D7El:not(.bar_25D7El) { - display: flex; - } - } - diff --git a/node_modules/csjs/test/not-pseudo.expected.json b/node_modules/csjs/test/not-pseudo.expected.json deleted file mode 100644 index 89d9fda36..000000000 --- a/node_modules/csjs/test/not-pseudo.expected.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "foo": "foo_25D7El", - "bar": "bar_25D7El" -} diff --git a/node_modules/csjs/test/not-pseudo.noscope.expected.css b/node_modules/csjs/test/not-pseudo.noscope.expected.css deleted file mode 100644 index 907bd49f9..000000000 --- a/node_modules/csjs/test/not-pseudo.noscope.expected.css +++ /dev/null @@ -1,8 +0,0 @@ - - - @media screen and (min-width: 769px) { - .foo:not(.bar) { - display: flex; - } - } - diff --git a/node_modules/csjs/test/not-pseudo.noscope.expected.json b/node_modules/csjs/test/not-pseudo.noscope.expected.json deleted file mode 100644 index 5c294f87c..000000000 --- a/node_modules/csjs/test/not-pseudo.noscope.expected.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "foo": "foo", - "bar": "bar" -} diff --git a/node_modules/csjs/test/not-pseudo.noscope.source.js b/node_modules/csjs/test/not-pseudo.noscope.source.js deleted file mode 100644 index d4a9819a3..000000000 --- a/node_modules/csjs/test/not-pseudo.noscope.source.js +++ /dev/null @@ -1,11 +0,0 @@ -const csjs = require('../').noScope; - -module.exports = csjs` - - @media screen and (min-width: 769px) { - .foo:not(.bar) { - display: flex; - } - } - -`; diff --git a/node_modules/csjs/test/not-pseudo.source.js b/node_modules/csjs/test/not-pseudo.source.js deleted file mode 100644 index 47488b328..000000000 --- a/node_modules/csjs/test/not-pseudo.source.js +++ /dev/null @@ -1,11 +0,0 @@ -const csjs = require('../'); - -module.exports = csjs` - - @media screen and (min-width: 769px) { - .foo:not(.bar) { - display: flex; - } - } - -`; diff --git a/node_modules/cytoscape/.babelrc b/node_modules/cytoscape/.babelrc deleted file mode 100644 index 002b4aa0d..000000000 --- a/node_modules/cytoscape/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["env"] -} diff --git a/node_modules/cytoscape/.eslintrc.json b/node_modules/cytoscape/.eslintrc.json deleted file mode 100644 index f4c5bb248..000000000 --- a/node_modules/cytoscape/.eslintrc.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "env": { - "commonjs": true, - "shared-node-browser": true, - "node": true, - "mocha": true - }, - "parserOptions": { - "ecmaVersion": 6 - }, - "extends": "eslint:recommended", - "rules": { - "no-redeclare": "off", - "semi": "error" - } -} diff --git a/node_modules/cytoscape/.travis.yml b/node_modules/cytoscape/.travis.yml deleted file mode 100644 index 983729473..000000000 --- a/node_modules/cytoscape/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: node_js -node_js: - - "4" - - "5" - - "6" - - "7" - - "8" -sudo: false -script: npm run test-travis diff --git a/node_modules/cytoscape/ISSUE_TEMPLATE.md b/node_modules/cytoscape/ISSUE_TEMPLATE.md deleted file mode 100644 index 1804bc9ad..000000000 --- a/node_modules/cytoscape/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,74 +0,0 @@ - - -**Issue type** - - - - -Bug report -Feature request - - - - - - -**Environment info** - -- Cytoscape.js version : -- Browser/Node.js & version : - -**Current (buggy) behaviour** - - - - -**Desired behaviour** - - - - -**Minimum steps to reproduce** - - - - - - - - - - -**Description of new feature** - - - - -**Motivation for new feature** - - - - - diff --git a/node_modules/cytoscape/LICENSE b/node_modules/cytoscape/LICENSE deleted file mode 100644 index 9e21a7e3e..000000000 --- a/node_modules/cytoscape/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - - -Copyright (c) 2016-2018, The Cytoscape Consortium. - -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. \ No newline at end of file diff --git a/node_modules/cytoscape/README.md b/node_modules/cytoscape/README.md deleted file mode 100644 index 7ee3f7b73..000000000 --- a/node_modules/cytoscape/README.md +++ /dev/null @@ -1,115 +0,0 @@ -# Cytoscape.js - -[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?maxAge=1)](https://raw.githubusercontent.com/cytoscape/cytoscape.js/master/LICENSE) -[![DOI](https://zenodo.org/badge/2255947.svg)](https://zenodo.org/badge/latestdoi/2255947) -[![npm](https://img.shields.io/npm/v/cytoscape.svg?maxAge=1)](https://www.npmjs.com/package/cytoscape) -[![CDNJS version](https://img.shields.io/cdnjs/v/cytoscape.svg)](https://cdnjs.com/libraries/cytoscape) -
    [![npm installs](https://img.shields.io/npm/dm/cytoscape.svg?maxAge=1&label=npm%20installs)](https://www.npmjs.com/package/cytoscape) -[![master branch tests](https://img.shields.io/travis/cytoscape/cytoscape.js/master.svg?maxAge=1&label=master%20branch)](https://travis-ci.org/cytoscape/cytoscape.js) -[![unstable branch tests](https://img.shields.io/travis/cytoscape/cytoscape.js/unstable.svg?maxAge=1&label=unstable%20branch)](https://travis-ci.org/cytoscape/cytoscape.js) - - -Graph theory (a.k.a. network) library for analysis and visualisation : [http://js.cytoscape.org](http://js.cytoscape.org) - - - -## Description - -Cytoscape.js is a fully featured [graph theory](https://en.wikipedia.org/wiki/Graph_theory) library. Do you need to model and/or visualise relational data, like biological data or social networks? If so, Cytoscape.js is just what you need. - -Cytoscape.js contains a graph theory model and an optional renderer to display interactive graphs. This library was designed to make it as easy as possible for programmers and scientists to use graph theory in their apps, whether it's for server-side analysis in a Node.js app or for a rich user interface. - -You can get started with Cytoscape.js with one line: - -```js -var cy = cytoscape({ elements: myElements, container: myDiv }); -``` - -Learn more about the features of Cytoscape.js by reading [its documentation](http://js.cytoscape.org). - - - - - -## Documentation - -You can find the documentation and downloads on the [project website](http://js.cytoscape.org). - - - -## Roadmap - -Future versions of Cytoscape.js are planned in the [milestones of the Github issue tracker](https://github.com/cytoscape/cytoscape.js/milestones). You can use the milestones to see what's currently planned for future releases. - - - - -## Contributing to Cytoscape.js - -Please refer to [CONTRIBUTING.md](CONTRIBUTING.md). - - - -## Citation - -To cite Cytoscape.js in a paper, please cite the Oxford Bioinformatics issue: - -*Cytoscape.js: a graph theory library for visualisation and analysis* - -Franz M, Lopes CT, Huck G, Dong Y, Sumer O, Bader GD - -[Bioinformatics (2016) 32 (2): 309-311 first published online September 28, 2015 doi:10.1093/bioinformatics/btv557 (PDF)](http://bioinformatics.oxfordjournals.org/content/32/2/309) - -[PubMed Abstract](http://www.ncbi.nlm.nih.gov/pubmed/26415722) - - - - -## Build dependencies - -Install `node`, `npm` and `gulp` (optional). Of course, `npm install` before using `gulp` or `npm run`. - - - - -## Build instructions - -Run `npm run ` or `gulp ` in the console. The main targets are: - -**Building:** - - * `build` (default) : build the library - * `clean` : clean the `build` directory - * `watch` : automatically build lib and tests for debugging (no babel, very quick) - * `watch-babel` : automatically build lib and tests for debugging (with babel; good for testing out of date browsers) - * `zip` : build the release ZIP - * `dist` : update the distribution JS for npm, bower, etc. - -**Testing:** - -If the `TRAVIS` or `TEST_BUILD` environment variables are defined, then `mocha` or `gulp test` will test `build/cytoscape.cjs.js`. Otherwise, the unbundled, unbabelified, raw source is tested. This keeps local tests very quick to run on modern versions of Node while ensuring we can test old versions of Node as well. The library can be built on `node>=4`, but it can be tested on `node>=0.10`. - - * `test` : run the Mocha unit tests - * `lint` : lint the JS sources via eslint - * `benchmark` : run benchmark regression tests - * `benchmark-single` : run benchmarks only for the suite specified in `benchmark/single` - * `sniper` : runs a BioJS sniper server that hosts demos - - - -## Release instructions - - 1. Do each backport patch release before the corresponding current release. This ensures that npm lists the current version as the latest one. - 1. Make sure the docs are updated with the list of releases in `documentation/md/intro.md` - 1. Update the `VERSION` environment variable, e.g. `export VERSION=1.2.3` - 1. Confirm JS files pass linting: `gulp lint` - 1. Confirm all tests passing: `gulp test` - 1. Test the docs and demos with the latest code: `gulp docs-pub` - 1. Build and publish the release: `gulp publish` - 1. [Create a release](https://github.com/cytoscape/cytoscape.js/releases/new) for Zenodo from the latest tag - - - -## Tests - -Mocha tests are found in the [test directory](https://github.com/cytoscape/cytoscape.js/tree/master/test). The tests can be run in the browser or they can be run via Node.js (`gulp test` or `mocha`). diff --git a/node_modules/cytoscape/dist/cytoscape.cjs.js b/node_modules/cytoscape/dist/cytoscape.cjs.js deleted file mode 100644 index d15d3dbb2..000000000 --- a/node_modules/cytoscape/dist/cytoscape.cjs.js +++ /dev/null @@ -1,29144 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(require("lodash.debounce"), require("heap")); - else if(typeof define === 'function' && define.amd) - define(["lodash.debounce", "heap"], factory); - else if(typeof exports === 'object') - exports["cytoscape"] = factory(require("lodash.debounce"), require("heap")); - else - root["cytoscape"] = factory(root["lodash.debounce"], root["heap"]); -})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_26__, __WEBPACK_EXTERNAL_MODULE_32__) { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 20); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -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; }; - -/*global HTMLElement DocumentTouch */ - -var window = __webpack_require__(3); -var navigator = window ? window.navigator : null; -var document = window ? window.document : null; - -var typeofstr = _typeof(''); -var typeofobj = _typeof({}); -var typeoffn = _typeof(function () {}); -var typeofhtmlele = typeof HTMLElement === 'undefined' ? 'undefined' : _typeof(HTMLElement); - -var instanceStr = function instanceStr(obj) { - return obj && obj.instanceString && is.fn(obj.instanceString) ? obj.instanceString() : null; -}; - -var is = { - defined: function defined(obj) { - return obj != null; // not undefined or null - }, - - string: function string(obj) { - return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) == typeofstr; - }, - - fn: function fn(obj) { - return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === typeoffn; - }, - - array: function array(obj) { - return Array.isArray ? Array.isArray(obj) : obj != null && obj instanceof Array; - }, - - plainObject: function plainObject(obj) { - return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === typeofobj && !is.array(obj) && obj.constructor === Object; - }, - - object: function object(obj) { - return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === typeofobj; - }, - - number: function number(obj) { - return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === _typeof(1) && !isNaN(obj); - }, - - integer: function integer(obj) { - return is.number(obj) && Math.floor(obj) === obj; - }, - - bool: function bool(obj) { - return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === _typeof(true); - }, - - htmlElement: function htmlElement(obj) { - if ('undefined' === typeofhtmlele) { - return undefined; - } else { - return null != obj && obj instanceof HTMLElement; - } - }, - - elementOrCollection: function elementOrCollection(obj) { - return is.element(obj) || is.collection(obj); - }, - - element: function element(obj) { - return instanceStr(obj) === 'collection' && obj._private.single; - }, - - collection: function collection(obj) { - return instanceStr(obj) === 'collection' && !obj._private.single; - }, - - core: function core(obj) { - return instanceStr(obj) === 'core'; - }, - - style: function style(obj) { - return instanceStr(obj) === 'style'; - }, - - stylesheet: function stylesheet(obj) { - return instanceStr(obj) === 'stylesheet'; - }, - - event: function event(obj) { - return instanceStr(obj) === 'event'; - }, - - thread: function thread(obj) { - return instanceStr(obj) === 'thread'; - }, - - fabric: function fabric(obj) { - return instanceStr(obj) === 'fabric'; - }, - - emptyString: function emptyString(obj) { - if (obj === undefined || obj === null) { - // null is empty - return true; - } else if (obj === '' || obj.match(/^\s+$/)) { - return true; // empty string is empty - } - - return false; // otherwise, we don't know what we've got - }, - - nonemptyString: function nonemptyString(obj) { - if (obj && is.string(obj) && obj !== '' && !obj.match(/^\s+$/)) { - return true; - } - - return false; - }, - - domElement: function domElement(obj) { - if (typeof HTMLElement === 'undefined') { - return false; // we're not in a browser so it doesn't matter - } else { - return obj instanceof HTMLElement; - } - }, - - boundingBox: function boundingBox(obj) { - return is.plainObject(obj) && is.number(obj.x1) && is.number(obj.x2) && is.number(obj.y1) && is.number(obj.y2); - }, - - promise: function promise(obj) { - return is.object(obj) && is.fn(obj.then); - }, - - touch: function touch() { - return window && ('ontouchstart' in window || window.DocumentTouch && document instanceof DocumentTouch); - }, - - gecko: function gecko() { - return window && (typeof InstallTrigger !== 'undefined' || 'MozAppearance' in document.documentElement.style); - }, - - webkit: function webkit() { - return window && (typeof webkitURL !== 'undefined' || 'WebkitAppearance' in document.documentElement.style); - }, - - chromium: function chromium() { - return window && typeof chrome !== 'undefined'; - }, - - khtml: function khtml() { - return navigator && navigator.vendor.match(/kde/i); // probably a better way to detect this... - }, - - khtmlEtc: function khtmlEtc() { - return is.khtml() || is.webkit() || is.chromium(); - }, - - ms: function ms() { - return navigator && navigator.userAgent.match(/msie|trident|edge/i); // probably a better way to detect this... - }, - - windows: function windows() { - return navigator && navigator.appVersion.match(/Win/i); - }, - - mac: function mac() { - return navigator && navigator.appVersion.match(/Mac/i); - }, - - linux: function linux() { - return navigator && navigator.appVersion.match(/Linux/i); - }, - - unix: function unix() { - return navigator && navigator.appVersion.match(/X11/i); - } -}; - -module.exports = is; - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/*global console */ - -var is = __webpack_require__(0); -var math = __webpack_require__(2); - -var util = { - - MAX_INT: Number.MAX_SAFE_INTEGER || 9007199254740991, - - trueify: function trueify() { - return true; - }, - - falsify: function falsify() { - return false; - }, - - zeroify: function zeroify() { - return 0; - }, - - noop: function noop() {}, - - error: function error(msg) { - /* eslint-disable */ - if (console.error) { - console.error.apply(console, arguments); - - if (console.trace) { - console.trace(); - } - } else { - console.log.apply(console, arguments); - - if (console.trace) { - console.trace(); - } - } - /* eslint-enable */ - }, - - clone: function clone(obj) { - return this.extend({}, obj); - }, - - // gets a shallow copy of the argument - copy: function copy(obj) { - if (obj == null) { - return obj; - }if (is.array(obj)) { - return obj.slice(); - } else if (is.plainObject(obj)) { - return this.clone(obj); - } else { - return obj; - } - }, - - copyArray: function copyArray(arr) { - return arr.slice(); - }, - - clonePosition: function clonePosition(pos) { - return { x: pos.x, y: pos.y }; - }, - - uuid: function uuid(a, b // placeholders - ) { - for ( // loop :) - b = a = ''; // b - result , a - numeric letiable - a++ < 36; // - b += a * 51 & 52 // if "a" is not 9 or 14 or 19 or 24 - ? // return a random number or 4 - (a ^ 15 // if "a" is not 15 - ? // genetate a random number from 0 to 15 - 8 ^ Math.random() * (a ^ 20 ? 16 : 4) // unless "a" is 20, in which case a random number from 8 to 11 - : 4 // otherwise 4 - ).toString(16) : '-' // in other cases (if "a" is 9,14,19,24) insert "-" - ) {} - return b; - } - -}; - -util.makeBoundingBox = math.makeBoundingBox.bind(math); - -util._staticEmptyObject = {}; - -util.staticEmptyObject = function () { - return util._staticEmptyObject; -}; - -util.extend = Object.assign != null ? Object.assign.bind(Object) : function (tgt) { - var args = arguments; - - for (var i = 1; i < args.length; i++) { - var obj = args[i]; - - if (obj == null) { - continue; - } - - var keys = Object.keys(obj); - - for (var j = 0; j < keys.length; j++) { - var k = keys[j]; - - tgt[k] = obj[k]; - } - } - - return tgt; -}; - -util.assign = util.extend; - -util.default = function (val, def) { - if (val === undefined) { - return def; - } else { - return val; - } -}; - -util.removeFromArray = function (arr, ele, manyCopies) { - for (var i = arr.length; i >= 0; i--) { - if (arr[i] === ele) { - arr.splice(i, 1); - - if (!manyCopies) { - break; - } - } - } -}; - -util.clearArray = function (arr) { - arr.splice(0, arr.length); -}; - -util.push = function (arr, otherArr) { - for (var i = 0; i < otherArr.length; i++) { - var el = otherArr[i]; - - arr.push(el); - } -}; - -util.getPrefixedProperty = function (obj, propName, prefix) { - if (prefix) { - propName = this.prependCamel(prefix, propName); // e.g. (labelWidth, source) => sourceLabelWidth - } - - return obj[propName]; -}; - -util.setPrefixedProperty = function (obj, propName, prefix, value) { - if (prefix) { - propName = this.prependCamel(prefix, propName); // e.g. (labelWidth, source) => sourceLabelWidth - } - - obj[propName] = value; -}; - -[__webpack_require__(21), __webpack_require__(22), { memoize: __webpack_require__(13) }, __webpack_require__(23), __webpack_require__(24), __webpack_require__(25), __webpack_require__(27)].forEach(function (req) { - util.extend(util, req); -}); - -module.exports = util; - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var math = {}; - -math.arePositionsSame = function (p1, p2) { - return p1.x === p2.x && p1.y === p2.y; -}; - -math.copyPosition = function (p) { - return { x: p.x, y: p.y }; -}; - -math.modelToRenderedPosition = function (p, zoom, pan) { - return { - x: p.x * zoom + pan.x, - y: p.y * zoom + pan.y - }; -}; - -math.renderedToModelPosition = function (p, zoom, pan) { - return { - x: (p.x - pan.x) / zoom, - y: (p.y - pan.y) / zoom - }; -}; - -math.array2point = function (arr) { - return { - x: arr[0], - y: arr[1] - }; -}; - -math.deg2rad = function (deg) { - return Math.PI * deg / 180; -}; - -math.getAngleFromDisp = function (dispX, dispY) { - return Math.atan2(dispY, dispX) - Math.PI / 2; -}; - -math.log2 = Math.log2 || function (n) { - return Math.log(n) / Math.log(2); -}; - -math.signum = function (x) { - if (x > 0) { - return 1; - } else if (x < 0) { - return -1; - } else { - return 0; - } -}; - -math.dist = function (p1, p2) { - return Math.sqrt(math.sqdist(p1, p2)); -}; - -math.sqdist = function (p1, p2) { - var dx = p2.x - p1.x; - var dy = p2.y - p1.y; - - return dx * dx + dy * dy; -}; - -// from http://en.wikipedia.org/wiki/Bézier_curve#Quadratic_curves -math.qbezierAt = function (p0, p1, p2, t) { - return (1 - t) * (1 - t) * p0 + 2 * (1 - t) * t * p1 + t * t * p2; -}; - -math.qbezierPtAt = function (p0, p1, p2, t) { - return { - x: math.qbezierAt(p0.x, p1.x, p2.x, t), - y: math.qbezierAt(p0.y, p1.y, p2.y, t) - }; -}; - -math.lineAt = function (p0, p1, t, d) { - var vec = { - x: p1.x - p0.x, - y: p1.y - p0.y - }; - - var vecDist = math.dist(p0, p1); - - var normVec = { - x: vec.x / vecDist, - y: vec.y / vecDist - }; - - t = t == null ? 0 : t; - - d = d != null ? d : t * vecDist; - - return { - x: p0.x + normVec.x * d, - y: p0.y + normVec.y * d - }; -}; - -math.lineAtDist = function (p0, p1, d) { - return math.lineAt(p0, p1, undefined, d); -}; - -// get angle at A via cosine law -math.triangleAngle = function (A, B, C) { - var a = math.dist(B, C); - var b = math.dist(A, C); - var c = math.dist(A, B); - - return Math.acos((a * a + b * b - c * c) / (2 * a * b)); -}; - -math.bound = function (min, val, max) { - return Math.max(min, Math.min(max, val)); -}; - -// makes a full bb (x1, y1, x2, y2, w, h) from implicit params -math.makeBoundingBox = function (bb) { - if (bb == null) { - return { - x1: Infinity, - y1: Infinity, - x2: -Infinity, - y2: -Infinity, - w: 0, - h: 0 - }; - } else if (bb.x1 != null && bb.y1 != null) { - if (bb.x2 != null && bb.y2 != null && bb.x2 >= bb.x1 && bb.y2 >= bb.y1) { - return { - x1: bb.x1, - y1: bb.y1, - x2: bb.x2, - y2: bb.y2, - w: bb.x2 - bb.x1, - h: bb.y2 - bb.y1 - }; - } else if (bb.w != null && bb.h != null && bb.w >= 0 && bb.h >= 0) { - return { - x1: bb.x1, - y1: bb.y1, - x2: bb.x1 + bb.w, - y2: bb.y1 + bb.h, - w: bb.w, - h: bb.h - }; - } - } -}; - -math.updateBoundingBox = function (bb1, bb2) { - // update bb1 with bb2 bounds - - bb1.x1 = Math.min(bb1.x1, bb2.x1); - bb1.x2 = Math.max(bb1.x2, bb2.x2); - bb1.w = bb1.x2 - bb1.x1; - - bb1.y1 = Math.min(bb1.y1, bb2.y1); - bb1.y2 = Math.max(bb1.y2, bb2.y2); - bb1.h = bb1.y2 - bb1.y1; -}; - -math.expandBoundingBoxByPoint = function (bb, x, y) { - bb.x1 = Math.min(bb.x1, x); - bb.x2 = Math.max(bb.x2, x); - bb.w = bb.x2 - bb.x1; - - bb.y1 = Math.min(bb.y1, y); - bb.y2 = Math.max(bb.y2, y); - bb.h = bb.y2 - bb.y1; -}; - -math.expandBoundingBox = function (bb, padding) { - bb.x1 -= padding; - bb.x2 += padding; - bb.y1 -= padding; - bb.y2 += padding; - bb.w = bb.x2 - bb.x1; - bb.h = bb.y2 - bb.y1; - - return bb; -}; - -math.boundingBoxesIntersect = function (bb1, bb2) { - // case: one bb to right of other - if (bb1.x1 > bb2.x2) { - return false; - } - if (bb2.x1 > bb1.x2) { - return false; - } - - // case: one bb to left of other - if (bb1.x2 < bb2.x1) { - return false; - } - if (bb2.x2 < bb1.x1) { - return false; - } - - // case: one bb above other - if (bb1.y2 < bb2.y1) { - return false; - } - if (bb2.y2 < bb1.y1) { - return false; - } - - // case: one bb below other - if (bb1.y1 > bb2.y2) { - return false; - } - if (bb2.y1 > bb1.y2) { - return false; - } - - // otherwise, must have some overlap - return true; -}; - -math.inBoundingBox = function (bb, x, y) { - return bb.x1 <= x && x <= bb.x2 && bb.y1 <= y && y <= bb.y2; -}; - -math.pointInBoundingBox = function (bb, pt) { - return this.inBoundingBox(bb, pt.x, pt.y); -}; - -math.boundingBoxInBoundingBox = function (bb1, bb2) { - return math.inBoundingBox(bb1, bb2.x1, bb2.y1) && math.inBoundingBox(bb1, bb2.x2, bb2.y2); -}; - -math.roundRectangleIntersectLine = function (x, y, nodeX, nodeY, width, height, padding) { - - var cornerRadius = this.getRoundRectangleRadius(width, height); - - var halfWidth = width / 2; - var halfHeight = height / 2; - - // Check intersections with straight line segments - var straightLineIntersections = void 0; - - // Top segment, left to right - { - var topStartX = nodeX - halfWidth + cornerRadius - padding; - var topStartY = nodeY - halfHeight - padding; - var topEndX = nodeX + halfWidth - cornerRadius + padding; - var topEndY = topStartY; - - straightLineIntersections = this.finiteLinesIntersect(x, y, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false); - - if (straightLineIntersections.length > 0) { - return straightLineIntersections; - } - } - - // Right segment, top to bottom - { - var rightStartX = nodeX + halfWidth + padding; - var rightStartY = nodeY - halfHeight + cornerRadius - padding; - var rightEndX = rightStartX; - var rightEndY = nodeY + halfHeight - cornerRadius + padding; - - straightLineIntersections = this.finiteLinesIntersect(x, y, nodeX, nodeY, rightStartX, rightStartY, rightEndX, rightEndY, false); - - if (straightLineIntersections.length > 0) { - return straightLineIntersections; - } - } - - // Bottom segment, left to right - { - var bottomStartX = nodeX - halfWidth + cornerRadius - padding; - var bottomStartY = nodeY + halfHeight + padding; - var bottomEndX = nodeX + halfWidth - cornerRadius + padding; - var bottomEndY = bottomStartY; - - straightLineIntersections = this.finiteLinesIntersect(x, y, nodeX, nodeY, bottomStartX, bottomStartY, bottomEndX, bottomEndY, false); - - if (straightLineIntersections.length > 0) { - return straightLineIntersections; - } - } - - // Left segment, top to bottom - { - var leftStartX = nodeX - halfWidth - padding; - var leftStartY = nodeY - halfHeight + cornerRadius - padding; - var leftEndX = leftStartX; - var leftEndY = nodeY + halfHeight - cornerRadius + padding; - - straightLineIntersections = this.finiteLinesIntersect(x, y, nodeX, nodeY, leftStartX, leftStartY, leftEndX, leftEndY, false); - - if (straightLineIntersections.length > 0) { - return straightLineIntersections; - } - } - - // Check intersections with arc segments - var arcIntersections = void 0; - - // Top Left - { - var topLeftCenterX = nodeX - halfWidth + cornerRadius; - var topLeftCenterY = nodeY - halfHeight + cornerRadius; - arcIntersections = this.intersectLineCircle(x, y, nodeX, nodeY, topLeftCenterX, topLeftCenterY, cornerRadius + padding); - - // Ensure the intersection is on the desired quarter of the circle - if (arcIntersections.length > 0 && arcIntersections[0] <= topLeftCenterX && arcIntersections[1] <= topLeftCenterY) { - return [arcIntersections[0], arcIntersections[1]]; - } - } - - // Top Right - { - var topRightCenterX = nodeX + halfWidth - cornerRadius; - var topRightCenterY = nodeY - halfHeight + cornerRadius; - arcIntersections = this.intersectLineCircle(x, y, nodeX, nodeY, topRightCenterX, topRightCenterY, cornerRadius + padding); - - // Ensure the intersection is on the desired quarter of the circle - if (arcIntersections.length > 0 && arcIntersections[0] >= topRightCenterX && arcIntersections[1] <= topRightCenterY) { - return [arcIntersections[0], arcIntersections[1]]; - } - } - - // Bottom Right - { - var bottomRightCenterX = nodeX + halfWidth - cornerRadius; - var bottomRightCenterY = nodeY + halfHeight - cornerRadius; - arcIntersections = this.intersectLineCircle(x, y, nodeX, nodeY, bottomRightCenterX, bottomRightCenterY, cornerRadius + padding); - - // Ensure the intersection is on the desired quarter of the circle - if (arcIntersections.length > 0 && arcIntersections[0] >= bottomRightCenterX && arcIntersections[1] >= bottomRightCenterY) { - return [arcIntersections[0], arcIntersections[1]]; - } - } - - // Bottom Left - { - var bottomLeftCenterX = nodeX - halfWidth + cornerRadius; - var bottomLeftCenterY = nodeY + halfHeight - cornerRadius; - arcIntersections = this.intersectLineCircle(x, y, nodeX, nodeY, bottomLeftCenterX, bottomLeftCenterY, cornerRadius + padding); - - // Ensure the intersection is on the desired quarter of the circle - if (arcIntersections.length > 0 && arcIntersections[0] <= bottomLeftCenterX && arcIntersections[1] >= bottomLeftCenterY) { - return [arcIntersections[0], arcIntersections[1]]; - } - } - - return []; // if nothing -}; - -math.inLineVicinity = function (x, y, lx1, ly1, lx2, ly2, tolerance) { - var t = tolerance; - - var x1 = Math.min(lx1, lx2); - var x2 = Math.max(lx1, lx2); - var y1 = Math.min(ly1, ly2); - var y2 = Math.max(ly1, ly2); - - return x1 - t <= x && x <= x2 + t && y1 - t <= y && y <= y2 + t; -}; - -math.inBezierVicinity = function (x, y, x1, y1, x2, y2, x3, y3, tolerance) { - - var bb = { - x1: Math.min(x1, x3, x2) - tolerance, - x2: Math.max(x1, x3, x2) + tolerance, - y1: Math.min(y1, y3, y2) - tolerance, - y2: Math.max(y1, y3, y2) + tolerance - }; - - // if outside the rough bounding box for the bezier, then it can't be a hit - if (x < bb.x1 || x > bb.x2 || y < bb.y1 || y > bb.y2) { - // console.log('bezier out of rough bb') - return false; - } else { - // console.log('do more expensive check'); - return true; - } -}; -math.solveQuadratic = function (a, b, c, val) { - c -= val; - - var r = b * b - 4 * a * c; - - if (r < 0) { - return []; - } - - var sqrtR = Math.sqrt(r); - var denom = 2 * a; - var root1 = (-b + sqrtR) / denom; - var root2 = (-b - sqrtR) / denom; - - return [root1, root2]; -}; - -math.solveCubic = function (a, b, c, d, result) { - - // Solves a cubic function, returns root in form [r1, i1, r2, i2, r3, i3], where - // r is the real component, i is the imaginary component - - // An implementation of the Cardano method from the year 1545 - // http://en.wikipedia.org/wiki/Cubic_function#The_nature_of_the_roots - - b /= a; - c /= a; - d /= a; - - var discriminant = void 0, - q = void 0, - r = void 0, - dum1 = void 0, - s = void 0, - t = void 0, - term1 = void 0, - r13 = void 0; - - q = (3.0 * c - b * b) / 9.0; - r = -(27.0 * d) + b * (9.0 * c - 2.0 * (b * b)); - r /= 54.0; - - discriminant = q * q * q + r * r; - result[1] = 0; - term1 = b / 3.0; - - if (discriminant > 0) { - s = r + Math.sqrt(discriminant); - s = s < 0 ? -Math.pow(-s, 1.0 / 3.0) : Math.pow(s, 1.0 / 3.0); - t = r - Math.sqrt(discriminant); - t = t < 0 ? -Math.pow(-t, 1.0 / 3.0) : Math.pow(t, 1.0 / 3.0); - result[0] = -term1 + s + t; - term1 += (s + t) / 2.0; - result[4] = result[2] = -term1; - term1 = Math.sqrt(3.0) * (-t + s) / 2; - result[3] = term1; - result[5] = -term1; - return; - } - - result[5] = result[3] = 0; - - if (discriminant === 0) { - r13 = r < 0 ? -Math.pow(-r, 1.0 / 3.0) : Math.pow(r, 1.0 / 3.0); - result[0] = -term1 + 2.0 * r13; - result[4] = result[2] = -(r13 + term1); - return; - } - - q = -q; - dum1 = q * q * q; - dum1 = Math.acos(r / Math.sqrt(dum1)); - r13 = 2.0 * Math.sqrt(q); - result[0] = -term1 + r13 * Math.cos(dum1 / 3.0); - result[2] = -term1 + r13 * Math.cos((dum1 + 2.0 * Math.PI) / 3.0); - result[4] = -term1 + r13 * Math.cos((dum1 + 4.0 * Math.PI) / 3.0); - - return; -}; - -math.sqdistToQuadraticBezier = function (x, y, x1, y1, x2, y2, x3, y3) { - - // Find minimum distance by using the minimum of the distance - // function between the given point and the curve - - // This gives the coefficients of the resulting cubic equation - // whose roots tell us where a possible minimum is - // (Coefficients are divided by 4) - - var a = 1.0 * x1 * x1 - 4 * x1 * x2 + 2 * x1 * x3 + 4 * x2 * x2 - 4 * x2 * x3 + x3 * x3 + y1 * y1 - 4 * y1 * y2 + 2 * y1 * y3 + 4 * y2 * y2 - 4 * y2 * y3 + y3 * y3; - - var b = 1.0 * 9 * x1 * x2 - 3 * x1 * x1 - 3 * x1 * x3 - 6 * x2 * x2 + 3 * x2 * x3 + 9 * y1 * y2 - 3 * y1 * y1 - 3 * y1 * y3 - 6 * y2 * y2 + 3 * y2 * y3; - - var c = 1.0 * 3 * x1 * x1 - 6 * x1 * x2 + x1 * x3 - x1 * x + 2 * x2 * x2 + 2 * x2 * x - x3 * x + 3 * y1 * y1 - 6 * y1 * y2 + y1 * y3 - y1 * y + 2 * y2 * y2 + 2 * y2 * y - y3 * y; - - var d = 1.0 * x1 * x2 - x1 * x1 + x1 * x - x2 * x + y1 * y2 - y1 * y1 + y1 * y - y2 * y; - - // debug("coefficients: " + a / a + ", " + b / a + ", " + c / a + ", " + d / a); - - var roots = []; - - // Use the cubic solving algorithm - this.solveCubic(a, b, c, d, roots); - - var zeroThreshold = 0.0000001; - - var params = []; - - for (var index = 0; index < 6; index += 2) { - if (Math.abs(roots[index + 1]) < zeroThreshold && roots[index] >= 0 && roots[index] <= 1.0) { - params.push(roots[index]); - } - } - - params.push(1.0); - params.push(0.0); - - var minDistanceSquared = -1; - - var curX = void 0, - curY = void 0, - distSquared = void 0; - for (var i = 0; i < params.length; i++) { - curX = Math.pow(1.0 - params[i], 2.0) * x1 + 2.0 * (1 - params[i]) * params[i] * x2 + params[i] * params[i] * x3; - - curY = Math.pow(1 - params[i], 2.0) * y1 + 2 * (1.0 - params[i]) * params[i] * y2 + params[i] * params[i] * y3; - - distSquared = Math.pow(curX - x, 2) + Math.pow(curY - y, 2); - // debug('distance for param ' + params[i] + ": " + Math.sqrt(distSquared)); - if (minDistanceSquared >= 0) { - if (distSquared < minDistanceSquared) { - minDistanceSquared = distSquared; - } - } else { - minDistanceSquared = distSquared; - } - } - - return minDistanceSquared; -}; - -math.sqdistToFiniteLine = function (x, y, x1, y1, x2, y2) { - var offset = [x - x1, y - y1]; - var line = [x2 - x1, y2 - y1]; - - var lineSq = line[0] * line[0] + line[1] * line[1]; - var hypSq = offset[0] * offset[0] + offset[1] * offset[1]; - - var dotProduct = offset[0] * line[0] + offset[1] * line[1]; - var adjSq = dotProduct * dotProduct / lineSq; - - if (dotProduct < 0) { - return hypSq; - } - - if (adjSq > lineSq) { - return (x - x2) * (x - x2) + (y - y2) * (y - y2); - } - - return hypSq - adjSq; -}; - -math.pointInsidePolygonPoints = function (x, y, points) { - var x1 = void 0, - y1 = void 0, - x2 = void 0, - y2 = void 0; - var y3 = void 0; - - // Intersect with vertical line through (x, y) - var up = 0; - // let down = 0; - for (var i = 0; i < points.length / 2; i++) { - x1 = points[i * 2]; - y1 = points[i * 2 + 1]; - - if (i + 1 < points.length / 2) { - x2 = points[(i + 1) * 2]; - y2 = points[(i + 1) * 2 + 1]; - } else { - x2 = points[(i + 1 - points.length / 2) * 2]; - y2 = points[(i + 1 - points.length / 2) * 2 + 1]; - } - - if (x1 == x && x2 == x) { - // then ignore - } else if (x1 >= x && x >= x2 || x1 <= x && x <= x2) { - - y3 = (x - x1) / (x2 - x1) * (y2 - y1) + y1; - - if (y3 > y) { - up++; - } - - // if( y3 < y ){ - // down++; - // } - } else { - continue; - } - } - - if (up % 2 === 0) { - return false; - } else { - return true; - } -}; - -math.pointInsidePolygon = function (x, y, basePoints, centerX, centerY, width, height, direction, padding) { - - //let direction = arguments[6]; - var transformedPoints = new Array(basePoints.length); - - // Gives negative angle - var angle = void 0; - - if (direction[0] != null) { - angle = Math.atan(direction[1] / direction[0]); - - if (direction[0] < 0) { - angle = angle + Math.PI / 2; - } else { - angle = -angle - Math.PI / 2; - } - } else { - angle = direction; - } - - var cos = Math.cos(-angle); - var sin = Math.sin(-angle); - - // console.log("base: " + basePoints); - for (var i = 0; i < transformedPoints.length / 2; i++) { - transformedPoints[i * 2] = width / 2 * (basePoints[i * 2] * cos - basePoints[i * 2 + 1] * sin); - - transformedPoints[i * 2 + 1] = height / 2 * (basePoints[i * 2 + 1] * cos + basePoints[i * 2] * sin); - - transformedPoints[i * 2] += centerX; - transformedPoints[i * 2 + 1] += centerY; - } - - var points = void 0; - - if (padding > 0) { - var expandedLineSet = this.expandPolygon(transformedPoints, -padding); - - points = this.joinLines(expandedLineSet); - } else { - points = transformedPoints; - } - - return math.pointInsidePolygonPoints(x, y, points); -}; - -math.joinLines = function (lineSet) { - - var vertices = new Array(lineSet.length / 2); - - var currentLineStartX = void 0, - currentLineStartY = void 0, - currentLineEndX = void 0, - currentLineEndY = void 0; - var nextLineStartX = void 0, - nextLineStartY = void 0, - nextLineEndX = void 0, - nextLineEndY = void 0; - - for (var i = 0; i < lineSet.length / 4; i++) { - currentLineStartX = lineSet[i * 4]; - currentLineStartY = lineSet[i * 4 + 1]; - currentLineEndX = lineSet[i * 4 + 2]; - currentLineEndY = lineSet[i * 4 + 3]; - - if (i < lineSet.length / 4 - 1) { - nextLineStartX = lineSet[(i + 1) * 4]; - nextLineStartY = lineSet[(i + 1) * 4 + 1]; - nextLineEndX = lineSet[(i + 1) * 4 + 2]; - nextLineEndY = lineSet[(i + 1) * 4 + 3]; - } else { - nextLineStartX = lineSet[0]; - nextLineStartY = lineSet[1]; - nextLineEndX = lineSet[2]; - nextLineEndY = lineSet[3]; - } - - var intersection = this.finiteLinesIntersect(currentLineStartX, currentLineStartY, currentLineEndX, currentLineEndY, nextLineStartX, nextLineStartY, nextLineEndX, nextLineEndY, true); - - vertices[i * 2] = intersection[0]; - vertices[i * 2 + 1] = intersection[1]; - } - - return vertices; -}; - -math.expandPolygon = function (points, pad) { - - var expandedLineSet = new Array(points.length * 2); - - var currentPointX = void 0, - currentPointY = void 0, - nextPointX = void 0, - nextPointY = void 0; - - for (var i = 0; i < points.length / 2; i++) { - currentPointX = points[i * 2]; - currentPointY = points[i * 2 + 1]; - - if (i < points.length / 2 - 1) { - nextPointX = points[(i + 1) * 2]; - nextPointY = points[(i + 1) * 2 + 1]; - } else { - nextPointX = points[0]; - nextPointY = points[1]; - } - - // Current line: [currentPointX, currentPointY] to [nextPointX, nextPointY] - - // Assume CCW polygon winding - - var offsetX = nextPointY - currentPointY; - var offsetY = -(nextPointX - currentPointX); - - // Normalize - var offsetLength = Math.sqrt(offsetX * offsetX + offsetY * offsetY); - var normalizedOffsetX = offsetX / offsetLength; - var normalizedOffsetY = offsetY / offsetLength; - - expandedLineSet[i * 4] = currentPointX + normalizedOffsetX * pad; - expandedLineSet[i * 4 + 1] = currentPointY + normalizedOffsetY * pad; - expandedLineSet[i * 4 + 2] = nextPointX + normalizedOffsetX * pad; - expandedLineSet[i * 4 + 3] = nextPointY + normalizedOffsetY * pad; - } - - return expandedLineSet; -}; - -math.intersectLineEllipse = function (x, y, centerX, centerY, ellipseWradius, ellipseHradius) { - - var dispX = centerX - x; - var dispY = centerY - y; - - dispX /= ellipseWradius; - dispY /= ellipseHradius; - - var len = Math.sqrt(dispX * dispX + dispY * dispY); - - var newLength = len - 1; - - if (newLength < 0) { - return []; - } - - var lenProportion = newLength / len; - - return [(centerX - x) * lenProportion + x, (centerY - y) * lenProportion + y]; -}; - -math.checkInEllipse = function (x, y, width, height, centerX, centerY, padding) { - x -= centerX; - y -= centerY; - - x /= width / 2 + padding; - y /= height / 2 + padding; - - return x * x + y * y <= 1; -}; - -// Returns intersections of increasing distance from line's start point -math.intersectLineCircle = function (x1, y1, x2, y2, centerX, centerY, radius) { - - // Calculate d, direction vector of line - var d = [x2 - x1, y2 - y1]; // Direction vector of line - var f = [x1 - centerX, y1 - centerY]; - - var a = d[0] * d[0] + d[1] * d[1]; - var b = 2 * (f[0] * d[0] + f[1] * d[1]); - var c = f[0] * f[0] + f[1] * f[1] - radius * radius; - - var discriminant = b * b - 4 * a * c; - - if (discriminant < 0) { - return []; - } - - var t1 = (-b + Math.sqrt(discriminant)) / (2 * a); - var t2 = (-b - Math.sqrt(discriminant)) / (2 * a); - - var tMin = Math.min(t1, t2); - var tMax = Math.max(t1, t2); - var inRangeParams = []; - - if (tMin >= 0 && tMin <= 1) { - inRangeParams.push(tMin); - } - - if (tMax >= 0 && tMax <= 1) { - inRangeParams.push(tMax); - } - - if (inRangeParams.length === 0) { - return []; - } - - var nearIntersectionX = inRangeParams[0] * d[0] + x1; - var nearIntersectionY = inRangeParams[0] * d[1] + y1; - - if (inRangeParams.length > 1) { - - if (inRangeParams[0] == inRangeParams[1]) { - return [nearIntersectionX, nearIntersectionY]; - } else { - - var farIntersectionX = inRangeParams[1] * d[0] + x1; - var farIntersectionY = inRangeParams[1] * d[1] + y1; - - return [nearIntersectionX, nearIntersectionY, farIntersectionX, farIntersectionY]; - } - } else { - return [nearIntersectionX, nearIntersectionY]; - } -}; - -math.findCircleNearPoint = function (centerX, centerY, radius, farX, farY) { - - var displacementX = farX - centerX; - var displacementY = farY - centerY; - var distance = Math.sqrt(displacementX * displacementX + displacementY * displacementY); - - var unitDisplacementX = displacementX / distance; - var unitDisplacementY = displacementY / distance; - - return [centerX + unitDisplacementX * radius, centerY + unitDisplacementY * radius]; -}; - -math.findMaxSqDistanceToOrigin = function (points) { - var maxSqDistance = 0.000001; - var sqDistance = void 0; - - for (var i = 0; i < points.length / 2; i++) { - - sqDistance = points[i * 2] * points[i * 2] + points[i * 2 + 1] * points[i * 2 + 1]; - - if (sqDistance > maxSqDistance) { - maxSqDistance = sqDistance; - } - } - - return maxSqDistance; -}; - -math.midOfThree = function (a, b, c) { - if (b <= a && a <= c || c <= a && a <= b) { - return a; - } else if (a <= b && b <= c || c <= b && b <= a) { - return b; - } else { - return c; - } -}; - -// (x1,y1)=>(x2,y2) intersect with (x3,y3)=>(x4,y4) -math.finiteLinesIntersect = function (x1, y1, x2, y2, x3, y3, x4, y4, infiniteLines) { - - var dx13 = x1 - x3; - var dx21 = x2 - x1; - var dx43 = x4 - x3; - - var dy13 = y1 - y3; - var dy21 = y2 - y1; - var dy43 = y4 - y3; - - var ua_t = dx43 * dy13 - dy43 * dx13; - var ub_t = dx21 * dy13 - dy21 * dx13; - var u_b = dy43 * dx21 - dx43 * dy21; - - if (u_b !== 0) { - var ua = ua_t / u_b; - var ub = ub_t / u_b; - - var flptThreshold = 0.001; - var min = 0 - flptThreshold; - var max = 1 + flptThreshold; - - if (min <= ua && ua <= max && min <= ub && ub <= max) { - return [x1 + ua * dx21, y1 + ua * dy21]; - } else { - if (!infiniteLines) { - return []; - } else { - return [x1 + ua * dx21, y1 + ua * dy21]; - } - } - } else { - if (ua_t === 0 || ub_t === 0) { - - // Parallel, coincident lines. Check if overlap - - // Check endpoint of second line - if (this.midOfThree(x1, x2, x4) === x4) { - return [x4, y4]; - } - - // Check start point of second line - if (this.midOfThree(x1, x2, x3) === x3) { - return [x3, y3]; - } - - // Endpoint of first line - if (this.midOfThree(x3, x4, x2) === x2) { - return [x2, y2]; - } - - return []; - } else { - - // Parallel, non-coincident - return []; - } - } -}; - -// math.polygonIntersectLine( x, y, basePoints, centerX, centerY, width, height, padding ) -// intersect a node polygon (pts transformed) -// -// math.polygonIntersectLine( x, y, basePoints, centerX, centerY ) -// intersect the points (no transform) -math.polygonIntersectLine = function (x, y, basePoints, centerX, centerY, width, height, padding) { - - var intersections = []; - var intersection = void 0; - - var transformedPoints = new Array(basePoints.length); - - var doTransform = true; - if (arguments.length === 5) { - doTransform = false; - } - - var points = void 0; - - if (doTransform) { - for (var i = 0; i < transformedPoints.length / 2; i++) { - transformedPoints[i * 2] = basePoints[i * 2] * width + centerX; - transformedPoints[i * 2 + 1] = basePoints[i * 2 + 1] * height + centerY; - } - - if (padding > 0) { - var expandedLineSet = math.expandPolygon(transformedPoints, -padding); - - points = math.joinLines(expandedLineSet); - } else { - points = transformedPoints; - } - } else { - points = basePoints; - } - - var currentX = void 0, - currentY = void 0, - nextX = void 0, - nextY = void 0; - - for (var _i = 0; _i < points.length / 2; _i++) { - - currentX = points[_i * 2]; - currentY = points[_i * 2 + 1]; - - if (_i < points.length / 2 - 1) { - nextX = points[(_i + 1) * 2]; - nextY = points[(_i + 1) * 2 + 1]; - } else { - nextX = points[0]; - nextY = points[1]; - } - - intersection = this.finiteLinesIntersect(x, y, centerX, centerY, currentX, currentY, nextX, nextY); - - if (intersection.length !== 0) { - intersections.push(intersection[0], intersection[1]); - } - } - - return intersections; -}; - -math.shortenIntersection = function (intersection, offset, amount) { - - var disp = [intersection[0] - offset[0], intersection[1] - offset[1]]; - - var length = Math.sqrt(disp[0] * disp[0] + disp[1] * disp[1]); - - var lenRatio = (length - amount) / length; - - if (lenRatio < 0) { - lenRatio = 0.00001; - } - - return [offset[0] + lenRatio * disp[0], offset[1] + lenRatio * disp[1]]; -}; - -math.generateUnitNgonPointsFitToSquare = function (sides, rotationRadians) { - var points = math.generateUnitNgonPoints(sides, rotationRadians); - points = math.fitPolygonToSquare(points); - - return points; -}; - -math.fitPolygonToSquare = function (points) { - var x = void 0, - y = void 0; - var sides = points.length / 2; - var minX = Infinity, - minY = Infinity, - maxX = -Infinity, - maxY = -Infinity; - - for (var i = 0; i < sides; i++) { - x = points[2 * i]; - y = points[2 * i + 1]; - - minX = Math.min(minX, x); - maxX = Math.max(maxX, x); - minY = Math.min(minY, y); - maxY = Math.max(maxY, y); - } - - // stretch factors - var sx = 2 / (maxX - minX); - var sy = 2 / (maxY - minY); - - for (var _i2 = 0; _i2 < sides; _i2++) { - x = points[2 * _i2] = points[2 * _i2] * sx; - y = points[2 * _i2 + 1] = points[2 * _i2 + 1] * sy; - - minX = Math.min(minX, x); - maxX = Math.max(maxX, x); - minY = Math.min(minY, y); - maxY = Math.max(maxY, y); - } - - if (minY < -1) { - for (var _i3 = 0; _i3 < sides; _i3++) { - y = points[2 * _i3 + 1] = points[2 * _i3 + 1] + (-1 - minY); - } - } - - return points; -}; - -math.generateUnitNgonPoints = function (sides, rotationRadians) { - - var increment = 1.0 / sides * 2 * Math.PI; - var startAngle = sides % 2 === 0 ? Math.PI / 2.0 + increment / 2.0 : Math.PI / 2.0; - - startAngle += rotationRadians; - - var points = new Array(sides * 2); - - var currentAngle = void 0; - for (var i = 0; i < sides; i++) { - currentAngle = i * increment + startAngle; - - points[2 * i] = Math.cos(currentAngle); // x - points[2 * i + 1] = Math.sin(-currentAngle); // y - } - - return points; -}; - -math.getRoundRectangleRadius = function (width, height) { - - // Set the default radius, unless half of width or height is smaller than default - return Math.min(width / 4, height / 4, 8); -}; - -math.getCutRectangleCornerLength = function () { - return 8; -}; - -math.bezierPtsToQuadCoeff = function (p0, p1, p2) { - return [p0 - 2 * p1 + p2, 2 * (p1 - p0), p0]; -}; - -math.getBarrelCurveConstants = function (width, height) { - // get curve width, height, and control point position offsets as a percentage of node height / width - return { - heightOffset: Math.min(15, 0.05 * height), - widthOffset: Math.min(100, 0.25 * width), - ctrlPtOffsetPct: 0.05 - }; -}; - -module.exports = math; - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = typeof window === 'undefined' ? null : window; // eslint-disable-line no-undef - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -// use this module to cherry pick functions into your prototype -// (useful for functions shared between the core and collections, for example) - -// e.g. -// let foo = define.foo({ /* params... */ }) - -var util = __webpack_require__(1); - -var define = {}; - -[__webpack_require__(43), __webpack_require__(45), __webpack_require__(46)].forEach(function (m) { - util.assign(define, m); -}); - -module.exports = define; - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -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; }; - -/*! -Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable -Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) -Licensed under The MIT License (http://opensource.org/licenses/MIT) -*/ - -/* promise states [Promises/A+ 2.1] */ -var STATE_PENDING = 0; /* [Promises/A+ 2.1.1] */ -var STATE_FULFILLED = 1; /* [Promises/A+ 2.1.2] */ -var STATE_REJECTED = 2; /* [Promises/A+ 2.1.3] */ - -/* promise object constructor */ -var api = function api(executor) { - /* optionally support non-constructor/plain-function call */ - if (!(this instanceof api)) return new api(executor); - - /* initialize object */ - this.id = 'Thenable/1.0.7'; - this.state = STATE_PENDING; /* initial state */ - this.fulfillValue = undefined; /* initial value */ /* [Promises/A+ 1.3, 2.1.2.2] */ - this.rejectReason = undefined; /* initial reason */ /* [Promises/A+ 1.5, 2.1.3.2] */ - this.onFulfilled = []; /* initial handlers */ - this.onRejected = []; /* initial handlers */ - - /* provide optional information-hiding proxy */ - this.proxy = { - then: this.then.bind(this) - }; - - /* support optional executor function */ - if (typeof executor === 'function') executor.call(this, this.fulfill.bind(this), this.reject.bind(this)); -}; - -/* promise API methods */ -api.prototype = { - /* promise resolving methods */ - fulfill: function fulfill(value) { - return deliver(this, STATE_FULFILLED, 'fulfillValue', value); - }, - reject: function reject(value) { - return deliver(this, STATE_REJECTED, 'rejectReason', value); - }, - - /* "The then Method" [Promises/A+ 1.1, 1.2, 2.2] */ - then: function then(onFulfilled, onRejected) { - var curr = this; - var next = new api(); /* [Promises/A+ 2.2.7] */ - curr.onFulfilled.push(resolver(onFulfilled, next, 'fulfill')); /* [Promises/A+ 2.2.2/2.2.6] */ - curr.onRejected.push(resolver(onRejected, next, 'reject')); /* [Promises/A+ 2.2.3/2.2.6] */ - execute(curr); - return next.proxy; /* [Promises/A+ 2.2.7, 3.3] */ - } -}; - -/* deliver an action */ -var deliver = function deliver(curr, state, name, value) { - if (curr.state === STATE_PENDING) { - curr.state = state; /* [Promises/A+ 2.1.2.1, 2.1.3.1] */ - curr[name] = value; /* [Promises/A+ 2.1.2.2, 2.1.3.2] */ - execute(curr); - } - return curr; -}; - -/* execute all handlers */ -var execute = function execute(curr) { - if (curr.state === STATE_FULFILLED) execute_handlers(curr, 'onFulfilled', curr.fulfillValue);else if (curr.state === STATE_REJECTED) execute_handlers(curr, 'onRejected', curr.rejectReason); -}; - -/* execute particular set of handlers */ -var execute_handlers = function execute_handlers(curr, name, value) { - /* global setImmediate: true */ - /* global setTimeout: true */ - - /* short-circuit processing */ - if (curr[name].length === 0) return; - - /* iterate over all handlers, exactly once */ - var handlers = curr[name]; - curr[name] = []; /* [Promises/A+ 2.2.2.3, 2.2.3.3] */ - var func = function func() { - for (var i = 0; i < handlers.length; i++) { - handlers[i](value); - } /* [Promises/A+ 2.2.5] */ - }; - - /* execute procedure asynchronously */ /* [Promises/A+ 2.2.4, 3.1] */ - if (typeof setImmediate === 'function') setImmediate(func);else setTimeout(func, 0); -}; - -/* generate a resolver function */ -var resolver = function resolver(cb, next, method) { - return function (value) { - if (typeof cb !== 'function') /* [Promises/A+ 2.2.1, 2.2.7.3, 2.2.7.4] */ - next[method].call(next, value); /* [Promises/A+ 2.2.7.3, 2.2.7.4] */ - else { - var result; - try { - result = cb(value); - } /* [Promises/A+ 2.2.2.1, 2.2.3.1, 2.2.5, 3.2] */ - catch (e) { - next.reject(e); /* [Promises/A+ 2.2.7.2] */ - return; - } - resolve(next, result); /* [Promises/A+ 2.2.7.1] */ - } - }; -}; - -/* "Promise Resolution Procedure" */ /* [Promises/A+ 2.3] */ -var resolve = function resolve(promise, x) { - /* sanity check arguments */ /* [Promises/A+ 2.3.1] */ - if (promise === x || promise.proxy === x) { - promise.reject(new TypeError('cannot resolve promise with itself')); - return; - } - - /* surgically check for a "then" method - (mainly to just call the "getter" of "then" only once) */ - var then; - if ((typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object' && x !== null || typeof x === 'function') { - try { - then = x.then; - } /* [Promises/A+ 2.3.3.1, 3.5] */ - catch (e) { - promise.reject(e); /* [Promises/A+ 2.3.3.2] */ - return; - } - } - - /* handle own Thenables [Promises/A+ 2.3.2] - and similar "thenables" [Promises/A+ 2.3.3] */ - if (typeof then === 'function') { - var resolved = false; - try { - /* call retrieved "then" method */ /* [Promises/A+ 2.3.3.3] */ - then.call(x, - /* resolvePromise */ /* [Promises/A+ 2.3.3.3.1] */ - function (y) { - if (resolved) return;resolved = true; /* [Promises/A+ 2.3.3.3.3] */ - if (y === x) /* [Promises/A+ 3.6] */ - promise.reject(new TypeError('circular thenable chain'));else resolve(promise, y); - }, - - /* rejectPromise */ /* [Promises/A+ 2.3.3.3.2] */ - function (r) { - if (resolved) return;resolved = true; /* [Promises/A+ 2.3.3.3.3] */ - promise.reject(r); - }); - } catch (e) { - if (!resolved) /* [Promises/A+ 2.3.3.3.3] */ - promise.reject(e); /* [Promises/A+ 2.3.3.3.4] */ - } - return; - } - - /* handle other values */ - promise.fulfill(x); /* [Promises/A+ 2.3.4, 2.3.3.4] */ -}; - -// so we always have Promise.all() -api.all = function (ps) { - return new api(function (resolveAll, rejectAll) { - var vals = new Array(ps.length); - var doneCount = 0; - - var fulfill = function fulfill(i, val) { - vals[i] = val; - doneCount++; - - if (doneCount === ps.length) { - resolveAll(vals); - } - }; - - for (var i = 0; i < ps.length; i++) { - (function (i) { - var p = ps[i]; - var isPromise = p != null && p.then != null; - - if (isPromise) { - p.then(function (val) { - fulfill(i, val); - }, function (err) { - rejectAll(err); - }); - } else { - var val = p; - fulfill(i, val); - } - })(i); - } - }); -}; - -api.resolve = function (val) { - return new api(function (resolve, reject) { - resolve(val); - }); -}; - -api.reject = function (val) { - return new api(function (resolve, reject) { - reject(val); - }); -}; - -module.exports = typeof Promise !== 'undefined' ? Promise : api; // eslint-disable-line no-undef - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var util = __webpack_require__(1); -var newQuery = __webpack_require__(10); - -var Selector = function Selector(selector) { - var self = this; - - self._private = { - selectorText: selector, - invalid: true - }; - - if (selector == null || is.string(selector) && selector.match(/^\s*$/)) { - - self.length = 0; - } else if (selector === '*' || selector === 'edge' || selector === 'node') { - - // make single, group-only selectors cheap to make and cheap to filter - - self[0] = newQuery(); - self[0].group = selector === '*' ? selector : selector + 's'; - self[0].groupOnly = true; - self[0].length = 1; - self._private.invalid = false; - self.length = 1; - } else if (is.elementOrCollection(selector)) { - - var collection = selector.collection(); - - self[0] = newQuery(); - self[0].collection = collection; - self[0].length = 1; - self.length = 1; - } else if (is.fn(selector)) { - - self[0] = newQuery(); - self[0].filter = selector; - self[0].length = 1; - self.length = 1; - } else if (is.string(selector)) { - if (!self.parse(selector)) { - return; - } - } else { - util.error('A selector must be created from a string; found ', selector); - return; - } - - self._private.invalid = false; -}; - -var selfn = Selector.prototype; - -selfn.valid = function () { - return !this._private.invalid; -}; - -selfn.invalid = function () { - return this._private.invalid; -}; - -selfn.text = function () { - return this._private.selectorText; -}; - -selfn.size = function () { - return this.length; -}; - -selfn.eq = function (i) { - return this[i]; -}; - -selfn.sameText = function (otherSel) { - return this.text() === otherSel.text(); -}; - -selfn.toString = selfn.selector = function () { - - if (this._private.toStringCache != null) { - return this._private.toStringCache; - } - - var i = void 0; - var str = ''; - - var clean = function clean(obj) { - if (obj == null) { - return ''; - } else { - return obj; - } - }; - - var cleanVal = function cleanVal(val) { - if (is.string(val)) { - return '"' + val + '"'; - } else { - return clean(val); - } - }; - - var space = function space(val) { - return ' ' + val + ' '; - }; - - var queryToString = function queryToString(query) { - var str = ''; - var j = void 0, - sel = void 0; - - if (query.subject === query) { - str += '$'; - } - - var group = clean(query.group); - str += group.substring(0, group.length - 1); - - for (j = 0; j < query.data.length; j++) { - var data = query.data[j]; - - if (data.value) { - str += '[' + data.field + space(clean(data.operator)) + cleanVal(data.value) + ']'; - } else { - str += '[' + clean(data.operator) + data.field + ']'; - } - } - - for (j = 0; j < query.meta.length; j++) { - var meta = query.meta[j]; - str += '[[' + meta.field + space(clean(meta.operator)) + cleanVal(meta.value) + ']]'; - } - - for (j = 0; j < query.colonSelectors.length; j++) { - sel = query.colonSelectors[i]; - str += sel; - } - - for (j = 0; j < query.ids.length; j++) { - sel = '#' + query.ids[i]; - str += sel; - } - - for (j = 0; j < query.classes.length; j++) { - sel = '.' + query.classes[j]; - str += sel; - } - - if (query.source != null && query.target != null) { - str = queryToString(query.source) + ' -> ' + queryToString(query.target); - } - - if (query.connectedNodes != null) { - var n = query.connectedNodes; - - str = queryToString(n[0]) + ' <-> ' + queryToString(n[1]); - } - - if (query.parent != null) { - str = queryToString(query.parent) + ' > ' + str; - } - - if (query.ancestor != null) { - str = queryToString(query.ancestor) + ' ' + str; - } - - if (query.child != null) { - str += ' > ' + queryToString(query.child); - } - - if (query.descendant != null) { - str += ' ' + queryToString(query.descendant); - } - - return str; - }; - - for (i = 0; i < this.length; i++) { - var query = this[i]; - - str += queryToString(query); - - if (this.length > 1 && i < this.length - 1) { - str += ', '; - } - } - - this._private.toStringCache = str; - - return str; -}; - -[__webpack_require__(49), __webpack_require__(52)].forEach(function (p) { - return util.assign(selfn, p); -}); - -module.exports = Selector; - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var is = __webpack_require__(0); -var Map = __webpack_require__(28); -var Set = __webpack_require__(8); - -var Element = __webpack_require__(14); - -// factory for generating edge ids when no id is specified for a new element -var idFactory = { - generate: function generate(cy, element, tryThisId) { - var id = tryThisId != null ? tryThisId : util.uuid(); - - while (cy.hasElementWithId(id)) { - id = util.uuid(); - } - - return id; - } -}; - -// represents a set of nodes, edges, or both together -var Collection = function Collection(cy, elements, options) { - if (cy === undefined || !is.core(cy)) { - util.error('A collection must have a reference to the core'); - return; - } - - var map = new Map(); - var createdElements = false; - - if (!elements) { - elements = []; - } else if (elements.length > 0 && is.plainObject(elements[0]) && !is.element(elements[0])) { - createdElements = true; - - // make elements from json and restore all at once later - var eles = []; - var elesIds = new Set(); - - for (var i = 0, l = elements.length; i < l; i++) { - var json = elements[i]; - - if (json.data == null) { - json.data = {}; - } - - var data = json.data; - - // make sure newly created elements have valid ids - if (data.id == null) { - data.id = idFactory.generate(cy, json); - } else if (cy.hasElementWithId(data.id) || elesIds.has(data.id)) { - continue; // can't create element if prior id already exists - } - - var ele = new Element(cy, json, false); - eles.push(ele); - elesIds.add(data.id); - } - - elements = eles; - } - - this.length = 0; - - for (var _i = 0, _l = elements.length; _i < _l; _i++) { - var element = elements[_i]; - if (element == null) { - continue; - } - - var id = element._private.data.id; - - if (options == null || options.unique && !map.has(id)) { - map.set(id, { - index: this.length, - ele: element - }); - - this[this.length] = element; - this.length++; - } - } - - this._private = { - cy: cy, - map: map - }; - - // restore the elements if we created them from json - if (createdElements) { - this.restore(); - } -}; - -// Functions -//////////////////////////////////////////////////////////////////////////////////////////////////// - -// keep the prototypes in sync (an element has the same functions as a collection) -// and use elefn and elesfn as shorthands to the prototypes -var elesfn = Element.prototype = Collection.prototype; - -elesfn.instanceString = function () { - return 'collection'; -}; - -elesfn.spawn = function (cy, eles, opts) { - if (!is.core(cy)) { - // cy is optional - opts = eles; - eles = cy; - cy = this.cy(); - } - - return new Collection(cy, eles, opts); -}; - -elesfn.spawnSelf = function () { - return this.spawn(this); -}; - -elesfn.cy = function () { - return this._private.cy; -}; - -elesfn.renderer = function () { - return this._private.cy.renderer(); -}; - -elesfn.element = function () { - return this[0]; -}; - -elesfn.collection = function () { - if (is.collection(this)) { - return this; - } else { - // an element - return new Collection(this._private.cy, [this]); - } -}; - -elesfn.unique = function () { - return new Collection(this._private.cy, this, { unique: true }); -}; - -elesfn.hasElementWithId = function (id) { - return this._private.map.has(id); -}; - -elesfn.getElementById = function (id) { - var cy = this._private.cy; - var entry = this._private.map.get(id); - - return entry ? entry.ele : new Collection(cy); // get ele or empty collection -}; - -elesfn.$id = elesfn.getElementById; - -elesfn.poolIndex = function () { - var cy = this._private.cy; - var eles = cy._private.elements; - var id = this._private.data.id; - - return eles._private.map.get(id).index; -}; - -elesfn.json = function (obj) { - var ele = this.element(); - var cy = this.cy(); - - if (ele == null && obj) { - return this; - } // can't set to no eles - - if (ele == null) { - return undefined; - } // can't get from no eles - - var p = ele._private; - - if (is.plainObject(obj)) { - // set - - cy.startBatch(); - - if (obj.data) { - ele.data(obj.data); - } - - if (obj.position) { - ele.position(obj.position); - } - - // ignore group -- immutable - - var checkSwitch = function checkSwitch(k, trueFnName, falseFnName) { - var obj_k = obj[k]; - - if (obj_k != null && obj_k !== p[k]) { - if (obj_k) { - ele[trueFnName](); - } else { - ele[falseFnName](); - } - } - }; - - checkSwitch('removed', 'remove', 'restore'); - - checkSwitch('selected', 'select', 'unselect'); - - checkSwitch('selectable', 'selectify', 'unselectify'); - - checkSwitch('locked', 'lock', 'unlock'); - - checkSwitch('grabbable', 'grabify', 'ungrabify'); - - if (obj.classes != null) { - ele.classes(obj.classes); - } - - cy.endBatch(); - - return this; - } else if (obj === undefined) { - // get - - var json = { - data: util.copy(p.data), - position: util.copy(p.position), - group: p.group, - removed: p.removed, - selected: p.selected, - selectable: p.selectable, - locked: p.locked, - grabbable: p.grabbable, - classes: null - }; - - json.classes = ''; - - var i = 0; - p.classes.forEach(function (cls) { - return json.classes += i++ === 0 ? cls : ' ' + cls; - }); - - return json; - } -}; - -elesfn.jsons = function () { - var jsons = []; - - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - var json = ele.json(); - - jsons.push(json); - } - - return jsons; -}; - -elesfn.clone = function () { - var cy = this.cy(); - var elesArr = []; - - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - var json = ele.json(); - var clone = new Element(cy, json, false); // NB no restore - - elesArr.push(clone); - } - - return new Collection(cy, elesArr); -}; -elesfn.copy = elesfn.clone; - -elesfn.restore = function (notifyRenderer) { - var self = this; - var cy = self.cy(); - var cy_p = cy._private; - - if (notifyRenderer === undefined) { - notifyRenderer = true; - } - - // create arrays of nodes and edges, since we need to - // restore the nodes first - var nodes = []; - var edges = []; - var elements = void 0; - for (var _i2 = 0, l = self.length; _i2 < l; _i2++) { - var ele = self[_i2]; - - if (!ele.removed()) { - // don't need to handle this ele - continue; - } - - // keep nodes first in the array and edges after - if (ele.isNode()) { - // put to front of array if node - nodes.push(ele); - } else { - // put to end of array if edge - edges.push(ele); - } - } - - elements = nodes.concat(edges); - - var i = void 0; - var removeFromElements = function removeFromElements() { - elements.splice(i, 1); - i--; - }; - - // now, restore each element - for (i = 0; i < elements.length; i++) { - var _ele = elements[i]; - - var _private = _ele._private; - var data = _private.data; - - // the traversal cache should start fresh when ele is added - _ele.clearTraversalCache(); - - // set id and validate - if (data.id === undefined) { - data.id = idFactory.generate(cy, _ele); - } else if (is.number(data.id)) { - data.id = '' + data.id; // now it's a string - } else if (is.emptyString(data.id) || !is.string(data.id)) { - util.error('Can not create element with invalid string ID `' + data.id + '`'); - - // can't create element if it has empty string as id or non-string id - removeFromElements(); - continue; - } else if (cy.hasElementWithId(data.id)) { - util.error('Can not create second element with ID `' + data.id + '`'); - - // can't create element if one already has that id - removeFromElements(); - continue; - } - - var id = data.id; // id is finalised, now let's keep a ref - - if (_ele.isNode()) { - // extra checks for nodes - var pos = _private.position; - - // make sure the nodes have a defined position - - if (pos.x == null) { - pos.x = 0; - } - - if (pos.y == null) { - pos.y = 0; - } - } - - if (_ele.isEdge()) { - // extra checks for edges - - var edge = _ele; - var fields = ['source', 'target']; - var fieldsLength = fields.length; - var badSourceOrTarget = false; - for (var j = 0; j < fieldsLength; j++) { - - var field = fields[j]; - var val = data[field]; - - if (is.number(val)) { - val = data[field] = '' + data[field]; // now string - } - - if (val == null || val === '') { - // can't create if source or target is not defined properly - util.error('Can not create edge `' + id + '` with unspecified ' + field); - badSourceOrTarget = true; - } else if (!cy.hasElementWithId(val)) { - // can't create edge if one of its nodes doesn't exist - util.error('Can not create edge `' + id + '` with nonexistant ' + field + ' `' + val + '`'); - badSourceOrTarget = true; - } - } - - if (badSourceOrTarget) { - removeFromElements();continue; - } // can't create this - - var src = cy.getElementById(data.source); - var tgt = cy.getElementById(data.target); - - src._private.edges.push(edge); - tgt._private.edges.push(edge); - - edge._private.source = src; - edge._private.target = tgt; - } // if is edge - - // create mock ids / indexes maps for element so it can be used like collections - _private.map = new Map(); - _private.map.set(id, { ele: _ele, index: 0 }); - - _private.removed = false; - cy.addToPool(_ele); - } // for each element - - // do compound node sanity checks - for (var _i3 = 0; _i3 < nodes.length; _i3++) { - // each node - var node = nodes[_i3]; - var _data = node._private.data; - - if (is.number(_data.parent)) { - // then automake string - _data.parent = '' + _data.parent; - } - - var parentId = _data.parent; - - var specifiedParent = parentId != null; - - if (specifiedParent) { - var parent = cy.getElementById(parentId); - - if (parent.empty()) { - // non-existant parent; just remove it - _data.parent = undefined; - } else { - var selfAsParent = false; - var ancestor = parent; - while (!ancestor.empty()) { - if (node.same(ancestor)) { - // mark self as parent and remove from data - selfAsParent = true; - _data.parent = undefined; // remove parent reference - - // exit or we loop forever - break; - } - - ancestor = ancestor.parent(); - } - - if (!selfAsParent) { - // connect with children - parent[0]._private.children.push(node); - node._private.parent = parent[0]; - - // let the core know we have a compound graph - cy_p.hasCompoundNodes = true; - } - } // else - } // if specified parent - } // for each node - - if (elements.length > 0) { - var restored = new Collection(cy, elements); - - for (var _i4 = 0; _i4 < restored.length; _i4++) { - var _ele2 = restored[_i4]; - - if (_ele2.isNode()) { - continue; - } - - // adding an edge invalidates the traversal caches for the parallel edges - _ele2.parallelEdges().clearTraversalCache(); - - // adding an edge invalidates the traversal cache for the connected nodes - _ele2.source().clearTraversalCache(); - _ele2.target().clearTraversalCache(); - } - - var toUpdateStyle = void 0; - - if (cy_p.hasCompoundNodes) { - toUpdateStyle = cy.collection().merge(restored).merge(restored.connectedNodes()).merge(restored.parent()); - } else { - toUpdateStyle = restored; - } - - toUpdateStyle.dirtyCompoundBoundsCache().updateStyle(notifyRenderer); - - if (notifyRenderer) { - restored.emitAndNotify('add'); - } else { - restored.emit('add'); - } - } - - return self; // chainability -}; - -elesfn.removed = function () { - var ele = this[0]; - return ele && ele._private.removed; -}; - -elesfn.inside = function () { - var ele = this[0]; - return ele && !ele._private.removed; -}; - -elesfn.remove = function (notifyRenderer) { - var self = this; - var removed = []; - var elesToRemove = []; - var elesToRemoveIds = {}; - var cy = self._private.cy; - - if (notifyRenderer === undefined) { - notifyRenderer = true; - } - - // add connected edges - function addConnectedEdges(node) { - var edges = node._private.edges; - for (var i = 0; i < edges.length; i++) { - add(edges[i]); - } - } - - // add descendant nodes - function addChildren(node) { - var children = node._private.children; - - for (var i = 0; i < children.length; i++) { - add(children[i]); - } - } - - function add(ele) { - var alreadyAdded = elesToRemoveIds[ele.id()]; - if (ele.removed() || alreadyAdded) { - return; - } else { - elesToRemoveIds[ele.id()] = true; - } - - if (ele.isNode()) { - elesToRemove.push(ele); // nodes are removed last - - addConnectedEdges(ele); - addChildren(ele); - } else { - elesToRemove.unshift(ele); // edges are removed first - } - } - - // make the list of elements to remove - // (may be removing more than specified due to connected edges etc) - - for (var i = 0, l = self.length; i < l; i++) { - var ele = self[i]; - - add(ele); - } - - function removeEdgeRef(node, edge) { - var connectedEdges = node._private.edges; - - util.removeFromArray(connectedEdges, edge); - - // removing an edges invalidates the traversal cache for its nodes - node.clearTraversalCache(); - } - - function removeParallelRefs(edge) { - // removing an edge invalidates the traversal caches for the parallel edges - edge.parallelEdges().clearTraversalCache(); - } - - var alteredParents = []; - alteredParents.ids = {}; - - function removeChildRef(parent, ele) { - ele = ele[0]; - parent = parent[0]; - - var children = parent._private.children; - var pid = parent.id(); - - util.removeFromArray(children, ele); - - if (!alteredParents.ids[pid]) { - alteredParents.ids[pid] = true; - alteredParents.push(parent); - } - } - - self.dirtyCompoundBoundsCache(); - - cy.removeFromPool(elesToRemove); // remove from core pool - - for (var _i5 = 0; _i5 < elesToRemove.length; _i5++) { - var _ele3 = elesToRemove[_i5]; - - // mark as removed - _ele3._private.removed = true; - - // add to list of removed elements - removed.push(_ele3); - - if (_ele3.isEdge()) { - // remove references to this edge in its connected nodes - var src = _ele3.source()[0]; - var tgt = _ele3.target()[0]; - - removeEdgeRef(src, _ele3); - removeEdgeRef(tgt, _ele3); - removeParallelRefs(_ele3); - } else { - // remove reference to parent - var parent = _ele3.parent(); - - if (parent.length !== 0) { - removeChildRef(parent, _ele3); - } - } - } - - // check to see if we have a compound graph or not - var elesStillInside = cy._private.elements; - cy._private.hasCompoundNodes = false; - for (var _i6 = 0; _i6 < elesStillInside.length; _i6++) { - var _ele4 = elesStillInside[_i6]; - - if (_ele4.isParent()) { - cy._private.hasCompoundNodes = true; - break; - } - } - - var removedElements = new Collection(this.cy(), removed); - if (removedElements.size() > 0) { - // must manually notify since trigger won't do this automatically once removed - - if (notifyRenderer) { - this.cy().notify({ - type: 'remove', - eles: removedElements - }); - } - - removedElements.emit('remove'); - } - - // the parents who were modified by the removal need their style updated - for (var _i7 = 0; _i7 < alteredParents.length; _i7++) { - var _ele5 = alteredParents[_i7]; - - if (!_ele5.removed()) { - _ele5.updateStyle(); - } - } - - return new Collection(cy, removed); -}; - -elesfn.move = function (struct) { - var cy = this._private.cy; - - if (struct.source !== undefined || struct.target !== undefined) { - var srcId = struct.source; - var tgtId = struct.target; - var srcExists = cy.hasElementWithId(srcId); - var tgtExists = cy.hasElementWithId(tgtId); - - if (srcExists || tgtExists) { - var jsons = this.jsons(); - - this.remove(); - - for (var i = 0; i < jsons.length; i++) { - var json = jsons[i]; - var ele = this[i]; - - if (json.group === 'edges') { - if (srcExists) { - json.data.source = srcId; - } - - if (tgtExists) { - json.data.target = tgtId; - } - - json.scratch = ele._private.scratch; - } - } - - return cy.add(jsons); - } - } else if (struct.parent !== undefined) { - // move node to new parent - var parentId = struct.parent; - var parentExists = parentId === null || cy.hasElementWithId(parentId); - - if (parentExists) { - var _jsons = this.jsons(); - var descs = this.descendants(); - var descsEtcJsons = descs.union(descs.union(this).connectedEdges()).jsons(); - - this.remove(); // NB: also removes descendants and their connected edges - - for (var _i8 = 0; _i8 < _jsons.length; _i8++) { - var _json = _jsons[_i8]; - var _ele6 = this[_i8]; - - if (_json.group === 'nodes') { - _json.data.parent = parentId === null ? undefined : parentId; - - _json.scratch = _ele6._private.scratch; - } - } - - return cy.add(_jsons.concat(descsEtcJsons)); - } - } - - return this; // if nothing done -}; - -[__webpack_require__(29), __webpack_require__(42), __webpack_require__(47), __webpack_require__(48), __webpack_require__(53), __webpack_require__(54), __webpack_require__(55), __webpack_require__(56), __webpack_require__(61), __webpack_require__(62), __webpack_require__(63), __webpack_require__(7), __webpack_require__(64), __webpack_require__(65), __webpack_require__(66), __webpack_require__(67), __webpack_require__(68)].forEach(function (props) { - util.extend(elesfn, props); -}); - -module.exports = Collection; - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -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 _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; }; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/* global Set */ - -var undef = true ? 'undefined' : _typeof(undefined); - -var ObjectSet = function () { - function ObjectSet(arrayOrObjectSet) { - _classCallCheck(this, ObjectSet); - - this._obj = Object.create(null); - - if (arrayOrObjectSet != null) { - var arr = void 0; - - if (arrayOrObjectSet.instanceString != null && arrayOrObjectSet.instanceString() === this.instanceString()) { - arr = arrayOrObjectSet.toArray(); - } else { - arr = arrayOrObjectSet; - } - - for (var i = 0; i < arr.length; i++) { - this.add(arr[i]); - } - } - } - - _createClass(ObjectSet, [{ - key: 'instanceString', - value: function instanceString() { - return 'set'; - } - }, { - key: 'add', - value: function add(val) { - this._obj[val] = 1; - } - }, { - key: 'delete', - value: function _delete(val) { - this._obj[val] = 0; - } - }, { - key: 'clear', - value: function clear() { - this._obj = Object.create(null); - } - }, { - key: 'has', - value: function has(val) { - return this._obj[val] === 1; - } - }, { - key: 'toArray', - value: function toArray() { - var _this = this; - - return Object.keys(this._obj).filter(function (key) { - return _this.has(key); - }); - } - }, { - key: 'forEach', - value: function forEach(callback, thisArg) { - return this.toArray().forEach(callback, thisArg); - } - }, { - key: 'size', - get: function get() { - return this.toArray().length; - } - }]); - - return ObjectSet; -}(); - -// TODO use the stdlib Set in future... -// module.exports = typeof Set !== undef ? Set : ObjectSet; - - -module.exports = ObjectSet; - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = __webpack_require__(32); - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -// storage for parsed queries -var newQuery = function newQuery() { - return { - classes: [], - colonSelectors: [], - data: [], - group: null, - ids: [], - meta: [], - - // fake selectors - collection: null, // a collection to match against - filter: null, // filter function - - // these are defined in the upward direction rather than down (e.g. child) - // because we need to go up in Selector.filter() - parent: null, // parent query obj - ancestor: null, // ancestor query obj - subject: null, // defines subject in compound query (subject query obj; points to self if subject) - - // use these only when subject has been defined - child: null, - descendant: null - }; -}; - -module.exports = newQuery; - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var is = __webpack_require__(0); -var Event = __webpack_require__(16); - -var eventRegex = /^([^.]+)(\.(?:[^.]+))?$/; // regex for matching event strings (e.g. "click.namespace") -var universalNamespace = '.*'; // matches as if no namespace specified and prevents users from unbinding accidentally - -var defaults = { - qualifierCompare: function qualifierCompare(q1, q2) { - return q1 === q2; - }, - eventMatches: function eventMatches() /*context, listener, eventObj*/{ - return true; - }, - eventFields: function eventFields() /*context*/{ - return {}; - }, - callbackContext: function callbackContext(context /*, listener, eventObj*/) { - return context; - }, - beforeEmit: function beforeEmit() /* context, listener, eventObj */{}, - afterEmit: function afterEmit() /* context, listener, eventObj */{}, - bubble: function bubble() /*context*/{ - return false; - }, - parent: function parent() /*context*/{ - return null; - }, - context: undefined -}; - -function Emitter(opts) { - util.assign(this, defaults, opts); - - this.listeners = []; - this.emitting = 0; -} - -var p = Emitter.prototype; - -var forEachEvent = function forEachEvent(self, handler, events, qualifier, callback, conf, confOverrides) { - if (is.fn(qualifier)) { - callback = qualifier; - qualifier = null; - } - - if (confOverrides) { - if (conf == null) { - conf = confOverrides; - } else { - conf = util.assign({}, conf, confOverrides); - } - } - - var eventList = events.split(/\s+/); - - for (var i = 0; i < eventList.length; i++) { - var evt = eventList[i]; - - if (is.emptyString(evt)) { - continue; - } - - var match = evt.match(eventRegex); // type[.namespace] - - if (match) { - var type = match[1]; - var namespace = match[2] ? match[2] : null; - var ret = handler(self, evt, type, namespace, qualifier, callback, conf); - - if (ret === false) { - break; - } // allow exiting early - } - } -}; - -var makeEventObj = function makeEventObj(self, obj) { - return new Event(obj.type, util.assign(obj, self.eventFields(self.context))); -}; - -var forEachEventObj = function forEachEventObj(self, handler, events) { - if (is.event(events)) { - handler(self, events); - - return; - } else if (is.plainObject(events)) { - handler(self, makeEventObj(self, events)); - - return; - } - - var eventList = events.split(/\s+/); - - for (var i = 0; i < eventList.length; i++) { - var evt = eventList[i]; - - if (is.emptyString(evt)) { - continue; - } - - var match = evt.match(eventRegex); // type[.namespace] - - if (match) { - var type = match[1]; - var namespace = match[2] ? match[2] : null; - var eventObj = makeEventObj(self, { - type: type, - namespace: namespace, - target: self.context - }); - - handler(self, eventObj); - } - } -}; - -p.on = p.addListener = function (events, qualifier, callback, conf, confOverrides) { - forEachEvent(this, function (self, event, type, namespace, qualifier, callback, conf) { - if (is.fn(callback)) { - self.listeners.push({ - event: event, // full event string - callback: callback, // callback to run - type: type, // the event type (e.g. 'click') - namespace: namespace, // the event namespace (e.g. ".foo") - qualifier: qualifier, // a restriction on whether to match this emitter - conf: conf // additional configuration - }); - } - }, events, qualifier, callback, conf, confOverrides); - - return this; -}; - -p.one = function (events, qualifier, callback, conf) { - return this.on(events, qualifier, callback, conf, { one: true }); -}; - -p.removeListener = p.off = function (events, qualifier, callback, conf) { - var _this = this; - - if (this.emitting !== 0) { - this.listeners = util.copyArray(this.listeners); - } - - var listeners = this.listeners; - - var _loop = function _loop(i) { - var listener = listeners[i]; - - forEachEvent(_this, function (self, event, type, namespace, qualifier, callback /*, conf*/) { - if (listener.type === type && (!namespace || listener.namespace === namespace) && (!qualifier || self.qualifierCompare(listener.qualifier, qualifier)) && (!callback || listener.callback === callback)) { - listeners.splice(i, 1); - - return false; - } - }, events, qualifier, callback, conf); - }; - - for (var i = listeners.length - 1; i >= 0; i--) { - _loop(i); - } - - return this; -}; - -p.emit = p.trigger = function (events, extraParams, manualCallback) { - var listeners = this.listeners; - var numListenersBeforeEmit = listeners.length; - - this.emitting++; - - if (!is.array(extraParams)) { - extraParams = [extraParams]; - } - - forEachEventObj(this, function (self, eventObj) { - if (manualCallback != null) { - listeners = [{ - event: eventObj.event, - type: eventObj.type, - namespace: eventObj.namespace, - callback: manualCallback - }]; - - numListenersBeforeEmit = listeners.length; - } - - var _loop2 = function _loop2(i) { - var listener = listeners[i]; - - if (listener.type === eventObj.type && (!listener.namespace || listener.namespace === eventObj.namespace || listener.namespace === universalNamespace) && self.eventMatches(self.context, listener, eventObj)) { - var args = [eventObj]; - - if (extraParams != null) { - util.push(args, extraParams); - } - - self.beforeEmit(self.context, listener, eventObj); - - if (listener.conf && listener.conf.one) { - self.listeners = self.listeners.filter(function (l) { - return l !== listener; - }); - } - - var context = self.callbackContext(self.context, listener, eventObj); - var ret = listener.callback.apply(context, args); - - self.afterEmit(self.context, listener, eventObj); - - if (ret === false) { - eventObj.stopPropagation(); - eventObj.preventDefault(); - } - } // if listener matches - }; - - for (var i = 0; i < numListenersBeforeEmit; i++) { - _loop2(i); - } // for listener - - if (self.bubble(self.context) && !eventObj.isPropagationStopped()) { - self.parent(self.context).emit(eventObj, extraParams); - } - }, events); - - this.emitting--; - - return this; -}; - -module.exports = Emitter; - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var window = __webpack_require__(3); -var util = __webpack_require__(1); -var Collection = __webpack_require__(7); -var is = __webpack_require__(0); -var Promise = __webpack_require__(5); -var define = __webpack_require__(4); - -var Core = function Core(opts) { - var cy = this; - - opts = util.extend({}, opts); - - var container = opts.container; - - // allow for passing a wrapped jquery object - // e.g. cytoscape({ container: $('#cy') }) - if (container && !is.htmlElement(container) && is.htmlElement(container[0])) { - container = container[0]; - } - - var reg = container ? container._cyreg : null; // e.g. already registered some info (e.g. readies) via jquery - reg = reg || {}; - - if (reg && reg.cy) { - reg.cy.destroy(); - - reg = {}; // old instance => replace reg completely - } - - var readies = reg.readies = reg.readies || []; - - if (container) { - container._cyreg = reg; - } // make sure container assoc'd reg points to this cy - reg.cy = cy; - - var head = window !== undefined && container !== undefined && !opts.headless; - var options = opts; - options.layout = util.extend({ name: head ? 'grid' : 'null' }, options.layout); - options.renderer = util.extend({ name: head ? 'canvas' : 'null' }, options.renderer); - - var defVal = function defVal(def, val, altVal) { - if (val !== undefined) { - return val; - } else if (altVal !== undefined) { - return altVal; - } else { - return def; - } - }; - - var _p = this._private = { - container: container, // html dom ele container - ready: false, // whether ready has been triggered - options: options, // cached options - elements: new Collection(this), // elements in the graph - listeners: [], // list of listeners - aniEles: new Collection(this), // elements being animated - scratch: {}, // scratch object for core - layout: null, - renderer: null, - destroyed: false, // whether destroy was called - notificationsEnabled: true, // whether notifications are sent to the renderer - minZoom: 1e-50, - maxZoom: 1e50, - zoomingEnabled: defVal(true, options.zoomingEnabled), - userZoomingEnabled: defVal(true, options.userZoomingEnabled), - panningEnabled: defVal(true, options.panningEnabled), - userPanningEnabled: defVal(true, options.userPanningEnabled), - boxSelectionEnabled: defVal(true, options.boxSelectionEnabled), - autolock: defVal(false, options.autolock, options.autolockNodes), - autoungrabify: defVal(false, options.autoungrabify, options.autoungrabifyNodes), - autounselectify: defVal(false, options.autounselectify), - styleEnabled: options.styleEnabled === undefined ? head : options.styleEnabled, - zoom: is.number(options.zoom) ? options.zoom : 1, - pan: { - x: is.plainObject(options.pan) && is.number(options.pan.x) ? options.pan.x : 0, - y: is.plainObject(options.pan) && is.number(options.pan.y) ? options.pan.y : 0 - }, - animation: { // object for currently-running animations - current: [], - queue: [] - }, - hasCompoundNodes: false - }; - - this.createEmitter(); - - // set selection type - var selType = options.selectionType; - if (selType === undefined || selType !== 'additive' && selType !== 'single') { - // then set default - - _p.selectionType = 'single'; - } else { - _p.selectionType = selType; - } - - // init zoom bounds - if (is.number(options.minZoom) && is.number(options.maxZoom) && options.minZoom < options.maxZoom) { - _p.minZoom = options.minZoom; - _p.maxZoom = options.maxZoom; - } else if (is.number(options.minZoom) && options.maxZoom === undefined) { - _p.minZoom = options.minZoom; - } else if (is.number(options.maxZoom) && options.minZoom === undefined) { - _p.maxZoom = options.maxZoom; - } - - var loadExtData = function loadExtData(extData, next) { - var anyIsPromise = extData.some(is.promise); - - if (anyIsPromise) { - return Promise.all(extData).then(next); // load all data asynchronously, then exec rest of init - } else { - next(extData); // exec synchronously for convenience - } - }; - - // start with the default stylesheet so we have something before loading an external stylesheet - if (_p.styleEnabled) { - cy.setStyle([]); - } - - // create the renderer - cy.initRenderer(util.extend({ - hideEdgesOnViewport: options.hideEdgesOnViewport, - textureOnViewport: options.textureOnViewport, - wheelSensitivity: is.number(options.wheelSensitivity) && options.wheelSensitivity > 0 ? options.wheelSensitivity : 1, - motionBlur: options.motionBlur === undefined ? false : options.motionBlur, // off by default - motionBlurOpacity: options.motionBlurOpacity === undefined ? 0.05 : options.motionBlurOpacity, - pixelRatio: is.number(options.pixelRatio) && options.pixelRatio > 0 ? options.pixelRatio : undefined, - desktopTapThreshold: options.desktopTapThreshold === undefined ? 4 : options.desktopTapThreshold, - touchTapThreshold: options.touchTapThreshold === undefined ? 8 : options.touchTapThreshold - }, options.renderer)); - - var setElesAndLayout = function setElesAndLayout(elements, onload, ondone) { - cy.notifications(false); - - // remove old elements - var oldEles = cy.mutableElements(); - if (oldEles.length > 0) { - oldEles.remove(); - } - - if (elements != null) { - if (is.plainObject(elements) || is.array(elements)) { - cy.add(elements); - } - } - - cy.one('layoutready', function (e) { - cy.notifications(true); - cy.emit(e); // we missed this event by turning notifications off, so pass it on - - cy.notify({ - type: 'load', - eles: cy.mutableElements() - }); - - cy.one('load', onload); - cy.emit('load'); - }).one('layoutstop', function () { - cy.one('done', ondone); - cy.emit('done'); - }); - - var layoutOpts = util.extend({}, cy._private.options.layout); - layoutOpts.eles = cy.elements(); - - cy.layout(layoutOpts).run(); - }; - - loadExtData([options.style, options.elements], function (thens) { - var initStyle = thens[0]; - var initEles = thens[1]; - - // init style - if (_p.styleEnabled) { - cy.style().append(initStyle); - } - - // initial load - setElesAndLayout(initEles, function () { - // onready - cy.startAnimationLoop(); - _p.ready = true; - - // if a ready callback is specified as an option, the bind it - if (is.fn(options.ready)) { - cy.on('ready', options.ready); - } - - // bind all the ready handlers registered before creating this instance - for (var i = 0; i < readies.length; i++) { - var fn = readies[i]; - cy.on('ready', fn); - } - if (reg) { - reg.readies = []; - } // clear b/c we've bound them all and don't want to keep it around in case a new core uses the same div etc - - cy.emit('ready'); - }, options.done); - }); -}; - -var corefn = Core.prototype; // short alias - -util.extend(corefn, { - instanceString: function instanceString() { - return 'core'; - }, - - isReady: function isReady() { - return this._private.ready; - }, - - isDestroyed: function isDestroyed() { - return this._private.destroyed; - }, - - ready: function ready(fn) { - if (this.isReady()) { - this.emitter().emit('ready', [], fn); // just calls fn as though triggered via ready event - } else { - this.on('ready', fn); - } - - return this; - }, - - destroy: function destroy() { - var cy = this; - if (cy.isDestroyed()) return; - - cy.stopAnimationLoop(); - - cy.destroyRenderer(); - - this.emit('destroy'); - - cy._private.destroyed = true; - - return cy; - }, - - hasElementWithId: function hasElementWithId(id) { - return this._private.elements.hasElementWithId(id); - }, - - getElementById: function getElementById(id) { - return this._private.elements.getElementById(id); - }, - - selectionType: function selectionType() { - return this._private.selectionType; - }, - - hasCompoundNodes: function hasCompoundNodes() { - return this._private.hasCompoundNodes; - }, - - headless: function headless() { - return this._private.options.renderer.name === 'null'; - }, - - styleEnabled: function styleEnabled() { - return this._private.styleEnabled; - }, - - addToPool: function addToPool(eles) { - this._private.elements.merge(eles); - - return this; // chaining - }, - - removeFromPool: function removeFromPool(eles) { - this._private.elements.unmerge(eles); - - return this; - }, - - container: function container() { - return this._private.container; - }, - - options: function options() { - return util.copy(this._private.options); - }, - - json: function json(obj) { - var cy = this; - var _p = cy._private; - var eles = cy.mutableElements(); - - if (is.plainObject(obj)) { - // set - - cy.startBatch(); - - if (obj.elements) { - var idInJson = {}; - - var updateEles = function updateEles(jsons, gr) { - for (var i = 0; i < jsons.length; i++) { - var json = jsons[i]; - var id = json.data.id; - var ele = cy.getElementById(id); - - idInJson[id] = true; - - if (ele.length !== 0) { - // existing element should be updated - ele.json(json); - } else { - // otherwise should be added - if (gr) { - cy.add(util.extend({ group: gr }, json)); - } else { - cy.add(json); - } - } - } - }; - - if (is.array(obj.elements)) { - // elements: [] - updateEles(obj.elements); - } else { - // elements: { nodes: [], edges: [] } - var grs = ['nodes', 'edges']; - for (var i = 0; i < grs.length; i++) { - var gr = grs[i]; - var elements = obj.elements[gr]; - - if (is.array(elements)) { - updateEles(elements, gr); - } - } - } - - // elements not specified in json should be removed - eles.stdFilter(function (ele) { - return !idInJson[ele.id()]; - }).remove(); - } - - if (obj.style) { - cy.style(obj.style); - } - - if (obj.zoom != null && obj.zoom !== _p.zoom) { - cy.zoom(obj.zoom); - } - - if (obj.pan) { - if (obj.pan.x !== _p.pan.x || obj.pan.y !== _p.pan.y) { - cy.pan(obj.pan); - } - } - - var fields = ['minZoom', 'maxZoom', 'zoomingEnabled', 'userZoomingEnabled', 'panningEnabled', 'userPanningEnabled', 'boxSelectionEnabled', 'autolock', 'autoungrabify', 'autounselectify']; - - for (var _i = 0; _i < fields.length; _i++) { - var f = fields[_i]; - - if (obj[f] != null) { - cy[f](obj[f]); - } - } - - cy.endBatch(); - - return this; // chaining - } else if (obj === undefined) { - // get - var json = {}; - - json.elements = {}; - eles.forEach(function (ele) { - var group = ele.group(); - - if (!json.elements[group]) { - json.elements[group] = []; - } - - json.elements[group].push(ele.json()); - }); - - if (this._private.styleEnabled) { - json.style = cy.style().json(); - } - - json.zoomingEnabled = cy._private.zoomingEnabled; - json.userZoomingEnabled = cy._private.userZoomingEnabled; - json.zoom = cy._private.zoom; - json.minZoom = cy._private.minZoom; - json.maxZoom = cy._private.maxZoom; - json.panningEnabled = cy._private.panningEnabled; - json.userPanningEnabled = cy._private.userPanningEnabled; - json.pan = util.copy(cy._private.pan); - json.boxSelectionEnabled = cy._private.boxSelectionEnabled; - json.renderer = util.copy(cy._private.options.renderer); - json.hideEdgesOnViewport = cy._private.options.hideEdgesOnViewport; - json.textureOnViewport = cy._private.options.textureOnViewport; - json.wheelSensitivity = cy._private.options.wheelSensitivity; - json.motionBlur = cy._private.options.motionBlur; - - return json; - } - }, - - scratch: define.data({ - field: 'scratch', - bindingEvent: 'scratch', - allowBinding: true, - allowSetting: true, - settingEvent: 'scratch', - settingTriggersEvent: true, - triggerFnName: 'trigger', - allowGetting: true - }), - - removeScratch: define.removeData({ - field: 'scratch', - event: 'scratch', - triggerFnName: 'trigger', - triggerEvent: true - }) - -}); - -corefn.$id = corefn.getElementById; - -[__webpack_require__(69), __webpack_require__(70), __webpack_require__(78), __webpack_require__(79), __webpack_require__(80), __webpack_require__(81), __webpack_require__(82), __webpack_require__(83), __webpack_require__(84), __webpack_require__(93)].forEach(function (props) { - util.extend(corefn, props); -}); - -module.exports = Core; - -/***/ }), -/* 13 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = function memoize(fn, keyFn) { - if (!keyFn) { - keyFn = function keyFn() { - if (arguments.length === 1) { - return arguments[0]; - } else if (arguments.length === 0) { - return 'undefined'; - } - - var args = []; - - for (var i = 0; i < arguments.length; i++) { - args.push(arguments[i]); - } - - return args.join('$'); - }; - } - - var memoizedFn = function memoizedFn() { - var self = this; - var args = arguments; - var ret = void 0; - var k = keyFn.apply(self, args); - var cache = memoizedFn.cache; - - if (!(ret = cache[k])) { - ret = cache[k] = fn.apply(self, args); - } - - return ret; - }; - - memoizedFn.cache = {}; - - return memoizedFn; -}; - -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var is = __webpack_require__(0); -var Set = __webpack_require__(8); - -// represents a node or an edge -var Element = function Element(cy, params, restore) { - restore = restore === undefined || restore ? true : false; - - if (cy === undefined || params === undefined || !is.core(cy)) { - util.error('An element must have a core reference and parameters set'); - return; - } - - var group = params.group; - - // try to automatically infer the group if unspecified - if (group == null) { - if (params.data && params.data.source != null && params.data.target != null) { - group = 'edges'; - } else { - group = 'nodes'; - } - } - - // validate group - if (group !== 'nodes' && group !== 'edges') { - util.error('An element must be of type `nodes` or `edges`; you specified `' + group + '`'); - return; - } - - // make the element array-like, just like a collection - this.length = 1; - this[0] = this; - - // NOTE: when something is added here, add also to ele.json() - var _p = this._private = { - cy: cy, - single: true, // indicates this is an element - data: params.data || {}, // data object - position: params.position || {}, // (x, y) position pair - autoWidth: undefined, // width and height of nodes calculated by the renderer when set to special 'auto' value - autoHeight: undefined, - autoPadding: undefined, - compoundBoundsClean: false, // whether the compound dimensions need to be recalculated the next time dimensions are read - listeners: [], // array of bound listeners - group: group, // string; 'nodes' or 'edges' - style: {}, // properties as set by the style - rstyle: {}, // properties for style sent from the renderer to the core - styleCxts: [], // applied style contexts from the styler - removed: true, // whether it's inside the vis; true if removed (set true here since we call restore) - selected: params.selected ? true : false, // whether it's selected - selectable: params.selectable === undefined ? true : params.selectable ? true : false, // whether it's selectable - locked: params.locked ? true : false, // whether the element is locked (cannot be moved) - grabbed: false, // whether the element is grabbed by the mouse; renderer sets this privately - grabbable: params.grabbable === undefined ? true : params.grabbable ? true : false, // whether the element can be grabbed - active: false, // whether the element is active from user interaction - classes: new Set(), // map ( className => true ) - animation: { // object for currently-running animations - current: [], - queue: [] - }, - rscratch: {}, // object in which the renderer can store information - scratch: params.scratch || {}, // scratch objects - edges: [], // array of connected edges - children: [], // array of children - parent: null, // parent ref - traversalCache: {}, // cache of output of traversal functions - backgrounding: false // whether background images are loading - }; - - // renderedPosition overrides if specified - if (params.renderedPosition) { - var rpos = params.renderedPosition; - var pan = cy.pan(); - var zoom = cy.zoom(); - - _p.position = { - x: (rpos.x - pan.x) / zoom, - y: (rpos.y - pan.y) / zoom - }; - } - - if (is.string(params.classes)) { - var classes = params.classes.split(/\s+/); - for (var i = 0, l = classes.length; i < l; i++) { - var cls = classes[i]; - if (!cls || cls === '') { - continue; - } - - _p.classes.add(cls); - } - } - - if (params.style || params.css) { - cy.style().applyBypass(this, params.style || params.css); - } - - this.createEmitter(); - - if (restore === undefined || restore) { - this.restore(); - } -}; - -module.exports = Element; - -/***/ }), -/* 15 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); - -var stateSelectors = [{ - selector: ':selected', - matches: function matches(ele) { - return ele.selected(); - } -}, { - selector: ':unselected', - matches: function matches(ele) { - return !ele.selected(); - } -}, { - selector: ':selectable', - matches: function matches(ele) { - return ele.selectable(); - } -}, { - selector: ':unselectable', - matches: function matches(ele) { - return !ele.selectable(); - } -}, { - selector: ':locked', - matches: function matches(ele) { - return ele.locked(); - } -}, { - selector: ':unlocked', - matches: function matches(ele) { - return !ele.locked(); - } -}, { - selector: ':visible', - matches: function matches(ele) { - return ele.visible(); - } -}, { - selector: ':hidden', - matches: function matches(ele) { - return !ele.visible(); - } -}, { - selector: ':transparent', - matches: function matches(ele) { - return ele.transparent(); - } -}, { - selector: ':grabbed', - matches: function matches(ele) { - return ele.grabbed(); - } -}, { - selector: ':free', - matches: function matches(ele) { - return !ele.grabbed(); - } -}, { - selector: ':removed', - matches: function matches(ele) { - return ele.removed(); - } -}, { - selector: ':inside', - matches: function matches(ele) { - return !ele.removed(); - } -}, { - selector: ':grabbable', - matches: function matches(ele) { - return ele.grabbable(); - } -}, { - selector: ':ungrabbable', - matches: function matches(ele) { - return !ele.grabbable(); - } -}, { - selector: ':animated', - matches: function matches(ele) { - return ele.animated(); - } -}, { - selector: ':unanimated', - matches: function matches(ele) { - return !ele.animated(); - } -}, { - selector: ':parent', - matches: function matches(ele) { - return ele.isParent(); - } -}, { - selector: ':childless', - matches: function matches(ele) { - return ele.isChildless(); - } -}, { - selector: ':child', - matches: function matches(ele) { - return ele.isChild(); - } -}, { - selector: ':orphan', - matches: function matches(ele) { - return ele.isOrphan(); - } -}, { - selector: ':nonorphan', - matches: function matches(ele) { - return ele.isChild(); - } -}, { - selector: ':loop', - matches: function matches(ele) { - return ele.isLoop(); - } -}, { - selector: ':simple', - matches: function matches(ele) { - return ele.isSimple(); - } -}, { - selector: ':active', - matches: function matches(ele) { - return ele.active(); - } -}, { - selector: ':inactive', - matches: function matches(ele) { - return !ele.active(); - } -}, { - selector: ':backgrounding', - matches: function matches(ele) { - return ele.backgrounding(); - } -}, { - selector: ':nonbackgrounding', - matches: function matches(ele) { - return !ele.backgrounding(); - } -}].sort(function (a, b) { - // n.b. selectors that are starting substrings of others must have the longer ones first - return util.sort.descending(a.selector, b.selector); -}); - -var stateSelectorMatches = function stateSelectorMatches(sel, ele) { - var lookup = stateSelectorMatches.lookup = stateSelectorMatches.lookup || function () { - var selToFn = {}; - var s = void 0; - - for (var i = 0; i < stateSelectors.length; i++) { - s = stateSelectors[i]; - - selToFn[s.selector] = s.matches; - } - - return selToFn; - }(); - - return lookup[sel](ele); -}; - -var stateSelectorRegex = '(' + stateSelectors.map(function (s) { - return s.selector; -}).join('|') + ')'; - -module.exports = { stateSelectors: stateSelectors, stateSelectorMatches: stateSelectorMatches, stateSelectorRegex: stateSelectorRegex }; - -/***/ }), -/* 16 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/*! -Event object based on jQuery events, MIT license - -https://jquery.org/license/ -https://tldrlegal.com/license/mit-license -https://github.com/jquery/jquery/blob/master/src/event.js -*/ - -var Event = function Event(src, props) { - this.recycle(src, props); -}; - -function returnFalse() { - return false; -} - -function returnTrue() { - return true; -} - -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -Event.prototype = { - instanceString: function instanceString() { - return 'event'; - }, - - recycle: function recycle(src, props) { - this.isImmediatePropagationStopped = this.isPropagationStopped = this.isDefaultPrevented = returnFalse; - - if (src != null && src.preventDefault) { - // Browser Event object - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented ? returnTrue : returnFalse; - } else if (src != null && src.type) { - // Plain object containing all event details - props = src; - } else { - // Event string - this.type = src; - } - - // Put explicitly provided properties onto the event object - if (props != null) { - // more efficient to manually copy fields we use - this.originalEvent = props.originalEvent; - this.type = props.type != null ? props.type : this.type; - this.cy = props.cy; - this.target = props.target; - this.position = props.position; - this.renderedPosition = props.renderedPosition; - this.namespace = props.namespace; - this.layout = props.layout; - } - - if (this.cy != null && this.position != null && this.renderedPosition == null) { - // create a rendered position based on the passed position - var pos = this.position; - var zoom = this.cy.zoom(); - var pan = this.cy.pan(); - - this.renderedPosition = { - x: pos.x * zoom + pan.x, - y: pos.y * zoom + pan.y - }; - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || Date.now(); - }, - - preventDefault: function preventDefault() { - this.isDefaultPrevented = returnTrue; - - var e = this.originalEvent; - if (!e) { - return; - } - - // if preventDefault exists run it on the original event - if (e.preventDefault) { - e.preventDefault(); - } - }, - - stopPropagation: function stopPropagation() { - this.isPropagationStopped = returnTrue; - - var e = this.originalEvent; - if (!e) { - return; - } - - // if stopPropagation exists run it on the original event - if (e.stopPropagation) { - e.stopPropagation(); - } - }, - - stopImmediatePropagation: function stopImmediatePropagation() { - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - }, - - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse -}; - -module.exports = Event; - -/***/ }), -/* 17 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Elements are drawn in a specific order based on compound depth (low to high), the element type (nodes above edges), - * and z-index (low to high). These styles affect how this applies: - * - * z-compound-depth: May be `bottom | orphan | auto | top`. The first drawn is `bottom`, then `orphan` which is the - * same depth as the root of the compound graph, followed by the default value `auto` which draws in order from - * root to leaves of the compound graph. The last drawn is `top`. - * z-index-compare: May be `auto | manual`. The default value is `auto` which always draws edges under nodes. - * `manual` ignores this convention and draws based on the `z-index` value setting. - * z-index: An integer value that affects the relative draw order of elements. In general, an element with a higher - * `z-index` will be drawn on top of an element with a lower `z-index`. - */ -var util = __webpack_require__(1); - -var zIndexSort = function zIndexSort(a, b) { - var cy = a.cy(); - var hasCompoundNodes = cy.hasCompoundNodes(); - - function getDepth(ele) { - var style = ele.pstyle('z-compound-depth'); - if (style.value === 'auto') { - return hasCompoundNodes ? ele.zDepth() : 0; - } else if (style.value === 'bottom') { - return -1; - } else if (style.value === 'top') { - return util.MAX_INT; - } - // 'orphan' - return 0; - } - var depthDiff = getDepth(a) - getDepth(b); - if (depthDiff !== 0) { - return depthDiff; - } - - function getEleDepth(ele) { - var style = ele.pstyle('z-index-compare'); - if (style.value === 'auto') { - return ele.isNode() ? 1 : 0; - } - // 'manual' - return 0; - } - var eleDiff = getEleDepth(a) - getEleDepth(b); - if (eleDiff !== 0) { - return eleDiff; - } - - var zDiff = a.pstyle('z-index').value - b.pstyle('z-index').value; - if (zDiff !== 0) { - return zDiff; - } - // compare indices in the core (order added to graph w/ last on top) - return a.poolIndex() - b.poolIndex(); -}; - -module.exports = zIndexSort; - -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var util = __webpack_require__(1); -var Selector = __webpack_require__(6); - -var Style = function Style(cy) { - - if (!(this instanceof Style)) { - return new Style(cy); - } - - if (!is.core(cy)) { - util.error('A style must have a core reference'); - return; - } - - this._private = { - cy: cy, - coreStyle: {} - }; - - this.length = 0; - - this.resetToDefault(); -}; - -var styfn = Style.prototype; - -styfn.instanceString = function () { - return 'style'; -}; - -// remove all contexts -styfn.clear = function () { - for (var i = 0; i < this.length; i++) { - this[i] = undefined; - } - this.length = 0; - - var _p = this._private; - - _p.newStyle = true; - - return this; // chaining -}; - -styfn.resetToDefault = function () { - this.clear(); - this.addDefaultStylesheet(); - - return this; -}; - -// builds a style object for the 'core' selector -styfn.core = function () { - return this._private.coreStyle; -}; - -// create a new context from the specified selector string and switch to that context -styfn.selector = function (selectorStr) { - // 'core' is a special case and does not need a selector - var selector = selectorStr === 'core' ? null : new Selector(selectorStr); - - var i = this.length++; // new context means new index - this[i] = { - selector: selector, - properties: [], - mappedProperties: [], - index: i - }; - - return this; // chaining -}; - -// add one or many css rules to the current context -styfn.css = function () { - var self = this; - var args = arguments; - - switch (args.length) { - case 1: - var map = args[0]; - - for (var i = 0; i < self.properties.length; i++) { - var prop = self.properties[i]; - var mapVal = map[prop.name]; - - if (mapVal === undefined) { - mapVal = map[util.dash2camel(prop.name)]; - } - - if (mapVal !== undefined) { - this.cssRule(prop.name, mapVal); - } - } - - break; - - case 2: - this.cssRule(args[0], args[1]); - break; - - default: - break; // do nothing if args are invalid - } - - return this; // chaining -}; -styfn.style = styfn.css; - -// add a single css rule to the current context -styfn.cssRule = function (name, value) { - // name-value pair - var property = this.parse(name, value); - - // add property to current context if valid - if (property) { - var i = this.length - 1; - this[i].properties.push(property); - this[i].properties[property.name] = property; // allow access by name as well - - if (property.name.match(/pie-(\d+)-background-size/) && property.value) { - this._private.hasPie = true; - } - - if (property.mapped) { - this[i].mappedProperties.push(property); - } - - // add to core style if necessary - var currentSelectorIsCore = !this[i].selector; - if (currentSelectorIsCore) { - this._private.coreStyle[property.name] = property; - } - } - - return this; // chaining -}; - -styfn.append = function (style) { - if (is.stylesheet(style)) { - style.appendToStyle(this); - } else if (is.array(style)) { - this.appendFromJson(style); - } else if (is.string(style)) { - this.appendFromString(style); - } // you probably wouldn't want to append a Style, since you'd duplicate the default parts - - return this; -}; - -// static function -Style.fromJson = function (cy, json) { - var style = new Style(cy); - - style.fromJson(json); - - return style; -}; - -Style.fromString = function (cy, string) { - return new Style(cy).fromString(string); -}; - -[__webpack_require__(85), __webpack_require__(86), __webpack_require__(87), __webpack_require__(88), __webpack_require__(89), __webpack_require__(90), __webpack_require__(91), __webpack_require__(92)].forEach(function (props) { - util.extend(styfn, props); -}); - -Style.types = styfn.types; -Style.properties = styfn.properties; - -module.exports = Style; - -/***/ }), -/* 19 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); - -var fullFpsTime = 1000 / 60; // assume 60 frames per second - -module.exports = { - setupDequeueing: function setupDequeueing(opts) { - return function setupDequeueingImpl() { - var self = this; - var r = this.renderer; - - if (self.dequeueingSetup) { - return; - } else { - self.dequeueingSetup = true; - } - - var queueRedraw = util.debounce(function () { - r.redrawHint('eles', true); - r.redrawHint('drag', true); - - r.redraw(); - }, opts.deqRedrawThreshold); - - var dequeue = function dequeue(willDraw, frameStartTime) { - var startTime = util.performanceNow(); - var avgRenderTime = r.averageRedrawTime; - var renderTime = r.lastRedrawTime; - var deqd = []; - var extent = r.cy.extent(); - var pixelRatio = r.getPixelRatio(); - - while (true) { - var now = util.performanceNow(); - var duration = now - startTime; - var frameDuration = now - frameStartTime; - - if (renderTime < fullFpsTime) { - // if we're rendering faster than the ideal fps, then do dequeueing - // during all of the remaining frame time - - var timeAvailable = fullFpsTime - (willDraw ? avgRenderTime : 0); - - if (frameDuration >= opts.deqFastCost * timeAvailable) { - break; - } - } else { - if (willDraw) { - if (duration >= opts.deqCost * renderTime || duration >= opts.deqAvgCost * avgRenderTime) { - break; - } - } else if (frameDuration >= opts.deqNoDrawCost * fullFpsTime) { - break; - } - } - - var thisDeqd = opts.deq(self, pixelRatio, extent); - - if (thisDeqd.length > 0) { - for (var i = 0; i < thisDeqd.length; i++) { - deqd.push(thisDeqd[i]); - } - } else { - break; - } - } - - // callbacks on dequeue - if (deqd.length > 0) { - opts.onDeqd(self, deqd); - - if (!willDraw && opts.shouldRedraw(self, deqd, pixelRatio, extent)) { - queueRedraw(); - } - } - }; - - var priority = opts.priority || util.noop; - - r.beforeRender(dequeue, priority(self)); - }; - } -}; - -/***/ }), -/* 20 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var Core = __webpack_require__(12); -var extension = __webpack_require__(94); -var Stylesheet = __webpack_require__(136); - -var cytoscape = function cytoscape(options) { - // jshint ignore:line - // if no options specified, use default - if (options === undefined) { - options = {}; - } - - // create instance - if (is.plainObject(options)) { - return new Core(options); - } - - // allow for registration of extensions - else if (is.string(options)) { - return extension.apply(extension, arguments); - } -}; - -// e.g. cytoscape.use( require('cytoscape-foo'), bar ) -cytoscape.use = function (ext) { - var args = Array.prototype.slice.call(arguments, 1); // args to pass to ext - - args.unshift(cytoscape); // cytoscape is first arg to ext - - ext.apply(null, args); - - return this; -}; - -// replaced by build system -cytoscape.version = __webpack_require__(137); - -// expose public apis (mostly for extensions) -cytoscape.stylesheet = cytoscape.Stylesheet = Stylesheet; - -module.exports = cytoscape; - -/***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); - -module.exports = { - // get [r, g, b] from #abc or #aabbcc - hex2tuple: function hex2tuple(hex) { - if (!(hex.length === 4 || hex.length === 7) || hex[0] !== '#') { - return; - } - - var shortHex = hex.length === 4; - var r = void 0, - g = void 0, - b = void 0; - var base = 16; - - if (shortHex) { - r = parseInt(hex[1] + hex[1], base); - g = parseInt(hex[2] + hex[2], base); - b = parseInt(hex[3] + hex[3], base); - } else { - r = parseInt(hex[1] + hex[2], base); - g = parseInt(hex[3] + hex[4], base); - b = parseInt(hex[5] + hex[6], base); - } - - return [r, g, b]; - }, - - // get [r, g, b, a] from hsl(0, 0, 0) or hsla(0, 0, 0, 0) - hsl2tuple: function hsl2tuple(hsl) { - var ret = void 0; - var h = void 0, - s = void 0, - l = void 0, - a = void 0, - r = void 0, - g = void 0, - b = void 0; - function hue2rgb(p, q, t) { - if (t < 0) t += 1; - if (t > 1) t -= 1; - if (t < 1 / 6) return p + (q - p) * 6 * t; - if (t < 1 / 2) return q; - if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6; - return p; - } - - var m = new RegExp('^' + this.regex.hsla + '$').exec(hsl); - if (m) { - - // get hue - h = parseInt(m[1]); - if (h < 0) { - h = (360 - -1 * h % 360) % 360; - } else if (h > 360) { - h = h % 360; - } - h /= 360; // normalise on [0, 1] - - s = parseFloat(m[2]); - if (s < 0 || s > 100) { - return; - } // saturation is [0, 100] - s = s / 100; // normalise on [0, 1] - - l = parseFloat(m[3]); - if (l < 0 || l > 100) { - return; - } // lightness is [0, 100] - l = l / 100; // normalise on [0, 1] - - a = m[4]; - if (a !== undefined) { - a = parseFloat(a); - - if (a < 0 || a > 1) { - return; - } // alpha is [0, 1] - } - - // now, convert to rgb - // code from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript - if (s === 0) { - r = g = b = Math.round(l * 255); // achromatic - } else { - var q = l < 0.5 ? l * (1 + s) : l + s - l * s; - var p = 2 * l - q; - r = Math.round(255 * hue2rgb(p, q, h + 1 / 3)); - g = Math.round(255 * hue2rgb(p, q, h)); - b = Math.round(255 * hue2rgb(p, q, h - 1 / 3)); - } - - ret = [r, g, b, a]; - } - - return ret; - }, - - // get [r, g, b, a] from rgb(0, 0, 0) or rgba(0, 0, 0, 0) - rgb2tuple: function rgb2tuple(rgb) { - var ret = void 0; - - var m = new RegExp('^' + this.regex.rgba + '$').exec(rgb); - if (m) { - ret = []; - - var isPct = []; - for (var i = 1; i <= 3; i++) { - var channel = m[i]; - - if (channel[channel.length - 1] === '%') { - isPct[i] = true; - } - channel = parseFloat(channel); - - if (isPct[i]) { - channel = channel / 100 * 255; // normalise to [0, 255] - } - - if (channel < 0 || channel > 255) { - return; - } // invalid channel value - - ret.push(Math.floor(channel)); - } - - var atLeastOneIsPct = isPct[1] || isPct[2] || isPct[3]; - var allArePct = isPct[1] && isPct[2] && isPct[3]; - if (atLeastOneIsPct && !allArePct) { - return; - } // must all be percent values if one is - - var alpha = m[4]; - if (alpha !== undefined) { - alpha = parseFloat(alpha); - - if (alpha < 0 || alpha > 1) { - return; - } // invalid alpha value - - ret.push(alpha); - } - } - - return ret; - }, - - colorname2tuple: function colorname2tuple(color) { - return this.colors[color.toLowerCase()]; - }, - - color2tuple: function color2tuple(color) { - return (is.array(color) ? color : null) || this.colorname2tuple(color) || this.hex2tuple(color) || this.rgb2tuple(color) || this.hsl2tuple(color); - }, - - colors: { - // special colour names - transparent: [0, 0, 0, 0], // NB alpha === 0 - - // regular colours - aliceblue: [240, 248, 255], - antiquewhite: [250, 235, 215], - aqua: [0, 255, 255], - aquamarine: [127, 255, 212], - azure: [240, 255, 255], - beige: [245, 245, 220], - bisque: [255, 228, 196], - black: [0, 0, 0], - blanchedalmond: [255, 235, 205], - blue: [0, 0, 255], - blueviolet: [138, 43, 226], - brown: [165, 42, 42], - burlywood: [222, 184, 135], - cadetblue: [95, 158, 160], - chartreuse: [127, 255, 0], - chocolate: [210, 105, 30], - coral: [255, 127, 80], - cornflowerblue: [100, 149, 237], - cornsilk: [255, 248, 220], - crimson: [220, 20, 60], - cyan: [0, 255, 255], - darkblue: [0, 0, 139], - darkcyan: [0, 139, 139], - darkgoldenrod: [184, 134, 11], - darkgray: [169, 169, 169], - darkgreen: [0, 100, 0], - darkgrey: [169, 169, 169], - darkkhaki: [189, 183, 107], - darkmagenta: [139, 0, 139], - darkolivegreen: [85, 107, 47], - darkorange: [255, 140, 0], - darkorchid: [153, 50, 204], - darkred: [139, 0, 0], - darksalmon: [233, 150, 122], - darkseagreen: [143, 188, 143], - darkslateblue: [72, 61, 139], - darkslategray: [47, 79, 79], - darkslategrey: [47, 79, 79], - darkturquoise: [0, 206, 209], - darkviolet: [148, 0, 211], - deeppink: [255, 20, 147], - deepskyblue: [0, 191, 255], - dimgray: [105, 105, 105], - dimgrey: [105, 105, 105], - dodgerblue: [30, 144, 255], - firebrick: [178, 34, 34], - floralwhite: [255, 250, 240], - forestgreen: [34, 139, 34], - fuchsia: [255, 0, 255], - gainsboro: [220, 220, 220], - ghostwhite: [248, 248, 255], - gold: [255, 215, 0], - goldenrod: [218, 165, 32], - gray: [128, 128, 128], - grey: [128, 128, 128], - green: [0, 128, 0], - greenyellow: [173, 255, 47], - honeydew: [240, 255, 240], - hotpink: [255, 105, 180], - indianred: [205, 92, 92], - indigo: [75, 0, 130], - ivory: [255, 255, 240], - khaki: [240, 230, 140], - lavender: [230, 230, 250], - lavenderblush: [255, 240, 245], - lawngreen: [124, 252, 0], - lemonchiffon: [255, 250, 205], - lightblue: [173, 216, 230], - lightcoral: [240, 128, 128], - lightcyan: [224, 255, 255], - lightgoldenrodyellow: [250, 250, 210], - lightgray: [211, 211, 211], - lightgreen: [144, 238, 144], - lightgrey: [211, 211, 211], - lightpink: [255, 182, 193], - lightsalmon: [255, 160, 122], - lightseagreen: [32, 178, 170], - lightskyblue: [135, 206, 250], - lightslategray: [119, 136, 153], - lightslategrey: [119, 136, 153], - lightsteelblue: [176, 196, 222], - lightyellow: [255, 255, 224], - lime: [0, 255, 0], - limegreen: [50, 205, 50], - linen: [250, 240, 230], - magenta: [255, 0, 255], - maroon: [128, 0, 0], - mediumaquamarine: [102, 205, 170], - mediumblue: [0, 0, 205], - mediumorchid: [186, 85, 211], - mediumpurple: [147, 112, 219], - mediumseagreen: [60, 179, 113], - mediumslateblue: [123, 104, 238], - mediumspringgreen: [0, 250, 154], - mediumturquoise: [72, 209, 204], - mediumvioletred: [199, 21, 133], - midnightblue: [25, 25, 112], - mintcream: [245, 255, 250], - mistyrose: [255, 228, 225], - moccasin: [255, 228, 181], - navajowhite: [255, 222, 173], - navy: [0, 0, 128], - oldlace: [253, 245, 230], - olive: [128, 128, 0], - olivedrab: [107, 142, 35], - orange: [255, 165, 0], - orangered: [255, 69, 0], - orchid: [218, 112, 214], - palegoldenrod: [238, 232, 170], - palegreen: [152, 251, 152], - paleturquoise: [175, 238, 238], - palevioletred: [219, 112, 147], - papayawhip: [255, 239, 213], - peachpuff: [255, 218, 185], - peru: [205, 133, 63], - pink: [255, 192, 203], - plum: [221, 160, 221], - powderblue: [176, 224, 230], - purple: [128, 0, 128], - red: [255, 0, 0], - rosybrown: [188, 143, 143], - royalblue: [65, 105, 225], - saddlebrown: [139, 69, 19], - salmon: [250, 128, 114], - sandybrown: [244, 164, 96], - seagreen: [46, 139, 87], - seashell: [255, 245, 238], - sienna: [160, 82, 45], - silver: [192, 192, 192], - skyblue: [135, 206, 235], - slateblue: [106, 90, 205], - slategray: [112, 128, 144], - slategrey: [112, 128, 144], - snow: [255, 250, 250], - springgreen: [0, 255, 127], - steelblue: [70, 130, 180], - tan: [210, 180, 140], - teal: [0, 128, 128], - thistle: [216, 191, 216], - tomato: [255, 99, 71], - turquoise: [64, 224, 208], - violet: [238, 130, 238], - wheat: [245, 222, 179], - white: [255, 255, 255], - whitesmoke: [245, 245, 245], - yellow: [255, 255, 0], - yellowgreen: [154, 205, 50] - } -}; - -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); - -module.exports = { - // has anything been set in the map - mapEmpty: function mapEmpty(map) { - var empty = true; - - if (map != null) { - return Object.keys(map).length === 0; - } - - return empty; - }, - - // pushes to the array at the end of a map (map may not be built) - pushMap: function pushMap(options) { - var array = this.getMap(options); - - if (array == null) { - // if empty, put initial array - this.setMap(this.extend({}, options, { - value: [options.value] - })); - } else { - array.push(options.value); - } - }, - - // sets the value in a map (map may not be built) - setMap: function setMap(options) { - var obj = options.map; - var key = void 0; - var keys = options.keys; - var l = keys.length; - - for (var i = 0; i < l; i++) { - var _key = keys[i]; - - if (is.plainObject(_key)) { - this.error('Tried to set map with object key'); - } - - if (i < keys.length - 1) { - - // extend the map if necessary - if (obj[_key] == null) { - obj[_key] = {}; - } - - obj = obj[_key]; - } else { - // set the value - obj[_key] = options.value; - } - } - }, - - // gets the value in a map even if it's not built in places - getMap: function getMap(options) { - var obj = options.map; - var keys = options.keys; - var l = keys.length; - - for (var i = 0; i < l; i++) { - var key = keys[i]; - - if (is.plainObject(key)) { - this.error('Tried to get map with object key'); - } - - obj = obj[key]; - - if (obj == null) { - return obj; - } - } - - return obj; - }, - - // deletes the entry in the map - deleteMap: function deleteMap(options) { - var obj = options.map; - var keys = options.keys; - var l = keys.length; - var keepChildren = options.keepChildren; - - for (var i = 0; i < l; i++) { - var key = keys[i]; - - if (is.plainObject(key)) { - this.error('Tried to delete map with object key'); - } - - var lastKey = i === options.keys.length - 1; - if (lastKey) { - - if (keepChildren) { - // then only delete child fields not in keepChildren - var children = Object.keys(obj); - - for (var j = 0; j < children.length; j++) { - var child = children[j]; - - if (!keepChildren[child]) { - obj[child] = undefined; - } - } - } else { - obj[key] = undefined; - } - } else { - obj = obj[key]; - } - } - } -}; - -/***/ }), -/* 23 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var number = '(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))'; - -var rgba = 'rgb[a]?\\((' + number + '[%]?)\\s*,\\s*(' + number + '[%]?)\\s*,\\s*(' + number + '[%]?)(?:\\s*,\\s*(' + number + '))?\\)'; -var rgbaNoBackRefs = 'rgb[a]?\\((?:' + number + '[%]?)\\s*,\\s*(?:' + number + '[%]?)\\s*,\\s*(?:' + number + '[%]?)(?:\\s*,\\s*(?:' + number + '))?\\)'; - -var hsla = 'hsl[a]?\\((' + number + ')\\s*,\\s*(' + number + '[%])\\s*,\\s*(' + number + '[%])(?:\\s*,\\s*(' + number + '))?\\)'; -var hslaNoBackRefs = 'hsl[a]?\\((?:' + number + ')\\s*,\\s*(?:' + number + '[%])\\s*,\\s*(?:' + number + '[%])(?:\\s*,\\s*(?:' + number + '))?\\)'; - -var hex3 = '\\#[0-9a-fA-F]{3}'; -var hex6 = '\\#[0-9a-fA-F]{6}'; - -module.exports = { - regex: { - number: number, - rgba: rgba, - rgbaNoBackRefs: rgbaNoBackRefs, - hsla: hsla, - hslaNoBackRefs: hslaNoBackRefs, - hex3: hex3, - hex6: hex6 - } -}; - -/***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var memoize = __webpack_require__(13); -var is = __webpack_require__(0); - -module.exports = { - - camel2dash: memoize(function (str) { - return str.replace(/([A-Z])/g, function (v) { - return '-' + v.toLowerCase(); - }); - }), - - dash2camel: memoize(function (str) { - return str.replace(/(-\w)/g, function (v) { - return v[1].toUpperCase(); - }); - }), - - prependCamel: memoize(function (prefix, str) { - return prefix + str[0].toUpperCase() + str.substring(1); - }, function (prefix, str) { - return prefix + '$' + str; - }), - - capitalize: function capitalize(str) { - if (is.emptyString(str)) { - return str; - } - - return str.charAt(0).toUpperCase() + str.substring(1); - } - -}; - -/***/ }), -/* 25 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var window = __webpack_require__(3); -var performance = window ? window.performance : null; - -var util = {}; - -var pnow = performance && performance.now ? function () { - return performance.now(); -} : function () { - return Date.now(); -}; - -var raf = function () { - if (window) { - if (window.requestAnimationFrame) { - return function (fn) { - window.requestAnimationFrame(fn); - }; - } else if (window.mozRequestAnimationFrame) { - return function (fn) { - window.mozRequestAnimationFrame(fn); - }; - } else if (window.webkitRequestAnimationFrame) { - return function (fn) { - window.webkitRequestAnimationFrame(fn); - }; - } else if (window.msRequestAnimationFrame) { - return function (fn) { - window.msRequestAnimationFrame(fn); - }; - } - } - - return function (fn) { - if (fn) { - setTimeout(function () { - fn(pnow()); - }, 1000 / 60); - } - }; -}(); - -util.requestAnimationFrame = function (fn) { - raf(fn); -}; - -util.performanceNow = pnow; - -util.debounce = __webpack_require__(26); - -util.now = function () { - return Date.now(); -}; - -module.exports = util; - -/***/ }), -/* 26 */ -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE_26__; - -/***/ }), -/* 27 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -function ascending(a, b) { - if (a < b) { - return -1; - } else if (a > b) { - return 1; - } else { - return 0; - } -} - -function descending(a, b) { - return -1 * ascending(a, b); -} - -module.exports = { - sort: { - ascending: ascending, - descending: descending - } -}; - -/***/ }), -/* 28 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -function ObjectMap() { - this._obj = {}; -} - -var p = ObjectMap.prototype; - -p.set = function (key, val) { - this._obj[key] = val; -}; - -p.delete = function (key) { - this._obj[key] = null; -}; - -p.has = function (key) { - return this._obj[key] != null; -}; - -p.get = function (key) { - return this._obj[key]; -}; - -// TODO use the stdlib Map in future... -// module.exports = typeof Map !== 'undefined' ? Map : ObjectMap; -module.exports = ObjectMap; - -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); - -var elesfn = {}; - -[__webpack_require__(30), __webpack_require__(31), __webpack_require__(33), __webpack_require__(34), __webpack_require__(35), __webpack_require__(36), __webpack_require__(37), __webpack_require__(38), __webpack_require__(39), __webpack_require__(40), __webpack_require__(41)].forEach(function (props) { - util.extend(elesfn, props); -}); - -module.exports = elesfn; - -/***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); - -var defineSearch = function defineSearch(params) { - params = { - bfs: params.bfs || !params.dfs, - dfs: params.dfs || !params.bfs - }; - - // from pseudocode on wikipedia - return function searchFn(roots, fn, directed) { - var options; - if (is.plainObject(roots) && !is.elementOrCollection(roots)) { - options = roots; - roots = options.roots || options.root; - fn = options.visit; - directed = options.directed; - } - - directed = arguments.length === 2 && !is.fn(fn) ? fn : directed; - fn = is.fn(fn) ? fn : function () {}; - - var cy = this._private.cy; - var v = roots = is.string(roots) ? this.filter(roots) : roots; - var Q = []; - var connectedNodes = []; - var connectedBy = {}; - var id2depth = {}; - var V = {}; - var j = 0; - var found; - var nodes = this.nodes(); - var edges = this.edges(); - - // enqueue v - for (var i = 0; i < v.length; i++) { - if (v[i].isNode()) { - Q.unshift(v[i]); - - if (params.bfs) { - V[v[i].id()] = true; - - connectedNodes.push(v[i]); - } - - id2depth[v[i].id()] = 0; - } - } - - while (Q.length !== 0) { - var v = params.bfs ? Q.shift() : Q.pop(); - - if (params.dfs) { - if (V[v.id()]) { - continue; - } - - V[v.id()] = true; - - connectedNodes.push(v); - } - - var depth = id2depth[v.id()]; - var prevEdge = connectedBy[v.id()]; - var prevNode = prevEdge == null ? undefined : prevEdge.connectedNodes().not(v)[0]; - var ret; - - ret = fn(v, prevEdge, prevNode, j++, depth); - - if (ret === true) { - found = v; - break; - } - - if (ret === false) { - break; - } - - var vwEdges = v.connectedEdges(directed ? function (ele) { - return ele.data('source') === v.id(); - } : undefined).intersect(edges); - for (var i = 0; i < vwEdges.length; i++) { - var e = vwEdges[i]; - var w = e.connectedNodes(function (n) { - return n.id() !== v.id(); - }).intersect(nodes); - - if (w.length !== 0 && !V[w.id()]) { - w = w[0]; - - Q.push(w); - - if (params.bfs) { - V[w.id()] = true; - - connectedNodes.push(w); - } - - connectedBy[w.id()] = e; - - id2depth[w.id()] = id2depth[v.id()] + 1; - } - } - } - - var connectedEles = []; - - for (var i = 0; i < connectedNodes.length; i++) { - var node = connectedNodes[i]; - var edge = connectedBy[node.id()]; - - if (edge) { - connectedEles.push(edge); - } - - connectedEles.push(node); - } - - return { - path: cy.collection(connectedEles, { unique: true }), - found: cy.collection(found) - }; - }; -}; - -// search, spanning trees, etc -var elesfn = { - breadthFirstSearch: defineSearch({ bfs: true }), - depthFirstSearch: defineSearch({ dfs: true }) -}; - -// nice, short mathemathical alias -elesfn.bfs = elesfn.breadthFirstSearch; -elesfn.dfs = elesfn.depthFirstSearch; - -module.exports = elesfn; - -/***/ }), -/* 31 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var Heap = __webpack_require__(9); - -var elesfn = { - - dijkstra: function dijkstra(root, weightFn, directed) { - var options; - if (is.plainObject(root) && !is.elementOrCollection(root)) { - options = root; - root = options.root; - weightFn = options.weight; - directed = options.directed; - } - - var cy = this._private.cy; - weightFn = is.fn(weightFn) ? weightFn : function () { - return 1; - }; // if not specified, assume each edge has equal weight (1) - - var source = is.string(root) ? this.filter(root)[0] : root[0]; - var dist = {}; - var prev = {}; - var knownDist = {}; - - var edges = this.edges().filter(function (ele) { - return !ele.isLoop(); - }); - var nodes = this.nodes(); - - var getDist = function getDist(node) { - return dist[node.id()]; - }; - - var setDist = function setDist(node, d) { - dist[node.id()] = d; - - Q.updateItem(node); - }; - - var Q = new Heap(function (a, b) { - return getDist(a) - getDist(b); - }); - - for (var i = 0; i < nodes.length; i++) { - var node = nodes[i]; - - dist[node.id()] = node.same(source) ? 0 : Infinity; - Q.push(node); - } - - var distBetween = function distBetween(u, v) { - var uvs = (directed ? u.edgesTo(v) : u.edgesWith(v)).intersect(edges); - var smallestDistance = Infinity; - var smallestEdge; - - for (var i = 0; i < uvs.length; i++) { - var edge = uvs[i]; - var weight = weightFn(edge); - - if (weight < smallestDistance || !smallestEdge) { - smallestDistance = weight; - smallestEdge = edge; - } - } - - return { - edge: smallestEdge, - dist: smallestDistance - }; - }; - - while (Q.size() > 0) { - var u = Q.pop(); - var smalletsDist = getDist(u); - var uid = u.id(); - - knownDist[uid] = smalletsDist; - - if (smalletsDist === Infinity) { - continue; - } - - var neighbors = u.neighborhood().intersect(nodes); - for (var i = 0; i < neighbors.length; i++) { - var v = neighbors[i]; - var vid = v.id(); - var vDist = distBetween(u, v); - - var alt = smalletsDist + vDist.dist; - - if (alt < getDist(v)) { - setDist(v, alt); - - prev[vid] = { - node: u, - edge: vDist.edge - }; - } - } // for - } // while - - return { - distanceTo: function distanceTo(node) { - var target = is.string(node) ? nodes.filter(node)[0] : node[0]; - - return knownDist[target.id()]; - }, - - pathTo: function pathTo(node) { - var target = is.string(node) ? nodes.filter(node)[0] : node[0]; - var S = []; - var u = target; - - if (target.length > 0) { - S.unshift(target); - - while (prev[u.id()]) { - var p = prev[u.id()]; - - S.unshift(p.edge); - S.unshift(p.node); - - u = p.node; - } - } - - return cy.collection(S); - } - }; - } -}; - -module.exports = elesfn; - -/***/ }), -/* 32 */ -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE_32__; - -/***/ }), -/* 33 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); - -// search, spanning trees, etc -var elesfn = { - - // kruskal's algorithm (finds min spanning tree, assuming undirected graph) - // implemented from pseudocode from wikipedia - kruskal: function kruskal(weightFn) { - var cy = this.cy(); - - weightFn = is.fn(weightFn) ? weightFn : function () { - return 1; - }; // if not specified, assume each edge has equal weight (1) - - function findSet(ele) { - for (var i = 0; i < forest.length; i++) { - var eles = forest[i]; - - if (eles.anySame(ele)) { - return { - eles: eles, - index: i - }; - } - } - } - - var A = cy.collection(cy, []); - var forest = []; - var nodes = this.nodes(); - - for (var i = 0; i < nodes.length; i++) { - forest.push(nodes[i].collection()); - } - - var edges = this.edges(); - var S = edges.toArray().sort(function (a, b) { - var weightA = weightFn(a); - var weightB = weightFn(b); - - return weightA - weightB; - }); - - for (var i = 0; i < S.length; i++) { - var edge = S[i]; - var u = edge.source()[0]; - var v = edge.target()[0]; - var setU = findSet(u); - var setV = findSet(v); - - if (setU.index !== setV.index) { - A = A.add(edge); - - // combine forests for u and v - forest[setU.index] = setU.eles.add(setV.eles); - forest.splice(setV.index, 1); - } - } - - return nodes.add(A); - } -}; - -module.exports = elesfn; - -/***/ }), -/* 34 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); - -var elesfn = { - - // Implemented from pseudocode from wikipedia - aStar: function aStar(options) { - var eles = this; - - options = options || {}; - - // Reconstructs the path from Start to End, acumulating the result in pathAcum - var reconstructPath = function reconstructPath(start, end, cameFromMap, pathAcum) { - // Base case - if (start == end) { - pathAcum.unshift(cy.getElementById(end)); - return pathAcum; - } - - if (end in cameFromMap) { - // We know which node is before the last one - var previous = cameFromMap[end]; - var previousEdge = cameFromEdge[end]; - - pathAcum.unshift(cy.getElementById(previousEdge)); - pathAcum.unshift(cy.getElementById(end)); - - return reconstructPath(start, previous, cameFromMap, pathAcum); - } - - // We should not reach here! - return undefined; - }; - - // Returns the index of the element in openSet which has minimum fScore - var findMin = function findMin(openSet, fScore) { - if (openSet.length === 0) { - // Should never be the case - return undefined; - } - var minPos = 0; - var tempScore = fScore[openSet[0]]; - for (var i = 1; i < openSet.length; i++) { - var s = fScore[openSet[i]]; - if (s < tempScore) { - tempScore = s; - minPos = i; - } - } - return minPos; - }; - - var cy = this._private.cy; - - // root - mandatory! - if (options != null && options.root != null) { - var source = is.string(options.root) ? - // use it as a selector, e.g. "#rootID - this.filter(options.root)[0] : options.root[0]; - } else { - return undefined; - } - - // goal - mandatory! - if (options.goal != null) { - var target = is.string(options.goal) ? - // use it as a selector, e.g. "#goalID - this.filter(options.goal)[0] : options.goal[0]; - } else { - return undefined; - } - - // Heuristic function - optional - if (options.heuristic != null && is.fn(options.heuristic)) { - var heuristic = options.heuristic; - } else { - var heuristic = function heuristic() { - return 0; - }; // use constant if unspecified - } - - // Weight function - optional - if (options.weight != null && is.fn(options.weight)) { - var weightFn = options.weight; - } else { - // If not specified, assume each edge has equal weight (1) - var weightFn = function weightFn(e) { - return 1; - }; - } - - // directed - optional - if (options.directed != null) { - var directed = options.directed; - } else { - var directed = false; - } - - var sid = source.id(); - var tid = target.id(); - - var closedSet = []; - var openSet = [sid]; - var cameFrom = {}; - var cameFromEdge = {}; - var gScore = {}; - var fScore = {}; - - gScore[sid] = 0; - fScore[sid] = heuristic(source); - - // Counter - var steps = 0; - - // Main loop - while (openSet.length > 0) { - var minPos = findMin(openSet, fScore); - var cMin = cy.getElementById(openSet[minPos]); - var cMinId = cMin.id(); - steps++; - - // If we've found our goal, then we are done - if (cMinId == tid) { - var rPath = reconstructPath(sid, tid, cameFrom, []); - - return { - found: true, - distance: gScore[cMinId], - path: eles.spawn(rPath), - steps: steps - }; - } - - // Add cMin to processed nodes - closedSet.push(cMinId); - // Remove cMin from boundary nodes - openSet.splice(minPos, 1); - - // Update scores for neighbors of cMin - // Take into account if graph is directed or not - var vwEdges = cMin._private.edges; - - for (var i = 0; i < vwEdges.length; i++) { - var e = vwEdges[i]; - - // edge must be in set of calling eles - if (!this.hasElementWithId(e.id())) { - continue; - } - - // cMin must be the source of edge if directed - if (directed && e.data('source') !== cMinId) { - continue; - } - - var wSrc = e.source(); - var wTgt = e.target(); - - var w = wSrc.id() !== cMinId ? wSrc : wTgt; - var wid = w.id(); - - // node must be in set of calling eles - if (!this.hasElementWithId(wid)) { - continue; - } - - // if node is in closedSet, ignore it - if (closedSet.indexOf(wid) != -1) { - continue; - } - - // New tentative score for node w - var tempScore = gScore[cMinId] + weightFn(e); - - // Update gScore for node w if: - // w not present in openSet - // OR - // tentative gScore is less than previous value - - // w not in openSet - if (openSet.indexOf(wid) == -1) { - gScore[wid] = tempScore; - fScore[wid] = tempScore + heuristic(w); - openSet.push(wid); // Add node to openSet - cameFrom[wid] = cMinId; - cameFromEdge[wid] = e.id(); - continue; - } - // w already in openSet, but with greater gScore - if (tempScore < gScore[wid]) { - gScore[wid] = tempScore; - fScore[wid] = tempScore + heuristic(w); - cameFrom[wid] = cMinId; - } - } // End of neighbors update - } // End of main loop - - // If we've reached here, then we've not reached our goal - return { - found: false, - distance: undefined, - path: undefined, - steps: steps - }; - } - -}; // elesfn - - -module.exports = elesfn; - -/***/ }), -/* 35 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); - -var elesfn = { - - // Implemented from pseudocode from wikipedia - floydWarshall: function floydWarshall(options) { - options = options || {}; - - var cy = this.cy(); - - // Weight function - optional - if (options.weight != null && is.fn(options.weight)) { - var weightFn = options.weight; - } else { - // If not specified, assume each edge has equal weight (1) - var weightFn = function weightFn(e) { - return 1; - }; - } - - // directed - optional - if (options.directed != null) { - var directed = options.directed; - } else { - var directed = false; - } - - var edges = this.edges().stdFilter(function (e) { - return !e.isLoop(); - }); - var nodes = this.nodes(); - var numNodes = nodes.length; - - // mapping: node id -> position in nodes array - var id2position = {}; - for (var i = 0; i < numNodes; i++) { - id2position[nodes[i].id()] = i; - } - - // Initialize distance matrix - var dist = []; - for (var i = 0; i < numNodes; i++) { - var newRow = new Array(numNodes); - for (var j = 0; j < numNodes; j++) { - if (i == j) { - newRow[j] = 0; - } else { - newRow[j] = Infinity; - } - } - dist.push(newRow); - } - - // Initialize matrix used for path reconstruction - // Initialize distance matrix - var next = []; - var edgeNext = []; - - var initMatrix = function initMatrix(next) { - for (var i = 0; i < numNodes; i++) { - var newRow = new Array(numNodes); - for (var j = 0; j < numNodes; j++) { - newRow[j] = undefined; - } - next.push(newRow); - } - }; - - initMatrix(next); - initMatrix(edgeNext); - - // Process edges - for (var i = 0; i < edges.length; i++) { - var sourceIndex = id2position[edges[i].source().id()]; - var targetIndex = id2position[edges[i].target().id()]; - var weight = weightFn(edges[i]); - - // Check if already process another edge between same 2 nodes - if (dist[sourceIndex][targetIndex] > weight) { - dist[sourceIndex][targetIndex] = weight; - next[sourceIndex][targetIndex] = targetIndex; - edgeNext[sourceIndex][targetIndex] = edges[i]; - } - } - - // If undirected graph, process 'reversed' edges - if (!directed) { - for (var i = 0; i < edges.length; i++) { - var sourceIndex = id2position[edges[i].target().id()]; - var targetIndex = id2position[edges[i].source().id()]; - var weight = weightFn(edges[i]); - - // Check if already process another edge between same 2 nodes - if (dist[sourceIndex][targetIndex] > weight) { - dist[sourceIndex][targetIndex] = weight; - next[sourceIndex][targetIndex] = targetIndex; - edgeNext[sourceIndex][targetIndex] = edges[i]; - } - } - } - - // Main loop - for (var k = 0; k < numNodes; k++) { - for (var i = 0; i < numNodes; i++) { - for (var j = 0; j < numNodes; j++) { - if (dist[i][k] + dist[k][j] < dist[i][j]) { - dist[i][j] = dist[i][k] + dist[k][j]; - next[i][j] = next[i][k]; - } - } - } - } - - // Build result object - var position2id = []; - for (var i = 0; i < numNodes; i++) { - position2id.push(nodes[i].id()); - } - - var res = { - distance: function distance(from, to) { - if (is.string(from)) { - // from is a selector string - var fromId = cy.filter(from)[0].id(); - } else { - // from is a node - var fromId = from.id(); - } - - if (is.string(to)) { - // to is a selector string - var toId = cy.filter(to)[0].id(); - } else { - // to is a node - var toId = to.id(); - } - - return dist[id2position[fromId]][id2position[toId]]; - }, - - path: function path(from, to) { - var reconstructPathAux = function reconstructPathAux(from, to, next, position2id, edgeNext) { - if (from === to) { - return cy.getElementById(position2id[from]); - } - if (next[from][to] === undefined) { - return undefined; - } - - var path = [cy.getElementById(position2id[from])]; - var prev = from; - while (from !== to) { - prev = from; - from = next[from][to]; - - var edge = edgeNext[prev][from]; - path.push(edge); - - path.push(cy.getElementById(position2id[from])); - } - return path; - }; - - if (is.string(from)) { - // from is a selector string - var fromId = cy.filter(from)[0].id(); - } else { - // from is a node - var fromId = from.id(); - } - - if (is.string(to)) { - // to is a selector string - var toId = cy.filter(to)[0].id(); - } else { - // to is a node - var toId = to.id(); - } - - var pathArr = reconstructPathAux(id2position[fromId], id2position[toId], next, position2id, edgeNext); - - return cy.collection(pathArr); - } - }; - - return res; - } // floydWarshall - -}; // elesfn - -module.exports = elesfn; - -/***/ }), -/* 36 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var util = __webpack_require__(1); - -var elesfn = { - - // Implemented from pseudocode from wikipedia - bellmanFord: function bellmanFord(options) { - var eles = this; - - options = options || {}; - - // Weight function - optional - if (options.weight != null && is.fn(options.weight)) { - var weightFn = options.weight; - } else { - // If not specified, assume each edge has equal weight (1) - var weightFn = function weightFn(e) { - return 1; - }; - } - - // directed - optional - if (options.directed != null) { - var directed = options.directed; - } else { - var directed = false; - } - - // root - mandatory! - if (options.root != null) { - if (is.string(options.root)) { - // use it as a selector, e.g. "#rootID - var source = this.filter(options.root)[0]; - } else { - var source = options.root[0]; - } - } else { - return undefined; - } - - var cy = this._private.cy; - var edges = this.edges().stdFilter(function (e) { - return !e.isLoop(); - }); - var nodes = this.nodes(); - var numNodes = nodes.length; - - // mapping: node id -> position in nodes array - var id2position = {}; - for (var i = 0; i < numNodes; i++) { - id2position[nodes[i].id()] = i; - } - - // Initializations - var cost = []; - var predecessor = []; - var predEdge = []; - - for (var i = 0; i < numNodes; i++) { - if (nodes[i].id() === source.id()) { - cost[i] = 0; - } else { - cost[i] = Infinity; - } - predecessor[i] = undefined; - } - - // Edges relaxation - var flag = false; - for (var i = 1; i < numNodes; i++) { - flag = false; - for (var e = 0; e < edges.length; e++) { - var sourceIndex = id2position[edges[e].source().id()]; - var targetIndex = id2position[edges[e].target().id()]; - var weight = weightFn(edges[e]); - - var temp = cost[sourceIndex] + weight; - if (temp < cost[targetIndex]) { - cost[targetIndex] = temp; - predecessor[targetIndex] = sourceIndex; - predEdge[targetIndex] = edges[e]; - flag = true; - } - - // If undirected graph, we need to take into account the 'reverse' edge - if (!directed) { - var temp = cost[targetIndex] + weight; - if (temp < cost[sourceIndex]) { - cost[sourceIndex] = temp; - predecessor[sourceIndex] = targetIndex; - predEdge[sourceIndex] = edges[e]; - flag = true; - } - } - } - - if (!flag) { - break; - } - } - - if (flag) { - // Check for negative weight cycles - for (var e = 0; e < edges.length; e++) { - var sourceIndex = id2position[edges[e].source().id()]; - var targetIndex = id2position[edges[e].target().id()]; - var weight = weightFn(edges[e]); - - if (cost[sourceIndex] + weight < cost[targetIndex]) { - util.error('Graph contains a negative weight cycle for Bellman-Ford'); - return { pathTo: undefined, - distanceTo: undefined, - hasNegativeWeightCycle: true }; - } - } - } - - // Build result object - var position2id = []; - for (var i = 0; i < numNodes; i++) { - position2id.push(nodes[i].id()); - } - - var res = { - distanceTo: function distanceTo(to) { - if (is.string(to)) { - // to is a selector string - var toId = cy.filter(to)[0].id(); - } else { - // to is a node - var toId = to.id(); - } - - return cost[id2position[toId]]; - }, - - pathTo: function pathTo(to) { - - var reconstructPathAux = function reconstructPathAux(predecessor, fromPos, toPos, position2id, acumPath, predEdge) { - for (;;) { - // Add toId to path - acumPath.push(cy.getElementById(position2id[toPos])); - acumPath.push(predEdge[toPos]); - - if (fromPos === toPos) { - // reached starting node - return acumPath; - } - - // If no path exists, discart acumulated path and return undefined - var predPos = predecessor[toPos]; - if (typeof predPos === 'undefined') { - return undefined; - } - - toPos = predPos; - } - }; - - if (is.string(to)) { - // to is a selector string - var toId = cy.filter(to)[0].id(); - } else { - // to is a node - var toId = to.id(); - } - var path = []; - - // This returns a reversed path - var res = reconstructPathAux(predecessor, id2position[source.id()], id2position[toId], position2id, path, predEdge); - - // Get it in the correct order and return it - if (res != null) { - res.reverse(); - } - - return eles.spawn(res); - }, - - hasNegativeWeightCycle: false - }; - - return res; - } // bellmanFord - -}; // elesfn - -module.exports = elesfn; - -/***/ }), -/* 37 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); - -var elesfn = { - - // Computes the minimum cut of an undirected graph - // Returns the correct answer with high probability - kargerStein: function kargerStein(options) { - var eles = this; - - options = options || {}; - - // Function which colapses 2 (meta) nodes into one - // Updates the remaining edge lists - // Receives as a paramater the edge which causes the collapse - var colapse = function colapse(edgeIndex, nodeMap, remainingEdges) { - var edgeInfo = remainingEdges[edgeIndex]; - var sourceIn = edgeInfo[1]; - var targetIn = edgeInfo[2]; - var partition1 = nodeMap[sourceIn]; - var partition2 = nodeMap[targetIn]; - - // Delete all edges between partition1 and partition2 - var newEdges = remainingEdges.filter(function (edge) { - if (nodeMap[edge[1]] === partition1 && nodeMap[edge[2]] === partition2) { - return false; - } - if (nodeMap[edge[1]] === partition2 && nodeMap[edge[2]] === partition1) { - return false; - } - return true; - }); - - // All edges pointing to partition2 should now point to partition1 - for (var i = 0; i < newEdges.length; i++) { - var edge = newEdges[i]; - if (edge[1] === partition2) { - // Check source - newEdges[i] = edge.slice(0); - newEdges[i][1] = partition1; - } else if (edge[2] === partition2) { - // Check target - newEdges[i] = edge.slice(0); - newEdges[i][2] = partition1; - } - } - - // Move all nodes from partition2 to partition1 - for (var i = 0; i < nodeMap.length; i++) { - if (nodeMap[i] === partition2) { - nodeMap[i] = partition1; - } - } - - return newEdges; - }; - - // Contracts a graph until we reach a certain number of meta nodes - var contractUntil = function contractUntil(metaNodeMap, remainingEdges, size, sizeLimit) { - // Stop condition - if (size <= sizeLimit) { - return remainingEdges; - } - - // Choose an edge randomly - var edgeIndex = Math.floor(Math.random() * remainingEdges.length); - - // Colapse graph based on edge - var newEdges = colapse(edgeIndex, metaNodeMap, remainingEdges); - - return contractUntil(metaNodeMap, newEdges, size - 1, sizeLimit); - }; - - var cy = this._private.cy; - var edges = this.edges().stdFilter(function (e) { - return !e.isLoop(); - }); - var nodes = this.nodes(); - var numNodes = nodes.length; - var numEdges = edges.length; - var numIter = Math.ceil(Math.pow(Math.log(numNodes) / Math.LN2, 2)); - var stopSize = Math.floor(numNodes / Math.sqrt(2)); - - if (numNodes < 2) { - util.error('At least 2 nodes are required for Karger-Stein algorithm'); - return undefined; - } - - // Create numerical identifiers for each node - // mapping: node id -> position in nodes array - // for reverse mapping, simply use nodes array - var id2position = {}; - for (var i = 0; i < numNodes; i++) { - id2position[nodes[i].id()] = i; - } - - // Now store edge destination as indexes - // Format for each edge (edge index, source node index, target node index) - var edgeIndexes = []; - for (var i = 0; i < numEdges; i++) { - var e = edges[i]; - edgeIndexes.push([i, id2position[e.source().id()], id2position[e.target().id()]]); - } - - // We will store the best cut found here - var minCutSize = Infinity; - var minCut; - - // Initial meta node partition - var originalMetaNode = []; - for (var i = 0; i < numNodes; i++) { - originalMetaNode.push(i); - } - - // Main loop - for (var iter = 0; iter <= numIter; iter++) { - // Create new meta node partition - var metaNodeMap = originalMetaNode.slice(0); - - // Contract until stop point (stopSize nodes) - var edgesState = contractUntil(metaNodeMap, edgeIndexes, numNodes, stopSize); - - // Create a copy of the colapsed nodes state - var metaNodeMap2 = metaNodeMap.slice(0); - - // Run 2 iterations starting in the stop state - var res1 = contractUntil(metaNodeMap, edgesState, stopSize, 2); - var res2 = contractUntil(metaNodeMap2, edgesState, stopSize, 2); - - // Is any of the 2 results the best cut so far? - if (res1.length <= res2.length && res1.length < minCutSize) { - minCutSize = res1.length; - minCut = [res1, metaNodeMap]; - } else if (res2.length <= res1.length && res2.length < minCutSize) { - minCutSize = res2.length; - minCut = [res2, metaNodeMap2]; - } - } // end of main loop - - - // Construct result - var resEdges = minCut[0].map(function (e) { - return edges[e[0]]; - }); - var partition1 = []; - var partition2 = []; - - // traverse metaNodeMap for best cut - var witnessNodePartition = minCut[1][0]; - for (var i = 0; i < minCut[1].length; i++) { - var partitionId = minCut[1][i]; - if (partitionId === witnessNodePartition) { - partition1.push(nodes[i]); - } else { - partition2.push(nodes[i]); - } - } - - var ret = { - cut: eles.spawn(cy, resEdges), - partition1: eles.spawn(partition1), - partition2: eles.spawn(partition2) - }; - - return ret; - } -}; // elesfn - - -module.exports = elesfn; - -/***/ }), -/* 38 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); - -var elesfn = { - - pageRank: function pageRank(options) { - options = options || {}; - - var normalizeVector = function normalizeVector(vector) { - var length = vector.length; - - // First, get sum of all elements - var total = 0; - for (var i = 0; i < length; i++) { - total += vector[i]; - } - - // Now, divide each by the sum of all elements - for (var i = 0; i < length; i++) { - vector[i] = vector[i] / total; - } - }; - - // dampingFactor - optional - if (options != null && options.dampingFactor != null) { - var dampingFactor = options.dampingFactor; - } else { - var dampingFactor = 0.8; // Default damping factor - } - - // desired precision - optional - if (options != null && options.precision != null) { - var epsilon = options.precision; - } else { - var epsilon = 0.000001; // Default precision - } - - // Max number of iterations - optional - if (options != null && options.iterations != null) { - var numIter = options.iterations; - } else { - var numIter = 200; // Default number of iterations - } - - // Weight function - optional - if (options != null && options.weight != null && is.fn(options.weight)) { - var weightFn = options.weight; - } else { - // If not specified, assume each edge has equal weight (1) - var weightFn = function weightFn(e) { - return 1; - }; - } - - var cy = this._private.cy; - var edges = this.edges().stdFilter(function (e) { - return !e.isLoop(); - }); - var nodes = this.nodes(); - var numNodes = nodes.length; - var numEdges = edges.length; - - // Create numerical identifiers for each node - // mapping: node id -> position in nodes array - // for reverse mapping, simply use nodes array - var id2position = {}; - for (var i = 0; i < numNodes; i++) { - id2position[nodes[i].id()] = i; - } - - // Construct transposed adjacency matrix - // First lets have a zeroed matrix of the right size - // We'll also keep track of the sum of each column - var matrix = []; - var columnSum = []; - var additionalProb = (1 - dampingFactor) / numNodes; - - // Create null matric - for (var i = 0; i < numNodes; i++) { - var newRow = []; - for (var j = 0; j < numNodes; j++) { - newRow.push(0.0); - } - matrix.push(newRow); - columnSum.push(0.0); - } - - // Now, process edges - for (var i = 0; i < numEdges; i++) { - var edge = edges[i]; - var s = id2position[edge.source().id()]; - var t = id2position[edge.target().id()]; - var w = weightFn(edge); - - // Update matrix - matrix[t][s] += w; - - // Update column sum - columnSum[s] += w; - } - - // Add additional probability based on damping factor - // Also, take into account columns that have sum = 0 - var p = 1.0 / numNodes + additionalProb; // Shorthand - // Traverse matrix, column by column - for (var j = 0; j < numNodes; j++) { - if (columnSum[j] === 0) { - // No 'links' out from node jth, assume equal probability for each possible node - for (var i = 0; i < numNodes; i++) { - matrix[i][j] = p; - } - } else { - // Node jth has outgoing link, compute normalized probabilities - for (var i = 0; i < numNodes; i++) { - matrix[i][j] = matrix[i][j] / columnSum[j] + additionalProb; - } - } - } - - // Compute dominant eigenvector using power method - var eigenvector = []; - var nullVector = []; - var previous; - - // Start with a vector of all 1's - // Also, initialize a null vector which will be used as shorthand - for (var i = 0; i < numNodes; i++) { - eigenvector.push(1.0); - nullVector.push(0.0); - } - - for (var iter = 0; iter < numIter; iter++) { - // New array with all 0's - var temp = nullVector.slice(0); - - // Multiply matrix with previous result - for (var i = 0; i < numNodes; i++) { - for (var j = 0; j < numNodes; j++) { - temp[i] += matrix[i][j] * eigenvector[j]; - } - } - - normalizeVector(temp); - previous = eigenvector; - eigenvector = temp; - - var diff = 0; - // Compute difference (squared module) of both vectors - for (var i = 0; i < numNodes; i++) { - diff += Math.pow(previous[i] - eigenvector[i], 2); - } - - // If difference is less than the desired threshold, stop iterating - if (diff < epsilon) { - break; - } - } - - // Construct result - var res = { - rank: function rank(node) { - if (is.string(node)) { - // is a selector string - var nodeId = cy.filter(node)[0].id(); - } else { - // is a node object - var nodeId = node.id(); - } - return eigenvector[id2position[nodeId]]; - } - }; - - return res; - } // pageRank - -}; // elesfn - -module.exports = elesfn; - -/***/ }), -/* 39 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var util = __webpack_require__(1); - -var elesfn = { - - degreeCentralityNormalized: function degreeCentralityNormalized(options) { - options = options || {}; - - var cy = this.cy(); - - // directed - optional - if (options.directed != null) { - var directed = options.directed; - } else { - var directed = false; - } - - var nodes = this.nodes(); - var numNodes = nodes.length; - - if (!directed) { - var degrees = {}; - var maxDegree = 0; - - for (var i = 0; i < numNodes; i++) { - var node = nodes[i]; - // add current node to the current options object and call degreeCentrality - var currDegree = this.degreeCentrality(util.extend({}, options, { root: node })); - if (maxDegree < currDegree.degree) maxDegree = currDegree.degree; - - degrees[node.id()] = currDegree.degree; - } - - return { - degree: function degree(node) { - if (maxDegree == 0) return 0; - - if (is.string(node)) { - // from is a selector string - var node = cy.filter(node)[0].id(); - } else { - // from is a node - var node = node.id(); - } - - return degrees[node] / maxDegree; - } - }; - } else { - var indegrees = {}; - var outdegrees = {}; - var maxIndegree = 0; - var maxOutdegree = 0; - - for (var i = 0; i < numNodes; i++) { - var node = nodes[i]; - // add current node to the current options object and call degreeCentrality - var currDegree = this.degreeCentrality(util.extend({}, options, { root: node })); - - if (maxIndegree < currDegree.indegree) maxIndegree = currDegree.indegree; - - if (maxOutdegree < currDegree.outdegree) maxOutdegree = currDegree.outdegree; - - indegrees[node.id()] = currDegree.indegree; - outdegrees[node.id()] = currDegree.outdegree; - } - - return { - indegree: function indegree(node) { - if (maxIndegree == 0) return 0; - - if (is.string(node)) { - // from is a selector string - var node = cy.filter(node)[0].id(); - } else { - // from is a node - var node = node.id(); - } - - return indegrees[node] / maxIndegree; - }, - outdegree: function outdegree(node) { - if (maxOutdegree == 0) return 0; - - if (is.string(node)) { - // from is a selector string - var node = cy.filter(node)[0].id(); - } else { - // from is a node - var node = node.id(); - } - - return outdegrees[node] / maxOutdegree; - } - - }; - } - }, // degreeCentralityNormalized - - // Implemented from the algorithm in Opsahl's paper - // "Node centrality in weighted networks: Generalizing degree and shortest paths" - // check the heading 2 "Degree" - degreeCentrality: function degreeCentrality(options) { - options = options || {}; - - var callingEles = this; - - // root - mandatory! - if (options != null && options.root != null) { - var root = is.string(options.root) ? this.filter(options.root)[0] : options.root[0]; - } else { - return undefined; - } - - // weight - optional - if (options.weight != null && is.fn(options.weight)) { - var weightFn = options.weight; - } else { - // If not specified, assume each edge has equal weight (1) - var weightFn = function weightFn(e) { - return 1; - }; - } - - // directed - optional - if (options.directed != null) { - var directed = options.directed; - } else { - var directed = false; - } - - // alpha - optional - if (options.alpha != null && is.number(options.alpha)) { - var alpha = options.alpha; - } else { - alpha = 0; - } - - if (!directed) { - var connEdges = root.connectedEdges().intersection(callingEles); - var k = connEdges.length; - var s = 0; - - // Now, sum edge weights - for (var i = 0; i < connEdges.length; i++) { - var edge = connEdges[i]; - s += weightFn(edge); - } - - return { - degree: Math.pow(k, 1 - alpha) * Math.pow(s, alpha) - }; - } else { - var incoming = root.connectedEdges('edge[target = "' + root.id() + '"]').intersection(callingEles); - var outgoing = root.connectedEdges('edge[source = "' + root.id() + '"]').intersection(callingEles); - var k_in = incoming.length; - var k_out = outgoing.length; - var s_in = 0; - var s_out = 0; - - // Now, sum incoming edge weights - for (var i = 0; i < incoming.length; i++) { - var edge = incoming[i]; - s_in += weightFn(edge); - } - - // Now, sum outgoing edge weights - for (var i = 0; i < outgoing.length; i++) { - var edge = outgoing[i]; - s_out += weightFn(edge); - } - - return { - indegree: Math.pow(k_in, 1 - alpha) * Math.pow(s_in, alpha), - outdegree: Math.pow(k_out, 1 - alpha) * Math.pow(s_out, alpha) - }; - } - } // degreeCentrality - -}; // elesfn - -// nice, short mathemathical alias -elesfn.dc = elesfn.degreeCentrality; -elesfn.dcn = elesfn.degreeCentralityNormalised = elesfn.degreeCentralityNormalized; - -module.exports = elesfn; - -/***/ }), -/* 40 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); - -var elesfn = { - - closenessCentralityNormalized: function closenessCentralityNormalized(options) { - options = options || {}; - - var cy = this.cy(); - - var harmonic = options.harmonic; - if (harmonic === undefined) { - harmonic = true; - } - - var closenesses = {}; - var maxCloseness = 0; - var nodes = this.nodes(); - var fw = this.floydWarshall({ weight: options.weight, directed: options.directed }); - - // Compute closeness for every node and find the maximum closeness - for (var i = 0; i < nodes.length; i++) { - var currCloseness = 0; - for (var j = 0; j < nodes.length; j++) { - if (i != j) { - var d = fw.distance(nodes[i], nodes[j]); - - if (harmonic) { - currCloseness += 1 / d; - } else { - currCloseness += d; - } - } - } - - if (!harmonic) { - currCloseness = 1 / currCloseness; - } - - if (maxCloseness < currCloseness) { - maxCloseness = currCloseness; - } - - closenesses[nodes[i].id()] = currCloseness; - } - - return { - closeness: function closeness(node) { - if (maxCloseness == 0) { - return 0; - } - - if (is.string(node)) { - // from is a selector string - var node = cy.filter(node)[0].id(); - } else { - // from is a node - var node = node.id(); - } - - return closenesses[node] / maxCloseness; - } - }; - }, - - // Implemented from pseudocode from wikipedia - closenessCentrality: function closenessCentrality(options) { - options = options || {}; - - // root - mandatory! - if (options.root != null) { - if (is.string(options.root)) { - // use it as a selector, e.g. "#rootID - var root = this.filter(options.root)[0]; - } else { - var root = options.root[0]; - } - } else { - return undefined; - } - - // weight - optional - if (options.weight != null && is.fn(options.weight)) { - var weight = options.weight; - } else { - var weight = function weight() { - return 1; - }; - } - - // directed - optional - if (options.directed != null && is.bool(options.directed)) { - var directed = options.directed; - } else { - var directed = false; - } - - var harmonic = options.harmonic; - if (harmonic === undefined) { - harmonic = true; - } - - // we need distance from this node to every other node - var dijkstra = this.dijkstra({ - root: root, - weight: weight, - directed: directed - }); - var totalDistance = 0; - - var nodes = this.nodes(); - for (var i = 0; i < nodes.length; i++) { - if (nodes[i].id() != root.id()) { - var d = dijkstra.distanceTo(nodes[i]); - - if (harmonic) { - totalDistance += 1 / d; - } else { - totalDistance += d; - } - } - } - - return harmonic ? totalDistance : 1 / totalDistance; - } // closenessCentrality - -}; // elesfn - -// nice, short mathemathical alias -elesfn.cc = elesfn.closenessCentrality; -elesfn.ccn = elesfn.closenessCentralityNormalised = elesfn.closenessCentralityNormalized; - -module.exports = elesfn; - -/***/ }), -/* 41 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var Heap = __webpack_require__(9); - -var elesfn = { - - // Implemented from the algorithm in the paper "On Variants of Shortest-Path Betweenness Centrality and their Generic Computation" by Ulrik Brandes - betweennessCentrality: function betweennessCentrality(options) { - options = options || {}; - - // Weight - optional - var weighted, weightFn; - if (is.fn(options.weight)) { - weightFn = options.weight; - weighted = true; - } else { - weighted = false; - } - - // Directed - default false - var directed = options.directed != null ? options.directed : false; - - var cy = this._private.cy; - - // starting - var V = this.nodes(); - var A = {}; - var _C = {}; - var max = 0; - var C = { - set: function set(key, val) { - _C[key] = val; - - if (val > max) { - max = val; - } - }, - - get: function get(key) { - return _C[key]; - } - }; - - // A contains the neighborhoods of every node - for (var i = 0; i < V.length; i++) { - var v = V[i]; - var vid = v.id(); - - if (directed) { - A[vid] = v.outgoers().nodes(); // get outgoers of every node - } else { - A[vid] = v.openNeighborhood().nodes(); // get neighbors of every node - } - - C.set(vid, 0); - } - - for (var s = 0; s < V.length; s++) { - var sid = V[s].id(); - var S = []; // stack - var P = {}; - var g = {}; - var d = {}; - var Q = new Heap(function (a, b) { - return d[a] - d[b]; - }); // queue - - // init dictionaries - for (var i = 0; i < V.length; i++) { - var vid = V[i].id(); - - P[vid] = []; - g[vid] = 0; - d[vid] = Infinity; - } - - g[sid] = 1; // sigma - d[sid] = 0; // distance to s - - Q.push(sid); - - while (!Q.empty()) { - var v = Q.pop(); - - S.push(v); - - if (weighted) { - for (var j = 0; j < A[v].length; j++) { - var w = A[v][j]; - var vEle = cy.getElementById(v); - - var edge; - if (vEle.edgesTo(w).length > 0) { - edge = vEle.edgesTo(w)[0]; - } else { - edge = w.edgesTo(vEle)[0]; - } - - var edgeWeight = weightFn(edge); - - w = w.id(); - - if (d[w] > d[v] + edgeWeight) { - d[w] = d[v] + edgeWeight; - - if (Q.nodes.indexOf(w) < 0) { - //if w is not in Q - Q.push(w); - } else { - // update position if w is in Q - Q.updateItem(w); - } - - g[w] = 0; - P[w] = []; - } - - if (d[w] == d[v] + edgeWeight) { - g[w] = g[w] + g[v]; - P[w].push(v); - } - } - } else { - for (var j = 0; j < A[v].length; j++) { - var w = A[v][j].id(); - - if (d[w] == Infinity) { - Q.push(w); - - d[w] = d[v] + 1; - } - - if (d[w] == d[v] + 1) { - g[w] = g[w] + g[v]; - P[w].push(v); - } - } - } - } - - var e = {}; - for (var i = 0; i < V.length; i++) { - e[V[i].id()] = 0; - } - - while (S.length > 0) { - var w = S.pop(); - - for (var j = 0; j < P[w].length; j++) { - var v = P[w][j]; - - e[v] = e[v] + g[v] / g[w] * (1 + e[w]); - - if (w != V[s].id()) { - C.set(w, C.get(w) + e[w]); - } - } - } - } - - var ret = { - betweenness: function betweenness(node) { - if (is.string(node)) { - var node = cy.filter(node).id(); - } else { - var node = node.id(); - } - - return C.get(node); - }, - - betweennessNormalized: function betweennessNormalized(node) { - if (max == 0) return 0; - - if (is.string(node)) { - var node = cy.filter(node).id(); - } else { - var node = node.id(); - } - - return C.get(node) / max; - } - }; - - // alias - ret.betweennessNormalised = ret.betweennessNormalized; - - return ret; - } // betweennessCentrality - -}; // elesfn - -// nice, short mathemathical alias -elesfn.bc = elesfn.betweennessCentrality; - -module.exports = elesfn; - -/***/ }), -/* 42 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var define = __webpack_require__(4); - -var elesfn = { - animate: define.animate(), - animation: define.animation(), - animated: define.animated(), - clearQueue: define.clearQueue(), - delay: define.delay(), - delayAnimation: define.delayAnimation(), - stop: define.stop() -}; - -module.exports = elesfn; - -/***/ }), -/* 43 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var Animation = __webpack_require__(44); -var math = __webpack_require__(2); -var is = __webpack_require__(0); - -var define = { - - animated: function animated() { - return function animatedImpl() { - var self = this; - var selfIsArrayLike = self.length !== undefined; - var all = selfIsArrayLike ? self : [self]; // put in array if not array-like - var cy = this._private.cy || this; - - if (!cy.styleEnabled()) { - return false; - } - - var ele = all[0]; - - if (ele) { - return ele._private.animation.current.length > 0; - } - }; - }, // animated - - clearQueue: function clearQueue() { - return function clearQueueImpl() { - var self = this; - var selfIsArrayLike = self.length !== undefined; - var all = selfIsArrayLike ? self : [self]; // put in array if not array-like - var cy = this._private.cy || this; - - if (!cy.styleEnabled()) { - return this; - } - - for (var i = 0; i < all.length; i++) { - var ele = all[i]; - ele._private.animation.queue = []; - } - - return this; - }; - }, // clearQueue - - delay: function delay() { - return function delayImpl(time, complete) { - var cy = this._private.cy || this; - - if (!cy.styleEnabled()) { - return this; - } - - return this.animate({ - delay: time, - duration: time, - complete: complete - }); - }; - }, // delay - - delayAnimation: function delayAnimation() { - return function delayAnimationImpl(time, complete) { - var cy = this._private.cy || this; - - if (!cy.styleEnabled()) { - return this; - } - - return this.animation({ - delay: time, - duration: time, - complete: complete - }); - }; - }, // delay - - animation: function animation() { - return function animationImpl(properties, params) { - var self = this; - var selfIsArrayLike = self.length !== undefined; - var all = selfIsArrayLike ? self : [self]; // put in array if not array-like - var cy = this._private.cy || this; - var isCore = !selfIsArrayLike; - var isEles = !isCore; - - if (!cy.styleEnabled()) { - return this; - } - - var style = cy.style(); - - properties = util.assign({}, properties, params); - - var propertiesEmpty = Object.keys(properties).length === 0; - - if (propertiesEmpty) { - return new Animation(all[0], properties); // nothing to animate - } - - if (properties.duration === undefined) { - properties.duration = 400; - } - - switch (properties.duration) { - case 'slow': - properties.duration = 600; - break; - case 'fast': - properties.duration = 200; - break; - } - - if (isEles) { - properties.style = style.getPropsList(properties.style || properties.css); - - properties.css = undefined; - } - - if (isEles && properties.renderedPosition != null) { - var rpos = properties.renderedPosition; - var pan = cy.pan(); - var zoom = cy.zoom(); - - properties.position = math.renderedToModelPosition(rpos, zoom, pan); - } - - // override pan w/ panBy if set - if (isCore && properties.panBy != null) { - var panBy = properties.panBy; - var cyPan = cy.pan(); - - properties.pan = { - x: cyPan.x + panBy.x, - y: cyPan.y + panBy.y - }; - } - - // override pan w/ center if set - var center = properties.center || properties.centre; - if (isCore && center != null) { - var centerPan = cy.getCenterPan(center.eles, properties.zoom); - - if (centerPan != null) { - properties.pan = centerPan; - } - } - - // override pan & zoom w/ fit if set - if (isCore && properties.fit != null) { - var fit = properties.fit; - var fitVp = cy.getFitViewport(fit.eles || fit.boundingBox, fit.padding); - - if (fitVp != null) { - properties.pan = fitVp.pan; - properties.zoom = fitVp.zoom; - } - } - - // override zoom (& potentially pan) w/ zoom obj if set - if (isCore && is.plainObject(properties.zoom)) { - var vp = cy.getZoomedViewport(properties.zoom); - - if (vp != null) { - if (vp.zoomed) { - properties.zoom = vp.zoom; - } - - if (vp.panned) { - properties.pan = vp.pan; - } - } - } - - return new Animation(all[0], properties); - }; - }, // animate - - animate: function animate() { - return function animateImpl(properties, params) { - var self = this; - var selfIsArrayLike = self.length !== undefined; - var all = selfIsArrayLike ? self : [self]; // put in array if not array-like - var cy = this._private.cy || this; - - if (!cy.styleEnabled()) { - return this; - } - - if (params) { - properties = util.extend({}, properties, params); - } - - // manually hook and run the animation - for (var i = 0; i < all.length; i++) { - var ele = all[i]; - var queue = ele.animated() && (properties.queue === undefined || properties.queue); - - var ani = ele.animation(properties, queue ? { queue: true } : undefined); - - ani.play(); - } - - return this; // chaining - }; - }, // animate - - stop: function stop() { - return function stopImpl(clearQueue, jumpToEnd) { - var self = this; - var selfIsArrayLike = self.length !== undefined; - var all = selfIsArrayLike ? self : [self]; // put in array if not array-like - var cy = this._private.cy || this; - - if (!cy.styleEnabled()) { - return this; - } - - for (var i = 0; i < all.length; i++) { - var ele = all[i]; - var _p = ele._private; - var anis = _p.animation.current; - - for (var j = 0; j < anis.length; j++) { - var ani = anis[j]; - var ani_p = ani._private; - - if (jumpToEnd) { - // next iteration of the animation loop, the animation - // will go straight to the end and be removed - ani_p.duration = 0; - } - } - - // clear the queue of future animations - if (clearQueue) { - _p.animation.queue = []; - } - - if (!jumpToEnd) { - _p.animation.current = []; - } - } - - // we have to notify (the animation loop doesn't do it for us on `stop`) - cy.notify({ - eles: this, - type: 'draw' - }); - - return this; - }; - } // stop - -}; // define - -module.exports = define; - -/***/ }), -/* 44 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var is = __webpack_require__(0); -var Promise = __webpack_require__(5); - -var Animation = function Animation(target, opts, opts2) { - var _p = this._private = util.extend({ - duration: 1000 - }, opts, opts2); - - _p.target = target; - _p.style = _p.style || _p.css; - _p.started = false; - _p.playing = false; - _p.hooked = false; - _p.applying = false; - _p.progress = 0; - _p.completes = []; - _p.frames = []; - - if (_p.complete && is.fn(_p.complete)) { - _p.completes.push(_p.complete); - } - - // for future timeline/animations impl - this.length = 1; - this[0] = this; -}; - -var anifn = Animation.prototype; - -util.extend(anifn, { - - instanceString: function instanceString() { - return 'animation'; - }, - - hook: function hook() { - var _p = this._private; - - if (!_p.hooked) { - // add to target's animation queue - var q = void 0; - var tAni = _p.target._private.animation; - if (_p.queue) { - q = tAni.queue; - } else { - q = tAni.current; - } - q.push(this); - - // add to the animation loop pool - if (is.elementOrCollection(_p.target)) { - _p.target.cy().addToAnimationPool(_p.target); - } - - _p.hooked = true; - } - - return this; - }, - - play: function play() { - var _p = this._private; - - // autorewind - if (_p.progress === 1) { - _p.progress = 0; - } - - _p.playing = true; - _p.started = false; // needs to be started by animation loop - _p.stopped = false; - - this.hook(); - - // the animation loop will start the animation... - - return this; - }, - - playing: function playing() { - return this._private.playing; - }, - - apply: function apply() { - var _p = this._private; - - _p.applying = true; - _p.started = false; // needs to be started by animation loop - _p.stopped = false; - - this.hook(); - - // the animation loop will apply the animation at this progress - - return this; - }, - - applying: function applying() { - return this._private.applying; - }, - - pause: function pause() { - var _p = this._private; - - _p.playing = false; - _p.started = false; - - return this; - }, - - stop: function stop() { - var _p = this._private; - - _p.playing = false; - _p.started = false; - _p.stopped = true; // to be removed from animation queues - - return this; - }, - - rewind: function rewind() { - return this.progress(0); - }, - - fastforward: function fastforward() { - return this.progress(1); - }, - - time: function time(t) { - var _p = this._private; - - if (t === undefined) { - return _p.progress * _p.duration; - } else { - return this.progress(t / _p.duration); - } - }, - - progress: function progress(p) { - var _p = this._private; - var wasPlaying = _p.playing; - - if (p === undefined) { - return _p.progress; - } else { - if (wasPlaying) { - this.pause(); - } - - _p.progress = p; - _p.started = false; - - if (wasPlaying) { - this.play(); - } - } - - return this; - }, - - completed: function completed() { - return this._private.progress === 1; - }, - - reverse: function reverse() { - var _p = this._private; - var wasPlaying = _p.playing; - - if (wasPlaying) { - this.pause(); - } - - _p.progress = 1 - _p.progress; - _p.started = false; - - var swap = function swap(a, b) { - var _pa = _p[a]; - - if (_pa == null) { - return; - } - - _p[a] = _p[b]; - _p[b] = _pa; - }; - - swap('zoom', 'startZoom'); - swap('pan', 'startPan'); - swap('position', 'startPosition'); - - // swap styles - if (_p.style) { - for (var i = 0; i < _p.style.length; i++) { - var prop = _p.style[i]; - var name = prop.name; - var startStyleProp = _p.startStyle[name]; - - _p.startStyle[name] = prop; - _p.style[i] = startStyleProp; - } - } - - if (wasPlaying) { - this.play(); - } - - return this; - }, - - promise: function promise(type) { - var _p = this._private; - - var arr = void 0; - - switch (type) { - case 'frame': - arr = _p.frames; - break; - default: - case 'complete': - case 'completed': - arr = _p.completes; - } - - return new Promise(function (resolve, reject) { - arr.push(function () { - resolve(); - }); - }); - } - -}); - -anifn.complete = anifn.completed; - -module.exports = Animation; - -/***/ }), -/* 45 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -var util = __webpack_require__(1); -var is = __webpack_require__(0); - -var define = { - - // access data field - data: function data(params) { - var defaults = { - field: 'data', - bindingEvent: 'data', - allowBinding: false, - allowSetting: false, - allowGetting: false, - settingEvent: 'data', - settingTriggersEvent: false, - triggerFnName: 'trigger', - immutableKeys: {}, // key => true if immutable - updateStyle: false, - beforeGet: function beforeGet(self) {}, - beforeSet: function beforeSet(self, obj) {}, - onSet: function onSet(self) {}, - canSet: function canSet(self) { - return true; - } - }; - params = util.extend({}, defaults, params); - - return function dataImpl(name, value) { - var p = params; - var self = this; - var selfIsArrayLike = self.length !== undefined; - var all = selfIsArrayLike ? self : [self]; // put in array if not array-like - var single = selfIsArrayLike ? self[0] : self; - - // .data('foo', ...) - if (is.string(name)) { - // set or get property - - // .data('foo') - if (p.allowGetting && value === undefined) { - // get - - var ret = void 0; - if (single) { - p.beforeGet(single); - - ret = single._private[p.field][name]; - } - return ret; - - // .data('foo', 'bar') - } else if (p.allowSetting && value !== undefined) { - // set - var valid = !p.immutableKeys[name]; - if (valid) { - var change = _defineProperty({}, name, value); - - p.beforeSet(self, change); - - for (var i = 0, l = all.length; i < l; i++) { - var ele = all[i]; - - if (p.canSet(ele)) { - ele._private[p.field][name] = value; - } - } - - // update mappers if asked - if (p.updateStyle) { - self.updateStyle(); - } - - // call onSet callback - p.onSet(self); - - if (p.settingTriggersEvent) { - self[p.triggerFnName](p.settingEvent); - } - } - } - - // .data({ 'foo': 'bar' }) - } else if (p.allowSetting && is.plainObject(name)) { - // extend - var obj = name; - var k = void 0, - v = void 0; - var keys = Object.keys(obj); - - p.beforeSet(self, obj); - - for (var _i = 0; _i < keys.length; _i++) { - k = keys[_i]; - v = obj[k]; - - var _valid = !p.immutableKeys[k]; - if (_valid) { - for (var j = 0; j < all.length; j++) { - var _ele = all[j]; - - if (p.canSet(_ele)) { - _ele._private[p.field][k] = v; - } - } - } - } - - // update mappers if asked - if (p.updateStyle) { - self.updateStyle(); - } - - // call onSet callback - p.onSet(self); - - if (p.settingTriggersEvent) { - self[p.triggerFnName](p.settingEvent); - } - - // .data(function(){ ... }) - } else if (p.allowBinding && is.fn(name)) { - // bind to event - var fn = name; - self.on(p.bindingEvent, fn); - - // .data() - } else if (p.allowGetting && name === undefined) { - // get whole object - var _ret = void 0; - if (single) { - p.beforeGet(single); - - _ret = single._private[p.field]; - } - return _ret; - } - - return self; // maintain chainability - }; // function - }, // data - - // remove data field - removeData: function removeData(params) { - var defaults = { - field: 'data', - event: 'data', - triggerFnName: 'trigger', - triggerEvent: false, - immutableKeys: {} // key => true if immutable - }; - params = util.extend({}, defaults, params); - - return function removeDataImpl(names) { - var p = params; - var self = this; - var selfIsArrayLike = self.length !== undefined; - var all = selfIsArrayLike ? self : [self]; // put in array if not array-like - - // .removeData('foo bar') - if (is.string(names)) { - // then get the list of keys, and delete them - var keys = names.split(/\s+/); - var l = keys.length; - - for (var i = 0; i < l; i++) { - // delete each non-empty key - var key = keys[i]; - if (is.emptyString(key)) { - continue; - } - - var valid = !p.immutableKeys[key]; // not valid if immutable - if (valid) { - for (var i_a = 0, l_a = all.length; i_a < l_a; i_a++) { - all[i_a]._private[p.field][key] = undefined; - } - } - } - - if (p.triggerEvent) { - self[p.triggerFnName](p.event); - } - - // .removeData() - } else if (names === undefined) { - // then delete all keys - - for (var _i_a = 0, _l_a = all.length; _i_a < _l_a; _i_a++) { - var _privateFields = all[_i_a]._private[p.field]; - var _keys = Object.keys(_privateFields); - - for (var _i2 = 0; _i2 < _keys.length; _i2++) { - var _key = _keys[_i2]; - var validKeyToDelete = !p.immutableKeys[_key]; - - if (validKeyToDelete) { - _privateFields[_key] = undefined; - } - } - } - - if (p.triggerEvent) { - self[p.triggerFnName](p.event); - } - } - - return self; // maintain chaining - }; // function - } // removeData -}; // define - -module.exports = define; - -/***/ }), -/* 46 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Promise = __webpack_require__(5); - -var define = { - - eventAliasesOn: function eventAliasesOn(proto) { - var p = proto; - - p.addListener = p.listen = p.bind = p.on; - p.unlisten = p.unbind = p.off = p.removeListener; - p.trigger = p.emit; - - // this is just a wrapper alias of .on() - p.pon = p.promiseOn = function (events, selector) { - var self = this; - var args = Array.prototype.slice.call(arguments, 0); - - return new Promise(function (resolve, reject) { - var callback = function callback(e) { - self.off.apply(self, offArgs); - - resolve(e); - }; - - var onArgs = args.concat([callback]); - var offArgs = onArgs.concat([]); - - self.on.apply(self, onArgs); - }); - }; - } - -}; // define - -module.exports = define; - -/***/ }), -/* 47 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Set = __webpack_require__(8); - -var elesfn = { - classes: function classes(_classes) { - _classes = (_classes || '').match(/\S+/g) || []; - var self = this; - var changed = []; - var classesMap = new Set(_classes); - - // check and update each ele - - var _loop = function _loop(j) { - var ele = self[j]; - var _p = ele._private; - var eleClasses = _p.classes; - var changedEle = false; - - // check if ele has all of the passed classes - classesMap.forEach(function (cls) { - var eleHasClass = eleClasses.has(cls); - - if (!eleHasClass) { - changedEle = true; - } - }); - - // check if ele has classes outside of those passed - if (!changedEle) { - eleClasses.forEach(function (eleCls) { - var specdClass = classesMap.has(eleCls); - - if (!specdClass) { - changedEle = true; - } - }); - } - - if (changedEle) { - _p.classes = new Set(classesMap); - - changed.push(ele); - } - }; - - for (var j = 0; j < self.length; j++) { - _loop(j); - } - - // trigger update style on those eles that had class changes - if (changed.length > 0) { - this.spawn(changed).updateStyle().emit('class'); - } - - return self; - }, - - addClass: function addClass(classes) { - return this.toggleClass(classes, true); - }, - - hasClass: function hasClass(className) { - var ele = this[0]; - return ele != null && ele._private.classes.has(className); - }, - - toggleClass: function toggleClass(classesStr, toggle) { - var classes = classesStr.match(/\S+/g) || []; - var self = this; - var changed = []; // eles who had classes changed - - for (var i = 0, il = self.length; i < il; i++) { - var _ele = self[i]; - var _changedEle = false; - - for (var j = 0; j < classes.length; j++) { - var cls = classes[j]; - var _eleClasses = _ele._private.classes; - var hasClass = _eleClasses.has(cls); - var shouldAdd = toggle || toggle === undefined && !hasClass; - - if (shouldAdd) { - _eleClasses.add(cls); - - if (!hasClass && !_changedEle) { - changed.push(_ele); - _changedEle = true; - } - } else { - // then remove - _eleClasses.delete(cls); - - if (hasClass && !_changedEle) { - changed.push(_ele); - _changedEle = true; - } - } - } // for j classes - } // for i eles - - // trigger update style on those eles that had class changes - if (changed.length > 0) { - this.spawn(changed).updateStyle().emit('class'); - } - - return self; - }, - - removeClass: function removeClass(classes) { - return this.toggleClass(classes, false); - }, - - flashClass: function flashClass(classes, duration) { - var self = this; - - if (duration == null) { - duration = 250; - } else if (duration === 0) { - return self; // nothing to do really - } - - self.addClass(classes); - setTimeout(function () { - self.removeClass(classes); - }, duration); - - return self; - } -}; - -module.exports = elesfn; - -/***/ }), -/* 48 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var Selector = __webpack_require__(6); - -var elesfn = { - allAre: function allAre(selector) { - var selObj = new Selector(selector); - - return this.every(function (ele) { - return selObj.matches(ele); - }); - }, - - is: function is(selector) { - var selObj = new Selector(selector); - - return this.some(function (ele) { - return selObj.matches(ele); - }); - }, - - some: function some(fn, thisArg) { - for (var i = 0; i < this.length; i++) { - var ret = !thisArg ? fn(this[i], i, this) : fn.apply(thisArg, [this[i], i, this]); - - if (ret) { - return true; - } - } - - return false; - }, - - every: function every(fn, thisArg) { - for (var i = 0; i < this.length; i++) { - var ret = !thisArg ? fn(this[i], i, this) : fn.apply(thisArg, [this[i], i, this]); - - if (!ret) { - return false; - } - } - - return true; - }, - - same: function same(collection) { - collection = this.cy().collection(collection); - - // cheap extra check - if (this.length !== collection.length) { - return false; - } - - return this.every(function (ele) { - return collection.hasElementWithId(ele.id()); - }); - }, - - anySame: function anySame(collection) { - collection = this.cy().collection(collection); - - return this.some(function (ele) { - return collection.hasElementWithId(ele.id()); - }); - }, - - allAreNeighbors: function allAreNeighbors(collection) { - collection = this.cy().collection(collection); - - var nhood = this.neighborhood(); - - return collection.every(function (ele) { - return nhood.hasElementWithId(ele.id()); - }); - }, - - contains: function contains(collection) { - collection = this.cy().collection(collection); - - var self = this; - - return collection.every(function (ele) { - return self.hasElementWithId(ele.id()); - }); - } -}; - -elesfn.allAreNeighbours = elesfn.allAreNeighbors; -elesfn.has = elesfn.contains; - -module.exports = elesfn; - -/***/ }), -/* 49 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var exprs = __webpack_require__(50); -var newQuery = __webpack_require__(10); - -// of all the expressions, find the first match in the remaining text -var consumeExpr = function consumeExpr(remaining) { - var expr = void 0; - var match = void 0; - var name = void 0; - - for (var j = 0; j < exprs.length; j++) { - var e = exprs[j]; - var n = e.name; - - var m = remaining.match(e.regexObj); - - if (m != null) { - match = m; - expr = e; - name = n; - - var consumed = m[0]; - remaining = remaining.substring(consumed.length); - - break; // we've consumed one expr, so we can return now - } - } - - return { - expr: expr, - match: match, - name: name, - remaining: remaining - }; -}; - -// consume all leading whitespace -var consumeWhitespace = function consumeWhitespace(remaining) { - var match = remaining.match(/^\s+/); - - if (match) { - var consumed = match[0]; - remaining = remaining.substring(consumed.length); - } - - return remaining; -}; - -var parse = function parse(selector) { - var self = this; - - var remaining = self._private.selectorText = selector; - - var currentQuery = self[0] = newQuery(); - self.length = 1; - - remaining = consumeWhitespace(remaining); // get rid of leading whitespace - - for (;;) { - var check = consumeExpr(remaining); - - if (check.expr == null) { - util.error('The selector `' + selector + '`is invalid'); - return false; - } else { - var args = check.match.slice(1); - - // let the token populate the selector object in currentQuery - var ret = check.expr.populate(self, currentQuery, args); - - if (ret === false) { - return false; // exit if population failed - } else if (ret != null) { - currentQuery = ret; // change the current query to be filled if the expr specifies - } - } - - remaining = check.remaining; - - // we're done when there's nothing left to parse - if (remaining.match(/^\s*$/)) { - break; - } - } - - // adjust references for subject - for (var j = 0; j < self.length; j++) { - var query = self[j]; - - if (query.subject != null) { - // go up the tree until we reach the subject - for (;;) { - if (query.subject === query) { - break; - } // done if subject is self - - if (query.parent != null) { - // swap parent/child reference - var parent = query.parent; - var child = query; - - child.parent = null; - parent.child = child; - - query = parent; // go up the tree - } else if (query.ancestor != null) { - // swap ancestor/descendant - var ancestor = query.ancestor; - var descendant = query; - - descendant.ancestor = null; - ancestor.descendant = descendant; - - query = ancestor; // go up the tree - } else if (query.source || query.target || query.connectedNodes) { - util.error('The selector `' + self.text() + '` can not contain a subject selector that applies to the source or target of an edge selector'); - return false; - } else { - util.error('When adjusting references for the selector `' + self.text() + '`, neither parent nor ancestor was found'); - return false; - } - } // for - - self[j] = query.subject; // subject should be the root query - } // if - } // for - - return true; // success -}; - -module.exports = { parse: parse }; - -/***/ }), -/* 50 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _slicedToArray = function () { function sliceIterator(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"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -var _require = __webpack_require__(15), - stateSelectorRegex = _require.stateSelectorRegex; - -var tokens = __webpack_require__(51); -var util = __webpack_require__(1); -var newQuery = __webpack_require__(10); - -// when a token like a variable has escaped meta characters, we need to clean the backslashes out -// so that values get compared properly in Selector.filter() -var cleanMetaChars = function cleanMetaChars(str) { - return str.replace(new RegExp('\\\\(' + tokens.metaChar + ')', 'g'), function (match, $1) { - return $1; - }); -}; - -var replaceLastQuery = function replaceLastQuery(selector, examiningQuery, replacementQuery) { - if (examiningQuery === selector[selector.length - 1]) { - selector[selector.length - 1] = replacementQuery; - } -}; - -// NOTE: add new expression syntax here to have it recognised by the parser; -// - a query contains all adjacent (i.e. no separator in between) expressions; -// - the current query is stored in selector[i] --- you can use the reference to `this` in the populate function; -// - you need to check the query objects in Selector.filter() for it actually filter properly, but that's pretty straight forward -// - when you add something here, also add to Selector.toString() -var exprs = [{ - name: 'group', - query: true, - regex: '(' + tokens.group + ')', - populate: function populate(selector, query, _ref) { - var _ref2 = _slicedToArray(_ref, 1), - group = _ref2[0]; - - query.group = group === '*' ? group : group + 's'; - } -}, { - name: 'state', - query: true, - regex: stateSelectorRegex, - populate: function populate(selector, query, _ref3) { - var _ref4 = _slicedToArray(_ref3, 1), - state = _ref4[0]; - - query.colonSelectors.push(state); - } -}, { - name: 'id', - query: true, - regex: '\\#(' + tokens.id + ')', - populate: function populate(selector, query, _ref5) { - var _ref6 = _slicedToArray(_ref5, 1), - id = _ref6[0]; - - query.ids.push(cleanMetaChars(id)); - } -}, { - name: 'className', - query: true, - regex: '\\.(' + tokens.className + ')', - populate: function populate(selector, query, _ref7) { - var _ref8 = _slicedToArray(_ref7, 1), - className = _ref8[0]; - - query.classes.push(cleanMetaChars(className)); - } -}, { - name: 'dataExists', - query: true, - regex: '\\[\\s*(' + tokens.variable + ')\\s*\\]', - populate: function populate(selector, query, _ref9) { - var _ref10 = _slicedToArray(_ref9, 1), - variable = _ref10[0]; - - query.data.push({ - field: cleanMetaChars(variable) - }); - } -}, { - name: 'dataCompare', - query: true, - regex: '\\[\\s*(' + tokens.variable + ')\\s*(' + tokens.comparatorOp + ')\\s*(' + tokens.value + ')\\s*\\]', - populate: function populate(selector, query, _ref11) { - var _ref12 = _slicedToArray(_ref11, 3), - variable = _ref12[0], - comparatorOp = _ref12[1], - value = _ref12[2]; - - var valueIsString = new RegExp('^' + tokens.string + '$').exec(value) != null; - - if (valueIsString) { - value = value.substring(1, value.length - 1); - } else { - value = parseFloat(value); - } - - query.data.push({ - field: cleanMetaChars(variable), - operator: comparatorOp, - value: value - }); - } -}, { - name: 'dataBool', - query: true, - regex: '\\[\\s*(' + tokens.boolOp + ')\\s*(' + tokens.variable + ')\\s*\\]', - populate: function populate(selector, query, _ref13) { - var _ref14 = _slicedToArray(_ref13, 2), - boolOp = _ref14[0], - variable = _ref14[1]; - - query.data.push({ - field: cleanMetaChars(variable), - operator: boolOp - }); - } -}, { - name: 'metaCompare', - query: true, - regex: '\\[\\[\\s*(' + tokens.meta + ')\\s*(' + tokens.comparatorOp + ')\\s*(' + tokens.number + ')\\s*\\]\\]', - populate: function populate(selector, query, _ref15) { - var _ref16 = _slicedToArray(_ref15, 3), - meta = _ref16[0], - comparatorOp = _ref16[1], - number = _ref16[2]; - - query.meta.push({ - field: cleanMetaChars(meta), - operator: comparatorOp, - value: parseFloat(number) - }); - } -}, { - name: 'nextQuery', - separator: true, - regex: tokens.separator, - populate: function populate(selector) { - // go on to next query - var nextQuery = selector[selector.length++] = newQuery(); - selector.currentSubject = null; - - return nextQuery; - } -}, { - name: 'directedEdge', - separator: true, - regex: tokens.directedEdge, - populate: function populate(selector, query) { - var edgeQuery = newQuery(); - var source = query; - var target = newQuery(); - - edgeQuery.group = 'edges'; - edgeQuery.target = target; - edgeQuery.source = source; - edgeQuery.subject = selector.currentSubject; - - // the query in the selector should be the edge rather than the source - replaceLastQuery(selector, query, edgeQuery); - - // we're now populating the target query with expressions that follow - return target; - } -}, { - name: 'undirectedEdge', - separator: true, - regex: tokens.undirectedEdge, - populate: function populate(selector, query) { - var edgeQuery = newQuery(); - var source = query; - var target = newQuery(); - - edgeQuery.group = 'edges'; - edgeQuery.connectedNodes = [source, target]; - edgeQuery.subject = selector.currentSubject; - - // the query in the selector should be the edge rather than the source - replaceLastQuery(selector, query, edgeQuery); - - // we're now populating the target query with expressions that follow - return target; - } -}, { - name: 'child', - separator: true, - regex: tokens.child, - populate: function populate(selector, query) { - // this query is the parent of the following query - var childQuery = newQuery(); - childQuery.parent = query; - childQuery.subject = selector.currentSubject; - - // it's cheaper to compare children first and go up so replace the parent - replaceLastQuery(selector, query, childQuery); - - // we're now populating the child query with expressions that follow - return childQuery; - } -}, { - name: 'descendant', - separator: true, - regex: tokens.descendant, - populate: function populate(selector, query) { - // this query is the ancestor of the following query - var descendantQuery = newQuery(); - descendantQuery.ancestor = query; - descendantQuery.subject = selector.currentSubject; - - // it's cheaper to compare descendants first and go up so replace the ancestor - replaceLastQuery(selector, query, descendantQuery); - - // we're now populating the descendant query with expressions that follow - return descendantQuery; - } -}, { - name: 'subject', - modifier: true, - regex: tokens.subject, - populate: function populate(selector, query) { - if (selector.currentSubject != null && query.subject != query) { - util.error('Redefinition of subject in selector `' + selector.toString() + '`'); - return false; - } - - selector.currentSubject = query; - query.subject = query; - selector[selector.length - 1].subject = query; - } -}]; - -exprs.forEach(function (e) { - return e.regexObj = new RegExp('^' + e.regex); -}); - -module.exports = exprs; - -/***/ }), -/* 51 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); - -// tokens in the query language -var tokens = { - metaChar: '[\\!\\"\\#\\$\\%\\&\\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]', // chars we need to escape in let names, etc - comparatorOp: '=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=', // binary comparison op (used in data selectors) - boolOp: '\\?|\\!|\\^', // boolean (unary) operators (used in data selectors) - string: '"(?:\\\\"|[^"])*"' + '|' + "'(?:\\\\'|[^'])*'", // string literals (used in data selectors) -- doublequotes | singlequotes - number: util.regex.number, // number literal (used in data selectors) --- e.g. 0.1234, 1234, 12e123 - meta: 'degree|indegree|outdegree', // allowed metadata fields (i.e. allowed functions to use from Collection) - separator: '\\s*,\\s*', // queries are separated by commas, e.g. edge[foo = 'bar'], node.someClass - descendant: '\\s+', - child: '\\s+>\\s+', - subject: '\\$', - group: 'node|edge|\\*', - directedEdge: '\\s+->\\s+', - undirectedEdge: '\\s+<->\\s+' -}; -tokens.variable = '(?:[\\w-]|(?:\\\\' + tokens.metaChar + '))+'; // a variable name -tokens.value = tokens.string + '|' + tokens.number; // a value literal, either a string or number -tokens.className = tokens.variable; // a class name (follows variable conventions) -tokens.id = tokens.variable; // an element id (follows variable conventions) - -(function () { - var ops = void 0, - op = void 0, - i = void 0; - - // add @ variants to comparatorOp - ops = tokens.comparatorOp.split('|'); - for (i = 0; i < ops.length; i++) { - op = ops[i]; - tokens.comparatorOp += '|@' + op; - } - - // add ! variants to comparatorOp - ops = tokens.comparatorOp.split('|'); - for (i = 0; i < ops.length; i++) { - op = ops[i]; - - if (op.indexOf('!') >= 0) { - continue; - } // skip ops that explicitly contain ! - if (op === '=') { - continue; - } // skip = b/c != is explicitly defined - - tokens.comparatorOp += '|\\!' + op; - } -})(); - -module.exports = tokens; - -/***/ }), -/* 52 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _require = __webpack_require__(15), - stateSelectorMatches = _require.stateSelectorMatches; - -var is = __webpack_require__(0); - -// generic checking for data/metadata -var operandsMatch = function operandsMatch(query, params) { - var allDataMatches = true; - for (var k = 0; k < query[params.name].length; k++) { - var data = query[params.name][k]; - var operator = data.operator; - var value = data.value; - var field = data.field; - var _matches = void 0; - var fieldVal = params.fieldValue(field); - - if (operator != null && value != null) { - var fieldStr = !is.string(fieldVal) && !is.number(fieldVal) ? '' : '' + fieldVal; - var valStr = '' + value; - - var caseInsensitive = false; - if (operator.indexOf('@') >= 0) { - fieldStr = fieldStr.toLowerCase(); - valStr = valStr.toLowerCase(); - - operator = operator.replace('@', ''); - caseInsensitive = true; - } - - var notExpr = false; - if (operator.indexOf('!') >= 0) { - operator = operator.replace('!', ''); - notExpr = true; - } - - // if we're doing a case insensitive comparison, then we're using a STRING comparison - // even if we're comparing numbers - if (caseInsensitive) { - value = valStr.toLowerCase(); - fieldVal = fieldStr.toLowerCase(); - } - - var isIneqCmp = false; - - switch (operator) { - case '*=': - _matches = fieldStr.indexOf(valStr) >= 0; - break; - case '$=': - _matches = fieldStr.indexOf(valStr, fieldStr.length - valStr.length) >= 0; - break; - case '^=': - _matches = fieldStr.indexOf(valStr) === 0; - break; - case '=': - _matches = fieldVal === value; - break; - case '>': - isIneqCmp = true; - _matches = fieldVal > value; - break; - case '>=': - isIneqCmp = true; - _matches = fieldVal >= value; - break; - case '<': - isIneqCmp = true; - _matches = fieldVal < value; - break; - case '<=': - isIneqCmp = true; - _matches = fieldVal <= value; - break; - default: - _matches = false; - break; - } - - // apply the not op, but null vals for inequalities should always stay non-matching - if (notExpr && (fieldVal != null || !isIneqCmp)) { - _matches = !_matches; - } - } else if (operator != null) { - switch (operator) { - case '?': - _matches = fieldVal ? true : false; - break; - case '!': - _matches = fieldVal ? false : true; - break; - case '^': - _matches = fieldVal === undefined; - break; - } - } else { - _matches = fieldVal !== undefined; - } - - if (!_matches) { - allDataMatches = false; - break; - } - } // for - - return allDataMatches; -}; // operandsMatch - -// check parent/child relations -var confirmRelations = function confirmRelations(query, isNecessary, eles) { - if (query != null) { - var _matches2 = false; - - if (!isNecessary) { - return false; - } - - eles = eles(); // save cycles if query == null - - // query must match for at least one element (may be recursive) - for (var i = 0; i < eles.length; i++) { - if (queryMatches(query, eles[i])) { - _matches2 = true; - break; - } - } - - return _matches2; - } else { - return true; - } -}; - -var queryMatches = function queryMatches(query, ele) { - // make single group-only selectors really cheap to check since they're the most common ones - if (query.groupOnly) { - return query.group === '*' || query.group === ele.group(); - } - - // check group - if (query.group != null && query.group != '*' && query.group != ele.group()) { - return false; - } - - var cy = ele.cy(); - var k = void 0; - - // check colon selectors - var allColonSelectorsMatch = true; - for (k = 0; k < query.colonSelectors.length; k++) { - var sel = query.colonSelectors[k]; - - allColonSelectorsMatch = stateSelectorMatches(sel, ele); - - if (!allColonSelectorsMatch) break; - } - if (!allColonSelectorsMatch) return false; - - // check id - var allIdsMatch = true; - for (k = 0; k < query.ids.length; k++) { - var id = query.ids[k]; - var actualId = ele.id(); - - allIdsMatch = allIdsMatch && id == actualId; - - if (!allIdsMatch) break; - } - if (!allIdsMatch) return false; - - // check classes - var allClassesMatch = true; - for (k = 0; k < query.classes.length; k++) { - var cls = query.classes[k]; - - allClassesMatch = allClassesMatch && ele.hasClass(cls); - - if (!allClassesMatch) break; - } - if (!allClassesMatch) return false; - - // check data matches - var allDataMatches = operandsMatch(query, { - name: 'data', - fieldValue: function fieldValue(field) { - return ele.data(field); - } - }); - - if (!allDataMatches) { - return false; - } - - // check metadata matches - var allMetaMatches = operandsMatch(query, { - name: 'meta', - fieldValue: function fieldValue(field) { - return ele[field](); - } - }); - - if (!allMetaMatches) { - return false; - } - - // check collection - if (query.collection != null) { - var matchesAny = query.collection.hasElementWithId(ele.id()); - - if (!matchesAny) { - return false; - } - } - - // check filter function - if (query.filter != null && ele.collection().some(query.filter)) { - return false; - } - - var isCompound = cy.hasCompoundNodes(); - var getSource = function getSource() { - return ele.source(); - }; - var getTarget = function getTarget() { - return ele.target(); - }; - - if (!confirmRelations(query.parent, isCompound, function () { - return ele.parent(); - })) { - return false; - } - - if (!confirmRelations(query.ancestor, isCompound, function () { - return ele.parents(); - })) { - return false; - } - - if (!confirmRelations(query.child, isCompound, function () { - return ele.children(); - })) { - return false; - } - - if (!confirmRelations(query.descendant, isCompound, function () { - return ele.descendants(); - })) { - return false; - } - - if (!confirmRelations(query.source, true, getSource)) { - return false; - } - - if (!confirmRelations(query.target, true, getTarget)) { - return false; - } - - if (query.connectedNodes) { - var q0 = query.connectedNodes[0]; - var q1 = query.connectedNodes[1]; - - if (confirmRelations(q0, true, getSource) && confirmRelations(q1, true, getTarget)) { - // match - } else if (confirmRelations(q0, true, getTarget) && confirmRelations(q1, true, getSource)) { - // match - } else { - return false; - } - } - - // we've reached the end, so we've matched everything for this query - return true; -}; // queryMatches - -// filter an existing collection -var filter = function filter(collection) { - var self = this; - var cy = collection.cy(); - - // don't bother trying if it's invalid - if (self.invalid()) { - return cy.collection(); - } - - // for 1 id #foo queries, just get the element - if (self.length === 1 && self[0].length === 1 && self[0].ids.length === 1) { - return collection.getElementById(self[0].ids[0]).collection(); - } - - var selectorFunction = function selectorFunction(element) { - for (var j = 0; j < self.length; j++) { - var query = self[j]; - - if (queryMatches(query, element)) { - return true; - } - } - - return false; - }; - - if (self.text() == null) { - selectorFunction = function selectorFunction() { - return true; - }; - } - - var filteredCollection = collection.filter(selectorFunction); - - return filteredCollection; -}; // filter - -// does selector match a single element? -var matches = function matches(ele) { - var self = this; - - // don't bother trying if it's invalid - if (self.invalid()) { - return false; - } - - for (var j = 0; j < self.length; j++) { - var query = self[j]; - - if (queryMatches(query, ele)) { - return true; - } - } - - return false; -}; // filter - -module.exports = { matches: matches, filter: filter }; - -/***/ }), -/* 53 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Set = __webpack_require__(8); - -var elesfn = { - parent: function parent(selector) { - var parents = []; - - // optimisation for single ele call - if (this.length === 1) { - var parent = this[0]._private.parent; - - if (parent) { - return parent; - } - } - - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - var _parent = ele._private.parent; - - if (_parent) { - parents.push(_parent); - } - } - - return this.spawn(parents, { unique: true }).filter(selector); - }, - - parents: function parents(selector) { - var parents = []; - - var eles = this.parent(); - while (eles.nonempty()) { - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - parents.push(ele); - } - - eles = eles.parent(); - } - - return this.spawn(parents, { unique: true }).filter(selector); - }, - - commonAncestors: function commonAncestors(selector) { - var ancestors = void 0; - - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - var parents = ele.parents(); - - ancestors = ancestors || parents; - - ancestors = ancestors.intersect(parents); // current list must be common with current ele parents set - } - - return ancestors.filter(selector); - }, - - orphans: function orphans(selector) { - return this.stdFilter(function (ele) { - return ele.isOrphan(); - }).filter(selector); - }, - - nonorphans: function nonorphans(selector) { - return this.stdFilter(function (ele) { - return ele.isChild(); - }).filter(selector); - }, - - children: function children(selector) { - var children = []; - - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - children = children.concat(ele._private.children); - } - - return this.spawn(children, { unique: true }).filter(selector); - }, - - siblings: function siblings(selector) { - return this.parent().children().not(this).filter(selector); - }, - - isParent: function isParent() { - var ele = this[0]; - - if (ele) { - return ele.isNode() && ele._private.children.length !== 0; - } - }, - - isChildless: function isChildless() { - var ele = this[0]; - - if (ele) { - return ele.isNode() && ele._private.children.length === 0; - } - }, - - isChild: function isChild() { - var ele = this[0]; - - if (ele) { - return ele.isNode() && ele._private.parent != null; - } - }, - - isOrphan: function isOrphan() { - var ele = this[0]; - - if (ele) { - return ele.isNode() && ele._private.parent == null; - } - }, - - descendants: function descendants(selector) { - var elements = []; - - function add(eles) { - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - - elements.push(ele); - - if (ele.children().nonempty()) { - add(ele.children()); - } - } - } - - add(this.children()); - - return this.spawn(elements, { unique: true }).filter(selector); - } -}; - -function forEachCompound(eles, fn, includeSelf, recursiveStep) { - var q = []; - var did = new Set(); - var cy = eles.cy(); - var hasCompounds = cy.hasCompoundNodes(); - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - - if (includeSelf) { - q.push(ele); - } else if (hasCompounds) { - recursiveStep(q, did, ele); - } - } - - while (q.length > 0) { - var _ele = q.shift(); - - fn(_ele); - - did.add(_ele.id()); - - if (hasCompounds) { - recursiveStep(q, did, _ele); - } - } - - return eles; -} - -function addChildren(q, did, ele) { - if (ele.isParent()) { - var children = ele._private.children; - - for (var i = 0; i < children.length; i++) { - var child = children[i]; - - if (!did.has(child.id())) { - q.push(child); - } - } - } -} - -// very efficient version of eles.add( eles.descendants() ).forEach() -// for internal use -elesfn.forEachDown = function (fn) { - var includeSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - - return forEachCompound(this, fn, includeSelf, addChildren); -}; - -function addParent(q, did, ele) { - if (ele.isChild()) { - var parent = ele._private.parent; - - if (!did.has(parent.id())) { - q.push(parent); - } - } -} - -elesfn.forEachUp = function (fn) { - var includeSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - - return forEachCompound(this, fn, includeSelf, addParent); -}; - -function addParentAndChildren(q, did, ele) { - addParent(q, did, ele); - addChildren(q, did, ele); -} - -elesfn.forEachUpAndDown = function (fn) { - var includeSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - - return forEachCompound(this, fn, includeSelf, addParentAndChildren); -}; - -// aliases -elesfn.ancestors = elesfn.parents; - -module.exports = elesfn; - -/***/ }), -/* 54 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var define = __webpack_require__(4); -var fn = void 0, - elesfn = void 0; - -fn = elesfn = { - - data: define.data({ - field: 'data', - bindingEvent: 'data', - allowBinding: true, - allowSetting: true, - settingEvent: 'data', - settingTriggersEvent: true, - triggerFnName: 'trigger', - allowGetting: true, - immutableKeys: { - 'id': true, - 'source': true, - 'target': true, - 'parent': true - }, - updateStyle: true - }), - - removeData: define.removeData({ - field: 'data', - event: 'data', - triggerFnName: 'trigger', - triggerEvent: true, - immutableKeys: { - 'id': true, - 'source': true, - 'target': true, - 'parent': true - }, - updateStyle: true - }), - - scratch: define.data({ - field: 'scratch', - bindingEvent: 'scratch', - allowBinding: true, - allowSetting: true, - settingEvent: 'scratch', - settingTriggersEvent: true, - triggerFnName: 'trigger', - allowGetting: true, - updateStyle: true - }), - - removeScratch: define.removeData({ - field: 'scratch', - event: 'scratch', - triggerFnName: 'trigger', - triggerEvent: true, - updateStyle: true - }), - - rscratch: define.data({ - field: 'rscratch', - allowBinding: false, - allowSetting: true, - settingTriggersEvent: false, - allowGetting: true - }), - - removeRscratch: define.removeData({ - field: 'rscratch', - triggerEvent: false - }), - - id: function id() { - var ele = this[0]; - - if (ele) { - return ele._private.data.id; - } - } - -}; - -// aliases -fn.attr = fn.data; -fn.removeAttr = fn.removeData; - -module.exports = elesfn; - -/***/ }), -/* 55 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); - -var elesfn = {}; - -function defineDegreeFunction(callback) { - return function (includeLoops) { - var self = this; - - if (includeLoops === undefined) { - includeLoops = true; - } - - if (self.length === 0) { - return; - } - - if (self.isNode() && !self.removed()) { - var degree = 0; - var node = self[0]; - var connectedEdges = node._private.edges; - - for (var i = 0; i < connectedEdges.length; i++) { - var edge = connectedEdges[i]; - - if (!includeLoops && edge.isLoop()) { - continue; - } - - degree += callback(node, edge); - } - - return degree; - } else { - return; - } - }; -} - -util.extend(elesfn, { - degree: defineDegreeFunction(function (node, edge) { - if (edge.source().same(edge.target())) { - return 2; - } else { - return 1; - } - }), - - indegree: defineDegreeFunction(function (node, edge) { - if (edge.target().same(node)) { - return 1; - } else { - return 0; - } - }), - - outdegree: defineDegreeFunction(function (node, edge) { - if (edge.source().same(node)) { - return 1; - } else { - return 0; - } - }) -}); - -function defineDegreeBoundsFunction(degreeFn, callback) { - return function (includeLoops) { - var ret = void 0; - var nodes = this.nodes(); - - for (var i = 0; i < nodes.length; i++) { - var ele = nodes[i]; - var degree = ele[degreeFn](includeLoops); - if (degree !== undefined && (ret === undefined || callback(degree, ret))) { - ret = degree; - } - } - - return ret; - }; -} - -util.extend(elesfn, { - minDegree: defineDegreeBoundsFunction('degree', function (degree, min) { - return degree < min; - }), - - maxDegree: defineDegreeBoundsFunction('degree', function (degree, max) { - return degree > max; - }), - - minIndegree: defineDegreeBoundsFunction('indegree', function (degree, min) { - return degree < min; - }), - - maxIndegree: defineDegreeBoundsFunction('indegree', function (degree, max) { - return degree > max; - }), - - minOutdegree: defineDegreeBoundsFunction('outdegree', function (degree, min) { - return degree < min; - }), - - maxOutdegree: defineDegreeBoundsFunction('outdegree', function (degree, max) { - return degree > max; - }) -}); - -util.extend(elesfn, { - totalDegree: function totalDegree(includeLoops) { - var total = 0; - var nodes = this.nodes(); - - for (var i = 0; i < nodes.length; i++) { - total += nodes[i].degree(includeLoops); - } - - return total; - } -}); - -module.exports = elesfn; - -/***/ }), -/* 56 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var position = __webpack_require__(57); -var bounds = __webpack_require__(58); -var widthHeight = __webpack_require__(59); -var edgePoints = __webpack_require__(60); - -module.exports = util.assign({}, position, bounds, widthHeight, edgePoints); - -/***/ }), -/* 57 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var define = __webpack_require__(4); -var is = __webpack_require__(0); -var math = __webpack_require__(2); -var fn = void 0, - elesfn = void 0; - -var beforePositionSet = function beforePositionSet(eles, newPos) { - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - - if (ele.isParent() && !ele.locked()) { - var oldPos = ele._private.position; - var delta = { - x: newPos.x - oldPos.x, - y: newPos.y - oldPos.y - }; - - eles.children().shift(delta); - } - } -}; - -fn = elesfn = { - - position: define.data({ - field: 'position', - bindingEvent: 'position', - allowBinding: true, - allowSetting: true, - settingEvent: 'position', - settingTriggersEvent: true, - triggerFnName: 'emitAndNotify', - allowGetting: true, - validKeys: ['x', 'y'], - beforeGet: function beforeGet(ele) { - ele.updateCompoundBounds(); - }, - beforeSet: beforePositionSet, - onSet: function onSet(eles) { - eles.dirtyCompoundBoundsCache(); - }, - canSet: function canSet(ele) { - return !ele.locked(); - } - }), - - // position but no notification to renderer - silentPosition: define.data({ - field: 'position', - bindingEvent: 'position', - allowBinding: false, - allowSetting: true, - settingEvent: 'position', - settingTriggersEvent: false, - triggerFnName: 'trigger', - allowGetting: false, - validKeys: ['x', 'y'], - beforeSet: beforePositionSet, - onSet: function onSet(eles) { - eles.dirtyCompoundBoundsCache(); - }, - canSet: function canSet(ele) { - return !ele.locked(); - } - }), - - positions: function positions(pos, silent) { - if (is.plainObject(pos)) { - if (silent) { - this.silentPosition(pos); - } else { - this.position(pos); - } - } else if (is.fn(pos)) { - var _fn = pos; - var cy = this.cy(); - - cy.startBatch(); - - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - var _pos = void 0; - - if (_pos = _fn(ele, i)) { - if (silent) { - ele.silentPosition(_pos); - } else { - ele.position(_pos); - } - } - } - - cy.endBatch(); - } - - return this; // chaining - }, - - silentPositions: function silentPositions(pos) { - return this.positions(pos, true); - }, - - shift: function shift(dim, val) { - var delta = void 0; - - if (is.plainObject(dim)) { - delta = dim; - } else if (is.string(dim) && is.number(val)) { - delta = { x: 0, y: 0 }; - - delta[dim] = val; - } - - if (delta != null) { - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - var pos = ele.position(); - - ele.position({ - x: pos.x + delta.x, - y: pos.y + delta.y - }); - } - } - - return this; - }, - - // get/set the rendered (i.e. on screen) positon of the element - renderedPosition: function renderedPosition(dim, val) { - var ele = this[0]; - var cy = this.cy(); - var zoom = cy.zoom(); - var pan = cy.pan(); - var rpos = is.plainObject(dim) ? dim : undefined; - var setting = rpos !== undefined || val !== undefined && is.string(dim); - - if (ele && ele.isNode()) { - // must have an element and must be a node to return position - if (setting) { - for (var i = 0; i < this.length; i++) { - var _ele = this[i]; - - if (val !== undefined) { - // set one dimension - _ele.position(dim, (val - pan[dim]) / zoom); - } else if (rpos !== undefined) { - // set whole position - _ele.position(math.renderedToModelPosition(rpos, zoom, pan)); - } - } - } else { - // getting - var pos = ele.position(); - rpos = math.modelToRenderedPosition(pos, zoom, pan); - - if (dim === undefined) { - // then return the whole rendered position - return rpos; - } else { - // then return the specified dimension - return rpos[dim]; - } - } - } else if (!setting) { - return undefined; // for empty collection case - } - - return this; // chaining - }, - - // get/set the position relative to the parent - relativePosition: function relativePosition(dim, val) { - var ele = this[0]; - var cy = this.cy(); - var ppos = is.plainObject(dim) ? dim : undefined; - var setting = ppos !== undefined || val !== undefined && is.string(dim); - var hasCompoundNodes = cy.hasCompoundNodes(); - - if (ele && ele.isNode()) { - // must have an element and must be a node to return position - if (setting) { - for (var i = 0; i < this.length; i++) { - var _ele2 = this[i]; - var parent = hasCompoundNodes ? _ele2.parent() : null; - var hasParent = parent && parent.length > 0; - var relativeToParent = hasParent; - - if (hasParent) { - parent = parent[0]; - } - - var origin = relativeToParent ? parent.position() : { x: 0, y: 0 }; - - if (val !== undefined) { - // set one dimension - _ele2.position(dim, val + origin[dim]); - } else if (ppos !== undefined) { - // set whole position - _ele2.position({ - x: ppos.x + origin.x, - y: ppos.y + origin.y - }); - } - } - } else { - // getting - var pos = ele.position(); - var _parent = hasCompoundNodes ? ele.parent() : null; - var _hasParent = _parent && _parent.length > 0; - var _relativeToParent = _hasParent; - - if (_hasParent) { - _parent = _parent[0]; - } - - var _origin = _relativeToParent ? _parent.position() : { x: 0, y: 0 }; - - ppos = { - x: pos.x - _origin.x, - y: pos.y - _origin.y - }; - - if (dim === undefined) { - // then return the whole rendered position - return ppos; - } else { - // then return the specified dimension - return ppos[dim]; - } - } - } else if (!setting) { - return undefined; // for empty collection case - } - - return this; // chaining - } -}; - -// aliases -fn.modelPosition = fn.point = fn.position; -fn.modelPositions = fn.points = fn.positions; -fn.renderedPoint = fn.renderedPosition; -fn.relativePoint = fn.relativePosition; - -module.exports = elesfn; - -/***/ }), -/* 58 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var util = __webpack_require__(1); -var math = __webpack_require__(2); -var fn = void 0, - elesfn = void 0; - -fn = elesfn = {}; - -elesfn.renderedBoundingBox = function (options) { - var bb = this.boundingBox(options); - var cy = this.cy(); - var zoom = cy.zoom(); - var pan = cy.pan(); - - var x1 = bb.x1 * zoom + pan.x; - var x2 = bb.x2 * zoom + pan.x; - var y1 = bb.y1 * zoom + pan.y; - var y2 = bb.y2 * zoom + pan.y; - - return { - x1: x1, - x2: x2, - y1: y1, - y2: y2, - w: x2 - x1, - h: y2 - y1 - }; -}; - -elesfn.dirtyCompoundBoundsCache = function () { - var cy = this.cy(); - - if (!cy.styleEnabled() || !cy.hasCompoundNodes()) { - return this; - } - - this.forEachUp(function (ele) { - ele._private.compoundBoundsClean = false; - - if (ele.isParent()) { - ele.emit('bounds'); - } - }); - - return this; -}; - -elesfn.updateCompoundBounds = function () { - var cy = this.cy(); - - // save cycles for non compound graphs or when style disabled - if (!cy.styleEnabled() || !cy.hasCompoundNodes()) { - return this; - } - - // save cycles when batching -- but bounds will be stale (or not exist yet) - if (cy.batching()) { - return this; - } - - var updated = []; - - function update(parent) { - if (!parent.isParent()) { - return; - } - - var _p = parent._private; - var children = parent.children(); - var includeLabels = parent.pstyle('compound-sizing-wrt-labels').value === 'include'; - - var min = { - width: { - val: parent.pstyle('min-width').pfValue, - left: parent.pstyle('min-width-bias-left'), - right: parent.pstyle('min-width-bias-right') - }, - height: { - val: parent.pstyle('min-height').pfValue, - top: parent.pstyle('min-height-bias-top'), - bottom: parent.pstyle('min-height-bias-bottom') - } - }; - - var bb = children.boundingBox({ - includeLabels: includeLabels, - includeOverlays: false, - - // updating the compound bounds happens outside of the regular - // cache cycle (i.e. before fired events) - useCache: false - }); - var pos = _p.position; - - // if children take up zero area then keep position and fall back on stylesheet w/h - if (bb.w === 0 || bb.h === 0) { - bb = { - w: parent.pstyle('width').pfValue, - h: parent.pstyle('height').pfValue - }; - - bb.x1 = pos.x - bb.w / 2; - bb.x2 = pos.x + bb.w / 2; - bb.y1 = pos.y - bb.h / 2; - bb.y2 = pos.y + bb.h / 2; - } - - function computeBiasValues(propDiff, propBias, propBiasComplement) { - var biasDiff = 0; - var biasComplementDiff = 0; - var biasTotal = propBias + propBiasComplement; - - if (propDiff > 0 && biasTotal > 0) { - biasDiff = propBias / biasTotal * propDiff; - biasComplementDiff = propBiasComplement / biasTotal * propDiff; - } - return { - biasDiff: biasDiff, - biasComplementDiff: biasComplementDiff - }; - } - - function computePaddingValues(width, height, paddingObject, relativeTo) { - // Assuming percentage is number from 0 to 1 - if (paddingObject.units === '%') { - switch (relativeTo) { - case 'width': - return width > 0 ? paddingObject.pfValue * width : 0; - case 'height': - return height > 0 ? paddingObject.pfValue * height : 0; - case 'average': - return width > 0 && height > 0 ? paddingObject.pfValue * (width + height) / 2 : 0; - case 'min': - return width > 0 && height > 0 ? width > height ? paddingObject.pfValue * height : paddingObject.pfValue * width : 0; - case 'max': - return width > 0 && height > 0 ? width > height ? paddingObject.pfValue * width : paddingObject.pfValue * height : 0; - default: - return 0; - } - } else if (paddingObject.units === 'px') { - return paddingObject.pfValue; - } else { - return 0; - } - } - - var leftVal = min.width.left.value; - if (min.width.left.units === 'px' && min.width.val > 0) { - leftVal = leftVal * 100 / min.width.val; - } - var rightVal = min.width.right.value; - if (min.width.right.units === 'px' && min.width.val > 0) { - rightVal = rightVal * 100 / min.width.val; - } - - var topVal = min.height.top.value; - if (min.height.top.units === 'px' && min.height.val > 0) { - topVal = topVal * 100 / min.height.val; - } - - var bottomVal = min.height.bottom.value; - if (min.height.bottom.units === 'px' && min.height.val > 0) { - bottomVal = bottomVal * 100 / min.height.val; - } - - var widthBiasDiffs = computeBiasValues(min.width.val - bb.w, leftVal, rightVal); - var diffLeft = widthBiasDiffs.biasDiff; - var diffRight = widthBiasDiffs.biasComplementDiff; - - var heightBiasDiffs = computeBiasValues(min.height.val - bb.h, topVal, bottomVal); - var diffTop = heightBiasDiffs.biasDiff; - var diffBottom = heightBiasDiffs.biasComplementDiff; - - _p.autoPadding = computePaddingValues(bb.w, bb.h, parent.pstyle('padding'), parent.pstyle('padding-relative-to').value); - - _p.autoWidth = Math.max(bb.w, min.width.val); - pos.x = (-diffLeft + bb.x1 + bb.x2 + diffRight) / 2; - - _p.autoHeight = Math.max(bb.h, min.height.val); - pos.y = (-diffTop + bb.y1 + bb.y2 + diffBottom) / 2; - - updated.push(parent); - } - - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - var _p = ele._private; - - if (!_p.compoundBoundsClean) { - update(ele); - - if (!cy._private.batchingStyle) { - _p.compoundBoundsClean = true; - } - } - } - - return this; -}; - -var noninf = function noninf(x) { - if (x === Infinity || x === -Infinity) { - return 0; - } - - return x; -}; - -var updateBounds = function updateBounds(b, x1, y1, x2, y2) { - // don't update with zero area boxes - if (x2 - x1 === 0 || y2 - y1 === 0) { - return; - } - - // don't update with null dim - if (x1 == null || y1 == null || x2 == null || y2 == null) { - return; - } - - b.x1 = x1 < b.x1 ? x1 : b.x1; - b.x2 = x2 > b.x2 ? x2 : b.x2; - b.y1 = y1 < b.y1 ? y1 : b.y1; - b.y2 = y2 > b.y2 ? y2 : b.y2; -}; - -var updateBoundsFromBox = function updateBoundsFromBox(b, b2) { - return updateBounds(b, b2.x1, b2.y1, b2.x2, b2.y2); -}; - -var prefixedProperty = function prefixedProperty(obj, field, prefix) { - return util.getPrefixedProperty(obj, field, prefix); -}; - -var updateBoundsFromArrow = function updateBoundsFromArrow(bounds, ele, prefix) { - if (ele.cy().headless()) { - return; - } - - var _p = ele._private; - var rstyle = _p.rstyle; - var halfArW = rstyle.arrowWidth / 2; - var arrowType = ele.pstyle(prefix + '-arrow-shape').value; - var x = void 0; - var y = void 0; - - if (arrowType !== 'none') { - if (prefix === 'source') { - x = rstyle.srcX; - y = rstyle.srcY; - } else if (prefix === 'target') { - x = rstyle.tgtX; - y = rstyle.tgtY; - } else { - x = rstyle.midX; - y = rstyle.midY; - } - - updateBounds(bounds, x - halfArW, y - halfArW, x + halfArW, y + halfArW); - } -}; - -var updateBoundsFromLabel = function updateBoundsFromLabel(bounds, ele, prefix) { - if (ele.cy().headless()) { - return; - } - - var prefixDash = void 0; - - if (prefix) { - prefixDash = prefix + '-'; - } else { - prefixDash = ''; - } - - var _p = ele._private; - var rstyle = _p.rstyle; - var label = ele.pstyle(prefixDash + 'label').strValue; - - if (label) { - var halign = ele.pstyle('text-halign'); - var valign = ele.pstyle('text-valign'); - var labelWidth = prefixedProperty(rstyle, 'labelWidth', prefix); - var labelHeight = prefixedProperty(rstyle, 'labelHeight', prefix); - var labelX = prefixedProperty(rstyle, 'labelX', prefix); - var labelY = prefixedProperty(rstyle, 'labelY', prefix); - var marginX = ele.pstyle(prefixDash + 'text-margin-x').pfValue; - var marginY = ele.pstyle(prefixDash + 'text-margin-y').pfValue; - var isEdge = ele.isEdge(); - var rotation = ele.pstyle(prefixDash + 'text-rotation'); - var outlineWidth = ele.pstyle('text-outline-width').pfValue; - var borderWidth = ele.pstyle('text-border-width').pfValue; - var halfBorderWidth = borderWidth / 2; - var padding = ele.pstyle('text-background-padding').pfValue; - - var lh = labelHeight + 2 * padding; - var lw = labelWidth + 2 * padding; - var lw_2 = lw / 2; - var lh_2 = lh / 2; - var lx1 = void 0, - lx2 = void 0, - ly1 = void 0, - ly2 = void 0; - - if (isEdge) { - lx1 = labelX - lw_2; - lx2 = labelX + lw_2; - ly1 = labelY - lh_2; - ly2 = labelY + lh_2; - } else { - switch (halign.value) { - case 'left': - lx1 = labelX - lw; - lx2 = labelX; - break; - - case 'center': - lx1 = labelX - lw_2; - lx2 = labelX + lw_2; - break; - - case 'right': - lx1 = labelX; - lx2 = labelX + lw; - break; - } - - switch (valign.value) { - case 'top': - ly1 = labelY - lh; - ly2 = labelY; - break; - - case 'center': - ly1 = labelY - lh_2; - ly2 = labelY + lh_2; - break; - - case 'bottom': - ly1 = labelY; - ly2 = labelY + lh; - break; - } - } - - var isAutorotate = isEdge && rotation.strValue === 'autorotate'; - var isPfValue = rotation.pfValue != null && rotation.pfValue !== 0; - - if (isAutorotate || isPfValue) { - var theta = isAutorotate ? prefixedProperty(_p.rstyle, 'labelAngle', prefix) : rotation.pfValue; - var cos = Math.cos(theta); - var sin = Math.sin(theta); - - var rotate = function rotate(x, y) { - x = x - labelX; - y = y - labelY; - - return { - x: x * cos - y * sin + labelX, - y: x * sin + y * cos + labelY - }; - }; - - var px1y1 = rotate(lx1, ly1); - var px1y2 = rotate(lx1, ly2); - var px2y1 = rotate(lx2, ly1); - var px2y2 = rotate(lx2, ly2); - - lx1 = Math.min(px1y1.x, px1y2.x, px2y1.x, px2y2.x); - lx2 = Math.max(px1y1.x, px1y2.x, px2y1.x, px2y2.x); - ly1 = Math.min(px1y1.y, px1y2.y, px2y1.y, px2y2.y); - ly2 = Math.max(px1y1.y, px1y2.y, px2y1.y, px2y2.y); - } - - lx1 += marginX - Math.max(outlineWidth, halfBorderWidth); - lx2 += marginX + Math.max(outlineWidth, halfBorderWidth); - ly1 += marginY - Math.max(outlineWidth, halfBorderWidth); - ly2 += marginY + Math.max(outlineWidth, halfBorderWidth); - - updateBounds(bounds, lx1, ly1, lx2, ly2); - } - - return bounds; -}; - -// get the bounding box of the elements (in raw model position) -var boundingBoxImpl = function boundingBoxImpl(ele, options) { - var cy = ele._private.cy; - var styleEnabled = cy.styleEnabled(); - var headless = cy.headless(); - - var bounds = { - x1: Infinity, - y1: Infinity, - x2: -Infinity, - y2: -Infinity - }; - - var _p = ele._private; - var display = styleEnabled ? ele.pstyle('display').value : 'element'; - var isNode = ele.isNode(); - var isEdge = ele.isEdge(); - var ex1 = void 0, - ex2 = void 0, - ey1 = void 0, - ey2 = void 0; // extrema of body / lines - var x = void 0, - y = void 0; // node pos - var displayed = display !== 'none'; - - if (displayed) { - var overlayOpacity = 0; - var overlayPadding = 0; - - if (styleEnabled && options.includeOverlays) { - overlayOpacity = ele.pstyle('overlay-opacity').value; - - if (overlayOpacity !== 0) { - overlayPadding = ele.pstyle('overlay-padding').value; - } - } - - var w = 0; - var wHalf = 0; - - if (styleEnabled) { - w = ele.pstyle('width').pfValue; - wHalf = w / 2; - } - - if (isNode && options.includeNodes) { - var pos = ele.position(); - x = pos.x; - y = pos.y; - var _w = ele.outerWidth(); - var halfW = _w / 2; - var h = ele.outerHeight(); - var halfH = h / 2; - - // handle node dimensions - ///////////////////////// - - ex1 = x - halfW - overlayPadding; - ex2 = x + halfW + overlayPadding; - ey1 = y - halfH - overlayPadding; - ey2 = y + halfH + overlayPadding; - - updateBounds(bounds, ex1, ey1, ex2, ey2); - } else if (isEdge && options.includeEdges) { - var rstyle = _p.rstyle || {}; - - // handle edge dimensions (rough box estimate) - ////////////////////////////////////////////// - if (styleEnabled && !headless) { - ex1 = Math.min(rstyle.srcX, rstyle.midX, rstyle.tgtX); - ex2 = Math.max(rstyle.srcX, rstyle.midX, rstyle.tgtX); - ey1 = Math.min(rstyle.srcY, rstyle.midY, rstyle.tgtY); - ey2 = Math.max(rstyle.srcY, rstyle.midY, rstyle.tgtY); - - // take into account edge width - ex1 -= wHalf; - ex2 += wHalf; - ey1 -= wHalf; - ey2 += wHalf; - - updateBounds(bounds, ex1, ey1, ex2, ey2); - } - - // precise haystacks - //////////////////// - if (styleEnabled && !headless && ele.pstyle('curve-style').strValue === 'haystack') { - var hpts = rstyle.haystackPts || []; - - ex1 = hpts[0].x; - ey1 = hpts[0].y; - ex2 = hpts[1].x; - ey2 = hpts[1].y; - - if (ex1 > ex2) { - var temp = ex1; - ex1 = ex2; - ex2 = temp; - } - - if (ey1 > ey2) { - var _temp = ey1; - ey1 = ey2; - ey2 = _temp; - } - - updateBounds(bounds, ex1 - wHalf, ey1 - wHalf, ex2 + wHalf, ey2 + wHalf); - - // handle points along edge - /////////////////////////// - } else { - var pts = rstyle.bezierPts || rstyle.linePts || []; - - for (var j = 0; j < pts.length; j++) { - var pt = pts[j]; - - ex1 = pt.x - wHalf; - ex2 = pt.x + wHalf; - ey1 = pt.y - wHalf; - ey2 = pt.y + wHalf; - - updateBounds(bounds, ex1, ey1, ex2, ey2); - } - - // fallback on source and target positions - ////////////////////////////////////////// - if (pts.length === 0) { - var n1 = ele.source(); - var n1pos = n1.position(); - - var n2 = ele.target(); - var n2pos = n2.position(); - - ex1 = n1pos.x; - ex2 = n2pos.x; - ey1 = n1pos.y; - ey2 = n2pos.y; - - if (ex1 > ex2) { - var _temp2 = ex1; - ex1 = ex2; - ex2 = _temp2; - } - - if (ey1 > ey2) { - var _temp3 = ey1; - ey1 = ey2; - ey2 = _temp3; - } - - // take into account edge width - ex1 -= wHalf; - ex2 += wHalf; - ey1 -= wHalf; - ey2 += wHalf; - - updateBounds(bounds, ex1, ey1, ex2, ey2); - } - } - } // edges - - - // handle edge arrow size - ///////////////////////// - - if (styleEnabled && options.includeEdges && isEdge) { - updateBoundsFromArrow(bounds, ele, 'mid-source', options); - updateBoundsFromArrow(bounds, ele, 'mid-target', options); - updateBoundsFromArrow(bounds, ele, 'source', options); - updateBoundsFromArrow(bounds, ele, 'target', options); - } - - // ghost - //////// - - if (styleEnabled) { - var ghost = ele.pstyle('ghost').value === 'yes'; - - if (ghost) { - var gx = ele.pstyle('ghost-offset-x').pfValue; - var gy = ele.pstyle('ghost-offset-y').pfValue; - - updateBounds(bounds, bounds.x1 + gx, bounds.y1 + gy, bounds.x2 + gx, bounds.y2 + gy); - } - } - - // overlay - ////////// - - if (styleEnabled) { - - ex1 = bounds.x1; - ex2 = bounds.x2; - ey1 = bounds.y1; - ey2 = bounds.y2; - - updateBounds(bounds, ex1 - overlayPadding, ey1 - overlayPadding, ex2 + overlayPadding, ey2 + overlayPadding); - } - - // handle label dimensions - ////////////////////////// - - if (styleEnabled && options.includeLabels) { - updateBoundsFromLabel(bounds, ele, null, options); - - if (isEdge) { - updateBoundsFromLabel(bounds, ele, 'source', options); - updateBoundsFromLabel(bounds, ele, 'target', options); - } - } // style enabled for labels - } // if displayed - - bounds.x1 = noninf(bounds.x1); - bounds.y1 = noninf(bounds.y1); - bounds.x2 = noninf(bounds.x2); - bounds.y2 = noninf(bounds.y2); - bounds.w = noninf(bounds.x2 - bounds.x1); - bounds.h = noninf(bounds.y2 - bounds.y1); - - // expand bounds by 1 because antialiasing can increase the visual/effective size by 1 on all sides - if (bounds.w > 0 && bounds.h > 0 && displayed) { - math.expandBoundingBox(bounds, 1); - } - - return bounds; -}; - -var tf = function tf(val) { - if (val) { - return 't'; - } else { - return 'f'; - } -}; - -var getKey = function getKey(opts) { - var key = ''; - - key += tf(opts.incudeNodes); - key += tf(opts.includeEdges); - key += tf(opts.includeLabels); - key += tf(opts.includeOverlays); - - return key; -}; - -var cachedBoundingBoxImpl = function cachedBoundingBoxImpl(ele, opts) { - var _p = ele._private; - var bb = void 0; - var headless = ele.cy().headless(); - var key = opts === defBbOpts ? defBbOptsKey : getKey(opts); - - if (!opts.useCache || headless || !_p.bbCache || !_p.bbCache[key]) { - bb = boundingBoxImpl(ele, opts); - - if (!headless) { - _p.bbCache = _p.bbCache || {}; - _p.bbCache[key] = bb; - } - } else { - bb = _p.bbCache[key]; - } - - return bb; -}; - -var defBbOpts = { - includeNodes: true, - includeEdges: true, - includeLabels: true, - includeOverlays: true, - useCache: true -}; - -var defBbOptsKey = getKey(defBbOpts); - -function filledBbOpts(options) { - return { - includeNodes: util.default(options.includeNodes, defBbOpts.includeNodes), - includeEdges: util.default(options.includeEdges, defBbOpts.includeEdges), - includeLabels: util.default(options.includeLabels, defBbOpts.includeLabels), - includeOverlays: util.default(options.includeOverlays, defBbOpts.includeOverlays), - useCache: util.default(options.useCache, defBbOpts.useCache) - }; -} - -elesfn.boundingBox = function (options) { - // the main usecase is ele.boundingBox() for a single element with no/def options - // specified s.t. the cache is used, so check for this case to make it faster by - // avoiding the overhead of the rest of the function - if (this.length === 1 && this[0]._private.bbCache && (options === undefined || options.useCache === undefined || options.useCache === true)) { - if (options === undefined) { - options = defBbOpts; - } else { - options = filledBbOpts(options); - } - - return cachedBoundingBoxImpl(this[0], options); - } - - var bounds = { - x1: Infinity, - y1: Infinity, - x2: -Infinity, - y2: -Infinity - }; - - options = options || util.staticEmptyObject(); - - var opts = filledBbOpts(options); - - var eles = this; - var cy = eles.cy(); - var styleEnabled = cy.styleEnabled(); - - if (styleEnabled) { - this.recalculateRenderedStyle(opts.useCache); - } - - this.updateCompoundBounds(); - - var updatedEdge = {}; // use to avoid duplicated edge updates - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - - if (styleEnabled && ele.isEdge() && ele.pstyle('curve-style').strValue === 'bezier' && !updatedEdge[ele.id()]) { - var edges = ele.parallelEdges(); - - for (var j = 0; j < edges.length; j++) { - // make all as updated - updatedEdge[edges[j].id()] = true; - } - - edges.recalculateRenderedStyle(opts.useCache); // n.b. ele.parallelEdges() single is cached - } - - updateBoundsFromBox(bounds, cachedBoundingBoxImpl(ele, opts)); - } - - bounds.x1 = noninf(bounds.x1); - bounds.y1 = noninf(bounds.y1); - bounds.x2 = noninf(bounds.x2); - bounds.y2 = noninf(bounds.y2); - bounds.w = noninf(bounds.x2 - bounds.x1); - bounds.h = noninf(bounds.y2 - bounds.y1); - - return bounds; -}; - -// private helper to get bounding box for custom node positions -// - good for perf in certain cases but currently requires dirtying the rendered style -// - would be better to not modify the nodes but the nodes are read directly everywhere in the renderer... -// - try to use for only things like discrete layouts where the node position would change anyway -elesfn.boundingBoxAt = function (fn) { - var nodes = this.nodes(); - - if (is.plainObject(fn)) { - var obj = fn; - - fn = function fn() { - return obj; - }; - } - - // save the current position and set the new one, per node - for (var i = 0; i < nodes.length; i++) { - var n = nodes[i]; - var _p = n._private; - var pos = _p.position; - var newPos = fn.call(n, n, i); - - _p.bbAtOldPos = { x: pos.x, y: pos.y }; - - if (newPos) { - pos.x = newPos.x; - pos.y = newPos.y; - } - } - - this.emit('dirty'); // let the renderer know we've manually dirtied rendered dim calcs - - nodes.dirtyCompoundBoundsCache().updateCompoundBounds(); - - var bb = this.boundingBox({ useCache: false }); - - // restore the original position, per node - for (var _i = 0; _i < nodes.length; _i++) { - var _n = nodes[_i]; - var _p2 = _n._private; - var _pos = _n._private.position; - var old = _p2.bbAtOldPos; - - _pos.x = old.x; - _pos.y = old.y; - } - - nodes.dirtyCompoundBoundsCache(); - - this.emit('dirty'); // let the renderer know we've manually dirtied rendered dim calcs - - return bb; -}; - -fn.boundingbox = fn.boundingBox; -fn.renderedBoundingbox = fn.renderedBoundingBox; - -module.exports = elesfn; - -/***/ }), -/* 59 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var fn = void 0, - elesfn = void 0; - -fn = elesfn = {}; - -var defineDimFns = function defineDimFns(opts) { - opts.uppercaseName = util.capitalize(opts.name); - opts.autoName = 'auto' + opts.uppercaseName; - opts.labelName = 'label' + opts.uppercaseName; - opts.outerName = 'outer' + opts.uppercaseName; - opts.uppercaseOuterName = util.capitalize(opts.outerName); - - fn[opts.name] = function dimImpl() { - var ele = this[0]; - var _p = ele._private; - var cy = _p.cy; - var styleEnabled = cy._private.styleEnabled; - - if (ele) { - if (styleEnabled) { - if (ele.isParent()) { - ele.updateCompoundBounds(); - - return _p[opts.autoName] || 0; - } - - var d = ele.pstyle(opts.name); - - switch (d.strValue) { - case 'label': - ele.recalculateRenderedStyle(); - - return _p.rstyle[opts.labelName] || 0; - - default: - return d.pfValue; - } - } else { - return 1; - } - } - }; - - fn['outer' + opts.uppercaseName] = function outerDimImpl() { - var ele = this[0]; - var _p = ele._private; - var cy = _p.cy; - var styleEnabled = cy._private.styleEnabled; - - if (ele) { - if (styleEnabled) { - var dim = ele[opts.name](); - var border = ele.pstyle('border-width').pfValue; // n.b. 1/2 each side - var padding = 2 * ele.padding(); - - return dim + border + padding; - } else { - return 1; - } - } - }; - - fn['rendered' + opts.uppercaseName] = function renderedDimImpl() { - var ele = this[0]; - - if (ele) { - var d = ele[opts.name](); - return d * this.cy().zoom(); - } - }; - - fn['rendered' + opts.uppercaseOuterName] = function renderedOuterDimImpl() { - var ele = this[0]; - - if (ele) { - var od = ele[opts.outerName](); - return od * this.cy().zoom(); - } - }; -}; - -defineDimFns({ - name: 'width' -}); - -defineDimFns({ - name: 'height' -}); - -elesfn.padding = function () { - var ele = this[0]; - var _p = ele._private; - if (ele.isParent()) { - ele.updateCompoundBounds(); - - if (_p.autoPadding !== undefined) { - return _p.autoPadding; - } else { - return ele.pstyle('padding').pfValue; - } - } else { - return ele.pstyle('padding').pfValue; - } -}; - -module.exports = elesfn; - -/***/ }), -/* 60 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var ifEdge = function ifEdge(self, then) { - if (self.isEdge()) { - return then(self.renderer()); - } -}; - -module.exports = { - controlPoints: function controlPoints() { - var _this = this; - - return ifEdge(this, function (renderer) { - return renderer.getControlPoints(_this); - }); - }, - segmentPoints: function segmentPoints() { - var _this2 = this; - - return ifEdge(this, function (renderer) { - return renderer.getSegmentPoints(_this2); - }); - }, - sourceEndpoint: function sourceEndpoint() { - var _this3 = this; - - return ifEdge(this, function (renderer) { - return renderer.getSourceEndpoint(_this3); - }); - }, - targetEndpoint: function targetEndpoint() { - var _this4 = this; - - return ifEdge(this, function (renderer) { - return renderer.getTargetEndpoint(_this4); - }); - }, - midpoint: function midpoint() { - var _this5 = this; - - return ifEdge(this, function (renderer) { - return renderer.getEdgeMidpoint(_this5); - }); - } -}; - -/***/ }), -/* 61 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Emitter = __webpack_require__(11); -var define = __webpack_require__(4); -var is = __webpack_require__(0); -var util = __webpack_require__(1); -var Selector = __webpack_require__(6); - -var emitterOptions = { - qualifierCompare: function qualifierCompare(selector1, selector2) { - if (selector1 == null || selector2 == null) { - return selector1 == null && selector2 == null; - } else { - return selector1.sameText(selector2); - } - }, - eventMatches: function eventMatches(ele, listener, eventObj) { - var selector = listener.qualifier; - - if (selector != null) { - return ele !== eventObj.target && is.element(eventObj.target) && selector.matches(eventObj.target); - } - - return true; - }, - eventFields: function eventFields(ele) { - return { - cy: ele.cy(), - target: ele - }; - }, - callbackContext: function callbackContext(ele, listener, eventObj) { - return listener.qualifier != null ? eventObj.target : ele; - }, - beforeEmit: function beforeEmit(context, listener /*, eventObj*/) { - if (listener.conf && listener.conf.once) { - listener.conf.onceCollection.removeListener(listener.event, listener.qualifier, listener.callback); - } - }, - bubble: function bubble() { - return true; - }, - parent: function parent(ele) { - return ele.isChild() ? ele.parent() : ele.cy(); - } -}; - -var argSelector = function argSelector(arg) { - if (is.string(arg)) { - return new Selector(arg); - } else { - return arg; - } -}; - -var elesfn = { - createEmitter: function createEmitter() { - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - var _p = ele._private; - - if (!_p.emitter) { - _p.emitter = new Emitter(util.assign({ - context: ele - }, emitterOptions)); - } - } - - return this; - }, - - emitter: function emitter() { - return this._private.emitter; - }, - - on: function on(events, selector, callback) { - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - - ele.emitter().on(events, argSelector(selector), callback); - } - - return this; - }, - - removeListener: function removeListener(events, selector, callback) { - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - - ele.emitter().removeListener(events, argSelector(selector), callback); - } - - return this; - }, - - one: function one(events, selector, callback) { - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - - ele.emitter().one(events, argSelector(selector), callback); - } - - return this; - }, - - once: function once(events, selector, callback) { - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - - ele.emitter().on(events, argSelector(selector), callback, { - once: true, - onceCollection: this - }); - } - }, - - emit: function emit(events, extraParams) { - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - - ele.emitter().emit(events, extraParams); - } - - return this; - }, - - emitAndNotify: function emitAndNotify(event, extraParams) { - // for internal use only - if (this.length === 0) { - return; - } // empty collections don't need to notify anything - - // notify renderer - this.cy().notify({ - type: event, - eles: this - }); - - this.emit(event, extraParams); - - return this; - } -}; - -define.eventAliasesOn(elesfn); - -module.exports = elesfn; - -/***/ }), -/* 62 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var Selector = __webpack_require__(6); - -var elesfn = { - nodes: function nodes(selector) { - return this.filter(function (ele) { - return ele.isNode(); - }).filter(selector); - }, - - edges: function edges(selector) { - return this.filter(function (ele) { - return ele.isEdge(); - }).filter(selector); - }, - - filter: function filter(_filter, thisArg) { - if (_filter === undefined) { - // check this first b/c it's the most common/performant case - return this; - } else if (is.string(_filter) || is.elementOrCollection(_filter)) { - return new Selector(_filter).filter(this); - } else if (is.fn(_filter)) { - var filterEles = this.spawn(); - var eles = this; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - var include = thisArg ? _filter.apply(thisArg, [ele, i, eles]) : _filter(ele, i, eles); - - if (include) { - filterEles.merge(ele); - } - } - - return filterEles; - } - - return this.spawn(); // if not handled by above, give 'em an empty collection - }, - - not: function not(toRemove) { - if (!toRemove) { - return this; - } else { - - if (is.string(toRemove)) { - toRemove = this.filter(toRemove); - } - - var elements = []; - var rMap = toRemove._private.map; - - for (var i = 0; i < this.length; i++) { - var element = this[i]; - - var remove = rMap.has(element.id()); - if (!remove) { - elements.push(element); - } - } - - return this.spawn(elements); - } - }, - - absoluteComplement: function absoluteComplement() { - var cy = this.cy(); - - return cy.mutableElements().not(this); - }, - - intersect: function intersect(other) { - // if a selector is specified, then filter by it instead - if (is.string(other)) { - var selector = other; - return this.filter(selector); - } - - var elements = []; - var col1 = this; - var col2 = other; - var col1Smaller = this.length < other.length; - var map2 = col1Smaller ? col2._private.map : col1._private.map; - var col = col1Smaller ? col1 : col2; - - for (var i = 0; i < col.length; i++) { - var id = col[i]._private.data.id; - var entry = map2.get(id); - - if (entry) { - elements.push(entry.ele); - } - } - - return this.spawn(elements); - }, - - xor: function xor(other) { - var cy = this._private.cy; - - if (is.string(other)) { - other = cy.$(other); - } - - var elements = []; - var col1 = this; - var col2 = other; - - var add = function add(col, other) { - for (var i = 0; i < col.length; i++) { - var ele = col[i]; - var id = ele._private.data.id; - var inOther = other.hasElementWithId(id); - - if (!inOther) { - elements.push(ele); - } - } - }; - - add(col1, col2); - add(col2, col1); - - return this.spawn(elements); - }, - - diff: function diff(other) { - var cy = this._private.cy; - - if (is.string(other)) { - other = cy.$(other); - } - - var left = []; - var right = []; - var both = []; - var col1 = this; - var col2 = other; - - var add = function add(col, other, retEles) { - - for (var i = 0; i < col.length; i++) { - var ele = col[i]; - var id = ele._private.data.id; - var inOther = other.hasElementWithId(id); - - if (inOther) { - both.push(ele); - } else { - retEles.push(ele); - } - } - }; - - add(col1, col2, left); - add(col2, col1, right); - - return { - left: this.spawn(left, { unique: true }), - right: this.spawn(right, { unique: true }), - both: this.spawn(both, { unique: true }) - }; - }, - - add: function add(toAdd) { - var cy = this._private.cy; - - if (!toAdd) { - return this; - } - - if (is.string(toAdd)) { - var selector = toAdd; - toAdd = cy.mutableElements().filter(selector); - } - - var elements = []; - - for (var i = 0; i < this.length; i++) { - elements.push(this[i]); - } - - var map = this._private.map; - - for (var _i = 0; _i < toAdd.length; _i++) { - - var add = !map.has(toAdd[_i].id()); - if (add) { - elements.push(toAdd[_i]); - } - } - - return this.spawn(elements); - }, - - // in place merge on calling collection - merge: function merge(toAdd) { - var _p = this._private; - var cy = _p.cy; - - if (!toAdd) { - return this; - } - - if (toAdd && is.string(toAdd)) { - var selector = toAdd; - toAdd = cy.mutableElements().filter(selector); - } - - var map = _p.map; - - for (var i = 0; i < toAdd.length; i++) { - var toAddEle = toAdd[i]; - var id = toAddEle._private.data.id; - var add = !map.has(id); - - if (add) { - var index = this.length++; - - this[index] = toAddEle; - - map.set(id, { ele: toAddEle, index: index }); - } else { - // replace - var _index = map.get(id).index; - - this[_index] = toAddEle; - map.set(id, { ele: toAddEle, index: _index }); - } - } - - return this; // chaining - }, - - // remove single ele in place in calling collection - unmergeOne: function unmergeOne(ele) { - ele = ele[0]; - - var _p = this._private; - var id = ele._private.data.id; - var map = _p.map; - var entry = map.get(id); - - if (!entry) { - return this; // no need to remove - } - - var i = entry.index; - - // remove ele - this[i] = undefined; - map.delete(id); - - var unmergedLastEle = i === this.length - 1; - - // replace empty spot with last ele in collection - if (this.length > 1 && !unmergedLastEle) { - var lastEleI = this.length - 1; - var lastEle = this[lastEleI]; - var lastEleId = lastEle._private.data.id; - - this[lastEleI] = undefined; - this[i] = lastEle; - map.set(lastEleId, { ele: lastEle, index: i }); - } - - // the collection is now 1 ele smaller - this.length--; - - return this; - }, - - // remove eles in place on calling collection - unmerge: function unmerge(toRemove) { - var cy = this._private.cy; - - if (!toRemove) { - return this; - } - - if (toRemove && is.string(toRemove)) { - var selector = toRemove; - toRemove = cy.mutableElements().filter(selector); - } - - for (var i = 0; i < toRemove.length; i++) { - this.unmergeOne(toRemove[i]); - } - - return this; // chaining - }, - - map: function map(mapFn, thisArg) { - var arr = []; - var eles = this; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - var ret = thisArg ? mapFn.apply(thisArg, [ele, i, eles]) : mapFn(ele, i, eles); - - arr.push(ret); - } - - return arr; - }, - - reduce: function reduce(fn, initialValue) { - var val = initialValue; - var eles = this; - - for (var i = 0; i < eles.length; i++) { - val = fn(val, eles[i], i, eles); - } - - return val; - }, - - max: function max(valFn, thisArg) { - var max = -Infinity; - var maxEle = void 0; - var eles = this; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - var val = thisArg ? valFn.apply(thisArg, [ele, i, eles]) : valFn(ele, i, eles); - - if (val > max) { - max = val; - maxEle = ele; - } - } - - return { - value: max, - ele: maxEle - }; - }, - - min: function min(valFn, thisArg) { - var min = Infinity; - var minEle = void 0; - var eles = this; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - var val = thisArg ? valFn.apply(thisArg, [ele, i, eles]) : valFn(ele, i, eles); - - if (val < min) { - min = val; - minEle = ele; - } - } - - return { - value: min, - ele: minEle - }; - } -}; - -// aliases -var fn = elesfn; -fn['u'] = fn['|'] = fn['+'] = fn.union = fn.or = fn.add; -fn['\\'] = fn['!'] = fn['-'] = fn.difference = fn.relativeComplement = fn.subtract = fn.not; -fn['n'] = fn['&'] = fn['.'] = fn.and = fn.intersection = fn.intersect; -fn['^'] = fn['(+)'] = fn['(-)'] = fn.symmetricDifference = fn.symdiff = fn.xor; -fn.fnFilter = fn.filterFn = fn.stdFilter = fn.filter; -fn.complement = fn.abscomp = fn.absoluteComplement; - -module.exports = elesfn; - -/***/ }), -/* 63 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var elesfn = { - isNode: function isNode() { - return this.group() === 'nodes'; - }, - - isEdge: function isEdge() { - return this.group() === 'edges'; - }, - - isLoop: function isLoop() { - return this.isEdge() && this.source().id() === this.target().id(); - }, - - isSimple: function isSimple() { - return this.isEdge() && this.source().id() !== this.target().id(); - }, - - group: function group() { - var ele = this[0]; - - if (ele) { - return ele._private.group; - } - } -}; - -module.exports = elesfn; - -/***/ }), -/* 64 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var zIndexSort = __webpack_require__(17); -var util = __webpack_require__(1); - -var elesfn = { - forEach: function forEach(fn, thisArg) { - if (is.fn(fn)) { - - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - var ret = thisArg ? fn.apply(thisArg, [ele, i, this]) : fn(ele, i, this); - - if (ret === false) { - break; - } // exit each early on return false - } - } - - return this; - }, - - toArray: function toArray() { - var array = []; - - for (var i = 0; i < this.length; i++) { - array.push(this[i]); - } - - return array; - }, - - slice: function slice(start, end) { - var array = []; - var thisSize = this.length; - - if (end == null) { - end = thisSize; - } - - if (start == null) { - start = 0; - } - - if (start < 0) { - start = thisSize + start; - } - - if (end < 0) { - end = thisSize + end; - } - - for (var i = start; i >= 0 && i < end && i < thisSize; i++) { - array.push(this[i]); - } - - return this.spawn(array); - }, - - size: function size() { - return this.length; - }, - - eq: function eq(i) { - return this[i] || this.spawn(); - }, - - first: function first() { - return this[0] || this.spawn(); - }, - - last: function last() { - return this[this.length - 1] || this.spawn(); - }, - - empty: function empty() { - return this.length === 0; - }, - - nonempty: function nonempty() { - return !this.empty(); - }, - - sort: function sort(sortFn) { - if (!is.fn(sortFn)) { - return this; - } - - var sorted = this.toArray().sort(sortFn); - - return this.spawn(sorted); - }, - - sortByZIndex: function sortByZIndex() { - return this.sort(zIndexSort); - }, - - zDepth: function zDepth() { - var ele = this[0]; - if (!ele) { - return undefined; - } - - // let cy = ele.cy(); - var _p = ele._private; - var group = _p.group; - - if (group === 'nodes') { - var depth = _p.data.parent ? ele.parents().size() : 0; - - if (!ele.isParent()) { - return util.MAX_INT - 1; // childless nodes always on top - } - - return depth; - } else { - var src = _p.source; - var tgt = _p.target; - var srcDepth = src.zDepth(); - var tgtDepth = tgt.zDepth(); - - return Math.max(srcDepth, tgtDepth, 0); // depth of deepest parent - } - } -}; - -elesfn.each = elesfn.forEach; - -module.exports = elesfn; - -/***/ }), -/* 65 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var util = __webpack_require__(1); -var Promise = __webpack_require__(5); -var math = __webpack_require__(2); - -var elesfn = { - // Calculates and returns node dimensions { x, y } based on options given - layoutDimensions: function layoutDimensions(options) { - options = util.assign({ - nodeDimensionsIncludeLabels: true - }, options); - - if (options.nodeDimensionsIncludeLabels) { - var bbDim = this.boundingBox(); - return { - w: bbDim.w, - h: bbDim.h - }; - } else { - return { - w: this.outerWidth(), - h: this.outerHeight() - }; - } - }, - - // using standard layout options, apply position function (w/ or w/o animation) - layoutPositions: function layoutPositions(layout, options, fn) { - var nodes = this.nodes(); - var cy = this.cy(); - var layoutEles = options.eles; // nodes & edges - var getMemoizeKey = function getMemoizeKey(node, i) { - return node.id() + '$' + i; - }; - var fnMem = util.memoize(fn, getMemoizeKey); // memoized version of position function - - layout.emit({ type: 'layoutstart', layout: layout }); - - layout.animations = []; - - var calculateSpacing = function calculateSpacing(spacing, nodesBb, pos) { - var center = { - x: nodesBb.x1 + nodesBb.w / 2, - y: nodesBb.y1 + nodesBb.h / 2 - }; - - var spacingVector = { // scale from center of bounding box (not necessarily 0,0) - x: (pos.x - center.x) * spacing, - y: (pos.y - center.y) * spacing - }; - - return { - x: center.x + spacingVector.x, - y: center.y + spacingVector.y - }; - }; - - var useSpacingFactor = options.spacingFactor && options.spacingFactor !== 1; - - var spacingBb = function spacingBb() { - if (!useSpacingFactor) { - return null; - } - - var bb = math.makeBoundingBox(); - - for (var i = 0; i < nodes.length; i++) { - var node = nodes[i]; - var pos = fnMem(node, i); - - math.expandBoundingBoxByPoint(bb, pos.x, pos.y); - } - - return bb; - }; - - var bb = spacingBb(); - - var getFinalPos = util.memoize(function (node, i) { - var newPos = fnMem(node, i); - var pos = node.position(); - - if (!is.number(pos.x) || !is.number(pos.y)) { - node.silentPosition({ x: 0, y: 0 }); - } - - if (useSpacingFactor) { - var spacing = Math.abs(options.spacingFactor); - - newPos = calculateSpacing(spacing, bb, newPos); - } - - if (options.transform != null) { - newPos = options.transform(node, newPos); - } - - return newPos; - }, getMemoizeKey); - - if (options.animate) { - for (var i = 0; i < nodes.length; i++) { - var node = nodes[i]; - var newPos = getFinalPos(node, i); - var animateNode = options.animateFilter == null || options.animateFilter(node, i); - - if (animateNode) { - var ani = node.animation({ - position: newPos, - duration: options.animationDuration, - easing: options.animationEasing - }); - - layout.animations.push(ani); - - ani.play(); - } else { - node.position(newPos); - } - } - - if (options.fit) { - var fitAni = cy.animation({ - fit: { - boundingBox: layoutEles.boundingBoxAt(getFinalPos), - padding: options.padding - }, - duration: options.animationDuration, - easing: options.animationEasing - }); - - layout.animations.push(fitAni); - - fitAni.play(); - } else if (options.zoom !== undefined && options.pan !== undefined) { - var zoomPanAni = cy.animation({ - zoom: options.zoom, - pan: options.pan, - duration: options.animationDuration, - easing: options.animationEasing - }); - - layout.animations.push(zoomPanAni); - - zoomPanAni.play(); - } - - layout.one('layoutready', options.ready); - layout.emit({ type: 'layoutready', layout: layout }); - - Promise.all(layout.animations.map(function (ani) { - return ani.promise(); - })).then(function () { - layout.one('layoutstop', options.stop); - layout.emit({ type: 'layoutstop', layout: layout }); - }); - } else { - - nodes.positions(getFinalPos); - - if (options.fit) { - cy.fit(options.eles, options.padding); - } - - if (options.zoom != null) { - cy.zoom(options.zoom); - } - - if (options.pan) { - cy.pan(options.pan); - } - - layout.one('layoutready', options.ready); - layout.emit({ type: 'layoutready', layout: layout }); - - layout.one('layoutstop', options.stop); - layout.emit({ type: 'layoutstop', layout: layout }); - } - - return this; // chaining - }, - - layout: function layout(options) { - var cy = this.cy(); - - return cy.makeLayout(util.extend({}, options, { - eles: this - })); - } - -}; - -// aliases: -elesfn.createLayout = elesfn.makeLayout = elesfn.layout; - -module.exports = elesfn; - -/***/ }), -/* 66 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); - -function styleCache(key, fn, ele) { - var _p = ele._private; - var cache = _p.styleCache = _p.styleCache || {}; - var val; - - if ((val = cache[key]) != null) { - return val; - } else { - val = cache[key] = fn(ele); - - return val; - } -} - -function cacheStyleFunction(key, fn) { - return function cachedStyleFunction(ele) { - return styleCache(key, fn, ele); - }; -} - -function cachePrototypeStyleFunction(key, fn) { - var selfFn = function selfFn(ele) { - return fn.call(ele); - }; - - return function cachedPrototypeStyleFunction() { - var ele = this[0]; - - if (ele) { - return styleCache(key, selfFn, ele); - } - }; -} - -var elesfn = { - - recalculateRenderedStyle: function recalculateRenderedStyle(useCache) { - var cy = this.cy(); - var renderer = cy.renderer(); - var styleEnabled = cy.styleEnabled(); - - if (renderer && styleEnabled) { - renderer.recalculateRenderedStyle(this, useCache); - } - - return this; - }, - - dirtyStyleCache: function dirtyStyleCache() { - var cy = this.cy(); - var dirty = function dirty(ele) { - return ele._private.styleCache = {}; - }; - - if (cy.hasCompoundNodes()) { - var eles = void 0; - - eles = this.spawnSelf().merge(this.descendants()).merge(this.parents()); - - eles.merge(eles.connectedEdges()); - - eles.forEach(dirty); - } else { - this.forEach(function (ele) { - dirty(ele); - - ele.connectedEdges().forEach(dirty); - }); - } - - return this; - }, - - // fully updates (recalculates) the style for the elements - updateStyle: function updateStyle(notifyRenderer) { - var cy = this._private.cy; - - if (!cy.styleEnabled()) { - return this; - } - - if (cy._private.batchingStyle) { - var bEles = cy._private.batchStyleEles; - - bEles.merge(this); - - return this; // chaining and exit early when batching - } - - var hasCompounds = cy.hasCompoundNodes(); - var style = cy.style(); - var updatedEles = this; - - notifyRenderer = notifyRenderer || notifyRenderer === undefined ? true : false; - - if (hasCompounds) { - // then add everything up and down for compound selector checks - updatedEles = this.spawnSelf().merge(this.descendants()).merge(this.parents()); - } - - var changedEles = style.apply(updatedEles); - - changedEles.dirtyStyleCache(); - changedEles.dirtyCompoundBoundsCache(); - - if (notifyRenderer) { - changedEles.emitAndNotify('style'); // let renderer know we changed style - } else { - changedEles.emit('style'); // just fire the event - } - - return this; // chaining - }, - - // just update the mappers in the elements' styles; cheaper than eles.updateStyle() - updateMappers: function updateMappers(notifyRenderer) { - var cy = this._private.cy; - var style = cy.style(); - notifyRenderer = notifyRenderer || notifyRenderer === undefined ? true : false; - - if (!cy.styleEnabled()) { - return this; - } - - var changedEles = style.updateMappers(this); - - changedEles.dirtyStyleCache(); - changedEles.dirtyCompoundBoundsCache(); - - if (notifyRenderer) { - changedEles.emitAndNotify('style'); // let renderer know we changed style - } else { - changedEles.emit('style'); // just fire the event - } - return this; // chaining - }, - - // get the internal parsed style object for the specified property - parsedStyle: function parsedStyle(property) { - var ele = this[0]; - var cy = ele.cy(); - - if (!cy.styleEnabled()) { - return; - } - - if (ele) { - return ele._private.style[property] || cy.style().getDefaultProperty(property); - } - }, - - numericStyle: function numericStyle(property) { - var ele = this[0]; - - if (!ele.cy().styleEnabled()) { - return; - } - - if (ele) { - var pstyle = ele.pstyle(property); - - return pstyle.pfValue !== undefined ? pstyle.pfValue : pstyle.value; - } - }, - - numericStyleUnits: function numericStyleUnits(property) { - var ele = this[0]; - - if (!ele.cy().styleEnabled()) { - return; - } - - if (ele) { - return ele.pstyle(property).units; - } - }, - - // get the specified css property as a rendered value (i.e. on-screen value) - // or get the whole rendered style if no property specified (NB doesn't allow setting) - renderedStyle: function renderedStyle(property) { - var cy = this.cy(); - if (!cy.styleEnabled()) { - return this; - } - - var ele = this[0]; - - if (ele) { - return cy.style().getRenderedStyle(ele, property); - } - }, - - // read the calculated css style of the element or override the style (via a bypass) - style: function style(name, value) { - var cy = this.cy(); - - if (!cy.styleEnabled()) { - return this; - } - - var updateTransitions = false; - var style = cy.style(); - - if (is.plainObject(name)) { - // then extend the bypass - var props = name; - style.applyBypass(this, props, updateTransitions); - - this.dirtyStyleCache(); - this.dirtyCompoundBoundsCache(); - - this.emitAndNotify('style'); // let the renderer know we've updated style - } else if (is.string(name)) { - - if (value === undefined) { - // then get the property from the style - var ele = this[0]; - - if (ele) { - return style.getStylePropertyValue(ele, name); - } else { - // empty collection => can't get any value - return; - } - } else { - // then set the bypass with the property value - style.applyBypass(this, name, value, updateTransitions); - - this.dirtyStyleCache(); - this.dirtyCompoundBoundsCache(); - - this.emitAndNotify('style'); // let the renderer know we've updated style - } - } else if (name === undefined) { - var _ele = this[0]; - - if (_ele) { - return style.getRawStyle(_ele); - } else { - // empty collection => can't get any value - return; - } - } - - return this; // chaining - }, - - removeStyle: function removeStyle(names) { - var cy = this.cy(); - - if (!cy.styleEnabled()) { - return this; - } - - var updateTransitions = false; - var style = cy.style(); - var eles = this; - - if (names === undefined) { - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - - style.removeAllBypasses(ele, updateTransitions); - } - } else { - names = names.split(/\s+/); - - for (var _i = 0; _i < eles.length; _i++) { - var _ele2 = eles[_i]; - - style.removeBypasses(_ele2, names, updateTransitions); - } - } - - this.dirtyStyleCache(); - this.dirtyCompoundBoundsCache(); - - this.emitAndNotify('style'); // let the renderer know we've updated style - - return this; // chaining - }, - - show: function show() { - this.css('display', 'element'); - return this; // chaining - }, - - hide: function hide() { - this.css('display', 'none'); - return this; // chaining - }, - - effectiveOpacity: function effectiveOpacity() { - var cy = this.cy(); - if (!cy.styleEnabled()) { - return 1; - } - - var hasCompoundNodes = cy.hasCompoundNodes(); - var ele = this[0]; - - if (ele) { - var _p = ele._private; - var parentOpacity = ele.pstyle('opacity').value; - - if (!hasCompoundNodes) { - return parentOpacity; - } - - var parents = !_p.data.parent ? null : ele.parents(); - - if (parents) { - for (var i = 0; i < parents.length; i++) { - var parent = parents[i]; - var opacity = parent.pstyle('opacity').value; - - parentOpacity = opacity * parentOpacity; - } - } - - return parentOpacity; - } - }, - - transparent: function transparent() { - var cy = this.cy(); - if (!cy.styleEnabled()) { - return false; - } - - var ele = this[0]; - var hasCompoundNodes = ele.cy().hasCompoundNodes(); - - if (ele) { - if (!hasCompoundNodes) { - return ele.pstyle('opacity').value === 0; - } else { - return ele.effectiveOpacity() === 0; - } - } - }, - - backgrounding: function backgrounding() { - var cy = this.cy(); - if (!cy.styleEnabled()) { - return false; - } - - var ele = this[0]; - - return ele._private.backgrounding ? true : false; - } - -}; - -function checkCompound(ele, parentOk) { - var _p = ele._private; - var parents = _p.data.parent ? ele.parents() : null; - - if (parents) { - for (var i = 0; i < parents.length; i++) { - var parent = parents[i]; - - if (!parentOk(parent)) { - return false; - } - } - } - - return true; -} - -function defineDerivedStateFunction(specs) { - var ok = specs.ok; - var edgeOkViaNode = specs.edgeOkViaNode || specs.ok; - var parentOk = specs.parentOk || specs.ok; - - return function () { - var cy = this.cy(); - if (!cy.styleEnabled()) { - return true; - } - - var ele = this[0]; - var hasCompoundNodes = cy.hasCompoundNodes(); - - if (ele) { - var _p = ele._private; - - if (!ok(ele)) { - return false; - } - - if (ele.isNode()) { - return !hasCompoundNodes || checkCompound(ele, parentOk); - } else { - var src = _p.source; - var tgt = _p.target; - - return edgeOkViaNode(src) && (!hasCompoundNodes || checkCompound(src, edgeOkViaNode)) && (src === tgt || edgeOkViaNode(tgt) && (!hasCompoundNodes || checkCompound(tgt, edgeOkViaNode))); - } - } - }; -} - -var eleTakesUpSpace = cacheStyleFunction('eleTakesUpSpace', function (ele) { - return ele.pstyle('display').value === 'element' && ele.width() !== 0 && (ele.isNode() ? ele.height() !== 0 : true); -}); - -elesfn.takesUpSpace = cachePrototypeStyleFunction('takesUpSpace', defineDerivedStateFunction({ - ok: eleTakesUpSpace -})); - -var eleInteractive = cacheStyleFunction('eleInteractive', function (ele) { - return ele.pstyle('events').value === 'yes' && ele.pstyle('visibility').value === 'visible' && eleTakesUpSpace(ele); -}); - -var parentInteractive = cacheStyleFunction('parentInteractive', function (parent) { - return parent.pstyle('visibility').value === 'visible' && eleTakesUpSpace(parent); -}); - -elesfn.interactive = cachePrototypeStyleFunction('interactive', defineDerivedStateFunction({ - ok: eleInteractive, - parentOk: parentInteractive, - edgeOkViaNode: eleTakesUpSpace -})); - -elesfn.noninteractive = function () { - var ele = this[0]; - - if (ele) { - return !ele.interactive(); - } -}; - -var eleVisible = cacheStyleFunction('eleVisible', function (ele) { - return ele.pstyle('visibility').value === 'visible' && ele.pstyle('opacity').pfValue !== 0 && eleTakesUpSpace(ele); -}); - -var edgeVisibleViaNode = eleTakesUpSpace; - -elesfn.visible = cachePrototypeStyleFunction('visible', defineDerivedStateFunction({ - ok: eleVisible, - edgeOkViaNode: edgeVisibleViaNode -})); - -elesfn.hidden = function () { - var ele = this[0]; - - if (ele) { - return !ele.visible(); - } -}; - -elesfn.bypass = elesfn.css = elesfn.style; -elesfn.renderedCss = elesfn.renderedStyle; -elesfn.removeBypass = elesfn.removeCss = elesfn.removeStyle; -elesfn.pstyle = elesfn.parsedStyle; - -module.exports = elesfn; - -/***/ }), -/* 67 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var elesfn = {}; - -function defineSwitchFunction(params) { - return function () { - var args = arguments; - var changedEles = []; - - // e.g. cy.nodes().select( data, handler ) - if (args.length === 2) { - var data = args[0]; - var handler = args[1]; - this.on(params.event, data, handler); - } - - // e.g. cy.nodes().select( handler ) - else if (args.length === 1) { - var _handler = args[0]; - this.on(params.event, _handler); - } - - // e.g. cy.nodes().select() - else if (args.length === 0) { - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - var able = !params.ableField || ele._private[params.ableField]; - var changed = ele._private[params.field] != params.value; - - if (params.overrideAble) { - var overrideAble = params.overrideAble(ele); - - if (overrideAble !== undefined) { - able = overrideAble; - - if (!overrideAble) { - return this; - } // to save cycles assume not able for all on override - } - } - - if (able) { - ele._private[params.field] = params.value; - - if (changed) { - changedEles.push(ele); - } - } - } - - var changedColl = this.spawn(changedEles); - changedColl.updateStyle(); // change of state => possible change of style - changedColl.emit(params.event); - } - - return this; - }; -} - -function defineSwitchSet(params) { - elesfn[params.field] = function () { - var ele = this[0]; - - if (ele) { - if (params.overrideField) { - var val = params.overrideField(ele); - - if (val !== undefined) { - return val; - } - } - - return ele._private[params.field]; - } - }; - - elesfn[params.on] = defineSwitchFunction({ - event: params.on, - field: params.field, - ableField: params.ableField, - overrideAble: params.overrideAble, - value: true - }); - - elesfn[params.off] = defineSwitchFunction({ - event: params.off, - field: params.field, - ableField: params.ableField, - overrideAble: params.overrideAble, - value: false - }); -} - -defineSwitchSet({ - field: 'locked', - overrideField: function overrideField(ele) { - return ele.cy().autolock() ? true : undefined; - }, - on: 'lock', - off: 'unlock' -}); - -defineSwitchSet({ - field: 'grabbable', - overrideField: function overrideField(ele) { - return ele.cy().autoungrabify() ? false : undefined; - }, - on: 'grabify', - off: 'ungrabify' -}); - -defineSwitchSet({ - field: 'selected', - ableField: 'selectable', - overrideAble: function overrideAble(ele) { - return ele.cy().autounselectify() ? false : undefined; - }, - on: 'select', - off: 'unselect' -}); - -defineSwitchSet({ - field: 'selectable', - overrideField: function overrideField(ele) { - return ele.cy().autounselectify() ? false : undefined; - }, - on: 'selectify', - off: 'unselectify' -}); - -elesfn.deselect = elesfn.unselect; - -elesfn.grabbed = function () { - var ele = this[0]; - if (ele) { - return ele._private.grabbed; - } -}; - -defineSwitchSet({ - field: 'active', - on: 'activate', - off: 'unactivate' -}); - -elesfn.inactive = function () { - var ele = this[0]; - if (ele) { - return !ele._private.active; - } -}; - -module.exports = elesfn; - -/***/ }), -/* 68 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var is = __webpack_require__(0); - -var elesfn = {}; - -var cache = function cache(fn, name) { - return function traversalCache(arg1, arg2, arg3, arg4) { - var selectorOrEles = arg1; - var eles = this; - var key = void 0; - - if (selectorOrEles == null) { - key = 'null'; - } else if (is.elementOrCollection(selectorOrEles) && selectorOrEles.length === 1) { - key = '#' + selectorOrEles.id(); - } - - if (eles.length === 1 && key) { - var _p = eles[0]._private; - var tch = _p.traversalCache = _p.traversalCache || {}; - var ch = tch[name] = tch[name] || {}; - var cacheHit = ch[key]; - - if (cacheHit) { - return cacheHit; - } else { - return ch[key] = fn.call(eles, arg1, arg2, arg3, arg4); - } - } else { - return fn.call(eles, arg1, arg2, arg3, arg4); - } - }; -}; - -// DAG functions -//////////////// - -var defineDagExtremity = function defineDagExtremity(params) { - return function dagExtremityImpl(selector) { - var eles = this; - var ret = []; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - if (!ele.isNode()) { - continue; - } - - var disqualified = false; - var edges = ele.connectedEdges(); - - for (var j = 0; j < edges.length; j++) { - var edge = edges[j]; - var src = edge.source(); - var tgt = edge.target(); - - if (params.noIncomingEdges && tgt === ele && src !== ele || params.noOutgoingEdges && src === ele && tgt !== ele) { - disqualified = true; - break; - } - } - - if (!disqualified) { - ret.push(ele); - } - } - - return this.spawn(ret, { unique: true }).filter(selector); - }; -}; - -var defineDagOneHop = function defineDagOneHop(params) { - return function (selector) { - var eles = this; - var oEles = []; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - - if (!ele.isNode()) { - continue; - } - - var edges = ele.connectedEdges(); - for (var j = 0; j < edges.length; j++) { - var edge = edges[j]; - var src = edge.source(); - var tgt = edge.target(); - - if (params.outgoing && src === ele) { - oEles.push(edge); - oEles.push(tgt); - } else if (params.incoming && tgt === ele) { - oEles.push(edge); - oEles.push(src); - } - } - } - - return this.spawn(oEles, { unique: true }).filter(selector); - }; -}; - -var defineDagAllHops = function defineDagAllHops(params) { - return function (selector) { - var eles = this; - var sEles = []; - var sElesIds = {}; - - for (;;) { - var next = params.outgoing ? eles.outgoers() : eles.incomers(); - - if (next.length === 0) { - break; - } // done if none left - - var newNext = false; - for (var i = 0; i < next.length; i++) { - var n = next[i]; - var nid = n.id(); - - if (!sElesIds[nid]) { - sElesIds[nid] = true; - sEles.push(n); - newNext = true; - } - } - - if (!newNext) { - break; - } // done if touched all outgoers already - - eles = next; - } - - return this.spawn(sEles, { unique: true }).filter(selector); - }; -}; - -elesfn.clearTraversalCache = function () { - for (var i = 0; i < this.length; i++) { - this[i]._private.traversalCache = null; - } -}; - -util.extend(elesfn, { - // get the root nodes in the DAG - roots: defineDagExtremity({ noIncomingEdges: true }), - - // get the leaf nodes in the DAG - leaves: defineDagExtremity({ noOutgoingEdges: true }), - - // normally called children in graph theory - // these nodes =edges=> outgoing nodes - outgoers: cache(defineDagOneHop({ outgoing: true }), 'outgoers'), - - // aka DAG descendants - successors: defineDagAllHops({ outgoing: true }), - - // normally called parents in graph theory - // these nodes <=edges= incoming nodes - incomers: cache(defineDagOneHop({ incoming: true }), 'incomers'), - - // aka DAG ancestors - predecessors: defineDagAllHops({ incoming: true }) -}); - -// Neighbourhood functions -////////////////////////// - -util.extend(elesfn, { - neighborhood: cache(function (selector) { - var elements = []; - var nodes = this.nodes(); - - for (var i = 0; i < nodes.length; i++) { - // for all nodes - var node = nodes[i]; - var connectedEdges = node.connectedEdges(); - - // for each connected edge, add the edge and the other node - for (var j = 0; j < connectedEdges.length; j++) { - var edge = connectedEdges[j]; - var src = edge.source(); - var tgt = edge.target(); - var otherNode = node === src ? tgt : src; - - // need check in case of loop - if (otherNode.length > 0) { - elements.push(otherNode[0]); // add node 1 hop away - } - - // add connected edge - elements.push(edge[0]); - } - } - - return this.spawn(elements, { unique: true }).filter(selector); - }, 'neighborhood'), - - closedNeighborhood: function closedNeighborhood(selector) { - return this.neighborhood().add(this).filter(selector); - }, - - openNeighborhood: function openNeighborhood(selector) { - return this.neighborhood(selector); - } -}); - -// aliases -elesfn.neighbourhood = elesfn.neighborhood; -elesfn.closedNeighbourhood = elesfn.closedNeighborhood; -elesfn.openNeighbourhood = elesfn.openNeighborhood; - -// Edge functions -///////////////// - -util.extend(elesfn, { - source: cache(function sourceImpl(selector) { - var ele = this[0]; - var src = void 0; - - if (ele) { - src = ele._private.source || ele.cy().collection(); - } - - return src && selector ? src.filter(selector) : src; - }, 'source'), - - target: cache(function targetImpl(selector) { - var ele = this[0]; - var tgt = void 0; - - if (ele) { - tgt = ele._private.target || ele.cy().collection(); - } - - return tgt && selector ? tgt.filter(selector) : tgt; - }, 'target'), - - sources: defineSourceFunction({ - attr: 'source' - }), - - targets: defineSourceFunction({ - attr: 'target' - }) -}); - -function defineSourceFunction(params) { - return function sourceImpl(selector) { - var sources = []; - - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - var src = ele._private[params.attr]; - - if (src) { - sources.push(src); - } - } - - return this.spawn(sources, { unique: true }).filter(selector); - }; -} - -util.extend(elesfn, { - edgesWith: cache(defineEdgesWithFunction(), 'edgesWith'), - - edgesTo: cache(defineEdgesWithFunction({ - thisIsSrc: true - }), 'edgesTo') -}); - -function defineEdgesWithFunction(params) { - - return function edgesWithImpl(otherNodes) { - var elements = []; - var cy = this._private.cy; - var p = params || {}; - - // get elements if a selector is specified - if (is.string(otherNodes)) { - otherNodes = cy.$(otherNodes); - } - - for (var h = 0; h < otherNodes.length; h++) { - var edges = otherNodes[h]._private.edges; - - for (var i = 0; i < edges.length; i++) { - var edge = edges[i]; - var edgeData = edge._private.data; - var thisToOther = this.hasElementWithId(edgeData.source) && otherNodes.hasElementWithId(edgeData.target); - var otherToThis = otherNodes.hasElementWithId(edgeData.source) && this.hasElementWithId(edgeData.target); - var edgeConnectsThisAndOther = thisToOther || otherToThis; - - if (!edgeConnectsThisAndOther) { - continue; - } - - if (p.thisIsSrc || p.thisIsTgt) { - if (p.thisIsSrc && !thisToOther) { - continue; - } - - if (p.thisIsTgt && !otherToThis) { - continue; - } - } - - elements.push(edge); - } - } - - return this.spawn(elements, { unique: true }); - }; -} - -util.extend(elesfn, { - connectedEdges: cache(function (selector) { - var retEles = []; - - var eles = this; - for (var i = 0; i < eles.length; i++) { - var node = eles[i]; - if (!node.isNode()) { - continue; - } - - var edges = node._private.edges; - - for (var j = 0; j < edges.length; j++) { - var edge = edges[j]; - retEles.push(edge); - } - } - - return this.spawn(retEles, { unique: true }).filter(selector); - }, 'connectedEdges'), - - connectedNodes: cache(function (selector) { - var retEles = []; - - var eles = this; - for (var i = 0; i < eles.length; i++) { - var edge = eles[i]; - if (!edge.isEdge()) { - continue; - } - - retEles.push(edge.source()[0]); - retEles.push(edge.target()[0]); - } - - return this.spawn(retEles, { unique: true }).filter(selector); - }, 'connectedNodes'), - - parallelEdges: cache(defineParallelEdgesFunction(), 'parallelEdges'), - - codirectedEdges: cache(defineParallelEdgesFunction({ - codirected: true - }), 'codirectedEdges') -}); - -function defineParallelEdgesFunction(params) { - var defaults = { - codirected: false - }; - params = util.extend({}, defaults, params); - - return function parallelEdgesImpl(selector) { - // micro-optimised for renderer - var elements = []; - var edges = this.edges(); - var p = params; - - // look at all the edges in the collection - for (var i = 0; i < edges.length; i++) { - var edge1 = edges[i]; - var edge1_p = edge1._private; - var src1 = edge1_p.source; - var srcid1 = src1._private.data.id; - var tgtid1 = edge1_p.data.target; - var srcEdges1 = src1._private.edges; - - // look at edges connected to the src node of this edge - for (var j = 0; j < srcEdges1.length; j++) { - var edge2 = srcEdges1[j]; - var edge2data = edge2._private.data; - var tgtid2 = edge2data.target; - var srcid2 = edge2data.source; - - var codirected = tgtid2 === tgtid1 && srcid2 === srcid1; - var oppdirected = srcid1 === tgtid2 && tgtid1 === srcid2; - - if (p.codirected && codirected || !p.codirected && (codirected || oppdirected)) { - elements.push(edge2); - } - } - } - - return this.spawn(elements, { unique: true }).filter(selector); - }; -} - -// Misc functions -///////////////// - -util.extend(elesfn, { - components: function components() { - var self = this; - var cy = self.cy(); - var visited = self.spawn(); - var unvisited = self.nodes().spawnSelf(); - var components = []; - - var visitInComponent = function visitInComponent(node, component) { - visited.merge(node); - unvisited.unmerge(node); - component.merge(node); - }; - - if (unvisited.empty()) { - return self.spawn(); - } - - var _loop = function _loop() { - var component = cy.collection(); - components.push(component); - - var root = unvisited[0]; - visitInComponent(root, component); - - self.bfs({ - directed: false, - roots: root, - visit: function visit(v, e, u, i, depth) { - visitInComponent(v, component); - } - }); - }; - - do { - _loop(); - } while (unvisited.length > 0); - - return components.map(function (component) { - var connectedEdges = component.connectedEdges().stdFilter(function (edge) { - return component.anySame(edge.source()) && component.anySame(edge.target()); - }); - - return component.union(connectedEdges); - }); - } -}); - -module.exports = elesfn; - -/***/ }), -/* 69 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var util = __webpack_require__(1); -var Collection = __webpack_require__(7); -var Element = __webpack_require__(14); - -var corefn = { - add: function add(opts) { - - var elements = void 0; - var cy = this; - - // add the elements - if (is.elementOrCollection(opts)) { - var eles = opts; - - if (eles._private.cy === cy) { - // same instance => just restore - elements = eles.restore(); - } else { - // otherwise, copy from json - var jsons = []; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - jsons.push(ele.json()); - } - - elements = new Collection(cy, jsons); - } - } - - // specify an array of options - else if (is.array(opts)) { - var _jsons = opts; - - elements = new Collection(cy, _jsons); - } - - // specify via opts.nodes and opts.edges - else if (is.plainObject(opts) && (is.array(opts.nodes) || is.array(opts.edges))) { - var elesByGroup = opts; - var _jsons2 = []; - - var grs = ['nodes', 'edges']; - for (var _i = 0, il = grs.length; _i < il; _i++) { - var group = grs[_i]; - var elesArray = elesByGroup[group]; - - if (is.array(elesArray)) { - - for (var j = 0, jl = elesArray.length; j < jl; j++) { - var json = util.extend({ group: group }, elesArray[j]); - - _jsons2.push(json); - } - } - } - - elements = new Collection(cy, _jsons2); - } - - // specify options for one element - else { - var _json = opts; - elements = new Element(cy, _json).collection(); - } - - return elements; - }, - - remove: function remove(collection) { - if (is.elementOrCollection(collection)) { - // already have right ref - } else if (is.string(collection)) { - var selector = collection; - collection = this.$(selector); - } - - return collection.remove(); - } -}; - -module.exports = corefn; - -/***/ }), -/* 70 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var define = __webpack_require__(4); -var util = __webpack_require__(1); -var stepAll = __webpack_require__(71); - -var corefn = { - - // pull in animation functions - animate: define.animate(), - animation: define.animation(), - animated: define.animated(), - clearQueue: define.clearQueue(), - delay: define.delay(), - delayAnimation: define.delayAnimation(), - stop: define.stop(), - - addToAnimationPool: function addToAnimationPool(eles) { - var cy = this; - - if (!cy.styleEnabled()) { - return; - } // save cycles when no style used - - cy._private.aniEles.merge(eles); - }, - - stopAnimationLoop: function stopAnimationLoop() { - this._private.animationsRunning = false; - }, - - startAnimationLoop: function startAnimationLoop() { - var cy = this; - - cy._private.animationsRunning = true; - - if (!cy.styleEnabled()) { - return; - } // save cycles when no style used - - // NB the animation loop will exec in headless environments if style enabled - // and explicit cy.destroy() is necessary to stop the loop - - function headlessStep() { - if (!cy._private.animationsRunning) { - return; - } - - util.requestAnimationFrame(function animationStep(now) { - stepAll(now, cy); - headlessStep(); - }); - } - - var renderer = cy.renderer(); - - if (renderer && renderer.beforeRender) { - // let the renderer schedule animations - renderer.beforeRender(function rendererAnimationStep(willDraw, now) { - stepAll(now, cy); - }, renderer.beforeRenderPriorities.animations); - } else { - // manage the animation loop ourselves - headlessStep(); // first call - } - } - -}; - -module.exports = corefn; - -/***/ }), -/* 71 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var step = __webpack_require__(72); -var startAnimation = __webpack_require__(77); - -function stepAll(now, cy) { - var eles = cy._private.aniEles; - var doneEles = []; - - function stepOne(ele, isCore) { - var _p = ele._private; - var current = _p.animation.current; - var queue = _p.animation.queue; - var ranAnis = false; - - // cancel all animations on display:none ele - if (!isCore && ele.pstyle('display').value === 'none') { - // put all current and queue animations in this tick's current list - // and empty the lists for the element - current = current.splice(0, current.length).concat(queue.splice(0, queue.length)); - - // stop all animations - for (var i = 0; i < current.length; i++) { - current[i].stop(); - } - } - - // if nothing currently animating, get something from the queue - if (current.length === 0) { - var next = queue.shift(); - - if (next) { - current.push(next); - } - } - - var callbacks = function callbacks(_callbacks) { - for (var j = _callbacks.length - 1; j >= 0; j--) { - var cb = _callbacks[j]; - - cb(); - } - - _callbacks.splice(0, _callbacks.length); - }; - - // step and remove if done - for (var _i = current.length - 1; _i >= 0; _i--) { - var ani = current[_i]; - var ani_p = ani._private; - - if (ani_p.stopped) { - current.splice(_i, 1); - - ani_p.hooked = false; - ani_p.playing = false; - ani_p.started = false; - - callbacks(ani_p.frames); - - continue; - } - - if (!ani_p.playing && !ani_p.applying) { - continue; - } - - // an apply() while playing shouldn't do anything - if (ani_p.playing && ani_p.applying) { - ani_p.applying = false; - } - - if (!ani_p.started) { - startAnimation(ele, ani, now, isCore); - } - - step(ele, ani, now, isCore); - - if (ani_p.applying) { - ani_p.applying = false; - } - - callbacks(ani_p.frames); - - if (ani.completed()) { - current.splice(_i, 1); - - ani_p.hooked = false; - ani_p.playing = false; - ani_p.started = false; - - callbacks(ani_p.completes); - } - - ranAnis = true; - } - - if (!isCore && current.length === 0 && queue.length === 0) { - doneEles.push(ele); - } - - return ranAnis; - } // stepElement - - // handle all eles - var ranEleAni = false; - for (var e = 0; e < eles.length; e++) { - var ele = eles[e]; - var handledThisEle = stepOne(ele); - - ranEleAni = ranEleAni || handledThisEle; - } // each element - - var ranCoreAni = stepOne(cy, true); - - // notify renderer - if (ranEleAni || ranCoreAni) { - if (eles.length > 0) { - eles.dirtyCompoundBoundsCache(); - - cy.notify({ - type: 'draw', - eles: eles - }); - } else { - cy.notify({ - type: 'draw' - }); - } - } - - // remove elements from list of currently animating if its queues are empty - eles.unmerge(doneEles); - - cy.emit('step'); -} // stepAll - -module.exports = stepAll; - -/***/ }), -/* 72 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var easings = __webpack_require__(73); -var ease = __webpack_require__(76); -var is = __webpack_require__(0); - -function step(self, ani, now, isCore) { - var isEles = !isCore; - var _p = self._private; - var ani_p = ani._private; - var pEasing = ani_p.easing; - var startTime = ani_p.startTime; - var cy = isCore ? self : self.cy(); - var style = cy.style(); - - if (!ani_p.easingImpl) { - - if (pEasing == null) { - // use default - ani_p.easingImpl = easings['linear']; - } else { - // then define w/ name - var easingVals = void 0; - - if (is.string(pEasing)) { - var easingProp = style.parse('transition-timing-function', pEasing); - - easingVals = easingProp.value; - } else { - // then assume preparsed array - easingVals = pEasing; - } - - var name = void 0, - args = void 0; - - if (is.string(easingVals)) { - name = easingVals; - args = []; - } else { - name = easingVals[1]; - args = easingVals.slice(2).map(function (n) { - return +n; - }); - } - - if (args.length > 0) { - // create with args - if (name === 'spring') { - args.push(ani_p.duration); // need duration to generate spring - } - - ani_p.easingImpl = easings[name].apply(null, args); - } else { - // static impl by name - ani_p.easingImpl = easings[name]; - } - } - } - - var easing = ani_p.easingImpl; - var percent = void 0; - - if (ani_p.duration === 0) { - percent = 1; - } else { - percent = (now - startTime) / ani_p.duration; - } - - if (ani_p.applying) { - percent = ani_p.progress; - } - - if (percent < 0) { - percent = 0; - } else if (percent > 1) { - percent = 1; - } - - if (ani_p.delay == null) { - // then update - - var startPos = ani_p.startPosition; - var endPos = ani_p.position; - - if (endPos && isEles && !self.locked()) { - var pos = self.position(); - - if (valid(startPos.x, endPos.x)) { - pos.x = ease(startPos.x, endPos.x, percent, easing); - } - - if (valid(startPos.y, endPos.y)) { - pos.y = ease(startPos.y, endPos.y, percent, easing); - } - - self.emit('position'); - } - - var startPan = ani_p.startPan; - var endPan = ani_p.pan; - var pan = _p.pan; - var animatingPan = endPan != null && isCore; - if (animatingPan) { - if (valid(startPan.x, endPan.x)) { - pan.x = ease(startPan.x, endPan.x, percent, easing); - } - - if (valid(startPan.y, endPan.y)) { - pan.y = ease(startPan.y, endPan.y, percent, easing); - } - - self.emit('pan'); - } - - var startZoom = ani_p.startZoom; - var endZoom = ani_p.zoom; - var animatingZoom = endZoom != null && isCore; - if (animatingZoom) { - if (valid(startZoom, endZoom)) { - _p.zoom = ease(startZoom, endZoom, percent, easing); - } - - self.emit('zoom'); - } - - if (animatingPan || animatingZoom) { - self.emit('viewport'); - } - - var props = ani_p.style; - if (props && props.length > 0 && isEles) { - for (var i = 0; i < props.length; i++) { - var prop = props[i]; - var _name = prop.name; - var end = prop; - var start = ani_p.startStyle[_name]; - var propSpec = style.properties[start.name]; - var easedVal = ease(start, end, percent, easing, propSpec); - - style.overrideBypass(self, _name, easedVal); - } // for props - - self.emit('style'); - } // if - } - - ani_p.progress = percent; - - return percent; -} - -function valid(start, end) { - if (start == null || end == null) { - return false; - } - - if (is.number(start) && is.number(end)) { - return true; - } else if (start && end) { - return true; - } - - return false; -} - -module.exports = step; - -/***/ }), -/* 73 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var generateCubicBezier = __webpack_require__(74); -var generateSpringRK4 = __webpack_require__(75); - -var cubicBezier = function cubicBezier(t1, p1, t2, p2) { - var bezier = generateCubicBezier(t1, p1, t2, p2); - - return function (start, end, percent) { - return start + (end - start) * bezier(percent); - }; -}; - -var easings = { - 'linear': function linear(start, end, percent) { - return start + (end - start) * percent; - }, - - // default easings - 'ease': cubicBezier(0.25, 0.1, 0.25, 1), - 'ease-in': cubicBezier(0.42, 0, 1, 1), - 'ease-out': cubicBezier(0, 0, 0.58, 1), - 'ease-in-out': cubicBezier(0.42, 0, 0.58, 1), - - // sine - 'ease-in-sine': cubicBezier(0.47, 0, 0.745, 0.715), - 'ease-out-sine': cubicBezier(0.39, 0.575, 0.565, 1), - 'ease-in-out-sine': cubicBezier(0.445, 0.05, 0.55, 0.95), - - // quad - 'ease-in-quad': cubicBezier(0.55, 0.085, 0.68, 0.53), - 'ease-out-quad': cubicBezier(0.25, 0.46, 0.45, 0.94), - 'ease-in-out-quad': cubicBezier(0.455, 0.03, 0.515, 0.955), - - // cubic - 'ease-in-cubic': cubicBezier(0.55, 0.055, 0.675, 0.19), - 'ease-out-cubic': cubicBezier(0.215, 0.61, 0.355, 1), - 'ease-in-out-cubic': cubicBezier(0.645, 0.045, 0.355, 1), - - // quart - 'ease-in-quart': cubicBezier(0.895, 0.03, 0.685, 0.22), - 'ease-out-quart': cubicBezier(0.165, 0.84, 0.44, 1), - 'ease-in-out-quart': cubicBezier(0.77, 0, 0.175, 1), - - // quint - 'ease-in-quint': cubicBezier(0.755, 0.05, 0.855, 0.06), - 'ease-out-quint': cubicBezier(0.23, 1, 0.32, 1), - 'ease-in-out-quint': cubicBezier(0.86, 0, 0.07, 1), - - // expo - 'ease-in-expo': cubicBezier(0.95, 0.05, 0.795, 0.035), - 'ease-out-expo': cubicBezier(0.19, 1, 0.22, 1), - 'ease-in-out-expo': cubicBezier(1, 0, 0, 1), - - // circ - 'ease-in-circ': cubicBezier(0.6, 0.04, 0.98, 0.335), - 'ease-out-circ': cubicBezier(0.075, 0.82, 0.165, 1), - 'ease-in-out-circ': cubicBezier(0.785, 0.135, 0.15, 0.86), - - // user param easings... - - 'spring': function spring(tension, friction, duration) { - if (duration === 0) { - // can't get a spring w/ duration 0 - return easings.linear; // duration 0 => jump to end so impl doesn't matter - } - - var spring = generateSpringRK4(tension, friction, duration); - - return function (start, end, percent) { - return start + (end - start) * spring(percent); - }; - }, - - 'cubic-bezier': cubicBezier -}; - -module.exports = easings; - -/***/ }), -/* 74 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/* global Float32Array */ - -/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */ -function generateCubicBezier(mX1, mY1, mX2, mY2) { - var NEWTON_ITERATIONS = 4, - NEWTON_MIN_SLOPE = 0.001, - SUBDIVISION_PRECISION = 0.0000001, - SUBDIVISION_MAX_ITERATIONS = 10, - kSplineTableSize = 11, - kSampleStepSize = 1.0 / (kSplineTableSize - 1.0), - float32ArraySupported = typeof Float32Array !== 'undefined'; - - /* Must contain four arguments. */ - if (arguments.length !== 4) { - return false; - } - - /* Arguments must be numbers. */ - for (var i = 0; i < 4; ++i) { - if (typeof arguments[i] !== "number" || isNaN(arguments[i]) || !isFinite(arguments[i])) { - return false; - } - } - - /* X values must be in the [0, 1] range. */ - mX1 = Math.min(mX1, 1); - mX2 = Math.min(mX2, 1); - mX1 = Math.max(mX1, 0); - mX2 = Math.max(mX2, 0); - - var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize); - - function A(aA1, aA2) { - return 1.0 - 3.0 * aA2 + 3.0 * aA1; - } - - function B(aA1, aA2) { - return 3.0 * aA2 - 6.0 * aA1; - } - - function C(aA1) { - return 3.0 * aA1; - } - - function calcBezier(aT, aA1, aA2) { - return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; - } - - function getSlope(aT, aA1, aA2) { - return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); - } - - function newtonRaphsonIterate(aX, aGuessT) { - for (var _i = 0; _i < NEWTON_ITERATIONS; ++_i) { - var currentSlope = getSlope(aGuessT, mX1, mX2); - - if (currentSlope === 0.0) { - return aGuessT; - } - - var currentX = calcBezier(aGuessT, mX1, mX2) - aX; - aGuessT -= currentX / currentSlope; - } - - return aGuessT; - } - - function calcSampleValues() { - for (var _i2 = 0; _i2 < kSplineTableSize; ++_i2) { - mSampleValues[_i2] = calcBezier(_i2 * kSampleStepSize, mX1, mX2); - } - } - - function binarySubdivide(aX, aA, aB) { - var currentX = void 0, - currentT = void 0, - i = 0; - - do { - currentT = aA + (aB - aA) / 2.0; - currentX = calcBezier(currentT, mX1, mX2) - aX; - if (currentX > 0.0) { - aB = currentT; - } else { - aA = currentT; - } - } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS); - - return currentT; - } - - function getTForX(aX) { - var intervalStart = 0.0, - currentSample = 1, - lastSample = kSplineTableSize - 1; - - for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) { - intervalStart += kSampleStepSize; - } - - --currentSample; - - var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]), - guessForT = intervalStart + dist * kSampleStepSize, - initialSlope = getSlope(guessForT, mX1, mX2); - - if (initialSlope >= NEWTON_MIN_SLOPE) { - return newtonRaphsonIterate(aX, guessForT); - } else if (initialSlope === 0.0) { - return guessForT; - } else { - return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize); - } - } - - var _precomputed = false; - - function precompute() { - _precomputed = true; - if (mX1 !== mY1 || mX2 !== mY2) { - calcSampleValues(); - } - } - - var f = function f(aX) { - if (!_precomputed) { - precompute(); - } - if (mX1 === mY1 && mX2 === mY2) { - return aX; - } - if (aX === 0) { - return 0; - } - if (aX === 1) { - return 1; - } - - return calcBezier(getTForX(aX), mY1, mY2); - }; - - f.getControlPoints = function () { - return [{ - x: mX1, - y: mY1 - }, { - x: mX2, - y: mY2 - }]; - }; - - var str = "generateBezier(" + [mX1, mY1, mX2, mY2] + ")"; - f.toString = function () { - return str; - }; - - return f; -} - -module.exports = generateCubicBezier; - -/***/ }), -/* 75 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */ -/* Given a tension, friction, and duration, a simulation at 60FPS will first run without a defined duration in order to calculate the full path. A second pass - then adjusts the time delta -- using the relation between actual time and duration -- to calculate the path for the duration-constrained animation. */ -var generateSpringRK4 = function () { - function springAccelerationForState(state) { - return -state.tension * state.x - state.friction * state.v; - } - - function springEvaluateStateWithDerivative(initialState, dt, derivative) { - var state = { - x: initialState.x + derivative.dx * dt, - v: initialState.v + derivative.dv * dt, - tension: initialState.tension, - friction: initialState.friction - }; - - return { dx: state.v, dv: springAccelerationForState(state) }; - } - - function springIntegrateState(state, dt) { - var a = { - dx: state.v, - dv: springAccelerationForState(state) - }, - b = springEvaluateStateWithDerivative(state, dt * 0.5, a), - c = springEvaluateStateWithDerivative(state, dt * 0.5, b), - d = springEvaluateStateWithDerivative(state, dt, c), - dxdt = 1.0 / 6.0 * (a.dx + 2.0 * (b.dx + c.dx) + d.dx), - dvdt = 1.0 / 6.0 * (a.dv + 2.0 * (b.dv + c.dv) + d.dv); - - state.x = state.x + dxdt * dt; - state.v = state.v + dvdt * dt; - - return state; - } - - return function springRK4Factory(tension, friction, duration) { - - var initState = { - x: -1, - v: 0, - tension: null, - friction: null - }, - path = [0], - time_lapsed = 0, - tolerance = 1 / 10000, - DT = 16 / 1000, - have_duration = void 0, - dt = void 0, - last_state = void 0; - - tension = parseFloat(tension) || 500; - friction = parseFloat(friction) || 20; - duration = duration || null; - - initState.tension = tension; - initState.friction = friction; - - have_duration = duration !== null; - - /* Calculate the actual time it takes for this animation to complete with the provided conditions. */ - if (have_duration) { - /* Run the simulation without a duration. */ - time_lapsed = springRK4Factory(tension, friction); - /* Compute the adjusted time delta. */ - dt = time_lapsed / duration * DT; - } else { - dt = DT; - } - - for (;;) { - /* Next/step function .*/ - last_state = springIntegrateState(last_state || initState, dt); - /* Store the position. */ - path.push(1 + last_state.x); - time_lapsed += 16; - /* If the change threshold is reached, break. */ - if (!(Math.abs(last_state.x) > tolerance && Math.abs(last_state.v) > tolerance)) { - break; - } - } - - /* If duration is not defined, return the actual time required for completing this animation. Otherwise, return a closure that holds the - computed path and returns a snapshot of the position according to a given percentComplete. */ - return !have_duration ? time_lapsed : function (percentComplete) { - return path[percentComplete * (path.length - 1) | 0]; - }; - }; -}(); - -module.exports = generateSpringRK4; - -/***/ }), -/* 76 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); - -function getEasedValue(type, start, end, percent, easingFn) { - if (percent === 1) { - return end; - } - - var val = easingFn(start, end, percent); - - if (type == null) { - return val; - } - - if (type.roundValue || type.color) { - val = Math.round(val); - } - - if (type.min !== undefined) { - val = Math.max(val, type.min); - } - - if (type.max !== undefined) { - val = Math.min(val, type.max); - } - - return val; -} - -function getValue(prop, spec) { - if (prop.pfValue != null || prop.value != null) { - if (prop.pfValue != null && (spec == null || spec.type.units !== '%')) { - return prop.pfValue; - } else { - return prop.value; - } - } else { - return prop; - } -} - -function ease(startProp, endProp, percent, easingFn, propSpec) { - var type = propSpec != null ? propSpec.type : null; - - if (percent < 0) { - percent = 0; - } else if (percent > 1) { - percent = 1; - } - - var start = getValue(startProp, propSpec); - var end = getValue(endProp, propSpec); - - if (is.number(start) && is.number(end)) { - return getEasedValue(type, start, end, percent, easingFn); - } else if (is.array(start) && is.array(end)) { - var easedArr = []; - - for (var i = 0; i < end.length; i++) { - var si = start[i]; - var ei = end[i]; - - if (si != null && ei != null) { - var val = getEasedValue(type, si, ei, percent, easingFn); - - easedArr.push(val); - } else { - easedArr.push(ei); - } - } - - return easedArr; - } - - return undefined; -} - -module.exports = ease; - -/***/ }), -/* 77 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -function startAnimation(self, ani, now, isCore) { - var isEles = !isCore; - var ele = self; - var ani_p = ani._private; - var cy = isCore ? self : self.cy(); - var style = cy.style(); - - if (isEles) { - var pos = ele.position(); - - ani_p.startPosition = ani_p.startPosition || { - x: pos.x, - y: pos.y - }; - - ani_p.startStyle = ani_p.startStyle || style.getAnimationStartStyle(ele, ani_p.style); - } - - if (isCore) { - var pan = cy._private.pan; - - ani_p.startPan = ani_p.startPan || { - x: pan.x, - y: pan.y - }; - - ani_p.startZoom = ani_p.startZoom != null ? ani_p.startZoom : cy._private.zoom; - } - - ani_p.started = true; - ani_p.startTime = now - ani_p.progress * ani_p.duration; -} - -module.exports = startAnimation; - -/***/ }), -/* 78 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Emitter = __webpack_require__(11); -var define = __webpack_require__(4); -var is = __webpack_require__(0); -var util = __webpack_require__(1); -var Selector = __webpack_require__(6); - -var emitterOptions = { - qualifierCompare: function qualifierCompare(selector1, selector2) { - if (selector1 == null || selector2 == null) { - return selector1 == null && selector2 == null; - } else { - return selector1.sameText(selector2); - } - }, - eventMatches: function eventMatches(cy, listener, eventObj) { - var selector = listener.qualifier; - - if (selector != null) { - return cy !== eventObj.target && is.element(eventObj.target) && selector.matches(eventObj.target); - } - - return true; - }, - eventFields: function eventFields(cy) { - return { - cy: cy, - target: cy - }; - }, - callbackContext: function callbackContext(cy, listener, eventObj) { - return listener.qualifier != null ? eventObj.target : cy; - } -}; - -var argSelector = function argSelector(arg) { - if (is.string(arg)) { - return new Selector(arg); - } else { - return arg; - } -}; - -var elesfn = { - createEmitter: function createEmitter() { - var _p = this._private; - - if (!_p.emitter) { - _p.emitter = new Emitter(util.assign({ - context: this - }, emitterOptions)); - } - - return this; - }, - - emitter: function emitter() { - return this._private.emitter; - }, - - on: function on(events, selector, callback) { - this.emitter().on(events, argSelector(selector), callback); - - return this; - }, - - removeListener: function removeListener(events, selector, callback) { - this.emitter().removeListener(events, argSelector(selector), callback); - - return this; - }, - - one: function one(events, selector, callback) { - this.emitter().one(events, argSelector(selector), callback); - - return this; - }, - - once: function once(events, selector, callback) { - this.emitter().one(events, argSelector(selector), callback); - - return this; - }, - - emit: function emit(events, extraParams) { - this.emitter().emit(events, extraParams); - - return this; - } -}; - -define.eventAliasesOn(elesfn); - -module.exports = elesfn; - -/***/ }), -/* 79 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var corefn = { - - png: function png(options) { - var renderer = this._private.renderer; - options = options || {}; - - return renderer.png(options); - }, - - jpg: function jpg(options) { - var renderer = this._private.renderer; - options = options || {}; - - options.bg = options.bg || '#fff'; - - return renderer.jpg(options); - } - -}; - -corefn.jpeg = corefn.jpg; - -module.exports = corefn; - -/***/ }), -/* 80 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var is = __webpack_require__(0); - -var corefn = { - - layout: function layout(options) { - var cy = this; - - if (options == null) { - util.error('Layout options must be specified to make a layout'); - return; - } - - if (options.name == null) { - util.error('A `name` must be specified to make a layout'); - return; - } - - var name = options.name; - var Layout = cy.extension('layout', name); - - if (Layout == null) { - util.error('Can not apply layout: No such layout `' + name + '` found; did you include its JS file?'); - return; - } - - var eles = void 0; - if (is.string(options.eles)) { - eles = cy.$(options.eles); - } else { - eles = options.eles != null ? options.eles : cy.$(); - } - - var layout = new Layout(util.extend({}, options, { - cy: cy, - eles: eles - })); - - return layout; - } - -}; - -corefn.createLayout = corefn.makeLayout = corefn.layout; - -module.exports = corefn; - -/***/ }), -/* 81 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var corefn = { - notify: function notify(params) { - var _p = this._private; - - if (_p.batchingNotify) { - var bEles = _p.batchNotifyEles; - var bTypes = _p.batchNotifyTypes; - - if (params.eles) { - bEles.merge(params.eles); - } - - if (!bTypes.ids[params.type]) { - bTypes.push(params.type); - bTypes.ids[params.type] = true; - } - - return; // notifications are disabled during batching - } - - if (!_p.notificationsEnabled) { - return; - } // exit on disabled - - var renderer = this.renderer(); - - // exit if destroy() called on core or renderer in between frames #1499 #1528 - if (this.isDestroyed() || !renderer) { - return; - } - - renderer.notify(params); - }, - - notifications: function notifications(bool) { - var p = this._private; - - if (bool === undefined) { - return p.notificationsEnabled; - } else { - p.notificationsEnabled = bool ? true : false; - } - }, - - noNotifications: function noNotifications(callback) { - this.notifications(false); - callback(); - this.notifications(true); - }, - - batching: function batching() { - return this._private.batchCount > 0; - }, - - startBatch: function startBatch() { - var _p = this._private; - - if (_p.batchCount == null) { - _p.batchCount = 0; - } - - if (_p.batchCount === 0) { - _p.batchingStyle = _p.batchingNotify = true; - _p.batchStyleEles = this.collection(); - _p.batchNotifyEles = this.collection(); - _p.batchNotifyTypes = []; - _p.batchNotifyTypes.ids = {}; - } - - _p.batchCount++; - - return this; - }, - - endBatch: function endBatch() { - var _p = this._private; - - _p.batchCount--; - - if (_p.batchCount === 0) { - // update style for dirty eles - _p.batchingStyle = false; - _p.batchStyleEles.updateStyle(); - - // notify the renderer of queued eles and event types - _p.batchingNotify = false; - this.notify({ - type: _p.batchNotifyTypes, - eles: _p.batchNotifyEles - }); - } - - return this; - }, - - batch: function batch(callback) { - this.startBatch(); - callback(); - this.endBatch(); - - return this; - }, - - // for backwards compatibility - batchData: function batchData(map) { - var cy = this; - - return this.batch(function () { - var ids = Object.keys(map); - - for (var i = 0; i < ids.length; i++) { - var id = ids[i]; - var data = map[id]; - var ele = cy.getElementById(id); - - ele.data(data); - } - }); - } -}; - -module.exports = corefn; - -/***/ }), -/* 82 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); - -var corefn = { - - renderTo: function renderTo(context, zoom, pan, pxRatio) { - var r = this._private.renderer; - - r.renderTo(context, zoom, pan, pxRatio); - return this; - }, - - renderer: function renderer() { - return this._private.renderer; - }, - - forceRender: function forceRender() { - this.notify({ - type: 'draw' - }); - - return this; - }, - - resize: function resize() { - this.invalidateSize(); - - this.notify({ - type: 'resize' - }); - - this.emit('resize'); - - return this; - }, - - initRenderer: function initRenderer(options) { - var cy = this; - - var RendererProto = cy.extension('renderer', options.name); - if (RendererProto == null) { - util.error('Can not initialise: No such renderer `%s` found; did you include its JS file?', options.name); - return; - } - - cy._private.renderer = new RendererProto(util.extend({}, options, { cy: cy })); - - this.notify({ type: 'init' }); - }, - - destroyRenderer: function destroyRenderer() { - var cy = this; - - cy.notify({ type: 'destroy' }); // destroy the renderer - - var domEle = cy.container(); - if (domEle) { - domEle._cyreg = null; - - while (domEle.childNodes.length > 0) { - domEle.removeChild(domEle.childNodes[0]); - } - } - - cy._private.renderer = null; // to be extra safe, remove the ref - }, - - onRender: function onRender(fn) { - return this.on('render', fn); - }, - - offRender: function offRender(fn) { - return this.off('render', fn); - } - -}; - -corefn.invalidateDimensions = corefn.resize; - -module.exports = corefn; - -/***/ }), -/* 83 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var Collection = __webpack_require__(7); - -var corefn = { - - // get a collection - // - empty collection on no args - // - collection of elements in the graph on selector arg - // - guarantee a returned collection when elements or collection specified - collection: function collection(eles, opts) { - - if (is.string(eles)) { - return this.$(eles); - } else if (is.elementOrCollection(eles)) { - return eles.collection(); - } else if (is.array(eles)) { - return new Collection(this, eles, opts); - } - - return new Collection(this); - }, - - nodes: function nodes(selector) { - var nodes = this.$(function (ele) { - return ele.isNode(); - }); - - if (selector) { - return nodes.filter(selector); - } - - return nodes; - }, - - edges: function edges(selector) { - var edges = this.$(function (ele) { - return ele.isEdge(); - }); - - if (selector) { - return edges.filter(selector); - } - - return edges; - }, - - // search the graph like jQuery - $: function $(selector) { - var eles = this._private.elements; - - if (selector) { - return eles.filter(selector); - } else { - return eles.spawnSelf(); - } - }, - - mutableElements: function mutableElements() { - return this._private.elements; - } - -}; - -// aliases -corefn.elements = corefn.filter = corefn.$; - -module.exports = corefn; - -/***/ }), -/* 84 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var Style = __webpack_require__(18); - -var corefn = { - - style: function style(newStyle) { - if (newStyle) { - var s = this.setStyle(newStyle); - - s.update(); - } - - return this._private.style; - }, - - setStyle: function setStyle(style) { - var _p = this._private; - - if (is.stylesheet(style)) { - _p.style = style.generateStyle(this); - } else if (is.array(style)) { - _p.style = Style.fromJson(this, style); - } else if (is.string(style)) { - _p.style = Style.fromString(this, style); - } else { - _p.style = Style(this); - } - - return _p.style; - } -}; - -module.exports = corefn; - -/***/ }), -/* 85 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var is = __webpack_require__(0); -var Promise = __webpack_require__(5); - -var styfn = {}; - -// (potentially expensive calculation) -// apply the style to the element based on -// - its bypass -// - what selectors match it -styfn.apply = function (eles) { - var self = this; - var _p = self._private; - var cy = _p.cy; - var updatedEles = cy.collection(); - - if (_p.newStyle) { - // clear style caches - _p.contextStyles = {}; - _p.propDiffs = {}; - - self.cleanElements(eles, true); - } - - for (var ie = 0; ie < eles.length; ie++) { - var ele = eles[ie]; - - var cxtMeta = self.getContextMeta(ele); - - if (cxtMeta.empty) { - continue; - } else { - updatedEles.merge(ele); - } - - var cxtStyle = self.getContextStyle(cxtMeta); - var app = self.applyContextStyle(cxtMeta, cxtStyle, ele); - - if (!_p.newStyle) { - self.updateTransitions(ele, app.diffProps); - } - - self.updateStyleHints(ele); - } // for elements - - _p.newStyle = false; - - return updatedEles; -}; - -styfn.getPropertiesDiff = function (oldCxtKey, newCxtKey) { - var self = this; - var cache = self._private.propDiffs = self._private.propDiffs || {}; - var dualCxtKey = oldCxtKey + '-' + newCxtKey; - var cachedVal = cache[dualCxtKey]; - - if (cachedVal) { - return cachedVal; - } - - var diffProps = []; - var addedProp = {}; - - for (var i = 0; i < self.length; i++) { - var cxt = self[i]; - var oldHasCxt = oldCxtKey[i] === 't'; - var newHasCxt = newCxtKey[i] === 't'; - var cxtHasDiffed = oldHasCxt !== newHasCxt; - var cxtHasMappedProps = cxt.mappedProperties.length > 0; - - if (cxtHasDiffed || cxtHasMappedProps) { - var props = void 0; - - if (cxtHasDiffed && cxtHasMappedProps) { - props = cxt.properties; // suffices b/c mappedProperties is a subset of properties - } else if (cxtHasDiffed) { - props = cxt.properties; // need to check them all - } else if (cxtHasMappedProps) { - props = cxt.mappedProperties; // only need to check mapped - } - - for (var j = 0; j < props.length; j++) { - var prop = props[j]; - var name = prop.name; - - // if a later context overrides this property, then the fact that this context has switched/diffed doesn't matter - // (semi expensive check since it makes this function O(n^2) on context length, but worth it since overall result - // is cached) - var laterCxtOverrides = false; - for (var k = i + 1; k < self.length; k++) { - var laterCxt = self[k]; - var hasLaterCxt = newCxtKey[k] === 't'; - - if (!hasLaterCxt) { - continue; - } // can't override unless the context is active - - laterCxtOverrides = laterCxt.properties[prop.name] != null; - - if (laterCxtOverrides) { - break; - } // exit early as long as one later context overrides - } - - if (!addedProp[name] && !laterCxtOverrides) { - addedProp[name] = true; - diffProps.push(name); - } - } // for props - } // if - } // for contexts - - cache[dualCxtKey] = diffProps; - return diffProps; -}; - -styfn.getContextMeta = function (ele) { - var self = this; - var cxtKey = ''; - var diffProps = void 0; - var prevKey = ele._private.styleCxtKey || ''; - - if (self._private.newStyle) { - prevKey = ''; // since we need to apply all style if a fresh stylesheet - } - - // get the cxt key - for (var i = 0; i < self.length; i++) { - var context = self[i]; - var contextSelectorMatches = context.selector && context.selector.matches(ele); // NB: context.selector may be null for 'core' - - if (contextSelectorMatches) { - cxtKey += 't'; - } else { - cxtKey += 'f'; - } - } // for context - - diffProps = self.getPropertiesDiff(prevKey, cxtKey); - - ele._private.styleCxtKey = cxtKey; - - return { - key: cxtKey, - diffPropNames: diffProps, - empty: diffProps.length === 0 - }; -}; - -// gets a computed ele style object based on matched contexts -styfn.getContextStyle = function (cxtMeta) { - var cxtKey = cxtMeta.key; - var self = this; - var cxtStyles = this._private.contextStyles = this._private.contextStyles || {}; - - // if already computed style, returned cached copy - if (cxtStyles[cxtKey]) { - return cxtStyles[cxtKey]; - } - - var style = { - _private: { - key: cxtKey - } - }; - - for (var i = 0; i < self.length; i++) { - var cxt = self[i]; - var hasCxt = cxtKey[i] === 't'; - - if (!hasCxt) { - continue; - } - - for (var j = 0; j < cxt.properties.length; j++) { - var prop = cxt.properties[j]; - - style[prop.name] = prop; - } - } - - cxtStyles[cxtKey] = style; - return style; -}; - -styfn.applyContextStyle = function (cxtMeta, cxtStyle, ele) { - var self = this; - var diffProps = cxtMeta.diffPropNames; - var retDiffProps = {}; - - for (var i = 0; i < diffProps.length; i++) { - var diffPropName = diffProps[i]; - var cxtProp = cxtStyle[diffPropName]; - var eleProp = ele.pstyle(diffPropName); - - if (!cxtProp) { - // no context prop means delete - if (!eleProp) { - continue; // no existing prop means nothing needs to be removed - // nb affects initial application on mapped values like control-point-distances - } else if (eleProp.bypass) { - cxtProp = { name: diffPropName, deleteBypassed: true }; - } else { - cxtProp = { name: diffPropName, delete: true }; - } - } - - // save cycles when the context prop doesn't need to be applied - if (eleProp === cxtProp) { - continue; - } - - var retDiffProp = retDiffProps[diffPropName] = { - prev: eleProp - }; - - self.applyParsedProperty(ele, cxtProp); - - retDiffProp.next = ele.pstyle(diffPropName); - - if (retDiffProp.next && retDiffProp.next.bypass) { - retDiffProp.next = retDiffProp.next.bypassed; - } - } - - return { - diffProps: retDiffProps - }; -}; - -styfn.updateStyleHints = function (ele) { - var _p = ele._private; - var self = this; - - if (ele.removed()) { - return; - } - - // set whether has pie or not; for greater efficiency - var hasPie = false; - if (_p.group === 'nodes') { - for (var i = 1; i <= self.pieBackgroundN; i++) { - // 1..N - var _size = ele.pstyle('pie-' + i + '-background-size').value; - - if (_size > 0) { - hasPie = true; - break; - } - } - } - - _p.hasPie = hasPie; - - var transform = ele.pstyle('text-transform').strValue; - var content = ele.pstyle('label').strValue; - var srcContent = ele.pstyle('source-label').strValue; - var tgtContent = ele.pstyle('target-label').strValue; - var fStyle = ele.pstyle('font-style').strValue; - var size = ele.pstyle('font-size').pfValue + 'px'; - var family = ele.pstyle('font-family').strValue; - // let letiant = style['font-letiant'].strValue; - var weight = ele.pstyle('font-weight').strValue; - var valign = ele.pstyle('text-valign').strValue; - var halign = ele.pstyle('text-valign').strValue; - var oWidth = ele.pstyle('text-outline-width').pfValue; - var wrap = ele.pstyle('text-wrap').strValue; - var wrapW = ele.pstyle('text-max-width').pfValue; - var labelStyleKey = fStyle + '$' + size + '$' + family + '$' + weight + '$' + transform + '$' + valign + '$' + halign + '$' + oWidth + '$' + wrap + '$' + wrapW; - _p.labelStyleKey = labelStyleKey; - _p.sourceLabelKey = labelStyleKey + '$' + srcContent; - _p.targetLabelKey = labelStyleKey + '$' + tgtContent; - _p.labelKey = labelStyleKey + '$' + content; - _p.fontKey = fStyle + '$' + weight + '$' + size + '$' + family; - - _p.styleKey = Date.now(); -}; - -// apply a property to the style (for internal use) -// returns whether application was successful -// -// now, this function flattens the property, and here's how: -// -// for parsedProp:{ bypass: true, deleteBypass: true } -// no property is generated, instead the bypass property in the -// element's style is replaced by what's pointed to by the `bypassed` -// field in the bypass property (i.e. restoring the property the -// bypass was overriding) -// -// for parsedProp:{ mapped: truthy } -// the generated flattenedProp:{ mapping: prop } -// -// for parsedProp:{ bypass: true } -// the generated flattenedProp:{ bypassed: parsedProp } -styfn.applyParsedProperty = function (ele, parsedProp) { - var self = this; - var prop = parsedProp; - var style = ele._private.style; - var fieldVal = void 0, - flatProp = void 0; - var types = self.types; - var type = self.properties[prop.name].type; - var propIsBypass = prop.bypass; - var origProp = style[prop.name]; - var origPropIsBypass = origProp && origProp.bypass; - var _p = ele._private; - var flatPropMapping = 'mapping'; - - var checkZOrder = function checkZOrder() { - self.checkZOrderTrigger(ele, prop.name, origProp ? origProp.value : null, prop.value); - }; - - // edges connected to compound nodes can not be haystacks - if (parsedProp.name === 'curve-style' && parsedProp.value === 'haystack' && ele.isEdge() && (ele.isLoop() || ele.source().isParent() || ele.target().isParent())) { - prop = parsedProp = this.parse(parsedProp.name, 'bezier', propIsBypass); - } - - if (prop.delete) { - // delete the property and use the default value on falsey value - style[prop.name] = undefined; - - checkZOrder(); - - return true; - } - - if (prop.deleteBypassed) { - // delete the property that the - if (!origProp) { - checkZOrder(); - - return true; // can't delete if no prop - } else if (origProp.bypass) { - // delete bypassed - origProp.bypassed = undefined; - - checkZOrder(); - - return true; - } else { - return false; // we're unsuccessful deleting the bypassed - } - } - - // check if we need to delete the current bypass - if (prop.deleteBypass) { - // then this property is just here to indicate we need to delete - if (!origProp) { - checkZOrder(); - - return true; // property is already not defined - } else if (origProp.bypass) { - // then replace the bypass property with the original - // because the bypassed property was already applied (and therefore parsed), we can just replace it (no reapplying necessary) - style[prop.name] = origProp.bypassed; - - checkZOrder(); - - return true; - } else { - return false; // we're unsuccessful deleting the bypass - } - } - - var printMappingErr = function printMappingErr() { - util.error('Do not assign mappings to elements without corresponding data (e.g. ele `' + ele.id() + '` for property `' + prop.name + '` with data field `' + prop.field + '`); try a `[' + prop.field + ']` selector to limit scope to elements with `' + prop.field + '` defined'); - }; - - // put the property in the style objects - switch (prop.mapped) {// flatten the property if mapped - case types.mapData: - { - // flatten the field (e.g. data.foo.bar) - var fields = prop.field.split('.'); - var _fieldVal = _p.data; - - for (var i = 0; i < fields.length && _fieldVal; i++) { - var field = fields[i]; - _fieldVal = _fieldVal[field]; - } - - var percent = void 0; - if (!is.number(_fieldVal)) { - // then keep the mapping but assume 0% for now - percent = 0; - } else { - percent = (_fieldVal - prop.fieldMin) / (prop.fieldMax - prop.fieldMin); - } - - // make sure to bound percent value - if (percent < 0) { - percent = 0; - } else if (percent > 1) { - percent = 1; - } - - if (type.color) { - var r1 = prop.valueMin[0]; - var r2 = prop.valueMax[0]; - var g1 = prop.valueMin[1]; - var g2 = prop.valueMax[1]; - var b1 = prop.valueMin[2]; - var b2 = prop.valueMax[2]; - var a1 = prop.valueMin[3] == null ? 1 : prop.valueMin[3]; - var a2 = prop.valueMax[3] == null ? 1 : prop.valueMax[3]; - - var clr = [Math.round(r1 + (r2 - r1) * percent), Math.round(g1 + (g2 - g1) * percent), Math.round(b1 + (b2 - b1) * percent), Math.round(a1 + (a2 - a1) * percent)]; - - flatProp = { // colours are simple, so just create the flat property instead of expensive string parsing - bypass: prop.bypass, // we're a bypass if the mapping property is a bypass - name: prop.name, - value: clr, - strValue: 'rgb(' + clr[0] + ', ' + clr[1] + ', ' + clr[2] + ')' - }; - } else if (type.number) { - var calcValue = prop.valueMin + (prop.valueMax - prop.valueMin) * percent; - flatProp = this.parse(prop.name, calcValue, prop.bypass, flatPropMapping); - } else { - return false; // can only map to colours and numbers - } - - if (!flatProp) { - // if we can't flatten the property, then use the origProp so we still keep the mapping itself - flatProp = this.parse(prop.name, origProp.strValue, prop.bypass, flatPropMapping); - } - - if (!flatProp) { - printMappingErr(); - } - flatProp.mapping = prop; // keep a reference to the mapping - prop = flatProp; // the flattened (mapped) property is the one we want - - break; - } - - // direct mapping - case types.data: - { - // flatten the field (e.g. data.foo.bar) - var _fields = prop.field.split('.'); - var _fieldVal2 = _p.data; - - if (_fieldVal2) { - for (var _i = 0; _i < _fields.length; _i++) { - var _field = _fields[_i]; - _fieldVal2 = _fieldVal2[_field]; - } - } - - flatProp = this.parse(prop.name, _fieldVal2, prop.bypass, flatPropMapping); - - if (!flatProp) { - // if we can't flatten the property, then use the origProp so we still keep the mapping itself - var flatPropVal = origProp ? origProp.strValue : ''; - - flatProp = this.parse(prop.name, flatPropVal, prop.bypass, flatPropMapping); - } - - if (!flatProp) { - printMappingErr(); - } - flatProp.mapping = prop; // keep a reference to the mapping - prop = flatProp; // the flattened (mapped) property is the one we want - - break; - } - - case types.fn: - { - var fn = prop.value; - var fnRetVal = fn(ele); - - flatProp = this.parse(prop.name, fnRetVal, prop.bypass, flatPropMapping); - flatProp.mapping = prop; // keep a reference to the mapping - prop = flatProp; // the flattened (mapped) property is the one we want - - break; - } - - case undefined: - break; // just set the property - - default: - return false; // not a valid mapping - } - - // if the property is a bypass property, then link the resultant property to the original one - if (propIsBypass) { - if (origPropIsBypass) { - // then this bypass overrides the existing one - prop.bypassed = origProp.bypassed; // steal bypassed prop from old bypass - } else { - // then link the orig prop to the new bypass - prop.bypassed = origProp; - } - - style[prop.name] = prop; // and set - } else { - // prop is not bypass - if (origPropIsBypass) { - // then keep the orig prop (since it's a bypass) and link to the new prop - origProp.bypassed = prop; - } else { - // then just replace the old prop with the new one - style[prop.name] = prop; - } - } - - checkZOrder(); - - return true; -}; - -styfn.cleanElements = function (eles, keepBypasses) { - var self = this; - var props = self.properties; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - - if (!keepBypasses) { - ele._private.style = {}; - } else { - var style = ele._private.style; - - for (var j = 0; j < props.length; j++) { - var prop = props[j]; - var eleProp = style[prop.name]; - - if (eleProp) { - if (eleProp.bypass) { - eleProp.bypassed = null; - } else { - style[prop.name] = null; - } - } - } - } - } -}; - -// updates the visual style for all elements (useful for manual style modification after init) -styfn.update = function () { - var cy = this._private.cy; - var eles = cy.mutableElements(); - - eles.updateStyle(); -}; - -// just update the functional properties (i.e. mappings) in the elements' -// styles (less expensive than recalculation) -styfn.updateMappers = function (eles) { - var self = this; - var cy = this._private.cy; - var updatedEles = cy.collection(); - - for (var i = 0; i < eles.length; i++) { - // for each ele - var ele = eles[i]; - var style = ele._private.style; - var updatedEle = false; - - for (var j = 0; j < self.properties.length; j++) { - // for each prop - var prop = self.properties[j]; - var propInStyle = style[prop.name]; - - if (propInStyle && propInStyle.mapping) { - var mapping = propInStyle.mapping; - - this.applyParsedProperty(ele, mapping); // reapply the mapping property - - updatedEle = true; - } - } - - if (updatedEle) { - this.updateStyleHints(ele); - - updatedEles.merge(ele); - } - } - - return updatedEles; -}; - -// diffProps : { name => { prev, next } } -styfn.updateTransitions = function (ele, diffProps, isBypass) { - var self = this; - var _p = ele._private; - var props = ele.pstyle('transition-property').value; - var duration = ele.pstyle('transition-duration').pfValue; - var delay = ele.pstyle('transition-delay').pfValue; - - if (props.length > 0 && duration > 0) { - - var style = {}; - - // build up the style to animate towards - var anyPrev = false; - for (var i = 0; i < props.length; i++) { - var prop = props[i]; - var styProp = ele.pstyle(prop); - var diffProp = diffProps[prop]; - - if (!diffProp) { - continue; - } - - var prevProp = diffProp.prev; - var fromProp = prevProp; - var toProp = diffProp.next != null ? diffProp.next : styProp; - var diff = false; - var initVal = void 0; - var initDt = 0.000001; // delta time % value for initVal (allows animating out of init zero opacity) - - if (!fromProp) { - continue; - } - - // consider px values - if (is.number(fromProp.pfValue) && is.number(toProp.pfValue)) { - diff = toProp.pfValue - fromProp.pfValue; // nonzero is truthy - initVal = fromProp.pfValue + initDt * diff; - - // consider numerical values - } else if (is.number(fromProp.value) && is.number(toProp.value)) { - diff = toProp.value - fromProp.value; // nonzero is truthy - initVal = fromProp.value + initDt * diff; - - // consider colour values - } else if (is.array(fromProp.value) && is.array(toProp.value)) { - diff = fromProp.value[0] !== toProp.value[0] || fromProp.value[1] !== toProp.value[1] || fromProp.value[2] !== toProp.value[2]; - - initVal = fromProp.strValue; - } - - // the previous value is good for an animation only if it's different - if (diff) { - style[prop] = toProp.strValue; // to val - this.applyBypass(ele, prop, initVal); // from val - anyPrev = true; - } - } // end if props allow ani - - // can't transition if there's nothing previous to transition from - if (!anyPrev) { - return; - } - - _p.transitioning = true; - - new Promise(function (resolve) { - if (delay > 0) { - ele.delayAnimation(delay).play().promise().then(resolve); - } else { - resolve(); - } - }).then(function () { - return ele.animation({ - style: style, - duration: duration, - easing: ele.pstyle('transition-timing-function').value, - queue: false - }).play().promise(); - }).then(function () { - // if( !isBypass ){ - self.removeBypasses(ele, props); - ele.emitAndNotify('style'); - // } - - _p.transitioning = false; - }); - } else if (_p.transitioning) { - this.removeBypasses(ele, props); - ele.emitAndNotify('style'); - - _p.transitioning = false; - } -}; - -styfn.checkZOrderTrigger = function (ele, name, fromValue, toValue) { - var prop = this.properties[name]; - - if (prop.triggersZOrder != null && (fromValue == null || prop.triggersZOrder(fromValue, toValue))) { - this._private.cy.notify({ - type: 'zorder', - eles: ele - }); - } -}; - -module.exports = styfn; - -/***/ }), -/* 86 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var util = __webpack_require__(1); - -var styfn = {}; - -// bypasses are applied to an existing style on an element, and just tacked on temporarily -// returns true iff application was successful for at least 1 specified property -styfn.applyBypass = function (eles, name, value, updateTransitions) { - var self = this; - var props = []; - var isBypass = true; - - // put all the properties (can specify one or many) in an array after parsing them - if (name === '*' || name === '**') { - // apply to all property names - - if (value !== undefined) { - for (var i = 0; i < self.properties.length; i++) { - var prop = self.properties[i]; - var _name = prop.name; - - var parsedProp = this.parse(_name, value, true); - - if (parsedProp) { - props.push(parsedProp); - } - } - } - } else if (is.string(name)) { - // then parse the single property - var _parsedProp = this.parse(name, value, true); - - if (_parsedProp) { - props.push(_parsedProp); - } - } else if (is.plainObject(name)) { - // then parse each property - var specifiedProps = name; - updateTransitions = value; - - var names = Object.keys(specifiedProps); - - for (var _i = 0; _i < names.length; _i++) { - var _name2 = names[_i]; - var _prop = self.properties[_name2]; - var _value = specifiedProps[_name2]; - - if (_value === undefined) { - // try camel case name too - _value = specifiedProps[util.dash2camel(_name2)]; - } - - if (_value !== undefined) { - var _parsedProp2 = this.parse(_name2, _value, true); - - if (_parsedProp2) { - props.push(_parsedProp2); - } - } - } - } else { - // can't do anything without well defined properties - return false; - } - - // we've failed if there are no valid properties - if (props.length === 0) { - return false; - } - - // now, apply the bypass properties on the elements - var ret = false; // return true if at least one succesful bypass applied - for (var _i2 = 0; _i2 < eles.length; _i2++) { - // for each ele - var ele = eles[_i2]; - var diffProps = {}; - var diffProp = void 0; - - for (var j = 0; j < props.length; j++) { - // for each prop - var _prop2 = props[j]; - - if (updateTransitions) { - var prevProp = ele.pstyle(_prop2.name); - diffProp = diffProps[_prop2.name] = { prev: prevProp }; - } - - ret = this.applyParsedProperty(ele, _prop2) || ret; - - if (updateTransitions) { - diffProp.next = ele.pstyle(_prop2.name); - } - } // for props - - if (ret) { - this.updateStyleHints(ele); - } - - if (updateTransitions) { - this.updateTransitions(ele, diffProps, isBypass); - } - } // for eles - - return ret; -}; - -// only useful in specific cases like animation -styfn.overrideBypass = function (eles, name, value) { - name = util.camel2dash(name); - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - var prop = ele._private.style[name]; - var type = this.properties[name].type; - var isColor = type.color; - var isMulti = type.mutiple; - - if (!prop || !prop.bypass) { - // need a bypass if one doesn't exist - this.applyBypass(ele, name, value); - continue; - } - - var oldValue = prop.pfValue != null ? prop.pfValue : prop.value; - - prop.value = value; - - if (prop.pfValue != null) { - prop.pfValue = value; - } - - if (isColor) { - prop.strValue = 'rgb(' + value.join(',') + ')'; - } else if (isMulti) { - prop.strValue = value.join(' '); - } else { - prop.strValue = '' + value; - } - - this.checkZOrderTrigger(ele, name, oldValue, value); - } -}; - -styfn.removeAllBypasses = function (eles, updateTransitions) { - return this.removeBypasses(eles, this.propertyNames, updateTransitions); -}; - -styfn.removeBypasses = function (eles, props, updateTransitions) { - var isBypass = true; - - for (var j = 0; j < eles.length; j++) { - var ele = eles[j]; - var diffProps = {}; - - for (var i = 0; i < props.length; i++) { - var name = props[i]; - var prop = this.properties[name]; - var prevProp = ele.pstyle(prop.name); - - if (!prevProp || !prevProp.bypass) { - // if a bypass doesn't exist for the prop, nothing needs to be removed - continue; - } - - var value = ''; // empty => remove bypass - var parsedProp = this.parse(name, value, true); - var diffProp = diffProps[prop.name] = { prev: prevProp }; - - this.applyParsedProperty(ele, parsedProp); - - diffProp.next = ele.pstyle(prop.name); - } // for props - - this.updateStyleHints(ele); - - if (updateTransitions) { - this.updateTransitions(ele, diffProps, isBypass); - } - } // for eles -}; - -module.exports = styfn; - -/***/ }), -/* 87 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var window = __webpack_require__(3); - -var styfn = {}; - -// gets what an em size corresponds to in pixels relative to a dom element -styfn.getEmSizeInPixels = function () { - var px = this.containerCss('font-size'); - - if (px != null) { - return parseFloat(px); - } else { - return 1; // for headless - } -}; - -// gets css property from the core container -styfn.containerCss = function (propName) { - var cy = this._private.cy; - var domElement = cy.container(); - - if (window && domElement && window.getComputedStyle) { - return window.getComputedStyle(domElement).getPropertyValue(propName); - } -}; - -module.exports = styfn; - -/***/ }), -/* 88 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var is = __webpack_require__(0); - -var styfn = {}; - -// gets the rendered style for an element -styfn.getRenderedStyle = function (ele, prop) { - if (prop) { - return this.getStylePropertyValue(ele, prop, true); - } else { - return this.getRawStyle(ele, true); - } -}; - -// gets the raw style for an element -styfn.getRawStyle = function (ele, isRenderedVal) { - var self = this; - - ele = ele[0]; // insure it's an element - - if (ele) { - var rstyle = {}; - - for (var i = 0; i < self.properties.length; i++) { - var prop = self.properties[i]; - var val = self.getStylePropertyValue(ele, prop.name, isRenderedVal); - - if (val != null) { - rstyle[prop.name] = val; - rstyle[util.dash2camel(prop.name)] = val; - } - } - - return rstyle; - } -}; - -styfn.getIndexedStyle = function (ele, property, subproperty, index) { - var pstyle = ele.pstyle(property)[subproperty][index]; - return pstyle != null ? pstyle : ele.cy().style().getDefaultProperty(property)[subproperty][0]; -}; - -styfn.getStylePropertyValue = function (ele, propName, isRenderedVal) { - var self = this; - - ele = ele[0]; // insure it's an element - - if (ele) { - var prop = self.properties[propName]; - - if (prop.alias) { - prop = prop.pointsTo; - } - - var type = prop.type; - var styleProp = ele.pstyle(prop.name); - var zoom = ele.cy().zoom(); - - if (styleProp) { - var units = styleProp.units ? type.implicitUnits || 'px' : null; - var val = units ? [].concat(styleProp.pfValue).map(function (pfValue) { - return pfValue * (isRenderedVal ? zoom : 1) + units; - }).join(' ') : styleProp.strValue; - - return val; - } - } -}; - -styfn.getAnimationStartStyle = function (ele, aniProps) { - var rstyle = {}; - - for (var i = 0; i < aniProps.length; i++) { - var aniProp = aniProps[i]; - var name = aniProp.name; - - var styleProp = ele.pstyle(name); - - if (styleProp !== undefined) { - // then make a prop of it - if (is.plainObject(styleProp)) { - styleProp = this.parse(name, styleProp.strValue); - } else { - styleProp = this.parse(name, styleProp); - } - } - - if (styleProp) { - rstyle[name] = styleProp; - } - } - - return rstyle; -}; - -styfn.getPropsList = function (propsObj) { - var self = this; - var rstyle = []; - var style = propsObj; - var props = self.properties; - - if (style) { - var names = Object.keys(style); - - for (var i = 0; i < names.length; i++) { - var name = names[i]; - var val = style[name]; - var prop = props[name] || props[util.camel2dash(name)]; - var styleProp = this.parse(prop.name, val); - - if (styleProp) { - rstyle.push(styleProp); - } - } - } - - return rstyle; -}; - -module.exports = styfn; - -/***/ }), -/* 89 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var styfn = {}; - -styfn.appendFromJson = function (json) { - var style = this; - - for (var i = 0; i < json.length; i++) { - var context = json[i]; - var selector = context.selector; - var props = context.style || context.css; - var names = Object.keys(props); - - style.selector(selector); // apply selector - - for (var j = 0; j < names.length; j++) { - var name = names[j]; - var value = props[name]; - - style.css(name, value); // apply property - } - } - - return style; -}; - -// accessible cy.style() function -styfn.fromJson = function (json) { - var style = this; - - style.resetToDefault(); - style.appendFromJson(json); - - return style; -}; - -// get json from cy.style() api -styfn.json = function () { - var json = []; - - for (var i = this.defaultLength; i < this.length; i++) { - var cxt = this[i]; - var selector = cxt.selector; - var props = cxt.properties; - var css = {}; - - for (var j = 0; j < props.length; j++) { - var prop = props[j]; - css[prop.name] = prop.strValue; - } - - json.push({ - selector: !selector ? 'core' : selector.toString(), - style: css - }); - } - - return json; -}; - -module.exports = styfn; - -/***/ }), -/* 90 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var Selector = __webpack_require__(6); - -var styfn = {}; - -styfn.appendFromString = function (string) { - var self = this; - var style = this; - var remaining = '' + string; - var selAndBlockStr = void 0; - var blockRem = void 0; - var propAndValStr = void 0; - - // remove comments from the style string - remaining = remaining.replace(/[/][*](\s|.)+?[*][/]/g, ''); - - function removeSelAndBlockFromRemaining() { - // remove the parsed selector and block from the remaining text to parse - if (remaining.length > selAndBlockStr.length) { - remaining = remaining.substr(selAndBlockStr.length); - } else { - remaining = ''; - } - } - - function removePropAndValFromRem() { - // remove the parsed property and value from the remaining block text to parse - if (blockRem.length > propAndValStr.length) { - blockRem = blockRem.substr(propAndValStr.length); - } else { - blockRem = ''; - } - } - - while (true) { - var nothingLeftToParse = remaining.match(/^\s*$/); - if (nothingLeftToParse) { - break; - } - - var selAndBlock = remaining.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/); - - if (!selAndBlock) { - util.error('Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: ' + remaining); - break; - } - - selAndBlockStr = selAndBlock[0]; - - // parse the selector - var selectorStr = selAndBlock[1]; - if (selectorStr !== 'core') { - var selector = new Selector(selectorStr); - if (selector._private.invalid) { - util.error('Skipping parsing of block: Invalid selector found in string stylesheet: ' + selectorStr); - - // skip this selector and block - removeSelAndBlockFromRemaining(); - continue; - } - } - - // parse the block of properties and values - var blockStr = selAndBlock[2]; - var invalidBlock = false; - blockRem = blockStr; - var props = []; - - while (true) { - var _nothingLeftToParse = blockRem.match(/^\s*$/); - if (_nothingLeftToParse) { - break; - } - - var propAndVal = blockRem.match(/^\s*(.+?)\s*:\s*(.+?)\s*;/); - - if (!propAndVal) { - util.error('Skipping parsing of block: Invalid formatting of style property and value definitions found in:' + blockStr); - invalidBlock = true; - break; - } - - propAndValStr = propAndVal[0]; - var propStr = propAndVal[1]; - var valStr = propAndVal[2]; - - var prop = self.properties[propStr]; - if (!prop) { - util.error('Skipping property: Invalid property name in: ' + propAndValStr); - - // skip this property in the block - removePropAndValFromRem(); - continue; - } - - var parsedProp = style.parse(propStr, valStr); - - if (!parsedProp) { - util.error('Skipping property: Invalid property definition in: ' + propAndValStr); - - // skip this property in the block - removePropAndValFromRem(); - continue; - } - - props.push({ - name: propStr, - val: valStr - }); - removePropAndValFromRem(); - } - - if (invalidBlock) { - removeSelAndBlockFromRemaining(); - break; - } - - // put the parsed block in the style - style.selector(selectorStr); - for (var i = 0; i < props.length; i++) { - var _prop = props[i]; - style.css(_prop.name, _prop.val); - } - - removeSelAndBlockFromRemaining(); - } - - return style; -}; - -styfn.fromString = function (string) { - var style = this; - - style.resetToDefault(); - style.appendFromString(string); - - return style; -}; - -module.exports = styfn; - -/***/ }), -/* 91 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var is = __webpack_require__(0); - -var styfn = {}; - -(function () { - var number = util.regex.number; - var rgba = util.regex.rgbaNoBackRefs; - var hsla = util.regex.hslaNoBackRefs; - var hex3 = util.regex.hex3; - var hex6 = util.regex.hex6; - var data = function data(prefix) { - return '^' + prefix + '\\s*\\(\\s*([\\w\\.]+)\\s*\\)$'; - }; - var mapData = function mapData(prefix) { - var mapArg = number + '|\\w+|' + rgba + '|' + hsla + '|' + hex3 + '|' + hex6; - return '^' + prefix + '\\s*\\(([\\w\\.]+)\\s*\\,\\s*(' + number + ')\\s*\\,\\s*(' + number + ')\\s*,\\s*(' + mapArg + ')\\s*\\,\\s*(' + mapArg + ')\\)$'; - }; - var urlRegexes = ['^url\\s*\\(\\s*[\'"]?(.+?)[\'"]?\\s*\\)$', '^(none)$', '^(.+)$']; - - // each visual style property has a type and needs to be validated according to it - styfn.types = { - time: { number: true, min: 0, units: 's|ms', implicitUnits: 'ms' }, - percent: { number: true, min: 0, max: 100, units: '%', implicitUnits: '%' }, - zeroOneNumber: { number: true, min: 0, max: 1, unitless: true }, - zeroOneNumbers: { number: true, min: 0, max: 1, unitless: true, multiple: true }, - nOneOneNumber: { number: true, min: -1, max: 1, unitless: true }, - nonNegativeInt: { number: true, min: 0, integer: true, unitless: true }, - position: { enums: ['parent', 'origin'] }, - nodeSize: { number: true, min: 0, enums: ['label'] }, - number: { number: true, unitless: true }, - numbers: { number: true, unitless: true, multiple: true }, - positiveNumber: { number: true, unitless: true, min: 0, strictMin: true }, - size: { number: true, min: 0 }, - bidirectionalSize: { number: true }, // allows negative - bidirectionalSizes: { number: true, multiple: true }, // allows negative - sizeMaybePercent: { number: true, min: 0, allowPercent: true }, - paddingRelativeTo: { enums: ['width', 'height', 'average', 'min', 'max'] }, - bgWH: { number: true, min: 0, allowPercent: true, enums: ['auto'], multiple: true }, - bgPos: { number: true, allowPercent: true, multiple: true }, - bgRelativeTo: { enums: ['inner', 'include-padding'], multiple: true }, - bgRepeat: { enums: ['repeat', 'repeat-x', 'repeat-y', 'no-repeat'], multiple: true }, - bgFit: { enums: ['none', 'contain', 'cover'], multiple: true }, - bgCrossOrigin: { enums: ['anonymous', 'use-credentials'], multiple: true }, - bgClip: { enums: ['none', 'node'] }, - color: { color: true }, - bool: { enums: ['yes', 'no'] }, - lineStyle: { enums: ['solid', 'dotted', 'dashed'] }, - borderStyle: { enums: ['solid', 'dotted', 'dashed', 'double'] }, - curveStyle: { enums: ['bezier', 'unbundled-bezier', 'haystack', 'segments'] }, - fontFamily: { regex: '^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$' }, - fontletiant: { enums: ['small-caps', 'normal'] }, - fontStyle: { enums: ['italic', 'normal', 'oblique'] }, - fontWeight: { enums: ['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '800', '900', 100, 200, 300, 400, 500, 600, 700, 800, 900] }, - textDecoration: { enums: ['none', 'underline', 'overline', 'line-through'] }, - textTransform: { enums: ['none', 'uppercase', 'lowercase'] }, - textWrap: { enums: ['none', 'wrap', 'ellipsis'] }, - textBackgroundShape: { enums: ['rectangle', 'roundrectangle'] }, - nodeShape: { enums: ['rectangle', 'roundrectangle', 'cutrectangle', 'bottomroundrectangle', 'barrel', 'ellipse', 'triangle', 'square', 'pentagon', 'hexagon', 'concavehexagon', 'heptagon', 'octagon', 'tag', 'star', 'diamond', 'vee', 'rhomboid', 'polygon'] }, - compoundIncludeLabels: { enums: ['include', 'exclude'] }, - arrowShape: { enums: ['tee', 'triangle', 'triangle-tee', 'triangle-cross', 'triangle-backcurve', 'half-triangle-overshot', 'vee', 'square', 'circle', 'diamond', 'none'] }, - arrowFill: { enums: ['filled', 'hollow'] }, - display: { enums: ['element', 'none'] }, - visibility: { enums: ['hidden', 'visible'] }, - zCompoundDepth: { enums: ['bottom', 'orphan', 'auto', 'top'] }, - zIndexCompare: { enums: ['auto', 'manual'] }, - valign: { enums: ['top', 'center', 'bottom'] }, - halign: { enums: ['left', 'center', 'right'] }, - text: { string: true }, - data: { mapping: true, regex: data('data') }, - layoutData: { mapping: true, regex: data('layoutData') }, - scratch: { mapping: true, regex: data('scratch') }, - mapData: { mapping: true, regex: mapData('mapData') }, - mapLayoutData: { mapping: true, regex: mapData('mapLayoutData') }, - mapScratch: { mapping: true, regex: mapData('mapScratch') }, - fn: { mapping: true, fn: true }, - url: { regexes: urlRegexes, singleRegexMatchValue: true }, - urls: { regexes: urlRegexes, singleRegexMatchValue: true, multiple: true }, - propList: { propList: true }, - angle: { number: true, units: 'deg|rad', implicitUnits: 'rad' }, - textRotation: { number: true, units: 'deg|rad', implicitUnits: 'rad', enums: ['none', 'autorotate'] }, - polygonPointList: { number: true, multiple: true, evenMultiple: true, min: -1, max: 1, unitless: true }, - edgeDistances: { enums: ['intersection', 'node-position'] }, - edgeEndpoint: { - number: true, multiple: true, units: '%|px|em|deg|rad', implicitUnits: 'px', - enums: ['inside-to-node', 'outside-to-node', 'outside-to-line'], singleEnum: true, - validate: function validate(valArr, unitsArr) { - switch (valArr.length) { - case 2: - // can be % or px only - return unitsArr[0] !== 'deg' && unitsArr[0] !== 'rad' && unitsArr[1] !== 'deg' && unitsArr[1] !== 'rad'; - case 1: - // can be enum, deg, or rad only - return is.string(valArr[0]) || unitsArr[0] === 'deg' || unitsArr[0] === 'rad'; - default: - return false; - } - } - }, - easing: { - regexes: ['^(spring)\\s*\\(\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*\\)$', '^(cubic-bezier)\\s*\\(\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*\\)$'], - enums: ['linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out', 'ease-in-sine', 'ease-out-sine', 'ease-in-out-sine', 'ease-in-quad', 'ease-out-quad', 'ease-in-out-quad', 'ease-in-cubic', 'ease-out-cubic', 'ease-in-out-cubic', 'ease-in-quart', 'ease-out-quart', 'ease-in-out-quart', 'ease-in-quint', 'ease-out-quint', 'ease-in-out-quint', 'ease-in-expo', 'ease-out-expo', 'ease-in-out-expo', 'ease-in-circ', 'ease-out-circ', 'ease-in-out-circ'] - } - }; - - var zOrderDiff = { - zeroNonZero: function zeroNonZero(val1, val2) { - if (val1 === 0 && val2 !== 0) { - return true; - } else if (val1 !== 0 && val2 === 0) { - return true; - } else { - return false; - } - }, - anyDiff: function anyDiff(val1, val2) { - return val1 !== val2; - } - }; - - var zd = zOrderDiff; - - // define visual style properties - var t = styfn.types; - var props = styfn.properties = [ - // main label - { name: 'label', type: t.text }, { name: 'text-rotation', type: t.textRotation }, { name: 'text-margin-x', type: t.bidirectionalSize }, { name: 'text-margin-y', type: t.bidirectionalSize }, - - // source label - { name: 'source-label', type: t.text }, { name: 'source-text-rotation', type: t.textRotation }, { name: 'source-text-margin-x', type: t.bidirectionalSize }, { name: 'source-text-margin-y', type: t.bidirectionalSize }, { name: 'source-text-offset', type: t.size }, - - // target label - { name: 'target-label', type: t.text }, { name: 'target-text-rotation', type: t.textRotation }, { name: 'target-text-margin-x', type: t.bidirectionalSize }, { name: 'target-text-margin-y', type: t.bidirectionalSize }, { name: 'target-text-offset', type: t.size }, - - // common label style - { name: 'text-valign', type: t.valign }, { name: 'text-halign', type: t.halign }, { name: 'color', type: t.color }, { name: 'text-outline-color', type: t.color }, { name: 'text-outline-width', type: t.size }, { name: 'text-outline-opacity', type: t.zeroOneNumber }, { name: 'text-opacity', type: t.zeroOneNumber }, { name: 'text-background-color', type: t.color }, { name: 'text-background-opacity', type: t.zeroOneNumber }, { name: 'text-background-padding', type: t.size }, { name: 'text-border-opacity', type: t.zeroOneNumber }, { name: 'text-border-color', type: t.color }, { name: 'text-border-width', type: t.size }, { name: 'text-border-style', type: t.borderStyle }, { name: 'text-background-shape', type: t.textBackgroundShape }, - // { name: 'text-decoration', type: t.textDecoration }, // not supported in canvas - { name: 'text-transform', type: t.textTransform }, { name: 'text-wrap', type: t.textWrap }, { name: 'text-max-width', type: t.size }, { name: 'text-events', type: t.bool }, { name: 'font-family', type: t.fontFamily }, { name: 'font-style', type: t.fontStyle }, - // { name: 'font-letiant', type: t.fontletiant }, // not useful - { name: 'font-weight', type: t.fontWeight }, { name: 'font-size', type: t.size }, { name: 'min-zoomed-font-size', type: t.size }, - - // behaviour - { name: 'events', type: t.bool }, - - // visibility - { name: 'display', type: t.display, triggersZOrder: zd.anyDiff }, { name: 'visibility', type: t.visibility, triggersZOrder: zd.anyDiff }, { name: 'opacity', type: t.zeroOneNumber, triggersZOrder: zd.zeroNonZero }, { name: 'z-compound-depth', type: t.zCompoundDepth, triggersZOrder: zd.anyDiff }, { name: 'z-index-compare', type: t.zIndexCompare, triggersZOrder: zd.anyDiff }, { name: 'z-index', type: t.nonNegativeInt, triggersZOrder: zd.anyDiff }, - - // overlays - { name: 'overlay-padding', type: t.size }, { name: 'overlay-color', type: t.color }, { name: 'overlay-opacity', type: t.zeroOneNumber }, - - // transition anis - { name: 'transition-property', type: t.propList }, { name: 'transition-duration', type: t.time }, { name: 'transition-delay', type: t.time }, { name: 'transition-timing-function', type: t.easing }, - - // node body - { name: 'height', type: t.nodeSize }, { name: 'width', type: t.nodeSize }, { name: 'shape', type: t.nodeShape }, { name: 'shape-polygon-points', type: t.polygonPointList }, { name: 'background-color', type: t.color }, { name: 'background-opacity', type: t.zeroOneNumber }, { name: 'background-blacken', type: t.nOneOneNumber }, { name: 'padding', type: t.sizeMaybePercent }, { name: 'padding-relative-to', type: t.paddingRelativeTo }, - - // node border - { name: 'border-color', type: t.color }, { name: 'border-opacity', type: t.zeroOneNumber }, { name: 'border-width', type: t.size }, { name: 'border-style', type: t.borderStyle }, - - // node background images - { name: 'background-image', type: t.urls }, { name: 'background-image-crossorigin', type: t.bgCrossOrigin }, { name: 'background-image-opacity', type: t.zeroOneNumbers }, { name: 'background-position-x', type: t.bgPos }, { name: 'background-position-y', type: t.bgPos }, { name: 'background-width-relative-to', type: t.bgRelativeTo }, { name: 'background-height-relative-to', type: t.bgRelativeTo }, { name: 'background-repeat', type: t.bgRepeat }, { name: 'background-fit', type: t.bgFit }, { name: 'background-clip', type: t.bgClip }, { name: 'background-width', type: t.bgWH }, { name: 'background-height', type: t.bgWH }, - - // compound props - { name: 'position', type: t.position }, { name: 'compound-sizing-wrt-labels', type: t.compoundIncludeLabels }, { name: 'min-width', type: t.size }, { name: 'min-width-bias-left', type: t.sizeMaybePercent }, { name: 'min-width-bias-right', type: t.sizeMaybePercent }, { name: 'min-height', type: t.size }, { name: 'min-height-bias-top', type: t.sizeMaybePercent }, { name: 'min-height-bias-bottom', type: t.sizeMaybePercent }, - - // edge line - { name: 'line-style', type: t.lineStyle }, { name: 'line-color', type: t.color }, { name: 'curve-style', type: t.curveStyle }, { name: 'haystack-radius', type: t.zeroOneNumber }, { name: 'source-endpoint', type: t.edgeEndpoint }, { name: 'target-endpoint', type: t.edgeEndpoint }, { name: 'control-point-step-size', type: t.size }, { name: 'control-point-distances', type: t.bidirectionalSizes }, { name: 'control-point-weights', type: t.numbers }, { name: 'segment-distances', type: t.bidirectionalSizes }, { name: 'segment-weights', type: t.numbers }, { name: 'edge-distances', type: t.edgeDistances }, { name: 'arrow-scale', type: t.positiveNumber }, { name: 'loop-direction', type: t.angle }, { name: 'loop-sweep', type: t.angle }, { name: 'source-distance-from-node', type: t.size }, { name: 'target-distance-from-node', type: t.size }, - - // ghost properties - { name: 'ghost', type: t.bool }, { name: 'ghost-offset-x', type: t.bidirectionalSize }, { name: 'ghost-offset-y', type: t.bidirectionalSize }, { name: 'ghost-opacity', type: t.zeroOneNumber }, - - // these are just for the core - { name: 'selection-box-color', type: t.color }, { name: 'selection-box-opacity', type: t.zeroOneNumber }, { name: 'selection-box-border-color', type: t.color }, { name: 'selection-box-border-width', type: t.size }, { name: 'active-bg-color', type: t.color }, { name: 'active-bg-opacity', type: t.zeroOneNumber }, { name: 'active-bg-size', type: t.size }, { name: 'outside-texture-bg-color', type: t.color }, { name: 'outside-texture-bg-opacity', type: t.zeroOneNumber }]; - - // define aliases - var aliases = styfn.aliases = [{ name: 'content', pointsTo: 'label' }, { name: 'control-point-distance', pointsTo: 'control-point-distances' }, { name: 'control-point-weight', pointsTo: 'control-point-weights' }, { name: 'edge-text-rotation', pointsTo: 'text-rotation' }, { name: 'padding-left', pointsTo: 'padding' }, { name: 'padding-right', pointsTo: 'padding' }, { name: 'padding-top', pointsTo: 'padding' }, { name: 'padding-bottom', pointsTo: 'padding' }]; - - // pie backgrounds for nodes - styfn.pieBackgroundN = 16; // because the pie properties are numbered, give access to a constant N (for renderer use) - props.push({ name: 'pie-size', type: t.sizeMaybePercent }); - for (var i = 1; i <= styfn.pieBackgroundN; i++) { - props.push({ name: 'pie-' + i + '-background-color', type: t.color }); - props.push({ name: 'pie-' + i + '-background-size', type: t.percent }); - props.push({ name: 'pie-' + i + '-background-opacity', type: t.zeroOneNumber }); - } - - // edge arrows - var arrowPrefixes = styfn.arrowPrefixes = ['source', 'mid-source', 'target', 'mid-target']; - [{ name: 'arrow-shape', type: t.arrowShape }, { name: 'arrow-color', type: t.color }, { name: 'arrow-fill', type: t.arrowFill }].forEach(function (prop) { - arrowPrefixes.forEach(function (prefix) { - var name = prefix + '-' + prop.name; - var type = prop.type; - - props.push({ name: name, type: type }); - }); - }, {}); - - // list of property names - styfn.propertyNames = props.map(function (p) { - return p.name; - }); - - // allow access of properties by name ( e.g. style.properties.height ) - for (var _i = 0; _i < props.length; _i++) { - var prop = props[_i]; - - props[prop.name] = prop; // allow lookup by name - } - - // map aliases - for (var _i2 = 0; _i2 < aliases.length; _i2++) { - var alias = aliases[_i2]; - var pointsToProp = props[alias.pointsTo]; - var aliasProp = { - name: alias.name, - alias: true, - pointsTo: pointsToProp - }; - - // add alias prop for parsing - props.push(aliasProp); - - props[alias.name] = aliasProp; // allow lookup by name - } -})(); - -styfn.getDefaultProperty = function (name) { - return this.getDefaultProperties()[name]; -}; - -styfn.getDefaultProperties = util.memoize(function () { - var rawProps = util.extend({ - // common node/edge props - 'events': 'yes', - 'text-events': 'no', - 'text-valign': 'top', - 'text-halign': 'center', - 'color': '#000', - 'text-outline-color': '#000', - 'text-outline-width': 0, - 'text-outline-opacity': 1, - 'text-opacity': 1, - 'text-decoration': 'none', - 'text-transform': 'none', - 'text-wrap': 'none', - 'text-max-width': 9999, - 'text-background-color': '#000', - 'text-background-opacity': 0, - 'text-background-shape': 'rectangle', - 'text-background-padding': 0, - 'text-border-opacity': 0, - 'text-border-width': 0, - 'text-border-style': 'solid', - 'text-border-color': '#000', - 'font-family': 'Helvetica Neue, Helvetica, sans-serif', - 'font-style': 'normal', - // 'font-letiant': fontletiant, - 'font-weight': 'normal', - 'font-size': 16, - 'min-zoomed-font-size': 0, - 'text-rotation': 'none', - 'source-text-rotation': 'none', - 'target-text-rotation': 'none', - 'visibility': 'visible', - 'display': 'element', - 'opacity': 1, - 'z-compound-depth': 'auto', - 'z-index-compare': 'auto', - 'z-index': 0, - 'label': '', - 'text-margin-x': 0, - 'text-margin-y': 0, - 'source-label': '', - 'source-text-offset': 0, - 'source-text-margin-x': 0, - 'source-text-margin-y': 0, - 'target-label': '', - 'target-text-offset': 0, - 'target-text-margin-x': 0, - 'target-text-margin-y': 0, - 'overlay-opacity': 0, - 'overlay-color': '#000', - 'overlay-padding': 10, - 'transition-property': 'none', - 'transition-duration': 0, - 'transition-delay': 0, - 'transition-timing-function': 'linear', - - // node props - 'background-blacken': 0, - 'background-color': '#999', - 'background-opacity': 1, - 'background-image': 'none', - 'background-image-crossorigin': 'anonymous', - 'background-image-opacity': 1, - 'background-position-x': '50%', - 'background-position-y': '50%', - 'background-width-relative-to': 'include-padding', - 'background-height-relative-to': 'include-padding', - 'background-repeat': 'no-repeat', - 'background-fit': 'none', - 'background-clip': 'node', - 'background-width': 'auto', - 'background-height': 'auto', - 'border-color': '#000', - 'border-opacity': 1, - 'border-width': 0, - 'border-style': 'solid', - 'height': 30, - 'width': 30, - 'shape': 'ellipse', - 'shape-polygon-points': '-1, -1, 1, -1, 1, 1, -1, 1', - - // ghost props - 'ghost': 'no', - 'ghost-offset-y': 0, - 'ghost-offset-x': 0, - 'ghost-opacity': 0, - - // compound props - 'padding': 0, - 'padding-relative-to': 'width', - 'position': 'origin', - 'compound-sizing-wrt-labels': 'include', - 'min-width': 0, - 'min-width-bias-left': 0, - 'min-width-bias-right': 0, - 'min-height': 0, - 'min-height-bias-top': 0, - 'min-height-bias-bottom': 0 - }, { - // node pie bg - 'pie-size': '100%' - }, [{ name: 'pie-{{i}}-background-color', value: 'black' }, { name: 'pie-{{i}}-background-size', value: '0%' }, { name: 'pie-{{i}}-background-opacity', value: 1 }].reduce(function (css, prop) { - for (var i = 1; i <= styfn.pieBackgroundN; i++) { - var name = prop.name.replace('{{i}}', i); - var val = prop.value; - - css[name] = val; - } - - return css; - }, {}), { - // edge props - 'line-style': 'solid', - 'line-color': '#999', - 'control-point-step-size': 40, - 'control-point-weights': 0.5, - 'segment-weights': 0.5, - 'segment-distances': 20, - 'edge-distances': 'intersection', - 'curve-style': 'bezier', - 'haystack-radius': 0, - 'arrow-scale': 1, - 'loop-direction': '-45deg', - 'loop-sweep': '-90deg', - 'source-distance-from-node': 0, - 'target-distance-from-node': 0, - 'source-endpoint': 'outside-to-node', - 'target-endpoint': 'outside-to-node' - }, [{ name: 'arrow-shape', value: 'none' }, { name: 'arrow-color', value: '#999' }, { name: 'arrow-fill', value: 'filled' }].reduce(function (css, prop) { - styfn.arrowPrefixes.forEach(function (prefix) { - var name = prefix + '-' + prop.name; - var val = prop.value; - - css[name] = val; - }); - - return css; - }, {})); - - var parsedProps = {}; - - for (var i = 0; i < this.properties.length; i++) { - var prop = this.properties[i]; - - if (prop.pointsTo) { - continue; - } - - var name = prop.name; - var val = rawProps[name]; - var parsedProp = this.parse(name, val); - - parsedProps[name] = parsedProp; - } - - return parsedProps; -}); - -styfn.addDefaultStylesheet = function () { - this.selector('$node > node') // compound (parent) node properties - .css({ - 'shape': 'rectangle', - 'padding': 10, - 'background-color': '#eee', - 'border-color': '#ccc', - 'border-width': 1 - }).selector('edge') // just edge properties - .css({ - 'width': 3, - 'curve-style': 'haystack' - }).selector(':parent <-> node').css({ - 'curve-style': 'bezier', - 'source-endpoint': 'outside-to-line', - 'target-endpoint': 'outside-to-line' - }).selector(':selected').css({ - 'background-color': '#0169D9', - 'line-color': '#0169D9', - 'source-arrow-color': '#0169D9', - 'target-arrow-color': '#0169D9', - 'mid-source-arrow-color': '#0169D9', - 'mid-target-arrow-color': '#0169D9' - }).selector('node:parent:selected').css({ - 'background-color': '#CCE1F9', - 'border-color': '#aec8e5' - }).selector(':active').css({ - 'overlay-color': 'black', - 'overlay-padding': 10, - 'overlay-opacity': 0.25 - }).selector('core') // just core properties - .css({ - 'selection-box-color': '#ddd', - 'selection-box-opacity': 0.65, - 'selection-box-border-color': '#aaa', - 'selection-box-border-width': 1, - 'active-bg-color': 'black', - 'active-bg-opacity': 0.15, - 'active-bg-size': 30, - 'outside-texture-bg-color': '#000', - 'outside-texture-bg-opacity': 0.125 - }); - - this.defaultLength = this.length; -}; - -module.exports = styfn; - -/***/ }), -/* 92 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var is = __webpack_require__(0); -var math = __webpack_require__(2); - -var styfn = {}; - -// a caching layer for property parsing -styfn.parse = function (name, value, propIsBypass, propIsFlat) { - var self = this; - - // function values can't be cached in all cases, and there isn't much benefit of caching them anyway - if (is.fn(value)) { - return self.parseImplWarn(name, value, propIsBypass, propIsFlat); - } - - var flatKey = propIsFlat === 'mapping' || propIsFlat === true || propIsFlat === false || propIsFlat == null ? 'dontcare' : propIsFlat; - var argHash = [name, value, propIsBypass, flatKey].join('$'); - var propCache = self.propCache = self.propCache || {}; - var ret = void 0; - - if (!(ret = propCache[argHash])) { - ret = propCache[argHash] = self.parseImplWarn(name, value, propIsBypass, propIsFlat); - } - - // - bypasses can't be shared b/c the value can be changed by animations or otherwise overridden - // - mappings can't be shared b/c mappings are per-element - if (propIsBypass || propIsFlat === 'mapping') { - // need a copy since props are mutated later in their lifecycles - ret = util.copy(ret); - - if (ret) { - ret.value = util.copy(ret.value); // because it could be an array, e.g. colour - } - } - - return ret; -}; - -styfn.parseImplWarn = function (name, value, propIsBypass, propIsFlat) { - var prop = this.parseImpl(name, value, propIsBypass, propIsFlat); - - if (!prop && value != null) { - util.error('The style property `%s: %s` is invalid', name, value); - } - - return prop; -}; - -// parse a property; return null on invalid; return parsed property otherwise -// fields : -// - name : the name of the property -// - value : the parsed, native-typed value of the property -// - strValue : a string value that represents the property value in valid css -// - bypass : true iff the property is a bypass property -styfn.parseImpl = function (name, value, propIsBypass, propIsFlat) { - var self = this; - - name = util.camel2dash(name); // make sure the property name is in dash form (e.g. 'property-name' not 'propertyName') - - var property = self.properties[name]; - var passedValue = value; - var types = self.types; - - if (!property) { - return null; - } // return null on property of unknown name - if (value === undefined) { - return null; - } // can't assign undefined - - // the property may be an alias - if (property.alias) { - property = property.pointsTo; - name = property.name; - } - - var valueIsString = is.string(value); - if (valueIsString) { - // trim the value to make parsing easier - value = value.trim(); - } - - var type = property.type; - if (!type) { - return null; - } // no type, no luck - - // check if bypass is null or empty string (i.e. indication to delete bypass property) - if (propIsBypass && (value === '' || value === null)) { - return { - name: name, - value: value, - bypass: true, - deleteBypass: true - }; - } - - // check if value is a function used as a mapper - if (is.fn(value)) { - return { - name: name, - value: value, - strValue: 'fn', - mapped: types.fn, - bypass: propIsBypass - }; - } - - // check if value is mapped - var data = void 0, - mapData = void 0; - if (!valueIsString || propIsFlat) { - // then don't bother to do the expensive regex checks - - } else if (data = new RegExp(types.data.regex).exec(value)) { - if (propIsBypass) { - return false; - } // mappers not allowed in bypass - - var mapped = types.data; - - return { - name: name, - value: data, - strValue: '' + value, - mapped: mapped, - field: data[1], - bypass: propIsBypass - }; - } else if (mapData = new RegExp(types.mapData.regex).exec(value)) { - if (propIsBypass) { - return false; - } // mappers not allowed in bypass - if (type.multiple) { - return false; - } // impossible to map to num - - var _mapped = types.mapData; - - // we can map only if the type is a colour or a number - if (!(type.color || type.number)) { - return false; - } - - var valueMin = this.parse(name, mapData[4]); // parse to validate - if (!valueMin || valueMin.mapped) { - return false; - } // can't be invalid or mapped - - var valueMax = this.parse(name, mapData[5]); // parse to validate - if (!valueMax || valueMax.mapped) { - return false; - } // can't be invalid or mapped - - // check if valueMin and valueMax are the same - if (valueMin.value === valueMax.value) { - return false; // can't make much of a mapper without a range - } else if (type.color) { - var c1 = valueMin.value; - var c2 = valueMax.value; - - var same = c1[0] === c2[0] // red - && c1[1] === c2[1] // green - && c1[2] === c2[2] // blue - && ( // optional alpha - c1[3] === c2[3] // same alpha outright - || (c1[3] == null || c1[3] === 1) && ( // full opacity for colour 1? - c2[3] == null || c2[3] === 1) // full opacity for colour 2? - ); - - if (same) { - return false; - } // can't make a mapper without a range - } - - return { - name: name, - value: mapData, - strValue: '' + value, - mapped: _mapped, - field: mapData[1], - fieldMin: parseFloat(mapData[2]), // min & max are numeric - fieldMax: parseFloat(mapData[3]), - valueMin: valueMin.value, - valueMax: valueMax.value, - bypass: propIsBypass - }; - } - - if (type.multiple && propIsFlat !== 'multiple') { - var vals = void 0; - - if (valueIsString) { - vals = value.split(/\s+/); - } else if (is.array(value)) { - vals = value; - } else { - vals = [value]; - } - - if (type.evenMultiple && vals.length % 2 !== 0) { - return null; - } - - var valArr = []; - var unitsArr = []; - var pfValArr = []; - var hasEnum = false; - - for (var i = 0; i < vals.length; i++) { - var p = self.parse(name, vals[i], propIsBypass, 'multiple'); - - hasEnum = hasEnum || is.string(p.value); - - valArr.push(p.value); - pfValArr.push(p.pfValue != null ? p.pfValue : p.value); - unitsArr.push(p.units); - } - - if (type.validate && !type.validate(valArr, unitsArr)) { - return null; - } - - if (type.singleEnum && hasEnum) { - if (valArr.length === 1 && is.string(valArr[0])) { - return { - name: name, - value: valArr[0], - strValue: valArr[0], - bypass: propIsBypass - }; - } else { - return null; - } - } - - return { - name: name, - value: valArr, - pfValue: pfValArr, - strValue: valArr.map(function (val, i) { - return val + (unitsArr[i] || ''); - }).join(' '), - bypass: propIsBypass, - units: unitsArr - }; - } - - // several types also allow enums - var checkEnums = function checkEnums() { - for (var _i = 0; _i < type.enums.length; _i++) { - var en = type.enums[_i]; - - if (en === value) { - return { - name: name, - value: value, - strValue: '' + value, - bypass: propIsBypass - }; - } - } - - return null; - }; - - // check the type and return the appropriate object - if (type.number) { - var units = void 0; - var implicitUnits = 'px'; // not set => px - - if (type.units) { - // use specified units if set - units = type.units; - } - - if (type.implicitUnits) { - implicitUnits = type.implicitUnits; - } - - if (!type.unitless) { - if (valueIsString) { - var unitsRegex = 'px|em' + (type.allowPercent ? '|\\%' : ''); - if (units) { - unitsRegex = units; - } // only allow explicit units if so set - var match = value.match('^(' + util.regex.number + ')(' + unitsRegex + ')?' + '$'); - - if (match) { - value = match[1]; - units = match[2] || implicitUnits; - } - } else if (!units || type.implicitUnits) { - units = implicitUnits; // implicitly px if unspecified - } - } - - value = parseFloat(value); - - // if not a number and enums not allowed, then the value is invalid - if (isNaN(value) && type.enums === undefined) { - return null; - } - - // check if this number type also accepts special keywords in place of numbers - // (i.e. `left`, `auto`, etc) - if (isNaN(value) && type.enums !== undefined) { - value = passedValue; - - return checkEnums(); - } - - // check if value must be an integer - if (type.integer && !is.integer(value)) { - return null; - } - - // check value is within range - if (type.min !== undefined && (value < type.min || type.strictMin && value === type.min) || type.max !== undefined && (value > type.max || type.strictMax && value === type.max)) { - return null; - } - - var ret = { - name: name, - value: value, - strValue: '' + value + (units ? units : ''), - units: units, - bypass: propIsBypass - }; - - // normalise value in pixels - if (type.unitless || units !== 'px' && units !== 'em') { - ret.pfValue = value; - } else { - ret.pfValue = units === 'px' || !units ? value : this.getEmSizeInPixels() * value; - } - - // normalise value in ms - if (units === 'ms' || units === 's') { - ret.pfValue = units === 'ms' ? value : 1000 * value; - } - - // normalise value in rad - if (units === 'deg' || units === 'rad') { - ret.pfValue = units === 'rad' ? value : math.deg2rad(value); - } - - // normalize value in % - if (units === '%') { - ret.pfValue = value / 100; - } - - return ret; - } else if (type.propList) { - - var props = []; - var propsStr = '' + value; - - if (propsStr === 'none') { - // leave empty - - } else { - // go over each prop - - var propsSplit = propsStr.split(','); - for (var _i2 = 0; _i2 < propsSplit.length; _i2++) { - var propName = propsSplit[_i2].trim(); - - if (self.properties[propName]) { - props.push(propName); - } - } - - if (props.length === 0) { - return null; - } - } - - return { - name: name, - value: props, - strValue: props.length === 0 ? 'none' : props.join(', '), - bypass: propIsBypass - }; - } else if (type.color) { - var tuple = util.color2tuple(value); - - if (!tuple) { - return null; - } - - return { - name: name, - value: tuple, - pfValue: tuple, - strValue: '' + value, - bypass: propIsBypass - }; - } else if (type.regex || type.regexes) { - - // first check enums - if (type.enums) { - var enumProp = checkEnums(); - - if (enumProp) { - return enumProp; - } - } - - var regexes = type.regexes ? type.regexes : [type.regex]; - - for (var _i3 = 0; _i3 < regexes.length; _i3++) { - var regex = new RegExp(regexes[_i3]); // make a regex from the type string - var m = regex.exec(value); - - if (m) { - // regex matches - return { - name: name, - value: type.singleRegexMatchValue ? m[1] : m, - strValue: '' + value, - bypass: propIsBypass - }; - } - } - - return null; // didn't match any - } else if (type.string) { - // just return - return { - name: name, - value: '' + value, - strValue: '' + value, - bypass: propIsBypass - }; - } else if (type.enums) { - // check enums last because it's a combo type in others - return checkEnums(); - } else { - return null; // not a type we can handle - } -}; - -module.exports = styfn; - -/***/ }), -/* 93 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var window = __webpack_require__(3); -var math = __webpack_require__(2); - -var corefn = { - - autolock: function autolock(bool) { - if (bool !== undefined) { - this._private.autolock = bool ? true : false; - } else { - return this._private.autolock; - } - - return this; // chaining - }, - - autoungrabify: function autoungrabify(bool) { - if (bool !== undefined) { - this._private.autoungrabify = bool ? true : false; - } else { - return this._private.autoungrabify; - } - - return this; // chaining - }, - - autounselectify: function autounselectify(bool) { - if (bool !== undefined) { - this._private.autounselectify = bool ? true : false; - } else { - return this._private.autounselectify; - } - - return this; // chaining - }, - - panningEnabled: function panningEnabled(bool) { - if (bool !== undefined) { - this._private.panningEnabled = bool ? true : false; - } else { - return this._private.panningEnabled; - } - - return this; // chaining - }, - - userPanningEnabled: function userPanningEnabled(bool) { - if (bool !== undefined) { - this._private.userPanningEnabled = bool ? true : false; - } else { - return this._private.userPanningEnabled; - } - - return this; // chaining - }, - - zoomingEnabled: function zoomingEnabled(bool) { - if (bool !== undefined) { - this._private.zoomingEnabled = bool ? true : false; - } else { - return this._private.zoomingEnabled; - } - - return this; // chaining - }, - - userZoomingEnabled: function userZoomingEnabled(bool) { - if (bool !== undefined) { - this._private.userZoomingEnabled = bool ? true : false; - } else { - return this._private.userZoomingEnabled; - } - - return this; // chaining - }, - - boxSelectionEnabled: function boxSelectionEnabled(bool) { - if (bool !== undefined) { - this._private.boxSelectionEnabled = bool ? true : false; - } else { - return this._private.boxSelectionEnabled; - } - - return this; // chaining - }, - - pan: function pan() { - var args = arguments; - var pan = this._private.pan; - var dim = void 0, - val = void 0, - dims = void 0, - x = void 0, - y = void 0; - - switch (args.length) { - case 0: - // .pan() - return pan; - - case 1: - - if (is.string(args[0])) { - // .pan('x') - dim = args[0]; - return pan[dim]; - } else if (is.plainObject(args[0])) { - // .pan({ x: 0, y: 100 }) - if (!this._private.panningEnabled) { - return this; - } - - dims = args[0]; - x = dims.x; - y = dims.y; - - if (is.number(x)) { - pan.x = x; - } - - if (is.number(y)) { - pan.y = y; - } - - this.emit('pan viewport'); - } - break; - - case 2: - // .pan('x', 100) - if (!this._private.panningEnabled) { - return this; - } - - dim = args[0]; - val = args[1]; - - if ((dim === 'x' || dim === 'y') && is.number(val)) { - pan[dim] = val; - } - - this.emit('pan viewport'); - break; - - default: - break; // invalid - } - - this.notify({ // notify the renderer that the viewport changed - type: 'viewport' - }); - - return this; // chaining - }, - - panBy: function panBy(arg0, arg1) { - var args = arguments; - var pan = this._private.pan; - var dim = void 0, - val = void 0, - dims = void 0, - x = void 0, - y = void 0; - - if (!this._private.panningEnabled) { - return this; - } - - switch (args.length) { - case 1: - - if (is.plainObject(arg0)) { - // .panBy({ x: 0, y: 100 }) - dims = args[0]; - x = dims.x; - y = dims.y; - - if (is.number(x)) { - pan.x += x; - } - - if (is.number(y)) { - pan.y += y; - } - - this.emit('pan viewport'); - } - break; - - case 2: - // .panBy('x', 100) - dim = arg0; - val = arg1; - - if ((dim === 'x' || dim === 'y') && is.number(val)) { - pan[dim] += val; - } - - this.emit('pan viewport'); - break; - - default: - break; // invalid - } - - this.notify({ // notify the renderer that the viewport changed - type: 'viewport' - }); - - return this; // chaining - }, - - fit: function fit(elements, padding) { - var viewportState = this.getFitViewport(elements, padding); - - if (viewportState) { - var _p = this._private; - _p.zoom = viewportState.zoom; - _p.pan = viewportState.pan; - - this.emit('pan zoom viewport'); - - this.notify({ // notify the renderer that the viewport changed - type: 'viewport' - }); - } - - return this; // chaining - }, - - getFitViewport: function getFitViewport(elements, padding) { - if (is.number(elements) && padding === undefined) { - // elements is optional - padding = elements; - elements = undefined; - } - - if (!this._private.panningEnabled || !this._private.zoomingEnabled) { - return; - } - - var bb = void 0; - - if (is.string(elements)) { - var sel = elements; - elements = this.$(sel); - } else if (is.boundingBox(elements)) { - // assume bb - var bbe = elements; - bb = { - x1: bbe.x1, - y1: bbe.y1, - x2: bbe.x2, - y2: bbe.y2 - }; - - bb.w = bb.x2 - bb.x1; - bb.h = bb.y2 - bb.y1; - } else if (!is.elementOrCollection(elements)) { - elements = this.mutableElements(); - } - - if (is.elementOrCollection(elements) && elements.empty()) { - return; - } // can't fit to nothing - - bb = bb || elements.boundingBox(); - - var w = this.width(); - var h = this.height(); - var zoom = void 0; - padding = is.number(padding) ? padding : 0; - - if (!isNaN(w) && !isNaN(h) && w > 0 && h > 0 && !isNaN(bb.w) && !isNaN(bb.h) && bb.w > 0 && bb.h > 0) { - zoom = Math.min((w - 2 * padding) / bb.w, (h - 2 * padding) / bb.h); - - // crop zoom - zoom = zoom > this._private.maxZoom ? this._private.maxZoom : zoom; - zoom = zoom < this._private.minZoom ? this._private.minZoom : zoom; - - var pan = { // now pan to middle - x: (w - zoom * (bb.x1 + bb.x2)) / 2, - y: (h - zoom * (bb.y1 + bb.y2)) / 2 - }; - - return { - zoom: zoom, - pan: pan - }; - } - - return; - }, - - minZoom: function minZoom(zoom) { - if (zoom === undefined) { - return this._private.minZoom; - } else if (is.number(zoom)) { - this._private.minZoom = zoom; - } - - return this; - }, - - maxZoom: function maxZoom(zoom) { - if (zoom === undefined) { - return this._private.maxZoom; - } else if (is.number(zoom)) { - this._private.maxZoom = zoom; - } - - return this; - }, - - getZoomedViewport: function getZoomedViewport(params) { - var _p = this._private; - var currentPan = _p.pan; - var currentZoom = _p.zoom; - var pos = void 0; // in rendered px - var zoom = void 0; - var bail = false; - - if (!_p.zoomingEnabled) { - // zooming disabled - bail = true; - } - - if (is.number(params)) { - // then set the zoom - zoom = params; - } else if (is.plainObject(params)) { - // then zoom about a point - zoom = params.level; - - if (params.position != null) { - pos = math.modelToRenderedPosition(params.position, currentZoom, currentPan); - } else if (params.renderedPosition != null) { - pos = params.renderedPosition; - } - - if (pos != null && !_p.panningEnabled) { - // panning disabled - bail = true; - } - } - - // crop zoom - zoom = zoom > _p.maxZoom ? _p.maxZoom : zoom; - zoom = zoom < _p.minZoom ? _p.minZoom : zoom; - - // can't zoom with invalid params - if (bail || !is.number(zoom) || zoom === currentZoom || pos != null && (!is.number(pos.x) || !is.number(pos.y))) { - return null; - } - - if (pos != null) { - // set zoom about position - var pan1 = currentPan; - var zoom1 = currentZoom; - var zoom2 = zoom; - - var pan2 = { - x: -zoom2 / zoom1 * (pos.x - pan1.x) + pos.x, - y: -zoom2 / zoom1 * (pos.y - pan1.y) + pos.y - }; - - return { - zoomed: true, - panned: true, - zoom: zoom2, - pan: pan2 - }; - } else { - // just set the zoom - return { - zoomed: true, - panned: false, - zoom: zoom, - pan: currentPan - }; - } - }, - - zoom: function zoom(params) { - if (params === undefined) { - // get - return this._private.zoom; - } else { - // set - var vp = this.getZoomedViewport(params); - var _p = this._private; - - if (vp == null || !vp.zoomed) { - return this; - } - - _p.zoom = vp.zoom; - - if (vp.panned) { - _p.pan.x = vp.pan.x; - _p.pan.y = vp.pan.y; - } - - this.emit('zoom' + (vp.panned ? ' pan' : '') + ' viewport'); - - this.notify({ // notify the renderer that the viewport changed - type: 'viewport' - }); - - return this; // chaining - } - }, - - viewport: function viewport(opts) { - var _p = this._private; - var zoomDefd = true; - var panDefd = true; - var events = []; // to trigger - var zoomFailed = false; - var panFailed = false; - - if (!opts) { - return this; - } - if (!is.number(opts.zoom)) { - zoomDefd = false; - } - if (!is.plainObject(opts.pan)) { - panDefd = false; - } - if (!zoomDefd && !panDefd) { - return this; - } - - if (zoomDefd) { - var z = opts.zoom; - - if (z < _p.minZoom || z > _p.maxZoom || !_p.zoomingEnabled) { - zoomFailed = true; - } else { - _p.zoom = z; - - events.push('zoom'); - } - } - - if (panDefd && (!zoomFailed || !opts.cancelOnFailedZoom) && _p.panningEnabled) { - var p = opts.pan; - - if (is.number(p.x)) { - _p.pan.x = p.x; - panFailed = false; - } - - if (is.number(p.y)) { - _p.pan.y = p.y; - panFailed = false; - } - - if (!panFailed) { - events.push('pan'); - } - } - - if (events.length > 0) { - events.push('viewport'); - this.emit(events.join(' ')); - - this.notify({ - type: 'viewport' - }); - } - - return this; // chaining - }, - - center: function center(elements) { - var pan = this.getCenterPan(elements); - - if (pan) { - this._private.pan = pan; - - this.emit('pan viewport'); - - this.notify({ // notify the renderer that the viewport changed - type: 'viewport' - }); - } - - return this; // chaining - }, - - getCenterPan: function getCenterPan(elements, zoom) { - if (!this._private.panningEnabled) { - return; - } - - if (is.string(elements)) { - var selector = elements; - elements = this.mutableElements().filter(selector); - } else if (!is.elementOrCollection(elements)) { - elements = this.mutableElements(); - } - - if (elements.length === 0) { - return; - } // can't centre pan to nothing - - var bb = elements.boundingBox(); - var w = this.width(); - var h = this.height(); - zoom = zoom === undefined ? this._private.zoom : zoom; - - var pan = { // middle - x: (w - zoom * (bb.x1 + bb.x2)) / 2, - y: (h - zoom * (bb.y1 + bb.y2)) / 2 - }; - - return pan; - }, - - reset: function reset() { - if (!this._private.panningEnabled || !this._private.zoomingEnabled) { - return this; - } - - this.viewport({ - pan: { x: 0, y: 0 }, - zoom: 1 - }); - - return this; // chaining - }, - - invalidateSize: function invalidateSize() { - this._private.sizeCache = null; - }, - - size: function size() { - var _p = this._private; - var container = _p.container; - - return _p.sizeCache = _p.sizeCache || (container ? function () { - var style = window.getComputedStyle(container); - var val = function val(name) { - return parseFloat(style.getPropertyValue(name)); - }; - - return { - width: container.clientWidth - val('padding-left') - val('padding-right'), - height: container.clientHeight - val('padding-top') - val('padding-bottom') - }; - }() : { // fallback if no container (not 0 b/c can be used for dividing etc) - width: 1, - height: 1 - }); - }, - - width: function width() { - return this.size().width; - }, - - height: function height() { - return this.size().height; - }, - - extent: function extent() { - var pan = this._private.pan; - var zoom = this._private.zoom; - var rb = this.renderedExtent(); - - var b = { - x1: (rb.x1 - pan.x) / zoom, - x2: (rb.x2 - pan.x) / zoom, - y1: (rb.y1 - pan.y) / zoom, - y2: (rb.y2 - pan.y) / zoom - }; - - b.w = b.x2 - b.x1; - b.h = b.y2 - b.y1; - - return b; - }, - - renderedExtent: function renderedExtent() { - var width = this.width(); - var height = this.height(); - - return { - x1: 0, - y1: 0, - x2: width, - y2: height, - w: width, - h: height - }; - } -}; - -// aliases -corefn.centre = corefn.center; - -// backwards compatibility -corefn.autolockNodes = corefn.autolock; -corefn.autoungrabifyNodes = corefn.autoungrabify; - -module.exports = corefn; - -/***/ }), -/* 94 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var define = __webpack_require__(4); -var Collection = __webpack_require__(7); -var Core = __webpack_require__(12); -var incExts = __webpack_require__(95); -var is = __webpack_require__(0); -var Emitter = __webpack_require__(11); - -// registered extensions to cytoscape, indexed by name -var extensions = {}; - -// registered modules for extensions, indexed by name -var modules = {}; - -function setExtension(type, name, registrant) { - - var ext = registrant; - - var overrideErr = function overrideErr(field) { - util.error('Can not register `' + name + '` for `' + type + '` since `' + field + '` already exists in the prototype and can not be overridden'); - }; - - if (type === 'core') { - if (Core.prototype[name]) { - return overrideErr(name); - } else { - Core.prototype[name] = registrant; - } - } else if (type === 'collection') { - if (Collection.prototype[name]) { - return overrideErr(name); - } else { - Collection.prototype[name] = registrant; - } - } else if (type === 'layout') { - // fill in missing layout functions in the prototype - - var Layout = function Layout(options) { - this.options = options; - - registrant.call(this, options); - - // make sure layout has _private for use w/ std apis like .on() - if (!is.plainObject(this._private)) { - this._private = {}; - } - - this._private.cy = options.cy; - this._private.listeners = []; - - this.createEmitter(); - }; - - var layoutProto = Layout.prototype = Object.create(registrant.prototype); - - var optLayoutFns = []; - - for (var i = 0; i < optLayoutFns.length; i++) { - var fnName = optLayoutFns[i]; - - layoutProto[fnName] = layoutProto[fnName] || function () { - return this; - }; - } - - // either .start() or .run() is defined, so autogen the other - if (layoutProto.start && !layoutProto.run) { - layoutProto.run = function () { - this.start();return this; - }; - } else if (!layoutProto.start && layoutProto.run) { - layoutProto.start = function () { - this.run();return this; - }; - } - - var regStop = registrant.prototype.stop; - layoutProto.stop = function () { - var opts = this.options; - - if (opts && opts.animate) { - var anis = this.animations; - - if (anis) { - for (var _i = 0; _i < anis.length; _i++) { - anis[_i].stop(); - } - } - } - - if (regStop) { - regStop.call(this); - } else { - this.emit('layoutstop'); - } - - return this; - }; - - if (!layoutProto.destroy) { - layoutProto.destroy = function () { - return this; - }; - } - - layoutProto.cy = function () { - return this._private.cy; - }; - - var getCy = function getCy(layout) { - return layout._private.cy; - }; - - util.assign(layoutProto, { - createEmitter: function createEmitter() { - this._private.emitter = new Emitter({ - eventFields: function eventFields(layout) { - return { - layout: layout, - cy: getCy(layout), - target: layout - }; - }, - bubble: function bubble() { - return true; - }, - parent: function parent(layout) { - return getCy(layout); - }, - context: this - }); - - return this; - }, - emitter: function emitter() { - return this._private.emitter; - }, - on: function on(evt, cb) { - this.emitter().on(evt, cb);return this; - }, - one: function one(evt, cb) { - this.emitter().one(evt, cb);return this; - }, - once: function once(evt, cb) { - this.emitter().one(evt, cb);return this; - }, - removeListener: function removeListener(evt, cb) { - this.emitter().removeListener(evt, cb);return this; - }, - emit: function emit(evt, params) { - this.emitter().emit(evt, params);return this; - } - }); - - define.eventAliasesOn(layoutProto); - - ext = Layout; // replace with our wrapped layout - } else if (type === 'renderer' && name !== 'null' && name !== 'base') { - // user registered renderers inherit from base - - var BaseRenderer = getExtension('renderer', 'base'); - var bProto = BaseRenderer.prototype; - var RegistrantRenderer = registrant; - var rProto = registrant.prototype; - - var Renderer = function Renderer() { - BaseRenderer.apply(this, arguments); - RegistrantRenderer.apply(this, arguments); - }; - - var proto = Renderer.prototype; - - for (var pName in bProto) { - var pVal = bProto[pName]; - var existsInR = rProto[pName] != null; - - if (existsInR) { - return overrideErr(pName); - } - - proto[pName] = pVal; // take impl from base - } - - for (var _pName in rProto) { - proto[_pName] = rProto[_pName]; // take impl from registrant - } - - bProto.clientFunctions.forEach(function (name) { - proto[name] = proto[name] || function () { - util.error('Renderer does not implement `renderer.' + name + '()` on its prototype'); - }; - }); - - ext = Renderer; - } - - return util.setMap({ - map: extensions, - keys: [type, name], - value: ext - }); -} - -function getExtension(type, name) { - return util.getMap({ - map: extensions, - keys: [type, name] - }); -} - -function setModule(type, name, moduleType, moduleName, registrant) { - return util.setMap({ - map: modules, - keys: [type, name, moduleType, moduleName], - value: registrant - }); -} - -function getModule(type, name, moduleType, moduleName) { - return util.getMap({ - map: modules, - keys: [type, name, moduleType, moduleName] - }); -} - -var extension = function extension() { - // e.g. extension('renderer', 'svg') - if (arguments.length === 2) { - return getExtension.apply(null, arguments); - } - - // e.g. extension('renderer', 'svg', { ... }) - else if (arguments.length === 3) { - return setExtension.apply(null, arguments); - } - - // e.g. extension('renderer', 'svg', 'nodeShape', 'ellipse') - else if (arguments.length === 4) { - return getModule.apply(null, arguments); - } - - // e.g. extension('renderer', 'svg', 'nodeShape', 'ellipse', { ... }) - else if (arguments.length === 5) { - return setModule.apply(null, arguments); - } else { - util.error('Invalid extension access syntax'); - } -}; - -// allows a core instance to access extensions internally -Core.prototype.extension = extension; - -// included extensions -incExts.forEach(function (group) { - group.extensions.forEach(function (ext) { - setExtension(group.type, ext.name, ext.impl); - }); -}); - -module.exports = extension; - -/***/ }), -/* 95 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = [{ - type: 'layout', - extensions: __webpack_require__(96) -}, { - type: 'renderer', - extensions: __webpack_require__(105) -}]; - -/***/ }), -/* 96 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = [{ name: 'breadthfirst', impl: __webpack_require__(97) }, { name: 'circle', impl: __webpack_require__(98) }, { name: 'concentric', impl: __webpack_require__(99) }, { name: 'cose', impl: __webpack_require__(100) }, { name: 'grid', impl: __webpack_require__(101) }, { name: 'null', impl: __webpack_require__(102) }, { name: 'preset', impl: __webpack_require__(103) }, { name: 'random', impl: __webpack_require__(104) }]; - -/***/ }), -/* 97 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var math = __webpack_require__(2); -var is = __webpack_require__(0); - -var defaults = { - fit: true, // whether to fit the viewport to the graph - directed: false, // whether the tree is directed downwards (or edges can point in any direction if false) - padding: 30, // padding on fit - circle: false, // put depths in concentric circles if true, put depths top down if false - spacingFactor: 1.75, // positive spacing factor, larger => more space between nodes (N.B. n/a if causes overlap) - boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space - nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm - roots: undefined, // the roots of the trees - maximalAdjustments: 0, // how many times to try to position the nodes in a maximal way (i.e. no backtracking) - animate: false, // whether to transition the node positions - animationDuration: 500, // duration of animation in ms if enabled - animationEasing: undefined, // easing of animation if enabled, - animateFilter: function animateFilter(node, i) { - return true; - }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts - ready: undefined, // callback on layoutready - stop: undefined, // callback on layoutstop - transform: function transform(node, position) { - return position; - } // transform a given node position. Useful for changing flow direction in discrete layouts -}; - -function BreadthFirstLayout(options) { - this.options = util.extend({}, defaults, options); -} - -BreadthFirstLayout.prototype.run = function () { - var params = this.options; - var options = params; - - var cy = params.cy; - var eles = options.eles; - var nodes = eles.nodes().not(':parent'); - var graph = eles; - - var bb = math.makeBoundingBox(options.boundingBox ? options.boundingBox : { - x1: 0, y1: 0, w: cy.width(), h: cy.height() - }); - - var roots = void 0; - if (is.elementOrCollection(options.roots)) { - roots = options.roots; - } else if (is.array(options.roots)) { - var rootsArray = []; - - for (var i = 0; i < options.roots.length; i++) { - var id = options.roots[i]; - var ele = cy.getElementById(id); - rootsArray.push(ele); - } - - roots = cy.collection(rootsArray); - } else if (is.string(options.roots)) { - roots = cy.$(options.roots); - } else { - if (options.directed) { - roots = nodes.roots(); - } else { - var components = []; - var unhandledNodes = nodes; - - var _loop = function _loop() { - var currComp = cy.collection(); - - eles.bfs({ - roots: unhandledNodes[0], - visit: function visit(node, edge, pNode, i, depth) { - currComp = currComp.add(node); - }, - directed: false - }); - - unhandledNodes = unhandledNodes.not(currComp); - components.push(currComp); - }; - - while (unhandledNodes.length > 0) { - _loop(); - } - - roots = cy.collection(); - - var _loop2 = function _loop2(_i) { - var comp = components[_i]; - var maxDegree = comp.maxDegree(false); - var compRoots = comp.filter(function (ele) { - return ele.degree(false) === maxDegree; - }); - - roots = roots.add(compRoots); - }; - - for (var _i = 0; _i < components.length; _i++) { - _loop2(_i); - } - } - } - - var depths = []; - var foundByBfs = {}; - var id2depth = {}; - var prevNode = {}; - var prevEdge = {}; - var successors = {}; - - // find the depths of the nodes - graph.bfs({ - roots: roots, - directed: options.directed, - visit: function visit(node, edge, pNode, i, depth) { - var ele = node[0]; - var id = ele.id(); - - if (!depths[depth]) { - depths[depth] = []; - } - - depths[depth].push(ele); - foundByBfs[id] = true; - id2depth[id] = depth; - prevNode[id] = pNode; - prevEdge[id] = edge; - - if (pNode) { - var prevId = pNode.id(); - var succ = successors[prevId] = successors[prevId] || []; - - succ.push(node); - } - } - }); - - // check for nodes not found by bfs - var orphanNodes = []; - for (var _i2 = 0; _i2 < nodes.length; _i2++) { - var _ele = nodes[_i2]; - - if (foundByBfs[_ele.id()]) { - continue; - } else { - orphanNodes.push(_ele); - } - } - - // assign orphan nodes a depth from their neighborhood - var maxChecks = orphanNodes.length * 3; - var checks = 0; - while (orphanNodes.length !== 0 && checks < maxChecks) { - var node = orphanNodes.shift(); - var neighbors = node.neighborhood().nodes(); - var assignedDepth = false; - - for (var _i3 = 0; _i3 < neighbors.length; _i3++) { - var depth = id2depth[neighbors[_i3].id()]; - - if (depth !== undefined) { - depths[depth].push(node); - assignedDepth = true; - break; - } - } - - if (!assignedDepth) { - orphanNodes.push(node); - } - - checks++; - } - - // assign orphan nodes that are still left to the depth of their subgraph - while (orphanNodes.length !== 0) { - var _node = orphanNodes.shift(); - //let subgraph = graph.bfs( node ).path; - var _assignedDepth = false; - - // for( let i = 0; i < subgraph.length; i++ ){ - // let depth = id2depth[ subgraph[i].id() ]; - - // if( depth !== undefined ){ - // depths[depth].push( node ); - // assignedDepth = true; - // break; - // } - // } - - if (!_assignedDepth) { - // worst case if the graph really isn't tree friendly, then just dump it in 0 - if (depths.length === 0) { - depths.push([]); - } - - depths[0].push(_node); - } - } - - // assign the nodes a depth and index - var assignDepthsToEles = function assignDepthsToEles() { - for (var _i4 = 0; _i4 < depths.length; _i4++) { - var _eles = depths[_i4]; - - for (var j = 0; j < _eles.length; j++) { - var _ele2 = _eles[j]; - - if (_ele2 == null) { - _eles.splice(j, 1); - j--; - continue; - } - - _ele2._private.scratch.breadthfirst = { - depth: _i4, - index: j - }; - } - } - }; - assignDepthsToEles(); - - var intersectsDepth = function intersectsDepth(node) { - // returns true if has edges pointing in from a higher depth - var edges = node.connectedEdges(function (ele) { - return ele.data('target') === node.id(); - }); - var thisInfo = node._private.scratch.breadthfirst; - var highestDepthOfOther = 0; - var highestOther = void 0; - for (var _i5 = 0; _i5 < edges.length; _i5++) { - var edge = edges[_i5]; - var otherNode = edge.source()[0]; - var otherInfo = otherNode._private.scratch.breadthfirst; - - if (thisInfo.depth <= otherInfo.depth && highestDepthOfOther < otherInfo.depth) { - highestDepthOfOther = otherInfo.depth; - highestOther = otherNode; - } - } - - return highestOther; - }; - - // make maximal if so set by adjusting depths - for (var adj = 0; adj < options.maximalAdjustments; adj++) { - - var nDepths = depths.length; - var elesToMove = []; - for (var _i6 = 0; _i6 < nDepths; _i6++) { - var _depth = depths[_i6]; - - var nDepth = _depth.length; - for (var j = 0; j < nDepth; j++) { - var _ele3 = _depth[j]; - var info = _ele3._private.scratch.breadthfirst; - var intEle = intersectsDepth(_ele3); - - if (intEle) { - info.intEle = intEle; - elesToMove.push(_ele3); - } - } - } - - for (var _i7 = 0; _i7 < elesToMove.length; _i7++) { - var _ele4 = elesToMove[_i7]; - var _info = _ele4._private.scratch.breadthfirst; - var _intEle = _info.intEle; - var intInfo = _intEle._private.scratch.breadthfirst; - - depths[_info.depth][_info.index] = null; // remove from old depth & index (create hole to be cleaned) - - // add to end of new depth - var newDepth = intInfo.depth + 1; - while (newDepth > depths.length - 1) { - depths.push([]); - } - depths[newDepth].push(_ele4); - - _info.depth = newDepth; - _info.index = depths[newDepth].length - 1; - } - - assignDepthsToEles(); - } - - // find min distance we need to leave between nodes - var minDistance = 0; - if (options.avoidOverlap) { - for (var _i8 = 0; _i8 < nodes.length; _i8++) { - var n = nodes[_i8]; - var nbb = n.layoutDimensions(options); - var w = nbb.w; - var h = nbb.h; - - minDistance = Math.max(minDistance, w, h); - } - } - - // get the weighted percent for an element based on its connectivity to other levels - var cachedWeightedPercent = {}; - var getWeightedPercent = function getWeightedPercent(ele) { - if (cachedWeightedPercent[ele.id()]) { - return cachedWeightedPercent[ele.id()]; - } - - var eleDepth = ele._private.scratch.breadthfirst.depth; - var neighbors = ele.neighborhood().nodes().not(':parent').intersection(nodes); - var percent = 0; - var samples = 0; - - for (var _i9 = 0; _i9 < neighbors.length; _i9++) { - var neighbor = neighbors[_i9]; - var bf = neighbor._private.scratch.breadthfirst; - var index = bf.index; - var _depth2 = bf.depth; - var _nDepth = depths[_depth2].length; - - if (eleDepth > _depth2 || eleDepth === 0) { - // only get influenced by elements above - percent += index / _nDepth; - samples++; - } - } - - samples = Math.max(1, samples); - percent = percent / samples; - - if (samples === 0) { - // so lone nodes have a "don't care" state in sorting - percent = undefined; - } - - cachedWeightedPercent[ele.id()] = percent; - return percent; - }; - - // rearrange the indices in each depth level based on connectivity - - var sortFn = function sortFn(a, b) { - var apct = getWeightedPercent(a); - var bpct = getWeightedPercent(b); - - return apct - bpct; - }; - - for (var times = 0; times < 3; times++) { - // do it a few times b/c the depths are dynamic and we want a more stable result - - for (var _i10 = 0; _i10 < depths.length; _i10++) { - depths[_i10] = depths[_i10].sort(sortFn); - } - assignDepthsToEles(); // and update - } - - var biggestDepthSize = 0; - for (var _i11 = 0; _i11 < depths.length; _i11++) { - biggestDepthSize = Math.max(depths[_i11].length, biggestDepthSize); - } - - var center = { - x: bb.x1 + bb.w / 2, - y: bb.x1 + bb.h / 2 - }; - - var getPosition = function getPosition(ele, isBottomDepth) { - var info = ele._private.scratch.breadthfirst; - var depth = info.depth; - var index = info.index; - var depthSize = depths[depth].length; - - var distanceX = Math.max(bb.w / (depthSize + 1), minDistance); - var distanceY = Math.max(bb.h / (depths.length + 1), minDistance); - var radiusStepSize = Math.min(bb.w / 2 / depths.length, bb.h / 2 / depths.length); - radiusStepSize = Math.max(radiusStepSize, minDistance); - - if (!options.circle) { - - var epos = { - x: center.x + (index + 1 - (depthSize + 1) / 2) * distanceX, - y: (depth + 1) * distanceY - }; - - if (isBottomDepth) { - return epos; - } - - // let succs = successors[ ele.id() ]; - // if( succs ){ - // epos.x = 0; - // - // for( let i = 0 ; i < succs.length; i++ ){ - // let spos = pos[ succs[i].id() ]; - // - // epos.x += spos.x; - // } - // - // epos.x /= succs.length; - // } else { - // //debugger; - // } - - return epos; - } else { - if (options.circle) { - var radius = radiusStepSize * depth + radiusStepSize - (depths.length > 0 && depths[0].length <= 3 ? radiusStepSize / 2 : 0); - var theta = 2 * Math.PI / depths[depth].length * index; - - if (depth === 0 && depths[0].length === 1) { - radius = 1; - } - - return { - x: center.x + radius * Math.cos(theta), - y: center.y + radius * Math.sin(theta) - }; - } else { - return { - x: center.x + (index + 1 - (depthSize + 1) / 2) * distanceX, - y: (depth + 1) * distanceY - }; - } - } - }; - - // get positions in reverse depth order - var pos = {}; - for (var _i12 = depths.length - 1; _i12 >= 0; _i12--) { - var _depth3 = depths[_i12]; - - for (var _j = 0; _j < _depth3.length; _j++) { - var _node2 = _depth3[_j]; - - pos[_node2.id()] = getPosition(_node2, _i12 === depths.length - 1); - } - } - - nodes.layoutPositions(this, options, function (node) { - return pos[node.id()]; - }); - - return this; // chaining -}; - -module.exports = BreadthFirstLayout; - -/***/ }), -/* 98 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var math = __webpack_require__(2); -var is = __webpack_require__(0); - -var defaults = { - fit: true, // whether to fit the viewport to the graph - padding: 30, // the padding on fit - boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - avoidOverlap: true, // prevents node overlap, may overflow boundingBox and radius if not enough space - nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm - spacingFactor: undefined, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up - radius: undefined, // the radius of the circle - startAngle: 3 / 2 * Math.PI, // where nodes start in radians - sweep: undefined, // how many radians should be between the first and last node (defaults to full circle) - clockwise: true, // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) - sort: undefined, // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } - animate: false, // whether to transition the node positions - animationDuration: 500, // duration of animation in ms if enabled - animationEasing: undefined, // easing of animation if enabled - animateFilter: function animateFilter(node, i) { - return true; - }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts - ready: undefined, // callback on layoutready - stop: undefined, // callback on layoutstop - transform: function transform(node, position) { - return position; - } // transform a given node position. Useful for changing flow direction in discrete layouts - -}; - -function CircleLayout(options) { - this.options = util.extend({}, defaults, options); -} - -CircleLayout.prototype.run = function () { - var params = this.options; - var options = params; - - var cy = params.cy; - var eles = options.eles; - - var clockwise = options.counterclockwise !== undefined ? !options.counterclockwise : options.clockwise; - - var nodes = eles.nodes().not(':parent'); - - if (options.sort) { - nodes = nodes.sort(options.sort); - } - - var bb = math.makeBoundingBox(options.boundingBox ? options.boundingBox : { - x1: 0, y1: 0, w: cy.width(), h: cy.height() - }); - - var center = { - x: bb.x1 + bb.w / 2, - y: bb.y1 + bb.h / 2 - }; - - var sweep = options.sweep === undefined ? 2 * Math.PI - 2 * Math.PI / nodes.length : options.sweep; - var dTheta = sweep / Math.max(1, nodes.length - 1); - var r = void 0; - - var minDistance = 0; - for (var i = 0; i < nodes.length; i++) { - var n = nodes[i]; - var nbb = n.layoutDimensions(options); - var w = nbb.w; - var h = nbb.h; - - minDistance = Math.max(minDistance, w, h); - } - - if (is.number(options.radius)) { - r = options.radius; - } else if (nodes.length <= 1) { - r = 0; - } else { - r = Math.min(bb.h, bb.w) / 2 - minDistance; - } - - // calculate the radius - if (nodes.length > 1 && options.avoidOverlap) { - // but only if more than one node (can't overlap) - minDistance *= 1.75; // just to have some nice spacing - - var dcos = Math.cos(dTheta) - Math.cos(0); - var dsin = Math.sin(dTheta) - Math.sin(0); - var rMin = Math.sqrt(minDistance * minDistance / (dcos * dcos + dsin * dsin)); // s.t. no nodes overlapping - r = Math.max(rMin, r); - } - - var getPos = function getPos(ele, i) { - var theta = options.startAngle + i * dTheta * (clockwise ? 1 : -1); - - var rx = r * Math.cos(theta); - var ry = r * Math.sin(theta); - var pos = { - x: center.x + rx, - y: center.y + ry - }; - - return pos; - }; - - nodes.layoutPositions(this, options, getPos); - - return this; // chaining -}; - -module.exports = CircleLayout; - -/***/ }), -/* 99 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var math = __webpack_require__(2); - -var defaults = { - fit: true, // whether to fit the viewport to the graph - padding: 30, // the padding on fit - startAngle: 3 / 2 * Math.PI, // where nodes start in radians - sweep: undefined, // how many radians should be between the first and last node (defaults to full circle) - clockwise: true, // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) - equidistant: false, // whether levels have an equal radial distance betwen them, may cause bounding box overflow - minNodeSpacing: 10, // min spacing between outside of nodes (used for radius adjustment) - boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space - nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm - height: undefined, // height of layout area (overrides container height) - width: undefined, // width of layout area (overrides container width) - spacingFactor: undefined, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up - concentric: function concentric(node) { - // returns numeric value for each node, placing higher nodes in levels towards the centre - return node.degree(); - }, - levelWidth: function levelWidth(nodes) { - // the letiation of concentric values in each level - return nodes.maxDegree() / 4; - }, - animate: false, // whether to transition the node positions - animationDuration: 500, // duration of animation in ms if enabled - animationEasing: undefined, // easing of animation if enabled - animateFilter: function animateFilter(node, i) { - return true; - }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts - ready: undefined, // callback on layoutready - stop: undefined, // callback on layoutstop - transform: function transform(node, position) { - return position; - } // transform a given node position. Useful for changing flow direction in discrete layouts -}; - -function ConcentricLayout(options) { - this.options = util.extend({}, defaults, options); -} - -ConcentricLayout.prototype.run = function () { - var params = this.options; - var options = params; - - var clockwise = options.counterclockwise !== undefined ? !options.counterclockwise : options.clockwise; - - var cy = params.cy; - - var eles = options.eles; - var nodes = eles.nodes().not(':parent'); - - var bb = math.makeBoundingBox(options.boundingBox ? options.boundingBox : { - x1: 0, y1: 0, w: cy.width(), h: cy.height() - }); - - var center = { - x: bb.x1 + bb.w / 2, - y: bb.y1 + bb.h / 2 - }; - - var nodeValues = []; // { node, value } - var theta = options.startAngle; - var maxNodeSize = 0; - - for (var i = 0; i < nodes.length; i++) { - var node = nodes[i]; - var value = void 0; - - // calculate the node value - value = options.concentric(node); - nodeValues.push({ - value: value, - node: node - }); - - // for style mapping - node._private.scratch.concentric = value; - } - - // in case we used the `concentric` in style - nodes.updateStyle(); - - // calculate max size now based on potentially updated mappers - for (var _i = 0; _i < nodes.length; _i++) { - var _node = nodes[_i]; - var nbb = _node.layoutDimensions(options); - - maxNodeSize = Math.max(maxNodeSize, nbb.w, nbb.h); - } - - // sort node values in descreasing order - nodeValues.sort(function (a, b) { - return b.value - a.value; - }); - - var levelWidth = options.levelWidth(nodes); - - // put the values into levels - var levels = [[]]; - var currentLevel = levels[0]; - for (var _i2 = 0; _i2 < nodeValues.length; _i2++) { - var val = nodeValues[_i2]; - - if (currentLevel.length > 0) { - var diff = Math.abs(currentLevel[0].value - val.value); - - if (diff >= levelWidth) { - currentLevel = []; - levels.push(currentLevel); - } - } - - currentLevel.push(val); - } - - // create positions from levels - - var minDist = maxNodeSize + options.minNodeSpacing; // min dist between nodes - - if (!options.avoidOverlap) { - // then strictly constrain to bb - var firstLvlHasMulti = levels.length > 0 && levels[0].length > 1; - var maxR = Math.min(bb.w, bb.h) / 2 - minDist; - var rStep = maxR / (levels.length + firstLvlHasMulti ? 1 : 0); - - minDist = Math.min(minDist, rStep); - } - - // find the metrics for each level - var r = 0; - for (var _i3 = 0; _i3 < levels.length; _i3++) { - var level = levels[_i3]; - var sweep = options.sweep === undefined ? 2 * Math.PI - 2 * Math.PI / level.length : options.sweep; - var dTheta = level.dTheta = sweep / Math.max(1, level.length - 1); - - // calculate the radius - if (level.length > 1 && options.avoidOverlap) { - // but only if more than one node (can't overlap) - var dcos = Math.cos(dTheta) - Math.cos(0); - var dsin = Math.sin(dTheta) - Math.sin(0); - var rMin = Math.sqrt(minDist * minDist / (dcos * dcos + dsin * dsin)); // s.t. no nodes overlapping - - r = Math.max(rMin, r); - } - - level.r = r; - - r += minDist; - } - - if (options.equidistant) { - var rDeltaMax = 0; - var _r = 0; - - for (var _i4 = 0; _i4 < levels.length; _i4++) { - var _level = levels[_i4]; - var rDelta = _level.r - _r; - - rDeltaMax = Math.max(rDeltaMax, rDelta); - } - - _r = 0; - for (var _i5 = 0; _i5 < levels.length; _i5++) { - var _level2 = levels[_i5]; - - if (_i5 === 0) { - _r = _level2.r; - } - - _level2.r = _r; - - _r += rDeltaMax; - } - } - - // calculate the node positions - var pos = {}; // id => position - for (var _i6 = 0; _i6 < levels.length; _i6++) { - var _level3 = levels[_i6]; - var _dTheta = _level3.dTheta; - var _r2 = _level3.r; - - for (var j = 0; j < _level3.length; j++) { - var _val = _level3[j]; - var _theta = options.startAngle + (clockwise ? 1 : -1) * _dTheta * j; - - var p = { - x: center.x + _r2 * Math.cos(_theta), - y: center.y + _r2 * Math.sin(_theta) - }; - - pos[_val.node.id()] = p; - } - } - - // position the nodes - nodes.layoutPositions(this, options, function (ele) { - var id = ele.id(); - - return pos[id]; - }); - - return this; // chaining -}; - -module.exports = ConcentricLayout; - -/***/ }), -/* 100 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/* -The CoSE layout was written by Gerardo Huck. -https://www.linkedin.com/in/gerardohuck/ - -Based on the following article: -http://dl.acm.org/citation.cfm?id=1498047 - -Modifications tracked on Github. -*/ - -var util = __webpack_require__(1); -var math = __webpack_require__(2); -var is = __webpack_require__(0); -var Promise = __webpack_require__(5); - -var DEBUG; - -/** - * @brief : default layout options - */ -var defaults = { - // Called on `layoutready` - ready: function ready() {}, - - // Called on `layoutstop` - stop: function stop() {}, - - // Whether to animate while running the layout - // true : Animate continuously as the layout is running - // false : Just show the end result - // 'end' : Animate with the end result, from the initial positions to the end positions - animate: true, - - // Easing of the animation for animate:'end' - animationEasing: undefined, - - // The duration of the animation for animate:'end' - animationDuration: undefined, - - // A function that determines whether the node should be animated - // All nodes animated by default on animate enabled - // Non-animated nodes are positioned immediately when the layout starts - animateFilter: function animateFilter(node, i) { - return true; - }, - - // The layout animates only after this many milliseconds for animate:true - // (prevents flashing on fast runs) - animationThreshold: 250, - - // Number of iterations between consecutive screen positions update - // (0 -> only updated on the end) - refresh: 20, - - // Whether to fit the network view after when done - fit: true, - - // Padding on fit - padding: 30, - - // Constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - boundingBox: undefined, - - // Excludes the label when calculating node bounding boxes for the layout algorithm - nodeDimensionsIncludeLabels: false, - - // Randomize the initial positions of the nodes (true) or use existing positions (false) - randomize: false, - - // Extra spacing between components in non-compound graphs - componentSpacing: 40, - - // Node repulsion (non overlapping) multiplier - nodeRepulsion: function nodeRepulsion(node) { - return 2048; - }, - - // Node repulsion (overlapping) multiplier - nodeOverlap: 4, - - // Ideal edge (non nested) length - idealEdgeLength: function idealEdgeLength(edge) { - return 32; - }, - - // Divisor to compute edge forces - edgeElasticity: function edgeElasticity(edge) { - return 32; - }, - - // Nesting factor (multiplier) to compute ideal edge length for nested edges - nestingFactor: 1.2, - - // Gravity force (constant) - gravity: 1, - - // Maximum number of iterations to perform - numIter: 1000, - - // Initial temperature (maximum node displacement) - initialTemp: 1000, - - // Cooling factor (how the temperature is reduced between consecutive iterations - coolingFactor: 0.99, - - // Lower temperature threshold (below this point the layout will end) - minTemp: 1.0, - - // Pass a reference to weaver to use threads for calculations - weaver: false -}; - -/** - * @brief : constructor - * @arg options : object containing layout options - */ -function CoseLayout(options) { - this.options = util.extend({}, defaults, options); - - this.options.layout = this; -} - -/** - * @brief : runs the layout - */ -CoseLayout.prototype.run = function () { - var options = this.options; - var cy = options.cy; - var layout = this; - var thread = this.thread; - var Thread = options.weaver ? options.weaver.Thread : null; - - var falseThread = { // use false thread as polyfill - listeners: [], - on: function on(e, cb) { - this.listeners.push({ event: e, callback: cb }); - - return this; - }, - trigger: function trigger(e) { - if (is.string(e)) { - e = { type: e }; - } - - var matchesEvent = function matchesEvent(l) { - return l.event === e.type; - }; - var trigger = function trigger(l) { - l.callback(e); - }; - - this.listeners.filter(matchesEvent).forEach(trigger); - - return this; - }, - pass: function pass(data) { - this.pass = data; - - return this; - }, - run: function run(cb) { - var pass = this.pass; - - return new Promise(function (resolve) { - resolve(cb(pass)); - }); - }, - stop: function stop() { - return this; - }, - stopped: function stopped() { - return true; - } - }; - - function broadcast(message) { - // for false thread - var e = { type: 'message', message: message }; - - falseThread.trigger(e); - } - - if (!thread || thread.stopped()) { - thread = this.thread = Thread ? new Thread() : falseThread; - } - - layout.stopped = false; - - if (options.animate === true || options.animate === false) { - layout.emit({ type: 'layoutstart', layout: layout }); - } - - // Set DEBUG - Global variable - if (true === options.debug) { - DEBUG = true; - } else { - DEBUG = false; - } - - // Initialize layout info - var layoutInfo = createLayoutInfo(cy, layout, options); - - // Show LayoutInfo contents if debugging - if (DEBUG) { - printLayoutInfo(layoutInfo); - } - - // If required, randomize node positions - if (options.randomize) { - randomizePositions(layoutInfo, cy); - } - - var startTime = Date.now(); - var refreshRequested = false; - var refresh = function refresh(rOpts) { - rOpts = rOpts || {}; - - if (refreshRequested && !rOpts.next) { - return; - } - - if (!rOpts.force && Date.now() - startTime < options.animationThreshold) { - return; - } - - refreshRequested = true; - - util.requestAnimationFrame(function () { - refreshPositions(layoutInfo, cy, options); - - // Fit the graph if necessary - if (true === options.fit) { - cy.fit(options.padding); - } - - refreshRequested = false; - - if (rOpts.next) { - rOpts.next(); - } - }); - }; - - thread.on('message', function (e) { - var layoutNodes = e.message; - - layoutInfo.layoutNodes = layoutNodes; - refresh(); - }); - - thread.pass({ - layoutInfo: layoutInfo, - options: { - animate: options.animate, - refresh: options.refresh, - componentSpacing: options.componentSpacing, - nodeOverlap: options.nodeOverlap, - nestingFactor: options.nestingFactor, - gravity: options.gravity, - numIter: options.numIter, - initialTemp: options.initialTemp, - coolingFactor: options.coolingFactor, - minTemp: options.minTemp - } - }).run(function (pass) { - var layoutInfo = pass.layoutInfo; - var options = pass.options; - var stopped = false; - - /** - * @brief : Performs one iteration of the physical simulation - * @arg layoutInfo : LayoutInfo object already initialized - * @arg cy : Cytoscape object - * @arg options : Layout options - */ - var step = function step(layoutInfo, options, _step) { - // var s = "\n\n###############################"; - // s += "\nSTEP: " + step; - // s += "\n###############################\n"; - // logDebug(s); - - // Calculate node repulsions - calculateNodeForces(layoutInfo, options); - // Calculate edge forces - calculateEdgeForces(layoutInfo, options); - // Calculate gravity forces - calculateGravityForces(layoutInfo, options); - // Propagate forces from parent to child - propagateForces(layoutInfo, options); - // Update positions based on calculated forces - updatePositions(layoutInfo, options); - }; - - /** - * @brief : Computes the node repulsion forces - */ - var calculateNodeForces = function calculateNodeForces(layoutInfo, options) { - // Go through each of the graphs in graphSet - // Nodes only repel each other if they belong to the same graph - // var s = 'calculateNodeForces'; - // logDebug(s); - for (var i = 0; i < layoutInfo.graphSet.length; i++) { - var graph = layoutInfo.graphSet[i]; - var numNodes = graph.length; - - // s = "Set: " + graph.toString(); - // logDebug(s); - - // Now get all the pairs of nodes - // Only get each pair once, (A, B) = (B, A) - for (var j = 0; j < numNodes; j++) { - var node1 = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[j]]]; - - for (var k = j + 1; k < numNodes; k++) { - var node2 = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[k]]]; - - nodeRepulsion(node1, node2, layoutInfo, options); - } - } - } - }; - - var randomDistance = function randomDistance(max) { - return -max + 2 * max * Math.random(); - }; - - /** - * @brief : Compute the node repulsion forces between a pair of nodes - */ - var nodeRepulsion = function nodeRepulsion(node1, node2, layoutInfo, options) { - // var s = "Node repulsion. Node1: " + node1.id + " Node2: " + node2.id; - - var cmptId1 = node1.cmptId; - var cmptId2 = node2.cmptId; - - if (cmptId1 !== cmptId2 && !layoutInfo.isCompound) { - return; - } - - // Get direction of line connecting both node centers - var directionX = node2.positionX - node1.positionX; - var directionY = node2.positionY - node1.positionY; - var maxRandDist = 1; - // s += "\ndirectionX: " + directionX + ", directionY: " + directionY; - - // If both centers are the same, apply a random force - if (0 === directionX && 0 === directionY) { - directionX = randomDistance(maxRandDist); - directionY = randomDistance(maxRandDist); - } - - var overlap = nodesOverlap(node1, node2, directionX, directionY); - - if (overlap > 0) { - // s += "\nNodes DO overlap."; - // s += "\nOverlap: " + overlap; - // If nodes overlap, repulsion force is proportional - // to the overlap - var force = options.nodeOverlap * overlap; - - // Compute the module and components of the force vector - var distance = Math.sqrt(directionX * directionX + directionY * directionY); - // s += "\nDistance: " + distance; - var forceX = force * directionX / distance; - var forceY = force * directionY / distance; - } else { - // s += "\nNodes do NOT overlap."; - // If there's no overlap, force is inversely proportional - // to squared distance - - // Get clipping points for both nodes - var point1 = findClippingPoint(node1, directionX, directionY); - var point2 = findClippingPoint(node2, -1 * directionX, -1 * directionY); - - // Use clipping points to compute distance - var distanceX = point2.x - point1.x; - var distanceY = point2.y - point1.y; - var distanceSqr = distanceX * distanceX + distanceY * distanceY; - var distance = Math.sqrt(distanceSqr); - // s += "\nDistance: " + distance; - - // Compute the module and components of the force vector - var force = (node1.nodeRepulsion + node2.nodeRepulsion) / distanceSqr; - var forceX = force * distanceX / distance; - var forceY = force * distanceY / distance; - } - - // Apply force - if (!node1.isLocked) { - node1.offsetX -= forceX; - node1.offsetY -= forceY; - } - - if (!node2.isLocked) { - node2.offsetX += forceX; - node2.offsetY += forceY; - } - - // s += "\nForceX: " + forceX + " ForceY: " + forceY; - // logDebug(s); - - return; - }; - - /** - * @brief : Determines whether two nodes overlap or not - * @return : Amount of overlapping (0 => no overlap) - */ - var nodesOverlap = function nodesOverlap(node1, node2, dX, dY) { - - if (dX > 0) { - var overlapX = node1.maxX - node2.minX; - } else { - var overlapX = node2.maxX - node1.minX; - } - - if (dY > 0) { - var overlapY = node1.maxY - node2.minY; - } else { - var overlapY = node2.maxY - node1.minY; - } - - if (overlapX >= 0 && overlapY >= 0) { - return Math.sqrt(overlapX * overlapX + overlapY * overlapY); - } else { - return 0; - } - }; - - /** - * @brief : Finds the point in which an edge (direction dX, dY) intersects - * the rectangular bounding box of it's source/target node - */ - var findClippingPoint = function findClippingPoint(node, dX, dY) { - - // Shorcuts - var X = node.positionX; - var Y = node.positionY; - var H = node.height || 1; - var W = node.width || 1; - var dirSlope = dY / dX; - var nodeSlope = H / W; - - // var s = 'Computing clipping point of node ' + node.id + - // " . Height: " + H + ", Width: " + W + - // "\nDirection " + dX + ", " + dY; - // - // Compute intersection - var res = {}; - - // Case: Vertical direction (up) - if (0 === dX && 0 < dY) { - res.x = X; - // s += "\nUp direction"; - res.y = Y + H / 2; - - return res; - } - - // Case: Vertical direction (down) - if (0 === dX && 0 > dY) { - res.x = X; - res.y = Y + H / 2; - // s += "\nDown direction"; - - return res; - } - - // Case: Intersects the right border - if (0 < dX && -1 * nodeSlope <= dirSlope && dirSlope <= nodeSlope) { - res.x = X + W / 2; - res.y = Y + W * dY / 2 / dX; - // s += "\nRightborder"; - - return res; - } - - // Case: Intersects the left border - if (0 > dX && -1 * nodeSlope <= dirSlope && dirSlope <= nodeSlope) { - res.x = X - W / 2; - res.y = Y - W * dY / 2 / dX; - // s += "\nLeftborder"; - - return res; - } - - // Case: Intersects the top border - if (0 < dY && (dirSlope <= -1 * nodeSlope || dirSlope >= nodeSlope)) { - res.x = X + H * dX / 2 / dY; - res.y = Y + H / 2; - // s += "\nTop border"; - - return res; - } - - // Case: Intersects the bottom border - if (0 > dY && (dirSlope <= -1 * nodeSlope || dirSlope >= nodeSlope)) { - res.x = X - H * dX / 2 / dY; - res.y = Y - H / 2; - // s += "\nBottom border"; - - return res; - } - - // s += "\nClipping point found at " + res.x + ", " + res.y; - // logDebug(s); - return res; - }; - - /** - * @brief : Calculates all edge forces - */ - var calculateEdgeForces = function calculateEdgeForces(layoutInfo, options) { - // Iterate over all edges - for (var i = 0; i < layoutInfo.edgeSize; i++) { - // Get edge, source & target nodes - var edge = layoutInfo.layoutEdges[i]; - var sourceIx = layoutInfo.idToIndex[edge.sourceId]; - var source = layoutInfo.layoutNodes[sourceIx]; - var targetIx = layoutInfo.idToIndex[edge.targetId]; - var target = layoutInfo.layoutNodes[targetIx]; - - // Get direction of line connecting both node centers - var directionX = target.positionX - source.positionX; - var directionY = target.positionY - source.positionY; - - // If both centers are the same, do nothing. - // A random force has already been applied as node repulsion - if (0 === directionX && 0 === directionY) { - continue; - } - - // Get clipping points for both nodes - var point1 = findClippingPoint(source, directionX, directionY); - var point2 = findClippingPoint(target, -1 * directionX, -1 * directionY); - - var lx = point2.x - point1.x; - var ly = point2.y - point1.y; - var l = Math.sqrt(lx * lx + ly * ly); - - var force = Math.pow(edge.idealLength - l, 2) / edge.elasticity; - - if (0 !== l) { - var forceX = force * lx / l; - var forceY = force * ly / l; - } else { - var forceX = 0; - var forceY = 0; - } - - // Add this force to target and source nodes - if (!source.isLocked) { - source.offsetX += forceX; - source.offsetY += forceY; - } - - if (!target.isLocked) { - target.offsetX -= forceX; - target.offsetY -= forceY; - } - - // var s = 'Edge force between nodes ' + source.id + ' and ' + target.id; - // s += "\nDistance: " + l + " Force: (" + forceX + ", " + forceY + ")"; - // logDebug(s); - } - }; - - /** - * @brief : Computes gravity forces for all nodes - */ - var calculateGravityForces = function calculateGravityForces(layoutInfo, options) { - var distThreshold = 1; - - // var s = 'calculateGravityForces'; - // logDebug(s); - for (var i = 0; i < layoutInfo.graphSet.length; i++) { - var graph = layoutInfo.graphSet[i]; - var numNodes = graph.length; - - // s = "Set: " + graph.toString(); - // logDebug(s); - - // Compute graph center - if (0 === i) { - var centerX = layoutInfo.clientHeight / 2; - var centerY = layoutInfo.clientWidth / 2; - } else { - // Get Parent node for this graph, and use its position as center - var temp = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[0]]]; - var parent = layoutInfo.layoutNodes[layoutInfo.idToIndex[temp.parentId]]; - var centerX = parent.positionX; - var centerY = parent.positionY; - } - // s = "Center found at: " + centerX + ", " + centerY; - // logDebug(s); - - // Apply force to all nodes in graph - for (var j = 0; j < numNodes; j++) { - var node = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[j]]]; - // s = "Node: " + node.id; - - if (node.isLocked) { - continue; - } - - var dx = centerX - node.positionX; - var dy = centerY - node.positionY; - var d = Math.sqrt(dx * dx + dy * dy); - if (d > distThreshold) { - var fx = options.gravity * dx / d; - var fy = options.gravity * dy / d; - node.offsetX += fx; - node.offsetY += fy; - // s += ": Applied force: " + fx + ", " + fy; - } else {} - // s += ": skypped since it's too close to center"; - - // logDebug(s); - } - } - }; - - /** - * @brief : This function propagates the existing offsets from - * parent nodes to its descendents. - * @arg layoutInfo : layoutInfo Object - * @arg cy : cytoscape Object - * @arg options : Layout options - */ - var propagateForces = function propagateForces(layoutInfo, options) { - // Inline implementation of a queue, used for traversing the graph in BFS order - var queue = []; - var start = 0; // Points to the start the queue - var end = -1; // Points to the end of the queue - - // logDebug('propagateForces'); - - // Start by visiting the nodes in the root graph - queue.push.apply(queue, layoutInfo.graphSet[0]); - end += layoutInfo.graphSet[0].length; - - // Traverse the graph, level by level, - while (start <= end) { - // Get the node to visit and remove it from queue - var nodeId = queue[start++]; - var nodeIndex = layoutInfo.idToIndex[nodeId]; - var node = layoutInfo.layoutNodes[nodeIndex]; - var children = node.children; - - // We only need to process the node if it's compound - if (0 < children.length && !node.isLocked) { - var offX = node.offsetX; - var offY = node.offsetY; - - // var s = "Propagating offset from parent node : " + node.id + - // ". OffsetX: " + offX + ". OffsetY: " + offY; - // s += "\n Children: " + children.toString(); - // logDebug(s); - - for (var i = 0; i < children.length; i++) { - var childNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[children[i]]]; - // Propagate offset - childNode.offsetX += offX; - childNode.offsetY += offY; - // Add children to queue to be visited - queue[++end] = children[i]; - } - - // Reset parent offsets - node.offsetX = 0; - node.offsetY = 0; - } - } - }; - - /** - * @brief : Updates the layout model positions, based on - * the accumulated forces - */ - var updatePositions = function updatePositions(layoutInfo, options) { - // var s = 'Updating positions'; - // logDebug(s); - - // Reset boundaries for compound nodes - for (var i = 0; i < layoutInfo.nodeSize; i++) { - var n = layoutInfo.layoutNodes[i]; - if (0 < n.children.length) { - // logDebug("Resetting boundaries of compound node: " + n.id); - n.maxX = undefined; - n.minX = undefined; - n.maxY = undefined; - n.minY = undefined; - } - } - - for (var i = 0; i < layoutInfo.nodeSize; i++) { - var n = layoutInfo.layoutNodes[i]; - if (0 < n.children.length || n.isLocked) { - // No need to set compound or locked node position - // logDebug("Skipping position update of node: " + n.id); - continue; - } - // s = "Node: " + n.id + " Previous position: (" + - // n.positionX + ", " + n.positionY + ")."; - - // Limit displacement in order to improve stability - var tempForce = limitForce(n.offsetX, n.offsetY, layoutInfo.temperature); - n.positionX += tempForce.x; - n.positionY += tempForce.y; - n.offsetX = 0; - n.offsetY = 0; - n.minX = n.positionX - n.width; - n.maxX = n.positionX + n.width; - n.minY = n.positionY - n.height; - n.maxY = n.positionY + n.height; - // s += " New Position: (" + n.positionX + ", " + n.positionY + ")."; - // logDebug(s); - - // Update ancestry boudaries - updateAncestryBoundaries(n, layoutInfo); - } - - // Update size, position of compund nodes - for (var i = 0; i < layoutInfo.nodeSize; i++) { - var n = layoutInfo.layoutNodes[i]; - if (0 < n.children.length && !n.isLocked) { - n.positionX = (n.maxX + n.minX) / 2; - n.positionY = (n.maxY + n.minY) / 2; - n.width = n.maxX - n.minX; - n.height = n.maxY - n.minY; - // s = "Updating position, size of compound node " + n.id; - // s += "\nPositionX: " + n.positionX + ", PositionY: " + n.positionY; - // s += "\nWidth: " + n.width + ", Height: " + n.height; - // logDebug(s); - } - } - }; - - /** - * @brief : Limits a force (forceX, forceY) to be not - * greater (in modulo) than max. - 8 Preserves force direction. - */ - var limitForce = function limitForce(forceX, forceY, max) { - // var s = "Limiting force: (" + forceX + ", " + forceY + "). Max: " + max; - var force = Math.sqrt(forceX * forceX + forceY * forceY); - - if (force > max) { - var res = { - x: max * forceX / force, - y: max * forceY / force - }; - } else { - var res = { - x: forceX, - y: forceY - }; - } - - // s += ".\nResult: (" + res.x + ", " + res.y + ")"; - // logDebug(s); - - return res; - }; - - /** - * @brief : Function used for keeping track of compound node - * sizes, since they should bound all their subnodes. - */ - var updateAncestryBoundaries = function updateAncestryBoundaries(node, layoutInfo) { - // var s = "Propagating new position/size of node " + node.id; - var parentId = node.parentId; - if (null == parentId) { - // If there's no parent, we are done - // s += ". No parent node."; - // logDebug(s); - return; - } - - // Get Parent Node - var p = layoutInfo.layoutNodes[layoutInfo.idToIndex[parentId]]; - var flag = false; - - // MaxX - if (null == p.maxX || node.maxX + p.padRight > p.maxX) { - p.maxX = node.maxX + p.padRight; - flag = true; - // s += "\nNew maxX for parent node " + p.id + ": " + p.maxX; - } - - // MinX - if (null == p.minX || node.minX - p.padLeft < p.minX) { - p.minX = node.minX - p.padLeft; - flag = true; - // s += "\nNew minX for parent node " + p.id + ": " + p.minX; - } - - // MaxY - if (null == p.maxY || node.maxY + p.padBottom > p.maxY) { - p.maxY = node.maxY + p.padBottom; - flag = true; - // s += "\nNew maxY for parent node " + p.id + ": " + p.maxY; - } - - // MinY - if (null == p.minY || node.minY - p.padTop < p.minY) { - p.minY = node.minY - p.padTop; - flag = true; - // s += "\nNew minY for parent node " + p.id + ": " + p.minY; - } - - // If updated boundaries, propagate changes upward - if (flag) { - // logDebug(s); - return updateAncestryBoundaries(p, layoutInfo); - } - - // s += ". No changes in boundaries/position of parent node " + p.id; - // logDebug(s); - return; - }; - - var separateComponents = function separateComponents(layutInfo, options) { - var nodes = layoutInfo.layoutNodes; - var components = []; - - for (var i = 0; i < nodes.length; i++) { - var node = nodes[i]; - var cid = node.cmptId; - var component = components[cid] = components[cid] || []; - - component.push(node); - } - - var totalA = 0; - - for (var i = 0; i < components.length; i++) { - var c = components[i]; - - if (!c) { - continue; - } - - c.x1 = Infinity; - c.x2 = -Infinity; - c.y1 = Infinity; - c.y2 = -Infinity; - - for (var j = 0; j < c.length; j++) { - var n = c[j]; - - c.x1 = Math.min(c.x1, n.positionX - n.width / 2); - c.x2 = Math.max(c.x2, n.positionX + n.width / 2); - c.y1 = Math.min(c.y1, n.positionY - n.height / 2); - c.y2 = Math.max(c.y2, n.positionY + n.height / 2); - } - - c.w = c.x2 - c.x1; - c.h = c.y2 - c.y1; - - totalA += c.w * c.h; - } - - components.sort(function (c1, c2) { - return c2.w * c2.h - c1.w * c1.h; - }); - - var x = 0; - var y = 0; - var usedW = 0; - var rowH = 0; - var maxRowW = Math.sqrt(totalA) * layoutInfo.clientWidth / layoutInfo.clientHeight; - - for (var i = 0; i < components.length; i++) { - var c = components[i]; - - if (!c) { - continue; - } - - for (var j = 0; j < c.length; j++) { - var n = c[j]; - - if (!n.isLocked) { - n.positionX += x; - n.positionY += y; - } - } - - x += c.w + options.componentSpacing; - usedW += c.w + options.componentSpacing; - rowH = Math.max(rowH, c.h); - - if (usedW > maxRowW) { - y += rowH + options.componentSpacing; - x = 0; - usedW = 0; - rowH = 0; - } - } - }; - - var mainLoop = function mainLoop(i) { - if (stopped) { - // logDebug("Layout manually stopped. Stopping computation in step " + i); - return false; - } - - // Do one step in the phisical simulation - step(layoutInfo, options, i); - - // Update temperature - layoutInfo.temperature = layoutInfo.temperature * options.coolingFactor; - // logDebug("New temperature: " + layoutInfo.temperature); - - if (layoutInfo.temperature < options.minTemp) { - // logDebug("Temperature drop below minimum threshold. Stopping computation in step " + i); - return false; - } - - return true; - }; - - var i = 0; - var loopRet; - - do { - var f = 0; - - while (f < options.refresh && i < options.numIter) { - var loopRet = mainLoop(i); - if (!loopRet) { - break; - } - - f++; - i++; - } - - if (options.animate === true) { - broadcast(layoutInfo.layoutNodes); // eslint-disable-line no-undef - } - } while (loopRet && i + 1 < options.numIter); - - separateComponents(layoutInfo, options); - - return layoutInfo; - }).then(function (layoutInfoUpdated) { - layoutInfo.layoutNodes = layoutInfoUpdated.layoutNodes; // get the positions - - thread.stop(); - done(); - }); - - var done = function done() { - if (options.animate === true || options.animate === false) { - refresh({ - force: true, - next: function next() { - // Layout has finished - layout.one('layoutstop', options.stop); - layout.emit({ type: 'layoutstop', layout: layout }); - } - }); - } else { - options.eles.nodes().layoutPositions(layout, options, function (node) { - var lnode = layoutInfo.layoutNodes[layoutInfo.idToIndex[node.data('id')]]; - - return { x: lnode.positionX, y: lnode.positionY }; - }); - } - }; - - return this; // chaining -}; - -/** - * @brief : called on continuous layouts to stop them before they finish - */ -CoseLayout.prototype.stop = function () { - this.stopped = true; - - if (this.thread) { - this.thread.stop(); - } - - this.emit('layoutstop'); - - return this; // chaining -}; - -CoseLayout.prototype.destroy = function () { - if (this.thread) { - this.thread.stop(); - } - - return this; // chaining -}; - -/** - * @brief : Creates an object which is contains all the data - * used in the layout process - * @arg cy : cytoscape.js object - * @return : layoutInfo object initialized - */ -var createLayoutInfo = function createLayoutInfo(cy, layout, options) { - // Shortcut - var edges = options.eles.edges(); - var nodes = options.eles.nodes(); - - var layoutInfo = { - isCompound: cy.hasCompoundNodes(), - layoutNodes: [], - idToIndex: {}, - nodeSize: nodes.size(), - graphSet: [], - indexToGraph: [], - layoutEdges: [], - edgeSize: edges.size(), - temperature: options.initialTemp, - clientWidth: cy.width(), - clientHeight: cy.width(), - boundingBox: math.makeBoundingBox(options.boundingBox ? options.boundingBox : { - x1: 0, y1: 0, w: cy.width(), h: cy.height() - }) - }; - - var components = options.eles.components(); - var id2cmptId = {}; - - for (var i = 0; i < components.length; i++) { - var component = components[i]; - - for (var j = 0; j < component.length; j++) { - var node = component[j]; - - id2cmptId[node.id()] = i; - } - } - - // Iterate over all nodes, creating layout nodes - for (var i = 0; i < layoutInfo.nodeSize; i++) { - var n = nodes[i]; - var nbb = n.layoutDimensions(options); - - var tempNode = {}; - tempNode.isLocked = n.locked(); - tempNode.id = n.data('id'); - tempNode.parentId = n.data('parent'); - tempNode.cmptId = id2cmptId[n.id()]; - tempNode.children = []; - tempNode.positionX = n.position('x'); - tempNode.positionY = n.position('y'); - tempNode.offsetX = 0; - tempNode.offsetY = 0; - tempNode.height = nbb.w; - tempNode.width = nbb.h; - tempNode.maxX = tempNode.positionX + tempNode.width / 2; - tempNode.minX = tempNode.positionX - tempNode.width / 2; - tempNode.maxY = tempNode.positionY + tempNode.height / 2; - tempNode.minY = tempNode.positionY - tempNode.height / 2; - tempNode.padLeft = parseFloat(n.style('padding')); - tempNode.padRight = parseFloat(n.style('padding')); - tempNode.padTop = parseFloat(n.style('padding')); - tempNode.padBottom = parseFloat(n.style('padding')); - - // forces - tempNode.nodeRepulsion = is.fn(options.nodeRepulsion) ? options.nodeRepulsion(n) : options.nodeRepulsion; - - // Add new node - layoutInfo.layoutNodes.push(tempNode); - // Add entry to id-index map - layoutInfo.idToIndex[tempNode.id] = i; - } - - // Inline implementation of a queue, used for traversing the graph in BFS order - var queue = []; - var start = 0; // Points to the start the queue - var end = -1; // Points to the end of the queue - - var tempGraph = []; - - // Second pass to add child information and - // initialize queue for hierarchical traversal - for (var i = 0; i < layoutInfo.nodeSize; i++) { - var n = layoutInfo.layoutNodes[i]; - var p_id = n.parentId; - // Check if node n has a parent node - if (null != p_id) { - // Add node Id to parent's list of children - layoutInfo.layoutNodes[layoutInfo.idToIndex[p_id]].children.push(n.id); - } else { - // If a node doesn't have a parent, then it's in the root graph - queue[++end] = n.id; - tempGraph.push(n.id); - } - } - - // Add root graph to graphSet - layoutInfo.graphSet.push(tempGraph); - - // Traverse the graph, level by level, - while (start <= end) { - // Get the node to visit and remove it from queue - var node_id = queue[start++]; - var node_ix = layoutInfo.idToIndex[node_id]; - var node = layoutInfo.layoutNodes[node_ix]; - var children = node.children; - if (children.length > 0) { - // Add children nodes as a new graph to graph set - layoutInfo.graphSet.push(children); - // Add children to que queue to be visited - for (var i = 0; i < children.length; i++) { - queue[++end] = children[i]; - } - } - } - - // Create indexToGraph map - for (var i = 0; i < layoutInfo.graphSet.length; i++) { - var graph = layoutInfo.graphSet[i]; - for (var j = 0; j < graph.length; j++) { - var index = layoutInfo.idToIndex[graph[j]]; - layoutInfo.indexToGraph[index] = i; - } - } - - // Iterate over all edges, creating Layout Edges - for (var i = 0; i < layoutInfo.edgeSize; i++) { - var e = edges[i]; - var tempEdge = {}; - tempEdge.id = e.data('id'); - tempEdge.sourceId = e.data('source'); - tempEdge.targetId = e.data('target'); - - // Compute ideal length - var idealLength = is.fn(options.idealEdgeLength) ? options.idealEdgeLength(e) : options.idealEdgeLength; - var elasticity = is.fn(options.edgeElasticity) ? options.edgeElasticity(e) : options.edgeElasticity; - - // Check if it's an inter graph edge - var sourceIx = layoutInfo.idToIndex[tempEdge.sourceId]; - var targetIx = layoutInfo.idToIndex[tempEdge.targetId]; - var sourceGraph = layoutInfo.indexToGraph[sourceIx]; - var targetGraph = layoutInfo.indexToGraph[targetIx]; - - if (sourceGraph != targetGraph) { - // Find lowest common graph ancestor - var lca = findLCA(tempEdge.sourceId, tempEdge.targetId, layoutInfo); - - // Compute sum of node depths, relative to lca graph - var lcaGraph = layoutInfo.graphSet[lca]; - var depth = 0; - - // Source depth - var tempNode = layoutInfo.layoutNodes[sourceIx]; - while (-1 === lcaGraph.indexOf(tempNode.id)) { - tempNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[tempNode.parentId]]; - depth++; - } - - // Target depth - tempNode = layoutInfo.layoutNodes[targetIx]; - while (-1 === lcaGraph.indexOf(tempNode.id)) { - tempNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[tempNode.parentId]]; - depth++; - } - - // logDebug('LCA of nodes ' + tempEdge.sourceId + ' and ' + tempEdge.targetId + - // ". Index: " + lca + " Contents: " + lcaGraph.toString() + - // ". Depth: " + depth); - - // Update idealLength - idealLength *= depth * options.nestingFactor; - } - - tempEdge.idealLength = idealLength; - tempEdge.elasticity = elasticity; - - layoutInfo.layoutEdges.push(tempEdge); - } - - // Finally, return layoutInfo object - return layoutInfo; -}; - -/** - * @brief : This function finds the index of the lowest common - * graph ancestor between 2 nodes in the subtree - * (from the graph hierarchy induced tree) whose - * root is graphIx - * - * @arg node1: node1's ID - * @arg node2: node2's ID - * @arg layoutInfo: layoutInfo object - * - */ -var findLCA = function findLCA(node1, node2, layoutInfo) { - // Find their common ancester, starting from the root graph - var res = findLCA_aux(node1, node2, 0, layoutInfo); - if (2 > res.count) { - // If aux function couldn't find the common ancester, - // then it is the root graph - return 0; - } else { - return res.graph; - } -}; - -/** - * @brief : Auxiliary function used for LCA computation - * - * @arg node1 : node1's ID - * @arg node2 : node2's ID - * @arg graphIx : subgraph index - * @arg layoutInfo : layoutInfo object - * - * @return : object of the form {count: X, graph: Y}, where: - * X is the number of ancesters (max: 2) found in - * graphIx (and it's subgraphs), - * Y is the graph index of the lowest graph containing - * all X nodes - */ -var findLCA_aux = function findLCA_aux(node1, node2, graphIx, layoutInfo) { - var graph = layoutInfo.graphSet[graphIx]; - // If both nodes belongs to graphIx - if (-1 < graph.indexOf(node1) && -1 < graph.indexOf(node2)) { - return { count: 2, graph: graphIx }; - } - - // Make recursive calls for all subgraphs - var c = 0; - for (var i = 0; i < graph.length; i++) { - var nodeId = graph[i]; - var nodeIx = layoutInfo.idToIndex[nodeId]; - var children = layoutInfo.layoutNodes[nodeIx].children; - - // If the node has no child, skip it - if (0 === children.length) { - continue; - } - - var childGraphIx = layoutInfo.indexToGraph[layoutInfo.idToIndex[children[0]]]; - var result = findLCA_aux(node1, node2, childGraphIx, layoutInfo); - if (0 === result.count) { - // Neither node1 nor node2 are present in this subgraph - continue; - } else if (1 === result.count) { - // One of (node1, node2) is present in this subgraph - c++; - if (2 === c) { - // We've already found both nodes, no need to keep searching - break; - } - } else { - // Both nodes are present in this subgraph - return result; - } - } - - return { count: c, graph: graphIx }; -}; - -/** - * @brief: printsLayoutInfo into js console - * Only used for debbuging - */ -var printLayoutInfo = function printLayoutInfo(layoutInfo) { - /* eslint-disable */ - - if (!DEBUG) { - return; - } - console.debug('layoutNodes:'); - for (var i = 0; i < layoutInfo.nodeSize; i++) { - var n = layoutInfo.layoutNodes[i]; - var s = '\nindex: ' + i + '\nId: ' + n.id + '\nChildren: ' + n.children.toString() + '\nparentId: ' + n.parentId + '\npositionX: ' + n.positionX + '\npositionY: ' + n.positionY + '\nOffsetX: ' + n.offsetX + '\nOffsetY: ' + n.offsetY + '\npadLeft: ' + n.padLeft + '\npadRight: ' + n.padRight + '\npadTop: ' + n.padTop + '\npadBottom: ' + n.padBottom; - - console.debug(s); - } - - console.debug('idToIndex'); - for (var i in layoutInfo.idToIndex) { - console.debug('Id: ' + i + '\nIndex: ' + layoutInfo.idToIndex[i]); - } - - console.debug('Graph Set'); - var set = layoutInfo.graphSet; - for (var i = 0; i < set.length; i++) { - console.debug('Set : ' + i + ': ' + set[i].toString()); - } - - var s = 'IndexToGraph'; - for (var i = 0; i < layoutInfo.indexToGraph.length; i++) { - s += '\nIndex : ' + i + ' Graph: ' + layoutInfo.indexToGraph[i]; - } - console.debug(s); - - s = 'Layout Edges'; - for (var i = 0; i < layoutInfo.layoutEdges.length; i++) { - var e = layoutInfo.layoutEdges[i]; - s += '\nEdge Index: ' + i + ' ID: ' + e.id + ' SouceID: ' + e.sourceId + ' TargetId: ' + e.targetId + ' Ideal Length: ' + e.idealLength; - } - console.debug(s); - - s = 'nodeSize: ' + layoutInfo.nodeSize; - s += '\nedgeSize: ' + layoutInfo.edgeSize; - s += '\ntemperature: ' + layoutInfo.temperature; - console.debug(s); - - return; - /* eslint-enable */ -}; - -/** - * @brief : Randomizes the position of all nodes - */ -var randomizePositions = function randomizePositions(layoutInfo, cy) { - var width = layoutInfo.clientWidth; - var height = layoutInfo.clientHeight; - - for (var i = 0; i < layoutInfo.nodeSize; i++) { - var n = layoutInfo.layoutNodes[i]; - - // No need to randomize compound nodes or locked nodes - if (0 === n.children.length && !n.isLocked) { - n.positionX = Math.random() * width; - n.positionY = Math.random() * height; - } - } -}; - -/** - * @brief : Updates the positions of nodes in the network - * @arg layoutInfo : LayoutInfo object - * @arg cy : Cytoscape object - * @arg options : Layout options - */ -var refreshPositions = function refreshPositions(layoutInfo, cy, options) { - // var s = 'Refreshing positions'; - // logDebug(s); - - var layout = options.layout; - var nodes = options.eles.nodes(); - var bb = layoutInfo.boundingBox; - var coseBB = { x1: Infinity, x2: -Infinity, y1: Infinity, y2: -Infinity }; - - if (options.boundingBox) { - nodes.forEach(function (node) { - var lnode = layoutInfo.layoutNodes[layoutInfo.idToIndex[node.data('id')]]; - - coseBB.x1 = Math.min(coseBB.x1, lnode.positionX); - coseBB.x2 = Math.max(coseBB.x2, lnode.positionX); - - coseBB.y1 = Math.min(coseBB.y1, lnode.positionY); - coseBB.y2 = Math.max(coseBB.y2, lnode.positionY); - }); - - coseBB.w = coseBB.x2 - coseBB.x1; - coseBB.h = coseBB.y2 - coseBB.y1; - } - - nodes.positions(function (ele, i) { - var lnode = layoutInfo.layoutNodes[layoutInfo.idToIndex[ele.data('id')]]; - // s = "Node: " + lnode.id + ". Refreshed position: (" + - // lnode.positionX + ", " + lnode.positionY + ")."; - // logDebug(s); - - if (options.boundingBox) { - // then add extra bounding box constraint - var pctX = (lnode.positionX - coseBB.x1) / coseBB.w; - var pctY = (lnode.positionY - coseBB.y1) / coseBB.h; - - return { - x: bb.x1 + pctX * bb.w, - y: bb.y1 + pctY * bb.h - }; - } else { - return { - x: lnode.positionX, - y: lnode.positionY - }; - } - }); - - // Trigger layoutReady only on first call - if (true !== layoutInfo.ready) { - // s = 'Triggering layoutready'; - // logDebug(s); - layoutInfo.ready = true; - layout.one('layoutready', options.ready); - layout.emit({ type: 'layoutready', layout: this }); - } -}; - -/** - * @brief : Logs a debug message in JS console, if DEBUG is ON - */ -// var logDebug = function(text) { -// if (DEBUG) { -// console.debug(text); -// } -// }; - -module.exports = CoseLayout; - -/***/ }), -/* 101 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var math = __webpack_require__(2); - -var defaults = { - fit: true, // whether to fit the viewport to the graph - padding: 30, // padding used on fit - boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space - avoidOverlapPadding: 10, // extra spacing around nodes when avoidOverlap: true - nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm - spacingFactor: undefined, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up - condense: false, // uses all available space on false, uses minimal space on true - rows: undefined, // force num of rows in the grid - cols: undefined, // force num of columns in the grid - position: function position(node) {}, // returns { row, col } for element - sort: undefined, // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } - animate: false, // whether to transition the node positions - animationDuration: 500, // duration of animation in ms if enabled - animationEasing: undefined, // easing of animation if enabled - animateFilter: function animateFilter(node, i) { - return true; - }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts - ready: undefined, // callback on layoutready - stop: undefined, // callback on layoutstop - transform: function transform(node, position) { - return position; - } // transform a given node position. Useful for changing flow direction in discrete layouts -}; - -function GridLayout(options) { - this.options = util.extend({}, defaults, options); -} - -GridLayout.prototype.run = function () { - var params = this.options; - var options = params; - - var cy = params.cy; - var eles = options.eles; - var nodes = eles.nodes().not(':parent'); - - if (options.sort) { - nodes = nodes.sort(options.sort); - } - - var bb = math.makeBoundingBox(options.boundingBox ? options.boundingBox : { - x1: 0, y1: 0, w: cy.width(), h: cy.height() - }); - - if (bb.h === 0 || bb.w === 0) { - nodes.layoutPositions(this, options, function (ele) { - return { x: bb.x1, y: bb.y1 }; - }); - } else { - - // width/height * splits^2 = cells where splits is number of times to split width - var cells = nodes.size(); - var splits = Math.sqrt(cells * bb.h / bb.w); - var rows = Math.round(splits); - var cols = Math.round(bb.w / bb.h * splits); - - var small = function small(val) { - if (val == null) { - return Math.min(rows, cols); - } else { - var min = Math.min(rows, cols); - if (min == rows) { - rows = val; - } else { - cols = val; - } - } - }; - - var large = function large(val) { - if (val == null) { - return Math.max(rows, cols); - } else { - var max = Math.max(rows, cols); - if (max == rows) { - rows = val; - } else { - cols = val; - } - } - }; - - var oRows = options.rows; - var oCols = options.cols != null ? options.cols : options.columns; - - // if rows or columns were set in options, use those values - if (oRows != null && oCols != null) { - rows = oRows; - cols = oCols; - } else if (oRows != null && oCols == null) { - rows = oRows; - cols = Math.ceil(cells / rows); - } else if (oRows == null && oCols != null) { - cols = oCols; - rows = Math.ceil(cells / cols); - } - - // otherwise use the automatic values and adjust accordingly - - // if rounding was up, see if we can reduce rows or columns - else if (cols * rows > cells) { - var sm = small(); - var lg = large(); - - // reducing the small side takes away the most cells, so try it first - if ((sm - 1) * lg >= cells) { - small(sm - 1); - } else if ((lg - 1) * sm >= cells) { - large(lg - 1); - } - } else { - - // if rounding was too low, add rows or columns - while (cols * rows < cells) { - var _sm = small(); - var _lg = large(); - - // try to add to larger side first (adds less in multiplication) - if ((_lg + 1) * _sm >= cells) { - large(_lg + 1); - } else { - small(_sm + 1); - } - } - } - - var cellWidth = bb.w / cols; - var cellHeight = bb.h / rows; - - if (options.condense) { - cellWidth = 0; - cellHeight = 0; - } - - if (options.avoidOverlap) { - for (var i = 0; i < nodes.length; i++) { - var node = nodes[i]; - var pos = node._private.position; - - if (pos.x == null || pos.y == null) { - // for bb - pos.x = 0; - pos.y = 0; - } - - var nbb = node.layoutDimensions(options); - var p = options.avoidOverlapPadding; - - var w = nbb.w + p; - var h = nbb.h + p; - - cellWidth = Math.max(cellWidth, w); - cellHeight = Math.max(cellHeight, h); - } - } - - var cellUsed = {}; // e.g. 'c-0-2' => true - - var used = function used(row, col) { - return cellUsed['c-' + row + '-' + col] ? true : false; - }; - - var use = function use(row, col) { - cellUsed['c-' + row + '-' + col] = true; - }; - - // to keep track of current cell position - var row = 0; - var col = 0; - var moveToNextCell = function moveToNextCell() { - col++; - if (col >= cols) { - col = 0; - row++; - } - }; - - // get a cache of all the manual positions - var id2manPos = {}; - for (var _i = 0; _i < nodes.length; _i++) { - var _node = nodes[_i]; - var rcPos = options.position(_node); - - if (rcPos && (rcPos.row !== undefined || rcPos.col !== undefined)) { - // must have at least row or col def'd - var _pos = { - row: rcPos.row, - col: rcPos.col - }; - - if (_pos.col === undefined) { - // find unused col - _pos.col = 0; - - while (used(_pos.row, _pos.col)) { - _pos.col++; - } - } else if (_pos.row === undefined) { - // find unused row - _pos.row = 0; - - while (used(_pos.row, _pos.col)) { - _pos.row++; - } - } - - id2manPos[_node.id()] = _pos; - use(_pos.row, _pos.col); - } - } - - var getPos = function getPos(element, i) { - var x = void 0, - y = void 0; - - if (element.locked() || element.isParent()) { - return false; - } - - // see if we have a manual position set - var rcPos = id2manPos[element.id()]; - if (rcPos) { - x = rcPos.col * cellWidth + cellWidth / 2 + bb.x1; - y = rcPos.row * cellHeight + cellHeight / 2 + bb.y1; - } else { - // otherwise set automatically - - while (used(row, col)) { - moveToNextCell(); - } - - x = col * cellWidth + cellWidth / 2 + bb.x1; - y = row * cellHeight + cellHeight / 2 + bb.y1; - use(row, col); - - moveToNextCell(); - } - - return { x: x, y: y }; - }; - - nodes.layoutPositions(this, options, getPos); - } - - return this; // chaining -}; - -module.exports = GridLayout; - -/***/ }), -/* 102 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); - -// default layout options -var defaults = { - ready: function ready() {}, // on layoutready - stop: function stop() {} // on layoutstop -}; - -// constructor -// options : object containing layout options -function NullLayout(options) { - this.options = util.extend({}, defaults, options); -} - -// runs the layout -NullLayout.prototype.run = function () { - var options = this.options; - var eles = options.eles; // elements to consider in the layout - var layout = this; - - // cy is automatically populated for us in the constructor - var cy = options.cy; // jshint ignore:line - - layout.emit('layoutstart'); - - // puts all nodes at (0, 0) - eles.nodes().positions(function () { - return { - x: 0, - y: 0 - }; - }); - - // trigger layoutready when each node has had its position set at least once - layout.one('layoutready', options.ready); - layout.emit('layoutready'); - - // trigger layoutstop when the layout stops (e.g. finishes) - layout.one('layoutstop', options.stop); - layout.emit('layoutstop'); - - return this; // chaining -}; - -// called on continuous layouts to stop them before they finish -NullLayout.prototype.stop = function () { - return this; // chaining -}; - -module.exports = NullLayout; - -/***/ }), -/* 103 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var is = __webpack_require__(0); - -var defaults = { - positions: undefined, // map of (node id) => (position obj); or function(node){ return somPos; } - zoom: undefined, // the zoom level to set (prob want fit = false if set) - pan: undefined, // the pan level to set (prob want fit = false if set) - fit: true, // whether to fit to viewport - padding: 30, // padding on fit - animate: false, // whether to transition the node positions - animationDuration: 500, // duration of animation in ms if enabled - animationEasing: undefined, // easing of animation if enabled - animateFilter: function animateFilter(node, i) { - return true; - }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts - ready: undefined, // callback on layoutready - stop: undefined, // callback on layoutstop - transform: function transform(node, position) { - return position; - } // transform a given node position. Useful for changing flow direction in discrete layouts -}; - -function PresetLayout(options) { - this.options = util.extend({}, defaults, options); -} - -PresetLayout.prototype.run = function () { - var options = this.options; - var eles = options.eles; - - var nodes = eles.nodes(); - var posIsFn = is.fn(options.positions); - - function getPosition(node) { - if (options.positions == null) { - return null; - } - - if (posIsFn) { - return options.positions(node); - } - - var pos = options.positions[node._private.data.id]; - - if (pos == null) { - return null; - } - - return pos; - } - - nodes.layoutPositions(this, options, function (node, i) { - var position = getPosition(node); - - if (node.locked() || position == null) { - return false; - } - - return position; - }); - - return this; // chaining -}; - -module.exports = PresetLayout; - -/***/ }), -/* 104 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var math = __webpack_require__(2); - -var defaults = { - fit: true, // whether to fit to viewport - padding: 30, // fit padding - boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - animate: false, // whether to transition the node positions - animationDuration: 500, // duration of animation in ms if enabled - animationEasing: undefined, // easing of animation if enabled - animateFilter: function animateFilter(node, i) { - return true; - }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts - ready: undefined, // callback on layoutready - stop: undefined, // callback on layoutstop - transform: function transform(node, position) { - return position; - } // transform a given node position. Useful for changing flow direction in discrete layouts -}; - -function RandomLayout(options) { - this.options = util.extend({}, defaults, options); -} - -RandomLayout.prototype.run = function () { - var options = this.options; - var cy = options.cy; - var eles = options.eles; - var nodes = eles.nodes().not(':parent'); - - var bb = math.makeBoundingBox(options.boundingBox ? options.boundingBox : { - x1: 0, y1: 0, w: cy.width(), h: cy.height() - }); - - var getPos = function getPos(node, i) { - return { - x: bb.x1 + Math.round(Math.random() * bb.w), - y: bb.y1 + Math.round(Math.random() * bb.h) - }; - }; - - nodes.layoutPositions(this, options, getPos); - - return this; // chaining -}; - -module.exports = RandomLayout; - -/***/ }), -/* 105 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = [{ name: 'null', impl: __webpack_require__(106) }, { name: 'base', impl: __webpack_require__(107) }, { name: 'canvas', impl: __webpack_require__(123) }]; - -/***/ }), -/* 106 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -function NullRenderer(options) { - this.options = options; - this.notifications = 0; // for testing -} - -var noop = function noop() {}; - -NullRenderer.prototype = { - recalculateRenderedStyle: noop, - notify: function notify() { - this.notifications++; - }, - init: noop -}; - -module.exports = NullRenderer; - -/***/ }), -/* 107 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var util = __webpack_require__(1); -var window = __webpack_require__(3); - -var BaseRenderer = function BaseRenderer(options) { - this.init(options); -}; -var BR = BaseRenderer; -var BRp = BR.prototype; - -BRp.clientFunctions = ['redrawHint', 'render', 'renderTo', 'matchCanvasSize', 'nodeShapeImpl', 'arrowShapeImpl']; - -BRp.init = function (options) { - var r = this; - - r.options = options; - - r.cy = options.cy; - - var ctr = r.container = options.cy.container(); - - // prepend a stylesheet in the head such that - if (window) { - var document = window.document; - var head = document.head; - var stylesheetId = '__________cytoscape_stylesheet'; - var className = '__________cytoscape_container'; - var stylesheetAlreadyExists = document.getElementById(stylesheetId) != null; - - if (ctr.className.indexOf(className) < 0) { - ctr.className = (ctr.className || '') + ' ' + className; - } - - if (!stylesheetAlreadyExists) { - var stylesheet = document.createElement('style'); - - stylesheet.id = stylesheetId; - stylesheet.innerHTML = '.' + className + ' { position: relative; }'; - - head.insertBefore(stylesheet, head.children[0]); // first so lowest priority - } - - var computedStyle = window.getComputedStyle(ctr); - var position = computedStyle.getPropertyValue('position'); - - if (position === 'static') { - util.error('A Cytoscape container has style position:static and so can not use UI extensions properly'); - } - } - - r.selection = [undefined, undefined, undefined, undefined, 0]; // Coordinates for selection box, plus enabled flag - - r.bezierProjPcts = [0.05, 0.225, 0.4, 0.5, 0.6, 0.775, 0.95]; - - //--Pointer-related data - r.hoverData = { down: null, last: null, - downTime: null, triggerMode: null, - dragging: false, - initialPan: [null, null], capture: false }; - - r.dragData = { possibleDragElements: [] }; - - r.touchData = { - start: null, capture: false, - - // These 3 fields related to tap, taphold events - startPosition: [null, null, null, null, null, null], - singleTouchStartTime: null, - singleTouchMoved: true, - - now: [null, null, null, null, null, null], - earlier: [null, null, null, null, null, null] - }; - - r.redraws = 0; - r.showFps = options.showFps; - r.debug = options.debug; - - r.hideEdgesOnViewport = options.hideEdgesOnViewport; - r.hideLabelsOnViewport = options.hideLabelsOnViewport; - r.textureOnViewport = options.textureOnViewport; - r.wheelSensitivity = options.wheelSensitivity; - r.motionBlurEnabled = options.motionBlur; // on by default - r.forcedPixelRatio = options.pixelRatio; - r.motionBlur = options.motionBlur; // for initial kick off - r.motionBlurOpacity = options.motionBlurOpacity; - r.motionBlurTransparency = 1 - r.motionBlurOpacity; - r.motionBlurPxRatio = 1; - r.mbPxRBlurry = 1; //0.8; - r.minMbLowQualFrames = 4; - r.fullQualityMb = false; - r.clearedForMotionBlur = []; - r.desktopTapThreshold = options.desktopTapThreshold; - r.desktopTapThreshold2 = options.desktopTapThreshold * options.desktopTapThreshold; - r.touchTapThreshold = options.touchTapThreshold; - r.touchTapThreshold2 = options.touchTapThreshold * options.touchTapThreshold; - r.tapholdDuration = 500; - - r.bindings = []; - r.beforeRenderCallbacks = []; - r.beforeRenderPriorities = { // higher priority execs before lower one - animations: 400, - eleCalcs: 300, - eleTxrDeq: 200, - lyrTxrDeq: 100 - }; - - r.registerNodeShapes(); - r.registerArrowShapes(); - r.registerCalculationListeners(); -}; - -BRp.notify = function (params) { - var types; - var r = this; - - // the renderer can't be notified after it's destroyed - if (this.destroyed) { - return; - } - - if (is.array(params.type)) { - types = params.type; - } else { - types = [params.type]; - } - - var has = {}; - for (var i = 0; i < types.length; i++) { - var type = types[i]; - - has[type] = true; - } // for - - if (has['init']) { - r.load(); - return; - } - - if (has['destroy']) { - r.destroy(); - return; - } - - if (has['add'] || has['remove'] || has['load'] || has['zorder']) { - r.invalidateCachedZSortedEles(); - } - - if (has['viewport']) { - r.redrawHint('select', true); - } - - if (has['load'] || has['resize']) { - r.invalidateContainerClientCoordsCache(); - r.matchCanvasSize(r.container); - } - - r.redrawHint('eles', true); - r.redrawHint('drag', true); - - this.startRenderLoop(); - - this.redraw(); -}; - -BRp.destroy = function () { - var r = this; - - r.destroyed = true; - - r.cy.stopAnimationLoop(); - - for (var i = 0; i < r.bindings.length; i++) { - var binding = r.bindings[i]; - var b = binding; - var tgt = b.target; - - (tgt.off || tgt.removeEventListener).apply(tgt, b.args); - } - - r.bindings = []; - r.beforeRenderCallbacks = []; - r.onUpdateEleCalcsFns = []; - - if (r.removeObserver) { - r.removeObserver.disconnect(); - } - - if (r.styleObserver) { - r.styleObserver.disconnect(); - } - - if (r.labelCalcDiv) { - try { - document.body.removeChild(r.labelCalcDiv); // eslint-disable-line no-undef - } catch (e) { - // ie10 issue #1014 - } - } -}; - -[__webpack_require__(108), __webpack_require__(109), __webpack_require__(119), __webpack_require__(120), __webpack_require__(121), __webpack_require__(122)].forEach(function (props) { - util.extend(BRp, props); -}); - -module.exports = BR; - -/***/ }), -/* 108 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var math = __webpack_require__(2); -var is = __webpack_require__(0); -var util = __webpack_require__(1); - -var BRp = {}; - -BRp.arrowShapeWidth = 0.3; - -BRp.registerArrowShapes = function () { - var arrowShapes = this.arrowShapes = {}; - var renderer = this; - - // Contract for arrow shapes: - // 0, 0 is arrow tip - // (0, 1) is direction towards node - // (1, 0) is right - // - // functional api: - // collide: check x, y in shape - // roughCollide: called before collide, no false negatives - // draw: draw - // spacing: dist(arrowTip, nodeBoundary) - // gap: dist(edgeTip, nodeBoundary), edgeTip may != arrowTip - - var bbCollide = function bbCollide(x, y, size, angle, translation, edgeWidth, padding) { - var x1 = translation.x - size / 2 - padding; - var x2 = translation.x + size / 2 + padding; - var y1 = translation.y - size / 2 - padding; - var y2 = translation.y + size / 2 + padding; - - var inside = x1 <= x && x <= x2 && y1 <= y && y <= y2; - - return inside; - }; - - var transform = function transform(x, y, size, angle, translation) { - var xRotated = x * Math.cos(angle) - y * Math.sin(angle); - var yRotated = x * Math.sin(angle) + y * Math.cos(angle); - - var xScaled = xRotated * size; - var yScaled = yRotated * size; - - var xTranslated = xScaled + translation.x; - var yTranslated = yScaled + translation.y; - - return { - x: xTranslated, - y: yTranslated - }; - }; - - var transformPoints = function transformPoints(pts, size, angle, translation) { - var retPts = []; - - for (var i = 0; i < pts.length; i += 2) { - var x = pts[i]; - var y = pts[i + 1]; - - retPts.push(transform(x, y, size, angle, translation)); - } - - return retPts; - }; - - var pointsToArr = function pointsToArr(pts) { - var ret = []; - - for (var i = 0; i < pts.length; i++) { - var p = pts[i]; - - ret.push(p.x, p.y); - } - - return ret; - }; - - var standardGap = function standardGap(edge) { - return edge.pstyle('width').pfValue * edge.pstyle('arrow-scale').pfValue * 2; - }; - - var defineArrowShape = function defineArrowShape(name, defn) { - if (is.string(defn)) { - defn = arrowShapes[defn]; - } - - arrowShapes[name] = util.extend({ - name: name, - - points: [-0.15, -0.3, 0.15, -0.3, 0.15, 0.3, -0.15, 0.3], - - collide: function collide(x, y, size, angle, translation, padding) { - var points = pointsToArr(transformPoints(this.points, size + 2 * padding, angle, translation)); - var inside = math.pointInsidePolygonPoints(x, y, points); - - return inside; - }, - - roughCollide: bbCollide, - - draw: function draw(context, size, angle, translation) { - var points = transformPoints(this.points, size, angle, translation); - - renderer.arrowShapeImpl('polygon')(context, points); - }, - - spacing: function spacing(edge) { - return 0; - }, - - gap: standardGap - }, defn); - }; - - defineArrowShape('none', { - collide: util.falsify, - - roughCollide: util.falsify, - - draw: util.noop, - - spacing: util.zeroify, - - gap: util.zeroify - }); - - defineArrowShape('triangle', { - points: [-0.15, -0.3, 0, 0, 0.15, -0.3] - }); - - defineArrowShape('arrow', 'triangle'); - - defineArrowShape('triangle-backcurve', { - points: arrowShapes['triangle'].points, - - controlPoint: [0, -0.15], - - roughCollide: bbCollide, - - draw: function draw(context, size, angle, translation, edgeWidth) { - var ptsTrans = transformPoints(this.points, size, angle, translation); - var ctrlPt = this.controlPoint; - var ctrlPtTrans = transform(ctrlPt[0], ctrlPt[1], size, angle, translation); - - renderer.arrowShapeImpl(this.name)(context, ptsTrans, ctrlPtTrans); - }, - - gap: function gap(edge) { - return standardGap(edge) * 0.8; - } - }); - - defineArrowShape('triangle-tee', { - points: [-0.15, -0.3, 0, 0, 0.15, -0.3, -0.15, -0.3], - - pointsTee: [-0.15, -0.4, -0.15, -0.5, 0.15, -0.5, 0.15, -0.4], - - collide: function collide(x, y, size, angle, translation, edgeWidth, padding) { - var triPts = pointsToArr(transformPoints(this.points, size + 2 * padding, angle, translation)); - var teePts = pointsToArr(transformPoints(this.pointsTee, size + 2 * padding, angle, translation)); - - var inside = math.pointInsidePolygonPoints(x, y, triPts) || math.pointInsidePolygonPoints(x, y, teePts); - - return inside; - }, - - draw: function draw(context, size, angle, translation, edgeWidth) { - var triPts = transformPoints(this.points, size, angle, translation); - var teePts = transformPoints(this.pointsTee, size, angle, translation); - - renderer.arrowShapeImpl(this.name)(context, triPts, teePts); - } - }); - - defineArrowShape('triangle-cross', { - points: [-0.15, -0.3, 0, 0, 0.15, -0.3, -0.15, -0.3], - - baseCrossLinePts: [-0.15, -0.4, // first half of the rectangle - -0.15, -0.4, 0.15, -0.4, // second half of the rectangle - 0.15, -0.4], - - crossLinePts: function crossLinePts(size, edgeWidth) { - // shift points so that the distance between the cross points matches edge width - var p = this.baseCrossLinePts.slice(); - var shiftFactor = edgeWidth / size; - var y0 = 3; - var y1 = 5; - - p[y0] = p[y0] - shiftFactor; - p[y1] = p[y1] - shiftFactor; - - return p; - }, - - collide: function collide(x, y, size, angle, translation, edgeWidth, padding) { - var triPts = pointsToArr(transformPoints(this.points, size + 2 * padding, angle, translation)); - var teePts = pointsToArr(transformPoints(this.crossLinePts(size, edgeWidth), size + 2 * padding, angle, translation)); - var inside = math.pointInsidePolygonPoints(x, y, triPts) || math.pointInsidePolygonPoints(x, y, teePts); - - return inside; - }, - - draw: function draw(context, size, angle, translation, edgeWidth) { - var triPts = transformPoints(this.points, size, angle, translation); - var crossLinePts = transformPoints(this.crossLinePts(size, edgeWidth), size, angle, translation); - - renderer.arrowShapeImpl(this.name)(context, triPts, crossLinePts); - } - }); - - defineArrowShape('vee', { - points: [-0.15, -0.3, 0, 0, 0.15, -0.3, 0, -0.15], - - gap: function gap(edge) { - return standardGap(edge) * 0.525; - } - }); - - defineArrowShape('circle', { - radius: 0.15, - - collide: function collide(x, y, size, angle, translation, edgeWidth, padding) { - var t = translation; - var inside = Math.pow(t.x - x, 2) + Math.pow(t.y - y, 2) <= Math.pow((size + 2 * padding) * this.radius, 2); - - return inside; - }, - - draw: function draw(context, size, angle, translation, edgeWidth) { - renderer.arrowShapeImpl(this.name)(context, translation.x, translation.y, this.radius * size); - }, - - spacing: function spacing(edge) { - return renderer.getArrowWidth(edge.pstyle('width').pfValue, edge.pstyle('arrow-scale').value) * this.radius; - } - }); - - defineArrowShape('tee', { - points: [-0.15, 0, -0.15, -0.1, 0.15, -0.1, 0.15, 0], - - spacing: function spacing(edge) { - return 1; - }, - - gap: function gap(edge) { - return 1; - } - }); - - defineArrowShape('square', { - points: [-0.15, 0.00, 0.15, 0.00, 0.15, -0.3, -0.15, -0.3] - }); - - defineArrowShape('diamond', { - points: [-0.15, -0.15, 0, -0.3, 0.15, -0.15, 0, 0], - - gap: function gap(edge) { - return edge.pstyle('width').pfValue * edge.pstyle('arrow-scale').value; - } - }); -}; - -module.exports = BRp; - -/***/ }), -/* 109 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); - -var BRp = {}; - -[__webpack_require__(110), __webpack_require__(111), __webpack_require__(112), __webpack_require__(113), __webpack_require__(114), __webpack_require__(115), __webpack_require__(116), __webpack_require__(117), __webpack_require__(118)].forEach(function (props) { - util.extend(BRp, props); -}); - -module.exports = BRp; - -/***/ }), -/* 110 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var window = __webpack_require__(3); -var math = __webpack_require__(2); -var util = __webpack_require__(1); -var window = __webpack_require__(3); - -var BRp = {}; - -// Project mouse -BRp.projectIntoViewport = function (clientX, clientY) { - var cy = this.cy; - var offsets = this.findContainerClientCoords(); - var offsetLeft = offsets[0]; - var offsetTop = offsets[1]; - var scale = offsets[4]; - var pan = cy.pan(); - var zoom = cy.zoom(); - - var x = ((clientX - offsetLeft) / scale - pan.x) / zoom; - var y = ((clientY - offsetTop) / scale - pan.y) / zoom; - - return [x, y]; -}; - -BRp.findContainerClientCoords = function () { - if (this.containerBB) { - return this.containerBB; - } - - var container = this.container; - var rect = container.getBoundingClientRect(); - var style = window.getComputedStyle(container); - var styleValue = function styleValue(name) { - return parseFloat(style.getPropertyValue(name)); - }; - - var padding = { - left: styleValue('padding-left'), - right: styleValue('padding-right'), - top: styleValue('padding-top'), - bottom: styleValue('padding-bottom') - }; - - var border = { - left: styleValue('border-left-width'), - right: styleValue('border-right-width'), - top: styleValue('border-top-width'), - bottom: styleValue('border-bottom-width') - }; - - var clientWidth = container.clientWidth; - var clientHeight = container.clientHeight; - - var paddingHor = padding.left + padding.right; - var paddingVer = padding.top + padding.bottom; - - var borderHor = border.left + border.right; - var borderVer = border.top + border.bottom; - - var scale = rect.width / (clientWidth + borderHor); - - var unscaledW = clientWidth - paddingHor; - var unscaledH = clientHeight - paddingVer; - - var scaledW = rect.width - (paddingHor + borderHor) * scale; - var scaledH = rect.height - (paddingVer + borderVer) * scale; - - var left = rect.left + padding.left + border.left; - var top = rect.top + padding.top + border.top; - - return this.containerBB = [left, top, unscaledW, unscaledH, scale]; -}; - -BRp.invalidateContainerClientCoordsCache = function () { - this.containerBB = null; -}; - -BRp.findNearestElement = function (x, y, interactiveElementsOnly, isTouch) { - return this.findNearestElements(x, y, interactiveElementsOnly, isTouch)[0]; -}; - -BRp.findNearestElements = function (x, y, interactiveElementsOnly, isTouch) { - var self = this; - var r = this; - var eles = r.getCachedZSortedEles(); - var near = []; // 1 node max, 1 edge max - var zoom = r.cy.zoom(); - var hasCompounds = r.cy.hasCompoundNodes(); - var edgeThreshold = (isTouch ? 24 : 8) / zoom; - var nodeThreshold = (isTouch ? 8 : 2) / zoom; - var labelThreshold = (isTouch ? 8 : 2) / zoom; - var minSqDist = Infinity; - var nearEdge; - var nearNode; - - if (interactiveElementsOnly) { - eles = eles.interactive; - } - - function addEle(ele, sqDist) { - if (ele.isNode()) { - if (nearNode) { - return; // can't replace node - } else { - nearNode = ele; - near.push(ele); - } - } - - if (ele.isEdge() && (sqDist == null || sqDist < minSqDist)) { - if (nearEdge) { - // then replace existing edge - // can replace only if same z-index - if (nearEdge.pstyle('z-index').value === ele.pstyle('z-index').value) { - for (var i = 0; i < near.length; i++) { - if (near[i].isEdge()) { - near[i] = ele; - nearEdge = ele; - minSqDist = sqDist != null ? sqDist : minSqDist; - break; - } - } - } - } else { - near.push(ele); - nearEdge = ele; - minSqDist = sqDist != null ? sqDist : minSqDist; - } - } - } - - function checkNode(node) { - var width = node.outerWidth() + 2 * nodeThreshold; - var height = node.outerHeight() + 2 * nodeThreshold; - var hw = width / 2; - var hh = height / 2; - var pos = node.position(); - - if (pos.x - hw <= x && x <= pos.x + hw // bb check x - && pos.y - hh <= y && y <= pos.y + hh // bb check y - ) { - var shape = r.nodeShapes[self.getNodeShape(node)]; - - if (shape.checkPoint(x, y, 0, width, height, pos.x, pos.y)) { - addEle(node, 0); - return true; - } - } - } - - function checkEdge(edge) { - var _p = edge._private; - - var rs = _p.rscratch; - var styleWidth = edge.pstyle('width').pfValue; - var scale = edge.pstyle('arrow-scale').value; - var width = styleWidth / 2 + edgeThreshold; // more like a distance radius from centre - var widthSq = width * width; - var width2 = width * 2; - var src = _p.source; - var tgt = _p.target; - var inEdgeBB = false; - var sqDist; - - if (rs.edgeType === 'segments' || rs.edgeType === 'straight' || rs.edgeType === 'haystack') { - var pts = rs.allpts; - - for (var i = 0; i + 3 < pts.length; i += 2) { - if ((inEdgeBB = math.inLineVicinity(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3], width2)) && widthSq > (sqDist = math.sqdistToFiniteLine(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3]))) { - addEle(edge, sqDist); - return true; - } - } - } else if (rs.edgeType === 'bezier' || rs.edgeType === 'multibezier' || rs.edgeType === 'self' || rs.edgeType === 'compound') { - var pts = rs.allpts; - for (var i = 0; i + 5 < rs.allpts.length; i += 4) { - if ((inEdgeBB = math.inBezierVicinity(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3], pts[i + 4], pts[i + 5], width2)) && widthSq > (sqDist = math.sqdistToQuadraticBezier(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3], pts[i + 4], pts[i + 5]))) { - addEle(edge, sqDist); - return true; - } - } - } - - // if we're close to the edge but didn't hit it, maybe we hit its arrows - - var src = src || _p.source; - var tgt = tgt || _p.target; - - var arSize = self.getArrowWidth(styleWidth, scale); - - var arrows = [{ name: 'source', x: rs.arrowStartX, y: rs.arrowStartY, angle: rs.srcArrowAngle }, { name: 'target', x: rs.arrowEndX, y: rs.arrowEndY, angle: rs.tgtArrowAngle }, { name: 'mid-source', x: rs.midX, y: rs.midY, angle: rs.midsrcArrowAngle }, { name: 'mid-target', x: rs.midX, y: rs.midY, angle: rs.midtgtArrowAngle }]; - - for (var i = 0; i < arrows.length; i++) { - var ar = arrows[i]; - var shape = r.arrowShapes[edge.pstyle(ar.name + '-arrow-shape').value]; - var edgeWidth = edge.pstyle('width').pfValue; - if (shape.roughCollide(x, y, arSize, ar.angle, { x: ar.x, y: ar.y }, edgeWidth, edgeThreshold) && shape.collide(x, y, arSize, ar.angle, { x: ar.x, y: ar.y }, edgeWidth, edgeThreshold)) { - addEle(edge); - return true; - } - } - - // for compound graphs, hitting edge may actually want a connected node instead (b/c edge may have greater z-index precedence) - if (hasCompounds && near.length > 0) { - checkNode(src); - checkNode(tgt); - } - } - - function preprop(obj, name, pre) { - return util.getPrefixedProperty(obj, name, pre); - } - - function checkLabel(ele, prefix) { - var _p = ele._private; - var th = labelThreshold; - - var prefixDash; - if (prefix) { - prefixDash = prefix + '-'; - } else { - prefixDash = ''; - } - - var text = ele.pstyle(prefixDash + 'label').value; - var eventsEnabled = ele.pstyle('text-events').strValue === 'yes'; - - if (!eventsEnabled || !text) { - return; - } - - var rstyle = _p.rstyle; - var bw = ele.pstyle('text-border-width').pfValue; - var pw = ele.pstyle('text-background-padding').pfValue; - var lw = preprop(rstyle, 'labelWidth', prefix) + bw + 2 * th + 2 * pw; - var lh = preprop(rstyle, 'labelHeight', prefix) + bw + 2 * th + 2 * pw; - var lx = preprop(rstyle, 'labelX', prefix); - var ly = preprop(rstyle, 'labelY', prefix); - - var theta = preprop(_p.rscratch, 'labelAngle', prefix); - - var lx1 = lx - lw / 2; - var lx2 = lx + lw / 2; - var ly1 = ly - lh / 2; - var ly2 = ly + lh / 2; - - if (theta) { - var cos = Math.cos(theta); - var sin = Math.sin(theta); - - var rotate = function rotate(x, y) { - x = x - lx; - y = y - ly; - - return { - x: x * cos - y * sin + lx, - y: x * sin + y * cos + ly - }; - }; - - var px1y1 = rotate(lx1, ly1); - var px1y2 = rotate(lx1, ly2); - var px2y1 = rotate(lx2, ly1); - var px2y2 = rotate(lx2, ly2); - - var points = [px1y1.x, px1y1.y, px2y1.x, px2y1.y, px2y2.x, px2y2.y, px1y2.x, px1y2.y]; - - if (math.pointInsidePolygonPoints(x, y, points)) { - addEle(ele); - return true; - } - } else { - // do a cheaper bb check - var bb = { - w: lw, - h: lh, - x1: lx1, - x2: lx2, - y1: ly1, - y2: ly2 - }; - - if (math.inBoundingBox(bb, x, y)) { - addEle(ele); - return true; - } - } - } - - for (var i = eles.length - 1; i >= 0; i--) { - // reverse order for precedence - var ele = eles[i]; - - if (ele.isNode()) { - checkNode(ele) || checkLabel(ele); - } else { - // then edge - checkEdge(ele) || checkLabel(ele) || checkLabel(ele, 'source') || checkLabel(ele, 'target'); - } - } - - return near; -}; - -// 'Give me everything from this box' -BRp.getAllInBox = function (x1, y1, x2, y2) { - var eles = this.getCachedZSortedEles().interactive; - var box = []; - - var x1c = Math.min(x1, x2); - var x2c = Math.max(x1, x2); - var y1c = Math.min(y1, y2); - var y2c = Math.max(y1, y2); - - x1 = x1c; - x2 = x2c; - y1 = y1c; - y2 = y2c; - - var boxBb = math.makeBoundingBox({ - x1: x1, y1: y1, - x2: x2, y2: y2 - }); - - for (var e = 0; e < eles.length; e++) { - var ele = eles[e]; - - if (ele.isNode()) { - var node = ele; - var nodeBb = node.boundingBox({ - includeNodes: true, - includeEdges: false, - includeLabels: false - }); - - if (math.boundingBoxesIntersect(boxBb, nodeBb) && !math.boundingBoxInBoundingBox(nodeBb, boxBb)) { - box.push(node); - } - } else { - var edge = ele; - var _p = edge._private; - var rs = _p.rscratch; - - if (rs.startX != null && rs.startY != null && !math.inBoundingBox(boxBb, rs.startX, rs.startY)) { - continue; - } - if (rs.endX != null && rs.endY != null && !math.inBoundingBox(boxBb, rs.endX, rs.endY)) { - continue; - } - - if (rs.edgeType === 'bezier' || rs.edgeType === 'multibezier' || rs.edgeType === 'self' || rs.edgeType === 'compound' || rs.edgeType === 'segments' || rs.edgeType === 'haystack') { - - var pts = _p.rstyle.bezierPts || _p.rstyle.linePts || _p.rstyle.haystackPts; - var allInside = true; - - for (var i = 0; i < pts.length; i++) { - if (!math.pointInBoundingBox(boxBb, pts[i])) { - allInside = false; - break; - } - } - - if (allInside) { - box.push(edge); - } - } else if (rs.edgeType === 'haystack' || rs.edgeType === 'straight') { - box.push(edge); - } - } - } - - return box; -}; - -module.exports = BRp; - -/***/ }), -/* 111 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var math = __webpack_require__(2); - -var BRp = {}; - -BRp.calculateArrowAngles = function (edge) { - var rs = edge._private.rscratch; - var isHaystack = rs.edgeType === 'haystack'; - var isBezier = rs.edgeType === 'bezier'; - var isMultibezier = rs.edgeType === 'multibezier'; - var isSegments = rs.edgeType === 'segments'; - var isCompound = rs.edgeType === 'compound'; - var isSelf = rs.edgeType === 'self'; - - // Displacement gives direction for arrowhead orientation - var dispX, dispY; - var startX, startY, endX, endY, midX, midY; - - if (isHaystack) { - startX = rs.haystackPts[0]; - startY = rs.haystackPts[1]; - endX = rs.haystackPts[2]; - endY = rs.haystackPts[3]; - } else { - startX = rs.arrowStartX; - startY = rs.arrowStartY; - endX = rs.arrowEndX; - endY = rs.arrowEndY; - } - - midX = rs.midX; - midY = rs.midY; - - // source - // - - if (isSegments) { - dispX = startX - rs.segpts[0]; - dispY = startY - rs.segpts[1]; - } else if (isMultibezier || isCompound || isSelf || isBezier) { - var pts = rs.allpts; - var bX = math.qbezierAt(pts[0], pts[2], pts[4], 0.1); - var bY = math.qbezierAt(pts[1], pts[3], pts[5], 0.1); - - dispX = startX - bX; - dispY = startY - bY; - } else { - dispX = startX - midX; - dispY = startY - midY; - } - - rs.srcArrowAngle = math.getAngleFromDisp(dispX, dispY); - - // mid target - // - - var midX = rs.midX; - var midY = rs.midY; - - if (isHaystack) { - midX = (startX + endX) / 2; - midY = (startY + endY) / 2; - } - - dispX = endX - startX; - dispY = endY - startY; - - if (isSegments) { - var pts = rs.allpts; - - if (pts.length / 2 % 2 === 0) { - var i2 = pts.length / 2; - var i1 = i2 - 2; - - dispX = pts[i2] - pts[i1]; - dispY = pts[i2 + 1] - pts[i1 + 1]; - } else { - var i2 = pts.length / 2 - 1; - var i1 = i2 - 2; - var i3 = i2 + 2; - - dispX = pts[i2] - pts[i1]; - dispY = pts[i2 + 1] - pts[i1 + 1]; - } - } else if (isMultibezier || isCompound || isSelf) { - var pts = rs.allpts; - var cpts = rs.ctrlpts; - var bp0x, bp0y; - var bp1x, bp1y; - - if (cpts.length / 2 % 2 === 0) { - var p0 = pts.length / 2 - 1; // startpt - var ic = p0 + 2; - var p1 = ic + 2; - - bp0x = math.qbezierAt(pts[p0], pts[ic], pts[p1], 0.0); - bp0y = math.qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.0); - - bp1x = math.qbezierAt(pts[p0], pts[ic], pts[p1], 0.0001); - bp1y = math.qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.0001); - } else { - var ic = pts.length / 2 - 1; // ctrpt - var p0 = ic - 2; // startpt - var p1 = ic + 2; // endpt - - bp0x = math.qbezierAt(pts[p0], pts[ic], pts[p1], 0.4999); - bp0y = math.qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.4999); - - bp1x = math.qbezierAt(pts[p0], pts[ic], pts[p1], 0.5); - bp1y = math.qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.5); - } - - dispX = bp1x - bp0x; - dispY = bp1y - bp0y; - } - - rs.midtgtArrowAngle = math.getAngleFromDisp(dispX, dispY); - - rs.midDispX = dispX; - rs.midDispY = dispY; - - // mid source - // - - dispX *= -1; - dispY *= -1; - - if (isSegments) { - var pts = rs.allpts; - - if (pts.length / 2 % 2 === 0) { - // already ok - } else { - var i2 = pts.length / 2 - 1; - var i3 = i2 + 2; - - dispX = -(pts[i3] - pts[i2]); - dispY = -(pts[i3 + 1] - pts[i2 + 1]); - } - } - - rs.midsrcArrowAngle = math.getAngleFromDisp(dispX, dispY); - - // target - // - - if (isSegments) { - dispX = endX - rs.segpts[rs.segpts.length - 2]; - dispY = endY - rs.segpts[rs.segpts.length - 1]; - } else if (isMultibezier || isCompound || isSelf || isBezier) { - var pts = rs.allpts; - var l = pts.length; - var bX = math.qbezierAt(pts[l - 6], pts[l - 4], pts[l - 2], 0.9); - var bY = math.qbezierAt(pts[l - 5], pts[l - 3], pts[l - 1], 0.9); - - dispX = endX - bX; - dispY = endY - bY; - } else { - dispX = endX - midX; - dispY = endY - midY; - } - - rs.tgtArrowAngle = math.getAngleFromDisp(dispX, dispY); -}; - -BRp.getArrowWidth = BRp.getArrowHeight = function (edgeWidth, scale) { - var cache = this.arrowWidthCache = this.arrowWidthCache || {}; - - var cachedVal = cache[edgeWidth + ', ' + scale]; - if (cachedVal) { - return cachedVal; - } - - cachedVal = Math.max(Math.pow(edgeWidth * 13.37, 0.9), 29) * scale; - cache[edgeWidth + ', ' + scale] = cachedVal; - - return cachedVal; -}; - -module.exports = BRp; - -/***/ }), -/* 112 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var math = __webpack_require__(2); -var is = __webpack_require__(0); - -var BRp = {}; - -BRp.findEdgeControlPoints = function (edges) { - if (!edges || edges.length === 0) { - return; - } - - var r = this; - var cy = r.cy; - var hasCompounds = cy.hasCompoundNodes(); - var hashTable = {}; - var pairIds = []; - var haystackEdges = []; - - // create a table of edge (src, tgt) => list of edges between them - var pairId; - for (var i = 0; i < edges.length; i++) { - var edge = edges[i]; - var _p = edge._private; - var data = _p.data; - var curveStyle = edge.pstyle('curve-style').value; - var edgeIsUnbundled = curveStyle === 'unbundled-bezier' || curveStyle === 'segments'; - var edgeIsBezier = curveStyle === 'unbundled-bezier' || curveStyle === 'bezier'; - - // ignore edges who are not to be displayed - // they shouldn't take up space - if (edge.pstyle('display').value === 'none') { - continue; - } - - if (curveStyle === 'haystack') { - haystackEdges.push(edge); - continue; - } - - var srcId = data.source; - var tgtId = data.target; - - pairId = srcId > tgtId ? tgtId + '$-$' + srcId : srcId + '$-$' + tgtId; - - if (edgeIsUnbundled) { - pairId = 'unbundled' + '$-$' + data.id; - } - - var tableEntry = hashTable[pairId]; - - if (tableEntry == null) { - tableEntry = hashTable[pairId] = []; - pairIds.push(pairId); - } - - tableEntry.push(edge); - - if (edgeIsUnbundled) { - tableEntry.hasUnbundled = true; - } - - if (edgeIsBezier) { - tableEntry.hasBezier = true; - } - } - - var src, tgt, srcPos, tgtPos, srcW, srcH, tgtW, tgtH, srcShape, tgtShape; - var vectorNormInverse; - var badBezier; - - // for each pair (src, tgt), create the ctrl pts - // Nested for loop is OK; total number of iterations for both loops = edgeCount - for (var p = 0; p < pairIds.length; p++) { - pairId = pairIds[p]; - var pairEdges = hashTable[pairId]; - - // for each pair id, the edges should be sorted by index - pairEdges.sort(function (edge1, edge2) { - return edge1.poolIndex() - edge2.poolIndex(); - }); - - src = pairEdges[0]._private.source; - tgt = pairEdges[0]._private.target; - - // make sure src/tgt distinction is consistent for bundled edges - if (!pairEdges.hasUnbundled && src.id() > tgt.id()) { - var temp = src; - src = tgt; - tgt = temp; - } - - srcPos = src.position(); - tgtPos = tgt.position(); - - srcW = src.outerWidth(); - srcH = src.outerHeight(); - - tgtW = tgt.outerWidth(); - tgtH = tgt.outerHeight(); - - srcShape = r.nodeShapes[this.getNodeShape(src)]; - tgtShape = r.nodeShapes[this.getNodeShape(tgt)]; - - badBezier = false; - - var edge; - var edge_p; - var rs; - - var dirCounts = { - 'north': 0, - 'west': 0, - 'south': 0, - 'east': 0, - 'northwest': 0, - 'southwest': 0, - 'northeast': 0, - 'southeast': 0 - }; - - var srcX2 = srcPos.x; - var srcY2 = srcPos.y; - var srcW2 = srcW; - var srcH2 = srcH; - - var tgtX2 = tgtPos.x; - var tgtY2 = tgtPos.y; - var tgtW2 = tgtW; - var tgtH2 = tgtH; - - var numEdges2 = pairEdges.length; - - for (var i = 0; i < pairEdges.length; i++) { - edge = pairEdges[i]; - edge_p = edge._private; - rs = edge_p.rscratch; - - var edgeIndex1 = rs.lastEdgeIndex; - var edgeIndex2 = i; - - var numEdges1 = rs.lastNumEdges; - - var curveStyle = edge.pstyle('curve-style').value; - - var edgeIsUnbundled = curveStyle === 'unbundled-bezier' || curveStyle === 'segments'; - - // whether the normalised pair order is the reverse of the edge's src-tgt order - var edgeIsSwapped = src.id() !== edge.source().id(); - - var ctrlptDists = edge.pstyle('control-point-distances'); - var loopDir = edge.pstyle('loop-direction').pfValue; - var loopSwp = edge.pstyle('loop-sweep').pfValue; - var ctrlptWs = edge.pstyle('control-point-weights'); - var bezierN = ctrlptDists && ctrlptWs ? Math.min(ctrlptDists.value.length, ctrlptWs.value.length) : 1; - var stepSize = edge.pstyle('control-point-step-size').pfValue; - var ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[0] : undefined; - var ctrlptWeight = ctrlptWs.value[0]; - var edgeDistances = edge.pstyle('edge-distances').value; - var srcDistFNode = edge.pstyle('source-distance-from-node').pfValue; - var tgtDistFNode = edge.pstyle('target-distance-from-node').pfValue; - var segmentWs = edge.pstyle('segment-weights'); - var segmentDs = edge.pstyle('segment-distances'); - var segmentsN = Math.min(segmentWs.pfValue.length, segmentDs.pfValue.length); - var srcEndpt = edge.pstyle('source-endpoint').value; - var tgtEndpt = edge.pstyle('target-endpoint').value; - var srcArrShape = edge.pstyle('source-arrow-shape').value; - var tgtArrShape = edge.pstyle('target-arrow-shape').value; - var arrowScale = edge.pstyle('arrow-scale').value; - var lineWidth = edge.pstyle('width').pfValue; - - var srcX1 = rs.lastSrcCtlPtX; - var srcY1 = rs.lastSrcCtlPtY; - var srcW1 = rs.lastSrcCtlPtW; - var srcH1 = rs.lastSrcCtlPtH; - - var tgtX1 = rs.lastTgtCtlPtX; - var tgtY1 = rs.lastTgtCtlPtY; - var tgtW1 = rs.lastTgtCtlPtW; - var tgtH1 = rs.lastTgtCtlPtH; - - var curveStyle1 = rs.lastCurveStyle; - var curveStyle2 = curveStyle; - - var ctrlptDists1 = rs.lastCtrlptDists; - var ctrlptDists2 = ctrlptDists ? ctrlptDists.strValue : null; - - var ctrlptWs1 = rs.lastCtrlptWs; - var ctrlptWs2 = ctrlptWs.strValue; - - var segmentWs1 = rs.lastSegmentWs; - var segmentWs2 = segmentWs.strValue; - - var segmentDs1 = rs.lastSegmentDs; - var segmentDs2 = segmentDs.strValue; - - var stepSize1 = rs.lastStepSize; - var stepSize2 = stepSize; - - var loopDir1 = rs.lastLoopDir; - var loopDir2 = loopDir; - - var loopSwp1 = rs.lastLoopSwp; - var loopSwp2 = loopSwp; - - var edgeDistances1 = rs.lastEdgeDistances; - var edgeDistances2 = edgeDistances; - - var srcDistFNode1 = rs.lastSrcDistFNode; - var srcDistFNode2 = srcDistFNode; - - var tgtDistFNode1 = rs.lastTgtDistFNode; - var tgtDistFNode2 = tgtDistFNode; - - var srcEndpt1 = rs.lastSrcEndpt; - var srcEndpt2 = srcEndpt; - - var tgtEndpt1 = rs.lastTgtEndpt; - var tgtEndpt2 = tgtEndpt; - - var srcArr1 = rs.lastSrcArr; - var srcArr2 = srcArrShape; - - var tgtArr1 = rs.lastTgtArr; - var tgtArr2 = tgtArrShape; - - var lineW1 = rs.lastLineW; - var lineW2 = lineWidth; - - var arrScl1 = rs.lastArrScl; - var arrScl2 = arrowScale; - - if (badBezier) { - rs.badBezier = true; - } else { - rs.badBezier = false; - } - - var ptCacheHit; - - if (srcX1 === srcX2 && srcY1 === srcY2 && srcW1 === srcW2 && srcH1 === srcH2 && tgtX1 === tgtX2 && tgtY1 === tgtY2 && tgtW1 === tgtW2 && tgtH1 === tgtH2 && curveStyle1 === curveStyle2 && ctrlptDists1 === ctrlptDists2 && ctrlptWs1 === ctrlptWs2 && segmentWs1 === segmentWs2 && segmentDs1 === segmentDs2 && stepSize1 === stepSize2 && loopDir1 === loopDir2 && loopSwp1 === loopSwp2 && edgeDistances1 === edgeDistances2 && srcDistFNode1 === srcDistFNode2 && tgtDistFNode1 === tgtDistFNode2 && srcEndpt1 === srcEndpt2 && tgtEndpt1 === tgtEndpt2 && srcArr1 === srcArr2 && tgtArr1 === tgtArr2 && lineW1 === lineW2 && arrScl1 === arrScl2 && (edgeIndex1 === edgeIndex2 && numEdges1 === numEdges2 || edgeIsUnbundled)) { - ptCacheHit = true; // then the control points haven't changed and we can skip calculating them - } else { - ptCacheHit = false; - - rs.lastSrcCtlPtX = srcX2; - rs.lastSrcCtlPtY = srcY2; - rs.lastSrcCtlPtW = srcW2; - rs.lastSrcCtlPtH = srcH2; - rs.lastTgtCtlPtX = tgtX2; - rs.lastTgtCtlPtY = tgtY2; - rs.lastTgtCtlPtW = tgtW2; - rs.lastTgtCtlPtH = tgtH2; - rs.lastEdgeIndex = edgeIndex2; - rs.lastNumEdges = numEdges2; - rs.lastCurveStyle = curveStyle2; - rs.lastCtrlptDists = ctrlptDists2; - rs.lastCtrlptWs = ctrlptWs2; - rs.lastSegmentDs = segmentDs2; - rs.lastSegmentWs = segmentWs2; - rs.lastStepSize = stepSize2; - rs.lastLoopDir = loopDir2; - rs.lastLoopSwp = loopSwp2; - rs.lastEdgeDistances = edgeDistances2; - rs.lastSrcDistFNode = srcDistFNode2; - rs.lastTgtDistFNode = tgtDistFNode2; - rs.lastSrcEndpt = srcEndpt2; - rs.lastTgtEndpt = tgtEndpt2; - rs.lastSrcArr = srcArr2; - rs.lastTgtArr = tgtArr2; - rs.lastLineW = lineW2; - rs.lastArrScl = arrScl2; - } - - if (!ptCacheHit) { - - if (!pairEdges.calculatedIntersection && src !== tgt && (pairEdges.hasBezier || pairEdges.hasUnbundled)) { - - pairEdges.calculatedIntersection = true; - - // pt outside src shape to calc distance/displacement from src to tgt - var srcOutside = srcShape.intersectLine(srcPos.x, srcPos.y, srcW, srcH, tgtPos.x, tgtPos.y, 0); - - pairEdges.srcIntn = srcOutside; - - // pt outside tgt shape to calc distance/displacement from src to tgt - var tgtOutside = tgtShape.intersectLine(tgtPos.x, tgtPos.y, tgtW, tgtH, srcPos.x, srcPos.y, 0); - - pairEdges.tgtIntn = tgtOutside; - - var midptSrcPts = { - x1: srcOutside[0], - x2: tgtOutside[0], - y1: srcOutside[1], - y2: tgtOutside[1] - }; - - var posPts = { - x1: srcPos.x, - x2: tgtPos.x, - y1: srcPos.y, - y2: tgtPos.y - }; - - var dy = tgtOutside[1] - srcOutside[1]; - var dx = tgtOutside[0] - srcOutside[0]; - var l = Math.sqrt(dx * dx + dy * dy); - - var vector = { - x: dx, - y: dy - }; - - var vectorNorm = { - x: vector.x / l, - y: vector.y / l - }; - vectorNormInverse = { - x: -vectorNorm.y, - y: vectorNorm.x - }; - - // if node shapes overlap, then no ctrl pts to draw - if (tgtShape.checkPoint(srcOutside[0], srcOutside[1], 0, tgtW, tgtH, tgtPos.x, tgtPos.y) && srcShape.checkPoint(tgtOutside[0], tgtOutside[1], 0, srcW, srcH, srcPos.x, srcPos.y)) { - vectorNormInverse = {}; - badBezier = true; - } - } - - if (!edgeIsSwapped) { - rs.srcIntn = pairEdges.srcIntn; - rs.tgtIntn = pairEdges.tgtIntn; - } else { - // ensure that the per-edge cached value for intersections are correct for swapped bundled edges - rs.srcIntn = pairEdges.tgtIntn; - rs.tgtIntn = pairEdges.srcIntn; - } - - if (src === tgt) { - // Self-edge - - rs.edgeType = 'self'; - - var j = i; - var loopDist = stepSize; - - if (edgeIsUnbundled) { - j = 0; - loopDist = ctrlptDist; - } - - var loopAngle = loopDir - Math.PI / 2; - var outAngle = loopAngle - loopSwp / 2; - var inAngle = loopAngle + loopSwp / 2; - - // increase by step size for overlapping loops, keyed on direction and sweep values - var dc = String(loopDir + '_' + loopSwp); - j = dirCounts[dc] === undefined ? dirCounts[dc] = 0 : ++dirCounts[dc]; - - rs.ctrlpts = [srcPos.x + Math.cos(outAngle) * 1.4 * loopDist * (j / 3 + 1), srcPos.y + Math.sin(outAngle) * 1.4 * loopDist * (j / 3 + 1), srcPos.x + Math.cos(inAngle) * 1.4 * loopDist * (j / 3 + 1), srcPos.y + Math.sin(inAngle) * 1.4 * loopDist * (j / 3 + 1)]; - } else if (hasCompounds && (src.isParent() || src.isChild() || tgt.isParent() || tgt.isChild()) && (src.parents().anySame(tgt) || tgt.parents().anySame(src))) { - // Compound edge - - rs.edgeType = 'compound'; - - // because the line approximation doesn't apply for compound beziers - // (loop/self edges are already elided b/c of cheap src==tgt check) - rs.badBezier = false; - - var j = i; - var loopDist = stepSize; - - if (edgeIsUnbundled) { - j = 0; - loopDist = ctrlptDist; - } - - var loopW = 50; - - var loopaPos = { - x: srcPos.x - srcW / 2, - y: srcPos.y - srcH / 2 - }; - - var loopbPos = { - x: tgtPos.x - tgtW / 2, - y: tgtPos.y - tgtH / 2 - }; - - var loopPos = { - x: Math.min(loopaPos.x, loopbPos.x), - y: Math.min(loopaPos.y, loopbPos.y) - }; - - // avoids cases with impossible beziers - var minCompoundStretch = 0.5; - var compoundStretchA = Math.max(minCompoundStretch, Math.log(srcW * 0.01)); - var compoundStretchB = Math.max(minCompoundStretch, Math.log(tgtW * 0.01)); - - rs.ctrlpts = [loopPos.x, loopPos.y - (1 + Math.pow(loopW, 1.12) / 100) * loopDist * (j / 3 + 1) * compoundStretchA, loopPos.x - (1 + Math.pow(loopW, 1.12) / 100) * loopDist * (j / 3 + 1) * compoundStretchB, loopPos.y]; - } else if (curveStyle === 'segments') { - // Segments (multiple straight lines) - - rs.edgeType = 'segments'; - rs.segpts = []; - - for (var s = 0; s < segmentsN; s++) { - var w = segmentWs.pfValue[s]; - var d = segmentDs.pfValue[s]; - - var w1 = 1 - w; - var w2 = w; - - var midptPts = edgeDistances === 'node-position' ? posPts : midptSrcPts; - - var adjustedMidpt = { - x: midptPts.x1 * w1 + midptPts.x2 * w2, - y: midptPts.y1 * w1 + midptPts.y2 * w2 - }; - - rs.segpts.push(adjustedMidpt.x + vectorNormInverse.x * d, adjustedMidpt.y + vectorNormInverse.y * d); - } - - // Straight edge - } else if (pairEdges.length % 2 === 1 && i === Math.floor(pairEdges.length / 2) && !edgeIsUnbundled) { - - rs.edgeType = 'straight'; - } else { - // (Multi)bezier - - var multi = edgeIsUnbundled; - - rs.edgeType = multi ? 'multibezier' : 'bezier'; - rs.ctrlpts = []; - - for (var b = 0; b < bezierN; b++) { - var normctrlptDist = (0.5 - pairEdges.length / 2 + i) * stepSize; - var manctrlptDist; - var sign = math.signum(normctrlptDist); - - if (multi) { - ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[b] : stepSize; // fall back on step size - ctrlptWeight = ctrlptWs.value[b]; - } - - if (edgeIsUnbundled) { - // multi or single unbundled - manctrlptDist = ctrlptDist; - } else { - manctrlptDist = ctrlptDist !== undefined ? sign * ctrlptDist : undefined; - } - - var distanceFromMidpoint = manctrlptDist !== undefined ? manctrlptDist : normctrlptDist; - - var w1 = 1 - ctrlptWeight; - var w2 = ctrlptWeight; - - if (edgeIsSwapped) { - var temp = w1; - w1 = w2; - w2 = temp; - } - - var midptPts = edgeDistances === 'node-position' ? posPts : midptSrcPts; - - var adjustedMidpt = { - x: midptPts.x1 * w1 + midptPts.x2 * w2, - y: midptPts.y1 * w1 + midptPts.y2 * w2 - }; - - rs.ctrlpts.push(adjustedMidpt.x + vectorNormInverse.x * distanceFromMidpoint, adjustedMidpt.y + vectorNormInverse.y * distanceFromMidpoint); - } - } - - // find endpts for edge - this.findEndpoints(edge); - - var badStart = !is.number(rs.startX) || !is.number(rs.startY); - var badAStart = !is.number(rs.arrowStartX) || !is.number(rs.arrowStartY); - var badEnd = !is.number(rs.endX) || !is.number(rs.endY); - var badAEnd = !is.number(rs.arrowEndX) || !is.number(rs.arrowEndY); - - var minCpADistFactor = 3; - var arrowW = this.getArrowWidth(edge.pstyle('width').pfValue, edge.pstyle('arrow-scale').value) * this.arrowShapeWidth; - var minCpADist = minCpADistFactor * arrowW; - - if (rs.edgeType === 'bezier') { - var startACpDist = math.dist({ x: rs.ctrlpts[0], y: rs.ctrlpts[1] }, { x: rs.startX, y: rs.startY }); - var closeStartACp = startACpDist < minCpADist; - var endACpDist = math.dist({ x: rs.ctrlpts[0], y: rs.ctrlpts[1] }, { x: rs.endX, y: rs.endY }); - var closeEndACp = endACpDist < minCpADist; - - var overlapping = false; - - if (badStart || badAStart || closeStartACp) { - overlapping = true; - - // project control point along line from src centre to outside the src shape - // (otherwise intersection will yield nothing) - var cpD = { // delta - x: rs.ctrlpts[0] - srcPos.x, - y: rs.ctrlpts[1] - srcPos.y - }; - var cpL = Math.sqrt(cpD.x * cpD.x + cpD.y * cpD.y); // length of line - var cpM = { // normalised delta - x: cpD.x / cpL, - y: cpD.y / cpL - }; - var radius = Math.max(srcW, srcH); - var cpProj = { // *2 radius guarantees outside shape - x: rs.ctrlpts[0] + cpM.x * 2 * radius, - y: rs.ctrlpts[1] + cpM.y * 2 * radius - }; - - var srcCtrlPtIntn = srcShape.intersectLine(srcPos.x, srcPos.y, srcW, srcH, cpProj.x, cpProj.y, 0); - - if (closeStartACp) { - rs.ctrlpts[0] = rs.ctrlpts[0] + cpM.x * (minCpADist - startACpDist); - rs.ctrlpts[1] = rs.ctrlpts[1] + cpM.y * (minCpADist - startACpDist); - } else { - rs.ctrlpts[0] = srcCtrlPtIntn[0] + cpM.x * minCpADist; - rs.ctrlpts[1] = srcCtrlPtIntn[1] + cpM.y * minCpADist; - } - } - - if (badEnd || badAEnd || closeEndACp) { - overlapping = true; - - // project control point along line from tgt centre to outside the tgt shape - // (otherwise intersection will yield nothing) - var cpD = { // delta - x: rs.ctrlpts[0] - tgtPos.x, - y: rs.ctrlpts[1] - tgtPos.y - }; - var cpL = Math.sqrt(cpD.x * cpD.x + cpD.y * cpD.y); // length of line - var cpM = { // normalised delta - x: cpD.x / cpL, - y: cpD.y / cpL - }; - var radius = Math.max(srcW, srcH); - var cpProj = { // *2 radius guarantees outside shape - x: rs.ctrlpts[0] + cpM.x * 2 * radius, - y: rs.ctrlpts[1] + cpM.y * 2 * radius - }; - - var tgtCtrlPtIntn = tgtShape.intersectLine(tgtPos.x, tgtPos.y, tgtW, tgtH, cpProj.x, cpProj.y, 0); - - if (closeEndACp) { - rs.ctrlpts[0] = rs.ctrlpts[0] + cpM.x * (minCpADist - endACpDist); - rs.ctrlpts[1] = rs.ctrlpts[1] + cpM.y * (minCpADist - endACpDist); - } else { - rs.ctrlpts[0] = tgtCtrlPtIntn[0] + cpM.x * minCpADist; - rs.ctrlpts[1] = tgtCtrlPtIntn[1] + cpM.y * minCpADist; - } - } - - if (overlapping) { - // recalc endpts - this.findEndpoints(edge); - } - } - - if (rs.edgeType === 'multibezier' || rs.edgeType === 'bezier' || rs.edgeType === 'self' || rs.edgeType === 'compound') { - rs.allpts = []; - - rs.allpts.push(rs.startX, rs.startY); - - for (var b = 0; b + 1 < rs.ctrlpts.length; b += 2) { - // ctrl pt itself - rs.allpts.push(rs.ctrlpts[b], rs.ctrlpts[b + 1]); - - // the midpt between ctrlpts as intermediate destination pts - if (b + 3 < rs.ctrlpts.length) { - rs.allpts.push((rs.ctrlpts[b] + rs.ctrlpts[b + 2]) / 2, (rs.ctrlpts[b + 1] + rs.ctrlpts[b + 3]) / 2); - } - } - - rs.allpts.push(rs.endX, rs.endY); - - var m, mt; - if (rs.ctrlpts.length / 2 % 2 === 0) { - m = rs.allpts.length / 2 - 1; - - rs.midX = rs.allpts[m]; - rs.midY = rs.allpts[m + 1]; - } else { - m = rs.allpts.length / 2 - 3; - mt = 0.5; - - rs.midX = math.qbezierAt(rs.allpts[m], rs.allpts[m + 2], rs.allpts[m + 4], mt); - rs.midY = math.qbezierAt(rs.allpts[m + 1], rs.allpts[m + 3], rs.allpts[m + 5], mt); - } - } else if (rs.edgeType === 'straight') { - // need to calc these after endpts - rs.allpts = [rs.startX, rs.startY, rs.endX, rs.endY]; - - // default midpt for labels etc - rs.midX = (rs.startX + rs.endX + rs.arrowStartX + rs.arrowEndX) / 4; - rs.midY = (rs.startY + rs.endY + rs.arrowStartY + rs.arrowEndY) / 4; - } else if (rs.edgeType === 'segments') { - rs.allpts = []; - rs.allpts.push(rs.startX, rs.startY); - rs.allpts.push.apply(rs.allpts, rs.segpts); - rs.allpts.push(rs.endX, rs.endY); - - if (rs.segpts.length % 4 === 0) { - var i2 = rs.segpts.length / 2; - var i1 = i2 - 2; - - rs.midX = (rs.segpts[i1] + rs.segpts[i2]) / 2; - rs.midY = (rs.segpts[i1 + 1] + rs.segpts[i2 + 1]) / 2; - } else { - var i1 = rs.segpts.length / 2 - 1; - - rs.midX = rs.segpts[i1]; - rs.midY = rs.segpts[i1 + 1]; - } - } - - this.storeEdgeProjections(edge); - this.calculateArrowAngles(edge); - } // if point cache miss - - this.recalculateEdgeLabelProjections(edge); - this.calculateLabelAngles(edge); - } // for pair edges - } // for pair ids - - for (var i = 0; i < haystackEdges.length; i++) { - var edge = haystackEdges[i]; - var _p = edge._private; - var rscratch = _p.rscratch; - var rs = rscratch; - - if (!rscratch.haystack) { - var angle = Math.random() * 2 * Math.PI; - - rscratch.source = { - x: Math.cos(angle), - y: Math.sin(angle) - }; - - var angle = Math.random() * 2 * Math.PI; - - rscratch.target = { - x: Math.cos(angle), - y: Math.sin(angle) - }; - } - - var src = _p.source; - var tgt = _p.target; - var srcPos = src.position(); - var tgtPos = tgt.position(); - var srcW = src.width(); - var tgtW = tgt.width(); - var srcH = src.height(); - var tgtH = tgt.height(); - var radius = edge.pstyle('haystack-radius').value; - var halfRadius = radius / 2; // b/c have to half width/height - - rs.haystackPts = rs.allpts = [rs.source.x * srcW * halfRadius + srcPos.x, rs.source.y * srcH * halfRadius + srcPos.y, rs.target.x * tgtW * halfRadius + tgtPos.x, rs.target.y * tgtH * halfRadius + tgtPos.y]; - - rs.midX = (rs.allpts[0] + rs.allpts[2]) / 2; - rs.midY = (rs.allpts[1] + rs.allpts[3]) / 2; - - // always override as haystack in case set to different type previously - rscratch.edgeType = rscratch.lastCurveStyle = 'haystack'; - rscratch.haystack = true; - - this.storeEdgeProjections(edge); - this.calculateArrowAngles(edge); - this.recalculateEdgeLabelProjections(edge); - this.calculateLabelAngles(edge); - } -}; - -function getPts(pts) { - var retPts = []; - - if (pts == null) { - return; - } - - for (var i = 0; i < pts.length; i += 2) { - var x = pts[i]; - var y = pts[i + 1]; - - retPts.push({ x: x, y: y }); - } - - return retPts; -} - -BRp.getSegmentPoints = function (edge) { - var rs = edge[0]._private.rscratch; - var type = rs.edgeType; - - if (type === 'segments') { - return getPts(rs.segpts); - } -}; - -BRp.getControlPoints = function (edge) { - var rs = edge[0]._private.rscratch; - var type = rs.edgeType; - - if (type === 'bezier' || type === 'multibezier' || type === 'self' || type === 'compound') { - return getPts(rs.ctrlpts); - } -}; - -BRp.getEdgeMidpoint = function (edge) { - var rs = edge[0]._private.rscratch; - - return { - x: rs.midX, - y: rs.midY - }; -}; - -module.exports = BRp; - -/***/ }), -/* 113 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var math = __webpack_require__(2); -var is = __webpack_require__(0); - -var BRp = {}; - -BRp.manualEndptToPx = function (node, prop) { - var r = this; - var npos = node.position(); - var w = node.outerWidth(); - var h = node.outerHeight(); - - if (prop.value.length === 2) { - var p = [prop.pfValue[0], prop.pfValue[1]]; - - if (prop.units[0] === '%') { - p[0] = p[0] * w; - } - - if (prop.units[1] === '%') { - p[1] = p[1] * h; - } - - p[0] += npos.x; - p[1] += npos.y; - - return p; - } else { - var angle = prop.pfValue[0]; - - angle = -Math.PI / 2 + angle; // start at 12 o'clock - - var l = 2 * Math.max(w, h); - - var _p = [npos.x + Math.cos(angle) * l, npos.y + Math.sin(angle) * l]; - - return r.nodeShapes[this.getNodeShape(node)].intersectLine(npos.x, npos.y, w, h, _p[0], _p[1], 0); - } -}; - -BRp.findEndpoints = function (edge) { - var r = this; - var intersect = void 0; - - var source = edge.source()[0]; - var target = edge.target()[0]; - - var srcPos = source.position(); - var tgtPos = target.position(); - - var tgtArShape = edge.pstyle('target-arrow-shape').value; - var srcArShape = edge.pstyle('source-arrow-shape').value; - - var tgtDist = edge.pstyle('target-distance-from-node').pfValue; - var srcDist = edge.pstyle('source-distance-from-node').pfValue; - - var rs = edge._private.rscratch; - - var et = rs.edgeType; - var self = et === 'self' || et === 'compound'; - var bezier = et === 'bezier' || et === 'multibezier' || self; - var multi = et !== 'bezier'; - var lines = et === 'straight' || et === 'segments'; - var segments = et === 'segments'; - var hasEndpts = bezier || multi || lines; - var srcManEndpt = edge.pstyle('source-endpoint'); - var srcManEndptVal = self ? 'outside-to-node' : srcManEndpt.value; - var tgtManEndpt = edge.pstyle('target-endpoint'); - var tgtManEndptVal = self ? 'outside-to-node' : tgtManEndpt.value; - - rs.srcManEndpt = srcManEndpt; - rs.tgtManEndpt = tgtManEndpt; - - var p1 = void 0; // last known point of edge on target side - var p2 = void 0; // last known point of edge on source side - - var p1_i = void 0; // point to intersect with target shape - var p2_i = void 0; // point to intersect with source shape - - if (bezier) { - var cpStart = [rs.ctrlpts[0], rs.ctrlpts[1]]; - var cpEnd = multi ? [rs.ctrlpts[rs.ctrlpts.length - 2], rs.ctrlpts[rs.ctrlpts.length - 1]] : cpStart; - - p1 = cpEnd; - p2 = cpStart; - } else if (lines) { - var srcArrowFromPt = !segments ? [tgtPos.x, tgtPos.y] : rs.segpts.slice(0, 2); - var tgtArrowFromPt = !segments ? [srcPos.x, srcPos.y] : rs.segpts.slice(rs.segpts.length - 2); - - p1 = tgtArrowFromPt; - p2 = srcArrowFromPt; - } - - if (tgtManEndptVal === 'inside-to-node') { - intersect = [tgtPos.x, tgtPos.y]; - } else if (tgtManEndpt.units) { - intersect = this.manualEndptToPx(target, tgtManEndpt); - } else if (tgtManEndptVal === 'outside-to-line') { - intersect = rs.tgtIntn; // use cached value from ctrlpt calc - } else { - if (tgtManEndptVal === 'outside-to-node') { - p1_i = p1; - } else if (tgtManEndptVal === 'outside-to-line') { - p1_i = [srcPos.x, srcPos.y]; - } - - intersect = r.nodeShapes[this.getNodeShape(target)].intersectLine(tgtPos.x, tgtPos.y, target.outerWidth(), target.outerHeight(), p1_i[0], p1_i[1], 0); - } - - var arrowEnd = math.shortenIntersection(intersect, p1, r.arrowShapes[tgtArShape].spacing(edge) + tgtDist); - var edgeEnd = math.shortenIntersection(intersect, p1, r.arrowShapes[tgtArShape].gap(edge) + tgtDist); - - rs.endX = edgeEnd[0]; - rs.endY = edgeEnd[1]; - - rs.arrowEndX = arrowEnd[0]; - rs.arrowEndY = arrowEnd[1]; - - if (srcManEndptVal === 'inside-to-node') { - intersect = [srcPos.x, srcPos.y]; - } else if (srcManEndpt.units) { - intersect = this.manualEndptToPx(source, srcManEndpt); - } else if (srcManEndptVal === 'outside-to-line') { - intersect = rs.srcIntn; // use cached value from ctrlpt calc - } else { - if (srcManEndptVal === 'outside-to-node') { - p2_i = p2; - } else if (srcManEndptVal === 'outside-to-line') { - p2_i = [tgtPos.x, tgtPos.y]; - } - - intersect = r.nodeShapes[this.getNodeShape(source)].intersectLine(srcPos.x, srcPos.y, source.outerWidth(), source.outerHeight(), p2_i[0], p2_i[1], 0); - } - - var arrowStart = math.shortenIntersection(intersect, p2, r.arrowShapes[srcArShape].spacing(edge) + srcDist); - var edgeStart = math.shortenIntersection(intersect, p2, r.arrowShapes[srcArShape].gap(edge) + srcDist); - - rs.startX = edgeStart[0]; - rs.startY = edgeStart[1]; - - rs.arrowStartX = arrowStart[0]; - rs.arrowStartY = arrowStart[1]; - - if (hasEndpts) { - if (!is.number(rs.startX) || !is.number(rs.startY) || !is.number(rs.endX) || !is.number(rs.endY)) { - rs.badLine = true; - } else { - rs.badLine = false; - } - } -}; - -BRp.getSourceEndpoint = function (edge) { - var rs = edge[0]._private.rscratch; - - switch (rs.edgeType) { - case 'haystack': - return { - x: rs.haystackPts[0], - y: rs.haystackPts[1] - }; - default: - return { - x: rs.arrowStartX, - y: rs.arrowStartY - }; - } -}; - -BRp.getTargetEndpoint = function (edge) { - var rs = edge[0]._private.rscratch; - - switch (rs.edgeType) { - case 'haystack': - return { - x: rs.haystackPts[2], - y: rs.haystackPts[3] - }; - default: - return { - x: rs.arrowEndX, - y: rs.arrowEndY - }; - } -}; - -module.exports = BRp; - -/***/ }), -/* 114 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var math = __webpack_require__(2); - -var BRp = {}; - -function pushBezierPts(r, edge, pts) { - var qbezierAt = function qbezierAt(p1, p2, p3, t) { - return math.qbezierAt(p1, p2, p3, t); - }; - var _p = edge._private; - var bpts = _p.rstyle.bezierPts; - - for (var i = 0; i < r.bezierProjPcts.length; i++) { - var p = r.bezierProjPcts[i]; - - bpts.push({ - x: qbezierAt(pts[0], pts[2], pts[4], p), - y: qbezierAt(pts[1], pts[3], pts[5], p) - }); - } -} - -BRp.storeEdgeProjections = function (edge) { - var _p = edge._private; - var rs = _p.rscratch; - var et = rs.edgeType; - - // clear the cached points state - _p.rstyle.bezierPts = null; - _p.rstyle.linePts = null; - _p.rstyle.haystackPts = null; - - if (et === 'multibezier' || et === 'bezier' || et === 'self' || et === 'compound') { - var bpts = _p.rstyle.bezierPts = []; // jshint ignore:line - - for (var i = 0; i + 5 < rs.allpts.length; i += 4) { - pushBezierPts(this, edge, rs.allpts.slice(i, i + 6)); - } - } else if (et === 'segments') { - var lpts = _p.rstyle.linePts = []; - - for (var i = 0; i + 1 < rs.allpts.length; i += 2) { - lpts.push({ - x: rs.allpts[i], - y: rs.allpts[i + 1] - }); - } - } else if (et === 'haystack') { - var hpts = rs.haystackPts; - - _p.rstyle.haystackPts = [{ x: hpts[0], y: hpts[1] }, { x: hpts[2], y: hpts[3] }]; - } - - _p.rstyle.arrowWidth = this.getArrowWidth(edge.pstyle('width').pfValue, edge.pstyle('arrow-scale').value) * this.arrowShapeWidth; -}; - -BRp.recalculateEdgeProjections = function (edges) { - this.findEdgeControlPoints(edges); -}; - -module.exports = BRp; - -/***/ }), -/* 115 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var math = __webpack_require__(2); -var is = __webpack_require__(0); -var util = __webpack_require__(1); - -var BRp = {}; - -BRp.recalculateNodeLabelProjection = function (node) { - var content = node.pstyle('label').strValue; - - if (is.emptyString(content)) { - return; - } - - var textX, textY; - var _p = node._private; - var nodeWidth = node.width(); - var nodeHeight = node.height(); - var padding = node.padding(); - var nodePos = node.position(); - var textHalign = node.pstyle('text-halign').strValue; - var textValign = node.pstyle('text-valign').strValue; - var rs = _p.rscratch; - var rstyle = _p.rstyle; - - switch (textHalign) { - case 'left': - textX = nodePos.x - nodeWidth / 2 - padding; - break; - - case 'right': - textX = nodePos.x + nodeWidth / 2 + padding; - break; - - default: - // e.g. center - textX = nodePos.x; - } - - switch (textValign) { - case 'top': - textY = nodePos.y - nodeHeight / 2 - padding; - break; - - case 'bottom': - textY = nodePos.y + nodeHeight / 2 + padding; - break; - - default: - // e.g. middle - textY = nodePos.y; - } - - rs.labelX = textX; - rs.labelY = textY; - rstyle.labelX = textX; - rstyle.labelY = textY; - - this.applyLabelDimensions(node); -}; - -var lineAngleFromDelta = function lineAngleFromDelta(dx, dy) { - var angle = Math.atan(dy / dx); - - if (dx === 0 && angle < 0) { - angle = angle * -1; - } - - return angle; -}; - -var lineAngle = function lineAngle(p0, p1) { - var dx = p1.x - p0.x; - var dy = p1.y - p0.y; - - return lineAngleFromDelta(dx, dy); -}; - -var bezierAngle = function bezierAngle(p0, p1, p2, t) { - var t0 = math.bound(0, t - 0.001, 1); - var t1 = math.bound(0, t + 0.001, 1); - - var lp0 = math.qbezierPtAt(p0, p1, p2, t0); - var lp1 = math.qbezierPtAt(p0, p1, p2, t1); - - return lineAngle(lp0, lp1); -}; - -BRp.recalculateEdgeLabelProjections = function (edge) { - var p; - var _p = edge._private; - var rs = _p.rscratch; - var r = this; - var content = { - mid: edge.pstyle('label').strValue, - source: edge.pstyle('source-label').strValue, - target: edge.pstyle('target-label').strValue - }; - - if (content.mid || content.source || content.target) { - // then we have to calculate... - } else { - return; // no labels => no calcs - } - - // add center point to style so bounding box calculations can use it - // - p = { - x: rs.midX, - y: rs.midY - }; - - var setRs = function setRs(propName, prefix, value) { - util.setPrefixedProperty(_p.rscratch, propName, prefix, value); - util.setPrefixedProperty(_p.rstyle, propName, prefix, value); - }; - - setRs('labelX', null, p.x); - setRs('labelY', null, p.y); - - var midAngle = lineAngleFromDelta(rs.midDispX, rs.midDispY); - setRs('labelAutoAngle', null, midAngle); - - var createControlPointInfo = function createControlPointInfo() { - if (createControlPointInfo.cache) { - return createControlPointInfo.cache; - } // use cache so only 1x per edge - - var ctrlpts = []; - - // store each ctrlpt info init - for (var i = 0; i + 5 < rs.allpts.length; i += 4) { - var p0 = { x: rs.allpts[i], y: rs.allpts[i + 1] }; - var p1 = { x: rs.allpts[i + 2], y: rs.allpts[i + 3] }; // ctrlpt - var p2 = { x: rs.allpts[i + 4], y: rs.allpts[i + 5] }; - - ctrlpts.push({ - p0: p0, - p1: p1, - p2: p2, - startDist: 0, - length: 0, - segments: [] - }); - } - - var bpts = _p.rstyle.bezierPts; - var nProjs = r.bezierProjPcts.length; - - function addSegment(cp, p0, p1, t0, t1) { - var length = math.dist(p0, p1); - var prevSegment = cp.segments[cp.segments.length - 1]; - var segment = { - p0: p0, - p1: p1, - t0: t0, - t1: t1, - startDist: prevSegment ? prevSegment.startDist + prevSegment.length : 0, - length: length - }; - - cp.segments.push(segment); - - cp.length += length; - } - - // update each ctrlpt with segment info - for (var i = 0; i < ctrlpts.length; i++) { - var cp = ctrlpts[i]; - var prevCp = ctrlpts[i - 1]; - - if (prevCp) { - cp.startDist = prevCp.startDist + prevCp.length; - } - - addSegment(cp, cp.p0, bpts[i * nProjs], 0, r.bezierProjPcts[0]); // first - - for (var j = 0; j < nProjs - 1; j++) { - addSegment(cp, bpts[i * nProjs + j], bpts[i * nProjs + j + 1], r.bezierProjPcts[j], r.bezierProjPcts[j + 1]); - } - - addSegment(cp, bpts[i * nProjs + nProjs - 1], cp.p2, r.bezierProjPcts[nProjs - 1], 1); // last - } - - return createControlPointInfo.cache = ctrlpts; - }; - - var calculateEndProjection = function calculateEndProjection(prefix) { - var angle; - var isSrc = prefix === 'source'; - - if (!content[prefix]) { - return; - } - - var offset = edge.pstyle(prefix + '-text-offset').pfValue; - - switch (rs.edgeType) { - case 'self': - case 'compound': - case 'bezier': - case 'multibezier': - var cps = createControlPointInfo(); - var selected; - var startDist = 0; - var totalDist = 0; - - // find the segment we're on - for (var i = 0; i < cps.length; i++) { - var cp = cps[isSrc ? i : cps.length - 1 - i]; - - for (var j = 0; j < cp.segments.length; j++) { - var seg = cp.segments[isSrc ? j : cp.segments.length - 1 - j]; - var lastSeg = i === cps.length - 1 && j === cp.segments.length - 1; - - startDist = totalDist; - totalDist += seg.length; - - if (totalDist >= offset || lastSeg) { - selected = { cp: cp, segment: seg }; - break; - } - } - - if (selected) { - break; - } - } - - var cp = selected.cp; - var seg = selected.segment; - var tSegment = (offset - startDist) / seg.length; - var segDt = seg.t1 - seg.t0; - var t = isSrc ? seg.t0 + segDt * tSegment : seg.t1 - segDt * tSegment; - - t = math.bound(0, t, 1); - p = math.qbezierPtAt(cp.p0, cp.p1, cp.p2, t); - angle = bezierAngle(cp.p0, cp.p1, cp.p2, t, p); - - break; - - case 'straight': - case 'segments': - case 'haystack': - var d = 0, - di, - d0; - var p0, p1; - var l = rs.allpts.length; - - for (var i = 0; i + 3 < l; i += 2) { - if (isSrc) { - p0 = { x: rs.allpts[i], y: rs.allpts[i + 1] }; - p1 = { x: rs.allpts[i + 2], y: rs.allpts[i + 3] }; - } else { - p0 = { x: rs.allpts[l - 2 - i], y: rs.allpts[l - 1 - i] }; - p1 = { x: rs.allpts[l - 4 - i], y: rs.allpts[l - 3 - i] }; - } - - di = math.dist(p0, p1); - d0 = d; - d += di; - - if (d >= offset) { - break; - } - } - - var pD = offset - d0; - var t = pD / di; - - t = math.bound(0, t, 1); - p = math.lineAt(p0, p1, t); - angle = lineAngle(p0, p1); - - break; - } - - setRs('labelX', prefix, p.x); - setRs('labelY', prefix, p.y); - setRs('labelAutoAngle', prefix, angle); - }; - - calculateEndProjection('source'); - calculateEndProjection('target'); - - this.applyLabelDimensions(edge); -}; - -BRp.applyLabelDimensions = function (ele) { - this.applyPrefixedLabelDimensions(ele); - - if (ele.isEdge()) { - this.applyPrefixedLabelDimensions(ele, 'source'); - this.applyPrefixedLabelDimensions(ele, 'target'); - } -}; - -BRp.applyPrefixedLabelDimensions = function (ele, prefix) { - var _p = ele._private; - - var text = this.getLabelText(ele, prefix); - var labelDims = this.calculateLabelDimensions(ele, text); - - util.setPrefixedProperty(_p.rstyle, 'labelWidth', prefix, labelDims.width); - util.setPrefixedProperty(_p.rscratch, 'labelWidth', prefix, labelDims.width); - - util.setPrefixedProperty(_p.rstyle, 'labelHeight', prefix, labelDims.height); - util.setPrefixedProperty(_p.rscratch, 'labelHeight', prefix, labelDims.height); -}; - -BRp.getLabelText = function (ele, prefix) { - var _p = ele._private; - var pfd = prefix ? prefix + '-' : ''; - var text = ele.pstyle(pfd + 'label').strValue; - var textTransform = ele.pstyle('text-transform').value; - var rscratch = function rscratch(propName, value) { - if (value) { - util.setPrefixedProperty(_p.rscratch, propName, prefix, value); - return value; - } else { - return util.getPrefixedProperty(_p.rscratch, propName, prefix); - } - }; - - // for empty text, skip all processing - if (!text) { - return ''; - } - - if (textTransform == 'none') { - // passthrough - } else if (textTransform == 'uppercase') { - text = text.toUpperCase(); - } else if (textTransform == 'lowercase') { - text = text.toLowerCase(); - } - - var wrapStyle = ele.pstyle('text-wrap').value; - - if (wrapStyle === 'wrap') { - //console.log('wrap'); - - var labelKey = rscratch('labelKey'); - - // save recalc if the label is the same as before - if (labelKey && rscratch('labelWrapKey') === labelKey) { - // console.log('wrap cache hit'); - return rscratch('labelWrapCachedText'); - } - // console.log('wrap cache miss'); - - var lines = text.split('\n'); - var maxW = ele.pstyle('text-max-width').pfValue; - var wrappedLines = []; - - for (var l = 0; l < lines.length; l++) { - var line = lines[l]; - var lineDims = this.calculateLabelDimensions(ele, line, 'line=' + line); - var lineW = lineDims.width; - - if (lineW > maxW) { - // line is too long - var words = line.split(/\s+/); // NB: assume collapsed whitespace into single space - var subline = ''; - - for (var w = 0; w < words.length; w++) { - var word = words[w]; - var testLine = subline.length === 0 ? word : subline + ' ' + word; - var testDims = this.calculateLabelDimensions(ele, testLine, 'testLine=' + testLine); - var testW = testDims.width; - - if (testW <= maxW) { - // word fits on current line - subline += word + ' '; - } else { - // word starts new line - wrappedLines.push(subline); - subline = word + ' '; - } - } - - // if there's remaining text, put it in a wrapped line - if (!subline.match(/^\s+$/)) { - wrappedLines.push(subline); - } - } else { - // line is already short enough - wrappedLines.push(line); - } - } // for - - rscratch('labelWrapCachedLines', wrappedLines); - text = rscratch('labelWrapCachedText', wrappedLines.join('\n')); - rscratch('labelWrapKey', labelKey); - - // console.log(text) - } else if (wrapStyle === 'ellipsis') { - var maxW = ele.pstyle('text-max-width').pfValue; - var ellipsized = ''; - var ellipsis = '\u2026'; - var incLastCh = false; - - for (var i = 0; i < text.length; i++) { - var widthWithNextCh = this.calculateLabelDimensions(ele, ellipsized + text[i] + ellipsis).width; - - if (widthWithNextCh > maxW) { - break; - } - - ellipsized += text[i]; - - if (i === text.length - 1) { - incLastCh = true; - } - } - - if (!incLastCh) { - ellipsized += ellipsis; - } - - return ellipsized; - } // if ellipsize - - return text; -}; - -BRp.calculateLabelDimensions = function (ele, text, extraKey) { - var r = this; - - var cacheKey = ele._private.labelStyleKey + '$@$' + text; - - if (extraKey) { - cacheKey += '$@$' + extraKey; - } - - var cache = r.labelDimCache || (r.labelDimCache = {}); - - if (cache[cacheKey]) { - return cache[cacheKey]; - } - - var sizeMult = 1; // increase the scale to increase accuracy w.r.t. zoomed text - var fStyle = ele.pstyle('font-style').strValue; - var size = sizeMult * ele.pstyle('font-size').pfValue + 'px'; - var family = ele.pstyle('font-family').strValue; - var weight = ele.pstyle('font-weight').strValue; - - var div = this.labelCalcDiv; - - if (!div) { - div = this.labelCalcDiv = document.createElement('div'); // eslint-disable-line no-undef - document.body.appendChild(div); // eslint-disable-line no-undef - } - - var ds = div.style; - - // from ele style - ds.fontFamily = family; - ds.fontStyle = fStyle; - ds.fontSize = size; - ds.fontWeight = weight; - - // forced style - ds.position = 'absolute'; - ds.left = '-9999px'; - ds.top = '-9999px'; - ds.zIndex = '-1'; - ds.visibility = 'hidden'; - ds.pointerEvents = 'none'; - ds.padding = '0'; - ds.lineHeight = '1'; - - if (ele.pstyle('text-wrap').value === 'wrap') { - ds.whiteSpace = 'pre'; // so newlines are taken into account - } else { - ds.whiteSpace = 'normal'; - } - - // put label content in div - div.textContent = text; - - cache[cacheKey] = { - width: Math.ceil(div.clientWidth / sizeMult), - height: Math.ceil(div.clientHeight / sizeMult) - }; - - return cache[cacheKey]; -}; - -BRp.calculateLabelAngles = function (ele) { - var _p = ele._private; - var rs = _p.rscratch; - var isEdge = ele.isEdge(); - var rot = ele.pstyle('text-rotation'); - var rotStr = rot.strValue; - - if (rotStr === 'none') { - rs.labelAngle = rs.sourceLabelAngle = rs.targetLabelAngle = 0; - } else if (isEdge && rotStr === 'autorotate') { - rs.labelAngle = rs.labelAutoAngle; - rs.sourceLabelAngle = rs.sourceLabelAutoAngle; - rs.targetLabelAngle = rs.targetLabelAutoAngle; - } else if (rotStr === 'autorotate') { - rs.labelAngle = rs.sourceLabelAngle = rs.targetLabelAngle = 0; - } else { - rs.labelAngle = rs.sourceLabelAngle = rs.targetLabelAngle = rot.pfValue; - } -}; - -module.exports = BRp; - -/***/ }), -/* 116 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var BRp = {}; - -BRp.getNodeShape = function (node) { - var r = this; - var shape = node.pstyle('shape').value; - - if (node.isParent()) { - if (shape === 'rectangle' || shape === 'roundrectangle' || shape === 'cutrectangle' || shape === 'barrel') { - return shape; - } else { - return 'rectangle'; - } - } - - if (shape === 'polygon') { - var points = node.pstyle('shape-polygon-points').value; - - return r.nodeShapes.makePolygon(points).name; - } - - return shape; -}; - -module.exports = BRp; - -/***/ }), -/* 117 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var BRp = {}; - -BRp.registerCalculationListeners = function () { - var cy = this.cy; - var elesToUpdate = cy.collection(); - var r = this; - - var enqueue = function enqueue(eles, e) { - var dirtyStyleCaches = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; - - elesToUpdate.merge(eles); - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - var _p = ele._private; - var rstyle = _p.rstyle; - - if (dirtyStyleCaches) { - rstyle.clean = false; - _p.bbCache = null; - } - - var evts = rstyle.dirtyEvents = rstyle.dirtyEvents || { length: 0 }; - - if (!evts[e.type]) { - evts[e.type] = true; - evts.length++; - } - } - }; - - r.binder(cy) - // nodes - - .on('position.* style.* free.* bounds.*', 'node', function onDirtyModNode(e) { - var node = e.target; - - enqueue(node, e); - enqueue(node.connectedEdges(), e); - }).on('add.*', 'node', function onDirtyAddNode(e) { - var ele = e.target; - - enqueue(ele, e); - }).on('background.*', 'node', function onDirtyBgNode(e) { - var ele = e.target; - - enqueue(ele, e, false); - }) - - // edges - - .on('add.* style.*', 'edge', function onDirtyEdge(e) { - var edge = e.target; - - enqueue(edge, e); - enqueue(edge.parallelEdges(), e); - }).on('remove.*', 'edge', function onDirtyRemoveEdge(e) { - var edge = e.target; - var pEdges = edge.parallelEdges(); - - for (var i = 0; i < pEdges.length; i++) { - var pEdge = pEdges[i]; - - if (!pEdge.removed()) { - enqueue(pEdge, e); - } - } - }) - - // manual dirtying - - .on('dirty.*', 'node', function onDirtyEle(e) { - var ele = e.target; - - enqueue(ele, e); - }); - - var updateEleCalcs = function updateEleCalcs(willDraw) { - if (willDraw) { - var fns = r.onUpdateEleCalcsFns; - - if (fns) { - for (var i = 0; i < fns.length; i++) { - var fn = fns[i]; - - fn(willDraw, elesToUpdate); - } - } - - r.recalculateRenderedStyle(elesToUpdate, false); - - for (var i = 0; i < elesToUpdate.length; i++) { - elesToUpdate[i]._private.rstyle.dirtyEvents = null; - } - - elesToUpdate = cy.collection(); - } - }; - - r.beforeRender(updateEleCalcs, r.beforeRenderPriorities.eleCalcs); -}; - -BRp.onUpdateEleCalcs = function (fn) { - var fns = this.onUpdateEleCalcsFns = this.onUpdateEleCalcsFns || []; - - fns.push(fn); -}; - -BRp.recalculateRenderedStyle = function (eles, useCache) { - var edges = []; - var nodes = []; - - // the renderer can't be used for calcs when destroyed, e.g. ele.boundingBox() - if (this.destroyed) { - return; - } - - // use cache by default for perf - if (useCache === undefined) { - useCache = true; - } - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - var _p = ele._private; - var rstyle = _p.rstyle; - - // only update if dirty and in graph - if (useCache && rstyle.clean || ele.removed()) { - continue; - } - - // only update if not display: none - if (ele.pstyle('display').value === 'none') { - continue; - } - - if (_p.group === 'nodes') { - nodes.push(ele); - } else { - // edges - edges.push(ele); - } - - rstyle.clean = true; - // rstyle.dirtyEvents = null; - } - - // update node data from projections - for (var i = 0; i < nodes.length; i++) { - var ele = nodes[i]; - var _p = ele._private; - var rstyle = _p.rstyle; - var pos = ele.position(); - - this.recalculateNodeLabelProjection(ele); - - rstyle.nodeX = pos.x; - rstyle.nodeY = pos.y; - rstyle.nodeW = ele.pstyle('width').pfValue; - rstyle.nodeH = ele.pstyle('height').pfValue; - } - - this.recalculateEdgeProjections(edges); - - // update edge data from projections - for (var i = 0; i < edges.length; i++) { - var ele = edges[i]; - var _p = ele._private; - var rstyle = _p.rstyle; - var rs = _p.rscratch; - - this.recalculateEdgeLabelProjections(ele); - - // update rstyle positions - rstyle.srcX = rs.arrowStartX; - rstyle.srcY = rs.arrowStartY; - rstyle.tgtX = rs.arrowEndX; - rstyle.tgtY = rs.arrowEndY; - rstyle.midX = rs.midX; - rstyle.midY = rs.midY; - rstyle.labelAngle = rs.labelAngle; - rstyle.sourceLabelAngle = rs.sourceLabelAngle; - rstyle.targetLabelAngle = rs.targetLabelAngle; - } -}; - -module.exports = BRp; - -/***/ }), -/* 118 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var zIndexSort = __webpack_require__(17); - -var BRp = {}; - -BRp.updateCachedGrabbedEles = function () { - var eles = this.cachedZSortedEles; - - if (!eles) { - // just let this be recalculated on the next z sort tick - return; - } - - eles.drag = []; - eles.nondrag = []; - - var grabTargets = []; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - var rs = ele._private.rscratch; - - if (ele.grabbed() && !ele.isParent()) { - grabTargets.push(ele); - } else if (rs.inDragLayer) { - eles.drag.push(ele); - } else { - eles.nondrag.push(ele); - } - } - - // put the grab target nodes last so it's on top of its neighbourhood - for (var i = 0; i < grabTargets.length; i++) { - var ele = grabTargets[i]; - - eles.drag.push(ele); - } -}; - -BRp.invalidateCachedZSortedEles = function () { - this.cachedZSortedEles = null; -}; - -BRp.getCachedZSortedEles = function (forceRecalc) { - if (forceRecalc || !this.cachedZSortedEles) { - //console.time('cachezorder') - - var eles = this.cy.mutableElements().toArray(); - - eles.sort(zIndexSort); - - eles.interactive = eles.filter(function (ele) { - return ele.interactive(); - }); - - this.cachedZSortedEles = eles; - - this.updateCachedGrabbedEles(); - } else { - eles = this.cachedZSortedEles; - } - - return eles; -}; - -module.exports = BRp; - -/***/ }), -/* 119 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var BRp = {}; - -BRp.getCachedImage = function (url, crossOrigin, onLoad) { - var r = this; - var imageCache = r.imageCache = r.imageCache || {}; - var cache = imageCache[url]; - - if (cache) { - if (!cache.image.complete) { - cache.image.addEventListener('load', onLoad); - } - - return cache.image; - } else { - cache = imageCache[url] = imageCache[url] || {}; - - var image = cache.image = new Image(); // eslint-disable-line no-undef - - image.addEventListener('load', onLoad); - image.addEventListener('error', function () { - image.error = true; - }); - - // #1582 safari doesn't load data uris with crossOrigin properly - // https://bugs.webkit.org/show_bug.cgi?id=123978 - var dataUriPrefix = 'data:'; - var isDataUri = url.substring(0, dataUriPrefix.length).toLowerCase() === dataUriPrefix; - if (!isDataUri) { - image.crossOrigin = crossOrigin; // prevent tainted canvas - } - - image.src = url; - - return image; - } -}; - -module.exports = BRp; - -/***/ }), -/* 120 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var util = __webpack_require__(1); -var math = __webpack_require__(2); -var Event = __webpack_require__(16); - -var BRp = {}; - -BRp.registerBinding = function (target, event, handler, useCapture) { - var args = Array.prototype.slice.apply(arguments, [1]); // copy - var b = this.binder(target); - - return b.on.apply(b, args); -}; - -BRp.binder = function (tgt) { - var r = this; - - var tgtIsDom = tgt === window || tgt === document || tgt === document.body || is.domElement(tgt); - - if (r.supportsPassiveEvents == null) { - - // from https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection - var supportsPassive = false; - try { - var opts = Object.defineProperty({}, 'passive', { - get: function get() { - supportsPassive = true; - } - }); - - window.addEventListener('test', null, opts); - } catch (err) {} - - r.supportsPassiveEvents = supportsPassive; - } - - var on = function on(event, handler, useCapture) { - var args = Array.prototype.slice.call(arguments); - - if (tgtIsDom && r.supportsPassiveEvents) { - // replace useCapture w/ opts obj - args[2] = { - capture: useCapture != null ? useCapture : false, - passive: false, - once: false - }; - } - - r.bindings.push({ - target: tgt, - args: args - }); - - (tgt.addEventListener || tgt.on).apply(tgt, args); - - return this; - }; - - return { - on: on, - addEventListener: on, - addListener: on, - bind: on - }; -}; - -BRp.nodeIsDraggable = function (node) { - return node && node.isNode() && !node.locked() && node.grabbable(); -}; - -BRp.nodeIsGrabbable = function (node) { - return this.nodeIsDraggable(node) && node.interactive(); -}; - -BRp.load = function () { - var r = this; - - var triggerEvents = function triggerEvents(target, names, e, props) { - if (target == null) { - target = r.cy; - } - - for (var i = 0; i < names.length; i++) { - var name = names[i]; - - target.emit(util.extend({ originalEvent: e, type: name }, props)); - } - }; - - var isMultSelKeyDown = function isMultSelKeyDown(e) { - return e.shiftKey || e.metaKey || e.ctrlKey; // maybe e.altKey - }; - - var allowPanningPassthrough = function allowPanningPassthrough(down, downs) { - var allowPassthrough = true; - - if (r.cy.hasCompoundNodes() && down && down.isEdge()) { - // a compound node below the edge => no passthrough panning - for (var i = 0; downs && i < downs.length; i++) { - var down = downs[i]; - - if (down.isNode() && down.isParent()) { - allowPassthrough = false; - break; - } - } - } else { - allowPassthrough = true; - } - - return allowPassthrough; - }; - - var getDragListIds = function getDragListIds(opts) { - var listHasId; - - if (opts.addToList && r.cy.hasCompoundNodes()) { - // only needed for compound graphs - if (!opts.addToList.hasId) { - // build ids lookup if doesn't already exist - opts.addToList.hasId = {}; - - for (var i = 0; i < opts.addToList.length; i++) { - var ele = opts.addToList[i]; - - opts.addToList.hasId[ele.id()] = true; - } - } - - listHasId = opts.addToList.hasId; - } - - return listHasId || {}; - }; - - var setGrabbed = function setGrabbed(ele) { - ele[0]._private.grabbed = true; - }; - - var setFreed = function setFreed(ele) { - ele[0]._private.grabbed = false; - }; - - var setInDragLayer = function setInDragLayer(ele) { - ele[0]._private.rscratch.inDragLayer = true; - }; - - var setOutDragLayer = function setOutDragLayer(ele) { - ele[0]._private.rscratch.inDragLayer = false; - }; - - var setGrabTarget = function setGrabTarget(ele) { - ele[0]._private.rscratch.isGrabTarget = true; - }; - - var removeGrabTarget = function removeGrabTarget(ele) { - ele[0]._private.rscratch.isGrabTarget = false; - }; - - var addToDragList = function addToDragList(ele, opts) { - var listHasId = getDragListIds(opts); - - if (!listHasId[ele.id()]) { - opts.addToList.push(ele); - listHasId[ele.id()] = true; - - setGrabbed(ele); - } - }; - - // helper function to determine which child nodes and inner edges - // of a compound node to be dragged as well as the grabbed and selected nodes - var addDescendantsToDrag = function addDescendantsToDrag(node, opts) { - if (!node.cy().hasCompoundNodes()) { - return; - } - - if (opts.inDragLayer == null && opts.addToList == null) { - return; - } // nothing to do - - var innerNodes = node.descendants(); - - if (opts.inDragLayer) { - innerNodes.forEach(setInDragLayer); - innerNodes.connectedEdges().forEach(setInDragLayer); - } - - if (opts.addToList) { - innerNodes.forEach(function (ele) { - addToDragList(ele, opts); - }); - } - }; - - // adds the given nodes and its neighbourhood to the drag layer - var addNodesToDrag = function addNodesToDrag(nodes, opts) { - opts = opts || {}; - - var hasCompoundNodes = nodes.cy().hasCompoundNodes(); - - if (opts.inDragLayer) { - nodes.forEach(setInDragLayer); - - nodes.neighborhood().stdFilter(function (ele) { - return !hasCompoundNodes || ele.isEdge(); - }).forEach(setInDragLayer); - } - - if (opts.addToList) { - nodes.forEach(function (ele) { - addToDragList(ele, opts); - }); - } - - addDescendantsToDrag(nodes, opts); // always add to drag - - // also add nodes and edges related to the topmost ancestor - updateAncestorsInDragLayer(nodes, { - inDragLayer: opts.inDragLayer - }); - - r.updateCachedGrabbedEles(); - }; - - var addNodeToDrag = addNodesToDrag; - - var freeDraggedElements = function freeDraggedElements(grabbedEles) { - if (!grabbedEles) { - return; - } - - grabbedEles.hasId = {}; // clear the id list - - // just go over all elements rather than doing a bunch of (possibly expensive) traversals - r.getCachedZSortedEles().forEach(function (ele) { - setFreed(ele); - setOutDragLayer(ele); - removeGrabTarget(ele); - }); - - r.updateCachedGrabbedEles(); - }; - - // helper function to determine which ancestor nodes and edges should go - // to the drag layer (or should be removed from drag layer). - var updateAncestorsInDragLayer = function updateAncestorsInDragLayer(node, opts) { - - if (opts.inDragLayer == null && opts.addToList == null) { - return; - } // nothing to do - - if (!node.cy().hasCompoundNodes()) { - return; - } - - // find top-level parent - var parent = node.ancestors().orphans(); - - // no parent node: no nodes to add to the drag layer - if (parent.same(node)) { - return; - } - - var nodes = parent.descendants().spawnSelf().merge(parent).unmerge(node).unmerge(node.descendants()); - - var edges = nodes.connectedEdges(); - - if (opts.inDragLayer) { - edges.forEach(setInDragLayer); - nodes.forEach(setInDragLayer); - } - - if (opts.addToList) { - nodes.forEach(function (ele) { - addToDragList(ele, opts); - }); - } - }; - - var blurActiveDomElement = function blurActiveDomElement() { - if (document.activeElement != null && document.activeElement.blur != null) { - document.activeElement.blur(); - } - }; - - var haveMutationsApi = typeof MutationObserver !== 'undefined'; - - // watch for when the cy container is removed from the dom - if (haveMutationsApi) { - r.removeObserver = new MutationObserver(function (mutns) { - // eslint-disable-line no-undef - for (var i = 0; i < mutns.length; i++) { - var mutn = mutns[i]; - var rNodes = mutn.removedNodes; - - if (rNodes) { - for (var j = 0; j < rNodes.length; j++) { - var rNode = rNodes[j]; - - if (rNode === r.container) { - r.destroy(); - break; - } - } - } - } - }); - - if (r.container.parentNode) { - r.removeObserver.observe(r.container.parentNode, { childList: true }); - } - } else { - r.registerBinding(r.container, 'DOMNodeRemoved', function (e) { - r.destroy(); - }); - } - - var onResize = util.debounce(function () { - r.cy.resize(); - }, 100); - - if (haveMutationsApi) { - r.styleObserver = new MutationObserver(onResize); // eslint-disable-line no-undef - - r.styleObserver.observe(r.container, { attributes: true }); - } - - // auto resize - r.registerBinding(window, 'resize', onResize); // eslint-disable-line no-undef - - var forEachUp = function forEachUp(domEle, fn) { - while (domEle != null) { - fn(domEle); - - domEle = domEle.parentNode; - } - }; - - var invalidateCoords = function invalidateCoords() { - r.invalidateContainerClientCoordsCache(); - }; - - forEachUp(r.container, function (domEle) { - r.registerBinding(domEle, 'transitionend', invalidateCoords); - r.registerBinding(domEle, 'animationend', invalidateCoords); - r.registerBinding(domEle, 'scroll', invalidateCoords); - }); - - // stop right click menu from appearing on cy - r.registerBinding(r.container, 'contextmenu', function (e) { - e.preventDefault(); - }); - - var inBoxSelection = function inBoxSelection() { - return r.selection[4] !== 0; - }; - - var eventInContainer = function eventInContainer(e) { - // save cycles if mouse events aren't to be captured - var containerPageCoords = r.findContainerClientCoords(); - var x = containerPageCoords[0]; - var y = containerPageCoords[1]; - var width = containerPageCoords[2]; - var height = containerPageCoords[3]; - - var positions = e.touches ? e.touches : [e]; - var atLeastOnePosInside = false; - - for (var i = 0; i < positions.length; i++) { - var p = positions[i]; - - if (x <= p.clientX && p.clientX <= x + width && y <= p.clientY && p.clientY <= y + height) { - atLeastOnePosInside = true; - break; - } - } - - if (!atLeastOnePosInside) { - return false; - } - - var container = r.container; - var target = e.target; - var tParent = target.parentNode; - var containerIsTarget = false; - - while (tParent) { - if (tParent === container) { - containerIsTarget = true; - break; - } - - tParent = tParent.parentNode; - } - - if (!containerIsTarget) { - return false; - } // if target is outisde cy container, then this event is not for us - - return true; - }; - - // Primary key - r.registerBinding(r.container, 'mousedown', function mousedownHandler(e) { - if (!eventInContainer(e)) { - return; - } - - e.preventDefault(); - - blurActiveDomElement(); - - r.hoverData.capture = true; - r.hoverData.which = e.which; - - var cy = r.cy; - var gpos = [e.clientX, e.clientY]; - var pos = r.projectIntoViewport(gpos[0], gpos[1]); - var select = r.selection; - var nears = r.findNearestElements(pos[0], pos[1], true, false); - var near = nears[0]; - var draggedElements = r.dragData.possibleDragElements; - - r.hoverData.mdownPos = pos; - r.hoverData.mdownGPos = gpos; - - var checkForTaphold = function checkForTaphold() { - r.hoverData.tapholdCancelled = false; - - clearTimeout(r.hoverData.tapholdTimeout); - - r.hoverData.tapholdTimeout = setTimeout(function () { - - if (r.hoverData.tapholdCancelled) { - return; - } else { - var ele = r.hoverData.down; - - if (ele) { - ele.emit({ - originalEvent: e, - type: 'taphold', - position: { x: pos[0], y: pos[1] } - }); - } else { - cy.emit({ - originalEvent: e, - type: 'taphold', - position: { x: pos[0], y: pos[1] } - }); - } - } - }, r.tapholdDuration); - }; - - // Right click button - if (e.which == 3) { - - r.hoverData.cxtStarted = true; - - var cxtEvt = { - originalEvent: e, - type: 'cxttapstart', - position: { x: pos[0], y: pos[1] } - }; - - if (near) { - near.activate(); - near.emit(cxtEvt); - - r.hoverData.down = near; - } else { - cy.emit(cxtEvt); - } - - r.hoverData.downTime = new Date().getTime(); - r.hoverData.cxtDragged = false; - - // Primary button - } else if (e.which == 1) { - - if (near) { - near.activate(); - } - - // Element dragging - { - // If something is under the cursor and it is draggable, prepare to grab it - if (near != null) { - - if (r.nodeIsGrabbable(near)) { - - var makeEvent = function makeEvent(type) { - return { - originalEvent: e, - type: type, - position: { x: pos[0], y: pos[1] } - }; - }; - - var triggerGrab = function triggerGrab(ele) { - ele.emit(makeEvent('grab')); - }; - - setGrabTarget(near); - - if (!near.selected()) { - - draggedElements = r.dragData.possibleDragElements = []; - addNodeToDrag(near, { addToList: draggedElements }); - - near.emit(makeEvent('grabon')).emit(makeEvent('grab')); - } else { - draggedElements = r.dragData.possibleDragElements = []; - - var selectedNodes = cy.$(function (ele) { - return ele.isNode() && ele.selected() && r.nodeIsGrabbable(ele); - }); - - addNodesToDrag(selectedNodes, { addToList: draggedElements }); - - near.emit(makeEvent('grabon')); - - selectedNodes.forEach(triggerGrab); - } - - r.redrawHint('eles', true); - r.redrawHint('drag', true); - } - } - - r.hoverData.down = near; - r.hoverData.downs = nears; - r.hoverData.downTime = new Date().getTime(); - } - - triggerEvents(near, ['mousedown', 'tapstart', 'vmousedown'], e, { - position: { x: pos[0], y: pos[1] } - }); - - if (near == null) { - select[4] = 1; - - r.data.bgActivePosistion = { - x: pos[0], - y: pos[1] - }; - - r.redrawHint('select', true); - - r.redraw(); - } else if (near.isEdge()) { - select[4] = 1; // for future pan - } - - checkForTaphold(); - } - - // Initialize selection box coordinates - select[0] = select[2] = pos[0]; - select[1] = select[3] = pos[1]; - }, false); - - r.registerBinding(window, 'mousemove', function mousemoveHandler(e) { - // eslint-disable-line no-undef - var capture = r.hoverData.capture; - - if (!capture && !eventInContainer(e)) { - return; - } - - var preventDefault = false; - var cy = r.cy; - var zoom = cy.zoom(); - var gpos = [e.clientX, e.clientY]; - var pos = r.projectIntoViewport(gpos[0], gpos[1]); - var mdownPos = r.hoverData.mdownPos; - var mdownGPos = r.hoverData.mdownGPos; - var select = r.selection; - - var near = null; - if (!r.hoverData.draggingEles && !r.hoverData.dragging && !r.hoverData.selecting) { - near = r.findNearestElement(pos[0], pos[1], true, false); - } - var last = r.hoverData.last; - var down = r.hoverData.down; - - var disp = [pos[0] - select[2], pos[1] - select[3]]; - - var draggedElements = r.dragData.possibleDragElements; - - var isOverThresholdDrag; - - if (mdownGPos) { - var dx = gpos[0] - mdownGPos[0]; - var dx2 = dx * dx; - var dy = gpos[1] - mdownGPos[1]; - var dy2 = dy * dy; - var dist2 = dx2 + dy2; - - r.hoverData.isOverThresholdDrag = isOverThresholdDrag = dist2 >= r.desktopTapThreshold2; - } - - var multSelKeyDown = isMultSelKeyDown(e); - - if (isOverThresholdDrag) { - r.hoverData.tapholdCancelled = true; - } - - var updateDragDelta = function updateDragDelta() { - var dragDelta = r.hoverData.dragDelta = r.hoverData.dragDelta || []; - - if (dragDelta.length === 0) { - dragDelta.push(disp[0]); - dragDelta.push(disp[1]); - } else { - dragDelta[0] += disp[0]; - dragDelta[1] += disp[1]; - } - }; - - preventDefault = true; - - triggerEvents(near, ['mousemove', 'vmousemove', 'tapdrag'], e, { - position: { x: pos[0], y: pos[1] } - }); - - var goIntoBoxMode = function goIntoBoxMode() { - r.data.bgActivePosistion = undefined; - - if (!r.hoverData.selecting) { - cy.emit('boxstart'); - } - - select[4] = 1; - r.hoverData.selecting = true; - - r.redrawHint('select', true); - r.redraw(); - }; - - // trigger context drag if rmouse down - if (r.hoverData.which === 3) { - // but only if over threshold - if (isOverThresholdDrag) { - var cxtEvt = { - originalEvent: e, - type: 'cxtdrag', - position: { x: pos[0], y: pos[1] } - }; - - if (down) { - down.emit(cxtEvt); - } else { - cy.emit(cxtEvt); - } - - r.hoverData.cxtDragged = true; - - if (!r.hoverData.cxtOver || near !== r.hoverData.cxtOver) { - - if (r.hoverData.cxtOver) { - r.hoverData.cxtOver.emit({ - originalEvent: e, - type: 'cxtdragout', - position: { x: pos[0], y: pos[1] } - }); - } - - r.hoverData.cxtOver = near; - - if (near) { - near.emit({ - originalEvent: e, - type: 'cxtdragover', - position: { x: pos[0], y: pos[1] } - }); - } - } - } - - // Check if we are drag panning the entire graph - } else if (r.hoverData.dragging) { - preventDefault = true; - - if (cy.panningEnabled() && cy.userPanningEnabled()) { - var deltaP; - - if (r.hoverData.justStartedPan) { - var mdPos = r.hoverData.mdownPos; - - deltaP = { - x: (pos[0] - mdPos[0]) * zoom, - y: (pos[1] - mdPos[1]) * zoom - }; - - r.hoverData.justStartedPan = false; - } else { - deltaP = { - x: disp[0] * zoom, - y: disp[1] * zoom - }; - } - - cy.panBy(deltaP); - - r.hoverData.dragged = true; - } - - // Needs reproject due to pan changing viewport - pos = r.projectIntoViewport(e.clientX, e.clientY); - - // Checks primary button down & out of time & mouse not moved much - } else if (select[4] == 1 && (down == null || down.isEdge())) { - - if (isOverThresholdDrag) { - - if (!r.hoverData.dragging && cy.boxSelectionEnabled() && (multSelKeyDown || !cy.panningEnabled() || !cy.userPanningEnabled())) { - goIntoBoxMode(); - } else if (!r.hoverData.selecting && cy.panningEnabled() && cy.userPanningEnabled()) { - var allowPassthrough = allowPanningPassthrough(down, r.hoverData.downs); - - if (allowPassthrough) { - r.hoverData.dragging = true; - r.hoverData.justStartedPan = true; - select[4] = 0; - - r.data.bgActivePosistion = math.array2point(mdownPos); - - r.redrawHint('select', true); - r.redraw(); - } - } - - if (down && down.isEdge() && down.active()) { - down.unactivate(); - } - } - } else { - if (down && down.isEdge() && down.active()) { - down.unactivate(); - } - - if ((!down || !down.grabbed()) && near != last) { - - if (last) { - triggerEvents(last, ['mouseout', 'tapdragout'], e, { - position: { x: pos[0], y: pos[1] } - }); - } - - if (near) { - triggerEvents(near, ['mouseover', 'tapdragover'], e, { - position: { x: pos[0], y: pos[1] } - }); - } - - r.hoverData.last = near; - } - - if (down) { - - if (isOverThresholdDrag) { - // then we can take action - - if (cy.boxSelectionEnabled() && multSelKeyDown) { - // then selection overrides - if (down && down.grabbed()) { - freeDraggedElements(draggedElements); - - down.emit('free'); - } - - goIntoBoxMode(); - } else if (down && down.grabbed() && r.nodeIsDraggable(down)) { - // drag node - var justStartedDrag = !r.dragData.didDrag; - - if (justStartedDrag) { - r.redrawHint('eles', true); - } - - r.dragData.didDrag = true; // indicate that we actually did drag the node - - var toTrigger = []; - - // now, add the elements to the drag layer if not done already - if (!r.hoverData.draggingEles) { - addNodesToDrag(cy.collection(draggedElements), { inDragLayer: true }); - } - - for (var i = 0; i < draggedElements.length; i++) { - var dEle = draggedElements[i]; - - // Locked nodes not draggable, as well as non-visible nodes - if (r.nodeIsDraggable(dEle) && dEle.grabbed()) { - var dPos = dEle.position(); - - toTrigger.push(dEle); - - if (is.number(disp[0]) && is.number(disp[1])) { - dPos.x += disp[0]; - dPos.y += disp[1]; - - if (justStartedDrag) { - var dragDelta = r.hoverData.dragDelta; - - if (dragDelta && is.number(dragDelta[0]) && is.number(dragDelta[1])) { - dPos.x += dragDelta[0]; - dPos.y += dragDelta[1]; - } - } - } - } - } - - r.hoverData.draggingEles = true; - - var tcol = cy.collection(toTrigger); - - tcol.dirtyCompoundBoundsCache(); - tcol.emit('position drag'); - - r.redrawHint('drag', true); - r.redraw(); - } - } else { - // otherwise save drag delta for when we actually start dragging so the relative grab pos is constant - updateDragDelta(); - } - } - - // prevent the dragging from triggering text selection on the page - preventDefault = true; - } - - select[2] = pos[0];select[3] = pos[1]; - - if (preventDefault) { - if (e.stopPropagation) e.stopPropagation(); - if (e.preventDefault) e.preventDefault(); - return false; - } - }, false); - - r.registerBinding(window, 'mouseup', function mouseupHandler(e) { - // eslint-disable-line no-undef - var capture = r.hoverData.capture; - if (!capture) { - return; - } - r.hoverData.capture = false; - - var cy = r.cy;var pos = r.projectIntoViewport(e.clientX, e.clientY);var select = r.selection; - var near = r.findNearestElement(pos[0], pos[1], true, false); - var draggedElements = r.dragData.possibleDragElements;var down = r.hoverData.down; - var multSelKeyDown = isMultSelKeyDown(e); - - if (r.data.bgActivePosistion) { - r.redrawHint('select', true); - r.redraw(); - } - - r.hoverData.tapholdCancelled = true; - - r.data.bgActivePosistion = undefined; // not active bg now - - if (down) { - down.unactivate(); - } - - if (r.hoverData.which === 3) { - var cxtEvt = { - originalEvent: e, - type: 'cxttapend', - position: { x: pos[0], y: pos[1] } - }; - - if (down) { - down.emit(cxtEvt); - } else { - cy.emit(cxtEvt); - } - - if (!r.hoverData.cxtDragged) { - var cxtTap = { - originalEvent: e, - type: 'cxttap', - position: { x: pos[0], y: pos[1] } - }; - - if (down) { - down.emit(cxtTap); - } else { - cy.emit(cxtTap); - } - } - - r.hoverData.cxtDragged = false; - r.hoverData.which = null; - } else if (r.hoverData.which === 1) { - - // Deselect all elements if nothing is currently under the mouse cursor and we aren't dragging something - if (down == null && // not mousedown on node - !r.dragData.didDrag // didn't move the node around - && !r.hoverData.selecting // not box selection - && !r.hoverData.dragged // didn't pan - && !isMultSelKeyDown(e)) { - - cy.$(function (ele) { - return ele.selected(); - }).unselect(); - - if (draggedElements.length > 0) { - r.redrawHint('eles', true); - } - - r.dragData.possibleDragElements = draggedElements = []; - } - - triggerEvents(near, ['mouseup', 'tapend', 'vmouseup'], e, { - position: { x: pos[0], y: pos[1] } - }); - - if (!r.dragData.didDrag // didn't move a node around - && !r.hoverData.dragged // didn't pan - && !r.hoverData.selecting // not box selection - && !r.hoverData.isOverThresholdDrag // didn't move too much - ) { - triggerEvents(down, ['click', 'tap', 'vclick'], e, { - position: { x: pos[0], y: pos[1] } - }); - } - - // Single selection - if (near == down && !r.dragData.didDrag && !r.hoverData.selecting) { - if (near != null && near._private.selectable) { - - if (r.hoverData.dragging) { - // if panning, don't change selection state - } else if (cy.selectionType() === 'additive' || multSelKeyDown) { - if (near.selected()) { - near.unselect(); - } else { - near.select(); - } - } else { - if (!multSelKeyDown) { - cy.$(':selected').unmerge(near).unselect(); - near.select(); - } - } - - r.redrawHint('eles', true); - } - } - - if (r.hoverData.selecting) { - var box = cy.collection(r.getAllInBox(select[0], select[1], select[2], select[3])); - - r.redrawHint('select', true); - - if (box.length > 0) { - r.redrawHint('eles', true); - } - - cy.emit('boxend'); - - var eleWouldBeSelected = function eleWouldBeSelected(ele) { - return ele.selectable() && !ele.selected(); - }; - - if (cy.selectionType() === 'additive') { - box.emit('box').stdFilter(eleWouldBeSelected).select().emit('boxselect'); - } else { - if (!multSelKeyDown) { - cy.$(':selected').unmerge(box).unselect(); - } - - box.emit('box').stdFilter(eleWouldBeSelected).select().emit('boxselect'); - } - - // always need redraw in case eles unselectable - r.redraw(); - } - - // Cancel drag pan - if (r.hoverData.dragging) { - r.hoverData.dragging = false; - - r.redrawHint('select', true); - r.redrawHint('eles', true); - - r.redraw(); - } - - if (!select[4]) { - r.redrawHint('drag', true); - r.redrawHint('eles', true); - - var downWasGrabbed = down && down.grabbed(); - - freeDraggedElements(draggedElements); - - if (downWasGrabbed) { - down.emit('free'); - } - } - } // else not right mouse - - select[4] = 0;r.hoverData.down = null; - - r.hoverData.cxtStarted = false; - r.hoverData.draggingEles = false; - r.hoverData.selecting = false; - r.hoverData.isOverThresholdDrag = false; - r.dragData.didDrag = false; - r.hoverData.dragged = false; - r.hoverData.dragDelta = []; - r.hoverData.mdownPos = null; - r.hoverData.mdownGPos = null; - }, false); - - var wheelHandler = function wheelHandler(e) { - - if (r.scrollingPage) { - return; - } // while scrolling, ignore wheel-to-zoom - - var cy = r.cy; - var pos = r.projectIntoViewport(e.clientX, e.clientY); - var rpos = [pos[0] * cy.zoom() + cy.pan().x, pos[1] * cy.zoom() + cy.pan().y]; - - if (r.hoverData.draggingEles || r.hoverData.dragging || r.hoverData.cxtStarted || inBoxSelection()) { - // if pan dragging or cxt dragging, wheel movements make no zoom - e.preventDefault(); - return; - } - - if (cy.panningEnabled() && cy.userPanningEnabled() && cy.zoomingEnabled() && cy.userZoomingEnabled()) { - e.preventDefault(); - - r.data.wheelZooming = true; - clearTimeout(r.data.wheelTimeout); - r.data.wheelTimeout = setTimeout(function () { - r.data.wheelZooming = false; - - r.redrawHint('eles', true); - r.redraw(); - }, 150); - - var diff; - - if (e.deltaY != null) { - diff = e.deltaY / -250; - } else if (e.wheelDeltaY != null) { - diff = e.wheelDeltaY / 1000; - } else { - diff = e.wheelDelta / 1000; - } - - diff = diff * r.wheelSensitivity; - - var needsWheelFix = e.deltaMode === 1; - if (needsWheelFix) { - // fixes slow wheel events on ff/linux and ff/windows - diff *= 33; - } - - cy.zoom({ - level: cy.zoom() * Math.pow(10, diff), - renderedPosition: { x: rpos[0], y: rpos[1] } - }); - } - }; - - // Functions to help with whether mouse wheel should trigger zooming - // -- - r.registerBinding(r.container, 'wheel', wheelHandler, true); - - // disable nonstandard wheel events - // r.registerBinding(r.container, 'mousewheel', wheelHandler, true); - // r.registerBinding(r.container, 'DOMMouseScroll', wheelHandler, true); - // r.registerBinding(r.container, 'MozMousePixelScroll', wheelHandler, true); // older firefox - - r.registerBinding(window, 'scroll', function scrollHandler(e) { - // eslint-disable-line no-undef - r.scrollingPage = true; - - clearTimeout(r.scrollingPageTimeout); - r.scrollingPageTimeout = setTimeout(function () { - r.scrollingPage = false; - }, 250); - }, true); - - // Functions to help with handling mouseout/mouseover on the Cytoscape container - // Handle mouseout on Cytoscape container - r.registerBinding(r.container, 'mouseout', function mouseOutHandler(e) { - var pos = r.projectIntoViewport(e.clientX, e.clientY); - - r.cy.emit({ - originalEvent: e, - type: 'mouseout', - position: { x: pos[0], y: pos[1] } - }); - }, false); - - r.registerBinding(r.container, 'mouseover', function mouseOverHandler(e) { - var pos = r.projectIntoViewport(e.clientX, e.clientY); - - r.cy.emit({ - originalEvent: e, - type: 'mouseover', - position: { x: pos[0], y: pos[1] } - }); - }, false); - - var f1x1, f1y1, f2x1, f2y1; // starting points for pinch-to-zoom - var distance1, distance1Sq; // initial distance between finger 1 and finger 2 for pinch-to-zoom - var center1, modelCenter1; // center point on start pinch to zoom - var offsetLeft, offsetTop; - var containerWidth, containerHeight; - var twoFingersStartInside; - - var distance = function distance(x1, y1, x2, y2) { - return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); - }; - - var distanceSq = function distanceSq(x1, y1, x2, y2) { - return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1); - }; - - var touchstartHandler; - r.registerBinding(r.container, 'touchstart', touchstartHandler = function touchstartHandler(e) { - if (!eventInContainer(e)) { - return; - } - - blurActiveDomElement(); - - r.touchData.capture = true; - r.data.bgActivePosistion = undefined; - - var cy = r.cy; - var now = r.touchData.now; - var earlier = r.touchData.earlier; - - if (e.touches[0]) { - var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);now[0] = pos[0];now[1] = pos[1]; - } - if (e.touches[1]) { - var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);now[2] = pos[0];now[3] = pos[1]; - } - if (e.touches[2]) { - var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);now[4] = pos[0];now[5] = pos[1]; - } - - // record starting points for pinch-to-zoom - if (e.touches[1]) { - - freeDraggedElements(r.dragData.touchDragEles); - - var offsets = r.findContainerClientCoords(); - offsetLeft = offsets[0]; - offsetTop = offsets[1]; - containerWidth = offsets[2]; - containerHeight = offsets[3]; - - f1x1 = e.touches[0].clientX - offsetLeft; - f1y1 = e.touches[0].clientY - offsetTop; - - f2x1 = e.touches[1].clientX - offsetLeft; - f2y1 = e.touches[1].clientY - offsetTop; - - twoFingersStartInside = 0 <= f1x1 && f1x1 <= containerWidth && 0 <= f2x1 && f2x1 <= containerWidth && 0 <= f1y1 && f1y1 <= containerHeight && 0 <= f2y1 && f2y1 <= containerHeight; - - var pan = cy.pan(); - var zoom = cy.zoom(); - - distance1 = distance(f1x1, f1y1, f2x1, f2y1); - distance1Sq = distanceSq(f1x1, f1y1, f2x1, f2y1); - center1 = [(f1x1 + f2x1) / 2, (f1y1 + f2y1) / 2]; - modelCenter1 = [(center1[0] - pan.x) / zoom, (center1[1] - pan.y) / zoom]; - - // consider context tap - var cxtDistThreshold = 200; - var cxtDistThresholdSq = cxtDistThreshold * cxtDistThreshold; - if (distance1Sq < cxtDistThresholdSq && !e.touches[2]) { - - var near1 = r.findNearestElement(now[0], now[1], true, true); - var near2 = r.findNearestElement(now[2], now[3], true, true); - - if (near1 && near1.isNode()) { - near1.activate().emit({ - originalEvent: e, - type: 'cxttapstart', - position: { x: now[0], y: now[1] } - }); - r.touchData.start = near1; - } else if (near2 && near2.isNode()) { - near2.activate().emit({ - originalEvent: e, - type: 'cxttapstart', - position: { x: now[0], y: now[1] } - }); - r.touchData.start = near2; - } else { - cy.emit({ - originalEvent: e, - type: 'cxttapstart', - position: { x: now[0], y: now[1] } - }); - } - - if (r.touchData.start) { - r.touchData.start._private.grabbed = false; - } - r.touchData.cxt = true; - r.touchData.cxtDragged = false; - r.data.bgActivePosistion = undefined; - - r.redraw(); - return; - } - } - - if (e.touches[2]) { - // ignore - } else if (e.touches[1]) { - // ignore - } else if (e.touches[0]) { - var nears = r.findNearestElements(now[0], now[1], true, true); - var near = nears[0]; - - if (near != null) { - near.activate(); - - r.touchData.start = near; - r.touchData.starts = nears; - - if (r.nodeIsGrabbable(near)) { - - var draggedEles = r.dragData.touchDragEles = []; - var selectedNodes = null; - - r.redrawHint('eles', true); - r.redrawHint('drag', true); - - if (near.selected()) { - // reset drag elements, since near will be added again - - selectedNodes = cy.$(function (ele) { - return ele.selected() && r.nodeIsGrabbable(ele); - }); - - addNodesToDrag(selectedNodes, { addToList: draggedEles }); - } else { - addNodeToDrag(near, { addToList: draggedEles }); - } - - setGrabTarget(near); - - var makeEvent = function makeEvent(type) { - return { - originalEvent: e, - type: type, - position: { x: now[0], y: now[1] } - }; - }; - - near.emit(makeEvent('grabon')); - - if (selectedNodes) { - selectedNodes.forEach(function (n) { - n.emit(makeEvent('grab')); - }); - } else { - near.emit(makeEvent('grab')); - } - } - } - - triggerEvents(near, ['touchstart', 'tapstart', 'vmousedown'], e, { - position: { x: now[0], y: now[1] } - }); - - if (near == null) { - r.data.bgActivePosistion = { - x: pos[0], - y: pos[1] - }; - - r.redrawHint('select', true); - r.redraw(); - } - - // Tap, taphold - // ----- - - r.touchData.singleTouchMoved = false; - r.touchData.singleTouchStartTime = +new Date(); - - clearTimeout(r.touchData.tapholdTimeout); - r.touchData.tapholdTimeout = setTimeout(function () { - if (r.touchData.singleTouchMoved === false && !r.pinching // if pinching, then taphold unselect shouldn't take effect - && !r.touchData.selecting // box selection shouldn't allow taphold through - ) { - triggerEvents(r.touchData.start, ['taphold'], e, { - position: { x: now[0], y: now[1] } - }); - - if (!r.touchData.start) { - cy.$(':selected').unselect(); - } - } - }, r.tapholdDuration); - } - - if (e.touches.length >= 1) { - var sPos = r.touchData.startPosition = []; - - for (var i = 0; i < now.length; i++) { - sPos[i] = earlier[i] = now[i]; - } - - var touch0 = e.touches[0]; - - r.touchData.startGPosition = [touch0.clientX, touch0.clientY]; - } - }, false); - - var touchmoveHandler; - r.registerBinding(window, 'touchmove', touchmoveHandler = function touchmoveHandler(e) { - // eslint-disable-line no-undef - var capture = r.touchData.capture; - - if (!capture && !eventInContainer(e)) { - return; - } - - var select = r.selection; - var cy = r.cy; - var now = r.touchData.now; - var earlier = r.touchData.earlier; - var zoom = cy.zoom(); - - if (e.touches[0]) { - var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);now[0] = pos[0];now[1] = pos[1]; - } - if (e.touches[1]) { - var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);now[2] = pos[0];now[3] = pos[1]; - } - if (e.touches[2]) { - var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);now[4] = pos[0];now[5] = pos[1]; - } - - var startGPos = r.touchData.startGPosition; - var isOverThresholdDrag; - - if (capture && e.touches[0] && startGPos) { - var disp = [];for (var j = 0; j < now.length; j++) { - disp[j] = now[j] - earlier[j]; - } - var dx = e.touches[0].clientX - startGPos[0]; - var dx2 = dx * dx; - var dy = e.touches[0].clientY - startGPos[1]; - var dy2 = dy * dy; - var dist2 = dx2 + dy2; - - isOverThresholdDrag = dist2 >= r.touchTapThreshold2; - } - - // context swipe cancelling - if (capture && r.touchData.cxt) { - e.preventDefault(); - - var f1x2 = e.touches[0].clientX - offsetLeft, - f1y2 = e.touches[0].clientY - offsetTop; - var f2x2 = e.touches[1].clientX - offsetLeft, - f2y2 = e.touches[1].clientY - offsetTop; - // var distance2 = distance( f1x2, f1y2, f2x2, f2y2 ); - var distance2Sq = distanceSq(f1x2, f1y2, f2x2, f2y2); - var factorSq = distance2Sq / distance1Sq; - - var distThreshold = 150; - var distThresholdSq = distThreshold * distThreshold; - var factorThreshold = 1.5; - var factorThresholdSq = factorThreshold * factorThreshold; - - // cancel ctx gestures if the distance b/t the fingers increases - if (factorSq >= factorThresholdSq || distance2Sq >= distThresholdSq) { - r.touchData.cxt = false; - - r.data.bgActivePosistion = undefined; - - r.redrawHint('select', true); - - var cxtEvt = { - originalEvent: e, - type: 'cxttapend', - position: { x: now[0], y: now[1] } - }; - - if (r.touchData.start) { - r.touchData.start.unactivate().emit(cxtEvt); - - r.touchData.start = null; - } else { - cy.emit(cxtEvt); - } - } - } - - // context swipe - if (capture && r.touchData.cxt) { - var cxtEvt = { - originalEvent: e, - type: 'cxtdrag', - position: { x: now[0], y: now[1] } - }; - r.data.bgActivePosistion = undefined; - r.redrawHint('select', true); - - if (r.touchData.start) { - r.touchData.start.emit(cxtEvt); - } else { - cy.emit(cxtEvt); - } - - if (r.touchData.start) { - r.touchData.start._private.grabbed = false; - } - r.touchData.cxtDragged = true; - - var near = r.findNearestElement(now[0], now[1], true, true); - - if (!r.touchData.cxtOver || near !== r.touchData.cxtOver) { - - if (r.touchData.cxtOver) { - r.touchData.cxtOver.emit({ - originalEvent: e, - type: 'cxtdragout', - position: { x: now[0], y: now[1] } - }); - } - - r.touchData.cxtOver = near; - - if (near) { - near.emit({ - originalEvent: e, - type: 'cxtdragover', - position: { x: now[0], y: now[1] } - }); - } - } - - // box selection - } else if (capture && e.touches[2] && cy.boxSelectionEnabled()) { - e.preventDefault(); - - r.data.bgActivePosistion = undefined; - - this.lastThreeTouch = +new Date(); - - if (!r.touchData.selecting) { - cy.emit('boxstart'); - } - - r.touchData.selecting = true; - - r.redrawHint('select', true); - - if (!select || select.length === 0 || select[0] === undefined) { - select[0] = (now[0] + now[2] + now[4]) / 3; - select[1] = (now[1] + now[3] + now[5]) / 3; - select[2] = (now[0] + now[2] + now[4]) / 3 + 1; - select[3] = (now[1] + now[3] + now[5]) / 3 + 1; - } else { - select[2] = (now[0] + now[2] + now[4]) / 3; - select[3] = (now[1] + now[3] + now[5]) / 3; - } - - select[4] = 1; - r.touchData.selecting = true; - - r.redraw(); - - // pinch to zoom - } else if (capture && e.touches[1] && cy.zoomingEnabled() && cy.panningEnabled() && cy.userZoomingEnabled() && cy.userPanningEnabled()) { - // two fingers => pinch to zoom - e.preventDefault(); - - r.data.bgActivePosistion = undefined; - r.redrawHint('select', true); - - var draggedEles = r.dragData.touchDragEles; - if (draggedEles) { - r.redrawHint('drag', true); - - for (var i = 0; i < draggedEles.length; i++) { - var de_p = draggedEles[i]._private; - - de_p.grabbed = false; - de_p.rscratch.inDragLayer = false; - } - } - - // (x2, y2) for fingers 1 and 2 - var f1x2 = e.touches[0].clientX - offsetLeft, - f1y2 = e.touches[0].clientY - offsetTop; - var f2x2 = e.touches[1].clientX - offsetLeft, - f2y2 = e.touches[1].clientY - offsetTop; - - var distance2 = distance(f1x2, f1y2, f2x2, f2y2); - // var distance2Sq = distanceSq( f1x2, f1y2, f2x2, f2y2 ); - // var factor = Math.sqrt( distance2Sq ) / Math.sqrt( distance1Sq ); - var factor = distance2 / distance1; - - if (twoFingersStartInside) { - // delta finger1 - var df1x = f1x2 - f1x1; - var df1y = f1y2 - f1y1; - - // delta finger 2 - var df2x = f2x2 - f2x1; - var df2y = f2y2 - f2y1; - - // translation is the normalised vector of the two fingers movement - // i.e. so pinching cancels out and moving together pans - var tx = (df1x + df2x) / 2; - var ty = (df1y + df2y) / 2; - - // adjust factor by the speed multiplier - // var speed = 1.5; - // if( factor > 1 ){ - // factor = (factor - 1) * speed + 1; - // } else { - // factor = 1 - (1 - factor) * speed; - // } - - // now calculate the zoom - var zoom1 = cy.zoom(); - var zoom2 = zoom1 * factor; - var pan1 = cy.pan(); - - // the model center point converted to the current rendered pos - var ctrx = modelCenter1[0] * zoom1 + pan1.x; - var ctry = modelCenter1[1] * zoom1 + pan1.y; - - var pan2 = { - x: -zoom2 / zoom1 * (ctrx - pan1.x - tx) + ctrx, - y: -zoom2 / zoom1 * (ctry - pan1.y - ty) + ctry - }; - - // remove dragged eles - if (r.touchData.start && r.touchData.start.active()) { - var draggedEles = r.dragData.touchDragEles; - - freeDraggedElements(draggedEles); - - r.redrawHint('drag', true); - r.redrawHint('eles', true); - - r.touchData.start.unactivate().emit('free'); - } - - cy.viewport({ - zoom: zoom2, - pan: pan2, - cancelOnFailedZoom: true - }); - - distance1 = distance2; - f1x1 = f1x2; - f1y1 = f1y2; - f2x1 = f2x2; - f2y1 = f2y2; - - r.pinching = true; - } - - // Re-project - if (e.touches[0]) { - var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);now[0] = pos[0];now[1] = pos[1]; - } - if (e.touches[1]) { - var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);now[2] = pos[0];now[3] = pos[1]; - } - if (e.touches[2]) { - var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);now[4] = pos[0];now[5] = pos[1]; - } - } else if (e.touches[0]) { - var start = r.touchData.start; - var last = r.touchData.last; - var near; - - if (!r.hoverData.draggingEles && !r.swipePanning) { - near = r.findNearestElement(now[0], now[1], true, true); - } - - if (capture && start != null) { - e.preventDefault(); - } - - // dragging nodes - if (capture && start != null && r.nodeIsDraggable(start)) { - - if (isOverThresholdDrag) { - // then dragging can happen - var draggedEles = r.dragData.touchDragEles; - var justStartedDrag = !r.dragData.didDrag; - - if (justStartedDrag) { - addNodesToDrag(cy.collection(draggedEles), { inDragLayer: true }); - } - - for (var k = 0; k < draggedEles.length; k++) { - var draggedEle = draggedEles[k]; - - if (r.nodeIsDraggable(draggedEle) && draggedEle.grabbed()) { - r.dragData.didDrag = true; - var dPos = draggedEle.position(); - - if (is.number(disp[0]) && is.number(disp[1])) { - dPos.x += disp[0]; - dPos.y += disp[1]; - } - - if (justStartedDrag) { - r.redrawHint('eles', true); - - var dragDelta = r.touchData.dragDelta; - - if (dragDelta && is.number(dragDelta[0]) && is.number(dragDelta[1])) { - dPos.x += dragDelta[0]; - dPos.y += dragDelta[1]; - } - } - } - } - - var tcol = cy.collection(draggedEles); - - tcol.dirtyCompoundBoundsCache(); - tcol.emit('position drag'); - - r.hoverData.draggingEles = true; - - r.redrawHint('drag', true); - - if (r.touchData.startPosition[0] == earlier[0] && r.touchData.startPosition[1] == earlier[1]) { - - r.redrawHint('eles', true); - } - - r.redraw(); - } else { - // otherise keep track of drag delta for later - var dragDelta = r.touchData.dragDelta = r.touchData.dragDelta || []; - - if (dragDelta.length === 0) { - dragDelta.push(disp[0]); - dragDelta.push(disp[1]); - } else { - dragDelta[0] += disp[0]; - dragDelta[1] += disp[1]; - } - } - } - - // touchmove - { - triggerEvents(start || near, ['touchmove', 'tapdrag', 'vmousemove'], e, { - position: { x: now[0], y: now[1] } - }); - - if ((!start || !start.grabbed()) && near != last) { - if (last) { - last.emit({ originalEvent: e, type: 'tapdragout', position: { x: now[0], y: now[1] } }); - } - if (near) { - near.emit({ originalEvent: e, type: 'tapdragover', position: { x: now[0], y: now[1] } }); - } - } - - r.touchData.last = near; - } - - // check to cancel taphold - if (capture) { - for (var i = 0; i < now.length; i++) { - if (now[i] && r.touchData.startPosition[i] && isOverThresholdDrag) { - - r.touchData.singleTouchMoved = true; - } - } - } - - // panning - if (capture && (start == null || start.isEdge()) && cy.panningEnabled() && cy.userPanningEnabled()) { - - var allowPassthrough = allowPanningPassthrough(start, r.touchData.starts); - - if (allowPassthrough) { - e.preventDefault(); - - if (r.swipePanning) { - cy.panBy({ - x: disp[0] * zoom, - y: disp[1] * zoom - }); - } else if (isOverThresholdDrag) { - r.swipePanning = true; - - cy.panBy({ - x: dx * zoom, - y: dy * zoom - }); - - if (start) { - start.unactivate(); - - if (!r.data.bgActivePosistion) { - r.data.bgActivePosistion = math.array2point(r.touchData.startPosition); - } - - r.redrawHint('select', true); - - r.touchData.start = null; - } - } - } - - // Re-project - var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY); - now[0] = pos[0];now[1] = pos[1]; - } - } - - for (var j = 0; j < now.length; j++) { - earlier[j] = now[j]; - } - //r.redraw(); - - // the active bg indicator should be removed when making a swipe that is neither for dragging nodes or panning - if (capture && e.touches.length > 0 && !r.hoverData.draggingEles && !r.swipePanning && r.data.bgActivePosistion != null) { - r.data.bgActivePosistion = undefined; - r.redrawHint('select', true); - r.redraw(); - } - }, false); - var touchcancelHandler; - r.registerBinding(window, 'touchcancel', touchcancelHandler = function touchcancelHandler(e) { - // eslint-disable-line no-undef - var start = r.touchData.start; - - r.touchData.capture = false; - - if (start) { - start.unactivate(); - } - }); - - var touchendHandler; - r.registerBinding(window, 'touchend', touchendHandler = function touchendHandler(e) { - // eslint-disable-line no-undef - var start = r.touchData.start; - - var capture = r.touchData.capture; - - if (capture) { - if (e.touches.length === 0) { - r.touchData.capture = false; - } - - e.preventDefault(); - } else { - return; - } - - var select = r.selection; - - r.swipePanning = false; - r.hoverData.draggingEles = false; - - var cy = r.cy; - var zoom = cy.zoom(); - var now = r.touchData.now; - var earlier = r.touchData.earlier; - - if (e.touches[0]) { - var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);now[0] = pos[0];now[1] = pos[1]; - } - if (e.touches[1]) { - var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);now[2] = pos[0];now[3] = pos[1]; - } - if (e.touches[2]) { - var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);now[4] = pos[0];now[5] = pos[1]; - } - - if (start) { - start.unactivate(); - } - - var ctxTapend; - if (r.touchData.cxt) { - ctxTapend = { - originalEvent: e, - type: 'cxttapend', - position: { x: now[0], y: now[1] } - }; - - if (start) { - start.emit(ctxTapend); - } else { - cy.emit(ctxTapend); - } - - if (!r.touchData.cxtDragged) { - var ctxTap = { - originalEvent: e, - type: 'cxttap', - position: { x: now[0], y: now[1] } - }; - - if (start) { - start.emit(ctxTap); - } else { - cy.emit(ctxTap); - } - } - - if (r.touchData.start) { - r.touchData.start._private.grabbed = false; - } - r.touchData.cxt = false; - r.touchData.start = null; - - r.redraw(); - return; - } - - // no more box selection if we don't have three fingers - if (!e.touches[2] && cy.boxSelectionEnabled() && r.touchData.selecting) { - r.touchData.selecting = false; - - var box = cy.collection(r.getAllInBox(select[0], select[1], select[2], select[3])); - - select[0] = undefined; - select[1] = undefined; - select[2] = undefined; - select[3] = undefined; - select[4] = 0; - - r.redrawHint('select', true); - - cy.emit('boxend'); - - var eleWouldBeSelected = function eleWouldBeSelected(ele) { - return ele.selectable() && !ele.selected(); - }; - - box.emit('box').stdFilter(eleWouldBeSelected).select().emit('boxselect'); - - if (box.nonempty()) { - r.redrawHint('eles', true); - } - - r.redraw(); - } - - if (start != null) { - start.unactivate(); - } - - if (e.touches[2]) { - r.data.bgActivePosistion = undefined; - r.redrawHint('select', true); - } else if (e.touches[1]) { - // ignore - } else if (e.touches[0]) { - // ignore - - // Last touch released - } else if (!e.touches[0]) { - - r.data.bgActivePosistion = undefined; - r.redrawHint('select', true); - - var draggedEles = r.dragData.touchDragEles; - - if (start != null) { - - var startWasGrabbed = start._private.grabbed; - - freeDraggedElements(draggedEles); - - r.redrawHint('drag', true); - r.redrawHint('eles', true); - - if (startWasGrabbed) { - start.emit('free'); - } - - triggerEvents(start, ['touchend', 'tapend', 'vmouseup', 'tapdragout'], e, { - position: { x: now[0], y: now[1] } - }); - - start.unactivate(); - - r.touchData.start = null; - } else { - var near = r.findNearestElement(now[0], now[1], true, true); - - triggerEvents(near, ['touchend', 'tapend', 'vmouseup', 'tapdragout'], e, { - position: { x: now[0], y: now[1] } - }); - } - - var dx = r.touchData.startPosition[0] - now[0]; - var dx2 = dx * dx; - var dy = r.touchData.startPosition[1] - now[1]; - var dy2 = dy * dy; - var dist2 = dx2 + dy2; - var rdist2 = dist2 * zoom * zoom; - - // Prepare to select the currently touched node, only if it hasn't been dragged past a certain distance - if (start != null && !r.dragData.didDrag // didn't drag nodes around - && start._private.selectable && rdist2 < r.touchTapThreshold2 && !r.pinching // pinch to zoom should not affect selection - ) { - - if (cy.selectionType() === 'single') { - cy.$(':selected').unmerge(start).unselect(); - start.select(); - } else { - if (start.selected()) { - start.unselect(); - } else { - start.select(); - } - } - - r.redrawHint('eles', true); - } - - // Tap event, roughly same as mouse click event for touch - if (!r.touchData.singleTouchMoved) { - triggerEvents(start, ['tap', 'vclick'], e, { - position: { x: now[0], y: now[1] } - }); - } - - r.touchData.singleTouchMoved = true; - } - - for (var j = 0; j < now.length; j++) { - earlier[j] = now[j]; - } - - r.dragData.didDrag = false; // reset for next mousedown - - if (e.touches.length === 0) { - r.touchData.dragDelta = []; - r.touchData.startPosition = null; - r.touchData.startGPosition = null; - } - - if (e.touches.length < 2) { - r.pinching = false; - r.redrawHint('eles', true); - r.redraw(); - } - - //r.redraw(); - }, false); - - // fallback compatibility layer for ms pointer events - if (typeof TouchEvent === 'undefined') { - - var pointers = []; - - var makeTouch = function makeTouch(e) { - return { - clientX: e.clientX, - clientY: e.clientY, - force: 1, - identifier: e.pointerId, - pageX: e.pageX, - pageY: e.pageY, - radiusX: e.width / 2, - radiusY: e.height / 2, - screenX: e.screenX, - screenY: e.screenY, - target: e.target - }; - }; - - var makePointer = function makePointer(e) { - return { - event: e, - touch: makeTouch(e) - }; - }; - - var addPointer = function addPointer(e) { - pointers.push(makePointer(e)); - }; - - var removePointer = function removePointer(e) { - for (var i = 0; i < pointers.length; i++) { - var p = pointers[i]; - - if (p.event.pointerId === e.pointerId) { - pointers.splice(i, 1); - return; - } - } - }; - - var updatePointer = function updatePointer(e) { - var p = pointers.filter(function (p) { - return p.event.pointerId === e.pointerId; - })[0]; - - p.event = e; - p.touch = makeTouch(e); - }; - - var addTouchesToEvent = function addTouchesToEvent(e) { - e.touches = pointers.map(function (p) { - return p.touch; - }); - }; - - var pointerIsMouse = function pointerIsMouse(e) { - return e.pointerType === 'mouse' || e.pointerType === 4; - }; - - r.registerBinding(r.container, 'pointerdown', function (e) { - if (pointerIsMouse(e)) { - return; - } // mouse already handled - - e.preventDefault(); - - addPointer(e); - - addTouchesToEvent(e); - touchstartHandler(e); - }); - - r.registerBinding(r.container, 'pointerup', function (e) { - if (pointerIsMouse(e)) { - return; - } // mouse already handled - - removePointer(e); - - addTouchesToEvent(e); - touchendHandler(e); - }); - - r.registerBinding(r.container, 'pointercancel', function (e) { - if (pointerIsMouse(e)) { - return; - } // mouse already handled - - removePointer(e); - - addTouchesToEvent(e); - touchcancelHandler(e); - }); - - r.registerBinding(r.container, 'pointermove', function (e) { - if (pointerIsMouse(e)) { - return; - } // mouse already handled - - e.preventDefault(); - - updatePointer(e); - - addTouchesToEvent(e); - touchmoveHandler(e); - }); - } -}; - -module.exports = BRp; - -/***/ }), -/* 121 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var math = __webpack_require__(2); - -var BRp = {}; - -BRp.generatePolygon = function (name, points) { - return this.nodeShapes[name] = { - renderer: this, - - name: name, - - points: points, - - draw: function draw(context, centerX, centerY, width, height) { - this.renderer.nodeShapeImpl('polygon', context, centerX, centerY, width, height, this.points); - }, - - intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { - return math.polygonIntersectLine(x, y, this.points, nodeX, nodeY, width / 2, height / 2, padding); - }, - - checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { - return math.pointInsidePolygon(x, y, this.points, centerX, centerY, width, height, [0, -1], padding); - } - }; -}; - -BRp.generateEllipse = function () { - return this.nodeShapes['ellipse'] = { - renderer: this, - - name: 'ellipse', - - draw: function draw(context, centerX, centerY, width, height) { - this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height); - }, - - intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { - return math.intersectLineEllipse(x, y, nodeX, nodeY, width / 2 + padding, height / 2 + padding); - }, - - checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { - return math.checkInEllipse(x, y, width, height, centerX, centerY, padding); - } - }; -}; - -BRp.generateRoundRectangle = function () { - return this.nodeShapes['roundrectangle'] = { - renderer: this, - - name: 'roundrectangle', - - points: math.generateUnitNgonPointsFitToSquare(4, 0), - - draw: function draw(context, centerX, centerY, width, height) { - this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height); - }, - - intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { - return math.roundRectangleIntersectLine(x, y, nodeX, nodeY, width, height, padding); - }, - - checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { - - var cornerRadius = math.getRoundRectangleRadius(width, height); - var diam = cornerRadius * 2; - - // Check hBox - if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - diam, [0, -1], padding)) { - return true; - } - - // Check vBox - if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width - diam, height, [0, -1], padding)) { - return true; - } - - // Check top left quarter circle - if (math.checkInEllipse(x, y, diam, diam, centerX - width / 2 + cornerRadius, centerY - height / 2 + cornerRadius, padding)) { - - return true; - } - - // Check top right quarter circle - if (math.checkInEllipse(x, y, diam, diam, centerX + width / 2 - cornerRadius, centerY - height / 2 + cornerRadius, padding)) { - - return true; - } - - // Check bottom right quarter circle - if (math.checkInEllipse(x, y, diam, diam, centerX + width / 2 - cornerRadius, centerY + height / 2 - cornerRadius, padding)) { - - return true; - } - - // Check bottom left quarter circle - if (math.checkInEllipse(x, y, diam, diam, centerX - width / 2 + cornerRadius, centerY + height / 2 - cornerRadius, padding)) { - - return true; - } - - return false; - } - }; -}; - -BRp.generateCutRectangle = function () { - return this.nodeShapes['cutrectangle'] = { - renderer: this, - - name: 'cutrectangle', - - cornerLength: math.getCutRectangleCornerLength(), - - points: math.generateUnitNgonPointsFitToSquare(4, 0), - - draw: function draw(context, centerX, centerY, width, height) { - this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height); - }, - - generateCutTrianglePts: function generateCutTrianglePts(width, height, centerX, centerY) { - var cl = this.cornerLength; - var hh = height / 2; - var hw = width / 2; - var xBegin = centerX - hw; - var xEnd = centerX + hw; - var yBegin = centerY - hh; - var yEnd = centerY + hh; - - // points are in clockwise order, inner (imaginary) triangle pt on [4, 5] - return { - topLeft: [xBegin, yBegin + cl, xBegin + cl, yBegin, xBegin + cl, yBegin + cl], - topRight: [xEnd - cl, yBegin, xEnd, yBegin + cl, xEnd - cl, yBegin + cl], - bottomRight: [xEnd, yEnd - cl, xEnd - cl, yEnd, xEnd - cl, yEnd - cl], - bottomLeft: [xBegin + cl, yEnd, xBegin, yEnd - cl, xBegin + cl, yEnd - cl] - }; - }, - - intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { - var cPts = this.generateCutTrianglePts(width + 2 * padding, height + 2 * padding, nodeX, nodeY); - var pts = [].concat.apply([], [cPts.topLeft.splice(0, 4), cPts.topRight.splice(0, 4), cPts.bottomRight.splice(0, 4), cPts.bottomLeft.splice(0, 4)]); - - return math.polygonIntersectLine(x, y, pts, nodeX, nodeY); - }, - - checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { - // Check hBox - if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - 2 * this.cornerLength, [0, -1], padding)) { - return true; - } - - // Check vBox - if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width - 2 * this.cornerLength, height, [0, -1], padding)) { - return true; - } - var cutTrianglePts = this.generateCutTrianglePts(width, height, centerX, centerY); - return math.pointInsidePolygonPoints(x, y, cutTrianglePts.topLeft) || math.pointInsidePolygonPoints(x, y, cutTrianglePts.topRight) || math.pointInsidePolygonPoints(x, y, cutTrianglePts.bottomRight) || math.pointInsidePolygonPoints(x, y, cutTrianglePts.bottomLeft); - } - - }; -}; - -BRp.generateBarrel = function () { - return this.nodeShapes['barrel'] = { - renderer: this, - - name: 'barrel', - - points: math.generateUnitNgonPointsFitToSquare(4, 0), - - draw: function draw(context, centerX, centerY, width, height) { - this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height); - }, - - intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { - // use two fixed t values for the bezier curve approximation - - var t0 = 0.15; - var t1 = 0.5; - var t2 = 0.85; - - var bPts = this.generateBarrelBezierPts(width + 2 * padding, height + 2 * padding, nodeX, nodeY); - - var approximateBarrelCurvePts = function approximateBarrelCurvePts(pts) { - // approximate curve pts based on the two t values - var m0 = math.qbezierPtAt({ x: pts[0], y: pts[1] }, { x: pts[2], y: pts[3] }, { x: pts[4], y: pts[5] }, t0); - var m1 = math.qbezierPtAt({ x: pts[0], y: pts[1] }, { x: pts[2], y: pts[3] }, { x: pts[4], y: pts[5] }, t1); - var m2 = math.qbezierPtAt({ x: pts[0], y: pts[1] }, { x: pts[2], y: pts[3] }, { x: pts[4], y: pts[5] }, t2); - - return [pts[0], pts[1], m0.x, m0.y, m1.x, m1.y, m2.x, m2.y, pts[4], pts[5]]; - }; - - var pts = [].concat(approximateBarrelCurvePts(bPts.topLeft), approximateBarrelCurvePts(bPts.topRight), approximateBarrelCurvePts(bPts.bottomRight), approximateBarrelCurvePts(bPts.bottomLeft)); - - return math.polygonIntersectLine(x, y, pts, nodeX, nodeY); - }, - - generateBarrelBezierPts: function generateBarrelBezierPts(width, height, centerX, centerY) { - var hh = height / 2; - var hw = width / 2; - var xBegin = centerX - hw; - var xEnd = centerX + hw; - var yBegin = centerY - hh; - var yEnd = centerY + hh; - - var curveConstants = math.getBarrelCurveConstants(width, height); - var hOffset = curveConstants.heightOffset; - var wOffset = curveConstants.widthOffset; - var ctrlPtXOffset = curveConstants.ctrlPtOffsetPct * width; - - // points are in clockwise order, inner (imaginary) control pt on [4, 5] - var pts = { - topLeft: [xBegin, yBegin + hOffset, xBegin + ctrlPtXOffset, yBegin, xBegin + wOffset, yBegin], - topRight: [xEnd - wOffset, yBegin, xEnd - ctrlPtXOffset, yBegin, xEnd, yBegin + hOffset], - bottomRight: [xEnd, yEnd - hOffset, xEnd - ctrlPtXOffset, yEnd, xEnd - wOffset, yEnd], - bottomLeft: [xBegin + wOffset, yEnd, xBegin + ctrlPtXOffset, yEnd, xBegin, yEnd - hOffset] - }; - - pts.topLeft.isTop = true; - pts.topRight.isTop = true; - pts.bottomLeft.isBottom = true; - pts.bottomRight.isBottom = true; - - return pts; - }, - - checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { - - var curveConstants = math.getBarrelCurveConstants(width, height); - var hOffset = curveConstants.heightOffset; - var wOffset = curveConstants.widthOffset; - - // Check hBox - if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - 2 * hOffset, [0, -1], padding)) { - return true; - } - - // Check vBox - if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width - 2 * wOffset, height, [0, -1], padding)) { - return true; - } - - var barrelCurvePts = this.generateBarrelBezierPts(width, height, centerX, centerY); - - var getCurveT = function getCurveT(x, y, curvePts) { - var x0 = curvePts[4]; - var x1 = curvePts[2]; - var x2 = curvePts[0]; - var y0 = curvePts[5]; - // var y1 = curvePts[ 3 ]; - var y2 = curvePts[1]; - - var xMin = Math.min(x0, x2); - var xMax = Math.max(x0, x2); - var yMin = Math.min(y0, y2); - var yMax = Math.max(y0, y2); - - if (xMin <= x && x <= xMax && yMin <= y && y <= yMax) { - var coeff = math.bezierPtsToQuadCoeff(x0, x1, x2); - var roots = math.solveQuadratic(coeff[0], coeff[1], coeff[2], x); - - var validRoots = roots.filter(function (r) { - return 0 <= r && r <= 1; - }); - - if (validRoots.length > 0) { - return validRoots[0]; - } - } - return null; - }; - - var curveRegions = Object.keys(barrelCurvePts); - for (var i = 0; i < curveRegions.length; i++) { - var corner = curveRegions[i]; - var cornerPts = barrelCurvePts[corner]; - var t = getCurveT(x, y, cornerPts); - - if (t == null) { - continue; - } - - var y0 = cornerPts[5]; - var y1 = cornerPts[3]; - var y2 = cornerPts[1]; - var bezY = math.qbezierAt(y0, y1, y2, t); - - if (cornerPts.isTop && bezY <= y) { - return true; - } - if (cornerPts.isBottom && y <= bezY) { - return true; - } - } - return false; - } - }; -}; - -BRp.generateBottomRoundrectangle = function () { - return this.nodeShapes['bottomroundrectangle'] = { - renderer: this, - - name: 'bottomroundrectangle', - - points: math.generateUnitNgonPointsFitToSquare(4, 0), - - draw: function draw(context, centerX, centerY, width, height) { - this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height); - }, - - intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { - var topStartX = nodeX - (width / 2 + padding); - var topStartY = nodeY - (height / 2 + padding); - var topEndY = topStartY; - var topEndX = nodeX + (width / 2 + padding); - - var topIntersections = math.finiteLinesIntersect(x, y, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false); - if (topIntersections.length > 0) { - return topIntersections; - } - - return math.roundRectangleIntersectLine(x, y, nodeX, nodeY, width, height, padding); - }, - - checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { - - var cornerRadius = math.getRoundRectangleRadius(width, height); - var diam = 2 * cornerRadius; - - // Check hBox - if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - diam, [0, -1], padding)) { - return true; - } - - // Check vBox - if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width - diam, height, [0, -1], padding)) { - return true; - } - - // check non-rounded top side - var outerWidth = width / 2 + 2 * padding; - var outerHeight = height / 2 + 2 * padding; - var points = [centerX - outerWidth, centerY - outerHeight, centerX - outerWidth, centerY, centerX + outerWidth, centerY, centerX + outerWidth, centerY - outerHeight]; - if (math.pointInsidePolygonPoints(x, y, points)) { - return true; - } - - // Check bottom right quarter circle - if (math.checkInEllipse(x, y, diam, diam, centerX + width / 2 - cornerRadius, centerY + height / 2 - cornerRadius, padding)) { - - return true; - } - - // Check bottom left quarter circle - if (math.checkInEllipse(x, y, diam, diam, centerX - width / 2 + cornerRadius, centerY + height / 2 - cornerRadius, padding)) { - - return true; - } - - return false; - } - }; -}; - -BRp.registerNodeShapes = function () { - var nodeShapes = this.nodeShapes = {}; - var renderer = this; - - this.generateEllipse(); - - this.generatePolygon('triangle', math.generateUnitNgonPointsFitToSquare(3, 0)); - - this.generatePolygon('rectangle', math.generateUnitNgonPointsFitToSquare(4, 0)); - nodeShapes['square'] = nodeShapes['rectangle']; - - this.generateRoundRectangle(); - - this.generateCutRectangle(); - - this.generateBarrel(); - - this.generateBottomRoundrectangle(); - - this.generatePolygon('diamond', [0, 1, 1, 0, 0, -1, -1, 0]); - - this.generatePolygon('pentagon', math.generateUnitNgonPointsFitToSquare(5, 0)); - - this.generatePolygon('hexagon', math.generateUnitNgonPointsFitToSquare(6, 0)); - - this.generatePolygon('heptagon', math.generateUnitNgonPointsFitToSquare(7, 0)); - - this.generatePolygon('octagon', math.generateUnitNgonPointsFitToSquare(8, 0)); - - var star5Points = new Array(20); - { - var outerPoints = math.generateUnitNgonPoints(5, 0); - var innerPoints = math.generateUnitNgonPoints(5, Math.PI / 5); - - // Outer radius is 1; inner radius of star is smaller - var innerRadius = 0.5 * (3 - Math.sqrt(5)); - innerRadius *= 1.57; - - for (var i = 0; i < innerPoints.length / 2; i++) { - innerPoints[i * 2] *= innerRadius; - innerPoints[i * 2 + 1] *= innerRadius; - } - - for (var i = 0; i < 20 / 4; i++) { - star5Points[i * 4] = outerPoints[i * 2]; - star5Points[i * 4 + 1] = outerPoints[i * 2 + 1]; - - star5Points[i * 4 + 2] = innerPoints[i * 2]; - star5Points[i * 4 + 3] = innerPoints[i * 2 + 1]; - } - } - - star5Points = math.fitPolygonToSquare(star5Points); - - this.generatePolygon('star', star5Points); - - this.generatePolygon('vee', [-1, -1, 0, -0.333, 1, -1, 0, 1]); - - this.generatePolygon('rhomboid', [-1, -1, 0.333, -1, 1, 1, -0.333, 1]); - - this.generatePolygon('concavehexagon', [-1, -0.95, -0.75, 0, -1, 0.95, 1, 0.95, 0.75, 0, 1, -0.95]); - - this.generatePolygon('tag', [-1, -1, 0.25, -1, 1, 0, 0.25, 1, -1, 1]); - - nodeShapes.makePolygon = function (points) { - - // use caching on user-specified polygons so they are as fast as native shapes - - var key = points.join('$'); - var name = 'polygon-' + key; - var shape; - - if (shape = this[name]) { - // got cached shape - return shape; - } - - // create and cache new shape - return renderer.generatePolygon(name, points); - }; -}; - -module.exports = BRp; - -/***/ }), -/* 122 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); - -var BRp = {}; - -BRp.timeToRender = function () { - return this.redrawTotalTime / this.redrawCount; -}; - -BRp.redraw = function (options) { - options = options || util.staticEmptyObject(); - - var r = this; - - if (r.averageRedrawTime === undefined) { - r.averageRedrawTime = 0; - } - if (r.lastRedrawTime === undefined) { - r.lastRedrawTime = 0; - } - if (r.lastDrawTime === undefined) { - r.lastDrawTime = 0; - } - - r.requestedFrame = true; - r.renderOptions = options; -}; - -BRp.beforeRender = function (fn, priority) { - // the renderer can't add tick callbacks when destroyed - if (this.destroyed) { - return; - } - - priority = priority || 0; - - var cbs = this.beforeRenderCallbacks; - - cbs.push({ fn: fn, priority: priority }); - - // higher priority callbacks executed first - cbs.sort(function (a, b) { - return b.priority - a.priority; - }); -}; - -var beforeRenderCallbacks = function beforeRenderCallbacks(r, willDraw, startTime) { - var cbs = r.beforeRenderCallbacks; - - for (var i = 0; i < cbs.length; i++) { - cbs[i].fn(willDraw, startTime); - } -}; - -BRp.startRenderLoop = function () { - var r = this; - - if (r.renderLoopStarted) { - return; - } else { - r.renderLoopStarted = true; - } - - var renderFn = function renderFn(requestTime) { - if (r.destroyed) { - return; - } - - if (r.requestedFrame && !r.skipFrame) { - beforeRenderCallbacks(r, true, requestTime); - - var startTime = util.performanceNow(); - - r.render(r.renderOptions); - - var endTime = r.lastDrawTime = util.performanceNow(); - - if (r.averageRedrawTime === undefined) { - r.averageRedrawTime = endTime - startTime; - } - - if (r.redrawCount === undefined) { - r.redrawCount = 0; - } - - r.redrawCount++; - - if (r.redrawTotalTime === undefined) { - r.redrawTotalTime = 0; - } - - var duration = endTime - startTime; - - r.redrawTotalTime += duration; - r.lastRedrawTime = duration; - - // use a weighted average with a bias from the previous average so we don't spike so easily - r.averageRedrawTime = r.averageRedrawTime / 2 + duration / 2; - - r.requestedFrame = false; - } else { - beforeRenderCallbacks(r, false, requestTime); - } - - r.skipFrame = false; - - util.requestAnimationFrame(renderFn); - }; - - util.requestAnimationFrame(renderFn); -}; - -module.exports = BRp; - -/***/ }), -/* 123 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/* -The canvas renderer was written by Yue Dong. - -Modifications tracked on Github. -*/ - -var util = __webpack_require__(1); -var is = __webpack_require__(0); -var ElementTextureCache = __webpack_require__(124); -var LayeredTextureCache = __webpack_require__(125); - -var CR = CanvasRenderer; -var CRp = CanvasRenderer.prototype; - -CRp.CANVAS_LAYERS = 3; -// -CRp.SELECT_BOX = 0; -CRp.DRAG = 1; -CRp.NODE = 2; - -CRp.BUFFER_COUNT = 3; -// -CRp.TEXTURE_BUFFER = 0; -CRp.MOTIONBLUR_BUFFER_NODE = 1; -CRp.MOTIONBLUR_BUFFER_DRAG = 2; - -function CanvasRenderer(options) { - var r = this; - - r.data = { - canvases: new Array(CRp.CANVAS_LAYERS), - contexts: new Array(CRp.CANVAS_LAYERS), - canvasNeedsRedraw: new Array(CRp.CANVAS_LAYERS), - - bufferCanvases: new Array(CRp.BUFFER_COUNT), - bufferContexts: new Array(CRp.CANVAS_LAYERS) - }; - - var tapHlOff = '-webkit-tap-highlight-color: rgba(0,0,0,0);'; - - r.data.canvasContainer = document.createElement('div'); // eslint-disable-line no-undef - var containerStyle = r.data.canvasContainer.style; - r.data.canvasContainer.setAttribute('style', tapHlOff); - containerStyle.position = 'relative'; - containerStyle.zIndex = '0'; - containerStyle.overflow = 'hidden'; - - var container = options.cy.container(); - container.appendChild(r.data.canvasContainer); - - if ((container.getAttribute('style') || '').indexOf(tapHlOff) < 0) { - container.setAttribute('style', (container.getAttribute('style') || '') + tapHlOff); - } - - for (var i = 0; i < CRp.CANVAS_LAYERS; i++) { - var canvas = r.data.canvases[i] = document.createElement('canvas'); // eslint-disable-line no-undef - r.data.contexts[i] = canvas.getContext('2d'); - canvas.setAttribute('style', '-webkit-user-select: none; -moz-user-select: -moz-none; user-select: none; -webkit-tap-highlight-color: rgba(0,0,0,0); outline-style: none;' + (is.ms() ? ' -ms-touch-action: none; touch-action: none; ' : '')); - canvas.style.position = 'absolute'; - canvas.setAttribute('data-id', 'layer' + i); - canvas.style.zIndex = String(CRp.CANVAS_LAYERS - i); - r.data.canvasContainer.appendChild(canvas); - - r.data.canvasNeedsRedraw[i] = false; - } - r.data.topCanvas = r.data.canvases[0]; - - r.data.canvases[CRp.NODE].setAttribute('data-id', 'layer' + CRp.NODE + '-node'); - r.data.canvases[CRp.SELECT_BOX].setAttribute('data-id', 'layer' + CRp.SELECT_BOX + '-selectbox'); - r.data.canvases[CRp.DRAG].setAttribute('data-id', 'layer' + CRp.DRAG + '-drag'); - - for (var i = 0; i < CRp.BUFFER_COUNT; i++) { - r.data.bufferCanvases[i] = document.createElement('canvas'); // eslint-disable-line no-undef - r.data.bufferContexts[i] = r.data.bufferCanvases[i].getContext('2d'); - r.data.bufferCanvases[i].style.position = 'absolute'; - r.data.bufferCanvases[i].setAttribute('data-id', 'buffer' + i); - r.data.bufferCanvases[i].style.zIndex = String(-i - 1); - r.data.bufferCanvases[i].style.visibility = 'hidden'; - //r.data.canvasContainer.appendChild(r.data.bufferCanvases[i]); - } - - r.pathsEnabled = true; - - r.data.eleTxrCache = new ElementTextureCache(r); - r.data.lyrTxrCache = new LayeredTextureCache(r, r.data.eleTxrCache); - - r.onUpdateEleCalcs(function invalidateTextureCaches(willDraw, eles) { - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - var rs = ele._private.rstyle; - var de = rs.dirtyEvents; - - if (ele.isNode() && de && de.length === 1 && de['position']) { - // then keep cached ele texture - } else { - r.data.eleTxrCache.invalidateElement(ele); - - // NB this block of code should not be ported to 3.3 (unstable branch). - // - This check is unneccesary in 3.3 as caches will be stored without respect to opacity. - // - This fix may result in lowered performance for compound graphs. - // - Ref : Opacity of child node is not updated for certain zoom levels after parent opacity is overriden #2078 - if (ele.isParent() && de['style']) { - var op1 = rs.prevParentOpacity; - var op2 = ele.pstyle('opacity').pfValue; - - rs.prevParentOpacity = op2; - - if (op1 !== op2) { - var descs = ele.descendants(); - - for (var j = 0; j < descs.length; j++) { - r.data.eleTxrCache.invalidateElement(descs[j]); - } - } - } - } - } - - if (eles.length > 0) { - r.data.lyrTxrCache.invalidateElements(eles); - } - }); -} - -CRp.redrawHint = function (group, bool) { - var r = this; - - switch (group) { - case 'eles': - r.data.canvasNeedsRedraw[CRp.NODE] = bool; - break; - case 'drag': - r.data.canvasNeedsRedraw[CRp.DRAG] = bool; - break; - case 'select': - r.data.canvasNeedsRedraw[CRp.SELECT_BOX] = bool; - break; - } -}; - -// whether to use Path2D caching for drawing -var pathsImpld = typeof Path2D !== 'undefined'; - -CRp.path2dEnabled = function (on) { - if (on === undefined) { - return this.pathsEnabled; - } - - this.pathsEnabled = on ? true : false; -}; - -CRp.usePaths = function () { - return pathsImpld && this.pathsEnabled; -}; - -[__webpack_require__(126), __webpack_require__(127), __webpack_require__(128), __webpack_require__(129), __webpack_require__(130), __webpack_require__(131), __webpack_require__(132), __webpack_require__(133), __webpack_require__(134), __webpack_require__(135)].forEach(function (props) { - util.extend(CRp, props); -}); - -module.exports = CR; - -/***/ }), -/* 124 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var math = __webpack_require__(2); -var util = __webpack_require__(1); -var Heap = __webpack_require__(9); -var defs = __webpack_require__(19); - -var minTxrH = 25; // the size of the texture cache for small height eles (special case) -var txrStepH = 50; // the min size of the regular cache, and the size it increases with each step up -var minLvl = -4; // when scaling smaller than that we don't need to re-render -var maxLvl = 2; // when larger than this scale just render directly (caching is not helpful) -var maxZoom = 3.99; // beyond this zoom level, layered textures are not used -var eleTxrSpacing = 8; // spacing between elements on textures to avoid blitting overlaps -var defTxrWidth = 1024; // default/minimum texture width -var maxTxrW = 1024; // the maximum width of a texture -var maxTxrH = 1024; // the maximum height of a texture -var minUtility = 0.5; // if usage of texture is less than this, it is retired -var maxFullness = 0.8; // fullness of texture after which queue removal is checked -var maxFullnessChecks = 10; // dequeued after this many checks -var allowEdgeTxrCaching = false; // whether edges can be cached as textures (TODO maybe better on if webgl supported?) -var allowParentTxrCaching = false; // whether parent nodes can be cached as textures (TODO maybe better on if webgl supported?) -var deqCost = 0.15; // % of add'l rendering cost allowed for dequeuing ele caches each frame -var deqAvgCost = 0.1; // % of add'l rendering cost compared to average overall redraw time -var deqNoDrawCost = 0.9; // % of avg frame time that can be used for dequeueing when not drawing -var deqFastCost = 0.9; // % of frame time to be used when >60fps -var deqRedrawThreshold = 100; // time to batch redraws together from dequeueing to allow more dequeueing calcs to happen in the meanwhile -var maxDeqSize = 1; // number of eles to dequeue and render at higher texture in each batch - -var getTxrReasons = { - dequeue: 'dequeue', - downscale: 'downscale', - highQuality: 'highQuality' -}; - -var ElementTextureCache = function ElementTextureCache(renderer) { - var self = this; - - self.renderer = renderer; - self.onDequeues = []; - - self.setupDequeueing(); -}; - -var ETCp = ElementTextureCache.prototype; - -ETCp.reasons = getTxrReasons; - -// the list of textures in which new subtextures for elements can be placed -ETCp.getTextureQueue = function (txrH) { - var self = this; - self.eleImgCaches = self.eleImgCaches || {}; - - return self.eleImgCaches[txrH] = self.eleImgCaches[txrH] || []; -}; - -// the list of usused textures which can be recycled (in use in texture queue) -ETCp.getRetiredTextureQueue = function (txrH) { - var self = this; - - var rtxtrQs = self.eleImgCaches.retired = self.eleImgCaches.retired || {}; - var rtxtrQ = rtxtrQs[txrH] = rtxtrQs[txrH] || []; - - return rtxtrQ; -}; - -// queue of element draw requests at different scale levels -ETCp.getElementQueue = function () { - var self = this; - - var q = self.eleCacheQueue = self.eleCacheQueue || new Heap(function (a, b) { - return b.reqs - a.reqs; - }); - - return q; -}; - -// queue of element draw requests at different scale levels (element id lookup) -ETCp.getElementIdToQueue = function () { - var self = this; - - var id2q = self.eleIdToCacheQueue = self.eleIdToCacheQueue || {}; - - return id2q; -}; - -ETCp.getElement = function (ele, bb, pxRatio, lvl, reason) { - var self = this; - var r = this.renderer; - var rs = ele._private.rscratch; - var zoom = r.cy.zoom(); - - if (bb.w === 0 || bb.h === 0 || !ele.visible()) { - return null; - } - - if (lvl == null) { - lvl = Math.ceil(math.log2(zoom * pxRatio)); - } - - if (lvl < minLvl) { - lvl = minLvl; - } else if (zoom >= maxZoom || lvl > maxLvl) { - return null; - } - - var scale = Math.pow(2, lvl); - var eleScaledH = bb.h * scale; - var eleScaledW = bb.w * scale; - var caches = rs.imgCaches = rs.imgCaches || {}; - var eleCache = caches[lvl]; - - if (eleCache) { - return eleCache; - } - - var txrH; // which texture height this ele belongs to - - if (eleScaledH <= minTxrH) { - txrH = minTxrH; - } else if (eleScaledH <= txrStepH) { - txrH = txrStepH; - } else { - txrH = Math.ceil(eleScaledH / txrStepH) * txrStepH; - } - - if (eleScaledH > maxTxrH || eleScaledW > maxTxrW || !allowEdgeTxrCaching && ele.isEdge() || !allowParentTxrCaching && ele.isParent()) { - return null; // caching large elements is not efficient - } - - var txrQ = self.getTextureQueue(txrH); - - // first try the second last one in case it has space at the end - var txr = txrQ[txrQ.length - 2]; - - var addNewTxr = function addNewTxr() { - return self.recycleTexture(txrH, eleScaledW) || self.addTexture(txrH, eleScaledW); - }; - - // try the last one if there is no second last one - if (!txr) { - txr = txrQ[txrQ.length - 1]; - } - - // if the last one doesn't exist, we need a first one - if (!txr) { - txr = addNewTxr(); - } - - // if there's no room in the current texture, we need a new one - if (txr.width - txr.usedWidth < eleScaledW) { - txr = addNewTxr(); - } - - var scaledLabelShown = r.eleTextBiggerThanMin(ele, scale); - var scalableFrom = function scalableFrom(otherCache) { - return otherCache && otherCache.scaledLabelShown === scaledLabelShown; - }; - - var deqing = reason && reason === getTxrReasons.dequeue; - var highQualityReq = reason && reason === getTxrReasons.highQuality; - var downscaleReq = reason && reason === getTxrReasons.downscale; - - var higherCache; // the nearest cache with a higher level - for (var l = lvl + 1; l <= maxLvl; l++) { - var c = caches[l]; - - if (c) { - higherCache = c;break; - } - } - - var oneUpCache = higherCache && higherCache.level === lvl + 1 ? higherCache : null; - - var downscale = function downscale() { - txr.context.drawImage(oneUpCache.texture.canvas, oneUpCache.x, 0, oneUpCache.width, oneUpCache.height, txr.usedWidth, 0, eleScaledW, eleScaledH); - }; - - // reset ele area in texture - txr.context.setTransform(1, 0, 0, 1, 0, 0); - txr.context.clearRect(txr.usedWidth, 0, eleScaledW, txrH); - - if (scalableFrom(oneUpCache)) { - // then we can relatively cheaply rescale the existing image w/o rerendering - downscale(); - } else if (scalableFrom(higherCache)) { - // then use the higher cache for now and queue the next level down - // to cheaply scale towards the smaller level - - if (highQualityReq) { - for (var l = higherCache.level; l > lvl; l--) { - oneUpCache = self.getElement(ele, bb, pxRatio, l, getTxrReasons.downscale); - } - - downscale(); - } else { - self.queueElement(ele, higherCache.level - 1); - - return higherCache; - } - } else { - - var lowerCache; // the nearest cache with a lower level - if (!deqing && !highQualityReq && !downscaleReq) { - for (var l = lvl - 1; l >= minLvl; l--) { - var c = caches[l]; - - if (c) { - lowerCache = c;break; - } - } - } - - if (scalableFrom(lowerCache)) { - // then use the lower quality cache for now and queue the better one for later - - self.queueElement(ele, lvl); - - return lowerCache; - } - - txr.context.translate(txr.usedWidth, 0); - txr.context.scale(scale, scale); - - r.drawElement(txr.context, ele, bb, scaledLabelShown); - - txr.context.scale(1 / scale, 1 / scale); - txr.context.translate(-txr.usedWidth, 0); - } - - eleCache = caches[lvl] = { - ele: ele, - x: txr.usedWidth, - texture: txr, - level: lvl, - scale: scale, - width: eleScaledW, - height: eleScaledH, - scaledLabelShown: scaledLabelShown - }; - - txr.usedWidth += Math.ceil(eleScaledW + eleTxrSpacing); - - txr.eleCaches.push(eleCache); - - self.checkTextureFullness(txr); - - return eleCache; -}; - -ETCp.invalidateElement = function (ele) { - var self = this; - var caches = ele._private.rscratch.imgCaches; - - if (caches) { - for (var lvl = minLvl; lvl <= maxLvl; lvl++) { - var cache = caches[lvl]; - - if (cache) { - var txr = cache.texture; - - // remove space from the texture it belongs to - txr.invalidatedWidth += cache.width; - - // remove refs with the element - caches[lvl] = null; - util.removeFromArray(txr.eleCaches, cache); - - // remove from queue since the old req was for the old state - self.removeFromQueue(ele); - - // might have to remove the entire texture if it's not efficiently using its space - self.checkTextureUtility(txr); - } - } - } -}; - -ETCp.checkTextureUtility = function (txr) { - // invalidate all entries in the cache if the cache size is small - if (txr.invalidatedWidth >= minUtility * txr.width) { - this.retireTexture(txr); - } -}; - -ETCp.checkTextureFullness = function (txr) { - // if texture has been mostly filled and passed over several times, remove - // it from the queue so we don't need to waste time looking at it to put new things - - var self = this; - var txrQ = self.getTextureQueue(txr.height); - - if (txr.usedWidth / txr.width > maxFullness && txr.fullnessChecks >= maxFullnessChecks) { - util.removeFromArray(txrQ, txr); - } else { - txr.fullnessChecks++; - } -}; - -ETCp.retireTexture = function (txr) { - var self = this; - var txrH = txr.height; - var txrQ = self.getTextureQueue(txrH); - - // retire the texture from the active / searchable queue: - - util.removeFromArray(txrQ, txr); - - txr.retired = true; - - // remove the refs from the eles to the caches: - - var eleCaches = txr.eleCaches; - - for (var i = 0; i < eleCaches.length; i++) { - var eleCache = eleCaches[i]; - var ele = eleCache.ele; - var lvl = eleCache.level; - var imgCaches = ele._private.rscratch.imgCaches; - - if (imgCaches) { - imgCaches[lvl] = null; - } - } - - util.clearArray(eleCaches); - - // add the texture to a retired queue so it can be recycled in future: - - var rtxtrQ = self.getRetiredTextureQueue(txrH); - - rtxtrQ.push(txr); -}; - -ETCp.addTexture = function (txrH, minW) { - var self = this; - var txrQ = self.getTextureQueue(txrH); - var txr = {}; - - txrQ.push(txr); - - txr.eleCaches = []; - - txr.height = txrH; - txr.width = Math.max(defTxrWidth, minW); - txr.usedWidth = 0; - txr.invalidatedWidth = 0; - txr.fullnessChecks = 0; - - txr.canvas = document.createElement('canvas'); // eslint-disable-line no-undef - txr.canvas.width = txr.width; - txr.canvas.height = txr.height; - - txr.context = txr.canvas.getContext('2d'); - - return txr; -}; - -ETCp.recycleTexture = function (txrH, minW) { - var self = this; - var txrQ = self.getTextureQueue(txrH); - var rtxtrQ = self.getRetiredTextureQueue(txrH); - - for (var i = 0; i < rtxtrQ.length; i++) { - var txr = rtxtrQ[i]; - - if (txr.width >= minW) { - txr.retired = false; - - txr.usedWidth = 0; - txr.invalidatedWidth = 0; - txr.fullnessChecks = 0; - - util.clearArray(txr.eleCaches); - - txr.context.setTransform(1, 0, 0, 1, 0, 0); - txr.context.clearRect(0, 0, txr.width, txr.height); - - util.removeFromArray(rtxtrQ, txr); - txrQ.push(txr); - - return txr; - } - } -}; - -ETCp.queueElement = function (ele, lvl) { - var self = this; - var q = self.getElementQueue(); - var id2q = self.getElementIdToQueue(); - var id = ele.id(); - var existingReq = id2q[id]; - - if (existingReq) { - // use the max lvl b/c in between lvls are cheap to make - existingReq.level = Math.max(existingReq.level, lvl); - existingReq.reqs++; - - q.updateItem(existingReq); - } else { - var req = { - ele: ele, - level: lvl, - reqs: 1 - }; - - q.push(req); - - id2q[id] = req; - } -}; - -ETCp.dequeue = function (pxRatio /*, extent*/) { - var self = this; - var q = self.getElementQueue(); - var id2q = self.getElementIdToQueue(); - var dequeued = []; - - for (var i = 0; i < maxDeqSize; i++) { - if (q.size() > 0) { - var req = q.pop(); - var ele = req.ele; - var caches = ele._private.rscratch.imgCaches; - - // dequeueing isn't necessary when an existing cache exists - if (caches[req.level] != null) { - continue; - } - - id2q[ele.id()] = null; - - dequeued.push(req); - - var bb = ele.boundingBox(); - - self.getElement(ele, bb, pxRatio, req.level, getTxrReasons.dequeue); - } else { - break; - } - } - - return dequeued; -}; - -ETCp.removeFromQueue = function (ele) { - var self = this; - var q = self.getElementQueue(); - var id2q = self.getElementIdToQueue(); - var req = id2q[ele.id()]; - - if (req != null) { - // bring to front of queue - req.reqs = util.MAX_INT; - q.updateItem(req); - - q.pop(); // remove from queue - - id2q[ele.id()] = null; // remove from lookup map - } -}; - -ETCp.onDequeue = function (fn) { - this.onDequeues.push(fn); -}; -ETCp.offDequeue = function (fn) { - util.removeFromArray(this.onDequeues, fn); -}; - -ETCp.setupDequeueing = defs.setupDequeueing({ - deqRedrawThreshold: deqRedrawThreshold, - deqCost: deqCost, - deqAvgCost: deqAvgCost, - deqNoDrawCost: deqNoDrawCost, - deqFastCost: deqFastCost, - deq: function deq(self, pxRatio, extent) { - return self.dequeue(pxRatio, extent); - }, - onDeqd: function onDeqd(self, deqd) { - for (var i = 0; i < self.onDequeues.length; i++) { - var fn = self.onDequeues[i]; - - fn(deqd); - } - }, - shouldRedraw: function shouldRedraw(self, deqd, pxRatio, extent) { - for (var i = 0; i < deqd.length; i++) { - var bb = deqd[i].ele.boundingBox(); - - if (math.boundingBoxesIntersect(bb, extent)) { - return true; - } - } - - return false; - }, - priority: function priority(self) { - return self.renderer.beforeRenderPriorities.eleTxrDeq; - } -}); - -module.exports = ElementTextureCache; - -/***/ }), -/* 125 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var math = __webpack_require__(2); -var Heap = __webpack_require__(9); -var is = __webpack_require__(0); -var defs = __webpack_require__(19); - -var defNumLayers = 1; // default number of layers to use -var minLvl = -4; // when scaling smaller than that we don't need to re-render -var maxLvl = 2; // when larger than this scale just render directly (caching is not helpful) -var maxZoom = 3.99; // beyond this zoom level, layered textures are not used -var deqRedrawThreshold = 50; // time to batch redraws together from dequeueing to allow more dequeueing calcs to happen in the meanwhile -var refineEleDebounceTime = 50; // time to debounce sharper ele texture updates -var disableEleImgSmoothing = true; // when drawing eles on layers from an ele cache ; crisper and more performant when true -var deqCost = 0.15; // % of add'l rendering cost allowed for dequeuing ele caches each frame -var deqAvgCost = 0.1; // % of add'l rendering cost compared to average overall redraw time -var deqNoDrawCost = 0.9; // % of avg frame time that can be used for dequeueing when not drawing -var deqFastCost = 0.9; // % of frame time to be used when >60fps -var maxDeqSize = 1; // number of eles to dequeue and render at higher texture in each batch -var invalidThreshold = 250; // time threshold for disabling b/c of invalidations -var maxLayerArea = 4000 * 4000; // layers can't be bigger than this -var alwaysQueue = true; // never draw all the layers in a level on a frame; draw directly until all dequeued -var useHighQualityEleTxrReqs = true; // whether to use high quality ele txr requests (generally faster and cheaper in the longterm) - -var useEleTxrCaching = true; // whether to use individual ele texture caching underneath this cache - -// var log = function(){ console.log.apply( console, arguments ); }; - -var LayeredTextureCache = function LayeredTextureCache(renderer, eleTxrCache) { - var self = this; - - var r = self.renderer = renderer; - - self.layersByLevel = {}; // e.g. 2 => [ layer1, layer2, ..., layerN ] - - self.firstGet = true; - - self.lastInvalidationTime = util.performanceNow() - 2 * invalidThreshold; - - self.skipping = false; - - r.beforeRender(function (willDraw, now) { - if (now - self.lastInvalidationTime <= invalidThreshold) { - self.skipping = true; - } else { - self.skipping = false; - } - }); - - var qSort = function qSort(a, b) { - return b.reqs - a.reqs; - }; - - self.layersQueue = new Heap(qSort); - - self.eleTxrCache = eleTxrCache; - - self.setupEleCacheInvalidation(); - - self.setupDequeueing(); -}; - -var LTCp = LayeredTextureCache.prototype; - -var layerIdPool = 0; -var MAX_INT = Math.pow(2, 53) - 1; - -LTCp.makeLayer = function (bb, lvl) { - var scale = Math.pow(2, lvl); - - var w = Math.ceil(bb.w * scale); - var h = Math.ceil(bb.h * scale); - - var canvas = document.createElement('canvas'); // eslint-disable-line no-undef - - canvas.width = w; - canvas.height = h; - - var layer = { - id: layerIdPool = ++layerIdPool % MAX_INT, - bb: bb, - level: lvl, - width: w, - height: h, - canvas: canvas, - context: canvas.getContext('2d'), - eles: [], - elesQueue: [], - reqs: 0 - }; - - // log('make layer %s with w %s and h %s and lvl %s', layer.id, layer.width, layer.height, layer.level); - - var cxt = layer.context; - var dx = -layer.bb.x1; - var dy = -layer.bb.y1; - - // do the transform on creation to save cycles (it's the same for all eles) - cxt.scale(scale, scale); - cxt.translate(dx, dy); - - return layer; -}; - -LTCp.getLayers = function (eles, pxRatio, lvl) { - var self = this; - var r = self.renderer; - var cy = r.cy; - var zoom = cy.zoom(); - var firstGet = self.firstGet; - - self.firstGet = false; - - // log('--\nget layers with %s eles', eles.length); - //log eles.map(function(ele){ return ele.id() }) ); - - if (lvl == null) { - lvl = Math.ceil(math.log2(zoom * pxRatio)); - - if (lvl < minLvl) { - lvl = minLvl; - } else if (zoom >= maxZoom || lvl > maxLvl) { - return null; - } - } - - self.validateLayersElesOrdering(lvl, eles); - - var layersByLvl = self.layersByLevel; - var scale = Math.pow(2, lvl); - var layers = layersByLvl[lvl] = layersByLvl[lvl] || []; - var bb; - - var lvlComplete = self.levelIsComplete(lvl, eles); - var tmpLayers; - - var checkTempLevels = function checkTempLevels() { - var canUseAsTmpLvl = function canUseAsTmpLvl(l) { - self.validateLayersElesOrdering(l, eles); - - if (self.levelIsComplete(l, eles)) { - tmpLayers = layersByLvl[l]; - return true; - } - }; - - var checkLvls = function checkLvls(dir) { - if (tmpLayers) { - return; - } - - for (var l = lvl + dir; minLvl <= l && l <= maxLvl; l += dir) { - if (canUseAsTmpLvl(l)) { - break; - } - } - }; - - checkLvls(+1); - checkLvls(-1); - - // remove the invalid layers; they will be replaced as needed later in this function - for (var i = layers.length - 1; i >= 0; i--) { - var layer = layers[i]; - - if (layer.invalid) { - util.removeFromArray(layers, layer); - } - } - }; - - if (!lvlComplete) { - // if the current level is incomplete, then use the closest, best quality layerset temporarily - // and later queue the current layerset so we can get the proper quality level soon - - checkTempLevels(); - } else { - // log('level complete, using existing layers\n--'); - return layers; - } - - var getBb = function getBb() { - if (!bb) { - bb = math.makeBoundingBox(); - - for (var i = 0; i < eles.length; i++) { - math.updateBoundingBox(bb, eles[i].boundingBox()); - } - } - - return bb; - }; - - var makeLayer = function makeLayer(opts) { - opts = opts || {}; - - var after = opts.after; - - getBb(); - - var area = bb.w * scale * (bb.h * scale); - - if (area > maxLayerArea) { - return null; - } - - var layer = self.makeLayer(bb, lvl); - - if (after != null) { - var index = layers.indexOf(after) + 1; - - layers.splice(index, 0, layer); - } else if (opts.insert === undefined || opts.insert) { - // no after specified => first layer made so put at start - layers.unshift(layer); - } - - // if( tmpLayers ){ - //self.queueLayer( layer ); - // } - - return layer; - }; - - if (self.skipping && !firstGet) { - // log('skip layers'); - return null; - } - - // log('do layers'); - - var layer = null; - var maxElesPerLayer = eles.length / defNumLayers; - var allowLazyQueueing = alwaysQueue && !firstGet; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - var rs = ele._private.rscratch; - var caches = rs.imgLayerCaches = rs.imgLayerCaches || {}; - - // log('look at ele', ele.id()); - - var existingLayer = caches[lvl]; - - if (existingLayer) { - // reuse layer for later eles - // log('reuse layer for', ele.id()); - layer = existingLayer; - continue; - } - - if (!layer || layer.eles.length >= maxElesPerLayer || !math.boundingBoxInBoundingBox(layer.bb, ele.boundingBox())) { - // log('make new layer for ele %s', ele.id()); - - layer = makeLayer({ insert: true, after: layer }); - - // if now layer can be built then we can't use layers at this level - if (!layer) { - return null; - } - - // log('new layer with id %s', layer.id); - } - - if (tmpLayers || allowLazyQueueing) { - // log('queue ele %s in layer %s', ele.id(), layer.id); - self.queueLayer(layer, ele); - } else { - // log('draw ele %s in layer %s', ele.id(), layer.id); - self.drawEleInLayer(layer, ele, lvl, pxRatio); - } - - layer.eles.push(ele); - - caches[lvl] = layer; - } - - // log('--'); - - if (tmpLayers) { - // then we only queued the current layerset and can't draw it yet - return tmpLayers; - } - - if (allowLazyQueueing) { - // log('lazy queue level', lvl); - return null; - } - - return layers; -}; - -// a layer may want to use an ele cache of a higher level to avoid blurriness -// so the layer level might not equal the ele level -LTCp.getEleLevelForLayerLevel = function (lvl, pxRatio) { - return lvl; -}; - -function imgSmoothing(context, bool) { - if (context.imageSmoothingEnabled != null) { - context.imageSmoothingEnabled = bool; - } else { - context.webkitImageSmoothingEnabled = bool; - context.mozImageSmoothingEnabled = bool; - context.msImageSmoothingEnabled = bool; - } -} - -LTCp.drawEleInLayer = function (layer, ele, lvl, pxRatio) { - var self = this; - var r = this.renderer; - var context = layer.context; - var bb = ele.boundingBox(); - - if (bb.w === 0 || bb.h === 0 || !ele.visible()) { - return; - } - - var eleCache = self.eleTxrCache; - var reason = useHighQualityEleTxrReqs ? eleCache.reasons.highQuality : undefined; - - lvl = self.getEleLevelForLayerLevel(lvl, pxRatio); - - var cache = useEleTxrCaching ? eleCache.getElement(ele, bb, null, lvl, reason) : null; - - if (cache) { - if (disableEleImgSmoothing) { - imgSmoothing(context, false); - } - - context.drawImage(cache.texture.canvas, cache.x, 0, cache.width, cache.height, bb.x1, bb.y1, bb.w, bb.h); - - if (disableEleImgSmoothing) { - imgSmoothing(context, true); - } - } else { - // if the element is not cacheable, then draw directly - r.drawElement(context, ele); - } -}; - -LTCp.levelIsComplete = function (lvl, eles) { - var self = this; - var layers = self.layersByLevel[lvl]; - - if (!layers || layers.length === 0) { - return false; - } - - var numElesInLayers = 0; - - for (var i = 0; i < layers.length; i++) { - var layer = layers[i]; - - // if there are any eles needed to be drawn yet, the level is not complete - if (layer.reqs > 0) { - return false; - } - - // if the layer is invalid, the level is not complete - if (layer.invalid) { - return false; - } - - numElesInLayers += layer.eles.length; - } - - // we should have exactly the number of eles passed in to be complete - if (numElesInLayers !== eles.length) { - return false; - } - - return true; -}; - -LTCp.validateLayersElesOrdering = function (lvl, eles) { - var layers = this.layersByLevel[lvl]; - - if (!layers) { - return; - } - - // if in a layer the eles are not in the same order, then the layer is invalid - // (i.e. there is an ele in between the eles in the layer) - - for (var i = 0; i < layers.length; i++) { - var layer = layers[i]; - var offset = -1; - - // find the offset - for (var j = 0; j < eles.length; j++) { - if (layer.eles[0] === eles[j]) { - offset = j; - break; - } - } - - if (offset < 0) { - // then the layer has nonexistant elements and is invalid - this.invalidateLayer(layer); - continue; - } - - // the eles in the layer must be in the same continuous order, else the layer is invalid - - var o = offset; - - for (var j = 0; j < layer.eles.length; j++) { - if (layer.eles[j] !== eles[o + j]) { - // log('invalidate based on ordering', layer.id); - - this.invalidateLayer(layer); - break; - } - } - } -}; - -LTCp.updateElementsInLayers = function (eles, update) { - var self = this; - var isEles = is.element(eles[0]); - - // collect udpated elements (cascaded from the layers) and update each - // layer itself along the way - for (var i = 0; i < eles.length; i++) { - var req = isEles ? null : eles[i]; - var ele = isEles ? eles[i] : eles[i].ele; - var rs = ele._private.rscratch; - var caches = rs.imgLayerCaches = rs.imgLayerCaches || {}; - - for (var l = minLvl; l <= maxLvl; l++) { - var layer = caches[l]; - - if (!layer) { - continue; - } - - // if update is a request from the ele cache, then it affects only - // the matching level - if (req && self.getEleLevelForLayerLevel(layer.level) !== req.level) { - continue; - } - - update(layer, ele, req); - } - } -}; - -LTCp.haveLayers = function () { - var self = this; - var haveLayers = false; - - for (var l = minLvl; l <= maxLvl; l++) { - var layers = self.layersByLevel[l]; - - if (layers && layers.length > 0) { - haveLayers = true; - break; - } - } - - return haveLayers; -}; - -LTCp.invalidateElements = function (eles) { - var self = this; - - self.lastInvalidationTime = util.performanceNow(); - - // log('update invalidate layer time from eles'); - - if (eles.length === 0 || !self.haveLayers()) { - return; - } - - self.updateElementsInLayers(eles, function invalAssocLayers(layer, ele, req) { - self.invalidateLayer(layer); - }); -}; - -LTCp.invalidateLayer = function (layer) { - // log('update invalidate layer time'); - - this.lastInvalidationTime = util.performanceNow(); - - if (layer.invalid) { - return; - } // save cycles - - var lvl = layer.level; - var eles = layer.eles; - var layers = this.layersByLevel[lvl]; - - // log('invalidate layer', layer.id ); - - util.removeFromArray(layers, layer); - // layer.eles = []; - - layer.elesQueue = []; - - layer.invalid = true; - - if (layer.replacement) { - layer.replacement.invalid = true; - } - - for (var i = 0; i < eles.length; i++) { - var caches = eles[i]._private.rscratch.imgLayerCaches; - - if (caches) { - caches[lvl] = null; - } - } -}; - -LTCp.refineElementTextures = function (eles) { - var self = this; - - // log('refine', eles.length); - - self.updateElementsInLayers(eles, function refineEachEle(layer, ele, req) { - var rLyr = layer.replacement; - - if (!rLyr) { - rLyr = layer.replacement = self.makeLayer(layer.bb, layer.level); - rLyr.replaces = layer; - rLyr.eles = layer.eles; - - // log('make replacement layer %s for %s with level %s', rLyr.id, layer.id, rLyr.level); - } - - if (!rLyr.reqs) { - for (var i = 0; i < rLyr.eles.length; i++) { - self.queueLayer(rLyr, rLyr.eles[i]); - } - - // log('queue replacement layer refinement', rLyr.id); - } - }); -}; - -LTCp.setupEleCacheInvalidation = function () { - var self = this; - var eleDeqs = []; - - if (!useEleTxrCaching) { - return; - } - - var updatedElesInLayers = util.debounce(function () { - self.refineElementTextures(eleDeqs); - - eleDeqs = []; - }, refineEleDebounceTime); - - self.eleTxrCache.onDequeue(function (reqs) { - for (var i = 0; i < reqs.length; i++) { - eleDeqs.push(reqs[i]); - } - - updatedElesInLayers(); - }); -}; - -LTCp.queueLayer = function (layer, ele) { - var self = this; - var q = self.layersQueue; - var elesQ = layer.elesQueue; - var hasId = elesQ.hasId = elesQ.hasId || {}; - - // if a layer is going to be replaced, queuing is a waste of time - if (layer.replacement) { - return; - } - - if (ele) { - if (hasId[ele.id()]) { - return; - } - - elesQ.push(ele); - hasId[ele.id()] = true; - } - - if (layer.reqs) { - layer.reqs++; - - q.updateItem(layer); - } else { - layer.reqs = 1; - - q.push(layer); - } -}; - -LTCp.dequeue = function (pxRatio) { - var self = this; - var q = self.layersQueue; - var deqd = []; - var eleDeqs = 0; - - while (eleDeqs < maxDeqSize) { - if (q.size() === 0) { - break; - } - - var layer = q.peek(); - - // if a layer has been or will be replaced, then don't waste time with it - if (layer.replacement) { - // log('layer %s in queue skipped b/c it already has a replacement', layer.id); - q.pop(); - continue; - } - - // if this is a replacement layer that has been superceded, then forget it - if (layer.replaces && layer !== layer.replaces.replacement) { - // log('layer is no longer the most uptodate replacement; dequeued', layer.id) - q.pop(); - continue; - } - - if (layer.invalid) { - // log('replacement layer %s is invalid; dequeued', layer.id); - q.pop(); - continue; - } - - var ele = layer.elesQueue.shift(); - - if (ele) { - // log('dequeue layer %s', layer.id); - - self.drawEleInLayer(layer, ele, layer.level, pxRatio); - - eleDeqs++; - } - - if (deqd.length === 0) { - // we need only one entry in deqd to queue redrawing etc - deqd.push(true); - } - - // if the layer has all its eles done, then remove from the queue - if (layer.elesQueue.length === 0) { - q.pop(); - - layer.reqs = 0; - - // log('dequeue of layer %s complete', layer.id); - - // when a replacement layer is dequeued, it replaces the old layer in the level - if (layer.replaces) { - self.applyLayerReplacement(layer); - } - - self.requestRedraw(); - } - } - - return deqd; -}; - -LTCp.applyLayerReplacement = function (layer) { - var self = this; - var layersInLevel = self.layersByLevel[layer.level]; - var replaced = layer.replaces; - var index = layersInLevel.indexOf(replaced); - - // if the replaced layer is not in the active list for the level, then replacing - // refs would be a mistake (i.e. overwriting the true active layer) - if (index < 0 || replaced.invalid) { - // log('replacement layer would have no effect', layer.id); - return; - } - - layersInLevel[index] = layer; // replace level ref - - // replace refs in eles - for (var i = 0; i < layer.eles.length; i++) { - var _p = layer.eles[i]._private; - var cache = _p.imgLayerCaches = _p.imgLayerCaches || {}; - - if (cache) { - cache[layer.level] = layer; - } - } - - // log('apply replacement layer %s over %s', layer.id, replaced.id); - - self.requestRedraw(); -}; - -LTCp.requestRedraw = util.debounce(function () { - var r = this.renderer; - - r.redrawHint('eles', true); - r.redrawHint('drag', true); - r.redraw(); -}, 100); - -LTCp.setupDequeueing = defs.setupDequeueing({ - deqRedrawThreshold: deqRedrawThreshold, - deqCost: deqCost, - deqAvgCost: deqAvgCost, - deqNoDrawCost: deqNoDrawCost, - deqFastCost: deqFastCost, - deq: function deq(self, pxRatio) { - return self.dequeue(pxRatio); - }, - onDeqd: util.noop, - shouldRedraw: util.trueify, - priority: function priority(self) { - return self.renderer.beforeRenderPriorities.lyrTxrDeq; - } -}); - -module.exports = LayeredTextureCache; - -/***/ }), -/* 126 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var CRp = {}; - -var impl; - -CRp.arrowShapeImpl = function (name) { - return (impl || (impl = { - 'polygon': function polygon(context, points) { - for (var i = 0; i < points.length; i++) { - var pt = points[i]; - - context.lineTo(pt.x, pt.y); - } - }, - - 'triangle-backcurve': function triangleBackcurve(context, points, controlPoint) { - var firstPt; - - for (var i = 0; i < points.length; i++) { - var pt = points[i]; - - if (i === 0) { - firstPt = pt; - } - - context.lineTo(pt.x, pt.y); - } - - context.quadraticCurveTo(controlPoint.x, controlPoint.y, firstPt.x, firstPt.y); - }, - - 'triangle-tee': function triangleTee(context, trianglePoints, teePoints) { - if (context.beginPath) { - context.beginPath(); - } - - var triPts = trianglePoints; - for (var i = 0; i < triPts.length; i++) { - var pt = triPts[i]; - - context.lineTo(pt.x, pt.y); - } - - if (context.closePath) { - context.closePath(); - } - - if (context.beginPath) { - context.beginPath(); - } - - var teePts = teePoints; - var firstTeePt = teePoints[0]; - context.moveTo(firstTeePt.x, firstTeePt.y); - - for (var i = 0; i < teePts.length; i++) { - var pt = teePts[i]; - - context.lineTo(pt.x, pt.y); - } - if (context.closePath) { - context.closePath(); - } - }, - - 'triangle-cross': function triangleCross(context, trianglePoints, crossLinePoints) { - if (context.beginPath) { - context.beginPath(); - } - - var triPts = trianglePoints; - for (var i = 0; i < triPts.length; i++) { - var pt = triPts[i]; - - context.lineTo(pt.x, pt.y); - } - - if (context.closePath) { - context.closePath(); - } - - if (context.beginPath) { - context.beginPath(); - } - - var teePts = crossLinePoints; - var firstTeePt = crossLinePoints[0]; - context.moveTo(firstTeePt.x, firstTeePt.y); - - for (var i = 0; i < teePts.length; i++) { - var pt = teePts[i]; - - context.lineTo(pt.x, pt.y); - } - if (context.closePath) { - context.closePath(); - } - }, - - 'circle': function circle(context, rx, ry, r) { - context.arc(rx, ry, r, 0, Math.PI * 2, false); - } - }))[name]; -}; - -module.exports = CRp; - -/***/ }), -/* 127 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var math = __webpack_require__(2); - -var CRp = {}; - -CRp.drawElement = function (context, ele, shiftToOriginWithBb, showLabel) { - var r = this; - - if (ele.isNode()) { - r.drawNode(context, ele, shiftToOriginWithBb, showLabel); - } else { - r.drawEdge(context, ele, shiftToOriginWithBb, showLabel); - } -}; - -CRp.drawCachedElement = function (context, ele, pxRatio, extent) { - var r = this; - var bb = ele.boundingBox(); - - if (bb.w === 0 || bb.h === 0) { - return; - } - - if (!extent || math.boundingBoxesIntersect(bb, extent)) { - var cache = r.data.eleTxrCache.getElement(ele, bb, pxRatio); - - if (cache != null) { - context.drawImage(cache.texture.canvas, cache.x, 0, cache.width, cache.height, bb.x1, bb.y1, bb.w, bb.h); - } else { - // if the element is not cacheable, then draw directly - r.drawElement(context, ele); - } - } -}; - -CRp.drawElements = function (context, eles) { - var r = this; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - - r.drawElement(context, ele); - } -}; - -CRp.drawCachedElements = function (context, eles, pxRatio, extent) { - var r = this; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - - r.drawCachedElement(context, ele, pxRatio, extent); - } -}; - -CRp.drawCachedNodes = function (context, eles, pxRatio, extent) { - var r = this; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - - if (!ele.isNode()) { - continue; - } - - r.drawCachedElement(context, ele, pxRatio, extent); - } -}; - -CRp.drawLayeredElements = function (context, eles, pxRatio, extent) { - var r = this; - - var layers = r.data.lyrTxrCache.getLayers(eles, pxRatio); - - if (layers) { - for (var i = 0; i < layers.length; i++) { - var layer = layers[i]; - var bb = layer.bb; - - if (bb.w === 0 || bb.h === 0) { - continue; - } - - context.drawImage(layer.canvas, bb.x1, bb.y1, bb.w, bb.h); - } - } else { - // fall back on plain caching if no layers - r.drawCachedElements(context, eles, pxRatio, extent); - } -}; - -CRp.drawDebugPoints = function (context, eles) { - var draw = function draw(x, y, color) { - context.fillStyle = color; - context.fillRect(x - 1, y - 1, 3, 3); - }; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - var rs = ele._private.rscratch; - - if (ele.isNode()) { - var p = ele.position(); - - draw(p.x, p.y, 'magenta'); - } else { - var pts = rs.allpts; - - for (var j = 0; j + 1 < pts.length; j += 2) { - var x = pts[j]; - var y = pts[j + 1]; - - draw(x, y, 'cyan'); - } - - draw(rs.midX, rs.midY, 'yellow'); - } - } -}; - -module.exports = CRp; - -/***/ }), -/* 128 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var CRp = {}; - -CRp.drawEdge = function (context, edge, shiftToOriginWithBb, drawLabel) { - var r = this; - var rs = edge._private.rscratch; - var usePaths = r.usePaths(); - - if (!edge.visible()) { - return; - } - - // if bezier ctrl pts can not be calculated, then die - if (rs.badLine || rs.allpts == null || isNaN(rs.allpts[0])) { - // isNaN in case edge is impossible and browser bugs (e.g. safari) - return; - } - - var bb = void 0; - if (shiftToOriginWithBb) { - bb = shiftToOriginWithBb; - - context.translate(-bb.x1, -bb.y1); - } - - var overlayPadding = edge.pstyle('overlay-padding').pfValue; - var overlayWidth = 2 * overlayPadding; - var overlayOpacity = edge.pstyle('overlay-opacity').value; - var overlayColor = edge.pstyle('overlay-color').value; - var lineColor = edge.pstyle('line-color').value; - var opacity = edge.pstyle('opacity').value; - var lineStyle = edge.pstyle('line-style').value; - var edgeWidth = edge.pstyle('width').pfValue; - - var drawLine = function drawLine() { - var strokeOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : opacity; - - context.lineWidth = edgeWidth; - context.lineCap = 'butt'; - - r.strokeStyle(context, lineColor[0], lineColor[1], lineColor[2], strokeOpacity); - - r.drawEdgePath(edge, context, rs.allpts, lineStyle); - }; - - var drawOverlay = function drawOverlay() { - var strokeOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : overlayOpacity; - - context.lineWidth = overlayWidth; - - if (rs.edgeType === 'self' && !usePaths) { - context.lineCap = 'butt'; - } else { - context.lineCap = 'round'; - } - - r.strokeStyle(context, overlayColor[0], overlayColor[1], overlayColor[2], strokeOpacity); - - r.drawEdgePath(edge, context, rs.allpts, 'solid'); - }; - - var drawArrows = function drawArrows() { - var arrowOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : opacity; - - r.drawArrowheads(context, edge, arrowOpacity); - }; - - var drawText = function drawText() { - r.drawElementText(context, edge, drawLabel); - }; - - context.lineJoin = 'round'; - - var ghost = edge.pstyle('ghost').value === 'yes'; - - if (ghost) { - var gx = edge.pstyle('ghost-offset-x').pfValue; - var gy = edge.pstyle('ghost-offset-y').pfValue; - var ghostOpacity = edge.pstyle('ghost-opacity').value; - var effectiveGhostOpacity = opacity * ghostOpacity; - - context.translate(gx, gy); - - drawLine(effectiveGhostOpacity); - drawArrows(effectiveGhostOpacity); - - context.translate(-gx, -gy); - } - - drawLine(); - drawArrows(); - drawOverlay(); - drawText(); - - if (shiftToOriginWithBb) { - context.translate(bb.x1, bb.y1); - } -}; - -CRp.drawEdgePath = function (edge, context, pts, type) { - var rs = edge._private.rscratch; - var canvasCxt = context; - var path = void 0; - var pathCacheHit = false; - var usePaths = this.usePaths(); - - if (usePaths) { - var pathCacheKey = pts.join('$'); - var keyMatches = rs.pathCacheKey && rs.pathCacheKey === pathCacheKey; - - if (keyMatches) { - path = context = rs.pathCache; - pathCacheHit = true; - } else { - path = context = new Path2D(); // eslint-disable-line no-undef - rs.pathCacheKey = pathCacheKey; - rs.pathCache = path; - } - } - - if (canvasCxt.setLineDash) { - // for very outofdate browsers - switch (type) { - case 'dotted': - canvasCxt.setLineDash([1, 1]); - break; - - case 'dashed': - canvasCxt.setLineDash([6, 3]); - break; - - case 'solid': - canvasCxt.setLineDash([]); - break; - } - } - - if (!pathCacheHit && !rs.badLine) { - if (context.beginPath) { - context.beginPath(); - } - context.moveTo(pts[0], pts[1]); - - switch (rs.edgeType) { - case 'bezier': - case 'self': - case 'compound': - case 'multibezier': - for (var i = 2; i + 3 < pts.length; i += 4) { - context.quadraticCurveTo(pts[i], pts[i + 1], pts[i + 2], pts[i + 3]); - } - break; - - case 'straight': - case 'segments': - case 'haystack': - for (var _i = 2; _i + 1 < pts.length; _i += 2) { - context.lineTo(pts[_i], pts[_i + 1]); - } - break; - } - } - - context = canvasCxt; - if (usePaths) { - context.stroke(path); - } else { - context.stroke(); - } - - // reset any line dashes - if (context.setLineDash) { - // for very outofdate browsers - context.setLineDash([]); - } -}; - -CRp.drawArrowheads = function (context, edge, opacity) { - var rs = edge._private.rscratch; - var isHaystack = rs.edgeType === 'haystack'; - - if (!isHaystack) { - this.drawArrowhead(context, edge, 'source', rs.arrowStartX, rs.arrowStartY, rs.srcArrowAngle, opacity); - } - - this.drawArrowhead(context, edge, 'mid-target', rs.midX, rs.midY, rs.midtgtArrowAngle, opacity); - - this.drawArrowhead(context, edge, 'mid-source', rs.midX, rs.midY, rs.midsrcArrowAngle, opacity); - - if (!isHaystack) { - this.drawArrowhead(context, edge, 'target', rs.arrowEndX, rs.arrowEndY, rs.tgtArrowAngle, opacity); - } -}; - -CRp.drawArrowhead = function (context, edge, prefix, x, y, angle, opacity) { - if (isNaN(x) || x == null || isNaN(y) || y == null || isNaN(angle) || angle == null) { - return; - } - - var self = this; - var arrowShape = edge.pstyle(prefix + '-arrow-shape').value; - if (arrowShape === 'none') { - return; - } - - var arrowClearFill = edge.pstyle(prefix + '-arrow-fill').value === 'hollow' ? 'both' : 'filled'; - var arrowFill = edge.pstyle(prefix + '-arrow-fill').value; - var edgeWidth = edge.pstyle('width').pfValue; - var edgeOpacity = edge.pstyle('opacity').value; - - if (opacity === undefined) { - opacity = edgeOpacity; - } - - var gco = context.globalCompositeOperation; - - if (opacity !== 1 || arrowFill === 'hollow') { - // then extra clear is needed - context.globalCompositeOperation = 'destination-out'; - - self.fillStyle(context, 255, 255, 255, 1); - self.strokeStyle(context, 255, 255, 255, 1); - - self.drawArrowShape(edge, prefix, context, arrowClearFill, edgeWidth, arrowShape, x, y, angle); - - context.globalCompositeOperation = gco; - } // otherwise, the opaque arrow clears it for free :) - - var color = edge.pstyle(prefix + '-arrow-color').value; - self.fillStyle(context, color[0], color[1], color[2], opacity); - self.strokeStyle(context, color[0], color[1], color[2], opacity); - - self.drawArrowShape(edge, prefix, context, arrowFill, edgeWidth, arrowShape, x, y, angle); -}; - -CRp.drawArrowShape = function (edge, arrowType, context, fill, edgeWidth, shape, x, y, angle) { - var r = this; - var usePaths = this.usePaths(); - var rs = edge._private.rscratch; - var pathCacheHit = false; - var path = void 0; - var canvasContext = context; - var translation = { x: x, y: y }; - var scale = edge.pstyle('arrow-scale').value; - var size = this.getArrowWidth(edgeWidth, scale); - var shapeImpl = r.arrowShapes[shape]; - - if (usePaths) { - var pathCacheKey = size + '$' + shape + '$' + angle + '$' + x + '$' + y; - rs.arrowPathCacheKey = rs.arrowPathCacheKey || {}; - rs.arrowPathCache = rs.arrowPathCache || {}; - - var alreadyCached = rs.arrowPathCacheKey[arrowType] === pathCacheKey; - if (alreadyCached) { - path = context = rs.arrowPathCache[arrowType]; - pathCacheHit = true; - } else { - path = context = new Path2D(); // eslint-disable-line no-undef - rs.arrowPathCacheKey[arrowType] = pathCacheKey; - rs.arrowPathCache[arrowType] = path; - } - } - - if (context.beginPath) { - context.beginPath(); - } - - if (!pathCacheHit) { - shapeImpl.draw(context, size, angle, translation, edgeWidth); - } - - if (!shapeImpl.leavePathOpen && context.closePath) { - context.closePath(); - } - - context = canvasContext; - - if (fill === 'filled' || fill === 'both') { - if (usePaths) { - context.fill(path); - } else { - context.fill(); - } - } - - if (fill === 'hollow' || fill === 'both') { - context.lineWidth = shapeImpl.matchEdgeWidth ? edgeWidth : 1; - context.lineJoin = 'miter'; - - if (usePaths) { - context.stroke(path); - } else { - context.stroke(); - } - } -}; - -module.exports = CRp; - -/***/ }), -/* 129 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var CRp = {}; - -CRp.safeDrawImage = function (context, img, ix, iy, iw, ih, x, y, w, h) { - var r = this; - - // detect problematic cases for old browsers with bad images (cheaper than try-catch) - if (iw <= 0 || ih <= 0 || w <= 0 || h <= 0) { - return; - } - - context.drawImage(img, ix, iy, iw, ih, x, y, w, h); -}; - -CRp.drawInscribedImage = function (context, img, node, index, nodeOpacity) { - var r = this; - var pos = node.position(); - var nodeX = pos.x; - var nodeY = pos.y; - var styleObj = node.cy().style(); - var getIndexedStyle = styleObj.getIndexedStyle.bind(styleObj); - var fit = getIndexedStyle(node, 'background-fit', 'value', index); - var repeat = getIndexedStyle(node, 'background-repeat', 'value', index); - var nodeW = node.width(); - var nodeH = node.height(); - var paddingX2 = node.padding() * 2; - var nodeTW = nodeW + (getIndexedStyle(node, 'background-width-relative-to', 'value', index) === 'inner' ? 0 : paddingX2); - var nodeTH = nodeH + (getIndexedStyle(node, 'background-height-relative-to', 'value', index) === 'inner' ? 0 : paddingX2); - var rs = node._private.rscratch; - var clip = node.pstyle('background-clip').value; - var shouldClip = clip === 'node'; - var imgOpacity = getIndexedStyle(node, 'background-image-opacity', 'value', index) * nodeOpacity; - - var imgW = img.width || img.cachedW; - var imgH = img.height || img.cachedH; - - // workaround for broken browsers like ie - if (null == imgW || null == imgH) { - document.body.appendChild(img); // eslint-disable-line no-undef - - imgW = img.cachedW = img.width || img.offsetWidth; - imgH = img.cachedH = img.height || img.offsetHeight; - - document.body.removeChild(img); // eslint-disable-line no-undef - } - - var w = imgW; - var h = imgH; - - if (getIndexedStyle(node, 'background-width', 'value', index) !== 'auto') { - if (getIndexedStyle(node, 'background-width', 'units', index) === '%') { - w = getIndexedStyle(node, 'background-width', 'pfValue', index) * nodeTW; - } else { - w = getIndexedStyle(node, 'background-width', 'pfValue', index); - } - } - - if (getIndexedStyle(node, 'background-height', 'value', index) !== 'auto') { - if (getIndexedStyle(node, 'background-height', 'units', index) === '%') { - h = getIndexedStyle(node, 'background-height', 'pfValue', index) * nodeTH; - } else { - h = getIndexedStyle(node, 'background-height', 'pfValue', index); - } - } - - if (w === 0 || h === 0) { - return; // no point in drawing empty image (and chrome is broken in this case) - } - - if (fit === 'contain') { - var scale = Math.min(nodeTW / w, nodeTH / h); - - w *= scale; - h *= scale; - } else if (fit === 'cover') { - var scale = Math.max(nodeTW / w, nodeTH / h); - - w *= scale; - h *= scale; - } - - var x = nodeX - nodeTW / 2; // left - if (getIndexedStyle(node, 'background-position-x', 'units', index) === '%') { - x += (nodeTW - w) * getIndexedStyle(node, 'background-position-x', 'pfValue', index); - } else { - x += getIndexedStyle(node, 'background-position-x', 'pfValue', index); - } - - var y = nodeY - nodeTH / 2; // top - if (getIndexedStyle(node, 'background-position-y', 'units', index) === '%') { - y += (nodeTH - h) * getIndexedStyle(node, 'background-position-y', 'pfValue', index); - } else { - y += getIndexedStyle(node, 'background-position-y', 'pfValue', index); - } - - if (rs.pathCache) { - x -= nodeX; - y -= nodeY; - - nodeX = 0; - nodeY = 0; - } - - var gAlpha = context.globalAlpha; - - context.globalAlpha = imgOpacity; - - if (repeat === 'no-repeat') { - - if (shouldClip) { - context.save(); - - if (rs.pathCache) { - context.clip(rs.pathCache); - } else { - r.nodeShapes[r.getNodeShape(node)].draw(context, nodeX, nodeY, nodeTW, nodeTH); - - context.clip(); - } - } - - r.safeDrawImage(context, img, 0, 0, imgW, imgH, x, y, w, h); - - if (shouldClip) { - context.restore(); - } - } else { - var pattern = context.createPattern(img, repeat); - context.fillStyle = pattern; - - r.nodeShapes[r.getNodeShape(node)].draw(context, nodeX, nodeY, nodeTW, nodeTH); - - context.translate(x, y); - context.fill(); - context.translate(-x, -y); - } - - context.globalAlpha = gAlpha; -}; - -module.exports = CRp; - -/***/ }), -/* 130 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var math = __webpack_require__(2); - -var CRp = {}; - -CRp.eleTextBiggerThanMin = function (ele, scale) { - if (!scale) { - var zoom = ele.cy().zoom(); - var pxRatio = this.getPixelRatio(); - var lvl = Math.ceil(math.log2(zoom * pxRatio)); // the effective texture level - - scale = Math.pow(2, lvl); - } - - var computedSize = ele.pstyle('font-size').pfValue * scale; - var minSize = ele.pstyle('min-zoomed-font-size').pfValue; - - if (computedSize < minSize) { - return false; - } - - return true; -}; - -CRp.drawElementText = function (context, ele, force) { - var r = this; - - if (force === undefined) { - if (!r.eleTextBiggerThanMin(ele)) { - return; - } - } else { - if (!force) { - return; - } - } - - if (ele.isNode()) { - var label = ele.pstyle('label'); - - if (!label || !label.value) { - return; - } - - var textHalign = ele.pstyle('text-halign').strValue; - var textValign = ele.pstyle('text-valign').strValue; - - switch (textHalign) { - case 'left': - context.textAlign = 'right'; - break; - - case 'right': - context.textAlign = 'left'; - break; - - default: - // e.g. center - context.textAlign = 'center'; - } - - context.textBaseline = 'bottom'; - } else { - var label = ele.pstyle('label'); - var srcLabel = ele.pstyle('source-label'); - var tgtLabel = ele.pstyle('target-label'); - - if ((!label || !label.value) && (!srcLabel || !srcLabel.value) && (!tgtLabel || !tgtLabel.value)) { - return; - } - - context.textAlign = 'center'; - context.textBaseline = 'bottom'; - } - - r.drawText(context, ele); - - if (ele.isEdge()) { - r.drawText(context, ele, 'source'); - - r.drawText(context, ele, 'target'); - } -}; - -CRp.drawNodeText = CRp.drawEdgeText = CRp.drawElementText; - -CRp.getFontCache = function (context) { - var cache; - - this.fontCaches = this.fontCaches || []; - - for (var i = 0; i < this.fontCaches.length; i++) { - cache = this.fontCaches[i]; - - if (cache.context === context) { - return cache; - } - } - - cache = { - context: context - }; - this.fontCaches.push(cache); - - return cache; -}; - -// set up canvas context with font -// returns transformed text string -CRp.setupTextStyle = function (context, ele) { - // Font style - var parentOpacity = ele.effectiveOpacity(); - var labelStyle = ele.pstyle('font-style').strValue; - var labelSize = ele.pstyle('font-size').pfValue + 'px'; - var labelFamily = ele.pstyle('font-family').strValue; - var labelWeight = ele.pstyle('font-weight').strValue; - var opacity = ele.pstyle('text-opacity').value * ele.pstyle('opacity').value * parentOpacity; - var outlineOpacity = ele.pstyle('text-outline-opacity').value * opacity; - var color = ele.pstyle('color').value; - var outlineColor = ele.pstyle('text-outline-color').value; - - var fontCacheKey = ele._private.fontKey; - var cache = this.getFontCache(context); - - if (cache.key !== fontCacheKey) { - context.font = labelStyle + ' ' + labelWeight + ' ' + labelSize + ' ' + labelFamily; - - cache.key = fontCacheKey; - } - - // Calculate text draw position based on text alignment - - // so text outlines aren't jagged - context.lineJoin = 'round'; - - this.fillStyle(context, color[0], color[1], color[2], opacity); - - this.strokeStyle(context, outlineColor[0], outlineColor[1], outlineColor[2], outlineOpacity); -}; - -function roundRect(ctx, x, y, width, height, radius) { - var radius = radius || 5; - ctx.beginPath(); - ctx.moveTo(x + radius, y); - ctx.lineTo(x + width - radius, y); - ctx.quadraticCurveTo(x + width, y, x + width, y + radius); - ctx.lineTo(x + width, y + height - radius); - ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height); - ctx.lineTo(x + radius, y + height); - ctx.quadraticCurveTo(x, y + height, x, y + height - radius); - ctx.lineTo(x, y + radius); - ctx.quadraticCurveTo(x, y, x + radius, y); - ctx.closePath(); - ctx.fill(); -} - -// Draw text -CRp.drawText = function (context, ele, prefix) { - var _p = ele._private; - var rscratch = _p.rscratch; - var parentOpacity = ele.effectiveOpacity(); - if (parentOpacity === 0 || ele.pstyle('text-opacity').value === 0) { - return; - } - - var textX = util.getPrefixedProperty(rscratch, 'labelX', prefix); - var textY = util.getPrefixedProperty(rscratch, 'labelY', prefix); - var text = this.getLabelText(ele, prefix); - - if (text != null && text !== '' && !isNaN(textX) && !isNaN(textY)) { - this.setupTextStyle(context, ele); - - var pdash = prefix ? prefix + '-' : ''; - var textW = util.getPrefixedProperty(rscratch, 'labelWidth', prefix); - var textH = util.getPrefixedProperty(rscratch, 'labelHeight', prefix); - var textAngle = util.getPrefixedProperty(rscratch, 'labelAngle', prefix); - var marginX = ele.pstyle(pdash + 'text-margin-x').pfValue; - var marginY = ele.pstyle(pdash + 'text-margin-y').pfValue; - - var isEdge = ele.isEdge(); - var isNode = ele.isNode(); - - var halign = ele.pstyle('text-halign').value; - var valign = ele.pstyle('text-valign').value; - - if (isEdge) { - halign = 'center'; - valign = 'center'; - } - - textX += marginX; - textY += marginY; - - var rotation = ele.pstyle(pdash + 'text-rotation'); - var theta; - - if (rotation.strValue === 'autorotate') { - theta = isEdge ? textAngle : 0; - } else if (rotation.strValue === 'none') { - theta = 0; - } else { - theta = rotation.pfValue; - } - - if (theta !== 0) { - var orgTextX = textX; - var orgTextY = textY; - - context.translate(orgTextX, orgTextY); - context.rotate(theta); - - textX = 0; - textY = 0; - } - - switch (valign) { - case 'top': - break; - case 'center': - textY += textH / 2; - break; - case 'bottom': - textY += textH; - break; - } - - var backgroundOpacity = ele.pstyle('text-background-opacity').value; - var borderOpacity = ele.pstyle('text-border-opacity').value; - var textBorderWidth = ele.pstyle('text-border-width').pfValue; - var backgroundPadding = ele.pstyle('text-background-padding').pfValue; - - if (backgroundOpacity > 0 || textBorderWidth > 0 && borderOpacity > 0) { - var bgX = textX - backgroundPadding; - - switch (halign) { - case 'left': - bgX -= textW; - break; - case 'center': - bgX -= textW / 2; - break; - case 'right': - break; - } - - var bgY = textY - textH - backgroundPadding; - var bgW = textW + 2 * backgroundPadding; - var bgH = textH + 2 * backgroundPadding; - - if (backgroundOpacity > 0) { - var textFill = context.fillStyle; - var textBackgroundColor = ele.pstyle('text-background-color').value; - - context.fillStyle = 'rgba(' + textBackgroundColor[0] + ',' + textBackgroundColor[1] + ',' + textBackgroundColor[2] + ',' + backgroundOpacity * parentOpacity + ')'; - var styleShape = ele.pstyle('text-background-shape').strValue; - if (styleShape == 'roundrectangle') { - roundRect(context, bgX, bgY, bgW, bgH, 2); - } else { - context.fillRect(bgX, bgY, bgW, bgH); - } - context.fillStyle = textFill; - } - - if (textBorderWidth > 0 && borderOpacity > 0) { - var textStroke = context.strokeStyle; - var textLineWidth = context.lineWidth; - var textBorderColor = ele.pstyle('text-border-color').value; - var textBorderStyle = ele.pstyle('text-border-style').value; - - context.strokeStyle = 'rgba(' + textBorderColor[0] + ',' + textBorderColor[1] + ',' + textBorderColor[2] + ',' + borderOpacity * parentOpacity + ')'; - context.lineWidth = textBorderWidth; - - if (context.setLineDash) { - // for very outofdate browsers - switch (textBorderStyle) { - case 'dotted': - context.setLineDash([1, 1]); - break; - case 'dashed': - context.setLineDash([4, 2]); - break; - case 'double': - context.lineWidth = textBorderWidth / 4; // 50% reserved for white between the two borders - context.setLineDash([]); - break; - case 'solid': - context.setLineDash([]); - break; - } - } - - context.strokeRect(bgX, bgY, bgW, bgH); - - if (textBorderStyle === 'double') { - var whiteWidth = textBorderWidth / 2; - - context.strokeRect(bgX + whiteWidth, bgY + whiteWidth, bgW - whiteWidth * 2, bgH - whiteWidth * 2); - } - - if (context.setLineDash) { - // for very outofdate browsers - context.setLineDash([]); - } - context.lineWidth = textLineWidth; - context.strokeStyle = textStroke; - } - } - - var lineWidth = 2 * ele.pstyle('text-outline-width').pfValue; // *2 b/c the stroke is drawn centred on the middle - - if (lineWidth > 0) { - context.lineWidth = lineWidth; - } - - if (ele.pstyle('text-wrap').value === 'wrap') { - var lines = util.getPrefixedProperty(rscratch, 'labelWrapCachedLines', prefix); - var lineHeight = textH / lines.length; - - switch (valign) { - case 'top': - textY -= (lines.length - 1) * lineHeight; - break; - case 'center': - case 'bottom': - textY -= (lines.length - 1) * lineHeight; - break; - } - - for (var l = 0; l < lines.length; l++) { - if (lineWidth > 0) { - context.strokeText(lines[l], textX, textY); - } - - context.fillText(lines[l], textX, textY); - - textY += lineHeight; - } - } else { - if (lineWidth > 0) { - context.strokeText(text, textX, textY); - } - - context.fillText(text, textX, textY); - } - - if (theta !== 0) { - context.rotate(-theta); - context.translate(-orgTextX, -orgTextY); - } - } -}; - -module.exports = CRp; - -/***/ }), -/* 131 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/* global Path2D */ - -var is = __webpack_require__(0); - -var CRp = {}; - -CRp.drawNode = function (context, node, shiftToOriginWithBb, drawLabel) { - var r = this; - var nodeWidth = void 0, - nodeHeight = void 0; - var _p = node._private; - var rs = _p.rscratch; - var pos = node.position(); - - if (!is.number(pos.x) || !is.number(pos.y)) { - return; // can't draw node with undefined position - } - - if (!node.visible()) { - return; - } - - var parentOpacity = node.effectiveOpacity(); - - var usePaths = r.usePaths(); - var path = void 0; - var pathCacheHit = false; - - var padding = node.padding(); - - nodeWidth = node.width() + 2 * padding; - nodeHeight = node.height() + 2 * padding; - - // - // setup shift - - var bb = void 0; - if (shiftToOriginWithBb) { - bb = shiftToOriginWithBb; - - context.translate(-bb.x1, -bb.y1); - } - - // - // load bg image - - var bgImgProp = node.pstyle('background-image'); - var urls = bgImgProp.value; - var urlDefined = new Array(urls.length); - var image = new Array(urls.length); - var numImages = 0; - for (var i = 0; i < urls.length; i++) { - var url = urls[i]; - var defd = urlDefined[i] = url != null && url !== 'none'; - - if (defd) { - var bgImgCrossOrigin = node.cy().style().getIndexedStyle(node, 'background-image-crossorigin', 'value', i); - - numImages++; - - // get image, and if not loaded then ask to redraw when later loaded - image[i] = r.getCachedImage(url, bgImgCrossOrigin, function () { - node.emitAndNotify('background'); - }); - } - } - - // - // setup styles - - var darkness = node.pstyle('background-blacken').value; - var borderWidth = node.pstyle('border-width').pfValue; - var bgColor = node.pstyle('background-color').value; - var bgOpacity = node.pstyle('background-opacity').value * parentOpacity; - var borderColor = node.pstyle('border-color').value; - var borderStyle = node.pstyle('border-style').value; - var borderOpacity = node.pstyle('border-opacity').value * parentOpacity; - - context.lineJoin = 'miter'; // so borders are square with the node shape - - var setupShapeColor = function setupShapeColor() { - var bgOpy = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : bgOpacity; - - r.fillStyle(context, bgColor[0], bgColor[1], bgColor[2], bgOpy); - }; - - var setupBorderColor = function setupBorderColor() { - var bdrOpy = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : borderOpacity; - - r.strokeStyle(context, borderColor[0], borderColor[1], borderColor[2], bdrOpy); - }; - - // - // setup shape - - var styleShape = node.pstyle('shape').strValue; - var shapePts = node.pstyle('shape-polygon-points').pfValue; - - if (usePaths) { - var pathCacheKey = styleShape + '$' + nodeWidth + '$' + nodeHeight + (styleShape === 'polygon' ? '$' + shapePts.join('$') : ''); - - context.translate(pos.x, pos.y); - - if (rs.pathCacheKey === pathCacheKey) { - path = rs.pathCache; - pathCacheHit = true; - } else { - path = new Path2D(); - rs.pathCacheKey = pathCacheKey; - rs.pathCache = path; - } - } - - var drawShape = function drawShape() { - if (!pathCacheHit) { - - var npos = pos; - - if (usePaths) { - npos = { - x: 0, - y: 0 - }; - } - - r.nodeShapes[r.getNodeShape(node)].draw(path || context, npos.x, npos.y, nodeWidth, nodeHeight); - } - - if (usePaths) { - context.fill(path); - } else { - context.fill(); - } - }; - - var drawImages = function drawImages() { - var nodeOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : parentOpacity; - - var prevBging = _p.backgrounding; - var totalCompleted = 0; - - for (var _i = 0; _i < image.length; _i++) { - if (urlDefined[_i] && image[_i].complete && !image[_i].error) { - totalCompleted++; - r.drawInscribedImage(context, image[_i], node, _i, nodeOpacity); - } - } - - _p.backgrounding = !(totalCompleted === numImages); - if (prevBging !== _p.backgrounding) { - // update style b/c :backgrounding state changed - node.updateStyle(false); - } - }; - - var drawPie = function drawPie() { - var redrawShape = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - var pieOpacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : parentOpacity; - - if (r.hasPie(node)) { - r.drawPie(context, node, pieOpacity); - - // redraw/restore path if steps after pie need it - if (redrawShape) { - - if (!usePaths) { - r.nodeShapes[r.getNodeShape(node)].draw(context, pos.x, pos.y, nodeWidth, nodeHeight); - } - } - } - }; - - var darken = function darken() { - var darkenOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : parentOpacity; - - var opacity = (darkness > 0 ? darkness : -darkness) * darkenOpacity; - var c = darkness > 0 ? 0 : 255; - - if (darkness !== 0) { - r.fillStyle(context, c, c, c, opacity); - - if (usePaths) { - context.fill(path); - } else { - context.fill(); - } - } - }; - - var drawBorder = function drawBorder() { - if (borderWidth > 0) { - - context.lineWidth = borderWidth; - context.lineCap = 'butt'; - - if (context.setLineDash) { - // for very outofdate browsers - switch (borderStyle) { - case 'dotted': - context.setLineDash([1, 1]); - break; - - case 'dashed': - context.setLineDash([4, 2]); - break; - - case 'solid': - case 'double': - context.setLineDash([]); - break; - } - } - - if (usePaths) { - context.stroke(path); - } else { - context.stroke(); - } - - if (borderStyle === 'double') { - context.lineWidth = borderWidth / 3; - - var gco = context.globalCompositeOperation; - context.globalCompositeOperation = 'destination-out'; - - if (usePaths) { - context.stroke(path); - } else { - context.stroke(); - } - - context.globalCompositeOperation = gco; - } - - // reset in case we changed the border style - if (context.setLineDash) { - // for very outofdate browsers - context.setLineDash([]); - } - } - }; - - var drawOverlay = function drawOverlay() { - var overlayPadding = node.pstyle('overlay-padding').pfValue; - var overlayOpacity = node.pstyle('overlay-opacity').value; - var overlayColor = node.pstyle('overlay-color').value; - - if (overlayOpacity > 0) { - r.fillStyle(context, overlayColor[0], overlayColor[1], overlayColor[2], overlayOpacity); - - r.nodeShapes['roundrectangle'].draw(context, pos.x, pos.y, nodeWidth + overlayPadding * 2, nodeHeight + overlayPadding * 2); - - context.fill(); - } - }; - - var drawText = function drawText() { - r.drawElementText(context, node, drawLabel); - }; - - var ghost = node.pstyle('ghost').value === 'yes'; - - if (ghost) { - var gx = node.pstyle('ghost-offset-x').pfValue; - var gy = node.pstyle('ghost-offset-y').pfValue; - var ghostOpacity = node.pstyle('ghost-opacity').value; - var effGhostOpacity = ghostOpacity * parentOpacity; - - context.translate(gx, gy); - - setupShapeColor(ghostOpacity * bgOpacity); - drawShape(); - drawImages(effGhostOpacity); - drawPie(darkness !== 0 || borderWidth !== 0); - darken(effGhostOpacity); - setupBorderColor(ghostOpacity * borderOpacity); - drawBorder(); - - context.translate(-gx, -gy); - } - - setupShapeColor(); - drawShape(); - drawImages(); - drawPie(darkness !== 0 || borderWidth !== 0); - darken(); - setupBorderColor(); - drawBorder(); - - if (usePaths) { - context.translate(-pos.x, -pos.y); - } - - drawText(); - drawOverlay(); - - // - // clean up shift - - if (shiftToOriginWithBb) { - context.translate(bb.x1, bb.y1); - } -}; - -// does the node have at least one pie piece? -CRp.hasPie = function (node) { - node = node[0]; // ensure ele ref - - return node._private.hasPie; -}; - -CRp.drawPie = function (context, node, nodeOpacity, pos) { - node = node[0]; // ensure ele ref - pos = pos || node.position(); - - var cyStyle = node.cy().style(); - var pieSize = node.pstyle('pie-size'); - var x = pos.x; - var y = pos.y; - var nodeW = node.width(); - var nodeH = node.height(); - var radius = Math.min(nodeW, nodeH) / 2; // must fit in node - var lastPercent = 0; // what % to continue drawing pie slices from on [0, 1] - var usePaths = this.usePaths(); - - if (usePaths) { - x = 0; - y = 0; - } - - if (pieSize.units === '%') { - radius = radius * pieSize.pfValue; - } else if (pieSize.pfValue !== undefined) { - radius = pieSize.pfValue / 2; - } - - for (var i = 1; i <= cyStyle.pieBackgroundN; i++) { - // 1..N - var size = node.pstyle('pie-' + i + '-background-size').value; - var color = node.pstyle('pie-' + i + '-background-color').value; - var opacity = node.pstyle('pie-' + i + '-background-opacity').value * nodeOpacity; - var percent = size / 100; // map integer range [0, 100] to [0, 1] - - // percent can't push beyond 1 - if (percent + lastPercent > 1) { - percent = 1 - lastPercent; - } - - var angleStart = 1.5 * Math.PI + 2 * Math.PI * lastPercent; // start at 12 o'clock and go clockwise - var angleDelta = 2 * Math.PI * percent; - var angleEnd = angleStart + angleDelta; - - // ignore if - // - zero size - // - we're already beyond the full circle - // - adding the current slice would go beyond the full circle - if (size === 0 || lastPercent >= 1 || lastPercent + percent > 1) { - continue; - } - - context.beginPath(); - context.moveTo(x, y); - context.arc(x, y, radius, angleStart, angleEnd); - context.closePath(); - - this.fillStyle(context, color[0], color[1], color[2], opacity); - - context.fill(); - - lastPercent += percent; - } -}; - -module.exports = CRp; - -/***/ }), -/* 132 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var CRp = {}; - -var util = __webpack_require__(1); - -var motionBlurDelay = 100; - -// var isFirefox = typeof InstallTrigger !== 'undefined'; - -CRp.getPixelRatio = function () { - var context = this.data.contexts[0]; - - if (this.forcedPixelRatio != null) { - return this.forcedPixelRatio; - } - - var backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1; - - return (window.devicePixelRatio || 1) / backingStore; // eslint-disable-line no-undef -}; - -CRp.paintCache = function (context) { - var caches = this.paintCaches = this.paintCaches || []; - var needToCreateCache = true; - var cache; - - for (var i = 0; i < caches.length; i++) { - cache = caches[i]; - - if (cache.context === context) { - needToCreateCache = false; - break; - } - } - - if (needToCreateCache) { - cache = { - context: context - }; - caches.push(cache); - } - - return cache; -}; - -CRp.fillStyle = function (context, r, g, b, a) { - context.fillStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; - - // turn off for now, seems context does its own caching - - // var cache = this.paintCache(context); - - // var fillStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; - - // if( cache.fillStyle !== fillStyle ){ - // context.fillStyle = cache.fillStyle = fillStyle; - // } -}; - -CRp.strokeStyle = function (context, r, g, b, a) { - context.strokeStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; - - // turn off for now, seems context does its own caching - - // var cache = this.paintCache(context); - - // var strokeStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; - - // if( cache.strokeStyle !== strokeStyle ){ - // context.strokeStyle = cache.strokeStyle = strokeStyle; - // } -}; - -// Resize canvas -CRp.matchCanvasSize = function (container) { - var r = this; - var data = r.data; - var bb = r.findContainerClientCoords(); - var width = bb[2]; - var height = bb[3]; - var pixelRatio = r.getPixelRatio(); - var mbPxRatio = r.motionBlurPxRatio; - - if (container === r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_NODE] || container === r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_DRAG]) { - pixelRatio = mbPxRatio; - } - - var canvasWidth = width * pixelRatio; - var canvasHeight = height * pixelRatio; - var canvas; - - if (canvasWidth === r.canvasWidth && canvasHeight === r.canvasHeight) { - return; // save cycles if same - } - - r.fontCaches = null; // resizing resets the style - - var canvasContainer = data.canvasContainer; - canvasContainer.style.width = width + 'px'; - canvasContainer.style.height = height + 'px'; - - for (var i = 0; i < r.CANVAS_LAYERS; i++) { - canvas = data.canvases[i]; - - canvas.width = canvasWidth; - canvas.height = canvasHeight; - - canvas.style.width = width + 'px'; - canvas.style.height = height + 'px'; - } - - for (var i = 0; i < r.BUFFER_COUNT; i++) { - canvas = data.bufferCanvases[i]; - - canvas.width = canvasWidth; - canvas.height = canvasHeight; - - canvas.style.width = width + 'px'; - canvas.style.height = height + 'px'; - } - - r.textureMult = 1; - if (pixelRatio <= 1) { - canvas = data.bufferCanvases[r.TEXTURE_BUFFER]; - - r.textureMult = 2; - canvas.width = canvasWidth * r.textureMult; - canvas.height = canvasHeight * r.textureMult; - } - - r.canvasWidth = canvasWidth; - r.canvasHeight = canvasHeight; -}; - -CRp.renderTo = function (cxt, zoom, pan, pxRatio) { - this.render({ - forcedContext: cxt, - forcedZoom: zoom, - forcedPan: pan, - drawAllLayers: true, - forcedPxRatio: pxRatio - }); -}; - -CRp.render = function (options) { - options = options || util.staticEmptyObject(); - - var forcedContext = options.forcedContext; - var drawAllLayers = options.drawAllLayers; - var drawOnlyNodeLayer = options.drawOnlyNodeLayer; - var forcedZoom = options.forcedZoom; - var forcedPan = options.forcedPan; - var r = this; - var pixelRatio = options.forcedPxRatio === undefined ? this.getPixelRatio() : options.forcedPxRatio; - var cy = r.cy;var data = r.data; - var needDraw = data.canvasNeedsRedraw; - var textureDraw = r.textureOnViewport && !forcedContext && (r.pinching || r.hoverData.dragging || r.swipePanning || r.data.wheelZooming); - var motionBlur = options.motionBlur !== undefined ? options.motionBlur : r.motionBlur; - var mbPxRatio = r.motionBlurPxRatio; - var hasCompoundNodes = cy.hasCompoundNodes(); - var inNodeDragGesture = r.hoverData.draggingEles; - var inBoxSelection = r.hoverData.selecting || r.touchData.selecting ? true : false; - motionBlur = motionBlur && !forcedContext && r.motionBlurEnabled && !inBoxSelection; - var motionBlurFadeEffect = motionBlur; - - if (!forcedContext) { - if (r.prevPxRatio !== pixelRatio) { - r.invalidateContainerClientCoordsCache(); - r.matchCanvasSize(r.container); - - r.redrawHint('eles', true); - r.redrawHint('drag', true); - } - - r.prevPxRatio = pixelRatio; - } - - if (!forcedContext && r.motionBlurTimeout) { - clearTimeout(r.motionBlurTimeout); - } - - if (motionBlur) { - if (r.mbFrames == null) { - r.mbFrames = 0; - } - - r.mbFrames++; - - if (r.mbFrames < 3) { - // need several frames before even high quality motionblur - motionBlurFadeEffect = false; - } - - // go to lower quality blurry frames when several m/b frames have been rendered (avoids flashing) - if (r.mbFrames > r.minMbLowQualFrames) { - //r.fullQualityMb = false; - r.motionBlurPxRatio = r.mbPxRBlurry; - } - } - - if (r.clearingMotionBlur) { - r.motionBlurPxRatio = 1; - } - - // b/c drawToContext() may be async w.r.t. redraw(), keep track of last texture frame - // because a rogue async texture frame would clear needDraw - if (r.textureDrawLastFrame && !textureDraw) { - needDraw[r.NODE] = true; - needDraw[r.SELECT_BOX] = true; - } - - var coreStyle = cy.style()._private.coreStyle; - - var zoom = cy.zoom(); - var effectiveZoom = forcedZoom !== undefined ? forcedZoom : zoom; - var pan = cy.pan(); - var effectivePan = { - x: pan.x, - y: pan.y - }; - - var vp = { - zoom: zoom, - pan: { - x: pan.x, - y: pan.y - } - }; - var prevVp = r.prevViewport; - var viewportIsDiff = prevVp === undefined || vp.zoom !== prevVp.zoom || vp.pan.x !== prevVp.pan.x || vp.pan.y !== prevVp.pan.y; - - // we want the low quality motionblur only when the viewport is being manipulated etc (where it's not noticed) - if (!viewportIsDiff && !(inNodeDragGesture && !hasCompoundNodes)) { - r.motionBlurPxRatio = 1; - } - - if (forcedPan) { - effectivePan = forcedPan; - } - - // apply pixel ratio - - effectiveZoom *= pixelRatio; - effectivePan.x *= pixelRatio; - effectivePan.y *= pixelRatio; - - var eles = r.getCachedZSortedEles(); - - function mbclear(context, x, y, w, h) { - var gco = context.globalCompositeOperation; - - context.globalCompositeOperation = 'destination-out'; - r.fillStyle(context, 255, 255, 255, r.motionBlurTransparency); - context.fillRect(x, y, w, h); - - context.globalCompositeOperation = gco; - } - - function setContextTransform(context, clear) { - var ePan, eZoom, w, h; - - if (!r.clearingMotionBlur && (context === data.bufferContexts[r.MOTIONBLUR_BUFFER_NODE] || context === data.bufferContexts[r.MOTIONBLUR_BUFFER_DRAG])) { - ePan = { - x: pan.x * mbPxRatio, - y: pan.y * mbPxRatio - }; - - eZoom = zoom * mbPxRatio; - - w = r.canvasWidth * mbPxRatio; - h = r.canvasHeight * mbPxRatio; - } else { - ePan = effectivePan; - eZoom = effectiveZoom; - - w = r.canvasWidth; - h = r.canvasHeight; - } - - context.setTransform(1, 0, 0, 1, 0, 0); - - if (clear === 'motionBlur') { - mbclear(context, 0, 0, w, h); - } else if (!forcedContext && (clear === undefined || clear)) { - context.clearRect(0, 0, w, h); - } - - if (!drawAllLayers) { - context.translate(ePan.x, ePan.y); - context.scale(eZoom, eZoom); - } - if (forcedPan) { - context.translate(forcedPan.x, forcedPan.y); - } - if (forcedZoom) { - context.scale(forcedZoom, forcedZoom); - } - } - - if (!textureDraw) { - r.textureDrawLastFrame = false; - } - - if (textureDraw) { - r.textureDrawLastFrame = true; - - var bb; - - if (!r.textureCache) { - r.textureCache = {}; - - bb = r.textureCache.bb = cy.mutableElements().boundingBox(); - - r.textureCache.texture = r.data.bufferCanvases[r.TEXTURE_BUFFER]; - - var cxt = r.data.bufferContexts[r.TEXTURE_BUFFER]; - - cxt.setTransform(1, 0, 0, 1, 0, 0); - cxt.clearRect(0, 0, r.canvasWidth * r.textureMult, r.canvasHeight * r.textureMult); - - r.render({ - forcedContext: cxt, - drawOnlyNodeLayer: true, - forcedPxRatio: pixelRatio * r.textureMult - }); - - var vp = r.textureCache.viewport = { - zoom: cy.zoom(), - pan: cy.pan(), - width: r.canvasWidth, - height: r.canvasHeight - }; - - vp.mpan = { - x: (0 - vp.pan.x) / vp.zoom, - y: (0 - vp.pan.y) / vp.zoom - }; - } - - needDraw[r.DRAG] = false; - needDraw[r.NODE] = false; - - var context = data.contexts[r.NODE]; - - var texture = r.textureCache.texture; - var vp = r.textureCache.viewport; - bb = r.textureCache.bb; - - context.setTransform(1, 0, 0, 1, 0, 0); - - if (motionBlur) { - mbclear(context, 0, 0, vp.width, vp.height); - } else { - context.clearRect(0, 0, vp.width, vp.height); - } - - var outsideBgColor = coreStyle['outside-texture-bg-color'].value; - var outsideBgOpacity = coreStyle['outside-texture-bg-opacity'].value; - r.fillStyle(context, outsideBgColor[0], outsideBgColor[1], outsideBgColor[2], outsideBgOpacity); - context.fillRect(0, 0, vp.width, vp.height); - - var zoom = cy.zoom(); - - setContextTransform(context, false); - - context.clearRect(vp.mpan.x, vp.mpan.y, vp.width / vp.zoom / pixelRatio, vp.height / vp.zoom / pixelRatio); - context.drawImage(texture, vp.mpan.x, vp.mpan.y, vp.width / vp.zoom / pixelRatio, vp.height / vp.zoom / pixelRatio); - } else if (r.textureOnViewport && !forcedContext) { - // clear the cache since we don't need it - r.textureCache = null; - } - - var extent = cy.extent(); - var vpManip = r.pinching || r.hoverData.dragging || r.swipePanning || r.data.wheelZooming || r.hoverData.draggingEles; - var hideEdges = r.hideEdgesOnViewport && vpManip; - - var needMbClear = []; - - needMbClear[r.NODE] = !needDraw[r.NODE] && motionBlur && !r.clearedForMotionBlur[r.NODE] || r.clearingMotionBlur; - if (needMbClear[r.NODE]) { - r.clearedForMotionBlur[r.NODE] = true; - } - - needMbClear[r.DRAG] = !needDraw[r.DRAG] && motionBlur && !r.clearedForMotionBlur[r.DRAG] || r.clearingMotionBlur; - if (needMbClear[r.DRAG]) { - r.clearedForMotionBlur[r.DRAG] = true; - } - - if (needDraw[r.NODE] || drawAllLayers || drawOnlyNodeLayer || needMbClear[r.NODE]) { - var useBuffer = motionBlur && !needMbClear[r.NODE] && mbPxRatio !== 1; - var context = forcedContext || (useBuffer ? r.data.bufferContexts[r.MOTIONBLUR_BUFFER_NODE] : data.contexts[r.NODE]); - var clear = motionBlur && !useBuffer ? 'motionBlur' : undefined; - - setContextTransform(context, clear); - - if (hideEdges) { - r.drawCachedNodes(context, eles.nondrag, pixelRatio, extent); - } else { - r.drawLayeredElements(context, eles.nondrag, pixelRatio, extent); - } - - if (r.debug) { - r.drawDebugPoints(context, eles.nondrag); - } - - if (!drawAllLayers && !motionBlur) { - needDraw[r.NODE] = false; - } - } - - if (!drawOnlyNodeLayer && (needDraw[r.DRAG] || drawAllLayers || needMbClear[r.DRAG])) { - var useBuffer = motionBlur && !needMbClear[r.DRAG] && mbPxRatio !== 1; - var context = forcedContext || (useBuffer ? r.data.bufferContexts[r.MOTIONBLUR_BUFFER_DRAG] : data.contexts[r.DRAG]); - - setContextTransform(context, motionBlur && !useBuffer ? 'motionBlur' : undefined); - - if (hideEdges) { - r.drawCachedNodes(context, eles.drag, pixelRatio, extent); - } else { - r.drawCachedElements(context, eles.drag, pixelRatio, extent); - } - - if (r.debug) { - r.drawDebugPoints(context, eles.drag); - } - - if (!drawAllLayers && !motionBlur) { - needDraw[r.DRAG] = false; - } - } - - if (r.showFps || !drawOnlyNodeLayer && needDraw[r.SELECT_BOX] && !drawAllLayers) { - var context = forcedContext || data.contexts[r.SELECT_BOX]; - - setContextTransform(context); - - if (r.selection[4] == 1 && (r.hoverData.selecting || r.touchData.selecting)) { - var zoom = r.cy.zoom(); - var borderWidth = coreStyle['selection-box-border-width'].value / zoom; - - context.lineWidth = borderWidth; - context.fillStyle = 'rgba(' + coreStyle['selection-box-color'].value[0] + ',' + coreStyle['selection-box-color'].value[1] + ',' + coreStyle['selection-box-color'].value[2] + ',' + coreStyle['selection-box-opacity'].value + ')'; - - context.fillRect(r.selection[0], r.selection[1], r.selection[2] - r.selection[0], r.selection[3] - r.selection[1]); - - if (borderWidth > 0) { - context.strokeStyle = 'rgba(' + coreStyle['selection-box-border-color'].value[0] + ',' + coreStyle['selection-box-border-color'].value[1] + ',' + coreStyle['selection-box-border-color'].value[2] + ',' + coreStyle['selection-box-opacity'].value + ')'; - - context.strokeRect(r.selection[0], r.selection[1], r.selection[2] - r.selection[0], r.selection[3] - r.selection[1]); - } - } - - if (data.bgActivePosistion && !r.hoverData.selecting) { - var zoom = r.cy.zoom(); - var pos = data.bgActivePosistion; - - context.fillStyle = 'rgba(' + coreStyle['active-bg-color'].value[0] + ',' + coreStyle['active-bg-color'].value[1] + ',' + coreStyle['active-bg-color'].value[2] + ',' + coreStyle['active-bg-opacity'].value + ')'; - - context.beginPath(); - context.arc(pos.x, pos.y, coreStyle['active-bg-size'].pfValue / zoom, 0, 2 * Math.PI); - context.fill(); - } - - var timeToRender = r.lastRedrawTime; - if (r.showFps && timeToRender) { - timeToRender = Math.round(timeToRender); - var fps = Math.round(1000 / timeToRender); - - context.setTransform(1, 0, 0, 1, 0, 0); - - context.fillStyle = 'rgba(255, 0, 0, 0.75)'; - context.strokeStyle = 'rgba(255, 0, 0, 0.75)'; - context.lineWidth = 1; - context.fillText('1 frame = ' + timeToRender + ' ms = ' + fps + ' fps', 0, 20); - - var maxFps = 60; - context.strokeRect(0, 30, 250, 20); - context.fillRect(0, 30, 250 * Math.min(fps / maxFps, 1), 20); - } - - if (!drawAllLayers) { - needDraw[r.SELECT_BOX] = false; - } - } - - // motionblur: blit rendered blurry frames - if (motionBlur && mbPxRatio !== 1) { - var cxtNode = data.contexts[r.NODE]; - var txtNode = r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_NODE]; - - var cxtDrag = data.contexts[r.DRAG]; - var txtDrag = r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_DRAG]; - - var drawMotionBlur = function drawMotionBlur(cxt, txt, needClear) { - cxt.setTransform(1, 0, 0, 1, 0, 0); - - if (needClear || !motionBlurFadeEffect) { - cxt.clearRect(0, 0, r.canvasWidth, r.canvasHeight); - } else { - mbclear(cxt, 0, 0, r.canvasWidth, r.canvasHeight); - } - - var pxr = mbPxRatio; - - cxt.drawImage(txt, // img - 0, 0, // sx, sy - r.canvasWidth * pxr, r.canvasHeight * pxr, // sw, sh - 0, 0, // x, y - r.canvasWidth, r.canvasHeight // w, h - ); - }; - - if (needDraw[r.NODE] || needMbClear[r.NODE]) { - drawMotionBlur(cxtNode, txtNode, needMbClear[r.NODE]); - needDraw[r.NODE] = false; - } - - if (needDraw[r.DRAG] || needMbClear[r.DRAG]) { - drawMotionBlur(cxtDrag, txtDrag, needMbClear[r.DRAG]); - needDraw[r.DRAG] = false; - } - } - - r.prevViewport = vp; - - if (r.clearingMotionBlur) { - r.clearingMotionBlur = false; - r.motionBlurCleared = true; - r.motionBlur = true; - } - - if (motionBlur) { - r.motionBlurTimeout = setTimeout(function () { - r.motionBlurTimeout = null; - - r.clearedForMotionBlur[r.NODE] = false; - r.clearedForMotionBlur[r.DRAG] = false; - r.motionBlur = false; - r.clearingMotionBlur = !textureDraw; - r.mbFrames = 0; - - needDraw[r.NODE] = true; - needDraw[r.DRAG] = true; - - r.redraw(); - }, motionBlurDelay); - } - - if (!forcedContext) { - cy.emit('render'); - } -}; - -module.exports = CRp; - -/***/ }), -/* 133 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var math = __webpack_require__(2); - -var CRp = {}; - -// @O Polygon drawing -CRp.drawPolygonPath = function (context, x, y, width, height, points) { - - var halfW = width / 2; - var halfH = height / 2; - - if (context.beginPath) { - context.beginPath(); - } - - context.moveTo(x + halfW * points[0], y + halfH * points[1]); - - for (var i = 1; i < points.length / 2; i++) { - context.lineTo(x + halfW * points[i * 2], y + halfH * points[i * 2 + 1]); - } - - context.closePath(); -}; - -// Round rectangle drawing -CRp.drawRoundRectanglePath = function (context, x, y, width, height) { - - var halfWidth = width / 2; - var halfHeight = height / 2; - var cornerRadius = math.getRoundRectangleRadius(width, height); - - if (context.beginPath) { - context.beginPath(); - } - - // Start at top middle - context.moveTo(x, y - halfHeight); - // Arc from middle top to right side - context.arcTo(x + halfWidth, y - halfHeight, x + halfWidth, y, cornerRadius); - // Arc from right side to bottom - context.arcTo(x + halfWidth, y + halfHeight, x, y + halfHeight, cornerRadius); - // Arc from bottom to left side - context.arcTo(x - halfWidth, y + halfHeight, x - halfWidth, y, cornerRadius); - // Arc from left side to topBorder - context.arcTo(x - halfWidth, y - halfHeight, x, y - halfHeight, cornerRadius); - // Join line - context.lineTo(x, y - halfHeight); - - context.closePath(); -}; - -CRp.drawBottomRoundRectanglePath = function (context, x, y, width, height) { - - var halfWidth = width / 2; - var halfHeight = height / 2; - var cornerRadius = math.getRoundRectangleRadius(width, height); - - if (context.beginPath) { - context.beginPath(); - } - - // Start at top middle - context.moveTo(x, y - halfHeight); - context.lineTo(x + halfWidth, y - halfHeight); - context.lineTo(x + halfWidth, y); - - context.arcTo(x + halfWidth, y + halfHeight, x, y + halfHeight, cornerRadius); - context.arcTo(x - halfWidth, y + halfHeight, x - halfWidth, y, cornerRadius); - - context.lineTo(x - halfWidth, y - halfHeight); - context.lineTo(x, y - halfHeight); - - context.closePath(); -}; - -CRp.drawCutRectanglePath = function (context, x, y, width, height) { - - var halfWidth = width / 2; - var halfHeight = height / 2; - var cornerLength = math.getCutRectangleCornerLength(); - - if (context.beginPath) { - context.beginPath(); - } - - context.moveTo(x - halfWidth + cornerLength, y - halfHeight); - - context.lineTo(x + halfWidth - cornerLength, y - halfHeight); - context.lineTo(x + halfWidth, y - halfHeight + cornerLength); - context.lineTo(x + halfWidth, y + halfHeight - cornerLength); - context.lineTo(x + halfWidth - cornerLength, y + halfHeight); - context.lineTo(x - halfWidth + cornerLength, y + halfHeight); - context.lineTo(x - halfWidth, y + halfHeight - cornerLength); - context.lineTo(x - halfWidth, y - halfHeight + cornerLength); - - context.closePath(); -}; - -CRp.drawBarrelPath = function (context, x, y, width, height) { - - var halfWidth = width / 2; - var halfHeight = height / 2; - - var xBegin = x - halfWidth; - var xEnd = x + halfWidth; - var yBegin = y - halfHeight; - var yEnd = y + halfHeight; - - var barrelCurveConstants = math.getBarrelCurveConstants(width, height); - var wOffset = barrelCurveConstants.widthOffset; - var hOffset = barrelCurveConstants.heightOffset; - var ctrlPtXOffset = barrelCurveConstants.ctrlPtOffsetPct * wOffset; - - if (context.beginPath) { - context.beginPath(); - } - - context.moveTo(xBegin, yBegin + hOffset); - - context.lineTo(xBegin, yEnd - hOffset); - context.quadraticCurveTo(xBegin + ctrlPtXOffset, yEnd, xBegin + wOffset, yEnd); - - context.lineTo(xEnd - wOffset, yEnd); - context.quadraticCurveTo(xEnd - ctrlPtXOffset, yEnd, xEnd, yEnd - hOffset); - - context.lineTo(xEnd, yBegin + hOffset); - context.quadraticCurveTo(xEnd - ctrlPtXOffset, yBegin, xEnd - wOffset, yBegin); - - context.lineTo(xBegin + wOffset, yBegin); - context.quadraticCurveTo(xBegin + ctrlPtXOffset, yBegin, xBegin, yBegin + hOffset); - - context.closePath(); -}; - -var sin0 = Math.sin(0); -var cos0 = Math.cos(0); - -var sin = {}; -var cos = {}; - -var ellipseStepSize = Math.PI / 40; - -for (var i = 0 * Math.PI; i < 2 * Math.PI; i += ellipseStepSize) { - sin[i] = Math.sin(i); - cos[i] = Math.cos(i); -} - -CRp.drawEllipsePath = function (context, centerX, centerY, width, height) { - if (context.beginPath) { - context.beginPath(); - } - - if (context.ellipse) { - context.ellipse(centerX, centerY, width / 2, height / 2, 0, 0, 2 * Math.PI); - } else { - var xPos, yPos; - var rw = width / 2; - var rh = height / 2; - for (var i = 0 * Math.PI; i < 2 * Math.PI; i += ellipseStepSize) { - xPos = centerX - rw * sin[i] * sin0 + rw * cos[i] * cos0; - yPos = centerY + rh * cos[i] * sin0 + rh * sin[i] * cos0; - - if (i === 0) { - context.moveTo(xPos, yPos); - } else { - context.lineTo(xPos, yPos); - } - } - } - - context.closePath(); -}; - -module.exports = CRp; - -/***/ }), -/* 134 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); - -var CRp = {}; - -CRp.createBuffer = function (w, h) { - var buffer = document.createElement('canvas'); // eslint-disable-line no-undef - buffer.width = w; - buffer.height = h; - - return [buffer, buffer.getContext('2d')]; -}; - -CRp.bufferCanvasImage = function (options) { - var cy = this.cy; - var eles = cy.mutableElements(); - var bb = eles.boundingBox(); - var ctrRect = this.findContainerClientCoords(); - var width = options.full ? Math.ceil(bb.w) : ctrRect[2]; - var height = options.full ? Math.ceil(bb.h) : ctrRect[3]; - var specdMaxDims = is.number(options.maxWidth) || is.number(options.maxHeight); - var pxRatio = this.getPixelRatio(); - var scale = 1; - - if (options.scale !== undefined) { - width *= options.scale; - height *= options.scale; - - scale = options.scale; - } else if (specdMaxDims) { - var maxScaleW = Infinity; - var maxScaleH = Infinity; - - if (is.number(options.maxWidth)) { - maxScaleW = scale * options.maxWidth / width; - } - - if (is.number(options.maxHeight)) { - maxScaleH = scale * options.maxHeight / height; - } - - scale = Math.min(maxScaleW, maxScaleH); - - width *= scale; - height *= scale; - } - - if (!specdMaxDims) { - width *= pxRatio; - height *= pxRatio; - scale *= pxRatio; - } - - var buffCanvas = document.createElement('canvas'); // eslint-disable-line no-undef - - buffCanvas.width = width; - buffCanvas.height = height; - - buffCanvas.style.width = width + 'px'; - buffCanvas.style.height = height + 'px'; - - var buffCxt = buffCanvas.getContext('2d'); - - // Rasterize the layers, but only if container has nonzero size - if (width > 0 && height > 0) { - - buffCxt.clearRect(0, 0, width, height); - - buffCxt.globalCompositeOperation = 'source-over'; - - var zsortedEles = this.getCachedZSortedEles(); - - if (options.full) { - // draw the full bounds of the graph - buffCxt.translate(-bb.x1 * scale, -bb.y1 * scale); - buffCxt.scale(scale, scale); - - this.drawElements(buffCxt, zsortedEles); - - buffCxt.scale(1 / scale, 1 / scale); - buffCxt.translate(bb.x1 * scale, bb.y1 * scale); - } else { - // draw the current view - var pan = cy.pan(); - - var translation = { - x: pan.x * scale, - y: pan.y * scale - }; - - scale *= cy.zoom(); - - buffCxt.translate(translation.x, translation.y); - buffCxt.scale(scale, scale); - - this.drawElements(buffCxt, zsortedEles); - - buffCxt.scale(1 / scale, 1 / scale); - buffCxt.translate(-translation.x, -translation.y); - } - - // need to fill bg at end like this in order to fill cleared transparent pixels in jpgs - if (options.bg) { - buffCxt.globalCompositeOperation = 'destination-over'; - - buffCxt.fillStyle = options.bg; - buffCxt.rect(0, 0, width, height); - buffCxt.fill(); - } - } - - return buffCanvas; -}; - -function b64ToBlob(b64, mimeType) { - var bytes = atob(b64); - var buff = new ArrayBuffer(bytes.length); - var buffUint8 = new Uint8Array(buff); - - for (var i = 0; i < bytes.length; i++) { - buffUint8[i] = bytes.charCodeAt(i); - } - - return new Blob([buff], { type: mimeType }); -} - -function b64UriToB64(b64uri) { - var i = b64uri.indexOf(','); - - return b64uri.substr(i + 1); -}; - -function output(options, canvas, mimeType) { - var b64Uri = canvas.toDataURL(mimeType, options.quality); - - switch (options.output) { - case 'blob': - return b64ToBlob(b64UriToB64(b64Uri), mimeType); - - case 'base64': - return b64UriToB64(b64Uri); - - case 'base64uri': - default: - return b64Uri; - } -} - -CRp.png = function (options) { - return output(options, this.bufferCanvasImage(options), 'image/png'); -}; - -CRp.jpg = function (options) { - return output(options, this.bufferCanvasImage(options), 'image/jpeg'); -}; - -module.exports = CRp; - -/***/ }), -/* 135 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var CRp = {}; - -CRp.nodeShapeImpl = function (name, context, centerX, centerY, width, height, points) { - switch (name) { - case 'ellipse': - return this.drawEllipsePath(context, centerX, centerY, width, height); - case 'polygon': - return this.drawPolygonPath(context, centerX, centerY, width, height, points); - case 'roundrectangle': - return this.drawRoundRectanglePath(context, centerX, centerY, width, height); - case 'cutrectangle': - return this.drawCutRectanglePath(context, centerX, centerY, width, height); - case 'bottomroundrectangle': - return this.drawBottomRoundRectanglePath(context, centerX, centerY, width, height); - case 'barrel': - return this.drawBarrelPath(context, centerX, centerY, width, height); - } -}; - -module.exports = CRp; - -/***/ }), -/* 136 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var util = __webpack_require__(1); -var Style = __webpack_require__(18); - -// a dummy stylesheet object that doesn't need a reference to the core -// (useful for init) -var Stylesheet = function Stylesheet() { - if (!(this instanceof Stylesheet)) { - return new Stylesheet(); - } - - this.length = 0; -}; - -var sheetfn = Stylesheet.prototype; - -sheetfn.instanceString = function () { - return 'stylesheet'; -}; - -// just store the selector to be parsed later -sheetfn.selector = function (selector) { - var i = this.length++; - - this[i] = { - selector: selector, - properties: [] - }; - - return this; // chaining -}; - -// just store the property to be parsed later -sheetfn.css = function (name, value) { - var i = this.length - 1; - - if (is.string(name)) { - this[i].properties.push({ - name: name, - value: value - }); - } else if (is.plainObject(name)) { - var map = name; - - for (var j = 0; j < Style.properties.length; j++) { - var prop = Style.properties[j]; - var mapVal = map[prop.name]; - - if (mapVal === undefined) { - // also try camel case name - mapVal = map[util.dash2camel(prop.name)]; - } - - if (mapVal !== undefined) { - var _name = prop.name; - var _value = mapVal; - - this[i].properties.push({ - name: _name, - value: _value - }); - } - } - } - - return this; // chaining -}; - -sheetfn.style = sheetfn.css; - -// generate a real style object from the dummy stylesheet -sheetfn.generateStyle = function (cy) { - var style = new Style(cy); - - return this.appendToStyle(style); -}; - -// append a dummy stylesheet object on a real style object -sheetfn.appendToStyle = function (style) { - for (var i = 0; i < this.length; i++) { - var context = this[i]; - var selector = context.selector; - var props = context.properties; - - style.selector(selector); // apply selector - - for (var j = 0; j < props.length; j++) { - var prop = props[j]; - - style.css(prop.name, prop.value); // apply property - } - } - - return style; -}; - -module.exports = Stylesheet; - -/***/ }), -/* 137 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = "3.2.18"; - -/***/ }) -/******/ ]); -}); \ No newline at end of file diff --git a/node_modules/cytoscape/dist/cytoscape.js b/node_modules/cytoscape/dist/cytoscape.js deleted file mode 100644 index 801d4feed..000000000 --- a/node_modules/cytoscape/dist/cytoscape.js +++ /dev/null @@ -1,29906 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["cytoscape"] = factory(); - else - root["cytoscape"] = factory(); -})(typeof self !== 'undefined' ? self : this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 20); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -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; }; - -/*global HTMLElement DocumentTouch */ - -var window = __webpack_require__(3); -var navigator = window ? window.navigator : null; -var document = window ? window.document : null; - -var typeofstr = _typeof(''); -var typeofobj = _typeof({}); -var typeoffn = _typeof(function () {}); -var typeofhtmlele = typeof HTMLElement === 'undefined' ? 'undefined' : _typeof(HTMLElement); - -var instanceStr = function instanceStr(obj) { - return obj && obj.instanceString && is.fn(obj.instanceString) ? obj.instanceString() : null; -}; - -var is = { - defined: function defined(obj) { - return obj != null; // not undefined or null - }, - - string: function string(obj) { - return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) == typeofstr; - }, - - fn: function fn(obj) { - return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === typeoffn; - }, - - array: function array(obj) { - return Array.isArray ? Array.isArray(obj) : obj != null && obj instanceof Array; - }, - - plainObject: function plainObject(obj) { - return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === typeofobj && !is.array(obj) && obj.constructor === Object; - }, - - object: function object(obj) { - return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === typeofobj; - }, - - number: function number(obj) { - return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === _typeof(1) && !isNaN(obj); - }, - - integer: function integer(obj) { - return is.number(obj) && Math.floor(obj) === obj; - }, - - bool: function bool(obj) { - return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === _typeof(true); - }, - - htmlElement: function htmlElement(obj) { - if ('undefined' === typeofhtmlele) { - return undefined; - } else { - return null != obj && obj instanceof HTMLElement; - } - }, - - elementOrCollection: function elementOrCollection(obj) { - return is.element(obj) || is.collection(obj); - }, - - element: function element(obj) { - return instanceStr(obj) === 'collection' && obj._private.single; - }, - - collection: function collection(obj) { - return instanceStr(obj) === 'collection' && !obj._private.single; - }, - - core: function core(obj) { - return instanceStr(obj) === 'core'; - }, - - style: function style(obj) { - return instanceStr(obj) === 'style'; - }, - - stylesheet: function stylesheet(obj) { - return instanceStr(obj) === 'stylesheet'; - }, - - event: function event(obj) { - return instanceStr(obj) === 'event'; - }, - - thread: function thread(obj) { - return instanceStr(obj) === 'thread'; - }, - - fabric: function fabric(obj) { - return instanceStr(obj) === 'fabric'; - }, - - emptyString: function emptyString(obj) { - if (obj === undefined || obj === null) { - // null is empty - return true; - } else if (obj === '' || obj.match(/^\s+$/)) { - return true; // empty string is empty - } - - return false; // otherwise, we don't know what we've got - }, - - nonemptyString: function nonemptyString(obj) { - if (obj && is.string(obj) && obj !== '' && !obj.match(/^\s+$/)) { - return true; - } - - return false; - }, - - domElement: function domElement(obj) { - if (typeof HTMLElement === 'undefined') { - return false; // we're not in a browser so it doesn't matter - } else { - return obj instanceof HTMLElement; - } - }, - - boundingBox: function boundingBox(obj) { - return is.plainObject(obj) && is.number(obj.x1) && is.number(obj.x2) && is.number(obj.y1) && is.number(obj.y2); - }, - - promise: function promise(obj) { - return is.object(obj) && is.fn(obj.then); - }, - - touch: function touch() { - return window && ('ontouchstart' in window || window.DocumentTouch && document instanceof DocumentTouch); - }, - - gecko: function gecko() { - return window && (typeof InstallTrigger !== 'undefined' || 'MozAppearance' in document.documentElement.style); - }, - - webkit: function webkit() { - return window && (typeof webkitURL !== 'undefined' || 'WebkitAppearance' in document.documentElement.style); - }, - - chromium: function chromium() { - return window && typeof chrome !== 'undefined'; - }, - - khtml: function khtml() { - return navigator && navigator.vendor.match(/kde/i); // probably a better way to detect this... - }, - - khtmlEtc: function khtmlEtc() { - return is.khtml() || is.webkit() || is.chromium(); - }, - - ms: function ms() { - return navigator && navigator.userAgent.match(/msie|trident|edge/i); // probably a better way to detect this... - }, - - windows: function windows() { - return navigator && navigator.appVersion.match(/Win/i); - }, - - mac: function mac() { - return navigator && navigator.appVersion.match(/Mac/i); - }, - - linux: function linux() { - return navigator && navigator.appVersion.match(/Linux/i); - }, - - unix: function unix() { - return navigator && navigator.appVersion.match(/X11/i); - } -}; - -module.exports = is; - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/*global console */ - -var is = __webpack_require__(0); -var math = __webpack_require__(2); - -var util = { - - MAX_INT: Number.MAX_SAFE_INTEGER || 9007199254740991, - - trueify: function trueify() { - return true; - }, - - falsify: function falsify() { - return false; - }, - - zeroify: function zeroify() { - return 0; - }, - - noop: function noop() {}, - - error: function error(msg) { - /* eslint-disable */ - if (console.error) { - console.error.apply(console, arguments); - - if (console.trace) { - console.trace(); - } - } else { - console.log.apply(console, arguments); - - if (console.trace) { - console.trace(); - } - } - /* eslint-enable */ - }, - - clone: function clone(obj) { - return this.extend({}, obj); - }, - - // gets a shallow copy of the argument - copy: function copy(obj) { - if (obj == null) { - return obj; - }if (is.array(obj)) { - return obj.slice(); - } else if (is.plainObject(obj)) { - return this.clone(obj); - } else { - return obj; - } - }, - - copyArray: function copyArray(arr) { - return arr.slice(); - }, - - clonePosition: function clonePosition(pos) { - return { x: pos.x, y: pos.y }; - }, - - uuid: function uuid(a, b // placeholders - ) { - for ( // loop :) - b = a = ''; // b - result , a - numeric letiable - a++ < 36; // - b += a * 51 & 52 // if "a" is not 9 or 14 or 19 or 24 - ? // return a random number or 4 - (a ^ 15 // if "a" is not 15 - ? // genetate a random number from 0 to 15 - 8 ^ Math.random() * (a ^ 20 ? 16 : 4) // unless "a" is 20, in which case a random number from 8 to 11 - : 4 // otherwise 4 - ).toString(16) : '-' // in other cases (if "a" is 9,14,19,24) insert "-" - ) {} - return b; - } - -}; - -util.makeBoundingBox = math.makeBoundingBox.bind(math); - -util._staticEmptyObject = {}; - -util.staticEmptyObject = function () { - return util._staticEmptyObject; -}; - -util.extend = Object.assign != null ? Object.assign.bind(Object) : function (tgt) { - var args = arguments; - - for (var i = 1; i < args.length; i++) { - var obj = args[i]; - - if (obj == null) { - continue; - } - - var keys = Object.keys(obj); - - for (var j = 0; j < keys.length; j++) { - var k = keys[j]; - - tgt[k] = obj[k]; - } - } - - return tgt; -}; - -util.assign = util.extend; - -util.default = function (val, def) { - if (val === undefined) { - return def; - } else { - return val; - } -}; - -util.removeFromArray = function (arr, ele, manyCopies) { - for (var i = arr.length; i >= 0; i--) { - if (arr[i] === ele) { - arr.splice(i, 1); - - if (!manyCopies) { - break; - } - } - } -}; - -util.clearArray = function (arr) { - arr.splice(0, arr.length); -}; - -util.push = function (arr, otherArr) { - for (var i = 0; i < otherArr.length; i++) { - var el = otherArr[i]; - - arr.push(el); - } -}; - -util.getPrefixedProperty = function (obj, propName, prefix) { - if (prefix) { - propName = this.prependCamel(prefix, propName); // e.g. (labelWidth, source) => sourceLabelWidth - } - - return obj[propName]; -}; - -util.setPrefixedProperty = function (obj, propName, prefix, value) { - if (prefix) { - propName = this.prependCamel(prefix, propName); // e.g. (labelWidth, source) => sourceLabelWidth - } - - obj[propName] = value; -}; - -[__webpack_require__(21), __webpack_require__(22), { memoize: __webpack_require__(13) }, __webpack_require__(23), __webpack_require__(24), __webpack_require__(25), __webpack_require__(27)].forEach(function (req) { - util.extend(util, req); -}); - -module.exports = util; - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var math = {}; - -math.arePositionsSame = function (p1, p2) { - return p1.x === p2.x && p1.y === p2.y; -}; - -math.copyPosition = function (p) { - return { x: p.x, y: p.y }; -}; - -math.modelToRenderedPosition = function (p, zoom, pan) { - return { - x: p.x * zoom + pan.x, - y: p.y * zoom + pan.y - }; -}; - -math.renderedToModelPosition = function (p, zoom, pan) { - return { - x: (p.x - pan.x) / zoom, - y: (p.y - pan.y) / zoom - }; -}; - -math.array2point = function (arr) { - return { - x: arr[0], - y: arr[1] - }; -}; - -math.deg2rad = function (deg) { - return Math.PI * deg / 180; -}; - -math.getAngleFromDisp = function (dispX, dispY) { - return Math.atan2(dispY, dispX) - Math.PI / 2; -}; - -math.log2 = Math.log2 || function (n) { - return Math.log(n) / Math.log(2); -}; - -math.signum = function (x) { - if (x > 0) { - return 1; - } else if (x < 0) { - return -1; - } else { - return 0; - } -}; - -math.dist = function (p1, p2) { - return Math.sqrt(math.sqdist(p1, p2)); -}; - -math.sqdist = function (p1, p2) { - var dx = p2.x - p1.x; - var dy = p2.y - p1.y; - - return dx * dx + dy * dy; -}; - -// from http://en.wikipedia.org/wiki/Bézier_curve#Quadratic_curves -math.qbezierAt = function (p0, p1, p2, t) { - return (1 - t) * (1 - t) * p0 + 2 * (1 - t) * t * p1 + t * t * p2; -}; - -math.qbezierPtAt = function (p0, p1, p2, t) { - return { - x: math.qbezierAt(p0.x, p1.x, p2.x, t), - y: math.qbezierAt(p0.y, p1.y, p2.y, t) - }; -}; - -math.lineAt = function (p0, p1, t, d) { - var vec = { - x: p1.x - p0.x, - y: p1.y - p0.y - }; - - var vecDist = math.dist(p0, p1); - - var normVec = { - x: vec.x / vecDist, - y: vec.y / vecDist - }; - - t = t == null ? 0 : t; - - d = d != null ? d : t * vecDist; - - return { - x: p0.x + normVec.x * d, - y: p0.y + normVec.y * d - }; -}; - -math.lineAtDist = function (p0, p1, d) { - return math.lineAt(p0, p1, undefined, d); -}; - -// get angle at A via cosine law -math.triangleAngle = function (A, B, C) { - var a = math.dist(B, C); - var b = math.dist(A, C); - var c = math.dist(A, B); - - return Math.acos((a * a + b * b - c * c) / (2 * a * b)); -}; - -math.bound = function (min, val, max) { - return Math.max(min, Math.min(max, val)); -}; - -// makes a full bb (x1, y1, x2, y2, w, h) from implicit params -math.makeBoundingBox = function (bb) { - if (bb == null) { - return { - x1: Infinity, - y1: Infinity, - x2: -Infinity, - y2: -Infinity, - w: 0, - h: 0 - }; - } else if (bb.x1 != null && bb.y1 != null) { - if (bb.x2 != null && bb.y2 != null && bb.x2 >= bb.x1 && bb.y2 >= bb.y1) { - return { - x1: bb.x1, - y1: bb.y1, - x2: bb.x2, - y2: bb.y2, - w: bb.x2 - bb.x1, - h: bb.y2 - bb.y1 - }; - } else if (bb.w != null && bb.h != null && bb.w >= 0 && bb.h >= 0) { - return { - x1: bb.x1, - y1: bb.y1, - x2: bb.x1 + bb.w, - y2: bb.y1 + bb.h, - w: bb.w, - h: bb.h - }; - } - } -}; - -math.updateBoundingBox = function (bb1, bb2) { - // update bb1 with bb2 bounds - - bb1.x1 = Math.min(bb1.x1, bb2.x1); - bb1.x2 = Math.max(bb1.x2, bb2.x2); - bb1.w = bb1.x2 - bb1.x1; - - bb1.y1 = Math.min(bb1.y1, bb2.y1); - bb1.y2 = Math.max(bb1.y2, bb2.y2); - bb1.h = bb1.y2 - bb1.y1; -}; - -math.expandBoundingBoxByPoint = function (bb, x, y) { - bb.x1 = Math.min(bb.x1, x); - bb.x2 = Math.max(bb.x2, x); - bb.w = bb.x2 - bb.x1; - - bb.y1 = Math.min(bb.y1, y); - bb.y2 = Math.max(bb.y2, y); - bb.h = bb.y2 - bb.y1; -}; - -math.expandBoundingBox = function (bb, padding) { - bb.x1 -= padding; - bb.x2 += padding; - bb.y1 -= padding; - bb.y2 += padding; - bb.w = bb.x2 - bb.x1; - bb.h = bb.y2 - bb.y1; - - return bb; -}; - -math.boundingBoxesIntersect = function (bb1, bb2) { - // case: one bb to right of other - if (bb1.x1 > bb2.x2) { - return false; - } - if (bb2.x1 > bb1.x2) { - return false; - } - - // case: one bb to left of other - if (bb1.x2 < bb2.x1) { - return false; - } - if (bb2.x2 < bb1.x1) { - return false; - } - - // case: one bb above other - if (bb1.y2 < bb2.y1) { - return false; - } - if (bb2.y2 < bb1.y1) { - return false; - } - - // case: one bb below other - if (bb1.y1 > bb2.y2) { - return false; - } - if (bb2.y1 > bb1.y2) { - return false; - } - - // otherwise, must have some overlap - return true; -}; - -math.inBoundingBox = function (bb, x, y) { - return bb.x1 <= x && x <= bb.x2 && bb.y1 <= y && y <= bb.y2; -}; - -math.pointInBoundingBox = function (bb, pt) { - return this.inBoundingBox(bb, pt.x, pt.y); -}; - -math.boundingBoxInBoundingBox = function (bb1, bb2) { - return math.inBoundingBox(bb1, bb2.x1, bb2.y1) && math.inBoundingBox(bb1, bb2.x2, bb2.y2); -}; - -math.roundRectangleIntersectLine = function (x, y, nodeX, nodeY, width, height, padding) { - - var cornerRadius = this.getRoundRectangleRadius(width, height); - - var halfWidth = width / 2; - var halfHeight = height / 2; - - // Check intersections with straight line segments - var straightLineIntersections = void 0; - - // Top segment, left to right - { - var topStartX = nodeX - halfWidth + cornerRadius - padding; - var topStartY = nodeY - halfHeight - padding; - var topEndX = nodeX + halfWidth - cornerRadius + padding; - var topEndY = topStartY; - - straightLineIntersections = this.finiteLinesIntersect(x, y, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false); - - if (straightLineIntersections.length > 0) { - return straightLineIntersections; - } - } - - // Right segment, top to bottom - { - var rightStartX = nodeX + halfWidth + padding; - var rightStartY = nodeY - halfHeight + cornerRadius - padding; - var rightEndX = rightStartX; - var rightEndY = nodeY + halfHeight - cornerRadius + padding; - - straightLineIntersections = this.finiteLinesIntersect(x, y, nodeX, nodeY, rightStartX, rightStartY, rightEndX, rightEndY, false); - - if (straightLineIntersections.length > 0) { - return straightLineIntersections; - } - } - - // Bottom segment, left to right - { - var bottomStartX = nodeX - halfWidth + cornerRadius - padding; - var bottomStartY = nodeY + halfHeight + padding; - var bottomEndX = nodeX + halfWidth - cornerRadius + padding; - var bottomEndY = bottomStartY; - - straightLineIntersections = this.finiteLinesIntersect(x, y, nodeX, nodeY, bottomStartX, bottomStartY, bottomEndX, bottomEndY, false); - - if (straightLineIntersections.length > 0) { - return straightLineIntersections; - } - } - - // Left segment, top to bottom - { - var leftStartX = nodeX - halfWidth - padding; - var leftStartY = nodeY - halfHeight + cornerRadius - padding; - var leftEndX = leftStartX; - var leftEndY = nodeY + halfHeight - cornerRadius + padding; - - straightLineIntersections = this.finiteLinesIntersect(x, y, nodeX, nodeY, leftStartX, leftStartY, leftEndX, leftEndY, false); - - if (straightLineIntersections.length > 0) { - return straightLineIntersections; - } - } - - // Check intersections with arc segments - var arcIntersections = void 0; - - // Top Left - { - var topLeftCenterX = nodeX - halfWidth + cornerRadius; - var topLeftCenterY = nodeY - halfHeight + cornerRadius; - arcIntersections = this.intersectLineCircle(x, y, nodeX, nodeY, topLeftCenterX, topLeftCenterY, cornerRadius + padding); - - // Ensure the intersection is on the desired quarter of the circle - if (arcIntersections.length > 0 && arcIntersections[0] <= topLeftCenterX && arcIntersections[1] <= topLeftCenterY) { - return [arcIntersections[0], arcIntersections[1]]; - } - } - - // Top Right - { - var topRightCenterX = nodeX + halfWidth - cornerRadius; - var topRightCenterY = nodeY - halfHeight + cornerRadius; - arcIntersections = this.intersectLineCircle(x, y, nodeX, nodeY, topRightCenterX, topRightCenterY, cornerRadius + padding); - - // Ensure the intersection is on the desired quarter of the circle - if (arcIntersections.length > 0 && arcIntersections[0] >= topRightCenterX && arcIntersections[1] <= topRightCenterY) { - return [arcIntersections[0], arcIntersections[1]]; - } - } - - // Bottom Right - { - var bottomRightCenterX = nodeX + halfWidth - cornerRadius; - var bottomRightCenterY = nodeY + halfHeight - cornerRadius; - arcIntersections = this.intersectLineCircle(x, y, nodeX, nodeY, bottomRightCenterX, bottomRightCenterY, cornerRadius + padding); - - // Ensure the intersection is on the desired quarter of the circle - if (arcIntersections.length > 0 && arcIntersections[0] >= bottomRightCenterX && arcIntersections[1] >= bottomRightCenterY) { - return [arcIntersections[0], arcIntersections[1]]; - } - } - - // Bottom Left - { - var bottomLeftCenterX = nodeX - halfWidth + cornerRadius; - var bottomLeftCenterY = nodeY + halfHeight - cornerRadius; - arcIntersections = this.intersectLineCircle(x, y, nodeX, nodeY, bottomLeftCenterX, bottomLeftCenterY, cornerRadius + padding); - - // Ensure the intersection is on the desired quarter of the circle - if (arcIntersections.length > 0 && arcIntersections[0] <= bottomLeftCenterX && arcIntersections[1] >= bottomLeftCenterY) { - return [arcIntersections[0], arcIntersections[1]]; - } - } - - return []; // if nothing -}; - -math.inLineVicinity = function (x, y, lx1, ly1, lx2, ly2, tolerance) { - var t = tolerance; - - var x1 = Math.min(lx1, lx2); - var x2 = Math.max(lx1, lx2); - var y1 = Math.min(ly1, ly2); - var y2 = Math.max(ly1, ly2); - - return x1 - t <= x && x <= x2 + t && y1 - t <= y && y <= y2 + t; -}; - -math.inBezierVicinity = function (x, y, x1, y1, x2, y2, x3, y3, tolerance) { - - var bb = { - x1: Math.min(x1, x3, x2) - tolerance, - x2: Math.max(x1, x3, x2) + tolerance, - y1: Math.min(y1, y3, y2) - tolerance, - y2: Math.max(y1, y3, y2) + tolerance - }; - - // if outside the rough bounding box for the bezier, then it can't be a hit - if (x < bb.x1 || x > bb.x2 || y < bb.y1 || y > bb.y2) { - // console.log('bezier out of rough bb') - return false; - } else { - // console.log('do more expensive check'); - return true; - } -}; -math.solveQuadratic = function (a, b, c, val) { - c -= val; - - var r = b * b - 4 * a * c; - - if (r < 0) { - return []; - } - - var sqrtR = Math.sqrt(r); - var denom = 2 * a; - var root1 = (-b + sqrtR) / denom; - var root2 = (-b - sqrtR) / denom; - - return [root1, root2]; -}; - -math.solveCubic = function (a, b, c, d, result) { - - // Solves a cubic function, returns root in form [r1, i1, r2, i2, r3, i3], where - // r is the real component, i is the imaginary component - - // An implementation of the Cardano method from the year 1545 - // http://en.wikipedia.org/wiki/Cubic_function#The_nature_of_the_roots - - b /= a; - c /= a; - d /= a; - - var discriminant = void 0, - q = void 0, - r = void 0, - dum1 = void 0, - s = void 0, - t = void 0, - term1 = void 0, - r13 = void 0; - - q = (3.0 * c - b * b) / 9.0; - r = -(27.0 * d) + b * (9.0 * c - 2.0 * (b * b)); - r /= 54.0; - - discriminant = q * q * q + r * r; - result[1] = 0; - term1 = b / 3.0; - - if (discriminant > 0) { - s = r + Math.sqrt(discriminant); - s = s < 0 ? -Math.pow(-s, 1.0 / 3.0) : Math.pow(s, 1.0 / 3.0); - t = r - Math.sqrt(discriminant); - t = t < 0 ? -Math.pow(-t, 1.0 / 3.0) : Math.pow(t, 1.0 / 3.0); - result[0] = -term1 + s + t; - term1 += (s + t) / 2.0; - result[4] = result[2] = -term1; - term1 = Math.sqrt(3.0) * (-t + s) / 2; - result[3] = term1; - result[5] = -term1; - return; - } - - result[5] = result[3] = 0; - - if (discriminant === 0) { - r13 = r < 0 ? -Math.pow(-r, 1.0 / 3.0) : Math.pow(r, 1.0 / 3.0); - result[0] = -term1 + 2.0 * r13; - result[4] = result[2] = -(r13 + term1); - return; - } - - q = -q; - dum1 = q * q * q; - dum1 = Math.acos(r / Math.sqrt(dum1)); - r13 = 2.0 * Math.sqrt(q); - result[0] = -term1 + r13 * Math.cos(dum1 / 3.0); - result[2] = -term1 + r13 * Math.cos((dum1 + 2.0 * Math.PI) / 3.0); - result[4] = -term1 + r13 * Math.cos((dum1 + 4.0 * Math.PI) / 3.0); - - return; -}; - -math.sqdistToQuadraticBezier = function (x, y, x1, y1, x2, y2, x3, y3) { - - // Find minimum distance by using the minimum of the distance - // function between the given point and the curve - - // This gives the coefficients of the resulting cubic equation - // whose roots tell us where a possible minimum is - // (Coefficients are divided by 4) - - var a = 1.0 * x1 * x1 - 4 * x1 * x2 + 2 * x1 * x3 + 4 * x2 * x2 - 4 * x2 * x3 + x3 * x3 + y1 * y1 - 4 * y1 * y2 + 2 * y1 * y3 + 4 * y2 * y2 - 4 * y2 * y3 + y3 * y3; - - var b = 1.0 * 9 * x1 * x2 - 3 * x1 * x1 - 3 * x1 * x3 - 6 * x2 * x2 + 3 * x2 * x3 + 9 * y1 * y2 - 3 * y1 * y1 - 3 * y1 * y3 - 6 * y2 * y2 + 3 * y2 * y3; - - var c = 1.0 * 3 * x1 * x1 - 6 * x1 * x2 + x1 * x3 - x1 * x + 2 * x2 * x2 + 2 * x2 * x - x3 * x + 3 * y1 * y1 - 6 * y1 * y2 + y1 * y3 - y1 * y + 2 * y2 * y2 + 2 * y2 * y - y3 * y; - - var d = 1.0 * x1 * x2 - x1 * x1 + x1 * x - x2 * x + y1 * y2 - y1 * y1 + y1 * y - y2 * y; - - // debug("coefficients: " + a / a + ", " + b / a + ", " + c / a + ", " + d / a); - - var roots = []; - - // Use the cubic solving algorithm - this.solveCubic(a, b, c, d, roots); - - var zeroThreshold = 0.0000001; - - var params = []; - - for (var index = 0; index < 6; index += 2) { - if (Math.abs(roots[index + 1]) < zeroThreshold && roots[index] >= 0 && roots[index] <= 1.0) { - params.push(roots[index]); - } - } - - params.push(1.0); - params.push(0.0); - - var minDistanceSquared = -1; - - var curX = void 0, - curY = void 0, - distSquared = void 0; - for (var i = 0; i < params.length; i++) { - curX = Math.pow(1.0 - params[i], 2.0) * x1 + 2.0 * (1 - params[i]) * params[i] * x2 + params[i] * params[i] * x3; - - curY = Math.pow(1 - params[i], 2.0) * y1 + 2 * (1.0 - params[i]) * params[i] * y2 + params[i] * params[i] * y3; - - distSquared = Math.pow(curX - x, 2) + Math.pow(curY - y, 2); - // debug('distance for param ' + params[i] + ": " + Math.sqrt(distSquared)); - if (minDistanceSquared >= 0) { - if (distSquared < minDistanceSquared) { - minDistanceSquared = distSquared; - } - } else { - minDistanceSquared = distSquared; - } - } - - return minDistanceSquared; -}; - -math.sqdistToFiniteLine = function (x, y, x1, y1, x2, y2) { - var offset = [x - x1, y - y1]; - var line = [x2 - x1, y2 - y1]; - - var lineSq = line[0] * line[0] + line[1] * line[1]; - var hypSq = offset[0] * offset[0] + offset[1] * offset[1]; - - var dotProduct = offset[0] * line[0] + offset[1] * line[1]; - var adjSq = dotProduct * dotProduct / lineSq; - - if (dotProduct < 0) { - return hypSq; - } - - if (adjSq > lineSq) { - return (x - x2) * (x - x2) + (y - y2) * (y - y2); - } - - return hypSq - adjSq; -}; - -math.pointInsidePolygonPoints = function (x, y, points) { - var x1 = void 0, - y1 = void 0, - x2 = void 0, - y2 = void 0; - var y3 = void 0; - - // Intersect with vertical line through (x, y) - var up = 0; - // let down = 0; - for (var i = 0; i < points.length / 2; i++) { - x1 = points[i * 2]; - y1 = points[i * 2 + 1]; - - if (i + 1 < points.length / 2) { - x2 = points[(i + 1) * 2]; - y2 = points[(i + 1) * 2 + 1]; - } else { - x2 = points[(i + 1 - points.length / 2) * 2]; - y2 = points[(i + 1 - points.length / 2) * 2 + 1]; - } - - if (x1 == x && x2 == x) { - // then ignore - } else if (x1 >= x && x >= x2 || x1 <= x && x <= x2) { - - y3 = (x - x1) / (x2 - x1) * (y2 - y1) + y1; - - if (y3 > y) { - up++; - } - - // if( y3 < y ){ - // down++; - // } - } else { - continue; - } - } - - if (up % 2 === 0) { - return false; - } else { - return true; - } -}; - -math.pointInsidePolygon = function (x, y, basePoints, centerX, centerY, width, height, direction, padding) { - - //let direction = arguments[6]; - var transformedPoints = new Array(basePoints.length); - - // Gives negative angle - var angle = void 0; - - if (direction[0] != null) { - angle = Math.atan(direction[1] / direction[0]); - - if (direction[0] < 0) { - angle = angle + Math.PI / 2; - } else { - angle = -angle - Math.PI / 2; - } - } else { - angle = direction; - } - - var cos = Math.cos(-angle); - var sin = Math.sin(-angle); - - // console.log("base: " + basePoints); - for (var i = 0; i < transformedPoints.length / 2; i++) { - transformedPoints[i * 2] = width / 2 * (basePoints[i * 2] * cos - basePoints[i * 2 + 1] * sin); - - transformedPoints[i * 2 + 1] = height / 2 * (basePoints[i * 2 + 1] * cos + basePoints[i * 2] * sin); - - transformedPoints[i * 2] += centerX; - transformedPoints[i * 2 + 1] += centerY; - } - - var points = void 0; - - if (padding > 0) { - var expandedLineSet = this.expandPolygon(transformedPoints, -padding); - - points = this.joinLines(expandedLineSet); - } else { - points = transformedPoints; - } - - return math.pointInsidePolygonPoints(x, y, points); -}; - -math.joinLines = function (lineSet) { - - var vertices = new Array(lineSet.length / 2); - - var currentLineStartX = void 0, - currentLineStartY = void 0, - currentLineEndX = void 0, - currentLineEndY = void 0; - var nextLineStartX = void 0, - nextLineStartY = void 0, - nextLineEndX = void 0, - nextLineEndY = void 0; - - for (var i = 0; i < lineSet.length / 4; i++) { - currentLineStartX = lineSet[i * 4]; - currentLineStartY = lineSet[i * 4 + 1]; - currentLineEndX = lineSet[i * 4 + 2]; - currentLineEndY = lineSet[i * 4 + 3]; - - if (i < lineSet.length / 4 - 1) { - nextLineStartX = lineSet[(i + 1) * 4]; - nextLineStartY = lineSet[(i + 1) * 4 + 1]; - nextLineEndX = lineSet[(i + 1) * 4 + 2]; - nextLineEndY = lineSet[(i + 1) * 4 + 3]; - } else { - nextLineStartX = lineSet[0]; - nextLineStartY = lineSet[1]; - nextLineEndX = lineSet[2]; - nextLineEndY = lineSet[3]; - } - - var intersection = this.finiteLinesIntersect(currentLineStartX, currentLineStartY, currentLineEndX, currentLineEndY, nextLineStartX, nextLineStartY, nextLineEndX, nextLineEndY, true); - - vertices[i * 2] = intersection[0]; - vertices[i * 2 + 1] = intersection[1]; - } - - return vertices; -}; - -math.expandPolygon = function (points, pad) { - - var expandedLineSet = new Array(points.length * 2); - - var currentPointX = void 0, - currentPointY = void 0, - nextPointX = void 0, - nextPointY = void 0; - - for (var i = 0; i < points.length / 2; i++) { - currentPointX = points[i * 2]; - currentPointY = points[i * 2 + 1]; - - if (i < points.length / 2 - 1) { - nextPointX = points[(i + 1) * 2]; - nextPointY = points[(i + 1) * 2 + 1]; - } else { - nextPointX = points[0]; - nextPointY = points[1]; - } - - // Current line: [currentPointX, currentPointY] to [nextPointX, nextPointY] - - // Assume CCW polygon winding - - var offsetX = nextPointY - currentPointY; - var offsetY = -(nextPointX - currentPointX); - - // Normalize - var offsetLength = Math.sqrt(offsetX * offsetX + offsetY * offsetY); - var normalizedOffsetX = offsetX / offsetLength; - var normalizedOffsetY = offsetY / offsetLength; - - expandedLineSet[i * 4] = currentPointX + normalizedOffsetX * pad; - expandedLineSet[i * 4 + 1] = currentPointY + normalizedOffsetY * pad; - expandedLineSet[i * 4 + 2] = nextPointX + normalizedOffsetX * pad; - expandedLineSet[i * 4 + 3] = nextPointY + normalizedOffsetY * pad; - } - - return expandedLineSet; -}; - -math.intersectLineEllipse = function (x, y, centerX, centerY, ellipseWradius, ellipseHradius) { - - var dispX = centerX - x; - var dispY = centerY - y; - - dispX /= ellipseWradius; - dispY /= ellipseHradius; - - var len = Math.sqrt(dispX * dispX + dispY * dispY); - - var newLength = len - 1; - - if (newLength < 0) { - return []; - } - - var lenProportion = newLength / len; - - return [(centerX - x) * lenProportion + x, (centerY - y) * lenProportion + y]; -}; - -math.checkInEllipse = function (x, y, width, height, centerX, centerY, padding) { - x -= centerX; - y -= centerY; - - x /= width / 2 + padding; - y /= height / 2 + padding; - - return x * x + y * y <= 1; -}; - -// Returns intersections of increasing distance from line's start point -math.intersectLineCircle = function (x1, y1, x2, y2, centerX, centerY, radius) { - - // Calculate d, direction vector of line - var d = [x2 - x1, y2 - y1]; // Direction vector of line - var f = [x1 - centerX, y1 - centerY]; - - var a = d[0] * d[0] + d[1] * d[1]; - var b = 2 * (f[0] * d[0] + f[1] * d[1]); - var c = f[0] * f[0] + f[1] * f[1] - radius * radius; - - var discriminant = b * b - 4 * a * c; - - if (discriminant < 0) { - return []; - } - - var t1 = (-b + Math.sqrt(discriminant)) / (2 * a); - var t2 = (-b - Math.sqrt(discriminant)) / (2 * a); - - var tMin = Math.min(t1, t2); - var tMax = Math.max(t1, t2); - var inRangeParams = []; - - if (tMin >= 0 && tMin <= 1) { - inRangeParams.push(tMin); - } - - if (tMax >= 0 && tMax <= 1) { - inRangeParams.push(tMax); - } - - if (inRangeParams.length === 0) { - return []; - } - - var nearIntersectionX = inRangeParams[0] * d[0] + x1; - var nearIntersectionY = inRangeParams[0] * d[1] + y1; - - if (inRangeParams.length > 1) { - - if (inRangeParams[0] == inRangeParams[1]) { - return [nearIntersectionX, nearIntersectionY]; - } else { - - var farIntersectionX = inRangeParams[1] * d[0] + x1; - var farIntersectionY = inRangeParams[1] * d[1] + y1; - - return [nearIntersectionX, nearIntersectionY, farIntersectionX, farIntersectionY]; - } - } else { - return [nearIntersectionX, nearIntersectionY]; - } -}; - -math.findCircleNearPoint = function (centerX, centerY, radius, farX, farY) { - - var displacementX = farX - centerX; - var displacementY = farY - centerY; - var distance = Math.sqrt(displacementX * displacementX + displacementY * displacementY); - - var unitDisplacementX = displacementX / distance; - var unitDisplacementY = displacementY / distance; - - return [centerX + unitDisplacementX * radius, centerY + unitDisplacementY * radius]; -}; - -math.findMaxSqDistanceToOrigin = function (points) { - var maxSqDistance = 0.000001; - var sqDistance = void 0; - - for (var i = 0; i < points.length / 2; i++) { - - sqDistance = points[i * 2] * points[i * 2] + points[i * 2 + 1] * points[i * 2 + 1]; - - if (sqDistance > maxSqDistance) { - maxSqDistance = sqDistance; - } - } - - return maxSqDistance; -}; - -math.midOfThree = function (a, b, c) { - if (b <= a && a <= c || c <= a && a <= b) { - return a; - } else if (a <= b && b <= c || c <= b && b <= a) { - return b; - } else { - return c; - } -}; - -// (x1,y1)=>(x2,y2) intersect with (x3,y3)=>(x4,y4) -math.finiteLinesIntersect = function (x1, y1, x2, y2, x3, y3, x4, y4, infiniteLines) { - - var dx13 = x1 - x3; - var dx21 = x2 - x1; - var dx43 = x4 - x3; - - var dy13 = y1 - y3; - var dy21 = y2 - y1; - var dy43 = y4 - y3; - - var ua_t = dx43 * dy13 - dy43 * dx13; - var ub_t = dx21 * dy13 - dy21 * dx13; - var u_b = dy43 * dx21 - dx43 * dy21; - - if (u_b !== 0) { - var ua = ua_t / u_b; - var ub = ub_t / u_b; - - var flptThreshold = 0.001; - var min = 0 - flptThreshold; - var max = 1 + flptThreshold; - - if (min <= ua && ua <= max && min <= ub && ub <= max) { - return [x1 + ua * dx21, y1 + ua * dy21]; - } else { - if (!infiniteLines) { - return []; - } else { - return [x1 + ua * dx21, y1 + ua * dy21]; - } - } - } else { - if (ua_t === 0 || ub_t === 0) { - - // Parallel, coincident lines. Check if overlap - - // Check endpoint of second line - if (this.midOfThree(x1, x2, x4) === x4) { - return [x4, y4]; - } - - // Check start point of second line - if (this.midOfThree(x1, x2, x3) === x3) { - return [x3, y3]; - } - - // Endpoint of first line - if (this.midOfThree(x3, x4, x2) === x2) { - return [x2, y2]; - } - - return []; - } else { - - // Parallel, non-coincident - return []; - } - } -}; - -// math.polygonIntersectLine( x, y, basePoints, centerX, centerY, width, height, padding ) -// intersect a node polygon (pts transformed) -// -// math.polygonIntersectLine( x, y, basePoints, centerX, centerY ) -// intersect the points (no transform) -math.polygonIntersectLine = function (x, y, basePoints, centerX, centerY, width, height, padding) { - - var intersections = []; - var intersection = void 0; - - var transformedPoints = new Array(basePoints.length); - - var doTransform = true; - if (arguments.length === 5) { - doTransform = false; - } - - var points = void 0; - - if (doTransform) { - for (var i = 0; i < transformedPoints.length / 2; i++) { - transformedPoints[i * 2] = basePoints[i * 2] * width + centerX; - transformedPoints[i * 2 + 1] = basePoints[i * 2 + 1] * height + centerY; - } - - if (padding > 0) { - var expandedLineSet = math.expandPolygon(transformedPoints, -padding); - - points = math.joinLines(expandedLineSet); - } else { - points = transformedPoints; - } - } else { - points = basePoints; - } - - var currentX = void 0, - currentY = void 0, - nextX = void 0, - nextY = void 0; - - for (var _i = 0; _i < points.length / 2; _i++) { - - currentX = points[_i * 2]; - currentY = points[_i * 2 + 1]; - - if (_i < points.length / 2 - 1) { - nextX = points[(_i + 1) * 2]; - nextY = points[(_i + 1) * 2 + 1]; - } else { - nextX = points[0]; - nextY = points[1]; - } - - intersection = this.finiteLinesIntersect(x, y, centerX, centerY, currentX, currentY, nextX, nextY); - - if (intersection.length !== 0) { - intersections.push(intersection[0], intersection[1]); - } - } - - return intersections; -}; - -math.shortenIntersection = function (intersection, offset, amount) { - - var disp = [intersection[0] - offset[0], intersection[1] - offset[1]]; - - var length = Math.sqrt(disp[0] * disp[0] + disp[1] * disp[1]); - - var lenRatio = (length - amount) / length; - - if (lenRatio < 0) { - lenRatio = 0.00001; - } - - return [offset[0] + lenRatio * disp[0], offset[1] + lenRatio * disp[1]]; -}; - -math.generateUnitNgonPointsFitToSquare = function (sides, rotationRadians) { - var points = math.generateUnitNgonPoints(sides, rotationRadians); - points = math.fitPolygonToSquare(points); - - return points; -}; - -math.fitPolygonToSquare = function (points) { - var x = void 0, - y = void 0; - var sides = points.length / 2; - var minX = Infinity, - minY = Infinity, - maxX = -Infinity, - maxY = -Infinity; - - for (var i = 0; i < sides; i++) { - x = points[2 * i]; - y = points[2 * i + 1]; - - minX = Math.min(minX, x); - maxX = Math.max(maxX, x); - minY = Math.min(minY, y); - maxY = Math.max(maxY, y); - } - - // stretch factors - var sx = 2 / (maxX - minX); - var sy = 2 / (maxY - minY); - - for (var _i2 = 0; _i2 < sides; _i2++) { - x = points[2 * _i2] = points[2 * _i2] * sx; - y = points[2 * _i2 + 1] = points[2 * _i2 + 1] * sy; - - minX = Math.min(minX, x); - maxX = Math.max(maxX, x); - minY = Math.min(minY, y); - maxY = Math.max(maxY, y); - } - - if (minY < -1) { - for (var _i3 = 0; _i3 < sides; _i3++) { - y = points[2 * _i3 + 1] = points[2 * _i3 + 1] + (-1 - minY); - } - } - - return points; -}; - -math.generateUnitNgonPoints = function (sides, rotationRadians) { - - var increment = 1.0 / sides * 2 * Math.PI; - var startAngle = sides % 2 === 0 ? Math.PI / 2.0 + increment / 2.0 : Math.PI / 2.0; - - startAngle += rotationRadians; - - var points = new Array(sides * 2); - - var currentAngle = void 0; - for (var i = 0; i < sides; i++) { - currentAngle = i * increment + startAngle; - - points[2 * i] = Math.cos(currentAngle); // x - points[2 * i + 1] = Math.sin(-currentAngle); // y - } - - return points; -}; - -math.getRoundRectangleRadius = function (width, height) { - - // Set the default radius, unless half of width or height is smaller than default - return Math.min(width / 4, height / 4, 8); -}; - -math.getCutRectangleCornerLength = function () { - return 8; -}; - -math.bezierPtsToQuadCoeff = function (p0, p1, p2) { - return [p0 - 2 * p1 + p2, 2 * (p1 - p0), p0]; -}; - -math.getBarrelCurveConstants = function (width, height) { - // get curve width, height, and control point position offsets as a percentage of node height / width - return { - heightOffset: Math.min(15, 0.05 * height), - widthOffset: Math.min(100, 0.25 * width), - ctrlPtOffsetPct: 0.05 - }; -}; - -module.exports = math; - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = typeof window === 'undefined' ? null : window; // eslint-disable-line no-undef - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -// use this module to cherry pick functions into your prototype -// (useful for functions shared between the core and collections, for example) - -// e.g. -// let foo = define.foo({ /* params... */ }) - -var util = __webpack_require__(1); - -var define = {}; - -[__webpack_require__(44), __webpack_require__(46), __webpack_require__(47)].forEach(function (m) { - util.assign(define, m); -}); - -module.exports = define; - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -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; }; - -/*! -Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable -Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) -Licensed under The MIT License (http://opensource.org/licenses/MIT) -*/ - -/* promise states [Promises/A+ 2.1] */ -var STATE_PENDING = 0; /* [Promises/A+ 2.1.1] */ -var STATE_FULFILLED = 1; /* [Promises/A+ 2.1.2] */ -var STATE_REJECTED = 2; /* [Promises/A+ 2.1.3] */ - -/* promise object constructor */ -var api = function api(executor) { - /* optionally support non-constructor/plain-function call */ - if (!(this instanceof api)) return new api(executor); - - /* initialize object */ - this.id = 'Thenable/1.0.7'; - this.state = STATE_PENDING; /* initial state */ - this.fulfillValue = undefined; /* initial value */ /* [Promises/A+ 1.3, 2.1.2.2] */ - this.rejectReason = undefined; /* initial reason */ /* [Promises/A+ 1.5, 2.1.3.2] */ - this.onFulfilled = []; /* initial handlers */ - this.onRejected = []; /* initial handlers */ - - /* provide optional information-hiding proxy */ - this.proxy = { - then: this.then.bind(this) - }; - - /* support optional executor function */ - if (typeof executor === 'function') executor.call(this, this.fulfill.bind(this), this.reject.bind(this)); -}; - -/* promise API methods */ -api.prototype = { - /* promise resolving methods */ - fulfill: function fulfill(value) { - return deliver(this, STATE_FULFILLED, 'fulfillValue', value); - }, - reject: function reject(value) { - return deliver(this, STATE_REJECTED, 'rejectReason', value); - }, - - /* "The then Method" [Promises/A+ 1.1, 1.2, 2.2] */ - then: function then(onFulfilled, onRejected) { - var curr = this; - var next = new api(); /* [Promises/A+ 2.2.7] */ - curr.onFulfilled.push(resolver(onFulfilled, next, 'fulfill')); /* [Promises/A+ 2.2.2/2.2.6] */ - curr.onRejected.push(resolver(onRejected, next, 'reject')); /* [Promises/A+ 2.2.3/2.2.6] */ - execute(curr); - return next.proxy; /* [Promises/A+ 2.2.7, 3.3] */ - } -}; - -/* deliver an action */ -var deliver = function deliver(curr, state, name, value) { - if (curr.state === STATE_PENDING) { - curr.state = state; /* [Promises/A+ 2.1.2.1, 2.1.3.1] */ - curr[name] = value; /* [Promises/A+ 2.1.2.2, 2.1.3.2] */ - execute(curr); - } - return curr; -}; - -/* execute all handlers */ -var execute = function execute(curr) { - if (curr.state === STATE_FULFILLED) execute_handlers(curr, 'onFulfilled', curr.fulfillValue);else if (curr.state === STATE_REJECTED) execute_handlers(curr, 'onRejected', curr.rejectReason); -}; - -/* execute particular set of handlers */ -var execute_handlers = function execute_handlers(curr, name, value) { - /* global setImmediate: true */ - /* global setTimeout: true */ - - /* short-circuit processing */ - if (curr[name].length === 0) return; - - /* iterate over all handlers, exactly once */ - var handlers = curr[name]; - curr[name] = []; /* [Promises/A+ 2.2.2.3, 2.2.3.3] */ - var func = function func() { - for (var i = 0; i < handlers.length; i++) { - handlers[i](value); - } /* [Promises/A+ 2.2.5] */ - }; - - /* execute procedure asynchronously */ /* [Promises/A+ 2.2.4, 3.1] */ - if (typeof setImmediate === 'function') setImmediate(func);else setTimeout(func, 0); -}; - -/* generate a resolver function */ -var resolver = function resolver(cb, next, method) { - return function (value) { - if (typeof cb !== 'function') /* [Promises/A+ 2.2.1, 2.2.7.3, 2.2.7.4] */ - next[method].call(next, value); /* [Promises/A+ 2.2.7.3, 2.2.7.4] */ - else { - var result; - try { - result = cb(value); - } /* [Promises/A+ 2.2.2.1, 2.2.3.1, 2.2.5, 3.2] */ - catch (e) { - next.reject(e); /* [Promises/A+ 2.2.7.2] */ - return; - } - resolve(next, result); /* [Promises/A+ 2.2.7.1] */ - } - }; -}; - -/* "Promise Resolution Procedure" */ /* [Promises/A+ 2.3] */ -var resolve = function resolve(promise, x) { - /* sanity check arguments */ /* [Promises/A+ 2.3.1] */ - if (promise === x || promise.proxy === x) { - promise.reject(new TypeError('cannot resolve promise with itself')); - return; - } - - /* surgically check for a "then" method - (mainly to just call the "getter" of "then" only once) */ - var then; - if ((typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object' && x !== null || typeof x === 'function') { - try { - then = x.then; - } /* [Promises/A+ 2.3.3.1, 3.5] */ - catch (e) { - promise.reject(e); /* [Promises/A+ 2.3.3.2] */ - return; - } - } - - /* handle own Thenables [Promises/A+ 2.3.2] - and similar "thenables" [Promises/A+ 2.3.3] */ - if (typeof then === 'function') { - var resolved = false; - try { - /* call retrieved "then" method */ /* [Promises/A+ 2.3.3.3] */ - then.call(x, - /* resolvePromise */ /* [Promises/A+ 2.3.3.3.1] */ - function (y) { - if (resolved) return;resolved = true; /* [Promises/A+ 2.3.3.3.3] */ - if (y === x) /* [Promises/A+ 3.6] */ - promise.reject(new TypeError('circular thenable chain'));else resolve(promise, y); - }, - - /* rejectPromise */ /* [Promises/A+ 2.3.3.3.2] */ - function (r) { - if (resolved) return;resolved = true; /* [Promises/A+ 2.3.3.3.3] */ - promise.reject(r); - }); - } catch (e) { - if (!resolved) /* [Promises/A+ 2.3.3.3.3] */ - promise.reject(e); /* [Promises/A+ 2.3.3.3.4] */ - } - return; - } - - /* handle other values */ - promise.fulfill(x); /* [Promises/A+ 2.3.4, 2.3.3.4] */ -}; - -// so we always have Promise.all() -api.all = function (ps) { - return new api(function (resolveAll, rejectAll) { - var vals = new Array(ps.length); - var doneCount = 0; - - var fulfill = function fulfill(i, val) { - vals[i] = val; - doneCount++; - - if (doneCount === ps.length) { - resolveAll(vals); - } - }; - - for (var i = 0; i < ps.length; i++) { - (function (i) { - var p = ps[i]; - var isPromise = p != null && p.then != null; - - if (isPromise) { - p.then(function (val) { - fulfill(i, val); - }, function (err) { - rejectAll(err); - }); - } else { - var val = p; - fulfill(i, val); - } - })(i); - } - }); -}; - -api.resolve = function (val) { - return new api(function (resolve, reject) { - resolve(val); - }); -}; - -api.reject = function (val) { - return new api(function (resolve, reject) { - reject(val); - }); -}; - -module.exports = typeof Promise !== 'undefined' ? Promise : api; // eslint-disable-line no-undef - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var util = __webpack_require__(1); -var newQuery = __webpack_require__(10); - -var Selector = function Selector(selector) { - var self = this; - - self._private = { - selectorText: selector, - invalid: true - }; - - if (selector == null || is.string(selector) && selector.match(/^\s*$/)) { - - self.length = 0; - } else if (selector === '*' || selector === 'edge' || selector === 'node') { - - // make single, group-only selectors cheap to make and cheap to filter - - self[0] = newQuery(); - self[0].group = selector === '*' ? selector : selector + 's'; - self[0].groupOnly = true; - self[0].length = 1; - self._private.invalid = false; - self.length = 1; - } else if (is.elementOrCollection(selector)) { - - var collection = selector.collection(); - - self[0] = newQuery(); - self[0].collection = collection; - self[0].length = 1; - self.length = 1; - } else if (is.fn(selector)) { - - self[0] = newQuery(); - self[0].filter = selector; - self[0].length = 1; - self.length = 1; - } else if (is.string(selector)) { - if (!self.parse(selector)) { - return; - } - } else { - util.error('A selector must be created from a string; found ', selector); - return; - } - - self._private.invalid = false; -}; - -var selfn = Selector.prototype; - -selfn.valid = function () { - return !this._private.invalid; -}; - -selfn.invalid = function () { - return this._private.invalid; -}; - -selfn.text = function () { - return this._private.selectorText; -}; - -selfn.size = function () { - return this.length; -}; - -selfn.eq = function (i) { - return this[i]; -}; - -selfn.sameText = function (otherSel) { - return this.text() === otherSel.text(); -}; - -selfn.toString = selfn.selector = function () { - - if (this._private.toStringCache != null) { - return this._private.toStringCache; - } - - var i = void 0; - var str = ''; - - var clean = function clean(obj) { - if (obj == null) { - return ''; - } else { - return obj; - } - }; - - var cleanVal = function cleanVal(val) { - if (is.string(val)) { - return '"' + val + '"'; - } else { - return clean(val); - } - }; - - var space = function space(val) { - return ' ' + val + ' '; - }; - - var queryToString = function queryToString(query) { - var str = ''; - var j = void 0, - sel = void 0; - - if (query.subject === query) { - str += '$'; - } - - var group = clean(query.group); - str += group.substring(0, group.length - 1); - - for (j = 0; j < query.data.length; j++) { - var data = query.data[j]; - - if (data.value) { - str += '[' + data.field + space(clean(data.operator)) + cleanVal(data.value) + ']'; - } else { - str += '[' + clean(data.operator) + data.field + ']'; - } - } - - for (j = 0; j < query.meta.length; j++) { - var meta = query.meta[j]; - str += '[[' + meta.field + space(clean(meta.operator)) + cleanVal(meta.value) + ']]'; - } - - for (j = 0; j < query.colonSelectors.length; j++) { - sel = query.colonSelectors[i]; - str += sel; - } - - for (j = 0; j < query.ids.length; j++) { - sel = '#' + query.ids[i]; - str += sel; - } - - for (j = 0; j < query.classes.length; j++) { - sel = '.' + query.classes[j]; - str += sel; - } - - if (query.source != null && query.target != null) { - str = queryToString(query.source) + ' -> ' + queryToString(query.target); - } - - if (query.connectedNodes != null) { - var n = query.connectedNodes; - - str = queryToString(n[0]) + ' <-> ' + queryToString(n[1]); - } - - if (query.parent != null) { - str = queryToString(query.parent) + ' > ' + str; - } - - if (query.ancestor != null) { - str = queryToString(query.ancestor) + ' ' + str; - } - - if (query.child != null) { - str += ' > ' + queryToString(query.child); - } - - if (query.descendant != null) { - str += ' ' + queryToString(query.descendant); - } - - return str; - }; - - for (i = 0; i < this.length; i++) { - var query = this[i]; - - str += queryToString(query); - - if (this.length > 1 && i < this.length - 1) { - str += ', '; - } - } - - this._private.toStringCache = str; - - return str; -}; - -[__webpack_require__(50), __webpack_require__(53)].forEach(function (p) { - return util.assign(selfn, p); -}); - -module.exports = Selector; - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var is = __webpack_require__(0); -var Map = __webpack_require__(28); -var Set = __webpack_require__(8); - -var Element = __webpack_require__(14); - -// factory for generating edge ids when no id is specified for a new element -var idFactory = { - generate: function generate(cy, element, tryThisId) { - var id = tryThisId != null ? tryThisId : util.uuid(); - - while (cy.hasElementWithId(id)) { - id = util.uuid(); - } - - return id; - } -}; - -// represents a set of nodes, edges, or both together -var Collection = function Collection(cy, elements, options) { - if (cy === undefined || !is.core(cy)) { - util.error('A collection must have a reference to the core'); - return; - } - - var map = new Map(); - var createdElements = false; - - if (!elements) { - elements = []; - } else if (elements.length > 0 && is.plainObject(elements[0]) && !is.element(elements[0])) { - createdElements = true; - - // make elements from json and restore all at once later - var eles = []; - var elesIds = new Set(); - - for (var i = 0, l = elements.length; i < l; i++) { - var json = elements[i]; - - if (json.data == null) { - json.data = {}; - } - - var data = json.data; - - // make sure newly created elements have valid ids - if (data.id == null) { - data.id = idFactory.generate(cy, json); - } else if (cy.hasElementWithId(data.id) || elesIds.has(data.id)) { - continue; // can't create element if prior id already exists - } - - var ele = new Element(cy, json, false); - eles.push(ele); - elesIds.add(data.id); - } - - elements = eles; - } - - this.length = 0; - - for (var _i = 0, _l = elements.length; _i < _l; _i++) { - var element = elements[_i]; - if (element == null) { - continue; - } - - var id = element._private.data.id; - - if (options == null || options.unique && !map.has(id)) { - map.set(id, { - index: this.length, - ele: element - }); - - this[this.length] = element; - this.length++; - } - } - - this._private = { - cy: cy, - map: map - }; - - // restore the elements if we created them from json - if (createdElements) { - this.restore(); - } -}; - -// Functions -//////////////////////////////////////////////////////////////////////////////////////////////////// - -// keep the prototypes in sync (an element has the same functions as a collection) -// and use elefn and elesfn as shorthands to the prototypes -var elesfn = Element.prototype = Collection.prototype; - -elesfn.instanceString = function () { - return 'collection'; -}; - -elesfn.spawn = function (cy, eles, opts) { - if (!is.core(cy)) { - // cy is optional - opts = eles; - eles = cy; - cy = this.cy(); - } - - return new Collection(cy, eles, opts); -}; - -elesfn.spawnSelf = function () { - return this.spawn(this); -}; - -elesfn.cy = function () { - return this._private.cy; -}; - -elesfn.renderer = function () { - return this._private.cy.renderer(); -}; - -elesfn.element = function () { - return this[0]; -}; - -elesfn.collection = function () { - if (is.collection(this)) { - return this; - } else { - // an element - return new Collection(this._private.cy, [this]); - } -}; - -elesfn.unique = function () { - return new Collection(this._private.cy, this, { unique: true }); -}; - -elesfn.hasElementWithId = function (id) { - return this._private.map.has(id); -}; - -elesfn.getElementById = function (id) { - var cy = this._private.cy; - var entry = this._private.map.get(id); - - return entry ? entry.ele : new Collection(cy); // get ele or empty collection -}; - -elesfn.$id = elesfn.getElementById; - -elesfn.poolIndex = function () { - var cy = this._private.cy; - var eles = cy._private.elements; - var id = this._private.data.id; - - return eles._private.map.get(id).index; -}; - -elesfn.json = function (obj) { - var ele = this.element(); - var cy = this.cy(); - - if (ele == null && obj) { - return this; - } // can't set to no eles - - if (ele == null) { - return undefined; - } // can't get from no eles - - var p = ele._private; - - if (is.plainObject(obj)) { - // set - - cy.startBatch(); - - if (obj.data) { - ele.data(obj.data); - } - - if (obj.position) { - ele.position(obj.position); - } - - // ignore group -- immutable - - var checkSwitch = function checkSwitch(k, trueFnName, falseFnName) { - var obj_k = obj[k]; - - if (obj_k != null && obj_k !== p[k]) { - if (obj_k) { - ele[trueFnName](); - } else { - ele[falseFnName](); - } - } - }; - - checkSwitch('removed', 'remove', 'restore'); - - checkSwitch('selected', 'select', 'unselect'); - - checkSwitch('selectable', 'selectify', 'unselectify'); - - checkSwitch('locked', 'lock', 'unlock'); - - checkSwitch('grabbable', 'grabify', 'ungrabify'); - - if (obj.classes != null) { - ele.classes(obj.classes); - } - - cy.endBatch(); - - return this; - } else if (obj === undefined) { - // get - - var json = { - data: util.copy(p.data), - position: util.copy(p.position), - group: p.group, - removed: p.removed, - selected: p.selected, - selectable: p.selectable, - locked: p.locked, - grabbable: p.grabbable, - classes: null - }; - - json.classes = ''; - - var i = 0; - p.classes.forEach(function (cls) { - return json.classes += i++ === 0 ? cls : ' ' + cls; - }); - - return json; - } -}; - -elesfn.jsons = function () { - var jsons = []; - - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - var json = ele.json(); - - jsons.push(json); - } - - return jsons; -}; - -elesfn.clone = function () { - var cy = this.cy(); - var elesArr = []; - - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - var json = ele.json(); - var clone = new Element(cy, json, false); // NB no restore - - elesArr.push(clone); - } - - return new Collection(cy, elesArr); -}; -elesfn.copy = elesfn.clone; - -elesfn.restore = function (notifyRenderer) { - var self = this; - var cy = self.cy(); - var cy_p = cy._private; - - if (notifyRenderer === undefined) { - notifyRenderer = true; - } - - // create arrays of nodes and edges, since we need to - // restore the nodes first - var nodes = []; - var edges = []; - var elements = void 0; - for (var _i2 = 0, l = self.length; _i2 < l; _i2++) { - var ele = self[_i2]; - - if (!ele.removed()) { - // don't need to handle this ele - continue; - } - - // keep nodes first in the array and edges after - if (ele.isNode()) { - // put to front of array if node - nodes.push(ele); - } else { - // put to end of array if edge - edges.push(ele); - } - } - - elements = nodes.concat(edges); - - var i = void 0; - var removeFromElements = function removeFromElements() { - elements.splice(i, 1); - i--; - }; - - // now, restore each element - for (i = 0; i < elements.length; i++) { - var _ele = elements[i]; - - var _private = _ele._private; - var data = _private.data; - - // the traversal cache should start fresh when ele is added - _ele.clearTraversalCache(); - - // set id and validate - if (data.id === undefined) { - data.id = idFactory.generate(cy, _ele); - } else if (is.number(data.id)) { - data.id = '' + data.id; // now it's a string - } else if (is.emptyString(data.id) || !is.string(data.id)) { - util.error('Can not create element with invalid string ID `' + data.id + '`'); - - // can't create element if it has empty string as id or non-string id - removeFromElements(); - continue; - } else if (cy.hasElementWithId(data.id)) { - util.error('Can not create second element with ID `' + data.id + '`'); - - // can't create element if one already has that id - removeFromElements(); - continue; - } - - var id = data.id; // id is finalised, now let's keep a ref - - if (_ele.isNode()) { - // extra checks for nodes - var pos = _private.position; - - // make sure the nodes have a defined position - - if (pos.x == null) { - pos.x = 0; - } - - if (pos.y == null) { - pos.y = 0; - } - } - - if (_ele.isEdge()) { - // extra checks for edges - - var edge = _ele; - var fields = ['source', 'target']; - var fieldsLength = fields.length; - var badSourceOrTarget = false; - for (var j = 0; j < fieldsLength; j++) { - - var field = fields[j]; - var val = data[field]; - - if (is.number(val)) { - val = data[field] = '' + data[field]; // now string - } - - if (val == null || val === '') { - // can't create if source or target is not defined properly - util.error('Can not create edge `' + id + '` with unspecified ' + field); - badSourceOrTarget = true; - } else if (!cy.hasElementWithId(val)) { - // can't create edge if one of its nodes doesn't exist - util.error('Can not create edge `' + id + '` with nonexistant ' + field + ' `' + val + '`'); - badSourceOrTarget = true; - } - } - - if (badSourceOrTarget) { - removeFromElements();continue; - } // can't create this - - var src = cy.getElementById(data.source); - var tgt = cy.getElementById(data.target); - - src._private.edges.push(edge); - tgt._private.edges.push(edge); - - edge._private.source = src; - edge._private.target = tgt; - } // if is edge - - // create mock ids / indexes maps for element so it can be used like collections - _private.map = new Map(); - _private.map.set(id, { ele: _ele, index: 0 }); - - _private.removed = false; - cy.addToPool(_ele); - } // for each element - - // do compound node sanity checks - for (var _i3 = 0; _i3 < nodes.length; _i3++) { - // each node - var node = nodes[_i3]; - var _data = node._private.data; - - if (is.number(_data.parent)) { - // then automake string - _data.parent = '' + _data.parent; - } - - var parentId = _data.parent; - - var specifiedParent = parentId != null; - - if (specifiedParent) { - var parent = cy.getElementById(parentId); - - if (parent.empty()) { - // non-existant parent; just remove it - _data.parent = undefined; - } else { - var selfAsParent = false; - var ancestor = parent; - while (!ancestor.empty()) { - if (node.same(ancestor)) { - // mark self as parent and remove from data - selfAsParent = true; - _data.parent = undefined; // remove parent reference - - // exit or we loop forever - break; - } - - ancestor = ancestor.parent(); - } - - if (!selfAsParent) { - // connect with children - parent[0]._private.children.push(node); - node._private.parent = parent[0]; - - // let the core know we have a compound graph - cy_p.hasCompoundNodes = true; - } - } // else - } // if specified parent - } // for each node - - if (elements.length > 0) { - var restored = new Collection(cy, elements); - - for (var _i4 = 0; _i4 < restored.length; _i4++) { - var _ele2 = restored[_i4]; - - if (_ele2.isNode()) { - continue; - } - - // adding an edge invalidates the traversal caches for the parallel edges - _ele2.parallelEdges().clearTraversalCache(); - - // adding an edge invalidates the traversal cache for the connected nodes - _ele2.source().clearTraversalCache(); - _ele2.target().clearTraversalCache(); - } - - var toUpdateStyle = void 0; - - if (cy_p.hasCompoundNodes) { - toUpdateStyle = cy.collection().merge(restored).merge(restored.connectedNodes()).merge(restored.parent()); - } else { - toUpdateStyle = restored; - } - - toUpdateStyle.dirtyCompoundBoundsCache().updateStyle(notifyRenderer); - - if (notifyRenderer) { - restored.emitAndNotify('add'); - } else { - restored.emit('add'); - } - } - - return self; // chainability -}; - -elesfn.removed = function () { - var ele = this[0]; - return ele && ele._private.removed; -}; - -elesfn.inside = function () { - var ele = this[0]; - return ele && !ele._private.removed; -}; - -elesfn.remove = function (notifyRenderer) { - var self = this; - var removed = []; - var elesToRemove = []; - var elesToRemoveIds = {}; - var cy = self._private.cy; - - if (notifyRenderer === undefined) { - notifyRenderer = true; - } - - // add connected edges - function addConnectedEdges(node) { - var edges = node._private.edges; - for (var i = 0; i < edges.length; i++) { - add(edges[i]); - } - } - - // add descendant nodes - function addChildren(node) { - var children = node._private.children; - - for (var i = 0; i < children.length; i++) { - add(children[i]); - } - } - - function add(ele) { - var alreadyAdded = elesToRemoveIds[ele.id()]; - if (ele.removed() || alreadyAdded) { - return; - } else { - elesToRemoveIds[ele.id()] = true; - } - - if (ele.isNode()) { - elesToRemove.push(ele); // nodes are removed last - - addConnectedEdges(ele); - addChildren(ele); - } else { - elesToRemove.unshift(ele); // edges are removed first - } - } - - // make the list of elements to remove - // (may be removing more than specified due to connected edges etc) - - for (var i = 0, l = self.length; i < l; i++) { - var ele = self[i]; - - add(ele); - } - - function removeEdgeRef(node, edge) { - var connectedEdges = node._private.edges; - - util.removeFromArray(connectedEdges, edge); - - // removing an edges invalidates the traversal cache for its nodes - node.clearTraversalCache(); - } - - function removeParallelRefs(edge) { - // removing an edge invalidates the traversal caches for the parallel edges - edge.parallelEdges().clearTraversalCache(); - } - - var alteredParents = []; - alteredParents.ids = {}; - - function removeChildRef(parent, ele) { - ele = ele[0]; - parent = parent[0]; - - var children = parent._private.children; - var pid = parent.id(); - - util.removeFromArray(children, ele); - - if (!alteredParents.ids[pid]) { - alteredParents.ids[pid] = true; - alteredParents.push(parent); - } - } - - self.dirtyCompoundBoundsCache(); - - cy.removeFromPool(elesToRemove); // remove from core pool - - for (var _i5 = 0; _i5 < elesToRemove.length; _i5++) { - var _ele3 = elesToRemove[_i5]; - - // mark as removed - _ele3._private.removed = true; - - // add to list of removed elements - removed.push(_ele3); - - if (_ele3.isEdge()) { - // remove references to this edge in its connected nodes - var src = _ele3.source()[0]; - var tgt = _ele3.target()[0]; - - removeEdgeRef(src, _ele3); - removeEdgeRef(tgt, _ele3); - removeParallelRefs(_ele3); - } else { - // remove reference to parent - var parent = _ele3.parent(); - - if (parent.length !== 0) { - removeChildRef(parent, _ele3); - } - } - } - - // check to see if we have a compound graph or not - var elesStillInside = cy._private.elements; - cy._private.hasCompoundNodes = false; - for (var _i6 = 0; _i6 < elesStillInside.length; _i6++) { - var _ele4 = elesStillInside[_i6]; - - if (_ele4.isParent()) { - cy._private.hasCompoundNodes = true; - break; - } - } - - var removedElements = new Collection(this.cy(), removed); - if (removedElements.size() > 0) { - // must manually notify since trigger won't do this automatically once removed - - if (notifyRenderer) { - this.cy().notify({ - type: 'remove', - eles: removedElements - }); - } - - removedElements.emit('remove'); - } - - // the parents who were modified by the removal need their style updated - for (var _i7 = 0; _i7 < alteredParents.length; _i7++) { - var _ele5 = alteredParents[_i7]; - - if (!_ele5.removed()) { - _ele5.updateStyle(); - } - } - - return new Collection(cy, removed); -}; - -elesfn.move = function (struct) { - var cy = this._private.cy; - - if (struct.source !== undefined || struct.target !== undefined) { - var srcId = struct.source; - var tgtId = struct.target; - var srcExists = cy.hasElementWithId(srcId); - var tgtExists = cy.hasElementWithId(tgtId); - - if (srcExists || tgtExists) { - var jsons = this.jsons(); - - this.remove(); - - for (var i = 0; i < jsons.length; i++) { - var json = jsons[i]; - var ele = this[i]; - - if (json.group === 'edges') { - if (srcExists) { - json.data.source = srcId; - } - - if (tgtExists) { - json.data.target = tgtId; - } - - json.scratch = ele._private.scratch; - } - } - - return cy.add(jsons); - } - } else if (struct.parent !== undefined) { - // move node to new parent - var parentId = struct.parent; - var parentExists = parentId === null || cy.hasElementWithId(parentId); - - if (parentExists) { - var _jsons = this.jsons(); - var descs = this.descendants(); - var descsEtcJsons = descs.union(descs.union(this).connectedEdges()).jsons(); - - this.remove(); // NB: also removes descendants and their connected edges - - for (var _i8 = 0; _i8 < _jsons.length; _i8++) { - var _json = _jsons[_i8]; - var _ele6 = this[_i8]; - - if (_json.group === 'nodes') { - _json.data.parent = parentId === null ? undefined : parentId; - - _json.scratch = _ele6._private.scratch; - } - } - - return cy.add(_jsons.concat(descsEtcJsons)); - } - } - - return this; // if nothing done -}; - -[__webpack_require__(29), __webpack_require__(43), __webpack_require__(48), __webpack_require__(49), __webpack_require__(54), __webpack_require__(55), __webpack_require__(56), __webpack_require__(57), __webpack_require__(62), __webpack_require__(63), __webpack_require__(64), __webpack_require__(7), __webpack_require__(65), __webpack_require__(66), __webpack_require__(67), __webpack_require__(68), __webpack_require__(69)].forEach(function (props) { - util.extend(elesfn, props); -}); - -module.exports = Collection; - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -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 _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; }; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/* global Set */ - -var undef = true ? 'undefined' : _typeof(undefined); - -var ObjectSet = function () { - function ObjectSet(arrayOrObjectSet) { - _classCallCheck(this, ObjectSet); - - this._obj = Object.create(null); - - if (arrayOrObjectSet != null) { - var arr = void 0; - - if (arrayOrObjectSet.instanceString != null && arrayOrObjectSet.instanceString() === this.instanceString()) { - arr = arrayOrObjectSet.toArray(); - } else { - arr = arrayOrObjectSet; - } - - for (var i = 0; i < arr.length; i++) { - this.add(arr[i]); - } - } - } - - _createClass(ObjectSet, [{ - key: 'instanceString', - value: function instanceString() { - return 'set'; - } - }, { - key: 'add', - value: function add(val) { - this._obj[val] = 1; - } - }, { - key: 'delete', - value: function _delete(val) { - this._obj[val] = 0; - } - }, { - key: 'clear', - value: function clear() { - this._obj = Object.create(null); - } - }, { - key: 'has', - value: function has(val) { - return this._obj[val] === 1; - } - }, { - key: 'toArray', - value: function toArray() { - var _this = this; - - return Object.keys(this._obj).filter(function (key) { - return _this.has(key); - }); - } - }, { - key: 'forEach', - value: function forEach(callback, thisArg) { - return this.toArray().forEach(callback, thisArg); - } - }, { - key: 'size', - get: function get() { - return this.toArray().length; - } - }]); - - return ObjectSet; -}(); - -// TODO use the stdlib Set in future... -// module.exports = typeof Set !== undef ? Set : ObjectSet; - - -module.exports = ObjectSet; - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = __webpack_require__(32); - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -// storage for parsed queries -var newQuery = function newQuery() { - return { - classes: [], - colonSelectors: [], - data: [], - group: null, - ids: [], - meta: [], - - // fake selectors - collection: null, // a collection to match against - filter: null, // filter function - - // these are defined in the upward direction rather than down (e.g. child) - // because we need to go up in Selector.filter() - parent: null, // parent query obj - ancestor: null, // ancestor query obj - subject: null, // defines subject in compound query (subject query obj; points to self if subject) - - // use these only when subject has been defined - child: null, - descendant: null - }; -}; - -module.exports = newQuery; - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var is = __webpack_require__(0); -var Event = __webpack_require__(16); - -var eventRegex = /^([^.]+)(\.(?:[^.]+))?$/; // regex for matching event strings (e.g. "click.namespace") -var universalNamespace = '.*'; // matches as if no namespace specified and prevents users from unbinding accidentally - -var defaults = { - qualifierCompare: function qualifierCompare(q1, q2) { - return q1 === q2; - }, - eventMatches: function eventMatches() /*context, listener, eventObj*/{ - return true; - }, - eventFields: function eventFields() /*context*/{ - return {}; - }, - callbackContext: function callbackContext(context /*, listener, eventObj*/) { - return context; - }, - beforeEmit: function beforeEmit() /* context, listener, eventObj */{}, - afterEmit: function afterEmit() /* context, listener, eventObj */{}, - bubble: function bubble() /*context*/{ - return false; - }, - parent: function parent() /*context*/{ - return null; - }, - context: undefined -}; - -function Emitter(opts) { - util.assign(this, defaults, opts); - - this.listeners = []; - this.emitting = 0; -} - -var p = Emitter.prototype; - -var forEachEvent = function forEachEvent(self, handler, events, qualifier, callback, conf, confOverrides) { - if (is.fn(qualifier)) { - callback = qualifier; - qualifier = null; - } - - if (confOverrides) { - if (conf == null) { - conf = confOverrides; - } else { - conf = util.assign({}, conf, confOverrides); - } - } - - var eventList = events.split(/\s+/); - - for (var i = 0; i < eventList.length; i++) { - var evt = eventList[i]; - - if (is.emptyString(evt)) { - continue; - } - - var match = evt.match(eventRegex); // type[.namespace] - - if (match) { - var type = match[1]; - var namespace = match[2] ? match[2] : null; - var ret = handler(self, evt, type, namespace, qualifier, callback, conf); - - if (ret === false) { - break; - } // allow exiting early - } - } -}; - -var makeEventObj = function makeEventObj(self, obj) { - return new Event(obj.type, util.assign(obj, self.eventFields(self.context))); -}; - -var forEachEventObj = function forEachEventObj(self, handler, events) { - if (is.event(events)) { - handler(self, events); - - return; - } else if (is.plainObject(events)) { - handler(self, makeEventObj(self, events)); - - return; - } - - var eventList = events.split(/\s+/); - - for (var i = 0; i < eventList.length; i++) { - var evt = eventList[i]; - - if (is.emptyString(evt)) { - continue; - } - - var match = evt.match(eventRegex); // type[.namespace] - - if (match) { - var type = match[1]; - var namespace = match[2] ? match[2] : null; - var eventObj = makeEventObj(self, { - type: type, - namespace: namespace, - target: self.context - }); - - handler(self, eventObj); - } - } -}; - -p.on = p.addListener = function (events, qualifier, callback, conf, confOverrides) { - forEachEvent(this, function (self, event, type, namespace, qualifier, callback, conf) { - if (is.fn(callback)) { - self.listeners.push({ - event: event, // full event string - callback: callback, // callback to run - type: type, // the event type (e.g. 'click') - namespace: namespace, // the event namespace (e.g. ".foo") - qualifier: qualifier, // a restriction on whether to match this emitter - conf: conf // additional configuration - }); - } - }, events, qualifier, callback, conf, confOverrides); - - return this; -}; - -p.one = function (events, qualifier, callback, conf) { - return this.on(events, qualifier, callback, conf, { one: true }); -}; - -p.removeListener = p.off = function (events, qualifier, callback, conf) { - var _this = this; - - if (this.emitting !== 0) { - this.listeners = util.copyArray(this.listeners); - } - - var listeners = this.listeners; - - var _loop = function _loop(i) { - var listener = listeners[i]; - - forEachEvent(_this, function (self, event, type, namespace, qualifier, callback /*, conf*/) { - if (listener.type === type && (!namespace || listener.namespace === namespace) && (!qualifier || self.qualifierCompare(listener.qualifier, qualifier)) && (!callback || listener.callback === callback)) { - listeners.splice(i, 1); - - return false; - } - }, events, qualifier, callback, conf); - }; - - for (var i = listeners.length - 1; i >= 0; i--) { - _loop(i); - } - - return this; -}; - -p.emit = p.trigger = function (events, extraParams, manualCallback) { - var listeners = this.listeners; - var numListenersBeforeEmit = listeners.length; - - this.emitting++; - - if (!is.array(extraParams)) { - extraParams = [extraParams]; - } - - forEachEventObj(this, function (self, eventObj) { - if (manualCallback != null) { - listeners = [{ - event: eventObj.event, - type: eventObj.type, - namespace: eventObj.namespace, - callback: manualCallback - }]; - - numListenersBeforeEmit = listeners.length; - } - - var _loop2 = function _loop2(i) { - var listener = listeners[i]; - - if (listener.type === eventObj.type && (!listener.namespace || listener.namespace === eventObj.namespace || listener.namespace === universalNamespace) && self.eventMatches(self.context, listener, eventObj)) { - var args = [eventObj]; - - if (extraParams != null) { - util.push(args, extraParams); - } - - self.beforeEmit(self.context, listener, eventObj); - - if (listener.conf && listener.conf.one) { - self.listeners = self.listeners.filter(function (l) { - return l !== listener; - }); - } - - var context = self.callbackContext(self.context, listener, eventObj); - var ret = listener.callback.apply(context, args); - - self.afterEmit(self.context, listener, eventObj); - - if (ret === false) { - eventObj.stopPropagation(); - eventObj.preventDefault(); - } - } // if listener matches - }; - - for (var i = 0; i < numListenersBeforeEmit; i++) { - _loop2(i); - } // for listener - - if (self.bubble(self.context) && !eventObj.isPropagationStopped()) { - self.parent(self.context).emit(eventObj, extraParams); - } - }, events); - - this.emitting--; - - return this; -}; - -module.exports = Emitter; - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var window = __webpack_require__(3); -var util = __webpack_require__(1); -var Collection = __webpack_require__(7); -var is = __webpack_require__(0); -var Promise = __webpack_require__(5); -var define = __webpack_require__(4); - -var Core = function Core(opts) { - var cy = this; - - opts = util.extend({}, opts); - - var container = opts.container; - - // allow for passing a wrapped jquery object - // e.g. cytoscape({ container: $('#cy') }) - if (container && !is.htmlElement(container) && is.htmlElement(container[0])) { - container = container[0]; - } - - var reg = container ? container._cyreg : null; // e.g. already registered some info (e.g. readies) via jquery - reg = reg || {}; - - if (reg && reg.cy) { - reg.cy.destroy(); - - reg = {}; // old instance => replace reg completely - } - - var readies = reg.readies = reg.readies || []; - - if (container) { - container._cyreg = reg; - } // make sure container assoc'd reg points to this cy - reg.cy = cy; - - var head = window !== undefined && container !== undefined && !opts.headless; - var options = opts; - options.layout = util.extend({ name: head ? 'grid' : 'null' }, options.layout); - options.renderer = util.extend({ name: head ? 'canvas' : 'null' }, options.renderer); - - var defVal = function defVal(def, val, altVal) { - if (val !== undefined) { - return val; - } else if (altVal !== undefined) { - return altVal; - } else { - return def; - } - }; - - var _p = this._private = { - container: container, // html dom ele container - ready: false, // whether ready has been triggered - options: options, // cached options - elements: new Collection(this), // elements in the graph - listeners: [], // list of listeners - aniEles: new Collection(this), // elements being animated - scratch: {}, // scratch object for core - layout: null, - renderer: null, - destroyed: false, // whether destroy was called - notificationsEnabled: true, // whether notifications are sent to the renderer - minZoom: 1e-50, - maxZoom: 1e50, - zoomingEnabled: defVal(true, options.zoomingEnabled), - userZoomingEnabled: defVal(true, options.userZoomingEnabled), - panningEnabled: defVal(true, options.panningEnabled), - userPanningEnabled: defVal(true, options.userPanningEnabled), - boxSelectionEnabled: defVal(true, options.boxSelectionEnabled), - autolock: defVal(false, options.autolock, options.autolockNodes), - autoungrabify: defVal(false, options.autoungrabify, options.autoungrabifyNodes), - autounselectify: defVal(false, options.autounselectify), - styleEnabled: options.styleEnabled === undefined ? head : options.styleEnabled, - zoom: is.number(options.zoom) ? options.zoom : 1, - pan: { - x: is.plainObject(options.pan) && is.number(options.pan.x) ? options.pan.x : 0, - y: is.plainObject(options.pan) && is.number(options.pan.y) ? options.pan.y : 0 - }, - animation: { // object for currently-running animations - current: [], - queue: [] - }, - hasCompoundNodes: false - }; - - this.createEmitter(); - - // set selection type - var selType = options.selectionType; - if (selType === undefined || selType !== 'additive' && selType !== 'single') { - // then set default - - _p.selectionType = 'single'; - } else { - _p.selectionType = selType; - } - - // init zoom bounds - if (is.number(options.minZoom) && is.number(options.maxZoom) && options.minZoom < options.maxZoom) { - _p.minZoom = options.minZoom; - _p.maxZoom = options.maxZoom; - } else if (is.number(options.minZoom) && options.maxZoom === undefined) { - _p.minZoom = options.minZoom; - } else if (is.number(options.maxZoom) && options.minZoom === undefined) { - _p.maxZoom = options.maxZoom; - } - - var loadExtData = function loadExtData(extData, next) { - var anyIsPromise = extData.some(is.promise); - - if (anyIsPromise) { - return Promise.all(extData).then(next); // load all data asynchronously, then exec rest of init - } else { - next(extData); // exec synchronously for convenience - } - }; - - // start with the default stylesheet so we have something before loading an external stylesheet - if (_p.styleEnabled) { - cy.setStyle([]); - } - - // create the renderer - cy.initRenderer(util.extend({ - hideEdgesOnViewport: options.hideEdgesOnViewport, - textureOnViewport: options.textureOnViewport, - wheelSensitivity: is.number(options.wheelSensitivity) && options.wheelSensitivity > 0 ? options.wheelSensitivity : 1, - motionBlur: options.motionBlur === undefined ? false : options.motionBlur, // off by default - motionBlurOpacity: options.motionBlurOpacity === undefined ? 0.05 : options.motionBlurOpacity, - pixelRatio: is.number(options.pixelRatio) && options.pixelRatio > 0 ? options.pixelRatio : undefined, - desktopTapThreshold: options.desktopTapThreshold === undefined ? 4 : options.desktopTapThreshold, - touchTapThreshold: options.touchTapThreshold === undefined ? 8 : options.touchTapThreshold - }, options.renderer)); - - var setElesAndLayout = function setElesAndLayout(elements, onload, ondone) { - cy.notifications(false); - - // remove old elements - var oldEles = cy.mutableElements(); - if (oldEles.length > 0) { - oldEles.remove(); - } - - if (elements != null) { - if (is.plainObject(elements) || is.array(elements)) { - cy.add(elements); - } - } - - cy.one('layoutready', function (e) { - cy.notifications(true); - cy.emit(e); // we missed this event by turning notifications off, so pass it on - - cy.notify({ - type: 'load', - eles: cy.mutableElements() - }); - - cy.one('load', onload); - cy.emit('load'); - }).one('layoutstop', function () { - cy.one('done', ondone); - cy.emit('done'); - }); - - var layoutOpts = util.extend({}, cy._private.options.layout); - layoutOpts.eles = cy.elements(); - - cy.layout(layoutOpts).run(); - }; - - loadExtData([options.style, options.elements], function (thens) { - var initStyle = thens[0]; - var initEles = thens[1]; - - // init style - if (_p.styleEnabled) { - cy.style().append(initStyle); - } - - // initial load - setElesAndLayout(initEles, function () { - // onready - cy.startAnimationLoop(); - _p.ready = true; - - // if a ready callback is specified as an option, the bind it - if (is.fn(options.ready)) { - cy.on('ready', options.ready); - } - - // bind all the ready handlers registered before creating this instance - for (var i = 0; i < readies.length; i++) { - var fn = readies[i]; - cy.on('ready', fn); - } - if (reg) { - reg.readies = []; - } // clear b/c we've bound them all and don't want to keep it around in case a new core uses the same div etc - - cy.emit('ready'); - }, options.done); - }); -}; - -var corefn = Core.prototype; // short alias - -util.extend(corefn, { - instanceString: function instanceString() { - return 'core'; - }, - - isReady: function isReady() { - return this._private.ready; - }, - - isDestroyed: function isDestroyed() { - return this._private.destroyed; - }, - - ready: function ready(fn) { - if (this.isReady()) { - this.emitter().emit('ready', [], fn); // just calls fn as though triggered via ready event - } else { - this.on('ready', fn); - } - - return this; - }, - - destroy: function destroy() { - var cy = this; - if (cy.isDestroyed()) return; - - cy.stopAnimationLoop(); - - cy.destroyRenderer(); - - this.emit('destroy'); - - cy._private.destroyed = true; - - return cy; - }, - - hasElementWithId: function hasElementWithId(id) { - return this._private.elements.hasElementWithId(id); - }, - - getElementById: function getElementById(id) { - return this._private.elements.getElementById(id); - }, - - selectionType: function selectionType() { - return this._private.selectionType; - }, - - hasCompoundNodes: function hasCompoundNodes() { - return this._private.hasCompoundNodes; - }, - - headless: function headless() { - return this._private.options.renderer.name === 'null'; - }, - - styleEnabled: function styleEnabled() { - return this._private.styleEnabled; - }, - - addToPool: function addToPool(eles) { - this._private.elements.merge(eles); - - return this; // chaining - }, - - removeFromPool: function removeFromPool(eles) { - this._private.elements.unmerge(eles); - - return this; - }, - - container: function container() { - return this._private.container; - }, - - options: function options() { - return util.copy(this._private.options); - }, - - json: function json(obj) { - var cy = this; - var _p = cy._private; - var eles = cy.mutableElements(); - - if (is.plainObject(obj)) { - // set - - cy.startBatch(); - - if (obj.elements) { - var idInJson = {}; - - var updateEles = function updateEles(jsons, gr) { - for (var i = 0; i < jsons.length; i++) { - var json = jsons[i]; - var id = json.data.id; - var ele = cy.getElementById(id); - - idInJson[id] = true; - - if (ele.length !== 0) { - // existing element should be updated - ele.json(json); - } else { - // otherwise should be added - if (gr) { - cy.add(util.extend({ group: gr }, json)); - } else { - cy.add(json); - } - } - } - }; - - if (is.array(obj.elements)) { - // elements: [] - updateEles(obj.elements); - } else { - // elements: { nodes: [], edges: [] } - var grs = ['nodes', 'edges']; - for (var i = 0; i < grs.length; i++) { - var gr = grs[i]; - var elements = obj.elements[gr]; - - if (is.array(elements)) { - updateEles(elements, gr); - } - } - } - - // elements not specified in json should be removed - eles.stdFilter(function (ele) { - return !idInJson[ele.id()]; - }).remove(); - } - - if (obj.style) { - cy.style(obj.style); - } - - if (obj.zoom != null && obj.zoom !== _p.zoom) { - cy.zoom(obj.zoom); - } - - if (obj.pan) { - if (obj.pan.x !== _p.pan.x || obj.pan.y !== _p.pan.y) { - cy.pan(obj.pan); - } - } - - var fields = ['minZoom', 'maxZoom', 'zoomingEnabled', 'userZoomingEnabled', 'panningEnabled', 'userPanningEnabled', 'boxSelectionEnabled', 'autolock', 'autoungrabify', 'autounselectify']; - - for (var _i = 0; _i < fields.length; _i++) { - var f = fields[_i]; - - if (obj[f] != null) { - cy[f](obj[f]); - } - } - - cy.endBatch(); - - return this; // chaining - } else if (obj === undefined) { - // get - var json = {}; - - json.elements = {}; - eles.forEach(function (ele) { - var group = ele.group(); - - if (!json.elements[group]) { - json.elements[group] = []; - } - - json.elements[group].push(ele.json()); - }); - - if (this._private.styleEnabled) { - json.style = cy.style().json(); - } - - json.zoomingEnabled = cy._private.zoomingEnabled; - json.userZoomingEnabled = cy._private.userZoomingEnabled; - json.zoom = cy._private.zoom; - json.minZoom = cy._private.minZoom; - json.maxZoom = cy._private.maxZoom; - json.panningEnabled = cy._private.panningEnabled; - json.userPanningEnabled = cy._private.userPanningEnabled; - json.pan = util.copy(cy._private.pan); - json.boxSelectionEnabled = cy._private.boxSelectionEnabled; - json.renderer = util.copy(cy._private.options.renderer); - json.hideEdgesOnViewport = cy._private.options.hideEdgesOnViewport; - json.textureOnViewport = cy._private.options.textureOnViewport; - json.wheelSensitivity = cy._private.options.wheelSensitivity; - json.motionBlur = cy._private.options.motionBlur; - - return json; - } - }, - - scratch: define.data({ - field: 'scratch', - bindingEvent: 'scratch', - allowBinding: true, - allowSetting: true, - settingEvent: 'scratch', - settingTriggersEvent: true, - triggerFnName: 'trigger', - allowGetting: true - }), - - removeScratch: define.removeData({ - field: 'scratch', - event: 'scratch', - triggerFnName: 'trigger', - triggerEvent: true - }) - -}); - -corefn.$id = corefn.getElementById; - -[__webpack_require__(70), __webpack_require__(71), __webpack_require__(79), __webpack_require__(80), __webpack_require__(81), __webpack_require__(82), __webpack_require__(83), __webpack_require__(84), __webpack_require__(85), __webpack_require__(94)].forEach(function (props) { - util.extend(corefn, props); -}); - -module.exports = Core; - -/***/ }), -/* 13 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = function memoize(fn, keyFn) { - if (!keyFn) { - keyFn = function keyFn() { - if (arguments.length === 1) { - return arguments[0]; - } else if (arguments.length === 0) { - return 'undefined'; - } - - var args = []; - - for (var i = 0; i < arguments.length; i++) { - args.push(arguments[i]); - } - - return args.join('$'); - }; - } - - var memoizedFn = function memoizedFn() { - var self = this; - var args = arguments; - var ret = void 0; - var k = keyFn.apply(self, args); - var cache = memoizedFn.cache; - - if (!(ret = cache[k])) { - ret = cache[k] = fn.apply(self, args); - } - - return ret; - }; - - memoizedFn.cache = {}; - - return memoizedFn; -}; - -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var is = __webpack_require__(0); -var Set = __webpack_require__(8); - -// represents a node or an edge -var Element = function Element(cy, params, restore) { - restore = restore === undefined || restore ? true : false; - - if (cy === undefined || params === undefined || !is.core(cy)) { - util.error('An element must have a core reference and parameters set'); - return; - } - - var group = params.group; - - // try to automatically infer the group if unspecified - if (group == null) { - if (params.data && params.data.source != null && params.data.target != null) { - group = 'edges'; - } else { - group = 'nodes'; - } - } - - // validate group - if (group !== 'nodes' && group !== 'edges') { - util.error('An element must be of type `nodes` or `edges`; you specified `' + group + '`'); - return; - } - - // make the element array-like, just like a collection - this.length = 1; - this[0] = this; - - // NOTE: when something is added here, add also to ele.json() - var _p = this._private = { - cy: cy, - single: true, // indicates this is an element - data: params.data || {}, // data object - position: params.position || {}, // (x, y) position pair - autoWidth: undefined, // width and height of nodes calculated by the renderer when set to special 'auto' value - autoHeight: undefined, - autoPadding: undefined, - compoundBoundsClean: false, // whether the compound dimensions need to be recalculated the next time dimensions are read - listeners: [], // array of bound listeners - group: group, // string; 'nodes' or 'edges' - style: {}, // properties as set by the style - rstyle: {}, // properties for style sent from the renderer to the core - styleCxts: [], // applied style contexts from the styler - removed: true, // whether it's inside the vis; true if removed (set true here since we call restore) - selected: params.selected ? true : false, // whether it's selected - selectable: params.selectable === undefined ? true : params.selectable ? true : false, // whether it's selectable - locked: params.locked ? true : false, // whether the element is locked (cannot be moved) - grabbed: false, // whether the element is grabbed by the mouse; renderer sets this privately - grabbable: params.grabbable === undefined ? true : params.grabbable ? true : false, // whether the element can be grabbed - active: false, // whether the element is active from user interaction - classes: new Set(), // map ( className => true ) - animation: { // object for currently-running animations - current: [], - queue: [] - }, - rscratch: {}, // object in which the renderer can store information - scratch: params.scratch || {}, // scratch objects - edges: [], // array of connected edges - children: [], // array of children - parent: null, // parent ref - traversalCache: {}, // cache of output of traversal functions - backgrounding: false // whether background images are loading - }; - - // renderedPosition overrides if specified - if (params.renderedPosition) { - var rpos = params.renderedPosition; - var pan = cy.pan(); - var zoom = cy.zoom(); - - _p.position = { - x: (rpos.x - pan.x) / zoom, - y: (rpos.y - pan.y) / zoom - }; - } - - if (is.string(params.classes)) { - var classes = params.classes.split(/\s+/); - for (var i = 0, l = classes.length; i < l; i++) { - var cls = classes[i]; - if (!cls || cls === '') { - continue; - } - - _p.classes.add(cls); - } - } - - if (params.style || params.css) { - cy.style().applyBypass(this, params.style || params.css); - } - - this.createEmitter(); - - if (restore === undefined || restore) { - this.restore(); - } -}; - -module.exports = Element; - -/***/ }), -/* 15 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); - -var stateSelectors = [{ - selector: ':selected', - matches: function matches(ele) { - return ele.selected(); - } -}, { - selector: ':unselected', - matches: function matches(ele) { - return !ele.selected(); - } -}, { - selector: ':selectable', - matches: function matches(ele) { - return ele.selectable(); - } -}, { - selector: ':unselectable', - matches: function matches(ele) { - return !ele.selectable(); - } -}, { - selector: ':locked', - matches: function matches(ele) { - return ele.locked(); - } -}, { - selector: ':unlocked', - matches: function matches(ele) { - return !ele.locked(); - } -}, { - selector: ':visible', - matches: function matches(ele) { - return ele.visible(); - } -}, { - selector: ':hidden', - matches: function matches(ele) { - return !ele.visible(); - } -}, { - selector: ':transparent', - matches: function matches(ele) { - return ele.transparent(); - } -}, { - selector: ':grabbed', - matches: function matches(ele) { - return ele.grabbed(); - } -}, { - selector: ':free', - matches: function matches(ele) { - return !ele.grabbed(); - } -}, { - selector: ':removed', - matches: function matches(ele) { - return ele.removed(); - } -}, { - selector: ':inside', - matches: function matches(ele) { - return !ele.removed(); - } -}, { - selector: ':grabbable', - matches: function matches(ele) { - return ele.grabbable(); - } -}, { - selector: ':ungrabbable', - matches: function matches(ele) { - return !ele.grabbable(); - } -}, { - selector: ':animated', - matches: function matches(ele) { - return ele.animated(); - } -}, { - selector: ':unanimated', - matches: function matches(ele) { - return !ele.animated(); - } -}, { - selector: ':parent', - matches: function matches(ele) { - return ele.isParent(); - } -}, { - selector: ':childless', - matches: function matches(ele) { - return ele.isChildless(); - } -}, { - selector: ':child', - matches: function matches(ele) { - return ele.isChild(); - } -}, { - selector: ':orphan', - matches: function matches(ele) { - return ele.isOrphan(); - } -}, { - selector: ':nonorphan', - matches: function matches(ele) { - return ele.isChild(); - } -}, { - selector: ':loop', - matches: function matches(ele) { - return ele.isLoop(); - } -}, { - selector: ':simple', - matches: function matches(ele) { - return ele.isSimple(); - } -}, { - selector: ':active', - matches: function matches(ele) { - return ele.active(); - } -}, { - selector: ':inactive', - matches: function matches(ele) { - return !ele.active(); - } -}, { - selector: ':backgrounding', - matches: function matches(ele) { - return ele.backgrounding(); - } -}, { - selector: ':nonbackgrounding', - matches: function matches(ele) { - return !ele.backgrounding(); - } -}].sort(function (a, b) { - // n.b. selectors that are starting substrings of others must have the longer ones first - return util.sort.descending(a.selector, b.selector); -}); - -var stateSelectorMatches = function stateSelectorMatches(sel, ele) { - var lookup = stateSelectorMatches.lookup = stateSelectorMatches.lookup || function () { - var selToFn = {}; - var s = void 0; - - for (var i = 0; i < stateSelectors.length; i++) { - s = stateSelectors[i]; - - selToFn[s.selector] = s.matches; - } - - return selToFn; - }(); - - return lookup[sel](ele); -}; - -var stateSelectorRegex = '(' + stateSelectors.map(function (s) { - return s.selector; -}).join('|') + ')'; - -module.exports = { stateSelectors: stateSelectors, stateSelectorMatches: stateSelectorMatches, stateSelectorRegex: stateSelectorRegex }; - -/***/ }), -/* 16 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/*! -Event object based on jQuery events, MIT license - -https://jquery.org/license/ -https://tldrlegal.com/license/mit-license -https://github.com/jquery/jquery/blob/master/src/event.js -*/ - -var Event = function Event(src, props) { - this.recycle(src, props); -}; - -function returnFalse() { - return false; -} - -function returnTrue() { - return true; -} - -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -Event.prototype = { - instanceString: function instanceString() { - return 'event'; - }, - - recycle: function recycle(src, props) { - this.isImmediatePropagationStopped = this.isPropagationStopped = this.isDefaultPrevented = returnFalse; - - if (src != null && src.preventDefault) { - // Browser Event object - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented ? returnTrue : returnFalse; - } else if (src != null && src.type) { - // Plain object containing all event details - props = src; - } else { - // Event string - this.type = src; - } - - // Put explicitly provided properties onto the event object - if (props != null) { - // more efficient to manually copy fields we use - this.originalEvent = props.originalEvent; - this.type = props.type != null ? props.type : this.type; - this.cy = props.cy; - this.target = props.target; - this.position = props.position; - this.renderedPosition = props.renderedPosition; - this.namespace = props.namespace; - this.layout = props.layout; - } - - if (this.cy != null && this.position != null && this.renderedPosition == null) { - // create a rendered position based on the passed position - var pos = this.position; - var zoom = this.cy.zoom(); - var pan = this.cy.pan(); - - this.renderedPosition = { - x: pos.x * zoom + pan.x, - y: pos.y * zoom + pan.y - }; - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || Date.now(); - }, - - preventDefault: function preventDefault() { - this.isDefaultPrevented = returnTrue; - - var e = this.originalEvent; - if (!e) { - return; - } - - // if preventDefault exists run it on the original event - if (e.preventDefault) { - e.preventDefault(); - } - }, - - stopPropagation: function stopPropagation() { - this.isPropagationStopped = returnTrue; - - var e = this.originalEvent; - if (!e) { - return; - } - - // if stopPropagation exists run it on the original event - if (e.stopPropagation) { - e.stopPropagation(); - } - }, - - stopImmediatePropagation: function stopImmediatePropagation() { - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - }, - - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse -}; - -module.exports = Event; - -/***/ }), -/* 17 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Elements are drawn in a specific order based on compound depth (low to high), the element type (nodes above edges), - * and z-index (low to high). These styles affect how this applies: - * - * z-compound-depth: May be `bottom | orphan | auto | top`. The first drawn is `bottom`, then `orphan` which is the - * same depth as the root of the compound graph, followed by the default value `auto` which draws in order from - * root to leaves of the compound graph. The last drawn is `top`. - * z-index-compare: May be `auto | manual`. The default value is `auto` which always draws edges under nodes. - * `manual` ignores this convention and draws based on the `z-index` value setting. - * z-index: An integer value that affects the relative draw order of elements. In general, an element with a higher - * `z-index` will be drawn on top of an element with a lower `z-index`. - */ -var util = __webpack_require__(1); - -var zIndexSort = function zIndexSort(a, b) { - var cy = a.cy(); - var hasCompoundNodes = cy.hasCompoundNodes(); - - function getDepth(ele) { - var style = ele.pstyle('z-compound-depth'); - if (style.value === 'auto') { - return hasCompoundNodes ? ele.zDepth() : 0; - } else if (style.value === 'bottom') { - return -1; - } else if (style.value === 'top') { - return util.MAX_INT; - } - // 'orphan' - return 0; - } - var depthDiff = getDepth(a) - getDepth(b); - if (depthDiff !== 0) { - return depthDiff; - } - - function getEleDepth(ele) { - var style = ele.pstyle('z-index-compare'); - if (style.value === 'auto') { - return ele.isNode() ? 1 : 0; - } - // 'manual' - return 0; - } - var eleDiff = getEleDepth(a) - getEleDepth(b); - if (eleDiff !== 0) { - return eleDiff; - } - - var zDiff = a.pstyle('z-index').value - b.pstyle('z-index').value; - if (zDiff !== 0) { - return zDiff; - } - // compare indices in the core (order added to graph w/ last on top) - return a.poolIndex() - b.poolIndex(); -}; - -module.exports = zIndexSort; - -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var util = __webpack_require__(1); -var Selector = __webpack_require__(6); - -var Style = function Style(cy) { - - if (!(this instanceof Style)) { - return new Style(cy); - } - - if (!is.core(cy)) { - util.error('A style must have a core reference'); - return; - } - - this._private = { - cy: cy, - coreStyle: {} - }; - - this.length = 0; - - this.resetToDefault(); -}; - -var styfn = Style.prototype; - -styfn.instanceString = function () { - return 'style'; -}; - -// remove all contexts -styfn.clear = function () { - for (var i = 0; i < this.length; i++) { - this[i] = undefined; - } - this.length = 0; - - var _p = this._private; - - _p.newStyle = true; - - return this; // chaining -}; - -styfn.resetToDefault = function () { - this.clear(); - this.addDefaultStylesheet(); - - return this; -}; - -// builds a style object for the 'core' selector -styfn.core = function () { - return this._private.coreStyle; -}; - -// create a new context from the specified selector string and switch to that context -styfn.selector = function (selectorStr) { - // 'core' is a special case and does not need a selector - var selector = selectorStr === 'core' ? null : new Selector(selectorStr); - - var i = this.length++; // new context means new index - this[i] = { - selector: selector, - properties: [], - mappedProperties: [], - index: i - }; - - return this; // chaining -}; - -// add one or many css rules to the current context -styfn.css = function () { - var self = this; - var args = arguments; - - switch (args.length) { - case 1: - var map = args[0]; - - for (var i = 0; i < self.properties.length; i++) { - var prop = self.properties[i]; - var mapVal = map[prop.name]; - - if (mapVal === undefined) { - mapVal = map[util.dash2camel(prop.name)]; - } - - if (mapVal !== undefined) { - this.cssRule(prop.name, mapVal); - } - } - - break; - - case 2: - this.cssRule(args[0], args[1]); - break; - - default: - break; // do nothing if args are invalid - } - - return this; // chaining -}; -styfn.style = styfn.css; - -// add a single css rule to the current context -styfn.cssRule = function (name, value) { - // name-value pair - var property = this.parse(name, value); - - // add property to current context if valid - if (property) { - var i = this.length - 1; - this[i].properties.push(property); - this[i].properties[property.name] = property; // allow access by name as well - - if (property.name.match(/pie-(\d+)-background-size/) && property.value) { - this._private.hasPie = true; - } - - if (property.mapped) { - this[i].mappedProperties.push(property); - } - - // add to core style if necessary - var currentSelectorIsCore = !this[i].selector; - if (currentSelectorIsCore) { - this._private.coreStyle[property.name] = property; - } - } - - return this; // chaining -}; - -styfn.append = function (style) { - if (is.stylesheet(style)) { - style.appendToStyle(this); - } else if (is.array(style)) { - this.appendFromJson(style); - } else if (is.string(style)) { - this.appendFromString(style); - } // you probably wouldn't want to append a Style, since you'd duplicate the default parts - - return this; -}; - -// static function -Style.fromJson = function (cy, json) { - var style = new Style(cy); - - style.fromJson(json); - - return style; -}; - -Style.fromString = function (cy, string) { - return new Style(cy).fromString(string); -}; - -[__webpack_require__(86), __webpack_require__(87), __webpack_require__(88), __webpack_require__(89), __webpack_require__(90), __webpack_require__(91), __webpack_require__(92), __webpack_require__(93)].forEach(function (props) { - util.extend(styfn, props); -}); - -Style.types = styfn.types; -Style.properties = styfn.properties; - -module.exports = Style; - -/***/ }), -/* 19 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); - -var fullFpsTime = 1000 / 60; // assume 60 frames per second - -module.exports = { - setupDequeueing: function setupDequeueing(opts) { - return function setupDequeueingImpl() { - var self = this; - var r = this.renderer; - - if (self.dequeueingSetup) { - return; - } else { - self.dequeueingSetup = true; - } - - var queueRedraw = util.debounce(function () { - r.redrawHint('eles', true); - r.redrawHint('drag', true); - - r.redraw(); - }, opts.deqRedrawThreshold); - - var dequeue = function dequeue(willDraw, frameStartTime) { - var startTime = util.performanceNow(); - var avgRenderTime = r.averageRedrawTime; - var renderTime = r.lastRedrawTime; - var deqd = []; - var extent = r.cy.extent(); - var pixelRatio = r.getPixelRatio(); - - while (true) { - var now = util.performanceNow(); - var duration = now - startTime; - var frameDuration = now - frameStartTime; - - if (renderTime < fullFpsTime) { - // if we're rendering faster than the ideal fps, then do dequeueing - // during all of the remaining frame time - - var timeAvailable = fullFpsTime - (willDraw ? avgRenderTime : 0); - - if (frameDuration >= opts.deqFastCost * timeAvailable) { - break; - } - } else { - if (willDraw) { - if (duration >= opts.deqCost * renderTime || duration >= opts.deqAvgCost * avgRenderTime) { - break; - } - } else if (frameDuration >= opts.deqNoDrawCost * fullFpsTime) { - break; - } - } - - var thisDeqd = opts.deq(self, pixelRatio, extent); - - if (thisDeqd.length > 0) { - for (var i = 0; i < thisDeqd.length; i++) { - deqd.push(thisDeqd[i]); - } - } else { - break; - } - } - - // callbacks on dequeue - if (deqd.length > 0) { - opts.onDeqd(self, deqd); - - if (!willDraw && opts.shouldRedraw(self, deqd, pixelRatio, extent)) { - queueRedraw(); - } - } - }; - - var priority = opts.priority || util.noop; - - r.beforeRender(dequeue, priority(self)); - }; - } -}; - -/***/ }), -/* 20 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var Core = __webpack_require__(12); -var extension = __webpack_require__(95); -var Stylesheet = __webpack_require__(137); - -var cytoscape = function cytoscape(options) { - // jshint ignore:line - // if no options specified, use default - if (options === undefined) { - options = {}; - } - - // create instance - if (is.plainObject(options)) { - return new Core(options); - } - - // allow for registration of extensions - else if (is.string(options)) { - return extension.apply(extension, arguments); - } -}; - -// e.g. cytoscape.use( require('cytoscape-foo'), bar ) -cytoscape.use = function (ext) { - var args = Array.prototype.slice.call(arguments, 1); // args to pass to ext - - args.unshift(cytoscape); // cytoscape is first arg to ext - - ext.apply(null, args); - - return this; -}; - -// replaced by build system -cytoscape.version = __webpack_require__(138); - -// expose public apis (mostly for extensions) -cytoscape.stylesheet = cytoscape.Stylesheet = Stylesheet; - -module.exports = cytoscape; - -/***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); - -module.exports = { - // get [r, g, b] from #abc or #aabbcc - hex2tuple: function hex2tuple(hex) { - if (!(hex.length === 4 || hex.length === 7) || hex[0] !== '#') { - return; - } - - var shortHex = hex.length === 4; - var r = void 0, - g = void 0, - b = void 0; - var base = 16; - - if (shortHex) { - r = parseInt(hex[1] + hex[1], base); - g = parseInt(hex[2] + hex[2], base); - b = parseInt(hex[3] + hex[3], base); - } else { - r = parseInt(hex[1] + hex[2], base); - g = parseInt(hex[3] + hex[4], base); - b = parseInt(hex[5] + hex[6], base); - } - - return [r, g, b]; - }, - - // get [r, g, b, a] from hsl(0, 0, 0) or hsla(0, 0, 0, 0) - hsl2tuple: function hsl2tuple(hsl) { - var ret = void 0; - var h = void 0, - s = void 0, - l = void 0, - a = void 0, - r = void 0, - g = void 0, - b = void 0; - function hue2rgb(p, q, t) { - if (t < 0) t += 1; - if (t > 1) t -= 1; - if (t < 1 / 6) return p + (q - p) * 6 * t; - if (t < 1 / 2) return q; - if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6; - return p; - } - - var m = new RegExp('^' + this.regex.hsla + '$').exec(hsl); - if (m) { - - // get hue - h = parseInt(m[1]); - if (h < 0) { - h = (360 - -1 * h % 360) % 360; - } else if (h > 360) { - h = h % 360; - } - h /= 360; // normalise on [0, 1] - - s = parseFloat(m[2]); - if (s < 0 || s > 100) { - return; - } // saturation is [0, 100] - s = s / 100; // normalise on [0, 1] - - l = parseFloat(m[3]); - if (l < 0 || l > 100) { - return; - } // lightness is [0, 100] - l = l / 100; // normalise on [0, 1] - - a = m[4]; - if (a !== undefined) { - a = parseFloat(a); - - if (a < 0 || a > 1) { - return; - } // alpha is [0, 1] - } - - // now, convert to rgb - // code from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript - if (s === 0) { - r = g = b = Math.round(l * 255); // achromatic - } else { - var q = l < 0.5 ? l * (1 + s) : l + s - l * s; - var p = 2 * l - q; - r = Math.round(255 * hue2rgb(p, q, h + 1 / 3)); - g = Math.round(255 * hue2rgb(p, q, h)); - b = Math.round(255 * hue2rgb(p, q, h - 1 / 3)); - } - - ret = [r, g, b, a]; - } - - return ret; - }, - - // get [r, g, b, a] from rgb(0, 0, 0) or rgba(0, 0, 0, 0) - rgb2tuple: function rgb2tuple(rgb) { - var ret = void 0; - - var m = new RegExp('^' + this.regex.rgba + '$').exec(rgb); - if (m) { - ret = []; - - var isPct = []; - for (var i = 1; i <= 3; i++) { - var channel = m[i]; - - if (channel[channel.length - 1] === '%') { - isPct[i] = true; - } - channel = parseFloat(channel); - - if (isPct[i]) { - channel = channel / 100 * 255; // normalise to [0, 255] - } - - if (channel < 0 || channel > 255) { - return; - } // invalid channel value - - ret.push(Math.floor(channel)); - } - - var atLeastOneIsPct = isPct[1] || isPct[2] || isPct[3]; - var allArePct = isPct[1] && isPct[2] && isPct[3]; - if (atLeastOneIsPct && !allArePct) { - return; - } // must all be percent values if one is - - var alpha = m[4]; - if (alpha !== undefined) { - alpha = parseFloat(alpha); - - if (alpha < 0 || alpha > 1) { - return; - } // invalid alpha value - - ret.push(alpha); - } - } - - return ret; - }, - - colorname2tuple: function colorname2tuple(color) { - return this.colors[color.toLowerCase()]; - }, - - color2tuple: function color2tuple(color) { - return (is.array(color) ? color : null) || this.colorname2tuple(color) || this.hex2tuple(color) || this.rgb2tuple(color) || this.hsl2tuple(color); - }, - - colors: { - // special colour names - transparent: [0, 0, 0, 0], // NB alpha === 0 - - // regular colours - aliceblue: [240, 248, 255], - antiquewhite: [250, 235, 215], - aqua: [0, 255, 255], - aquamarine: [127, 255, 212], - azure: [240, 255, 255], - beige: [245, 245, 220], - bisque: [255, 228, 196], - black: [0, 0, 0], - blanchedalmond: [255, 235, 205], - blue: [0, 0, 255], - blueviolet: [138, 43, 226], - brown: [165, 42, 42], - burlywood: [222, 184, 135], - cadetblue: [95, 158, 160], - chartreuse: [127, 255, 0], - chocolate: [210, 105, 30], - coral: [255, 127, 80], - cornflowerblue: [100, 149, 237], - cornsilk: [255, 248, 220], - crimson: [220, 20, 60], - cyan: [0, 255, 255], - darkblue: [0, 0, 139], - darkcyan: [0, 139, 139], - darkgoldenrod: [184, 134, 11], - darkgray: [169, 169, 169], - darkgreen: [0, 100, 0], - darkgrey: [169, 169, 169], - darkkhaki: [189, 183, 107], - darkmagenta: [139, 0, 139], - darkolivegreen: [85, 107, 47], - darkorange: [255, 140, 0], - darkorchid: [153, 50, 204], - darkred: [139, 0, 0], - darksalmon: [233, 150, 122], - darkseagreen: [143, 188, 143], - darkslateblue: [72, 61, 139], - darkslategray: [47, 79, 79], - darkslategrey: [47, 79, 79], - darkturquoise: [0, 206, 209], - darkviolet: [148, 0, 211], - deeppink: [255, 20, 147], - deepskyblue: [0, 191, 255], - dimgray: [105, 105, 105], - dimgrey: [105, 105, 105], - dodgerblue: [30, 144, 255], - firebrick: [178, 34, 34], - floralwhite: [255, 250, 240], - forestgreen: [34, 139, 34], - fuchsia: [255, 0, 255], - gainsboro: [220, 220, 220], - ghostwhite: [248, 248, 255], - gold: [255, 215, 0], - goldenrod: [218, 165, 32], - gray: [128, 128, 128], - grey: [128, 128, 128], - green: [0, 128, 0], - greenyellow: [173, 255, 47], - honeydew: [240, 255, 240], - hotpink: [255, 105, 180], - indianred: [205, 92, 92], - indigo: [75, 0, 130], - ivory: [255, 255, 240], - khaki: [240, 230, 140], - lavender: [230, 230, 250], - lavenderblush: [255, 240, 245], - lawngreen: [124, 252, 0], - lemonchiffon: [255, 250, 205], - lightblue: [173, 216, 230], - lightcoral: [240, 128, 128], - lightcyan: [224, 255, 255], - lightgoldenrodyellow: [250, 250, 210], - lightgray: [211, 211, 211], - lightgreen: [144, 238, 144], - lightgrey: [211, 211, 211], - lightpink: [255, 182, 193], - lightsalmon: [255, 160, 122], - lightseagreen: [32, 178, 170], - lightskyblue: [135, 206, 250], - lightslategray: [119, 136, 153], - lightslategrey: [119, 136, 153], - lightsteelblue: [176, 196, 222], - lightyellow: [255, 255, 224], - lime: [0, 255, 0], - limegreen: [50, 205, 50], - linen: [250, 240, 230], - magenta: [255, 0, 255], - maroon: [128, 0, 0], - mediumaquamarine: [102, 205, 170], - mediumblue: [0, 0, 205], - mediumorchid: [186, 85, 211], - mediumpurple: [147, 112, 219], - mediumseagreen: [60, 179, 113], - mediumslateblue: [123, 104, 238], - mediumspringgreen: [0, 250, 154], - mediumturquoise: [72, 209, 204], - mediumvioletred: [199, 21, 133], - midnightblue: [25, 25, 112], - mintcream: [245, 255, 250], - mistyrose: [255, 228, 225], - moccasin: [255, 228, 181], - navajowhite: [255, 222, 173], - navy: [0, 0, 128], - oldlace: [253, 245, 230], - olive: [128, 128, 0], - olivedrab: [107, 142, 35], - orange: [255, 165, 0], - orangered: [255, 69, 0], - orchid: [218, 112, 214], - palegoldenrod: [238, 232, 170], - palegreen: [152, 251, 152], - paleturquoise: [175, 238, 238], - palevioletred: [219, 112, 147], - papayawhip: [255, 239, 213], - peachpuff: [255, 218, 185], - peru: [205, 133, 63], - pink: [255, 192, 203], - plum: [221, 160, 221], - powderblue: [176, 224, 230], - purple: [128, 0, 128], - red: [255, 0, 0], - rosybrown: [188, 143, 143], - royalblue: [65, 105, 225], - saddlebrown: [139, 69, 19], - salmon: [250, 128, 114], - sandybrown: [244, 164, 96], - seagreen: [46, 139, 87], - seashell: [255, 245, 238], - sienna: [160, 82, 45], - silver: [192, 192, 192], - skyblue: [135, 206, 235], - slateblue: [106, 90, 205], - slategray: [112, 128, 144], - slategrey: [112, 128, 144], - snow: [255, 250, 250], - springgreen: [0, 255, 127], - steelblue: [70, 130, 180], - tan: [210, 180, 140], - teal: [0, 128, 128], - thistle: [216, 191, 216], - tomato: [255, 99, 71], - turquoise: [64, 224, 208], - violet: [238, 130, 238], - wheat: [245, 222, 179], - white: [255, 255, 255], - whitesmoke: [245, 245, 245], - yellow: [255, 255, 0], - yellowgreen: [154, 205, 50] - } -}; - -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); - -module.exports = { - // has anything been set in the map - mapEmpty: function mapEmpty(map) { - var empty = true; - - if (map != null) { - return Object.keys(map).length === 0; - } - - return empty; - }, - - // pushes to the array at the end of a map (map may not be built) - pushMap: function pushMap(options) { - var array = this.getMap(options); - - if (array == null) { - // if empty, put initial array - this.setMap(this.extend({}, options, { - value: [options.value] - })); - } else { - array.push(options.value); - } - }, - - // sets the value in a map (map may not be built) - setMap: function setMap(options) { - var obj = options.map; - var key = void 0; - var keys = options.keys; - var l = keys.length; - - for (var i = 0; i < l; i++) { - var _key = keys[i]; - - if (is.plainObject(_key)) { - this.error('Tried to set map with object key'); - } - - if (i < keys.length - 1) { - - // extend the map if necessary - if (obj[_key] == null) { - obj[_key] = {}; - } - - obj = obj[_key]; - } else { - // set the value - obj[_key] = options.value; - } - } - }, - - // gets the value in a map even if it's not built in places - getMap: function getMap(options) { - var obj = options.map; - var keys = options.keys; - var l = keys.length; - - for (var i = 0; i < l; i++) { - var key = keys[i]; - - if (is.plainObject(key)) { - this.error('Tried to get map with object key'); - } - - obj = obj[key]; - - if (obj == null) { - return obj; - } - } - - return obj; - }, - - // deletes the entry in the map - deleteMap: function deleteMap(options) { - var obj = options.map; - var keys = options.keys; - var l = keys.length; - var keepChildren = options.keepChildren; - - for (var i = 0; i < l; i++) { - var key = keys[i]; - - if (is.plainObject(key)) { - this.error('Tried to delete map with object key'); - } - - var lastKey = i === options.keys.length - 1; - if (lastKey) { - - if (keepChildren) { - // then only delete child fields not in keepChildren - var children = Object.keys(obj); - - for (var j = 0; j < children.length; j++) { - var child = children[j]; - - if (!keepChildren[child]) { - obj[child] = undefined; - } - } - } else { - obj[key] = undefined; - } - } else { - obj = obj[key]; - } - } - } -}; - -/***/ }), -/* 23 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var number = '(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))'; - -var rgba = 'rgb[a]?\\((' + number + '[%]?)\\s*,\\s*(' + number + '[%]?)\\s*,\\s*(' + number + '[%]?)(?:\\s*,\\s*(' + number + '))?\\)'; -var rgbaNoBackRefs = 'rgb[a]?\\((?:' + number + '[%]?)\\s*,\\s*(?:' + number + '[%]?)\\s*,\\s*(?:' + number + '[%]?)(?:\\s*,\\s*(?:' + number + '))?\\)'; - -var hsla = 'hsl[a]?\\((' + number + ')\\s*,\\s*(' + number + '[%])\\s*,\\s*(' + number + '[%])(?:\\s*,\\s*(' + number + '))?\\)'; -var hslaNoBackRefs = 'hsl[a]?\\((?:' + number + ')\\s*,\\s*(?:' + number + '[%])\\s*,\\s*(?:' + number + '[%])(?:\\s*,\\s*(?:' + number + '))?\\)'; - -var hex3 = '\\#[0-9a-fA-F]{3}'; -var hex6 = '\\#[0-9a-fA-F]{6}'; - -module.exports = { - regex: { - number: number, - rgba: rgba, - rgbaNoBackRefs: rgbaNoBackRefs, - hsla: hsla, - hslaNoBackRefs: hslaNoBackRefs, - hex3: hex3, - hex6: hex6 - } -}; - -/***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var memoize = __webpack_require__(13); -var is = __webpack_require__(0); - -module.exports = { - - camel2dash: memoize(function (str) { - return str.replace(/([A-Z])/g, function (v) { - return '-' + v.toLowerCase(); - }); - }), - - dash2camel: memoize(function (str) { - return str.replace(/(-\w)/g, function (v) { - return v[1].toUpperCase(); - }); - }), - - prependCamel: memoize(function (prefix, str) { - return prefix + str[0].toUpperCase() + str.substring(1); - }, function (prefix, str) { - return prefix + '$' + str; - }), - - capitalize: function capitalize(str) { - if (is.emptyString(str)) { - return str; - } - - return str.charAt(0).toUpperCase() + str.substring(1); - } - -}; - -/***/ }), -/* 25 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var window = __webpack_require__(3); -var performance = window ? window.performance : null; - -var util = {}; - -var pnow = performance && performance.now ? function () { - return performance.now(); -} : function () { - return Date.now(); -}; - -var raf = function () { - if (window) { - if (window.requestAnimationFrame) { - return function (fn) { - window.requestAnimationFrame(fn); - }; - } else if (window.mozRequestAnimationFrame) { - return function (fn) { - window.mozRequestAnimationFrame(fn); - }; - } else if (window.webkitRequestAnimationFrame) { - return function (fn) { - window.webkitRequestAnimationFrame(fn); - }; - } else if (window.msRequestAnimationFrame) { - return function (fn) { - window.msRequestAnimationFrame(fn); - }; - } - } - - return function (fn) { - if (fn) { - setTimeout(function () { - fn(pnow()); - }, 1000 / 60); - } - }; -}(); - -util.requestAnimationFrame = function (fn) { - raf(fn); -}; - -util.performanceNow = pnow; - -util.debounce = __webpack_require__(26); - -util.now = function () { - return Date.now(); -}; - -module.exports = util; - -/***/ }), -/* 26 */ -/***/ (function(module, exports) { - -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** Used as references for various `Number` constants. */ -var NAN = 0 / 0; - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; - -/** Used to detect bad signed hexadecimal string values. */ -var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - -/** Used to detect binary string values. */ -var reIsBinary = /^0b[01]+$/i; - -/** Used to detect octal string values. */ -var reIsOctal = /^0o[0-7]+$/i; - -/** Built-in method references without a dependency on `root`. */ -var freeParseInt = parseInt; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max, - nativeMin = Math.min; - -/** - * Gets the timestamp of the number of milliseconds that have elapsed since - * the Unix epoch (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Date - * @returns {number} Returns the timestamp. - * @example - * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => Logs the number of milliseconds it took for the deferred invocation. - */ -var now = function() { - return root.Date.now(); -}; - -/** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed `func` invocations and a `flush` method to immediately invoke them. - * Provide `options` to indicate whether `func` should be invoked on the - * leading and/or trailing edge of the `wait` timeout. The `func` is invoked - * with the last arguments provided to the debounced function. Subsequent - * calls to the debounced function return the result of the last `func` - * invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the debounced function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=false] - * Specify invoking on the leading edge of the timeout. - * @param {number} [options.maxWait] - * The maximum time `func` is allowed to be delayed before it's invoked. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // Avoid costly calculations while the window size is in flux. - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // Invoke `sendMail` when clicked, debouncing subsequent calls. - * jQuery(element).on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // Ensure `batchLog` is invoked once after 1 second of debounced calls. - * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); - * var source = new EventSource('/stream'); - * jQuery(source).on('message', debounced); - * - * // Cancel the trailing debounced invocation. - * jQuery(window).on('popstate', debounced.cancel); - */ -function debounce(func, wait, options) { - var lastArgs, - lastThis, - maxWait, - result, - timerId, - lastCallTime, - lastInvokeTime = 0, - leading = false, - maxing = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = toNumber(wait) || 0; - if (isObject(options)) { - leading = !!options.leading; - maxing = 'maxWait' in options; - maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - - function invokeFunc(time) { - var args = lastArgs, - thisArg = lastThis; - - lastArgs = lastThis = undefined; - lastInvokeTime = time; - result = func.apply(thisArg, args); - return result; - } - - function leadingEdge(time) { - // Reset any `maxWait` timer. - lastInvokeTime = time; - // Start the timer for the trailing edge. - timerId = setTimeout(timerExpired, wait); - // Invoke the leading edge. - return leading ? invokeFunc(time) : result; - } - - function remainingWait(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime, - result = wait - timeSinceLastCall; - - return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; - } - - function shouldInvoke(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime; - - // Either this is the first call, activity has stopped and we're at the - // trailing edge, the system time has gone backwards and we're treating - // it as the trailing edge, or we've hit the `maxWait` limit. - return (lastCallTime === undefined || (timeSinceLastCall >= wait) || - (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); - } - - function timerExpired() { - var time = now(); - if (shouldInvoke(time)) { - return trailingEdge(time); - } - // Restart the timer. - timerId = setTimeout(timerExpired, remainingWait(time)); - } - - function trailingEdge(time) { - timerId = undefined; - - // Only invoke if we have `lastArgs` which means `func` has been - // debounced at least once. - if (trailing && lastArgs) { - return invokeFunc(time); - } - lastArgs = lastThis = undefined; - return result; - } - - function cancel() { - if (timerId !== undefined) { - clearTimeout(timerId); - } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = undefined; - } - - function flush() { - return timerId === undefined ? result : trailingEdge(now()); - } - - function debounced() { - var time = now(), - isInvoking = shouldInvoke(time); - - lastArgs = arguments; - lastThis = this; - lastCallTime = time; - - if (isInvoking) { - if (timerId === undefined) { - return leadingEdge(lastCallTime); - } - if (maxing) { - // Handle invocations in a tight loop. - timerId = setTimeout(timerExpired, wait); - return invokeFunc(lastCallTime); - } - } - if (timerId === undefined) { - timerId = setTimeout(timerExpired, wait); - } - return result; - } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ -function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); -} - -module.exports = debounce; - - -/***/ }), -/* 27 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -function ascending(a, b) { - if (a < b) { - return -1; - } else if (a > b) { - return 1; - } else { - return 0; - } -} - -function descending(a, b) { - return -1 * ascending(a, b); -} - -module.exports = { - sort: { - ascending: ascending, - descending: descending - } -}; - -/***/ }), -/* 28 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -function ObjectMap() { - this._obj = {}; -} - -var p = ObjectMap.prototype; - -p.set = function (key, val) { - this._obj[key] = val; -}; - -p.delete = function (key) { - this._obj[key] = null; -}; - -p.has = function (key) { - return this._obj[key] != null; -}; - -p.get = function (key) { - return this._obj[key]; -}; - -// TODO use the stdlib Map in future... -// module.exports = typeof Map !== 'undefined' ? Map : ObjectMap; -module.exports = ObjectMap; - -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); - -var elesfn = {}; - -[__webpack_require__(30), __webpack_require__(31), __webpack_require__(34), __webpack_require__(35), __webpack_require__(36), __webpack_require__(37), __webpack_require__(38), __webpack_require__(39), __webpack_require__(40), __webpack_require__(41), __webpack_require__(42)].forEach(function (props) { - util.extend(elesfn, props); -}); - -module.exports = elesfn; - -/***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); - -var defineSearch = function defineSearch(params) { - params = { - bfs: params.bfs || !params.dfs, - dfs: params.dfs || !params.bfs - }; - - // from pseudocode on wikipedia - return function searchFn(roots, fn, directed) { - var options; - if (is.plainObject(roots) && !is.elementOrCollection(roots)) { - options = roots; - roots = options.roots || options.root; - fn = options.visit; - directed = options.directed; - } - - directed = arguments.length === 2 && !is.fn(fn) ? fn : directed; - fn = is.fn(fn) ? fn : function () {}; - - var cy = this._private.cy; - var v = roots = is.string(roots) ? this.filter(roots) : roots; - var Q = []; - var connectedNodes = []; - var connectedBy = {}; - var id2depth = {}; - var V = {}; - var j = 0; - var found; - var nodes = this.nodes(); - var edges = this.edges(); - - // enqueue v - for (var i = 0; i < v.length; i++) { - if (v[i].isNode()) { - Q.unshift(v[i]); - - if (params.bfs) { - V[v[i].id()] = true; - - connectedNodes.push(v[i]); - } - - id2depth[v[i].id()] = 0; - } - } - - while (Q.length !== 0) { - var v = params.bfs ? Q.shift() : Q.pop(); - - if (params.dfs) { - if (V[v.id()]) { - continue; - } - - V[v.id()] = true; - - connectedNodes.push(v); - } - - var depth = id2depth[v.id()]; - var prevEdge = connectedBy[v.id()]; - var prevNode = prevEdge == null ? undefined : prevEdge.connectedNodes().not(v)[0]; - var ret; - - ret = fn(v, prevEdge, prevNode, j++, depth); - - if (ret === true) { - found = v; - break; - } - - if (ret === false) { - break; - } - - var vwEdges = v.connectedEdges(directed ? function (ele) { - return ele.data('source') === v.id(); - } : undefined).intersect(edges); - for (var i = 0; i < vwEdges.length; i++) { - var e = vwEdges[i]; - var w = e.connectedNodes(function (n) { - return n.id() !== v.id(); - }).intersect(nodes); - - if (w.length !== 0 && !V[w.id()]) { - w = w[0]; - - Q.push(w); - - if (params.bfs) { - V[w.id()] = true; - - connectedNodes.push(w); - } - - connectedBy[w.id()] = e; - - id2depth[w.id()] = id2depth[v.id()] + 1; - } - } - } - - var connectedEles = []; - - for (var i = 0; i < connectedNodes.length; i++) { - var node = connectedNodes[i]; - var edge = connectedBy[node.id()]; - - if (edge) { - connectedEles.push(edge); - } - - connectedEles.push(node); - } - - return { - path: cy.collection(connectedEles, { unique: true }), - found: cy.collection(found) - }; - }; -}; - -// search, spanning trees, etc -var elesfn = { - breadthFirstSearch: defineSearch({ bfs: true }), - depthFirstSearch: defineSearch({ dfs: true }) -}; - -// nice, short mathemathical alias -elesfn.bfs = elesfn.breadthFirstSearch; -elesfn.dfs = elesfn.depthFirstSearch; - -module.exports = elesfn; - -/***/ }), -/* 31 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var Heap = __webpack_require__(9); - -var elesfn = { - - dijkstra: function dijkstra(root, weightFn, directed) { - var options; - if (is.plainObject(root) && !is.elementOrCollection(root)) { - options = root; - root = options.root; - weightFn = options.weight; - directed = options.directed; - } - - var cy = this._private.cy; - weightFn = is.fn(weightFn) ? weightFn : function () { - return 1; - }; // if not specified, assume each edge has equal weight (1) - - var source = is.string(root) ? this.filter(root)[0] : root[0]; - var dist = {}; - var prev = {}; - var knownDist = {}; - - var edges = this.edges().filter(function (ele) { - return !ele.isLoop(); - }); - var nodes = this.nodes(); - - var getDist = function getDist(node) { - return dist[node.id()]; - }; - - var setDist = function setDist(node, d) { - dist[node.id()] = d; - - Q.updateItem(node); - }; - - var Q = new Heap(function (a, b) { - return getDist(a) - getDist(b); - }); - - for (var i = 0; i < nodes.length; i++) { - var node = nodes[i]; - - dist[node.id()] = node.same(source) ? 0 : Infinity; - Q.push(node); - } - - var distBetween = function distBetween(u, v) { - var uvs = (directed ? u.edgesTo(v) : u.edgesWith(v)).intersect(edges); - var smallestDistance = Infinity; - var smallestEdge; - - for (var i = 0; i < uvs.length; i++) { - var edge = uvs[i]; - var weight = weightFn(edge); - - if (weight < smallestDistance || !smallestEdge) { - smallestDistance = weight; - smallestEdge = edge; - } - } - - return { - edge: smallestEdge, - dist: smallestDistance - }; - }; - - while (Q.size() > 0) { - var u = Q.pop(); - var smalletsDist = getDist(u); - var uid = u.id(); - - knownDist[uid] = smalletsDist; - - if (smalletsDist === Infinity) { - continue; - } - - var neighbors = u.neighborhood().intersect(nodes); - for (var i = 0; i < neighbors.length; i++) { - var v = neighbors[i]; - var vid = v.id(); - var vDist = distBetween(u, v); - - var alt = smalletsDist + vDist.dist; - - if (alt < getDist(v)) { - setDist(v, alt); - - prev[vid] = { - node: u, - edge: vDist.edge - }; - } - } // for - } // while - - return { - distanceTo: function distanceTo(node) { - var target = is.string(node) ? nodes.filter(node)[0] : node[0]; - - return knownDist[target.id()]; - }, - - pathTo: function pathTo(node) { - var target = is.string(node) ? nodes.filter(node)[0] : node[0]; - var S = []; - var u = target; - - if (target.length > 0) { - S.unshift(target); - - while (prev[u.id()]) { - var p = prev[u.id()]; - - S.unshift(p.edge); - S.unshift(p.node); - - u = p.node; - } - } - - return cy.collection(S); - } - }; - } -}; - -module.exports = elesfn; - -/***/ }), -/* 32 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(33); - - -/***/ }), -/* 33 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Generated by CoffeeScript 1.8.0 -(function() { - var Heap, defaultCmp, floor, heapify, heappop, heappush, heappushpop, heapreplace, insort, min, nlargest, nsmallest, updateItem, _siftdown, _siftup; - - floor = Math.floor, min = Math.min; - - - /* - Default comparison function to be used - */ - - defaultCmp = function(x, y) { - if (x < y) { - return -1; - } - if (x > y) { - return 1; - } - return 0; - }; - - - /* - Insert item x in list a, and keep it sorted assuming a is sorted. - - If x is already in a, insert it to the right of the rightmost x. - - Optional args lo (default 0) and hi (default a.length) bound the slice - of a to be searched. - */ - - insort = function(a, x, lo, hi, cmp) { - var mid; - if (lo == null) { - lo = 0; - } - if (cmp == null) { - cmp = defaultCmp; - } - if (lo < 0) { - throw new Error('lo must be non-negative'); - } - if (hi == null) { - hi = a.length; - } - while (lo < hi) { - mid = floor((lo + hi) / 2); - if (cmp(x, a[mid]) < 0) { - hi = mid; - } else { - lo = mid + 1; - } - } - return ([].splice.apply(a, [lo, lo - lo].concat(x)), x); - }; - - - /* - Push item onto heap, maintaining the heap invariant. - */ - - heappush = function(array, item, cmp) { - if (cmp == null) { - cmp = defaultCmp; - } - array.push(item); - return _siftdown(array, 0, array.length - 1, cmp); - }; - - - /* - Pop the smallest item off the heap, maintaining the heap invariant. - */ - - heappop = function(array, cmp) { - var lastelt, returnitem; - if (cmp == null) { - cmp = defaultCmp; - } - lastelt = array.pop(); - if (array.length) { - returnitem = array[0]; - array[0] = lastelt; - _siftup(array, 0, cmp); - } else { - returnitem = lastelt; - } - return returnitem; - }; - - - /* - Pop and return the current smallest value, and add the new item. - - This is more efficient than heappop() followed by heappush(), and can be - more appropriate when using a fixed size heap. Note that the value - returned may be larger than item! That constrains reasonable use of - this routine unless written as part of a conditional replacement: - if item > array[0] - item = heapreplace(array, item) - */ - - heapreplace = function(array, item, cmp) { - var returnitem; - if (cmp == null) { - cmp = defaultCmp; - } - returnitem = array[0]; - array[0] = item; - _siftup(array, 0, cmp); - return returnitem; - }; - - - /* - Fast version of a heappush followed by a heappop. - */ - - heappushpop = function(array, item, cmp) { - var _ref; - if (cmp == null) { - cmp = defaultCmp; - } - if (array.length && cmp(array[0], item) < 0) { - _ref = [array[0], item], item = _ref[0], array[0] = _ref[1]; - _siftup(array, 0, cmp); - } - return item; - }; - - - /* - Transform list into a heap, in-place, in O(array.length) time. - */ - - heapify = function(array, cmp) { - var i, _i, _j, _len, _ref, _ref1, _results, _results1; - if (cmp == null) { - cmp = defaultCmp; - } - _ref1 = (function() { - _results1 = []; - for (var _j = 0, _ref = floor(array.length / 2); 0 <= _ref ? _j < _ref : _j > _ref; 0 <= _ref ? _j++ : _j--){ _results1.push(_j); } - return _results1; - }).apply(this).reverse(); - _results = []; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - i = _ref1[_i]; - _results.push(_siftup(array, i, cmp)); - } - return _results; - }; - - - /* - Update the position of the given item in the heap. - This function should be called every time the item is being modified. - */ - - updateItem = function(array, item, cmp) { - var pos; - if (cmp == null) { - cmp = defaultCmp; - } - pos = array.indexOf(item); - if (pos === -1) { - return; - } - _siftdown(array, 0, pos, cmp); - return _siftup(array, pos, cmp); - }; - - - /* - Find the n largest elements in a dataset. - */ - - nlargest = function(array, n, cmp) { - var elem, result, _i, _len, _ref; - if (cmp == null) { - cmp = defaultCmp; - } - result = array.slice(0, n); - if (!result.length) { - return result; - } - heapify(result, cmp); - _ref = array.slice(n); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - elem = _ref[_i]; - heappushpop(result, elem, cmp); - } - return result.sort(cmp).reverse(); - }; - - - /* - Find the n smallest elements in a dataset. - */ - - nsmallest = function(array, n, cmp) { - var elem, i, los, result, _i, _j, _len, _ref, _ref1, _results; - if (cmp == null) { - cmp = defaultCmp; - } - if (n * 10 <= array.length) { - result = array.slice(0, n).sort(cmp); - if (!result.length) { - return result; - } - los = result[result.length - 1]; - _ref = array.slice(n); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - elem = _ref[_i]; - if (cmp(elem, los) < 0) { - insort(result, elem, 0, null, cmp); - result.pop(); - los = result[result.length - 1]; - } - } - return result; - } - heapify(array, cmp); - _results = []; - for (i = _j = 0, _ref1 = min(n, array.length); 0 <= _ref1 ? _j < _ref1 : _j > _ref1; i = 0 <= _ref1 ? ++_j : --_j) { - _results.push(heappop(array, cmp)); - } - return _results; - }; - - _siftdown = function(array, startpos, pos, cmp) { - var newitem, parent, parentpos; - if (cmp == null) { - cmp = defaultCmp; - } - newitem = array[pos]; - while (pos > startpos) { - parentpos = (pos - 1) >> 1; - parent = array[parentpos]; - if (cmp(newitem, parent) < 0) { - array[pos] = parent; - pos = parentpos; - continue; - } - break; - } - return array[pos] = newitem; - }; - - _siftup = function(array, pos, cmp) { - var childpos, endpos, newitem, rightpos, startpos; - if (cmp == null) { - cmp = defaultCmp; - } - endpos = array.length; - startpos = pos; - newitem = array[pos]; - childpos = 2 * pos + 1; - while (childpos < endpos) { - rightpos = childpos + 1; - if (rightpos < endpos && !(cmp(array[childpos], array[rightpos]) < 0)) { - childpos = rightpos; - } - array[pos] = array[childpos]; - pos = childpos; - childpos = 2 * pos + 1; - } - array[pos] = newitem; - return _siftdown(array, startpos, pos, cmp); - }; - - Heap = (function() { - Heap.push = heappush; - - Heap.pop = heappop; - - Heap.replace = heapreplace; - - Heap.pushpop = heappushpop; - - Heap.heapify = heapify; - - Heap.updateItem = updateItem; - - Heap.nlargest = nlargest; - - Heap.nsmallest = nsmallest; - - function Heap(cmp) { - this.cmp = cmp != null ? cmp : defaultCmp; - this.nodes = []; - } - - Heap.prototype.push = function(x) { - return heappush(this.nodes, x, this.cmp); - }; - - Heap.prototype.pop = function() { - return heappop(this.nodes, this.cmp); - }; - - Heap.prototype.peek = function() { - return this.nodes[0]; - }; - - Heap.prototype.contains = function(x) { - return this.nodes.indexOf(x) !== -1; - }; - - Heap.prototype.replace = function(x) { - return heapreplace(this.nodes, x, this.cmp); - }; - - Heap.prototype.pushpop = function(x) { - return heappushpop(this.nodes, x, this.cmp); - }; - - Heap.prototype.heapify = function() { - return heapify(this.nodes, this.cmp); - }; - - Heap.prototype.updateItem = function(x) { - return updateItem(this.nodes, x, this.cmp); - }; - - Heap.prototype.clear = function() { - return this.nodes = []; - }; - - Heap.prototype.empty = function() { - return this.nodes.length === 0; - }; - - Heap.prototype.size = function() { - return this.nodes.length; - }; - - Heap.prototype.clone = function() { - var heap; - heap = new Heap(); - heap.nodes = this.nodes.slice(0); - return heap; - }; - - Heap.prototype.toArray = function() { - return this.nodes.slice(0); - }; - - Heap.prototype.insert = Heap.prototype.push; - - Heap.prototype.top = Heap.prototype.peek; - - Heap.prototype.front = Heap.prototype.peek; - - Heap.prototype.has = Heap.prototype.contains; - - Heap.prototype.copy = Heap.prototype.clone; - - return Heap; - - })(); - - (function(root, factory) { - if (true) { - return !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof exports === 'object') { - return module.exports = factory(); - } else { - return root.Heap = factory(); - } - })(this, function() { - return Heap; - }); - -}).call(this); - - -/***/ }), -/* 34 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); - -// search, spanning trees, etc -var elesfn = { - - // kruskal's algorithm (finds min spanning tree, assuming undirected graph) - // implemented from pseudocode from wikipedia - kruskal: function kruskal(weightFn) { - var cy = this.cy(); - - weightFn = is.fn(weightFn) ? weightFn : function () { - return 1; - }; // if not specified, assume each edge has equal weight (1) - - function findSet(ele) { - for (var i = 0; i < forest.length; i++) { - var eles = forest[i]; - - if (eles.anySame(ele)) { - return { - eles: eles, - index: i - }; - } - } - } - - var A = cy.collection(cy, []); - var forest = []; - var nodes = this.nodes(); - - for (var i = 0; i < nodes.length; i++) { - forest.push(nodes[i].collection()); - } - - var edges = this.edges(); - var S = edges.toArray().sort(function (a, b) { - var weightA = weightFn(a); - var weightB = weightFn(b); - - return weightA - weightB; - }); - - for (var i = 0; i < S.length; i++) { - var edge = S[i]; - var u = edge.source()[0]; - var v = edge.target()[0]; - var setU = findSet(u); - var setV = findSet(v); - - if (setU.index !== setV.index) { - A = A.add(edge); - - // combine forests for u and v - forest[setU.index] = setU.eles.add(setV.eles); - forest.splice(setV.index, 1); - } - } - - return nodes.add(A); - } -}; - -module.exports = elesfn; - -/***/ }), -/* 35 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); - -var elesfn = { - - // Implemented from pseudocode from wikipedia - aStar: function aStar(options) { - var eles = this; - - options = options || {}; - - // Reconstructs the path from Start to End, acumulating the result in pathAcum - var reconstructPath = function reconstructPath(start, end, cameFromMap, pathAcum) { - // Base case - if (start == end) { - pathAcum.unshift(cy.getElementById(end)); - return pathAcum; - } - - if (end in cameFromMap) { - // We know which node is before the last one - var previous = cameFromMap[end]; - var previousEdge = cameFromEdge[end]; - - pathAcum.unshift(cy.getElementById(previousEdge)); - pathAcum.unshift(cy.getElementById(end)); - - return reconstructPath(start, previous, cameFromMap, pathAcum); - } - - // We should not reach here! - return undefined; - }; - - // Returns the index of the element in openSet which has minimum fScore - var findMin = function findMin(openSet, fScore) { - if (openSet.length === 0) { - // Should never be the case - return undefined; - } - var minPos = 0; - var tempScore = fScore[openSet[0]]; - for (var i = 1; i < openSet.length; i++) { - var s = fScore[openSet[i]]; - if (s < tempScore) { - tempScore = s; - minPos = i; - } - } - return minPos; - }; - - var cy = this._private.cy; - - // root - mandatory! - if (options != null && options.root != null) { - var source = is.string(options.root) ? - // use it as a selector, e.g. "#rootID - this.filter(options.root)[0] : options.root[0]; - } else { - return undefined; - } - - // goal - mandatory! - if (options.goal != null) { - var target = is.string(options.goal) ? - // use it as a selector, e.g. "#goalID - this.filter(options.goal)[0] : options.goal[0]; - } else { - return undefined; - } - - // Heuristic function - optional - if (options.heuristic != null && is.fn(options.heuristic)) { - var heuristic = options.heuristic; - } else { - var heuristic = function heuristic() { - return 0; - }; // use constant if unspecified - } - - // Weight function - optional - if (options.weight != null && is.fn(options.weight)) { - var weightFn = options.weight; - } else { - // If not specified, assume each edge has equal weight (1) - var weightFn = function weightFn(e) { - return 1; - }; - } - - // directed - optional - if (options.directed != null) { - var directed = options.directed; - } else { - var directed = false; - } - - var sid = source.id(); - var tid = target.id(); - - var closedSet = []; - var openSet = [sid]; - var cameFrom = {}; - var cameFromEdge = {}; - var gScore = {}; - var fScore = {}; - - gScore[sid] = 0; - fScore[sid] = heuristic(source); - - // Counter - var steps = 0; - - // Main loop - while (openSet.length > 0) { - var minPos = findMin(openSet, fScore); - var cMin = cy.getElementById(openSet[minPos]); - var cMinId = cMin.id(); - steps++; - - // If we've found our goal, then we are done - if (cMinId == tid) { - var rPath = reconstructPath(sid, tid, cameFrom, []); - - return { - found: true, - distance: gScore[cMinId], - path: eles.spawn(rPath), - steps: steps - }; - } - - // Add cMin to processed nodes - closedSet.push(cMinId); - // Remove cMin from boundary nodes - openSet.splice(minPos, 1); - - // Update scores for neighbors of cMin - // Take into account if graph is directed or not - var vwEdges = cMin._private.edges; - - for (var i = 0; i < vwEdges.length; i++) { - var e = vwEdges[i]; - - // edge must be in set of calling eles - if (!this.hasElementWithId(e.id())) { - continue; - } - - // cMin must be the source of edge if directed - if (directed && e.data('source') !== cMinId) { - continue; - } - - var wSrc = e.source(); - var wTgt = e.target(); - - var w = wSrc.id() !== cMinId ? wSrc : wTgt; - var wid = w.id(); - - // node must be in set of calling eles - if (!this.hasElementWithId(wid)) { - continue; - } - - // if node is in closedSet, ignore it - if (closedSet.indexOf(wid) != -1) { - continue; - } - - // New tentative score for node w - var tempScore = gScore[cMinId] + weightFn(e); - - // Update gScore for node w if: - // w not present in openSet - // OR - // tentative gScore is less than previous value - - // w not in openSet - if (openSet.indexOf(wid) == -1) { - gScore[wid] = tempScore; - fScore[wid] = tempScore + heuristic(w); - openSet.push(wid); // Add node to openSet - cameFrom[wid] = cMinId; - cameFromEdge[wid] = e.id(); - continue; - } - // w already in openSet, but with greater gScore - if (tempScore < gScore[wid]) { - gScore[wid] = tempScore; - fScore[wid] = tempScore + heuristic(w); - cameFrom[wid] = cMinId; - } - } // End of neighbors update - } // End of main loop - - // If we've reached here, then we've not reached our goal - return { - found: false, - distance: undefined, - path: undefined, - steps: steps - }; - } - -}; // elesfn - - -module.exports = elesfn; - -/***/ }), -/* 36 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); - -var elesfn = { - - // Implemented from pseudocode from wikipedia - floydWarshall: function floydWarshall(options) { - options = options || {}; - - var cy = this.cy(); - - // Weight function - optional - if (options.weight != null && is.fn(options.weight)) { - var weightFn = options.weight; - } else { - // If not specified, assume each edge has equal weight (1) - var weightFn = function weightFn(e) { - return 1; - }; - } - - // directed - optional - if (options.directed != null) { - var directed = options.directed; - } else { - var directed = false; - } - - var edges = this.edges().stdFilter(function (e) { - return !e.isLoop(); - }); - var nodes = this.nodes(); - var numNodes = nodes.length; - - // mapping: node id -> position in nodes array - var id2position = {}; - for (var i = 0; i < numNodes; i++) { - id2position[nodes[i].id()] = i; - } - - // Initialize distance matrix - var dist = []; - for (var i = 0; i < numNodes; i++) { - var newRow = new Array(numNodes); - for (var j = 0; j < numNodes; j++) { - if (i == j) { - newRow[j] = 0; - } else { - newRow[j] = Infinity; - } - } - dist.push(newRow); - } - - // Initialize matrix used for path reconstruction - // Initialize distance matrix - var next = []; - var edgeNext = []; - - var initMatrix = function initMatrix(next) { - for (var i = 0; i < numNodes; i++) { - var newRow = new Array(numNodes); - for (var j = 0; j < numNodes; j++) { - newRow[j] = undefined; - } - next.push(newRow); - } - }; - - initMatrix(next); - initMatrix(edgeNext); - - // Process edges - for (var i = 0; i < edges.length; i++) { - var sourceIndex = id2position[edges[i].source().id()]; - var targetIndex = id2position[edges[i].target().id()]; - var weight = weightFn(edges[i]); - - // Check if already process another edge between same 2 nodes - if (dist[sourceIndex][targetIndex] > weight) { - dist[sourceIndex][targetIndex] = weight; - next[sourceIndex][targetIndex] = targetIndex; - edgeNext[sourceIndex][targetIndex] = edges[i]; - } - } - - // If undirected graph, process 'reversed' edges - if (!directed) { - for (var i = 0; i < edges.length; i++) { - var sourceIndex = id2position[edges[i].target().id()]; - var targetIndex = id2position[edges[i].source().id()]; - var weight = weightFn(edges[i]); - - // Check if already process another edge between same 2 nodes - if (dist[sourceIndex][targetIndex] > weight) { - dist[sourceIndex][targetIndex] = weight; - next[sourceIndex][targetIndex] = targetIndex; - edgeNext[sourceIndex][targetIndex] = edges[i]; - } - } - } - - // Main loop - for (var k = 0; k < numNodes; k++) { - for (var i = 0; i < numNodes; i++) { - for (var j = 0; j < numNodes; j++) { - if (dist[i][k] + dist[k][j] < dist[i][j]) { - dist[i][j] = dist[i][k] + dist[k][j]; - next[i][j] = next[i][k]; - } - } - } - } - - // Build result object - var position2id = []; - for (var i = 0; i < numNodes; i++) { - position2id.push(nodes[i].id()); - } - - var res = { - distance: function distance(from, to) { - if (is.string(from)) { - // from is a selector string - var fromId = cy.filter(from)[0].id(); - } else { - // from is a node - var fromId = from.id(); - } - - if (is.string(to)) { - // to is a selector string - var toId = cy.filter(to)[0].id(); - } else { - // to is a node - var toId = to.id(); - } - - return dist[id2position[fromId]][id2position[toId]]; - }, - - path: function path(from, to) { - var reconstructPathAux = function reconstructPathAux(from, to, next, position2id, edgeNext) { - if (from === to) { - return cy.getElementById(position2id[from]); - } - if (next[from][to] === undefined) { - return undefined; - } - - var path = [cy.getElementById(position2id[from])]; - var prev = from; - while (from !== to) { - prev = from; - from = next[from][to]; - - var edge = edgeNext[prev][from]; - path.push(edge); - - path.push(cy.getElementById(position2id[from])); - } - return path; - }; - - if (is.string(from)) { - // from is a selector string - var fromId = cy.filter(from)[0].id(); - } else { - // from is a node - var fromId = from.id(); - } - - if (is.string(to)) { - // to is a selector string - var toId = cy.filter(to)[0].id(); - } else { - // to is a node - var toId = to.id(); - } - - var pathArr = reconstructPathAux(id2position[fromId], id2position[toId], next, position2id, edgeNext); - - return cy.collection(pathArr); - } - }; - - return res; - } // floydWarshall - -}; // elesfn - -module.exports = elesfn; - -/***/ }), -/* 37 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var util = __webpack_require__(1); - -var elesfn = { - - // Implemented from pseudocode from wikipedia - bellmanFord: function bellmanFord(options) { - var eles = this; - - options = options || {}; - - // Weight function - optional - if (options.weight != null && is.fn(options.weight)) { - var weightFn = options.weight; - } else { - // If not specified, assume each edge has equal weight (1) - var weightFn = function weightFn(e) { - return 1; - }; - } - - // directed - optional - if (options.directed != null) { - var directed = options.directed; - } else { - var directed = false; - } - - // root - mandatory! - if (options.root != null) { - if (is.string(options.root)) { - // use it as a selector, e.g. "#rootID - var source = this.filter(options.root)[0]; - } else { - var source = options.root[0]; - } - } else { - return undefined; - } - - var cy = this._private.cy; - var edges = this.edges().stdFilter(function (e) { - return !e.isLoop(); - }); - var nodes = this.nodes(); - var numNodes = nodes.length; - - // mapping: node id -> position in nodes array - var id2position = {}; - for (var i = 0; i < numNodes; i++) { - id2position[nodes[i].id()] = i; - } - - // Initializations - var cost = []; - var predecessor = []; - var predEdge = []; - - for (var i = 0; i < numNodes; i++) { - if (nodes[i].id() === source.id()) { - cost[i] = 0; - } else { - cost[i] = Infinity; - } - predecessor[i] = undefined; - } - - // Edges relaxation - var flag = false; - for (var i = 1; i < numNodes; i++) { - flag = false; - for (var e = 0; e < edges.length; e++) { - var sourceIndex = id2position[edges[e].source().id()]; - var targetIndex = id2position[edges[e].target().id()]; - var weight = weightFn(edges[e]); - - var temp = cost[sourceIndex] + weight; - if (temp < cost[targetIndex]) { - cost[targetIndex] = temp; - predecessor[targetIndex] = sourceIndex; - predEdge[targetIndex] = edges[e]; - flag = true; - } - - // If undirected graph, we need to take into account the 'reverse' edge - if (!directed) { - var temp = cost[targetIndex] + weight; - if (temp < cost[sourceIndex]) { - cost[sourceIndex] = temp; - predecessor[sourceIndex] = targetIndex; - predEdge[sourceIndex] = edges[e]; - flag = true; - } - } - } - - if (!flag) { - break; - } - } - - if (flag) { - // Check for negative weight cycles - for (var e = 0; e < edges.length; e++) { - var sourceIndex = id2position[edges[e].source().id()]; - var targetIndex = id2position[edges[e].target().id()]; - var weight = weightFn(edges[e]); - - if (cost[sourceIndex] + weight < cost[targetIndex]) { - util.error('Graph contains a negative weight cycle for Bellman-Ford'); - return { pathTo: undefined, - distanceTo: undefined, - hasNegativeWeightCycle: true }; - } - } - } - - // Build result object - var position2id = []; - for (var i = 0; i < numNodes; i++) { - position2id.push(nodes[i].id()); - } - - var res = { - distanceTo: function distanceTo(to) { - if (is.string(to)) { - // to is a selector string - var toId = cy.filter(to)[0].id(); - } else { - // to is a node - var toId = to.id(); - } - - return cost[id2position[toId]]; - }, - - pathTo: function pathTo(to) { - - var reconstructPathAux = function reconstructPathAux(predecessor, fromPos, toPos, position2id, acumPath, predEdge) { - for (;;) { - // Add toId to path - acumPath.push(cy.getElementById(position2id[toPos])); - acumPath.push(predEdge[toPos]); - - if (fromPos === toPos) { - // reached starting node - return acumPath; - } - - // If no path exists, discart acumulated path and return undefined - var predPos = predecessor[toPos]; - if (typeof predPos === 'undefined') { - return undefined; - } - - toPos = predPos; - } - }; - - if (is.string(to)) { - // to is a selector string - var toId = cy.filter(to)[0].id(); - } else { - // to is a node - var toId = to.id(); - } - var path = []; - - // This returns a reversed path - var res = reconstructPathAux(predecessor, id2position[source.id()], id2position[toId], position2id, path, predEdge); - - // Get it in the correct order and return it - if (res != null) { - res.reverse(); - } - - return eles.spawn(res); - }, - - hasNegativeWeightCycle: false - }; - - return res; - } // bellmanFord - -}; // elesfn - -module.exports = elesfn; - -/***/ }), -/* 38 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); - -var elesfn = { - - // Computes the minimum cut of an undirected graph - // Returns the correct answer with high probability - kargerStein: function kargerStein(options) { - var eles = this; - - options = options || {}; - - // Function which colapses 2 (meta) nodes into one - // Updates the remaining edge lists - // Receives as a paramater the edge which causes the collapse - var colapse = function colapse(edgeIndex, nodeMap, remainingEdges) { - var edgeInfo = remainingEdges[edgeIndex]; - var sourceIn = edgeInfo[1]; - var targetIn = edgeInfo[2]; - var partition1 = nodeMap[sourceIn]; - var partition2 = nodeMap[targetIn]; - - // Delete all edges between partition1 and partition2 - var newEdges = remainingEdges.filter(function (edge) { - if (nodeMap[edge[1]] === partition1 && nodeMap[edge[2]] === partition2) { - return false; - } - if (nodeMap[edge[1]] === partition2 && nodeMap[edge[2]] === partition1) { - return false; - } - return true; - }); - - // All edges pointing to partition2 should now point to partition1 - for (var i = 0; i < newEdges.length; i++) { - var edge = newEdges[i]; - if (edge[1] === partition2) { - // Check source - newEdges[i] = edge.slice(0); - newEdges[i][1] = partition1; - } else if (edge[2] === partition2) { - // Check target - newEdges[i] = edge.slice(0); - newEdges[i][2] = partition1; - } - } - - // Move all nodes from partition2 to partition1 - for (var i = 0; i < nodeMap.length; i++) { - if (nodeMap[i] === partition2) { - nodeMap[i] = partition1; - } - } - - return newEdges; - }; - - // Contracts a graph until we reach a certain number of meta nodes - var contractUntil = function contractUntil(metaNodeMap, remainingEdges, size, sizeLimit) { - // Stop condition - if (size <= sizeLimit) { - return remainingEdges; - } - - // Choose an edge randomly - var edgeIndex = Math.floor(Math.random() * remainingEdges.length); - - // Colapse graph based on edge - var newEdges = colapse(edgeIndex, metaNodeMap, remainingEdges); - - return contractUntil(metaNodeMap, newEdges, size - 1, sizeLimit); - }; - - var cy = this._private.cy; - var edges = this.edges().stdFilter(function (e) { - return !e.isLoop(); - }); - var nodes = this.nodes(); - var numNodes = nodes.length; - var numEdges = edges.length; - var numIter = Math.ceil(Math.pow(Math.log(numNodes) / Math.LN2, 2)); - var stopSize = Math.floor(numNodes / Math.sqrt(2)); - - if (numNodes < 2) { - util.error('At least 2 nodes are required for Karger-Stein algorithm'); - return undefined; - } - - // Create numerical identifiers for each node - // mapping: node id -> position in nodes array - // for reverse mapping, simply use nodes array - var id2position = {}; - for (var i = 0; i < numNodes; i++) { - id2position[nodes[i].id()] = i; - } - - // Now store edge destination as indexes - // Format for each edge (edge index, source node index, target node index) - var edgeIndexes = []; - for (var i = 0; i < numEdges; i++) { - var e = edges[i]; - edgeIndexes.push([i, id2position[e.source().id()], id2position[e.target().id()]]); - } - - // We will store the best cut found here - var minCutSize = Infinity; - var minCut; - - // Initial meta node partition - var originalMetaNode = []; - for (var i = 0; i < numNodes; i++) { - originalMetaNode.push(i); - } - - // Main loop - for (var iter = 0; iter <= numIter; iter++) { - // Create new meta node partition - var metaNodeMap = originalMetaNode.slice(0); - - // Contract until stop point (stopSize nodes) - var edgesState = contractUntil(metaNodeMap, edgeIndexes, numNodes, stopSize); - - // Create a copy of the colapsed nodes state - var metaNodeMap2 = metaNodeMap.slice(0); - - // Run 2 iterations starting in the stop state - var res1 = contractUntil(metaNodeMap, edgesState, stopSize, 2); - var res2 = contractUntil(metaNodeMap2, edgesState, stopSize, 2); - - // Is any of the 2 results the best cut so far? - if (res1.length <= res2.length && res1.length < minCutSize) { - minCutSize = res1.length; - minCut = [res1, metaNodeMap]; - } else if (res2.length <= res1.length && res2.length < minCutSize) { - minCutSize = res2.length; - minCut = [res2, metaNodeMap2]; - } - } // end of main loop - - - // Construct result - var resEdges = minCut[0].map(function (e) { - return edges[e[0]]; - }); - var partition1 = []; - var partition2 = []; - - // traverse metaNodeMap for best cut - var witnessNodePartition = minCut[1][0]; - for (var i = 0; i < minCut[1].length; i++) { - var partitionId = minCut[1][i]; - if (partitionId === witnessNodePartition) { - partition1.push(nodes[i]); - } else { - partition2.push(nodes[i]); - } - } - - var ret = { - cut: eles.spawn(cy, resEdges), - partition1: eles.spawn(partition1), - partition2: eles.spawn(partition2) - }; - - return ret; - } -}; // elesfn - - -module.exports = elesfn; - -/***/ }), -/* 39 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); - -var elesfn = { - - pageRank: function pageRank(options) { - options = options || {}; - - var normalizeVector = function normalizeVector(vector) { - var length = vector.length; - - // First, get sum of all elements - var total = 0; - for (var i = 0; i < length; i++) { - total += vector[i]; - } - - // Now, divide each by the sum of all elements - for (var i = 0; i < length; i++) { - vector[i] = vector[i] / total; - } - }; - - // dampingFactor - optional - if (options != null && options.dampingFactor != null) { - var dampingFactor = options.dampingFactor; - } else { - var dampingFactor = 0.8; // Default damping factor - } - - // desired precision - optional - if (options != null && options.precision != null) { - var epsilon = options.precision; - } else { - var epsilon = 0.000001; // Default precision - } - - // Max number of iterations - optional - if (options != null && options.iterations != null) { - var numIter = options.iterations; - } else { - var numIter = 200; // Default number of iterations - } - - // Weight function - optional - if (options != null && options.weight != null && is.fn(options.weight)) { - var weightFn = options.weight; - } else { - // If not specified, assume each edge has equal weight (1) - var weightFn = function weightFn(e) { - return 1; - }; - } - - var cy = this._private.cy; - var edges = this.edges().stdFilter(function (e) { - return !e.isLoop(); - }); - var nodes = this.nodes(); - var numNodes = nodes.length; - var numEdges = edges.length; - - // Create numerical identifiers for each node - // mapping: node id -> position in nodes array - // for reverse mapping, simply use nodes array - var id2position = {}; - for (var i = 0; i < numNodes; i++) { - id2position[nodes[i].id()] = i; - } - - // Construct transposed adjacency matrix - // First lets have a zeroed matrix of the right size - // We'll also keep track of the sum of each column - var matrix = []; - var columnSum = []; - var additionalProb = (1 - dampingFactor) / numNodes; - - // Create null matric - for (var i = 0; i < numNodes; i++) { - var newRow = []; - for (var j = 0; j < numNodes; j++) { - newRow.push(0.0); - } - matrix.push(newRow); - columnSum.push(0.0); - } - - // Now, process edges - for (var i = 0; i < numEdges; i++) { - var edge = edges[i]; - var s = id2position[edge.source().id()]; - var t = id2position[edge.target().id()]; - var w = weightFn(edge); - - // Update matrix - matrix[t][s] += w; - - // Update column sum - columnSum[s] += w; - } - - // Add additional probability based on damping factor - // Also, take into account columns that have sum = 0 - var p = 1.0 / numNodes + additionalProb; // Shorthand - // Traverse matrix, column by column - for (var j = 0; j < numNodes; j++) { - if (columnSum[j] === 0) { - // No 'links' out from node jth, assume equal probability for each possible node - for (var i = 0; i < numNodes; i++) { - matrix[i][j] = p; - } - } else { - // Node jth has outgoing link, compute normalized probabilities - for (var i = 0; i < numNodes; i++) { - matrix[i][j] = matrix[i][j] / columnSum[j] + additionalProb; - } - } - } - - // Compute dominant eigenvector using power method - var eigenvector = []; - var nullVector = []; - var previous; - - // Start with a vector of all 1's - // Also, initialize a null vector which will be used as shorthand - for (var i = 0; i < numNodes; i++) { - eigenvector.push(1.0); - nullVector.push(0.0); - } - - for (var iter = 0; iter < numIter; iter++) { - // New array with all 0's - var temp = nullVector.slice(0); - - // Multiply matrix with previous result - for (var i = 0; i < numNodes; i++) { - for (var j = 0; j < numNodes; j++) { - temp[i] += matrix[i][j] * eigenvector[j]; - } - } - - normalizeVector(temp); - previous = eigenvector; - eigenvector = temp; - - var diff = 0; - // Compute difference (squared module) of both vectors - for (var i = 0; i < numNodes; i++) { - diff += Math.pow(previous[i] - eigenvector[i], 2); - } - - // If difference is less than the desired threshold, stop iterating - if (diff < epsilon) { - break; - } - } - - // Construct result - var res = { - rank: function rank(node) { - if (is.string(node)) { - // is a selector string - var nodeId = cy.filter(node)[0].id(); - } else { - // is a node object - var nodeId = node.id(); - } - return eigenvector[id2position[nodeId]]; - } - }; - - return res; - } // pageRank - -}; // elesfn - -module.exports = elesfn; - -/***/ }), -/* 40 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var util = __webpack_require__(1); - -var elesfn = { - - degreeCentralityNormalized: function degreeCentralityNormalized(options) { - options = options || {}; - - var cy = this.cy(); - - // directed - optional - if (options.directed != null) { - var directed = options.directed; - } else { - var directed = false; - } - - var nodes = this.nodes(); - var numNodes = nodes.length; - - if (!directed) { - var degrees = {}; - var maxDegree = 0; - - for (var i = 0; i < numNodes; i++) { - var node = nodes[i]; - // add current node to the current options object and call degreeCentrality - var currDegree = this.degreeCentrality(util.extend({}, options, { root: node })); - if (maxDegree < currDegree.degree) maxDegree = currDegree.degree; - - degrees[node.id()] = currDegree.degree; - } - - return { - degree: function degree(node) { - if (maxDegree == 0) return 0; - - if (is.string(node)) { - // from is a selector string - var node = cy.filter(node)[0].id(); - } else { - // from is a node - var node = node.id(); - } - - return degrees[node] / maxDegree; - } - }; - } else { - var indegrees = {}; - var outdegrees = {}; - var maxIndegree = 0; - var maxOutdegree = 0; - - for (var i = 0; i < numNodes; i++) { - var node = nodes[i]; - // add current node to the current options object and call degreeCentrality - var currDegree = this.degreeCentrality(util.extend({}, options, { root: node })); - - if (maxIndegree < currDegree.indegree) maxIndegree = currDegree.indegree; - - if (maxOutdegree < currDegree.outdegree) maxOutdegree = currDegree.outdegree; - - indegrees[node.id()] = currDegree.indegree; - outdegrees[node.id()] = currDegree.outdegree; - } - - return { - indegree: function indegree(node) { - if (maxIndegree == 0) return 0; - - if (is.string(node)) { - // from is a selector string - var node = cy.filter(node)[0].id(); - } else { - // from is a node - var node = node.id(); - } - - return indegrees[node] / maxIndegree; - }, - outdegree: function outdegree(node) { - if (maxOutdegree == 0) return 0; - - if (is.string(node)) { - // from is a selector string - var node = cy.filter(node)[0].id(); - } else { - // from is a node - var node = node.id(); - } - - return outdegrees[node] / maxOutdegree; - } - - }; - } - }, // degreeCentralityNormalized - - // Implemented from the algorithm in Opsahl's paper - // "Node centrality in weighted networks: Generalizing degree and shortest paths" - // check the heading 2 "Degree" - degreeCentrality: function degreeCentrality(options) { - options = options || {}; - - var callingEles = this; - - // root - mandatory! - if (options != null && options.root != null) { - var root = is.string(options.root) ? this.filter(options.root)[0] : options.root[0]; - } else { - return undefined; - } - - // weight - optional - if (options.weight != null && is.fn(options.weight)) { - var weightFn = options.weight; - } else { - // If not specified, assume each edge has equal weight (1) - var weightFn = function weightFn(e) { - return 1; - }; - } - - // directed - optional - if (options.directed != null) { - var directed = options.directed; - } else { - var directed = false; - } - - // alpha - optional - if (options.alpha != null && is.number(options.alpha)) { - var alpha = options.alpha; - } else { - alpha = 0; - } - - if (!directed) { - var connEdges = root.connectedEdges().intersection(callingEles); - var k = connEdges.length; - var s = 0; - - // Now, sum edge weights - for (var i = 0; i < connEdges.length; i++) { - var edge = connEdges[i]; - s += weightFn(edge); - } - - return { - degree: Math.pow(k, 1 - alpha) * Math.pow(s, alpha) - }; - } else { - var incoming = root.connectedEdges('edge[target = "' + root.id() + '"]').intersection(callingEles); - var outgoing = root.connectedEdges('edge[source = "' + root.id() + '"]').intersection(callingEles); - var k_in = incoming.length; - var k_out = outgoing.length; - var s_in = 0; - var s_out = 0; - - // Now, sum incoming edge weights - for (var i = 0; i < incoming.length; i++) { - var edge = incoming[i]; - s_in += weightFn(edge); - } - - // Now, sum outgoing edge weights - for (var i = 0; i < outgoing.length; i++) { - var edge = outgoing[i]; - s_out += weightFn(edge); - } - - return { - indegree: Math.pow(k_in, 1 - alpha) * Math.pow(s_in, alpha), - outdegree: Math.pow(k_out, 1 - alpha) * Math.pow(s_out, alpha) - }; - } - } // degreeCentrality - -}; // elesfn - -// nice, short mathemathical alias -elesfn.dc = elesfn.degreeCentrality; -elesfn.dcn = elesfn.degreeCentralityNormalised = elesfn.degreeCentralityNormalized; - -module.exports = elesfn; - -/***/ }), -/* 41 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); - -var elesfn = { - - closenessCentralityNormalized: function closenessCentralityNormalized(options) { - options = options || {}; - - var cy = this.cy(); - - var harmonic = options.harmonic; - if (harmonic === undefined) { - harmonic = true; - } - - var closenesses = {}; - var maxCloseness = 0; - var nodes = this.nodes(); - var fw = this.floydWarshall({ weight: options.weight, directed: options.directed }); - - // Compute closeness for every node and find the maximum closeness - for (var i = 0; i < nodes.length; i++) { - var currCloseness = 0; - for (var j = 0; j < nodes.length; j++) { - if (i != j) { - var d = fw.distance(nodes[i], nodes[j]); - - if (harmonic) { - currCloseness += 1 / d; - } else { - currCloseness += d; - } - } - } - - if (!harmonic) { - currCloseness = 1 / currCloseness; - } - - if (maxCloseness < currCloseness) { - maxCloseness = currCloseness; - } - - closenesses[nodes[i].id()] = currCloseness; - } - - return { - closeness: function closeness(node) { - if (maxCloseness == 0) { - return 0; - } - - if (is.string(node)) { - // from is a selector string - var node = cy.filter(node)[0].id(); - } else { - // from is a node - var node = node.id(); - } - - return closenesses[node] / maxCloseness; - } - }; - }, - - // Implemented from pseudocode from wikipedia - closenessCentrality: function closenessCentrality(options) { - options = options || {}; - - // root - mandatory! - if (options.root != null) { - if (is.string(options.root)) { - // use it as a selector, e.g. "#rootID - var root = this.filter(options.root)[0]; - } else { - var root = options.root[0]; - } - } else { - return undefined; - } - - // weight - optional - if (options.weight != null && is.fn(options.weight)) { - var weight = options.weight; - } else { - var weight = function weight() { - return 1; - }; - } - - // directed - optional - if (options.directed != null && is.bool(options.directed)) { - var directed = options.directed; - } else { - var directed = false; - } - - var harmonic = options.harmonic; - if (harmonic === undefined) { - harmonic = true; - } - - // we need distance from this node to every other node - var dijkstra = this.dijkstra({ - root: root, - weight: weight, - directed: directed - }); - var totalDistance = 0; - - var nodes = this.nodes(); - for (var i = 0; i < nodes.length; i++) { - if (nodes[i].id() != root.id()) { - var d = dijkstra.distanceTo(nodes[i]); - - if (harmonic) { - totalDistance += 1 / d; - } else { - totalDistance += d; - } - } - } - - return harmonic ? totalDistance : 1 / totalDistance; - } // closenessCentrality - -}; // elesfn - -// nice, short mathemathical alias -elesfn.cc = elesfn.closenessCentrality; -elesfn.ccn = elesfn.closenessCentralityNormalised = elesfn.closenessCentralityNormalized; - -module.exports = elesfn; - -/***/ }), -/* 42 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var Heap = __webpack_require__(9); - -var elesfn = { - - // Implemented from the algorithm in the paper "On Variants of Shortest-Path Betweenness Centrality and their Generic Computation" by Ulrik Brandes - betweennessCentrality: function betweennessCentrality(options) { - options = options || {}; - - // Weight - optional - var weighted, weightFn; - if (is.fn(options.weight)) { - weightFn = options.weight; - weighted = true; - } else { - weighted = false; - } - - // Directed - default false - var directed = options.directed != null ? options.directed : false; - - var cy = this._private.cy; - - // starting - var V = this.nodes(); - var A = {}; - var _C = {}; - var max = 0; - var C = { - set: function set(key, val) { - _C[key] = val; - - if (val > max) { - max = val; - } - }, - - get: function get(key) { - return _C[key]; - } - }; - - // A contains the neighborhoods of every node - for (var i = 0; i < V.length; i++) { - var v = V[i]; - var vid = v.id(); - - if (directed) { - A[vid] = v.outgoers().nodes(); // get outgoers of every node - } else { - A[vid] = v.openNeighborhood().nodes(); // get neighbors of every node - } - - C.set(vid, 0); - } - - for (var s = 0; s < V.length; s++) { - var sid = V[s].id(); - var S = []; // stack - var P = {}; - var g = {}; - var d = {}; - var Q = new Heap(function (a, b) { - return d[a] - d[b]; - }); // queue - - // init dictionaries - for (var i = 0; i < V.length; i++) { - var vid = V[i].id(); - - P[vid] = []; - g[vid] = 0; - d[vid] = Infinity; - } - - g[sid] = 1; // sigma - d[sid] = 0; // distance to s - - Q.push(sid); - - while (!Q.empty()) { - var v = Q.pop(); - - S.push(v); - - if (weighted) { - for (var j = 0; j < A[v].length; j++) { - var w = A[v][j]; - var vEle = cy.getElementById(v); - - var edge; - if (vEle.edgesTo(w).length > 0) { - edge = vEle.edgesTo(w)[0]; - } else { - edge = w.edgesTo(vEle)[0]; - } - - var edgeWeight = weightFn(edge); - - w = w.id(); - - if (d[w] > d[v] + edgeWeight) { - d[w] = d[v] + edgeWeight; - - if (Q.nodes.indexOf(w) < 0) { - //if w is not in Q - Q.push(w); - } else { - // update position if w is in Q - Q.updateItem(w); - } - - g[w] = 0; - P[w] = []; - } - - if (d[w] == d[v] + edgeWeight) { - g[w] = g[w] + g[v]; - P[w].push(v); - } - } - } else { - for (var j = 0; j < A[v].length; j++) { - var w = A[v][j].id(); - - if (d[w] == Infinity) { - Q.push(w); - - d[w] = d[v] + 1; - } - - if (d[w] == d[v] + 1) { - g[w] = g[w] + g[v]; - P[w].push(v); - } - } - } - } - - var e = {}; - for (var i = 0; i < V.length; i++) { - e[V[i].id()] = 0; - } - - while (S.length > 0) { - var w = S.pop(); - - for (var j = 0; j < P[w].length; j++) { - var v = P[w][j]; - - e[v] = e[v] + g[v] / g[w] * (1 + e[w]); - - if (w != V[s].id()) { - C.set(w, C.get(w) + e[w]); - } - } - } - } - - var ret = { - betweenness: function betweenness(node) { - if (is.string(node)) { - var node = cy.filter(node).id(); - } else { - var node = node.id(); - } - - return C.get(node); - }, - - betweennessNormalized: function betweennessNormalized(node) { - if (max == 0) return 0; - - if (is.string(node)) { - var node = cy.filter(node).id(); - } else { - var node = node.id(); - } - - return C.get(node) / max; - } - }; - - // alias - ret.betweennessNormalised = ret.betweennessNormalized; - - return ret; - } // betweennessCentrality - -}; // elesfn - -// nice, short mathemathical alias -elesfn.bc = elesfn.betweennessCentrality; - -module.exports = elesfn; - -/***/ }), -/* 43 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var define = __webpack_require__(4); - -var elesfn = { - animate: define.animate(), - animation: define.animation(), - animated: define.animated(), - clearQueue: define.clearQueue(), - delay: define.delay(), - delayAnimation: define.delayAnimation(), - stop: define.stop() -}; - -module.exports = elesfn; - -/***/ }), -/* 44 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var Animation = __webpack_require__(45); -var math = __webpack_require__(2); -var is = __webpack_require__(0); - -var define = { - - animated: function animated() { - return function animatedImpl() { - var self = this; - var selfIsArrayLike = self.length !== undefined; - var all = selfIsArrayLike ? self : [self]; // put in array if not array-like - var cy = this._private.cy || this; - - if (!cy.styleEnabled()) { - return false; - } - - var ele = all[0]; - - if (ele) { - return ele._private.animation.current.length > 0; - } - }; - }, // animated - - clearQueue: function clearQueue() { - return function clearQueueImpl() { - var self = this; - var selfIsArrayLike = self.length !== undefined; - var all = selfIsArrayLike ? self : [self]; // put in array if not array-like - var cy = this._private.cy || this; - - if (!cy.styleEnabled()) { - return this; - } - - for (var i = 0; i < all.length; i++) { - var ele = all[i]; - ele._private.animation.queue = []; - } - - return this; - }; - }, // clearQueue - - delay: function delay() { - return function delayImpl(time, complete) { - var cy = this._private.cy || this; - - if (!cy.styleEnabled()) { - return this; - } - - return this.animate({ - delay: time, - duration: time, - complete: complete - }); - }; - }, // delay - - delayAnimation: function delayAnimation() { - return function delayAnimationImpl(time, complete) { - var cy = this._private.cy || this; - - if (!cy.styleEnabled()) { - return this; - } - - return this.animation({ - delay: time, - duration: time, - complete: complete - }); - }; - }, // delay - - animation: function animation() { - return function animationImpl(properties, params) { - var self = this; - var selfIsArrayLike = self.length !== undefined; - var all = selfIsArrayLike ? self : [self]; // put in array if not array-like - var cy = this._private.cy || this; - var isCore = !selfIsArrayLike; - var isEles = !isCore; - - if (!cy.styleEnabled()) { - return this; - } - - var style = cy.style(); - - properties = util.assign({}, properties, params); - - var propertiesEmpty = Object.keys(properties).length === 0; - - if (propertiesEmpty) { - return new Animation(all[0], properties); // nothing to animate - } - - if (properties.duration === undefined) { - properties.duration = 400; - } - - switch (properties.duration) { - case 'slow': - properties.duration = 600; - break; - case 'fast': - properties.duration = 200; - break; - } - - if (isEles) { - properties.style = style.getPropsList(properties.style || properties.css); - - properties.css = undefined; - } - - if (isEles && properties.renderedPosition != null) { - var rpos = properties.renderedPosition; - var pan = cy.pan(); - var zoom = cy.zoom(); - - properties.position = math.renderedToModelPosition(rpos, zoom, pan); - } - - // override pan w/ panBy if set - if (isCore && properties.panBy != null) { - var panBy = properties.panBy; - var cyPan = cy.pan(); - - properties.pan = { - x: cyPan.x + panBy.x, - y: cyPan.y + panBy.y - }; - } - - // override pan w/ center if set - var center = properties.center || properties.centre; - if (isCore && center != null) { - var centerPan = cy.getCenterPan(center.eles, properties.zoom); - - if (centerPan != null) { - properties.pan = centerPan; - } - } - - // override pan & zoom w/ fit if set - if (isCore && properties.fit != null) { - var fit = properties.fit; - var fitVp = cy.getFitViewport(fit.eles || fit.boundingBox, fit.padding); - - if (fitVp != null) { - properties.pan = fitVp.pan; - properties.zoom = fitVp.zoom; - } - } - - // override zoom (& potentially pan) w/ zoom obj if set - if (isCore && is.plainObject(properties.zoom)) { - var vp = cy.getZoomedViewport(properties.zoom); - - if (vp != null) { - if (vp.zoomed) { - properties.zoom = vp.zoom; - } - - if (vp.panned) { - properties.pan = vp.pan; - } - } - } - - return new Animation(all[0], properties); - }; - }, // animate - - animate: function animate() { - return function animateImpl(properties, params) { - var self = this; - var selfIsArrayLike = self.length !== undefined; - var all = selfIsArrayLike ? self : [self]; // put in array if not array-like - var cy = this._private.cy || this; - - if (!cy.styleEnabled()) { - return this; - } - - if (params) { - properties = util.extend({}, properties, params); - } - - // manually hook and run the animation - for (var i = 0; i < all.length; i++) { - var ele = all[i]; - var queue = ele.animated() && (properties.queue === undefined || properties.queue); - - var ani = ele.animation(properties, queue ? { queue: true } : undefined); - - ani.play(); - } - - return this; // chaining - }; - }, // animate - - stop: function stop() { - return function stopImpl(clearQueue, jumpToEnd) { - var self = this; - var selfIsArrayLike = self.length !== undefined; - var all = selfIsArrayLike ? self : [self]; // put in array if not array-like - var cy = this._private.cy || this; - - if (!cy.styleEnabled()) { - return this; - } - - for (var i = 0; i < all.length; i++) { - var ele = all[i]; - var _p = ele._private; - var anis = _p.animation.current; - - for (var j = 0; j < anis.length; j++) { - var ani = anis[j]; - var ani_p = ani._private; - - if (jumpToEnd) { - // next iteration of the animation loop, the animation - // will go straight to the end and be removed - ani_p.duration = 0; - } - } - - // clear the queue of future animations - if (clearQueue) { - _p.animation.queue = []; - } - - if (!jumpToEnd) { - _p.animation.current = []; - } - } - - // we have to notify (the animation loop doesn't do it for us on `stop`) - cy.notify({ - eles: this, - type: 'draw' - }); - - return this; - }; - } // stop - -}; // define - -module.exports = define; - -/***/ }), -/* 45 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var is = __webpack_require__(0); -var Promise = __webpack_require__(5); - -var Animation = function Animation(target, opts, opts2) { - var _p = this._private = util.extend({ - duration: 1000 - }, opts, opts2); - - _p.target = target; - _p.style = _p.style || _p.css; - _p.started = false; - _p.playing = false; - _p.hooked = false; - _p.applying = false; - _p.progress = 0; - _p.completes = []; - _p.frames = []; - - if (_p.complete && is.fn(_p.complete)) { - _p.completes.push(_p.complete); - } - - // for future timeline/animations impl - this.length = 1; - this[0] = this; -}; - -var anifn = Animation.prototype; - -util.extend(anifn, { - - instanceString: function instanceString() { - return 'animation'; - }, - - hook: function hook() { - var _p = this._private; - - if (!_p.hooked) { - // add to target's animation queue - var q = void 0; - var tAni = _p.target._private.animation; - if (_p.queue) { - q = tAni.queue; - } else { - q = tAni.current; - } - q.push(this); - - // add to the animation loop pool - if (is.elementOrCollection(_p.target)) { - _p.target.cy().addToAnimationPool(_p.target); - } - - _p.hooked = true; - } - - return this; - }, - - play: function play() { - var _p = this._private; - - // autorewind - if (_p.progress === 1) { - _p.progress = 0; - } - - _p.playing = true; - _p.started = false; // needs to be started by animation loop - _p.stopped = false; - - this.hook(); - - // the animation loop will start the animation... - - return this; - }, - - playing: function playing() { - return this._private.playing; - }, - - apply: function apply() { - var _p = this._private; - - _p.applying = true; - _p.started = false; // needs to be started by animation loop - _p.stopped = false; - - this.hook(); - - // the animation loop will apply the animation at this progress - - return this; - }, - - applying: function applying() { - return this._private.applying; - }, - - pause: function pause() { - var _p = this._private; - - _p.playing = false; - _p.started = false; - - return this; - }, - - stop: function stop() { - var _p = this._private; - - _p.playing = false; - _p.started = false; - _p.stopped = true; // to be removed from animation queues - - return this; - }, - - rewind: function rewind() { - return this.progress(0); - }, - - fastforward: function fastforward() { - return this.progress(1); - }, - - time: function time(t) { - var _p = this._private; - - if (t === undefined) { - return _p.progress * _p.duration; - } else { - return this.progress(t / _p.duration); - } - }, - - progress: function progress(p) { - var _p = this._private; - var wasPlaying = _p.playing; - - if (p === undefined) { - return _p.progress; - } else { - if (wasPlaying) { - this.pause(); - } - - _p.progress = p; - _p.started = false; - - if (wasPlaying) { - this.play(); - } - } - - return this; - }, - - completed: function completed() { - return this._private.progress === 1; - }, - - reverse: function reverse() { - var _p = this._private; - var wasPlaying = _p.playing; - - if (wasPlaying) { - this.pause(); - } - - _p.progress = 1 - _p.progress; - _p.started = false; - - var swap = function swap(a, b) { - var _pa = _p[a]; - - if (_pa == null) { - return; - } - - _p[a] = _p[b]; - _p[b] = _pa; - }; - - swap('zoom', 'startZoom'); - swap('pan', 'startPan'); - swap('position', 'startPosition'); - - // swap styles - if (_p.style) { - for (var i = 0; i < _p.style.length; i++) { - var prop = _p.style[i]; - var name = prop.name; - var startStyleProp = _p.startStyle[name]; - - _p.startStyle[name] = prop; - _p.style[i] = startStyleProp; - } - } - - if (wasPlaying) { - this.play(); - } - - return this; - }, - - promise: function promise(type) { - var _p = this._private; - - var arr = void 0; - - switch (type) { - case 'frame': - arr = _p.frames; - break; - default: - case 'complete': - case 'completed': - arr = _p.completes; - } - - return new Promise(function (resolve, reject) { - arr.push(function () { - resolve(); - }); - }); - } - -}); - -anifn.complete = anifn.completed; - -module.exports = Animation; - -/***/ }), -/* 46 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -var util = __webpack_require__(1); -var is = __webpack_require__(0); - -var define = { - - // access data field - data: function data(params) { - var defaults = { - field: 'data', - bindingEvent: 'data', - allowBinding: false, - allowSetting: false, - allowGetting: false, - settingEvent: 'data', - settingTriggersEvent: false, - triggerFnName: 'trigger', - immutableKeys: {}, // key => true if immutable - updateStyle: false, - beforeGet: function beforeGet(self) {}, - beforeSet: function beforeSet(self, obj) {}, - onSet: function onSet(self) {}, - canSet: function canSet(self) { - return true; - } - }; - params = util.extend({}, defaults, params); - - return function dataImpl(name, value) { - var p = params; - var self = this; - var selfIsArrayLike = self.length !== undefined; - var all = selfIsArrayLike ? self : [self]; // put in array if not array-like - var single = selfIsArrayLike ? self[0] : self; - - // .data('foo', ...) - if (is.string(name)) { - // set or get property - - // .data('foo') - if (p.allowGetting && value === undefined) { - // get - - var ret = void 0; - if (single) { - p.beforeGet(single); - - ret = single._private[p.field][name]; - } - return ret; - - // .data('foo', 'bar') - } else if (p.allowSetting && value !== undefined) { - // set - var valid = !p.immutableKeys[name]; - if (valid) { - var change = _defineProperty({}, name, value); - - p.beforeSet(self, change); - - for (var i = 0, l = all.length; i < l; i++) { - var ele = all[i]; - - if (p.canSet(ele)) { - ele._private[p.field][name] = value; - } - } - - // update mappers if asked - if (p.updateStyle) { - self.updateStyle(); - } - - // call onSet callback - p.onSet(self); - - if (p.settingTriggersEvent) { - self[p.triggerFnName](p.settingEvent); - } - } - } - - // .data({ 'foo': 'bar' }) - } else if (p.allowSetting && is.plainObject(name)) { - // extend - var obj = name; - var k = void 0, - v = void 0; - var keys = Object.keys(obj); - - p.beforeSet(self, obj); - - for (var _i = 0; _i < keys.length; _i++) { - k = keys[_i]; - v = obj[k]; - - var _valid = !p.immutableKeys[k]; - if (_valid) { - for (var j = 0; j < all.length; j++) { - var _ele = all[j]; - - if (p.canSet(_ele)) { - _ele._private[p.field][k] = v; - } - } - } - } - - // update mappers if asked - if (p.updateStyle) { - self.updateStyle(); - } - - // call onSet callback - p.onSet(self); - - if (p.settingTriggersEvent) { - self[p.triggerFnName](p.settingEvent); - } - - // .data(function(){ ... }) - } else if (p.allowBinding && is.fn(name)) { - // bind to event - var fn = name; - self.on(p.bindingEvent, fn); - - // .data() - } else if (p.allowGetting && name === undefined) { - // get whole object - var _ret = void 0; - if (single) { - p.beforeGet(single); - - _ret = single._private[p.field]; - } - return _ret; - } - - return self; // maintain chainability - }; // function - }, // data - - // remove data field - removeData: function removeData(params) { - var defaults = { - field: 'data', - event: 'data', - triggerFnName: 'trigger', - triggerEvent: false, - immutableKeys: {} // key => true if immutable - }; - params = util.extend({}, defaults, params); - - return function removeDataImpl(names) { - var p = params; - var self = this; - var selfIsArrayLike = self.length !== undefined; - var all = selfIsArrayLike ? self : [self]; // put in array if not array-like - - // .removeData('foo bar') - if (is.string(names)) { - // then get the list of keys, and delete them - var keys = names.split(/\s+/); - var l = keys.length; - - for (var i = 0; i < l; i++) { - // delete each non-empty key - var key = keys[i]; - if (is.emptyString(key)) { - continue; - } - - var valid = !p.immutableKeys[key]; // not valid if immutable - if (valid) { - for (var i_a = 0, l_a = all.length; i_a < l_a; i_a++) { - all[i_a]._private[p.field][key] = undefined; - } - } - } - - if (p.triggerEvent) { - self[p.triggerFnName](p.event); - } - - // .removeData() - } else if (names === undefined) { - // then delete all keys - - for (var _i_a = 0, _l_a = all.length; _i_a < _l_a; _i_a++) { - var _privateFields = all[_i_a]._private[p.field]; - var _keys = Object.keys(_privateFields); - - for (var _i2 = 0; _i2 < _keys.length; _i2++) { - var _key = _keys[_i2]; - var validKeyToDelete = !p.immutableKeys[_key]; - - if (validKeyToDelete) { - _privateFields[_key] = undefined; - } - } - } - - if (p.triggerEvent) { - self[p.triggerFnName](p.event); - } - } - - return self; // maintain chaining - }; // function - } // removeData -}; // define - -module.exports = define; - -/***/ }), -/* 47 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Promise = __webpack_require__(5); - -var define = { - - eventAliasesOn: function eventAliasesOn(proto) { - var p = proto; - - p.addListener = p.listen = p.bind = p.on; - p.unlisten = p.unbind = p.off = p.removeListener; - p.trigger = p.emit; - - // this is just a wrapper alias of .on() - p.pon = p.promiseOn = function (events, selector) { - var self = this; - var args = Array.prototype.slice.call(arguments, 0); - - return new Promise(function (resolve, reject) { - var callback = function callback(e) { - self.off.apply(self, offArgs); - - resolve(e); - }; - - var onArgs = args.concat([callback]); - var offArgs = onArgs.concat([]); - - self.on.apply(self, onArgs); - }); - }; - } - -}; // define - -module.exports = define; - -/***/ }), -/* 48 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Set = __webpack_require__(8); - -var elesfn = { - classes: function classes(_classes) { - _classes = (_classes || '').match(/\S+/g) || []; - var self = this; - var changed = []; - var classesMap = new Set(_classes); - - // check and update each ele - - var _loop = function _loop(j) { - var ele = self[j]; - var _p = ele._private; - var eleClasses = _p.classes; - var changedEle = false; - - // check if ele has all of the passed classes - classesMap.forEach(function (cls) { - var eleHasClass = eleClasses.has(cls); - - if (!eleHasClass) { - changedEle = true; - } - }); - - // check if ele has classes outside of those passed - if (!changedEle) { - eleClasses.forEach(function (eleCls) { - var specdClass = classesMap.has(eleCls); - - if (!specdClass) { - changedEle = true; - } - }); - } - - if (changedEle) { - _p.classes = new Set(classesMap); - - changed.push(ele); - } - }; - - for (var j = 0; j < self.length; j++) { - _loop(j); - } - - // trigger update style on those eles that had class changes - if (changed.length > 0) { - this.spawn(changed).updateStyle().emit('class'); - } - - return self; - }, - - addClass: function addClass(classes) { - return this.toggleClass(classes, true); - }, - - hasClass: function hasClass(className) { - var ele = this[0]; - return ele != null && ele._private.classes.has(className); - }, - - toggleClass: function toggleClass(classesStr, toggle) { - var classes = classesStr.match(/\S+/g) || []; - var self = this; - var changed = []; // eles who had classes changed - - for (var i = 0, il = self.length; i < il; i++) { - var _ele = self[i]; - var _changedEle = false; - - for (var j = 0; j < classes.length; j++) { - var cls = classes[j]; - var _eleClasses = _ele._private.classes; - var hasClass = _eleClasses.has(cls); - var shouldAdd = toggle || toggle === undefined && !hasClass; - - if (shouldAdd) { - _eleClasses.add(cls); - - if (!hasClass && !_changedEle) { - changed.push(_ele); - _changedEle = true; - } - } else { - // then remove - _eleClasses.delete(cls); - - if (hasClass && !_changedEle) { - changed.push(_ele); - _changedEle = true; - } - } - } // for j classes - } // for i eles - - // trigger update style on those eles that had class changes - if (changed.length > 0) { - this.spawn(changed).updateStyle().emit('class'); - } - - return self; - }, - - removeClass: function removeClass(classes) { - return this.toggleClass(classes, false); - }, - - flashClass: function flashClass(classes, duration) { - var self = this; - - if (duration == null) { - duration = 250; - } else if (duration === 0) { - return self; // nothing to do really - } - - self.addClass(classes); - setTimeout(function () { - self.removeClass(classes); - }, duration); - - return self; - } -}; - -module.exports = elesfn; - -/***/ }), -/* 49 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var Selector = __webpack_require__(6); - -var elesfn = { - allAre: function allAre(selector) { - var selObj = new Selector(selector); - - return this.every(function (ele) { - return selObj.matches(ele); - }); - }, - - is: function is(selector) { - var selObj = new Selector(selector); - - return this.some(function (ele) { - return selObj.matches(ele); - }); - }, - - some: function some(fn, thisArg) { - for (var i = 0; i < this.length; i++) { - var ret = !thisArg ? fn(this[i], i, this) : fn.apply(thisArg, [this[i], i, this]); - - if (ret) { - return true; - } - } - - return false; - }, - - every: function every(fn, thisArg) { - for (var i = 0; i < this.length; i++) { - var ret = !thisArg ? fn(this[i], i, this) : fn.apply(thisArg, [this[i], i, this]); - - if (!ret) { - return false; - } - } - - return true; - }, - - same: function same(collection) { - collection = this.cy().collection(collection); - - // cheap extra check - if (this.length !== collection.length) { - return false; - } - - return this.every(function (ele) { - return collection.hasElementWithId(ele.id()); - }); - }, - - anySame: function anySame(collection) { - collection = this.cy().collection(collection); - - return this.some(function (ele) { - return collection.hasElementWithId(ele.id()); - }); - }, - - allAreNeighbors: function allAreNeighbors(collection) { - collection = this.cy().collection(collection); - - var nhood = this.neighborhood(); - - return collection.every(function (ele) { - return nhood.hasElementWithId(ele.id()); - }); - }, - - contains: function contains(collection) { - collection = this.cy().collection(collection); - - var self = this; - - return collection.every(function (ele) { - return self.hasElementWithId(ele.id()); - }); - } -}; - -elesfn.allAreNeighbours = elesfn.allAreNeighbors; -elesfn.has = elesfn.contains; - -module.exports = elesfn; - -/***/ }), -/* 50 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var exprs = __webpack_require__(51); -var newQuery = __webpack_require__(10); - -// of all the expressions, find the first match in the remaining text -var consumeExpr = function consumeExpr(remaining) { - var expr = void 0; - var match = void 0; - var name = void 0; - - for (var j = 0; j < exprs.length; j++) { - var e = exprs[j]; - var n = e.name; - - var m = remaining.match(e.regexObj); - - if (m != null) { - match = m; - expr = e; - name = n; - - var consumed = m[0]; - remaining = remaining.substring(consumed.length); - - break; // we've consumed one expr, so we can return now - } - } - - return { - expr: expr, - match: match, - name: name, - remaining: remaining - }; -}; - -// consume all leading whitespace -var consumeWhitespace = function consumeWhitespace(remaining) { - var match = remaining.match(/^\s+/); - - if (match) { - var consumed = match[0]; - remaining = remaining.substring(consumed.length); - } - - return remaining; -}; - -var parse = function parse(selector) { - var self = this; - - var remaining = self._private.selectorText = selector; - - var currentQuery = self[0] = newQuery(); - self.length = 1; - - remaining = consumeWhitespace(remaining); // get rid of leading whitespace - - for (;;) { - var check = consumeExpr(remaining); - - if (check.expr == null) { - util.error('The selector `' + selector + '`is invalid'); - return false; - } else { - var args = check.match.slice(1); - - // let the token populate the selector object in currentQuery - var ret = check.expr.populate(self, currentQuery, args); - - if (ret === false) { - return false; // exit if population failed - } else if (ret != null) { - currentQuery = ret; // change the current query to be filled if the expr specifies - } - } - - remaining = check.remaining; - - // we're done when there's nothing left to parse - if (remaining.match(/^\s*$/)) { - break; - } - } - - // adjust references for subject - for (var j = 0; j < self.length; j++) { - var query = self[j]; - - if (query.subject != null) { - // go up the tree until we reach the subject - for (;;) { - if (query.subject === query) { - break; - } // done if subject is self - - if (query.parent != null) { - // swap parent/child reference - var parent = query.parent; - var child = query; - - child.parent = null; - parent.child = child; - - query = parent; // go up the tree - } else if (query.ancestor != null) { - // swap ancestor/descendant - var ancestor = query.ancestor; - var descendant = query; - - descendant.ancestor = null; - ancestor.descendant = descendant; - - query = ancestor; // go up the tree - } else if (query.source || query.target || query.connectedNodes) { - util.error('The selector `' + self.text() + '` can not contain a subject selector that applies to the source or target of an edge selector'); - return false; - } else { - util.error('When adjusting references for the selector `' + self.text() + '`, neither parent nor ancestor was found'); - return false; - } - } // for - - self[j] = query.subject; // subject should be the root query - } // if - } // for - - return true; // success -}; - -module.exports = { parse: parse }; - -/***/ }), -/* 51 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _slicedToArray = function () { function sliceIterator(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"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -var _require = __webpack_require__(15), - stateSelectorRegex = _require.stateSelectorRegex; - -var tokens = __webpack_require__(52); -var util = __webpack_require__(1); -var newQuery = __webpack_require__(10); - -// when a token like a variable has escaped meta characters, we need to clean the backslashes out -// so that values get compared properly in Selector.filter() -var cleanMetaChars = function cleanMetaChars(str) { - return str.replace(new RegExp('\\\\(' + tokens.metaChar + ')', 'g'), function (match, $1) { - return $1; - }); -}; - -var replaceLastQuery = function replaceLastQuery(selector, examiningQuery, replacementQuery) { - if (examiningQuery === selector[selector.length - 1]) { - selector[selector.length - 1] = replacementQuery; - } -}; - -// NOTE: add new expression syntax here to have it recognised by the parser; -// - a query contains all adjacent (i.e. no separator in between) expressions; -// - the current query is stored in selector[i] --- you can use the reference to `this` in the populate function; -// - you need to check the query objects in Selector.filter() for it actually filter properly, but that's pretty straight forward -// - when you add something here, also add to Selector.toString() -var exprs = [{ - name: 'group', - query: true, - regex: '(' + tokens.group + ')', - populate: function populate(selector, query, _ref) { - var _ref2 = _slicedToArray(_ref, 1), - group = _ref2[0]; - - query.group = group === '*' ? group : group + 's'; - } -}, { - name: 'state', - query: true, - regex: stateSelectorRegex, - populate: function populate(selector, query, _ref3) { - var _ref4 = _slicedToArray(_ref3, 1), - state = _ref4[0]; - - query.colonSelectors.push(state); - } -}, { - name: 'id', - query: true, - regex: '\\#(' + tokens.id + ')', - populate: function populate(selector, query, _ref5) { - var _ref6 = _slicedToArray(_ref5, 1), - id = _ref6[0]; - - query.ids.push(cleanMetaChars(id)); - } -}, { - name: 'className', - query: true, - regex: '\\.(' + tokens.className + ')', - populate: function populate(selector, query, _ref7) { - var _ref8 = _slicedToArray(_ref7, 1), - className = _ref8[0]; - - query.classes.push(cleanMetaChars(className)); - } -}, { - name: 'dataExists', - query: true, - regex: '\\[\\s*(' + tokens.variable + ')\\s*\\]', - populate: function populate(selector, query, _ref9) { - var _ref10 = _slicedToArray(_ref9, 1), - variable = _ref10[0]; - - query.data.push({ - field: cleanMetaChars(variable) - }); - } -}, { - name: 'dataCompare', - query: true, - regex: '\\[\\s*(' + tokens.variable + ')\\s*(' + tokens.comparatorOp + ')\\s*(' + tokens.value + ')\\s*\\]', - populate: function populate(selector, query, _ref11) { - var _ref12 = _slicedToArray(_ref11, 3), - variable = _ref12[0], - comparatorOp = _ref12[1], - value = _ref12[2]; - - var valueIsString = new RegExp('^' + tokens.string + '$').exec(value) != null; - - if (valueIsString) { - value = value.substring(1, value.length - 1); - } else { - value = parseFloat(value); - } - - query.data.push({ - field: cleanMetaChars(variable), - operator: comparatorOp, - value: value - }); - } -}, { - name: 'dataBool', - query: true, - regex: '\\[\\s*(' + tokens.boolOp + ')\\s*(' + tokens.variable + ')\\s*\\]', - populate: function populate(selector, query, _ref13) { - var _ref14 = _slicedToArray(_ref13, 2), - boolOp = _ref14[0], - variable = _ref14[1]; - - query.data.push({ - field: cleanMetaChars(variable), - operator: boolOp - }); - } -}, { - name: 'metaCompare', - query: true, - regex: '\\[\\[\\s*(' + tokens.meta + ')\\s*(' + tokens.comparatorOp + ')\\s*(' + tokens.number + ')\\s*\\]\\]', - populate: function populate(selector, query, _ref15) { - var _ref16 = _slicedToArray(_ref15, 3), - meta = _ref16[0], - comparatorOp = _ref16[1], - number = _ref16[2]; - - query.meta.push({ - field: cleanMetaChars(meta), - operator: comparatorOp, - value: parseFloat(number) - }); - } -}, { - name: 'nextQuery', - separator: true, - regex: tokens.separator, - populate: function populate(selector) { - // go on to next query - var nextQuery = selector[selector.length++] = newQuery(); - selector.currentSubject = null; - - return nextQuery; - } -}, { - name: 'directedEdge', - separator: true, - regex: tokens.directedEdge, - populate: function populate(selector, query) { - var edgeQuery = newQuery(); - var source = query; - var target = newQuery(); - - edgeQuery.group = 'edges'; - edgeQuery.target = target; - edgeQuery.source = source; - edgeQuery.subject = selector.currentSubject; - - // the query in the selector should be the edge rather than the source - replaceLastQuery(selector, query, edgeQuery); - - // we're now populating the target query with expressions that follow - return target; - } -}, { - name: 'undirectedEdge', - separator: true, - regex: tokens.undirectedEdge, - populate: function populate(selector, query) { - var edgeQuery = newQuery(); - var source = query; - var target = newQuery(); - - edgeQuery.group = 'edges'; - edgeQuery.connectedNodes = [source, target]; - edgeQuery.subject = selector.currentSubject; - - // the query in the selector should be the edge rather than the source - replaceLastQuery(selector, query, edgeQuery); - - // we're now populating the target query with expressions that follow - return target; - } -}, { - name: 'child', - separator: true, - regex: tokens.child, - populate: function populate(selector, query) { - // this query is the parent of the following query - var childQuery = newQuery(); - childQuery.parent = query; - childQuery.subject = selector.currentSubject; - - // it's cheaper to compare children first and go up so replace the parent - replaceLastQuery(selector, query, childQuery); - - // we're now populating the child query with expressions that follow - return childQuery; - } -}, { - name: 'descendant', - separator: true, - regex: tokens.descendant, - populate: function populate(selector, query) { - // this query is the ancestor of the following query - var descendantQuery = newQuery(); - descendantQuery.ancestor = query; - descendantQuery.subject = selector.currentSubject; - - // it's cheaper to compare descendants first and go up so replace the ancestor - replaceLastQuery(selector, query, descendantQuery); - - // we're now populating the descendant query with expressions that follow - return descendantQuery; - } -}, { - name: 'subject', - modifier: true, - regex: tokens.subject, - populate: function populate(selector, query) { - if (selector.currentSubject != null && query.subject != query) { - util.error('Redefinition of subject in selector `' + selector.toString() + '`'); - return false; - } - - selector.currentSubject = query; - query.subject = query; - selector[selector.length - 1].subject = query; - } -}]; - -exprs.forEach(function (e) { - return e.regexObj = new RegExp('^' + e.regex); -}); - -module.exports = exprs; - -/***/ }), -/* 52 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); - -// tokens in the query language -var tokens = { - metaChar: '[\\!\\"\\#\\$\\%\\&\\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]', // chars we need to escape in let names, etc - comparatorOp: '=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=', // binary comparison op (used in data selectors) - boolOp: '\\?|\\!|\\^', // boolean (unary) operators (used in data selectors) - string: '"(?:\\\\"|[^"])*"' + '|' + "'(?:\\\\'|[^'])*'", // string literals (used in data selectors) -- doublequotes | singlequotes - number: util.regex.number, // number literal (used in data selectors) --- e.g. 0.1234, 1234, 12e123 - meta: 'degree|indegree|outdegree', // allowed metadata fields (i.e. allowed functions to use from Collection) - separator: '\\s*,\\s*', // queries are separated by commas, e.g. edge[foo = 'bar'], node.someClass - descendant: '\\s+', - child: '\\s+>\\s+', - subject: '\\$', - group: 'node|edge|\\*', - directedEdge: '\\s+->\\s+', - undirectedEdge: '\\s+<->\\s+' -}; -tokens.variable = '(?:[\\w-]|(?:\\\\' + tokens.metaChar + '))+'; // a variable name -tokens.value = tokens.string + '|' + tokens.number; // a value literal, either a string or number -tokens.className = tokens.variable; // a class name (follows variable conventions) -tokens.id = tokens.variable; // an element id (follows variable conventions) - -(function () { - var ops = void 0, - op = void 0, - i = void 0; - - // add @ variants to comparatorOp - ops = tokens.comparatorOp.split('|'); - for (i = 0; i < ops.length; i++) { - op = ops[i]; - tokens.comparatorOp += '|@' + op; - } - - // add ! variants to comparatorOp - ops = tokens.comparatorOp.split('|'); - for (i = 0; i < ops.length; i++) { - op = ops[i]; - - if (op.indexOf('!') >= 0) { - continue; - } // skip ops that explicitly contain ! - if (op === '=') { - continue; - } // skip = b/c != is explicitly defined - - tokens.comparatorOp += '|\\!' + op; - } -})(); - -module.exports = tokens; - -/***/ }), -/* 53 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _require = __webpack_require__(15), - stateSelectorMatches = _require.stateSelectorMatches; - -var is = __webpack_require__(0); - -// generic checking for data/metadata -var operandsMatch = function operandsMatch(query, params) { - var allDataMatches = true; - for (var k = 0; k < query[params.name].length; k++) { - var data = query[params.name][k]; - var operator = data.operator; - var value = data.value; - var field = data.field; - var _matches = void 0; - var fieldVal = params.fieldValue(field); - - if (operator != null && value != null) { - var fieldStr = !is.string(fieldVal) && !is.number(fieldVal) ? '' : '' + fieldVal; - var valStr = '' + value; - - var caseInsensitive = false; - if (operator.indexOf('@') >= 0) { - fieldStr = fieldStr.toLowerCase(); - valStr = valStr.toLowerCase(); - - operator = operator.replace('@', ''); - caseInsensitive = true; - } - - var notExpr = false; - if (operator.indexOf('!') >= 0) { - operator = operator.replace('!', ''); - notExpr = true; - } - - // if we're doing a case insensitive comparison, then we're using a STRING comparison - // even if we're comparing numbers - if (caseInsensitive) { - value = valStr.toLowerCase(); - fieldVal = fieldStr.toLowerCase(); - } - - var isIneqCmp = false; - - switch (operator) { - case '*=': - _matches = fieldStr.indexOf(valStr) >= 0; - break; - case '$=': - _matches = fieldStr.indexOf(valStr, fieldStr.length - valStr.length) >= 0; - break; - case '^=': - _matches = fieldStr.indexOf(valStr) === 0; - break; - case '=': - _matches = fieldVal === value; - break; - case '>': - isIneqCmp = true; - _matches = fieldVal > value; - break; - case '>=': - isIneqCmp = true; - _matches = fieldVal >= value; - break; - case '<': - isIneqCmp = true; - _matches = fieldVal < value; - break; - case '<=': - isIneqCmp = true; - _matches = fieldVal <= value; - break; - default: - _matches = false; - break; - } - - // apply the not op, but null vals for inequalities should always stay non-matching - if (notExpr && (fieldVal != null || !isIneqCmp)) { - _matches = !_matches; - } - } else if (operator != null) { - switch (operator) { - case '?': - _matches = fieldVal ? true : false; - break; - case '!': - _matches = fieldVal ? false : true; - break; - case '^': - _matches = fieldVal === undefined; - break; - } - } else { - _matches = fieldVal !== undefined; - } - - if (!_matches) { - allDataMatches = false; - break; - } - } // for - - return allDataMatches; -}; // operandsMatch - -// check parent/child relations -var confirmRelations = function confirmRelations(query, isNecessary, eles) { - if (query != null) { - var _matches2 = false; - - if (!isNecessary) { - return false; - } - - eles = eles(); // save cycles if query == null - - // query must match for at least one element (may be recursive) - for (var i = 0; i < eles.length; i++) { - if (queryMatches(query, eles[i])) { - _matches2 = true; - break; - } - } - - return _matches2; - } else { - return true; - } -}; - -var queryMatches = function queryMatches(query, ele) { - // make single group-only selectors really cheap to check since they're the most common ones - if (query.groupOnly) { - return query.group === '*' || query.group === ele.group(); - } - - // check group - if (query.group != null && query.group != '*' && query.group != ele.group()) { - return false; - } - - var cy = ele.cy(); - var k = void 0; - - // check colon selectors - var allColonSelectorsMatch = true; - for (k = 0; k < query.colonSelectors.length; k++) { - var sel = query.colonSelectors[k]; - - allColonSelectorsMatch = stateSelectorMatches(sel, ele); - - if (!allColonSelectorsMatch) break; - } - if (!allColonSelectorsMatch) return false; - - // check id - var allIdsMatch = true; - for (k = 0; k < query.ids.length; k++) { - var id = query.ids[k]; - var actualId = ele.id(); - - allIdsMatch = allIdsMatch && id == actualId; - - if (!allIdsMatch) break; - } - if (!allIdsMatch) return false; - - // check classes - var allClassesMatch = true; - for (k = 0; k < query.classes.length; k++) { - var cls = query.classes[k]; - - allClassesMatch = allClassesMatch && ele.hasClass(cls); - - if (!allClassesMatch) break; - } - if (!allClassesMatch) return false; - - // check data matches - var allDataMatches = operandsMatch(query, { - name: 'data', - fieldValue: function fieldValue(field) { - return ele.data(field); - } - }); - - if (!allDataMatches) { - return false; - } - - // check metadata matches - var allMetaMatches = operandsMatch(query, { - name: 'meta', - fieldValue: function fieldValue(field) { - return ele[field](); - } - }); - - if (!allMetaMatches) { - return false; - } - - // check collection - if (query.collection != null) { - var matchesAny = query.collection.hasElementWithId(ele.id()); - - if (!matchesAny) { - return false; - } - } - - // check filter function - if (query.filter != null && ele.collection().some(query.filter)) { - return false; - } - - var isCompound = cy.hasCompoundNodes(); - var getSource = function getSource() { - return ele.source(); - }; - var getTarget = function getTarget() { - return ele.target(); - }; - - if (!confirmRelations(query.parent, isCompound, function () { - return ele.parent(); - })) { - return false; - } - - if (!confirmRelations(query.ancestor, isCompound, function () { - return ele.parents(); - })) { - return false; - } - - if (!confirmRelations(query.child, isCompound, function () { - return ele.children(); - })) { - return false; - } - - if (!confirmRelations(query.descendant, isCompound, function () { - return ele.descendants(); - })) { - return false; - } - - if (!confirmRelations(query.source, true, getSource)) { - return false; - } - - if (!confirmRelations(query.target, true, getTarget)) { - return false; - } - - if (query.connectedNodes) { - var q0 = query.connectedNodes[0]; - var q1 = query.connectedNodes[1]; - - if (confirmRelations(q0, true, getSource) && confirmRelations(q1, true, getTarget)) { - // match - } else if (confirmRelations(q0, true, getTarget) && confirmRelations(q1, true, getSource)) { - // match - } else { - return false; - } - } - - // we've reached the end, so we've matched everything for this query - return true; -}; // queryMatches - -// filter an existing collection -var filter = function filter(collection) { - var self = this; - var cy = collection.cy(); - - // don't bother trying if it's invalid - if (self.invalid()) { - return cy.collection(); - } - - // for 1 id #foo queries, just get the element - if (self.length === 1 && self[0].length === 1 && self[0].ids.length === 1) { - return collection.getElementById(self[0].ids[0]).collection(); - } - - var selectorFunction = function selectorFunction(element) { - for (var j = 0; j < self.length; j++) { - var query = self[j]; - - if (queryMatches(query, element)) { - return true; - } - } - - return false; - }; - - if (self.text() == null) { - selectorFunction = function selectorFunction() { - return true; - }; - } - - var filteredCollection = collection.filter(selectorFunction); - - return filteredCollection; -}; // filter - -// does selector match a single element? -var matches = function matches(ele) { - var self = this; - - // don't bother trying if it's invalid - if (self.invalid()) { - return false; - } - - for (var j = 0; j < self.length; j++) { - var query = self[j]; - - if (queryMatches(query, ele)) { - return true; - } - } - - return false; -}; // filter - -module.exports = { matches: matches, filter: filter }; - -/***/ }), -/* 54 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Set = __webpack_require__(8); - -var elesfn = { - parent: function parent(selector) { - var parents = []; - - // optimisation for single ele call - if (this.length === 1) { - var parent = this[0]._private.parent; - - if (parent) { - return parent; - } - } - - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - var _parent = ele._private.parent; - - if (_parent) { - parents.push(_parent); - } - } - - return this.spawn(parents, { unique: true }).filter(selector); - }, - - parents: function parents(selector) { - var parents = []; - - var eles = this.parent(); - while (eles.nonempty()) { - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - parents.push(ele); - } - - eles = eles.parent(); - } - - return this.spawn(parents, { unique: true }).filter(selector); - }, - - commonAncestors: function commonAncestors(selector) { - var ancestors = void 0; - - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - var parents = ele.parents(); - - ancestors = ancestors || parents; - - ancestors = ancestors.intersect(parents); // current list must be common with current ele parents set - } - - return ancestors.filter(selector); - }, - - orphans: function orphans(selector) { - return this.stdFilter(function (ele) { - return ele.isOrphan(); - }).filter(selector); - }, - - nonorphans: function nonorphans(selector) { - return this.stdFilter(function (ele) { - return ele.isChild(); - }).filter(selector); - }, - - children: function children(selector) { - var children = []; - - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - children = children.concat(ele._private.children); - } - - return this.spawn(children, { unique: true }).filter(selector); - }, - - siblings: function siblings(selector) { - return this.parent().children().not(this).filter(selector); - }, - - isParent: function isParent() { - var ele = this[0]; - - if (ele) { - return ele.isNode() && ele._private.children.length !== 0; - } - }, - - isChildless: function isChildless() { - var ele = this[0]; - - if (ele) { - return ele.isNode() && ele._private.children.length === 0; - } - }, - - isChild: function isChild() { - var ele = this[0]; - - if (ele) { - return ele.isNode() && ele._private.parent != null; - } - }, - - isOrphan: function isOrphan() { - var ele = this[0]; - - if (ele) { - return ele.isNode() && ele._private.parent == null; - } - }, - - descendants: function descendants(selector) { - var elements = []; - - function add(eles) { - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - - elements.push(ele); - - if (ele.children().nonempty()) { - add(ele.children()); - } - } - } - - add(this.children()); - - return this.spawn(elements, { unique: true }).filter(selector); - } -}; - -function forEachCompound(eles, fn, includeSelf, recursiveStep) { - var q = []; - var did = new Set(); - var cy = eles.cy(); - var hasCompounds = cy.hasCompoundNodes(); - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - - if (includeSelf) { - q.push(ele); - } else if (hasCompounds) { - recursiveStep(q, did, ele); - } - } - - while (q.length > 0) { - var _ele = q.shift(); - - fn(_ele); - - did.add(_ele.id()); - - if (hasCompounds) { - recursiveStep(q, did, _ele); - } - } - - return eles; -} - -function addChildren(q, did, ele) { - if (ele.isParent()) { - var children = ele._private.children; - - for (var i = 0; i < children.length; i++) { - var child = children[i]; - - if (!did.has(child.id())) { - q.push(child); - } - } - } -} - -// very efficient version of eles.add( eles.descendants() ).forEach() -// for internal use -elesfn.forEachDown = function (fn) { - var includeSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - - return forEachCompound(this, fn, includeSelf, addChildren); -}; - -function addParent(q, did, ele) { - if (ele.isChild()) { - var parent = ele._private.parent; - - if (!did.has(parent.id())) { - q.push(parent); - } - } -} - -elesfn.forEachUp = function (fn) { - var includeSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - - return forEachCompound(this, fn, includeSelf, addParent); -}; - -function addParentAndChildren(q, did, ele) { - addParent(q, did, ele); - addChildren(q, did, ele); -} - -elesfn.forEachUpAndDown = function (fn) { - var includeSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - - return forEachCompound(this, fn, includeSelf, addParentAndChildren); -}; - -// aliases -elesfn.ancestors = elesfn.parents; - -module.exports = elesfn; - -/***/ }), -/* 55 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var define = __webpack_require__(4); -var fn = void 0, - elesfn = void 0; - -fn = elesfn = { - - data: define.data({ - field: 'data', - bindingEvent: 'data', - allowBinding: true, - allowSetting: true, - settingEvent: 'data', - settingTriggersEvent: true, - triggerFnName: 'trigger', - allowGetting: true, - immutableKeys: { - 'id': true, - 'source': true, - 'target': true, - 'parent': true - }, - updateStyle: true - }), - - removeData: define.removeData({ - field: 'data', - event: 'data', - triggerFnName: 'trigger', - triggerEvent: true, - immutableKeys: { - 'id': true, - 'source': true, - 'target': true, - 'parent': true - }, - updateStyle: true - }), - - scratch: define.data({ - field: 'scratch', - bindingEvent: 'scratch', - allowBinding: true, - allowSetting: true, - settingEvent: 'scratch', - settingTriggersEvent: true, - triggerFnName: 'trigger', - allowGetting: true, - updateStyle: true - }), - - removeScratch: define.removeData({ - field: 'scratch', - event: 'scratch', - triggerFnName: 'trigger', - triggerEvent: true, - updateStyle: true - }), - - rscratch: define.data({ - field: 'rscratch', - allowBinding: false, - allowSetting: true, - settingTriggersEvent: false, - allowGetting: true - }), - - removeRscratch: define.removeData({ - field: 'rscratch', - triggerEvent: false - }), - - id: function id() { - var ele = this[0]; - - if (ele) { - return ele._private.data.id; - } - } - -}; - -// aliases -fn.attr = fn.data; -fn.removeAttr = fn.removeData; - -module.exports = elesfn; - -/***/ }), -/* 56 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); - -var elesfn = {}; - -function defineDegreeFunction(callback) { - return function (includeLoops) { - var self = this; - - if (includeLoops === undefined) { - includeLoops = true; - } - - if (self.length === 0) { - return; - } - - if (self.isNode() && !self.removed()) { - var degree = 0; - var node = self[0]; - var connectedEdges = node._private.edges; - - for (var i = 0; i < connectedEdges.length; i++) { - var edge = connectedEdges[i]; - - if (!includeLoops && edge.isLoop()) { - continue; - } - - degree += callback(node, edge); - } - - return degree; - } else { - return; - } - }; -} - -util.extend(elesfn, { - degree: defineDegreeFunction(function (node, edge) { - if (edge.source().same(edge.target())) { - return 2; - } else { - return 1; - } - }), - - indegree: defineDegreeFunction(function (node, edge) { - if (edge.target().same(node)) { - return 1; - } else { - return 0; - } - }), - - outdegree: defineDegreeFunction(function (node, edge) { - if (edge.source().same(node)) { - return 1; - } else { - return 0; - } - }) -}); - -function defineDegreeBoundsFunction(degreeFn, callback) { - return function (includeLoops) { - var ret = void 0; - var nodes = this.nodes(); - - for (var i = 0; i < nodes.length; i++) { - var ele = nodes[i]; - var degree = ele[degreeFn](includeLoops); - if (degree !== undefined && (ret === undefined || callback(degree, ret))) { - ret = degree; - } - } - - return ret; - }; -} - -util.extend(elesfn, { - minDegree: defineDegreeBoundsFunction('degree', function (degree, min) { - return degree < min; - }), - - maxDegree: defineDegreeBoundsFunction('degree', function (degree, max) { - return degree > max; - }), - - minIndegree: defineDegreeBoundsFunction('indegree', function (degree, min) { - return degree < min; - }), - - maxIndegree: defineDegreeBoundsFunction('indegree', function (degree, max) { - return degree > max; - }), - - minOutdegree: defineDegreeBoundsFunction('outdegree', function (degree, min) { - return degree < min; - }), - - maxOutdegree: defineDegreeBoundsFunction('outdegree', function (degree, max) { - return degree > max; - }) -}); - -util.extend(elesfn, { - totalDegree: function totalDegree(includeLoops) { - var total = 0; - var nodes = this.nodes(); - - for (var i = 0; i < nodes.length; i++) { - total += nodes[i].degree(includeLoops); - } - - return total; - } -}); - -module.exports = elesfn; - -/***/ }), -/* 57 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var position = __webpack_require__(58); -var bounds = __webpack_require__(59); -var widthHeight = __webpack_require__(60); -var edgePoints = __webpack_require__(61); - -module.exports = util.assign({}, position, bounds, widthHeight, edgePoints); - -/***/ }), -/* 58 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var define = __webpack_require__(4); -var is = __webpack_require__(0); -var math = __webpack_require__(2); -var fn = void 0, - elesfn = void 0; - -var beforePositionSet = function beforePositionSet(eles, newPos) { - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - - if (ele.isParent() && !ele.locked()) { - var oldPos = ele._private.position; - var delta = { - x: newPos.x - oldPos.x, - y: newPos.y - oldPos.y - }; - - eles.children().shift(delta); - } - } -}; - -fn = elesfn = { - - position: define.data({ - field: 'position', - bindingEvent: 'position', - allowBinding: true, - allowSetting: true, - settingEvent: 'position', - settingTriggersEvent: true, - triggerFnName: 'emitAndNotify', - allowGetting: true, - validKeys: ['x', 'y'], - beforeGet: function beforeGet(ele) { - ele.updateCompoundBounds(); - }, - beforeSet: beforePositionSet, - onSet: function onSet(eles) { - eles.dirtyCompoundBoundsCache(); - }, - canSet: function canSet(ele) { - return !ele.locked(); - } - }), - - // position but no notification to renderer - silentPosition: define.data({ - field: 'position', - bindingEvent: 'position', - allowBinding: false, - allowSetting: true, - settingEvent: 'position', - settingTriggersEvent: false, - triggerFnName: 'trigger', - allowGetting: false, - validKeys: ['x', 'y'], - beforeSet: beforePositionSet, - onSet: function onSet(eles) { - eles.dirtyCompoundBoundsCache(); - }, - canSet: function canSet(ele) { - return !ele.locked(); - } - }), - - positions: function positions(pos, silent) { - if (is.plainObject(pos)) { - if (silent) { - this.silentPosition(pos); - } else { - this.position(pos); - } - } else if (is.fn(pos)) { - var _fn = pos; - var cy = this.cy(); - - cy.startBatch(); - - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - var _pos = void 0; - - if (_pos = _fn(ele, i)) { - if (silent) { - ele.silentPosition(_pos); - } else { - ele.position(_pos); - } - } - } - - cy.endBatch(); - } - - return this; // chaining - }, - - silentPositions: function silentPositions(pos) { - return this.positions(pos, true); - }, - - shift: function shift(dim, val) { - var delta = void 0; - - if (is.plainObject(dim)) { - delta = dim; - } else if (is.string(dim) && is.number(val)) { - delta = { x: 0, y: 0 }; - - delta[dim] = val; - } - - if (delta != null) { - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - var pos = ele.position(); - - ele.position({ - x: pos.x + delta.x, - y: pos.y + delta.y - }); - } - } - - return this; - }, - - // get/set the rendered (i.e. on screen) positon of the element - renderedPosition: function renderedPosition(dim, val) { - var ele = this[0]; - var cy = this.cy(); - var zoom = cy.zoom(); - var pan = cy.pan(); - var rpos = is.plainObject(dim) ? dim : undefined; - var setting = rpos !== undefined || val !== undefined && is.string(dim); - - if (ele && ele.isNode()) { - // must have an element and must be a node to return position - if (setting) { - for (var i = 0; i < this.length; i++) { - var _ele = this[i]; - - if (val !== undefined) { - // set one dimension - _ele.position(dim, (val - pan[dim]) / zoom); - } else if (rpos !== undefined) { - // set whole position - _ele.position(math.renderedToModelPosition(rpos, zoom, pan)); - } - } - } else { - // getting - var pos = ele.position(); - rpos = math.modelToRenderedPosition(pos, zoom, pan); - - if (dim === undefined) { - // then return the whole rendered position - return rpos; - } else { - // then return the specified dimension - return rpos[dim]; - } - } - } else if (!setting) { - return undefined; // for empty collection case - } - - return this; // chaining - }, - - // get/set the position relative to the parent - relativePosition: function relativePosition(dim, val) { - var ele = this[0]; - var cy = this.cy(); - var ppos = is.plainObject(dim) ? dim : undefined; - var setting = ppos !== undefined || val !== undefined && is.string(dim); - var hasCompoundNodes = cy.hasCompoundNodes(); - - if (ele && ele.isNode()) { - // must have an element and must be a node to return position - if (setting) { - for (var i = 0; i < this.length; i++) { - var _ele2 = this[i]; - var parent = hasCompoundNodes ? _ele2.parent() : null; - var hasParent = parent && parent.length > 0; - var relativeToParent = hasParent; - - if (hasParent) { - parent = parent[0]; - } - - var origin = relativeToParent ? parent.position() : { x: 0, y: 0 }; - - if (val !== undefined) { - // set one dimension - _ele2.position(dim, val + origin[dim]); - } else if (ppos !== undefined) { - // set whole position - _ele2.position({ - x: ppos.x + origin.x, - y: ppos.y + origin.y - }); - } - } - } else { - // getting - var pos = ele.position(); - var _parent = hasCompoundNodes ? ele.parent() : null; - var _hasParent = _parent && _parent.length > 0; - var _relativeToParent = _hasParent; - - if (_hasParent) { - _parent = _parent[0]; - } - - var _origin = _relativeToParent ? _parent.position() : { x: 0, y: 0 }; - - ppos = { - x: pos.x - _origin.x, - y: pos.y - _origin.y - }; - - if (dim === undefined) { - // then return the whole rendered position - return ppos; - } else { - // then return the specified dimension - return ppos[dim]; - } - } - } else if (!setting) { - return undefined; // for empty collection case - } - - return this; // chaining - } -}; - -// aliases -fn.modelPosition = fn.point = fn.position; -fn.modelPositions = fn.points = fn.positions; -fn.renderedPoint = fn.renderedPosition; -fn.relativePoint = fn.relativePosition; - -module.exports = elesfn; - -/***/ }), -/* 59 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var util = __webpack_require__(1); -var math = __webpack_require__(2); -var fn = void 0, - elesfn = void 0; - -fn = elesfn = {}; - -elesfn.renderedBoundingBox = function (options) { - var bb = this.boundingBox(options); - var cy = this.cy(); - var zoom = cy.zoom(); - var pan = cy.pan(); - - var x1 = bb.x1 * zoom + pan.x; - var x2 = bb.x2 * zoom + pan.x; - var y1 = bb.y1 * zoom + pan.y; - var y2 = bb.y2 * zoom + pan.y; - - return { - x1: x1, - x2: x2, - y1: y1, - y2: y2, - w: x2 - x1, - h: y2 - y1 - }; -}; - -elesfn.dirtyCompoundBoundsCache = function () { - var cy = this.cy(); - - if (!cy.styleEnabled() || !cy.hasCompoundNodes()) { - return this; - } - - this.forEachUp(function (ele) { - ele._private.compoundBoundsClean = false; - - if (ele.isParent()) { - ele.emit('bounds'); - } - }); - - return this; -}; - -elesfn.updateCompoundBounds = function () { - var cy = this.cy(); - - // save cycles for non compound graphs or when style disabled - if (!cy.styleEnabled() || !cy.hasCompoundNodes()) { - return this; - } - - // save cycles when batching -- but bounds will be stale (or not exist yet) - if (cy.batching()) { - return this; - } - - var updated = []; - - function update(parent) { - if (!parent.isParent()) { - return; - } - - var _p = parent._private; - var children = parent.children(); - var includeLabels = parent.pstyle('compound-sizing-wrt-labels').value === 'include'; - - var min = { - width: { - val: parent.pstyle('min-width').pfValue, - left: parent.pstyle('min-width-bias-left'), - right: parent.pstyle('min-width-bias-right') - }, - height: { - val: parent.pstyle('min-height').pfValue, - top: parent.pstyle('min-height-bias-top'), - bottom: parent.pstyle('min-height-bias-bottom') - } - }; - - var bb = children.boundingBox({ - includeLabels: includeLabels, - includeOverlays: false, - - // updating the compound bounds happens outside of the regular - // cache cycle (i.e. before fired events) - useCache: false - }); - var pos = _p.position; - - // if children take up zero area then keep position and fall back on stylesheet w/h - if (bb.w === 0 || bb.h === 0) { - bb = { - w: parent.pstyle('width').pfValue, - h: parent.pstyle('height').pfValue - }; - - bb.x1 = pos.x - bb.w / 2; - bb.x2 = pos.x + bb.w / 2; - bb.y1 = pos.y - bb.h / 2; - bb.y2 = pos.y + bb.h / 2; - } - - function computeBiasValues(propDiff, propBias, propBiasComplement) { - var biasDiff = 0; - var biasComplementDiff = 0; - var biasTotal = propBias + propBiasComplement; - - if (propDiff > 0 && biasTotal > 0) { - biasDiff = propBias / biasTotal * propDiff; - biasComplementDiff = propBiasComplement / biasTotal * propDiff; - } - return { - biasDiff: biasDiff, - biasComplementDiff: biasComplementDiff - }; - } - - function computePaddingValues(width, height, paddingObject, relativeTo) { - // Assuming percentage is number from 0 to 1 - if (paddingObject.units === '%') { - switch (relativeTo) { - case 'width': - return width > 0 ? paddingObject.pfValue * width : 0; - case 'height': - return height > 0 ? paddingObject.pfValue * height : 0; - case 'average': - return width > 0 && height > 0 ? paddingObject.pfValue * (width + height) / 2 : 0; - case 'min': - return width > 0 && height > 0 ? width > height ? paddingObject.pfValue * height : paddingObject.pfValue * width : 0; - case 'max': - return width > 0 && height > 0 ? width > height ? paddingObject.pfValue * width : paddingObject.pfValue * height : 0; - default: - return 0; - } - } else if (paddingObject.units === 'px') { - return paddingObject.pfValue; - } else { - return 0; - } - } - - var leftVal = min.width.left.value; - if (min.width.left.units === 'px' && min.width.val > 0) { - leftVal = leftVal * 100 / min.width.val; - } - var rightVal = min.width.right.value; - if (min.width.right.units === 'px' && min.width.val > 0) { - rightVal = rightVal * 100 / min.width.val; - } - - var topVal = min.height.top.value; - if (min.height.top.units === 'px' && min.height.val > 0) { - topVal = topVal * 100 / min.height.val; - } - - var bottomVal = min.height.bottom.value; - if (min.height.bottom.units === 'px' && min.height.val > 0) { - bottomVal = bottomVal * 100 / min.height.val; - } - - var widthBiasDiffs = computeBiasValues(min.width.val - bb.w, leftVal, rightVal); - var diffLeft = widthBiasDiffs.biasDiff; - var diffRight = widthBiasDiffs.biasComplementDiff; - - var heightBiasDiffs = computeBiasValues(min.height.val - bb.h, topVal, bottomVal); - var diffTop = heightBiasDiffs.biasDiff; - var diffBottom = heightBiasDiffs.biasComplementDiff; - - _p.autoPadding = computePaddingValues(bb.w, bb.h, parent.pstyle('padding'), parent.pstyle('padding-relative-to').value); - - _p.autoWidth = Math.max(bb.w, min.width.val); - pos.x = (-diffLeft + bb.x1 + bb.x2 + diffRight) / 2; - - _p.autoHeight = Math.max(bb.h, min.height.val); - pos.y = (-diffTop + bb.y1 + bb.y2 + diffBottom) / 2; - - updated.push(parent); - } - - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - var _p = ele._private; - - if (!_p.compoundBoundsClean) { - update(ele); - - if (!cy._private.batchingStyle) { - _p.compoundBoundsClean = true; - } - } - } - - return this; -}; - -var noninf = function noninf(x) { - if (x === Infinity || x === -Infinity) { - return 0; - } - - return x; -}; - -var updateBounds = function updateBounds(b, x1, y1, x2, y2) { - // don't update with zero area boxes - if (x2 - x1 === 0 || y2 - y1 === 0) { - return; - } - - // don't update with null dim - if (x1 == null || y1 == null || x2 == null || y2 == null) { - return; - } - - b.x1 = x1 < b.x1 ? x1 : b.x1; - b.x2 = x2 > b.x2 ? x2 : b.x2; - b.y1 = y1 < b.y1 ? y1 : b.y1; - b.y2 = y2 > b.y2 ? y2 : b.y2; -}; - -var updateBoundsFromBox = function updateBoundsFromBox(b, b2) { - return updateBounds(b, b2.x1, b2.y1, b2.x2, b2.y2); -}; - -var prefixedProperty = function prefixedProperty(obj, field, prefix) { - return util.getPrefixedProperty(obj, field, prefix); -}; - -var updateBoundsFromArrow = function updateBoundsFromArrow(bounds, ele, prefix) { - if (ele.cy().headless()) { - return; - } - - var _p = ele._private; - var rstyle = _p.rstyle; - var halfArW = rstyle.arrowWidth / 2; - var arrowType = ele.pstyle(prefix + '-arrow-shape').value; - var x = void 0; - var y = void 0; - - if (arrowType !== 'none') { - if (prefix === 'source') { - x = rstyle.srcX; - y = rstyle.srcY; - } else if (prefix === 'target') { - x = rstyle.tgtX; - y = rstyle.tgtY; - } else { - x = rstyle.midX; - y = rstyle.midY; - } - - updateBounds(bounds, x - halfArW, y - halfArW, x + halfArW, y + halfArW); - } -}; - -var updateBoundsFromLabel = function updateBoundsFromLabel(bounds, ele, prefix) { - if (ele.cy().headless()) { - return; - } - - var prefixDash = void 0; - - if (prefix) { - prefixDash = prefix + '-'; - } else { - prefixDash = ''; - } - - var _p = ele._private; - var rstyle = _p.rstyle; - var label = ele.pstyle(prefixDash + 'label').strValue; - - if (label) { - var halign = ele.pstyle('text-halign'); - var valign = ele.pstyle('text-valign'); - var labelWidth = prefixedProperty(rstyle, 'labelWidth', prefix); - var labelHeight = prefixedProperty(rstyle, 'labelHeight', prefix); - var labelX = prefixedProperty(rstyle, 'labelX', prefix); - var labelY = prefixedProperty(rstyle, 'labelY', prefix); - var marginX = ele.pstyle(prefixDash + 'text-margin-x').pfValue; - var marginY = ele.pstyle(prefixDash + 'text-margin-y').pfValue; - var isEdge = ele.isEdge(); - var rotation = ele.pstyle(prefixDash + 'text-rotation'); - var outlineWidth = ele.pstyle('text-outline-width').pfValue; - var borderWidth = ele.pstyle('text-border-width').pfValue; - var halfBorderWidth = borderWidth / 2; - var padding = ele.pstyle('text-background-padding').pfValue; - - var lh = labelHeight + 2 * padding; - var lw = labelWidth + 2 * padding; - var lw_2 = lw / 2; - var lh_2 = lh / 2; - var lx1 = void 0, - lx2 = void 0, - ly1 = void 0, - ly2 = void 0; - - if (isEdge) { - lx1 = labelX - lw_2; - lx2 = labelX + lw_2; - ly1 = labelY - lh_2; - ly2 = labelY + lh_2; - } else { - switch (halign.value) { - case 'left': - lx1 = labelX - lw; - lx2 = labelX; - break; - - case 'center': - lx1 = labelX - lw_2; - lx2 = labelX + lw_2; - break; - - case 'right': - lx1 = labelX; - lx2 = labelX + lw; - break; - } - - switch (valign.value) { - case 'top': - ly1 = labelY - lh; - ly2 = labelY; - break; - - case 'center': - ly1 = labelY - lh_2; - ly2 = labelY + lh_2; - break; - - case 'bottom': - ly1 = labelY; - ly2 = labelY + lh; - break; - } - } - - var isAutorotate = isEdge && rotation.strValue === 'autorotate'; - var isPfValue = rotation.pfValue != null && rotation.pfValue !== 0; - - if (isAutorotate || isPfValue) { - var theta = isAutorotate ? prefixedProperty(_p.rstyle, 'labelAngle', prefix) : rotation.pfValue; - var cos = Math.cos(theta); - var sin = Math.sin(theta); - - var rotate = function rotate(x, y) { - x = x - labelX; - y = y - labelY; - - return { - x: x * cos - y * sin + labelX, - y: x * sin + y * cos + labelY - }; - }; - - var px1y1 = rotate(lx1, ly1); - var px1y2 = rotate(lx1, ly2); - var px2y1 = rotate(lx2, ly1); - var px2y2 = rotate(lx2, ly2); - - lx1 = Math.min(px1y1.x, px1y2.x, px2y1.x, px2y2.x); - lx2 = Math.max(px1y1.x, px1y2.x, px2y1.x, px2y2.x); - ly1 = Math.min(px1y1.y, px1y2.y, px2y1.y, px2y2.y); - ly2 = Math.max(px1y1.y, px1y2.y, px2y1.y, px2y2.y); - } - - lx1 += marginX - Math.max(outlineWidth, halfBorderWidth); - lx2 += marginX + Math.max(outlineWidth, halfBorderWidth); - ly1 += marginY - Math.max(outlineWidth, halfBorderWidth); - ly2 += marginY + Math.max(outlineWidth, halfBorderWidth); - - updateBounds(bounds, lx1, ly1, lx2, ly2); - } - - return bounds; -}; - -// get the bounding box of the elements (in raw model position) -var boundingBoxImpl = function boundingBoxImpl(ele, options) { - var cy = ele._private.cy; - var styleEnabled = cy.styleEnabled(); - var headless = cy.headless(); - - var bounds = { - x1: Infinity, - y1: Infinity, - x2: -Infinity, - y2: -Infinity - }; - - var _p = ele._private; - var display = styleEnabled ? ele.pstyle('display').value : 'element'; - var isNode = ele.isNode(); - var isEdge = ele.isEdge(); - var ex1 = void 0, - ex2 = void 0, - ey1 = void 0, - ey2 = void 0; // extrema of body / lines - var x = void 0, - y = void 0; // node pos - var displayed = display !== 'none'; - - if (displayed) { - var overlayOpacity = 0; - var overlayPadding = 0; - - if (styleEnabled && options.includeOverlays) { - overlayOpacity = ele.pstyle('overlay-opacity').value; - - if (overlayOpacity !== 0) { - overlayPadding = ele.pstyle('overlay-padding').value; - } - } - - var w = 0; - var wHalf = 0; - - if (styleEnabled) { - w = ele.pstyle('width').pfValue; - wHalf = w / 2; - } - - if (isNode && options.includeNodes) { - var pos = ele.position(); - x = pos.x; - y = pos.y; - var _w = ele.outerWidth(); - var halfW = _w / 2; - var h = ele.outerHeight(); - var halfH = h / 2; - - // handle node dimensions - ///////////////////////// - - ex1 = x - halfW - overlayPadding; - ex2 = x + halfW + overlayPadding; - ey1 = y - halfH - overlayPadding; - ey2 = y + halfH + overlayPadding; - - updateBounds(bounds, ex1, ey1, ex2, ey2); - } else if (isEdge && options.includeEdges) { - var rstyle = _p.rstyle || {}; - - // handle edge dimensions (rough box estimate) - ////////////////////////////////////////////// - if (styleEnabled && !headless) { - ex1 = Math.min(rstyle.srcX, rstyle.midX, rstyle.tgtX); - ex2 = Math.max(rstyle.srcX, rstyle.midX, rstyle.tgtX); - ey1 = Math.min(rstyle.srcY, rstyle.midY, rstyle.tgtY); - ey2 = Math.max(rstyle.srcY, rstyle.midY, rstyle.tgtY); - - // take into account edge width - ex1 -= wHalf; - ex2 += wHalf; - ey1 -= wHalf; - ey2 += wHalf; - - updateBounds(bounds, ex1, ey1, ex2, ey2); - } - - // precise haystacks - //////////////////// - if (styleEnabled && !headless && ele.pstyle('curve-style').strValue === 'haystack') { - var hpts = rstyle.haystackPts || []; - - ex1 = hpts[0].x; - ey1 = hpts[0].y; - ex2 = hpts[1].x; - ey2 = hpts[1].y; - - if (ex1 > ex2) { - var temp = ex1; - ex1 = ex2; - ex2 = temp; - } - - if (ey1 > ey2) { - var _temp = ey1; - ey1 = ey2; - ey2 = _temp; - } - - updateBounds(bounds, ex1 - wHalf, ey1 - wHalf, ex2 + wHalf, ey2 + wHalf); - - // handle points along edge - /////////////////////////// - } else { - var pts = rstyle.bezierPts || rstyle.linePts || []; - - for (var j = 0; j < pts.length; j++) { - var pt = pts[j]; - - ex1 = pt.x - wHalf; - ex2 = pt.x + wHalf; - ey1 = pt.y - wHalf; - ey2 = pt.y + wHalf; - - updateBounds(bounds, ex1, ey1, ex2, ey2); - } - - // fallback on source and target positions - ////////////////////////////////////////// - if (pts.length === 0) { - var n1 = ele.source(); - var n1pos = n1.position(); - - var n2 = ele.target(); - var n2pos = n2.position(); - - ex1 = n1pos.x; - ex2 = n2pos.x; - ey1 = n1pos.y; - ey2 = n2pos.y; - - if (ex1 > ex2) { - var _temp2 = ex1; - ex1 = ex2; - ex2 = _temp2; - } - - if (ey1 > ey2) { - var _temp3 = ey1; - ey1 = ey2; - ey2 = _temp3; - } - - // take into account edge width - ex1 -= wHalf; - ex2 += wHalf; - ey1 -= wHalf; - ey2 += wHalf; - - updateBounds(bounds, ex1, ey1, ex2, ey2); - } - } - } // edges - - - // handle edge arrow size - ///////////////////////// - - if (styleEnabled && options.includeEdges && isEdge) { - updateBoundsFromArrow(bounds, ele, 'mid-source', options); - updateBoundsFromArrow(bounds, ele, 'mid-target', options); - updateBoundsFromArrow(bounds, ele, 'source', options); - updateBoundsFromArrow(bounds, ele, 'target', options); - } - - // ghost - //////// - - if (styleEnabled) { - var ghost = ele.pstyle('ghost').value === 'yes'; - - if (ghost) { - var gx = ele.pstyle('ghost-offset-x').pfValue; - var gy = ele.pstyle('ghost-offset-y').pfValue; - - updateBounds(bounds, bounds.x1 + gx, bounds.y1 + gy, bounds.x2 + gx, bounds.y2 + gy); - } - } - - // overlay - ////////// - - if (styleEnabled) { - - ex1 = bounds.x1; - ex2 = bounds.x2; - ey1 = bounds.y1; - ey2 = bounds.y2; - - updateBounds(bounds, ex1 - overlayPadding, ey1 - overlayPadding, ex2 + overlayPadding, ey2 + overlayPadding); - } - - // handle label dimensions - ////////////////////////// - - if (styleEnabled && options.includeLabels) { - updateBoundsFromLabel(bounds, ele, null, options); - - if (isEdge) { - updateBoundsFromLabel(bounds, ele, 'source', options); - updateBoundsFromLabel(bounds, ele, 'target', options); - } - } // style enabled for labels - } // if displayed - - bounds.x1 = noninf(bounds.x1); - bounds.y1 = noninf(bounds.y1); - bounds.x2 = noninf(bounds.x2); - bounds.y2 = noninf(bounds.y2); - bounds.w = noninf(bounds.x2 - bounds.x1); - bounds.h = noninf(bounds.y2 - bounds.y1); - - // expand bounds by 1 because antialiasing can increase the visual/effective size by 1 on all sides - if (bounds.w > 0 && bounds.h > 0 && displayed) { - math.expandBoundingBox(bounds, 1); - } - - return bounds; -}; - -var tf = function tf(val) { - if (val) { - return 't'; - } else { - return 'f'; - } -}; - -var getKey = function getKey(opts) { - var key = ''; - - key += tf(opts.incudeNodes); - key += tf(opts.includeEdges); - key += tf(opts.includeLabels); - key += tf(opts.includeOverlays); - - return key; -}; - -var cachedBoundingBoxImpl = function cachedBoundingBoxImpl(ele, opts) { - var _p = ele._private; - var bb = void 0; - var headless = ele.cy().headless(); - var key = opts === defBbOpts ? defBbOptsKey : getKey(opts); - - if (!opts.useCache || headless || !_p.bbCache || !_p.bbCache[key]) { - bb = boundingBoxImpl(ele, opts); - - if (!headless) { - _p.bbCache = _p.bbCache || {}; - _p.bbCache[key] = bb; - } - } else { - bb = _p.bbCache[key]; - } - - return bb; -}; - -var defBbOpts = { - includeNodes: true, - includeEdges: true, - includeLabels: true, - includeOverlays: true, - useCache: true -}; - -var defBbOptsKey = getKey(defBbOpts); - -function filledBbOpts(options) { - return { - includeNodes: util.default(options.includeNodes, defBbOpts.includeNodes), - includeEdges: util.default(options.includeEdges, defBbOpts.includeEdges), - includeLabels: util.default(options.includeLabels, defBbOpts.includeLabels), - includeOverlays: util.default(options.includeOverlays, defBbOpts.includeOverlays), - useCache: util.default(options.useCache, defBbOpts.useCache) - }; -} - -elesfn.boundingBox = function (options) { - // the main usecase is ele.boundingBox() for a single element with no/def options - // specified s.t. the cache is used, so check for this case to make it faster by - // avoiding the overhead of the rest of the function - if (this.length === 1 && this[0]._private.bbCache && (options === undefined || options.useCache === undefined || options.useCache === true)) { - if (options === undefined) { - options = defBbOpts; - } else { - options = filledBbOpts(options); - } - - return cachedBoundingBoxImpl(this[0], options); - } - - var bounds = { - x1: Infinity, - y1: Infinity, - x2: -Infinity, - y2: -Infinity - }; - - options = options || util.staticEmptyObject(); - - var opts = filledBbOpts(options); - - var eles = this; - var cy = eles.cy(); - var styleEnabled = cy.styleEnabled(); - - if (styleEnabled) { - this.recalculateRenderedStyle(opts.useCache); - } - - this.updateCompoundBounds(); - - var updatedEdge = {}; // use to avoid duplicated edge updates - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - - if (styleEnabled && ele.isEdge() && ele.pstyle('curve-style').strValue === 'bezier' && !updatedEdge[ele.id()]) { - var edges = ele.parallelEdges(); - - for (var j = 0; j < edges.length; j++) { - // make all as updated - updatedEdge[edges[j].id()] = true; - } - - edges.recalculateRenderedStyle(opts.useCache); // n.b. ele.parallelEdges() single is cached - } - - updateBoundsFromBox(bounds, cachedBoundingBoxImpl(ele, opts)); - } - - bounds.x1 = noninf(bounds.x1); - bounds.y1 = noninf(bounds.y1); - bounds.x2 = noninf(bounds.x2); - bounds.y2 = noninf(bounds.y2); - bounds.w = noninf(bounds.x2 - bounds.x1); - bounds.h = noninf(bounds.y2 - bounds.y1); - - return bounds; -}; - -// private helper to get bounding box for custom node positions -// - good for perf in certain cases but currently requires dirtying the rendered style -// - would be better to not modify the nodes but the nodes are read directly everywhere in the renderer... -// - try to use for only things like discrete layouts where the node position would change anyway -elesfn.boundingBoxAt = function (fn) { - var nodes = this.nodes(); - - if (is.plainObject(fn)) { - var obj = fn; - - fn = function fn() { - return obj; - }; - } - - // save the current position and set the new one, per node - for (var i = 0; i < nodes.length; i++) { - var n = nodes[i]; - var _p = n._private; - var pos = _p.position; - var newPos = fn.call(n, n, i); - - _p.bbAtOldPos = { x: pos.x, y: pos.y }; - - if (newPos) { - pos.x = newPos.x; - pos.y = newPos.y; - } - } - - this.emit('dirty'); // let the renderer know we've manually dirtied rendered dim calcs - - nodes.dirtyCompoundBoundsCache().updateCompoundBounds(); - - var bb = this.boundingBox({ useCache: false }); - - // restore the original position, per node - for (var _i = 0; _i < nodes.length; _i++) { - var _n = nodes[_i]; - var _p2 = _n._private; - var _pos = _n._private.position; - var old = _p2.bbAtOldPos; - - _pos.x = old.x; - _pos.y = old.y; - } - - nodes.dirtyCompoundBoundsCache(); - - this.emit('dirty'); // let the renderer know we've manually dirtied rendered dim calcs - - return bb; -}; - -fn.boundingbox = fn.boundingBox; -fn.renderedBoundingbox = fn.renderedBoundingBox; - -module.exports = elesfn; - -/***/ }), -/* 60 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var fn = void 0, - elesfn = void 0; - -fn = elesfn = {}; - -var defineDimFns = function defineDimFns(opts) { - opts.uppercaseName = util.capitalize(opts.name); - opts.autoName = 'auto' + opts.uppercaseName; - opts.labelName = 'label' + opts.uppercaseName; - opts.outerName = 'outer' + opts.uppercaseName; - opts.uppercaseOuterName = util.capitalize(opts.outerName); - - fn[opts.name] = function dimImpl() { - var ele = this[0]; - var _p = ele._private; - var cy = _p.cy; - var styleEnabled = cy._private.styleEnabled; - - if (ele) { - if (styleEnabled) { - if (ele.isParent()) { - ele.updateCompoundBounds(); - - return _p[opts.autoName] || 0; - } - - var d = ele.pstyle(opts.name); - - switch (d.strValue) { - case 'label': - ele.recalculateRenderedStyle(); - - return _p.rstyle[opts.labelName] || 0; - - default: - return d.pfValue; - } - } else { - return 1; - } - } - }; - - fn['outer' + opts.uppercaseName] = function outerDimImpl() { - var ele = this[0]; - var _p = ele._private; - var cy = _p.cy; - var styleEnabled = cy._private.styleEnabled; - - if (ele) { - if (styleEnabled) { - var dim = ele[opts.name](); - var border = ele.pstyle('border-width').pfValue; // n.b. 1/2 each side - var padding = 2 * ele.padding(); - - return dim + border + padding; - } else { - return 1; - } - } - }; - - fn['rendered' + opts.uppercaseName] = function renderedDimImpl() { - var ele = this[0]; - - if (ele) { - var d = ele[opts.name](); - return d * this.cy().zoom(); - } - }; - - fn['rendered' + opts.uppercaseOuterName] = function renderedOuterDimImpl() { - var ele = this[0]; - - if (ele) { - var od = ele[opts.outerName](); - return od * this.cy().zoom(); - } - }; -}; - -defineDimFns({ - name: 'width' -}); - -defineDimFns({ - name: 'height' -}); - -elesfn.padding = function () { - var ele = this[0]; - var _p = ele._private; - if (ele.isParent()) { - ele.updateCompoundBounds(); - - if (_p.autoPadding !== undefined) { - return _p.autoPadding; - } else { - return ele.pstyle('padding').pfValue; - } - } else { - return ele.pstyle('padding').pfValue; - } -}; - -module.exports = elesfn; - -/***/ }), -/* 61 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var ifEdge = function ifEdge(self, then) { - if (self.isEdge()) { - return then(self.renderer()); - } -}; - -module.exports = { - controlPoints: function controlPoints() { - var _this = this; - - return ifEdge(this, function (renderer) { - return renderer.getControlPoints(_this); - }); - }, - segmentPoints: function segmentPoints() { - var _this2 = this; - - return ifEdge(this, function (renderer) { - return renderer.getSegmentPoints(_this2); - }); - }, - sourceEndpoint: function sourceEndpoint() { - var _this3 = this; - - return ifEdge(this, function (renderer) { - return renderer.getSourceEndpoint(_this3); - }); - }, - targetEndpoint: function targetEndpoint() { - var _this4 = this; - - return ifEdge(this, function (renderer) { - return renderer.getTargetEndpoint(_this4); - }); - }, - midpoint: function midpoint() { - var _this5 = this; - - return ifEdge(this, function (renderer) { - return renderer.getEdgeMidpoint(_this5); - }); - } -}; - -/***/ }), -/* 62 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Emitter = __webpack_require__(11); -var define = __webpack_require__(4); -var is = __webpack_require__(0); -var util = __webpack_require__(1); -var Selector = __webpack_require__(6); - -var emitterOptions = { - qualifierCompare: function qualifierCompare(selector1, selector2) { - if (selector1 == null || selector2 == null) { - return selector1 == null && selector2 == null; - } else { - return selector1.sameText(selector2); - } - }, - eventMatches: function eventMatches(ele, listener, eventObj) { - var selector = listener.qualifier; - - if (selector != null) { - return ele !== eventObj.target && is.element(eventObj.target) && selector.matches(eventObj.target); - } - - return true; - }, - eventFields: function eventFields(ele) { - return { - cy: ele.cy(), - target: ele - }; - }, - callbackContext: function callbackContext(ele, listener, eventObj) { - return listener.qualifier != null ? eventObj.target : ele; - }, - beforeEmit: function beforeEmit(context, listener /*, eventObj*/) { - if (listener.conf && listener.conf.once) { - listener.conf.onceCollection.removeListener(listener.event, listener.qualifier, listener.callback); - } - }, - bubble: function bubble() { - return true; - }, - parent: function parent(ele) { - return ele.isChild() ? ele.parent() : ele.cy(); - } -}; - -var argSelector = function argSelector(arg) { - if (is.string(arg)) { - return new Selector(arg); - } else { - return arg; - } -}; - -var elesfn = { - createEmitter: function createEmitter() { - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - var _p = ele._private; - - if (!_p.emitter) { - _p.emitter = new Emitter(util.assign({ - context: ele - }, emitterOptions)); - } - } - - return this; - }, - - emitter: function emitter() { - return this._private.emitter; - }, - - on: function on(events, selector, callback) { - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - - ele.emitter().on(events, argSelector(selector), callback); - } - - return this; - }, - - removeListener: function removeListener(events, selector, callback) { - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - - ele.emitter().removeListener(events, argSelector(selector), callback); - } - - return this; - }, - - one: function one(events, selector, callback) { - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - - ele.emitter().one(events, argSelector(selector), callback); - } - - return this; - }, - - once: function once(events, selector, callback) { - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - - ele.emitter().on(events, argSelector(selector), callback, { - once: true, - onceCollection: this - }); - } - }, - - emit: function emit(events, extraParams) { - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - - ele.emitter().emit(events, extraParams); - } - - return this; - }, - - emitAndNotify: function emitAndNotify(event, extraParams) { - // for internal use only - if (this.length === 0) { - return; - } // empty collections don't need to notify anything - - // notify renderer - this.cy().notify({ - type: event, - eles: this - }); - - this.emit(event, extraParams); - - return this; - } -}; - -define.eventAliasesOn(elesfn); - -module.exports = elesfn; - -/***/ }), -/* 63 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var Selector = __webpack_require__(6); - -var elesfn = { - nodes: function nodes(selector) { - return this.filter(function (ele) { - return ele.isNode(); - }).filter(selector); - }, - - edges: function edges(selector) { - return this.filter(function (ele) { - return ele.isEdge(); - }).filter(selector); - }, - - filter: function filter(_filter, thisArg) { - if (_filter === undefined) { - // check this first b/c it's the most common/performant case - return this; - } else if (is.string(_filter) || is.elementOrCollection(_filter)) { - return new Selector(_filter).filter(this); - } else if (is.fn(_filter)) { - var filterEles = this.spawn(); - var eles = this; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - var include = thisArg ? _filter.apply(thisArg, [ele, i, eles]) : _filter(ele, i, eles); - - if (include) { - filterEles.merge(ele); - } - } - - return filterEles; - } - - return this.spawn(); // if not handled by above, give 'em an empty collection - }, - - not: function not(toRemove) { - if (!toRemove) { - return this; - } else { - - if (is.string(toRemove)) { - toRemove = this.filter(toRemove); - } - - var elements = []; - var rMap = toRemove._private.map; - - for (var i = 0; i < this.length; i++) { - var element = this[i]; - - var remove = rMap.has(element.id()); - if (!remove) { - elements.push(element); - } - } - - return this.spawn(elements); - } - }, - - absoluteComplement: function absoluteComplement() { - var cy = this.cy(); - - return cy.mutableElements().not(this); - }, - - intersect: function intersect(other) { - // if a selector is specified, then filter by it instead - if (is.string(other)) { - var selector = other; - return this.filter(selector); - } - - var elements = []; - var col1 = this; - var col2 = other; - var col1Smaller = this.length < other.length; - var map2 = col1Smaller ? col2._private.map : col1._private.map; - var col = col1Smaller ? col1 : col2; - - for (var i = 0; i < col.length; i++) { - var id = col[i]._private.data.id; - var entry = map2.get(id); - - if (entry) { - elements.push(entry.ele); - } - } - - return this.spawn(elements); - }, - - xor: function xor(other) { - var cy = this._private.cy; - - if (is.string(other)) { - other = cy.$(other); - } - - var elements = []; - var col1 = this; - var col2 = other; - - var add = function add(col, other) { - for (var i = 0; i < col.length; i++) { - var ele = col[i]; - var id = ele._private.data.id; - var inOther = other.hasElementWithId(id); - - if (!inOther) { - elements.push(ele); - } - } - }; - - add(col1, col2); - add(col2, col1); - - return this.spawn(elements); - }, - - diff: function diff(other) { - var cy = this._private.cy; - - if (is.string(other)) { - other = cy.$(other); - } - - var left = []; - var right = []; - var both = []; - var col1 = this; - var col2 = other; - - var add = function add(col, other, retEles) { - - for (var i = 0; i < col.length; i++) { - var ele = col[i]; - var id = ele._private.data.id; - var inOther = other.hasElementWithId(id); - - if (inOther) { - both.push(ele); - } else { - retEles.push(ele); - } - } - }; - - add(col1, col2, left); - add(col2, col1, right); - - return { - left: this.spawn(left, { unique: true }), - right: this.spawn(right, { unique: true }), - both: this.spawn(both, { unique: true }) - }; - }, - - add: function add(toAdd) { - var cy = this._private.cy; - - if (!toAdd) { - return this; - } - - if (is.string(toAdd)) { - var selector = toAdd; - toAdd = cy.mutableElements().filter(selector); - } - - var elements = []; - - for (var i = 0; i < this.length; i++) { - elements.push(this[i]); - } - - var map = this._private.map; - - for (var _i = 0; _i < toAdd.length; _i++) { - - var add = !map.has(toAdd[_i].id()); - if (add) { - elements.push(toAdd[_i]); - } - } - - return this.spawn(elements); - }, - - // in place merge on calling collection - merge: function merge(toAdd) { - var _p = this._private; - var cy = _p.cy; - - if (!toAdd) { - return this; - } - - if (toAdd && is.string(toAdd)) { - var selector = toAdd; - toAdd = cy.mutableElements().filter(selector); - } - - var map = _p.map; - - for (var i = 0; i < toAdd.length; i++) { - var toAddEle = toAdd[i]; - var id = toAddEle._private.data.id; - var add = !map.has(id); - - if (add) { - var index = this.length++; - - this[index] = toAddEle; - - map.set(id, { ele: toAddEle, index: index }); - } else { - // replace - var _index = map.get(id).index; - - this[_index] = toAddEle; - map.set(id, { ele: toAddEle, index: _index }); - } - } - - return this; // chaining - }, - - // remove single ele in place in calling collection - unmergeOne: function unmergeOne(ele) { - ele = ele[0]; - - var _p = this._private; - var id = ele._private.data.id; - var map = _p.map; - var entry = map.get(id); - - if (!entry) { - return this; // no need to remove - } - - var i = entry.index; - - // remove ele - this[i] = undefined; - map.delete(id); - - var unmergedLastEle = i === this.length - 1; - - // replace empty spot with last ele in collection - if (this.length > 1 && !unmergedLastEle) { - var lastEleI = this.length - 1; - var lastEle = this[lastEleI]; - var lastEleId = lastEle._private.data.id; - - this[lastEleI] = undefined; - this[i] = lastEle; - map.set(lastEleId, { ele: lastEle, index: i }); - } - - // the collection is now 1 ele smaller - this.length--; - - return this; - }, - - // remove eles in place on calling collection - unmerge: function unmerge(toRemove) { - var cy = this._private.cy; - - if (!toRemove) { - return this; - } - - if (toRemove && is.string(toRemove)) { - var selector = toRemove; - toRemove = cy.mutableElements().filter(selector); - } - - for (var i = 0; i < toRemove.length; i++) { - this.unmergeOne(toRemove[i]); - } - - return this; // chaining - }, - - map: function map(mapFn, thisArg) { - var arr = []; - var eles = this; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - var ret = thisArg ? mapFn.apply(thisArg, [ele, i, eles]) : mapFn(ele, i, eles); - - arr.push(ret); - } - - return arr; - }, - - reduce: function reduce(fn, initialValue) { - var val = initialValue; - var eles = this; - - for (var i = 0; i < eles.length; i++) { - val = fn(val, eles[i], i, eles); - } - - return val; - }, - - max: function max(valFn, thisArg) { - var max = -Infinity; - var maxEle = void 0; - var eles = this; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - var val = thisArg ? valFn.apply(thisArg, [ele, i, eles]) : valFn(ele, i, eles); - - if (val > max) { - max = val; - maxEle = ele; - } - } - - return { - value: max, - ele: maxEle - }; - }, - - min: function min(valFn, thisArg) { - var min = Infinity; - var minEle = void 0; - var eles = this; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - var val = thisArg ? valFn.apply(thisArg, [ele, i, eles]) : valFn(ele, i, eles); - - if (val < min) { - min = val; - minEle = ele; - } - } - - return { - value: min, - ele: minEle - }; - } -}; - -// aliases -var fn = elesfn; -fn['u'] = fn['|'] = fn['+'] = fn.union = fn.or = fn.add; -fn['\\'] = fn['!'] = fn['-'] = fn.difference = fn.relativeComplement = fn.subtract = fn.not; -fn['n'] = fn['&'] = fn['.'] = fn.and = fn.intersection = fn.intersect; -fn['^'] = fn['(+)'] = fn['(-)'] = fn.symmetricDifference = fn.symdiff = fn.xor; -fn.fnFilter = fn.filterFn = fn.stdFilter = fn.filter; -fn.complement = fn.abscomp = fn.absoluteComplement; - -module.exports = elesfn; - -/***/ }), -/* 64 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var elesfn = { - isNode: function isNode() { - return this.group() === 'nodes'; - }, - - isEdge: function isEdge() { - return this.group() === 'edges'; - }, - - isLoop: function isLoop() { - return this.isEdge() && this.source().id() === this.target().id(); - }, - - isSimple: function isSimple() { - return this.isEdge() && this.source().id() !== this.target().id(); - }, - - group: function group() { - var ele = this[0]; - - if (ele) { - return ele._private.group; - } - } -}; - -module.exports = elesfn; - -/***/ }), -/* 65 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var zIndexSort = __webpack_require__(17); -var util = __webpack_require__(1); - -var elesfn = { - forEach: function forEach(fn, thisArg) { - if (is.fn(fn)) { - - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - var ret = thisArg ? fn.apply(thisArg, [ele, i, this]) : fn(ele, i, this); - - if (ret === false) { - break; - } // exit each early on return false - } - } - - return this; - }, - - toArray: function toArray() { - var array = []; - - for (var i = 0; i < this.length; i++) { - array.push(this[i]); - } - - return array; - }, - - slice: function slice(start, end) { - var array = []; - var thisSize = this.length; - - if (end == null) { - end = thisSize; - } - - if (start == null) { - start = 0; - } - - if (start < 0) { - start = thisSize + start; - } - - if (end < 0) { - end = thisSize + end; - } - - for (var i = start; i >= 0 && i < end && i < thisSize; i++) { - array.push(this[i]); - } - - return this.spawn(array); - }, - - size: function size() { - return this.length; - }, - - eq: function eq(i) { - return this[i] || this.spawn(); - }, - - first: function first() { - return this[0] || this.spawn(); - }, - - last: function last() { - return this[this.length - 1] || this.spawn(); - }, - - empty: function empty() { - return this.length === 0; - }, - - nonempty: function nonempty() { - return !this.empty(); - }, - - sort: function sort(sortFn) { - if (!is.fn(sortFn)) { - return this; - } - - var sorted = this.toArray().sort(sortFn); - - return this.spawn(sorted); - }, - - sortByZIndex: function sortByZIndex() { - return this.sort(zIndexSort); - }, - - zDepth: function zDepth() { - var ele = this[0]; - if (!ele) { - return undefined; - } - - // let cy = ele.cy(); - var _p = ele._private; - var group = _p.group; - - if (group === 'nodes') { - var depth = _p.data.parent ? ele.parents().size() : 0; - - if (!ele.isParent()) { - return util.MAX_INT - 1; // childless nodes always on top - } - - return depth; - } else { - var src = _p.source; - var tgt = _p.target; - var srcDepth = src.zDepth(); - var tgtDepth = tgt.zDepth(); - - return Math.max(srcDepth, tgtDepth, 0); // depth of deepest parent - } - } -}; - -elesfn.each = elesfn.forEach; - -module.exports = elesfn; - -/***/ }), -/* 66 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var util = __webpack_require__(1); -var Promise = __webpack_require__(5); -var math = __webpack_require__(2); - -var elesfn = { - // Calculates and returns node dimensions { x, y } based on options given - layoutDimensions: function layoutDimensions(options) { - options = util.assign({ - nodeDimensionsIncludeLabels: true - }, options); - - if (options.nodeDimensionsIncludeLabels) { - var bbDim = this.boundingBox(); - return { - w: bbDim.w, - h: bbDim.h - }; - } else { - return { - w: this.outerWidth(), - h: this.outerHeight() - }; - } - }, - - // using standard layout options, apply position function (w/ or w/o animation) - layoutPositions: function layoutPositions(layout, options, fn) { - var nodes = this.nodes(); - var cy = this.cy(); - var layoutEles = options.eles; // nodes & edges - var getMemoizeKey = function getMemoizeKey(node, i) { - return node.id() + '$' + i; - }; - var fnMem = util.memoize(fn, getMemoizeKey); // memoized version of position function - - layout.emit({ type: 'layoutstart', layout: layout }); - - layout.animations = []; - - var calculateSpacing = function calculateSpacing(spacing, nodesBb, pos) { - var center = { - x: nodesBb.x1 + nodesBb.w / 2, - y: nodesBb.y1 + nodesBb.h / 2 - }; - - var spacingVector = { // scale from center of bounding box (not necessarily 0,0) - x: (pos.x - center.x) * spacing, - y: (pos.y - center.y) * spacing - }; - - return { - x: center.x + spacingVector.x, - y: center.y + spacingVector.y - }; - }; - - var useSpacingFactor = options.spacingFactor && options.spacingFactor !== 1; - - var spacingBb = function spacingBb() { - if (!useSpacingFactor) { - return null; - } - - var bb = math.makeBoundingBox(); - - for (var i = 0; i < nodes.length; i++) { - var node = nodes[i]; - var pos = fnMem(node, i); - - math.expandBoundingBoxByPoint(bb, pos.x, pos.y); - } - - return bb; - }; - - var bb = spacingBb(); - - var getFinalPos = util.memoize(function (node, i) { - var newPos = fnMem(node, i); - var pos = node.position(); - - if (!is.number(pos.x) || !is.number(pos.y)) { - node.silentPosition({ x: 0, y: 0 }); - } - - if (useSpacingFactor) { - var spacing = Math.abs(options.spacingFactor); - - newPos = calculateSpacing(spacing, bb, newPos); - } - - if (options.transform != null) { - newPos = options.transform(node, newPos); - } - - return newPos; - }, getMemoizeKey); - - if (options.animate) { - for (var i = 0; i < nodes.length; i++) { - var node = nodes[i]; - var newPos = getFinalPos(node, i); - var animateNode = options.animateFilter == null || options.animateFilter(node, i); - - if (animateNode) { - var ani = node.animation({ - position: newPos, - duration: options.animationDuration, - easing: options.animationEasing - }); - - layout.animations.push(ani); - - ani.play(); - } else { - node.position(newPos); - } - } - - if (options.fit) { - var fitAni = cy.animation({ - fit: { - boundingBox: layoutEles.boundingBoxAt(getFinalPos), - padding: options.padding - }, - duration: options.animationDuration, - easing: options.animationEasing - }); - - layout.animations.push(fitAni); - - fitAni.play(); - } else if (options.zoom !== undefined && options.pan !== undefined) { - var zoomPanAni = cy.animation({ - zoom: options.zoom, - pan: options.pan, - duration: options.animationDuration, - easing: options.animationEasing - }); - - layout.animations.push(zoomPanAni); - - zoomPanAni.play(); - } - - layout.one('layoutready', options.ready); - layout.emit({ type: 'layoutready', layout: layout }); - - Promise.all(layout.animations.map(function (ani) { - return ani.promise(); - })).then(function () { - layout.one('layoutstop', options.stop); - layout.emit({ type: 'layoutstop', layout: layout }); - }); - } else { - - nodes.positions(getFinalPos); - - if (options.fit) { - cy.fit(options.eles, options.padding); - } - - if (options.zoom != null) { - cy.zoom(options.zoom); - } - - if (options.pan) { - cy.pan(options.pan); - } - - layout.one('layoutready', options.ready); - layout.emit({ type: 'layoutready', layout: layout }); - - layout.one('layoutstop', options.stop); - layout.emit({ type: 'layoutstop', layout: layout }); - } - - return this; // chaining - }, - - layout: function layout(options) { - var cy = this.cy(); - - return cy.makeLayout(util.extend({}, options, { - eles: this - })); - } - -}; - -// aliases: -elesfn.createLayout = elesfn.makeLayout = elesfn.layout; - -module.exports = elesfn; - -/***/ }), -/* 67 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); - -function styleCache(key, fn, ele) { - var _p = ele._private; - var cache = _p.styleCache = _p.styleCache || {}; - var val; - - if ((val = cache[key]) != null) { - return val; - } else { - val = cache[key] = fn(ele); - - return val; - } -} - -function cacheStyleFunction(key, fn) { - return function cachedStyleFunction(ele) { - return styleCache(key, fn, ele); - }; -} - -function cachePrototypeStyleFunction(key, fn) { - var selfFn = function selfFn(ele) { - return fn.call(ele); - }; - - return function cachedPrototypeStyleFunction() { - var ele = this[0]; - - if (ele) { - return styleCache(key, selfFn, ele); - } - }; -} - -var elesfn = { - - recalculateRenderedStyle: function recalculateRenderedStyle(useCache) { - var cy = this.cy(); - var renderer = cy.renderer(); - var styleEnabled = cy.styleEnabled(); - - if (renderer && styleEnabled) { - renderer.recalculateRenderedStyle(this, useCache); - } - - return this; - }, - - dirtyStyleCache: function dirtyStyleCache() { - var cy = this.cy(); - var dirty = function dirty(ele) { - return ele._private.styleCache = {}; - }; - - if (cy.hasCompoundNodes()) { - var eles = void 0; - - eles = this.spawnSelf().merge(this.descendants()).merge(this.parents()); - - eles.merge(eles.connectedEdges()); - - eles.forEach(dirty); - } else { - this.forEach(function (ele) { - dirty(ele); - - ele.connectedEdges().forEach(dirty); - }); - } - - return this; - }, - - // fully updates (recalculates) the style for the elements - updateStyle: function updateStyle(notifyRenderer) { - var cy = this._private.cy; - - if (!cy.styleEnabled()) { - return this; - } - - if (cy._private.batchingStyle) { - var bEles = cy._private.batchStyleEles; - - bEles.merge(this); - - return this; // chaining and exit early when batching - } - - var hasCompounds = cy.hasCompoundNodes(); - var style = cy.style(); - var updatedEles = this; - - notifyRenderer = notifyRenderer || notifyRenderer === undefined ? true : false; - - if (hasCompounds) { - // then add everything up and down for compound selector checks - updatedEles = this.spawnSelf().merge(this.descendants()).merge(this.parents()); - } - - var changedEles = style.apply(updatedEles); - - changedEles.dirtyStyleCache(); - changedEles.dirtyCompoundBoundsCache(); - - if (notifyRenderer) { - changedEles.emitAndNotify('style'); // let renderer know we changed style - } else { - changedEles.emit('style'); // just fire the event - } - - return this; // chaining - }, - - // just update the mappers in the elements' styles; cheaper than eles.updateStyle() - updateMappers: function updateMappers(notifyRenderer) { - var cy = this._private.cy; - var style = cy.style(); - notifyRenderer = notifyRenderer || notifyRenderer === undefined ? true : false; - - if (!cy.styleEnabled()) { - return this; - } - - var changedEles = style.updateMappers(this); - - changedEles.dirtyStyleCache(); - changedEles.dirtyCompoundBoundsCache(); - - if (notifyRenderer) { - changedEles.emitAndNotify('style'); // let renderer know we changed style - } else { - changedEles.emit('style'); // just fire the event - } - return this; // chaining - }, - - // get the internal parsed style object for the specified property - parsedStyle: function parsedStyle(property) { - var ele = this[0]; - var cy = ele.cy(); - - if (!cy.styleEnabled()) { - return; - } - - if (ele) { - return ele._private.style[property] || cy.style().getDefaultProperty(property); - } - }, - - numericStyle: function numericStyle(property) { - var ele = this[0]; - - if (!ele.cy().styleEnabled()) { - return; - } - - if (ele) { - var pstyle = ele.pstyle(property); - - return pstyle.pfValue !== undefined ? pstyle.pfValue : pstyle.value; - } - }, - - numericStyleUnits: function numericStyleUnits(property) { - var ele = this[0]; - - if (!ele.cy().styleEnabled()) { - return; - } - - if (ele) { - return ele.pstyle(property).units; - } - }, - - // get the specified css property as a rendered value (i.e. on-screen value) - // or get the whole rendered style if no property specified (NB doesn't allow setting) - renderedStyle: function renderedStyle(property) { - var cy = this.cy(); - if (!cy.styleEnabled()) { - return this; - } - - var ele = this[0]; - - if (ele) { - return cy.style().getRenderedStyle(ele, property); - } - }, - - // read the calculated css style of the element or override the style (via a bypass) - style: function style(name, value) { - var cy = this.cy(); - - if (!cy.styleEnabled()) { - return this; - } - - var updateTransitions = false; - var style = cy.style(); - - if (is.plainObject(name)) { - // then extend the bypass - var props = name; - style.applyBypass(this, props, updateTransitions); - - this.dirtyStyleCache(); - this.dirtyCompoundBoundsCache(); - - this.emitAndNotify('style'); // let the renderer know we've updated style - } else if (is.string(name)) { - - if (value === undefined) { - // then get the property from the style - var ele = this[0]; - - if (ele) { - return style.getStylePropertyValue(ele, name); - } else { - // empty collection => can't get any value - return; - } - } else { - // then set the bypass with the property value - style.applyBypass(this, name, value, updateTransitions); - - this.dirtyStyleCache(); - this.dirtyCompoundBoundsCache(); - - this.emitAndNotify('style'); // let the renderer know we've updated style - } - } else if (name === undefined) { - var _ele = this[0]; - - if (_ele) { - return style.getRawStyle(_ele); - } else { - // empty collection => can't get any value - return; - } - } - - return this; // chaining - }, - - removeStyle: function removeStyle(names) { - var cy = this.cy(); - - if (!cy.styleEnabled()) { - return this; - } - - var updateTransitions = false; - var style = cy.style(); - var eles = this; - - if (names === undefined) { - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - - style.removeAllBypasses(ele, updateTransitions); - } - } else { - names = names.split(/\s+/); - - for (var _i = 0; _i < eles.length; _i++) { - var _ele2 = eles[_i]; - - style.removeBypasses(_ele2, names, updateTransitions); - } - } - - this.dirtyStyleCache(); - this.dirtyCompoundBoundsCache(); - - this.emitAndNotify('style'); // let the renderer know we've updated style - - return this; // chaining - }, - - show: function show() { - this.css('display', 'element'); - return this; // chaining - }, - - hide: function hide() { - this.css('display', 'none'); - return this; // chaining - }, - - effectiveOpacity: function effectiveOpacity() { - var cy = this.cy(); - if (!cy.styleEnabled()) { - return 1; - } - - var hasCompoundNodes = cy.hasCompoundNodes(); - var ele = this[0]; - - if (ele) { - var _p = ele._private; - var parentOpacity = ele.pstyle('opacity').value; - - if (!hasCompoundNodes) { - return parentOpacity; - } - - var parents = !_p.data.parent ? null : ele.parents(); - - if (parents) { - for (var i = 0; i < parents.length; i++) { - var parent = parents[i]; - var opacity = parent.pstyle('opacity').value; - - parentOpacity = opacity * parentOpacity; - } - } - - return parentOpacity; - } - }, - - transparent: function transparent() { - var cy = this.cy(); - if (!cy.styleEnabled()) { - return false; - } - - var ele = this[0]; - var hasCompoundNodes = ele.cy().hasCompoundNodes(); - - if (ele) { - if (!hasCompoundNodes) { - return ele.pstyle('opacity').value === 0; - } else { - return ele.effectiveOpacity() === 0; - } - } - }, - - backgrounding: function backgrounding() { - var cy = this.cy(); - if (!cy.styleEnabled()) { - return false; - } - - var ele = this[0]; - - return ele._private.backgrounding ? true : false; - } - -}; - -function checkCompound(ele, parentOk) { - var _p = ele._private; - var parents = _p.data.parent ? ele.parents() : null; - - if (parents) { - for (var i = 0; i < parents.length; i++) { - var parent = parents[i]; - - if (!parentOk(parent)) { - return false; - } - } - } - - return true; -} - -function defineDerivedStateFunction(specs) { - var ok = specs.ok; - var edgeOkViaNode = specs.edgeOkViaNode || specs.ok; - var parentOk = specs.parentOk || specs.ok; - - return function () { - var cy = this.cy(); - if (!cy.styleEnabled()) { - return true; - } - - var ele = this[0]; - var hasCompoundNodes = cy.hasCompoundNodes(); - - if (ele) { - var _p = ele._private; - - if (!ok(ele)) { - return false; - } - - if (ele.isNode()) { - return !hasCompoundNodes || checkCompound(ele, parentOk); - } else { - var src = _p.source; - var tgt = _p.target; - - return edgeOkViaNode(src) && (!hasCompoundNodes || checkCompound(src, edgeOkViaNode)) && (src === tgt || edgeOkViaNode(tgt) && (!hasCompoundNodes || checkCompound(tgt, edgeOkViaNode))); - } - } - }; -} - -var eleTakesUpSpace = cacheStyleFunction('eleTakesUpSpace', function (ele) { - return ele.pstyle('display').value === 'element' && ele.width() !== 0 && (ele.isNode() ? ele.height() !== 0 : true); -}); - -elesfn.takesUpSpace = cachePrototypeStyleFunction('takesUpSpace', defineDerivedStateFunction({ - ok: eleTakesUpSpace -})); - -var eleInteractive = cacheStyleFunction('eleInteractive', function (ele) { - return ele.pstyle('events').value === 'yes' && ele.pstyle('visibility').value === 'visible' && eleTakesUpSpace(ele); -}); - -var parentInteractive = cacheStyleFunction('parentInteractive', function (parent) { - return parent.pstyle('visibility').value === 'visible' && eleTakesUpSpace(parent); -}); - -elesfn.interactive = cachePrototypeStyleFunction('interactive', defineDerivedStateFunction({ - ok: eleInteractive, - parentOk: parentInteractive, - edgeOkViaNode: eleTakesUpSpace -})); - -elesfn.noninteractive = function () { - var ele = this[0]; - - if (ele) { - return !ele.interactive(); - } -}; - -var eleVisible = cacheStyleFunction('eleVisible', function (ele) { - return ele.pstyle('visibility').value === 'visible' && ele.pstyle('opacity').pfValue !== 0 && eleTakesUpSpace(ele); -}); - -var edgeVisibleViaNode = eleTakesUpSpace; - -elesfn.visible = cachePrototypeStyleFunction('visible', defineDerivedStateFunction({ - ok: eleVisible, - edgeOkViaNode: edgeVisibleViaNode -})); - -elesfn.hidden = function () { - var ele = this[0]; - - if (ele) { - return !ele.visible(); - } -}; - -elesfn.bypass = elesfn.css = elesfn.style; -elesfn.renderedCss = elesfn.renderedStyle; -elesfn.removeBypass = elesfn.removeCss = elesfn.removeStyle; -elesfn.pstyle = elesfn.parsedStyle; - -module.exports = elesfn; - -/***/ }), -/* 68 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var elesfn = {}; - -function defineSwitchFunction(params) { - return function () { - var args = arguments; - var changedEles = []; - - // e.g. cy.nodes().select( data, handler ) - if (args.length === 2) { - var data = args[0]; - var handler = args[1]; - this.on(params.event, data, handler); - } - - // e.g. cy.nodes().select( handler ) - else if (args.length === 1) { - var _handler = args[0]; - this.on(params.event, _handler); - } - - // e.g. cy.nodes().select() - else if (args.length === 0) { - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - var able = !params.ableField || ele._private[params.ableField]; - var changed = ele._private[params.field] != params.value; - - if (params.overrideAble) { - var overrideAble = params.overrideAble(ele); - - if (overrideAble !== undefined) { - able = overrideAble; - - if (!overrideAble) { - return this; - } // to save cycles assume not able for all on override - } - } - - if (able) { - ele._private[params.field] = params.value; - - if (changed) { - changedEles.push(ele); - } - } - } - - var changedColl = this.spawn(changedEles); - changedColl.updateStyle(); // change of state => possible change of style - changedColl.emit(params.event); - } - - return this; - }; -} - -function defineSwitchSet(params) { - elesfn[params.field] = function () { - var ele = this[0]; - - if (ele) { - if (params.overrideField) { - var val = params.overrideField(ele); - - if (val !== undefined) { - return val; - } - } - - return ele._private[params.field]; - } - }; - - elesfn[params.on] = defineSwitchFunction({ - event: params.on, - field: params.field, - ableField: params.ableField, - overrideAble: params.overrideAble, - value: true - }); - - elesfn[params.off] = defineSwitchFunction({ - event: params.off, - field: params.field, - ableField: params.ableField, - overrideAble: params.overrideAble, - value: false - }); -} - -defineSwitchSet({ - field: 'locked', - overrideField: function overrideField(ele) { - return ele.cy().autolock() ? true : undefined; - }, - on: 'lock', - off: 'unlock' -}); - -defineSwitchSet({ - field: 'grabbable', - overrideField: function overrideField(ele) { - return ele.cy().autoungrabify() ? false : undefined; - }, - on: 'grabify', - off: 'ungrabify' -}); - -defineSwitchSet({ - field: 'selected', - ableField: 'selectable', - overrideAble: function overrideAble(ele) { - return ele.cy().autounselectify() ? false : undefined; - }, - on: 'select', - off: 'unselect' -}); - -defineSwitchSet({ - field: 'selectable', - overrideField: function overrideField(ele) { - return ele.cy().autounselectify() ? false : undefined; - }, - on: 'selectify', - off: 'unselectify' -}); - -elesfn.deselect = elesfn.unselect; - -elesfn.grabbed = function () { - var ele = this[0]; - if (ele) { - return ele._private.grabbed; - } -}; - -defineSwitchSet({ - field: 'active', - on: 'activate', - off: 'unactivate' -}); - -elesfn.inactive = function () { - var ele = this[0]; - if (ele) { - return !ele._private.active; - } -}; - -module.exports = elesfn; - -/***/ }), -/* 69 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var is = __webpack_require__(0); - -var elesfn = {}; - -var cache = function cache(fn, name) { - return function traversalCache(arg1, arg2, arg3, arg4) { - var selectorOrEles = arg1; - var eles = this; - var key = void 0; - - if (selectorOrEles == null) { - key = 'null'; - } else if (is.elementOrCollection(selectorOrEles) && selectorOrEles.length === 1) { - key = '#' + selectorOrEles.id(); - } - - if (eles.length === 1 && key) { - var _p = eles[0]._private; - var tch = _p.traversalCache = _p.traversalCache || {}; - var ch = tch[name] = tch[name] || {}; - var cacheHit = ch[key]; - - if (cacheHit) { - return cacheHit; - } else { - return ch[key] = fn.call(eles, arg1, arg2, arg3, arg4); - } - } else { - return fn.call(eles, arg1, arg2, arg3, arg4); - } - }; -}; - -// DAG functions -//////////////// - -var defineDagExtremity = function defineDagExtremity(params) { - return function dagExtremityImpl(selector) { - var eles = this; - var ret = []; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - if (!ele.isNode()) { - continue; - } - - var disqualified = false; - var edges = ele.connectedEdges(); - - for (var j = 0; j < edges.length; j++) { - var edge = edges[j]; - var src = edge.source(); - var tgt = edge.target(); - - if (params.noIncomingEdges && tgt === ele && src !== ele || params.noOutgoingEdges && src === ele && tgt !== ele) { - disqualified = true; - break; - } - } - - if (!disqualified) { - ret.push(ele); - } - } - - return this.spawn(ret, { unique: true }).filter(selector); - }; -}; - -var defineDagOneHop = function defineDagOneHop(params) { - return function (selector) { - var eles = this; - var oEles = []; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - - if (!ele.isNode()) { - continue; - } - - var edges = ele.connectedEdges(); - for (var j = 0; j < edges.length; j++) { - var edge = edges[j]; - var src = edge.source(); - var tgt = edge.target(); - - if (params.outgoing && src === ele) { - oEles.push(edge); - oEles.push(tgt); - } else if (params.incoming && tgt === ele) { - oEles.push(edge); - oEles.push(src); - } - } - } - - return this.spawn(oEles, { unique: true }).filter(selector); - }; -}; - -var defineDagAllHops = function defineDagAllHops(params) { - return function (selector) { - var eles = this; - var sEles = []; - var sElesIds = {}; - - for (;;) { - var next = params.outgoing ? eles.outgoers() : eles.incomers(); - - if (next.length === 0) { - break; - } // done if none left - - var newNext = false; - for (var i = 0; i < next.length; i++) { - var n = next[i]; - var nid = n.id(); - - if (!sElesIds[nid]) { - sElesIds[nid] = true; - sEles.push(n); - newNext = true; - } - } - - if (!newNext) { - break; - } // done if touched all outgoers already - - eles = next; - } - - return this.spawn(sEles, { unique: true }).filter(selector); - }; -}; - -elesfn.clearTraversalCache = function () { - for (var i = 0; i < this.length; i++) { - this[i]._private.traversalCache = null; - } -}; - -util.extend(elesfn, { - // get the root nodes in the DAG - roots: defineDagExtremity({ noIncomingEdges: true }), - - // get the leaf nodes in the DAG - leaves: defineDagExtremity({ noOutgoingEdges: true }), - - // normally called children in graph theory - // these nodes =edges=> outgoing nodes - outgoers: cache(defineDagOneHop({ outgoing: true }), 'outgoers'), - - // aka DAG descendants - successors: defineDagAllHops({ outgoing: true }), - - // normally called parents in graph theory - // these nodes <=edges= incoming nodes - incomers: cache(defineDagOneHop({ incoming: true }), 'incomers'), - - // aka DAG ancestors - predecessors: defineDagAllHops({ incoming: true }) -}); - -// Neighbourhood functions -////////////////////////// - -util.extend(elesfn, { - neighborhood: cache(function (selector) { - var elements = []; - var nodes = this.nodes(); - - for (var i = 0; i < nodes.length; i++) { - // for all nodes - var node = nodes[i]; - var connectedEdges = node.connectedEdges(); - - // for each connected edge, add the edge and the other node - for (var j = 0; j < connectedEdges.length; j++) { - var edge = connectedEdges[j]; - var src = edge.source(); - var tgt = edge.target(); - var otherNode = node === src ? tgt : src; - - // need check in case of loop - if (otherNode.length > 0) { - elements.push(otherNode[0]); // add node 1 hop away - } - - // add connected edge - elements.push(edge[0]); - } - } - - return this.spawn(elements, { unique: true }).filter(selector); - }, 'neighborhood'), - - closedNeighborhood: function closedNeighborhood(selector) { - return this.neighborhood().add(this).filter(selector); - }, - - openNeighborhood: function openNeighborhood(selector) { - return this.neighborhood(selector); - } -}); - -// aliases -elesfn.neighbourhood = elesfn.neighborhood; -elesfn.closedNeighbourhood = elesfn.closedNeighborhood; -elesfn.openNeighbourhood = elesfn.openNeighborhood; - -// Edge functions -///////////////// - -util.extend(elesfn, { - source: cache(function sourceImpl(selector) { - var ele = this[0]; - var src = void 0; - - if (ele) { - src = ele._private.source || ele.cy().collection(); - } - - return src && selector ? src.filter(selector) : src; - }, 'source'), - - target: cache(function targetImpl(selector) { - var ele = this[0]; - var tgt = void 0; - - if (ele) { - tgt = ele._private.target || ele.cy().collection(); - } - - return tgt && selector ? tgt.filter(selector) : tgt; - }, 'target'), - - sources: defineSourceFunction({ - attr: 'source' - }), - - targets: defineSourceFunction({ - attr: 'target' - }) -}); - -function defineSourceFunction(params) { - return function sourceImpl(selector) { - var sources = []; - - for (var i = 0; i < this.length; i++) { - var ele = this[i]; - var src = ele._private[params.attr]; - - if (src) { - sources.push(src); - } - } - - return this.spawn(sources, { unique: true }).filter(selector); - }; -} - -util.extend(elesfn, { - edgesWith: cache(defineEdgesWithFunction(), 'edgesWith'), - - edgesTo: cache(defineEdgesWithFunction({ - thisIsSrc: true - }), 'edgesTo') -}); - -function defineEdgesWithFunction(params) { - - return function edgesWithImpl(otherNodes) { - var elements = []; - var cy = this._private.cy; - var p = params || {}; - - // get elements if a selector is specified - if (is.string(otherNodes)) { - otherNodes = cy.$(otherNodes); - } - - for (var h = 0; h < otherNodes.length; h++) { - var edges = otherNodes[h]._private.edges; - - for (var i = 0; i < edges.length; i++) { - var edge = edges[i]; - var edgeData = edge._private.data; - var thisToOther = this.hasElementWithId(edgeData.source) && otherNodes.hasElementWithId(edgeData.target); - var otherToThis = otherNodes.hasElementWithId(edgeData.source) && this.hasElementWithId(edgeData.target); - var edgeConnectsThisAndOther = thisToOther || otherToThis; - - if (!edgeConnectsThisAndOther) { - continue; - } - - if (p.thisIsSrc || p.thisIsTgt) { - if (p.thisIsSrc && !thisToOther) { - continue; - } - - if (p.thisIsTgt && !otherToThis) { - continue; - } - } - - elements.push(edge); - } - } - - return this.spawn(elements, { unique: true }); - }; -} - -util.extend(elesfn, { - connectedEdges: cache(function (selector) { - var retEles = []; - - var eles = this; - for (var i = 0; i < eles.length; i++) { - var node = eles[i]; - if (!node.isNode()) { - continue; - } - - var edges = node._private.edges; - - for (var j = 0; j < edges.length; j++) { - var edge = edges[j]; - retEles.push(edge); - } - } - - return this.spawn(retEles, { unique: true }).filter(selector); - }, 'connectedEdges'), - - connectedNodes: cache(function (selector) { - var retEles = []; - - var eles = this; - for (var i = 0; i < eles.length; i++) { - var edge = eles[i]; - if (!edge.isEdge()) { - continue; - } - - retEles.push(edge.source()[0]); - retEles.push(edge.target()[0]); - } - - return this.spawn(retEles, { unique: true }).filter(selector); - }, 'connectedNodes'), - - parallelEdges: cache(defineParallelEdgesFunction(), 'parallelEdges'), - - codirectedEdges: cache(defineParallelEdgesFunction({ - codirected: true - }), 'codirectedEdges') -}); - -function defineParallelEdgesFunction(params) { - var defaults = { - codirected: false - }; - params = util.extend({}, defaults, params); - - return function parallelEdgesImpl(selector) { - // micro-optimised for renderer - var elements = []; - var edges = this.edges(); - var p = params; - - // look at all the edges in the collection - for (var i = 0; i < edges.length; i++) { - var edge1 = edges[i]; - var edge1_p = edge1._private; - var src1 = edge1_p.source; - var srcid1 = src1._private.data.id; - var tgtid1 = edge1_p.data.target; - var srcEdges1 = src1._private.edges; - - // look at edges connected to the src node of this edge - for (var j = 0; j < srcEdges1.length; j++) { - var edge2 = srcEdges1[j]; - var edge2data = edge2._private.data; - var tgtid2 = edge2data.target; - var srcid2 = edge2data.source; - - var codirected = tgtid2 === tgtid1 && srcid2 === srcid1; - var oppdirected = srcid1 === tgtid2 && tgtid1 === srcid2; - - if (p.codirected && codirected || !p.codirected && (codirected || oppdirected)) { - elements.push(edge2); - } - } - } - - return this.spawn(elements, { unique: true }).filter(selector); - }; -} - -// Misc functions -///////////////// - -util.extend(elesfn, { - components: function components() { - var self = this; - var cy = self.cy(); - var visited = self.spawn(); - var unvisited = self.nodes().spawnSelf(); - var components = []; - - var visitInComponent = function visitInComponent(node, component) { - visited.merge(node); - unvisited.unmerge(node); - component.merge(node); - }; - - if (unvisited.empty()) { - return self.spawn(); - } - - var _loop = function _loop() { - var component = cy.collection(); - components.push(component); - - var root = unvisited[0]; - visitInComponent(root, component); - - self.bfs({ - directed: false, - roots: root, - visit: function visit(v, e, u, i, depth) { - visitInComponent(v, component); - } - }); - }; - - do { - _loop(); - } while (unvisited.length > 0); - - return components.map(function (component) { - var connectedEdges = component.connectedEdges().stdFilter(function (edge) { - return component.anySame(edge.source()) && component.anySame(edge.target()); - }); - - return component.union(connectedEdges); - }); - } -}); - -module.exports = elesfn; - -/***/ }), -/* 70 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var util = __webpack_require__(1); -var Collection = __webpack_require__(7); -var Element = __webpack_require__(14); - -var corefn = { - add: function add(opts) { - - var elements = void 0; - var cy = this; - - // add the elements - if (is.elementOrCollection(opts)) { - var eles = opts; - - if (eles._private.cy === cy) { - // same instance => just restore - elements = eles.restore(); - } else { - // otherwise, copy from json - var jsons = []; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - jsons.push(ele.json()); - } - - elements = new Collection(cy, jsons); - } - } - - // specify an array of options - else if (is.array(opts)) { - var _jsons = opts; - - elements = new Collection(cy, _jsons); - } - - // specify via opts.nodes and opts.edges - else if (is.plainObject(opts) && (is.array(opts.nodes) || is.array(opts.edges))) { - var elesByGroup = opts; - var _jsons2 = []; - - var grs = ['nodes', 'edges']; - for (var _i = 0, il = grs.length; _i < il; _i++) { - var group = grs[_i]; - var elesArray = elesByGroup[group]; - - if (is.array(elesArray)) { - - for (var j = 0, jl = elesArray.length; j < jl; j++) { - var json = util.extend({ group: group }, elesArray[j]); - - _jsons2.push(json); - } - } - } - - elements = new Collection(cy, _jsons2); - } - - // specify options for one element - else { - var _json = opts; - elements = new Element(cy, _json).collection(); - } - - return elements; - }, - - remove: function remove(collection) { - if (is.elementOrCollection(collection)) { - // already have right ref - } else if (is.string(collection)) { - var selector = collection; - collection = this.$(selector); - } - - return collection.remove(); - } -}; - -module.exports = corefn; - -/***/ }), -/* 71 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var define = __webpack_require__(4); -var util = __webpack_require__(1); -var stepAll = __webpack_require__(72); - -var corefn = { - - // pull in animation functions - animate: define.animate(), - animation: define.animation(), - animated: define.animated(), - clearQueue: define.clearQueue(), - delay: define.delay(), - delayAnimation: define.delayAnimation(), - stop: define.stop(), - - addToAnimationPool: function addToAnimationPool(eles) { - var cy = this; - - if (!cy.styleEnabled()) { - return; - } // save cycles when no style used - - cy._private.aniEles.merge(eles); - }, - - stopAnimationLoop: function stopAnimationLoop() { - this._private.animationsRunning = false; - }, - - startAnimationLoop: function startAnimationLoop() { - var cy = this; - - cy._private.animationsRunning = true; - - if (!cy.styleEnabled()) { - return; - } // save cycles when no style used - - // NB the animation loop will exec in headless environments if style enabled - // and explicit cy.destroy() is necessary to stop the loop - - function headlessStep() { - if (!cy._private.animationsRunning) { - return; - } - - util.requestAnimationFrame(function animationStep(now) { - stepAll(now, cy); - headlessStep(); - }); - } - - var renderer = cy.renderer(); - - if (renderer && renderer.beforeRender) { - // let the renderer schedule animations - renderer.beforeRender(function rendererAnimationStep(willDraw, now) { - stepAll(now, cy); - }, renderer.beforeRenderPriorities.animations); - } else { - // manage the animation loop ourselves - headlessStep(); // first call - } - } - -}; - -module.exports = corefn; - -/***/ }), -/* 72 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var step = __webpack_require__(73); -var startAnimation = __webpack_require__(78); - -function stepAll(now, cy) { - var eles = cy._private.aniEles; - var doneEles = []; - - function stepOne(ele, isCore) { - var _p = ele._private; - var current = _p.animation.current; - var queue = _p.animation.queue; - var ranAnis = false; - - // cancel all animations on display:none ele - if (!isCore && ele.pstyle('display').value === 'none') { - // put all current and queue animations in this tick's current list - // and empty the lists for the element - current = current.splice(0, current.length).concat(queue.splice(0, queue.length)); - - // stop all animations - for (var i = 0; i < current.length; i++) { - current[i].stop(); - } - } - - // if nothing currently animating, get something from the queue - if (current.length === 0) { - var next = queue.shift(); - - if (next) { - current.push(next); - } - } - - var callbacks = function callbacks(_callbacks) { - for (var j = _callbacks.length - 1; j >= 0; j--) { - var cb = _callbacks[j]; - - cb(); - } - - _callbacks.splice(0, _callbacks.length); - }; - - // step and remove if done - for (var _i = current.length - 1; _i >= 0; _i--) { - var ani = current[_i]; - var ani_p = ani._private; - - if (ani_p.stopped) { - current.splice(_i, 1); - - ani_p.hooked = false; - ani_p.playing = false; - ani_p.started = false; - - callbacks(ani_p.frames); - - continue; - } - - if (!ani_p.playing && !ani_p.applying) { - continue; - } - - // an apply() while playing shouldn't do anything - if (ani_p.playing && ani_p.applying) { - ani_p.applying = false; - } - - if (!ani_p.started) { - startAnimation(ele, ani, now, isCore); - } - - step(ele, ani, now, isCore); - - if (ani_p.applying) { - ani_p.applying = false; - } - - callbacks(ani_p.frames); - - if (ani.completed()) { - current.splice(_i, 1); - - ani_p.hooked = false; - ani_p.playing = false; - ani_p.started = false; - - callbacks(ani_p.completes); - } - - ranAnis = true; - } - - if (!isCore && current.length === 0 && queue.length === 0) { - doneEles.push(ele); - } - - return ranAnis; - } // stepElement - - // handle all eles - var ranEleAni = false; - for (var e = 0; e < eles.length; e++) { - var ele = eles[e]; - var handledThisEle = stepOne(ele); - - ranEleAni = ranEleAni || handledThisEle; - } // each element - - var ranCoreAni = stepOne(cy, true); - - // notify renderer - if (ranEleAni || ranCoreAni) { - if (eles.length > 0) { - eles.dirtyCompoundBoundsCache(); - - cy.notify({ - type: 'draw', - eles: eles - }); - } else { - cy.notify({ - type: 'draw' - }); - } - } - - // remove elements from list of currently animating if its queues are empty - eles.unmerge(doneEles); - - cy.emit('step'); -} // stepAll - -module.exports = stepAll; - -/***/ }), -/* 73 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var easings = __webpack_require__(74); -var ease = __webpack_require__(77); -var is = __webpack_require__(0); - -function step(self, ani, now, isCore) { - var isEles = !isCore; - var _p = self._private; - var ani_p = ani._private; - var pEasing = ani_p.easing; - var startTime = ani_p.startTime; - var cy = isCore ? self : self.cy(); - var style = cy.style(); - - if (!ani_p.easingImpl) { - - if (pEasing == null) { - // use default - ani_p.easingImpl = easings['linear']; - } else { - // then define w/ name - var easingVals = void 0; - - if (is.string(pEasing)) { - var easingProp = style.parse('transition-timing-function', pEasing); - - easingVals = easingProp.value; - } else { - // then assume preparsed array - easingVals = pEasing; - } - - var name = void 0, - args = void 0; - - if (is.string(easingVals)) { - name = easingVals; - args = []; - } else { - name = easingVals[1]; - args = easingVals.slice(2).map(function (n) { - return +n; - }); - } - - if (args.length > 0) { - // create with args - if (name === 'spring') { - args.push(ani_p.duration); // need duration to generate spring - } - - ani_p.easingImpl = easings[name].apply(null, args); - } else { - // static impl by name - ani_p.easingImpl = easings[name]; - } - } - } - - var easing = ani_p.easingImpl; - var percent = void 0; - - if (ani_p.duration === 0) { - percent = 1; - } else { - percent = (now - startTime) / ani_p.duration; - } - - if (ani_p.applying) { - percent = ani_p.progress; - } - - if (percent < 0) { - percent = 0; - } else if (percent > 1) { - percent = 1; - } - - if (ani_p.delay == null) { - // then update - - var startPos = ani_p.startPosition; - var endPos = ani_p.position; - - if (endPos && isEles && !self.locked()) { - var pos = self.position(); - - if (valid(startPos.x, endPos.x)) { - pos.x = ease(startPos.x, endPos.x, percent, easing); - } - - if (valid(startPos.y, endPos.y)) { - pos.y = ease(startPos.y, endPos.y, percent, easing); - } - - self.emit('position'); - } - - var startPan = ani_p.startPan; - var endPan = ani_p.pan; - var pan = _p.pan; - var animatingPan = endPan != null && isCore; - if (animatingPan) { - if (valid(startPan.x, endPan.x)) { - pan.x = ease(startPan.x, endPan.x, percent, easing); - } - - if (valid(startPan.y, endPan.y)) { - pan.y = ease(startPan.y, endPan.y, percent, easing); - } - - self.emit('pan'); - } - - var startZoom = ani_p.startZoom; - var endZoom = ani_p.zoom; - var animatingZoom = endZoom != null && isCore; - if (animatingZoom) { - if (valid(startZoom, endZoom)) { - _p.zoom = ease(startZoom, endZoom, percent, easing); - } - - self.emit('zoom'); - } - - if (animatingPan || animatingZoom) { - self.emit('viewport'); - } - - var props = ani_p.style; - if (props && props.length > 0 && isEles) { - for (var i = 0; i < props.length; i++) { - var prop = props[i]; - var _name = prop.name; - var end = prop; - var start = ani_p.startStyle[_name]; - var propSpec = style.properties[start.name]; - var easedVal = ease(start, end, percent, easing, propSpec); - - style.overrideBypass(self, _name, easedVal); - } // for props - - self.emit('style'); - } // if - } - - ani_p.progress = percent; - - return percent; -} - -function valid(start, end) { - if (start == null || end == null) { - return false; - } - - if (is.number(start) && is.number(end)) { - return true; - } else if (start && end) { - return true; - } - - return false; -} - -module.exports = step; - -/***/ }), -/* 74 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var generateCubicBezier = __webpack_require__(75); -var generateSpringRK4 = __webpack_require__(76); - -var cubicBezier = function cubicBezier(t1, p1, t2, p2) { - var bezier = generateCubicBezier(t1, p1, t2, p2); - - return function (start, end, percent) { - return start + (end - start) * bezier(percent); - }; -}; - -var easings = { - 'linear': function linear(start, end, percent) { - return start + (end - start) * percent; - }, - - // default easings - 'ease': cubicBezier(0.25, 0.1, 0.25, 1), - 'ease-in': cubicBezier(0.42, 0, 1, 1), - 'ease-out': cubicBezier(0, 0, 0.58, 1), - 'ease-in-out': cubicBezier(0.42, 0, 0.58, 1), - - // sine - 'ease-in-sine': cubicBezier(0.47, 0, 0.745, 0.715), - 'ease-out-sine': cubicBezier(0.39, 0.575, 0.565, 1), - 'ease-in-out-sine': cubicBezier(0.445, 0.05, 0.55, 0.95), - - // quad - 'ease-in-quad': cubicBezier(0.55, 0.085, 0.68, 0.53), - 'ease-out-quad': cubicBezier(0.25, 0.46, 0.45, 0.94), - 'ease-in-out-quad': cubicBezier(0.455, 0.03, 0.515, 0.955), - - // cubic - 'ease-in-cubic': cubicBezier(0.55, 0.055, 0.675, 0.19), - 'ease-out-cubic': cubicBezier(0.215, 0.61, 0.355, 1), - 'ease-in-out-cubic': cubicBezier(0.645, 0.045, 0.355, 1), - - // quart - 'ease-in-quart': cubicBezier(0.895, 0.03, 0.685, 0.22), - 'ease-out-quart': cubicBezier(0.165, 0.84, 0.44, 1), - 'ease-in-out-quart': cubicBezier(0.77, 0, 0.175, 1), - - // quint - 'ease-in-quint': cubicBezier(0.755, 0.05, 0.855, 0.06), - 'ease-out-quint': cubicBezier(0.23, 1, 0.32, 1), - 'ease-in-out-quint': cubicBezier(0.86, 0, 0.07, 1), - - // expo - 'ease-in-expo': cubicBezier(0.95, 0.05, 0.795, 0.035), - 'ease-out-expo': cubicBezier(0.19, 1, 0.22, 1), - 'ease-in-out-expo': cubicBezier(1, 0, 0, 1), - - // circ - 'ease-in-circ': cubicBezier(0.6, 0.04, 0.98, 0.335), - 'ease-out-circ': cubicBezier(0.075, 0.82, 0.165, 1), - 'ease-in-out-circ': cubicBezier(0.785, 0.135, 0.15, 0.86), - - // user param easings... - - 'spring': function spring(tension, friction, duration) { - if (duration === 0) { - // can't get a spring w/ duration 0 - return easings.linear; // duration 0 => jump to end so impl doesn't matter - } - - var spring = generateSpringRK4(tension, friction, duration); - - return function (start, end, percent) { - return start + (end - start) * spring(percent); - }; - }, - - 'cubic-bezier': cubicBezier -}; - -module.exports = easings; - -/***/ }), -/* 75 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/* global Float32Array */ - -/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */ -function generateCubicBezier(mX1, mY1, mX2, mY2) { - var NEWTON_ITERATIONS = 4, - NEWTON_MIN_SLOPE = 0.001, - SUBDIVISION_PRECISION = 0.0000001, - SUBDIVISION_MAX_ITERATIONS = 10, - kSplineTableSize = 11, - kSampleStepSize = 1.0 / (kSplineTableSize - 1.0), - float32ArraySupported = typeof Float32Array !== 'undefined'; - - /* Must contain four arguments. */ - if (arguments.length !== 4) { - return false; - } - - /* Arguments must be numbers. */ - for (var i = 0; i < 4; ++i) { - if (typeof arguments[i] !== "number" || isNaN(arguments[i]) || !isFinite(arguments[i])) { - return false; - } - } - - /* X values must be in the [0, 1] range. */ - mX1 = Math.min(mX1, 1); - mX2 = Math.min(mX2, 1); - mX1 = Math.max(mX1, 0); - mX2 = Math.max(mX2, 0); - - var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize); - - function A(aA1, aA2) { - return 1.0 - 3.0 * aA2 + 3.0 * aA1; - } - - function B(aA1, aA2) { - return 3.0 * aA2 - 6.0 * aA1; - } - - function C(aA1) { - return 3.0 * aA1; - } - - function calcBezier(aT, aA1, aA2) { - return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; - } - - function getSlope(aT, aA1, aA2) { - return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); - } - - function newtonRaphsonIterate(aX, aGuessT) { - for (var _i = 0; _i < NEWTON_ITERATIONS; ++_i) { - var currentSlope = getSlope(aGuessT, mX1, mX2); - - if (currentSlope === 0.0) { - return aGuessT; - } - - var currentX = calcBezier(aGuessT, mX1, mX2) - aX; - aGuessT -= currentX / currentSlope; - } - - return aGuessT; - } - - function calcSampleValues() { - for (var _i2 = 0; _i2 < kSplineTableSize; ++_i2) { - mSampleValues[_i2] = calcBezier(_i2 * kSampleStepSize, mX1, mX2); - } - } - - function binarySubdivide(aX, aA, aB) { - var currentX = void 0, - currentT = void 0, - i = 0; - - do { - currentT = aA + (aB - aA) / 2.0; - currentX = calcBezier(currentT, mX1, mX2) - aX; - if (currentX > 0.0) { - aB = currentT; - } else { - aA = currentT; - } - } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS); - - return currentT; - } - - function getTForX(aX) { - var intervalStart = 0.0, - currentSample = 1, - lastSample = kSplineTableSize - 1; - - for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) { - intervalStart += kSampleStepSize; - } - - --currentSample; - - var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]), - guessForT = intervalStart + dist * kSampleStepSize, - initialSlope = getSlope(guessForT, mX1, mX2); - - if (initialSlope >= NEWTON_MIN_SLOPE) { - return newtonRaphsonIterate(aX, guessForT); - } else if (initialSlope === 0.0) { - return guessForT; - } else { - return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize); - } - } - - var _precomputed = false; - - function precompute() { - _precomputed = true; - if (mX1 !== mY1 || mX2 !== mY2) { - calcSampleValues(); - } - } - - var f = function f(aX) { - if (!_precomputed) { - precompute(); - } - if (mX1 === mY1 && mX2 === mY2) { - return aX; - } - if (aX === 0) { - return 0; - } - if (aX === 1) { - return 1; - } - - return calcBezier(getTForX(aX), mY1, mY2); - }; - - f.getControlPoints = function () { - return [{ - x: mX1, - y: mY1 - }, { - x: mX2, - y: mY2 - }]; - }; - - var str = "generateBezier(" + [mX1, mY1, mX2, mY2] + ")"; - f.toString = function () { - return str; - }; - - return f; -} - -module.exports = generateCubicBezier; - -/***/ }), -/* 76 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */ -/* Given a tension, friction, and duration, a simulation at 60FPS will first run without a defined duration in order to calculate the full path. A second pass - then adjusts the time delta -- using the relation between actual time and duration -- to calculate the path for the duration-constrained animation. */ -var generateSpringRK4 = function () { - function springAccelerationForState(state) { - return -state.tension * state.x - state.friction * state.v; - } - - function springEvaluateStateWithDerivative(initialState, dt, derivative) { - var state = { - x: initialState.x + derivative.dx * dt, - v: initialState.v + derivative.dv * dt, - tension: initialState.tension, - friction: initialState.friction - }; - - return { dx: state.v, dv: springAccelerationForState(state) }; - } - - function springIntegrateState(state, dt) { - var a = { - dx: state.v, - dv: springAccelerationForState(state) - }, - b = springEvaluateStateWithDerivative(state, dt * 0.5, a), - c = springEvaluateStateWithDerivative(state, dt * 0.5, b), - d = springEvaluateStateWithDerivative(state, dt, c), - dxdt = 1.0 / 6.0 * (a.dx + 2.0 * (b.dx + c.dx) + d.dx), - dvdt = 1.0 / 6.0 * (a.dv + 2.0 * (b.dv + c.dv) + d.dv); - - state.x = state.x + dxdt * dt; - state.v = state.v + dvdt * dt; - - return state; - } - - return function springRK4Factory(tension, friction, duration) { - - var initState = { - x: -1, - v: 0, - tension: null, - friction: null - }, - path = [0], - time_lapsed = 0, - tolerance = 1 / 10000, - DT = 16 / 1000, - have_duration = void 0, - dt = void 0, - last_state = void 0; - - tension = parseFloat(tension) || 500; - friction = parseFloat(friction) || 20; - duration = duration || null; - - initState.tension = tension; - initState.friction = friction; - - have_duration = duration !== null; - - /* Calculate the actual time it takes for this animation to complete with the provided conditions. */ - if (have_duration) { - /* Run the simulation without a duration. */ - time_lapsed = springRK4Factory(tension, friction); - /* Compute the adjusted time delta. */ - dt = time_lapsed / duration * DT; - } else { - dt = DT; - } - - for (;;) { - /* Next/step function .*/ - last_state = springIntegrateState(last_state || initState, dt); - /* Store the position. */ - path.push(1 + last_state.x); - time_lapsed += 16; - /* If the change threshold is reached, break. */ - if (!(Math.abs(last_state.x) > tolerance && Math.abs(last_state.v) > tolerance)) { - break; - } - } - - /* If duration is not defined, return the actual time required for completing this animation. Otherwise, return a closure that holds the - computed path and returns a snapshot of the position according to a given percentComplete. */ - return !have_duration ? time_lapsed : function (percentComplete) { - return path[percentComplete * (path.length - 1) | 0]; - }; - }; -}(); - -module.exports = generateSpringRK4; - -/***/ }), -/* 77 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); - -function getEasedValue(type, start, end, percent, easingFn) { - if (percent === 1) { - return end; - } - - var val = easingFn(start, end, percent); - - if (type == null) { - return val; - } - - if (type.roundValue || type.color) { - val = Math.round(val); - } - - if (type.min !== undefined) { - val = Math.max(val, type.min); - } - - if (type.max !== undefined) { - val = Math.min(val, type.max); - } - - return val; -} - -function getValue(prop, spec) { - if (prop.pfValue != null || prop.value != null) { - if (prop.pfValue != null && (spec == null || spec.type.units !== '%')) { - return prop.pfValue; - } else { - return prop.value; - } - } else { - return prop; - } -} - -function ease(startProp, endProp, percent, easingFn, propSpec) { - var type = propSpec != null ? propSpec.type : null; - - if (percent < 0) { - percent = 0; - } else if (percent > 1) { - percent = 1; - } - - var start = getValue(startProp, propSpec); - var end = getValue(endProp, propSpec); - - if (is.number(start) && is.number(end)) { - return getEasedValue(type, start, end, percent, easingFn); - } else if (is.array(start) && is.array(end)) { - var easedArr = []; - - for (var i = 0; i < end.length; i++) { - var si = start[i]; - var ei = end[i]; - - if (si != null && ei != null) { - var val = getEasedValue(type, si, ei, percent, easingFn); - - easedArr.push(val); - } else { - easedArr.push(ei); - } - } - - return easedArr; - } - - return undefined; -} - -module.exports = ease; - -/***/ }), -/* 78 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -function startAnimation(self, ani, now, isCore) { - var isEles = !isCore; - var ele = self; - var ani_p = ani._private; - var cy = isCore ? self : self.cy(); - var style = cy.style(); - - if (isEles) { - var pos = ele.position(); - - ani_p.startPosition = ani_p.startPosition || { - x: pos.x, - y: pos.y - }; - - ani_p.startStyle = ani_p.startStyle || style.getAnimationStartStyle(ele, ani_p.style); - } - - if (isCore) { - var pan = cy._private.pan; - - ani_p.startPan = ani_p.startPan || { - x: pan.x, - y: pan.y - }; - - ani_p.startZoom = ani_p.startZoom != null ? ani_p.startZoom : cy._private.zoom; - } - - ani_p.started = true; - ani_p.startTime = now - ani_p.progress * ani_p.duration; -} - -module.exports = startAnimation; - -/***/ }), -/* 79 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Emitter = __webpack_require__(11); -var define = __webpack_require__(4); -var is = __webpack_require__(0); -var util = __webpack_require__(1); -var Selector = __webpack_require__(6); - -var emitterOptions = { - qualifierCompare: function qualifierCompare(selector1, selector2) { - if (selector1 == null || selector2 == null) { - return selector1 == null && selector2 == null; - } else { - return selector1.sameText(selector2); - } - }, - eventMatches: function eventMatches(cy, listener, eventObj) { - var selector = listener.qualifier; - - if (selector != null) { - return cy !== eventObj.target && is.element(eventObj.target) && selector.matches(eventObj.target); - } - - return true; - }, - eventFields: function eventFields(cy) { - return { - cy: cy, - target: cy - }; - }, - callbackContext: function callbackContext(cy, listener, eventObj) { - return listener.qualifier != null ? eventObj.target : cy; - } -}; - -var argSelector = function argSelector(arg) { - if (is.string(arg)) { - return new Selector(arg); - } else { - return arg; - } -}; - -var elesfn = { - createEmitter: function createEmitter() { - var _p = this._private; - - if (!_p.emitter) { - _p.emitter = new Emitter(util.assign({ - context: this - }, emitterOptions)); - } - - return this; - }, - - emitter: function emitter() { - return this._private.emitter; - }, - - on: function on(events, selector, callback) { - this.emitter().on(events, argSelector(selector), callback); - - return this; - }, - - removeListener: function removeListener(events, selector, callback) { - this.emitter().removeListener(events, argSelector(selector), callback); - - return this; - }, - - one: function one(events, selector, callback) { - this.emitter().one(events, argSelector(selector), callback); - - return this; - }, - - once: function once(events, selector, callback) { - this.emitter().one(events, argSelector(selector), callback); - - return this; - }, - - emit: function emit(events, extraParams) { - this.emitter().emit(events, extraParams); - - return this; - } -}; - -define.eventAliasesOn(elesfn); - -module.exports = elesfn; - -/***/ }), -/* 80 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var corefn = { - - png: function png(options) { - var renderer = this._private.renderer; - options = options || {}; - - return renderer.png(options); - }, - - jpg: function jpg(options) { - var renderer = this._private.renderer; - options = options || {}; - - options.bg = options.bg || '#fff'; - - return renderer.jpg(options); - } - -}; - -corefn.jpeg = corefn.jpg; - -module.exports = corefn; - -/***/ }), -/* 81 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var is = __webpack_require__(0); - -var corefn = { - - layout: function layout(options) { - var cy = this; - - if (options == null) { - util.error('Layout options must be specified to make a layout'); - return; - } - - if (options.name == null) { - util.error('A `name` must be specified to make a layout'); - return; - } - - var name = options.name; - var Layout = cy.extension('layout', name); - - if (Layout == null) { - util.error('Can not apply layout: No such layout `' + name + '` found; did you include its JS file?'); - return; - } - - var eles = void 0; - if (is.string(options.eles)) { - eles = cy.$(options.eles); - } else { - eles = options.eles != null ? options.eles : cy.$(); - } - - var layout = new Layout(util.extend({}, options, { - cy: cy, - eles: eles - })); - - return layout; - } - -}; - -corefn.createLayout = corefn.makeLayout = corefn.layout; - -module.exports = corefn; - -/***/ }), -/* 82 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var corefn = { - notify: function notify(params) { - var _p = this._private; - - if (_p.batchingNotify) { - var bEles = _p.batchNotifyEles; - var bTypes = _p.batchNotifyTypes; - - if (params.eles) { - bEles.merge(params.eles); - } - - if (!bTypes.ids[params.type]) { - bTypes.push(params.type); - bTypes.ids[params.type] = true; - } - - return; // notifications are disabled during batching - } - - if (!_p.notificationsEnabled) { - return; - } // exit on disabled - - var renderer = this.renderer(); - - // exit if destroy() called on core or renderer in between frames #1499 #1528 - if (this.isDestroyed() || !renderer) { - return; - } - - renderer.notify(params); - }, - - notifications: function notifications(bool) { - var p = this._private; - - if (bool === undefined) { - return p.notificationsEnabled; - } else { - p.notificationsEnabled = bool ? true : false; - } - }, - - noNotifications: function noNotifications(callback) { - this.notifications(false); - callback(); - this.notifications(true); - }, - - batching: function batching() { - return this._private.batchCount > 0; - }, - - startBatch: function startBatch() { - var _p = this._private; - - if (_p.batchCount == null) { - _p.batchCount = 0; - } - - if (_p.batchCount === 0) { - _p.batchingStyle = _p.batchingNotify = true; - _p.batchStyleEles = this.collection(); - _p.batchNotifyEles = this.collection(); - _p.batchNotifyTypes = []; - _p.batchNotifyTypes.ids = {}; - } - - _p.batchCount++; - - return this; - }, - - endBatch: function endBatch() { - var _p = this._private; - - _p.batchCount--; - - if (_p.batchCount === 0) { - // update style for dirty eles - _p.batchingStyle = false; - _p.batchStyleEles.updateStyle(); - - // notify the renderer of queued eles and event types - _p.batchingNotify = false; - this.notify({ - type: _p.batchNotifyTypes, - eles: _p.batchNotifyEles - }); - } - - return this; - }, - - batch: function batch(callback) { - this.startBatch(); - callback(); - this.endBatch(); - - return this; - }, - - // for backwards compatibility - batchData: function batchData(map) { - var cy = this; - - return this.batch(function () { - var ids = Object.keys(map); - - for (var i = 0; i < ids.length; i++) { - var id = ids[i]; - var data = map[id]; - var ele = cy.getElementById(id); - - ele.data(data); - } - }); - } -}; - -module.exports = corefn; - -/***/ }), -/* 83 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); - -var corefn = { - - renderTo: function renderTo(context, zoom, pan, pxRatio) { - var r = this._private.renderer; - - r.renderTo(context, zoom, pan, pxRatio); - return this; - }, - - renderer: function renderer() { - return this._private.renderer; - }, - - forceRender: function forceRender() { - this.notify({ - type: 'draw' - }); - - return this; - }, - - resize: function resize() { - this.invalidateSize(); - - this.notify({ - type: 'resize' - }); - - this.emit('resize'); - - return this; - }, - - initRenderer: function initRenderer(options) { - var cy = this; - - var RendererProto = cy.extension('renderer', options.name); - if (RendererProto == null) { - util.error('Can not initialise: No such renderer `%s` found; did you include its JS file?', options.name); - return; - } - - cy._private.renderer = new RendererProto(util.extend({}, options, { cy: cy })); - - this.notify({ type: 'init' }); - }, - - destroyRenderer: function destroyRenderer() { - var cy = this; - - cy.notify({ type: 'destroy' }); // destroy the renderer - - var domEle = cy.container(); - if (domEle) { - domEle._cyreg = null; - - while (domEle.childNodes.length > 0) { - domEle.removeChild(domEle.childNodes[0]); - } - } - - cy._private.renderer = null; // to be extra safe, remove the ref - }, - - onRender: function onRender(fn) { - return this.on('render', fn); - }, - - offRender: function offRender(fn) { - return this.off('render', fn); - } - -}; - -corefn.invalidateDimensions = corefn.resize; - -module.exports = corefn; - -/***/ }), -/* 84 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var Collection = __webpack_require__(7); - -var corefn = { - - // get a collection - // - empty collection on no args - // - collection of elements in the graph on selector arg - // - guarantee a returned collection when elements or collection specified - collection: function collection(eles, opts) { - - if (is.string(eles)) { - return this.$(eles); - } else if (is.elementOrCollection(eles)) { - return eles.collection(); - } else if (is.array(eles)) { - return new Collection(this, eles, opts); - } - - return new Collection(this); - }, - - nodes: function nodes(selector) { - var nodes = this.$(function (ele) { - return ele.isNode(); - }); - - if (selector) { - return nodes.filter(selector); - } - - return nodes; - }, - - edges: function edges(selector) { - var edges = this.$(function (ele) { - return ele.isEdge(); - }); - - if (selector) { - return edges.filter(selector); - } - - return edges; - }, - - // search the graph like jQuery - $: function $(selector) { - var eles = this._private.elements; - - if (selector) { - return eles.filter(selector); - } else { - return eles.spawnSelf(); - } - }, - - mutableElements: function mutableElements() { - return this._private.elements; - } - -}; - -// aliases -corefn.elements = corefn.filter = corefn.$; - -module.exports = corefn; - -/***/ }), -/* 85 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var Style = __webpack_require__(18); - -var corefn = { - - style: function style(newStyle) { - if (newStyle) { - var s = this.setStyle(newStyle); - - s.update(); - } - - return this._private.style; - }, - - setStyle: function setStyle(style) { - var _p = this._private; - - if (is.stylesheet(style)) { - _p.style = style.generateStyle(this); - } else if (is.array(style)) { - _p.style = Style.fromJson(this, style); - } else if (is.string(style)) { - _p.style = Style.fromString(this, style); - } else { - _p.style = Style(this); - } - - return _p.style; - } -}; - -module.exports = corefn; - -/***/ }), -/* 86 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var is = __webpack_require__(0); -var Promise = __webpack_require__(5); - -var styfn = {}; - -// (potentially expensive calculation) -// apply the style to the element based on -// - its bypass -// - what selectors match it -styfn.apply = function (eles) { - var self = this; - var _p = self._private; - var cy = _p.cy; - var updatedEles = cy.collection(); - - if (_p.newStyle) { - // clear style caches - _p.contextStyles = {}; - _p.propDiffs = {}; - - self.cleanElements(eles, true); - } - - for (var ie = 0; ie < eles.length; ie++) { - var ele = eles[ie]; - - var cxtMeta = self.getContextMeta(ele); - - if (cxtMeta.empty) { - continue; - } else { - updatedEles.merge(ele); - } - - var cxtStyle = self.getContextStyle(cxtMeta); - var app = self.applyContextStyle(cxtMeta, cxtStyle, ele); - - if (!_p.newStyle) { - self.updateTransitions(ele, app.diffProps); - } - - self.updateStyleHints(ele); - } // for elements - - _p.newStyle = false; - - return updatedEles; -}; - -styfn.getPropertiesDiff = function (oldCxtKey, newCxtKey) { - var self = this; - var cache = self._private.propDiffs = self._private.propDiffs || {}; - var dualCxtKey = oldCxtKey + '-' + newCxtKey; - var cachedVal = cache[dualCxtKey]; - - if (cachedVal) { - return cachedVal; - } - - var diffProps = []; - var addedProp = {}; - - for (var i = 0; i < self.length; i++) { - var cxt = self[i]; - var oldHasCxt = oldCxtKey[i] === 't'; - var newHasCxt = newCxtKey[i] === 't'; - var cxtHasDiffed = oldHasCxt !== newHasCxt; - var cxtHasMappedProps = cxt.mappedProperties.length > 0; - - if (cxtHasDiffed || cxtHasMappedProps) { - var props = void 0; - - if (cxtHasDiffed && cxtHasMappedProps) { - props = cxt.properties; // suffices b/c mappedProperties is a subset of properties - } else if (cxtHasDiffed) { - props = cxt.properties; // need to check them all - } else if (cxtHasMappedProps) { - props = cxt.mappedProperties; // only need to check mapped - } - - for (var j = 0; j < props.length; j++) { - var prop = props[j]; - var name = prop.name; - - // if a later context overrides this property, then the fact that this context has switched/diffed doesn't matter - // (semi expensive check since it makes this function O(n^2) on context length, but worth it since overall result - // is cached) - var laterCxtOverrides = false; - for (var k = i + 1; k < self.length; k++) { - var laterCxt = self[k]; - var hasLaterCxt = newCxtKey[k] === 't'; - - if (!hasLaterCxt) { - continue; - } // can't override unless the context is active - - laterCxtOverrides = laterCxt.properties[prop.name] != null; - - if (laterCxtOverrides) { - break; - } // exit early as long as one later context overrides - } - - if (!addedProp[name] && !laterCxtOverrides) { - addedProp[name] = true; - diffProps.push(name); - } - } // for props - } // if - } // for contexts - - cache[dualCxtKey] = diffProps; - return diffProps; -}; - -styfn.getContextMeta = function (ele) { - var self = this; - var cxtKey = ''; - var diffProps = void 0; - var prevKey = ele._private.styleCxtKey || ''; - - if (self._private.newStyle) { - prevKey = ''; // since we need to apply all style if a fresh stylesheet - } - - // get the cxt key - for (var i = 0; i < self.length; i++) { - var context = self[i]; - var contextSelectorMatches = context.selector && context.selector.matches(ele); // NB: context.selector may be null for 'core' - - if (contextSelectorMatches) { - cxtKey += 't'; - } else { - cxtKey += 'f'; - } - } // for context - - diffProps = self.getPropertiesDiff(prevKey, cxtKey); - - ele._private.styleCxtKey = cxtKey; - - return { - key: cxtKey, - diffPropNames: diffProps, - empty: diffProps.length === 0 - }; -}; - -// gets a computed ele style object based on matched contexts -styfn.getContextStyle = function (cxtMeta) { - var cxtKey = cxtMeta.key; - var self = this; - var cxtStyles = this._private.contextStyles = this._private.contextStyles || {}; - - // if already computed style, returned cached copy - if (cxtStyles[cxtKey]) { - return cxtStyles[cxtKey]; - } - - var style = { - _private: { - key: cxtKey - } - }; - - for (var i = 0; i < self.length; i++) { - var cxt = self[i]; - var hasCxt = cxtKey[i] === 't'; - - if (!hasCxt) { - continue; - } - - for (var j = 0; j < cxt.properties.length; j++) { - var prop = cxt.properties[j]; - - style[prop.name] = prop; - } - } - - cxtStyles[cxtKey] = style; - return style; -}; - -styfn.applyContextStyle = function (cxtMeta, cxtStyle, ele) { - var self = this; - var diffProps = cxtMeta.diffPropNames; - var retDiffProps = {}; - - for (var i = 0; i < diffProps.length; i++) { - var diffPropName = diffProps[i]; - var cxtProp = cxtStyle[diffPropName]; - var eleProp = ele.pstyle(diffPropName); - - if (!cxtProp) { - // no context prop means delete - if (!eleProp) { - continue; // no existing prop means nothing needs to be removed - // nb affects initial application on mapped values like control-point-distances - } else if (eleProp.bypass) { - cxtProp = { name: diffPropName, deleteBypassed: true }; - } else { - cxtProp = { name: diffPropName, delete: true }; - } - } - - // save cycles when the context prop doesn't need to be applied - if (eleProp === cxtProp) { - continue; - } - - var retDiffProp = retDiffProps[diffPropName] = { - prev: eleProp - }; - - self.applyParsedProperty(ele, cxtProp); - - retDiffProp.next = ele.pstyle(diffPropName); - - if (retDiffProp.next && retDiffProp.next.bypass) { - retDiffProp.next = retDiffProp.next.bypassed; - } - } - - return { - diffProps: retDiffProps - }; -}; - -styfn.updateStyleHints = function (ele) { - var _p = ele._private; - var self = this; - - if (ele.removed()) { - return; - } - - // set whether has pie or not; for greater efficiency - var hasPie = false; - if (_p.group === 'nodes') { - for (var i = 1; i <= self.pieBackgroundN; i++) { - // 1..N - var _size = ele.pstyle('pie-' + i + '-background-size').value; - - if (_size > 0) { - hasPie = true; - break; - } - } - } - - _p.hasPie = hasPie; - - var transform = ele.pstyle('text-transform').strValue; - var content = ele.pstyle('label').strValue; - var srcContent = ele.pstyle('source-label').strValue; - var tgtContent = ele.pstyle('target-label').strValue; - var fStyle = ele.pstyle('font-style').strValue; - var size = ele.pstyle('font-size').pfValue + 'px'; - var family = ele.pstyle('font-family').strValue; - // let letiant = style['font-letiant'].strValue; - var weight = ele.pstyle('font-weight').strValue; - var valign = ele.pstyle('text-valign').strValue; - var halign = ele.pstyle('text-valign').strValue; - var oWidth = ele.pstyle('text-outline-width').pfValue; - var wrap = ele.pstyle('text-wrap').strValue; - var wrapW = ele.pstyle('text-max-width').pfValue; - var labelStyleKey = fStyle + '$' + size + '$' + family + '$' + weight + '$' + transform + '$' + valign + '$' + halign + '$' + oWidth + '$' + wrap + '$' + wrapW; - _p.labelStyleKey = labelStyleKey; - _p.sourceLabelKey = labelStyleKey + '$' + srcContent; - _p.targetLabelKey = labelStyleKey + '$' + tgtContent; - _p.labelKey = labelStyleKey + '$' + content; - _p.fontKey = fStyle + '$' + weight + '$' + size + '$' + family; - - _p.styleKey = Date.now(); -}; - -// apply a property to the style (for internal use) -// returns whether application was successful -// -// now, this function flattens the property, and here's how: -// -// for parsedProp:{ bypass: true, deleteBypass: true } -// no property is generated, instead the bypass property in the -// element's style is replaced by what's pointed to by the `bypassed` -// field in the bypass property (i.e. restoring the property the -// bypass was overriding) -// -// for parsedProp:{ mapped: truthy } -// the generated flattenedProp:{ mapping: prop } -// -// for parsedProp:{ bypass: true } -// the generated flattenedProp:{ bypassed: parsedProp } -styfn.applyParsedProperty = function (ele, parsedProp) { - var self = this; - var prop = parsedProp; - var style = ele._private.style; - var fieldVal = void 0, - flatProp = void 0; - var types = self.types; - var type = self.properties[prop.name].type; - var propIsBypass = prop.bypass; - var origProp = style[prop.name]; - var origPropIsBypass = origProp && origProp.bypass; - var _p = ele._private; - var flatPropMapping = 'mapping'; - - var checkZOrder = function checkZOrder() { - self.checkZOrderTrigger(ele, prop.name, origProp ? origProp.value : null, prop.value); - }; - - // edges connected to compound nodes can not be haystacks - if (parsedProp.name === 'curve-style' && parsedProp.value === 'haystack' && ele.isEdge() && (ele.isLoop() || ele.source().isParent() || ele.target().isParent())) { - prop = parsedProp = this.parse(parsedProp.name, 'bezier', propIsBypass); - } - - if (prop.delete) { - // delete the property and use the default value on falsey value - style[prop.name] = undefined; - - checkZOrder(); - - return true; - } - - if (prop.deleteBypassed) { - // delete the property that the - if (!origProp) { - checkZOrder(); - - return true; // can't delete if no prop - } else if (origProp.bypass) { - // delete bypassed - origProp.bypassed = undefined; - - checkZOrder(); - - return true; - } else { - return false; // we're unsuccessful deleting the bypassed - } - } - - // check if we need to delete the current bypass - if (prop.deleteBypass) { - // then this property is just here to indicate we need to delete - if (!origProp) { - checkZOrder(); - - return true; // property is already not defined - } else if (origProp.bypass) { - // then replace the bypass property with the original - // because the bypassed property was already applied (and therefore parsed), we can just replace it (no reapplying necessary) - style[prop.name] = origProp.bypassed; - - checkZOrder(); - - return true; - } else { - return false; // we're unsuccessful deleting the bypass - } - } - - var printMappingErr = function printMappingErr() { - util.error('Do not assign mappings to elements without corresponding data (e.g. ele `' + ele.id() + '` for property `' + prop.name + '` with data field `' + prop.field + '`); try a `[' + prop.field + ']` selector to limit scope to elements with `' + prop.field + '` defined'); - }; - - // put the property in the style objects - switch (prop.mapped) {// flatten the property if mapped - case types.mapData: - { - // flatten the field (e.g. data.foo.bar) - var fields = prop.field.split('.'); - var _fieldVal = _p.data; - - for (var i = 0; i < fields.length && _fieldVal; i++) { - var field = fields[i]; - _fieldVal = _fieldVal[field]; - } - - var percent = void 0; - if (!is.number(_fieldVal)) { - // then keep the mapping but assume 0% for now - percent = 0; - } else { - percent = (_fieldVal - prop.fieldMin) / (prop.fieldMax - prop.fieldMin); - } - - // make sure to bound percent value - if (percent < 0) { - percent = 0; - } else if (percent > 1) { - percent = 1; - } - - if (type.color) { - var r1 = prop.valueMin[0]; - var r2 = prop.valueMax[0]; - var g1 = prop.valueMin[1]; - var g2 = prop.valueMax[1]; - var b1 = prop.valueMin[2]; - var b2 = prop.valueMax[2]; - var a1 = prop.valueMin[3] == null ? 1 : prop.valueMin[3]; - var a2 = prop.valueMax[3] == null ? 1 : prop.valueMax[3]; - - var clr = [Math.round(r1 + (r2 - r1) * percent), Math.round(g1 + (g2 - g1) * percent), Math.round(b1 + (b2 - b1) * percent), Math.round(a1 + (a2 - a1) * percent)]; - - flatProp = { // colours are simple, so just create the flat property instead of expensive string parsing - bypass: prop.bypass, // we're a bypass if the mapping property is a bypass - name: prop.name, - value: clr, - strValue: 'rgb(' + clr[0] + ', ' + clr[1] + ', ' + clr[2] + ')' - }; - } else if (type.number) { - var calcValue = prop.valueMin + (prop.valueMax - prop.valueMin) * percent; - flatProp = this.parse(prop.name, calcValue, prop.bypass, flatPropMapping); - } else { - return false; // can only map to colours and numbers - } - - if (!flatProp) { - // if we can't flatten the property, then use the origProp so we still keep the mapping itself - flatProp = this.parse(prop.name, origProp.strValue, prop.bypass, flatPropMapping); - } - - if (!flatProp) { - printMappingErr(); - } - flatProp.mapping = prop; // keep a reference to the mapping - prop = flatProp; // the flattened (mapped) property is the one we want - - break; - } - - // direct mapping - case types.data: - { - // flatten the field (e.g. data.foo.bar) - var _fields = prop.field.split('.'); - var _fieldVal2 = _p.data; - - if (_fieldVal2) { - for (var _i = 0; _i < _fields.length; _i++) { - var _field = _fields[_i]; - _fieldVal2 = _fieldVal2[_field]; - } - } - - flatProp = this.parse(prop.name, _fieldVal2, prop.bypass, flatPropMapping); - - if (!flatProp) { - // if we can't flatten the property, then use the origProp so we still keep the mapping itself - var flatPropVal = origProp ? origProp.strValue : ''; - - flatProp = this.parse(prop.name, flatPropVal, prop.bypass, flatPropMapping); - } - - if (!flatProp) { - printMappingErr(); - } - flatProp.mapping = prop; // keep a reference to the mapping - prop = flatProp; // the flattened (mapped) property is the one we want - - break; - } - - case types.fn: - { - var fn = prop.value; - var fnRetVal = fn(ele); - - flatProp = this.parse(prop.name, fnRetVal, prop.bypass, flatPropMapping); - flatProp.mapping = prop; // keep a reference to the mapping - prop = flatProp; // the flattened (mapped) property is the one we want - - break; - } - - case undefined: - break; // just set the property - - default: - return false; // not a valid mapping - } - - // if the property is a bypass property, then link the resultant property to the original one - if (propIsBypass) { - if (origPropIsBypass) { - // then this bypass overrides the existing one - prop.bypassed = origProp.bypassed; // steal bypassed prop from old bypass - } else { - // then link the orig prop to the new bypass - prop.bypassed = origProp; - } - - style[prop.name] = prop; // and set - } else { - // prop is not bypass - if (origPropIsBypass) { - // then keep the orig prop (since it's a bypass) and link to the new prop - origProp.bypassed = prop; - } else { - // then just replace the old prop with the new one - style[prop.name] = prop; - } - } - - checkZOrder(); - - return true; -}; - -styfn.cleanElements = function (eles, keepBypasses) { - var self = this; - var props = self.properties; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - - if (!keepBypasses) { - ele._private.style = {}; - } else { - var style = ele._private.style; - - for (var j = 0; j < props.length; j++) { - var prop = props[j]; - var eleProp = style[prop.name]; - - if (eleProp) { - if (eleProp.bypass) { - eleProp.bypassed = null; - } else { - style[prop.name] = null; - } - } - } - } - } -}; - -// updates the visual style for all elements (useful for manual style modification after init) -styfn.update = function () { - var cy = this._private.cy; - var eles = cy.mutableElements(); - - eles.updateStyle(); -}; - -// just update the functional properties (i.e. mappings) in the elements' -// styles (less expensive than recalculation) -styfn.updateMappers = function (eles) { - var self = this; - var cy = this._private.cy; - var updatedEles = cy.collection(); - - for (var i = 0; i < eles.length; i++) { - // for each ele - var ele = eles[i]; - var style = ele._private.style; - var updatedEle = false; - - for (var j = 0; j < self.properties.length; j++) { - // for each prop - var prop = self.properties[j]; - var propInStyle = style[prop.name]; - - if (propInStyle && propInStyle.mapping) { - var mapping = propInStyle.mapping; - - this.applyParsedProperty(ele, mapping); // reapply the mapping property - - updatedEle = true; - } - } - - if (updatedEle) { - this.updateStyleHints(ele); - - updatedEles.merge(ele); - } - } - - return updatedEles; -}; - -// diffProps : { name => { prev, next } } -styfn.updateTransitions = function (ele, diffProps, isBypass) { - var self = this; - var _p = ele._private; - var props = ele.pstyle('transition-property').value; - var duration = ele.pstyle('transition-duration').pfValue; - var delay = ele.pstyle('transition-delay').pfValue; - - if (props.length > 0 && duration > 0) { - - var style = {}; - - // build up the style to animate towards - var anyPrev = false; - for (var i = 0; i < props.length; i++) { - var prop = props[i]; - var styProp = ele.pstyle(prop); - var diffProp = diffProps[prop]; - - if (!diffProp) { - continue; - } - - var prevProp = diffProp.prev; - var fromProp = prevProp; - var toProp = diffProp.next != null ? diffProp.next : styProp; - var diff = false; - var initVal = void 0; - var initDt = 0.000001; // delta time % value for initVal (allows animating out of init zero opacity) - - if (!fromProp) { - continue; - } - - // consider px values - if (is.number(fromProp.pfValue) && is.number(toProp.pfValue)) { - diff = toProp.pfValue - fromProp.pfValue; // nonzero is truthy - initVal = fromProp.pfValue + initDt * diff; - - // consider numerical values - } else if (is.number(fromProp.value) && is.number(toProp.value)) { - diff = toProp.value - fromProp.value; // nonzero is truthy - initVal = fromProp.value + initDt * diff; - - // consider colour values - } else if (is.array(fromProp.value) && is.array(toProp.value)) { - diff = fromProp.value[0] !== toProp.value[0] || fromProp.value[1] !== toProp.value[1] || fromProp.value[2] !== toProp.value[2]; - - initVal = fromProp.strValue; - } - - // the previous value is good for an animation only if it's different - if (diff) { - style[prop] = toProp.strValue; // to val - this.applyBypass(ele, prop, initVal); // from val - anyPrev = true; - } - } // end if props allow ani - - // can't transition if there's nothing previous to transition from - if (!anyPrev) { - return; - } - - _p.transitioning = true; - - new Promise(function (resolve) { - if (delay > 0) { - ele.delayAnimation(delay).play().promise().then(resolve); - } else { - resolve(); - } - }).then(function () { - return ele.animation({ - style: style, - duration: duration, - easing: ele.pstyle('transition-timing-function').value, - queue: false - }).play().promise(); - }).then(function () { - // if( !isBypass ){ - self.removeBypasses(ele, props); - ele.emitAndNotify('style'); - // } - - _p.transitioning = false; - }); - } else if (_p.transitioning) { - this.removeBypasses(ele, props); - ele.emitAndNotify('style'); - - _p.transitioning = false; - } -}; - -styfn.checkZOrderTrigger = function (ele, name, fromValue, toValue) { - var prop = this.properties[name]; - - if (prop.triggersZOrder != null && (fromValue == null || prop.triggersZOrder(fromValue, toValue))) { - this._private.cy.notify({ - type: 'zorder', - eles: ele - }); - } -}; - -module.exports = styfn; - -/***/ }), -/* 87 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var util = __webpack_require__(1); - -var styfn = {}; - -// bypasses are applied to an existing style on an element, and just tacked on temporarily -// returns true iff application was successful for at least 1 specified property -styfn.applyBypass = function (eles, name, value, updateTransitions) { - var self = this; - var props = []; - var isBypass = true; - - // put all the properties (can specify one or many) in an array after parsing them - if (name === '*' || name === '**') { - // apply to all property names - - if (value !== undefined) { - for (var i = 0; i < self.properties.length; i++) { - var prop = self.properties[i]; - var _name = prop.name; - - var parsedProp = this.parse(_name, value, true); - - if (parsedProp) { - props.push(parsedProp); - } - } - } - } else if (is.string(name)) { - // then parse the single property - var _parsedProp = this.parse(name, value, true); - - if (_parsedProp) { - props.push(_parsedProp); - } - } else if (is.plainObject(name)) { - // then parse each property - var specifiedProps = name; - updateTransitions = value; - - var names = Object.keys(specifiedProps); - - for (var _i = 0; _i < names.length; _i++) { - var _name2 = names[_i]; - var _prop = self.properties[_name2]; - var _value = specifiedProps[_name2]; - - if (_value === undefined) { - // try camel case name too - _value = specifiedProps[util.dash2camel(_name2)]; - } - - if (_value !== undefined) { - var _parsedProp2 = this.parse(_name2, _value, true); - - if (_parsedProp2) { - props.push(_parsedProp2); - } - } - } - } else { - // can't do anything without well defined properties - return false; - } - - // we've failed if there are no valid properties - if (props.length === 0) { - return false; - } - - // now, apply the bypass properties on the elements - var ret = false; // return true if at least one succesful bypass applied - for (var _i2 = 0; _i2 < eles.length; _i2++) { - // for each ele - var ele = eles[_i2]; - var diffProps = {}; - var diffProp = void 0; - - for (var j = 0; j < props.length; j++) { - // for each prop - var _prop2 = props[j]; - - if (updateTransitions) { - var prevProp = ele.pstyle(_prop2.name); - diffProp = diffProps[_prop2.name] = { prev: prevProp }; - } - - ret = this.applyParsedProperty(ele, _prop2) || ret; - - if (updateTransitions) { - diffProp.next = ele.pstyle(_prop2.name); - } - } // for props - - if (ret) { - this.updateStyleHints(ele); - } - - if (updateTransitions) { - this.updateTransitions(ele, diffProps, isBypass); - } - } // for eles - - return ret; -}; - -// only useful in specific cases like animation -styfn.overrideBypass = function (eles, name, value) { - name = util.camel2dash(name); - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - var prop = ele._private.style[name]; - var type = this.properties[name].type; - var isColor = type.color; - var isMulti = type.mutiple; - - if (!prop || !prop.bypass) { - // need a bypass if one doesn't exist - this.applyBypass(ele, name, value); - continue; - } - - var oldValue = prop.pfValue != null ? prop.pfValue : prop.value; - - prop.value = value; - - if (prop.pfValue != null) { - prop.pfValue = value; - } - - if (isColor) { - prop.strValue = 'rgb(' + value.join(',') + ')'; - } else if (isMulti) { - prop.strValue = value.join(' '); - } else { - prop.strValue = '' + value; - } - - this.checkZOrderTrigger(ele, name, oldValue, value); - } -}; - -styfn.removeAllBypasses = function (eles, updateTransitions) { - return this.removeBypasses(eles, this.propertyNames, updateTransitions); -}; - -styfn.removeBypasses = function (eles, props, updateTransitions) { - var isBypass = true; - - for (var j = 0; j < eles.length; j++) { - var ele = eles[j]; - var diffProps = {}; - - for (var i = 0; i < props.length; i++) { - var name = props[i]; - var prop = this.properties[name]; - var prevProp = ele.pstyle(prop.name); - - if (!prevProp || !prevProp.bypass) { - // if a bypass doesn't exist for the prop, nothing needs to be removed - continue; - } - - var value = ''; // empty => remove bypass - var parsedProp = this.parse(name, value, true); - var diffProp = diffProps[prop.name] = { prev: prevProp }; - - this.applyParsedProperty(ele, parsedProp); - - diffProp.next = ele.pstyle(prop.name); - } // for props - - this.updateStyleHints(ele); - - if (updateTransitions) { - this.updateTransitions(ele, diffProps, isBypass); - } - } // for eles -}; - -module.exports = styfn; - -/***/ }), -/* 88 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var window = __webpack_require__(3); - -var styfn = {}; - -// gets what an em size corresponds to in pixels relative to a dom element -styfn.getEmSizeInPixels = function () { - var px = this.containerCss('font-size'); - - if (px != null) { - return parseFloat(px); - } else { - return 1; // for headless - } -}; - -// gets css property from the core container -styfn.containerCss = function (propName) { - var cy = this._private.cy; - var domElement = cy.container(); - - if (window && domElement && window.getComputedStyle) { - return window.getComputedStyle(domElement).getPropertyValue(propName); - } -}; - -module.exports = styfn; - -/***/ }), -/* 89 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var is = __webpack_require__(0); - -var styfn = {}; - -// gets the rendered style for an element -styfn.getRenderedStyle = function (ele, prop) { - if (prop) { - return this.getStylePropertyValue(ele, prop, true); - } else { - return this.getRawStyle(ele, true); - } -}; - -// gets the raw style for an element -styfn.getRawStyle = function (ele, isRenderedVal) { - var self = this; - - ele = ele[0]; // insure it's an element - - if (ele) { - var rstyle = {}; - - for (var i = 0; i < self.properties.length; i++) { - var prop = self.properties[i]; - var val = self.getStylePropertyValue(ele, prop.name, isRenderedVal); - - if (val != null) { - rstyle[prop.name] = val; - rstyle[util.dash2camel(prop.name)] = val; - } - } - - return rstyle; - } -}; - -styfn.getIndexedStyle = function (ele, property, subproperty, index) { - var pstyle = ele.pstyle(property)[subproperty][index]; - return pstyle != null ? pstyle : ele.cy().style().getDefaultProperty(property)[subproperty][0]; -}; - -styfn.getStylePropertyValue = function (ele, propName, isRenderedVal) { - var self = this; - - ele = ele[0]; // insure it's an element - - if (ele) { - var prop = self.properties[propName]; - - if (prop.alias) { - prop = prop.pointsTo; - } - - var type = prop.type; - var styleProp = ele.pstyle(prop.name); - var zoom = ele.cy().zoom(); - - if (styleProp) { - var units = styleProp.units ? type.implicitUnits || 'px' : null; - var val = units ? [].concat(styleProp.pfValue).map(function (pfValue) { - return pfValue * (isRenderedVal ? zoom : 1) + units; - }).join(' ') : styleProp.strValue; - - return val; - } - } -}; - -styfn.getAnimationStartStyle = function (ele, aniProps) { - var rstyle = {}; - - for (var i = 0; i < aniProps.length; i++) { - var aniProp = aniProps[i]; - var name = aniProp.name; - - var styleProp = ele.pstyle(name); - - if (styleProp !== undefined) { - // then make a prop of it - if (is.plainObject(styleProp)) { - styleProp = this.parse(name, styleProp.strValue); - } else { - styleProp = this.parse(name, styleProp); - } - } - - if (styleProp) { - rstyle[name] = styleProp; - } - } - - return rstyle; -}; - -styfn.getPropsList = function (propsObj) { - var self = this; - var rstyle = []; - var style = propsObj; - var props = self.properties; - - if (style) { - var names = Object.keys(style); - - for (var i = 0; i < names.length; i++) { - var name = names[i]; - var val = style[name]; - var prop = props[name] || props[util.camel2dash(name)]; - var styleProp = this.parse(prop.name, val); - - if (styleProp) { - rstyle.push(styleProp); - } - } - } - - return rstyle; -}; - -module.exports = styfn; - -/***/ }), -/* 90 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var styfn = {}; - -styfn.appendFromJson = function (json) { - var style = this; - - for (var i = 0; i < json.length; i++) { - var context = json[i]; - var selector = context.selector; - var props = context.style || context.css; - var names = Object.keys(props); - - style.selector(selector); // apply selector - - for (var j = 0; j < names.length; j++) { - var name = names[j]; - var value = props[name]; - - style.css(name, value); // apply property - } - } - - return style; -}; - -// accessible cy.style() function -styfn.fromJson = function (json) { - var style = this; - - style.resetToDefault(); - style.appendFromJson(json); - - return style; -}; - -// get json from cy.style() api -styfn.json = function () { - var json = []; - - for (var i = this.defaultLength; i < this.length; i++) { - var cxt = this[i]; - var selector = cxt.selector; - var props = cxt.properties; - var css = {}; - - for (var j = 0; j < props.length; j++) { - var prop = props[j]; - css[prop.name] = prop.strValue; - } - - json.push({ - selector: !selector ? 'core' : selector.toString(), - style: css - }); - } - - return json; -}; - -module.exports = styfn; - -/***/ }), -/* 91 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var Selector = __webpack_require__(6); - -var styfn = {}; - -styfn.appendFromString = function (string) { - var self = this; - var style = this; - var remaining = '' + string; - var selAndBlockStr = void 0; - var blockRem = void 0; - var propAndValStr = void 0; - - // remove comments from the style string - remaining = remaining.replace(/[/][*](\s|.)+?[*][/]/g, ''); - - function removeSelAndBlockFromRemaining() { - // remove the parsed selector and block from the remaining text to parse - if (remaining.length > selAndBlockStr.length) { - remaining = remaining.substr(selAndBlockStr.length); - } else { - remaining = ''; - } - } - - function removePropAndValFromRem() { - // remove the parsed property and value from the remaining block text to parse - if (blockRem.length > propAndValStr.length) { - blockRem = blockRem.substr(propAndValStr.length); - } else { - blockRem = ''; - } - } - - while (true) { - var nothingLeftToParse = remaining.match(/^\s*$/); - if (nothingLeftToParse) { - break; - } - - var selAndBlock = remaining.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/); - - if (!selAndBlock) { - util.error('Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: ' + remaining); - break; - } - - selAndBlockStr = selAndBlock[0]; - - // parse the selector - var selectorStr = selAndBlock[1]; - if (selectorStr !== 'core') { - var selector = new Selector(selectorStr); - if (selector._private.invalid) { - util.error('Skipping parsing of block: Invalid selector found in string stylesheet: ' + selectorStr); - - // skip this selector and block - removeSelAndBlockFromRemaining(); - continue; - } - } - - // parse the block of properties and values - var blockStr = selAndBlock[2]; - var invalidBlock = false; - blockRem = blockStr; - var props = []; - - while (true) { - var _nothingLeftToParse = blockRem.match(/^\s*$/); - if (_nothingLeftToParse) { - break; - } - - var propAndVal = blockRem.match(/^\s*(.+?)\s*:\s*(.+?)\s*;/); - - if (!propAndVal) { - util.error('Skipping parsing of block: Invalid formatting of style property and value definitions found in:' + blockStr); - invalidBlock = true; - break; - } - - propAndValStr = propAndVal[0]; - var propStr = propAndVal[1]; - var valStr = propAndVal[2]; - - var prop = self.properties[propStr]; - if (!prop) { - util.error('Skipping property: Invalid property name in: ' + propAndValStr); - - // skip this property in the block - removePropAndValFromRem(); - continue; - } - - var parsedProp = style.parse(propStr, valStr); - - if (!parsedProp) { - util.error('Skipping property: Invalid property definition in: ' + propAndValStr); - - // skip this property in the block - removePropAndValFromRem(); - continue; - } - - props.push({ - name: propStr, - val: valStr - }); - removePropAndValFromRem(); - } - - if (invalidBlock) { - removeSelAndBlockFromRemaining(); - break; - } - - // put the parsed block in the style - style.selector(selectorStr); - for (var i = 0; i < props.length; i++) { - var _prop = props[i]; - style.css(_prop.name, _prop.val); - } - - removeSelAndBlockFromRemaining(); - } - - return style; -}; - -styfn.fromString = function (string) { - var style = this; - - style.resetToDefault(); - style.appendFromString(string); - - return style; -}; - -module.exports = styfn; - -/***/ }), -/* 92 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var is = __webpack_require__(0); - -var styfn = {}; - -(function () { - var number = util.regex.number; - var rgba = util.regex.rgbaNoBackRefs; - var hsla = util.regex.hslaNoBackRefs; - var hex3 = util.regex.hex3; - var hex6 = util.regex.hex6; - var data = function data(prefix) { - return '^' + prefix + '\\s*\\(\\s*([\\w\\.]+)\\s*\\)$'; - }; - var mapData = function mapData(prefix) { - var mapArg = number + '|\\w+|' + rgba + '|' + hsla + '|' + hex3 + '|' + hex6; - return '^' + prefix + '\\s*\\(([\\w\\.]+)\\s*\\,\\s*(' + number + ')\\s*\\,\\s*(' + number + ')\\s*,\\s*(' + mapArg + ')\\s*\\,\\s*(' + mapArg + ')\\)$'; - }; - var urlRegexes = ['^url\\s*\\(\\s*[\'"]?(.+?)[\'"]?\\s*\\)$', '^(none)$', '^(.+)$']; - - // each visual style property has a type and needs to be validated according to it - styfn.types = { - time: { number: true, min: 0, units: 's|ms', implicitUnits: 'ms' }, - percent: { number: true, min: 0, max: 100, units: '%', implicitUnits: '%' }, - zeroOneNumber: { number: true, min: 0, max: 1, unitless: true }, - zeroOneNumbers: { number: true, min: 0, max: 1, unitless: true, multiple: true }, - nOneOneNumber: { number: true, min: -1, max: 1, unitless: true }, - nonNegativeInt: { number: true, min: 0, integer: true, unitless: true }, - position: { enums: ['parent', 'origin'] }, - nodeSize: { number: true, min: 0, enums: ['label'] }, - number: { number: true, unitless: true }, - numbers: { number: true, unitless: true, multiple: true }, - positiveNumber: { number: true, unitless: true, min: 0, strictMin: true }, - size: { number: true, min: 0 }, - bidirectionalSize: { number: true }, // allows negative - bidirectionalSizes: { number: true, multiple: true }, // allows negative - sizeMaybePercent: { number: true, min: 0, allowPercent: true }, - paddingRelativeTo: { enums: ['width', 'height', 'average', 'min', 'max'] }, - bgWH: { number: true, min: 0, allowPercent: true, enums: ['auto'], multiple: true }, - bgPos: { number: true, allowPercent: true, multiple: true }, - bgRelativeTo: { enums: ['inner', 'include-padding'], multiple: true }, - bgRepeat: { enums: ['repeat', 'repeat-x', 'repeat-y', 'no-repeat'], multiple: true }, - bgFit: { enums: ['none', 'contain', 'cover'], multiple: true }, - bgCrossOrigin: { enums: ['anonymous', 'use-credentials'], multiple: true }, - bgClip: { enums: ['none', 'node'] }, - color: { color: true }, - bool: { enums: ['yes', 'no'] }, - lineStyle: { enums: ['solid', 'dotted', 'dashed'] }, - borderStyle: { enums: ['solid', 'dotted', 'dashed', 'double'] }, - curveStyle: { enums: ['bezier', 'unbundled-bezier', 'haystack', 'segments'] }, - fontFamily: { regex: '^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$' }, - fontletiant: { enums: ['small-caps', 'normal'] }, - fontStyle: { enums: ['italic', 'normal', 'oblique'] }, - fontWeight: { enums: ['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '800', '900', 100, 200, 300, 400, 500, 600, 700, 800, 900] }, - textDecoration: { enums: ['none', 'underline', 'overline', 'line-through'] }, - textTransform: { enums: ['none', 'uppercase', 'lowercase'] }, - textWrap: { enums: ['none', 'wrap', 'ellipsis'] }, - textBackgroundShape: { enums: ['rectangle', 'roundrectangle'] }, - nodeShape: { enums: ['rectangle', 'roundrectangle', 'cutrectangle', 'bottomroundrectangle', 'barrel', 'ellipse', 'triangle', 'square', 'pentagon', 'hexagon', 'concavehexagon', 'heptagon', 'octagon', 'tag', 'star', 'diamond', 'vee', 'rhomboid', 'polygon'] }, - compoundIncludeLabels: { enums: ['include', 'exclude'] }, - arrowShape: { enums: ['tee', 'triangle', 'triangle-tee', 'triangle-cross', 'triangle-backcurve', 'half-triangle-overshot', 'vee', 'square', 'circle', 'diamond', 'none'] }, - arrowFill: { enums: ['filled', 'hollow'] }, - display: { enums: ['element', 'none'] }, - visibility: { enums: ['hidden', 'visible'] }, - zCompoundDepth: { enums: ['bottom', 'orphan', 'auto', 'top'] }, - zIndexCompare: { enums: ['auto', 'manual'] }, - valign: { enums: ['top', 'center', 'bottom'] }, - halign: { enums: ['left', 'center', 'right'] }, - text: { string: true }, - data: { mapping: true, regex: data('data') }, - layoutData: { mapping: true, regex: data('layoutData') }, - scratch: { mapping: true, regex: data('scratch') }, - mapData: { mapping: true, regex: mapData('mapData') }, - mapLayoutData: { mapping: true, regex: mapData('mapLayoutData') }, - mapScratch: { mapping: true, regex: mapData('mapScratch') }, - fn: { mapping: true, fn: true }, - url: { regexes: urlRegexes, singleRegexMatchValue: true }, - urls: { regexes: urlRegexes, singleRegexMatchValue: true, multiple: true }, - propList: { propList: true }, - angle: { number: true, units: 'deg|rad', implicitUnits: 'rad' }, - textRotation: { number: true, units: 'deg|rad', implicitUnits: 'rad', enums: ['none', 'autorotate'] }, - polygonPointList: { number: true, multiple: true, evenMultiple: true, min: -1, max: 1, unitless: true }, - edgeDistances: { enums: ['intersection', 'node-position'] }, - edgeEndpoint: { - number: true, multiple: true, units: '%|px|em|deg|rad', implicitUnits: 'px', - enums: ['inside-to-node', 'outside-to-node', 'outside-to-line'], singleEnum: true, - validate: function validate(valArr, unitsArr) { - switch (valArr.length) { - case 2: - // can be % or px only - return unitsArr[0] !== 'deg' && unitsArr[0] !== 'rad' && unitsArr[1] !== 'deg' && unitsArr[1] !== 'rad'; - case 1: - // can be enum, deg, or rad only - return is.string(valArr[0]) || unitsArr[0] === 'deg' || unitsArr[0] === 'rad'; - default: - return false; - } - } - }, - easing: { - regexes: ['^(spring)\\s*\\(\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*\\)$', '^(cubic-bezier)\\s*\\(\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*\\)$'], - enums: ['linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out', 'ease-in-sine', 'ease-out-sine', 'ease-in-out-sine', 'ease-in-quad', 'ease-out-quad', 'ease-in-out-quad', 'ease-in-cubic', 'ease-out-cubic', 'ease-in-out-cubic', 'ease-in-quart', 'ease-out-quart', 'ease-in-out-quart', 'ease-in-quint', 'ease-out-quint', 'ease-in-out-quint', 'ease-in-expo', 'ease-out-expo', 'ease-in-out-expo', 'ease-in-circ', 'ease-out-circ', 'ease-in-out-circ'] - } - }; - - var zOrderDiff = { - zeroNonZero: function zeroNonZero(val1, val2) { - if (val1 === 0 && val2 !== 0) { - return true; - } else if (val1 !== 0 && val2 === 0) { - return true; - } else { - return false; - } - }, - anyDiff: function anyDiff(val1, val2) { - return val1 !== val2; - } - }; - - var zd = zOrderDiff; - - // define visual style properties - var t = styfn.types; - var props = styfn.properties = [ - // main label - { name: 'label', type: t.text }, { name: 'text-rotation', type: t.textRotation }, { name: 'text-margin-x', type: t.bidirectionalSize }, { name: 'text-margin-y', type: t.bidirectionalSize }, - - // source label - { name: 'source-label', type: t.text }, { name: 'source-text-rotation', type: t.textRotation }, { name: 'source-text-margin-x', type: t.bidirectionalSize }, { name: 'source-text-margin-y', type: t.bidirectionalSize }, { name: 'source-text-offset', type: t.size }, - - // target label - { name: 'target-label', type: t.text }, { name: 'target-text-rotation', type: t.textRotation }, { name: 'target-text-margin-x', type: t.bidirectionalSize }, { name: 'target-text-margin-y', type: t.bidirectionalSize }, { name: 'target-text-offset', type: t.size }, - - // common label style - { name: 'text-valign', type: t.valign }, { name: 'text-halign', type: t.halign }, { name: 'color', type: t.color }, { name: 'text-outline-color', type: t.color }, { name: 'text-outline-width', type: t.size }, { name: 'text-outline-opacity', type: t.zeroOneNumber }, { name: 'text-opacity', type: t.zeroOneNumber }, { name: 'text-background-color', type: t.color }, { name: 'text-background-opacity', type: t.zeroOneNumber }, { name: 'text-background-padding', type: t.size }, { name: 'text-border-opacity', type: t.zeroOneNumber }, { name: 'text-border-color', type: t.color }, { name: 'text-border-width', type: t.size }, { name: 'text-border-style', type: t.borderStyle }, { name: 'text-background-shape', type: t.textBackgroundShape }, - // { name: 'text-decoration', type: t.textDecoration }, // not supported in canvas - { name: 'text-transform', type: t.textTransform }, { name: 'text-wrap', type: t.textWrap }, { name: 'text-max-width', type: t.size }, { name: 'text-events', type: t.bool }, { name: 'font-family', type: t.fontFamily }, { name: 'font-style', type: t.fontStyle }, - // { name: 'font-letiant', type: t.fontletiant }, // not useful - { name: 'font-weight', type: t.fontWeight }, { name: 'font-size', type: t.size }, { name: 'min-zoomed-font-size', type: t.size }, - - // behaviour - { name: 'events', type: t.bool }, - - // visibility - { name: 'display', type: t.display, triggersZOrder: zd.anyDiff }, { name: 'visibility', type: t.visibility, triggersZOrder: zd.anyDiff }, { name: 'opacity', type: t.zeroOneNumber, triggersZOrder: zd.zeroNonZero }, { name: 'z-compound-depth', type: t.zCompoundDepth, triggersZOrder: zd.anyDiff }, { name: 'z-index-compare', type: t.zIndexCompare, triggersZOrder: zd.anyDiff }, { name: 'z-index', type: t.nonNegativeInt, triggersZOrder: zd.anyDiff }, - - // overlays - { name: 'overlay-padding', type: t.size }, { name: 'overlay-color', type: t.color }, { name: 'overlay-opacity', type: t.zeroOneNumber }, - - // transition anis - { name: 'transition-property', type: t.propList }, { name: 'transition-duration', type: t.time }, { name: 'transition-delay', type: t.time }, { name: 'transition-timing-function', type: t.easing }, - - // node body - { name: 'height', type: t.nodeSize }, { name: 'width', type: t.nodeSize }, { name: 'shape', type: t.nodeShape }, { name: 'shape-polygon-points', type: t.polygonPointList }, { name: 'background-color', type: t.color }, { name: 'background-opacity', type: t.zeroOneNumber }, { name: 'background-blacken', type: t.nOneOneNumber }, { name: 'padding', type: t.sizeMaybePercent }, { name: 'padding-relative-to', type: t.paddingRelativeTo }, - - // node border - { name: 'border-color', type: t.color }, { name: 'border-opacity', type: t.zeroOneNumber }, { name: 'border-width', type: t.size }, { name: 'border-style', type: t.borderStyle }, - - // node background images - { name: 'background-image', type: t.urls }, { name: 'background-image-crossorigin', type: t.bgCrossOrigin }, { name: 'background-image-opacity', type: t.zeroOneNumbers }, { name: 'background-position-x', type: t.bgPos }, { name: 'background-position-y', type: t.bgPos }, { name: 'background-width-relative-to', type: t.bgRelativeTo }, { name: 'background-height-relative-to', type: t.bgRelativeTo }, { name: 'background-repeat', type: t.bgRepeat }, { name: 'background-fit', type: t.bgFit }, { name: 'background-clip', type: t.bgClip }, { name: 'background-width', type: t.bgWH }, { name: 'background-height', type: t.bgWH }, - - // compound props - { name: 'position', type: t.position }, { name: 'compound-sizing-wrt-labels', type: t.compoundIncludeLabels }, { name: 'min-width', type: t.size }, { name: 'min-width-bias-left', type: t.sizeMaybePercent }, { name: 'min-width-bias-right', type: t.sizeMaybePercent }, { name: 'min-height', type: t.size }, { name: 'min-height-bias-top', type: t.sizeMaybePercent }, { name: 'min-height-bias-bottom', type: t.sizeMaybePercent }, - - // edge line - { name: 'line-style', type: t.lineStyle }, { name: 'line-color', type: t.color }, { name: 'curve-style', type: t.curveStyle }, { name: 'haystack-radius', type: t.zeroOneNumber }, { name: 'source-endpoint', type: t.edgeEndpoint }, { name: 'target-endpoint', type: t.edgeEndpoint }, { name: 'control-point-step-size', type: t.size }, { name: 'control-point-distances', type: t.bidirectionalSizes }, { name: 'control-point-weights', type: t.numbers }, { name: 'segment-distances', type: t.bidirectionalSizes }, { name: 'segment-weights', type: t.numbers }, { name: 'edge-distances', type: t.edgeDistances }, { name: 'arrow-scale', type: t.positiveNumber }, { name: 'loop-direction', type: t.angle }, { name: 'loop-sweep', type: t.angle }, { name: 'source-distance-from-node', type: t.size }, { name: 'target-distance-from-node', type: t.size }, - - // ghost properties - { name: 'ghost', type: t.bool }, { name: 'ghost-offset-x', type: t.bidirectionalSize }, { name: 'ghost-offset-y', type: t.bidirectionalSize }, { name: 'ghost-opacity', type: t.zeroOneNumber }, - - // these are just for the core - { name: 'selection-box-color', type: t.color }, { name: 'selection-box-opacity', type: t.zeroOneNumber }, { name: 'selection-box-border-color', type: t.color }, { name: 'selection-box-border-width', type: t.size }, { name: 'active-bg-color', type: t.color }, { name: 'active-bg-opacity', type: t.zeroOneNumber }, { name: 'active-bg-size', type: t.size }, { name: 'outside-texture-bg-color', type: t.color }, { name: 'outside-texture-bg-opacity', type: t.zeroOneNumber }]; - - // define aliases - var aliases = styfn.aliases = [{ name: 'content', pointsTo: 'label' }, { name: 'control-point-distance', pointsTo: 'control-point-distances' }, { name: 'control-point-weight', pointsTo: 'control-point-weights' }, { name: 'edge-text-rotation', pointsTo: 'text-rotation' }, { name: 'padding-left', pointsTo: 'padding' }, { name: 'padding-right', pointsTo: 'padding' }, { name: 'padding-top', pointsTo: 'padding' }, { name: 'padding-bottom', pointsTo: 'padding' }]; - - // pie backgrounds for nodes - styfn.pieBackgroundN = 16; // because the pie properties are numbered, give access to a constant N (for renderer use) - props.push({ name: 'pie-size', type: t.sizeMaybePercent }); - for (var i = 1; i <= styfn.pieBackgroundN; i++) { - props.push({ name: 'pie-' + i + '-background-color', type: t.color }); - props.push({ name: 'pie-' + i + '-background-size', type: t.percent }); - props.push({ name: 'pie-' + i + '-background-opacity', type: t.zeroOneNumber }); - } - - // edge arrows - var arrowPrefixes = styfn.arrowPrefixes = ['source', 'mid-source', 'target', 'mid-target']; - [{ name: 'arrow-shape', type: t.arrowShape }, { name: 'arrow-color', type: t.color }, { name: 'arrow-fill', type: t.arrowFill }].forEach(function (prop) { - arrowPrefixes.forEach(function (prefix) { - var name = prefix + '-' + prop.name; - var type = prop.type; - - props.push({ name: name, type: type }); - }); - }, {}); - - // list of property names - styfn.propertyNames = props.map(function (p) { - return p.name; - }); - - // allow access of properties by name ( e.g. style.properties.height ) - for (var _i = 0; _i < props.length; _i++) { - var prop = props[_i]; - - props[prop.name] = prop; // allow lookup by name - } - - // map aliases - for (var _i2 = 0; _i2 < aliases.length; _i2++) { - var alias = aliases[_i2]; - var pointsToProp = props[alias.pointsTo]; - var aliasProp = { - name: alias.name, - alias: true, - pointsTo: pointsToProp - }; - - // add alias prop for parsing - props.push(aliasProp); - - props[alias.name] = aliasProp; // allow lookup by name - } -})(); - -styfn.getDefaultProperty = function (name) { - return this.getDefaultProperties()[name]; -}; - -styfn.getDefaultProperties = util.memoize(function () { - var rawProps = util.extend({ - // common node/edge props - 'events': 'yes', - 'text-events': 'no', - 'text-valign': 'top', - 'text-halign': 'center', - 'color': '#000', - 'text-outline-color': '#000', - 'text-outline-width': 0, - 'text-outline-opacity': 1, - 'text-opacity': 1, - 'text-decoration': 'none', - 'text-transform': 'none', - 'text-wrap': 'none', - 'text-max-width': 9999, - 'text-background-color': '#000', - 'text-background-opacity': 0, - 'text-background-shape': 'rectangle', - 'text-background-padding': 0, - 'text-border-opacity': 0, - 'text-border-width': 0, - 'text-border-style': 'solid', - 'text-border-color': '#000', - 'font-family': 'Helvetica Neue, Helvetica, sans-serif', - 'font-style': 'normal', - // 'font-letiant': fontletiant, - 'font-weight': 'normal', - 'font-size': 16, - 'min-zoomed-font-size': 0, - 'text-rotation': 'none', - 'source-text-rotation': 'none', - 'target-text-rotation': 'none', - 'visibility': 'visible', - 'display': 'element', - 'opacity': 1, - 'z-compound-depth': 'auto', - 'z-index-compare': 'auto', - 'z-index': 0, - 'label': '', - 'text-margin-x': 0, - 'text-margin-y': 0, - 'source-label': '', - 'source-text-offset': 0, - 'source-text-margin-x': 0, - 'source-text-margin-y': 0, - 'target-label': '', - 'target-text-offset': 0, - 'target-text-margin-x': 0, - 'target-text-margin-y': 0, - 'overlay-opacity': 0, - 'overlay-color': '#000', - 'overlay-padding': 10, - 'transition-property': 'none', - 'transition-duration': 0, - 'transition-delay': 0, - 'transition-timing-function': 'linear', - - // node props - 'background-blacken': 0, - 'background-color': '#999', - 'background-opacity': 1, - 'background-image': 'none', - 'background-image-crossorigin': 'anonymous', - 'background-image-opacity': 1, - 'background-position-x': '50%', - 'background-position-y': '50%', - 'background-width-relative-to': 'include-padding', - 'background-height-relative-to': 'include-padding', - 'background-repeat': 'no-repeat', - 'background-fit': 'none', - 'background-clip': 'node', - 'background-width': 'auto', - 'background-height': 'auto', - 'border-color': '#000', - 'border-opacity': 1, - 'border-width': 0, - 'border-style': 'solid', - 'height': 30, - 'width': 30, - 'shape': 'ellipse', - 'shape-polygon-points': '-1, -1, 1, -1, 1, 1, -1, 1', - - // ghost props - 'ghost': 'no', - 'ghost-offset-y': 0, - 'ghost-offset-x': 0, - 'ghost-opacity': 0, - - // compound props - 'padding': 0, - 'padding-relative-to': 'width', - 'position': 'origin', - 'compound-sizing-wrt-labels': 'include', - 'min-width': 0, - 'min-width-bias-left': 0, - 'min-width-bias-right': 0, - 'min-height': 0, - 'min-height-bias-top': 0, - 'min-height-bias-bottom': 0 - }, { - // node pie bg - 'pie-size': '100%' - }, [{ name: 'pie-{{i}}-background-color', value: 'black' }, { name: 'pie-{{i}}-background-size', value: '0%' }, { name: 'pie-{{i}}-background-opacity', value: 1 }].reduce(function (css, prop) { - for (var i = 1; i <= styfn.pieBackgroundN; i++) { - var name = prop.name.replace('{{i}}', i); - var val = prop.value; - - css[name] = val; - } - - return css; - }, {}), { - // edge props - 'line-style': 'solid', - 'line-color': '#999', - 'control-point-step-size': 40, - 'control-point-weights': 0.5, - 'segment-weights': 0.5, - 'segment-distances': 20, - 'edge-distances': 'intersection', - 'curve-style': 'bezier', - 'haystack-radius': 0, - 'arrow-scale': 1, - 'loop-direction': '-45deg', - 'loop-sweep': '-90deg', - 'source-distance-from-node': 0, - 'target-distance-from-node': 0, - 'source-endpoint': 'outside-to-node', - 'target-endpoint': 'outside-to-node' - }, [{ name: 'arrow-shape', value: 'none' }, { name: 'arrow-color', value: '#999' }, { name: 'arrow-fill', value: 'filled' }].reduce(function (css, prop) { - styfn.arrowPrefixes.forEach(function (prefix) { - var name = prefix + '-' + prop.name; - var val = prop.value; - - css[name] = val; - }); - - return css; - }, {})); - - var parsedProps = {}; - - for (var i = 0; i < this.properties.length; i++) { - var prop = this.properties[i]; - - if (prop.pointsTo) { - continue; - } - - var name = prop.name; - var val = rawProps[name]; - var parsedProp = this.parse(name, val); - - parsedProps[name] = parsedProp; - } - - return parsedProps; -}); - -styfn.addDefaultStylesheet = function () { - this.selector('$node > node') // compound (parent) node properties - .css({ - 'shape': 'rectangle', - 'padding': 10, - 'background-color': '#eee', - 'border-color': '#ccc', - 'border-width': 1 - }).selector('edge') // just edge properties - .css({ - 'width': 3, - 'curve-style': 'haystack' - }).selector(':parent <-> node').css({ - 'curve-style': 'bezier', - 'source-endpoint': 'outside-to-line', - 'target-endpoint': 'outside-to-line' - }).selector(':selected').css({ - 'background-color': '#0169D9', - 'line-color': '#0169D9', - 'source-arrow-color': '#0169D9', - 'target-arrow-color': '#0169D9', - 'mid-source-arrow-color': '#0169D9', - 'mid-target-arrow-color': '#0169D9' - }).selector('node:parent:selected').css({ - 'background-color': '#CCE1F9', - 'border-color': '#aec8e5' - }).selector(':active').css({ - 'overlay-color': 'black', - 'overlay-padding': 10, - 'overlay-opacity': 0.25 - }).selector('core') // just core properties - .css({ - 'selection-box-color': '#ddd', - 'selection-box-opacity': 0.65, - 'selection-box-border-color': '#aaa', - 'selection-box-border-width': 1, - 'active-bg-color': 'black', - 'active-bg-opacity': 0.15, - 'active-bg-size': 30, - 'outside-texture-bg-color': '#000', - 'outside-texture-bg-opacity': 0.125 - }); - - this.defaultLength = this.length; -}; - -module.exports = styfn; - -/***/ }), -/* 93 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var is = __webpack_require__(0); -var math = __webpack_require__(2); - -var styfn = {}; - -// a caching layer for property parsing -styfn.parse = function (name, value, propIsBypass, propIsFlat) { - var self = this; - - // function values can't be cached in all cases, and there isn't much benefit of caching them anyway - if (is.fn(value)) { - return self.parseImplWarn(name, value, propIsBypass, propIsFlat); - } - - var flatKey = propIsFlat === 'mapping' || propIsFlat === true || propIsFlat === false || propIsFlat == null ? 'dontcare' : propIsFlat; - var argHash = [name, value, propIsBypass, flatKey].join('$'); - var propCache = self.propCache = self.propCache || {}; - var ret = void 0; - - if (!(ret = propCache[argHash])) { - ret = propCache[argHash] = self.parseImplWarn(name, value, propIsBypass, propIsFlat); - } - - // - bypasses can't be shared b/c the value can be changed by animations or otherwise overridden - // - mappings can't be shared b/c mappings are per-element - if (propIsBypass || propIsFlat === 'mapping') { - // need a copy since props are mutated later in their lifecycles - ret = util.copy(ret); - - if (ret) { - ret.value = util.copy(ret.value); // because it could be an array, e.g. colour - } - } - - return ret; -}; - -styfn.parseImplWarn = function (name, value, propIsBypass, propIsFlat) { - var prop = this.parseImpl(name, value, propIsBypass, propIsFlat); - - if (!prop && value != null) { - util.error('The style property `%s: %s` is invalid', name, value); - } - - return prop; -}; - -// parse a property; return null on invalid; return parsed property otherwise -// fields : -// - name : the name of the property -// - value : the parsed, native-typed value of the property -// - strValue : a string value that represents the property value in valid css -// - bypass : true iff the property is a bypass property -styfn.parseImpl = function (name, value, propIsBypass, propIsFlat) { - var self = this; - - name = util.camel2dash(name); // make sure the property name is in dash form (e.g. 'property-name' not 'propertyName') - - var property = self.properties[name]; - var passedValue = value; - var types = self.types; - - if (!property) { - return null; - } // return null on property of unknown name - if (value === undefined) { - return null; - } // can't assign undefined - - // the property may be an alias - if (property.alias) { - property = property.pointsTo; - name = property.name; - } - - var valueIsString = is.string(value); - if (valueIsString) { - // trim the value to make parsing easier - value = value.trim(); - } - - var type = property.type; - if (!type) { - return null; - } // no type, no luck - - // check if bypass is null or empty string (i.e. indication to delete bypass property) - if (propIsBypass && (value === '' || value === null)) { - return { - name: name, - value: value, - bypass: true, - deleteBypass: true - }; - } - - // check if value is a function used as a mapper - if (is.fn(value)) { - return { - name: name, - value: value, - strValue: 'fn', - mapped: types.fn, - bypass: propIsBypass - }; - } - - // check if value is mapped - var data = void 0, - mapData = void 0; - if (!valueIsString || propIsFlat) { - // then don't bother to do the expensive regex checks - - } else if (data = new RegExp(types.data.regex).exec(value)) { - if (propIsBypass) { - return false; - } // mappers not allowed in bypass - - var mapped = types.data; - - return { - name: name, - value: data, - strValue: '' + value, - mapped: mapped, - field: data[1], - bypass: propIsBypass - }; - } else if (mapData = new RegExp(types.mapData.regex).exec(value)) { - if (propIsBypass) { - return false; - } // mappers not allowed in bypass - if (type.multiple) { - return false; - } // impossible to map to num - - var _mapped = types.mapData; - - // we can map only if the type is a colour or a number - if (!(type.color || type.number)) { - return false; - } - - var valueMin = this.parse(name, mapData[4]); // parse to validate - if (!valueMin || valueMin.mapped) { - return false; - } // can't be invalid or mapped - - var valueMax = this.parse(name, mapData[5]); // parse to validate - if (!valueMax || valueMax.mapped) { - return false; - } // can't be invalid or mapped - - // check if valueMin and valueMax are the same - if (valueMin.value === valueMax.value) { - return false; // can't make much of a mapper without a range - } else if (type.color) { - var c1 = valueMin.value; - var c2 = valueMax.value; - - var same = c1[0] === c2[0] // red - && c1[1] === c2[1] // green - && c1[2] === c2[2] // blue - && ( // optional alpha - c1[3] === c2[3] // same alpha outright - || (c1[3] == null || c1[3] === 1) && ( // full opacity for colour 1? - c2[3] == null || c2[3] === 1) // full opacity for colour 2? - ); - - if (same) { - return false; - } // can't make a mapper without a range - } - - return { - name: name, - value: mapData, - strValue: '' + value, - mapped: _mapped, - field: mapData[1], - fieldMin: parseFloat(mapData[2]), // min & max are numeric - fieldMax: parseFloat(mapData[3]), - valueMin: valueMin.value, - valueMax: valueMax.value, - bypass: propIsBypass - }; - } - - if (type.multiple && propIsFlat !== 'multiple') { - var vals = void 0; - - if (valueIsString) { - vals = value.split(/\s+/); - } else if (is.array(value)) { - vals = value; - } else { - vals = [value]; - } - - if (type.evenMultiple && vals.length % 2 !== 0) { - return null; - } - - var valArr = []; - var unitsArr = []; - var pfValArr = []; - var hasEnum = false; - - for (var i = 0; i < vals.length; i++) { - var p = self.parse(name, vals[i], propIsBypass, 'multiple'); - - hasEnum = hasEnum || is.string(p.value); - - valArr.push(p.value); - pfValArr.push(p.pfValue != null ? p.pfValue : p.value); - unitsArr.push(p.units); - } - - if (type.validate && !type.validate(valArr, unitsArr)) { - return null; - } - - if (type.singleEnum && hasEnum) { - if (valArr.length === 1 && is.string(valArr[0])) { - return { - name: name, - value: valArr[0], - strValue: valArr[0], - bypass: propIsBypass - }; - } else { - return null; - } - } - - return { - name: name, - value: valArr, - pfValue: pfValArr, - strValue: valArr.map(function (val, i) { - return val + (unitsArr[i] || ''); - }).join(' '), - bypass: propIsBypass, - units: unitsArr - }; - } - - // several types also allow enums - var checkEnums = function checkEnums() { - for (var _i = 0; _i < type.enums.length; _i++) { - var en = type.enums[_i]; - - if (en === value) { - return { - name: name, - value: value, - strValue: '' + value, - bypass: propIsBypass - }; - } - } - - return null; - }; - - // check the type and return the appropriate object - if (type.number) { - var units = void 0; - var implicitUnits = 'px'; // not set => px - - if (type.units) { - // use specified units if set - units = type.units; - } - - if (type.implicitUnits) { - implicitUnits = type.implicitUnits; - } - - if (!type.unitless) { - if (valueIsString) { - var unitsRegex = 'px|em' + (type.allowPercent ? '|\\%' : ''); - if (units) { - unitsRegex = units; - } // only allow explicit units if so set - var match = value.match('^(' + util.regex.number + ')(' + unitsRegex + ')?' + '$'); - - if (match) { - value = match[1]; - units = match[2] || implicitUnits; - } - } else if (!units || type.implicitUnits) { - units = implicitUnits; // implicitly px if unspecified - } - } - - value = parseFloat(value); - - // if not a number and enums not allowed, then the value is invalid - if (isNaN(value) && type.enums === undefined) { - return null; - } - - // check if this number type also accepts special keywords in place of numbers - // (i.e. `left`, `auto`, etc) - if (isNaN(value) && type.enums !== undefined) { - value = passedValue; - - return checkEnums(); - } - - // check if value must be an integer - if (type.integer && !is.integer(value)) { - return null; - } - - // check value is within range - if (type.min !== undefined && (value < type.min || type.strictMin && value === type.min) || type.max !== undefined && (value > type.max || type.strictMax && value === type.max)) { - return null; - } - - var ret = { - name: name, - value: value, - strValue: '' + value + (units ? units : ''), - units: units, - bypass: propIsBypass - }; - - // normalise value in pixels - if (type.unitless || units !== 'px' && units !== 'em') { - ret.pfValue = value; - } else { - ret.pfValue = units === 'px' || !units ? value : this.getEmSizeInPixels() * value; - } - - // normalise value in ms - if (units === 'ms' || units === 's') { - ret.pfValue = units === 'ms' ? value : 1000 * value; - } - - // normalise value in rad - if (units === 'deg' || units === 'rad') { - ret.pfValue = units === 'rad' ? value : math.deg2rad(value); - } - - // normalize value in % - if (units === '%') { - ret.pfValue = value / 100; - } - - return ret; - } else if (type.propList) { - - var props = []; - var propsStr = '' + value; - - if (propsStr === 'none') { - // leave empty - - } else { - // go over each prop - - var propsSplit = propsStr.split(','); - for (var _i2 = 0; _i2 < propsSplit.length; _i2++) { - var propName = propsSplit[_i2].trim(); - - if (self.properties[propName]) { - props.push(propName); - } - } - - if (props.length === 0) { - return null; - } - } - - return { - name: name, - value: props, - strValue: props.length === 0 ? 'none' : props.join(', '), - bypass: propIsBypass - }; - } else if (type.color) { - var tuple = util.color2tuple(value); - - if (!tuple) { - return null; - } - - return { - name: name, - value: tuple, - pfValue: tuple, - strValue: '' + value, - bypass: propIsBypass - }; - } else if (type.regex || type.regexes) { - - // first check enums - if (type.enums) { - var enumProp = checkEnums(); - - if (enumProp) { - return enumProp; - } - } - - var regexes = type.regexes ? type.regexes : [type.regex]; - - for (var _i3 = 0; _i3 < regexes.length; _i3++) { - var regex = new RegExp(regexes[_i3]); // make a regex from the type string - var m = regex.exec(value); - - if (m) { - // regex matches - return { - name: name, - value: type.singleRegexMatchValue ? m[1] : m, - strValue: '' + value, - bypass: propIsBypass - }; - } - } - - return null; // didn't match any - } else if (type.string) { - // just return - return { - name: name, - value: '' + value, - strValue: '' + value, - bypass: propIsBypass - }; - } else if (type.enums) { - // check enums last because it's a combo type in others - return checkEnums(); - } else { - return null; // not a type we can handle - } -}; - -module.exports = styfn; - -/***/ }), -/* 94 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var window = __webpack_require__(3); -var math = __webpack_require__(2); - -var corefn = { - - autolock: function autolock(bool) { - if (bool !== undefined) { - this._private.autolock = bool ? true : false; - } else { - return this._private.autolock; - } - - return this; // chaining - }, - - autoungrabify: function autoungrabify(bool) { - if (bool !== undefined) { - this._private.autoungrabify = bool ? true : false; - } else { - return this._private.autoungrabify; - } - - return this; // chaining - }, - - autounselectify: function autounselectify(bool) { - if (bool !== undefined) { - this._private.autounselectify = bool ? true : false; - } else { - return this._private.autounselectify; - } - - return this; // chaining - }, - - panningEnabled: function panningEnabled(bool) { - if (bool !== undefined) { - this._private.panningEnabled = bool ? true : false; - } else { - return this._private.panningEnabled; - } - - return this; // chaining - }, - - userPanningEnabled: function userPanningEnabled(bool) { - if (bool !== undefined) { - this._private.userPanningEnabled = bool ? true : false; - } else { - return this._private.userPanningEnabled; - } - - return this; // chaining - }, - - zoomingEnabled: function zoomingEnabled(bool) { - if (bool !== undefined) { - this._private.zoomingEnabled = bool ? true : false; - } else { - return this._private.zoomingEnabled; - } - - return this; // chaining - }, - - userZoomingEnabled: function userZoomingEnabled(bool) { - if (bool !== undefined) { - this._private.userZoomingEnabled = bool ? true : false; - } else { - return this._private.userZoomingEnabled; - } - - return this; // chaining - }, - - boxSelectionEnabled: function boxSelectionEnabled(bool) { - if (bool !== undefined) { - this._private.boxSelectionEnabled = bool ? true : false; - } else { - return this._private.boxSelectionEnabled; - } - - return this; // chaining - }, - - pan: function pan() { - var args = arguments; - var pan = this._private.pan; - var dim = void 0, - val = void 0, - dims = void 0, - x = void 0, - y = void 0; - - switch (args.length) { - case 0: - // .pan() - return pan; - - case 1: - - if (is.string(args[0])) { - // .pan('x') - dim = args[0]; - return pan[dim]; - } else if (is.plainObject(args[0])) { - // .pan({ x: 0, y: 100 }) - if (!this._private.panningEnabled) { - return this; - } - - dims = args[0]; - x = dims.x; - y = dims.y; - - if (is.number(x)) { - pan.x = x; - } - - if (is.number(y)) { - pan.y = y; - } - - this.emit('pan viewport'); - } - break; - - case 2: - // .pan('x', 100) - if (!this._private.panningEnabled) { - return this; - } - - dim = args[0]; - val = args[1]; - - if ((dim === 'x' || dim === 'y') && is.number(val)) { - pan[dim] = val; - } - - this.emit('pan viewport'); - break; - - default: - break; // invalid - } - - this.notify({ // notify the renderer that the viewport changed - type: 'viewport' - }); - - return this; // chaining - }, - - panBy: function panBy(arg0, arg1) { - var args = arguments; - var pan = this._private.pan; - var dim = void 0, - val = void 0, - dims = void 0, - x = void 0, - y = void 0; - - if (!this._private.panningEnabled) { - return this; - } - - switch (args.length) { - case 1: - - if (is.plainObject(arg0)) { - // .panBy({ x: 0, y: 100 }) - dims = args[0]; - x = dims.x; - y = dims.y; - - if (is.number(x)) { - pan.x += x; - } - - if (is.number(y)) { - pan.y += y; - } - - this.emit('pan viewport'); - } - break; - - case 2: - // .panBy('x', 100) - dim = arg0; - val = arg1; - - if ((dim === 'x' || dim === 'y') && is.number(val)) { - pan[dim] += val; - } - - this.emit('pan viewport'); - break; - - default: - break; // invalid - } - - this.notify({ // notify the renderer that the viewport changed - type: 'viewport' - }); - - return this; // chaining - }, - - fit: function fit(elements, padding) { - var viewportState = this.getFitViewport(elements, padding); - - if (viewportState) { - var _p = this._private; - _p.zoom = viewportState.zoom; - _p.pan = viewportState.pan; - - this.emit('pan zoom viewport'); - - this.notify({ // notify the renderer that the viewport changed - type: 'viewport' - }); - } - - return this; // chaining - }, - - getFitViewport: function getFitViewport(elements, padding) { - if (is.number(elements) && padding === undefined) { - // elements is optional - padding = elements; - elements = undefined; - } - - if (!this._private.panningEnabled || !this._private.zoomingEnabled) { - return; - } - - var bb = void 0; - - if (is.string(elements)) { - var sel = elements; - elements = this.$(sel); - } else if (is.boundingBox(elements)) { - // assume bb - var bbe = elements; - bb = { - x1: bbe.x1, - y1: bbe.y1, - x2: bbe.x2, - y2: bbe.y2 - }; - - bb.w = bb.x2 - bb.x1; - bb.h = bb.y2 - bb.y1; - } else if (!is.elementOrCollection(elements)) { - elements = this.mutableElements(); - } - - if (is.elementOrCollection(elements) && elements.empty()) { - return; - } // can't fit to nothing - - bb = bb || elements.boundingBox(); - - var w = this.width(); - var h = this.height(); - var zoom = void 0; - padding = is.number(padding) ? padding : 0; - - if (!isNaN(w) && !isNaN(h) && w > 0 && h > 0 && !isNaN(bb.w) && !isNaN(bb.h) && bb.w > 0 && bb.h > 0) { - zoom = Math.min((w - 2 * padding) / bb.w, (h - 2 * padding) / bb.h); - - // crop zoom - zoom = zoom > this._private.maxZoom ? this._private.maxZoom : zoom; - zoom = zoom < this._private.minZoom ? this._private.minZoom : zoom; - - var pan = { // now pan to middle - x: (w - zoom * (bb.x1 + bb.x2)) / 2, - y: (h - zoom * (bb.y1 + bb.y2)) / 2 - }; - - return { - zoom: zoom, - pan: pan - }; - } - - return; - }, - - minZoom: function minZoom(zoom) { - if (zoom === undefined) { - return this._private.minZoom; - } else if (is.number(zoom)) { - this._private.minZoom = zoom; - } - - return this; - }, - - maxZoom: function maxZoom(zoom) { - if (zoom === undefined) { - return this._private.maxZoom; - } else if (is.number(zoom)) { - this._private.maxZoom = zoom; - } - - return this; - }, - - getZoomedViewport: function getZoomedViewport(params) { - var _p = this._private; - var currentPan = _p.pan; - var currentZoom = _p.zoom; - var pos = void 0; // in rendered px - var zoom = void 0; - var bail = false; - - if (!_p.zoomingEnabled) { - // zooming disabled - bail = true; - } - - if (is.number(params)) { - // then set the zoom - zoom = params; - } else if (is.plainObject(params)) { - // then zoom about a point - zoom = params.level; - - if (params.position != null) { - pos = math.modelToRenderedPosition(params.position, currentZoom, currentPan); - } else if (params.renderedPosition != null) { - pos = params.renderedPosition; - } - - if (pos != null && !_p.panningEnabled) { - // panning disabled - bail = true; - } - } - - // crop zoom - zoom = zoom > _p.maxZoom ? _p.maxZoom : zoom; - zoom = zoom < _p.minZoom ? _p.minZoom : zoom; - - // can't zoom with invalid params - if (bail || !is.number(zoom) || zoom === currentZoom || pos != null && (!is.number(pos.x) || !is.number(pos.y))) { - return null; - } - - if (pos != null) { - // set zoom about position - var pan1 = currentPan; - var zoom1 = currentZoom; - var zoom2 = zoom; - - var pan2 = { - x: -zoom2 / zoom1 * (pos.x - pan1.x) + pos.x, - y: -zoom2 / zoom1 * (pos.y - pan1.y) + pos.y - }; - - return { - zoomed: true, - panned: true, - zoom: zoom2, - pan: pan2 - }; - } else { - // just set the zoom - return { - zoomed: true, - panned: false, - zoom: zoom, - pan: currentPan - }; - } - }, - - zoom: function zoom(params) { - if (params === undefined) { - // get - return this._private.zoom; - } else { - // set - var vp = this.getZoomedViewport(params); - var _p = this._private; - - if (vp == null || !vp.zoomed) { - return this; - } - - _p.zoom = vp.zoom; - - if (vp.panned) { - _p.pan.x = vp.pan.x; - _p.pan.y = vp.pan.y; - } - - this.emit('zoom' + (vp.panned ? ' pan' : '') + ' viewport'); - - this.notify({ // notify the renderer that the viewport changed - type: 'viewport' - }); - - return this; // chaining - } - }, - - viewport: function viewport(opts) { - var _p = this._private; - var zoomDefd = true; - var panDefd = true; - var events = []; // to trigger - var zoomFailed = false; - var panFailed = false; - - if (!opts) { - return this; - } - if (!is.number(opts.zoom)) { - zoomDefd = false; - } - if (!is.plainObject(opts.pan)) { - panDefd = false; - } - if (!zoomDefd && !panDefd) { - return this; - } - - if (zoomDefd) { - var z = opts.zoom; - - if (z < _p.minZoom || z > _p.maxZoom || !_p.zoomingEnabled) { - zoomFailed = true; - } else { - _p.zoom = z; - - events.push('zoom'); - } - } - - if (panDefd && (!zoomFailed || !opts.cancelOnFailedZoom) && _p.panningEnabled) { - var p = opts.pan; - - if (is.number(p.x)) { - _p.pan.x = p.x; - panFailed = false; - } - - if (is.number(p.y)) { - _p.pan.y = p.y; - panFailed = false; - } - - if (!panFailed) { - events.push('pan'); - } - } - - if (events.length > 0) { - events.push('viewport'); - this.emit(events.join(' ')); - - this.notify({ - type: 'viewport' - }); - } - - return this; // chaining - }, - - center: function center(elements) { - var pan = this.getCenterPan(elements); - - if (pan) { - this._private.pan = pan; - - this.emit('pan viewport'); - - this.notify({ // notify the renderer that the viewport changed - type: 'viewport' - }); - } - - return this; // chaining - }, - - getCenterPan: function getCenterPan(elements, zoom) { - if (!this._private.panningEnabled) { - return; - } - - if (is.string(elements)) { - var selector = elements; - elements = this.mutableElements().filter(selector); - } else if (!is.elementOrCollection(elements)) { - elements = this.mutableElements(); - } - - if (elements.length === 0) { - return; - } // can't centre pan to nothing - - var bb = elements.boundingBox(); - var w = this.width(); - var h = this.height(); - zoom = zoom === undefined ? this._private.zoom : zoom; - - var pan = { // middle - x: (w - zoom * (bb.x1 + bb.x2)) / 2, - y: (h - zoom * (bb.y1 + bb.y2)) / 2 - }; - - return pan; - }, - - reset: function reset() { - if (!this._private.panningEnabled || !this._private.zoomingEnabled) { - return this; - } - - this.viewport({ - pan: { x: 0, y: 0 }, - zoom: 1 - }); - - return this; // chaining - }, - - invalidateSize: function invalidateSize() { - this._private.sizeCache = null; - }, - - size: function size() { - var _p = this._private; - var container = _p.container; - - return _p.sizeCache = _p.sizeCache || (container ? function () { - var style = window.getComputedStyle(container); - var val = function val(name) { - return parseFloat(style.getPropertyValue(name)); - }; - - return { - width: container.clientWidth - val('padding-left') - val('padding-right'), - height: container.clientHeight - val('padding-top') - val('padding-bottom') - }; - }() : { // fallback if no container (not 0 b/c can be used for dividing etc) - width: 1, - height: 1 - }); - }, - - width: function width() { - return this.size().width; - }, - - height: function height() { - return this.size().height; - }, - - extent: function extent() { - var pan = this._private.pan; - var zoom = this._private.zoom; - var rb = this.renderedExtent(); - - var b = { - x1: (rb.x1 - pan.x) / zoom, - x2: (rb.x2 - pan.x) / zoom, - y1: (rb.y1 - pan.y) / zoom, - y2: (rb.y2 - pan.y) / zoom - }; - - b.w = b.x2 - b.x1; - b.h = b.y2 - b.y1; - - return b; - }, - - renderedExtent: function renderedExtent() { - var width = this.width(); - var height = this.height(); - - return { - x1: 0, - y1: 0, - x2: width, - y2: height, - w: width, - h: height - }; - } -}; - -// aliases -corefn.centre = corefn.center; - -// backwards compatibility -corefn.autolockNodes = corefn.autolock; -corefn.autoungrabifyNodes = corefn.autoungrabify; - -module.exports = corefn; - -/***/ }), -/* 95 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var define = __webpack_require__(4); -var Collection = __webpack_require__(7); -var Core = __webpack_require__(12); -var incExts = __webpack_require__(96); -var is = __webpack_require__(0); -var Emitter = __webpack_require__(11); - -// registered extensions to cytoscape, indexed by name -var extensions = {}; - -// registered modules for extensions, indexed by name -var modules = {}; - -function setExtension(type, name, registrant) { - - var ext = registrant; - - var overrideErr = function overrideErr(field) { - util.error('Can not register `' + name + '` for `' + type + '` since `' + field + '` already exists in the prototype and can not be overridden'); - }; - - if (type === 'core') { - if (Core.prototype[name]) { - return overrideErr(name); - } else { - Core.prototype[name] = registrant; - } - } else if (type === 'collection') { - if (Collection.prototype[name]) { - return overrideErr(name); - } else { - Collection.prototype[name] = registrant; - } - } else if (type === 'layout') { - // fill in missing layout functions in the prototype - - var Layout = function Layout(options) { - this.options = options; - - registrant.call(this, options); - - // make sure layout has _private for use w/ std apis like .on() - if (!is.plainObject(this._private)) { - this._private = {}; - } - - this._private.cy = options.cy; - this._private.listeners = []; - - this.createEmitter(); - }; - - var layoutProto = Layout.prototype = Object.create(registrant.prototype); - - var optLayoutFns = []; - - for (var i = 0; i < optLayoutFns.length; i++) { - var fnName = optLayoutFns[i]; - - layoutProto[fnName] = layoutProto[fnName] || function () { - return this; - }; - } - - // either .start() or .run() is defined, so autogen the other - if (layoutProto.start && !layoutProto.run) { - layoutProto.run = function () { - this.start();return this; - }; - } else if (!layoutProto.start && layoutProto.run) { - layoutProto.start = function () { - this.run();return this; - }; - } - - var regStop = registrant.prototype.stop; - layoutProto.stop = function () { - var opts = this.options; - - if (opts && opts.animate) { - var anis = this.animations; - - if (anis) { - for (var _i = 0; _i < anis.length; _i++) { - anis[_i].stop(); - } - } - } - - if (regStop) { - regStop.call(this); - } else { - this.emit('layoutstop'); - } - - return this; - }; - - if (!layoutProto.destroy) { - layoutProto.destroy = function () { - return this; - }; - } - - layoutProto.cy = function () { - return this._private.cy; - }; - - var getCy = function getCy(layout) { - return layout._private.cy; - }; - - util.assign(layoutProto, { - createEmitter: function createEmitter() { - this._private.emitter = new Emitter({ - eventFields: function eventFields(layout) { - return { - layout: layout, - cy: getCy(layout), - target: layout - }; - }, - bubble: function bubble() { - return true; - }, - parent: function parent(layout) { - return getCy(layout); - }, - context: this - }); - - return this; - }, - emitter: function emitter() { - return this._private.emitter; - }, - on: function on(evt, cb) { - this.emitter().on(evt, cb);return this; - }, - one: function one(evt, cb) { - this.emitter().one(evt, cb);return this; - }, - once: function once(evt, cb) { - this.emitter().one(evt, cb);return this; - }, - removeListener: function removeListener(evt, cb) { - this.emitter().removeListener(evt, cb);return this; - }, - emit: function emit(evt, params) { - this.emitter().emit(evt, params);return this; - } - }); - - define.eventAliasesOn(layoutProto); - - ext = Layout; // replace with our wrapped layout - } else if (type === 'renderer' && name !== 'null' && name !== 'base') { - // user registered renderers inherit from base - - var BaseRenderer = getExtension('renderer', 'base'); - var bProto = BaseRenderer.prototype; - var RegistrantRenderer = registrant; - var rProto = registrant.prototype; - - var Renderer = function Renderer() { - BaseRenderer.apply(this, arguments); - RegistrantRenderer.apply(this, arguments); - }; - - var proto = Renderer.prototype; - - for (var pName in bProto) { - var pVal = bProto[pName]; - var existsInR = rProto[pName] != null; - - if (existsInR) { - return overrideErr(pName); - } - - proto[pName] = pVal; // take impl from base - } - - for (var _pName in rProto) { - proto[_pName] = rProto[_pName]; // take impl from registrant - } - - bProto.clientFunctions.forEach(function (name) { - proto[name] = proto[name] || function () { - util.error('Renderer does not implement `renderer.' + name + '()` on its prototype'); - }; - }); - - ext = Renderer; - } - - return util.setMap({ - map: extensions, - keys: [type, name], - value: ext - }); -} - -function getExtension(type, name) { - return util.getMap({ - map: extensions, - keys: [type, name] - }); -} - -function setModule(type, name, moduleType, moduleName, registrant) { - return util.setMap({ - map: modules, - keys: [type, name, moduleType, moduleName], - value: registrant - }); -} - -function getModule(type, name, moduleType, moduleName) { - return util.getMap({ - map: modules, - keys: [type, name, moduleType, moduleName] - }); -} - -var extension = function extension() { - // e.g. extension('renderer', 'svg') - if (arguments.length === 2) { - return getExtension.apply(null, arguments); - } - - // e.g. extension('renderer', 'svg', { ... }) - else if (arguments.length === 3) { - return setExtension.apply(null, arguments); - } - - // e.g. extension('renderer', 'svg', 'nodeShape', 'ellipse') - else if (arguments.length === 4) { - return getModule.apply(null, arguments); - } - - // e.g. extension('renderer', 'svg', 'nodeShape', 'ellipse', { ... }) - else if (arguments.length === 5) { - return setModule.apply(null, arguments); - } else { - util.error('Invalid extension access syntax'); - } -}; - -// allows a core instance to access extensions internally -Core.prototype.extension = extension; - -// included extensions -incExts.forEach(function (group) { - group.extensions.forEach(function (ext) { - setExtension(group.type, ext.name, ext.impl); - }); -}); - -module.exports = extension; - -/***/ }), -/* 96 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = [{ - type: 'layout', - extensions: __webpack_require__(97) -}, { - type: 'renderer', - extensions: __webpack_require__(106) -}]; - -/***/ }), -/* 97 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = [{ name: 'breadthfirst', impl: __webpack_require__(98) }, { name: 'circle', impl: __webpack_require__(99) }, { name: 'concentric', impl: __webpack_require__(100) }, { name: 'cose', impl: __webpack_require__(101) }, { name: 'grid', impl: __webpack_require__(102) }, { name: 'null', impl: __webpack_require__(103) }, { name: 'preset', impl: __webpack_require__(104) }, { name: 'random', impl: __webpack_require__(105) }]; - -/***/ }), -/* 98 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var math = __webpack_require__(2); -var is = __webpack_require__(0); - -var defaults = { - fit: true, // whether to fit the viewport to the graph - directed: false, // whether the tree is directed downwards (or edges can point in any direction if false) - padding: 30, // padding on fit - circle: false, // put depths in concentric circles if true, put depths top down if false - spacingFactor: 1.75, // positive spacing factor, larger => more space between nodes (N.B. n/a if causes overlap) - boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space - nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm - roots: undefined, // the roots of the trees - maximalAdjustments: 0, // how many times to try to position the nodes in a maximal way (i.e. no backtracking) - animate: false, // whether to transition the node positions - animationDuration: 500, // duration of animation in ms if enabled - animationEasing: undefined, // easing of animation if enabled, - animateFilter: function animateFilter(node, i) { - return true; - }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts - ready: undefined, // callback on layoutready - stop: undefined, // callback on layoutstop - transform: function transform(node, position) { - return position; - } // transform a given node position. Useful for changing flow direction in discrete layouts -}; - -function BreadthFirstLayout(options) { - this.options = util.extend({}, defaults, options); -} - -BreadthFirstLayout.prototype.run = function () { - var params = this.options; - var options = params; - - var cy = params.cy; - var eles = options.eles; - var nodes = eles.nodes().not(':parent'); - var graph = eles; - - var bb = math.makeBoundingBox(options.boundingBox ? options.boundingBox : { - x1: 0, y1: 0, w: cy.width(), h: cy.height() - }); - - var roots = void 0; - if (is.elementOrCollection(options.roots)) { - roots = options.roots; - } else if (is.array(options.roots)) { - var rootsArray = []; - - for (var i = 0; i < options.roots.length; i++) { - var id = options.roots[i]; - var ele = cy.getElementById(id); - rootsArray.push(ele); - } - - roots = cy.collection(rootsArray); - } else if (is.string(options.roots)) { - roots = cy.$(options.roots); - } else { - if (options.directed) { - roots = nodes.roots(); - } else { - var components = []; - var unhandledNodes = nodes; - - var _loop = function _loop() { - var currComp = cy.collection(); - - eles.bfs({ - roots: unhandledNodes[0], - visit: function visit(node, edge, pNode, i, depth) { - currComp = currComp.add(node); - }, - directed: false - }); - - unhandledNodes = unhandledNodes.not(currComp); - components.push(currComp); - }; - - while (unhandledNodes.length > 0) { - _loop(); - } - - roots = cy.collection(); - - var _loop2 = function _loop2(_i) { - var comp = components[_i]; - var maxDegree = comp.maxDegree(false); - var compRoots = comp.filter(function (ele) { - return ele.degree(false) === maxDegree; - }); - - roots = roots.add(compRoots); - }; - - for (var _i = 0; _i < components.length; _i++) { - _loop2(_i); - } - } - } - - var depths = []; - var foundByBfs = {}; - var id2depth = {}; - var prevNode = {}; - var prevEdge = {}; - var successors = {}; - - // find the depths of the nodes - graph.bfs({ - roots: roots, - directed: options.directed, - visit: function visit(node, edge, pNode, i, depth) { - var ele = node[0]; - var id = ele.id(); - - if (!depths[depth]) { - depths[depth] = []; - } - - depths[depth].push(ele); - foundByBfs[id] = true; - id2depth[id] = depth; - prevNode[id] = pNode; - prevEdge[id] = edge; - - if (pNode) { - var prevId = pNode.id(); - var succ = successors[prevId] = successors[prevId] || []; - - succ.push(node); - } - } - }); - - // check for nodes not found by bfs - var orphanNodes = []; - for (var _i2 = 0; _i2 < nodes.length; _i2++) { - var _ele = nodes[_i2]; - - if (foundByBfs[_ele.id()]) { - continue; - } else { - orphanNodes.push(_ele); - } - } - - // assign orphan nodes a depth from their neighborhood - var maxChecks = orphanNodes.length * 3; - var checks = 0; - while (orphanNodes.length !== 0 && checks < maxChecks) { - var node = orphanNodes.shift(); - var neighbors = node.neighborhood().nodes(); - var assignedDepth = false; - - for (var _i3 = 0; _i3 < neighbors.length; _i3++) { - var depth = id2depth[neighbors[_i3].id()]; - - if (depth !== undefined) { - depths[depth].push(node); - assignedDepth = true; - break; - } - } - - if (!assignedDepth) { - orphanNodes.push(node); - } - - checks++; - } - - // assign orphan nodes that are still left to the depth of their subgraph - while (orphanNodes.length !== 0) { - var _node = orphanNodes.shift(); - //let subgraph = graph.bfs( node ).path; - var _assignedDepth = false; - - // for( let i = 0; i < subgraph.length; i++ ){ - // let depth = id2depth[ subgraph[i].id() ]; - - // if( depth !== undefined ){ - // depths[depth].push( node ); - // assignedDepth = true; - // break; - // } - // } - - if (!_assignedDepth) { - // worst case if the graph really isn't tree friendly, then just dump it in 0 - if (depths.length === 0) { - depths.push([]); - } - - depths[0].push(_node); - } - } - - // assign the nodes a depth and index - var assignDepthsToEles = function assignDepthsToEles() { - for (var _i4 = 0; _i4 < depths.length; _i4++) { - var _eles = depths[_i4]; - - for (var j = 0; j < _eles.length; j++) { - var _ele2 = _eles[j]; - - if (_ele2 == null) { - _eles.splice(j, 1); - j--; - continue; - } - - _ele2._private.scratch.breadthfirst = { - depth: _i4, - index: j - }; - } - } - }; - assignDepthsToEles(); - - var intersectsDepth = function intersectsDepth(node) { - // returns true if has edges pointing in from a higher depth - var edges = node.connectedEdges(function (ele) { - return ele.data('target') === node.id(); - }); - var thisInfo = node._private.scratch.breadthfirst; - var highestDepthOfOther = 0; - var highestOther = void 0; - for (var _i5 = 0; _i5 < edges.length; _i5++) { - var edge = edges[_i5]; - var otherNode = edge.source()[0]; - var otherInfo = otherNode._private.scratch.breadthfirst; - - if (thisInfo.depth <= otherInfo.depth && highestDepthOfOther < otherInfo.depth) { - highestDepthOfOther = otherInfo.depth; - highestOther = otherNode; - } - } - - return highestOther; - }; - - // make maximal if so set by adjusting depths - for (var adj = 0; adj < options.maximalAdjustments; adj++) { - - var nDepths = depths.length; - var elesToMove = []; - for (var _i6 = 0; _i6 < nDepths; _i6++) { - var _depth = depths[_i6]; - - var nDepth = _depth.length; - for (var j = 0; j < nDepth; j++) { - var _ele3 = _depth[j]; - var info = _ele3._private.scratch.breadthfirst; - var intEle = intersectsDepth(_ele3); - - if (intEle) { - info.intEle = intEle; - elesToMove.push(_ele3); - } - } - } - - for (var _i7 = 0; _i7 < elesToMove.length; _i7++) { - var _ele4 = elesToMove[_i7]; - var _info = _ele4._private.scratch.breadthfirst; - var _intEle = _info.intEle; - var intInfo = _intEle._private.scratch.breadthfirst; - - depths[_info.depth][_info.index] = null; // remove from old depth & index (create hole to be cleaned) - - // add to end of new depth - var newDepth = intInfo.depth + 1; - while (newDepth > depths.length - 1) { - depths.push([]); - } - depths[newDepth].push(_ele4); - - _info.depth = newDepth; - _info.index = depths[newDepth].length - 1; - } - - assignDepthsToEles(); - } - - // find min distance we need to leave between nodes - var minDistance = 0; - if (options.avoidOverlap) { - for (var _i8 = 0; _i8 < nodes.length; _i8++) { - var n = nodes[_i8]; - var nbb = n.layoutDimensions(options); - var w = nbb.w; - var h = nbb.h; - - minDistance = Math.max(minDistance, w, h); - } - } - - // get the weighted percent for an element based on its connectivity to other levels - var cachedWeightedPercent = {}; - var getWeightedPercent = function getWeightedPercent(ele) { - if (cachedWeightedPercent[ele.id()]) { - return cachedWeightedPercent[ele.id()]; - } - - var eleDepth = ele._private.scratch.breadthfirst.depth; - var neighbors = ele.neighborhood().nodes().not(':parent').intersection(nodes); - var percent = 0; - var samples = 0; - - for (var _i9 = 0; _i9 < neighbors.length; _i9++) { - var neighbor = neighbors[_i9]; - var bf = neighbor._private.scratch.breadthfirst; - var index = bf.index; - var _depth2 = bf.depth; - var _nDepth = depths[_depth2].length; - - if (eleDepth > _depth2 || eleDepth === 0) { - // only get influenced by elements above - percent += index / _nDepth; - samples++; - } - } - - samples = Math.max(1, samples); - percent = percent / samples; - - if (samples === 0) { - // so lone nodes have a "don't care" state in sorting - percent = undefined; - } - - cachedWeightedPercent[ele.id()] = percent; - return percent; - }; - - // rearrange the indices in each depth level based on connectivity - - var sortFn = function sortFn(a, b) { - var apct = getWeightedPercent(a); - var bpct = getWeightedPercent(b); - - return apct - bpct; - }; - - for (var times = 0; times < 3; times++) { - // do it a few times b/c the depths are dynamic and we want a more stable result - - for (var _i10 = 0; _i10 < depths.length; _i10++) { - depths[_i10] = depths[_i10].sort(sortFn); - } - assignDepthsToEles(); // and update - } - - var biggestDepthSize = 0; - for (var _i11 = 0; _i11 < depths.length; _i11++) { - biggestDepthSize = Math.max(depths[_i11].length, biggestDepthSize); - } - - var center = { - x: bb.x1 + bb.w / 2, - y: bb.x1 + bb.h / 2 - }; - - var getPosition = function getPosition(ele, isBottomDepth) { - var info = ele._private.scratch.breadthfirst; - var depth = info.depth; - var index = info.index; - var depthSize = depths[depth].length; - - var distanceX = Math.max(bb.w / (depthSize + 1), minDistance); - var distanceY = Math.max(bb.h / (depths.length + 1), minDistance); - var radiusStepSize = Math.min(bb.w / 2 / depths.length, bb.h / 2 / depths.length); - radiusStepSize = Math.max(radiusStepSize, minDistance); - - if (!options.circle) { - - var epos = { - x: center.x + (index + 1 - (depthSize + 1) / 2) * distanceX, - y: (depth + 1) * distanceY - }; - - if (isBottomDepth) { - return epos; - } - - // let succs = successors[ ele.id() ]; - // if( succs ){ - // epos.x = 0; - // - // for( let i = 0 ; i < succs.length; i++ ){ - // let spos = pos[ succs[i].id() ]; - // - // epos.x += spos.x; - // } - // - // epos.x /= succs.length; - // } else { - // //debugger; - // } - - return epos; - } else { - if (options.circle) { - var radius = radiusStepSize * depth + radiusStepSize - (depths.length > 0 && depths[0].length <= 3 ? radiusStepSize / 2 : 0); - var theta = 2 * Math.PI / depths[depth].length * index; - - if (depth === 0 && depths[0].length === 1) { - radius = 1; - } - - return { - x: center.x + radius * Math.cos(theta), - y: center.y + radius * Math.sin(theta) - }; - } else { - return { - x: center.x + (index + 1 - (depthSize + 1) / 2) * distanceX, - y: (depth + 1) * distanceY - }; - } - } - }; - - // get positions in reverse depth order - var pos = {}; - for (var _i12 = depths.length - 1; _i12 >= 0; _i12--) { - var _depth3 = depths[_i12]; - - for (var _j = 0; _j < _depth3.length; _j++) { - var _node2 = _depth3[_j]; - - pos[_node2.id()] = getPosition(_node2, _i12 === depths.length - 1); - } - } - - nodes.layoutPositions(this, options, function (node) { - return pos[node.id()]; - }); - - return this; // chaining -}; - -module.exports = BreadthFirstLayout; - -/***/ }), -/* 99 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var math = __webpack_require__(2); -var is = __webpack_require__(0); - -var defaults = { - fit: true, // whether to fit the viewport to the graph - padding: 30, // the padding on fit - boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - avoidOverlap: true, // prevents node overlap, may overflow boundingBox and radius if not enough space - nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm - spacingFactor: undefined, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up - radius: undefined, // the radius of the circle - startAngle: 3 / 2 * Math.PI, // where nodes start in radians - sweep: undefined, // how many radians should be between the first and last node (defaults to full circle) - clockwise: true, // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) - sort: undefined, // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } - animate: false, // whether to transition the node positions - animationDuration: 500, // duration of animation in ms if enabled - animationEasing: undefined, // easing of animation if enabled - animateFilter: function animateFilter(node, i) { - return true; - }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts - ready: undefined, // callback on layoutready - stop: undefined, // callback on layoutstop - transform: function transform(node, position) { - return position; - } // transform a given node position. Useful for changing flow direction in discrete layouts - -}; - -function CircleLayout(options) { - this.options = util.extend({}, defaults, options); -} - -CircleLayout.prototype.run = function () { - var params = this.options; - var options = params; - - var cy = params.cy; - var eles = options.eles; - - var clockwise = options.counterclockwise !== undefined ? !options.counterclockwise : options.clockwise; - - var nodes = eles.nodes().not(':parent'); - - if (options.sort) { - nodes = nodes.sort(options.sort); - } - - var bb = math.makeBoundingBox(options.boundingBox ? options.boundingBox : { - x1: 0, y1: 0, w: cy.width(), h: cy.height() - }); - - var center = { - x: bb.x1 + bb.w / 2, - y: bb.y1 + bb.h / 2 - }; - - var sweep = options.sweep === undefined ? 2 * Math.PI - 2 * Math.PI / nodes.length : options.sweep; - var dTheta = sweep / Math.max(1, nodes.length - 1); - var r = void 0; - - var minDistance = 0; - for (var i = 0; i < nodes.length; i++) { - var n = nodes[i]; - var nbb = n.layoutDimensions(options); - var w = nbb.w; - var h = nbb.h; - - minDistance = Math.max(minDistance, w, h); - } - - if (is.number(options.radius)) { - r = options.radius; - } else if (nodes.length <= 1) { - r = 0; - } else { - r = Math.min(bb.h, bb.w) / 2 - minDistance; - } - - // calculate the radius - if (nodes.length > 1 && options.avoidOverlap) { - // but only if more than one node (can't overlap) - minDistance *= 1.75; // just to have some nice spacing - - var dcos = Math.cos(dTheta) - Math.cos(0); - var dsin = Math.sin(dTheta) - Math.sin(0); - var rMin = Math.sqrt(minDistance * minDistance / (dcos * dcos + dsin * dsin)); // s.t. no nodes overlapping - r = Math.max(rMin, r); - } - - var getPos = function getPos(ele, i) { - var theta = options.startAngle + i * dTheta * (clockwise ? 1 : -1); - - var rx = r * Math.cos(theta); - var ry = r * Math.sin(theta); - var pos = { - x: center.x + rx, - y: center.y + ry - }; - - return pos; - }; - - nodes.layoutPositions(this, options, getPos); - - return this; // chaining -}; - -module.exports = CircleLayout; - -/***/ }), -/* 100 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var math = __webpack_require__(2); - -var defaults = { - fit: true, // whether to fit the viewport to the graph - padding: 30, // the padding on fit - startAngle: 3 / 2 * Math.PI, // where nodes start in radians - sweep: undefined, // how many radians should be between the first and last node (defaults to full circle) - clockwise: true, // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) - equidistant: false, // whether levels have an equal radial distance betwen them, may cause bounding box overflow - minNodeSpacing: 10, // min spacing between outside of nodes (used for radius adjustment) - boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space - nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm - height: undefined, // height of layout area (overrides container height) - width: undefined, // width of layout area (overrides container width) - spacingFactor: undefined, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up - concentric: function concentric(node) { - // returns numeric value for each node, placing higher nodes in levels towards the centre - return node.degree(); - }, - levelWidth: function levelWidth(nodes) { - // the letiation of concentric values in each level - return nodes.maxDegree() / 4; - }, - animate: false, // whether to transition the node positions - animationDuration: 500, // duration of animation in ms if enabled - animationEasing: undefined, // easing of animation if enabled - animateFilter: function animateFilter(node, i) { - return true; - }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts - ready: undefined, // callback on layoutready - stop: undefined, // callback on layoutstop - transform: function transform(node, position) { - return position; - } // transform a given node position. Useful for changing flow direction in discrete layouts -}; - -function ConcentricLayout(options) { - this.options = util.extend({}, defaults, options); -} - -ConcentricLayout.prototype.run = function () { - var params = this.options; - var options = params; - - var clockwise = options.counterclockwise !== undefined ? !options.counterclockwise : options.clockwise; - - var cy = params.cy; - - var eles = options.eles; - var nodes = eles.nodes().not(':parent'); - - var bb = math.makeBoundingBox(options.boundingBox ? options.boundingBox : { - x1: 0, y1: 0, w: cy.width(), h: cy.height() - }); - - var center = { - x: bb.x1 + bb.w / 2, - y: bb.y1 + bb.h / 2 - }; - - var nodeValues = []; // { node, value } - var theta = options.startAngle; - var maxNodeSize = 0; - - for (var i = 0; i < nodes.length; i++) { - var node = nodes[i]; - var value = void 0; - - // calculate the node value - value = options.concentric(node); - nodeValues.push({ - value: value, - node: node - }); - - // for style mapping - node._private.scratch.concentric = value; - } - - // in case we used the `concentric` in style - nodes.updateStyle(); - - // calculate max size now based on potentially updated mappers - for (var _i = 0; _i < nodes.length; _i++) { - var _node = nodes[_i]; - var nbb = _node.layoutDimensions(options); - - maxNodeSize = Math.max(maxNodeSize, nbb.w, nbb.h); - } - - // sort node values in descreasing order - nodeValues.sort(function (a, b) { - return b.value - a.value; - }); - - var levelWidth = options.levelWidth(nodes); - - // put the values into levels - var levels = [[]]; - var currentLevel = levels[0]; - for (var _i2 = 0; _i2 < nodeValues.length; _i2++) { - var val = nodeValues[_i2]; - - if (currentLevel.length > 0) { - var diff = Math.abs(currentLevel[0].value - val.value); - - if (diff >= levelWidth) { - currentLevel = []; - levels.push(currentLevel); - } - } - - currentLevel.push(val); - } - - // create positions from levels - - var minDist = maxNodeSize + options.minNodeSpacing; // min dist between nodes - - if (!options.avoidOverlap) { - // then strictly constrain to bb - var firstLvlHasMulti = levels.length > 0 && levels[0].length > 1; - var maxR = Math.min(bb.w, bb.h) / 2 - minDist; - var rStep = maxR / (levels.length + firstLvlHasMulti ? 1 : 0); - - minDist = Math.min(minDist, rStep); - } - - // find the metrics for each level - var r = 0; - for (var _i3 = 0; _i3 < levels.length; _i3++) { - var level = levels[_i3]; - var sweep = options.sweep === undefined ? 2 * Math.PI - 2 * Math.PI / level.length : options.sweep; - var dTheta = level.dTheta = sweep / Math.max(1, level.length - 1); - - // calculate the radius - if (level.length > 1 && options.avoidOverlap) { - // but only if more than one node (can't overlap) - var dcos = Math.cos(dTheta) - Math.cos(0); - var dsin = Math.sin(dTheta) - Math.sin(0); - var rMin = Math.sqrt(minDist * minDist / (dcos * dcos + dsin * dsin)); // s.t. no nodes overlapping - - r = Math.max(rMin, r); - } - - level.r = r; - - r += minDist; - } - - if (options.equidistant) { - var rDeltaMax = 0; - var _r = 0; - - for (var _i4 = 0; _i4 < levels.length; _i4++) { - var _level = levels[_i4]; - var rDelta = _level.r - _r; - - rDeltaMax = Math.max(rDeltaMax, rDelta); - } - - _r = 0; - for (var _i5 = 0; _i5 < levels.length; _i5++) { - var _level2 = levels[_i5]; - - if (_i5 === 0) { - _r = _level2.r; - } - - _level2.r = _r; - - _r += rDeltaMax; - } - } - - // calculate the node positions - var pos = {}; // id => position - for (var _i6 = 0; _i6 < levels.length; _i6++) { - var _level3 = levels[_i6]; - var _dTheta = _level3.dTheta; - var _r2 = _level3.r; - - for (var j = 0; j < _level3.length; j++) { - var _val = _level3[j]; - var _theta = options.startAngle + (clockwise ? 1 : -1) * _dTheta * j; - - var p = { - x: center.x + _r2 * Math.cos(_theta), - y: center.y + _r2 * Math.sin(_theta) - }; - - pos[_val.node.id()] = p; - } - } - - // position the nodes - nodes.layoutPositions(this, options, function (ele) { - var id = ele.id(); - - return pos[id]; - }); - - return this; // chaining -}; - -module.exports = ConcentricLayout; - -/***/ }), -/* 101 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/* -The CoSE layout was written by Gerardo Huck. -https://www.linkedin.com/in/gerardohuck/ - -Based on the following article: -http://dl.acm.org/citation.cfm?id=1498047 - -Modifications tracked on Github. -*/ - -var util = __webpack_require__(1); -var math = __webpack_require__(2); -var is = __webpack_require__(0); -var Promise = __webpack_require__(5); - -var DEBUG; - -/** - * @brief : default layout options - */ -var defaults = { - // Called on `layoutready` - ready: function ready() {}, - - // Called on `layoutstop` - stop: function stop() {}, - - // Whether to animate while running the layout - // true : Animate continuously as the layout is running - // false : Just show the end result - // 'end' : Animate with the end result, from the initial positions to the end positions - animate: true, - - // Easing of the animation for animate:'end' - animationEasing: undefined, - - // The duration of the animation for animate:'end' - animationDuration: undefined, - - // A function that determines whether the node should be animated - // All nodes animated by default on animate enabled - // Non-animated nodes are positioned immediately when the layout starts - animateFilter: function animateFilter(node, i) { - return true; - }, - - // The layout animates only after this many milliseconds for animate:true - // (prevents flashing on fast runs) - animationThreshold: 250, - - // Number of iterations between consecutive screen positions update - // (0 -> only updated on the end) - refresh: 20, - - // Whether to fit the network view after when done - fit: true, - - // Padding on fit - padding: 30, - - // Constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - boundingBox: undefined, - - // Excludes the label when calculating node bounding boxes for the layout algorithm - nodeDimensionsIncludeLabels: false, - - // Randomize the initial positions of the nodes (true) or use existing positions (false) - randomize: false, - - // Extra spacing between components in non-compound graphs - componentSpacing: 40, - - // Node repulsion (non overlapping) multiplier - nodeRepulsion: function nodeRepulsion(node) { - return 2048; - }, - - // Node repulsion (overlapping) multiplier - nodeOverlap: 4, - - // Ideal edge (non nested) length - idealEdgeLength: function idealEdgeLength(edge) { - return 32; - }, - - // Divisor to compute edge forces - edgeElasticity: function edgeElasticity(edge) { - return 32; - }, - - // Nesting factor (multiplier) to compute ideal edge length for nested edges - nestingFactor: 1.2, - - // Gravity force (constant) - gravity: 1, - - // Maximum number of iterations to perform - numIter: 1000, - - // Initial temperature (maximum node displacement) - initialTemp: 1000, - - // Cooling factor (how the temperature is reduced between consecutive iterations - coolingFactor: 0.99, - - // Lower temperature threshold (below this point the layout will end) - minTemp: 1.0, - - // Pass a reference to weaver to use threads for calculations - weaver: false -}; - -/** - * @brief : constructor - * @arg options : object containing layout options - */ -function CoseLayout(options) { - this.options = util.extend({}, defaults, options); - - this.options.layout = this; -} - -/** - * @brief : runs the layout - */ -CoseLayout.prototype.run = function () { - var options = this.options; - var cy = options.cy; - var layout = this; - var thread = this.thread; - var Thread = options.weaver ? options.weaver.Thread : null; - - var falseThread = { // use false thread as polyfill - listeners: [], - on: function on(e, cb) { - this.listeners.push({ event: e, callback: cb }); - - return this; - }, - trigger: function trigger(e) { - if (is.string(e)) { - e = { type: e }; - } - - var matchesEvent = function matchesEvent(l) { - return l.event === e.type; - }; - var trigger = function trigger(l) { - l.callback(e); - }; - - this.listeners.filter(matchesEvent).forEach(trigger); - - return this; - }, - pass: function pass(data) { - this.pass = data; - - return this; - }, - run: function run(cb) { - var pass = this.pass; - - return new Promise(function (resolve) { - resolve(cb(pass)); - }); - }, - stop: function stop() { - return this; - }, - stopped: function stopped() { - return true; - } - }; - - function broadcast(message) { - // for false thread - var e = { type: 'message', message: message }; - - falseThread.trigger(e); - } - - if (!thread || thread.stopped()) { - thread = this.thread = Thread ? new Thread() : falseThread; - } - - layout.stopped = false; - - if (options.animate === true || options.animate === false) { - layout.emit({ type: 'layoutstart', layout: layout }); - } - - // Set DEBUG - Global variable - if (true === options.debug) { - DEBUG = true; - } else { - DEBUG = false; - } - - // Initialize layout info - var layoutInfo = createLayoutInfo(cy, layout, options); - - // Show LayoutInfo contents if debugging - if (DEBUG) { - printLayoutInfo(layoutInfo); - } - - // If required, randomize node positions - if (options.randomize) { - randomizePositions(layoutInfo, cy); - } - - var startTime = Date.now(); - var refreshRequested = false; - var refresh = function refresh(rOpts) { - rOpts = rOpts || {}; - - if (refreshRequested && !rOpts.next) { - return; - } - - if (!rOpts.force && Date.now() - startTime < options.animationThreshold) { - return; - } - - refreshRequested = true; - - util.requestAnimationFrame(function () { - refreshPositions(layoutInfo, cy, options); - - // Fit the graph if necessary - if (true === options.fit) { - cy.fit(options.padding); - } - - refreshRequested = false; - - if (rOpts.next) { - rOpts.next(); - } - }); - }; - - thread.on('message', function (e) { - var layoutNodes = e.message; - - layoutInfo.layoutNodes = layoutNodes; - refresh(); - }); - - thread.pass({ - layoutInfo: layoutInfo, - options: { - animate: options.animate, - refresh: options.refresh, - componentSpacing: options.componentSpacing, - nodeOverlap: options.nodeOverlap, - nestingFactor: options.nestingFactor, - gravity: options.gravity, - numIter: options.numIter, - initialTemp: options.initialTemp, - coolingFactor: options.coolingFactor, - minTemp: options.minTemp - } - }).run(function (pass) { - var layoutInfo = pass.layoutInfo; - var options = pass.options; - var stopped = false; - - /** - * @brief : Performs one iteration of the physical simulation - * @arg layoutInfo : LayoutInfo object already initialized - * @arg cy : Cytoscape object - * @arg options : Layout options - */ - var step = function step(layoutInfo, options, _step) { - // var s = "\n\n###############################"; - // s += "\nSTEP: " + step; - // s += "\n###############################\n"; - // logDebug(s); - - // Calculate node repulsions - calculateNodeForces(layoutInfo, options); - // Calculate edge forces - calculateEdgeForces(layoutInfo, options); - // Calculate gravity forces - calculateGravityForces(layoutInfo, options); - // Propagate forces from parent to child - propagateForces(layoutInfo, options); - // Update positions based on calculated forces - updatePositions(layoutInfo, options); - }; - - /** - * @brief : Computes the node repulsion forces - */ - var calculateNodeForces = function calculateNodeForces(layoutInfo, options) { - // Go through each of the graphs in graphSet - // Nodes only repel each other if they belong to the same graph - // var s = 'calculateNodeForces'; - // logDebug(s); - for (var i = 0; i < layoutInfo.graphSet.length; i++) { - var graph = layoutInfo.graphSet[i]; - var numNodes = graph.length; - - // s = "Set: " + graph.toString(); - // logDebug(s); - - // Now get all the pairs of nodes - // Only get each pair once, (A, B) = (B, A) - for (var j = 0; j < numNodes; j++) { - var node1 = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[j]]]; - - for (var k = j + 1; k < numNodes; k++) { - var node2 = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[k]]]; - - nodeRepulsion(node1, node2, layoutInfo, options); - } - } - } - }; - - var randomDistance = function randomDistance(max) { - return -max + 2 * max * Math.random(); - }; - - /** - * @brief : Compute the node repulsion forces between a pair of nodes - */ - var nodeRepulsion = function nodeRepulsion(node1, node2, layoutInfo, options) { - // var s = "Node repulsion. Node1: " + node1.id + " Node2: " + node2.id; - - var cmptId1 = node1.cmptId; - var cmptId2 = node2.cmptId; - - if (cmptId1 !== cmptId2 && !layoutInfo.isCompound) { - return; - } - - // Get direction of line connecting both node centers - var directionX = node2.positionX - node1.positionX; - var directionY = node2.positionY - node1.positionY; - var maxRandDist = 1; - // s += "\ndirectionX: " + directionX + ", directionY: " + directionY; - - // If both centers are the same, apply a random force - if (0 === directionX && 0 === directionY) { - directionX = randomDistance(maxRandDist); - directionY = randomDistance(maxRandDist); - } - - var overlap = nodesOverlap(node1, node2, directionX, directionY); - - if (overlap > 0) { - // s += "\nNodes DO overlap."; - // s += "\nOverlap: " + overlap; - // If nodes overlap, repulsion force is proportional - // to the overlap - var force = options.nodeOverlap * overlap; - - // Compute the module and components of the force vector - var distance = Math.sqrt(directionX * directionX + directionY * directionY); - // s += "\nDistance: " + distance; - var forceX = force * directionX / distance; - var forceY = force * directionY / distance; - } else { - // s += "\nNodes do NOT overlap."; - // If there's no overlap, force is inversely proportional - // to squared distance - - // Get clipping points for both nodes - var point1 = findClippingPoint(node1, directionX, directionY); - var point2 = findClippingPoint(node2, -1 * directionX, -1 * directionY); - - // Use clipping points to compute distance - var distanceX = point2.x - point1.x; - var distanceY = point2.y - point1.y; - var distanceSqr = distanceX * distanceX + distanceY * distanceY; - var distance = Math.sqrt(distanceSqr); - // s += "\nDistance: " + distance; - - // Compute the module and components of the force vector - var force = (node1.nodeRepulsion + node2.nodeRepulsion) / distanceSqr; - var forceX = force * distanceX / distance; - var forceY = force * distanceY / distance; - } - - // Apply force - if (!node1.isLocked) { - node1.offsetX -= forceX; - node1.offsetY -= forceY; - } - - if (!node2.isLocked) { - node2.offsetX += forceX; - node2.offsetY += forceY; - } - - // s += "\nForceX: " + forceX + " ForceY: " + forceY; - // logDebug(s); - - return; - }; - - /** - * @brief : Determines whether two nodes overlap or not - * @return : Amount of overlapping (0 => no overlap) - */ - var nodesOverlap = function nodesOverlap(node1, node2, dX, dY) { - - if (dX > 0) { - var overlapX = node1.maxX - node2.minX; - } else { - var overlapX = node2.maxX - node1.minX; - } - - if (dY > 0) { - var overlapY = node1.maxY - node2.minY; - } else { - var overlapY = node2.maxY - node1.minY; - } - - if (overlapX >= 0 && overlapY >= 0) { - return Math.sqrt(overlapX * overlapX + overlapY * overlapY); - } else { - return 0; - } - }; - - /** - * @brief : Finds the point in which an edge (direction dX, dY) intersects - * the rectangular bounding box of it's source/target node - */ - var findClippingPoint = function findClippingPoint(node, dX, dY) { - - // Shorcuts - var X = node.positionX; - var Y = node.positionY; - var H = node.height || 1; - var W = node.width || 1; - var dirSlope = dY / dX; - var nodeSlope = H / W; - - // var s = 'Computing clipping point of node ' + node.id + - // " . Height: " + H + ", Width: " + W + - // "\nDirection " + dX + ", " + dY; - // - // Compute intersection - var res = {}; - - // Case: Vertical direction (up) - if (0 === dX && 0 < dY) { - res.x = X; - // s += "\nUp direction"; - res.y = Y + H / 2; - - return res; - } - - // Case: Vertical direction (down) - if (0 === dX && 0 > dY) { - res.x = X; - res.y = Y + H / 2; - // s += "\nDown direction"; - - return res; - } - - // Case: Intersects the right border - if (0 < dX && -1 * nodeSlope <= dirSlope && dirSlope <= nodeSlope) { - res.x = X + W / 2; - res.y = Y + W * dY / 2 / dX; - // s += "\nRightborder"; - - return res; - } - - // Case: Intersects the left border - if (0 > dX && -1 * nodeSlope <= dirSlope && dirSlope <= nodeSlope) { - res.x = X - W / 2; - res.y = Y - W * dY / 2 / dX; - // s += "\nLeftborder"; - - return res; - } - - // Case: Intersects the top border - if (0 < dY && (dirSlope <= -1 * nodeSlope || dirSlope >= nodeSlope)) { - res.x = X + H * dX / 2 / dY; - res.y = Y + H / 2; - // s += "\nTop border"; - - return res; - } - - // Case: Intersects the bottom border - if (0 > dY && (dirSlope <= -1 * nodeSlope || dirSlope >= nodeSlope)) { - res.x = X - H * dX / 2 / dY; - res.y = Y - H / 2; - // s += "\nBottom border"; - - return res; - } - - // s += "\nClipping point found at " + res.x + ", " + res.y; - // logDebug(s); - return res; - }; - - /** - * @brief : Calculates all edge forces - */ - var calculateEdgeForces = function calculateEdgeForces(layoutInfo, options) { - // Iterate over all edges - for (var i = 0; i < layoutInfo.edgeSize; i++) { - // Get edge, source & target nodes - var edge = layoutInfo.layoutEdges[i]; - var sourceIx = layoutInfo.idToIndex[edge.sourceId]; - var source = layoutInfo.layoutNodes[sourceIx]; - var targetIx = layoutInfo.idToIndex[edge.targetId]; - var target = layoutInfo.layoutNodes[targetIx]; - - // Get direction of line connecting both node centers - var directionX = target.positionX - source.positionX; - var directionY = target.positionY - source.positionY; - - // If both centers are the same, do nothing. - // A random force has already been applied as node repulsion - if (0 === directionX && 0 === directionY) { - continue; - } - - // Get clipping points for both nodes - var point1 = findClippingPoint(source, directionX, directionY); - var point2 = findClippingPoint(target, -1 * directionX, -1 * directionY); - - var lx = point2.x - point1.x; - var ly = point2.y - point1.y; - var l = Math.sqrt(lx * lx + ly * ly); - - var force = Math.pow(edge.idealLength - l, 2) / edge.elasticity; - - if (0 !== l) { - var forceX = force * lx / l; - var forceY = force * ly / l; - } else { - var forceX = 0; - var forceY = 0; - } - - // Add this force to target and source nodes - if (!source.isLocked) { - source.offsetX += forceX; - source.offsetY += forceY; - } - - if (!target.isLocked) { - target.offsetX -= forceX; - target.offsetY -= forceY; - } - - // var s = 'Edge force between nodes ' + source.id + ' and ' + target.id; - // s += "\nDistance: " + l + " Force: (" + forceX + ", " + forceY + ")"; - // logDebug(s); - } - }; - - /** - * @brief : Computes gravity forces for all nodes - */ - var calculateGravityForces = function calculateGravityForces(layoutInfo, options) { - var distThreshold = 1; - - // var s = 'calculateGravityForces'; - // logDebug(s); - for (var i = 0; i < layoutInfo.graphSet.length; i++) { - var graph = layoutInfo.graphSet[i]; - var numNodes = graph.length; - - // s = "Set: " + graph.toString(); - // logDebug(s); - - // Compute graph center - if (0 === i) { - var centerX = layoutInfo.clientHeight / 2; - var centerY = layoutInfo.clientWidth / 2; - } else { - // Get Parent node for this graph, and use its position as center - var temp = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[0]]]; - var parent = layoutInfo.layoutNodes[layoutInfo.idToIndex[temp.parentId]]; - var centerX = parent.positionX; - var centerY = parent.positionY; - } - // s = "Center found at: " + centerX + ", " + centerY; - // logDebug(s); - - // Apply force to all nodes in graph - for (var j = 0; j < numNodes; j++) { - var node = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[j]]]; - // s = "Node: " + node.id; - - if (node.isLocked) { - continue; - } - - var dx = centerX - node.positionX; - var dy = centerY - node.positionY; - var d = Math.sqrt(dx * dx + dy * dy); - if (d > distThreshold) { - var fx = options.gravity * dx / d; - var fy = options.gravity * dy / d; - node.offsetX += fx; - node.offsetY += fy; - // s += ": Applied force: " + fx + ", " + fy; - } else {} - // s += ": skypped since it's too close to center"; - - // logDebug(s); - } - } - }; - - /** - * @brief : This function propagates the existing offsets from - * parent nodes to its descendents. - * @arg layoutInfo : layoutInfo Object - * @arg cy : cytoscape Object - * @arg options : Layout options - */ - var propagateForces = function propagateForces(layoutInfo, options) { - // Inline implementation of a queue, used for traversing the graph in BFS order - var queue = []; - var start = 0; // Points to the start the queue - var end = -1; // Points to the end of the queue - - // logDebug('propagateForces'); - - // Start by visiting the nodes in the root graph - queue.push.apply(queue, layoutInfo.graphSet[0]); - end += layoutInfo.graphSet[0].length; - - // Traverse the graph, level by level, - while (start <= end) { - // Get the node to visit and remove it from queue - var nodeId = queue[start++]; - var nodeIndex = layoutInfo.idToIndex[nodeId]; - var node = layoutInfo.layoutNodes[nodeIndex]; - var children = node.children; - - // We only need to process the node if it's compound - if (0 < children.length && !node.isLocked) { - var offX = node.offsetX; - var offY = node.offsetY; - - // var s = "Propagating offset from parent node : " + node.id + - // ". OffsetX: " + offX + ". OffsetY: " + offY; - // s += "\n Children: " + children.toString(); - // logDebug(s); - - for (var i = 0; i < children.length; i++) { - var childNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[children[i]]]; - // Propagate offset - childNode.offsetX += offX; - childNode.offsetY += offY; - // Add children to queue to be visited - queue[++end] = children[i]; - } - - // Reset parent offsets - node.offsetX = 0; - node.offsetY = 0; - } - } - }; - - /** - * @brief : Updates the layout model positions, based on - * the accumulated forces - */ - var updatePositions = function updatePositions(layoutInfo, options) { - // var s = 'Updating positions'; - // logDebug(s); - - // Reset boundaries for compound nodes - for (var i = 0; i < layoutInfo.nodeSize; i++) { - var n = layoutInfo.layoutNodes[i]; - if (0 < n.children.length) { - // logDebug("Resetting boundaries of compound node: " + n.id); - n.maxX = undefined; - n.minX = undefined; - n.maxY = undefined; - n.minY = undefined; - } - } - - for (var i = 0; i < layoutInfo.nodeSize; i++) { - var n = layoutInfo.layoutNodes[i]; - if (0 < n.children.length || n.isLocked) { - // No need to set compound or locked node position - // logDebug("Skipping position update of node: " + n.id); - continue; - } - // s = "Node: " + n.id + " Previous position: (" + - // n.positionX + ", " + n.positionY + ")."; - - // Limit displacement in order to improve stability - var tempForce = limitForce(n.offsetX, n.offsetY, layoutInfo.temperature); - n.positionX += tempForce.x; - n.positionY += tempForce.y; - n.offsetX = 0; - n.offsetY = 0; - n.minX = n.positionX - n.width; - n.maxX = n.positionX + n.width; - n.minY = n.positionY - n.height; - n.maxY = n.positionY + n.height; - // s += " New Position: (" + n.positionX + ", " + n.positionY + ")."; - // logDebug(s); - - // Update ancestry boudaries - updateAncestryBoundaries(n, layoutInfo); - } - - // Update size, position of compund nodes - for (var i = 0; i < layoutInfo.nodeSize; i++) { - var n = layoutInfo.layoutNodes[i]; - if (0 < n.children.length && !n.isLocked) { - n.positionX = (n.maxX + n.minX) / 2; - n.positionY = (n.maxY + n.minY) / 2; - n.width = n.maxX - n.minX; - n.height = n.maxY - n.minY; - // s = "Updating position, size of compound node " + n.id; - // s += "\nPositionX: " + n.positionX + ", PositionY: " + n.positionY; - // s += "\nWidth: " + n.width + ", Height: " + n.height; - // logDebug(s); - } - } - }; - - /** - * @brief : Limits a force (forceX, forceY) to be not - * greater (in modulo) than max. - 8 Preserves force direction. - */ - var limitForce = function limitForce(forceX, forceY, max) { - // var s = "Limiting force: (" + forceX + ", " + forceY + "). Max: " + max; - var force = Math.sqrt(forceX * forceX + forceY * forceY); - - if (force > max) { - var res = { - x: max * forceX / force, - y: max * forceY / force - }; - } else { - var res = { - x: forceX, - y: forceY - }; - } - - // s += ".\nResult: (" + res.x + ", " + res.y + ")"; - // logDebug(s); - - return res; - }; - - /** - * @brief : Function used for keeping track of compound node - * sizes, since they should bound all their subnodes. - */ - var updateAncestryBoundaries = function updateAncestryBoundaries(node, layoutInfo) { - // var s = "Propagating new position/size of node " + node.id; - var parentId = node.parentId; - if (null == parentId) { - // If there's no parent, we are done - // s += ". No parent node."; - // logDebug(s); - return; - } - - // Get Parent Node - var p = layoutInfo.layoutNodes[layoutInfo.idToIndex[parentId]]; - var flag = false; - - // MaxX - if (null == p.maxX || node.maxX + p.padRight > p.maxX) { - p.maxX = node.maxX + p.padRight; - flag = true; - // s += "\nNew maxX for parent node " + p.id + ": " + p.maxX; - } - - // MinX - if (null == p.minX || node.minX - p.padLeft < p.minX) { - p.minX = node.minX - p.padLeft; - flag = true; - // s += "\nNew minX for parent node " + p.id + ": " + p.minX; - } - - // MaxY - if (null == p.maxY || node.maxY + p.padBottom > p.maxY) { - p.maxY = node.maxY + p.padBottom; - flag = true; - // s += "\nNew maxY for parent node " + p.id + ": " + p.maxY; - } - - // MinY - if (null == p.minY || node.minY - p.padTop < p.minY) { - p.minY = node.minY - p.padTop; - flag = true; - // s += "\nNew minY for parent node " + p.id + ": " + p.minY; - } - - // If updated boundaries, propagate changes upward - if (flag) { - // logDebug(s); - return updateAncestryBoundaries(p, layoutInfo); - } - - // s += ". No changes in boundaries/position of parent node " + p.id; - // logDebug(s); - return; - }; - - var separateComponents = function separateComponents(layutInfo, options) { - var nodes = layoutInfo.layoutNodes; - var components = []; - - for (var i = 0; i < nodes.length; i++) { - var node = nodes[i]; - var cid = node.cmptId; - var component = components[cid] = components[cid] || []; - - component.push(node); - } - - var totalA = 0; - - for (var i = 0; i < components.length; i++) { - var c = components[i]; - - if (!c) { - continue; - } - - c.x1 = Infinity; - c.x2 = -Infinity; - c.y1 = Infinity; - c.y2 = -Infinity; - - for (var j = 0; j < c.length; j++) { - var n = c[j]; - - c.x1 = Math.min(c.x1, n.positionX - n.width / 2); - c.x2 = Math.max(c.x2, n.positionX + n.width / 2); - c.y1 = Math.min(c.y1, n.positionY - n.height / 2); - c.y2 = Math.max(c.y2, n.positionY + n.height / 2); - } - - c.w = c.x2 - c.x1; - c.h = c.y2 - c.y1; - - totalA += c.w * c.h; - } - - components.sort(function (c1, c2) { - return c2.w * c2.h - c1.w * c1.h; - }); - - var x = 0; - var y = 0; - var usedW = 0; - var rowH = 0; - var maxRowW = Math.sqrt(totalA) * layoutInfo.clientWidth / layoutInfo.clientHeight; - - for (var i = 0; i < components.length; i++) { - var c = components[i]; - - if (!c) { - continue; - } - - for (var j = 0; j < c.length; j++) { - var n = c[j]; - - if (!n.isLocked) { - n.positionX += x; - n.positionY += y; - } - } - - x += c.w + options.componentSpacing; - usedW += c.w + options.componentSpacing; - rowH = Math.max(rowH, c.h); - - if (usedW > maxRowW) { - y += rowH + options.componentSpacing; - x = 0; - usedW = 0; - rowH = 0; - } - } - }; - - var mainLoop = function mainLoop(i) { - if (stopped) { - // logDebug("Layout manually stopped. Stopping computation in step " + i); - return false; - } - - // Do one step in the phisical simulation - step(layoutInfo, options, i); - - // Update temperature - layoutInfo.temperature = layoutInfo.temperature * options.coolingFactor; - // logDebug("New temperature: " + layoutInfo.temperature); - - if (layoutInfo.temperature < options.minTemp) { - // logDebug("Temperature drop below minimum threshold. Stopping computation in step " + i); - return false; - } - - return true; - }; - - var i = 0; - var loopRet; - - do { - var f = 0; - - while (f < options.refresh && i < options.numIter) { - var loopRet = mainLoop(i); - if (!loopRet) { - break; - } - - f++; - i++; - } - - if (options.animate === true) { - broadcast(layoutInfo.layoutNodes); // eslint-disable-line no-undef - } - } while (loopRet && i + 1 < options.numIter); - - separateComponents(layoutInfo, options); - - return layoutInfo; - }).then(function (layoutInfoUpdated) { - layoutInfo.layoutNodes = layoutInfoUpdated.layoutNodes; // get the positions - - thread.stop(); - done(); - }); - - var done = function done() { - if (options.animate === true || options.animate === false) { - refresh({ - force: true, - next: function next() { - // Layout has finished - layout.one('layoutstop', options.stop); - layout.emit({ type: 'layoutstop', layout: layout }); - } - }); - } else { - options.eles.nodes().layoutPositions(layout, options, function (node) { - var lnode = layoutInfo.layoutNodes[layoutInfo.idToIndex[node.data('id')]]; - - return { x: lnode.positionX, y: lnode.positionY }; - }); - } - }; - - return this; // chaining -}; - -/** - * @brief : called on continuous layouts to stop them before they finish - */ -CoseLayout.prototype.stop = function () { - this.stopped = true; - - if (this.thread) { - this.thread.stop(); - } - - this.emit('layoutstop'); - - return this; // chaining -}; - -CoseLayout.prototype.destroy = function () { - if (this.thread) { - this.thread.stop(); - } - - return this; // chaining -}; - -/** - * @brief : Creates an object which is contains all the data - * used in the layout process - * @arg cy : cytoscape.js object - * @return : layoutInfo object initialized - */ -var createLayoutInfo = function createLayoutInfo(cy, layout, options) { - // Shortcut - var edges = options.eles.edges(); - var nodes = options.eles.nodes(); - - var layoutInfo = { - isCompound: cy.hasCompoundNodes(), - layoutNodes: [], - idToIndex: {}, - nodeSize: nodes.size(), - graphSet: [], - indexToGraph: [], - layoutEdges: [], - edgeSize: edges.size(), - temperature: options.initialTemp, - clientWidth: cy.width(), - clientHeight: cy.width(), - boundingBox: math.makeBoundingBox(options.boundingBox ? options.boundingBox : { - x1: 0, y1: 0, w: cy.width(), h: cy.height() - }) - }; - - var components = options.eles.components(); - var id2cmptId = {}; - - for (var i = 0; i < components.length; i++) { - var component = components[i]; - - for (var j = 0; j < component.length; j++) { - var node = component[j]; - - id2cmptId[node.id()] = i; - } - } - - // Iterate over all nodes, creating layout nodes - for (var i = 0; i < layoutInfo.nodeSize; i++) { - var n = nodes[i]; - var nbb = n.layoutDimensions(options); - - var tempNode = {}; - tempNode.isLocked = n.locked(); - tempNode.id = n.data('id'); - tempNode.parentId = n.data('parent'); - tempNode.cmptId = id2cmptId[n.id()]; - tempNode.children = []; - tempNode.positionX = n.position('x'); - tempNode.positionY = n.position('y'); - tempNode.offsetX = 0; - tempNode.offsetY = 0; - tempNode.height = nbb.w; - tempNode.width = nbb.h; - tempNode.maxX = tempNode.positionX + tempNode.width / 2; - tempNode.minX = tempNode.positionX - tempNode.width / 2; - tempNode.maxY = tempNode.positionY + tempNode.height / 2; - tempNode.minY = tempNode.positionY - tempNode.height / 2; - tempNode.padLeft = parseFloat(n.style('padding')); - tempNode.padRight = parseFloat(n.style('padding')); - tempNode.padTop = parseFloat(n.style('padding')); - tempNode.padBottom = parseFloat(n.style('padding')); - - // forces - tempNode.nodeRepulsion = is.fn(options.nodeRepulsion) ? options.nodeRepulsion(n) : options.nodeRepulsion; - - // Add new node - layoutInfo.layoutNodes.push(tempNode); - // Add entry to id-index map - layoutInfo.idToIndex[tempNode.id] = i; - } - - // Inline implementation of a queue, used for traversing the graph in BFS order - var queue = []; - var start = 0; // Points to the start the queue - var end = -1; // Points to the end of the queue - - var tempGraph = []; - - // Second pass to add child information and - // initialize queue for hierarchical traversal - for (var i = 0; i < layoutInfo.nodeSize; i++) { - var n = layoutInfo.layoutNodes[i]; - var p_id = n.parentId; - // Check if node n has a parent node - if (null != p_id) { - // Add node Id to parent's list of children - layoutInfo.layoutNodes[layoutInfo.idToIndex[p_id]].children.push(n.id); - } else { - // If a node doesn't have a parent, then it's in the root graph - queue[++end] = n.id; - tempGraph.push(n.id); - } - } - - // Add root graph to graphSet - layoutInfo.graphSet.push(tempGraph); - - // Traverse the graph, level by level, - while (start <= end) { - // Get the node to visit and remove it from queue - var node_id = queue[start++]; - var node_ix = layoutInfo.idToIndex[node_id]; - var node = layoutInfo.layoutNodes[node_ix]; - var children = node.children; - if (children.length > 0) { - // Add children nodes as a new graph to graph set - layoutInfo.graphSet.push(children); - // Add children to que queue to be visited - for (var i = 0; i < children.length; i++) { - queue[++end] = children[i]; - } - } - } - - // Create indexToGraph map - for (var i = 0; i < layoutInfo.graphSet.length; i++) { - var graph = layoutInfo.graphSet[i]; - for (var j = 0; j < graph.length; j++) { - var index = layoutInfo.idToIndex[graph[j]]; - layoutInfo.indexToGraph[index] = i; - } - } - - // Iterate over all edges, creating Layout Edges - for (var i = 0; i < layoutInfo.edgeSize; i++) { - var e = edges[i]; - var tempEdge = {}; - tempEdge.id = e.data('id'); - tempEdge.sourceId = e.data('source'); - tempEdge.targetId = e.data('target'); - - // Compute ideal length - var idealLength = is.fn(options.idealEdgeLength) ? options.idealEdgeLength(e) : options.idealEdgeLength; - var elasticity = is.fn(options.edgeElasticity) ? options.edgeElasticity(e) : options.edgeElasticity; - - // Check if it's an inter graph edge - var sourceIx = layoutInfo.idToIndex[tempEdge.sourceId]; - var targetIx = layoutInfo.idToIndex[tempEdge.targetId]; - var sourceGraph = layoutInfo.indexToGraph[sourceIx]; - var targetGraph = layoutInfo.indexToGraph[targetIx]; - - if (sourceGraph != targetGraph) { - // Find lowest common graph ancestor - var lca = findLCA(tempEdge.sourceId, tempEdge.targetId, layoutInfo); - - // Compute sum of node depths, relative to lca graph - var lcaGraph = layoutInfo.graphSet[lca]; - var depth = 0; - - // Source depth - var tempNode = layoutInfo.layoutNodes[sourceIx]; - while (-1 === lcaGraph.indexOf(tempNode.id)) { - tempNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[tempNode.parentId]]; - depth++; - } - - // Target depth - tempNode = layoutInfo.layoutNodes[targetIx]; - while (-1 === lcaGraph.indexOf(tempNode.id)) { - tempNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[tempNode.parentId]]; - depth++; - } - - // logDebug('LCA of nodes ' + tempEdge.sourceId + ' and ' + tempEdge.targetId + - // ". Index: " + lca + " Contents: " + lcaGraph.toString() + - // ". Depth: " + depth); - - // Update idealLength - idealLength *= depth * options.nestingFactor; - } - - tempEdge.idealLength = idealLength; - tempEdge.elasticity = elasticity; - - layoutInfo.layoutEdges.push(tempEdge); - } - - // Finally, return layoutInfo object - return layoutInfo; -}; - -/** - * @brief : This function finds the index of the lowest common - * graph ancestor between 2 nodes in the subtree - * (from the graph hierarchy induced tree) whose - * root is graphIx - * - * @arg node1: node1's ID - * @arg node2: node2's ID - * @arg layoutInfo: layoutInfo object - * - */ -var findLCA = function findLCA(node1, node2, layoutInfo) { - // Find their common ancester, starting from the root graph - var res = findLCA_aux(node1, node2, 0, layoutInfo); - if (2 > res.count) { - // If aux function couldn't find the common ancester, - // then it is the root graph - return 0; - } else { - return res.graph; - } -}; - -/** - * @brief : Auxiliary function used for LCA computation - * - * @arg node1 : node1's ID - * @arg node2 : node2's ID - * @arg graphIx : subgraph index - * @arg layoutInfo : layoutInfo object - * - * @return : object of the form {count: X, graph: Y}, where: - * X is the number of ancesters (max: 2) found in - * graphIx (and it's subgraphs), - * Y is the graph index of the lowest graph containing - * all X nodes - */ -var findLCA_aux = function findLCA_aux(node1, node2, graphIx, layoutInfo) { - var graph = layoutInfo.graphSet[graphIx]; - // If both nodes belongs to graphIx - if (-1 < graph.indexOf(node1) && -1 < graph.indexOf(node2)) { - return { count: 2, graph: graphIx }; - } - - // Make recursive calls for all subgraphs - var c = 0; - for (var i = 0; i < graph.length; i++) { - var nodeId = graph[i]; - var nodeIx = layoutInfo.idToIndex[nodeId]; - var children = layoutInfo.layoutNodes[nodeIx].children; - - // If the node has no child, skip it - if (0 === children.length) { - continue; - } - - var childGraphIx = layoutInfo.indexToGraph[layoutInfo.idToIndex[children[0]]]; - var result = findLCA_aux(node1, node2, childGraphIx, layoutInfo); - if (0 === result.count) { - // Neither node1 nor node2 are present in this subgraph - continue; - } else if (1 === result.count) { - // One of (node1, node2) is present in this subgraph - c++; - if (2 === c) { - // We've already found both nodes, no need to keep searching - break; - } - } else { - // Both nodes are present in this subgraph - return result; - } - } - - return { count: c, graph: graphIx }; -}; - -/** - * @brief: printsLayoutInfo into js console - * Only used for debbuging - */ -var printLayoutInfo = function printLayoutInfo(layoutInfo) { - /* eslint-disable */ - - if (!DEBUG) { - return; - } - console.debug('layoutNodes:'); - for (var i = 0; i < layoutInfo.nodeSize; i++) { - var n = layoutInfo.layoutNodes[i]; - var s = '\nindex: ' + i + '\nId: ' + n.id + '\nChildren: ' + n.children.toString() + '\nparentId: ' + n.parentId + '\npositionX: ' + n.positionX + '\npositionY: ' + n.positionY + '\nOffsetX: ' + n.offsetX + '\nOffsetY: ' + n.offsetY + '\npadLeft: ' + n.padLeft + '\npadRight: ' + n.padRight + '\npadTop: ' + n.padTop + '\npadBottom: ' + n.padBottom; - - console.debug(s); - } - - console.debug('idToIndex'); - for (var i in layoutInfo.idToIndex) { - console.debug('Id: ' + i + '\nIndex: ' + layoutInfo.idToIndex[i]); - } - - console.debug('Graph Set'); - var set = layoutInfo.graphSet; - for (var i = 0; i < set.length; i++) { - console.debug('Set : ' + i + ': ' + set[i].toString()); - } - - var s = 'IndexToGraph'; - for (var i = 0; i < layoutInfo.indexToGraph.length; i++) { - s += '\nIndex : ' + i + ' Graph: ' + layoutInfo.indexToGraph[i]; - } - console.debug(s); - - s = 'Layout Edges'; - for (var i = 0; i < layoutInfo.layoutEdges.length; i++) { - var e = layoutInfo.layoutEdges[i]; - s += '\nEdge Index: ' + i + ' ID: ' + e.id + ' SouceID: ' + e.sourceId + ' TargetId: ' + e.targetId + ' Ideal Length: ' + e.idealLength; - } - console.debug(s); - - s = 'nodeSize: ' + layoutInfo.nodeSize; - s += '\nedgeSize: ' + layoutInfo.edgeSize; - s += '\ntemperature: ' + layoutInfo.temperature; - console.debug(s); - - return; - /* eslint-enable */ -}; - -/** - * @brief : Randomizes the position of all nodes - */ -var randomizePositions = function randomizePositions(layoutInfo, cy) { - var width = layoutInfo.clientWidth; - var height = layoutInfo.clientHeight; - - for (var i = 0; i < layoutInfo.nodeSize; i++) { - var n = layoutInfo.layoutNodes[i]; - - // No need to randomize compound nodes or locked nodes - if (0 === n.children.length && !n.isLocked) { - n.positionX = Math.random() * width; - n.positionY = Math.random() * height; - } - } -}; - -/** - * @brief : Updates the positions of nodes in the network - * @arg layoutInfo : LayoutInfo object - * @arg cy : Cytoscape object - * @arg options : Layout options - */ -var refreshPositions = function refreshPositions(layoutInfo, cy, options) { - // var s = 'Refreshing positions'; - // logDebug(s); - - var layout = options.layout; - var nodes = options.eles.nodes(); - var bb = layoutInfo.boundingBox; - var coseBB = { x1: Infinity, x2: -Infinity, y1: Infinity, y2: -Infinity }; - - if (options.boundingBox) { - nodes.forEach(function (node) { - var lnode = layoutInfo.layoutNodes[layoutInfo.idToIndex[node.data('id')]]; - - coseBB.x1 = Math.min(coseBB.x1, lnode.positionX); - coseBB.x2 = Math.max(coseBB.x2, lnode.positionX); - - coseBB.y1 = Math.min(coseBB.y1, lnode.positionY); - coseBB.y2 = Math.max(coseBB.y2, lnode.positionY); - }); - - coseBB.w = coseBB.x2 - coseBB.x1; - coseBB.h = coseBB.y2 - coseBB.y1; - } - - nodes.positions(function (ele, i) { - var lnode = layoutInfo.layoutNodes[layoutInfo.idToIndex[ele.data('id')]]; - // s = "Node: " + lnode.id + ". Refreshed position: (" + - // lnode.positionX + ", " + lnode.positionY + ")."; - // logDebug(s); - - if (options.boundingBox) { - // then add extra bounding box constraint - var pctX = (lnode.positionX - coseBB.x1) / coseBB.w; - var pctY = (lnode.positionY - coseBB.y1) / coseBB.h; - - return { - x: bb.x1 + pctX * bb.w, - y: bb.y1 + pctY * bb.h - }; - } else { - return { - x: lnode.positionX, - y: lnode.positionY - }; - } - }); - - // Trigger layoutReady only on first call - if (true !== layoutInfo.ready) { - // s = 'Triggering layoutready'; - // logDebug(s); - layoutInfo.ready = true; - layout.one('layoutready', options.ready); - layout.emit({ type: 'layoutready', layout: this }); - } -}; - -/** - * @brief : Logs a debug message in JS console, if DEBUG is ON - */ -// var logDebug = function(text) { -// if (DEBUG) { -// console.debug(text); -// } -// }; - -module.exports = CoseLayout; - -/***/ }), -/* 102 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var math = __webpack_require__(2); - -var defaults = { - fit: true, // whether to fit the viewport to the graph - padding: 30, // padding used on fit - boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space - avoidOverlapPadding: 10, // extra spacing around nodes when avoidOverlap: true - nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm - spacingFactor: undefined, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up - condense: false, // uses all available space on false, uses minimal space on true - rows: undefined, // force num of rows in the grid - cols: undefined, // force num of columns in the grid - position: function position(node) {}, // returns { row, col } for element - sort: undefined, // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } - animate: false, // whether to transition the node positions - animationDuration: 500, // duration of animation in ms if enabled - animationEasing: undefined, // easing of animation if enabled - animateFilter: function animateFilter(node, i) { - return true; - }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts - ready: undefined, // callback on layoutready - stop: undefined, // callback on layoutstop - transform: function transform(node, position) { - return position; - } // transform a given node position. Useful for changing flow direction in discrete layouts -}; - -function GridLayout(options) { - this.options = util.extend({}, defaults, options); -} - -GridLayout.prototype.run = function () { - var params = this.options; - var options = params; - - var cy = params.cy; - var eles = options.eles; - var nodes = eles.nodes().not(':parent'); - - if (options.sort) { - nodes = nodes.sort(options.sort); - } - - var bb = math.makeBoundingBox(options.boundingBox ? options.boundingBox : { - x1: 0, y1: 0, w: cy.width(), h: cy.height() - }); - - if (bb.h === 0 || bb.w === 0) { - nodes.layoutPositions(this, options, function (ele) { - return { x: bb.x1, y: bb.y1 }; - }); - } else { - - // width/height * splits^2 = cells where splits is number of times to split width - var cells = nodes.size(); - var splits = Math.sqrt(cells * bb.h / bb.w); - var rows = Math.round(splits); - var cols = Math.round(bb.w / bb.h * splits); - - var small = function small(val) { - if (val == null) { - return Math.min(rows, cols); - } else { - var min = Math.min(rows, cols); - if (min == rows) { - rows = val; - } else { - cols = val; - } - } - }; - - var large = function large(val) { - if (val == null) { - return Math.max(rows, cols); - } else { - var max = Math.max(rows, cols); - if (max == rows) { - rows = val; - } else { - cols = val; - } - } - }; - - var oRows = options.rows; - var oCols = options.cols != null ? options.cols : options.columns; - - // if rows or columns were set in options, use those values - if (oRows != null && oCols != null) { - rows = oRows; - cols = oCols; - } else if (oRows != null && oCols == null) { - rows = oRows; - cols = Math.ceil(cells / rows); - } else if (oRows == null && oCols != null) { - cols = oCols; - rows = Math.ceil(cells / cols); - } - - // otherwise use the automatic values and adjust accordingly - - // if rounding was up, see if we can reduce rows or columns - else if (cols * rows > cells) { - var sm = small(); - var lg = large(); - - // reducing the small side takes away the most cells, so try it first - if ((sm - 1) * lg >= cells) { - small(sm - 1); - } else if ((lg - 1) * sm >= cells) { - large(lg - 1); - } - } else { - - // if rounding was too low, add rows or columns - while (cols * rows < cells) { - var _sm = small(); - var _lg = large(); - - // try to add to larger side first (adds less in multiplication) - if ((_lg + 1) * _sm >= cells) { - large(_lg + 1); - } else { - small(_sm + 1); - } - } - } - - var cellWidth = bb.w / cols; - var cellHeight = bb.h / rows; - - if (options.condense) { - cellWidth = 0; - cellHeight = 0; - } - - if (options.avoidOverlap) { - for (var i = 0; i < nodes.length; i++) { - var node = nodes[i]; - var pos = node._private.position; - - if (pos.x == null || pos.y == null) { - // for bb - pos.x = 0; - pos.y = 0; - } - - var nbb = node.layoutDimensions(options); - var p = options.avoidOverlapPadding; - - var w = nbb.w + p; - var h = nbb.h + p; - - cellWidth = Math.max(cellWidth, w); - cellHeight = Math.max(cellHeight, h); - } - } - - var cellUsed = {}; // e.g. 'c-0-2' => true - - var used = function used(row, col) { - return cellUsed['c-' + row + '-' + col] ? true : false; - }; - - var use = function use(row, col) { - cellUsed['c-' + row + '-' + col] = true; - }; - - // to keep track of current cell position - var row = 0; - var col = 0; - var moveToNextCell = function moveToNextCell() { - col++; - if (col >= cols) { - col = 0; - row++; - } - }; - - // get a cache of all the manual positions - var id2manPos = {}; - for (var _i = 0; _i < nodes.length; _i++) { - var _node = nodes[_i]; - var rcPos = options.position(_node); - - if (rcPos && (rcPos.row !== undefined || rcPos.col !== undefined)) { - // must have at least row or col def'd - var _pos = { - row: rcPos.row, - col: rcPos.col - }; - - if (_pos.col === undefined) { - // find unused col - _pos.col = 0; - - while (used(_pos.row, _pos.col)) { - _pos.col++; - } - } else if (_pos.row === undefined) { - // find unused row - _pos.row = 0; - - while (used(_pos.row, _pos.col)) { - _pos.row++; - } - } - - id2manPos[_node.id()] = _pos; - use(_pos.row, _pos.col); - } - } - - var getPos = function getPos(element, i) { - var x = void 0, - y = void 0; - - if (element.locked() || element.isParent()) { - return false; - } - - // see if we have a manual position set - var rcPos = id2manPos[element.id()]; - if (rcPos) { - x = rcPos.col * cellWidth + cellWidth / 2 + bb.x1; - y = rcPos.row * cellHeight + cellHeight / 2 + bb.y1; - } else { - // otherwise set automatically - - while (used(row, col)) { - moveToNextCell(); - } - - x = col * cellWidth + cellWidth / 2 + bb.x1; - y = row * cellHeight + cellHeight / 2 + bb.y1; - use(row, col); - - moveToNextCell(); - } - - return { x: x, y: y }; - }; - - nodes.layoutPositions(this, options, getPos); - } - - return this; // chaining -}; - -module.exports = GridLayout; - -/***/ }), -/* 103 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); - -// default layout options -var defaults = { - ready: function ready() {}, // on layoutready - stop: function stop() {} // on layoutstop -}; - -// constructor -// options : object containing layout options -function NullLayout(options) { - this.options = util.extend({}, defaults, options); -} - -// runs the layout -NullLayout.prototype.run = function () { - var options = this.options; - var eles = options.eles; // elements to consider in the layout - var layout = this; - - // cy is automatically populated for us in the constructor - var cy = options.cy; // jshint ignore:line - - layout.emit('layoutstart'); - - // puts all nodes at (0, 0) - eles.nodes().positions(function () { - return { - x: 0, - y: 0 - }; - }); - - // trigger layoutready when each node has had its position set at least once - layout.one('layoutready', options.ready); - layout.emit('layoutready'); - - // trigger layoutstop when the layout stops (e.g. finishes) - layout.one('layoutstop', options.stop); - layout.emit('layoutstop'); - - return this; // chaining -}; - -// called on continuous layouts to stop them before they finish -NullLayout.prototype.stop = function () { - return this; // chaining -}; - -module.exports = NullLayout; - -/***/ }), -/* 104 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var is = __webpack_require__(0); - -var defaults = { - positions: undefined, // map of (node id) => (position obj); or function(node){ return somPos; } - zoom: undefined, // the zoom level to set (prob want fit = false if set) - pan: undefined, // the pan level to set (prob want fit = false if set) - fit: true, // whether to fit to viewport - padding: 30, // padding on fit - animate: false, // whether to transition the node positions - animationDuration: 500, // duration of animation in ms if enabled - animationEasing: undefined, // easing of animation if enabled - animateFilter: function animateFilter(node, i) { - return true; - }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts - ready: undefined, // callback on layoutready - stop: undefined, // callback on layoutstop - transform: function transform(node, position) { - return position; - } // transform a given node position. Useful for changing flow direction in discrete layouts -}; - -function PresetLayout(options) { - this.options = util.extend({}, defaults, options); -} - -PresetLayout.prototype.run = function () { - var options = this.options; - var eles = options.eles; - - var nodes = eles.nodes(); - var posIsFn = is.fn(options.positions); - - function getPosition(node) { - if (options.positions == null) { - return null; - } - - if (posIsFn) { - return options.positions(node); - } - - var pos = options.positions[node._private.data.id]; - - if (pos == null) { - return null; - } - - return pos; - } - - nodes.layoutPositions(this, options, function (node, i) { - var position = getPosition(node); - - if (node.locked() || position == null) { - return false; - } - - return position; - }); - - return this; // chaining -}; - -module.exports = PresetLayout; - -/***/ }), -/* 105 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var math = __webpack_require__(2); - -var defaults = { - fit: true, // whether to fit to viewport - padding: 30, // fit padding - boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - animate: false, // whether to transition the node positions - animationDuration: 500, // duration of animation in ms if enabled - animationEasing: undefined, // easing of animation if enabled - animateFilter: function animateFilter(node, i) { - return true; - }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts - ready: undefined, // callback on layoutready - stop: undefined, // callback on layoutstop - transform: function transform(node, position) { - return position; - } // transform a given node position. Useful for changing flow direction in discrete layouts -}; - -function RandomLayout(options) { - this.options = util.extend({}, defaults, options); -} - -RandomLayout.prototype.run = function () { - var options = this.options; - var cy = options.cy; - var eles = options.eles; - var nodes = eles.nodes().not(':parent'); - - var bb = math.makeBoundingBox(options.boundingBox ? options.boundingBox : { - x1: 0, y1: 0, w: cy.width(), h: cy.height() - }); - - var getPos = function getPos(node, i) { - return { - x: bb.x1 + Math.round(Math.random() * bb.w), - y: bb.y1 + Math.round(Math.random() * bb.h) - }; - }; - - nodes.layoutPositions(this, options, getPos); - - return this; // chaining -}; - -module.exports = RandomLayout; - -/***/ }), -/* 106 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = [{ name: 'null', impl: __webpack_require__(107) }, { name: 'base', impl: __webpack_require__(108) }, { name: 'canvas', impl: __webpack_require__(124) }]; - -/***/ }), -/* 107 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -function NullRenderer(options) { - this.options = options; - this.notifications = 0; // for testing -} - -var noop = function noop() {}; - -NullRenderer.prototype = { - recalculateRenderedStyle: noop, - notify: function notify() { - this.notifications++; - }, - init: noop -}; - -module.exports = NullRenderer; - -/***/ }), -/* 108 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var util = __webpack_require__(1); -var window = __webpack_require__(3); - -var BaseRenderer = function BaseRenderer(options) { - this.init(options); -}; -var BR = BaseRenderer; -var BRp = BR.prototype; - -BRp.clientFunctions = ['redrawHint', 'render', 'renderTo', 'matchCanvasSize', 'nodeShapeImpl', 'arrowShapeImpl']; - -BRp.init = function (options) { - var r = this; - - r.options = options; - - r.cy = options.cy; - - var ctr = r.container = options.cy.container(); - - // prepend a stylesheet in the head such that - if (window) { - var document = window.document; - var head = document.head; - var stylesheetId = '__________cytoscape_stylesheet'; - var className = '__________cytoscape_container'; - var stylesheetAlreadyExists = document.getElementById(stylesheetId) != null; - - if (ctr.className.indexOf(className) < 0) { - ctr.className = (ctr.className || '') + ' ' + className; - } - - if (!stylesheetAlreadyExists) { - var stylesheet = document.createElement('style'); - - stylesheet.id = stylesheetId; - stylesheet.innerHTML = '.' + className + ' { position: relative; }'; - - head.insertBefore(stylesheet, head.children[0]); // first so lowest priority - } - - var computedStyle = window.getComputedStyle(ctr); - var position = computedStyle.getPropertyValue('position'); - - if (position === 'static') { - util.error('A Cytoscape container has style position:static and so can not use UI extensions properly'); - } - } - - r.selection = [undefined, undefined, undefined, undefined, 0]; // Coordinates for selection box, plus enabled flag - - r.bezierProjPcts = [0.05, 0.225, 0.4, 0.5, 0.6, 0.775, 0.95]; - - //--Pointer-related data - r.hoverData = { down: null, last: null, - downTime: null, triggerMode: null, - dragging: false, - initialPan: [null, null], capture: false }; - - r.dragData = { possibleDragElements: [] }; - - r.touchData = { - start: null, capture: false, - - // These 3 fields related to tap, taphold events - startPosition: [null, null, null, null, null, null], - singleTouchStartTime: null, - singleTouchMoved: true, - - now: [null, null, null, null, null, null], - earlier: [null, null, null, null, null, null] - }; - - r.redraws = 0; - r.showFps = options.showFps; - r.debug = options.debug; - - r.hideEdgesOnViewport = options.hideEdgesOnViewport; - r.hideLabelsOnViewport = options.hideLabelsOnViewport; - r.textureOnViewport = options.textureOnViewport; - r.wheelSensitivity = options.wheelSensitivity; - r.motionBlurEnabled = options.motionBlur; // on by default - r.forcedPixelRatio = options.pixelRatio; - r.motionBlur = options.motionBlur; // for initial kick off - r.motionBlurOpacity = options.motionBlurOpacity; - r.motionBlurTransparency = 1 - r.motionBlurOpacity; - r.motionBlurPxRatio = 1; - r.mbPxRBlurry = 1; //0.8; - r.minMbLowQualFrames = 4; - r.fullQualityMb = false; - r.clearedForMotionBlur = []; - r.desktopTapThreshold = options.desktopTapThreshold; - r.desktopTapThreshold2 = options.desktopTapThreshold * options.desktopTapThreshold; - r.touchTapThreshold = options.touchTapThreshold; - r.touchTapThreshold2 = options.touchTapThreshold * options.touchTapThreshold; - r.tapholdDuration = 500; - - r.bindings = []; - r.beforeRenderCallbacks = []; - r.beforeRenderPriorities = { // higher priority execs before lower one - animations: 400, - eleCalcs: 300, - eleTxrDeq: 200, - lyrTxrDeq: 100 - }; - - r.registerNodeShapes(); - r.registerArrowShapes(); - r.registerCalculationListeners(); -}; - -BRp.notify = function (params) { - var types; - var r = this; - - // the renderer can't be notified after it's destroyed - if (this.destroyed) { - return; - } - - if (is.array(params.type)) { - types = params.type; - } else { - types = [params.type]; - } - - var has = {}; - for (var i = 0; i < types.length; i++) { - var type = types[i]; - - has[type] = true; - } // for - - if (has['init']) { - r.load(); - return; - } - - if (has['destroy']) { - r.destroy(); - return; - } - - if (has['add'] || has['remove'] || has['load'] || has['zorder']) { - r.invalidateCachedZSortedEles(); - } - - if (has['viewport']) { - r.redrawHint('select', true); - } - - if (has['load'] || has['resize']) { - r.invalidateContainerClientCoordsCache(); - r.matchCanvasSize(r.container); - } - - r.redrawHint('eles', true); - r.redrawHint('drag', true); - - this.startRenderLoop(); - - this.redraw(); -}; - -BRp.destroy = function () { - var r = this; - - r.destroyed = true; - - r.cy.stopAnimationLoop(); - - for (var i = 0; i < r.bindings.length; i++) { - var binding = r.bindings[i]; - var b = binding; - var tgt = b.target; - - (tgt.off || tgt.removeEventListener).apply(tgt, b.args); - } - - r.bindings = []; - r.beforeRenderCallbacks = []; - r.onUpdateEleCalcsFns = []; - - if (r.removeObserver) { - r.removeObserver.disconnect(); - } - - if (r.styleObserver) { - r.styleObserver.disconnect(); - } - - if (r.labelCalcDiv) { - try { - document.body.removeChild(r.labelCalcDiv); // eslint-disable-line no-undef - } catch (e) { - // ie10 issue #1014 - } - } -}; - -[__webpack_require__(109), __webpack_require__(110), __webpack_require__(120), __webpack_require__(121), __webpack_require__(122), __webpack_require__(123)].forEach(function (props) { - util.extend(BRp, props); -}); - -module.exports = BR; - -/***/ }), -/* 109 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var math = __webpack_require__(2); -var is = __webpack_require__(0); -var util = __webpack_require__(1); - -var BRp = {}; - -BRp.arrowShapeWidth = 0.3; - -BRp.registerArrowShapes = function () { - var arrowShapes = this.arrowShapes = {}; - var renderer = this; - - // Contract for arrow shapes: - // 0, 0 is arrow tip - // (0, 1) is direction towards node - // (1, 0) is right - // - // functional api: - // collide: check x, y in shape - // roughCollide: called before collide, no false negatives - // draw: draw - // spacing: dist(arrowTip, nodeBoundary) - // gap: dist(edgeTip, nodeBoundary), edgeTip may != arrowTip - - var bbCollide = function bbCollide(x, y, size, angle, translation, edgeWidth, padding) { - var x1 = translation.x - size / 2 - padding; - var x2 = translation.x + size / 2 + padding; - var y1 = translation.y - size / 2 - padding; - var y2 = translation.y + size / 2 + padding; - - var inside = x1 <= x && x <= x2 && y1 <= y && y <= y2; - - return inside; - }; - - var transform = function transform(x, y, size, angle, translation) { - var xRotated = x * Math.cos(angle) - y * Math.sin(angle); - var yRotated = x * Math.sin(angle) + y * Math.cos(angle); - - var xScaled = xRotated * size; - var yScaled = yRotated * size; - - var xTranslated = xScaled + translation.x; - var yTranslated = yScaled + translation.y; - - return { - x: xTranslated, - y: yTranslated - }; - }; - - var transformPoints = function transformPoints(pts, size, angle, translation) { - var retPts = []; - - for (var i = 0; i < pts.length; i += 2) { - var x = pts[i]; - var y = pts[i + 1]; - - retPts.push(transform(x, y, size, angle, translation)); - } - - return retPts; - }; - - var pointsToArr = function pointsToArr(pts) { - var ret = []; - - for (var i = 0; i < pts.length; i++) { - var p = pts[i]; - - ret.push(p.x, p.y); - } - - return ret; - }; - - var standardGap = function standardGap(edge) { - return edge.pstyle('width').pfValue * edge.pstyle('arrow-scale').pfValue * 2; - }; - - var defineArrowShape = function defineArrowShape(name, defn) { - if (is.string(defn)) { - defn = arrowShapes[defn]; - } - - arrowShapes[name] = util.extend({ - name: name, - - points: [-0.15, -0.3, 0.15, -0.3, 0.15, 0.3, -0.15, 0.3], - - collide: function collide(x, y, size, angle, translation, padding) { - var points = pointsToArr(transformPoints(this.points, size + 2 * padding, angle, translation)); - var inside = math.pointInsidePolygonPoints(x, y, points); - - return inside; - }, - - roughCollide: bbCollide, - - draw: function draw(context, size, angle, translation) { - var points = transformPoints(this.points, size, angle, translation); - - renderer.arrowShapeImpl('polygon')(context, points); - }, - - spacing: function spacing(edge) { - return 0; - }, - - gap: standardGap - }, defn); - }; - - defineArrowShape('none', { - collide: util.falsify, - - roughCollide: util.falsify, - - draw: util.noop, - - spacing: util.zeroify, - - gap: util.zeroify - }); - - defineArrowShape('triangle', { - points: [-0.15, -0.3, 0, 0, 0.15, -0.3] - }); - - defineArrowShape('arrow', 'triangle'); - - defineArrowShape('triangle-backcurve', { - points: arrowShapes['triangle'].points, - - controlPoint: [0, -0.15], - - roughCollide: bbCollide, - - draw: function draw(context, size, angle, translation, edgeWidth) { - var ptsTrans = transformPoints(this.points, size, angle, translation); - var ctrlPt = this.controlPoint; - var ctrlPtTrans = transform(ctrlPt[0], ctrlPt[1], size, angle, translation); - - renderer.arrowShapeImpl(this.name)(context, ptsTrans, ctrlPtTrans); - }, - - gap: function gap(edge) { - return standardGap(edge) * 0.8; - } - }); - - defineArrowShape('triangle-tee', { - points: [-0.15, -0.3, 0, 0, 0.15, -0.3, -0.15, -0.3], - - pointsTee: [-0.15, -0.4, -0.15, -0.5, 0.15, -0.5, 0.15, -0.4], - - collide: function collide(x, y, size, angle, translation, edgeWidth, padding) { - var triPts = pointsToArr(transformPoints(this.points, size + 2 * padding, angle, translation)); - var teePts = pointsToArr(transformPoints(this.pointsTee, size + 2 * padding, angle, translation)); - - var inside = math.pointInsidePolygonPoints(x, y, triPts) || math.pointInsidePolygonPoints(x, y, teePts); - - return inside; - }, - - draw: function draw(context, size, angle, translation, edgeWidth) { - var triPts = transformPoints(this.points, size, angle, translation); - var teePts = transformPoints(this.pointsTee, size, angle, translation); - - renderer.arrowShapeImpl(this.name)(context, triPts, teePts); - } - }); - - defineArrowShape('triangle-cross', { - points: [-0.15, -0.3, 0, 0, 0.15, -0.3, -0.15, -0.3], - - baseCrossLinePts: [-0.15, -0.4, // first half of the rectangle - -0.15, -0.4, 0.15, -0.4, // second half of the rectangle - 0.15, -0.4], - - crossLinePts: function crossLinePts(size, edgeWidth) { - // shift points so that the distance between the cross points matches edge width - var p = this.baseCrossLinePts.slice(); - var shiftFactor = edgeWidth / size; - var y0 = 3; - var y1 = 5; - - p[y0] = p[y0] - shiftFactor; - p[y1] = p[y1] - shiftFactor; - - return p; - }, - - collide: function collide(x, y, size, angle, translation, edgeWidth, padding) { - var triPts = pointsToArr(transformPoints(this.points, size + 2 * padding, angle, translation)); - var teePts = pointsToArr(transformPoints(this.crossLinePts(size, edgeWidth), size + 2 * padding, angle, translation)); - var inside = math.pointInsidePolygonPoints(x, y, triPts) || math.pointInsidePolygonPoints(x, y, teePts); - - return inside; - }, - - draw: function draw(context, size, angle, translation, edgeWidth) { - var triPts = transformPoints(this.points, size, angle, translation); - var crossLinePts = transformPoints(this.crossLinePts(size, edgeWidth), size, angle, translation); - - renderer.arrowShapeImpl(this.name)(context, triPts, crossLinePts); - } - }); - - defineArrowShape('vee', { - points: [-0.15, -0.3, 0, 0, 0.15, -0.3, 0, -0.15], - - gap: function gap(edge) { - return standardGap(edge) * 0.525; - } - }); - - defineArrowShape('circle', { - radius: 0.15, - - collide: function collide(x, y, size, angle, translation, edgeWidth, padding) { - var t = translation; - var inside = Math.pow(t.x - x, 2) + Math.pow(t.y - y, 2) <= Math.pow((size + 2 * padding) * this.radius, 2); - - return inside; - }, - - draw: function draw(context, size, angle, translation, edgeWidth) { - renderer.arrowShapeImpl(this.name)(context, translation.x, translation.y, this.radius * size); - }, - - spacing: function spacing(edge) { - return renderer.getArrowWidth(edge.pstyle('width').pfValue, edge.pstyle('arrow-scale').value) * this.radius; - } - }); - - defineArrowShape('tee', { - points: [-0.15, 0, -0.15, -0.1, 0.15, -0.1, 0.15, 0], - - spacing: function spacing(edge) { - return 1; - }, - - gap: function gap(edge) { - return 1; - } - }); - - defineArrowShape('square', { - points: [-0.15, 0.00, 0.15, 0.00, 0.15, -0.3, -0.15, -0.3] - }); - - defineArrowShape('diamond', { - points: [-0.15, -0.15, 0, -0.3, 0.15, -0.15, 0, 0], - - gap: function gap(edge) { - return edge.pstyle('width').pfValue * edge.pstyle('arrow-scale').value; - } - }); -}; - -module.exports = BRp; - -/***/ }), -/* 110 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); - -var BRp = {}; - -[__webpack_require__(111), __webpack_require__(112), __webpack_require__(113), __webpack_require__(114), __webpack_require__(115), __webpack_require__(116), __webpack_require__(117), __webpack_require__(118), __webpack_require__(119)].forEach(function (props) { - util.extend(BRp, props); -}); - -module.exports = BRp; - -/***/ }), -/* 111 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var window = __webpack_require__(3); -var math = __webpack_require__(2); -var util = __webpack_require__(1); -var window = __webpack_require__(3); - -var BRp = {}; - -// Project mouse -BRp.projectIntoViewport = function (clientX, clientY) { - var cy = this.cy; - var offsets = this.findContainerClientCoords(); - var offsetLeft = offsets[0]; - var offsetTop = offsets[1]; - var scale = offsets[4]; - var pan = cy.pan(); - var zoom = cy.zoom(); - - var x = ((clientX - offsetLeft) / scale - pan.x) / zoom; - var y = ((clientY - offsetTop) / scale - pan.y) / zoom; - - return [x, y]; -}; - -BRp.findContainerClientCoords = function () { - if (this.containerBB) { - return this.containerBB; - } - - var container = this.container; - var rect = container.getBoundingClientRect(); - var style = window.getComputedStyle(container); - var styleValue = function styleValue(name) { - return parseFloat(style.getPropertyValue(name)); - }; - - var padding = { - left: styleValue('padding-left'), - right: styleValue('padding-right'), - top: styleValue('padding-top'), - bottom: styleValue('padding-bottom') - }; - - var border = { - left: styleValue('border-left-width'), - right: styleValue('border-right-width'), - top: styleValue('border-top-width'), - bottom: styleValue('border-bottom-width') - }; - - var clientWidth = container.clientWidth; - var clientHeight = container.clientHeight; - - var paddingHor = padding.left + padding.right; - var paddingVer = padding.top + padding.bottom; - - var borderHor = border.left + border.right; - var borderVer = border.top + border.bottom; - - var scale = rect.width / (clientWidth + borderHor); - - var unscaledW = clientWidth - paddingHor; - var unscaledH = clientHeight - paddingVer; - - var scaledW = rect.width - (paddingHor + borderHor) * scale; - var scaledH = rect.height - (paddingVer + borderVer) * scale; - - var left = rect.left + padding.left + border.left; - var top = rect.top + padding.top + border.top; - - return this.containerBB = [left, top, unscaledW, unscaledH, scale]; -}; - -BRp.invalidateContainerClientCoordsCache = function () { - this.containerBB = null; -}; - -BRp.findNearestElement = function (x, y, interactiveElementsOnly, isTouch) { - return this.findNearestElements(x, y, interactiveElementsOnly, isTouch)[0]; -}; - -BRp.findNearestElements = function (x, y, interactiveElementsOnly, isTouch) { - var self = this; - var r = this; - var eles = r.getCachedZSortedEles(); - var near = []; // 1 node max, 1 edge max - var zoom = r.cy.zoom(); - var hasCompounds = r.cy.hasCompoundNodes(); - var edgeThreshold = (isTouch ? 24 : 8) / zoom; - var nodeThreshold = (isTouch ? 8 : 2) / zoom; - var labelThreshold = (isTouch ? 8 : 2) / zoom; - var minSqDist = Infinity; - var nearEdge; - var nearNode; - - if (interactiveElementsOnly) { - eles = eles.interactive; - } - - function addEle(ele, sqDist) { - if (ele.isNode()) { - if (nearNode) { - return; // can't replace node - } else { - nearNode = ele; - near.push(ele); - } - } - - if (ele.isEdge() && (sqDist == null || sqDist < minSqDist)) { - if (nearEdge) { - // then replace existing edge - // can replace only if same z-index - if (nearEdge.pstyle('z-index').value === ele.pstyle('z-index').value) { - for (var i = 0; i < near.length; i++) { - if (near[i].isEdge()) { - near[i] = ele; - nearEdge = ele; - minSqDist = sqDist != null ? sqDist : minSqDist; - break; - } - } - } - } else { - near.push(ele); - nearEdge = ele; - minSqDist = sqDist != null ? sqDist : minSqDist; - } - } - } - - function checkNode(node) { - var width = node.outerWidth() + 2 * nodeThreshold; - var height = node.outerHeight() + 2 * nodeThreshold; - var hw = width / 2; - var hh = height / 2; - var pos = node.position(); - - if (pos.x - hw <= x && x <= pos.x + hw // bb check x - && pos.y - hh <= y && y <= pos.y + hh // bb check y - ) { - var shape = r.nodeShapes[self.getNodeShape(node)]; - - if (shape.checkPoint(x, y, 0, width, height, pos.x, pos.y)) { - addEle(node, 0); - return true; - } - } - } - - function checkEdge(edge) { - var _p = edge._private; - - var rs = _p.rscratch; - var styleWidth = edge.pstyle('width').pfValue; - var scale = edge.pstyle('arrow-scale').value; - var width = styleWidth / 2 + edgeThreshold; // more like a distance radius from centre - var widthSq = width * width; - var width2 = width * 2; - var src = _p.source; - var tgt = _p.target; - var inEdgeBB = false; - var sqDist; - - if (rs.edgeType === 'segments' || rs.edgeType === 'straight' || rs.edgeType === 'haystack') { - var pts = rs.allpts; - - for (var i = 0; i + 3 < pts.length; i += 2) { - if ((inEdgeBB = math.inLineVicinity(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3], width2)) && widthSq > (sqDist = math.sqdistToFiniteLine(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3]))) { - addEle(edge, sqDist); - return true; - } - } - } else if (rs.edgeType === 'bezier' || rs.edgeType === 'multibezier' || rs.edgeType === 'self' || rs.edgeType === 'compound') { - var pts = rs.allpts; - for (var i = 0; i + 5 < rs.allpts.length; i += 4) { - if ((inEdgeBB = math.inBezierVicinity(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3], pts[i + 4], pts[i + 5], width2)) && widthSq > (sqDist = math.sqdistToQuadraticBezier(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3], pts[i + 4], pts[i + 5]))) { - addEle(edge, sqDist); - return true; - } - } - } - - // if we're close to the edge but didn't hit it, maybe we hit its arrows - - var src = src || _p.source; - var tgt = tgt || _p.target; - - var arSize = self.getArrowWidth(styleWidth, scale); - - var arrows = [{ name: 'source', x: rs.arrowStartX, y: rs.arrowStartY, angle: rs.srcArrowAngle }, { name: 'target', x: rs.arrowEndX, y: rs.arrowEndY, angle: rs.tgtArrowAngle }, { name: 'mid-source', x: rs.midX, y: rs.midY, angle: rs.midsrcArrowAngle }, { name: 'mid-target', x: rs.midX, y: rs.midY, angle: rs.midtgtArrowAngle }]; - - for (var i = 0; i < arrows.length; i++) { - var ar = arrows[i]; - var shape = r.arrowShapes[edge.pstyle(ar.name + '-arrow-shape').value]; - var edgeWidth = edge.pstyle('width').pfValue; - if (shape.roughCollide(x, y, arSize, ar.angle, { x: ar.x, y: ar.y }, edgeWidth, edgeThreshold) && shape.collide(x, y, arSize, ar.angle, { x: ar.x, y: ar.y }, edgeWidth, edgeThreshold)) { - addEle(edge); - return true; - } - } - - // for compound graphs, hitting edge may actually want a connected node instead (b/c edge may have greater z-index precedence) - if (hasCompounds && near.length > 0) { - checkNode(src); - checkNode(tgt); - } - } - - function preprop(obj, name, pre) { - return util.getPrefixedProperty(obj, name, pre); - } - - function checkLabel(ele, prefix) { - var _p = ele._private; - var th = labelThreshold; - - var prefixDash; - if (prefix) { - prefixDash = prefix + '-'; - } else { - prefixDash = ''; - } - - var text = ele.pstyle(prefixDash + 'label').value; - var eventsEnabled = ele.pstyle('text-events').strValue === 'yes'; - - if (!eventsEnabled || !text) { - return; - } - - var rstyle = _p.rstyle; - var bw = ele.pstyle('text-border-width').pfValue; - var pw = ele.pstyle('text-background-padding').pfValue; - var lw = preprop(rstyle, 'labelWidth', prefix) + bw + 2 * th + 2 * pw; - var lh = preprop(rstyle, 'labelHeight', prefix) + bw + 2 * th + 2 * pw; - var lx = preprop(rstyle, 'labelX', prefix); - var ly = preprop(rstyle, 'labelY', prefix); - - var theta = preprop(_p.rscratch, 'labelAngle', prefix); - - var lx1 = lx - lw / 2; - var lx2 = lx + lw / 2; - var ly1 = ly - lh / 2; - var ly2 = ly + lh / 2; - - if (theta) { - var cos = Math.cos(theta); - var sin = Math.sin(theta); - - var rotate = function rotate(x, y) { - x = x - lx; - y = y - ly; - - return { - x: x * cos - y * sin + lx, - y: x * sin + y * cos + ly - }; - }; - - var px1y1 = rotate(lx1, ly1); - var px1y2 = rotate(lx1, ly2); - var px2y1 = rotate(lx2, ly1); - var px2y2 = rotate(lx2, ly2); - - var points = [px1y1.x, px1y1.y, px2y1.x, px2y1.y, px2y2.x, px2y2.y, px1y2.x, px1y2.y]; - - if (math.pointInsidePolygonPoints(x, y, points)) { - addEle(ele); - return true; - } - } else { - // do a cheaper bb check - var bb = { - w: lw, - h: lh, - x1: lx1, - x2: lx2, - y1: ly1, - y2: ly2 - }; - - if (math.inBoundingBox(bb, x, y)) { - addEle(ele); - return true; - } - } - } - - for (var i = eles.length - 1; i >= 0; i--) { - // reverse order for precedence - var ele = eles[i]; - - if (ele.isNode()) { - checkNode(ele) || checkLabel(ele); - } else { - // then edge - checkEdge(ele) || checkLabel(ele) || checkLabel(ele, 'source') || checkLabel(ele, 'target'); - } - } - - return near; -}; - -// 'Give me everything from this box' -BRp.getAllInBox = function (x1, y1, x2, y2) { - var eles = this.getCachedZSortedEles().interactive; - var box = []; - - var x1c = Math.min(x1, x2); - var x2c = Math.max(x1, x2); - var y1c = Math.min(y1, y2); - var y2c = Math.max(y1, y2); - - x1 = x1c; - x2 = x2c; - y1 = y1c; - y2 = y2c; - - var boxBb = math.makeBoundingBox({ - x1: x1, y1: y1, - x2: x2, y2: y2 - }); - - for (var e = 0; e < eles.length; e++) { - var ele = eles[e]; - - if (ele.isNode()) { - var node = ele; - var nodeBb = node.boundingBox({ - includeNodes: true, - includeEdges: false, - includeLabels: false - }); - - if (math.boundingBoxesIntersect(boxBb, nodeBb) && !math.boundingBoxInBoundingBox(nodeBb, boxBb)) { - box.push(node); - } - } else { - var edge = ele; - var _p = edge._private; - var rs = _p.rscratch; - - if (rs.startX != null && rs.startY != null && !math.inBoundingBox(boxBb, rs.startX, rs.startY)) { - continue; - } - if (rs.endX != null && rs.endY != null && !math.inBoundingBox(boxBb, rs.endX, rs.endY)) { - continue; - } - - if (rs.edgeType === 'bezier' || rs.edgeType === 'multibezier' || rs.edgeType === 'self' || rs.edgeType === 'compound' || rs.edgeType === 'segments' || rs.edgeType === 'haystack') { - - var pts = _p.rstyle.bezierPts || _p.rstyle.linePts || _p.rstyle.haystackPts; - var allInside = true; - - for (var i = 0; i < pts.length; i++) { - if (!math.pointInBoundingBox(boxBb, pts[i])) { - allInside = false; - break; - } - } - - if (allInside) { - box.push(edge); - } - } else if (rs.edgeType === 'haystack' || rs.edgeType === 'straight') { - box.push(edge); - } - } - } - - return box; -}; - -module.exports = BRp; - -/***/ }), -/* 112 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var math = __webpack_require__(2); - -var BRp = {}; - -BRp.calculateArrowAngles = function (edge) { - var rs = edge._private.rscratch; - var isHaystack = rs.edgeType === 'haystack'; - var isBezier = rs.edgeType === 'bezier'; - var isMultibezier = rs.edgeType === 'multibezier'; - var isSegments = rs.edgeType === 'segments'; - var isCompound = rs.edgeType === 'compound'; - var isSelf = rs.edgeType === 'self'; - - // Displacement gives direction for arrowhead orientation - var dispX, dispY; - var startX, startY, endX, endY, midX, midY; - - if (isHaystack) { - startX = rs.haystackPts[0]; - startY = rs.haystackPts[1]; - endX = rs.haystackPts[2]; - endY = rs.haystackPts[3]; - } else { - startX = rs.arrowStartX; - startY = rs.arrowStartY; - endX = rs.arrowEndX; - endY = rs.arrowEndY; - } - - midX = rs.midX; - midY = rs.midY; - - // source - // - - if (isSegments) { - dispX = startX - rs.segpts[0]; - dispY = startY - rs.segpts[1]; - } else if (isMultibezier || isCompound || isSelf || isBezier) { - var pts = rs.allpts; - var bX = math.qbezierAt(pts[0], pts[2], pts[4], 0.1); - var bY = math.qbezierAt(pts[1], pts[3], pts[5], 0.1); - - dispX = startX - bX; - dispY = startY - bY; - } else { - dispX = startX - midX; - dispY = startY - midY; - } - - rs.srcArrowAngle = math.getAngleFromDisp(dispX, dispY); - - // mid target - // - - var midX = rs.midX; - var midY = rs.midY; - - if (isHaystack) { - midX = (startX + endX) / 2; - midY = (startY + endY) / 2; - } - - dispX = endX - startX; - dispY = endY - startY; - - if (isSegments) { - var pts = rs.allpts; - - if (pts.length / 2 % 2 === 0) { - var i2 = pts.length / 2; - var i1 = i2 - 2; - - dispX = pts[i2] - pts[i1]; - dispY = pts[i2 + 1] - pts[i1 + 1]; - } else { - var i2 = pts.length / 2 - 1; - var i1 = i2 - 2; - var i3 = i2 + 2; - - dispX = pts[i2] - pts[i1]; - dispY = pts[i2 + 1] - pts[i1 + 1]; - } - } else if (isMultibezier || isCompound || isSelf) { - var pts = rs.allpts; - var cpts = rs.ctrlpts; - var bp0x, bp0y; - var bp1x, bp1y; - - if (cpts.length / 2 % 2 === 0) { - var p0 = pts.length / 2 - 1; // startpt - var ic = p0 + 2; - var p1 = ic + 2; - - bp0x = math.qbezierAt(pts[p0], pts[ic], pts[p1], 0.0); - bp0y = math.qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.0); - - bp1x = math.qbezierAt(pts[p0], pts[ic], pts[p1], 0.0001); - bp1y = math.qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.0001); - } else { - var ic = pts.length / 2 - 1; // ctrpt - var p0 = ic - 2; // startpt - var p1 = ic + 2; // endpt - - bp0x = math.qbezierAt(pts[p0], pts[ic], pts[p1], 0.4999); - bp0y = math.qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.4999); - - bp1x = math.qbezierAt(pts[p0], pts[ic], pts[p1], 0.5); - bp1y = math.qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.5); - } - - dispX = bp1x - bp0x; - dispY = bp1y - bp0y; - } - - rs.midtgtArrowAngle = math.getAngleFromDisp(dispX, dispY); - - rs.midDispX = dispX; - rs.midDispY = dispY; - - // mid source - // - - dispX *= -1; - dispY *= -1; - - if (isSegments) { - var pts = rs.allpts; - - if (pts.length / 2 % 2 === 0) { - // already ok - } else { - var i2 = pts.length / 2 - 1; - var i3 = i2 + 2; - - dispX = -(pts[i3] - pts[i2]); - dispY = -(pts[i3 + 1] - pts[i2 + 1]); - } - } - - rs.midsrcArrowAngle = math.getAngleFromDisp(dispX, dispY); - - // target - // - - if (isSegments) { - dispX = endX - rs.segpts[rs.segpts.length - 2]; - dispY = endY - rs.segpts[rs.segpts.length - 1]; - } else if (isMultibezier || isCompound || isSelf || isBezier) { - var pts = rs.allpts; - var l = pts.length; - var bX = math.qbezierAt(pts[l - 6], pts[l - 4], pts[l - 2], 0.9); - var bY = math.qbezierAt(pts[l - 5], pts[l - 3], pts[l - 1], 0.9); - - dispX = endX - bX; - dispY = endY - bY; - } else { - dispX = endX - midX; - dispY = endY - midY; - } - - rs.tgtArrowAngle = math.getAngleFromDisp(dispX, dispY); -}; - -BRp.getArrowWidth = BRp.getArrowHeight = function (edgeWidth, scale) { - var cache = this.arrowWidthCache = this.arrowWidthCache || {}; - - var cachedVal = cache[edgeWidth + ', ' + scale]; - if (cachedVal) { - return cachedVal; - } - - cachedVal = Math.max(Math.pow(edgeWidth * 13.37, 0.9), 29) * scale; - cache[edgeWidth + ', ' + scale] = cachedVal; - - return cachedVal; -}; - -module.exports = BRp; - -/***/ }), -/* 113 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var math = __webpack_require__(2); -var is = __webpack_require__(0); - -var BRp = {}; - -BRp.findEdgeControlPoints = function (edges) { - if (!edges || edges.length === 0) { - return; - } - - var r = this; - var cy = r.cy; - var hasCompounds = cy.hasCompoundNodes(); - var hashTable = {}; - var pairIds = []; - var haystackEdges = []; - - // create a table of edge (src, tgt) => list of edges between them - var pairId; - for (var i = 0; i < edges.length; i++) { - var edge = edges[i]; - var _p = edge._private; - var data = _p.data; - var curveStyle = edge.pstyle('curve-style').value; - var edgeIsUnbundled = curveStyle === 'unbundled-bezier' || curveStyle === 'segments'; - var edgeIsBezier = curveStyle === 'unbundled-bezier' || curveStyle === 'bezier'; - - // ignore edges who are not to be displayed - // they shouldn't take up space - if (edge.pstyle('display').value === 'none') { - continue; - } - - if (curveStyle === 'haystack') { - haystackEdges.push(edge); - continue; - } - - var srcId = data.source; - var tgtId = data.target; - - pairId = srcId > tgtId ? tgtId + '$-$' + srcId : srcId + '$-$' + tgtId; - - if (edgeIsUnbundled) { - pairId = 'unbundled' + '$-$' + data.id; - } - - var tableEntry = hashTable[pairId]; - - if (tableEntry == null) { - tableEntry = hashTable[pairId] = []; - pairIds.push(pairId); - } - - tableEntry.push(edge); - - if (edgeIsUnbundled) { - tableEntry.hasUnbundled = true; - } - - if (edgeIsBezier) { - tableEntry.hasBezier = true; - } - } - - var src, tgt, srcPos, tgtPos, srcW, srcH, tgtW, tgtH, srcShape, tgtShape; - var vectorNormInverse; - var badBezier; - - // for each pair (src, tgt), create the ctrl pts - // Nested for loop is OK; total number of iterations for both loops = edgeCount - for (var p = 0; p < pairIds.length; p++) { - pairId = pairIds[p]; - var pairEdges = hashTable[pairId]; - - // for each pair id, the edges should be sorted by index - pairEdges.sort(function (edge1, edge2) { - return edge1.poolIndex() - edge2.poolIndex(); - }); - - src = pairEdges[0]._private.source; - tgt = pairEdges[0]._private.target; - - // make sure src/tgt distinction is consistent for bundled edges - if (!pairEdges.hasUnbundled && src.id() > tgt.id()) { - var temp = src; - src = tgt; - tgt = temp; - } - - srcPos = src.position(); - tgtPos = tgt.position(); - - srcW = src.outerWidth(); - srcH = src.outerHeight(); - - tgtW = tgt.outerWidth(); - tgtH = tgt.outerHeight(); - - srcShape = r.nodeShapes[this.getNodeShape(src)]; - tgtShape = r.nodeShapes[this.getNodeShape(tgt)]; - - badBezier = false; - - var edge; - var edge_p; - var rs; - - var dirCounts = { - 'north': 0, - 'west': 0, - 'south': 0, - 'east': 0, - 'northwest': 0, - 'southwest': 0, - 'northeast': 0, - 'southeast': 0 - }; - - var srcX2 = srcPos.x; - var srcY2 = srcPos.y; - var srcW2 = srcW; - var srcH2 = srcH; - - var tgtX2 = tgtPos.x; - var tgtY2 = tgtPos.y; - var tgtW2 = tgtW; - var tgtH2 = tgtH; - - var numEdges2 = pairEdges.length; - - for (var i = 0; i < pairEdges.length; i++) { - edge = pairEdges[i]; - edge_p = edge._private; - rs = edge_p.rscratch; - - var edgeIndex1 = rs.lastEdgeIndex; - var edgeIndex2 = i; - - var numEdges1 = rs.lastNumEdges; - - var curveStyle = edge.pstyle('curve-style').value; - - var edgeIsUnbundled = curveStyle === 'unbundled-bezier' || curveStyle === 'segments'; - - // whether the normalised pair order is the reverse of the edge's src-tgt order - var edgeIsSwapped = src.id() !== edge.source().id(); - - var ctrlptDists = edge.pstyle('control-point-distances'); - var loopDir = edge.pstyle('loop-direction').pfValue; - var loopSwp = edge.pstyle('loop-sweep').pfValue; - var ctrlptWs = edge.pstyle('control-point-weights'); - var bezierN = ctrlptDists && ctrlptWs ? Math.min(ctrlptDists.value.length, ctrlptWs.value.length) : 1; - var stepSize = edge.pstyle('control-point-step-size').pfValue; - var ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[0] : undefined; - var ctrlptWeight = ctrlptWs.value[0]; - var edgeDistances = edge.pstyle('edge-distances').value; - var srcDistFNode = edge.pstyle('source-distance-from-node').pfValue; - var tgtDistFNode = edge.pstyle('target-distance-from-node').pfValue; - var segmentWs = edge.pstyle('segment-weights'); - var segmentDs = edge.pstyle('segment-distances'); - var segmentsN = Math.min(segmentWs.pfValue.length, segmentDs.pfValue.length); - var srcEndpt = edge.pstyle('source-endpoint').value; - var tgtEndpt = edge.pstyle('target-endpoint').value; - var srcArrShape = edge.pstyle('source-arrow-shape').value; - var tgtArrShape = edge.pstyle('target-arrow-shape').value; - var arrowScale = edge.pstyle('arrow-scale').value; - var lineWidth = edge.pstyle('width').pfValue; - - var srcX1 = rs.lastSrcCtlPtX; - var srcY1 = rs.lastSrcCtlPtY; - var srcW1 = rs.lastSrcCtlPtW; - var srcH1 = rs.lastSrcCtlPtH; - - var tgtX1 = rs.lastTgtCtlPtX; - var tgtY1 = rs.lastTgtCtlPtY; - var tgtW1 = rs.lastTgtCtlPtW; - var tgtH1 = rs.lastTgtCtlPtH; - - var curveStyle1 = rs.lastCurveStyle; - var curveStyle2 = curveStyle; - - var ctrlptDists1 = rs.lastCtrlptDists; - var ctrlptDists2 = ctrlptDists ? ctrlptDists.strValue : null; - - var ctrlptWs1 = rs.lastCtrlptWs; - var ctrlptWs2 = ctrlptWs.strValue; - - var segmentWs1 = rs.lastSegmentWs; - var segmentWs2 = segmentWs.strValue; - - var segmentDs1 = rs.lastSegmentDs; - var segmentDs2 = segmentDs.strValue; - - var stepSize1 = rs.lastStepSize; - var stepSize2 = stepSize; - - var loopDir1 = rs.lastLoopDir; - var loopDir2 = loopDir; - - var loopSwp1 = rs.lastLoopSwp; - var loopSwp2 = loopSwp; - - var edgeDistances1 = rs.lastEdgeDistances; - var edgeDistances2 = edgeDistances; - - var srcDistFNode1 = rs.lastSrcDistFNode; - var srcDistFNode2 = srcDistFNode; - - var tgtDistFNode1 = rs.lastTgtDistFNode; - var tgtDistFNode2 = tgtDistFNode; - - var srcEndpt1 = rs.lastSrcEndpt; - var srcEndpt2 = srcEndpt; - - var tgtEndpt1 = rs.lastTgtEndpt; - var tgtEndpt2 = tgtEndpt; - - var srcArr1 = rs.lastSrcArr; - var srcArr2 = srcArrShape; - - var tgtArr1 = rs.lastTgtArr; - var tgtArr2 = tgtArrShape; - - var lineW1 = rs.lastLineW; - var lineW2 = lineWidth; - - var arrScl1 = rs.lastArrScl; - var arrScl2 = arrowScale; - - if (badBezier) { - rs.badBezier = true; - } else { - rs.badBezier = false; - } - - var ptCacheHit; - - if (srcX1 === srcX2 && srcY1 === srcY2 && srcW1 === srcW2 && srcH1 === srcH2 && tgtX1 === tgtX2 && tgtY1 === tgtY2 && tgtW1 === tgtW2 && tgtH1 === tgtH2 && curveStyle1 === curveStyle2 && ctrlptDists1 === ctrlptDists2 && ctrlptWs1 === ctrlptWs2 && segmentWs1 === segmentWs2 && segmentDs1 === segmentDs2 && stepSize1 === stepSize2 && loopDir1 === loopDir2 && loopSwp1 === loopSwp2 && edgeDistances1 === edgeDistances2 && srcDistFNode1 === srcDistFNode2 && tgtDistFNode1 === tgtDistFNode2 && srcEndpt1 === srcEndpt2 && tgtEndpt1 === tgtEndpt2 && srcArr1 === srcArr2 && tgtArr1 === tgtArr2 && lineW1 === lineW2 && arrScl1 === arrScl2 && (edgeIndex1 === edgeIndex2 && numEdges1 === numEdges2 || edgeIsUnbundled)) { - ptCacheHit = true; // then the control points haven't changed and we can skip calculating them - } else { - ptCacheHit = false; - - rs.lastSrcCtlPtX = srcX2; - rs.lastSrcCtlPtY = srcY2; - rs.lastSrcCtlPtW = srcW2; - rs.lastSrcCtlPtH = srcH2; - rs.lastTgtCtlPtX = tgtX2; - rs.lastTgtCtlPtY = tgtY2; - rs.lastTgtCtlPtW = tgtW2; - rs.lastTgtCtlPtH = tgtH2; - rs.lastEdgeIndex = edgeIndex2; - rs.lastNumEdges = numEdges2; - rs.lastCurveStyle = curveStyle2; - rs.lastCtrlptDists = ctrlptDists2; - rs.lastCtrlptWs = ctrlptWs2; - rs.lastSegmentDs = segmentDs2; - rs.lastSegmentWs = segmentWs2; - rs.lastStepSize = stepSize2; - rs.lastLoopDir = loopDir2; - rs.lastLoopSwp = loopSwp2; - rs.lastEdgeDistances = edgeDistances2; - rs.lastSrcDistFNode = srcDistFNode2; - rs.lastTgtDistFNode = tgtDistFNode2; - rs.lastSrcEndpt = srcEndpt2; - rs.lastTgtEndpt = tgtEndpt2; - rs.lastSrcArr = srcArr2; - rs.lastTgtArr = tgtArr2; - rs.lastLineW = lineW2; - rs.lastArrScl = arrScl2; - } - - if (!ptCacheHit) { - - if (!pairEdges.calculatedIntersection && src !== tgt && (pairEdges.hasBezier || pairEdges.hasUnbundled)) { - - pairEdges.calculatedIntersection = true; - - // pt outside src shape to calc distance/displacement from src to tgt - var srcOutside = srcShape.intersectLine(srcPos.x, srcPos.y, srcW, srcH, tgtPos.x, tgtPos.y, 0); - - pairEdges.srcIntn = srcOutside; - - // pt outside tgt shape to calc distance/displacement from src to tgt - var tgtOutside = tgtShape.intersectLine(tgtPos.x, tgtPos.y, tgtW, tgtH, srcPos.x, srcPos.y, 0); - - pairEdges.tgtIntn = tgtOutside; - - var midptSrcPts = { - x1: srcOutside[0], - x2: tgtOutside[0], - y1: srcOutside[1], - y2: tgtOutside[1] - }; - - var posPts = { - x1: srcPos.x, - x2: tgtPos.x, - y1: srcPos.y, - y2: tgtPos.y - }; - - var dy = tgtOutside[1] - srcOutside[1]; - var dx = tgtOutside[0] - srcOutside[0]; - var l = Math.sqrt(dx * dx + dy * dy); - - var vector = { - x: dx, - y: dy - }; - - var vectorNorm = { - x: vector.x / l, - y: vector.y / l - }; - vectorNormInverse = { - x: -vectorNorm.y, - y: vectorNorm.x - }; - - // if node shapes overlap, then no ctrl pts to draw - if (tgtShape.checkPoint(srcOutside[0], srcOutside[1], 0, tgtW, tgtH, tgtPos.x, tgtPos.y) && srcShape.checkPoint(tgtOutside[0], tgtOutside[1], 0, srcW, srcH, srcPos.x, srcPos.y)) { - vectorNormInverse = {}; - badBezier = true; - } - } - - if (!edgeIsSwapped) { - rs.srcIntn = pairEdges.srcIntn; - rs.tgtIntn = pairEdges.tgtIntn; - } else { - // ensure that the per-edge cached value for intersections are correct for swapped bundled edges - rs.srcIntn = pairEdges.tgtIntn; - rs.tgtIntn = pairEdges.srcIntn; - } - - if (src === tgt) { - // Self-edge - - rs.edgeType = 'self'; - - var j = i; - var loopDist = stepSize; - - if (edgeIsUnbundled) { - j = 0; - loopDist = ctrlptDist; - } - - var loopAngle = loopDir - Math.PI / 2; - var outAngle = loopAngle - loopSwp / 2; - var inAngle = loopAngle + loopSwp / 2; - - // increase by step size for overlapping loops, keyed on direction and sweep values - var dc = String(loopDir + '_' + loopSwp); - j = dirCounts[dc] === undefined ? dirCounts[dc] = 0 : ++dirCounts[dc]; - - rs.ctrlpts = [srcPos.x + Math.cos(outAngle) * 1.4 * loopDist * (j / 3 + 1), srcPos.y + Math.sin(outAngle) * 1.4 * loopDist * (j / 3 + 1), srcPos.x + Math.cos(inAngle) * 1.4 * loopDist * (j / 3 + 1), srcPos.y + Math.sin(inAngle) * 1.4 * loopDist * (j / 3 + 1)]; - } else if (hasCompounds && (src.isParent() || src.isChild() || tgt.isParent() || tgt.isChild()) && (src.parents().anySame(tgt) || tgt.parents().anySame(src))) { - // Compound edge - - rs.edgeType = 'compound'; - - // because the line approximation doesn't apply for compound beziers - // (loop/self edges are already elided b/c of cheap src==tgt check) - rs.badBezier = false; - - var j = i; - var loopDist = stepSize; - - if (edgeIsUnbundled) { - j = 0; - loopDist = ctrlptDist; - } - - var loopW = 50; - - var loopaPos = { - x: srcPos.x - srcW / 2, - y: srcPos.y - srcH / 2 - }; - - var loopbPos = { - x: tgtPos.x - tgtW / 2, - y: tgtPos.y - tgtH / 2 - }; - - var loopPos = { - x: Math.min(loopaPos.x, loopbPos.x), - y: Math.min(loopaPos.y, loopbPos.y) - }; - - // avoids cases with impossible beziers - var minCompoundStretch = 0.5; - var compoundStretchA = Math.max(minCompoundStretch, Math.log(srcW * 0.01)); - var compoundStretchB = Math.max(minCompoundStretch, Math.log(tgtW * 0.01)); - - rs.ctrlpts = [loopPos.x, loopPos.y - (1 + Math.pow(loopW, 1.12) / 100) * loopDist * (j / 3 + 1) * compoundStretchA, loopPos.x - (1 + Math.pow(loopW, 1.12) / 100) * loopDist * (j / 3 + 1) * compoundStretchB, loopPos.y]; - } else if (curveStyle === 'segments') { - // Segments (multiple straight lines) - - rs.edgeType = 'segments'; - rs.segpts = []; - - for (var s = 0; s < segmentsN; s++) { - var w = segmentWs.pfValue[s]; - var d = segmentDs.pfValue[s]; - - var w1 = 1 - w; - var w2 = w; - - var midptPts = edgeDistances === 'node-position' ? posPts : midptSrcPts; - - var adjustedMidpt = { - x: midptPts.x1 * w1 + midptPts.x2 * w2, - y: midptPts.y1 * w1 + midptPts.y2 * w2 - }; - - rs.segpts.push(adjustedMidpt.x + vectorNormInverse.x * d, adjustedMidpt.y + vectorNormInverse.y * d); - } - - // Straight edge - } else if (pairEdges.length % 2 === 1 && i === Math.floor(pairEdges.length / 2) && !edgeIsUnbundled) { - - rs.edgeType = 'straight'; - } else { - // (Multi)bezier - - var multi = edgeIsUnbundled; - - rs.edgeType = multi ? 'multibezier' : 'bezier'; - rs.ctrlpts = []; - - for (var b = 0; b < bezierN; b++) { - var normctrlptDist = (0.5 - pairEdges.length / 2 + i) * stepSize; - var manctrlptDist; - var sign = math.signum(normctrlptDist); - - if (multi) { - ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[b] : stepSize; // fall back on step size - ctrlptWeight = ctrlptWs.value[b]; - } - - if (edgeIsUnbundled) { - // multi or single unbundled - manctrlptDist = ctrlptDist; - } else { - manctrlptDist = ctrlptDist !== undefined ? sign * ctrlptDist : undefined; - } - - var distanceFromMidpoint = manctrlptDist !== undefined ? manctrlptDist : normctrlptDist; - - var w1 = 1 - ctrlptWeight; - var w2 = ctrlptWeight; - - if (edgeIsSwapped) { - var temp = w1; - w1 = w2; - w2 = temp; - } - - var midptPts = edgeDistances === 'node-position' ? posPts : midptSrcPts; - - var adjustedMidpt = { - x: midptPts.x1 * w1 + midptPts.x2 * w2, - y: midptPts.y1 * w1 + midptPts.y2 * w2 - }; - - rs.ctrlpts.push(adjustedMidpt.x + vectorNormInverse.x * distanceFromMidpoint, adjustedMidpt.y + vectorNormInverse.y * distanceFromMidpoint); - } - } - - // find endpts for edge - this.findEndpoints(edge); - - var badStart = !is.number(rs.startX) || !is.number(rs.startY); - var badAStart = !is.number(rs.arrowStartX) || !is.number(rs.arrowStartY); - var badEnd = !is.number(rs.endX) || !is.number(rs.endY); - var badAEnd = !is.number(rs.arrowEndX) || !is.number(rs.arrowEndY); - - var minCpADistFactor = 3; - var arrowW = this.getArrowWidth(edge.pstyle('width').pfValue, edge.pstyle('arrow-scale').value) * this.arrowShapeWidth; - var minCpADist = minCpADistFactor * arrowW; - - if (rs.edgeType === 'bezier') { - var startACpDist = math.dist({ x: rs.ctrlpts[0], y: rs.ctrlpts[1] }, { x: rs.startX, y: rs.startY }); - var closeStartACp = startACpDist < minCpADist; - var endACpDist = math.dist({ x: rs.ctrlpts[0], y: rs.ctrlpts[1] }, { x: rs.endX, y: rs.endY }); - var closeEndACp = endACpDist < minCpADist; - - var overlapping = false; - - if (badStart || badAStart || closeStartACp) { - overlapping = true; - - // project control point along line from src centre to outside the src shape - // (otherwise intersection will yield nothing) - var cpD = { // delta - x: rs.ctrlpts[0] - srcPos.x, - y: rs.ctrlpts[1] - srcPos.y - }; - var cpL = Math.sqrt(cpD.x * cpD.x + cpD.y * cpD.y); // length of line - var cpM = { // normalised delta - x: cpD.x / cpL, - y: cpD.y / cpL - }; - var radius = Math.max(srcW, srcH); - var cpProj = { // *2 radius guarantees outside shape - x: rs.ctrlpts[0] + cpM.x * 2 * radius, - y: rs.ctrlpts[1] + cpM.y * 2 * radius - }; - - var srcCtrlPtIntn = srcShape.intersectLine(srcPos.x, srcPos.y, srcW, srcH, cpProj.x, cpProj.y, 0); - - if (closeStartACp) { - rs.ctrlpts[0] = rs.ctrlpts[0] + cpM.x * (minCpADist - startACpDist); - rs.ctrlpts[1] = rs.ctrlpts[1] + cpM.y * (minCpADist - startACpDist); - } else { - rs.ctrlpts[0] = srcCtrlPtIntn[0] + cpM.x * minCpADist; - rs.ctrlpts[1] = srcCtrlPtIntn[1] + cpM.y * minCpADist; - } - } - - if (badEnd || badAEnd || closeEndACp) { - overlapping = true; - - // project control point along line from tgt centre to outside the tgt shape - // (otherwise intersection will yield nothing) - var cpD = { // delta - x: rs.ctrlpts[0] - tgtPos.x, - y: rs.ctrlpts[1] - tgtPos.y - }; - var cpL = Math.sqrt(cpD.x * cpD.x + cpD.y * cpD.y); // length of line - var cpM = { // normalised delta - x: cpD.x / cpL, - y: cpD.y / cpL - }; - var radius = Math.max(srcW, srcH); - var cpProj = { // *2 radius guarantees outside shape - x: rs.ctrlpts[0] + cpM.x * 2 * radius, - y: rs.ctrlpts[1] + cpM.y * 2 * radius - }; - - var tgtCtrlPtIntn = tgtShape.intersectLine(tgtPos.x, tgtPos.y, tgtW, tgtH, cpProj.x, cpProj.y, 0); - - if (closeEndACp) { - rs.ctrlpts[0] = rs.ctrlpts[0] + cpM.x * (minCpADist - endACpDist); - rs.ctrlpts[1] = rs.ctrlpts[1] + cpM.y * (minCpADist - endACpDist); - } else { - rs.ctrlpts[0] = tgtCtrlPtIntn[0] + cpM.x * minCpADist; - rs.ctrlpts[1] = tgtCtrlPtIntn[1] + cpM.y * minCpADist; - } - } - - if (overlapping) { - // recalc endpts - this.findEndpoints(edge); - } - } - - if (rs.edgeType === 'multibezier' || rs.edgeType === 'bezier' || rs.edgeType === 'self' || rs.edgeType === 'compound') { - rs.allpts = []; - - rs.allpts.push(rs.startX, rs.startY); - - for (var b = 0; b + 1 < rs.ctrlpts.length; b += 2) { - // ctrl pt itself - rs.allpts.push(rs.ctrlpts[b], rs.ctrlpts[b + 1]); - - // the midpt between ctrlpts as intermediate destination pts - if (b + 3 < rs.ctrlpts.length) { - rs.allpts.push((rs.ctrlpts[b] + rs.ctrlpts[b + 2]) / 2, (rs.ctrlpts[b + 1] + rs.ctrlpts[b + 3]) / 2); - } - } - - rs.allpts.push(rs.endX, rs.endY); - - var m, mt; - if (rs.ctrlpts.length / 2 % 2 === 0) { - m = rs.allpts.length / 2 - 1; - - rs.midX = rs.allpts[m]; - rs.midY = rs.allpts[m + 1]; - } else { - m = rs.allpts.length / 2 - 3; - mt = 0.5; - - rs.midX = math.qbezierAt(rs.allpts[m], rs.allpts[m + 2], rs.allpts[m + 4], mt); - rs.midY = math.qbezierAt(rs.allpts[m + 1], rs.allpts[m + 3], rs.allpts[m + 5], mt); - } - } else if (rs.edgeType === 'straight') { - // need to calc these after endpts - rs.allpts = [rs.startX, rs.startY, rs.endX, rs.endY]; - - // default midpt for labels etc - rs.midX = (rs.startX + rs.endX + rs.arrowStartX + rs.arrowEndX) / 4; - rs.midY = (rs.startY + rs.endY + rs.arrowStartY + rs.arrowEndY) / 4; - } else if (rs.edgeType === 'segments') { - rs.allpts = []; - rs.allpts.push(rs.startX, rs.startY); - rs.allpts.push.apply(rs.allpts, rs.segpts); - rs.allpts.push(rs.endX, rs.endY); - - if (rs.segpts.length % 4 === 0) { - var i2 = rs.segpts.length / 2; - var i1 = i2 - 2; - - rs.midX = (rs.segpts[i1] + rs.segpts[i2]) / 2; - rs.midY = (rs.segpts[i1 + 1] + rs.segpts[i2 + 1]) / 2; - } else { - var i1 = rs.segpts.length / 2 - 1; - - rs.midX = rs.segpts[i1]; - rs.midY = rs.segpts[i1 + 1]; - } - } - - this.storeEdgeProjections(edge); - this.calculateArrowAngles(edge); - } // if point cache miss - - this.recalculateEdgeLabelProjections(edge); - this.calculateLabelAngles(edge); - } // for pair edges - } // for pair ids - - for (var i = 0; i < haystackEdges.length; i++) { - var edge = haystackEdges[i]; - var _p = edge._private; - var rscratch = _p.rscratch; - var rs = rscratch; - - if (!rscratch.haystack) { - var angle = Math.random() * 2 * Math.PI; - - rscratch.source = { - x: Math.cos(angle), - y: Math.sin(angle) - }; - - var angle = Math.random() * 2 * Math.PI; - - rscratch.target = { - x: Math.cos(angle), - y: Math.sin(angle) - }; - } - - var src = _p.source; - var tgt = _p.target; - var srcPos = src.position(); - var tgtPos = tgt.position(); - var srcW = src.width(); - var tgtW = tgt.width(); - var srcH = src.height(); - var tgtH = tgt.height(); - var radius = edge.pstyle('haystack-radius').value; - var halfRadius = radius / 2; // b/c have to half width/height - - rs.haystackPts = rs.allpts = [rs.source.x * srcW * halfRadius + srcPos.x, rs.source.y * srcH * halfRadius + srcPos.y, rs.target.x * tgtW * halfRadius + tgtPos.x, rs.target.y * tgtH * halfRadius + tgtPos.y]; - - rs.midX = (rs.allpts[0] + rs.allpts[2]) / 2; - rs.midY = (rs.allpts[1] + rs.allpts[3]) / 2; - - // always override as haystack in case set to different type previously - rscratch.edgeType = rscratch.lastCurveStyle = 'haystack'; - rscratch.haystack = true; - - this.storeEdgeProjections(edge); - this.calculateArrowAngles(edge); - this.recalculateEdgeLabelProjections(edge); - this.calculateLabelAngles(edge); - } -}; - -function getPts(pts) { - var retPts = []; - - if (pts == null) { - return; - } - - for (var i = 0; i < pts.length; i += 2) { - var x = pts[i]; - var y = pts[i + 1]; - - retPts.push({ x: x, y: y }); - } - - return retPts; -} - -BRp.getSegmentPoints = function (edge) { - var rs = edge[0]._private.rscratch; - var type = rs.edgeType; - - if (type === 'segments') { - return getPts(rs.segpts); - } -}; - -BRp.getControlPoints = function (edge) { - var rs = edge[0]._private.rscratch; - var type = rs.edgeType; - - if (type === 'bezier' || type === 'multibezier' || type === 'self' || type === 'compound') { - return getPts(rs.ctrlpts); - } -}; - -BRp.getEdgeMidpoint = function (edge) { - var rs = edge[0]._private.rscratch; - - return { - x: rs.midX, - y: rs.midY - }; -}; - -module.exports = BRp; - -/***/ }), -/* 114 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var math = __webpack_require__(2); -var is = __webpack_require__(0); - -var BRp = {}; - -BRp.manualEndptToPx = function (node, prop) { - var r = this; - var npos = node.position(); - var w = node.outerWidth(); - var h = node.outerHeight(); - - if (prop.value.length === 2) { - var p = [prop.pfValue[0], prop.pfValue[1]]; - - if (prop.units[0] === '%') { - p[0] = p[0] * w; - } - - if (prop.units[1] === '%') { - p[1] = p[1] * h; - } - - p[0] += npos.x; - p[1] += npos.y; - - return p; - } else { - var angle = prop.pfValue[0]; - - angle = -Math.PI / 2 + angle; // start at 12 o'clock - - var l = 2 * Math.max(w, h); - - var _p = [npos.x + Math.cos(angle) * l, npos.y + Math.sin(angle) * l]; - - return r.nodeShapes[this.getNodeShape(node)].intersectLine(npos.x, npos.y, w, h, _p[0], _p[1], 0); - } -}; - -BRp.findEndpoints = function (edge) { - var r = this; - var intersect = void 0; - - var source = edge.source()[0]; - var target = edge.target()[0]; - - var srcPos = source.position(); - var tgtPos = target.position(); - - var tgtArShape = edge.pstyle('target-arrow-shape').value; - var srcArShape = edge.pstyle('source-arrow-shape').value; - - var tgtDist = edge.pstyle('target-distance-from-node').pfValue; - var srcDist = edge.pstyle('source-distance-from-node').pfValue; - - var rs = edge._private.rscratch; - - var et = rs.edgeType; - var self = et === 'self' || et === 'compound'; - var bezier = et === 'bezier' || et === 'multibezier' || self; - var multi = et !== 'bezier'; - var lines = et === 'straight' || et === 'segments'; - var segments = et === 'segments'; - var hasEndpts = bezier || multi || lines; - var srcManEndpt = edge.pstyle('source-endpoint'); - var srcManEndptVal = self ? 'outside-to-node' : srcManEndpt.value; - var tgtManEndpt = edge.pstyle('target-endpoint'); - var tgtManEndptVal = self ? 'outside-to-node' : tgtManEndpt.value; - - rs.srcManEndpt = srcManEndpt; - rs.tgtManEndpt = tgtManEndpt; - - var p1 = void 0; // last known point of edge on target side - var p2 = void 0; // last known point of edge on source side - - var p1_i = void 0; // point to intersect with target shape - var p2_i = void 0; // point to intersect with source shape - - if (bezier) { - var cpStart = [rs.ctrlpts[0], rs.ctrlpts[1]]; - var cpEnd = multi ? [rs.ctrlpts[rs.ctrlpts.length - 2], rs.ctrlpts[rs.ctrlpts.length - 1]] : cpStart; - - p1 = cpEnd; - p2 = cpStart; - } else if (lines) { - var srcArrowFromPt = !segments ? [tgtPos.x, tgtPos.y] : rs.segpts.slice(0, 2); - var tgtArrowFromPt = !segments ? [srcPos.x, srcPos.y] : rs.segpts.slice(rs.segpts.length - 2); - - p1 = tgtArrowFromPt; - p2 = srcArrowFromPt; - } - - if (tgtManEndptVal === 'inside-to-node') { - intersect = [tgtPos.x, tgtPos.y]; - } else if (tgtManEndpt.units) { - intersect = this.manualEndptToPx(target, tgtManEndpt); - } else if (tgtManEndptVal === 'outside-to-line') { - intersect = rs.tgtIntn; // use cached value from ctrlpt calc - } else { - if (tgtManEndptVal === 'outside-to-node') { - p1_i = p1; - } else if (tgtManEndptVal === 'outside-to-line') { - p1_i = [srcPos.x, srcPos.y]; - } - - intersect = r.nodeShapes[this.getNodeShape(target)].intersectLine(tgtPos.x, tgtPos.y, target.outerWidth(), target.outerHeight(), p1_i[0], p1_i[1], 0); - } - - var arrowEnd = math.shortenIntersection(intersect, p1, r.arrowShapes[tgtArShape].spacing(edge) + tgtDist); - var edgeEnd = math.shortenIntersection(intersect, p1, r.arrowShapes[tgtArShape].gap(edge) + tgtDist); - - rs.endX = edgeEnd[0]; - rs.endY = edgeEnd[1]; - - rs.arrowEndX = arrowEnd[0]; - rs.arrowEndY = arrowEnd[1]; - - if (srcManEndptVal === 'inside-to-node') { - intersect = [srcPos.x, srcPos.y]; - } else if (srcManEndpt.units) { - intersect = this.manualEndptToPx(source, srcManEndpt); - } else if (srcManEndptVal === 'outside-to-line') { - intersect = rs.srcIntn; // use cached value from ctrlpt calc - } else { - if (srcManEndptVal === 'outside-to-node') { - p2_i = p2; - } else if (srcManEndptVal === 'outside-to-line') { - p2_i = [tgtPos.x, tgtPos.y]; - } - - intersect = r.nodeShapes[this.getNodeShape(source)].intersectLine(srcPos.x, srcPos.y, source.outerWidth(), source.outerHeight(), p2_i[0], p2_i[1], 0); - } - - var arrowStart = math.shortenIntersection(intersect, p2, r.arrowShapes[srcArShape].spacing(edge) + srcDist); - var edgeStart = math.shortenIntersection(intersect, p2, r.arrowShapes[srcArShape].gap(edge) + srcDist); - - rs.startX = edgeStart[0]; - rs.startY = edgeStart[1]; - - rs.arrowStartX = arrowStart[0]; - rs.arrowStartY = arrowStart[1]; - - if (hasEndpts) { - if (!is.number(rs.startX) || !is.number(rs.startY) || !is.number(rs.endX) || !is.number(rs.endY)) { - rs.badLine = true; - } else { - rs.badLine = false; - } - } -}; - -BRp.getSourceEndpoint = function (edge) { - var rs = edge[0]._private.rscratch; - - switch (rs.edgeType) { - case 'haystack': - return { - x: rs.haystackPts[0], - y: rs.haystackPts[1] - }; - default: - return { - x: rs.arrowStartX, - y: rs.arrowStartY - }; - } -}; - -BRp.getTargetEndpoint = function (edge) { - var rs = edge[0]._private.rscratch; - - switch (rs.edgeType) { - case 'haystack': - return { - x: rs.haystackPts[2], - y: rs.haystackPts[3] - }; - default: - return { - x: rs.arrowEndX, - y: rs.arrowEndY - }; - } -}; - -module.exports = BRp; - -/***/ }), -/* 115 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var math = __webpack_require__(2); - -var BRp = {}; - -function pushBezierPts(r, edge, pts) { - var qbezierAt = function qbezierAt(p1, p2, p3, t) { - return math.qbezierAt(p1, p2, p3, t); - }; - var _p = edge._private; - var bpts = _p.rstyle.bezierPts; - - for (var i = 0; i < r.bezierProjPcts.length; i++) { - var p = r.bezierProjPcts[i]; - - bpts.push({ - x: qbezierAt(pts[0], pts[2], pts[4], p), - y: qbezierAt(pts[1], pts[3], pts[5], p) - }); - } -} - -BRp.storeEdgeProjections = function (edge) { - var _p = edge._private; - var rs = _p.rscratch; - var et = rs.edgeType; - - // clear the cached points state - _p.rstyle.bezierPts = null; - _p.rstyle.linePts = null; - _p.rstyle.haystackPts = null; - - if (et === 'multibezier' || et === 'bezier' || et === 'self' || et === 'compound') { - var bpts = _p.rstyle.bezierPts = []; // jshint ignore:line - - for (var i = 0; i + 5 < rs.allpts.length; i += 4) { - pushBezierPts(this, edge, rs.allpts.slice(i, i + 6)); - } - } else if (et === 'segments') { - var lpts = _p.rstyle.linePts = []; - - for (var i = 0; i + 1 < rs.allpts.length; i += 2) { - lpts.push({ - x: rs.allpts[i], - y: rs.allpts[i + 1] - }); - } - } else if (et === 'haystack') { - var hpts = rs.haystackPts; - - _p.rstyle.haystackPts = [{ x: hpts[0], y: hpts[1] }, { x: hpts[2], y: hpts[3] }]; - } - - _p.rstyle.arrowWidth = this.getArrowWidth(edge.pstyle('width').pfValue, edge.pstyle('arrow-scale').value) * this.arrowShapeWidth; -}; - -BRp.recalculateEdgeProjections = function (edges) { - this.findEdgeControlPoints(edges); -}; - -module.exports = BRp; - -/***/ }), -/* 116 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var math = __webpack_require__(2); -var is = __webpack_require__(0); -var util = __webpack_require__(1); - -var BRp = {}; - -BRp.recalculateNodeLabelProjection = function (node) { - var content = node.pstyle('label').strValue; - - if (is.emptyString(content)) { - return; - } - - var textX, textY; - var _p = node._private; - var nodeWidth = node.width(); - var nodeHeight = node.height(); - var padding = node.padding(); - var nodePos = node.position(); - var textHalign = node.pstyle('text-halign').strValue; - var textValign = node.pstyle('text-valign').strValue; - var rs = _p.rscratch; - var rstyle = _p.rstyle; - - switch (textHalign) { - case 'left': - textX = nodePos.x - nodeWidth / 2 - padding; - break; - - case 'right': - textX = nodePos.x + nodeWidth / 2 + padding; - break; - - default: - // e.g. center - textX = nodePos.x; - } - - switch (textValign) { - case 'top': - textY = nodePos.y - nodeHeight / 2 - padding; - break; - - case 'bottom': - textY = nodePos.y + nodeHeight / 2 + padding; - break; - - default: - // e.g. middle - textY = nodePos.y; - } - - rs.labelX = textX; - rs.labelY = textY; - rstyle.labelX = textX; - rstyle.labelY = textY; - - this.applyLabelDimensions(node); -}; - -var lineAngleFromDelta = function lineAngleFromDelta(dx, dy) { - var angle = Math.atan(dy / dx); - - if (dx === 0 && angle < 0) { - angle = angle * -1; - } - - return angle; -}; - -var lineAngle = function lineAngle(p0, p1) { - var dx = p1.x - p0.x; - var dy = p1.y - p0.y; - - return lineAngleFromDelta(dx, dy); -}; - -var bezierAngle = function bezierAngle(p0, p1, p2, t) { - var t0 = math.bound(0, t - 0.001, 1); - var t1 = math.bound(0, t + 0.001, 1); - - var lp0 = math.qbezierPtAt(p0, p1, p2, t0); - var lp1 = math.qbezierPtAt(p0, p1, p2, t1); - - return lineAngle(lp0, lp1); -}; - -BRp.recalculateEdgeLabelProjections = function (edge) { - var p; - var _p = edge._private; - var rs = _p.rscratch; - var r = this; - var content = { - mid: edge.pstyle('label').strValue, - source: edge.pstyle('source-label').strValue, - target: edge.pstyle('target-label').strValue - }; - - if (content.mid || content.source || content.target) { - // then we have to calculate... - } else { - return; // no labels => no calcs - } - - // add center point to style so bounding box calculations can use it - // - p = { - x: rs.midX, - y: rs.midY - }; - - var setRs = function setRs(propName, prefix, value) { - util.setPrefixedProperty(_p.rscratch, propName, prefix, value); - util.setPrefixedProperty(_p.rstyle, propName, prefix, value); - }; - - setRs('labelX', null, p.x); - setRs('labelY', null, p.y); - - var midAngle = lineAngleFromDelta(rs.midDispX, rs.midDispY); - setRs('labelAutoAngle', null, midAngle); - - var createControlPointInfo = function createControlPointInfo() { - if (createControlPointInfo.cache) { - return createControlPointInfo.cache; - } // use cache so only 1x per edge - - var ctrlpts = []; - - // store each ctrlpt info init - for (var i = 0; i + 5 < rs.allpts.length; i += 4) { - var p0 = { x: rs.allpts[i], y: rs.allpts[i + 1] }; - var p1 = { x: rs.allpts[i + 2], y: rs.allpts[i + 3] }; // ctrlpt - var p2 = { x: rs.allpts[i + 4], y: rs.allpts[i + 5] }; - - ctrlpts.push({ - p0: p0, - p1: p1, - p2: p2, - startDist: 0, - length: 0, - segments: [] - }); - } - - var bpts = _p.rstyle.bezierPts; - var nProjs = r.bezierProjPcts.length; - - function addSegment(cp, p0, p1, t0, t1) { - var length = math.dist(p0, p1); - var prevSegment = cp.segments[cp.segments.length - 1]; - var segment = { - p0: p0, - p1: p1, - t0: t0, - t1: t1, - startDist: prevSegment ? prevSegment.startDist + prevSegment.length : 0, - length: length - }; - - cp.segments.push(segment); - - cp.length += length; - } - - // update each ctrlpt with segment info - for (var i = 0; i < ctrlpts.length; i++) { - var cp = ctrlpts[i]; - var prevCp = ctrlpts[i - 1]; - - if (prevCp) { - cp.startDist = prevCp.startDist + prevCp.length; - } - - addSegment(cp, cp.p0, bpts[i * nProjs], 0, r.bezierProjPcts[0]); // first - - for (var j = 0; j < nProjs - 1; j++) { - addSegment(cp, bpts[i * nProjs + j], bpts[i * nProjs + j + 1], r.bezierProjPcts[j], r.bezierProjPcts[j + 1]); - } - - addSegment(cp, bpts[i * nProjs + nProjs - 1], cp.p2, r.bezierProjPcts[nProjs - 1], 1); // last - } - - return createControlPointInfo.cache = ctrlpts; - }; - - var calculateEndProjection = function calculateEndProjection(prefix) { - var angle; - var isSrc = prefix === 'source'; - - if (!content[prefix]) { - return; - } - - var offset = edge.pstyle(prefix + '-text-offset').pfValue; - - switch (rs.edgeType) { - case 'self': - case 'compound': - case 'bezier': - case 'multibezier': - var cps = createControlPointInfo(); - var selected; - var startDist = 0; - var totalDist = 0; - - // find the segment we're on - for (var i = 0; i < cps.length; i++) { - var cp = cps[isSrc ? i : cps.length - 1 - i]; - - for (var j = 0; j < cp.segments.length; j++) { - var seg = cp.segments[isSrc ? j : cp.segments.length - 1 - j]; - var lastSeg = i === cps.length - 1 && j === cp.segments.length - 1; - - startDist = totalDist; - totalDist += seg.length; - - if (totalDist >= offset || lastSeg) { - selected = { cp: cp, segment: seg }; - break; - } - } - - if (selected) { - break; - } - } - - var cp = selected.cp; - var seg = selected.segment; - var tSegment = (offset - startDist) / seg.length; - var segDt = seg.t1 - seg.t0; - var t = isSrc ? seg.t0 + segDt * tSegment : seg.t1 - segDt * tSegment; - - t = math.bound(0, t, 1); - p = math.qbezierPtAt(cp.p0, cp.p1, cp.p2, t); - angle = bezierAngle(cp.p0, cp.p1, cp.p2, t, p); - - break; - - case 'straight': - case 'segments': - case 'haystack': - var d = 0, - di, - d0; - var p0, p1; - var l = rs.allpts.length; - - for (var i = 0; i + 3 < l; i += 2) { - if (isSrc) { - p0 = { x: rs.allpts[i], y: rs.allpts[i + 1] }; - p1 = { x: rs.allpts[i + 2], y: rs.allpts[i + 3] }; - } else { - p0 = { x: rs.allpts[l - 2 - i], y: rs.allpts[l - 1 - i] }; - p1 = { x: rs.allpts[l - 4 - i], y: rs.allpts[l - 3 - i] }; - } - - di = math.dist(p0, p1); - d0 = d; - d += di; - - if (d >= offset) { - break; - } - } - - var pD = offset - d0; - var t = pD / di; - - t = math.bound(0, t, 1); - p = math.lineAt(p0, p1, t); - angle = lineAngle(p0, p1); - - break; - } - - setRs('labelX', prefix, p.x); - setRs('labelY', prefix, p.y); - setRs('labelAutoAngle', prefix, angle); - }; - - calculateEndProjection('source'); - calculateEndProjection('target'); - - this.applyLabelDimensions(edge); -}; - -BRp.applyLabelDimensions = function (ele) { - this.applyPrefixedLabelDimensions(ele); - - if (ele.isEdge()) { - this.applyPrefixedLabelDimensions(ele, 'source'); - this.applyPrefixedLabelDimensions(ele, 'target'); - } -}; - -BRp.applyPrefixedLabelDimensions = function (ele, prefix) { - var _p = ele._private; - - var text = this.getLabelText(ele, prefix); - var labelDims = this.calculateLabelDimensions(ele, text); - - util.setPrefixedProperty(_p.rstyle, 'labelWidth', prefix, labelDims.width); - util.setPrefixedProperty(_p.rscratch, 'labelWidth', prefix, labelDims.width); - - util.setPrefixedProperty(_p.rstyle, 'labelHeight', prefix, labelDims.height); - util.setPrefixedProperty(_p.rscratch, 'labelHeight', prefix, labelDims.height); -}; - -BRp.getLabelText = function (ele, prefix) { - var _p = ele._private; - var pfd = prefix ? prefix + '-' : ''; - var text = ele.pstyle(pfd + 'label').strValue; - var textTransform = ele.pstyle('text-transform').value; - var rscratch = function rscratch(propName, value) { - if (value) { - util.setPrefixedProperty(_p.rscratch, propName, prefix, value); - return value; - } else { - return util.getPrefixedProperty(_p.rscratch, propName, prefix); - } - }; - - // for empty text, skip all processing - if (!text) { - return ''; - } - - if (textTransform == 'none') { - // passthrough - } else if (textTransform == 'uppercase') { - text = text.toUpperCase(); - } else if (textTransform == 'lowercase') { - text = text.toLowerCase(); - } - - var wrapStyle = ele.pstyle('text-wrap').value; - - if (wrapStyle === 'wrap') { - //console.log('wrap'); - - var labelKey = rscratch('labelKey'); - - // save recalc if the label is the same as before - if (labelKey && rscratch('labelWrapKey') === labelKey) { - // console.log('wrap cache hit'); - return rscratch('labelWrapCachedText'); - } - // console.log('wrap cache miss'); - - var lines = text.split('\n'); - var maxW = ele.pstyle('text-max-width').pfValue; - var wrappedLines = []; - - for (var l = 0; l < lines.length; l++) { - var line = lines[l]; - var lineDims = this.calculateLabelDimensions(ele, line, 'line=' + line); - var lineW = lineDims.width; - - if (lineW > maxW) { - // line is too long - var words = line.split(/\s+/); // NB: assume collapsed whitespace into single space - var subline = ''; - - for (var w = 0; w < words.length; w++) { - var word = words[w]; - var testLine = subline.length === 0 ? word : subline + ' ' + word; - var testDims = this.calculateLabelDimensions(ele, testLine, 'testLine=' + testLine); - var testW = testDims.width; - - if (testW <= maxW) { - // word fits on current line - subline += word + ' '; - } else { - // word starts new line - wrappedLines.push(subline); - subline = word + ' '; - } - } - - // if there's remaining text, put it in a wrapped line - if (!subline.match(/^\s+$/)) { - wrappedLines.push(subline); - } - } else { - // line is already short enough - wrappedLines.push(line); - } - } // for - - rscratch('labelWrapCachedLines', wrappedLines); - text = rscratch('labelWrapCachedText', wrappedLines.join('\n')); - rscratch('labelWrapKey', labelKey); - - // console.log(text) - } else if (wrapStyle === 'ellipsis') { - var maxW = ele.pstyle('text-max-width').pfValue; - var ellipsized = ''; - var ellipsis = '\u2026'; - var incLastCh = false; - - for (var i = 0; i < text.length; i++) { - var widthWithNextCh = this.calculateLabelDimensions(ele, ellipsized + text[i] + ellipsis).width; - - if (widthWithNextCh > maxW) { - break; - } - - ellipsized += text[i]; - - if (i === text.length - 1) { - incLastCh = true; - } - } - - if (!incLastCh) { - ellipsized += ellipsis; - } - - return ellipsized; - } // if ellipsize - - return text; -}; - -BRp.calculateLabelDimensions = function (ele, text, extraKey) { - var r = this; - - var cacheKey = ele._private.labelStyleKey + '$@$' + text; - - if (extraKey) { - cacheKey += '$@$' + extraKey; - } - - var cache = r.labelDimCache || (r.labelDimCache = {}); - - if (cache[cacheKey]) { - return cache[cacheKey]; - } - - var sizeMult = 1; // increase the scale to increase accuracy w.r.t. zoomed text - var fStyle = ele.pstyle('font-style').strValue; - var size = sizeMult * ele.pstyle('font-size').pfValue + 'px'; - var family = ele.pstyle('font-family').strValue; - var weight = ele.pstyle('font-weight').strValue; - - var div = this.labelCalcDiv; - - if (!div) { - div = this.labelCalcDiv = document.createElement('div'); // eslint-disable-line no-undef - document.body.appendChild(div); // eslint-disable-line no-undef - } - - var ds = div.style; - - // from ele style - ds.fontFamily = family; - ds.fontStyle = fStyle; - ds.fontSize = size; - ds.fontWeight = weight; - - // forced style - ds.position = 'absolute'; - ds.left = '-9999px'; - ds.top = '-9999px'; - ds.zIndex = '-1'; - ds.visibility = 'hidden'; - ds.pointerEvents = 'none'; - ds.padding = '0'; - ds.lineHeight = '1'; - - if (ele.pstyle('text-wrap').value === 'wrap') { - ds.whiteSpace = 'pre'; // so newlines are taken into account - } else { - ds.whiteSpace = 'normal'; - } - - // put label content in div - div.textContent = text; - - cache[cacheKey] = { - width: Math.ceil(div.clientWidth / sizeMult), - height: Math.ceil(div.clientHeight / sizeMult) - }; - - return cache[cacheKey]; -}; - -BRp.calculateLabelAngles = function (ele) { - var _p = ele._private; - var rs = _p.rscratch; - var isEdge = ele.isEdge(); - var rot = ele.pstyle('text-rotation'); - var rotStr = rot.strValue; - - if (rotStr === 'none') { - rs.labelAngle = rs.sourceLabelAngle = rs.targetLabelAngle = 0; - } else if (isEdge && rotStr === 'autorotate') { - rs.labelAngle = rs.labelAutoAngle; - rs.sourceLabelAngle = rs.sourceLabelAutoAngle; - rs.targetLabelAngle = rs.targetLabelAutoAngle; - } else if (rotStr === 'autorotate') { - rs.labelAngle = rs.sourceLabelAngle = rs.targetLabelAngle = 0; - } else { - rs.labelAngle = rs.sourceLabelAngle = rs.targetLabelAngle = rot.pfValue; - } -}; - -module.exports = BRp; - -/***/ }), -/* 117 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var BRp = {}; - -BRp.getNodeShape = function (node) { - var r = this; - var shape = node.pstyle('shape').value; - - if (node.isParent()) { - if (shape === 'rectangle' || shape === 'roundrectangle' || shape === 'cutrectangle' || shape === 'barrel') { - return shape; - } else { - return 'rectangle'; - } - } - - if (shape === 'polygon') { - var points = node.pstyle('shape-polygon-points').value; - - return r.nodeShapes.makePolygon(points).name; - } - - return shape; -}; - -module.exports = BRp; - -/***/ }), -/* 118 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var BRp = {}; - -BRp.registerCalculationListeners = function () { - var cy = this.cy; - var elesToUpdate = cy.collection(); - var r = this; - - var enqueue = function enqueue(eles, e) { - var dirtyStyleCaches = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; - - elesToUpdate.merge(eles); - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - var _p = ele._private; - var rstyle = _p.rstyle; - - if (dirtyStyleCaches) { - rstyle.clean = false; - _p.bbCache = null; - } - - var evts = rstyle.dirtyEvents = rstyle.dirtyEvents || { length: 0 }; - - if (!evts[e.type]) { - evts[e.type] = true; - evts.length++; - } - } - }; - - r.binder(cy) - // nodes - - .on('position.* style.* free.* bounds.*', 'node', function onDirtyModNode(e) { - var node = e.target; - - enqueue(node, e); - enqueue(node.connectedEdges(), e); - }).on('add.*', 'node', function onDirtyAddNode(e) { - var ele = e.target; - - enqueue(ele, e); - }).on('background.*', 'node', function onDirtyBgNode(e) { - var ele = e.target; - - enqueue(ele, e, false); - }) - - // edges - - .on('add.* style.*', 'edge', function onDirtyEdge(e) { - var edge = e.target; - - enqueue(edge, e); - enqueue(edge.parallelEdges(), e); - }).on('remove.*', 'edge', function onDirtyRemoveEdge(e) { - var edge = e.target; - var pEdges = edge.parallelEdges(); - - for (var i = 0; i < pEdges.length; i++) { - var pEdge = pEdges[i]; - - if (!pEdge.removed()) { - enqueue(pEdge, e); - } - } - }) - - // manual dirtying - - .on('dirty.*', 'node', function onDirtyEle(e) { - var ele = e.target; - - enqueue(ele, e); - }); - - var updateEleCalcs = function updateEleCalcs(willDraw) { - if (willDraw) { - var fns = r.onUpdateEleCalcsFns; - - if (fns) { - for (var i = 0; i < fns.length; i++) { - var fn = fns[i]; - - fn(willDraw, elesToUpdate); - } - } - - r.recalculateRenderedStyle(elesToUpdate, false); - - for (var i = 0; i < elesToUpdate.length; i++) { - elesToUpdate[i]._private.rstyle.dirtyEvents = null; - } - - elesToUpdate = cy.collection(); - } - }; - - r.beforeRender(updateEleCalcs, r.beforeRenderPriorities.eleCalcs); -}; - -BRp.onUpdateEleCalcs = function (fn) { - var fns = this.onUpdateEleCalcsFns = this.onUpdateEleCalcsFns || []; - - fns.push(fn); -}; - -BRp.recalculateRenderedStyle = function (eles, useCache) { - var edges = []; - var nodes = []; - - // the renderer can't be used for calcs when destroyed, e.g. ele.boundingBox() - if (this.destroyed) { - return; - } - - // use cache by default for perf - if (useCache === undefined) { - useCache = true; - } - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - var _p = ele._private; - var rstyle = _p.rstyle; - - // only update if dirty and in graph - if (useCache && rstyle.clean || ele.removed()) { - continue; - } - - // only update if not display: none - if (ele.pstyle('display').value === 'none') { - continue; - } - - if (_p.group === 'nodes') { - nodes.push(ele); - } else { - // edges - edges.push(ele); - } - - rstyle.clean = true; - // rstyle.dirtyEvents = null; - } - - // update node data from projections - for (var i = 0; i < nodes.length; i++) { - var ele = nodes[i]; - var _p = ele._private; - var rstyle = _p.rstyle; - var pos = ele.position(); - - this.recalculateNodeLabelProjection(ele); - - rstyle.nodeX = pos.x; - rstyle.nodeY = pos.y; - rstyle.nodeW = ele.pstyle('width').pfValue; - rstyle.nodeH = ele.pstyle('height').pfValue; - } - - this.recalculateEdgeProjections(edges); - - // update edge data from projections - for (var i = 0; i < edges.length; i++) { - var ele = edges[i]; - var _p = ele._private; - var rstyle = _p.rstyle; - var rs = _p.rscratch; - - this.recalculateEdgeLabelProjections(ele); - - // update rstyle positions - rstyle.srcX = rs.arrowStartX; - rstyle.srcY = rs.arrowStartY; - rstyle.tgtX = rs.arrowEndX; - rstyle.tgtY = rs.arrowEndY; - rstyle.midX = rs.midX; - rstyle.midY = rs.midY; - rstyle.labelAngle = rs.labelAngle; - rstyle.sourceLabelAngle = rs.sourceLabelAngle; - rstyle.targetLabelAngle = rs.targetLabelAngle; - } -}; - -module.exports = BRp; - -/***/ }), -/* 119 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var zIndexSort = __webpack_require__(17); - -var BRp = {}; - -BRp.updateCachedGrabbedEles = function () { - var eles = this.cachedZSortedEles; - - if (!eles) { - // just let this be recalculated on the next z sort tick - return; - } - - eles.drag = []; - eles.nondrag = []; - - var grabTargets = []; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - var rs = ele._private.rscratch; - - if (ele.grabbed() && !ele.isParent()) { - grabTargets.push(ele); - } else if (rs.inDragLayer) { - eles.drag.push(ele); - } else { - eles.nondrag.push(ele); - } - } - - // put the grab target nodes last so it's on top of its neighbourhood - for (var i = 0; i < grabTargets.length; i++) { - var ele = grabTargets[i]; - - eles.drag.push(ele); - } -}; - -BRp.invalidateCachedZSortedEles = function () { - this.cachedZSortedEles = null; -}; - -BRp.getCachedZSortedEles = function (forceRecalc) { - if (forceRecalc || !this.cachedZSortedEles) { - //console.time('cachezorder') - - var eles = this.cy.mutableElements().toArray(); - - eles.sort(zIndexSort); - - eles.interactive = eles.filter(function (ele) { - return ele.interactive(); - }); - - this.cachedZSortedEles = eles; - - this.updateCachedGrabbedEles(); - } else { - eles = this.cachedZSortedEles; - } - - return eles; -}; - -module.exports = BRp; - -/***/ }), -/* 120 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var BRp = {}; - -BRp.getCachedImage = function (url, crossOrigin, onLoad) { - var r = this; - var imageCache = r.imageCache = r.imageCache || {}; - var cache = imageCache[url]; - - if (cache) { - if (!cache.image.complete) { - cache.image.addEventListener('load', onLoad); - } - - return cache.image; - } else { - cache = imageCache[url] = imageCache[url] || {}; - - var image = cache.image = new Image(); // eslint-disable-line no-undef - - image.addEventListener('load', onLoad); - image.addEventListener('error', function () { - image.error = true; - }); - - // #1582 safari doesn't load data uris with crossOrigin properly - // https://bugs.webkit.org/show_bug.cgi?id=123978 - var dataUriPrefix = 'data:'; - var isDataUri = url.substring(0, dataUriPrefix.length).toLowerCase() === dataUriPrefix; - if (!isDataUri) { - image.crossOrigin = crossOrigin; // prevent tainted canvas - } - - image.src = url; - - return image; - } -}; - -module.exports = BRp; - -/***/ }), -/* 121 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var util = __webpack_require__(1); -var math = __webpack_require__(2); -var Event = __webpack_require__(16); - -var BRp = {}; - -BRp.registerBinding = function (target, event, handler, useCapture) { - var args = Array.prototype.slice.apply(arguments, [1]); // copy - var b = this.binder(target); - - return b.on.apply(b, args); -}; - -BRp.binder = function (tgt) { - var r = this; - - var tgtIsDom = tgt === window || tgt === document || tgt === document.body || is.domElement(tgt); - - if (r.supportsPassiveEvents == null) { - - // from https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection - var supportsPassive = false; - try { - var opts = Object.defineProperty({}, 'passive', { - get: function get() { - supportsPassive = true; - } - }); - - window.addEventListener('test', null, opts); - } catch (err) {} - - r.supportsPassiveEvents = supportsPassive; - } - - var on = function on(event, handler, useCapture) { - var args = Array.prototype.slice.call(arguments); - - if (tgtIsDom && r.supportsPassiveEvents) { - // replace useCapture w/ opts obj - args[2] = { - capture: useCapture != null ? useCapture : false, - passive: false, - once: false - }; - } - - r.bindings.push({ - target: tgt, - args: args - }); - - (tgt.addEventListener || tgt.on).apply(tgt, args); - - return this; - }; - - return { - on: on, - addEventListener: on, - addListener: on, - bind: on - }; -}; - -BRp.nodeIsDraggable = function (node) { - return node && node.isNode() && !node.locked() && node.grabbable(); -}; - -BRp.nodeIsGrabbable = function (node) { - return this.nodeIsDraggable(node) && node.interactive(); -}; - -BRp.load = function () { - var r = this; - - var triggerEvents = function triggerEvents(target, names, e, props) { - if (target == null) { - target = r.cy; - } - - for (var i = 0; i < names.length; i++) { - var name = names[i]; - - target.emit(util.extend({ originalEvent: e, type: name }, props)); - } - }; - - var isMultSelKeyDown = function isMultSelKeyDown(e) { - return e.shiftKey || e.metaKey || e.ctrlKey; // maybe e.altKey - }; - - var allowPanningPassthrough = function allowPanningPassthrough(down, downs) { - var allowPassthrough = true; - - if (r.cy.hasCompoundNodes() && down && down.isEdge()) { - // a compound node below the edge => no passthrough panning - for (var i = 0; downs && i < downs.length; i++) { - var down = downs[i]; - - if (down.isNode() && down.isParent()) { - allowPassthrough = false; - break; - } - } - } else { - allowPassthrough = true; - } - - return allowPassthrough; - }; - - var getDragListIds = function getDragListIds(opts) { - var listHasId; - - if (opts.addToList && r.cy.hasCompoundNodes()) { - // only needed for compound graphs - if (!opts.addToList.hasId) { - // build ids lookup if doesn't already exist - opts.addToList.hasId = {}; - - for (var i = 0; i < opts.addToList.length; i++) { - var ele = opts.addToList[i]; - - opts.addToList.hasId[ele.id()] = true; - } - } - - listHasId = opts.addToList.hasId; - } - - return listHasId || {}; - }; - - var setGrabbed = function setGrabbed(ele) { - ele[0]._private.grabbed = true; - }; - - var setFreed = function setFreed(ele) { - ele[0]._private.grabbed = false; - }; - - var setInDragLayer = function setInDragLayer(ele) { - ele[0]._private.rscratch.inDragLayer = true; - }; - - var setOutDragLayer = function setOutDragLayer(ele) { - ele[0]._private.rscratch.inDragLayer = false; - }; - - var setGrabTarget = function setGrabTarget(ele) { - ele[0]._private.rscratch.isGrabTarget = true; - }; - - var removeGrabTarget = function removeGrabTarget(ele) { - ele[0]._private.rscratch.isGrabTarget = false; - }; - - var addToDragList = function addToDragList(ele, opts) { - var listHasId = getDragListIds(opts); - - if (!listHasId[ele.id()]) { - opts.addToList.push(ele); - listHasId[ele.id()] = true; - - setGrabbed(ele); - } - }; - - // helper function to determine which child nodes and inner edges - // of a compound node to be dragged as well as the grabbed and selected nodes - var addDescendantsToDrag = function addDescendantsToDrag(node, opts) { - if (!node.cy().hasCompoundNodes()) { - return; - } - - if (opts.inDragLayer == null && opts.addToList == null) { - return; - } // nothing to do - - var innerNodes = node.descendants(); - - if (opts.inDragLayer) { - innerNodes.forEach(setInDragLayer); - innerNodes.connectedEdges().forEach(setInDragLayer); - } - - if (opts.addToList) { - innerNodes.forEach(function (ele) { - addToDragList(ele, opts); - }); - } - }; - - // adds the given nodes and its neighbourhood to the drag layer - var addNodesToDrag = function addNodesToDrag(nodes, opts) { - opts = opts || {}; - - var hasCompoundNodes = nodes.cy().hasCompoundNodes(); - - if (opts.inDragLayer) { - nodes.forEach(setInDragLayer); - - nodes.neighborhood().stdFilter(function (ele) { - return !hasCompoundNodes || ele.isEdge(); - }).forEach(setInDragLayer); - } - - if (opts.addToList) { - nodes.forEach(function (ele) { - addToDragList(ele, opts); - }); - } - - addDescendantsToDrag(nodes, opts); // always add to drag - - // also add nodes and edges related to the topmost ancestor - updateAncestorsInDragLayer(nodes, { - inDragLayer: opts.inDragLayer - }); - - r.updateCachedGrabbedEles(); - }; - - var addNodeToDrag = addNodesToDrag; - - var freeDraggedElements = function freeDraggedElements(grabbedEles) { - if (!grabbedEles) { - return; - } - - grabbedEles.hasId = {}; // clear the id list - - // just go over all elements rather than doing a bunch of (possibly expensive) traversals - r.getCachedZSortedEles().forEach(function (ele) { - setFreed(ele); - setOutDragLayer(ele); - removeGrabTarget(ele); - }); - - r.updateCachedGrabbedEles(); - }; - - // helper function to determine which ancestor nodes and edges should go - // to the drag layer (or should be removed from drag layer). - var updateAncestorsInDragLayer = function updateAncestorsInDragLayer(node, opts) { - - if (opts.inDragLayer == null && opts.addToList == null) { - return; - } // nothing to do - - if (!node.cy().hasCompoundNodes()) { - return; - } - - // find top-level parent - var parent = node.ancestors().orphans(); - - // no parent node: no nodes to add to the drag layer - if (parent.same(node)) { - return; - } - - var nodes = parent.descendants().spawnSelf().merge(parent).unmerge(node).unmerge(node.descendants()); - - var edges = nodes.connectedEdges(); - - if (opts.inDragLayer) { - edges.forEach(setInDragLayer); - nodes.forEach(setInDragLayer); - } - - if (opts.addToList) { - nodes.forEach(function (ele) { - addToDragList(ele, opts); - }); - } - }; - - var blurActiveDomElement = function blurActiveDomElement() { - if (document.activeElement != null && document.activeElement.blur != null) { - document.activeElement.blur(); - } - }; - - var haveMutationsApi = typeof MutationObserver !== 'undefined'; - - // watch for when the cy container is removed from the dom - if (haveMutationsApi) { - r.removeObserver = new MutationObserver(function (mutns) { - // eslint-disable-line no-undef - for (var i = 0; i < mutns.length; i++) { - var mutn = mutns[i]; - var rNodes = mutn.removedNodes; - - if (rNodes) { - for (var j = 0; j < rNodes.length; j++) { - var rNode = rNodes[j]; - - if (rNode === r.container) { - r.destroy(); - break; - } - } - } - } - }); - - if (r.container.parentNode) { - r.removeObserver.observe(r.container.parentNode, { childList: true }); - } - } else { - r.registerBinding(r.container, 'DOMNodeRemoved', function (e) { - r.destroy(); - }); - } - - var onResize = util.debounce(function () { - r.cy.resize(); - }, 100); - - if (haveMutationsApi) { - r.styleObserver = new MutationObserver(onResize); // eslint-disable-line no-undef - - r.styleObserver.observe(r.container, { attributes: true }); - } - - // auto resize - r.registerBinding(window, 'resize', onResize); // eslint-disable-line no-undef - - var forEachUp = function forEachUp(domEle, fn) { - while (domEle != null) { - fn(domEle); - - domEle = domEle.parentNode; - } - }; - - var invalidateCoords = function invalidateCoords() { - r.invalidateContainerClientCoordsCache(); - }; - - forEachUp(r.container, function (domEle) { - r.registerBinding(domEle, 'transitionend', invalidateCoords); - r.registerBinding(domEle, 'animationend', invalidateCoords); - r.registerBinding(domEle, 'scroll', invalidateCoords); - }); - - // stop right click menu from appearing on cy - r.registerBinding(r.container, 'contextmenu', function (e) { - e.preventDefault(); - }); - - var inBoxSelection = function inBoxSelection() { - return r.selection[4] !== 0; - }; - - var eventInContainer = function eventInContainer(e) { - // save cycles if mouse events aren't to be captured - var containerPageCoords = r.findContainerClientCoords(); - var x = containerPageCoords[0]; - var y = containerPageCoords[1]; - var width = containerPageCoords[2]; - var height = containerPageCoords[3]; - - var positions = e.touches ? e.touches : [e]; - var atLeastOnePosInside = false; - - for (var i = 0; i < positions.length; i++) { - var p = positions[i]; - - if (x <= p.clientX && p.clientX <= x + width && y <= p.clientY && p.clientY <= y + height) { - atLeastOnePosInside = true; - break; - } - } - - if (!atLeastOnePosInside) { - return false; - } - - var container = r.container; - var target = e.target; - var tParent = target.parentNode; - var containerIsTarget = false; - - while (tParent) { - if (tParent === container) { - containerIsTarget = true; - break; - } - - tParent = tParent.parentNode; - } - - if (!containerIsTarget) { - return false; - } // if target is outisde cy container, then this event is not for us - - return true; - }; - - // Primary key - r.registerBinding(r.container, 'mousedown', function mousedownHandler(e) { - if (!eventInContainer(e)) { - return; - } - - e.preventDefault(); - - blurActiveDomElement(); - - r.hoverData.capture = true; - r.hoverData.which = e.which; - - var cy = r.cy; - var gpos = [e.clientX, e.clientY]; - var pos = r.projectIntoViewport(gpos[0], gpos[1]); - var select = r.selection; - var nears = r.findNearestElements(pos[0], pos[1], true, false); - var near = nears[0]; - var draggedElements = r.dragData.possibleDragElements; - - r.hoverData.mdownPos = pos; - r.hoverData.mdownGPos = gpos; - - var checkForTaphold = function checkForTaphold() { - r.hoverData.tapholdCancelled = false; - - clearTimeout(r.hoverData.tapholdTimeout); - - r.hoverData.tapholdTimeout = setTimeout(function () { - - if (r.hoverData.tapholdCancelled) { - return; - } else { - var ele = r.hoverData.down; - - if (ele) { - ele.emit({ - originalEvent: e, - type: 'taphold', - position: { x: pos[0], y: pos[1] } - }); - } else { - cy.emit({ - originalEvent: e, - type: 'taphold', - position: { x: pos[0], y: pos[1] } - }); - } - } - }, r.tapholdDuration); - }; - - // Right click button - if (e.which == 3) { - - r.hoverData.cxtStarted = true; - - var cxtEvt = { - originalEvent: e, - type: 'cxttapstart', - position: { x: pos[0], y: pos[1] } - }; - - if (near) { - near.activate(); - near.emit(cxtEvt); - - r.hoverData.down = near; - } else { - cy.emit(cxtEvt); - } - - r.hoverData.downTime = new Date().getTime(); - r.hoverData.cxtDragged = false; - - // Primary button - } else if (e.which == 1) { - - if (near) { - near.activate(); - } - - // Element dragging - { - // If something is under the cursor and it is draggable, prepare to grab it - if (near != null) { - - if (r.nodeIsGrabbable(near)) { - - var makeEvent = function makeEvent(type) { - return { - originalEvent: e, - type: type, - position: { x: pos[0], y: pos[1] } - }; - }; - - var triggerGrab = function triggerGrab(ele) { - ele.emit(makeEvent('grab')); - }; - - setGrabTarget(near); - - if (!near.selected()) { - - draggedElements = r.dragData.possibleDragElements = []; - addNodeToDrag(near, { addToList: draggedElements }); - - near.emit(makeEvent('grabon')).emit(makeEvent('grab')); - } else { - draggedElements = r.dragData.possibleDragElements = []; - - var selectedNodes = cy.$(function (ele) { - return ele.isNode() && ele.selected() && r.nodeIsGrabbable(ele); - }); - - addNodesToDrag(selectedNodes, { addToList: draggedElements }); - - near.emit(makeEvent('grabon')); - - selectedNodes.forEach(triggerGrab); - } - - r.redrawHint('eles', true); - r.redrawHint('drag', true); - } - } - - r.hoverData.down = near; - r.hoverData.downs = nears; - r.hoverData.downTime = new Date().getTime(); - } - - triggerEvents(near, ['mousedown', 'tapstart', 'vmousedown'], e, { - position: { x: pos[0], y: pos[1] } - }); - - if (near == null) { - select[4] = 1; - - r.data.bgActivePosistion = { - x: pos[0], - y: pos[1] - }; - - r.redrawHint('select', true); - - r.redraw(); - } else if (near.isEdge()) { - select[4] = 1; // for future pan - } - - checkForTaphold(); - } - - // Initialize selection box coordinates - select[0] = select[2] = pos[0]; - select[1] = select[3] = pos[1]; - }, false); - - r.registerBinding(window, 'mousemove', function mousemoveHandler(e) { - // eslint-disable-line no-undef - var capture = r.hoverData.capture; - - if (!capture && !eventInContainer(e)) { - return; - } - - var preventDefault = false; - var cy = r.cy; - var zoom = cy.zoom(); - var gpos = [e.clientX, e.clientY]; - var pos = r.projectIntoViewport(gpos[0], gpos[1]); - var mdownPos = r.hoverData.mdownPos; - var mdownGPos = r.hoverData.mdownGPos; - var select = r.selection; - - var near = null; - if (!r.hoverData.draggingEles && !r.hoverData.dragging && !r.hoverData.selecting) { - near = r.findNearestElement(pos[0], pos[1], true, false); - } - var last = r.hoverData.last; - var down = r.hoverData.down; - - var disp = [pos[0] - select[2], pos[1] - select[3]]; - - var draggedElements = r.dragData.possibleDragElements; - - var isOverThresholdDrag; - - if (mdownGPos) { - var dx = gpos[0] - mdownGPos[0]; - var dx2 = dx * dx; - var dy = gpos[1] - mdownGPos[1]; - var dy2 = dy * dy; - var dist2 = dx2 + dy2; - - r.hoverData.isOverThresholdDrag = isOverThresholdDrag = dist2 >= r.desktopTapThreshold2; - } - - var multSelKeyDown = isMultSelKeyDown(e); - - if (isOverThresholdDrag) { - r.hoverData.tapholdCancelled = true; - } - - var updateDragDelta = function updateDragDelta() { - var dragDelta = r.hoverData.dragDelta = r.hoverData.dragDelta || []; - - if (dragDelta.length === 0) { - dragDelta.push(disp[0]); - dragDelta.push(disp[1]); - } else { - dragDelta[0] += disp[0]; - dragDelta[1] += disp[1]; - } - }; - - preventDefault = true; - - triggerEvents(near, ['mousemove', 'vmousemove', 'tapdrag'], e, { - position: { x: pos[0], y: pos[1] } - }); - - var goIntoBoxMode = function goIntoBoxMode() { - r.data.bgActivePosistion = undefined; - - if (!r.hoverData.selecting) { - cy.emit('boxstart'); - } - - select[4] = 1; - r.hoverData.selecting = true; - - r.redrawHint('select', true); - r.redraw(); - }; - - // trigger context drag if rmouse down - if (r.hoverData.which === 3) { - // but only if over threshold - if (isOverThresholdDrag) { - var cxtEvt = { - originalEvent: e, - type: 'cxtdrag', - position: { x: pos[0], y: pos[1] } - }; - - if (down) { - down.emit(cxtEvt); - } else { - cy.emit(cxtEvt); - } - - r.hoverData.cxtDragged = true; - - if (!r.hoverData.cxtOver || near !== r.hoverData.cxtOver) { - - if (r.hoverData.cxtOver) { - r.hoverData.cxtOver.emit({ - originalEvent: e, - type: 'cxtdragout', - position: { x: pos[0], y: pos[1] } - }); - } - - r.hoverData.cxtOver = near; - - if (near) { - near.emit({ - originalEvent: e, - type: 'cxtdragover', - position: { x: pos[0], y: pos[1] } - }); - } - } - } - - // Check if we are drag panning the entire graph - } else if (r.hoverData.dragging) { - preventDefault = true; - - if (cy.panningEnabled() && cy.userPanningEnabled()) { - var deltaP; - - if (r.hoverData.justStartedPan) { - var mdPos = r.hoverData.mdownPos; - - deltaP = { - x: (pos[0] - mdPos[0]) * zoom, - y: (pos[1] - mdPos[1]) * zoom - }; - - r.hoverData.justStartedPan = false; - } else { - deltaP = { - x: disp[0] * zoom, - y: disp[1] * zoom - }; - } - - cy.panBy(deltaP); - - r.hoverData.dragged = true; - } - - // Needs reproject due to pan changing viewport - pos = r.projectIntoViewport(e.clientX, e.clientY); - - // Checks primary button down & out of time & mouse not moved much - } else if (select[4] == 1 && (down == null || down.isEdge())) { - - if (isOverThresholdDrag) { - - if (!r.hoverData.dragging && cy.boxSelectionEnabled() && (multSelKeyDown || !cy.panningEnabled() || !cy.userPanningEnabled())) { - goIntoBoxMode(); - } else if (!r.hoverData.selecting && cy.panningEnabled() && cy.userPanningEnabled()) { - var allowPassthrough = allowPanningPassthrough(down, r.hoverData.downs); - - if (allowPassthrough) { - r.hoverData.dragging = true; - r.hoverData.justStartedPan = true; - select[4] = 0; - - r.data.bgActivePosistion = math.array2point(mdownPos); - - r.redrawHint('select', true); - r.redraw(); - } - } - - if (down && down.isEdge() && down.active()) { - down.unactivate(); - } - } - } else { - if (down && down.isEdge() && down.active()) { - down.unactivate(); - } - - if ((!down || !down.grabbed()) && near != last) { - - if (last) { - triggerEvents(last, ['mouseout', 'tapdragout'], e, { - position: { x: pos[0], y: pos[1] } - }); - } - - if (near) { - triggerEvents(near, ['mouseover', 'tapdragover'], e, { - position: { x: pos[0], y: pos[1] } - }); - } - - r.hoverData.last = near; - } - - if (down) { - - if (isOverThresholdDrag) { - // then we can take action - - if (cy.boxSelectionEnabled() && multSelKeyDown) { - // then selection overrides - if (down && down.grabbed()) { - freeDraggedElements(draggedElements); - - down.emit('free'); - } - - goIntoBoxMode(); - } else if (down && down.grabbed() && r.nodeIsDraggable(down)) { - // drag node - var justStartedDrag = !r.dragData.didDrag; - - if (justStartedDrag) { - r.redrawHint('eles', true); - } - - r.dragData.didDrag = true; // indicate that we actually did drag the node - - var toTrigger = []; - - // now, add the elements to the drag layer if not done already - if (!r.hoverData.draggingEles) { - addNodesToDrag(cy.collection(draggedElements), { inDragLayer: true }); - } - - for (var i = 0; i < draggedElements.length; i++) { - var dEle = draggedElements[i]; - - // Locked nodes not draggable, as well as non-visible nodes - if (r.nodeIsDraggable(dEle) && dEle.grabbed()) { - var dPos = dEle.position(); - - toTrigger.push(dEle); - - if (is.number(disp[0]) && is.number(disp[1])) { - dPos.x += disp[0]; - dPos.y += disp[1]; - - if (justStartedDrag) { - var dragDelta = r.hoverData.dragDelta; - - if (dragDelta && is.number(dragDelta[0]) && is.number(dragDelta[1])) { - dPos.x += dragDelta[0]; - dPos.y += dragDelta[1]; - } - } - } - } - } - - r.hoverData.draggingEles = true; - - var tcol = cy.collection(toTrigger); - - tcol.dirtyCompoundBoundsCache(); - tcol.emit('position drag'); - - r.redrawHint('drag', true); - r.redraw(); - } - } else { - // otherwise save drag delta for when we actually start dragging so the relative grab pos is constant - updateDragDelta(); - } - } - - // prevent the dragging from triggering text selection on the page - preventDefault = true; - } - - select[2] = pos[0];select[3] = pos[1]; - - if (preventDefault) { - if (e.stopPropagation) e.stopPropagation(); - if (e.preventDefault) e.preventDefault(); - return false; - } - }, false); - - r.registerBinding(window, 'mouseup', function mouseupHandler(e) { - // eslint-disable-line no-undef - var capture = r.hoverData.capture; - if (!capture) { - return; - } - r.hoverData.capture = false; - - var cy = r.cy;var pos = r.projectIntoViewport(e.clientX, e.clientY);var select = r.selection; - var near = r.findNearestElement(pos[0], pos[1], true, false); - var draggedElements = r.dragData.possibleDragElements;var down = r.hoverData.down; - var multSelKeyDown = isMultSelKeyDown(e); - - if (r.data.bgActivePosistion) { - r.redrawHint('select', true); - r.redraw(); - } - - r.hoverData.tapholdCancelled = true; - - r.data.bgActivePosistion = undefined; // not active bg now - - if (down) { - down.unactivate(); - } - - if (r.hoverData.which === 3) { - var cxtEvt = { - originalEvent: e, - type: 'cxttapend', - position: { x: pos[0], y: pos[1] } - }; - - if (down) { - down.emit(cxtEvt); - } else { - cy.emit(cxtEvt); - } - - if (!r.hoverData.cxtDragged) { - var cxtTap = { - originalEvent: e, - type: 'cxttap', - position: { x: pos[0], y: pos[1] } - }; - - if (down) { - down.emit(cxtTap); - } else { - cy.emit(cxtTap); - } - } - - r.hoverData.cxtDragged = false; - r.hoverData.which = null; - } else if (r.hoverData.which === 1) { - - // Deselect all elements if nothing is currently under the mouse cursor and we aren't dragging something - if (down == null && // not mousedown on node - !r.dragData.didDrag // didn't move the node around - && !r.hoverData.selecting // not box selection - && !r.hoverData.dragged // didn't pan - && !isMultSelKeyDown(e)) { - - cy.$(function (ele) { - return ele.selected(); - }).unselect(); - - if (draggedElements.length > 0) { - r.redrawHint('eles', true); - } - - r.dragData.possibleDragElements = draggedElements = []; - } - - triggerEvents(near, ['mouseup', 'tapend', 'vmouseup'], e, { - position: { x: pos[0], y: pos[1] } - }); - - if (!r.dragData.didDrag // didn't move a node around - && !r.hoverData.dragged // didn't pan - && !r.hoverData.selecting // not box selection - && !r.hoverData.isOverThresholdDrag // didn't move too much - ) { - triggerEvents(down, ['click', 'tap', 'vclick'], e, { - position: { x: pos[0], y: pos[1] } - }); - } - - // Single selection - if (near == down && !r.dragData.didDrag && !r.hoverData.selecting) { - if (near != null && near._private.selectable) { - - if (r.hoverData.dragging) { - // if panning, don't change selection state - } else if (cy.selectionType() === 'additive' || multSelKeyDown) { - if (near.selected()) { - near.unselect(); - } else { - near.select(); - } - } else { - if (!multSelKeyDown) { - cy.$(':selected').unmerge(near).unselect(); - near.select(); - } - } - - r.redrawHint('eles', true); - } - } - - if (r.hoverData.selecting) { - var box = cy.collection(r.getAllInBox(select[0], select[1], select[2], select[3])); - - r.redrawHint('select', true); - - if (box.length > 0) { - r.redrawHint('eles', true); - } - - cy.emit('boxend'); - - var eleWouldBeSelected = function eleWouldBeSelected(ele) { - return ele.selectable() && !ele.selected(); - }; - - if (cy.selectionType() === 'additive') { - box.emit('box').stdFilter(eleWouldBeSelected).select().emit('boxselect'); - } else { - if (!multSelKeyDown) { - cy.$(':selected').unmerge(box).unselect(); - } - - box.emit('box').stdFilter(eleWouldBeSelected).select().emit('boxselect'); - } - - // always need redraw in case eles unselectable - r.redraw(); - } - - // Cancel drag pan - if (r.hoverData.dragging) { - r.hoverData.dragging = false; - - r.redrawHint('select', true); - r.redrawHint('eles', true); - - r.redraw(); - } - - if (!select[4]) { - r.redrawHint('drag', true); - r.redrawHint('eles', true); - - var downWasGrabbed = down && down.grabbed(); - - freeDraggedElements(draggedElements); - - if (downWasGrabbed) { - down.emit('free'); - } - } - } // else not right mouse - - select[4] = 0;r.hoverData.down = null; - - r.hoverData.cxtStarted = false; - r.hoverData.draggingEles = false; - r.hoverData.selecting = false; - r.hoverData.isOverThresholdDrag = false; - r.dragData.didDrag = false; - r.hoverData.dragged = false; - r.hoverData.dragDelta = []; - r.hoverData.mdownPos = null; - r.hoverData.mdownGPos = null; - }, false); - - var wheelHandler = function wheelHandler(e) { - - if (r.scrollingPage) { - return; - } // while scrolling, ignore wheel-to-zoom - - var cy = r.cy; - var pos = r.projectIntoViewport(e.clientX, e.clientY); - var rpos = [pos[0] * cy.zoom() + cy.pan().x, pos[1] * cy.zoom() + cy.pan().y]; - - if (r.hoverData.draggingEles || r.hoverData.dragging || r.hoverData.cxtStarted || inBoxSelection()) { - // if pan dragging or cxt dragging, wheel movements make no zoom - e.preventDefault(); - return; - } - - if (cy.panningEnabled() && cy.userPanningEnabled() && cy.zoomingEnabled() && cy.userZoomingEnabled()) { - e.preventDefault(); - - r.data.wheelZooming = true; - clearTimeout(r.data.wheelTimeout); - r.data.wheelTimeout = setTimeout(function () { - r.data.wheelZooming = false; - - r.redrawHint('eles', true); - r.redraw(); - }, 150); - - var diff; - - if (e.deltaY != null) { - diff = e.deltaY / -250; - } else if (e.wheelDeltaY != null) { - diff = e.wheelDeltaY / 1000; - } else { - diff = e.wheelDelta / 1000; - } - - diff = diff * r.wheelSensitivity; - - var needsWheelFix = e.deltaMode === 1; - if (needsWheelFix) { - // fixes slow wheel events on ff/linux and ff/windows - diff *= 33; - } - - cy.zoom({ - level: cy.zoom() * Math.pow(10, diff), - renderedPosition: { x: rpos[0], y: rpos[1] } - }); - } - }; - - // Functions to help with whether mouse wheel should trigger zooming - // -- - r.registerBinding(r.container, 'wheel', wheelHandler, true); - - // disable nonstandard wheel events - // r.registerBinding(r.container, 'mousewheel', wheelHandler, true); - // r.registerBinding(r.container, 'DOMMouseScroll', wheelHandler, true); - // r.registerBinding(r.container, 'MozMousePixelScroll', wheelHandler, true); // older firefox - - r.registerBinding(window, 'scroll', function scrollHandler(e) { - // eslint-disable-line no-undef - r.scrollingPage = true; - - clearTimeout(r.scrollingPageTimeout); - r.scrollingPageTimeout = setTimeout(function () { - r.scrollingPage = false; - }, 250); - }, true); - - // Functions to help with handling mouseout/mouseover on the Cytoscape container - // Handle mouseout on Cytoscape container - r.registerBinding(r.container, 'mouseout', function mouseOutHandler(e) { - var pos = r.projectIntoViewport(e.clientX, e.clientY); - - r.cy.emit({ - originalEvent: e, - type: 'mouseout', - position: { x: pos[0], y: pos[1] } - }); - }, false); - - r.registerBinding(r.container, 'mouseover', function mouseOverHandler(e) { - var pos = r.projectIntoViewport(e.clientX, e.clientY); - - r.cy.emit({ - originalEvent: e, - type: 'mouseover', - position: { x: pos[0], y: pos[1] } - }); - }, false); - - var f1x1, f1y1, f2x1, f2y1; // starting points for pinch-to-zoom - var distance1, distance1Sq; // initial distance between finger 1 and finger 2 for pinch-to-zoom - var center1, modelCenter1; // center point on start pinch to zoom - var offsetLeft, offsetTop; - var containerWidth, containerHeight; - var twoFingersStartInside; - - var distance = function distance(x1, y1, x2, y2) { - return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); - }; - - var distanceSq = function distanceSq(x1, y1, x2, y2) { - return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1); - }; - - var touchstartHandler; - r.registerBinding(r.container, 'touchstart', touchstartHandler = function touchstartHandler(e) { - if (!eventInContainer(e)) { - return; - } - - blurActiveDomElement(); - - r.touchData.capture = true; - r.data.bgActivePosistion = undefined; - - var cy = r.cy; - var now = r.touchData.now; - var earlier = r.touchData.earlier; - - if (e.touches[0]) { - var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);now[0] = pos[0];now[1] = pos[1]; - } - if (e.touches[1]) { - var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);now[2] = pos[0];now[3] = pos[1]; - } - if (e.touches[2]) { - var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);now[4] = pos[0];now[5] = pos[1]; - } - - // record starting points for pinch-to-zoom - if (e.touches[1]) { - - freeDraggedElements(r.dragData.touchDragEles); - - var offsets = r.findContainerClientCoords(); - offsetLeft = offsets[0]; - offsetTop = offsets[1]; - containerWidth = offsets[2]; - containerHeight = offsets[3]; - - f1x1 = e.touches[0].clientX - offsetLeft; - f1y1 = e.touches[0].clientY - offsetTop; - - f2x1 = e.touches[1].clientX - offsetLeft; - f2y1 = e.touches[1].clientY - offsetTop; - - twoFingersStartInside = 0 <= f1x1 && f1x1 <= containerWidth && 0 <= f2x1 && f2x1 <= containerWidth && 0 <= f1y1 && f1y1 <= containerHeight && 0 <= f2y1 && f2y1 <= containerHeight; - - var pan = cy.pan(); - var zoom = cy.zoom(); - - distance1 = distance(f1x1, f1y1, f2x1, f2y1); - distance1Sq = distanceSq(f1x1, f1y1, f2x1, f2y1); - center1 = [(f1x1 + f2x1) / 2, (f1y1 + f2y1) / 2]; - modelCenter1 = [(center1[0] - pan.x) / zoom, (center1[1] - pan.y) / zoom]; - - // consider context tap - var cxtDistThreshold = 200; - var cxtDistThresholdSq = cxtDistThreshold * cxtDistThreshold; - if (distance1Sq < cxtDistThresholdSq && !e.touches[2]) { - - var near1 = r.findNearestElement(now[0], now[1], true, true); - var near2 = r.findNearestElement(now[2], now[3], true, true); - - if (near1 && near1.isNode()) { - near1.activate().emit({ - originalEvent: e, - type: 'cxttapstart', - position: { x: now[0], y: now[1] } - }); - r.touchData.start = near1; - } else if (near2 && near2.isNode()) { - near2.activate().emit({ - originalEvent: e, - type: 'cxttapstart', - position: { x: now[0], y: now[1] } - }); - r.touchData.start = near2; - } else { - cy.emit({ - originalEvent: e, - type: 'cxttapstart', - position: { x: now[0], y: now[1] } - }); - } - - if (r.touchData.start) { - r.touchData.start._private.grabbed = false; - } - r.touchData.cxt = true; - r.touchData.cxtDragged = false; - r.data.bgActivePosistion = undefined; - - r.redraw(); - return; - } - } - - if (e.touches[2]) { - // ignore - } else if (e.touches[1]) { - // ignore - } else if (e.touches[0]) { - var nears = r.findNearestElements(now[0], now[1], true, true); - var near = nears[0]; - - if (near != null) { - near.activate(); - - r.touchData.start = near; - r.touchData.starts = nears; - - if (r.nodeIsGrabbable(near)) { - - var draggedEles = r.dragData.touchDragEles = []; - var selectedNodes = null; - - r.redrawHint('eles', true); - r.redrawHint('drag', true); - - if (near.selected()) { - // reset drag elements, since near will be added again - - selectedNodes = cy.$(function (ele) { - return ele.selected() && r.nodeIsGrabbable(ele); - }); - - addNodesToDrag(selectedNodes, { addToList: draggedEles }); - } else { - addNodeToDrag(near, { addToList: draggedEles }); - } - - setGrabTarget(near); - - var makeEvent = function makeEvent(type) { - return { - originalEvent: e, - type: type, - position: { x: now[0], y: now[1] } - }; - }; - - near.emit(makeEvent('grabon')); - - if (selectedNodes) { - selectedNodes.forEach(function (n) { - n.emit(makeEvent('grab')); - }); - } else { - near.emit(makeEvent('grab')); - } - } - } - - triggerEvents(near, ['touchstart', 'tapstart', 'vmousedown'], e, { - position: { x: now[0], y: now[1] } - }); - - if (near == null) { - r.data.bgActivePosistion = { - x: pos[0], - y: pos[1] - }; - - r.redrawHint('select', true); - r.redraw(); - } - - // Tap, taphold - // ----- - - r.touchData.singleTouchMoved = false; - r.touchData.singleTouchStartTime = +new Date(); - - clearTimeout(r.touchData.tapholdTimeout); - r.touchData.tapholdTimeout = setTimeout(function () { - if (r.touchData.singleTouchMoved === false && !r.pinching // if pinching, then taphold unselect shouldn't take effect - && !r.touchData.selecting // box selection shouldn't allow taphold through - ) { - triggerEvents(r.touchData.start, ['taphold'], e, { - position: { x: now[0], y: now[1] } - }); - - if (!r.touchData.start) { - cy.$(':selected').unselect(); - } - } - }, r.tapholdDuration); - } - - if (e.touches.length >= 1) { - var sPos = r.touchData.startPosition = []; - - for (var i = 0; i < now.length; i++) { - sPos[i] = earlier[i] = now[i]; - } - - var touch0 = e.touches[0]; - - r.touchData.startGPosition = [touch0.clientX, touch0.clientY]; - } - }, false); - - var touchmoveHandler; - r.registerBinding(window, 'touchmove', touchmoveHandler = function touchmoveHandler(e) { - // eslint-disable-line no-undef - var capture = r.touchData.capture; - - if (!capture && !eventInContainer(e)) { - return; - } - - var select = r.selection; - var cy = r.cy; - var now = r.touchData.now; - var earlier = r.touchData.earlier; - var zoom = cy.zoom(); - - if (e.touches[0]) { - var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);now[0] = pos[0];now[1] = pos[1]; - } - if (e.touches[1]) { - var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);now[2] = pos[0];now[3] = pos[1]; - } - if (e.touches[2]) { - var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);now[4] = pos[0];now[5] = pos[1]; - } - - var startGPos = r.touchData.startGPosition; - var isOverThresholdDrag; - - if (capture && e.touches[0] && startGPos) { - var disp = [];for (var j = 0; j < now.length; j++) { - disp[j] = now[j] - earlier[j]; - } - var dx = e.touches[0].clientX - startGPos[0]; - var dx2 = dx * dx; - var dy = e.touches[0].clientY - startGPos[1]; - var dy2 = dy * dy; - var dist2 = dx2 + dy2; - - isOverThresholdDrag = dist2 >= r.touchTapThreshold2; - } - - // context swipe cancelling - if (capture && r.touchData.cxt) { - e.preventDefault(); - - var f1x2 = e.touches[0].clientX - offsetLeft, - f1y2 = e.touches[0].clientY - offsetTop; - var f2x2 = e.touches[1].clientX - offsetLeft, - f2y2 = e.touches[1].clientY - offsetTop; - // var distance2 = distance( f1x2, f1y2, f2x2, f2y2 ); - var distance2Sq = distanceSq(f1x2, f1y2, f2x2, f2y2); - var factorSq = distance2Sq / distance1Sq; - - var distThreshold = 150; - var distThresholdSq = distThreshold * distThreshold; - var factorThreshold = 1.5; - var factorThresholdSq = factorThreshold * factorThreshold; - - // cancel ctx gestures if the distance b/t the fingers increases - if (factorSq >= factorThresholdSq || distance2Sq >= distThresholdSq) { - r.touchData.cxt = false; - - r.data.bgActivePosistion = undefined; - - r.redrawHint('select', true); - - var cxtEvt = { - originalEvent: e, - type: 'cxttapend', - position: { x: now[0], y: now[1] } - }; - - if (r.touchData.start) { - r.touchData.start.unactivate().emit(cxtEvt); - - r.touchData.start = null; - } else { - cy.emit(cxtEvt); - } - } - } - - // context swipe - if (capture && r.touchData.cxt) { - var cxtEvt = { - originalEvent: e, - type: 'cxtdrag', - position: { x: now[0], y: now[1] } - }; - r.data.bgActivePosistion = undefined; - r.redrawHint('select', true); - - if (r.touchData.start) { - r.touchData.start.emit(cxtEvt); - } else { - cy.emit(cxtEvt); - } - - if (r.touchData.start) { - r.touchData.start._private.grabbed = false; - } - r.touchData.cxtDragged = true; - - var near = r.findNearestElement(now[0], now[1], true, true); - - if (!r.touchData.cxtOver || near !== r.touchData.cxtOver) { - - if (r.touchData.cxtOver) { - r.touchData.cxtOver.emit({ - originalEvent: e, - type: 'cxtdragout', - position: { x: now[0], y: now[1] } - }); - } - - r.touchData.cxtOver = near; - - if (near) { - near.emit({ - originalEvent: e, - type: 'cxtdragover', - position: { x: now[0], y: now[1] } - }); - } - } - - // box selection - } else if (capture && e.touches[2] && cy.boxSelectionEnabled()) { - e.preventDefault(); - - r.data.bgActivePosistion = undefined; - - this.lastThreeTouch = +new Date(); - - if (!r.touchData.selecting) { - cy.emit('boxstart'); - } - - r.touchData.selecting = true; - - r.redrawHint('select', true); - - if (!select || select.length === 0 || select[0] === undefined) { - select[0] = (now[0] + now[2] + now[4]) / 3; - select[1] = (now[1] + now[3] + now[5]) / 3; - select[2] = (now[0] + now[2] + now[4]) / 3 + 1; - select[3] = (now[1] + now[3] + now[5]) / 3 + 1; - } else { - select[2] = (now[0] + now[2] + now[4]) / 3; - select[3] = (now[1] + now[3] + now[5]) / 3; - } - - select[4] = 1; - r.touchData.selecting = true; - - r.redraw(); - - // pinch to zoom - } else if (capture && e.touches[1] && cy.zoomingEnabled() && cy.panningEnabled() && cy.userZoomingEnabled() && cy.userPanningEnabled()) { - // two fingers => pinch to zoom - e.preventDefault(); - - r.data.bgActivePosistion = undefined; - r.redrawHint('select', true); - - var draggedEles = r.dragData.touchDragEles; - if (draggedEles) { - r.redrawHint('drag', true); - - for (var i = 0; i < draggedEles.length; i++) { - var de_p = draggedEles[i]._private; - - de_p.grabbed = false; - de_p.rscratch.inDragLayer = false; - } - } - - // (x2, y2) for fingers 1 and 2 - var f1x2 = e.touches[0].clientX - offsetLeft, - f1y2 = e.touches[0].clientY - offsetTop; - var f2x2 = e.touches[1].clientX - offsetLeft, - f2y2 = e.touches[1].clientY - offsetTop; - - var distance2 = distance(f1x2, f1y2, f2x2, f2y2); - // var distance2Sq = distanceSq( f1x2, f1y2, f2x2, f2y2 ); - // var factor = Math.sqrt( distance2Sq ) / Math.sqrt( distance1Sq ); - var factor = distance2 / distance1; - - if (twoFingersStartInside) { - // delta finger1 - var df1x = f1x2 - f1x1; - var df1y = f1y2 - f1y1; - - // delta finger 2 - var df2x = f2x2 - f2x1; - var df2y = f2y2 - f2y1; - - // translation is the normalised vector of the two fingers movement - // i.e. so pinching cancels out and moving together pans - var tx = (df1x + df2x) / 2; - var ty = (df1y + df2y) / 2; - - // adjust factor by the speed multiplier - // var speed = 1.5; - // if( factor > 1 ){ - // factor = (factor - 1) * speed + 1; - // } else { - // factor = 1 - (1 - factor) * speed; - // } - - // now calculate the zoom - var zoom1 = cy.zoom(); - var zoom2 = zoom1 * factor; - var pan1 = cy.pan(); - - // the model center point converted to the current rendered pos - var ctrx = modelCenter1[0] * zoom1 + pan1.x; - var ctry = modelCenter1[1] * zoom1 + pan1.y; - - var pan2 = { - x: -zoom2 / zoom1 * (ctrx - pan1.x - tx) + ctrx, - y: -zoom2 / zoom1 * (ctry - pan1.y - ty) + ctry - }; - - // remove dragged eles - if (r.touchData.start && r.touchData.start.active()) { - var draggedEles = r.dragData.touchDragEles; - - freeDraggedElements(draggedEles); - - r.redrawHint('drag', true); - r.redrawHint('eles', true); - - r.touchData.start.unactivate().emit('free'); - } - - cy.viewport({ - zoom: zoom2, - pan: pan2, - cancelOnFailedZoom: true - }); - - distance1 = distance2; - f1x1 = f1x2; - f1y1 = f1y2; - f2x1 = f2x2; - f2y1 = f2y2; - - r.pinching = true; - } - - // Re-project - if (e.touches[0]) { - var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);now[0] = pos[0];now[1] = pos[1]; - } - if (e.touches[1]) { - var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);now[2] = pos[0];now[3] = pos[1]; - } - if (e.touches[2]) { - var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);now[4] = pos[0];now[5] = pos[1]; - } - } else if (e.touches[0]) { - var start = r.touchData.start; - var last = r.touchData.last; - var near; - - if (!r.hoverData.draggingEles && !r.swipePanning) { - near = r.findNearestElement(now[0], now[1], true, true); - } - - if (capture && start != null) { - e.preventDefault(); - } - - // dragging nodes - if (capture && start != null && r.nodeIsDraggable(start)) { - - if (isOverThresholdDrag) { - // then dragging can happen - var draggedEles = r.dragData.touchDragEles; - var justStartedDrag = !r.dragData.didDrag; - - if (justStartedDrag) { - addNodesToDrag(cy.collection(draggedEles), { inDragLayer: true }); - } - - for (var k = 0; k < draggedEles.length; k++) { - var draggedEle = draggedEles[k]; - - if (r.nodeIsDraggable(draggedEle) && draggedEle.grabbed()) { - r.dragData.didDrag = true; - var dPos = draggedEle.position(); - - if (is.number(disp[0]) && is.number(disp[1])) { - dPos.x += disp[0]; - dPos.y += disp[1]; - } - - if (justStartedDrag) { - r.redrawHint('eles', true); - - var dragDelta = r.touchData.dragDelta; - - if (dragDelta && is.number(dragDelta[0]) && is.number(dragDelta[1])) { - dPos.x += dragDelta[0]; - dPos.y += dragDelta[1]; - } - } - } - } - - var tcol = cy.collection(draggedEles); - - tcol.dirtyCompoundBoundsCache(); - tcol.emit('position drag'); - - r.hoverData.draggingEles = true; - - r.redrawHint('drag', true); - - if (r.touchData.startPosition[0] == earlier[0] && r.touchData.startPosition[1] == earlier[1]) { - - r.redrawHint('eles', true); - } - - r.redraw(); - } else { - // otherise keep track of drag delta for later - var dragDelta = r.touchData.dragDelta = r.touchData.dragDelta || []; - - if (dragDelta.length === 0) { - dragDelta.push(disp[0]); - dragDelta.push(disp[1]); - } else { - dragDelta[0] += disp[0]; - dragDelta[1] += disp[1]; - } - } - } - - // touchmove - { - triggerEvents(start || near, ['touchmove', 'tapdrag', 'vmousemove'], e, { - position: { x: now[0], y: now[1] } - }); - - if ((!start || !start.grabbed()) && near != last) { - if (last) { - last.emit({ originalEvent: e, type: 'tapdragout', position: { x: now[0], y: now[1] } }); - } - if (near) { - near.emit({ originalEvent: e, type: 'tapdragover', position: { x: now[0], y: now[1] } }); - } - } - - r.touchData.last = near; - } - - // check to cancel taphold - if (capture) { - for (var i = 0; i < now.length; i++) { - if (now[i] && r.touchData.startPosition[i] && isOverThresholdDrag) { - - r.touchData.singleTouchMoved = true; - } - } - } - - // panning - if (capture && (start == null || start.isEdge()) && cy.panningEnabled() && cy.userPanningEnabled()) { - - var allowPassthrough = allowPanningPassthrough(start, r.touchData.starts); - - if (allowPassthrough) { - e.preventDefault(); - - if (r.swipePanning) { - cy.panBy({ - x: disp[0] * zoom, - y: disp[1] * zoom - }); - } else if (isOverThresholdDrag) { - r.swipePanning = true; - - cy.panBy({ - x: dx * zoom, - y: dy * zoom - }); - - if (start) { - start.unactivate(); - - if (!r.data.bgActivePosistion) { - r.data.bgActivePosistion = math.array2point(r.touchData.startPosition); - } - - r.redrawHint('select', true); - - r.touchData.start = null; - } - } - } - - // Re-project - var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY); - now[0] = pos[0];now[1] = pos[1]; - } - } - - for (var j = 0; j < now.length; j++) { - earlier[j] = now[j]; - } - //r.redraw(); - - // the active bg indicator should be removed when making a swipe that is neither for dragging nodes or panning - if (capture && e.touches.length > 0 && !r.hoverData.draggingEles && !r.swipePanning && r.data.bgActivePosistion != null) { - r.data.bgActivePosistion = undefined; - r.redrawHint('select', true); - r.redraw(); - } - }, false); - var touchcancelHandler; - r.registerBinding(window, 'touchcancel', touchcancelHandler = function touchcancelHandler(e) { - // eslint-disable-line no-undef - var start = r.touchData.start; - - r.touchData.capture = false; - - if (start) { - start.unactivate(); - } - }); - - var touchendHandler; - r.registerBinding(window, 'touchend', touchendHandler = function touchendHandler(e) { - // eslint-disable-line no-undef - var start = r.touchData.start; - - var capture = r.touchData.capture; - - if (capture) { - if (e.touches.length === 0) { - r.touchData.capture = false; - } - - e.preventDefault(); - } else { - return; - } - - var select = r.selection; - - r.swipePanning = false; - r.hoverData.draggingEles = false; - - var cy = r.cy; - var zoom = cy.zoom(); - var now = r.touchData.now; - var earlier = r.touchData.earlier; - - if (e.touches[0]) { - var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);now[0] = pos[0];now[1] = pos[1]; - } - if (e.touches[1]) { - var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);now[2] = pos[0];now[3] = pos[1]; - } - if (e.touches[2]) { - var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);now[4] = pos[0];now[5] = pos[1]; - } - - if (start) { - start.unactivate(); - } - - var ctxTapend; - if (r.touchData.cxt) { - ctxTapend = { - originalEvent: e, - type: 'cxttapend', - position: { x: now[0], y: now[1] } - }; - - if (start) { - start.emit(ctxTapend); - } else { - cy.emit(ctxTapend); - } - - if (!r.touchData.cxtDragged) { - var ctxTap = { - originalEvent: e, - type: 'cxttap', - position: { x: now[0], y: now[1] } - }; - - if (start) { - start.emit(ctxTap); - } else { - cy.emit(ctxTap); - } - } - - if (r.touchData.start) { - r.touchData.start._private.grabbed = false; - } - r.touchData.cxt = false; - r.touchData.start = null; - - r.redraw(); - return; - } - - // no more box selection if we don't have three fingers - if (!e.touches[2] && cy.boxSelectionEnabled() && r.touchData.selecting) { - r.touchData.selecting = false; - - var box = cy.collection(r.getAllInBox(select[0], select[1], select[2], select[3])); - - select[0] = undefined; - select[1] = undefined; - select[2] = undefined; - select[3] = undefined; - select[4] = 0; - - r.redrawHint('select', true); - - cy.emit('boxend'); - - var eleWouldBeSelected = function eleWouldBeSelected(ele) { - return ele.selectable() && !ele.selected(); - }; - - box.emit('box').stdFilter(eleWouldBeSelected).select().emit('boxselect'); - - if (box.nonempty()) { - r.redrawHint('eles', true); - } - - r.redraw(); - } - - if (start != null) { - start.unactivate(); - } - - if (e.touches[2]) { - r.data.bgActivePosistion = undefined; - r.redrawHint('select', true); - } else if (e.touches[1]) { - // ignore - } else if (e.touches[0]) { - // ignore - - // Last touch released - } else if (!e.touches[0]) { - - r.data.bgActivePosistion = undefined; - r.redrawHint('select', true); - - var draggedEles = r.dragData.touchDragEles; - - if (start != null) { - - var startWasGrabbed = start._private.grabbed; - - freeDraggedElements(draggedEles); - - r.redrawHint('drag', true); - r.redrawHint('eles', true); - - if (startWasGrabbed) { - start.emit('free'); - } - - triggerEvents(start, ['touchend', 'tapend', 'vmouseup', 'tapdragout'], e, { - position: { x: now[0], y: now[1] } - }); - - start.unactivate(); - - r.touchData.start = null; - } else { - var near = r.findNearestElement(now[0], now[1], true, true); - - triggerEvents(near, ['touchend', 'tapend', 'vmouseup', 'tapdragout'], e, { - position: { x: now[0], y: now[1] } - }); - } - - var dx = r.touchData.startPosition[0] - now[0]; - var dx2 = dx * dx; - var dy = r.touchData.startPosition[1] - now[1]; - var dy2 = dy * dy; - var dist2 = dx2 + dy2; - var rdist2 = dist2 * zoom * zoom; - - // Prepare to select the currently touched node, only if it hasn't been dragged past a certain distance - if (start != null && !r.dragData.didDrag // didn't drag nodes around - && start._private.selectable && rdist2 < r.touchTapThreshold2 && !r.pinching // pinch to zoom should not affect selection - ) { - - if (cy.selectionType() === 'single') { - cy.$(':selected').unmerge(start).unselect(); - start.select(); - } else { - if (start.selected()) { - start.unselect(); - } else { - start.select(); - } - } - - r.redrawHint('eles', true); - } - - // Tap event, roughly same as mouse click event for touch - if (!r.touchData.singleTouchMoved) { - triggerEvents(start, ['tap', 'vclick'], e, { - position: { x: now[0], y: now[1] } - }); - } - - r.touchData.singleTouchMoved = true; - } - - for (var j = 0; j < now.length; j++) { - earlier[j] = now[j]; - } - - r.dragData.didDrag = false; // reset for next mousedown - - if (e.touches.length === 0) { - r.touchData.dragDelta = []; - r.touchData.startPosition = null; - r.touchData.startGPosition = null; - } - - if (e.touches.length < 2) { - r.pinching = false; - r.redrawHint('eles', true); - r.redraw(); - } - - //r.redraw(); - }, false); - - // fallback compatibility layer for ms pointer events - if (typeof TouchEvent === 'undefined') { - - var pointers = []; - - var makeTouch = function makeTouch(e) { - return { - clientX: e.clientX, - clientY: e.clientY, - force: 1, - identifier: e.pointerId, - pageX: e.pageX, - pageY: e.pageY, - radiusX: e.width / 2, - radiusY: e.height / 2, - screenX: e.screenX, - screenY: e.screenY, - target: e.target - }; - }; - - var makePointer = function makePointer(e) { - return { - event: e, - touch: makeTouch(e) - }; - }; - - var addPointer = function addPointer(e) { - pointers.push(makePointer(e)); - }; - - var removePointer = function removePointer(e) { - for (var i = 0; i < pointers.length; i++) { - var p = pointers[i]; - - if (p.event.pointerId === e.pointerId) { - pointers.splice(i, 1); - return; - } - } - }; - - var updatePointer = function updatePointer(e) { - var p = pointers.filter(function (p) { - return p.event.pointerId === e.pointerId; - })[0]; - - p.event = e; - p.touch = makeTouch(e); - }; - - var addTouchesToEvent = function addTouchesToEvent(e) { - e.touches = pointers.map(function (p) { - return p.touch; - }); - }; - - var pointerIsMouse = function pointerIsMouse(e) { - return e.pointerType === 'mouse' || e.pointerType === 4; - }; - - r.registerBinding(r.container, 'pointerdown', function (e) { - if (pointerIsMouse(e)) { - return; - } // mouse already handled - - e.preventDefault(); - - addPointer(e); - - addTouchesToEvent(e); - touchstartHandler(e); - }); - - r.registerBinding(r.container, 'pointerup', function (e) { - if (pointerIsMouse(e)) { - return; - } // mouse already handled - - removePointer(e); - - addTouchesToEvent(e); - touchendHandler(e); - }); - - r.registerBinding(r.container, 'pointercancel', function (e) { - if (pointerIsMouse(e)) { - return; - } // mouse already handled - - removePointer(e); - - addTouchesToEvent(e); - touchcancelHandler(e); - }); - - r.registerBinding(r.container, 'pointermove', function (e) { - if (pointerIsMouse(e)) { - return; - } // mouse already handled - - e.preventDefault(); - - updatePointer(e); - - addTouchesToEvent(e); - touchmoveHandler(e); - }); - } -}; - -module.exports = BRp; - -/***/ }), -/* 122 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var math = __webpack_require__(2); - -var BRp = {}; - -BRp.generatePolygon = function (name, points) { - return this.nodeShapes[name] = { - renderer: this, - - name: name, - - points: points, - - draw: function draw(context, centerX, centerY, width, height) { - this.renderer.nodeShapeImpl('polygon', context, centerX, centerY, width, height, this.points); - }, - - intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { - return math.polygonIntersectLine(x, y, this.points, nodeX, nodeY, width / 2, height / 2, padding); - }, - - checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { - return math.pointInsidePolygon(x, y, this.points, centerX, centerY, width, height, [0, -1], padding); - } - }; -}; - -BRp.generateEllipse = function () { - return this.nodeShapes['ellipse'] = { - renderer: this, - - name: 'ellipse', - - draw: function draw(context, centerX, centerY, width, height) { - this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height); - }, - - intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { - return math.intersectLineEllipse(x, y, nodeX, nodeY, width / 2 + padding, height / 2 + padding); - }, - - checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { - return math.checkInEllipse(x, y, width, height, centerX, centerY, padding); - } - }; -}; - -BRp.generateRoundRectangle = function () { - return this.nodeShapes['roundrectangle'] = { - renderer: this, - - name: 'roundrectangle', - - points: math.generateUnitNgonPointsFitToSquare(4, 0), - - draw: function draw(context, centerX, centerY, width, height) { - this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height); - }, - - intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { - return math.roundRectangleIntersectLine(x, y, nodeX, nodeY, width, height, padding); - }, - - checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { - - var cornerRadius = math.getRoundRectangleRadius(width, height); - var diam = cornerRadius * 2; - - // Check hBox - if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - diam, [0, -1], padding)) { - return true; - } - - // Check vBox - if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width - diam, height, [0, -1], padding)) { - return true; - } - - // Check top left quarter circle - if (math.checkInEllipse(x, y, diam, diam, centerX - width / 2 + cornerRadius, centerY - height / 2 + cornerRadius, padding)) { - - return true; - } - - // Check top right quarter circle - if (math.checkInEllipse(x, y, diam, diam, centerX + width / 2 - cornerRadius, centerY - height / 2 + cornerRadius, padding)) { - - return true; - } - - // Check bottom right quarter circle - if (math.checkInEllipse(x, y, diam, diam, centerX + width / 2 - cornerRadius, centerY + height / 2 - cornerRadius, padding)) { - - return true; - } - - // Check bottom left quarter circle - if (math.checkInEllipse(x, y, diam, diam, centerX - width / 2 + cornerRadius, centerY + height / 2 - cornerRadius, padding)) { - - return true; - } - - return false; - } - }; -}; - -BRp.generateCutRectangle = function () { - return this.nodeShapes['cutrectangle'] = { - renderer: this, - - name: 'cutrectangle', - - cornerLength: math.getCutRectangleCornerLength(), - - points: math.generateUnitNgonPointsFitToSquare(4, 0), - - draw: function draw(context, centerX, centerY, width, height) { - this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height); - }, - - generateCutTrianglePts: function generateCutTrianglePts(width, height, centerX, centerY) { - var cl = this.cornerLength; - var hh = height / 2; - var hw = width / 2; - var xBegin = centerX - hw; - var xEnd = centerX + hw; - var yBegin = centerY - hh; - var yEnd = centerY + hh; - - // points are in clockwise order, inner (imaginary) triangle pt on [4, 5] - return { - topLeft: [xBegin, yBegin + cl, xBegin + cl, yBegin, xBegin + cl, yBegin + cl], - topRight: [xEnd - cl, yBegin, xEnd, yBegin + cl, xEnd - cl, yBegin + cl], - bottomRight: [xEnd, yEnd - cl, xEnd - cl, yEnd, xEnd - cl, yEnd - cl], - bottomLeft: [xBegin + cl, yEnd, xBegin, yEnd - cl, xBegin + cl, yEnd - cl] - }; - }, - - intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { - var cPts = this.generateCutTrianglePts(width + 2 * padding, height + 2 * padding, nodeX, nodeY); - var pts = [].concat.apply([], [cPts.topLeft.splice(0, 4), cPts.topRight.splice(0, 4), cPts.bottomRight.splice(0, 4), cPts.bottomLeft.splice(0, 4)]); - - return math.polygonIntersectLine(x, y, pts, nodeX, nodeY); - }, - - checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { - // Check hBox - if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - 2 * this.cornerLength, [0, -1], padding)) { - return true; - } - - // Check vBox - if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width - 2 * this.cornerLength, height, [0, -1], padding)) { - return true; - } - var cutTrianglePts = this.generateCutTrianglePts(width, height, centerX, centerY); - return math.pointInsidePolygonPoints(x, y, cutTrianglePts.topLeft) || math.pointInsidePolygonPoints(x, y, cutTrianglePts.topRight) || math.pointInsidePolygonPoints(x, y, cutTrianglePts.bottomRight) || math.pointInsidePolygonPoints(x, y, cutTrianglePts.bottomLeft); - } - - }; -}; - -BRp.generateBarrel = function () { - return this.nodeShapes['barrel'] = { - renderer: this, - - name: 'barrel', - - points: math.generateUnitNgonPointsFitToSquare(4, 0), - - draw: function draw(context, centerX, centerY, width, height) { - this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height); - }, - - intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { - // use two fixed t values for the bezier curve approximation - - var t0 = 0.15; - var t1 = 0.5; - var t2 = 0.85; - - var bPts = this.generateBarrelBezierPts(width + 2 * padding, height + 2 * padding, nodeX, nodeY); - - var approximateBarrelCurvePts = function approximateBarrelCurvePts(pts) { - // approximate curve pts based on the two t values - var m0 = math.qbezierPtAt({ x: pts[0], y: pts[1] }, { x: pts[2], y: pts[3] }, { x: pts[4], y: pts[5] }, t0); - var m1 = math.qbezierPtAt({ x: pts[0], y: pts[1] }, { x: pts[2], y: pts[3] }, { x: pts[4], y: pts[5] }, t1); - var m2 = math.qbezierPtAt({ x: pts[0], y: pts[1] }, { x: pts[2], y: pts[3] }, { x: pts[4], y: pts[5] }, t2); - - return [pts[0], pts[1], m0.x, m0.y, m1.x, m1.y, m2.x, m2.y, pts[4], pts[5]]; - }; - - var pts = [].concat(approximateBarrelCurvePts(bPts.topLeft), approximateBarrelCurvePts(bPts.topRight), approximateBarrelCurvePts(bPts.bottomRight), approximateBarrelCurvePts(bPts.bottomLeft)); - - return math.polygonIntersectLine(x, y, pts, nodeX, nodeY); - }, - - generateBarrelBezierPts: function generateBarrelBezierPts(width, height, centerX, centerY) { - var hh = height / 2; - var hw = width / 2; - var xBegin = centerX - hw; - var xEnd = centerX + hw; - var yBegin = centerY - hh; - var yEnd = centerY + hh; - - var curveConstants = math.getBarrelCurveConstants(width, height); - var hOffset = curveConstants.heightOffset; - var wOffset = curveConstants.widthOffset; - var ctrlPtXOffset = curveConstants.ctrlPtOffsetPct * width; - - // points are in clockwise order, inner (imaginary) control pt on [4, 5] - var pts = { - topLeft: [xBegin, yBegin + hOffset, xBegin + ctrlPtXOffset, yBegin, xBegin + wOffset, yBegin], - topRight: [xEnd - wOffset, yBegin, xEnd - ctrlPtXOffset, yBegin, xEnd, yBegin + hOffset], - bottomRight: [xEnd, yEnd - hOffset, xEnd - ctrlPtXOffset, yEnd, xEnd - wOffset, yEnd], - bottomLeft: [xBegin + wOffset, yEnd, xBegin + ctrlPtXOffset, yEnd, xBegin, yEnd - hOffset] - }; - - pts.topLeft.isTop = true; - pts.topRight.isTop = true; - pts.bottomLeft.isBottom = true; - pts.bottomRight.isBottom = true; - - return pts; - }, - - checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { - - var curveConstants = math.getBarrelCurveConstants(width, height); - var hOffset = curveConstants.heightOffset; - var wOffset = curveConstants.widthOffset; - - // Check hBox - if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - 2 * hOffset, [0, -1], padding)) { - return true; - } - - // Check vBox - if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width - 2 * wOffset, height, [0, -1], padding)) { - return true; - } - - var barrelCurvePts = this.generateBarrelBezierPts(width, height, centerX, centerY); - - var getCurveT = function getCurveT(x, y, curvePts) { - var x0 = curvePts[4]; - var x1 = curvePts[2]; - var x2 = curvePts[0]; - var y0 = curvePts[5]; - // var y1 = curvePts[ 3 ]; - var y2 = curvePts[1]; - - var xMin = Math.min(x0, x2); - var xMax = Math.max(x0, x2); - var yMin = Math.min(y0, y2); - var yMax = Math.max(y0, y2); - - if (xMin <= x && x <= xMax && yMin <= y && y <= yMax) { - var coeff = math.bezierPtsToQuadCoeff(x0, x1, x2); - var roots = math.solveQuadratic(coeff[0], coeff[1], coeff[2], x); - - var validRoots = roots.filter(function (r) { - return 0 <= r && r <= 1; - }); - - if (validRoots.length > 0) { - return validRoots[0]; - } - } - return null; - }; - - var curveRegions = Object.keys(barrelCurvePts); - for (var i = 0; i < curveRegions.length; i++) { - var corner = curveRegions[i]; - var cornerPts = barrelCurvePts[corner]; - var t = getCurveT(x, y, cornerPts); - - if (t == null) { - continue; - } - - var y0 = cornerPts[5]; - var y1 = cornerPts[3]; - var y2 = cornerPts[1]; - var bezY = math.qbezierAt(y0, y1, y2, t); - - if (cornerPts.isTop && bezY <= y) { - return true; - } - if (cornerPts.isBottom && y <= bezY) { - return true; - } - } - return false; - } - }; -}; - -BRp.generateBottomRoundrectangle = function () { - return this.nodeShapes['bottomroundrectangle'] = { - renderer: this, - - name: 'bottomroundrectangle', - - points: math.generateUnitNgonPointsFitToSquare(4, 0), - - draw: function draw(context, centerX, centerY, width, height) { - this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height); - }, - - intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) { - var topStartX = nodeX - (width / 2 + padding); - var topStartY = nodeY - (height / 2 + padding); - var topEndY = topStartY; - var topEndX = nodeX + (width / 2 + padding); - - var topIntersections = math.finiteLinesIntersect(x, y, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false); - if (topIntersections.length > 0) { - return topIntersections; - } - - return math.roundRectangleIntersectLine(x, y, nodeX, nodeY, width, height, padding); - }, - - checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) { - - var cornerRadius = math.getRoundRectangleRadius(width, height); - var diam = 2 * cornerRadius; - - // Check hBox - if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - diam, [0, -1], padding)) { - return true; - } - - // Check vBox - if (math.pointInsidePolygon(x, y, this.points, centerX, centerY, width - diam, height, [0, -1], padding)) { - return true; - } - - // check non-rounded top side - var outerWidth = width / 2 + 2 * padding; - var outerHeight = height / 2 + 2 * padding; - var points = [centerX - outerWidth, centerY - outerHeight, centerX - outerWidth, centerY, centerX + outerWidth, centerY, centerX + outerWidth, centerY - outerHeight]; - if (math.pointInsidePolygonPoints(x, y, points)) { - return true; - } - - // Check bottom right quarter circle - if (math.checkInEllipse(x, y, diam, diam, centerX + width / 2 - cornerRadius, centerY + height / 2 - cornerRadius, padding)) { - - return true; - } - - // Check bottom left quarter circle - if (math.checkInEllipse(x, y, diam, diam, centerX - width / 2 + cornerRadius, centerY + height / 2 - cornerRadius, padding)) { - - return true; - } - - return false; - } - }; -}; - -BRp.registerNodeShapes = function () { - var nodeShapes = this.nodeShapes = {}; - var renderer = this; - - this.generateEllipse(); - - this.generatePolygon('triangle', math.generateUnitNgonPointsFitToSquare(3, 0)); - - this.generatePolygon('rectangle', math.generateUnitNgonPointsFitToSquare(4, 0)); - nodeShapes['square'] = nodeShapes['rectangle']; - - this.generateRoundRectangle(); - - this.generateCutRectangle(); - - this.generateBarrel(); - - this.generateBottomRoundrectangle(); - - this.generatePolygon('diamond', [0, 1, 1, 0, 0, -1, -1, 0]); - - this.generatePolygon('pentagon', math.generateUnitNgonPointsFitToSquare(5, 0)); - - this.generatePolygon('hexagon', math.generateUnitNgonPointsFitToSquare(6, 0)); - - this.generatePolygon('heptagon', math.generateUnitNgonPointsFitToSquare(7, 0)); - - this.generatePolygon('octagon', math.generateUnitNgonPointsFitToSquare(8, 0)); - - var star5Points = new Array(20); - { - var outerPoints = math.generateUnitNgonPoints(5, 0); - var innerPoints = math.generateUnitNgonPoints(5, Math.PI / 5); - - // Outer radius is 1; inner radius of star is smaller - var innerRadius = 0.5 * (3 - Math.sqrt(5)); - innerRadius *= 1.57; - - for (var i = 0; i < innerPoints.length / 2; i++) { - innerPoints[i * 2] *= innerRadius; - innerPoints[i * 2 + 1] *= innerRadius; - } - - for (var i = 0; i < 20 / 4; i++) { - star5Points[i * 4] = outerPoints[i * 2]; - star5Points[i * 4 + 1] = outerPoints[i * 2 + 1]; - - star5Points[i * 4 + 2] = innerPoints[i * 2]; - star5Points[i * 4 + 3] = innerPoints[i * 2 + 1]; - } - } - - star5Points = math.fitPolygonToSquare(star5Points); - - this.generatePolygon('star', star5Points); - - this.generatePolygon('vee', [-1, -1, 0, -0.333, 1, -1, 0, 1]); - - this.generatePolygon('rhomboid', [-1, -1, 0.333, -1, 1, 1, -0.333, 1]); - - this.generatePolygon('concavehexagon', [-1, -0.95, -0.75, 0, -1, 0.95, 1, 0.95, 0.75, 0, 1, -0.95]); - - this.generatePolygon('tag', [-1, -1, 0.25, -1, 1, 0, 0.25, 1, -1, 1]); - - nodeShapes.makePolygon = function (points) { - - // use caching on user-specified polygons so they are as fast as native shapes - - var key = points.join('$'); - var name = 'polygon-' + key; - var shape; - - if (shape = this[name]) { - // got cached shape - return shape; - } - - // create and cache new shape - return renderer.generatePolygon(name, points); - }; -}; - -module.exports = BRp; - -/***/ }), -/* 123 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); - -var BRp = {}; - -BRp.timeToRender = function () { - return this.redrawTotalTime / this.redrawCount; -}; - -BRp.redraw = function (options) { - options = options || util.staticEmptyObject(); - - var r = this; - - if (r.averageRedrawTime === undefined) { - r.averageRedrawTime = 0; - } - if (r.lastRedrawTime === undefined) { - r.lastRedrawTime = 0; - } - if (r.lastDrawTime === undefined) { - r.lastDrawTime = 0; - } - - r.requestedFrame = true; - r.renderOptions = options; -}; - -BRp.beforeRender = function (fn, priority) { - // the renderer can't add tick callbacks when destroyed - if (this.destroyed) { - return; - } - - priority = priority || 0; - - var cbs = this.beforeRenderCallbacks; - - cbs.push({ fn: fn, priority: priority }); - - // higher priority callbacks executed first - cbs.sort(function (a, b) { - return b.priority - a.priority; - }); -}; - -var beforeRenderCallbacks = function beforeRenderCallbacks(r, willDraw, startTime) { - var cbs = r.beforeRenderCallbacks; - - for (var i = 0; i < cbs.length; i++) { - cbs[i].fn(willDraw, startTime); - } -}; - -BRp.startRenderLoop = function () { - var r = this; - - if (r.renderLoopStarted) { - return; - } else { - r.renderLoopStarted = true; - } - - var renderFn = function renderFn(requestTime) { - if (r.destroyed) { - return; - } - - if (r.requestedFrame && !r.skipFrame) { - beforeRenderCallbacks(r, true, requestTime); - - var startTime = util.performanceNow(); - - r.render(r.renderOptions); - - var endTime = r.lastDrawTime = util.performanceNow(); - - if (r.averageRedrawTime === undefined) { - r.averageRedrawTime = endTime - startTime; - } - - if (r.redrawCount === undefined) { - r.redrawCount = 0; - } - - r.redrawCount++; - - if (r.redrawTotalTime === undefined) { - r.redrawTotalTime = 0; - } - - var duration = endTime - startTime; - - r.redrawTotalTime += duration; - r.lastRedrawTime = duration; - - // use a weighted average with a bias from the previous average so we don't spike so easily - r.averageRedrawTime = r.averageRedrawTime / 2 + duration / 2; - - r.requestedFrame = false; - } else { - beforeRenderCallbacks(r, false, requestTime); - } - - r.skipFrame = false; - - util.requestAnimationFrame(renderFn); - }; - - util.requestAnimationFrame(renderFn); -}; - -module.exports = BRp; - -/***/ }), -/* 124 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/* -The canvas renderer was written by Yue Dong. - -Modifications tracked on Github. -*/ - -var util = __webpack_require__(1); -var is = __webpack_require__(0); -var ElementTextureCache = __webpack_require__(125); -var LayeredTextureCache = __webpack_require__(126); - -var CR = CanvasRenderer; -var CRp = CanvasRenderer.prototype; - -CRp.CANVAS_LAYERS = 3; -// -CRp.SELECT_BOX = 0; -CRp.DRAG = 1; -CRp.NODE = 2; - -CRp.BUFFER_COUNT = 3; -// -CRp.TEXTURE_BUFFER = 0; -CRp.MOTIONBLUR_BUFFER_NODE = 1; -CRp.MOTIONBLUR_BUFFER_DRAG = 2; - -function CanvasRenderer(options) { - var r = this; - - r.data = { - canvases: new Array(CRp.CANVAS_LAYERS), - contexts: new Array(CRp.CANVAS_LAYERS), - canvasNeedsRedraw: new Array(CRp.CANVAS_LAYERS), - - bufferCanvases: new Array(CRp.BUFFER_COUNT), - bufferContexts: new Array(CRp.CANVAS_LAYERS) - }; - - var tapHlOff = '-webkit-tap-highlight-color: rgba(0,0,0,0);'; - - r.data.canvasContainer = document.createElement('div'); // eslint-disable-line no-undef - var containerStyle = r.data.canvasContainer.style; - r.data.canvasContainer.setAttribute('style', tapHlOff); - containerStyle.position = 'relative'; - containerStyle.zIndex = '0'; - containerStyle.overflow = 'hidden'; - - var container = options.cy.container(); - container.appendChild(r.data.canvasContainer); - - if ((container.getAttribute('style') || '').indexOf(tapHlOff) < 0) { - container.setAttribute('style', (container.getAttribute('style') || '') + tapHlOff); - } - - for (var i = 0; i < CRp.CANVAS_LAYERS; i++) { - var canvas = r.data.canvases[i] = document.createElement('canvas'); // eslint-disable-line no-undef - r.data.contexts[i] = canvas.getContext('2d'); - canvas.setAttribute('style', '-webkit-user-select: none; -moz-user-select: -moz-none; user-select: none; -webkit-tap-highlight-color: rgba(0,0,0,0); outline-style: none;' + (is.ms() ? ' -ms-touch-action: none; touch-action: none; ' : '')); - canvas.style.position = 'absolute'; - canvas.setAttribute('data-id', 'layer' + i); - canvas.style.zIndex = String(CRp.CANVAS_LAYERS - i); - r.data.canvasContainer.appendChild(canvas); - - r.data.canvasNeedsRedraw[i] = false; - } - r.data.topCanvas = r.data.canvases[0]; - - r.data.canvases[CRp.NODE].setAttribute('data-id', 'layer' + CRp.NODE + '-node'); - r.data.canvases[CRp.SELECT_BOX].setAttribute('data-id', 'layer' + CRp.SELECT_BOX + '-selectbox'); - r.data.canvases[CRp.DRAG].setAttribute('data-id', 'layer' + CRp.DRAG + '-drag'); - - for (var i = 0; i < CRp.BUFFER_COUNT; i++) { - r.data.bufferCanvases[i] = document.createElement('canvas'); // eslint-disable-line no-undef - r.data.bufferContexts[i] = r.data.bufferCanvases[i].getContext('2d'); - r.data.bufferCanvases[i].style.position = 'absolute'; - r.data.bufferCanvases[i].setAttribute('data-id', 'buffer' + i); - r.data.bufferCanvases[i].style.zIndex = String(-i - 1); - r.data.bufferCanvases[i].style.visibility = 'hidden'; - //r.data.canvasContainer.appendChild(r.data.bufferCanvases[i]); - } - - r.pathsEnabled = true; - - r.data.eleTxrCache = new ElementTextureCache(r); - r.data.lyrTxrCache = new LayeredTextureCache(r, r.data.eleTxrCache); - - r.onUpdateEleCalcs(function invalidateTextureCaches(willDraw, eles) { - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - var rs = ele._private.rstyle; - var de = rs.dirtyEvents; - - if (ele.isNode() && de && de.length === 1 && de['position']) { - // then keep cached ele texture - } else { - r.data.eleTxrCache.invalidateElement(ele); - - // NB this block of code should not be ported to 3.3 (unstable branch). - // - This check is unneccesary in 3.3 as caches will be stored without respect to opacity. - // - This fix may result in lowered performance for compound graphs. - // - Ref : Opacity of child node is not updated for certain zoom levels after parent opacity is overriden #2078 - if (ele.isParent() && de['style']) { - var op1 = rs.prevParentOpacity; - var op2 = ele.pstyle('opacity').pfValue; - - rs.prevParentOpacity = op2; - - if (op1 !== op2) { - var descs = ele.descendants(); - - for (var j = 0; j < descs.length; j++) { - r.data.eleTxrCache.invalidateElement(descs[j]); - } - } - } - } - } - - if (eles.length > 0) { - r.data.lyrTxrCache.invalidateElements(eles); - } - }); -} - -CRp.redrawHint = function (group, bool) { - var r = this; - - switch (group) { - case 'eles': - r.data.canvasNeedsRedraw[CRp.NODE] = bool; - break; - case 'drag': - r.data.canvasNeedsRedraw[CRp.DRAG] = bool; - break; - case 'select': - r.data.canvasNeedsRedraw[CRp.SELECT_BOX] = bool; - break; - } -}; - -// whether to use Path2D caching for drawing -var pathsImpld = typeof Path2D !== 'undefined'; - -CRp.path2dEnabled = function (on) { - if (on === undefined) { - return this.pathsEnabled; - } - - this.pathsEnabled = on ? true : false; -}; - -CRp.usePaths = function () { - return pathsImpld && this.pathsEnabled; -}; - -[__webpack_require__(127), __webpack_require__(128), __webpack_require__(129), __webpack_require__(130), __webpack_require__(131), __webpack_require__(132), __webpack_require__(133), __webpack_require__(134), __webpack_require__(135), __webpack_require__(136)].forEach(function (props) { - util.extend(CRp, props); -}); - -module.exports = CR; - -/***/ }), -/* 125 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var math = __webpack_require__(2); -var util = __webpack_require__(1); -var Heap = __webpack_require__(9); -var defs = __webpack_require__(19); - -var minTxrH = 25; // the size of the texture cache for small height eles (special case) -var txrStepH = 50; // the min size of the regular cache, and the size it increases with each step up -var minLvl = -4; // when scaling smaller than that we don't need to re-render -var maxLvl = 2; // when larger than this scale just render directly (caching is not helpful) -var maxZoom = 3.99; // beyond this zoom level, layered textures are not used -var eleTxrSpacing = 8; // spacing between elements on textures to avoid blitting overlaps -var defTxrWidth = 1024; // default/minimum texture width -var maxTxrW = 1024; // the maximum width of a texture -var maxTxrH = 1024; // the maximum height of a texture -var minUtility = 0.5; // if usage of texture is less than this, it is retired -var maxFullness = 0.8; // fullness of texture after which queue removal is checked -var maxFullnessChecks = 10; // dequeued after this many checks -var allowEdgeTxrCaching = false; // whether edges can be cached as textures (TODO maybe better on if webgl supported?) -var allowParentTxrCaching = false; // whether parent nodes can be cached as textures (TODO maybe better on if webgl supported?) -var deqCost = 0.15; // % of add'l rendering cost allowed for dequeuing ele caches each frame -var deqAvgCost = 0.1; // % of add'l rendering cost compared to average overall redraw time -var deqNoDrawCost = 0.9; // % of avg frame time that can be used for dequeueing when not drawing -var deqFastCost = 0.9; // % of frame time to be used when >60fps -var deqRedrawThreshold = 100; // time to batch redraws together from dequeueing to allow more dequeueing calcs to happen in the meanwhile -var maxDeqSize = 1; // number of eles to dequeue and render at higher texture in each batch - -var getTxrReasons = { - dequeue: 'dequeue', - downscale: 'downscale', - highQuality: 'highQuality' -}; - -var ElementTextureCache = function ElementTextureCache(renderer) { - var self = this; - - self.renderer = renderer; - self.onDequeues = []; - - self.setupDequeueing(); -}; - -var ETCp = ElementTextureCache.prototype; - -ETCp.reasons = getTxrReasons; - -// the list of textures in which new subtextures for elements can be placed -ETCp.getTextureQueue = function (txrH) { - var self = this; - self.eleImgCaches = self.eleImgCaches || {}; - - return self.eleImgCaches[txrH] = self.eleImgCaches[txrH] || []; -}; - -// the list of usused textures which can be recycled (in use in texture queue) -ETCp.getRetiredTextureQueue = function (txrH) { - var self = this; - - var rtxtrQs = self.eleImgCaches.retired = self.eleImgCaches.retired || {}; - var rtxtrQ = rtxtrQs[txrH] = rtxtrQs[txrH] || []; - - return rtxtrQ; -}; - -// queue of element draw requests at different scale levels -ETCp.getElementQueue = function () { - var self = this; - - var q = self.eleCacheQueue = self.eleCacheQueue || new Heap(function (a, b) { - return b.reqs - a.reqs; - }); - - return q; -}; - -// queue of element draw requests at different scale levels (element id lookup) -ETCp.getElementIdToQueue = function () { - var self = this; - - var id2q = self.eleIdToCacheQueue = self.eleIdToCacheQueue || {}; - - return id2q; -}; - -ETCp.getElement = function (ele, bb, pxRatio, lvl, reason) { - var self = this; - var r = this.renderer; - var rs = ele._private.rscratch; - var zoom = r.cy.zoom(); - - if (bb.w === 0 || bb.h === 0 || !ele.visible()) { - return null; - } - - if (lvl == null) { - lvl = Math.ceil(math.log2(zoom * pxRatio)); - } - - if (lvl < minLvl) { - lvl = minLvl; - } else if (zoom >= maxZoom || lvl > maxLvl) { - return null; - } - - var scale = Math.pow(2, lvl); - var eleScaledH = bb.h * scale; - var eleScaledW = bb.w * scale; - var caches = rs.imgCaches = rs.imgCaches || {}; - var eleCache = caches[lvl]; - - if (eleCache) { - return eleCache; - } - - var txrH; // which texture height this ele belongs to - - if (eleScaledH <= minTxrH) { - txrH = minTxrH; - } else if (eleScaledH <= txrStepH) { - txrH = txrStepH; - } else { - txrH = Math.ceil(eleScaledH / txrStepH) * txrStepH; - } - - if (eleScaledH > maxTxrH || eleScaledW > maxTxrW || !allowEdgeTxrCaching && ele.isEdge() || !allowParentTxrCaching && ele.isParent()) { - return null; // caching large elements is not efficient - } - - var txrQ = self.getTextureQueue(txrH); - - // first try the second last one in case it has space at the end - var txr = txrQ[txrQ.length - 2]; - - var addNewTxr = function addNewTxr() { - return self.recycleTexture(txrH, eleScaledW) || self.addTexture(txrH, eleScaledW); - }; - - // try the last one if there is no second last one - if (!txr) { - txr = txrQ[txrQ.length - 1]; - } - - // if the last one doesn't exist, we need a first one - if (!txr) { - txr = addNewTxr(); - } - - // if there's no room in the current texture, we need a new one - if (txr.width - txr.usedWidth < eleScaledW) { - txr = addNewTxr(); - } - - var scaledLabelShown = r.eleTextBiggerThanMin(ele, scale); - var scalableFrom = function scalableFrom(otherCache) { - return otherCache && otherCache.scaledLabelShown === scaledLabelShown; - }; - - var deqing = reason && reason === getTxrReasons.dequeue; - var highQualityReq = reason && reason === getTxrReasons.highQuality; - var downscaleReq = reason && reason === getTxrReasons.downscale; - - var higherCache; // the nearest cache with a higher level - for (var l = lvl + 1; l <= maxLvl; l++) { - var c = caches[l]; - - if (c) { - higherCache = c;break; - } - } - - var oneUpCache = higherCache && higherCache.level === lvl + 1 ? higherCache : null; - - var downscale = function downscale() { - txr.context.drawImage(oneUpCache.texture.canvas, oneUpCache.x, 0, oneUpCache.width, oneUpCache.height, txr.usedWidth, 0, eleScaledW, eleScaledH); - }; - - // reset ele area in texture - txr.context.setTransform(1, 0, 0, 1, 0, 0); - txr.context.clearRect(txr.usedWidth, 0, eleScaledW, txrH); - - if (scalableFrom(oneUpCache)) { - // then we can relatively cheaply rescale the existing image w/o rerendering - downscale(); - } else if (scalableFrom(higherCache)) { - // then use the higher cache for now and queue the next level down - // to cheaply scale towards the smaller level - - if (highQualityReq) { - for (var l = higherCache.level; l > lvl; l--) { - oneUpCache = self.getElement(ele, bb, pxRatio, l, getTxrReasons.downscale); - } - - downscale(); - } else { - self.queueElement(ele, higherCache.level - 1); - - return higherCache; - } - } else { - - var lowerCache; // the nearest cache with a lower level - if (!deqing && !highQualityReq && !downscaleReq) { - for (var l = lvl - 1; l >= minLvl; l--) { - var c = caches[l]; - - if (c) { - lowerCache = c;break; - } - } - } - - if (scalableFrom(lowerCache)) { - // then use the lower quality cache for now and queue the better one for later - - self.queueElement(ele, lvl); - - return lowerCache; - } - - txr.context.translate(txr.usedWidth, 0); - txr.context.scale(scale, scale); - - r.drawElement(txr.context, ele, bb, scaledLabelShown); - - txr.context.scale(1 / scale, 1 / scale); - txr.context.translate(-txr.usedWidth, 0); - } - - eleCache = caches[lvl] = { - ele: ele, - x: txr.usedWidth, - texture: txr, - level: lvl, - scale: scale, - width: eleScaledW, - height: eleScaledH, - scaledLabelShown: scaledLabelShown - }; - - txr.usedWidth += Math.ceil(eleScaledW + eleTxrSpacing); - - txr.eleCaches.push(eleCache); - - self.checkTextureFullness(txr); - - return eleCache; -}; - -ETCp.invalidateElement = function (ele) { - var self = this; - var caches = ele._private.rscratch.imgCaches; - - if (caches) { - for (var lvl = minLvl; lvl <= maxLvl; lvl++) { - var cache = caches[lvl]; - - if (cache) { - var txr = cache.texture; - - // remove space from the texture it belongs to - txr.invalidatedWidth += cache.width; - - // remove refs with the element - caches[lvl] = null; - util.removeFromArray(txr.eleCaches, cache); - - // remove from queue since the old req was for the old state - self.removeFromQueue(ele); - - // might have to remove the entire texture if it's not efficiently using its space - self.checkTextureUtility(txr); - } - } - } -}; - -ETCp.checkTextureUtility = function (txr) { - // invalidate all entries in the cache if the cache size is small - if (txr.invalidatedWidth >= minUtility * txr.width) { - this.retireTexture(txr); - } -}; - -ETCp.checkTextureFullness = function (txr) { - // if texture has been mostly filled and passed over several times, remove - // it from the queue so we don't need to waste time looking at it to put new things - - var self = this; - var txrQ = self.getTextureQueue(txr.height); - - if (txr.usedWidth / txr.width > maxFullness && txr.fullnessChecks >= maxFullnessChecks) { - util.removeFromArray(txrQ, txr); - } else { - txr.fullnessChecks++; - } -}; - -ETCp.retireTexture = function (txr) { - var self = this; - var txrH = txr.height; - var txrQ = self.getTextureQueue(txrH); - - // retire the texture from the active / searchable queue: - - util.removeFromArray(txrQ, txr); - - txr.retired = true; - - // remove the refs from the eles to the caches: - - var eleCaches = txr.eleCaches; - - for (var i = 0; i < eleCaches.length; i++) { - var eleCache = eleCaches[i]; - var ele = eleCache.ele; - var lvl = eleCache.level; - var imgCaches = ele._private.rscratch.imgCaches; - - if (imgCaches) { - imgCaches[lvl] = null; - } - } - - util.clearArray(eleCaches); - - // add the texture to a retired queue so it can be recycled in future: - - var rtxtrQ = self.getRetiredTextureQueue(txrH); - - rtxtrQ.push(txr); -}; - -ETCp.addTexture = function (txrH, minW) { - var self = this; - var txrQ = self.getTextureQueue(txrH); - var txr = {}; - - txrQ.push(txr); - - txr.eleCaches = []; - - txr.height = txrH; - txr.width = Math.max(defTxrWidth, minW); - txr.usedWidth = 0; - txr.invalidatedWidth = 0; - txr.fullnessChecks = 0; - - txr.canvas = document.createElement('canvas'); // eslint-disable-line no-undef - txr.canvas.width = txr.width; - txr.canvas.height = txr.height; - - txr.context = txr.canvas.getContext('2d'); - - return txr; -}; - -ETCp.recycleTexture = function (txrH, minW) { - var self = this; - var txrQ = self.getTextureQueue(txrH); - var rtxtrQ = self.getRetiredTextureQueue(txrH); - - for (var i = 0; i < rtxtrQ.length; i++) { - var txr = rtxtrQ[i]; - - if (txr.width >= minW) { - txr.retired = false; - - txr.usedWidth = 0; - txr.invalidatedWidth = 0; - txr.fullnessChecks = 0; - - util.clearArray(txr.eleCaches); - - txr.context.setTransform(1, 0, 0, 1, 0, 0); - txr.context.clearRect(0, 0, txr.width, txr.height); - - util.removeFromArray(rtxtrQ, txr); - txrQ.push(txr); - - return txr; - } - } -}; - -ETCp.queueElement = function (ele, lvl) { - var self = this; - var q = self.getElementQueue(); - var id2q = self.getElementIdToQueue(); - var id = ele.id(); - var existingReq = id2q[id]; - - if (existingReq) { - // use the max lvl b/c in between lvls are cheap to make - existingReq.level = Math.max(existingReq.level, lvl); - existingReq.reqs++; - - q.updateItem(existingReq); - } else { - var req = { - ele: ele, - level: lvl, - reqs: 1 - }; - - q.push(req); - - id2q[id] = req; - } -}; - -ETCp.dequeue = function (pxRatio /*, extent*/) { - var self = this; - var q = self.getElementQueue(); - var id2q = self.getElementIdToQueue(); - var dequeued = []; - - for (var i = 0; i < maxDeqSize; i++) { - if (q.size() > 0) { - var req = q.pop(); - var ele = req.ele; - var caches = ele._private.rscratch.imgCaches; - - // dequeueing isn't necessary when an existing cache exists - if (caches[req.level] != null) { - continue; - } - - id2q[ele.id()] = null; - - dequeued.push(req); - - var bb = ele.boundingBox(); - - self.getElement(ele, bb, pxRatio, req.level, getTxrReasons.dequeue); - } else { - break; - } - } - - return dequeued; -}; - -ETCp.removeFromQueue = function (ele) { - var self = this; - var q = self.getElementQueue(); - var id2q = self.getElementIdToQueue(); - var req = id2q[ele.id()]; - - if (req != null) { - // bring to front of queue - req.reqs = util.MAX_INT; - q.updateItem(req); - - q.pop(); // remove from queue - - id2q[ele.id()] = null; // remove from lookup map - } -}; - -ETCp.onDequeue = function (fn) { - this.onDequeues.push(fn); -}; -ETCp.offDequeue = function (fn) { - util.removeFromArray(this.onDequeues, fn); -}; - -ETCp.setupDequeueing = defs.setupDequeueing({ - deqRedrawThreshold: deqRedrawThreshold, - deqCost: deqCost, - deqAvgCost: deqAvgCost, - deqNoDrawCost: deqNoDrawCost, - deqFastCost: deqFastCost, - deq: function deq(self, pxRatio, extent) { - return self.dequeue(pxRatio, extent); - }, - onDeqd: function onDeqd(self, deqd) { - for (var i = 0; i < self.onDequeues.length; i++) { - var fn = self.onDequeues[i]; - - fn(deqd); - } - }, - shouldRedraw: function shouldRedraw(self, deqd, pxRatio, extent) { - for (var i = 0; i < deqd.length; i++) { - var bb = deqd[i].ele.boundingBox(); - - if (math.boundingBoxesIntersect(bb, extent)) { - return true; - } - } - - return false; - }, - priority: function priority(self) { - return self.renderer.beforeRenderPriorities.eleTxrDeq; - } -}); - -module.exports = ElementTextureCache; - -/***/ }), -/* 126 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var math = __webpack_require__(2); -var Heap = __webpack_require__(9); -var is = __webpack_require__(0); -var defs = __webpack_require__(19); - -var defNumLayers = 1; // default number of layers to use -var minLvl = -4; // when scaling smaller than that we don't need to re-render -var maxLvl = 2; // when larger than this scale just render directly (caching is not helpful) -var maxZoom = 3.99; // beyond this zoom level, layered textures are not used -var deqRedrawThreshold = 50; // time to batch redraws together from dequeueing to allow more dequeueing calcs to happen in the meanwhile -var refineEleDebounceTime = 50; // time to debounce sharper ele texture updates -var disableEleImgSmoothing = true; // when drawing eles on layers from an ele cache ; crisper and more performant when true -var deqCost = 0.15; // % of add'l rendering cost allowed for dequeuing ele caches each frame -var deqAvgCost = 0.1; // % of add'l rendering cost compared to average overall redraw time -var deqNoDrawCost = 0.9; // % of avg frame time that can be used for dequeueing when not drawing -var deqFastCost = 0.9; // % of frame time to be used when >60fps -var maxDeqSize = 1; // number of eles to dequeue and render at higher texture in each batch -var invalidThreshold = 250; // time threshold for disabling b/c of invalidations -var maxLayerArea = 4000 * 4000; // layers can't be bigger than this -var alwaysQueue = true; // never draw all the layers in a level on a frame; draw directly until all dequeued -var useHighQualityEleTxrReqs = true; // whether to use high quality ele txr requests (generally faster and cheaper in the longterm) - -var useEleTxrCaching = true; // whether to use individual ele texture caching underneath this cache - -// var log = function(){ console.log.apply( console, arguments ); }; - -var LayeredTextureCache = function LayeredTextureCache(renderer, eleTxrCache) { - var self = this; - - var r = self.renderer = renderer; - - self.layersByLevel = {}; // e.g. 2 => [ layer1, layer2, ..., layerN ] - - self.firstGet = true; - - self.lastInvalidationTime = util.performanceNow() - 2 * invalidThreshold; - - self.skipping = false; - - r.beforeRender(function (willDraw, now) { - if (now - self.lastInvalidationTime <= invalidThreshold) { - self.skipping = true; - } else { - self.skipping = false; - } - }); - - var qSort = function qSort(a, b) { - return b.reqs - a.reqs; - }; - - self.layersQueue = new Heap(qSort); - - self.eleTxrCache = eleTxrCache; - - self.setupEleCacheInvalidation(); - - self.setupDequeueing(); -}; - -var LTCp = LayeredTextureCache.prototype; - -var layerIdPool = 0; -var MAX_INT = Math.pow(2, 53) - 1; - -LTCp.makeLayer = function (bb, lvl) { - var scale = Math.pow(2, lvl); - - var w = Math.ceil(bb.w * scale); - var h = Math.ceil(bb.h * scale); - - var canvas = document.createElement('canvas'); // eslint-disable-line no-undef - - canvas.width = w; - canvas.height = h; - - var layer = { - id: layerIdPool = ++layerIdPool % MAX_INT, - bb: bb, - level: lvl, - width: w, - height: h, - canvas: canvas, - context: canvas.getContext('2d'), - eles: [], - elesQueue: [], - reqs: 0 - }; - - // log('make layer %s with w %s and h %s and lvl %s', layer.id, layer.width, layer.height, layer.level); - - var cxt = layer.context; - var dx = -layer.bb.x1; - var dy = -layer.bb.y1; - - // do the transform on creation to save cycles (it's the same for all eles) - cxt.scale(scale, scale); - cxt.translate(dx, dy); - - return layer; -}; - -LTCp.getLayers = function (eles, pxRatio, lvl) { - var self = this; - var r = self.renderer; - var cy = r.cy; - var zoom = cy.zoom(); - var firstGet = self.firstGet; - - self.firstGet = false; - - // log('--\nget layers with %s eles', eles.length); - //log eles.map(function(ele){ return ele.id() }) ); - - if (lvl == null) { - lvl = Math.ceil(math.log2(zoom * pxRatio)); - - if (lvl < minLvl) { - lvl = minLvl; - } else if (zoom >= maxZoom || lvl > maxLvl) { - return null; - } - } - - self.validateLayersElesOrdering(lvl, eles); - - var layersByLvl = self.layersByLevel; - var scale = Math.pow(2, lvl); - var layers = layersByLvl[lvl] = layersByLvl[lvl] || []; - var bb; - - var lvlComplete = self.levelIsComplete(lvl, eles); - var tmpLayers; - - var checkTempLevels = function checkTempLevels() { - var canUseAsTmpLvl = function canUseAsTmpLvl(l) { - self.validateLayersElesOrdering(l, eles); - - if (self.levelIsComplete(l, eles)) { - tmpLayers = layersByLvl[l]; - return true; - } - }; - - var checkLvls = function checkLvls(dir) { - if (tmpLayers) { - return; - } - - for (var l = lvl + dir; minLvl <= l && l <= maxLvl; l += dir) { - if (canUseAsTmpLvl(l)) { - break; - } - } - }; - - checkLvls(+1); - checkLvls(-1); - - // remove the invalid layers; they will be replaced as needed later in this function - for (var i = layers.length - 1; i >= 0; i--) { - var layer = layers[i]; - - if (layer.invalid) { - util.removeFromArray(layers, layer); - } - } - }; - - if (!lvlComplete) { - // if the current level is incomplete, then use the closest, best quality layerset temporarily - // and later queue the current layerset so we can get the proper quality level soon - - checkTempLevels(); - } else { - // log('level complete, using existing layers\n--'); - return layers; - } - - var getBb = function getBb() { - if (!bb) { - bb = math.makeBoundingBox(); - - for (var i = 0; i < eles.length; i++) { - math.updateBoundingBox(bb, eles[i].boundingBox()); - } - } - - return bb; - }; - - var makeLayer = function makeLayer(opts) { - opts = opts || {}; - - var after = opts.after; - - getBb(); - - var area = bb.w * scale * (bb.h * scale); - - if (area > maxLayerArea) { - return null; - } - - var layer = self.makeLayer(bb, lvl); - - if (after != null) { - var index = layers.indexOf(after) + 1; - - layers.splice(index, 0, layer); - } else if (opts.insert === undefined || opts.insert) { - // no after specified => first layer made so put at start - layers.unshift(layer); - } - - // if( tmpLayers ){ - //self.queueLayer( layer ); - // } - - return layer; - }; - - if (self.skipping && !firstGet) { - // log('skip layers'); - return null; - } - - // log('do layers'); - - var layer = null; - var maxElesPerLayer = eles.length / defNumLayers; - var allowLazyQueueing = alwaysQueue && !firstGet; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - var rs = ele._private.rscratch; - var caches = rs.imgLayerCaches = rs.imgLayerCaches || {}; - - // log('look at ele', ele.id()); - - var existingLayer = caches[lvl]; - - if (existingLayer) { - // reuse layer for later eles - // log('reuse layer for', ele.id()); - layer = existingLayer; - continue; - } - - if (!layer || layer.eles.length >= maxElesPerLayer || !math.boundingBoxInBoundingBox(layer.bb, ele.boundingBox())) { - // log('make new layer for ele %s', ele.id()); - - layer = makeLayer({ insert: true, after: layer }); - - // if now layer can be built then we can't use layers at this level - if (!layer) { - return null; - } - - // log('new layer with id %s', layer.id); - } - - if (tmpLayers || allowLazyQueueing) { - // log('queue ele %s in layer %s', ele.id(), layer.id); - self.queueLayer(layer, ele); - } else { - // log('draw ele %s in layer %s', ele.id(), layer.id); - self.drawEleInLayer(layer, ele, lvl, pxRatio); - } - - layer.eles.push(ele); - - caches[lvl] = layer; - } - - // log('--'); - - if (tmpLayers) { - // then we only queued the current layerset and can't draw it yet - return tmpLayers; - } - - if (allowLazyQueueing) { - // log('lazy queue level', lvl); - return null; - } - - return layers; -}; - -// a layer may want to use an ele cache of a higher level to avoid blurriness -// so the layer level might not equal the ele level -LTCp.getEleLevelForLayerLevel = function (lvl, pxRatio) { - return lvl; -}; - -function imgSmoothing(context, bool) { - if (context.imageSmoothingEnabled != null) { - context.imageSmoothingEnabled = bool; - } else { - context.webkitImageSmoothingEnabled = bool; - context.mozImageSmoothingEnabled = bool; - context.msImageSmoothingEnabled = bool; - } -} - -LTCp.drawEleInLayer = function (layer, ele, lvl, pxRatio) { - var self = this; - var r = this.renderer; - var context = layer.context; - var bb = ele.boundingBox(); - - if (bb.w === 0 || bb.h === 0 || !ele.visible()) { - return; - } - - var eleCache = self.eleTxrCache; - var reason = useHighQualityEleTxrReqs ? eleCache.reasons.highQuality : undefined; - - lvl = self.getEleLevelForLayerLevel(lvl, pxRatio); - - var cache = useEleTxrCaching ? eleCache.getElement(ele, bb, null, lvl, reason) : null; - - if (cache) { - if (disableEleImgSmoothing) { - imgSmoothing(context, false); - } - - context.drawImage(cache.texture.canvas, cache.x, 0, cache.width, cache.height, bb.x1, bb.y1, bb.w, bb.h); - - if (disableEleImgSmoothing) { - imgSmoothing(context, true); - } - } else { - // if the element is not cacheable, then draw directly - r.drawElement(context, ele); - } -}; - -LTCp.levelIsComplete = function (lvl, eles) { - var self = this; - var layers = self.layersByLevel[lvl]; - - if (!layers || layers.length === 0) { - return false; - } - - var numElesInLayers = 0; - - for (var i = 0; i < layers.length; i++) { - var layer = layers[i]; - - // if there are any eles needed to be drawn yet, the level is not complete - if (layer.reqs > 0) { - return false; - } - - // if the layer is invalid, the level is not complete - if (layer.invalid) { - return false; - } - - numElesInLayers += layer.eles.length; - } - - // we should have exactly the number of eles passed in to be complete - if (numElesInLayers !== eles.length) { - return false; - } - - return true; -}; - -LTCp.validateLayersElesOrdering = function (lvl, eles) { - var layers = this.layersByLevel[lvl]; - - if (!layers) { - return; - } - - // if in a layer the eles are not in the same order, then the layer is invalid - // (i.e. there is an ele in between the eles in the layer) - - for (var i = 0; i < layers.length; i++) { - var layer = layers[i]; - var offset = -1; - - // find the offset - for (var j = 0; j < eles.length; j++) { - if (layer.eles[0] === eles[j]) { - offset = j; - break; - } - } - - if (offset < 0) { - // then the layer has nonexistant elements and is invalid - this.invalidateLayer(layer); - continue; - } - - // the eles in the layer must be in the same continuous order, else the layer is invalid - - var o = offset; - - for (var j = 0; j < layer.eles.length; j++) { - if (layer.eles[j] !== eles[o + j]) { - // log('invalidate based on ordering', layer.id); - - this.invalidateLayer(layer); - break; - } - } - } -}; - -LTCp.updateElementsInLayers = function (eles, update) { - var self = this; - var isEles = is.element(eles[0]); - - // collect udpated elements (cascaded from the layers) and update each - // layer itself along the way - for (var i = 0; i < eles.length; i++) { - var req = isEles ? null : eles[i]; - var ele = isEles ? eles[i] : eles[i].ele; - var rs = ele._private.rscratch; - var caches = rs.imgLayerCaches = rs.imgLayerCaches || {}; - - for (var l = minLvl; l <= maxLvl; l++) { - var layer = caches[l]; - - if (!layer) { - continue; - } - - // if update is a request from the ele cache, then it affects only - // the matching level - if (req && self.getEleLevelForLayerLevel(layer.level) !== req.level) { - continue; - } - - update(layer, ele, req); - } - } -}; - -LTCp.haveLayers = function () { - var self = this; - var haveLayers = false; - - for (var l = minLvl; l <= maxLvl; l++) { - var layers = self.layersByLevel[l]; - - if (layers && layers.length > 0) { - haveLayers = true; - break; - } - } - - return haveLayers; -}; - -LTCp.invalidateElements = function (eles) { - var self = this; - - self.lastInvalidationTime = util.performanceNow(); - - // log('update invalidate layer time from eles'); - - if (eles.length === 0 || !self.haveLayers()) { - return; - } - - self.updateElementsInLayers(eles, function invalAssocLayers(layer, ele, req) { - self.invalidateLayer(layer); - }); -}; - -LTCp.invalidateLayer = function (layer) { - // log('update invalidate layer time'); - - this.lastInvalidationTime = util.performanceNow(); - - if (layer.invalid) { - return; - } // save cycles - - var lvl = layer.level; - var eles = layer.eles; - var layers = this.layersByLevel[lvl]; - - // log('invalidate layer', layer.id ); - - util.removeFromArray(layers, layer); - // layer.eles = []; - - layer.elesQueue = []; - - layer.invalid = true; - - if (layer.replacement) { - layer.replacement.invalid = true; - } - - for (var i = 0; i < eles.length; i++) { - var caches = eles[i]._private.rscratch.imgLayerCaches; - - if (caches) { - caches[lvl] = null; - } - } -}; - -LTCp.refineElementTextures = function (eles) { - var self = this; - - // log('refine', eles.length); - - self.updateElementsInLayers(eles, function refineEachEle(layer, ele, req) { - var rLyr = layer.replacement; - - if (!rLyr) { - rLyr = layer.replacement = self.makeLayer(layer.bb, layer.level); - rLyr.replaces = layer; - rLyr.eles = layer.eles; - - // log('make replacement layer %s for %s with level %s', rLyr.id, layer.id, rLyr.level); - } - - if (!rLyr.reqs) { - for (var i = 0; i < rLyr.eles.length; i++) { - self.queueLayer(rLyr, rLyr.eles[i]); - } - - // log('queue replacement layer refinement', rLyr.id); - } - }); -}; - -LTCp.setupEleCacheInvalidation = function () { - var self = this; - var eleDeqs = []; - - if (!useEleTxrCaching) { - return; - } - - var updatedElesInLayers = util.debounce(function () { - self.refineElementTextures(eleDeqs); - - eleDeqs = []; - }, refineEleDebounceTime); - - self.eleTxrCache.onDequeue(function (reqs) { - for (var i = 0; i < reqs.length; i++) { - eleDeqs.push(reqs[i]); - } - - updatedElesInLayers(); - }); -}; - -LTCp.queueLayer = function (layer, ele) { - var self = this; - var q = self.layersQueue; - var elesQ = layer.elesQueue; - var hasId = elesQ.hasId = elesQ.hasId || {}; - - // if a layer is going to be replaced, queuing is a waste of time - if (layer.replacement) { - return; - } - - if (ele) { - if (hasId[ele.id()]) { - return; - } - - elesQ.push(ele); - hasId[ele.id()] = true; - } - - if (layer.reqs) { - layer.reqs++; - - q.updateItem(layer); - } else { - layer.reqs = 1; - - q.push(layer); - } -}; - -LTCp.dequeue = function (pxRatio) { - var self = this; - var q = self.layersQueue; - var deqd = []; - var eleDeqs = 0; - - while (eleDeqs < maxDeqSize) { - if (q.size() === 0) { - break; - } - - var layer = q.peek(); - - // if a layer has been or will be replaced, then don't waste time with it - if (layer.replacement) { - // log('layer %s in queue skipped b/c it already has a replacement', layer.id); - q.pop(); - continue; - } - - // if this is a replacement layer that has been superceded, then forget it - if (layer.replaces && layer !== layer.replaces.replacement) { - // log('layer is no longer the most uptodate replacement; dequeued', layer.id) - q.pop(); - continue; - } - - if (layer.invalid) { - // log('replacement layer %s is invalid; dequeued', layer.id); - q.pop(); - continue; - } - - var ele = layer.elesQueue.shift(); - - if (ele) { - // log('dequeue layer %s', layer.id); - - self.drawEleInLayer(layer, ele, layer.level, pxRatio); - - eleDeqs++; - } - - if (deqd.length === 0) { - // we need only one entry in deqd to queue redrawing etc - deqd.push(true); - } - - // if the layer has all its eles done, then remove from the queue - if (layer.elesQueue.length === 0) { - q.pop(); - - layer.reqs = 0; - - // log('dequeue of layer %s complete', layer.id); - - // when a replacement layer is dequeued, it replaces the old layer in the level - if (layer.replaces) { - self.applyLayerReplacement(layer); - } - - self.requestRedraw(); - } - } - - return deqd; -}; - -LTCp.applyLayerReplacement = function (layer) { - var self = this; - var layersInLevel = self.layersByLevel[layer.level]; - var replaced = layer.replaces; - var index = layersInLevel.indexOf(replaced); - - // if the replaced layer is not in the active list for the level, then replacing - // refs would be a mistake (i.e. overwriting the true active layer) - if (index < 0 || replaced.invalid) { - // log('replacement layer would have no effect', layer.id); - return; - } - - layersInLevel[index] = layer; // replace level ref - - // replace refs in eles - for (var i = 0; i < layer.eles.length; i++) { - var _p = layer.eles[i]._private; - var cache = _p.imgLayerCaches = _p.imgLayerCaches || {}; - - if (cache) { - cache[layer.level] = layer; - } - } - - // log('apply replacement layer %s over %s', layer.id, replaced.id); - - self.requestRedraw(); -}; - -LTCp.requestRedraw = util.debounce(function () { - var r = this.renderer; - - r.redrawHint('eles', true); - r.redrawHint('drag', true); - r.redraw(); -}, 100); - -LTCp.setupDequeueing = defs.setupDequeueing({ - deqRedrawThreshold: deqRedrawThreshold, - deqCost: deqCost, - deqAvgCost: deqAvgCost, - deqNoDrawCost: deqNoDrawCost, - deqFastCost: deqFastCost, - deq: function deq(self, pxRatio) { - return self.dequeue(pxRatio); - }, - onDeqd: util.noop, - shouldRedraw: util.trueify, - priority: function priority(self) { - return self.renderer.beforeRenderPriorities.lyrTxrDeq; - } -}); - -module.exports = LayeredTextureCache; - -/***/ }), -/* 127 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var CRp = {}; - -var impl; - -CRp.arrowShapeImpl = function (name) { - return (impl || (impl = { - 'polygon': function polygon(context, points) { - for (var i = 0; i < points.length; i++) { - var pt = points[i]; - - context.lineTo(pt.x, pt.y); - } - }, - - 'triangle-backcurve': function triangleBackcurve(context, points, controlPoint) { - var firstPt; - - for (var i = 0; i < points.length; i++) { - var pt = points[i]; - - if (i === 0) { - firstPt = pt; - } - - context.lineTo(pt.x, pt.y); - } - - context.quadraticCurveTo(controlPoint.x, controlPoint.y, firstPt.x, firstPt.y); - }, - - 'triangle-tee': function triangleTee(context, trianglePoints, teePoints) { - if (context.beginPath) { - context.beginPath(); - } - - var triPts = trianglePoints; - for (var i = 0; i < triPts.length; i++) { - var pt = triPts[i]; - - context.lineTo(pt.x, pt.y); - } - - if (context.closePath) { - context.closePath(); - } - - if (context.beginPath) { - context.beginPath(); - } - - var teePts = teePoints; - var firstTeePt = teePoints[0]; - context.moveTo(firstTeePt.x, firstTeePt.y); - - for (var i = 0; i < teePts.length; i++) { - var pt = teePts[i]; - - context.lineTo(pt.x, pt.y); - } - if (context.closePath) { - context.closePath(); - } - }, - - 'triangle-cross': function triangleCross(context, trianglePoints, crossLinePoints) { - if (context.beginPath) { - context.beginPath(); - } - - var triPts = trianglePoints; - for (var i = 0; i < triPts.length; i++) { - var pt = triPts[i]; - - context.lineTo(pt.x, pt.y); - } - - if (context.closePath) { - context.closePath(); - } - - if (context.beginPath) { - context.beginPath(); - } - - var teePts = crossLinePoints; - var firstTeePt = crossLinePoints[0]; - context.moveTo(firstTeePt.x, firstTeePt.y); - - for (var i = 0; i < teePts.length; i++) { - var pt = teePts[i]; - - context.lineTo(pt.x, pt.y); - } - if (context.closePath) { - context.closePath(); - } - }, - - 'circle': function circle(context, rx, ry, r) { - context.arc(rx, ry, r, 0, Math.PI * 2, false); - } - }))[name]; -}; - -module.exports = CRp; - -/***/ }), -/* 128 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var math = __webpack_require__(2); - -var CRp = {}; - -CRp.drawElement = function (context, ele, shiftToOriginWithBb, showLabel) { - var r = this; - - if (ele.isNode()) { - r.drawNode(context, ele, shiftToOriginWithBb, showLabel); - } else { - r.drawEdge(context, ele, shiftToOriginWithBb, showLabel); - } -}; - -CRp.drawCachedElement = function (context, ele, pxRatio, extent) { - var r = this; - var bb = ele.boundingBox(); - - if (bb.w === 0 || bb.h === 0) { - return; - } - - if (!extent || math.boundingBoxesIntersect(bb, extent)) { - var cache = r.data.eleTxrCache.getElement(ele, bb, pxRatio); - - if (cache != null) { - context.drawImage(cache.texture.canvas, cache.x, 0, cache.width, cache.height, bb.x1, bb.y1, bb.w, bb.h); - } else { - // if the element is not cacheable, then draw directly - r.drawElement(context, ele); - } - } -}; - -CRp.drawElements = function (context, eles) { - var r = this; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - - r.drawElement(context, ele); - } -}; - -CRp.drawCachedElements = function (context, eles, pxRatio, extent) { - var r = this; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - - r.drawCachedElement(context, ele, pxRatio, extent); - } -}; - -CRp.drawCachedNodes = function (context, eles, pxRatio, extent) { - var r = this; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - - if (!ele.isNode()) { - continue; - } - - r.drawCachedElement(context, ele, pxRatio, extent); - } -}; - -CRp.drawLayeredElements = function (context, eles, pxRatio, extent) { - var r = this; - - var layers = r.data.lyrTxrCache.getLayers(eles, pxRatio); - - if (layers) { - for (var i = 0; i < layers.length; i++) { - var layer = layers[i]; - var bb = layer.bb; - - if (bb.w === 0 || bb.h === 0) { - continue; - } - - context.drawImage(layer.canvas, bb.x1, bb.y1, bb.w, bb.h); - } - } else { - // fall back on plain caching if no layers - r.drawCachedElements(context, eles, pxRatio, extent); - } -}; - -CRp.drawDebugPoints = function (context, eles) { - var draw = function draw(x, y, color) { - context.fillStyle = color; - context.fillRect(x - 1, y - 1, 3, 3); - }; - - for (var i = 0; i < eles.length; i++) { - var ele = eles[i]; - var rs = ele._private.rscratch; - - if (ele.isNode()) { - var p = ele.position(); - - draw(p.x, p.y, 'magenta'); - } else { - var pts = rs.allpts; - - for (var j = 0; j + 1 < pts.length; j += 2) { - var x = pts[j]; - var y = pts[j + 1]; - - draw(x, y, 'cyan'); - } - - draw(rs.midX, rs.midY, 'yellow'); - } - } -}; - -module.exports = CRp; - -/***/ }), -/* 129 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var CRp = {}; - -CRp.drawEdge = function (context, edge, shiftToOriginWithBb, drawLabel) { - var r = this; - var rs = edge._private.rscratch; - var usePaths = r.usePaths(); - - if (!edge.visible()) { - return; - } - - // if bezier ctrl pts can not be calculated, then die - if (rs.badLine || rs.allpts == null || isNaN(rs.allpts[0])) { - // isNaN in case edge is impossible and browser bugs (e.g. safari) - return; - } - - var bb = void 0; - if (shiftToOriginWithBb) { - bb = shiftToOriginWithBb; - - context.translate(-bb.x1, -bb.y1); - } - - var overlayPadding = edge.pstyle('overlay-padding').pfValue; - var overlayWidth = 2 * overlayPadding; - var overlayOpacity = edge.pstyle('overlay-opacity').value; - var overlayColor = edge.pstyle('overlay-color').value; - var lineColor = edge.pstyle('line-color').value; - var opacity = edge.pstyle('opacity').value; - var lineStyle = edge.pstyle('line-style').value; - var edgeWidth = edge.pstyle('width').pfValue; - - var drawLine = function drawLine() { - var strokeOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : opacity; - - context.lineWidth = edgeWidth; - context.lineCap = 'butt'; - - r.strokeStyle(context, lineColor[0], lineColor[1], lineColor[2], strokeOpacity); - - r.drawEdgePath(edge, context, rs.allpts, lineStyle); - }; - - var drawOverlay = function drawOverlay() { - var strokeOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : overlayOpacity; - - context.lineWidth = overlayWidth; - - if (rs.edgeType === 'self' && !usePaths) { - context.lineCap = 'butt'; - } else { - context.lineCap = 'round'; - } - - r.strokeStyle(context, overlayColor[0], overlayColor[1], overlayColor[2], strokeOpacity); - - r.drawEdgePath(edge, context, rs.allpts, 'solid'); - }; - - var drawArrows = function drawArrows() { - var arrowOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : opacity; - - r.drawArrowheads(context, edge, arrowOpacity); - }; - - var drawText = function drawText() { - r.drawElementText(context, edge, drawLabel); - }; - - context.lineJoin = 'round'; - - var ghost = edge.pstyle('ghost').value === 'yes'; - - if (ghost) { - var gx = edge.pstyle('ghost-offset-x').pfValue; - var gy = edge.pstyle('ghost-offset-y').pfValue; - var ghostOpacity = edge.pstyle('ghost-opacity').value; - var effectiveGhostOpacity = opacity * ghostOpacity; - - context.translate(gx, gy); - - drawLine(effectiveGhostOpacity); - drawArrows(effectiveGhostOpacity); - - context.translate(-gx, -gy); - } - - drawLine(); - drawArrows(); - drawOverlay(); - drawText(); - - if (shiftToOriginWithBb) { - context.translate(bb.x1, bb.y1); - } -}; - -CRp.drawEdgePath = function (edge, context, pts, type) { - var rs = edge._private.rscratch; - var canvasCxt = context; - var path = void 0; - var pathCacheHit = false; - var usePaths = this.usePaths(); - - if (usePaths) { - var pathCacheKey = pts.join('$'); - var keyMatches = rs.pathCacheKey && rs.pathCacheKey === pathCacheKey; - - if (keyMatches) { - path = context = rs.pathCache; - pathCacheHit = true; - } else { - path = context = new Path2D(); // eslint-disable-line no-undef - rs.pathCacheKey = pathCacheKey; - rs.pathCache = path; - } - } - - if (canvasCxt.setLineDash) { - // for very outofdate browsers - switch (type) { - case 'dotted': - canvasCxt.setLineDash([1, 1]); - break; - - case 'dashed': - canvasCxt.setLineDash([6, 3]); - break; - - case 'solid': - canvasCxt.setLineDash([]); - break; - } - } - - if (!pathCacheHit && !rs.badLine) { - if (context.beginPath) { - context.beginPath(); - } - context.moveTo(pts[0], pts[1]); - - switch (rs.edgeType) { - case 'bezier': - case 'self': - case 'compound': - case 'multibezier': - for (var i = 2; i + 3 < pts.length; i += 4) { - context.quadraticCurveTo(pts[i], pts[i + 1], pts[i + 2], pts[i + 3]); - } - break; - - case 'straight': - case 'segments': - case 'haystack': - for (var _i = 2; _i + 1 < pts.length; _i += 2) { - context.lineTo(pts[_i], pts[_i + 1]); - } - break; - } - } - - context = canvasCxt; - if (usePaths) { - context.stroke(path); - } else { - context.stroke(); - } - - // reset any line dashes - if (context.setLineDash) { - // for very outofdate browsers - context.setLineDash([]); - } -}; - -CRp.drawArrowheads = function (context, edge, opacity) { - var rs = edge._private.rscratch; - var isHaystack = rs.edgeType === 'haystack'; - - if (!isHaystack) { - this.drawArrowhead(context, edge, 'source', rs.arrowStartX, rs.arrowStartY, rs.srcArrowAngle, opacity); - } - - this.drawArrowhead(context, edge, 'mid-target', rs.midX, rs.midY, rs.midtgtArrowAngle, opacity); - - this.drawArrowhead(context, edge, 'mid-source', rs.midX, rs.midY, rs.midsrcArrowAngle, opacity); - - if (!isHaystack) { - this.drawArrowhead(context, edge, 'target', rs.arrowEndX, rs.arrowEndY, rs.tgtArrowAngle, opacity); - } -}; - -CRp.drawArrowhead = function (context, edge, prefix, x, y, angle, opacity) { - if (isNaN(x) || x == null || isNaN(y) || y == null || isNaN(angle) || angle == null) { - return; - } - - var self = this; - var arrowShape = edge.pstyle(prefix + '-arrow-shape').value; - if (arrowShape === 'none') { - return; - } - - var arrowClearFill = edge.pstyle(prefix + '-arrow-fill').value === 'hollow' ? 'both' : 'filled'; - var arrowFill = edge.pstyle(prefix + '-arrow-fill').value; - var edgeWidth = edge.pstyle('width').pfValue; - var edgeOpacity = edge.pstyle('opacity').value; - - if (opacity === undefined) { - opacity = edgeOpacity; - } - - var gco = context.globalCompositeOperation; - - if (opacity !== 1 || arrowFill === 'hollow') { - // then extra clear is needed - context.globalCompositeOperation = 'destination-out'; - - self.fillStyle(context, 255, 255, 255, 1); - self.strokeStyle(context, 255, 255, 255, 1); - - self.drawArrowShape(edge, prefix, context, arrowClearFill, edgeWidth, arrowShape, x, y, angle); - - context.globalCompositeOperation = gco; - } // otherwise, the opaque arrow clears it for free :) - - var color = edge.pstyle(prefix + '-arrow-color').value; - self.fillStyle(context, color[0], color[1], color[2], opacity); - self.strokeStyle(context, color[0], color[1], color[2], opacity); - - self.drawArrowShape(edge, prefix, context, arrowFill, edgeWidth, arrowShape, x, y, angle); -}; - -CRp.drawArrowShape = function (edge, arrowType, context, fill, edgeWidth, shape, x, y, angle) { - var r = this; - var usePaths = this.usePaths(); - var rs = edge._private.rscratch; - var pathCacheHit = false; - var path = void 0; - var canvasContext = context; - var translation = { x: x, y: y }; - var scale = edge.pstyle('arrow-scale').value; - var size = this.getArrowWidth(edgeWidth, scale); - var shapeImpl = r.arrowShapes[shape]; - - if (usePaths) { - var pathCacheKey = size + '$' + shape + '$' + angle + '$' + x + '$' + y; - rs.arrowPathCacheKey = rs.arrowPathCacheKey || {}; - rs.arrowPathCache = rs.arrowPathCache || {}; - - var alreadyCached = rs.arrowPathCacheKey[arrowType] === pathCacheKey; - if (alreadyCached) { - path = context = rs.arrowPathCache[arrowType]; - pathCacheHit = true; - } else { - path = context = new Path2D(); // eslint-disable-line no-undef - rs.arrowPathCacheKey[arrowType] = pathCacheKey; - rs.arrowPathCache[arrowType] = path; - } - } - - if (context.beginPath) { - context.beginPath(); - } - - if (!pathCacheHit) { - shapeImpl.draw(context, size, angle, translation, edgeWidth); - } - - if (!shapeImpl.leavePathOpen && context.closePath) { - context.closePath(); - } - - context = canvasContext; - - if (fill === 'filled' || fill === 'both') { - if (usePaths) { - context.fill(path); - } else { - context.fill(); - } - } - - if (fill === 'hollow' || fill === 'both') { - context.lineWidth = shapeImpl.matchEdgeWidth ? edgeWidth : 1; - context.lineJoin = 'miter'; - - if (usePaths) { - context.stroke(path); - } else { - context.stroke(); - } - } -}; - -module.exports = CRp; - -/***/ }), -/* 130 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var CRp = {}; - -CRp.safeDrawImage = function (context, img, ix, iy, iw, ih, x, y, w, h) { - var r = this; - - // detect problematic cases for old browsers with bad images (cheaper than try-catch) - if (iw <= 0 || ih <= 0 || w <= 0 || h <= 0) { - return; - } - - context.drawImage(img, ix, iy, iw, ih, x, y, w, h); -}; - -CRp.drawInscribedImage = function (context, img, node, index, nodeOpacity) { - var r = this; - var pos = node.position(); - var nodeX = pos.x; - var nodeY = pos.y; - var styleObj = node.cy().style(); - var getIndexedStyle = styleObj.getIndexedStyle.bind(styleObj); - var fit = getIndexedStyle(node, 'background-fit', 'value', index); - var repeat = getIndexedStyle(node, 'background-repeat', 'value', index); - var nodeW = node.width(); - var nodeH = node.height(); - var paddingX2 = node.padding() * 2; - var nodeTW = nodeW + (getIndexedStyle(node, 'background-width-relative-to', 'value', index) === 'inner' ? 0 : paddingX2); - var nodeTH = nodeH + (getIndexedStyle(node, 'background-height-relative-to', 'value', index) === 'inner' ? 0 : paddingX2); - var rs = node._private.rscratch; - var clip = node.pstyle('background-clip').value; - var shouldClip = clip === 'node'; - var imgOpacity = getIndexedStyle(node, 'background-image-opacity', 'value', index) * nodeOpacity; - - var imgW = img.width || img.cachedW; - var imgH = img.height || img.cachedH; - - // workaround for broken browsers like ie - if (null == imgW || null == imgH) { - document.body.appendChild(img); // eslint-disable-line no-undef - - imgW = img.cachedW = img.width || img.offsetWidth; - imgH = img.cachedH = img.height || img.offsetHeight; - - document.body.removeChild(img); // eslint-disable-line no-undef - } - - var w = imgW; - var h = imgH; - - if (getIndexedStyle(node, 'background-width', 'value', index) !== 'auto') { - if (getIndexedStyle(node, 'background-width', 'units', index) === '%') { - w = getIndexedStyle(node, 'background-width', 'pfValue', index) * nodeTW; - } else { - w = getIndexedStyle(node, 'background-width', 'pfValue', index); - } - } - - if (getIndexedStyle(node, 'background-height', 'value', index) !== 'auto') { - if (getIndexedStyle(node, 'background-height', 'units', index) === '%') { - h = getIndexedStyle(node, 'background-height', 'pfValue', index) * nodeTH; - } else { - h = getIndexedStyle(node, 'background-height', 'pfValue', index); - } - } - - if (w === 0 || h === 0) { - return; // no point in drawing empty image (and chrome is broken in this case) - } - - if (fit === 'contain') { - var scale = Math.min(nodeTW / w, nodeTH / h); - - w *= scale; - h *= scale; - } else if (fit === 'cover') { - var scale = Math.max(nodeTW / w, nodeTH / h); - - w *= scale; - h *= scale; - } - - var x = nodeX - nodeTW / 2; // left - if (getIndexedStyle(node, 'background-position-x', 'units', index) === '%') { - x += (nodeTW - w) * getIndexedStyle(node, 'background-position-x', 'pfValue', index); - } else { - x += getIndexedStyle(node, 'background-position-x', 'pfValue', index); - } - - var y = nodeY - nodeTH / 2; // top - if (getIndexedStyle(node, 'background-position-y', 'units', index) === '%') { - y += (nodeTH - h) * getIndexedStyle(node, 'background-position-y', 'pfValue', index); - } else { - y += getIndexedStyle(node, 'background-position-y', 'pfValue', index); - } - - if (rs.pathCache) { - x -= nodeX; - y -= nodeY; - - nodeX = 0; - nodeY = 0; - } - - var gAlpha = context.globalAlpha; - - context.globalAlpha = imgOpacity; - - if (repeat === 'no-repeat') { - - if (shouldClip) { - context.save(); - - if (rs.pathCache) { - context.clip(rs.pathCache); - } else { - r.nodeShapes[r.getNodeShape(node)].draw(context, nodeX, nodeY, nodeTW, nodeTH); - - context.clip(); - } - } - - r.safeDrawImage(context, img, 0, 0, imgW, imgH, x, y, w, h); - - if (shouldClip) { - context.restore(); - } - } else { - var pattern = context.createPattern(img, repeat); - context.fillStyle = pattern; - - r.nodeShapes[r.getNodeShape(node)].draw(context, nodeX, nodeY, nodeTW, nodeTH); - - context.translate(x, y); - context.fill(); - context.translate(-x, -y); - } - - context.globalAlpha = gAlpha; -}; - -module.exports = CRp; - -/***/ }), -/* 131 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var util = __webpack_require__(1); -var math = __webpack_require__(2); - -var CRp = {}; - -CRp.eleTextBiggerThanMin = function (ele, scale) { - if (!scale) { - var zoom = ele.cy().zoom(); - var pxRatio = this.getPixelRatio(); - var lvl = Math.ceil(math.log2(zoom * pxRatio)); // the effective texture level - - scale = Math.pow(2, lvl); - } - - var computedSize = ele.pstyle('font-size').pfValue * scale; - var minSize = ele.pstyle('min-zoomed-font-size').pfValue; - - if (computedSize < minSize) { - return false; - } - - return true; -}; - -CRp.drawElementText = function (context, ele, force) { - var r = this; - - if (force === undefined) { - if (!r.eleTextBiggerThanMin(ele)) { - return; - } - } else { - if (!force) { - return; - } - } - - if (ele.isNode()) { - var label = ele.pstyle('label'); - - if (!label || !label.value) { - return; - } - - var textHalign = ele.pstyle('text-halign').strValue; - var textValign = ele.pstyle('text-valign').strValue; - - switch (textHalign) { - case 'left': - context.textAlign = 'right'; - break; - - case 'right': - context.textAlign = 'left'; - break; - - default: - // e.g. center - context.textAlign = 'center'; - } - - context.textBaseline = 'bottom'; - } else { - var label = ele.pstyle('label'); - var srcLabel = ele.pstyle('source-label'); - var tgtLabel = ele.pstyle('target-label'); - - if ((!label || !label.value) && (!srcLabel || !srcLabel.value) && (!tgtLabel || !tgtLabel.value)) { - return; - } - - context.textAlign = 'center'; - context.textBaseline = 'bottom'; - } - - r.drawText(context, ele); - - if (ele.isEdge()) { - r.drawText(context, ele, 'source'); - - r.drawText(context, ele, 'target'); - } -}; - -CRp.drawNodeText = CRp.drawEdgeText = CRp.drawElementText; - -CRp.getFontCache = function (context) { - var cache; - - this.fontCaches = this.fontCaches || []; - - for (var i = 0; i < this.fontCaches.length; i++) { - cache = this.fontCaches[i]; - - if (cache.context === context) { - return cache; - } - } - - cache = { - context: context - }; - this.fontCaches.push(cache); - - return cache; -}; - -// set up canvas context with font -// returns transformed text string -CRp.setupTextStyle = function (context, ele) { - // Font style - var parentOpacity = ele.effectiveOpacity(); - var labelStyle = ele.pstyle('font-style').strValue; - var labelSize = ele.pstyle('font-size').pfValue + 'px'; - var labelFamily = ele.pstyle('font-family').strValue; - var labelWeight = ele.pstyle('font-weight').strValue; - var opacity = ele.pstyle('text-opacity').value * ele.pstyle('opacity').value * parentOpacity; - var outlineOpacity = ele.pstyle('text-outline-opacity').value * opacity; - var color = ele.pstyle('color').value; - var outlineColor = ele.pstyle('text-outline-color').value; - - var fontCacheKey = ele._private.fontKey; - var cache = this.getFontCache(context); - - if (cache.key !== fontCacheKey) { - context.font = labelStyle + ' ' + labelWeight + ' ' + labelSize + ' ' + labelFamily; - - cache.key = fontCacheKey; - } - - // Calculate text draw position based on text alignment - - // so text outlines aren't jagged - context.lineJoin = 'round'; - - this.fillStyle(context, color[0], color[1], color[2], opacity); - - this.strokeStyle(context, outlineColor[0], outlineColor[1], outlineColor[2], outlineOpacity); -}; - -function roundRect(ctx, x, y, width, height, radius) { - var radius = radius || 5; - ctx.beginPath(); - ctx.moveTo(x + radius, y); - ctx.lineTo(x + width - radius, y); - ctx.quadraticCurveTo(x + width, y, x + width, y + radius); - ctx.lineTo(x + width, y + height - radius); - ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height); - ctx.lineTo(x + radius, y + height); - ctx.quadraticCurveTo(x, y + height, x, y + height - radius); - ctx.lineTo(x, y + radius); - ctx.quadraticCurveTo(x, y, x + radius, y); - ctx.closePath(); - ctx.fill(); -} - -// Draw text -CRp.drawText = function (context, ele, prefix) { - var _p = ele._private; - var rscratch = _p.rscratch; - var parentOpacity = ele.effectiveOpacity(); - if (parentOpacity === 0 || ele.pstyle('text-opacity').value === 0) { - return; - } - - var textX = util.getPrefixedProperty(rscratch, 'labelX', prefix); - var textY = util.getPrefixedProperty(rscratch, 'labelY', prefix); - var text = this.getLabelText(ele, prefix); - - if (text != null && text !== '' && !isNaN(textX) && !isNaN(textY)) { - this.setupTextStyle(context, ele); - - var pdash = prefix ? prefix + '-' : ''; - var textW = util.getPrefixedProperty(rscratch, 'labelWidth', prefix); - var textH = util.getPrefixedProperty(rscratch, 'labelHeight', prefix); - var textAngle = util.getPrefixedProperty(rscratch, 'labelAngle', prefix); - var marginX = ele.pstyle(pdash + 'text-margin-x').pfValue; - var marginY = ele.pstyle(pdash + 'text-margin-y').pfValue; - - var isEdge = ele.isEdge(); - var isNode = ele.isNode(); - - var halign = ele.pstyle('text-halign').value; - var valign = ele.pstyle('text-valign').value; - - if (isEdge) { - halign = 'center'; - valign = 'center'; - } - - textX += marginX; - textY += marginY; - - var rotation = ele.pstyle(pdash + 'text-rotation'); - var theta; - - if (rotation.strValue === 'autorotate') { - theta = isEdge ? textAngle : 0; - } else if (rotation.strValue === 'none') { - theta = 0; - } else { - theta = rotation.pfValue; - } - - if (theta !== 0) { - var orgTextX = textX; - var orgTextY = textY; - - context.translate(orgTextX, orgTextY); - context.rotate(theta); - - textX = 0; - textY = 0; - } - - switch (valign) { - case 'top': - break; - case 'center': - textY += textH / 2; - break; - case 'bottom': - textY += textH; - break; - } - - var backgroundOpacity = ele.pstyle('text-background-opacity').value; - var borderOpacity = ele.pstyle('text-border-opacity').value; - var textBorderWidth = ele.pstyle('text-border-width').pfValue; - var backgroundPadding = ele.pstyle('text-background-padding').pfValue; - - if (backgroundOpacity > 0 || textBorderWidth > 0 && borderOpacity > 0) { - var bgX = textX - backgroundPadding; - - switch (halign) { - case 'left': - bgX -= textW; - break; - case 'center': - bgX -= textW / 2; - break; - case 'right': - break; - } - - var bgY = textY - textH - backgroundPadding; - var bgW = textW + 2 * backgroundPadding; - var bgH = textH + 2 * backgroundPadding; - - if (backgroundOpacity > 0) { - var textFill = context.fillStyle; - var textBackgroundColor = ele.pstyle('text-background-color').value; - - context.fillStyle = 'rgba(' + textBackgroundColor[0] + ',' + textBackgroundColor[1] + ',' + textBackgroundColor[2] + ',' + backgroundOpacity * parentOpacity + ')'; - var styleShape = ele.pstyle('text-background-shape').strValue; - if (styleShape == 'roundrectangle') { - roundRect(context, bgX, bgY, bgW, bgH, 2); - } else { - context.fillRect(bgX, bgY, bgW, bgH); - } - context.fillStyle = textFill; - } - - if (textBorderWidth > 0 && borderOpacity > 0) { - var textStroke = context.strokeStyle; - var textLineWidth = context.lineWidth; - var textBorderColor = ele.pstyle('text-border-color').value; - var textBorderStyle = ele.pstyle('text-border-style').value; - - context.strokeStyle = 'rgba(' + textBorderColor[0] + ',' + textBorderColor[1] + ',' + textBorderColor[2] + ',' + borderOpacity * parentOpacity + ')'; - context.lineWidth = textBorderWidth; - - if (context.setLineDash) { - // for very outofdate browsers - switch (textBorderStyle) { - case 'dotted': - context.setLineDash([1, 1]); - break; - case 'dashed': - context.setLineDash([4, 2]); - break; - case 'double': - context.lineWidth = textBorderWidth / 4; // 50% reserved for white between the two borders - context.setLineDash([]); - break; - case 'solid': - context.setLineDash([]); - break; - } - } - - context.strokeRect(bgX, bgY, bgW, bgH); - - if (textBorderStyle === 'double') { - var whiteWidth = textBorderWidth / 2; - - context.strokeRect(bgX + whiteWidth, bgY + whiteWidth, bgW - whiteWidth * 2, bgH - whiteWidth * 2); - } - - if (context.setLineDash) { - // for very outofdate browsers - context.setLineDash([]); - } - context.lineWidth = textLineWidth; - context.strokeStyle = textStroke; - } - } - - var lineWidth = 2 * ele.pstyle('text-outline-width').pfValue; // *2 b/c the stroke is drawn centred on the middle - - if (lineWidth > 0) { - context.lineWidth = lineWidth; - } - - if (ele.pstyle('text-wrap').value === 'wrap') { - var lines = util.getPrefixedProperty(rscratch, 'labelWrapCachedLines', prefix); - var lineHeight = textH / lines.length; - - switch (valign) { - case 'top': - textY -= (lines.length - 1) * lineHeight; - break; - case 'center': - case 'bottom': - textY -= (lines.length - 1) * lineHeight; - break; - } - - for (var l = 0; l < lines.length; l++) { - if (lineWidth > 0) { - context.strokeText(lines[l], textX, textY); - } - - context.fillText(lines[l], textX, textY); - - textY += lineHeight; - } - } else { - if (lineWidth > 0) { - context.strokeText(text, textX, textY); - } - - context.fillText(text, textX, textY); - } - - if (theta !== 0) { - context.rotate(-theta); - context.translate(-orgTextX, -orgTextY); - } - } -}; - -module.exports = CRp; - -/***/ }), -/* 132 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/* global Path2D */ - -var is = __webpack_require__(0); - -var CRp = {}; - -CRp.drawNode = function (context, node, shiftToOriginWithBb, drawLabel) { - var r = this; - var nodeWidth = void 0, - nodeHeight = void 0; - var _p = node._private; - var rs = _p.rscratch; - var pos = node.position(); - - if (!is.number(pos.x) || !is.number(pos.y)) { - return; // can't draw node with undefined position - } - - if (!node.visible()) { - return; - } - - var parentOpacity = node.effectiveOpacity(); - - var usePaths = r.usePaths(); - var path = void 0; - var pathCacheHit = false; - - var padding = node.padding(); - - nodeWidth = node.width() + 2 * padding; - nodeHeight = node.height() + 2 * padding; - - // - // setup shift - - var bb = void 0; - if (shiftToOriginWithBb) { - bb = shiftToOriginWithBb; - - context.translate(-bb.x1, -bb.y1); - } - - // - // load bg image - - var bgImgProp = node.pstyle('background-image'); - var urls = bgImgProp.value; - var urlDefined = new Array(urls.length); - var image = new Array(urls.length); - var numImages = 0; - for (var i = 0; i < urls.length; i++) { - var url = urls[i]; - var defd = urlDefined[i] = url != null && url !== 'none'; - - if (defd) { - var bgImgCrossOrigin = node.cy().style().getIndexedStyle(node, 'background-image-crossorigin', 'value', i); - - numImages++; - - // get image, and if not loaded then ask to redraw when later loaded - image[i] = r.getCachedImage(url, bgImgCrossOrigin, function () { - node.emitAndNotify('background'); - }); - } - } - - // - // setup styles - - var darkness = node.pstyle('background-blacken').value; - var borderWidth = node.pstyle('border-width').pfValue; - var bgColor = node.pstyle('background-color').value; - var bgOpacity = node.pstyle('background-opacity').value * parentOpacity; - var borderColor = node.pstyle('border-color').value; - var borderStyle = node.pstyle('border-style').value; - var borderOpacity = node.pstyle('border-opacity').value * parentOpacity; - - context.lineJoin = 'miter'; // so borders are square with the node shape - - var setupShapeColor = function setupShapeColor() { - var bgOpy = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : bgOpacity; - - r.fillStyle(context, bgColor[0], bgColor[1], bgColor[2], bgOpy); - }; - - var setupBorderColor = function setupBorderColor() { - var bdrOpy = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : borderOpacity; - - r.strokeStyle(context, borderColor[0], borderColor[1], borderColor[2], bdrOpy); - }; - - // - // setup shape - - var styleShape = node.pstyle('shape').strValue; - var shapePts = node.pstyle('shape-polygon-points').pfValue; - - if (usePaths) { - var pathCacheKey = styleShape + '$' + nodeWidth + '$' + nodeHeight + (styleShape === 'polygon' ? '$' + shapePts.join('$') : ''); - - context.translate(pos.x, pos.y); - - if (rs.pathCacheKey === pathCacheKey) { - path = rs.pathCache; - pathCacheHit = true; - } else { - path = new Path2D(); - rs.pathCacheKey = pathCacheKey; - rs.pathCache = path; - } - } - - var drawShape = function drawShape() { - if (!pathCacheHit) { - - var npos = pos; - - if (usePaths) { - npos = { - x: 0, - y: 0 - }; - } - - r.nodeShapes[r.getNodeShape(node)].draw(path || context, npos.x, npos.y, nodeWidth, nodeHeight); - } - - if (usePaths) { - context.fill(path); - } else { - context.fill(); - } - }; - - var drawImages = function drawImages() { - var nodeOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : parentOpacity; - - var prevBging = _p.backgrounding; - var totalCompleted = 0; - - for (var _i = 0; _i < image.length; _i++) { - if (urlDefined[_i] && image[_i].complete && !image[_i].error) { - totalCompleted++; - r.drawInscribedImage(context, image[_i], node, _i, nodeOpacity); - } - } - - _p.backgrounding = !(totalCompleted === numImages); - if (prevBging !== _p.backgrounding) { - // update style b/c :backgrounding state changed - node.updateStyle(false); - } - }; - - var drawPie = function drawPie() { - var redrawShape = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - var pieOpacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : parentOpacity; - - if (r.hasPie(node)) { - r.drawPie(context, node, pieOpacity); - - // redraw/restore path if steps after pie need it - if (redrawShape) { - - if (!usePaths) { - r.nodeShapes[r.getNodeShape(node)].draw(context, pos.x, pos.y, nodeWidth, nodeHeight); - } - } - } - }; - - var darken = function darken() { - var darkenOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : parentOpacity; - - var opacity = (darkness > 0 ? darkness : -darkness) * darkenOpacity; - var c = darkness > 0 ? 0 : 255; - - if (darkness !== 0) { - r.fillStyle(context, c, c, c, opacity); - - if (usePaths) { - context.fill(path); - } else { - context.fill(); - } - } - }; - - var drawBorder = function drawBorder() { - if (borderWidth > 0) { - - context.lineWidth = borderWidth; - context.lineCap = 'butt'; - - if (context.setLineDash) { - // for very outofdate browsers - switch (borderStyle) { - case 'dotted': - context.setLineDash([1, 1]); - break; - - case 'dashed': - context.setLineDash([4, 2]); - break; - - case 'solid': - case 'double': - context.setLineDash([]); - break; - } - } - - if (usePaths) { - context.stroke(path); - } else { - context.stroke(); - } - - if (borderStyle === 'double') { - context.lineWidth = borderWidth / 3; - - var gco = context.globalCompositeOperation; - context.globalCompositeOperation = 'destination-out'; - - if (usePaths) { - context.stroke(path); - } else { - context.stroke(); - } - - context.globalCompositeOperation = gco; - } - - // reset in case we changed the border style - if (context.setLineDash) { - // for very outofdate browsers - context.setLineDash([]); - } - } - }; - - var drawOverlay = function drawOverlay() { - var overlayPadding = node.pstyle('overlay-padding').pfValue; - var overlayOpacity = node.pstyle('overlay-opacity').value; - var overlayColor = node.pstyle('overlay-color').value; - - if (overlayOpacity > 0) { - r.fillStyle(context, overlayColor[0], overlayColor[1], overlayColor[2], overlayOpacity); - - r.nodeShapes['roundrectangle'].draw(context, pos.x, pos.y, nodeWidth + overlayPadding * 2, nodeHeight + overlayPadding * 2); - - context.fill(); - } - }; - - var drawText = function drawText() { - r.drawElementText(context, node, drawLabel); - }; - - var ghost = node.pstyle('ghost').value === 'yes'; - - if (ghost) { - var gx = node.pstyle('ghost-offset-x').pfValue; - var gy = node.pstyle('ghost-offset-y').pfValue; - var ghostOpacity = node.pstyle('ghost-opacity').value; - var effGhostOpacity = ghostOpacity * parentOpacity; - - context.translate(gx, gy); - - setupShapeColor(ghostOpacity * bgOpacity); - drawShape(); - drawImages(effGhostOpacity); - drawPie(darkness !== 0 || borderWidth !== 0); - darken(effGhostOpacity); - setupBorderColor(ghostOpacity * borderOpacity); - drawBorder(); - - context.translate(-gx, -gy); - } - - setupShapeColor(); - drawShape(); - drawImages(); - drawPie(darkness !== 0 || borderWidth !== 0); - darken(); - setupBorderColor(); - drawBorder(); - - if (usePaths) { - context.translate(-pos.x, -pos.y); - } - - drawText(); - drawOverlay(); - - // - // clean up shift - - if (shiftToOriginWithBb) { - context.translate(bb.x1, bb.y1); - } -}; - -// does the node have at least one pie piece? -CRp.hasPie = function (node) { - node = node[0]; // ensure ele ref - - return node._private.hasPie; -}; - -CRp.drawPie = function (context, node, nodeOpacity, pos) { - node = node[0]; // ensure ele ref - pos = pos || node.position(); - - var cyStyle = node.cy().style(); - var pieSize = node.pstyle('pie-size'); - var x = pos.x; - var y = pos.y; - var nodeW = node.width(); - var nodeH = node.height(); - var radius = Math.min(nodeW, nodeH) / 2; // must fit in node - var lastPercent = 0; // what % to continue drawing pie slices from on [0, 1] - var usePaths = this.usePaths(); - - if (usePaths) { - x = 0; - y = 0; - } - - if (pieSize.units === '%') { - radius = radius * pieSize.pfValue; - } else if (pieSize.pfValue !== undefined) { - radius = pieSize.pfValue / 2; - } - - for (var i = 1; i <= cyStyle.pieBackgroundN; i++) { - // 1..N - var size = node.pstyle('pie-' + i + '-background-size').value; - var color = node.pstyle('pie-' + i + '-background-color').value; - var opacity = node.pstyle('pie-' + i + '-background-opacity').value * nodeOpacity; - var percent = size / 100; // map integer range [0, 100] to [0, 1] - - // percent can't push beyond 1 - if (percent + lastPercent > 1) { - percent = 1 - lastPercent; - } - - var angleStart = 1.5 * Math.PI + 2 * Math.PI * lastPercent; // start at 12 o'clock and go clockwise - var angleDelta = 2 * Math.PI * percent; - var angleEnd = angleStart + angleDelta; - - // ignore if - // - zero size - // - we're already beyond the full circle - // - adding the current slice would go beyond the full circle - if (size === 0 || lastPercent >= 1 || lastPercent + percent > 1) { - continue; - } - - context.beginPath(); - context.moveTo(x, y); - context.arc(x, y, radius, angleStart, angleEnd); - context.closePath(); - - this.fillStyle(context, color[0], color[1], color[2], opacity); - - context.fill(); - - lastPercent += percent; - } -}; - -module.exports = CRp; - -/***/ }), -/* 133 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var CRp = {}; - -var util = __webpack_require__(1); - -var motionBlurDelay = 100; - -// var isFirefox = typeof InstallTrigger !== 'undefined'; - -CRp.getPixelRatio = function () { - var context = this.data.contexts[0]; - - if (this.forcedPixelRatio != null) { - return this.forcedPixelRatio; - } - - var backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1; - - return (window.devicePixelRatio || 1) / backingStore; // eslint-disable-line no-undef -}; - -CRp.paintCache = function (context) { - var caches = this.paintCaches = this.paintCaches || []; - var needToCreateCache = true; - var cache; - - for (var i = 0; i < caches.length; i++) { - cache = caches[i]; - - if (cache.context === context) { - needToCreateCache = false; - break; - } - } - - if (needToCreateCache) { - cache = { - context: context - }; - caches.push(cache); - } - - return cache; -}; - -CRp.fillStyle = function (context, r, g, b, a) { - context.fillStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; - - // turn off for now, seems context does its own caching - - // var cache = this.paintCache(context); - - // var fillStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; - - // if( cache.fillStyle !== fillStyle ){ - // context.fillStyle = cache.fillStyle = fillStyle; - // } -}; - -CRp.strokeStyle = function (context, r, g, b, a) { - context.strokeStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; - - // turn off for now, seems context does its own caching - - // var cache = this.paintCache(context); - - // var strokeStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; - - // if( cache.strokeStyle !== strokeStyle ){ - // context.strokeStyle = cache.strokeStyle = strokeStyle; - // } -}; - -// Resize canvas -CRp.matchCanvasSize = function (container) { - var r = this; - var data = r.data; - var bb = r.findContainerClientCoords(); - var width = bb[2]; - var height = bb[3]; - var pixelRatio = r.getPixelRatio(); - var mbPxRatio = r.motionBlurPxRatio; - - if (container === r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_NODE] || container === r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_DRAG]) { - pixelRatio = mbPxRatio; - } - - var canvasWidth = width * pixelRatio; - var canvasHeight = height * pixelRatio; - var canvas; - - if (canvasWidth === r.canvasWidth && canvasHeight === r.canvasHeight) { - return; // save cycles if same - } - - r.fontCaches = null; // resizing resets the style - - var canvasContainer = data.canvasContainer; - canvasContainer.style.width = width + 'px'; - canvasContainer.style.height = height + 'px'; - - for (var i = 0; i < r.CANVAS_LAYERS; i++) { - canvas = data.canvases[i]; - - canvas.width = canvasWidth; - canvas.height = canvasHeight; - - canvas.style.width = width + 'px'; - canvas.style.height = height + 'px'; - } - - for (var i = 0; i < r.BUFFER_COUNT; i++) { - canvas = data.bufferCanvases[i]; - - canvas.width = canvasWidth; - canvas.height = canvasHeight; - - canvas.style.width = width + 'px'; - canvas.style.height = height + 'px'; - } - - r.textureMult = 1; - if (pixelRatio <= 1) { - canvas = data.bufferCanvases[r.TEXTURE_BUFFER]; - - r.textureMult = 2; - canvas.width = canvasWidth * r.textureMult; - canvas.height = canvasHeight * r.textureMult; - } - - r.canvasWidth = canvasWidth; - r.canvasHeight = canvasHeight; -}; - -CRp.renderTo = function (cxt, zoom, pan, pxRatio) { - this.render({ - forcedContext: cxt, - forcedZoom: zoom, - forcedPan: pan, - drawAllLayers: true, - forcedPxRatio: pxRatio - }); -}; - -CRp.render = function (options) { - options = options || util.staticEmptyObject(); - - var forcedContext = options.forcedContext; - var drawAllLayers = options.drawAllLayers; - var drawOnlyNodeLayer = options.drawOnlyNodeLayer; - var forcedZoom = options.forcedZoom; - var forcedPan = options.forcedPan; - var r = this; - var pixelRatio = options.forcedPxRatio === undefined ? this.getPixelRatio() : options.forcedPxRatio; - var cy = r.cy;var data = r.data; - var needDraw = data.canvasNeedsRedraw; - var textureDraw = r.textureOnViewport && !forcedContext && (r.pinching || r.hoverData.dragging || r.swipePanning || r.data.wheelZooming); - var motionBlur = options.motionBlur !== undefined ? options.motionBlur : r.motionBlur; - var mbPxRatio = r.motionBlurPxRatio; - var hasCompoundNodes = cy.hasCompoundNodes(); - var inNodeDragGesture = r.hoverData.draggingEles; - var inBoxSelection = r.hoverData.selecting || r.touchData.selecting ? true : false; - motionBlur = motionBlur && !forcedContext && r.motionBlurEnabled && !inBoxSelection; - var motionBlurFadeEffect = motionBlur; - - if (!forcedContext) { - if (r.prevPxRatio !== pixelRatio) { - r.invalidateContainerClientCoordsCache(); - r.matchCanvasSize(r.container); - - r.redrawHint('eles', true); - r.redrawHint('drag', true); - } - - r.prevPxRatio = pixelRatio; - } - - if (!forcedContext && r.motionBlurTimeout) { - clearTimeout(r.motionBlurTimeout); - } - - if (motionBlur) { - if (r.mbFrames == null) { - r.mbFrames = 0; - } - - r.mbFrames++; - - if (r.mbFrames < 3) { - // need several frames before even high quality motionblur - motionBlurFadeEffect = false; - } - - // go to lower quality blurry frames when several m/b frames have been rendered (avoids flashing) - if (r.mbFrames > r.minMbLowQualFrames) { - //r.fullQualityMb = false; - r.motionBlurPxRatio = r.mbPxRBlurry; - } - } - - if (r.clearingMotionBlur) { - r.motionBlurPxRatio = 1; - } - - // b/c drawToContext() may be async w.r.t. redraw(), keep track of last texture frame - // because a rogue async texture frame would clear needDraw - if (r.textureDrawLastFrame && !textureDraw) { - needDraw[r.NODE] = true; - needDraw[r.SELECT_BOX] = true; - } - - var coreStyle = cy.style()._private.coreStyle; - - var zoom = cy.zoom(); - var effectiveZoom = forcedZoom !== undefined ? forcedZoom : zoom; - var pan = cy.pan(); - var effectivePan = { - x: pan.x, - y: pan.y - }; - - var vp = { - zoom: zoom, - pan: { - x: pan.x, - y: pan.y - } - }; - var prevVp = r.prevViewport; - var viewportIsDiff = prevVp === undefined || vp.zoom !== prevVp.zoom || vp.pan.x !== prevVp.pan.x || vp.pan.y !== prevVp.pan.y; - - // we want the low quality motionblur only when the viewport is being manipulated etc (where it's not noticed) - if (!viewportIsDiff && !(inNodeDragGesture && !hasCompoundNodes)) { - r.motionBlurPxRatio = 1; - } - - if (forcedPan) { - effectivePan = forcedPan; - } - - // apply pixel ratio - - effectiveZoom *= pixelRatio; - effectivePan.x *= pixelRatio; - effectivePan.y *= pixelRatio; - - var eles = r.getCachedZSortedEles(); - - function mbclear(context, x, y, w, h) { - var gco = context.globalCompositeOperation; - - context.globalCompositeOperation = 'destination-out'; - r.fillStyle(context, 255, 255, 255, r.motionBlurTransparency); - context.fillRect(x, y, w, h); - - context.globalCompositeOperation = gco; - } - - function setContextTransform(context, clear) { - var ePan, eZoom, w, h; - - if (!r.clearingMotionBlur && (context === data.bufferContexts[r.MOTIONBLUR_BUFFER_NODE] || context === data.bufferContexts[r.MOTIONBLUR_BUFFER_DRAG])) { - ePan = { - x: pan.x * mbPxRatio, - y: pan.y * mbPxRatio - }; - - eZoom = zoom * mbPxRatio; - - w = r.canvasWidth * mbPxRatio; - h = r.canvasHeight * mbPxRatio; - } else { - ePan = effectivePan; - eZoom = effectiveZoom; - - w = r.canvasWidth; - h = r.canvasHeight; - } - - context.setTransform(1, 0, 0, 1, 0, 0); - - if (clear === 'motionBlur') { - mbclear(context, 0, 0, w, h); - } else if (!forcedContext && (clear === undefined || clear)) { - context.clearRect(0, 0, w, h); - } - - if (!drawAllLayers) { - context.translate(ePan.x, ePan.y); - context.scale(eZoom, eZoom); - } - if (forcedPan) { - context.translate(forcedPan.x, forcedPan.y); - } - if (forcedZoom) { - context.scale(forcedZoom, forcedZoom); - } - } - - if (!textureDraw) { - r.textureDrawLastFrame = false; - } - - if (textureDraw) { - r.textureDrawLastFrame = true; - - var bb; - - if (!r.textureCache) { - r.textureCache = {}; - - bb = r.textureCache.bb = cy.mutableElements().boundingBox(); - - r.textureCache.texture = r.data.bufferCanvases[r.TEXTURE_BUFFER]; - - var cxt = r.data.bufferContexts[r.TEXTURE_BUFFER]; - - cxt.setTransform(1, 0, 0, 1, 0, 0); - cxt.clearRect(0, 0, r.canvasWidth * r.textureMult, r.canvasHeight * r.textureMult); - - r.render({ - forcedContext: cxt, - drawOnlyNodeLayer: true, - forcedPxRatio: pixelRatio * r.textureMult - }); - - var vp = r.textureCache.viewport = { - zoom: cy.zoom(), - pan: cy.pan(), - width: r.canvasWidth, - height: r.canvasHeight - }; - - vp.mpan = { - x: (0 - vp.pan.x) / vp.zoom, - y: (0 - vp.pan.y) / vp.zoom - }; - } - - needDraw[r.DRAG] = false; - needDraw[r.NODE] = false; - - var context = data.contexts[r.NODE]; - - var texture = r.textureCache.texture; - var vp = r.textureCache.viewport; - bb = r.textureCache.bb; - - context.setTransform(1, 0, 0, 1, 0, 0); - - if (motionBlur) { - mbclear(context, 0, 0, vp.width, vp.height); - } else { - context.clearRect(0, 0, vp.width, vp.height); - } - - var outsideBgColor = coreStyle['outside-texture-bg-color'].value; - var outsideBgOpacity = coreStyle['outside-texture-bg-opacity'].value; - r.fillStyle(context, outsideBgColor[0], outsideBgColor[1], outsideBgColor[2], outsideBgOpacity); - context.fillRect(0, 0, vp.width, vp.height); - - var zoom = cy.zoom(); - - setContextTransform(context, false); - - context.clearRect(vp.mpan.x, vp.mpan.y, vp.width / vp.zoom / pixelRatio, vp.height / vp.zoom / pixelRatio); - context.drawImage(texture, vp.mpan.x, vp.mpan.y, vp.width / vp.zoom / pixelRatio, vp.height / vp.zoom / pixelRatio); - } else if (r.textureOnViewport && !forcedContext) { - // clear the cache since we don't need it - r.textureCache = null; - } - - var extent = cy.extent(); - var vpManip = r.pinching || r.hoverData.dragging || r.swipePanning || r.data.wheelZooming || r.hoverData.draggingEles; - var hideEdges = r.hideEdgesOnViewport && vpManip; - - var needMbClear = []; - - needMbClear[r.NODE] = !needDraw[r.NODE] && motionBlur && !r.clearedForMotionBlur[r.NODE] || r.clearingMotionBlur; - if (needMbClear[r.NODE]) { - r.clearedForMotionBlur[r.NODE] = true; - } - - needMbClear[r.DRAG] = !needDraw[r.DRAG] && motionBlur && !r.clearedForMotionBlur[r.DRAG] || r.clearingMotionBlur; - if (needMbClear[r.DRAG]) { - r.clearedForMotionBlur[r.DRAG] = true; - } - - if (needDraw[r.NODE] || drawAllLayers || drawOnlyNodeLayer || needMbClear[r.NODE]) { - var useBuffer = motionBlur && !needMbClear[r.NODE] && mbPxRatio !== 1; - var context = forcedContext || (useBuffer ? r.data.bufferContexts[r.MOTIONBLUR_BUFFER_NODE] : data.contexts[r.NODE]); - var clear = motionBlur && !useBuffer ? 'motionBlur' : undefined; - - setContextTransform(context, clear); - - if (hideEdges) { - r.drawCachedNodes(context, eles.nondrag, pixelRatio, extent); - } else { - r.drawLayeredElements(context, eles.nondrag, pixelRatio, extent); - } - - if (r.debug) { - r.drawDebugPoints(context, eles.nondrag); - } - - if (!drawAllLayers && !motionBlur) { - needDraw[r.NODE] = false; - } - } - - if (!drawOnlyNodeLayer && (needDraw[r.DRAG] || drawAllLayers || needMbClear[r.DRAG])) { - var useBuffer = motionBlur && !needMbClear[r.DRAG] && mbPxRatio !== 1; - var context = forcedContext || (useBuffer ? r.data.bufferContexts[r.MOTIONBLUR_BUFFER_DRAG] : data.contexts[r.DRAG]); - - setContextTransform(context, motionBlur && !useBuffer ? 'motionBlur' : undefined); - - if (hideEdges) { - r.drawCachedNodes(context, eles.drag, pixelRatio, extent); - } else { - r.drawCachedElements(context, eles.drag, pixelRatio, extent); - } - - if (r.debug) { - r.drawDebugPoints(context, eles.drag); - } - - if (!drawAllLayers && !motionBlur) { - needDraw[r.DRAG] = false; - } - } - - if (r.showFps || !drawOnlyNodeLayer && needDraw[r.SELECT_BOX] && !drawAllLayers) { - var context = forcedContext || data.contexts[r.SELECT_BOX]; - - setContextTransform(context); - - if (r.selection[4] == 1 && (r.hoverData.selecting || r.touchData.selecting)) { - var zoom = r.cy.zoom(); - var borderWidth = coreStyle['selection-box-border-width'].value / zoom; - - context.lineWidth = borderWidth; - context.fillStyle = 'rgba(' + coreStyle['selection-box-color'].value[0] + ',' + coreStyle['selection-box-color'].value[1] + ',' + coreStyle['selection-box-color'].value[2] + ',' + coreStyle['selection-box-opacity'].value + ')'; - - context.fillRect(r.selection[0], r.selection[1], r.selection[2] - r.selection[0], r.selection[3] - r.selection[1]); - - if (borderWidth > 0) { - context.strokeStyle = 'rgba(' + coreStyle['selection-box-border-color'].value[0] + ',' + coreStyle['selection-box-border-color'].value[1] + ',' + coreStyle['selection-box-border-color'].value[2] + ',' + coreStyle['selection-box-opacity'].value + ')'; - - context.strokeRect(r.selection[0], r.selection[1], r.selection[2] - r.selection[0], r.selection[3] - r.selection[1]); - } - } - - if (data.bgActivePosistion && !r.hoverData.selecting) { - var zoom = r.cy.zoom(); - var pos = data.bgActivePosistion; - - context.fillStyle = 'rgba(' + coreStyle['active-bg-color'].value[0] + ',' + coreStyle['active-bg-color'].value[1] + ',' + coreStyle['active-bg-color'].value[2] + ',' + coreStyle['active-bg-opacity'].value + ')'; - - context.beginPath(); - context.arc(pos.x, pos.y, coreStyle['active-bg-size'].pfValue / zoom, 0, 2 * Math.PI); - context.fill(); - } - - var timeToRender = r.lastRedrawTime; - if (r.showFps && timeToRender) { - timeToRender = Math.round(timeToRender); - var fps = Math.round(1000 / timeToRender); - - context.setTransform(1, 0, 0, 1, 0, 0); - - context.fillStyle = 'rgba(255, 0, 0, 0.75)'; - context.strokeStyle = 'rgba(255, 0, 0, 0.75)'; - context.lineWidth = 1; - context.fillText('1 frame = ' + timeToRender + ' ms = ' + fps + ' fps', 0, 20); - - var maxFps = 60; - context.strokeRect(0, 30, 250, 20); - context.fillRect(0, 30, 250 * Math.min(fps / maxFps, 1), 20); - } - - if (!drawAllLayers) { - needDraw[r.SELECT_BOX] = false; - } - } - - // motionblur: blit rendered blurry frames - if (motionBlur && mbPxRatio !== 1) { - var cxtNode = data.contexts[r.NODE]; - var txtNode = r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_NODE]; - - var cxtDrag = data.contexts[r.DRAG]; - var txtDrag = r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_DRAG]; - - var drawMotionBlur = function drawMotionBlur(cxt, txt, needClear) { - cxt.setTransform(1, 0, 0, 1, 0, 0); - - if (needClear || !motionBlurFadeEffect) { - cxt.clearRect(0, 0, r.canvasWidth, r.canvasHeight); - } else { - mbclear(cxt, 0, 0, r.canvasWidth, r.canvasHeight); - } - - var pxr = mbPxRatio; - - cxt.drawImage(txt, // img - 0, 0, // sx, sy - r.canvasWidth * pxr, r.canvasHeight * pxr, // sw, sh - 0, 0, // x, y - r.canvasWidth, r.canvasHeight // w, h - ); - }; - - if (needDraw[r.NODE] || needMbClear[r.NODE]) { - drawMotionBlur(cxtNode, txtNode, needMbClear[r.NODE]); - needDraw[r.NODE] = false; - } - - if (needDraw[r.DRAG] || needMbClear[r.DRAG]) { - drawMotionBlur(cxtDrag, txtDrag, needMbClear[r.DRAG]); - needDraw[r.DRAG] = false; - } - } - - r.prevViewport = vp; - - if (r.clearingMotionBlur) { - r.clearingMotionBlur = false; - r.motionBlurCleared = true; - r.motionBlur = true; - } - - if (motionBlur) { - r.motionBlurTimeout = setTimeout(function () { - r.motionBlurTimeout = null; - - r.clearedForMotionBlur[r.NODE] = false; - r.clearedForMotionBlur[r.DRAG] = false; - r.motionBlur = false; - r.clearingMotionBlur = !textureDraw; - r.mbFrames = 0; - - needDraw[r.NODE] = true; - needDraw[r.DRAG] = true; - - r.redraw(); - }, motionBlurDelay); - } - - if (!forcedContext) { - cy.emit('render'); - } -}; - -module.exports = CRp; - -/***/ }), -/* 134 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var math = __webpack_require__(2); - -var CRp = {}; - -// @O Polygon drawing -CRp.drawPolygonPath = function (context, x, y, width, height, points) { - - var halfW = width / 2; - var halfH = height / 2; - - if (context.beginPath) { - context.beginPath(); - } - - context.moveTo(x + halfW * points[0], y + halfH * points[1]); - - for (var i = 1; i < points.length / 2; i++) { - context.lineTo(x + halfW * points[i * 2], y + halfH * points[i * 2 + 1]); - } - - context.closePath(); -}; - -// Round rectangle drawing -CRp.drawRoundRectanglePath = function (context, x, y, width, height) { - - var halfWidth = width / 2; - var halfHeight = height / 2; - var cornerRadius = math.getRoundRectangleRadius(width, height); - - if (context.beginPath) { - context.beginPath(); - } - - // Start at top middle - context.moveTo(x, y - halfHeight); - // Arc from middle top to right side - context.arcTo(x + halfWidth, y - halfHeight, x + halfWidth, y, cornerRadius); - // Arc from right side to bottom - context.arcTo(x + halfWidth, y + halfHeight, x, y + halfHeight, cornerRadius); - // Arc from bottom to left side - context.arcTo(x - halfWidth, y + halfHeight, x - halfWidth, y, cornerRadius); - // Arc from left side to topBorder - context.arcTo(x - halfWidth, y - halfHeight, x, y - halfHeight, cornerRadius); - // Join line - context.lineTo(x, y - halfHeight); - - context.closePath(); -}; - -CRp.drawBottomRoundRectanglePath = function (context, x, y, width, height) { - - var halfWidth = width / 2; - var halfHeight = height / 2; - var cornerRadius = math.getRoundRectangleRadius(width, height); - - if (context.beginPath) { - context.beginPath(); - } - - // Start at top middle - context.moveTo(x, y - halfHeight); - context.lineTo(x + halfWidth, y - halfHeight); - context.lineTo(x + halfWidth, y); - - context.arcTo(x + halfWidth, y + halfHeight, x, y + halfHeight, cornerRadius); - context.arcTo(x - halfWidth, y + halfHeight, x - halfWidth, y, cornerRadius); - - context.lineTo(x - halfWidth, y - halfHeight); - context.lineTo(x, y - halfHeight); - - context.closePath(); -}; - -CRp.drawCutRectanglePath = function (context, x, y, width, height) { - - var halfWidth = width / 2; - var halfHeight = height / 2; - var cornerLength = math.getCutRectangleCornerLength(); - - if (context.beginPath) { - context.beginPath(); - } - - context.moveTo(x - halfWidth + cornerLength, y - halfHeight); - - context.lineTo(x + halfWidth - cornerLength, y - halfHeight); - context.lineTo(x + halfWidth, y - halfHeight + cornerLength); - context.lineTo(x + halfWidth, y + halfHeight - cornerLength); - context.lineTo(x + halfWidth - cornerLength, y + halfHeight); - context.lineTo(x - halfWidth + cornerLength, y + halfHeight); - context.lineTo(x - halfWidth, y + halfHeight - cornerLength); - context.lineTo(x - halfWidth, y - halfHeight + cornerLength); - - context.closePath(); -}; - -CRp.drawBarrelPath = function (context, x, y, width, height) { - - var halfWidth = width / 2; - var halfHeight = height / 2; - - var xBegin = x - halfWidth; - var xEnd = x + halfWidth; - var yBegin = y - halfHeight; - var yEnd = y + halfHeight; - - var barrelCurveConstants = math.getBarrelCurveConstants(width, height); - var wOffset = barrelCurveConstants.widthOffset; - var hOffset = barrelCurveConstants.heightOffset; - var ctrlPtXOffset = barrelCurveConstants.ctrlPtOffsetPct * wOffset; - - if (context.beginPath) { - context.beginPath(); - } - - context.moveTo(xBegin, yBegin + hOffset); - - context.lineTo(xBegin, yEnd - hOffset); - context.quadraticCurveTo(xBegin + ctrlPtXOffset, yEnd, xBegin + wOffset, yEnd); - - context.lineTo(xEnd - wOffset, yEnd); - context.quadraticCurveTo(xEnd - ctrlPtXOffset, yEnd, xEnd, yEnd - hOffset); - - context.lineTo(xEnd, yBegin + hOffset); - context.quadraticCurveTo(xEnd - ctrlPtXOffset, yBegin, xEnd - wOffset, yBegin); - - context.lineTo(xBegin + wOffset, yBegin); - context.quadraticCurveTo(xBegin + ctrlPtXOffset, yBegin, xBegin, yBegin + hOffset); - - context.closePath(); -}; - -var sin0 = Math.sin(0); -var cos0 = Math.cos(0); - -var sin = {}; -var cos = {}; - -var ellipseStepSize = Math.PI / 40; - -for (var i = 0 * Math.PI; i < 2 * Math.PI; i += ellipseStepSize) { - sin[i] = Math.sin(i); - cos[i] = Math.cos(i); -} - -CRp.drawEllipsePath = function (context, centerX, centerY, width, height) { - if (context.beginPath) { - context.beginPath(); - } - - if (context.ellipse) { - context.ellipse(centerX, centerY, width / 2, height / 2, 0, 0, 2 * Math.PI); - } else { - var xPos, yPos; - var rw = width / 2; - var rh = height / 2; - for (var i = 0 * Math.PI; i < 2 * Math.PI; i += ellipseStepSize) { - xPos = centerX - rw * sin[i] * sin0 + rw * cos[i] * cos0; - yPos = centerY + rh * cos[i] * sin0 + rh * sin[i] * cos0; - - if (i === 0) { - context.moveTo(xPos, yPos); - } else { - context.lineTo(xPos, yPos); - } - } - } - - context.closePath(); -}; - -module.exports = CRp; - -/***/ }), -/* 135 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); - -var CRp = {}; - -CRp.createBuffer = function (w, h) { - var buffer = document.createElement('canvas'); // eslint-disable-line no-undef - buffer.width = w; - buffer.height = h; - - return [buffer, buffer.getContext('2d')]; -}; - -CRp.bufferCanvasImage = function (options) { - var cy = this.cy; - var eles = cy.mutableElements(); - var bb = eles.boundingBox(); - var ctrRect = this.findContainerClientCoords(); - var width = options.full ? Math.ceil(bb.w) : ctrRect[2]; - var height = options.full ? Math.ceil(bb.h) : ctrRect[3]; - var specdMaxDims = is.number(options.maxWidth) || is.number(options.maxHeight); - var pxRatio = this.getPixelRatio(); - var scale = 1; - - if (options.scale !== undefined) { - width *= options.scale; - height *= options.scale; - - scale = options.scale; - } else if (specdMaxDims) { - var maxScaleW = Infinity; - var maxScaleH = Infinity; - - if (is.number(options.maxWidth)) { - maxScaleW = scale * options.maxWidth / width; - } - - if (is.number(options.maxHeight)) { - maxScaleH = scale * options.maxHeight / height; - } - - scale = Math.min(maxScaleW, maxScaleH); - - width *= scale; - height *= scale; - } - - if (!specdMaxDims) { - width *= pxRatio; - height *= pxRatio; - scale *= pxRatio; - } - - var buffCanvas = document.createElement('canvas'); // eslint-disable-line no-undef - - buffCanvas.width = width; - buffCanvas.height = height; - - buffCanvas.style.width = width + 'px'; - buffCanvas.style.height = height + 'px'; - - var buffCxt = buffCanvas.getContext('2d'); - - // Rasterize the layers, but only if container has nonzero size - if (width > 0 && height > 0) { - - buffCxt.clearRect(0, 0, width, height); - - buffCxt.globalCompositeOperation = 'source-over'; - - var zsortedEles = this.getCachedZSortedEles(); - - if (options.full) { - // draw the full bounds of the graph - buffCxt.translate(-bb.x1 * scale, -bb.y1 * scale); - buffCxt.scale(scale, scale); - - this.drawElements(buffCxt, zsortedEles); - - buffCxt.scale(1 / scale, 1 / scale); - buffCxt.translate(bb.x1 * scale, bb.y1 * scale); - } else { - // draw the current view - var pan = cy.pan(); - - var translation = { - x: pan.x * scale, - y: pan.y * scale - }; - - scale *= cy.zoom(); - - buffCxt.translate(translation.x, translation.y); - buffCxt.scale(scale, scale); - - this.drawElements(buffCxt, zsortedEles); - - buffCxt.scale(1 / scale, 1 / scale); - buffCxt.translate(-translation.x, -translation.y); - } - - // need to fill bg at end like this in order to fill cleared transparent pixels in jpgs - if (options.bg) { - buffCxt.globalCompositeOperation = 'destination-over'; - - buffCxt.fillStyle = options.bg; - buffCxt.rect(0, 0, width, height); - buffCxt.fill(); - } - } - - return buffCanvas; -}; - -function b64ToBlob(b64, mimeType) { - var bytes = atob(b64); - var buff = new ArrayBuffer(bytes.length); - var buffUint8 = new Uint8Array(buff); - - for (var i = 0; i < bytes.length; i++) { - buffUint8[i] = bytes.charCodeAt(i); - } - - return new Blob([buff], { type: mimeType }); -} - -function b64UriToB64(b64uri) { - var i = b64uri.indexOf(','); - - return b64uri.substr(i + 1); -}; - -function output(options, canvas, mimeType) { - var b64Uri = canvas.toDataURL(mimeType, options.quality); - - switch (options.output) { - case 'blob': - return b64ToBlob(b64UriToB64(b64Uri), mimeType); - - case 'base64': - return b64UriToB64(b64Uri); - - case 'base64uri': - default: - return b64Uri; - } -} - -CRp.png = function (options) { - return output(options, this.bufferCanvasImage(options), 'image/png'); -}; - -CRp.jpg = function (options) { - return output(options, this.bufferCanvasImage(options), 'image/jpeg'); -}; - -module.exports = CRp; - -/***/ }), -/* 136 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var CRp = {}; - -CRp.nodeShapeImpl = function (name, context, centerX, centerY, width, height, points) { - switch (name) { - case 'ellipse': - return this.drawEllipsePath(context, centerX, centerY, width, height); - case 'polygon': - return this.drawPolygonPath(context, centerX, centerY, width, height, points); - case 'roundrectangle': - return this.drawRoundRectanglePath(context, centerX, centerY, width, height); - case 'cutrectangle': - return this.drawCutRectanglePath(context, centerX, centerY, width, height); - case 'bottomroundrectangle': - return this.drawBottomRoundRectanglePath(context, centerX, centerY, width, height); - case 'barrel': - return this.drawBarrelPath(context, centerX, centerY, width, height); - } -}; - -module.exports = CRp; - -/***/ }), -/* 137 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var is = __webpack_require__(0); -var util = __webpack_require__(1); -var Style = __webpack_require__(18); - -// a dummy stylesheet object that doesn't need a reference to the core -// (useful for init) -var Stylesheet = function Stylesheet() { - if (!(this instanceof Stylesheet)) { - return new Stylesheet(); - } - - this.length = 0; -}; - -var sheetfn = Stylesheet.prototype; - -sheetfn.instanceString = function () { - return 'stylesheet'; -}; - -// just store the selector to be parsed later -sheetfn.selector = function (selector) { - var i = this.length++; - - this[i] = { - selector: selector, - properties: [] - }; - - return this; // chaining -}; - -// just store the property to be parsed later -sheetfn.css = function (name, value) { - var i = this.length - 1; - - if (is.string(name)) { - this[i].properties.push({ - name: name, - value: value - }); - } else if (is.plainObject(name)) { - var map = name; - - for (var j = 0; j < Style.properties.length; j++) { - var prop = Style.properties[j]; - var mapVal = map[prop.name]; - - if (mapVal === undefined) { - // also try camel case name - mapVal = map[util.dash2camel(prop.name)]; - } - - if (mapVal !== undefined) { - var _name = prop.name; - var _value = mapVal; - - this[i].properties.push({ - name: _name, - value: _value - }); - } - } - } - - return this; // chaining -}; - -sheetfn.style = sheetfn.css; - -// generate a real style object from the dummy stylesheet -sheetfn.generateStyle = function (cy) { - var style = new Style(cy); - - return this.appendToStyle(style); -}; - -// append a dummy stylesheet object on a real style object -sheetfn.appendToStyle = function (style) { - for (var i = 0; i < this.length; i++) { - var context = this[i]; - var selector = context.selector; - var props = context.properties; - - style.selector(selector); // apply selector - - for (var j = 0; j < props.length; j++) { - var prop = props[j]; - - style.css(prop.name, prop.value); // apply property - } - } - - return style; -}; - -module.exports = Stylesheet; - -/***/ }), -/* 138 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = "3.2.18"; - -/***/ }) -/******/ ]); -}); \ No newline at end of file diff --git a/node_modules/cytoscape/dist/cytoscape.min.js b/node_modules/cytoscape/dist/cytoscape.min.js deleted file mode 100644 index 8e7257c14..000000000 --- a/node_modules/cytoscape/dist/cytoscape.min.js +++ /dev/null @@ -1,10 +0,0 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.cytoscape=t():e.cytoscape=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=20)}([function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=n(3),a=i?i.navigator:null,o=i?i.document:null,s=r(""),l=r({}),u=r(function(){}),c="undefined"==typeof HTMLElement?"undefined":r(HTMLElement),d=function(e){return e&&e.instanceString&&h.fn(e.instanceString)?e.instanceString():null},h={defined:function(e){return null!=e},string:function(e){return null!=e&&(void 0===e?"undefined":r(e))==s},fn:function(e){return null!=e&&(void 0===e?"undefined":r(e))===u},array:function(e){return Array.isArray?Array.isArray(e):null!=e&&e instanceof Array},plainObject:function(e){return null!=e&&(void 0===e?"undefined":r(e))===l&&!h.array(e)&&e.constructor===Object},object:function(e){return null!=e&&(void 0===e?"undefined":r(e))===l},number:function(e){return null!=e&&(void 0===e?"undefined":r(e))===r(1)&&!isNaN(e)},integer:function(e){return h.number(e)&&Math.floor(e)===e},bool:function(e){return null!=e&&(void 0===e?"undefined":r(e))===r(!0)},htmlElement:function(e){return"undefined"===c?void 0:null!=e&&e instanceof HTMLElement},elementOrCollection:function(e){return h.element(e)||h.collection(e)},element:function(e){return"collection"===d(e)&&e._private.single},collection:function(e){return"collection"===d(e)&&!e._private.single},core:function(e){return"core"===d(e)},style:function(e){return"style"===d(e)},stylesheet:function(e){return"stylesheet"===d(e)},event:function(e){return"event"===d(e)},thread:function(e){return"thread"===d(e)},fabric:function(e){return"fabric"===d(e)},emptyString:function(e){return void 0===e||null===e||!(""!==e&&!e.match(/^\s+$/))},nonemptyString:function(e){return!(!e||!h.string(e)||""===e||e.match(/^\s+$/))},domElement:function(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement},boundingBox:function(e){return h.plainObject(e)&&h.number(e.x1)&&h.number(e.x2)&&h.number(e.y1)&&h.number(e.y2)},promise:function(e){return h.object(e)&&h.fn(e.then)},touch:function(){return i&&("ontouchstart"in i||i.DocumentTouch&&o instanceof DocumentTouch)},gecko:function(){return i&&("undefined"!=typeof InstallTrigger||"MozAppearance"in o.documentElement.style)},webkit:function(){return i&&("undefined"!=typeof webkitURL||"WebkitAppearance"in o.documentElement.style)},chromium:function(){return i&&"undefined"!=typeof chrome},khtml:function(){return a&&a.vendor.match(/kde/i)},khtmlEtc:function(){return h.khtml()||h.webkit()||h.chromium()},ms:function(){return a&&a.userAgent.match(/msie|trident|edge/i)},windows:function(){return a&&a.appVersion.match(/Win/i)},mac:function(){return a&&a.appVersion.match(/Mac/i)},linux:function(){return a&&a.appVersion.match(/Linux/i)},unix:function(){return a&&a.appVersion.match(/X11/i)}};e.exports=h},function(e,t,n){"use strict";var r=n(0),i=n(2),a={MAX_INT:Number.MAX_SAFE_INTEGER||9007199254740991,trueify:function(){return!0},falsify:function(){return!1},zeroify:function(){return 0},noop:function(){},error:function(e){console.error?(console.error.apply(console,arguments),console.trace&&console.trace()):(console.log.apply(console,arguments),console.trace&&console.trace())},clone:function(e){return this.extend({},e)},copy:function(e){return null==e?e:r.array(e)?e.slice():r.plainObject(e)?this.clone(e):e},copyArray:function(e){return e.slice()},clonePosition:function(e){return{x:e.x,y:e.y}},uuid:function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t}};a.makeBoundingBox=i.makeBoundingBox.bind(i),a._staticEmptyObject={},a.staticEmptyObject=function(){return a._staticEmptyObject},a.extend=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n=0&&(e[r]!==t||(e.splice(r,1),n));r--);},a.clearArray=function(e){e.splice(0,e.length)},a.push=function(e,t){for(var n=0;n0?1:e<0?-1:0},r.dist=function(e,t){return Math.sqrt(r.sqdist(e,t))},r.sqdist=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},r.qbezierAt=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},r.qbezierPtAt=function(e,t,n,i){return{x:r.qbezierAt(e.x,t.x,n.x,i),y:r.qbezierAt(e.y,t.y,n.y,i)}},r.lineAt=function(e,t,n,i){var a={x:t.x-e.x,y:t.y-e.y},o=r.dist(e,t),s={x:a.x/o,y:a.y/o};return n=null==n?0:n,i=null!=i?i:n*o,{x:e.x+s.x*i,y:e.y+s.y*i}},r.lineAtDist=function(e,t,n){return r.lineAt(e,t,void 0,n)},r.triangleAngle=function(e,t,n){var i=r.dist(t,n),a=r.dist(e,n),o=r.dist(e,t);return Math.acos((i*i+a*a-o*o)/(2*i*a))},r.bound=function(e,t,n){return Math.max(e,Math.min(n,t))},r.makeBoundingBox=function(e){if(null==e)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(null!=e.x1&&null!=e.y1){if(null!=e.x2&&null!=e.y2&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},r.updateBoundingBox=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},r.expandBoundingBoxByPoint=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},r.expandBoundingBox=function(e,t){return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},r.boundingBoxesIntersect=function(e,t){return!(e.x1>t.x2)&&(!(t.x1>e.x2)&&(!(e.x2t.y2)&&!(t.y1>e.y2)))))))},r.inBoundingBox=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},r.pointInBoundingBox=function(e,t){return this.inBoundingBox(e,t.x,t.y)},r.boundingBoxInBoundingBox=function(e,t){return r.inBoundingBox(e,t.x1,t.y1)&&r.inBoundingBox(e,t.x2,t.y2)},r.roundRectangleIntersectLine=function(e,t,n,r,i,a,o){var s=this.getRoundRectangleRadius(i,a),l=i/2,u=a/2,c=void 0,d=n-l+s-o,h=r-u-o,p=n+l-s+o,f=h;if(c=this.finiteLinesIntersect(e,t,n,r,d,h,p,f,!1),c.length>0)return c;var v=n+l+o,g=r-u+s-o,y=v,m=r+u-s+o;if(c=this.finiteLinesIntersect(e,t,n,r,v,g,y,m,!1),c.length>0)return c;var b=n-l+s-o,x=r+u+o,w=n+l-s+o,E=x;if(c=this.finiteLinesIntersect(e,t,n,r,b,x,w,E,!1),c.length>0)return c;var P=n-l-o,C=r-u+s-o,S=P,T=r+u-s+o;if(c=this.finiteLinesIntersect(e,t,n,r,P,C,S,T,!1),c.length>0)return c;var D=void 0,k=n-l+s,_=r-u+s;if(D=this.intersectLineCircle(e,t,n,r,k,_,s+o),D.length>0&&D[0]<=k&&D[1]<=_)return[D[0],D[1]];var M=n+l-s,I=r-u+s;if(D=this.intersectLineCircle(e,t,n,r,M,I,s+o),D.length>0&&D[0]>=M&&D[1]<=I)return[D[0],D[1]];var N=n+l-s,B=r+u-s;if(D=this.intersectLineCircle(e,t,n,r,N,B,s+o),D.length>0&&D[0]>=N&&D[1]>=B)return[D[0],D[1]];var z=n-l+s,L=r+u-s;return D=this.intersectLineCircle(e,t,n,r,z,L,s+o),D.length>0&&D[0]<=z&&D[1]>=L?[D[0],D[1]]:[]},r.inLineVicinity=function(e,t,n,r,i,a,o){var s=o,l=Math.min(n,i),u=Math.max(n,i),c=Math.min(r,a),d=Math.max(r,a);return l-s<=e&&e<=u+s&&c-s<=t&&t<=d+s},r.inBezierVicinity=function(e,t,n,r,i,a,o,s,l){var u={x1:Math.min(n,o,i)-l,x2:Math.max(n,o,i)+l,y1:Math.min(r,s,a)-l,y2:Math.max(r,s,a)+l};return!(eu.x2||tu.y2)},r.solveQuadratic=function(e,t,n,r){n-=r;var i=t*t-4*e*n;if(i<0)return[];var a=Math.sqrt(i),o=2*e;return[(-t+a)/o,(-t-a)/o]},r.solveCubic=function(e,t,n,r,i){t/=e,n/=e,r/=e;var a=void 0,o=void 0,s=void 0,l=void 0,u=void 0,c=void 0,d=void 0,h=void 0;return o=(3*n-t*t)/9,s=-27*r+t*(9*n-t*t*2),s/=54,a=o*o*o+s*s,i[1]=0,d=t/3,a>0?(u=s+Math.sqrt(a),u=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),c=s-Math.sqrt(a),c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-d+u+c,d+=(u+c)/2,i[4]=i[2]=-d,d=Math.sqrt(3)*(-c+u)/2,i[3]=d,void(i[5]=-d)):(i[5]=i[3]=0,0===a?(h=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),i[0]=2*h-d,void(i[4]=i[2]=-(h+d))):(o=-o,l=o*o*o,l=Math.acos(s/Math.sqrt(l)),h=2*Math.sqrt(o),i[0]=-d+h*Math.cos(l/3),i[2]=-d+h*Math.cos((l+2*Math.PI)/3),void(i[4]=-d+h*Math.cos((l+4*Math.PI)/3))))},r.sqdistToQuadraticBezier=function(e,t,n,r,i,a,o,s){var l=1*n*n-4*n*i+2*n*o+4*i*i-4*i*o+o*o+r*r-4*r*a+2*r*s+4*a*a-4*a*s+s*s,u=9*n*i-3*n*n-3*n*o-6*i*i+3*i*o+9*r*a-3*r*r-3*r*s-6*a*a+3*a*s,c=3*n*n-6*n*i+n*o-n*e+2*i*i+2*i*e-o*e+3*r*r-6*r*a+r*s-r*t+2*a*a+2*a*t-s*t,d=1*n*i-n*n+n*e-i*e+r*a-r*r+r*t-a*t,h=[];this.solveCubic(l,u,c,d,h);for(var p=[],f=0;f<6;f+=2)Math.abs(h[f+1])<1e-7&&h[f]>=0&&h[f]<=1&&p.push(h[f]);p.push(1),p.push(0);for(var v=-1,g=void 0,y=void 0,m=void 0,b=0;b=0?ml?(e-i)*(e-i)+(t-a)*(t-a):u-d},r.pointInsidePolygonPoints=function(e,t,n){for(var r=void 0,i=void 0,a=void 0,o=void 0,s=0,l=0;l=e&&e>=a||r<=e&&e<=a))continue;(e-r)/(a-r)*(o-i)+i>t&&s++}return s%2!=0},r.pointInsidePolygon=function(e,t,n,i,a,o,s,l,u){var c=new Array(n.length),d=void 0;null!=l[0]?(d=Math.atan(l[1]/l[0]),l[0]<0?d+=Math.PI/2:d=-d-Math.PI/2):d=l;for(var h=Math.cos(-d),p=Math.sin(-d),f=0;f0){var g=this.expandPolygon(c,-u);v=this.joinLines(g)}else v=c;return r.pointInsidePolygonPoints(e,t,v)},r.joinLines=function(e){for(var t=new Array(e.length/2),n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,l=void 0,u=void 0,c=0;c=0&&v<=1&&y.push(v),g>=0&&g<=1&&y.push(g),0===y.length)return[];var m=y[0]*s[0]+e,b=y[0]*s[1]+t;if(y.length>1){if(y[0]==y[1])return[m,b];return[m,b,y[1]*s[0]+e,y[1]*s[1]+t]}return[m,b]},r.findCircleNearPoint=function(e,t,n,r,i){var a=r-e,o=i-t,s=Math.sqrt(a*a+o*o);return[e+a/s*n,t+o/s*n]},r.findMaxSqDistanceToOrigin=function(e){for(var t=1e-6,n=void 0,r=0;rt&&(t=n);return t},r.midOfThree=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},r.finiteLinesIntersect=function(e,t,n,r,i,a,o,s,l){var u=e-i,c=n-e,d=o-i,h=t-a,p=r-t,f=s-a,v=d*h-f*u,g=c*h-p*u,y=f*c-d*p;if(0!==y){var m=v/y,b=g/y;return-.001<=m&&m<=1.001&&-.001<=b&&b<=1.001?[e+m*c,t+m*p]:l?[e+m*c,t+m*p]:[]}return 0===v||0===g?this.midOfThree(e,n,o)===o?[o,s]:this.midOfThree(e,n,i)===i?[i,a]:this.midOfThree(i,o,n)===n?[n,r]:[]:[]},r.polygonIntersectLine=function(e,t,n,i,a,o,s,l){var u=[],c=void 0,d=new Array(n.length),h=!0;5===arguments.length&&(h=!1);var p=void 0;if(h){for(var f=0;f0){var v=r.expandPolygon(d,-l);p=r.joinLines(v)}else p=d}else p=n;for(var g=void 0,y=void 0,m=void 0,b=void 0,x=0;x "+t(r.target)),null!=r.connectedNodes){var h=r.connectedNodes;o=t(h[0])+" <-> "+t(h[1])}return null!=r.parent&&(o=t(r.parent)+" > "+o),null!=r.ancestor&&(o=t(r.ancestor)+" "+o),null!=r.child&&(o+=" > "+t(r.child)),null!=r.descendant&&(o+=" "+t(r.descendant)),o}(o),this.length>1&&e0&&i.plainObject(t[0])&&!i.element(t[0])){c=!0;for(var d=[],h=new o,p=0,f=t.length;p0){for(var R=new u(n,d),V=0;V0&&(e&&this.cy().notify({type:"remove",eles:E}),E.emit("remove"));for(var P=0;P=0;s--)!function(i){var s=o[i];c(a,function(e,t,n,r,a,l){if(s.type===n&&(!r||s.namespace===r)&&(!a||e.qualifierCompare(s.qualifier,a))&&(!l||s.callback===l))return o.splice(i,1),!1},e,t,n,r)}(s);return this},u.emit=u.trigger=function(e,t,n){var r=this.listeners,o=r.length;return this.emitting++,a.array(t)||(t=[t]),h(this,function(e,a){null!=n&&(r=[{event:a.event,type:a.type,namespace:a.namespace,callback:n}],o=r.length);for(var s=0;s0?d.wheelSensitivity:1,motionBlur:void 0!==d.motionBlur&&d.motionBlur,motionBlurOpacity:void 0===d.motionBlurOpacity?.05:d.motionBlurOpacity,pixelRatio:o.number(d.pixelRatio)&&d.pixelRatio>0?d.pixelRatio:void 0,desktopTapThreshold:void 0===d.desktopTapThreshold?4:d.desktopTapThreshold,touchTapThreshold:void 0===d.touchTapThreshold?8:d.touchTapThreshold},d.renderer));var v=function(e,n,r){t.notifications(!1);var a=t.mutableElements();a.length>0&&a.remove(),null!=e&&(o.plainObject(e)||o.array(e))&&t.add(e),t.one("layoutready",function(e){t.notifications(!0),t.emit(e),t.notify({type:"load",eles:t.mutableElements()}),t.one("load",n),t.emit("load")}).one("layoutstop",function(){t.one("done",r),t.emit("done")});var s=i.extend({},t._private.options.layout);s.eles=t.elements(),t.layout(s).run()};!function(e,t){if(e.some(o.promise))return s.all(e).then(t);t(e)}([d.style,d.elements],function(e){var n=e[0],r=e[1];p.styleEnabled&&t.style().append(n),v(r,function(){t.startAnimationLoop(),p.ready=!0,o.fn(d.ready)&&t.on("ready",d.ready);for(var e=0;e=e.deqFastCost*g)break}else if(a){if(f>=e.deqCost*u||f>=e.deqAvgCost*l)break}else if(v>=e.deqNoDrawCost*(1e3/60))break;var y=e.deq(t,h,d);if(!(y.length>0))break;for(var m=0;m0&&(e.onDeqd(t,c),!a&&e.shouldRedraw(t,c,h,d)&&i())},o=e.priority||r.noop;n.beforeRender(a,o(t))}}}}},function(e,t,n){"use strict";var r=n(0),i=n(12),a=n(95),o=n(137),s=function(e){return void 0===e&&(e={}),r.plainObject(e)?new i(e):r.string(e)?a.apply(a,arguments):void 0};s.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(s),e.apply(null,t),this},s.version=n(138),s.stylesheet=s.Stylesheet=o,e.exports=s},function(e,t,n){"use strict";var r=n(0);e.exports={hex2tuple:function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var t=4===e.length,n=void 0,r=void 0,i=void 0;return t?(n=parseInt(e[1]+e[1],16),r=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16)):(n=parseInt(e[1]+e[2],16),r=parseInt(e[3]+e[4],16),i=parseInt(e[5]+e[6],16)),[n,r,i]}},hsl2tuple:function(e){function t(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,l=void 0,u=void 0,c=new RegExp("^"+this.regex.hsla+"$").exec(e);if(c){if(r=parseInt(c[1]),r<0?r=(360- -1*r%360)%360:r>360&&(r%=360),r/=360,(i=parseFloat(c[2]))<0||i>100)return;if(i/=100,(a=parseFloat(c[3]))<0||a>100)return;if(a/=100,void 0!==(o=c[4])&&((o=parseFloat(o))<0||o>1))return;if(0===i)s=l=u=Math.round(255*a);else{var d=a<.5?a*(1+i):a+i-a*i,h=2*a-d;s=Math.round(255*t(h,d,r+1/3)),l=Math.round(255*t(h,d,r)),u=Math.round(255*t(h,d,r-1/3))}n=[s,l,u,o]}return n},rgb2tuple:function(e){var t=void 0,n=new RegExp("^"+this.regex.rgba+"$").exec(e);if(n){t=[];for(var r=[],i=1;i<=3;i++){var a=n[i];if("%"===a[a.length-1]&&(r[i]=!0),a=parseFloat(a),r[i]&&(a=a/100*255),a<0||a>255)return;t.push(Math.floor(a))}var o=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(o&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t},colorname2tuple:function(e){return this.colors[e.toLowerCase()]},color2tuple:function(e){return(r.array(e)?e:null)||this.colorname2tuple(e)||this.hex2tuple(e)||this.rgb2tuple(e)||this.hsl2tuple(e)},colors:{transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}},function(e,t,n){"use strict";var r=n(0);e.exports={mapEmpty:function(e){return null==e||0===Object.keys(e).length},pushMap:function(e){var t=this.getMap(e);null==t?this.setMap(this.extend({},e,{value:[e.value]})):t.push(e.value)},setMap:function(e){for(var t=e.map,n=e.keys,i=n.length,a=0;a=t||n<0||T&&r>=y}function c(){var e=E();if(u(e))return d(e);b=setTimeout(c,l(e))}function d(e){return b=void 0,D&&v?i(e):(v=g=void 0,m)}function h(){void 0!==b&&clearTimeout(b),C=0,v=P=g=b=void 0}function p(){return void 0===b?m:d(E())}function f(){var e=E(),n=u(e);if(v=arguments,g=this,P=e,n){if(void 0===b)return a(P);if(T)return b=setTimeout(c,t),i(P)}return void 0===b&&(b=setTimeout(c,t)),m}var v,g,y,m,b,P,C=0,S=!1,T=!1,D=!0;if("function"!=typeof e)throw new TypeError(s);return t=o(t)||0,r(n)&&(S=!!n.leading,T="maxWait"in n,y=T?x(o(n.maxWait)||0,t):y,D="trailing"in n?!!n.trailing:D),f.cancel=h,f.flush=p,f}function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==typeof e}function a(e){return"symbol"==typeof e||i(e)&&b.call(e)==u}function o(e){if("number"==typeof e)return e;if(a(e))return l;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(c,"");var n=h.test(e);return n||p.test(e)?f(e.slice(2),n?2:8):d.test(e)?l:+e}var s="Expected a function",l=NaN,u="[object Symbol]",c=/^\s+|\s+$/g,d=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,p=/^0o[0-7]+$/i,f=parseInt,v="object"==typeof global&&global&&global.Object===Object&&global,g="object"==typeof self&&self&&self.Object===Object&&self,y=v||g||Function("return this")(),m=Object.prototype,b=m.toString,x=Math.max,w=Math.min,E=function(){return y.Date.now()};e.exports=n},function(e,t,n){"use strict";function r(e,t){return et?1:0}function i(e,t){return-1*r(e,t)}e.exports={sort:{ascending:r,descending:i}}},function(e,t,n){"use strict";function r(){this._obj={}}var i=r.prototype;i.set=function(e,t){this._obj[e]=t},i.delete=function(e){this._obj[e]=null},i.has=function(e){return null!=this._obj[e]},i.get=function(e){return this._obj[e]},e.exports=r},function(e,t,n){"use strict";var r=n(1),i={};[n(30),n(31),n(34),n(35),n(36),n(37),n(38),n(39),n(40),n(41),n(42)].forEach(function(e){r.extend(i,e)}),e.exports=i},function(e,t,n){"use strict";var r=n(0),i=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,i){var a;r.plainObject(t)&&!r.elementOrCollection(t)&&(a=t,t=a.roots||a.root,n=a.visit,i=a.directed),i=2!==arguments.length||r.fn(n)?i:n,n=r.fn(n)?n:function(){};for(var o,s=this._private.cy,l=t=r.string(t)?this.filter(t):t,u=[],c=[],d={},h={},p={},f=0,v=this.nodes(),g=this.edges(),y=0;y0;){var y=f.pop(),m=p(y),b=y.id();if(c[b]=m,m!==1/0)for(var x=y.neighborhood().intersect(h),v=0;v0)for(n.unshift(t);u[i.id()];){var a=u[i.id()];n.unshift(a.edge),n.unshift(a.node),i=a.node}return o.collection(n)}}}};e.exports=a},function(e,t,n){e.exports=n(33)},function(e,t,n){var r,i,a;(function(){var n,o,s,l,u,c,d,h,p,f,v,g,y,m,b;s=Math.floor,f=Math.min,o=function(e,t){return et?1:0},p=function(e,t,n,r,i){var a;if(null==n&&(n=0),null==i&&(i=o),n<0)throw new Error("lo must be non-negative");for(null==r&&(r=e.length);nn;0<=n?t++:t--)u.push(t);return u}.apply(this).reverse(),l=[],r=0,i=a.length;rv;0<=v?++c:--c)g.push(u(e,n));return g},m=function(e,t,n,r){var i,a,s;for(null==r&&(r=o),i=e[n];n>t&&(s=n-1>>1,a=e[s],r(i,a)<0);)e[n]=a,n=s;return e[n]=i},b=function(e,t,n){var r,i,a,s,l;for(null==n&&(n=o),i=e.length,l=t,a=e[t],r=2*t+1;r0;){var m=function(e,t){if(0!==e.length){for(var n=0,r=t[e[0]],i=1;im&&(c[g][y]=m,p[g][y]=y,f[g][y]=a[u])}if(!i)for(var u=0;um&&(c[g][y]=m,p[g][y]=y,f[g][y]=a[u])}for(var b=0;bc&&(c=t)},get:function(e){return u[e]}},h=0;h0?S.edgesTo(C)[0]:C.edgesTo(S)[0];var T=n(P);C=C.id(),x[C]>x[p]+T&&(x[C]=x[p]+T,w.nodes.indexOf(C)<0?w.push(C):w.updateItem(C),b[C]=0,m[C]=[]),x[C]==x[p]+T&&(b[C]=b[C]+b[p],m[C].push(p))}else for(var E=0;E0;)for(var C=y.pop(),E=0;E0:void 0}},clearQueue:function(){return function(){var e=this,t=void 0!==e.length,n=t?e:[e];if(!(this._private.cy||this).styleEnabled())return this;for(var r=0;r0&&this.spawn(n).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){for(var n=e.match(/\S+/g)||[],r=this,i=[],a=0,o=r.length;a0&&this.spawn(i).updateStyle().emit("class"),r},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},t),n}};e.exports=i},function(e,t,n){"use strict";var r=(n(0),n(6)),i={allAre:function(e){var t=new r(e);return this.every(function(e){return t.matches(e)})},is:function(e){var t=new r(e);return this.some(function(e){return t.matches(e)})},some:function(e,t){for(var n=0;n\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:'"(?:\\\\"|[^"])*"|'+"'(?:\\\\'|[^'])*'",number:r.regex.number,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};i.variable="(?:[\\w-]|(?:\\\\"+i.metaChar+"))+",i.value=i.string+"|"+i.number,i.className=i.variable,i.id=i.variable,function(){var e=void 0,t=void 0,n=void 0;for(e=i.comparatorOp.split("|"),n=0;n=0||"="!==t&&(i.comparatorOp+="|\\!"+t)}(),e.exports=i},function(e,t,n){"use strict";var r=n(15),i=r.stateSelectorMatches,a=n(0),o=function(e,t){for(var n=!0,r=0;r=0&&(d=d.toLowerCase(),h=h.toLowerCase(),o=o.replace("@",""),p=!0);var f=!1;o.indexOf("!")>=0&&(o=o.replace("!",""),f=!0),p&&(s=h.toLowerCase(),c=d.toLowerCase());var v=!1;switch(o){case"*=":u=d.indexOf(h)>=0;break;case"$=":u=d.indexOf(h,d.length-h.length)>=0;break;case"^=":u=0===d.indexOf(h);break;case"=":u=c===s;break;case">":v=!0,u=c>s;break;case">=":v=!0,u=c>=s;break;case"<":v=!0,u=c0;){var d=i.shift();t(d),a.add(d.id()),l&&r(i,a,d)}return e}function i(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i1&&void 0!==arguments[1])||arguments[1],i)},l.forEachUp=function(e){return r(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a)},l.forEachUpAndDown=function(e){return r(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o)},l.ancestors=l.parents,e.exports=l},function(e,t,n){"use strict";var r=n(4),i=void 0,a=void 0;i=a={data:r.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:r.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:r.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:r.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:r.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:r.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},i.attr=i.data,i.removeAttr=i.removeData,e.exports=a},function(e,t,n){"use strict";function r(e){return function(t){var n=this;if(void 0===t&&(t=!0),0!==n.length&&n.isNode()&&!n.removed()){for(var r=0,i=n[0],a=i._private.edges,o=0;ot}),minIndegree:i("indegree",function(e,t){return et}),minOutdegree:i("outdegree",function(e,t){return et})}),a.extend(o,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r0,d=c;c&&(u=u[0]);var h=d?u.position():{x:0,y:0};return a={x:l.x-h.x,y:l.y-h.y},void 0===e?a:a[e]}for(var p=0;p0,y=g;g&&(v=v[0]);var m=y?v.position():{x:0,y:0};void 0!==t?f.position(e,t+m[e]):void 0!==a&&f.position({x:a.x+m.x,y:a.y+m.y})}}else if(!o)return;return this}},o.modelPosition=o.point=o.position,o.modelPositions=o.points=o.positions,o.renderedPoint=o.renderedPosition,o.relativePoint=o.relativePosition,e.exports=s},function(e,t,n){"use strict";function r(e){return{includeNodes:a.default(e.includeNodes,b.includeNodes),includeEdges:a.default(e.includeEdges,b.includeEdges),includeLabels:a.default(e.includeLabels,b.includeLabels),includeOverlays:a.default(e.includeOverlays,b.includeOverlays),useCache:a.default(e.useCache,b.useCache)}}var i=n(0),a=n(1),o=n(2),s=void 0,l=void 0;s=l={},l.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),a=t.x1*r+i.x,o=t.x2*r+i.x,s=t.y1*r+i.y,l=t.y2*r+i.y;return{x1:a,x2:o,y1:s,y2:l,w:o-a,h:l-s}},l.dirtyCompoundBoundsCache=function(){var e=this.cy();return e.styleEnabled()&&e.hasCompoundNodes()?(this.forEachUp(function(e){e._private.compoundBoundsClean=!1,e.isParent()&&e.emit("bounds")}),this):this},l.updateCompoundBounds=function(){var e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(e.batching())return this;for(var t=[],n=0;n0&&a>0&&(r=t/a*e,i=n/a*e),{biasDiff:r,biasComplementDiff:i}}if(e.isParent()){var r=e._private,i=e.children(),a="include"===e.pstyle("compound-sizing-wrt-labels").value,o={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}},s=i.boundingBox({includeLabels:a,includeOverlays:!1,useCache:!1}),l=r.position;0!==s.w&&0!==s.h||(s={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue},s.x1=l.x-s.w/2,s.x2=l.x+s.w/2,s.y1=l.y-s.h/2,s.y2=l.y+s.h/2);var u=o.width.left.value;"px"===o.width.left.units&&o.width.val>0&&(u=100*u/o.width.val);var c=o.width.right.value;"px"===o.width.right.units&&o.width.val>0&&(c=100*c/o.width.val);var d=o.height.top.value;"px"===o.height.top.units&&o.height.val>0&&(d=100*d/o.height.val);var h=o.height.bottom.value;"px"===o.height.bottom.units&&o.height.val>0&&(h=100*h/o.height.val);var p=n(o.width.val-s.w,u,c),f=p.biasDiff,v=p.biasComplementDiff,g=n(o.height.val-s.h,d,h),y=g.biasDiff,m=g.biasComplementDiff;r.autoPadding=function(e,t,n,r){if("%"!==n.units)return"px"===n.units?n.pfValue:0;switch(r){case"width":return e>0?n.pfValue*e:0;case"height":return t>0?n.pfValue*t:0;case"average":return e>0&&t>0?n.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case"max":return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}}(s.w,s.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),r.autoWidth=Math.max(s.w,o.width.val),l.x=(-f+s.x1+s.x2+v)/2,r.autoHeight=Math.max(s.h,o.height.val),l.y=(-y+s.y1+s.y2+m)/2,t.push(e)}}(r),e._private.batchingStyle||(i.compoundBoundsClean=!0))}return this};var u=function(e){return e===1/0||e===-1/0?0:e},c=function(e,t,n,r,i){r-t!=0&&i-n!=0&&null!=t&&null!=n&&null!=r&&null!=i&&(e.x1=te.x2?r:e.x2,e.y1=ne.y2?i:e.y2)},d=function(e,t){return c(e,t.x1,t.y1,t.x2,t.y2)},h=function(e,t,n){return a.getPrefixedProperty(e,t,n)},p=function(e,t,n){if(!t.cy().headless()){var r=t._private,i=r.rstyle,a=i.arrowWidth/2,o=t.pstyle(n+"-arrow-shape").value,s=void 0,l=void 0;"none"!==o&&("source"===n?(s=i.srcX,l=i.srcY):"target"===n?(s=i.tgtX,l=i.tgtY):(s=i.midX,l=i.midY),c(e,s-a,l-a,s+a,l+a))}},f=function(e,t,n){if(!t.cy().headless()){var r=void 0;r=n?n+"-":"";var i=t._private,a=i.rstyle;if(t.pstyle(r+"label").strValue){var o=t.pstyle("text-halign"),s=t.pstyle("text-valign"),l=h(a,"labelWidth",n),u=h(a,"labelHeight",n),d=h(a,"labelX",n),p=h(a,"labelY",n),f=t.pstyle(r+"text-margin-x").pfValue,v=t.pstyle(r+"text-margin-y").pfValue,g=t.isEdge(),y=t.pstyle(r+"text-rotation"),m=t.pstyle("text-outline-width").pfValue,b=t.pstyle("text-border-width").pfValue,x=b/2,w=t.pstyle("text-background-padding").pfValue,E=u+2*w,P=l+2*w,C=P/2,S=E/2,T=void 0,D=void 0,k=void 0,_=void 0;if(g)T=d-C,D=d+C,k=p-S,_=p+S;else{switch(o.value){case"left":T=d-P,D=d;break;case"center":T=d-C,D=d+C;break;case"right":T=d,D=d+P}switch(s.value){case"top":k=p-E,_=p;break;case"center":k=p-S,_=p+S;break;case"bottom":k=p,_=p+E}}var M=g&&"autorotate"===y.strValue,I=null!=y.pfValue&&0!==y.pfValue;if(M||I){var N=M?h(i.rstyle,"labelAngle",n):y.pfValue,B=Math.cos(N),z=Math.sin(N),L=function(e,t){return e-=d,t-=p,{x:e*B-t*z+d,y:e*z+t*B+p}},A=L(T,k),O=L(T,_),R=L(D,k),V=L(D,_);T=Math.min(A.x,O.x,R.x,V.x),D=Math.max(A.x,O.x,R.x,V.x),k=Math.min(A.y,O.y,R.y,V.y),_=Math.max(A.y,O.y,R.y,V.y)}T+=f-Math.max(m,x),D+=f+Math.max(m,x),k+=v-Math.max(m,x),_+=v+Math.max(m,x),c(e,T,k,D,_)}return e}},v=function(e,t){var n=e._private.cy,r=n.styleEnabled(),i=n.headless(),a={x1:1/0,y1:1/0,x2:-1/0,y2:-1/0},s=e._private,l=r?e.pstyle("display").value:"element",d=e.isNode(),h=e.isEdge(),v=void 0,g=void 0,y=void 0,m=void 0,b=void 0,x=void 0,w="none"!==l;if(w){var E=0;r&&t.includeOverlays&&0!==e.pstyle("overlay-opacity").value&&(E=e.pstyle("overlay-padding").value);var P=0,C=0;if(r&&(P=e.pstyle("width").pfValue,C=P/2),d&&t.includeNodes){var S=e.position();b=S.x,x=S.y;var T=e.outerWidth(),D=T/2,k=e.outerHeight(),_=k/2;v=b-D-E,g=b+D+E,y=x-_-E,m=x+_+E,c(a,v,y,g,m)}else if(h&&t.includeEdges){var M=s.rstyle||{};if(r&&!i&&(v=Math.min(M.srcX,M.midX,M.tgtX),g=Math.max(M.srcX,M.midX,M.tgtX),y=Math.min(M.srcY,M.midY,M.tgtY),m=Math.max(M.srcY,M.midY,M.tgtY),v-=C,g+=C,y-=C,m+=C,c(a,v,y,g,m)),r&&!i&&"haystack"===e.pstyle("curve-style").strValue){var I=M.haystackPts||[];if(v=I[0].x,y=I[0].y,g=I[1].x,m=I[1].y,v>g){var N=v;v=g,g=N}if(y>m){var B=y;y=m,m=B}c(a,v-C,y-C,g+C,m+C)}else{for(var z=M.bezierPts||M.linePts||[],L=0;Lg){var F=v;v=g,g=F}if(y>m){var j=y;y=m,m=j}v-=C,g+=C,y-=C,m+=C,c(a,v,y,g,m)}}}if(r&&t.includeEdges&&h&&(p(a,e,"mid-source"),p(a,e,"mid-target"),p(a,e,"source"),p(a,e,"target")),r){if("yes"===e.pstyle("ghost").value){var X=e.pstyle("ghost-offset-x").pfValue,Y=e.pstyle("ghost-offset-y").pfValue;c(a,a.x1+X,a.y1+Y,a.x2+X,a.y2+Y)}}r&&(v=a.x1,g=a.x2,y=a.y1,m=a.y2,c(a,v-E,y-E,g+E,m+E)),r&&t.includeLabels&&(f(a,e,null),h&&(f(a,e,"source"),f(a,e,"target")))}return a.x1=u(a.x1),a.y1=u(a.y1),a.x2=u(a.x2),a.y2=u(a.y2),a.w=u(a.x2-a.x1),a.h=u(a.y2-a.y1),a.w>0&&a.h>0&&w&&o.expandBoundingBox(a,1),a},g=function(e){return e?"t":"f"},y=function(e){var t="";return t+=g(e.incudeNodes),t+=g(e.includeEdges),t+=g(e.includeLabels),t+=g(e.includeOverlays)},m=function(e,t){var n=e._private,r=void 0,i=e.cy().headless(),a=t===b?x:y(t);return t.useCache&&!i&&n.bbCache&&n.bbCache[a]?r=n.bbCache[a]:(r=v(e,t),i||(n.bbCache=n.bbCache||{},n.bbCache[a]=r)),r},b={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeOverlays:!0,useCache:!0},x=y(b);l.boundingBox=function(e){if(1===this.length&&this[0]._private.bbCache&&(void 0===e||void 0===e.useCache||!0===e.useCache))return e=void 0===e?b:r(e),m(this[0],e);var t={x1:1/0,y1:1/0,x2:-1/0,y2:-1/0};e=e||a.staticEmptyObject();var n=r(e),i=this,o=i.cy(),s=o.styleEnabled();s&&this.recalculateRenderedStyle(n.useCache),this.updateCompoundBounds();for(var l={},c=0;c1&&!o){var s=this.length-1,l=this[s],u=l._private.data.id;this[s]=void 0,this[a]=l,r.set(u,{ele:l,index:a})}return this.length--,this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&r.string(e)){var n=e;e=t.mutableElements().filter(n)}for(var i=0;in&&(n=s,r=o)}return{value:n,ele:r}},min:function(e,t){for(var n=1/0,r=void 0,i=this,a=0;a=0&&i0&&t.push(c[0]),t.push(s[0])}return this.spawn(t,{unique:!0}).filter(e)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),l.neighbourhood=l.neighborhood,l.closedNeighbourhood=l.closedNeighborhood,l.openNeighbourhood=l.openNeighborhood,o.extend(l,{source:u(function(e){var t=this[0],n=void 0;return t&&(n=t._private.source||t.cy().collection()),n&&e?n.filter(e):n},"source"),target:u(function(e){var t=this[0],n=void 0;return t&&(n=t._private.target||t.cy().collection()),n&&e?n.filter(e):n},"target"),sources:r({attr:"source"}),targets:r({attr:"target"})}),o.extend(l,{edgesWith:u(i(),"edgesWith"),edgesTo:u(i({thisIsSrc:!0}),"edgesTo")}),o.extend(l,{connectedEdges:u(function(e){for(var t=[],n=this,r=0;r0);return i.map(function(e){var t=e.connectedEdges().stdFilter(function(t){return e.anySame(t.source())&&e.anySame(t.target())});return e.union(t)})}}),e.exports=l},function(e,t,n){"use strict";var r=n(0),i=n(1),a=n(7),o=n(14),s={add:function(e){var t=void 0,n=this;if(r.elementOrCollection(e)){var s=e;if(s._private.cy===n)t=s.restore();else{for(var l=[],u=0;u=0;t--){(0,e[t])()}e.splice(0,e.length)},p=s.length-1;p>=0;p--){var f=s[p],v=f._private;v.stopped?(s.splice(p,1),v.hooked=!1,v.playing=!1,v.started=!1,h(v.frames)):(v.playing||v.applying)&&(v.playing&&v.applying&&(v.applying=!1),v.started||a(t,f,e,n),i(t,f,e,n),v.applying&&(v.applying=!1),h(v.frames),f.completed()&&(s.splice(p,1),v.hooked=!1,v.playing=!1,v.started=!1,h(v.completes)),u=!0)}return n||0!==s.length||0!==l.length||o.push(t),u}for(var r=t._private.aniEles,o=[],s=!1,l=0;l0?(r.dirtyCompoundBoundsCache(),t.notify({type:"draw",eles:r})):t.notify({type:"draw"})),r.unmerge(o),t.emit("step")}var i=n(73),a=n(78);e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){var l=!r,u=e._private,c=t._private,d=c.easing,h=c.startTime,p=r?e:e.cy(),f=p.style();if(!c.easingImpl)if(null==d)c.easingImpl=a.linear;else{var v=void 0;if(s.string(d)){var g=f.parse("transition-timing-function",d);v=g.value}else v=d;var y=void 0,m=void 0;s.string(v)?(y=v,m=[]):(y=v[1],m=v.slice(2).map(function(e){return+e})),m.length>0?("spring"===y&&m.push(c.duration),c.easingImpl=a[y].apply(null,m)):c.easingImpl=a[y]}var b=c.easingImpl,x=void 0;if(x=0===c.duration?1:(n-h)/c.duration,c.applying&&(x=c.progress),x<0?x=0:x>1&&(x=1),null==c.delay){var w=c.startPosition,E=c.position;if(E&&l&&!e.locked()){var P=e.position();i(w.x,E.x)&&(P.x=o(w.x,E.x,x,b)),i(w.y,E.y)&&(P.y=o(w.y,E.y,x,b)),e.emit("position")}var C=c.startPan,S=c.pan,T=u.pan,D=null!=S&&r;D&&(i(C.x,S.x)&&(T.x=o(C.x,S.x,x,b)),i(C.y,S.y)&&(T.y=o(C.y,S.y,x,b)),e.emit("pan"));var k=c.startZoom,_=c.zoom,M=null!=_&&r;M&&(i(k,_)&&(u.zoom=o(k,_,x,b)),e.emit("zoom")),(D||M)&&e.emit("viewport");var I=c.style;if(I&&I.length>0&&l){for(var N=0;N0?i=o:r=o}while(Math.abs(a)>g&&++l=v?u(t,s):0===c?s:d(t,r,r+b)}function p(){P=!0,e===t&&n===r||c()}var f=4,v=.001,g=1e-7,y=10,m=11,b=1/(m-1),x="undefined"!=typeof Float32Array;if(4!==arguments.length)return!1;for(var w=0;w<4;++w)if("number"!=typeof arguments[w]||isNaN(arguments[w])||!isFinite(arguments[w]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var E=x?new Float32Array(m):new Array(m),P=!1,C=function(i){return P||p(),e===t&&n===r?i:0===i?0:1===i?1:s(h(i),t,r)};C.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var S="generateBezier("+[e,t,n,r]+")";return C.toString=function(){return S},C}e.exports=r},function(e,t,n){"use strict";/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */ -var r=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},a=t(n,.5*r,i),o=t(n,.5*r,a),s=t(n,r,o),l=1/6*(i.dx+2*(a.dx+o.dx)+s.dx),u=1/6*(i.dv+2*(a.dv+o.dv)+s.dv);return n.x=n.x+l*r,n.v=n.v+u*r,n}return function e(t,r,i){var a={x:-1,v:0,tension:null,friction:null},o=[0],s=0,l=void 0,u=void 0,c=void 0;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i=i||null,a.tension=t,a.friction=r,l=null!==i,l?(s=e(t,r),u=s/i*.016):u=.016;c=n(c||a,u),o.push(1+c.x),s+=16,Math.abs(c.x)>1e-4&&Math.abs(c.v)>1e-4;);return l?function(e){return o[e*(o.length-1)|0]}:s}}();e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r,i){if(1===r)return n;var a=i(t,n,r);return null==e?a:((e.roundValue||e.color)&&(a=Math.round(a)),void 0!==e.min&&(a=Math.max(a,e.min)),void 0!==e.max&&(a=Math.min(a,e.max)),a)}function i(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function a(e,t,n,a,s){var l=null!=s?s.type:null;n<0?n=0:n>1&&(n=1);var u=i(e,s),c=i(t,s);if(o.number(u)&&o.number(c))return r(l,u,c,n,a);if(o.array(u)&&o.array(c)){for(var d=[],h=0;h0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchingStyle=e.batchingNotify=!0,e.batchStyleEles=this.collection(),e.batchNotifyEles=this.collection(),e.batchNotifyTypes=[],e.batchNotifyTypes.ids={}),e.batchCount++,this},endBatch:function(){var e=this._private;return e.batchCount--,0===e.batchCount&&(e.batchingStyle=!1,e.batchStyleEles.updateStyle(),e.batchingNotify=!1,this.notify({type:e.batchNotifyTypes,eles:e.batchNotifyEles})),this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var n=Object.keys(e),r=0;r0;)t.removeChild(t.childNodes[0]);e._private.renderer=null},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};i.invalidateDimensions=i.resize,e.exports=i},function(e,t,n){"use strict";var r=n(0),i=n(7),a={collection:function(e,t){return r.string(e)?this.$(e):r.elementOrCollection(e)?e.collection():r.array(e)?new i(this,e,t):new i(this)},nodes:function(e){var t=this.$(function(e){return e.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(e){return e.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};a.elements=a.filter=a.$,e.exports=a},function(e,t,n){"use strict";var r=n(0),i=n(18),a={style:function(e){if(e){this.setStyle(e).update()}return this._private.style},setStyle:function(e){var t=this._private;return r.stylesheet(e)?t.style=e.generateStyle(this):r.array(e)?t.style=i.fromJson(this,e):r.string(e)?t.style=i.fromString(this,e):t.style=i(this),t.style}};e.exports=a},function(e,t,n){"use strict";var r=n(1),i=n(0),a=n(5),o={};o.apply=function(e){var t=this,n=t._private,r=n.cy,i=r.collection();n.newStyle&&(n.contextStyles={},n.propDiffs={},t.cleanElements(e,!0));for(var a=0;a0;if(h||p){var f=void 0;h&&p?f=u.properties:h?f=u.properties:p&&(f=u.mappedProperties);for(var v=0;v0){r=!0;break}}t.hasPie=r;var o=e.pstyle("text-transform").strValue,s=e.pstyle("label").strValue,l=e.pstyle("source-label").strValue,u=e.pstyle("target-label").strValue,c=e.pstyle("font-style").strValue,d=e.pstyle("font-size").pfValue+"px",h=e.pstyle("font-family").strValue,p=e.pstyle("font-weight").strValue,f=e.pstyle("text-valign").strValue,v=e.pstyle("text-valign").strValue,g=e.pstyle("text-outline-width").pfValue,y=e.pstyle("text-wrap").strValue,m=e.pstyle("text-max-width").pfValue,b=c+"$"+d+"$"+h+"$"+p+"$"+o+"$"+f+"$"+v+"$"+g+"$"+y+"$"+m;t.labelStyleKey=b,t.sourceLabelKey=b+"$"+l,t.targetLabelKey=b+"$"+u,t.labelKey=b+"$"+s,t.fontKey=c+"$"+p+"$"+d+"$"+h,t.styleKey=Date.now()}},o.applyParsedProperty=function(e,t){var n=this,a=t,o=e._private.style,s=void 0,l=n.types,u=n.properties[a.name].type,c=a.bypass,d=o[a.name],h=d&&d.bypass,p=e._private,f=function(){n.checkZOrderTrigger(e,a.name,d?d.value:null,a.value)};if("curve-style"===t.name&&"haystack"===t.value&&e.isEdge()&&(e.isLoop()||e.source().isParent()||e.target().isParent())&&(a=t=this.parse(t.name,"bezier",c)),a.delete)return o[a.name]=void 0,f(),!0;if(a.deleteBypassed)return d?!!d.bypass&&(d.bypassed=void 0,f(),!0):(f(),!0);if(a.deleteBypass)return d?!!d.bypass&&(o[a.name]=d.bypassed,f(),!0):(f(),!0);var v=function(){r.error("Do not assign mappings to elements without corresponding data (e.g. ele `"+e.id()+"` for property `"+a.name+"` with data field `"+a.field+"`); try a `["+a.field+"]` selector to limit scope to elements with `"+a.field+"` defined")};switch(a.mapped){case l.mapData:for(var g=a.field.split("."),y=p.data,m=0;m1&&(b=1),u.color){var x=a.valueMin[0],w=a.valueMax[0],E=a.valueMin[1],P=a.valueMax[1],C=a.valueMin[2],S=a.valueMax[2],T=null==a.valueMin[3]?1:a.valueMin[3],D=null==a.valueMax[3]?1:a.valueMax[3],k=[Math.round(x+(w-x)*b),Math.round(E+(P-E)*b),Math.round(C+(S-C)*b),Math.round(T+(D-T)*b)];s={bypass:a.bypass,name:a.name,value:k,strValue:"rgb("+k[0]+", "+k[1]+", "+k[2]+")"}}else{if(!u.number)return!1;var _=a.valueMin+(a.valueMax-a.valueMin)*b;s=this.parse(a.name,_,a.bypass,"mapping")}s||(s=this.parse(a.name,d.strValue,a.bypass,"mapping")),s||v(),s.mapping=a,a=s;break;case l.data:var M=a.field.split("."),I=p.data;if(I)for(var N=0;N0&&l>0){for(var c={},d=!1,h=0;h0?e.delayAnimation(u).play().promise().then(t):t()}).then(function(){return e.animation({style:c,duration:l,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(e,s),e.emitAndNotify("style"),o.transitioning=!1})}else o.transitioning&&(this.removeBypasses(e,s),e.emitAndNotify("style"),o.transitioning=!1)},o.checkZOrderTrigger=function(e,t,n,r){var i=this.properties[t];null==i.triggersZOrder||null!=n&&!i.triggersZOrder(n,r)||this._private.cy.notify({type:"zorder",eles:e})},e.exports=o},function(e,t,n){"use strict";var r=n(0),i=n(1),a={};a.applyBypass=function(e,t,n,a){var o=this,s=[];if("*"===t||"**"===t){if(void 0!==n)for(var l=0;ll.length?s.substr(l.length):""}function n(){u=u.length>c.length?u.substr(c.length):""}var a=this,o=this,s=""+e,l=void 0,u=void 0,c=void 0;for(s=s.replace(/[\/][*](\s|.)+?[*][\/]/g,"");;){if(s.match(/^\s*$/))break;var d=s.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!d){r.error("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+s);break}l=d[0];var h=d[1];if("core"!==h){if(new i(h)._private.invalid){r.error("Skipping parsing of block: Invalid selector found in string stylesheet: "+h),t();continue}}var p=d[2],f=!1;u=p;for(var v=[];;){if(u.match(/^\s*$/))break;var g=u.match(/^\s*(.+?)\s*:\s*(.+?)\s*;/);if(!g){r.error("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),f=!0;break}c=g[0];var y=g[1],m=g[2];if(a.properties[y]){o.parse(y,m)?(v.push({name:y,val:m}),n()):(r.error("Skipping property: Invalid property definition in: "+c),n())}else r.error("Skipping property: Invalid property name in: "+c),n()}if(f){t();break}o.selector(h);for(var b=0;b node").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3,"curve-style":"haystack"}).selector(":parent <-> node").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector("node:parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}).selector("core").css({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125}),this.defaultLength=this.length},e.exports=a},function(e,t,n){"use strict";var r=n(1),i=n(0),a=n(2),o={};o.parse=function(e,t,n,a){var o=this;if(i.fn(t))return o.parseImplWarn(e,t,n,a);var s="mapping"===a||!0===a||!1===a||null==a?"dontcare":a,l=[e,t,n,s].join("$"),u=o.propCache=o.propCache||{},c=void 0;return(c=u[l])||(c=u[l]=o.parseImplWarn(e,t,n,a)),(n||"mapping"===a)&&(c=r.copy(c))&&(c.value=r.copy(c.value)),c},o.parseImplWarn=function(e,t,n,i){var a=this.parseImpl(e,t,n,i);return a||null==t||r.error("The style property `%s: %s` is invalid",e,t),a},o.parseImpl=function(e,t,n,o){var s=this;e=r.camel2dash(e);var l=s.properties[e],u=t,c=s.types;if(!l)return null;if(void 0===t)return null;l.alias&&(l=l.pointsTo,e=l.name);var d=i.string(t);d&&(t=t.trim());var h=l.type;if(!h)return null;if(n&&(""===t||null===t))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(i.fn(t))return{name:e,value:t,strValue:"fn",mapped:c.fn,bypass:n};var p=void 0,f=void 0;if(!d||o);else{if(p=new RegExp(c.data.regex).exec(t)){if(n)return!1;var v=c.data;return{name:e,value:p,strValue:""+t,mapped:v,field:p[1],bypass:n}}if(f=new RegExp(c.mapData.regex).exec(t)){if(n)return!1;if(h.multiple)return!1;var g=c.mapData;if(!h.color&&!h.number)return!1;var y=this.parse(e,f[4]);if(!y||y.mapped)return!1;var m=this.parse(e,f[5]);if(!m||m.mapped)return!1;if(y.value===m.value)return!1;if(h.color){var b=y.value,x=m.value;if(!(b[0]!==x[0]||b[1]!==x[1]||b[2]!==x[2]||b[3]!==x[3]&&(null!=b[3]&&1!==b[3]||null!=x[3]&&1!==x[3])))return!1}return{name:e,value:f,strValue:""+t,mapped:g,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:y.value,valueMax:m.value,bypass:n}}}if(h.multiple&&"multiple"!==o){var w=void 0;if(w=d?t.split(/\s+/):i.array(t)?t:[t],h.evenMultiple&&w.length%2!=0)return null;for(var E=[],P=[],C=[],S=!1,T=0;Th.max||h.strictMax&&t===h.max))return null;var B={name:e,value:t,strValue:""+t+(_||""),units:_,bypass:n};return h.unitless||"px"!==_&&"em"!==_?B.pfValue=t:B.pfValue="px"!==_&&_?this.getEmSizeInPixels()*t:t,"ms"!==_&&"s"!==_||(B.pfValue="ms"===_?t:1e3*t),"deg"!==_&&"rad"!==_||(B.pfValue="rad"===_?t:a.deg2rad(t)),"%"===_&&(B.pfValue=t/100),B}if(h.propList){var z=[],L=""+t;if("none"===L);else{for(var A=L.split(","),O=0;O0&&s>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((o-2*t)/n.w,(s-2*t)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=lt.maxZoom?t.maxZoom:s,s=st.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=l,a.push("zoom"))}if(i&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var u=e.pan;r.number(u.x)&&(t.pan.x=u.x,s=!1),r.number(u.y)&&(t.pan.y=u.y,s=!1),s||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify({type:"viewport"})),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify({type:"viewport"})),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(r.string(e)){var n=e;e=this.mutableElements().filter(n)}else r.elementOrCollection(e)||(e=this.mutableElements());if(0!==e.length){var i=e.boundingBox(),a=this.width(),o=this.height();t=void 0===t?this._private.zoom:t;return{x:(a-t*(i.x1+i.x2))/2,y:(o-t*(i.y1+i.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,t=e.container;return e.sizeCache=e.sizeCache||(t?function(){var e=i.getComputedStyle(t),n=function(t){return parseFloat(e.getPropertyValue(t))};return{width:t.clientWidth-n("padding-left")-n("padding-right"),height:t.clientHeight-n("padding-top")-n("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}}};o.centre=o.center,o.autolockNodes=o.autolock,o.autoungrabifyNodes=o.autoungrabify,e.exports=o},function(e,t,n){"use strict";function r(e,t,n){var r=n,a=function(n){s.error("Can not register `"+t+"` for `"+e+"` since `"+n+"` already exists in the prototype and can not be overridden")};if("core"===e){if(c.prototype[t])return a(t);c.prototype[t]=n}else if("collection"===e){if(u.prototype[t])return a(t);u.prototype[t]=n}else if("layout"===e){for(var o=function(e){this.options=e,n.call(this,e),h.plainObject(this._private)||(this._private={}),this._private.cy=e.cy,this._private.listeners=[],this.createEmitter()},d=o.prototype=Object.create(n.prototype),v=[],g=0;g0;)!function(){var e=n.collection();r.bfs({roots:v[0],visit:function(t,n,r,i,a){e=e.add(t)},directed:!1}),v=v.not(e),f.push(e)}();u=n.collection();for(var g=0;gy.length-1;)y.push([]);y[G].push(H),Z.depth=G,Z.index=y[G].length-1}z()}var Q=0;if(t.avoidOverlap)for(var K=0;Kc||0===t)&&(r+=u/d,a++)}return a=Math.max(1,a),r/=a,0===a&&(r=void 0),re[e.id()]=r,r},ae=function(e,t){return ie(e)-ie(t)},oe=0;oe<3;oe++){for(var se=0;se=0;he--)for(var pe=y[he],fe=0;fe0&&y[0].length<=3?c/2:0),h=2*Math.PI/y[i].length*a;return 0===i&&1===y[0].length&&(d=1),{x:ce.x+d*Math.cos(h),y:ce.y+d*Math.sin(h)}}return{x:ce.x+(a+1-(o+1)/2)*s,y:(i+1)*u}}var p={x:ce.x+(a+1-(o+1)/2)*s,y:(i+1)*u};return p}(ve,y.length)}return i.layoutPositions(this,t,function(e){return de[e.id()]}),this},e.exports=r},function(e,t,n){"use strict";function r(e){this.options=i.extend({},s,e)}var i=n(1),a=n(2),o=n(0),s={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};r.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,s=r.nodes().not(":parent");t.sort&&(s=s.sort(t.sort));for(var l=a.makeBoundingBox(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),u={x:l.x1+l.w/2,y:l.y1+l.h/2},c=void 0===t.sweep?2*Math.PI-2*Math.PI/s.length:t.sweep,d=c/Math.max(1,s.length-1),h=void 0,p=0,f=0;f1&&t.avoidOverlap){p*=1.75;var b=Math.cos(d)-Math.cos(0),x=Math.sin(d)-Math.sin(0),w=Math.sqrt(p*p/(b*b+x*x));h=Math.max(w,h)}var E=function(e,n){var r=t.startAngle+n*d*(i?1:-1),a=h*Math.cos(r),o=h*Math.sin(r);return{x:u.x+a,y:u.y+o}};return s.layoutPositions(this,t,E),this},e.exports=r},function(e,t,n){"use strict";function r(e){this.options=i.extend({},o,e)}var i=n(1),a=n(2),o={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};r.prototype.run=function(){for(var e=this.options,t=e,n=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,r=e.cy,i=t.eles,o=i.nodes().not(":parent"),s=a.makeBoundingBox(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),l={x:s.x1+s.w/2,y:s.y1+s.h/2},u=[],c=(t.startAngle,0),d=0;d0){Math.abs(b[0].value-w.value)>=y&&(b=[],m.push(b))}b.push(w)}var E=c+t.minNodeSpacing;if(!t.avoidOverlap){var P=m.length>0&&m[0].length>1,C=Math.min(s.w,s.h)/2-E,S=C/(m.length+P?1:0);E=Math.min(E,S)}for(var T=0,D=0;D1&&t.avoidOverlap){var I=Math.cos(M)-Math.cos(0),N=Math.sin(M)-Math.sin(0),B=Math.sqrt(E*E/(I*I+N*N));T=Math.max(B,T)}k.r=T,T+=E}if(t.equidistant){for(var z=0,L=0,A=0;A0)var l=r.nodeOverlap*o,d=Math.sqrt(i*i+a*a),h=l*i/d,p=l*a/d;else var f=c(e,i,a),v=c(t,-1*i,-1*a),g=v.x-f.x,y=v.y-f.y,m=g*g+y*y,d=Math.sqrt(m),l=(e.nodeRepulsion+t.nodeRepulsion)/m,h=l*g/d,p=l*y/d;e.isLocked||(e.offsetX-=h,e.offsetY-=p),t.isLocked||(t.offsetX+=h,t.offsetY+=p)}},u=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else var i=t.maxX-e.minX;if(r>0)var a=e.maxY-t.minY;else var a=t.maxY-e.minY;return i>=0&&a>=0?Math.sqrt(i*i+a*a):0},c=function(e,t,n){var r=e.positionX,i=e.positionY,a=e.height||1,o=e.width||1,s=n/t,l=a/o,u={};return 0===t&&0n?(u.x=r,u.y=i+a/2,u):0t&&-1*l<=s&&s<=l?(u.x=r-o/2,u.y=i-o*n/2/t,u):0=l)?(u.x=r+a*t/2/n,u.y=i+a/2,u):0>n&&(s<=-1*l||s>=l)?(u.x=r-a*t/2/n,u.y=i-a/2,u):u},d=function(e,t){for(var n=0;n1){var f=t.gravity*d/p,v=t.gravity*h/p;c.offsetX+=f,c.offsetY+=v}}}}},p=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var a=n[r++],o=e.idToIndex[a],s=e.layoutNodes[o],l=s.children;if(0n)var i={x:n*e/r,y:n*t/r};else var i={x:e,y:t};return i},g=function e(t,n){var r=t.parentId;if(null!=r){var i=n.layoutNodes[n.idToIndex[r]],a=!1;return(null==i.maxX||t.maxX+i.padRight>i.maxX)&&(i.maxX=t.maxX+i.padRight,a=!0),(null==i.minX||t.minX-i.padLefti.maxY)&&(i.maxY=t.maxY+i.padBottom,a=!0),(null==i.minY||t.minY-i.padTopg&&(p+=v+t.componentSpacing,h=0,f=0,v=0)}}}(0,i),r}).then(function(e){h.layoutNodes=e.layoutNodes,o.stop(),b()});var b=function(){!0===t.animate||!1===t.animate?m({force:!0,next:function(){r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r})}}):t.eles.nodes().layoutPositions(r,t,function(e){var t=h.layoutNodes[h.idToIndex[e.data("id")]];return{x:t.positionX,y:t.positionY}})};return this},r.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},r.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var c=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),a={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:e.width(),clientHeight:e.width(),boundingBox:o.makeBoundingBox(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()})},l=n.eles.components(),u={},c=0;c0){a.graphSet.push(S);for(var c=0;cr.count?0:r.graph},h=function e(t,n,r,i){var a=i.graphSet[r];if(-1s){var v=d(),g=h();(v-1)*g>=s?d(v-1):(g-1)*v>=s&&h(g-1)}else for(;c*u=s?h(m+1):d(y+1)}var b=o.w/c,x=o.h/u;if(t.condense&&(b=0,x=0),t.avoidOverlap)for(var w=0;w=c&&(N=0,I++)},z={},L=0;L=0;E--){var P=f[E];P.isNode()?s(P)||u(P):function(n){var r,a=n._private,l=a.rscratch,u=n.pstyle("width").pfValue,c=n.pstyle("arrow-scale").value,d=u/2+m,f=d*d,g=2*d,b=a.source,x=a.target;if("segments"===l.edgeType||"straight"===l.edgeType||"haystack"===l.edgeType){for(var w=l.allpts,E=0;E+3(r=i.sqdistToFiniteLine(e,t,w[E],w[E+1],w[E+2],w[E+3])))return o(n,r),!0}else if("bezier"===l.edgeType||"multibezier"===l.edgeType||"self"===l.edgeType||"compound"===l.edgeType)for(var w=l.allpts,E=0;E+5(r=i.sqdistToQuadraticBezier(e,t,w[E],w[E+1],w[E+2],w[E+3],w[E+4],w[E+5])))return o(n,r),!0;for(var b=b||a.source,x=x||a.target,P=h.getArrowWidth(u,c),C=[{name:"source",x:l.arrowStartX,y:l.arrowStartY,angle:l.srcArrowAngle},{name:"target",x:l.arrowEndX,y:l.arrowEndY,angle:l.tgtArrowAngle},{name:"mid-source",x:l.midX,y:l.midY,angle:l.midsrcArrowAngle},{name:"mid-target",x:l.midX,y:l.midY,angle:l.midtgtArrowAngle}],E=0;E0&&(s(b),s(x))}(P)||u(P)||u(P,"source")||u(P,"target")}return v},o.getAllInBox=function(e,t,n,r){var a=this.getCachedZSortedEles().interactive,o=[],s=Math.min(e,n),l=Math.max(e,n),u=Math.min(t,r),c=Math.max(t,r);e=s,n=l,t=u,r=c;for(var d=i.makeBoundingBox({x1:e,y1:t,x2:n,y2:r}),h=0;hm?m+"$-$"+y:y+"$-$"+m,v&&(t="unbundled$-$"+p.id);var b=s[t];null==b&&(b=s[t]=[],l.push(t)),b.push(d),v&&(b.hasUnbundled=!0),g&&(b.hasBezier=!0)}else u.push(d)}for(var x,w,E,P,C,S,T,D,k,_,M,I,N=0;Nw.id()){var z=x;x=w,w=z}E=x.position(),P=w.position(),C=x.outerWidth(),S=x.outerHeight(),T=w.outerWidth(),D=w.outerHeight(),k=n.nodeShapes[this.getNodeShape(x)],_=n.nodeShapes[this.getNodeShape(w)],I=!1;for(var d,L,A,O={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0},R=E.x,V=E.y,q=C,F=S,j=P.x,X=P.y,Y=T,W=D,H=B.length,c=0;c=s||w){h={cp:m,segment:x};break}}if(h)break}var m=h.cp,x=h.segment,E=(s-v)/x.length,P=x.t1-x.t0,C=o?x.t0+P*E:x.t1-P*E;C=r.bound(0,C,1),t=r.qbezierPtAt(m.p0,m.p1,m.p2,C),a=u(m.p0,m.p1,m.p2,C);break;case"straight":case"segments":case"haystack":for(var S,T,D,k,_=0,M=i.allpts.length,y=0;y+3=s));y+=2);var I=s-T,C=I/S;C=r.bound(0,C,1),t=r.lineAt(D,k,C),a=l(D,k)}d("labelX",n,t.x),d("labelY",n,t.y),d("labelAutoAngle",n,a)}};f("source"),f("target"),this.applyLabelDimensions(e)}},o.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},o.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=this.calculateLabelDimensions(e,r);a.setPrefixedProperty(n.rstyle,"labelWidth",t,i.width),a.setPrefixedProperty(n.rscratch,"labelWidth",t,i.width),a.setPrefixedProperty(n.rstyle,"labelHeight",t,i.height),a.setPrefixedProperty(n.rscratch,"labelHeight",t,i.height)},o.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,o=e.pstyle("text-transform").value,s=function(e,r){return r?(a.setPrefixedProperty(n.rscratch,e,t,r),r):a.getPrefixedProperty(n.rscratch,e,t)};if(!i)return"";"none"==o||("uppercase"==o?i=i.toUpperCase():"lowercase"==o&&(i=i.toLowerCase()));var l=e.pstyle("text-wrap").value;if("wrap"===l){var u=s("labelKey");if(u&&s("labelWrapKey")===u)return s("labelWrapCachedText");for(var c=i.split("\n"),d=e.pstyle("text-max-width").pfValue,h=[],p=0;pd){for(var v=f.split(/\s+/),g="",y=0;yd)break;x+=i[E],E===i.length-1&&(w=!0)}return w||(x+="…"),x}return i},o.calculateLabelDimensions=function(e,t,n){var r=this,i=e._private.labelStyleKey+"$@$"+t;n&&(i+="$@$"+n);var a=r.labelDimCache||(r.labelDimCache={});if(a[i])return a[i];var o=e.pstyle("font-style").strValue,s=1*e.pstyle("font-size").pfValue+"px",l=e.pstyle("font-family").strValue,u=e.pstyle("font-weight").strValue,c=this.labelCalcDiv;c||(c=this.labelCalcDiv=document.createElement("div"),document.body.appendChild(c));var d=c.style;return d.fontFamily=l,d.fontStyle=o,d.fontSize=s,d.fontWeight=u,d.position="absolute",d.left="-9999px",d.top="-9999px",d.zIndex="-1",d.visibility="hidden",d.pointerEvents="none",d.padding="0",d.lineHeight="1","wrap"===e.pstyle("text-wrap").value?d.whiteSpace="pre":d.whiteSpace="normal",c.textContent=t,a[i]={width:Math.ceil(c.clientWidth/1),height:Math.ceil(c.clientHeight/1)},a[i]},o.calculateLabelAngles=function(e){var t=e._private,n=t.rscratch,r=e.isEdge(),i=e.pstyle("text-rotation"),a=i.strValue;"none"===a?n.labelAngle=n.sourceLabelAngle=n.targetLabelAngle=0:r&&"autorotate"===a?(n.labelAngle=n.labelAutoAngle,n.sourceLabelAngle=n.sourceLabelAutoAngle,n.targetLabelAngle=n.targetLabelAutoAngle):n.labelAngle=n.sourceLabelAngle=n.targetLabelAngle="autorotate"===a?0:i.pfValue},e.exports=o},function(e,t,n){"use strict";var r={};r.getNodeShape=function(e){var t=this,n=e.pstyle("shape").value;if(e.isParent())return"rectangle"===n||"roundrectangle"===n||"cutrectangle"===n||"barrel"===n?n:"rectangle";if("polygon"===n){var r=e.pstyle("shape-polygon-points").value;return t.nodeShapes.makePolygon(r).name}return n},e.exports=r},function(e,t,n){"use strict";var r={};r.registerCalculationListeners=function(){var e=this.cy,t=e.collection(),n=this,r=function(e,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t.merge(e);for(var i=0;i=e.desktopTapThreshold2}var _=n(i);y&&(e.hoverData.tapholdCancelled=!0),s=!0,t(v,["mousemove","vmousemove","tapdrag"],i,{position:{x:d[0],y:d[1]}});var M=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||l.emit("boxstart"),f[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(y){var I={originalEvent:i,type:"cxtdrag",position:{x:d[0],y:d[1]}};x?x.emit(I):l.emit(I),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&v===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:i,type:"cxtdragout",position:{x:d[0],y:d[1]}}),e.hoverData.cxtOver=v,v&&v.emit({originalEvent:i,type:"cxtdragover",position:{x:d[0],y:d[1]}}))}}else if(e.hoverData.dragging){if(s=!0,l.panningEnabled()&&l.userPanningEnabled()){var N;if(e.hoverData.justStartedPan){var B=e.hoverData.mdownPos;N={x:(d[0]-B[0])*u,y:(d[1]-B[1])*u},e.hoverData.justStartedPan=!1}else N={x:w[0]*u,y:w[1]*u};l.panBy(N),e.hoverData.dragged=!0}d=e.projectIntoViewport(i.clientX,i.clientY)}else if(1!=f[4]||null!=x&&!x.isEdge()){if(x&&x.isEdge()&&x.active()&&x.unactivate(),x&&x.grabbed()||v==b||(b&&t(b,["mouseout","tapdragout"],i,{position:{x:d[0],y:d[1]}}),v&&t(v,["mouseover","tapdragover"],i,{position:{x:d[0],y:d[1]}}),e.hoverData.last=v),x)if(y){if(l.boxSelectionEnabled()&&_)x&&x.grabbed()&&(m(E),x.emit("free")),M();else if(x&&x.grabbed()&&e.nodeIsDraggable(x)){var z=!e.dragData.didDrag;z&&e.redrawHint("eles",!0),e.dragData.didDrag=!0;var L=[];e.hoverData.draggingEles||g(l.collection(E),{inDragLayer:!0});for(var A=0;A0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=l=[]),t(s,["mouseup","tapend","vmouseup"],r,{position:{x:a[0],y:a[1]}}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||t(u,["click","tap","vclick"],r,{position:{x:a[0],y:a[1]}}),s!=u||e.dragData.didDrag||e.hoverData.selecting||null!=s&&s._private.selectable&&(e.hoverData.dragging||("additive"===i.selectionType()||c?s.selected()?s.unselect():s.select():c||(i.$(":selected").unmerge(s).unselect(),s.select())),e.redrawHint("eles",!0)),e.hoverData.selecting){var p=i.collection(e.getAllInBox(o[0],o[1],o[2],o[3]));e.redrawHint("select",!0),p.length>0&&e.redrawHint("eles",!0),i.emit("boxend");var f=function(e){return e.selectable()&&!e.selected()};"additive"===i.selectionType()?p.emit("box").stdFilter(f).select().emit("boxselect"):(c||i.$(":selected").unmerge(p).unselect(),p.emit("box").stdFilter(f).select().emit("boxselect")),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!o[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var v=u&&u.grabbed();m(l),v&&u.emit("free")}}o[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null}},!1);var T=function(t){if(!e.scrollingPage){var n=e.cy,r=e.projectIntoViewport(t.clientX,t.clientY),i=[r[0]*n.zoom()+n.pan().x,r[1]*n.zoom()+n.pan().y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||C())return void t.preventDefault();if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){t.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout(function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()},150);var a;a=null!=t.deltaY?t.deltaY/-250:null!=t.wheelDeltaY?t.wheelDeltaY/1e3:t.wheelDelta/1e3,a*=e.wheelSensitivity;1===t.deltaMode&&(a*=33),n.zoom({level:n.zoom()*Math.pow(10,a),renderedPosition:{x:i[0],y:i[1]}})}}};e.registerBinding(e.container,"wheel",T,!0),e.registerBinding(window,"scroll",function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout(function(){e.scrollingPage=!1},250)},!0),e.registerBinding(e.container,"mouseout",function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseout",position:{x:n[0],y:n[1]}})},!1),e.registerBinding(e.container,"mouseover",function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseover",position:{x:n[0],y:n[1]}})},!1);var D,k,_,M,I,N,B,z,L,A,O,R,V,q,F=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},j=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};e.registerBinding(e.container,"touchstart",q=function(n){if(S(n)){x(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var r=e.cy,i=e.touchData.now,a=e.touchData.earlier;if(n.touches[0]){var o=e.projectIntoViewport(n.touches[0].clientX,n.touches[0].clientY);i[0]=o[0],i[1]=o[1]}if(n.touches[1]){var o=e.projectIntoViewport(n.touches[1].clientX,n.touches[1].clientY);i[2]=o[0],i[3]=o[1]}if(n.touches[2]){var o=e.projectIntoViewport(n.touches[2].clientX,n.touches[2].clientY);i[4]=o[0],i[5]=o[1]}if(n.touches[1]){m(e.dragData.touchDragEles);var s=e.findContainerClientCoords();L=s[0],A=s[1],O=s[2],R=s[3],D=n.touches[0].clientX-L,k=n.touches[0].clientY-A,_=n.touches[1].clientX-L,M=n.touches[1].clientY-A,V=0<=D&&D<=O&&0<=_&&_<=O&&0<=k&&k<=R&&0<=M&&M<=R;var l=r.pan(),u=r.zoom();I=F(D,k,_,M),N=j(D,k,_,M),B=[(D+_)/2,(k+M)/2],z=[(B[0]-l.x)/u,(B[1]-l.y)/u];if(N<4e4&&!n.touches[2]){var c=e.findNearestElement(i[0],i[1],!0,!0),d=e.findNearestElement(i[2],i[3],!0,!0);return c&&c.isNode()?(c.activate().emit({originalEvent:n,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=c):d&&d.isNode()?(d.activate().emit({originalEvent:n,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=d):r.emit({originalEvent:n,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,void e.redraw()}}if(n.touches[2]);else if(n.touches[1]);else if(n.touches[0]){var p=e.findNearestElements(i[0],i[1],!0,!0),f=p[0];if(null!=f&&(f.activate(),e.touchData.start=f,e.touchData.starts=p,e.nodeIsGrabbable(f))){var v=e.dragData.touchDragEles=[],b=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),f.selected()?(b=r.$(function(t){return t.selected()&&e.nodeIsGrabbable(t)}),g(b,{addToList:v})):y(f,{addToList:v}),h(f);var w=function(e){return{originalEvent:n,type:e,position:{x:i[0],y:i[1]}}};f.emit(w("grabon")),b?b.forEach(function(e){e.emit(w("grab"))}):f.emit(w("grab"))}t(f,["touchstart","tapstart","vmousedown"],n,{position:{x:i[0],y:i[1]}}),null==f&&(e.data.bgActivePosistion={x:o[0],y:o[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout(function(){!1!==e.touchData.singleTouchMoved||e.pinching||e.touchData.selecting||(t(e.touchData.start,["taphold"],n,{position:{x:i[0],y:i[1]}}),e.touchData.start||r.$(":selected").unselect())},e.tapholdDuration)}if(n.touches.length>=1){for(var E=e.touchData.startPosition=[],P=0;P=e.touchTapThreshold2}if(i&&e.touchData.cxt){n.preventDefault();var E=n.touches[0].clientX-L,P=n.touches[0].clientY-A,C=n.touches[1].clientX-L,T=n.touches[1].clientY-A,B=j(E,P,C,T),O=B/N;if(O>=2.25||B>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var R={originalEvent:n,type:"cxttapend",position:{x:u[0],y:u[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(R),e.touchData.start=null):l.emit(R)}}if(i&&e.touchData.cxt){var R={originalEvent:n,type:"cxtdrag",position:{x:u[0],y:u[1]}};e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(R):l.emit(R),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var q=e.findNearestElement(u[0],u[1],!0,!0);e.touchData.cxtOver&&q===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:n,type:"cxtdragout",position:{x:u[0],y:u[1]}}),e.touchData.cxtOver=q,q&&q.emit({originalEvent:n,type:"cxtdragover",position:{x:u[0],y:u[1]}}))}else if(i&&n.touches[2]&&l.boxSelectionEnabled())n.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||l.emit("boxstart"),e.touchData.selecting=!0,e.redrawHint("select",!0),s&&0!==s.length&&void 0!==s[0]?(s[2]=(u[0]+u[2]+u[4])/3,s[3]=(u[1]+u[3]+u[5])/3):(s[0]=(u[0]+u[2]+u[4])/3,s[1]=(u[1]+u[3]+u[5])/3,s[2]=(u[0]+u[2]+u[4])/3+1,s[3]=(u[1]+u[3]+u[5])/3+1),s[4]=1,e.touchData.selecting=!0,e.redraw();else if(i&&n.touches[1]&&l.zoomingEnabled()&&l.panningEnabled()&&l.userZoomingEnabled()&&l.userPanningEnabled()){n.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var X=e.dragData.touchDragEles;if(X){e.redrawHint("drag",!0);for(var Y=0;Y0&&!e.hoverData.draggingEles&&!e.swipePanning&&null!=e.data.bgActivePosistion&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1);var Y;e.registerBinding(window,"touchcancel",Y=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()});var W;if(e.registerBinding(window,"touchend",W=function(n){var r=e.touchData.start;if(e.touchData.capture){0===n.touches.length&&(e.touchData.capture=!1),n.preventDefault();var i=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var a=e.cy,o=a.zoom(),s=e.touchData.now,l=e.touchData.earlier;if(n.touches[0]){var u=e.projectIntoViewport(n.touches[0].clientX,n.touches[0].clientY);s[0]=u[0],s[1]=u[1]}if(n.touches[1]){var u=e.projectIntoViewport(n.touches[1].clientX,n.touches[1].clientY);s[2]=u[0],s[3]=u[1]}if(n.touches[2]){var u=e.projectIntoViewport(n.touches[2].clientX,n.touches[2].clientY);s[4]=u[0],s[5]=u[1]}r&&r.unactivate();var c;if(e.touchData.cxt){if(c={originalEvent:n,type:"cxttapend",position:{x:s[0],y:s[1]}},r?r.emit(c):a.emit(c),!e.touchData.cxtDragged){var d={originalEvent:n,type:"cxttap",position:{x:s[0],y:s[1]}};r?r.emit(d):a.emit(d)}return e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,void e.redraw()}if(!n.touches[2]&&a.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var h=a.collection(e.getAllInBox(i[0],i[1],i[2],i[3]));i[0]=void 0,i[1]=void 0,i[2]=void 0,i[3]=void 0,i[4]=0,e.redrawHint("select",!0),a.emit("boxend");var p=function(e){return e.selectable()&&!e.selected()};h.emit("box").stdFilter(p).select().emit("boxselect"),h.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(null!=r&&r.unactivate(),n.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(n.touches[1]);else if(n.touches[0]);else if(!n.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var f=e.dragData.touchDragEles;if(null!=r){var v=r._private.grabbed;m(f),e.redrawHint("drag",!0),e.redrawHint("eles",!0),v&&r.emit("free"),t(r,["touchend","tapend","vmouseup","tapdragout"],n,{position:{x:s[0],y:s[1]}}),r.unactivate(),e.touchData.start=null}else{var g=e.findNearestElement(s[0],s[1],!0,!0);t(g,["touchend","tapend","vmouseup","tapdragout"],n,{position:{x:s[0],y:s[1]}})}var y=e.touchData.startPosition[0]-s[0],b=y*y,x=e.touchData.startPosition[1]-s[1],w=x*x,E=b+w,P=E*o*o;null!=r&&!e.dragData.didDrag&&r._private.selectable&&P0)return v[0]}return null}(e,t,v);if(null!=g){var y=v[5],m=v[3],b=v[1],x=r.qbezierAt(y,m,b,g);if(v.isTop&&x<=t)return!0;if(v.isBottom&&t<=x)return!0}}return!1}}},i.generateBottomRoundrectangle=function(){return this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottomroundrectangle",points:r.generateUnitNgonPointsFitToSquare(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,i,a,o,s){var l=e-(n/2+s),u=t-(i/2+s),c=u,d=e+(n/2+s),h=r.finiteLinesIntersect(a,o,e,t,l,u,d,c,!1);return h.length>0?h:r.roundRectangleIntersectLine(a,o,e,t,n,i,s)},checkPoint:function(e,t,n,i,a,o,s){var l=r.getRoundRectangleRadius(i,a),u=2*l;if(r.pointInsidePolygon(e,t,this.points,o,s,i,a-u,[0,-1],n))return!0;if(r.pointInsidePolygon(e,t,this.points,o,s,i-u,a,[0,-1],n))return!0;var c=i/2+2*n,d=a/2+2*n,h=[o-c,s-d,o-c,s,o+c,s,o+c,s-d];return!!r.pointInsidePolygonPoints(e,t,h)||(!!r.checkInEllipse(e,t,u,u,o+i/2-l,s+a/2-l,n)||!!r.checkInEllipse(e,t,u,u,o-i/2+l,s+a/2-l,n))}}},i.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",r.generateUnitNgonPointsFitToSquare(3,0)),this.generatePolygon("rectangle",r.generateUnitNgonPointsFitToSquare(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle(),this.generatePolygon("diamond",[0,1,1,0,0,-1,-1,0]),this.generatePolygon("pentagon",r.generateUnitNgonPointsFitToSquare(5,0)),this.generatePolygon("hexagon",r.generateUnitNgonPointsFitToSquare(6,0)),this.generatePolygon("heptagon",r.generateUnitNgonPointsFitToSquare(7,0)),this.generatePolygon("octagon",r.generateUnitNgonPointsFitToSquare(8,0));var n=new Array(20),i=r.generateUnitNgonPoints(5,0),a=r.generateUnitNgonPoints(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s0&&t.data.lyrTxrCache.invalidateElements(n)})}var i=n(1),a=n(0),o=n(125),s=n(126),l=r,u=r.prototype;u.CANVAS_LAYERS=3,u.SELECT_BOX=0,u.DRAG=1,u.NODE=2,u.BUFFER_COUNT=3,u.TEXTURE_BUFFER=0,u.MOTIONBLUR_BUFFER_NODE=1,u.MOTIONBLUR_BUFFER_DRAG=2,u.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[u.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[u.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[u.SELECT_BOX]=t}};var c="undefined"!=typeof Path2D;u.path2dEnabled=function(e){if(void 0===e)return this.pathsEnabled;this.pathsEnabled=!!e},u.usePaths=function(){return c&&this.pathsEnabled},[n(127),n(128),n(129),n(130),n(131),n(132),n(133),n(134),n(135),n(136)].forEach(function(e){i.extend(u,e)}),e.exports=l},function(e,t,n){"use strict";var r=n(2),i=n(1),a=n(9),o=n(19),s={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},l=function(e){var t=this;t.renderer=e,t.onDequeues=[],t.setupDequeueing()},u=l.prototype;u.reasons=s,u.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},u.getRetiredTextureQueue=function(e){var t=this,n=t.eleImgCaches.retired=t.eleImgCaches.retired||{};return n[e]=n[e]||[]},u.getElementQueue=function(){var e=this;return e.eleCacheQueue=e.eleCacheQueue||new a(function(e,t){return t.reqs-e.reqs})},u.getElementIdToQueue=function(){var e=this;return e.eleIdToCacheQueue=e.eleIdToCacheQueue||{}},u.getElement=function(e,t,n,i,a){var o=this,l=this.renderer,u=e._private.rscratch,c=l.cy.zoom();if(0===t.w||0===t.h||!e.visible())return null;if(null==i&&(i=Math.ceil(r.log2(c*n))),i<-4)i=-4;else if(c>=3.99||i>2)return null;var d=Math.pow(2,i),h=t.h*d,p=t.w*d,f=u.imgCaches=u.imgCaches||{},v=f[i];if(v)return v;var g;if(g=h<=25?25:h<=50?50:50*Math.ceil(h/50),h>1024||p>1024||e.isEdge()||e.isParent())return null;var y=o.getTextureQueue(g),m=y[y.length-2],b=function(){return o.recycleTexture(g,p)||o.addTexture(g,p)};m||(m=y[y.length-1]),m||(m=b()),m.width-m.usedWidthi;T--)k=o.getElement(e,t,n,T,s.downscale);_()}else{var M;if(!P&&!C&&!S)for(var T=i-1;T>=-4;T--){var D=f[T];if(D){M=D;break}}if(E(M))return o.queueElement(e,i),M;m.context.translate(m.usedWidth,0),m.context.scale(d,d),l.drawElement(m.context,e,t,w),m.context.scale(1/d,1/d),m.context.translate(-m.usedWidth,0)}return v=f[i]={ele:e,x:m.usedWidth,texture:m,level:i,scale:d,width:p,height:h,scaledLabelShown:w},m.usedWidth+=Math.ceil(p+8),m.eleCaches.push(v),o.checkTextureFullness(m),v},u.invalidateElement=function(e){var t=this,n=e._private.rscratch.imgCaches;if(n)for(var r=-4;r<=2;r++){var a=n[r];if(a){var o=a.texture;o.invalidatedWidth+=a.width,n[r]=null,i.removeFromArray(o.eleCaches,a),t.removeFromQueue(e),t.checkTextureUtility(o)}}},u.checkTextureUtility=function(e){e.invalidatedWidth>=.5*e.width&&this.retireTexture(e)},u.checkTextureFullness=function(e){var t=this,n=t.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?i.removeFromArray(n,e):e.fullnessChecks++},u.retireTexture=function(e){var t=this,n=e.height,r=t.getTextureQueue(n);i.removeFromArray(r,e),e.retired=!0;for(var a=e.eleCaches,o=0;o=t)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,i.clearArray(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),i.removeFromArray(a,s),r.push(s),s}},u.queueElement=function(e,t){var n=this,r=n.getElementQueue(),i=n.getElementIdToQueue(),a=e.id(),o=i[a];if(o)o.level=Math.max(o.level,t),o.reqs++,r.updateItem(o);else{var s={ele:e,level:t,reqs:1};r.push(s),i[a]=s}},u.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementIdToQueue(),i=[],a=0;a<1&&n.size()>0;a++){var o=n.pop(),l=o.ele;if(null==l._private.rscratch.imgCaches[o.level]){r[l.id()]=null,i.push(o);var u=l.boundingBox();t.getElement(l,u,e,o.level,s.dequeue)}}return i},u.removeFromQueue=function(e){var t=this,n=t.getElementQueue(),r=t.getElementIdToQueue(),a=r[e.id()];null!=a&&(a.reqs=i.MAX_INT,n.updateItem(a),n.pop(),r[e.id()]=null)},u.onDequeue=function(e){this.onDequeues.push(e)},u.offDequeue=function(e){i.removeFromArray(this.onDequeues,e)},u.setupDequeueing=o.setupDequeueing({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n=3.99||n>2)return null;r.validateLayersElesOrdering(n,e);var c,d,h=r.layersByLevel,p=Math.pow(2,n),f=h[n]=h[n]||[],v=r.levelIsComplete(n,e);if(v)return f;!function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return d=h[t],!0},a=function(e){if(!d)for(var r=n+e;-4<=r&&r<=2&&!t(r);r+=e);};a(1),a(-1);for(var o=f.length-1;o>=0;o--){var s=f[o];s.invalid&&i.removeFromArray(f,s)}}();var g=function(){if(!c){c=a.makeBoundingBox();for(var t=0;t=m||!a.boundingBoxInBoundingBox(y.bb,w.boundingBox()))&&!(y=function(e){e=e||{};var t=e.after;if(g(),c.w*p*(c.h*p)>16e6)return null;var i=r.makeLayer(c,n);if(null!=t){var a=f.indexOf(t)+1;f.splice(a,0,i)}else(void 0===e.insert||e.insert)&&f.unshift(i);return i}({insert:!0,after:y})))return null;d||b?r.queueLayer(y,w):r.drawEleInLayer(y,w,n,t),y.eles.push(w),P[n]=y}}return d||(b?null:f)},c.getEleLevelForLayerLevel=function(e,t){return e},c.drawEleInLayer=function(e,t,n,i){var a=this,o=this.renderer,s=e.context,l=t.boundingBox();if(0!==l.w&&0!==l.h&&t.visible()){var u=a.eleTxrCache,c=u.reasons.highQuality;n=a.getEleLevelForLayerLevel(n,i);var d=u.getElement(t,l,null,n,c);d?(r(s,!1),s.drawImage(d.texture.canvas,d.x,0,d.width,d.height,l.x1,l.y1,l.w,l.h),r(s,!0)):o.drawElement(s,t)}},c.levelIsComplete=function(e,t){var n=this,r=n.layersByLevel[e];if(!r||0===r.length)return!1;for(var i=0,a=0;a0)return!1;if(o.invalid)return!1;i+=o.eles.length}return i===t.length},c.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r0){t=!0;break}}return t},c.invalidateElements=function(e){var t=this;t.lastInvalidationTime=i.performanceNow(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,function(e,n,r){t.invalidateLayer(e)})},c.invalidateLayer=function(e){if(this.lastInvalidationTime=i.performanceNow(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];i.removeFromArray(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:p;e.lineWidth=v,e.lineCap="butt",i.strokeStyle(e,h[0],h[1],h[2],n),i.drawEdgePath(t,e,a.allpts,f)},y=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p;i.drawArrowheads(e,t,n)};e.lineJoin="round";if("yes"===t.pstyle("ghost").value){var m=t.pstyle("ghost-offset-x").pfValue,b=t.pstyle("ghost-offset-y").pfValue,x=t.pstyle("ghost-opacity").value,w=p*x;e.translate(m,b),g(w),y(w),e.translate(-m,-b)}g(),y(),function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c;e.lineWidth=u,"self"!==a.edgeType||o?e.lineCap="round":e.lineCap="butt",i.strokeStyle(e,d[0],d[1],d[2],n),i.drawEdgePath(t,e,a.allpts,"solid")}(),function(){i.drawElementText(e,t,r)}(),n&&e.translate(s.x1,s.y1)}},r.drawEdgePath=function(e,t,n,r){var i=e._private.rscratch,a=t,o=void 0,s=!1,l=this.usePaths();if(l){var u=n.join("$");i.pathCacheKey&&i.pathCacheKey===u?(o=t=i.pathCache,s=!0):(o=t=new Path2D,i.pathCacheKey=u,i.pathCache=o)}if(a.setLineDash)switch(r){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash([6,3]);break;case"solid":a.setLineDash([])}if(!s&&!i.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var c=2;c+30||T>0&&S>0){var k=l-D;switch(m){case"left":k-=h;break;case"center":k-=h/2}var _=u-p-D,M=h+2*D,I=p+2*D;if(C>0){var N=e.fillStyle,B=t.pstyle("text-background-color").value;e.fillStyle="rgba("+B[0]+","+B[1]+","+B[2]+","+C*s+")";"roundrectangle"==t.pstyle("text-background-shape").strValue?r(e,k,_,M,I,2):e.fillRect(k,_,M,I),e.fillStyle=N}if(T>0&&S>0){var z=e.strokeStyle,L=e.lineWidth,A=t.pstyle("text-border-color").value,O=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+A[0]+","+A[1]+","+A[2]+","+S*s+")",e.lineWidth=T,e.setLineDash)switch(O){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=T/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(e.strokeRect(k,_,M,I),"double"===O){var R=T/2;e.strokeRect(k+R,_+R,M-2*R,I-2*R)}e.setLineDash&&e.setLineDash([]),e.lineWidth=L,e.strokeStyle=z}}var V=2*t.pstyle("text-outline-width").pfValue;if(V>0&&(e.lineWidth=V),"wrap"===t.pstyle("text-wrap").value){var q=i.getPrefixedProperty(o,"labelWrapCachedLines",n),F=p/q.length;switch(b){case"top":u-=(q.length-1)*F;break;case"center":case"bottom":u-=(q.length-1)*F}for(var j=0;j0&&e.strokeText(q[j],l,u),e.fillText(q[j],l,u),u+=F}else V>0&&e.strokeText(c,l,u),e.fillText(c,l,u);0!==x&&(e.rotate(-x),e.translate(-E,-P))}}},e.exports=o},function(e,t,n){"use strict";var r=n(0),i={};i.drawNode=function(e,t,n,i){var a=this,o=void 0,s=void 0,l=t._private,u=l.rscratch,c=t.position();if(r.number(c.x)&&r.number(c.y)&&t.visible()){var d=t.effectiveOpacity(),h=a.usePaths(),p=void 0,f=!1,v=t.padding();o=t.width()+2*v,s=t.height()+2*v;var g=void 0;n&&(g=n,e.translate(-g.x1,-g.y1));for(var y=t.pstyle("background-image"),m=y.value,b=new Array(m.length),x=new Array(m.length),w=0,E=0;E0&&void 0!==arguments[0]?arguments[0]:k;a.fillStyle(e,D[0],D[1],D[2],t)},B=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:I;a.strokeStyle(e,_[0],_[1],_[2],t)},z=t.pstyle("shape").strValue,L=t.pstyle("shape-polygon-points").pfValue;if(h){var A=z+"$"+o+"$"+s+("polygon"===z?"$"+L.join("$"):"");e.translate(c.x,c.y),u.pathCacheKey===A?(p=u.pathCache,f=!0):(p=new Path2D,u.pathCacheKey=A,u.pathCache=p)}var O=function(){if(!f){var n=c;h&&(n={x:0,y:0}),a.nodeShapes[a.getNodeShape(t)].draw(p||e,n.x,n.y,o,s)}h?e.fill(p):e.fill()},R=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,r=l.backgrounding,i=0,o=0;o0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;a.hasPie(t)&&(a.drawPie(e,t,r),n&&(h||a.nodeShapes[a.getNodeShape(t)].draw(e,c.x,c.y,o,s)))},q=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,n=(S>0?S:-S)*t,r=S>0?0:255;0!==S&&(a.fillStyle(e,r,r,r,n),h?e.fill(p):e.fill())},F=function(){if(T>0){if(e.lineWidth=T,e.lineCap="butt",e.setLineDash)switch(M){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}if(h?e.stroke(p):e.stroke(),"double"===M){e.lineWidth=T/3;var t=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",h?e.stroke(p):e.stroke(),e.globalCompositeOperation=t}e.setLineDash&&e.setLineDash([])}};if("yes"===t.pstyle("ghost").value){var j=t.pstyle("ghost-offset-x").pfValue,X=t.pstyle("ghost-offset-y").pfValue,Y=t.pstyle("ghost-opacity").value,W=Y*d;e.translate(j,X),N(Y*k),O(),R(W),V(0!==S||0!==T),q(W),B(Y*I),F(),e.translate(-j,-X)}N(),O(),R(),V(0!==S||0!==T),q(),B(),F(),h&&e.translate(-c.x,-c.y),function(){a.drawElementText(e,t,i)}(),function(){var n=t.pstyle("overlay-padding").pfValue,r=t.pstyle("overlay-opacity").value,i=t.pstyle("overlay-color").value;r>0&&(a.fillStyle(e,i[0],i[1],i[2],r),a.nodeShapes.roundrectangle.draw(e,c.x,c.y,o+2*n,s+2*n),e.fill())}(),n&&e.translate(g.x1,g.y1)}},i.hasPie=function(e){return e=e[0],e._private.hasPie},i.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var i=t.cy().style(),a=t.pstyle("pie-size"),o=r.x,s=r.y,l=t.width(),u=t.height(),c=Math.min(l,u)/2,d=0;this.usePaths()&&(o=0,s=0),"%"===a.units?c*=a.pfValue:void 0!==a.pfValue&&(c=a.pfValue/2);for(var h=1;h<=i.pieBackgroundN;h++){var p=t.pstyle("pie-"+h+"-background-size").value,f=t.pstyle("pie-"+h+"-background-color").value,v=t.pstyle("pie-"+h+"-background-opacity").value*n,g=p/100;g+d>1&&(g=1-d);var y=1.5*Math.PI+2*Math.PI*d,m=2*Math.PI*g,b=y+m;0===p||d>=1||d+g>1||(e.beginPath(),e.moveTo(o,s),e.arc(o,s,c,y,b),e.closePath(),this.fillStyle(e,f[0],f[1],f[2],v),e.fill(),d+=g)}},e.exports=i},function(e,t,n){"use strict";var r={},i=n(1);r.getPixelRatio=function(){var e=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t},r.paintCache=function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;iu.minMbLowQualFrames&&(u.motionBlurPxRatio=u.mbPxRBlurry)),u.clearingMotionBlur&&(u.motionBlurPxRatio=1),u.textureDrawLastFrame&&!f&&(p[u.NODE]=!0,p[u.SELECT_BOX]=!0);var w=d.style()._private.coreStyle,E=d.zoom(),P=void 0!==s?s:E,C=d.pan(),S={x:C.x,y:C.y},T={zoom:E,pan:{x:C.x,y:C.y}},D=u.prevViewport;void 0===D||T.zoom!==D.zoom||T.pan.x!==D.pan.x||T.pan.y!==D.pan.y||m&&!y||(u.motionBlurPxRatio=1),l&&(S=l),P*=c,S.x*=c,S.y*=c;var k=u.getCachedZSortedEles();if(f||(u.textureDrawLastFrame=!1),f){u.textureDrawLastFrame=!0;if(!u.textureCache){u.textureCache={},u.textureCache.bb=d.mutableElements().boundingBox(),u.textureCache.texture=u.data.bufferCanvases[u.TEXTURE_BUFFER];var _=u.data.bufferContexts[u.TEXTURE_BUFFER];_.setTransform(1,0,0,1,0,0),_.clearRect(0,0,u.canvasWidth*u.textureMult,u.canvasHeight*u.textureMult),u.render({forcedContext:_,drawOnlyNodeLayer:!0,forcedPxRatio:c*u.textureMult});var T=u.textureCache.viewport={zoom:d.zoom(),pan:d.pan(),width:u.canvasWidth,height:u.canvasHeight};T.mpan={x:(0-T.pan.x)/T.zoom,y:(0-T.pan.y)/T.zoom}}p[u.DRAG]=!1,p[u.NODE]=!1;var M=h.contexts[u.NODE],I=u.textureCache.texture,T=u.textureCache.viewport;u.textureCache.bb,M.setTransform(1,0,0,1,0,0),v?t(M,0,0,T.width,T.height):M.clearRect(0,0,T.width,T.height);var N=w["outside-texture-bg-color"].value,B=w["outside-texture-bg-opacity"].value;u.fillStyle(M,N[0],N[1],N[2],B),M.fillRect(0,0,T.width,T.height);var E=d.zoom();n(M,!1),M.clearRect(T.mpan.x,T.mpan.y,T.width/T.zoom/c,T.height/T.zoom/c),M.drawImage(I,T.mpan.x,T.mpan.y,T.width/T.zoom/c,T.height/T.zoom/c)}else u.textureOnViewport&&!r&&(u.textureCache=null);var z=d.extent(),L=u.pinching||u.hoverData.dragging||u.swipePanning||u.data.wheelZooming||u.hoverData.draggingEles,A=u.hideEdgesOnViewport&&L,O=[];if(O[u.NODE]=!p[u.NODE]&&v&&!u.clearedForMotionBlur[u.NODE]||u.clearingMotionBlur,O[u.NODE]&&(u.clearedForMotionBlur[u.NODE]=!0),O[u.DRAG]=!p[u.DRAG]&&v&&!u.clearedForMotionBlur[u.DRAG]||u.clearingMotionBlur,O[u.DRAG]&&(u.clearedForMotionBlur[u.DRAG]=!0),p[u.NODE]||a||o||O[u.NODE]){var R=v&&!O[u.NODE]&&1!==g,M=r||(R?u.data.bufferContexts[u.MOTIONBLUR_BUFFER_NODE]:h.contexts[u.NODE]);n(M,v&&!R?"motionBlur":void 0),A?u.drawCachedNodes(M,k.nondrag,c,z):u.drawLayeredElements(M,k.nondrag,c,z),u.debug&&u.drawDebugPoints(M,k.nondrag),a||v||(p[u.NODE]=!1)}if(!o&&(p[u.DRAG]||a||O[u.DRAG])){var R=v&&!O[u.DRAG]&&1!==g,M=r||(R?u.data.bufferContexts[u.MOTIONBLUR_BUFFER_DRAG]:h.contexts[u.DRAG]);n(M,v&&!R?"motionBlur":void 0),A?u.drawCachedNodes(M,k.drag,c,z):u.drawCachedElements(M,k.drag,c,z),u.debug&&u.drawDebugPoints(M,k.drag),a||v||(p[u.DRAG]=!1)}if(u.showFps||!o&&p[u.SELECT_BOX]&&!a){var M=r||h.contexts[u.SELECT_BOX];if(n(M),1==u.selection[4]&&(u.hoverData.selecting||u.touchData.selecting)){var E=u.cy.zoom(),V=w["selection-box-border-width"].value/E;M.lineWidth=V,M.fillStyle="rgba("+w["selection-box-color"].value[0]+","+w["selection-box-color"].value[1]+","+w["selection-box-color"].value[2]+","+w["selection-box-opacity"].value+")",M.fillRect(u.selection[0],u.selection[1],u.selection[2]-u.selection[0],u.selection[3]-u.selection[1]),V>0&&(M.strokeStyle="rgba("+w["selection-box-border-color"].value[0]+","+w["selection-box-border-color"].value[1]+","+w["selection-box-border-color"].value[2]+","+w["selection-box-opacity"].value+")",M.strokeRect(u.selection[0],u.selection[1],u.selection[2]-u.selection[0],u.selection[3]-u.selection[1]))}if(h.bgActivePosistion&&!u.hoverData.selecting){var E=u.cy.zoom(),q=h.bgActivePosistion;M.fillStyle="rgba("+w["active-bg-color"].value[0]+","+w["active-bg-color"].value[1]+","+w["active-bg-color"].value[2]+","+w["active-bg-opacity"].value+")",M.beginPath(),M.arc(q.x,q.y,w["active-bg-size"].pfValue/E,0,2*Math.PI),M.fill()}var F=u.lastRedrawTime;if(u.showFps&&F){F=Math.round(F);var j=Math.round(1e3/F);M.setTransform(1,0,0,1,0,0),M.fillStyle="rgba(255, 0, 0, 0.75)",M.strokeStyle="rgba(255, 0, 0, 0.75)",M.lineWidth=1,M.fillText("1 frame = "+F+" ms = "+j+" fps",0,20);M.strokeRect(0,30,250,20),M.fillRect(0,30,250*Math.min(j/60,1),20)}a||(p[u.SELECT_BOX]=!1)}if(v&&1!==g){var X=h.contexts[u.NODE],Y=u.data.bufferCanvases[u.MOTIONBLUR_BUFFER_NODE],W=h.contexts[u.DRAG],H=u.data.bufferCanvases[u.MOTIONBLUR_BUFFER_DRAG],Z=function(e,n,r){e.setTransform(1,0,0,1,0,0),r||!x?e.clearRect(0,0,u.canvasWidth,u.canvasHeight):t(e,0,0,u.canvasWidth,u.canvasHeight);var i=g;e.drawImage(n,0,0,u.canvasWidth*i,u.canvasHeight*i,0,0,u.canvasWidth,u.canvasHeight)};(p[u.NODE]||O[u.NODE])&&(Z(X,Y,O[u.NODE]),p[u.NODE]=!1),(p[u.DRAG]||O[u.DRAG])&&(Z(W,H,O[u.DRAG]),p[u.DRAG]=!1)}u.prevViewport=T,u.clearingMotionBlur&&(u.clearingMotionBlur=!1,u.motionBlurCleared=!0,u.motionBlur=!0),v&&(u.motionBlurTimeout=setTimeout(function(){u.motionBlurTimeout=null,u.clearedForMotionBlur[u.NODE]=!1,u.clearedForMotionBlur[u.DRAG]=!1,u.motionBlur=!1,u.clearingMotionBlur=!f,u.mbFrames=0,p[u.NODE]=!0,p[u.DRAG]=!0,u.redraw()},100)),r||d.emit("render")},e.exports=r},function(e,t,n){"use strict";var r=n(2),i={};i.drawPolygonPath=function(e,t,n,r,i,a){var o=r/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+o*a[0],n+s*a[1]);for(var l=1;l0&&s>0){f.clearRect(0,0,a,s),f.globalCompositeOperation="source-over";var v=this.getCachedZSortedEles();if(e.full)f.translate(-r.x1*c,-r.y1*c),f.scale(c,c),this.drawElements(f,v),f.scale(1/c,1/c),f.translate(r.x1*c,r.y1*c);else{var g=t.pan(),y={x:g.x*c,y:g.y*c};c*=t.zoom(),f.translate(y.x,y.y),f.scale(c,c),this.drawElements(f,v),f.scale(1/c,1/c),f.translate(-y.x,-y.y)}e.bg&&(f.globalCompositeOperation="destination-over",f.fillStyle=e.bg,f.rect(0,0,a,s),f.fill())}return p},s.png=function(e){return a(e,this.bufferCanvasImage(e),"image/png")},s.jpg=function(e){return a(e,this.bufferCanvasImage(e),"image/jpeg")},e.exports=s},function(e,t,n){"use strict";var r={};r.nodeShapeImpl=function(e,t,n,r,i,a,o){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,i,a);case"polygon":return this.drawPolygonPath(t,n,r,i,a,o);case"roundrectangle":return this.drawRoundRectanglePath(t,n,r,i,a);case"cutrectangle":return this.drawCutRectanglePath(t,n,r,i,a);case"bottomroundrectangle":return this.drawBottomRoundRectanglePath(t,n,r,i,a);case"barrel":return this.drawBarrelPath(t,n,r,i,a)}},e.exports=r},function(e,t,n){"use strict";var r=n(0),i=n(1),a=n(18),o=function e(){if(!(this instanceof e))return new e;this.length=0},s=o.prototype;s.instanceString=function(){return"stylesheet"},s.selector=function(e){return this[this.length++]={selector:e,properties:[]},this},s.css=function(e,t){var n=this.length-1;if(r.string(e))this[n].properties.push({name:e,value:t});else if(r.plainObject(e))for(var o=e,s=0;s=0.10" - }, - "homepage": "http://js.cytoscape.org", - "keywords": [ - "graph", - "graph-theory", - "network", - "node", - "edge", - "vertex", - "link", - "analysis", - "visualisation", - "visualization", - "draw", - "render", - "biojs", - "cytoscape" - ], - "license": "MIT", - "main": "dist/cytoscape.cjs.js", - "name": "cytoscape", - "repository": { - "type": "git", - "url": "git+https://github.com/cytoscape/cytoscape.js.git" - }, - "scripts": { - "benchmark": "gulp benchmark", - "benchmark-single": "gulp benchmark-single", - "build": "gulp build", - "build-cjs": "gulp build-cjs", - "build-min": "gulp build-min", - "build-unmin": "gulp build-unmin", - "copyright": "update license", - "dist": "gulp dist", - "docs": "gulp docs", - "docs-min": "gulp docs-min", - "docs-pub": "gulp docs-pub", - "docs-push": "gulp docs-push", - "docs-push-unstable": "gulp docs-push-unstable", - "lint": "gulp lint", - "sniper": "sniper .", - "test": "gulp test", - "test-build": "gulp test-build", - "test-travis": "gulp build-cjs && gulp test-build", - "watch": "gulp watch", - "watch-babel": "gulp watch-babel", - "zip": "gulp zip" - }, - "sniper": { - "js": [ - "https://cdnjs.cloudflare.com/ajax/libs/fetch/2.0.3/fetch.min.js", - "/build/cytoscape.js" - ], - "first": "images" - }, - "version": "3.2.18" -} diff --git a/node_modules/cytoscape/src/animation.js b/node_modules/cytoscape/src/animation.js deleted file mode 100644 index 2c18e635b..000000000 --- a/node_modules/cytoscape/src/animation.js +++ /dev/null @@ -1,233 +0,0 @@ -let util = require( './util' ); -let is = require( './is' ); -let Promise = require( './promise' ); - -let Animation = function( target, opts, opts2 ){ - let _p = this._private = util.extend( { - duration: 1000 - }, opts, opts2 ); - - _p.target = target; - _p.style = _p.style || _p.css; - _p.started = false; - _p.playing = false; - _p.hooked = false; - _p.applying = false; - _p.progress = 0; - _p.completes = []; - _p.frames = []; - - if( _p.complete && is.fn( _p.complete ) ){ - _p.completes.push( _p.complete ); - } - - // for future timeline/animations impl - this.length = 1; - this[0] = this; -}; - -let anifn = Animation.prototype; - -util.extend( anifn, { - - instanceString: function(){ return 'animation'; }, - - hook: function(){ - let _p = this._private; - - if( !_p.hooked ){ - // add to target's animation queue - let q; - let tAni = _p.target._private.animation; - if( _p.queue ){ - q = tAni.queue; - } else { - q = tAni.current; - } - q.push( this ); - - // add to the animation loop pool - if( is.elementOrCollection( _p.target ) ){ - _p.target.cy().addToAnimationPool( _p.target ); - } - - _p.hooked = true; - } - - return this; - }, - - play: function(){ - let _p = this._private; - - // autorewind - if( _p.progress === 1 ){ - _p.progress = 0; - } - - _p.playing = true; - _p.started = false; // needs to be started by animation loop - _p.stopped = false; - - this.hook(); - - // the animation loop will start the animation... - - return this; - }, - - playing: function(){ - return this._private.playing; - }, - - apply: function(){ - let _p = this._private; - - _p.applying = true; - _p.started = false; // needs to be started by animation loop - _p.stopped = false; - - this.hook(); - - // the animation loop will apply the animation at this progress - - return this; - }, - - applying: function(){ - return this._private.applying; - }, - - pause: function(){ - let _p = this._private; - - _p.playing = false; - _p.started = false; - - return this; - }, - - stop: function(){ - let _p = this._private; - - _p.playing = false; - _p.started = false; - _p.stopped = true; // to be removed from animation queues - - return this; - }, - - rewind: function(){ - return this.progress( 0 ); - }, - - fastforward: function(){ - return this.progress( 1 ); - }, - - time: function( t ){ - let _p = this._private; - - if( t === undefined ){ - return _p.progress * _p.duration; - } else { - return this.progress( t / _p.duration ); - } - }, - - progress: function( p ){ - let _p = this._private; - let wasPlaying = _p.playing; - - if( p === undefined ){ - return _p.progress; - } else { - if( wasPlaying ){ - this.pause(); - } - - _p.progress = p; - _p.started = false; - - if( wasPlaying ){ - this.play(); - } - } - - return this; - }, - - completed: function(){ - return this._private.progress === 1; - }, - - reverse: function(){ - let _p = this._private; - let wasPlaying = _p.playing; - - if( wasPlaying ){ - this.pause(); - } - - _p.progress = 1 - _p.progress; - _p.started = false; - - let swap = function( a, b ){ - let _pa = _p[ a ]; - - if( _pa == null ){ return; } - - _p[ a ] = _p[ b ]; - _p[ b ] = _pa; - }; - - swap( 'zoom', 'startZoom' ); - swap( 'pan', 'startPan' ); - swap( 'position', 'startPosition' ); - - // swap styles - if( _p.style ){ - for( let i = 0; i < _p.style.length; i++ ){ - let prop = _p.style[ i ]; - let name = prop.name; - let startStyleProp = _p.startStyle[ name ]; - - _p.startStyle[ name ] = prop; - _p.style[ i ] = startStyleProp; - } - } - - if( wasPlaying ){ - this.play(); - } - - return this; - }, - - promise: function( type ){ - let _p = this._private; - - let arr; - - switch( type ){ - case 'frame': - arr = _p.frames; - break; - default: - case 'complete': - case 'completed': - arr = _p.completes; - } - - return new Promise( function( resolve, reject ){ - arr.push( function(){ - resolve(); - } ); - } ); - } - -} ); - -anifn.complete = anifn.completed; - -module.exports = Animation; diff --git a/node_modules/cytoscape/src/collection/algorithms/a-star.js b/node_modules/cytoscape/src/collection/algorithms/a-star.js deleted file mode 100644 index dd3f81df8..000000000 --- a/node_modules/cytoscape/src/collection/algorithms/a-star.js +++ /dev/null @@ -1,206 +0,0 @@ -var is = require( '../../is' ); - -var elesfn = ({ - - // Implemented from pseudocode from wikipedia - aStar: function( options ){ - var eles = this; - - options = options || {}; - - // Reconstructs the path from Start to End, acumulating the result in pathAcum - var reconstructPath = function( start, end, cameFromMap, pathAcum ){ - // Base case - if( start == end ){ - pathAcum.unshift( cy.getElementById( end ) ); - return pathAcum; - } - - if( end in cameFromMap ){ - // We know which node is before the last one - var previous = cameFromMap[ end ]; - var previousEdge = cameFromEdge[ end ]; - - pathAcum.unshift( cy.getElementById( previousEdge ) ); - pathAcum.unshift( cy.getElementById( end ) ); - - return reconstructPath( start, - previous, - cameFromMap, - pathAcum ); - } - - // We should not reach here! - return undefined; - }; - - // Returns the index of the element in openSet which has minimum fScore - var findMin = function( openSet, fScore ){ - if( openSet.length === 0 ){ - // Should never be the case - return undefined; - } - var minPos = 0; - var tempScore = fScore[ openSet[0] ]; - for( var i = 1; i < openSet.length; i++ ){ - var s = fScore[ openSet[ i ] ]; - if( s < tempScore ){ - tempScore = s; - minPos = i; - } - } - return minPos; - }; - - var cy = this._private.cy; - - // root - mandatory! - if( options != null && options.root != null ){ - var source = is.string( options.root ) ? - // use it as a selector, e.g. "#rootID - this.filter( options.root )[0] : - options.root[0]; - } else { - return undefined; - } - - // goal - mandatory! - if( options.goal != null ){ - var target = is.string( options.goal ) ? - // use it as a selector, e.g. "#goalID - this.filter( options.goal )[0] : - options.goal[0]; - } else { - return undefined; - } - - // Heuristic function - optional - if( options.heuristic != null && is.fn( options.heuristic ) ){ - var heuristic = options.heuristic; - } else { - var heuristic = function(){ return 0; }; // use constant if unspecified - } - - // Weight function - optional - if( options.weight != null && is.fn( options.weight ) ){ - var weightFn = options.weight; - } else { - // If not specified, assume each edge has equal weight (1) - var weightFn = function( e ){return 1;}; - } - - // directed - optional - if( options.directed != null ){ - var directed = options.directed; - } else { - var directed = false; - } - - var sid = source.id(); - var tid = target.id(); - - var closedSet = []; - var openSet = [ sid ]; - var cameFrom = {}; - var cameFromEdge = {}; - var gScore = {}; - var fScore = {}; - - gScore[ sid ] = 0; - fScore[ sid ] = heuristic( source ); - - // Counter - var steps = 0; - - // Main loop - while( openSet.length > 0 ){ - var minPos = findMin( openSet, fScore ); - var cMin = cy.getElementById( openSet[ minPos ] ); - var cMinId = cMin.id(); - steps++; - - // If we've found our goal, then we are done - if( cMinId == tid ){ - var rPath = reconstructPath( sid, tid, cameFrom, [] ); - - return { - found: true, - distance: gScore[ cMinId ], - path: eles.spawn( rPath ), - steps: steps - }; - } - - // Add cMin to processed nodes - closedSet.push( cMinId ); - // Remove cMin from boundary nodes - openSet.splice( minPos, 1 ); - - // Update scores for neighbors of cMin - // Take into account if graph is directed or not - var vwEdges = cMin._private.edges; - - for( var i = 0; i < vwEdges.length; i++ ){ - var e = vwEdges[ i ]; - - // edge must be in set of calling eles - if( !this.hasElementWithId( e.id() ) ){ continue; } - - // cMin must be the source of edge if directed - if( directed && e.data('source') !== cMinId ){ continue; } - - var wSrc = e.source(); - var wTgt = e.target(); - - var w = wSrc.id() !== cMinId ? wSrc : wTgt; - var wid = w.id(); - - // node must be in set of calling eles - if( !this.hasElementWithId( wid ) ){ continue; } - - // if node is in closedSet, ignore it - if( closedSet.indexOf( wid ) != -1 ){ - continue; - } - - // New tentative score for node w - var tempScore = gScore[ cMinId ] + weightFn( e ); - - // Update gScore for node w if: - // w not present in openSet - // OR - // tentative gScore is less than previous value - - // w not in openSet - if( openSet.indexOf( wid ) == -1 ){ - gScore[ wid ] = tempScore; - fScore[ wid ] = tempScore + heuristic( w ); - openSet.push( wid ); // Add node to openSet - cameFrom[ wid ] = cMinId; - cameFromEdge[ wid ] = e.id(); - continue; - } - // w already in openSet, but with greater gScore - if( tempScore < gScore[ wid ] ){ - gScore[ wid ] = tempScore; - fScore[ wid ] = tempScore + heuristic( w ); - cameFrom[ wid ] = cMinId; - } - - } // End of neighbors update - - } // End of main loop - - // If we've reached here, then we've not reached our goal - return { - found: false, - distance: undefined, - path: undefined, - steps: steps - }; - } - -}); // elesfn - - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/algorithms/bellman-ford.js b/node_modules/cytoscape/src/collection/algorithms/bellman-ford.js deleted file mode 100644 index 36ce4f747..000000000 --- a/node_modules/cytoscape/src/collection/algorithms/bellman-ford.js +++ /dev/null @@ -1,192 +0,0 @@ -var is = require( '../../is' ); -var util = require( '../../util' ); - -var elesfn = ({ - - // Implemented from pseudocode from wikipedia - bellmanFord: function( options ){ - var eles = this; - - options = options || {}; - - // Weight function - optional - if( options.weight != null && is.fn( options.weight ) ){ - var weightFn = options.weight; - } else { - // If not specified, assume each edge has equal weight (1) - var weightFn = function( e ){return 1;}; - } - - // directed - optional - if( options.directed != null ){ - var directed = options.directed; - } else { - var directed = false; - } - - // root - mandatory! - if( options.root != null ){ - if( is.string( options.root ) ){ - // use it as a selector, e.g. "#rootID - var source = this.filter( options.root )[0]; - } else { - var source = options.root[0]; - } - } else { - return undefined; - } - - var cy = this._private.cy; - var edges = this.edges().stdFilter( function( e ){ return !e.isLoop(); } ); - var nodes = this.nodes(); - var numNodes = nodes.length; - - // mapping: node id -> position in nodes array - var id2position = {}; - for( var i = 0; i < numNodes; i++ ){ - id2position[ nodes[ i ].id() ] = i; - } - - // Initializations - var cost = []; - var predecessor = []; - var predEdge = []; - - for( var i = 0; i < numNodes; i++ ){ - if( nodes[ i ].id() === source.id() ){ - cost[ i ] = 0; - } else { - cost[ i ] = Infinity; - } - predecessor[ i ] = undefined; - } - - // Edges relaxation - var flag = false; - for( var i = 1; i < numNodes; i++ ){ - flag = false; - for( var e = 0; e < edges.length; e++ ){ - var sourceIndex = id2position[ edges[ e ].source().id() ]; - var targetIndex = id2position[ edges[ e ].target().id() ]; - var weight = weightFn( edges[ e ] ); - - var temp = cost[ sourceIndex ] + weight; - if( temp < cost[ targetIndex ] ){ - cost[ targetIndex ] = temp; - predecessor[ targetIndex ] = sourceIndex; - predEdge[ targetIndex ] = edges[ e ]; - flag = true; - } - - // If undirected graph, we need to take into account the 'reverse' edge - if( !directed ){ - var temp = cost[ targetIndex ] + weight; - if( temp < cost[ sourceIndex ] ){ - cost[ sourceIndex ] = temp; - predecessor[ sourceIndex ] = targetIndex; - predEdge[ sourceIndex ] = edges[ e ]; - flag = true; - } - } - } - - if( !flag ){ - break; - } - } - - if( flag ){ - // Check for negative weight cycles - for( var e = 0; e < edges.length; e++ ){ - var sourceIndex = id2position[ edges[ e ].source().id() ]; - var targetIndex = id2position[ edges[ e ].target().id() ]; - var weight = weightFn( edges[ e ] ); - - if( cost[ sourceIndex ] + weight < cost[ targetIndex ] ){ - util.error( 'Graph contains a negative weight cycle for Bellman-Ford' ); - return { pathTo: undefined, - distanceTo: undefined, - hasNegativeWeightCycle: true}; - } - } - } - - // Build result object - var position2id = []; - for( var i = 0; i < numNodes; i++ ){ - position2id.push( nodes[ i ].id() ); - } - - - var res = { - distanceTo: function( to ){ - if( is.string( to ) ){ - // to is a selector string - var toId = (cy.filter( to )[0]).id(); - } else { - // to is a node - var toId = to.id(); - } - - return cost[ id2position[ toId ] ]; - }, - - pathTo: function( to ){ - - var reconstructPathAux = function( predecessor, fromPos, toPos, position2id, acumPath, predEdge ){ - for( ;; ){ - // Add toId to path - acumPath.push( cy.getElementById( position2id[ toPos ] ) ); - acumPath.push( predEdge[ toPos ] ); - - if( fromPos === toPos ){ - // reached starting node - return acumPath; - } - - // If no path exists, discart acumulated path and return undefined - var predPos = predecessor[ toPos ]; - if( typeof predPos === 'undefined' ){ - return undefined; - } - - toPos = predPos; - } - - }; - - if( is.string( to ) ){ - // to is a selector string - var toId = (cy.filter( to )[0]).id(); - } else { - // to is a node - var toId = to.id(); - } - var path = []; - - // This returns a reversed path - var res = reconstructPathAux( predecessor, - id2position[ source.id() ], - id2position[ toId ], - position2id, - path, - predEdge ); - - // Get it in the correct order and return it - if( res != null ){ - res.reverse(); - } - - return eles.spawn( res ); - }, - - hasNegativeWeightCycle: false - }; - - return res; - - } // bellmanFord - -}); // elesfn - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/algorithms/betweenness-centrality.js b/node_modules/cytoscape/src/collection/algorithms/betweenness-centrality.js deleted file mode 100644 index d01d23029..000000000 --- a/node_modules/cytoscape/src/collection/algorithms/betweenness-centrality.js +++ /dev/null @@ -1,190 +0,0 @@ -var is = require( '../../is' ); -var Heap = require( '../../heap' ); - -var elesfn = ({ - - // Implemented from the algorithm in the paper "On Variants of Shortest-Path Betweenness Centrality and their Generic Computation" by Ulrik Brandes - betweennessCentrality: function( options ){ - options = options || {}; - - // Weight - optional - var weighted, weightFn; - if( is.fn( options.weight ) ){ - weightFn = options.weight; - weighted = true; - } else { - weighted = false; - } - - // Directed - default false - var directed = options.directed != null ? options.directed : false; - - var cy = this._private.cy; - - // starting - var V = this.nodes(); - var A = {}; - var _C = {}; - var max = 0; - var C = { - set: function( key, val ){ - _C[ key ] = val; - - if( val > max ){ max = val; } - }, - - get: function( key ){ return _C[ key ]; } - }; - - // A contains the neighborhoods of every node - for( var i = 0; i < V.length; i++ ){ - var v = V[ i ]; - var vid = v.id(); - - if( directed ){ - A[ vid ] = v.outgoers().nodes(); // get outgoers of every node - } else { - A[ vid ] = v.openNeighborhood().nodes(); // get neighbors of every node - } - - C.set( vid, 0 ); - } - - for( var s = 0; s < V.length; s++ ){ - var sid = V[s].id(); - var S = []; // stack - var P = {}; - var g = {}; - var d = {}; - var Q = new Heap(function( a, b ){ - return d[a] - d[b]; - }); // queue - - // init dictionaries - for( var i = 0; i < V.length; i++ ){ - var vid = V[ i ].id(); - - P[ vid ] = []; - g[ vid ] = 0; - d[ vid ] = Infinity; - } - - g[ sid ] = 1; // sigma - d[ sid ] = 0; // distance to s - - Q.push( sid ); - - while( !Q.empty() ){ - var v = Q.pop(); - - S.push( v ); - - if( weighted ){ - for( var j = 0; j < A[v].length; j++ ){ - var w = A[v][j]; - var vEle = cy.getElementById( v ); - - var edge; - if( vEle.edgesTo( w ).length > 0 ){ - edge = vEle.edgesTo( w )[0]; - } else { - edge = w.edgesTo( vEle )[0]; - } - - var edgeWeight = weightFn( edge ); - - w = w.id(); - - if( d[w] > d[v] + edgeWeight ){ - d[w] = d[v] + edgeWeight; - - if( Q.nodes.indexOf( w ) < 0 ){ //if w is not in Q - Q.push( w ); - } else { // update position if w is in Q - Q.updateItem( w ); - } - - g[w] = 0; - P[w] = []; - } - - if( d[w] == d[v] + edgeWeight ){ - g[w] = g[w] + g[v]; - P[w].push( v ); - } - } - } else { - for( var j = 0; j < A[v].length; j++ ){ - var w = A[v][j].id(); - - if( d[w] == Infinity ){ - Q.push( w ); - - d[w] = d[v] + 1; - } - - if( d[w] == d[v] + 1 ){ - g[w] = g[w] + g[v]; - P[w].push( v ); - } - } - } - } - - var e = {}; - for( var i = 0; i < V.length; i++ ){ - e[ V[ i ].id() ] = 0; - } - - while( S.length > 0 ){ - var w = S.pop(); - - for( var j = 0; j < P[w].length; j++ ){ - var v = P[w][j]; - - e[v] = e[v] + (g[v] / g[w]) * (1 + e[w]); - - if( w != V[s].id() ){ - C.set( w, C.get( w ) + e[w] ); - } - } - } - } - - var ret = { - betweenness: function( node ){ - if( is.string( node ) ){ - var node = cy.filter( node ).id(); - } else { - var node = node.id(); - } - - return C.get( node ); - }, - - betweennessNormalized: function( node ){ - if ( max == 0 ) - return 0; - - if( is.string( node ) ){ - var node = cy.filter( node ).id(); - } else { - var node = node.id(); - } - - return C.get( node ) / max; - } - }; - - // alias - ret.betweennessNormalised = ret.betweennessNormalized; - - return ret; - } // betweennessCentrality - -}); // elesfn - -// nice, short mathemathical alias -elesfn.bc = elesfn.betweennessCentrality; - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/algorithms/bfs-dfs.js b/node_modules/cytoscape/src/collection/algorithms/bfs-dfs.js deleted file mode 100644 index 7d0ea51ab..000000000 --- a/node_modules/cytoscape/src/collection/algorithms/bfs-dfs.js +++ /dev/null @@ -1,130 +0,0 @@ -var is = require( '../../is' ); - -var defineSearch = function( params ){ - params = { - bfs: params.bfs || !params.dfs, - dfs: params.dfs || !params.bfs - }; - - // from pseudocode on wikipedia - return function searchFn( roots, fn, directed ){ - var options; - if( is.plainObject( roots ) && !is.elementOrCollection( roots ) ){ - options = roots; - roots = options.roots || options.root; - fn = options.visit; - directed = options.directed; - } - - directed = arguments.length === 2 && !is.fn( fn ) ? fn : directed; - fn = is.fn( fn ) ? fn : function(){}; - - var cy = this._private.cy; - var v = roots = is.string( roots ) ? this.filter( roots ) : roots; - var Q = []; - var connectedNodes = []; - var connectedBy = {}; - var id2depth = {}; - var V = {}; - var j = 0; - var found; - var nodes = this.nodes(); - var edges = this.edges(); - - // enqueue v - for( var i = 0; i < v.length; i++ ){ - if( v[ i ].isNode() ){ - Q.unshift( v[ i ] ); - - if( params.bfs ){ - V[ v[ i ].id() ] = true; - - connectedNodes.push( v[ i ] ); - } - - id2depth[ v[ i ].id() ] = 0; - } - } - - while( Q.length !== 0 ){ - var v = params.bfs ? Q.shift() : Q.pop(); - - if( params.dfs ){ - if( V[ v.id() ] ){ continue; } - - V[ v.id() ] = true; - - connectedNodes.push( v ); - } - - var depth = id2depth[ v.id() ]; - var prevEdge = connectedBy[ v.id() ]; - var prevNode = prevEdge == null ? undefined : prevEdge.connectedNodes().not( v )[0]; - var ret; - - ret = fn( v, prevEdge, prevNode, j++, depth ); - - if( ret === true ){ - found = v; - break; - } - - if( ret === false ){ - break; - } - - var vwEdges = v.connectedEdges( directed ? function( ele ){ return ele.data( 'source' ) === v.id(); } : undefined ).intersect( edges ); - for( var i = 0; i < vwEdges.length; i++ ){ - var e = vwEdges[ i ]; - var w = e.connectedNodes( function( n ){ return n.id() !== v.id(); } ).intersect( nodes ); - - if( w.length !== 0 && !V[ w.id() ] ){ - w = w[0]; - - Q.push( w ); - - if( params.bfs ){ - V[ w.id() ] = true; - - connectedNodes.push( w ); - } - - connectedBy[ w.id() ] = e; - - id2depth[ w.id() ] = id2depth[ v.id() ] + 1; - } - } - - } - - var connectedEles = []; - - for( var i = 0; i < connectedNodes.length; i++ ){ - var node = connectedNodes[ i ]; - var edge = connectedBy[ node.id() ]; - - if( edge ){ - connectedEles.push( edge ); - } - - connectedEles.push( node ); - } - - return { - path: cy.collection( connectedEles, { unique: true } ), - found: cy.collection( found ) - }; - }; -}; - -// search, spanning trees, etc -var elesfn = ({ - breadthFirstSearch: defineSearch( { bfs: true } ), - depthFirstSearch: defineSearch( { dfs: true } ) -}); - -// nice, short mathemathical alias -elesfn.bfs = elesfn.breadthFirstSearch; -elesfn.dfs = elesfn.depthFirstSearch; - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/algorithms/closeness-centrality.js b/node_modules/cytoscape/src/collection/algorithms/closeness-centrality.js deleted file mode 100644 index 09de61be7..000000000 --- a/node_modules/cytoscape/src/collection/algorithms/closeness-centrality.js +++ /dev/null @@ -1,128 +0,0 @@ -var is = require( '../../is' ); - -var elesfn = ({ - - closenessCentralityNormalized: function( options ){ - options = options || {}; - - var cy = this.cy(); - - var harmonic = options.harmonic; - if( harmonic === undefined ){ - harmonic = true; - } - - var closenesses = {}; - var maxCloseness = 0; - var nodes = this.nodes(); - var fw = this.floydWarshall( { weight: options.weight, directed: options.directed } ); - - // Compute closeness for every node and find the maximum closeness - for( var i = 0; i < nodes.length; i++ ){ - var currCloseness = 0; - for( var j = 0; j < nodes.length; j++ ){ - if( i != j ){ - var d = fw.distance( nodes[ i ], nodes[ j ] ); - - if( harmonic ){ - currCloseness += 1 / d; - } else { - currCloseness += d; - } - } - } - - if( !harmonic ){ - currCloseness = 1 / currCloseness; - } - - if( maxCloseness < currCloseness ){ - maxCloseness = currCloseness; - } - - closenesses[ nodes[ i ].id() ] = currCloseness; - } - - return { - closeness: function( node ){ - if( maxCloseness == 0 ){ return 0; } - - if( is.string( node ) ){ - // from is a selector string - var node = (cy.filter( node )[0]).id(); - } else { - // from is a node - var node = node.id(); - } - - return closenesses[ node ] / maxCloseness; - } - }; - }, - - // Implemented from pseudocode from wikipedia - closenessCentrality: function( options ){ - options = options || {}; - - // root - mandatory! - if( options.root != null ){ - if( is.string( options.root ) ){ - // use it as a selector, e.g. "#rootID - var root = this.filter( options.root )[0]; - } else { - var root = options.root[0]; - } - } else { - return undefined; - } - - // weight - optional - if( options.weight != null && is.fn( options.weight ) ){ - var weight = options.weight; - } else { - var weight = function(){return 1;}; - } - - // directed - optional - if( options.directed != null && is.bool( options.directed ) ){ - var directed = options.directed; - } else { - var directed = false; - } - - var harmonic = options.harmonic; - if( harmonic === undefined ){ - harmonic = true; - } - - // we need distance from this node to every other node - var dijkstra = this.dijkstra( { - root: root, - weight: weight, - directed: directed - } ); - var totalDistance = 0; - - var nodes = this.nodes(); - for( var i = 0; i < nodes.length; i++ ){ - if( nodes[ i ].id() != root.id() ){ - var d = dijkstra.distanceTo( nodes[ i ] ); - - if( harmonic ){ - totalDistance += 1 / d; - } else { - totalDistance += d; - } - } - } - - return harmonic ? totalDistance : 1 / totalDistance; - } // closenessCentrality - -}); // elesfn - -// nice, short mathemathical alias -elesfn.cc = elesfn.closenessCentrality; -elesfn.ccn = elesfn.closenessCentralityNormalised = elesfn.closenessCentralityNormalized; - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/algorithms/degree-centrality.js b/node_modules/cytoscape/src/collection/algorithms/degree-centrality.js deleted file mode 100644 index aec826b3b..000000000 --- a/node_modules/cytoscape/src/collection/algorithms/degree-centrality.js +++ /dev/null @@ -1,194 +0,0 @@ -var is = require( '../../is' ); -var util = require( '../../util' ); - -var elesfn = ({ - - degreeCentralityNormalized: function( options ){ - options = options || {}; - - var cy = this.cy(); - - // directed - optional - if( options.directed != null ){ - var directed = options.directed; - } else { - var directed = false; - } - - var nodes = this.nodes(); - var numNodes = nodes.length; - - if( !directed ){ - var degrees = {}; - var maxDegree = 0; - - for( var i = 0; i < numNodes; i++ ){ - var node = nodes[ i ]; - // add current node to the current options object and call degreeCentrality - var currDegree = this.degreeCentrality( util.extend( {}, options, {root: node} ) ); - if( maxDegree < currDegree.degree ) - maxDegree = currDegree.degree; - - degrees[ node.id() ] = currDegree.degree; - } - - return { - degree: function( node ){ - if( maxDegree == 0 ) - return 0; - - if( is.string( node ) ){ - // from is a selector string - var node = (cy.filter( node )[0]).id(); - } else { - // from is a node - var node = node.id(); - } - - return degrees[ node ] / maxDegree; - } - }; - } else { - var indegrees = {}; - var outdegrees = {}; - var maxIndegree = 0; - var maxOutdegree = 0; - - for( var i = 0; i < numNodes; i++ ){ - var node = nodes[ i ]; - // add current node to the current options object and call degreeCentrality - var currDegree = this.degreeCentrality( util.extend( {}, options, {root: node} ) ); - - if( maxIndegree < currDegree.indegree ) - maxIndegree = currDegree.indegree; - - if( maxOutdegree < currDegree.outdegree ) - maxOutdegree = currDegree.outdegree; - - indegrees[ node.id() ] = currDegree.indegree; - outdegrees[ node.id() ] = currDegree.outdegree; - } - - return { - indegree: function( node ){ - if ( maxIndegree == 0 ) - return 0; - - if( is.string( node ) ){ - // from is a selector string - var node = (cy.filter( node )[0]).id(); - } else { - // from is a node - var node = node.id(); - } - - return indegrees[ node ] / maxIndegree; - }, - outdegree: function( node ){ - if ( maxOutdegree == 0 ) - return 0; - - if( is.string( node ) ){ - // from is a selector string - var node = (cy.filter( node )[0]).id(); - } else { - // from is a node - var node = node.id(); - } - - return outdegrees[ node ] / maxOutdegree; - } - - }; - } - - }, // degreeCentralityNormalized - - // Implemented from the algorithm in Opsahl's paper - // "Node centrality in weighted networks: Generalizing degree and shortest paths" - // check the heading 2 "Degree" - degreeCentrality: function( options ){ - options = options || {}; - - var callingEles = this; - - // root - mandatory! - if( options != null && options.root != null ){ - var root = is.string( options.root ) ? this.filter( options.root )[0] : options.root[0]; - } else { - return undefined; - } - - // weight - optional - if( options.weight != null && is.fn( options.weight ) ){ - var weightFn = options.weight; - } else { - // If not specified, assume each edge has equal weight (1) - var weightFn = function( e ){ - return 1; - }; - } - - // directed - optional - if( options.directed != null ){ - var directed = options.directed; - } else { - var directed = false; - } - - // alpha - optional - if( options.alpha != null && is.number( options.alpha ) ){ - var alpha = options.alpha; - } else { - alpha = 0; - } - - - if( !directed ){ - var connEdges = root.connectedEdges().intersection( callingEles ); - var k = connEdges.length; - var s = 0; - - // Now, sum edge weights - for( var i = 0; i < connEdges.length; i++ ){ - var edge = connEdges[ i ]; - s += weightFn( edge ); - } - - return { - degree: Math.pow( k, 1 - alpha ) * Math.pow( s, alpha ) - }; - } else { - var incoming = root.connectedEdges( 'edge[target = "' + root.id() + '"]' ).intersection( callingEles ); - var outgoing = root.connectedEdges( 'edge[source = "' + root.id() + '"]' ).intersection( callingEles ); - var k_in = incoming.length; - var k_out = outgoing.length; - var s_in = 0; - var s_out = 0; - - // Now, sum incoming edge weights - for( var i = 0; i < incoming.length; i++ ){ - var edge = incoming[ i ]; - s_in += weightFn( edge ); - } - - // Now, sum outgoing edge weights - for( var i = 0; i < outgoing.length; i++ ){ - var edge = outgoing[ i ]; - s_out += weightFn( edge ); - } - - return { - indegree: Math.pow( k_in, 1 - alpha ) * Math.pow( s_in, alpha ), - outdegree: Math.pow( k_out, 1 - alpha ) * Math.pow( s_out, alpha ) - }; - } - } // degreeCentrality - -}); // elesfn - -// nice, short mathemathical alias -elesfn.dc = elesfn.degreeCentrality; -elesfn.dcn = elesfn.degreeCentralityNormalised = elesfn.degreeCentralityNormalized; - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/algorithms/dijkstra.js b/node_modules/cytoscape/src/collection/algorithms/dijkstra.js deleted file mode 100644 index c45a3771f..000000000 --- a/node_modules/cytoscape/src/collection/algorithms/dijkstra.js +++ /dev/null @@ -1,129 +0,0 @@ -var is = require( '../../is' ); -var Heap = require( '../../heap' ); - -var elesfn = ({ - - dijkstra: function( root, weightFn, directed ){ - var options; - if( is.plainObject( root ) && !is.elementOrCollection( root ) ){ - options = root; - root = options.root; - weightFn = options.weight; - directed = options.directed; - } - - var cy = this._private.cy; - weightFn = is.fn( weightFn ) ? weightFn : function(){ return 1; }; // if not specified, assume each edge has equal weight (1) - - var source = is.string( root ) ? this.filter( root )[0] : root[0]; - var dist = {}; - var prev = {}; - var knownDist = {}; - - var edges = this.edges().filter( function( ele ){ return !ele.isLoop(); } ); - var nodes = this.nodes(); - - var getDist = function( node ){ - return dist[ node.id() ]; - }; - - var setDist = function( node, d ){ - dist[ node.id() ] = d; - - Q.updateItem( node ); - }; - - var Q = new Heap( function( a, b ){ - return getDist( a ) - getDist( b ); - } ); - - for( var i = 0; i < nodes.length; i++ ){ - var node = nodes[ i ]; - - dist[ node.id() ] = node.same( source ) ? 0 : Infinity; - Q.push( node ); - } - - var distBetween = function( u, v ){ - var uvs = ( directed ? u.edgesTo( v ) : u.edgesWith( v ) ).intersect( edges ); - var smallestDistance = Infinity; - var smallestEdge; - - for( var i = 0; i < uvs.length; i++ ){ - var edge = uvs[ i ]; - var weight = weightFn( edge ); - - if( weight < smallestDistance || !smallestEdge ){ - smallestDistance = weight; - smallestEdge = edge; - } - } - - return { - edge: smallestEdge, - dist: smallestDistance - }; - }; - - while( Q.size() > 0 ){ - var u = Q.pop(); - var smalletsDist = getDist( u ); - var uid = u.id(); - - knownDist[ uid ] = smalletsDist; - - if( smalletsDist === Infinity ){ - continue; - } - - var neighbors = u.neighborhood().intersect( nodes ); - for( var i = 0; i < neighbors.length; i++ ){ - var v = neighbors[ i ]; - var vid = v.id(); - var vDist = distBetween( u, v ); - - var alt = smalletsDist + vDist.dist; - - if( alt < getDist( v ) ){ - setDist( v, alt ); - - prev[ vid ] = { - node: u, - edge: vDist.edge - }; - } - } // for - } // while - - return { - distanceTo: function( node ){ - var target = is.string( node ) ? nodes.filter( node )[0] : node[0]; - - return knownDist[ target.id() ]; - }, - - pathTo: function( node ){ - var target = is.string( node ) ? nodes.filter( node )[0] : node[0]; - var S = []; - var u = target; - - if( target.length > 0 ){ - S.unshift( target ); - - while( prev[ u.id() ] ){ - var p = prev[ u.id() ]; - - S.unshift( p.edge ); - S.unshift( p.node ); - - u = p.node; - } - } - - return cy.collection( S ); - } - }; - } -}); - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/algorithms/floyd-warshall.js b/node_modules/cytoscape/src/collection/algorithms/floyd-warshall.js deleted file mode 100644 index f056adced..000000000 --- a/node_modules/cytoscape/src/collection/algorithms/floyd-warshall.js +++ /dev/null @@ -1,192 +0,0 @@ -var is = require( '../../is' ); - -var elesfn = ({ - - // Implemented from pseudocode from wikipedia - floydWarshall: function( options ){ - options = options || {}; - - var cy = this.cy(); - - // Weight function - optional - if( options.weight != null && is.fn( options.weight ) ){ - var weightFn = options.weight; - } else { - // If not specified, assume each edge has equal weight (1) - var weightFn = function( e ){return 1;}; - } - - // directed - optional - if( options.directed != null ){ - var directed = options.directed; - } else { - var directed = false; - } - - var edges = this.edges().stdFilter( function( e ){ return !e.isLoop(); } ); - var nodes = this.nodes(); - var numNodes = nodes.length; - - // mapping: node id -> position in nodes array - var id2position = {}; - for( var i = 0; i < numNodes; i++ ){ - id2position[ nodes[ i ].id() ] = i; - } - - // Initialize distance matrix - var dist = []; - for( var i = 0; i < numNodes; i++ ){ - var newRow = new Array( numNodes ); - for( var j = 0; j < numNodes; j++ ){ - if( i == j ){ - newRow[ j ] = 0; - } else { - newRow[ j ] = Infinity; - } - } - dist.push( newRow ); - } - - // Initialize matrix used for path reconstruction - // Initialize distance matrix - var next = []; - var edgeNext = []; - - var initMatrix = function( next ){ - for( var i = 0; i < numNodes; i++ ){ - var newRow = new Array( numNodes ); - for( var j = 0; j < numNodes; j++ ){ - newRow[ j ] = undefined; - } - next.push( newRow ); - } - }; - - initMatrix( next ); - initMatrix( edgeNext ); - - // Process edges - for( var i = 0; i < edges.length ; i++ ){ - var sourceIndex = id2position[ edges[ i ].source().id() ]; - var targetIndex = id2position[ edges[ i ].target().id() ]; - var weight = weightFn( edges[ i ] ); - - // Check if already process another edge between same 2 nodes - if( dist[ sourceIndex ][ targetIndex ] > weight ){ - dist[ sourceIndex ][ targetIndex ] = weight; - next[ sourceIndex ][ targetIndex ] = targetIndex; - edgeNext[ sourceIndex ][ targetIndex ] = edges[ i ]; - } - } - - // If undirected graph, process 'reversed' edges - if( !directed ){ - for( var i = 0; i < edges.length ; i++ ){ - var sourceIndex = id2position[ edges[ i ].target().id() ]; - var targetIndex = id2position[ edges[ i ].source().id() ]; - var weight = weightFn( edges[ i ] ); - - // Check if already process another edge between same 2 nodes - if( dist[ sourceIndex ][ targetIndex ] > weight ){ - dist[ sourceIndex ][ targetIndex ] = weight; - next[ sourceIndex ][ targetIndex ] = targetIndex; - edgeNext[ sourceIndex ][ targetIndex ] = edges[ i ]; - } - } - } - - // Main loop - for( var k = 0; k < numNodes; k++ ){ - for( var i = 0; i < numNodes; i++ ){ - for( var j = 0; j < numNodes; j++ ){ - if( dist[ i ][ k ] + dist[ k ][ j ] < dist[ i ][ j ] ){ - dist[ i ][ j ] = dist[ i ][ k ] + dist[ k ][ j ]; - next[ i ][ j ] = next[ i ][ k ]; - } - } - } - } - - // Build result object - var position2id = []; - for( var i = 0; i < numNodes; i++ ){ - position2id.push( nodes[ i ].id() ); - } - - var res = { - distance: function( from, to ){ - if( is.string( from ) ){ - // from is a selector string - var fromId = (cy.filter( from )[0]).id(); - } else { - // from is a node - var fromId = from.id(); - } - - if( is.string( to ) ){ - // to is a selector string - var toId = (cy.filter( to )[0]).id(); - } else { - // to is a node - var toId = to.id(); - } - - return dist[ id2position[ fromId ] ][ id2position[ toId ] ]; - }, - - path: function( from, to ){ - var reconstructPathAux = function( from, to, next, position2id, edgeNext ){ - if( from === to ){ - return cy.getElementById( position2id[ from ] ); - } - if( next[ from ][ to ] === undefined ){ - return undefined; - } - - var path = [ cy.getElementById( position2id[ from ] ) ]; - var prev = from; - while( from !== to ){ - prev = from; - from = next[ from ][ to ]; - - var edge = edgeNext[ prev ][ from ]; - path.push( edge ); - - path.push( cy.getElementById( position2id[ from ] ) ); - } - return path; - }; - - if( is.string( from ) ){ - // from is a selector string - var fromId = (cy.filter( from )[0]).id(); - } else { - // from is a node - var fromId = from.id(); - } - - if( is.string( to ) ){ - // to is a selector string - var toId = (cy.filter( to )[0]).id(); - } else { - // to is a node - var toId = to.id(); - } - - var pathArr = reconstructPathAux( id2position[ fromId ], - id2position[ toId ], - next, - position2id, - edgeNext ); - - return cy.collection( pathArr ); - } - }; - - return res; - - } // floydWarshall - -}); // elesfn - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/algorithms/index.js b/node_modules/cytoscape/src/collection/algorithms/index.js deleted file mode 100644 index f0149fea9..000000000 --- a/node_modules/cytoscape/src/collection/algorithms/index.js +++ /dev/null @@ -1,21 +0,0 @@ -var util = require( '../../util' ); - -var elesfn = {}; - -[ - require( './bfs-dfs' ), - require( './dijkstra' ), - require( './kruskal' ), - require( './a-star' ), - require( './floyd-warshall' ), - require( './bellman-ford' ), - require( './kerger-stein' ), - require( './page-rank' ), - require( './degree-centrality' ), - require( './closeness-centrality' ), - require( './betweenness-centrality' ) -].forEach( function( props ){ - util.extend( elesfn, props ); -} ); - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/algorithms/kerger-stein.js b/node_modules/cytoscape/src/collection/algorithms/kerger-stein.js deleted file mode 100644 index 290bc0224..000000000 --- a/node_modules/cytoscape/src/collection/algorithms/kerger-stein.js +++ /dev/null @@ -1,170 +0,0 @@ -var util = require( '../../util' ); - -var elesfn = ({ - - // Computes the minimum cut of an undirected graph - // Returns the correct answer with high probability - kargerStein: function( options ){ - var eles = this; - - options = options || {}; - - // Function which colapses 2 (meta) nodes into one - // Updates the remaining edge lists - // Receives as a paramater the edge which causes the collapse - var colapse = function( edgeIndex, nodeMap, remainingEdges ){ - var edgeInfo = remainingEdges[ edgeIndex ]; - var sourceIn = edgeInfo[1]; - var targetIn = edgeInfo[2]; - var partition1 = nodeMap[ sourceIn ]; - var partition2 = nodeMap[ targetIn ]; - - // Delete all edges between partition1 and partition2 - var newEdges = remainingEdges.filter( function( edge ){ - if( nodeMap[ edge[1] ] === partition1 && nodeMap[ edge[2] ] === partition2 ){ - return false; - } - if( nodeMap[ edge[1] ] === partition2 && nodeMap[ edge[2] ] === partition1 ){ - return false; - } - return true; - } ); - - // All edges pointing to partition2 should now point to partition1 - for( var i = 0; i < newEdges.length; i++ ){ - var edge = newEdges[ i ]; - if( edge[1] === partition2 ){ // Check source - newEdges[ i ] = edge.slice( 0 ); - newEdges[ i ][1] = partition1; - } else if( edge[2] === partition2 ){ // Check target - newEdges[ i ] = edge.slice( 0 ); - newEdges[ i ][2] = partition1; - } - } - - // Move all nodes from partition2 to partition1 - for( var i = 0; i < nodeMap.length; i++ ){ - if( nodeMap[ i ] === partition2 ){ - nodeMap[ i ] = partition1; - } - } - - return newEdges; - }; - - - // Contracts a graph until we reach a certain number of meta nodes - var contractUntil = function( metaNodeMap, - remainingEdges, - size, - sizeLimit ){ - // Stop condition - if( size <= sizeLimit ){ - return remainingEdges; - } - - // Choose an edge randomly - var edgeIndex = Math.floor( (Math.random() * remainingEdges.length) ); - - // Colapse graph based on edge - var newEdges = colapse( edgeIndex, metaNodeMap, remainingEdges ); - - return contractUntil( metaNodeMap, - newEdges, - size - 1, - sizeLimit ); - }; - - var cy = this._private.cy; - var edges = this.edges().stdFilter( function( e ){ return !e.isLoop(); } ); - var nodes = this.nodes(); - var numNodes = nodes.length; - var numEdges = edges.length; - var numIter = Math.ceil( Math.pow( Math.log( numNodes ) / Math.LN2, 2 ) ); - var stopSize = Math.floor( numNodes / Math.sqrt( 2 ) ); - - if( numNodes < 2 ){ - util.error( 'At least 2 nodes are required for Karger-Stein algorithm' ); - return undefined; - } - - // Create numerical identifiers for each node - // mapping: node id -> position in nodes array - // for reverse mapping, simply use nodes array - var id2position = {}; - for( var i = 0; i < numNodes; i++ ){ - id2position[ nodes[ i ].id() ] = i; - } - - // Now store edge destination as indexes - // Format for each edge (edge index, source node index, target node index) - var edgeIndexes = []; - for( var i = 0; i < numEdges; i++ ){ - var e = edges[ i ]; - edgeIndexes.push( [ i, id2position[ e.source().id() ], id2position[ e.target().id() ] ] ); - } - - // We will store the best cut found here - var minCutSize = Infinity; - var minCut; - - // Initial meta node partition - var originalMetaNode = []; - for( var i = 0; i < numNodes; i++ ){ - originalMetaNode.push( i ); - } - - // Main loop - for( var iter = 0; iter <= numIter; iter++ ){ - // Create new meta node partition - var metaNodeMap = originalMetaNode.slice( 0 ); - - // Contract until stop point (stopSize nodes) - var edgesState = contractUntil( metaNodeMap, edgeIndexes, numNodes, stopSize ); - - // Create a copy of the colapsed nodes state - var metaNodeMap2 = metaNodeMap.slice( 0 ); - - // Run 2 iterations starting in the stop state - var res1 = contractUntil( metaNodeMap, edgesState, stopSize, 2 ); - var res2 = contractUntil( metaNodeMap2, edgesState, stopSize, 2 ); - - // Is any of the 2 results the best cut so far? - if( res1.length <= res2.length && res1.length < minCutSize ){ - minCutSize = res1.length; - minCut = [ res1, metaNodeMap ]; - } else if( res2.length <= res1.length && res2.length < minCutSize ){ - minCutSize = res2.length; - minCut = [ res2, metaNodeMap2 ]; - } - } // end of main loop - - - // Construct result - var resEdges = (minCut[0]).map( function( e ){ return edges[ e[0] ]; } ); - var partition1 = []; - var partition2 = []; - - // traverse metaNodeMap for best cut - var witnessNodePartition = minCut[1][0]; - for( var i = 0; i < minCut[1].length; i++ ){ - var partitionId = minCut[1][ i ]; - if( partitionId === witnessNodePartition ){ - partition1.push( nodes[ i ] ); - } else { - partition2.push( nodes[ i ] ); - } - } - - var ret = { - cut: eles.spawn( cy, resEdges ), - partition1: eles.spawn( partition1 ), - partition2: eles.spawn( partition2 ) - }; - - return ret; - } -}); // elesfn - - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/algorithms/kruskal.js b/node_modules/cytoscape/src/collection/algorithms/kruskal.js deleted file mode 100644 index 3b471f1a1..000000000 --- a/node_modules/cytoscape/src/collection/algorithms/kruskal.js +++ /dev/null @@ -1,62 +0,0 @@ -var is = require( '../../is' ); - -// search, spanning trees, etc -var elesfn = ({ - - // kruskal's algorithm (finds min spanning tree, assuming undirected graph) - // implemented from pseudocode from wikipedia - kruskal: function( weightFn ){ - var cy = this.cy(); - - weightFn = is.fn( weightFn ) ? weightFn : function(){ return 1; }; // if not specified, assume each edge has equal weight (1) - - function findSet( ele ){ - for( var i = 0; i < forest.length; i++ ){ - var eles = forest[ i ]; - - if( eles.anySame( ele ) ){ - return { - eles: eles, - index: i - }; - } - } - } - - var A = cy.collection( cy, [] ); - var forest = []; - var nodes = this.nodes(); - - for( var i = 0; i < nodes.length; i++ ){ - forest.push( nodes[ i ].collection() ); - } - - var edges = this.edges(); - var S = edges.toArray().sort( function( a, b ){ - var weightA = weightFn( a ); - var weightB = weightFn( b ); - - return weightA - weightB; - } ); - - for( var i = 0; i < S.length; i++ ){ - var edge = S[ i ]; - var u = edge.source()[0]; - var v = edge.target()[0]; - var setU = findSet( u ); - var setV = findSet( v ); - - if( setU.index !== setV.index ){ - A = A.add( edge ); - - // combine forests for u and v - forest[ setU.index ] = setU.eles.add( setV.eles ); - forest.splice( setV.index, 1 ); - } - } - - return nodes.add( A ); - } -}); - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/algorithms/page-rank.js b/node_modules/cytoscape/src/collection/algorithms/page-rank.js deleted file mode 100644 index a29cdc59c..000000000 --- a/node_modules/cytoscape/src/collection/algorithms/page-rank.js +++ /dev/null @@ -1,179 +0,0 @@ -var is = require( '../../is' ); - -var elesfn = ({ - - pageRank: function( options ){ - options = options || {}; - - var normalizeVector = function( vector ){ - var length = vector.length; - - // First, get sum of all elements - var total = 0; - for( var i = 0; i < length; i++ ){ - total += vector[ i ]; - } - - // Now, divide each by the sum of all elements - for( var i = 0; i < length; i++ ){ - vector[ i ] = vector[ i ] / total; - } - }; - - // dampingFactor - optional - if( options != null && - options.dampingFactor != null ){ - var dampingFactor = options.dampingFactor; - } else { - var dampingFactor = 0.8; // Default damping factor - } - - // desired precision - optional - if( options != null && - options.precision != null ){ - var epsilon = options.precision; - } else { - var epsilon = 0.000001; // Default precision - } - - // Max number of iterations - optional - if( options != null && - options.iterations != null ){ - var numIter = options.iterations; - } else { - var numIter = 200; // Default number of iterations - } - - // Weight function - optional - if( options != null && - options.weight != null && - is.fn( options.weight ) ){ - var weightFn = options.weight; - } else { - // If not specified, assume each edge has equal weight (1) - var weightFn = function( e ){return 1;}; - } - - var cy = this._private.cy; - var edges = this.edges().stdFilter( function( e ){ return !e.isLoop(); } ); - var nodes = this.nodes(); - var numNodes = nodes.length; - var numEdges = edges.length; - - // Create numerical identifiers for each node - // mapping: node id -> position in nodes array - // for reverse mapping, simply use nodes array - var id2position = {}; - for( var i = 0; i < numNodes; i++ ){ - id2position[ nodes[ i ].id() ] = i; - } - - // Construct transposed adjacency matrix - // First lets have a zeroed matrix of the right size - // We'll also keep track of the sum of each column - var matrix = []; - var columnSum = []; - var additionalProb = (1 - dampingFactor) / numNodes; - - // Create null matric - for( var i = 0; i < numNodes; i++ ){ - var newRow = []; - for( var j = 0; j < numNodes; j++ ){ - newRow.push( 0.0 ); - } - matrix.push( newRow ); - columnSum.push( 0.0 ); - } - - // Now, process edges - for( var i = 0; i < numEdges; i++ ){ - var edge = edges[ i ]; - var s = id2position[ edge.source().id() ]; - var t = id2position[ edge.target().id() ]; - var w = weightFn( edge ); - - // Update matrix - matrix[ t ][ s ] += w; - - // Update column sum - columnSum[ s ] += w; - } - - // Add additional probability based on damping factor - // Also, take into account columns that have sum = 0 - var p = 1.0 / numNodes + additionalProb; // Shorthand - // Traverse matrix, column by column - for( var j = 0; j < numNodes; j++ ){ - if( columnSum[ j ] === 0 ){ - // No 'links' out from node jth, assume equal probability for each possible node - for( var i = 0; i < numNodes; i++ ){ - matrix[ i ][ j ] = p; - } - } else { - // Node jth has outgoing link, compute normalized probabilities - for( var i = 0; i < numNodes; i++ ){ - matrix[ i ][ j ] = matrix[ i ][ j ] / columnSum[ j ] + additionalProb; - } - } - } - - // Compute dominant eigenvector using power method - var eigenvector = []; - var nullVector = []; - var previous; - - // Start with a vector of all 1's - // Also, initialize a null vector which will be used as shorthand - for( var i = 0; i < numNodes; i++ ){ - eigenvector.push( 1.0 ); - nullVector.push( 0.0 ); - } - - for( var iter = 0; iter < numIter; iter++ ){ - // New array with all 0's - var temp = nullVector.slice( 0 ); - - // Multiply matrix with previous result - for( var i = 0; i < numNodes; i++ ){ - for( var j = 0; j < numNodes; j++ ){ - temp[ i ] += matrix[ i ][ j ] * eigenvector[ j ]; - } - } - - normalizeVector( temp ); - previous = eigenvector; - eigenvector = temp; - - var diff = 0; - // Compute difference (squared module) of both vectors - for( var i = 0; i < numNodes; i++ ){ - diff += Math.pow( previous[ i ] - eigenvector[ i ], 2 ); - } - - // If difference is less than the desired threshold, stop iterating - if( diff < epsilon ){ - break; - } - } - - // Construct result - var res = { - rank: function( node ){ - if( is.string( node ) ){ - // is a selector string - var nodeId = (cy.filter( node )[0]).id(); - } else { - // is a node object - var nodeId = node.id(); - } - return eigenvector[ id2position[ nodeId ] ]; - } - }; - - - return res; - } // pageRank - -}); // elesfn - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/animation.js b/node_modules/cytoscape/src/collection/animation.js deleted file mode 100644 index e2035902e..000000000 --- a/node_modules/cytoscape/src/collection/animation.js +++ /dev/null @@ -1,13 +0,0 @@ -let define = require( '../define' ); - -let elesfn = ({ - animate: define.animate(), - animation: define.animation(), - animated: define.animated(), - clearQueue: define.clearQueue(), - delay: define.delay(), - delayAnimation: define.delayAnimation(), - stop: define.stop() -}); - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/class.js b/node_modules/cytoscape/src/collection/class.js deleted file mode 100644 index 8672a699c..000000000 --- a/node_modules/cytoscape/src/collection/class.js +++ /dev/null @@ -1,131 +0,0 @@ -let Set = require('../set'); - -let elesfn = ({ - classes: function( classes ){ - classes = ( classes || '' ).match( /\S+/g ) || []; - let self = this; - let changed = []; - let classesMap = new Set( classes ); - - // check and update each ele - for( let j = 0; j < self.length; j++ ){ - let ele = self[ j ]; - let _p = ele._private; - let eleClasses = _p.classes; - let changedEle = false; - - // check if ele has all of the passed classes - classesMap.forEach( cls => { - let eleHasClass = eleClasses.has(cls); - - if( !eleHasClass ){ - changedEle = true; - } - }); - - // check if ele has classes outside of those passed - if( !changedEle ){ - eleClasses.forEach( eleCls => { - let specdClass = classesMap.has(eleCls); - - if( !specdClass ){ - changedEle = true; - } - }); - } - - if( changedEle ){ - _p.classes = new Set( classesMap ); - - changed.push( ele ); - } - } - - // trigger update style on those eles that had class changes - if( changed.length > 0 ){ - this.spawn( changed ) - .updateStyle() - .emit( 'class' ) - ; - } - - return self; - }, - - addClass: function( classes ){ - return this.toggleClass( classes, true ); - }, - - hasClass: function( className ){ - let ele = this[0]; - return ( ele != null && ele._private.classes.has(className) ); - }, - - toggleClass: function( classesStr, toggle ){ - let classes = classesStr.match( /\S+/g ) || []; - let self = this; - let changed = []; // eles who had classes changed - - for( let i = 0, il = self.length; i < il; i++ ){ - let ele = self[ i ]; - let changedEle = false; - - for( let j = 0; j < classes.length; j++ ){ - let cls = classes[ j ]; - let eleClasses = ele._private.classes; - let hasClass = eleClasses.has(cls); - let shouldAdd = toggle || (toggle === undefined && !hasClass); - - if( shouldAdd ){ - eleClasses.add(cls); - - if( !hasClass && !changedEle ){ - changed.push( ele ); - changedEle = true; - } - } else { // then remove - eleClasses.delete(cls); - - if( hasClass && !changedEle ){ - changed.push( ele ); - changedEle = true; - } - } - - } // for j classes - } // for i eles - - // trigger update style on those eles that had class changes - if( changed.length > 0 ){ - this.spawn( changed ) - .updateStyle() - .emit( 'class' ) - ; - } - - return self; - }, - - removeClass: function( classes ){ - return this.toggleClass( classes, false ); - }, - - flashClass: function( classes, duration ){ - let self = this; - - if( duration == null ){ - duration = 250; - } else if( duration === 0 ){ - return self; // nothing to do really - } - - self.addClass( classes ); - setTimeout( function(){ - self.removeClass( classes ); - }, duration ); - - return self; - } -}); - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/comparators.js b/node_modules/cytoscape/src/collection/comparators.js deleted file mode 100644 index 964ee203f..000000000 --- a/node_modules/cytoscape/src/collection/comparators.js +++ /dev/null @@ -1,90 +0,0 @@ -let is = require('../is'); -let Selector = require('../selector'); - -let elesfn = ({ - allAre: function( selector ){ - let selObj = new Selector( selector ); - - return this.every(function( ele ){ - return selObj.matches( ele ); - }); - }, - - is: function( selector ){ - let selObj = new Selector( selector ); - - return this.some(function( ele ){ - return selObj.matches( ele ); - }); - }, - - some: function( fn, thisArg ){ - for( let i = 0; i < this.length; i++ ){ - let ret = !thisArg ? fn( this[ i ], i, this ) : fn.apply( thisArg, [ this[ i ], i, this ] ); - - if( ret ){ - return true; - } - } - - return false; - }, - - every: function( fn, thisArg ){ - for( let i = 0; i < this.length; i++ ){ - let ret = !thisArg ? fn( this[ i ], i, this ) : fn.apply( thisArg, [ this[ i ], i, this ] ); - - if( !ret ){ - return false; - } - } - - return true; - }, - - same: function( collection ){ - collection = this.cy().collection( collection ); - - // cheap extra check - if( this.length !== collection.length ){ - return false; - } - - return this.every(function( ele ){ - return collection.hasElementWithId( ele.id() ); - }); - }, - - anySame: function( collection ){ - collection = this.cy().collection( collection ); - - return this.some(function( ele ){ - return collection.hasElementWithId( ele.id() ); - }); - }, - - allAreNeighbors: function( collection ){ - collection = this.cy().collection( collection ); - - let nhood = this.neighborhood(); - - return collection.every(function( ele ){ - return nhood.hasElementWithId( ele.id() ); - }); - }, - - contains: function( collection ){ - collection = this.cy().collection( collection ); - - let self = this; - - return collection.every(function( ele ){ - return self.hasElementWithId( ele.id() ); - }); - } -}); - -elesfn.allAreNeighbours = elesfn.allAreNeighbors; -elesfn.has = elesfn.contains; - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/compounds.js b/node_modules/cytoscape/src/collection/compounds.js deleted file mode 100644 index 4e5793b7e..000000000 --- a/node_modules/cytoscape/src/collection/compounds.js +++ /dev/null @@ -1,214 +0,0 @@ -let Set = require('../set'); - -let elesfn = ({ - parent: function( selector ){ - let parents = []; - - // optimisation for single ele call - if( this.length === 1 ){ - let parent = this[0]._private.parent; - - if( parent ){ return parent; } - } - - for( let i = 0; i < this.length; i++ ){ - let ele = this[ i ]; - let parent = ele._private.parent; - - if( parent ){ - parents.push( parent ); - } - } - - return this.spawn( parents, { unique: true } ).filter( selector ); - }, - - parents: function( selector ){ - let parents = []; - - let eles = this.parent(); - while( eles.nonempty() ){ - for( let i = 0; i < eles.length; i++ ){ - let ele = eles[ i ]; - parents.push( ele ); - } - - eles = eles.parent(); - } - - return this.spawn( parents, { unique: true } ).filter( selector ); - }, - - commonAncestors: function( selector ){ - let ancestors; - - for( let i = 0; i < this.length; i++ ){ - let ele = this[ i ]; - let parents = ele.parents(); - - ancestors = ancestors || parents; - - ancestors = ancestors.intersect( parents ); // current list must be common with current ele parents set - } - - return ancestors.filter( selector ); - }, - - orphans: function( selector ){ - return this.stdFilter( function( ele ){ - return ele.isOrphan(); - } ).filter( selector ); - }, - - nonorphans: function( selector ){ - return this.stdFilter( function( ele ){ - return ele.isChild(); - } ).filter( selector ); - }, - - children: function( selector ){ - let children = []; - - for( let i = 0; i < this.length; i++ ){ - let ele = this[ i ]; - children = children.concat( ele._private.children ); - } - - return this.spawn( children, { unique: true } ).filter( selector ); - }, - - siblings: function( selector ){ - return this.parent().children().not( this ).filter( selector ); - }, - - isParent: function(){ - let ele = this[0]; - - if( ele ){ - return ele.isNode() && ele._private.children.length !== 0; - } - }, - - isChildless: function(){ - let ele = this[0]; - - if( ele ){ - return ele.isNode() && ele._private.children.length === 0; - } - }, - - isChild: function(){ - let ele = this[0]; - - if( ele ){ - return ele.isNode() && ele._private.parent != null; - } - }, - - isOrphan: function(){ - let ele = this[0]; - - if( ele ){ - return ele.isNode() && ele._private.parent == null; - } - }, - - descendants: function( selector ){ - let elements = []; - - function add( eles ){ - for( let i = 0; i < eles.length; i++ ){ - let ele = eles[ i ]; - - elements.push( ele ); - - if( ele.children().nonempty() ){ - add( ele.children() ); - } - } - } - - add( this.children() ); - - return this.spawn( elements, { unique: true } ).filter( selector ); - } -}); - -function forEachCompound( eles, fn, includeSelf, recursiveStep ){ - let q = []; - let did = new Set(); - let cy = eles.cy(); - let hasCompounds = cy.hasCompoundNodes(); - - for( let i = 0; i < eles.length; i++ ){ - let ele = eles[i]; - - if( includeSelf ){ - q.push( ele ); - } else if( hasCompounds ){ - recursiveStep( q, did, ele ); - } - } - - while( q.length > 0 ){ - let ele = q.shift(); - - fn( ele ); - - did.add( ele.id() ); - - if( hasCompounds ){ - recursiveStep( q, did, ele ); - } - } - - return eles; -} - -function addChildren( q, did, ele ){ - if( ele.isParent() ){ - let children = ele._private.children; - - for( let i = 0; i < children.length; i++ ){ - let child = children[i]; - - if( !did.has( child.id() ) ){ - q.push( child ); - } - } - } -} - -// very efficient version of eles.add( eles.descendants() ).forEach() -// for internal use -elesfn.forEachDown = function( fn, includeSelf = true ){ - return forEachCompound( this, fn, includeSelf, addChildren ); -}; - -function addParent( q, did, ele ){ - if( ele.isChild() ){ - let parent = ele._private.parent; - - if( !did.has( parent.id() ) ){ - q.push( parent ); - } - } -} - -elesfn.forEachUp = function( fn, includeSelf = true ){ - return forEachCompound( this, fn, includeSelf, addParent ); -}; - -function addParentAndChildren( q, did, ele ){ - addParent( q, did, ele ); - addChildren( q, did, ele ); -} - -elesfn.forEachUpAndDown = function( fn, includeSelf = true ){ - return forEachCompound( this, fn, includeSelf, addParentAndChildren ); -}; - -// aliases -elesfn.ancestors = elesfn.parents; - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/data.js b/node_modules/cytoscape/src/collection/data.js deleted file mode 100644 index f73d43b3e..000000000 --- a/node_modules/cytoscape/src/collection/data.js +++ /dev/null @@ -1,85 +0,0 @@ -let define = require( '../define' ); -let fn, elesfn; - -fn = elesfn = ({ - - data: define.data( { - field: 'data', - bindingEvent: 'data', - allowBinding: true, - allowSetting: true, - settingEvent: 'data', - settingTriggersEvent: true, - triggerFnName: 'trigger', - allowGetting: true, - immutableKeys: { - 'id': true, - 'source': true, - 'target': true, - 'parent': true - }, - updateStyle: true - } ), - - removeData: define.removeData( { - field: 'data', - event: 'data', - triggerFnName: 'trigger', - triggerEvent: true, - immutableKeys: { - 'id': true, - 'source': true, - 'target': true, - 'parent': true - }, - updateStyle: true - } ), - - scratch: define.data( { - field: 'scratch', - bindingEvent: 'scratch', - allowBinding: true, - allowSetting: true, - settingEvent: 'scratch', - settingTriggersEvent: true, - triggerFnName: 'trigger', - allowGetting: true, - updateStyle: true - } ), - - removeScratch: define.removeData( { - field: 'scratch', - event: 'scratch', - triggerFnName: 'trigger', - triggerEvent: true, - updateStyle: true - } ), - - rscratch: define.data( { - field: 'rscratch', - allowBinding: false, - allowSetting: true, - settingTriggersEvent: false, - allowGetting: true - } ), - - removeRscratch: define.removeData( { - field: 'rscratch', - triggerEvent: false - } ), - - id: function(){ - let ele = this[0]; - - if( ele ){ - return ele._private.data.id; - } - } - -}); - -// aliases -fn.attr = fn.data; -fn.removeAttr = fn.removeData; - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/degree.js b/node_modules/cytoscape/src/collection/degree.js deleted file mode 100644 index 4eabd31a2..000000000 --- a/node_modules/cytoscape/src/collection/degree.js +++ /dev/null @@ -1,119 +0,0 @@ -let util = require( '../util' ); - -let elesfn = {}; - -function defineDegreeFunction( callback ){ - return function( includeLoops ){ - let self = this; - - if( includeLoops === undefined ){ - includeLoops = true; - } - - if( self.length === 0 ){ return; } - - if( self.isNode() && !self.removed() ){ - let degree = 0; - let node = self[0]; - let connectedEdges = node._private.edges; - - for( let i = 0; i < connectedEdges.length; i++ ){ - let edge = connectedEdges[ i ]; - - if( !includeLoops && edge.isLoop() ){ - continue; - } - - degree += callback( node, edge ); - } - - return degree; - } else { - return; - } - }; -} - -util.extend( elesfn, { - degree: defineDegreeFunction( function( node, edge ){ - if( edge.source().same( edge.target() ) ){ - return 2; - } else { - return 1; - } - } ), - - indegree: defineDegreeFunction( function( node, edge ){ - if( edge.target().same( node ) ){ - return 1; - } else { - return 0; - } - } ), - - outdegree: defineDegreeFunction( function( node, edge ){ - if( edge.source().same( node ) ){ - return 1; - } else { - return 0; - } - } ) -} ); - -function defineDegreeBoundsFunction( degreeFn, callback ){ - return function( includeLoops ){ - let ret; - let nodes = this.nodes(); - - for( let i = 0; i < nodes.length; i++ ){ - let ele = nodes[ i ]; - let degree = ele[ degreeFn ]( includeLoops ); - if( degree !== undefined && (ret === undefined || callback( degree, ret )) ){ - ret = degree; - } - } - - return ret; - }; -} - -util.extend( elesfn, { - minDegree: defineDegreeBoundsFunction( 'degree', function( degree, min ){ - return degree < min; - } ), - - maxDegree: defineDegreeBoundsFunction( 'degree', function( degree, max ){ - return degree > max; - } ), - - minIndegree: defineDegreeBoundsFunction( 'indegree', function( degree, min ){ - return degree < min; - } ), - - maxIndegree: defineDegreeBoundsFunction( 'indegree', function( degree, max ){ - return degree > max; - } ), - - minOutdegree: defineDegreeBoundsFunction( 'outdegree', function( degree, min ){ - return degree < min; - } ), - - maxOutdegree: defineDegreeBoundsFunction( 'outdegree', function( degree, max ){ - return degree > max; - } ) -} ); - -util.extend( elesfn, { - totalDegree: function( includeLoops ){ - let total = 0; - let nodes = this.nodes(); - - for( let i = 0; i < nodes.length; i++ ){ - total += nodes[ i ].degree( includeLoops ); - } - - return total; - } -} ); - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/dimensions/bounds.js b/node_modules/cytoscape/src/collection/dimensions/bounds.js deleted file mode 100644 index e46982658..000000000 --- a/node_modules/cytoscape/src/collection/dimensions/bounds.js +++ /dev/null @@ -1,766 +0,0 @@ -let is = require('../../is'); -let util = require('../../util'); -let math = require('../../math'); -let fn, elesfn; - -fn = elesfn = {}; - -elesfn.renderedBoundingBox = function( options ){ - let bb = this.boundingBox( options ); - let cy = this.cy(); - let zoom = cy.zoom(); - let pan = cy.pan(); - - let x1 = bb.x1 * zoom + pan.x; - let x2 = bb.x2 * zoom + pan.x; - let y1 = bb.y1 * zoom + pan.y; - let y2 = bb.y2 * zoom + pan.y; - - return { - x1: x1, - x2: x2, - y1: y1, - y2: y2, - w: x2 - x1, - h: y2 - y1 - }; -}; - -elesfn.dirtyCompoundBoundsCache = function(){ - let cy = this.cy(); - - if( !cy.styleEnabled() || !cy.hasCompoundNodes() ){ return this; } - - this.forEachUp( ele => { - ele._private.compoundBoundsClean = false; - - if( ele.isParent() ){ - ele.emit('bounds'); - } - } ); - - return this; -}; - -elesfn.updateCompoundBounds = function(){ - let cy = this.cy(); - - // save cycles for non compound graphs or when style disabled - if( !cy.styleEnabled() || !cy.hasCompoundNodes() ){ return this; } - - // save cycles when batching -- but bounds will be stale (or not exist yet) - if( cy.batching() ){ return this; } - - let updated = []; - - function update( parent ){ - if( !parent.isParent() ){ return; } - - let _p = parent._private; - let children = parent.children(); - let includeLabels = parent.pstyle( 'compound-sizing-wrt-labels' ).value === 'include'; - - let min = { - width: { - val: parent.pstyle( 'min-width' ).pfValue, - left: parent.pstyle( 'min-width-bias-left' ), - right: parent.pstyle( 'min-width-bias-right' ) - }, - height: { - val: parent.pstyle( 'min-height' ).pfValue, - top: parent.pstyle( 'min-height-bias-top' ), - bottom: parent.pstyle( 'min-height-bias-bottom' ) - } - }; - - let bb = children.boundingBox( { - includeLabels: includeLabels, - includeOverlays: false, - - // updating the compound bounds happens outside of the regular - // cache cycle (i.e. before fired events) - useCache: false - } ); - let pos = _p.position; - - // if children take up zero area then keep position and fall back on stylesheet w/h - if( bb.w === 0 || bb.h === 0 ){ - bb = { - w: parent.pstyle('width').pfValue, - h: parent.pstyle('height').pfValue - }; - - bb.x1 = pos.x - bb.w/2; - bb.x2 = pos.x + bb.w/2; - bb.y1 = pos.y - bb.h/2; - bb.y2 = pos.y + bb.h/2; - } - - function computeBiasValues( propDiff, propBias, propBiasComplement ){ - let biasDiff = 0; - let biasComplementDiff = 0; - let biasTotal = propBias + propBiasComplement; - - if( propDiff > 0 && biasTotal > 0 ){ - biasDiff = ( propBias / biasTotal ) * propDiff; - biasComplementDiff = ( propBiasComplement / biasTotal ) * propDiff; - } - return { - biasDiff: biasDiff, - biasComplementDiff: biasComplementDiff - }; - } - - function computePaddingValues( width, height, paddingObject, relativeTo ) { - // Assuming percentage is number from 0 to 1 - if(paddingObject.units === '%') { - switch(relativeTo) { - case 'width': - return width > 0 ? paddingObject.pfValue * width : 0; - case 'height': - return height > 0 ? paddingObject.pfValue * height : 0; - case 'average': - return ( width > 0 ) && ( height > 0 ) ? paddingObject.pfValue * ( width + height ) / 2 : 0; - case 'min': - return ( width > 0 ) && ( height > 0 ) ? ( ( width > height ) ? paddingObject.pfValue * height : paddingObject.pfValue * width ) : 0; - case 'max': - return ( width > 0 ) && ( height > 0 ) ? ( ( width > height ) ? paddingObject.pfValue * width : paddingObject.pfValue * height ) : 0; - default: - return 0; - } - } else if(paddingObject.units === 'px') { - return paddingObject.pfValue; - } else { - return 0; - } - } - - let leftVal = min.width.left.value; - if( min.width.left.units === 'px' && min.width.val > 0 ){ - leftVal = ( leftVal * 100 ) / min.width.val; - } - let rightVal = min.width.right.value; - if( min.width.right.units === 'px' && min.width.val > 0 ){ - rightVal = ( rightVal * 100 ) / min.width.val; - } - - let topVal = min.height.top.value; - if( min.height.top.units === 'px' && min.height.val > 0 ){ - topVal = ( topVal * 100 ) / min.height.val; - } - - let bottomVal = min.height.bottom.value; - if( min.height.bottom.units === 'px' && min.height.val > 0 ){ - bottomVal = ( bottomVal * 100 ) / min.height.val; - } - - let widthBiasDiffs = computeBiasValues( min.width.val - bb.w, leftVal, rightVal ); - let diffLeft = widthBiasDiffs.biasDiff; - let diffRight = widthBiasDiffs.biasComplementDiff; - - let heightBiasDiffs = computeBiasValues( min.height.val - bb.h, topVal, bottomVal ); - let diffTop = heightBiasDiffs.biasDiff; - let diffBottom = heightBiasDiffs.biasComplementDiff; - - _p.autoPadding = computePaddingValues( bb.w, bb.h, parent.pstyle( 'padding' ), parent.pstyle( 'padding-relative-to' ).value ); - - _p.autoWidth = Math.max(bb.w, min.width.val); - pos.x = (- diffLeft + bb.x1 + bb.x2 + diffRight) / 2; - - _p.autoHeight = Math.max(bb.h, min.height.val); - pos.y = (- diffTop + bb.y1 + bb.y2 + diffBottom) / 2; - - updated.push( parent ); - } - - for( let i = 0; i < this.length; i++ ){ - let ele = this[i]; - let _p = ele._private; - - if( !_p.compoundBoundsClean ){ - update( ele ); - - if( !cy._private.batchingStyle ){ - _p.compoundBoundsClean = true; - } - } - } - - return this; -}; - -let noninf = function( x ){ - if( x === Infinity || x === -Infinity ){ - return 0; - } - - return x; -}; - -let updateBounds = function( b, x1, y1, x2, y2 ){ - // don't update with zero area boxes - if( x2 - x1 === 0 || y2 - y1 === 0 ){ return; } - - // don't update with null dim - if( x1 == null || y1 == null || x2 == null || y2 == null ){ return; } - - b.x1 = x1 < b.x1 ? x1 : b.x1; - b.x2 = x2 > b.x2 ? x2 : b.x2; - b.y1 = y1 < b.y1 ? y1 : b.y1; - b.y2 = y2 > b.y2 ? y2 : b.y2; -}; - -let updateBoundsFromBox = function( b, b2 ){ - return updateBounds( b, b2.x1, b2.y1, b2.x2, b2.y2 ); -}; - -let prefixedProperty = function( obj, field, prefix ){ - return util.getPrefixedProperty( obj, field, prefix ); -}; - -let updateBoundsFromArrow = function( bounds, ele, prefix ){ - if( ele.cy().headless() ){ return; } - - let _p = ele._private; - let rstyle = _p.rstyle; - let halfArW = rstyle.arrowWidth / 2; - let arrowType = ele.pstyle( prefix + '-arrow-shape' ).value; - let x; - let y; - - if( arrowType !== 'none' ){ - if( prefix === 'source' ){ - x = rstyle.srcX; - y = rstyle.srcY; - } else if( prefix === 'target' ){ - x = rstyle.tgtX; - y = rstyle.tgtY; - } else { - x = rstyle.midX; - y = rstyle.midY; - } - - updateBounds( bounds, x - halfArW, y - halfArW, x + halfArW, y + halfArW ); - } -}; - -let updateBoundsFromLabel = function( bounds, ele, prefix ){ - if( ele.cy().headless() ){ return; } - - let prefixDash; - - if( prefix ){ - prefixDash = prefix + '-'; - } else { - prefixDash = ''; - } - - let _p = ele._private; - let rstyle = _p.rstyle; - let label = ele.pstyle( prefixDash + 'label' ).strValue; - - if( label ){ - let halign = ele.pstyle( 'text-halign' ); - let valign = ele.pstyle( 'text-valign' ); - let labelWidth = prefixedProperty( rstyle, 'labelWidth', prefix ); - let labelHeight = prefixedProperty( rstyle, 'labelHeight', prefix ); - let labelX = prefixedProperty( rstyle, 'labelX', prefix ); - let labelY = prefixedProperty( rstyle, 'labelY', prefix ); - let marginX = ele.pstyle( prefixDash + 'text-margin-x' ).pfValue; - let marginY = ele.pstyle( prefixDash + 'text-margin-y' ).pfValue; - let isEdge = ele.isEdge(); - let rotation = ele.pstyle( prefixDash + 'text-rotation' ); - let outlineWidth = ele.pstyle( 'text-outline-width' ).pfValue; - let borderWidth = ele.pstyle( 'text-border-width' ).pfValue; - let halfBorderWidth = borderWidth / 2; - let padding = ele.pstyle( 'text-background-padding' ).pfValue; - - let lh = labelHeight + 2 * padding; - let lw = labelWidth + 2 * padding; - let lw_2 = lw / 2; - let lh_2 = lh / 2; - let lx1, lx2, ly1, ly2; - - if( isEdge ){ - lx1 = labelX - lw_2; - lx2 = labelX + lw_2; - ly1 = labelY - lh_2; - ly2 = labelY + lh_2; - } else { - switch( halign.value ){ - case 'left': - lx1 = labelX - lw; - lx2 = labelX; - break; - - case 'center': - lx1 = labelX - lw_2; - lx2 = labelX + lw_2; - break; - - case 'right': - lx1 = labelX; - lx2 = labelX + lw; - break; - } - - switch( valign.value ){ - case 'top': - ly1 = labelY - lh; - ly2 = labelY; - break; - - case 'center': - ly1 = labelY - lh_2; - ly2 = labelY + lh_2; - break; - - case 'bottom': - ly1 = labelY; - ly2 = labelY + lh; - break; - } - } - - let isAutorotate = ( isEdge && rotation.strValue === 'autorotate' ); - let isPfValue = ( rotation.pfValue != null && rotation.pfValue !== 0 ); - - if( isAutorotate || isPfValue ){ - let theta = isAutorotate ? prefixedProperty( _p.rstyle, 'labelAngle', prefix ) : rotation.pfValue; - let cos = Math.cos( theta ); - let sin = Math.sin( theta ); - - let rotate = function( x, y ){ - x = x - labelX; - y = y - labelY; - - return { - x: x * cos - y * sin + labelX, - y: x * sin + y * cos + labelY - }; - }; - - let px1y1 = rotate( lx1, ly1 ); - let px1y2 = rotate( lx1, ly2 ); - let px2y1 = rotate( lx2, ly1 ); - let px2y2 = rotate( lx2, ly2 ); - - lx1 = Math.min( px1y1.x, px1y2.x, px2y1.x, px2y2.x ); - lx2 = Math.max( px1y1.x, px1y2.x, px2y1.x, px2y2.x ); - ly1 = Math.min( px1y1.y, px1y2.y, px2y1.y, px2y2.y ); - ly2 = Math.max( px1y1.y, px1y2.y, px2y1.y, px2y2.y ); - } - - lx1 += marginX - Math.max( outlineWidth, halfBorderWidth ); - lx2 += marginX + Math.max( outlineWidth, halfBorderWidth ); - ly1 += marginY - Math.max( outlineWidth, halfBorderWidth ); - ly2 += marginY + Math.max( outlineWidth, halfBorderWidth ); - - updateBounds( bounds, lx1, ly1, lx2, ly2 ); - } - - return bounds; -}; - -// get the bounding box of the elements (in raw model position) -let boundingBoxImpl = function( ele, options ){ - let cy = ele._private.cy; - let styleEnabled = cy.styleEnabled(); - let headless = cy.headless(); - - let bounds = { - x1: Infinity, - y1: Infinity, - x2: -Infinity, - y2: -Infinity - }; - - let _p = ele._private; - let display = styleEnabled ? ele.pstyle( 'display' ).value : 'element'; - let isNode = ele.isNode(); - let isEdge = ele.isEdge(); - let ex1, ex2, ey1, ey2; // extrema of body / lines - let x, y; // node pos - let displayed = display !== 'none'; - - if( displayed ){ - let overlayOpacity = 0; - let overlayPadding = 0; - - if( styleEnabled && options.includeOverlays ){ - overlayOpacity = ele.pstyle( 'overlay-opacity' ).value; - - if( overlayOpacity !== 0 ){ - overlayPadding = ele.pstyle( 'overlay-padding' ).value; - } - } - - let w = 0; - let wHalf = 0; - - if( styleEnabled ){ - w = ele.pstyle( 'width' ).pfValue; - wHalf = w / 2; - } - - if( isNode && options.includeNodes ){ - let pos = ele.position(); - x = pos.x; - y = pos.y; - let w = ele.outerWidth(); - let halfW = w / 2; - let h = ele.outerHeight(); - let halfH = h / 2; - - // handle node dimensions - ///////////////////////// - - ex1 = x - halfW - overlayPadding; - ex2 = x + halfW + overlayPadding; - ey1 = y - halfH - overlayPadding; - ey2 = y + halfH + overlayPadding; - - updateBounds( bounds, ex1, ey1, ex2, ey2 ); - - } else if( isEdge && options.includeEdges ){ - let rstyle = _p.rstyle || {}; - - // handle edge dimensions (rough box estimate) - ////////////////////////////////////////////// - if( styleEnabled && !headless ){ - ex1 = Math.min( rstyle.srcX, rstyle.midX, rstyle.tgtX ); - ex2 = Math.max( rstyle.srcX, rstyle.midX, rstyle.tgtX ); - ey1 = Math.min( rstyle.srcY, rstyle.midY, rstyle.tgtY ); - ey2 = Math.max( rstyle.srcY, rstyle.midY, rstyle.tgtY ); - - // take into account edge width - ex1 -= wHalf; - ex2 += wHalf; - ey1 -= wHalf; - ey2 += wHalf; - - updateBounds( bounds, ex1, ey1, ex2, ey2 ); - } - - // precise haystacks - //////////////////// - if( styleEnabled && !headless && ele.pstyle( 'curve-style' ).strValue === 'haystack' ){ - let hpts = rstyle.haystackPts || []; - - ex1 = hpts[0].x; - ey1 = hpts[0].y; - ex2 = hpts[1].x; - ey2 = hpts[1].y; - - if( ex1 > ex2 ){ - let temp = ex1; - ex1 = ex2; - ex2 = temp; - } - - if( ey1 > ey2 ){ - let temp = ey1; - ey1 = ey2; - ey2 = temp; - } - - updateBounds( bounds, ex1 - wHalf, ey1 - wHalf, ex2 + wHalf, ey2 + wHalf ); - - // handle points along edge - /////////////////////////// - } else { - let pts = rstyle.bezierPts || rstyle.linePts || []; - - for( let j = 0; j < pts.length; j++ ){ - let pt = pts[ j ]; - - ex1 = pt.x - wHalf; - ex2 = pt.x + wHalf; - ey1 = pt.y - wHalf; - ey2 = pt.y + wHalf; - - updateBounds( bounds, ex1, ey1, ex2, ey2 ); - } - - // fallback on source and target positions - ////////////////////////////////////////// - if( pts.length === 0 ){ - let n1 = ele.source(); - let n1pos = n1.position(); - - let n2 = ele.target(); - let n2pos = n2.position(); - - ex1 = n1pos.x; - ex2 = n2pos.x; - ey1 = n1pos.y; - ey2 = n2pos.y; - - if( ex1 > ex2 ){ - let temp = ex1; - ex1 = ex2; - ex2 = temp; - } - - if( ey1 > ey2 ){ - let temp = ey1; - ey1 = ey2; - ey2 = temp; - } - - // take into account edge width - ex1 -= wHalf; - ex2 += wHalf; - ey1 -= wHalf; - ey2 += wHalf; - - updateBounds( bounds, ex1, ey1, ex2, ey2 ); - } - } - - } // edges - - - // handle edge arrow size - ///////////////////////// - - if( styleEnabled && options.includeEdges && isEdge ){ - updateBoundsFromArrow( bounds, ele, 'mid-source', options ); - updateBoundsFromArrow( bounds, ele, 'mid-target', options ); - updateBoundsFromArrow( bounds, ele, 'source', options ); - updateBoundsFromArrow( bounds, ele, 'target', options ); - } - - // ghost - //////// - - if( styleEnabled ){ - let ghost = ele.pstyle('ghost').value === 'yes'; - - if( ghost ){ - let gx = ele.pstyle('ghost-offset-x').pfValue; - let gy = ele.pstyle('ghost-offset-y').pfValue; - - updateBounds( bounds, bounds.x1 + gx, bounds.y1 + gy, bounds.x2 + gx, bounds.y2 + gy ); - } - } - - // overlay - ////////// - - if( styleEnabled ){ - - ex1 = bounds.x1; - ex2 = bounds.x2; - ey1 = bounds.y1; - ey2 = bounds.y2; - - updateBounds( bounds, ex1 - overlayPadding, ey1 - overlayPadding, ex2 + overlayPadding, ey2 + overlayPadding ); - } - - // handle label dimensions - ////////////////////////// - - if( styleEnabled && options.includeLabels ){ - updateBoundsFromLabel( bounds, ele, null, options ); - - if( isEdge ){ - updateBoundsFromLabel( bounds, ele, 'source', options ); - updateBoundsFromLabel( bounds, ele, 'target', options ); - } - } // style enabled for labels - } // if displayed - - bounds.x1 = noninf( bounds.x1 ); - bounds.y1 = noninf( bounds.y1 ); - bounds.x2 = noninf( bounds.x2 ); - bounds.y2 = noninf( bounds.y2 ); - bounds.w = noninf( bounds.x2 - bounds.x1 ); - bounds.h = noninf( bounds.y2 - bounds.y1 ); - - // expand bounds by 1 because antialiasing can increase the visual/effective size by 1 on all sides - if( bounds.w > 0 && bounds.h > 0 && displayed ){ - math.expandBoundingBox( bounds, 1 ); - } - - return bounds; -}; - -let tf = function( val ){ - if( val ){ - return 't'; - } else { - return 'f'; - } -}; - -let getKey = function( opts ){ - let key = ''; - - key += tf( opts.incudeNodes ); - key += tf( opts.includeEdges ); - key += tf( opts.includeLabels ); - key += tf( opts.includeOverlays ); - - return key; -}; - -let cachedBoundingBoxImpl = function( ele, opts ){ - let _p = ele._private; - let bb; - let headless = ele.cy().headless(); - let key = opts === defBbOpts ? defBbOptsKey : getKey( opts ); - - if( !opts.useCache || headless || !_p.bbCache || !_p.bbCache[key] ){ - bb = boundingBoxImpl( ele, opts ); - - if( !headless ){ - _p.bbCache = _p.bbCache || {}; - _p.bbCache[key] = bb; - } - } else { - bb = _p.bbCache[key]; - } - - return bb; -}; - -let defBbOpts = { - includeNodes: true, - includeEdges: true, - includeLabels: true, - includeOverlays: true, - useCache: true -}; - -let defBbOptsKey = getKey( defBbOpts ); - -function filledBbOpts( options ){ - return { - includeNodes: util.default( options.includeNodes, defBbOpts.includeNodes ), - includeEdges: util.default( options.includeEdges, defBbOpts.includeEdges ), - includeLabels: util.default( options.includeLabels, defBbOpts.includeLabels ), - includeOverlays: util.default( options.includeOverlays, defBbOpts.includeOverlays ), - useCache: util.default( options.useCache, defBbOpts.useCache ) - }; -} - -elesfn.boundingBox = function( options ){ - // the main usecase is ele.boundingBox() for a single element with no/def options - // specified s.t. the cache is used, so check for this case to make it faster by - // avoiding the overhead of the rest of the function - if( this.length === 1 && this[0]._private.bbCache && (options === undefined || options.useCache === undefined || options.useCache === true) ){ - if( options === undefined ){ - options = defBbOpts; - } else { - options = filledBbOpts( options ); - } - - return cachedBoundingBoxImpl( this[0], options ); - } - - let bounds = { - x1: Infinity, - y1: Infinity, - x2: -Infinity, - y2: -Infinity - }; - - options = options || util.staticEmptyObject(); - - let opts = filledBbOpts( options ); - - let eles = this; - let cy = eles.cy(); - let styleEnabled = cy.styleEnabled(); - - if( styleEnabled ){ - this.recalculateRenderedStyle( opts.useCache ); - } - - this.updateCompoundBounds(); - - let updatedEdge = {}; // use to avoid duplicated edge updates - - for( let i = 0; i < eles.length; i++ ){ - let ele = eles[i]; - - if( styleEnabled && ele.isEdge() && ele.pstyle('curve-style').strValue === 'bezier' && !updatedEdge[ ele.id() ] ){ - let edges = ele.parallelEdges(); - - for( let j = 0; j < edges.length; j++ ){ // make all as updated - updatedEdge[ edges[j].id() ] = true; - } - - edges.recalculateRenderedStyle( opts.useCache ); // n.b. ele.parallelEdges() single is cached - } - - updateBoundsFromBox( bounds, cachedBoundingBoxImpl( ele, opts ) ); - } - - bounds.x1 = noninf( bounds.x1 ); - bounds.y1 = noninf( bounds.y1 ); - bounds.x2 = noninf( bounds.x2 ); - bounds.y2 = noninf( bounds.y2 ); - bounds.w = noninf( bounds.x2 - bounds.x1 ); - bounds.h = noninf( bounds.y2 - bounds.y1 ); - - return bounds; -}; - -// private helper to get bounding box for custom node positions -// - good for perf in certain cases but currently requires dirtying the rendered style -// - would be better to not modify the nodes but the nodes are read directly everywhere in the renderer... -// - try to use for only things like discrete layouts where the node position would change anyway -elesfn.boundingBoxAt = function( fn ){ - let nodes = this.nodes(); - - if( is.plainObject( fn ) ){ - let obj = fn; - - fn = function(){ return obj; }; - } - - // save the current position and set the new one, per node - for( let i = 0; i < nodes.length; i++ ){ - let n = nodes[i]; - let _p = n._private; - let pos = _p.position; - let newPos = fn.call( n, n, i ); - - _p.bbAtOldPos = { x: pos.x, y: pos.y }; - - if( newPos ){ - pos.x = newPos.x; - pos.y = newPos.y; - } - } - - this.emit('dirty'); // let the renderer know we've manually dirtied rendered dim calcs - - nodes.dirtyCompoundBoundsCache().updateCompoundBounds(); - - let bb = this.boundingBox({ useCache: false }); - - // restore the original position, per node - for( let i = 0; i < nodes.length; i++ ){ - let n = nodes[i]; - let _p = n._private; - let pos = n._private.position; - let old = _p.bbAtOldPos; - - pos.x = old.x; - pos.y = old.y; - } - - nodes.dirtyCompoundBoundsCache(); - - this.emit('dirty'); // let the renderer know we've manually dirtied rendered dim calcs - - return bb; -}; - -fn.boundingbox = fn.boundingBox; -fn.renderedBoundingbox = fn.renderedBoundingBox; - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/dimensions/edge-points.js b/node_modules/cytoscape/src/collection/dimensions/edge-points.js deleted file mode 100644 index 33a427445..000000000 --- a/node_modules/cytoscape/src/collection/dimensions/edge-points.js +++ /dev/null @@ -1,23 +0,0 @@ -let ifEdge = (self, then) => { - if( self.isEdge() ){ - return then( self.renderer() ); - } -}; - -module.exports = { - controlPoints: function(){ - return ifEdge( this, renderer => renderer.getControlPoints( this ) ); - }, - segmentPoints: function(){ - return ifEdge( this, renderer => renderer.getSegmentPoints( this ) ); - }, - sourceEndpoint: function(){ - return ifEdge( this, renderer => renderer.getSourceEndpoint( this ) ); - }, - targetEndpoint: function(){ - return ifEdge( this, renderer => renderer.getTargetEndpoint( this ) ); - }, - midpoint: function(){ - return ifEdge( this, renderer => renderer.getEdgeMidpoint( this ) ); - } -}; diff --git a/node_modules/cytoscape/src/collection/dimensions/index.js b/node_modules/cytoscape/src/collection/dimensions/index.js deleted file mode 100644 index 71b8f86e3..000000000 --- a/node_modules/cytoscape/src/collection/dimensions/index.js +++ /dev/null @@ -1,7 +0,0 @@ -let util = require('../../util'); -let position = require('./position'); -let bounds = require('./bounds'); -let widthHeight = require('./width-height'); -let edgePoints = require('./edge-points'); - -module.exports = util.assign( {}, position, bounds, widthHeight, edgePoints ); diff --git a/node_modules/cytoscape/src/collection/dimensions/position.js b/node_modules/cytoscape/src/collection/dimensions/position.js deleted file mode 100644 index a09323bc2..000000000 --- a/node_modules/cytoscape/src/collection/dimensions/position.js +++ /dev/null @@ -1,235 +0,0 @@ -let define = require('../../define'); -let is = require('../../is'); -let math = require('../../math'); -let fn, elesfn; - -let beforePositionSet = function( eles, newPos ){ - for( let i = 0; i < eles.length; i++ ){ - let ele = eles[i]; - - if( ele.isParent() && !ele.locked() ){ - let oldPos = ele._private.position; - let delta = { - x: newPos.x - oldPos.x, - y: newPos.y - oldPos.y - }; - - eles.children().shift( delta ); - } - } -}; - -fn = elesfn = ({ - - position: define.data( { - field: 'position', - bindingEvent: 'position', - allowBinding: true, - allowSetting: true, - settingEvent: 'position', - settingTriggersEvent: true, - triggerFnName: 'emitAndNotify', - allowGetting: true, - validKeys: [ 'x', 'y' ], - beforeGet: function( ele ){ - ele.updateCompoundBounds(); - }, - beforeSet: beforePositionSet, - onSet: function( eles ){ - eles.dirtyCompoundBoundsCache(); - }, - canSet: function( ele ){ - return !ele.locked(); - } - } ), - - // position but no notification to renderer - silentPosition: define.data( { - field: 'position', - bindingEvent: 'position', - allowBinding: false, - allowSetting: true, - settingEvent: 'position', - settingTriggersEvent: false, - triggerFnName: 'trigger', - allowGetting: false, - validKeys: [ 'x', 'y' ], - beforeSet: beforePositionSet, - onSet: function( eles ){ - eles.dirtyCompoundBoundsCache(); - }, - canSet: function( ele ){ - return !ele.locked(); - } - } ), - - positions: function( pos, silent ){ - if( is.plainObject( pos ) ){ - if( silent ){ - this.silentPosition( pos ); - } else { - this.position( pos ); - } - - } else if( is.fn( pos ) ){ - let fn = pos; - let cy = this.cy(); - - cy.startBatch(); - - for( let i = 0; i < this.length; i++ ){ - let ele = this[ i ]; - let pos; - - if( ( pos = fn(ele, i) ) ){ - if( silent ){ - ele.silentPosition( pos ); - } else { - ele.position( pos ); - } - } - } - - cy.endBatch(); - } - - return this; // chaining - }, - - silentPositions: function( pos ){ - return this.positions( pos, true ); - }, - - shift: function( dim, val ){ - let delta; - - if( is.plainObject( dim ) ){ - delta = dim; - } else if( is.string( dim ) && is.number( val ) ){ - delta = { x: 0, y: 0 }; - - delta[ dim ] = val; - } - - if( delta != null ){ - for( let i = 0; i < this.length; i++ ){ - let ele = this[i]; - let pos = ele.position(); - - ele.position({ - x: pos.x + delta.x, - y: pos.y + delta.y - }); - } - } - - return this; - }, - - // get/set the rendered (i.e. on screen) positon of the element - renderedPosition: function( dim, val ){ - let ele = this[0]; - let cy = this.cy(); - let zoom = cy.zoom(); - let pan = cy.pan(); - let rpos = is.plainObject( dim ) ? dim : undefined; - let setting = rpos !== undefined || ( val !== undefined && is.string( dim ) ); - - if( ele && ele.isNode() ){ // must have an element and must be a node to return position - if( setting ){ - for( let i = 0; i < this.length; i++ ){ - let ele = this[ i ]; - - if( val !== undefined ){ // set one dimension - ele.position( dim, ( val - pan[ dim ] ) / zoom ); - } else if( rpos !== undefined ){ // set whole position - ele.position( math.renderedToModelPosition( rpos, zoom, pan ) ); - } - } - } else { // getting - let pos = ele.position(); - rpos = math.modelToRenderedPosition( pos, zoom, pan ); - - if( dim === undefined ){ // then return the whole rendered position - return rpos; - } else { // then return the specified dimension - return rpos[ dim ]; - } - } - } else if( !setting ){ - return undefined; // for empty collection case - } - - return this; // chaining - }, - - // get/set the position relative to the parent - relativePosition: function( dim, val ){ - let ele = this[0]; - let cy = this.cy(); - let ppos = is.plainObject( dim ) ? dim : undefined; - let setting = ppos !== undefined || ( val !== undefined && is.string( dim ) ); - let hasCompoundNodes = cy.hasCompoundNodes(); - - if( ele && ele.isNode() ){ // must have an element and must be a node to return position - if( setting ){ - for( let i = 0; i < this.length; i++ ){ - let ele = this[ i ]; - let parent = hasCompoundNodes ? ele.parent() : null; - let hasParent = parent && parent.length > 0; - let relativeToParent = hasParent; - - if( hasParent ){ - parent = parent[0]; - } - - let origin = relativeToParent ? parent.position() : { x: 0, y: 0 }; - - if( val !== undefined ){ // set one dimension - ele.position( dim, val + origin[ dim ] ); - } else if( ppos !== undefined ){ // set whole position - ele.position({ - x: ppos.x + origin.x, - y: ppos.y + origin.y - }); - } - } - - } else { // getting - let pos = ele.position(); - let parent = hasCompoundNodes ? ele.parent() : null; - let hasParent = parent && parent.length > 0; - let relativeToParent = hasParent; - - if( hasParent ){ - parent = parent[0]; - } - - let origin = relativeToParent ? parent.position() : { x: 0, y: 0 }; - - ppos = { - x: pos.x - origin.x, - y: pos.y - origin.y - }; - - if( dim === undefined ){ // then return the whole rendered position - return ppos; - } else { // then return the specified dimension - return ppos[ dim ]; - } - } - } else if( !setting ){ - return undefined; // for empty collection case - } - - return this; // chaining - } -}); - -// aliases -fn.modelPosition = fn.point = fn.position; -fn.modelPositions = fn.points = fn.positions; -fn.renderedPoint = fn.renderedPosition; -fn.relativePoint = fn.relativePosition; - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/dimensions/width-height.js b/node_modules/cytoscape/src/collection/dimensions/width-height.js deleted file mode 100644 index 1c89f6021..000000000 --- a/node_modules/cytoscape/src/collection/dimensions/width-height.js +++ /dev/null @@ -1,106 +0,0 @@ -let util = require('../../util'); -let fn, elesfn; - -fn = elesfn = {}; - -let defineDimFns = function( opts ){ - opts.uppercaseName = util.capitalize( opts.name ); - opts.autoName = 'auto' + opts.uppercaseName; - opts.labelName = 'label' + opts.uppercaseName; - opts.outerName = 'outer' + opts.uppercaseName; - opts.uppercaseOuterName = util.capitalize( opts.outerName ); - - fn[ opts.name ] = function dimImpl(){ - let ele = this[0]; - let _p = ele._private; - let cy = _p.cy; - let styleEnabled = cy._private.styleEnabled; - - if( ele ){ - if( styleEnabled ){ - if( ele.isParent() ){ - ele.updateCompoundBounds(); - - return _p[ opts.autoName ] || 0; - } - - let d = ele.pstyle( opts.name ); - - switch( d.strValue ){ - case 'label': - ele.recalculateRenderedStyle(); - - return _p.rstyle[ opts.labelName ] || 0; - - default: - return d.pfValue; - } - } else { - return 1; - } - } - }; - - fn[ 'outer' + opts.uppercaseName ] = function outerDimImpl(){ - let ele = this[0]; - let _p = ele._private; - let cy = _p.cy; - let styleEnabled = cy._private.styleEnabled; - - if( ele ){ - if( styleEnabled ){ - let dim = ele[ opts.name ](); - let border = ele.pstyle( 'border-width' ).pfValue; // n.b. 1/2 each side - let padding = 2 * ele.padding(); - - return dim + border + padding; - } else { - return 1; - } - } - }; - - fn[ 'rendered' + opts.uppercaseName ] = function renderedDimImpl(){ - let ele = this[0]; - - if( ele ){ - let d = ele[ opts.name ](); - return d * this.cy().zoom(); - } - }; - - fn[ 'rendered' + opts.uppercaseOuterName ] = function renderedOuterDimImpl(){ - let ele = this[0]; - - if( ele ){ - let od = ele[ opts.outerName ](); - return od * this.cy().zoom(); - } - }; -}; - -defineDimFns( { - name: 'width' -} ); - -defineDimFns( { - name: 'height' -} ); - -elesfn.padding = function(){ - let ele = this[0]; - let _p = ele._private; - if( ele.isParent() ){ - ele.updateCompoundBounds(); - - if( _p.autoPadding !== undefined ){ - return _p.autoPadding; - } else { - return ele.pstyle('padding').pfValue; - } - } else { - return ele.pstyle('padding').pfValue; - } -}; - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/element.js b/node_modules/cytoscape/src/collection/element.js deleted file mode 100644 index 9f2e4314e..000000000 --- a/node_modules/cytoscape/src/collection/element.js +++ /dev/null @@ -1,105 +0,0 @@ -let util = require('../util'); -let is = require('../is'); -let Set = require('../set'); - -// represents a node or an edge -let Element = function( cy, params, restore ){ - restore = (restore === undefined || restore ? true : false); - - if( cy === undefined || params === undefined || !is.core( cy ) ){ - util.error( 'An element must have a core reference and parameters set' ); - return; - } - - let group = params.group; - - // try to automatically infer the group if unspecified - if( group == null ){ - if( params.data && params.data.source != null && params.data.target != null ){ - group = 'edges'; - } else { - group = 'nodes'; - } - } - - // validate group - if( group !== 'nodes' && group !== 'edges' ){ - util.error( 'An element must be of type `nodes` or `edges`; you specified `' + group + '`' ); - return; - } - - // make the element array-like, just like a collection - this.length = 1; - this[0] = this; - - // NOTE: when something is added here, add also to ele.json() - let _p = this._private = { - cy: cy, - single: true, // indicates this is an element - data: params.data || {}, // data object - position: params.position || {}, // (x, y) position pair - autoWidth: undefined, // width and height of nodes calculated by the renderer when set to special 'auto' value - autoHeight: undefined, - autoPadding: undefined, - compoundBoundsClean: false, // whether the compound dimensions need to be recalculated the next time dimensions are read - listeners: [], // array of bound listeners - group: group, // string; 'nodes' or 'edges' - style: {}, // properties as set by the style - rstyle: {}, // properties for style sent from the renderer to the core - styleCxts: [], // applied style contexts from the styler - removed: true, // whether it's inside the vis; true if removed (set true here since we call restore) - selected: params.selected ? true : false, // whether it's selected - selectable: params.selectable === undefined ? true : ( params.selectable ? true : false ), // whether it's selectable - locked: params.locked ? true : false, // whether the element is locked (cannot be moved) - grabbed: false, // whether the element is grabbed by the mouse; renderer sets this privately - grabbable: params.grabbable === undefined ? true : ( params.grabbable ? true : false ), // whether the element can be grabbed - active: false, // whether the element is active from user interaction - classes: new Set(), // map ( className => true ) - animation: { // object for currently-running animations - current: [], - queue: [] - }, - rscratch: {}, // object in which the renderer can store information - scratch: params.scratch || {}, // scratch objects - edges: [], // array of connected edges - children: [], // array of children - parent: null, // parent ref - traversalCache: {}, // cache of output of traversal functions - backgrounding: false // whether background images are loading - }; - - // renderedPosition overrides if specified - if( params.renderedPosition ){ - let rpos = params.renderedPosition; - let pan = cy.pan(); - let zoom = cy.zoom(); - - _p.position = { - x: (rpos.x - pan.x) / zoom, - y: (rpos.y - pan.y) / zoom - }; - } - - if( is.string( params.classes ) ){ - let classes = params.classes.split( /\s+/ ); - for( let i = 0, l = classes.length; i < l; i++ ){ - let cls = classes[ i ]; - if( !cls || cls === '' ){ continue; } - - _p.classes.add(cls); - } - } - - if( params.style || params.css ){ - cy.style().applyBypass( this, params.style || params.css ); - } - - this.createEmitter(); - - if( restore === undefined || restore ){ - this.restore(); - } - -}; - -module.exports = Element; diff --git a/node_modules/cytoscape/src/collection/events.js b/node_modules/cytoscape/src/collection/events.js deleted file mode 100644 index 8c70f53b1..000000000 --- a/node_modules/cytoscape/src/collection/events.js +++ /dev/null @@ -1,142 +0,0 @@ -let Emitter = require('../emitter'); -let define = require('../define'); -let is = require('../is'); -let util = require('../util'); -let Selector = require('../selector'); - -let emitterOptions = { - qualifierCompare: function( selector1, selector2 ){ - if( selector1 == null || selector2 == null ){ - return selector1 == null && selector2 == null; - } else { - return selector1.sameText( selector2 ); - } - }, - eventMatches: function( ele, listener, eventObj ){ - let selector = listener.qualifier; - - if( selector != null ){ - return ele !== eventObj.target && is.element( eventObj.target ) && selector.matches( eventObj.target ); - } - - return true; - }, - eventFields: function( ele ){ - return { - cy: ele.cy(), - target: ele - }; - }, - callbackContext: function( ele, listener, eventObj ){ - return listener.qualifier != null ? eventObj.target : ele; - }, - beforeEmit: function( context, listener/*, eventObj*/ ){ - if( listener.conf && listener.conf.once ){ - listener.conf.onceCollection.removeListener( listener.event, listener.qualifier, listener.callback ); - } - }, - bubble: function(){ - return true; - }, - parent: function( ele ){ - return ele.isChild() ? ele.parent() : ele.cy(); - } -}; - -let argSelector = function( arg ){ - if( is.string(arg) ){ - return new Selector( arg ); - } else { - return arg; - } -}; - -let elesfn = ({ - createEmitter: function(){ - for( let i = 0; i < this.length; i++ ){ - let ele = this[i]; - let _p = ele._private; - - if( !_p.emitter ){ - _p.emitter = new Emitter( util.assign( { - context: ele - }, emitterOptions ) ); - } - } - - return this; - }, - - emitter: function(){ - return this._private.emitter; - }, - - on: function( events, selector, callback ){ - for( let i = 0; i < this.length; i++ ){ - let ele = this[i]; - - ele.emitter().on( events, argSelector(selector), callback ); - } - - return this; - }, - - removeListener: function( events, selector, callback ){ - for( let i = 0; i < this.length; i++ ){ - let ele = this[i]; - - ele.emitter().removeListener( events, argSelector(selector), callback ); - } - - return this; - }, - - one: function( events, selector, callback ){ - for( let i = 0; i < this.length; i++ ){ - let ele = this[i]; - - ele.emitter().one( events, argSelector(selector), callback ); - } - - return this; - }, - - once: function( events, selector, callback ){ - for( let i = 0; i < this.length; i++ ){ - let ele = this[i]; - - ele.emitter().on( events, argSelector(selector), callback, { - once: true, - onceCollection: this - } ); - } - }, - - emit: function( events, extraParams ){ - for( let i = 0; i < this.length; i++ ){ - let ele = this[i]; - - ele.emitter().emit( events, extraParams ); - } - - return this; - }, - - emitAndNotify: function( event, extraParams ){ // for internal use only - if( this.length === 0 ){ return; } // empty collections don't need to notify anything - - // notify renderer - this.cy().notify( { - type: event, - eles: this - } ); - - this.emit( event, extraParams ); - - return this; - } -}); - -define.eventAliasesOn( elesfn ); - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/filter.js b/node_modules/cytoscape/src/collection/filter.js deleted file mode 100644 index a9d00e012..000000000 --- a/node_modules/cytoscape/src/collection/filter.js +++ /dev/null @@ -1,368 +0,0 @@ -let is = require( '../is' ); -let Selector = require( '../selector' ); - -let elesfn = ({ - nodes: function( selector ){ - return this.filter( ele => ele.isNode() ).filter( selector ); - }, - - edges: function( selector ){ - return this.filter( ele => ele.isEdge() ).filter( selector ); - }, - - filter: function( filter, thisArg ){ - if( filter === undefined ){ // check this first b/c it's the most common/performant case - return this; - } else if( is.string( filter ) || is.elementOrCollection( filter ) ){ - return new Selector( filter ).filter( this ); - } else if( is.fn( filter ) ){ - let filterEles = this.spawn(); - let eles = this; - - for( let i = 0; i < eles.length; i++ ){ - let ele = eles[ i ]; - let include = thisArg ? filter.apply( thisArg, [ ele, i, eles ] ) : filter( ele, i, eles ); - - if( include ){ - filterEles.merge( ele ); - } - } - - return filterEles; - } - - return this.spawn(); // if not handled by above, give 'em an empty collection - }, - - not: function( toRemove ){ - if( !toRemove ){ - return this; - } else { - - if( is.string( toRemove ) ){ - toRemove = this.filter( toRemove ); - } - - let elements = []; - let rMap = toRemove._private.map; - - for( let i = 0; i < this.length; i++ ){ - let element = this[ i ]; - - let remove = rMap.has( element.id() ); - if( !remove ){ - elements.push( element ); - } - } - - return this.spawn( elements ); - } - - }, - - absoluteComplement: function(){ - let cy = this.cy(); - - return cy.mutableElements().not( this ); - }, - - intersect: function( other ){ - // if a selector is specified, then filter by it instead - if( is.string( other ) ){ - let selector = other; - return this.filter( selector ); - } - - let elements = []; - let col1 = this; - let col2 = other; - let col1Smaller = this.length < other.length; - let map2 = col1Smaller ? col2._private.map : col1._private.map; - let col = col1Smaller ? col1 : col2; - - for( let i = 0; i < col.length; i++ ){ - let id = col[ i ]._private.data.id; - let entry = map2.get( id ); - - if( entry ){ - elements.push( entry.ele ); - } - } - - return this.spawn( elements ); - }, - - xor: function( other ){ - let cy = this._private.cy; - - if( is.string( other ) ){ - other = cy.$( other ); - } - - let elements = []; - let col1 = this; - let col2 = other; - - let add = function( col, other ){ - for( let i = 0; i < col.length; i++ ){ - let ele = col[ i ]; - let id = ele._private.data.id; - let inOther = other.hasElementWithId( id ); - - if( !inOther ){ - elements.push( ele ); - } - } - - }; - - add( col1, col2 ); - add( col2, col1 ); - - return this.spawn( elements ); - }, - - diff: function( other ){ - let cy = this._private.cy; - - if( is.string( other ) ){ - other = cy.$( other ); - } - - let left = []; - let right = []; - let both = []; - let col1 = this; - let col2 = other; - - let add = function( col, other, retEles ){ - - for( let i = 0; i < col.length; i++ ){ - let ele = col[ i ]; - let id = ele._private.data.id; - let inOther = other.hasElementWithId( id ); - - if( inOther ){ - both.push( ele ); - } else { - retEles.push( ele ); - } - } - - }; - - add( col1, col2, left ); - add( col2, col1, right ); - - return { - left: this.spawn( left, { unique: true } ), - right: this.spawn( right, { unique: true } ), - both: this.spawn( both, { unique: true } ) - }; - }, - - add: function( toAdd ){ - let cy = this._private.cy; - - if( !toAdd ){ - return this; - } - - if( is.string( toAdd ) ){ - let selector = toAdd; - toAdd = cy.mutableElements().filter( selector ); - } - - let elements = []; - - for( let i = 0; i < this.length; i++ ){ - elements.push( this[ i ] ); - } - - let map = this._private.map; - - for( let i = 0; i < toAdd.length; i++ ){ - - let add = !map.has( toAdd[ i ].id() ); - if( add ){ - elements.push( toAdd[ i ] ); - } - } - - return this.spawn( elements ); - }, - - // in place merge on calling collection - merge: function( toAdd ){ - let _p = this._private; - let cy = _p.cy; - - if( !toAdd ){ - return this; - } - - if( toAdd && is.string( toAdd ) ){ - let selector = toAdd; - toAdd = cy.mutableElements().filter( selector ); - } - - let map = _p.map; - - for( let i = 0; i < toAdd.length; i++ ){ - let toAddEle = toAdd[ i ]; - let id = toAddEle._private.data.id; - let add = !map.has( id ); - - if( add ){ - let index = this.length++; - - this[ index ] = toAddEle; - - map.set( id, { ele: toAddEle, index: index } ); - } else { // replace - let index = map.get( id ).index; - - this[ index ] = toAddEle; - map.set( id, { ele: toAddEle, index: index } ); - } - } - - return this; // chaining - }, - - // remove single ele in place in calling collection - unmergeOne: function( ele ){ - ele = ele[0]; - - let _p = this._private; - let id = ele._private.data.id; - let map = _p.map; - let entry = map.get( id ); - - if( !entry ){ - return this; // no need to remove - } - - let i = entry.index; - - // remove ele - this[ i ] = undefined; - map.delete( id ); - - let unmergedLastEle = i === this.length - 1; - - // replace empty spot with last ele in collection - if( this.length > 1 && !unmergedLastEle ){ - let lastEleI = this.length - 1; - let lastEle = this[ lastEleI ]; - let lastEleId = lastEle._private.data.id; - - this[ lastEleI ] = undefined; - this[ i ] = lastEle; - map.set( lastEleId, { ele: lastEle, index: i } ); - } - - // the collection is now 1 ele smaller - this.length--; - - return this; - }, - - // remove eles in place on calling collection - unmerge: function( toRemove ){ - let cy = this._private.cy; - - if( !toRemove ){ - return this; - } - - if( toRemove && is.string( toRemove ) ){ - let selector = toRemove; - toRemove = cy.mutableElements().filter( selector ); - } - - for( let i = 0; i < toRemove.length; i++ ){ - this.unmergeOne( toRemove[ i ] ); - } - - return this; // chaining - }, - - map: function( mapFn, thisArg ){ - let arr = []; - let eles = this; - - for( let i = 0; i < eles.length; i++ ){ - let ele = eles[ i ]; - let ret = thisArg ? mapFn.apply( thisArg, [ ele, i, eles ] ) : mapFn( ele, i, eles ); - - arr.push( ret ); - } - - return arr; - }, - - reduce: function( fn, initialValue ){ - let val = initialValue; - let eles = this; - - for( let i = 0; i < eles.length; i++ ){ - val = fn( val, eles[i], i, eles ); - } - - return val; - }, - - max: function( valFn, thisArg ){ - let max = -Infinity; - let maxEle; - let eles = this; - - for( let i = 0; i < eles.length; i++ ){ - let ele = eles[ i ]; - let val = thisArg ? valFn.apply( thisArg, [ ele, i, eles ] ) : valFn( ele, i, eles ); - - if( val > max ){ - max = val; - maxEle = ele; - } - } - - return { - value: max, - ele: maxEle - }; - }, - - min: function( valFn, thisArg ){ - let min = Infinity; - let minEle; - let eles = this; - - for( let i = 0; i < eles.length; i++ ){ - let ele = eles[ i ]; - let val = thisArg ? valFn.apply( thisArg, [ ele, i, eles ] ) : valFn( ele, i, eles ); - - if( val < min ){ - min = val; - minEle = ele; - } - } - - return { - value: min, - ele: minEle - }; - } -}); - -// aliases -let fn = elesfn; -fn[ 'u' ] = fn[ '|' ] = fn[ '+' ] = fn.union = fn.or = fn.add; -fn[ '\\' ] = fn[ '!' ] = fn[ '-' ] = fn.difference = fn.relativeComplement = fn.subtract = fn.not; -fn[ 'n' ] = fn[ '&' ] = fn[ '.' ] = fn.and = fn.intersection = fn.intersect; -fn[ '^' ] = fn[ '(+)' ] = fn[ '(-)' ] = fn.symmetricDifference = fn.symdiff = fn.xor; -fn.fnFilter = fn.filterFn = fn.stdFilter = fn.filter; -fn.complement = fn.abscomp = fn.absoluteComplement; - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/group.js b/node_modules/cytoscape/src/collection/group.js deleted file mode 100644 index 5e6c87235..000000000 --- a/node_modules/cytoscape/src/collection/group.js +++ /dev/null @@ -1,28 +0,0 @@ -let elesfn = ({ - isNode: function(){ - return this.group() === 'nodes'; - }, - - isEdge: function(){ - return this.group() === 'edges'; - }, - - isLoop: function(){ - return this.isEdge() && this.source().id() === this.target().id(); - }, - - isSimple: function(){ - return this.isEdge() && this.source().id() !== this.target().id(); - }, - - group: function(){ - let ele = this[0]; - - if( ele ){ - return ele._private.group; - } - } -}); - - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/index.js b/node_modules/cytoscape/src/collection/index.js deleted file mode 100644 index 13bdc4f11..000000000 --- a/node_modules/cytoscape/src/collection/index.js +++ /dev/null @@ -1,731 +0,0 @@ -let util = require('../util'); -let is = require('../is'); -let Map = require('../map'); -let Set = require('../set'); - -let Element = require('./element'); - -// factory for generating edge ids when no id is specified for a new element -let idFactory = { - generate: function( cy, element, tryThisId ){ - let id = tryThisId != null ? tryThisId : util.uuid(); - - while( cy.hasElementWithId( id ) ){ - id = util.uuid(); - } - - return id; - } -}; - -// represents a set of nodes, edges, or both together -let Collection = function( cy, elements, options ){ - if( cy === undefined || !is.core( cy ) ){ - util.error( 'A collection must have a reference to the core' ); - return; - } - - let map = new Map(); - let createdElements = false; - - if( !elements ){ - elements = []; - } else if( elements.length > 0 && is.plainObject( elements[0] ) && !is.element( elements[0] ) ){ - createdElements = true; - - // make elements from json and restore all at once later - let eles = []; - let elesIds = new Set(); - - for( let i = 0, l = elements.length; i < l; i++ ){ - let json = elements[ i ]; - - if( json.data == null ){ - json.data = {}; - } - - let data = json.data; - - // make sure newly created elements have valid ids - if( data.id == null ){ - data.id = idFactory.generate( cy, json ); - } else if( cy.hasElementWithId( data.id ) || elesIds.has( data.id ) ){ - continue; // can't create element if prior id already exists - } - - let ele = new Element( cy, json, false ); - eles.push( ele ); - elesIds.add( data.id ); - } - - elements = eles; - } - - this.length = 0; - - for( let i = 0, l = elements.length; i < l; i++ ){ - let element = elements[ i ]; - if( element == null ){ continue; } - - let id = element._private.data.id; - - if( options == null || ( options.unique && !map.has(id) ) ){ - map.set( id, { - index: this.length, - ele: element - } ); - - this[ this.length ] = element; - this.length++; - } - } - - this._private = { - cy: cy, - map: map - }; - - // restore the elements if we created them from json - if( createdElements ){ - this.restore(); - } -}; - -// Functions -//////////////////////////////////////////////////////////////////////////////////////////////////// - -// keep the prototypes in sync (an element has the same functions as a collection) -// and use elefn and elesfn as shorthands to the prototypes -let elesfn = Element.prototype = Collection.prototype; - -elesfn.instanceString = function(){ - return 'collection'; -}; - -elesfn.spawn = function( cy, eles, opts ){ - if( !is.core( cy ) ){ // cy is optional - opts = eles; - eles = cy; - cy = this.cy(); - } - - return new Collection( cy, eles, opts ); -}; - -elesfn.spawnSelf = function(){ - return this.spawn( this ); -}; - -elesfn.cy = function(){ - return this._private.cy; -}; - -elesfn.renderer = function(){ - return this._private.cy.renderer(); -}; - -elesfn.element = function(){ - return this[0]; -}; - -elesfn.collection = function(){ - if( is.collection( this ) ){ - return this; - } else { // an element - return new Collection( this._private.cy, [ this ] ); - } -}; - -elesfn.unique = function(){ - return new Collection( this._private.cy, this, { unique: true } ); -}; - -elesfn.hasElementWithId = function( id ){ - return this._private.map.has( id ); -}; - -elesfn.getElementById = function( id ){ - let cy = this._private.cy; - let entry = this._private.map.get( id ); - - return entry ? entry.ele : new Collection( cy ); // get ele or empty collection -}; - -elesfn.$id = elesfn.getElementById; - -elesfn.poolIndex = function(){ - let cy = this._private.cy; - let eles = cy._private.elements; - let id = this._private.data.id; - - return eles._private.map.get( id ).index; -}; - -elesfn.json = function( obj ){ - let ele = this.element(); - let cy = this.cy(); - - if( ele == null && obj ){ return this; } // can't set to no eles - - if( ele == null ){ return undefined; } // can't get from no eles - - let p = ele._private; - - if( is.plainObject( obj ) ){ // set - - cy.startBatch(); - - if( obj.data ){ - ele.data( obj.data ); - } - - if( obj.position ){ - ele.position( obj.position ); - } - - // ignore group -- immutable - - let checkSwitch = function( k, trueFnName, falseFnName ){ - let obj_k = obj[ k ]; - - if( obj_k != null && obj_k !== p[ k ] ){ - if( obj_k ){ - ele[ trueFnName ](); - } else { - ele[ falseFnName ](); - } - } - }; - - checkSwitch( 'removed', 'remove', 'restore' ); - - checkSwitch( 'selected', 'select', 'unselect' ); - - checkSwitch( 'selectable', 'selectify', 'unselectify' ); - - checkSwitch( 'locked', 'lock', 'unlock' ); - - checkSwitch( 'grabbable', 'grabify', 'ungrabify' ); - - if( obj.classes != null ){ - ele.classes( obj.classes ); - } - - cy.endBatch(); - - return this; - - } else if( obj === undefined ){ // get - - let json = { - data: util.copy( p.data ), - position: util.copy( p.position ), - group: p.group, - removed: p.removed, - selected: p.selected, - selectable: p.selectable, - locked: p.locked, - grabbable: p.grabbable, - classes: null - }; - - json.classes = ''; - - let i = 0; - p.classes.forEach( cls => json.classes += ( i++ === 0 ? cls : ' ' + cls ) ); - - return json; - } -}; - -elesfn.jsons = function(){ - let jsons = []; - - for( let i = 0; i < this.length; i++ ){ - let ele = this[ i ]; - let json = ele.json(); - - jsons.push( json ); - } - - return jsons; -}; - -elesfn.clone = function(){ - let cy = this.cy(); - let elesArr = []; - - for( let i = 0; i < this.length; i++ ){ - let ele = this[ i ]; - let json = ele.json(); - let clone = new Element( cy, json, false ); // NB no restore - - elesArr.push( clone ); - } - - return new Collection( cy, elesArr ); -}; -elesfn.copy = elesfn.clone; - -elesfn.restore = function( notifyRenderer ){ - let self = this; - let cy = self.cy(); - let cy_p = cy._private; - - if( notifyRenderer === undefined ){ - notifyRenderer = true; - } - - // create arrays of nodes and edges, since we need to - // restore the nodes first - let nodes = []; - let edges = []; - let elements; - for( let i = 0, l = self.length; i < l; i++ ){ - let ele = self[ i ]; - - if( !ele.removed() ){ - // don't need to handle this ele - continue; - } - - // keep nodes first in the array and edges after - if( ele.isNode() ){ // put to front of array if node - nodes.push( ele ); - } else { // put to end of array if edge - edges.push( ele ); - } - } - - elements = nodes.concat( edges ); - - let i; - let removeFromElements = function(){ - elements.splice( i, 1 ); - i--; - }; - - // now, restore each element - for( i = 0; i < elements.length; i++ ){ - let ele = elements[ i ]; - - let _private = ele._private; - let data = _private.data; - - // the traversal cache should start fresh when ele is added - ele.clearTraversalCache(); - - // set id and validate - if( data.id === undefined ){ - data.id = idFactory.generate( cy, ele ); - - } else if( is.number( data.id ) ){ - data.id = '' + data.id; // now it's a string - - } else if( is.emptyString( data.id ) || !is.string( data.id ) ){ - util.error( 'Can not create element with invalid string ID `' + data.id + '`' ); - - // can't create element if it has empty string as id or non-string id - removeFromElements(); - continue; - } else if( cy.hasElementWithId( data.id ) ){ - util.error( 'Can not create second element with ID `' + data.id + '`' ); - - // can't create element if one already has that id - removeFromElements(); - continue; - } - - let id = data.id; // id is finalised, now let's keep a ref - - if( ele.isNode() ){ // extra checks for nodes - let pos = _private.position; - - // make sure the nodes have a defined position - - if( pos.x == null ){ - pos.x = 0; - } - - if( pos.y == null ){ - pos.y = 0; - } - } - - if( ele.isEdge() ){ // extra checks for edges - - let edge = ele; - let fields = [ 'source', 'target' ]; - let fieldsLength = fields.length; - let badSourceOrTarget = false; - for( let j = 0; j < fieldsLength; j++ ){ - - let field = fields[ j ]; - let val = data[ field ]; - - if( is.number( val ) ){ - val = data[ field ] = '' + data[ field ]; // now string - } - - if( val == null || val === '' ){ - // can't create if source or target is not defined properly - util.error( 'Can not create edge `' + id + '` with unspecified ' + field ); - badSourceOrTarget = true; - } else if( !cy.hasElementWithId( val ) ){ - // can't create edge if one of its nodes doesn't exist - util.error( 'Can not create edge `' + id + '` with nonexistant ' + field + ' `' + val + '`' ); - badSourceOrTarget = true; - } - } - - if( badSourceOrTarget ){ removeFromElements(); continue; } // can't create this - - let src = cy.getElementById( data.source ); - let tgt = cy.getElementById( data.target ); - - src._private.edges.push( edge ); - tgt._private.edges.push( edge ); - - edge._private.source = src; - edge._private.target = tgt; - } // if is edge - - // create mock ids / indexes maps for element so it can be used like collections - _private.map = new Map(); - _private.map.set( id, { ele: ele, index: 0 } ); - - _private.removed = false; - cy.addToPool( ele ); - } // for each element - - // do compound node sanity checks - for( let i = 0; i < nodes.length; i++ ){ // each node - let node = nodes[ i ]; - let data = node._private.data; - - if( is.number( data.parent ) ){ // then automake string - data.parent = '' + data.parent; - } - - let parentId = data.parent; - - let specifiedParent = parentId != null; - - if( specifiedParent ){ - let parent = cy.getElementById( parentId ); - - if( parent.empty() ){ - // non-existant parent; just remove it - data.parent = undefined; - } else { - let selfAsParent = false; - let ancestor = parent; - while( !ancestor.empty() ){ - if( node.same( ancestor ) ){ - // mark self as parent and remove from data - selfAsParent = true; - data.parent = undefined; // remove parent reference - - // exit or we loop forever - break; - } - - ancestor = ancestor.parent(); - } - - if( !selfAsParent ){ - // connect with children - parent[0]._private.children.push( node ); - node._private.parent = parent[0]; - - // let the core know we have a compound graph - cy_p.hasCompoundNodes = true; - } - } // else - } // if specified parent - } // for each node - - if( elements.length > 0 ){ - let restored = new Collection( cy, elements ); - - for( let i = 0; i < restored.length; i++ ){ - let ele = restored[i]; - - if( ele.isNode() ){ continue; } - - // adding an edge invalidates the traversal caches for the parallel edges - ele.parallelEdges().clearTraversalCache(); - - // adding an edge invalidates the traversal cache for the connected nodes - ele.source().clearTraversalCache(); - ele.target().clearTraversalCache(); - } - - let toUpdateStyle; - - if( cy_p.hasCompoundNodes ){ - toUpdateStyle = cy.collection().merge( restored ).merge( restored.connectedNodes() ).merge( restored.parent() ); - } else { - toUpdateStyle = restored; - } - - toUpdateStyle.dirtyCompoundBoundsCache().updateStyle( notifyRenderer ); - - if( notifyRenderer ){ - restored.emitAndNotify( 'add' ); - } else { - restored.emit( 'add' ); - } - } - - return self; // chainability -}; - -elesfn.removed = function(){ - let ele = this[0]; - return ele && ele._private.removed; -}; - -elesfn.inside = function(){ - let ele = this[0]; - return ele && !ele._private.removed; -}; - -elesfn.remove = function( notifyRenderer ){ - let self = this; - let removed = []; - let elesToRemove = []; - let elesToRemoveIds = {}; - let cy = self._private.cy; - - if( notifyRenderer === undefined ){ - notifyRenderer = true; - } - - // add connected edges - function addConnectedEdges( node ){ - let edges = node._private.edges; - for( let i = 0; i < edges.length; i++ ){ - add( edges[ i ] ); - } - } - - - // add descendant nodes - function addChildren( node ){ - let children = node._private.children; - - for( let i = 0; i < children.length; i++ ){ - add( children[ i ] ); - } - } - - function add( ele ){ - let alreadyAdded = elesToRemoveIds[ ele.id() ]; - if( ele.removed() || alreadyAdded ){ - return; - } else { - elesToRemoveIds[ ele.id() ] = true; - } - - if( ele.isNode() ){ - elesToRemove.push( ele ); // nodes are removed last - - addConnectedEdges( ele ); - addChildren( ele ); - } else { - elesToRemove.unshift( ele ); // edges are removed first - } - } - - // make the list of elements to remove - // (may be removing more than specified due to connected edges etc) - - for( let i = 0, l = self.length; i < l; i++ ){ - let ele = self[ i ]; - - add( ele ); - } - - function removeEdgeRef( node, edge ){ - let connectedEdges = node._private.edges; - - util.removeFromArray( connectedEdges, edge ); - - // removing an edges invalidates the traversal cache for its nodes - node.clearTraversalCache(); - } - - function removeParallelRefs( edge ){ - // removing an edge invalidates the traversal caches for the parallel edges - edge.parallelEdges().clearTraversalCache(); - } - - let alteredParents = []; - alteredParents.ids = {}; - - function removeChildRef( parent, ele ){ - ele = ele[0]; - parent = parent[0]; - - let children = parent._private.children; - let pid = parent.id(); - - util.removeFromArray( children, ele ); - - if( !alteredParents.ids[ pid ] ){ - alteredParents.ids[ pid ] = true; - alteredParents.push( parent ); - } - } - - self.dirtyCompoundBoundsCache(); - - cy.removeFromPool( elesToRemove ); // remove from core pool - - for( let i = 0; i < elesToRemove.length; i++ ){ - let ele = elesToRemove[ i ]; - - // mark as removed - ele._private.removed = true; - - // add to list of removed elements - removed.push( ele ); - - if( ele.isEdge() ){ // remove references to this edge in its connected nodes - let src = ele.source()[0]; - let tgt = ele.target()[0]; - - removeEdgeRef( src, ele ); - removeEdgeRef( tgt, ele ); - removeParallelRefs( ele ); - - } else { // remove reference to parent - let parent = ele.parent(); - - if( parent.length !== 0 ){ - removeChildRef( parent, ele ); - } - } - } - - // check to see if we have a compound graph or not - let elesStillInside = cy._private.elements; - cy._private.hasCompoundNodes = false; - for( let i = 0; i < elesStillInside.length; i++ ){ - let ele = elesStillInside[ i ]; - - if( ele.isParent() ){ - cy._private.hasCompoundNodes = true; - break; - } - } - - let removedElements = new Collection( this.cy(), removed ); - if( removedElements.size() > 0 ){ - // must manually notify since trigger won't do this automatically once removed - - if( notifyRenderer ){ - this.cy().notify( { - type: 'remove', - eles: removedElements - } ); - } - - removedElements.emit( 'remove' ); - } - - // the parents who were modified by the removal need their style updated - for( let i = 0; i < alteredParents.length; i++ ){ - let ele = alteredParents[ i ]; - - if( !ele.removed() ){ - ele.updateStyle(); - } - } - - return new Collection( cy, removed ); -}; - -elesfn.move = function( struct ){ - let cy = this._private.cy; - - if( struct.source !== undefined || struct.target !== undefined ){ - let srcId = struct.source; - let tgtId = struct.target; - let srcExists = cy.hasElementWithId( srcId ); - let tgtExists = cy.hasElementWithId( tgtId ); - - if( srcExists || tgtExists ){ - let jsons = this.jsons(); - - this.remove(); - - for( let i = 0; i < jsons.length; i++ ){ - let json = jsons[i]; - let ele = this[i]; - - if( json.group === 'edges' ){ - if( srcExists ){ json.data.source = srcId; } - - if( tgtExists ){ json.data.target = tgtId; } - - json.scratch = ele._private.scratch; - } - } - - return cy.add( jsons ); - } - - } else if( struct.parent !== undefined ){ // move node to new parent - let parentId = struct.parent; - let parentExists = parentId === null || cy.hasElementWithId( parentId ); - - if( parentExists ){ - let jsons = this.jsons(); - let descs = this.descendants(); - let descsEtcJsons = descs.union( descs.union( this ).connectedEdges() ).jsons(); - - this.remove(); // NB: also removes descendants and their connected edges - - for( let i = 0; i < jsons.length; i++ ){ - let json = jsons[i]; - let ele = this[i]; - - if( json.group === 'nodes' ){ - json.data.parent = parentId === null ? undefined : parentId; - - json.scratch = ele._private.scratch; - } - } - - return cy.add( jsons.concat( descsEtcJsons ) ); - } - } - - return this; // if nothing done -}; - -[ - require( './algorithms' ), - require( './animation' ), - require( './class' ), - require( './comparators' ), - require( './compounds' ), - require( './data' ), - require( './degree' ), - require( './dimensions' ), - require( './events' ), - require( './filter' ), - require( './group' ), - require( './index' ), - require( './iteration' ), - require( './layout' ), - require( './style' ), - require( './switch-functions' ), - require( './traversing' ) -].forEach( function( props ){ - util.extend( elesfn, props ); -} ); - -module.exports = Collection; diff --git a/node_modules/cytoscape/src/collection/iteration.js b/node_modules/cytoscape/src/collection/iteration.js deleted file mode 100644 index a240f0d1d..000000000 --- a/node_modules/cytoscape/src/collection/iteration.js +++ /dev/null @@ -1,124 +0,0 @@ -let is = require( '../is' ); -let zIndexSort = require( './zsort' ); -let util = require('../util'); - -let elesfn = ({ - forEach: function( fn, thisArg ){ - if( is.fn( fn ) ){ - - for( let i = 0; i < this.length; i++ ){ - let ele = this[ i ]; - let ret = thisArg ? fn.apply( thisArg, [ ele, i, this ] ) : fn( ele, i, this ); - - if( ret === false ){ break; } // exit each early on return false - } - } - - return this; - }, - - toArray: function(){ - let array = []; - - for( let i = 0; i < this.length; i++ ){ - array.push( this[ i ] ); - } - - return array; - }, - - slice: function( start, end ){ - let array = []; - let thisSize = this.length; - - if( end == null ){ - end = thisSize; - } - - if( start == null ){ - start = 0; - } - - if( start < 0 ){ - start = thisSize + start; - } - - if( end < 0 ){ - end = thisSize + end; - } - - for( let i = start; i >= 0 && i < end && i < thisSize; i++ ){ - array.push( this[ i ] ); - } - - return this.spawn( array ); - }, - - size: function(){ - return this.length; - }, - - eq: function( i ){ - return this[ i ] || this.spawn(); - }, - - first: function(){ - return this[0] || this.spawn(); - }, - - last: function(){ - return this[ this.length - 1 ] || this.spawn(); - }, - - empty: function(){ - return this.length === 0; - }, - - nonempty: function(){ - return !this.empty(); - }, - - sort: function( sortFn ){ - if( !is.fn( sortFn ) ){ - return this; - } - - let sorted = this.toArray().sort( sortFn ); - - return this.spawn( sorted ); - }, - - sortByZIndex: function(){ - return this.sort( zIndexSort ); - }, - - zDepth: function(){ - let ele = this[0]; - if( !ele ){ return undefined; } - - // let cy = ele.cy(); - let _p = ele._private; - let group = _p.group; - - if( group === 'nodes' ){ - let depth = _p.data.parent ? ele.parents().size() : 0; - - if( !ele.isParent() ){ - return util.MAX_INT - 1; // childless nodes always on top - } - - return depth; - } else { - let src = _p.source; - let tgt = _p.target; - let srcDepth = src.zDepth(); - let tgtDepth = tgt.zDepth(); - - return Math.max( srcDepth, tgtDepth, 0 ); // depth of deepest parent - } - } -}); - -elesfn.each = elesfn.forEach; - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/layout.js b/node_modules/cytoscape/src/collection/layout.js deleted file mode 100644 index 95d1b8e43..000000000 --- a/node_modules/cytoscape/src/collection/layout.js +++ /dev/null @@ -1,193 +0,0 @@ -let is = require( '../is' ); -let util = require( '../util' ); -let Promise = require('../promise'); -let math = require('../math'); - -let elesfn = ({ - // Calculates and returns node dimensions { x, y } based on options given - layoutDimensions: function( options ){ - options = util.assign( { - nodeDimensionsIncludeLabels: true - }, options ); - - if( options.nodeDimensionsIncludeLabels ){ - let bbDim = this.boundingBox(); - return { - w: bbDim.w, - h: bbDim.h - }; - } - else { - return { - w: this.outerWidth(), - h: this.outerHeight() - }; - } - }, - - // using standard layout options, apply position function (w/ or w/o animation) - layoutPositions: function( layout, options, fn ){ - let nodes = this.nodes(); - let cy = this.cy(); - let layoutEles = options.eles; // nodes & edges - let getMemoizeKey = ( node, i ) => node.id() + '$' + i; - let fnMem = util.memoize( fn, getMemoizeKey ); // memoized version of position function - - layout.emit( { type: 'layoutstart', layout: layout } ); - - layout.animations = []; - - let calculateSpacing = function( spacing, nodesBb, pos ){ - let center = { - x: nodesBb.x1 + nodesBb.w / 2, - y: nodesBb.y1 + nodesBb.h / 2 - }; - - let spacingVector = { // scale from center of bounding box (not necessarily 0,0) - x: (pos.x - center.x) * spacing, - y: (pos.y - center.y) * spacing - }; - - return { - x: center.x + spacingVector.x, - y: center.y + spacingVector.y - }; - }; - - let useSpacingFactor = options.spacingFactor && options.spacingFactor !== 1; - - let spacingBb = function(){ - if( !useSpacingFactor ){ return null; } - - let bb = math.makeBoundingBox(); - - for( let i = 0; i < nodes.length; i++ ){ - let node = nodes[i]; - let pos = fnMem( node, i ); - - math.expandBoundingBoxByPoint( bb, pos.x, pos.y ); - } - - return bb; - }; - - let bb = spacingBb(); - - let getFinalPos = util.memoize( function( node, i ){ - let newPos = fnMem( node, i ); - let pos = node.position(); - - if( !is.number( pos.x ) || !is.number( pos.y ) ){ - node.silentPosition( { x: 0, y: 0 } ); - } - - if( useSpacingFactor ){ - let spacing = Math.abs( options.spacingFactor ); - - newPos = calculateSpacing( spacing, bb, newPos ); - } - - if( options.transform != null ){ - newPos = options.transform( node, newPos ); - } - - return newPos; - }, getMemoizeKey ); - - if( options.animate ){ - for( let i = 0; i < nodes.length; i++ ){ - let node = nodes[ i ]; - let newPos = getFinalPos( node, i ); - let animateNode = options.animateFilter == null || options.animateFilter( node, i ); - - if( animateNode ){ - let ani = node.animation( { - position: newPos, - duration: options.animationDuration, - easing: options.animationEasing - } ); - - layout.animations.push( ani ); - - ani.play(); - } else { - node.position( newPos ); - } - - } - - if( options.fit ){ - let fitAni = cy.animation({ - fit: { - boundingBox: layoutEles.boundingBoxAt( getFinalPos ), - padding: options.padding - }, - duration: options.animationDuration, - easing: options.animationEasing - }); - - layout.animations.push( fitAni ); - - fitAni.play(); - } else if( options.zoom !== undefined && options.pan !== undefined ){ - let zoomPanAni = cy.animation({ - zoom: options.zoom, - pan: options.pan, - duration: options.animationDuration, - easing: options.animationEasing - }); - - layout.animations.push( zoomPanAni ); - - zoomPanAni.play(); - } - - layout.one( 'layoutready', options.ready ); - layout.emit( { type: 'layoutready', layout: layout } ); - - Promise.all( layout.animations.map(function( ani ){ - return ani.promise(); - }) ).then(function(){ - layout.one( 'layoutstop', options.stop ); - layout.emit( { type: 'layoutstop', layout: layout } ); - }); - } else { - - nodes.positions( getFinalPos ); - - if( options.fit ){ - cy.fit( options.eles, options.padding ); - } - - if( options.zoom != null ){ - cy.zoom( options.zoom ); - } - - if( options.pan ){ - cy.pan( options.pan ); - } - - layout.one( 'layoutready', options.ready ); - layout.emit( { type: 'layoutready', layout: layout } ); - - layout.one( 'layoutstop', options.stop ); - layout.emit( { type: 'layoutstop', layout: layout } ); - } - - return this; // chaining - }, - - layout: function( options ){ - let cy = this.cy(); - - return cy.makeLayout( util.extend( {}, options, { - eles: this - } ) ); - } - -}); - -// aliases: -elesfn.createLayout = elesfn.makeLayout = elesfn.layout; - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/style.js b/node_modules/cytoscape/src/collection/style.js deleted file mode 100644 index e5a811f9d..000000000 --- a/node_modules/cytoscape/src/collection/style.js +++ /dev/null @@ -1,443 +0,0 @@ -let is = require( '../is' ); - -function styleCache( key, fn, ele ){ - var _p = ele._private; - var cache = _p.styleCache = _p.styleCache || {}; - var val; - - if( (val = cache[key]) != null ){ - return val; - } else { - val = cache[key] = fn( ele ); - - return val; - } -} - -function cacheStyleFunction( key, fn ){ - return function cachedStyleFunction( ele ){ - return styleCache( key, fn, ele ); - }; -} - -function cachePrototypeStyleFunction( key, fn ){ - let selfFn = ele => fn.call( ele ); - - return function cachedPrototypeStyleFunction(){ - var ele = this[0]; - - if( ele ){ - return styleCache( key, selfFn, ele ); - } - }; -} - -let elesfn = ({ - - recalculateRenderedStyle: function( useCache ){ - let cy = this.cy(); - let renderer = cy.renderer(); - let styleEnabled = cy.styleEnabled(); - - if( renderer && styleEnabled ){ - renderer.recalculateRenderedStyle( this, useCache ); - } - - return this; - }, - - dirtyStyleCache: function(){ - let cy = this.cy(); - let dirty = ele => ele._private.styleCache = {}; - - if( cy.hasCompoundNodes() ){ - let eles; - - eles = this.spawnSelf() - .merge( this.descendants() ) - .merge( this.parents() ) - ; - - eles.merge( eles.connectedEdges() ); - - eles.forEach( dirty ); - } else { - this.forEach( ele => { - dirty( ele ); - - ele.connectedEdges().forEach( dirty ); - } ); - } - - return this; - }, - - // fully updates (recalculates) the style for the elements - updateStyle: function( notifyRenderer ){ - let cy = this._private.cy; - - if( !cy.styleEnabled() ){ return this; } - - if( cy._private.batchingStyle ){ - let bEles = cy._private.batchStyleEles; - - bEles.merge( this ); - - return this; // chaining and exit early when batching - } - - let hasCompounds = cy.hasCompoundNodes(); - let style = cy.style(); - let updatedEles = this; - - notifyRenderer = notifyRenderer || notifyRenderer === undefined ? true : false; - - if( hasCompounds ){ // then add everything up and down for compound selector checks - updatedEles = this.spawnSelf().merge( this.descendants() ).merge( this.parents() ); - } - - let changedEles = style.apply( updatedEles ); - - changedEles.dirtyStyleCache(); - changedEles.dirtyCompoundBoundsCache(); - - if( notifyRenderer ){ - changedEles.emitAndNotify( 'style' ); // let renderer know we changed style - } else { - changedEles.emit( 'style' ); // just fire the event - } - - return this; // chaining - }, - - // just update the mappers in the elements' styles; cheaper than eles.updateStyle() - updateMappers: function( notifyRenderer ){ - let cy = this._private.cy; - let style = cy.style(); - notifyRenderer = notifyRenderer || notifyRenderer === undefined ? true : false; - - if( !cy.styleEnabled() ){ return this; } - - let changedEles = style.updateMappers( this ); - - changedEles.dirtyStyleCache(); - changedEles.dirtyCompoundBoundsCache(); - - if( notifyRenderer ){ - changedEles.emitAndNotify( 'style' ); // let renderer know we changed style - } else { - changedEles.emit( 'style' ); // just fire the event - } - return this; // chaining - }, - - // get the internal parsed style object for the specified property - parsedStyle: function( property ){ - let ele = this[0]; - let cy = ele.cy(); - - if( !cy.styleEnabled() ){ return; } - - if( ele ){ - return ele._private.style[ property ] || cy.style().getDefaultProperty( property ); - } - }, - - numericStyle: function( property ){ - let ele = this[0]; - - if( !ele.cy().styleEnabled() ){ return; } - - if( ele ){ - let pstyle = ele.pstyle( property ); - - return pstyle.pfValue !== undefined ? pstyle.pfValue : pstyle.value; - } - }, - - numericStyleUnits: function( property ){ - let ele = this[0]; - - if( !ele.cy().styleEnabled() ){ return; } - - if( ele ){ - return ele.pstyle( property ).units; - } - }, - - // get the specified css property as a rendered value (i.e. on-screen value) - // or get the whole rendered style if no property specified (NB doesn't allow setting) - renderedStyle: function( property ){ - let cy = this.cy(); - if( !cy.styleEnabled() ){ return this; } - - let ele = this[0]; - - if( ele ){ - return cy.style().getRenderedStyle( ele, property ); - } - }, - - // read the calculated css style of the element or override the style (via a bypass) - style: function( name, value ){ - let cy = this.cy(); - - if( !cy.styleEnabled() ){ return this; } - - let updateTransitions = false; - let style = cy.style(); - - if( is.plainObject( name ) ){ // then extend the bypass - let props = name; - style.applyBypass( this, props, updateTransitions ); - - this.dirtyStyleCache(); - this.dirtyCompoundBoundsCache(); - - this.emitAndNotify( 'style' ); // let the renderer know we've updated style - - } else if( is.string( name ) ){ - - if( value === undefined ){ // then get the property from the style - let ele = this[0]; - - if( ele ){ - return style.getStylePropertyValue( ele, name ); - } else { // empty collection => can't get any value - return; - } - - } else { // then set the bypass with the property value - style.applyBypass( this, name, value, updateTransitions ); - - this.dirtyStyleCache(); - this.dirtyCompoundBoundsCache(); - - this.emitAndNotify( 'style' ); // let the renderer know we've updated style - } - - } else if( name === undefined ){ - let ele = this[0]; - - if( ele ){ - return style.getRawStyle( ele ); - } else { // empty collection => can't get any value - return; - } - } - - return this; // chaining - }, - - removeStyle: function( names ){ - let cy = this.cy(); - - if( !cy.styleEnabled() ){ return this; } - - let updateTransitions = false; - let style = cy.style(); - let eles = this; - - if( names === undefined ){ - for( let i = 0; i < eles.length; i++ ){ - let ele = eles[ i ]; - - style.removeAllBypasses( ele, updateTransitions ); - } - } else { - names = names.split( /\s+/ ); - - for( let i = 0; i < eles.length; i++ ){ - let ele = eles[ i ]; - - style.removeBypasses( ele, names, updateTransitions ); - } - } - - this.dirtyStyleCache(); - this.dirtyCompoundBoundsCache(); - - this.emitAndNotify( 'style' ); // let the renderer know we've updated style - - return this; // chaining - }, - - show: function(){ - this.css( 'display', 'element' ); - return this; // chaining - }, - - hide: function(){ - this.css( 'display', 'none' ); - return this; // chaining - }, - - effectiveOpacity: function(){ - let cy = this.cy(); - if( !cy.styleEnabled() ){ return 1; } - - let hasCompoundNodes = cy.hasCompoundNodes(); - let ele = this[0]; - - if( ele ){ - let _p = ele._private; - let parentOpacity = ele.pstyle( 'opacity' ).value; - - if( !hasCompoundNodes ){ return parentOpacity; } - - let parents = !_p.data.parent ? null : ele.parents(); - - if( parents ){ - for( let i = 0; i < parents.length; i++ ){ - let parent = parents[ i ]; - let opacity = parent.pstyle( 'opacity' ).value; - - parentOpacity = opacity * parentOpacity; - } - } - - return parentOpacity; - } - }, - - transparent: function(){ - let cy = this.cy(); - if( !cy.styleEnabled() ){ return false; } - - let ele = this[0]; - let hasCompoundNodes = ele.cy().hasCompoundNodes(); - - if( ele ){ - if( !hasCompoundNodes ){ - return ele.pstyle( 'opacity' ).value === 0; - } else { - return ele.effectiveOpacity() === 0; - } - } - }, - - backgrounding: function(){ - let cy = this.cy(); - if( !cy.styleEnabled() ){ return false; } - - let ele = this[0]; - - return ele._private.backgrounding ? true : false; - } - -}); - -function checkCompound( ele, parentOk ){ - let _p = ele._private; - let parents = _p.data.parent ? ele.parents() : null; - - if( parents ){ for( let i = 0; i < parents.length; i++ ){ - let parent = parents[ i ]; - - if( !parentOk( parent ) ){ return false; } - } } - - return true; -} - -function defineDerivedStateFunction( specs ){ - let ok = specs.ok; - let edgeOkViaNode = specs.edgeOkViaNode || specs.ok; - let parentOk = specs.parentOk || specs.ok; - - return function(){ - let cy = this.cy(); - if( !cy.styleEnabled() ){ return true; } - - let ele = this[0]; - let hasCompoundNodes = cy.hasCompoundNodes(); - - if( ele ){ - let _p = ele._private; - - if( !ok( ele ) ){ return false; } - - if( ele.isNode() ){ - return !hasCompoundNodes || checkCompound( ele, parentOk ); - } else { - let src = _p.source; - let tgt = _p.target; - - return ( edgeOkViaNode(src) && (!hasCompoundNodes || checkCompound(src, edgeOkViaNode)) ) && - ( src === tgt || ( edgeOkViaNode(tgt) && (!hasCompoundNodes || checkCompound(tgt, edgeOkViaNode)) ) ); - } - } - }; -} - -let eleTakesUpSpace = cacheStyleFunction( 'eleTakesUpSpace', function( ele ){ - return ( - ele.pstyle( 'display' ).value === 'element' - && ele.width() !== 0 - && ( ele.isNode() ? ele.height() !== 0 : true ) - ); -} ); - -elesfn.takesUpSpace = cachePrototypeStyleFunction( 'takesUpSpace', defineDerivedStateFunction({ - ok: eleTakesUpSpace -}) ); - -let eleInteractive = cacheStyleFunction( 'eleInteractive', function( ele ){ - return ( - ele.pstyle('events').value === 'yes' - && ele.pstyle('visibility').value === 'visible' - && eleTakesUpSpace( ele ) - ); -} ); - -let parentInteractive = cacheStyleFunction( 'parentInteractive', function( parent ){ - return ( - parent.pstyle('visibility').value === 'visible' - && eleTakesUpSpace( parent ) - ); -} ); - -elesfn.interactive = cachePrototypeStyleFunction( 'interactive', defineDerivedStateFunction({ - ok: eleInteractive, - parentOk: parentInteractive, - edgeOkViaNode: eleTakesUpSpace -}) ); - -elesfn.noninteractive = function(){ - let ele = this[0]; - - if( ele ){ - return !ele.interactive(); - } -}; - -let eleVisible = cacheStyleFunction( 'eleVisible', function( ele ){ - return ( - ele.pstyle( 'visibility' ).value === 'visible' - && ele.pstyle( 'opacity' ).pfValue !== 0 - && eleTakesUpSpace( ele ) - ); -} ); - -let edgeVisibleViaNode = eleTakesUpSpace; - -elesfn.visible = cachePrototypeStyleFunction( 'visible', defineDerivedStateFunction({ - ok: eleVisible, - edgeOkViaNode: edgeVisibleViaNode -}) ); - -elesfn.hidden = function(){ - let ele = this[0]; - - if( ele ){ - return !ele.visible(); - } -}; - - -elesfn.bypass = elesfn.css = elesfn.style; -elesfn.renderedCss = elesfn.renderedStyle; -elesfn.removeBypass = elesfn.removeCss = elesfn.removeStyle; -elesfn.pstyle = elesfn.parsedStyle; - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/switch-functions.js b/node_modules/cytoscape/src/collection/switch-functions.js deleted file mode 100644 index e48e23249..000000000 --- a/node_modules/cytoscape/src/collection/switch-functions.js +++ /dev/null @@ -1,149 +0,0 @@ -let elesfn = {}; - -function defineSwitchFunction( params ){ - return function(){ - let args = arguments; - let changedEles = []; - - // e.g. cy.nodes().select( data, handler ) - if( args.length === 2 ){ - let data = args[0]; - let handler = args[1]; - this.on( params.event, data, handler ); - } - - // e.g. cy.nodes().select( handler ) - else if( args.length === 1 ){ - let handler = args[0]; - this.on( params.event, handler ); - } - - // e.g. cy.nodes().select() - else if( args.length === 0 ){ - for( let i = 0; i < this.length; i++ ){ - let ele = this[ i ]; - let able = !params.ableField || ele._private[ params.ableField ]; - let changed = ele._private[ params.field ] != params.value; - - if( params.overrideAble ){ - let overrideAble = params.overrideAble( ele ); - - if( overrideAble !== undefined ){ - able = overrideAble; - - if( !overrideAble ){ return this; } // to save cycles assume not able for all on override - } - } - - if( able ){ - ele._private[ params.field ] = params.value; - - if( changed ){ - changedEles.push( ele ); - } - } - } - - let changedColl = this.spawn( changedEles ); - changedColl.updateStyle(); // change of state => possible change of style - changedColl.emit( params.event ); - } - - return this; - }; -} - -function defineSwitchSet( params ){ - elesfn[ params.field ] = function(){ - let ele = this[0]; - - if( ele ){ - if( params.overrideField ){ - let val = params.overrideField( ele ); - - if( val !== undefined ){ - return val; - } - } - - return ele._private[ params.field ]; - } - }; - - elesfn[ params.on ] = defineSwitchFunction( { - event: params.on, - field: params.field, - ableField: params.ableField, - overrideAble: params.overrideAble, - value: true - } ); - - elesfn[ params.off ] = defineSwitchFunction( { - event: params.off, - field: params.field, - ableField: params.ableField, - overrideAble: params.overrideAble, - value: false - } ); -} - -defineSwitchSet( { - field: 'locked', - overrideField: function( ele ){ - return ele.cy().autolock() ? true : undefined; - }, - on: 'lock', - off: 'unlock' -} ); - -defineSwitchSet( { - field: 'grabbable', - overrideField: function( ele ){ - return ele.cy().autoungrabify() ? false : undefined; - }, - on: 'grabify', - off: 'ungrabify' -} ); - -defineSwitchSet( { - field: 'selected', - ableField: 'selectable', - overrideAble: function( ele ){ - return ele.cy().autounselectify() ? false : undefined; - }, - on: 'select', - off: 'unselect' -} ); - -defineSwitchSet( { - field: 'selectable', - overrideField: function( ele ){ - return ele.cy().autounselectify() ? false : undefined; - }, - on: 'selectify', - off: 'unselectify' -} ); - -elesfn.deselect = elesfn.unselect; - -elesfn.grabbed = function(){ - let ele = this[0]; - if( ele ){ - return ele._private.grabbed; - } -}; - -defineSwitchSet( { - field: 'active', - on: 'activate', - off: 'unactivate' -} ); - -elesfn.inactive = function(){ - let ele = this[0]; - if( ele ){ - return !ele._private.active; - } -}; - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/traversing.js b/node_modules/cytoscape/src/collection/traversing.js deleted file mode 100644 index de34a72dd..000000000 --- a/node_modules/cytoscape/src/collection/traversing.js +++ /dev/null @@ -1,440 +0,0 @@ -let util = require( '../util' ); -let is = require( '../is' ); - -let elesfn = {}; - -let cache = function( fn, name ){ - return function traversalCache( arg1, arg2, arg3, arg4 ){ - let selectorOrEles = arg1; - let eles = this; - let key; - - if( selectorOrEles == null ){ - key = 'null'; - } else if( is.elementOrCollection( selectorOrEles ) && selectorOrEles.length === 1 ){ - key = '#' + selectorOrEles.id(); - } - - if( eles.length === 1 && key ){ - let _p = eles[0]._private; - let tch = _p.traversalCache = _p.traversalCache || {}; - let ch = tch[ name ] = tch[ name ] || {}; - let cacheHit = ch[ key ]; - - if( cacheHit ){ - return cacheHit; - } else { - return ( ch[ key ] = fn.call( eles, arg1, arg2, arg3, arg4 ) ); - } - } else { - return fn.call( eles, arg1, arg2, arg3, arg4 ); - } - }; -}; - -// DAG functions -//////////////// - -let defineDagExtremity = function( params ){ - return function dagExtremityImpl( selector ){ - let eles = this; - let ret = []; - - for( let i = 0; i < eles.length; i++ ){ - let ele = eles[ i ]; - if( !ele.isNode() ){ - continue; - } - - let disqualified = false; - let edges = ele.connectedEdges(); - - for( let j = 0; j < edges.length; j++ ){ - let edge = edges[j]; - let src = edge.source(); - let tgt = edge.target(); - - if( - ( params.noIncomingEdges && tgt === ele && src !== ele ) - || ( params.noOutgoingEdges && src === ele && tgt !== ele ) - ){ - disqualified = true; - break; - } - } - - if( !disqualified ){ - ret.push( ele ); - } - } - - return this.spawn( ret, { unique: true } ).filter( selector ); - }; -}; - -let defineDagOneHop = function( params ){ - return function( selector ){ - let eles = this; - let oEles = []; - - for( let i = 0; i < eles.length; i++ ){ - let ele = eles[ i ]; - - if( !ele.isNode() ){ continue; } - - let edges = ele.connectedEdges(); - for( let j = 0; j < edges.length; j++ ){ - let edge = edges[ j ]; - let src = edge.source(); - let tgt = edge.target(); - - if( params.outgoing && src === ele ){ - oEles.push( edge ); - oEles.push( tgt ); - } else if( params.incoming && tgt === ele ){ - oEles.push( edge ); - oEles.push( src ); - } - } - } - - return this.spawn( oEles, { unique: true } ).filter( selector ); - }; -}; - -let defineDagAllHops = function( params ){ - return function( selector ){ - let eles = this; - let sEles = []; - let sElesIds = {}; - - for( ;; ){ - let next = params.outgoing ? eles.outgoers() : eles.incomers(); - - if( next.length === 0 ){ break; } // done if none left - - let newNext = false; - for( let i = 0; i < next.length; i++ ){ - let n = next[ i ]; - let nid = n.id(); - - if( !sElesIds[ nid ] ){ - sElesIds[ nid ] = true; - sEles.push( n ); - newNext = true; - } - } - - if( !newNext ){ break; } // done if touched all outgoers already - - eles = next; - } - - return this.spawn( sEles, { unique: true } ).filter( selector ); - }; -}; - -elesfn.clearTraversalCache = function( ){ - for( let i = 0; i < this.length; i++ ){ - this[i]._private.traversalCache = null; - } -}; - -util.extend( elesfn, { - // get the root nodes in the DAG - roots: defineDagExtremity({ noIncomingEdges: true }), - - // get the leaf nodes in the DAG - leaves: defineDagExtremity({ noOutgoingEdges: true }), - - // normally called children in graph theory - // these nodes =edges=> outgoing nodes - outgoers: cache( defineDagOneHop({ outgoing: true }) , 'outgoers' ), - - // aka DAG descendants - successors: defineDagAllHops({ outgoing: true }), - - // normally called parents in graph theory - // these nodes <=edges= incoming nodes - incomers: cache( defineDagOneHop({ incoming: true }), 'incomers' ), - - // aka DAG ancestors - predecessors: defineDagAllHops({ incoming: true }) -} ); - - -// Neighbourhood functions -////////////////////////// - -util.extend( elesfn, { - neighborhood: cache(function( selector ){ - let elements = []; - let nodes = this.nodes(); - - for( let i = 0; i < nodes.length; i++ ){ // for all nodes - let node = nodes[ i ]; - let connectedEdges = node.connectedEdges(); - - // for each connected edge, add the edge and the other node - for( let j = 0; j < connectedEdges.length; j++ ){ - let edge = connectedEdges[ j ]; - let src = edge.source(); - let tgt = edge.target(); - let otherNode = node === src ? tgt : src; - - // need check in case of loop - if( otherNode.length > 0 ){ - elements.push( otherNode[0] ); // add node 1 hop away - } - - // add connected edge - elements.push( edge[0] ); - } - - } - - return ( this.spawn( elements, { unique: true } ) ).filter( selector ); - }, 'neighborhood'), - - closedNeighborhood: function( selector ){ - return this.neighborhood().add( this ).filter( selector ); - }, - - openNeighborhood: function( selector ){ - return this.neighborhood( selector ); - } -} ); - -// aliases -elesfn.neighbourhood = elesfn.neighborhood; -elesfn.closedNeighbourhood = elesfn.closedNeighborhood; -elesfn.openNeighbourhood = elesfn.openNeighborhood; - -// Edge functions -///////////////// - -util.extend( elesfn, { - source: cache(function sourceImpl( selector ){ - let ele = this[0]; - let src; - - if( ele ){ - src = ele._private.source || ele.cy().collection(); - } - - return src && selector ? src.filter( selector ) : src; - }, 'source'), - - target: cache(function targetImpl( selector ){ - let ele = this[0]; - let tgt; - - if( ele ){ - tgt = ele._private.target || ele.cy().collection(); - } - - return tgt && selector ? tgt.filter( selector ) : tgt; - }, 'target'), - - sources: defineSourceFunction( { - attr: 'source' - } ), - - targets: defineSourceFunction( { - attr: 'target' - } ) -} ); - -function defineSourceFunction( params ){ - return function sourceImpl( selector ){ - let sources = []; - - for( let i = 0; i < this.length; i++ ){ - let ele = this[ i ]; - let src = ele._private[ params.attr ]; - - if( src ){ - sources.push( src ); - } - } - - return this.spawn( sources, { unique: true } ).filter( selector ); - }; -} - -util.extend( elesfn, { - edgesWith: cache( defineEdgesWithFunction(), 'edgesWith' ), - - edgesTo: cache( defineEdgesWithFunction( { - thisIsSrc: true - } ), 'edgesTo' ) -} ); - -function defineEdgesWithFunction( params ){ - - return function edgesWithImpl( otherNodes ){ - let elements = []; - let cy = this._private.cy; - let p = params || {}; - - // get elements if a selector is specified - if( is.string( otherNodes ) ){ - otherNodes = cy.$( otherNodes ); - } - - for( let h = 0; h < otherNodes.length; h++ ){ - let edges = otherNodes[ h ]._private.edges; - - for( let i = 0; i < edges.length; i++ ){ - let edge = edges[ i ]; - let edgeData = edge._private.data; - let thisToOther = this.hasElementWithId( edgeData.source ) && otherNodes.hasElementWithId( edgeData.target ); - let otherToThis = otherNodes.hasElementWithId( edgeData.source ) && this.hasElementWithId( edgeData.target ); - let edgeConnectsThisAndOther = thisToOther || otherToThis; - - if( !edgeConnectsThisAndOther ){ continue; } - - if( p.thisIsSrc || p.thisIsTgt ){ - if( p.thisIsSrc && !thisToOther ){ continue; } - - if( p.thisIsTgt && !otherToThis ){ continue; } - } - - elements.push( edge ); - } - } - - return this.spawn( elements, { unique: true } ); - }; -} - -util.extend( elesfn, { - connectedEdges: cache(function( selector ){ - let retEles = []; - - let eles = this; - for( let i = 0; i < eles.length; i++ ){ - let node = eles[ i ]; - if( !node.isNode() ){ continue; } - - let edges = node._private.edges; - - for( let j = 0; j < edges.length; j++ ){ - let edge = edges[ j ]; - retEles.push( edge ); - } - } - - return this.spawn( retEles, { unique: true } ).filter( selector ); - }, 'connectedEdges'), - - connectedNodes: cache(function( selector ){ - let retEles = []; - - let eles = this; - for( let i = 0; i < eles.length; i++ ){ - let edge = eles[ i ]; - if( !edge.isEdge() ){ continue; } - - retEles.push( edge.source()[0] ); - retEles.push( edge.target()[0] ); - } - - return this.spawn( retEles, { unique: true } ).filter( selector ); - }, 'connectedNodes'), - - parallelEdges: cache( defineParallelEdgesFunction(), 'parallelEdges' ), - - codirectedEdges: cache( defineParallelEdgesFunction( { - codirected: true - } ), 'codirectedEdges' ) -} ); - -function defineParallelEdgesFunction( params ){ - let defaults = { - codirected: false - }; - params = util.extend( {}, defaults, params ); - - return function parallelEdgesImpl( selector ){ // micro-optimised for renderer - let elements = []; - let edges = this.edges(); - let p = params; - - // look at all the edges in the collection - for( let i = 0; i < edges.length; i++ ){ - let edge1 = edges[ i ]; - let edge1_p = edge1._private; - let src1 = edge1_p.source; - let srcid1 = src1._private.data.id; - let tgtid1 = edge1_p.data.target; - let srcEdges1 = src1._private.edges; - - // look at edges connected to the src node of this edge - for( let j = 0; j < srcEdges1.length; j++ ){ - let edge2 = srcEdges1[ j ]; - let edge2data = edge2._private.data; - let tgtid2 = edge2data.target; - let srcid2 = edge2data.source; - - let codirected = tgtid2 === tgtid1 && srcid2 === srcid1; - let oppdirected = srcid1 === tgtid2 && tgtid1 === srcid2; - - if( (p.codirected && codirected) || (!p.codirected && (codirected || oppdirected)) ){ - elements.push( edge2 ); - } - } - } - - return this.spawn( elements, { unique: true } ).filter( selector ); - }; - -} - -// Misc functions -///////////////// - -util.extend( elesfn, { - components: function(){ - let self = this; - let cy = self.cy(); - let visited = self.spawn(); - let unvisited = self.nodes().spawnSelf(); - let components = []; - - let visitInComponent = function( node, component ){ - visited.merge( node ); - unvisited.unmerge( node ); - component.merge( node ); - }; - - if( unvisited.empty() ){ return self.spawn(); } - - do { - let component = cy.collection(); - components.push( component ); - - let root = unvisited[0]; - visitInComponent( root, component ); - - self.bfs({ - directed: false, - roots: root, - visit: function( v, e, u, i, depth ){ - visitInComponent( v, component ); - } - } ); - - } while( unvisited.length > 0 ); - - return components.map(function( component ){ - let connectedEdges = component.connectedEdges().stdFilter(function( edge ){ - return component.anySame( edge.source() ) && component.anySame( edge.target() ); - }); - - return component.union( connectedEdges ); - }); - } -} ); - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/collection/zsort.js b/node_modules/cytoscape/src/collection/zsort.js deleted file mode 100644 index 7676b4e80..000000000 --- a/node_modules/cytoscape/src/collection/zsort.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Elements are drawn in a specific order based on compound depth (low to high), the element type (nodes above edges), - * and z-index (low to high). These styles affect how this applies: - * - * z-compound-depth: May be `bottom | orphan | auto | top`. The first drawn is `bottom`, then `orphan` which is the - * same depth as the root of the compound graph, followed by the default value `auto` which draws in order from - * root to leaves of the compound graph. The last drawn is `top`. - * z-index-compare: May be `auto | manual`. The default value is `auto` which always draws edges under nodes. - * `manual` ignores this convention and draws based on the `z-index` value setting. - * z-index: An integer value that affects the relative draw order of elements. In general, an element with a higher - * `z-index` will be drawn on top of an element with a lower `z-index`. - */ -let util = require('../util'); - -let zIndexSort = function( a, b ){ - let cy = a.cy(); - let hasCompoundNodes = cy.hasCompoundNodes(); - - function getDepth(ele){ - let style = ele.pstyle( 'z-compound-depth' ); - if ( style.value === 'auto' ){ - return hasCompoundNodes ? ele.zDepth() : 0; - } else if ( style.value === 'bottom' ){ - return -1; - } else if ( style.value === 'top' ){ - return util.MAX_INT; - } - // 'orphan' - return 0; - } - let depthDiff = getDepth(a) - getDepth(b); - if ( depthDiff !== 0 ){ - return depthDiff; - } - - function getEleDepth(ele){ - let style = ele.pstyle( 'z-index-compare' ); - if ( style.value === 'auto' ){ - return ele.isNode() ? 1 : 0; - } - // 'manual' - return 0; - } - let eleDiff = getEleDepth(a) - getEleDepth(b); - if ( eleDiff !== 0 ){ - return eleDiff; - } - - let zDiff = a.pstyle( 'z-index' ).value - b.pstyle( 'z-index' ).value; - if ( zDiff !== 0 ){ - return zDiff; - } - // compare indices in the core (order added to graph w/ last on top) - return a.poolIndex() - b.poolIndex(); -}; - -module.exports = zIndexSort; diff --git a/node_modules/cytoscape/src/core/add-remove.js b/node_modules/cytoscape/src/core/add-remove.js deleted file mode 100644 index d8876f1d6..000000000 --- a/node_modules/cytoscape/src/core/add-remove.js +++ /dev/null @@ -1,82 +0,0 @@ -let is = require( '../is' ); -let util = require( '../util' ); -let Collection = require( '../collection' ); -let Element = require( '../collection/element' ); - -let corefn = { - add: function( opts ){ - - let elements; - let cy = this; - - // add the elements - if( is.elementOrCollection( opts ) ){ - let eles = opts; - - if( eles._private.cy === cy ){ // same instance => just restore - elements = eles.restore(); - - } else { // otherwise, copy from json - let jsons = []; - - for( let i = 0; i < eles.length; i++ ){ - let ele = eles[ i ]; - jsons.push( ele.json() ); - } - - elements = new Collection( cy, jsons ); - } - } - - // specify an array of options - else if( is.array( opts ) ){ - let jsons = opts; - - elements = new Collection( cy, jsons ); - } - - // specify via opts.nodes and opts.edges - else if( is.plainObject( opts ) && (is.array( opts.nodes ) || is.array( opts.edges )) ){ - let elesByGroup = opts; - let jsons = []; - - let grs = [ 'nodes', 'edges' ]; - for( let i = 0, il = grs.length; i < il; i++ ){ - let group = grs[ i ]; - let elesArray = elesByGroup[ group ]; - - if( is.array( elesArray ) ){ - - for( let j = 0, jl = elesArray.length; j < jl; j++ ){ - let json = util.extend( { group: group }, elesArray[ j ] ); - - jsons.push( json ); - } - } - } - - elements = new Collection( cy, jsons ); - } - - // specify options for one element - else { - let json = opts; - elements = (new Element( cy, json )).collection(); - } - - return elements; - }, - - remove: function( collection ){ - if( is.elementOrCollection( collection ) ){ - // already have right ref - } else if( is.string( collection ) ){ - let selector = collection; - collection = this.$( selector ); - } - - return collection.remove(); - } -}; - -module.exports = corefn; diff --git a/node_modules/cytoscape/src/core/animation/cubic-bezier.js b/node_modules/cytoscape/src/core/animation/cubic-bezier.js deleted file mode 100644 index c733e5373..000000000 --- a/node_modules/cytoscape/src/core/animation/cubic-bezier.js +++ /dev/null @@ -1,158 +0,0 @@ -/* global Float32Array */ - -/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */ -function generateCubicBezier(mX1, mY1, mX2, mY2) { - let NEWTON_ITERATIONS = 4, - NEWTON_MIN_SLOPE = 0.001, - SUBDIVISION_PRECISION = 0.0000001, - SUBDIVISION_MAX_ITERATIONS = 10, - kSplineTableSize = 11, - kSampleStepSize = 1.0 / (kSplineTableSize - 1.0), - float32ArraySupported = typeof Float32Array !== 'undefined'; - - /* Must contain four arguments. */ - if (arguments.length !== 4) { - return false; - } - - /* Arguments must be numbers. */ - for (let i = 0; i < 4; ++i) { - if (typeof arguments[i] !== "number" || isNaN(arguments[i]) || !isFinite(arguments[i])) { - return false; - } - } - - /* X values must be in the [0, 1] range. */ - mX1 = Math.min(mX1, 1); - mX2 = Math.min(mX2, 1); - mX1 = Math.max(mX1, 0); - mX2 = Math.max(mX2, 0); - - let mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize); - - function A(aA1, aA2) { - return 1.0 - 3.0 * aA2 + 3.0 * aA1; - } - - function B(aA1, aA2) { - return 3.0 * aA2 - 6.0 * aA1; - } - - function C(aA1) { - return 3.0 * aA1; - } - - function calcBezier(aT, aA1, aA2) { - return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; - } - - function getSlope(aT, aA1, aA2) { - return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); - } - - function newtonRaphsonIterate(aX, aGuessT) { - for (let i = 0; i < NEWTON_ITERATIONS; ++i) { - let currentSlope = getSlope(aGuessT, mX1, mX2); - - if (currentSlope === 0.0) { - return aGuessT; - } - - let currentX = calcBezier(aGuessT, mX1, mX2) - aX; - aGuessT -= currentX / currentSlope; - } - - return aGuessT; - } - - function calcSampleValues() { - for (let i = 0; i < kSplineTableSize; ++i) { - mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2); - } - } - - function binarySubdivide(aX, aA, aB) { - let currentX, currentT, i = 0; - - do { - currentT = aA + (aB - aA) / 2.0; - currentX = calcBezier(currentT, mX1, mX2) - aX; - if (currentX > 0.0) { - aB = currentT; - } else { - aA = currentT; - } - } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS); - - return currentT; - } - - function getTForX(aX) { - let intervalStart = 0.0, - currentSample = 1, - lastSample = kSplineTableSize - 1; - - for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) { - intervalStart += kSampleStepSize; - } - - --currentSample; - - let dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]), - guessForT = intervalStart + dist * kSampleStepSize, - initialSlope = getSlope(guessForT, mX1, mX2); - - if (initialSlope >= NEWTON_MIN_SLOPE) { - return newtonRaphsonIterate(aX, guessForT); - } else if (initialSlope === 0.0) { - return guessForT; - } else { - return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize); - } - } - - let _precomputed = false; - - function precompute() { - _precomputed = true; - if (mX1 !== mY1 || mX2 !== mY2) { - calcSampleValues(); - } - } - - let f = function(aX) { - if (!_precomputed) { - precompute(); - } - if (mX1 === mY1 && mX2 === mY2) { - return aX; - } - if (aX === 0) { - return 0; - } - if (aX === 1) { - return 1; - } - - return calcBezier(getTForX(aX), mY1, mY2); - }; - - f.getControlPoints = function() { - return [{ - x: mX1, - y: mY1 - }, { - x: mX2, - y: mY2 - }]; - }; - - let str = "generateBezier(" + [mX1, mY1, mX2, mY2] + ")"; - f.toString = function() { - return str; - }; - - return f; -} - -module.exports = generateCubicBezier; diff --git a/node_modules/cytoscape/src/core/animation/ease.js b/node_modules/cytoscape/src/core/animation/ease.js deleted file mode 100644 index ad731fc18..000000000 --- a/node_modules/cytoscape/src/core/animation/ease.js +++ /dev/null @@ -1,78 +0,0 @@ -let is = require('../../is'); - -function getEasedValue( type, start, end, percent, easingFn ){ - if( percent === 1 ){ - return end; - } - - let val = easingFn( start, end, percent ); - - if( type == null ){ - return val; - } - - if( type.roundValue || type.color ){ - val = Math.round( val ); - } - - if( type.min !== undefined ){ - val = Math.max( val, type.min ); - } - - if( type.max !== undefined ){ - val = Math.min( val, type.max ); - } - - return val; -} - -function getValue( prop, spec ){ - if( prop.pfValue != null || prop.value != null ){ - if( prop.pfValue != null && (spec == null || spec.type.units !== '%') ){ - return prop.pfValue; - } else { - return prop.value; - } - } else { - return prop; - } -} - -function ease( startProp, endProp, percent, easingFn, propSpec ){ - let type = propSpec != null ? propSpec.type : null; - - if( percent < 0 ){ - percent = 0; - } else if( percent > 1 ){ - percent = 1; - } - - let start = getValue( startProp, propSpec ); - let end = getValue( endProp, propSpec ); - - if( is.number( start ) && is.number( end ) ){ - return getEasedValue( type, start, end, percent, easingFn ); - - } else if( is.array( start ) && is.array( end ) ){ - let easedArr = []; - - for( let i = 0; i < end.length; i++ ){ - let si = start[ i ]; - let ei = end[ i ]; - - if( si != null && ei != null ){ - let val = getEasedValue( type, si, ei, percent, easingFn ); - - easedArr.push( val ); - } else { - easedArr.push( ei ); - } - } - - return easedArr; - } - - return undefined; -} - -module.exports = ease; diff --git a/node_modules/cytoscape/src/core/animation/easings.js b/node_modules/cytoscape/src/core/animation/easings.js deleted file mode 100644 index 1a7156b16..000000000 --- a/node_modules/cytoscape/src/core/animation/easings.js +++ /dev/null @@ -1,76 +0,0 @@ -let generateCubicBezier = require('./cubic-bezier'); -let generateSpringRK4 = require('./spring'); - -let cubicBezier = function( t1, p1, t2, p2 ){ - let bezier = generateCubicBezier( t1, p1, t2, p2 ); - - return function( start, end, percent ){ - return start + ( end - start ) * bezier( percent ); - }; -}; - -let easings = { - 'linear': function( start, end, percent ){ - return start + (end - start) * percent; - }, - - // default easings - 'ease': cubicBezier( 0.25, 0.1, 0.25, 1 ), - 'ease-in': cubicBezier( 0.42, 0, 1, 1 ), - 'ease-out': cubicBezier( 0, 0, 0.58, 1 ), - 'ease-in-out': cubicBezier( 0.42, 0, 0.58, 1 ), - - // sine - 'ease-in-sine': cubicBezier( 0.47, 0, 0.745, 0.715 ), - 'ease-out-sine': cubicBezier( 0.39, 0.575, 0.565, 1 ), - 'ease-in-out-sine': cubicBezier( 0.445, 0.05, 0.55, 0.95 ), - - // quad - 'ease-in-quad': cubicBezier( 0.55, 0.085, 0.68, 0.53 ), - 'ease-out-quad': cubicBezier( 0.25, 0.46, 0.45, 0.94 ), - 'ease-in-out-quad': cubicBezier( 0.455, 0.03, 0.515, 0.955 ), - - // cubic - 'ease-in-cubic': cubicBezier( 0.55, 0.055, 0.675, 0.19 ), - 'ease-out-cubic': cubicBezier( 0.215, 0.61, 0.355, 1 ), - 'ease-in-out-cubic': cubicBezier( 0.645, 0.045, 0.355, 1 ), - - // quart - 'ease-in-quart': cubicBezier( 0.895, 0.03, 0.685, 0.22 ), - 'ease-out-quart': cubicBezier( 0.165, 0.84, 0.44, 1 ), - 'ease-in-out-quart': cubicBezier( 0.77, 0, 0.175, 1 ), - - // quint - 'ease-in-quint': cubicBezier( 0.755, 0.05, 0.855, 0.06 ), - 'ease-out-quint': cubicBezier( 0.23, 1, 0.32, 1 ), - 'ease-in-out-quint': cubicBezier( 0.86, 0, 0.07, 1 ), - - // expo - 'ease-in-expo': cubicBezier( 0.95, 0.05, 0.795, 0.035 ), - 'ease-out-expo': cubicBezier( 0.19, 1, 0.22, 1 ), - 'ease-in-out-expo': cubicBezier( 1, 0, 0, 1 ), - - // circ - 'ease-in-circ': cubicBezier( 0.6, 0.04, 0.98, 0.335 ), - 'ease-out-circ': cubicBezier( 0.075, 0.82, 0.165, 1 ), - 'ease-in-out-circ': cubicBezier( 0.785, 0.135, 0.15, 0.86 ), - - - // user param easings... - - 'spring': function( tension, friction, duration ){ - if( duration === 0 ){ // can't get a spring w/ duration 0 - return easings.linear; // duration 0 => jump to end so impl doesn't matter - } - - let spring = generateSpringRK4( tension, friction, duration ); - - return function( start, end, percent ){ - return start + (end - start) * spring( percent ); - }; - }, - - 'cubic-bezier': cubicBezier -}; - -module.exports = easings; diff --git a/node_modules/cytoscape/src/core/animation/index.js b/node_modules/cytoscape/src/core/animation/index.js deleted file mode 100644 index 4035ff58a..000000000 --- a/node_modules/cytoscape/src/core/animation/index.js +++ /dev/null @@ -1,60 +0,0 @@ -let define = require('../../define'); -let util = require('../../util'); -let stepAll = require('./step-all'); - -let corefn = ({ - - // pull in animation functions - animate: define.animate(), - animation: define.animation(), - animated: define.animated(), - clearQueue: define.clearQueue(), - delay: define.delay(), - delayAnimation: define.delayAnimation(), - stop: define.stop(), - - addToAnimationPool: function( eles ){ - let cy = this; - - if( !cy.styleEnabled() ){ return; } // save cycles when no style used - - cy._private.aniEles.merge( eles ); - }, - - stopAnimationLoop: function(){ - this._private.animationsRunning = false; - }, - - startAnimationLoop: function(){ - let cy = this; - - cy._private.animationsRunning = true; - - if( !cy.styleEnabled() ){ return; } // save cycles when no style used - - // NB the animation loop will exec in headless environments if style enabled - // and explicit cy.destroy() is necessary to stop the loop - - function headlessStep(){ - if( !cy._private.animationsRunning ){ return; } - - util.requestAnimationFrame( function animationStep( now ){ - stepAll( now, cy ); - headlessStep(); - } ); - } - - let renderer = cy.renderer(); - - if( renderer && renderer.beforeRender ){ // let the renderer schedule animations - renderer.beforeRender( function rendererAnimationStep( willDraw, now ){ - stepAll( now, cy ); - }, renderer.beforeRenderPriorities.animations ); - } else { // manage the animation loop ourselves - headlessStep(); // first call - } - } - -}); - -module.exports = corefn; diff --git a/node_modules/cytoscape/src/core/animation/spring.js b/node_modules/cytoscape/src/core/animation/spring.js deleted file mode 100644 index 04fcc8268..000000000 --- a/node_modules/cytoscape/src/core/animation/spring.js +++ /dev/null @@ -1,88 +0,0 @@ -/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */ -/* Given a tension, friction, and duration, a simulation at 60FPS will first run without a defined duration in order to calculate the full path. A second pass - then adjusts the time delta -- using the relation between actual time and duration -- to calculate the path for the duration-constrained animation. */ -let generateSpringRK4 = (function(){ - function springAccelerationForState( state ){ - return (-state.tension * state.x) - (state.friction * state.v); - } - - function springEvaluateStateWithDerivative( initialState, dt, derivative ){ - let state = { - x: initialState.x + derivative.dx * dt, - v: initialState.v + derivative.dv * dt, - tension: initialState.tension, - friction: initialState.friction - }; - - return { dx: state.v, dv: springAccelerationForState( state ) }; - } - - function springIntegrateState( state, dt ){ - let a = { - dx: state.v, - dv: springAccelerationForState( state ) - }, - b = springEvaluateStateWithDerivative( state, dt * 0.5, a ), - c = springEvaluateStateWithDerivative( state, dt * 0.5, b ), - d = springEvaluateStateWithDerivative( state, dt, c ), - dxdt = 1.0 / 6.0 * (a.dx + 2.0 * (b.dx + c.dx) + d.dx), - dvdt = 1.0 / 6.0 * (a.dv + 2.0 * (b.dv + c.dv) + d.dv); - - state.x = state.x + dxdt * dt; - state.v = state.v + dvdt * dt; - - return state; - } - - return function springRK4Factory( tension, friction, duration ){ - - let initState = { - x: -1, - v: 0, - tension: null, - friction: null - }, - path = [0], - time_lapsed = 0, - tolerance = 1 / 10000, - DT = 16 / 1000, - have_duration, dt, last_state; - - tension = parseFloat( tension ) || 500; - friction = parseFloat( friction ) || 20; - duration = duration || null; - - initState.tension = tension; - initState.friction = friction; - - have_duration = duration !== null; - - /* Calculate the actual time it takes for this animation to complete with the provided conditions. */ - if( have_duration ){ - /* Run the simulation without a duration. */ - time_lapsed = springRK4Factory( tension, friction ); - /* Compute the adjusted time delta. */ - dt = time_lapsed / duration * DT; - } else { - dt = DT; - } - - for(;;){ - /* Next/step function .*/ - last_state = springIntegrateState( last_state || initState, dt ); - /* Store the position. */ - path.push( 1 + last_state.x ); - time_lapsed += 16; - /* If the change threshold is reached, break. */ - if( !(Math.abs( last_state.x ) > tolerance && Math.abs( last_state.v ) > tolerance) ){ - break; - } - } - - /* If duration is not defined, return the actual time required for completing this animation. Otherwise, return a closure that holds the - computed path and returns a snapshot of the position according to a given percentComplete. */ - return !have_duration ? time_lapsed : function( percentComplete ){ return path[ (percentComplete * (path.length - 1)) | 0 ]; }; - }; -}()); - -module.exports = generateSpringRK4; diff --git a/node_modules/cytoscape/src/core/animation/start.js b/node_modules/cytoscape/src/core/animation/start.js deleted file mode 100644 index 69689c66e..000000000 --- a/node_modules/cytoscape/src/core/animation/start.js +++ /dev/null @@ -1,34 +0,0 @@ -function startAnimation( self, ani, now, isCore ){ - let isEles = !isCore; - let ele = self; - let ani_p = ani._private; - let cy = isCore ? self : self.cy(); - let style = cy.style(); - - if( isEles ){ - let pos = ele.position(); - - ani_p.startPosition = ani_p.startPosition || { - x: pos.x, - y: pos.y - }; - - ani_p.startStyle = ani_p.startStyle || style.getAnimationStartStyle( ele, ani_p.style ); - } - - if( isCore ){ - let pan = cy._private.pan; - - ani_p.startPan = ani_p.startPan || { - x: pan.x, - y: pan.y - }; - - ani_p.startZoom = ani_p.startZoom != null ? ani_p.startZoom : cy._private.zoom; - } - - ani_p.started = true; - ani_p.startTime = now - ani_p.progress * ani_p.duration; -} - -module.exports = startAnimation; diff --git a/node_modules/cytoscape/src/core/animation/step-all.js b/node_modules/cytoscape/src/core/animation/step-all.js deleted file mode 100644 index 543de7ced..000000000 --- a/node_modules/cytoscape/src/core/animation/step-all.js +++ /dev/null @@ -1,133 +0,0 @@ -let step = require('./step'); -let startAnimation = require('./start'); - -function stepAll( now, cy ){ - let eles = cy._private.aniEles; - let doneEles = []; - - function stepOne( ele, isCore ){ - let _p = ele._private; - let current = _p.animation.current; - let queue = _p.animation.queue; - let ranAnis = false; - - // cancel all animations on display:none ele - if( !isCore && ele.pstyle('display').value === 'none' ){ - // put all current and queue animations in this tick's current list - // and empty the lists for the element - current = current.splice( 0, current.length ).concat( queue.splice( 0, queue.length ) ); - - // stop all animations - for( let i = 0; i < current.length; i++ ){ current[i].stop(); } - } - - // if nothing currently animating, get something from the queue - if( current.length === 0 ){ - let next = queue.shift(); - - if( next ){ - current.push( next ); - } - } - - let callbacks = function( callbacks ){ - for( let j = callbacks.length - 1; j >= 0; j-- ){ - let cb = callbacks[ j ]; - - cb(); - } - - callbacks.splice( 0, callbacks.length ); - }; - - // step and remove if done - for( let i = current.length - 1; i >= 0; i-- ){ - let ani = current[ i ]; - let ani_p = ani._private; - - if( ani_p.stopped ){ - current.splice( i, 1 ); - - ani_p.hooked = false; - ani_p.playing = false; - ani_p.started = false; - - callbacks( ani_p.frames ); - - continue; - } - - if( !ani_p.playing && !ani_p.applying ){ continue; } - - // an apply() while playing shouldn't do anything - if( ani_p.playing && ani_p.applying ){ - ani_p.applying = false; - } - - if( !ani_p.started ){ - startAnimation( ele, ani, now, isCore ); - } - - step( ele, ani, now, isCore ); - - if( ani_p.applying ){ - ani_p.applying = false; - } - - callbacks( ani_p.frames ); - - if( ani.completed() ){ - current.splice( i, 1 ); - - ani_p.hooked = false; - ani_p.playing = false; - ani_p.started = false; - - callbacks( ani_p.completes ); - } - - ranAnis = true; - } - - if( !isCore && current.length === 0 && queue.length === 0 ){ - doneEles.push( ele ); - } - - return ranAnis; - } // stepElement - - // handle all eles - let ranEleAni = false; - for( let e = 0; e < eles.length; e++ ){ - let ele = eles[ e ]; - let handledThisEle = stepOne( ele ); - - ranEleAni = ranEleAni || handledThisEle; - } // each element - - let ranCoreAni = stepOne( cy, true ); - - // notify renderer - if( ranEleAni || ranCoreAni ){ - if( eles.length > 0 ){ - eles.dirtyCompoundBoundsCache(); - - cy.notify({ - type: 'draw', - eles: eles - }); - } else { - cy.notify({ - type: 'draw' - }); - } - } - - // remove elements from list of currently animating if its queues are empty - eles.unmerge( doneEles ); - - cy.emit('step'); - -} // stepAll - -module.exports = stepAll; diff --git a/node_modules/cytoscape/src/core/animation/step.js b/node_modules/cytoscape/src/core/animation/step.js deleted file mode 100644 index fbe8cfc27..000000000 --- a/node_modules/cytoscape/src/core/animation/step.js +++ /dev/null @@ -1,161 +0,0 @@ -let easings = require('./easings'); -let ease = require('./ease'); -let is = require('../../is'); - -function step( self, ani, now, isCore ){ - let isEles = !isCore; - let _p = self._private; - let ani_p = ani._private; - let pEasing = ani_p.easing; - let startTime = ani_p.startTime; - let cy = isCore ? self : self.cy(); - let style = cy.style(); - - if( !ani_p.easingImpl ){ - - if( pEasing == null ){ // use default - ani_p.easingImpl = easings[ 'linear' ]; - - } else { // then define w/ name - let easingVals; - - if( is.string( pEasing ) ){ - let easingProp = style.parse( 'transition-timing-function', pEasing ); - - easingVals = easingProp.value; - - } else { // then assume preparsed array - easingVals = pEasing; - } - - let name, args; - - if( is.string( easingVals ) ){ - name = easingVals; - args = []; - } else { - name = easingVals[1]; - args = easingVals.slice( 2 ).map( function( n ){ return +n; } ); - } - - if( args.length > 0 ){ // create with args - if( name === 'spring' ){ - args.push( ani_p.duration ); // need duration to generate spring - } - - ani_p.easingImpl = easings[ name ].apply( null, args ); - } else { // static impl by name - ani_p.easingImpl = easings[ name ]; - } - } - - } - - let easing = ani_p.easingImpl; - let percent; - - if( ani_p.duration === 0 ){ - percent = 1; - } else { - percent = (now - startTime) / ani_p.duration; - } - - if( ani_p.applying ){ - percent = ani_p.progress; - } - - if( percent < 0 ){ - percent = 0; - } else if( percent > 1 ){ - percent = 1; - } - - if( ani_p.delay == null ){ // then update - - let startPos = ani_p.startPosition; - let endPos = ani_p.position; - - if( endPos && isEles && !self.locked() ){ - let pos = self.position(); - - if( valid( startPos.x, endPos.x ) ){ - pos.x = ease( startPos.x, endPos.x, percent, easing ); - } - - if( valid( startPos.y, endPos.y ) ){ - pos.y = ease( startPos.y, endPos.y, percent, easing ); - } - - self.emit('position'); - } - - let startPan = ani_p.startPan; - let endPan = ani_p.pan; - let pan = _p.pan; - let animatingPan = endPan != null && isCore; - if( animatingPan ){ - if( valid( startPan.x, endPan.x ) ){ - pan.x = ease( startPan.x, endPan.x, percent, easing ); - } - - if( valid( startPan.y, endPan.y ) ){ - pan.y = ease( startPan.y, endPan.y, percent, easing ); - } - - self.emit( 'pan' ); - } - - let startZoom = ani_p.startZoom; - let endZoom = ani_p.zoom; - let animatingZoom = endZoom != null && isCore; - if( animatingZoom ){ - if( valid( startZoom, endZoom ) ){ - _p.zoom = ease( startZoom, endZoom, percent, easing ); - } - - self.emit( 'zoom' ); - } - - if( animatingPan || animatingZoom ){ - self.emit( 'viewport' ); - } - - let props = ani_p.style; - if( props && props.length > 0 && isEles ){ - for( let i = 0; i < props.length; i++ ){ - let prop = props[ i ]; - let name = prop.name; - let end = prop; - let start = ani_p.startStyle[ name ]; - let propSpec = style.properties[ start.name ]; - let easedVal = ease( start, end, percent, easing, propSpec ); - - style.overrideBypass( self, name, easedVal ); - } // for props - - self.emit('style'); - - } // if - - } - - ani_p.progress = percent; - - return percent; -} - -function valid( start, end ){ - if( start == null || end == null ){ - return false; - } - - if( is.number( start ) && is.number( end ) ){ - return true; - } else if( (start) && (end) ){ - return true; - } - - return false; -} - -module.exports = step; diff --git a/node_modules/cytoscape/src/core/events.js b/node_modules/cytoscape/src/core/events.js deleted file mode 100644 index 6d941665e..000000000 --- a/node_modules/cytoscape/src/core/events.js +++ /dev/null @@ -1,93 +0,0 @@ -let Emitter = require('../emitter'); -let define = require('../define'); -let is = require('../is'); -let util = require('../util'); -let Selector = require('../selector'); - -let emitterOptions = { - qualifierCompare: function( selector1, selector2 ){ - if( selector1 == null || selector2 == null ){ - return selector1 == null && selector2 == null; - } else { - return selector1.sameText( selector2 ); - } - }, - eventMatches: function( cy, listener, eventObj ){ - let selector = listener.qualifier; - - if( selector != null ){ - return cy !== eventObj.target && is.element( eventObj.target ) && selector.matches( eventObj.target ); - } - - return true; - }, - eventFields: function( cy ){ - return { - cy: cy, - target: cy - }; - }, - callbackContext: function( cy, listener, eventObj ){ - return listener.qualifier != null ? eventObj.target : cy; - } -}; - -let argSelector = function( arg ){ - if( is.string(arg) ){ - return new Selector( arg ); - } else { - return arg; - } -}; - -let elesfn = ({ - createEmitter: function(){ - let _p = this._private; - - if( !_p.emitter ){ - _p.emitter = new Emitter( util.assign( { - context: this - }, emitterOptions ) ); - } - - return this; - }, - - emitter: function(){ - return this._private.emitter; - }, - - on: function( events, selector, callback ){ - this.emitter().on( events, argSelector(selector), callback ); - - return this; - }, - - removeListener: function( events, selector, callback ){ - this.emitter().removeListener( events, argSelector(selector), callback ); - - return this; - }, - - one: function( events, selector, callback ){ - this.emitter().one( events, argSelector(selector), callback ); - - return this; - }, - - once: function( events, selector, callback ){ - this.emitter().one( events, argSelector(selector), callback ); - - return this; - }, - - emit: function( events, extraParams ){ - this.emitter().emit( events, extraParams ); - - return this; - } -}); - -define.eventAliasesOn( elesfn ); - -module.exports = elesfn; diff --git a/node_modules/cytoscape/src/core/export.js b/node_modules/cytoscape/src/core/export.js deleted file mode 100644 index 5d1156ded..000000000 --- a/node_modules/cytoscape/src/core/export.js +++ /dev/null @@ -1,23 +0,0 @@ -let corefn = ({ - - png: function( options ){ - let renderer = this._private.renderer; - options = options || {}; - - return renderer.png( options ); - }, - - jpg: function( options ){ - let renderer = this._private.renderer; - options = options || {}; - - options.bg = options.bg || '#fff'; - - return renderer.jpg( options ); - } - -}); - -corefn.jpeg = corefn.jpg; - -module.exports = corefn; diff --git a/node_modules/cytoscape/src/core/index.js b/node_modules/cytoscape/src/core/index.js deleted file mode 100644 index 7b5f19b2e..000000000 --- a/node_modules/cytoscape/src/core/index.js +++ /dev/null @@ -1,446 +0,0 @@ -let window = require( '../window' ); -let util = require( '../util' ); -let Collection = require( '../collection' ); -let is = require( '../is' ); -let Promise = require( '../promise' ); -let define = require( '../define' ); - -let Core = function( opts ){ - let cy = this; - - opts = util.extend( {}, opts ); - - let container = opts.container; - - // allow for passing a wrapped jquery object - // e.g. cytoscape({ container: $('#cy') }) - if( container && !is.htmlElement( container ) && is.htmlElement( container[0] ) ){ - container = container[0]; - } - - let reg = container ? container._cyreg : null; // e.g. already registered some info (e.g. readies) via jquery - reg = reg || {}; - - if( reg && reg.cy ){ - reg.cy.destroy(); - - reg = {}; // old instance => replace reg completely - } - - let readies = reg.readies = reg.readies || []; - - if( container ){ container._cyreg = reg; } // make sure container assoc'd reg points to this cy - reg.cy = cy; - - let head = window !== undefined && container !== undefined && !opts.headless; - let options = opts; - options.layout = util.extend( { name: head ? 'grid' : 'null' }, options.layout ); - options.renderer = util.extend( { name: head ? 'canvas' : 'null' }, options.renderer ); - - let defVal = function( def, val, altVal ){ - if( val !== undefined ){ - return val; - } else if( altVal !== undefined ){ - return altVal; - } else { - return def; - } - }; - - let _p = this._private = { - container: container, // html dom ele container - ready: false, // whether ready has been triggered - options: options, // cached options - elements: new Collection( this ), // elements in the graph - listeners: [], // list of listeners - aniEles: new Collection( this ), // elements being animated - scratch: {}, // scratch object for core - layout: null, - renderer: null, - destroyed: false, // whether destroy was called - notificationsEnabled: true, // whether notifications are sent to the renderer - minZoom: 1e-50, - maxZoom: 1e50, - zoomingEnabled: defVal( true, options.zoomingEnabled ), - userZoomingEnabled: defVal( true, options.userZoomingEnabled ), - panningEnabled: defVal( true, options.panningEnabled ), - userPanningEnabled: defVal( true, options.userPanningEnabled ), - boxSelectionEnabled: defVal( true, options.boxSelectionEnabled ), - autolock: defVal( false, options.autolock, options.autolockNodes ), - autoungrabify: defVal( false, options.autoungrabify, options.autoungrabifyNodes ), - autounselectify: defVal( false, options.autounselectify ), - styleEnabled: options.styleEnabled === undefined ? head : options.styleEnabled, - zoom: is.number( options.zoom ) ? options.zoom : 1, - pan: { - x: is.plainObject( options.pan ) && is.number( options.pan.x ) ? options.pan.x : 0, - y: is.plainObject( options.pan ) && is.number( options.pan.y ) ? options.pan.y : 0 - }, - animation: { // object for currently-running animations - current: [], - queue: [] - }, - hasCompoundNodes: false - }; - - this.createEmitter(); - - // set selection type - let selType = options.selectionType; - if( selType === undefined || (selType !== 'additive' && selType !== 'single') ){ - // then set default - - _p.selectionType = 'single'; - } else { - _p.selectionType = selType; - } - - // init zoom bounds - if( is.number( options.minZoom ) && is.number( options.maxZoom ) && options.minZoom < options.maxZoom ){ - _p.minZoom = options.minZoom; - _p.maxZoom = options.maxZoom; - } else if( is.number( options.minZoom ) && options.maxZoom === undefined ){ - _p.minZoom = options.minZoom; - } else if( is.number( options.maxZoom ) && options.minZoom === undefined ){ - _p.maxZoom = options.maxZoom; - } - - let loadExtData = function( extData, next ){ - let anyIsPromise = extData.some( is.promise ); - - if( anyIsPromise ){ - return Promise.all( extData ).then( next ); // load all data asynchronously, then exec rest of init - } else { - next( extData ); // exec synchronously for convenience - } - }; - - // start with the default stylesheet so we have something before loading an external stylesheet - if( _p.styleEnabled ){ - cy.setStyle([]); - } - - // create the renderer - cy.initRenderer( util.extend( { - hideEdgesOnViewport: options.hideEdgesOnViewport, - textureOnViewport: options.textureOnViewport, - wheelSensitivity: is.number( options.wheelSensitivity ) && options.wheelSensitivity > 0 ? options.wheelSensitivity : 1, - motionBlur: options.motionBlur === undefined ? false : options.motionBlur, // off by default - motionBlurOpacity: options.motionBlurOpacity === undefined ? 0.05 : options.motionBlurOpacity, - pixelRatio: is.number( options.pixelRatio ) && options.pixelRatio > 0 ? options.pixelRatio : undefined, - desktopTapThreshold: options.desktopTapThreshold === undefined ? 4 : options.desktopTapThreshold, - touchTapThreshold: options.touchTapThreshold === undefined ? 8 : options.touchTapThreshold - }, options.renderer ) ); - - let setElesAndLayout = function( elements, onload, ondone ){ - cy.notifications( false ); - - // remove old elements - let oldEles = cy.mutableElements(); - if( oldEles.length > 0 ){ - oldEles.remove(); - } - - if( elements != null ){ - if( is.plainObject( elements ) || is.array( elements ) ){ - cy.add( elements ); - } - } - - cy.one( 'layoutready', function( e ){ - cy.notifications( true ); - cy.emit( e ); // we missed this event by turning notifications off, so pass it on - - cy.notify( { - type: 'load', - eles: cy.mutableElements() - } ); - - cy.one( 'load', onload ); - cy.emit( 'load' ); - } ).one( 'layoutstop', function(){ - cy.one( 'done', ondone ); - cy.emit( 'done' ); - } ); - - let layoutOpts = util.extend( {}, cy._private.options.layout ); - layoutOpts.eles = cy.elements(); - - cy.layout( layoutOpts ).run(); - }; - - loadExtData([ options.style, options.elements ], function( thens ){ - let initStyle = thens[0]; - let initEles = thens[1]; - - // init style - if( _p.styleEnabled ){ - cy.style().append( initStyle ); - } - - // initial load - setElesAndLayout( initEles, function(){ // onready - cy.startAnimationLoop(); - _p.ready = true; - - // if a ready callback is specified as an option, the bind it - if( is.fn( options.ready ) ){ - cy.on( 'ready', options.ready ); - } - - // bind all the ready handlers registered before creating this instance - for( let i = 0; i < readies.length; i++ ){ - let fn = readies[ i ]; - cy.on( 'ready', fn ); - } - if( reg ){ reg.readies = []; } // clear b/c we've bound them all and don't want to keep it around in case a new core uses the same div etc - - cy.emit( 'ready' ); - }, options.done ); - - } ); -}; - -let corefn = Core.prototype; // short alias - -util.extend( corefn, { - instanceString: function(){ - return 'core'; - }, - - isReady: function(){ - return this._private.ready; - }, - - isDestroyed: function(){ - return this._private.destroyed; - }, - - ready: function( fn ){ - if( this.isReady() ){ - this.emitter().emit( 'ready', [], fn ); // just calls fn as though triggered via ready event - } else { - this.on( 'ready', fn ); - } - - return this; - }, - - destroy: function(){ - let cy = this; - if( cy.isDestroyed() ) return; - - cy.stopAnimationLoop(); - - cy.destroyRenderer(); - - this.emit( 'destroy' ); - - cy._private.destroyed = true; - - return cy; - }, - - hasElementWithId: function( id ){ - return this._private.elements.hasElementWithId( id ); - }, - - getElementById: function( id ){ - return this._private.elements.getElementById( id ); - }, - - selectionType: function(){ - return this._private.selectionType; - }, - - hasCompoundNodes: function(){ - return this._private.hasCompoundNodes; - }, - - headless: function(){ - return this._private.options.renderer.name === 'null'; - }, - - styleEnabled: function(){ - return this._private.styleEnabled; - }, - - addToPool: function( eles ){ - this._private.elements.merge( eles ); - - return this; // chaining - }, - - removeFromPool: function( eles ){ - this._private.elements.unmerge( eles ); - - return this; - }, - - container: function(){ - return this._private.container; - }, - - options: function(){ - return util.copy( this._private.options ); - }, - - json: function( obj ){ - let cy = this; - let _p = cy._private; - let eles = cy.mutableElements(); - - if( is.plainObject( obj ) ){ // set - - cy.startBatch(); - - if( obj.elements ){ - let idInJson = {}; - - let updateEles = function( jsons, gr ){ - for( let i = 0; i < jsons.length; i++ ){ - let json = jsons[ i ]; - let id = json.data.id; - let ele = cy.getElementById( id ); - - idInJson[ id ] = true; - - if( ele.length !== 0 ){ // existing element should be updated - ele.json( json ); - } else { // otherwise should be added - if( gr ){ - cy.add( util.extend( { group: gr }, json ) ); - } else { - cy.add( json ); - } - } - } - }; - - if( is.array( obj.elements ) ){ // elements: [] - updateEles( obj.elements ); - - } else { // elements: { nodes: [], edges: [] } - let grs = [ 'nodes', 'edges' ]; - for( let i = 0; i < grs.length; i++ ){ - let gr = grs[ i ]; - let elements = obj.elements[ gr ]; - - if( is.array( elements ) ){ - updateEles( elements, gr ); - } - } - } - - // elements not specified in json should be removed - eles.stdFilter( function( ele ){ - return !idInJson[ ele.id() ]; - } ).remove(); - } - - if( obj.style ){ - cy.style( obj.style ); - } - - if( obj.zoom != null && obj.zoom !== _p.zoom ){ - cy.zoom( obj.zoom ); - } - - if( obj.pan ){ - if( obj.pan.x !== _p.pan.x || obj.pan.y !== _p.pan.y ){ - cy.pan( obj.pan ); - } - } - - let fields = [ - 'minZoom', 'maxZoom', 'zoomingEnabled', 'userZoomingEnabled', - 'panningEnabled', 'userPanningEnabled', - 'boxSelectionEnabled', - 'autolock', 'autoungrabify', 'autounselectify' - ]; - - for( let i = 0; i < fields.length; i++ ){ - let f = fields[ i ]; - - if( obj[ f ] != null ){ - cy[ f ]( obj[ f ] ); - } - } - - cy.endBatch(); - - return this; // chaining - } else if( obj === undefined ){ // get - let json = {}; - - json.elements = {}; - eles.forEach( function( ele ){ - let group = ele.group(); - - if( !json.elements[ group ] ){ - json.elements[ group ] = []; - } - - json.elements[ group ].push( ele.json() ); - } ); - - if( this._private.styleEnabled ){ - json.style = cy.style().json(); - } - - json.zoomingEnabled = cy._private.zoomingEnabled; - json.userZoomingEnabled = cy._private.userZoomingEnabled; - json.zoom = cy._private.zoom; - json.minZoom = cy._private.minZoom; - json.maxZoom = cy._private.maxZoom; - json.panningEnabled = cy._private.panningEnabled; - json.userPanningEnabled = cy._private.userPanningEnabled; - json.pan = util.copy( cy._private.pan ); - json.boxSelectionEnabled = cy._private.boxSelectionEnabled; - json.renderer = util.copy( cy._private.options.renderer ); - json.hideEdgesOnViewport = cy._private.options.hideEdgesOnViewport; - json.textureOnViewport = cy._private.options.textureOnViewport; - json.wheelSensitivity = cy._private.options.wheelSensitivity; - json.motionBlur = cy._private.options.motionBlur; - - return json; - } - }, - - scratch: define.data( { - field: 'scratch', - bindingEvent: 'scratch', - allowBinding: true, - allowSetting: true, - settingEvent: 'scratch', - settingTriggersEvent: true, - triggerFnName: 'trigger', - allowGetting: true - } ), - - removeScratch: define.removeData( { - field: 'scratch', - event: 'scratch', - triggerFnName: 'trigger', - triggerEvent: true - } ) - -} ); - -corefn.$id = corefn.getElementById; - -[ - require( './add-remove' ), - require( './animation' ), - require( './events' ), - require( './export' ), - require( './layout' ), - require( './notification' ), - require( './renderer' ), - require( './search' ), - require( './style' ), - require( './viewport' ) -].forEach( function( props ){ - util.extend( corefn, props ); -} ); - -module.exports = Core; diff --git a/node_modules/cytoscape/src/core/layout.js b/node_modules/cytoscape/src/core/layout.js deleted file mode 100644 index 49cd9103a..000000000 --- a/node_modules/cytoscape/src/core/layout.js +++ /dev/null @@ -1,46 +0,0 @@ -let util = require( '../util' ); -let is = require( '../is' ); - -let corefn = ({ - - layout: function( options ){ - let cy = this; - - if( options == null ){ - util.error( 'Layout options must be specified to make a layout' ); - return; - } - - if( options.name == null ){ - util.error( 'A `name` must be specified to make a layout' ); - return; - } - - let name = options.name; - let Layout = cy.extension( 'layout', name ); - - if( Layout == null ){ - util.error( 'Can not apply layout: No such layout `' + name + '` found; did you include its JS file?' ); - return; - } - - let eles; - if( is.string( options.eles ) ){ - eles = cy.$( options.eles ); - } else { - eles = options.eles != null ? options.eles : cy.$(); - } - - let layout = new Layout( util.extend( {}, options, { - cy: cy, - eles: eles - } ) ); - - return layout; - } - -}); - -corefn.createLayout = corefn.makeLayout = corefn.layout; - -module.exports = corefn; diff --git a/node_modules/cytoscape/src/core/notification.js b/node_modules/cytoscape/src/core/notification.js deleted file mode 100644 index 112d05460..000000000 --- a/node_modules/cytoscape/src/core/notification.js +++ /dev/null @@ -1,118 +0,0 @@ -let corefn = ({ - notify: function( params ){ - let _p = this._private; - - if( _p.batchingNotify ){ - let bEles = _p.batchNotifyEles; - let bTypes = _p.batchNotifyTypes; - - if( params.eles ){ - bEles.merge( params.eles ); - } - - if( !bTypes.ids[ params.type ] ){ - bTypes.push( params.type ); - bTypes.ids[ params.type ] = true; - } - - return; // notifications are disabled during batching - } - - if( !_p.notificationsEnabled ){ return; } // exit on disabled - - let renderer = this.renderer(); - - // exit if destroy() called on core or renderer in between frames #1499 #1528 - if( this.isDestroyed() || !renderer ){ return; } - - renderer.notify( params ); - }, - - notifications: function( bool ){ - let p = this._private; - - if( bool === undefined ){ - return p.notificationsEnabled; - } else { - p.notificationsEnabled = bool ? true : false; - } - }, - - noNotifications: function( callback ){ - this.notifications( false ); - callback(); - this.notifications( true ); - }, - - batching: function(){ - return this._private.batchCount > 0; - }, - - startBatch: function(){ - let _p = this._private; - - if( _p.batchCount == null ){ - _p.batchCount = 0; - } - - if( _p.batchCount === 0 ){ - _p.batchingStyle = _p.batchingNotify = true; - _p.batchStyleEles = this.collection(); - _p.batchNotifyEles = this.collection(); - _p.batchNotifyTypes = []; - _p.batchNotifyTypes.ids = {}; - } - - _p.batchCount++; - - return this; - }, - - endBatch: function(){ - let _p = this._private; - - _p.batchCount--; - - if( _p.batchCount === 0 ){ - // update style for dirty eles - _p.batchingStyle = false; - _p.batchStyleEles.updateStyle(); - - // notify the renderer of queued eles and event types - _p.batchingNotify = false; - this.notify( { - type: _p.batchNotifyTypes, - eles: _p.batchNotifyEles - } ); - } - - return this; - }, - - batch: function( callback ){ - this.startBatch(); - callback(); - this.endBatch(); - - return this; - }, - - // for backwards compatibility - batchData: function( map ){ - let cy = this; - - return this.batch( function(){ - let ids = Object.keys( map ); - - for( let i = 0; i < ids.length; i++ ){ - let id = ids[i]; - let data = map[ id ]; - let ele = cy.getElementById( id ); - - ele.data( data ); - } - } ); - } -}); - -module.exports = corefn; diff --git a/node_modules/cytoscape/src/core/renderer.js b/node_modules/cytoscape/src/core/renderer.js deleted file mode 100644 index 7d9c40966..000000000 --- a/node_modules/cytoscape/src/core/renderer.js +++ /dev/null @@ -1,79 +0,0 @@ -let util = require( '../util' ); - -let corefn = ({ - - renderTo: function( context, zoom, pan, pxRatio ){ - let r = this._private.renderer; - - r.renderTo( context, zoom, pan, pxRatio ); - return this; - }, - - renderer: function(){ - return this._private.renderer; - }, - - forceRender: function(){ - this.notify( { - type: 'draw' - } ); - - return this; - }, - - resize: function(){ - this.invalidateSize(); - - this.notify( { - type: 'resize' - } ); - - this.emit( 'resize' ); - - return this; - }, - - initRenderer: function( options ){ - let cy = this; - - let RendererProto = cy.extension( 'renderer', options.name ); - if( RendererProto == null ){ - util.error( 'Can not initialise: No such renderer `%s` found; did you include its JS file?', options.name ); - return; - } - - cy._private.renderer = new RendererProto( util.extend( {}, options, { cy } ) ); - - this.notify({ type: 'init' }); - }, - - destroyRenderer: function(){ - let cy = this; - - cy.notify( { type: 'destroy' } ); // destroy the renderer - - let domEle = cy.container(); - if( domEle ){ - domEle._cyreg = null; - - while( domEle.childNodes.length > 0 ){ - domEle.removeChild( domEle.childNodes[0] ); - } - } - - cy._private.renderer = null; // to be extra safe, remove the ref - }, - - onRender: function( fn ){ - return this.on('render', fn); - }, - - offRender: function( fn ){ - return this.off('render', fn); - } - -}); - -corefn.invalidateDimensions = corefn.resize; - -module.exports = corefn; diff --git a/node_modules/cytoscape/src/core/search.js b/node_modules/cytoscape/src/core/search.js deleted file mode 100644 index 9839ab949..000000000 --- a/node_modules/cytoscape/src/core/search.js +++ /dev/null @@ -1,69 +0,0 @@ -let is = require( '../is' ); -let Collection = require( '../collection' ); - -let corefn = ({ - - // get a collection - // - empty collection on no args - // - collection of elements in the graph on selector arg - // - guarantee a returned collection when elements or collection specified - collection: function( eles, opts ){ - - if( is.string( eles ) ){ - return this.$( eles ); - - } else if( is.elementOrCollection( eles ) ){ - return eles.collection(); - - } else if( is.array( eles ) ){ - return new Collection( this, eles, opts ); - } - - return new Collection( this ); - }, - - nodes: function( selector ){ - let nodes = this.$( function( ele ){ - return ele.isNode(); - } ); - - if( selector ){ - return nodes.filter( selector ); - } - - return nodes; - }, - - edges: function( selector ){ - let edges = this.$( function( ele ){ - return ele.isEdge(); - } ); - - if( selector ){ - return edges.filter( selector ); - } - - return edges; - }, - - // search the graph like jQuery - $: function( selector ){ - let eles = this._private.elements; - - if( selector ){ - return eles.filter( selector ); - } else { - return eles.spawnSelf(); - } - }, - - mutableElements: function(){ - return this._private.elements; - } - -}); - -// aliases -corefn.elements = corefn.filter = corefn.$; - -module.exports = corefn; diff --git a/node_modules/cytoscape/src/core/style.js b/node_modules/cytoscape/src/core/style.js deleted file mode 100644 index 679093edb..000000000 --- a/node_modules/cytoscape/src/core/style.js +++ /dev/null @@ -1,36 +0,0 @@ -let is = require( '../is' ); -let Style = require( '../style' ); - -let corefn = ({ - - style: function( newStyle ){ - if( newStyle ){ - let s = this.setStyle( newStyle ); - - s.update(); - } - - return this._private.style; - }, - - setStyle: function( style ){ - let _p = this._private; - - if( is.stylesheet( style ) ){ - _p.style = style.generateStyle( this ); - - } else if( is.array( style ) ){ - _p.style = Style.fromJson( this, style ); - - } else if( is.string( style ) ){ - _p.style = Style.fromString( this, style ); - - } else { - _p.style = Style( this ); - } - - return _p.style; - } -}); - -module.exports = corefn; diff --git a/node_modules/cytoscape/src/core/viewport.js b/node_modules/cytoscape/src/core/viewport.js deleted file mode 100644 index 67789ef55..000000000 --- a/node_modules/cytoscape/src/core/viewport.js +++ /dev/null @@ -1,573 +0,0 @@ -let is = require('../is'); -let window = require('../window'); -let math = require('../math'); - -let corefn = ({ - - autolock: function( bool ){ - if( bool !== undefined ){ - this._private.autolock = bool ? true : false; - } else { - return this._private.autolock; - } - - return this; // chaining - }, - - autoungrabify: function( bool ){ - if( bool !== undefined ){ - this._private.autoungrabify = bool ? true : false; - } else { - return this._private.autoungrabify; - } - - return this; // chaining - }, - - autounselectify: function( bool ){ - if( bool !== undefined ){ - this._private.autounselectify = bool ? true : false; - } else { - return this._private.autounselectify; - } - - return this; // chaining - }, - - panningEnabled: function( bool ){ - if( bool !== undefined ){ - this._private.panningEnabled = bool ? true : false; - } else { - return this._private.panningEnabled; - } - - return this; // chaining - }, - - userPanningEnabled: function( bool ){ - if( bool !== undefined ){ - this._private.userPanningEnabled = bool ? true : false; - } else { - return this._private.userPanningEnabled; - } - - return this; // chaining - }, - - zoomingEnabled: function( bool ){ - if( bool !== undefined ){ - this._private.zoomingEnabled = bool ? true : false; - } else { - return this._private.zoomingEnabled; - } - - return this; // chaining - }, - - userZoomingEnabled: function( bool ){ - if( bool !== undefined ){ - this._private.userZoomingEnabled = bool ? true : false; - } else { - return this._private.userZoomingEnabled; - } - - return this; // chaining - }, - - boxSelectionEnabled: function( bool ){ - if( bool !== undefined ){ - this._private.boxSelectionEnabled = bool ? true : false; - } else { - return this._private.boxSelectionEnabled; - } - - return this; // chaining - }, - - pan: function(){ - let args = arguments; - let pan = this._private.pan; - let dim, val, dims, x, y; - - switch( args.length ){ - case 0: // .pan() - return pan; - - case 1: - - if( is.string( args[0] ) ){ // .pan('x') - dim = args[0]; - return pan[ dim ]; - - } else if( is.plainObject( args[0] ) ){ // .pan({ x: 0, y: 100 }) - if( !this._private.panningEnabled ){ - return this; - } - - dims = args[0]; - x = dims.x; - y = dims.y; - - if( is.number( x ) ){ - pan.x = x; - } - - if( is.number( y ) ){ - pan.y = y; - } - - this.emit( 'pan viewport' ); - } - break; - - case 2: // .pan('x', 100) - if( !this._private.panningEnabled ){ - return this; - } - - dim = args[0]; - val = args[1]; - - if( (dim === 'x' || dim === 'y') && is.number( val ) ){ - pan[ dim ] = val; - } - - this.emit( 'pan viewport' ); - break; - - default: - break; // invalid - } - - this.notify( { // notify the renderer that the viewport changed - type: 'viewport' - } ); - - return this; // chaining - }, - - panBy: function( arg0, arg1 ){ - let args = arguments; - let pan = this._private.pan; - let dim, val, dims, x, y; - - if( !this._private.panningEnabled ){ - return this; - } - - switch( args.length ){ - case 1: - - if( is.plainObject( arg0 ) ){ // .panBy({ x: 0, y: 100 }) - dims = args[0]; - x = dims.x; - y = dims.y; - - if( is.number( x ) ){ - pan.x += x; - } - - if( is.number( y ) ){ - pan.y += y; - } - - this.emit( 'pan viewport' ); - } - break; - - case 2: // .panBy('x', 100) - dim = arg0; - val = arg1; - - if( (dim === 'x' || dim === 'y') && is.number( val ) ){ - pan[ dim ] += val; - } - - this.emit( 'pan viewport' ); - break; - - default: - break; // invalid - } - - this.notify( { // notify the renderer that the viewport changed - type: 'viewport' - } ); - - return this; // chaining - }, - - fit: function( elements, padding ){ - let viewportState = this.getFitViewport( elements, padding ); - - if( viewportState ){ - let _p = this._private; - _p.zoom = viewportState.zoom; - _p.pan = viewportState.pan; - - this.emit( 'pan zoom viewport' ); - - this.notify( { // notify the renderer that the viewport changed - type: 'viewport' - } ); - } - - return this; // chaining - }, - - getFitViewport: function( elements, padding ){ - if( is.number( elements ) && padding === undefined ){ // elements is optional - padding = elements; - elements = undefined; - } - - if( !this._private.panningEnabled || !this._private.zoomingEnabled ){ - return; - } - - let bb; - - if( is.string( elements ) ){ - let sel = elements; - elements = this.$( sel ); - - } else if( is.boundingBox( elements ) ){ // assume bb - let bbe = elements; - bb = { - x1: bbe.x1, - y1: bbe.y1, - x2: bbe.x2, - y2: bbe.y2 - }; - - bb.w = bb.x2 - bb.x1; - bb.h = bb.y2 - bb.y1; - - } else if( !is.elementOrCollection( elements ) ){ - elements = this.mutableElements(); - } - - if( is.elementOrCollection( elements ) && elements.empty() ){ return; } // can't fit to nothing - - bb = bb || elements.boundingBox(); - - let w = this.width(); - let h = this.height(); - let zoom; - padding = is.number( padding ) ? padding : 0; - - if( !isNaN( w ) && !isNaN( h ) && w > 0 && h > 0 && !isNaN( bb.w ) && !isNaN( bb.h ) && bb.w > 0 && bb.h > 0 ){ - zoom = Math.min( (w - 2 * padding) / bb.w, (h - 2 * padding) / bb.h ); - - // crop zoom - zoom = zoom > this._private.maxZoom ? this._private.maxZoom : zoom; - zoom = zoom < this._private.minZoom ? this._private.minZoom : zoom; - - let pan = { // now pan to middle - x: (w - zoom * ( bb.x1 + bb.x2 )) / 2, - y: (h - zoom * ( bb.y1 + bb.y2 )) / 2 - }; - - return { - zoom: zoom, - pan: pan - }; - } - - return; - }, - - minZoom: function( zoom ){ - if( zoom === undefined ){ - return this._private.minZoom; - } else if( is.number( zoom ) ){ - this._private.minZoom = zoom; - } - - return this; - }, - - maxZoom: function( zoom ){ - if( zoom === undefined ){ - return this._private.maxZoom; - } else if( is.number( zoom ) ){ - this._private.maxZoom = zoom; - } - - return this; - }, - - getZoomedViewport: function( params ){ - let _p = this._private; - let currentPan = _p.pan; - let currentZoom = _p.zoom; - let pos; // in rendered px - let zoom; - let bail = false; - - if( !_p.zoomingEnabled ){ // zooming disabled - bail = true; - } - - if( is.number( params ) ){ // then set the zoom - zoom = params; - - } else if( is.plainObject( params ) ){ // then zoom about a point - zoom = params.level; - - if( params.position != null ){ - pos = math.modelToRenderedPosition( params.position, currentZoom, currentPan ); - } else if( params.renderedPosition != null ){ - pos = params.renderedPosition; - } - - if( pos != null && !_p.panningEnabled ){ // panning disabled - bail = true; - } - } - - // crop zoom - zoom = zoom > _p.maxZoom ? _p.maxZoom : zoom; - zoom = zoom < _p.minZoom ? _p.minZoom : zoom; - - // can't zoom with invalid params - if( bail || !is.number( zoom ) || zoom === currentZoom || ( pos != null && (!is.number( pos.x ) || !is.number( pos.y )) ) ){ - return null; - } - - if( pos != null ){ // set zoom about position - let pan1 = currentPan; - let zoom1 = currentZoom; - let zoom2 = zoom; - - let pan2 = { - x: -zoom2 / zoom1 * (pos.x - pan1.x) + pos.x, - y: -zoom2 / zoom1 * (pos.y - pan1.y) + pos.y - }; - - return { - zoomed: true, - panned: true, - zoom: zoom2, - pan: pan2 - }; - - } else { // just set the zoom - return { - zoomed: true, - panned: false, - zoom: zoom, - pan: currentPan - }; - } - }, - - zoom: function( params ){ - if( params === undefined ){ // get - return this._private.zoom; - } else { // set - let vp = this.getZoomedViewport( params ); - let _p = this._private; - - if( vp == null || !vp.zoomed ){ return this; } - - _p.zoom = vp.zoom; - - if( vp.panned ){ - _p.pan.x = vp.pan.x; - _p.pan.y = vp.pan.y; - } - - this.emit( 'zoom' + ( vp.panned ? ' pan' : '' ) + ' viewport' ); - - this.notify( { // notify the renderer that the viewport changed - type: 'viewport' - } ); - - return this; // chaining - } - }, - - viewport: function( opts ){ - let _p = this._private; - let zoomDefd = true; - let panDefd = true; - let events = []; // to trigger - let zoomFailed = false; - let panFailed = false; - - if( !opts ){ return this; } - if( !is.number( opts.zoom ) ){ zoomDefd = false; } - if( !is.plainObject( opts.pan ) ){ panDefd = false; } - if( !zoomDefd && !panDefd ){ return this; } - - if( zoomDefd ){ - let z = opts.zoom; - - if( z < _p.minZoom || z > _p.maxZoom || !_p.zoomingEnabled ){ - zoomFailed = true; - - } else { - _p.zoom = z; - - events.push( 'zoom' ); - } - } - - if( panDefd && (!zoomFailed || !opts.cancelOnFailedZoom) && _p.panningEnabled ){ - let p = opts.pan; - - if( is.number( p.x ) ){ - _p.pan.x = p.x; - panFailed = false; - } - - if( is.number( p.y ) ){ - _p.pan.y = p.y; - panFailed = false; - } - - if( !panFailed ){ - events.push( 'pan' ); - } - } - - if( events.length > 0 ){ - events.push( 'viewport' ); - this.emit( events.join( ' ' ) ); - - this.notify( { - type: 'viewport' - } ); - } - - return this; // chaining - }, - - center: function( elements ){ - let pan = this.getCenterPan( elements ); - - if( pan ){ - this._private.pan = pan; - - this.emit( 'pan viewport' ); - - this.notify( { // notify the renderer that the viewport changed - type: 'viewport' - } ); - } - - return this; // chaining - }, - - getCenterPan: function( elements, zoom ){ - if( !this._private.panningEnabled ){ - return; - } - - if( is.string( elements ) ){ - let selector = elements; - elements = this.mutableElements().filter( selector ); - } else if( !is.elementOrCollection( elements ) ){ - elements = this.mutableElements(); - } - - if( elements.length === 0 ){ return; } // can't centre pan to nothing - - let bb = elements.boundingBox(); - let w = this.width(); - let h = this.height(); - zoom = zoom === undefined ? this._private.zoom : zoom; - - let pan = { // middle - x: (w - zoom * ( bb.x1 + bb.x2 )) / 2, - y: (h - zoom * ( bb.y1 + bb.y2 )) / 2 - }; - - return pan; - }, - - reset: function(){ - if( !this._private.panningEnabled || !this._private.zoomingEnabled ){ - return this; - } - - this.viewport( { - pan: { x: 0, y: 0 }, - zoom: 1 - } ); - - return this; // chaining - }, - - invalidateSize: function(){ - this._private.sizeCache = null; - }, - - size: function(){ - let _p = this._private; - let container = _p.container; - - return ( _p.sizeCache = _p.sizeCache || ( container ? (function(){ - let style = window.getComputedStyle( container ); - let val = function( name ){ return parseFloat( style.getPropertyValue( name ) ); }; - - return { - width: container.clientWidth - val('padding-left') - val('padding-right'), - height: container.clientHeight - val('padding-top') - val('padding-bottom') - }; - })() : { // fallback if no container (not 0 b/c can be used for dividing etc) - width: 1, - height: 1 - } ) ); - }, - - width: function(){ - return this.size().width; - }, - - height: function(){ - return this.size().height; - }, - - extent: function(){ - let pan = this._private.pan; - let zoom = this._private.zoom; - let rb = this.renderedExtent(); - - let b = { - x1: ( rb.x1 - pan.x ) / zoom, - x2: ( rb.x2 - pan.x ) / zoom, - y1: ( rb.y1 - pan.y ) / zoom, - y2: ( rb.y2 - pan.y ) / zoom - }; - - b.w = b.x2 - b.x1; - b.h = b.y2 - b.y1; - - return b; - }, - - renderedExtent: function(){ - let width = this.width(); - let height = this.height(); - - return { - x1: 0, - y1: 0, - x2: width, - y2: height, - w: width, - h: height - }; - } -}); - -// aliases -corefn.centre = corefn.center; - -// backwards compatibility -corefn.autolockNodes = corefn.autolock; -corefn.autoungrabifyNodes = corefn.autoungrabify; - -module.exports = corefn; diff --git a/node_modules/cytoscape/src/define/animation.js b/node_modules/cytoscape/src/define/animation.js deleted file mode 100644 index 13c47d440..000000000 --- a/node_modules/cytoscape/src/define/animation.js +++ /dev/null @@ -1,240 +0,0 @@ -let util = require( '../util' ); -let Animation = require( '../animation' ); -let math = require('../math'); -let is = require('../is'); - -let define = { - - animated: function(){ - return function animatedImpl(){ - let self = this; - let selfIsArrayLike = self.length !== undefined; - let all = selfIsArrayLike ? self : [ self ]; // put in array if not array-like - let cy = this._private.cy || this; - - if( !cy.styleEnabled() ){ return false; } - - let ele = all[0]; - - if( ele ){ - return ele._private.animation.current.length > 0; - } - }; - }, // animated - - clearQueue: function(){ - return function clearQueueImpl(){ - let self = this; - let selfIsArrayLike = self.length !== undefined; - let all = selfIsArrayLike ? self : [ self ]; // put in array if not array-like - let cy = this._private.cy || this; - - if( !cy.styleEnabled() ){ return this; } - - for( let i = 0; i < all.length; i++ ){ - let ele = all[ i ]; - ele._private.animation.queue = []; - } - - return this; - }; - }, // clearQueue - - delay: function(){ - return function delayImpl( time, complete ){ - let cy = this._private.cy || this; - - if( !cy.styleEnabled() ){ return this; } - - return this.animate( { - delay: time, - duration: time, - complete: complete - } ); - }; - }, // delay - - delayAnimation: function(){ - return function delayAnimationImpl( time, complete ){ - let cy = this._private.cy || this; - - if( !cy.styleEnabled() ){ return this; } - - return this.animation( { - delay: time, - duration: time, - complete: complete - } ); - }; - }, // delay - - animation: function(){ - return function animationImpl( properties, params ){ - let self = this; - let selfIsArrayLike = self.length !== undefined; - let all = selfIsArrayLike ? self : [ self ]; // put in array if not array-like - let cy = this._private.cy || this; - let isCore = !selfIsArrayLike; - let isEles = !isCore; - - if( !cy.styleEnabled() ){ return this; } - - let style = cy.style(); - - properties = util.assign( {}, properties, params ); - - let propertiesEmpty = Object.keys( properties ).length === 0; - - if( propertiesEmpty ){ - return new Animation( all[0], properties ); // nothing to animate - } - - if( properties.duration === undefined ){ - properties.duration = 400; - } - - switch( properties.duration ){ - case 'slow': - properties.duration = 600; - break; - case 'fast': - properties.duration = 200; - break; - } - - if( isEles ){ - properties.style = style.getPropsList( properties.style || properties.css ); - - properties.css = undefined; - } - - if( isEles && properties.renderedPosition != null ){ - let rpos = properties.renderedPosition; - let pan = cy.pan(); - let zoom = cy.zoom(); - - properties.position = math.renderedToModelPosition( rpos, zoom, pan ); - } - - // override pan w/ panBy if set - if( isCore && properties.panBy != null ){ - let panBy = properties.panBy; - let cyPan = cy.pan(); - - properties.pan = { - x: cyPan.x + panBy.x, - y: cyPan.y + panBy.y - }; - } - - // override pan w/ center if set - let center = properties.center || properties.centre; - if( isCore && center != null ){ - let centerPan = cy.getCenterPan( center.eles, properties.zoom ); - - if( centerPan != null ){ - properties.pan = centerPan; - } - } - - // override pan & zoom w/ fit if set - if( isCore && properties.fit != null ){ - let fit = properties.fit; - let fitVp = cy.getFitViewport( fit.eles || fit.boundingBox, fit.padding ); - - if( fitVp != null ){ - properties.pan = fitVp.pan; - properties.zoom = fitVp.zoom; - } - } - - // override zoom (& potentially pan) w/ zoom obj if set - if( isCore && is.plainObject( properties.zoom ) ){ - let vp = cy.getZoomedViewport( properties.zoom ); - - if( vp != null ){ - if( vp.zoomed ){ properties.zoom = vp.zoom; } - - if( vp.panned ){ properties.pan = vp.pan; } - } - } - - return new Animation( all[0], properties ); - }; - }, // animate - - animate: function(){ - return function animateImpl( properties, params ){ - let self = this; - let selfIsArrayLike = self.length !== undefined; - let all = selfIsArrayLike ? self : [ self ]; // put in array if not array-like - let cy = this._private.cy || this; - - if( !cy.styleEnabled() ){ return this; } - - if( params ){ - properties = util.extend( {}, properties, params ); - } - - // manually hook and run the animation - for( let i = 0; i < all.length; i++ ){ - let ele = all[ i ]; - let queue = ele.animated() && (properties.queue === undefined || properties.queue); - - let ani = ele.animation( properties, (queue ? { queue: true } : undefined) ); - - ani.play(); - } - - return this; // chaining - }; - }, // animate - - stop: function(){ - return function stopImpl( clearQueue, jumpToEnd ){ - let self = this; - let selfIsArrayLike = self.length !== undefined; - let all = selfIsArrayLike ? self : [ self ]; // put in array if not array-like - let cy = this._private.cy || this; - - if( !cy.styleEnabled() ){ return this; } - - for( let i = 0; i < all.length; i++ ){ - let ele = all[ i ]; - let _p = ele._private; - let anis = _p.animation.current; - - for( let j = 0; j < anis.length; j++ ){ - let ani = anis[ j ]; - let ani_p = ani._private; - - if( jumpToEnd ){ - // next iteration of the animation loop, the animation - // will go straight to the end and be removed - ani_p.duration = 0; - } - } - - // clear the queue of future animations - if( clearQueue ){ - _p.animation.queue = []; - } - - if( !jumpToEnd ){ - _p.animation.current = []; - } - } - - // we have to notify (the animation loop doesn't do it for us on `stop`) - cy.notify( { - eles: this, - type: 'draw' - } ); - - return this; - }; - } // stop - -}; // define - -module.exports = define; diff --git a/node_modules/cytoscape/src/define/data.js b/node_modules/cytoscape/src/define/data.js deleted file mode 100644 index bbdc4b0c1..000000000 --- a/node_modules/cytoscape/src/define/data.js +++ /dev/null @@ -1,194 +0,0 @@ -let util = require( '../util' ); -let is = require( '../is' ); - -let define = { - - // access data field - data: function( params ){ - let defaults = { - field: 'data', - bindingEvent: 'data', - allowBinding: false, - allowSetting: false, - allowGetting: false, - settingEvent: 'data', - settingTriggersEvent: false, - triggerFnName: 'trigger', - immutableKeys: {}, // key => true if immutable - updateStyle: false, - beforeGet: function( self ){}, - beforeSet: function( self, obj ){}, - onSet: function( self ){}, - canSet: function( self ){ return true; } - }; - params = util.extend( {}, defaults, params ); - - return function dataImpl( name, value ){ - let p = params; - let self = this; - let selfIsArrayLike = self.length !== undefined; - let all = selfIsArrayLike ? self : [ self ]; // put in array if not array-like - let single = selfIsArrayLike ? self[0] : self; - - // .data('foo', ...) - if( is.string( name ) ){ // set or get property - - // .data('foo') - if( p.allowGetting && value === undefined ){ // get - - let ret; - if( single ){ - p.beforeGet( single ); - - ret = single._private[ p.field ][ name ]; - } - return ret; - - // .data('foo', 'bar') - } else if( p.allowSetting && value !== undefined ){ // set - let valid = !p.immutableKeys[ name ]; - if( valid ){ - let change = { [name]: value }; - - p.beforeSet( self, change ); - - for( let i = 0, l = all.length; i < l; i++ ){ - let ele = all[i]; - - if( p.canSet( ele ) ){ - ele._private[ p.field ][ name ] = value; - } - } - - // update mappers if asked - if( p.updateStyle ){ self.updateStyle(); } - - // call onSet callback - p.onSet( self ); - - if( p.settingTriggersEvent ){ - self[ p.triggerFnName ]( p.settingEvent ); - } - } - } - - // .data({ 'foo': 'bar' }) - } else if( p.allowSetting && is.plainObject( name ) ){ // extend - let obj = name; - let k, v; - let keys = Object.keys( obj ); - - p.beforeSet( self, obj ); - - for( let i = 0; i < keys.length; i++ ){ - k = keys[ i ]; - v = obj[ k ]; - - let valid = !p.immutableKeys[ k ]; - if( valid ){ - for( let j = 0; j < all.length; j++ ){ - let ele = all[j]; - - if( p.canSet( ele ) ){ - ele._private[ p.field ][ k ] = v; - } - } - } - } - - // update mappers if asked - if( p.updateStyle ){ self.updateStyle(); } - - // call onSet callback - p.onSet( self ); - - if( p.settingTriggersEvent ){ - self[ p.triggerFnName ]( p.settingEvent ); - } - - // .data(function(){ ... }) - } else if( p.allowBinding && is.fn( name ) ){ // bind to event - let fn = name; - self.on( p.bindingEvent, fn ); - - // .data() - } else if( p.allowGetting && name === undefined ){ // get whole object - let ret; - if( single ){ - p.beforeGet( single ); - - ret = single._private[ p.field ]; - } - return ret; - } - - return self; // maintain chainability - }; // function - }, // data - - // remove data field - removeData: function( params ){ - let defaults = { - field: 'data', - event: 'data', - triggerFnName: 'trigger', - triggerEvent: false, - immutableKeys: {} // key => true if immutable - }; - params = util.extend( {}, defaults, params ); - - return function removeDataImpl( names ){ - let p = params; - let self = this; - let selfIsArrayLike = self.length !== undefined; - let all = selfIsArrayLike ? self : [ self ]; // put in array if not array-like - - // .removeData('foo bar') - if( is.string( names ) ){ // then get the list of keys, and delete them - let keys = names.split( /\s+/ ); - let l = keys.length; - - for( let i = 0; i < l; i++ ){ // delete each non-empty key - let key = keys[ i ]; - if( is.emptyString( key ) ){ continue; } - - let valid = !p.immutableKeys[ key ]; // not valid if immutable - if( valid ){ - for( let i_a = 0, l_a = all.length; i_a < l_a; i_a++ ){ - all[ i_a ]._private[ p.field ][ key ] = undefined; - } - } - } - - if( p.triggerEvent ){ - self[ p.triggerFnName ]( p.event ); - } - - // .removeData() - } else if( names === undefined ){ // then delete all keys - - for( let i_a = 0, l_a = all.length; i_a < l_a; i_a++ ){ - let _privateFields = all[ i_a ]._private[ p.field ]; - let keys = Object.keys( _privateFields ); - - for( let i = 0; i < keys.length; i++ ){ - let key = keys[i]; - let validKeyToDelete = !p.immutableKeys[ key ]; - - if( validKeyToDelete ){ - _privateFields[ key ] = undefined; - } - } - } - - if( p.triggerEvent ){ - self[ p.triggerFnName ]( p.event ); - } - } - - return self; // maintain chaining - }; // function - }, // removeData -}; // define - -module.exports = define; diff --git a/node_modules/cytoscape/src/define/events.js b/node_modules/cytoscape/src/define/events.js deleted file mode 100644 index 4d96b84f0..000000000 --- a/node_modules/cytoscape/src/define/events.js +++ /dev/null @@ -1,34 +0,0 @@ -let Promise = require( '../promise' ); - -let define = { - - eventAliasesOn: function( proto ){ - let p = proto; - - p.addListener = p.listen = p.bind = p.on; - p.unlisten = p.unbind = p.off = p.removeListener; - p.trigger = p.emit; - - // this is just a wrapper alias of .on() - p.pon = p.promiseOn = function( events, selector ){ - let self = this; - let args = Array.prototype.slice.call( arguments, 0 ); - - return new Promise( function( resolve, reject ){ - let callback = function( e ){ - self.off.apply( self, offArgs ); - - resolve( e ); - }; - - let onArgs = args.concat( [ callback ] ); - let offArgs = onArgs.concat( [] ); - - self.on.apply( self, onArgs ); - } ); - }; - }, - -}; // define - -module.exports = define; diff --git a/node_modules/cytoscape/src/define/index.js b/node_modules/cytoscape/src/define/index.js deleted file mode 100644 index 24404a225..000000000 --- a/node_modules/cytoscape/src/define/index.js +++ /dev/null @@ -1,19 +0,0 @@ -// use this module to cherry pick functions into your prototype -// (useful for functions shared between the core and collections, for example) - -// e.g. -// let foo = define.foo({ /* params... */ }) - -let util = require('../util'); - -let define = {}; - -[ - require('./animation'), - require('./data'), - require('./events') -].forEach(function( m ){ - util.assign( define, m ); -}); - -module.exports = define; diff --git a/node_modules/cytoscape/src/emitter.js b/node_modules/cytoscape/src/emitter.js deleted file mode 100644 index 8ee108269..000000000 --- a/node_modules/cytoscape/src/emitter.js +++ /dev/null @@ -1,226 +0,0 @@ -const util = require('./util'); -const is = require('./is'); -const Event = require('./event'); - -const eventRegex = /^([^.]+)(\.(?:[^.]+))?$/; // regex for matching event strings (e.g. "click.namespace") -const universalNamespace = '.*'; // matches as if no namespace specified and prevents users from unbinding accidentally - -const defaults = { - qualifierCompare: function( q1, q2 ){ - return q1 === q2; - }, - eventMatches: function( /*context, listener, eventObj*/ ){ - return true; - }, - eventFields: function( /*context*/ ){ - return {}; - }, - callbackContext: function( context/*, listener, eventObj*/ ){ - return context; - }, - beforeEmit: function(/* context, listener, eventObj */){ - }, - afterEmit: function(/* context, listener, eventObj */){ - }, - bubble: function( /*context*/ ){ - return false; - }, - parent: function( /*context*/ ){ - return null; - }, - context: this -}; - -function Emitter( opts ){ - util.assign( this, defaults, opts ); - - this.listeners = []; - this.emitting = 0; -} - -let p = Emitter.prototype; - -let forEachEvent = function( self, handler, events, qualifier, callback, conf, confOverrides ){ - if( is.fn( qualifier ) ){ - callback = qualifier; - qualifier = null; - } - - if( confOverrides ){ - if( conf == null ){ - conf = confOverrides; - } else { - conf = util.assign( {}, conf, confOverrides ); - } - } - - let eventList = events.split(/\s+/); - - for( let i = 0; i < eventList.length; i++ ){ - let evt = eventList[i]; - - if( is.emptyString( evt ) ){ continue; } - - let match = evt.match( eventRegex ); // type[.namespace] - - if( match ){ - let type = match[1]; - let namespace = match[2] ? match[2] : null; - let ret = handler( self, evt, type, namespace, qualifier, callback, conf ); - - if( ret === false ){ break; } // allow exiting early - } - } -}; - -let makeEventObj = function( self, obj ){ - return new Event( obj.type, util.assign( obj, self.eventFields( self.context ) ) ); -}; - -let forEachEventObj = function( self, handler, events ){ - if( is.event( events ) ){ - handler( self, events ); - - return; - } else if( is.plainObject( events ) ){ - handler( self, makeEventObj( self, events ) ); - - return; - } - - let eventList = events.split(/\s+/); - - for( let i = 0; i < eventList.length; i++ ){ - let evt = eventList[i]; - - if( is.emptyString( evt ) ){ continue; } - - let match = evt.match( eventRegex ); // type[.namespace] - - if( match ){ - let type = match[1]; - let namespace = match[2] ? match[2] : null; - let eventObj = makeEventObj( self, { - type: type, - namespace: namespace, - target: self.context - } ); - - handler( self, eventObj ); - } - } -}; - -p.on = p.addListener = function( events, qualifier, callback, conf, confOverrides ){ - forEachEvent( this, function( self, event, type, namespace, qualifier, callback, conf ){ - if( is.fn( callback ) ){ - self.listeners.push( { - event: event, // full event string - callback: callback, // callback to run - type: type, // the event type (e.g. 'click') - namespace: namespace, // the event namespace (e.g. ".foo") - qualifier: qualifier, // a restriction on whether to match this emitter - conf: conf // additional configuration - } ); - } - }, events, qualifier, callback, conf, confOverrides ); - - return this; -}; - -p.one = function( events, qualifier, callback, conf ){ - return this.on( events, qualifier, callback, conf, { one: true } ); -}; - -p.removeListener = p.off = function( events, qualifier, callback, conf ){ - if( this.emitting !== 0 ){ - this.listeners = util.copyArray( this.listeners ); - } - - let listeners = this.listeners; - - for( let i = listeners.length - 1; i >= 0; i-- ){ - let listener = listeners[i]; - - forEachEvent( this, function( self, event, type, namespace, qualifier, callback/*, conf*/ ){ - if( - ( listener.type === type ) && - ( !namespace || listener.namespace === namespace ) && - ( !qualifier || self.qualifierCompare( listener.qualifier, qualifier ) ) && - ( !callback || listener.callback === callback ) - ){ - listeners.splice( i, 1 ); - - return false; - } - }, events, qualifier, callback, conf ); - } - - return this; -}; - -p.emit = p.trigger = function( events, extraParams, manualCallback ){ - let listeners = this.listeners; - let numListenersBeforeEmit = listeners.length; - - this.emitting++; - - if( !is.array( extraParams ) ){ - extraParams = [ extraParams ]; - } - - forEachEventObj( this, function( self, eventObj ){ - if( manualCallback != null ){ - listeners = [{ - event: eventObj.event, - type: eventObj.type, - namespace: eventObj.namespace, - callback: manualCallback - }]; - - numListenersBeforeEmit = listeners.length; - } - - for( let i = 0; i < numListenersBeforeEmit; i++ ){ - let listener = listeners[i]; - - if( - ( listener.type === eventObj.type ) && - ( !listener.namespace || listener.namespace === eventObj.namespace || listener.namespace === universalNamespace ) && - ( self.eventMatches( self.context, listener, eventObj ) ) - ){ - let args = [ eventObj ]; - - if( extraParams != null ){ - util.push( args, extraParams ); - } - - self.beforeEmit( self.context, listener, eventObj ); - - if( listener.conf && listener.conf.one ){ - self.listeners = self.listeners.filter( l => l !== listener ); - } - - let context = self.callbackContext( self.context, listener, eventObj ); - let ret = listener.callback.apply( context, args ); - - self.afterEmit( self.context, listener, eventObj ); - - if( ret === false ){ - eventObj.stopPropagation(); - eventObj.preventDefault(); - } - } // if listener matches - } // for listener - - if( self.bubble( self.context ) && !eventObj.isPropagationStopped() ){ - self.parent( self.context ).emit( eventObj, extraParams ); - } - }, events ); - - this.emitting--; - - return this; -}; - -module.exports = Emitter; diff --git a/node_modules/cytoscape/src/event.js b/node_modules/cytoscape/src/event.js deleted file mode 100644 index 9853c7a98..000000000 --- a/node_modules/cytoscape/src/event.js +++ /dev/null @@ -1,111 +0,0 @@ -/*! -Event object based on jQuery events, MIT license - -https://jquery.org/license/ -https://tldrlegal.com/license/mit-license -https://github.com/jquery/jquery/blob/master/src/event.js -*/ - -let Event = function( src, props ){ - this.recycle( src, props ); -}; - -function returnFalse(){ - return false; -} - -function returnTrue(){ - return true; -} - -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -Event.prototype = { - instanceString: function(){ - return 'event'; - }, - - recycle: function( src, props ){ - this.isImmediatePropagationStopped = this.isPropagationStopped = this.isDefaultPrevented = returnFalse; - - if( src != null && src.preventDefault ){ // Browser Event object - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = ( src.defaultPrevented ) ? returnTrue : returnFalse; - - } else if( src != null && src.type ){ // Plain object containing all event details - props = src; - - } else { // Event string - this.type = src; - } - - // Put explicitly provided properties onto the event object - if( props != null ){ - // more efficient to manually copy fields we use - this.originalEvent = props.originalEvent; - this.type = props.type != null ? props.type : this.type; - this.cy = props.cy; - this.target = props.target; - this.position = props.position; - this.renderedPosition = props.renderedPosition; - this.namespace = props.namespace; - this.layout = props.layout; - } - - if( this.cy != null && this.position != null && this.renderedPosition == null ){ - // create a rendered position based on the passed position - let pos = this.position; - let zoom = this.cy.zoom(); - let pan = this.cy.pan(); - - this.renderedPosition = { - x: pos.x * zoom + pan.x, - y: pos.y * zoom + pan.y - }; - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || Date.now(); - }, - - preventDefault: function(){ - this.isDefaultPrevented = returnTrue; - - let e = this.originalEvent; - if( !e ){ - return; - } - - // if preventDefault exists run it on the original event - if( e.preventDefault ){ - e.preventDefault(); - } - }, - - stopPropagation: function(){ - this.isPropagationStopped = returnTrue; - - let e = this.originalEvent; - if( !e ){ - return; - } - - // if stopPropagation exists run it on the original event - if( e.stopPropagation ){ - e.stopPropagation(); - } - }, - - stopImmediatePropagation: function(){ - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - }, - - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse -}; - -module.exports = Event; diff --git a/node_modules/cytoscape/src/extension.js b/node_modules/cytoscape/src/extension.js deleted file mode 100644 index cd426b3ba..000000000 --- a/node_modules/cytoscape/src/extension.js +++ /dev/null @@ -1,243 +0,0 @@ -let util = require('./util'); -let define = require('./define'); -let Collection = require('./collection'); -let Core = require('./core'); -let incExts = require('./extensions'); -let is = require('./is'); -let Emitter = require('./emitter'); - -// registered extensions to cytoscape, indexed by name -let extensions = {}; - -// registered modules for extensions, indexed by name -let modules = {}; - -function setExtension( type, name, registrant ){ - - let ext = registrant; - - let overrideErr = function( field ){ - util.error( 'Can not register `' + name + '` for `' + type + '` since `' + field + '` already exists in the prototype and can not be overridden' ); - }; - - if( type === 'core' ){ - if( Core.prototype[ name ] ){ - return overrideErr( name ); - } else { - Core.prototype[ name ] = registrant; - } - - } else if( type === 'collection' ){ - if( Collection.prototype[ name ] ){ - return overrideErr( name ); - } else { - Collection.prototype[ name ] = registrant; - } - - } else if( type === 'layout' ){ - // fill in missing layout functions in the prototype - - let Layout = function( options ){ - this.options = options; - - registrant.call( this, options ); - - // make sure layout has _private for use w/ std apis like .on() - if( !is.plainObject( this._private ) ){ - this._private = {}; - } - - this._private.cy = options.cy; - this._private.listeners = []; - - this.createEmitter(); - }; - - let layoutProto = Layout.prototype = Object.create( registrant.prototype ); - - let optLayoutFns = []; - - for( let i = 0; i < optLayoutFns.length; i++ ){ - let fnName = optLayoutFns[ i ]; - - layoutProto[ fnName ] = layoutProto[ fnName ] || function(){ return this; }; - } - - // either .start() or .run() is defined, so autogen the other - if( layoutProto.start && !layoutProto.run ){ - layoutProto.run = function(){ this.start(); return this; }; - } else if( !layoutProto.start && layoutProto.run ){ - layoutProto.start = function(){ this.run(); return this; }; - } - - let regStop = registrant.prototype.stop; - layoutProto.stop = function(){ - let opts = this.options; - - if( opts && opts.animate ){ - let anis = this.animations; - - if( anis ){ - for( let i = 0; i < anis.length; i++ ){ - anis[ i ].stop(); - } - } - } - - if( regStop ){ - regStop.call( this ); - } else { - this.emit( 'layoutstop' ); - } - - return this; - }; - - if( !layoutProto.destroy ){ - layoutProto.destroy = function(){ - return this; - }; - } - - layoutProto.cy = function(){ - return this._private.cy; - }; - - let getCy = layout => layout._private.cy; - - util.assign( layoutProto, { - createEmitter: function(){ - this._private.emitter = new Emitter({ - eventFields: function( layout ){ - return { - layout: layout, - cy: getCy(layout), - target: layout - }; - }, - bubble: function(){ return true; }, - parent: function( layout ){ return getCy(layout); }, - context: this - }); - - return this; - }, - emitter: function(){ return this._private.emitter; }, - on: function( evt, cb ){ this.emitter().on( evt, cb ); return this; }, - one: function( evt, cb ){ this.emitter().one( evt, cb ); return this; }, - once: function( evt, cb ){ this.emitter().one( evt, cb ); return this; }, - removeListener: function( evt, cb ){ this.emitter().removeListener( evt, cb ); return this; }, - emit: function( evt, params ){ this.emitter().emit( evt, params ); return this; } - } ); - - define.eventAliasesOn( layoutProto ); - - ext = Layout; // replace with our wrapped layout - - } else if( type === 'renderer' && name !== 'null' && name !== 'base' ){ - // user registered renderers inherit from base - - let BaseRenderer = getExtension( 'renderer', 'base' ); - let bProto = BaseRenderer.prototype; - let RegistrantRenderer = registrant; - let rProto = registrant.prototype; - - let Renderer = function(){ - BaseRenderer.apply( this, arguments ); - RegistrantRenderer.apply( this, arguments ); - }; - - let proto = Renderer.prototype; - - for( let pName in bProto ){ - let pVal = bProto[ pName ]; - let existsInR = rProto[ pName ] != null; - - if( existsInR ){ - return overrideErr( pName ); - } - - proto[ pName ] = pVal; // take impl from base - } - - for( let pName in rProto ){ - proto[ pName ] = rProto[ pName ]; // take impl from registrant - } - - bProto.clientFunctions.forEach( function( name ){ - proto[ name ] = proto[ name ] || function(){ - util.error( 'Renderer does not implement `renderer.' + name + '()` on its prototype' ); - }; - } ); - - ext = Renderer; - - } - - return util.setMap( { - map: extensions, - keys: [ type, name ], - value: ext - } ); -} - -function getExtension( type, name ){ - return util.getMap( { - map: extensions, - keys: [ type, name ] - } ); -} - -function setModule( type, name, moduleType, moduleName, registrant ){ - return util.setMap( { - map: modules, - keys: [ type, name, moduleType, moduleName ], - value: registrant - } ); -} - -function getModule( type, name, moduleType, moduleName ){ - return util.getMap( { - map: modules, - keys: [ type, name, moduleType, moduleName ] - } ); -} - -let extension = function(){ - // e.g. extension('renderer', 'svg') - if( arguments.length === 2 ){ - return getExtension.apply( null, arguments ); - } - - // e.g. extension('renderer', 'svg', { ... }) - else if( arguments.length === 3 ){ - return setExtension.apply( null, arguments ); - } - - // e.g. extension('renderer', 'svg', 'nodeShape', 'ellipse') - else if( arguments.length === 4 ){ - return getModule.apply( null, arguments ); - } - - // e.g. extension('renderer', 'svg', 'nodeShape', 'ellipse', { ... }) - else if( arguments.length === 5 ){ - return setModule.apply( null, arguments ); - } - - else { - util.error( 'Invalid extension access syntax' ); - } - -}; - -// allows a core instance to access extensions internally -Core.prototype.extension = extension; - -// included extensions -incExts.forEach( function( group ){ - group.extensions.forEach( function( ext ){ - setExtension( group.type, ext.name, ext.impl ); - } ); -} ); - -module.exports = extension; diff --git a/node_modules/cytoscape/src/extensions/index.js b/node_modules/cytoscape/src/extensions/index.js deleted file mode 100644 index ed9c7128b..000000000 --- a/node_modules/cytoscape/src/extensions/index.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = [ - { - type: 'layout', - extensions: require( './layout' ) - }, - - { - type: 'renderer', - extensions: require( './renderer' ) - } -]; diff --git a/node_modules/cytoscape/src/extensions/layout/breadthfirst.js b/node_modules/cytoscape/src/extensions/layout/breadthfirst.js deleted file mode 100644 index 8227a1349..000000000 --- a/node_modules/cytoscape/src/extensions/layout/breadthfirst.js +++ /dev/null @@ -1,439 +0,0 @@ -let util = require( '../../util' ); -let math = require( '../../math' ); -let is = require( '../../is' ); - -let defaults = { - fit: true, // whether to fit the viewport to the graph - directed: false, // whether the tree is directed downwards (or edges can point in any direction if false) - padding: 30, // padding on fit - circle: false, // put depths in concentric circles if true, put depths top down if false - spacingFactor: 1.75, // positive spacing factor, larger => more space between nodes (N.B. n/a if causes overlap) - boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space - nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm - roots: undefined, // the roots of the trees - maximalAdjustments: 0, // how many times to try to position the nodes in a maximal way (i.e. no backtracking) - animate: false, // whether to transition the node positions - animationDuration: 500, // duration of animation in ms if enabled - animationEasing: undefined, // easing of animation if enabled, - animateFilter: function ( node, i ){ return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts - ready: undefined, // callback on layoutready - stop: undefined, // callback on layoutstop - transform: function (node, position ){ return position; } // transform a given node position. Useful for changing flow direction in discrete layouts -}; - -function BreadthFirstLayout( options ){ - this.options = util.extend( {}, defaults, options ); -} - -BreadthFirstLayout.prototype.run = function(){ - let params = this.options; - let options = params; - - let cy = params.cy; - let eles = options.eles; - let nodes = eles.nodes().not( ':parent' ); - let graph = eles; - - let bb = math.makeBoundingBox( options.boundingBox ? options.boundingBox : { - x1: 0, y1: 0, w: cy.width(), h: cy.height() - } ); - - let roots; - if( is.elementOrCollection( options.roots ) ){ - roots = options.roots; - } else if( is.array( options.roots ) ){ - let rootsArray = []; - - for( let i = 0; i < options.roots.length; i++ ){ - let id = options.roots[ i ]; - let ele = cy.getElementById( id ); - rootsArray.push( ele ); - } - - roots = cy.collection( rootsArray ); - } else if( is.string( options.roots ) ){ - roots = cy.$( options.roots ); - - } else { - if( options.directed ){ - roots = nodes.roots(); - } else { - let components = []; - let unhandledNodes = nodes; - - while( unhandledNodes.length > 0 ){ - let currComp = cy.collection(); - - eles.bfs( { - roots: unhandledNodes[0], - visit: function( node, edge, pNode, i, depth ){ - currComp = currComp.add( node ); - }, - directed: false - } ); - - unhandledNodes = unhandledNodes.not( currComp ); - components.push( currComp ); - } - - roots = cy.collection(); - for( let i = 0; i < components.length; i++ ){ - let comp = components[ i ]; - let maxDegree = comp.maxDegree( false ); - let compRoots = comp.filter( function( ele ){ - return ele.degree( false ) === maxDegree; - } ); - - roots = roots.add( compRoots ); - } - - } - } - - - let depths = []; - let foundByBfs = {}; - let id2depth = {}; - let prevNode = {}; - let prevEdge = {}; - let successors = {}; - - // find the depths of the nodes - graph.bfs( { - roots: roots, - directed: options.directed, - visit: function( node, edge, pNode, i, depth ){ - let ele = node[0]; - let id = ele.id(); - - if( !depths[ depth ] ){ - depths[ depth ] = []; - } - - depths[ depth ].push( ele ); - foundByBfs[ id ] = true; - id2depth[ id ] = depth; - prevNode[ id ] = pNode; - prevEdge[ id ] = edge; - - if( pNode ){ - let prevId = pNode.id(); - let succ = successors[ prevId ] = successors[ prevId ] || []; - - succ.push( node ); - } - } - } ); - - // check for nodes not found by bfs - let orphanNodes = []; - for( let i = 0; i < nodes.length; i++ ){ - let ele = nodes[ i ]; - - if( foundByBfs[ ele.id() ] ){ - continue; - } else { - orphanNodes.push( ele ); - } - } - - // assign orphan nodes a depth from their neighborhood - let maxChecks = orphanNodes.length * 3; - let checks = 0; - while( orphanNodes.length !== 0 && checks < maxChecks ){ - let node = orphanNodes.shift(); - let neighbors = node.neighborhood().nodes(); - let assignedDepth = false; - - for( let i = 0; i < neighbors.length; i++ ){ - let depth = id2depth[ neighbors[ i ].id() ]; - - if( depth !== undefined ){ - depths[ depth ].push( node ); - assignedDepth = true; - break; - } - } - - if( !assignedDepth ){ - orphanNodes.push( node ); - } - - checks++; - } - - // assign orphan nodes that are still left to the depth of their subgraph - while( orphanNodes.length !== 0 ){ - let node = orphanNodes.shift(); - //let subgraph = graph.bfs( node ).path; - let assignedDepth = false; - - // for( let i = 0; i < subgraph.length; i++ ){ - // let depth = id2depth[ subgraph[i].id() ]; - - // if( depth !== undefined ){ - // depths[depth].push( node ); - // assignedDepth = true; - // break; - // } - // } - - if( !assignedDepth ){ // worst case if the graph really isn't tree friendly, then just dump it in 0 - if( depths.length === 0 ){ - depths.push( [] ); - } - - depths[0].push( node ); - } - } - - // assign the nodes a depth and index - let assignDepthsToEles = function(){ - for( let i = 0; i < depths.length; i++ ){ - let eles = depths[ i ]; - - for( let j = 0; j < eles.length; j++ ){ - let ele = eles[ j ]; - - if( ele == null ){ - eles.splice( j, 1 ); - j--; - continue; - } - - ele._private.scratch.breadthfirst = { - depth: i, - index: j - }; - } - } - }; - assignDepthsToEles(); - - - let intersectsDepth = function( node ){ // returns true if has edges pointing in from a higher depth - let edges = node.connectedEdges( function( ele ){ - return ele.data( 'target' ) === node.id(); - } ); - let thisInfo = node._private.scratch.breadthfirst; - let highestDepthOfOther = 0; - let highestOther; - for( let i = 0; i < edges.length; i++ ){ - let edge = edges[ i ]; - let otherNode = edge.source()[0]; - let otherInfo = otherNode._private.scratch.breadthfirst; - - if( thisInfo.depth <= otherInfo.depth && highestDepthOfOther < otherInfo.depth ){ - highestDepthOfOther = otherInfo.depth; - highestOther = otherNode; - } - } - - return highestOther; - }; - - // make maximal if so set by adjusting depths - for( let adj = 0; adj < options.maximalAdjustments; adj++ ){ - - let nDepths = depths.length; - let elesToMove = []; - for( let i = 0; i < nDepths; i++ ){ - let depth = depths[ i ]; - - let nDepth = depth.length; - for( let j = 0; j < nDepth; j++ ){ - let ele = depth[ j ]; - let info = ele._private.scratch.breadthfirst; - let intEle = intersectsDepth( ele ); - - if( intEle ){ - info.intEle = intEle; - elesToMove.push( ele ); - } - } - } - - for( let i = 0; i < elesToMove.length; i++ ){ - let ele = elesToMove[ i ]; - let info = ele._private.scratch.breadthfirst; - let intEle = info.intEle; - let intInfo = intEle._private.scratch.breadthfirst; - - depths[ info.depth ][ info.index ] = null; // remove from old depth & index (create hole to be cleaned) - - // add to end of new depth - let newDepth = intInfo.depth + 1; - while( newDepth > depths.length - 1 ){ - depths.push( [] ); - } - depths[ newDepth ].push( ele ); - - info.depth = newDepth; - info.index = depths[ newDepth ].length - 1; - } - - assignDepthsToEles(); - } - - // find min distance we need to leave between nodes - let minDistance = 0; - if( options.avoidOverlap ){ - for( let i = 0; i < nodes.length; i++ ){ - let n = nodes[ i ]; - let nbb = n.layoutDimensions( options ); - let w = nbb.w; - let h = nbb.h; - - minDistance = Math.max( minDistance, w, h ); - } - } - - // get the weighted percent for an element based on its connectivity to other levels - let cachedWeightedPercent = {}; - let getWeightedPercent = function( ele ){ - if( cachedWeightedPercent[ ele.id() ] ){ - return cachedWeightedPercent[ ele.id() ]; - } - - let eleDepth = ele._private.scratch.breadthfirst.depth; - let neighbors = ele.neighborhood().nodes().not( ':parent' ).intersection(nodes); - let percent = 0; - let samples = 0; - - for( let i = 0; i < neighbors.length; i++ ){ - let neighbor = neighbors[ i ]; - let bf = neighbor._private.scratch.breadthfirst; - let index = bf.index; - let depth = bf.depth; - let nDepth = depths[ depth ].length; - - if( eleDepth > depth || eleDepth === 0 ){ // only get influenced by elements above - percent += index / nDepth; - samples++; - } - } - - samples = Math.max( 1, samples ); - percent = percent / samples; - - if( samples === 0 ){ // so lone nodes have a "don't care" state in sorting - percent = undefined; - } - - cachedWeightedPercent[ ele.id() ] = percent; - return percent; - }; - - - // rearrange the indices in each depth level based on connectivity - - let sortFn = function( a, b ){ - let apct = getWeightedPercent( a ); - let bpct = getWeightedPercent( b ); - - return apct - bpct; - }; - - for( let times = 0; times < 3; times++ ){ // do it a few times b/c the depths are dynamic and we want a more stable result - - for( let i = 0; i < depths.length; i++ ){ - depths[ i ] = depths[ i ].sort( sortFn ); - } - assignDepthsToEles(); // and update - - } - - let biggestDepthSize = 0; - for( let i = 0; i < depths.length; i++ ){ - biggestDepthSize = Math.max( depths[ i ].length, biggestDepthSize ); - } - - let center = { - x: bb.x1 + bb.w / 2, - y: bb.x1 + bb.h / 2 - }; - - let getPosition = function( ele, isBottomDepth ){ - let info = ele._private.scratch.breadthfirst; - let depth = info.depth; - let index = info.index; - let depthSize = depths[ depth ].length; - - let distanceX = Math.max( bb.w / (depthSize + 1), minDistance ); - let distanceY = Math.max( bb.h / (depths.length + 1), minDistance ); - let radiusStepSize = Math.min( bb.w / 2 / depths.length, bb.h / 2 / depths.length ); - radiusStepSize = Math.max( radiusStepSize, minDistance ); - - if( !options.circle ){ - - let epos = { - x: center.x + (index + 1 - (depthSize + 1) / 2) * distanceX, - y: (depth + 1) * distanceY - }; - - if( isBottomDepth ){ - return epos; - } - - // let succs = successors[ ele.id() ]; - // if( succs ){ - // epos.x = 0; - // - // for( let i = 0 ; i < succs.length; i++ ){ - // let spos = pos[ succs[i].id() ]; - // - // epos.x += spos.x; - // } - // - // epos.x /= succs.length; - // } else { - // //debugger; - // } - - return epos; - - } else { - if( options.circle ){ - let radius = radiusStepSize * depth + radiusStepSize - (depths.length > 0 && depths[0].length <= 3 ? radiusStepSize / 2 : 0); - let theta = 2 * Math.PI / depths[ depth ].length * index; - - if( depth === 0 && depths[0].length === 1 ){ - radius = 1; - } - - return { - x: center.x + radius * Math.cos( theta ), - y: center.y + radius * Math.sin( theta ) - }; - - } else { - return { - x: center.x + (index + 1 - (depthSize + 1) / 2) * distanceX, - y: (depth + 1) * distanceY - }; - } - } - - }; - - // get positions in reverse depth order - let pos = {}; - for( let i = depths.length - 1; i >= 0; i-- ){ - let depth = depths[ i ]; - - for( let j = 0; j < depth.length; j++ ){ - let node = depth[ j ]; - - pos[ node.id() ] = getPosition( node, i === depths.length - 1 ); - } - } - - nodes.layoutPositions( this, options, function( node ){ - return pos[ node.id() ]; - } ); - - return this; // chaining -}; - -module.exports = BreadthFirstLayout; diff --git a/node_modules/cytoscape/src/extensions/layout/circle.js b/node_modules/cytoscape/src/extensions/layout/circle.js deleted file mode 100644 index 8983057cb..000000000 --- a/node_modules/cytoscape/src/extensions/layout/circle.js +++ /dev/null @@ -1,105 +0,0 @@ -let util = require( '../../util' ); -let math = require( '../../math' ); -let is = require( '../../is' ); - -let defaults = { - fit: true, // whether to fit the viewport to the graph - padding: 30, // the padding on fit - boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - avoidOverlap: true, // prevents node overlap, may overflow boundingBox and radius if not enough space - nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm - spacingFactor: undefined, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up - radius: undefined, // the radius of the circle - startAngle: 3 / 2 * Math.PI, // where nodes start in radians - sweep: undefined, // how many radians should be between the first and last node (defaults to full circle) - clockwise: true, // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) - sort: undefined, // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } - animate: false, // whether to transition the node positions - animationDuration: 500, // duration of animation in ms if enabled - animationEasing: undefined, // easing of animation if enabled - animateFilter: function ( node, i ){ return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts - ready: undefined, // callback on layoutready - stop: undefined, // callback on layoutstop - transform: function (node, position ){ return position; } // transform a given node position. Useful for changing flow direction in discrete layouts - -}; - -function CircleLayout( options ){ - this.options = util.extend( {}, defaults, options ); -} - -CircleLayout.prototype.run = function(){ - let params = this.options; - let options = params; - - let cy = params.cy; - let eles = options.eles; - - let clockwise = options.counterclockwise !== undefined ? !options.counterclockwise : options.clockwise; - - let nodes = eles.nodes().not( ':parent' ); - - if( options.sort ){ - nodes = nodes.sort( options.sort ); - } - - let bb = math.makeBoundingBox( options.boundingBox ? options.boundingBox : { - x1: 0, y1: 0, w: cy.width(), h: cy.height() - } ); - - let center = { - x: bb.x1 + bb.w / 2, - y: bb.y1 + bb.h / 2 - }; - - let sweep = options.sweep === undefined ? 2 * Math.PI - 2 * Math.PI / nodes.length : options.sweep; - let dTheta = sweep / ( Math.max( 1, nodes.length - 1 ) ); - let r; - - let minDistance = 0; - for( let i = 0; i < nodes.length; i++ ){ - let n = nodes[ i ]; - let nbb = n.layoutDimensions( options ); - let w = nbb.w; - let h = nbb.h; - - minDistance = Math.max( minDistance, w, h ); - } - - if( is.number( options.radius ) ){ - r = options.radius; - } else if( nodes.length <= 1 ){ - r = 0; - } else { - r = Math.min( bb.h, bb.w ) / 2 - minDistance; - } - - // calculate the radius - if( nodes.length > 1 && options.avoidOverlap ){ // but only if more than one node (can't overlap) - minDistance *= 1.75; // just to have some nice spacing - - let dcos = Math.cos( dTheta ) - Math.cos( 0 ); - let dsin = Math.sin( dTheta ) - Math.sin( 0 ); - let rMin = Math.sqrt( minDistance * minDistance / ( dcos * dcos + dsin * dsin ) ); // s.t. no nodes overlapping - r = Math.max( rMin, r ); - } - - let getPos = function( ele, i ){ - let theta = options.startAngle + i * dTheta * ( clockwise ? 1 : -1 ); - - let rx = r * Math.cos( theta ); - let ry = r * Math.sin( theta ); - let pos = { - x: center.x + rx, - y: center.y + ry - }; - - return pos; - }; - - nodes.layoutPositions( this, options, getPos ); - - return this; // chaining -}; - -module.exports = CircleLayout; diff --git a/node_modules/cytoscape/src/extensions/layout/concentric.js b/node_modules/cytoscape/src/extensions/layout/concentric.js deleted file mode 100644 index bc827280d..000000000 --- a/node_modules/cytoscape/src/extensions/layout/concentric.js +++ /dev/null @@ -1,200 +0,0 @@ -let util = require( '../../util' ); -let math = require( '../../math' ); - -let defaults = { - fit: true, // whether to fit the viewport to the graph - padding: 30, // the padding on fit - startAngle: 3 / 2 * Math.PI, // where nodes start in radians - sweep: undefined, // how many radians should be between the first and last node (defaults to full circle) - clockwise: true, // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) - equidistant: false, // whether levels have an equal radial distance betwen them, may cause bounding box overflow - minNodeSpacing: 10, // min spacing between outside of nodes (used for radius adjustment) - boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space - nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm - height: undefined, // height of layout area (overrides container height) - width: undefined, // width of layout area (overrides container width) - spacingFactor: undefined, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up - concentric: function( node ){ // returns numeric value for each node, placing higher nodes in levels towards the centre - return node.degree(); - }, - levelWidth: function( nodes ){ // the letiation of concentric values in each level - return nodes.maxDegree() / 4; - }, - animate: false, // whether to transition the node positions - animationDuration: 500, // duration of animation in ms if enabled - animationEasing: undefined, // easing of animation if enabled - animateFilter: function ( node, i ){ return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts - ready: undefined, // callback on layoutready - stop: undefined, // callback on layoutstop - transform: function (node, position ){ return position; } // transform a given node position. Useful for changing flow direction in discrete layouts -}; - -function ConcentricLayout( options ){ - this.options = util.extend( {}, defaults, options ); -} - -ConcentricLayout.prototype.run = function(){ - let params = this.options; - let options = params; - - let clockwise = options.counterclockwise !== undefined ? !options.counterclockwise : options.clockwise; - - let cy = params.cy; - - let eles = options.eles; - let nodes = eles.nodes().not( ':parent' ); - - let bb = math.makeBoundingBox( options.boundingBox ? options.boundingBox : { - x1: 0, y1: 0, w: cy.width(), h: cy.height() - } ); - - let center = { - x: bb.x1 + bb.w / 2, - y: bb.y1 + bb.h / 2 - }; - - let nodeValues = []; // { node, value } - let theta = options.startAngle; - let maxNodeSize = 0; - - for( let i = 0; i < nodes.length; i++ ){ - let node = nodes[ i ]; - let value; - - // calculate the node value - value = options.concentric( node ); - nodeValues.push( { - value: value, - node: node - } ); - - // for style mapping - node._private.scratch.concentric = value; - } - - // in case we used the `concentric` in style - nodes.updateStyle(); - - // calculate max size now based on potentially updated mappers - for( let i = 0; i < nodes.length; i++ ){ - let node = nodes[ i ]; - let nbb = node.layoutDimensions( options ); - - maxNodeSize = Math.max( maxNodeSize, nbb.w, nbb.h ); - } - - // sort node values in descreasing order - nodeValues.sort( function( a, b ){ - return b.value - a.value; - } ); - - let levelWidth = options.levelWidth( nodes ); - - // put the values into levels - let levels = [ [] ]; - let currentLevel = levels[0]; - for( let i = 0; i < nodeValues.length; i++ ){ - let val = nodeValues[ i ]; - - if( currentLevel.length > 0 ){ - let diff = Math.abs( currentLevel[0].value - val.value ); - - if( diff >= levelWidth ){ - currentLevel = []; - levels.push( currentLevel ); - } - } - - currentLevel.push( val ); - } - - // create positions from levels - - let minDist = maxNodeSize + options.minNodeSpacing; // min dist between nodes - - if( !options.avoidOverlap ){ // then strictly constrain to bb - let firstLvlHasMulti = levels.length > 0 && levels[0].length > 1; - let maxR = ( Math.min( bb.w, bb.h ) / 2 - minDist ); - let rStep = maxR / ( levels.length + firstLvlHasMulti ? 1 : 0 ); - - minDist = Math.min( minDist, rStep ); - } - - // find the metrics for each level - let r = 0; - for( let i = 0; i < levels.length; i++ ){ - let level = levels[ i ]; - let sweep = options.sweep === undefined ? 2 * Math.PI - 2 * Math.PI / level.length : options.sweep; - let dTheta = level.dTheta = sweep / ( Math.max( 1, level.length - 1 ) ); - - // calculate the radius - if( level.length > 1 && options.avoidOverlap ){ // but only if more than one node (can't overlap) - let dcos = Math.cos( dTheta ) - Math.cos( 0 ); - let dsin = Math.sin( dTheta ) - Math.sin( 0 ); - let rMin = Math.sqrt( minDist * minDist / ( dcos * dcos + dsin * dsin ) ); // s.t. no nodes overlapping - - r = Math.max( rMin, r ); - } - - level.r = r; - - r += minDist; - } - - if( options.equidistant ){ - let rDeltaMax = 0; - let r = 0; - - for( let i = 0; i < levels.length; i++ ){ - let level = levels[ i ]; - let rDelta = level.r - r; - - rDeltaMax = Math.max( rDeltaMax, rDelta ); - } - - r = 0; - for( let i = 0; i < levels.length; i++ ){ - let level = levels[ i ]; - - if( i === 0 ){ - r = level.r; - } - - level.r = r; - - r += rDeltaMax; - } - } - - // calculate the node positions - let pos = {}; // id => position - for( let i = 0; i < levels.length; i++ ){ - let level = levels[ i ]; - let dTheta = level.dTheta; - let r = level.r; - - for( let j = 0; j < level.length; j++ ){ - let val = level[ j ]; - let theta = options.startAngle + (clockwise ? 1 : -1) * dTheta * j; - - let p = { - x: center.x + r * Math.cos( theta ), - y: center.y + r * Math.sin( theta ) - }; - - pos[ val.node.id() ] = p; - } - } - - // position the nodes - nodes.layoutPositions( this, options, function( ele ){ - let id = ele.id(); - - return pos[ id ]; - } ); - - return this; // chaining -}; - -module.exports = ConcentricLayout; diff --git a/node_modules/cytoscape/src/extensions/layout/cose.js b/node_modules/cytoscape/src/extensions/layout/cose.js deleted file mode 100644 index d62f632e8..000000000 --- a/node_modules/cytoscape/src/extensions/layout/cose.js +++ /dev/null @@ -1,1414 +0,0 @@ -/* -The CoSE layout was written by Gerardo Huck. -https://www.linkedin.com/in/gerardohuck/ - -Based on the following article: -http://dl.acm.org/citation.cfm?id=1498047 - -Modifications tracked on Github. -*/ - -var util = require( '../../util' ); -var math = require( '../../math' ); -var is = require( '../../is' ); -var Promise = require('../../promise'); - -var DEBUG; - -/** - * @brief : default layout options - */ -var defaults = { - // Called on `layoutready` - ready: function(){}, - - // Called on `layoutstop` - stop: function(){}, - - // Whether to animate while running the layout - // true : Animate continuously as the layout is running - // false : Just show the end result - // 'end' : Animate with the end result, from the initial positions to the end positions - animate: true, - - // Easing of the animation for animate:'end' - animationEasing: undefined, - - // The duration of the animation for animate:'end' - animationDuration: undefined, - - // A function that determines whether the node should be animated - // All nodes animated by default on animate enabled - // Non-animated nodes are positioned immediately when the layout starts - animateFilter: function ( node, i ){ return true; }, - - - // The layout animates only after this many milliseconds for animate:true - // (prevents flashing on fast runs) - animationThreshold: 250, - - // Number of iterations between consecutive screen positions update - // (0 -> only updated on the end) - refresh: 20, - - // Whether to fit the network view after when done - fit: true, - - // Padding on fit - padding: 30, - - // Constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - boundingBox: undefined, - - // Excludes the label when calculating node bounding boxes for the layout algorithm - nodeDimensionsIncludeLabels: false, - - // Randomize the initial positions of the nodes (true) or use existing positions (false) - randomize: false, - - // Extra spacing between components in non-compound graphs - componentSpacing: 40, - - // Node repulsion (non overlapping) multiplier - nodeRepulsion: function( node ){ return 2048; }, - - // Node repulsion (overlapping) multiplier - nodeOverlap: 4, - - // Ideal edge (non nested) length - idealEdgeLength: function( edge ){ return 32; }, - - // Divisor to compute edge forces - edgeElasticity: function( edge ){ return 32; }, - - // Nesting factor (multiplier) to compute ideal edge length for nested edges - nestingFactor: 1.2, - - // Gravity force (constant) - gravity: 1, - - // Maximum number of iterations to perform - numIter: 1000, - - // Initial temperature (maximum node displacement) - initialTemp: 1000, - - // Cooling factor (how the temperature is reduced between consecutive iterations - coolingFactor: 0.99, - - // Lower temperature threshold (below this point the layout will end) - minTemp: 1.0, - - // Pass a reference to weaver to use threads for calculations - weaver: false -}; - - -/** - * @brief : constructor - * @arg options : object containing layout options - */ -function CoseLayout( options ){ - this.options = util.extend( {}, defaults, options ); - - this.options.layout = this; -} - -/** - * @brief : runs the layout - */ -CoseLayout.prototype.run = function(){ - var options = this.options; - var cy = options.cy; - var layout = this; - var thread = this.thread; - var Thread = options.weaver ? options.weaver.Thread : null; - - var falseThread = { // use false thread as polyfill - listeners: [], - on: function(e, cb){ - this.listeners.push({ event: e, callback: cb }); - - return this; - }, - trigger: function(e){ - if( is.string(e) ){ - e = { type: e }; - } - - var matchesEvent = function( l ){ return l.event === e.type; }; - var trigger = function( l ){ l.callback(e); }; - - this.listeners.filter( matchesEvent ).forEach( trigger ); - - return this; - }, - pass: function( data ){ - this.pass = data; - - return this; - }, - run: function( cb ){ - var pass = this.pass; - - return new Promise(function( resolve ){ - resolve( cb( pass ) ); - }); - }, - stop: function(){ - return this; - }, - stopped: function(){ - return true; - }, - }; - - function broadcast( message ){ // for false thread - var e = { type: 'message', message: message }; - - falseThread.trigger( e ); - } - - if( !thread || thread.stopped() ){ - thread = this.thread = Thread ? new Thread() : falseThread; - } - - layout.stopped = false; - - if( options.animate === true || options.animate === false ){ - layout.emit( { type: 'layoutstart', layout: layout } ); - } - - // Set DEBUG - Global variable - if( true === options.debug ){ - DEBUG = true; - } else { - DEBUG = false; - } - - // Initialize layout info - var layoutInfo = createLayoutInfo( cy, layout, options ); - - // Show LayoutInfo contents if debugging - if( DEBUG ){ - printLayoutInfo( layoutInfo ); - } - - // If required, randomize node positions - if (options.randomize) { - randomizePositions( layoutInfo, cy ); - } - - var startTime = Date.now(); - var refreshRequested = false; - var refresh = function( rOpts ){ - rOpts = rOpts || {}; - - if( refreshRequested && !rOpts.next ){ - return; - } - - if( !rOpts.force && Date.now() - startTime < options.animationThreshold ){ - return; - } - - refreshRequested = true; - - util.requestAnimationFrame( function(){ - refreshPositions( layoutInfo, cy, options ); - - // Fit the graph if necessary - if( true === options.fit ){ - cy.fit( options.padding ); - } - - refreshRequested = false; - - if( rOpts.next ){ rOpts.next(); } - }); - }; - - thread.on( 'message', function( e ){ - var layoutNodes = e.message; - - layoutInfo.layoutNodes = layoutNodes; - refresh(); - } ); - - thread.pass( { - layoutInfo: layoutInfo, - options: { - animate: options.animate, - refresh: options.refresh, - componentSpacing: options.componentSpacing, - nodeOverlap: options.nodeOverlap, - nestingFactor: options.nestingFactor, - gravity: options.gravity, - numIter: options.numIter, - initialTemp: options.initialTemp, - coolingFactor: options.coolingFactor, - minTemp: options.minTemp - } - } ).run( function( pass ){ - var layoutInfo = pass.layoutInfo; - var options = pass.options; - var stopped = false; - - /** - * @brief : Performs one iteration of the physical simulation - * @arg layoutInfo : LayoutInfo object already initialized - * @arg cy : Cytoscape object - * @arg options : Layout options - */ - var step = function( layoutInfo, options, step ){ - // var s = "\n\n###############################"; - // s += "\nSTEP: " + step; - // s += "\n###############################\n"; - // logDebug(s); - - // Calculate node repulsions - calculateNodeForces( layoutInfo, options ); - // Calculate edge forces - calculateEdgeForces( layoutInfo, options ); - // Calculate gravity forces - calculateGravityForces( layoutInfo, options ); - // Propagate forces from parent to child - propagateForces( layoutInfo, options ); - // Update positions based on calculated forces - updatePositions( layoutInfo, options ); - }; - - /** - * @brief : Computes the node repulsion forces - */ - var calculateNodeForces = function( layoutInfo, options ){ - // Go through each of the graphs in graphSet - // Nodes only repel each other if they belong to the same graph - // var s = 'calculateNodeForces'; - // logDebug(s); - for( var i = 0; i < layoutInfo.graphSet.length; i ++ ){ - var graph = layoutInfo.graphSet[ i ]; - var numNodes = graph.length; - - // s = "Set: " + graph.toString(); - // logDebug(s); - - // Now get all the pairs of nodes - // Only get each pair once, (A, B) = (B, A) - for( var j = 0; j < numNodes; j++ ){ - var node1 = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ graph[ j ] ] ]; - - for( var k = j + 1; k < numNodes; k++ ){ - var node2 = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ graph[ k ] ] ]; - - nodeRepulsion( node1, node2, layoutInfo, options ); - } - } - } - }; - - var randomDistance = function( max ){ - return -max + 2 * max * Math.random(); - }; - - /** - * @brief : Compute the node repulsion forces between a pair of nodes - */ - var nodeRepulsion = function( node1, node2, layoutInfo, options ){ - // var s = "Node repulsion. Node1: " + node1.id + " Node2: " + node2.id; - - var cmptId1 = node1.cmptId; - var cmptId2 = node2.cmptId; - - if( cmptId1 !== cmptId2 && !layoutInfo.isCompound ){ return; } - - // Get direction of line connecting both node centers - var directionX = node2.positionX - node1.positionX; - var directionY = node2.positionY - node1.positionY; - var maxRandDist = 1; - // s += "\ndirectionX: " + directionX + ", directionY: " + directionY; - - // If both centers are the same, apply a random force - if( 0 === directionX && 0 === directionY ){ - directionX = randomDistance( maxRandDist ); - directionY = randomDistance( maxRandDist ); - } - - var overlap = nodesOverlap( node1, node2, directionX, directionY ); - - if( overlap > 0 ){ - // s += "\nNodes DO overlap."; - // s += "\nOverlap: " + overlap; - // If nodes overlap, repulsion force is proportional - // to the overlap - var force = options.nodeOverlap * overlap; - - // Compute the module and components of the force vector - var distance = Math.sqrt( directionX * directionX + directionY * directionY ); - // s += "\nDistance: " + distance; - var forceX = force * directionX / distance; - var forceY = force * directionY / distance; - - } else { - // s += "\nNodes do NOT overlap."; - // If there's no overlap, force is inversely proportional - // to squared distance - - // Get clipping points for both nodes - var point1 = findClippingPoint( node1, directionX, directionY ); - var point2 = findClippingPoint( node2, -1 * directionX, -1 * directionY ); - - // Use clipping points to compute distance - var distanceX = point2.x - point1.x; - var distanceY = point2.y - point1.y; - var distanceSqr = distanceX * distanceX + distanceY * distanceY; - var distance = Math.sqrt( distanceSqr ); - // s += "\nDistance: " + distance; - - // Compute the module and components of the force vector - var force = ( node1.nodeRepulsion + node2.nodeRepulsion ) / distanceSqr; - var forceX = force * distanceX / distance; - var forceY = force * distanceY / distance; - } - - // Apply force - if( !node1.isLocked ){ - node1.offsetX -= forceX; - node1.offsetY -= forceY; - } - - if( !node2.isLocked ){ - node2.offsetX += forceX; - node2.offsetY += forceY; - } - - // s += "\nForceX: " + forceX + " ForceY: " + forceY; - // logDebug(s); - - return; - }; - - /** - * @brief : Determines whether two nodes overlap or not - * @return : Amount of overlapping (0 => no overlap) - */ - var nodesOverlap = function( node1, node2, dX, dY ){ - - if( dX > 0 ){ - var overlapX = node1.maxX - node2.minX; - } else { - var overlapX = node2.maxX - node1.minX; - } - - if( dY > 0 ){ - var overlapY = node1.maxY - node2.minY; - } else { - var overlapY = node2.maxY - node1.minY; - } - - if( overlapX >= 0 && overlapY >= 0 ){ - return Math.sqrt( overlapX * overlapX + overlapY * overlapY ); - } else { - return 0; - } - }; - - /** - * @brief : Finds the point in which an edge (direction dX, dY) intersects - * the rectangular bounding box of it's source/target node - */ - var findClippingPoint = function( node, dX, dY ){ - - // Shorcuts - var X = node.positionX; - var Y = node.positionY; - var H = node.height || 1; - var W = node.width || 1; - var dirSlope = dY / dX; - var nodeSlope = H / W; - - // var s = 'Computing clipping point of node ' + node.id + - // " . Height: " + H + ", Width: " + W + - // "\nDirection " + dX + ", " + dY; - // - // Compute intersection - var res = {}; - - // Case: Vertical direction (up) - if( 0 === dX && 0 < dY ){ - res.x = X; - // s += "\nUp direction"; - res.y = Y + H / 2; - - return res; - } - - // Case: Vertical direction (down) - if( 0 === dX && 0 > dY ){ - res.x = X; - res.y = Y + H / 2; - // s += "\nDown direction"; - - return res; - } - - // Case: Intersects the right border - if( 0 < dX && - -1 * nodeSlope <= dirSlope && - dirSlope <= nodeSlope ){ - res.x = X + W / 2; - res.y = Y + (W * dY / 2 / dX); - // s += "\nRightborder"; - - return res; - } - - // Case: Intersects the left border - if( 0 > dX && - -1 * nodeSlope <= dirSlope && - dirSlope <= nodeSlope ){ - res.x = X - W / 2; - res.y = Y - (W * dY / 2 / dX); - // s += "\nLeftborder"; - - return res; - } - - // Case: Intersects the top border - if( 0 < dY && - ( dirSlope <= -1 * nodeSlope || - dirSlope >= nodeSlope ) ){ - res.x = X + (H * dX / 2 / dY); - res.y = Y + H / 2; - // s += "\nTop border"; - - return res; - } - - // Case: Intersects the bottom border - if( 0 > dY && - ( dirSlope <= -1 * nodeSlope || - dirSlope >= nodeSlope ) ){ - res.x = X - (H * dX / 2 / dY); - res.y = Y - H / 2; - // s += "\nBottom border"; - - return res; - } - - // s += "\nClipping point found at " + res.x + ", " + res.y; - // logDebug(s); - return res; - }; - - /** - * @brief : Calculates all edge forces - */ - var calculateEdgeForces = function( layoutInfo, options ){ - // Iterate over all edges - for( var i = 0; i < layoutInfo.edgeSize; i++ ){ - // Get edge, source & target nodes - var edge = layoutInfo.layoutEdges[ i ]; - var sourceIx = layoutInfo.idToIndex[ edge.sourceId ]; - var source = layoutInfo.layoutNodes[ sourceIx ]; - var targetIx = layoutInfo.idToIndex[ edge.targetId ]; - var target = layoutInfo.layoutNodes[ targetIx ]; - - // Get direction of line connecting both node centers - var directionX = target.positionX - source.positionX; - var directionY = target.positionY - source.positionY; - - // If both centers are the same, do nothing. - // A random force has already been applied as node repulsion - if( 0 === directionX && 0 === directionY ){ - continue; - } - - // Get clipping points for both nodes - var point1 = findClippingPoint( source, directionX, directionY ); - var point2 = findClippingPoint( target, -1 * directionX, -1 * directionY ); - - - var lx = point2.x - point1.x; - var ly = point2.y - point1.y; - var l = Math.sqrt( lx * lx + ly * ly ); - - var force = Math.pow( edge.idealLength - l, 2 ) / edge.elasticity; - - if( 0 !== l ){ - var forceX = force * lx / l; - var forceY = force * ly / l; - } else { - var forceX = 0; - var forceY = 0; - } - - // Add this force to target and source nodes - if( !source.isLocked ){ - source.offsetX += forceX; - source.offsetY += forceY; - } - - if( !target.isLocked ){ - target.offsetX -= forceX; - target.offsetY -= forceY; - } - - // var s = 'Edge force between nodes ' + source.id + ' and ' + target.id; - // s += "\nDistance: " + l + " Force: (" + forceX + ", " + forceY + ")"; - // logDebug(s); - } - }; - - /** - * @brief : Computes gravity forces for all nodes - */ - var calculateGravityForces = function( layoutInfo, options ){ - var distThreshold = 1; - - // var s = 'calculateGravityForces'; - // logDebug(s); - for( var i = 0; i < layoutInfo.graphSet.length; i ++ ){ - var graph = layoutInfo.graphSet[ i ]; - var numNodes = graph.length; - - // s = "Set: " + graph.toString(); - // logDebug(s); - - // Compute graph center - if( 0 === i ){ - var centerX = layoutInfo.clientHeight / 2; - var centerY = layoutInfo.clientWidth / 2; - } else { - // Get Parent node for this graph, and use its position as center - var temp = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ graph[0] ] ]; - var parent = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ temp.parentId ] ]; - var centerX = parent.positionX; - var centerY = parent.positionY; - } - // s = "Center found at: " + centerX + ", " + centerY; - // logDebug(s); - - // Apply force to all nodes in graph - for( var j = 0; j < numNodes; j++ ){ - var node = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ graph[ j ] ] ]; - // s = "Node: " + node.id; - - if( node.isLocked ){ continue; } - - var dx = centerX - node.positionX; - var dy = centerY - node.positionY; - var d = Math.sqrt( dx * dx + dy * dy ); - if( d > distThreshold ){ - var fx = options.gravity * dx / d; - var fy = options.gravity * dy / d; - node.offsetX += fx; - node.offsetY += fy; - // s += ": Applied force: " + fx + ", " + fy; - } else { - // s += ": skypped since it's too close to center"; - } - // logDebug(s); - } - } - }; - - /** - * @brief : This function propagates the existing offsets from - * parent nodes to its descendents. - * @arg layoutInfo : layoutInfo Object - * @arg cy : cytoscape Object - * @arg options : Layout options - */ - var propagateForces = function( layoutInfo, options ){ - // Inline implementation of a queue, used for traversing the graph in BFS order - var queue = []; - var start = 0; // Points to the start the queue - var end = -1; // Points to the end of the queue - - // logDebug('propagateForces'); - - // Start by visiting the nodes in the root graph - queue.push.apply( queue, layoutInfo.graphSet[0] ); - end += layoutInfo.graphSet[0].length; - - // Traverse the graph, level by level, - while( start <= end ){ - // Get the node to visit and remove it from queue - var nodeId = queue[ start++ ]; - var nodeIndex = layoutInfo.idToIndex[ nodeId ]; - var node = layoutInfo.layoutNodes[ nodeIndex ]; - var children = node.children; - - // We only need to process the node if it's compound - if( 0 < children.length && !node.isLocked ){ - var offX = node.offsetX; - var offY = node.offsetY; - - // var s = "Propagating offset from parent node : " + node.id + - // ". OffsetX: " + offX + ". OffsetY: " + offY; - // s += "\n Children: " + children.toString(); - // logDebug(s); - - for( var i = 0; i < children.length; i++ ){ - var childNode = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ children[ i ] ] ]; - // Propagate offset - childNode.offsetX += offX; - childNode.offsetY += offY; - // Add children to queue to be visited - queue[ ++end ] = children[ i ]; - } - - // Reset parent offsets - node.offsetX = 0; - node.offsetY = 0; - } - - } - }; - - /** - * @brief : Updates the layout model positions, based on - * the accumulated forces - */ - var updatePositions = function( layoutInfo, options ){ - // var s = 'Updating positions'; - // logDebug(s); - - // Reset boundaries for compound nodes - for( var i = 0; i < layoutInfo.nodeSize; i++ ){ - var n = layoutInfo.layoutNodes[ i ]; - if( 0 < n.children.length ){ - // logDebug("Resetting boundaries of compound node: " + n.id); - n.maxX = undefined; - n.minX = undefined; - n.maxY = undefined; - n.minY = undefined; - } - } - - for( var i = 0; i < layoutInfo.nodeSize; i++ ){ - var n = layoutInfo.layoutNodes[ i ]; - if( 0 < n.children.length || n.isLocked ){ - // No need to set compound or locked node position - // logDebug("Skipping position update of node: " + n.id); - continue; - } - // s = "Node: " + n.id + " Previous position: (" + - // n.positionX + ", " + n.positionY + ")."; - - // Limit displacement in order to improve stability - var tempForce = limitForce( n.offsetX, n.offsetY, layoutInfo.temperature ); - n.positionX += tempForce.x; - n.positionY += tempForce.y; - n.offsetX = 0; - n.offsetY = 0; - n.minX = n.positionX - n.width; - n.maxX = n.positionX + n.width; - n.minY = n.positionY - n.height; - n.maxY = n.positionY + n.height; - // s += " New Position: (" + n.positionX + ", " + n.positionY + ")."; - // logDebug(s); - - // Update ancestry boudaries - updateAncestryBoundaries( n, layoutInfo ); - } - - // Update size, position of compund nodes - for( var i = 0; i < layoutInfo.nodeSize; i++ ){ - var n = layoutInfo.layoutNodes[ i ]; - if( 0 < n.children.length && !n.isLocked ){ - n.positionX = (n.maxX + n.minX) / 2; - n.positionY = (n.maxY + n.minY) / 2; - n.width = n.maxX - n.minX; - n.height = n.maxY - n.minY; - // s = "Updating position, size of compound node " + n.id; - // s += "\nPositionX: " + n.positionX + ", PositionY: " + n.positionY; - // s += "\nWidth: " + n.width + ", Height: " + n.height; - // logDebug(s); - } - } - }; - - /** - * @brief : Limits a force (forceX, forceY) to be not - * greater (in modulo) than max. - 8 Preserves force direction. - */ - var limitForce = function( forceX, forceY, max ){ - // var s = "Limiting force: (" + forceX + ", " + forceY + "). Max: " + max; - var force = Math.sqrt( forceX * forceX + forceY * forceY ); - - if( force > max ){ - var res = { - x: max * forceX / force, - y: max * forceY / force - }; - - } else { - var res = { - x: forceX, - y: forceY - }; - } - - // s += ".\nResult: (" + res.x + ", " + res.y + ")"; - // logDebug(s); - - return res; - }; - - /** - * @brief : Function used for keeping track of compound node - * sizes, since they should bound all their subnodes. - */ - var updateAncestryBoundaries = function( node, layoutInfo ){ - // var s = "Propagating new position/size of node " + node.id; - var parentId = node.parentId; - if( null == parentId ){ - // If there's no parent, we are done - // s += ". No parent node."; - // logDebug(s); - return; - } - - // Get Parent Node - var p = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ parentId ] ]; - var flag = false; - - // MaxX - if( null == p.maxX || node.maxX + p.padRight > p.maxX ){ - p.maxX = node.maxX + p.padRight; - flag = true; - // s += "\nNew maxX for parent node " + p.id + ": " + p.maxX; - } - - // MinX - if( null == p.minX || node.minX - p.padLeft < p.minX ){ - p.minX = node.minX - p.padLeft; - flag = true; - // s += "\nNew minX for parent node " + p.id + ": " + p.minX; - } - - // MaxY - if( null == p.maxY || node.maxY + p.padBottom > p.maxY ){ - p.maxY = node.maxY + p.padBottom; - flag = true; - // s += "\nNew maxY for parent node " + p.id + ": " + p.maxY; - } - - // MinY - if( null == p.minY || node.minY - p.padTop < p.minY ){ - p.minY = node.minY - p.padTop; - flag = true; - // s += "\nNew minY for parent node " + p.id + ": " + p.minY; - } - - // If updated boundaries, propagate changes upward - if( flag ){ - // logDebug(s); - return updateAncestryBoundaries( p, layoutInfo ); - } - - // s += ". No changes in boundaries/position of parent node " + p.id; - // logDebug(s); - return; - }; - - var separateComponents = function( layutInfo, options ){ - var nodes = layoutInfo.layoutNodes; - var components = []; - - for( var i = 0; i < nodes.length; i++ ){ - var node = nodes[ i ]; - var cid = node.cmptId; - var component = components[ cid ] = components[ cid ] || []; - - component.push( node ); - } - - var totalA = 0; - - for( var i = 0; i < components.length; i++ ){ - var c = components[ i ]; - - if( !c ){ continue; } - - c.x1 = Infinity; - c.x2 = -Infinity; - c.y1 = Infinity; - c.y2 = -Infinity; - - for( var j = 0; j < c.length; j++ ){ - var n = c[ j ]; - - c.x1 = Math.min( c.x1, n.positionX - n.width / 2 ); - c.x2 = Math.max( c.x2, n.positionX + n.width / 2 ); - c.y1 = Math.min( c.y1, n.positionY - n.height / 2 ); - c.y2 = Math.max( c.y2, n.positionY + n.height / 2 ); - } - - c.w = c.x2 - c.x1; - c.h = c.y2 - c.y1; - - totalA += c.w * c.h; - } - - components.sort( function( c1, c2 ){ - return c2.w * c2.h - c1.w * c1.h; - } ); - - var x = 0; - var y = 0; - var usedW = 0; - var rowH = 0; - var maxRowW = Math.sqrt( totalA ) * layoutInfo.clientWidth / layoutInfo.clientHeight; - - for( var i = 0; i < components.length; i++ ){ - var c = components[ i ]; - - if( !c ){ continue; } - - for( var j = 0; j < c.length; j++ ){ - var n = c[ j ]; - - if( !n.isLocked ){ - n.positionX += x; - n.positionY += y; - } - } - - x += c.w + options.componentSpacing; - usedW += c.w + options.componentSpacing; - rowH = Math.max( rowH, c.h ); - - if( usedW > maxRowW ){ - y += rowH + options.componentSpacing; - x = 0; - usedW = 0; - rowH = 0; - } - } - }; - - var mainLoop = function( i ){ - if( stopped ){ - // logDebug("Layout manually stopped. Stopping computation in step " + i); - return false; - } - - // Do one step in the phisical simulation - step( layoutInfo, options, i ); - - // Update temperature - layoutInfo.temperature = layoutInfo.temperature * options.coolingFactor; - // logDebug("New temperature: " + layoutInfo.temperature); - - if( layoutInfo.temperature < options.minTemp ){ - // logDebug("Temperature drop below minimum threshold. Stopping computation in step " + i); - return false; - } - - return true; - }; - - var i = 0; - var loopRet; - - do { - var f = 0; - - while( f < options.refresh && i < options.numIter ){ - var loopRet = mainLoop( i ); - if( !loopRet ){ break; } - - f++; - i++; - } - - if( options.animate === true ){ - broadcast( layoutInfo.layoutNodes ); // eslint-disable-line no-undef - } - - } while( loopRet && i + 1 < options.numIter ); - - separateComponents( layoutInfo, options ); - - return layoutInfo; - } ).then( function( layoutInfoUpdated ){ - layoutInfo.layoutNodes = layoutInfoUpdated.layoutNodes; // get the positions - - thread.stop(); - done(); - } ); - - var done = function(){ - if( options.animate === true || options.animate === false ){ - refresh({ - force: true, - next: function(){ - // Layout has finished - layout.one('layoutstop', options.stop); - layout.emit({ type: 'layoutstop', layout: layout }); - } - }); - } else { - options.eles.nodes().layoutPositions( layout, options, function( node ){ - var lnode = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ node.data( 'id' ) ] ]; - - return { x: lnode.positionX, y: lnode.positionY }; - } ); - } - }; - - return this; // chaining -}; - - -/** - * @brief : called on continuous layouts to stop them before they finish - */ -CoseLayout.prototype.stop = function(){ - this.stopped = true; - - if( this.thread ){ - this.thread.stop(); - } - - this.emit( 'layoutstop' ); - - return this; // chaining -}; - -CoseLayout.prototype.destroy = function(){ - if( this.thread ){ - this.thread.stop(); - } - - return this; // chaining -}; - - -/** - * @brief : Creates an object which is contains all the data - * used in the layout process - * @arg cy : cytoscape.js object - * @return : layoutInfo object initialized - */ -var createLayoutInfo = function( cy, layout, options ){ - // Shortcut - var edges = options.eles.edges(); - var nodes = options.eles.nodes(); - - var layoutInfo = { - isCompound: cy.hasCompoundNodes(), - layoutNodes: [], - idToIndex: {}, - nodeSize: nodes.size(), - graphSet: [], - indexToGraph: [], - layoutEdges: [], - edgeSize: edges.size(), - temperature: options.initialTemp, - clientWidth: cy.width(), - clientHeight: cy.width(), - boundingBox: math.makeBoundingBox( options.boundingBox ? options.boundingBox : { - x1: 0, y1: 0, w: cy.width(), h: cy.height() - } ) - }; - - var components = options.eles.components(); - var id2cmptId = {}; - - for( var i = 0; i < components.length; i++ ){ - var component = components[ i ]; - - for( var j = 0; j < component.length; j++ ){ - var node = component[ j ]; - - id2cmptId[ node.id() ] = i; - } - } - - // Iterate over all nodes, creating layout nodes - for( var i = 0; i < layoutInfo.nodeSize; i++ ){ - var n = nodes[ i ]; - var nbb = n.layoutDimensions( options ); - - var tempNode = {}; - tempNode.isLocked = n.locked(); - tempNode.id = n.data( 'id' ); - tempNode.parentId = n.data( 'parent' ); - tempNode.cmptId = id2cmptId[ n.id() ]; - tempNode.children = []; - tempNode.positionX = n.position( 'x' ); - tempNode.positionY = n.position( 'y' ); - tempNode.offsetX = 0; - tempNode.offsetY = 0; - tempNode.height = nbb.w; - tempNode.width = nbb.h; - tempNode.maxX = tempNode.positionX + tempNode.width / 2; - tempNode.minX = tempNode.positionX - tempNode.width / 2; - tempNode.maxY = tempNode.positionY + tempNode.height / 2; - tempNode.minY = tempNode.positionY - tempNode.height / 2; - tempNode.padLeft = parseFloat( n.style( 'padding' ) ); - tempNode.padRight = parseFloat( n.style( 'padding' ) ); - tempNode.padTop = parseFloat( n.style( 'padding' ) ); - tempNode.padBottom = parseFloat( n.style( 'padding' ) ); - - // forces - tempNode.nodeRepulsion = is.fn( options.nodeRepulsion ) ? options.nodeRepulsion(n) : options.nodeRepulsion; - - // Add new node - layoutInfo.layoutNodes.push( tempNode ); - // Add entry to id-index map - layoutInfo.idToIndex[ tempNode.id ] = i; - } - - // Inline implementation of a queue, used for traversing the graph in BFS order - var queue = []; - var start = 0; // Points to the start the queue - var end = -1; // Points to the end of the queue - - var tempGraph = []; - - // Second pass to add child information and - // initialize queue for hierarchical traversal - for( var i = 0; i < layoutInfo.nodeSize; i++ ){ - var n = layoutInfo.layoutNodes[ i ]; - var p_id = n.parentId; - // Check if node n has a parent node - if( null != p_id ){ - // Add node Id to parent's list of children - layoutInfo.layoutNodes[ layoutInfo.idToIndex[ p_id ] ].children.push( n.id ); - } else { - // If a node doesn't have a parent, then it's in the root graph - queue[ ++end ] = n.id; - tempGraph.push( n.id ); - } - } - - // Add root graph to graphSet - layoutInfo.graphSet.push( tempGraph ); - - // Traverse the graph, level by level, - while( start <= end ){ - // Get the node to visit and remove it from queue - var node_id = queue[ start++ ]; - var node_ix = layoutInfo.idToIndex[ node_id ]; - var node = layoutInfo.layoutNodes[ node_ix ]; - var children = node.children; - if( children.length > 0 ){ - // Add children nodes as a new graph to graph set - layoutInfo.graphSet.push( children ); - // Add children to que queue to be visited - for( var i = 0; i < children.length; i++ ){ - queue[ ++end ] = children[ i ]; - } - } - } - - // Create indexToGraph map - for( var i = 0; i < layoutInfo.graphSet.length; i++ ){ - var graph = layoutInfo.graphSet[ i ]; - for( var j = 0; j < graph.length; j++ ){ - var index = layoutInfo.idToIndex[ graph[ j ] ]; - layoutInfo.indexToGraph[ index ] = i; - } - } - - // Iterate over all edges, creating Layout Edges - for( var i = 0; i < layoutInfo.edgeSize; i++ ){ - var e = edges[ i ]; - var tempEdge = {}; - tempEdge.id = e.data( 'id' ); - tempEdge.sourceId = e.data( 'source' ); - tempEdge.targetId = e.data( 'target' ); - - // Compute ideal length - var idealLength = is.fn( options.idealEdgeLength ) ? options.idealEdgeLength(e) : options.idealEdgeLength; - var elasticity = is.fn( options.edgeElasticity ) ? options.edgeElasticity(e) : options.edgeElasticity; - - // Check if it's an inter graph edge - var sourceIx = layoutInfo.idToIndex[ tempEdge.sourceId ]; - var targetIx = layoutInfo.idToIndex[ tempEdge.targetId ]; - var sourceGraph = layoutInfo.indexToGraph[ sourceIx ]; - var targetGraph = layoutInfo.indexToGraph[ targetIx ]; - - if( sourceGraph != targetGraph ){ - // Find lowest common graph ancestor - var lca = findLCA( tempEdge.sourceId, tempEdge.targetId, layoutInfo ); - - // Compute sum of node depths, relative to lca graph - var lcaGraph = layoutInfo.graphSet[ lca ]; - var depth = 0; - - // Source depth - var tempNode = layoutInfo.layoutNodes[ sourceIx ]; - while( -1 === lcaGraph.indexOf( tempNode.id ) ){ - tempNode = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ tempNode.parentId ] ]; - depth++; - } - - // Target depth - tempNode = layoutInfo.layoutNodes[ targetIx ]; - while( -1 === lcaGraph.indexOf( tempNode.id ) ){ - tempNode = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ tempNode.parentId ] ]; - depth++; - } - - // logDebug('LCA of nodes ' + tempEdge.sourceId + ' and ' + tempEdge.targetId + - // ". Index: " + lca + " Contents: " + lcaGraph.toString() + - // ". Depth: " + depth); - - // Update idealLength - idealLength *= depth * options.nestingFactor; - } - - tempEdge.idealLength = idealLength; - tempEdge.elasticity = elasticity; - - layoutInfo.layoutEdges.push( tempEdge ); - } - - // Finally, return layoutInfo object - return layoutInfo; -}; - - -/** - * @brief : This function finds the index of the lowest common - * graph ancestor between 2 nodes in the subtree - * (from the graph hierarchy induced tree) whose - * root is graphIx - * - * @arg node1: node1's ID - * @arg node2: node2's ID - * @arg layoutInfo: layoutInfo object - * - */ -var findLCA = function( node1, node2, layoutInfo ){ - // Find their common ancester, starting from the root graph - var res = findLCA_aux( node1, node2, 0, layoutInfo ); - if( 2 > res.count ){ - // If aux function couldn't find the common ancester, - // then it is the root graph - return 0; - } else { - return res.graph; - } -}; - - -/** - * @brief : Auxiliary function used for LCA computation - * - * @arg node1 : node1's ID - * @arg node2 : node2's ID - * @arg graphIx : subgraph index - * @arg layoutInfo : layoutInfo object - * - * @return : object of the form {count: X, graph: Y}, where: - * X is the number of ancesters (max: 2) found in - * graphIx (and it's subgraphs), - * Y is the graph index of the lowest graph containing - * all X nodes - */ -var findLCA_aux = function( node1, node2, graphIx, layoutInfo ){ - var graph = layoutInfo.graphSet[ graphIx ]; - // If both nodes belongs to graphIx - if( -1 < graph.indexOf( node1 ) && -1 < graph.indexOf( node2 ) ){ - return {count: 2, graph: graphIx}; - } - - // Make recursive calls for all subgraphs - var c = 0; - for( var i = 0; i < graph.length; i++ ){ - var nodeId = graph[ i ]; - var nodeIx = layoutInfo.idToIndex[ nodeId ]; - var children = layoutInfo.layoutNodes[ nodeIx ].children; - - // If the node has no child, skip it - if( 0 === children.length ){ - continue; - } - - var childGraphIx = layoutInfo.indexToGraph[ layoutInfo.idToIndex[ children[0] ] ]; - var result = findLCA_aux( node1, node2, childGraphIx, layoutInfo ); - if( 0 === result.count ){ - // Neither node1 nor node2 are present in this subgraph - continue; - } else if( 1 === result.count ){ - // One of (node1, node2) is present in this subgraph - c++; - if( 2 === c ){ - // We've already found both nodes, no need to keep searching - break; - } - } else { - // Both nodes are present in this subgraph - return result; - } - } - - return {count: c, graph: graphIx}; -}; - - -/** - * @brief: printsLayoutInfo into js console - * Only used for debbuging - */ -var printLayoutInfo = function( layoutInfo ){ - /* eslint-disable */ - - if( !DEBUG ){ - return; - } - console.debug( 'layoutNodes:' ); - for( var i = 0; i < layoutInfo.nodeSize; i++ ){ - var n = layoutInfo.layoutNodes[ i ]; - var s = - '\nindex: ' + i + - '\nId: ' + n.id + - '\nChildren: ' + n.children.toString() + - '\nparentId: ' + n.parentId + - '\npositionX: ' + n.positionX + - '\npositionY: ' + n.positionY + - '\nOffsetX: ' + n.offsetX + - '\nOffsetY: ' + n.offsetY + - '\npadLeft: ' + n.padLeft + - '\npadRight: ' + n.padRight + - '\npadTop: ' + n.padTop + - '\npadBottom: ' + n.padBottom; - - console.debug( s ); - } - - console.debug( 'idToIndex' ); - for( var i in layoutInfo.idToIndex ){ - console.debug( 'Id: ' + i + '\nIndex: ' + layoutInfo.idToIndex[ i ] ); - } - - console.debug( 'Graph Set' ); - var set = layoutInfo.graphSet; - for( var i = 0; i < set.length; i ++ ){ - console.debug( 'Set : ' + i + ': ' + set[ i ].toString() ); - } - - var s = 'IndexToGraph'; - for( var i = 0; i < layoutInfo.indexToGraph.length; i ++ ){ - s += '\nIndex : ' + i + ' Graph: ' + layoutInfo.indexToGraph[ i ]; - } - console.debug( s ); - - s = 'Layout Edges'; - for( var i = 0; i < layoutInfo.layoutEdges.length; i++ ){ - var e = layoutInfo.layoutEdges[ i ]; - s += '\nEdge Index: ' + i + ' ID: ' + e.id + - ' SouceID: ' + e.sourceId + ' TargetId: ' + e.targetId + - ' Ideal Length: ' + e.idealLength; - } - console.debug( s ); - - s = 'nodeSize: ' + layoutInfo.nodeSize; - s += '\nedgeSize: ' + layoutInfo.edgeSize; - s += '\ntemperature: ' + layoutInfo.temperature; - console.debug( s ); - - return; - /* eslint-enable */ -}; - - -/** - * @brief : Randomizes the position of all nodes - */ -var randomizePositions = function( layoutInfo, cy ){ - var width = layoutInfo.clientWidth; - var height = layoutInfo.clientHeight; - - for( var i = 0; i < layoutInfo.nodeSize; i++ ){ - var n = layoutInfo.layoutNodes[ i ]; - - // No need to randomize compound nodes or locked nodes - if( 0 === n.children.length && !n.isLocked ){ - n.positionX = Math.random() * width; - n.positionY = Math.random() * height; - } - } -}; - - -/** - * @brief : Updates the positions of nodes in the network - * @arg layoutInfo : LayoutInfo object - * @arg cy : Cytoscape object - * @arg options : Layout options - */ -var refreshPositions = function( layoutInfo, cy, options ){ - // var s = 'Refreshing positions'; - // logDebug(s); - - var layout = options.layout; - var nodes = options.eles.nodes(); - var bb = layoutInfo.boundingBox; - var coseBB = { x1: Infinity, x2: -Infinity, y1: Infinity, y2: -Infinity }; - - if( options.boundingBox ){ - nodes.forEach( function( node ){ - var lnode = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ node.data( 'id' ) ] ]; - - coseBB.x1 = Math.min( coseBB.x1, lnode.positionX ); - coseBB.x2 = Math.max( coseBB.x2, lnode.positionX ); - - coseBB.y1 = Math.min( coseBB.y1, lnode.positionY ); - coseBB.y2 = Math.max( coseBB.y2, lnode.positionY ); - } ); - - coseBB.w = coseBB.x2 - coseBB.x1; - coseBB.h = coseBB.y2 - coseBB.y1; - } - - nodes.positions( function( ele, i ){ - var lnode = layoutInfo.layoutNodes[ layoutInfo.idToIndex[ ele.data( 'id' ) ] ]; - // s = "Node: " + lnode.id + ". Refreshed position: (" + - // lnode.positionX + ", " + lnode.positionY + ")."; - // logDebug(s); - - if( options.boundingBox ){ // then add extra bounding box constraint - var pctX = (lnode.positionX - coseBB.x1) / coseBB.w; - var pctY = (lnode.positionY - coseBB.y1) / coseBB.h; - - return { - x: bb.x1 + pctX * bb.w, - y: bb.y1 + pctY * bb.h - }; - } else { - return { - x: lnode.positionX, - y: lnode.positionY - }; - } - } ); - - // Trigger layoutReady only on first call - if( true !== layoutInfo.ready ){ - // s = 'Triggering layoutready'; - // logDebug(s); - layoutInfo.ready = true; - layout.one( 'layoutready', options.ready ); - layout.emit( { type: 'layoutready', layout: this } ); - } -}; - -/** - * @brief : Logs a debug message in JS console, if DEBUG is ON - */ -// var logDebug = function(text) { -// if (DEBUG) { -// console.debug(text); -// } -// }; - -module.exports = CoseLayout; diff --git a/node_modules/cytoscape/src/extensions/layout/grid.js b/node_modules/cytoscape/src/extensions/layout/grid.js deleted file mode 100644 index 70753b9ae..000000000 --- a/node_modules/cytoscape/src/extensions/layout/grid.js +++ /dev/null @@ -1,247 +0,0 @@ -let util = require( '../../util' ); -let math = require( '../../math' ); - -let defaults = { - fit: true, // whether to fit the viewport to the graph - padding: 30, // padding used on fit - boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space - avoidOverlapPadding: 10, // extra spacing around nodes when avoidOverlap: true - nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm - spacingFactor: undefined, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up - condense: false, // uses all available space on false, uses minimal space on true - rows: undefined, // force num of rows in the grid - cols: undefined, // force num of columns in the grid - position: function( node ){}, // returns { row, col } for element - sort: undefined, // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } - animate: false, // whether to transition the node positions - animationDuration: 500, // duration of animation in ms if enabled - animationEasing: undefined, // easing of animation if enabled - animateFilter: function ( node, i ){ return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts - ready: undefined, // callback on layoutready - stop: undefined, // callback on layoutstop - transform: function (node, position ){ return position; } // transform a given node position. Useful for changing flow direction in discrete layouts -}; - -function GridLayout( options ){ - this.options = util.extend( {}, defaults, options ); -} - -GridLayout.prototype.run = function(){ - let params = this.options; - let options = params; - - let cy = params.cy; - let eles = options.eles; - let nodes = eles.nodes().not( ':parent' ); - - if( options.sort ){ - nodes = nodes.sort( options.sort ); - } - - let bb = math.makeBoundingBox( options.boundingBox ? options.boundingBox : { - x1: 0, y1: 0, w: cy.width(), h: cy.height() - } ); - - if( bb.h === 0 || bb.w === 0 ){ - nodes.layoutPositions( this, options, function( ele ){ - return { x: bb.x1, y: bb.y1 }; - } ); - - } else { - - // width/height * splits^2 = cells where splits is number of times to split width - let cells = nodes.size(); - let splits = Math.sqrt( cells * bb.h / bb.w ); - let rows = Math.round( splits ); - let cols = Math.round( bb.w / bb.h * splits ); - - let small = function( val ){ - if( val == null ){ - return Math.min( rows, cols ); - } else { - let min = Math.min( rows, cols ); - if( min == rows ){ - rows = val; - } else { - cols = val; - } - } - }; - - let large = function( val ){ - if( val == null ){ - return Math.max( rows, cols ); - } else { - let max = Math.max( rows, cols ); - if( max == rows ){ - rows = val; - } else { - cols = val; - } - } - }; - - let oRows = options.rows; - let oCols = options.cols != null ? options.cols : options.columns; - - // if rows or columns were set in options, use those values - if( oRows != null && oCols != null ){ - rows = oRows; - cols = oCols; - } else if( oRows != null && oCols == null ){ - rows = oRows; - cols = Math.ceil( cells / rows ); - } else if( oRows == null && oCols != null ){ - cols = oCols; - rows = Math.ceil( cells / cols ); - } - - // otherwise use the automatic values and adjust accordingly - - // if rounding was up, see if we can reduce rows or columns - else if( cols * rows > cells ){ - let sm = small(); - let lg = large(); - - // reducing the small side takes away the most cells, so try it first - if( (sm - 1) * lg >= cells ){ - small( sm - 1 ); - } else if( (lg - 1) * sm >= cells ){ - large( lg - 1 ); - } - } else { - - // if rounding was too low, add rows or columns - while( cols * rows < cells ){ - let sm = small(); - let lg = large(); - - // try to add to larger side first (adds less in multiplication) - if( (lg + 1) * sm >= cells ){ - large( lg + 1 ); - } else { - small( sm + 1 ); - } - } - } - - let cellWidth = bb.w / cols; - let cellHeight = bb.h / rows; - - if( options.condense ){ - cellWidth = 0; - cellHeight = 0; - } - - if( options.avoidOverlap ){ - for( let i = 0; i < nodes.length; i++ ){ - let node = nodes[ i ]; - let pos = node._private.position; - - if( pos.x == null || pos.y == null ){ // for bb - pos.x = 0; - pos.y = 0; - } - - let nbb = node.layoutDimensions( options ); - let p = options.avoidOverlapPadding; - - let w = nbb.w + p; - let h = nbb.h + p; - - cellWidth = Math.max( cellWidth, w ); - cellHeight = Math.max( cellHeight, h ); - } - } - - let cellUsed = {}; // e.g. 'c-0-2' => true - - let used = function( row, col ){ - return cellUsed[ 'c-' + row + '-' + col ] ? true : false; - }; - - let use = function( row, col ){ - cellUsed[ 'c-' + row + '-' + col ] = true; - }; - - // to keep track of current cell position - let row = 0; - let col = 0; - let moveToNextCell = function(){ - col++; - if( col >= cols ){ - col = 0; - row++; - } - }; - - // get a cache of all the manual positions - let id2manPos = {}; - for( let i = 0; i < nodes.length; i++ ){ - let node = nodes[ i ]; - let rcPos = options.position( node ); - - if( rcPos && (rcPos.row !== undefined || rcPos.col !== undefined) ){ // must have at least row or col def'd - let pos = { - row: rcPos.row, - col: rcPos.col - }; - - if( pos.col === undefined ){ // find unused col - pos.col = 0; - - while( used( pos.row, pos.col ) ){ - pos.col++; - } - } else if( pos.row === undefined ){ // find unused row - pos.row = 0; - - while( used( pos.row, pos.col ) ){ - pos.row++; - } - } - - id2manPos[ node.id() ] = pos; - use( pos.row, pos.col ); - } - } - - let getPos = function( element, i ){ - let x, y; - - if( element.locked() || element.isParent() ){ - return false; - } - - // see if we have a manual position set - let rcPos = id2manPos[ element.id() ]; - if( rcPos ){ - x = rcPos.col * cellWidth + cellWidth / 2 + bb.x1; - y = rcPos.row * cellHeight + cellHeight / 2 + bb.y1; - - } else { // otherwise set automatically - - while( used( row, col ) ){ - moveToNextCell(); - } - - x = col * cellWidth + cellWidth / 2 + bb.x1; - y = row * cellHeight + cellHeight / 2 + bb.y1; - use( row, col ); - - moveToNextCell(); - } - - return { x: x, y: y }; - - }; - - nodes.layoutPositions( this, options, getPos ); - } - - return this; // chaining - -}; - -module.exports = GridLayout; diff --git a/node_modules/cytoscape/src/extensions/layout/index.js b/node_modules/cytoscape/src/extensions/layout/index.js deleted file mode 100644 index 075dce771..000000000 --- a/node_modules/cytoscape/src/extensions/layout/index.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = [ - { name: 'breadthfirst', impl: require( './breadthfirst' ) }, - { name: 'circle', impl: require( './circle' ) }, - { name: 'concentric',impl: require( './concentric' ) }, - { name: 'cose', impl: require( './cose' ) }, - { name: 'grid', impl: require( './grid' ) }, - { name: 'null', impl: require( './null' ) }, - { name: 'preset', impl: require( './preset' ) }, - { name: 'random', impl: require( './random' ) } -]; diff --git a/node_modules/cytoscape/src/extensions/layout/null.js b/node_modules/cytoscape/src/extensions/layout/null.js deleted file mode 100644 index 0a738c922..000000000 --- a/node_modules/cytoscape/src/extensions/layout/null.js +++ /dev/null @@ -1,50 +0,0 @@ -let util = require( '../../util' ); - -// default layout options -let defaults = { - ready: function(){}, // on layoutready - stop: function(){} // on layoutstop -}; - -// constructor -// options : object containing layout options -function NullLayout( options ){ - this.options = util.extend( {}, defaults, options ); -} - -// runs the layout -NullLayout.prototype.run = function(){ - let options = this.options; - let eles = options.eles; // elements to consider in the layout - let layout = this; - - // cy is automatically populated for us in the constructor - let cy = options.cy; // jshint ignore:line - - layout.emit( 'layoutstart' ); - - // puts all nodes at (0, 0) - eles.nodes().positions( function(){ - return { - x: 0, - y: 0 - }; - } ); - - // trigger layoutready when each node has had its position set at least once - layout.one( 'layoutready', options.ready ); - layout.emit( 'layoutready' ); - - // trigger layoutstop when the layout stops (e.g. finishes) - layout.one( 'layoutstop', options.stop ); - layout.emit( 'layoutstop' ); - - return this; // chaining -}; - -// called on continuous layouts to stop them before they finish -NullLayout.prototype.stop = function(){ - return this; // chaining -}; - -module.exports = NullLayout; diff --git a/node_modules/cytoscape/src/extensions/layout/preset.js b/node_modules/cytoscape/src/extensions/layout/preset.js deleted file mode 100644 index b4fd57338..000000000 --- a/node_modules/cytoscape/src/extensions/layout/preset.js +++ /dev/null @@ -1,61 +0,0 @@ -let util = require( '../../util' ); -let is = require( '../../is' ); - -let defaults = { - positions: undefined, // map of (node id) => (position obj); or function(node){ return somPos; } - zoom: undefined, // the zoom level to set (prob want fit = false if set) - pan: undefined, // the pan level to set (prob want fit = false if set) - fit: true, // whether to fit to viewport - padding: 30, // padding on fit - animate: false, // whether to transition the node positions - animationDuration: 500, // duration of animation in ms if enabled - animationEasing: undefined, // easing of animation if enabled - animateFilter: function ( node, i ){ return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts - ready: undefined, // callback on layoutready - stop: undefined, // callback on layoutstop - transform: function (node, position ){ return position; } // transform a given node position. Useful for changing flow direction in discrete layouts -}; - -function PresetLayout( options ){ - this.options = util.extend( {}, defaults, options ); -} - -PresetLayout.prototype.run = function(){ - let options = this.options; - let eles = options.eles; - - let nodes = eles.nodes(); - let posIsFn = is.fn( options.positions ); - - function getPosition( node ){ - if( options.positions == null ){ - return null; - } - - if( posIsFn ){ - return options.positions( node ); - } - - let pos = options.positions[ node._private.data.id ]; - - if( pos == null ){ - return null; - } - - return pos; - } - - nodes.layoutPositions( this, options, function( node, i ){ - let position = getPosition( node ); - - if( node.locked() || position == null ){ - return false; - } - - return position; - } ); - - return this; // chaining -}; - -module.exports = PresetLayout; diff --git a/node_modules/cytoscape/src/extensions/layout/random.js b/node_modules/cytoscape/src/extensions/layout/random.js deleted file mode 100644 index dd86871fb..000000000 --- a/node_modules/cytoscape/src/extensions/layout/random.js +++ /dev/null @@ -1,43 +0,0 @@ -let util = require( '../../util' ); -let math = require( '../../math' ); - -let defaults = { - fit: true, // whether to fit to viewport - padding: 30, // fit padding - boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } - animate: false, // whether to transition the node positions - animationDuration: 500, // duration of animation in ms if enabled - animationEasing: undefined, // easing of animation if enabled - animateFilter: function ( node, i ){ return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts - ready: undefined, // callback on layoutready - stop: undefined, // callback on layoutstop - transform: function (node, position ){ return position; } // transform a given node position. Useful for changing flow direction in discrete layouts -}; - -function RandomLayout( options ){ - this.options = util.extend( {}, defaults, options ); -} - -RandomLayout.prototype.run = function(){ - let options = this.options; - let cy = options.cy; - let eles = options.eles; - let nodes = eles.nodes().not( ':parent' ); - - let bb = math.makeBoundingBox( options.boundingBox ? options.boundingBox : { - x1: 0, y1: 0, w: cy.width(), h: cy.height() - } ); - - let getPos = function( node, i ){ - return { - x: bb.x1 + Math.round( Math.random() * bb.w ), - y: bb.y1 + Math.round( Math.random() * bb.h ) - }; - }; - - nodes.layoutPositions( this, options, getPos ); - - return this; // chaining -}; - -module.exports = RandomLayout; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/arrow-shapes.js b/node_modules/cytoscape/src/extensions/renderer/base/arrow-shapes.js deleted file mode 100644 index 999f93984..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/base/arrow-shapes.js +++ /dev/null @@ -1,312 +0,0 @@ -var math = require( '../../../math' ); -var is = require( '../../../is' ); -var util = require( '../../../util' ); - -var BRp = {}; - -BRp.arrowShapeWidth = 0.3; - -BRp.registerArrowShapes = function(){ - var arrowShapes = this.arrowShapes = {}; - var renderer = this; - - // Contract for arrow shapes: - // 0, 0 is arrow tip - // (0, 1) is direction towards node - // (1, 0) is right - // - // functional api: - // collide: check x, y in shape - // roughCollide: called before collide, no false negatives - // draw: draw - // spacing: dist(arrowTip, nodeBoundary) - // gap: dist(edgeTip, nodeBoundary), edgeTip may != arrowTip - - var bbCollide = function( x, y, size, angle, translation, edgeWidth, padding ){ - var x1 = translation.x - size / 2 - padding; - var x2 = translation.x + size / 2 + padding; - var y1 = translation.y - size / 2 - padding; - var y2 = translation.y + size / 2 + padding; - - var inside = (x1 <= x && x <= x2) && (y1 <= y && y <= y2); - - return inside; - }; - - var transform = function( x, y, size, angle, translation ){ - var xRotated = x * Math.cos( angle ) - y * Math.sin( angle ); - var yRotated = x * Math.sin( angle ) + y * Math.cos( angle ); - - var xScaled = xRotated * size; - var yScaled = yRotated * size; - - var xTranslated = xScaled + translation.x; - var yTranslated = yScaled + translation.y; - - return { - x: xTranslated, - y: yTranslated - }; - }; - - var transformPoints = function( pts, size, angle, translation ){ - var retPts = []; - - for( var i = 0; i < pts.length; i += 2 ){ - var x = pts[ i ]; - var y = pts[ i + 1]; - - retPts.push( transform( x, y, size, angle, translation ) ); - } - - return retPts; - }; - - var pointsToArr = function( pts ){ - var ret = []; - - for( var i = 0; i < pts.length; i++ ){ - var p = pts[ i ]; - - ret.push( p.x, p.y ); - } - - return ret; - }; - - var standardGap = function( edge ) { - return edge.pstyle( 'width' ).pfValue * edge.pstyle( 'arrow-scale' ).pfValue * 2; - }; - - var defineArrowShape = function( name, defn ){ - if( is.string( defn ) ){ - defn = arrowShapes[ defn ]; - } - - arrowShapes[ name ] = util.extend( { - name: name, - - points: [ - -0.15, -0.3, - 0.15, -0.3, - 0.15, 0.3, - -0.15, 0.3 - ], - - collide: function( x, y, size, angle, translation, padding ){ - var points = pointsToArr( transformPoints( this.points, size + 2 * padding, angle, translation ) ); - var inside = math.pointInsidePolygonPoints( x, y, points ); - - return inside; - }, - - roughCollide: bbCollide, - - draw: function( context, size, angle, translation ){ - var points = transformPoints( this.points, size, angle, translation ); - - renderer.arrowShapeImpl( 'polygon' )( context, points ); - }, - - spacing: function( edge ){ - return 0; - }, - - gap: standardGap - }, defn ); - }; - - defineArrowShape( 'none', { - collide: util.falsify, - - roughCollide: util.falsify, - - draw: util.noop, - - spacing: util.zeroify, - - gap: util.zeroify - } ); - - defineArrowShape( 'triangle', { - points: [ - -0.15, -0.3, - 0, 0, - 0.15, -0.3 - ] - } ); - - defineArrowShape( 'arrow', 'triangle' ); - - defineArrowShape( 'triangle-backcurve', { - points: arrowShapes[ 'triangle' ].points, - - controlPoint: [ 0, -0.15 ], - - roughCollide: bbCollide, - - draw: function( context, size, angle, translation, edgeWidth ){ - var ptsTrans = transformPoints( this.points, size, angle, translation ); - var ctrlPt = this.controlPoint; - var ctrlPtTrans = transform( ctrlPt[0], ctrlPt[1], size, angle, translation ); - - renderer.arrowShapeImpl( this.name )( context, ptsTrans, ctrlPtTrans ); - }, - - gap: function( edge ) { - return standardGap(edge) * 0.8; - } - } ); - - - defineArrowShape( 'triangle-tee', { - points: [ - -0.15, -0.3, - 0, 0, - 0.15, -0.3, - -0.15, -0.3 - ], - - pointsTee: [ - -0.15, -0.4, - -0.15, -0.5, - 0.15, -0.5, - 0.15, -0.4 - ], - - collide: function( x, y, size, angle, translation, edgeWidth, padding ){ - var triPts = pointsToArr( transformPoints( this.points, size + 2 * padding, angle, translation ) ); - var teePts = pointsToArr( transformPoints( this.pointsTee, size + 2 * padding, angle, translation ) ); - - var inside = math.pointInsidePolygonPoints( x, y, triPts ) || math.pointInsidePolygonPoints( x, y, teePts ); - - return inside; - }, - - draw: function( context, size, angle, translation, edgeWidth ){ - var triPts = transformPoints( this.points, size, angle, translation ); - var teePts = transformPoints( this.pointsTee, size, angle, translation ); - - renderer.arrowShapeImpl( this.name )( context, triPts, teePts ); - } - } ); - - defineArrowShape( 'triangle-cross', { - points: [ - -0.15, -0.3, - 0, 0, - 0.15, -0.3, - -0.15, -0.3 - ], - - baseCrossLinePts: [ - -0.15, -0.4, // first half of the rectangle - -0.15, -0.4, - 0.15, -0.4, // second half of the rectangle - 0.15, -0.4 - ], - - crossLinePts: function( size, edgeWidth ){ - // shift points so that the distance between the cross points matches edge width - var p = this.baseCrossLinePts.slice(); - var shiftFactor = edgeWidth / size; - var y0 = 3; - var y1 = 5; - - p[y0] = p[y0] - shiftFactor; - p[y1] = p[y1] - shiftFactor; - - return p; - }, - - collide: function( x, y, size, angle, translation, edgeWidth, padding ){ - var triPts = pointsToArr( transformPoints( this.points, size + 2 * padding, angle, translation ) ); - var teePts = pointsToArr( transformPoints( this.crossLinePts( size, edgeWidth ), size + 2 * padding, angle, translation ) ); - var inside = math.pointInsidePolygonPoints( x, y, triPts ) || math.pointInsidePolygonPoints( x, y, teePts ); - - return inside; - }, - - draw: function( context, size, angle, translation, edgeWidth ){ - var triPts = transformPoints( this.points, size, angle, translation ); - var crossLinePts = transformPoints( this.crossLinePts( size, edgeWidth ), size, angle, translation ); - - renderer.arrowShapeImpl( this.name )( context, triPts, crossLinePts ); - } - } ); - - defineArrowShape( 'vee', { - points: [ - -0.15, -0.3, - 0, 0, - 0.15, -0.3, - 0, -0.15 - ], - - gap: function( edge ){ - return standardGap(edge) * 0.525; - } - } ); - - defineArrowShape( 'circle', { - radius: 0.15, - - collide: function( x, y, size, angle, translation, edgeWidth, padding ){ - var t = translation; - var inside = ( Math.pow( t.x - x, 2 ) + Math.pow( t.y - y, 2 ) <= Math.pow( (size + 2 * padding) * this.radius, 2 ) ); - - return inside; - }, - - draw: function( context, size, angle, translation, edgeWidth ){ - renderer.arrowShapeImpl( this.name )( context, translation.x, translation.y, this.radius * size ); - }, - - spacing: function( edge ){ - return renderer.getArrowWidth( edge.pstyle( 'width' ).pfValue, edge.pstyle( 'arrow-scale' ).value ) - * this.radius; - } - } ); - - defineArrowShape( 'tee', { - points: [ - -0.15, 0, - -0.15, -0.1, - 0.15, -0.1, - 0.15, 0 - ], - - spacing: function( edge ){ - return 1; - }, - - gap: function( edge ){ - return 1; - } - } ); - - defineArrowShape( 'square', { - points: [ - -0.15, 0.00, - 0.15, 0.00, - 0.15, -0.3, - -0.15, -0.3 - ] - } ); - - defineArrowShape( 'diamond', { - points: [ - -0.15, -0.15, - 0, -0.3, - 0.15, -0.15, - 0, 0 - ], - - gap: function( edge ){ - return edge.pstyle( 'width' ).pfValue * edge.pstyle( 'arrow-scale' ).value; - } - } ); - -}; - -module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/coords.js b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/coords.js deleted file mode 100644 index 7d7606c03..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/coords.js +++ /dev/null @@ -1,400 +0,0 @@ -var window = require( '../../../../window' ); -var math = require( '../../../../math' ); -var util = require( '../../../../util' ); -var window = require( '../../../../window' ); - - -var BRp = {}; - -// Project mouse -BRp.projectIntoViewport = function( clientX, clientY ){ - var cy = this.cy; - var offsets = this.findContainerClientCoords(); - var offsetLeft = offsets[0]; - var offsetTop = offsets[1]; - var scale = offsets[4]; - var pan = cy.pan(); - var zoom = cy.zoom(); - - var x = ( (clientX - offsetLeft)/scale - pan.x ) / zoom; - var y = ( (clientY - offsetTop)/scale - pan.y ) / zoom; - - return [ x, y ]; -}; - -BRp.findContainerClientCoords = function(){ - if( this.containerBB ){ - return this.containerBB; - } - - var container = this.container; - var rect = container.getBoundingClientRect(); - var style = window.getComputedStyle( container ); - var styleValue = function( name ){ return parseFloat( style.getPropertyValue( name ) ); }; - - var padding = { - left: styleValue('padding-left'), - right: styleValue('padding-right'), - top: styleValue('padding-top'), - bottom: styleValue('padding-bottom') - }; - - var border = { - left: styleValue('border-left-width'), - right: styleValue('border-right-width'), - top: styleValue('border-top-width'), - bottom: styleValue('border-bottom-width') - }; - - var clientWidth = container.clientWidth; - var clientHeight = container.clientHeight; - - var paddingHor = padding.left + padding.right; - var paddingVer = padding.top + padding.bottom; - - var borderHor = border.left + border.right; - var borderVer = border.top + border.bottom; - - var scale = rect.width / ( clientWidth + borderHor ); - - var unscaledW = clientWidth - paddingHor; - var unscaledH = clientHeight - paddingVer; - - var scaledW = rect.width - (paddingHor + borderHor) * scale; - var scaledH = rect.height - (paddingVer + borderVer) * scale; - - var left = rect.left + padding.left + border.left; - var top = rect.top + padding.top + border.top; - - return ( this.containerBB = [ - left, - top, - unscaledW, - unscaledH, - scale - ] ); -}; - -BRp.invalidateContainerClientCoordsCache = function(){ - this.containerBB = null; -}; - -BRp.findNearestElement = function( x, y, interactiveElementsOnly, isTouch ){ - return this.findNearestElements( x, y, interactiveElementsOnly, isTouch )[0]; -}; - -BRp.findNearestElements = function( x, y, interactiveElementsOnly, isTouch ){ - var self = this; - var r = this; - var eles = r.getCachedZSortedEles(); - var near = []; // 1 node max, 1 edge max - var zoom = r.cy.zoom(); - var hasCompounds = r.cy.hasCompoundNodes(); - var edgeThreshold = (isTouch ? 24 : 8) / zoom; - var nodeThreshold = (isTouch ? 8 : 2) / zoom; - var labelThreshold = (isTouch ? 8 : 2) / zoom; - var minSqDist = Infinity; - var nearEdge; - var nearNode; - - if( interactiveElementsOnly ){ - eles = eles.interactive; - } - - function addEle( ele, sqDist ){ - if( ele.isNode() ){ - if( nearNode ){ - return; // can't replace node - } else { - nearNode = ele; - near.push( ele ); - } - } - - if( ele.isEdge() && ( sqDist == null || sqDist < minSqDist ) ){ - if( nearEdge ){ // then replace existing edge - // can replace only if same z-index - if( nearEdge.pstyle( 'z-index' ).value === ele.pstyle('z-index').value ){ - for( var i = 0; i < near.length; i++ ){ - if( near[i].isEdge() ){ - near[i] = ele; - nearEdge = ele; - minSqDist = sqDist != null ? sqDist : minSqDist; - break; - } - } - } - } else { - near.push( ele ); - nearEdge = ele; - minSqDist = sqDist != null ? sqDist : minSqDist; - } - } - } - - function checkNode( node ){ - var width = node.outerWidth() + 2 * nodeThreshold; - var height = node.outerHeight() + 2 * nodeThreshold; - var hw = width / 2; - var hh = height / 2; - var pos = node.position(); - - if( - pos.x - hw <= x && x <= pos.x + hw // bb check x - && - pos.y - hh <= y && y <= pos.y + hh // bb check y - ){ - var shape = r.nodeShapes[ self.getNodeShape( node ) ]; - - if( - shape.checkPoint( x, y, 0, width, height, pos.x, pos.y ) - ){ - addEle( node, 0 ); - return true; - } - - } - } - - function checkEdge( edge ){ - var _p = edge._private; - - var rs = _p.rscratch; - var styleWidth = edge.pstyle( 'width' ).pfValue; - var scale = edge.pstyle( 'arrow-scale' ).value; - var width = styleWidth / 2 + edgeThreshold; // more like a distance radius from centre - var widthSq = width * width; - var width2 = width * 2; - var src = _p.source; - var tgt = _p.target; - var inEdgeBB = false; - var sqDist; - - if( rs.edgeType === 'segments' || rs.edgeType === 'straight' || rs.edgeType === 'haystack' ){ - var pts = rs.allpts; - - for( var i = 0; i + 3 < pts.length; i += 2 ){ - if( - (inEdgeBB = math.inLineVicinity( x, y, pts[ i ], pts[ i + 1], pts[ i + 2], pts[ i + 3], width2 )) - && - widthSq > ( sqDist = math.sqdistToFiniteLine( x, y, pts[ i ], pts[ i + 1], pts[ i + 2], pts[ i + 3] ) ) - ){ - addEle( edge, sqDist ); - return true; - } - } - - } else if( rs.edgeType === 'bezier' || rs.edgeType === 'multibezier' || rs.edgeType === 'self' || rs.edgeType === 'compound' ){ - var pts = rs.allpts; - for( var i = 0; i + 5 < rs.allpts.length; i += 4 ){ - if( - (inEdgeBB = math.inBezierVicinity( x, y, pts[ i ], pts[ i + 1], pts[ i + 2], pts[ i + 3], pts[ i + 4], pts[ i + 5], width2 )) - && - (widthSq > (sqDist = math.sqdistToQuadraticBezier( x, y, pts[ i ], pts[ i + 1], pts[ i + 2], pts[ i + 3], pts[ i + 4], pts[ i + 5] )) ) - ){ - addEle( edge, sqDist ); - return true; - } - } - } - - // if we're close to the edge but didn't hit it, maybe we hit its arrows - - var src = src || _p.source; - var tgt = tgt || _p.target; - - var arSize = self.getArrowWidth( styleWidth, scale ); - - var arrows = [ - { name: 'source', x: rs.arrowStartX, y: rs.arrowStartY, angle: rs.srcArrowAngle }, - { name: 'target', x: rs.arrowEndX, y: rs.arrowEndY, angle: rs.tgtArrowAngle }, - { name: 'mid-source', x: rs.midX, y: rs.midY, angle: rs.midsrcArrowAngle }, - { name: 'mid-target', x: rs.midX, y: rs.midY, angle: rs.midtgtArrowAngle } - ]; - - for( var i = 0; i < arrows.length; i++ ){ - var ar = arrows[ i ]; - var shape = r.arrowShapes[ edge.pstyle( ar.name + '-arrow-shape' ).value ]; - var edgeWidth = edge.pstyle('width').pfValue; - if( - shape.roughCollide( x, y, arSize, ar.angle, { x: ar.x, y: ar.y }, edgeWidth, edgeThreshold ) - && - shape.collide( x, y, arSize, ar.angle, { x: ar.x, y: ar.y }, edgeWidth, edgeThreshold ) - ){ - addEle( edge ); - return true; - } - } - - // for compound graphs, hitting edge may actually want a connected node instead (b/c edge may have greater z-index precedence) - if( hasCompounds && near.length > 0 ){ - checkNode( src ); - checkNode( tgt ); - } - } - - function preprop( obj, name, pre ){ - return util.getPrefixedProperty( obj, name, pre ); - } - - function checkLabel( ele, prefix ){ - var _p = ele._private; - var th = labelThreshold; - - var prefixDash; - if( prefix ){ - prefixDash = prefix + '-'; - } else { - prefixDash = ''; - } - - var text = ele.pstyle( prefixDash + 'label' ).value; - var eventsEnabled = ele.pstyle( 'text-events' ).strValue === 'yes'; - - if( !eventsEnabled || !text ){ return; } - - var rstyle = _p.rstyle; - var bw = ele.pstyle('text-border-width').pfValue; - var pw = ele.pstyle('text-background-padding').pfValue; - var lw = preprop( rstyle, 'labelWidth', prefix ) + bw + 2*th + 2*pw; - var lh = preprop( rstyle, 'labelHeight', prefix ) + bw + 2*th + 2*pw; - var lx = preprop( rstyle, 'labelX', prefix ); - var ly = preprop( rstyle, 'labelY', prefix ); - - var theta = preprop( _p.rscratch, 'labelAngle', prefix ); - - var lx1 = lx - lw / 2; - var lx2 = lx + lw / 2; - var ly1 = ly - lh / 2; - var ly2 = ly + lh / 2; - - if( theta ){ - var cos = Math.cos( theta ); - var sin = Math.sin( theta ); - - var rotate = function( x, y ){ - x = x - lx; - y = y - ly; - - return { - x: x * cos - y * sin + lx, - y: x * sin + y * cos + ly - }; - }; - - var px1y1 = rotate( lx1, ly1 ); - var px1y2 = rotate( lx1, ly2 ); - var px2y1 = rotate( lx2, ly1 ); - var px2y2 = rotate( lx2, ly2 ); - - var points = [ - px1y1.x, px1y1.y, - px2y1.x, px2y1.y, - px2y2.x, px2y2.y, - px1y2.x, px1y2.y - ]; - - if( math.pointInsidePolygonPoints( x, y, points ) ){ - addEle( ele ); - return true; - } - } else { // do a cheaper bb check - var bb = { - w: lw, - h: lh, - x1: lx1, - x2: lx2, - y1: ly1, - y2: ly2 - }; - - if( math.inBoundingBox( bb, x, y ) ){ - addEle( ele ); - return true; - } - } - - } - - for( var i = eles.length - 1; i >= 0; i-- ){ // reverse order for precedence - var ele = eles[ i ]; - - if( ele.isNode() ){ - checkNode( ele ) || checkLabel( ele ); - - } else { // then edge - checkEdge( ele ) || checkLabel( ele ) || checkLabel( ele, 'source' ) || checkLabel( ele, 'target' ); - } - } - - return near; -}; - -// 'Give me everything from this box' -BRp.getAllInBox = function( x1, y1, x2, y2 ){ - var eles = this.getCachedZSortedEles().interactive; - var box = []; - - var x1c = Math.min( x1, x2 ); - var x2c = Math.max( x1, x2 ); - var y1c = Math.min( y1, y2 ); - var y2c = Math.max( y1, y2 ); - - x1 = x1c; - x2 = x2c; - y1 = y1c; - y2 = y2c; - - var boxBb = math.makeBoundingBox( { - x1: x1, y1: y1, - x2: x2, y2: y2 - } ); - - for( var e = 0; e < eles.length; e++ ){ - var ele = eles[e]; - - if( ele.isNode() ){ - var node = ele; - var nodeBb = node.boundingBox( { - includeNodes: true, - includeEdges: false, - includeLabels: false - } ); - - if( math.boundingBoxesIntersect( boxBb, nodeBb ) && !math.boundingBoxInBoundingBox( nodeBb, boxBb ) ){ - box.push( node ); - } - } else { - var edge = ele; - var _p = edge._private; - var rs = _p.rscratch; - - if( rs.startX != null && rs.startY != null && !math.inBoundingBox( boxBb, rs.startX, rs.startY ) ){ continue; } - if( rs.endX != null && rs.endY != null && !math.inBoundingBox( boxBb, rs.endX, rs.endY ) ){ continue; } - - if( rs.edgeType === 'bezier' || rs.edgeType === 'multibezier' || rs.edgeType === 'self' || rs.edgeType === 'compound' || rs.edgeType === 'segments' || rs.edgeType === 'haystack' ){ - - var pts = _p.rstyle.bezierPts || _p.rstyle.linePts || _p.rstyle.haystackPts; - var allInside = true; - - for( var i = 0; i < pts.length; i++ ){ - if( !math.pointInBoundingBox( boxBb, pts[ i ] ) ){ - allInside = false; - break; - } - } - - if( allInside ){ - box.push( edge ); - } - - } else if( rs.edgeType === 'haystack' || rs.edgeType === 'straight' ){ - box.push( edge ); - } - } - } - - return box; -}; - -module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-arrows.js b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-arrows.js deleted file mode 100644 index 58b66e13a..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-arrows.js +++ /dev/null @@ -1,179 +0,0 @@ -var math = require( '../../../../math' ); - -var BRp = {}; - -BRp.calculateArrowAngles = function( edge ){ - var rs = edge._private.rscratch; - var isHaystack = rs.edgeType === 'haystack'; - var isBezier = rs.edgeType === 'bezier'; - var isMultibezier = rs.edgeType === 'multibezier'; - var isSegments = rs.edgeType === 'segments'; - var isCompound = rs.edgeType === 'compound'; - var isSelf = rs.edgeType === 'self'; - - // Displacement gives direction for arrowhead orientation - var dispX, dispY; - var startX, startY, endX, endY, midX, midY; - - if( isHaystack ){ - startX = rs.haystackPts[0]; - startY = rs.haystackPts[1]; - endX = rs.haystackPts[2]; - endY = rs.haystackPts[3]; - } else { - startX = rs.arrowStartX; - startY = rs.arrowStartY; - endX = rs.arrowEndX; - endY = rs.arrowEndY; - } - - midX = rs.midX; - midY = rs.midY; - - // source - // - - if( isSegments ){ - dispX = startX - rs.segpts[0]; - dispY = startY - rs.segpts[1]; - } else if( isMultibezier || isCompound || isSelf || isBezier ){ - var pts = rs.allpts; - var bX = math.qbezierAt( pts[0], pts[2], pts[4], 0.1 ); - var bY = math.qbezierAt( pts[1], pts[3], pts[5], 0.1 ); - - dispX = startX - bX; - dispY = startY - bY; - } else { - dispX = startX - midX; - dispY = startY - midY; - } - - rs.srcArrowAngle = math.getAngleFromDisp( dispX, dispY ); - - // mid target - // - - var midX = rs.midX; - var midY = rs.midY; - - if( isHaystack ){ - midX = ( startX + endX ) / 2; - midY = ( startY + endY ) / 2; - } - - dispX = endX - startX; - dispY = endY - startY; - - if( isSegments ){ - var pts = rs.allpts; - - if( pts.length / 2 % 2 === 0 ){ - var i2 = pts.length / 2; - var i1 = i2 - 2; - - dispX = ( pts[ i2 ] - pts[ i1 ] ); - dispY = ( pts[ i2 + 1] - pts[ i1 + 1] ); - } else { - var i2 = pts.length / 2 - 1; - var i1 = i2 - 2; - var i3 = i2 + 2; - - dispX = ( pts[ i2 ] - pts[ i1 ] ); - dispY = ( pts[ i2 + 1] - pts[ i1 + 1] ); - } - } else if( isMultibezier || isCompound || isSelf ){ - var pts = rs.allpts; - var cpts = rs.ctrlpts; - var bp0x, bp0y; - var bp1x, bp1y; - - if( cpts.length / 2 % 2 === 0 ){ - var p0 = pts.length / 2 - 1; // startpt - var ic = p0 + 2; - var p1 = ic + 2; - - bp0x = math.qbezierAt( pts[ p0 ], pts[ ic ], pts[ p1 ], 0.0 ); - bp0y = math.qbezierAt( pts[ p0 + 1], pts[ ic + 1], pts[ p1 + 1], 0.0 ); - - bp1x = math.qbezierAt( pts[ p0 ], pts[ ic ], pts[ p1 ], 0.0001 ); - bp1y = math.qbezierAt( pts[ p0 + 1], pts[ ic + 1], pts[ p1 + 1], 0.0001 ); - } else { - var ic = pts.length / 2 - 1; // ctrpt - var p0 = ic - 2; // startpt - var p1 = ic + 2; // endpt - - bp0x = math.qbezierAt( pts[ p0 ], pts[ ic ], pts[ p1 ], 0.4999 ); - bp0y = math.qbezierAt( pts[ p0 + 1], pts[ ic + 1], pts[ p1 + 1], 0.4999 ); - - bp1x = math.qbezierAt( pts[ p0 ], pts[ ic ], pts[ p1 ], 0.5 ); - bp1y = math.qbezierAt( pts[ p0 + 1], pts[ ic + 1], pts[ p1 + 1], 0.5 ); - } - - dispX = ( bp1x - bp0x ); - dispY = ( bp1y - bp0y ); - } - - rs.midtgtArrowAngle = math.getAngleFromDisp( dispX, dispY ); - - rs.midDispX = dispX; - rs.midDispY = dispY; - - // mid source - // - - dispX *= -1; - dispY *= -1; - - if( isSegments ){ - var pts = rs.allpts; - - if( pts.length / 2 % 2 === 0 ){ - // already ok - } else { - var i2 = pts.length / 2 - 1; - var i3 = i2 + 2; - - dispX = -( pts[ i3 ] - pts[ i2 ] ); - dispY = -( pts[ i3 + 1] - pts[ i2 + 1] ); - } - } - - rs.midsrcArrowAngle = math.getAngleFromDisp( dispX, dispY ); - - // target - // - - if( isSegments ){ - dispX = endX - rs.segpts[ rs.segpts.length - 2 ]; - dispY = endY - rs.segpts[ rs.segpts.length - 1 ]; - } else if( isMultibezier || isCompound || isSelf || isBezier ){ - var pts = rs.allpts; - var l = pts.length; - var bX = math.qbezierAt( pts[l-6], pts[l-4], pts[l-2], 0.9 ); - var bY = math.qbezierAt( pts[l-5], pts[l-3], pts[l-1], 0.9 ); - - dispX = endX - bX; - dispY = endY - bY; - } else { - dispX = endX - midX; - dispY = endY - midY; - } - - rs.tgtArrowAngle = math.getAngleFromDisp( dispX, dispY ); -}; - -BRp.getArrowWidth = BRp.getArrowHeight = function( edgeWidth, scale ){ - var cache = this.arrowWidthCache = this.arrowWidthCache || {}; - - var cachedVal = cache[ edgeWidth + ', ' + scale ]; - if( cachedVal ){ - return cachedVal; - } - - cachedVal = Math.max( Math.pow( edgeWidth * 13.37, 0.9 ), 29 ) * scale; - cache[ edgeWidth + ', ' + scale ] = cachedVal; - - return cachedVal; -}; - -module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-control-points.js b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-control-points.js deleted file mode 100644 index 120aa860a..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-control-points.js +++ /dev/null @@ -1,815 +0,0 @@ -var math = require( '../../../../math' ); -var is = require( '../../../../is' ); - -var BRp = {}; - -BRp.findEdgeControlPoints = function( edges ){ - if( !edges || edges.length === 0 ){ return; } - - var r = this; - var cy = r.cy; - var hasCompounds = cy.hasCompoundNodes(); - var hashTable = {}; - var pairIds = []; - var haystackEdges = []; - - // create a table of edge (src, tgt) => list of edges between them - var pairId; - for( var i = 0; i < edges.length; i++ ){ - var edge = edges[ i ]; - var _p = edge._private; - var data = _p.data; - var curveStyle = edge.pstyle( 'curve-style' ).value; - var edgeIsUnbundled = curveStyle === 'unbundled-bezier' || curveStyle === 'segments'; - var edgeIsBezier = curveStyle === 'unbundled-bezier' || curveStyle === 'bezier'; - - // ignore edges who are not to be displayed - // they shouldn't take up space - if( edge.pstyle( 'display').value === 'none' ){ - continue; - } - - if( curveStyle === 'haystack' ){ - haystackEdges.push( edge ); - continue; - } - - var srcId = data.source; - var tgtId = data.target; - - pairId = srcId > tgtId ? - tgtId + '$-$' + srcId : - srcId + '$-$' + tgtId ; - - if( edgeIsUnbundled ){ - pairId = 'unbundled' + '$-$' + data.id; - } - - var tableEntry = hashTable[ pairId ]; - - if( tableEntry == null ){ - tableEntry = hashTable[ pairId ] = []; - pairIds.push( pairId ); - } - - tableEntry.push( edge ); - - if( edgeIsUnbundled ){ - tableEntry.hasUnbundled = true; - } - - if( edgeIsBezier ){ - tableEntry.hasBezier = true; - } - } - - var src, tgt, srcPos, tgtPos, srcW, srcH, tgtW, tgtH, srcShape, tgtShape; - var vectorNormInverse; - var badBezier; - - // for each pair (src, tgt), create the ctrl pts - // Nested for loop is OK; total number of iterations for both loops = edgeCount - for( var p = 0; p < pairIds.length; p++ ){ - pairId = pairIds[ p ]; - var pairEdges = hashTable[ pairId ]; - - // for each pair id, the edges should be sorted by index - pairEdges.sort( function( edge1, edge2 ){ - return edge1.poolIndex() - edge2.poolIndex(); - } ); - - src = pairEdges[0]._private.source; - tgt = pairEdges[0]._private.target; - - // make sure src/tgt distinction is consistent for bundled edges - if( !pairEdges.hasUnbundled && src.id() > tgt.id() ){ - var temp = src; - src = tgt; - tgt = temp; - } - - srcPos = src.position(); - tgtPos = tgt.position(); - - srcW = src.outerWidth(); - srcH = src.outerHeight(); - - tgtW = tgt.outerWidth(); - tgtH = tgt.outerHeight(); - - srcShape = r.nodeShapes[ this.getNodeShape( src ) ]; - tgtShape = r.nodeShapes[ this.getNodeShape( tgt ) ]; - - badBezier = false; - - var edge; - var edge_p; - var rs; - - var dirCounts = { - 'north': 0, - 'west': 0, - 'south': 0, - 'east': 0, - 'northwest': 0, - 'southwest': 0, - 'northeast': 0, - 'southeast': 0 - }; - - var srcX2 = srcPos.x; - var srcY2 = srcPos.y; - var srcW2 = srcW; - var srcH2 = srcH; - - var tgtX2 = tgtPos.x; - var tgtY2 = tgtPos.y; - var tgtW2 = tgtW; - var tgtH2 = tgtH; - - var numEdges2 = pairEdges.length; - - for( var i = 0; i < pairEdges.length; i++ ){ - edge = pairEdges[ i ]; - edge_p = edge._private; - rs = edge_p.rscratch; - - var edgeIndex1 = rs.lastEdgeIndex; - var edgeIndex2 = i; - - var numEdges1 = rs.lastNumEdges; - - var curveStyle = edge.pstyle( 'curve-style' ).value; - - var edgeIsUnbundled = curveStyle === 'unbundled-bezier' || curveStyle === 'segments'; - - // whether the normalised pair order is the reverse of the edge's src-tgt order - var edgeIsSwapped = src.id() !== edge.source().id(); - - var ctrlptDists = edge.pstyle( 'control-point-distances' ); - var loopDir = edge.pstyle('loop-direction').pfValue; - var loopSwp = edge.pstyle('loop-sweep').pfValue; - var ctrlptWs = edge.pstyle( 'control-point-weights' ); - var bezierN = ctrlptDists && ctrlptWs ? Math.min( ctrlptDists.value.length, ctrlptWs.value.length ) : 1; - var stepSize = edge.pstyle( 'control-point-step-size' ).pfValue; - var ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[0] : undefined; - var ctrlptWeight = ctrlptWs.value[0]; - var edgeDistances = edge.pstyle('edge-distances').value; - var srcDistFNode = edge.pstyle('source-distance-from-node').pfValue; - var tgtDistFNode = edge.pstyle('target-distance-from-node').pfValue; - var segmentWs = edge.pstyle( 'segment-weights' ); - var segmentDs = edge.pstyle( 'segment-distances' ); - var segmentsN = Math.min( segmentWs.pfValue.length, segmentDs.pfValue.length ); - var srcEndpt = edge.pstyle('source-endpoint').value; - var tgtEndpt = edge.pstyle('target-endpoint').value; - var srcArrShape = edge.pstyle('source-arrow-shape').value; - var tgtArrShape = edge.pstyle('target-arrow-shape').value; - var arrowScale = edge.pstyle('arrow-scale').value; - var lineWidth = edge.pstyle('width').pfValue; - - var srcX1 = rs.lastSrcCtlPtX; - var srcY1 = rs.lastSrcCtlPtY; - var srcW1 = rs.lastSrcCtlPtW; - var srcH1 = rs.lastSrcCtlPtH; - - var tgtX1 = rs.lastTgtCtlPtX; - var tgtY1 = rs.lastTgtCtlPtY; - var tgtW1 = rs.lastTgtCtlPtW; - var tgtH1 = rs.lastTgtCtlPtH; - - var curveStyle1 = rs.lastCurveStyle; - var curveStyle2 = curveStyle; - - var ctrlptDists1 = rs.lastCtrlptDists; - var ctrlptDists2 = ctrlptDists ? ctrlptDists.strValue : null; - - var ctrlptWs1 = rs.lastCtrlptWs; - var ctrlptWs2 = ctrlptWs.strValue; - - var segmentWs1 = rs.lastSegmentWs; - var segmentWs2 = segmentWs.strValue; - - var segmentDs1 = rs.lastSegmentDs; - var segmentDs2 = segmentDs.strValue; - - var stepSize1 = rs.lastStepSize; - var stepSize2 = stepSize; - - var loopDir1 = rs.lastLoopDir; - var loopDir2 = loopDir; - - var loopSwp1 = rs.lastLoopSwp; - var loopSwp2 = loopSwp; - - var edgeDistances1 = rs.lastEdgeDistances; - var edgeDistances2 = edgeDistances; - - var srcDistFNode1 = rs.lastSrcDistFNode; - var srcDistFNode2 = srcDistFNode; - - var tgtDistFNode1 = rs.lastTgtDistFNode; - var tgtDistFNode2 = tgtDistFNode; - - var srcEndpt1 = rs.lastSrcEndpt; - var srcEndpt2 = srcEndpt; - - var tgtEndpt1 = rs.lastTgtEndpt; - var tgtEndpt2 = tgtEndpt; - - var srcArr1 = rs.lastSrcArr; - var srcArr2 = srcArrShape; - - var tgtArr1 = rs.lastTgtArr; - var tgtArr2 = tgtArrShape; - - var lineW1 = rs.lastLineW; - var lineW2 = lineWidth; - - var arrScl1 = rs.lastArrScl; - var arrScl2 = arrowScale; - - if( badBezier ){ - rs.badBezier = true; - } else { - rs.badBezier = false; - } - - var ptCacheHit; - - if( srcX1 === srcX2 && srcY1 === srcY2 && srcW1 === srcW2 && srcH1 === srcH2 - && tgtX1 === tgtX2 && tgtY1 === tgtY2 && tgtW1 === tgtW2 && tgtH1 === tgtH2 - && curveStyle1 === curveStyle2 - && ctrlptDists1 === ctrlptDists2 - && ctrlptWs1 === ctrlptWs2 - && segmentWs1 === segmentWs2 - && segmentDs1 === segmentDs2 - && stepSize1 === stepSize2 - && loopDir1 === loopDir2 - && loopSwp1 === loopSwp2 - && edgeDistances1 === edgeDistances2 - && srcDistFNode1 === srcDistFNode2 - && tgtDistFNode1 === tgtDistFNode2 - && srcEndpt1 === srcEndpt2 - && tgtEndpt1 === tgtEndpt2 - && srcArr1 === srcArr2 - && tgtArr1 === tgtArr2 - && lineW1 === lineW2 - && arrScl1 === arrScl2 - && ((edgeIndex1 === edgeIndex2 && numEdges1 === numEdges2) || edgeIsUnbundled) ){ - ptCacheHit = true; // then the control points haven't changed and we can skip calculating them - } else { - ptCacheHit = false; - - rs.lastSrcCtlPtX = srcX2; - rs.lastSrcCtlPtY = srcY2; - rs.lastSrcCtlPtW = srcW2; - rs.lastSrcCtlPtH = srcH2; - rs.lastTgtCtlPtX = tgtX2; - rs.lastTgtCtlPtY = tgtY2; - rs.lastTgtCtlPtW = tgtW2; - rs.lastTgtCtlPtH = tgtH2; - rs.lastEdgeIndex = edgeIndex2; - rs.lastNumEdges = numEdges2; - rs.lastCurveStyle = curveStyle2; - rs.lastCtrlptDists = ctrlptDists2; - rs.lastCtrlptWs = ctrlptWs2; - rs.lastSegmentDs = segmentDs2; - rs.lastSegmentWs = segmentWs2; - rs.lastStepSize = stepSize2; - rs.lastLoopDir = loopDir2; - rs.lastLoopSwp = loopSwp2; - rs.lastEdgeDistances = edgeDistances2; - rs.lastSrcDistFNode = srcDistFNode2; - rs.lastTgtDistFNode = tgtDistFNode2; - rs.lastSrcEndpt = srcEndpt2; - rs.lastTgtEndpt = tgtEndpt2; - rs.lastSrcArr = srcArr2; - rs.lastTgtArr = tgtArr2; - rs.lastLineW = lineW2; - rs.lastArrScl = arrScl2; - } - - if( !ptCacheHit ){ - - if( !pairEdges.calculatedIntersection && src !== tgt && ( pairEdges.hasBezier || pairEdges.hasUnbundled ) ){ - - pairEdges.calculatedIntersection = true; - - // pt outside src shape to calc distance/displacement from src to tgt - var srcOutside = srcShape.intersectLine( - srcPos.x, - srcPos.y, - srcW, - srcH, - tgtPos.x, - tgtPos.y, - 0 - ); - - pairEdges.srcIntn = srcOutside; - - // pt outside tgt shape to calc distance/displacement from src to tgt - var tgtOutside = tgtShape.intersectLine( - tgtPos.x, - tgtPos.y, - tgtW, - tgtH, - srcPos.x, - srcPos.y, - 0 - ); - - pairEdges.tgtIntn = tgtOutside; - - var midptSrcPts = { - x1: srcOutside[0], - x2: tgtOutside[0], - y1: srcOutside[1], - y2: tgtOutside[1] - }; - - var posPts = { - x1: srcPos.x, - x2: tgtPos.x, - y1: srcPos.y, - y2: tgtPos.y - }; - - var dy = ( tgtOutside[1] - srcOutside[1] ); - var dx = ( tgtOutside[0] - srcOutside[0] ); - var l = Math.sqrt( dx * dx + dy * dy ); - - var vector = { - x: dx, - y: dy - }; - - var vectorNorm = { - x: vector.x / l, - y: vector.y / l - }; - vectorNormInverse = { - x: -vectorNorm.y, - y: vectorNorm.x - }; - - - // if node shapes overlap, then no ctrl pts to draw - if( - tgtShape.checkPoint( srcOutside[0], srcOutside[1], 0, tgtW, tgtH, tgtPos.x, tgtPos.y ) && - srcShape.checkPoint( tgtOutside[0], tgtOutside[1], 0, srcW, srcH, srcPos.x, srcPos.y ) - ){ - vectorNormInverse = {}; - badBezier = true; - } - - } - - if( !edgeIsSwapped ){ - rs.srcIntn = pairEdges.srcIntn; - rs.tgtIntn = pairEdges.tgtIntn; - } else { // ensure that the per-edge cached value for intersections are correct for swapped bundled edges - rs.srcIntn = pairEdges.tgtIntn; - rs.tgtIntn = pairEdges.srcIntn; - } - - if( src === tgt ){ - // Self-edge - - rs.edgeType = 'self'; - - var j = i; - var loopDist = stepSize; - - if( edgeIsUnbundled ){ - j = 0; - loopDist = ctrlptDist; - } - - var loopAngle = loopDir - Math.PI / 2; - var outAngle = loopAngle - loopSwp / 2; - var inAngle = loopAngle + loopSwp / 2; - - // increase by step size for overlapping loops, keyed on direction and sweep values - var dc = String(loopDir + '_' + loopSwp); - j = dirCounts[dc] === undefined ? dirCounts[dc] = 0 : ++dirCounts[dc]; - - rs.ctrlpts = [ - srcPos.x + Math.cos(outAngle) * 1.4 * loopDist * (j / 3 + 1), - srcPos.y + Math.sin(outAngle) * 1.4 * loopDist * (j / 3 + 1), - srcPos.x + Math.cos(inAngle) * 1.4 * loopDist * (j / 3 + 1), - srcPos.y + Math.sin(inAngle) * 1.4 * loopDist * (j / 3 + 1) - ]; - - } else if( - hasCompounds && - ( src.isParent() || src.isChild() || tgt.isParent() || tgt.isChild() ) && - ( src.parents().anySame( tgt ) || tgt.parents().anySame( src ) ) - ){ - // Compound edge - - rs.edgeType = 'compound'; - - // because the line approximation doesn't apply for compound beziers - // (loop/self edges are already elided b/c of cheap src==tgt check) - rs.badBezier = false; - - var j = i; - var loopDist = stepSize; - - if( edgeIsUnbundled ){ - j = 0; - loopDist = ctrlptDist; - } - - var loopW = 50; - - var loopaPos = { - x: srcPos.x - srcW / 2, - y: srcPos.y - srcH / 2 - }; - - var loopbPos = { - x: tgtPos.x - tgtW / 2, - y: tgtPos.y - tgtH / 2 - }; - - var loopPos = { - x: Math.min( loopaPos.x, loopbPos.x ), - y: Math.min( loopaPos.y, loopbPos.y ) - }; - - // avoids cases with impossible beziers - var minCompoundStretch = 0.5; - var compoundStretchA = Math.max( minCompoundStretch, Math.log( srcW * 0.01 ) ); - var compoundStretchB = Math.max( minCompoundStretch, Math.log( tgtW * 0.01 ) ); - - rs.ctrlpts = [ - loopPos.x, - loopPos.y - (1 + Math.pow( loopW, 1.12 ) / 100) * loopDist * (j / 3 + 1) * compoundStretchA, - - loopPos.x - (1 + Math.pow( loopW, 1.12 ) / 100) * loopDist * (j / 3 + 1) * compoundStretchB, - loopPos.y - ]; - - } else if( curveStyle === 'segments' ){ - // Segments (multiple straight lines) - - rs.edgeType = 'segments'; - rs.segpts = []; - - for( var s = 0; s < segmentsN; s++ ){ - var w = segmentWs.pfValue[ s ]; - var d = segmentDs.pfValue[ s ]; - - var w1 = 1 - w; - var w2 = w; - - var midptPts = edgeDistances === 'node-position' ? posPts : midptSrcPts; - - var adjustedMidpt = { - x: midptPts.x1 * w1 + midptPts.x2 * w2, - y: midptPts.y1 * w1 + midptPts.y2 * w2 - }; - - rs.segpts.push( - adjustedMidpt.x + vectorNormInverse.x * d, - adjustedMidpt.y + vectorNormInverse.y * d - ); - } - - // Straight edge - } else if( - pairEdges.length % 2 === 1 - && i === Math.floor( pairEdges.length / 2 ) - && !edgeIsUnbundled - ){ - - rs.edgeType = 'straight'; - - } else { - // (Multi)bezier - - var multi = edgeIsUnbundled; - - rs.edgeType = multi ? 'multibezier' : 'bezier'; - rs.ctrlpts = []; - - for( var b = 0; b < bezierN; b++ ){ - var normctrlptDist = (0.5 - pairEdges.length / 2 + i) * stepSize; - var manctrlptDist; - var sign = math.signum( normctrlptDist ); - - if( multi ){ - ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[ b ] : stepSize; // fall back on step size - ctrlptWeight = ctrlptWs.value[ b ]; - } - - if( edgeIsUnbundled ){ // multi or single unbundled - manctrlptDist = ctrlptDist; - } else { - manctrlptDist = ctrlptDist !== undefined ? sign * ctrlptDist : undefined; - } - - var distanceFromMidpoint = manctrlptDist !== undefined ? manctrlptDist : normctrlptDist; - - var w1 = 1 - ctrlptWeight; - var w2 = ctrlptWeight; - - if( edgeIsSwapped ){ - var temp = w1; - w1 = w2; - w2 = temp; - } - - var midptPts = edgeDistances === 'node-position' ? posPts : midptSrcPts; - - var adjustedMidpt = { - x: midptPts.x1 * w1 + midptPts.x2 * w2, - y: midptPts.y1 * w1 + midptPts.y2 * w2 - }; - - rs.ctrlpts.push( - adjustedMidpt.x + vectorNormInverse.x * distanceFromMidpoint, - adjustedMidpt.y + vectorNormInverse.y * distanceFromMidpoint - ); - } - - } - - // find endpts for edge - this.findEndpoints( edge ); - - var badStart = !is.number( rs.startX ) || !is.number( rs.startY ); - var badAStart = !is.number( rs.arrowStartX ) || !is.number( rs.arrowStartY ); - var badEnd = !is.number( rs.endX ) || !is.number( rs.endY ); - var badAEnd = !is.number( rs.arrowEndX ) || !is.number( rs.arrowEndY ); - - var minCpADistFactor = 3; - var arrowW = this.getArrowWidth( edge.pstyle( 'width' ).pfValue, edge.pstyle( 'arrow-scale' ).value ) - * this.arrowShapeWidth; - var minCpADist = minCpADistFactor * arrowW; - - if( rs.edgeType === 'bezier' ){ - var startACpDist = math.dist( { x: rs.ctrlpts[0], y: rs.ctrlpts[1] }, { x: rs.startX, y: rs.startY } ); - var closeStartACp = startACpDist < minCpADist; - var endACpDist = math.dist( { x: rs.ctrlpts[0], y: rs.ctrlpts[1] }, { x: rs.endX, y: rs.endY } ); - var closeEndACp = endACpDist < minCpADist; - - var overlapping = false; - - if( badStart || badAStart || closeStartACp ){ - overlapping = true; - - // project control point along line from src centre to outside the src shape - // (otherwise intersection will yield nothing) - var cpD = { // delta - x: rs.ctrlpts[0] - srcPos.x, - y: rs.ctrlpts[1] - srcPos.y - }; - var cpL = Math.sqrt( cpD.x * cpD.x + cpD.y * cpD.y ); // length of line - var cpM = { // normalised delta - x: cpD.x / cpL, - y: cpD.y / cpL - }; - var radius = Math.max( srcW, srcH ); - var cpProj = { // *2 radius guarantees outside shape - x: rs.ctrlpts[0] + cpM.x * 2 * radius, - y: rs.ctrlpts[1] + cpM.y * 2 * radius - }; - - var srcCtrlPtIntn = srcShape.intersectLine( - srcPos.x, - srcPos.y, - srcW, - srcH, - cpProj.x, - cpProj.y, - 0 - ); - - if( closeStartACp ){ - rs.ctrlpts[0] = rs.ctrlpts[0] + cpM.x * (minCpADist - startACpDist); - rs.ctrlpts[1] = rs.ctrlpts[1] + cpM.y * (minCpADist - startACpDist); - } else { - rs.ctrlpts[0] = srcCtrlPtIntn[0] + cpM.x * minCpADist; - rs.ctrlpts[1] = srcCtrlPtIntn[1] + cpM.y * minCpADist; - } - } - - if( badEnd || badAEnd || closeEndACp ){ - overlapping = true; - - // project control point along line from tgt centre to outside the tgt shape - // (otherwise intersection will yield nothing) - var cpD = { // delta - x: rs.ctrlpts[0] - tgtPos.x, - y: rs.ctrlpts[1] - tgtPos.y - }; - var cpL = Math.sqrt( cpD.x * cpD.x + cpD.y * cpD.y ); // length of line - var cpM = { // normalised delta - x: cpD.x / cpL, - y: cpD.y / cpL - }; - var radius = Math.max( srcW, srcH ); - var cpProj = { // *2 radius guarantees outside shape - x: rs.ctrlpts[0] + cpM.x * 2 * radius, - y: rs.ctrlpts[1] + cpM.y * 2 * radius - }; - - var tgtCtrlPtIntn = tgtShape.intersectLine( - tgtPos.x, - tgtPos.y, - tgtW, - tgtH, - cpProj.x, - cpProj.y, - 0 - ); - - if( closeEndACp ){ - rs.ctrlpts[0] = rs.ctrlpts[0] + cpM.x * (minCpADist - endACpDist); - rs.ctrlpts[1] = rs.ctrlpts[1] + cpM.y * (minCpADist - endACpDist); - } else { - rs.ctrlpts[0] = tgtCtrlPtIntn[0] + cpM.x * minCpADist; - rs.ctrlpts[1] = tgtCtrlPtIntn[1] + cpM.y * minCpADist; - } - - } - - if( overlapping ){ - // recalc endpts - this.findEndpoints( edge ); - } - - } - - if( rs.edgeType === 'multibezier' || rs.edgeType === 'bezier' || rs.edgeType === 'self' || rs.edgeType === 'compound' ){ - rs.allpts = []; - - rs.allpts.push( rs.startX, rs.startY ); - - for( var b = 0; b + 1 < rs.ctrlpts.length; b += 2 ){ - // ctrl pt itself - rs.allpts.push( rs.ctrlpts[ b ], rs.ctrlpts[ b + 1] ); - - // the midpt between ctrlpts as intermediate destination pts - if( b + 3 < rs.ctrlpts.length ){ - rs.allpts.push( (rs.ctrlpts[ b ] + rs.ctrlpts[ b + 2]) / 2, (rs.ctrlpts[ b + 1] + rs.ctrlpts[ b + 3]) / 2 ); - } - } - - rs.allpts.push( rs.endX, rs.endY ); - - var m, mt; - if( rs.ctrlpts.length / 2 % 2 === 0 ){ - m = rs.allpts.length / 2 - 1; - - rs.midX = rs.allpts[ m ]; - rs.midY = rs.allpts[ m + 1]; - } else { - m = rs.allpts.length / 2 - 3; - mt = 0.5; - - rs.midX = math.qbezierAt( rs.allpts[ m ], rs.allpts[ m + 2], rs.allpts[ m + 4], mt ); - rs.midY = math.qbezierAt( rs.allpts[ m + 1], rs.allpts[ m + 3], rs.allpts[ m + 5], mt ); - } - - } else if( rs.edgeType === 'straight' ){ - // need to calc these after endpts - rs.allpts = [ rs.startX, rs.startY, rs.endX, rs.endY ]; - - // default midpt for labels etc - rs.midX = ( rs.startX + rs.endX + rs.arrowStartX + rs.arrowEndX ) / 4; - rs.midY = ( rs.startY + rs.endY + rs.arrowStartY + rs.arrowEndY ) / 4; - - } else if( rs.edgeType === 'segments' ){ - rs.allpts = []; - rs.allpts.push( rs.startX, rs.startY ); - rs.allpts.push.apply( rs.allpts, rs.segpts ); - rs.allpts.push( rs.endX, rs.endY ); - - if( rs.segpts.length % 4 === 0 ){ - var i2 = rs.segpts.length / 2; - var i1 = i2 - 2; - - rs.midX = ( rs.segpts[ i1 ] + rs.segpts[ i2 ] ) / 2; - rs.midY = ( rs.segpts[ i1 + 1] + rs.segpts[ i2 + 1] ) / 2; - } else { - var i1 = rs.segpts.length / 2 - 1; - - rs.midX = rs.segpts[ i1 ]; - rs.midY = rs.segpts[ i1 + 1]; - } - - - } - - this.storeEdgeProjections( edge ); - this.calculateArrowAngles( edge ); - } // if point cache miss - - this.recalculateEdgeLabelProjections( edge ); - this.calculateLabelAngles( edge ); - - } // for pair edges - } // for pair ids - - for( var i = 0; i < haystackEdges.length; i++ ){ - var edge = haystackEdges[ i ]; - var _p = edge._private; - var rscratch = _p.rscratch; - var rs = rscratch; - - if( !rscratch.haystack ){ - var angle = Math.random() * 2 * Math.PI; - - rscratch.source = { - x: Math.cos( angle ), - y: Math.sin( angle ) - }; - - var angle = Math.random() * 2 * Math.PI; - - rscratch.target = { - x: Math.cos( angle ), - y: Math.sin( angle ) - }; - - } - - var src = _p.source; - var tgt = _p.target; - var srcPos = src.position(); - var tgtPos = tgt.position(); - var srcW = src.width(); - var tgtW = tgt.width(); - var srcH = src.height(); - var tgtH = tgt.height(); - var radius = edge.pstyle( 'haystack-radius' ).value; - var halfRadius = radius / 2; // b/c have to half width/height - - rs.haystackPts = rs.allpts = [ - rs.source.x * srcW * halfRadius + srcPos.x, - rs.source.y * srcH * halfRadius + srcPos.y, - rs.target.x * tgtW * halfRadius + tgtPos.x, - rs.target.y * tgtH * halfRadius + tgtPos.y - ]; - - rs.midX = (rs.allpts[0] + rs.allpts[2]) / 2; - rs.midY = (rs.allpts[1] + rs.allpts[3]) / 2; - - // always override as haystack in case set to different type previously - rscratch.edgeType = rscratch.lastCurveStyle = 'haystack'; - rscratch.haystack = true; - - this.storeEdgeProjections( edge ); - this.calculateArrowAngles( edge ); - this.recalculateEdgeLabelProjections( edge ); - this.calculateLabelAngles( edge ); - } -}; - -function getPts( pts ){ - let retPts = []; - - if( pts == null ){ return; } - - for( let i = 0; i < pts.length; i += 2 ){ - let x = pts[i]; - let y = pts[i+1]; - - retPts.push({ x, y }); - } - - return retPts; -} - -BRp.getSegmentPoints = function( edge ){ - let rs = edge[0]._private.rscratch; - let type = rs.edgeType; - - if( type === 'segments' ){ - return getPts( rs.segpts ); - } -}; - -BRp.getControlPoints = function( edge ){ - let rs = edge[0]._private.rscratch; - let type = rs.edgeType; - - if( type === 'bezier' || type === 'multibezier' || type === 'self' || type === 'compound' ){ - return getPts( rs.ctrlpts ); - } -}; - -BRp.getEdgeMidpoint = function( edge ){ - let rs = edge[0]._private.rscratch; - - return { - x: rs.midX, - y: rs.midY - }; -}; - -module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-endpoints.js b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-endpoints.js deleted file mode 100644 index 32a21f4e8..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-endpoints.js +++ /dev/null @@ -1,229 +0,0 @@ -let math = require( '../../../../math' ); -let is = require( '../../../../is' ); - -let BRp = {}; - -BRp.manualEndptToPx = function( node, prop ){ - let r = this; - let npos = node.position(); - let w = node.outerWidth(); - let h = node.outerHeight(); - - if( prop.value.length === 2 ){ - let p = [ - prop.pfValue[0], - prop.pfValue[1] - ]; - - if( prop.units[0] === '%' ){ - p[0] = p[0] * w; - } - - if( prop.units[1] === '%' ){ - p[1] = p[1] * h; - } - - p[0] += npos.x; - p[1] += npos.y; - - return p; - } else { - let angle = prop.pfValue[0]; - - angle = -Math.PI / 2 + angle; // start at 12 o'clock - - let l = 2 * Math.max( w, h ); - - let p = [ - npos.x + Math.cos( angle ) * l, - npos.y + Math.sin( angle ) * l - ]; - - return r.nodeShapes[ this.getNodeShape( node ) ].intersectLine( - npos.x, npos.y, - w, h, - p[0], p[1], - 0 - ); - } -}; - -BRp.findEndpoints = function( edge ){ - let r = this; - let intersect; - - let source = edge.source()[0]; - let target = edge.target()[0]; - - let srcPos = source.position(); - let tgtPos = target.position(); - - let tgtArShape = edge.pstyle( 'target-arrow-shape' ).value; - let srcArShape = edge.pstyle( 'source-arrow-shape' ).value; - - let tgtDist = edge.pstyle( 'target-distance-from-node' ).pfValue; - let srcDist = edge.pstyle( 'source-distance-from-node' ).pfValue; - - let rs = edge._private.rscratch; - - let et = rs.edgeType; - let self = et === 'self' || et === 'compound'; - let bezier = et === 'bezier' || et === 'multibezier' || self; - let multi = et !== 'bezier'; - let lines = et === 'straight' || et === 'segments'; - let segments = et === 'segments'; - let hasEndpts = bezier || multi || lines; - let srcManEndpt = edge.pstyle('source-endpoint'); - let srcManEndptVal = self ? 'outside-to-node' : srcManEndpt.value; - let tgtManEndpt = edge.pstyle('target-endpoint'); - let tgtManEndptVal = self ? 'outside-to-node' : tgtManEndpt.value; - - rs.srcManEndpt = srcManEndpt; - rs.tgtManEndpt = tgtManEndpt; - - let p1; // last known point of edge on target side - let p2; // last known point of edge on source side - - let p1_i; // point to intersect with target shape - let p2_i; // point to intersect with source shape - - if( bezier ){ - let cpStart = [ rs.ctrlpts[0], rs.ctrlpts[1] ]; - let cpEnd = multi ? [ rs.ctrlpts[ rs.ctrlpts.length - 2], rs.ctrlpts[ rs.ctrlpts.length - 1] ] : cpStart; - - p1 = cpEnd; - p2 = cpStart; - } else if( lines ){ - let srcArrowFromPt = !segments ? [ tgtPos.x, tgtPos.y ] : rs.segpts.slice( 0, 2 ); - let tgtArrowFromPt = !segments ? [ srcPos.x, srcPos.y ] : rs.segpts.slice( rs.segpts.length - 2 ); - - p1 = tgtArrowFromPt; - p2 = srcArrowFromPt; - } - - if( tgtManEndptVal === 'inside-to-node' ){ - intersect = [ tgtPos.x, tgtPos.y ]; - } else if( tgtManEndpt.units ){ - intersect = this.manualEndptToPx( target, tgtManEndpt ); - } else if( tgtManEndptVal === 'outside-to-line' ){ - intersect = rs.tgtIntn; // use cached value from ctrlpt calc - } else { - if( tgtManEndptVal === 'outside-to-node' ){ - p1_i = p1; - } else if( tgtManEndptVal === 'outside-to-line' ){ - p1_i = [ srcPos.x, srcPos.y ]; - } - - intersect = r.nodeShapes[ this.getNodeShape( target ) ].intersectLine( - tgtPos.x, - tgtPos.y, - target.outerWidth(), - target.outerHeight(), - p1_i[0], - p1_i[1], - 0 - ); - } - - let arrowEnd = math.shortenIntersection( - intersect, - p1, - r.arrowShapes[ tgtArShape ].spacing( edge ) + tgtDist - ); - let edgeEnd = math.shortenIntersection( - intersect, - p1, - r.arrowShapes[ tgtArShape ].gap( edge ) + tgtDist - ); - - rs.endX = edgeEnd[0]; - rs.endY = edgeEnd[1]; - - rs.arrowEndX = arrowEnd[0]; - rs.arrowEndY = arrowEnd[1]; - - if( srcManEndptVal === 'inside-to-node' ){ - intersect = [ srcPos.x, srcPos.y ]; - } else if( srcManEndpt.units ){ - intersect = this.manualEndptToPx( source, srcManEndpt ); - } else if( srcManEndptVal === 'outside-to-line' ){ - intersect = rs.srcIntn; // use cached value from ctrlpt calc - } else { - if( srcManEndptVal === 'outside-to-node' ){ - p2_i = p2; - } else if( srcManEndptVal === 'outside-to-line' ){ - p2_i = [ tgtPos.x, tgtPos.y ]; - } - - intersect = r.nodeShapes[ this.getNodeShape( source ) ].intersectLine( - srcPos.x, - srcPos.y, - source.outerWidth(), - source.outerHeight(), - p2_i[0], - p2_i[1], - 0 - ); - } - - let arrowStart = math.shortenIntersection( - intersect, - p2, - r.arrowShapes[ srcArShape ].spacing( edge ) + srcDist - ); - let edgeStart = math.shortenIntersection( - intersect, - p2, - r.arrowShapes[ srcArShape ].gap( edge ) + srcDist - ); - - rs.startX = edgeStart[0]; - rs.startY = edgeStart[1]; - - rs.arrowStartX = arrowStart[0]; - rs.arrowStartY = arrowStart[1]; - - if( hasEndpts ){ - if( !is.number( rs.startX ) || !is.number( rs.startY ) || !is.number( rs.endX ) || !is.number( rs.endY ) ){ - rs.badLine = true; - } else { - rs.badLine = false; - } - } -}; - -BRp.getSourceEndpoint = function( edge ){ - let rs = edge[0]._private.rscratch; - - switch( rs.edgeType ){ - case 'haystack': - return { - x: rs.haystackPts[0], - y: rs.haystackPts[1] - }; - default: - return { - x: rs.arrowStartX, - y: rs.arrowStartY - }; - } -}; - -BRp.getTargetEndpoint = function( edge ){ - let rs = edge[0]._private.rscratch; - - switch( rs.edgeType ){ - case 'haystack': - return { - x: rs.haystackPts[2], - y: rs.haystackPts[3] - }; - default: - return { - x: rs.arrowEndX, - y: rs.arrowEndY - }; - } -}; - -module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-projection.js b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-projection.js deleted file mode 100644 index 2f4e4ed7e..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/edge-projection.js +++ /dev/null @@ -1,62 +0,0 @@ -var math = require( '../../../../math' ); - -var BRp = {}; - -function pushBezierPts( r, edge, pts ){ - var qbezierAt = function( p1, p2, p3, t ){ return math.qbezierAt( p1, p2, p3, t ); }; - var _p = edge._private; - var bpts = _p.rstyle.bezierPts; - - for( var i = 0; i < r.bezierProjPcts.length; i++ ){ - var p = r.bezierProjPcts[i]; - - bpts.push( { - x: qbezierAt( pts[0], pts[2], pts[4], p ), - y: qbezierAt( pts[1], pts[3], pts[5], p ) - } ); - } -} - -BRp.storeEdgeProjections = function( edge ){ - var _p = edge._private; - var rs = _p.rscratch; - var et = rs.edgeType; - - // clear the cached points state - _p.rstyle.bezierPts = null; - _p.rstyle.linePts = null; - _p.rstyle.haystackPts = null; - - if( et === 'multibezier' || et === 'bezier' || et === 'self' || et === 'compound' ){ - var bpts = _p.rstyle.bezierPts = []; // jshint ignore:line - - for( var i = 0; i + 5 < rs.allpts.length; i += 4 ){ - pushBezierPts( this, edge, rs.allpts.slice( i, i + 6 ) ); - } - } else if( et === 'segments' ){ - var lpts = _p.rstyle.linePts = []; - - for( var i = 0; i + 1 < rs.allpts.length; i += 2 ){ - lpts.push( { - x: rs.allpts[ i ], - y: rs.allpts[ i + 1] - } ); - } - } else if( et === 'haystack' ){ - var hpts = rs.haystackPts; - - _p.rstyle.haystackPts = [ - { x: hpts[0], y: hpts[1] }, - { x: hpts[2], y: hpts[3] } - ]; - } - - _p.rstyle.arrowWidth = this.getArrowWidth( edge.pstyle('width').pfValue, edge.pstyle( 'arrow-scale' ).value ) - * this.arrowShapeWidth; -}; - -BRp.recalculateEdgeProjections = function( edges ){ - this.findEdgeControlPoints( edges ); -}; - -module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/index.js b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/index.js deleted file mode 100644 index 71e535885..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/index.js +++ /dev/null @@ -1,19 +0,0 @@ -var util = require('../../../../util'); - -var BRp = {}; - -[ - require('./coords'), - require('./edge-arrows'), - require('./edge-control-points'), - require('./edge-endpoints'), - require('./edge-projection'), - require('./labels'), - require('./nodes'), - require('./rendered-style'), - require('./z-ordering') -].forEach(function( props ){ - util.extend( BRp, props ); -}); - -module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/labels.js b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/labels.js deleted file mode 100644 index 39818ad9e..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/labels.js +++ /dev/null @@ -1,499 +0,0 @@ -var math = require( '../../../../math' ); -var is = require( '../../../../is' ); -var util = require( '../../../../util' ); - -var BRp = {}; - -BRp.recalculateNodeLabelProjection = function( node ){ - var content = node.pstyle( 'label' ).strValue; - - if( is.emptyString(content) ){ return; } - - var textX, textY; - var _p = node._private; - var nodeWidth = node.width(); - var nodeHeight = node.height(); - var padding = node.padding(); - var nodePos = node.position(); - var textHalign = node.pstyle( 'text-halign' ).strValue; - var textValign = node.pstyle( 'text-valign' ).strValue; - var rs = _p.rscratch; - var rstyle = _p.rstyle; - - switch( textHalign ){ - case 'left': - textX = nodePos.x - nodeWidth / 2 - padding; - break; - - case 'right': - textX = nodePos.x + nodeWidth / 2 + padding; - break; - - default: // e.g. center - textX = nodePos.x; - } - - switch( textValign ){ - case 'top': - textY = nodePos.y - nodeHeight / 2 - padding; - break; - - case 'bottom': - textY = nodePos.y + nodeHeight / 2 + padding; - break; - - default: // e.g. middle - textY = nodePos.y; - } - - rs.labelX = textX; - rs.labelY = textY; - rstyle.labelX = textX; - rstyle.labelY = textY; - - this.applyLabelDimensions( node ); -}; - -var lineAngleFromDelta = function( dx, dy ){ - var angle = Math.atan( dy / dx ); - - if( dx === 0 && angle < 0 ){ - angle = angle * -1; - } - - return angle; -}; - -var lineAngle = function( p0, p1 ){ - var dx = p1.x - p0.x; - var dy = p1.y - p0.y; - - return lineAngleFromDelta( dx, dy ); -}; - -var bezierAngle = function( p0, p1, p2, t ){ - var t0 = math.bound( 0, t - 0.001, 1 ); - var t1 = math.bound( 0, t + 0.001, 1 ); - - var lp0 = math.qbezierPtAt( p0, p1, p2, t0 ); - var lp1 = math.qbezierPtAt( p0, p1, p2, t1 ); - - return lineAngle( lp0, lp1 ); -}; - -BRp.recalculateEdgeLabelProjections = function( edge ){ - var p; - var _p = edge._private; - var rs = _p.rscratch; - var r = this; - var content = { - mid: edge.pstyle('label').strValue, - source: edge.pstyle('source-label').strValue, - target: edge.pstyle('target-label').strValue - }; - - if( content.mid || content.source || content.target ){ - // then we have to calculate... - } else { - return; // no labels => no calcs - } - - // add center point to style so bounding box calculations can use it - // - p = { - x: rs.midX, - y: rs.midY - }; - - var setRs = function( propName, prefix, value ){ - util.setPrefixedProperty( _p.rscratch, propName, prefix, value ); - util.setPrefixedProperty( _p.rstyle, propName, prefix, value ); - }; - - setRs( 'labelX', null, p.x ); - setRs( 'labelY', null, p.y ); - - var midAngle = lineAngleFromDelta(rs.midDispX, rs.midDispY); - setRs( 'labelAutoAngle', null, midAngle ); - - var createControlPointInfo = function(){ - if( createControlPointInfo.cache ){ return createControlPointInfo.cache; } // use cache so only 1x per edge - - var ctrlpts = []; - - // store each ctrlpt info init - for( var i = 0; i + 5 < rs.allpts.length; i += 4 ){ - var p0 = { x: rs.allpts[i], y: rs.allpts[i+1] }; - var p1 = { x: rs.allpts[i+2], y: rs.allpts[i+3] }; // ctrlpt - var p2 = { x: rs.allpts[i+4], y: rs.allpts[i+5] }; - - ctrlpts.push({ - p0: p0, - p1: p1, - p2: p2, - startDist: 0, - length: 0, - segments: [] - }); - } - - var bpts = _p.rstyle.bezierPts; - var nProjs = r.bezierProjPcts.length; - - function addSegment( cp, p0, p1, t0, t1 ){ - var length = math.dist( p0, p1 ); - var prevSegment = cp.segments[ cp.segments.length - 1 ]; - var segment = { - p0: p0, - p1: p1, - t0: t0, - t1: t1, - startDist: prevSegment ? prevSegment.startDist + prevSegment.length : 0, - length: length - }; - - cp.segments.push( segment ); - - cp.length += length; - } - - // update each ctrlpt with segment info - for( var i = 0; i < ctrlpts.length; i++ ){ - var cp = ctrlpts[i]; - var prevCp = ctrlpts[i - 1]; - - if( prevCp ){ - cp.startDist = prevCp.startDist + prevCp.length; - } - - addSegment( - cp, - cp.p0, bpts[ i * nProjs ], - 0, r.bezierProjPcts[ 0 ] - ); // first - - for( var j = 0; j < nProjs - 1; j++ ){ - addSegment( - cp, - bpts[ i * nProjs + j ], bpts[ i * nProjs + j + 1 ], - r.bezierProjPcts[ j ], r.bezierProjPcts[ j + 1 ] - ); - } - - addSegment( - cp, - bpts[ i * nProjs + nProjs - 1 ], cp.p2, - r.bezierProjPcts[ nProjs - 1 ], 1 - ); // last - } - - return ( createControlPointInfo.cache = ctrlpts ); - }; - - var calculateEndProjection = function( prefix ){ - var angle; - var isSrc = prefix === 'source'; - - if( !content[ prefix ] ){ return; } - - var offset = edge.pstyle(prefix+'-text-offset').pfValue; - - switch( rs.edgeType ){ - case 'self': - case 'compound': - case 'bezier': - case 'multibezier': - var cps = createControlPointInfo(); - var selected; - var startDist = 0; - var totalDist = 0; - - // find the segment we're on - for( var i = 0; i < cps.length; i++ ){ - var cp = cps[ isSrc ? i : cps.length - 1 - i ]; - - for( var j = 0; j < cp.segments.length; j++ ){ - var seg = cp.segments[ isSrc ? j : cp.segments.length - 1 - j ]; - var lastSeg = i === cps.length - 1 && j === cp.segments.length - 1; - - startDist = totalDist; - totalDist += seg.length; - - if( totalDist >= offset || lastSeg ){ - selected = { cp: cp, segment: seg }; - break; - } - } - - if( selected ){ break; } - } - - var cp = selected.cp; - var seg = selected.segment; - var tSegment = ( offset - startDist ) / ( seg.length ); - var segDt = seg.t1 - seg.t0; - var t = isSrc ? seg.t0 + segDt * tSegment : seg.t1 - segDt * tSegment; - - t = math.bound( 0, t, 1 ); - p = math.qbezierPtAt( cp.p0, cp.p1, cp.p2, t ); - angle = bezierAngle( cp.p0, cp.p1, cp.p2, t, p ); - - break; - - case 'straight': - case 'segments': - case 'haystack': - var d = 0, di, d0; - var p0, p1; - var l = rs.allpts.length; - - for( var i = 0; i + 3 < l; i += 2 ){ - if( isSrc ){ - p0 = { x: rs.allpts[i], y: rs.allpts[i+1] }; - p1 = { x: rs.allpts[i+2], y: rs.allpts[i+3] }; - } else { - p0 = { x: rs.allpts[l-2-i], y: rs.allpts[l-1-i] }; - p1 = { x: rs.allpts[l-4-i], y: rs.allpts[l-3-i] }; - } - - di = math.dist( p0, p1 ); - d0 = d; - d += di; - - if( d >= offset ){ break; } - } - - var pD = offset - d0; - var t = pD / di; - - t = math.bound( 0, t, 1 ); - p = math.lineAt( p0, p1, t ); - angle = lineAngle( p0, p1 ); - - break; - } - - setRs( 'labelX', prefix, p.x ); - setRs( 'labelY', prefix, p.y ); - setRs( 'labelAutoAngle', prefix, angle ); - }; - - calculateEndProjection( 'source' ); - calculateEndProjection( 'target' ); - - this.applyLabelDimensions( edge ); -}; - -BRp.applyLabelDimensions = function( ele ){ - this.applyPrefixedLabelDimensions( ele ); - - if( ele.isEdge() ){ - this.applyPrefixedLabelDimensions( ele, 'source' ); - this.applyPrefixedLabelDimensions( ele, 'target' ); - } -}; - -BRp.applyPrefixedLabelDimensions = function( ele, prefix ){ - var _p = ele._private; - - var text = this.getLabelText( ele, prefix ); - var labelDims = this.calculateLabelDimensions( ele, text ); - - util.setPrefixedProperty( _p.rstyle, 'labelWidth', prefix, labelDims.width ); - util.setPrefixedProperty( _p.rscratch, 'labelWidth', prefix, labelDims.width ); - - util.setPrefixedProperty( _p.rstyle, 'labelHeight', prefix, labelDims.height ); - util.setPrefixedProperty( _p.rscratch, 'labelHeight', prefix, labelDims.height ); -}; - -BRp.getLabelText = function( ele, prefix ){ - var _p = ele._private; - var pfd = prefix ? prefix + '-' : ''; - var text = ele.pstyle( pfd + 'label' ).strValue; - var textTransform = ele.pstyle( 'text-transform' ).value; - var rscratch = function( propName, value ){ - if( value ){ - util.setPrefixedProperty( _p.rscratch, propName, prefix, value ); - return value; - } else { - return util.getPrefixedProperty( _p.rscratch, propName, prefix ); - } - }; - - // for empty text, skip all processing - if( !text ){ return ''; } - - if( textTransform == 'none' ){ - // passthrough - } else if( textTransform == 'uppercase' ){ - text = text.toUpperCase(); - } else if( textTransform == 'lowercase' ){ - text = text.toLowerCase(); - } - - var wrapStyle = ele.pstyle( 'text-wrap' ).value; - - if( wrapStyle === 'wrap' ){ - //console.log('wrap'); - - var labelKey = rscratch( 'labelKey' ); - - // save recalc if the label is the same as before - if( labelKey && rscratch( 'labelWrapKey' ) === labelKey ){ - // console.log('wrap cache hit'); - return rscratch( 'labelWrapCachedText' ); - } - // console.log('wrap cache miss'); - - var lines = text.split( '\n' ); - var maxW = ele.pstyle( 'text-max-width' ).pfValue; - var wrappedLines = []; - - for( var l = 0; l < lines.length; l++ ){ - var line = lines[ l ]; - var lineDims = this.calculateLabelDimensions( ele, line, 'line=' + line ); - var lineW = lineDims.width; - - if( lineW > maxW ){ // line is too long - var words = line.split( /\s+/ ); // NB: assume collapsed whitespace into single space - var subline = ''; - - for( var w = 0; w < words.length; w++ ){ - var word = words[ w ]; - var testLine = subline.length === 0 ? word : subline + ' ' + word; - var testDims = this.calculateLabelDimensions( ele, testLine, 'testLine=' + testLine ); - var testW = testDims.width; - - if( testW <= maxW ){ // word fits on current line - subline += word + ' '; - } else { // word starts new line - wrappedLines.push( subline ); - subline = word + ' '; - } - } - - // if there's remaining text, put it in a wrapped line - if( !subline.match( /^\s+$/ ) ){ - wrappedLines.push( subline ); - } - } else { // line is already short enough - wrappedLines.push( line ); - } - } // for - - rscratch( 'labelWrapCachedLines', wrappedLines ); - text = rscratch( 'labelWrapCachedText', wrappedLines.join( '\n' ) ); - rscratch( 'labelWrapKey', labelKey ); - - // console.log(text) - } else if( wrapStyle === 'ellipsis' ){ - var maxW = ele.pstyle( 'text-max-width' ).pfValue; - var ellipsized = ''; - var ellipsis = '\u2026'; - var incLastCh = false; - - for( var i = 0; i < text.length; i++ ){ - var widthWithNextCh = this.calculateLabelDimensions( ele, ellipsized + text[i] + ellipsis ).width; - - if( widthWithNextCh > maxW ){ break; } - - ellipsized += text[i]; - - if( i === text.length - 1 ){ incLastCh = true; } - } - - if( !incLastCh ){ - ellipsized += ellipsis; - } - - return ellipsized; - } // if ellipsize - - return text; -}; - -BRp.calculateLabelDimensions = function( ele, text, extraKey ){ - var r = this; - - var cacheKey = ele._private.labelStyleKey + '$@$' + text; - - if( extraKey ){ - cacheKey += '$@$' + extraKey; - } - - var cache = r.labelDimCache || (r.labelDimCache = {}); - - if( cache[ cacheKey ] ){ - return cache[ cacheKey ]; - } - - var sizeMult = 1; // increase the scale to increase accuracy w.r.t. zoomed text - var fStyle = ele.pstyle( 'font-style' ).strValue; - var size = ( sizeMult * ele.pstyle( 'font-size' ).pfValue ) + 'px'; - var family = ele.pstyle( 'font-family' ).strValue; - var weight = ele.pstyle( 'font-weight' ).strValue; - - var div = this.labelCalcDiv; - - if( !div ){ - div = this.labelCalcDiv = document.createElement( 'div' ); // eslint-disable-line no-undef - document.body.appendChild( div ); // eslint-disable-line no-undef - } - - var ds = div.style; - - // from ele style - ds.fontFamily = family; - ds.fontStyle = fStyle; - ds.fontSize = size; - ds.fontWeight = weight; - - // forced style - ds.position = 'absolute'; - ds.left = '-9999px'; - ds.top = '-9999px'; - ds.zIndex = '-1'; - ds.visibility = 'hidden'; - ds.pointerEvents = 'none'; - ds.padding = '0'; - ds.lineHeight = '1'; - - if( ele.pstyle( 'text-wrap' ).value === 'wrap' ){ - ds.whiteSpace = 'pre'; // so newlines are taken into account - } else { - ds.whiteSpace = 'normal'; - } - - // put label content in div - div.textContent = text; - - cache[ cacheKey ] = { - width: Math.ceil( div.clientWidth / sizeMult ), - height: Math.ceil( div.clientHeight / sizeMult ) - }; - - return cache[ cacheKey ]; -}; - - -BRp.calculateLabelAngles = function( ele ){ - var _p = ele._private; - var rs = _p.rscratch; - var isEdge = ele.isEdge(); - var rot = ele.pstyle( 'text-rotation' ); - var rotStr = rot.strValue; - - if( rotStr === 'none' ){ - rs.labelAngle = rs.sourceLabelAngle = rs.targetLabelAngle = 0; - } else if( isEdge && rotStr === 'autorotate' ){ - rs.labelAngle = rs.labelAutoAngle; - rs.sourceLabelAngle = rs.sourceLabelAutoAngle; - rs.targetLabelAngle = rs.targetLabelAutoAngle; - } else if( rotStr === 'autorotate' ){ - rs.labelAngle = rs.sourceLabelAngle = rs.targetLabelAngle = 0; - } else { - rs.labelAngle = rs.sourceLabelAngle = rs.targetLabelAngle = rot.pfValue; - } -}; - -module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/nodes.js b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/nodes.js deleted file mode 100644 index 046598c24..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/nodes.js +++ /dev/null @@ -1,27 +0,0 @@ -var BRp = {}; - -BRp.getNodeShape = function( node ){ - var r = this; - var shape = node.pstyle( 'shape' ).value; - - if( node.isParent() ){ - if( shape === 'rectangle' - || shape === 'roundrectangle' - || shape === 'cutrectangle' - || shape === 'barrel' ){ - return shape; - } else { - return 'rectangle'; - } - } - - if( shape === 'polygon' ){ - var points = node.pstyle( 'shape-polygon-points' ).value; - - return r.nodeShapes.makePolygon( points ).name; - } - - return shape; -}; - -module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/rendered-style.js b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/rendered-style.js deleted file mode 100644 index 870edef8b..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/rendered-style.js +++ /dev/null @@ -1,182 +0,0 @@ -var BRp = {}; - -BRp.registerCalculationListeners = function(){ - var cy = this.cy; - var elesToUpdate = cy.collection(); - var r = this; - - var enqueue = function( eles, e, dirtyStyleCaches = true ){ - elesToUpdate.merge( eles ); - - for( var i = 0; i < eles.length; i++ ){ - var ele = eles[i]; - var _p = ele._private; - var rstyle = _p.rstyle; - - if( dirtyStyleCaches ){ - rstyle.clean = false; - _p.bbCache = null; - } - - var evts = rstyle.dirtyEvents = rstyle.dirtyEvents || { length: 0 }; - - if( !evts[ e.type ] ){ - evts[ e.type ] = true; - evts.length++; - } - } - }; - - r.binder( cy ) - // nodes - - .on('position.* style.* free.* bounds.*', 'node', function onDirtyModNode( e ){ - var node = e.target; - - enqueue( node, e ); - enqueue( node.connectedEdges(), e ); - }) - - .on('add.*', 'node', function onDirtyAddNode( e ){ - var ele = e.target; - - enqueue( ele, e ); - }) - - .on('background.*', 'node', function onDirtyBgNode( e ){ - var ele = e.target; - - enqueue( ele, e, false ); - }) - - // edges - - .on('add.* style.*', 'edge', function onDirtyEdge( e ){ - var edge = e.target; - - enqueue( edge, e ); - enqueue( edge.parallelEdges(), e ); - }) - - .on('remove.*', 'edge', function onDirtyRemoveEdge( e ){ - var edge = e.target; - var pEdges = edge.parallelEdges(); - - for( var i = 0; i < pEdges.length; i++ ){ - var pEdge = pEdges[i]; - - if( !pEdge.removed() ){ - enqueue( pEdge, e ); - } - } - }) - - // manual dirtying - - .on('dirty.*', 'node', function onDirtyEle( e ){ - var ele = e.target; - - enqueue( ele, e ); - }) - ; - - var updateEleCalcs = function( willDraw ){ - if( willDraw ){ - var fns = r.onUpdateEleCalcsFns; - - if( fns ){ for( var i = 0; i < fns.length; i++ ){ - var fn = fns[i]; - - fn( willDraw, elesToUpdate ); - } } - - r.recalculateRenderedStyle( elesToUpdate, false ); - - for( var i = 0; i < elesToUpdate.length; i++ ){ - elesToUpdate[i]._private.rstyle.dirtyEvents = null; - } - - elesToUpdate = cy.collection(); - } - }; - - r.beforeRender( updateEleCalcs, r.beforeRenderPriorities.eleCalcs ); -}; - -BRp.onUpdateEleCalcs = function( fn ){ - var fns = this.onUpdateEleCalcsFns = this.onUpdateEleCalcsFns || []; - - fns.push( fn ); -}; - -BRp.recalculateRenderedStyle = function( eles, useCache ){ - var edges = []; - var nodes = []; - - // the renderer can't be used for calcs when destroyed, e.g. ele.boundingBox() - if( this.destroyed ){ return; } - - // use cache by default for perf - if( useCache === undefined ){ useCache = true; } - - for( var i = 0; i < eles.length; i++ ){ - var ele = eles[ i ]; - var _p = ele._private; - var rstyle = _p.rstyle; - - // only update if dirty and in graph - if( (useCache && rstyle.clean) || ele.removed() ){ continue; } - - // only update if not display: none - if( ele.pstyle('display').value === 'none' ){ continue; } - - if( _p.group === 'nodes' ){ - nodes.push( ele ); - } else { // edges - edges.push( ele ); - } - - rstyle.clean = true; - // rstyle.dirtyEvents = null; - } - - // update node data from projections - for( var i = 0; i < nodes.length; i++ ){ - var ele = nodes[i]; - var _p = ele._private; - var rstyle = _p.rstyle; - var pos = ele.position(); - - this.recalculateNodeLabelProjection( ele ); - - rstyle.nodeX = pos.x; - rstyle.nodeY = pos.y; - rstyle.nodeW = ele.pstyle( 'width' ).pfValue; - rstyle.nodeH = ele.pstyle( 'height' ).pfValue; - } - - this.recalculateEdgeProjections( edges ); - - // update edge data from projections - for( var i = 0; i < edges.length; i++ ){ - var ele = edges[ i ]; - var _p = ele._private; - var rstyle = _p.rstyle; - var rs = _p.rscratch; - - this.recalculateEdgeLabelProjections( ele ); - - // update rstyle positions - rstyle.srcX = rs.arrowStartX; - rstyle.srcY = rs.arrowStartY; - rstyle.tgtX = rs.arrowEndX; - rstyle.tgtY = rs.arrowEndY; - rstyle.midX = rs.midX; - rstyle.midY = rs.midY; - rstyle.labelAngle = rs.labelAngle; - rstyle.sourceLabelAngle = rs.sourceLabelAngle; - rstyle.targetLabelAngle = rs.targetLabelAngle; - } -}; - -module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/z-ordering.js b/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/z-ordering.js deleted file mode 100644 index 9c66bceaa..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/base/coord-ele-math/z-ordering.js +++ /dev/null @@ -1,65 +0,0 @@ -var zIndexSort = require( '../../../../collection/zsort' ); - -var BRp = {}; - -BRp.updateCachedGrabbedEles = function(){ - var eles = this.cachedZSortedEles; - - if( !eles ){ - // just let this be recalculated on the next z sort tick - return; - } - - eles.drag = []; - eles.nondrag = []; - - var grabTargets = []; - - for( var i = 0; i < eles.length; i++ ){ - var ele = eles[i]; - var rs = ele._private.rscratch; - - if( ele.grabbed() && !ele.isParent() ){ - grabTargets.push( ele ); - } else if( rs.inDragLayer ){ - eles.drag.push( ele ); - } else { - eles.nondrag.push( ele ); - } - } - - // put the grab target nodes last so it's on top of its neighbourhood - for( var i = 0; i < grabTargets.length; i++ ){ - var ele = grabTargets[i]; - - eles.drag.push( ele ); - } -}; - -BRp.invalidateCachedZSortedEles = function(){ - this.cachedZSortedEles = null; -}; - -BRp.getCachedZSortedEles = function( forceRecalc ){ - if( forceRecalc || !this.cachedZSortedEles ){ - //console.time('cachezorder') - - var eles = this.cy.mutableElements().toArray(); - - eles.sort( zIndexSort ); - - eles.interactive = eles.filter(function( ele ){ - return ele.interactive(); - }); - - this.cachedZSortedEles = eles; - - this.updateCachedGrabbedEles(); - } else { - eles = this.cachedZSortedEles; - } - - return eles; -}; - -module.exports = BRp diff --git a/node_modules/cytoscape/src/extensions/renderer/base/images.js b/node_modules/cytoscape/src/extensions/renderer/base/images.js deleted file mode 100644 index f1e2b5691..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/base/images.js +++ /dev/null @@ -1,36 +0,0 @@ -var BRp = {}; - -BRp.getCachedImage = function( url, crossOrigin, onLoad ){ - var r = this; - var imageCache = r.imageCache = r.imageCache || {}; - var cache = imageCache[ url ]; - - if( cache ){ - if( !cache.image.complete ){ - cache.image.addEventListener('load', onLoad); - } - - return cache.image; - } else { - cache = imageCache[ url ] = imageCache[ url ] || {}; - - var image = cache.image = new Image(); // eslint-disable-line no-undef - - image.addEventListener('load', onLoad); - image.addEventListener('error', function(){ image.error = true; }); - - // #1582 safari doesn't load data uris with crossOrigin properly - // https://bugs.webkit.org/show_bug.cgi?id=123978 - var dataUriPrefix = 'data:'; - var isDataUri = url.substring( 0, dataUriPrefix.length ).toLowerCase() === dataUriPrefix; - if( !isDataUri ){ - image.crossOrigin = crossOrigin; // prevent tainted canvas - } - - image.src = url; - - return image; - } -}; - -module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/index.js b/node_modules/cytoscape/src/extensions/renderer/base/index.js deleted file mode 100644 index 84e261ac1..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/base/index.js +++ /dev/null @@ -1,210 +0,0 @@ -var is = require('../../../is'); -var util = require('../../../util'); -var window = require('../../../window'); - -var BaseRenderer = function( options ){ this.init( options ); }; -var BR = BaseRenderer; -var BRp = BR.prototype; - -BRp.clientFunctions = [ 'redrawHint', 'render', 'renderTo', 'matchCanvasSize', 'nodeShapeImpl', 'arrowShapeImpl' ]; - -BRp.init = function( options ){ - var r = this; - - r.options = options; - - r.cy = options.cy; - - var ctr = r.container = options.cy.container(); - - // prepend a stylesheet in the head such that - if( window ){ - var document = window.document; - var head = document.head; - var stylesheetId = '__________cytoscape_stylesheet'; - var className = '__________cytoscape_container'; - var stylesheetAlreadyExists = document.getElementById( stylesheetId ) != null; - - if( ctr.className.indexOf( className ) < 0 ){ - ctr.className = ( ctr.className || '' ) + ' ' + className; - } - - if( !stylesheetAlreadyExists ){ - var stylesheet = document.createElement('style'); - - stylesheet.id = stylesheetId; - stylesheet.innerHTML = '.'+className+' { position: relative; }'; - - head.insertBefore( stylesheet, head.children[0] ); // first so lowest priority - } - - var computedStyle = window.getComputedStyle( ctr ); - var position = computedStyle.getPropertyValue('position'); - - if( position === 'static' ){ - util.error('A Cytoscape container has style position:static and so can not use UI extensions properly'); - } - } - - r.selection = [ undefined, undefined, undefined, undefined, 0]; // Coordinates for selection box, plus enabled flag - - r.bezierProjPcts = [ 0.05, 0.225, 0.4, 0.5, 0.6, 0.775, 0.95 ]; - - //--Pointer-related data - r.hoverData = {down: null, last: null, - downTime: null, triggerMode: null, - dragging: false, - initialPan: [ null, null ], capture: false}; - - r.dragData = {possibleDragElements: []}; - - r.touchData = { - start: null, capture: false, - - // These 3 fields related to tap, taphold events - startPosition: [ null, null, null, null, null, null ], - singleTouchStartTime: null, - singleTouchMoved: true, - - now: [ null, null, null, null, null, null ], - earlier: [ null, null, null, null, null, null ] - }; - - r.redraws = 0; - r.showFps = options.showFps; - r.debug = options.debug; - - r.hideEdgesOnViewport = options.hideEdgesOnViewport; - r.hideLabelsOnViewport = options.hideLabelsOnViewport; - r.textureOnViewport = options.textureOnViewport; - r.wheelSensitivity = options.wheelSensitivity; - r.motionBlurEnabled = options.motionBlur; // on by default - r.forcedPixelRatio = options.pixelRatio; - r.motionBlur = options.motionBlur; // for initial kick off - r.motionBlurOpacity = options.motionBlurOpacity; - r.motionBlurTransparency = 1 - r.motionBlurOpacity; - r.motionBlurPxRatio = 1; - r.mbPxRBlurry = 1; //0.8; - r.minMbLowQualFrames = 4; - r.fullQualityMb = false; - r.clearedForMotionBlur = []; - r.desktopTapThreshold = options.desktopTapThreshold; - r.desktopTapThreshold2 = options.desktopTapThreshold * options.desktopTapThreshold; - r.touchTapThreshold = options.touchTapThreshold; - r.touchTapThreshold2 = options.touchTapThreshold * options.touchTapThreshold; - r.tapholdDuration = 500; - - r.bindings = []; - r.beforeRenderCallbacks = []; - r.beforeRenderPriorities = { // higher priority execs before lower one - animations: 400, - eleCalcs: 300, - eleTxrDeq: 200, - lyrTxrDeq: 100 - }; - - r.registerNodeShapes(); - r.registerArrowShapes(); - r.registerCalculationListeners(); -}; - -BRp.notify = function( params ){ - var types; - var r = this; - - // the renderer can't be notified after it's destroyed - if( this.destroyed ){ return; } - - if( is.array( params.type ) ){ - types = params.type; - - } else { - types = [ params.type ]; - } - - var has = {}; - for( var i = 0; i < types.length; i++ ){ - var type = types[ i ]; - - has[ type ] = true; - } // for - - if( has['init'] ){ - r.load(); - return; - } - - if( has['destroy'] ){ - r.destroy(); - return; - } - - if( has['add'] || has['remove'] || has['load'] || has['zorder'] ){ - r.invalidateCachedZSortedEles(); - } - - if( has['viewport'] ){ - r.redrawHint( 'select', true ); - } - - if( has['load'] || has['resize'] ){ - r.invalidateContainerClientCoordsCache(); - r.matchCanvasSize( r.container ); - } - - r.redrawHint( 'eles', true ); - r.redrawHint( 'drag', true ); - - this.startRenderLoop(); - - this.redraw(); -}; - -BRp.destroy = function(){ - var r = this; - - r.destroyed = true; - - r.cy.stopAnimationLoop(); - - for( var i = 0; i < r.bindings.length; i++ ){ - var binding = r.bindings[ i ]; - var b = binding; - var tgt = b.target; - - ( tgt.off || tgt.removeEventListener ).apply( tgt, b.args ); - } - - r.bindings = []; - r.beforeRenderCallbacks = []; - r.onUpdateEleCalcsFns = []; - - if( r.removeObserver ){ - r.removeObserver.disconnect(); - } - - if( r.styleObserver ){ - r.styleObserver.disconnect(); - } - - if( r.labelCalcDiv ){ - try { - document.body.removeChild( r.labelCalcDiv ); // eslint-disable-line no-undef - } catch( e ){ - // ie10 issue #1014 - } - } -}; - -[ - require( './arrow-shapes' ), - require( './coord-ele-math' ), - require( './images' ), - require( './load-listeners' ), - require( './node-shapes' ), - require( './redraw' ) -].forEach( function( props ){ - util.extend( BRp, props ); -} ); - -module.exports = BR; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/load-listeners.js b/node_modules/cytoscape/src/extensions/renderer/base/load-listeners.js deleted file mode 100644 index ac545c93b..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/base/load-listeners.js +++ /dev/null @@ -1,2085 +0,0 @@ -var is = require( '../../../is' ); -var util = require( '../../../util' ); -var math = require( '../../../math' ); -var Event = require( '../../../event' ); - -var BRp = {}; - -BRp.registerBinding = function( target, event, handler, useCapture ){ - var args = Array.prototype.slice.apply( arguments, [1] ); // copy - var b = this.binder( target ); - - return b.on.apply( b, args ); -}; - -BRp.binder = function( tgt ){ - var r = this; - - var tgtIsDom = tgt === window || tgt === document || tgt === document.body || is.domElement( tgt ); - - if( r.supportsPassiveEvents == null ){ - - // from https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection - var supportsPassive = false; - try { - var opts = Object.defineProperty( {}, 'passive', { - get: function(){ - supportsPassive = true; - } - } ); - - window.addEventListener( 'test', null, opts ); - } catch( err ){} - - r.supportsPassiveEvents = supportsPassive; - } - - var on = function( event, handler, useCapture ){ - var args = Array.prototype.slice.call( arguments ); - - if( tgtIsDom && r.supportsPassiveEvents ){ // replace useCapture w/ opts obj - args[2] = { - capture: useCapture != null ? useCapture : false, - passive: false, - once: false - }; - } - - r.bindings.push({ - target: tgt, - args: args - }); - - ( tgt.addEventListener || tgt.on ).apply( tgt, args ); - - return this; - }; - - return { - on: on, - addEventListener: on, - addListener: on, - bind: on - }; -}; - -BRp.nodeIsDraggable = function( node ){ - return ( - node - && node.isNode() - && !node.locked() - && node.grabbable() - ); -}; - -BRp.nodeIsGrabbable = function( node ){ - return ( - this.nodeIsDraggable( node ) - && node.interactive() - ); -}; - -BRp.load = function(){ - var r = this; - - var triggerEvents = function( target, names, e, props ){ - if( target == null ){ - target = r.cy; - } - - for( var i = 0; i < names.length; i++ ){ - var name = names[ i ]; - - target.emit( util.extend( { originalEvent: e, type: name }, props ) ); - } - }; - - var isMultSelKeyDown = function( e ){ - return e.shiftKey || e.metaKey || e.ctrlKey; // maybe e.altKey - }; - - var allowPanningPassthrough = function( down, downs ){ - var allowPassthrough = true; - - if( r.cy.hasCompoundNodes() && down && down.isEdge() ){ - // a compound node below the edge => no passthrough panning - for( var i = 0; downs && i < downs.length; i++ ){ - var down = downs[i]; - - if( down.isNode() && down.isParent() ){ - allowPassthrough = false; - break; - } - } - } else { - allowPassthrough = true; - } - - return allowPassthrough; - }; - - var getDragListIds = function( opts ){ - var listHasId; - - if( opts.addToList && r.cy.hasCompoundNodes() ){ // only needed for compound graphs - if( !opts.addToList.hasId ){ // build ids lookup if doesn't already exist - opts.addToList.hasId = {}; - - for( var i = 0; i < opts.addToList.length; i++ ){ - var ele = opts.addToList[ i ]; - - opts.addToList.hasId[ ele.id() ] = true; - } - } - - listHasId = opts.addToList.hasId; - } - - return listHasId || {}; - }; - - var setGrabbed = function( ele ){ - ele[0]._private.grabbed = true; - }; - - var setFreed = function( ele ){ - ele[0]._private.grabbed = false; - }; - - var setInDragLayer = function( ele ){ - ele[0]._private.rscratch.inDragLayer = true; - }; - - var setOutDragLayer = function( ele ){ - ele[0]._private.rscratch.inDragLayer = false; - }; - - var setGrabTarget = function( ele ){ - ele[0]._private.rscratch.isGrabTarget = true; - }; - - var removeGrabTarget = function( ele ){ - ele[0]._private.rscratch.isGrabTarget = false; - }; - - var addToDragList = function( ele, opts ){ - var listHasId = getDragListIds( opts ); - - if( !listHasId[ ele.id() ] ){ - opts.addToList.push( ele ); - listHasId[ ele.id() ] = true; - - setGrabbed( ele ); - } - }; - - // helper function to determine which child nodes and inner edges - // of a compound node to be dragged as well as the grabbed and selected nodes - var addDescendantsToDrag = function( node, opts ){ - if( !node.cy().hasCompoundNodes() ){ - return; - } - - if( opts.inDragLayer == null && opts.addToList == null ){ return; } // nothing to do - - var innerNodes = node.descendants(); - - if( opts.inDragLayer ){ - innerNodes.forEach( setInDragLayer ); - innerNodes.connectedEdges().forEach( setInDragLayer ); - } - - if( opts.addToList ){ - innerNodes.forEach(function( ele ){ - addToDragList( ele, opts ); - }); - } - }; - - // adds the given nodes and its neighbourhood to the drag layer - var addNodesToDrag = function( nodes, opts ){ - opts = opts || {}; - - var hasCompoundNodes = nodes.cy().hasCompoundNodes(); - - if( opts.inDragLayer ){ - nodes.forEach( setInDragLayer ); - - nodes.neighborhood().stdFilter(function( ele ){ - return !hasCompoundNodes || ele.isEdge(); - }).forEach( setInDragLayer ); - } - - if( opts.addToList ){ - nodes.forEach(function( ele ){ - addToDragList( ele, opts ); - }); - } - - addDescendantsToDrag( nodes, opts ); // always add to drag - - // also add nodes and edges related to the topmost ancestor - updateAncestorsInDragLayer( nodes, { - inDragLayer: opts.inDragLayer - } ); - - r.updateCachedGrabbedEles(); - }; - - var addNodeToDrag = addNodesToDrag; - - var freeDraggedElements = function( grabbedEles ){ - if( !grabbedEles ){ return; } - - grabbedEles.hasId = {}; // clear the id list - - // just go over all elements rather than doing a bunch of (possibly expensive) traversals - r.getCachedZSortedEles().forEach(function( ele ){ - setFreed( ele ); - setOutDragLayer( ele ); - removeGrabTarget( ele ); - }); - - r.updateCachedGrabbedEles(); - }; - - // helper function to determine which ancestor nodes and edges should go - // to the drag layer (or should be removed from drag layer). - var updateAncestorsInDragLayer = function( node, opts ){ - - if( opts.inDragLayer == null && opts.addToList == null ){ return; } // nothing to do - - if( !node.cy().hasCompoundNodes() ){ - return; - } - - // find top-level parent - var parent = node.ancestors().orphans(); - - // no parent node: no nodes to add to the drag layer - if( parent.same( node ) ){ - return; - } - - var nodes = parent.descendants().spawnSelf() - .merge( parent ) - .unmerge( node ) - .unmerge( node.descendants() ) - ; - - var edges = nodes.connectedEdges(); - - if( opts.inDragLayer ){ - edges.forEach( setInDragLayer ); - nodes.forEach( setInDragLayer ); - } - - if( opts.addToList ){ - nodes.forEach(function( ele ){ - addToDragList( ele, opts ); - }); - } - }; - - var blurActiveDomElement = function(){ - if( document.activeElement != null && document.activeElement.blur != null ){ - document.activeElement.blur(); - } - }; - - var haveMutationsApi = typeof MutationObserver !== 'undefined'; - - // watch for when the cy container is removed from the dom - if( haveMutationsApi ){ - r.removeObserver = new MutationObserver( function( mutns ){ // eslint-disable-line no-undef - for( var i = 0; i < mutns.length; i++ ){ - var mutn = mutns[ i ]; - var rNodes = mutn.removedNodes; - - if( rNodes ){ for( var j = 0; j < rNodes.length; j++ ){ - var rNode = rNodes[ j ]; - - if( rNode === r.container ){ - r.destroy(); - break; - } - } } - } - } ); - - if( r.container.parentNode ){ - r.removeObserver.observe( r.container.parentNode, { childList: true } ); - } - } else { - r.registerBinding( r.container, 'DOMNodeRemoved', function( e ){ - r.destroy(); - } ); - } - - var onResize = util.debounce( function(){ - r.cy.resize(); - }, 100 ); - - if( haveMutationsApi ){ - r.styleObserver = new MutationObserver( onResize ); // eslint-disable-line no-undef - - r.styleObserver.observe( r.container, { attributes: true } ); - } - - // auto resize - r.registerBinding( window, 'resize', onResize ); // eslint-disable-line no-undef - - var forEachUp = function( domEle, fn ){ - while( domEle != null ){ - fn( domEle ); - - domEle = domEle.parentNode - } - }; - - var invalidateCoords = function(){ - r.invalidateContainerClientCoordsCache(); - }; - - forEachUp( r.container, function( domEle ){ - r.registerBinding( domEle, 'transitionend', invalidateCoords ); - r.registerBinding( domEle, 'animationend', invalidateCoords ); - r.registerBinding( domEle, 'scroll', invalidateCoords ); - } ); - - // stop right click menu from appearing on cy - r.registerBinding( r.container, 'contextmenu', function( e ){ - e.preventDefault(); - } ); - - var inBoxSelection = function(){ - return r.selection[4] !== 0; - }; - - var eventInContainer = function( e ){ - // save cycles if mouse events aren't to be captured - var containerPageCoords = r.findContainerClientCoords(); - var x = containerPageCoords[0]; - var y = containerPageCoords[1]; - var width = containerPageCoords[2]; - var height = containerPageCoords[3]; - - var positions = e.touches ? e.touches : [ e ]; - var atLeastOnePosInside = false; - - for( var i = 0; i < positions.length; i++ ){ - var p = positions[i]; - - if( x <= p.clientX && p.clientX <= x + width - && y <= p.clientY && p.clientY <= y + height - ){ - atLeastOnePosInside = true; - break; - } - } - - if( !atLeastOnePosInside ){ return false; } - - var container = r.container; - var target = e.target; - var tParent = target.parentNode; - var containerIsTarget = false; - - while( tParent ){ - if( tParent === container ){ - containerIsTarget = true; - break; - } - - tParent = tParent.parentNode; - } - - if( !containerIsTarget ){ return false; } // if target is outisde cy container, then this event is not for us - - return true; - }; - - // Primary key - r.registerBinding( r.container, 'mousedown', function mousedownHandler( e ){ - if( !eventInContainer(e) ){ return; } - - e.preventDefault(); - - blurActiveDomElement(); - - r.hoverData.capture = true; - r.hoverData.which = e.which; - - var cy = r.cy; - var gpos = [ e.clientX, e.clientY ]; - var pos = r.projectIntoViewport( gpos[0], gpos[1] ); - var select = r.selection; - var nears = r.findNearestElements( pos[0], pos[1], true, false ); - var near = nears[0]; - var draggedElements = r.dragData.possibleDragElements; - - r.hoverData.mdownPos = pos; - r.hoverData.mdownGPos = gpos; - - var checkForTaphold = function(){ - r.hoverData.tapholdCancelled = false; - - clearTimeout( r.hoverData.tapholdTimeout ); - - r.hoverData.tapholdTimeout = setTimeout( function(){ - - if( r.hoverData.tapholdCancelled ){ - return; - } else { - var ele = r.hoverData.down; - - if( ele ){ - ele.emit( { - originalEvent: e, - type: 'taphold', - position: { x: pos[0], y: pos[1] } - } ); - } else { - cy.emit( { - originalEvent: e, - type: 'taphold', - position: { x: pos[0], y: pos[1] } - } ); - } - } - - }, r.tapholdDuration ); - }; - - // Right click button - if( e.which == 3 ){ - - r.hoverData.cxtStarted = true; - - var cxtEvt = { - originalEvent: e, - type: 'cxttapstart', - position: { x: pos[0], y: pos[1] } - }; - - if( near ){ - near.activate(); - near.emit( cxtEvt ); - - r.hoverData.down = near; - } else { - cy.emit( cxtEvt ); - } - - r.hoverData.downTime = (new Date()).getTime(); - r.hoverData.cxtDragged = false; - - // Primary button - } else if( e.which == 1 ){ - - if( near ){ - near.activate(); - } - - // Element dragging - { - // If something is under the cursor and it is draggable, prepare to grab it - if( near != null ){ - - if( r.nodeIsGrabbable( near ) ){ - - var makeEvent = function( type ){ - return { - originalEvent: e, - type: type, - position: { x: pos[0], y: pos[1] } - }; - }; - - var triggerGrab = function( ele ){ - ele.emit( makeEvent('grab') ); - }; - - setGrabTarget( near ); - - if( !near.selected() ){ - - draggedElements = r.dragData.possibleDragElements = []; - addNodeToDrag( near, { addToList: draggedElements } ); - - near.emit( makeEvent('grabon') ).emit( makeEvent('grab') ); - - } else { - draggedElements = r.dragData.possibleDragElements = [ ]; - - var selectedNodes = cy.$( function( ele ){ return ele.isNode() && ele.selected() && r.nodeIsGrabbable( ele ); } ); - - addNodesToDrag( selectedNodes, { addToList: draggedElements } ); - - near.emit( makeEvent('grabon') ); - - selectedNodes.forEach( triggerGrab ); - } - - r.redrawHint( 'eles', true ); - r.redrawHint( 'drag', true ); - - } - - } - - r.hoverData.down = near; - r.hoverData.downs = nears; - r.hoverData.downTime = (new Date()).getTime(); - } - - triggerEvents( near, [ 'mousedown', 'tapstart', 'vmousedown' ], e, { - position: { x: pos[0], y: pos[1] } - } ); - - if( near == null ){ - select[4] = 1; - - r.data.bgActivePosistion = { - x: pos[0], - y: pos[1] - }; - - r.redrawHint( 'select', true ); - - r.redraw(); - } else if( near.isEdge() ){ - select[4] = 1; // for future pan - } - - checkForTaphold(); - - } - - // Initialize selection box coordinates - select[0] = select[2] = pos[0]; - select[1] = select[3] = pos[1]; - - }, false ); - - r.registerBinding( window, 'mousemove', function mousemoveHandler( e ){ // eslint-disable-line no-undef - var capture = r.hoverData.capture; - - if( !capture && !eventInContainer(e) ){ return; } - - var preventDefault = false; - var cy = r.cy; - var zoom = cy.zoom(); - var gpos = [ e.clientX, e.clientY ]; - var pos = r.projectIntoViewport( gpos[0], gpos[1] ); - var mdownPos = r.hoverData.mdownPos; - var mdownGPos = r.hoverData.mdownGPos; - var select = r.selection; - - var near = null; - if( !r.hoverData.draggingEles && !r.hoverData.dragging && !r.hoverData.selecting ){ - near = r.findNearestElement( pos[0], pos[1], true, false ); - } - var last = r.hoverData.last; - var down = r.hoverData.down; - - var disp = [ pos[0] - select[2], pos[1] - select[3] ]; - - var draggedElements = r.dragData.possibleDragElements; - - var isOverThresholdDrag; - - if( mdownGPos ){ - var dx = gpos[0] - mdownGPos[0]; - var dx2 = dx * dx; - var dy = gpos[1] - mdownGPos[1]; - var dy2 = dy * dy; - var dist2 = dx2 + dy2; - - r.hoverData.isOverThresholdDrag = isOverThresholdDrag = dist2 >= r.desktopTapThreshold2; - } - - var multSelKeyDown = isMultSelKeyDown( e ); - - if (isOverThresholdDrag) { - r.hoverData.tapholdCancelled = true; - } - - var updateDragDelta = function(){ - var dragDelta = r.hoverData.dragDelta = r.hoverData.dragDelta || []; - - if( dragDelta.length === 0 ){ - dragDelta.push( disp[0] ); - dragDelta.push( disp[1] ); - } else { - dragDelta[0] += disp[0]; - dragDelta[1] += disp[1]; - } - }; - - - preventDefault = true; - - triggerEvents( near, [ 'mousemove', 'vmousemove', 'tapdrag' ], e, { - position: { x: pos[0], y: pos[1] } - } ); - - var goIntoBoxMode = function(){ - r.data.bgActivePosistion = undefined; - - if( !r.hoverData.selecting ){ - cy.emit('boxstart'); - } - - select[4] = 1; - r.hoverData.selecting = true; - - r.redrawHint( 'select', true ); - r.redraw(); - }; - - // trigger context drag if rmouse down - if( r.hoverData.which === 3 ){ - // but only if over threshold - if( isOverThresholdDrag ){ - var cxtEvt = ( { - originalEvent: e, - type: 'cxtdrag', - position: { x: pos[0], y: pos[1] } - } ); - - if( down ){ - down.emit( cxtEvt ); - } else { - cy.emit( cxtEvt ); - } - - r.hoverData.cxtDragged = true; - - if( !r.hoverData.cxtOver || near !== r.hoverData.cxtOver ){ - - if( r.hoverData.cxtOver ){ - r.hoverData.cxtOver.emit( ( { - originalEvent: e, - type: 'cxtdragout', - position: { x: pos[0], y: pos[1] } - } ) ); - } - - r.hoverData.cxtOver = near; - - if( near ){ - near.emit( ( { - originalEvent: e, - type: 'cxtdragover', - position: { x: pos[0], y: pos[1] } - } ) ); - } - - } - } - - // Check if we are drag panning the entire graph - } else if( r.hoverData.dragging ){ - preventDefault = true; - - if( cy.panningEnabled() && cy.userPanningEnabled() ){ - var deltaP; - - if( r.hoverData.justStartedPan ){ - var mdPos = r.hoverData.mdownPos; - - deltaP = { - x: ( pos[0] - mdPos[0] ) * zoom, - y: ( pos[1] - mdPos[1] ) * zoom - }; - - r.hoverData.justStartedPan = false; - - } else { - deltaP = { - x: disp[0] * zoom, - y: disp[1] * zoom - }; - - } - - cy.panBy( deltaP ); - - r.hoverData.dragged = true; - } - - // Needs reproject due to pan changing viewport - pos = r.projectIntoViewport( e.clientX, e.clientY ); - - // Checks primary button down & out of time & mouse not moved much - } else if( - select[4] == 1 && (down == null || down.isEdge()) - ){ - - if( isOverThresholdDrag ){ - - if( !r.hoverData.dragging && cy.boxSelectionEnabled() && ( multSelKeyDown || !cy.panningEnabled() || !cy.userPanningEnabled() ) ){ - goIntoBoxMode(); - - } else if( !r.hoverData.selecting && cy.panningEnabled() && cy.userPanningEnabled() ){ - var allowPassthrough = allowPanningPassthrough( down, r.hoverData.downs ); - - if( allowPassthrough ){ - r.hoverData.dragging = true; - r.hoverData.justStartedPan = true; - select[4] = 0; - - r.data.bgActivePosistion = math.array2point( mdownPos ); - - r.redrawHint( 'select', true ); - r.redraw(); - } - } - - if( down && down.isEdge() && down.active() ){ down.unactivate(); } - - } - - } else { - if( down && down.isEdge() && down.active() ){ down.unactivate(); } - - if( ( !down || !down.grabbed() ) && near != last ){ - - if( last ){ - triggerEvents( last, [ 'mouseout', 'tapdragout' ], e, { - position: { x: pos[0], y: pos[1] } - } ); - } - - if( near ){ - triggerEvents( near, [ 'mouseover', 'tapdragover' ], e, { - position: { x: pos[0], y: pos[1] } - } ); - } - - r.hoverData.last = near; - } - - if( down ){ - - if( isOverThresholdDrag ){ // then we can take action - - if( cy.boxSelectionEnabled() && multSelKeyDown ){ // then selection overrides - if( down && down.grabbed() ){ - freeDraggedElements( draggedElements ); - - down.emit('free'); - } - - goIntoBoxMode(); - - } else if( down && down.grabbed() && r.nodeIsDraggable( down ) ){ // drag node - var justStartedDrag = !r.dragData.didDrag; - - if( justStartedDrag ){ - r.redrawHint( 'eles', true ); - } - - r.dragData.didDrag = true; // indicate that we actually did drag the node - - var toTrigger = []; - - // now, add the elements to the drag layer if not done already - if( !r.hoverData.draggingEles ){ - addNodesToDrag( cy.collection( draggedElements ), { inDragLayer: true } ); - } - - for( var i = 0; i < draggedElements.length; i++ ){ - var dEle = draggedElements[ i ]; - - // Locked nodes not draggable, as well as non-visible nodes - if( r.nodeIsDraggable( dEle ) && dEle.grabbed() ){ - var dPos = dEle.position(); - - toTrigger.push( dEle ); - - if( is.number( disp[0] ) && is.number( disp[1] ) ){ - dPos.x += disp[0]; - dPos.y += disp[1]; - - if( justStartedDrag ){ - var dragDelta = r.hoverData.dragDelta; - - if( dragDelta && is.number( dragDelta[0] ) && is.number( dragDelta[1] ) ){ - dPos.x += dragDelta[0]; - dPos.y += dragDelta[1]; - } - } - } - - } - } - - r.hoverData.draggingEles = true; - - var tcol = cy.collection( toTrigger ); - - tcol.dirtyCompoundBoundsCache(); - tcol.emit( 'position drag' ); - - r.redrawHint( 'drag', true ); - r.redraw(); - } - - } else { // otherwise save drag delta for when we actually start dragging so the relative grab pos is constant - updateDragDelta(); - } - } - - // prevent the dragging from triggering text selection on the page - preventDefault = true; - } - - select[2] = pos[0]; select[3] = pos[1]; - - if( preventDefault ){ - if( e.stopPropagation ) e.stopPropagation(); - if( e.preventDefault ) e.preventDefault(); - return false; - } - }, false ); - - r.registerBinding( window, 'mouseup', function mouseupHandler( e ){ // eslint-disable-line no-undef - var capture = r.hoverData.capture; - if( !capture ){ return; } - r.hoverData.capture = false; - - var cy = r.cy; var pos = r.projectIntoViewport( e.clientX, e.clientY ); var select = r.selection; - var near = r.findNearestElement( pos[0], pos[1], true, false ); - var draggedElements = r.dragData.possibleDragElements; var down = r.hoverData.down; - var multSelKeyDown = isMultSelKeyDown( e ); - - if( r.data.bgActivePosistion ){ - r.redrawHint( 'select', true ); - r.redraw(); - } - - r.hoverData.tapholdCancelled = true; - - r.data.bgActivePosistion = undefined; // not active bg now - - if( down ){ - down.unactivate(); - } - - if( r.hoverData.which === 3 ){ - var cxtEvt = ( { - originalEvent: e, - type: 'cxttapend', - position: { x: pos[0], y: pos[1] } - } ); - - if( down ){ - down.emit( cxtEvt ); - } else { - cy.emit( cxtEvt ); - } - - if( !r.hoverData.cxtDragged ){ - var cxtTap = ( { - originalEvent: e, - type: 'cxttap', - position: { x: pos[0], y: pos[1] } - } ); - - if( down ){ - down.emit( cxtTap ); - } else { - cy.emit( cxtTap ); - } - } - - r.hoverData.cxtDragged = false; - r.hoverData.which = null; - - } else if( r.hoverData.which === 1 ){ - - // Deselect all elements if nothing is currently under the mouse cursor and we aren't dragging something - if( (down == null) // not mousedown on node - && !r.dragData.didDrag // didn't move the node around - && !r.hoverData.selecting // not box selection - && !r.hoverData.dragged // didn't pan - && !isMultSelKeyDown( e ) - ){ - - cy.$( function( ele ){ return ele.selected(); } ).unselect(); - - if( draggedElements.length > 0 ){ - r.redrawHint( 'eles', true ); - } - - r.dragData.possibleDragElements = draggedElements = []; - } - - triggerEvents( near, [ 'mouseup', 'tapend', 'vmouseup' ], e, { - position: { x: pos[0], y: pos[1] } - } ); - - if( - !r.dragData.didDrag // didn't move a node around - && !r.hoverData.dragged // didn't pan - && !r.hoverData.selecting // not box selection - && !r.hoverData.isOverThresholdDrag // didn't move too much - ){ - triggerEvents( down, ['click', 'tap', 'vclick'], e, { - position: { x: pos[0], y: pos[1] } - } ); - } - - // Single selection - if( near == down && !r.dragData.didDrag && !r.hoverData.selecting ){ - if( near != null && near._private.selectable ){ - - if( r.hoverData.dragging ){ - // if panning, don't change selection state - } else if( cy.selectionType() === 'additive' || multSelKeyDown ){ - if( near.selected() ){ - near.unselect(); - } else { - near.select(); - } - } else { - if( !multSelKeyDown ){ - cy.$( ':selected' ).unmerge( near ).unselect(); - near.select(); - } - } - - r.redrawHint( 'eles', true ); - } - } - - if( r.hoverData.selecting ){ - var box = cy.collection( r.getAllInBox( select[0], select[1], select[2], select[3] ) ); - - r.redrawHint( 'select', true ); - - if( box.length > 0 ){ - r.redrawHint( 'eles', true ); - } - - cy.emit('boxend'); - - var eleWouldBeSelected = function( ele ){ return ele.selectable() && !ele.selected(); }; - - if( cy.selectionType() === 'additive' ){ - box - .emit('box') - .stdFilter( eleWouldBeSelected ) - .select() - .emit('boxselect') - ; - } else { - if( !multSelKeyDown ){ - cy.$( ':selected' ).unmerge( box ).unselect(); - } - - box - .emit('box') - .stdFilter( eleWouldBeSelected ) - .select() - .emit('boxselect') - ; - } - - // always need redraw in case eles unselectable - r.redraw(); - - } - - // Cancel drag pan - if( r.hoverData.dragging ){ - r.hoverData.dragging = false; - - r.redrawHint( 'select', true ); - r.redrawHint( 'eles', true ); - - r.redraw(); - } - - if( !select[4] ) { - r.redrawHint('drag', true); - r.redrawHint('eles', true); - - var downWasGrabbed = down && down.grabbed(); - - freeDraggedElements( draggedElements ); - - if( downWasGrabbed ){ down.emit('free'); } - } - - } // else not right mouse - - select[4] = 0; r.hoverData.down = null; - - r.hoverData.cxtStarted = false; - r.hoverData.draggingEles = false; - r.hoverData.selecting = false; - r.hoverData.isOverThresholdDrag = false; - r.dragData.didDrag = false; - r.hoverData.dragged = false; - r.hoverData.dragDelta = []; - r.hoverData.mdownPos = null; - r.hoverData.mdownGPos = null; - - }, false ); - - var wheelHandler = function( e ){ - - - if( r.scrollingPage ){ return; } // while scrolling, ignore wheel-to-zoom - - var cy = r.cy; - var pos = r.projectIntoViewport( e.clientX, e.clientY ); - var rpos = [ pos[0] * cy.zoom() + cy.pan().x, - pos[1] * cy.zoom() + cy.pan().y ]; - - if( r.hoverData.draggingEles || r.hoverData.dragging || r.hoverData.cxtStarted || inBoxSelection() ){ // if pan dragging or cxt dragging, wheel movements make no zoom - e.preventDefault(); - return; - } - - if( cy.panningEnabled() && cy.userPanningEnabled() && cy.zoomingEnabled() && cy.userZoomingEnabled() ){ - e.preventDefault(); - - r.data.wheelZooming = true; - clearTimeout( r.data.wheelTimeout ); - r.data.wheelTimeout = setTimeout( function(){ - r.data.wheelZooming = false; - - r.redrawHint( 'eles', true ); - r.redraw(); - }, 150 ); - - var diff; - - if( e.deltaY != null ){ - diff = e.deltaY / -250; - } else if( e.wheelDeltaY != null ){ - diff = e.wheelDeltaY / 1000; - } else { - diff = e.wheelDelta / 1000; - } - - diff = diff * r.wheelSensitivity; - - var needsWheelFix = e.deltaMode === 1; - if( needsWheelFix ){ // fixes slow wheel events on ff/linux and ff/windows - diff *= 33; - } - - cy.zoom( { - level: cy.zoom() * Math.pow( 10, diff ), - renderedPosition: { x: rpos[0], y: rpos[1] } - } ); - } - - }; - - // Functions to help with whether mouse wheel should trigger zooming - // -- - r.registerBinding( r.container, 'wheel', wheelHandler, true ); - - // disable nonstandard wheel events - // r.registerBinding(r.container, 'mousewheel', wheelHandler, true); - // r.registerBinding(r.container, 'DOMMouseScroll', wheelHandler, true); - // r.registerBinding(r.container, 'MozMousePixelScroll', wheelHandler, true); // older firefox - - r.registerBinding( window, 'scroll', function scrollHandler( e ){ // eslint-disable-line no-undef - r.scrollingPage = true; - - clearTimeout( r.scrollingPageTimeout ); - r.scrollingPageTimeout = setTimeout( function(){ - r.scrollingPage = false; - }, 250 ); - }, true ); - - // Functions to help with handling mouseout/mouseover on the Cytoscape container - // Handle mouseout on Cytoscape container - r.registerBinding( r.container, 'mouseout', function mouseOutHandler( e ){ - var pos = r.projectIntoViewport( e.clientX, e.clientY ); - - r.cy.emit( ( { - originalEvent: e, - type: 'mouseout', - position: { x: pos[0], y: pos[1] } - } ) ); - }, false ); - - r.registerBinding( r.container, 'mouseover', function mouseOverHandler( e ){ - var pos = r.projectIntoViewport( e.clientX, e.clientY ); - - r.cy.emit( ( { - originalEvent: e, - type: 'mouseover', - position: { x: pos[0], y: pos[1] } - } ) ); - }, false ); - - var f1x1, f1y1, f2x1, f2y1; // starting points for pinch-to-zoom - var distance1, distance1Sq; // initial distance between finger 1 and finger 2 for pinch-to-zoom - var center1, modelCenter1; // center point on start pinch to zoom - var offsetLeft, offsetTop; - var containerWidth, containerHeight; - var twoFingersStartInside; - - var distance = function( x1, y1, x2, y2 ){ - return Math.sqrt( (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1) ); - }; - - var distanceSq = function( x1, y1, x2, y2 ){ - return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1); - }; - - var touchstartHandler; - r.registerBinding( r.container, 'touchstart', touchstartHandler = function( e ){ - if( !eventInContainer(e) ){ return; } - - blurActiveDomElement(); - - r.touchData.capture = true; - r.data.bgActivePosistion = undefined; - - var cy = r.cy; - var now = r.touchData.now; - var earlier = r.touchData.earlier; - - if( e.touches[0] ){ var pos = r.projectIntoViewport( e.touches[0].clientX, e.touches[0].clientY ); now[0] = pos[0]; now[1] = pos[1]; } - if( e.touches[1] ){ var pos = r.projectIntoViewport( e.touches[1].clientX, e.touches[1].clientY ); now[2] = pos[0]; now[3] = pos[1]; } - if( e.touches[2] ){ var pos = r.projectIntoViewport( e.touches[2].clientX, e.touches[2].clientY ); now[4] = pos[0]; now[5] = pos[1]; } - - // record starting points for pinch-to-zoom - if( e.touches[1] ){ - - freeDraggedElements( r.dragData.touchDragEles ); - - var offsets = r.findContainerClientCoords(); - offsetLeft = offsets[0]; - offsetTop = offsets[1]; - containerWidth = offsets[2]; - containerHeight = offsets[3]; - - f1x1 = e.touches[0].clientX - offsetLeft; - f1y1 = e.touches[0].clientY - offsetTop; - - f2x1 = e.touches[1].clientX - offsetLeft; - f2y1 = e.touches[1].clientY - offsetTop; - - twoFingersStartInside = - 0 <= f1x1 && f1x1 <= containerWidth - && 0 <= f2x1 && f2x1 <= containerWidth - && 0 <= f1y1 && f1y1 <= containerHeight - && 0 <= f2y1 && f2y1 <= containerHeight - ; - - var pan = cy.pan(); - var zoom = cy.zoom(); - - distance1 = distance( f1x1, f1y1, f2x1, f2y1 ); - distance1Sq = distanceSq( f1x1, f1y1, f2x1, f2y1 ); - center1 = [ (f1x1 + f2x1) / 2, (f1y1 + f2y1) / 2 ]; - modelCenter1 = [ - (center1[0] - pan.x) / zoom, - (center1[1] - pan.y) / zoom - ]; - - // consider context tap - var cxtDistThreshold = 200; - var cxtDistThresholdSq = cxtDistThreshold * cxtDistThreshold; - if( distance1Sq < cxtDistThresholdSq && !e.touches[2] ){ - - var near1 = r.findNearestElement( now[0], now[1], true, true ); - var near2 = r.findNearestElement( now[2], now[3], true, true ); - - if( near1 && near1.isNode() ){ - near1.activate().emit( ( { - originalEvent: e, - type: 'cxttapstart', - position: { x: now[0], y: now[1] } - } ) ); - r.touchData.start = near1; - - } else if( near2 && near2.isNode() ){ - near2.activate().emit( ( { - originalEvent: e, - type: 'cxttapstart', - position: { x: now[0], y: now[1] } - } ) ); - r.touchData.start = near2; - - } else { - cy.emit( ( { - originalEvent: e, - type: 'cxttapstart', - position: { x: now[0], y: now[1] } - } ) ); - } - - if( r.touchData.start ){ r.touchData.start._private.grabbed = false; } - r.touchData.cxt = true; - r.touchData.cxtDragged = false; - r.data.bgActivePosistion = undefined; - - r.redraw(); - return; - - } - - } - - if( e.touches[2] ){ - // ignore - } else if( e.touches[1] ){ - // ignore - } else if( e.touches[0] ){ - var nears = r.findNearestElements( now[0], now[1], true, true ); - var near = nears[0]; - - if( near != null ){ - near.activate(); - - r.touchData.start = near; - r.touchData.starts = nears; - - if( r.nodeIsGrabbable( near ) ){ - - var draggedEles = r.dragData.touchDragEles = []; - var selectedNodes = null; - - r.redrawHint( 'eles', true ); - r.redrawHint( 'drag', true ); - - if( near.selected() ){ - // reset drag elements, since near will be added again - - selectedNodes = cy.$( function( ele ){ - return ele.selected() && r.nodeIsGrabbable( ele ); - } ); - - addNodesToDrag( selectedNodes, { addToList: draggedEles } ); - } else { - addNodeToDrag( near, { addToList: draggedEles } ); - } - - setGrabTarget( near ); - - var makeEvent = function( type ){ - return ( { - originalEvent: e, - type: type, - position: { x: now[0], y: now[1] } - } ); - }; - - near.emit( makeEvent('grabon') ) - - if( selectedNodes ){ - selectedNodes.forEach(function( n ){ n.emit( makeEvent('grab') ); }); - } else { - near.emit( makeEvent('grab') ); - } - } - } - - triggerEvents( near, [ 'touchstart', 'tapstart', 'vmousedown' ], e, { - position: { x: now[0], y: now[1] } - } ); - - if( near == null ){ - r.data.bgActivePosistion = { - x: pos[0], - y: pos[1] - }; - - r.redrawHint( 'select', true ); - r.redraw(); - } - - - // Tap, taphold - // ----- - - r.touchData.singleTouchMoved = false; - r.touchData.singleTouchStartTime = +new Date(); - - clearTimeout( r.touchData.tapholdTimeout ); - r.touchData.tapholdTimeout = setTimeout( function(){ - if( - r.touchData.singleTouchMoved === false - && !r.pinching // if pinching, then taphold unselect shouldn't take effect - && !r.touchData.selecting // box selection shouldn't allow taphold through - ){ - triggerEvents( r.touchData.start, [ 'taphold' ], e, { - position: { x: now[0], y: now[1] } - } ); - - if( !r.touchData.start ){ - cy.$( ':selected' ).unselect(); - } - - } - }, r.tapholdDuration ); - } - - if( e.touches.length >= 1 ){ - var sPos = r.touchData.startPosition = []; - - for( var i = 0; i < now.length; i++ ){ - sPos[i] = earlier[i] = now[i]; - } - - var touch0 = e.touches[0]; - - r.touchData.startGPosition = [ touch0.clientX, touch0.clientY ]; - } - - }, false ); - - var touchmoveHandler; - r.registerBinding(window, 'touchmove', touchmoveHandler = function(e) { // eslint-disable-line no-undef - var capture = r.touchData.capture; - - if( !capture && !eventInContainer(e) ){ return; } - - var select = r.selection; - var cy = r.cy; - var now = r.touchData.now; - var earlier = r.touchData.earlier; - var zoom = cy.zoom(); - - if( e.touches[0] ){ var pos = r.projectIntoViewport( e.touches[0].clientX, e.touches[0].clientY ); now[0] = pos[0]; now[1] = pos[1]; } - if( e.touches[1] ){ var pos = r.projectIntoViewport( e.touches[1].clientX, e.touches[1].clientY ); now[2] = pos[0]; now[3] = pos[1]; } - if( e.touches[2] ){ var pos = r.projectIntoViewport( e.touches[2].clientX, e.touches[2].clientY ); now[4] = pos[0]; now[5] = pos[1]; } - - var startGPos = r.touchData.startGPosition; - var isOverThresholdDrag; - - if( capture && e.touches[0] && startGPos ){ - var disp = []; for (var j=0;j= r.touchTapThreshold2; - } - - // context swipe cancelling - if( capture && r.touchData.cxt ){ - e.preventDefault(); - - var f1x2 = e.touches[0].clientX - offsetLeft, f1y2 = e.touches[0].clientY - offsetTop; - var f2x2 = e.touches[1].clientX - offsetLeft, f2y2 = e.touches[1].clientY - offsetTop; - // var distance2 = distance( f1x2, f1y2, f2x2, f2y2 ); - var distance2Sq = distanceSq( f1x2, f1y2, f2x2, f2y2 ); - var factorSq = distance2Sq / distance1Sq; - - var distThreshold = 150; - var distThresholdSq = distThreshold * distThreshold; - var factorThreshold = 1.5; - var factorThresholdSq = factorThreshold * factorThreshold; - - // cancel ctx gestures if the distance b/t the fingers increases - if( factorSq >= factorThresholdSq || distance2Sq >= distThresholdSq ){ - r.touchData.cxt = false; - - r.data.bgActivePosistion = undefined; - - r.redrawHint( 'select', true ); - - var cxtEvt = ( { - originalEvent: e, - type: 'cxttapend', - position: { x: now[0], y: now[1] } - } ); - - if( r.touchData.start ){ - r.touchData.start - .unactivate() - .emit( cxtEvt ) - ; - - r.touchData.start = null; - } else { - cy.emit( cxtEvt ); - } - } - - } - - // context swipe - if( capture && r.touchData.cxt ){ - var cxtEvt = ( { - originalEvent: e, - type: 'cxtdrag', - position: { x: now[0], y: now[1] } - } ); - r.data.bgActivePosistion = undefined; - r.redrawHint( 'select', true ); - - if( r.touchData.start ){ - r.touchData.start.emit( cxtEvt ); - } else { - cy.emit( cxtEvt ); - } - - if( r.touchData.start ){ r.touchData.start._private.grabbed = false; } - r.touchData.cxtDragged = true; - - var near = r.findNearestElement( now[0], now[1], true, true ); - - if( !r.touchData.cxtOver || near !== r.touchData.cxtOver ){ - - if( r.touchData.cxtOver ){ - r.touchData.cxtOver.emit( ( { - originalEvent: e, - type: 'cxtdragout', - position: { x: now[0], y: now[1] } - } ) ); - } - - r.touchData.cxtOver = near; - - if( near ){ - near.emit( ( { - originalEvent: e, - type: 'cxtdragover', - position: { x: now[0], y: now[1] } - } ) ); - - } - - } - - // box selection - } else if( capture && e.touches[2] && cy.boxSelectionEnabled() ){ - e.preventDefault(); - - r.data.bgActivePosistion = undefined; - - this.lastThreeTouch = +new Date(); - - if( !r.touchData.selecting ){ - cy.emit('boxstart'); - } - - r.touchData.selecting = true; - - r.redrawHint( 'select', true ); - - if( !select || select.length === 0 || select[0] === undefined ){ - select[0] = (now[0] + now[2] + now[4]) / 3; - select[1] = (now[1] + now[3] + now[5]) / 3; - select[2] = (now[0] + now[2] + now[4]) / 3 + 1; - select[3] = (now[1] + now[3] + now[5]) / 3 + 1; - } else { - select[2] = (now[0] + now[2] + now[4]) / 3; - select[3] = (now[1] + now[3] + now[5]) / 3; - } - - select[4] = 1; - r.touchData.selecting = true; - - r.redraw(); - - // pinch to zoom - } else if( capture && e.touches[1] && cy.zoomingEnabled() && cy.panningEnabled() && cy.userZoomingEnabled() && cy.userPanningEnabled() ){ // two fingers => pinch to zoom - e.preventDefault(); - - r.data.bgActivePosistion = undefined; - r.redrawHint( 'select', true ); - - var draggedEles = r.dragData.touchDragEles; - if( draggedEles ){ - r.redrawHint( 'drag', true ); - - for( var i = 0; i < draggedEles.length; i++ ){ - var de_p = draggedEles[i]._private; - - de_p.grabbed = false; - de_p.rscratch.inDragLayer = false; - } - } - - // (x2, y2) for fingers 1 and 2 - var f1x2 = e.touches[0].clientX - offsetLeft, f1y2 = e.touches[0].clientY - offsetTop; - var f2x2 = e.touches[1].clientX - offsetLeft, f2y2 = e.touches[1].clientY - offsetTop; - - - var distance2 = distance( f1x2, f1y2, f2x2, f2y2 ); - // var distance2Sq = distanceSq( f1x2, f1y2, f2x2, f2y2 ); - // var factor = Math.sqrt( distance2Sq ) / Math.sqrt( distance1Sq ); - var factor = distance2 / distance1; - - if( twoFingersStartInside ){ - // delta finger1 - var df1x = f1x2 - f1x1; - var df1y = f1y2 - f1y1; - - // delta finger 2 - var df2x = f2x2 - f2x1; - var df2y = f2y2 - f2y1; - - // translation is the normalised vector of the two fingers movement - // i.e. so pinching cancels out and moving together pans - var tx = (df1x + df2x) / 2; - var ty = (df1y + df2y) / 2; - - // adjust factor by the speed multiplier - // var speed = 1.5; - // if( factor > 1 ){ - // factor = (factor - 1) * speed + 1; - // } else { - // factor = 1 - (1 - factor) * speed; - // } - - // now calculate the zoom - var zoom1 = cy.zoom(); - var zoom2 = zoom1 * factor; - var pan1 = cy.pan(); - - // the model center point converted to the current rendered pos - var ctrx = modelCenter1[0] * zoom1 + pan1.x; - var ctry = modelCenter1[1] * zoom1 + pan1.y; - - var pan2 = { - x: -zoom2 / zoom1 * (ctrx - pan1.x - tx) + ctrx, - y: -zoom2 / zoom1 * (ctry - pan1.y - ty) + ctry - }; - - // remove dragged eles - if( r.touchData.start && r.touchData.start.active() ){ - var draggedEles = r.dragData.touchDragEles; - - freeDraggedElements( draggedEles ); - - r.redrawHint( 'drag', true ); - r.redrawHint( 'eles', true ); - - r.touchData.start - .unactivate() - .emit( 'free' ) - ; - } - - cy.viewport( { - zoom: zoom2, - pan: pan2, - cancelOnFailedZoom: true - } ); - - distance1 = distance2; - f1x1 = f1x2; - f1y1 = f1y2; - f2x1 = f2x2; - f2y1 = f2y2; - - r.pinching = true; - } - - // Re-project - if( e.touches[0] ){ var pos = r.projectIntoViewport( e.touches[0].clientX, e.touches[0].clientY ); now[0] = pos[0]; now[1] = pos[1]; } - if( e.touches[1] ){ var pos = r.projectIntoViewport( e.touches[1].clientX, e.touches[1].clientY ); now[2] = pos[0]; now[3] = pos[1]; } - if( e.touches[2] ){ var pos = r.projectIntoViewport( e.touches[2].clientX, e.touches[2].clientY ); now[4] = pos[0]; now[5] = pos[1]; } - - } else if( e.touches[0] ){ - var start = r.touchData.start; - var last = r.touchData.last; - var near; - - if( !r.hoverData.draggingEles && !r.swipePanning ){ - near = r.findNearestElement( now[0], now[1], true, true ); - } - - if( capture && start != null ){ - e.preventDefault(); - } - - // dragging nodes - if( capture && start != null && r.nodeIsDraggable( start ) ){ - - if( isOverThresholdDrag ){ // then dragging can happen - var draggedEles = r.dragData.touchDragEles; - var justStartedDrag = !r.dragData.didDrag; - - if( justStartedDrag ){ - addNodesToDrag( cy.collection( draggedEles ), { inDragLayer: true } ); - } - - for( var k = 0; k < draggedEles.length; k++ ){ - var draggedEle = draggedEles[ k ]; - - if( r.nodeIsDraggable( draggedEle ) && draggedEle.grabbed() ){ - r.dragData.didDrag = true; - var dPos = draggedEle.position(); - - if( is.number( disp[0] ) && is.number( disp[1] ) ){ - dPos.x += disp[0]; - dPos.y += disp[1]; - } - - if( justStartedDrag ){ - r.redrawHint( 'eles', true ); - - var dragDelta = r.touchData.dragDelta; - - if( dragDelta && is.number( dragDelta[0] ) && is.number( dragDelta[1] ) ){ - dPos.x += dragDelta[0]; - dPos.y += dragDelta[1]; - } - - } - } - } - - var tcol = cy.collection( draggedEles ); - - tcol.dirtyCompoundBoundsCache(); - tcol.emit( 'position drag' ); - - r.hoverData.draggingEles = true; - - r.redrawHint( 'drag', true ); - - if( - r.touchData.startPosition[0] == earlier[0] - && r.touchData.startPosition[1] == earlier[1] - ){ - - r.redrawHint( 'eles', true ); - } - - r.redraw(); - } else { // otherise keep track of drag delta for later - var dragDelta = r.touchData.dragDelta = r.touchData.dragDelta || []; - - if( dragDelta.length === 0 ){ - dragDelta.push( disp[0] ); - dragDelta.push( disp[1] ); - } else { - dragDelta[0] += disp[0]; - dragDelta[1] += disp[1]; - } - } - } - - // touchmove - { - triggerEvents( (start || near), [ 'touchmove', 'tapdrag', 'vmousemove' ], e, { - position: { x: now[0], y: now[1] } - } ); - - if( ( !start || !start.grabbed() ) && near != last ){ - if( last ){ last.emit( ( { originalEvent: e, type: 'tapdragout', position: { x: now[0], y: now[1] } } ) ); } - if( near ){ near.emit( ( { originalEvent: e, type: 'tapdragover', position: { x: now[0], y: now[1] } } ) ); } - } - - r.touchData.last = near; - } - - // check to cancel taphold - if( capture ){ - for( var i = 0; i < now.length; i++ ){ - if( now[ i ] - && r.touchData.startPosition[ i ] - && isOverThresholdDrag ){ - - r.touchData.singleTouchMoved = true; - } - } - } - - // panning - if( - capture - && ( start == null || start.isEdge() ) - && cy.panningEnabled() && cy.userPanningEnabled() - ){ - - var allowPassthrough = allowPanningPassthrough( start, r.touchData.starts ); - - if( allowPassthrough ){ - e.preventDefault(); - - if( r.swipePanning ){ - cy.panBy( { - x: disp[0] * zoom, - y: disp[1] * zoom - } ); - - } else if( isOverThresholdDrag ){ - r.swipePanning = true; - - cy.panBy( { - x: dx * zoom, - y: dy * zoom - } ); - - if( start ){ - start.unactivate(); - - if( !r.data.bgActivePosistion ){ - r.data.bgActivePosistion = math.array2point( r.touchData.startPosition ); - } - - r.redrawHint( 'select', true ); - - r.touchData.start = null; - } - } - - } - - // Re-project - var pos = r.projectIntoViewport( e.touches[0].clientX, e.touches[0].clientY ); - now[0] = pos[0]; now[1] = pos[1]; - } - } - - for( var j = 0; j < now.length; j++ ){ earlier[ j ] = now[ j ]; } - //r.redraw(); - - // the active bg indicator should be removed when making a swipe that is neither for dragging nodes or panning - if( capture && e.touches.length > 0 && !r.hoverData.draggingEles && !r.swipePanning && r.data.bgActivePosistion != null ){ - r.data.bgActivePosistion = undefined; - r.redrawHint( 'select', true ); - r.redraw(); - } - - }, false ); - var touchcancelHandler; - r.registerBinding( window, 'touchcancel', touchcancelHandler = function( e ){ // eslint-disable-line no-undef - var start = r.touchData.start; - - r.touchData.capture = false; - - if( start ){ - start.unactivate(); - } - } ); - - var touchendHandler; - r.registerBinding( window, 'touchend', touchendHandler = function( e ){ // eslint-disable-line no-undef - var start = r.touchData.start; - - var capture = r.touchData.capture; - - if( capture ){ - if( e.touches.length === 0 ){ - r.touchData.capture = false; - } - - e.preventDefault(); - } else { - return; - } - - var select = r.selection; - - r.swipePanning = false; - r.hoverData.draggingEles = false; - - var cy = r.cy; - var zoom = cy.zoom(); - var now = r.touchData.now; - var earlier = r.touchData.earlier; - - if( e.touches[0] ){ var pos = r.projectIntoViewport( e.touches[0].clientX, e.touches[0].clientY ); now[0] = pos[0]; now[1] = pos[1]; } - if( e.touches[1] ){ var pos = r.projectIntoViewport( e.touches[1].clientX, e.touches[1].clientY ); now[2] = pos[0]; now[3] = pos[1]; } - if( e.touches[2] ){ var pos = r.projectIntoViewport( e.touches[2].clientX, e.touches[2].clientY ); now[4] = pos[0]; now[5] = pos[1]; } - - if( start ){ - start.unactivate(); - } - - var ctxTapend; - if( r.touchData.cxt ){ - ctxTapend = ( { - originalEvent: e, - type: 'cxttapend', - position: { x: now[0], y: now[1] } - } ); - - if( start ){ - start.emit( ctxTapend ); - } else { - cy.emit( ctxTapend ); - } - - if( !r.touchData.cxtDragged ){ - var ctxTap = ( { - originalEvent: e, - type: 'cxttap', - position: { x: now[0], y: now[1] } - } ); - - if( start ){ - start.emit( ctxTap ); - } else { - cy.emit( ctxTap ); - } - - } - - if( r.touchData.start ){ r.touchData.start._private.grabbed = false; } - r.touchData.cxt = false; - r.touchData.start = null; - - r.redraw(); - return; - } - - // no more box selection if we don't have three fingers - if( !e.touches[2] && cy.boxSelectionEnabled() && r.touchData.selecting ){ - r.touchData.selecting = false; - - var box = cy.collection( r.getAllInBox( select[0], select[1], select[2], select[3] ) ); - - select[0] = undefined; - select[1] = undefined; - select[2] = undefined; - select[3] = undefined; - select[4] = 0; - - r.redrawHint( 'select', true ); - - cy.emit('boxend'); - - var eleWouldBeSelected = function( ele ){ return ele.selectable() && !ele.selected(); }; - - box - .emit('box') - .stdFilter( eleWouldBeSelected ) - .select() - .emit('boxselect') - ; - - if( box.nonempty() ){ - r.redrawHint( 'eles', true ); - } - - r.redraw(); - } - - if( start != null ){ - start.unactivate(); - } - - if( e.touches[2] ){ - r.data.bgActivePosistion = undefined; - r.redrawHint( 'select', true ); - } else if( e.touches[1] ){ - // ignore - } else if( e.touches[0] ){ - // ignore - - // Last touch released - } else if( !e.touches[0] ){ - - r.data.bgActivePosistion = undefined; - r.redrawHint( 'select', true ); - - var draggedEles = r.dragData.touchDragEles; - - if( start != null ){ - - var startWasGrabbed = start._private.grabbed; - - freeDraggedElements( draggedEles ); - - r.redrawHint( 'drag', true ); - r.redrawHint( 'eles', true ); - - if( startWasGrabbed ){ - start.emit( 'free' ); - } - - triggerEvents( start, [ 'touchend', 'tapend', 'vmouseup', 'tapdragout' ], e, { - position: { x: now[0], y: now[1] } - } ); - - start.unactivate(); - - r.touchData.start = null; - - } else { - var near = r.findNearestElement( now[0], now[1], true, true ); - - triggerEvents( near, [ 'touchend', 'tapend', 'vmouseup', 'tapdragout' ], e, { - position: { x: now[0], y: now[1] } - } ); - - } - - var dx = r.touchData.startPosition[0] - now[0]; - var dx2 = dx * dx; - var dy = r.touchData.startPosition[1] - now[1]; - var dy2 = dy * dy; - var dist2 = dx2 + dy2; - var rdist2 = dist2 * zoom * zoom; - - // Prepare to select the currently touched node, only if it hasn't been dragged past a certain distance - if( start != null - && !r.dragData.didDrag // didn't drag nodes around - && start._private.selectable - && rdist2 < r.touchTapThreshold2 - && !r.pinching // pinch to zoom should not affect selection - ){ - - if( cy.selectionType() === 'single' ){ - cy.$( ':selected' ).unmerge( start ).unselect(); - start.select(); - } else { - if( start.selected() ){ - start.unselect(); - } else { - start.select(); - } - } - - r.redrawHint( 'eles', true ); - } - - // Tap event, roughly same as mouse click event for touch - if( !r.touchData.singleTouchMoved ){ - triggerEvents( start, [ 'tap', 'vclick' ], e, { - position: { x: now[0], y: now[1] } - } ); - } - - r.touchData.singleTouchMoved = true; - } - - for( var j = 0; j < now.length; j++ ){ earlier[ j ] = now[ j ]; } - - r.dragData.didDrag = false; // reset for next mousedown - - if( e.touches.length === 0 ){ - r.touchData.dragDelta = []; - r.touchData.startPosition = null; - r.touchData.startGPosition = null; - } - - if( e.touches.length < 2 ){ - r.pinching = false; - r.redrawHint( 'eles', true ); - r.redraw(); - } - - //r.redraw(); - - }, false ); - - // fallback compatibility layer for ms pointer events - if( typeof TouchEvent === 'undefined' ){ - - var pointers = []; - - var makeTouch = function( e ){ - return { - clientX: e.clientX, - clientY: e.clientY, - force: 1, - identifier: e.pointerId, - pageX: e.pageX, - pageY: e.pageY, - radiusX: e.width / 2, - radiusY: e.height / 2, - screenX: e.screenX, - screenY: e.screenY, - target: e.target - }; - }; - - var makePointer = function( e ){ - return { - event: e, - touch: makeTouch( e ) - }; - }; - - var addPointer = function( e ){ - pointers.push( makePointer( e ) ); - }; - - var removePointer = function( e ){ - for( var i = 0; i < pointers.length; i++ ){ - var p = pointers[ i ]; - - if( p.event.pointerId === e.pointerId ){ - pointers.splice( i, 1 ); - return; - } - } - }; - - var updatePointer = function( e ){ - var p = pointers.filter( function( p ){ - return p.event.pointerId === e.pointerId; - } )[0]; - - p.event = e; - p.touch = makeTouch( e ); - }; - - var addTouchesToEvent = function( e ){ - e.touches = pointers.map( function( p ){ - return p.touch; - } ); - }; - - var pointerIsMouse = function( e ){ - return e.pointerType === 'mouse' || e.pointerType === 4; - }; - - r.registerBinding( r.container, 'pointerdown', function( e ){ - if( pointerIsMouse(e) ){ return; } // mouse already handled - - e.preventDefault(); - - addPointer( e ); - - addTouchesToEvent( e ); - touchstartHandler( e ); - } ); - - r.registerBinding( r.container, 'pointerup', function( e ){ - if( pointerIsMouse(e) ){ return; } // mouse already handled - - removePointer( e ); - - addTouchesToEvent( e ); - touchendHandler( e ); - } ); - - r.registerBinding( r.container, 'pointercancel', function( e ){ - if( pointerIsMouse(e) ){ return; } // mouse already handled - - removePointer( e ); - - addTouchesToEvent( e ); - touchcancelHandler( e ); - } ); - - r.registerBinding( r.container, 'pointermove', function( e ){ - if( pointerIsMouse(e) ){ return; } // mouse already handled - - e.preventDefault(); - - updatePointer( e ); - - addTouchesToEvent( e ); - touchmoveHandler( e ); - } ); - - } -}; - -module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/node-shapes.js b/node_modules/cytoscape/src/extensions/renderer/base/node-shapes.js deleted file mode 100644 index ce716c69f..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/base/node-shapes.js +++ /dev/null @@ -1,560 +0,0 @@ -var math = require('../../../math'); - -var BRp = {}; - -BRp.generatePolygon = function( name, points ){ - return ( this.nodeShapes[ name ] = { - renderer: this, - - name: name, - - points: points, - - draw: function( context, centerX, centerY, width, height ){ - this.renderer.nodeShapeImpl( 'polygon', context, centerX, centerY, width, height, this.points ); - }, - - intersectLine: function( nodeX, nodeY, width, height, x, y, padding ){ - return math.polygonIntersectLine( - x, y, - this.points, - nodeX, - nodeY, - width / 2, height / 2, - padding ) - ; - }, - - checkPoint: function( x, y, padding, width, height, centerX, centerY ){ - return math.pointInsidePolygon( x, y, this.points, - centerX, centerY, width, height, [0, -1], padding ) - ; - } - } ); -}; - -BRp.generateEllipse = function(){ - return ( this.nodeShapes['ellipse'] = { - renderer: this, - - name: 'ellipse', - - draw: function( context, centerX, centerY, width, height ){ - this.renderer.nodeShapeImpl( this.name, context, centerX, centerY, width, height ); - }, - - intersectLine: function( nodeX, nodeY, width, height, x, y, padding ){ - return math.intersectLineEllipse( - x, y, - nodeX, - nodeY, - width / 2 + padding, - height / 2 + padding ) - ; - }, - - checkPoint: function( x, y, padding, width, height, centerX, centerY ){ - return math.checkInEllipse( x, y, width, height, centerX, centerY, padding ); - } - } ); -}; - -BRp.generateRoundRectangle = function(){ - return ( this.nodeShapes['roundrectangle'] = { - renderer: this, - - name: 'roundrectangle', - - points: math.generateUnitNgonPointsFitToSquare( 4, 0 ), - - draw: function( context, centerX, centerY, width, height ){ - this.renderer.nodeShapeImpl( this.name, context, centerX, centerY, width, height ); - }, - - intersectLine: function( nodeX, nodeY, width, height, x, y, padding ){ - return math.roundRectangleIntersectLine( - x, y, - nodeX, - nodeY, - width, height, - padding ) - ; - }, - - checkPoint: function( - x, y, padding, width, height, centerX, centerY ){ - - var cornerRadius = math.getRoundRectangleRadius( width, height ); - var diam = cornerRadius * 2; - - // Check hBox - if( math.pointInsidePolygon( x, y, this.points, - centerX, centerY, width, height - diam, [0, -1], padding ) ){ - return true; - } - - // Check vBox - if( math.pointInsidePolygon( x, y, this.points, - centerX, centerY, width - diam, height, [0, -1], padding ) ){ - return true; - } - - // Check top left quarter circle - if( math.checkInEllipse( x, y, - diam, diam, - centerX - width / 2 + cornerRadius, - centerY - height / 2 + cornerRadius, - padding ) ){ - - return true; - } - - // Check top right quarter circle - if( math.checkInEllipse( x, y, - diam, diam, - centerX + width / 2 - cornerRadius, - centerY - height / 2 + cornerRadius, - padding ) ){ - - return true; - } - - // Check bottom right quarter circle - if( math.checkInEllipse( x, y, - diam, diam, - centerX + width / 2 - cornerRadius, - centerY + height / 2 - cornerRadius, - padding ) ){ - - return true; - } - - // Check bottom left quarter circle - if( math.checkInEllipse( x, y, - diam, diam, - centerX - width / 2 + cornerRadius, - centerY + height / 2 - cornerRadius, - padding ) ){ - - return true; - } - - return false; - } - } ); -}; - -BRp.generateCutRectangle = function(){ - return ( this.nodeShapes['cutrectangle'] = { - renderer: this, - - name: 'cutrectangle', - - cornerLength: math.getCutRectangleCornerLength(), - - points: math.generateUnitNgonPointsFitToSquare( 4, 0 ), - - draw: function( context, centerX, centerY, width, height ){ - this.renderer.nodeShapeImpl( this.name, context, centerX, centerY, width, height ); - }, - - generateCutTrianglePts: function( width, height, centerX, centerY ){ - var cl = this.cornerLength; - var hh = height / 2; - var hw = width / 2; - var xBegin = centerX - hw; - var xEnd = centerX + hw; - var yBegin = centerY - hh; - var yEnd = centerY + hh; - - // points are in clockwise order, inner (imaginary) triangle pt on [4, 5] - return { - topLeft: [ xBegin, yBegin + cl, xBegin + cl, yBegin, xBegin + cl, yBegin + cl ], - topRight: [ xEnd - cl, yBegin, xEnd, yBegin + cl, xEnd - cl, yBegin + cl ], - bottomRight: [ xEnd, yEnd - cl, xEnd - cl, yEnd, xEnd - cl, yEnd - cl ], - bottomLeft: [ xBegin + cl, yEnd, xBegin, yEnd - cl, xBegin + cl, yEnd - cl ] - }; - }, - - intersectLine: function( nodeX, nodeY, width, height, x, y, padding ){ - var cPts = this.generateCutTrianglePts( width + 2*padding, height+2*padding, nodeX, nodeY ); - var pts = [].concat.apply([], - [cPts.topLeft.splice(0, 4), cPts.topRight.splice(0, 4), - cPts.bottomRight.splice(0, 4), cPts.bottomLeft.splice(0, 4) - ]); - - return math.polygonIntersectLine( x, y, pts, nodeX, nodeY ); - }, - - checkPoint: function( x, y, padding, width, height, centerX, centerY ){ - // Check hBox - if( math.pointInsidePolygon( x, y, this.points, - centerX, centerY, width, height - 2 * this.cornerLength, [0, -1], padding ) ){ - return true; - } - - // Check vBox - if( math.pointInsidePolygon( x, y, this.points, - centerX, centerY, width - 2 * this.cornerLength, height, [0, -1], padding ) ){ - return true; - } - var cutTrianglePts = this.generateCutTrianglePts(width, height, centerX, centerY); - return math.pointInsidePolygonPoints( x, y, cutTrianglePts.topLeft) - || math.pointInsidePolygonPoints( x, y, cutTrianglePts.topRight ) - || math.pointInsidePolygonPoints( x, y, cutTrianglePts.bottomRight ) - || math.pointInsidePolygonPoints( x, y, cutTrianglePts.bottomLeft ); - } - - } ); -}; - -BRp.generateBarrel = function(){ - return ( this.nodeShapes['barrel'] = { - renderer: this, - - name: 'barrel', - - points: math.generateUnitNgonPointsFitToSquare( 4, 0 ), - - draw: function( context, centerX, centerY, width, height ){ - this.renderer.nodeShapeImpl( this.name, context, centerX, centerY, width, height ); - }, - - intersectLine: function( nodeX, nodeY, width, height, x, y, padding ){ - // use two fixed t values for the bezier curve approximation - - var t0 = 0.15; - var t1 = 0.5; - var t2 = 0.85; - - var bPts = this.generateBarrelBezierPts( width + 2*padding, height + 2*padding, nodeX, nodeY ); - - var approximateBarrelCurvePts = pts => { - // approximate curve pts based on the two t values - var m0 = math.qbezierPtAt({x: pts[0], y: pts[1]}, {x: pts[2], y: pts[3]}, {x: pts[4], y: pts[5]}, t0); - var m1 = math.qbezierPtAt({x: pts[0], y: pts[1]}, {x: pts[2], y: pts[3]}, {x: pts[4], y: pts[5]}, t1); - var m2 = math.qbezierPtAt({x: pts[0], y: pts[1]}, {x: pts[2], y: pts[3]}, {x: pts[4], y: pts[5]}, t2); - - return [ - pts[0],pts[1], - m0.x, m0.y, - m1.x, m1.y, - m2.x, m2.y, - pts[4], pts[5] - ]; - }; - - var pts = [].concat( - approximateBarrelCurvePts(bPts.topLeft), - approximateBarrelCurvePts(bPts.topRight), - approximateBarrelCurvePts(bPts.bottomRight), - approximateBarrelCurvePts(bPts.bottomLeft) - ); - - return math.polygonIntersectLine( x, y, pts, nodeX, nodeY ); - }, - - generateBarrelBezierPts: function( width, height, centerX, centerY ){ - var hh = height / 2; - var hw = width / 2; - var xBegin = centerX - hw; - var xEnd = centerX + hw; - var yBegin = centerY - hh; - var yEnd = centerY + hh; - - var curveConstants = math.getBarrelCurveConstants( width, height ); - var hOffset = curveConstants.heightOffset; - var wOffset = curveConstants.widthOffset; - var ctrlPtXOffset = curveConstants.ctrlPtOffsetPct * width; - - // points are in clockwise order, inner (imaginary) control pt on [4, 5] - var pts = { - topLeft: [ xBegin, yBegin + hOffset, xBegin + ctrlPtXOffset, yBegin, xBegin + wOffset, yBegin ], - topRight: [ xEnd - wOffset, yBegin, xEnd - ctrlPtXOffset, yBegin, xEnd, yBegin + hOffset ], - bottomRight: [ xEnd, yEnd - hOffset, xEnd - ctrlPtXOffset, yEnd, xEnd - wOffset, yEnd ], - bottomLeft: [ xBegin + wOffset, yEnd, xBegin + ctrlPtXOffset, yEnd, xBegin, yEnd - hOffset ] - }; - - pts.topLeft.isTop = true; - pts.topRight.isTop = true; - pts.bottomLeft.isBottom = true; - pts.bottomRight.isBottom = true; - - return pts; - }, - - checkPoint: function( - x, y, padding, width, height, centerX, centerY ){ - - var curveConstants = math.getBarrelCurveConstants( width, height ); - var hOffset = curveConstants.heightOffset; - var wOffset = curveConstants.widthOffset; - - // Check hBox - if( math.pointInsidePolygon( x, y, this.points, - centerX, centerY, width, height - 2 * hOffset, [0, -1], padding ) ){ - return true; - } - - // Check vBox - if( math.pointInsidePolygon( x, y, this.points, - centerX, centerY, width - 2 * wOffset, height, [0, -1], padding ) ){ - return true; - } - - var barrelCurvePts = this.generateBarrelBezierPts( width, height, centerX, centerY ); - - var getCurveT = function (x, y, curvePts) { - var x0 = curvePts[ 4 ]; - var x1 = curvePts[ 2 ]; - var x2 = curvePts[ 0 ]; - var y0 = curvePts[ 5 ]; - // var y1 = curvePts[ 3 ]; - var y2 = curvePts[ 1 ]; - - var xMin = Math.min( x0, x2 ); - var xMax = Math.max( x0, x2 ); - var yMin = Math.min( y0, y2 ); - var yMax = Math.max( y0, y2 ); - - if( xMin <= x && x <= xMax && yMin <= y && y <= yMax ){ - var coeff = math.bezierPtsToQuadCoeff( x0, x1, x2 ); - var roots = math.solveQuadratic( coeff[0], coeff[1], coeff[2], x ); - - var validRoots = roots.filter(function( r ){ - return 0 <= r && r <= 1; - }); - - if( validRoots.length > 0 ){ - return validRoots[ 0 ]; - } - } - return null; - }; - - var curveRegions = Object.keys( barrelCurvePts ); - for( var i = 0; i < curveRegions.length; i++ ){ - var corner = curveRegions[ i ]; - var cornerPts = barrelCurvePts[ corner ]; - var t = getCurveT( x, y, cornerPts ); - - if( t == null ){ continue; } - - var y0 = cornerPts[ 5 ]; - var y1 = cornerPts[ 3 ]; - var y2 = cornerPts[ 1 ]; - var bezY = math.qbezierAt( y0, y1, y2, t ); - - if( cornerPts.isTop && bezY <= y ){ - return true; - } - if( cornerPts.isBottom && y <= bezY ){ - return true; - } - } - return false; - } - } ); -}; - -BRp.generateBottomRoundrectangle = function(){ - return ( this.nodeShapes['bottomroundrectangle'] = { - renderer: this, - - name: 'bottomroundrectangle', - - points: math.generateUnitNgonPointsFitToSquare( 4, 0 ), - - draw: function( context, centerX, centerY, width, height ){ - this.renderer.nodeShapeImpl( this.name, context, centerX, centerY, width, height ); - }, - - intersectLine: function( nodeX, nodeY, width, height, x, y, padding ){ - var topStartX = nodeX - ( width / 2 + padding ); - var topStartY = nodeY - ( height / 2 + padding ); - var topEndY = topStartY; - var topEndX = nodeX + ( width / 2 + padding ); - - var topIntersections = math.finiteLinesIntersect( - x, y, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false ); - if( topIntersections.length > 0 ){ - return topIntersections; - } - - return math.roundRectangleIntersectLine( - x, y, - nodeX, - nodeY, - width, height, - padding ) - ; - }, - - checkPoint: function( - x, y, padding, width, height, centerX, centerY ){ - - var cornerRadius = math.getRoundRectangleRadius( width, height ); - var diam = 2 * cornerRadius; - - // Check hBox - if( math.pointInsidePolygon( x, y, this.points, - centerX, centerY, width, height - diam, [0, -1], padding ) ){ - return true; - } - - // Check vBox - if( math.pointInsidePolygon( x, y, this.points, - centerX, centerY, width - diam, height, [0, -1], padding ) ){ - return true; - } - - // check non-rounded top side - var outerWidth = ( ( width / 2 ) + 2 * padding ); - var outerHeight = ( ( height / 2 ) + 2 * padding ); - var points = [ - centerX - outerWidth, centerY - outerHeight, - centerX - outerWidth, centerY, - centerX + outerWidth, centerY, - centerX + outerWidth, centerY - outerHeight - ]; - if( math.pointInsidePolygonPoints( x, y, points) ){ - return true; - } - - // Check bottom right quarter circle - if( math.checkInEllipse( x, y, - diam, diam, - centerX + width / 2 - cornerRadius, - centerY + height / 2 - cornerRadius, - padding ) ){ - - return true; - } - - // Check bottom left quarter circle - if( math.checkInEllipse( x, y, - diam, diam, - centerX - width / 2 + cornerRadius, - centerY + height / 2 - cornerRadius, - padding ) ){ - - return true; - } - - return false; - } - } ); -}; - - -BRp.registerNodeShapes = function(){ - var nodeShapes = this.nodeShapes = {}; - var renderer = this; - - this.generateEllipse(); - - this.generatePolygon( 'triangle', math.generateUnitNgonPointsFitToSquare( 3, 0 ) ); - - this.generatePolygon( 'rectangle', math.generateUnitNgonPointsFitToSquare( 4, 0 ) ); - nodeShapes[ 'square' ] = nodeShapes[ 'rectangle' ]; - - this.generateRoundRectangle(); - - this.generateCutRectangle(); - - this.generateBarrel(); - - this.generateBottomRoundrectangle(); - - this.generatePolygon( 'diamond', [ - 0, 1, - 1, 0, - 0, -1, - -1, 0 - ] ); - - this.generatePolygon( 'pentagon', math.generateUnitNgonPointsFitToSquare( 5, 0 ) ); - - this.generatePolygon( 'hexagon', math.generateUnitNgonPointsFitToSquare( 6, 0 ) ); - - this.generatePolygon( 'heptagon', math.generateUnitNgonPointsFitToSquare( 7, 0 ) ); - - this.generatePolygon( 'octagon', math.generateUnitNgonPointsFitToSquare( 8, 0 ) ); - - var star5Points = new Array( 20 ); - { - var outerPoints = math.generateUnitNgonPoints( 5, 0 ); - var innerPoints = math.generateUnitNgonPoints( 5, Math.PI / 5 ); - - // Outer radius is 1; inner radius of star is smaller - var innerRadius = 0.5 * (3 - Math.sqrt( 5 )); - innerRadius *= 1.57; - - for( var i = 0;i < innerPoints.length / 2;i++ ){ - innerPoints[ i * 2] *= innerRadius; - innerPoints[ i * 2 + 1] *= innerRadius; - } - - for( var i = 0;i < 20 / 4;i++ ){ - star5Points[ i * 4] = outerPoints[ i * 2]; - star5Points[ i * 4 + 1] = outerPoints[ i * 2 + 1]; - - star5Points[ i * 4 + 2] = innerPoints[ i * 2]; - star5Points[ i * 4 + 3] = innerPoints[ i * 2 + 1]; - } - } - - star5Points = math.fitPolygonToSquare( star5Points ); - - this.generatePolygon( 'star', star5Points ); - - this.generatePolygon( 'vee', [ - -1, -1, - 0, -0.333, - 1, -1, - 0, 1 - ] ); - - this.generatePolygon( 'rhomboid', [ - -1, -1, - 0.333, -1, - 1, 1, - -0.333, 1 - ] ); - - this.generatePolygon( 'concavehexagon', [ - -1, -0.95, - -0.75, 0, - -1, 0.95, - 1, 0.95, - 0.75, 0, - 1, -0.95 - ] ); - - this.generatePolygon( 'tag', [ - -1, -1, - 0.25, -1, - 1, 0, - 0.25,1, - -1, 1 - ]); - - nodeShapes.makePolygon = function( points ){ - - // use caching on user-specified polygons so they are as fast as native shapes - - var key = points.join( '$' ); - var name = 'polygon-' + key; - var shape; - - if( (shape = this[ name ]) ){ // got cached shape - return shape; - } - - // create and cache new shape - return renderer.generatePolygon( name, points ); - }; - -}; - -module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/base/redraw.js b/node_modules/cytoscape/src/extensions/renderer/base/redraw.js deleted file mode 100644 index 7be88fc31..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/base/redraw.js +++ /dev/null @@ -1,101 +0,0 @@ -var util = require( '../../../util' ); - -var BRp = {}; - -BRp.timeToRender = function(){ - return this.redrawTotalTime / this.redrawCount; -}; - -BRp.redraw = function( options ){ - options = options || util.staticEmptyObject(); - - var r = this; - - if( r.averageRedrawTime === undefined ){ r.averageRedrawTime = 0; } - if( r.lastRedrawTime === undefined ){ r.lastRedrawTime = 0; } - if( r.lastDrawTime === undefined ){ r.lastDrawTime = 0; } - - r.requestedFrame = true; - r.renderOptions = options; -}; - -BRp.beforeRender = function( fn, priority ){ - // the renderer can't add tick callbacks when destroyed - if( this.destroyed ){ return; } - - priority = priority || 0; - - var cbs = this.beforeRenderCallbacks; - - cbs.push({ fn: fn, priority: priority }); - - // higher priority callbacks executed first - cbs.sort(function( a, b ){ return b.priority - a.priority; }); -}; - -var beforeRenderCallbacks = function( r, willDraw, startTime ){ - var cbs = r.beforeRenderCallbacks; - - for( var i = 0; i < cbs.length; i++ ){ - cbs[i].fn( willDraw, startTime ); - } -}; - -BRp.startRenderLoop = function(){ - var r = this; - - if( r.renderLoopStarted ){ - return; - } else { - r.renderLoopStarted = true; - } - - var renderFn = function( requestTime ){ - if( r.destroyed ){ return; } - - if( r.requestedFrame && !r.skipFrame ){ - beforeRenderCallbacks( r, true, requestTime ); - - var startTime = util.performanceNow(); - - r.render( r.renderOptions ); - - var endTime = r.lastDrawTime = util.performanceNow(); - - if( r.averageRedrawTime === undefined ){ - r.averageRedrawTime = endTime - startTime; - } - - if( r.redrawCount === undefined ){ - r.redrawCount = 0; - } - - r.redrawCount++; - - if( r.redrawTotalTime === undefined ){ - r.redrawTotalTime = 0; - } - - var duration = endTime - startTime; - - r.redrawTotalTime += duration; - r.lastRedrawTime = duration; - - // use a weighted average with a bias from the previous average so we don't spike so easily - r.averageRedrawTime = r.averageRedrawTime / 2 + duration / 2; - - r.requestedFrame = false; - } else { - beforeRenderCallbacks( r, false, requestTime ); - } - - r.skipFrame = false; - - util.requestAnimationFrame( renderFn ); - }; - - util.requestAnimationFrame( renderFn ); - -}; - -module.exports = BRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/arrow-shapes.js b/node_modules/cytoscape/src/extensions/renderer/canvas/arrow-shapes.js deleted file mode 100644 index d47e76743..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/canvas/arrow-shapes.js +++ /dev/null @@ -1,89 +0,0 @@ -var CRp = {}; - -var impl; - -CRp.arrowShapeImpl = function( name ){ - return ( impl || (impl = { - 'polygon': function( context, points ){ - for( var i = 0; i < points.length; i++ ){ - var pt = points[ i ]; - - context.lineTo( pt.x, pt.y ); - } - }, - - 'triangle-backcurve': function( context, points, controlPoint ){ - var firstPt; - - for( var i = 0; i < points.length; i++ ){ - var pt = points[ i ]; - - if( i === 0 ){ - firstPt = pt; - } - - context.lineTo( pt.x, pt.y ); - } - - context.quadraticCurveTo( controlPoint.x, controlPoint.y, firstPt.x, firstPt.y ); - }, - - 'triangle-tee': function( context, trianglePoints, teePoints ){ - if( context.beginPath ){ context.beginPath(); } - - var triPts = trianglePoints; - for( var i = 0; i < triPts.length; i++ ){ - var pt = triPts[ i ]; - - context.lineTo( pt.x, pt.y ); - } - - if( context.closePath ){ context.closePath(); } - - if( context.beginPath ){ context.beginPath(); } - - var teePts = teePoints; - var firstTeePt = teePoints[0]; - context.moveTo( firstTeePt.x, firstTeePt.y ); - - for( var i = 0; i < teePts.length; i++ ){ - var pt = teePts[ i ]; - - context.lineTo( pt.x, pt.y ); - } - if( context.closePath ){ context.closePath(); } - }, - - 'triangle-cross': function( context, trianglePoints, crossLinePoints ){ - if( context.beginPath ){ context.beginPath(); } - - var triPts = trianglePoints; - for( var i = 0; i < triPts.length; i++ ){ - var pt = triPts[ i ]; - - context.lineTo( pt.x, pt.y ); - } - - if( context.closePath ){ context.closePath(); } - - if( context.beginPath ){ context.beginPath(); } - - var teePts = crossLinePoints; - var firstTeePt = crossLinePoints[0]; - context.moveTo( firstTeePt.x, firstTeePt.y ); - - for( var i = 0; i < teePts.length; i++ ){ - var pt = teePts[ i ]; - - context.lineTo( pt.x, pt.y ); - } - if( context.closePath ){ context.closePath(); } - }, - - 'circle': function( context, rx, ry, r ){ - context.arc( rx, ry, r, 0, Math.PI * 2, false ); - } - }) )[ name ]; -}; - -module.exports = CRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-edges.js b/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-edges.js deleted file mode 100644 index ed33fbcd4..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-edges.js +++ /dev/null @@ -1,293 +0,0 @@ -let CRp = {}; - -CRp.drawEdge = function( context, edge, shiftToOriginWithBb, drawLabel ){ - let r = this; - let rs = edge._private.rscratch; - let usePaths = r.usePaths(); - - if( !edge.visible() ){ return; } - - // if bezier ctrl pts can not be calculated, then die - if( rs.badLine || rs.allpts == null || isNaN(rs.allpts[0]) ){ // isNaN in case edge is impossible and browser bugs (e.g. safari) - return; - } - - let bb; - if( shiftToOriginWithBb ){ - bb = shiftToOriginWithBb; - - context.translate( -bb.x1, -bb.y1 ); - } - - let overlayPadding = edge.pstyle('overlay-padding').pfValue; - let overlayWidth = 2 * overlayPadding; - let overlayOpacity = edge.pstyle('overlay-opacity').value; - let overlayColor = edge.pstyle('overlay-color').value; - let lineColor = edge.pstyle('line-color').value; - let opacity = edge.pstyle('opacity').value; - let lineStyle = edge.pstyle('line-style').value; - let edgeWidth = edge.pstyle('width').pfValue; - - let drawLine = ( strokeOpacity = opacity ) => { - context.lineWidth = edgeWidth; - context.lineCap = 'butt'; - - r.strokeStyle( context, lineColor[0], lineColor[1], lineColor[2], strokeOpacity ); - - r.drawEdgePath( - edge, - context, - rs.allpts, - lineStyle - ); - }; - - let drawOverlay = ( strokeOpacity = overlayOpacity ) => { - context.lineWidth = overlayWidth; - - if( rs.edgeType === 'self' && !usePaths ){ - context.lineCap = 'butt'; - } else { - context.lineCap = 'round'; - } - - r.strokeStyle( context, overlayColor[0], overlayColor[1], overlayColor[2], strokeOpacity ); - - r.drawEdgePath( - edge, - context, - rs.allpts, - 'solid' - ); - }; - - let drawArrows = ( arrowOpacity = opacity ) => { - r.drawArrowheads( context, edge, arrowOpacity ); - }; - - let drawText = () => { - r.drawElementText( context, edge, drawLabel ); - }; - - context.lineJoin = 'round'; - - let ghost = edge.pstyle('ghost').value === 'yes'; - - if( ghost ){ - let gx = edge.pstyle('ghost-offset-x').pfValue; - let gy = edge.pstyle('ghost-offset-y').pfValue; - let ghostOpacity = edge.pstyle('ghost-opacity').value; - let effectiveGhostOpacity = opacity * ghostOpacity; - - context.translate( gx, gy ); - - drawLine( effectiveGhostOpacity ); - drawArrows( effectiveGhostOpacity ); - - context.translate( -gx, -gy ); - } - - drawLine(); - drawArrows(); - drawOverlay(); - drawText(); - - if( shiftToOriginWithBb ){ - context.translate( bb.x1, bb.y1 ); - } -}; - - -CRp.drawEdgePath = function( edge, context, pts, type ){ - let rs = edge._private.rscratch; - let canvasCxt = context; - let path; - let pathCacheHit = false; - let usePaths = this.usePaths(); - - if( usePaths ){ - let pathCacheKey = pts.join( '$' ); - let keyMatches = rs.pathCacheKey && rs.pathCacheKey === pathCacheKey; - - if( keyMatches ){ - path = context = rs.pathCache; - pathCacheHit = true; - } else { - path = context = new Path2D(); // eslint-disable-line no-undef - rs.pathCacheKey = pathCacheKey; - rs.pathCache = path; - } - } - - if( canvasCxt.setLineDash ){ // for very outofdate browsers - switch( type ){ - case 'dotted': - canvasCxt.setLineDash( [ 1, 1 ] ); - break; - - case 'dashed': - canvasCxt.setLineDash( [ 6, 3 ] ); - break; - - case 'solid': - canvasCxt.setLineDash( [ ] ); - break; - } - } - - if( !pathCacheHit && !rs.badLine ){ - if( context.beginPath ){ context.beginPath(); } - context.moveTo( pts[0], pts[1] ); - - switch( rs.edgeType ){ - case 'bezier': - case 'self': - case 'compound': - case 'multibezier': - for( let i = 2; i + 3 < pts.length; i += 4 ){ - context.quadraticCurveTo( pts[ i ], pts[ i + 1], pts[ i + 2], pts[ i + 3] ); - } - break; - - case 'straight': - case 'segments': - case 'haystack': - for( let i = 2; i + 1 < pts.length; i += 2 ){ - context.lineTo( pts[ i ], pts[ i + 1] ); - } - break; - } - } - - context = canvasCxt; - if( usePaths ){ - context.stroke( path ); - } else { - context.stroke(); - } - - // reset any line dashes - if( context.setLineDash ){ // for very outofdate browsers - context.setLineDash( [ ] ); - } - -}; - -CRp.drawArrowheads = function( context, edge, opacity ){ - let rs = edge._private.rscratch; - let isHaystack = rs.edgeType === 'haystack'; - - if( !isHaystack ){ - this.drawArrowhead( context, edge, 'source', rs.arrowStartX, rs.arrowStartY, rs.srcArrowAngle, opacity ); - } - - this.drawArrowhead( context, edge, 'mid-target', rs.midX, rs.midY, rs.midtgtArrowAngle, opacity ); - - this.drawArrowhead( context, edge, 'mid-source', rs.midX, rs.midY, rs.midsrcArrowAngle, opacity ); - - if( !isHaystack ){ - this.drawArrowhead( context, edge, 'target', rs.arrowEndX, rs.arrowEndY, rs.tgtArrowAngle, opacity ); - } -}; - -CRp.drawArrowhead = function( context, edge, prefix, x, y, angle, opacity ){ - if( isNaN( x ) || x == null || isNaN( y ) || y == null || isNaN( angle ) || angle == null ){ return; } - - let self = this; - let arrowShape = edge.pstyle( prefix + '-arrow-shape' ).value; - if( arrowShape === 'none' ) { return; } - - let arrowClearFill = edge.pstyle( prefix + '-arrow-fill' ).value === 'hollow' ? 'both' : 'filled'; - let arrowFill = edge.pstyle( prefix + '-arrow-fill' ).value; - let edgeWidth = edge.pstyle( 'width' ).pfValue; - let edgeOpacity = edge.pstyle( 'opacity' ).value; - - if( opacity === undefined ){ - opacity = edgeOpacity; - } - - let gco = context.globalCompositeOperation; - - if( opacity !== 1 || arrowFill === 'hollow' ){ // then extra clear is needed - context.globalCompositeOperation = 'destination-out'; - - self.fillStyle( context, 255, 255, 255, 1 ); - self.strokeStyle( context, 255, 255, 255, 1 ); - - self.drawArrowShape( edge, prefix, context, - arrowClearFill, edgeWidth, arrowShape, x, y, angle - ); - - context.globalCompositeOperation = gco; - } // otherwise, the opaque arrow clears it for free :) - - let color = edge.pstyle( prefix + '-arrow-color' ).value; - self.fillStyle( context, color[0], color[1], color[2], opacity ); - self.strokeStyle( context, color[0], color[1], color[2], opacity ); - - self.drawArrowShape( edge, prefix, context, - arrowFill, edgeWidth, arrowShape, x, y, angle - ); -}; - -CRp.drawArrowShape = function( edge, arrowType, context, fill, edgeWidth, shape, x, y, angle ){ - let r = this; - let usePaths = this.usePaths(); - let rs = edge._private.rscratch; - let pathCacheHit = false; - let path; - let canvasContext = context; - let translation = { x: x, y: y }; - let scale = edge.pstyle( 'arrow-scale' ).value; - let size = this.getArrowWidth( edgeWidth, scale ); - let shapeImpl = r.arrowShapes[ shape ]; - - if( usePaths ){ - let pathCacheKey = size + '$' + shape + '$' + angle + '$' + x + '$' + y; - rs.arrowPathCacheKey = rs.arrowPathCacheKey || {}; - rs.arrowPathCache = rs.arrowPathCache || {}; - - let alreadyCached = rs.arrowPathCacheKey[ arrowType ] === pathCacheKey; - if( alreadyCached ){ - path = context = rs.arrowPathCache[ arrowType ]; - pathCacheHit = true; - } else { - path = context = new Path2D(); // eslint-disable-line no-undef - rs.arrowPathCacheKey[ arrowType ] = pathCacheKey; - rs.arrowPathCache[ arrowType ] = path; - } - } - - if( context.beginPath ){ context.beginPath(); } - - if( !pathCacheHit ){ - shapeImpl.draw( context, size, angle, translation, edgeWidth ); - } - - if( !shapeImpl.leavePathOpen && context.closePath ){ - context.closePath(); - } - - context = canvasContext; - - if( fill === 'filled' || fill === 'both' ){ - if( usePaths ){ - context.fill( path ); - } else { - context.fill(); - } - } - - if( fill === 'hollow' || fill === 'both' ){ - context.lineWidth = ( shapeImpl.matchEdgeWidth ? edgeWidth : 1 ); - context.lineJoin = 'miter'; - - if( usePaths ){ - context.stroke( path ); - } else { - context.stroke(); - } - } -}; - -module.exports = CRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-elements.js b/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-elements.js deleted file mode 100644 index b15634135..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-elements.js +++ /dev/null @@ -1,112 +0,0 @@ -let math = require( '../../../math' ); - -let CRp = {}; - -CRp.drawElement = function( context, ele, shiftToOriginWithBb, showLabel ){ - let r = this; - - if( ele.isNode() ){ - r.drawNode( context, ele, shiftToOriginWithBb, showLabel ); - } else { - r.drawEdge( context, ele, shiftToOriginWithBb, showLabel ); - } -}; - -CRp.drawCachedElement = function( context, ele, pxRatio, extent ){ - let r = this; - let bb = ele.boundingBox(); - - if( bb.w === 0 || bb.h === 0 ){ return; } - - if( !extent || math.boundingBoxesIntersect( bb, extent ) ){ - let cache = r.data.eleTxrCache.getElement( ele, bb, pxRatio ); - - if( cache != null ){ - context.drawImage( cache.texture.canvas, cache.x, 0, cache.width, cache.height, bb.x1, bb.y1, bb.w, bb.h ); - } else { // if the element is not cacheable, then draw directly - r.drawElement( context, ele ); - } - } -}; - -CRp.drawElements = function( context, eles ){ - let r = this; - - for( let i = 0; i < eles.length; i++ ){ - let ele = eles[ i ]; - - r.drawElement( context, ele ); - } -}; - -CRp.drawCachedElements = function( context, eles, pxRatio, extent ){ - let r = this; - - for( let i = 0; i < eles.length; i++ ){ - let ele = eles[ i ]; - - r.drawCachedElement( context, ele, pxRatio, extent ); - } -}; - -CRp.drawCachedNodes = function( context, eles, pxRatio, extent ){ - let r = this; - - for( let i = 0; i < eles.length; i++ ){ - let ele = eles[ i ]; - - if( !ele.isNode() ){ continue; } - - r.drawCachedElement( context, ele, pxRatio, extent ); - } -}; - -CRp.drawLayeredElements = function( context, eles, pxRatio, extent ){ - let r = this; - - let layers = r.data.lyrTxrCache.getLayers( eles, pxRatio ); - - if( layers ){ - for( let i = 0; i < layers.length; i++ ){ - let layer = layers[i]; - let bb = layer.bb; - - if( bb.w === 0 || bb.h === 0 ){ continue; } - - context.drawImage( layer.canvas, bb.x1, bb.y1, bb.w, bb.h ); - } - } else { // fall back on plain caching if no layers - r.drawCachedElements( context, eles, pxRatio, extent ); - } -}; - -CRp.drawDebugPoints = function( context, eles ){ - let draw = function( x, y, color ){ - context.fillStyle = color; - context.fillRect( x - 1, y - 1, 3, 3 ); - }; - - for( let i = 0; i < eles.length; i++ ){ - let ele = eles[i]; - let rs = ele._private.rscratch; - - if( ele.isNode() ){ - let p = ele.position(); - - draw( p.x, p.y, 'magenta' ); - } else { - let pts = rs.allpts; - - for( let j = 0; j + 1 < pts.length; j += 2 ){ - let x = pts[ j ]; - let y = pts[ j + 1 ]; - - draw( x, y, 'cyan' ); - } - - draw( rs.midX, rs.midY, 'yellow' ); - } - } -}; - -module.exports = CRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-images.js b/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-images.js deleted file mode 100644 index 42fcfd27d..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-images.js +++ /dev/null @@ -1,148 +0,0 @@ -var CRp = {}; - -CRp.safeDrawImage = function( context, img, ix, iy, iw, ih, x, y, w, h ){ - var r = this; - - // detect problematic cases for old browsers with bad images (cheaper than try-catch) - if( iw <= 0 || ih <= 0 || w <= 0 || h <= 0 ){ - return; - } - - context.drawImage( img, ix, iy, iw, ih, x, y, w, h ); -}; - -CRp.drawInscribedImage = function( context, img, node, index, nodeOpacity ){ - var r = this; - var pos = node.position(); - var nodeX = pos.x; - var nodeY = pos.y; - var styleObj = node.cy().style(); - var getIndexedStyle = styleObj.getIndexedStyle.bind( styleObj ); - var fit = getIndexedStyle( node, 'background-fit', 'value', index ); - var repeat = getIndexedStyle( node, 'background-repeat', 'value', index ); - var nodeW = node.width(); - var nodeH = node.height(); - var paddingX2 = node.padding() * 2; - var nodeTW = nodeW + ( getIndexedStyle( node, 'background-width-relative-to', 'value', index ) === 'inner' ? 0 : paddingX2 ); - var nodeTH = nodeH + ( getIndexedStyle( node, 'background-height-relative-to', 'value', index ) === 'inner' ? 0 : paddingX2 ); - var rs = node._private.rscratch; - var clip = node.pstyle( 'background-clip' ).value; - var shouldClip = clip === 'node'; - var imgOpacity = getIndexedStyle( node, 'background-image-opacity', 'value', index ) * nodeOpacity; - - var imgW = img.width || img.cachedW; - var imgH = img.height || img.cachedH; - - // workaround for broken browsers like ie - if( null == imgW || null == imgH ){ - document.body.appendChild( img ); // eslint-disable-line no-undef - - imgW = img.cachedW = img.width || img.offsetWidth; - imgH = img.cachedH = img.height || img.offsetHeight; - - document.body.removeChild( img ); // eslint-disable-line no-undef - } - - var w = imgW; - var h = imgH; - - if( getIndexedStyle( node, 'background-width', 'value', index ) !== 'auto' ){ - if( getIndexedStyle( node, 'background-width', 'units', index ) === '%' ){ - w = getIndexedStyle( node, 'background-width', 'pfValue', index ) * nodeTW; - } else { - w = getIndexedStyle( node, 'background-width', 'pfValue', index ); - } - } - - if( getIndexedStyle( node, 'background-height', 'value', index ) !== 'auto' ){ - if( getIndexedStyle( node, 'background-height', 'units', index ) === '%' ){ - h = getIndexedStyle( node, 'background-height', 'pfValue', index ) * nodeTH; - } else { - h = getIndexedStyle( node, 'background-height', 'pfValue', index ); - } - } - - if( w === 0 || h === 0 ){ - return; // no point in drawing empty image (and chrome is broken in this case) - } - - if( fit === 'contain' ){ - var scale = Math.min( nodeTW / w, nodeTH / h ); - - w *= scale; - h *= scale; - - } else if( fit === 'cover' ){ - var scale = Math.max( nodeTW / w, nodeTH / h ); - - w *= scale; - h *= scale; - } - - var x = (nodeX - nodeTW / 2); // left - if( getIndexedStyle( node, 'background-position-x', 'units', index ) === '%' ){ - x += (nodeTW - w) * getIndexedStyle( node, 'background-position-x', 'pfValue', index ); - } else { - x += getIndexedStyle( node, 'background-position-x', 'pfValue', index ); - } - - var y = (nodeY - nodeTH / 2); // top - if( getIndexedStyle( node, 'background-position-y', 'units', index ) === '%' ){ - y += (nodeTH - h) * getIndexedStyle( node, 'background-position-y', 'pfValue', index ); - } else { - y += getIndexedStyle( node, 'background-position-y', 'pfValue', index ); - } - - if( rs.pathCache ){ - x -= nodeX; - y -= nodeY; - - nodeX = 0; - nodeY = 0; - } - - var gAlpha = context.globalAlpha; - - context.globalAlpha = imgOpacity; - - if( repeat === 'no-repeat' ){ - - if( shouldClip ){ - context.save(); - - if( rs.pathCache ){ - context.clip( rs.pathCache ); - } else { - r.nodeShapes[ r.getNodeShape( node ) ].draw( - context, - nodeX, nodeY, - nodeTW, nodeTH ); - - context.clip(); - } - } - - r.safeDrawImage( context, img, 0, 0, imgW, imgH, x, y, w, h ); - - if( shouldClip ){ - context.restore(); - } - } else { - var pattern = context.createPattern( img, repeat ); - context.fillStyle = pattern; - - r.nodeShapes[ r.getNodeShape( node ) ].draw( - context, - nodeX, nodeY, - nodeTW, nodeTH ); - - context.translate( x, y ); - context.fill(); - context.translate( -x, -y ); - } - - context.globalAlpha = gAlpha; - -}; - -module.exports = CRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-label-text.js b/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-label-text.js deleted file mode 100644 index 3c7cd8a3c..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-label-text.js +++ /dev/null @@ -1,351 +0,0 @@ -var util = require( '../../../util' ); -var math = require( '../../../math' ); - -var CRp = {}; - -CRp.eleTextBiggerThanMin = function( ele, scale ){ - if( !scale ){ - var zoom = ele.cy().zoom(); - var pxRatio = this.getPixelRatio(); - var lvl = Math.ceil( math.log2( zoom * pxRatio ) ); // the effective texture level - - scale = Math.pow( 2, lvl ); - } - - var computedSize = ele.pstyle( 'font-size' ).pfValue * scale; - var minSize = ele.pstyle( 'min-zoomed-font-size' ).pfValue; - - if( computedSize < minSize ){ - return false; - } - - return true; -}; - -CRp.drawElementText = function( context, ele, force ){ - var r = this; - - if( force === undefined ){ - if( !r.eleTextBiggerThanMin( ele ) ){ return; } - } else { - if( !force ){ return; } - } - - if( ele.isNode() ){ - var label = ele.pstyle( 'label' ); - - if( !label || !label.value ){ return; } - - var textHalign = ele.pstyle( 'text-halign' ).strValue; - var textValign = ele.pstyle( 'text-valign' ).strValue; - - switch( textHalign ){ - case 'left': - context.textAlign = 'right'; - break; - - case 'right': - context.textAlign = 'left'; - break; - - default: // e.g. center - context.textAlign = 'center'; - } - - context.textBaseline = 'bottom'; - } else { - var label = ele.pstyle( 'label' ); - var srcLabel = ele.pstyle( 'source-label' ); - var tgtLabel = ele.pstyle( 'target-label' ); - - if( - ( !label || !label.value ) - && ( !srcLabel || !srcLabel.value ) - && ( !tgtLabel || !tgtLabel.value ) - ){ - return; - } - - context.textAlign = 'center'; - context.textBaseline = 'bottom'; - } - - - r.drawText( context, ele ); - - if( ele.isEdge() ){ - r.drawText( context, ele, 'source' ); - - r.drawText( context, ele, 'target' ); - } -}; - -CRp.drawNodeText = CRp.drawEdgeText = CRp.drawElementText; - -CRp.getFontCache = function( context ){ - var cache; - - this.fontCaches = this.fontCaches || []; - - for( var i = 0; i < this.fontCaches.length; i++ ){ - cache = this.fontCaches[ i ]; - - if( cache.context === context ){ - return cache; - } - } - - cache = { - context: context - }; - this.fontCaches.push( cache ); - - return cache; -}; - -// set up canvas context with font -// returns transformed text string -CRp.setupTextStyle = function( context, ele ){ - // Font style - var parentOpacity = ele.effectiveOpacity(); - var labelStyle = ele.pstyle( 'font-style' ).strValue; - var labelSize = ele.pstyle( 'font-size' ).pfValue + 'px'; - var labelFamily = ele.pstyle( 'font-family' ).strValue; - var labelWeight = ele.pstyle( 'font-weight' ).strValue; - var opacity = ele.pstyle( 'text-opacity' ).value * ele.pstyle( 'opacity' ).value * parentOpacity; - var outlineOpacity = ele.pstyle( 'text-outline-opacity' ).value * opacity; - var color = ele.pstyle( 'color' ).value; - var outlineColor = ele.pstyle( 'text-outline-color' ).value; - - var fontCacheKey = ele._private.fontKey; - var cache = this.getFontCache( context ); - - if( cache.key !== fontCacheKey ){ - context.font = labelStyle + ' ' + labelWeight + ' ' + labelSize + ' ' + labelFamily; - - cache.key = fontCacheKey; - } - - // Calculate text draw position based on text alignment - - // so text outlines aren't jagged - context.lineJoin = 'round'; - - this.fillStyle( context, color[ 0 ], color[ 1 ], color[ 2 ], opacity ); - - this.strokeStyle( context, outlineColor[ 0 ], outlineColor[ 1 ], outlineColor[ 2 ], outlineOpacity ); -}; - -function roundRect( ctx, x, y, width, height, radius ){ - var radius = radius || 5; - ctx.beginPath(); - ctx.moveTo( x + radius, y ); - ctx.lineTo( x + width - radius, y ); - ctx.quadraticCurveTo( x + width, y, x + width, y + radius ); - ctx.lineTo( x + width, y + height - radius ); - ctx.quadraticCurveTo( x + width, y + height, x + width - radius, y + height ); - ctx.lineTo( x + radius, y + height ); - ctx.quadraticCurveTo( x, y + height, x, y + height - radius ); - ctx.lineTo( x, y + radius ); - ctx.quadraticCurveTo( x, y, x + radius, y ); - ctx.closePath(); - ctx.fill(); -} - -// Draw text -CRp.drawText = function( context, ele, prefix ){ - var _p = ele._private; - var rscratch = _p.rscratch; - var parentOpacity = ele.effectiveOpacity(); - if( parentOpacity === 0 || ele.pstyle( 'text-opacity' ).value === 0 ){ - return; - } - - var textX = util.getPrefixedProperty( rscratch, 'labelX', prefix ); - var textY = util.getPrefixedProperty( rscratch, 'labelY', prefix ); - var text = this.getLabelText( ele, prefix ); - - if( text != null && text !== '' && !isNaN( textX ) && !isNaN( textY ) ){ - this.setupTextStyle( context, ele ); - - var pdash = prefix ? prefix + '-' : ''; - var textW = util.getPrefixedProperty( rscratch, 'labelWidth', prefix ); - var textH = util.getPrefixedProperty( rscratch, 'labelHeight', prefix ); - var textAngle = util.getPrefixedProperty( rscratch, 'labelAngle', prefix ); - var marginX = ele.pstyle( pdash + 'text-margin-x' ).pfValue; - var marginY = ele.pstyle( pdash + 'text-margin-y' ).pfValue; - - var isEdge = ele.isEdge(); - var isNode = ele.isNode(); - - var halign = ele.pstyle( 'text-halign' ).value; - var valign = ele.pstyle( 'text-valign' ).value; - - if( isEdge ){ - halign = 'center'; - valign = 'center'; - } - - textX += marginX; - textY += marginY; - - var rotation = ele.pstyle( pdash + 'text-rotation' ); - var theta; - - if( rotation.strValue === 'autorotate' ){ - theta = isEdge ? textAngle : 0; - } else if( rotation.strValue === 'none' ){ - theta = 0; - } else { - theta = rotation.pfValue; - } - - if( theta !== 0 ){ - var orgTextX = textX; - var orgTextY = textY; - - context.translate( orgTextX, orgTextY ); - context.rotate( theta ); - - textX = 0; - textY = 0; - } - - switch( valign ){ - case 'top': - break; - case 'center': - textY += textH / 2; - break; - case 'bottom': - textY += textH; - break; - } - - var backgroundOpacity = ele.pstyle( 'text-background-opacity' ).value; - var borderOpacity = ele.pstyle( 'text-border-opacity' ).value; - var textBorderWidth = ele.pstyle( 'text-border-width' ).pfValue; - var backgroundPadding = ele.pstyle( 'text-background-padding' ).pfValue; - - if( backgroundOpacity > 0 || ( textBorderWidth > 0 && borderOpacity > 0 ) ){ - var bgX = textX - backgroundPadding; - - switch( halign ){ - case 'left': - bgX -= textW; - break; - case 'center': - bgX -= textW / 2; - break; - case 'right': - break; - } - - var bgY = textY - textH - backgroundPadding; - var bgW = textW + 2*backgroundPadding; - var bgH = textH + 2*backgroundPadding; - - if( backgroundOpacity > 0 ){ - var textFill = context.fillStyle; - var textBackgroundColor = ele.pstyle( 'text-background-color' ).value; - - context.fillStyle = 'rgba(' + textBackgroundColor[ 0 ] + ',' + textBackgroundColor[ 1 ] + ',' + textBackgroundColor[ 2 ] + ',' + backgroundOpacity * parentOpacity + ')'; - var styleShape = ele.pstyle( 'text-background-shape' ).strValue; - if( styleShape == 'roundrectangle' ){ - roundRect( context, bgX, bgY, bgW, bgH, 2 ); - } else { - context.fillRect( bgX, bgY, bgW, bgH ); - } - context.fillStyle = textFill; - } - - if( textBorderWidth > 0 && borderOpacity > 0 ){ - var textStroke = context.strokeStyle; - var textLineWidth = context.lineWidth; - var textBorderColor = ele.pstyle( 'text-border-color' ).value; - var textBorderStyle = ele.pstyle( 'text-border-style' ).value; - - context.strokeStyle = 'rgba(' + textBorderColor[ 0 ] + ',' + textBorderColor[ 1 ] + ',' + textBorderColor[ 2 ] + ',' + borderOpacity * parentOpacity + ')'; - context.lineWidth = textBorderWidth; - - if( context.setLineDash ){ // for very outofdate browsers - switch( textBorderStyle ){ - case 'dotted': - context.setLineDash( [ 1, 1 ] ); - break; - case 'dashed': - context.setLineDash( [ 4, 2 ] ); - break; - case 'double': - context.lineWidth = textBorderWidth / 4; // 50% reserved for white between the two borders - context.setLineDash( [] ); - break; - case 'solid': - context.setLineDash( [] ); - break; - } - } - - context.strokeRect( bgX, bgY, bgW, bgH ); - - if( textBorderStyle === 'double' ){ - var whiteWidth = textBorderWidth / 2; - - context.strokeRect( bgX + whiteWidth, bgY + whiteWidth, bgW - whiteWidth * 2, bgH - whiteWidth * 2 ); - } - - if( context.setLineDash ){ // for very outofdate browsers - context.setLineDash( [] ); - } - context.lineWidth = textLineWidth; - context.strokeStyle = textStroke; - } - - } - - var lineWidth = 2 * ele.pstyle( 'text-outline-width' ).pfValue; // *2 b/c the stroke is drawn centred on the middle - - if( lineWidth > 0 ){ - context.lineWidth = lineWidth; - } - - if( ele.pstyle( 'text-wrap' ).value === 'wrap' ){ - var lines = util.getPrefixedProperty( rscratch, 'labelWrapCachedLines', prefix ); - var lineHeight = textH / lines.length; - - switch( valign ){ - case 'top': - textY -= ( lines.length - 1 ) * lineHeight; - break; - case 'center': - case 'bottom': - textY -= ( lines.length - 1 ) * lineHeight; - break; - } - - for( var l = 0; l < lines.length; l++ ){ - if( lineWidth > 0 ){ - context.strokeText( lines[ l ], textX, textY ); - } - - context.fillText( lines[ l ], textX, textY ); - - textY += lineHeight; - } - - } else { - if( lineWidth > 0 ){ - context.strokeText( text, textX, textY ); - } - - context.fillText( text, textX, textY ); - } - - if( theta !== 0 ){ - context.rotate( -theta ); - context.translate( -orgTextX, -orgTextY ); - } - } -}; - -module.exports = CRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-nodes.js b/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-nodes.js deleted file mode 100644 index d69831b29..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-nodes.js +++ /dev/null @@ -1,377 +0,0 @@ -/* global Path2D */ - -let is = require( '../../../is' ); - -let CRp = {}; - -CRp.drawNode = function( context, node, shiftToOriginWithBb, drawLabel ){ - let r = this; - let nodeWidth, nodeHeight; - let _p = node._private; - let rs = _p.rscratch; - let pos = node.position(); - - if( !is.number( pos.x ) || !is.number( pos.y ) ){ - return; // can't draw node with undefined position - } - - if( !node.visible() ){ return; } - - let parentOpacity = node.effectiveOpacity(); - - let usePaths = r.usePaths(); - let path; - let pathCacheHit = false; - - let padding = node.padding(); - - nodeWidth = node.width() + 2 * padding; - nodeHeight = node.height() + 2 * padding; - - // - // setup shift - - let bb; - if( shiftToOriginWithBb ){ - bb = shiftToOriginWithBb; - - context.translate( -bb.x1, -bb.y1 ); - } - - // - // load bg image - - let bgImgProp = node.pstyle( 'background-image' ); - let urls = bgImgProp.value; - let urlDefined = new Array( urls.length ); - let image = new Array( urls.length ); - let numImages = 0; - for( let i = 0; i < urls.length; i++ ){ - let url = urls[i]; - let defd = urlDefined[i] = url != null && url !== 'none'; - - if( defd ){ - let bgImgCrossOrigin = node.cy().style().getIndexedStyle(node, 'background-image-crossorigin', 'value', i); - - numImages++; - - // get image, and if not loaded then ask to redraw when later loaded - image[i] = r.getCachedImage( url, bgImgCrossOrigin, function(){ - node.emitAndNotify('background'); - } ); - } - } - - // - // setup styles - - let darkness = node.pstyle('background-blacken').value; - let borderWidth = node.pstyle('border-width').pfValue; - let bgColor = node.pstyle('background-color').value; - let bgOpacity = node.pstyle('background-opacity').value * parentOpacity; - let borderColor = node.pstyle('border-color').value; - let borderStyle = node.pstyle('border-style').value; - let borderOpacity = node.pstyle('border-opacity').value * parentOpacity; - - context.lineJoin = 'miter'; // so borders are square with the node shape - - let setupShapeColor = ( bgOpy = bgOpacity ) => { - r.fillStyle( context, bgColor[0], bgColor[1], bgColor[2], bgOpy ); - }; - - let setupBorderColor = ( bdrOpy = borderOpacity ) => { - r.strokeStyle( context, borderColor[0], borderColor[1], borderColor[2], bdrOpy ); - }; - - - // - // setup shape - - let styleShape = node.pstyle('shape').strValue; - let shapePts = node.pstyle('shape-polygon-points').pfValue; - - if( usePaths ){ - let pathCacheKey = styleShape + '$' + nodeWidth + '$' + nodeHeight + ( styleShape === 'polygon' ? '$' + shapePts.join('$') : '' ); - - context.translate( pos.x, pos.y ); - - if( rs.pathCacheKey === pathCacheKey ){ - path = rs.pathCache; - pathCacheHit = true; - } else { - path = new Path2D(); - rs.pathCacheKey = pathCacheKey; - rs.pathCache = path; - } - } - - let drawShape = () => { - if( !pathCacheHit ){ - - let npos = pos; - - if( usePaths ){ - npos = { - x: 0, - y: 0 - }; - } - - r.nodeShapes[ r.getNodeShape( node ) ].draw( - ( path || context ), - npos.x, - npos.y, - nodeWidth, - nodeHeight ); - } - - if( usePaths ){ - context.fill( path ); - } else { - context.fill(); - } - }; - - let drawImages = ( nodeOpacity = parentOpacity ) => { - let prevBging = _p.backgrounding; - let totalCompleted = 0; - - for( let i = 0; i < image.length; i++ ){ - if( urlDefined[i] && image[i].complete && !image[i].error ){ - totalCompleted++; - r.drawInscribedImage( context, image[i], node, i, nodeOpacity ); - } - } - - _p.backgrounding = !(totalCompleted === numImages); - if( prevBging !== _p.backgrounding ){ // update style b/c :backgrounding state changed - node.updateStyle( false ); - } - }; - - let drawPie = ( redrawShape = false, pieOpacity = parentOpacity ) => { - if( r.hasPie( node ) ){ - r.drawPie( context, node, pieOpacity ); - - // redraw/restore path if steps after pie need it - if( redrawShape ){ - - if( !usePaths ){ - r.nodeShapes[ r.getNodeShape( node ) ].draw( - context, - pos.x, - pos.y, - nodeWidth, - nodeHeight ); - } - } - } - }; - - let darken = ( darkenOpacity = parentOpacity ) => { - let opacity = ( darkness > 0 ? darkness : -darkness ) * darkenOpacity; - let c = darkness > 0 ? 0 : 255; - - if( darkness !== 0 ){ - r.fillStyle( context, c, c, c, opacity ); - - if( usePaths ){ - context.fill( path ); - } else { - context.fill(); - } - } - }; - - let drawBorder = () => { - if( borderWidth > 0 ){ - - context.lineWidth = borderWidth; - context.lineCap = 'butt'; - - if( context.setLineDash ){ // for very outofdate browsers - switch( borderStyle ){ - case 'dotted': - context.setLineDash( [ 1, 1 ] ); - break; - - case 'dashed': - context.setLineDash( [ 4, 2 ] ); - break; - - case 'solid': - case 'double': - context.setLineDash( [ ] ); - break; - } - } - - if( usePaths ){ - context.stroke( path ); - } else { - context.stroke(); - } - - if( borderStyle === 'double' ){ - context.lineWidth = borderWidth / 3; - - let gco = context.globalCompositeOperation; - context.globalCompositeOperation = 'destination-out'; - - if( usePaths ){ - context.stroke( path ); - } else { - context.stroke(); - } - - context.globalCompositeOperation = gco; - } - - // reset in case we changed the border style - if( context.setLineDash ){ // for very outofdate browsers - context.setLineDash( [ ] ); - } - - } - }; - - let drawOverlay = () => { - let overlayPadding = node.pstyle( 'overlay-padding' ).pfValue; - let overlayOpacity = node.pstyle( 'overlay-opacity' ).value; - let overlayColor = node.pstyle( 'overlay-color' ).value; - - if( overlayOpacity > 0 ){ - r.fillStyle( context, overlayColor[0], overlayColor[1], overlayColor[2], overlayOpacity ); - - r.nodeShapes[ 'roundrectangle' ].draw( - context, - pos.x, - pos.y, - nodeWidth + overlayPadding * 2, - nodeHeight + overlayPadding * 2 - ); - - context.fill(); - } - }; - - let drawText = () => { - r.drawElementText( context, node, drawLabel ); - }; - - let ghost = node.pstyle('ghost').value === 'yes'; - - if( ghost ){ - let gx = node.pstyle('ghost-offset-x').pfValue; - let gy = node.pstyle('ghost-offset-y').pfValue; - let ghostOpacity = node.pstyle('ghost-opacity').value; - let effGhostOpacity = ghostOpacity * parentOpacity; - - context.translate( gx, gy ); - - setupShapeColor( ghostOpacity * bgOpacity ); - drawShape(); - drawImages( effGhostOpacity ); - drawPie( darkness !== 0 || borderWidth !== 0 ); - darken( effGhostOpacity ); - setupBorderColor( ghostOpacity * borderOpacity ); - drawBorder(); - - context.translate( -gx, -gy ); - } - - setupShapeColor(); - drawShape(); - drawImages(); - drawPie( darkness !== 0 || borderWidth !== 0 ); - darken(); - setupBorderColor(); - drawBorder(); - - if( usePaths ){ - context.translate( -pos.x, -pos.y ); - } - - drawText(); - drawOverlay(); - - // - // clean up shift - - if( shiftToOriginWithBb ){ - context.translate( bb.x1, bb.y1 ); - } - -}; - -// does the node have at least one pie piece? -CRp.hasPie = function( node ){ - node = node[0]; // ensure ele ref - - return node._private.hasPie; -}; - -CRp.drawPie = function( context, node, nodeOpacity, pos ){ - node = node[0]; // ensure ele ref - pos = pos || node.position(); - - let cyStyle = node.cy().style(); - let pieSize = node.pstyle( 'pie-size' ); - let x = pos.x; - let y = pos.y; - let nodeW = node.width(); - let nodeH = node.height(); - let radius = Math.min( nodeW, nodeH ) / 2; // must fit in node - let lastPercent = 0; // what % to continue drawing pie slices from on [0, 1] - let usePaths = this.usePaths(); - - if( usePaths ){ - x = 0; - y = 0; - } - - if( pieSize.units === '%' ){ - radius = radius * pieSize.pfValue; - } else if( pieSize.pfValue !== undefined ){ - radius = pieSize.pfValue / 2; - } - - for( let i = 1; i <= cyStyle.pieBackgroundN; i++ ){ // 1..N - let size = node.pstyle( 'pie-' + i + '-background-size' ).value; - let color = node.pstyle( 'pie-' + i + '-background-color' ).value; - let opacity = node.pstyle( 'pie-' + i + '-background-opacity' ).value * nodeOpacity; - let percent = size / 100; // map integer range [0, 100] to [0, 1] - - // percent can't push beyond 1 - if( percent + lastPercent > 1 ){ - percent = 1 - lastPercent; - } - - let angleStart = 1.5 * Math.PI + 2 * Math.PI * lastPercent; // start at 12 o'clock and go clockwise - let angleDelta = 2 * Math.PI * percent; - let angleEnd = angleStart + angleDelta; - - // ignore if - // - zero size - // - we're already beyond the full circle - // - adding the current slice would go beyond the full circle - if( size === 0 || lastPercent >= 1 || lastPercent + percent > 1 ){ - continue; - } - - context.beginPath(); - context.moveTo( x, y ); - context.arc( x, y, radius, angleStart, angleEnd ); - context.closePath(); - - this.fillStyle( context, color[0], color[1], color[2], opacity ); - - context.fill(); - - lastPercent += percent; - } - -}; - - -module.exports = CRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-redraw.js b/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-redraw.js deleted file mode 100644 index fe34835b6..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-redraw.js +++ /dev/null @@ -1,579 +0,0 @@ -var CRp = {}; - -var util = require( '../../../util' ); - -var motionBlurDelay = 100; - -// var isFirefox = typeof InstallTrigger !== 'undefined'; - -CRp.getPixelRatio = function(){ - var context = this.data.contexts[0]; - - if( this.forcedPixelRatio != null ){ - return this.forcedPixelRatio; - } - - var backingStore = context.backingStorePixelRatio || - context.webkitBackingStorePixelRatio || - context.mozBackingStorePixelRatio || - context.msBackingStorePixelRatio || - context.oBackingStorePixelRatio || - context.backingStorePixelRatio || 1; - - return (window.devicePixelRatio || 1) / backingStore; // eslint-disable-line no-undef -}; - -CRp.paintCache = function( context ){ - var caches = this.paintCaches = this.paintCaches || []; - var needToCreateCache = true; - var cache; - - for( var i = 0; i < caches.length; i++ ){ - cache = caches[ i ]; - - if( cache.context === context ){ - needToCreateCache = false; - break; - } - } - - if( needToCreateCache ){ - cache = { - context: context - }; - caches.push( cache ); - } - - return cache; -}; - -CRp.fillStyle = function( context, r, g, b, a ){ - context.fillStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; - - // turn off for now, seems context does its own caching - - // var cache = this.paintCache(context); - - // var fillStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; - - // if( cache.fillStyle !== fillStyle ){ - // context.fillStyle = cache.fillStyle = fillStyle; - // } -}; - -CRp.strokeStyle = function( context, r, g, b, a ){ - context.strokeStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; - - // turn off for now, seems context does its own caching - - // var cache = this.paintCache(context); - - // var strokeStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; - - // if( cache.strokeStyle !== strokeStyle ){ - // context.strokeStyle = cache.strokeStyle = strokeStyle; - // } -}; - -// Resize canvas -CRp.matchCanvasSize = function( container ){ - var r = this; - var data = r.data; - var bb = r.findContainerClientCoords(); - var width = bb[2]; - var height = bb[3]; - var pixelRatio = r.getPixelRatio(); - var mbPxRatio = r.motionBlurPxRatio; - - if( - container === r.data.bufferCanvases[ r.MOTIONBLUR_BUFFER_NODE ] || - container === r.data.bufferCanvases[ r.MOTIONBLUR_BUFFER_DRAG ] - ){ - pixelRatio = mbPxRatio; - } - - var canvasWidth = width * pixelRatio; - var canvasHeight = height * pixelRatio; - var canvas; - - if( canvasWidth === r.canvasWidth && canvasHeight === r.canvasHeight ){ - return; // save cycles if same - } - - r.fontCaches = null; // resizing resets the style - - var canvasContainer = data.canvasContainer; - canvasContainer.style.width = width + 'px'; - canvasContainer.style.height = height + 'px'; - - for( var i = 0; i < r.CANVAS_LAYERS; i++ ){ - canvas = data.canvases[ i ]; - - canvas.width = canvasWidth; - canvas.height = canvasHeight; - - canvas.style.width = width + 'px'; - canvas.style.height = height + 'px'; - } - - for( var i = 0; i < r.BUFFER_COUNT; i++ ){ - canvas = data.bufferCanvases[ i ]; - - canvas.width = canvasWidth; - canvas.height = canvasHeight; - - canvas.style.width = width + 'px'; - canvas.style.height = height + 'px'; - } - - r.textureMult = 1; - if( pixelRatio <= 1 ){ - canvas = data.bufferCanvases[ r.TEXTURE_BUFFER ]; - - r.textureMult = 2; - canvas.width = canvasWidth * r.textureMult; - canvas.height = canvasHeight * r.textureMult; - } - - r.canvasWidth = canvasWidth; - r.canvasHeight = canvasHeight; - -}; - -CRp.renderTo = function( cxt, zoom, pan, pxRatio ){ - this.render( { - forcedContext: cxt, - forcedZoom: zoom, - forcedPan: pan, - drawAllLayers: true, - forcedPxRatio: pxRatio - } ); -}; - -CRp.render = function( options ){ - options = options || util.staticEmptyObject(); - - var forcedContext = options.forcedContext; - var drawAllLayers = options.drawAllLayers; - var drawOnlyNodeLayer = options.drawOnlyNodeLayer; - var forcedZoom = options.forcedZoom; - var forcedPan = options.forcedPan; - var r = this; - var pixelRatio = options.forcedPxRatio === undefined ? this.getPixelRatio() : options.forcedPxRatio; - var cy = r.cy; var data = r.data; - var needDraw = data.canvasNeedsRedraw; - var textureDraw = r.textureOnViewport && !forcedContext && (r.pinching || r.hoverData.dragging || r.swipePanning || r.data.wheelZooming); - var motionBlur = options.motionBlur !== undefined ? options.motionBlur : r.motionBlur; - var mbPxRatio = r.motionBlurPxRatio; - var hasCompoundNodes = cy.hasCompoundNodes(); - var inNodeDragGesture = r.hoverData.draggingEles; - var inBoxSelection = r.hoverData.selecting || r.touchData.selecting ? true : false; - motionBlur = motionBlur && !forcedContext && r.motionBlurEnabled && !inBoxSelection; - var motionBlurFadeEffect = motionBlur; - - if( !forcedContext ){ - if( r.prevPxRatio !== pixelRatio ){ - r.invalidateContainerClientCoordsCache(); - r.matchCanvasSize( r.container ); - - r.redrawHint('eles', true); - r.redrawHint('drag', true); - } - - r.prevPxRatio = pixelRatio; - } - - if( !forcedContext && r.motionBlurTimeout ){ - clearTimeout( r.motionBlurTimeout ); - } - - if( motionBlur ){ - if( r.mbFrames == null ){ - r.mbFrames = 0; - } - - r.mbFrames++; - - if( r.mbFrames < 3 ){ // need several frames before even high quality motionblur - motionBlurFadeEffect = false; - } - - // go to lower quality blurry frames when several m/b frames have been rendered (avoids flashing) - if( r.mbFrames > r.minMbLowQualFrames ){ - //r.fullQualityMb = false; - r.motionBlurPxRatio = r.mbPxRBlurry; - } - } - - if( r.clearingMotionBlur ){ - r.motionBlurPxRatio = 1; - } - - // b/c drawToContext() may be async w.r.t. redraw(), keep track of last texture frame - // because a rogue async texture frame would clear needDraw - if( r.textureDrawLastFrame && !textureDraw ){ - needDraw[ r.NODE ] = true; - needDraw[ r.SELECT_BOX ] = true; - } - - var coreStyle = cy.style()._private.coreStyle; - - var zoom = cy.zoom(); - var effectiveZoom = forcedZoom !== undefined ? forcedZoom : zoom; - var pan = cy.pan(); - var effectivePan = { - x: pan.x, - y: pan.y - }; - - var vp = { - zoom: zoom, - pan: { - x: pan.x, - y: pan.y - } - }; - var prevVp = r.prevViewport; - var viewportIsDiff = prevVp === undefined || vp.zoom !== prevVp.zoom || vp.pan.x !== prevVp.pan.x || vp.pan.y !== prevVp.pan.y; - - // we want the low quality motionblur only when the viewport is being manipulated etc (where it's not noticed) - if( !viewportIsDiff && !(inNodeDragGesture && !hasCompoundNodes) ){ - r.motionBlurPxRatio = 1; - } - - if( forcedPan ){ - effectivePan = forcedPan; - } - - // apply pixel ratio - - effectiveZoom *= pixelRatio; - effectivePan.x *= pixelRatio; - effectivePan.y *= pixelRatio; - - var eles = r.getCachedZSortedEles(); - - function mbclear( context, x, y, w, h ){ - var gco = context.globalCompositeOperation; - - context.globalCompositeOperation = 'destination-out'; - r.fillStyle( context, 255, 255, 255, r.motionBlurTransparency ); - context.fillRect( x, y, w, h ); - - context.globalCompositeOperation = gco; - } - - function setContextTransform( context, clear ){ - var ePan, eZoom, w, h; - - if( !r.clearingMotionBlur && (context === data.bufferContexts[ r.MOTIONBLUR_BUFFER_NODE ] || context === data.bufferContexts[ r.MOTIONBLUR_BUFFER_DRAG ]) ){ - ePan = { - x: pan.x * mbPxRatio, - y: pan.y * mbPxRatio - }; - - eZoom = zoom * mbPxRatio; - - w = r.canvasWidth * mbPxRatio; - h = r.canvasHeight * mbPxRatio; - } else { - ePan = effectivePan; - eZoom = effectiveZoom; - - w = r.canvasWidth; - h = r.canvasHeight; - } - - context.setTransform( 1, 0, 0, 1, 0, 0 ); - - if( clear === 'motionBlur' ){ - mbclear( context, 0, 0, w, h ); - } else if( !forcedContext && (clear === undefined || clear) ){ - context.clearRect( 0, 0, w, h ); - } - - if( !drawAllLayers ){ - context.translate( ePan.x, ePan.y ); - context.scale( eZoom, eZoom ); - } - if( forcedPan ){ - context.translate( forcedPan.x, forcedPan.y ); - } - if( forcedZoom ){ - context.scale( forcedZoom, forcedZoom ); - } - } - - if( !textureDraw ){ - r.textureDrawLastFrame = false; - } - - if( textureDraw ){ - r.textureDrawLastFrame = true; - - var bb; - - if( !r.textureCache ){ - r.textureCache = {}; - - bb = r.textureCache.bb = cy.mutableElements().boundingBox(); - - r.textureCache.texture = r.data.bufferCanvases[ r.TEXTURE_BUFFER ]; - - var cxt = r.data.bufferContexts[ r.TEXTURE_BUFFER ]; - - cxt.setTransform( 1, 0, 0, 1, 0, 0 ); - cxt.clearRect( 0, 0, r.canvasWidth * r.textureMult, r.canvasHeight * r.textureMult ); - - r.render( { - forcedContext: cxt, - drawOnlyNodeLayer: true, - forcedPxRatio: pixelRatio * r.textureMult - } ); - - var vp = r.textureCache.viewport = { - zoom: cy.zoom(), - pan: cy.pan(), - width: r.canvasWidth, - height: r.canvasHeight - }; - - vp.mpan = { - x: (0 - vp.pan.x) / vp.zoom, - y: (0 - vp.pan.y) / vp.zoom - }; - } - - needDraw[ r.DRAG ] = false; - needDraw[ r.NODE ] = false; - - var context = data.contexts[ r.NODE ]; - - var texture = r.textureCache.texture; - var vp = r.textureCache.viewport; - bb = r.textureCache.bb; - - context.setTransform( 1, 0, 0, 1, 0, 0 ); - - if( motionBlur ){ - mbclear( context, 0, 0, vp.width, vp.height ); - } else { - context.clearRect( 0, 0, vp.width, vp.height ); - } - - var outsideBgColor = coreStyle[ 'outside-texture-bg-color' ].value; - var outsideBgOpacity = coreStyle[ 'outside-texture-bg-opacity' ].value; - r.fillStyle( context, outsideBgColor[0], outsideBgColor[1], outsideBgColor[2], outsideBgOpacity ); - context.fillRect( 0, 0, vp.width, vp.height ); - - var zoom = cy.zoom(); - - setContextTransform( context, false ); - - context.clearRect( vp.mpan.x, vp.mpan.y, vp.width / vp.zoom / pixelRatio, vp.height / vp.zoom / pixelRatio ); - context.drawImage( texture, vp.mpan.x, vp.mpan.y, vp.width / vp.zoom / pixelRatio, vp.height / vp.zoom / pixelRatio ); - - } else if( r.textureOnViewport && !forcedContext ){ // clear the cache since we don't need it - r.textureCache = null; - } - - var extent = cy.extent(); - var vpManip = (r.pinching || r.hoverData.dragging || r.swipePanning || r.data.wheelZooming || r.hoverData.draggingEles); - var hideEdges = r.hideEdgesOnViewport && vpManip; - - var needMbClear = []; - - needMbClear[ r.NODE ] = !needDraw[ r.NODE ] && motionBlur && !r.clearedForMotionBlur[ r.NODE ] || r.clearingMotionBlur; - if( needMbClear[ r.NODE ] ){ r.clearedForMotionBlur[ r.NODE ] = true; } - - needMbClear[ r.DRAG ] = !needDraw[ r.DRAG ] && motionBlur && !r.clearedForMotionBlur[ r.DRAG ] || r.clearingMotionBlur; - if( needMbClear[ r.DRAG ] ){ r.clearedForMotionBlur[ r.DRAG ] = true; } - - if( needDraw[ r.NODE ] || drawAllLayers || drawOnlyNodeLayer || needMbClear[ r.NODE ] ){ - var useBuffer = motionBlur && !needMbClear[ r.NODE ] && mbPxRatio !== 1; - var context = forcedContext || ( useBuffer ? r.data.bufferContexts[ r.MOTIONBLUR_BUFFER_NODE ] : data.contexts[ r.NODE ] ); - var clear = motionBlur && !useBuffer ? 'motionBlur' : undefined; - - setContextTransform( context, clear ); - - if( hideEdges ){ - r.drawCachedNodes( context, eles.nondrag, pixelRatio, extent ); - } else { - r.drawLayeredElements( context, eles.nondrag, pixelRatio, extent ); - } - - if( r.debug ){ - r.drawDebugPoints( context, eles.nondrag ); - } - - if( !drawAllLayers && !motionBlur ){ - needDraw[ r.NODE ] = false; - } - } - - if( !drawOnlyNodeLayer && (needDraw[ r.DRAG ] || drawAllLayers || needMbClear[ r.DRAG ]) ){ - var useBuffer = motionBlur && !needMbClear[ r.DRAG ] && mbPxRatio !== 1; - var context = forcedContext || ( useBuffer ? r.data.bufferContexts[ r.MOTIONBLUR_BUFFER_DRAG ] : data.contexts[ r.DRAG ] ); - - setContextTransform( context, motionBlur && !useBuffer ? 'motionBlur' : undefined ); - - if( hideEdges ){ - r.drawCachedNodes( context, eles.drag, pixelRatio, extent ); - } else { - r.drawCachedElements( context, eles.drag, pixelRatio, extent ); - } - - if( r.debug ){ - r.drawDebugPoints( context, eles.drag ); - } - - if( !drawAllLayers && !motionBlur ){ - needDraw[ r.DRAG ] = false; - } - } - - if( r.showFps || (!drawOnlyNodeLayer && (needDraw[ r.SELECT_BOX ] && !drawAllLayers)) ){ - var context = forcedContext || data.contexts[ r.SELECT_BOX ]; - - setContextTransform( context ); - - if( r.selection[4] == 1 && ( r.hoverData.selecting || r.touchData.selecting ) ){ - var zoom = r.cy.zoom(); - var borderWidth = coreStyle[ 'selection-box-border-width' ].value / zoom; - - context.lineWidth = borderWidth; - context.fillStyle = 'rgba(' - + coreStyle[ 'selection-box-color' ].value[0] + ',' - + coreStyle[ 'selection-box-color' ].value[1] + ',' - + coreStyle[ 'selection-box-color' ].value[2] + ',' - + coreStyle[ 'selection-box-opacity' ].value + ')'; - - context.fillRect( - r.selection[0], - r.selection[1], - r.selection[2] - r.selection[0], - r.selection[3] - r.selection[1] ); - - if( borderWidth > 0 ){ - context.strokeStyle = 'rgba(' - + coreStyle[ 'selection-box-border-color' ].value[0] + ',' - + coreStyle[ 'selection-box-border-color' ].value[1] + ',' - + coreStyle[ 'selection-box-border-color' ].value[2] + ',' - + coreStyle[ 'selection-box-opacity' ].value + ')'; - - context.strokeRect( - r.selection[0], - r.selection[1], - r.selection[2] - r.selection[0], - r.selection[3] - r.selection[1] ); - } - } - - if( data.bgActivePosistion && !r.hoverData.selecting ){ - var zoom = r.cy.zoom(); - var pos = data.bgActivePosistion; - - context.fillStyle = 'rgba(' - + coreStyle[ 'active-bg-color' ].value[0] + ',' - + coreStyle[ 'active-bg-color' ].value[1] + ',' - + coreStyle[ 'active-bg-color' ].value[2] + ',' - + coreStyle[ 'active-bg-opacity' ].value + ')'; - - context.beginPath(); - context.arc( pos.x, pos.y, coreStyle[ 'active-bg-size' ].pfValue / zoom, 0, 2 * Math.PI ); - context.fill(); - } - - var timeToRender = r.lastRedrawTime; - if( r.showFps && timeToRender ){ - timeToRender = Math.round( timeToRender ); - var fps = Math.round( 1000 / timeToRender ); - - context.setTransform( 1, 0, 0, 1, 0, 0 ); - - context.fillStyle = 'rgba(255, 0, 0, 0.75)'; - context.strokeStyle = 'rgba(255, 0, 0, 0.75)'; - context.lineWidth = 1; - context.fillText( '1 frame = ' + timeToRender + ' ms = ' + fps + ' fps', 0, 20 ); - - var maxFps = 60; - context.strokeRect( 0, 30, 250, 20 ); - context.fillRect( 0, 30, 250 * Math.min( fps / maxFps, 1 ), 20 ); - } - - if( !drawAllLayers ){ - needDraw[ r.SELECT_BOX ] = false; - } - } - - // motionblur: blit rendered blurry frames - if( motionBlur && mbPxRatio !== 1 ){ - var cxtNode = data.contexts[ r.NODE ]; - var txtNode = r.data.bufferCanvases[ r.MOTIONBLUR_BUFFER_NODE ]; - - var cxtDrag = data.contexts[ r.DRAG ]; - var txtDrag = r.data.bufferCanvases[ r.MOTIONBLUR_BUFFER_DRAG ]; - - var drawMotionBlur = function( cxt, txt, needClear ){ - cxt.setTransform( 1, 0, 0, 1, 0, 0 ); - - if( needClear || !motionBlurFadeEffect ){ - cxt.clearRect( 0, 0, r.canvasWidth, r.canvasHeight ); - } else { - mbclear( cxt, 0, 0, r.canvasWidth, r.canvasHeight ); - } - - var pxr = mbPxRatio; - - cxt.drawImage( - txt, // img - 0, 0, // sx, sy - r.canvasWidth * pxr, r.canvasHeight * pxr, // sw, sh - 0, 0, // x, y - r.canvasWidth, r.canvasHeight // w, h - ); - }; - - if( needDraw[ r.NODE ] || needMbClear[ r.NODE ] ){ - drawMotionBlur( cxtNode, txtNode, needMbClear[ r.NODE ] ); - needDraw[ r.NODE ] = false; - } - - if( needDraw[ r.DRAG ] || needMbClear[ r.DRAG ] ){ - drawMotionBlur( cxtDrag, txtDrag, needMbClear[ r.DRAG ] ); - needDraw[ r.DRAG ] = false; - } - } - - r.prevViewport = vp; - - if( r.clearingMotionBlur ){ - r.clearingMotionBlur = false; - r.motionBlurCleared = true; - r.motionBlur = true; - } - - if( motionBlur ){ - r.motionBlurTimeout = setTimeout( function(){ - r.motionBlurTimeout = null; - - r.clearedForMotionBlur[ r.NODE ] = false; - r.clearedForMotionBlur[ r.DRAG ] = false; - r.motionBlur = false; - r.clearingMotionBlur = !textureDraw; - r.mbFrames = 0; - - needDraw[ r.NODE ] = true; - needDraw[ r.DRAG ] = true; - - r.redraw(); - }, motionBlurDelay ); - } - - if( !forcedContext ){ - cy.emit('render'); - } - -}; - -module.exports = CRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-shapes.js b/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-shapes.js deleted file mode 100644 index ad1bed1f6..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/canvas/drawing-shapes.js +++ /dev/null @@ -1,168 +0,0 @@ -var math = require( '../../../math' ); - -var CRp = {}; - -// @O Polygon drawing -CRp.drawPolygonPath = function( - context, x, y, width, height, points ){ - - var halfW = width / 2; - var halfH = height / 2; - - if( context.beginPath ){ context.beginPath(); } - - context.moveTo( x + halfW * points[0], y + halfH * points[1] ); - - for( var i = 1; i < points.length / 2; i++ ){ - context.lineTo( x + halfW * points[ i * 2], y + halfH * points[ i * 2 + 1] ); - } - - context.closePath(); -}; - -// Round rectangle drawing -CRp.drawRoundRectanglePath = function( - context, x, y, width, height ){ - - var halfWidth = width / 2; - var halfHeight = height / 2; - var cornerRadius = math.getRoundRectangleRadius( width, height ); - - if( context.beginPath ){ context.beginPath(); } - - // Start at top middle - context.moveTo( x, y - halfHeight ); - // Arc from middle top to right side - context.arcTo( x + halfWidth, y - halfHeight, x + halfWidth, y, cornerRadius ); - // Arc from right side to bottom - context.arcTo( x + halfWidth, y + halfHeight, x, y + halfHeight, cornerRadius ); - // Arc from bottom to left side - context.arcTo( x - halfWidth, y + halfHeight, x - halfWidth, y, cornerRadius ); - // Arc from left side to topBorder - context.arcTo( x - halfWidth, y - halfHeight, x, y - halfHeight, cornerRadius ); - // Join line - context.lineTo( x, y - halfHeight ); - - - context.closePath(); -}; - -CRp.drawBottomRoundRectanglePath = function( - context, x, y, width, height ){ - - var halfWidth = width / 2; - var halfHeight = height / 2; - var cornerRadius = math.getRoundRectangleRadius( width, height ); - - if( context.beginPath ){ context.beginPath(); } - - // Start at top middle - context.moveTo( x, y - halfHeight ); - context.lineTo( x + halfWidth, y - halfHeight ); - context.lineTo( x + halfWidth, y ); - - context.arcTo( x + halfWidth, y + halfHeight, x, y + halfHeight, cornerRadius); - context.arcTo( x - halfWidth, y + halfHeight, x - halfWidth, y, cornerRadius ); - - context.lineTo( x - halfWidth, y - halfHeight ); - context.lineTo( x, y - halfHeight ); - - context.closePath(); -}; - -CRp.drawCutRectanglePath = function( - context, x, y, width, height ){ - - var halfWidth = width / 2; - var halfHeight = height / 2; - var cornerLength = math.getCutRectangleCornerLength(); - - if( context.beginPath ){ context.beginPath(); } - - context.moveTo( x - halfWidth + cornerLength, y - halfHeight ); - - context.lineTo( x + halfWidth - cornerLength, y - halfHeight ); - context.lineTo( x + halfWidth, y - halfHeight + cornerLength ); - context.lineTo( x + halfWidth, y + halfHeight - cornerLength ); - context.lineTo( x + halfWidth - cornerLength, y + halfHeight ); - context.lineTo( x - halfWidth + cornerLength, y + halfHeight ); - context.lineTo( x - halfWidth, y + halfHeight - cornerLength ); - context.lineTo( x - halfWidth, y - halfHeight + cornerLength ); - - context.closePath(); -}; - -CRp.drawBarrelPath = function( - context, x, y, width, height ){ - - var halfWidth = width / 2; - var halfHeight = height / 2; - - var xBegin = x - halfWidth; - var xEnd = x + halfWidth; - var yBegin = y - halfHeight; - var yEnd = y + halfHeight; - - var barrelCurveConstants = math.getBarrelCurveConstants( width, height ); - var wOffset = barrelCurveConstants.widthOffset; - var hOffset = barrelCurveConstants.heightOffset; - var ctrlPtXOffset = barrelCurveConstants.ctrlPtOffsetPct * wOffset; - - if( context.beginPath ){ context.beginPath(); } - - context.moveTo( xBegin, yBegin + hOffset ); - - context.lineTo( xBegin, yEnd - hOffset ); - context.quadraticCurveTo( xBegin + ctrlPtXOffset, yEnd, xBegin + wOffset, yEnd ); - - context.lineTo( xEnd - wOffset, yEnd ); - context.quadraticCurveTo( xEnd - ctrlPtXOffset, yEnd, xEnd, yEnd - hOffset ); - - context.lineTo( xEnd, yBegin + hOffset ); - context.quadraticCurveTo( xEnd - ctrlPtXOffset, yBegin, xEnd - wOffset, yBegin ); - - context.lineTo( xBegin + wOffset, yBegin ); - context.quadraticCurveTo( xBegin + ctrlPtXOffset, yBegin, xBegin, yBegin + hOffset ); - - context.closePath(); -}; - - -var sin0 = Math.sin( 0 ); -var cos0 = Math.cos( 0 ); - -var sin = {}; -var cos = {}; - -var ellipseStepSize = Math.PI / 40; - -for( var i = 0 * Math.PI; i < 2 * Math.PI; i += ellipseStepSize ){ - sin[ i ] = Math.sin( i ); - cos[ i ] = Math.cos( i ); -} - -CRp.drawEllipsePath = function( context, centerX, centerY, width, height ){ - if( context.beginPath ){ context.beginPath(); } - - if( context.ellipse ){ - context.ellipse( centerX, centerY, width / 2, height / 2, 0, 0, 2 * Math.PI ); - } else { - var xPos, yPos; - var rw = width / 2; - var rh = height / 2; - for( var i = 0 * Math.PI; i < 2 * Math.PI; i += ellipseStepSize ){ - xPos = centerX - (rw * sin[ i ]) * sin0 + (rw * cos[ i ]) * cos0; - yPos = centerY + (rh * cos[ i ]) * sin0 + (rh * sin[ i ]) * cos0; - - if( i === 0 ){ - context.moveTo( xPos, yPos ); - } else { - context.lineTo( xPos, yPos ); - } - } - } - - context.closePath(); - }; - -module.exports = CRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/ele-texture-cache.js b/node_modules/cytoscape/src/extensions/renderer/canvas/ele-texture-cache.js deleted file mode 100644 index 6ee1ee662..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/canvas/ele-texture-cache.js +++ /dev/null @@ -1,500 +0,0 @@ -var math = require( '../../../math' ); -var util = require( '../../../util' ); -var Heap = require( '../../../heap' ); -var defs = require( './texture-cache-defs' ); - -var minTxrH = 25; // the size of the texture cache for small height eles (special case) -var txrStepH = 50; // the min size of the regular cache, and the size it increases with each step up -var minLvl = -4; // when scaling smaller than that we don't need to re-render -var maxLvl = 2; // when larger than this scale just render directly (caching is not helpful) -var maxZoom = 3.99; // beyond this zoom level, layered textures are not used -var eleTxrSpacing = 8; // spacing between elements on textures to avoid blitting overlaps -var defTxrWidth = 1024; // default/minimum texture width -var maxTxrW = 1024; // the maximum width of a texture -var maxTxrH = 1024; // the maximum height of a texture -var minUtility = 0.5; // if usage of texture is less than this, it is retired -var maxFullness = 0.8; // fullness of texture after which queue removal is checked -var maxFullnessChecks = 10; // dequeued after this many checks -var allowEdgeTxrCaching = false; // whether edges can be cached as textures (TODO maybe better on if webgl supported?) -var allowParentTxrCaching = false; // whether parent nodes can be cached as textures (TODO maybe better on if webgl supported?) -var deqCost = 0.15; // % of add'l rendering cost allowed for dequeuing ele caches each frame -var deqAvgCost = 0.1; // % of add'l rendering cost compared to average overall redraw time -var deqNoDrawCost = 0.9; // % of avg frame time that can be used for dequeueing when not drawing -var deqFastCost = 0.9; // % of frame time to be used when >60fps -var deqRedrawThreshold = 100; // time to batch redraws together from dequeueing to allow more dequeueing calcs to happen in the meanwhile -var maxDeqSize = 1; // number of eles to dequeue and render at higher texture in each batch - -var getTxrReasons = { - dequeue: 'dequeue', - downscale: 'downscale', - highQuality: 'highQuality' -}; - -var ElementTextureCache = function( renderer ){ - var self = this; - - self.renderer = renderer; - self.onDequeues = []; - - self.setupDequeueing(); -}; - -var ETCp = ElementTextureCache.prototype; - -ETCp.reasons = getTxrReasons; - -// the list of textures in which new subtextures for elements can be placed -ETCp.getTextureQueue = function( txrH ){ - var self = this; - self.eleImgCaches = self.eleImgCaches || {}; - - return ( self.eleImgCaches[ txrH ] = self.eleImgCaches[ txrH ] || [] ); -}; - -// the list of usused textures which can be recycled (in use in texture queue) -ETCp.getRetiredTextureQueue = function( txrH ){ - var self = this; - - var rtxtrQs = self.eleImgCaches.retired = self.eleImgCaches.retired || {}; - var rtxtrQ = rtxtrQs[ txrH ] = rtxtrQs[ txrH ] || []; - - return rtxtrQ; -}; - -// queue of element draw requests at different scale levels -ETCp.getElementQueue = function(){ - var self = this; - - var q = self.eleCacheQueue = self.eleCacheQueue || new Heap(function( a, b ){ - return b.reqs - a.reqs; - }); - - return q; -}; - -// queue of element draw requests at different scale levels (element id lookup) -ETCp.getElementIdToQueue = function(){ - var self = this; - - var id2q = self.eleIdToCacheQueue = self.eleIdToCacheQueue || {}; - - return id2q; -}; - -ETCp.getElement = function( ele, bb, pxRatio, lvl, reason ){ - var self = this; - var r = this.renderer; - var rs = ele._private.rscratch; - var zoom = r.cy.zoom(); - - if( bb.w === 0 || bb.h === 0 || !ele.visible() ){ return null; } - - if( lvl == null ){ - lvl = Math.ceil( math.log2( zoom * pxRatio ) ); - } - - if( lvl < minLvl ){ - lvl = minLvl; - } else if( zoom >= maxZoom || lvl > maxLvl ){ - return null; - } - - var scale = Math.pow( 2, lvl ); - var eleScaledH = bb.h * scale; - var eleScaledW = bb.w * scale; - var caches = rs.imgCaches = rs.imgCaches || {}; - var eleCache = caches[lvl]; - - if( eleCache ){ - return eleCache; - } - - var txrH; // which texture height this ele belongs to - - if( eleScaledH <= minTxrH ){ - txrH = minTxrH; - } else if( eleScaledH <= txrStepH ){ - txrH = txrStepH; - } else { - txrH = Math.ceil( eleScaledH / txrStepH ) * txrStepH; - } - - if( - eleScaledH > maxTxrH - || eleScaledW > maxTxrW - || ( !allowEdgeTxrCaching && ele.isEdge() ) - || ( !allowParentTxrCaching && ele.isParent() ) - ){ - return null; // caching large elements is not efficient - } - - var txrQ = self.getTextureQueue( txrH ); - - // first try the second last one in case it has space at the end - var txr = txrQ[ txrQ.length - 2 ]; - - var addNewTxr = function(){ - return self.recycleTexture( txrH, eleScaledW ) || self.addTexture( txrH, eleScaledW ); - }; - - // try the last one if there is no second last one - if( !txr ){ - txr = txrQ[ txrQ.length - 1 ]; - } - - // if the last one doesn't exist, we need a first one - if( !txr ){ - txr = addNewTxr(); - } - - // if there's no room in the current texture, we need a new one - if( txr.width - txr.usedWidth < eleScaledW ){ - txr = addNewTxr(); - } - - var scaledLabelShown = r.eleTextBiggerThanMin( ele, scale ); - var scalableFrom = function( otherCache ){ - return otherCache && otherCache.scaledLabelShown === scaledLabelShown; - }; - - var deqing = reason && reason === getTxrReasons.dequeue; - var highQualityReq = reason && reason === getTxrReasons.highQuality; - var downscaleReq = reason && reason === getTxrReasons.downscale; - - var higherCache; // the nearest cache with a higher level - for( var l = lvl + 1; l <= maxLvl; l++ ){ - var c = caches[l]; - - if( c ){ higherCache = c; break; } - } - - var oneUpCache = higherCache && higherCache.level === lvl + 1 ? higherCache : null; - - var downscale = function(){ - txr.context.drawImage( - oneUpCache.texture.canvas, - oneUpCache.x, 0, - oneUpCache.width, oneUpCache.height, - txr.usedWidth, 0, - eleScaledW, eleScaledH - ); - }; - - // reset ele area in texture - txr.context.setTransform( 1, 0, 0, 1, 0, 0 ); - txr.context.clearRect( txr.usedWidth, 0, eleScaledW, txrH ); - - if( scalableFrom(oneUpCache) ){ - // then we can relatively cheaply rescale the existing image w/o rerendering - downscale(); - - } else if( scalableFrom(higherCache) ){ - // then use the higher cache for now and queue the next level down - // to cheaply scale towards the smaller level - - if( highQualityReq ){ - for( var l = higherCache.level; l > lvl; l-- ){ - oneUpCache = self.getElement( ele, bb, pxRatio, l, getTxrReasons.downscale ); - } - - downscale(); - - } else { - self.queueElement( ele, higherCache.level - 1 ); - - return higherCache; - } - } else { - - var lowerCache; // the nearest cache with a lower level - if( !deqing && !highQualityReq && !downscaleReq ){ - for( var l = lvl - 1; l >= minLvl; l-- ){ - var c = caches[l]; - - if( c ){ lowerCache = c; break; } - } - } - - if( scalableFrom(lowerCache) ){ - // then use the lower quality cache for now and queue the better one for later - - self.queueElement( ele, lvl ); - - return lowerCache; - } - - txr.context.translate( txr.usedWidth, 0 ); - txr.context.scale( scale, scale ); - - r.drawElement( txr.context, ele, bb, scaledLabelShown ); - - txr.context.scale( 1/scale, 1/scale ); - txr.context.translate( -txr.usedWidth, 0 ); - } - - eleCache = caches[lvl] = { - ele: ele, - x: txr.usedWidth, - texture: txr, - level: lvl, - scale: scale, - width: eleScaledW, - height: eleScaledH, - scaledLabelShown: scaledLabelShown - }; - - txr.usedWidth += Math.ceil( eleScaledW + eleTxrSpacing ); - - txr.eleCaches.push( eleCache ); - - self.checkTextureFullness( txr ); - - return eleCache; -}; - -ETCp.invalidateElement = function( ele ){ - var self = this; - var caches = ele._private.rscratch.imgCaches; - - if( caches ){ - for( var lvl = minLvl; lvl <= maxLvl; lvl++ ){ - var cache = caches[ lvl ]; - - if( cache ){ - var txr = cache.texture; - - // remove space from the texture it belongs to - txr.invalidatedWidth += cache.width; - - // remove refs with the element - caches[ lvl ] = null; - util.removeFromArray( txr.eleCaches, cache ); - - // remove from queue since the old req was for the old state - self.removeFromQueue( ele ); - - // might have to remove the entire texture if it's not efficiently using its space - self.checkTextureUtility( txr ); - } - } - } -}; - -ETCp.checkTextureUtility = function( txr ){ - // invalidate all entries in the cache if the cache size is small - if( txr.invalidatedWidth >= minUtility * txr.width ){ - this.retireTexture( txr ); - } -}; - -ETCp.checkTextureFullness = function( txr ){ - // if texture has been mostly filled and passed over several times, remove - // it from the queue so we don't need to waste time looking at it to put new things - - var self = this; - var txrQ = self.getTextureQueue( txr.height ); - - if( txr.usedWidth / txr.width > maxFullness && txr.fullnessChecks >= maxFullnessChecks ){ - util.removeFromArray( txrQ, txr ); - } else { - txr.fullnessChecks++; - } -}; - -ETCp.retireTexture = function( txr ){ - var self = this; - var txrH = txr.height; - var txrQ = self.getTextureQueue( txrH ); - - // retire the texture from the active / searchable queue: - - util.removeFromArray( txrQ, txr ); - - txr.retired = true; - - // remove the refs from the eles to the caches: - - var eleCaches = txr.eleCaches; - - for( var i = 0; i < eleCaches.length; i++ ){ - var eleCache = eleCaches[i]; - var ele = eleCache.ele; - var lvl = eleCache.level; - var imgCaches = ele._private.rscratch.imgCaches; - - if( imgCaches ){ - imgCaches[ lvl ] = null; - } - } - - util.clearArray( eleCaches ); - - // add the texture to a retired queue so it can be recycled in future: - - var rtxtrQ = self.getRetiredTextureQueue( txrH ); - - rtxtrQ.push( txr ); -}; - -ETCp.addTexture = function( txrH, minW ){ - var self = this; - var txrQ = self.getTextureQueue( txrH ); - var txr = {}; - - txrQ.push( txr ); - - txr.eleCaches = []; - - txr.height = txrH; - txr.width = Math.max( defTxrWidth, minW ); - txr.usedWidth = 0; - txr.invalidatedWidth = 0; - txr.fullnessChecks = 0; - - txr.canvas = document.createElement('canvas'); // eslint-disable-line no-undef - txr.canvas.width = txr.width; - txr.canvas.height = txr.height; - - txr.context = txr.canvas.getContext('2d'); - - return txr; -}; - -ETCp.recycleTexture = function( txrH, minW ){ - var self = this; - var txrQ = self.getTextureQueue( txrH ); - var rtxtrQ = self.getRetiredTextureQueue( txrH ); - - for( var i = 0; i < rtxtrQ.length; i++ ){ - var txr = rtxtrQ[i]; - - if( txr.width >= minW ){ - txr.retired = false; - - txr.usedWidth = 0; - txr.invalidatedWidth = 0; - txr.fullnessChecks = 0; - - util.clearArray( txr.eleCaches ); - - txr.context.setTransform( 1, 0, 0, 1, 0, 0 ); - txr.context.clearRect( 0, 0, txr.width, txr.height ); - - util.removeFromArray( rtxtrQ, txr ); - txrQ.push( txr ); - - return txr; - } - } -}; - -ETCp.queueElement = function( ele, lvl ){ - var self = this; - var q = self.getElementQueue(); - var id2q = self.getElementIdToQueue(); - var id = ele.id(); - var existingReq = id2q[ id ]; - - if( existingReq ){ // use the max lvl b/c in between lvls are cheap to make - existingReq.level = Math.max( existingReq.level, lvl ); - existingReq.reqs++; - - q.updateItem( existingReq ); - } else { - var req = { - ele: ele, - level: lvl, - reqs: 1 - }; - - q.push( req ); - - id2q[ id ] = req; - } -}; - -ETCp.dequeue = function( pxRatio /*, extent*/ ){ - var self = this; - var q = self.getElementQueue(); - var id2q = self.getElementIdToQueue(); - var dequeued = []; - - for( var i = 0; i < maxDeqSize; i++ ){ - if( q.size() > 0 ){ - var req = q.pop(); - var ele = req.ele; - var caches = ele._private.rscratch.imgCaches; - - // dequeueing isn't necessary when an existing cache exists - if( caches[ req.level ] != null ){ - continue; - } - - id2q[ ele.id() ] = null; - - dequeued.push( req ); - - var bb = ele.boundingBox(); - - self.getElement( ele, bb, pxRatio, req.level, getTxrReasons.dequeue ); - } else { - break; - } - } - - return dequeued; -}; - -ETCp.removeFromQueue = function( ele ){ - var self = this; - var q = self.getElementQueue(); - var id2q = self.getElementIdToQueue(); - var req = id2q[ ele.id() ]; - - if( req != null ){ - // bring to front of queue - req.reqs = util.MAX_INT; - q.updateItem( req ); - - q.pop(); // remove from queue - - id2q[ ele.id() ] = null; // remove from lookup map - } -}; - -ETCp.onDequeue = function( fn ){ this.onDequeues.push( fn ); }; -ETCp.offDequeue = function( fn ){ util.removeFromArray( this.onDequeues, fn ); }; - -ETCp.setupDequeueing = defs.setupDequeueing({ - deqRedrawThreshold: deqRedrawThreshold, - deqCost: deqCost, - deqAvgCost: deqAvgCost, - deqNoDrawCost: deqNoDrawCost, - deqFastCost: deqFastCost, - deq: function( self, pxRatio, extent ){ - return self.dequeue( pxRatio, extent ); - }, - onDeqd: function( self, deqd ){ - for( var i = 0; i < self.onDequeues.length; i++ ){ - var fn = self.onDequeues[i]; - - fn( deqd ); - } - }, - shouldRedraw: function( self, deqd, pxRatio, extent ){ - for( var i = 0; i < deqd.length; i++ ){ - var bb = deqd[i].ele.boundingBox(); - - if( math.boundingBoxesIntersect( bb, extent ) ){ - return true; - } - } - - return false; - }, - priority: function( self ){ - return self.renderer.beforeRenderPriorities.eleTxrDeq; - } -}); - -module.exports = ElementTextureCache; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/export-image.js b/node_modules/cytoscape/src/extensions/renderer/canvas/export-image.js deleted file mode 100644 index 64763e557..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/canvas/export-image.js +++ /dev/null @@ -1,154 +0,0 @@ -var is = require( '../../../is' ); - -var CRp = {}; - -CRp.createBuffer = function( w, h ){ - var buffer = document.createElement( 'canvas' ); // eslint-disable-line no-undef - buffer.width = w; - buffer.height = h; - - return [ buffer, buffer.getContext( '2d' ) ]; -}; - -CRp.bufferCanvasImage = function( options ){ - var cy = this.cy; - var eles = cy.mutableElements(); - var bb = eles.boundingBox(); - var ctrRect = this.findContainerClientCoords(); - var width = options.full ? Math.ceil( bb.w ) : ctrRect[2]; - var height = options.full ? Math.ceil( bb.h ) : ctrRect[3]; - var specdMaxDims = is.number( options.maxWidth ) || is.number( options.maxHeight ); - var pxRatio = this.getPixelRatio(); - var scale = 1; - - if( options.scale !== undefined ){ - width *= options.scale; - height *= options.scale; - - scale = options.scale; - } else if( specdMaxDims ){ - var maxScaleW = Infinity; - var maxScaleH = Infinity; - - if( is.number( options.maxWidth ) ){ - maxScaleW = scale * options.maxWidth / width; - } - - if( is.number( options.maxHeight ) ){ - maxScaleH = scale * options.maxHeight / height; - } - - scale = Math.min( maxScaleW, maxScaleH ); - - width *= scale; - height *= scale; - } - - if( !specdMaxDims ){ - width *= pxRatio; - height *= pxRatio; - scale *= pxRatio; - } - - var buffCanvas = document.createElement( 'canvas' ); // eslint-disable-line no-undef - - buffCanvas.width = width; - buffCanvas.height = height; - - buffCanvas.style.width = width + 'px'; - buffCanvas.style.height = height + 'px'; - - var buffCxt = buffCanvas.getContext( '2d' ); - - // Rasterize the layers, but only if container has nonzero size - if( width > 0 && height > 0 ){ - - buffCxt.clearRect( 0, 0, width, height ); - - buffCxt.globalCompositeOperation = 'source-over'; - - var zsortedEles = this.getCachedZSortedEles(); - - if( options.full ){ // draw the full bounds of the graph - buffCxt.translate( -bb.x1 * scale, -bb.y1 * scale ); - buffCxt.scale( scale, scale ); - - this.drawElements( buffCxt, zsortedEles ); - - buffCxt.scale( 1/scale, 1/scale ); - buffCxt.translate( bb.x1 * scale, bb.y1 * scale ); - } else { // draw the current view - var pan = cy.pan(); - - var translation = { - x: pan.x * scale, - y: pan.y * scale - }; - - scale *= cy.zoom(); - - buffCxt.translate( translation.x, translation.y ); - buffCxt.scale( scale, scale ); - - this.drawElements( buffCxt, zsortedEles ); - - buffCxt.scale( 1/scale, 1/scale ); - buffCxt.translate( -translation.x, -translation.y ); - } - - // need to fill bg at end like this in order to fill cleared transparent pixels in jpgs - if( options.bg ){ - buffCxt.globalCompositeOperation = 'destination-over'; - - buffCxt.fillStyle = options.bg; - buffCxt.rect( 0, 0, width, height ); - buffCxt.fill(); - } - } - - return buffCanvas; -}; - -function b64ToBlob( b64, mimeType ){ - var bytes = atob( b64 ); - var buff = new ArrayBuffer( bytes.length ); - var buffUint8 = new Uint8Array( buff ); - - for( var i = 0; i < bytes.length; i++ ){ - buffUint8[i] = bytes.charCodeAt(i); - } - - return new Blob( [buff], { type: mimeType } ); -} - -function b64UriToB64( b64uri ){ - var i = b64uri.indexOf(','); - - return b64uri.substr( i + 1 ); -}; - -function output( options, canvas, mimeType ){ - var b64Uri = canvas.toDataURL( mimeType, options.quality ); - - switch( options.output ){ - case 'blob': - return b64ToBlob( b64UriToB64( b64Uri ), mimeType ); - - case 'base64': - return b64UriToB64( b64Uri ); - - case 'base64uri': - default: - return b64Uri; - } -} - -CRp.png = function( options ){ - return output( options, this.bufferCanvasImage( options ), 'image/png' ); -}; - -CRp.jpg = function( options ){ - return output( options, this.bufferCanvasImage( options ), 'image/jpeg' ); -}; - -module.exports = CRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/index.js b/node_modules/cytoscape/src/extensions/renderer/canvas/index.js deleted file mode 100644 index 509325d82..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/canvas/index.js +++ /dev/null @@ -1,171 +0,0 @@ -/* -The canvas renderer was written by Yue Dong. - -Modifications tracked on Github. -*/ - -var util = require( '../../../util' ); -var is = require( '../../../is' ); -var ElementTextureCache = require('./ele-texture-cache'); -var LayeredTextureCache = require('./layered-texture-cache'); - -var CR = CanvasRenderer; -var CRp = CanvasRenderer.prototype; - -CRp.CANVAS_LAYERS = 3; -// -CRp.SELECT_BOX = 0; -CRp.DRAG = 1; -CRp.NODE = 2; - -CRp.BUFFER_COUNT = 3; -// -CRp.TEXTURE_BUFFER = 0; -CRp.MOTIONBLUR_BUFFER_NODE = 1; -CRp.MOTIONBLUR_BUFFER_DRAG = 2; - -function CanvasRenderer( options ){ - var r = this; - - r.data = { - canvases: new Array( CRp.CANVAS_LAYERS ), - contexts: new Array( CRp.CANVAS_LAYERS ), - canvasNeedsRedraw: new Array( CRp.CANVAS_LAYERS ), - - bufferCanvases: new Array( CRp.BUFFER_COUNT ), - bufferContexts: new Array( CRp.CANVAS_LAYERS ), - }; - - var tapHlOff = '-webkit-tap-highlight-color: rgba(0,0,0,0);'; - - r.data.canvasContainer = document.createElement( 'div' ); // eslint-disable-line no-undef - var containerStyle = r.data.canvasContainer.style; - r.data.canvasContainer.setAttribute( 'style', tapHlOff ); - containerStyle.position = 'relative'; - containerStyle.zIndex = '0'; - containerStyle.overflow = 'hidden'; - - var container = options.cy.container(); - container.appendChild( r.data.canvasContainer ); - - if( (container.getAttribute('style') || '').indexOf(tapHlOff) < 0 ){ - container.setAttribute( 'style', ( container.getAttribute( 'style' ) || '' ) + tapHlOff ); - } - - for( var i = 0; i < CRp.CANVAS_LAYERS; i++ ){ - var canvas = r.data.canvases[ i ] = document.createElement( 'canvas' ); // eslint-disable-line no-undef - r.data.contexts[ i ] = canvas.getContext( '2d' ); - canvas.setAttribute( 'style', '-webkit-user-select: none; -moz-user-select: -moz-none; user-select: none; -webkit-tap-highlight-color: rgba(0,0,0,0); outline-style: none;' + ( is.ms() ? ' -ms-touch-action: none; touch-action: none; ' : '' ) ); - canvas.style.position = 'absolute'; - canvas.setAttribute( 'data-id', 'layer' + i ); - canvas.style.zIndex = String( CRp.CANVAS_LAYERS - i ); - r.data.canvasContainer.appendChild( canvas ); - - r.data.canvasNeedsRedraw[ i ] = false; - } - r.data.topCanvas = r.data.canvases[0]; - - r.data.canvases[ CRp.NODE ].setAttribute( 'data-id', 'layer' + CRp.NODE + '-node' ); - r.data.canvases[ CRp.SELECT_BOX ].setAttribute( 'data-id', 'layer' + CRp.SELECT_BOX + '-selectbox' ); - r.data.canvases[ CRp.DRAG ].setAttribute( 'data-id', 'layer' + CRp.DRAG + '-drag' ); - - for( var i = 0; i < CRp.BUFFER_COUNT; i++ ){ - r.data.bufferCanvases[ i ] = document.createElement( 'canvas' ); // eslint-disable-line no-undef - r.data.bufferContexts[ i ] = r.data.bufferCanvases[ i ].getContext( '2d' ); - r.data.bufferCanvases[ i ].style.position = 'absolute'; - r.data.bufferCanvases[ i ].setAttribute( 'data-id', 'buffer' + i ); - r.data.bufferCanvases[ i ].style.zIndex = String( -i - 1 ); - r.data.bufferCanvases[ i ].style.visibility = 'hidden'; - //r.data.canvasContainer.appendChild(r.data.bufferCanvases[i]); - } - - r.pathsEnabled = true; - - r.data.eleTxrCache = new ElementTextureCache( r ); - r.data.lyrTxrCache = new LayeredTextureCache( r, r.data.eleTxrCache ); - - r.onUpdateEleCalcs(function invalidateTextureCaches( willDraw, eles ){ - for( var i = 0; i < eles.length; i++ ){ - var ele = eles[i]; - var rs = ele._private.rstyle; - var de = rs.dirtyEvents; - - if( ele.isNode() && de && de.length === 1 && de['position'] ){ - // then keep cached ele texture - } else { - r.data.eleTxrCache.invalidateElement( ele ); - - // NB this block of code should not be ported to 3.3 (unstable branch). - // - This check is unneccesary in 3.3 as caches will be stored without respect to opacity. - // - This fix may result in lowered performance for compound graphs. - // - Ref : Opacity of child node is not updated for certain zoom levels after parent opacity is overriden #2078 - if( ele.isParent() && de['style'] ){ - var op1 = rs.prevParentOpacity; - var op2 = ele.pstyle('opacity').pfValue; - - rs.prevParentOpacity = op2; - - if( op1 !== op2 ){ - var descs = ele.descendants(); - - for( var j = 0; j < descs.length; j++ ){ - r.data.eleTxrCache.invalidateElement( descs[j] ); - } - } - } - } - } - - if( eles.length > 0 ){ - r.data.lyrTxrCache.invalidateElements( eles ); - } - }); -} - -CRp.redrawHint = function( group, bool ){ - var r = this; - - switch( group ){ - case 'eles': - r.data.canvasNeedsRedraw[ CRp.NODE ] = bool; - break; - case 'drag': - r.data.canvasNeedsRedraw[ CRp.DRAG ] = bool; - break; - case 'select': - r.data.canvasNeedsRedraw[ CRp.SELECT_BOX ] = bool; - break; - } -}; - -// whether to use Path2D caching for drawing -var pathsImpld = typeof Path2D !== 'undefined'; - -CRp.path2dEnabled = function( on ){ - if( on === undefined ){ - return this.pathsEnabled; - } - - this.pathsEnabled = on ? true : false; -}; - -CRp.usePaths = function(){ - return pathsImpld && this.pathsEnabled; -}; - -[ - require( './arrow-shapes' ), - require( './drawing-elements' ), - require( './drawing-edges' ), - require( './drawing-images' ), - require( './drawing-label-text' ), - require( './drawing-nodes' ), - require( './drawing-redraw' ), - require( './drawing-shapes' ), - require( './export-image' ), - require( './node-shapes' ) -].forEach( function( props ){ - util.extend( CRp, props ); -} ); - -module.exports = CR; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/layered-texture-cache.js b/node_modules/cytoscape/src/extensions/renderer/canvas/layered-texture-cache.js deleted file mode 100644 index 6d46b4075..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/canvas/layered-texture-cache.js +++ /dev/null @@ -1,686 +0,0 @@ -var util = require( '../../../util' ); -var math = require( '../../../math' ); -var Heap = require( '../../../heap' ); -var is = require( '../../../is' ); -var defs = require( './texture-cache-defs' ); - -var defNumLayers = 1; // default number of layers to use -var minLvl = -4; // when scaling smaller than that we don't need to re-render -var maxLvl = 2; // when larger than this scale just render directly (caching is not helpful) -var maxZoom = 3.99; // beyond this zoom level, layered textures are not used -var deqRedrawThreshold = 50; // time to batch redraws together from dequeueing to allow more dequeueing calcs to happen in the meanwhile -var refineEleDebounceTime = 50; // time to debounce sharper ele texture updates -var disableEleImgSmoothing = true; // when drawing eles on layers from an ele cache ; crisper and more performant when true -var deqCost = 0.15; // % of add'l rendering cost allowed for dequeuing ele caches each frame -var deqAvgCost = 0.1; // % of add'l rendering cost compared to average overall redraw time -var deqNoDrawCost = 0.9; // % of avg frame time that can be used for dequeueing when not drawing -var deqFastCost = 0.9; // % of frame time to be used when >60fps -var maxDeqSize = 1; // number of eles to dequeue and render at higher texture in each batch -var invalidThreshold = 250; // time threshold for disabling b/c of invalidations -var maxLayerArea = 4000 * 4000; // layers can't be bigger than this -var alwaysQueue = true; // never draw all the layers in a level on a frame; draw directly until all dequeued -var useHighQualityEleTxrReqs = true; // whether to use high quality ele txr requests (generally faster and cheaper in the longterm) - -var useEleTxrCaching = true; // whether to use individual ele texture caching underneath this cache - -// var log = function(){ console.log.apply( console, arguments ); }; - -var LayeredTextureCache = function( renderer, eleTxrCache ){ - var self = this; - - var r = self.renderer = renderer; - - self.layersByLevel = {}; // e.g. 2 => [ layer1, layer2, ..., layerN ] - - self.firstGet = true; - - self.lastInvalidationTime = util.performanceNow() - 2*invalidThreshold; - - self.skipping = false; - - r.beforeRender(function( willDraw, now ){ - if( now - self.lastInvalidationTime <= invalidThreshold ){ - self.skipping = true; - } else { - self.skipping = false; - } - }); - - var qSort = function(a, b){ - return b.reqs - a.reqs; - }; - - self.layersQueue = new Heap( qSort ); - - self.eleTxrCache = eleTxrCache; - - self.setupEleCacheInvalidation(); - - self.setupDequeueing(); -}; - -var LTCp = LayeredTextureCache.prototype; - -var layerIdPool = 0; -var MAX_INT = Math.pow(2, 53) - 1; - -LTCp.makeLayer = function( bb, lvl ){ - var scale = Math.pow( 2, lvl ); - - var w = Math.ceil( bb.w * scale ); - var h = Math.ceil( bb.h * scale ); - - var canvas = document.createElement('canvas'); // eslint-disable-line no-undef - - canvas.width = w; - canvas.height = h; - - var layer = { - id: (layerIdPool = ++layerIdPool % MAX_INT ), - bb: bb, - level: lvl, - width: w, - height: h, - canvas: canvas, - context: canvas.getContext('2d'), - eles: [], - elesQueue: [], - reqs: 0 - }; - - // log('make layer %s with w %s and h %s and lvl %s', layer.id, layer.width, layer.height, layer.level); - - var cxt = layer.context; - var dx = -layer.bb.x1; - var dy = -layer.bb.y1; - - // do the transform on creation to save cycles (it's the same for all eles) - cxt.scale( scale, scale ); - cxt.translate( dx, dy ); - - return layer; -}; - -LTCp.getLayers = function( eles, pxRatio, lvl ){ - var self = this; - var r = self.renderer; - var cy = r.cy; - var zoom = cy.zoom(); - var firstGet = self.firstGet; - - self.firstGet = false; - - // log('--\nget layers with %s eles', eles.length); - //log eles.map(function(ele){ return ele.id() }) ); - - if( lvl == null ){ - lvl = Math.ceil( math.log2( zoom * pxRatio ) ); - - if( lvl < minLvl ){ - lvl = minLvl; - } else if( zoom >= maxZoom || lvl > maxLvl ){ - return null; - } - } - - self.validateLayersElesOrdering( lvl, eles ); - - var layersByLvl = self.layersByLevel; - var scale = Math.pow( 2, lvl ); - var layers = layersByLvl[ lvl ] = layersByLvl[ lvl ] || []; - var bb; - - var lvlComplete = self.levelIsComplete( lvl, eles ); - var tmpLayers; - - var checkTempLevels = function(){ - var canUseAsTmpLvl = function( l ){ - self.validateLayersElesOrdering( l, eles ); - - if( self.levelIsComplete( l, eles ) ){ - tmpLayers = layersByLvl[l]; - return true; - } - }; - - var checkLvls = function( dir ){ - if( tmpLayers ){ return; } - - for( var l = lvl + dir; minLvl <= l && l <= maxLvl; l += dir ){ - if( canUseAsTmpLvl(l) ){ break; } - } - }; - - checkLvls( +1 ); - checkLvls( -1 ); - - // remove the invalid layers; they will be replaced as needed later in this function - for( var i = layers.length - 1; i >= 0; i-- ){ - var layer = layers[i]; - - if( layer.invalid ){ - util.removeFromArray( layers, layer ); - } - } - }; - - if( !lvlComplete ){ - // if the current level is incomplete, then use the closest, best quality layerset temporarily - // and later queue the current layerset so we can get the proper quality level soon - - checkTempLevels(); - - } else { - // log('level complete, using existing layers\n--'); - return layers; - } - - var getBb = function(){ - if( !bb ){ - bb = math.makeBoundingBox(); - - for( var i = 0; i < eles.length; i++ ){ - math.updateBoundingBox( bb, eles[i].boundingBox() ); - } - } - - return bb; - }; - - var makeLayer = function( opts ){ - opts = opts || {}; - - var after = opts.after; - - getBb(); - - var area = ( bb.w * scale ) * ( bb.h * scale ); - - if( area > maxLayerArea ){ - return null; - } - - var layer = self.makeLayer( bb, lvl ); - - if( after != null ){ - var index = layers.indexOf( after ) + 1; - - layers.splice( index, 0, layer ); - } else if( opts.insert === undefined || opts.insert ){ - // no after specified => first layer made so put at start - layers.unshift( layer ); - } - - // if( tmpLayers ){ - //self.queueLayer( layer ); - // } - - return layer; - }; - - if( self.skipping && !firstGet ){ - // log('skip layers'); - return null; - } - - // log('do layers'); - - var layer = null; - var maxElesPerLayer = eles.length / defNumLayers; - var allowLazyQueueing = alwaysQueue && !firstGet; - - for( var i = 0; i < eles.length; i++ ){ - var ele = eles[i]; - var rs = ele._private.rscratch; - var caches = rs.imgLayerCaches = rs.imgLayerCaches || {}; - - // log('look at ele', ele.id()); - - var existingLayer = caches[ lvl ]; - - if( existingLayer ){ - // reuse layer for later eles - // log('reuse layer for', ele.id()); - layer = existingLayer; - continue; - } - - if( - !layer - || layer.eles.length >= maxElesPerLayer - || !math.boundingBoxInBoundingBox( layer.bb, ele.boundingBox() ) - ){ - // log('make new layer for ele %s', ele.id()); - - layer = makeLayer({ insert: true, after: layer }); - - // if now layer can be built then we can't use layers at this level - if( !layer ){ return null; } - - // log('new layer with id %s', layer.id); - } - - if( tmpLayers || allowLazyQueueing ){ - // log('queue ele %s in layer %s', ele.id(), layer.id); - self.queueLayer( layer, ele ); - } else { - // log('draw ele %s in layer %s', ele.id(), layer.id); - self.drawEleInLayer( layer, ele, lvl, pxRatio ); - } - - layer.eles.push( ele ); - - caches[ lvl ] = layer; - } - - // log('--'); - - if( tmpLayers ){ // then we only queued the current layerset and can't draw it yet - return tmpLayers; - } - - if( allowLazyQueueing ){ - // log('lazy queue level', lvl); - return null; - } - - return layers; -}; - -// a layer may want to use an ele cache of a higher level to avoid blurriness -// so the layer level might not equal the ele level -LTCp.getEleLevelForLayerLevel = function( lvl, pxRatio ){ - return lvl; -}; - -function imgSmoothing( context, bool ){ - if( context.imageSmoothingEnabled != null ){ - context.imageSmoothingEnabled = bool; - } else { - context.webkitImageSmoothingEnabled = bool; - context.mozImageSmoothingEnabled = bool; - context.msImageSmoothingEnabled = bool; - } -} - -LTCp.drawEleInLayer = function( layer, ele, lvl, pxRatio ){ - var self = this; - var r = this.renderer; - var context = layer.context; - var bb = ele.boundingBox(); - - if( bb.w === 0 || bb.h === 0 || !ele.visible() ){ return; } - - var eleCache = self.eleTxrCache; - var reason = useHighQualityEleTxrReqs ? eleCache.reasons.highQuality : undefined; - - lvl = self.getEleLevelForLayerLevel( lvl, pxRatio ); - - var cache = useEleTxrCaching ? eleCache.getElement( ele, bb, null, lvl, reason ) : null; - - if( cache ){ - if( disableEleImgSmoothing ){ imgSmoothing( context, false ); } - - context.drawImage( cache.texture.canvas, cache.x, 0, cache.width, cache.height, bb.x1, bb.y1, bb.w, bb.h ); - - if( disableEleImgSmoothing ){ imgSmoothing( context, true ); } - } else { // if the element is not cacheable, then draw directly - r.drawElement( context, ele ); - } -}; - -LTCp.levelIsComplete = function( lvl, eles ){ - var self = this; - var layers = self.layersByLevel[ lvl ]; - - if( !layers || layers.length === 0 ){ return false; } - - var numElesInLayers = 0; - - for( var i = 0; i < layers.length; i++ ){ - var layer = layers[i]; - - // if there are any eles needed to be drawn yet, the level is not complete - if( layer.reqs > 0 ){ return false; } - - // if the layer is invalid, the level is not complete - if( layer.invalid ){ return false; } - - numElesInLayers += layer.eles.length; - } - - // we should have exactly the number of eles passed in to be complete - if( numElesInLayers !== eles.length ){ return false; } - - return true; -}; - -LTCp.validateLayersElesOrdering = function( lvl, eles ){ - var layers = this.layersByLevel[ lvl ]; - - if( !layers ){ return; } - - // if in a layer the eles are not in the same order, then the layer is invalid - // (i.e. there is an ele in between the eles in the layer) - - for( var i = 0; i < layers.length; i++ ){ - var layer = layers[i]; - var offset = -1; - - // find the offset - for( var j = 0; j < eles.length; j++ ){ - if( layer.eles[0] === eles[j] ){ - offset = j; - break; - } - } - - if( offset < 0 ){ - // then the layer has nonexistant elements and is invalid - this.invalidateLayer( layer ); - continue; - } - - // the eles in the layer must be in the same continuous order, else the layer is invalid - - var o = offset; - - for( var j = 0; j < layer.eles.length; j++ ){ - if( layer.eles[j] !== eles[o+j] ){ - // log('invalidate based on ordering', layer.id); - - this.invalidateLayer( layer ); - break; - } - } - } -}; - -LTCp.updateElementsInLayers = function( eles, update ){ - var self = this; - var isEles = is.element( eles[0] ); - - // collect udpated elements (cascaded from the layers) and update each - // layer itself along the way - for( var i = 0; i < eles.length; i++ ){ - var req = isEles ? null : eles[i]; - var ele = isEles ? eles[i] : eles[i].ele; - var rs = ele._private.rscratch; - var caches = rs.imgLayerCaches = rs.imgLayerCaches || {}; - - for( var l = minLvl; l <= maxLvl; l++ ){ - var layer = caches[l]; - - if( !layer ){ continue; } - - // if update is a request from the ele cache, then it affects only - // the matching level - if( req && self.getEleLevelForLayerLevel( layer.level ) !== req.level ){ - continue; - } - - update( layer, ele, req ); - } - } -}; - -LTCp.haveLayers = function(){ - var self = this; - var haveLayers = false; - - for( var l = minLvl; l <= maxLvl; l++ ){ - var layers = self.layersByLevel[l]; - - if( layers && layers.length > 0 ){ - haveLayers = true; - break; - } - } - - return haveLayers; -}; - -LTCp.invalidateElements = function( eles ){ - var self = this; - - self.lastInvalidationTime = util.performanceNow(); - - // log('update invalidate layer time from eles'); - - if( eles.length === 0 || !self.haveLayers() ){ return; } - - self.updateElementsInLayers( eles, function invalAssocLayers( layer, ele, req ){ - self.invalidateLayer( layer ); - } ); -}; - -LTCp.invalidateLayer = function( layer ){ - // log('update invalidate layer time'); - - this.lastInvalidationTime = util.performanceNow(); - - if( layer.invalid ){ return; } // save cycles - - var lvl = layer.level; - var eles = layer.eles; - var layers = this.layersByLevel[ lvl ]; - - // log('invalidate layer', layer.id ); - - util.removeFromArray( layers, layer ); - // layer.eles = []; - - layer.elesQueue = []; - - layer.invalid = true; - - if( layer.replacement ){ - layer.replacement.invalid = true; - } - - for( var i = 0; i < eles.length; i++ ){ - var caches = eles[i]._private.rscratch.imgLayerCaches; - - if( caches ){ - caches[ lvl ] = null; - } - } -}; - -LTCp.refineElementTextures = function( eles ){ - var self = this; - - // log('refine', eles.length); - - self.updateElementsInLayers( eles, function refineEachEle( layer, ele, req ){ - var rLyr = layer.replacement; - - if( !rLyr ){ - rLyr = layer.replacement = self.makeLayer( layer.bb, layer.level ); - rLyr.replaces = layer; - rLyr.eles = layer.eles; - - // log('make replacement layer %s for %s with level %s', rLyr.id, layer.id, rLyr.level); - } - - if( !rLyr.reqs ){ - for( var i = 0; i < rLyr.eles.length; i++ ){ - self.queueLayer( rLyr, rLyr.eles[i] ); - } - - // log('queue replacement layer refinement', rLyr.id); - } - } ); -}; - -LTCp.setupEleCacheInvalidation = function(){ - var self = this; - var eleDeqs = []; - - if( !useEleTxrCaching ){ return; } - - var updatedElesInLayers = util.debounce( function(){ - self.refineElementTextures( eleDeqs ); - - eleDeqs = []; - }, refineEleDebounceTime ); - - self.eleTxrCache.onDequeue(function( reqs ){ - for( var i = 0; i < reqs.length; i++ ){ - eleDeqs.push( reqs[i] ); - } - - updatedElesInLayers(); - }); -}; - -LTCp.queueLayer = function( layer, ele ){ - var self = this; - var q = self.layersQueue; - var elesQ = layer.elesQueue; - var hasId = elesQ.hasId = elesQ.hasId || {}; - - // if a layer is going to be replaced, queuing is a waste of time - if( layer.replacement ){ return; } - - if( ele ){ - if( hasId[ ele.id() ] ){ - return; - } - - elesQ.push( ele ); - hasId[ ele.id() ] = true; - } - - if( layer.reqs ){ - layer.reqs++; - - q.updateItem( layer ); - } else { - layer.reqs = 1; - - q.push( layer ); - } -}; - -LTCp.dequeue = function( pxRatio ){ - var self = this; - var q = self.layersQueue; - var deqd = []; - var eleDeqs = 0; - - while( eleDeqs < maxDeqSize ){ - if( q.size() === 0 ){ break; } - - var layer = q.peek(); - - // if a layer has been or will be replaced, then don't waste time with it - if( layer.replacement ){ - // log('layer %s in queue skipped b/c it already has a replacement', layer.id); - q.pop(); - continue; - } - - // if this is a replacement layer that has been superceded, then forget it - if( layer.replaces && layer !== layer.replaces.replacement ){ - // log('layer is no longer the most uptodate replacement; dequeued', layer.id) - q.pop(); - continue; - } - - if( layer.invalid ){ - // log('replacement layer %s is invalid; dequeued', layer.id); - q.pop(); - continue; - } - - var ele = layer.elesQueue.shift(); - - if( ele ){ - // log('dequeue layer %s', layer.id); - - self.drawEleInLayer( layer, ele, layer.level, pxRatio ); - - eleDeqs++; - } - - if( deqd.length === 0 ){ - // we need only one entry in deqd to queue redrawing etc - deqd.push( true ); - } - - // if the layer has all its eles done, then remove from the queue - if( layer.elesQueue.length === 0 ){ - q.pop(); - - layer.reqs = 0; - - // log('dequeue of layer %s complete', layer.id); - - // when a replacement layer is dequeued, it replaces the old layer in the level - if( layer.replaces ){ - self.applyLayerReplacement( layer ); - } - - self.requestRedraw(); - } - } - - return deqd; -}; - -LTCp.applyLayerReplacement = function( layer ){ - var self = this; - var layersInLevel = self.layersByLevel[ layer.level ]; - var replaced = layer.replaces; - var index = layersInLevel.indexOf( replaced ); - - // if the replaced layer is not in the active list for the level, then replacing - // refs would be a mistake (i.e. overwriting the true active layer) - if( index < 0 || replaced.invalid ){ - // log('replacement layer would have no effect', layer.id); - return; - } - - layersInLevel[ index ] = layer; // replace level ref - - // replace refs in eles - for( var i = 0; i < layer.eles.length; i++ ){ - var _p = layer.eles[i]._private; - var cache = _p.imgLayerCaches = _p.imgLayerCaches || {}; - - if( cache ){ - cache[ layer.level ] = layer; - } - } - - // log('apply replacement layer %s over %s', layer.id, replaced.id); - - self.requestRedraw(); -}; - -LTCp.requestRedraw = util.debounce( function(){ - var r = this.renderer; - - r.redrawHint( 'eles', true ); - r.redrawHint( 'drag', true ); - r.redraw(); -}, 100 ); - -LTCp.setupDequeueing = defs.setupDequeueing({ - deqRedrawThreshold: deqRedrawThreshold, - deqCost: deqCost, - deqAvgCost: deqAvgCost, - deqNoDrawCost: deqNoDrawCost, - deqFastCost: deqFastCost, - deq: function( self, pxRatio ){ - return self.dequeue( pxRatio ); - }, - onDeqd: util.noop, - shouldRedraw: util.trueify, - priority: function( self ){ - return self.renderer.beforeRenderPriorities.lyrTxrDeq; - } -}); - -module.exports = LayeredTextureCache; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/node-shapes.js b/node_modules/cytoscape/src/extensions/renderer/canvas/node-shapes.js deleted file mode 100644 index e23fbfd2e..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/canvas/node-shapes.js +++ /dev/null @@ -1,20 +0,0 @@ -var CRp = {}; - -CRp.nodeShapeImpl = function( name, context, centerX, centerY, width, height, points ){ - switch( name ){ - case 'ellipse': - return this.drawEllipsePath( context, centerX, centerY, width, height ); - case 'polygon': - return this.drawPolygonPath( context, centerX, centerY, width, height, points ); - case 'roundrectangle': - return this.drawRoundRectanglePath( context, centerX, centerY, width, height ); - case 'cutrectangle': - return this.drawCutRectanglePath( context, centerX, centerY, width, height ); - case 'bottomroundrectangle': - return this.drawBottomRoundRectanglePath( context, centerX, centerY, width, height ); - case 'barrel': - return this.drawBarrelPath( context, centerX, centerY, width, height ); - } -}; - -module.exports = CRp; diff --git a/node_modules/cytoscape/src/extensions/renderer/canvas/texture-cache-defs.js b/node_modules/cytoscape/src/extensions/renderer/canvas/texture-cache-defs.js deleted file mode 100644 index aa0564648..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/canvas/texture-cache-defs.js +++ /dev/null @@ -1,85 +0,0 @@ -var util = require( '../../../util' ); - -var fullFpsTime = 1000/60; // assume 60 frames per second - -module.exports = { - setupDequeueing: function( opts ){ - return function setupDequeueingImpl(){ - var self = this; - var r = this.renderer; - - if( self.dequeueingSetup ){ - return; - } else { - self.dequeueingSetup = true; - } - - var queueRedraw = util.debounce( function(){ - r.redrawHint( 'eles', true ); - r.redrawHint( 'drag', true ); - - r.redraw(); - }, opts.deqRedrawThreshold ); - - var dequeue = function( willDraw, frameStartTime ){ - var startTime = util.performanceNow(); - var avgRenderTime = r.averageRedrawTime; - var renderTime = r.lastRedrawTime; - var deqd = []; - var extent = r.cy.extent(); - var pixelRatio = r.getPixelRatio(); - - while( true ){ - var now = util.performanceNow(); - var duration = now - startTime; - var frameDuration = now - frameStartTime; - - if( renderTime < fullFpsTime ){ - // if we're rendering faster than the ideal fps, then do dequeueing - // during all of the remaining frame time - - var timeAvailable = fullFpsTime - ( willDraw ? avgRenderTime : 0 ); - - if( frameDuration >= opts.deqFastCost * timeAvailable ){ - break; - } - } else { - if( willDraw ){ - if( - duration >= opts.deqCost * renderTime - || duration >= opts.deqAvgCost * avgRenderTime - ){ - break; - } - } else if( frameDuration >= opts.deqNoDrawCost * fullFpsTime ){ - break; - } - } - - var thisDeqd = opts.deq( self, pixelRatio, extent ); - - if( thisDeqd.length > 0 ){ - for( var i = 0; i < thisDeqd.length; i++ ){ - deqd.push( thisDeqd[i] ); - } - } else { - break; - } - } - - // callbacks on dequeue - if( deqd.length > 0 ){ - opts.onDeqd( self, deqd ); - - if( !willDraw && opts.shouldRedraw( self, deqd, pixelRatio, extent ) ){ - queueRedraw(); - } - } - }; - - var priority = opts.priority || util.noop; - - r.beforeRender( dequeue, priority( self ) ); - }; - } -}; diff --git a/node_modules/cytoscape/src/extensions/renderer/index.js b/node_modules/cytoscape/src/extensions/renderer/index.js deleted file mode 100644 index 9bdbe08b9..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/index.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = [ - { name: 'null', impl: require( './null' ) }, - { name: 'base', impl: require( './base' ) }, - { name: 'canvas', impl: require( './canvas' ) } -]; diff --git a/node_modules/cytoscape/src/extensions/renderer/null/index.js b/node_modules/cytoscape/src/extensions/renderer/null/index.js deleted file mode 100644 index 6305e8168..000000000 --- a/node_modules/cytoscape/src/extensions/renderer/null/index.js +++ /dev/null @@ -1,14 +0,0 @@ -function NullRenderer( options ){ - this.options = options; - this.notifications = 0; // for testing -} - -let noop = function(){}; - -NullRenderer.prototype = { - recalculateRenderedStyle: noop, - notify: function(){ this.notifications++; }, - init: noop -}; - -module.exports = NullRenderer; diff --git a/node_modules/cytoscape/src/heap.js b/node_modules/cytoscape/src/heap.js deleted file mode 100644 index f71231bba..000000000 --- a/node_modules/cytoscape/src/heap.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('heap'); diff --git a/node_modules/cytoscape/src/index.js b/node_modules/cytoscape/src/index.js deleted file mode 100644 index 89e5449a6..000000000 --- a/node_modules/cytoscape/src/index.js +++ /dev/null @@ -1,40 +0,0 @@ -let is = require( './is' ); -let Core = require( './core' ); -let extension = require( './extension' ); -let Stylesheet = require( './stylesheet' ); - -let cytoscape = function( options ){ // jshint ignore:line - // if no options specified, use default - if( options === undefined ){ - options = {}; - } - - // create instance - if( is.plainObject( options ) ){ - return new Core( options ); - } - - // allow for registration of extensions - else if( is.string( options ) ){ - return extension.apply( extension, arguments ); - } -}; - -// e.g. cytoscape.use( require('cytoscape-foo'), bar ) -cytoscape.use = function( ext ){ - let args = Array.prototype.slice.call( arguments, 1 ); // args to pass to ext - - args.unshift( cytoscape ); // cytoscape is first arg to ext - - ext.apply( null, args ); - - return this; -}; - -// replaced by build system -cytoscape.version = require('./version'); - -// expose public apis (mostly for extensions) -cytoscape.stylesheet = cytoscape.Stylesheet = Stylesheet; - -module.exports = cytoscape; diff --git a/node_modules/cytoscape/src/is.js b/node_modules/cytoscape/src/is.js deleted file mode 100644 index 9a2bfdc9f..000000000 --- a/node_modules/cytoscape/src/is.js +++ /dev/null @@ -1,179 +0,0 @@ -/*global HTMLElement DocumentTouch */ - -let window = require( './window' ); -let navigator = window ? window.navigator : null; -let document = window ? window.document : null; - -let typeofstr = typeof ''; -let typeofobj = typeof {}; -let typeoffn = typeof function(){}; -let typeofhtmlele = typeof HTMLElement; - -let instanceStr = function( obj ){ - return obj && obj.instanceString && is.fn( obj.instanceString ) ? obj.instanceString() : null; -}; - -let is = { - defined: function( obj ){ - return obj != null; // not undefined or null - }, - - string: function( obj ){ - return obj != null && typeof obj == typeofstr; - }, - - fn: function( obj ){ - return obj != null && typeof obj === typeoffn; - }, - - array: function( obj ){ - return Array.isArray ? Array.isArray( obj ) : obj != null && obj instanceof Array; - }, - - plainObject: function( obj ){ - return obj != null && typeof obj === typeofobj && !is.array( obj ) && obj.constructor === Object; - }, - - object: function( obj ){ - return obj != null && typeof obj === typeofobj; - }, - - number: function( obj ){ - return obj != null && typeof obj === typeof 1 && !isNaN( obj ); - }, - - integer: function( obj ){ - return is.number( obj ) && Math.floor( obj ) === obj; - }, - - bool: function( obj ){ - return obj != null && typeof obj === typeof true; - }, - - htmlElement: function( obj ){ - if( 'undefined' === typeofhtmlele ){ - return undefined; - } else { - return null != obj && obj instanceof HTMLElement; - } - }, - - elementOrCollection: function( obj ){ - return is.element( obj ) || is.collection( obj ); - }, - - element: function( obj ){ - return instanceStr( obj ) === 'collection' && obj._private.single; - }, - - collection: function( obj ){ - return instanceStr( obj ) === 'collection' && !obj._private.single; - }, - - core: function( obj ){ - return instanceStr( obj ) === 'core'; - }, - - style: function( obj ){ - return instanceStr( obj ) === 'style'; - }, - - stylesheet: function( obj ){ - return instanceStr( obj ) === 'stylesheet'; - }, - - event: function( obj ){ - return instanceStr( obj ) === 'event'; - }, - - thread: function( obj ){ - return instanceStr( obj ) === 'thread'; - }, - - fabric: function( obj ){ - return instanceStr( obj ) === 'fabric'; - }, - - emptyString: function( obj ){ - if( obj === undefined || obj === null ){ // null is empty - return true; - } else if( obj === '' || obj.match( /^\s+$/ ) ){ - return true; // empty string is empty - } - - return false; // otherwise, we don't know what we've got - }, - - nonemptyString: function( obj ){ - if( obj && is.string( obj ) && obj !== '' && !obj.match( /^\s+$/ ) ){ - return true; - } - - return false; - }, - - domElement: function( obj ){ - if( typeof HTMLElement === 'undefined' ){ - return false; // we're not in a browser so it doesn't matter - } else { - return obj instanceof HTMLElement; - } - }, - - boundingBox: function( obj ){ - return is.plainObject( obj ) && - is.number( obj.x1 ) && is.number( obj.x2 ) && - is.number( obj.y1 ) && is.number( obj.y2 ) - ; - }, - - promise: function( obj ){ - return is.object( obj ) && is.fn( obj.then ); - }, - - touch: function(){ - return window && ( ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch ); - }, - - gecko: function(){ - return window && ( typeof InstallTrigger !== 'undefined' || ('MozAppearance' in document.documentElement.style) ); - }, - - webkit: function(){ - return window && ( typeof webkitURL !== 'undefined' || ('WebkitAppearance' in document.documentElement.style) ); - }, - - chromium: function(){ - return window && ( typeof chrome !== 'undefined' ); - }, - - khtml: function(){ - return navigator && navigator.vendor.match( /kde/i ); // probably a better way to detect this... - }, - - khtmlEtc: function(){ - return is.khtml() || is.webkit() || is.chromium(); - }, - - ms: function(){ - return navigator && navigator.userAgent.match( /msie|trident|edge/i ); // probably a better way to detect this... - }, - - windows: function(){ - return navigator && navigator.appVersion.match( /Win/i ); - }, - - mac: function(){ - return navigator && navigator.appVersion.match( /Mac/i ); - }, - - linux: function(){ - return navigator && navigator.appVersion.match( /Linux/i ); - }, - - unix: function(){ - return navigator && navigator.appVersion.match( /X11/i ); - } -}; - -module.exports = is; diff --git a/node_modules/cytoscape/src/map.js b/node_modules/cytoscape/src/map.js deleted file mode 100644 index 2693c8fa8..000000000 --- a/node_modules/cytoscape/src/map.js +++ /dev/null @@ -1,25 +0,0 @@ -function ObjectMap(){ - this._obj = {}; -} - -let p = ObjectMap.prototype; - -p.set = function( key, val ){ - this._obj[ key ] = val; -}; - -p.delete = function( key ){ - this._obj[ key ] = null; -}; - -p.has = function( key ){ - return this._obj[ key ] != null; -}; - -p.get = function( key ){ - return this._obj[ key ]; -}; - -// TODO use the stdlib Map in future... -// module.exports = typeof Map !== 'undefined' ? Map : ObjectMap; -module.exports = ObjectMap; diff --git a/node_modules/cytoscape/src/math.js b/node_modules/cytoscape/src/math.js deleted file mode 100644 index 51a758c2f..000000000 --- a/node_modules/cytoscape/src/math.js +++ /dev/null @@ -1,1109 +0,0 @@ -let math = {}; - -math.arePositionsSame = function( p1, p2 ){ - return p1.x === p2.x && p1.y === p2.y; -}; - -math.copyPosition = function( p ){ - return { x: p.x, y: p.y }; -}; - -math.modelToRenderedPosition = function( p, zoom, pan ){ - return { - x: p.x * zoom + pan.x, - y: p.y * zoom + pan.y - }; -}; - -math.renderedToModelPosition = function( p, zoom, pan ){ - return { - x: ( p.x - pan.x ) / zoom, - y: ( p.y - pan.y ) / zoom - }; -}; - -math.array2point = function( arr ){ - return { - x: arr[0], - y: arr[1] - }; -}; - -math.deg2rad = function( deg ){ - return Math.PI * deg / 180; -}; - -math.getAngleFromDisp = function( dispX, dispY ){ - return Math.atan2( dispY, dispX ) - Math.PI / 2; -}; - -math.log2 = Math.log2 || function( n ){ - return Math.log( n ) / Math.log( 2 ); -}; - -math.signum = function( x ){ - if( x > 0 ){ - return 1; - } else if( x < 0 ){ - return -1; - } else { - return 0; - } -}; - -math.dist = function( p1, p2 ){ - return Math.sqrt( math.sqdist( p1, p2 ) ); -}; - -math.sqdist = function( p1, p2 ){ - let dx = p2.x - p1.x; - let dy = p2.y - p1.y; - - return dx * dx + dy * dy; -}; - -// from http://en.wikipedia.org/wiki/Bézier_curve#Quadratic_curves -math.qbezierAt = function( p0, p1, p2, t ){ - return (1 - t) * (1 - t) * p0 + 2 * (1 - t) * t * p1 + t * t * p2; -}; - -math.qbezierPtAt = function( p0, p1, p2, t ){ - return { - x: math.qbezierAt( p0.x, p1.x, p2.x, t ), - y: math.qbezierAt( p0.y, p1.y, p2.y, t ) - }; -}; - -math.lineAt = function( p0, p1, t, d ){ - let vec = { - x: p1.x - p0.x, - y: p1.y - p0.y - }; - - let vecDist = math.dist( p0, p1 ); - - let normVec = { - x: vec.x / vecDist, - y: vec.y / vecDist - }; - - t = t == null ? 0 : t; - - d = d != null ? d : t * vecDist; - - return { - x: p0.x + normVec.x * d, - y: p0.y + normVec.y * d - }; -}; - -math.lineAtDist = function( p0, p1, d ){ - return math.lineAt( p0, p1, undefined, d ); -}; - -// get angle at A via cosine law -math.triangleAngle = function( A, B, C ){ - let a = math.dist( B, C ); - let b = math.dist( A, C ); - let c = math.dist( A, B ); - - return Math.acos( (a*a + b*b - c*c)/(2*a*b) ); -}; - -math.bound = function( min, val, max ){ - return Math.max( min, Math.min( max, val ) ); -}; - -// makes a full bb (x1, y1, x2, y2, w, h) from implicit params -math.makeBoundingBox = function( bb ){ - if( bb == null ){ - return { - x1: Infinity, - y1: Infinity, - x2: -Infinity, - y2: -Infinity, - w: 0, - h: 0 - }; - } else if( bb.x1 != null && bb.y1 != null ){ - if( bb.x2 != null && bb.y2 != null && bb.x2 >= bb.x1 && bb.y2 >= bb.y1 ){ - return { - x1: bb.x1, - y1: bb.y1, - x2: bb.x2, - y2: bb.y2, - w: bb.x2 - bb.x1, - h: bb.y2 - bb.y1 - }; - } else if( bb.w != null && bb.h != null && bb.w >= 0 && bb.h >= 0 ){ - return { - x1: bb.x1, - y1: bb.y1, - x2: bb.x1 + bb.w, - y2: bb.y1 + bb.h, - w: bb.w, - h: bb.h - }; - } - } -}; - -math.updateBoundingBox = function( bb1, bb2 ){ - // update bb1 with bb2 bounds - - bb1.x1 = Math.min( bb1.x1, bb2.x1 ); - bb1.x2 = Math.max( bb1.x2, bb2.x2 ); - bb1.w = bb1.x2 - bb1.x1; - - bb1.y1 = Math.min( bb1.y1, bb2.y1 ); - bb1.y2 = Math.max( bb1.y2, bb2.y2 ); - bb1.h = bb1.y2 - bb1.y1; -}; - -math.expandBoundingBoxByPoint = function( bb, x, y ){ - bb.x1 = Math.min( bb.x1, x ); - bb.x2 = Math.max( bb.x2, x ); - bb.w = bb.x2 - bb.x1; - - bb.y1 = Math.min( bb.y1, y ); - bb.y2 = Math.max( bb.y2, y ); - bb.h = bb.y2 - bb.y1; -}; - -math.expandBoundingBox = function( bb, padding ){ - bb.x1 -= padding; - bb.x2 += padding; - bb.y1 -= padding; - bb.y2 += padding; - bb.w = bb.x2 - bb.x1; - bb.h = bb.y2 - bb.y1; - - return bb; -}; - -math.boundingBoxesIntersect = function( bb1, bb2 ){ - // case: one bb to right of other - if( bb1.x1 > bb2.x2 ){ return false; } - if( bb2.x1 > bb1.x2 ){ return false; } - - // case: one bb to left of other - if( bb1.x2 < bb2.x1 ){ return false; } - if( bb2.x2 < bb1.x1 ){ return false; } - - // case: one bb above other - if( bb1.y2 < bb2.y1 ){ return false; } - if( bb2.y2 < bb1.y1 ){ return false; } - - // case: one bb below other - if( bb1.y1 > bb2.y2 ){ return false; } - if( bb2.y1 > bb1.y2 ){ return false; } - - // otherwise, must have some overlap - return true; -}; - -math.inBoundingBox = function( bb, x, y ){ - return bb.x1 <= x && x <= bb.x2 && bb.y1 <= y && y <= bb.y2; -}; - -math.pointInBoundingBox = function( bb, pt ){ - return this.inBoundingBox( bb, pt.x, pt.y ); -}; - -math.boundingBoxInBoundingBox = function( bb1, bb2 ){ - return ( - math.inBoundingBox( bb1, bb2.x1, bb2.y1 ) - && math.inBoundingBox( bb1, bb2.x2, bb2.y2 ) - ); -}; - -math.roundRectangleIntersectLine = function( - x, y, nodeX, nodeY, width, height, padding ){ - - let cornerRadius = this.getRoundRectangleRadius( width, height ); - - let halfWidth = width / 2; - let halfHeight = height / 2; - - // Check intersections with straight line segments - let straightLineIntersections; - - // Top segment, left to right - { - let topStartX = nodeX - halfWidth + cornerRadius - padding; - let topStartY = nodeY - halfHeight - padding; - let topEndX = nodeX + halfWidth - cornerRadius + padding; - let topEndY = topStartY; - - straightLineIntersections = this.finiteLinesIntersect( - x, y, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false ); - - if( straightLineIntersections.length > 0 ){ - return straightLineIntersections; - } - } - - // Right segment, top to bottom - { - let rightStartX = nodeX + halfWidth + padding; - let rightStartY = nodeY - halfHeight + cornerRadius - padding; - let rightEndX = rightStartX; - let rightEndY = nodeY + halfHeight - cornerRadius + padding; - - straightLineIntersections = this.finiteLinesIntersect( - x, y, nodeX, nodeY, rightStartX, rightStartY, rightEndX, rightEndY, false ); - - if( straightLineIntersections.length > 0 ){ - return straightLineIntersections; - } - } - - // Bottom segment, left to right - { - let bottomStartX = nodeX - halfWidth + cornerRadius - padding; - let bottomStartY = nodeY + halfHeight + padding; - let bottomEndX = nodeX + halfWidth - cornerRadius + padding; - let bottomEndY = bottomStartY; - - straightLineIntersections = this.finiteLinesIntersect( - x, y, nodeX, nodeY, bottomStartX, bottomStartY, bottomEndX, bottomEndY, false ); - - if( straightLineIntersections.length > 0 ){ - return straightLineIntersections; - } - } - - // Left segment, top to bottom - { - let leftStartX = nodeX - halfWidth - padding; - let leftStartY = nodeY - halfHeight + cornerRadius - padding; - let leftEndX = leftStartX; - let leftEndY = nodeY + halfHeight - cornerRadius + padding; - - straightLineIntersections = this.finiteLinesIntersect( - x, y, nodeX, nodeY, leftStartX, leftStartY, leftEndX, leftEndY, false ); - - if( straightLineIntersections.length > 0 ){ - return straightLineIntersections; - } - } - - // Check intersections with arc segments - let arcIntersections; - - // Top Left - { - let topLeftCenterX = nodeX - halfWidth + cornerRadius; - let topLeftCenterY = nodeY - halfHeight + cornerRadius; - arcIntersections = this.intersectLineCircle( - x, y, nodeX, nodeY, - topLeftCenterX, topLeftCenterY, cornerRadius + padding ); - - // Ensure the intersection is on the desired quarter of the circle - if( arcIntersections.length > 0 - && arcIntersections[0] <= topLeftCenterX - && arcIntersections[1] <= topLeftCenterY ){ - return [ arcIntersections[0], arcIntersections[1] ]; - } - } - - // Top Right - { - let topRightCenterX = nodeX + halfWidth - cornerRadius; - let topRightCenterY = nodeY - halfHeight + cornerRadius; - arcIntersections = this.intersectLineCircle( - x, y, nodeX, nodeY, - topRightCenterX, topRightCenterY, cornerRadius + padding ); - - // Ensure the intersection is on the desired quarter of the circle - if( arcIntersections.length > 0 - && arcIntersections[0] >= topRightCenterX - && arcIntersections[1] <= topRightCenterY ){ - return [ arcIntersections[0], arcIntersections[1] ]; - } - } - - // Bottom Right - { - let bottomRightCenterX = nodeX + halfWidth - cornerRadius; - let bottomRightCenterY = nodeY + halfHeight - cornerRadius; - arcIntersections = this.intersectLineCircle( - x, y, nodeX, nodeY, - bottomRightCenterX, bottomRightCenterY, cornerRadius + padding ); - - // Ensure the intersection is on the desired quarter of the circle - if( arcIntersections.length > 0 - && arcIntersections[0] >= bottomRightCenterX - && arcIntersections[1] >= bottomRightCenterY ){ - return [ arcIntersections[0], arcIntersections[1] ]; - } - } - - // Bottom Left - { - let bottomLeftCenterX = nodeX - halfWidth + cornerRadius; - let bottomLeftCenterY = nodeY + halfHeight - cornerRadius; - arcIntersections = this.intersectLineCircle( - x, y, nodeX, nodeY, - bottomLeftCenterX, bottomLeftCenterY, cornerRadius + padding ); - - // Ensure the intersection is on the desired quarter of the circle - if( arcIntersections.length > 0 - && arcIntersections[0] <= bottomLeftCenterX - && arcIntersections[1] >= bottomLeftCenterY ){ - return [ arcIntersections[0], arcIntersections[1] ]; - } - } - - return []; // if nothing -}; - -math.inLineVicinity = function( x, y, lx1, ly1, lx2, ly2, tolerance ){ - let t = tolerance; - - let x1 = Math.min( lx1, lx2 ); - let x2 = Math.max( lx1, lx2 ); - let y1 = Math.min( ly1, ly2 ); - let y2 = Math.max( ly1, ly2 ); - - return x1 - t <= x && x <= x2 + t - && y1 - t <= y && y <= y2 + t; -}; - -math.inBezierVicinity = function( - x, y, x1, y1, x2, y2, x3, y3, tolerance ){ - - let bb = { - x1: Math.min( x1, x3, x2 ) - tolerance, - x2: Math.max( x1, x3, x2 ) + tolerance, - y1: Math.min( y1, y3, y2 ) - tolerance, - y2: Math.max( y1, y3, y2 ) + tolerance - }; - - // if outside the rough bounding box for the bezier, then it can't be a hit - if( x < bb.x1 || x > bb.x2 || y < bb.y1 || y > bb.y2 ){ - // console.log('bezier out of rough bb') - return false; - } else { - // console.log('do more expensive check'); - return true; - } - -}; -math.solveQuadratic = function( a, b, c, val ){ - c -= val; - - var r = b * b - 4 * a * c; - - if( r < 0 ){ return []; } - - var sqrtR = Math.sqrt( r ); - var denom = 2 * a; - var root1 = ( -b + sqrtR ) / denom; - var root2 = ( -b - sqrtR ) / denom; - - return [ root1, root2 ]; -}; - -math.solveCubic = function( a, b, c, d, result ){ - - // Solves a cubic function, returns root in form [r1, i1, r2, i2, r3, i3], where - // r is the real component, i is the imaginary component - - // An implementation of the Cardano method from the year 1545 - // http://en.wikipedia.org/wiki/Cubic_function#The_nature_of_the_roots - - b /= a; - c /= a; - d /= a; - - let discriminant, q, r, dum1, s, t, term1, r13; - - q = (3.0 * c - (b * b)) / 9.0; - r = -(27.0 * d) + b * (9.0 * c - 2.0 * (b * b)); - r /= 54.0; - - discriminant = q * q * q + r * r; - result[1] = 0; - term1 = (b / 3.0); - - if( discriminant > 0 ){ - s = r + Math.sqrt( discriminant ); - s = ((s < 0) ? -Math.pow( -s, (1.0 / 3.0) ) : Math.pow( s, (1.0 / 3.0) )); - t = r - Math.sqrt( discriminant ); - t = ((t < 0) ? -Math.pow( -t, (1.0 / 3.0) ) : Math.pow( t, (1.0 / 3.0) )); - result[0] = -term1 + s + t; - term1 += (s + t) / 2.0; - result[4] = result[2] = -term1; - term1 = Math.sqrt( 3.0 ) * (-t + s) / 2; - result[3] = term1; - result[5] = -term1; - return; - } - - result[5] = result[3] = 0; - - if( discriminant === 0 ){ - r13 = ((r < 0) ? -Math.pow( -r, (1.0 / 3.0) ) : Math.pow( r, (1.0 / 3.0) )); - result[0] = -term1 + 2.0 * r13; - result[4] = result[2] = -(r13 + term1); - return; - } - - q = -q; - dum1 = q * q * q; - dum1 = Math.acos( r / Math.sqrt( dum1 ) ); - r13 = 2.0 * Math.sqrt( q ); - result[0] = -term1 + r13 * Math.cos( dum1 / 3.0 ); - result[2] = -term1 + r13 * Math.cos( (dum1 + 2.0 * Math.PI) / 3.0 ); - result[4] = -term1 + r13 * Math.cos( (dum1 + 4.0 * Math.PI) / 3.0 ); - - return; -}; - -math.sqdistToQuadraticBezier = function( - x, y, x1, y1, x2, y2, x3, y3 ){ - - // Find minimum distance by using the minimum of the distance - // function between the given point and the curve - - // This gives the coefficients of the resulting cubic equation - // whose roots tell us where a possible minimum is - // (Coefficients are divided by 4) - - let a = 1.0 * x1 * x1 - 4 * x1 * x2 + 2 * x1 * x3 + 4 * x2 * x2 - 4 * x2 * x3 + x3 * x3 - + y1 * y1 - 4 * y1 * y2 + 2 * y1 * y3 + 4 * y2 * y2 - 4 * y2 * y3 + y3 * y3; - - let b = 1.0 * 9 * x1 * x2 - 3 * x1 * x1 - 3 * x1 * x3 - 6 * x2 * x2 + 3 * x2 * x3 - + 9 * y1 * y2 - 3 * y1 * y1 - 3 * y1 * y3 - 6 * y2 * y2 + 3 * y2 * y3; - - let c = 1.0 * 3 * x1 * x1 - 6 * x1 * x2 + x1 * x3 - x1 * x + 2 * x2 * x2 + 2 * x2 * x - x3 * x - + 3 * y1 * y1 - 6 * y1 * y2 + y1 * y3 - y1 * y + 2 * y2 * y2 + 2 * y2 * y - y3 * y; - - let d = 1.0 * x1 * x2 - x1 * x1 + x1 * x - x2 * x - + y1 * y2 - y1 * y1 + y1 * y - y2 * y; - - // debug("coefficients: " + a / a + ", " + b / a + ", " + c / a + ", " + d / a); - - let roots = []; - - // Use the cubic solving algorithm - this.solveCubic( a, b, c, d, roots ); - - let zeroThreshold = 0.0000001; - - let params = []; - - for( let index = 0; index < 6; index += 2 ){ - if( Math.abs( roots[ index + 1] ) < zeroThreshold - && roots[ index ] >= 0 - && roots[ index ] <= 1.0 ){ - params.push( roots[ index ] ); - } - } - - params.push( 1.0 ); - params.push( 0.0 ); - - let minDistanceSquared = -1; - - let curX, curY, distSquared; - for( let i = 0; i < params.length; i++ ){ - curX = Math.pow( 1.0 - params[ i ], 2.0 ) * x1 - + 2.0 * (1 - params[ i ]) * params[ i ] * x2 - + params[ i ] * params[ i ] * x3; - - curY = Math.pow( 1 - params[ i ], 2.0 ) * y1 - + 2 * (1.0 - params[ i ]) * params[ i ] * y2 - + params[ i ] * params[ i ] * y3; - - distSquared = Math.pow( curX - x, 2 ) + Math.pow( curY - y, 2 ); - // debug('distance for param ' + params[i] + ": " + Math.sqrt(distSquared)); - if( minDistanceSquared >= 0 ){ - if( distSquared < minDistanceSquared ){ - minDistanceSquared = distSquared; - } - } else { - minDistanceSquared = distSquared; - } - } - - return minDistanceSquared; -}; - -math.sqdistToFiniteLine = function( x, y, x1, y1, x2, y2 ){ - let offset = [ x - x1, y - y1 ]; - let line = [ x2 - x1, y2 - y1 ]; - - let lineSq = line[0] * line[0] + line[1] * line[1]; - let hypSq = offset[0] * offset[0] + offset[1] * offset[1]; - - let dotProduct = offset[0] * line[0] + offset[1] * line[1]; - let adjSq = dotProduct * dotProduct / lineSq; - - if( dotProduct < 0 ){ - return hypSq; - } - - if( adjSq > lineSq ){ - return (x - x2) * (x - x2) + (y - y2) * (y - y2); - } - - return hypSq - adjSq; -}; - -math.pointInsidePolygonPoints = function( x, y, points ){ - let x1, y1, x2, y2; - let y3; - - // Intersect with vertical line through (x, y) - let up = 0; - // let down = 0; - for( let i = 0; i < points.length / 2; i++ ){ - x1 = points[ i * 2]; - y1 = points[ i * 2 + 1]; - - if( i + 1 < points.length / 2 ){ - x2 = points[ (i + 1) * 2]; - y2 = points[ (i + 1) * 2 + 1]; - } else { - x2 = points[ (i + 1 - points.length / 2) * 2]; - y2 = points[ (i + 1 - points.length / 2) * 2 + 1]; - } - - if( x1 == x && x2 == x ){ - // then ignore - } else if( (x1 >= x && x >= x2) - || (x1 <= x && x <= x2) ){ - - y3 = (x - x1) / (x2 - x1) * (y2 - y1) + y1; - - if( y3 > y ){ - up++; - } - - // if( y3 < y ){ - // down++; - // } - - } else { - continue; - } - - } - - if( up % 2 === 0 ){ - return false; - } else { - return true; - } -}; - -math.pointInsidePolygon = function( - x, y, basePoints, centerX, centerY, width, height, direction, padding ){ - - //let direction = arguments[6]; - let transformedPoints = new Array( basePoints.length ); - - // Gives negative angle - let angle; - - if( direction[0] != null ){ - angle = Math.atan( direction[1] / direction[0] ); - - if( direction[0] < 0 ){ - angle = angle + Math.PI / 2; - } else { - angle = -angle - Math.PI / 2; - } - } else { - angle = direction; - } - - let cos = Math.cos( -angle ); - let sin = Math.sin( -angle ); - - // console.log("base: " + basePoints); - for( let i = 0; i < transformedPoints.length / 2; i++ ){ - transformedPoints[ i * 2] = - width / 2 * (basePoints[ i * 2] * cos - - basePoints[ i * 2 + 1] * sin); - - transformedPoints[ i * 2 + 1] = - height / 2 * (basePoints[ i * 2 + 1] * cos - + basePoints[ i * 2] * sin); - - transformedPoints[ i * 2] += centerX; - transformedPoints[ i * 2 + 1] += centerY; - } - - let points; - - if( padding > 0 ){ - let expandedLineSet = this.expandPolygon( - transformedPoints, - -padding ); - - points = this.joinLines( expandedLineSet ); - } else { - points = transformedPoints; - } - - return math.pointInsidePolygonPoints( x, y, points ); -}; - -math.joinLines = function( lineSet ){ - - let vertices = new Array( lineSet.length / 2 ); - - let currentLineStartX, currentLineStartY, currentLineEndX, currentLineEndY; - let nextLineStartX, nextLineStartY, nextLineEndX, nextLineEndY; - - for( let i = 0; i < lineSet.length / 4; i++ ){ - currentLineStartX = lineSet[ i * 4]; - currentLineStartY = lineSet[ i * 4 + 1]; - currentLineEndX = lineSet[ i * 4 + 2]; - currentLineEndY = lineSet[ i * 4 + 3]; - - if( i < lineSet.length / 4 - 1 ){ - nextLineStartX = lineSet[ (i + 1) * 4]; - nextLineStartY = lineSet[ (i + 1) * 4 + 1]; - nextLineEndX = lineSet[ (i + 1) * 4 + 2]; - nextLineEndY = lineSet[ (i + 1) * 4 + 3]; - } else { - nextLineStartX = lineSet[0]; - nextLineStartY = lineSet[1]; - nextLineEndX = lineSet[2]; - nextLineEndY = lineSet[3]; - } - - let intersection = this.finiteLinesIntersect( - currentLineStartX, currentLineStartY, - currentLineEndX, currentLineEndY, - nextLineStartX, nextLineStartY, - nextLineEndX, nextLineEndY, - true ); - - vertices[ i * 2] = intersection[0]; - vertices[ i * 2 + 1] = intersection[1]; - } - - return vertices; -}; - -math.expandPolygon = function( points, pad ){ - - let expandedLineSet = new Array( points.length * 2 ); - - let currentPointX, currentPointY, nextPointX, nextPointY; - - for( let i = 0; i < points.length / 2; i++ ){ - currentPointX = points[ i * 2]; - currentPointY = points[ i * 2 + 1]; - - if( i < points.length / 2 - 1 ){ - nextPointX = points[ (i + 1) * 2]; - nextPointY = points[ (i + 1) * 2 + 1]; - } else { - nextPointX = points[0]; - nextPointY = points[1]; - } - - // Current line: [currentPointX, currentPointY] to [nextPointX, nextPointY] - - // Assume CCW polygon winding - - let offsetX = (nextPointY - currentPointY); - let offsetY = -(nextPointX - currentPointX); - - // Normalize - let offsetLength = Math.sqrt( offsetX * offsetX + offsetY * offsetY ); - let normalizedOffsetX = offsetX / offsetLength; - let normalizedOffsetY = offsetY / offsetLength; - - expandedLineSet[ i * 4] = currentPointX + normalizedOffsetX * pad; - expandedLineSet[ i * 4 + 1] = currentPointY + normalizedOffsetY * pad; - expandedLineSet[ i * 4 + 2] = nextPointX + normalizedOffsetX * pad; - expandedLineSet[ i * 4 + 3] = nextPointY + normalizedOffsetY * pad; - } - - return expandedLineSet; -}; - -math.intersectLineEllipse = function( - x, y, centerX, centerY, ellipseWradius, ellipseHradius ){ - - let dispX = centerX - x; - let dispY = centerY - y; - - dispX /= ellipseWradius; - dispY /= ellipseHradius; - - let len = Math.sqrt( dispX * dispX + dispY * dispY ); - - let newLength = len - 1; - - if( newLength < 0 ){ - return []; - } - - let lenProportion = newLength / len; - - return [ (centerX - x) * lenProportion + x, (centerY - y) * lenProportion + y ]; -}; - -math.checkInEllipse = function( - x, y, width, height, centerX, centerY, padding ){ - x -= centerX; - y -= centerY; - - x /= (width / 2 + padding); - y /= (height / 2 + padding); - - return x * x + y * y <= 1; -}; - -// Returns intersections of increasing distance from line's start point -math.intersectLineCircle = function( - x1, y1, x2, y2, centerX, centerY, radius ){ - - // Calculate d, direction vector of line - let d = [ x2 - x1, y2 - y1 ]; // Direction vector of line - let f = [ x1 - centerX, y1 - centerY ]; - - let a = d[0] * d[0] + d[1] * d[1]; - let b = 2 * (f[0] * d[0] + f[1] * d[1]); - let c = (f[0] * f[0] + f[1] * f[1]) - radius * radius ; - - let discriminant = b * b - 4 * a * c; - - if( discriminant < 0 ){ - return []; - } - - let t1 = (-b + Math.sqrt( discriminant )) / (2 * a); - let t2 = (-b - Math.sqrt( discriminant )) / (2 * a); - - let tMin = Math.min( t1, t2 ); - let tMax = Math.max( t1, t2 ); - let inRangeParams = []; - - if( tMin >= 0 && tMin <= 1 ){ - inRangeParams.push( tMin ); - } - - if( tMax >= 0 && tMax <= 1 ){ - inRangeParams.push( tMax ); - } - - if( inRangeParams.length === 0 ){ - return []; - } - - let nearIntersectionX = inRangeParams[0] * d[0] + x1; - let nearIntersectionY = inRangeParams[0] * d[1] + y1; - - if( inRangeParams.length > 1 ){ - - if( inRangeParams[0] == inRangeParams[1] ){ - return [ nearIntersectionX, nearIntersectionY ]; - } else { - - let farIntersectionX = inRangeParams[1] * d[0] + x1; - let farIntersectionY = inRangeParams[1] * d[1] + y1; - - return [ nearIntersectionX, nearIntersectionY, farIntersectionX, farIntersectionY ]; - } - - } else { - return [ nearIntersectionX, nearIntersectionY ]; - } - -}; - -math.findCircleNearPoint = function( centerX, centerY, - radius, farX, farY ){ - - let displacementX = farX - centerX; - let displacementY = farY - centerY; - let distance = Math.sqrt( displacementX * displacementX - + displacementY * displacementY ); - - let unitDisplacementX = displacementX / distance; - let unitDisplacementY = displacementY / distance; - - return [ centerX + unitDisplacementX * radius, - centerY + unitDisplacementY * radius ]; -}; - -math.findMaxSqDistanceToOrigin = function( points ){ - let maxSqDistance = 0.000001; - let sqDistance; - - for( let i = 0; i < points.length / 2; i++ ){ - - sqDistance = points[ i * 2] * points[ i * 2] - + points[ i * 2 + 1] * points[ i * 2 + 1]; - - if( sqDistance > maxSqDistance ){ - maxSqDistance = sqDistance; - } - } - - return maxSqDistance; -}; - -math.midOfThree = function( a, b, c ){ - if( (b <= a && a <= c) || (c <= a && a <= b) ){ - return a; - } else if( (a <= b && b <= c) || (c <= b && b <= a) ){ - return b; - } else { - return c; - } -}; - -// (x1,y1)=>(x2,y2) intersect with (x3,y3)=>(x4,y4) -math.finiteLinesIntersect = function( - x1, y1, x2, y2, - x3, y3, x4, y4, - infiniteLines -){ - - let dx13 = x1 - x3; - let dx21 = x2 - x1; - let dx43 = x4 - x3; - - let dy13 = y1 - y3; - let dy21 = y2 - y1; - let dy43 = y4 - y3; - - let ua_t = dx43 * dy13 - dy43 * dx13; - let ub_t = dx21 * dy13 - dy21 * dx13; - let u_b = dy43 * dx21 - dx43 * dy21; - - if( u_b !== 0 ){ - let ua = ua_t / u_b; - let ub = ub_t / u_b; - - let flptThreshold = 0.001; - let min = 0 - flptThreshold; - let max = 1 + flptThreshold; - - if( min <= ua && ua <= max && min <= ub && ub <= max ){ - return [ x1 + ua * dx21, y1 + ua * dy21 ]; - - } else { - if( !infiniteLines ){ - return []; - } else { - return [ x1 + ua * dx21, y1 + ua * dy21 ]; - } - } - } else { - if( ua_t === 0 || ub_t === 0 ){ - - // Parallel, coincident lines. Check if overlap - - // Check endpoint of second line - if( this.midOfThree( x1, x2, x4 ) === x4 ){ - return [ x4, y4 ]; - } - - // Check start point of second line - if( this.midOfThree( x1, x2, x3 ) === x3 ){ - return [ x3, y3 ]; - } - - // Endpoint of first line - if( this.midOfThree( x3, x4, x2 ) === x2 ){ - return [ x2, y2 ]; - } - - return []; - } else { - - // Parallel, non-coincident - return []; - } - } -}; - -// math.polygonIntersectLine( x, y, basePoints, centerX, centerY, width, height, padding ) -// intersect a node polygon (pts transformed) -// -// math.polygonIntersectLine( x, y, basePoints, centerX, centerY ) -// intersect the points (no transform) -math.polygonIntersectLine = function( - x, y, basePoints, centerX, centerY, width, height, padding ){ - - let intersections = []; - let intersection; - - let transformedPoints = new Array( basePoints.length ); - - let doTransform = true; - if( arguments.length === 5 ){ - doTransform = false; - } - - let points; - - if( doTransform ){ - for( let i = 0; i < transformedPoints.length / 2; i++ ){ - transformedPoints[ i * 2] = basePoints[ i * 2] * width + centerX; - transformedPoints[ i * 2 + 1] = basePoints[ i * 2 + 1] * height + centerY; - } - - if( padding > 0 ){ - let expandedLineSet = math.expandPolygon( - transformedPoints, - -padding ); - - points = math.joinLines( expandedLineSet ); - } else { - points = transformedPoints; - } - } else { - points = basePoints; - } - - let currentX, currentY, nextX, nextY; - - for( let i = 0; i < points.length / 2; i++ ){ - - currentX = points[ i * 2]; - currentY = points[ i * 2 + 1]; - - if( i < points.length / 2 - 1 ){ - nextX = points[ (i + 1) * 2]; - nextY = points[ (i + 1) * 2 + 1]; - } else { - nextX = points[0]; - nextY = points[1]; - } - - intersection = this.finiteLinesIntersect( - x, y, centerX, centerY, - currentX, currentY, - nextX, nextY ); - - if( intersection.length !== 0 ){ - intersections.push( intersection[0], intersection[1] ); - } - } - - return intersections; -}; - -math.shortenIntersection = function( - intersection, offset, amount ){ - - let disp = [ intersection[0] - offset[0], intersection[1] - offset[1] ]; - - let length = Math.sqrt( disp[0] * disp[0] + disp[1] * disp[1] ); - - let lenRatio = (length - amount) / length; - - if( lenRatio < 0 ){ - lenRatio = 0.00001; - } - - return [ offset[0] + lenRatio * disp[0], offset[1] + lenRatio * disp[1] ]; -}; - -math.generateUnitNgonPointsFitToSquare = function( sides, rotationRadians ){ - let points = math.generateUnitNgonPoints( sides, rotationRadians ); - points = math.fitPolygonToSquare( points ); - - return points; -}; - -math.fitPolygonToSquare = function( points ){ - let x, y; - let sides = points.length / 2; - let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity; - - for( let i = 0; i < sides; i++ ){ - x = points[2 * i ]; - y = points[2 * i + 1]; - - minX = Math.min( minX, x ); - maxX = Math.max( maxX, x ); - minY = Math.min( minY, y ); - maxY = Math.max( maxY, y ); - } - - // stretch factors - let sx = 2 / (maxX - minX); - let sy = 2 / (maxY - minY); - - for( let i = 0; i < sides; i++ ){ - x = points[2 * i ] = points[2 * i ] * sx; - y = points[2 * i + 1] = points[2 * i + 1] * sy; - - minX = Math.min( minX, x ); - maxX = Math.max( maxX, x ); - minY = Math.min( minY, y ); - maxY = Math.max( maxY, y ); - } - - if( minY < -1 ){ - for( let i = 0; i < sides; i++ ){ - y = points[2 * i + 1] = points[2 * i + 1] + (-1 - minY); - } - } - - return points; -}; - -math.generateUnitNgonPoints = function( sides, rotationRadians ){ - - let increment = 1.0 / sides * 2 * Math.PI; - let startAngle = sides % 2 === 0 ? - Math.PI / 2.0 + increment / 2.0 : Math.PI / 2.0; - - startAngle += rotationRadians; - - let points = new Array( sides * 2 ); - - let currentAngle; - for( let i = 0; i < sides; i++ ){ - currentAngle = i * increment + startAngle; - - points[2 * i ] = Math.cos( currentAngle ); // x - points[2 * i + 1] = Math.sin( -currentAngle ); // y - } - - return points; -}; - -math.getRoundRectangleRadius = function( width, height ){ - - // Set the default radius, unless half of width or height is smaller than default - return Math.min( width / 4, height / 4, 8 ); -}; - -math.getCutRectangleCornerLength = function(){ - return 8; -}; - -math.bezierPtsToQuadCoeff = function( p0, p1, p2 ){ - return [ - p0 - 2 * p1 + p2, - 2 * ( p1 - p0 ), - p0 - ]; -}; - -math.getBarrelCurveConstants = function( width, height ){ - // get curve width, height, and control point position offsets as a percentage of node height / width - return { - heightOffset: Math.min(15, 0.05 * height), - widthOffset: Math.min(100, 0.25 * width), - ctrlPtOffsetPct: 0.05 - }; -}; - - -module.exports = math; diff --git a/node_modules/cytoscape/src/promise.js b/node_modules/cytoscape/src/promise.js deleted file mode 100644 index d1bf47972..000000000 --- a/node_modules/cytoscape/src/promise.js +++ /dev/null @@ -1,211 +0,0 @@ -/*! -Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable -Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) -Licensed under The MIT License (http://opensource.org/licenses/MIT) -*/ - -/* promise states [Promises/A+ 2.1] */ -var STATE_PENDING = 0; /* [Promises/A+ 2.1.1] */ -var STATE_FULFILLED = 1; /* [Promises/A+ 2.1.2] */ -var STATE_REJECTED = 2; /* [Promises/A+ 2.1.3] */ - -/* promise object constructor */ -var api = function( executor ){ - /* optionally support non-constructor/plain-function call */ - if( !(this instanceof api) ) - return new api( executor ); - - /* initialize object */ - this.id = 'Thenable/1.0.7'; - this.state = STATE_PENDING; /* initial state */ - this.fulfillValue = undefined; /* initial value */ /* [Promises/A+ 1.3, 2.1.2.2] */ - this.rejectReason = undefined; /* initial reason */ /* [Promises/A+ 1.5, 2.1.3.2] */ - this.onFulfilled = []; /* initial handlers */ - this.onRejected = []; /* initial handlers */ - - /* provide optional information-hiding proxy */ - this.proxy = { - then: this.then.bind( this ) - }; - - /* support optional executor function */ - if( typeof executor === 'function' ) - executor.call( this, this.fulfill.bind( this ), this.reject.bind( this ) ); -}; - -/* promise API methods */ -api.prototype = { - /* promise resolving methods */ - fulfill: function( value ){ return deliver( this, STATE_FULFILLED, 'fulfillValue', value ); }, - reject: function( value ){ return deliver( this, STATE_REJECTED, 'rejectReason', value ); }, - - /* "The then Method" [Promises/A+ 1.1, 1.2, 2.2] */ - then: function( onFulfilled, onRejected ){ - var curr = this; - var next = new api(); /* [Promises/A+ 2.2.7] */ - curr.onFulfilled.push( - resolver( onFulfilled, next, 'fulfill' ) ); /* [Promises/A+ 2.2.2/2.2.6] */ - curr.onRejected.push( - resolver( onRejected, next, 'reject' ) ); /* [Promises/A+ 2.2.3/2.2.6] */ - execute( curr ); - return next.proxy; /* [Promises/A+ 2.2.7, 3.3] */ - } -}; - -/* deliver an action */ -var deliver = function( curr, state, name, value ){ - if( curr.state === STATE_PENDING ){ - curr.state = state; /* [Promises/A+ 2.1.2.1, 2.1.3.1] */ - curr[ name ] = value; /* [Promises/A+ 2.1.2.2, 2.1.3.2] */ - execute( curr ); - } - return curr; -}; - -/* execute all handlers */ -var execute = function( curr ){ - if( curr.state === STATE_FULFILLED ) - execute_handlers( curr, 'onFulfilled', curr.fulfillValue ); - else if( curr.state === STATE_REJECTED ) - execute_handlers( curr, 'onRejected', curr.rejectReason ); -}; - -/* execute particular set of handlers */ -var execute_handlers = function( curr, name, value ){ - /* global setImmediate: true */ - /* global setTimeout: true */ - - /* short-circuit processing */ - if( curr[ name ].length === 0 ) - return; - - /* iterate over all handlers, exactly once */ - var handlers = curr[ name ]; - curr[ name ] = []; /* [Promises/A+ 2.2.2.3, 2.2.3.3] */ - var func = function(){ - for( var i = 0; i < handlers.length; i++ ) - handlers[ i ]( value ); /* [Promises/A+ 2.2.5] */ - }; - - /* execute procedure asynchronously */ /* [Promises/A+ 2.2.4, 3.1] */ - if( typeof setImmediate === 'function' ) - setImmediate( func ); - else - setTimeout( func, 0 ); -}; - -/* generate a resolver function */ -var resolver = function( cb, next, method ){ - return function( value ){ - if( typeof cb !== 'function' ) /* [Promises/A+ 2.2.1, 2.2.7.3, 2.2.7.4] */ - next[ method ].call( next, value ); /* [Promises/A+ 2.2.7.3, 2.2.7.4] */ - else { - var result; - try { result = cb( value ); } /* [Promises/A+ 2.2.2.1, 2.2.3.1, 2.2.5, 3.2] */ - catch( e ){ - next.reject( e ); /* [Promises/A+ 2.2.7.2] */ - return; - } - resolve( next, result ); /* [Promises/A+ 2.2.7.1] */ - } - }; -}; - -/* "Promise Resolution Procedure" */ /* [Promises/A+ 2.3] */ -var resolve = function( promise, x ){ - /* sanity check arguments */ /* [Promises/A+ 2.3.1] */ - if( promise === x || promise.proxy === x ){ - promise.reject( new TypeError( 'cannot resolve promise with itself' ) ); - return; - } - - /* surgically check for a "then" method - (mainly to just call the "getter" of "then" only once) */ - var then; - if( (typeof x === 'object' && x !== null) || typeof x === 'function' ){ - try { then = x.then; } /* [Promises/A+ 2.3.3.1, 3.5] */ - catch( e ){ - promise.reject( e ); /* [Promises/A+ 2.3.3.2] */ - return; - } - } - - /* handle own Thenables [Promises/A+ 2.3.2] - and similar "thenables" [Promises/A+ 2.3.3] */ - if( typeof then === 'function' ){ - var resolved = false; - try { - /* call retrieved "then" method */ /* [Promises/A+ 2.3.3.3] */ - then.call( x, - /* resolvePromise */ /* [Promises/A+ 2.3.3.3.1] */ - function( y ){ - if( resolved ) return; resolved = true; /* [Promises/A+ 2.3.3.3.3] */ - if( y === x ) /* [Promises/A+ 3.6] */ - promise.reject( new TypeError( 'circular thenable chain' ) ); - else - resolve( promise, y ); - }, - - /* rejectPromise */ /* [Promises/A+ 2.3.3.3.2] */ - function( r ){ - if( resolved ) return; resolved = true; /* [Promises/A+ 2.3.3.3.3] */ - promise.reject( r ); - } - ); - } - catch( e ){ - if( !resolved ) /* [Promises/A+ 2.3.3.3.3] */ - promise.reject( e ); /* [Promises/A+ 2.3.3.3.4] */ - } - return; - } - - /* handle other values */ - promise.fulfill( x ); /* [Promises/A+ 2.3.4, 2.3.3.4] */ -}; - -// so we always have Promise.all() -api.all = function( ps ){ - return new api(function( resolveAll, rejectAll ){ - var vals = new Array( ps.length ); - var doneCount = 0; - - var fulfill = function( i, val ){ - vals[ i ] = val; - doneCount++; - - if( doneCount === ps.length ){ - resolveAll( vals ); - } - }; - - for( var i = 0; i < ps.length; i++ ){ - (function( i ){ - var p = ps[i]; - var isPromise = p != null && p.then != null; - - if( isPromise ){ - p.then( function( val ){ - fulfill( i, val ); - }, function( err ){ - rejectAll( err ); - } ); - } else { - var val = p; - fulfill( i, val ); - } - })( i ); - } - - } ); -}; - -api.resolve = function( val ){ - return new api(function( resolve, reject ){ resolve( val ); }); -}; - -api.reject = function( val ){ - return new api(function( resolve, reject ){ reject( val ); }); -}; - -module.exports = typeof Promise !== 'undefined' ? Promise : api; // eslint-disable-line no-undef diff --git a/node_modules/cytoscape/src/selector/expressions.js b/node_modules/cytoscape/src/selector/expressions.js deleted file mode 100644 index 183ec87f5..000000000 --- a/node_modules/cytoscape/src/selector/expressions.js +++ /dev/null @@ -1,230 +0,0 @@ -const { stateSelectorRegex } = require('./state'); -const tokens = require('./tokens'); -const util = require('../util'); -const newQuery = require('./new-query'); - -// when a token like a variable has escaped meta characters, we need to clean the backslashes out -// so that values get compared properly in Selector.filter() -const cleanMetaChars = function( str ){ - return str.replace( new RegExp( '\\\\(' + tokens.metaChar + ')', 'g' ), function( match, $1 ){ - return $1; - } ); -}; - -const replaceLastQuery = ( selector, examiningQuery, replacementQuery ) => { - if( examiningQuery === selector[ selector.length - 1 ] ){ - selector[ selector.length - 1 ] = replacementQuery; - } -}; - -// NOTE: add new expression syntax here to have it recognised by the parser; -// - a query contains all adjacent (i.e. no separator in between) expressions; -// - the current query is stored in selector[i] --- you can use the reference to `this` in the populate function; -// - you need to check the query objects in Selector.filter() for it actually filter properly, but that's pretty straight forward -// - when you add something here, also add to Selector.toString() -let exprs = [ - { - name: 'group', - query: true, - regex: '(' + tokens.group + ')', - populate: function( selector, query, [ group ] ){ - query.group = group === '*' ? group : group + 's'; - } - }, - - { - name: 'state', - query: true, - regex: stateSelectorRegex, - populate: function( selector, query, [ state ] ){ - query.colonSelectors.push( state ); - } - }, - - { - name: 'id', - query: true, - regex: '\\#(' + tokens.id + ')', - populate: function( selector, query,[ id ] ){ - query.ids.push( cleanMetaChars( id ) ); - } - }, - - { - name: 'className', - query: true, - regex: '\\.(' + tokens.className + ')', - populate: function( selector, query, [ className ] ){ - query.classes.push( cleanMetaChars( className ) ); - } - }, - - { - name: 'dataExists', - query: true, - regex: '\\[\\s*(' + tokens.variable + ')\\s*\\]', - populate: function( selector, query, [ variable ] ){ - query.data.push( { - field: cleanMetaChars( variable ) - } ); - } - }, - - { - name: 'dataCompare', - query: true, - regex: '\\[\\s*(' + tokens.variable + ')\\s*(' + tokens.comparatorOp + ')\\s*(' + tokens.value + ')\\s*\\]', - populate: function( selector, query, [ variable, comparatorOp, value ] ){ - let valueIsString = new RegExp( '^' + tokens.string + '$' ).exec( value ) != null; - - if( valueIsString ){ - value = value.substring( 1, value.length - 1 ); - } else { - value = parseFloat( value ); - } - - query.data.push( { - field: cleanMetaChars( variable ), - operator: comparatorOp, - value: value - } ); - } - }, - - { - name: 'dataBool', - query: true, - regex: '\\[\\s*(' + tokens.boolOp + ')\\s*(' + tokens.variable + ')\\s*\\]', - populate: function( selector, query, [ boolOp, variable ] ){ - query.data.push( { - field: cleanMetaChars( variable ), - operator: boolOp - } ); - } - }, - - { - name: 'metaCompare', - query: true, - regex: '\\[\\[\\s*(' + tokens.meta + ')\\s*(' + tokens.comparatorOp + ')\\s*(' + tokens.number + ')\\s*\\]\\]', - populate: function( selector, query, [ meta, comparatorOp, number ] ){ - query.meta.push( { - field: cleanMetaChars( meta ), - operator: comparatorOp, - value: parseFloat( number ) - } ); - } - }, - - { - name: 'nextQuery', - separator: true, - regex: tokens.separator, - populate: function( selector ){ - // go on to next query - let nextQuery = selector[ selector.length++ ] = newQuery(); - selector.currentSubject = null; - - return nextQuery; - } - }, - - { - name: 'directedEdge', - separator: true, - regex: tokens.directedEdge, - populate: function( selector, query ){ - let edgeQuery = newQuery(); - let source = query; - let target = newQuery(); - - edgeQuery.group = 'edges'; - edgeQuery.target = target; - edgeQuery.source = source; - edgeQuery.subject = selector.currentSubject; - - // the query in the selector should be the edge rather than the source - replaceLastQuery( selector, query, edgeQuery ); - - // we're now populating the target query with expressions that follow - return target; - } - }, - - { - name: 'undirectedEdge', - separator: true, - regex: tokens.undirectedEdge, - populate: function( selector, query ){ - let edgeQuery = newQuery(); - let source = query; - let target = newQuery(); - - edgeQuery.group = 'edges'; - edgeQuery.connectedNodes = [ source, target ]; - edgeQuery.subject = selector.currentSubject; - - // the query in the selector should be the edge rather than the source - replaceLastQuery( selector, query, edgeQuery ); - - // we're now populating the target query with expressions that follow - return target; - } - }, - - { - name: 'child', - separator: true, - regex: tokens.child, - populate: function( selector, query ){ - // this query is the parent of the following query - let childQuery = newQuery(); - childQuery.parent = query; - childQuery.subject = selector.currentSubject; - - // it's cheaper to compare children first and go up so replace the parent - replaceLastQuery( selector, query, childQuery ); - - // we're now populating the child query with expressions that follow - return childQuery; - } - }, - - { - name: 'descendant', - separator: true, - regex: tokens.descendant, - populate: function( selector, query ){ - // this query is the ancestor of the following query - let descendantQuery = newQuery(); - descendantQuery.ancestor = query; - descendantQuery.subject = selector.currentSubject; - - // it's cheaper to compare descendants first and go up so replace the ancestor - replaceLastQuery( selector, query, descendantQuery ); - - // we're now populating the descendant query with expressions that follow - return descendantQuery; - } - }, - - { - name: 'subject', - modifier: true, - regex: tokens.subject, - populate: function( selector, query ){ - if( selector.currentSubject != null && query.subject != query ){ - util.error( 'Redefinition of subject in selector `' + selector.toString() + '`' ); - return false; - } - - selector.currentSubject = query; - query.subject = query; - selector[ selector.length - 1 ].subject = query; - } - } -]; - -exprs.forEach( e => e.regexObj = new RegExp( '^' + e.regex ) ); - -module.exports = exprs; diff --git a/node_modules/cytoscape/src/selector/index.js b/node_modules/cytoscape/src/selector/index.js deleted file mode 100644 index f7a203345..000000000 --- a/node_modules/cytoscape/src/selector/index.js +++ /dev/null @@ -1,200 +0,0 @@ -const is = require('../is'); -const util = require('../util'); -const newQuery = require('./new-query'); - -let Selector = function( selector ){ - let self = this; - - self._private = { - selectorText: selector, - invalid: true - }; - - if( selector == null || ( is.string( selector ) && selector.match( /^\s*$/ ) ) ){ - - self.length = 0; - - } else if( selector === '*' || selector === 'edge' || selector === 'node' ){ - - // make single, group-only selectors cheap to make and cheap to filter - - self[0] = newQuery(); - self[0].group = selector === '*' ? selector : selector + 's'; - self[0].groupOnly = true; - self[0].length = 1; - self._private.invalid = false; - self.length = 1; - - } else if( is.elementOrCollection( selector ) ){ - - let collection = selector.collection(); - - self[0] = newQuery(); - self[0].collection = collection; - self[0].length = 1; - self.length = 1; - - } else if( is.fn( selector ) ){ - - self[0] = newQuery(); - self[0].filter = selector; - self[0].length = 1; - self.length = 1; - - } else if( is.string( selector ) ){ - if( !self.parse( selector ) ){ return; } - - } else { - util.error( 'A selector must be created from a string; found ', selector ); - return; - } - - self._private.invalid = false; -}; - -let selfn = Selector.prototype; - -selfn.valid = function(){ - return !this._private.invalid; -}; - -selfn.invalid = function(){ - return this._private.invalid; -}; - -selfn.text = function(){ - return this._private.selectorText; -}; - -selfn.size = function(){ - return this.length; -}; - -selfn.eq = function( i ){ - return this[ i ]; -}; - -selfn.sameText = function( otherSel ){ - return this.text() === otherSel.text(); -}; - -selfn.toString = selfn.selector = function(){ - - if( this._private.toStringCache != null ){ - return this._private.toStringCache; - } - - let i; - let str = ''; - - let clean = function( obj ){ - if( obj == null ){ - return ''; - } else { - return obj; - } - }; - - let cleanVal = function( val ){ - if( is.string( val ) ){ - return '"' + val + '"'; - } else { - return clean( val ); - } - }; - - let space = function( val ){ - return ' ' + val + ' '; - }; - - let queryToString = function( query ){ - let str = ''; - let j, sel; - - if( query.subject === query ){ - str += '$'; - } - - let group = clean( query.group ); - str += group.substring( 0, group.length - 1 ); - - for( j = 0; j < query.data.length; j++ ){ - let data = query.data[ j ]; - - if( data.value ){ - str += '[' + data.field + space( clean( data.operator ) ) + cleanVal( data.value ) + ']'; - } else { - str += '[' + clean( data.operator ) + data.field + ']'; - } - } - - for( j = 0; j < query.meta.length; j++ ){ - let meta = query.meta[ j ]; - str += '[[' + meta.field + space( clean( meta.operator ) ) + cleanVal( meta.value ) + ']]'; - } - - for( j = 0; j < query.colonSelectors.length; j++ ){ - sel = query.colonSelectors[ i ]; - str += sel; - } - - for( j = 0; j < query.ids.length; j++ ){ - sel = '#' + query.ids[ i ]; - str += sel; - } - - for( j = 0; j < query.classes.length; j++ ){ - sel = '.' + query.classes[ j ]; - str += sel; - } - - if( query.source != null && query.target != null ){ - str = queryToString( query.source ) + ' -> ' + queryToString( query.target ); - } - - if( query.connectedNodes != null ){ - let n = query.connectedNodes; - - str = queryToString( n[0] ) + ' <-> ' + queryToString( n[1] ); - } - - if( query.parent != null ){ - str = queryToString( query.parent ) + ' > ' + str; - } - - if( query.ancestor != null ){ - str = queryToString( query.ancestor ) + ' ' + str; - } - - if( query.child != null ){ - str += ' > ' + queryToString( query.child ); - } - - if( query.descendant != null ){ - str += ' ' + queryToString( query.descendant ); - } - - return str; - }; - - for( i = 0; i < this.length; i++ ){ - let query = this[ i ]; - - str += queryToString( query ); - - if( this.length > 1 && i < this.length - 1 ){ - str += ', '; - } - } - - this._private.toStringCache = str; - - return str; -}; - -[ - require('./parse'), - require('./matching') -].forEach( p => util.assign( selfn, p ) ); - -module.exports = Selector; diff --git a/node_modules/cytoscape/src/selector/matching.js b/node_modules/cytoscape/src/selector/matching.js deleted file mode 100644 index dbf8a5c42..000000000 --- a/node_modules/cytoscape/src/selector/matching.js +++ /dev/null @@ -1,310 +0,0 @@ -const { stateSelectorMatches } = require('./state'); -const is = require('../is'); - -// generic checking for data/metadata -let operandsMatch = function( query, params ){ - let allDataMatches = true; - for( let k = 0; k < query[ params.name ].length; k++ ){ - let data = query[ params.name ][ k ]; - let operator = data.operator; - let value = data.value; - let field = data.field; - let matches; - let fieldVal = params.fieldValue( field ); - - if( operator != null && value != null ){ - let fieldStr = !is.string( fieldVal ) && !is.number( fieldVal ) ? '' : '' + fieldVal; - let valStr = '' + value; - - let caseInsensitive = false; - if( operator.indexOf( '@' ) >= 0 ){ - fieldStr = fieldStr.toLowerCase(); - valStr = valStr.toLowerCase(); - - operator = operator.replace( '@', '' ); - caseInsensitive = true; - } - - let notExpr = false; - if( operator.indexOf( '!' ) >= 0 ){ - operator = operator.replace( '!', '' ); - notExpr = true; - } - - // if we're doing a case insensitive comparison, then we're using a STRING comparison - // even if we're comparing numbers - if( caseInsensitive ){ - value = valStr.toLowerCase(); - fieldVal = fieldStr.toLowerCase(); - } - - let isIneqCmp = false; - - switch( operator ){ - case '*=': - matches = fieldStr.indexOf( valStr ) >= 0; - break; - case '$=': - matches = fieldStr.indexOf( valStr, fieldStr.length - valStr.length ) >= 0; - break; - case '^=': - matches = fieldStr.indexOf( valStr ) === 0; - break; - case '=': - matches = fieldVal === value; - break; - case '>': - isIneqCmp = true; - matches = fieldVal > value; - break; - case '>=': - isIneqCmp = true; - matches = fieldVal >= value; - break; - case '<': - isIneqCmp = true; - matches = fieldVal < value; - break; - case '<=': - isIneqCmp = true; - matches = fieldVal <= value; - break; - default: - matches = false; - break; - } - - // apply the not op, but null vals for inequalities should always stay non-matching - if( notExpr && ( fieldVal != null || !isIneqCmp ) ){ - matches = !matches; - } - } else if( operator != null ){ - switch( operator ){ - case '?': - matches = fieldVal ? true : false; - break; - case '!': - matches = fieldVal ? false : true; - break; - case '^': - matches = fieldVal === undefined; - break; - } - } else { - matches = fieldVal !== undefined; - } - - if( !matches ){ - allDataMatches = false; - break; - } - } // for - - return allDataMatches; -}; // operandsMatch - -// check parent/child relations -let confirmRelations = function( query, isNecessary, eles ){ - if( query != null ){ - let matches = false; - - if( !isNecessary ){ return false; } - - eles = eles(); // save cycles if query == null - - // query must match for at least one element (may be recursive) - for( let i = 0; i < eles.length; i++ ){ - if( queryMatches( query, eles[ i ] ) ){ - matches = true; - break; - } - } - - return matches; - } else { - return true; - } -}; - -let queryMatches = function( query, ele ){ - // make single group-only selectors really cheap to check since they're the most common ones - if( query.groupOnly ){ - return query.group === '*' || query.group === ele.group(); - } - - // check group - if( query.group != null && query.group != '*' && query.group != ele.group() ){ - return false; - } - - let cy = ele.cy(); - let k; - - // check colon selectors - let allColonSelectorsMatch = true; - for( k = 0; k < query.colonSelectors.length; k++ ){ - let sel = query.colonSelectors[ k ]; - - allColonSelectorsMatch = stateSelectorMatches( sel, ele ); - - if( !allColonSelectorsMatch ) break; - } - if( !allColonSelectorsMatch ) return false; - - // check id - let allIdsMatch = true; - for( k = 0; k < query.ids.length; k++ ){ - let id = query.ids[ k ]; - let actualId = ele.id(); - - allIdsMatch = allIdsMatch && (id == actualId); - - if( !allIdsMatch ) break; - } - if( !allIdsMatch ) return false; - - // check classes - let allClassesMatch = true; - for( k = 0; k < query.classes.length; k++ ){ - let cls = query.classes[ k ]; - - allClassesMatch = allClassesMatch && ele.hasClass( cls ); - - if( !allClassesMatch ) break; - } - if( !allClassesMatch ) return false; - - // check data matches - let allDataMatches = operandsMatch( query, { - name: 'data', - fieldValue: function( field ){ - return ele.data( field ); - } - } ); - - if( !allDataMatches ){ - return false; - } - - // check metadata matches - let allMetaMatches = operandsMatch( query, { - name: 'meta', - fieldValue: function( field ){ - return ele[ field ](); - } - } ); - - if( !allMetaMatches ){ - return false; - } - - // check collection - if( query.collection != null ){ - let matchesAny = query.collection.hasElementWithId( ele.id() ); - - if( !matchesAny ){ - return false; - } - } - - // check filter function - if( query.filter != null && ele.collection().some( query.filter ) ){ - return false; - } - - let isCompound = cy.hasCompoundNodes(); - let getSource = () => ele.source(); - let getTarget = () => ele.target(); - - if( !confirmRelations( query.parent, isCompound, () => ele.parent() ) ){ return false; } - - if( !confirmRelations( query.ancestor, isCompound, () => ele.parents() ) ){ return false; } - - if( !confirmRelations( query.child, isCompound, () => ele.children() ) ){ return false; } - - if( !confirmRelations( query.descendant, isCompound, () => ele.descendants() ) ){ return false; } - - if( !confirmRelations( query.source, true, getSource ) ){ return false; } - - if( !confirmRelations( query.target, true, getTarget ) ){ return false; } - - if( query.connectedNodes ){ - let q0 = query.connectedNodes[0]; - let q1 = query.connectedNodes[1]; - - if( - confirmRelations( q0, true, getSource ) && - confirmRelations( q1, true, getTarget ) - ){ - // match - } else if( - confirmRelations( q0, true, getTarget ) && - confirmRelations( q1, true, getSource ) - ){ - // match - } else { - return false; - } - } - - // we've reached the end, so we've matched everything for this query - return true; -}; // queryMatches - -// filter an existing collection -let filter = function( collection ){ - let self = this; - let cy = collection.cy(); - - // don't bother trying if it's invalid - if( self.invalid() ){ - return cy.collection(); - } - - // for 1 id #foo queries, just get the element - if( self.length === 1 && self[0].length === 1 && self[0].ids.length === 1 ){ - return collection.getElementById( self[0].ids[0] ).collection(); - } - - let selectorFunction = function( element ){ - for( let j = 0; j < self.length; j++ ){ - let query = self[ j ]; - - if( queryMatches( query, element ) ){ - return true; - } - } - - return false; - }; - - if( self.text() == null ){ - selectorFunction = function(){ return true; }; - } - - let filteredCollection = collection.filter( selectorFunction ); - - return filteredCollection; -}; // filter - -// does selector match a single element? -let matches = function( ele ){ - let self = this; - - // don't bother trying if it's invalid - if( self.invalid() ){ - return false; - } - - for( let j = 0; j < self.length; j++ ){ - let query = self[ j ]; - - if( queryMatches( query, ele ) ){ - return true; - } - } - - return false; -}; // filter - -module.exports = { matches, filter }; diff --git a/node_modules/cytoscape/src/selector/new-query.js b/node_modules/cytoscape/src/selector/new-query.js deleted file mode 100644 index f65f01411..000000000 --- a/node_modules/cytoscape/src/selector/new-query.js +++ /dev/null @@ -1,27 +0,0 @@ -// storage for parsed queries -let newQuery = function(){ - return { - classes: [], - colonSelectors: [], - data: [], - group: null, - ids: [], - meta: [], - - // fake selectors - collection: null, // a collection to match against - filter: null, // filter function - - // these are defined in the upward direction rather than down (e.g. child) - // because we need to go up in Selector.filter() - parent: null, // parent query obj - ancestor: null, // ancestor query obj - subject: null, // defines subject in compound query (subject query obj; points to self if subject) - - // use these only when subject has been defined - child: null, - descendant: null - }; -}; - -module.exports = newQuery; diff --git a/node_modules/cytoscape/src/selector/parse.js b/node_modules/cytoscape/src/selector/parse.js deleted file mode 100644 index ff5e41a3c..000000000 --- a/node_modules/cytoscape/src/selector/parse.js +++ /dev/null @@ -1,128 +0,0 @@ -const util = require('../util'); -const exprs = require('./expressions'); -const newQuery = require('./new-query'); - -// of all the expressions, find the first match in the remaining text -let consumeExpr = function( remaining ){ - let expr; - let match; - let name; - - for( let j = 0; j < exprs.length; j++ ){ - let e = exprs[ j ]; - let n = e.name; - - let m = remaining.match( e.regexObj ); - - if( m != null ){ - match = m; - expr = e; - name = n; - - let consumed = m[0]; - remaining = remaining.substring( consumed.length ); - - break; // we've consumed one expr, so we can return now - } - } - - return { - expr: expr, - match: match, - name: name, - remaining: remaining - }; -}; - - -// consume all leading whitespace -let consumeWhitespace = function( remaining ){ - let match = remaining.match( /^\s+/ ); - - if( match ){ - let consumed = match[0]; - remaining = remaining.substring( consumed.length ); - } - - return remaining; -}; - -let parse = function( selector ){ - let self = this; - - let remaining = self._private.selectorText = selector; - - let currentQuery = self[0] = newQuery(); - self.length = 1; - - remaining = consumeWhitespace( remaining ); // get rid of leading whitespace - - for( ;; ){ - let check = consumeExpr( remaining ); - - if( check.expr == null ){ - util.error( 'The selector `' + selector + '`is invalid' ); - return false; - } else { - let args = check.match.slice( 1 ); - - // let the token populate the selector object in currentQuery - let ret = check.expr.populate( self, currentQuery, args ); - - if( ret === false ){ - return false; // exit if population failed - } else if( ret != null ){ - currentQuery = ret; // change the current query to be filled if the expr specifies - } - } - - remaining = check.remaining; - - // we're done when there's nothing left to parse - if( remaining.match( /^\s*$/ ) ){ - break; - } - } - - // adjust references for subject - for( let j = 0; j < self.length; j++ ){ - let query = self[ j ]; - - if( query.subject != null ){ - // go up the tree until we reach the subject - for( ;; ){ - if( query.subject === query ){ break; } // done if subject is self - - if( query.parent != null ){ // swap parent/child reference - let parent = query.parent; - let child = query; - - child.parent = null; - parent.child = child; - - query = parent; // go up the tree - } else if( query.ancestor != null ){ // swap ancestor/descendant - let ancestor = query.ancestor; - let descendant = query; - - descendant.ancestor = null; - ancestor.descendant = descendant; - - query = ancestor; // go up the tree - } else if( query.source || query.target || query.connectedNodes ){ - util.error( 'The selector `' + self.text() + '` can not contain a subject selector that applies to the source or target of an edge selector' ); - return false; - } else { - util.error( 'When adjusting references for the selector `' + self.text() + '`, neither parent nor ancestor was found' ); - return false; - } - } // for - - self[ j ] = query.subject; // subject should be the root query - } // if - } // for - - return true; // success -}; - -module.exports = { parse }; diff --git a/node_modules/cytoscape/src/selector/state.js b/node_modules/cytoscape/src/selector/state.js deleted file mode 100644 index 52ef5c506..000000000 --- a/node_modules/cytoscape/src/selector/state.js +++ /dev/null @@ -1,139 +0,0 @@ -const util = require('../util'); - -let stateSelectors = [ - { - selector: ':selected', - matches: function( ele ){ return ele.selected(); } - }, - { - selector: ':unselected', - matches: function( ele ){ return !ele.selected(); } - }, - { - selector: ':selectable', - matches: function( ele ){ return ele.selectable(); } - }, - { - selector: ':unselectable', - matches: function( ele ){ return !ele.selectable(); } - }, - { - selector: ':locked', - matches: function( ele ){ return ele.locked(); } - }, - { - selector: ':unlocked', - matches: function( ele ){ return !ele.locked(); } - }, - { - selector: ':visible', - matches: function( ele ){ return ele.visible(); } - }, - { - selector: ':hidden', - matches: function( ele ){ return !ele.visible(); } - }, - { - selector: ':transparent', - matches: function( ele ){ return ele.transparent(); } - }, - { - selector: ':grabbed', - matches: function( ele ){ return ele.grabbed(); } - }, - { - selector: ':free', - matches: function( ele ){ return !ele.grabbed(); } - }, - { - selector: ':removed', - matches: function( ele ){ return ele.removed(); } - }, - { - selector: ':inside', - matches: function( ele ){ return !ele.removed(); } - }, - { - selector: ':grabbable', - matches: function( ele ){ return ele.grabbable(); } - }, - { - selector: ':ungrabbable', - matches: function( ele ){ return !ele.grabbable(); } - }, - { - selector: ':animated', - matches: function( ele ){ return ele.animated(); } - }, - { - selector: ':unanimated', - matches: function( ele ){ return !ele.animated(); } - }, - { - selector: ':parent', - matches: function( ele ){ return ele.isParent(); } - }, - { - selector: ':childless', - matches: function( ele ){ return ele.isChildless(); } - }, - { - selector: ':child', - matches: function( ele ){ return ele.isChild(); } - }, - { - selector: ':orphan', - matches: function( ele ){ return ele.isOrphan(); } - }, - { - selector: ':nonorphan', - matches: function( ele ){ return ele.isChild(); } - }, - { - selector: ':loop', - matches: function( ele ){ return ele.isLoop(); } - }, - { - selector: ':simple', - matches: function( ele ){ return ele.isSimple(); } - }, - { - selector: ':active', - matches: function( ele ){ return ele.active(); } - }, - { - selector: ':inactive', - matches: function( ele ){ return !ele.active(); } - }, - { - selector: ':backgrounding', - matches: function( ele ){ return ele.backgrounding(); } - }, - { - selector: ':nonbackgrounding', - matches: function( ele ){ return !ele.backgrounding(); } - } -].sort(function( a, b ){ // n.b. selectors that are starting substrings of others must have the longer ones first - return util.sort.descending( a.selector, b.selector ); -}); - -let stateSelectorMatches = function( sel, ele ){ - let lookup = stateSelectorMatches.lookup = stateSelectorMatches.lookup || (function(){ - let selToFn = {}; - let s; - - for( let i = 0; i < stateSelectors.length; i++ ){ - s = stateSelectors[i]; - - selToFn[ s.selector ] = s.matches; - } - - return selToFn; - })(); - - return lookup[ sel ]( ele ); -}; - -let stateSelectorRegex = '(' + stateSelectors.map(function( s ){ return s.selector; }).join('|') + ')'; - -module.exports = { stateSelectors, stateSelectorMatches, stateSelectorRegex }; diff --git a/node_modules/cytoscape/src/selector/tokens.js b/node_modules/cytoscape/src/selector/tokens.js deleted file mode 100644 index f6922c095..000000000 --- a/node_modules/cytoscape/src/selector/tokens.js +++ /dev/null @@ -1,46 +0,0 @@ -const util = require('../util'); - -// tokens in the query language -const tokens = { - metaChar: '[\\!\\"\\#\\$\\%\\&\\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]', // chars we need to escape in let names, etc - comparatorOp: '=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=', // binary comparison op (used in data selectors) - boolOp: '\\?|\\!|\\^', // boolean (unary) operators (used in data selectors) - string: '"(?:\\\\"|[^"])*"' + '|' + "'(?:\\\\'|[^'])*'", // string literals (used in data selectors) -- doublequotes | singlequotes - number: util.regex.number, // number literal (used in data selectors) --- e.g. 0.1234, 1234, 12e123 - meta: 'degree|indegree|outdegree', // allowed metadata fields (i.e. allowed functions to use from Collection) - separator: '\\s*,\\s*', // queries are separated by commas, e.g. edge[foo = 'bar'], node.someClass - descendant: '\\s+', - child: '\\s+>\\s+', - subject: '\\$', - group: 'node|edge|\\*', - directedEdge: '\\s+->\\s+', - undirectedEdge: '\\s+<->\\s+' -}; -tokens.variable = '(?:[\\w-]|(?:\\\\' + tokens.metaChar + '))+'; // a variable name -tokens.value = tokens.string + '|' + tokens.number; // a value literal, either a string or number -tokens.className = tokens.variable; // a class name (follows variable conventions) -tokens.id = tokens.variable; // an element id (follows variable conventions) - -(function(){ - let ops, op, i; - - // add @ variants to comparatorOp - ops = tokens.comparatorOp.split( '|' ); - for( i = 0; i < ops.length; i++ ){ - op = ops[ i ]; - tokens.comparatorOp += '|@' + op; - } - - // add ! variants to comparatorOp - ops = tokens.comparatorOp.split( '|' ); - for( i = 0; i < ops.length; i++ ){ - op = ops[ i ]; - - if( op.indexOf( '!' ) >= 0 ){ continue; } // skip ops that explicitly contain ! - if( op === '=' ){ continue; } // skip = b/c != is explicitly defined - - tokens.comparatorOp += '|\\!' + op; - } -})(); - -module.exports = tokens; diff --git a/node_modules/cytoscape/src/set.js b/node_modules/cytoscape/src/set.js deleted file mode 100644 index 38c7510e6..000000000 --- a/node_modules/cytoscape/src/set.js +++ /dev/null @@ -1,59 +0,0 @@ -/* global Set */ - -const undef = typeof undefined; - -class ObjectSet { - constructor( arrayOrObjectSet ){ - this._obj = Object.create(null); - - if( arrayOrObjectSet != null ){ - let arr; - - if( arrayOrObjectSet.instanceString != null && arrayOrObjectSet.instanceString() === this.instanceString() ){ - arr = arrayOrObjectSet.toArray(); - } else { - arr = arrayOrObjectSet; - } - - for( let i = 0; i < arr.length; i++ ){ - this.add( arr[i] ); - } - } - } - - get size(){ - return this.toArray().length; - } - - instanceString(){ - return 'set'; - } - - add( val ){ - this._obj[ val ] = 1; - } - - delete( val ){ - this._obj[ val ] = 0; - } - - clear(){ - this._obj = Object.create(null); - } - - has( val ){ - return this._obj[ val ] === 1; - } - - toArray(){ - return Object.keys( this._obj ).filter( key => this.has(key) ); - } - - forEach( callback, thisArg ){ - return this.toArray().forEach( callback, thisArg ); - } -} - -// TODO use the stdlib Set in future... -// module.exports = typeof Set !== undef ? Set : ObjectSet; -module.exports = ObjectSet; diff --git a/node_modules/cytoscape/src/style/apply.js b/node_modules/cytoscape/src/style/apply.js deleted file mode 100644 index bb80f92f9..000000000 --- a/node_modules/cytoscape/src/style/apply.js +++ /dev/null @@ -1,671 +0,0 @@ -let util = require('../util'); -let is = require('../is'); -let Promise = require('../promise'); - -let styfn = {}; - -// (potentially expensive calculation) -// apply the style to the element based on -// - its bypass -// - what selectors match it -styfn.apply = function( eles ){ - let self = this; - let _p = self._private; - let cy = _p.cy; - let updatedEles = cy.collection(); - - if( _p.newStyle ){ // clear style caches - _p.contextStyles = {}; - _p.propDiffs = {}; - - self.cleanElements( eles, true ); - } - - for( let ie = 0; ie < eles.length; ie++ ){ - let ele = eles[ ie ]; - - let cxtMeta = self.getContextMeta( ele ); - - if( cxtMeta.empty ){ - continue; - } else { - updatedEles.merge( ele ); - } - - let cxtStyle = self.getContextStyle( cxtMeta ); - let app = self.applyContextStyle( cxtMeta, cxtStyle, ele ); - - if( !_p.newStyle ){ - self.updateTransitions( ele, app.diffProps ); - } - - self.updateStyleHints( ele ); - - } // for elements - - _p.newStyle = false; - - return updatedEles; -}; - -styfn.getPropertiesDiff = function( oldCxtKey, newCxtKey ){ - let self = this; - let cache = self._private.propDiffs = self._private.propDiffs || {}; - let dualCxtKey = oldCxtKey + '-' + newCxtKey; - let cachedVal = cache[ dualCxtKey ]; - - if( cachedVal ){ - return cachedVal; - } - - let diffProps = []; - let addedProp = {}; - - for( let i = 0; i < self.length; i++ ){ - let cxt = self[ i ]; - let oldHasCxt = oldCxtKey[ i ] === 't'; - let newHasCxt = newCxtKey[ i ] === 't'; - let cxtHasDiffed = oldHasCxt !== newHasCxt; - let cxtHasMappedProps = cxt.mappedProperties.length > 0; - - if( cxtHasDiffed || cxtHasMappedProps ){ - let props; - - if( cxtHasDiffed && cxtHasMappedProps ){ - props = cxt.properties; // suffices b/c mappedProperties is a subset of properties - } else if( cxtHasDiffed ){ - props = cxt.properties; // need to check them all - } else if( cxtHasMappedProps ){ - props = cxt.mappedProperties; // only need to check mapped - } - - for( let j = 0; j < props.length; j++ ){ - let prop = props[ j ]; - let name = prop.name; - - // if a later context overrides this property, then the fact that this context has switched/diffed doesn't matter - // (semi expensive check since it makes this function O(n^2) on context length, but worth it since overall result - // is cached) - let laterCxtOverrides = false; - for( let k = i + 1; k < self.length; k++ ){ - let laterCxt = self[ k ]; - let hasLaterCxt = newCxtKey[ k ] === 't'; - - if( !hasLaterCxt ){ continue; } // can't override unless the context is active - - laterCxtOverrides = laterCxt.properties[ prop.name ] != null; - - if( laterCxtOverrides ){ break; } // exit early as long as one later context overrides - } - - if( !addedProp[ name ] && !laterCxtOverrides ){ - addedProp[ name ] = true; - diffProps.push( name ); - } - } // for props - } // if - - } // for contexts - - cache[ dualCxtKey ] = diffProps; - return diffProps; -}; - -styfn.getContextMeta = function( ele ){ - let self = this; - let cxtKey = ''; - let diffProps; - let prevKey = ele._private.styleCxtKey || ''; - - if( self._private.newStyle ){ - prevKey = ''; // since we need to apply all style if a fresh stylesheet - } - - // get the cxt key - for( let i = 0; i < self.length; i++ ){ - let context = self[ i ]; - let contextSelectorMatches = context.selector && context.selector.matches( ele ); // NB: context.selector may be null for 'core' - - if( contextSelectorMatches ){ - cxtKey += 't'; - } else { - cxtKey += 'f'; - } - } // for context - - diffProps = self.getPropertiesDiff( prevKey, cxtKey ); - - ele._private.styleCxtKey = cxtKey; - - return { - key: cxtKey, - diffPropNames: diffProps, - empty: diffProps.length === 0 - }; -}; - -// gets a computed ele style object based on matched contexts -styfn.getContextStyle = function( cxtMeta ){ - let cxtKey = cxtMeta.key; - let self = this; - let cxtStyles = this._private.contextStyles = this._private.contextStyles || {}; - - // if already computed style, returned cached copy - if( cxtStyles[ cxtKey ] ){ return cxtStyles[ cxtKey ]; } - - let style = { - _private: { - key: cxtKey - } - }; - - for( let i = 0; i < self.length; i++ ){ - let cxt = self[ i ]; - let hasCxt = cxtKey[ i ] === 't'; - - if( !hasCxt ){ continue; } - - for( let j = 0; j < cxt.properties.length; j++ ){ - let prop = cxt.properties[ j ]; - - style[ prop.name ] = prop; - } - } - - cxtStyles[ cxtKey ] = style; - return style; -}; - -styfn.applyContextStyle = function( cxtMeta, cxtStyle, ele ){ - let self = this; - let diffProps = cxtMeta.diffPropNames; - let retDiffProps = {}; - - for( let i = 0; i < diffProps.length; i++ ){ - let diffPropName = diffProps[ i ]; - let cxtProp = cxtStyle[ diffPropName ]; - let eleProp = ele.pstyle( diffPropName ); - - if( !cxtProp ){ // no context prop means delete - if( !eleProp ){ - continue; // no existing prop means nothing needs to be removed - // nb affects initial application on mapped values like control-point-distances - } else if( eleProp.bypass ){ - cxtProp = { name: diffPropName, deleteBypassed: true }; - } else { - cxtProp = { name: diffPropName, delete: true }; - } - } - - // save cycles when the context prop doesn't need to be applied - if( eleProp === cxtProp ){ continue; } - - let retDiffProp = retDiffProps[ diffPropName ] = { - prev: eleProp - }; - - self.applyParsedProperty( ele, cxtProp ); - - retDiffProp.next = ele.pstyle( diffPropName ); - - if( retDiffProp.next && retDiffProp.next.bypass ){ - retDiffProp.next = retDiffProp.next.bypassed; - } - } - - return { - diffProps: retDiffProps - }; -}; - -styfn.updateStyleHints = function(ele){ - let _p = ele._private; - let self = this; - - if( ele.removed() ){ return; } - - // set whether has pie or not; for greater efficiency - let hasPie = false; - if( _p.group === 'nodes' ){ - for( let i = 1; i <= self.pieBackgroundN; i++ ){ // 1..N - let size = ele.pstyle( 'pie-' + i + '-background-size' ).value; - - if( size > 0 ){ - hasPie = true; - break; - } - } - } - - _p.hasPie = hasPie; - - let transform = ele.pstyle( 'text-transform' ).strValue; - let content = ele.pstyle( 'label' ).strValue; - let srcContent = ele.pstyle( 'source-label' ).strValue; - let tgtContent = ele.pstyle( 'target-label' ).strValue; - let fStyle = ele.pstyle( 'font-style' ).strValue; - let size = ele.pstyle( 'font-size' ).pfValue + 'px'; - let family = ele.pstyle( 'font-family' ).strValue; - // let letiant = style['font-letiant'].strValue; - let weight = ele.pstyle( 'font-weight' ).strValue; - let valign = ele.pstyle( 'text-valign' ).strValue; - let halign = ele.pstyle( 'text-valign' ).strValue; - let oWidth = ele.pstyle( 'text-outline-width' ).pfValue; - let wrap = ele.pstyle( 'text-wrap' ).strValue; - let wrapW = ele.pstyle( 'text-max-width' ).pfValue; - let labelStyleKey = fStyle + '$' + size + '$' + family + '$' + weight + '$' + transform + '$' + valign + '$' + halign + '$' + oWidth + '$' + wrap + '$' + wrapW; - _p.labelStyleKey = labelStyleKey; - _p.sourceLabelKey = labelStyleKey + '$' + srcContent; - _p.targetLabelKey = labelStyleKey + '$' + tgtContent; - _p.labelKey = labelStyleKey + '$' + content; - _p.fontKey = fStyle + '$' + weight + '$' + size + '$' + family; - - _p.styleKey = Date.now(); -}; - -// apply a property to the style (for internal use) -// returns whether application was successful -// -// now, this function flattens the property, and here's how: -// -// for parsedProp:{ bypass: true, deleteBypass: true } -// no property is generated, instead the bypass property in the -// element's style is replaced by what's pointed to by the `bypassed` -// field in the bypass property (i.e. restoring the property the -// bypass was overriding) -// -// for parsedProp:{ mapped: truthy } -// the generated flattenedProp:{ mapping: prop } -// -// for parsedProp:{ bypass: true } -// the generated flattenedProp:{ bypassed: parsedProp } -styfn.applyParsedProperty = function( ele, parsedProp ){ - let self = this; - let prop = parsedProp; - let style = ele._private.style; - let fieldVal, flatProp; - let types = self.types; - let type = self.properties[ prop.name ].type; - let propIsBypass = prop.bypass; - let origProp = style[ prop.name ]; - let origPropIsBypass = origProp && origProp.bypass; - let _p = ele._private; - let flatPropMapping = 'mapping'; - - let checkZOrder = function(){ - self.checkZOrderTrigger( ele, prop.name, origProp ? origProp.value : null, prop.value ); - }; - - // edges connected to compound nodes can not be haystacks - if( - parsedProp.name === 'curve-style' - && parsedProp.value === 'haystack' - && ele.isEdge() - && ( ele.isLoop() || ele.source().isParent() || ele.target().isParent() ) - ){ - prop = parsedProp = this.parse( parsedProp.name, 'bezier', propIsBypass ); - } - - if( prop.delete ){ // delete the property and use the default value on falsey value - style[ prop.name ] = undefined; - - checkZOrder(); - - return true; - } - - if( prop.deleteBypassed ){ // delete the property that the - if( !origProp ){ - checkZOrder(); - - return true; // can't delete if no prop - - } else if( origProp.bypass ){ // delete bypassed - origProp.bypassed = undefined; - - checkZOrder(); - - return true; - - } else { - return false; // we're unsuccessful deleting the bypassed - } - } - - // check if we need to delete the current bypass - if( prop.deleteBypass ){ // then this property is just here to indicate we need to delete - if( !origProp ){ - checkZOrder(); - - return true; // property is already not defined - - } else if( origProp.bypass ){ // then replace the bypass property with the original - // because the bypassed property was already applied (and therefore parsed), we can just replace it (no reapplying necessary) - style[ prop.name ] = origProp.bypassed; - - checkZOrder(); - - return true; - - } else { - return false; // we're unsuccessful deleting the bypass - } - } - - let printMappingErr = function(){ - util.error( 'Do not assign mappings to elements without corresponding data (e.g. ele `' + ele.id() + '` for property `' + prop.name + '` with data field `' + prop.field + '`); try a `[' + prop.field + ']` selector to limit scope to elements with `' + prop.field + '` defined' ); - }; - - // put the property in the style objects - switch( prop.mapped ){ // flatten the property if mapped - case types.mapData: { - // flatten the field (e.g. data.foo.bar) - let fields = prop.field.split( '.' ); - let fieldVal = _p.data; - - for( let i = 0; i < fields.length && fieldVal; i++ ){ - let field = fields[ i ]; - fieldVal = fieldVal[ field ]; - } - - let percent; - if( !is.number( fieldVal ) ){ // then keep the mapping but assume 0% for now - percent = 0; - } else { - percent = (fieldVal - prop.fieldMin) / (prop.fieldMax - prop.fieldMin); - } - - // make sure to bound percent value - if( percent < 0 ){ - percent = 0; - } else if( percent > 1 ){ - percent = 1; - } - - if( type.color ){ - let r1 = prop.valueMin[0]; - let r2 = prop.valueMax[0]; - let g1 = prop.valueMin[1]; - let g2 = prop.valueMax[1]; - let b1 = prop.valueMin[2]; - let b2 = prop.valueMax[2]; - let a1 = prop.valueMin[3] == null ? 1 : prop.valueMin[3]; - let a2 = prop.valueMax[3] == null ? 1 : prop.valueMax[3]; - - let clr = [ - Math.round( r1 + (r2 - r1) * percent ), - Math.round( g1 + (g2 - g1) * percent ), - Math.round( b1 + (b2 - b1) * percent ), - Math.round( a1 + (a2 - a1) * percent ) - ]; - - flatProp = { // colours are simple, so just create the flat property instead of expensive string parsing - bypass: prop.bypass, // we're a bypass if the mapping property is a bypass - name: prop.name, - value: clr, - strValue: 'rgb(' + clr[0] + ', ' + clr[1] + ', ' + clr[2] + ')' - }; - - } else if( type.number ){ - let calcValue = prop.valueMin + (prop.valueMax - prop.valueMin) * percent; - flatProp = this.parse( prop.name, calcValue, prop.bypass, flatPropMapping ); - - } else { - return false; // can only map to colours and numbers - } - - if( !flatProp ){ // if we can't flatten the property, then use the origProp so we still keep the mapping itself - flatProp = this.parse( prop.name, origProp.strValue, prop.bypass, flatPropMapping ); - } - - if( !flatProp ){ printMappingErr(); } - flatProp.mapping = prop; // keep a reference to the mapping - prop = flatProp; // the flattened (mapped) property is the one we want - - break; - } - - // direct mapping - case types.data: { - // flatten the field (e.g. data.foo.bar) - let fields = prop.field.split( '.' ); - let fieldVal = _p.data; - - if( fieldVal ){ for( let i = 0; i < fields.length; i++ ){ - let field = fields[ i ]; - fieldVal = fieldVal[ field ]; - } } - - flatProp = this.parse( prop.name, fieldVal, prop.bypass, flatPropMapping ); - - if( !flatProp ){ // if we can't flatten the property, then use the origProp so we still keep the mapping itself - let flatPropVal = origProp ? origProp.strValue : ''; - - flatProp = this.parse( prop.name, flatPropVal, prop.bypass, flatPropMapping ); - } - - if( !flatProp ){ printMappingErr(); } - flatProp.mapping = prop; // keep a reference to the mapping - prop = flatProp; // the flattened (mapped) property is the one we want - - break; - } - - case types.fn: { - let fn = prop.value; - let fnRetVal = fn( ele ); - - flatProp = this.parse( prop.name, fnRetVal, prop.bypass, flatPropMapping ); - flatProp.mapping = prop; // keep a reference to the mapping - prop = flatProp; // the flattened (mapped) property is the one we want - - break; - } - - case undefined: - break; // just set the property - - default: - return false; // not a valid mapping - } - - // if the property is a bypass property, then link the resultant property to the original one - if( propIsBypass ){ - if( origPropIsBypass ){ // then this bypass overrides the existing one - prop.bypassed = origProp.bypassed; // steal bypassed prop from old bypass - } else { // then link the orig prop to the new bypass - prop.bypassed = origProp; - } - - style[ prop.name ] = prop; // and set - - } else { // prop is not bypass - if( origPropIsBypass ){ // then keep the orig prop (since it's a bypass) and link to the new prop - origProp.bypassed = prop; - } else { // then just replace the old prop with the new one - style[ prop.name ] = prop; - } - } - - checkZOrder(); - - return true; -}; - -styfn.cleanElements = function( eles, keepBypasses ){ - let self = this; - let props = self.properties; - - for( let i = 0; i < eles.length; i++ ){ - let ele = eles[i]; - - if( !keepBypasses ){ - ele._private.style = {}; - } else { - let style = ele._private.style; - - for( let j = 0; j < props.length; j++ ){ - let prop = props[j]; - let eleProp = style[ prop.name ]; - - if( eleProp ){ - if( eleProp.bypass ){ - eleProp.bypassed = null; - } else { - style[ prop.name ] = null; - } - } - } - } - } -}; - -// updates the visual style for all elements (useful for manual style modification after init) -styfn.update = function(){ - let cy = this._private.cy; - let eles = cy.mutableElements(); - - eles.updateStyle(); -}; - -// just update the functional properties (i.e. mappings) in the elements' -// styles (less expensive than recalculation) -styfn.updateMappers = function( eles ){ - let self = this; - let cy = this._private.cy; - let updatedEles = cy.collection(); - - for( let i = 0; i < eles.length; i++ ){ // for each ele - let ele = eles[ i ]; - let style = ele._private.style; - let updatedEle = false; - - for( let j = 0; j < self.properties.length; j++ ){ // for each prop - let prop = self.properties[ j ]; - let propInStyle = style[ prop.name ]; - - if( propInStyle && propInStyle.mapping ){ - let mapping = propInStyle.mapping; - - this.applyParsedProperty( ele, mapping ); // reapply the mapping property - - updatedEle = true; - } - } - - if( updatedEle ){ - this.updateStyleHints( ele ); - - updatedEles.merge( ele ); - } - } - - return updatedEles; -}; - -// diffProps : { name => { prev, next } } -styfn.updateTransitions = function( ele, diffProps, isBypass ){ - let self = this; - let _p = ele._private; - let props = ele.pstyle( 'transition-property' ).value; - let duration = ele.pstyle( 'transition-duration' ).pfValue; - let delay = ele.pstyle( 'transition-delay' ).pfValue; - - if( props.length > 0 && duration > 0 ){ - - let style = {}; - - // build up the style to animate towards - let anyPrev = false; - for( let i = 0; i < props.length; i++ ){ - let prop = props[ i ]; - let styProp = ele.pstyle( prop ); - let diffProp = diffProps[ prop ]; - - if( !diffProp ){ continue; } - - let prevProp = diffProp.prev; - let fromProp = prevProp; - let toProp = diffProp.next != null ? diffProp.next : styProp; - let diff = false; - let initVal; - let initDt = 0.000001; // delta time % value for initVal (allows animating out of init zero opacity) - - if( !fromProp ){ continue; } - - // consider px values - if( is.number( fromProp.pfValue ) && is.number( toProp.pfValue ) ){ - diff = toProp.pfValue - fromProp.pfValue; // nonzero is truthy - initVal = fromProp.pfValue + initDt * diff; - - // consider numerical values - } else if( is.number( fromProp.value ) && is.number( toProp.value ) ){ - diff = toProp.value - fromProp.value; // nonzero is truthy - initVal = fromProp.value + initDt * diff; - - // consider colour values - } else if( is.array( fromProp.value ) && is.array( toProp.value ) ){ - diff = fromProp.value[0] !== toProp.value[0] - || fromProp.value[1] !== toProp.value[1] - || fromProp.value[2] !== toProp.value[2] - ; - - initVal = fromProp.strValue; - } - - // the previous value is good for an animation only if it's different - if( diff ){ - style[ prop ] = toProp.strValue; // to val - this.applyBypass( ele, prop, initVal ); // from val - anyPrev = true; - } - - } // end if props allow ani - - // can't transition if there's nothing previous to transition from - if( !anyPrev ){ return; } - - _p.transitioning = true; - - ( new Promise(function( resolve ){ - if( delay > 0 ){ - ele.delayAnimation( delay ).play().promise().then( resolve ); - } else { - resolve(); - } - }) ).then(function(){ - return ele.animation( { - style: style, - duration: duration, - easing: ele.pstyle( 'transition-timing-function' ).value, - queue: false - } ).play().promise(); - }).then(function(){ - // if( !isBypass ){ - self.removeBypasses( ele, props ); - ele.emitAndNotify('style'); - // } - - _p.transitioning = false; - }); - - } else if( _p.transitioning ){ - this.removeBypasses( ele, props ); - ele.emitAndNotify('style'); - - _p.transitioning = false; - } -}; - -styfn.checkZOrderTrigger = function( ele, name, fromValue, toValue ){ - let prop = this.properties[ name ]; - - if( prop.triggersZOrder != null && ( fromValue == null || prop.triggersZOrder( fromValue, toValue ) ) ){ - this._private.cy.notify({ - type: 'zorder', - eles: ele - }); - } -}; - -module.exports = styfn; diff --git a/node_modules/cytoscape/src/style/bypass.js b/node_modules/cytoscape/src/style/bypass.js deleted file mode 100644 index 70a827936..000000000 --- a/node_modules/cytoscape/src/style/bypass.js +++ /dev/null @@ -1,174 +0,0 @@ -let is = require( '../is' ); -let util = require( '../util' ); - -let styfn = {}; - -// bypasses are applied to an existing style on an element, and just tacked on temporarily -// returns true iff application was successful for at least 1 specified property -styfn.applyBypass = function( eles, name, value, updateTransitions ){ - let self = this; - let props = []; - let isBypass = true; - - // put all the properties (can specify one or many) in an array after parsing them - if( name === '*' || name === '**' ){ // apply to all property names - - if( value !== undefined ){ - for( let i = 0; i < self.properties.length; i++ ){ - let prop = self.properties[ i ]; - let name = prop.name; - - let parsedProp = this.parse( name, value, true ); - - if( parsedProp ){ - props.push( parsedProp ); - } - } - } - - } else if( is.string( name ) ){ // then parse the single property - let parsedProp = this.parse( name, value, true ); - - if( parsedProp ){ - props.push( parsedProp ); - } - } else if( is.plainObject( name ) ){ // then parse each property - let specifiedProps = name; - updateTransitions = value; - - let names = Object.keys( specifiedProps ); - - for( let i = 0; i < names.length; i++ ){ - let name = names[i]; - let prop = self.properties[ name ]; - let value = specifiedProps[ name ]; - - if( value === undefined ){ // try camel case name too - value = specifiedProps[ util.dash2camel( name ) ]; - } - - if( value !== undefined ){ - let parsedProp = this.parse( name, value, true ); - - if( parsedProp ){ - props.push( parsedProp ); - } - } - } - } else { // can't do anything without well defined properties - return false; - } - - // we've failed if there are no valid properties - if( props.length === 0 ){ return false; } - - // now, apply the bypass properties on the elements - let ret = false; // return true if at least one succesful bypass applied - for( let i = 0; i < eles.length; i++ ){ // for each ele - let ele = eles[ i ]; - let diffProps = {}; - let diffProp; - - for( let j = 0; j < props.length; j++ ){ // for each prop - let prop = props[ j ]; - - if( updateTransitions ){ - let prevProp = ele.pstyle( prop.name ); - diffProp = diffProps[ prop.name ] = { prev: prevProp }; - } - - ret = this.applyParsedProperty( ele, prop ) || ret; - - if( updateTransitions ){ - diffProp.next = ele.pstyle( prop.name ); - } - - } // for props - - if( ret ){ - this.updateStyleHints( ele ); - } - - if( updateTransitions ){ - this.updateTransitions( ele, diffProps, isBypass ); - } - } // for eles - - return ret; -}; - -// only useful in specific cases like animation -styfn.overrideBypass = function( eles, name, value ){ - name = util.camel2dash( name ); - - for( let i = 0; i < eles.length; i++ ){ - let ele = eles[ i ]; - let prop = ele._private.style[ name ]; - let type = this.properties[ name ].type; - let isColor = type.color; - let isMulti = type.mutiple; - - if( !prop || !prop.bypass ){ // need a bypass if one doesn't exist - this.applyBypass( ele, name, value ); - continue; - } - - let oldValue = prop.pfValue != null ? prop.pfValue : prop.value; - - prop.value = value; - - if( prop.pfValue != null ){ - prop.pfValue = value; - } - - if( isColor ){ - prop.strValue = 'rgb(' + value.join( ',' ) + ')'; - } else if( isMulti ){ - prop.strValue = value.join( ' ' ); - } else { - prop.strValue = '' + value; - } - - this.checkZOrderTrigger( ele, name, oldValue, value ); - } -}; - -styfn.removeAllBypasses = function( eles, updateTransitions ){ - return this.removeBypasses( eles, this.propertyNames, updateTransitions ); -}; - -styfn.removeBypasses = function( eles, props, updateTransitions ){ - let isBypass = true; - - for( let j = 0; j < eles.length; j++ ){ - let ele = eles[ j ]; - let diffProps = {}; - - for( let i = 0; i < props.length; i++ ){ - let name = props[ i ]; - let prop = this.properties[ name ]; - let prevProp = ele.pstyle( prop.name ); - - if( !prevProp || !prevProp.bypass ){ - // if a bypass doesn't exist for the prop, nothing needs to be removed - continue; - } - - let value = ''; // empty => remove bypass - let parsedProp = this.parse( name, value, true ); - let diffProp = diffProps[ prop.name ] = { prev: prevProp }; - - this.applyParsedProperty( ele, parsedProp ); - - diffProp.next = ele.pstyle( prop.name ); - } // for props - - this.updateStyleHints( ele ); - - if( updateTransitions ){ - this.updateTransitions( ele, diffProps, isBypass ); - } - } // for eles -}; - -module.exports = styfn; diff --git a/node_modules/cytoscape/src/style/container.js b/node_modules/cytoscape/src/style/container.js deleted file mode 100644 index bf21eb05d..000000000 --- a/node_modules/cytoscape/src/style/container.js +++ /dev/null @@ -1,26 +0,0 @@ -let window = require( '../window' ); - -let styfn = {}; - -// gets what an em size corresponds to in pixels relative to a dom element -styfn.getEmSizeInPixels = function(){ - let px = this.containerCss( 'font-size' ); - - if( px != null ){ - return parseFloat( px ); - } else { - return 1; // for headless - } -}; - -// gets css property from the core container -styfn.containerCss = function( propName ){ - let cy = this._private.cy; - let domElement = cy.container(); - - if( window && domElement && window.getComputedStyle ){ - return window.getComputedStyle( domElement ).getPropertyValue( propName ); - } -}; - -module.exports = styfn; diff --git a/node_modules/cytoscape/src/style/get-for-ele.js b/node_modules/cytoscape/src/style/get-for-ele.js deleted file mode 100644 index d9bbcbab8..000000000 --- a/node_modules/cytoscape/src/style/get-for-ele.js +++ /dev/null @@ -1,119 +0,0 @@ -let util = require( '../util' ); -let is = require( '../is' ); - -let styfn = {}; - -// gets the rendered style for an element -styfn.getRenderedStyle = function( ele, prop ){ - if( prop ){ - return this.getStylePropertyValue( ele, prop, true ); - } else { - return this.getRawStyle( ele, true ); - } -}; - -// gets the raw style for an element -styfn.getRawStyle = function( ele, isRenderedVal ){ - let self = this; - - ele = ele[0]; // insure it's an element - - if( ele ){ - let rstyle = {}; - - for( let i = 0; i < self.properties.length; i++ ){ - let prop = self.properties[ i ]; - let val = self.getStylePropertyValue( ele, prop.name, isRenderedVal ); - - if( val != null ){ - rstyle[ prop.name ] = val; - rstyle[ util.dash2camel( prop.name ) ] = val; - } - } - - return rstyle; - } -}; - -styfn.getIndexedStyle = function( ele, property, subproperty, index ){ - let pstyle = ele.pstyle( property )[subproperty][index]; - return pstyle != null ? pstyle : ele.cy().style().getDefaultProperty( property )[subproperty][0]; -}; - -styfn.getStylePropertyValue = function( ele, propName, isRenderedVal ){ - let self = this; - - ele = ele[0]; // insure it's an element - - if( ele ){ - let prop = self.properties[ propName ]; - - if( prop.alias ){ - prop = prop.pointsTo; - } - - let type = prop.type; - let styleProp = ele.pstyle( prop.name ); - let zoom = ele.cy().zoom(); - - if( styleProp ){ - let units = styleProp.units ? type.implicitUnits || 'px' : null; - let val = units ? [].concat( styleProp.pfValue ).map( function( pfValue ){ - return ( pfValue * (isRenderedVal ? zoom : 1) ) + units; - } ).join( ' ' ) : styleProp.strValue; - - return val; - } - } -}; - -styfn.getAnimationStartStyle = function( ele, aniProps ){ - let rstyle = {}; - - for( let i = 0; i < aniProps.length; i++ ){ - let aniProp = aniProps[ i ]; - let name = aniProp.name; - - let styleProp = ele.pstyle( name ); - - if( styleProp !== undefined ){ // then make a prop of it - if( is.plainObject( styleProp ) ){ - styleProp = this.parse( name, styleProp.strValue ); - } else { - styleProp = this.parse( name, styleProp ); - } - } - - if( styleProp ){ - rstyle[ name ] = styleProp; - } - } - - return rstyle; -}; - -styfn.getPropsList = function( propsObj ){ - let self = this; - let rstyle = []; - let style = propsObj; - let props = self.properties; - - if( style ){ - let names = Object.keys( style ); - - for( let i = 0; i < names.length; i++ ){ - let name = names[i]; - let val = style[ name ]; - let prop = props[ name ] || props[ util.camel2dash( name ) ]; - let styleProp = this.parse( prop.name, val ); - - if( styleProp ){ - rstyle.push( styleProp ); - } - } - } - - return rstyle; -}; - -module.exports = styfn; diff --git a/node_modules/cytoscape/src/style/index.js b/node_modules/cytoscape/src/style/index.js deleted file mode 100644 index 8a4605da6..000000000 --- a/node_modules/cytoscape/src/style/index.js +++ /dev/null @@ -1,181 +0,0 @@ -let is = require( '../is' ); -let util = require( '../util' ); -let Selector = require( '../selector' ); - -let Style = function( cy ){ - - if( !(this instanceof Style) ){ - return new Style( cy ); - } - - if( !is.core( cy ) ){ - util.error( 'A style must have a core reference' ); - return; - } - - this._private = { - cy: cy, - coreStyle: {} - }; - - this.length = 0; - - this.resetToDefault(); -}; - -let styfn = Style.prototype; - -styfn.instanceString = function(){ - return 'style'; -}; - -// remove all contexts -styfn.clear = function(){ - for( let i = 0; i < this.length; i++ ){ - this[ i ] = undefined; - } - this.length = 0; - - let _p = this._private; - - _p.newStyle = true; - - return this; // chaining -}; - -styfn.resetToDefault = function(){ - this.clear(); - this.addDefaultStylesheet(); - - return this; -}; - -// builds a style object for the 'core' selector -styfn.core = function(){ - return this._private.coreStyle; -}; - -// create a new context from the specified selector string and switch to that context -styfn.selector = function( selectorStr ){ - // 'core' is a special case and does not need a selector - let selector = selectorStr === 'core' ? null : new Selector( selectorStr ); - - let i = this.length++; // new context means new index - this[ i ] = { - selector: selector, - properties: [], - mappedProperties: [], - index: i - }; - - return this; // chaining -}; - -// add one or many css rules to the current context -styfn.css = function(){ - let self = this; - let args = arguments; - - switch( args.length ){ - case 1: - let map = args[0]; - - for( let i = 0; i < self.properties.length; i++ ){ - let prop = self.properties[ i ]; - let mapVal = map[ prop.name ]; - - if( mapVal === undefined ){ - mapVal = map[ util.dash2camel( prop.name ) ]; - } - - if( mapVal !== undefined ){ - this.cssRule( prop.name, mapVal ); - } - } - - break; - - case 2: - this.cssRule( args[0], args[1] ); - break; - - default: - break; // do nothing if args are invalid - } - - return this; // chaining -}; -styfn.style = styfn.css; - -// add a single css rule to the current context -styfn.cssRule = function( name, value ){ - // name-value pair - let property = this.parse( name, value ); - - // add property to current context if valid - if( property ){ - let i = this.length - 1; - this[ i ].properties.push( property ); - this[ i ].properties[ property.name ] = property; // allow access by name as well - - if( property.name.match( /pie-(\d+)-background-size/ ) && property.value ){ - this._private.hasPie = true; - } - - if( property.mapped ){ - this[ i ].mappedProperties.push( property ); - } - - // add to core style if necessary - let currentSelectorIsCore = !this[ i ].selector; - if( currentSelectorIsCore ){ - this._private.coreStyle[ property.name ] = property; - } - } - - return this; // chaining -}; - -styfn.append = function( style ){ - if( is.stylesheet( style ) ){ - style.appendToStyle( this ); - } else if( is.array( style ) ){ - this.appendFromJson( style ); - } else if( is.string( style ) ){ - this.appendFromString( style ); - } // you probably wouldn't want to append a Style, since you'd duplicate the default parts - - return this; -}; - -// static function -Style.fromJson = function( cy, json ){ - let style = new Style( cy ); - - style.fromJson( json ); - - return style; -}; - -Style.fromString = function( cy, string ){ - return new Style( cy ).fromString( string ); -}; - -[ - require( './apply' ), - require( './bypass' ), - require( './container' ), - require( './get-for-ele' ), - require( './json' ), - require( './string-sheet' ), - require( './properties' ), - require( './parse' ) -].forEach( function( props ){ - util.extend( styfn, props ); -} ); - - -Style.types = styfn.types; -Style.properties = styfn.properties; - -module.exports = Style; diff --git a/node_modules/cytoscape/src/style/json.js b/node_modules/cytoscape/src/style/json.js deleted file mode 100644 index f269dd457..000000000 --- a/node_modules/cytoscape/src/style/json.js +++ /dev/null @@ -1,59 +0,0 @@ -let styfn = {}; - -styfn.appendFromJson = function( json ){ - let style = this; - - for( let i = 0; i < json.length; i++ ){ - let context = json[ i ]; - let selector = context.selector; - let props = context.style || context.css; - let names = Object.keys( props ); - - style.selector( selector ); // apply selector - - for( let j = 0; j < names.length; j++ ){ - let name = names[j]; - let value = props[ name ]; - - style.css( name, value ); // apply property - } - } - - return style; -}; - -// accessible cy.style() function -styfn.fromJson = function( json ){ - let style = this; - - style.resetToDefault(); - style.appendFromJson( json ); - - return style; -}; - -// get json from cy.style() api -styfn.json = function(){ - let json = []; - - for( let i = this.defaultLength; i < this.length; i++ ){ - let cxt = this[ i ]; - let selector = cxt.selector; - let props = cxt.properties; - let css = {}; - - for( let j = 0; j < props.length; j++ ){ - let prop = props[ j ]; - css[ prop.name ] = prop.strValue; - } - - json.push( { - selector: !selector ? 'core' : selector.toString(), - style: css - } ); - } - - return json; -}; - -module.exports = styfn; diff --git a/node_modules/cytoscape/src/style/parse.js b/node_modules/cytoscape/src/style/parse.js deleted file mode 100644 index 01b88dafb..000000000 --- a/node_modules/cytoscape/src/style/parse.js +++ /dev/null @@ -1,423 +0,0 @@ -let util = require( '../util' ); -let is = require( '../is' ); -let math = require( '../math' ); - -let styfn = {}; - -// a caching layer for property parsing -styfn.parse = function( name, value, propIsBypass, propIsFlat ){ - let self = this; - - // function values can't be cached in all cases, and there isn't much benefit of caching them anyway - if( is.fn( value ) ){ - return self.parseImplWarn( name, value, propIsBypass, propIsFlat ); - } - - let flatKey = ( propIsFlat === 'mapping' || propIsFlat === true || propIsFlat === false || propIsFlat == null ) ? 'dontcare' : propIsFlat; - let argHash = [ name, value, propIsBypass, flatKey ].join( '$' ); - let propCache = self.propCache = self.propCache || {}; - let ret; - - if( !(ret = propCache[ argHash ]) ){ - ret = propCache[ argHash ] = self.parseImplWarn( name, value, propIsBypass, propIsFlat ); - } - - // - bypasses can't be shared b/c the value can be changed by animations or otherwise overridden - // - mappings can't be shared b/c mappings are per-element - if( propIsBypass || propIsFlat === 'mapping' ){ - // need a copy since props are mutated later in their lifecycles - ret = util.copy( ret ); - - if( ret ){ - ret.value = util.copy( ret.value ); // because it could be an array, e.g. colour - } - } - - return ret; -}; - -styfn.parseImplWarn = function( name, value, propIsBypass, propIsFlat ){ - let prop = this.parseImpl( name, value, propIsBypass, propIsFlat ); - - if( !prop && value != null ){ - util.error('The style property `%s: %s` is invalid', name, value); - } - - return prop; -}; - -// parse a property; return null on invalid; return parsed property otherwise -// fields : -// - name : the name of the property -// - value : the parsed, native-typed value of the property -// - strValue : a string value that represents the property value in valid css -// - bypass : true iff the property is a bypass property -styfn.parseImpl = function( name, value, propIsBypass, propIsFlat ){ - let self = this; - - name = util.camel2dash( name ); // make sure the property name is in dash form (e.g. 'property-name' not 'propertyName') - - let property = self.properties[ name ]; - let passedValue = value; - let types = self.types; - - if( !property ){ return null; } // return null on property of unknown name - if( value === undefined ){ return null; } // can't assign undefined - - // the property may be an alias - if( property.alias ){ - property = property.pointsTo; - name = property.name; - } - - let valueIsString = is.string( value ); - if( valueIsString ){ // trim the value to make parsing easier - value = value.trim(); - } - - let type = property.type; - if( !type ){ return null; } // no type, no luck - - // check if bypass is null or empty string (i.e. indication to delete bypass property) - if( propIsBypass && (value === '' || value === null) ){ - return { - name: name, - value: value, - bypass: true, - deleteBypass: true - }; - } - - // check if value is a function used as a mapper - if( is.fn( value ) ){ - return { - name: name, - value: value, - strValue: 'fn', - mapped: types.fn, - bypass: propIsBypass - }; - } - - // check if value is mapped - let data, mapData; - if( !valueIsString || propIsFlat ){ - // then don't bother to do the expensive regex checks - - } else if( data = new RegExp( types.data.regex ).exec( value ) ){ - if( propIsBypass ){ return false; } // mappers not allowed in bypass - - let mapped = types.data; - - return { - name: name, - value: data, - strValue: '' + value, - mapped: mapped, - field: data[1], - bypass: propIsBypass - }; - - } else if( mapData = new RegExp( types.mapData.regex ).exec( value ) ){ - if( propIsBypass ){ return false; } // mappers not allowed in bypass - if( type.multiple ){ return false; } // impossible to map to num - - let mapped = types.mapData; - - // we can map only if the type is a colour or a number - if( !(type.color || type.number) ){ return false; } - - let valueMin = this.parse( name, mapData[4] ); // parse to validate - if( !valueMin || valueMin.mapped ){ return false; } // can't be invalid or mapped - - let valueMax = this.parse( name, mapData[5] ); // parse to validate - if( !valueMax || valueMax.mapped ){ return false; } // can't be invalid or mapped - - // check if valueMin and valueMax are the same - if( valueMin.value === valueMax.value ){ - return false; // can't make much of a mapper without a range - - } else if( type.color ){ - let c1 = valueMin.value; - let c2 = valueMax.value; - - let same = c1[0] === c2[0] // red - && c1[1] === c2[1] // green - && c1[2] === c2[2] // blue - && ( // optional alpha - c1[3] === c2[3] // same alpha outright - || ( - (c1[3] == null || c1[3] === 1) // full opacity for colour 1? - && - (c2[3] == null || c2[3] === 1) // full opacity for colour 2? - ) - ) - ; - - if( same ){ return false; } // can't make a mapper without a range - } - - return { - name: name, - value: mapData, - strValue: '' + value, - mapped: mapped, - field: mapData[1], - fieldMin: parseFloat( mapData[2] ), // min & max are numeric - fieldMax: parseFloat( mapData[3] ), - valueMin: valueMin.value, - valueMax: valueMax.value, - bypass: propIsBypass - }; - } - - if( type.multiple && propIsFlat !== 'multiple' ){ - let vals; - - if( valueIsString ){ - vals = value.split( /\s+/ ); - } else if( is.array( value ) ){ - vals = value; - } else { - vals = [ value ]; - } - - if( type.evenMultiple && vals.length % 2 !== 0 ){ return null; } - - let valArr = []; - let unitsArr = []; - let pfValArr = []; - let hasEnum = false; - - for( let i = 0; i < vals.length; i++ ){ - let p = self.parse( name, vals[i], propIsBypass, 'multiple' ); - - hasEnum = hasEnum || is.string( p.value ); - - valArr.push( p.value ); - pfValArr.push( p.pfValue != null ? p.pfValue : p.value ); - unitsArr.push( p.units ); - } - - if( type.validate && !type.validate( valArr, unitsArr ) ){ - return null; - } - - if( type.singleEnum && hasEnum ){ - if( valArr.length === 1 && is.string( valArr[0] ) ){ - return { - name: name, - value: valArr[0], - strValue: valArr[0], - bypass: propIsBypass - }; - } else { - return null; - } - } - - return { - name: name, - value: valArr, - pfValue: pfValArr, - strValue: valArr.map( (val, i) => val + (unitsArr[i] || '') ).join(' '), - bypass: propIsBypass, - units: unitsArr - }; - } - - // several types also allow enums - let checkEnums = function(){ - for( let i = 0; i < type.enums.length; i++ ){ - let en = type.enums[ i ]; - - if( en === value ){ - return { - name: name, - value: value, - strValue: '' + value, - bypass: propIsBypass - }; - } - } - - return null; - }; - - // check the type and return the appropriate object - if( type.number ){ - let units; - let implicitUnits = 'px'; // not set => px - - if( type.units ){ // use specified units if set - units = type.units; - } - - if( type.implicitUnits ){ - implicitUnits = type.implicitUnits; - } - - if( !type.unitless ){ - if( valueIsString ){ - let unitsRegex = 'px|em' + (type.allowPercent ? '|\\%' : ''); - if( units ){ unitsRegex = units; } // only allow explicit units if so set - let match = value.match( '^(' + util.regex.number + ')(' + unitsRegex + ')?' + '$' ); - - if( match ){ - value = match[1]; - units = match[2] || implicitUnits; - } - - } else if( !units || type.implicitUnits ){ - units = implicitUnits; // implicitly px if unspecified - } - } - - value = parseFloat( value ); - - // if not a number and enums not allowed, then the value is invalid - if( isNaN( value ) && type.enums === undefined ){ - return null; - } - - // check if this number type also accepts special keywords in place of numbers - // (i.e. `left`, `auto`, etc) - if( isNaN( value ) && type.enums !== undefined ){ - value = passedValue; - - return checkEnums(); - } - - // check if value must be an integer - if( type.integer && !is.integer( value ) ){ - return null; - } - - // check value is within range - if( ( type.min !== undefined && ( value < type.min || (type.strictMin && value === type.min) ) ) - || ( type.max !== undefined && ( value > type.max || (type.strictMax && value === type.max) ) ) - ){ - return null; - } - - let ret = { - name: name, - value: value, - strValue: '' + value + (units ? units : ''), - units: units, - bypass: propIsBypass - }; - - // normalise value in pixels - if( type.unitless || (units !== 'px' && units !== 'em') ){ - ret.pfValue = value; - } else { - ret.pfValue = ( units === 'px' || !units ? (value) : (this.getEmSizeInPixels() * value) ); - } - - // normalise value in ms - if( units === 'ms' || units === 's' ){ - ret.pfValue = units === 'ms' ? value : 1000 * value; - } - - // normalise value in rad - if( units === 'deg' || units === 'rad' ){ - ret.pfValue = units === 'rad' ? value : math.deg2rad( value ); - } - - // normalize value in % - if( units === '%' ){ - ret.pfValue = value / 100; - } - - return ret; - - } else if( type.propList ){ - - let props = []; - let propsStr = '' + value; - - if( propsStr === 'none' ){ - // leave empty - - } else { // go over each prop - - let propsSplit = propsStr.split( ',' ); - for( let i = 0; i < propsSplit.length; i++ ){ - let propName = propsSplit[ i ].trim(); - - if( self.properties[ propName ] ){ - props.push( propName ); - } - } - - if( props.length === 0 ){ return null; } - } - - return { - name: name, - value: props, - strValue: props.length === 0 ? 'none' : props.join( ', ' ), - bypass: propIsBypass - }; - - } else if( type.color ){ - let tuple = util.color2tuple( value ); - - if( !tuple ){ return null; } - - return { - name: name, - value: tuple, - pfValue: tuple, - strValue: '' + value, - bypass: propIsBypass - }; - - } else if( type.regex || type.regexes ){ - - // first check enums - if( type.enums ){ - let enumProp = checkEnums(); - - if( enumProp ){ return enumProp; } - } - - let regexes = type.regexes ? type.regexes : [ type.regex ]; - - for( let i = 0; i < regexes.length; i++ ){ - let regex = new RegExp( regexes[ i ] ); // make a regex from the type string - let m = regex.exec( value ); - - if( m ){ // regex matches - return { - name: name, - value: type.singleRegexMatchValue ? m[1] : m, - strValue: '' + value, - bypass: propIsBypass - }; - - } - } - - return null; // didn't match any - - } else if( type.string ){ - // just return - return { - name: name, - value: '' + value, - strValue: '' + value, - bypass: propIsBypass - }; - - } else if( type.enums ){ // check enums last because it's a combo type in others - return checkEnums(); - - } else { - return null; // not a type we can handle - } - -}; - -module.exports = styfn; diff --git a/node_modules/cytoscape/src/style/properties.js b/node_modules/cytoscape/src/style/properties.js deleted file mode 100644 index 86137ad7e..000000000 --- a/node_modules/cytoscape/src/style/properties.js +++ /dev/null @@ -1,578 +0,0 @@ -let util = require( '../util' ); -let is = require( '../is' ); - -let styfn = {}; - -(function(){ - let number = util.regex.number; - let rgba = util.regex.rgbaNoBackRefs; - let hsla = util.regex.hslaNoBackRefs; - let hex3 = util.regex.hex3; - let hex6 = util.regex.hex6; - let data = function( prefix ){ return '^' + prefix + '\\s*\\(\\s*([\\w\\.]+)\\s*\\)$'; }; - let mapData = function( prefix ){ - let mapArg = number + '|\\w+|' + rgba + '|' + hsla + '|' + hex3 + '|' + hex6; - return '^' + prefix + '\\s*\\(([\\w\\.]+)\\s*\\,\\s*(' + number + ')\\s*\\,\\s*(' + number + ')\\s*,\\s*(' + mapArg + ')\\s*\\,\\s*(' + mapArg + ')\\)$'; - }; - let urlRegexes = [ - '^url\\s*\\(\\s*[\'"]?(.+?)[\'"]?\\s*\\)$', - '^(none)$', - '^(.+)$' - ]; - - // each visual style property has a type and needs to be validated according to it - styfn.types = { - time: { number: true, min: 0, units: 's|ms', implicitUnits: 'ms' }, - percent: { number: true, min: 0, max: 100, units: '%', implicitUnits: '%' }, - zeroOneNumber: { number: true, min: 0, max: 1, unitless: true }, - zeroOneNumbers: { number: true, min: 0, max: 1, unitless: true, multiple: true }, - nOneOneNumber: { number: true, min: -1, max: 1, unitless: true }, - nonNegativeInt: { number: true, min: 0, integer: true, unitless: true }, - position: { enums: [ 'parent', 'origin' ] }, - nodeSize: { number: true, min: 0, enums: [ 'label' ] }, - number: { number: true, unitless: true }, - numbers: { number: true, unitless: true, multiple: true }, - positiveNumber: { number: true, unitless: true, min: 0, strictMin: true }, - size: { number: true, min: 0 }, - bidirectionalSize: { number: true }, // allows negative - bidirectionalSizes: { number: true, multiple: true }, // allows negative - sizeMaybePercent: { number: true, min: 0, allowPercent: true }, - paddingRelativeTo: { enums: [ 'width', 'height', 'average', 'min', 'max' ] }, - bgWH: { number: true, min: 0, allowPercent: true, enums: [ 'auto' ], multiple: true }, - bgPos: { number: true, allowPercent: true, multiple: true }, - bgRelativeTo: { enums: [ 'inner', 'include-padding' ], multiple: true }, - bgRepeat: { enums: [ 'repeat', 'repeat-x', 'repeat-y', 'no-repeat' ], multiple: true }, - bgFit: { enums: [ 'none', 'contain', 'cover' ], multiple: true }, - bgCrossOrigin: { enums: [ 'anonymous', 'use-credentials' ], multiple: true }, - bgClip: { enums: [ 'none', 'node' ] }, - color: { color: true }, - bool: { enums: [ 'yes', 'no' ] }, - lineStyle: { enums: [ 'solid', 'dotted', 'dashed' ] }, - borderStyle: { enums: [ 'solid', 'dotted', 'dashed', 'double' ] }, - curveStyle: { enums: [ 'bezier', 'unbundled-bezier', 'haystack', 'segments' ] }, - fontFamily: { regex: '^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$' }, - fontletiant: { enums: [ 'small-caps', 'normal' ] }, - fontStyle: { enums: [ 'italic', 'normal', 'oblique' ] }, - fontWeight: { enums: [ 'normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '800', '900', 100, 200, 300, 400, 500, 600, 700, 800, 900 ] }, - textDecoration: { enums: [ 'none', 'underline', 'overline', 'line-through' ] }, - textTransform: { enums: [ 'none', 'uppercase', 'lowercase' ] }, - textWrap: { enums: [ 'none', 'wrap', 'ellipsis' ] }, - textBackgroundShape: { enums: [ 'rectangle', 'roundrectangle' ]}, - nodeShape: { enums: [ 'rectangle', 'roundrectangle', 'cutrectangle', 'bottomroundrectangle', 'barrel', 'ellipse', 'triangle', 'square', 'pentagon', 'hexagon', 'concavehexagon', 'heptagon', 'octagon', 'tag', 'star', 'diamond', 'vee', 'rhomboid', 'polygon' ] }, - compoundIncludeLabels: { enums: [ 'include', 'exclude' ] }, - arrowShape: { enums: [ 'tee', 'triangle', 'triangle-tee', 'triangle-cross', 'triangle-backcurve', 'half-triangle-overshot', 'vee', 'square', 'circle', 'diamond', 'none' ] }, - arrowFill: { enums: [ 'filled', 'hollow' ] }, - display: { enums: [ 'element', 'none' ] }, - visibility: { enums: [ 'hidden', 'visible' ] }, - zCompoundDepth: { enums: [ 'bottom', 'orphan', 'auto', 'top' ] }, - zIndexCompare: { enums: [ 'auto', 'manual' ] }, - valign: { enums: [ 'top', 'center', 'bottom' ] }, - halign: { enums: [ 'left', 'center', 'right' ] }, - text: { string: true }, - data: { mapping: true, regex: data( 'data' ) }, - layoutData: { mapping: true, regex: data( 'layoutData' ) }, - scratch: { mapping: true, regex: data( 'scratch' ) }, - mapData: { mapping: true, regex: mapData( 'mapData' ) }, - mapLayoutData: { mapping: true, regex: mapData( 'mapLayoutData' ) }, - mapScratch: { mapping: true, regex: mapData( 'mapScratch' ) }, - fn: { mapping: true, fn: true }, - url: { regexes: urlRegexes, singleRegexMatchValue: true }, - urls: { regexes: urlRegexes, singleRegexMatchValue: true, multiple: true }, - propList: { propList: true }, - angle: { number: true, units: 'deg|rad', implicitUnits: 'rad' }, - textRotation: { number: true, units: 'deg|rad', implicitUnits: 'rad', enums: [ 'none', 'autorotate' ] }, - polygonPointList: { number: true, multiple: true, evenMultiple: true, min: -1, max: 1, unitless: true }, - edgeDistances: { enums: ['intersection', 'node-position'] }, - edgeEndpoint: { - number: true, multiple: true, units: '%|px|em|deg|rad', implicitUnits: 'px', - enums: [ 'inside-to-node', 'outside-to-node', 'outside-to-line' ], singleEnum: true, - validate: function( valArr, unitsArr ){ - switch( valArr.length ){ - case 2: // can be % or px only - return unitsArr[0] !== 'deg' && unitsArr[0] !== 'rad' && unitsArr[1] !== 'deg' && unitsArr[1] !== 'rad'; - case 1: // can be enum, deg, or rad only - return is.string( valArr[0] ) || unitsArr[0] === 'deg' || unitsArr[0] === 'rad'; - default: - return false; - } - } - }, - easing: { - regexes: [ - '^(spring)\\s*\\(\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*\\)$', - '^(cubic-bezier)\\s*\\(\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*,\\s*(' + number + ')\\s*\\)$' - ], - enums: [ - 'linear', - 'ease', 'ease-in', 'ease-out', 'ease-in-out', - 'ease-in-sine', 'ease-out-sine', 'ease-in-out-sine', - 'ease-in-quad', 'ease-out-quad', 'ease-in-out-quad', - 'ease-in-cubic', 'ease-out-cubic', 'ease-in-out-cubic', - 'ease-in-quart', 'ease-out-quart', 'ease-in-out-quart', - 'ease-in-quint', 'ease-out-quint', 'ease-in-out-quint', - 'ease-in-expo', 'ease-out-expo', 'ease-in-out-expo', - 'ease-in-circ', 'ease-out-circ', 'ease-in-out-circ' - ] - } - }; - - let zOrderDiff = { - zeroNonZero: function( val1, val2 ){ - if( val1 === 0 && val2 !== 0 ){ - return true; - } else if( val1 !== 0 && val2 === 0 ){ - return true; - } else { - return false; - } - }, - anyDiff: function( val1, val2 ){ - return val1 !== val2; - } - }; - - let zd = zOrderDiff; - - // define visual style properties - let t = styfn.types; - let props = styfn.properties = [ - // main label - { name: 'label', type: t.text }, - { name: 'text-rotation', type: t.textRotation }, - { name: 'text-margin-x', type: t.bidirectionalSize }, - { name: 'text-margin-y', type: t.bidirectionalSize }, - - // source label - { name: 'source-label', type: t.text }, - { name: 'source-text-rotation', type: t.textRotation }, - { name: 'source-text-margin-x', type: t.bidirectionalSize }, - { name: 'source-text-margin-y', type: t.bidirectionalSize }, - { name: 'source-text-offset', type: t.size }, - - // target label - { name: 'target-label', type: t.text }, - { name: 'target-text-rotation', type: t.textRotation }, - { name: 'target-text-margin-x', type: t.bidirectionalSize }, - { name: 'target-text-margin-y', type: t.bidirectionalSize }, - { name: 'target-text-offset', type: t.size }, - - // common label style - { name: 'text-valign', type: t.valign }, - { name: 'text-halign', type: t.halign }, - { name: 'color', type: t.color }, - { name: 'text-outline-color', type: t.color }, - { name: 'text-outline-width', type: t.size }, - { name: 'text-outline-opacity', type: t.zeroOneNumber }, - { name: 'text-opacity', type: t.zeroOneNumber }, - { name: 'text-background-color', type: t.color }, - { name: 'text-background-opacity', type: t.zeroOneNumber }, - { name: 'text-background-padding', type: t.size }, - { name: 'text-border-opacity', type: t.zeroOneNumber }, - { name: 'text-border-color', type: t.color }, - { name: 'text-border-width', type: t.size }, - { name: 'text-border-style', type: t.borderStyle }, - { name: 'text-background-shape', type: t.textBackgroundShape}, - // { name: 'text-decoration', type: t.textDecoration }, // not supported in canvas - { name: 'text-transform', type: t.textTransform }, - { name: 'text-wrap', type: t.textWrap }, - { name: 'text-max-width', type: t.size }, - { name: 'text-events', type: t.bool }, - { name: 'font-family', type: t.fontFamily }, - { name: 'font-style', type: t.fontStyle }, - // { name: 'font-letiant', type: t.fontletiant }, // not useful - { name: 'font-weight', type: t.fontWeight }, - { name: 'font-size', type: t.size }, - { name: 'min-zoomed-font-size', type: t.size }, - - // behaviour - { name: 'events', type: t.bool }, - - // visibility - { name: 'display', type: t.display, triggersZOrder: zd.anyDiff }, - { name: 'visibility', type: t.visibility, triggersZOrder: zd.anyDiff }, - { name: 'opacity', type: t.zeroOneNumber, triggersZOrder: zd.zeroNonZero }, - { name: 'z-compound-depth', type: t.zCompoundDepth, triggersZOrder: zd.anyDiff }, - { name: 'z-index-compare', type: t.zIndexCompare, triggersZOrder: zd.anyDiff }, - { name: 'z-index', type: t.nonNegativeInt, triggersZOrder: zd.anyDiff }, - - // overlays - { name: 'overlay-padding', type: t.size }, - { name: 'overlay-color', type: t.color }, - { name: 'overlay-opacity', type: t.zeroOneNumber }, - - // transition anis - { name: 'transition-property', type: t.propList }, - { name: 'transition-duration', type: t.time }, - { name: 'transition-delay', type: t.time }, - { name: 'transition-timing-function', type: t.easing }, - - // node body - { name: 'height', type: t.nodeSize }, - { name: 'width', type: t.nodeSize }, - { name: 'shape', type: t.nodeShape }, - { name: 'shape-polygon-points', type: t.polygonPointList }, - { name: 'background-color', type: t.color }, - { name: 'background-opacity', type: t.zeroOneNumber }, - { name: 'background-blacken', type: t.nOneOneNumber }, - { name: 'padding', type: t.sizeMaybePercent }, - { name: 'padding-relative-to', type: t.paddingRelativeTo }, - - // node border - { name: 'border-color', type: t.color }, - { name: 'border-opacity', type: t.zeroOneNumber }, - { name: 'border-width', type: t.size }, - { name: 'border-style', type: t.borderStyle }, - - // node background images - { name: 'background-image', type: t.urls }, - { name: 'background-image-crossorigin', type: t.bgCrossOrigin }, - { name: 'background-image-opacity', type: t.zeroOneNumbers }, - { name: 'background-position-x', type: t.bgPos }, - { name: 'background-position-y', type: t.bgPos }, - { name: 'background-width-relative-to', type: t.bgRelativeTo }, - { name: 'background-height-relative-to', type: t.bgRelativeTo }, - { name: 'background-repeat', type: t.bgRepeat }, - { name: 'background-fit', type: t.bgFit }, - { name: 'background-clip', type: t.bgClip }, - { name: 'background-width', type: t.bgWH }, - { name: 'background-height', type: t.bgWH }, - - // compound props - { name: 'position', type: t.position }, - { name: 'compound-sizing-wrt-labels', type: t.compoundIncludeLabels }, - { name: 'min-width', type: t.size }, - { name: 'min-width-bias-left', type: t.sizeMaybePercent }, - { name: 'min-width-bias-right', type: t.sizeMaybePercent }, - { name: 'min-height', type: t.size }, - { name: 'min-height-bias-top', type: t.sizeMaybePercent }, - { name: 'min-height-bias-bottom', type: t.sizeMaybePercent }, - - // edge line - { name: 'line-style', type: t.lineStyle }, - { name: 'line-color', type: t.color }, - { name: 'curve-style', type: t.curveStyle }, - { name: 'haystack-radius', type: t.zeroOneNumber }, - { name: 'source-endpoint', type: t.edgeEndpoint }, - { name: 'target-endpoint', type: t.edgeEndpoint }, - { name: 'control-point-step-size', type: t.size }, - { name: 'control-point-distances', type: t.bidirectionalSizes }, - { name: 'control-point-weights', type: t.numbers }, - { name: 'segment-distances', type: t.bidirectionalSizes }, - { name: 'segment-weights', type: t.numbers }, - { name: 'edge-distances', type: t.edgeDistances }, - { name: 'arrow-scale', type: t.positiveNumber }, - { name: 'loop-direction', type: t.angle }, - { name: 'loop-sweep', type: t.angle }, - { name: 'source-distance-from-node', type: t.size }, - { name: 'target-distance-from-node', type: t.size }, - - // ghost properties - { name: 'ghost', type: t.bool }, - { name: 'ghost-offset-x', type: t.bidirectionalSize }, - { name: 'ghost-offset-y', type: t.bidirectionalSize }, - { name: 'ghost-opacity', type: t.zeroOneNumber }, - - // these are just for the core - { name: 'selection-box-color', type: t.color }, - { name: 'selection-box-opacity', type: t.zeroOneNumber }, - { name: 'selection-box-border-color', type: t.color }, - { name: 'selection-box-border-width', type: t.size }, - { name: 'active-bg-color', type: t.color }, - { name: 'active-bg-opacity', type: t.zeroOneNumber }, - { name: 'active-bg-size', type: t.size }, - { name: 'outside-texture-bg-color', type: t.color }, - { name: 'outside-texture-bg-opacity', type: t.zeroOneNumber } - ]; - - // define aliases - let aliases = styfn.aliases = [ - { name: 'content', pointsTo: 'label' }, - { name: 'control-point-distance', pointsTo: 'control-point-distances' }, - { name: 'control-point-weight', pointsTo: 'control-point-weights' }, - { name: 'edge-text-rotation', pointsTo: 'text-rotation' }, - { name: 'padding-left', pointsTo: 'padding' }, - { name: 'padding-right', pointsTo: 'padding' }, - { name: 'padding-top', pointsTo: 'padding' }, - { name: 'padding-bottom', pointsTo: 'padding' } - ]; - - // pie backgrounds for nodes - styfn.pieBackgroundN = 16; // because the pie properties are numbered, give access to a constant N (for renderer use) - props.push( { name: 'pie-size', type: t.sizeMaybePercent } ); - for( let i = 1; i <= styfn.pieBackgroundN; i++ ){ - props.push( { name: 'pie-' + i + '-background-color', type: t.color } ); - props.push( { name: 'pie-' + i + '-background-size', type: t.percent } ); - props.push( { name: 'pie-' + i + '-background-opacity', type: t.zeroOneNumber } ); - } - - // edge arrows - let arrowPrefixes = styfn.arrowPrefixes = [ 'source', 'mid-source', 'target', 'mid-target' ]; - [ - { name: 'arrow-shape', type: t.arrowShape }, - { name: 'arrow-color', type: t.color }, - { name: 'arrow-fill', type: t.arrowFill } - ].forEach( function( prop ){ - arrowPrefixes.forEach( function( prefix ){ - let name = prefix + '-' + prop.name; - let type = prop.type; - - props.push( { name: name, type: type } ); - } ); - }, {} ); - - // list of property names - styfn.propertyNames = props.map( function( p ){ return p.name; } ); - - // allow access of properties by name ( e.g. style.properties.height ) - for( let i = 0; i < props.length; i++ ){ - let prop = props[ i ]; - - props[ prop.name ] = prop; // allow lookup by name - } - - // map aliases - for( let i = 0; i < aliases.length; i++ ){ - let alias = aliases[ i ]; - let pointsToProp = props[ alias.pointsTo ]; - let aliasProp = { - name: alias.name, - alias: true, - pointsTo: pointsToProp - }; - - // add alias prop for parsing - props.push( aliasProp ); - - props[ alias.name ] = aliasProp; // allow lookup by name - } -})(); - -styfn.getDefaultProperty = function( name ){ - return this.getDefaultProperties()[ name ]; -}; - -styfn.getDefaultProperties = util.memoize( function(){ - let rawProps = util.extend( { - // common node/edge props - 'events': 'yes', - 'text-events': 'no', - 'text-valign': 'top', - 'text-halign': 'center', - 'color': '#000', - 'text-outline-color': '#000', - 'text-outline-width': 0, - 'text-outline-opacity': 1, - 'text-opacity': 1, - 'text-decoration': 'none', - 'text-transform': 'none', - 'text-wrap': 'none', - 'text-max-width': 9999, - 'text-background-color': '#000', - 'text-background-opacity': 0, - 'text-background-shape': 'rectangle', - 'text-background-padding': 0, - 'text-border-opacity': 0, - 'text-border-width': 0, - 'text-border-style': 'solid', - 'text-border-color': '#000', - 'font-family': 'Helvetica Neue, Helvetica, sans-serif', - 'font-style': 'normal', - // 'font-letiant': fontletiant, - 'font-weight': 'normal', - 'font-size': 16, - 'min-zoomed-font-size': 0, - 'text-rotation': 'none', - 'source-text-rotation': 'none', - 'target-text-rotation': 'none', - 'visibility': 'visible', - 'display': 'element', - 'opacity': 1, - 'z-compound-depth': 'auto', - 'z-index-compare': 'auto', - 'z-index': 0, - 'label': '', - 'text-margin-x': 0, - 'text-margin-y': 0, - 'source-label': '', - 'source-text-offset': 0, - 'source-text-margin-x': 0, - 'source-text-margin-y': 0, - 'target-label': '', - 'target-text-offset': 0, - 'target-text-margin-x': 0, - 'target-text-margin-y': 0, - 'overlay-opacity': 0, - 'overlay-color': '#000', - 'overlay-padding': 10, - 'transition-property': 'none', - 'transition-duration': 0, - 'transition-delay': 0, - 'transition-timing-function': 'linear', - - // node props - 'background-blacken': 0, - 'background-color': '#999', - 'background-opacity': 1, - 'background-image': 'none', - 'background-image-crossorigin': 'anonymous', - 'background-image-opacity': 1, - 'background-position-x': '50%', - 'background-position-y': '50%', - 'background-width-relative-to': 'include-padding', - 'background-height-relative-to': 'include-padding', - 'background-repeat': 'no-repeat', - 'background-fit': 'none', - 'background-clip': 'node', - 'background-width': 'auto', - 'background-height': 'auto', - 'border-color': '#000', - 'border-opacity': 1, - 'border-width': 0, - 'border-style': 'solid', - 'height': 30, - 'width': 30, - 'shape': 'ellipse', - 'shape-polygon-points': '-1, -1, 1, -1, 1, 1, -1, 1', - - // ghost props - 'ghost': 'no', - 'ghost-offset-y': 0, - 'ghost-offset-x': 0, - 'ghost-opacity': 0, - - // compound props - 'padding': 0, - 'padding-relative-to': 'width', - 'position': 'origin', - 'compound-sizing-wrt-labels': 'include', - 'min-width': 0, - 'min-width-bias-left': 0, - 'min-width-bias-right': 0, - 'min-height': 0, - 'min-height-bias-top': 0, - 'min-height-bias-bottom': 0 - }, { - // node pie bg - 'pie-size': '100%' - }, [ - { name: 'pie-{{i}}-background-color', value: 'black' }, - { name: 'pie-{{i}}-background-size', value: '0%' }, - { name: 'pie-{{i}}-background-opacity', value: 1 } - ].reduce( function( css, prop ){ - for( let i = 1; i <= styfn.pieBackgroundN; i++ ){ - let name = prop.name.replace( '{{i}}', i ); - let val = prop.value; - - css[ name ] = val; - } - - return css; - }, {} ), { - // edge props - 'line-style': 'solid', - 'line-color': '#999', - 'control-point-step-size': 40, - 'control-point-weights': 0.5, - 'segment-weights': 0.5, - 'segment-distances': 20, - 'edge-distances': 'intersection', - 'curve-style': 'bezier', - 'haystack-radius': 0, - 'arrow-scale': 1, - 'loop-direction': '-45deg', - 'loop-sweep': '-90deg', - 'source-distance-from-node': 0, - 'target-distance-from-node': 0, - 'source-endpoint': 'outside-to-node', - 'target-endpoint': 'outside-to-node' - }, [ - { name: 'arrow-shape', value: 'none' }, - { name: 'arrow-color', value: '#999' }, - { name: 'arrow-fill', value: 'filled' } - ].reduce( function( css, prop ){ - styfn.arrowPrefixes.forEach( function( prefix ){ - let name = prefix + '-' + prop.name; - let val = prop.value; - - css[ name ] = val; - } ); - - return css; - }, {} ) ); - - let parsedProps = {}; - - for( let i = 0; i < this.properties.length; i++ ){ - let prop = this.properties[i]; - - if( prop.pointsTo ){ continue; } - - let name = prop.name; - let val = rawProps[ name ]; - let parsedProp = this.parse( name, val ); - - parsedProps[ name ] = parsedProp; - } - - return parsedProps; -} ); - -styfn.addDefaultStylesheet = function(){ - this - .selector( '$node > node' ) // compound (parent) node properties - .css( { - 'shape': 'rectangle', - 'padding': 10, - 'background-color': '#eee', - 'border-color': '#ccc', - 'border-width': 1 - } ) - .selector( 'edge' ) // just edge properties - .css( { - 'width': 3, - 'curve-style': 'haystack' - } ) - .selector( ':parent <-> node' ) - .css( { - 'curve-style': 'bezier', - 'source-endpoint': 'outside-to-line', - 'target-endpoint': 'outside-to-line' - } ) - .selector( ':selected' ) - .css( { - 'background-color': '#0169D9', - 'line-color': '#0169D9', - 'source-arrow-color': '#0169D9', - 'target-arrow-color': '#0169D9', - 'mid-source-arrow-color': '#0169D9', - 'mid-target-arrow-color': '#0169D9' - } ) - .selector( 'node:parent:selected' ) - .css( { - 'background-color': '#CCE1F9', - 'border-color': '#aec8e5' - } ) - .selector( ':active' ) - .css( { - 'overlay-color': 'black', - 'overlay-padding': 10, - 'overlay-opacity': 0.25 - } ) - .selector( 'core' ) // just core properties - .css( { - 'selection-box-color': '#ddd', - 'selection-box-opacity': 0.65, - 'selection-box-border-color': '#aaa', - 'selection-box-border-width': 1, - 'active-bg-color': 'black', - 'active-bg-opacity': 0.15, - 'active-bg-size': 30, - 'outside-texture-bg-color': '#000', - 'outside-texture-bg-opacity': 0.125 - } ) - ; - - this.defaultLength = this.length; -}; - -module.exports = styfn; diff --git a/node_modules/cytoscape/src/style/string-sheet.js b/node_modules/cytoscape/src/style/string-sheet.js deleted file mode 100644 index 35a476ccc..000000000 --- a/node_modules/cytoscape/src/style/string-sheet.js +++ /dev/null @@ -1,136 +0,0 @@ -let util = require( '../util' ); -let Selector = require( '../selector' ); - -let styfn = {}; - -styfn.appendFromString = function( string ){ - let self = this; - let style = this; - let remaining = '' + string; - let selAndBlockStr; - let blockRem; - let propAndValStr; - - // remove comments from the style string - remaining = remaining.replace( /[/][*](\s|.)+?[*][/]/g, '' ); - - function removeSelAndBlockFromRemaining(){ - // remove the parsed selector and block from the remaining text to parse - if( remaining.length > selAndBlockStr.length ){ - remaining = remaining.substr( selAndBlockStr.length ); - } else { - remaining = ''; - } - } - - function removePropAndValFromRem(){ - // remove the parsed property and value from the remaining block text to parse - if( blockRem.length > propAndValStr.length ){ - blockRem = blockRem.substr( propAndValStr.length ); - } else { - blockRem = ''; - } - } - - while( true ){ - let nothingLeftToParse = remaining.match( /^\s*$/ ); - if( nothingLeftToParse ){ break; } - - let selAndBlock = remaining.match( /^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/ ); - - if( !selAndBlock ){ - util.error( 'Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: ' + remaining ); - break; - } - - selAndBlockStr = selAndBlock[0]; - - // parse the selector - let selectorStr = selAndBlock[1]; - if( selectorStr !== 'core' ){ - let selector = new Selector( selectorStr ); - if( selector._private.invalid ){ - util.error( 'Skipping parsing of block: Invalid selector found in string stylesheet: ' + selectorStr ); - - // skip this selector and block - removeSelAndBlockFromRemaining(); - continue; - } - } - - // parse the block of properties and values - let blockStr = selAndBlock[2]; - let invalidBlock = false; - blockRem = blockStr; - let props = []; - - while( true ){ - let nothingLeftToParse = blockRem.match( /^\s*$/ ); - if( nothingLeftToParse ){ break; } - - let propAndVal = blockRem.match( /^\s*(.+?)\s*:\s*(.+?)\s*;/ ); - - if( !propAndVal ){ - util.error( 'Skipping parsing of block: Invalid formatting of style property and value definitions found in:' + blockStr ); - invalidBlock = true; - break; - } - - propAndValStr = propAndVal[0]; - let propStr = propAndVal[1]; - let valStr = propAndVal[2]; - - let prop = self.properties[ propStr ]; - if( !prop ){ - util.error( 'Skipping property: Invalid property name in: ' + propAndValStr ); - - // skip this property in the block - removePropAndValFromRem(); - continue; - } - - let parsedProp = style.parse( propStr, valStr ); - - if( !parsedProp ){ - util.error( 'Skipping property: Invalid property definition in: ' + propAndValStr ); - - // skip this property in the block - removePropAndValFromRem(); - continue; - } - - props.push( { - name: propStr, - val: valStr - } ); - removePropAndValFromRem(); - } - - if( invalidBlock ){ - removeSelAndBlockFromRemaining(); - break; - } - - // put the parsed block in the style - style.selector( selectorStr ); - for( let i = 0; i < props.length; i++ ){ - let prop = props[ i ]; - style.css( prop.name, prop.val ); - } - - removeSelAndBlockFromRemaining(); - } - - return style; -}; - -styfn.fromString = function( string ){ - let style = this; - - style.resetToDefault(); - style.appendFromString( string ); - - return style; -}; - -module.exports = styfn; diff --git a/node_modules/cytoscape/src/stylesheet.js b/node_modules/cytoscape/src/stylesheet.js deleted file mode 100644 index 39788d020..000000000 --- a/node_modules/cytoscape/src/stylesheet.js +++ /dev/null @@ -1,96 +0,0 @@ -let is = require( './is' ); -let util = require( './util' ); -let Style = require( './style' ); - -// a dummy stylesheet object that doesn't need a reference to the core -// (useful for init) -let Stylesheet = function(){ - if( !(this instanceof Stylesheet) ){ - return new Stylesheet(); - } - - this.length = 0; -}; - -let sheetfn = Stylesheet.prototype; - -sheetfn.instanceString = function(){ - return 'stylesheet'; -}; - -// just store the selector to be parsed later -sheetfn.selector = function( selector ){ - let i = this.length++; - - this[ i ] = { - selector: selector, - properties: [] - }; - - return this; // chaining -}; - -// just store the property to be parsed later -sheetfn.css = function( name, value ){ - let i = this.length - 1; - - if( is.string( name ) ){ - this[ i ].properties.push( { - name: name, - value: value - } ); - } else if( is.plainObject( name ) ){ - let map = name; - - for( let j = 0; j < Style.properties.length; j++ ){ - let prop = Style.properties[ j ]; - let mapVal = map[ prop.name ]; - - if( mapVal === undefined ){ // also try camel case name - mapVal = map[ util.dash2camel( prop.name ) ]; - } - - if( mapVal !== undefined ){ - let name = prop.name; - let value = mapVal; - - this[ i ].properties.push( { - name: name, - value: value - } ); - } - } - } - - return this; // chaining -}; - -sheetfn.style = sheetfn.css; - -// generate a real style object from the dummy stylesheet -sheetfn.generateStyle = function( cy ){ - let style = new Style( cy ); - - return this.appendToStyle( style ); -}; - -// append a dummy stylesheet object on a real style object -sheetfn.appendToStyle = function( style ){ - for( let i = 0; i < this.length; i++ ){ - let context = this[ i ]; - let selector = context.selector; - let props = context.properties; - - style.selector( selector ); // apply selector - - for( let j = 0; j < props.length; j++ ){ - let prop = props[ j ]; - - style.css( prop.name, prop.value ); // apply property - } - } - - return style; -}; - -module.exports = Stylesheet; diff --git a/node_modules/cytoscape/src/test.js b/node_modules/cytoscape/src/test.js deleted file mode 100644 index 6555ebd71..000000000 --- a/node_modules/cytoscape/src/test.js +++ /dev/null @@ -1,14 +0,0 @@ -/* -This file tells the Mocha tests what build of Cytoscape to use. -*/ - -// For Travis or manual build tests, use the CJS build -// NB : Must do `gulp build-cjs` before `mocha` or `gulp-test` -if( process.env.TRAVIS || process.env.TEST_BUILD ){ - module.exports = require('../build/cytoscape.cjs.js'); - -// Otherwise use the unbundled, unbabelified, raw source -// NB : Must use a version of Node that natively supports all JS features used in the lib -} else { - module.exports = require('./index.js'); -} diff --git a/node_modules/cytoscape/src/util/colors.js b/node_modules/cytoscape/src/util/colors.js deleted file mode 100644 index b6c1122e0..000000000 --- a/node_modules/cytoscape/src/util/colors.js +++ /dev/null @@ -1,291 +0,0 @@ -let is = require( '../is' ); - -module.exports = { - // get [r, g, b] from #abc or #aabbcc - hex2tuple: function( hex ){ - if( !(hex.length === 4 || hex.length === 7) || hex[0] !== '#' ){ return; } - - let shortHex = hex.length === 4; - let r, g, b; - let base = 16; - - if( shortHex ){ - r = parseInt( hex[1] + hex[1], base ); - g = parseInt( hex[2] + hex[2], base ); - b = parseInt( hex[3] + hex[3], base ); - } else { - r = parseInt( hex[1] + hex[2], base ); - g = parseInt( hex[3] + hex[4], base ); - b = parseInt( hex[5] + hex[6], base ); - } - - return [ r, g, b ]; - }, - - // get [r, g, b, a] from hsl(0, 0, 0) or hsla(0, 0, 0, 0) - hsl2tuple: function( hsl ){ - let ret; - let h, s, l, a, r, g, b; - function hue2rgb( p, q, t ){ - if( t < 0 ) t += 1; - if( t > 1 ) t -= 1; - if( t < 1 / 6 ) return p + (q - p) * 6 * t; - if( t < 1 / 2 ) return q; - if( t < 2 / 3 ) return p + (q - p) * (2 / 3 - t) * 6; - return p; - } - - let m = new RegExp( '^' + this.regex.hsla + '$' ).exec( hsl ); - if( m ){ - - // get hue - h = parseInt( m[1] ); - if( h < 0 ){ - h = ( 360 - (-1 * h % 360) ) % 360; - } else if( h > 360 ){ - h = h % 360; - } - h /= 360; // normalise on [0, 1] - - s = parseFloat( m[2] ); - if( s < 0 || s > 100 ){ return; } // saturation is [0, 100] - s = s / 100; // normalise on [0, 1] - - l = parseFloat( m[3] ); - if( l < 0 || l > 100 ){ return; } // lightness is [0, 100] - l = l / 100; // normalise on [0, 1] - - a = m[4]; - if( a !== undefined ){ - a = parseFloat( a ); - - if( a < 0 || a > 1 ){ return; } // alpha is [0, 1] - } - - // now, convert to rgb - // code from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript - if( s === 0 ){ - r = g = b = Math.round( l * 255 ); // achromatic - } else { - let q = l < 0.5 ? l * (1 + s) : l + s - l * s; - let p = 2 * l - q; - r = Math.round( 255 * hue2rgb( p, q, h + 1 / 3 ) ); - g = Math.round( 255 * hue2rgb( p, q, h ) ); - b = Math.round( 255 * hue2rgb( p, q, h - 1 / 3 ) ); - } - - ret = [ r, g, b, a ]; - } - - return ret; - }, - - // get [r, g, b, a] from rgb(0, 0, 0) or rgba(0, 0, 0, 0) - rgb2tuple: function( rgb ){ - let ret; - - let m = new RegExp( '^' + this.regex.rgba + '$' ).exec( rgb ); - if( m ){ - ret = []; - - let isPct = []; - for( let i = 1; i <= 3; i++ ){ - let channel = m[ i ]; - - if( channel[ channel.length - 1 ] === '%' ){ - isPct[ i ] = true; - } - channel = parseFloat( channel ); - - if( isPct[ i ] ){ - channel = channel / 100 * 255; // normalise to [0, 255] - } - - if( channel < 0 || channel > 255 ){ return; } // invalid channel value - - ret.push( Math.floor( channel ) ); - } - - let atLeastOneIsPct = isPct[1] || isPct[2] || isPct[3]; - let allArePct = isPct[1] && isPct[2] && isPct[3]; - if( atLeastOneIsPct && !allArePct ){ return; } // must all be percent values if one is - - let alpha = m[4]; - if( alpha !== undefined ){ - alpha = parseFloat( alpha ); - - if( alpha < 0 || alpha > 1 ){ return; } // invalid alpha value - - ret.push( alpha ); - } - } - - return ret; - }, - - colorname2tuple: function( color ){ - return this.colors[ color.toLowerCase() ]; - }, - - color2tuple: function( color ){ - return ( is.array( color ) ? color : null ) - || this.colorname2tuple( color ) - || this.hex2tuple( color ) - || this.rgb2tuple( color ) - || this.hsl2tuple( color ); - }, - - colors: { - // special colour names - transparent: [0, 0, 0, 0], // NB alpha === 0 - - // regular colours - aliceblue: [ 240, 248, 255 ], - antiquewhite: [ 250, 235, 215 ], - aqua: [0, 255, 255 ], - aquamarine: [ 127, 255, 212 ], - azure: [ 240, 255, 255 ], - beige: [ 245, 245, 220 ], - bisque: [ 255, 228, 196 ], - black: [0, 0, 0], - blanchedalmond: [ 255, 235, 205 ], - blue: [0, 0, 255 ], - blueviolet: [ 138, 43, 226 ], - brown: [ 165, 42, 42 ], - burlywood: [ 222, 184, 135 ], - cadetblue: [ 95, 158, 160 ], - chartreuse: [ 127, 255, 0], - chocolate: [ 210, 105, 30 ], - coral: [ 255, 127, 80 ], - cornflowerblue: [ 100, 149, 237 ], - cornsilk: [ 255, 248, 220 ], - crimson: [ 220, 20, 60 ], - cyan: [0, 255, 255 ], - darkblue: [0, 0, 139 ], - darkcyan: [0, 139, 139 ], - darkgoldenrod: [ 184, 134, 11 ], - darkgray: [ 169, 169, 169 ], - darkgreen: [0, 100, 0], - darkgrey: [ 169, 169, 169 ], - darkkhaki: [ 189, 183, 107 ], - darkmagenta: [ 139, 0, 139 ], - darkolivegreen: [ 85, 107, 47 ], - darkorange: [ 255, 140, 0], - darkorchid: [ 153, 50, 204 ], - darkred: [ 139, 0, 0], - darksalmon: [ 233, 150, 122 ], - darkseagreen: [ 143, 188, 143 ], - darkslateblue: [ 72, 61, 139 ], - darkslategray: [ 47, 79, 79 ], - darkslategrey: [ 47, 79, 79 ], - darkturquoise: [0, 206, 209 ], - darkviolet: [ 148, 0, 211 ], - deeppink: [ 255, 20, 147 ], - deepskyblue: [0, 191, 255 ], - dimgray: [ 105, 105, 105 ], - dimgrey: [ 105, 105, 105 ], - dodgerblue: [ 30, 144, 255 ], - firebrick: [ 178, 34, 34 ], - floralwhite: [ 255, 250, 240 ], - forestgreen: [ 34, 139, 34 ], - fuchsia: [ 255, 0, 255 ], - gainsboro: [ 220, 220, 220 ], - ghostwhite: [ 248, 248, 255 ], - gold: [ 255, 215, 0], - goldenrod: [ 218, 165, 32 ], - gray: [ 128, 128, 128 ], - grey: [ 128, 128, 128 ], - green: [0, 128, 0], - greenyellow: [ 173, 255, 47 ], - honeydew: [ 240, 255, 240 ], - hotpink: [ 255, 105, 180 ], - indianred: [ 205, 92, 92 ], - indigo: [ 75, 0, 130 ], - ivory: [ 255, 255, 240 ], - khaki: [ 240, 230, 140 ], - lavender: [ 230, 230, 250 ], - lavenderblush: [ 255, 240, 245 ], - lawngreen: [ 124, 252, 0], - lemonchiffon: [ 255, 250, 205 ], - lightblue: [ 173, 216, 230 ], - lightcoral: [ 240, 128, 128 ], - lightcyan: [ 224, 255, 255 ], - lightgoldenrodyellow: [ 250, 250, 210 ], - lightgray: [ 211, 211, 211 ], - lightgreen: [ 144, 238, 144 ], - lightgrey: [ 211, 211, 211 ], - lightpink: [ 255, 182, 193 ], - lightsalmon: [ 255, 160, 122 ], - lightseagreen: [ 32, 178, 170 ], - lightskyblue: [ 135, 206, 250 ], - lightslategray: [ 119, 136, 153 ], - lightslategrey: [ 119, 136, 153 ], - lightsteelblue: [ 176, 196, 222 ], - lightyellow: [ 255, 255, 224 ], - lime: [0, 255, 0], - limegreen: [ 50, 205, 50 ], - linen: [ 250, 240, 230 ], - magenta: [ 255, 0, 255 ], - maroon: [ 128, 0, 0], - mediumaquamarine: [ 102, 205, 170 ], - mediumblue: [0, 0, 205 ], - mediumorchid: [ 186, 85, 211 ], - mediumpurple: [ 147, 112, 219 ], - mediumseagreen: [ 60, 179, 113 ], - mediumslateblue: [ 123, 104, 238 ], - mediumspringgreen: [0, 250, 154 ], - mediumturquoise: [ 72, 209, 204 ], - mediumvioletred: [ 199, 21, 133 ], - midnightblue: [ 25, 25, 112 ], - mintcream: [ 245, 255, 250 ], - mistyrose: [ 255, 228, 225 ], - moccasin: [ 255, 228, 181 ], - navajowhite: [ 255, 222, 173 ], - navy: [0, 0, 128 ], - oldlace: [ 253, 245, 230 ], - olive: [ 128, 128, 0], - olivedrab: [ 107, 142, 35 ], - orange: [ 255, 165, 0], - orangered: [ 255, 69, 0], - orchid: [ 218, 112, 214 ], - palegoldenrod: [ 238, 232, 170 ], - palegreen: [ 152, 251, 152 ], - paleturquoise: [ 175, 238, 238 ], - palevioletred: [ 219, 112, 147 ], - papayawhip: [ 255, 239, 213 ], - peachpuff: [ 255, 218, 185 ], - peru: [ 205, 133, 63 ], - pink: [ 255, 192, 203 ], - plum: [ 221, 160, 221 ], - powderblue: [ 176, 224, 230 ], - purple: [ 128, 0, 128 ], - red: [ 255, 0, 0], - rosybrown: [ 188, 143, 143 ], - royalblue: [ 65, 105, 225 ], - saddlebrown: [ 139, 69, 19 ], - salmon: [ 250, 128, 114 ], - sandybrown: [ 244, 164, 96 ], - seagreen: [ 46, 139, 87 ], - seashell: [ 255, 245, 238 ], - sienna: [ 160, 82, 45 ], - silver: [ 192, 192, 192 ], - skyblue: [ 135, 206, 235 ], - slateblue: [ 106, 90, 205 ], - slategray: [ 112, 128, 144 ], - slategrey: [ 112, 128, 144 ], - snow: [ 255, 250, 250 ], - springgreen: [0, 255, 127 ], - steelblue: [ 70, 130, 180 ], - tan: [ 210, 180, 140 ], - teal: [0, 128, 128 ], - thistle: [ 216, 191, 216 ], - tomato: [ 255, 99, 71 ], - turquoise: [ 64, 224, 208 ], - violet: [ 238, 130, 238 ], - wheat: [ 245, 222, 179 ], - white: [ 255, 255, 255 ], - whitesmoke: [ 245, 245, 245 ], - yellow: [ 255, 255, 0], - yellowgreen: [ 154, 205, 50 ] - } -}; diff --git a/node_modules/cytoscape/src/util/index.js b/node_modules/cytoscape/src/util/index.js deleted file mode 100644 index da5a1de6c..000000000 --- a/node_modules/cytoscape/src/util/index.js +++ /dev/null @@ -1,169 +0,0 @@ -/*global console */ - -let is = require( '../is' ); -let math = require( '../math' ); - -let util = { - - MAX_INT: Number.MAX_SAFE_INTEGER || 9007199254740991, - - trueify: function(){ return true; }, - - falsify: function(){ return false; }, - - zeroify: function(){ return 0; }, - - noop: function(){}, - - error: function( msg ){ - /* eslint-disable */ - if( console.error ){ - console.error.apply( console, arguments ); - - if( console.trace ){ console.trace(); } - } else { - console.log.apply( console, arguments ); - - if( console.trace ){ console.trace(); } - } - /* eslint-enable */ - }, - - clone: function( obj ){ - return this.extend( {}, obj ); - }, - - // gets a shallow copy of the argument - copy: function( obj ){ - if( obj == null ){ - return obj; - } if( is.array( obj ) ){ - return obj.slice(); - } else if( is.plainObject( obj ) ){ - return this.clone( obj ); - } else { - return obj; - } - }, - - copyArray: function( arr ){ - return arr.slice(); - }, - - clonePosition: function( pos ){ - return { x: pos.x, y: pos.y }; - }, - - uuid: function( - a,b // placeholders - ){ - for( // loop :) - b=a=''; // b - result , a - numeric letiable - a++<36; // - b+=a*51&52 // if "a" is not 9 or 14 or 19 or 24 - ? // return a random number or 4 - ( - a^15 // if "a" is not 15 - ? // genetate a random number from 0 to 15 - 8^Math.random()* - (a^20?16:4) // unless "a" is 20, in which case a random number from 8 to 11 - : - 4 // otherwise 4 - ).toString(16) - : - '-' // in other cases (if "a" is 9,14,19,24) insert "-" - ); - return b; - } - -}; - -util.makeBoundingBox = math.makeBoundingBox.bind( math ); - -util._staticEmptyObject = {}; - -util.staticEmptyObject = function(){ - return util._staticEmptyObject; -}; - -util.extend = Object.assign != null ? Object.assign.bind( Object ) : function( tgt ){ - let args = arguments; - - for( let i = 1; i < args.length; i++ ){ - let obj = args[ i ]; - - if( obj == null ){ continue; } - - let keys = Object.keys( obj ); - - for( let j = 0; j < keys.length; j++ ){ - let k = keys[j]; - - tgt[ k ] = obj[ k ]; - } - } - - return tgt; -}; - -util.assign = util.extend; - -util.default = function( val, def ){ - if( val === undefined ){ - return def; - } else { - return val; - } -}; - -util.removeFromArray = function( arr, ele, manyCopies ){ - for( let i = arr.length; i >= 0; i-- ){ - if( arr[i] === ele ){ - arr.splice( i, 1 ); - - if( !manyCopies ){ break; } - } - } -}; - -util.clearArray = function( arr ){ - arr.splice( 0, arr.length ); -}; - -util.push = function( arr, otherArr ){ - for( let i = 0; i < otherArr.length; i++ ){ - let el = otherArr[i]; - - arr.push( el ); - } -}; - -util.getPrefixedProperty = function( obj, propName, prefix ){ - if( prefix ){ - propName = this.prependCamel( prefix, propName ); // e.g. (labelWidth, source) => sourceLabelWidth - } - - return obj[ propName ]; -}; - -util.setPrefixedProperty = function( obj, propName, prefix, value ){ - if( prefix ){ - propName = this.prependCamel( prefix, propName ); // e.g. (labelWidth, source) => sourceLabelWidth - } - - obj[ propName ] = value; -}; - -[ - require( './colors' ), - require( './maps' ), - { memoize: require( './memoize' ) }, - require( './regex' ), - require( './strings' ), - require( './timing' ), - require( './sort' ) -].forEach( function( req ){ - util.extend( util, req ); -} ); - -module.exports = util; diff --git a/node_modules/cytoscape/src/util/maps.js b/node_modules/cytoscape/src/util/maps.js deleted file mode 100644 index 80135b84d..000000000 --- a/node_modules/cytoscape/src/util/maps.js +++ /dev/null @@ -1,116 +0,0 @@ -let is = require( '../is' ); - -module.exports = { - // has anything been set in the map - mapEmpty: function( map ){ - let empty = true; - - if( map != null ){ - return Object.keys( map ).length === 0; - } - - return empty; - }, - - // pushes to the array at the end of a map (map may not be built) - pushMap: function( options ){ - let array = this.getMap( options ); - - if( array == null ){ // if empty, put initial array - this.setMap( this.extend( {}, options, { - value: [ options.value ] - } ) ); - } else { - array.push( options.value ); - } - }, - - // sets the value in a map (map may not be built) - setMap: function( options ){ - let obj = options.map; - let key; - let keys = options.keys; - let l = keys.length; - - for( let i = 0; i < l; i++ ){ - let key = keys[ i ]; - - if( is.plainObject( key ) ){ - this.error( 'Tried to set map with object key' ); - } - - if( i < keys.length - 1 ){ - - // extend the map if necessary - if( obj[ key ] == null ){ - obj[ key ] = {}; - } - - obj = obj[ key ]; - } else { - // set the value - obj[ key ] = options.value; - } - } - }, - - // gets the value in a map even if it's not built in places - getMap: function( options ){ - let obj = options.map; - let keys = options.keys; - let l = keys.length; - - for( let i = 0; i < l; i++ ){ - let key = keys[ i ]; - - if( is.plainObject( key ) ){ - this.error( 'Tried to get map with object key' ); - } - - obj = obj[ key ]; - - if( obj == null ){ - return obj; - } - } - - return obj; - }, - - // deletes the entry in the map - deleteMap: function( options ){ - let obj = options.map; - let keys = options.keys; - let l = keys.length; - let keepChildren = options.keepChildren; - - for( let i = 0; i < l; i++ ){ - let key = keys[ i ]; - - if( is.plainObject( key ) ){ - this.error( 'Tried to delete map with object key' ); - } - - let lastKey = i === options.keys.length - 1; - if( lastKey ){ - - if( keepChildren ){ // then only delete child fields not in keepChildren - let children = Object.keys( obj ); - - for( let j = 0; j < children.length; j++ ){ - let child = children[j]; - - if( !keepChildren[ child ] ){ - obj[ child ] = undefined; - } - } - } else { - obj[ key ] = undefined; - } - - } else { - obj = obj[ key ]; - } - } - } -}; diff --git a/node_modules/cytoscape/src/util/memoize.js b/node_modules/cytoscape/src/util/memoize.js deleted file mode 100644 index f1b5f0bcc..000000000 --- a/node_modules/cytoscape/src/util/memoize.js +++ /dev/null @@ -1,37 +0,0 @@ -module.exports = function memoize( fn, keyFn ){ - if( !keyFn ){ - keyFn = function(){ - if( arguments.length === 1 ){ - return arguments[0]; - } else if( arguments.length === 0 ){ - return 'undefined'; - } - - let args = []; - - for( let i = 0; i < arguments.length; i++ ){ - args.push( arguments[ i ] ); - } - - return args.join( '$' ); - }; - } - - let memoizedFn = function(){ - let self = this; - let args = arguments; - let ret; - let k = keyFn.apply( self, args ); - let cache = memoizedFn.cache; - - if( !(ret = cache[ k ]) ){ - ret = cache[ k ] = fn.apply( self, args ); - } - - return ret; - }; - - memoizedFn.cache = {}; - - return memoizedFn; -}; diff --git a/node_modules/cytoscape/src/util/regex.js b/node_modules/cytoscape/src/util/regex.js deleted file mode 100644 index 203c03f8d..000000000 --- a/node_modules/cytoscape/src/util/regex.js +++ /dev/null @@ -1,22 +0,0 @@ -let number = '(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))'; - -let rgba = 'rgb[a]?\\((' + number + '[%]?)\\s*,\\s*(' + number + '[%]?)\\s*,\\s*(' + number + '[%]?)(?:\\s*,\\s*(' + number + '))?\\)'; -let rgbaNoBackRefs = 'rgb[a]?\\((?:' + number + '[%]?)\\s*,\\s*(?:' + number + '[%]?)\\s*,\\s*(?:' + number + '[%]?)(?:\\s*,\\s*(?:' + number + '))?\\)'; - -let hsla = 'hsl[a]?\\((' + number + ')\\s*,\\s*(' + number + '[%])\\s*,\\s*(' + number + '[%])(?:\\s*,\\s*(' + number + '))?\\)'; -let hslaNoBackRefs = 'hsl[a]?\\((?:' + number + ')\\s*,\\s*(?:' + number + '[%])\\s*,\\s*(?:' + number + '[%])(?:\\s*,\\s*(?:' + number + '))?\\)'; - -let hex3 = '\\#[0-9a-fA-F]{3}'; -let hex6 = '\\#[0-9a-fA-F]{6}'; - -module.exports = { - regex: { - number: number, - rgba: rgba, - rgbaNoBackRefs: rgbaNoBackRefs, - hsla: hsla, - hslaNoBackRefs: hslaNoBackRefs, - hex3: hex3, - hex6: hex6 - } -}; diff --git a/node_modules/cytoscape/src/util/sort.js b/node_modules/cytoscape/src/util/sort.js deleted file mode 100644 index c39614ac9..000000000 --- a/node_modules/cytoscape/src/util/sort.js +++ /dev/null @@ -1,20 +0,0 @@ -function ascending( a, b ){ - if( a < b ){ - return -1; - } else if( a > b ){ - return 1; - } else { - return 0; - } -} - -function descending( a, b ){ - return -1 * ascending( a, b ); -} - -module.exports = { - sort: { - ascending: ascending, - descending: descending - } -}; diff --git a/node_modules/cytoscape/src/util/strings.js b/node_modules/cytoscape/src/util/strings.js deleted file mode 100644 index 27fd6ec10..000000000 --- a/node_modules/cytoscape/src/util/strings.js +++ /dev/null @@ -1,32 +0,0 @@ -let memoize = require( './memoize' ); -let is = require( '../is' ); - -module.exports = { - - camel2dash: memoize( function( str ){ - return str.replace( /([A-Z])/g, function( v ){ - return '-' + v.toLowerCase(); - } ); - } ), - - dash2camel: memoize( function( str ){ - return str.replace( /(-\w)/g, function( v ){ - return v[1].toUpperCase(); - } ); - } ), - - prependCamel: memoize( function( prefix, str ){ - return prefix + str[0].toUpperCase() + str.substring(1); - }, function( prefix, str ){ - return prefix + '$' + str; - } ), - - capitalize: function( str ){ - if( is.emptyString( str ) ){ - return str; - } - - return str.charAt( 0 ).toUpperCase() + str.substring( 1 ); - } - -}; diff --git a/node_modules/cytoscape/src/util/timing.js b/node_modules/cytoscape/src/util/timing.js deleted file mode 100644 index ca8c17448..000000000 --- a/node_modules/cytoscape/src/util/timing.js +++ /dev/null @@ -1,42 +0,0 @@ -var window = require( '../window' ); -var performance = window ? window.performance : null; - -var util = {}; - -var pnow = performance && performance.now ? function(){ return performance.now(); } : function(){ return Date.now(); }; - -var raf = (function(){ - if( window ) { - if( window.requestAnimationFrame ){ - return function( fn ){ window.requestAnimationFrame( fn ); }; - } else if( window.mozRequestAnimationFrame ){ - return function( fn ){ window.mozRequestAnimationFrame( fn ); }; - } else if( window.webkitRequestAnimationFrame ){ - return function( fn ){ window.webkitRequestAnimationFrame( fn ); }; - } else if( window.msRequestAnimationFrame ){ - return function( fn ){ window.msRequestAnimationFrame( fn ); }; - } - } - - return function( fn ){ - if( fn ){ - setTimeout( function(){ - fn( pnow() ); - }, 1000 / 60 ); - } - } -})(); - -util.requestAnimationFrame = function( fn ){ - raf( fn ); -}; - -util.performanceNow = pnow; - -util.debounce = require('lodash.debounce'); - -util.now = function(){ - return Date.now(); -}; - -module.exports = util; diff --git a/node_modules/cytoscape/src/version.js b/node_modules/cytoscape/src/version.js deleted file mode 100644 index a61b268e9..000000000 --- a/node_modules/cytoscape/src/version.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = "3.2.18"; diff --git a/node_modules/cytoscape/src/version.json b/node_modules/cytoscape/src/version.json deleted file mode 100644 index 276888df7..000000000 --- a/node_modules/cytoscape/src/version.json +++ /dev/null @@ -1 +0,0 @@ -"snapshot-5b8143d96d-1474401082113" \ No newline at end of file diff --git a/node_modules/cytoscape/src/window.js b/node_modules/cytoscape/src/window.js deleted file mode 100644 index dad018123..000000000 --- a/node_modules/cytoscape/src/window.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = ( typeof window === 'undefined' ? null : window ); // eslint-disable-line no-undef diff --git a/node_modules/cytoscape/webpack.config.js b/node_modules/cytoscape/webpack.config.js deleted file mode 100644 index 6e4dab6f6..000000000 --- a/node_modules/cytoscape/webpack.config.js +++ /dev/null @@ -1,59 +0,0 @@ -var env = function( name, def ){ - var val = process.env[ name ]; - - if( val === undefined || val === '' ){ - return def; - } else { - return val; - } -}; -var boolEnv = function( name, def ){ - return env( name, def ) == 'true'; -}; -var FILENAME = env('FILENAME', 'cytoscape.js'); -var NODE_ENV = env('NODE_ENV', ''); -var MINIFY = boolEnv('MINIFY', false); -var BABEL = boolEnv('BABEL', true); -var SOURCEMAPS = boolEnv('SOURCEMAPS', false); -var pkg = require('./package.json'); -var path = require('path'); -var webpack = require('webpack'); - -module.exports = { - entry: './src/index.js', - output: { - path: path.resolve(__dirname, 'build'), - filename: FILENAME, - library: 'cytoscape', - libraryTarget: 'umd' - }, - externals: NODE_ENV === 'production' ? Object.keys( pkg.dependencies || {} ) : [], - module: { - rules: [ // common rules - - ].concat( BABEL ? [ - { - loader: 'babel-loader', - test: /\.js$/, - include: [ - path.resolve(__dirname, 'src') - ], - exclude: [ - path.resolve(__dirname, 'node_modules') - ] - } - ] : []) - }, - plugins: [ // common plugins - - ].concat( MINIFY ? [ // minify plugins - new webpack.optimize.UglifyJsPlugin({ - compress: { - warnings: false, - drop_console: false, - } - }) - ] : [] ), - devtool: SOURCEMAPS ? 'inline-source-map' : false, - node: false -}; diff --git a/node_modules/date-now/.npmignore b/node_modules/date-now/.npmignore deleted file mode 100644 index aa3fd4b85..000000000 --- a/node_modules/date-now/.npmignore +++ /dev/null @@ -1,14 +0,0 @@ -.DS_Store -.monitor -.*.swp -.nodemonignore -releases -*.log -*.err -fleet.json -public/browserify -bin/*.json -.bin -build -compile -.lock-wscript diff --git a/node_modules/date-now/.testem.json b/node_modules/date-now/.testem.json deleted file mode 100644 index 633c2ba84..000000000 --- a/node_modules/date-now/.testem.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "launchers": { - "node": { - "command": "npm test" - } - }, - "src_files": [ - "./**/*.js" - ], - "before_tests": "npm run build", - "on_exit": "rm test/static/bundle.js", - "test_page": "test/static/index.html", - "launch_in_dev": ["node", "phantomjs"] -} diff --git a/node_modules/date-now/.travis.yml b/node_modules/date-now/.travis.yml deleted file mode 100644 index ed178f635..000000000 --- a/node_modules/date-now/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.8 - - 0.9 diff --git a/node_modules/date-now/LICENCE b/node_modules/date-now/LICENCE deleted file mode 100644 index 822d880b9..000000000 --- a/node_modules/date-now/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012 Colingo. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/date-now/README.md b/node_modules/date-now/README.md deleted file mode 100644 index 22d267536..000000000 --- a/node_modules/date-now/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# date-now - -[![build status][1]][2] - -[![browser support][3]][4] - -A requirable version of Date.now() - -Use-case is to be able to mock out Date.now() using require interception. - -## Example - -```js -var now = require("date-now") - -var ts = now() -var ts2 = Date.now() -assert.equal(ts, ts2) -``` - -## example of seed - -``` -var now = require("date-now/seed")(timeStampFromServer) - -// ts is in "sync" with the seed value from the server -// useful if your users have their local time being a few minutes -// out of your server time. -var ts = now() -``` - -## Installation - -`npm install date-now` - -## Contributors - - - Raynos - -## MIT Licenced - - [1]: https://secure.travis-ci.org/Colingo/date-now.png - [2]: http://travis-ci.org/Colingo/date-now - [3]: http://ci.testling.com/Colingo/date-now.png - [4]: http://ci.testling.com/Colingo/date-now diff --git a/node_modules/date-now/index.js b/node_modules/date-now/index.js deleted file mode 100644 index d5f143a84..000000000 --- a/node_modules/date-now/index.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = now - -function now() { - return new Date().getTime() -} diff --git a/node_modules/date-now/package.json b/node_modules/date-now/package.json deleted file mode 100644 index 53470ad02..000000000 --- a/node_modules/date-now/package.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "_from": "date-now@^0.1.4", - "_id": "date-now@0.1.4", - "_inBundle": false, - "_integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", - "_location": "/date-now", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "date-now@^0.1.4", - "name": "date-now", - "escapedName": "date-now", - "rawSpec": "^0.1.4", - "saveSpec": null, - "fetchSpec": "^0.1.4" - }, - "_requiredBy": [ - "/console-browserify" - ], - "_resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", - "_shasum": "eaf439fd4d4848ad74e5cc7dbef200672b9e345b", - "_spec": "date-now@^0.1.4", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/console-browserify", - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "bugs": { - "url": "https://github.com/Colingo/date-now/issues", - "email": "raynos2@gmail.com" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Artem Shoobovych" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "A requirable version of Date.now()", - "devDependencies": { - "browserify": "https://github.com/raynos/node-browserify/tarball/master", - "tape": "~0.2.2", - "testem": "~0.2.52" - }, - "homepage": "https://github.com/Colingo/date-now", - "keywords": [], - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/Colingo/date-now/raw/master/LICENSE" - } - ], - "main": "index", - "name": "date-now", - "repository": { - "type": "git", - "url": "git://github.com/Colingo/date-now.git" - }, - "scripts": { - "build": "browserify test/index.js -o test/static/bundle.js", - "test": "node ./test", - "testem": "testem" - }, - "testling": { - "files": "test/*.js", - "browsers": { - "ie": [ - "8", - "9", - "10" - ], - "firefox": [ - "16", - "17", - "nightly" - ], - "chrome": [ - "22", - "23", - "canary" - ], - "opera": [ - "12", - "next" - ], - "safari": [ - "5.1" - ] - } - }, - "version": "0.1.4" -} diff --git a/node_modules/date-now/seed.js b/node_modules/date-now/seed.js deleted file mode 100644 index b9727c5a3..000000000 --- a/node_modules/date-now/seed.js +++ /dev/null @@ -1,16 +0,0 @@ -var now = require("./index") - -module.exports = seeded - -/* Returns a Date.now() like function that's in sync with - the seed value -*/ -function seeded(seed) { - var current = now() - - return time - - function time() { - return seed + (now() - current) - } -} diff --git a/node_modules/date-now/test/index.js b/node_modules/date-now/test/index.js deleted file mode 100644 index 270584cab..000000000 --- a/node_modules/date-now/test/index.js +++ /dev/null @@ -1,28 +0,0 @@ -var test = require("tape") -var setTimeout = require("timers").setTimeout - -var now = require("../index") -var seeded = require("../seed") - -test("date", function (assert) { - var ts = now() - var ts2 = Date.now() - assert.equal(ts, ts2) - assert.end() -}) - -test("seeded", function (assert) { - var time = seeded(40) - var ts = time() - - within(assert, time(), 40, 5) - setTimeout(function () { - within(assert, time(), 90, 10) - assert.end() - }, 50) -}) - -function within(assert, a, b, offset) { - assert.ok(a + offset > b) - assert.ok(a - offset < b) -} diff --git a/node_modules/date-now/test/static/index.html b/node_modules/date-now/test/static/index.html deleted file mode 100644 index 3d5384da8..000000000 --- a/node_modules/date-now/test/static/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - TAPE Example - - - - - - diff --git a/node_modules/debounce/History.md b/node_modules/debounce/History.md deleted file mode 100644 index 88add89c0..000000000 --- a/node_modules/debounce/History.md +++ /dev/null @@ -1,50 +0,0 @@ - -1.2.0 / 2018-08-14 -================== - - * Added a .debounce member to debounce (#21) - -1.1.0 / 2017-10-30 -================== - - * Ability to force execution (#16) - -1.0.2 / 2017-04-21 -================== - - * Fixes #3 - Debounced function executing early? (#15) - * Merge pull request #13 from selbekk/master - * Remove date-now from package.json - * Remove date-now dependency from component.json - * Remove date-now usage - -1.0.1 / 2016-07-25 -================== - - * add ability to clear timer (#10) - -1.0.0 / 2014-06-21 -================== - - * Readme: attribute underscore.js in the License section - * index: rewrite to use underscore.js' implementation (#2, @TooTallNate) - * component, package: add "date-now" as a dependency - * test: fix test - * component, package: add "keywords" array - * package: adjust "description" - * package: added "repository" field (#1, @juliangruber) - -0.0.3 / 2013-08-21 -================== - - * immediate now defaults to `false` - -0.0.2 / 2013-07-27 -================== - - * consolidated with TJ's debounce - -0.0.1 / 2012-11-5 -================== - - * Initial release diff --git a/node_modules/debounce/Makefile b/node_modules/debounce/Makefile deleted file mode 100644 index 0f14dac30..000000000 --- a/node_modules/debounce/Makefile +++ /dev/null @@ -1,11 +0,0 @@ - -build: components index.js - @component build --dev - -components: component.json - @component install --dev - -clean: - rm -fr build components template.js - -.PHONY: clean diff --git a/node_modules/debounce/Readme.md b/node_modules/debounce/Readme.md deleted file mode 100644 index 8639f0bf4..000000000 --- a/node_modules/debounce/Readme.md +++ /dev/null @@ -1,69 +0,0 @@ - -# debounce - - Useful for implementing behavior that should only happen after a repeated - action has completed. - -## Installation - - $ component install component/debounce - - Or in node: - - $ npm install debounce - -## Example - -```js -var debounce = require('debounce'); -window.onresize = debounce(resize, 200); - -function resize(e) { - console.log('height', window.innerHeight); - console.log('width', window.innerWidth); -} -``` - -To later clear the timer and cancel currently scheduled executions: -``` -window.onresize.clear(); -``` - -To execute any pending invocations and reset the timer: -``` -window.onresize.flush(); -``` - -Alternately, if using newer syntax: - -```js -import { debounce } from "debounce"; -``` - -## API - -### debounce(fn, wait, [ immediate || false ]) - - Creates and returns a new debounced version of the passed function that - will postpone its execution until after wait milliseconds have elapsed - since the last time it was invoked. - - Pass `true` for the `immediate` parameter to cause debounce to trigger - the function on the leading edge instead of the trailing edge of the wait - interval. Useful in circumstances like preventing accidental double-clicks - on a "submit" button from firing a second time. - - The debounced function returned has a property 'clear' that is a - function that will clear any scheduled future executions of your function. - - The debounced function returned has a property 'flush' that is a - function that will immediately execute the function if and only if execution is scheduled, - and reset the execution timer for subsequent invocations of the debounced - function. - -## License - - MIT - - Original implementation is from [`underscore.js`](http://underscorejs.org/) - which also has an MIT license. diff --git a/node_modules/debounce/component.json b/node_modules/debounce/component.json deleted file mode 100644 index ae489dfb3..000000000 --- a/node_modules/debounce/component.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "debounce", - "repo": "component/debounce", - "description": "Creates and returns a new debounced version of the passed function that will postpone its execution until after wait milliseconds have elapsed since the last time it was invoked", - "version": "1.2.0", - "main": "index.js", - "scripts": [ - "index.js" - ], - "keywords": [ - "function", - "throttle", - "invoke" - ], - "dependencies": {}, - "development": {}, - "license": "MIT" -} diff --git a/node_modules/debounce/index.js b/node_modules/debounce/index.js deleted file mode 100644 index 4f35c12de..000000000 --- a/node_modules/debounce/index.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Returns a function, that, as long as it continues to be invoked, will not - * be triggered. The function will be called after it stops being called for - * N milliseconds. If `immediate` is passed, trigger the function on the - * leading edge, instead of the trailing. The function also has a property 'clear' - * that is a function which will clear the timer to prevent previously scheduled executions. - * - * @source underscore.js - * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/ - * @param {Function} function to wrap - * @param {Number} timeout in ms (`100`) - * @param {Boolean} whether to execute at the beginning (`false`) - * @api public - */ -function debounce(func, wait, immediate){ - var timeout, args, context, timestamp, result; - if (null == wait) wait = 100; - - function later() { - var last = Date.now() - timestamp; - - if (last < wait && last >= 0) { - timeout = setTimeout(later, wait - last); - } else { - timeout = null; - if (!immediate) { - result = func.apply(context, args); - context = args = null; - } - } - }; - - var debounced = function(){ - context = this; - args = arguments; - timestamp = Date.now(); - var callNow = immediate && !timeout; - if (!timeout) timeout = setTimeout(later, wait); - if (callNow) { - result = func.apply(context, args); - context = args = null; - } - - return result; - }; - - debounced.clear = function() { - if (timeout) { - clearTimeout(timeout); - timeout = null; - } - }; - - debounced.flush = function() { - if (timeout) { - result = func.apply(context, args); - context = args = null; - - clearTimeout(timeout); - timeout = null; - } - }; - - return debounced; -}; - -// Adds compatibility for ES modules -debounce.debounce = debounce; - -module.exports = debounce; diff --git a/node_modules/debounce/package.json b/node_modules/debounce/package.json deleted file mode 100644 index eb63fc718..000000000 --- a/node_modules/debounce/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_from": "debounce@^1.0.0", - "_id": "debounce@1.2.0", - "_inBundle": false, - "_integrity": "sha512-mYtLl1xfZLi1m4RtQYlZgJUNQjl4ZxVnHzIR8nLLgi4q1YT8o/WM+MK/f8yfcc9s5Ir5zRaPZyZU6xs1Syoocg==", - "_location": "/debounce", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "debounce@^1.0.0", - "name": "debounce", - "escapedName": "debounce", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/watchify-middleware" - ], - "_resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.0.tgz", - "_shasum": "44a540abc0ea9943018dc0eaa95cce87f65cd131", - "_spec": "debounce@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/watchify-middleware", - "bugs": { - "url": "https://github.com/component/debounce/issues" - }, - "bundleDependencies": false, - "component": { - "scripts": { - "debounce/index.js": "index.js" - } - }, - "deprecated": false, - "description": "Creates and returns a new debounced version of the passed function that will postpone its execution until after wait milliseconds have elapsed since the last time it was invoked", - "devDependencies": { - "minijasminenode": "^1.1.1", - "mocha": "*", - "should": "*", - "sinon": "^1.17.7" - }, - "homepage": "https://github.com/component/debounce#readme", - "keywords": [ - "function", - "throttle", - "invoke" - ], - "license": "MIT", - "main": "index.js", - "name": "debounce", - "repository": { - "type": "git", - "url": "git://github.com/component/debounce.git" - }, - "scripts": { - "test": "minijasminenode test.js" - }, - "version": "1.2.0" -} diff --git a/node_modules/debounce/test.html b/node_modules/debounce/test.html deleted file mode 100644 index c5e268164..000000000 --- a/node_modules/debounce/test.html +++ /dev/null @@ -1,32 +0,0 @@ - - - Debounce Component - - - Resize the window! -
    - Cancel Print -
    - Print Now - - - - - diff --git a/node_modules/debounce/test.js b/node_modules/debounce/test.js deleted file mode 100644 index f2890e887..000000000 --- a/node_modules/debounce/test.js +++ /dev/null @@ -1,170 +0,0 @@ -var debounce = require('.') -var sinon = require('sinon') - -describe('housekeeping', function() { - it('should be defined as a function', function() { - expect(typeof debounce).toEqual('function') - }) -}) - -describe('catch issue #3 - Debounced function executing early?', function() { - - // use sinon to control the clock - var clock - - beforeEach(function(){ - clock = sinon.useFakeTimers() - }) - - afterEach(function(){ - clock.restore() - }) - - it('should debounce with fast timeout', function() { - - var callback = sinon.spy() - - // set up debounced function with wait of 100 - var fn = debounce(callback, 100) - - // call debounced function at interval of 50 - setTimeout(fn, 100) - setTimeout(fn, 150) - setTimeout(fn, 200) - setTimeout(fn, 250) - - // set the clock to 100 (period of the wait) ticks after the last debounced call - clock.tick(350) - - // the callback should have been triggered once - expect(callback.callCount).toEqual(1) - - }) - -}) - -describe('forcing execution', function() { - - // use sinon to control the clock - var clock - - beforeEach(function(){ - clock = sinon.useFakeTimers() - }) - - afterEach(function(){ - clock.restore() - }) - - it('should not execute prior to timeout', function() { - - var callback = sinon.spy() - - // set up debounced function with wait of 100 - var fn = debounce(callback, 100) - - // call debounced function at interval of 50 - setTimeout(fn, 100) - setTimeout(fn, 150) - - // set the clock to 25 (period of the wait) ticks after the last debounced call - clock.tick(175) - - // the callback should not have been called yet - expect(callback.callCount).toEqual(0) - - }) - - it('should execute prior to timeout when flushed', function() { - - var callback = sinon.spy() - - // set up debounced function with wait of 100 - var fn = debounce(callback, 100) - - // call debounced function at interval of 50 - setTimeout(fn, 100) - setTimeout(fn, 150) - - // set the clock to 25 (period of the wait) ticks after the last debounced call - clock.tick(175) - - fn.flush() - - // the callback has been called - expect(callback.callCount).toEqual(1) - - }) - - it('should not execute again after timeout when flushed before the timeout', function() { - - var callback = sinon.spy() - - // set up debounced function with wait of 100 - var fn = debounce(callback, 100) - - // call debounced function at interval of 50 - setTimeout(fn, 100) - setTimeout(fn, 150) - - // set the clock to 25 (period of the wait) ticks after the last debounced call - clock.tick(175) - - fn.flush() - - // the callback has been called here - expect(callback.callCount).toEqual(1) - - // move to past the timeout - clock.tick(225) - - // the callback should have only been called once - expect(callback.callCount).toEqual(1) - - }) - - it('should not execute on a timer after being flushed', function() { - - var callback = sinon.spy() - - // set up debounced function with wait of 100 - var fn = debounce(callback, 100) - - // call debounced function at interval of 50 - setTimeout(fn, 100) - setTimeout(fn, 150) - - // set the clock to 25 (period of the wait) ticks after the last debounced call - clock.tick(175) - - fn.flush() - - // the callback has been called here - expect(callback.callCount).toEqual(1) - - // schedule again - setTimeout(fn, 250) - - // move to past the new timeout - clock.tick(400) - - // the callback should have been called again - expect(callback.callCount).toEqual(2) - - }) - - it('should not execute when flushed if nothing was scheduled', function() { - - var callback = sinon.spy() - - // set up debounced function with wait of 100 - var fn = debounce(callback, 100) - - fn.flush() - - // the callback should not have been called - expect(callback.callCount).toEqual(0) - - }) - -}) diff --git a/node_modules/debug/.coveralls.yml b/node_modules/debug/.coveralls.yml deleted file mode 100644 index 20a706858..000000000 --- a/node_modules/debug/.coveralls.yml +++ /dev/null @@ -1 +0,0 @@ -repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve diff --git a/node_modules/debug/.eslintrc b/node_modules/debug/.eslintrc deleted file mode 100644 index 8a37ae2c2..000000000 --- a/node_modules/debug/.eslintrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "env": { - "browser": true, - "node": true - }, - "rules": { - "no-console": 0, - "no-empty": [1, { "allowEmptyCatch": true }] - }, - "extends": "eslint:recommended" -} diff --git a/node_modules/debug/.npmignore b/node_modules/debug/.npmignore deleted file mode 100644 index 5f60eecc8..000000000 --- a/node_modules/debug/.npmignore +++ /dev/null @@ -1,9 +0,0 @@ -support -test -examples -example -*.sock -dist -yarn.lock -coverage -bower.json diff --git a/node_modules/debug/.travis.yml b/node_modules/debug/.travis.yml deleted file mode 100644 index 6c6090c3b..000000000 --- a/node_modules/debug/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ - -language: node_js -node_js: - - "6" - - "5" - - "4" - -install: - - make node_modules - -script: - - make lint - - make test - - make coveralls diff --git a/node_modules/debug/CHANGELOG.md b/node_modules/debug/CHANGELOG.md deleted file mode 100644 index eadaa1895..000000000 --- a/node_modules/debug/CHANGELOG.md +++ /dev/null @@ -1,362 +0,0 @@ - -2.6.9 / 2017-09-22 -================== - - * remove ReDoS regexp in %o formatter (#504) - -2.6.8 / 2017-05-18 -================== - - * Fix: Check for undefined on browser globals (#462, @marbemac) - -2.6.7 / 2017-05-16 -================== - - * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) - * Fix: Inline extend function in node implementation (#452, @dougwilson) - * Docs: Fix typo (#455, @msasad) - -2.6.5 / 2017-04-27 -================== - - * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek) - * Misc: clean up browser reference checks (#447, @thebigredgeek) - * Misc: add npm-debug.log to .gitignore (@thebigredgeek) - - -2.6.4 / 2017-04-20 -================== - - * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo) - * Chore: ignore bower.json in npm installations. (#437, @joaovieira) - * Misc: update "ms" to v0.7.3 (@tootallnate) - -2.6.3 / 2017-03-13 -================== - - * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts) - * Docs: Changelog fix (@thebigredgeek) - -2.6.2 / 2017-03-10 -================== - - * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) - * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) - * Docs: Add Slackin invite badge (@tootallnate) - -2.6.1 / 2017-02-10 -================== - - * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error - * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) - * Fix: IE8 "Expected identifier" error (#414, @vgoma) - * Fix: Namespaces would not disable once enabled (#409, @musikov) - -2.6.0 / 2016-12-28 -================== - - * Fix: added better null pointer checks for browser useColors (@thebigredgeek) - * Improvement: removed explicit `window.debug` export (#404, @tootallnate) - * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) - -2.5.2 / 2016-12-25 -================== - - * Fix: reference error on window within webworkers (#393, @KlausTrainer) - * Docs: fixed README typo (#391, @lurch) - * Docs: added notice about v3 api discussion (@thebigredgeek) - -2.5.1 / 2016-12-20 -================== - - * Fix: babel-core compatibility - -2.5.0 / 2016-12-20 -================== - - * Fix: wrong reference in bower file (@thebigredgeek) - * Fix: webworker compatibility (@thebigredgeek) - * Fix: output formatting issue (#388, @kribblo) - * Fix: babel-loader compatibility (#383, @escwald) - * Misc: removed built asset from repo and publications (@thebigredgeek) - * Misc: moved source files to /src (#378, @yamikuronue) - * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) - * Test: coveralls integration (#378, @yamikuronue) - * Docs: simplified language in the opening paragraph (#373, @yamikuronue) - -2.4.5 / 2016-12-17 -================== - - * Fix: `navigator` undefined in Rhino (#376, @jochenberger) - * Fix: custom log function (#379, @hsiliev) - * Improvement: bit of cleanup + linting fixes (@thebigredgeek) - * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) - * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) - -2.4.4 / 2016-12-14 -================== - - * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) - -2.4.3 / 2016-12-14 -================== - - * Fix: navigation.userAgent error for react native (#364, @escwald) - -2.4.2 / 2016-12-14 -================== - - * Fix: browser colors (#367, @tootallnate) - * Misc: travis ci integration (@thebigredgeek) - * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) - -2.4.1 / 2016-12-13 -================== - - * Fix: typo that broke the package (#356) - -2.4.0 / 2016-12-13 -================== - - * Fix: bower.json references unbuilt src entry point (#342, @justmatt) - * Fix: revert "handle regex special characters" (@tootallnate) - * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) - * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) - * Improvement: allow colors in workers (#335, @botverse) - * Improvement: use same color for same namespace. (#338, @lchenay) - -2.3.3 / 2016-11-09 -================== - - * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) - * Fix: Returning `localStorage` saved values (#331, Levi Thomason) - * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) - -2.3.2 / 2016-11-09 -================== - - * Fix: be super-safe in index.js as well (@TooTallNate) - * Fix: should check whether process exists (Tom Newby) - -2.3.1 / 2016-11-09 -================== - - * Fix: Added electron compatibility (#324, @paulcbetts) - * Improvement: Added performance optimizations (@tootallnate) - * Readme: Corrected PowerShell environment variable example (#252, @gimre) - * Misc: Removed yarn lock file from source control (#321, @fengmk2) - -2.3.0 / 2016-11-07 -================== - - * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) - * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) - * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) - * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) - * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) - * Package: Update "ms" to 0.7.2 (#315, @DevSide) - * Package: removed superfluous version property from bower.json (#207 @kkirsche) - * Readme: fix USE_COLORS to DEBUG_COLORS - * Readme: Doc fixes for format string sugar (#269, @mlucool) - * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) - * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) - * Readme: better docs for browser support (#224, @matthewmueller) - * Tooling: Added yarn integration for development (#317, @thebigredgeek) - * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) - * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) - * Misc: Updated contributors (@thebigredgeek) - -2.2.0 / 2015-05-09 -================== - - * package: update "ms" to v0.7.1 (#202, @dougwilson) - * README: add logging to file example (#193, @DanielOchoa) - * README: fixed a typo (#191, @amir-s) - * browser: expose `storage` (#190, @stephenmathieson) - * Makefile: add a `distclean` target (#189, @stephenmathieson) - -2.1.3 / 2015-03-13 -================== - - * Updated stdout/stderr example (#186) - * Updated example/stdout.js to match debug current behaviour - * Renamed example/stderr.js to stdout.js - * Update Readme.md (#184) - * replace high intensity foreground color for bold (#182, #183) - -2.1.2 / 2015-03-01 -================== - - * dist: recompile - * update "ms" to v0.7.0 - * package: update "browserify" to v9.0.3 - * component: fix "ms.js" repo location - * changed bower package name - * updated documentation about using debug in a browser - * fix: security error on safari (#167, #168, @yields) - -2.1.1 / 2014-12-29 -================== - - * browser: use `typeof` to check for `console` existence - * browser: check for `console.log` truthiness (fix IE 8/9) - * browser: add support for Chrome apps - * Readme: added Windows usage remarks - * Add `bower.json` to properly support bower install - -2.1.0 / 2014-10-15 -================== - - * node: implement `DEBUG_FD` env variable support - * package: update "browserify" to v6.1.0 - * package: add "license" field to package.json (#135, @panuhorsmalahti) - -2.0.0 / 2014-09-01 -================== - - * package: update "browserify" to v5.11.0 - * node: use stderr rather than stdout for logging (#29, @stephenmathieson) - -1.0.4 / 2014-07-15 -================== - - * dist: recompile - * example: remove `console.info()` log usage - * example: add "Content-Type" UTF-8 header to browser example - * browser: place %c marker after the space character - * browser: reset the "content" color via `color: inherit` - * browser: add colors support for Firefox >= v31 - * debug: prefer an instance `log()` function over the global one (#119) - * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) - -1.0.3 / 2014-07-09 -================== - - * Add support for multiple wildcards in namespaces (#122, @seegno) - * browser: fix lint - -1.0.2 / 2014-06-10 -================== - - * browser: update color palette (#113, @gscottolson) - * common: make console logging function configurable (#108, @timoxley) - * node: fix %o colors on old node <= 0.8.x - * Makefile: find node path using shell/which (#109, @timoxley) - -1.0.1 / 2014-06-06 -================== - - * browser: use `removeItem()` to clear localStorage - * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) - * package: add "contributors" section - * node: fix comment typo - * README: list authors - -1.0.0 / 2014-06-04 -================== - - * make ms diff be global, not be scope - * debug: ignore empty strings in enable() - * node: make DEBUG_COLORS able to disable coloring - * *: export the `colors` array - * npmignore: don't publish the `dist` dir - * Makefile: refactor to use browserify - * package: add "browserify" as a dev dependency - * Readme: add Web Inspector Colors section - * node: reset terminal color for the debug content - * node: map "%o" to `util.inspect()` - * browser: map "%j" to `JSON.stringify()` - * debug: add custom "formatters" - * debug: use "ms" module for humanizing the diff - * Readme: add "bash" syntax highlighting - * browser: add Firebug color support - * browser: add colors for WebKit browsers - * node: apply log to `console` - * rewrite: abstract common logic for Node & browsers - * add .jshintrc file - -0.8.1 / 2014-04-14 -================== - - * package: re-add the "component" section - -0.8.0 / 2014-03-30 -================== - - * add `enable()` method for nodejs. Closes #27 - * change from stderr to stdout - * remove unnecessary index.js file - -0.7.4 / 2013-11-13 -================== - - * remove "browserify" key from package.json (fixes something in browserify) - -0.7.3 / 2013-10-30 -================== - - * fix: catch localStorage security error when cookies are blocked (Chrome) - * add debug(err) support. Closes #46 - * add .browser prop to package.json. Closes #42 - -0.7.2 / 2013-02-06 -================== - - * fix package.json - * fix: Mobile Safari (private mode) is broken with debug - * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript - -0.7.1 / 2013-02-05 -================== - - * add repository URL to package.json - * add DEBUG_COLORED to force colored output - * add browserify support - * fix component. Closes #24 - -0.7.0 / 2012-05-04 -================== - - * Added .component to package.json - * Added debug.component.js build - -0.6.0 / 2012-03-16 -================== - - * Added support for "-" prefix in DEBUG [Vinay Pulim] - * Added `.enabled` flag to the node version [TooTallNate] - -0.5.0 / 2012-02-02 -================== - - * Added: humanize diffs. Closes #8 - * Added `debug.disable()` to the CS variant - * Removed padding. Closes #10 - * Fixed: persist client-side variant again. Closes #9 - -0.4.0 / 2012-02-01 -================== - - * Added browser variant support for older browsers [TooTallNate] - * Added `debug.enable('project:*')` to browser variant [TooTallNate] - * Added padding to diff (moved it to the right) - -0.3.0 / 2012-01-26 -================== - - * Added millisecond diff when isatty, otherwise UTC string - -0.2.0 / 2012-01-22 -================== - - * Added wildcard support - -0.1.0 / 2011-12-02 -================== - - * Added: remove colors unless stderr isatty [TooTallNate] - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/debug/LICENSE b/node_modules/debug/LICENSE deleted file mode 100644 index 658c933d2..000000000 --- a/node_modules/debug/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 TJ Holowaychuk - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the 'Software'), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT -LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/node_modules/debug/Makefile b/node_modules/debug/Makefile deleted file mode 100644 index 584da8bf9..000000000 --- a/node_modules/debug/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 -THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) -THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) - -# BIN directory -BIN := $(THIS_DIR)/node_modules/.bin - -# Path -PATH := node_modules/.bin:$(PATH) -SHELL := /bin/bash - -# applications -NODE ?= $(shell which node) -YARN ?= $(shell which yarn) -PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm)) -BROWSERIFY ?= $(NODE) $(BIN)/browserify - -.FORCE: - -install: node_modules - -node_modules: package.json - @NODE_ENV= $(PKG) install - @touch node_modules - -lint: .FORCE - eslint browser.js debug.js index.js node.js - -test-node: .FORCE - istanbul cover node_modules/mocha/bin/_mocha -- test/**.js - -test-browser: .FORCE - mkdir -p dist - - @$(BROWSERIFY) \ - --standalone debug \ - . > dist/debug.js - - karma start --single-run - rimraf dist - -test: .FORCE - concurrently \ - "make test-node" \ - "make test-browser" - -coveralls: - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js - -.PHONY: all install clean distclean diff --git a/node_modules/debug/README.md b/node_modules/debug/README.md deleted file mode 100644 index f67be6b31..000000000 --- a/node_modules/debug/README.md +++ /dev/null @@ -1,312 +0,0 @@ -# debug -[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug) [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master) [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) -[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) - - - -A tiny node.js debugging utility modelled after node core's debugging technique. - -**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)** - -## Installation - -```bash -$ npm install debug -``` - -## Usage - -`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. - -Example _app.js_: - -```js -var debug = require('debug')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %s', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); -``` - -Example _worker.js_: - -```js -var debug = require('debug')('worker'); - -setInterval(function(){ - debug('doing some work'); -}, 1000); -``` - - The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: - - ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) - - ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) - -#### Windows note - - On Windows the environment variable is set using the `set` command. - - ```cmd - set DEBUG=*,-not_this - ``` - - Note that PowerShell uses different syntax to set environment variables. - - ```cmd - $env:DEBUG = "*,-not_this" - ``` - -Then, run the program to be debugged as usual. - -## Millisecond diff - - When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. - - ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) - - When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: - - ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) - -## Conventions - - If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". - -## Wildcards - - The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. - - You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". - -## Environment Variables - - When running through Node.js, you can set a few environment variables that will - change the behavior of the debug logging: - -| Name | Purpose | -|-----------|-------------------------------------------------| -| `DEBUG` | Enables/disables specific debugging namespaces. | -| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | -| `DEBUG_DEPTH` | Object inspection depth. | -| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | - - - __Note:__ The environment variables beginning with `DEBUG_` end up being - converted into an Options object that gets used with `%o`/`%O` formatters. - See the Node.js documentation for - [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) - for the complete list. - -## Formatters - - - Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters: - -| Formatter | Representation | -|-----------|----------------| -| `%O` | Pretty-print an Object on multiple lines. | -| `%o` | Pretty-print an Object all on a single line. | -| `%s` | String. | -| `%d` | Number (both integer and float). | -| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | -| `%%` | Single percent sign ('%'). This does not consume an argument. | - -### Custom formatters - - You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like: - -```js -const createDebug = require('debug') -createDebug.formatters.h = (v) => { - return v.toString('hex') -} - -// …elsewhere -const debug = createDebug('foo') -debug('this is hex: %h', new Buffer('hello world')) -// foo this is hex: 68656c6c6f20776f726c6421 +0ms -``` - -## Browser support - You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), - or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), - if you don't want to build it yourself. - - Debug's enable state is currently persisted by `localStorage`. - Consider the situation shown below where you have `worker:a` and `worker:b`, - and wish to debug both. You can enable this using `localStorage.debug`: - -```js -localStorage.debug = 'worker:*' -``` - -And then refresh the page. - -```js -a = debug('worker:a'); -b = debug('worker:b'); - -setInterval(function(){ - a('doing some work'); -}, 1000); - -setInterval(function(){ - b('doing some work'); -}, 1200); -``` - -#### Web Inspector Colors - - Colors are also enabled on "Web Inspectors" that understand the `%c` formatting - option. These are WebKit web inspectors, Firefox ([since version - 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) - and the Firebug plugin for Firefox (any version). - - Colored output looks something like: - - ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) - - -## Output streams - - By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: - -Example _stdout.js_: - -```js -var debug = require('debug'); -var error = debug('app:error'); - -// by default stderr is used -error('goes to stderr!'); - -var log = debug('app:log'); -// set this namespace to log via console.log -log.log = console.log.bind(console); // don't forget to bind to console! -log('goes to stdout'); -error('still goes to stderr!'); - -// set all output to go via console.info -// overrides all per-namespace log settings -debug.log = console.info.bind(console); -error('now goes to stdout via console.info'); -log('still goes to stdout, but via console.info now'); -``` - - -## Authors - - - TJ Holowaychuk - - Nathan Rajlich - - Andrew Rhyne - -## Backers - -Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -## Sponsors - -Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -## License - -(The MIT License) - -Copyright (c) 2014-2016 TJ Holowaychuk <tj@vision-media.ca> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/debug/component.json b/node_modules/debug/component.json deleted file mode 100644 index 9de26410f..000000000 --- a/node_modules/debug/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "debug", - "repo": "visionmedia/debug", - "description": "small debugging utility", - "version": "2.6.9", - "keywords": [ - "debug", - "log", - "debugger" - ], - "main": "src/browser.js", - "scripts": [ - "src/browser.js", - "src/debug.js" - ], - "dependencies": { - "rauchg/ms.js": "0.7.1" - } -} diff --git a/node_modules/debug/karma.conf.js b/node_modules/debug/karma.conf.js deleted file mode 100644 index 103a82d15..000000000 --- a/node_modules/debug/karma.conf.js +++ /dev/null @@ -1,70 +0,0 @@ -// Karma configuration -// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC) - -module.exports = function(config) { - config.set({ - - // base path that will be used to resolve all patterns (eg. files, exclude) - basePath: '', - - - // frameworks to use - // available frameworks: https://npmjs.org/browse/keyword/karma-adapter - frameworks: ['mocha', 'chai', 'sinon'], - - - // list of files / patterns to load in the browser - files: [ - 'dist/debug.js', - 'test/*spec.js' - ], - - - // list of files to exclude - exclude: [ - 'src/node.js' - ], - - - // preprocess matching files before serving them to the browser - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor - preprocessors: { - }, - - // test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['progress'], - - - // web server port - port: 9876, - - - // enable / disable colors in the output (reporters and logs) - colors: true, - - - // level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - logLevel: config.LOG_INFO, - - - // enable / disable watching file and executing tests whenever any file changes - autoWatch: true, - - - // start these browsers - // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - browsers: ['PhantomJS'], - - - // Continuous Integration mode - // if true, Karma captures browsers, runs the tests and exits - singleRun: false, - - // Concurrency level - // how many browser should be started simultaneous - concurrency: Infinity - }) -} diff --git a/node_modules/debug/node.js b/node_modules/debug/node.js deleted file mode 100644 index 7fc36fe6d..000000000 --- a/node_modules/debug/node.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./src/node'); diff --git a/node_modules/debug/package.json b/node_modules/debug/package.json deleted file mode 100644 index 3563bd856..000000000 --- a/node_modules/debug/package.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "_from": "debug@^2.2.0", - "_id": "debug@2.6.9", - "_inBundle": false, - "_integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "_location": "/debug", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "debug@^2.2.0", - "name": "debug", - "escapedName": "debug", - "rawSpec": "^2.2.0", - "saveSpec": null, - "fetchSpec": "^2.2.0" - }, - "_requiredBy": [ - "/readdirp/expand-brackets", - "/resp-modifier", - "/send", - "/snapdragon" - ], - "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "_shasum": "5d128515df134ff327e90a4c93f4e077a536341f", - "_spec": "debug@^2.2.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/snapdragon", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "browser": "./src/browser.js", - "bugs": { - "url": "https://github.com/visionmedia/debug/issues" - }, - "bundleDependencies": false, - "component": { - "scripts": { - "debug/index.js": "browser.js", - "debug/debug.js": "debug.js" - } - }, - "contributors": [ - { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io" - }, - { - "name": "Andrew Rhyne", - "email": "rhyneandrew@gmail.com" - } - ], - "dependencies": { - "ms": "2.0.0" - }, - "deprecated": false, - "description": "small debugging utility", - "devDependencies": { - "browserify": "9.0.3", - "chai": "^3.5.0", - "concurrently": "^3.1.0", - "coveralls": "^2.11.15", - "eslint": "^3.12.1", - "istanbul": "^0.4.5", - "karma": "^1.3.0", - "karma-chai": "^0.1.0", - "karma-mocha": "^1.3.0", - "karma-phantomjs-launcher": "^1.0.2", - "karma-sinon": "^1.0.5", - "mocha": "^3.2.0", - "mocha-lcov-reporter": "^1.2.0", - "rimraf": "^2.5.4", - "sinon": "^1.17.6", - "sinon-chai": "^2.8.0" - }, - "homepage": "https://github.com/visionmedia/debug#readme", - "keywords": [ - "debug", - "log", - "debugger" - ], - "license": "MIT", - "main": "./src/index.js", - "name": "debug", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" - }, - "version": "2.6.9" -} diff --git a/node_modules/debug/src/browser.js b/node_modules/debug/src/browser.js deleted file mode 100644 index 710692493..000000000 --- a/node_modules/debug/src/browser.js +++ /dev/null @@ -1,185 +0,0 @@ -/** - * This is the web browser implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -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 = process.env.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) {} -} diff --git a/node_modules/debug/src/debug.js b/node_modules/debug/src/debug.js deleted file mode 100644 index 6a5e3fc94..000000000 --- a/node_modules/debug/src/debug.js +++ /dev/null @@ -1,202 +0,0 @@ - -/** - * 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 = require('ms'); - -/** - * 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; -} diff --git a/node_modules/debug/src/index.js b/node_modules/debug/src/index.js deleted file mode 100644 index e12cf4d58..000000000 --- a/node_modules/debug/src/index.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Detect Electron renderer process, which is node, but we should - * treat as a browser. - */ - -if (typeof process !== 'undefined' && process.type === 'renderer') { - module.exports = require('./browser.js'); -} else { - module.exports = require('./node.js'); -} diff --git a/node_modules/debug/src/inspector-log.js b/node_modules/debug/src/inspector-log.js deleted file mode 100644 index 60ea6c04a..000000000 --- a/node_modules/debug/src/inspector-log.js +++ /dev/null @@ -1,15 +0,0 @@ -module.exports = inspectorLog; - -// black hole -const nullStream = new (require('stream').Writable)(); -nullStream._write = () => {}; - -/** - * Outputs a `console.log()` to the Node.js Inspector console *only*. - */ -function inspectorLog() { - const stdout = console._stdout; - console._stdout = nullStream; - console.log.apply(console, arguments); - console._stdout = stdout; -} diff --git a/node_modules/debug/src/node.js b/node_modules/debug/src/node.js deleted file mode 100644 index b15109c90..000000000 --- a/node_modules/debug/src/node.js +++ /dev/null @@ -1,248 +0,0 @@ -/** - * Module dependencies. - */ - -var tty = require('tty'); -var util = require('util'); - -/** - * This is the Node.js implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -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(process.env).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 = process.env[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(process.env.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 process.env.DEBUG; - } else { - process.env.DEBUG = namespaces; - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - return process.env.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 = require('fs'); - stream = new fs.SyncWriteStream(fd, { autoClose: false }); - stream._type = 'fs'; - break; - - case 'PIPE': - case 'TCP': - var net = require('net'); - 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()); diff --git a/node_modules/decode-uri-component/index.js b/node_modules/decode-uri-component/index.js deleted file mode 100644 index 691499b0e..000000000 --- a/node_modules/decode-uri-component/index.js +++ /dev/null @@ -1,94 +0,0 @@ -'use strict'; -var token = '%[a-f0-9]{2}'; -var singleMatcher = new RegExp(token, 'gi'); -var multiMatcher = new RegExp('(' + token + ')+', 'gi'); - -function decodeComponents(components, split) { - try { - // Try to decode the entire string first - return decodeURIComponent(components.join('')); - } catch (err) { - // Do nothing - } - - if (components.length === 1) { - return components; - } - - split = split || 1; - - // Split the array in 2 parts - var left = components.slice(0, split); - var right = components.slice(split); - - return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right)); -} - -function decode(input) { - try { - return decodeURIComponent(input); - } catch (err) { - var tokens = input.match(singleMatcher); - - for (var i = 1; i < tokens.length; i++) { - input = decodeComponents(tokens, i).join(''); - - tokens = input.match(singleMatcher); - } - - return input; - } -} - -function customDecodeURIComponent(input) { - // Keep track of all the replacements and prefill the map with the `BOM` - var replaceMap = { - '%FE%FF': '\uFFFD\uFFFD', - '%FF%FE': '\uFFFD\uFFFD' - }; - - var match = multiMatcher.exec(input); - while (match) { - try { - // Decode as big chunks as possible - replaceMap[match[0]] = decodeURIComponent(match[0]); - } catch (err) { - var result = decode(match[0]); - - if (result !== match[0]) { - replaceMap[match[0]] = result; - } - } - - match = multiMatcher.exec(input); - } - - // Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else - replaceMap['%C2'] = '\uFFFD'; - - var entries = Object.keys(replaceMap); - - for (var i = 0; i < entries.length; i++) { - // Replace all decoded components - var key = entries[i]; - input = input.replace(new RegExp(key, 'g'), replaceMap[key]); - } - - return input; -} - -module.exports = function (encodedURI) { - if (typeof encodedURI !== 'string') { - throw new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`'); - } - - try { - encodedURI = encodedURI.replace(/\+/g, ' '); - - // Try the built in decoder first - return decodeURIComponent(encodedURI); - } catch (err) { - // Fallback to a more advanced decoder - return customDecodeURIComponent(encodedURI); - } -}; diff --git a/node_modules/decode-uri-component/license b/node_modules/decode-uri-component/license deleted file mode 100644 index 78b08554a..000000000 --- a/node_modules/decode-uri-component/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sam Verschueren (github.com/SamVerschueren) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/decode-uri-component/package.json b/node_modules/decode-uri-component/package.json deleted file mode 100644 index b9cd4b574..000000000 --- a/node_modules/decode-uri-component/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_from": "decode-uri-component@^0.2.0", - "_id": "decode-uri-component@0.2.0", - "_inBundle": false, - "_integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "_location": "/decode-uri-component", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "decode-uri-component@^0.2.0", - "name": "decode-uri-component", - "escapedName": "decode-uri-component", - "rawSpec": "^0.2.0", - "saveSpec": null, - "fetchSpec": "^0.2.0" - }, - "_requiredBy": [ - "/source-map-resolve" - ], - "_resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "_shasum": "eb3913333458775cb84cd1a1fae062106bb87545", - "_spec": "decode-uri-component@^0.2.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/source-map-resolve", - "author": { - "name": "Sam Verschueren", - "email": "sam.verschueren@gmail.com", - "url": "github.com/SamVerschueren" - }, - "bugs": { - "url": "https://github.com/SamVerschueren/decode-uri-component/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "A better decodeURIComponent", - "devDependencies": { - "ava": "^0.17.0", - "coveralls": "^2.13.1", - "nyc": "^10.3.2", - "xo": "^0.16.0" - }, - "engines": { - "node": ">=0.10" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/SamVerschueren/decode-uri-component#readme", - "keywords": [ - "decode", - "uri", - "component", - "decodeuricomponent", - "components", - "decoder", - "url" - ], - "license": "MIT", - "name": "decode-uri-component", - "repository": { - "type": "git", - "url": "git+https://github.com/SamVerschueren/decode-uri-component.git" - }, - "scripts": { - "coveralls": "nyc report --reporter=text-lcov | coveralls", - "test": "xo && nyc ava" - }, - "version": "0.2.0" -} diff --git a/node_modules/decode-uri-component/readme.md b/node_modules/decode-uri-component/readme.md deleted file mode 100644 index 795c87ff7..000000000 --- a/node_modules/decode-uri-component/readme.md +++ /dev/null @@ -1,70 +0,0 @@ -# decode-uri-component - -[![Build Status](https://travis-ci.org/SamVerschueren/decode-uri-component.svg?branch=master)](https://travis-ci.org/SamVerschueren/decode-uri-component) [![Coverage Status](https://coveralls.io/repos/SamVerschueren/decode-uri-component/badge.svg?branch=master&service=github)](https://coveralls.io/github/SamVerschueren/decode-uri-component?branch=master) - -> A better [decodeURIComponent](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent) - - -## Why? - -- Decodes `+` to a space. -- Converts the [BOM](https://en.wikipedia.org/wiki/Byte_order_mark) to a [replacement character](https://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character) `�`. -- Does not throw with invalid encoded input. -- Decodes as much of the string as possible. - - -## Install - -``` -$ npm install --save decode-uri-component -``` - - -## Usage - -```js -const decodeUriComponent = require('decode-uri-component'); - -decodeUriComponent('%25'); -//=> '%' - -decodeUriComponent('%'); -//=> '%' - -decodeUriComponent('st%C3%A5le'); -//=> 'ståle' - -decodeUriComponent('%st%C3%A5le%'); -//=> '%ståle%' - -decodeUriComponent('%%7Bst%C3%A5le%7D%'); -//=> '%{ståle}%' - -decodeUriComponent('%7B%ab%%7C%de%%7D'); -//=> '{%ab%|%de%}' - -decodeUriComponent('%FE%FF'); -//=> '\uFFFD\uFFFD' - -decodeUriComponent('%C2'); -//=> '\uFFFD' - -decodeUriComponent('%C2%B5'); -//=> 'µ' -``` - - -## API - -### decodeUriComponent(encodedURI) - -#### encodedURI - -Type: `string` - -An encoded component of a Uniform Resource Identifier. - - -## License - -MIT © [Sam Verschueren](https://github.com/SamVerschueren) diff --git a/node_modules/default-gateway/LICENSE b/node_modules/default-gateway/LICENSE deleted file mode 100644 index 9669c20f8..000000000 --- a/node_modules/default-gateway/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) silverwind -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL 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. diff --git a/node_modules/default-gateway/README.md b/node_modules/default-gateway/README.md deleted file mode 100644 index e7497a2ac..000000000 --- a/node_modules/default-gateway/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# default-gateway -[![](https://img.shields.io/npm/v/default-gateway.svg?style=flat)](https://www.npmjs.org/package/default-gateway) [![](https://img.shields.io/npm/dm/default-gateway.svg)](https://www.npmjs.org/package/default-gateway) [![](https://api.travis-ci.org/silverwind/default-gateway.svg?style=flat)](https://travis-ci.org/silverwind/default-gateway) - -> Get the default network gateway, cross-platform. - -Obtains the machine's default gateway through `exec` calls to OS routing interfaces. On Linux and Android, the `ip` command must be available (usually provided by the `iproute2` package). - -## Installation - -``` -$ npm install default-gateway -``` - -## Example - -```js -const defaultGateway = require('default-gateway'); - -defaultGateway.v4().then(result => { - // result = {gateway: '1.2.3.4', interface: 'en1'} -}); - -defaultGateway.v6().then(result => { - // result = {gateway: '2001:db8::1', interface: 'en2'} -}); - -const result = defaultGateway.v4.sync(); -// result = {gateway: '1.2.3.4', interface: 'en1'} - -const result = defaultGateway.v6.sync(); -// result = {gateway: '2001:db8::1', interface: 'en2'} -``` - -## API -### defaultGateway.v4() -### defaultGateway.v6() -### defaultGateway.v4.sync() -### defaultGateway.v6.sync() - -Returns: `result` *Object* - - `gateway`: The IP address of the default gateway. - - `interface`: The name of the interface. On Windows, this is the network adapter name. - -The `.v{4,6}()` methods return a Promise while the `.v{4,6}.sync()` variants will return the result synchronously. - -The `gateway` property will always be defined on success, while `interface` can be `null` if it cannot be determined. All methods reject/throw when the gateway cannot be determined or the `exec` call failed. - -## License - -© [silverwind](https://github.com/silverwind), distributed under BSD licence diff --git a/node_modules/default-gateway/android.js b/node_modules/default-gateway/android.js deleted file mode 100644 index 6d0ac1a07..000000000 --- a/node_modules/default-gateway/android.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; - -const net = require("net"); -const execa = require("execa"); - -const args = { - v4: ["-4", "r"], - v6: ["-6", "r"], -}; - -const parse = stdout => { - let result; - - (stdout || "").trim().split("\n").some(line => { - const results = /default via (.+?) dev (.+?)( |$)/.exec(line) || []; - const gateway = results[1]; - const iface = results[2]; - if (gateway && net.isIP(gateway)) { - result = {gateway: gateway, interface: (iface ? iface : null)}; - return true; - } - }); - - if (!result) { - throw new Error("Unable to determine default gateway"); - } - - return result; -}; - -const promise = family => { - return execa.stdout("ip", args[family]).then(stdout => { - return parse(stdout); - }); -}; - -const sync = family => { - const result = execa.sync("ip", args[family]); - return parse(result.stdout); -}; - -module.exports.v4 = () => promise("v4"); -module.exports.v6 = () => promise("v6"); - -module.exports.v4.sync = () => sync("v4"); -module.exports.v6.sync = () => sync("v6"); diff --git a/node_modules/default-gateway/darwin.js b/node_modules/default-gateway/darwin.js deleted file mode 100644 index e7a190efd..000000000 --- a/node_modules/default-gateway/darwin.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; - -const net = require("net"); -const execa = require("execa"); -const dests = ["default", "0.0.0.0", "0.0.0.0/0", "::", "::/0"]; - -const args = { - v4: ["-rn", "-f", "inet"], - v6: ["-rn", "-f", "inet6"], -}; - -const parse = (stdout, family) => { - let result; - - (stdout || "").trim().split("\n").some(line => { - const results = line.split(/ +/) || []; - const target = results[0]; - const gateway = results[1]; - const iface = results[family === "v4" ? 5 : 3]; - if (dests.indexOf(target) !== -1 && gateway && net.isIP(gateway)) { - result = {gateway: gateway, interface: (iface ? iface : null)}; - return true; - } - }); - - if (!result) { - throw new Error("Unable to determine default gateway"); - } - - return result; -}; - -const promise = family => { - return execa.stdout("netstat", args[family]).then(stdout => { - return parse(stdout, family); - }); -}; - -const sync = family => { - const result = execa.sync("netstat", args[family]); - return parse(result.stdout, family); -}; - -module.exports.v4 = () => promise("v4"); -module.exports.v6 = () => promise("v6"); - -module.exports.v4.sync = () => sync("v4"); -module.exports.v6.sync = () => sync("v6"); diff --git a/node_modules/default-gateway/freebsd.js b/node_modules/default-gateway/freebsd.js deleted file mode 100644 index 77c626f8d..000000000 --- a/node_modules/default-gateway/freebsd.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; - -const net = require("net"); -const execa = require("execa"); -const dests = ["default", "0.0.0.0", "0.0.0.0/0", "::", "::/0"]; - -const args = { - v4: ["-rn", "-f", "inet"], - v6: ["-rn", "-f", "inet6"], -}; - -const parse = stdout => { - let result; - - (stdout || "").trim().split("\n").some(line => { - const results = line.split(/ +/) || []; - const target = results[0]; - const gateway = results[1]; - const iface = results[3]; - if (dests.indexOf(target) !== -1 && gateway && net.isIP(gateway)) { - result = {gateway: gateway, interface: (iface ? iface : null)}; - return true; - } - }); - - if (!result) { - throw new Error("Unable to determine default gateway"); - } - - return result; -}; - -const promise = family => { - return execa.stdout("netstat", args[family]).then(stdout => { - return parse(stdout); - }); -}; - -const sync = family => { - const result = execa.sync("netstat", args[family]); - return parse(result.stdout); -}; - -module.exports.v4 = () => promise("v4"); -module.exports.v6 = () => promise("v6"); - -module.exports.v4.sync = () => sync("v4"); -module.exports.v6.sync = () => sync("v6"); diff --git a/node_modules/default-gateway/index.js b/node_modules/default-gateway/index.js deleted file mode 100644 index 76da2b4b1..000000000 --- a/node_modules/default-gateway/index.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -const platform = require("os").platform(); - -if ([ - "android", - "darwin", - "freebsd", - "linux", - "openbsd", - "sunos", - "win32" -].indexOf(platform) !== -1) { - const families = require(`./${platform}`); - module.exports.v4 = () => families.v4(); - module.exports.v6 = () => families.v6(); - module.exports.v4.sync = () => families.v4.sync(); - module.exports.v6.sync = () => families.v6.sync(); -} else { - const noop = () => { throw new Error(`Unsupported Platform: ${platform}`); }; - module.exports.v4 = noop; - module.exports.v6 = noop; - module.exports.v4.sync = noop; - module.exports.v6.sync = noop; -} diff --git a/node_modules/default-gateway/linux.js b/node_modules/default-gateway/linux.js deleted file mode 100644 index ed564abc8..000000000 --- a/node_modules/default-gateway/linux.js +++ /dev/null @@ -1,58 +0,0 @@ -"use strict"; - -const net = require("net"); -const os = require("os"); -const execa = require("execa"); - -const args = { - v4: ["-4", "r"], - v6: ["-6", "r"], -}; - -const parse = (stdout, family) => { - let result; - - (stdout || "").trim().split("\n").some(line => { - const results = /default( via .+?)?( dev .+?)( |$)/.exec(line) || []; - const gateway = (results[1] || "").substring(5); - const iface = (results[2] || "").substring(5); - if (gateway && net.isIP(gateway)) { // default via 1.2.3.4 dev en0 - result = {gateway: gateway, interface: (iface ? iface : null)}; - return true; - } else if (iface && !gateway) { // default via dev en0 - const interfaces = os.networkInterfaces(); - const addresses = interfaces[iface]; - if (!addresses || !addresses.length) return; - - addresses.some(addr => { - if (addr.family.substring(2) === family && net.isIP(addr.address)) { - result = {gateway: addr.address, interface: (iface ? iface : null)}; - return true; - } - }); - } - }); - - if (!result) { - throw new Error("Unable to determine default gateway"); - } - - return result; -}; - -const promise = family => { - return execa.stdout("ip", args[family]).then(stdout => { - return parse(stdout, family); - }); -}; - -const sync = family => { - const result = execa.sync("ip", args[family]); - return parse(result.stdout, family); -}; - -module.exports.v4 = () => promise("v4"); -module.exports.v6 = () => promise("v6"); - -module.exports.v4.sync = () => sync("v4"); -module.exports.v6.sync = () => sync("v6"); diff --git a/node_modules/default-gateway/openbsd.js b/node_modules/default-gateway/openbsd.js deleted file mode 100644 index e03bca54f..000000000 --- a/node_modules/default-gateway/openbsd.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; - -const net = require("net"); -const execa = require("execa"); -const dests = ["default", "0.0.0.0", "0.0.0.0/0", "::", "::/0"]; - -const args = { - v4: ["-rn", "-f", "inet"], - v6: ["-rn", "-f", "inet6"], -}; - -const parse = stdout => { - let result; - - (stdout || "").trim().split("\n").some(line => { - const results = line.split(/ +/) || []; - const target = results[0]; - const gateway = results[1]; - const iface = results[7]; - if (dests.indexOf(target) !== -1 && gateway && net.isIP(gateway)) { - result = {gateway: gateway, interface: (iface ? iface : null)}; - return true; - } - }); - - if (!result) { - throw new Error("Unable to determine default gateway"); - } - - return result; -}; - -const promise = family => { - return execa.stdout("netstat", args[family]).then(stdout => { - return parse(stdout); - }); -}; - -const sync = family => { - const result = execa.sync("netstat", args[family]); - return parse(result.stdout); -}; - -module.exports.v4 = () => promise("v4"); -module.exports.v6 = () => promise("v6"); - -module.exports.v4.sync = () => sync("v4"); -module.exports.v6.sync = () => sync("v6"); diff --git a/node_modules/default-gateway/package.json b/node_modules/default-gateway/package.json deleted file mode 100644 index 18a5b3fc6..000000000 --- a/node_modules/default-gateway/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "_from": "default-gateway@^2.6.0", - "_id": "default-gateway@2.7.2", - "_inBundle": false, - "_integrity": "sha512-lAc4i9QJR0YHSDFdzeBQKfZ1SRDG3hsJNEkrpcZa8QhBfidLAilT60BDEIVUUGqosFp425KOgB3uYqcnQrWafQ==", - "_location": "/default-gateway", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "default-gateway@^2.6.0", - "name": "default-gateway", - "escapedName": "default-gateway", - "rawSpec": "^2.6.0", - "saveSpec": null, - "fetchSpec": "^2.6.0" - }, - "_requiredBy": [ - "/internal-ip" - ], - "_resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-2.7.2.tgz", - "_shasum": "b7ef339e5e024b045467af403d50348db4642d0f", - "_spec": "default-gateway@^2.6.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/internal-ip", - "author": { - "name": "silverwind", - "email": "me@silverwind.io" - }, - "bugs": { - "url": "https://github.com/silverwind/default-gateway/issues" - }, - "bundleDependencies": false, - "dependencies": { - "execa": "^0.10.0", - "ip-regex": "^2.1.0" - }, - "deprecated": false, - "description": "Get the default network gateway, cross-platform.", - "devDependencies": { - "eslint": "^4.19.1", - "eslint-config-silverwind": "^1.0.42", - "updates": "^3.0.0" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js", - "android.js", - "darwin.js", - "freebsd.js", - "linux.js", - "openbsd.js", - "sunos.js", - "win32.js" - ], - "homepage": "https://github.com/silverwind/default-gateway#readme", - "keywords": [ - "default gateway", - "network", - "default", - "gateway", - "routing", - "route" - ], - "license": "BSD-2-Clause", - "name": "default-gateway", - "os": [ - "android", - "darwin", - "freebsd", - "linux", - "openbsd", - "sunos", - "win32" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/silverwind/default-gateway.git" - }, - "scripts": { - "test": "make test" - }, - "version": "2.7.2" -} diff --git a/node_modules/default-gateway/sunos.js b/node_modules/default-gateway/sunos.js deleted file mode 100644 index f1d0ab77b..000000000 --- a/node_modules/default-gateway/sunos.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; - -const net = require("net"); -const execa = require("execa"); -const dests = ["default", "0.0.0.0", "0.0.0.0/0", "::", "::/0"]; - -const args = { - v4: ["-rn", "-f", "inet"], - v6: ["-rn", "-f", "inet6"], -}; - -const parse = stdout => { - let result; - - (stdout || "").trim().split("\n").some(line => { - const results = line.split(/ +/) || []; - const target = results[0]; - const gateway = results[1]; - const iface = results[5]; - if (dests.indexOf(target) !== -1 && gateway && net.isIP(gateway)) { - result = {gateway: gateway, interface: (iface ? iface : null)}; - return true; - } - }); - - if (!result) { - throw new Error("Unable to determine default gateway"); - } - - return result; -}; - -const promise = family => { - return execa.stdout("netstat", args[family]).then(stdout => { - return parse(stdout); - }); -}; - -const sync = family => { - const result = execa.sync("netstat", args[family]); - return parse(result.stdout); -}; - -module.exports.v4 = () => promise("v4"); -module.exports.v6 = () => promise("v6"); - -module.exports.v4.sync = () => sync("v4"); -module.exports.v6.sync = () => sync("v6"); diff --git a/node_modules/default-gateway/win32.js b/node_modules/default-gateway/win32.js deleted file mode 100644 index 9172dd5d8..000000000 --- a/node_modules/default-gateway/win32.js +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; - -const execa = require("execa"); -const ipRegex = require("ip-regex"); - -const gwArgs = "path Win32_NetworkAdapterConfiguration where IPEnabled=true get DefaultIPGateway,Index /format:table".split(" "); -const ifArgs = "path Win32_NetworkAdapter get Index,NetConnectionID /format:table".split(" "); - -const parse = (gwTable, ifTable, family) => { - let gateway, gwid, result; - - (gwTable || "").trim().split("\n").splice(1).some(line => { - const results = line.trim().split(/} +/) || []; - const gw = results[0]; - const id = results[1]; - gateway = (ipRegex[family]().exec((gw || "").trim()) || [])[0]; - if (gateway) { - gwid = id; - return true; - } - }); - - (ifTable || "").trim().split("\n").splice(1).some(line => { - const i = line.indexOf(" "); - const id = line.substr(0, i).trim(); - const name = line.substr(i + 1).trim(); - if (id === gwid) { - result = {gateway: gateway, interface: name ? name : null}; - return true; - } - }); - - if (!result) { - throw new Error("Unable to determine default gateway"); - } - - return result; -}; - -const spawnOpts = { - windowsHide: true, -}; - -const promise = family => { - return Promise.all([ - execa.stdout("wmic", gwArgs, spawnOpts), - execa.stdout("wmic", ifArgs, spawnOpts), - ]).then(results => { - const gwTable = results[0]; - const ifTable = results[1]; - - return parse(gwTable, ifTable, family); - }); -}; - -const sync = family => { - const gwTable = execa.sync("wmic", gwArgs, spawnOpts).stdout; - const ifTable = execa.sync("wmic", ifArgs, spawnOpts).stdout; - - return parse(gwTable, ifTable, family); -}; - -module.exports.v4 = () => promise("v4"); -module.exports.v6 = () => promise("v6"); - -module.exports.v4.sync = () => sync("v4"); -module.exports.v6.sync = () => sync("v6"); diff --git a/node_modules/define-property/CHANGELOG.md b/node_modules/define-property/CHANGELOG.md deleted file mode 100644 index 901c8aaee..000000000 --- a/node_modules/define-property/CHANGELOG.md +++ /dev/null @@ -1,82 +0,0 @@ -# Release history - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). - -
    - Guiding Principles - -- Changelogs are for humans, not machines. -- There should be an entry for every single version. -- The same types of changes should be grouped. -- Versions and sections should be linkable. -- The latest version comes first. -- The release date of each versions is displayed. -- Mention whether you follow Semantic Versioning. - -
    - -
    - Types of changes - -Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_): - -- `Added` for new features. -- `Changed` for changes in existing functionality. -- `Deprecated` for soon-to-be removed features. -- `Removed` for now removed features. -- `Fixed` for any bug fixes. -- `Security` in case of vulnerabilities. - -
    - -## [2.0.0] - 2017-04-20 - -### Changed - -- Now supports data descriptors in addition to accessor descriptors. -- Now uses [Reflect.defineProperty][reflect] when available, otherwise falls back to [Object.defineProperty][object]. - -## [1.0.0] - 2017-04-20 - -- stable release - -## [0.2.5] - 2015-08-31 - -- use is-descriptor - -## [0.2.3] - 2015-08-29 - -- check keys length - -## [0.2.2] - 2015-08-27 - -- ensure val is an object - -## [0.2.1] - 2015-08-27 - -- support functions - -## [0.2.0] - 2015-08-27 - -- support get/set -- update docs - -## [0.1.0] - 2015-08-12 - -- first commit - -[2.0.0]: https://github.com/jonschlinkert/define-property/compare/1.0.0...2.0.0 -[1.0.0]: https://github.com/jonschlinkert/define-property/compare/0.2.5...1.0.0 -[0.2.5]: https://github.com/jonschlinkert/define-property/compare/0.2.3...0.2.5 -[0.2.3]: https://github.com/jonschlinkert/define-property/compare/0.2.2...0.2.3 -[0.2.2]: https://github.com/jonschlinkert/define-property/compare/0.2.1...0.2.2 -[0.2.1]: https://github.com/jonschlinkert/define-property/compare/0.2.0...0.2.1 -[0.2.0]: https://github.com/jonschlinkert/define-property/compare/0.1.3...0.2.0 - -[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog - -[object]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty -[reflect]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect/defineProperty diff --git a/node_modules/define-property/LICENSE b/node_modules/define-property/LICENSE deleted file mode 100644 index f8de06305..000000000 --- a/node_modules/define-property/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2018, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/define-property/README.md b/node_modules/define-property/README.md deleted file mode 100644 index f1ee8f92e..000000000 --- a/node_modules/define-property/README.md +++ /dev/null @@ -1,117 +0,0 @@ -# define-property [![NPM version](https://img.shields.io/npm/v/define-property.svg?style=flat)](https://www.npmjs.com/package/define-property) [![NPM monthly downloads](https://img.shields.io/npm/dm/define-property.svg?style=flat)](https://npmjs.org/package/define-property) [![NPM total downloads](https://img.shields.io/npm/dt/define-property.svg?style=flat)](https://npmjs.org/package/define-property) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/define-property.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/define-property) - -> Define a non-enumerable property on an object. Uses Reflect.defineProperty when available, otherwise Object.defineProperty. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save define-property -``` - -## Release history - -See [the CHANGELOG](changelog.md) for updates. - -## Usage - -**Params** - -* `object`: The object on which to define the property. -* `key`: The name of the property to be defined or modified. -* `value`: The value or descriptor of the property being defined or modified. - -```js -var define = require('define-property'); -var obj = {}; -define(obj, 'foo', function(val) { - return val.toUpperCase(); -}); - -// by default, defined properties are non-enumberable -console.log(obj); -//=> {} - -console.log(obj.foo('bar')); -//=> 'BAR' -``` - -**defining setters/getters** - -Pass the same properties you would if using [Object.defineProperty](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty) or [Reflect.defineProperty](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect/defineProperty). - -```js -define(obj, 'foo', { - set: function() {}, - get: function() {} -}); -``` - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    - -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [assign-deep](https://www.npmjs.com/package/assign-deep): Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target… [more](https://github.com/jonschlinkert/assign-deep) | [homepage](https://github.com/jonschlinkert/assign-deep "Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target (first) object.") -* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") -* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") -* [mixin-deep](https://www.npmjs.com/package/mixin-deep): Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. | [homepage](https://github.com/jonschlinkert/mixin-deep "Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone.") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 28 | [jonschlinkert](https://github.com/jonschlinkert) | -| 1 | [doowb](https://github.com/doowb) | - -### Author - -**Jon Schlinkert** - -* Connect with me on [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) -* Follow me on [github/jonschlinkert](https://github.com/jonschlinkert) -* Follow me on [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on January 25, 2018._ \ No newline at end of file diff --git a/node_modules/define-property/index.js b/node_modules/define-property/index.js deleted file mode 100644 index 0efa0a9e6..000000000 --- a/node_modules/define-property/index.js +++ /dev/null @@ -1,38 +0,0 @@ -/*! - * define-property - * - * Copyright (c) 2015-2018, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var isobject = require('isobject'); -var isDescriptor = require('is-descriptor'); -var define = (typeof Reflect !== 'undefined' && Reflect.defineProperty) - ? Reflect.defineProperty - : Object.defineProperty; - -module.exports = function defineProperty(obj, key, val) { - if (!isobject(obj) && typeof obj !== 'function' && !Array.isArray(obj)) { - throw new TypeError('expected an object, function, or array'); - } - - if (typeof key !== 'string') { - throw new TypeError('expected "key" to be a string'); - } - - if (isDescriptor(val)) { - define(obj, key, val); - return obj; - } - - define(obj, key, { - configurable: true, - enumerable: false, - writable: true, - value: val - }); - - return obj; -}; diff --git a/node_modules/define-property/node_modules/is-accessor-descriptor/LICENSE b/node_modules/define-property/node_modules/is-accessor-descriptor/LICENSE deleted file mode 100644 index e33d14b75..000000000 --- a/node_modules/define-property/node_modules/is-accessor-descriptor/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2017, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/define-property/node_modules/is-accessor-descriptor/README.md b/node_modules/define-property/node_modules/is-accessor-descriptor/README.md deleted file mode 100644 index d198e1f05..000000000 --- a/node_modules/define-property/node_modules/is-accessor-descriptor/README.md +++ /dev/null @@ -1,144 +0,0 @@ -# is-accessor-descriptor [![NPM version](https://img.shields.io/npm/v/is-accessor-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-accessor-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-accessor-descriptor.svg?style=flat)](https://npmjs.org/package/is-accessor-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-accessor-descriptor.svg?style=flat)](https://npmjs.org/package/is-accessor-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-accessor-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-accessor-descriptor) - -> Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save is-accessor-descriptor -``` - -## Usage - -```js -var isAccessor = require('is-accessor-descriptor'); - -isAccessor({get: function() {}}); -//=> true -``` - -You may also pass an object and property name to check if the property is an accessor: - -```js -isAccessor(foo, 'bar'); -``` - -## Examples - -`false` when not an object - -```js -isAccessor('a') -isAccessor(null) -isAccessor([]) -//=> false -``` - -`true` when the object has valid properties - -and the properties all have the correct JavaScript types: - -```js -isAccessor({get: noop, set: noop}) -isAccessor({get: noop}) -isAccessor({set: noop}) -//=> true -``` - -`false` when the object has invalid properties - -```js -isAccessor({get: noop, set: noop, bar: 'baz'}) -isAccessor({get: noop, writable: true}) -isAccessor({get: noop, value: true}) -//=> false -``` - -`false` when an accessor is not a function - -```js -isAccessor({get: noop, set: 'baz'}) -isAccessor({get: 'foo', set: noop}) -isAccessor({get: 'foo', bar: 'baz'}) -isAccessor({get: 'foo', set: 'baz'}) -//=> false -``` - -`false` when a value is not the correct type - -```js -isAccessor({get: noop, set: noop, enumerable: 'foo'}) -isAccessor({set: noop, configurable: 'foo'}) -isAccessor({get: noop, configurable: 'foo'}) -//=> false -``` - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    - -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.") -* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.") -* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.") -* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") -* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 22 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [realityking](https://github.com/realityking) | - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on November 01, 2017._ \ No newline at end of file diff --git a/node_modules/define-property/node_modules/is-accessor-descriptor/index.js b/node_modules/define-property/node_modules/is-accessor-descriptor/index.js deleted file mode 100644 index d2e6fe8b9..000000000 --- a/node_modules/define-property/node_modules/is-accessor-descriptor/index.js +++ /dev/null @@ -1,69 +0,0 @@ -/*! - * is-accessor-descriptor - * - * Copyright (c) 2015-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var typeOf = require('kind-of'); - -// accessor descriptor properties -var accessor = { - get: 'function', - set: 'function', - configurable: 'boolean', - enumerable: 'boolean' -}; - -function isAccessorDescriptor(obj, prop) { - if (typeof prop === 'string') { - var val = Object.getOwnPropertyDescriptor(obj, prop); - return typeof val !== 'undefined'; - } - - if (typeOf(obj) !== 'object') { - return false; - } - - if (has(obj, 'value') || has(obj, 'writable')) { - return false; - } - - if (!has(obj, 'get') || typeof obj.get !== 'function') { - return false; - } - - // tldr: it's valid to have "set" be undefined - // "set" might be undefined if `Object.getOwnPropertyDescriptor` - // was used to get the value, and only `get` was defined by the user - if (has(obj, 'set') && typeof obj[key] !== 'function' && typeof obj[key] !== 'undefined') { - return false; - } - - for (var key in obj) { - if (!accessor.hasOwnProperty(key)) { - continue; - } - - if (typeOf(obj[key]) === accessor[key]) { - continue; - } - - if (typeof obj[key] !== 'undefined') { - return false; - } - } - return true; -} - -function has(obj, key) { - return {}.hasOwnProperty.call(obj, key); -} - -/** - * Expose `isAccessorDescriptor` - */ - -module.exports = isAccessorDescriptor; diff --git a/node_modules/define-property/node_modules/is-accessor-descriptor/package.json b/node_modules/define-property/node_modules/is-accessor-descriptor/package.json deleted file mode 100644 index 8a06c3fa2..000000000 --- a/node_modules/define-property/node_modules/is-accessor-descriptor/package.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "_from": "is-accessor-descriptor@^1.0.0", - "_id": "is-accessor-descriptor@1.0.0", - "_inBundle": false, - "_integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "_location": "/define-property/is-accessor-descriptor", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-accessor-descriptor@^1.0.0", - "name": "is-accessor-descriptor", - "escapedName": "is-accessor-descriptor", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/define-property/is-descriptor" - ], - "_resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "_shasum": "169c2f6d3df1f992618072365c9b0ea1f6878656", - "_spec": "is-accessor-descriptor@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/define-property/node_modules/is-descriptor", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-accessor-descriptor/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Rouven Weßling", - "url": "www.rouvenwessling.de" - } - ], - "dependencies": { - "kind-of": "^6.0.0" - }, - "deprecated": false, - "description": "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.", - "devDependencies": { - "gulp-format-md": "^1.0.0", - "mocha": "^3.5.3" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-accessor-descriptor", - "keywords": [ - "accessor", - "check", - "data", - "descriptor", - "get", - "getter", - "is", - "keys", - "object", - "properties", - "property", - "set", - "setter", - "type", - "valid", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "is-accessor-descriptor", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-accessor-descriptor.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "is-accessor-descriptor", - "is-data-descriptor", - "is-descriptor", - "is-plain-object", - "isobject" - ] - }, - "lint": { - "reflinks": true - } - }, - "version": "1.0.0" -} diff --git a/node_modules/define-property/node_modules/is-data-descriptor/LICENSE b/node_modules/define-property/node_modules/is-data-descriptor/LICENSE deleted file mode 100644 index e33d14b75..000000000 --- a/node_modules/define-property/node_modules/is-data-descriptor/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2017, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/define-property/node_modules/is-data-descriptor/README.md b/node_modules/define-property/node_modules/is-data-descriptor/README.md deleted file mode 100644 index 42b071446..000000000 --- a/node_modules/define-property/node_modules/is-data-descriptor/README.md +++ /dev/null @@ -1,161 +0,0 @@ -# is-data-descriptor [![NPM version](https://img.shields.io/npm/v/is-data-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-data-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-data-descriptor.svg?style=flat)](https://npmjs.org/package/is-data-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-data-descriptor.svg?style=flat)](https://npmjs.org/package/is-data-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-data-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-data-descriptor) - -> Returns true if a value has the characteristics of a valid JavaScript data descriptor. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save is-data-descriptor -``` - -## Usage - -```js -var isDataDesc = require('is-data-descriptor'); -``` - -## Examples - -`true` when the descriptor has valid properties with valid values. - -```js -// `value` can be anything -isDataDesc({value: 'foo'}) -isDataDesc({value: function() {}}) -isDataDesc({value: true}) -//=> true -``` - -`false` when not an object - -```js -isDataDesc('a') -//=> false -isDataDesc(null) -//=> false -isDataDesc([]) -//=> false -``` - -`false` when the object has invalid properties - -```js -isDataDesc({value: 'foo', bar: 'baz'}) -//=> false -isDataDesc({value: 'foo', bar: 'baz'}) -//=> false -isDataDesc({value: 'foo', get: function(){}}) -//=> false -isDataDesc({get: function(){}, value: 'foo'}) -//=> false -``` - -`false` when a value is not the correct type - -```js -isDataDesc({value: 'foo', enumerable: 'foo'}) -//=> false -isDataDesc({value: 'foo', configurable: 'foo'}) -//=> false -isDataDesc({value: 'foo', writable: 'foo'}) -//=> false -``` - -## Valid properties - -The only valid data descriptor properties are the following: - -* `configurable` (required) -* `enumerable` (required) -* `value` (optional) -* `writable` (optional) - -To be a valid data descriptor, either `value` or `writable` must be defined. - -**Invalid properties** - -A descriptor may have additional _invalid_ properties (an error will **not** be thrown). - -```js -var foo = {}; - -Object.defineProperty(foo, 'bar', { - enumerable: true, - whatever: 'blah', // invalid, but doesn't cause an error - get: function() { - return 'baz'; - } -}); - -console.log(foo.bar); -//=> 'baz' -``` - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    - -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.") -* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.") -* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.") -* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 21 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [realityking](https://github.com/realityking) | - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on November 01, 2017._ \ No newline at end of file diff --git a/node_modules/define-property/node_modules/is-data-descriptor/index.js b/node_modules/define-property/node_modules/is-data-descriptor/index.js deleted file mode 100644 index cfeae3619..000000000 --- a/node_modules/define-property/node_modules/is-data-descriptor/index.js +++ /dev/null @@ -1,49 +0,0 @@ -/*! - * is-data-descriptor - * - * Copyright (c) 2015-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var typeOf = require('kind-of'); - -module.exports = function isDataDescriptor(obj, prop) { - // data descriptor properties - var data = { - configurable: 'boolean', - enumerable: 'boolean', - writable: 'boolean' - }; - - if (typeOf(obj) !== 'object') { - return false; - } - - if (typeof prop === 'string') { - var val = Object.getOwnPropertyDescriptor(obj, prop); - return typeof val !== 'undefined'; - } - - if (!('value' in obj) && !('writable' in obj)) { - return false; - } - - for (var key in obj) { - if (key === 'value') continue; - - if (!data.hasOwnProperty(key)) { - continue; - } - - if (typeOf(obj[key]) === data[key]) { - continue; - } - - if (typeof obj[key] !== 'undefined') { - return false; - } - } - return true; -}; diff --git a/node_modules/define-property/node_modules/is-data-descriptor/package.json b/node_modules/define-property/node_modules/is-data-descriptor/package.json deleted file mode 100644 index a8da3347a..000000000 --- a/node_modules/define-property/node_modules/is-data-descriptor/package.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "_from": "is-data-descriptor@^1.0.0", - "_id": "is-data-descriptor@1.0.0", - "_inBundle": false, - "_integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "_location": "/define-property/is-data-descriptor", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-data-descriptor@^1.0.0", - "name": "is-data-descriptor", - "escapedName": "is-data-descriptor", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/define-property/is-descriptor" - ], - "_resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "_shasum": "d84876321d0e7add03990406abbbbd36ba9268c7", - "_spec": "is-data-descriptor@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/define-property/node_modules/is-descriptor", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-data-descriptor/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Rouven Weßling", - "url": "www.rouvenwessling.de" - } - ], - "dependencies": { - "kind-of": "^6.0.0" - }, - "deprecated": false, - "description": "Returns true if a value has the characteristics of a valid JavaScript data descriptor.", - "devDependencies": { - "gulp-format-md": "^1.0.0", - "mocha": "^3.5.3" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-data-descriptor", - "keywords": [ - "accessor", - "check", - "data", - "descriptor", - "get", - "getter", - "is", - "keys", - "object", - "properties", - "property", - "set", - "setter", - "type", - "valid", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "is-data-descriptor", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-data-descriptor.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "is-accessor-descriptor", - "is-data-descriptor", - "is-descriptor", - "isobject" - ] - }, - "lint": { - "reflinks": true - } - }, - "version": "1.0.0" -} diff --git a/node_modules/define-property/node_modules/is-descriptor/LICENSE b/node_modules/define-property/node_modules/is-descriptor/LICENSE deleted file mode 100644 index c0d7f1362..000000000 --- a/node_modules/define-property/node_modules/is-descriptor/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2017, Jon Schlinkert. - -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. \ No newline at end of file diff --git a/node_modules/define-property/node_modules/is-descriptor/README.md b/node_modules/define-property/node_modules/is-descriptor/README.md deleted file mode 100644 index 658e53301..000000000 --- a/node_modules/define-property/node_modules/is-descriptor/README.md +++ /dev/null @@ -1,193 +0,0 @@ -# is-descriptor [![NPM version](https://img.shields.io/npm/v/is-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-descriptor) - -> Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save is-descriptor -``` - -## Usage - -```js -var isDescriptor = require('is-descriptor'); - -isDescriptor({value: 'foo'}) -//=> true -isDescriptor({get: function(){}, set: function(){}}) -//=> true -isDescriptor({get: 'foo', set: function(){}}) -//=> false -``` - -You may also check for a descriptor by passing an object as the first argument and property name (`string`) as the second argument. - -```js -var obj = {}; -obj.foo = 'abc'; - -Object.defineProperty(obj, 'bar', { - value: 'xyz' -}); - -isDescriptor(obj, 'foo'); -//=> true -isDescriptor(obj, 'bar'); -//=> true -``` - -## Examples - -### value type - -`false` when not an object - -```js -isDescriptor('a'); -//=> false -isDescriptor(null); -//=> false -isDescriptor([]); -//=> false -``` - -### data descriptor - -`true` when the object has valid properties with valid values. - -```js -isDescriptor({value: 'foo'}); -//=> true -isDescriptor({value: noop}); -//=> true -``` - -`false` when the object has invalid properties - -```js -isDescriptor({value: 'foo', bar: 'baz'}); -//=> false -isDescriptor({value: 'foo', bar: 'baz'}); -//=> false -isDescriptor({value: 'foo', get: noop}); -//=> false -isDescriptor({get: noop, value: noop}); -//=> false -``` - -`false` when a value is not the correct type - -```js -isDescriptor({value: 'foo', enumerable: 'foo'}); -//=> false -isDescriptor({value: 'foo', configurable: 'foo'}); -//=> false -isDescriptor({value: 'foo', writable: 'foo'}); -//=> false -``` - -### accessor descriptor - -`true` when the object has valid properties with valid values. - -```js -isDescriptor({get: noop, set: noop}); -//=> true -isDescriptor({get: noop}); -//=> true -isDescriptor({set: noop}); -//=> true -``` - -`false` when the object has invalid properties - -```js -isDescriptor({get: noop, set: noop, bar: 'baz'}); -//=> false -isDescriptor({get: noop, writable: true}); -//=> false -isDescriptor({get: noop, value: true}); -//=> false -``` - -`false` when an accessor is not a function - -```js -isDescriptor({get: noop, set: 'baz'}); -//=> false -isDescriptor({get: 'foo', set: noop}); -//=> false -isDescriptor({get: 'foo', bar: 'baz'}); -//=> false -isDescriptor({get: 'foo', set: 'baz'}); -//=> false -``` - -`false` when a value is not the correct type - -```js -isDescriptor({get: noop, set: noop, enumerable: 'foo'}); -//=> false -isDescriptor({set: noop, configurable: 'foo'}); -//=> false -isDescriptor({get: noop, configurable: 'foo'}); -//=> false -``` - -## About - -### Related projects - -* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.") -* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.") -* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.") -* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 24 | [jonschlinkert](https://github.com/jonschlinkert) | -| 1 | [doowb](https://github.com/doowb) | -| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 22, 2017._ \ No newline at end of file diff --git a/node_modules/define-property/node_modules/is-descriptor/index.js b/node_modules/define-property/node_modules/is-descriptor/index.js deleted file mode 100644 index c9b91d762..000000000 --- a/node_modules/define-property/node_modules/is-descriptor/index.js +++ /dev/null @@ -1,22 +0,0 @@ -/*! - * is-descriptor - * - * Copyright (c) 2015-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var typeOf = require('kind-of'); -var isAccessor = require('is-accessor-descriptor'); -var isData = require('is-data-descriptor'); - -module.exports = function isDescriptor(obj, key) { - if (typeOf(obj) !== 'object') { - return false; - } - if ('get' in obj) { - return isAccessor(obj, key); - } - return isData(obj, key); -}; diff --git a/node_modules/define-property/node_modules/is-descriptor/package.json b/node_modules/define-property/node_modules/is-descriptor/package.json deleted file mode 100644 index a436bbb2f..000000000 --- a/node_modules/define-property/node_modules/is-descriptor/package.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "_from": "is-descriptor@^1.0.2", - "_id": "is-descriptor@1.0.2", - "_inBundle": false, - "_integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "_location": "/define-property/is-descriptor", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-descriptor@^1.0.2", - "name": "is-descriptor", - "escapedName": "is-descriptor", - "rawSpec": "^1.0.2", - "saveSpec": null, - "fetchSpec": "^1.0.2" - }, - "_requiredBy": [ - "/define-property" - ], - "_resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "_shasum": "3b159746a66604b04f8c81524ba365c5f14d86ec", - "_spec": "is-descriptor@^1.0.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/define-property", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-descriptor/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Brian Woodward", - "url": "https://twitter.com/doowb" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "url": "https://github.com/wtgtybhertgeghgtwtg" - } - ], - "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - }, - "deprecated": false, - "description": "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.", - "devDependencies": { - "gulp-format-md": "^1.0.0", - "mocha": "^3.5.3" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-descriptor", - "keywords": [ - "accessor", - "check", - "data", - "descriptor", - "get", - "getter", - "is", - "keys", - "object", - "properties", - "property", - "set", - "setter", - "type", - "valid", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "is-descriptor", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-descriptor.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "is-accessor-descriptor", - "is-data-descriptor", - "is-descriptor", - "isobject" - ] - }, - "plugins": [ - "gulp-format-md" - ], - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "lint": { - "reflinks": true - } - }, - "version": "1.0.2" -} diff --git a/node_modules/define-property/node_modules/isobject/LICENSE b/node_modules/define-property/node_modules/isobject/LICENSE deleted file mode 100644 index 943e71d05..000000000 --- a/node_modules/define-property/node_modules/isobject/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert. - -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. \ No newline at end of file diff --git a/node_modules/define-property/node_modules/isobject/README.md b/node_modules/define-property/node_modules/isobject/README.md deleted file mode 100644 index d01feaa40..000000000 --- a/node_modules/define-property/node_modules/isobject/README.md +++ /dev/null @@ -1,122 +0,0 @@ -# isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM monthly downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![NPM total downloads](https://img.shields.io/npm/dt/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/isobject) - -> Returns true if the value is an object and not an array or null. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save isobject -``` - -Install with [yarn](https://yarnpkg.com): - -```sh -$ yarn add isobject -``` - -Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install isobject -``` -Install with [bower](https://bower.io/) - -```sh -$ bower install isobject -``` - -## Usage - -```js -var isObject = require('isobject'); -``` - -**True** - -All of the following return `true`: - -```js -isObject({}); -isObject(Object.create({})); -isObject(Object.create(Object.prototype)); -isObject(Object.create(null)); -isObject({}); -isObject(new Foo); -isObject(/foo/); -``` - -**False** - -All of the following return `false`: - -```js -isObject(); -isObject(function () {}); -isObject(1); -isObject([]); -isObject(undefined); -isObject(null); -``` - -## About - -### Related projects - -* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") -* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") -* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") -* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 29 | [jonschlinkert](https://github.com/jonschlinkert) | -| 4 | [doowb](https://github.com/doowb) | -| 1 | [magnudae](https://github.com/magnudae) | -| 1 | [LeSuisse](https://github.com/LeSuisse) | -| 1 | [tmcw](https://github.com/tmcw) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 30, 2017._ \ No newline at end of file diff --git a/node_modules/define-property/node_modules/isobject/index.d.ts b/node_modules/define-property/node_modules/isobject/index.d.ts deleted file mode 100644 index 55f81c275..000000000 --- a/node_modules/define-property/node_modules/isobject/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export = isObject; - -declare function isObject(val: any): boolean; - -declare namespace isObject {} diff --git a/node_modules/define-property/node_modules/isobject/index.js b/node_modules/define-property/node_modules/isobject/index.js deleted file mode 100644 index 2d59958bf..000000000 --- a/node_modules/define-property/node_modules/isobject/index.js +++ /dev/null @@ -1,12 +0,0 @@ -/*! - * isobject - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -module.exports = function isObject(val) { - return val != null && typeof val === 'object' && Array.isArray(val) === false; -}; diff --git a/node_modules/define-property/node_modules/isobject/package.json b/node_modules/define-property/node_modules/isobject/package.json deleted file mode 100644 index 316fef022..000000000 --- a/node_modules/define-property/node_modules/isobject/package.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "_from": "isobject@^3.0.1", - "_id": "isobject@3.0.1", - "_inBundle": false, - "_integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "_location": "/define-property/isobject", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "isobject@^3.0.1", - "name": "isobject", - "escapedName": "isobject", - "rawSpec": "^3.0.1", - "saveSpec": null, - "fetchSpec": "^3.0.1" - }, - "_requiredBy": [ - "/define-property" - ], - "_resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "_shasum": "4e431e92b11a9731636aa1f9c8d1ccbcfdab78df", - "_spec": "isobject@^3.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/define-property", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/isobject/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "url": "https://github.com/LeSuisse" - }, - { - "name": "Brian Woodward", - "url": "https://twitter.com/doowb" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Magnús Dæhlen", - "url": "https://github.com/magnudae" - }, - { - "name": "Tom MacWright", - "url": "https://macwright.org" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "Returns true if the value is an object and not an array or null.", - "devDependencies": { - "gulp-format-md": "^0.1.9", - "mocha": "^2.4.5" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.d.ts", - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/isobject", - "keywords": [ - "check", - "is", - "is-object", - "isobject", - "kind", - "kind-of", - "kindof", - "native", - "object", - "type", - "typeof", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "isobject", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/isobject.git" - }, - "scripts": { - "test": "mocha" - }, - "types": "index.d.ts", - "verb": { - "related": { - "list": [ - "extend-shallow", - "is-plain-object", - "kind-of", - "merge-deep" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "verb" - ] - }, - "version": "3.0.1" -} diff --git a/node_modules/define-property/node_modules/kind-of/CHANGELOG.md b/node_modules/define-property/node_modules/kind-of/CHANGELOG.md deleted file mode 100644 index fb30b06df..000000000 --- a/node_modules/define-property/node_modules/kind-of/CHANGELOG.md +++ /dev/null @@ -1,157 +0,0 @@ -# Release history - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). - -
    - Guiding Principles - -- Changelogs are for humans, not machines. -- There should be an entry for every single version. -- The same types of changes should be grouped. -- Versions and sections should be linkable. -- The latest version comes first. -- The release date of each versions is displayed. -- Mention whether you follow Semantic Versioning. - -
    - -
    - Types of changes - -Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_): - -- `Added` for new features. -- `Changed` for changes in existing functionality. -- `Deprecated` for soon-to-be removed features. -- `Removed` for now removed features. -- `Fixed` for any bug fixes. -- `Security` in case of vulnerabilities. - -
    - -## [6.0.0] - 2017-10-13 - -- refactor code to be more performant -- refactor benchmarks - -## [5.1.0] - 2017-10-13 - -**Added** - -- Merge pull request #15 from aretecode/patch-1 -- adds support and tests for string & array iterators - -**Changed** - -- updates benchmarks - -## [5.0.2] - 2017-08-02 - -- Merge pull request #14 from struct78/master -- Added `undefined` check - -## [5.0.0] - 2017-06-21 - -- Merge pull request #12 from aretecode/iterator -- Set Iterator + Map Iterator -- streamline `isbuffer`, minor edits - -## [4.0.0] - 2017-05-19 - -- Merge pull request #8 from tunnckoCore/master -- update deps - -## [3.2.2] - 2017-05-16 - -- fix version - -## [3.2.1] - 2017-05-16 - -- add browserify - -## [3.2.0] - 2017-04-25 - -- Merge pull request #10 from ksheedlo/unrequire-buffer -- add `promise` support and tests -- Remove unnecessary `Buffer` check - -## [3.1.0] - 2016-12-07 - -- Merge pull request #7 from laggingreflex/err -- add support for `error` and tests -- run update - -## [3.0.4] - 2016-07-29 - -- move tests -- run update - -## [3.0.3] - 2016-05-03 - -- fix prepublish script -- remove unused dep - -## [3.0.0] - 2015-11-17 - -- add typed array support -- Merge pull request #5 from miguelmota/typed-arrays -- adds new tests - -## [2.0.1] - 2015-08-21 - -- use `is-buffer` module - -## [2.0.0] - 2015-05-31 - -- Create fallback for `Array.isArray` if used as a browser package -- Merge pull request #2 from dtothefp/patch-1 -- Merge pull request #3 from pdehaan/patch-1 -- Merge branch 'master' of https://github.com/chorks/kind-of into chorks-master -- optimizations, mostly date and regex - -## [1.1.0] - 2015-02-09 - -- adds `buffer` support -- adds tests for `buffer` - -## [1.0.0] - 2015-01-19 - -- update benchmarks -- optimizations based on benchmarks - -## [0.1.2] - 2014-10-26 - -- return `typeof` value if it's not an object. very slight speed improvement -- use `.slice` -- adds benchmarks - -## [0.1.0] - 2014-9-26 - -- first commit - -[6.0.0]: https://github.com/jonschlinkert/kind-of/compare/5.1.0...6.0.0 -[5.1.0]: https://github.com/jonschlinkert/kind-of/compare/5.0.2...5.1.0 -[5.0.2]: https://github.com/jonschlinkert/kind-of/compare/5.0.1...5.0.2 -[5.0.1]: https://github.com/jonschlinkert/kind-of/compare/5.0.0...5.0.1 -[5.0.0]: https://github.com/jonschlinkert/kind-of/compare/4.0.0...5.0.0 -[4.0.0]: https://github.com/jonschlinkert/kind-of/compare/3.2.2...4.0.0 -[3.2.2]: https://github.com/jonschlinkert/kind-of/compare/3.2.1...3.2.2 -[3.2.1]: https://github.com/jonschlinkert/kind-of/compare/3.2.0...3.2.1 -[3.2.0]: https://github.com/jonschlinkert/kind-of/compare/3.1.0...3.2.0 -[3.1.0]: https://github.com/jonschlinkert/kind-of/compare/3.0.4...3.1.0 -[3.0.4]: https://github.com/jonschlinkert/kind-of/compare/3.0.3...3.0.4 -[3.0.3]: https://github.com/jonschlinkert/kind-of/compare/3.0.0...3.0.3 -[3.0.0]: https://github.com/jonschlinkert/kind-of/compare/2.0.1...3.0.0 -[2.0.1]: https://github.com/jonschlinkert/kind-of/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/jonschlinkert/kind-of/compare/1.1.0...2.0.0 -[1.1.0]: https://github.com/jonschlinkert/kind-of/compare/1.0.0...1.1.0 -[1.0.0]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...1.0.0 -[0.1.2]: https://github.com/jonschlinkert/kind-of/compare/0.1.0...0.1.2 -[0.1.0]: https://github.com/jonschlinkert/kind-of/commit/2fae09b0b19b1aadb558e9be39f0c3ef6034eb87 - -[Unreleased]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...HEAD -[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog - diff --git a/node_modules/define-property/node_modules/kind-of/LICENSE b/node_modules/define-property/node_modules/kind-of/LICENSE deleted file mode 100644 index 3f2eca18f..000000000 --- a/node_modules/define-property/node_modules/kind-of/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/define-property/node_modules/kind-of/README.md b/node_modules/define-property/node_modules/kind-of/README.md deleted file mode 100644 index 4b0d4a818..000000000 --- a/node_modules/define-property/node_modules/kind-of/README.md +++ /dev/null @@ -1,365 +0,0 @@ -# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) - -> Get the native type of a value. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save kind-of -``` - -Install with [bower](https://bower.io/) - -```sh -$ bower install kind-of --save -``` - -## Why use this? - -1. [it's fast](#benchmarks) | [optimizations](#optimizations) -2. [better type checking](#better-type-checking) - -## Usage - -> es5, es6, and browser ready - -```js -var kindOf = require('kind-of'); - -kindOf(undefined); -//=> 'undefined' - -kindOf(null); -//=> 'null' - -kindOf(true); -//=> 'boolean' - -kindOf(false); -//=> 'boolean' - -kindOf(new Buffer('')); -//=> 'buffer' - -kindOf(42); -//=> 'number' - -kindOf('str'); -//=> 'string' - -kindOf(arguments); -//=> 'arguments' - -kindOf({}); -//=> 'object' - -kindOf(Object.create(null)); -//=> 'object' - -kindOf(new Test()); -//=> 'object' - -kindOf(new Date()); -//=> 'date' - -kindOf([1, 2, 3]); -//=> 'array' - -kindOf(/foo/); -//=> 'regexp' - -kindOf(new RegExp('foo')); -//=> 'regexp' - -kindOf(new Error('error')); -//=> 'error' - -kindOf(function () {}); -//=> 'function' - -kindOf(function * () {}); -//=> 'generatorfunction' - -kindOf(Symbol('str')); -//=> 'symbol' - -kindOf(new Map()); -//=> 'map' - -kindOf(new WeakMap()); -//=> 'weakmap' - -kindOf(new Set()); -//=> 'set' - -kindOf(new WeakSet()); -//=> 'weakset' - -kindOf(new Int8Array()); -//=> 'int8array' - -kindOf(new Uint8Array()); -//=> 'uint8array' - -kindOf(new Uint8ClampedArray()); -//=> 'uint8clampedarray' - -kindOf(new Int16Array()); -//=> 'int16array' - -kindOf(new Uint16Array()); -//=> 'uint16array' - -kindOf(new Int32Array()); -//=> 'int32array' - -kindOf(new Uint32Array()); -//=> 'uint32array' - -kindOf(new Float32Array()); -//=> 'float32array' - -kindOf(new Float64Array()); -//=> 'float64array' -``` - -## Benchmarks - -Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). - -```bash -# arguments (32 bytes) - kind-of x 17,024,098 ops/sec ±1.90% (86 runs sampled) - lib-type-of x 11,926,235 ops/sec ±1.34% (83 runs sampled) - lib-typeof x 9,245,257 ops/sec ±1.22% (87 runs sampled) - - fastest is kind-of (by 161% avg) - -# array (22 bytes) - kind-of x 17,196,492 ops/sec ±1.07% (88 runs sampled) - lib-type-of x 8,838,283 ops/sec ±1.02% (87 runs sampled) - lib-typeof x 8,677,848 ops/sec ±0.87% (87 runs sampled) - - fastest is kind-of (by 196% avg) - -# boolean (24 bytes) - kind-of x 16,841,600 ops/sec ±1.10% (86 runs sampled) - lib-type-of x 8,096,787 ops/sec ±0.95% (87 runs sampled) - lib-typeof x 8,423,345 ops/sec ±1.15% (86 runs sampled) - - fastest is kind-of (by 204% avg) - -# buffer (38 bytes) - kind-of x 14,848,060 ops/sec ±1.05% (86 runs sampled) - lib-type-of x 3,671,577 ops/sec ±1.49% (87 runs sampled) - lib-typeof x 8,360,236 ops/sec ±1.24% (86 runs sampled) - - fastest is kind-of (by 247% avg) - -# date (30 bytes) - kind-of x 16,067,761 ops/sec ±1.58% (86 runs sampled) - lib-type-of x 8,954,436 ops/sec ±1.40% (87 runs sampled) - lib-typeof x 8,488,307 ops/sec ±1.51% (84 runs sampled) - - fastest is kind-of (by 184% avg) - -# error (36 bytes) - kind-of x 9,634,090 ops/sec ±1.12% (89 runs sampled) - lib-type-of x 7,735,624 ops/sec ±1.32% (86 runs sampled) - lib-typeof x 7,442,160 ops/sec ±1.11% (90 runs sampled) - - fastest is kind-of (by 127% avg) - -# function (34 bytes) - kind-of x 10,031,494 ops/sec ±1.27% (86 runs sampled) - lib-type-of x 9,502,757 ops/sec ±1.17% (89 runs sampled) - lib-typeof x 8,278,985 ops/sec ±1.08% (88 runs sampled) - - fastest is kind-of (by 113% avg) - -# null (24 bytes) - kind-of x 18,159,808 ops/sec ±1.92% (86 runs sampled) - lib-type-of x 12,927,635 ops/sec ±1.01% (88 runs sampled) - lib-typeof x 7,958,234 ops/sec ±1.21% (89 runs sampled) - - fastest is kind-of (by 174% avg) - -# number (22 bytes) - kind-of x 17,846,779 ops/sec ±0.91% (85 runs sampled) - lib-type-of x 3,316,636 ops/sec ±1.19% (86 runs sampled) - lib-typeof x 2,329,477 ops/sec ±2.21% (85 runs sampled) - - fastest is kind-of (by 632% avg) - -# object-plain (47 bytes) - kind-of x 7,085,155 ops/sec ±1.05% (88 runs sampled) - lib-type-of x 8,870,930 ops/sec ±1.06% (83 runs sampled) - lib-typeof x 8,716,024 ops/sec ±1.05% (87 runs sampled) - - fastest is lib-type-of (by 112% avg) - -# regex (25 bytes) - kind-of x 14,196,052 ops/sec ±1.65% (84 runs sampled) - lib-type-of x 9,554,164 ops/sec ±1.25% (88 runs sampled) - lib-typeof x 8,359,691 ops/sec ±1.07% (87 runs sampled) - - fastest is kind-of (by 158% avg) - -# string (33 bytes) - kind-of x 16,131,428 ops/sec ±1.41% (85 runs sampled) - lib-type-of x 7,273,172 ops/sec ±1.05% (87 runs sampled) - lib-typeof x 7,382,635 ops/sec ±1.17% (85 runs sampled) - - fastest is kind-of (by 220% avg) - -# symbol (34 bytes) - kind-of x 17,011,537 ops/sec ±1.24% (86 runs sampled) - lib-type-of x 3,492,454 ops/sec ±1.23% (89 runs sampled) - lib-typeof x 7,471,235 ops/sec ±2.48% (87 runs sampled) - - fastest is kind-of (by 310% avg) - -# template-strings (36 bytes) - kind-of x 15,434,250 ops/sec ±1.46% (83 runs sampled) - lib-type-of x 7,157,907 ops/sec ±0.97% (87 runs sampled) - lib-typeof x 7,517,986 ops/sec ±0.92% (86 runs sampled) - - fastest is kind-of (by 210% avg) - -# undefined (29 bytes) - kind-of x 19,167,115 ops/sec ±1.71% (87 runs sampled) - lib-type-of x 15,477,740 ops/sec ±1.63% (85 runs sampled) - lib-typeof x 19,075,495 ops/sec ±1.17% (83 runs sampled) - - fastest is lib-typeof,kind-of - -``` - -## Optimizations - -In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: - -1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. -2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. -3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` -4. There is no reason to make the code in a microlib as terse as possible, just to win points for making it shorter. It's always better to favor performant code over terse code. You will always only be using a single `require()` statement to use the library anyway, regardless of how the code is written. - -## Better type checking - -kind-of seems to be more consistently "correct" than other type checking libs I've looked at. For example, here are some differing results from other popular libs: - -### [typeof](https://github.com/CodingFu/typeof) lib - -Incorrectly identifies instances of custom constructors (pretty common): - -```js -var typeOf = require('typeof'); -function Test() {} -console.log(typeOf(new Test())); -//=> 'test' -``` - -Returns `object` instead of `arguments`: - -```js -function foo() { - console.log(typeOf(arguments)) //=> 'object' -} -foo(); -``` - -### [type-of](https://github.com/ForbesLindesay/type-of) lib - -Incorrectly returns `object` for generator functions, buffers, `Map`, `Set`, `WeakMap` and `WeakSet`: - -```js -function * foo() {} -console.log(typeOf(foo)); -//=> 'object' -console.log(typeOf(new Buffer(''))); -//=> 'object' -console.log(typeOf(new Map())); -//=> 'object' -console.log(typeOf(new Set())); -//=> 'object' -console.log(typeOf(new WeakMap())); -//=> 'object' -console.log(typeOf(new WeakSet())); -//=> 'object' -``` - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    - -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") -* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") -* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 98 | [jonschlinkert](https://github.com/jonschlinkert) | -| 3 | [aretecode](https://github.com/aretecode) | -| 2 | [miguelmota](https://github.com/miguelmota) | -| 1 | [dtothefp](https://github.com/dtothefp) | -| 1 | [ianstormtaylor](https://github.com/ianstormtaylor) | -| 1 | [ksheedlo](https://github.com/ksheedlo) | -| 1 | [pdehaan](https://github.com/pdehaan) | -| 1 | [laggingreflex](https://github.com/laggingreflex) | -| 1 | [charlike-old](https://github.com/charlike-old) | - -### Author - -**Jon Schlinkert** - -* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on December 01, 2017._ \ No newline at end of file diff --git a/node_modules/define-property/node_modules/kind-of/index.js b/node_modules/define-property/node_modules/kind-of/index.js deleted file mode 100644 index aa2bb3944..000000000 --- a/node_modules/define-property/node_modules/kind-of/index.js +++ /dev/null @@ -1,129 +0,0 @@ -var toString = Object.prototype.toString; - -module.exports = function kindOf(val) { - if (val === void 0) return 'undefined'; - if (val === null) return 'null'; - - var type = typeof val; - if (type === 'boolean') return 'boolean'; - if (type === 'string') return 'string'; - if (type === 'number') return 'number'; - if (type === 'symbol') return 'symbol'; - if (type === 'function') { - return isGeneratorFn(val) ? 'generatorfunction' : 'function'; - } - - if (isArray(val)) return 'array'; - if (isBuffer(val)) return 'buffer'; - if (isArguments(val)) return 'arguments'; - if (isDate(val)) return 'date'; - if (isError(val)) return 'error'; - if (isRegexp(val)) return 'regexp'; - - switch (ctorName(val)) { - case 'Symbol': return 'symbol'; - case 'Promise': return 'promise'; - - // Set, Map, WeakSet, WeakMap - case 'WeakMap': return 'weakmap'; - case 'WeakSet': return 'weakset'; - case 'Map': return 'map'; - case 'Set': return 'set'; - - // 8-bit typed arrays - case 'Int8Array': return 'int8array'; - case 'Uint8Array': return 'uint8array'; - case 'Uint8ClampedArray': return 'uint8clampedarray'; - - // 16-bit typed arrays - case 'Int16Array': return 'int16array'; - case 'Uint16Array': return 'uint16array'; - - // 32-bit typed arrays - case 'Int32Array': return 'int32array'; - case 'Uint32Array': return 'uint32array'; - case 'Float32Array': return 'float32array'; - case 'Float64Array': return 'float64array'; - } - - if (isGeneratorObj(val)) { - return 'generator'; - } - - // Non-plain objects - type = toString.call(val); - switch (type) { - case '[object Object]': return 'object'; - // iterators - case '[object Map Iterator]': return 'mapiterator'; - case '[object Set Iterator]': return 'setiterator'; - case '[object String Iterator]': return 'stringiterator'; - case '[object Array Iterator]': return 'arrayiterator'; - } - - // other - return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); -}; - -function ctorName(val) { - return val.constructor ? val.constructor.name : null; -} - -function isArray(val) { - if (Array.isArray) return Array.isArray(val); - return val instanceof Array; -} - -function isError(val) { - return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'); -} - -function isDate(val) { - if (val instanceof Date) return true; - return typeof val.toDateString === 'function' - && typeof val.getDate === 'function' - && typeof val.setDate === 'function'; -} - -function isRegexp(val) { - if (val instanceof RegExp) return true; - return typeof val.flags === 'string' - && typeof val.ignoreCase === 'boolean' - && typeof val.multiline === 'boolean' - && typeof val.global === 'boolean'; -} - -function isGeneratorFn(name, val) { - return ctorName(name) === 'GeneratorFunction'; -} - -function isGeneratorObj(val) { - return typeof val.throw === 'function' - && typeof val.return === 'function' - && typeof val.next === 'function'; -} - -function isArguments(val) { - try { - if (typeof val.length === 'number' && typeof val.callee === 'function') { - return true; - } - } catch (err) { - if (err.message.indexOf('callee') !== -1) { - return true; - } - } - return false; -} - -/** - * If you need to support Safari 5-7 (8-10 yr-old browser), - * take a look at https://github.com/feross/is-buffer - */ - -function isBuffer(val) { - if (val.constructor && typeof val.constructor.isBuffer === 'function') { - return val.constructor.isBuffer(val); - } - return false; -} diff --git a/node_modules/define-property/node_modules/kind-of/package.json b/node_modules/define-property/node_modules/kind-of/package.json deleted file mode 100644 index aa4e636fe..000000000 --- a/node_modules/define-property/node_modules/kind-of/package.json +++ /dev/null @@ -1,145 +0,0 @@ -{ - "_from": "kind-of@^6.0.2", - "_id": "kind-of@6.0.2", - "_inBundle": false, - "_integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "_location": "/define-property/kind-of", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "kind-of@^6.0.2", - "name": "kind-of", - "escapedName": "kind-of", - "rawSpec": "^6.0.2", - "saveSpec": null, - "fetchSpec": "^6.0.2" - }, - "_requiredBy": [ - "/define-property/is-accessor-descriptor", - "/define-property/is-data-descriptor", - "/define-property/is-descriptor" - ], - "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "_shasum": "01146b36a6218e64e58f3a8d66de5d7fc6f6d051", - "_spec": "kind-of@^6.0.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/define-property/node_modules/is-descriptor", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/kind-of/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "David Fox-Powell", - "url": "https://dtothefp.github.io/me" - }, - { - "name": "James", - "url": "https://twitter.com/aretecode" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Ken Sheedlo", - "url": "kensheedlo.com" - }, - { - "name": "laggingreflex", - "url": "https://github.com/laggingreflex" - }, - { - "name": "Miguel Mota", - "url": "https://miguelmota.com" - }, - { - "name": "Peter deHaan", - "url": "http://about.me/peterdehaan" - }, - { - "name": "tunnckoCore", - "url": "https://i.am.charlike.online" - } - ], - "deprecated": false, - "description": "Get the native type of a value.", - "devDependencies": { - "benchmarked": "^2.0.0", - "browserify": "^14.4.0", - "gulp-format-md": "^1.0.0", - "mocha": "^4.0.1", - "write": "^1.0.3" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/kind-of", - "keywords": [ - "arguments", - "array", - "boolean", - "check", - "date", - "function", - "is", - "is-type", - "is-type-of", - "kind", - "kind-of", - "number", - "object", - "of", - "regexp", - "string", - "test", - "type", - "type-of", - "typeof", - "types" - ], - "license": "MIT", - "main": "index.js", - "name": "kind-of", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/kind-of.git" - }, - "scripts": { - "prepublish": "browserify -o browser.js -e index.js -s index --bare", - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "related": { - "list": [ - "is-glob", - "is-number", - "is-primitive" - ] - }, - "reflinks": [ - "type-of", - "typeof", - "verb" - ] - }, - "version": "6.0.2" -} diff --git a/node_modules/define-property/package.json b/node_modules/define-property/package.json deleted file mode 100644 index f8ce95c7f..000000000 --- a/node_modules/define-property/package.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "_from": "define-property@^2.0.2", - "_id": "define-property@2.0.2", - "_inBundle": false, - "_integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "_location": "/define-property", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "define-property@^2.0.2", - "name": "define-property", - "escapedName": "define-property", - "rawSpec": "^2.0.2", - "saveSpec": null, - "fetchSpec": "^2.0.2" - }, - "_requiredBy": [ - "/nanomatch", - "/readdirp/micromatch", - "/to-regex" - ], - "_resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "_shasum": "d459689e8d654ba77e02a817f8710d702cb16e9d", - "_spec": "define-property@^2.0.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/define-property/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Brian Woodward", - "url": "https://twitter.com/doowb" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - } - ], - "dependencies": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "deprecated": false, - "description": "Define a non-enumerable property on an object. Uses Reflect.defineProperty when available, otherwise Object.defineProperty.", - "devDependencies": { - "gulp-format-md": "^1.0.0", - "mocha": "^3.5.3" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/define-property", - "keywords": [ - "define", - "define-property", - "enumerable", - "key", - "non", - "non-enumerable", - "object", - "prop", - "property", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "define-property", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/define-property.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "assign-deep", - "extend-shallow", - "merge-deep", - "mixin-deep" - ] - }, - "lint": { - "reflinks": true - } - }, - "version": "2.0.2" -} diff --git a/node_modules/defined/.travis.yml b/node_modules/defined/.travis.yml deleted file mode 100644 index 895dbd362..000000000 --- a/node_modules/defined/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 diff --git a/node_modules/defined/LICENSE b/node_modules/defined/LICENSE deleted file mode 100644 index ee27ba4b4..000000000 --- a/node_modules/defined/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/defined/example/defined.js b/node_modules/defined/example/defined.js deleted file mode 100644 index 7b5d982f4..000000000 --- a/node_modules/defined/example/defined.js +++ /dev/null @@ -1,4 +0,0 @@ -var defined = require('../'); -var opts = { y : false, w : 4 }; -var x = defined(opts.x, opts.y, opts.w, 8); -console.log(x); diff --git a/node_modules/defined/index.js b/node_modules/defined/index.js deleted file mode 100644 index f8a22198d..000000000 --- a/node_modules/defined/index.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = function () { - for (var i = 0; i < arguments.length; i++) { - if (arguments[i] !== undefined) return arguments[i]; - } -}; diff --git a/node_modules/defined/package.json b/node_modules/defined/package.json deleted file mode 100644 index 9716ece35..000000000 --- a/node_modules/defined/package.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "_from": "defined@^1.0.0", - "_id": "defined@1.0.0", - "_inBundle": false, - "_integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", - "_location": "/defined", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "defined@^1.0.0", - "name": "defined", - "escapedName": "defined", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/browser-pack", - "/browserify", - "/detective", - "/module-deps", - "/watchify" - ], - "_resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "_shasum": "c98d9bcef75674188e110969151199e39b1fa693", - "_spec": "defined@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/defined/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "return the first argument that is `!== undefined`", - "devDependencies": { - "tape": "~3.5.0" - }, - "directories": { - "example": "example", - "test": "test" - }, - "homepage": "https://github.com/substack/defined", - "keywords": [ - "undefined", - "short-circuit", - "||", - "or", - "//", - "defined-or" - ], - "license": "MIT", - "main": "index.js", - "name": "defined", - "repository": { - "type": "git", - "url": "git://github.com/substack/defined.git" - }, - "scripts": { - "test": "tape test/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": { - "ie": [ - 6, - 7, - 8, - 9 - ], - "ff": [ - 3.5, - 10, - 15 - ], - "chrome": [ - 10, - 22 - ], - "safari": [ - 5.1 - ], - "opera": [ - 12 - ] - } - }, - "version": "1.0.0" -} diff --git a/node_modules/defined/readme.markdown b/node_modules/defined/readme.markdown deleted file mode 100644 index 9616195df..000000000 --- a/node_modules/defined/readme.markdown +++ /dev/null @@ -1,53 +0,0 @@ -# defined - -return the first argument that is `!== undefined` - -[![browser support](http://ci.testling.com/substack/defined.png)](http://ci.testling.com/substack/defined) - -[![build status](https://secure.travis-ci.org/substack/defined.png)](http://travis-ci.org/substack/defined) - -Most of the time when I chain together `||`s, I actually just want the first -item that is not `undefined`, not the first non-falsy item. - -This module is like the defined-or (`//`) operator in perl 5.10+. - -# example - -``` js -var defined = require('defined'); -var opts = { y : false, w : 4 }; -var x = defined(opts.x, opts.y, opts.w, 100); -console.log(x); -``` - -``` -$ node example/defined.js -false -``` - -The return value is `false` because `false` is the first item that is -`!== undefined`. - -# methods - -``` js -var defined = require('defined') -``` - -## var x = defined(a, b, c...) - -Return the first item in the argument list `a, b, c...` that is `!== undefined`. - -If all the items are `=== undefined`, return undefined. - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install defined -``` - -# license - -MIT diff --git a/node_modules/defined/test/def.js b/node_modules/defined/test/def.js deleted file mode 100644 index 48da51710..000000000 --- a/node_modules/defined/test/def.js +++ /dev/null @@ -1,22 +0,0 @@ -var defined = require('../'); -var test = require('tape'); - -test('defined-or', function (t) { - var u = undefined; - - t.equal(defined(), u, 'empty arguments'); - t.equal(defined(u), u, '1 undefined'); - t.equal(defined(u, u), u, '2 undefined'); - t.equal(defined(u, u, u, u), u, '4 undefineds'); - - t.equal(defined(undefined, false, true), false, 'false[0]'); - t.equal(defined(false, true), false, 'false[1]'); - t.equal(defined(undefined, 0, true), 0, 'zero[0]'); - t.equal(defined(0, true), 0, 'zero[1]'); - - t.equal(defined(3, undefined, 4), 3, 'first arg'); - t.equal(defined(undefined, 3, 4), 3, 'second arg'); - t.equal(defined(undefined, undefined, 3), 3, 'third arg'); - - t.end(); -}); diff --git a/node_modules/defined/test/falsy.js b/node_modules/defined/test/falsy.js deleted file mode 100644 index 6b7d623f0..000000000 --- a/node_modules/defined/test/falsy.js +++ /dev/null @@ -1,9 +0,0 @@ -var test = require('tape'); -var defined = require('../'); - -test('falsy', function (t) { - t.plan(1); - var opts = { y : false, w : 4 }; - var x = defined(opts.x, opts.y, opts.w, 8); - t.equal(x, false); -}); diff --git a/node_modules/depd/History.md b/node_modules/depd/History.md deleted file mode 100644 index 507ecb8de..000000000 --- a/node_modules/depd/History.md +++ /dev/null @@ -1,96 +0,0 @@ -1.1.2 / 2018-01-11 -================== - - * perf: remove argument reassignment - * Support Node.js 0.6 to 9.x - -1.1.1 / 2017-07-27 -================== - - * Remove unnecessary `Buffer` loading - * Support Node.js 0.6 to 8.x - -1.1.0 / 2015-09-14 -================== - - * Enable strict mode in more places - * Support io.js 3.x - * Support io.js 2.x - * Support web browser loading - - Requires bundler like Browserify or webpack - -1.0.1 / 2015-04-07 -================== - - * Fix `TypeError`s when under `'use strict'` code - * Fix useless type name on auto-generated messages - * Support io.js 1.x - * Support Node.js 0.12 - -1.0.0 / 2014-09-17 -================== - - * No changes - -0.4.5 / 2014-09-09 -================== - - * Improve call speed to functions using the function wrapper - * Support Node.js 0.6 - -0.4.4 / 2014-07-27 -================== - - * Work-around v8 generating empty stack traces - -0.4.3 / 2014-07-26 -================== - - * Fix exception when global `Error.stackTraceLimit` is too low - -0.4.2 / 2014-07-19 -================== - - * Correct call site for wrapped functions and properties - -0.4.1 / 2014-07-19 -================== - - * Improve automatic message generation for function properties - -0.4.0 / 2014-07-19 -================== - - * Add `TRACE_DEPRECATION` environment variable - * Remove non-standard grey color from color output - * Support `--no-deprecation` argument - * Support `--trace-deprecation` argument - * Support `deprecate.property(fn, prop, message)` - -0.3.0 / 2014-06-16 -================== - - * Add `NO_DEPRECATION` environment variable - -0.2.0 / 2014-06-15 -================== - - * Add `deprecate.property(obj, prop, message)` - * Remove `supports-color` dependency for node.js 0.8 - -0.1.0 / 2014-06-15 -================== - - * Add `deprecate.function(fn, message)` - * Add `process.on('deprecation', fn)` emitter - * Automatically generate message when omitted from `deprecate()` - -0.0.1 / 2014-06-15 -================== - - * Fix warning for dynamic calls at singe call site - -0.0.0 / 2014-06-15 -================== - - * Initial implementation diff --git a/node_modules/depd/LICENSE b/node_modules/depd/LICENSE deleted file mode 100644 index 84441fbb5..000000000 --- a/node_modules/depd/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2014-2017 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/depd/Readme.md b/node_modules/depd/Readme.md deleted file mode 100644 index 779067020..000000000 --- a/node_modules/depd/Readme.md +++ /dev/null @@ -1,280 +0,0 @@ -# depd - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-image]][node-url] -[![Linux Build][travis-image]][travis-url] -[![Windows Build][appveyor-image]][appveyor-url] -[![Coverage Status][coveralls-image]][coveralls-url] - -Deprecate all the things - -> With great modules comes great responsibility; mark things deprecated! - -## Install - -This module is installed directly using `npm`: - -```sh -$ npm install depd -``` - -This module can also be bundled with systems like -[Browserify](http://browserify.org/) or [webpack](https://webpack.github.io/), -though by default this module will alter it's API to no longer display or -track deprecations. - -## API - - - -```js -var deprecate = require('depd')('my-module') -``` - -This library allows you to display deprecation messages to your users. -This library goes above and beyond with deprecation warnings by -introspection of the call stack (but only the bits that it is interested -in). - -Instead of just warning on the first invocation of a deprecated -function and never again, this module will warn on the first invocation -of a deprecated function per unique call site, making it ideal to alert -users of all deprecated uses across the code base, rather than just -whatever happens to execute first. - -The deprecation warnings from this module also include the file and line -information for the call into the module that the deprecated function was -in. - -**NOTE** this library has a similar interface to the `debug` module, and -this module uses the calling file to get the boundary for the call stacks, -so you should always create a new `deprecate` object in each file and not -within some central file. - -### depd(namespace) - -Create a new deprecate function that uses the given namespace name in the -messages and will display the call site prior to the stack entering the -file this function was called from. It is highly suggested you use the -name of your module as the namespace. - -### deprecate(message) - -Call this function from deprecated code to display a deprecation message. -This message will appear once per unique caller site. Caller site is the -first call site in the stack in a different file from the caller of this -function. - -If the message is omitted, a message is generated for you based on the site -of the `deprecate()` call and will display the name of the function called, -similar to the name displayed in a stack trace. - -### deprecate.function(fn, message) - -Call this function to wrap a given function in a deprecation message on any -call to the function. An optional message can be supplied to provide a custom -message. - -### deprecate.property(obj, prop, message) - -Call this function to wrap a given property on object in a deprecation message -on any accessing or setting of the property. An optional message can be supplied -to provide a custom message. - -The method must be called on the object where the property belongs (not -inherited from the prototype). - -If the property is a data descriptor, it will be converted to an accessor -descriptor in order to display the deprecation message. - -### process.on('deprecation', fn) - -This module will allow easy capturing of deprecation errors by emitting the -errors as the type "deprecation" on the global `process`. If there are no -listeners for this type, the errors are written to STDERR as normal, but if -there are any listeners, nothing will be written to STDERR and instead only -emitted. From there, you can write the errors in a different format or to a -logging source. - -The error represents the deprecation and is emitted only once with the same -rules as writing to STDERR. The error has the following properties: - - - `message` - This is the message given by the library - - `name` - This is always `'DeprecationError'` - - `namespace` - This is the namespace the deprecation came from - - `stack` - This is the stack of the call to the deprecated thing - -Example `error.stack` output: - -``` -DeprecationError: my-cool-module deprecated oldfunction - at Object. ([eval]-wrapper:6:22) - at Module._compile (module.js:456:26) - at evalScript (node.js:532:25) - at startup (node.js:80:7) - at node.js:902:3 -``` - -### process.env.NO_DEPRECATION - -As a user of modules that are deprecated, the environment variable `NO_DEPRECATION` -is provided as a quick solution to silencing deprecation warnings from being -output. The format of this is similar to that of `DEBUG`: - -```sh -$ NO_DEPRECATION=my-module,othermod node app.js -``` - -This will suppress deprecations from being output for "my-module" and "othermod". -The value is a list of comma-separated namespaces. To suppress every warning -across all namespaces, use the value `*` for a namespace. - -Providing the argument `--no-deprecation` to the `node` executable will suppress -all deprecations (only available in Node.js 0.8 or higher). - -**NOTE** This will not suppress the deperecations given to any "deprecation" -event listeners, just the output to STDERR. - -### process.env.TRACE_DEPRECATION - -As a user of modules that are deprecated, the environment variable `TRACE_DEPRECATION` -is provided as a solution to getting more detailed location information in deprecation -warnings by including the entire stack trace. The format of this is the same as -`NO_DEPRECATION`: - -```sh -$ TRACE_DEPRECATION=my-module,othermod node app.js -``` - -This will include stack traces for deprecations being output for "my-module" and -"othermod". The value is a list of comma-separated namespaces. To trace every -warning across all namespaces, use the value `*` for a namespace. - -Providing the argument `--trace-deprecation` to the `node` executable will trace -all deprecations (only available in Node.js 0.8 or higher). - -**NOTE** This will not trace the deperecations silenced by `NO_DEPRECATION`. - -## Display - -![message](files/message.png) - -When a user calls a function in your library that you mark deprecated, they -will see the following written to STDERR (in the given colors, similar colors -and layout to the `debug` module): - -``` -bright cyan bright yellow -| | reset cyan -| | | | -▼ ▼ ▼ ▼ -my-cool-module deprecated oldfunction [eval]-wrapper:6:22 -▲ ▲ ▲ ▲ -| | | | -namespace | | location of mycoolmod.oldfunction() call - | deprecation message - the word "deprecated" -``` - -If the user redirects their STDERR to a file or somewhere that does not support -colors, they see (similar layout to the `debug` module): - -``` -Sun, 15 Jun 2014 05:21:37 GMT my-cool-module deprecated oldfunction at [eval]-wrapper:6:22 -▲ ▲ ▲ ▲ ▲ -| | | | | -timestamp of message namespace | | location of mycoolmod.oldfunction() call - | deprecation message - the word "deprecated" -``` - -## Examples - -### Deprecating all calls to a function - -This will display a deprecated message about "oldfunction" being deprecated -from "my-module" on STDERR. - -```js -var deprecate = require('depd')('my-cool-module') - -// message automatically derived from function name -// Object.oldfunction -exports.oldfunction = deprecate.function(function oldfunction () { - // all calls to function are deprecated -}) - -// specific message -exports.oldfunction = deprecate.function(function () { - // all calls to function are deprecated -}, 'oldfunction') -``` - -### Conditionally deprecating a function call - -This will display a deprecated message about "weirdfunction" being deprecated -from "my-module" on STDERR when called with less than 2 arguments. - -```js -var deprecate = require('depd')('my-cool-module') - -exports.weirdfunction = function () { - if (arguments.length < 2) { - // calls with 0 or 1 args are deprecated - deprecate('weirdfunction args < 2') - } -} -``` - -When calling `deprecate` as a function, the warning is counted per call site -within your own module, so you can display different deprecations depending -on different situations and the users will still get all the warnings: - -```js -var deprecate = require('depd')('my-cool-module') - -exports.weirdfunction = function () { - if (arguments.length < 2) { - // calls with 0 or 1 args are deprecated - deprecate('weirdfunction args < 2') - } else if (typeof arguments[0] !== 'string') { - // calls with non-string first argument are deprecated - deprecate('weirdfunction non-string first arg') - } -} -``` - -### Deprecating property access - -This will display a deprecated message about "oldprop" being deprecated -from "my-module" on STDERR when accessed. A deprecation will be displayed -when setting the value and when getting the value. - -```js -var deprecate = require('depd')('my-cool-module') - -exports.oldprop = 'something' - -// message automatically derives from property name -deprecate.property(exports, 'oldprop') - -// explicit message -deprecate.property(exports, 'oldprop', 'oldprop >= 0.10') -``` - -## License - -[MIT](LICENSE) - -[npm-version-image]: https://img.shields.io/npm/v/depd.svg -[npm-downloads-image]: https://img.shields.io/npm/dm/depd.svg -[npm-url]: https://npmjs.org/package/depd -[travis-image]: https://img.shields.io/travis/dougwilson/nodejs-depd/master.svg?label=linux -[travis-url]: https://travis-ci.org/dougwilson/nodejs-depd -[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/nodejs-depd/master.svg?label=windows -[appveyor-url]: https://ci.appveyor.com/project/dougwilson/nodejs-depd -[coveralls-image]: https://img.shields.io/coveralls/dougwilson/nodejs-depd/master.svg -[coveralls-url]: https://coveralls.io/r/dougwilson/nodejs-depd?branch=master -[node-image]: https://img.shields.io/node/v/depd.svg -[node-url]: https://nodejs.org/en/download/ diff --git a/node_modules/depd/index.js b/node_modules/depd/index.js deleted file mode 100644 index d758d3c8f..000000000 --- a/node_modules/depd/index.js +++ /dev/null @@ -1,522 +0,0 @@ -/*! - * depd - * Copyright(c) 2014-2017 Douglas Christopher Wilson - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var callSiteToString = require('./lib/compat').callSiteToString -var eventListenerCount = require('./lib/compat').eventListenerCount -var relative = require('path').relative - -/** - * Module exports. - */ - -module.exports = depd - -/** - * Get the path to base files on. - */ - -var basePath = process.cwd() - -/** - * Determine if namespace is contained in the string. - */ - -function containsNamespace (str, namespace) { - var vals = str.split(/[ ,]+/) - var ns = String(namespace).toLowerCase() - - for (var i = 0; i < vals.length; i++) { - var val = vals[i] - - // namespace contained - if (val && (val === '*' || val.toLowerCase() === ns)) { - return true - } - } - - return false -} - -/** - * Convert a data descriptor to accessor descriptor. - */ - -function convertDataDescriptorToAccessor (obj, prop, message) { - var descriptor = Object.getOwnPropertyDescriptor(obj, prop) - var value = descriptor.value - - descriptor.get = function getter () { return value } - - if (descriptor.writable) { - descriptor.set = function setter (val) { return (value = val) } - } - - delete descriptor.value - delete descriptor.writable - - Object.defineProperty(obj, prop, descriptor) - - return descriptor -} - -/** - * Create arguments string to keep arity. - */ - -function createArgumentsString (arity) { - var str = '' - - for (var i = 0; i < arity; i++) { - str += ', arg' + i - } - - return str.substr(2) -} - -/** - * Create stack string from stack. - */ - -function createStackString (stack) { - var str = this.name + ': ' + this.namespace - - if (this.message) { - str += ' deprecated ' + this.message - } - - for (var i = 0; i < stack.length; i++) { - str += '\n at ' + callSiteToString(stack[i]) - } - - return str -} - -/** - * Create deprecate for namespace in caller. - */ - -function depd (namespace) { - if (!namespace) { - throw new TypeError('argument namespace is required') - } - - var stack = getStack() - var site = callSiteLocation(stack[1]) - var file = site[0] - - function deprecate (message) { - // call to self as log - log.call(deprecate, message) - } - - deprecate._file = file - deprecate._ignored = isignored(namespace) - deprecate._namespace = namespace - deprecate._traced = istraced(namespace) - deprecate._warned = Object.create(null) - - deprecate.function = wrapfunction - deprecate.property = wrapproperty - - return deprecate -} - -/** - * Determine if namespace is ignored. - */ - -function isignored (namespace) { - /* istanbul ignore next: tested in a child processs */ - if (process.noDeprecation) { - // --no-deprecation support - return true - } - - var str = process.env.NO_DEPRECATION || '' - - // namespace ignored - return containsNamespace(str, namespace) -} - -/** - * Determine if namespace is traced. - */ - -function istraced (namespace) { - /* istanbul ignore next: tested in a child processs */ - if (process.traceDeprecation) { - // --trace-deprecation support - return true - } - - var str = process.env.TRACE_DEPRECATION || '' - - // namespace traced - return containsNamespace(str, namespace) -} - -/** - * Display deprecation message. - */ - -function log (message, site) { - var haslisteners = eventListenerCount(process, 'deprecation') !== 0 - - // abort early if no destination - if (!haslisteners && this._ignored) { - return - } - - var caller - var callFile - var callSite - var depSite - var i = 0 - var seen = false - var stack = getStack() - var file = this._file - - if (site) { - // provided site - depSite = site - callSite = callSiteLocation(stack[1]) - callSite.name = depSite.name - file = callSite[0] - } else { - // get call site - i = 2 - depSite = callSiteLocation(stack[i]) - callSite = depSite - } - - // get caller of deprecated thing in relation to file - for (; i < stack.length; i++) { - caller = callSiteLocation(stack[i]) - callFile = caller[0] - - if (callFile === file) { - seen = true - } else if (callFile === this._file) { - file = this._file - } else if (seen) { - break - } - } - - var key = caller - ? depSite.join(':') + '__' + caller.join(':') - : undefined - - if (key !== undefined && key in this._warned) { - // already warned - return - } - - this._warned[key] = true - - // generate automatic message from call site - var msg = message - if (!msg) { - msg = callSite === depSite || !callSite.name - ? defaultMessage(depSite) - : defaultMessage(callSite) - } - - // emit deprecation if listeners exist - if (haslisteners) { - var err = DeprecationError(this._namespace, msg, stack.slice(i)) - process.emit('deprecation', err) - return - } - - // format and write message - var format = process.stderr.isTTY - ? formatColor - : formatPlain - var output = format.call(this, msg, caller, stack.slice(i)) - process.stderr.write(output + '\n', 'utf8') -} - -/** - * Get call site location as array. - */ - -function callSiteLocation (callSite) { - var file = callSite.getFileName() || '' - var line = callSite.getLineNumber() - var colm = callSite.getColumnNumber() - - if (callSite.isEval()) { - file = callSite.getEvalOrigin() + ', ' + file - } - - var site = [file, line, colm] - - site.callSite = callSite - site.name = callSite.getFunctionName() - - return site -} - -/** - * Generate a default message from the site. - */ - -function defaultMessage (site) { - var callSite = site.callSite - var funcName = site.name - - // make useful anonymous name - if (!funcName) { - funcName = '' - } - - var context = callSite.getThis() - var typeName = context && callSite.getTypeName() - - // ignore useless type name - if (typeName === 'Object') { - typeName = undefined - } - - // make useful type name - if (typeName === 'Function') { - typeName = context.name || typeName - } - - return typeName && callSite.getMethodName() - ? typeName + '.' + funcName - : funcName -} - -/** - * Format deprecation message without color. - */ - -function formatPlain (msg, caller, stack) { - var timestamp = new Date().toUTCString() - - var formatted = timestamp + - ' ' + this._namespace + - ' deprecated ' + msg - - // add stack trace - if (this._traced) { - for (var i = 0; i < stack.length; i++) { - formatted += '\n at ' + callSiteToString(stack[i]) - } - - return formatted - } - - if (caller) { - formatted += ' at ' + formatLocation(caller) - } - - return formatted -} - -/** - * Format deprecation message with color. - */ - -function formatColor (msg, caller, stack) { - var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' + // bold cyan - ' \x1b[33;1mdeprecated\x1b[22;39m' + // bold yellow - ' \x1b[0m' + msg + '\x1b[39m' // reset - - // add stack trace - if (this._traced) { - for (var i = 0; i < stack.length; i++) { - formatted += '\n \x1b[36mat ' + callSiteToString(stack[i]) + '\x1b[39m' // cyan - } - - return formatted - } - - if (caller) { - formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m' // cyan - } - - return formatted -} - -/** - * Format call site location. - */ - -function formatLocation (callSite) { - return relative(basePath, callSite[0]) + - ':' + callSite[1] + - ':' + callSite[2] -} - -/** - * Get the stack as array of call sites. - */ - -function getStack () { - var limit = Error.stackTraceLimit - var obj = {} - var prep = Error.prepareStackTrace - - Error.prepareStackTrace = prepareObjectStackTrace - Error.stackTraceLimit = Math.max(10, limit) - - // capture the stack - Error.captureStackTrace(obj) - - // slice this function off the top - var stack = obj.stack.slice(1) - - Error.prepareStackTrace = prep - Error.stackTraceLimit = limit - - return stack -} - -/** - * Capture call site stack from v8. - */ - -function prepareObjectStackTrace (obj, stack) { - return stack -} - -/** - * Return a wrapped function in a deprecation message. - */ - -function wrapfunction (fn, message) { - if (typeof fn !== 'function') { - throw new TypeError('argument fn must be a function') - } - - var args = createArgumentsString(fn.length) - var deprecate = this // eslint-disable-line no-unused-vars - var stack = getStack() - var site = callSiteLocation(stack[1]) - - site.name = fn.name - - // eslint-disable-next-line no-eval - var deprecatedfn = eval('(function (' + args + ') {\n' + - '"use strict"\n' + - 'log.call(deprecate, message, site)\n' + - 'return fn.apply(this, arguments)\n' + - '})') - - return deprecatedfn -} - -/** - * Wrap property in a deprecation message. - */ - -function wrapproperty (obj, prop, message) { - if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { - throw new TypeError('argument obj must be object') - } - - var descriptor = Object.getOwnPropertyDescriptor(obj, prop) - - if (!descriptor) { - throw new TypeError('must call property on owner object') - } - - if (!descriptor.configurable) { - throw new TypeError('property must be configurable') - } - - var deprecate = this - var stack = getStack() - var site = callSiteLocation(stack[1]) - - // set site name - site.name = prop - - // convert data descriptor - if ('value' in descriptor) { - descriptor = convertDataDescriptorToAccessor(obj, prop, message) - } - - var get = descriptor.get - var set = descriptor.set - - // wrap getter - if (typeof get === 'function') { - descriptor.get = function getter () { - log.call(deprecate, message, site) - return get.apply(this, arguments) - } - } - - // wrap setter - if (typeof set === 'function') { - descriptor.set = function setter () { - log.call(deprecate, message, site) - return set.apply(this, arguments) - } - } - - Object.defineProperty(obj, prop, descriptor) -} - -/** - * Create DeprecationError for deprecation - */ - -function DeprecationError (namespace, message, stack) { - var error = new Error() - var stackString - - Object.defineProperty(error, 'constructor', { - value: DeprecationError - }) - - Object.defineProperty(error, 'message', { - configurable: true, - enumerable: false, - value: message, - writable: true - }) - - Object.defineProperty(error, 'name', { - enumerable: false, - configurable: true, - value: 'DeprecationError', - writable: true - }) - - Object.defineProperty(error, 'namespace', { - configurable: true, - enumerable: false, - value: namespace, - writable: true - }) - - Object.defineProperty(error, 'stack', { - configurable: true, - enumerable: false, - get: function () { - if (stackString !== undefined) { - return stackString - } - - // prepare stack trace - return (stackString = createStackString.call(this, stack)) - }, - set: function setter (val) { - stackString = val - } - }) - - return error -} diff --git a/node_modules/depd/lib/browser/index.js b/node_modules/depd/lib/browser/index.js deleted file mode 100644 index 6be45cc20..000000000 --- a/node_modules/depd/lib/browser/index.js +++ /dev/null @@ -1,77 +0,0 @@ -/*! - * depd - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = depd - -/** - * Create deprecate for namespace in caller. - */ - -function depd (namespace) { - if (!namespace) { - throw new TypeError('argument namespace is required') - } - - function deprecate (message) { - // no-op in browser - } - - deprecate._file = undefined - deprecate._ignored = true - deprecate._namespace = namespace - deprecate._traced = false - deprecate._warned = Object.create(null) - - deprecate.function = wrapfunction - deprecate.property = wrapproperty - - return deprecate -} - -/** - * Return a wrapped function in a deprecation message. - * - * This is a no-op version of the wrapper, which does nothing but call - * validation. - */ - -function wrapfunction (fn, message) { - if (typeof fn !== 'function') { - throw new TypeError('argument fn must be a function') - } - - return fn -} - -/** - * Wrap property in a deprecation message. - * - * This is a no-op version of the wrapper, which does nothing but call - * validation. - */ - -function wrapproperty (obj, prop, message) { - if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { - throw new TypeError('argument obj must be object') - } - - var descriptor = Object.getOwnPropertyDescriptor(obj, prop) - - if (!descriptor) { - throw new TypeError('must call property on owner object') - } - - if (!descriptor.configurable) { - throw new TypeError('property must be configurable') - } -} diff --git a/node_modules/depd/lib/compat/callsite-tostring.js b/node_modules/depd/lib/compat/callsite-tostring.js deleted file mode 100644 index 73186dc64..000000000 --- a/node_modules/depd/lib/compat/callsite-tostring.js +++ /dev/null @@ -1,103 +0,0 @@ -/*! - * depd - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - */ - -module.exports = callSiteToString - -/** - * Format a CallSite file location to a string. - */ - -function callSiteFileLocation (callSite) { - var fileName - var fileLocation = '' - - if (callSite.isNative()) { - fileLocation = 'native' - } else if (callSite.isEval()) { - fileName = callSite.getScriptNameOrSourceURL() - if (!fileName) { - fileLocation = callSite.getEvalOrigin() - } - } else { - fileName = callSite.getFileName() - } - - if (fileName) { - fileLocation += fileName - - var lineNumber = callSite.getLineNumber() - if (lineNumber != null) { - fileLocation += ':' + lineNumber - - var columnNumber = callSite.getColumnNumber() - if (columnNumber) { - fileLocation += ':' + columnNumber - } - } - } - - return fileLocation || 'unknown source' -} - -/** - * Format a CallSite to a string. - */ - -function callSiteToString (callSite) { - var addSuffix = true - var fileLocation = callSiteFileLocation(callSite) - var functionName = callSite.getFunctionName() - var isConstructor = callSite.isConstructor() - var isMethodCall = !(callSite.isToplevel() || isConstructor) - var line = '' - - if (isMethodCall) { - var methodName = callSite.getMethodName() - var typeName = getConstructorName(callSite) - - if (functionName) { - if (typeName && functionName.indexOf(typeName) !== 0) { - line += typeName + '.' - } - - line += functionName - - if (methodName && functionName.lastIndexOf('.' + methodName) !== functionName.length - methodName.length - 1) { - line += ' [as ' + methodName + ']' - } - } else { - line += typeName + '.' + (methodName || '') - } - } else if (isConstructor) { - line += 'new ' + (functionName || '') - } else if (functionName) { - line += functionName - } else { - addSuffix = false - line += fileLocation - } - - if (addSuffix) { - line += ' (' + fileLocation + ')' - } - - return line -} - -/** - * Get constructor name of reviver. - */ - -function getConstructorName (obj) { - var receiver = obj.receiver - return (receiver.constructor && receiver.constructor.name) || null -} diff --git a/node_modules/depd/lib/compat/event-listener-count.js b/node_modules/depd/lib/compat/event-listener-count.js deleted file mode 100644 index 3a8925d13..000000000 --- a/node_modules/depd/lib/compat/event-listener-count.js +++ /dev/null @@ -1,22 +0,0 @@ -/*! - * depd - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = eventListenerCount - -/** - * Get the count of listeners on an event emitter of a specific type. - */ - -function eventListenerCount (emitter, type) { - return emitter.listeners(type).length -} diff --git a/node_modules/depd/lib/compat/index.js b/node_modules/depd/lib/compat/index.js deleted file mode 100644 index 955b3336b..000000000 --- a/node_modules/depd/lib/compat/index.js +++ /dev/null @@ -1,79 +0,0 @@ -/*! - * depd - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var EventEmitter = require('events').EventEmitter - -/** - * Module exports. - * @public - */ - -lazyProperty(module.exports, 'callSiteToString', function callSiteToString () { - var limit = Error.stackTraceLimit - var obj = {} - var prep = Error.prepareStackTrace - - function prepareObjectStackTrace (obj, stack) { - return stack - } - - Error.prepareStackTrace = prepareObjectStackTrace - Error.stackTraceLimit = 2 - - // capture the stack - Error.captureStackTrace(obj) - - // slice the stack - var stack = obj.stack.slice() - - Error.prepareStackTrace = prep - Error.stackTraceLimit = limit - - return stack[0].toString ? toString : require('./callsite-tostring') -}) - -lazyProperty(module.exports, 'eventListenerCount', function eventListenerCount () { - return EventEmitter.listenerCount || require('./event-listener-count') -}) - -/** - * Define a lazy property. - */ - -function lazyProperty (obj, prop, getter) { - function get () { - var val = getter() - - Object.defineProperty(obj, prop, { - configurable: true, - enumerable: true, - value: val - }) - - return val - } - - Object.defineProperty(obj, prop, { - configurable: true, - enumerable: true, - get: get - }) -} - -/** - * Call toString() on the obj - */ - -function toString (obj) { - return obj.toString() -} diff --git a/node_modules/depd/package.json b/node_modules/depd/package.json deleted file mode 100644 index 71138cef4..000000000 --- a/node_modules/depd/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_from": "depd@~1.1.2", - "_id": "depd@1.1.2", - "_inBundle": false, - "_integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "_location": "/depd", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "depd@~1.1.2", - "name": "depd", - "escapedName": "depd", - "rawSpec": "~1.1.2", - "saveSpec": null, - "fetchSpec": "~1.1.2" - }, - "_requiredBy": [ - "/http-errors", - "/send" - ], - "_resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "_shasum": "9bcd52e14c097763e749b274c4346ed2e560b5a9", - "_spec": "depd@~1.1.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/send", - "author": { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - }, - "browser": "lib/browser/index.js", - "bugs": { - "url": "https://github.com/dougwilson/nodejs-depd/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Deprecate all the things", - "devDependencies": { - "beautify-benchmark": "0.2.4", - "benchmark": "2.1.4", - "eslint": "3.19.0", - "eslint-config-standard": "7.1.0", - "eslint-plugin-markdown": "1.0.0-beta.7", - "eslint-plugin-promise": "3.6.0", - "eslint-plugin-standard": "3.0.1", - "istanbul": "0.4.5", - "mocha": "~1.21.5" - }, - "engines": { - "node": ">= 0.6" - }, - "files": [ - "lib/", - "History.md", - "LICENSE", - "index.js", - "Readme.md" - ], - "homepage": "https://github.com/dougwilson/nodejs-depd#readme", - "keywords": [ - "deprecate", - "deprecated" - ], - "license": "MIT", - "name": "depd", - "repository": { - "type": "git", - "url": "git+https://github.com/dougwilson/nodejs-depd.git" - }, - "scripts": { - "bench": "node benchmark/index.js", - "lint": "eslint --plugin markdown --ext js,md .", - "test": "mocha --reporter spec --bail test/", - "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --no-exit test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/" - }, - "version": "1.1.2" -} diff --git a/node_modules/deps-sort/.travis.yml b/node_modules/deps-sort/.travis.yml deleted file mode 100644 index 4eaf0db4c..000000000 --- a/node_modules/deps-sort/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - "0.10" - - "0.12" - - node diff --git a/node_modules/deps-sort/LICENSE b/node_modules/deps-sort/LICENSE deleted file mode 100644 index ee27ba4b4..000000000 --- a/node_modules/deps-sort/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/deps-sort/bin/cmd.js b/node_modules/deps-sort/bin/cmd.js deleted file mode 100755 index e54613011..000000000 --- a/node_modules/deps-sort/bin/cmd.js +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env node - -var argv = require('subarg')(process.argv.slice(2)); -var JSONStream = require('JSONStream'); - -var sort = require('../')(argv); -var parse = JSONStream.parse([ true ]); -var stringify = JSONStream.stringify(); - -process.stdin.pipe(parse).pipe(sort).pipe(stringify).pipe(process.stdout); diff --git a/node_modules/deps-sort/example/sort.js b/node_modules/deps-sort/example/sort.js deleted file mode 100644 index cfc007548..000000000 --- a/node_modules/deps-sort/example/sort.js +++ /dev/null @@ -1,6 +0,0 @@ -var sort = require('../')(); -var JSONStream = require('JSONStream'); -var parse = JSONStream.parse([ true ]); -var stringify = JSONStream.stringify(); - -process.stdin.pipe(parse).pipe(sort).pipe(stringify).pipe(process.stdout); diff --git a/node_modules/deps-sort/index.js b/node_modules/deps-sort/index.js deleted file mode 100644 index 32cead406..000000000 --- a/node_modules/deps-sort/index.js +++ /dev/null @@ -1,122 +0,0 @@ -var through = require('through2'); -var shasum = require('shasum'); - -module.exports = function (opts) { - if (!opts) opts = {}; - var rows = []; - return through.obj(write, end); - - function write (row, enc, next) { rows.push(row); next() } - - function end () { - var tr = this; - rows.sort(cmp); - sorter(rows, tr, opts); - } -}; - -function sorter (rows, tr, opts) { - var expose = opts.expose || {}; - if (Array.isArray(expose)) { - expose = expose.reduce(function (acc, key) { - acc[key] = true; - return acc; - }, {}); - } - - var hashes = {}, deduped = {}; - var sameDeps = depCmp(); - - if (opts.dedupe) { - rows.forEach(function (row) { - var h = shasum(row.source); - sameDeps.add(row, h); - if (hashes[h]) { - hashes[h].push(row); - } else { - hashes[h] = [row]; - } - }); - Object.keys(hashes).forEach(function (h) { - var rows = hashes[h]; - while (rows.length > 1) { - var row = rows.pop(); - row.dedupe = rows[0].id; - row.sameDeps = sameDeps.cmp(rows[0].deps, row.deps); - deduped[row.id] = rows[0].id; - } - }); - } - - if (opts.index) { - var index = {}; - var offset = 0; - rows.forEach(function (row, ix) { - if (has(expose, row.id)) { - row.index = row.id; - offset ++; - if (expose[row.id] !== true) { - index[expose[row.id]] = row.index; - } - } - else { - row.index = ix + 1 - offset; - } - index[row.id] = row.index; - }); - rows.forEach(function (row) { - row.indexDeps = {}; - Object.keys(row.deps).forEach(function (key) { - var id = row.deps[key]; - row.indexDeps[key] = index[id]; - }); - if (row.dedupe) { - row.dedupeIndex = index[row.dedupe]; - } - tr.push(row); - }); - } - else { - rows.forEach(function (row) { tr.push(row) }); - } - tr.push(null); -} - -function cmp (a, b) { - return a.id + a.hash < b.id + b.hash ? -1 : 1; -} - -function has (obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} - -function depCmp () { - var deps = {}, hashes = {}; - return { add: add, cmp: cmp } - - function add (row, hash) { - deps[row.id] = row.deps; - hashes[row.id] = hash; - } - function cmp (a, b, limit) { - if (!a && !b) return true; - if (!a || !b) return false; - - var keys = Object.keys(a); - if (keys.length !== Object.keys(b).length) return false; - - for (var i = 0; i < keys.length; i++) { - var k = keys[i], ka = a[k], kb = b[k]; - var ha = hashes[ka]; - var hb = hashes[kb]; - var da = deps[ka]; - var db = deps[kb]; - - if (ka === kb) continue; - if (ha !== hb || (!limit && !cmp(da, db, 1))) { - return false; - } - } - return true; - } -} diff --git a/node_modules/deps-sort/package.json b/node_modules/deps-sort/package.json deleted file mode 100644 index 670a0a09c..000000000 --- a/node_modules/deps-sort/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_from": "deps-sort@^2.0.0", - "_id": "deps-sort@2.0.0", - "_inBundle": false, - "_integrity": "sha1-CRckkC6EZYJg65EHSMzNGvbiH7U=", - "_location": "/deps-sort", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "deps-sort@^2.0.0", - "name": "deps-sort", - "escapedName": "deps-sort", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/browserify" - ], - "_resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", - "_shasum": "091724902e84658260eb910748cccd1af6e21fb5", - "_spec": "deps-sort@^2.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bin": { - "deps-sort": "bin/cmd.js" - }, - "bugs": { - "url": "https://github.com/substack/deps-sort/issues" - }, - "bundleDependencies": false, - "dependencies": { - "JSONStream": "^1.0.3", - "shasum": "^1.0.0", - "subarg": "^1.0.0", - "through2": "^2.0.0" - }, - "deprecated": false, - "description": "sort module-deps output for deterministic browserify bundles", - "devDependencies": { - "tap": "^2.2.0" - }, - "homepage": "https://github.com/substack/deps-sort", - "keywords": [ - "dependency", - "graph", - "browser", - "browserify", - "module-deps", - "browser-pack", - "sorted", - "determinism" - ], - "license": "MIT", - "main": "index.js", - "name": "deps-sort", - "repository": { - "type": "git", - "url": "git://github.com/substack/deps-sort.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "2.0.0" -} diff --git a/node_modules/deps-sort/readme.markdown b/node_modules/deps-sort/readme.markdown deleted file mode 100644 index 873210b8e..000000000 --- a/node_modules/deps-sort/readme.markdown +++ /dev/null @@ -1,83 +0,0 @@ -# deps-sort - -sort [module-deps](https://npmjs.org/package/module-deps) output for deterministic -browserify bundles - -[![build status](https://secure.travis-ci.org/substack/deps-sort.png)](http://travis-ci.org/substack/deps-sort) - -# example - -## command-line - -``` -$ for((i=0;i<5;i++)); do module-deps main.js | deps-sort | browser-pack | md5sum; done -e9e630de2c62953140357db0444c3c3a - -e9e630de2c62953140357db0444c3c3a - -e9e630de2c62953140357db0444c3c3a - -e9e630de2c62953140357db0444c3c3a - -e9e630de2c62953140357db0444c3c3a - -``` - -or using `browserify --deps` on a [voxeljs](http://voxeljs.com/) project: - -``` -$ for((i=0;i<5;i++)); do browserify --deps browser.js | deps-sort | browser-pack | md5sum; done -fb418c74b53ba2e4cef7d01808b848e6 - -fb418c74b53ba2e4cef7d01808b848e6 - -fb418c74b53ba2e4cef7d01808b848e6 - -fb418c74b53ba2e4cef7d01808b848e6 - -fb418c74b53ba2e4cef7d01808b848e6 - -``` - -## api - -To use this module programmatically, write streaming object data and read -streaming object data: - -``` js -var sort = require('../')(); -var JSONStream = require('JSONStream'); -var parse = JSONStream.parse([ true ]); -var stringify = JSONStream.stringify(); - -process.stdin.pipe(parse).pipe(sort).pipe(stringify).pipe(process.stdout); -``` - -# methods - -``` js -var depsSort = require('deps-sort'); -``` - -## var stream = depsSort(opts) - -Return a new through `stream` that should get written -[module-deps](https://npmjs.org/package/module-deps) objects and will output -sorted objects. - -`opts` can be: - -* `opts.index` - when true, for each module-deps row, insert `row.index` with -the numeric index and `row.indexDeps` like `row.deps` but mapping require -strings to row indices - -* `opts.expose` - array of names or object mapping names to `true` not to mangle -with integer indexes when `opts.index` is turned on. If `opts.expose` maps names -to strings, those strings will be used to resolve the indexed references. - -* `opts.dedupe` - set `row.dedupe` for files that match existing contents. Sets -`row.dedupeIndex` when `opts.index` is enabled. When `row.dedupe` is set, -`row.sameDeps` will be set to a boolean of whether the dependencies at the -dedupe target match (true) or just the source content (false). - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install deps-sort -``` - -# license - -MIT diff --git a/node_modules/deps-sort/test/dedupe-deps-of-deps.js b/node_modules/deps-sort/test/dedupe-deps-of-deps.js deleted file mode 100644 index f0849c59b..000000000 --- a/node_modules/deps-sort/test/dedupe-deps-of-deps.js +++ /dev/null @@ -1,71 +0,0 @@ -var sort = require('../'); -var test = require('tap').test; -var through = require('through2'); - -test('dedupe-deps-of-deps', function (t) { - t.plan(1); - var s = sort({ dedupe: true }); - var rows = []; - function write (row, enc, next) { rows.push(row); next() } - function end () { - t.deepEqual(rows, [ - { - id: '/bar.js', - deps: { baz: '/bar/baz.js' }, - source: 'TWO' - }, - { - id: '/bar/baz.js', - deps: {}, - source: 'THREE' - }, - { - id: '/foo.js', - deps: { baz: '/foo/baz.js' }, - source: 'TWO', - dedupe: '/bar.js', - sameDeps: true - }, - { - id: '/foo/baz.js', - deps: {}, - source: 'THREE', - dedupe: '/bar/baz.js', - sameDeps: true - }, - { - id: '/main.js', - deps: { './foo': '/foo.js', './bar': '/bar.js' }, - source: 'ONE' - } - ]); - } - s.pipe(through.obj(write, end)); - - s.write({ - id: '/main.js', - deps: { './foo': '/foo.js', './bar': '/bar.js' }, - source: 'ONE' - }); - s.write({ - id: '/foo.js', - deps: { baz : '/foo/baz.js' }, - source: 'TWO' - }); - s.write({ - id: '/bar.js', - deps: { baz : '/bar/baz.js' }, - source: 'TWO' - }); - s.write({ - id: '/foo/baz.js', - deps: {}, - source: 'THREE' - }); - s.write({ - id: '/bar/baz.js', - deps: {}, - source: 'THREE' - }); - s.end(); -}); diff --git a/node_modules/deps-sort/test/dedupe.js b/node_modules/deps-sort/test/dedupe.js deleted file mode 100644 index e5b0ef3c1..000000000 --- a/node_modules/deps-sort/test/dedupe.js +++ /dev/null @@ -1,39 +0,0 @@ -var sort = require('../'); -var test = require('tap').test; -var through = require('through2'); - -test('dedupe', function (t) { - t.plan(1); - var s = sort({ dedupe: true }); - var rows = []; - function write (row, enc, next) { rows.push(row); next() } - function end () { - t.deepEqual(rows, [ - { id: '/bar.js', deps: {}, source: 'TWO' }, - { id: '/foo.js', deps: {}, source: 'TWO', dedupe: '/bar.js', sameDeps: true }, - { - id: '/main.js', - deps: { './foo': '/foo.js', './bar': '/bar.js' }, - source: 'ONE' - } - ]); - } - s.pipe(through.obj(write, end)); - - s.write({ - id: '/main.js', - deps: { './foo': '/foo.js', './bar': '/bar.js' }, - source: 'ONE' - }); - s.write({ - id: '/foo.js', - deps: {}, - source: 'TWO' - }); - s.write({ - id: '/bar.js', - deps: {}, - source: 'TWO' - }); - s.end(); -}); diff --git a/node_modules/deps-sort/test/dedupe_index.js b/node_modules/deps-sort/test/dedupe_index.js deleted file mode 100644 index 313b7442e..000000000 --- a/node_modules/deps-sort/test/dedupe_index.js +++ /dev/null @@ -1,56 +0,0 @@ -var sort = require('../'); -var test = require('tap').test; -var through = require('through2'); - -test('dedupe index', function (t) { - t.plan(1); - var s = sort({ dedupe: true, index: true }); - var rows = []; - function write (row, enc, next) { rows.push(row); next() } - function end () { - t.deepEqual(rows, [ - { - id: '/bar.js', - deps: {}, - source: 'TWO', - index: 1, - indexDeps: {} - }, - { - id: '/foo.js', - deps: {}, - source: 'TWO', - dedupe: '/bar.js', - index: 2, - indexDeps: {}, - dedupeIndex: 1, - sameDeps: true - }, - { - id: '/main.js', - deps: { './foo': '/foo.js', './bar': '/bar.js' }, - source: 'ONE', - index: 3, - indexDeps: { './foo': 2, './bar': 1 }, - } - ]); - } - s.pipe(through.obj(write, end)); - - s.write({ - id: '/main.js', - deps: { './foo': '/foo.js', './bar': '/bar.js' }, - source: 'ONE' - }); - s.write({ - id: '/foo.js', - deps: {}, - source: 'TWO' - }); - s.write({ - id: '/bar.js', - deps: {}, - source: 'TWO' - }); - s.end(); -}); diff --git a/node_modules/deps-sort/test/dedupe_undef.js b/node_modules/deps-sort/test/dedupe_undef.js deleted file mode 100644 index 3a9f987ec..000000000 --- a/node_modules/deps-sort/test/dedupe_undef.js +++ /dev/null @@ -1,37 +0,0 @@ -var sort = require('../'); -var test = require('tap').test; -var through = require('through2'); - -test('dedupe undef', function (t) { - t.plan(1); - var s = sort({ dedupe: true }); - var rows = []; - function write (row, enc, next) { rows.push(row); next() } - function end () { - t.deepEqual(rows, [ - { id: '/bar.js', source: 'TWO' }, - { id: '/foo.js', source: 'TWO', dedupe: '/bar.js', sameDeps: true }, - { - id: '/main.js', - deps: { './foo': '/foo.js', './bar': '/bar.js' }, - source: 'ONE' - } - ]); - } - s.pipe(through.obj(write, end)); - - s.write({ - id: '/main.js', - deps: { './foo': '/foo.js', './bar': '/bar.js' }, - source: 'ONE' - }); - s.write({ - id: '/foo.js', - source: 'TWO' - }); - s.write({ - id: '/bar.js', - source: 'TWO' - }); - s.end(); -}); diff --git a/node_modules/deps-sort/test/expose.js b/node_modules/deps-sort/test/expose.js deleted file mode 100644 index 7beb90d82..000000000 --- a/node_modules/deps-sort/test/expose.js +++ /dev/null @@ -1,38 +0,0 @@ -var sort = require('../'); -var test = require('tap').test; -var through = require('through2'); - -test('expose true', function (t) { - t.plan(1); - var s = sort({ index: true, expose: [ '/foo.js', '/bar.js' ] }); - var rows = []; - function write (row, enc, next) { rows.push(row); next() } - function end () { - t.deepEqual(rows, [ - { - id: '/bar.js', - deps: {}, - index: '/bar.js', - indexDeps: {} - }, - { - id: '/foo.js', - deps: { './bar': '/bar.js' }, - index: '/foo.js', - indexDeps: { './bar': '/bar.js' } - }, - { - id: '/main.js', - deps: { './foo': '/foo.js' }, - index: 1, - indexDeps: { './foo': '/foo.js' } - }, - ]); - } - s.pipe(through.obj(write, end)); - - s.write({ id: '/main.js', deps: { './foo': '/foo.js' } }); - s.write({ id: '/foo.js', deps: { './bar': '/bar.js' } }); - s.write({ id: '/bar.js', deps: {} }); - s.end(); -}); diff --git a/node_modules/deps-sort/test/expose_str.js b/node_modules/deps-sort/test/expose_str.js deleted file mode 100644 index 9ba151ef4..000000000 --- a/node_modules/deps-sort/test/expose_str.js +++ /dev/null @@ -1,44 +0,0 @@ -var sort = require('../'); -var test = require('tap').test; -var through = require('through2'); - -test('expose string', function (t) { - t.plan(1); - var s = sort({ - index: true, - expose: { - 'f': '/foo.js', - 'b': '/bar.js' - } - }); - var rows = []; - function write (row, enc, next) { rows.push(row); next() } - function end () { - t.deepEqual(rows, [ - { - id: '/main.js', - deps: { './foo': '/foo.js' }, - index: 1, - indexDeps: { './foo': 'f' } - }, - { - id: 'b', - deps: {}, - index: 'b', - indexDeps: {} - }, - { - id: 'f', - deps: { './bar': '/bar.js' }, - index: 'f', - indexDeps: { './bar': 'b' } - } - ]); - } - s.pipe(through.obj(write, end)); - - s.write({ id: '/main.js', deps: { './foo': '/foo.js' } }); - s.write({ id: 'f', deps: { './bar': '/bar.js' } }); - s.write({ id: 'b', deps: {} }); - s.end(); -}); diff --git a/node_modules/deps-sort/test/indexed.js b/node_modules/deps-sort/test/indexed.js deleted file mode 100644 index f47ea8c10..000000000 --- a/node_modules/deps-sort/test/indexed.js +++ /dev/null @@ -1,38 +0,0 @@ -var sort = require('../'); -var test = require('tap').test; -var through = require('through2'); - -test('indexed', function (t) { - t.plan(1); - var s = sort({ index: true }); - var rows = []; - function write (row, enc, next) { rows.push(row); next() } - function end () { - t.deepEqual(rows, [ - { - id: '/bar.js', - deps: {}, - index: 1, - indexDeps: {} - }, - { - id: '/foo.js', - deps: { './bar': '/bar.js' }, - index: 2, - indexDeps: { './bar': 1 } - }, - { - id: '/main.js', - deps: { './foo': '/foo.js' }, - index: 3, - indexDeps: { './foo': 2 } - }, - ]); - } - s.pipe(through.obj(write, end)); - - s.write({ id: '/main.js', deps: { './foo': '/foo.js' } }); - s.write({ id: '/foo.js', deps: { './bar': '/bar.js' } }); - s.write({ id: '/bar.js', deps: {} }); - s.end(); -}); diff --git a/node_modules/deps-sort/test/sort.js b/node_modules/deps-sort/test/sort.js deleted file mode 100644 index 7c600d4b8..000000000 --- a/node_modules/deps-sort/test/sort.js +++ /dev/null @@ -1,23 +0,0 @@ -var sort = require('../'); -var test = require('tap').test; -var through = require('through2'); - -test('sort', function (t) { - t.plan(1); - var s = sort(); - var rows = []; - function write (row, enc, next) { rows.push(row); next() } - function end () { - t.deepEqual(rows, [ - { id: '/bar.js', deps: {} }, - { id: '/foo.js', deps: { './bar': '/bar.js' } }, - { id: '/main.js', deps: { './foo': '/foo.js' } } - ]); - } - s.pipe(through.obj(write, end)); - - s.write({ id: '/main.js', deps: { './foo': '/foo.js' } }); - s.write({ id: '/foo.js', deps: { './bar': '/bar.js' } }); - s.write({ id: '/bar.js', deps: {} }); - s.end(); -}); diff --git a/node_modules/des.js/.jscsrc b/node_modules/des.js/.jscsrc deleted file mode 100644 index dbaae2057..000000000 --- a/node_modules/des.js/.jscsrc +++ /dev/null @@ -1,46 +0,0 @@ -{ - "disallowKeywordsOnNewLine": [ "else" ], - "disallowMixedSpacesAndTabs": true, - "disallowMultipleLineStrings": true, - "disallowMultipleVarDecl": true, - "disallowNewlineBeforeBlockStatements": true, - "disallowQuotedKeysInObjects": true, - "disallowSpaceAfterObjectKeys": true, - "disallowSpaceAfterPrefixUnaryOperators": true, - "disallowSpaceBeforePostfixUnaryOperators": true, - "disallowSpacesInCallExpression": true, - "disallowTrailingComma": true, - "disallowTrailingWhitespace": true, - "disallowYodaConditions": true, - - "requireCommaBeforeLineBreak": true, - "requireOperatorBeforeLineBreak": true, - "requireSpaceAfterBinaryOperators": true, - "requireSpaceAfterKeywords": [ "if", "for", "while", "else", "try", "catch" ], - "requireSpaceAfterLineComment": true, - "requireSpaceBeforeBinaryOperators": true, - "requireSpaceBeforeBlockStatements": true, - "requireSpaceBeforeKeywords": [ "else", "catch" ], - "requireSpaceBeforeObjectValues": true, - "requireSpaceBetweenArguments": true, - "requireSpacesInAnonymousFunctionExpression": { - "beforeOpeningCurlyBrace": true - }, - "requireSpacesInFunctionDeclaration": { - "beforeOpeningCurlyBrace": true - }, - "requireSpacesInFunctionExpression": { - "beforeOpeningCurlyBrace": true - }, - "requireSpacesInConditionalExpression": true, - "requireSpacesInForStatement": true, - "requireSpacesInsideArrayBrackets": "all", - "requireSpacesInsideObjectBrackets": "all", - "requireDotNotation": true, - - "maximumLineLength": 80, - "validateIndentation": 2, - "validateLineBreaks": "LF", - "validateParameterSeparator": ", ", - "validateQuoteMarks": "'" -} diff --git a/node_modules/des.js/.jshintrc b/node_modules/des.js/.jshintrc deleted file mode 100644 index 7e9739029..000000000 --- a/node_modules/des.js/.jshintrc +++ /dev/null @@ -1,89 +0,0 @@ -{ - // JSHint Default Configuration File (as on JSHint website) - // See http://jshint.com/docs/ for more details - - "maxerr" : 50, // {int} Maximum error before stopping - - // Enforcing - "bitwise" : false, // true: Prohibit bitwise operators (&, |, ^, etc.) - "camelcase" : false, // true: Identifiers must be in camelCase - "curly" : false, // true: Require {} for every new block or scope - "eqeqeq" : true, // true: Require triple equals (===) for comparison - "forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty() - "freeze" : true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc. - "immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());` - "indent" : 2, // {int} Number of spaces to use for indentation - "latedef" : true, // true: Require variables/functions to be defined before being used - "newcap" : true, // true: Require capitalization of all constructor functions e.g. `new F()` - "noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee` - "noempty" : false, // true: Prohibit use of empty blocks - "nonbsp" : true, // true: Prohibit "non-breaking whitespace" characters. - "nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment) - "plusplus" : false, // true: Prohibit use of `++` & `--` - "quotmark" : "single", // Quotation mark consistency: - // false : do nothing (default) - // true : ensure whatever is used is consistent - // "single" : require single quotes - // "double" : require double quotes - "undef" : true, // true: Require all non-global variables to be declared (prevents global leaks) - "unused" : true, // true: Require all defined variables be used - "strict" : true, // true: Requires all functions run in ES5 Strict Mode - "maxparams" : false, // {int} Max number of formal params allowed per function - "maxdepth" : 3, // {int} Max depth of nested blocks (within functions) - "maxstatements" : false, // {int} Max number statements per function - "maxcomplexity" : false, // {int} Max cyclomatic complexity per function - "maxlen" : false, // {int} Max number of characters per line - - // Relaxing - "asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons) - "boss" : false, // true: Tolerate assignments where comparisons would be expected - "debug" : false, // true: Allow debugger statements e.g. browser breakpoints. - "eqnull" : false, // true: Tolerate use of `== null` - "es5" : false, // true: Allow ES5 syntax (ex: getters and setters) - "esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`) - "moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features) - // (ex: `for each`, multiple try/catch, function expression…) - "evil" : false, // true: Tolerate use of `eval` and `new Function()` - "expr" : false, // true: Tolerate `ExpressionStatement` as Programs - "funcscope" : false, // true: Tolerate defining variables inside control statements - "globalstrict" : false, // true: Allow global "use strict" (also enables 'strict') - "iterator" : false, // true: Tolerate using the `__iterator__` property - "lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block - "laxbreak" : false, // true: Tolerate possibly unsafe line breakings - "laxcomma" : false, // true: Tolerate comma-first style coding - "loopfunc" : false, // true: Tolerate functions being defined in loops - "multistr" : false, // true: Tolerate multi-line strings - "noyield" : false, // true: Tolerate generator functions with no yield statement in them. - "notypeof" : false, // true: Tolerate invalid typeof operator values - "proto" : false, // true: Tolerate using the `__proto__` property - "scripturl" : false, // true: Tolerate script-targeted URLs - "shadow" : true, // true: Allows re-define variables later in code e.g. `var x=1; x=2;` - "sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation - "supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;` - "validthis" : false, // true: Tolerate using this in a non-constructor function - - // Environments - "browser" : true, // Web Browser (window, document, etc) - "browserify" : true, // Browserify (node.js code in the browser) - "couch" : false, // CouchDB - "devel" : true, // Development/debugging (alert, confirm, etc) - "dojo" : false, // Dojo Toolkit - "jasmine" : false, // Jasmine - "jquery" : false, // jQuery - "mocha" : true, // Mocha - "mootools" : false, // MooTools - "node" : true, // Node.js - "nonstandard" : false, // Widely adopted globals (escape, unescape, etc) - "prototypejs" : false, // Prototype and Scriptaculous - "qunit" : false, // QUnit - "rhino" : false, // Rhino - "shelljs" : false, // ShellJS - "worker" : false, // Web Workers - "wsh" : false, // Windows Scripting Host - "yui" : false, // Yahoo User Interface - - // Custom Globals - "globals" : { - "module": true - } // additional predefined global variables -} diff --git a/node_modules/des.js/.npmignore b/node_modules/des.js/.npmignore deleted file mode 100644 index 1ca957177..000000000 --- a/node_modules/des.js/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log diff --git a/node_modules/des.js/README.md b/node_modules/des.js/README.md deleted file mode 100644 index 976de33bd..000000000 --- a/node_modules/des.js/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# DES.js - -## LICENSE - -This software is licensed under the MIT License. - -Copyright Fedor Indutny, 2015. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the -following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/des.js/lib/des.js b/node_modules/des.js/lib/des.js deleted file mode 100644 index 2fd04a6dc..000000000 --- a/node_modules/des.js/lib/des.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -exports.utils = require('./des/utils'); -exports.Cipher = require('./des/cipher'); -exports.DES = require('./des/des'); -exports.CBC = require('./des/cbc'); -exports.EDE = require('./des/ede'); diff --git a/node_modules/des.js/lib/des/cbc.js b/node_modules/des.js/lib/des/cbc.js deleted file mode 100644 index 208ea3133..000000000 --- a/node_modules/des.js/lib/des/cbc.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict'; - -var assert = require('minimalistic-assert'); -var inherits = require('inherits'); - -var proto = {}; - -function CBCState(iv) { - assert.equal(iv.length, 8, 'Invalid IV length'); - - this.iv = new Array(8); - for (var i = 0; i < this.iv.length; i++) - this.iv[i] = iv[i]; -} - -function instantiate(Base) { - function CBC(options) { - Base.call(this, options); - this._cbcInit(); - } - inherits(CBC, Base); - - var keys = Object.keys(proto); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - CBC.prototype[key] = proto[key]; - } - - CBC.create = function create(options) { - return new CBC(options); - }; - - return CBC; -} - -exports.instantiate = instantiate; - -proto._cbcInit = function _cbcInit() { - var state = new CBCState(this.options.iv); - this._cbcState = state; -}; - -proto._update = function _update(inp, inOff, out, outOff) { - var state = this._cbcState; - var superProto = this.constructor.super_.prototype; - - var iv = state.iv; - if (this.type === 'encrypt') { - for (var i = 0; i < this.blockSize; i++) - iv[i] ^= inp[inOff + i]; - - superProto._update.call(this, iv, 0, out, outOff); - - for (var i = 0; i < this.blockSize; i++) - iv[i] = out[outOff + i]; - } else { - superProto._update.call(this, inp, inOff, out, outOff); - - for (var i = 0; i < this.blockSize; i++) - out[outOff + i] ^= iv[i]; - - for (var i = 0; i < this.blockSize; i++) - iv[i] = inp[inOff + i]; - } -}; diff --git a/node_modules/des.js/lib/des/cipher.js b/node_modules/des.js/lib/des/cipher.js deleted file mode 100644 index d0090b4cd..000000000 --- a/node_modules/des.js/lib/des/cipher.js +++ /dev/null @@ -1,141 +0,0 @@ -'use strict'; - -var assert = require('minimalistic-assert'); - -function Cipher(options) { - this.options = options; - - this.type = this.options.type; - this.blockSize = 8; - this._init(); - - this.buffer = new Array(this.blockSize); - this.bufferOff = 0; -} -module.exports = Cipher; - -Cipher.prototype._init = function _init() { - // Might be overrided -}; - -Cipher.prototype.update = function update(data) { - if (data.length === 0) - return []; - - if (this.type === 'decrypt') - return this._updateDecrypt(data); - else - return this._updateEncrypt(data); -}; - -Cipher.prototype._buffer = function _buffer(data, off) { - // Append data to buffer - var min = Math.min(this.buffer.length - this.bufferOff, data.length - off); - for (var i = 0; i < min; i++) - this.buffer[this.bufferOff + i] = data[off + i]; - this.bufferOff += min; - - // Shift next - return min; -}; - -Cipher.prototype._flushBuffer = function _flushBuffer(out, off) { - this._update(this.buffer, 0, out, off); - this.bufferOff = 0; - return this.blockSize; -}; - -Cipher.prototype._updateEncrypt = function _updateEncrypt(data) { - var inputOff = 0; - var outputOff = 0; - - var count = ((this.bufferOff + data.length) / this.blockSize) | 0; - var out = new Array(count * this.blockSize); - - if (this.bufferOff !== 0) { - inputOff += this._buffer(data, inputOff); - - if (this.bufferOff === this.buffer.length) - outputOff += this._flushBuffer(out, outputOff); - } - - // Write blocks - var max = data.length - ((data.length - inputOff) % this.blockSize); - for (; inputOff < max; inputOff += this.blockSize) { - this._update(data, inputOff, out, outputOff); - outputOff += this.blockSize; - } - - // Queue rest - for (; inputOff < data.length; inputOff++, this.bufferOff++) - this.buffer[this.bufferOff] = data[inputOff]; - - return out; -}; - -Cipher.prototype._updateDecrypt = function _updateDecrypt(data) { - var inputOff = 0; - var outputOff = 0; - - var count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1; - var out = new Array(count * this.blockSize); - - // TODO(indutny): optimize it, this is far from optimal - for (; count > 0; count--) { - inputOff += this._buffer(data, inputOff); - outputOff += this._flushBuffer(out, outputOff); - } - - // Buffer rest of the input - inputOff += this._buffer(data, inputOff); - - return out; -}; - -Cipher.prototype.final = function final(buffer) { - var first; - if (buffer) - first = this.update(buffer); - - var last; - if (this.type === 'encrypt') - last = this._finalEncrypt(); - else - last = this._finalDecrypt(); - - if (first) - return first.concat(last); - else - return last; -}; - -Cipher.prototype._pad = function _pad(buffer, off) { - if (off === 0) - return false; - - while (off < buffer.length) - buffer[off++] = 0; - - return true; -}; - -Cipher.prototype._finalEncrypt = function _finalEncrypt() { - if (!this._pad(this.buffer, this.bufferOff)) - return []; - - var out = new Array(this.blockSize); - this._update(this.buffer, 0, out, 0); - return out; -}; - -Cipher.prototype._unpad = function _unpad(buffer) { - return buffer; -}; - -Cipher.prototype._finalDecrypt = function _finalDecrypt() { - assert.equal(this.bufferOff, this.blockSize, 'Not enough data to decrypt'); - var out = new Array(this.blockSize); - this._flushBuffer(out, 0); - - return this._unpad(out); -}; diff --git a/node_modules/des.js/lib/des/des.js b/node_modules/des.js/lib/des/des.js deleted file mode 100644 index b64a6d1b0..000000000 --- a/node_modules/des.js/lib/des/des.js +++ /dev/null @@ -1,143 +0,0 @@ -'use strict'; - -var assert = require('minimalistic-assert'); -var inherits = require('inherits'); - -var des = require('../des'); -var utils = des.utils; -var Cipher = des.Cipher; - -function DESState() { - this.tmp = new Array(2); - this.keys = null; -} - -function DES(options) { - Cipher.call(this, options); - - var state = new DESState(); - this._desState = state; - - this.deriveKeys(state, options.key); -} -inherits(DES, Cipher); -module.exports = DES; - -DES.create = function create(options) { - return new DES(options); -}; - -var shiftTable = [ - 1, 1, 2, 2, 2, 2, 2, 2, - 1, 2, 2, 2, 2, 2, 2, 1 -]; - -DES.prototype.deriveKeys = function deriveKeys(state, key) { - state.keys = new Array(16 * 2); - - assert.equal(key.length, this.blockSize, 'Invalid key length'); - - var kL = utils.readUInt32BE(key, 0); - var kR = utils.readUInt32BE(key, 4); - - utils.pc1(kL, kR, state.tmp, 0); - kL = state.tmp[0]; - kR = state.tmp[1]; - for (var i = 0; i < state.keys.length; i += 2) { - var shift = shiftTable[i >>> 1]; - kL = utils.r28shl(kL, shift); - kR = utils.r28shl(kR, shift); - utils.pc2(kL, kR, state.keys, i); - } -}; - -DES.prototype._update = function _update(inp, inOff, out, outOff) { - var state = this._desState; - - var l = utils.readUInt32BE(inp, inOff); - var r = utils.readUInt32BE(inp, inOff + 4); - - // Initial Permutation - utils.ip(l, r, state.tmp, 0); - l = state.tmp[0]; - r = state.tmp[1]; - - if (this.type === 'encrypt') - this._encrypt(state, l, r, state.tmp, 0); - else - this._decrypt(state, l, r, state.tmp, 0); - - l = state.tmp[0]; - r = state.tmp[1]; - - utils.writeUInt32BE(out, l, outOff); - utils.writeUInt32BE(out, r, outOff + 4); -}; - -DES.prototype._pad = function _pad(buffer, off) { - var value = buffer.length - off; - for (var i = off; i < buffer.length; i++) - buffer[i] = value; - - return true; -}; - -DES.prototype._unpad = function _unpad(buffer) { - var pad = buffer[buffer.length - 1]; - for (var i = buffer.length - pad; i < buffer.length; i++) - assert.equal(buffer[i], pad); - - return buffer.slice(0, buffer.length - pad); -}; - -DES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) { - var l = lStart; - var r = rStart; - - // Apply f() x16 times - for (var i = 0; i < state.keys.length; i += 2) { - var keyL = state.keys[i]; - var keyR = state.keys[i + 1]; - - // f(r, k) - utils.expand(r, state.tmp, 0); - - keyL ^= state.tmp[0]; - keyR ^= state.tmp[1]; - var s = utils.substitute(keyL, keyR); - var f = utils.permute(s); - - var t = r; - r = (l ^ f) >>> 0; - l = t; - } - - // Reverse Initial Permutation - utils.rip(r, l, out, off); -}; - -DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) { - var l = rStart; - var r = lStart; - - // Apply f() x16 times - for (var i = state.keys.length - 2; i >= 0; i -= 2) { - var keyL = state.keys[i]; - var keyR = state.keys[i + 1]; - - // f(r, k) - utils.expand(l, state.tmp, 0); - - keyL ^= state.tmp[0]; - keyR ^= state.tmp[1]; - var s = utils.substitute(keyL, keyR); - var f = utils.permute(s); - - var t = l; - l = (r ^ f) >>> 0; - r = t; - } - - // Reverse Initial Permutation - utils.rip(l, r, out, off); -}; diff --git a/node_modules/des.js/lib/des/ede.js b/node_modules/des.js/lib/des/ede.js deleted file mode 100644 index cefc4a5c7..000000000 --- a/node_modules/des.js/lib/des/ede.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -var assert = require('minimalistic-assert'); -var inherits = require('inherits'); - -var des = require('../des'); -var Cipher = des.Cipher; -var DES = des.DES; - -function EDEState(type, key) { - assert.equal(key.length, 24, 'Invalid key length'); - - var k1 = key.slice(0, 8); - var k2 = key.slice(8, 16); - var k3 = key.slice(16, 24); - - if (type === 'encrypt') { - this.ciphers = [ - DES.create({ type: 'encrypt', key: k1 }), - DES.create({ type: 'decrypt', key: k2 }), - DES.create({ type: 'encrypt', key: k3 }) - ]; - } else { - this.ciphers = [ - DES.create({ type: 'decrypt', key: k3 }), - DES.create({ type: 'encrypt', key: k2 }), - DES.create({ type: 'decrypt', key: k1 }) - ]; - } -} - -function EDE(options) { - Cipher.call(this, options); - - var state = new EDEState(this.type, this.options.key); - this._edeState = state; -} -inherits(EDE, Cipher); - -module.exports = EDE; - -EDE.create = function create(options) { - return new EDE(options); -}; - -EDE.prototype._update = function _update(inp, inOff, out, outOff) { - var state = this._edeState; - - state.ciphers[0]._update(inp, inOff, out, outOff); - state.ciphers[1]._update(out, outOff, out, outOff); - state.ciphers[2]._update(out, outOff, out, outOff); -}; - -EDE.prototype._pad = DES.prototype._pad; -EDE.prototype._unpad = DES.prototype._unpad; diff --git a/node_modules/des.js/lib/des/utils.js b/node_modules/des.js/lib/des/utils.js deleted file mode 100644 index 08a5ccd9c..000000000 --- a/node_modules/des.js/lib/des/utils.js +++ /dev/null @@ -1,256 +0,0 @@ -'use strict'; - -exports.readUInt32BE = function readUInt32BE(bytes, off) { - var res = (bytes[0 + off] << 24) | - (bytes[1 + off] << 16) | - (bytes[2 + off] << 8) | - bytes[3 + off]; - return res >>> 0; -}; - -exports.writeUInt32BE = function writeUInt32BE(bytes, value, off) { - bytes[0 + off] = value >>> 24; - bytes[1 + off] = (value >>> 16) & 0xff; - bytes[2 + off] = (value >>> 8) & 0xff; - bytes[3 + off] = value & 0xff; -}; - -exports.ip = function ip(inL, inR, out, off) { - var outL = 0; - var outR = 0; - - for (var i = 6; i >= 0; i -= 2) { - for (var j = 0; j <= 24; j += 8) { - outL <<= 1; - outL |= (inR >>> (j + i)) & 1; - } - for (var j = 0; j <= 24; j += 8) { - outL <<= 1; - outL |= (inL >>> (j + i)) & 1; - } - } - - for (var i = 6; i >= 0; i -= 2) { - for (var j = 1; j <= 25; j += 8) { - outR <<= 1; - outR |= (inR >>> (j + i)) & 1; - } - for (var j = 1; j <= 25; j += 8) { - outR <<= 1; - outR |= (inL >>> (j + i)) & 1; - } - } - - out[off + 0] = outL >>> 0; - out[off + 1] = outR >>> 0; -}; - -exports.rip = function rip(inL, inR, out, off) { - var outL = 0; - var outR = 0; - - for (var i = 0; i < 4; i++) { - for (var j = 24; j >= 0; j -= 8) { - outL <<= 1; - outL |= (inR >>> (j + i)) & 1; - outL <<= 1; - outL |= (inL >>> (j + i)) & 1; - } - } - for (var i = 4; i < 8; i++) { - for (var j = 24; j >= 0; j -= 8) { - outR <<= 1; - outR |= (inR >>> (j + i)) & 1; - outR <<= 1; - outR |= (inL >>> (j + i)) & 1; - } - } - - out[off + 0] = outL >>> 0; - out[off + 1] = outR >>> 0; -}; - -exports.pc1 = function pc1(inL, inR, out, off) { - var outL = 0; - var outR = 0; - - // 7, 15, 23, 31, 39, 47, 55, 63 - // 6, 14, 22, 30, 39, 47, 55, 63 - // 5, 13, 21, 29, 39, 47, 55, 63 - // 4, 12, 20, 28 - for (var i = 7; i >= 5; i--) { - for (var j = 0; j <= 24; j += 8) { - outL <<= 1; - outL |= (inR >> (j + i)) & 1; - } - for (var j = 0; j <= 24; j += 8) { - outL <<= 1; - outL |= (inL >> (j + i)) & 1; - } - } - for (var j = 0; j <= 24; j += 8) { - outL <<= 1; - outL |= (inR >> (j + i)) & 1; - } - - // 1, 9, 17, 25, 33, 41, 49, 57 - // 2, 10, 18, 26, 34, 42, 50, 58 - // 3, 11, 19, 27, 35, 43, 51, 59 - // 36, 44, 52, 60 - for (var i = 1; i <= 3; i++) { - for (var j = 0; j <= 24; j += 8) { - outR <<= 1; - outR |= (inR >> (j + i)) & 1; - } - for (var j = 0; j <= 24; j += 8) { - outR <<= 1; - outR |= (inL >> (j + i)) & 1; - } - } - for (var j = 0; j <= 24; j += 8) { - outR <<= 1; - outR |= (inL >> (j + i)) & 1; - } - - out[off + 0] = outL >>> 0; - out[off + 1] = outR >>> 0; -}; - -exports.r28shl = function r28shl(num, shift) { - return ((num << shift) & 0xfffffff) | (num >>> (28 - shift)); -}; - -var pc2table = [ - // inL => outL - 14, 11, 17, 4, 27, 23, 25, 0, - 13, 22, 7, 18, 5, 9, 16, 24, - 2, 20, 12, 21, 1, 8, 15, 26, - - // inR => outR - 15, 4, 25, 19, 9, 1, 26, 16, - 5, 11, 23, 8, 12, 7, 17, 0, - 22, 3, 10, 14, 6, 20, 27, 24 -]; - -exports.pc2 = function pc2(inL, inR, out, off) { - var outL = 0; - var outR = 0; - - var len = pc2table.length >>> 1; - for (var i = 0; i < len; i++) { - outL <<= 1; - outL |= (inL >>> pc2table[i]) & 0x1; - } - for (var i = len; i < pc2table.length; i++) { - outR <<= 1; - outR |= (inR >>> pc2table[i]) & 0x1; - } - - out[off + 0] = outL >>> 0; - out[off + 1] = outR >>> 0; -}; - -exports.expand = function expand(r, out, off) { - var outL = 0; - var outR = 0; - - outL = ((r & 1) << 5) | (r >>> 27); - for (var i = 23; i >= 15; i -= 4) { - outL <<= 6; - outL |= (r >>> i) & 0x3f; - } - for (var i = 11; i >= 3; i -= 4) { - outR |= (r >>> i) & 0x3f; - outR <<= 6; - } - outR |= ((r & 0x1f) << 1) | (r >>> 31); - - out[off + 0] = outL >>> 0; - out[off + 1] = outR >>> 0; -}; - -var sTable = [ - 14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1, - 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8, - 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7, - 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13, - - 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14, - 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5, - 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2, - 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9, - - 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10, - 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1, - 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7, - 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12, - - 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3, - 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9, - 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8, - 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14, - - 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1, - 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6, - 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13, - 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3, - - 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5, - 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8, - 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10, - 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13, - - 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10, - 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6, - 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7, - 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12, - - 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4, - 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2, - 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13, - 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11 -]; - -exports.substitute = function substitute(inL, inR) { - var out = 0; - for (var i = 0; i < 4; i++) { - var b = (inL >>> (18 - i * 6)) & 0x3f; - var sb = sTable[i * 0x40 + b]; - - out <<= 4; - out |= sb; - } - for (var i = 0; i < 4; i++) { - var b = (inR >>> (18 - i * 6)) & 0x3f; - var sb = sTable[4 * 0x40 + i * 0x40 + b]; - - out <<= 4; - out |= sb; - } - return out >>> 0; -}; - -var permuteTable = [ - 16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22, - 30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7 -]; - -exports.permute = function permute(num) { - var out = 0; - for (var i = 0; i < permuteTable.length; i++) { - out <<= 1; - out |= (num >>> permuteTable[i]) & 0x1; - } - return out >>> 0; -}; - -exports.padSplit = function padSplit(num, size, group) { - var str = num.toString(2); - while (str.length < size) - str = '0' + str; - - var out = []; - for (var i = 0; i < size; i += group) - out.push(str.slice(i, i + group)); - return out.join(' '); -}; diff --git a/node_modules/des.js/package.json b/node_modules/des.js/package.json deleted file mode 100644 index 14fca47a9..000000000 --- a/node_modules/des.js/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_from": "des.js@^1.0.0", - "_id": "des.js@1.0.0", - "_inBundle": false, - "_integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", - "_location": "/des.js", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "des.js@^1.0.0", - "name": "des.js", - "escapedName": "des.js", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/browserify-des" - ], - "_resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", - "_shasum": "c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc", - "_spec": "des.js@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify-des", - "author": { - "name": "Fedor Indutny", - "email": "fedor@indutny.com" - }, - "bugs": { - "url": "https://github.com/indutny/des.js/issues" - }, - "bundleDependencies": false, - "dependencies": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - }, - "deprecated": false, - "description": "DES implementation", - "devDependencies": { - "jscs": "^2.1.1", - "jshint": "^2.8.0", - "mocha": "^2.3.0" - }, - "homepage": "https://github.com/indutny/des.js#readme", - "keywords": [ - "DES", - "3DES", - "EDE", - "CBC" - ], - "license": "MIT", - "main": "lib/des.js", - "name": "des.js", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/indutny/des.js.git" - }, - "scripts": { - "test": "mocha --reporter=spec test/*-test.js && jscs lib/*.js lib/**/*.js test/*.js && jshint lib/*.js lib/**/*.js" - }, - "version": "1.0.0" -} diff --git a/node_modules/des.js/test/cbc-test.js b/node_modules/des.js/test/cbc-test.js deleted file mode 100644 index d07881c13..000000000 --- a/node_modules/des.js/test/cbc-test.js +++ /dev/null @@ -1,73 +0,0 @@ -'use strict'; - -var assert = require('assert'); -var crypto = require('crypto'); -var Buffer = require('buffer').Buffer; - -var des = require('../'); - -var fixtures = require('./fixtures'); -var bin = fixtures.bin; - -describe('DES-CBC', function() { - var CBC = des.CBC.instantiate(des.DES); - - describe('encryption/decryption', function() { - var vectors = [ - { - key: '133457799bbcdff1', - iv: '0102030405060708', - input: '0123456789abcdef' - }, - { - key: '0000000000000000', - iv: 'ffffffffffffffff', - input: '0000000000000000' - }, - { - key: 'a3a3a3a3b3b3b3b3', - iv: 'cdcdcdcdcdcdcdcd', - input: 'cccccccccccccccc' - }, - { - key: 'deadbeefabbadead', - iv: 'a0da0da0da0da0da', - input: '0102030405060708090a' - }, - { - key: 'aabbccddeeff0011', - iv: 'fefefefefefefefe', - input: '0102030405060708090a0102030405060708090a0102030405060708090a' + - '0102030405060708090a0102030405060607080a0102030405060708090a' - } - ]; - - vectors.forEach(function(vec, i) { - it('should encrypt vector ' + i, function() { - var key = new Buffer(vec.key, 'hex'); - var iv = new Buffer(vec.iv, 'hex'); - var input = new Buffer(vec.input, 'hex'); - - var enc = CBC.create({ - type: 'encrypt', - key: key, - iv: iv - }); - var out = new Buffer(enc.update(input).concat(enc.final())); - - var cipher = crypto.createCipheriv('des-cbc', key, iv); - var expected = Buffer.concat([ cipher.update(input), cipher.final() ]); - - assert.deepEqual(out, expected); - - var dec = CBC.create({ - type: 'decrypt', - key: key, - iv: iv - }); - assert.deepEqual(new Buffer(dec.update(out).concat(dec.final())), - input); - }); - }); - }); -}); diff --git a/node_modules/des.js/test/des-test.js b/node_modules/des.js/test/des-test.js deleted file mode 100644 index b6a5ee84f..000000000 --- a/node_modules/des.js/test/des-test.js +++ /dev/null @@ -1,139 +0,0 @@ -'use strict'; - -var assert = require('assert'); -var crypto = require('crypto'); -var Buffer = require('buffer').Buffer; - -var des = require('../'); - -var fixtures = require('./fixtures'); -var bin = fixtures.bin; - -describe('DES', function() { - describe('Key Derivation', function() { - it('should derive proper keys', function() { - var d = des.DES.create({ - type: 'encrypt', - key: [ 0x13, 0x34, 0x57, 0x79, 0x9B, 0xBC, 0xDF, 0xF1 ] - }); - - var expected = [ - '000110 110000 001011 101111', - '111111 000111 000001 110010', - '011110 011010 111011 011001', - '110110 111100 100111 100101', - '010101 011111 110010 001010', - '010000 101100 111110 011001', - '011100 101010 110111 010110', - '110110 110011 010100 011101', - '011111 001110 110000 000111', - '111010 110101 001110 101000', - '011000 111010 010100 111110', - '010100 000111 101100 101111', - '111011 001000 010010 110111', - '111101 100001 100010 111100', - '111101 111000 101000 111010', - '110000 010011 101111 111011', - '111000 001101 101111 101011', - '111011 011110 011110 000001', - '101100 011111 001101 000111', - '101110 100100 011001 001111', - '001000 010101 111111 010011', - '110111 101101 001110 000110', - '011101 010111 000111 110101', - '100101 000110 011111 101001', - '100101 111100 010111 010001', - '111110 101011 101001 000001', - '010111 110100 001110 110111', - '111100 101110 011100 111010', - '101111 111001 000110 001101', - '001111 010011 111100 001010', - '110010 110011 110110 001011', - '000011 100001 011111 110101' - ]; - - expected = expected.map(fixtures.bin); - assert.deepEqual(d._desState.keys, expected); - }); - }); - - describe('encryption/decryption', function() { - var vectors = [ - { - key: '133457799bbcdff1', - input: '0123456789abcdef' - }, - { - key: '0000000000000000', - input: '0000000000000000' - }, - { - key: 'a3a3a3a3b3b3b3b3', - input: 'cccccccccccccccc' - }, - { - key: 'deadbeefabbadead', - input: '0102030405060708090a' - }, - { - key: 'aabbccddeeff0011', - input: '0102030405060708090a0102030405060708090a0102030405060708090a' + - '0102030405060708090a0102030405060607080a0102030405060708090a' - } - ]; - - vectors.forEach(function(vec, i) { - it('should encrypt vector ' + i, function() { - var key = new Buffer(vec.key, 'hex'); - var input = new Buffer(vec.input, 'hex'); - - var enc = des.DES.create({ - type: 'encrypt', - key: key - }); - var dec = des.DES.create({ - type: 'decrypt', - key: key - }); - var out = new Buffer(enc.update(input).concat(enc.final())); - - var cipher = crypto.createCipheriv('des-ecb', key, new Buffer(0)); - var expected = Buffer.concat([ cipher.update(input), cipher.final() ]); - - assert.deepEqual(out, expected); - - assert.deepEqual(new Buffer(dec.update(out).concat(dec.final())), - input); - }); - }); - - it('should buffer during encryption/decryption', function() { - var key = new Buffer('0102030405060708', 'hex'); - var chunk = new Buffer('01020304050607', 'hex'); - var count = 257; - var expected = new Buffer( - new Array(count + 1).join('01020304050607'), 'hex'); - - var enc = des.DES.create({ - type: 'encrypt', - key: key - }); - var cipher = []; - for (var i = 0; i < count; i++) - cipher = cipher.concat(enc.update(chunk)); - cipher = cipher.concat(enc.final()); - - var dec = des.DES.create({ - type: 'decrypt', - key: key - }); - var out = []; - for (var i = 0; i < count; i++) - out = out.concat(dec.update(cipher.slice(i * 7, (i + 1) * 7))); - out = out.concat(dec.final(cipher.slice(i * 7))); - - out = new Buffer(out); - assert.deepEqual(out, expected); - }); - }); -}); diff --git a/node_modules/des.js/test/ede-test.js b/node_modules/des.js/test/ede-test.js deleted file mode 100644 index 116a76a82..000000000 --- a/node_modules/des.js/test/ede-test.js +++ /dev/null @@ -1,73 +0,0 @@ -'use strict'; - -var assert = require('assert'); -var crypto = require('crypto'); -var Buffer = require('buffer').Buffer; - -var des = require('../'); - -var fixtures = require('./fixtures'); -var bin = fixtures.bin; - -describe('DES-EDE-CBC', function() { - var CBC = des.CBC.instantiate(des.EDE); - - describe('encryption/decryption', function() { - var vectors = [ - { - key: new Array(4).join('133457799bbcdff1'), - iv: '0102030405060708', - input: '0123456789abcdef' - }, - { - key: new Array(4).join('0000000000000000'), - iv: 'ffffffffffffffff', - input: '0000000000000000' - }, - { - key: new Array(4).join('a3a3a3a3b3b3b3b3'), - iv: 'cdcdcdcdcdcdcdcd', - input: 'cccccccccccccccc' - }, - { - key: new Array(4).join('deadbeefabbadead'), - iv: 'a0da0da0da0da0da', - input: '0102030405060708090a' - }, - { - key: 'aabbccddeeff0011' + '1111222233334444' + 'ffffeeeeddddcccc', - iv: 'fefefefefefefefe', - input: '0102030405060708090a0102030405060708090a0102030405060708090a' + - '0102030405060708090a0102030405060607080a0102030405060708090a' - } - ]; - - vectors.forEach(function(vec, i) { - it('should encrypt vector ' + i, function() { - var key = new Buffer(vec.key, 'hex'); - var iv = new Buffer(vec.iv, 'hex'); - var input = new Buffer(vec.input, 'hex'); - - var enc = CBC.create({ - type: 'encrypt', - key: key, - iv: iv - }); - var out = new Buffer(enc.update(input).concat(enc.final())); - - var cipher = crypto.createCipheriv('des-ede3-cbc', key, iv); - var expected = Buffer.concat([ cipher.update(input), cipher.final() ]); - - assert.deepEqual(out, expected); - - var dec = CBC.create({ - type: 'decrypt', - key: key, - iv: iv - }); - assert.deepEqual(new Buffer(dec.update(out).concat(dec.final())), - input); - }); - }); - }); -}); diff --git a/node_modules/des.js/test/fixtures.js b/node_modules/des.js/test/fixtures.js deleted file mode 100644 index fe8ccd8b6..000000000 --- a/node_modules/des.js/test/fixtures.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -exports.bin = function bin(str) { - return parseInt(str.replace(/[^01]/g, ''), 2); -} diff --git a/node_modules/des.js/test/utils-test.js b/node_modules/des.js/test/utils-test.js deleted file mode 100644 index 4c576de08..000000000 --- a/node_modules/des.js/test/utils-test.js +++ /dev/null @@ -1,169 +0,0 @@ -'use strict'; - -var assert = require('assert'); - -var des = require('../'); -var utils = des.utils; - -var fixtures = require('./fixtures'); -var bin = fixtures.bin; - -describe('utils', function() { - describe('IP', function() { - it('should permute properly', function() { - var out = new Array(2); - var inp = [ - bin('00000001 00100011 01000101 01100111'), - bin('10001001 10101011 11001101 11101111') - ]; - - utils.ip(inp[0], inp[1], out, 0); - - var expected = [ - bin('11001100 00000000 11001100 11111111'), - bin('11110000 10101010 11110000 10101010') - ]; - - assert.deepEqual(out, expected); - }); - - it('should rev-permute properly', function() { - var out = new Array(2); - var inp = [ - bin('11001100 00000000 11001100 11111111'), - bin('11110000 10101010 11110000 10101010') - ]; - - utils.rip(inp[0], inp[1], out, 0); - - var expected = [ - bin('00000001 00100011 01000101 01100111'), - bin('10001001 10101011 11001101 11101111') - ]; - - assert.deepEqual(out, expected); - }); - }); - - describe('PC1', function() { - it('should permute properly', function() { - var out = new Array(2); - var inp = [ - bin('00010011 00110100 01010111 01111001'), - bin('10011011 10111100 11011111 11110001') - ]; - - utils.pc1(inp[0], inp[1], out, 0); - - var expected = [ - bin('1111000 0110011 0010101 0101111'), - bin('0101010 1011001 1001111 0001111') - ]; - - assert.deepEqual(out, expected); - }); - }); - - describe('r28shl', function() { - it('should shl properly', function() { - assert.equal(utils.r28shl(bin('1111000011001100101010101111'), 1), - bin('1110000110011001010101011111')); - - assert.equal(utils.r28shl(bin('0101010101100110011110001111'), 1), - bin('1010101011001100111100011110')); - - assert.equal(utils.r28shl(bin('1111000011001100101010101111'), 4), - bin('0000110011001010101011111111')); - - assert.equal(utils.r28shl(bin('0101010101100110011110001111'), 4), - bin('0101011001100111100011110101')); - }); - }); - - describe('PC2', function() { - it('should permute properly', function() { - var out = new Array(2); - var inp = [ - bin('1110000 1100110 0101010 1011111'), - bin('1010101 0110011 0011110 0011110') - ]; - - utils.pc2(inp[0], inp[1], out, 0); - - var expected = [ - bin('000110 110000 001011 101111'), - bin('111111 000111 000001 110010') - ]; - - assert.deepEqual(out, expected); - }); - }); - - describe('readUInt32BE', function() { - it('should read number properly', function() { - var a = [ 0xde, 0xad, 0xbe, 0xef ]; - var o = utils.readUInt32BE(a, 0); - assert.equal(o, 0xdeadbeef); - }); - }); - - describe('writeUInt32BE', function() { - it('should read number properly', function() { - var a = [ 0, 0, 0, 0 ]; - utils.writeUInt32BE(a, 0xdeadbeef, 0); - var expected = [ 0xde, 0xad, 0xbe, 0xef ]; - assert.deepEqual(a, expected); - }); - }); - - describe('expand', function() { - it('should expand', function() { - var out = [ 0, 0 ]; - utils.expand(bin('1111 0000 1010 1010 1111 0000 1010 1010'), out, 0); - var expected = [ - bin('011110 100001 010101 010101'), - bin('011110 100001 010101 010101') - ]; - assert.deepEqual(out, expected); - }); - - it('should expand with low 1', function() { - var out = [ 0, 0 ]; - utils.expand(bin('1111 0000 1010 1010 1111 0000 1010 1011'), out, 0); - var expected = [ - bin('111110 100001 010101 010101'), - bin('011110 100001 010101 010111') - ]; - assert.deepEqual(out, expected); - }); - - it('should expand with low 1', function() { - var out = [ 0, 0 ]; - utils.expand(bin('10100010 01011100 00001011 11110100'), out, 0); - var expected = [ - bin('010100 000100 001011 111000'), - bin('000001 010111 111110 101001') - ]; - assert.deepEqual(out, expected); - }); - }); - - describe('substitute', function() { - it('should substitute', function() { - var input = [ - bin('011000 010001 011110 111010'), - bin('100001 100110 010100 100111') - ]; - var output = utils.substitute(input[0], input[1]); - assert.equal(output, bin('0101 1100 1000 0010 1011 0101 1001 0111')); - }); - }); - - describe('permute', function() { - it('should permute', function() { - var output = utils.permute( - bin('0101 1100 1000 0010 1011 0101 1001 0111')); - assert.equal(output, bin('0010 0011 0100 1010 1010 1001 1011 1011')); - }); - }); -}); diff --git a/node_modules/destroy/LICENSE b/node_modules/destroy/LICENSE deleted file mode 100644 index a7ae8ee9b..000000000 --- a/node_modules/destroy/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ - -The MIT License (MIT) - -Copyright (c) 2014 Jonathan Ong me@jongleberry.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/destroy/README.md b/node_modules/destroy/README.md deleted file mode 100644 index 6474bc3ce..000000000 --- a/node_modules/destroy/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# Destroy - -[![NPM version][npm-image]][npm-url] -[![Build status][travis-image]][travis-url] -[![Test coverage][coveralls-image]][coveralls-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] -[![Gittip][gittip-image]][gittip-url] - -Destroy a stream. - -This module is meant to ensure a stream gets destroyed, handling different APIs -and Node.js bugs. - -## API - -```js -var destroy = require('destroy') -``` - -### destroy(stream) - -Destroy the given stream. In most cases, this is identical to a simple -`stream.destroy()` call. The rules are as follows for a given stream: - - 1. If the `stream` is an instance of `ReadStream`, then call `stream.destroy()` - and add a listener to the `open` event to call `stream.close()` if it is - fired. This is for a Node.js bug that will leak a file descriptor if - `.destroy()` is called before `open`. - 2. If the `stream` is not an instance of `Stream`, then nothing happens. - 3. If the `stream` has a `.destroy()` method, then call it. - -The function returns the `stream` passed in as the argument. - -## Example - -```js -var destroy = require('destroy') - -var fs = require('fs') -var stream = fs.createReadStream('package.json') - -// ... and later -destroy(stream) -``` - -[npm-image]: https://img.shields.io/npm/v/destroy.svg?style=flat-square -[npm-url]: https://npmjs.org/package/destroy -[github-tag]: http://img.shields.io/github/tag/stream-utils/destroy.svg?style=flat-square -[github-url]: https://github.com/stream-utils/destroy/tags -[travis-image]: https://img.shields.io/travis/stream-utils/destroy.svg?style=flat-square -[travis-url]: https://travis-ci.org/stream-utils/destroy -[coveralls-image]: https://img.shields.io/coveralls/stream-utils/destroy.svg?style=flat-square -[coveralls-url]: https://coveralls.io/r/stream-utils/destroy?branch=master -[license-image]: http://img.shields.io/npm/l/destroy.svg?style=flat-square -[license-url]: LICENSE.md -[downloads-image]: http://img.shields.io/npm/dm/destroy.svg?style=flat-square -[downloads-url]: https://npmjs.org/package/destroy -[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square -[gittip-url]: https://www.gittip.com/jonathanong/ diff --git a/node_modules/destroy/index.js b/node_modules/destroy/index.js deleted file mode 100644 index 6da2d26ee..000000000 --- a/node_modules/destroy/index.js +++ /dev/null @@ -1,75 +0,0 @@ -/*! - * destroy - * Copyright(c) 2014 Jonathan Ong - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var ReadStream = require('fs').ReadStream -var Stream = require('stream') - -/** - * Module exports. - * @public - */ - -module.exports = destroy - -/** - * Destroy a stream. - * - * @param {object} stream - * @public - */ - -function destroy(stream) { - if (stream instanceof ReadStream) { - return destroyReadStream(stream) - } - - if (!(stream instanceof Stream)) { - return stream - } - - if (typeof stream.destroy === 'function') { - stream.destroy() - } - - return stream -} - -/** - * Destroy a ReadStream. - * - * @param {object} stream - * @private - */ - -function destroyReadStream(stream) { - stream.destroy() - - if (typeof stream.close === 'function') { - // node.js core bug work-around - stream.on('open', onOpenClose) - } - - return stream -} - -/** - * On open handler to close stream. - * @private - */ - -function onOpenClose() { - if (typeof this.fd === 'number') { - // actually close down the fd - this.close() - } -} diff --git a/node_modules/destroy/package.json b/node_modules/destroy/package.json deleted file mode 100644 index 9729d8038..000000000 --- a/node_modules/destroy/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "_from": "destroy@~1.0.4", - "_id": "destroy@1.0.4", - "_inBundle": false, - "_integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", - "_location": "/destroy", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "destroy@~1.0.4", - "name": "destroy", - "escapedName": "destroy", - "rawSpec": "~1.0.4", - "saveSpec": null, - "fetchSpec": "~1.0.4" - }, - "_requiredBy": [ - "/send" - ], - "_resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "_shasum": "978857442c44749e4206613e37946205826abd80", - "_spec": "destroy@~1.0.4", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/send", - "author": { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com" - }, - "bugs": { - "url": "https://github.com/stream-utils/destroy/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - } - ], - "deprecated": false, - "description": "destroy a stream if possible", - "devDependencies": { - "istanbul": "0.4.2", - "mocha": "2.3.4" - }, - "files": [ - "index.js", - "LICENSE" - ], - "homepage": "https://github.com/stream-utils/destroy#readme", - "keywords": [ - "stream", - "streams", - "destroy", - "cleanup", - "leak", - "fd" - ], - "license": "MIT", - "name": "destroy", - "repository": { - "type": "git", - "url": "git+https://github.com/stream-utils/destroy.git" - }, - "scripts": { - "test": "mocha --reporter spec", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" - }, - "version": "1.0.4" -} diff --git a/node_modules/detective/.travis.yml b/node_modules/detective/.travis.yml deleted file mode 100644 index a2814bc4d..000000000 --- a/node_modules/detective/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: node_js -node_js: - - "9" - - "8" - - "6" - - "4" - - "iojs" - - "0.12" - - "0.10" - - "0.8" -sudo: false -before_install: - - 'nvm install-latest-npm' -matrix: - fast_finish: true \ No newline at end of file diff --git a/node_modules/detective/CHANGELOG.md b/node_modules/detective/CHANGELOG.md deleted file mode 100644 index c9f4550d1..000000000 --- a/node_modules/detective/CHANGELOG.md +++ /dev/null @@ -1,17 +0,0 @@ -# detective Change Log -All notable changes to this project will be documented in this file. -This project adheres to [Semantic Versioning](http://semver.org/). - -## 5.1.0 - 2018-02-28 -* Use acorn-node parser, which matches latest Node syntax support (https://github.com/browserify/detective/pull/78) -* Add basic cli: `detective index.js` outputs dependency names (https://github.com/browserify/detective/pull/51) - -## 5.0.2 - 2018-01-06 -* Extend support back to 0.8 until we can determine a LTS plan. - -## 5.0.1 - 2018-01-02 -* Add engines field set to `>=4.0.0`. - -## 5.0.0 - 2018-01-02 -* Fix: Don't crash on files with the spread operator (https://github.com/browserify/detective/pull/75) -* Breaking: Drop support for node 0.12 (https://github.com/browserify/detective/pull/75) diff --git a/node_modules/detective/LICENSE b/node_modules/detective/LICENSE deleted file mode 100644 index ee27ba4b4..000000000 --- a/node_modules/detective/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/detective/bench/detect.js b/node_modules/detective/bench/detect.js deleted file mode 100644 index b7d0dd980..000000000 --- a/node_modules/detective/bench/detect.js +++ /dev/null @@ -1,7 +0,0 @@ -var detective = require('../'); -var fs = require('fs'); - -var src = fs.readFileSync(__dirname + '/src/jquery.js', 'utf8'); -var t0 = Date.now(); -var requires = detective(src); -console.log(Date.now() - t0); diff --git a/node_modules/detective/bench/esprima_v_acorn.txt b/node_modules/detective/bench/esprima_v_acorn.txt deleted file mode 100644 index a2340fe73..000000000 --- a/node_modules/detective/bench/esprima_v_acorn.txt +++ /dev/null @@ -1,18 +0,0 @@ -esprima: - - $ for i in {1..5}; do node detect.js; done - 704 - 702 - 704 - 704 - 697 - -acorn: - - $ for i in {1..5}; do node detect.js; done - 555 - 552 - 585 - 549 - 583 - diff --git a/node_modules/detective/bin/detective.js b/node_modules/detective/bin/detective.js deleted file mode 100755 index f3ff863e8..000000000 --- a/node_modules/detective/bin/detective.js +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env node - -var detective = require('../'); -var argv = require('minimist')(process.argv.slice(2)); -var fs = require('fs'); - -argv._.forEach(function(file) { - var src = fs.readFileSync(file, 'utf8'); - var requires = detective(src, argv); - console.log(requires.join('\n')); -}); diff --git a/node_modules/detective/example/strings.js b/node_modules/detective/example/strings.js deleted file mode 100644 index b9cc58fb6..000000000 --- a/node_modules/detective/example/strings.js +++ /dev/null @@ -1,6 +0,0 @@ -var detective = require('../'); -var fs = require('fs'); - -var src = fs.readFileSync(__dirname + '/strings_src.js'); -var requires = detective(src); -console.dir(requires); diff --git a/node_modules/detective/example/strings_src.js b/node_modules/detective/example/strings_src.js deleted file mode 100644 index 88d083276..000000000 --- a/node_modules/detective/example/strings_src.js +++ /dev/null @@ -1,3 +0,0 @@ -var a = require('a'); -var b = require('b'); -var c = require('c'); diff --git a/node_modules/detective/index.js b/node_modules/detective/index.js deleted file mode 100644 index 382d701a9..000000000 --- a/node_modules/detective/index.js +++ /dev/null @@ -1,80 +0,0 @@ -var acorn = require('acorn-node'); -var walk = require('acorn-node/walk'); -var defined = require('defined'); - -var requireRe = /\brequire\b/; - -function parse (src, opts) { - if (!opts) opts = {}; - return acorn.parse(src, { - ecmaVersion: defined(opts.ecmaVersion, 9), - sourceType: defined(opts.sourceType, 'script'), - ranges: defined(opts.ranges, opts.range), - locations: defined(opts.locations, opts.loc), - allowReserved: defined(opts.allowReserved, true), - allowReturnOutsideFunction: defined( - opts.allowReturnOutsideFunction, true - ), - allowImportExportEverywhere: defined( - opts.allowImportExportEverywhere, true - ), - allowHashBang: defined(opts.allowHashBang, true) - }); -} - -var exports = module.exports = function (src, opts) { - return exports.find(src, opts).strings; -}; - -exports.find = function (src, opts) { - if (!opts) opts = {}; - - var word = opts.word === undefined ? 'require' : opts.word; - if (typeof src !== 'string') src = String(src); - - var isRequire = opts.isRequire || function (node) { - return node.callee.type === 'Identifier' - && node.callee.name === word - ; - }; - - var modules = { strings : [], expressions : [] }; - if (opts.nodes) modules.nodes = []; - - var wordRe = word === 'require' ? requireRe : RegExp('\\b' + word + '\\b'); - if (!wordRe.test(src)) return modules; - - var ast = parse(src, opts.parse); - - function visit(node, st, c) { - var hasRequire = wordRe.test(src.slice(node.start, node.end)); - if (!hasRequire) return; - walk.base[node.type](node, st, c); - if (node.type !== 'CallExpression') return; - if (isRequire(node)) { - if (node.arguments.length) { - var arg = node.arguments[0]; - if (arg.type === 'Literal') { - modules.strings.push(arg.value); - } - else if (arg.type === 'TemplateLiteral' - && arg.quasis.length === 1 - && arg.expressions.length === 0) { - - modules.strings.push(arg.quasis[0].value.raw); - } - else { - modules.expressions.push(src.slice(arg.start, arg.end)); - } - } - if (opts.nodes) modules.nodes.push(node); - } - } - - walk.recursive(ast, null, { - Statement: visit, - Expression: visit - }); - - return modules; -}; diff --git a/node_modules/detective/package.json b/node_modules/detective/package.json deleted file mode 100644 index 3da3ac960..000000000 --- a/node_modules/detective/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_from": "detective@^5.0.2", - "_id": "detective@5.1.0", - "_inBundle": false, - "_integrity": "sha512-TFHMqfOvxlgrfVzTEkNBSh9SvSNX/HfF4OFI2QFGCyPm02EsyILqnUeb5P6q7JZ3SFNTBL5t2sePRgrN4epUWQ==", - "_location": "/detective", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "detective@^5.0.2", - "name": "detective", - "escapedName": "detective", - "rawSpec": "^5.0.2", - "saveSpec": null, - "fetchSpec": "^5.0.2" - }, - "_requiredBy": [ - "/module-deps" - ], - "_resolved": "https://registry.npmjs.org/detective/-/detective-5.1.0.tgz", - "_shasum": "7a20d89236d7b331ccea65832e7123b5551bb7cb", - "_spec": "detective@^5.0.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/module-deps", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bin": { - "detective": "bin/detective.js" - }, - "bugs": { - "url": "https://github.com/browserify/detective/issues" - }, - "bundleDependencies": false, - "dependencies": { - "acorn-node": "^1.3.0", - "defined": "^1.0.0", - "minimist": "^1.1.1" - }, - "deprecated": false, - "description": "find all require() calls by walking the AST", - "devDependencies": { - "tap": "^10.7.3" - }, - "engines": { - "node": ">=0.8.0" - }, - "homepage": "https://github.com/browserify/detective#readme", - "keywords": [ - "analyze", - "ast", - "require", - "source" - ], - "license": "MIT", - "main": "index.js", - "name": "detective", - "repository": { - "type": "git", - "url": "git://github.com/browserify/detective.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "5.1.0" -} diff --git a/node_modules/detective/readme.markdown b/node_modules/detective/readme.markdown deleted file mode 100644 index 34b0524fb..000000000 --- a/node_modules/detective/readme.markdown +++ /dev/null @@ -1,81 +0,0 @@ -# detective - -find all calls to `require()` by walking the AST - -[![build status](https://secure.travis-ci.org/browserify/detective.png)](http://travis-ci.org/browserify/detective) - -# example - -## strings - -strings_src.js: - -``` js -var a = require('a'); -var b = require('b'); -var c = require('c'); -``` - -strings.js: - -``` js -var detective = require('detective'); -var fs = require('fs'); - -var src = fs.readFileSync(__dirname + '/strings_src.js'); -var requires = detective(src); -console.dir(requires); -``` - -output: - -``` -$ node examples/strings.js -[ 'a', 'b', 'c' ] -``` - -# methods - -``` js -var detective = require('detective'); -``` - -## detective(src, opts) - -Give some source body `src`, return an array of all the `require()` calls with -string arguments. - -The options parameter `opts` is passed along to `detective.find()`. - -## var found = detective.find(src, opts) - -Give some source body `src`, return `found` with: - -* `found.strings` - an array of each string found in a `require()` -* `found.expressions` - an array of each stringified expression found in a -`require()` call -* `found.nodes` (when `opts.nodes === true`) - an array of AST nodes for each -argument found in a `require()` call - -Optionally: - -* `opts.word` - specify a different function name instead of `"require"` -* `opts.nodes` - when `true`, populate `found.nodes` -* `opts.isRequire(node)` - a function returning whether an AST `CallExpression` -node is a require call -* `opts.parse` - supply options directly to -[acorn](https://npmjs.org/package/acorn) with some support for esprima-style -options `range` and `loc` -* `opts.ecmaVersion` - default: 9 - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install detective -``` - -# license - -MIT diff --git a/node_modules/detective/test/both.js b/node_modules/detective/test/both.js deleted file mode 100644 index f09f1f854..000000000 --- a/node_modules/detective/test/both.js +++ /dev/null @@ -1,26 +0,0 @@ -var test = require('tap').test; -var detective = require('../'); -var fs = require('fs'); -var src = fs.readFileSync(__dirname + '/files/both.js'); - -test('both', function (t) { - var modules = detective.find(src); - t.deepEqual(modules.strings, [ 'a', 'b' ]); - t.deepEqual(modules.expressions, [ "'c' + x", "'d' + y" ]); - t.notOk(modules.nodes, 'has no nodes'); - t.end(); -}); - -test('both with nodes specified in opts', function (t) { - var modules = detective.find(src, { nodes: true }); - t.deepEqual(modules.strings, [ 'a', 'b' ]); - t.deepEqual(modules.expressions, [ "'c' + x", "'d' + y" ]); - t.deepEqual( - modules.nodes.map(function (n) { - var arg = n.arguments[0]; - return arg.value || arg.left.value; - }), - [ 'a', 'b', 'c', 'd' ], - 'has a node for each require'); - t.end(); -}); diff --git a/node_modules/detective/test/chained.js b/node_modules/detective/test/chained.js deleted file mode 100644 index 307c20150..000000000 --- a/node_modules/detective/test/chained.js +++ /dev/null @@ -1,9 +0,0 @@ -var test = require('tap').test; -var detective = require('../'); -var fs = require('fs'); -var src = fs.readFileSync(__dirname + '/files/chained.js'); - -test('chained', function (t) { - t.deepEqual(detective(src), [ 'c', 'b', 'a' ]); - t.end(); -}); diff --git a/node_modules/detective/test/complicated.js b/node_modules/detective/test/complicated.js deleted file mode 100644 index af402e18c..000000000 --- a/node_modules/detective/test/complicated.js +++ /dev/null @@ -1,58 +0,0 @@ -var test = require('tap').test; -var detective = require('../'); - -var sources = [ - 'require("a")', - "require('a')", - 'require(`a`)', - ';require("a")', - ' require("a")', - 'void require("a")', - '+require("a")', - '!require("a")', - '/*comments*/require("a")', - '(require("a"))', - - 'require/*comments*/("a")', - ';require/*comments*/("a")', - ' require/*comments*/("a")', - 'void require/*comments*/("a")', - '+require/*comments*/("a")', - '!require/*comments*/("a")', - '/*comments*/require/*comments*/("a")', - '(require/*comments*/("a"))', - - 'require /*comments*/ ("a")', - ';require /*comments*/ ("a")', - ' require /*comments*/ ("a")', - 'void require /*comments*/ ("a")', - '+require /*comments*/ ("a")', - '!require /*comments*/ ("a")', - ' /*comments*/ require /*comments*/ ("a")', - '(require /*comments*/ ("a"))', - - 'require /*comments*/ /*more comments*/ ("a")', - ';require /*comments*/ /*more comments*/ ("a")', - ' require /*comments*/ /*more comments*/ ("a")', - 'void require /*comments*/ /*more comments*/ ("a")', - '+require /*comments*/ /*more comments*/ ("a")', - '!require /*comments*/ /*more comments*/ ("a")', - ' /*comments*/ /*more comments*/ require /*comments*/ /*more comments*/ ("a")', - '(require /*comments*/ /*more comments*/ ("a"))', - - 'require//comments\n("a")', - ';require//comments\n("a")', - ' require//comments\n("a")', - 'void require//comments\n("a")', - '+require//comments\n("a")', - '!require//comments\n("a")', - ' require//comments\n("a")', - '(require//comments\n("a"))' -]; - -test('complicated', function (t) { - t.plan(sources.length); - sources.forEach(function(src) { - t.deepEqual(detective(src), [ 'a' ]); - }); -}); diff --git a/node_modules/detective/test/es6-module.js b/node_modules/detective/test/es6-module.js deleted file mode 100644 index 379c89cc3..000000000 --- a/node_modules/detective/test/es6-module.js +++ /dev/null @@ -1,9 +0,0 @@ -var test = require('tap').test; -var detective = require('../'); -var fs = require('fs'); -var src = fs.readFileSync(__dirname + '/files/es6-module.js'); - -test('es6-module', function (t) { - t.plan(1); - t.deepEqual(detective(src, {parse: {sourceType: 'module'}}), [ 'a', 'b' ]); -}); diff --git a/node_modules/detective/test/files/both.js b/node_modules/detective/test/files/both.js deleted file mode 100644 index 74bc521f5..000000000 --- a/node_modules/detective/test/files/both.js +++ /dev/null @@ -1,4 +0,0 @@ -require('a'); -require('b'); -require('c' + x); -var moo = require('d' + y).moo; diff --git a/node_modules/detective/test/files/chained.js b/node_modules/detective/test/files/chained.js deleted file mode 100644 index 63437cc1c..000000000 --- a/node_modules/detective/test/files/chained.js +++ /dev/null @@ -1,5 +0,0 @@ - - -require('c').hello().goodbye() -require('b').hello() -require('a') diff --git a/node_modules/detective/test/files/es6-module.js b/node_modules/detective/test/files/es6-module.js deleted file mode 100644 index e05c1a0be..000000000 --- a/node_modules/detective/test/files/es6-module.js +++ /dev/null @@ -1,5 +0,0 @@ -var a = require('a'); - -export default function () { - var b = require('b'); -} diff --git a/node_modules/detective/test/files/generators.js b/node_modules/detective/test/files/generators.js deleted file mode 100644 index 1c1c2c9aa..000000000 --- a/node_modules/detective/test/files/generators.js +++ /dev/null @@ -1,5 +0,0 @@ -var a = require('a'); - -function *gen() { - yield require('b'); -} \ No newline at end of file diff --git a/node_modules/detective/test/files/isrequire.js b/node_modules/detective/test/files/isrequire.js deleted file mode 100644 index 442100289..000000000 --- a/node_modules/detective/test/files/isrequire.js +++ /dev/null @@ -1,14 +0,0 @@ -var a = require.async('a'); -var b = require.async('b'); -var c = require.async('c'); -var abc = a.b(c); - -var EventEmitter = require.async('events').EventEmitter; - -var x = require.async('doom')(5,6,7); -x(8,9); -c.load('notthis'); -var y = require.async('y') * 100; - -var EventEmitter2 = require.async('events2').EventEmitter(); - diff --git a/node_modules/detective/test/files/nested.js b/node_modules/detective/test/files/nested.js deleted file mode 100644 index 646cf1335..000000000 --- a/node_modules/detective/test/files/nested.js +++ /dev/null @@ -1,22 +0,0 @@ - -if (true) { - (function () { - require('a'); - })(); -} -if (false) { - (function () { - var x = 10; - switch (x) { - case 1 : require('b'); break; - default : break; - } - })() -} - -function qqq () { - require - ( - "c" - ); -} diff --git a/node_modules/detective/test/files/rest-spread.js b/node_modules/detective/test/files/rest-spread.js deleted file mode 100644 index de764cee1..000000000 --- a/node_modules/detective/test/files/rest-spread.js +++ /dev/null @@ -1,9 +0,0 @@ -var a = require('a'); -var b = require('b'); -var c = require('c'); - - -var obj = { foo: 'bar', bee: 'bop' } -var spread = { ...obj } -var { foo, ...rest } = obj - diff --git a/node_modules/detective/test/files/set-in-object-pattern.js b/node_modules/detective/test/files/set-in-object-pattern.js deleted file mode 100644 index fa507b05a..000000000 --- a/node_modules/detective/test/files/set-in-object-pattern.js +++ /dev/null @@ -1,10 +0,0 @@ -var a = load('a'); -var b = load('b'); -var c = load('c'); -var abc = a.b(c); - -function load2({set = 'hello'}) { - return load('tt'); -} - -var loadUse = load2(); diff --git a/node_modules/detective/test/files/shebang.js b/node_modules/detective/test/files/shebang.js deleted file mode 100644 index 96d2cfcee..000000000 --- a/node_modules/detective/test/files/shebang.js +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env node - -var a = require('a'); -var b = require('b'); -var c = require('c'); diff --git a/node_modules/detective/test/files/sparse-array.js b/node_modules/detective/test/files/sparse-array.js deleted file mode 100644 index fa0d23cf1..000000000 --- a/node_modules/detective/test/files/sparse-array.js +++ /dev/null @@ -1,3 +0,0 @@ -var o = [,,,,] - -require('./foo') diff --git a/node_modules/detective/test/files/strings.js b/node_modules/detective/test/files/strings.js deleted file mode 100644 index 1ed9381cf..000000000 --- a/node_modules/detective/test/files/strings.js +++ /dev/null @@ -1,13 +0,0 @@ -var a = require('a'); -var b = require('b'); -var c = require('c'); -var abc = a.b(c); - -var EventEmitter = require('events').EventEmitter; - -var x = require('doom')(5,6,7); -x(8,9); -c.require('notthis'); -var y = require('y') * 100; - -var EventEmitter2 = require('events2').EventEmitter(); \ No newline at end of file diff --git a/node_modules/detective/test/files/word.js b/node_modules/detective/test/files/word.js deleted file mode 100644 index fd074fe75..000000000 --- a/node_modules/detective/test/files/word.js +++ /dev/null @@ -1,13 +0,0 @@ -var a = load('a'); -var b = load('b'); -var c = load('c'); -var abc = a.b(c); - -var EventEmitter = load('events').EventEmitter; - -var x = load('doom')(5,6,7); -x(8,9); -c.load('notthis'); -var y = load('y') * 100; - -var EventEmitter2 = load('events2').EventEmitter(); diff --git a/node_modules/detective/test/files/yield.js b/node_modules/detective/test/files/yield.js deleted file mode 100644 index 36bd2b93b..000000000 --- a/node_modules/detective/test/files/yield.js +++ /dev/null @@ -1,4 +0,0 @@ -(function * () { - var a = require('a'); - var b = yield require('c')(a); -})(); diff --git a/node_modules/detective/test/generators.js b/node_modules/detective/test/generators.js deleted file mode 100644 index c16d53466..000000000 --- a/node_modules/detective/test/generators.js +++ /dev/null @@ -1,9 +0,0 @@ -var test = require('tap').test; -var detective = require('../'); -var fs = require('fs'); -var src = fs.readFileSync(__dirname + '/files/generators.js'); - -test('generators', function (t) { - t.plan(1); - t.deepEqual(detective(src), [ 'a', 'b' ]); -}); diff --git a/node_modules/detective/test/isrequire.js b/node_modules/detective/test/isrequire.js deleted file mode 100644 index aa2ce361c..000000000 --- a/node_modules/detective/test/isrequire.js +++ /dev/null @@ -1,20 +0,0 @@ -var test = require('tap').test; -var detective = require('../'); -var fs = require('fs'); -var src = fs.readFileSync(__dirname + '/files/isrequire.js'); - -test('word', function (t) { - t.deepEqual( - detective(src, { isRequire: function(node) { - return (node.type === 'CallExpression' && - node.callee.type === 'MemberExpression' && - node.callee.object.type == 'Identifier' && - node.callee.object.name == 'require' && - node.callee.property.type == 'Identifier' && - node.callee.property.name == 'async') - } }), - [ 'a', 'b', 'c', 'events', 'doom', 'y', 'events2' ] - ); - t.end(); -}); - diff --git a/node_modules/detective/test/nested.js b/node_modules/detective/test/nested.js deleted file mode 100644 index d688c0f80..000000000 --- a/node_modules/detective/test/nested.js +++ /dev/null @@ -1,9 +0,0 @@ -var test = require('tap').test; -var detective = require('../'); -var fs = require('fs'); -var src = fs.readFileSync(__dirname + '/files/nested.js'); - -test('nested', function (t) { - t.deepEqual(detective(src), [ 'a', 'b', 'c' ]); - t.end(); -}); diff --git a/node_modules/detective/test/noargs.js b/node_modules/detective/test/noargs.js deleted file mode 100644 index 4871b60be..000000000 --- a/node_modules/detective/test/noargs.js +++ /dev/null @@ -1,26 +0,0 @@ -var test = require('tap').test; -var detective = require('../'); -var fs = require('fs'); - -// in order to use detective to find any function -// it needs to properly handle functions called without args -var src = [ 'fn();', 'otherfn();', 'fn();' ].join('\n') - -test('noargs', function (t) { - t.plan(1); - t.deepEqual(detective(src, { word: 'fn' }).length, 0, 'finds no arg id'); -}); - -test('find noargs with nodes', function (t) { - t.plan(4); - var modules = detective.find(src, { word: 'fn', nodes: true }); - t.equal(modules.strings.length, 0, 'finds no arg id'); - t.equal(modules.expressions.length, 0, 'finds no expressions'); - t.equal(modules.nodes.length, 2, 'finds a node for each matching function call'); - t.equal( - modules.nodes.filter(function (x) { - return x.callee.name === 'fn' - }).length, 2, - 'all matches are correct' - ); -}); diff --git a/node_modules/detective/test/parseopts.js b/node_modules/detective/test/parseopts.js deleted file mode 100644 index ec0da81d5..000000000 --- a/node_modules/detective/test/parseopts.js +++ /dev/null @@ -1,62 +0,0 @@ -var test = require('tap').test; -var detective = require('../'); -var fs = require('fs'); -var src = fs.readFileSync(__dirname + '/files/both.js'); - -test('nodes specified in opts and parseopts { range: true }', function (t) { - var modules = detective.find(src, { nodes: true, parse: { range: true } }); - t.deepEqual(modules.strings, [ 'a', 'b' ]); - t.deepEqual(modules.expressions, [ "'c' + x", "'d' + y" ]); - t.deepEqual( - modules.nodes.map(function (n) { - var arg = n.arguments[0]; - return arg.value || arg.left.value; - }), - [ 'a', 'b', 'c', 'd' ], - 'has a node for each require'); - - var range = modules.nodes[0].range; - t.equal(range[0], 0, 'includes range start'); - t.equal(range[1], 12, 'includes range end'); - t.end(); -}); - -test('nodes specified in opts and parseopts { range: false }', function (t) { - var modules = detective.find(src, { nodes: true, parse: { range: false } }); - t.deepEqual(modules.strings, [ 'a', 'b' ]); - t.deepEqual(modules.expressions, [ "'c' + x", "'d' + y" ]); - t.deepEqual( - modules.nodes.map(function (n) { - var arg = n.arguments[0]; - return arg.value || arg.left.value; - }), - [ 'a', 'b', 'c', 'd' ], - 'has a node for each require'); - - t.notOk(modules.nodes[0].range, 'includes no ranges'); - t.end(); -}); - -test('nodes specified in opts and parseopts { range: true, loc: true }', function (t) { - var modules = detective.find(src, { nodes: true, parse: { range: true, loc: true } }); - t.deepEqual(modules.strings, [ 'a', 'b' ]); - t.deepEqual(modules.expressions, [ "'c' + x", "'d' + y" ]); - t.deepEqual( - modules.nodes.map(function (n) { - var arg = n.arguments[0]; - return arg.value || arg.left.value; - }), - [ 'a', 'b', 'c', 'd' ], - 'has a node for each require'); - - var range = modules.nodes[0].range; - t.equal(range[0], 0, 'includes range start'); - t.equal(range[1], 12, 'includes range end'); - - var loc = modules.nodes[0].loc; - t.equal(loc.start.line, 1, 'includes start line'); - t.equal(loc.start.column, 0, 'includes start column'); - t.equal(loc.end.line, 1, 'includes end line'); - t.equal(loc.end.column, 12, 'includes end column'); - t.end(); -}); diff --git a/node_modules/detective/test/rest-spread.js b/node_modules/detective/test/rest-spread.js deleted file mode 100644 index 5da31e708..000000000 --- a/node_modules/detective/test/rest-spread.js +++ /dev/null @@ -1,9 +0,0 @@ -var test = require('tap').test; -var detective = require('../'); -var fs = require('fs'); -var src = fs.readFileSync(__dirname + '/files/rest-spread.js'); - -test('rest-spread', function (t) { - t.doesNotThrow(detective.bind(detective, src), 'Files with rest or spread do not throw') - t.end(); -}); diff --git a/node_modules/detective/test/return.js b/node_modules/detective/test/return.js deleted file mode 100644 index c2da016bb..000000000 --- a/node_modules/detective/test/return.js +++ /dev/null @@ -1,9 +0,0 @@ -var test = require('tap').test; -var detective = require('../'); -var fs = require('fs'); -var src = [ 'require("a")\nreturn' ]; - -test('return', function (t) { - t.plan(1); - t.deepEqual(detective(src), [ 'a' ]); -}); diff --git a/node_modules/detective/test/set-in-object-pattern.js b/node_modules/detective/test/set-in-object-pattern.js deleted file mode 100644 index 4787b1edb..000000000 --- a/node_modules/detective/test/set-in-object-pattern.js +++ /dev/null @@ -1,12 +0,0 @@ -var test = require('tap').test; -var detective = require('../'); -var fs = require('fs'); -var src = fs.readFileSync(__dirname + '/files/set-in-object-pattern.js'); - -test('set in object pattern', function (t) { - t.deepEqual( - detective(src, { word : 'load' }), - [ 'a', 'b', 'c', 'tt' ] - ); - t.end(); -}); \ No newline at end of file diff --git a/node_modules/detective/test/shebang.js b/node_modules/detective/test/shebang.js deleted file mode 100644 index b662ea241..000000000 --- a/node_modules/detective/test/shebang.js +++ /dev/null @@ -1,9 +0,0 @@ -var test = require('tap').test; -var detective = require('../'); -var fs = require('fs'); -var src = fs.readFileSync(__dirname + '/files/shebang.js'); - -test('shebang', function (t) { - t.plan(1); - t.deepEqual(detective(src), [ 'a', 'b', 'c' ]); -}); diff --git a/node_modules/detective/test/sparse-array.js b/node_modules/detective/test/sparse-array.js deleted file mode 100644 index f64f3593c..000000000 --- a/node_modules/detective/test/sparse-array.js +++ /dev/null @@ -1,14 +0,0 @@ -var test = require('tap').test; -var detective = require('../'); -var fs = require('fs'); -var src = fs.readFileSync(__dirname + '/files/sparse-array.js'); - -test('sparse-array', function (t) { - //just check that this does not crash. - t.doesNotThrow(function () { - detective(src) - }) - t.end(); -}); - - diff --git a/node_modules/detective/test/strings.js b/node_modules/detective/test/strings.js deleted file mode 100644 index 3b5e7d821..000000000 --- a/node_modules/detective/test/strings.js +++ /dev/null @@ -1,9 +0,0 @@ -var test = require('tap').test; -var detective = require('../'); -var fs = require('fs'); -var src = fs.readFileSync(__dirname + '/files/strings.js'); - -test('single', function (t) { - t.deepEqual(detective(src), [ 'a', 'b', 'c', 'events', 'doom', 'y', 'events2' ]); - t.end(); -}); diff --git a/node_modules/detective/test/word.js b/node_modules/detective/test/word.js deleted file mode 100644 index cf5397d85..000000000 --- a/node_modules/detective/test/word.js +++ /dev/null @@ -1,12 +0,0 @@ -var test = require('tap').test; -var detective = require('../'); -var fs = require('fs'); -var src = fs.readFileSync(__dirname + '/files/word.js'); - -test('word', function (t) { - t.deepEqual( - detective(src, { word : 'load' }), - [ 'a', 'b', 'c', 'events', 'doom', 'y', 'events2' ] - ); - t.end(); -}); diff --git a/node_modules/detective/test/yield.js b/node_modules/detective/test/yield.js deleted file mode 100644 index 85560ab7a..000000000 --- a/node_modules/detective/test/yield.js +++ /dev/null @@ -1,9 +0,0 @@ -var test = require('tap').test; -var detective = require('../'); -var fs = require('fs'); -var src = fs.readFileSync(__dirname + '/files/yield.js'); - -test('yield', function (t) { - t.plan(1); - t.deepEqual(detective(src), [ 'a', 'c' ]); -}); diff --git a/node_modules/diffie-hellman/.travis.yml b/node_modules/diffie-hellman/.travis.yml deleted file mode 100644 index 0dda27315..000000000 --- a/node_modules/diffie-hellman/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: node_js -node_js: - - "0.11" - - "0.10" - - "0.12" - - "1" - - "2" - - "3" - - "4" -sudo: false diff --git a/node_modules/diffie-hellman/LICENSE b/node_modules/diffie-hellman/LICENSE deleted file mode 100644 index c9ddc0feb..000000000 --- a/node_modules/diffie-hellman/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2017 Calvin Metcalf - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/diffie-hellman/browser.js b/node_modules/diffie-hellman/browser.js deleted file mode 100644 index d4be92bb6..000000000 --- a/node_modules/diffie-hellman/browser.js +++ /dev/null @@ -1,42 +0,0 @@ -var generatePrime = require('./lib/generatePrime') -var primes = require('./lib/primes.json') - -var DH = require('./lib/dh') - -function getDiffieHellman (mod) { - var prime = new Buffer(primes[mod].prime, 'hex') - var gen = new Buffer(primes[mod].gen, 'hex') - - return new DH(prime, gen) -} - -var ENCODINGS = { - 'binary': true, 'hex': true, 'base64': true -} - -function createDiffieHellman (prime, enc, generator, genc) { - if (Buffer.isBuffer(enc) || ENCODINGS[enc] === undefined) { - return createDiffieHellman(prime, 'binary', enc, generator) - } - - enc = enc || 'binary' - genc = genc || 'binary' - generator = generator || new Buffer([2]) - - if (!Buffer.isBuffer(generator)) { - generator = new Buffer(generator, genc) - } - - if (typeof prime === 'number') { - return new DH(generatePrime(prime, generator), generator, true) - } - - if (!Buffer.isBuffer(prime)) { - prime = new Buffer(prime, enc) - } - - return new DH(prime, generator, true) -} - -exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman -exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman diff --git a/node_modules/diffie-hellman/index.js b/node_modules/diffie-hellman/index.js deleted file mode 100644 index ab7c40fec..000000000 --- a/node_modules/diffie-hellman/index.js +++ /dev/null @@ -1,10 +0,0 @@ -var crypto = require('crypto') - -// getDiffieHellman -exports.DiffieHellmanGroup = crypto.DiffieHellmanGroup -exports.createDiffieHellmanGroup = crypto.createDiffieHellmanGroup -exports.getDiffieHellman = crypto.getDiffieHellman - -// createDiffieHellman -exports.createDiffieHellman = crypto.createDiffieHellman -exports.DiffieHellman = crypto.DiffieHellman diff --git a/node_modules/diffie-hellman/lib/dh.js b/node_modules/diffie-hellman/lib/dh.js deleted file mode 100644 index 0650f65d4..000000000 --- a/node_modules/diffie-hellman/lib/dh.js +++ /dev/null @@ -1,164 +0,0 @@ -var BN = require('bn.js'); -var MillerRabin = require('miller-rabin'); -var millerRabin = new MillerRabin(); -var TWENTYFOUR = new BN(24); -var ELEVEN = new BN(11); -var TEN = new BN(10); -var THREE = new BN(3); -var SEVEN = new BN(7); -var primes = require('./generatePrime'); -var randomBytes = require('randombytes'); -module.exports = DH; - -function setPublicKey(pub, enc) { - enc = enc || 'utf8'; - if (!Buffer.isBuffer(pub)) { - pub = new Buffer(pub, enc); - } - this._pub = new BN(pub); - return this; -} - -function setPrivateKey(priv, enc) { - enc = enc || 'utf8'; - if (!Buffer.isBuffer(priv)) { - priv = new Buffer(priv, enc); - } - this._priv = new BN(priv); - return this; -} - -var primeCache = {}; -function checkPrime(prime, generator) { - var gen = generator.toString('hex'); - var hex = [gen, prime.toString(16)].join('_'); - if (hex in primeCache) { - return primeCache[hex]; - } - var error = 0; - - if (prime.isEven() || - !primes.simpleSieve || - !primes.fermatTest(prime) || - !millerRabin.test(prime)) { - //not a prime so +1 - error += 1; - - if (gen === '02' || gen === '05') { - // we'd be able to check the generator - // it would fail so +8 - error += 8; - } else { - //we wouldn't be able to test the generator - // so +4 - error += 4; - } - primeCache[hex] = error; - return error; - } - if (!millerRabin.test(prime.shrn(1))) { - //not a safe prime - error += 2; - } - var rem; - switch (gen) { - case '02': - if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) { - // unsuidable generator - error += 8; - } - break; - case '05': - rem = prime.mod(TEN); - if (rem.cmp(THREE) && rem.cmp(SEVEN)) { - // prime mod 10 needs to equal 3 or 7 - error += 8; - } - break; - default: - error += 4; - } - primeCache[hex] = error; - return error; -} - -function DH(prime, generator, malleable) { - this.setGenerator(generator); - this.__prime = new BN(prime); - this._prime = BN.mont(this.__prime); - this._primeLen = prime.length; - this._pub = undefined; - this._priv = undefined; - this._primeCode = undefined; - if (malleable) { - this.setPublicKey = setPublicKey; - this.setPrivateKey = setPrivateKey; - } else { - this._primeCode = 8; - } -} -Object.defineProperty(DH.prototype, 'verifyError', { - enumerable: true, - get: function () { - if (typeof this._primeCode !== 'number') { - this._primeCode = checkPrime(this.__prime, this.__gen); - } - return this._primeCode; - } -}); -DH.prototype.generateKeys = function () { - if (!this._priv) { - this._priv = new BN(randomBytes(this._primeLen)); - } - this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed(); - return this.getPublicKey(); -}; - -DH.prototype.computeSecret = function (other) { - other = new BN(other); - other = other.toRed(this._prime); - var secret = other.redPow(this._priv).fromRed(); - var out = new Buffer(secret.toArray()); - var prime = this.getPrime(); - if (out.length < prime.length) { - var front = new Buffer(prime.length - out.length); - front.fill(0); - out = Buffer.concat([front, out]); - } - return out; -}; - -DH.prototype.getPublicKey = function getPublicKey(enc) { - return formatReturnValue(this._pub, enc); -}; - -DH.prototype.getPrivateKey = function getPrivateKey(enc) { - return formatReturnValue(this._priv, enc); -}; - -DH.prototype.getPrime = function (enc) { - return formatReturnValue(this.__prime, enc); -}; - -DH.prototype.getGenerator = function (enc) { - return formatReturnValue(this._gen, enc); -}; - -DH.prototype.setGenerator = function (gen, enc) { - enc = enc || 'utf8'; - if (!Buffer.isBuffer(gen)) { - gen = new Buffer(gen, enc); - } - this.__gen = gen; - this._gen = new BN(gen); - return this; -}; - -function formatReturnValue(bn, enc) { - var buf = new Buffer(bn.toArray()); - if (!enc) { - return buf; - } else { - return buf.toString(enc); - } -} diff --git a/node_modules/diffie-hellman/lib/generatePrime.js b/node_modules/diffie-hellman/lib/generatePrime.js deleted file mode 100644 index 32e053cf3..000000000 --- a/node_modules/diffie-hellman/lib/generatePrime.js +++ /dev/null @@ -1,105 +0,0 @@ -var randomBytes = require('randombytes'); -module.exports = findPrime; -findPrime.simpleSieve = simpleSieve; -findPrime.fermatTest = fermatTest; -var BN = require('bn.js'); -var TWENTYFOUR = new BN(24); -var MillerRabin = require('miller-rabin'); -var millerRabin = new MillerRabin(); -var ONE = new BN(1); -var TWO = new BN(2); -var FIVE = new BN(5); -var SIXTEEN = new BN(16); -var EIGHT = new BN(8); -var TEN = new BN(10); -var THREE = new BN(3); -var SEVEN = new BN(7); -var ELEVEN = new BN(11); -var FOUR = new BN(4); -var TWELVE = new BN(12); -var primes = null; - -function _getPrimes() { - if (primes !== null) - return primes; - - var limit = 0x100000; - var res = []; - res[0] = 2; - for (var i = 1, k = 3; k < limit; k += 2) { - var sqrt = Math.ceil(Math.sqrt(k)); - for (var j = 0; j < i && res[j] <= sqrt; j++) - if (k % res[j] === 0) - break; - - if (i !== j && res[j] <= sqrt) - continue; - - res[i++] = k; - } - primes = res; - return res; -} - -function simpleSieve(p) { - var primes = _getPrimes(); - - for (var i = 0; i < primes.length; i++) - if (p.modn(primes[i]) === 0) { - if (p.cmpn(primes[i]) === 0) { - return true; - } else { - return false; - } - } - - return true; -} - -function fermatTest(p) { - var red = BN.mont(p); - return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0; -} - -function findPrime(bits, gen) { - if (bits < 16) { - // this is what openssl does - if (gen === 2 || gen === 5) { - return new BN([0x8c, 0x7b]); - } else { - return new BN([0x8c, 0x27]); - } - } - gen = new BN(gen); - - var num, n2; - - while (true) { - num = new BN(randomBytes(Math.ceil(bits / 8))); - while (num.bitLength() > bits) { - num.ishrn(1); - } - if (num.isEven()) { - num.iadd(ONE); - } - if (!num.testn(1)) { - num.iadd(TWO); - } - if (!gen.cmp(TWO)) { - while (num.mod(TWENTYFOUR).cmp(ELEVEN)) { - num.iadd(FOUR); - } - } else if (!gen.cmp(FIVE)) { - while (num.mod(TEN).cmp(THREE)) { - num.iadd(FOUR); - } - } - n2 = num.shrn(1); - if (simpleSieve(n2) && simpleSieve(num) && - fermatTest(n2) && fermatTest(num) && - millerRabin.test(n2) && millerRabin.test(num)) { - return num; - } - } - -} diff --git a/node_modules/diffie-hellman/lib/primes.json b/node_modules/diffie-hellman/lib/primes.json deleted file mode 100644 index 9fef6c961..000000000 --- a/node_modules/diffie-hellman/lib/primes.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "modp1": { - "gen": "02", - "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff" - }, - "modp2": { - "gen": "02", - "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff" - }, - "modp5": { - "gen": "02", - "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff" - }, - "modp14": { - "gen": "02", - "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff" - }, - "modp15": { - "gen": "02", - "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff" - }, - "modp16": { - "gen": "02", - "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff" - }, - "modp17": { - "gen": "02", - "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff" - }, - "modp18": { - "gen": "02", - "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff" - } -} \ No newline at end of file diff --git a/node_modules/diffie-hellman/package.json b/node_modules/diffie-hellman/package.json deleted file mode 100644 index 187444b96..000000000 --- a/node_modules/diffie-hellman/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_from": "diffie-hellman@^5.0.0", - "_id": "diffie-hellman@5.0.3", - "_inBundle": false, - "_integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "_location": "/diffie-hellman", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "diffie-hellman@^5.0.0", - "name": "diffie-hellman", - "escapedName": "diffie-hellman", - "rawSpec": "^5.0.0", - "saveSpec": null, - "fetchSpec": "^5.0.0" - }, - "_requiredBy": [ - "/crypto-browserify" - ], - "_resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "_shasum": "40e8ee98f55a2149607146921c63e1ae5f3d2875", - "_spec": "diffie-hellman@^5.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/crypto-browserify", - "author": { - "name": "Calvin Metcalf" - }, - "browser": "browser.js", - "bugs": { - "url": "https://github.com/crypto-browserify/diffie-hellman/issues" - }, - "bundleDependencies": false, - "dependencies": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - }, - "deprecated": false, - "description": "pure js diffie-hellman", - "devDependencies": { - "tap-spec": "^1.0.1", - "tape": "^3.0.1" - }, - "homepage": "https://github.com/crypto-browserify/diffie-hellman", - "keywords": [ - "diffie", - "hellman", - "diffiehellman", - "dh" - ], - "license": "MIT", - "main": "index.js", - "name": "diffie-hellman", - "repository": { - "type": "git", - "url": "git+https://github.com/crypto-browserify/diffie-hellman.git" - }, - "scripts": { - "test": "node test.js | tspec" - }, - "version": "5.0.3" -} diff --git a/node_modules/diffie-hellman/readme.md b/node_modules/diffie-hellman/readme.md deleted file mode 100644 index afba499d9..000000000 --- a/node_modules/diffie-hellman/readme.md +++ /dev/null @@ -1,4 +0,0 @@ -diffie hellman [![Build Status](https://travis-ci.org/crypto-browserify/diffie-hellman.svg)](https://travis-ci.org/crypto-browserify/diffie-hellman) -==== - -pure js diffie-hellman, same api as node, most hard parts thanks to [bn.js](https://www.npmjs.org/package/bn.js) by [@indutny](https://github.com/indutny). In node just returns an object with `crypto.createDiffieHellman` and `crypto.getDiffieHellman` in the browser returns a shim. To require the pure JavaScript one in node `require('diffie-hellman/browser');`; \ No newline at end of file diff --git a/node_modules/domain-browser/HISTORY.md b/node_modules/domain-browser/HISTORY.md deleted file mode 100644 index b4a285d45..000000000 --- a/node_modules/domain-browser/HISTORY.md +++ /dev/null @@ -1,46 +0,0 @@ -# History - -## v1.2.0 2018 January 26 -- `index.js` is now located at `source/index.js` -- Updated base files - -## v1.1.7 2015 December 12 -- Revert minimum node version from 0.12 back to 0.4 - - Thanks to [Alexander Sorokin](https://github.com/syrnick) for [this comment](https://github.com/bevry/domain-browser/commit/c66ee3445e87955e70d0d60d4515f2d26a81b9c4#commitcomment-14938325) - -## v1.1.6 2015 December 12 -- Fixed `assert-helpers` sneaking into `dependencies` - - Thanks to [Bogdan Chadkin](https://github.com/TrySound) for [Pull Request #8](https://github.com/bevry/domain-browser/pull/8) - -## v1.1.5 2015 December 9 -- Updated internal conventions -- Added better jspm support - - Thanks to [Guy Bedford](https://github.com/guybedford) for [Pull Request #7](https://github.com/bevry/domain-browser/pull/7) - -## v1.1.4 2015 February 3 -- Added - - `domain.enter()` - - `domain.exit()` - - `domain.bind()` - - `domain.intercept()` - -## v1.1.3 2014 October 10 -- Added - - `domain.add()` - - `domain.remove()` - -## v1.1.2 2014 June 8 -- Added `domain.createDomain()` alias - - Thanks to [James Halliday](https://github.com/substack) for [Pull Request #1](https://github.com/bevry/domain-browser/pull/1) - -## v1.1.1 2013 December 27 -- Fixed `domain.create()` not returning anything - -## v1.1.0 2013 November 1 -- Dropped component.io and bower support, just use ender or browserify - -## v1.0.1 2013 September 18 -- Now called `domain-browser` everywhere - -## v1.0.0 2013 September 18 -- Initial release diff --git a/node_modules/domain-browser/LICENSE.md b/node_modules/domain-browser/LICENSE.md deleted file mode 100644 index 08d8802ab..000000000 --- a/node_modules/domain-browser/LICENSE.md +++ /dev/null @@ -1,23 +0,0 @@ - - -

    License

    - -Unless stated otherwise all works are: - - - -and licensed under: - - - -

    MIT License

    - -
    -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
    -
    -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
    -
    -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    -
    - - diff --git a/node_modules/domain-browser/README.md b/node_modules/domain-browser/README.md deleted file mode 100644 index 68c936bb4..000000000 --- a/node_modules/domain-browser/README.md +++ /dev/null @@ -1,121 +0,0 @@ - - -

    domain-browser

    - - - - - - -Travis CI Build Status -NPM version -NPM downloads -Dependency Status -Dev Dependency Status -
    -Patreon donate button -Open Collective donate button -Gratipay donate button -Flattr donate button -PayPal donate button -Bitcoin donate button -Wishlist browse button -
    -Slack community badge - - - - - - -Node's domain module for the web browser. This is merely an evented try...catch with the same API as node, nothing more. - - - - - - -

    Install

    - -

    NPM

      -
    • Install: npm install --save domain-browser
    • -
    • Module: require('domain-browser')
    - -

    Browserify

      -
    • Install: npm install --save domain-browser
    • -
    • Module: require('domain-browser')
    • -
    • CDN URL: //wzrd.in/bundle/domain-browser@1.2.0
    - -

    Ender

      -
    • Install: ender add domain-browser
    • -
    • Module: require('domain-browser')
    - -

    Editions

    - -

    This package is published with the following editions:

    - -
    • domain-browser aliases domain-browser/source/index.js
    • -
    • domain-browser/source/index.js is Source + ES5 + Require
    - - - - - - -

    History

    - -Discover the release history by heading on over to the HISTORY.md file. - - - - - - -

    Backers

    - -

    Maintainers

    - -These amazing people are maintaining this project: - - - -

    Sponsors

    - -No sponsors yet! Will you be the first? - -Patreon donate button -Open Collective donate button -Gratipay donate button -Flattr donate button -PayPal donate button -Bitcoin donate button -Wishlist browse button - -

    Contributors

    - -These amazing people have contributed code to this project: - - - -Discover how you can contribute by heading on over to the CONTRIBUTING.md file. - - - - - - -

    License

    - -Unless stated otherwise all works are: - - - -and licensed under: - - - - diff --git a/node_modules/domain-browser/package.json b/node_modules/domain-browser/package.json deleted file mode 100644 index 560677337..000000000 --- a/node_modules/domain-browser/package.json +++ /dev/null @@ -1,172 +0,0 @@ -{ - "_from": "domain-browser@^1.2.0", - "_id": "domain-browser@1.2.0", - "_inBundle": false, - "_integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", - "_location": "/domain-browser", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "domain-browser@^1.2.0", - "name": "domain-browser", - "escapedName": "domain-browser", - "rawSpec": "^1.2.0", - "saveSpec": null, - "fetchSpec": "^1.2.0" - }, - "_requiredBy": [ - "/browserify" - ], - "_resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "_shasum": "3d31f50191a6749dd1375a7f522e823d42e54eda", - "_spec": "domain-browser@^1.2.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "2013+ Bevry Pty Ltd", - "email": "us@bevry.me", - "url": "http://bevry.me" - }, - "badges": { - "list": [ - "travisci", - "npmversion", - "npmdownloads", - "daviddm", - "daviddmdev", - "---", - "patreon", - "opencollective", - "gratipay", - "flattr", - "paypal", - "bitcoin", - "wishlist", - "---", - "slackin" - ], - "config": { - "patreonUsername": "bevry", - "opencollectiveUsername": "bevry", - "gratipayUsername": "bevry", - "flattrUsername": "balupton", - "paypalURL": "https://bevry.me/paypal", - "bitcoinURL": "https://bevry.me/bitcoin", - "wishlistURL": "https://bevry.me/wishlist", - "slackinURL": "https://slack.bevry.me" - } - }, - "browser": "source/index.js", - "bugs": { - "url": "https://github.com/bevry/domain-browser/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Benjamin Lupton", - "email": "b@lupton.cc", - "url": "http://balupton.com" - }, - { - "name": "Evan Solomon", - "url": "http://evansolomon.me" - }, - { - "name": "James Halliday", - "email": "substack@gmail.com", - "url": "http://substack.neocities.org/" - }, - { - "name": "Guy Bedford", - "email": "guybedford@gmail.com", - "url": "twitter.com/guybedford" - }, - { - "name": "Bogdan Chadkin", - "email": "trysound@yandex.ru", - "url": "https://github.com/TrySound" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "Node's domain module for the web browser. This is merely an evented try...catch with the same API as node, nothing more.", - "devDependencies": { - "assert-helpers": "^4.5.0", - "eslint": "^4.16.0", - "joe": "^2.0.2", - "joe-reporter-console": "^2.0.1", - "projectz": "^1.4.0" - }, - "editions": [ - { - "description": "Source + ES5 + Require", - "directory": "source", - "entry": "index.js", - "syntaxes": [ - "javascript", - "es5", - "require" - ] - } - ], - "engines": { - "node": ">=0.4", - "npm": ">=1.2" - }, - "homepage": "https://github.com/bevry/domain-browser", - "jspm": { - "map": { - "source/index.js": { - "node": "@node/domain" - } - } - }, - "keywords": [ - "domain", - "trycatch", - "try", - "catch", - "node-compat", - "ender.js", - "component", - "component.io", - "umd", - "amd", - "require.js", - "browser" - ], - "license": "MIT", - "main": "source/index.js", - "maintainers": [ - { - "name": "Benjamin Lupton", - "email": "b@lupton.cc", - "url": "http://balupton.com" - } - ], - "name": "domain-browser", - "repository": { - "type": "git", - "url": "git+https://github.com/bevry/domain-browser.git" - }, - "scripts": { - "our:clean": "rm -Rf ./docs ./es2015 ./es5 ./out", - "our:compile": "echo no need for this project", - "our:meta": "npm run our:meta:projectz", - "our:meta:projectz": "projectz compile", - "our:release": "npm run our:release:prepare && npm run our:release:check && npm run our:release:tag && npm run our:release:push", - "our:release:check": "npm run our:release:check:changelog && npm run our:release:check:dirty", - "our:release:check:changelog": "cat ./HISTORY.md | grep v$npm_package_version || (echo add a changelog entry for v$npm_package_version && exit -1)", - "our:release:check:dirty": "git diff --exit-code", - "our:release:prepare": "npm run our:clean && npm run our:compile && npm run our:test && npm run our:meta", - "our:release:push": "git push origin master && git push origin --tags", - "our:release:tag": "export MESSAGE=$(cat ./HISTORY.md | sed -n \"/## v$npm_package_version/,/##/p\" | sed 's/## //' | awk 'NR>1{print buf}{buf = $0}') && test \"$MESSAGE\" || (echo 'proper changelog entry not found' && exit -1) && git tag v$npm_package_version -am \"$MESSAGE\"", - "our:setup": "npm run our:setup:npm", - "our:setup:npm": "npm install", - "our:test": "npm run our:verify && npm test", - "our:verify": "npm run our:verify:eslint", - "our:verify:eslint": "eslint --fix ./source", - "test": "node --harmony source/test.js --joe-reporter=console" - }, - "version": "1.2.0" -} diff --git a/node_modules/domain-browser/source/index.js b/node_modules/domain-browser/source/index.js deleted file mode 100644 index e06b3a175..000000000 --- a/node_modules/domain-browser/source/index.js +++ /dev/null @@ -1,70 +0,0 @@ -// This file should be ES5 compatible -/* eslint prefer-spread:0, no-var:0, prefer-reflect:0, no-magic-numbers:0 */ -'use strict' - -module.exports = (function () { - // Import Events - var events = require('events') - - // Export Domain - var domain = {} - domain.createDomain = domain.create = function () { - var d = new events.EventEmitter() - - function emitError (e) { - d.emit('error', e) - } - - d.add = function (emitter) { - emitter.on('error', emitError) - } - d.remove = function (emitter) { - emitter.removeListener('error', emitError) - } - d.bind = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments) - try { - fn.apply(null, args) - } - catch (err) { - emitError(err) - } - } - } - d.intercept = function (fn) { - return function (err) { - if ( err ) { - emitError(err) - } - else { - var args = Array.prototype.slice.call(arguments, 1) - try { - fn.apply(null, args) - } - catch (err) { - emitError(err) - } - } - } - } - d.run = function (fn) { - try { - fn() - } - catch (err) { - emitError(err) - } - return this - } - d.dispose = function () { - this.removeAllListeners() - return this - } - d.enter = d.exit = function () { - return this - } - return d - } - return domain -}).call(this) diff --git a/node_modules/duplexer2/LICENSE.md b/node_modules/duplexer2/LICENSE.md deleted file mode 100644 index 547189a6a..000000000 --- a/node_modules/duplexer2/LICENSE.md +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2013, Deoxxa Development -====================================== -All rights reserved. --------------------- - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. 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. -3. Neither the name of Deoxxa Development 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 DEOXXA DEVELOPMENT ''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 DEOXXA DEVELOPMENT 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. diff --git a/node_modules/duplexer2/README.md b/node_modules/duplexer2/README.md deleted file mode 100644 index f4a69573a..000000000 --- a/node_modules/duplexer2/README.md +++ /dev/null @@ -1,115 +0,0 @@ -# duplexer2 [![Build Status](https://travis-ci.org/deoxxa/duplexer2.svg?branch=master)](https://travis-ci.org/deoxxa/duplexer2) [![Coverage Status](https://coveralls.io/repos/deoxxa/duplexer2/badge.svg?branch=master&service=github)](https://coveralls.io/github/deoxxa/duplexer2?branch=master) - -Like [duplexer](https://github.com/Raynos/duplexer) but using Streams3 - -```javascript -var stream = require("stream"); - -var duplexer2 = require("duplexer2"); - -var writable = new stream.Writable({objectMode: true}), - readable = new stream.Readable({objectMode: true}); - -writable._write = function _write(input, encoding, done) { - if (readable.push(input)) { - return done(); - } else { - readable.once("drain", done); - } -}; - -readable._read = function _read(n) { - // no-op -}; - -// simulate the readable thing closing after a bit -writable.once("finish", function() { - setTimeout(function() { - readable.push(null); - }, 500); -}); - -var duplex = duplexer2(writable, readable); - -duplex.on("data", function(e) { - console.log("got data", JSON.stringify(e)); -}); - -duplex.on("finish", function() { - console.log("got finish event"); -}); - -duplex.on("end", function() { - console.log("got end event"); -}); - -duplex.write("oh, hi there", function() { - console.log("finished writing"); -}); - -duplex.end(function() { - console.log("finished ending"); -}); -``` - -``` -got data "oh, hi there" -finished writing -got finish event -finished ending -got end event -``` - -## Overview - -This is a reimplementation of [duplexer](https://www.npmjs.com/package/duplexer) using the -Streams3 API which is standard in Node as of v4. Everything largely -works the same. - - - -## Installation - -[Available via `npm`](https://docs.npmjs.com/cli/install): - -``` -$ npm i duplexer2 -``` - -## API - -### duplexer2 - -Creates a new `DuplexWrapper` object, which is the actual class that implements -most of the fun stuff. All that fun stuff is hidden. DON'T LOOK. - -```javascript -duplexer2([options], writable, readable) -``` - -```javascript -const duplex = duplexer2(new stream.Writable(), new stream.Readable()); -``` - -Arguments - -* __options__ - an object specifying the regular `stream.Duplex` options, as - well as the properties described below. -* __writable__ - a writable stream -* __readable__ - a readable stream - -Options - -* __bubbleErrors__ - a boolean value that specifies whether to bubble errors - from the underlying readable/writable streams. Default is `true`. - - -## License - -3-clause BSD. [A copy](./LICENSE) is included with the source. - -## Contact - -* GitHub ([deoxxa](http://github.com/deoxxa)) -* Twitter ([@deoxxa](http://twitter.com/deoxxa)) -* Email ([deoxxa@fknsrs.biz](mailto:deoxxa@fknsrs.biz)) diff --git a/node_modules/duplexer2/index.js b/node_modules/duplexer2/index.js deleted file mode 100644 index a40ece9ab..000000000 --- a/node_modules/duplexer2/index.js +++ /dev/null @@ -1,76 +0,0 @@ -"use strict"; - -var stream = require("readable-stream"); - -function DuplexWrapper(options, writable, readable) { - if (typeof readable === "undefined") { - readable = writable; - writable = options; - options = null; - } - - stream.Duplex.call(this, options); - - if (typeof readable.read !== "function") { - readable = (new stream.Readable(options)).wrap(readable); - } - - this._writable = writable; - this._readable = readable; - this._waiting = false; - - var self = this; - - writable.once("finish", function() { - self.end(); - }); - - this.once("finish", function() { - writable.end(); - }); - - readable.on("readable", function() { - if (self._waiting) { - self._waiting = false; - self._read(); - } - }); - - readable.once("end", function() { - self.push(null); - }); - - if (!options || typeof options.bubbleErrors === "undefined" || options.bubbleErrors) { - writable.on("error", function(err) { - self.emit("error", err); - }); - - readable.on("error", function(err) { - self.emit("error", err); - }); - } -} - -DuplexWrapper.prototype = Object.create(stream.Duplex.prototype, {constructor: {value: DuplexWrapper}}); - -DuplexWrapper.prototype._write = function _write(input, encoding, done) { - this._writable.write(input, encoding, done); -}; - -DuplexWrapper.prototype._read = function _read() { - var buf; - var reads = 0; - while ((buf = this._readable.read()) !== null) { - this.push(buf); - reads++; - } - if (reads === 0) { - this._waiting = true; - } -}; - -module.exports = function duplex2(options, writable, readable) { - return new DuplexWrapper(options, writable, readable); -}; - -module.exports.DuplexWrapper = DuplexWrapper; diff --git a/node_modules/duplexer2/package.json b/node_modules/duplexer2/package.json deleted file mode 100644 index 04e7cef5d..000000000 --- a/node_modules/duplexer2/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_from": "duplexer2@~0.1.2", - "_id": "duplexer2@0.1.4", - "_inBundle": false, - "_integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", - "_location": "/duplexer2", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "duplexer2@~0.1.2", - "name": "duplexer2", - "escapedName": "duplexer2", - "rawSpec": "~0.1.2", - "saveSpec": null, - "fetchSpec": "~0.1.2" - }, - "_requiredBy": [ - "/browserify", - "/module-deps", - "/stream-combiner2" - ], - "_resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "_shasum": "8b12dab878c0d69e3e7891051662a32fc6bddcc1", - "_spec": "duplexer2@~0.1.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "Conrad Pankoff", - "email": "deoxxa@fknsrs.biz", - "url": "http://www.fknsrs.biz/" - }, - "bugs": { - "url": "https://github.com/deoxxa/duplexer2/issues" - }, - "bundleDependencies": false, - "dependencies": { - "readable-stream": "^2.0.2" - }, - "deprecated": false, - "description": "Like duplexer but using streams3", - "devDependencies": { - "mocha": "^2.2.5" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/deoxxa/duplexer2#readme", - "keywords": [ - "duplex", - "duplexer", - "stream", - "stream3", - "join", - "combine" - ], - "license": "BSD-3-Clause", - "name": "duplexer2", - "repository": { - "type": "git", - "url": "git+https://github.com/deoxxa/duplexer2.git" - }, - "scripts": { - "test": "mocha -R tap" - }, - "version": "0.1.4" -} diff --git a/node_modules/ee-first/LICENSE b/node_modules/ee-first/LICENSE deleted file mode 100644 index a7ae8ee9b..000000000 --- a/node_modules/ee-first/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ - -The MIT License (MIT) - -Copyright (c) 2014 Jonathan Ong me@jongleberry.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/ee-first/README.md b/node_modules/ee-first/README.md deleted file mode 100644 index cbd2478be..000000000 --- a/node_modules/ee-first/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# EE First - -[![NPM version][npm-image]][npm-url] -[![Build status][travis-image]][travis-url] -[![Test coverage][coveralls-image]][coveralls-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] -[![Gittip][gittip-image]][gittip-url] - -Get the first event in a set of event emitters and event pairs, -then clean up after itself. - -## Install - -```sh -$ npm install ee-first -``` - -## API - -```js -var first = require('ee-first') -``` - -### first(arr, listener) - -Invoke `listener` on the first event from the list specified in `arr`. `arr` is -an array of arrays, with each array in the format `[ee, ...event]`. `listener` -will be called only once, the first time any of the given events are emitted. If -`error` is one of the listened events, then if that fires first, the `listener` -will be given the `err` argument. - -The `listener` is invoked as `listener(err, ee, event, args)`, where `err` is the -first argument emitted from an `error` event, if applicable; `ee` is the event -emitter that fired; `event` is the string event name that fired; and `args` is an -array of the arguments that were emitted on the event. - -```js -var ee1 = new EventEmitter() -var ee2 = new EventEmitter() - -first([ - [ee1, 'close', 'end', 'error'], - [ee2, 'error'] -], function (err, ee, event, args) { - // listener invoked -}) -``` - -#### .cancel() - -The group of listeners can be cancelled before being invoked and have all the event -listeners removed from the underlying event emitters. - -```js -var thunk = first([ - [ee1, 'close', 'end', 'error'], - [ee2, 'error'] -], function (err, ee, event, args) { - // listener invoked -}) - -// cancel and clean up -thunk.cancel() -``` - -[npm-image]: https://img.shields.io/npm/v/ee-first.svg?style=flat-square -[npm-url]: https://npmjs.org/package/ee-first -[github-tag]: http://img.shields.io/github/tag/jonathanong/ee-first.svg?style=flat-square -[github-url]: https://github.com/jonathanong/ee-first/tags -[travis-image]: https://img.shields.io/travis/jonathanong/ee-first.svg?style=flat-square -[travis-url]: https://travis-ci.org/jonathanong/ee-first -[coveralls-image]: https://img.shields.io/coveralls/jonathanong/ee-first.svg?style=flat-square -[coveralls-url]: https://coveralls.io/r/jonathanong/ee-first?branch=master -[license-image]: http://img.shields.io/npm/l/ee-first.svg?style=flat-square -[license-url]: LICENSE.md -[downloads-image]: http://img.shields.io/npm/dm/ee-first.svg?style=flat-square -[downloads-url]: https://npmjs.org/package/ee-first -[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square -[gittip-url]: https://www.gittip.com/jonathanong/ diff --git a/node_modules/ee-first/index.js b/node_modules/ee-first/index.js deleted file mode 100644 index 501287cd3..000000000 --- a/node_modules/ee-first/index.js +++ /dev/null @@ -1,95 +0,0 @@ -/*! - * ee-first - * Copyright(c) 2014 Jonathan Ong - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = first - -/** - * Get the first event in a set of event emitters and event pairs. - * - * @param {array} stuff - * @param {function} done - * @public - */ - -function first(stuff, done) { - if (!Array.isArray(stuff)) - throw new TypeError('arg must be an array of [ee, events...] arrays') - - var cleanups = [] - - for (var i = 0; i < stuff.length; i++) { - var arr = stuff[i] - - if (!Array.isArray(arr) || arr.length < 2) - throw new TypeError('each array member must be [ee, events...]') - - var ee = arr[0] - - for (var j = 1; j < arr.length; j++) { - var event = arr[j] - var fn = listener(event, callback) - - // listen to the event - ee.on(event, fn) - // push this listener to the list of cleanups - cleanups.push({ - ee: ee, - event: event, - fn: fn, - }) - } - } - - function callback() { - cleanup() - done.apply(null, arguments) - } - - function cleanup() { - var x - for (var i = 0; i < cleanups.length; i++) { - x = cleanups[i] - x.ee.removeListener(x.event, x.fn) - } - } - - function thunk(fn) { - done = fn - } - - thunk.cancel = cleanup - - return thunk -} - -/** - * Create the event listener. - * @private - */ - -function listener(event, done) { - return function onevent(arg1) { - var args = new Array(arguments.length) - var ee = this - var err = event === 'error' - ? arg1 - : null - - // copy args to prevent arguments escaping scope - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i] - } - - done(err, ee, event, args) - } -} diff --git a/node_modules/ee-first/package.json b/node_modules/ee-first/package.json deleted file mode 100644 index b836958c0..000000000 --- a/node_modules/ee-first/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "_from": "ee-first@1.1.1", - "_id": "ee-first@1.1.1", - "_inBundle": false, - "_integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", - "_location": "/ee-first", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "ee-first@1.1.1", - "name": "ee-first", - "escapedName": "ee-first", - "rawSpec": "1.1.1", - "saveSpec": null, - "fetchSpec": "1.1.1" - }, - "_requiredBy": [ - "/on-finished" - ], - "_resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "_shasum": "590c61156b0ae2f4f0255732a158b266bc56b21d", - "_spec": "ee-first@1.1.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/on-finished", - "author": { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com" - }, - "bugs": { - "url": "https://github.com/jonathanong/ee-first/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - } - ], - "deprecated": false, - "description": "return the first event in a set of ee/event pairs", - "devDependencies": { - "istanbul": "0.3.9", - "mocha": "2.2.5" - }, - "files": [ - "index.js", - "LICENSE" - ], - "homepage": "https://github.com/jonathanong/ee-first#readme", - "license": "MIT", - "name": "ee-first", - "repository": { - "type": "git", - "url": "git+https://github.com/jonathanong/ee-first.git" - }, - "scripts": { - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" - }, - "version": "1.1.1" -} diff --git a/node_modules/elliptic/README.md b/node_modules/elliptic/README.md deleted file mode 100644 index 96219e55b..000000000 --- a/node_modules/elliptic/README.md +++ /dev/null @@ -1,238 +0,0 @@ -# Elliptic [![Build Status](https://secure.travis-ci.org/indutny/elliptic.png)](http://travis-ci.org/indutny/elliptic) [![Coverage Status](https://coveralls.io/repos/indutny/elliptic/badge.svg?branch=master&service=github)](https://coveralls.io/github/indutny/elliptic?branch=master) [![Code Climate](https://codeclimate.com/github/indutny/elliptic/badges/gpa.svg)](https://codeclimate.com/github/indutny/elliptic) - -[![Saucelabs Test Status](https://saucelabs.com/browser-matrix/gh-indutny-elliptic.svg)](https://saucelabs.com/u/gh-indutny-elliptic) - -Fast elliptic-curve cryptography in a plain javascript implementation. - -NOTE: Please take a look at http://safecurves.cr.yp.to/ before choosing a curve -for your cryptography operations. - -## Incentive - -ECC is much slower than regular RSA cryptography, the JS implementations are -even more slower. - -## Benchmarks - -```bash -$ node benchmarks/index.js -Benchmarking: sign -elliptic#sign x 262 ops/sec ±0.51% (177 runs sampled) -eccjs#sign x 55.91 ops/sec ±0.90% (144 runs sampled) ------------------------- -Fastest is elliptic#sign -======================== -Benchmarking: verify -elliptic#verify x 113 ops/sec ±0.50% (166 runs sampled) -eccjs#verify x 48.56 ops/sec ±0.36% (125 runs sampled) ------------------------- -Fastest is elliptic#verify -======================== -Benchmarking: gen -elliptic#gen x 294 ops/sec ±0.43% (176 runs sampled) -eccjs#gen x 62.25 ops/sec ±0.63% (129 runs sampled) ------------------------- -Fastest is elliptic#gen -======================== -Benchmarking: ecdh -elliptic#ecdh x 136 ops/sec ±0.85% (156 runs sampled) ------------------------- -Fastest is elliptic#ecdh -======================== -``` - -## API - -### ECDSA - -```javascript -var EC = require('elliptic').ec; - -// Create and initialize EC context -// (better do it once and reuse it) -var ec = new EC('secp256k1'); - -// Generate keys -var key = ec.genKeyPair(); - -// Sign the message's hash (input must be an array, or a hex-string) -var msgHash = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]; -var signature = key.sign(msgHash); - -// Export DER encoded signature in Array -var derSign = signature.toDER(); - -// Verify signature -console.log(key.verify(msgHash, derSign)); - -// CHECK WITH NO PRIVATE KEY - -var pubPoint = key.getPublic(); -var x = pubPoint.getX(); -var y = pubPoint.getY(); - -// Public Key MUST be either: -// 1) '04' + hex string of x + hex string of y; or -// 2) object with two hex string properties (x and y); or -// 3) object with two buffer properties (x and y) -var pub = pubPoint.encode('hex'); // case 1 -var pub = { x: x.toString('hex'), y: y.toString('hex') }; // case 2 -var pub = { x: x.toBuffer(), y: y.toBuffer() }; // case 3 -var pub = { x: x.toArrayLike(Buffer), y: y.toArrayLike(Buffer) }; // case 3 - -// Import public key -var key = ec.keyFromPublic(pub, 'hex'); - -// Signature MUST be either: -// 1) DER-encoded signature as hex-string; or -// 2) DER-encoded signature as buffer; or -// 3) object with two hex-string properties (r and s); or -// 4) object with two buffer properties (r and s) - -var signature = '3046022100...'; // case 1 -var signature = new Buffer('...'); // case 2 -var signature = { r: 'b1fc...', s: '9c42...' }; // case 3 - -// Verify signature -console.log(key.verify(msgHash, signature)); -``` - -### EdDSA - -```javascript -var EdDSA = require('elliptic').eddsa; - -// Create and initialize EdDSA context -// (better do it once and reuse it) -var ec = new EdDSA('ed25519'); - -// Create key pair from secret -var key = ec.keyFromSecret('693e3c...'); // hex string, array or Buffer - -// Sign the message's hash (input must be an array, or a hex-string) -var msgHash = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]; -var signature = key.sign(msgHash).toHex(); - -// Verify signature -console.log(key.verify(msgHash, signature)); - -// CHECK WITH NO PRIVATE KEY - -// Import public key -var pub = '0a1af638...'; -var key = ec.keyFromPublic(pub, 'hex'); - -// Verify signature -var signature = '70bed1...'; -console.log(key.verify(msgHash, signature)); -``` - -### ECDH - -```javascript -var EC = require('elliptic').ec; -var ec = new EC('curve25519'); - -// Generate keys -var key1 = ec.genKeyPair(); -var key2 = ec.genKeyPair(); - -var shared1 = key1.derive(key2.getPublic()); -var shared2 = key2.derive(key1.getPublic()); - -console.log('Both shared secrets are BN instances'); -console.log(shared1.toString(16)); -console.log(shared2.toString(16)); -``` - -three and more members: -```javascript -var EC = require('elliptic').ec; -var ec = new EC('curve25519'); - -var A = ec.genKeyPair(); -var B = ec.genKeyPair(); -var C = ec.genKeyPair(); - -var AB = A.getPublic().mul(B.getPrivate()) -var BC = B.getPublic().mul(C.getPrivate()) -var CA = C.getPublic().mul(A.getPrivate()) - -var ABC = AB.mul(C.getPrivate()) -var BCA = BC.mul(A.getPrivate()) -var CAB = CA.mul(B.getPrivate()) - -console.log(ABC.getX().toString(16)) -console.log(BCA.getX().toString(16)) -console.log(CAB.getX().toString(16)) -``` - -NOTE: `.derive()` returns a [BN][1] instance. - -## Supported curves - -Elliptic.js support following curve types: - -* Short Weierstrass -* Montgomery -* Edwards -* Twisted Edwards - -Following curve 'presets' are embedded into the library: - -* `secp256k1` -* `p192` -* `p224` -* `p256` -* `p384` -* `p521` -* `curve25519` -* `ed25519` - -NOTE: That `curve25519` could not be used for ECDSA, use `ed25519` instead. - -### Implementation details - -ECDSA is using deterministic `k` value generation as per [RFC6979][0]. Most of -the curve operations are performed on non-affine coordinates (either projective -or extended), various windowing techniques are used for different cases. - -All operations are performed in reduction context using [bn.js][1], hashing is -provided by [hash.js][2] - -### Related projects - -* [eccrypto][3]: isomorphic implementation of ECDSA, ECDH and ECIES for both - browserify and node (uses `elliptic` for browser and [secp256k1-node][4] for - node) - -#### LICENSE - -This software is licensed under the MIT License. - -Copyright Fedor Indutny, 2014. - -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. - -[0]: http://tools.ietf.org/html/rfc6979 -[1]: https://github.com/indutny/bn.js -[2]: https://github.com/indutny/hash.js -[3]: https://github.com/bitchan/eccrypto -[4]: https://github.com/wanderer/secp256k1-node diff --git a/node_modules/elliptic/lib/elliptic.js b/node_modules/elliptic/lib/elliptic.js deleted file mode 100644 index dfe2fe7d1..000000000 --- a/node_modules/elliptic/lib/elliptic.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -var elliptic = exports; - -elliptic.version = require('../package.json').version; -elliptic.utils = require('./elliptic/utils'); -elliptic.rand = require('brorand'); -elliptic.curve = require('./elliptic/curve'); -elliptic.curves = require('./elliptic/curves'); - -// Protocols -elliptic.ec = require('./elliptic/ec'); -elliptic.eddsa = require('./elliptic/eddsa'); diff --git a/node_modules/elliptic/lib/elliptic/curve/base.js b/node_modules/elliptic/lib/elliptic/curve/base.js deleted file mode 100644 index 3af82396a..000000000 --- a/node_modules/elliptic/lib/elliptic/curve/base.js +++ /dev/null @@ -1,375 +0,0 @@ -'use strict'; - -var BN = require('bn.js'); -var elliptic = require('../../elliptic'); -var utils = elliptic.utils; -var getNAF = utils.getNAF; -var getJSF = utils.getJSF; -var assert = utils.assert; - -function BaseCurve(type, conf) { - this.type = type; - this.p = new BN(conf.p, 16); - - // Use Montgomery, when there is no fast reduction for the prime - this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p); - - // Useful for many curves - this.zero = new BN(0).toRed(this.red); - this.one = new BN(1).toRed(this.red); - this.two = new BN(2).toRed(this.red); - - // Curve configuration, optional - this.n = conf.n && new BN(conf.n, 16); - this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed); - - // Temporary arrays - this._wnafT1 = new Array(4); - this._wnafT2 = new Array(4); - this._wnafT3 = new Array(4); - this._wnafT4 = new Array(4); - - // Generalized Greg Maxwell's trick - var adjustCount = this.n && this.p.div(this.n); - if (!adjustCount || adjustCount.cmpn(100) > 0) { - this.redN = null; - } else { - this._maxwellTrick = true; - this.redN = this.n.toRed(this.red); - } -} -module.exports = BaseCurve; - -BaseCurve.prototype.point = function point() { - throw new Error('Not implemented'); -}; - -BaseCurve.prototype.validate = function validate() { - throw new Error('Not implemented'); -}; - -BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) { - assert(p.precomputed); - var doubles = p._getDoubles(); - - var naf = getNAF(k, 1); - var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1); - I /= 3; - - // Translate into more windowed form - var repr = []; - for (var j = 0; j < naf.length; j += doubles.step) { - var nafW = 0; - for (var k = j + doubles.step - 1; k >= j; k--) - nafW = (nafW << 1) + naf[k]; - repr.push(nafW); - } - - var a = this.jpoint(null, null, null); - var b = this.jpoint(null, null, null); - for (var i = I; i > 0; i--) { - for (var j = 0; j < repr.length; j++) { - var nafW = repr[j]; - if (nafW === i) - b = b.mixedAdd(doubles.points[j]); - else if (nafW === -i) - b = b.mixedAdd(doubles.points[j].neg()); - } - a = a.add(b); - } - return a.toP(); -}; - -BaseCurve.prototype._wnafMul = function _wnafMul(p, k) { - var w = 4; - - // Precompute window - var nafPoints = p._getNAFPoints(w); - w = nafPoints.wnd; - var wnd = nafPoints.points; - - // Get NAF form - var naf = getNAF(k, w); - - // Add `this`*(N+1) for every w-NAF index - var acc = this.jpoint(null, null, null); - for (var i = naf.length - 1; i >= 0; i--) { - // Count zeroes - for (var k = 0; i >= 0 && naf[i] === 0; i--) - k++; - if (i >= 0) - k++; - acc = acc.dblp(k); - - if (i < 0) - break; - var z = naf[i]; - assert(z !== 0); - if (p.type === 'affine') { - // J +- P - if (z > 0) - acc = acc.mixedAdd(wnd[(z - 1) >> 1]); - else - acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg()); - } else { - // J +- J - if (z > 0) - acc = acc.add(wnd[(z - 1) >> 1]); - else - acc = acc.add(wnd[(-z - 1) >> 1].neg()); - } - } - return p.type === 'affine' ? acc.toP() : acc; -}; - -BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW, - points, - coeffs, - len, - jacobianResult) { - var wndWidth = this._wnafT1; - var wnd = this._wnafT2; - var naf = this._wnafT3; - - // Fill all arrays - var max = 0; - for (var i = 0; i < len; i++) { - var p = points[i]; - var nafPoints = p._getNAFPoints(defW); - wndWidth[i] = nafPoints.wnd; - wnd[i] = nafPoints.points; - } - - // Comb small window NAFs - for (var i = len - 1; i >= 1; i -= 2) { - var a = i - 1; - var b = i; - if (wndWidth[a] !== 1 || wndWidth[b] !== 1) { - naf[a] = getNAF(coeffs[a], wndWidth[a]); - naf[b] = getNAF(coeffs[b], wndWidth[b]); - max = Math.max(naf[a].length, max); - max = Math.max(naf[b].length, max); - continue; - } - - var comb = [ - points[a], /* 1 */ - null, /* 3 */ - null, /* 5 */ - points[b] /* 7 */ - ]; - - // Try to avoid Projective points, if possible - if (points[a].y.cmp(points[b].y) === 0) { - comb[1] = points[a].add(points[b]); - comb[2] = points[a].toJ().mixedAdd(points[b].neg()); - } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) { - comb[1] = points[a].toJ().mixedAdd(points[b]); - comb[2] = points[a].add(points[b].neg()); - } else { - comb[1] = points[a].toJ().mixedAdd(points[b]); - comb[2] = points[a].toJ().mixedAdd(points[b].neg()); - } - - var index = [ - -3, /* -1 -1 */ - -1, /* -1 0 */ - -5, /* -1 1 */ - -7, /* 0 -1 */ - 0, /* 0 0 */ - 7, /* 0 1 */ - 5, /* 1 -1 */ - 1, /* 1 0 */ - 3 /* 1 1 */ - ]; - - var jsf = getJSF(coeffs[a], coeffs[b]); - max = Math.max(jsf[0].length, max); - naf[a] = new Array(max); - naf[b] = new Array(max); - for (var j = 0; j < max; j++) { - var ja = jsf[0][j] | 0; - var jb = jsf[1][j] | 0; - - naf[a][j] = index[(ja + 1) * 3 + (jb + 1)]; - naf[b][j] = 0; - wnd[a] = comb; - } - } - - var acc = this.jpoint(null, null, null); - var tmp = this._wnafT4; - for (var i = max; i >= 0; i--) { - var k = 0; - - while (i >= 0) { - var zero = true; - for (var j = 0; j < len; j++) { - tmp[j] = naf[j][i] | 0; - if (tmp[j] !== 0) - zero = false; - } - if (!zero) - break; - k++; - i--; - } - if (i >= 0) - k++; - acc = acc.dblp(k); - if (i < 0) - break; - - for (var j = 0; j < len; j++) { - var z = tmp[j]; - var p; - if (z === 0) - continue; - else if (z > 0) - p = wnd[j][(z - 1) >> 1]; - else if (z < 0) - p = wnd[j][(-z - 1) >> 1].neg(); - - if (p.type === 'affine') - acc = acc.mixedAdd(p); - else - acc = acc.add(p); - } - } - // Zeroify references - for (var i = 0; i < len; i++) - wnd[i] = null; - - if (jacobianResult) - return acc; - else - return acc.toP(); -}; - -function BasePoint(curve, type) { - this.curve = curve; - this.type = type; - this.precomputed = null; -} -BaseCurve.BasePoint = BasePoint; - -BasePoint.prototype.eq = function eq(/*other*/) { - throw new Error('Not implemented'); -}; - -BasePoint.prototype.validate = function validate() { - return this.curve.validate(this); -}; - -BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) { - bytes = utils.toArray(bytes, enc); - - var len = this.p.byteLength(); - - // uncompressed, hybrid-odd, hybrid-even - if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) && - bytes.length - 1 === 2 * len) { - if (bytes[0] === 0x06) - assert(bytes[bytes.length - 1] % 2 === 0); - else if (bytes[0] === 0x07) - assert(bytes[bytes.length - 1] % 2 === 1); - - var res = this.point(bytes.slice(1, 1 + len), - bytes.slice(1 + len, 1 + 2 * len)); - - return res; - } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) && - bytes.length - 1 === len) { - return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03); - } - throw new Error('Unknown point format'); -}; - -BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) { - return this.encode(enc, true); -}; - -BasePoint.prototype._encode = function _encode(compact) { - var len = this.curve.p.byteLength(); - var x = this.getX().toArray('be', len); - - if (compact) - return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x); - - return [ 0x04 ].concat(x, this.getY().toArray('be', len)) ; -}; - -BasePoint.prototype.encode = function encode(enc, compact) { - return utils.encode(this._encode(compact), enc); -}; - -BasePoint.prototype.precompute = function precompute(power) { - if (this.precomputed) - return this; - - var precomputed = { - doubles: null, - naf: null, - beta: null - }; - precomputed.naf = this._getNAFPoints(8); - precomputed.doubles = this._getDoubles(4, power); - precomputed.beta = this._getBeta(); - this.precomputed = precomputed; - - return this; -}; - -BasePoint.prototype._hasDoubles = function _hasDoubles(k) { - if (!this.precomputed) - return false; - - var doubles = this.precomputed.doubles; - if (!doubles) - return false; - - return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step); -}; - -BasePoint.prototype._getDoubles = function _getDoubles(step, power) { - if (this.precomputed && this.precomputed.doubles) - return this.precomputed.doubles; - - var doubles = [ this ]; - var acc = this; - for (var i = 0; i < power; i += step) { - for (var j = 0; j < step; j++) - acc = acc.dbl(); - doubles.push(acc); - } - return { - step: step, - points: doubles - }; -}; - -BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) { - if (this.precomputed && this.precomputed.naf) - return this.precomputed.naf; - - var res = [ this ]; - var max = (1 << wnd) - 1; - var dbl = max === 1 ? null : this.dbl(); - for (var i = 1; i < max; i++) - res[i] = res[i - 1].add(dbl); - return { - wnd: wnd, - points: res - }; -}; - -BasePoint.prototype._getBeta = function _getBeta() { - return null; -}; - -BasePoint.prototype.dblp = function dblp(k) { - var r = this; - for (var i = 0; i < k; i++) - r = r.dbl(); - return r; -}; diff --git a/node_modules/elliptic/lib/elliptic/curve/edwards.js b/node_modules/elliptic/lib/elliptic/curve/edwards.js deleted file mode 100644 index a8965eaec..000000000 --- a/node_modules/elliptic/lib/elliptic/curve/edwards.js +++ /dev/null @@ -1,433 +0,0 @@ -'use strict'; - -var curve = require('../curve'); -var elliptic = require('../../elliptic'); -var BN = require('bn.js'); -var inherits = require('inherits'); -var Base = curve.base; - -var assert = elliptic.utils.assert; - -function EdwardsCurve(conf) { - // NOTE: Important as we are creating point in Base.call() - this.twisted = (conf.a | 0) !== 1; - this.mOneA = this.twisted && (conf.a | 0) === -1; - this.extended = this.mOneA; - - Base.call(this, 'edwards', conf); - - this.a = new BN(conf.a, 16).umod(this.red.m); - this.a = this.a.toRed(this.red); - this.c = new BN(conf.c, 16).toRed(this.red); - this.c2 = this.c.redSqr(); - this.d = new BN(conf.d, 16).toRed(this.red); - this.dd = this.d.redAdd(this.d); - - assert(!this.twisted || this.c.fromRed().cmpn(1) === 0); - this.oneC = (conf.c | 0) === 1; -} -inherits(EdwardsCurve, Base); -module.exports = EdwardsCurve; - -EdwardsCurve.prototype._mulA = function _mulA(num) { - if (this.mOneA) - return num.redNeg(); - else - return this.a.redMul(num); -}; - -EdwardsCurve.prototype._mulC = function _mulC(num) { - if (this.oneC) - return num; - else - return this.c.redMul(num); -}; - -// Just for compatibility with Short curve -EdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) { - return this.point(x, y, z, t); -}; - -EdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) { - x = new BN(x, 16); - if (!x.red) - x = x.toRed(this.red); - - var x2 = x.redSqr(); - var rhs = this.c2.redSub(this.a.redMul(x2)); - var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2)); - - var y2 = rhs.redMul(lhs.redInvm()); - var y = y2.redSqrt(); - if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) - throw new Error('invalid point'); - - var isOdd = y.fromRed().isOdd(); - if (odd && !isOdd || !odd && isOdd) - y = y.redNeg(); - - return this.point(x, y); -}; - -EdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) { - y = new BN(y, 16); - if (!y.red) - y = y.toRed(this.red); - - // x^2 = (y^2 - c^2) / (c^2 d y^2 - a) - var y2 = y.redSqr(); - var lhs = y2.redSub(this.c2); - var rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a); - var x2 = lhs.redMul(rhs.redInvm()); - - if (x2.cmp(this.zero) === 0) { - if (odd) - throw new Error('invalid point'); - else - return this.point(this.zero, y); - } - - var x = x2.redSqrt(); - if (x.redSqr().redSub(x2).cmp(this.zero) !== 0) - throw new Error('invalid point'); - - if (x.fromRed().isOdd() !== odd) - x = x.redNeg(); - - return this.point(x, y); -}; - -EdwardsCurve.prototype.validate = function validate(point) { - if (point.isInfinity()) - return true; - - // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2) - point.normalize(); - - var x2 = point.x.redSqr(); - var y2 = point.y.redSqr(); - var lhs = x2.redMul(this.a).redAdd(y2); - var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2))); - - return lhs.cmp(rhs) === 0; -}; - -function Point(curve, x, y, z, t) { - Base.BasePoint.call(this, curve, 'projective'); - if (x === null && y === null && z === null) { - this.x = this.curve.zero; - this.y = this.curve.one; - this.z = this.curve.one; - this.t = this.curve.zero; - this.zOne = true; - } else { - this.x = new BN(x, 16); - this.y = new BN(y, 16); - this.z = z ? new BN(z, 16) : this.curve.one; - this.t = t && new BN(t, 16); - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - if (!this.y.red) - this.y = this.y.toRed(this.curve.red); - if (!this.z.red) - this.z = this.z.toRed(this.curve.red); - if (this.t && !this.t.red) - this.t = this.t.toRed(this.curve.red); - this.zOne = this.z === this.curve.one; - - // Use extended coordinates - if (this.curve.extended && !this.t) { - this.t = this.x.redMul(this.y); - if (!this.zOne) - this.t = this.t.redMul(this.z.redInvm()); - } - } -} -inherits(Point, Base.BasePoint); - -EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) { - return Point.fromJSON(this, obj); -}; - -EdwardsCurve.prototype.point = function point(x, y, z, t) { - return new Point(this, x, y, z, t); -}; - -Point.fromJSON = function fromJSON(curve, obj) { - return new Point(curve, obj[0], obj[1], obj[2]); -}; - -Point.prototype.inspect = function inspect() { - if (this.isInfinity()) - return ''; - return ''; -}; - -Point.prototype.isInfinity = function isInfinity() { - // XXX This code assumes that zero is always zero in red - return this.x.cmpn(0) === 0 && - (this.y.cmp(this.z) === 0 || - (this.zOne && this.y.cmp(this.curve.c) === 0)); -}; - -Point.prototype._extDbl = function _extDbl() { - // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html - // #doubling-dbl-2008-hwcd - // 4M + 4S - - // A = X1^2 - var a = this.x.redSqr(); - // B = Y1^2 - var b = this.y.redSqr(); - // C = 2 * Z1^2 - var c = this.z.redSqr(); - c = c.redIAdd(c); - // D = a * A - var d = this.curve._mulA(a); - // E = (X1 + Y1)^2 - A - B - var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b); - // G = D + B - var g = d.redAdd(b); - // F = G - C - var f = g.redSub(c); - // H = D - B - var h = d.redSub(b); - // X3 = E * F - var nx = e.redMul(f); - // Y3 = G * H - var ny = g.redMul(h); - // T3 = E * H - var nt = e.redMul(h); - // Z3 = F * G - var nz = f.redMul(g); - return this.curve.point(nx, ny, nz, nt); -}; - -Point.prototype._projDbl = function _projDbl() { - // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html - // #doubling-dbl-2008-bbjlp - // #doubling-dbl-2007-bl - // and others - // Generally 3M + 4S or 2M + 4S - - // B = (X1 + Y1)^2 - var b = this.x.redAdd(this.y).redSqr(); - // C = X1^2 - var c = this.x.redSqr(); - // D = Y1^2 - var d = this.y.redSqr(); - - var nx; - var ny; - var nz; - if (this.curve.twisted) { - // E = a * C - var e = this.curve._mulA(c); - // F = E + D - var f = e.redAdd(d); - if (this.zOne) { - // X3 = (B - C - D) * (F - 2) - nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two)); - // Y3 = F * (E - D) - ny = f.redMul(e.redSub(d)); - // Z3 = F^2 - 2 * F - nz = f.redSqr().redSub(f).redSub(f); - } else { - // H = Z1^2 - var h = this.z.redSqr(); - // J = F - 2 * H - var j = f.redSub(h).redISub(h); - // X3 = (B-C-D)*J - nx = b.redSub(c).redISub(d).redMul(j); - // Y3 = F * (E - D) - ny = f.redMul(e.redSub(d)); - // Z3 = F * J - nz = f.redMul(j); - } - } else { - // E = C + D - var e = c.redAdd(d); - // H = (c * Z1)^2 - var h = this.curve._mulC(this.z).redSqr(); - // J = E - 2 * H - var j = e.redSub(h).redSub(h); - // X3 = c * (B - E) * J - nx = this.curve._mulC(b.redISub(e)).redMul(j); - // Y3 = c * E * (C - D) - ny = this.curve._mulC(e).redMul(c.redISub(d)); - // Z3 = E * J - nz = e.redMul(j); - } - return this.curve.point(nx, ny, nz); -}; - -Point.prototype.dbl = function dbl() { - if (this.isInfinity()) - return this; - - // Double in extended coordinates - if (this.curve.extended) - return this._extDbl(); - else - return this._projDbl(); -}; - -Point.prototype._extAdd = function _extAdd(p) { - // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html - // #addition-add-2008-hwcd-3 - // 8M - - // A = (Y1 - X1) * (Y2 - X2) - var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x)); - // B = (Y1 + X1) * (Y2 + X2) - var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)); - // C = T1 * k * T2 - var c = this.t.redMul(this.curve.dd).redMul(p.t); - // D = Z1 * 2 * Z2 - var d = this.z.redMul(p.z.redAdd(p.z)); - // E = B - A - var e = b.redSub(a); - // F = D - C - var f = d.redSub(c); - // G = D + C - var g = d.redAdd(c); - // H = B + A - var h = b.redAdd(a); - // X3 = E * F - var nx = e.redMul(f); - // Y3 = G * H - var ny = g.redMul(h); - // T3 = E * H - var nt = e.redMul(h); - // Z3 = F * G - var nz = f.redMul(g); - return this.curve.point(nx, ny, nz, nt); -}; - -Point.prototype._projAdd = function _projAdd(p) { - // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html - // #addition-add-2008-bbjlp - // #addition-add-2007-bl - // 10M + 1S - - // A = Z1 * Z2 - var a = this.z.redMul(p.z); - // B = A^2 - var b = a.redSqr(); - // C = X1 * X2 - var c = this.x.redMul(p.x); - // D = Y1 * Y2 - var d = this.y.redMul(p.y); - // E = d * C * D - var e = this.curve.d.redMul(c).redMul(d); - // F = B - E - var f = b.redSub(e); - // G = B + E - var g = b.redAdd(e); - // X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D) - var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d); - var nx = a.redMul(f).redMul(tmp); - var ny; - var nz; - if (this.curve.twisted) { - // Y3 = A * G * (D - a * C) - ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c))); - // Z3 = F * G - nz = f.redMul(g); - } else { - // Y3 = A * G * (D - C) - ny = a.redMul(g).redMul(d.redSub(c)); - // Z3 = c * F * G - nz = this.curve._mulC(f).redMul(g); - } - return this.curve.point(nx, ny, nz); -}; - -Point.prototype.add = function add(p) { - if (this.isInfinity()) - return p; - if (p.isInfinity()) - return this; - - if (this.curve.extended) - return this._extAdd(p); - else - return this._projAdd(p); -}; - -Point.prototype.mul = function mul(k) { - if (this._hasDoubles(k)) - return this.curve._fixedNafMul(this, k); - else - return this.curve._wnafMul(this, k); -}; - -Point.prototype.mulAdd = function mulAdd(k1, p, k2) { - return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, false); -}; - -Point.prototype.jmulAdd = function jmulAdd(k1, p, k2) { - return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, true); -}; - -Point.prototype.normalize = function normalize() { - if (this.zOne) - return this; - - // Normalize coordinates - var zi = this.z.redInvm(); - this.x = this.x.redMul(zi); - this.y = this.y.redMul(zi); - if (this.t) - this.t = this.t.redMul(zi); - this.z = this.curve.one; - this.zOne = true; - return this; -}; - -Point.prototype.neg = function neg() { - return this.curve.point(this.x.redNeg(), - this.y, - this.z, - this.t && this.t.redNeg()); -}; - -Point.prototype.getX = function getX() { - this.normalize(); - return this.x.fromRed(); -}; - -Point.prototype.getY = function getY() { - this.normalize(); - return this.y.fromRed(); -}; - -Point.prototype.eq = function eq(other) { - return this === other || - this.getX().cmp(other.getX()) === 0 && - this.getY().cmp(other.getY()) === 0; -}; - -Point.prototype.eqXToP = function eqXToP(x) { - var rx = x.toRed(this.curve.red).redMul(this.z); - if (this.x.cmp(rx) === 0) - return true; - - var xc = x.clone(); - var t = this.curve.redN.redMul(this.z); - for (;;) { - xc.iadd(this.curve.n); - if (xc.cmp(this.curve.p) >= 0) - return false; - - rx.redIAdd(t); - if (this.x.cmp(rx) === 0) - return true; - } -}; - -// Compatibility with BaseCurve -Point.prototype.toP = Point.prototype.normalize; -Point.prototype.mixedAdd = Point.prototype.add; diff --git a/node_modules/elliptic/lib/elliptic/curve/index.js b/node_modules/elliptic/lib/elliptic/curve/index.js deleted file mode 100644 index c589281df..000000000 --- a/node_modules/elliptic/lib/elliptic/curve/index.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var curve = exports; - -curve.base = require('./base'); -curve.short = require('./short'); -curve.mont = require('./mont'); -curve.edwards = require('./edwards'); diff --git a/node_modules/elliptic/lib/elliptic/curve/mont.js b/node_modules/elliptic/lib/elliptic/curve/mont.js deleted file mode 100644 index 0ddea33e8..000000000 --- a/node_modules/elliptic/lib/elliptic/curve/mont.js +++ /dev/null @@ -1,180 +0,0 @@ -'use strict'; - -var curve = require('../curve'); -var BN = require('bn.js'); -var inherits = require('inherits'); -var Base = curve.base; - -var elliptic = require('../../elliptic'); -var utils = elliptic.utils; - -function MontCurve(conf) { - Base.call(this, 'mont', conf); - - this.a = new BN(conf.a, 16).toRed(this.red); - this.b = new BN(conf.b, 16).toRed(this.red); - this.i4 = new BN(4).toRed(this.red).redInvm(); - this.two = new BN(2).toRed(this.red); - this.a24 = this.i4.redMul(this.a.redAdd(this.two)); -} -inherits(MontCurve, Base); -module.exports = MontCurve; - -MontCurve.prototype.validate = function validate(point) { - var x = point.normalize().x; - var x2 = x.redSqr(); - var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x); - var y = rhs.redSqrt(); - - return y.redSqr().cmp(rhs) === 0; -}; - -function Point(curve, x, z) { - Base.BasePoint.call(this, curve, 'projective'); - if (x === null && z === null) { - this.x = this.curve.one; - this.z = this.curve.zero; - } else { - this.x = new BN(x, 16); - this.z = new BN(z, 16); - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - if (!this.z.red) - this.z = this.z.toRed(this.curve.red); - } -} -inherits(Point, Base.BasePoint); - -MontCurve.prototype.decodePoint = function decodePoint(bytes, enc) { - return this.point(utils.toArray(bytes, enc), 1); -}; - -MontCurve.prototype.point = function point(x, z) { - return new Point(this, x, z); -}; - -MontCurve.prototype.pointFromJSON = function pointFromJSON(obj) { - return Point.fromJSON(this, obj); -}; - -Point.prototype.precompute = function precompute() { - // No-op -}; - -Point.prototype._encode = function _encode() { - return this.getX().toArray('be', this.curve.p.byteLength()); -}; - -Point.fromJSON = function fromJSON(curve, obj) { - return new Point(curve, obj[0], obj[1] || curve.one); -}; - -Point.prototype.inspect = function inspect() { - if (this.isInfinity()) - return ''; - return ''; -}; - -Point.prototype.isInfinity = function isInfinity() { - // XXX This code assumes that zero is always zero in red - return this.z.cmpn(0) === 0; -}; - -Point.prototype.dbl = function dbl() { - // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3 - // 2M + 2S + 4A - - // A = X1 + Z1 - var a = this.x.redAdd(this.z); - // AA = A^2 - var aa = a.redSqr(); - // B = X1 - Z1 - var b = this.x.redSub(this.z); - // BB = B^2 - var bb = b.redSqr(); - // C = AA - BB - var c = aa.redSub(bb); - // X3 = AA * BB - var nx = aa.redMul(bb); - // Z3 = C * (BB + A24 * C) - var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c))); - return this.curve.point(nx, nz); -}; - -Point.prototype.add = function add() { - throw new Error('Not supported on Montgomery curve'); -}; - -Point.prototype.diffAdd = function diffAdd(p, diff) { - // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3 - // 4M + 2S + 6A - - // A = X2 + Z2 - var a = this.x.redAdd(this.z); - // B = X2 - Z2 - var b = this.x.redSub(this.z); - // C = X3 + Z3 - var c = p.x.redAdd(p.z); - // D = X3 - Z3 - var d = p.x.redSub(p.z); - // DA = D * A - var da = d.redMul(a); - // CB = C * B - var cb = c.redMul(b); - // X5 = Z1 * (DA + CB)^2 - var nx = diff.z.redMul(da.redAdd(cb).redSqr()); - // Z5 = X1 * (DA - CB)^2 - var nz = diff.x.redMul(da.redISub(cb).redSqr()); - return this.curve.point(nx, nz); -}; - -Point.prototype.mul = function mul(k) { - var t = k.clone(); - var a = this; // (N / 2) * Q + Q - var b = this.curve.point(null, null); // (N / 2) * Q - var c = this; // Q - - for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1)) - bits.push(t.andln(1)); - - for (var i = bits.length - 1; i >= 0; i--) { - if (bits[i] === 0) { - // N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q - a = a.diffAdd(b, c); - // N * Q = 2 * ((N / 2) * Q + Q)) - b = b.dbl(); - } else { - // N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q) - b = a.diffAdd(b, c); - // N * Q + Q = 2 * ((N / 2) * Q + Q) - a = a.dbl(); - } - } - return b; -}; - -Point.prototype.mulAdd = function mulAdd() { - throw new Error('Not supported on Montgomery curve'); -}; - -Point.prototype.jumlAdd = function jumlAdd() { - throw new Error('Not supported on Montgomery curve'); -}; - -Point.prototype.eq = function eq(other) { - return this.getX().cmp(other.getX()) === 0; -}; - -Point.prototype.normalize = function normalize() { - this.x = this.x.redMul(this.z.redInvm()); - this.z = this.curve.one; - return this; -}; - -Point.prototype.getX = function getX() { - // Normalize coordinates - this.normalize(); - - return this.x.fromRed(); -}; diff --git a/node_modules/elliptic/lib/elliptic/curve/short.js b/node_modules/elliptic/lib/elliptic/curve/short.js deleted file mode 100644 index 5a0e86032..000000000 --- a/node_modules/elliptic/lib/elliptic/curve/short.js +++ /dev/null @@ -1,937 +0,0 @@ -'use strict'; - -var curve = require('../curve'); -var elliptic = require('../../elliptic'); -var BN = require('bn.js'); -var inherits = require('inherits'); -var Base = curve.base; - -var assert = elliptic.utils.assert; - -function ShortCurve(conf) { - Base.call(this, 'short', conf); - - this.a = new BN(conf.a, 16).toRed(this.red); - this.b = new BN(conf.b, 16).toRed(this.red); - this.tinv = this.two.redInvm(); - - this.zeroA = this.a.fromRed().cmpn(0) === 0; - this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0; - - // If the curve is endomorphic, precalculate beta and lambda - this.endo = this._getEndomorphism(conf); - this._endoWnafT1 = new Array(4); - this._endoWnafT2 = new Array(4); -} -inherits(ShortCurve, Base); -module.exports = ShortCurve; - -ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) { - // No efficient endomorphism - if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1) - return; - - // Compute beta and lambda, that lambda * P = (beta * Px; Py) - var beta; - var lambda; - if (conf.beta) { - beta = new BN(conf.beta, 16).toRed(this.red); - } else { - var betas = this._getEndoRoots(this.p); - // Choose the smallest beta - beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1]; - beta = beta.toRed(this.red); - } - if (conf.lambda) { - lambda = new BN(conf.lambda, 16); - } else { - // Choose the lambda that is matching selected beta - var lambdas = this._getEndoRoots(this.n); - if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) { - lambda = lambdas[0]; - } else { - lambda = lambdas[1]; - assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0); - } - } - - // Get basis vectors, used for balanced length-two representation - var basis; - if (conf.basis) { - basis = conf.basis.map(function(vec) { - return { - a: new BN(vec.a, 16), - b: new BN(vec.b, 16) - }; - }); - } else { - basis = this._getEndoBasis(lambda); - } - - return { - beta: beta, - lambda: lambda, - basis: basis - }; -}; - -ShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) { - // Find roots of for x^2 + x + 1 in F - // Root = (-1 +- Sqrt(-3)) / 2 - // - var red = num === this.p ? this.red : BN.mont(num); - var tinv = new BN(2).toRed(red).redInvm(); - var ntinv = tinv.redNeg(); - - var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv); - - var l1 = ntinv.redAdd(s).fromRed(); - var l2 = ntinv.redSub(s).fromRed(); - return [ l1, l2 ]; -}; - -ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) { - // aprxSqrt >= sqrt(this.n) - var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2)); - - // 3.74 - // Run EGCD, until r(L + 1) < aprxSqrt - var u = lambda; - var v = this.n.clone(); - var x1 = new BN(1); - var y1 = new BN(0); - var x2 = new BN(0); - var y2 = new BN(1); - - // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n) - var a0; - var b0; - // First vector - var a1; - var b1; - // Second vector - var a2; - var b2; - - var prevR; - var i = 0; - var r; - var x; - while (u.cmpn(0) !== 0) { - var q = v.div(u); - r = v.sub(q.mul(u)); - x = x2.sub(q.mul(x1)); - var y = y2.sub(q.mul(y1)); - - if (!a1 && r.cmp(aprxSqrt) < 0) { - a0 = prevR.neg(); - b0 = x1; - a1 = r.neg(); - b1 = x; - } else if (a1 && ++i === 2) { - break; - } - prevR = r; - - v = u; - u = r; - x2 = x1; - x1 = x; - y2 = y1; - y1 = y; - } - a2 = r.neg(); - b2 = x; - - var len1 = a1.sqr().add(b1.sqr()); - var len2 = a2.sqr().add(b2.sqr()); - if (len2.cmp(len1) >= 0) { - a2 = a0; - b2 = b0; - } - - // Normalize signs - if (a1.negative) { - a1 = a1.neg(); - b1 = b1.neg(); - } - if (a2.negative) { - a2 = a2.neg(); - b2 = b2.neg(); - } - - return [ - { a: a1, b: b1 }, - { a: a2, b: b2 } - ]; -}; - -ShortCurve.prototype._endoSplit = function _endoSplit(k) { - var basis = this.endo.basis; - var v1 = basis[0]; - var v2 = basis[1]; - - var c1 = v2.b.mul(k).divRound(this.n); - var c2 = v1.b.neg().mul(k).divRound(this.n); - - var p1 = c1.mul(v1.a); - var p2 = c2.mul(v2.a); - var q1 = c1.mul(v1.b); - var q2 = c2.mul(v2.b); - - // Calculate answer - var k1 = k.sub(p1).sub(p2); - var k2 = q1.add(q2).neg(); - return { k1: k1, k2: k2 }; -}; - -ShortCurve.prototype.pointFromX = function pointFromX(x, odd) { - x = new BN(x, 16); - if (!x.red) - x = x.toRed(this.red); - - var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b); - var y = y2.redSqrt(); - if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) - throw new Error('invalid point'); - - // XXX Is there any way to tell if the number is odd without converting it - // to non-red form? - var isOdd = y.fromRed().isOdd(); - if (odd && !isOdd || !odd && isOdd) - y = y.redNeg(); - - return this.point(x, y); -}; - -ShortCurve.prototype.validate = function validate(point) { - if (point.inf) - return true; - - var x = point.x; - var y = point.y; - - var ax = this.a.redMul(x); - var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b); - return y.redSqr().redISub(rhs).cmpn(0) === 0; -}; - -ShortCurve.prototype._endoWnafMulAdd = - function _endoWnafMulAdd(points, coeffs, jacobianResult) { - var npoints = this._endoWnafT1; - var ncoeffs = this._endoWnafT2; - for (var i = 0; i < points.length; i++) { - var split = this._endoSplit(coeffs[i]); - var p = points[i]; - var beta = p._getBeta(); - - if (split.k1.negative) { - split.k1.ineg(); - p = p.neg(true); - } - if (split.k2.negative) { - split.k2.ineg(); - beta = beta.neg(true); - } - - npoints[i * 2] = p; - npoints[i * 2 + 1] = beta; - ncoeffs[i * 2] = split.k1; - ncoeffs[i * 2 + 1] = split.k2; - } - var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult); - - // Clean-up references to points and coefficients - for (var j = 0; j < i * 2; j++) { - npoints[j] = null; - ncoeffs[j] = null; - } - return res; -}; - -function Point(curve, x, y, isRed) { - Base.BasePoint.call(this, curve, 'affine'); - if (x === null && y === null) { - this.x = null; - this.y = null; - this.inf = true; - } else { - this.x = new BN(x, 16); - this.y = new BN(y, 16); - // Force redgomery representation when loading from JSON - if (isRed) { - this.x.forceRed(this.curve.red); - this.y.forceRed(this.curve.red); - } - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - if (!this.y.red) - this.y = this.y.toRed(this.curve.red); - this.inf = false; - } -} -inherits(Point, Base.BasePoint); - -ShortCurve.prototype.point = function point(x, y, isRed) { - return new Point(this, x, y, isRed); -}; - -ShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) { - return Point.fromJSON(this, obj, red); -}; - -Point.prototype._getBeta = function _getBeta() { - if (!this.curve.endo) - return; - - var pre = this.precomputed; - if (pre && pre.beta) - return pre.beta; - - var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y); - if (pre) { - var curve = this.curve; - var endoMul = function(p) { - return curve.point(p.x.redMul(curve.endo.beta), p.y); - }; - pre.beta = beta; - beta.precomputed = { - beta: null, - naf: pre.naf && { - wnd: pre.naf.wnd, - points: pre.naf.points.map(endoMul) - }, - doubles: pre.doubles && { - step: pre.doubles.step, - points: pre.doubles.points.map(endoMul) - } - }; - } - return beta; -}; - -Point.prototype.toJSON = function toJSON() { - if (!this.precomputed) - return [ this.x, this.y ]; - - return [ this.x, this.y, this.precomputed && { - doubles: this.precomputed.doubles && { - step: this.precomputed.doubles.step, - points: this.precomputed.doubles.points.slice(1) - }, - naf: this.precomputed.naf && { - wnd: this.precomputed.naf.wnd, - points: this.precomputed.naf.points.slice(1) - } - } ]; -}; - -Point.fromJSON = function fromJSON(curve, obj, red) { - if (typeof obj === 'string') - obj = JSON.parse(obj); - var res = curve.point(obj[0], obj[1], red); - if (!obj[2]) - return res; - - function obj2point(obj) { - return curve.point(obj[0], obj[1], red); - } - - var pre = obj[2]; - res.precomputed = { - beta: null, - doubles: pre.doubles && { - step: pre.doubles.step, - points: [ res ].concat(pre.doubles.points.map(obj2point)) - }, - naf: pre.naf && { - wnd: pre.naf.wnd, - points: [ res ].concat(pre.naf.points.map(obj2point)) - } - }; - return res; -}; - -Point.prototype.inspect = function inspect() { - if (this.isInfinity()) - return ''; - return ''; -}; - -Point.prototype.isInfinity = function isInfinity() { - return this.inf; -}; - -Point.prototype.add = function add(p) { - // O + P = P - if (this.inf) - return p; - - // P + O = P - if (p.inf) - return this; - - // P + P = 2P - if (this.eq(p)) - return this.dbl(); - - // P + (-P) = O - if (this.neg().eq(p)) - return this.curve.point(null, null); - - // P + Q = O - if (this.x.cmp(p.x) === 0) - return this.curve.point(null, null); - - var c = this.y.redSub(p.y); - if (c.cmpn(0) !== 0) - c = c.redMul(this.x.redSub(p.x).redInvm()); - var nx = c.redSqr().redISub(this.x).redISub(p.x); - var ny = c.redMul(this.x.redSub(nx)).redISub(this.y); - return this.curve.point(nx, ny); -}; - -Point.prototype.dbl = function dbl() { - if (this.inf) - return this; - - // 2P = O - var ys1 = this.y.redAdd(this.y); - if (ys1.cmpn(0) === 0) - return this.curve.point(null, null); - - var a = this.curve.a; - - var x2 = this.x.redSqr(); - var dyinv = ys1.redInvm(); - var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv); - - var nx = c.redSqr().redISub(this.x.redAdd(this.x)); - var ny = c.redMul(this.x.redSub(nx)).redISub(this.y); - return this.curve.point(nx, ny); -}; - -Point.prototype.getX = function getX() { - return this.x.fromRed(); -}; - -Point.prototype.getY = function getY() { - return this.y.fromRed(); -}; - -Point.prototype.mul = function mul(k) { - k = new BN(k, 16); - - if (this._hasDoubles(k)) - return this.curve._fixedNafMul(this, k); - else if (this.curve.endo) - return this.curve._endoWnafMulAdd([ this ], [ k ]); - else - return this.curve._wnafMul(this, k); -}; - -Point.prototype.mulAdd = function mulAdd(k1, p2, k2) { - var points = [ this, p2 ]; - var coeffs = [ k1, k2 ]; - if (this.curve.endo) - return this.curve._endoWnafMulAdd(points, coeffs); - else - return this.curve._wnafMulAdd(1, points, coeffs, 2); -}; - -Point.prototype.jmulAdd = function jmulAdd(k1, p2, k2) { - var points = [ this, p2 ]; - var coeffs = [ k1, k2 ]; - if (this.curve.endo) - return this.curve._endoWnafMulAdd(points, coeffs, true); - else - return this.curve._wnafMulAdd(1, points, coeffs, 2, true); -}; - -Point.prototype.eq = function eq(p) { - return this === p || - this.inf === p.inf && - (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0); -}; - -Point.prototype.neg = function neg(_precompute) { - if (this.inf) - return this; - - var res = this.curve.point(this.x, this.y.redNeg()); - if (_precompute && this.precomputed) { - var pre = this.precomputed; - var negate = function(p) { - return p.neg(); - }; - res.precomputed = { - naf: pre.naf && { - wnd: pre.naf.wnd, - points: pre.naf.points.map(negate) - }, - doubles: pre.doubles && { - step: pre.doubles.step, - points: pre.doubles.points.map(negate) - } - }; - } - return res; -}; - -Point.prototype.toJ = function toJ() { - if (this.inf) - return this.curve.jpoint(null, null, null); - - var res = this.curve.jpoint(this.x, this.y, this.curve.one); - return res; -}; - -function JPoint(curve, x, y, z) { - Base.BasePoint.call(this, curve, 'jacobian'); - if (x === null && y === null && z === null) { - this.x = this.curve.one; - this.y = this.curve.one; - this.z = new BN(0); - } else { - this.x = new BN(x, 16); - this.y = new BN(y, 16); - this.z = new BN(z, 16); - } - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - if (!this.y.red) - this.y = this.y.toRed(this.curve.red); - if (!this.z.red) - this.z = this.z.toRed(this.curve.red); - - this.zOne = this.z === this.curve.one; -} -inherits(JPoint, Base.BasePoint); - -ShortCurve.prototype.jpoint = function jpoint(x, y, z) { - return new JPoint(this, x, y, z); -}; - -JPoint.prototype.toP = function toP() { - if (this.isInfinity()) - return this.curve.point(null, null); - - var zinv = this.z.redInvm(); - var zinv2 = zinv.redSqr(); - var ax = this.x.redMul(zinv2); - var ay = this.y.redMul(zinv2).redMul(zinv); - - return this.curve.point(ax, ay); -}; - -JPoint.prototype.neg = function neg() { - return this.curve.jpoint(this.x, this.y.redNeg(), this.z); -}; - -JPoint.prototype.add = function add(p) { - // O + P = P - if (this.isInfinity()) - return p; - - // P + O = P - if (p.isInfinity()) - return this; - - // 12M + 4S + 7A - var pz2 = p.z.redSqr(); - var z2 = this.z.redSqr(); - var u1 = this.x.redMul(pz2); - var u2 = p.x.redMul(z2); - var s1 = this.y.redMul(pz2.redMul(p.z)); - var s2 = p.y.redMul(z2.redMul(this.z)); - - var h = u1.redSub(u2); - var r = s1.redSub(s2); - if (h.cmpn(0) === 0) { - if (r.cmpn(0) !== 0) - return this.curve.jpoint(null, null, null); - else - return this.dbl(); - } - - var h2 = h.redSqr(); - var h3 = h2.redMul(h); - var v = u1.redMul(h2); - - var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v); - var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)); - var nz = this.z.redMul(p.z).redMul(h); - - return this.curve.jpoint(nx, ny, nz); -}; - -JPoint.prototype.mixedAdd = function mixedAdd(p) { - // O + P = P - if (this.isInfinity()) - return p.toJ(); - - // P + O = P - if (p.isInfinity()) - return this; - - // 8M + 3S + 7A - var z2 = this.z.redSqr(); - var u1 = this.x; - var u2 = p.x.redMul(z2); - var s1 = this.y; - var s2 = p.y.redMul(z2).redMul(this.z); - - var h = u1.redSub(u2); - var r = s1.redSub(s2); - if (h.cmpn(0) === 0) { - if (r.cmpn(0) !== 0) - return this.curve.jpoint(null, null, null); - else - return this.dbl(); - } - - var h2 = h.redSqr(); - var h3 = h2.redMul(h); - var v = u1.redMul(h2); - - var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v); - var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)); - var nz = this.z.redMul(h); - - return this.curve.jpoint(nx, ny, nz); -}; - -JPoint.prototype.dblp = function dblp(pow) { - if (pow === 0) - return this; - if (this.isInfinity()) - return this; - if (!pow) - return this.dbl(); - - if (this.curve.zeroA || this.curve.threeA) { - var r = this; - for (var i = 0; i < pow; i++) - r = r.dbl(); - return r; - } - - // 1M + 2S + 1A + N * (4S + 5M + 8A) - // N = 1 => 6M + 6S + 9A - var a = this.curve.a; - var tinv = this.curve.tinv; - - var jx = this.x; - var jy = this.y; - var jz = this.z; - var jz4 = jz.redSqr().redSqr(); - - // Reuse results - var jyd = jy.redAdd(jy); - for (var i = 0; i < pow; i++) { - var jx2 = jx.redSqr(); - var jyd2 = jyd.redSqr(); - var jyd4 = jyd2.redSqr(); - var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)); - - var t1 = jx.redMul(jyd2); - var nx = c.redSqr().redISub(t1.redAdd(t1)); - var t2 = t1.redISub(nx); - var dny = c.redMul(t2); - dny = dny.redIAdd(dny).redISub(jyd4); - var nz = jyd.redMul(jz); - if (i + 1 < pow) - jz4 = jz4.redMul(jyd4); - - jx = nx; - jz = nz; - jyd = dny; - } - - return this.curve.jpoint(jx, jyd.redMul(tinv), jz); -}; - -JPoint.prototype.dbl = function dbl() { - if (this.isInfinity()) - return this; - - if (this.curve.zeroA) - return this._zeroDbl(); - else if (this.curve.threeA) - return this._threeDbl(); - else - return this._dbl(); -}; - -JPoint.prototype._zeroDbl = function _zeroDbl() { - var nx; - var ny; - var nz; - // Z = 1 - if (this.zOne) { - // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html - // #doubling-mdbl-2007-bl - // 1M + 5S + 14A - - // XX = X1^2 - var xx = this.x.redSqr(); - // YY = Y1^2 - var yy = this.y.redSqr(); - // YYYY = YY^2 - var yyyy = yy.redSqr(); - // S = 2 * ((X1 + YY)^2 - XX - YYYY) - var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); - s = s.redIAdd(s); - // M = 3 * XX + a; a = 0 - var m = xx.redAdd(xx).redIAdd(xx); - // T = M ^ 2 - 2*S - var t = m.redSqr().redISub(s).redISub(s); - - // 8 * YYYY - var yyyy8 = yyyy.redIAdd(yyyy); - yyyy8 = yyyy8.redIAdd(yyyy8); - yyyy8 = yyyy8.redIAdd(yyyy8); - - // X3 = T - nx = t; - // Y3 = M * (S - T) - 8 * YYYY - ny = m.redMul(s.redISub(t)).redISub(yyyy8); - // Z3 = 2*Y1 - nz = this.y.redAdd(this.y); - } else { - // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html - // #doubling-dbl-2009-l - // 2M + 5S + 13A - - // A = X1^2 - var a = this.x.redSqr(); - // B = Y1^2 - var b = this.y.redSqr(); - // C = B^2 - var c = b.redSqr(); - // D = 2 * ((X1 + B)^2 - A - C) - var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c); - d = d.redIAdd(d); - // E = 3 * A - var e = a.redAdd(a).redIAdd(a); - // F = E^2 - var f = e.redSqr(); - - // 8 * C - var c8 = c.redIAdd(c); - c8 = c8.redIAdd(c8); - c8 = c8.redIAdd(c8); - - // X3 = F - 2 * D - nx = f.redISub(d).redISub(d); - // Y3 = E * (D - X3) - 8 * C - ny = e.redMul(d.redISub(nx)).redISub(c8); - // Z3 = 2 * Y1 * Z1 - nz = this.y.redMul(this.z); - nz = nz.redIAdd(nz); - } - - return this.curve.jpoint(nx, ny, nz); -}; - -JPoint.prototype._threeDbl = function _threeDbl() { - var nx; - var ny; - var nz; - // Z = 1 - if (this.zOne) { - // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html - // #doubling-mdbl-2007-bl - // 1M + 5S + 15A - - // XX = X1^2 - var xx = this.x.redSqr(); - // YY = Y1^2 - var yy = this.y.redSqr(); - // YYYY = YY^2 - var yyyy = yy.redSqr(); - // S = 2 * ((X1 + YY)^2 - XX - YYYY) - var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); - s = s.redIAdd(s); - // M = 3 * XX + a - var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a); - // T = M^2 - 2 * S - var t = m.redSqr().redISub(s).redISub(s); - // X3 = T - nx = t; - // Y3 = M * (S - T) - 8 * YYYY - var yyyy8 = yyyy.redIAdd(yyyy); - yyyy8 = yyyy8.redIAdd(yyyy8); - yyyy8 = yyyy8.redIAdd(yyyy8); - ny = m.redMul(s.redISub(t)).redISub(yyyy8); - // Z3 = 2 * Y1 - nz = this.y.redAdd(this.y); - } else { - // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b - // 3M + 5S - - // delta = Z1^2 - var delta = this.z.redSqr(); - // gamma = Y1^2 - var gamma = this.y.redSqr(); - // beta = X1 * gamma - var beta = this.x.redMul(gamma); - // alpha = 3 * (X1 - delta) * (X1 + delta) - var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta)); - alpha = alpha.redAdd(alpha).redIAdd(alpha); - // X3 = alpha^2 - 8 * beta - var beta4 = beta.redIAdd(beta); - beta4 = beta4.redIAdd(beta4); - var beta8 = beta4.redAdd(beta4); - nx = alpha.redSqr().redISub(beta8); - // Z3 = (Y1 + Z1)^2 - gamma - delta - nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta); - // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2 - var ggamma8 = gamma.redSqr(); - ggamma8 = ggamma8.redIAdd(ggamma8); - ggamma8 = ggamma8.redIAdd(ggamma8); - ggamma8 = ggamma8.redIAdd(ggamma8); - ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8); - } - - return this.curve.jpoint(nx, ny, nz); -}; - -JPoint.prototype._dbl = function _dbl() { - var a = this.curve.a; - - // 4M + 6S + 10A - var jx = this.x; - var jy = this.y; - var jz = this.z; - var jz4 = jz.redSqr().redSqr(); - - var jx2 = jx.redSqr(); - var jy2 = jy.redSqr(); - - var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4)); - - var jxd4 = jx.redAdd(jx); - jxd4 = jxd4.redIAdd(jxd4); - var t1 = jxd4.redMul(jy2); - var nx = c.redSqr().redISub(t1.redAdd(t1)); - var t2 = t1.redISub(nx); - - var jyd8 = jy2.redSqr(); - jyd8 = jyd8.redIAdd(jyd8); - jyd8 = jyd8.redIAdd(jyd8); - jyd8 = jyd8.redIAdd(jyd8); - var ny = c.redMul(t2).redISub(jyd8); - var nz = jy.redAdd(jy).redMul(jz); - - return this.curve.jpoint(nx, ny, nz); -}; - -JPoint.prototype.trpl = function trpl() { - if (!this.curve.zeroA) - return this.dbl().add(this); - - // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl - // 5M + 10S + ... - - // XX = X1^2 - var xx = this.x.redSqr(); - // YY = Y1^2 - var yy = this.y.redSqr(); - // ZZ = Z1^2 - var zz = this.z.redSqr(); - // YYYY = YY^2 - var yyyy = yy.redSqr(); - // M = 3 * XX + a * ZZ2; a = 0 - var m = xx.redAdd(xx).redIAdd(xx); - // MM = M^2 - var mm = m.redSqr(); - // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM - var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); - e = e.redIAdd(e); - e = e.redAdd(e).redIAdd(e); - e = e.redISub(mm); - // EE = E^2 - var ee = e.redSqr(); - // T = 16*YYYY - var t = yyyy.redIAdd(yyyy); - t = t.redIAdd(t); - t = t.redIAdd(t); - t = t.redIAdd(t); - // U = (M + E)^2 - MM - EE - T - var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t); - // X3 = 4 * (X1 * EE - 4 * YY * U) - var yyu4 = yy.redMul(u); - yyu4 = yyu4.redIAdd(yyu4); - yyu4 = yyu4.redIAdd(yyu4); - var nx = this.x.redMul(ee).redISub(yyu4); - nx = nx.redIAdd(nx); - nx = nx.redIAdd(nx); - // Y3 = 8 * Y1 * (U * (T - U) - E * EE) - var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee))); - ny = ny.redIAdd(ny); - ny = ny.redIAdd(ny); - ny = ny.redIAdd(ny); - // Z3 = (Z1 + E)^2 - ZZ - EE - var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee); - - return this.curve.jpoint(nx, ny, nz); -}; - -JPoint.prototype.mul = function mul(k, kbase) { - k = new BN(k, kbase); - - return this.curve._wnafMul(this, k); -}; - -JPoint.prototype.eq = function eq(p) { - if (p.type === 'affine') - return this.eq(p.toJ()); - - if (this === p) - return true; - - // x1 * z2^2 == x2 * z1^2 - var z2 = this.z.redSqr(); - var pz2 = p.z.redSqr(); - if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0) - return false; - - // y1 * z2^3 == y2 * z1^3 - var z3 = z2.redMul(this.z); - var pz3 = pz2.redMul(p.z); - return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0; -}; - -JPoint.prototype.eqXToP = function eqXToP(x) { - var zs = this.z.redSqr(); - var rx = x.toRed(this.curve.red).redMul(zs); - if (this.x.cmp(rx) === 0) - return true; - - var xc = x.clone(); - var t = this.curve.redN.redMul(zs); - for (;;) { - xc.iadd(this.curve.n); - if (xc.cmp(this.curve.p) >= 0) - return false; - - rx.redIAdd(t); - if (this.x.cmp(rx) === 0) - return true; - } -}; - -JPoint.prototype.inspect = function inspect() { - if (this.isInfinity()) - return ''; - return ''; -}; - -JPoint.prototype.isInfinity = function isInfinity() { - // XXX This code assumes that zero is always zero in red - return this.z.cmpn(0) === 0; -}; diff --git a/node_modules/elliptic/lib/elliptic/curves.js b/node_modules/elliptic/lib/elliptic/curves.js deleted file mode 100644 index 0614c0073..000000000 --- a/node_modules/elliptic/lib/elliptic/curves.js +++ /dev/null @@ -1,205 +0,0 @@ -'use strict'; - -var curves = exports; - -var hash = require('hash.js'); -var elliptic = require('../elliptic'); - -var assert = elliptic.utils.assert; - -function PresetCurve(options) { - if (options.type === 'short') - this.curve = new elliptic.curve.short(options); - else if (options.type === 'edwards') - this.curve = new elliptic.curve.edwards(options); - else - this.curve = new elliptic.curve.mont(options); - this.g = this.curve.g; - this.n = this.curve.n; - this.hash = options.hash; - - assert(this.g.validate(), 'Invalid curve'); - assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O'); -} -curves.PresetCurve = PresetCurve; - -function defineCurve(name, options) { - Object.defineProperty(curves, name, { - configurable: true, - enumerable: true, - get: function() { - var curve = new PresetCurve(options); - Object.defineProperty(curves, name, { - configurable: true, - enumerable: true, - value: curve - }); - return curve; - } - }); -} - -defineCurve('p192', { - type: 'short', - prime: 'p192', - p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff', - a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc', - b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1', - n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831', - hash: hash.sha256, - gRed: false, - g: [ - '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012', - '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811' - ] -}); - -defineCurve('p224', { - type: 'short', - prime: 'p224', - p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001', - a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe', - b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4', - n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d', - hash: hash.sha256, - gRed: false, - g: [ - 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21', - 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34' - ] -}); - -defineCurve('p256', { - type: 'short', - prime: null, - p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff', - a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc', - b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b', - n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551', - hash: hash.sha256, - gRed: false, - g: [ - '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296', - '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5' - ] -}); - -defineCurve('p384', { - type: 'short', - prime: null, - p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + - 'fffffffe ffffffff 00000000 00000000 ffffffff', - a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + - 'fffffffe ffffffff 00000000 00000000 fffffffc', - b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' + - '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef', - n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' + - 'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973', - hash: hash.sha384, - gRed: false, - g: [ - 'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' + - '5502f25d bf55296c 3a545e38 72760ab7', - '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' + - '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f' - ] -}); - -defineCurve('p521', { - type: 'short', - prime: null, - p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + - 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + - 'ffffffff ffffffff ffffffff ffffffff ffffffff', - a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + - 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + - 'ffffffff ffffffff ffffffff ffffffff fffffffc', - b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' + - '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' + - '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00', - n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + - 'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' + - 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409', - hash: hash.sha512, - gRed: false, - g: [ - '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' + - '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' + - 'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66', - '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' + - '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' + - '3fad0761 353c7086 a272c240 88be9476 9fd16650' - ] -}); - -defineCurve('curve25519', { - type: 'mont', - prime: 'p25519', - p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed', - a: '76d06', - b: '1', - n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed', - hash: hash.sha256, - gRed: false, - g: [ - '9' - ] -}); - -defineCurve('ed25519', { - type: 'edwards', - prime: 'p25519', - p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed', - a: '-1', - c: '1', - // -121665 * (121666^(-1)) (mod P) - d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3', - n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed', - hash: hash.sha256, - gRed: false, - g: [ - '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a', - - // 4/5 - '6666666666666666666666666666666666666666666666666666666666666658' - ] -}); - -var pre; -try { - pre = require('./precomputed/secp256k1'); -} catch (e) { - pre = undefined; -} - -defineCurve('secp256k1', { - type: 'short', - prime: 'k256', - p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f', - a: '0', - b: '7', - n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141', - h: '1', - hash: hash.sha256, - - // Precomputed endomorphism - beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee', - lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72', - basis: [ - { - a: '3086d221a7d46bcde86c90e49284eb15', - b: '-e4437ed6010e88286f547fa90abfe4c3' - }, - { - a: '114ca50f7a8e2f3f657c1108d9d44cfd8', - b: '3086d221a7d46bcde86c90e49284eb15' - } - ], - - gRed: false, - g: [ - '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', - '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8', - pre - ] -}); diff --git a/node_modules/elliptic/lib/elliptic/ec/index.js b/node_modules/elliptic/lib/elliptic/ec/index.js deleted file mode 100644 index 012fa771e..000000000 --- a/node_modules/elliptic/lib/elliptic/ec/index.js +++ /dev/null @@ -1,240 +0,0 @@ -'use strict'; - -var BN = require('bn.js'); -var HmacDRBG = require('hmac-drbg'); -var elliptic = require('../../elliptic'); -var utils = elliptic.utils; -var assert = utils.assert; - -var KeyPair = require('./key'); -var Signature = require('./signature'); - -function EC(options) { - if (!(this instanceof EC)) - return new EC(options); - - // Shortcut `elliptic.ec(curve-name)` - if (typeof options === 'string') { - assert(elliptic.curves.hasOwnProperty(options), 'Unknown curve ' + options); - - options = elliptic.curves[options]; - } - - // Shortcut for `elliptic.ec(elliptic.curves.curveName)` - if (options instanceof elliptic.curves.PresetCurve) - options = { curve: options }; - - this.curve = options.curve.curve; - this.n = this.curve.n; - this.nh = this.n.ushrn(1); - this.g = this.curve.g; - - // Point on curve - this.g = options.curve.g; - this.g.precompute(options.curve.n.bitLength() + 1); - - // Hash for function for DRBG - this.hash = options.hash || options.curve.hash; -} -module.exports = EC; - -EC.prototype.keyPair = function keyPair(options) { - return new KeyPair(this, options); -}; - -EC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) { - return KeyPair.fromPrivate(this, priv, enc); -}; - -EC.prototype.keyFromPublic = function keyFromPublic(pub, enc) { - return KeyPair.fromPublic(this, pub, enc); -}; - -EC.prototype.genKeyPair = function genKeyPair(options) { - if (!options) - options = {}; - - // Instantiate Hmac_DRBG - var drbg = new HmacDRBG({ - hash: this.hash, - pers: options.pers, - persEnc: options.persEnc || 'utf8', - entropy: options.entropy || elliptic.rand(this.hash.hmacStrength), - entropyEnc: options.entropy && options.entropyEnc || 'utf8', - nonce: this.n.toArray() - }); - - var bytes = this.n.byteLength(); - var ns2 = this.n.sub(new BN(2)); - do { - var priv = new BN(drbg.generate(bytes)); - if (priv.cmp(ns2) > 0) - continue; - - priv.iaddn(1); - return this.keyFromPrivate(priv); - } while (true); -}; - -EC.prototype._truncateToN = function truncateToN(msg, truncOnly) { - var delta = msg.byteLength() * 8 - this.n.bitLength(); - if (delta > 0) - msg = msg.ushrn(delta); - if (!truncOnly && msg.cmp(this.n) >= 0) - return msg.sub(this.n); - else - return msg; -}; - -EC.prototype.sign = function sign(msg, key, enc, options) { - if (typeof enc === 'object') { - options = enc; - enc = null; - } - if (!options) - options = {}; - - key = this.keyFromPrivate(key, enc); - msg = this._truncateToN(new BN(msg, 16)); - - // Zero-extend key to provide enough entropy - var bytes = this.n.byteLength(); - var bkey = key.getPrivate().toArray('be', bytes); - - // Zero-extend nonce to have the same byte size as N - var nonce = msg.toArray('be', bytes); - - // Instantiate Hmac_DRBG - var drbg = new HmacDRBG({ - hash: this.hash, - entropy: bkey, - nonce: nonce, - pers: options.pers, - persEnc: options.persEnc || 'utf8' - }); - - // Number of bytes to generate - var ns1 = this.n.sub(new BN(1)); - - for (var iter = 0; true; iter++) { - var k = options.k ? - options.k(iter) : - new BN(drbg.generate(this.n.byteLength())); - k = this._truncateToN(k, true); - if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0) - continue; - - var kp = this.g.mul(k); - if (kp.isInfinity()) - continue; - - var kpX = kp.getX(); - var r = kpX.umod(this.n); - if (r.cmpn(0) === 0) - continue; - - var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg)); - s = s.umod(this.n); - if (s.cmpn(0) === 0) - continue; - - var recoveryParam = (kp.getY().isOdd() ? 1 : 0) | - (kpX.cmp(r) !== 0 ? 2 : 0); - - // Use complement of `s`, if it is > `n / 2` - if (options.canonical && s.cmp(this.nh) > 0) { - s = this.n.sub(s); - recoveryParam ^= 1; - } - - return new Signature({ r: r, s: s, recoveryParam: recoveryParam }); - } -}; - -EC.prototype.verify = function verify(msg, signature, key, enc) { - msg = this._truncateToN(new BN(msg, 16)); - key = this.keyFromPublic(key, enc); - signature = new Signature(signature, 'hex'); - - // Perform primitive values validation - var r = signature.r; - var s = signature.s; - if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0) - return false; - if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0) - return false; - - // Validate signature - var sinv = s.invm(this.n); - var u1 = sinv.mul(msg).umod(this.n); - var u2 = sinv.mul(r).umod(this.n); - - if (!this.curve._maxwellTrick) { - var p = this.g.mulAdd(u1, key.getPublic(), u2); - if (p.isInfinity()) - return false; - - return p.getX().umod(this.n).cmp(r) === 0; - } - - // NOTE: Greg Maxwell's trick, inspired by: - // https://git.io/vad3K - - var p = this.g.jmulAdd(u1, key.getPublic(), u2); - if (p.isInfinity()) - return false; - - // Compare `p.x` of Jacobian point with `r`, - // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the - // inverse of `p.z^2` - return p.eqXToP(r); -}; - -EC.prototype.recoverPubKey = function(msg, signature, j, enc) { - assert((3 & j) === j, 'The recovery param is more than two bits'); - signature = new Signature(signature, enc); - - var n = this.n; - var e = new BN(msg); - var r = signature.r; - var s = signature.s; - - // A set LSB signifies that the y-coordinate is odd - var isYOdd = j & 1; - var isSecondKey = j >> 1; - if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey) - throw new Error('Unable to find sencond key candinate'); - - // 1.1. Let x = r + jn. - if (isSecondKey) - r = this.curve.pointFromX(r.add(this.curve.n), isYOdd); - else - r = this.curve.pointFromX(r, isYOdd); - - var rInv = signature.r.invm(n); - var s1 = n.sub(e).mul(rInv).umod(n); - var s2 = s.mul(rInv).umod(n); - - // 1.6.1 Compute Q = r^-1 (sR - eG) - // Q = r^-1 (sR + -eG) - return this.g.mulAdd(s1, r, s2); -}; - -EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) { - signature = new Signature(signature, enc); - if (signature.recoveryParam !== null) - return signature.recoveryParam; - - for (var i = 0; i < 4; i++) { - var Qprime; - try { - Qprime = this.recoverPubKey(e, signature, i); - } catch (e) { - continue; - } - - if (Qprime.eq(Q)) - return i; - } - throw new Error('Unable to find valid recovery factor'); -}; diff --git a/node_modules/elliptic/lib/elliptic/ec/key.js b/node_modules/elliptic/lib/elliptic/ec/key.js deleted file mode 100644 index e0f448326..000000000 --- a/node_modules/elliptic/lib/elliptic/ec/key.js +++ /dev/null @@ -1,119 +0,0 @@ -'use strict'; - -var BN = require('bn.js'); -var elliptic = require('../../elliptic'); -var utils = elliptic.utils; -var assert = utils.assert; - -function KeyPair(ec, options) { - this.ec = ec; - this.priv = null; - this.pub = null; - - // KeyPair(ec, { priv: ..., pub: ... }) - if (options.priv) - this._importPrivate(options.priv, options.privEnc); - if (options.pub) - this._importPublic(options.pub, options.pubEnc); -} -module.exports = KeyPair; - -KeyPair.fromPublic = function fromPublic(ec, pub, enc) { - if (pub instanceof KeyPair) - return pub; - - return new KeyPair(ec, { - pub: pub, - pubEnc: enc - }); -}; - -KeyPair.fromPrivate = function fromPrivate(ec, priv, enc) { - if (priv instanceof KeyPair) - return priv; - - return new KeyPair(ec, { - priv: priv, - privEnc: enc - }); -}; - -KeyPair.prototype.validate = function validate() { - var pub = this.getPublic(); - - if (pub.isInfinity()) - return { result: false, reason: 'Invalid public key' }; - if (!pub.validate()) - return { result: false, reason: 'Public key is not a point' }; - if (!pub.mul(this.ec.curve.n).isInfinity()) - return { result: false, reason: 'Public key * N != O' }; - - return { result: true, reason: null }; -}; - -KeyPair.prototype.getPublic = function getPublic(compact, enc) { - // compact is optional argument - if (typeof compact === 'string') { - enc = compact; - compact = null; - } - - if (!this.pub) - this.pub = this.ec.g.mul(this.priv); - - if (!enc) - return this.pub; - - return this.pub.encode(enc, compact); -}; - -KeyPair.prototype.getPrivate = function getPrivate(enc) { - if (enc === 'hex') - return this.priv.toString(16, 2); - else - return this.priv; -}; - -KeyPair.prototype._importPrivate = function _importPrivate(key, enc) { - this.priv = new BN(key, enc || 16); - - // Ensure that the priv won't be bigger than n, otherwise we may fail - // in fixed multiplication method - this.priv = this.priv.umod(this.ec.curve.n); -}; - -KeyPair.prototype._importPublic = function _importPublic(key, enc) { - if (key.x || key.y) { - // Montgomery points only have an `x` coordinate. - // Weierstrass/Edwards points on the other hand have both `x` and - // `y` coordinates. - if (this.ec.curve.type === 'mont') { - assert(key.x, 'Need x coordinate'); - } else if (this.ec.curve.type === 'short' || - this.ec.curve.type === 'edwards') { - assert(key.x && key.y, 'Need both x and y coordinate'); - } - this.pub = this.ec.curve.point(key.x, key.y); - return; - } - this.pub = this.ec.curve.decodePoint(key, enc); -}; - -// ECDH -KeyPair.prototype.derive = function derive(pub) { - return pub.mul(this.priv).getX(); -}; - -// ECDSA -KeyPair.prototype.sign = function sign(msg, enc, options) { - return this.ec.sign(msg, this, enc, options); -}; - -KeyPair.prototype.verify = function verify(msg, signature) { - return this.ec.verify(msg, signature, this); -}; - -KeyPair.prototype.inspect = function inspect() { - return ''; -}; diff --git a/node_modules/elliptic/lib/elliptic/ec/signature.js b/node_modules/elliptic/lib/elliptic/ec/signature.js deleted file mode 100644 index 165b179a8..000000000 --- a/node_modules/elliptic/lib/elliptic/ec/signature.js +++ /dev/null @@ -1,135 +0,0 @@ -'use strict'; - -var BN = require('bn.js'); - -var elliptic = require('../../elliptic'); -var utils = elliptic.utils; -var assert = utils.assert; - -function Signature(options, enc) { - if (options instanceof Signature) - return options; - - if (this._importDER(options, enc)) - return; - - assert(options.r && options.s, 'Signature without r or s'); - this.r = new BN(options.r, 16); - this.s = new BN(options.s, 16); - if (options.recoveryParam === undefined) - this.recoveryParam = null; - else - this.recoveryParam = options.recoveryParam; -} -module.exports = Signature; - -function Position() { - this.place = 0; -} - -function getLength(buf, p) { - var initial = buf[p.place++]; - if (!(initial & 0x80)) { - return initial; - } - var octetLen = initial & 0xf; - var val = 0; - for (var i = 0, off = p.place; i < octetLen; i++, off++) { - val <<= 8; - val |= buf[off]; - } - p.place = off; - return val; -} - -function rmPadding(buf) { - var i = 0; - var len = buf.length - 1; - while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) { - i++; - } - if (i === 0) { - return buf; - } - return buf.slice(i); -} - -Signature.prototype._importDER = function _importDER(data, enc) { - data = utils.toArray(data, enc); - var p = new Position(); - if (data[p.place++] !== 0x30) { - return false; - } - var len = getLength(data, p); - if ((len + p.place) !== data.length) { - return false; - } - if (data[p.place++] !== 0x02) { - return false; - } - var rlen = getLength(data, p); - var r = data.slice(p.place, rlen + p.place); - p.place += rlen; - if (data[p.place++] !== 0x02) { - return false; - } - var slen = getLength(data, p); - if (data.length !== slen + p.place) { - return false; - } - var s = data.slice(p.place, slen + p.place); - if (r[0] === 0 && (r[1] & 0x80)) { - r = r.slice(1); - } - if (s[0] === 0 && (s[1] & 0x80)) { - s = s.slice(1); - } - - this.r = new BN(r); - this.s = new BN(s); - this.recoveryParam = null; - - return true; -}; - -function constructLength(arr, len) { - if (len < 0x80) { - arr.push(len); - return; - } - var octets = 1 + (Math.log(len) / Math.LN2 >>> 3); - arr.push(octets | 0x80); - while (--octets) { - arr.push((len >>> (octets << 3)) & 0xff); - } - arr.push(len); -} - -Signature.prototype.toDER = function toDER(enc) { - var r = this.r.toArray(); - var s = this.s.toArray(); - - // Pad values - if (r[0] & 0x80) - r = [ 0 ].concat(r); - // Pad values - if (s[0] & 0x80) - s = [ 0 ].concat(s); - - r = rmPadding(r); - s = rmPadding(s); - - while (!s[0] && !(s[1] & 0x80)) { - s = s.slice(1); - } - var arr = [ 0x02 ]; - constructLength(arr, r.length); - arr = arr.concat(r); - arr.push(0x02); - constructLength(arr, s.length); - var backHalf = arr.concat(s); - var res = [ 0x30 ]; - constructLength(res, backHalf.length); - res = res.concat(backHalf); - return utils.encode(res, enc); -}; diff --git a/node_modules/elliptic/lib/elliptic/eddsa/index.js b/node_modules/elliptic/lib/elliptic/eddsa/index.js deleted file mode 100644 index b218a1607..000000000 --- a/node_modules/elliptic/lib/elliptic/eddsa/index.js +++ /dev/null @@ -1,118 +0,0 @@ -'use strict'; - -var hash = require('hash.js'); -var elliptic = require('../../elliptic'); -var utils = elliptic.utils; -var assert = utils.assert; -var parseBytes = utils.parseBytes; -var KeyPair = require('./key'); -var Signature = require('./signature'); - -function EDDSA(curve) { - assert(curve === 'ed25519', 'only tested with ed25519 so far'); - - if (!(this instanceof EDDSA)) - return new EDDSA(curve); - - var curve = elliptic.curves[curve].curve; - this.curve = curve; - this.g = curve.g; - this.g.precompute(curve.n.bitLength() + 1); - - this.pointClass = curve.point().constructor; - this.encodingLength = Math.ceil(curve.n.bitLength() / 8); - this.hash = hash.sha512; -} - -module.exports = EDDSA; - -/** -* @param {Array|String} message - message bytes -* @param {Array|String|KeyPair} secret - secret bytes or a keypair -* @returns {Signature} - signature -*/ -EDDSA.prototype.sign = function sign(message, secret) { - message = parseBytes(message); - var key = this.keyFromSecret(secret); - var r = this.hashInt(key.messagePrefix(), message); - var R = this.g.mul(r); - var Rencoded = this.encodePoint(R); - var s_ = this.hashInt(Rencoded, key.pubBytes(), message) - .mul(key.priv()); - var S = r.add(s_).umod(this.curve.n); - return this.makeSignature({ R: R, S: S, Rencoded: Rencoded }); -}; - -/** -* @param {Array} message - message bytes -* @param {Array|String|Signature} sig - sig bytes -* @param {Array|String|Point|KeyPair} pub - public key -* @returns {Boolean} - true if public key matches sig of message -*/ -EDDSA.prototype.verify = function verify(message, sig, pub) { - message = parseBytes(message); - sig = this.makeSignature(sig); - var key = this.keyFromPublic(pub); - var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message); - var SG = this.g.mul(sig.S()); - var RplusAh = sig.R().add(key.pub().mul(h)); - return RplusAh.eq(SG); -}; - -EDDSA.prototype.hashInt = function hashInt() { - var hash = this.hash(); - for (var i = 0; i < arguments.length; i++) - hash.update(arguments[i]); - return utils.intFromLE(hash.digest()).umod(this.curve.n); -}; - -EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) { - return KeyPair.fromPublic(this, pub); -}; - -EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) { - return KeyPair.fromSecret(this, secret); -}; - -EDDSA.prototype.makeSignature = function makeSignature(sig) { - if (sig instanceof Signature) - return sig; - return new Signature(this, sig); -}; - -/** -* * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2 -* -* EDDSA defines methods for encoding and decoding points and integers. These are -* helper convenience methods, that pass along to utility functions implied -* parameters. -* -*/ -EDDSA.prototype.encodePoint = function encodePoint(point) { - var enc = point.getY().toArray('le', this.encodingLength); - enc[this.encodingLength - 1] |= point.getX().isOdd() ? 0x80 : 0; - return enc; -}; - -EDDSA.prototype.decodePoint = function decodePoint(bytes) { - bytes = utils.parseBytes(bytes); - - var lastIx = bytes.length - 1; - var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80); - var xIsOdd = (bytes[lastIx] & 0x80) !== 0; - - var y = utils.intFromLE(normed); - return this.curve.pointFromY(y, xIsOdd); -}; - -EDDSA.prototype.encodeInt = function encodeInt(num) { - return num.toArray('le', this.encodingLength); -}; - -EDDSA.prototype.decodeInt = function decodeInt(bytes) { - return utils.intFromLE(bytes); -}; - -EDDSA.prototype.isPoint = function isPoint(val) { - return val instanceof this.pointClass; -}; diff --git a/node_modules/elliptic/lib/elliptic/eddsa/key.js b/node_modules/elliptic/lib/elliptic/eddsa/key.js deleted file mode 100644 index 5d5e14274..000000000 --- a/node_modules/elliptic/lib/elliptic/eddsa/key.js +++ /dev/null @@ -1,96 +0,0 @@ -'use strict'; - -var elliptic = require('../../elliptic'); -var utils = elliptic.utils; -var assert = utils.assert; -var parseBytes = utils.parseBytes; -var cachedProperty = utils.cachedProperty; - -/** -* @param {EDDSA} eddsa - instance -* @param {Object} params - public/private key parameters -* -* @param {Array} [params.secret] - secret seed bytes -* @param {Point} [params.pub] - public key point (aka `A` in eddsa terms) -* @param {Array} [params.pub] - public key point encoded as bytes -* -*/ -function KeyPair(eddsa, params) { - this.eddsa = eddsa; - this._secret = parseBytes(params.secret); - if (eddsa.isPoint(params.pub)) - this._pub = params.pub; - else - this._pubBytes = parseBytes(params.pub); -} - -KeyPair.fromPublic = function fromPublic(eddsa, pub) { - if (pub instanceof KeyPair) - return pub; - return new KeyPair(eddsa, { pub: pub }); -}; - -KeyPair.fromSecret = function fromSecret(eddsa, secret) { - if (secret instanceof KeyPair) - return secret; - return new KeyPair(eddsa, { secret: secret }); -}; - -KeyPair.prototype.secret = function secret() { - return this._secret; -}; - -cachedProperty(KeyPair, 'pubBytes', function pubBytes() { - return this.eddsa.encodePoint(this.pub()); -}); - -cachedProperty(KeyPair, 'pub', function pub() { - if (this._pubBytes) - return this.eddsa.decodePoint(this._pubBytes); - return this.eddsa.g.mul(this.priv()); -}); - -cachedProperty(KeyPair, 'privBytes', function privBytes() { - var eddsa = this.eddsa; - var hash = this.hash(); - var lastIx = eddsa.encodingLength - 1; - - var a = hash.slice(0, eddsa.encodingLength); - a[0] &= 248; - a[lastIx] &= 127; - a[lastIx] |= 64; - - return a; -}); - -cachedProperty(KeyPair, 'priv', function priv() { - return this.eddsa.decodeInt(this.privBytes()); -}); - -cachedProperty(KeyPair, 'hash', function hash() { - return this.eddsa.hash().update(this.secret()).digest(); -}); - -cachedProperty(KeyPair, 'messagePrefix', function messagePrefix() { - return this.hash().slice(this.eddsa.encodingLength); -}); - -KeyPair.prototype.sign = function sign(message) { - assert(this._secret, 'KeyPair can only verify'); - return this.eddsa.sign(message, this); -}; - -KeyPair.prototype.verify = function verify(message, sig) { - return this.eddsa.verify(message, sig, this); -}; - -KeyPair.prototype.getSecret = function getSecret(enc) { - assert(this._secret, 'KeyPair is public only'); - return utils.encode(this.secret(), enc); -}; - -KeyPair.prototype.getPublic = function getPublic(enc) { - return utils.encode(this.pubBytes(), enc); -}; - -module.exports = KeyPair; diff --git a/node_modules/elliptic/lib/elliptic/eddsa/signature.js b/node_modules/elliptic/lib/elliptic/eddsa/signature.js deleted file mode 100644 index e944e8152..000000000 --- a/node_modules/elliptic/lib/elliptic/eddsa/signature.js +++ /dev/null @@ -1,66 +0,0 @@ -'use strict'; - -var BN = require('bn.js'); -var elliptic = require('../../elliptic'); -var utils = elliptic.utils; -var assert = utils.assert; -var cachedProperty = utils.cachedProperty; -var parseBytes = utils.parseBytes; - -/** -* @param {EDDSA} eddsa - eddsa instance -* @param {Array|Object} sig - -* @param {Array|Point} [sig.R] - R point as Point or bytes -* @param {Array|bn} [sig.S] - S scalar as bn or bytes -* @param {Array} [sig.Rencoded] - R point encoded -* @param {Array} [sig.Sencoded] - S scalar encoded -*/ -function Signature(eddsa, sig) { - this.eddsa = eddsa; - - if (typeof sig !== 'object') - sig = parseBytes(sig); - - if (Array.isArray(sig)) { - sig = { - R: sig.slice(0, eddsa.encodingLength), - S: sig.slice(eddsa.encodingLength) - }; - } - - assert(sig.R && sig.S, 'Signature without R or S'); - - if (eddsa.isPoint(sig.R)) - this._R = sig.R; - if (sig.S instanceof BN) - this._S = sig.S; - - this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded; - this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded; -} - -cachedProperty(Signature, 'S', function S() { - return this.eddsa.decodeInt(this.Sencoded()); -}); - -cachedProperty(Signature, 'R', function R() { - return this.eddsa.decodePoint(this.Rencoded()); -}); - -cachedProperty(Signature, 'Rencoded', function Rencoded() { - return this.eddsa.encodePoint(this.R()); -}); - -cachedProperty(Signature, 'Sencoded', function Sencoded() { - return this.eddsa.encodeInt(this.S()); -}); - -Signature.prototype.toBytes = function toBytes() { - return this.Rencoded().concat(this.Sencoded()); -}; - -Signature.prototype.toHex = function toHex() { - return utils.encode(this.toBytes(), 'hex').toUpperCase(); -}; - -module.exports = Signature; diff --git a/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js b/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js deleted file mode 100644 index e4c91e543..000000000 --- a/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js +++ /dev/null @@ -1,780 +0,0 @@ -module.exports = { - doubles: { - step: 4, - points: [ - [ - 'e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a', - 'f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821' - ], - [ - '8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508', - '11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf' - ], - [ - '175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739', - 'd3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695' - ], - [ - '363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640', - '4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9' - ], - [ - '8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c', - '4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36' - ], - [ - '723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda', - '96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f' - ], - [ - 'eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa', - '5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999' - ], - [ - '100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0', - 'cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09' - ], - [ - 'e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d', - '9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d' - ], - [ - 'feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d', - 'e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088' - ], - [ - 'da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1', - '9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d' - ], - [ - '53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0', - '5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8' - ], - [ - '8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047', - '10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a' - ], - [ - '385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862', - '283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453' - ], - [ - '6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7', - '7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160' - ], - [ - '3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd', - '56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0' - ], - [ - '85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83', - '7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6' - ], - [ - '948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a', - '53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589' - ], - [ - '6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8', - 'bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17' - ], - [ - 'e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d', - '4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda' - ], - [ - 'e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725', - '7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd' - ], - [ - '213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754', - '4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2' - ], - [ - '4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c', - '17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6' - ], - [ - 'fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6', - '6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f' - ], - [ - '76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39', - 'c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01' - ], - [ - 'c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891', - '893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3' - ], - [ - 'd895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b', - 'febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f' - ], - [ - 'b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03', - '2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7' - ], - [ - 'e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d', - 'eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78' - ], - [ - 'a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070', - '7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1' - ], - [ - '90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4', - 'e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150' - ], - [ - '8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da', - '662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82' - ], - [ - 'e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11', - '1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc' - ], - [ - '8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e', - 'efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b' - ], - [ - 'e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41', - '2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51' - ], - [ - 'b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef', - '67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45' - ], - [ - 'd68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8', - 'db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120' - ], - [ - '324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d', - '648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84' - ], - [ - '4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96', - '35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d' - ], - [ - '9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd', - 'ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d' - ], - [ - '6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5', - '9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8' - ], - [ - 'a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266', - '40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8' - ], - [ - '7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71', - '34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac' - ], - [ - '928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac', - 'c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f' - ], - [ - '85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751', - '1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962' - ], - [ - 'ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e', - '493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907' - ], - [ - '827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241', - 'c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec' - ], - [ - 'eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3', - 'be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d' - ], - [ - 'e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f', - '4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414' - ], - [ - '1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19', - 'aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd' - ], - [ - '146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be', - 'b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0' - ], - [ - 'fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9', - '6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811' - ], - [ - 'da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2', - '8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1' - ], - [ - 'a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13', - '7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c' - ], - [ - '174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c', - 'ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73' - ], - [ - '959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba', - '2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd' - ], - [ - 'd2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151', - 'e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405' - ], - [ - '64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073', - 'd99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589' - ], - [ - '8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458', - '38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e' - ], - [ - '13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b', - '69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27' - ], - [ - 'bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366', - 'd3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1' - ], - [ - '8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa', - '40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482' - ], - [ - '8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0', - '620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945' - ], - [ - 'dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787', - '7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573' - ], - [ - 'f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e', - 'ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82' - ] - ] - }, - naf: { - wnd: 7, - points: [ - [ - 'f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9', - '388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672' - ], - [ - '2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4', - 'd8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6' - ], - [ - '5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc', - '6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da' - ], - [ - 'acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe', - 'cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37' - ], - [ - '774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb', - 'd984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b' - ], - [ - 'f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8', - 'ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81' - ], - [ - 'd7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e', - '581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58' - ], - [ - 'defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34', - '4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77' - ], - [ - '2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c', - '85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a' - ], - [ - '352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5', - '321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c' - ], - [ - '2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f', - '2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67' - ], - [ - '9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714', - '73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402' - ], - [ - 'daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729', - 'a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55' - ], - [ - 'c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db', - '2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482' - ], - [ - '6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4', - 'e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82' - ], - [ - '1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5', - 'b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396' - ], - [ - '605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479', - '2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49' - ], - [ - '62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d', - '80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf' - ], - [ - '80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f', - '1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a' - ], - [ - '7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb', - 'd0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7' - ], - [ - 'd528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9', - 'eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933' - ], - [ - '49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963', - '758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a' - ], - [ - '77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74', - '958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6' - ], - [ - 'f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530', - 'e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37' - ], - [ - '463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b', - '5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e' - ], - [ - 'f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247', - 'cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6' - ], - [ - 'caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1', - 'cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476' - ], - [ - '2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120', - '4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40' - ], - [ - '7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435', - '91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61' - ], - [ - '754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18', - '673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683' - ], - [ - 'e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8', - '59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5' - ], - [ - '186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb', - '3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b' - ], - [ - 'df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f', - '55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417' - ], - [ - '5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143', - 'efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868' - ], - [ - '290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba', - 'e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a' - ], - [ - 'af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45', - 'f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6' - ], - [ - '766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a', - '744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996' - ], - [ - '59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e', - 'c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e' - ], - [ - 'f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8', - 'e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d' - ], - [ - '7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c', - '30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2' - ], - [ - '948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519', - 'e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e' - ], - [ - '7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab', - '100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437' - ], - [ - '3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca', - 'ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311' - ], - [ - 'd3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf', - '8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4' - ], - [ - '1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610', - '68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575' - ], - [ - '733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4', - 'f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d' - ], - [ - '15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c', - 'd56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d' - ], - [ - 'a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940', - 'edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629' - ], - [ - 'e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980', - 'a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06' - ], - [ - '311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3', - '66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374' - ], - [ - '34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf', - '9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee' - ], - [ - 'f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63', - '4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1' - ], - [ - 'd7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448', - 'fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b' - ], - [ - '32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf', - '5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661' - ], - [ - '7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5', - '8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6' - ], - [ - 'ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6', - '8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e' - ], - [ - '16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5', - '5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d' - ], - [ - 'eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99', - 'f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc' - ], - [ - '78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51', - 'f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4' - ], - [ - '494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5', - '42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c' - ], - [ - 'a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5', - '204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b' - ], - [ - 'c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997', - '4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913' - ], - [ - '841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881', - '73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154' - ], - [ - '5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5', - '39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865' - ], - [ - '36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66', - 'd2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc' - ], - [ - '336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726', - 'ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224' - ], - [ - '8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede', - '6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e' - ], - [ - '1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94', - '60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6' - ], - [ - '85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31', - '3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511' - ], - [ - '29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51', - 'b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b' - ], - [ - 'a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252', - 'ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2' - ], - [ - '4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5', - 'cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c' - ], - [ - 'd24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b', - '6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3' - ], - [ - 'ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4', - '322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d' - ], - [ - 'af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f', - '6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700' - ], - [ - 'e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889', - '2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4' - ], - [ - '591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246', - 'b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196' - ], - [ - '11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984', - '998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4' - ], - [ - '3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a', - 'b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257' - ], - [ - 'cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030', - 'bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13' - ], - [ - 'c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197', - '6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096' - ], - [ - 'c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593', - 'c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38' - ], - [ - 'a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef', - '21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f' - ], - [ - '347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38', - '60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448' - ], - [ - 'da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a', - '49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a' - ], - [ - 'c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111', - '5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4' - ], - [ - '4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502', - '7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437' - ], - [ - '3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea', - 'be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7' - ], - [ - 'cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26', - '8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d' - ], - [ - 'b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986', - '39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a' - ], - [ - 'd4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e', - '62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54' - ], - [ - '48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4', - '25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77' - ], - [ - 'dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda', - 'ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517' - ], - [ - '6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859', - 'cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10' - ], - [ - 'e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f', - 'f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125' - ], - [ - 'eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c', - '6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e' - ], - [ - '13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942', - 'fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1' - ], - [ - 'ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a', - '1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2' - ], - [ - 'b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80', - '5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423' - ], - [ - 'ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d', - '438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8' - ], - [ - '8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1', - 'cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758' - ], - [ - '52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63', - 'c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375' - ], - [ - 'e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352', - '6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d' - ], - [ - '7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193', - 'ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec' - ], - [ - '5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00', - '9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0' - ], - [ - '32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58', - 'ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c' - ], - [ - 'e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7', - 'd3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4' - ], - [ - '8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8', - 'c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f' - ], - [ - '4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e', - '67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649' - ], - [ - '3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d', - 'cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826' - ], - [ - '674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b', - '299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5' - ], - [ - 'd32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f', - 'f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87' - ], - [ - '30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6', - '462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b' - ], - [ - 'be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297', - '62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc' - ], - [ - '93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a', - '7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c' - ], - [ - 'b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c', - 'ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f' - ], - [ - 'd5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52', - '4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a' - ], - [ - 'd3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb', - 'bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46' - ], - [ - '463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065', - 'bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f' - ], - [ - '7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917', - '603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03' - ], - [ - '74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9', - 'cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08' - ], - [ - '30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3', - '553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8' - ], - [ - '9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57', - '712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373' - ], - [ - '176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66', - 'ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3' - ], - [ - '75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8', - '9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8' - ], - [ - '809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721', - '9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1' - ], - [ - '1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180', - '4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9' - ] - ] - } -}; diff --git a/node_modules/elliptic/lib/elliptic/utils.js b/node_modules/elliptic/lib/elliptic/utils.js deleted file mode 100644 index 982738149..000000000 --- a/node_modules/elliptic/lib/elliptic/utils.js +++ /dev/null @@ -1,120 +0,0 @@ -'use strict'; - -var utils = exports; -var BN = require('bn.js'); -var minAssert = require('minimalistic-assert'); -var minUtils = require('minimalistic-crypto-utils'); - -utils.assert = minAssert; -utils.toArray = minUtils.toArray; -utils.zero2 = minUtils.zero2; -utils.toHex = minUtils.toHex; -utils.encode = minUtils.encode; - -// Represent num in a w-NAF form -function getNAF(num, w) { - var naf = []; - var ws = 1 << (w + 1); - var k = num.clone(); - while (k.cmpn(1) >= 0) { - var z; - if (k.isOdd()) { - var mod = k.andln(ws - 1); - if (mod > (ws >> 1) - 1) - z = (ws >> 1) - mod; - else - z = mod; - k.isubn(z); - } else { - z = 0; - } - naf.push(z); - - // Optimization, shift by word if possible - var shift = (k.cmpn(0) !== 0 && k.andln(ws - 1) === 0) ? (w + 1) : 1; - for (var i = 1; i < shift; i++) - naf.push(0); - k.iushrn(shift); - } - - return naf; -} -utils.getNAF = getNAF; - -// Represent k1, k2 in a Joint Sparse Form -function getJSF(k1, k2) { - var jsf = [ - [], - [] - ]; - - k1 = k1.clone(); - k2 = k2.clone(); - var d1 = 0; - var d2 = 0; - while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) { - - // First phase - var m14 = (k1.andln(3) + d1) & 3; - var m24 = (k2.andln(3) + d2) & 3; - if (m14 === 3) - m14 = -1; - if (m24 === 3) - m24 = -1; - var u1; - if ((m14 & 1) === 0) { - u1 = 0; - } else { - var m8 = (k1.andln(7) + d1) & 7; - if ((m8 === 3 || m8 === 5) && m24 === 2) - u1 = -m14; - else - u1 = m14; - } - jsf[0].push(u1); - - var u2; - if ((m24 & 1) === 0) { - u2 = 0; - } else { - var m8 = (k2.andln(7) + d2) & 7; - if ((m8 === 3 || m8 === 5) && m14 === 2) - u2 = -m24; - else - u2 = m24; - } - jsf[1].push(u2); - - // Second phase - if (2 * d1 === u1 + 1) - d1 = 1 - d1; - if (2 * d2 === u2 + 1) - d2 = 1 - d2; - k1.iushrn(1); - k2.iushrn(1); - } - - return jsf; -} -utils.getJSF = getJSF; - -function cachedProperty(obj, name, computer) { - var key = '_' + name; - obj.prototype[name] = function cachedProperty() { - return this[key] !== undefined ? this[key] : - this[key] = computer.call(this); - }; -} -utils.cachedProperty = cachedProperty; - -function parseBytes(bytes) { - return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') : - bytes; -} -utils.parseBytes = parseBytes; - -function intFromLE(bytes) { - return new BN(bytes, 'hex', 'le'); -} -utils.intFromLE = intFromLE; - diff --git a/node_modules/elliptic/package.json b/node_modules/elliptic/package.json deleted file mode 100644 index 884a24bec..000000000 --- a/node_modules/elliptic/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_from": "elliptic@^6.0.0", - "_id": "elliptic@6.4.1", - "_inBundle": false, - "_integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", - "_location": "/elliptic", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "elliptic@^6.0.0", - "name": "elliptic", - "escapedName": "elliptic", - "rawSpec": "^6.0.0", - "saveSpec": null, - "fetchSpec": "^6.0.0" - }, - "_requiredBy": [ - "/browserify-sign", - "/create-ecdh" - ], - "_resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", - "_shasum": "c2d0b7776911b86722c632c3c06c60f2f819939a", - "_spec": "elliptic@^6.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify-sign", - "author": { - "name": "Fedor Indutny", - "email": "fedor@indutny.com" - }, - "bugs": { - "url": "https://github.com/indutny/elliptic/issues" - }, - "bundleDependencies": false, - "dependencies": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" - }, - "deprecated": false, - "description": "EC cryptography", - "devDependencies": { - "brfs": "^1.4.3", - "coveralls": "^2.11.3", - "grunt": "^0.4.5", - "grunt-browserify": "^5.0.0", - "grunt-cli": "^1.2.0", - "grunt-contrib-connect": "^1.0.0", - "grunt-contrib-copy": "^1.0.0", - "grunt-contrib-uglify": "^1.0.1", - "grunt-mocha-istanbul": "^3.0.1", - "grunt-saucelabs": "^8.6.2", - "istanbul": "^0.4.2", - "jscs": "^2.9.0", - "jshint": "^2.6.0", - "mocha": "^2.1.0" - }, - "files": [ - "lib" - ], - "homepage": "https://github.com/indutny/elliptic", - "keywords": [ - "EC", - "Elliptic", - "curve", - "Cryptography" - ], - "license": "MIT", - "main": "lib/elliptic.js", - "name": "elliptic", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/indutny/elliptic.git" - }, - "scripts": { - "jscs": "jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js", - "jshint": "jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js", - "lint": "npm run jscs && npm run jshint", - "test": "npm run lint && npm run unit", - "unit": "istanbul test _mocha --reporter=spec test/index.js", - "version": "grunt dist && git add dist/" - }, - "version": "6.4.1" -} diff --git a/node_modules/encodeurl/HISTORY.md b/node_modules/encodeurl/HISTORY.md deleted file mode 100644 index 41313b2b3..000000000 --- a/node_modules/encodeurl/HISTORY.md +++ /dev/null @@ -1,14 +0,0 @@ -1.0.2 / 2018-01-21 -================== - - * Fix encoding `%` as last character - -1.0.1 / 2016-06-09 -================== - - * Fix encoding unpaired surrogates at start/end of string - -1.0.0 / 2016-06-08 -================== - - * Initial release diff --git a/node_modules/encodeurl/LICENSE b/node_modules/encodeurl/LICENSE deleted file mode 100644 index 8812229bc..000000000 --- a/node_modules/encodeurl/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2016 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/encodeurl/README.md b/node_modules/encodeurl/README.md deleted file mode 100644 index 127c5a0d4..000000000 --- a/node_modules/encodeurl/README.md +++ /dev/null @@ -1,128 +0,0 @@ -# encodeurl - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Encode a URL to a percent-encoded form, excluding already-encoded sequences - -## Installation - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```sh -$ npm install encodeurl -``` - -## API - -```js -var encodeUrl = require('encodeurl') -``` - -### encodeUrl(url) - -Encode a URL to a percent-encoded form, excluding already-encoded sequences. - -This function will take an already-encoded URL and encode all the non-URL -code points (as UTF-8 byte sequences). This function will not encode the -"%" character unless it is not part of a valid sequence (`%20` will be -left as-is, but `%foo` will be encoded as `%25foo`). - -This encode is meant to be "safe" and does not throw errors. It will try as -hard as it can to properly encode the given URL, including replacing any raw, -unpaired surrogate pairs with the Unicode replacement character prior to -encoding. - -This function is _similar_ to the intrinsic function `encodeURI`, except it -will not encode the `%` character if that is part of a valid sequence, will -not encode `[` and `]` (for IPv6 hostnames) and will replace raw, unpaired -surrogate pairs with the Unicode replacement character (instead of throwing). - -## Examples - -### Encode a URL containing user-controled data - -```js -var encodeUrl = require('encodeurl') -var escapeHtml = require('escape-html') - -http.createServer(function onRequest (req, res) { - // get encoded form of inbound url - var url = encodeUrl(req.url) - - // create html message - var body = '

    Location ' + escapeHtml(url) + ' not found

    ' - - // send a 404 - res.statusCode = 404 - res.setHeader('Content-Type', 'text/html; charset=UTF-8') - res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8'))) - res.end(body, 'utf-8') -}) -``` - -### Encode a URL for use in a header field - -```js -var encodeUrl = require('encodeurl') -var escapeHtml = require('escape-html') -var url = require('url') - -http.createServer(function onRequest (req, res) { - // parse inbound url - var href = url.parse(req) - - // set new host for redirect - href.host = 'localhost' - href.protocol = 'https:' - href.slashes = true - - // create location header - var location = encodeUrl(url.format(href)) - - // create html message - var body = '

    Redirecting to new site: ' + escapeHtml(location) + '

    ' - - // send a 301 - res.statusCode = 301 - res.setHeader('Content-Type', 'text/html; charset=UTF-8') - res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8'))) - res.setHeader('Location', location) - res.end(body, 'utf-8') -}) -``` - -## Testing - -```sh -$ npm test -$ npm run lint -``` - -## References - -- [RFC 3986: Uniform Resource Identifier (URI): Generic Syntax][rfc-3986] -- [WHATWG URL Living Standard][whatwg-url] - -[rfc-3986]: https://tools.ietf.org/html/rfc3986 -[whatwg-url]: https://url.spec.whatwg.org/ - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/encodeurl.svg -[npm-url]: https://npmjs.org/package/encodeurl -[node-version-image]: https://img.shields.io/node/v/encodeurl.svg -[node-version-url]: https://nodejs.org/en/download -[travis-image]: https://img.shields.io/travis/pillarjs/encodeurl.svg -[travis-url]: https://travis-ci.org/pillarjs/encodeurl -[coveralls-image]: https://img.shields.io/coveralls/pillarjs/encodeurl.svg -[coveralls-url]: https://coveralls.io/r/pillarjs/encodeurl?branch=master -[downloads-image]: https://img.shields.io/npm/dm/encodeurl.svg -[downloads-url]: https://npmjs.org/package/encodeurl diff --git a/node_modules/encodeurl/index.js b/node_modules/encodeurl/index.js deleted file mode 100644 index fc4906c6c..000000000 --- a/node_modules/encodeurl/index.js +++ /dev/null @@ -1,60 +0,0 @@ -/*! - * encodeurl - * Copyright(c) 2016 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = encodeUrl - -/** - * RegExp to match non-URL code points, *after* encoding (i.e. not including "%") - * and including invalid escape sequences. - * @private - */ - -var ENCODE_CHARS_REGEXP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g - -/** - * RegExp to match unmatched surrogate pair. - * @private - */ - -var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g - -/** - * String to replace unmatched surrogate pair with. - * @private - */ - -var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2' - -/** - * Encode a URL to a percent-encoded form, excluding already-encoded sequences. - * - * This function will take an already-encoded URL and encode all the non-URL - * code points. This function will not encode the "%" character unless it is - * not part of a valid sequence (`%20` will be left as-is, but `%foo` will - * be encoded as `%25foo`). - * - * This encode is meant to be "safe" and does not throw errors. It will try as - * hard as it can to properly encode the given URL, including replacing any raw, - * unpaired surrogate pairs with the Unicode replacement character prior to - * encoding. - * - * @param {string} url - * @return {string} - * @public - */ - -function encodeUrl (url) { - return String(url) - .replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE) - .replace(ENCODE_CHARS_REGEXP, encodeURI) -} diff --git a/node_modules/encodeurl/package.json b/node_modules/encodeurl/package.json deleted file mode 100644 index 835434f66..000000000 --- a/node_modules/encodeurl/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "_from": "encodeurl@~1.0.2", - "_id": "encodeurl@1.0.2", - "_inBundle": false, - "_integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", - "_location": "/encodeurl", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "encodeurl@~1.0.2", - "name": "encodeurl", - "escapedName": "encodeurl", - "rawSpec": "~1.0.2", - "saveSpec": null, - "fetchSpec": "~1.0.2" - }, - "_requiredBy": [ - "/send", - "/serve-static" - ], - "_resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "_shasum": "ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59", - "_spec": "encodeurl@~1.0.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/serve-static", - "bugs": { - "url": "https://github.com/pillarjs/encodeurl/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - } - ], - "deprecated": false, - "description": "Encode a URL to a percent-encoded form, excluding already-encoded sequences", - "devDependencies": { - "eslint": "3.19.0", - "eslint-config-standard": "10.2.1", - "eslint-plugin-import": "2.8.0", - "eslint-plugin-node": "5.2.1", - "eslint-plugin-promise": "3.6.0", - "eslint-plugin-standard": "3.0.1", - "istanbul": "0.4.5", - "mocha": "2.5.3" - }, - "engines": { - "node": ">= 0.8" - }, - "files": [ - "LICENSE", - "HISTORY.md", - "README.md", - "index.js" - ], - "homepage": "https://github.com/pillarjs/encodeurl#readme", - "keywords": [ - "encode", - "encodeurl", - "url" - ], - "license": "MIT", - "name": "encodeurl", - "repository": { - "type": "git", - "url": "git+https://github.com/pillarjs/encodeurl.git" - }, - "scripts": { - "lint": "eslint .", - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" - }, - "version": "1.0.2" -} diff --git a/node_modules/es6-promisify/LICENSE b/node_modules/es6-promisify/LICENSE deleted file mode 100644 index f1e854fca..000000000 --- a/node_modules/es6-promisify/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2014 Mike Hall / Digital Design Labs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/es6-promisify/README.md b/node_modules/es6-promisify/README.md deleted file mode 100644 index 40668a2a1..000000000 --- a/node_modules/es6-promisify/README.md +++ /dev/null @@ -1,93 +0,0 @@ -[![Travis CI](https://travis-ci.org/digitaldesignlabs/es6-promisify.svg)](https://travis-ci.org/digitaldesignlabs/es6-promisify) - -# es6-promisify -Converts callback-based functions to ES6/ES2015 Promises, using a boilerplate callback function. - -NOTE: All-new API for Version 6.0.0; please read carefully! -=========================================================== - -## Install -Install with [npm](https://npmjs.org/package/es6-promisify) - -```bash -npm install es6-promisify -``` - -## Example -```js -const {promisify} = require("es6-promisify"); - -// Convert the stat function -const fs = require("fs"); -const stat = promisify(fs.stat); - -// Now usable as a promise! -stat("example.txt").then(function (stats) { - console.log("Got stats", stats); -}).catch(function (err) { - console.error("Yikes!", err); -}); -``` - -## Promisify methods -```js -const {promisify} = require("es6-promisify"); - -// Create a promise-based version of send_command -const redis = require("redis").createClient(6379, "localhost"); -const client = promisify(redis.send_command.bind(redis)); - -// Send commands to redis and get a promise back -client("ping").then(function (pong) { - console.log("Got", pong); -}).catch(function (err) { - console.error("Unexpected error", err); -}).then(function () { - redis.quit(); -}); -``` - -## Handle multiple callback arguments, with named parameters -```js -const {promisify} = require("es6-promisify"); - -function test(cb) { - return cb(undefined, 1, 2, 3); -} - -// Create promise-based version of test -test[promisify.argumentNames] = ["one", "two", "three"]; -const multi = promisify(test); - -// Returns named arguments -multi().then(result => { - console.log(result); // {one: 1, two: 2, three: 3} -}); -``` - -## Provide your own Promise implementation -```js -const {promisify} = require("es6-promisify"); - -// Now uses Bluebird -promisify.Promise = require("bluebird"); - -const test = promisify(cb => cb(undefined, "test")); -test().then(result => { - console.log(result); // "test", resolved using Bluebird -}); -``` - -### Tests -Test with tape -```bash -$ npm test -``` - -### Changes from v5.0.0 -- Allow developer to specify a different implementations of `Promise` -- No longer ships with a polyfill for `Promise`. If your environment has no native `Promise` you must polyfill yourself, or set `promisify.Promise` to an A+ compatible `Promise` implementation. -- Removed support for `settings.thisArg`: use `.bind()` instead. -- Removed support for `settings.multiArgs`: use named arguments instead. - -Published under the [MIT License](http://opensource.org/licenses/MIT). diff --git a/node_modules/es6-promisify/dist/promisify.js b/node_modules/es6-promisify/dist/promisify.js deleted file mode 100644 index 32a5aaae9..000000000 --- a/node_modules/es6-promisify/dist/promisify.js +++ /dev/null @@ -1,84 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -// Symbols is a better way to do this, but not all browsers have good support, -// so instead we'll just make do with a very unlikely string. -var customArgumentsToken = "__ES6-PROMISIFY--CUSTOM-ARGUMENTS__"; - -/** - * promisify() - * Transforms callback-based function -- func(arg1, arg2 .. argN, callback) -- into - * an ES6-compatible Promise. Promisify provides a default callback of the form (error, result) - * and rejects when `error` is truthy. - * - * @param {function} original - The function to promisify - * @return {function} A promisified version of `original` - */ -function promisify(original) { - - // Ensure the argument is a function - if (typeof original !== "function") { - throw new TypeError("Argument to promisify must be a function"); - } - - // If the user has asked us to decode argument names for them, honour that - var argumentNames = original[customArgumentsToken]; - - // If the user has supplied a custom Promise implementation, use it. Otherwise - // fall back to whatever we can find on the global object. - var ES6Promise = promisify.Promise || Promise; - - // If we can find no Promise implemention, then fail now. - if (typeof ES6Promise !== "function") { - throw new Error("No Promise implementation found; do you need a polyfill?"); - } - - return function () { - var _this = this; - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return new ES6Promise(function (resolve, reject) { - - // Append the callback bound to the context - args.push(function callback(err) { - - if (err) { - return reject(err); - } - - for (var _len2 = arguments.length, values = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - values[_key2 - 1] = arguments[_key2]; - } - - if (values.length === 1 || !argumentNames) { - return resolve(values[0]); - } - - var o = {}; - values.forEach(function (value, index) { - var name = argumentNames[index]; - if (name) { - o[name] = value; - } - }); - - resolve(o); - }); - - // Call the function. - original.call.apply(original, [_this].concat(args)); - }); - }; -} - -// Attach this symbol to the exported function, so users can use it -promisify.argumentNames = customArgumentsToken; -promisify.Promise = undefined; - -// Export the public API -exports.promisify = promisify; \ No newline at end of file diff --git a/node_modules/es6-promisify/package.json b/node_modules/es6-promisify/package.json deleted file mode 100644 index 5d5097935..000000000 --- a/node_modules/es6-promisify/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "_from": "es6-promisify@^6.0.0", - "_id": "es6-promisify@6.0.1", - "_inBundle": false, - "_integrity": "sha512-J3ZkwbEnnO+fGAKrjVpeUAnZshAdfZvbhQpqfIH9kSAspReRC4nJnu8ewm55b4y9ElyeuhCTzJD0XiH8Tsbhlw==", - "_location": "/es6-promisify", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "es6-promisify@^6.0.0", - "name": "es6-promisify", - "escapedName": "es6-promisify", - "rawSpec": "^6.0.0", - "saveSpec": null, - "fetchSpec": "^6.0.0" - }, - "_requiredBy": [ - "/pem" - ], - "_resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-6.0.1.tgz", - "_shasum": "6edaa45f3bd570ffe08febce66f7116be4b1cdb6", - "_spec": "es6-promisify@^6.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/pem", - "author": { - "name": "Mike Hall", - "email": "mikehall314@gmail.com" - }, - "bugs": { - "url": "http://github.com/digitaldesignlabs/es6-promisify/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Converts callback-based functions to ES6 Promises", - "devDependencies": { - "babel-cli": "^6.26.0", - "babel-preset-es2015": "^6.24.1", - "es6-promise": "^4.2.5", - "eslint": "^5.7.0", - "istanbul": "^0.4.5", - "sinon": "^7.0.0", - "tape": "^4.9.1" - }, - "files": [ - "dist/promisify.js" - ], - "greenkeeper": { - "ignore": [ - "eslint" - ] - }, - "homepage": "https://github.com/digitaldesignlabs/es6-promisify#readme", - "keywords": [ - "promises", - "es6", - "promisify" - ], - "license": "MIT", - "main": "dist/promisify.js", - "name": "es6-promisify", - "repository": { - "type": "git", - "url": "git+https://github.com/digitaldesignlabs/es6-promisify.git" - }, - "scripts": { - "build": "babel lib -d dist", - "pretest": "eslint lib/*.js test/*.js", - "test": "npm run build && ./node_modules/.bin/tape test", - "test:cover": "npm run build && ./node_modules/.bin/istanbul cover test" - }, - "version": "6.0.1" -} diff --git a/node_modules/escape-html/LICENSE b/node_modules/escape-html/LICENSE deleted file mode 100644 index 2e70de971..000000000 --- a/node_modules/escape-html/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2012-2013 TJ Holowaychuk -Copyright (c) 2015 Andreas Lubbe -Copyright (c) 2015 Tiancheng "Timothy" Gu - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/escape-html/Readme.md b/node_modules/escape-html/Readme.md deleted file mode 100644 index 653d9eaa7..000000000 --- a/node_modules/escape-html/Readme.md +++ /dev/null @@ -1,43 +0,0 @@ - -# escape-html - - Escape string for use in HTML - -## Example - -```js -var escape = require('escape-html'); -var html = escape('foo & bar'); -// -> foo & bar -``` - -## Benchmark - -``` -$ npm run-script bench - -> escape-html@1.0.3 bench nodejs-escape-html -> node benchmark/index.js - - - http_parser@1.0 - node@0.10.33 - v8@3.14.5.9 - ares@1.9.0-DEV - uv@0.10.29 - zlib@1.2.3 - modules@11 - openssl@1.0.1j - - 1 test completed. - 2 tests completed. - 3 tests completed. - - no special characters x 19,435,271 ops/sec ±0.85% (187 runs sampled) - single special character x 6,132,421 ops/sec ±0.67% (194 runs sampled) - many special characters x 3,175,826 ops/sec ±0.65% (193 runs sampled) -``` - -## License - - MIT \ No newline at end of file diff --git a/node_modules/escape-html/index.js b/node_modules/escape-html/index.js deleted file mode 100644 index bf9e226f4..000000000 --- a/node_modules/escape-html/index.js +++ /dev/null @@ -1,78 +0,0 @@ -/*! - * escape-html - * Copyright(c) 2012-2013 TJ Holowaychuk - * Copyright(c) 2015 Andreas Lubbe - * Copyright(c) 2015 Tiancheng "Timothy" Gu - * MIT Licensed - */ - -'use strict'; - -/** - * Module variables. - * @private - */ - -var matchHtmlRegExp = /["'&<>]/; - -/** - * Module exports. - * @public - */ - -module.exports = escapeHtml; - -/** - * Escape special characters in the given string of html. - * - * @param {string} string The string to escape for inserting into HTML - * @return {string} - * @public - */ - -function escapeHtml(string) { - var str = '' + string; - var match = matchHtmlRegExp.exec(str); - - if (!match) { - return str; - } - - var escape; - var html = ''; - var index = 0; - var lastIndex = 0; - - for (index = match.index; index < str.length; index++) { - switch (str.charCodeAt(index)) { - case 34: // " - escape = '"'; - break; - case 38: // & - escape = '&'; - break; - case 39: // ' - escape = '''; - break; - case 60: // < - escape = '<'; - break; - case 62: // > - escape = '>'; - break; - default: - continue; - } - - if (lastIndex !== index) { - html += str.substring(lastIndex, index); - } - - lastIndex = index + 1; - html += escape; - } - - return lastIndex !== index - ? html + str.substring(lastIndex, index) - : html; -} diff --git a/node_modules/escape-html/package.json b/node_modules/escape-html/package.json deleted file mode 100644 index e240b0d4b..000000000 --- a/node_modules/escape-html/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "_from": "escape-html@^1.0.3", - "_id": "escape-html@1.0.3", - "_inBundle": false, - "_integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", - "_location": "/escape-html", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "escape-html@^1.0.3", - "name": "escape-html", - "escapedName": "escape-html", - "rawSpec": "^1.0.3", - "saveSpec": null, - "fetchSpec": "^1.0.3" - }, - "_requiredBy": [ - "/budo", - "/send", - "/serve-static" - ], - "_resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "_shasum": "0258eae4d3d0c0974de1c169188ef0051d1d1988", - "_spec": "escape-html@^1.0.3", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", - "bugs": { - "url": "https://github.com/component/escape-html/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Escape string for use in HTML", - "devDependencies": { - "beautify-benchmark": "0.2.4", - "benchmark": "1.0.0" - }, - "files": [ - "LICENSE", - "Readme.md", - "index.js" - ], - "homepage": "https://github.com/component/escape-html#readme", - "keywords": [ - "escape", - "html", - "utility" - ], - "license": "MIT", - "name": "escape-html", - "repository": { - "type": "git", - "url": "git+https://github.com/component/escape-html.git" - }, - "scripts": { - "bench": "node benchmark/index.js" - }, - "version": "1.0.3" -} diff --git a/node_modules/escape-string-regexp/index.js b/node_modules/escape-string-regexp/index.js deleted file mode 100644 index 7834bf9b2..000000000 --- a/node_modules/escape-string-regexp/index.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; - -module.exports = function (str) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } - - return str.replace(matchOperatorsRe, '\\$&'); -}; diff --git a/node_modules/escape-string-regexp/license b/node_modules/escape-string-regexp/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/escape-string-regexp/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/escape-string-regexp/package.json b/node_modules/escape-string-regexp/package.json deleted file mode 100644 index cfc9c476c..000000000 --- a/node_modules/escape-string-regexp/package.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "_from": "escape-string-regexp@^1.0.0", - "_id": "escape-string-regexp@1.0.5", - "_inBundle": false, - "_integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "_location": "/escape-string-regexp", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "escape-string-regexp@^1.0.0", - "name": "escape-string-regexp", - "escapedName": "escape-string-regexp", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/chalk" - ], - "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "_shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4", - "_spec": "escape-string-regexp@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/chalk", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/escape-string-regexp/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Escape RegExp special characters", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=0.8.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/escape-string-regexp#readme", - "keywords": [ - "escape", - "regex", - "regexp", - "re", - "regular", - "expression", - "string", - "str", - "special", - "characters" - ], - "license": "MIT", - "maintainers": [ - { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - { - "name": "Joshua Boy Nicolai Appelman", - "email": "joshua@jbna.nl", - "url": "jbna.nl" - } - ], - "name": "escape-string-regexp", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/escape-string-regexp.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.5" -} diff --git a/node_modules/escape-string-regexp/readme.md b/node_modules/escape-string-regexp/readme.md deleted file mode 100644 index 87ac82d5e..000000000 --- a/node_modules/escape-string-regexp/readme.md +++ /dev/null @@ -1,27 +0,0 @@ -# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp) - -> Escape RegExp special characters - - -## Install - -``` -$ npm install --save escape-string-regexp -``` - - -## Usage - -```js -const escapeStringRegexp = require('escape-string-regexp'); - -const escapedString = escapeStringRegexp('how much $ for a unicorn?'); -//=> 'how much \$ for a unicorn\?' - -new RegExp(escapedString); -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/etag/HISTORY.md b/node_modules/etag/HISTORY.md deleted file mode 100644 index 222b293de..000000000 --- a/node_modules/etag/HISTORY.md +++ /dev/null @@ -1,83 +0,0 @@ -1.8.1 / 2017-09-12 -================== - - * perf: replace regular expression with substring - -1.8.0 / 2017-02-18 -================== - - * Use SHA1 instead of MD5 for ETag hashing - - Improves performance for larger entities - - Works with FIPS 140-2 OpenSSL configuration - -1.7.0 / 2015-06-08 -================== - - * Always include entity length in ETags for hash length extensions - * Generate non-Stats ETags using MD5 only (no longer CRC32) - * Improve stat performance by removing hashing - * Remove base64 padding in ETags to shorten - * Use MD5 instead of MD4 in weak ETags over 1KB - -1.6.0 / 2015-05-10 -================== - - * Improve support for JXcore - * Remove requirement of `atime` in the stats object - * Support "fake" stats objects in environments without `fs` - -1.5.1 / 2014-11-19 -================== - - * deps: crc@3.2.1 - - Minor fixes - -1.5.0 / 2014-10-14 -================== - - * Improve string performance - * Slightly improve speed for weak ETags over 1KB - -1.4.0 / 2014-09-21 -================== - - * Support "fake" stats objects - * Support Node.js 0.6 - -1.3.1 / 2014-09-14 -================== - - * Use the (new and improved) `crc` for crc32 - -1.3.0 / 2014-08-29 -================== - - * Default strings to strong ETags - * Improve speed for weak ETags over 1KB - -1.2.1 / 2014-08-29 -================== - - * Use the (much faster) `buffer-crc32` for crc32 - -1.2.0 / 2014-08-24 -================== - - * Add support for file stat objects - -1.1.0 / 2014-08-24 -================== - - * Add fast-path for empty entity - * Add weak ETag generation - * Shrink size of generated ETags - -1.0.1 / 2014-08-24 -================== - - * Fix behavior of string containing Unicode - -1.0.0 / 2014-05-18 -================== - - * Initial release diff --git a/node_modules/etag/LICENSE b/node_modules/etag/LICENSE deleted file mode 100644 index cab251c2b..000000000 --- a/node_modules/etag/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2014-2016 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/etag/README.md b/node_modules/etag/README.md deleted file mode 100644 index 09c2169e7..000000000 --- a/node_modules/etag/README.md +++ /dev/null @@ -1,159 +0,0 @@ -# etag - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Create simple HTTP ETags - -This module generates HTTP ETags (as defined in RFC 7232) for use in -HTTP responses. - -## Installation - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```sh -$ npm install etag -``` - -## API - - - -```js -var etag = require('etag') -``` - -### etag(entity, [options]) - -Generate a strong ETag for the given entity. This should be the complete -body of the entity. Strings, `Buffer`s, and `fs.Stats` are accepted. By -default, a strong ETag is generated except for `fs.Stats`, which will -generate a weak ETag (this can be overwritten by `options.weak`). - - - -```js -res.setHeader('ETag', etag(body)) -``` - -#### Options - -`etag` accepts these properties in the options object. - -##### weak - -Specifies if the generated ETag will include the weak validator mark (that -is, the leading `W/`). The actual entity tag is the same. The default value -is `false`, unless the `entity` is `fs.Stats`, in which case it is `true`. - -## Testing - -```sh -$ npm test -``` - -## Benchmark - -```bash -$ npm run-script bench - -> etag@1.8.1 bench nodejs-etag -> node benchmark/index.js - - http_parser@2.7.0 - node@6.11.1 - v8@5.1.281.103 - uv@1.11.0 - zlib@1.2.11 - ares@1.10.1-DEV - icu@58.2 - modules@48 - openssl@1.0.2k - -> node benchmark/body0-100b.js - - 100B body - - 4 tests completed. - - buffer - strong x 258,647 ops/sec ±1.07% (180 runs sampled) - buffer - weak x 263,812 ops/sec ±0.61% (184 runs sampled) - string - strong x 259,955 ops/sec ±1.19% (185 runs sampled) - string - weak x 264,356 ops/sec ±1.09% (184 runs sampled) - -> node benchmark/body1-1kb.js - - 1KB body - - 4 tests completed. - - buffer - strong x 189,018 ops/sec ±1.12% (182 runs sampled) - buffer - weak x 190,586 ops/sec ±0.81% (186 runs sampled) - string - strong x 144,272 ops/sec ±0.96% (188 runs sampled) - string - weak x 145,380 ops/sec ±1.43% (187 runs sampled) - -> node benchmark/body2-5kb.js - - 5KB body - - 4 tests completed. - - buffer - strong x 92,435 ops/sec ±0.42% (188 runs sampled) - buffer - weak x 92,373 ops/sec ±0.58% (189 runs sampled) - string - strong x 48,850 ops/sec ±0.56% (186 runs sampled) - string - weak x 49,380 ops/sec ±0.56% (190 runs sampled) - -> node benchmark/body3-10kb.js - - 10KB body - - 4 tests completed. - - buffer - strong x 55,989 ops/sec ±0.93% (188 runs sampled) - buffer - weak x 56,148 ops/sec ±0.55% (190 runs sampled) - string - strong x 27,345 ops/sec ±0.43% (188 runs sampled) - string - weak x 27,496 ops/sec ±0.45% (190 runs sampled) - -> node benchmark/body4-100kb.js - - 100KB body - - 4 tests completed. - - buffer - strong x 7,083 ops/sec ±0.22% (190 runs sampled) - buffer - weak x 7,115 ops/sec ±0.26% (191 runs sampled) - string - strong x 3,068 ops/sec ±0.34% (190 runs sampled) - string - weak x 3,096 ops/sec ±0.35% (190 runs sampled) - -> node benchmark/stats.js - - stat - - 4 tests completed. - - real - strong x 871,642 ops/sec ±0.34% (189 runs sampled) - real - weak x 867,613 ops/sec ±0.39% (190 runs sampled) - fake - strong x 401,051 ops/sec ±0.40% (189 runs sampled) - fake - weak x 400,100 ops/sec ±0.47% (188 runs sampled) -``` - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/etag.svg -[npm-url]: https://npmjs.org/package/etag -[node-version-image]: https://img.shields.io/node/v/etag.svg -[node-version-url]: https://nodejs.org/en/download/ -[travis-image]: https://img.shields.io/travis/jshttp/etag/master.svg -[travis-url]: https://travis-ci.org/jshttp/etag -[coveralls-image]: https://img.shields.io/coveralls/jshttp/etag/master.svg -[coveralls-url]: https://coveralls.io/r/jshttp/etag?branch=master -[downloads-image]: https://img.shields.io/npm/dm/etag.svg -[downloads-url]: https://npmjs.org/package/etag diff --git a/node_modules/etag/index.js b/node_modules/etag/index.js deleted file mode 100644 index 2a585c91f..000000000 --- a/node_modules/etag/index.js +++ /dev/null @@ -1,131 +0,0 @@ -/*! - * etag - * Copyright(c) 2014-2016 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = etag - -/** - * Module dependencies. - * @private - */ - -var crypto = require('crypto') -var Stats = require('fs').Stats - -/** - * Module variables. - * @private - */ - -var toString = Object.prototype.toString - -/** - * Generate an entity tag. - * - * @param {Buffer|string} entity - * @return {string} - * @private - */ - -function entitytag (entity) { - if (entity.length === 0) { - // fast-path empty - return '"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"' - } - - // compute hash of entity - var hash = crypto - .createHash('sha1') - .update(entity, 'utf8') - .digest('base64') - .substring(0, 27) - - // compute length of entity - var len = typeof entity === 'string' - ? Buffer.byteLength(entity, 'utf8') - : entity.length - - return '"' + len.toString(16) + '-' + hash + '"' -} - -/** - * Create a simple ETag. - * - * @param {string|Buffer|Stats} entity - * @param {object} [options] - * @param {boolean} [options.weak] - * @return {String} - * @public - */ - -function etag (entity, options) { - if (entity == null) { - throw new TypeError('argument entity is required') - } - - // support fs.Stats object - var isStats = isstats(entity) - var weak = options && typeof options.weak === 'boolean' - ? options.weak - : isStats - - // validate argument - if (!isStats && typeof entity !== 'string' && !Buffer.isBuffer(entity)) { - throw new TypeError('argument entity must be string, Buffer, or fs.Stats') - } - - // generate entity tag - var tag = isStats - ? stattag(entity) - : entitytag(entity) - - return weak - ? 'W/' + tag - : tag -} - -/** - * Determine if object is a Stats object. - * - * @param {object} obj - * @return {boolean} - * @api private - */ - -function isstats (obj) { - // genuine fs.Stats - if (typeof Stats === 'function' && obj instanceof Stats) { - return true - } - - // quack quack - return obj && typeof obj === 'object' && - 'ctime' in obj && toString.call(obj.ctime) === '[object Date]' && - 'mtime' in obj && toString.call(obj.mtime) === '[object Date]' && - 'ino' in obj && typeof obj.ino === 'number' && - 'size' in obj && typeof obj.size === 'number' -} - -/** - * Generate a tag for a stat. - * - * @param {object} stat - * @return {string} - * @private - */ - -function stattag (stat) { - var mtime = stat.mtime.getTime().toString(16) - var size = stat.size.toString(16) - - return '"' + size + '-' + mtime + '"' -} diff --git a/node_modules/etag/package.json b/node_modules/etag/package.json deleted file mode 100644 index 09d9cb0aa..000000000 --- a/node_modules/etag/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "_from": "etag@~1.8.1", - "_id": "etag@1.8.1", - "_inBundle": false, - "_integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", - "_location": "/etag", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "etag@~1.8.1", - "name": "etag", - "escapedName": "etag", - "rawSpec": "~1.8.1", - "saveSpec": null, - "fetchSpec": "~1.8.1" - }, - "_requiredBy": [ - "/send" - ], - "_resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "_shasum": "41ae2eeb65efa62268aebfea83ac7d79299b0887", - "_spec": "etag@~1.8.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/send", - "bugs": { - "url": "https://github.com/jshttp/etag/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - }, - { - "name": "David Björklund", - "email": "david.bjorklund@gmail.com" - } - ], - "deprecated": false, - "description": "Create simple HTTP ETags", - "devDependencies": { - "beautify-benchmark": "0.2.4", - "benchmark": "2.1.4", - "eslint": "3.19.0", - "eslint-config-standard": "10.2.1", - "eslint-plugin-import": "2.7.0", - "eslint-plugin-markdown": "1.0.0-beta.6", - "eslint-plugin-node": "5.1.1", - "eslint-plugin-promise": "3.5.0", - "eslint-plugin-standard": "3.0.1", - "istanbul": "0.4.5", - "mocha": "1.21.5", - "safe-buffer": "5.1.1", - "seedrandom": "2.4.3" - }, - "engines": { - "node": ">= 0.6" - }, - "files": [ - "LICENSE", - "HISTORY.md", - "README.md", - "index.js" - ], - "homepage": "https://github.com/jshttp/etag#readme", - "keywords": [ - "etag", - "http", - "res" - ], - "license": "MIT", - "name": "etag", - "repository": { - "type": "git", - "url": "git+https://github.com/jshttp/etag.git" - }, - "scripts": { - "bench": "node benchmark/index.js", - "lint": "eslint --plugin markdown --ext js,md .", - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" - }, - "version": "1.8.1" -} diff --git a/node_modules/events/.npmignore b/node_modules/events/.npmignore deleted file mode 100644 index 3c3629e64..000000000 --- a/node_modules/events/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/events/.travis.yml b/node_modules/events/.travis.yml deleted file mode 100644 index 002b04229..000000000 --- a/node_modules/events/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -sudo: false -language: node_js -node_js: -- '0.10' -env: - global: - - secure: XcBiD8yReflut9q7leKsigDZ0mI3qTKH+QrNVY8DaqlomJOZw8aOrVuX9Jz12l86ZJ41nbxmKnRNkFzcVr9mbP9YaeTb3DpeOBWmvaoSfud9Wnc16VfXtc1FCcwDhSVcSiM3UtnrmFU5cH+Dw1LPh5PbfylYOS/nJxUvG0FFLqI= - - secure: jNWtEbqhUdQ0xXDHvCYfUbKYeJCi6a7B4LsrcxYCyWWn4NIgncE5x2YbB+FSUUFVYfz0dsn5RKP1oHB99f0laUEo18HBNkrAS/rtyOdVzcpJjbQ6kgSILGjnJD/Ty1B57Rcz3iyev5Y7bLZ6Y1FbDnk/i9/l0faOGz8vTC3Vdkc= diff --git a/node_modules/events/.zuul.yml b/node_modules/events/.zuul.yml deleted file mode 100644 index a8e35afd3..000000000 --- a/node_modules/events/.zuul.yml +++ /dev/null @@ -1,12 +0,0 @@ -ui: mocha-qunit -browsers: - - name: chrome - version: latest - - name: firefox - version: latest - - name: safari - version: 5..latest - - name: iphone - version: latest - - name: ie - version: 8..latest diff --git a/node_modules/events/History.md b/node_modules/events/History.md deleted file mode 100644 index b345858e7..000000000 --- a/node_modules/events/History.md +++ /dev/null @@ -1,42 +0,0 @@ -# 1.1.1 (2016-06-22) - - - add more context to errors if they are not instanceof Error - -# 1.1.0 (2015-09-29) - - - add Emitter#listerCount (to match node v4 api) - -# 1.0.2 (2014-08-28) - - - remove un-reachable code - - update devDeps - -## 1.0.1 / 2014-05-11 - - - check for console.trace before using it - -## 1.0.0 / 2013-12-10 - - - Update to latest events code from node.js 0.10 - - copy tests from node.js - -## 0.4.0 / 2011-07-03 ## - - - Switching to graphquire@0.8.0 - -## 0.3.0 / 2011-07-03 ## - - - Switching to URL based module require. - -## 0.2.0 / 2011-06-10 ## - - - Simplified package structure. - - Graphquire for dependency management. - -## 0.1.1 / 2011-05-16 ## - - - Unhandled errors are logged via console.error - -## 0.1.0 / 2011-04-22 ## - - - Initial release diff --git a/node_modules/events/LICENSE b/node_modules/events/LICENSE deleted file mode 100644 index 52ed3b0a6..000000000 --- a/node_modules/events/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT - -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. diff --git a/node_modules/events/Readme.md b/node_modules/events/Readme.md deleted file mode 100644 index 02694efa6..000000000 --- a/node_modules/events/Readme.md +++ /dev/null @@ -1,19 +0,0 @@ -# events [![Build Status](https://travis-ci.org/Gozala/events.png?branch=master)](https://travis-ci.org/Gozala/events) - -Node's event emitter for all engines. - -## Install ## - -``` -npm install events -``` - -## Require ## - -```javascript -var EventEmitter = require('events').EventEmitter -``` - -## Usage ## - -See the [node.js event emitter docs](http://nodejs.org/api/events.html) diff --git a/node_modules/events/events.js b/node_modules/events/events.js deleted file mode 100644 index 1619a623a..000000000 --- a/node_modules/events/events.js +++ /dev/null @@ -1,302 +0,0 @@ -// 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. - -function EventEmitter() { - this._events = this._events || {}; - this._maxListeners = this._maxListeners || undefined; -} -module.exports = EventEmitter; - -// Backwards-compat with node 0.10.x -EventEmitter.EventEmitter = EventEmitter; - -EventEmitter.prototype._events = undefined; -EventEmitter.prototype._maxListeners = undefined; - -// By default EventEmitters will print a warning if more than 10 listeners are -// added to it. This is a useful default which helps finding memory leaks. -EventEmitter.defaultMaxListeners = 10; - -// Obviously not all Emitters should be limited to 10. This function allows -// that to be increased. Set to zero for unlimited. -EventEmitter.prototype.setMaxListeners = function(n) { - if (!isNumber(n) || n < 0 || isNaN(n)) - throw TypeError('n must be a positive number'); - this._maxListeners = n; - return this; -}; - -EventEmitter.prototype.emit = function(type) { - var er, handler, len, args, i, listeners; - - if (!this._events) - this._events = {}; - - // If there is no 'error' event listener then throw. - if (type === 'error') { - if (!this._events.error || - (isObject(this._events.error) && !this._events.error.length)) { - er = arguments[1]; - if (er instanceof Error) { - throw er; // Unhandled 'error' event - } else { - // At least give some kind of context to the user - var err = new Error('Uncaught, unspecified "error" event. (' + er + ')'); - err.context = er; - throw err; - } - } - } - - handler = this._events[type]; - - if (isUndefined(handler)) - return false; - - if (isFunction(handler)) { - switch (arguments.length) { - // fast cases - case 1: - handler.call(this); - break; - case 2: - handler.call(this, arguments[1]); - break; - case 3: - handler.call(this, arguments[1], arguments[2]); - break; - // slower - default: - args = Array.prototype.slice.call(arguments, 1); - handler.apply(this, args); - } - } else if (isObject(handler)) { - args = Array.prototype.slice.call(arguments, 1); - listeners = handler.slice(); - len = listeners.length; - for (i = 0; i < len; i++) - listeners[i].apply(this, args); - } - - return true; -}; - -EventEmitter.prototype.addListener = function(type, listener) { - var m; - - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - if (!this._events) - this._events = {}; - - // To avoid recursion in the case that type === "newListener"! Before - // adding it to the listeners, first emit "newListener". - if (this._events.newListener) - this.emit('newListener', type, - isFunction(listener.listener) ? - listener.listener : listener); - - if (!this._events[type]) - // Optimize the case of one listener. Don't need the extra array object. - this._events[type] = listener; - else if (isObject(this._events[type])) - // If we've already got an array, just append. - this._events[type].push(listener); - else - // Adding the second element, need to change to array. - this._events[type] = [this._events[type], listener]; - - // Check for listener leak - if (isObject(this._events[type]) && !this._events[type].warned) { - if (!isUndefined(this._maxListeners)) { - m = this._maxListeners; - } else { - m = EventEmitter.defaultMaxListeners; - } - - if (m && m > 0 && this._events[type].length > m) { - this._events[type].warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - this._events[type].length); - if (typeof console.trace === 'function') { - // not supported in IE 10 - console.trace(); - } - } - } - - return this; -}; - -EventEmitter.prototype.on = EventEmitter.prototype.addListener; - -EventEmitter.prototype.once = function(type, listener) { - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - var fired = false; - - function g() { - this.removeListener(type, g); - - if (!fired) { - fired = true; - listener.apply(this, arguments); - } - } - - g.listener = listener; - this.on(type, g); - - return this; -}; - -// emits a 'removeListener' event iff the listener was removed -EventEmitter.prototype.removeListener = function(type, listener) { - var list, position, length, i; - - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - if (!this._events || !this._events[type]) - return this; - - list = this._events[type]; - length = list.length; - position = -1; - - if (list === listener || - (isFunction(list.listener) && list.listener === listener)) { - delete this._events[type]; - if (this._events.removeListener) - this.emit('removeListener', type, listener); - - } else if (isObject(list)) { - for (i = length; i-- > 0;) { - if (list[i] === listener || - (list[i].listener && list[i].listener === listener)) { - position = i; - break; - } - } - - if (position < 0) - return this; - - if (list.length === 1) { - list.length = 0; - delete this._events[type]; - } else { - list.splice(position, 1); - } - - if (this._events.removeListener) - this.emit('removeListener', type, listener); - } - - return this; -}; - -EventEmitter.prototype.removeAllListeners = function(type) { - var key, listeners; - - if (!this._events) - return this; - - // not listening for removeListener, no need to emit - if (!this._events.removeListener) { - if (arguments.length === 0) - this._events = {}; - else if (this._events[type]) - delete this._events[type]; - return this; - } - - // emit removeListener for all listeners on all events - if (arguments.length === 0) { - for (key in this._events) { - if (key === 'removeListener') continue; - this.removeAllListeners(key); - } - this.removeAllListeners('removeListener'); - this._events = {}; - return this; - } - - listeners = this._events[type]; - - if (isFunction(listeners)) { - this.removeListener(type, listeners); - } else if (listeners) { - // LIFO order - while (listeners.length) - this.removeListener(type, listeners[listeners.length - 1]); - } - delete this._events[type]; - - return this; -}; - -EventEmitter.prototype.listeners = function(type) { - var ret; - if (!this._events || !this._events[type]) - ret = []; - else if (isFunction(this._events[type])) - ret = [this._events[type]]; - else - ret = this._events[type].slice(); - return ret; -}; - -EventEmitter.prototype.listenerCount = function(type) { - if (this._events) { - var evlistener = this._events[type]; - - if (isFunction(evlistener)) - return 1; - else if (evlistener) - return evlistener.length; - } - return 0; -}; - -EventEmitter.listenerCount = function(emitter, type) { - return emitter.listenerCount(type); -}; - -function isFunction(arg) { - return typeof arg === 'function'; -} - -function isNumber(arg) { - return typeof arg === 'number'; -} - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} - -function isUndefined(arg) { - return arg === void 0; -} diff --git a/node_modules/events/package.json b/node_modules/events/package.json deleted file mode 100644 index 4aeb621ea..000000000 --- a/node_modules/events/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "_from": "events@^1.0.2", - "_id": "events@1.1.1", - "_inBundle": false, - "_integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", - "_location": "/events", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "events@^1.0.2", - "name": "events", - "escapedName": "events", - "rawSpec": "^1.0.2", - "saveSpec": null, - "fetchSpec": "^1.0.2" - }, - "_requiredBy": [ - "/budo", - "/watchify-middleware" - ], - "_resolved": "http://registry.npmjs.org/events/-/events-1.1.1.tgz", - "_shasum": "9ebdb7635ad099c70dcc4c2a1f5004288e8bd924", - "_spec": "events@^1.0.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", - "author": { - "name": "Irakli Gozalishvili", - "email": "rfobic@gmail.com", - "url": "http://jeditoolkit.com" - }, - "bugs": { - "url": "http://github.com/Gozala/events/issues/" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Node's event emitter for all engines.", - "devDependencies": { - "mocha": "~1.21.4", - "zuul": "~1.10.2" - }, - "engines": { - "node": ">=0.4.x" - }, - "homepage": "https://github.com/Gozala/events#readme", - "id": "events", - "keywords": [ - "events", - "eventEmitter", - "eventDispatcher", - "listeners" - ], - "license": "MIT", - "main": "./events.js", - "name": "events", - "repository": { - "type": "git", - "url": "git://github.com/Gozala/events.git", - "web": "https://github.com/Gozala/events" - }, - "scripts": { - "test": "mocha --ui qunit -- tests/index.js && zuul -- tests/index.js" - }, - "version": "1.1.1" -} diff --git a/node_modules/events/tests/add-listeners.js b/node_modules/events/tests/add-listeners.js deleted file mode 100644 index 5ab874cea..000000000 --- a/node_modules/events/tests/add-listeners.js +++ /dev/null @@ -1,63 +0,0 @@ -// 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 assert = require('assert'); -var events = require('../'); - -var e = new events.EventEmitter(); - -var events_new_listener_emited = []; -var listeners_new_listener_emited = []; -var times_hello_emited = 0; - -// sanity check -assert.equal(e.addListener, e.on); - -e.on('newListener', function(event, listener) { - console.log('newListener: ' + event); - events_new_listener_emited.push(event); - listeners_new_listener_emited.push(listener); -}); - -function hello(a, b) { - console.log('hello'); - times_hello_emited += 1; - assert.equal('a', a); - assert.equal('b', b); -} -e.on('hello', hello); - -var foo = function() {}; -e.once('foo', foo); - -console.log('start'); - -e.emit('hello', 'a', 'b'); - - -// just make sure that this doesn't throw: -var f = new events.EventEmitter(); -f.setMaxListeners(0); - -assert.deepEqual(['hello', 'foo'], events_new_listener_emited); -assert.deepEqual([hello, foo], listeners_new_listener_emited); -assert.equal(1, times_hello_emited); - diff --git a/node_modules/events/tests/check-listener-leaks.js b/node_modules/events/tests/check-listener-leaks.js deleted file mode 100644 index e07866a50..000000000 --- a/node_modules/events/tests/check-listener-leaks.js +++ /dev/null @@ -1,86 +0,0 @@ -// 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 assert = require('assert'); -var events = require('../'); - -var e = new events.EventEmitter(); - -// default -for (var i = 0; i < 10; i++) { - e.on('default', function() {}); -} -assert.ok(!e._events['default'].hasOwnProperty('warned')); -e.on('default', function() {}); -assert.ok(e._events['default'].warned); - -// specific -e.setMaxListeners(5); -for (var i = 0; i < 5; i++) { - e.on('specific', function() {}); -} -assert.ok(!e._events['specific'].hasOwnProperty('warned')); -e.on('specific', function() {}); -assert.ok(e._events['specific'].warned); - -// only one -e.setMaxListeners(1); -e.on('only one', function() {}); -assert.ok(!e._events['only one'].hasOwnProperty('warned')); -e.on('only one', function() {}); -assert.ok(e._events['only one'].hasOwnProperty('warned')); - -// unlimited -e.setMaxListeners(0); -for (var i = 0; i < 1000; i++) { - e.on('unlimited', function() {}); -} -assert.ok(!e._events['unlimited'].hasOwnProperty('warned')); - -// process-wide -events.EventEmitter.defaultMaxListeners = 42; -e = new events.EventEmitter(); - -for (var i = 0; i < 42; ++i) { - e.on('fortytwo', function() {}); -} -assert.ok(!e._events['fortytwo'].hasOwnProperty('warned')); -e.on('fortytwo', function() {}); -assert.ok(e._events['fortytwo'].hasOwnProperty('warned')); -delete e._events['fortytwo'].warned; - -events.EventEmitter.defaultMaxListeners = 44; -e.on('fortytwo', function() {}); -assert.ok(!e._events['fortytwo'].hasOwnProperty('warned')); -e.on('fortytwo', function() {}); -assert.ok(e._events['fortytwo'].hasOwnProperty('warned')); - -// but _maxListeners still has precedence over defaultMaxListeners -events.EventEmitter.defaultMaxListeners = 42; -e = new events.EventEmitter(); -e.setMaxListeners(1); -e.on('uno', function() {}); -assert.ok(!e._events['uno'].hasOwnProperty('warned')); -e.on('uno', function() {}); -assert.ok(e._events['uno'].hasOwnProperty('warned')); - -// chainable -assert.strictEqual(e, e.setMaxListeners(1)); diff --git a/node_modules/events/tests/common.js b/node_modules/events/tests/common.js deleted file mode 100644 index 66f70a390..000000000 --- a/node_modules/events/tests/common.js +++ /dev/null @@ -1,42 +0,0 @@ -var assert = require('assert'); - -var mustCallChecks = []; - -function runCallChecks() { - var failed_count = 0; - for (var i=0 ; i< mustCallChecks.length; ++i) { - var context = mustCallChecks[i]; - if (context.actual === context.expected) { - continue; - } - - failed_count++; - console.log('Mismatched %s function calls. Expected %d, actual %d.', - context.name, - context.expected, - context.actual); - console.log(context.stack.split('\n').slice(2).join('\n')); - } - - assert(failed_count === 0); -} - -after(runCallChecks); - -exports.mustCall = function(fn, expected) { - if (typeof expected !== 'number') expected = 1; - - var context = { - expected: expected, - actual: 0, - stack: (new Error).stack, - name: fn.name || '' - }; - - mustCallChecks.push(context); - - return function() { - context.actual++; - return fn.apply(this, arguments); - }; -}; diff --git a/node_modules/events/tests/index.js b/node_modules/events/tests/index.js deleted file mode 100644 index f144530b9..000000000 --- a/node_modules/events/tests/index.js +++ /dev/null @@ -1,25 +0,0 @@ - -require('./legacy-compat'); - -// we do this to easily wrap each file in a mocha test -// and also have browserify be able to statically analyze this file -var orig_require = require; -var require = function(file) { - test(file, function() { - orig_require(file); - }); -} - -require('./add-listeners.js'); -require('./check-listener-leaks.js'); -require('./listener-count.js'); -require('./listeners-side-effects.js'); -require('./listeners.js'); -require('./max-listeners.js'); -require('./modify-in-emit.js'); -require('./num-args.js'); -require('./once.js'); -require('./set-max-listeners-side-effects.js'); -require('./subclass.js'); -require('./remove-all-listeners.js'); -require('./remove-listeners.js'); diff --git a/node_modules/events/tests/legacy-compat.js b/node_modules/events/tests/legacy-compat.js deleted file mode 100644 index afbc0ab83..000000000 --- a/node_modules/events/tests/legacy-compat.js +++ /dev/null @@ -1,18 +0,0 @@ -// sigh... life is hard -if (!global.console) { - console = {} -} - -var fns = ['log', 'error', 'trace']; -for (var i=0 ; ifoo should not be emitted', '!'); -}; - -e.once('foo', remove); -e.removeListener('foo', remove); -e.emit('foo'); - -var times_recurse_emitted = 0; - -e.once('e', function() { - e.emit('e'); - times_recurse_emitted++; -}); - -e.once('e', function() { - times_recurse_emitted++; -}); - -e.emit('e'); - -assert.equal(1, times_hello_emited); -assert.equal(2, times_recurse_emitted); diff --git a/node_modules/events/tests/remove-all-listeners.js b/node_modules/events/tests/remove-all-listeners.js deleted file mode 100644 index b3dc886e7..000000000 --- a/node_modules/events/tests/remove-all-listeners.js +++ /dev/null @@ -1,80 +0,0 @@ -// 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 common = require('./common'); -var assert = require('assert'); -var events = require('../'); - -var after_checks = []; -after(function() { - for (var i=0 ; i -// { key: , -// iv: } - -const cipher = crypto.createCipheriv('aes-256-cbc', result.key, result.iv) -``` - -## LICENSE [MIT](LICENSE) - -[1]: https://wiki.openssl.org/index.php/Manual:EVP_BytesToKey(3) -[2]: https://nodejs.org/api/crypto.html#crypto_class_hash diff --git a/node_modules/evp_bytestokey/index.js b/node_modules/evp_bytestokey/index.js deleted file mode 100644 index f9d4757dd..000000000 --- a/node_modules/evp_bytestokey/index.js +++ /dev/null @@ -1,45 +0,0 @@ -var Buffer = require('safe-buffer').Buffer -var MD5 = require('md5.js') - -/* eslint-disable camelcase */ -function EVP_BytesToKey (password, salt, keyBits, ivLen) { - if (!Buffer.isBuffer(password)) password = Buffer.from(password, 'binary') - if (salt) { - if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, 'binary') - if (salt.length !== 8) throw new RangeError('salt should be Buffer with 8 byte length') - } - - var keyLen = keyBits / 8 - var key = Buffer.alloc(keyLen) - var iv = Buffer.alloc(ivLen || 0) - var tmp = Buffer.alloc(0) - - while (keyLen > 0 || ivLen > 0) { - var hash = new MD5() - hash.update(tmp) - hash.update(password) - if (salt) hash.update(salt) - tmp = hash.digest() - - var used = 0 - - if (keyLen > 0) { - var keyStart = key.length - keyLen - used = Math.min(keyLen, tmp.length) - tmp.copy(key, keyStart, 0, used) - keyLen -= used - } - - if (used < tmp.length && ivLen > 0) { - var ivStart = iv.length - ivLen - var length = Math.min(ivLen, tmp.length - used) - tmp.copy(iv, ivStart, used, used + length) - ivLen -= length - } - } - - tmp.fill(0) - return { key: key, iv: iv } -} - -module.exports = EVP_BytesToKey diff --git a/node_modules/evp_bytestokey/package.json b/node_modules/evp_bytestokey/package.json deleted file mode 100644 index 7695543a3..000000000 --- a/node_modules/evp_bytestokey/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_from": "evp_bytestokey@^1.0.0", - "_id": "evp_bytestokey@1.0.3", - "_inBundle": false, - "_integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "_location": "/evp_bytestokey", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "evp_bytestokey@^1.0.0", - "name": "evp_bytestokey", - "escapedName": "evp_bytestokey", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/browserify-aes", - "/browserify-cipher", - "/parse-asn1" - ], - "_resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "_shasum": "7fcbdb198dc71959432efe13842684e0525acb02", - "_spec": "evp_bytestokey@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify-cipher", - "author": { - "name": "Calvin Metcalf", - "email": "calvin.metcalf@gmail.com" - }, - "bugs": { - "url": "https://github.com/crypto-browserify/EVP_BytesToKey/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Kirill Fomichev", - "email": "fanatid@ya.ru" - } - ], - "dependencies": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - }, - "deprecated": false, - "description": "The insecure key derivation algorithm from OpenSSL", - "devDependencies": { - "bindings": "^1.2.1", - "nan": "^2.4.0", - "nyc": "^8.1.0", - "standard": "^8.0.0", - "tape": "^4.6.0" - }, - "files": [ - "index.js" - ], - "gypfile": false, - "homepage": "https://github.com/crypto-browserify/EVP_BytesToKey", - "keywords": [ - "crypto", - "openssl" - ], - "license": "MIT", - "main": "index.js", - "name": "evp_bytestokey", - "repository": { - "type": "git", - "url": "git+https://github.com/crypto-browserify/EVP_BytesToKey.git" - }, - "scripts": { - "coverage": "nyc tape test/*.js", - "lint": "standard", - "test": "npm run lint && npm run unit", - "test:prepare": "node-gyp rebuild", - "unit": "tape test/*.js" - }, - "version": "1.0.3" -} diff --git a/node_modules/execa/index.js b/node_modules/execa/index.js deleted file mode 100644 index 06f39697d..000000000 --- a/node_modules/execa/index.js +++ /dev/null @@ -1,366 +0,0 @@ -'use strict'; -const path = require('path'); -const childProcess = require('child_process'); -const util = require('util'); -const crossSpawn = require('cross-spawn'); -const stripEof = require('strip-eof'); -const npmRunPath = require('npm-run-path'); -const isStream = require('is-stream'); -const _getStream = require('get-stream'); -const pFinally = require('p-finally'); -const onExit = require('signal-exit'); -const errname = require('./lib/errname'); -const stdio = require('./lib/stdio'); - -const TEN_MEGABYTES = 1000 * 1000 * 10; - -function handleArgs(cmd, args, opts) { - let parsed; - - opts = Object.assign({ - extendEnv: true, - env: {} - }, opts); - - if (opts.extendEnv) { - opts.env = Object.assign({}, process.env, opts.env); - } - - if (opts.__winShell === true) { - delete opts.__winShell; - parsed = { - command: cmd, - args, - options: opts, - file: cmd, - original: { - cmd, - args - } - }; - } else { - parsed = crossSpawn._parse(cmd, args, opts); - } - - opts = Object.assign({ - maxBuffer: TEN_MEGABYTES, - stripEof: true, - preferLocal: true, - localDir: parsed.options.cwd || process.cwd(), - encoding: 'utf8', - reject: true, - cleanup: true - }, parsed.options); - - opts.stdio = stdio(opts); - - if (opts.preferLocal) { - opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir})); - } - - if (opts.detached) { - // #115 - opts.cleanup = false; - } - - if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') { - // #116 - parsed.args.unshift('/q'); - } - - return { - cmd: parsed.command, - args: parsed.args, - opts, - parsed - }; -} - -function handleInput(spawned, opts) { - const input = opts.input; - - if (input === null || input === undefined) { - return; - } - - if (isStream(input)) { - input.pipe(spawned.stdin); - } else { - spawned.stdin.end(input); - } -} - -function handleOutput(opts, val) { - if (val && opts.stripEof) { - val = stripEof(val); - } - - return val; -} - -function handleShell(fn, cmd, opts) { - let file = '/bin/sh'; - let args = ['-c', cmd]; - - opts = Object.assign({}, opts); - - if (process.platform === 'win32') { - opts.__winShell = true; - file = process.env.comspec || 'cmd.exe'; - args = ['/s', '/c', `"${cmd}"`]; - opts.windowsVerbatimArguments = true; - } - - if (opts.shell) { - file = opts.shell; - delete opts.shell; - } - - return fn(file, args, opts); -} - -function getStream(process, stream, encoding, maxBuffer) { - if (!process[stream]) { - return null; - } - - let ret; - - if (encoding) { - ret = _getStream(process[stream], { - encoding, - maxBuffer - }); - } else { - ret = _getStream.buffer(process[stream], {maxBuffer}); - } - - return ret.catch(err => { - err.stream = stream; - err.message = `${stream} ${err.message}`; - throw err; - }); -} - -function makeError(result, options) { - const stdout = result.stdout; - const stderr = result.stderr; - - let err = result.error; - const code = result.code; - const signal = result.signal; - - const parsed = options.parsed; - const joinedCmd = options.joinedCmd; - const timedOut = options.timedOut || false; - - if (!err) { - let output = ''; - - if (Array.isArray(parsed.opts.stdio)) { - if (parsed.opts.stdio[2] !== 'inherit') { - output += output.length > 0 ? stderr : `\n${stderr}`; - } - - if (parsed.opts.stdio[1] !== 'inherit') { - output += `\n${stdout}`; - } - } else if (parsed.opts.stdio !== 'inherit') { - output = `\n${stderr}${stdout}`; - } - - err = new Error(`Command failed: ${joinedCmd}${output}`); - err.code = code < 0 ? errname(code) : code; - } - - err.stdout = stdout; - err.stderr = stderr; - err.failed = true; - err.signal = signal || null; - err.cmd = joinedCmd; - err.timedOut = timedOut; - - return err; -} - -function joinCmd(cmd, args) { - let joinedCmd = cmd; - - if (Array.isArray(args) && args.length > 0) { - joinedCmd += ' ' + args.join(' '); - } - - return joinedCmd; -} - -module.exports = (cmd, args, opts) => { - const parsed = handleArgs(cmd, args, opts); - const encoding = parsed.opts.encoding; - const maxBuffer = parsed.opts.maxBuffer; - const joinedCmd = joinCmd(cmd, args); - - let spawned; - try { - spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts); - } catch (err) { - return Promise.reject(err); - } - - let removeExitHandler; - if (parsed.opts.cleanup) { - removeExitHandler = onExit(() => { - spawned.kill(); - }); - } - - let timeoutId = null; - let timedOut = false; - - const cleanup = () => { - if (timeoutId) { - clearTimeout(timeoutId); - timeoutId = null; - } - - if (removeExitHandler) { - removeExitHandler(); - } - }; - - if (parsed.opts.timeout > 0) { - timeoutId = setTimeout(() => { - timeoutId = null; - timedOut = true; - spawned.kill(parsed.opts.killSignal); - }, parsed.opts.timeout); - } - - const processDone = new Promise(resolve => { - spawned.on('exit', (code, signal) => { - cleanup(); - resolve({code, signal}); - }); - - spawned.on('error', err => { - cleanup(); - resolve({error: err}); - }); - - if (spawned.stdin) { - spawned.stdin.on('error', err => { - cleanup(); - resolve({error: err}); - }); - } - }); - - function destroy() { - if (spawned.stdout) { - spawned.stdout.destroy(); - } - - if (spawned.stderr) { - spawned.stderr.destroy(); - } - } - - const handlePromise = () => pFinally(Promise.all([ - processDone, - getStream(spawned, 'stdout', encoding, maxBuffer), - getStream(spawned, 'stderr', encoding, maxBuffer) - ]).then(arr => { - const result = arr[0]; - result.stdout = arr[1]; - result.stderr = arr[2]; - - if (result.error || result.code !== 0 || result.signal !== null) { - const err = makeError(result, { - joinedCmd, - parsed, - timedOut - }); - - // TODO: missing some timeout logic for killed - // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203 - // err.killed = spawned.killed || killed; - err.killed = err.killed || spawned.killed; - - if (!parsed.opts.reject) { - return err; - } - - throw err; - } - - return { - stdout: handleOutput(parsed.opts, result.stdout), - stderr: handleOutput(parsed.opts, result.stderr), - code: 0, - failed: false, - killed: false, - signal: null, - cmd: joinedCmd, - timedOut: false - }; - }), destroy); - - crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed); - - handleInput(spawned, parsed.opts); - - spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected); - spawned.catch = onrejected => handlePromise().catch(onrejected); - - return spawned; -}; - -module.exports.stdout = function () { - // TODO: set `stderr: 'ignore'` when that option is implemented - return module.exports.apply(null, arguments).then(x => x.stdout); -}; - -module.exports.stderr = function () { - // TODO: set `stdout: 'ignore'` when that option is implemented - return module.exports.apply(null, arguments).then(x => x.stderr); -}; - -module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts); - -module.exports.sync = (cmd, args, opts) => { - const parsed = handleArgs(cmd, args, opts); - const joinedCmd = joinCmd(cmd, args); - - if (isStream(parsed.opts.input)) { - throw new TypeError('The `input` option cannot be a stream in sync mode'); - } - - const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts); - result.code = result.status; - - if (result.error || result.status !== 0 || result.signal !== null) { - const err = makeError(result, { - joinedCmd, - parsed - }); - - if (!parsed.opts.reject) { - return err; - } - - throw err; - } - - return { - stdout: handleOutput(parsed.opts, result.stdout), - stderr: handleOutput(parsed.opts, result.stderr), - code: 0, - failed: false, - signal: null, - cmd: joinedCmd, - timedOut: false - }; -}; - -module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts); - -module.exports.spawn = util.deprecate(module.exports, 'execa.spawn() is deprecated. Use execa() instead.'); diff --git a/node_modules/execa/lib/errname.js b/node_modules/execa/lib/errname.js deleted file mode 100644 index 5395e2e5a..000000000 --- a/node_modules/execa/lib/errname.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; -// Older verions of Node might not have `util.getSystemErrorName()`. -// In that case, fall back to a deprecated internal. -const util = require('util'); - -let uv; - -if (typeof util.getSystemErrorName === 'function') { - module.exports = util.getSystemErrorName; -} else { - try { - uv = process.binding('uv'); - - if (typeof uv.errname !== 'function') { - throw new TypeError('uv.errname is not a function'); - } - } catch (err) { - console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err); - uv = null; - } - - module.exports = code => errname(uv, code); -} - -// Used for testing the fallback behavior -module.exports.__test__ = errname; - -function errname(uv, code) { - if (uv) { - return uv.errname(code); - } - - if (!(code < 0)) { - throw new Error('err >= 0'); - } - - return `Unknown system error ${code}`; -} - diff --git a/node_modules/execa/lib/stdio.js b/node_modules/execa/lib/stdio.js deleted file mode 100644 index a82d46838..000000000 --- a/node_modules/execa/lib/stdio.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; -const alias = ['stdin', 'stdout', 'stderr']; - -const hasAlias = opts => alias.some(x => Boolean(opts[x])); - -module.exports = opts => { - if (!opts) { - return null; - } - - if (opts.stdio && hasAlias(opts)) { - throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`); - } - - if (typeof opts.stdio === 'string') { - return opts.stdio; - } - - const stdio = opts.stdio || []; - - if (!Array.isArray(stdio)) { - throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); - } - - const result = []; - const len = Math.max(stdio.length, alias.length); - - for (let i = 0; i < len; i++) { - let value = null; - - if (stdio[i] !== undefined) { - value = stdio[i]; - } else if (opts[alias[i]] !== undefined) { - value = opts[alias[i]]; - } - - result[i] = value; - } - - return result; -}; diff --git a/node_modules/execa/license b/node_modules/execa/license deleted file mode 100644 index e7af2f771..000000000 --- a/node_modules/execa/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/execa/package.json b/node_modules/execa/package.json deleted file mode 100644 index eae81759f..000000000 --- a/node_modules/execa/package.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "_from": "execa@^0.10.0", - "_id": "execa@0.10.0", - "_inBundle": false, - "_integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==", - "_location": "/execa", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "execa@^0.10.0", - "name": "execa", - "escapedName": "execa", - "rawSpec": "^0.10.0", - "saveSpec": null, - "fetchSpec": "^0.10.0" - }, - "_requiredBy": [ - "/default-gateway" - ], - "_resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz", - "_shasum": "ff456a8f53f90f8eccc71a96d11bdfc7f082cb50", - "_spec": "execa@^0.10.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/default-gateway", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/execa/issues" - }, - "bundleDependencies": false, - "dependencies": { - "cross-spawn": "^6.0.0", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "deprecated": false, - "description": "A better `child_process`", - "devDependencies": { - "ava": "*", - "cat-names": "^1.0.2", - "coveralls": "^2.11.9", - "delay": "^2.0.0", - "is-running": "^2.0.0", - "nyc": "^11.0.2", - "tempfile": "^2.0.0", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js", - "lib" - ], - "homepage": "https://github.com/sindresorhus/execa#readme", - "keywords": [ - "exec", - "child", - "process", - "execute", - "fork", - "execfile", - "spawn", - "file", - "shell", - "bin", - "binary", - "binaries", - "npm", - "path", - "local" - ], - "license": "MIT", - "maintainers": [ - { - "name": "James Talmage", - "email": "james@talmage.io", - "url": "github.com/jamestalmage" - } - ], - "name": "execa", - "nyc": { - "reporter": [ - "text", - "lcov" - ], - "exclude": [ - "**/fixtures/**", - "**/test.js", - "**/test/**" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/execa.git" - }, - "scripts": { - "test": "xo && nyc ava" - }, - "version": "0.10.0" -} diff --git a/node_modules/execa/readme.md b/node_modules/execa/readme.md deleted file mode 100644 index 110c0166d..000000000 --- a/node_modules/execa/readme.md +++ /dev/null @@ -1,304 +0,0 @@ -# execa [![Build Status: Linux](https://travis-ci.org/sindresorhus/execa.svg?branch=master)](https://travis-ci.org/sindresorhus/execa) [![Build status: Windows](https://ci.appveyor.com/api/projects/status/x5ajamxtjtt93cqv/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/execa/branch/master) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/execa/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/execa?branch=master) - -> A better [`child_process`](https://nodejs.org/api/child_process.html) - - -## Why - -- Promise interface. -- [Strips EOF](https://github.com/sindresorhus/strip-eof) from the output so you don't have to `stdout.trim()`. -- Supports [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) binaries cross-platform. -- [Improved Windows support.](https://github.com/IndigoUnited/node-cross-spawn#why) -- Higher max buffer. 10 MB instead of 200 KB. -- [Executes locally installed binaries by name.](#preferlocal) -- [Cleans up spawned processes when the parent process dies.](#cleanup) - - -## Install - -``` -$ npm install --save execa -``` - - -## Usage - -```js -const execa = require('execa'); - -execa('echo', ['unicorns']).then(result => { - console.log(result.stdout); - //=> 'unicorns' -}); - -// pipe the child process stdout to the current stdout -execa('echo', ['unicorns']).stdout.pipe(process.stdout); - -execa.shell('echo unicorns').then(result => { - console.log(result.stdout); - //=> 'unicorns' -}); - -// example of catching an error -execa.shell('exit 3').catch(error => { - console.log(error); - /* - { - message: 'Command failed: /bin/sh -c exit 3' - killed: false, - code: 3, - signal: null, - cmd: '/bin/sh -c exit 3', - stdout: '', - stderr: '', - timedOut: false - } - */ -}); - -// example of catching an error with a sync method -try { - execa.shellSync('exit 3'); -} catch (err) { - console.log(err); - /* - { - message: 'Command failed: /bin/sh -c exit 3' - code: 3, - signal: null, - cmd: '/bin/sh -c exit 3', - stdout: '', - stderr: '', - timedOut: false - } - */ -} -``` - - -## API - -### execa(file, [arguments], [options]) - -Execute a file. - -Think of this as a mix of `child_process.execFile` and `child_process.spawn`. - -Returns a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess), which is enhanced to also be a `Promise` for a result `Object` with `stdout` and `stderr` properties. - -### execa.stdout(file, [arguments], [options]) - -Same as `execa()`, but returns only `stdout`. - -### execa.stderr(file, [arguments], [options]) - -Same as `execa()`, but returns only `stderr`. - -### execa.shell(command, [options]) - -Execute a command through the system shell. Prefer `execa()` whenever possible, as it's both faster and safer. - -Returns a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess). - -The `child_process` instance is enhanced to also be promise for a result object with `stdout` and `stderr` properties. - -### execa.sync(file, [arguments], [options]) - -Execute a file synchronously. - -Returns the same result object as [`child_process.spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options). - -This method throws an `Error` if the command fails. - -### execa.shellSync(file, [options]) - -Execute a command synchronously through the system shell. - -Returns the same result object as [`child_process.spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options). - -### options - -Type: `Object` - -#### cwd - -Type: `string`
    -Default: `process.cwd()` - -Current working directory of the child process. - -#### env - -Type: `Object`
    -Default: `process.env` - -Environment key-value pairs. Extends automatically from `process.env`. Set `extendEnv` to `false` if you don't want this. - -#### extendEnv - -Type: `boolean`
    -Default: `true` - -Set to `false` if you don't want to extend the environment variables when providing the `env` property. - -#### argv0 - -Type: `string` - -Explicitly set the value of `argv[0]` sent to the child process. This will be set to `command` or `file` if not specified. - -#### stdio - -Type: `Array` `string`
    -Default: `pipe` - -Child's [stdio](https://nodejs.org/api/child_process.html#child_process_options_stdio) configuration. - -#### detached - -Type: `boolean` - -Prepare child to run independently of its parent process. Specific behavior [depends on the platform](https://nodejs.org/api/child_process.html#child_process_options_detached). - -#### uid - -Type: `number` - -Sets the user identity of the process. - -#### gid - -Type: `number` - -Sets the group identity of the process. - -#### shell - -Type: `boolean` `string`
    -Default: `false` - -If `true`, runs `command` inside of a shell. Uses `/bin/sh` on UNIX and `cmd.exe` on Windows. A different shell can be specified as a string. The shell should understand the `-c` switch on UNIX or `/d /s /c` on Windows. - -#### stripEof - -Type: `boolean`
    -Default: `true` - -[Strip EOF](https://github.com/sindresorhus/strip-eof) (last newline) from the output. - -#### preferLocal - -Type: `boolean`
    -Default: `true` - -Prefer locally installed binaries when looking for a binary to execute.
    -If you `$ npm install foo`, you can then `execa('foo')`. - -#### localDir - -Type: `string`
    -Default: `process.cwd()` - -Preferred path to find locally installed binaries in (use with `preferLocal`). - -#### input - -Type: `string` `Buffer` `stream.Readable` - -Write some input to the `stdin` of your binary.
    -Streams are not allowed when using the synchronous methods. - -#### reject - -Type: `boolean`
    -Default: `true` - -Setting this to `false` resolves the promise with the error instead of rejecting it. - -#### cleanup - -Type: `boolean`
    -Default: `true` - -Keep track of the spawned process and `kill` it when the parent process exits. - -#### encoding - -Type: `string`
    -Default: `utf8` - -Specify the character encoding used to decode the `stdout` and `stderr` output. - -#### timeout - -Type: `number`
    -Default: `0` - -If timeout is greater than `0`, the parent will send the signal identified by the `killSignal` property (the default is `SIGTERM`) if the child runs longer than timeout milliseconds. - -#### maxBuffer - -Type: `number`
    -Default: `10000000` (10MB) - -Largest amount of data in bytes allowed on `stdout` or `stderr`. - -#### killSignal - -Type: `string` `number`
    -Default: `SIGTERM` - -Signal value to be used when the spawned process will be killed. - -#### stdin - -Type: `string` `number` `Stream` `undefined` `null`
    -Default: `pipe` - -Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio). - -#### stdout - -Type: `string` `number` `Stream` `undefined` `null`
    -Default: `pipe` - -Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio). - -#### stderr - -Type: `string` `number` `Stream` `undefined` `null`
    -Default: `pipe` - -Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio). - -#### windowsVerbatimArguments - -Type: `boolean`
    -Default: `false` - -If `true`, no quoting or escaping of arguments is done on Windows. Ignored on other platforms. This is set to `true` automatically when the `shell` option is `true`. - - -## Tips - -### Save and pipe output from a child process - -Let's say you want to show the output of a child process in real-time while also saving it to a variable. - -```js -const execa = require('execa'); -const getStream = require('get-stream'); - -const stream = execa('echo', ['foo']).stdout; - -stream.pipe(process.stdout); - -getStream(stream).then(value => { - console.log('child output:', value); -}); -``` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/expand-brackets/LICENSE b/node_modules/expand-brackets/LICENSE deleted file mode 100644 index 1e49edf81..000000000 --- a/node_modules/expand-brackets/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2016, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/expand-brackets/README.md b/node_modules/expand-brackets/README.md deleted file mode 100644 index d3c913e7a..000000000 --- a/node_modules/expand-brackets/README.md +++ /dev/null @@ -1,107 +0,0 @@ -# expand-brackets [![NPM version](https://img.shields.io/npm/v/expand-brackets.svg?style=flat)](https://www.npmjs.com/package/expand-brackets) [![NPM downloads](https://img.shields.io/npm/dm/expand-brackets.svg?style=flat)](https://npmjs.org/package/expand-brackets) [![Build Status](https://img.shields.io/travis/jonschlinkert/expand-brackets.svg?style=flat)](https://travis-ci.org/jonschlinkert/expand-brackets) - -> Expand POSIX bracket expressions (character classes) in glob patterns. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install expand-brackets --save -``` - -## Usage - -```js -var brackets = require('expand-brackets'); - -brackets('[![:lower:]]'); -//=> '[^a-z]' -``` - -## .isMatch - -Return true if the given string matches the bracket expression: - -```js -brackets.isMatch('A', '[![:lower:]]'); -//=> true - -brackets.isMatch('a', '[![:lower:]]'); -//=> false -``` - -## .makeRe - -Make a regular expression from a bracket expression: - -```js -brackets.makeRe('[![:lower:]]'); -//=> /[^a-z]/ -``` - -The following named POSIX bracket expressions are supported: - -* `[:alnum:]`: Alphanumeric characters (`a-zA-Z0-9]`) -* `[:alpha:]`: Alphabetic characters (`a-zA-Z]`) -* `[:blank:]`: Space and tab (`[ t]`) -* `[:digit:]`: Digits (`[0-9]`) -* `[:lower:]`: Lowercase letters (`[a-z]`) -* `[:punct:]`: Punctuation and symbols. (`[!"#$%&'()*+, -./:;<=>?@ [\]^_``{|}~]`) -* `[:upper:]`: Uppercase letters (`[A-Z]`) -* `[:word:]`: Word characters (letters, numbers and underscores) (`[A-Za-z0-9_]`) -* `[:xdigit:]`: Hexadecimal digits (`[A-Fa-f0-9]`) - -Collating sequences are not supported. - -## Related projects - -You might also be interested in these projects: - -* [extglob](https://www.npmjs.com/package/extglob): Convert extended globs to regex-compatible strings. Add (almost) the expressive power of regular expressions to… [more](https://www.npmjs.com/package/extglob) | [homepage](https://github.com/jonschlinkert/extglob) -* [is-extglob](https://www.npmjs.com/package/is-extglob): Returns true if a string has an extglob. | [homepage](https://github.com/jonschlinkert/is-extglob) -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern.… [more](https://www.npmjs.com/package/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob) -* [is-posix-bracket](https://www.npmjs.com/package/is-posix-bracket): Returns true if the given string is a POSIX bracket expression (POSIX character class). | [homepage](https://github.com/jonschlinkert/is-posix-bracket) -* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just… [more](https://www.npmjs.com/package/micromatch) | [homepage](https://github.com/jonschlinkert/micromatch) - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/expand-brackets/issues/new). - -## Building docs - -Generate readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install verb && npm run docs -``` - -Or, if [verb](https://github.com/verbose/verb) is installed globally: - -```sh -$ verb -``` - -## Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -## Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -verb © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/expand-brackets/blob/master/LICENSE). - -*** - -_This file was generated by [verb](https://github.com/verbose/verb), v, on April 01, 2016._ \ No newline at end of file diff --git a/node_modules/expand-brackets/index.js b/node_modules/expand-brackets/index.js deleted file mode 100644 index b843cc2b1..000000000 --- a/node_modules/expand-brackets/index.js +++ /dev/null @@ -1,163 +0,0 @@ -/*! - * expand-brackets - * - * Copyright (c) 2015 Jon Schlinkert. - * Licensed under the MIT license. - */ - -'use strict'; - -var isPosixBracket = require('is-posix-bracket'); - -/** - * POSIX character classes - */ - -var POSIX = { - alnum: 'a-zA-Z0-9', - alpha: 'a-zA-Z', - blank: ' \\t', - cntrl: '\\x00-\\x1F\\x7F', - digit: '0-9', - graph: '\\x21-\\x7E', - lower: 'a-z', - print: '\\x20-\\x7E', - punct: '-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', - space: ' \\t\\r\\n\\v\\f', - upper: 'A-Z', - word: 'A-Za-z0-9_', - xdigit: 'A-Fa-f0-9', -}; - -/** - * Expose `brackets` - */ - -module.exports = brackets; - -function brackets(str) { - if (!isPosixBracket(str)) { - return str; - } - - var negated = false; - if (str.indexOf('[^') !== -1) { - negated = true; - str = str.split('[^').join('['); - } - if (str.indexOf('[!') !== -1) { - negated = true; - str = str.split('[!').join('['); - } - - var a = str.split('['); - var b = str.split(']'); - var imbalanced = a.length !== b.length; - - var parts = str.split(/(?::\]\[:|\[?\[:|:\]\]?)/); - var len = parts.length, i = 0; - var end = '', beg = ''; - var res = []; - - // start at the end (innermost) first - while (len--) { - var inner = parts[i++]; - if (inner === '^[!' || inner === '[!') { - inner = ''; - negated = true; - } - - var prefix = negated ? '^' : ''; - var ch = POSIX[inner]; - - if (ch) { - res.push('[' + prefix + ch + ']'); - } else if (inner) { - if (/^\[?\w-\w\]?$/.test(inner)) { - if (i === parts.length) { - res.push('[' + prefix + inner); - } else if (i === 1) { - res.push(prefix + inner + ']'); - } else { - res.push(prefix + inner); - } - } else { - if (i === 1) { - beg += inner; - } else if (i === parts.length) { - end += inner; - } else { - res.push('[' + prefix + inner + ']'); - } - } - } - } - - var result = res.join('|'); - var rlen = res.length || 1; - if (rlen > 1) { - result = '(?:' + result + ')'; - rlen = 1; - } - if (beg) { - rlen++; - if (beg.charAt(0) === '[') { - if (imbalanced) { - beg = '\\[' + beg.slice(1); - } else { - beg += ']'; - } - } - result = beg + result; - } - if (end) { - rlen++; - if (end.slice(-1) === ']') { - if (imbalanced) { - end = end.slice(0, end.length - 1) + '\\]'; - } else { - end = '[' + end; - } - } - result += end; - } - - if (rlen > 1) { - result = result.split('][').join(']|['); - if (result.indexOf('|') !== -1 && !/\(\?/.test(result)) { - result = '(?:' + result + ')'; - } - } - - result = result.replace(/\[+=|=\]+/g, '\\b'); - return result; -} - -brackets.makeRe = function(pattern) { - try { - return new RegExp(brackets(pattern)); - } catch (err) {} -}; - -brackets.isMatch = function(str, pattern) { - try { - return brackets.makeRe(pattern).test(str); - } catch (err) { - return false; - } -}; - -brackets.match = function(arr, pattern) { - var len = arr.length, i = 0; - var res = arr.slice(); - - var re = brackets.makeRe(pattern); - while (i < len) { - var ele = arr[i++]; - if (!re.test(ele)) { - continue; - } - res.splice(i, 1); - } - return res; -}; diff --git a/node_modules/expand-brackets/package.json b/node_modules/expand-brackets/package.json deleted file mode 100644 index f5f4fe80a..000000000 --- a/node_modules/expand-brackets/package.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "_from": "expand-brackets@^0.1.4", - "_id": "expand-brackets@0.1.5", - "_inBundle": false, - "_integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "_location": "/expand-brackets", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "expand-brackets@^0.1.4", - "name": "expand-brackets", - "escapedName": "expand-brackets", - "rawSpec": "^0.1.4", - "saveSpec": null, - "fetchSpec": "^0.1.4" - }, - "_requiredBy": [ - "/micromatch" - ], - "_resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "_shasum": "df07284e342a807cd733ac5af72411e581d1177b", - "_spec": "expand-brackets@^0.1.4", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/micromatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/expand-brackets/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-posix-bracket": "^0.1.0" - }, - "deprecated": false, - "description": "Expand POSIX bracket expressions (character classes) in glob patterns.", - "devDependencies": { - "gulp-format-md": "^0.1.7", - "mocha": "^2.2.5", - "should": "^7.0.2" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/expand-brackets", - "keywords": [ - "bracket", - "character class", - "expression", - "posix" - ], - "license": "MIT", - "main": "index.js", - "name": "expand-brackets", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/expand-brackets.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "run": true, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "extglob", - "is-extglob", - "is-glob", - "is-posix-bracket", - "micromatch" - ] - }, - "reflinks": [ - "verb" - ], - "lint": { - "reflinks": true - } - }, - "version": "0.1.5" -} diff --git a/node_modules/expand-range/LICENSE b/node_modules/expand-range/LICENSE deleted file mode 100644 index b1e51ff71..000000000 --- a/node_modules/expand-range/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2016, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/expand-range/README.md b/node_modules/expand-range/README.md deleted file mode 100644 index 72c7e8c6c..000000000 --- a/node_modules/expand-range/README.md +++ /dev/null @@ -1,145 +0,0 @@ -# expand-range [![NPM version](https://img.shields.io/npm/v/expand-range.svg?style=flat)](https://www.npmjs.com/package/expand-range) [![NPM downloads](https://img.shields.io/npm/dm/expand-range.svg?style=flat)](https://npmjs.org/package/expand-range) [![Build Status](https://img.shields.io/travis/jonschlinkert/expand-range.svg?style=flat)](https://travis-ci.org/jonschlinkert/expand-range) - -Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See the benchmarks. Used by micromatch. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install expand-range --save -``` - -Wraps [fill-range] to do range expansion using `..` separated strings. See [fill-range] for the full list of options and features. - -## Example usage - -```js -var expand = require('expand-range'); -``` - -**Params** - -```js -expand(start, stop, increment); -``` - -* `start`: the number or letter to start with -* `end`: the number or letter to end with -* `increment`: optionally pass the increment to use. works for letters or numbers - -**Examples** - -```js -expand('a..e') -//=> ['a', 'b', 'c', 'd', 'e'] - -expand('a..e..2') -//=> ['a', 'c', 'e'] - -expand('A..E..2') -//=> ['A', 'C', 'E'] - -expand('1..3') -//=> ['1', '2', '3'] - -expand('0..-5') -//=> [ '0', '-1', '-2', '-3', '-4', '-5' ] - -expand('-9..9..3') -//=> [ '-9', '-6', '-3', '0', '3', '6', '9' ]) - -expand('-1..-10..-2') -//=> [ '-1', '-3', '-5', '-7', '-9' ] - -expand('1..10..2') -//=> [ '1', '3', '5', '7', '9' ] -``` - -### Custom function - -Optionally pass a custom function as the second argument: - -```js -expand('a..e', function (val, isNumber, pad, i) { - if (!isNumber) { - return String.fromCharCode(val) + i; - } - return val; -}); -//=> ['a0', 'b1', 'c2', 'd3', 'e4'] -``` - -## Benchmarks - -```sh -# benchmark/fixtures/alpha-lower.js (29 bytes) - brace-expansion x 145,653 ops/sec ±0.89% (87 runs sampled) - expand-range x 453,213 ops/sec ±1.66% (85 runs sampled) - minimatch x 152,193 ops/sec ±1.17% (86 runs sampled) - -# benchmark/fixtures/alpha-upper.js (29 bytes) - brace-expansion x 149,975 ops/sec ±1.10% (88 runs sampled) - expand-range x 459,390 ops/sec ±1.27% (84 runs sampled) - minimatch x 155,253 ops/sec ±1.25% (88 runs sampled) - -# benchmark/fixtures/padded.js (33 bytes) - brace-expansion x 14,694 ops/sec ±1.37% (85 runs sampled) - expand-range x 169,393 ops/sec ±1.76% (80 runs sampled) - minimatch x 15,052 ops/sec ±1.15% (88 runs sampled) - -# benchmark/fixtures/range.js (29 bytes) - brace-expansion x 142,968 ops/sec ±1.35% (86 runs sampled) - expand-range x 465,579 ops/sec ±1.43% (86 runs sampled) - minimatch x 126,872 ops/sec ±1.18% (90 runs sampled) -``` - -## Related projects - -You might also be interested in these projects: - -* [braces](https://www.npmjs.com/package/braces): Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces… [more](https://www.npmjs.com/package/braces) | [homepage](https://github.com/jonschlinkert/braces) -* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or multiplier to… [more](https://www.npmjs.com/package/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range) -* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch) - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/expand-range/issues/new). - -## Building docs - -Generate readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install verb && npm run docs -``` - -Or, if [verb](https://github.com/verbose/verb) is installed globally: - -```sh -$ verb -``` - -## Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -## Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/expand-range/blob/master/LICENSE). - -*** - -_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on May 05, 2016._ \ No newline at end of file diff --git a/node_modules/expand-range/index.js b/node_modules/expand-range/index.js deleted file mode 100644 index 369962a87..000000000 --- a/node_modules/expand-range/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/*! - * expand-range - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT license. - */ - -'use strict'; - -var fill = require('fill-range'); - -module.exports = function expandRange(str, options, fn) { - if (typeof str !== 'string') { - throw new TypeError('expand-range expects a string.'); - } - - if (typeof options === 'function') { - fn = options; - options = {}; - } - - if (typeof options === 'boolean') { - options = {}; - options.makeRe = true; - } - - // create arguments to pass to fill-range - var opts = options || {}; - var args = str.split('..'); - var len = args.length; - if (len > 3) { return str; } - - // if only one argument, it can't expand so return it - if (len === 1) { return args; } - - // if `true`, tell fill-range to regexify the string - if (typeof fn === 'boolean' && fn === true) { - opts.makeRe = true; - } - - args.push(opts); - return fill.apply(null, args.concat(fn)); -}; diff --git a/node_modules/expand-range/package.json b/node_modules/expand-range/package.json deleted file mode 100644 index 97655e3b6..000000000 --- a/node_modules/expand-range/package.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "_from": "expand-range@^1.8.1", - "_id": "expand-range@1.8.2", - "_inBundle": false, - "_integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", - "_location": "/expand-range", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "expand-range@^1.8.1", - "name": "expand-range", - "escapedName": "expand-range", - "rawSpec": "^1.8.1", - "saveSpec": null, - "fetchSpec": "^1.8.1" - }, - "_requiredBy": [ - "/braces" - ], - "_resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "_shasum": "a299effd335fe2721ebae8e257ec79644fc85337", - "_spec": "expand-range@^1.8.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/braces", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/expand-range/issues" - }, - "bundleDependencies": false, - "dependencies": { - "fill-range": "^2.1.0" - }, - "deprecated": false, - "description": "Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See the benchmarks. Used by micromatch.", - "devDependencies": { - "benchmarked": "^0.2.4", - "brace-expansion": "^1.1.4", - "glob": "^7.0.3", - "gulp-format-md": "^0.1.9", - "minimatch": "^3.0.0", - "mocha": "^2.4.5" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/expand-range", - "keywords": [ - "alpha", - "alphabetical", - "bash", - "brace", - "expand", - "expansion", - "glob", - "match", - "matches", - "matching", - "number", - "numerical", - "range", - "ranges", - "sh" - ], - "license": "MIT", - "main": "index.js", - "name": "expand-range", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/expand-range.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "plugins": [ - "gulp-format-md" - ], - "reflinks": [ - "verb" - ], - "toc": false, - "layout": "default", - "lint": { - "reflinks": true - }, - "tasks": [ - "readme" - ], - "related": { - "list": [ - "micromatch", - "fill-range", - "braces" - ] - } - }, - "version": "1.8.2" -} diff --git a/node_modules/extend-shallow/LICENSE b/node_modules/extend-shallow/LICENSE deleted file mode 100644 index 99c936915..000000000 --- a/node_modules/extend-shallow/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2015, 2017, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/extend-shallow/README.md b/node_modules/extend-shallow/README.md deleted file mode 100644 index dee226f45..000000000 --- a/node_modules/extend-shallow/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# extend-shallow [![NPM version](https://img.shields.io/npm/v/extend-shallow.svg?style=flat)](https://www.npmjs.com/package/extend-shallow) [![NPM monthly downloads](https://img.shields.io/npm/dm/extend-shallow.svg?style=flat)](https://npmjs.org/package/extend-shallow) [![NPM total downloads](https://img.shields.io/npm/dt/extend-shallow.svg?style=flat)](https://npmjs.org/package/extend-shallow) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/extend-shallow.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/extend-shallow) - -> Extend an object with the properties of additional objects. node.js/javascript util. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save extend-shallow -``` - -## Usage - -```js -var extend = require('extend-shallow'); - -extend({a: 'b'}, {c: 'd'}) -//=> {a: 'b', c: 'd'} -``` - -Pass an empty object to shallow clone: - -```js -var obj = {}; -extend(obj, {a: 'b'}, {c: 'd'}) -//=> {a: 'b', c: 'd'} -``` - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    - -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") -* [for-in](https://www.npmjs.com/package/for-in): Iterate over the own and inherited enumerable properties of an object, and return an object… [more](https://github.com/jonschlinkert/for-in) | [homepage](https://github.com/jonschlinkert/for-in "Iterate over the own and inherited enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js") -* [for-own](https://www.npmjs.com/package/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) | [homepage](https://github.com/jonschlinkert/for-own "Iterate over the own enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js.") -* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") -* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") -* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 33 | [jonschlinkert](https://github.com/jonschlinkert) | -| 1 | [pdehaan](https://github.com/pdehaan) | - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on November 19, 2017._ \ No newline at end of file diff --git a/node_modules/extend-shallow/index.js b/node_modules/extend-shallow/index.js deleted file mode 100644 index c9582f8f9..000000000 --- a/node_modules/extend-shallow/index.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - -var isExtendable = require('is-extendable'); -var assignSymbols = require('assign-symbols'); - -module.exports = Object.assign || function(obj/*, objects*/) { - if (obj === null || typeof obj === 'undefined') { - throw new TypeError('Cannot convert undefined or null to object'); - } - if (!isObject(obj)) { - obj = {}; - } - for (var i = 1; i < arguments.length; i++) { - var val = arguments[i]; - if (isString(val)) { - val = toObject(val); - } - if (isObject(val)) { - assign(obj, val); - assignSymbols(obj, val); - } - } - return obj; -}; - -function assign(a, b) { - for (var key in b) { - if (hasOwn(b, key)) { - a[key] = b[key]; - } - } -} - -function isString(val) { - return (val && typeof val === 'string'); -} - -function toObject(str) { - var obj = {}; - for (var i in str) { - obj[i] = str[i]; - } - return obj; -} - -function isObject(val) { - return (val && typeof val === 'object') || isExtendable(val); -} - -/** - * Returns true if the given `key` is an own property of `obj`. - */ - -function hasOwn(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} - -function isEnum(obj, key) { - return Object.prototype.propertyIsEnumerable.call(obj, key); -} diff --git a/node_modules/extend-shallow/node_modules/is-extendable/LICENSE b/node_modules/extend-shallow/node_modules/is-extendable/LICENSE deleted file mode 100644 index c0d7f1362..000000000 --- a/node_modules/extend-shallow/node_modules/is-extendable/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2017, Jon Schlinkert. - -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. \ No newline at end of file diff --git a/node_modules/extend-shallow/node_modules/is-extendable/README.md b/node_modules/extend-shallow/node_modules/is-extendable/README.md deleted file mode 100644 index 875b56a73..000000000 --- a/node_modules/extend-shallow/node_modules/is-extendable/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# is-extendable [![NPM version](https://img.shields.io/npm/v/is-extendable.svg?style=flat)](https://www.npmjs.com/package/is-extendable) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-extendable.svg?style=flat)](https://npmjs.org/package/is-extendable) [![NPM total downloads](https://img.shields.io/npm/dt/is-extendable.svg?style=flat)](https://npmjs.org/package/is-extendable) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-extendable.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-extendable) - -> Returns true if a value is a plain object, array or function. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save is-extendable -``` - -## Usage - -```js -var isExtendable = require('is-extendable'); -``` - -Returns true if the value is any of the following: - -* array -* plain object -* function - -## Notes - -All objects in JavaScript can have keys, but it's a pain to check for this, since we ether need to verify that the value is not `null` or `undefined` and: - -* the value is not a primitive, or -* that the object is a plain object, function or array - -Also note that an `extendable` object is not the same as an [extensible object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible), which is one that (in es6) is not sealed, frozen, or marked as non-extensible using `preventExtensions`. - -## Release history - -### v1.0.0 - 2017/07/20 - -**Breaking changes** - -* No longer considers date, regex or error objects to be extendable - -## About - -### Related projects - -* [assign-deep](https://www.npmjs.com/package/assign-deep): Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target… [more](https://github.com/jonschlinkert/assign-deep) | [homepage](https://github.com/jonschlinkert/assign-deep "Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target (first) object.") -* [is-equal-shallow](https://www.npmjs.com/package/is-equal-shallow): Does a shallow comparison of two objects, returning false if the keys or values differ. | [homepage](https://github.com/jonschlinkert/is-equal-shallow "Does a shallow comparison of two objects, returning false if the keys or values differ.") -* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") -* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") -* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 20, 2017._ \ No newline at end of file diff --git a/node_modules/extend-shallow/node_modules/is-extendable/index.d.ts b/node_modules/extend-shallow/node_modules/is-extendable/index.d.ts deleted file mode 100644 index b96d50754..000000000 --- a/node_modules/extend-shallow/node_modules/is-extendable/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export = isExtendable; - -declare function isExtendable(val: any): boolean; - -declare namespace isExtendable {} diff --git a/node_modules/extend-shallow/node_modules/is-extendable/index.js b/node_modules/extend-shallow/node_modules/is-extendable/index.js deleted file mode 100644 index a8b26ad08..000000000 --- a/node_modules/extend-shallow/node_modules/is-extendable/index.js +++ /dev/null @@ -1,14 +0,0 @@ -/*! - * is-extendable - * - * Copyright (c) 2015-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var isPlainObject = require('is-plain-object'); - -module.exports = function isExtendable(val) { - return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); -}; diff --git a/node_modules/extend-shallow/node_modules/is-extendable/package.json b/node_modules/extend-shallow/node_modules/is-extendable/package.json deleted file mode 100644 index 8fa16aa9f..000000000 --- a/node_modules/extend-shallow/node_modules/is-extendable/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "_from": "is-extendable@^1.0.1", - "_id": "is-extendable@1.0.1", - "_inBundle": false, - "_integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "_location": "/extend-shallow/is-extendable", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-extendable@^1.0.1", - "name": "is-extendable", - "escapedName": "is-extendable", - "rawSpec": "^1.0.1", - "saveSpec": null, - "fetchSpec": "^1.0.1" - }, - "_requiredBy": [ - "/extend-shallow" - ], - "_resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "_shasum": "a7470f9e426733d81bd81e1155264e3a3507cab4", - "_spec": "is-extendable@^1.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/extend-shallow", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-extendable/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-plain-object": "^2.0.4" - }, - "deprecated": false, - "description": "Returns true if a value is a plain object, array or function.", - "devDependencies": { - "gulp-format-md": "^1.0.0", - "mocha": "^3.4.2" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/jonschlinkert/is-extendable", - "keywords": [ - "array", - "assign", - "check", - "date", - "extend", - "extendable", - "extensible", - "function", - "is", - "object", - "regex", - "test" - ], - "license": "MIT", - "main": "index.js", - "name": "is-extendable", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-extendable.git" - }, - "scripts": { - "test": "mocha" - }, - "types": "index.d.ts", - "verb": { - "related": { - "list": [ - "assign-deep", - "is-equal-shallow", - "is-plain-object", - "isobject", - "kind-of" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - } - }, - "version": "1.0.1" -} diff --git a/node_modules/extend-shallow/package.json b/node_modules/extend-shallow/package.json deleted file mode 100644 index 196dfa13b..000000000 --- a/node_modules/extend-shallow/package.json +++ /dev/null @@ -1,126 +0,0 @@ -{ - "_from": "extend-shallow@^3.0.2", - "_id": "extend-shallow@3.0.2", - "_inBundle": false, - "_integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "_location": "/extend-shallow", - "_phantomChildren": { - "is-plain-object": "2.0.4" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "extend-shallow@^3.0.2", - "name": "extend-shallow", - "escapedName": "extend-shallow", - "rawSpec": "^3.0.2", - "saveSpec": null, - "fetchSpec": "^3.0.2" - }, - "_requiredBy": [ - "/nanomatch", - "/readdirp/micromatch", - "/regex-not", - "/split-string", - "/to-regex" - ], - "_resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "_shasum": "26a71aaf073b39fb2127172746131c2704028db8", - "_spec": "extend-shallow@^3.0.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/extend-shallow/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Peter deHaan", - "url": "http://about.me/peterdehaan" - } - ], - "dependencies": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "deprecated": false, - "description": "Extend an object with the properties of additional objects. node.js/javascript util.", - "devDependencies": { - "array-slice": "^1.0.0", - "benchmarked": "^2.0.0", - "for-own": "^1.0.0", - "gulp-format-md": "^1.0.0", - "is-plain-object": "^2.0.4", - "kind-of": "^6.0.1", - "minimist": "^1.2.0", - "mocha": "^3.5.3", - "object-assign": "^4.1.1" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/extend-shallow", - "keywords": [ - "assign", - "clone", - "extend", - "merge", - "obj", - "object", - "object-assign", - "object.assign", - "prop", - "properties", - "property", - "props", - "shallow", - "util", - "utility", - "utils", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "extend-shallow", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/extend-shallow.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "related": { - "list": [ - "extend-shallow", - "for-in", - "for-own", - "is-plain-object", - "isobject", - "kind-of" - ] - }, - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - } - }, - "version": "3.0.2" -} diff --git a/node_modules/extglob/LICENSE b/node_modules/extglob/LICENSE deleted file mode 100644 index 65f90aca8..000000000 --- a/node_modules/extglob/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/extglob/README.md b/node_modules/extglob/README.md deleted file mode 100644 index 666440669..000000000 --- a/node_modules/extglob/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# extglob [![NPM version](https://badge.fury.io/js/extglob.svg)](http://badge.fury.io/js/extglob) [![Build Status](https://travis-ci.org/jonschlinkert/extglob.svg)](https://travis-ci.org/jonschlinkert/extglob) - -> Convert extended globs to regex-compatible strings. Add (almost) the expressive power of regular expressions to glob patterns. - -Install with [npm](https://www.npmjs.com/) - -```sh -$ npm i extglob --save -``` - -Used by [micromatch](https://github.com/jonschlinkert/micromatch). - -**Features** - -* Convert an extglob string to a regex-compatible string. **Only converts extglobs**, to handle full globs use [micromatch](https://github.com/jonschlinkert/micromatch). -* Pass `{regex: true}` to return a regex -* Handles nested patterns -* More complete (and correct) support than [minimatch](https://github.com/isaacs/minimatch) - -## Usage - -```js -var extglob = require('extglob'); - -extglob('?(z)'); -//=> '(?:z)?' -extglob('*(z)'); -//=> '(?:z)*' -extglob('+(z)'); -//=> '(?:z)+' -extglob('@(z)'); -//=> '(?:z)' -extglob('!(z)'); -//=> '(?!^(?:(?!z)[^/]*?)).*$' -``` - -**Optionally return regex** - -```js -extglob('!(z)', {regex: true}); -//=> /(?!^(?:(?!z)[^/]*?)).*$/ -``` - -## Extglob patterns - -To learn more about how extglobs work, see the docs for [Bash pattern matching](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html): - -* `?(pattern)`: Match zero or one occurrence of the given pattern. -* `*(pattern)`: Match zero or more occurrences of the given pattern. -* `+(pattern)`: Match one or more occurrences of the given pattern. -* `@(pattern)`: Match one of the given pattern. -* `!(pattern)`: Match anything except one of the given pattern. - -## Related - -* [braces](https://github.com/jonschlinkert/braces): Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces… [more](https://github.com/jonschlinkert/braces) -* [expand-brackets](https://github.com/jonschlinkert/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. -* [expand-range](https://github.com/jonschlinkert/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See… [more](https://github.com/jonschlinkert/expand-range) -* [fill-range](https://github.com/jonschlinkert/fill-range): Fill in a range of numbers or letters, optionally passing an increment or multiplier to… [more](https://github.com/jonschlinkert/fill-range) -* [micromatch](https://github.com/jonschlinkert/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just… [more](https://github.com/jonschlinkert/micromatch) - -## Run tests - -Install dev dependencies: - -```sh -$ npm i -d && npm test -``` - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/extglob/issues/new) - -## Author - -**Jon Schlinkert** - -+ [github/jonschlinkert](https://github.com/jonschlinkert) -+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2015 Jon Schlinkert -Released under the MIT license. - -*** - -_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 01, 2015._ \ No newline at end of file diff --git a/node_modules/extglob/index.js b/node_modules/extglob/index.js deleted file mode 100644 index 2e774d4aa..000000000 --- a/node_modules/extglob/index.js +++ /dev/null @@ -1,178 +0,0 @@ -/*! - * extglob - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -/** - * Module dependencies - */ - -var isExtglob = require('is-extglob'); -var re, cache = {}; - -/** - * Expose `extglob` - */ - -module.exports = extglob; - -/** - * Convert the given extglob `string` to a regex-compatible - * string. - * - * ```js - * var extglob = require('extglob'); - * extglob('!(a?(b))'); - * //=> '(?!a(?:b)?)[^/]*?' - * ``` - * - * @param {String} `str` The string to convert. - * @param {Object} `options` - * @option {Boolean} [options] `esc` If `false` special characters will not be escaped. Defaults to `true`. - * @option {Boolean} [options] `regex` If `true` a regular expression is returned instead of a string. - * @return {String} - * @api public - */ - - -function extglob(str, opts) { - opts = opts || {}; - var o = {}, i = 0; - - // fix common character reversals - // '*!(.js)' => '*.!(js)' - str = str.replace(/!\(([^\w*()])/g, '$1!('); - - // support file extension negation - str = str.replace(/([*\/])\.!\([*]\)/g, function (m, ch) { - if (ch === '/') { - return escape('\\/[^.]+'); - } - return escape('[^.]+'); - }); - - // create a unique key for caching by - // combining the string and options - var key = str - + String(!!opts.regex) - + String(!!opts.contains) - + String(!!opts.escape); - - if (cache.hasOwnProperty(key)) { - return cache[key]; - } - - if (!(re instanceof RegExp)) { - re = regex(); - } - - opts.negate = false; - var m; - - while (m = re.exec(str)) { - var prefix = m[1]; - var inner = m[3]; - if (prefix === '!') { - opts.negate = true; - } - - var id = '__EXTGLOB_' + (i++) + '__'; - // use the prefix of the _last_ (outtermost) pattern - o[id] = wrap(inner, prefix, opts.escape); - str = str.split(m[0]).join(id); - } - - var keys = Object.keys(o); - var len = keys.length; - - // we have to loop again to allow us to convert - // patterns in reverse order (starting with the - // innermost/last pattern first) - while (len--) { - var prop = keys[len]; - str = str.split(prop).join(o[prop]); - } - - var result = opts.regex - ? toRegex(str, opts.contains, opts.negate) - : str; - - result = result.split('.').join('\\.'); - - // cache the result and return it - return (cache[key] = result); -} - -/** - * Convert `string` to a regex string. - * - * @param {String} `str` - * @param {String} `prefix` Character that determines how to wrap the string. - * @param {Boolean} `esc` If `false` special characters will not be escaped. Defaults to `true`. - * @return {String} - */ - -function wrap(inner, prefix, esc) { - if (esc) inner = escape(inner); - - switch (prefix) { - case '!': - return '(?!' + inner + ')[^/]' + (esc ? '%%%~' : '*?'); - case '@': - return '(?:' + inner + ')'; - case '+': - return '(?:' + inner + ')+'; - case '*': - return '(?:' + inner + ')' + (esc ? '%%' : '*') - case '?': - return '(?:' + inner + '|)'; - default: - return inner; - } -} - -function escape(str) { - str = str.split('*').join('[^/]%%%~'); - str = str.split('.').join('\\.'); - return str; -} - -/** - * extglob regex. - */ - -function regex() { - return /(\\?[@?!+*$]\\?)(\(([^()]*?)\))/; -} - -/** - * Negation regex - */ - -function negate(str) { - return '(?!^' + str + ').*$'; -} - -/** - * Create the regex to do the matching. If - * the leading character in the `pattern` is `!` - * a negation regex is returned. - * - * @param {String} `pattern` - * @param {Boolean} `contains` Allow loose matching. - * @param {Boolean} `isNegated` True if the pattern is a negation pattern. - */ - -function toRegex(pattern, contains, isNegated) { - var prefix = contains ? '^' : ''; - var after = contains ? '$' : ''; - pattern = ('(?:' + pattern + ')' + after); - if (isNegated) { - pattern = prefix + negate(pattern); - } - return new RegExp(prefix + pattern); -} diff --git a/node_modules/extglob/package.json b/node_modules/extglob/package.json deleted file mode 100644 index e8ea71e8d..000000000 --- a/node_modules/extglob/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "_from": "extglob@^0.3.1", - "_id": "extglob@0.3.2", - "_inBundle": false, - "_integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "_location": "/extglob", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "extglob@^0.3.1", - "name": "extglob", - "escapedName": "extglob", - "rawSpec": "^0.3.1", - "saveSpec": null, - "fetchSpec": "^0.3.1" - }, - "_requiredBy": [ - "/micromatch" - ], - "_resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "_shasum": "2e18ff3d2f49ab2765cec9023f011daa8d8349a1", - "_spec": "extglob@^0.3.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/micromatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/extglob/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-extglob": "^1.0.0" - }, - "deprecated": false, - "description": "Convert extended globs to regex-compatible strings. Add (almost) the expressive power of regular expressions to glob patterns.", - "devDependencies": { - "ansi-green": "^0.1.1", - "micromatch": "^2.1.6", - "minimatch": "^2.0.1", - "minimist": "^1.1.0", - "mocha": "*", - "should": "*", - "success-symbol": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/extglob", - "keywords": [ - "bash", - "extended", - "extglob", - "glob", - "ksh", - "match", - "wildcard" - ], - "license": "MIT", - "main": "index.js", - "name": "extglob", - "repository": { - "type": "git", - "url": "git://github.com/jonschlinkert/extglob.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "micromatch", - "expand-brackets", - "braces", - "fill-range", - "expand-range" - ] - } - }, - "version": "0.3.2" -} diff --git a/node_modules/filename-regex/LICENSE b/node_modules/filename-regex/LICENSE deleted file mode 100644 index d290fe00b..000000000 --- a/node_modules/filename-regex/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2015, 2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/filename-regex/README.md b/node_modules/filename-regex/README.md deleted file mode 100644 index 2b6b06999..000000000 --- a/node_modules/filename-regex/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# filename-regex [![NPM version](https://img.shields.io/npm/v/filename-regex.svg?style=flat)](https://www.npmjs.com/package/filename-regex) [![NPM monthly downloads](https://img.shields.io/npm/dm/filename-regex.svg?style=flat)](https://npmjs.org/package/filename-regex) [![NPM total downloads](https://img.shields.io/npm/dt/filename-regex.svg?style=flat)](https://npmjs.org/package/filename-regex) [![Linux Build Status](https://img.shields.io/travis/regexhq/filename-regex.svg?style=flat&label=Travis)](https://travis-ci.org/regexhq/filename-regex) - -> Regular expression for matching file names, with or without extension. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save filename-regex -``` - -## Usage - -```js -var regex = require('filename-regex'); - -'a/b/c/d.min.js'.match(regex()); -//=> match[0] = 'd.min.js' - -'a/b/c/.dotfile'.match(regex()); -//=> match[0] = '.dotfile' -``` - -## About - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.3, on April 28, 2017._ \ No newline at end of file diff --git a/node_modules/filename-regex/index.js b/node_modules/filename-regex/index.js deleted file mode 100644 index bb1888b4a..000000000 --- a/node_modules/filename-regex/index.js +++ /dev/null @@ -1,10 +0,0 @@ -/*! - * filename-regex - * - * Copyright (c) 2014-2015, Jon Schlinkert - * Licensed under the MIT license. - */ - -module.exports = function filenameRegex() { - return /([^\\\/]+)$/; -}; diff --git a/node_modules/filename-regex/package.json b/node_modules/filename-regex/package.json deleted file mode 100644 index 71e1794fd..000000000 --- a/node_modules/filename-regex/package.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "_from": "filename-regex@^2.0.0", - "_id": "filename-regex@2.0.1", - "_inBundle": false, - "_integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", - "_location": "/filename-regex", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "filename-regex@^2.0.0", - "name": "filename-regex", - "escapedName": "filename-regex", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/micromatch" - ], - "_resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "_shasum": "c1c4b9bee3e09725ddb106b75c1e301fe2f18b26", - "_spec": "filename-regex@^2.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/micromatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/regexhq/filename-regex/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Regular expression for matching file names, with or without extension.", - "devDependencies": { - "gulp-format-md": "^0.1.12" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/regexhq/filename-regex", - "keywords": [ - "basename", - "file", - "filename", - "filepath", - "match", - "name", - "path", - "regex", - "regexp", - "regular expression" - ], - "license": "MIT", - "main": "index.js", - "name": "filename-regex", - "repository": { - "type": "git", - "url": "git+https://github.com/regexhq/filename-regex.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - } - }, - "version": "2.0.1" -} diff --git a/node_modules/fill-range/LICENSE b/node_modules/fill-range/LICENSE deleted file mode 100644 index d32ab4426..000000000 --- a/node_modules/fill-range/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2018, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/fill-range/README.md b/node_modules/fill-range/README.md deleted file mode 100644 index b70015b98..000000000 --- a/node_modules/fill-range/README.md +++ /dev/null @@ -1,317 +0,0 @@ -# fill-range [![NPM version](https://img.shields.io/npm/v/fill-range.svg?style=flat)](https://www.npmjs.com/package/fill-range) [![NPM monthly downloads](https://img.shields.io/npm/dm/fill-range.svg?style=flat)](https://npmjs.org/package/fill-range) [![NPM total downloads](https://img.shields.io/npm/dt/fill-range.svg?style=flat)](https://npmjs.org/package/fill-range) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/fill-range.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/fill-range) - -> Fill in a range of numbers or letters, optionally passing an increment or multiplier to use. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -- [Install](#install) -- [Usage](#usage) - * [Invalid ranges](#invalid-ranges) - * [Custom function](#custom-function) - * [Special characters](#special-characters) - + [plus](#plus) - + [pipe and tilde](#pipe-and-tilde) - + [angle bracket](#angle-bracket) - + [question mark](#question-mark) -- [About](#about) - -_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save fill-range -``` - -## Usage - -```js -var range = require('fill-range'); - -range('a', 'e'); -//=> ['a', 'b', 'c', 'd', 'e'] -``` - -**Params** - -```js -range(start, stop, step, options, fn); -``` - -* `start`: **{String|Number}** the number or letter to start with -* `end`: **{String|Number}** the number or letter to end with -* `step`: **{String|Number}** optionally pass the step to use. works for letters or numbers. -* `options`: **{Object}**: - - `makeRe`: return a regex-compatible string (still returned as an array for consistency) - - `step`: pass the step on the options as an alternative to passing it as an argument - - `silent`: `true` by default, set to false to throw errors for invalid ranges. -* `fn`: **{Function}** optionally [pass a function](#custom-function) to modify each character - -**Examples** - -```js -range(1, 3) -//=> ['1', '2', '3'] - -range('1', '3') -//=> ['1', '2', '3'] - -range('0', '-5') -//=> [ '0', '-1', '-2', '-3', '-4', '-5' ] - -range(-9, 9, 3) -//=> [ '-9', '-6', '-3', '0', '3', '6', '9' ]) - -range('-1', '-10', '-2') -//=> [ '-1', '-3', '-5', '-7', '-9' ] - -range('1', '10', '2') -//=> [ '1', '3', '5', '7', '9' ] - -range('a', 'e') -//=> ['a', 'b', 'c', 'd', 'e'] - -range('a', 'e', 2) -//=> ['a', 'c', 'e'] - -range('A', 'E', 2) -//=> ['A', 'C', 'E'] -``` - -### Invalid ranges - -When an invalid range is passed, `null` is returned. - -```js -range('1.1', '2'); -//=> null - -range('a', '2'); -//=> null - -range(1, 10, 'foo'); -//=> null -``` - -If you want errors to be throw, pass `silent: false` on the options: - -### Custom function - -Optionally pass a custom function as the third or fourth argument: - -```js -range('a', 'e', function (val, isNumber, pad, i) { - if (!isNumber) { - return String.fromCharCode(val) + i; - } - return val; -}); -//=> ['a0', 'b1', 'c2', 'd3', 'e4'] -``` - -### Special characters - -A special character may be passed as the third arg instead of a step increment. These characters can be pretty useful for brace expansion, creating file paths, test fixtures and similar use case. - -```js -range('a', 'z', SPECIAL_CHARACTER_HERE); -``` - -**Supported characters** - -* `+`: repeat the given string `n` times -* `|`: create a regex-ready string, instead of an array -* `>`: join values to single array element -* `?`: randomize the given pattern using [randomatic] - -#### plus - -Character: _(`+`)_ - -Repeat the first argument the number of times passed on the second argument. - -**Examples:** - -```js -range('a', 3, '+'); -//=> ['a', 'a', 'a'] - -range('abc', 2, '+'); -//=> ['abc', 'abc'] -``` - -#### pipe and tilde - -Characters: _(`|` and `~`)_ - -Creates a regex-capable string (either a logical `or` or a character class) from the expanded arguments. - -**Examples:** - -```js -range('a', 'c', '|'); -//=> ['(a|b|c)' - -range('a', 'c', '~'); -//=> ['[a-c]' - -range('a', 'z', '|5'); -//=> ['(a|f|k|p|u|z)' -``` - -**Automatic separator correction** - -To avoid this error: - -> `Range out of order in character class` - -Fill-range detects invalid sequences and uses the correct syntax. For example: - -**invalid** (regex) - -If you pass these: - -```js -range('a', 'z', '~5'); -// which would result in this -//=> ['[a-f-k-p-u-z]'] - -range('10', '20', '~'); -// which would result in this -//=> ['[10-20]'] -``` - -**valid** (regex) - -fill-range corrects them to this: - -```js -range('a', 'z', '~5'); -//=> ['(a|f|k|p|u|z)' - -range('10', '20', '~'); -//=> ['(10-20)' -``` - -#### angle bracket - -Character: _(`>`)_ - -Joins all values in the returned array to a single value. - -**Examples:** - -```js -range('a', 'e', '>'); -//=> ['abcde'] - -range('5', '8', '>'); -//=> ['5678'] - -range('2', '20', '2>'); -//=> ['2468101214161820'] -``` - -#### question mark - -Character: _(`?`)_ - -Uses [randomatic] to generate randomized alpha, numeric, or alpha-numeric patterns based on the provided arguments. - -**Examples:** - -_(actual results would obviously be randomized)_ - -Generate a 5-character, uppercase, alphabetical string: - -```js -range('A', 5, '?'); -//=> ['NSHAK'] -``` - -Generate a 5-digit random number: - -```js -range('0', 5, '?'); -//=> ['36583'] -``` - -Generate a 10-character alpha-numeric string: - -```js -range('A0', 10, '?'); -//=> ['5YJD60VQNN'] -``` - -See the [randomatic] repo for all available options and or to create issues or feature requests related to randomization. - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    - -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [braces](https://www.npmjs.com/package/braces): Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support… [more](https://github.com/micromatch/braces) | [homepage](https://github.com/micromatch/braces "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.") -* [expand-range](https://www.npmjs.com/package/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. Used… [more](https://github.com/jonschlinkert/expand-range) | [homepage](https://github.com/jonschlinkert/expand-range "Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. Used by [micromatch].") -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") -* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/micromatch/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 111 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [paulmillr](https://github.com/paulmillr) | -| 1 | [edorivai](https://github.com/edorivai) | -| 1 | [realityking](https://github.com/realityking) | -| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | - -### Author - -**Jon Schlinkert** - -* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) -* [GitHub Profile](https://github.com/jonschlinkert) -* [Twitter Profile](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 08, 2018._ \ No newline at end of file diff --git a/node_modules/fill-range/index.js b/node_modules/fill-range/index.js deleted file mode 100644 index 4c0fe8dd4..000000000 --- a/node_modules/fill-range/index.js +++ /dev/null @@ -1,408 +0,0 @@ -/*! - * fill-range - * - * Copyright (c) 2014-2018, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var isObject = require('isobject'); -var isNumber = require('is-number'); -var randomize = require('randomatic'); -var repeatStr = require('repeat-string'); -var repeat = require('repeat-element'); - -/** - * Expose `fillRange` - */ - -module.exports = fillRange; - -/** - * Return a range of numbers or letters. - * - * @param {String} `a` Start of the range - * @param {String} `b` End of the range - * @param {String} `step` Increment or decrement to use. - * @param {Function} `fn` Custom function to modify each element in the range. - * @return {Array} - */ - -function fillRange(a, b, step, options, fn) { - if (a == null || b == null) { - throw new Error('fill-range expects the first and second args to be strings.'); - } - - if (typeof step === 'function') { - fn = step; options = {}; step = null; - } - - if (typeof options === 'function') { - fn = options; options = {}; - } - - if (isObject(step)) { - options = step; step = ''; - } - - var expand, regex = false, sep = ''; - var opts = options || {}; - - if (typeof opts.silent === 'undefined') { - opts.silent = true; - } - - step = step || opts.step; - - // store a ref to unmodified arg - var origA = a, origB = b; - - b = (b.toString() === '-0') ? 0 : b; - - if (opts.optimize || opts.makeRe) { - step = step ? (step += '~') : step; - expand = true; - regex = true; - sep = '~'; - } - - // handle special step characters - if (typeof step === 'string') { - var match = stepRe().exec(step); - - if (match) { - var i = match.index; - var m = match[0]; - - // repeat string - if (m === '+') { - return repeat(a, b); - - // randomize a, `b` times - } else if (m === '?') { - return [randomize(a, b)]; - - // expand right, no regex reduction - } else if (m === '>') { - step = step.substr(0, i) + step.substr(i + 1); - expand = true; - - // expand to an array, or if valid create a reduced - // string for a regex logic `or` - } else if (m === '|') { - step = step.substr(0, i) + step.substr(i + 1); - expand = true; - regex = true; - sep = m; - - // expand to an array, or if valid create a reduced - // string for a regex range - } else if (m === '~') { - step = step.substr(0, i) + step.substr(i + 1); - expand = true; - regex = true; - sep = m; - } - } else if (!isNumber(step)) { - if (!opts.silent) { - throw new TypeError('fill-range: invalid step.'); - } - return null; - } - } - - if (/[.&*()[\]^%$#@!]/.test(a) || /[.&*()[\]^%$#@!]/.test(b)) { - if (!opts.silent) { - throw new RangeError('fill-range: invalid range arguments.'); - } - return null; - } - - // has neither a letter nor number, or has both letters and numbers - // this needs to be after the step logic - if (!noAlphaNum(a) || !noAlphaNum(b) || hasBoth(a) || hasBoth(b)) { - if (!opts.silent) { - throw new RangeError('fill-range: invalid range arguments.'); - } - return null; - } - - // validate arguments - var isNumA = isNumber(zeros(a)); - var isNumB = isNumber(zeros(b)); - - if ((!isNumA && isNumB) || (isNumA && !isNumB)) { - if (!opts.silent) { - throw new TypeError('fill-range: first range argument is incompatible with second.'); - } - return null; - } - - // by this point both are the same, so we - // can use A to check going forward. - var isNum = isNumA; - var num = formatStep(step); - - // is the range alphabetical? or numeric? - if (isNum) { - // if numeric, coerce to an integer - a = +a; b = +b; - } else { - // otherwise, get the charCode to expand alpha ranges - a = a.charCodeAt(0); - b = b.charCodeAt(0); - } - - // is the pattern descending? - var isDescending = a > b; - - // don't create a character class if the args are < 0 - if (a < 0 || b < 0) { - expand = false; - regex = false; - } - - // detect padding - var padding = isPadded(origA, origB); - var res, pad, arr = []; - var ii = 0; - - // character classes, ranges and logical `or` - if (regex) { - if (shouldExpand(a, b, num, isNum, padding, opts)) { - // make sure the correct separator is used - if (sep === '|' || sep === '~') { - sep = detectSeparator(a, b, num, isNum, isDescending); - } - return wrap([origA, origB], sep, opts); - } - } - - while (isDescending ? (a >= b) : (a <= b)) { - if (padding && isNum) { - pad = padding(a); - } - - // custom function - if (typeof fn === 'function') { - res = fn(a, isNum, pad, ii++); - - // letters - } else if (!isNum) { - if (regex && isInvalidChar(a)) { - res = null; - } else { - res = String.fromCharCode(a); - } - - // numbers - } else { - res = formatPadding(a, pad); - } - - // add result to the array, filtering any nulled values - if (res !== null) arr.push(res); - - // increment or decrement - if (isDescending) { - a -= num; - } else { - a += num; - } - } - - // now that the array is expanded, we need to handle regex - // character classes, ranges or logical `or` that wasn't - // already handled before the loop - if ((regex || expand) && !opts.noexpand) { - // make sure the correct separator is used - if (sep === '|' || sep === '~') { - sep = detectSeparator(a, b, num, isNum, isDescending); - } - if (arr.length === 1 || a < 0 || b < 0) { return arr; } - return wrap(arr, sep, opts); - } - - return arr; -} - -/** - * Wrap the string with the correct regex - * syntax. - */ - -function wrap(arr, sep, opts) { - if (sep === '~') { sep = '-'; } - var str = arr.join(sep); - var pre = opts && opts.regexPrefix; - - // regex logical `or` - if (sep === '|') { - str = pre ? pre + str : str; - str = '(' + str + ')'; - } - - // regex character class - if (sep === '-') { - str = (pre && pre === '^') - ? pre + str - : str; - str = '[' + str + ']'; - } - return [str]; -} - -/** - * Check for invalid characters - */ - -function isCharClass(a, b, step, isNum, isDescending) { - if (isDescending) { return false; } - if (isNum) { return a <= 9 && b <= 9; } - if (a < b) { return step === 1; } - return false; -} - -/** - * Detect the correct separator to use - */ - -function shouldExpand(a, b, num, isNum, padding, opts) { - if (isNum && (a > 9 || b > 9)) { return false; } - return !padding && num === 1 && a < b; -} - -/** - * Detect the correct separator to use - */ - -function detectSeparator(a, b, step, isNum, isDescending) { - var isChar = isCharClass(a, b, step, isNum, isDescending); - if (!isChar) { - return '|'; - } - return '~'; -} - -/** - * Correctly format the step based on type - */ - -function formatStep(step) { - return Math.abs(step >> 0) || 1; -} - -/** - * Format padding, taking leading `-` into account - */ - -function formatPadding(ch, pad) { - var res = pad ? pad + ch : ch; - if (pad && ch.toString().charAt(0) === '-') { - res = '-' + pad + ch.toString().substr(1); - } - return res.toString(); -} - -/** - * Check for invalid characters - */ - -function isInvalidChar(str) { - var ch = toStr(str); - return ch === '\\' - || ch === '[' - || ch === ']' - || ch === '^' - || ch === '(' - || ch === ')' - || ch === '`'; -} - -/** - * Convert to a string from a charCode - */ - -function toStr(ch) { - return String.fromCharCode(ch); -} - - -/** - * Step regex - */ - -function stepRe() { - return /\?|>|\||\+|\~/g; -} - -/** - * Return true if `val` has either a letter - * or a number - */ - -function noAlphaNum(val) { - return /[a-z0-9]/i.test(val); -} - -/** - * Return true if `val` has both a letter and - * a number (invalid) - */ - -function hasBoth(val) { - return /[a-z][0-9]|[0-9][a-z]/i.test(val); -} - -/** - * Normalize zeros for checks - */ - -function zeros(val) { - if (/^-*0+$/.test(val.toString())) { - return '0'; - } - return val; -} - -/** - * Return true if `val` has leading zeros, - * or a similar valid pattern. - */ - -function hasZeros(val) { - return /[^.]\.|^-*0+[0-9]/.test(val); -} - -/** - * If the string is padded, returns a curried function with - * the a cached padding string, or `false` if no padding. - * - * @param {*} `origA` String or number. - * @return {String|Boolean} - */ - -function isPadded(origA, origB) { - if (hasZeros(origA) || hasZeros(origB)) { - var alen = length(origA); - var blen = length(origB); - - var len = alen >= blen - ? alen - : blen; - - return function (a) { - return repeatStr('0', len - length(a)); - }; - } - return false; -} - -/** - * Get the string length of `val` - */ - -function length(val) { - return val.toString().length; -} diff --git a/node_modules/fill-range/package.json b/node_modules/fill-range/package.json deleted file mode 100644 index 5ad6918b9..000000000 --- a/node_modules/fill-range/package.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "_from": "fill-range@^2.1.0", - "_id": "fill-range@2.2.4", - "_inBundle": false, - "_integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", - "_location": "/fill-range", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "fill-range@^2.1.0", - "name": "fill-range", - "escapedName": "fill-range", - "rawSpec": "^2.1.0", - "saveSpec": null, - "fetchSpec": "^2.1.0" - }, - "_requiredBy": [ - "/expand-range" - ], - "_resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", - "_shasum": "eb1e773abb056dcd8df2bfdf6af59b8b3a936565", - "_spec": "fill-range@^2.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/expand-range", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/fill-range/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-number": "^2.1.0", - "isobject": "^2.0.0", - "randomatic": "^3.0.0", - "repeat-element": "^1.1.2", - "repeat-string": "^1.5.2" - }, - "deprecated": false, - "description": "Fill in a range of numbers or letters, optionally passing an increment or multiplier to use.", - "devDependencies": { - "benchmarked": "^0.1.3", - "chalk": "^0.5.1", - "gulp-format-md": "^1.0.0", - "should": "^13.2.1" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/fill-range", - "keywords": [ - "alpha", - "alphabetical", - "bash", - "brace", - "expand", - "expansion", - "fill", - "glob", - "match", - "matches", - "matching", - "number", - "numerical", - "range", - "ranges", - "sh" - ], - "license": "MIT", - "main": "index.js", - "name": "fill-range", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/fill-range.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": true, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "braces", - "expand-range", - "is-glob", - "micromatch" - ] - }, - "lint": { - "reflinks": true - }, - "reflinks": [ - "micromatch", - "randomatic" - ] - }, - "version": "2.2.4" -} diff --git a/node_modules/for-in/LICENSE b/node_modules/for-in/LICENSE deleted file mode 100644 index d734237bd..000000000 --- a/node_modules/for-in/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/for-in/README.md b/node_modules/for-in/README.md deleted file mode 100644 index 874e1895a..000000000 --- a/node_modules/for-in/README.md +++ /dev/null @@ -1,85 +0,0 @@ -# for-in [![NPM version](https://img.shields.io/npm/v/for-in.svg?style=flat)](https://www.npmjs.com/package/for-in) [![NPM monthly downloads](https://img.shields.io/npm/dm/for-in.svg?style=flat)](https://npmjs.org/package/for-in) [![NPM total downloads](https://img.shields.io/npm/dt/for-in.svg?style=flat)](https://npmjs.org/package/for-in) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/for-in.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/for-in) - -> Iterate over the own and inherited enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save for-in -``` - -## Usage - -```js -var forIn = require('for-in'); - -var obj = {a: 'foo', b: 'bar', c: 'baz'}; -var values = []; -var keys = []; - -forIn(obj, function (value, key, o) { - keys.push(key); - values.push(value); -}); - -console.log(keys); -//=> ['a', 'b', 'c']; - -console.log(values); -//=> ['foo', 'bar', 'baz']; -``` - -## About - -### Related projects - -* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays. This is the fastest implementation of array flatten.") -* [collection-map](https://www.npmjs.com/package/collection-map): Returns an array of mapped values from an array or object. | [homepage](https://github.com/jonschlinkert/collection-map "Returns an array of mapped values from an array or object.") -* [for-own](https://www.npmjs.com/package/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) | [homepage](https://github.com/jonschlinkert/for-own "Iterate over the own enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 16 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [paulirish](https://github.com/paulirish) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 28, 2017._ \ No newline at end of file diff --git a/node_modules/for-in/index.js b/node_modules/for-in/index.js deleted file mode 100644 index 0b5f95f02..000000000 --- a/node_modules/for-in/index.js +++ /dev/null @@ -1,16 +0,0 @@ -/*! - * for-in - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -module.exports = function forIn(obj, fn, thisArg) { - for (var key in obj) { - if (fn.call(thisArg, obj[key], key, obj) === false) { - break; - } - } -}; diff --git a/node_modules/for-in/package.json b/node_modules/for-in/package.json deleted file mode 100644 index 872f1c0bd..000000000 --- a/node_modules/for-in/package.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "_from": "for-in@^1.0.1", - "_id": "for-in@1.0.2", - "_inBundle": false, - "_integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "_location": "/for-in", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "for-in@^1.0.1", - "name": "for-in", - "escapedName": "for-in", - "rawSpec": "^1.0.1", - "saveSpec": null, - "fetchSpec": "^1.0.1" - }, - "_requiredBy": [ - "/for-own", - "/mixin-deep" - ], - "_resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "_shasum": "81068d295a8142ec0ac726c6e2200c30fb6d5e80", - "_spec": "for-in@^1.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/for-own", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/for-in/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jon Schlinkert", - "email": "jon.schlinkert@sellside.com", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Paul Irish", - "url": "http://paulirish.com" - } - ], - "deprecated": false, - "description": "Iterate over the own and inherited enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js", - "devDependencies": { - "gulp-format-md": "^0.1.11", - "mocha": "^3.2.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/for-in", - "keywords": [ - "for", - "for-in", - "for-own", - "has", - "has-own", - "hasOwn", - "in", - "key", - "keys", - "object", - "own", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "for-in", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/for-in.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "run": true, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "arr-flatten", - "collection-map", - "for-own" - ] - }, - "reflinks": [ - "verb" - ], - "lint": { - "reflinks": true - } - }, - "version": "1.0.2" -} diff --git a/node_modules/for-own/LICENSE b/node_modules/for-own/LICENSE deleted file mode 100644 index d290fe00b..000000000 --- a/node_modules/for-own/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2015, 2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/for-own/README.md b/node_modules/for-own/README.md deleted file mode 100644 index fd56877ae..000000000 --- a/node_modules/for-own/README.md +++ /dev/null @@ -1,85 +0,0 @@ -# for-own [![NPM version](https://img.shields.io/npm/v/for-own.svg?style=flat)](https://www.npmjs.com/package/for-own) [![NPM monthly downloads](https://img.shields.io/npm/dm/for-own.svg?style=flat)](https://npmjs.org/package/for-own) [![NPM total downloads](https://img.shields.io/npm/dt/for-own.svg?style=flat)](https://npmjs.org/package/for-own) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/for-own.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/for-own) - -> Iterate over the own enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save for-own -``` - -## Usage - -```js -var forOwn = require('for-own'); - -var obj = {a: 'foo', b: 'bar', c: 'baz'}; -var values = []; -var keys = []; - -forOwn(obj, function (value, key, o) { - keys.push(key); - values.push(value); -}); - -console.log(keys); -//=> ['a', 'b', 'c']; - -console.log(values); -//=> ['foo', 'bar', 'baz']; -``` - -## About - -### Related projects - -* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays. This is the fastest implementation of array flatten.") -* [collection-map](https://www.npmjs.com/package/collection-map): Returns an array of mapped values from an array or object. | [homepage](https://github.com/jonschlinkert/collection-map "Returns an array of mapped values from an array or object.") -* [for-in](https://www.npmjs.com/package/for-in): Iterate over the own and inherited enumerable properties of an object, and return an object… [more](https://github.com/jonschlinkert/for-in) | [homepage](https://github.com/jonschlinkert/for-in "Iterate over the own and inherited enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 10 | [jonschlinkert](https://github.com/jonschlinkert) | -| 1 | [javiercejudo](https://github.com/javiercejudo) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 26, 2017._ \ No newline at end of file diff --git a/node_modules/for-own/index.js b/node_modules/for-own/index.js deleted file mode 100644 index 74e2d7551..000000000 --- a/node_modules/for-own/index.js +++ /dev/null @@ -1,19 +0,0 @@ -/*! - * for-own - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var forIn = require('for-in'); -var hasOwn = Object.prototype.hasOwnProperty; - -module.exports = function forOwn(obj, fn, thisArg) { - forIn(obj, function(val, key) { - if (hasOwn.call(obj, key)) { - return fn.call(thisArg, obj[key], key, obj); - } - }); -}; diff --git a/node_modules/for-own/package.json b/node_modules/for-own/package.json deleted file mode 100644 index c1a50ee5d..000000000 --- a/node_modules/for-own/package.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "_from": "for-own@^0.1.4", - "_id": "for-own@0.1.5", - "_inBundle": false, - "_integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "_location": "/for-own", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "for-own@^0.1.4", - "name": "for-own", - "escapedName": "for-own", - "rawSpec": "^0.1.4", - "saveSpec": null, - "fetchSpec": "^0.1.4" - }, - "_requiredBy": [ - "/object.omit" - ], - "_resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "_shasum": "5265c681a4f294dabbf17c9509b6763aa84510ce", - "_spec": "for-own@^0.1.4", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/object.omit", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/for-own/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Javier Cejudo", - "email": "javier@javiercejudo.com", - "url": "https://www.javiercejudo.com" - }, - { - "name": "Jon Schlinkert", - "email": "jon.schlinkert@sellside.com", - "url": "http://twitter.com/jonschlinkert" - } - ], - "dependencies": { - "for-in": "^1.0.1" - }, - "deprecated": false, - "description": "Iterate over the own enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js.", - "devDependencies": { - "gulp-format-md": "^0.1.11", - "mocha": "^3.2.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/for-own", - "keywords": [ - "for", - "for-in", - "for-own", - "has", - "has-own", - "hasOwn", - "key", - "keys", - "object", - "own", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "for-own", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/for-own.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "run": true, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "arr-flatten", - "collection-map", - "for-in" - ] - }, - "reflinks": [ - "verb" - ], - "lint": { - "reflinks": true - } - }, - "version": "0.1.5" -} diff --git a/node_modules/fragment-cache/LICENSE b/node_modules/fragment-cache/LICENSE deleted file mode 100644 index b11cb7968..000000000 --- a/node_modules/fragment-cache/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016-2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/fragment-cache/README.md b/node_modules/fragment-cache/README.md deleted file mode 100644 index 541ef0fb4..000000000 --- a/node_modules/fragment-cache/README.md +++ /dev/null @@ -1,156 +0,0 @@ -# fragment-cache [![NPM version](https://img.shields.io/npm/v/fragment-cache.svg?style=flat)](https://www.npmjs.com/package/fragment-cache) [![NPM downloads](https://img.shields.io/npm/dm/fragment-cache.svg?style=flat)](https://npmjs.org/package/fragment-cache) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/fragment-cache.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/fragment-cache) - -> A cache for managing namespaced sub-caches - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save fragment-cache -``` - -## Usage - -```js -var Fragment = require('fragment-cache'); -var fragment = new Fragment(); -``` - -## API - -### [FragmentCache](index.js#L24) - -Create a new `FragmentCache` with an optional object to use for `caches`. - -**Example** - -```js -var fragment = new FragmentCache(); -``` - -**Params** - -* `cacheName` **{String}** -* `returns` **{Object}**: Returns the [map-cache](https://github.com/jonschlinkert/map-cache) instance. - -### [.cache](index.js#L49) - -Get cache `name` from the `fragment.caches` object. Creates a new `MapCache` if it doesn't already exist. - -**Example** - -```js -var cache = fragment.cache('files'); -console.log(fragment.caches.hasOwnProperty('files')); -//=> true -``` - -**Params** - -* `cacheName` **{String}** -* `returns` **{Object}**: Returns the [map-cache](https://github.com/jonschlinkert/map-cache) instance. - -### [.set](index.js#L67) - -Set a value for property `key` on cache `name` - -**Example** - -```js -fragment.set('files', 'somefile.js', new File({path: 'somefile.js'})); -``` - -**Params** - -* `name` **{String}** -* `key` **{String}**: Property name to set -* `val` **{any}**: The value of `key` -* `returns` **{Object}**: The cache instance for chaining - -### [.has](index.js#L93) - -Returns true if a non-undefined value is set for `key` on fragment cache `name`. - -**Example** - -```js -var cache = fragment.cache('files'); -cache.set('somefile.js'); - -console.log(cache.has('somefile.js')); -//=> true - -console.log(cache.has('some-other-file.js')); -//=> false -``` - -**Params** - -* `name` **{String}**: Cache name -* `key` **{String}**: Optionally specify a property to check for on cache `name` -* `returns` **{Boolean}** - -### [.get](index.js#L115) - -Get `name`, or if specified, the value of `key`. Invokes the [cache](#cache) method, so that cache `name` will be created it doesn't already exist. If `key` is not passed, the entire cache (`name`) is returned. - -**Example** - -```js -var Vinyl = require('vinyl'); -var cache = fragment.cache('files'); -cache.set('somefile.js', new Vinyl({path: 'somefile.js'})); -console.log(cache.get('somefile.js')); -//=> -``` - -**Params** - -* `name` **{String}** -* `returns` **{Object}**: Returns cache `name`, or the value of `key` if specified - -## About - -### Related projects - -* [base](https://www.npmjs.com/package/base): base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… [more](https://github.com/node-base/base) | [homepage](https://github.com/node-base/base "base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting with a handful of common methods, like `set`, `get`, `del` and `use`.") -* [map-cache](https://www.npmjs.com/package/map-cache): Basic cache object for storing key-value pairs. | [homepage](https://github.com/jonschlinkert/map-cache "Basic cache object for storing key-value pairs.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Building docs - -_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ - -To generate the readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install -g verb verb-generate-readme && verb -``` - -### Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -### License - -Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/fragment-cache/blob/master/LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on October 17, 2016._ \ No newline at end of file diff --git a/node_modules/fragment-cache/index.js b/node_modules/fragment-cache/index.js deleted file mode 100644 index 8ce621680..000000000 --- a/node_modules/fragment-cache/index.js +++ /dev/null @@ -1,128 +0,0 @@ -/*! - * fragment-cache - * - * Copyright (c) 2016-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var MapCache = require('map-cache'); - -/** - * Create a new `FragmentCache` with an optional object to use for `caches`. - * - * ```js - * var fragment = new FragmentCache(); - * ``` - * @name FragmentCache - * @param {String} `cacheName` - * @return {Object} Returns the [map-cache][] instance. - * @api public - */ - -function FragmentCache(caches) { - this.caches = caches || {}; -} - -/** - * Prototype - */ - -FragmentCache.prototype = { - - /** - * Get cache `name` from the `fragment.caches` object. Creates a new - * `MapCache` if it doesn't already exist. - * - * ```js - * var cache = fragment.cache('files'); - * console.log(fragment.caches.hasOwnProperty('files')); - * //=> true - * ``` - * @name .cache - * @param {String} `cacheName` - * @return {Object} Returns the [map-cache][] instance. - * @api public - */ - - cache: function(cacheName) { - return this.caches[cacheName] || (this.caches[cacheName] = new MapCache()); - }, - - /** - * Set a value for property `key` on cache `name` - * - * ```js - * fragment.set('files', 'somefile.js', new File({path: 'somefile.js'})); - * ``` - * @name .set - * @param {String} `name` - * @param {String} `key` Property name to set - * @param {any} `val` The value of `key` - * @return {Object} The cache instance for chaining - * @api public - */ - - set: function(cacheName, key, val) { - var cache = this.cache(cacheName); - cache.set(key, val); - return cache; - }, - - /** - * Returns true if a non-undefined value is set for `key` on fragment cache `name`. - * - * ```js - * var cache = fragment.cache('files'); - * cache.set('somefile.js'); - * - * console.log(cache.has('somefile.js')); - * //=> true - * - * console.log(cache.has('some-other-file.js')); - * //=> false - * ``` - * @name .has - * @param {String} `name` Cache name - * @param {String} `key` Optionally specify a property to check for on cache `name` - * @return {Boolean} - * @api public - */ - - has: function(cacheName, key) { - return typeof this.get(cacheName, key) !== 'undefined'; - }, - - /** - * Get `name`, or if specified, the value of `key`. Invokes the [cache]() method, - * so that cache `name` will be created it doesn't already exist. If `key` is not passed, - * the entire cache (`name`) is returned. - * - * ```js - * var Vinyl = require('vinyl'); - * var cache = fragment.cache('files'); - * cache.set('somefile.js', new Vinyl({path: 'somefile.js'})); - * console.log(cache.get('somefile.js')); - * //=> - * ``` - * @name .get - * @param {String} `name` - * @return {Object} Returns cache `name`, or the value of `key` if specified - * @api public - */ - - get: function(name, key) { - var cache = this.cache(name); - if (typeof key === 'string') { - return cache.get(key); - } - return cache; - } -}; - -/** - * Expose `FragmentCache` - */ - -exports = module.exports = FragmentCache; diff --git a/node_modules/fragment-cache/package.json b/node_modules/fragment-cache/package.json deleted file mode 100644 index 657083d57..000000000 --- a/node_modules/fragment-cache/package.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "_from": "fragment-cache@^0.2.1", - "_id": "fragment-cache@0.2.1", - "_inBundle": false, - "_integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "_location": "/fragment-cache", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "fragment-cache@^0.2.1", - "name": "fragment-cache", - "escapedName": "fragment-cache", - "rawSpec": "^0.2.1", - "saveSpec": null, - "fetchSpec": "^0.2.1" - }, - "_requiredBy": [ - "/nanomatch", - "/readdirp/extglob", - "/readdirp/micromatch" - ], - "_resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "_shasum": "4290fad27f13e89be7f33799c6bc5a0abfff0d19", - "_spec": "fragment-cache@^0.2.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/fragment-cache/issues" - }, - "bundleDependencies": false, - "dependencies": { - "map-cache": "^0.2.2" - }, - "deprecated": false, - "description": "A cache for managing namespaced sub-caches", - "devDependencies": { - "gulp": "^3.9.1", - "gulp-eslint": "^3.0.1", - "gulp-format-md": "^0.1.11", - "gulp-istanbul": "^1.1.1", - "gulp-mocha": "^3.0.1", - "mocha": "^3.2.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/fragment-cache", - "keywords": [ - "cache", - "fragment" - ], - "license": "MIT", - "main": "index.js", - "name": "fragment-cache", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/fragment-cache.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "plugins": [ - "gulp-format-md" - ], - "reflinks": [ - "map-cache", - "verb" - ], - "related": { - "list": [ - "base", - "map-cache" - ] - }, - "layout": "default", - "toc": false, - "tasks": [ - "readme" - ], - "lint": { - "reflinks": true - } - }, - "version": "0.2.1" -} diff --git a/node_modules/fresh/HISTORY.md b/node_modules/fresh/HISTORY.md deleted file mode 100644 index 4586996a3..000000000 --- a/node_modules/fresh/HISTORY.md +++ /dev/null @@ -1,70 +0,0 @@ -0.5.2 / 2017-09-13 -================== - - * Fix regression matching multiple ETags in `If-None-Match` - * perf: improve `If-None-Match` token parsing - -0.5.1 / 2017-09-11 -================== - - * Fix handling of modified headers with invalid dates - * perf: improve ETag match loop - -0.5.0 / 2017-02-21 -================== - - * Fix incorrect result when `If-None-Match` has both `*` and ETags - * Fix weak `ETag` matching to match spec - * perf: delay reading header values until needed - * perf: skip checking modified time if ETag check failed - * perf: skip parsing `If-None-Match` when no `ETag` header - * perf: use `Date.parse` instead of `new Date` - -0.4.0 / 2017-02-05 -================== - - * Fix false detection of `no-cache` request directive - * perf: enable strict mode - * perf: hoist regular expressions - * perf: remove duplicate conditional - * perf: remove unnecessary boolean coercions - -0.3.0 / 2015-05-12 -================== - - * Add weak `ETag` matching support - -0.2.4 / 2014-09-07 -================== - - * Support Node.js 0.6 - -0.2.3 / 2014-09-07 -================== - - * Move repository to jshttp - -0.2.2 / 2014-02-19 -================== - - * Revert "Fix for blank page on Safari reload" - -0.2.1 / 2014-01-29 -================== - - * Fix for blank page on Safari reload - -0.2.0 / 2013-08-11 -================== - - * Return stale for `Cache-Control: no-cache` - -0.1.0 / 2012-06-15 -================== - - * Add `If-None-Match: *` support - -0.0.1 / 2012-06-10 -================== - - * Initial release diff --git a/node_modules/fresh/LICENSE b/node_modules/fresh/LICENSE deleted file mode 100644 index 1434ade75..000000000 --- a/node_modules/fresh/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2012 TJ Holowaychuk -Copyright (c) 2016-2017 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/fresh/README.md b/node_modules/fresh/README.md deleted file mode 100644 index 1c1c680d1..000000000 --- a/node_modules/fresh/README.md +++ /dev/null @@ -1,119 +0,0 @@ -# fresh - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -HTTP response freshness testing - -## Installation - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -``` -$ npm install fresh -``` - -## API - - - -```js -var fresh = require('fresh') -``` - -### fresh(reqHeaders, resHeaders) - -Check freshness of the response using request and response headers. - -When the response is still "fresh" in the client's cache `true` is -returned, otherwise `false` is returned to indicate that the client -cache is now stale and the full response should be sent. - -When a client sends the `Cache-Control: no-cache` request header to -indicate an end-to-end reload request, this module will return `false` -to make handling these requests transparent. - -## Known Issues - -This module is designed to only follow the HTTP specifications, not -to work-around all kinda of client bugs (especially since this module -typically does not recieve enough information to understand what the -client actually is). - -There is a known issue that in certain versions of Safari, Safari -will incorrectly make a request that allows this module to validate -freshness of the resource even when Safari does not have a -representation of the resource in the cache. The module -[jumanji](https://www.npmjs.com/package/jumanji) can be used in -an Express application to work-around this issue and also provides -links to further reading on this Safari bug. - -## Example - -### API usage - - - -```js -var reqHeaders = { 'if-none-match': '"foo"' } -var resHeaders = { 'etag': '"bar"' } -fresh(reqHeaders, resHeaders) -// => false - -var reqHeaders = { 'if-none-match': '"foo"' } -var resHeaders = { 'etag': '"foo"' } -fresh(reqHeaders, resHeaders) -// => true -``` - -### Using with Node.js http server - -```js -var fresh = require('fresh') -var http = require('http') - -var server = http.createServer(function (req, res) { - // perform server logic - // ... including adding ETag / Last-Modified response headers - - if (isFresh(req, res)) { - // client has a fresh copy of resource - res.statusCode = 304 - res.end() - return - } - - // send the resource - res.statusCode = 200 - res.end('hello, world!') -}) - -function isFresh (req, res) { - return fresh(req.headers, { - 'etag': res.getHeader('ETag'), - 'last-modified': res.getHeader('Last-Modified') - }) -} - -server.listen(3000) -``` - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/fresh.svg -[npm-url]: https://npmjs.org/package/fresh -[node-version-image]: https://img.shields.io/node/v/fresh.svg -[node-version-url]: https://nodejs.org/en/ -[travis-image]: https://img.shields.io/travis/jshttp/fresh/master.svg -[travis-url]: https://travis-ci.org/jshttp/fresh -[coveralls-image]: https://img.shields.io/coveralls/jshttp/fresh/master.svg -[coveralls-url]: https://coveralls.io/r/jshttp/fresh?branch=master -[downloads-image]: https://img.shields.io/npm/dm/fresh.svg -[downloads-url]: https://npmjs.org/package/fresh diff --git a/node_modules/fresh/index.js b/node_modules/fresh/index.js deleted file mode 100644 index d154f5a7d..000000000 --- a/node_modules/fresh/index.js +++ /dev/null @@ -1,137 +0,0 @@ -/*! - * fresh - * Copyright(c) 2012 TJ Holowaychuk - * Copyright(c) 2016-2017 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * RegExp to check for no-cache token in Cache-Control. - * @private - */ - -var CACHE_CONTROL_NO_CACHE_REGEXP = /(?:^|,)\s*?no-cache\s*?(?:,|$)/ - -/** - * Module exports. - * @public - */ - -module.exports = fresh - -/** - * Check freshness of the response using request and response headers. - * - * @param {Object} reqHeaders - * @param {Object} resHeaders - * @return {Boolean} - * @public - */ - -function fresh (reqHeaders, resHeaders) { - // fields - var modifiedSince = reqHeaders['if-modified-since'] - var noneMatch = reqHeaders['if-none-match'] - - // unconditional request - if (!modifiedSince && !noneMatch) { - return false - } - - // Always return stale when Cache-Control: no-cache - // to support end-to-end reload requests - // https://tools.ietf.org/html/rfc2616#section-14.9.4 - var cacheControl = reqHeaders['cache-control'] - if (cacheControl && CACHE_CONTROL_NO_CACHE_REGEXP.test(cacheControl)) { - return false - } - - // if-none-match - if (noneMatch && noneMatch !== '*') { - var etag = resHeaders['etag'] - - if (!etag) { - return false - } - - var etagStale = true - var matches = parseTokenList(noneMatch) - for (var i = 0; i < matches.length; i++) { - var match = matches[i] - if (match === etag || match === 'W/' + etag || 'W/' + match === etag) { - etagStale = false - break - } - } - - if (etagStale) { - return false - } - } - - // if-modified-since - if (modifiedSince) { - var lastModified = resHeaders['last-modified'] - var modifiedStale = !lastModified || !(parseHttpDate(lastModified) <= parseHttpDate(modifiedSince)) - - if (modifiedStale) { - return false - } - } - - return true -} - -/** - * Parse an HTTP Date into a number. - * - * @param {string} date - * @private - */ - -function parseHttpDate (date) { - var timestamp = date && Date.parse(date) - - // istanbul ignore next: guard against date.js Date.parse patching - return typeof timestamp === 'number' - ? timestamp - : NaN -} - -/** - * Parse a HTTP token list. - * - * @param {string} str - * @private - */ - -function parseTokenList (str) { - var end = 0 - var list = [] - var start = 0 - - // gather tokens - for (var i = 0, len = str.length; i < len; i++) { - switch (str.charCodeAt(i)) { - case 0x20: /* */ - if (start === end) { - start = end = i + 1 - } - break - case 0x2c: /* , */ - list.push(str.substring(start, end)) - start = end = i + 1 - break - default: - end = i + 1 - break - } - } - - // final token - list.push(str.substring(start, end)) - - return list -} diff --git a/node_modules/fresh/package.json b/node_modules/fresh/package.json deleted file mode 100644 index a8346eb30..000000000 --- a/node_modules/fresh/package.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "_from": "fresh@0.5.2", - "_id": "fresh@0.5.2", - "_inBundle": false, - "_integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", - "_location": "/fresh", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "fresh@0.5.2", - "name": "fresh", - "escapedName": "fresh", - "rawSpec": "0.5.2", - "saveSpec": null, - "fetchSpec": "0.5.2" - }, - "_requiredBy": [ - "/send" - ], - "_resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "_shasum": "3d8cadd90d976569fa835ab1f8e4b23a105605a7", - "_spec": "fresh@0.5.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/send", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca", - "url": "http://tjholowaychuk.com" - }, - "bugs": { - "url": "https://github.com/jshttp/fresh/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - }, - { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com" - } - ], - "deprecated": false, - "description": "HTTP response freshness testing", - "devDependencies": { - "beautify-benchmark": "0.2.4", - "benchmark": "2.1.4", - "eslint": "3.19.0", - "eslint-config-standard": "10.2.1", - "eslint-plugin-import": "2.7.0", - "eslint-plugin-markdown": "1.0.0-beta.6", - "eslint-plugin-node": "5.1.1", - "eslint-plugin-promise": "3.5.0", - "eslint-plugin-standard": "3.0.1", - "istanbul": "0.4.5", - "mocha": "1.21.5" - }, - "engines": { - "node": ">= 0.6" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "index.js" - ], - "homepage": "https://github.com/jshttp/fresh#readme", - "keywords": [ - "fresh", - "http", - "conditional", - "cache" - ], - "license": "MIT", - "name": "fresh", - "repository": { - "type": "git", - "url": "git+https://github.com/jshttp/fresh.git" - }, - "scripts": { - "bench": "node benchmark/index.js", - "lint": "eslint --plugin markdown --ext js,md .", - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" - }, - "version": "0.5.2" -} diff --git a/node_modules/from2-string/LICENSE b/node_modules/from2-string/LICENSE deleted file mode 100644 index 0fd68ad42..000000000 --- a/node_modules/from2-string/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 - -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. \ No newline at end of file diff --git a/node_modules/from2-string/README.md b/node_modules/from2-string/README.md deleted file mode 100644 index de8b05108..000000000 --- a/node_modules/from2-string/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# from2-string -[![NPM version][npm-image]][npm-url] -[![build status][travis-image]][travis-url] -[![Test coverage][coveralls-image]][coveralls-url] -[![Downloads][downloads-image]][downloads-url] -[![js-standard-style][standard-image]][standard-url] - -Create a stream from a string. Sugary wrapper around -[from2](https://github.com/hughsk/from2). - -## Installation -```bash -$ npm install from2-string -``` - -## Usage -```js -const fromString = require('from2-string') - -fromString('hello world').pipe(process.stdout) -``` - -## Why -In order to use `from2` with strings, you must write some boilerplate to -break the string in correctly sized chunks. This module handles that -boilerplate for you, so you can directly source from a string. - -## See Also -- [from2](https://github.com/hughsk/from2) - Convenience wrapper for ReadableStream, with an API lifted from "from" and "through2" -- [from2-array](https://github.com/binocarlos/from2-array) - Create a from2 stream based on an array of source values - -## License -[MIT](https://tldrlegal.com/license/mit-license) - -[npm-image]: https://img.shields.io/npm/v/from2-string.svg?style=flat-square -[npm-url]: https://npmjs.org/package/from2-string -[travis-image]: https://img.shields.io/travis/yoshuawuyts/from2-string.svg?style=flat-square -[travis-url]: https://travis-ci.org/yoshuawuyts/from2-string -[coveralls-image]: https://img.shields.io/coveralls/yoshuawuyts/from2-string.svg?style=flat-square -[coveralls-url]: https://coveralls.io/r/yoshuawuyts/from2-string?branch=master -[downloads-image]: http://img.shields.io/npm/dm/from2-string.svg?style=flat-square -[downloads-url]: https://npmjs.org/package/from2-string -[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square -[standard-url]: https://github.com/feross/standard diff --git a/node_modules/from2-string/index.js b/node_modules/from2-string/index.js deleted file mode 100644 index c875b3dc5..000000000 --- a/node_modules/from2-string/index.js +++ /dev/null @@ -1,19 +0,0 @@ -const assert = require('assert') -const from = require('from2') - -module.exports = fromString - -// create a stream from a string -// str -> stream -function fromString (string) { - assert.equal(typeof string, 'string') - - return from(function (size, next) { - if (string.length <= 0) return this.push(null) - - const chunk = string.slice(0, size) - string = string.slice(size) - - next(null, chunk) - }) -} diff --git a/node_modules/from2-string/package.json b/node_modules/from2-string/package.json deleted file mode 100644 index 7014dc2ff..000000000 --- a/node_modules/from2-string/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_from": "from2-string@^1.1.0", - "_id": "from2-string@1.1.0", - "_inBundle": false, - "_integrity": "sha1-GCgrJ9CKJnyzAwzSuLSw8hKvdSo=", - "_location": "/from2-string", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "from2-string@^1.1.0", - "name": "from2-string", - "escapedName": "from2-string", - "rawSpec": "^1.1.0", - "saveSpec": null, - "fetchSpec": "^1.1.0" - }, - "_requiredBy": [ - "/simple-html-index" - ], - "_resolved": "https://registry.npmjs.org/from2-string/-/from2-string-1.1.0.tgz", - "_shasum": "18282b27d08a267cb3030cd2b8b4b0f212af752a", - "_spec": "from2-string@^1.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/simple-html-index", - "bugs": { - "url": "https://github.com/yoshuawuyts/from2-string/issues" - }, - "bundleDependencies": false, - "dependencies": { - "from2": "^2.0.3" - }, - "deprecated": false, - "description": "Create a stream from a string. Sugary wrapper around from2", - "devDependencies": { - "concat-stream": "^1.4.8", - "covert": "^1.0.1", - "standard": "^4.5.2", - "tape": "^4.0.0" - }, - "files": [ - "LICENSE", - "index.js", - "README.md" - ], - "homepage": "https://github.com/yoshuawuyts/from2-string#readme", - "keywords": [ - "stream", - "string", - "from", - "source", - "from2", - "stream2", - "streams2" - ], - "license": "MIT", - "main": "index.js", - "name": "from2-string", - "repository": { - "type": "git", - "url": "git+https://github.com/yoshuawuyts/from2-string.git" - }, - "scripts": { - "test": "standard && NODE_ENV=test node test", - "test-cov": "standard && NODE_ENV=test covert test", - "test-cov-ci": "NODE_ENV=test covert -q --json test 2>&1" - }, - "version": "1.1.0" -} diff --git a/node_modules/from2/.travis.yml b/node_modules/from2/.travis.yml deleted file mode 100644 index b03ffabca..000000000 --- a/node_modules/from2/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -before_install: - - npm install -g npm -node_js: - - "0.8" - - "0.10" - - "0.12" - - "iojs" diff --git a/node_modules/from2/LICENSE.md b/node_modules/from2/LICENSE.md deleted file mode 100644 index 146cb32a7..000000000 --- a/node_modules/from2/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -## The MIT License (MIT) ## - -Copyright (c) 2014 Hugh Kennedy - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/from2/README.md b/node_modules/from2/README.md deleted file mode 100644 index 3e041a412..000000000 --- a/node_modules/from2/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# from2 [![Flattr this!](https://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=hughskennedy&url=http://github.com/hughsk/from2&title=from2&description=hughsk/from2%20on%20GitHub&language=en_GB&tags=flattr,github,javascript&category=software)[![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges) # - -`from2` is a high-level module for creating readable streams that properly handle backpressure. - -Convience wrapper for -[readable-stream](http://github.com/isaacs/readable-stream)'s `ReadableStream` -base class, with an API lifted from -[from](http://github.com/dominictarr/from) and -[through2](http://github.com/rvagg/through2). - -## Usage ## - -[![from2](https://nodei.co/npm/from2.png?mini=true)](https://nodei.co/npm/from2) - -### `stream = from2([opts], read)` ### - -Where `opts` are the options to pass on to the `ReadableStream` constructor, -and `read(size, next)` is called when data is requested from the stream. - -* `size` is the recommended amount of data (in bytes) to retrieve. -* `next(err)` should be called when you're ready to emit more data. - -For example, here's a readable stream that emits the contents of a given -string: - -``` javascript -var from = require('from2') - -function fromString(string) { - return from(function(size, next) { - // if there's no more content - // left in the string, close the stream. - if (string.length <= 0) return next(null, null) - - // Pull in a new chunk of text, - // removing it from the string. - var chunk = string.slice(0, size) - string = string.slice(size) - - // Emit "chunk" from the stream. - next(null, chunk) - }) -} - -// pipe "hello world" out -// to stdout. -fromString('hello world').pipe(process.stdout) -``` - -### `stream = from2.obj([opts], read)` ### - -Shorthand for `from2({ objectMode: true }, read)`. - -### `createStream = from2.ctor([opts], read)` ### - -If you're creating similar streams in quick succession you can improve -performance by generating a stream **constructor** that you can reuse instead -of creating one-off streams on each call. - -Takes the same options as `from2`, instead returning a constructor which you -can use to create new streams. - -### See Also - -- [from2-array](https://github.com/binocarlos/from2-array) - Create a from2 stream based on an array of source values. -- [from2-string](https://github.com/yoshuawuyts/from2-string) - Create a stream from a string. Sugary wrapper around from2. - -## License ## - -MIT. See [LICENSE.md](http://github.com/hughsk/from2/blob/master/LICENSE.md) for details. diff --git a/node_modules/from2/index.js b/node_modules/from2/index.js deleted file mode 100644 index cb200c610..000000000 --- a/node_modules/from2/index.js +++ /dev/null @@ -1,103 +0,0 @@ -var Readable = require('readable-stream').Readable -var inherits = require('inherits') - -module.exports = from2 - -from2.ctor = ctor -from2.obj = obj - -var Proto = ctor() - -function toFunction(list) { - list = list.slice() - return function (_, cb) { - var err = null - var item = list.length ? list.shift() : null - if (item instanceof Error) { - err = item - item = null - } - - cb(err, item) - } -} - -function from2(opts, read) { - if (typeof opts !== 'object' || Array.isArray(opts)) { - read = opts - opts = {} - } - - var rs = new Proto(opts) - rs._from = Array.isArray(read) ? toFunction(read) : (read || noop) - return rs -} - -function ctor(opts, read) { - if (typeof opts === 'function') { - read = opts - opts = {} - } - - opts = defaults(opts) - - inherits(Class, Readable) - function Class(override) { - if (!(this instanceof Class)) return new Class(override) - this._reading = false - this._callback = check - this.destroyed = false - Readable.call(this, override || opts) - - var self = this - var hwm = this._readableState.highWaterMark - - function check(err, data) { - if (self.destroyed) return - if (err) return self.destroy(err) - if (data === null) return self.push(null) - self._reading = false - if (self.push(data)) self._read(hwm) - } - } - - Class.prototype._from = read || noop - Class.prototype._read = function(size) { - if (this._reading || this.destroyed) return - this._reading = true - this._from(size, this._callback) - } - - Class.prototype.destroy = function(err) { - if (this.destroyed) return - this.destroyed = true - - var self = this - process.nextTick(function() { - if (err) self.emit('error', err) - self.emit('close') - }) - } - - return Class -} - -function obj(opts, read) { - if (typeof opts === 'function' || Array.isArray(opts)) { - read = opts - opts = {} - } - - opts = defaults(opts) - opts.objectMode = true - opts.highWaterMark = 16 - - return from2(opts, read) -} - -function noop () {} - -function defaults(opts) { - opts = opts || {} - return opts -} diff --git a/node_modules/from2/package.json b/node_modules/from2/package.json deleted file mode 100644 index e03e72647..000000000 --- a/node_modules/from2/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_from": "from2@^2.0.3", - "_id": "from2@2.3.0", - "_inBundle": false, - "_integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "_location": "/from2", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "from2@^2.0.3", - "name": "from2", - "escapedName": "from2", - "rawSpec": "^2.0.3", - "saveSpec": null, - "fetchSpec": "^2.0.3" - }, - "_requiredBy": [ - "/from2-string" - ], - "_resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "_shasum": "8bfb5502bde4a4d36cfdeea007fcca21d7e382af", - "_spec": "from2@^2.0.3", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/from2-string", - "author": { - "name": "Hugh Kennedy", - "email": "hughskennedy@gmail.com", - "url": "http://hughsk.io/" - }, - "bugs": { - "url": "https://github.com/hughsk/from2/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Mathias Buus", - "email": "mathiasbuus@gmail.com" - } - ], - "dependencies": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - }, - "deprecated": false, - "description": "Convenience wrapper for ReadableStream, with an API lifted from \"from\" and \"through2\"", - "devDependencies": { - "tape": "^4.0.0" - }, - "homepage": "https://github.com/hughsk/from2", - "keywords": [ - "from", - "stream", - "readable", - "pull", - "convenience", - "wrapper" - ], - "license": "MIT", - "main": "index.js", - "name": "from2", - "repository": { - "type": "git", - "url": "git://github.com/hughsk/from2.git" - }, - "scripts": { - "test": "node test" - }, - "version": "2.3.0" -} diff --git a/node_modules/from2/test.js b/node_modules/from2/test.js deleted file mode 100644 index b11bd6cd8..000000000 --- a/node_modules/from2/test.js +++ /dev/null @@ -1,123 +0,0 @@ -var test = require('tape') -var path = require('path') -var from = require('./') -var fs = require('fs') - -var tmp = path.resolve( - __dirname, 'tmp.txt' -) - -function fromString(string) { - return from(function(size, next) { - if (string.length <= 0) return next(null, null) - var chunk = string.slice(0, size) - string = string.slice(size) - next(null, chunk) - }) -} - -test('from2', function(t) { - var contents = fs.readFileSync(__filename, 'utf8') - var stream = fromString(contents) - - stream - .pipe(fs.createWriteStream(tmp)) - .on('close', function() { - t.equal(fs.readFileSync(tmp, 'utf8'), contents) - fs.unlinkSync(tmp) - t.end() - }) -}) - -test('old mode', function(t) { - var contents = fs.readFileSync(__filename, 'utf8') - var stream = fromString(contents) - var buffer = '' - - stream.on('data', function(data) { - buffer += data - }).on('end', function() { - t.equal(buffer, contents) - t.end() - }) -}) - -test('destroy', function(t) { - var stream = from(function(size, next) { - process.nextTick(function() { - next(null, 'no') - }) - }) - - stream.on('data', function(data) { - t.ok(false) - }).on('close', function() { - t.ok(true) - t.end() - }) - - stream.destroy() -}) - -test('arrays', function (t) { - var input = ['a', 'b', 'c'] - var stream = from(input) - var output = [] - stream.on('data', function (letter) { - output.push(letter.toString()) - }) - stream.on('end', function () { - t.deepEqual(input, output) - t.end() - }) -}) - -test('obj arrays', function (t) { - var input = [{foo:'a'}, {foo:'b'}, {foo:'c'}] - var stream = from.obj(input) - var output = [] - stream.on('data', function (letter) { - output.push(letter) - }) - stream.on('end', function () { - t.deepEqual(input, output) - t.end() - }) -}) - - -test('arrays can emit errors', function (t) { - var input = ['a', 'b', new Error('ooops'), 'c'] - var stream = from(input) - var output = [] - stream.on('data', function (letter) { - output.push(letter.toString()) - }) - stream.on('error', function(e){ - t.deepEqual(['a', 'b'], output) - t.equal('ooops', e.message) - t.end() - }) - stream.on('end', function () { - t.fail('the stream should have errored') - }) -}) - -test('obj arrays can emit errors', function (t) { - var input = [{foo:'a'}, {foo:'b'}, new Error('ooops'), {foo:'c'}] - var stream = from.obj(input) - var output = [] - stream.on('data', function (letter) { - output.push(letter) - }) - stream.on('error', function(e){ - t.deepEqual([{foo:'a'}, {foo:'b'}], output) - t.equal('ooops', e.message) - t.end() - }) - stream.on('end', function () { - t.fail('the stream should have errored') - }) -}) - - diff --git a/node_modules/fs.realpath/LICENSE b/node_modules/fs.realpath/LICENSE deleted file mode 100644 index 5bd884c25..000000000 --- a/node_modules/fs.realpath/LICENSE +++ /dev/null @@ -1,43 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ----- - -This library bundles a version of the `fs.realpath` and `fs.realpathSync` -methods from Node.js v0.10 under the terms of the Node.js MIT license. - -Node's license follows, also included at the header of `old.js` which contains -the licensed code: - - 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. diff --git a/node_modules/fs.realpath/README.md b/node_modules/fs.realpath/README.md deleted file mode 100644 index a42ceac62..000000000 --- a/node_modules/fs.realpath/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# fs.realpath - -A backwards-compatible fs.realpath for Node v6 and above - -In Node v6, the JavaScript implementation of fs.realpath was replaced -with a faster (but less resilient) native implementation. That raises -new and platform-specific errors and cannot handle long or excessively -symlink-looping paths. - -This module handles those cases by detecting the new errors and -falling back to the JavaScript implementation. On versions of Node -prior to v6, it has no effect. - -## USAGE - -```js -var rp = require('fs.realpath') - -// async version -rp.realpath(someLongAndLoopingPath, function (er, real) { - // the ELOOP was handled, but it was a bit slower -}) - -// sync version -var real = rp.realpathSync(someLongAndLoopingPath) - -// monkeypatch at your own risk! -// This replaces the fs.realpath/fs.realpathSync builtins -rp.monkeypatch() - -// un-do the monkeypatching -rp.unmonkeypatch() -``` diff --git a/node_modules/fs.realpath/index.js b/node_modules/fs.realpath/index.js deleted file mode 100644 index b09c7c7e6..000000000 --- a/node_modules/fs.realpath/index.js +++ /dev/null @@ -1,66 +0,0 @@ -module.exports = realpath -realpath.realpath = realpath -realpath.sync = realpathSync -realpath.realpathSync = realpathSync -realpath.monkeypatch = monkeypatch -realpath.unmonkeypatch = unmonkeypatch - -var fs = require('fs') -var origRealpath = fs.realpath -var origRealpathSync = fs.realpathSync - -var version = process.version -var ok = /^v[0-5]\./.test(version) -var old = require('./old.js') - -function newError (er) { - return er && er.syscall === 'realpath' && ( - er.code === 'ELOOP' || - er.code === 'ENOMEM' || - er.code === 'ENAMETOOLONG' - ) -} - -function realpath (p, cache, cb) { - if (ok) { - return origRealpath(p, cache, cb) - } - - if (typeof cache === 'function') { - cb = cache - cache = null - } - origRealpath(p, cache, function (er, result) { - if (newError(er)) { - old.realpath(p, cache, cb) - } else { - cb(er, result) - } - }) -} - -function realpathSync (p, cache) { - if (ok) { - return origRealpathSync(p, cache) - } - - try { - return origRealpathSync(p, cache) - } catch (er) { - if (newError(er)) { - return old.realpathSync(p, cache) - } else { - throw er - } - } -} - -function monkeypatch () { - fs.realpath = realpath - fs.realpathSync = realpathSync -} - -function unmonkeypatch () { - fs.realpath = origRealpath - fs.realpathSync = origRealpathSync -} diff --git a/node_modules/fs.realpath/old.js b/node_modules/fs.realpath/old.js deleted file mode 100644 index b40305e73..000000000 --- a/node_modules/fs.realpath/old.js +++ /dev/null @@ -1,303 +0,0 @@ -// 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 pathModule = require('path'); -var isWindows = process.platform === 'win32'; -var fs = require('fs'); - -// JavaScript implementation of realpath, ported from node pre-v6 - -var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); - -function rethrow() { - // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and - // is fairly slow to generate. - var callback; - if (DEBUG) { - var backtrace = new Error; - callback = debugCallback; - } else - callback = missingCallback; - - return callback; - - function debugCallback(err) { - if (err) { - backtrace.message = err.message; - err = backtrace; - missingCallback(err); - } - } - - function missingCallback(err) { - if (err) { - if (process.throwDeprecation) - throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs - else if (!process.noDeprecation) { - var msg = 'fs: missing callback ' + (err.stack || err.message); - if (process.traceDeprecation) - console.trace(msg); - else - console.error(msg); - } - } - } -} - -function maybeCallback(cb) { - return typeof cb === 'function' ? cb : rethrow(); -} - -var normalize = pathModule.normalize; - -// Regexp that finds the next partion of a (partial) path -// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] -if (isWindows) { - var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; -} else { - var nextPartRe = /(.*?)(?:[\/]+|$)/g; -} - -// Regex to find the device root, including trailing slash. E.g. 'c:\\'. -if (isWindows) { - var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; -} else { - var splitRootRe = /^[\/]*/; -} - -exports.realpathSync = function realpathSync(p, cache) { - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return cache[p]; - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstatSync(base); - knownHard[base] = true; - } - } - - // walk down the path, swapping out linked pathparts for their real - // values - // NB: p.length changes. - while (pos < p.length) { - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - continue; - } - - var resolvedLink; - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // some known symbolic link. no need to stat again. - resolvedLink = cache[base]; - } else { - var stat = fs.lstatSync(base); - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - continue; - } - - // read the link if it wasn't read before - // dev/ino always return 0 on windows, so skip the check. - var linkTarget = null; - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - linkTarget = seenLinks[id]; - } - } - if (linkTarget === null) { - fs.statSync(base); - linkTarget = fs.readlinkSync(base); - } - resolvedLink = pathModule.resolve(previous, linkTarget); - // track this, if given a cache. - if (cache) cache[base] = resolvedLink; - if (!isWindows) seenLinks[id] = linkTarget; - } - - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } - - if (cache) cache[original] = p; - - return p; -}; - - -exports.realpath = function realpath(p, cache, cb) { - if (typeof cb !== 'function') { - cb = maybeCallback(cache); - cache = null; - } - - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return process.nextTick(cb.bind(null, null, cache[p])); - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstat(base, function(err) { - if (err) return cb(err); - knownHard[base] = true; - LOOP(); - }); - } else { - process.nextTick(LOOP); - } - } - - // walk down the path, swapping out linked pathparts for their real - // values - function LOOP() { - // stop if scanned past end of path - if (pos >= p.length) { - if (cache) cache[original] = p; - return cb(null, p); - } - - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - return process.nextTick(LOOP); - } - - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // known symbolic link. no need to stat again. - return gotResolvedLink(cache[base]); - } - - return fs.lstat(base, gotStat); - } - - function gotStat(err, stat) { - if (err) return cb(err); - - // if not a symlink, skip to the next path part - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - return process.nextTick(LOOP); - } - - // stat & read the link if not read before - // call gotTarget as soon as the link target is known - // dev/ino always return 0 on windows, so skip the check. - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - return gotTarget(null, seenLinks[id], base); - } - } - fs.stat(base, function(err) { - if (err) return cb(err); - - fs.readlink(base, function(err, target) { - if (!isWindows) seenLinks[id] = target; - gotTarget(err, target); - }); - }); - } - - function gotTarget(err, target, base) { - if (err) return cb(err); - - var resolvedLink = pathModule.resolve(previous, target); - if (cache) cache[base] = resolvedLink; - gotResolvedLink(resolvedLink); - } - - function gotResolvedLink(resolvedLink) { - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } -}; diff --git a/node_modules/fs.realpath/package.json b/node_modules/fs.realpath/package.json deleted file mode 100644 index eeb78ba06..000000000 --- a/node_modules/fs.realpath/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_from": "fs.realpath@^1.0.0", - "_id": "fs.realpath@1.0.0", - "_inBundle": false, - "_integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "_location": "/fs.realpath", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "fs.realpath@^1.0.0", - "name": "fs.realpath", - "escapedName": "fs.realpath", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/glob" - ], - "_resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "_shasum": "1504ad2523158caa40db4a2787cb01411994ea4f", - "_spec": "fs.realpath@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/glob", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/fs.realpath/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails", - "devDependencies": {}, - "files": [ - "old.js", - "index.js" - ], - "homepage": "https://github.com/isaacs/fs.realpath#readme", - "keywords": [ - "realpath", - "fs", - "polyfill" - ], - "license": "ISC", - "main": "index.js", - "name": "fs.realpath", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/fs.realpath.git" - }, - "scripts": { - "test": "tap test/*.js --cov" - }, - "version": "1.0.0" -} diff --git a/node_modules/function-bind/.editorconfig b/node_modules/function-bind/.editorconfig deleted file mode 100644 index ac29adef0..000000000 --- a/node_modules/function-bind/.editorconfig +++ /dev/null @@ -1,20 +0,0 @@ -root = true - -[*] -indent_style = tab -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -max_line_length = 120 - -[CHANGELOG.md] -indent_style = space -indent_size = 2 - -[*.json] -max_line_length = off - -[Makefile] -max_line_length = off diff --git a/node_modules/function-bind/.eslintrc b/node_modules/function-bind/.eslintrc deleted file mode 100644 index 9b33d8edf..000000000 --- a/node_modules/function-bind/.eslintrc +++ /dev/null @@ -1,15 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", - - "rules": { - "func-name-matching": 0, - "indent": [2, 4], - "max-nested-callbacks": [2, 3], - "max-params": [2, 3], - "max-statements": [2, 20], - "no-new-func": [1], - "strict": [0] - } -} diff --git a/node_modules/function-bind/.jscs.json b/node_modules/function-bind/.jscs.json deleted file mode 100644 index 8c4479480..000000000 --- a/node_modules/function-bind/.jscs.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "es3": true, - - "additionalRules": [], - - "requireSemicolons": true, - - "disallowMultipleSpaces": true, - - "disallowIdentifierNames": [], - - "requireCurlyBraces": { - "allExcept": [], - "keywords": ["if", "else", "for", "while", "do", "try", "catch"] - }, - - "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], - - "disallowSpaceAfterKeywords": [], - - "disallowSpaceBeforeComma": true, - "disallowSpaceAfterComma": false, - "disallowSpaceBeforeSemicolon": true, - - "disallowNodeTypes": [ - "DebuggerStatement", - "ForInStatement", - "LabeledStatement", - "SwitchCase", - "SwitchStatement", - "WithStatement" - ], - - "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, - - "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, - "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, - "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, - "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, - "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, - - "requireSpaceBetweenArguments": true, - - "disallowSpacesInsideParentheses": true, - - "disallowSpacesInsideArrayBrackets": true, - - "disallowQuotedKeysInObjects": { "allExcept": ["reserved"] }, - - "disallowSpaceAfterObjectKeys": true, - - "requireCommaBeforeLineBreak": true, - - "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], - "requireSpaceAfterPrefixUnaryOperators": [], - - "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], - "requireSpaceBeforePostfixUnaryOperators": [], - - "disallowSpaceBeforeBinaryOperators": [], - "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - - "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - "disallowSpaceAfterBinaryOperators": [], - - "disallowImplicitTypeConversion": ["binary", "string"], - - "disallowKeywords": ["with", "eval"], - - "requireKeywordsOnNewLine": [], - "disallowKeywordsOnNewLine": ["else"], - - "requireLineFeedAtFileEnd": true, - - "disallowTrailingWhitespace": true, - - "disallowTrailingComma": true, - - "excludeFiles": ["node_modules/**", "vendor/**"], - - "disallowMultipleLineStrings": true, - - "requireDotNotation": { "allExcept": ["keywords"] }, - - "requireParenthesesAroundIIFE": true, - - "validateLineBreaks": "LF", - - "validateQuoteMarks": { - "escape": true, - "mark": "'" - }, - - "disallowOperatorBeforeLineBreak": [], - - "requireSpaceBeforeKeywords": [ - "do", - "for", - "if", - "else", - "switch", - "case", - "try", - "catch", - "finally", - "while", - "with", - "return" - ], - - "validateAlignedFunctionParameters": { - "lineBreakAfterOpeningBraces": true, - "lineBreakBeforeClosingBraces": true - }, - - "requirePaddingNewLinesBeforeExport": true, - - "validateNewlineAfterArrayElements": { - "maximum": 8 - }, - - "requirePaddingNewLinesAfterUseStrict": true, - - "disallowArrowFunctions": true, - - "disallowMultiLineTernary": true, - - "validateOrderInObjectKeys": "asc-insensitive", - - "disallowIdenticalDestructuringNames": true, - - "disallowNestedTernaries": { "maxLevel": 1 }, - - "requireSpaceAfterComma": { "allExcept": ["trailing"] }, - "requireAlignedMultilineParams": false, - - "requireSpacesInGenerator": { - "afterStar": true - }, - - "disallowSpacesInGenerator": { - "beforeStar": true - }, - - "disallowVar": false, - - "requireArrayDestructuring": false, - - "requireEnhancedObjectLiterals": false, - - "requireObjectDestructuring": false, - - "requireEarlyReturn": false, - - "requireCapitalizedConstructorsNew": { - "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] - }, - - "requireImportAlphabetized": false, - - "requireSpaceBeforeObjectValues": true, - "requireSpaceBeforeDestructuredValues": true, - - "disallowSpacesInsideTemplateStringPlaceholders": true, - - "disallowArrayDestructuringReturn": false, - - "requireNewlineBeforeSingleStatementsInIf": false, - - "disallowUnusedVariables": true, - - "requireSpacesInsideImportedObjectBraces": true, - - "requireUseStrict": true -} - diff --git a/node_modules/function-bind/.npmignore b/node_modules/function-bind/.npmignore deleted file mode 100644 index dbb555fd1..000000000 --- a/node_modules/function-bind/.npmignore +++ /dev/null @@ -1,22 +0,0 @@ -# gitignore -.DS_Store -.monitor -.*.swp -.nodemonignore -releases -*.log -*.err -fleet.json -public/browserify -bin/*.json -.bin -build -compile -.lock-wscript -coverage -node_modules - -# Only apps should have lockfiles -npm-shrinkwrap.json -package-lock.json -yarn.lock diff --git a/node_modules/function-bind/.travis.yml b/node_modules/function-bind/.travis.yml deleted file mode 100644 index 85f70d246..000000000 --- a/node_modules/function-bind/.travis.yml +++ /dev/null @@ -1,168 +0,0 @@ -language: node_js -os: - - linux -node_js: - - "8.4" - - "7.10" - - "6.11" - - "5.12" - - "4.8" - - "iojs-v3.3" - - "iojs-v2.5" - - "iojs-v1.8" - - "0.12" - - "0.10" - - "0.8" -before_install: - - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then npm install -g npm@1.3 ; elif [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi' - - 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then if [ "${TRAVIS_NODE_VERSION%${TRAVIS_NODE_VERSION#[0-9]}}" = "0" ] || [ "${TRAVIS_NODE_VERSION:0:4}" = "iojs" ]; then npm install -g npm@4.5 ; else npm install -g npm; fi; fi' -install: - - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then nvm install 0.8 && npm install -g npm@1.3 && npm install -g npm@1.4.28 && npm install -g npm@2 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' -script: - - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi' - - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi' - - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi' - - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi' -sudo: false -env: - - TEST=true -matrix: - fast_finish: true - include: - - node_js: "node" - env: PRETEST=true - - node_js: "4" - env: COVERAGE=true - - node_js: "8.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.4" - env: TEST=true ALLOW_FAILURE=true - allow_failures: - - os: osx - - env: TEST=true ALLOW_FAILURE=true diff --git a/node_modules/function-bind/LICENSE b/node_modules/function-bind/LICENSE deleted file mode 100644 index 62d6d237f..000000000 --- a/node_modules/function-bind/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2013 Raynos. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/node_modules/function-bind/README.md b/node_modules/function-bind/README.md deleted file mode 100644 index 81862a02c..000000000 --- a/node_modules/function-bind/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# function-bind - - - - - -Implementation of function.prototype.bind - -## Example - -I mainly do this for unit tests I run on phantomjs. -PhantomJS does not have Function.prototype.bind :( - -```js -Function.prototype.bind = require("function-bind") -``` - -## Installation - -`npm install function-bind` - -## Contributors - - - Raynos - -## MIT Licenced - - [travis-svg]: https://travis-ci.org/Raynos/function-bind.svg - [travis-url]: https://travis-ci.org/Raynos/function-bind - [npm-badge-svg]: https://badge.fury.io/js/function-bind.svg - [npm-url]: https://npmjs.org/package/function-bind - [5]: https://coveralls.io/repos/Raynos/function-bind/badge.png - [6]: https://coveralls.io/r/Raynos/function-bind - [7]: https://gemnasium.com/Raynos/function-bind.png - [8]: https://gemnasium.com/Raynos/function-bind - [deps-svg]: https://david-dm.org/Raynos/function-bind.svg - [deps-url]: https://david-dm.org/Raynos/function-bind - [dev-deps-svg]: https://david-dm.org/Raynos/function-bind/dev-status.svg - [dev-deps-url]: https://david-dm.org/Raynos/function-bind#info=devDependencies - [11]: https://ci.testling.com/Raynos/function-bind.png - [12]: https://ci.testling.com/Raynos/function-bind diff --git a/node_modules/function-bind/implementation.js b/node_modules/function-bind/implementation.js deleted file mode 100644 index cc4daec1b..000000000 --- a/node_modules/function-bind/implementation.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; - -/* eslint no-invalid-this: 1 */ - -var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; -var slice = Array.prototype.slice; -var toStr = Object.prototype.toString; -var funcType = '[object Function]'; - -module.exports = function bind(that) { - var target = this; - if (typeof target !== 'function' || toStr.call(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); - } - var args = slice.call(arguments, 1); - - var bound; - var binder = function () { - if (this instanceof bound) { - var result = target.apply( - this, - args.concat(slice.call(arguments)) - ); - if (Object(result) === result) { - return result; - } - return this; - } else { - return target.apply( - that, - args.concat(slice.call(arguments)) - ); - } - }; - - var boundLength = Math.max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs.push('$' + i); - } - - bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); - - if (target.prototype) { - var Empty = function Empty() {}; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - - return bound; -}; diff --git a/node_modules/function-bind/index.js b/node_modules/function-bind/index.js deleted file mode 100644 index 3bb6b9609..000000000 --- a/node_modules/function-bind/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var implementation = require('./implementation'); - -module.exports = Function.prototype.bind || implementation; diff --git a/node_modules/function-bind/package.json b/node_modules/function-bind/package.json deleted file mode 100644 index a51e3c39a..000000000 --- a/node_modules/function-bind/package.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "_from": "function-bind@^1.1.1", - "_id": "function-bind@1.1.1", - "_inBundle": false, - "_integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "_location": "/function-bind", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "function-bind@^1.1.1", - "name": "function-bind", - "escapedName": "function-bind", - "rawSpec": "^1.1.1", - "saveSpec": null, - "fetchSpec": "^1.1.1" - }, - "_requiredBy": [ - "/has" - ], - "_resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "_shasum": "a56899d3ea3c9bab874bb9773b7c5ede92f4895d", - "_spec": "function-bind@^1.1.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/has", - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "bugs": { - "url": "https://github.com/Raynos/function-bind/issues", - "email": "raynos2@gmail.com" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Raynos" - }, - { - "name": "Jordan Harband", - "url": "https://github.com/ljharb" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "Implementation of Function.prototype.bind", - "devDependencies": { - "@ljharb/eslint-config": "^12.2.1", - "covert": "^1.1.0", - "eslint": "^4.5.0", - "jscs": "^3.0.7", - "tape": "^4.8.0" - }, - "homepage": "https://github.com/Raynos/function-bind", - "keywords": [ - "function", - "bind", - "shim", - "es5" - ], - "license": "MIT", - "main": "index", - "name": "function-bind", - "repository": { - "type": "git", - "url": "git://github.com/Raynos/function-bind.git" - }, - "scripts": { - "coverage": "covert test/*.js", - "eslint": "eslint *.js */*.js", - "jscs": "jscs *.js */*.js", - "lint": "npm run jscs && npm run eslint", - "posttest": "npm run coverage -- --quiet", - "pretest": "npm run lint", - "test": "npm run tests-only", - "tests-only": "node test" - }, - "testling": { - "files": "test/index.js", - "browsers": [ - "ie/8..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "version": "1.1.1" -} diff --git a/node_modules/function-bind/test/.eslintrc b/node_modules/function-bind/test/.eslintrc deleted file mode 100644 index 8a56d5b72..000000000 --- a/node_modules/function-bind/test/.eslintrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "rules": { - "array-bracket-newline": 0, - "array-element-newline": 0, - "max-statements-per-line": [2, { "max": 2 }], - "no-invalid-this": 0, - "no-magic-numbers": 0, - } -} diff --git a/node_modules/function-bind/test/index.js b/node_modules/function-bind/test/index.js deleted file mode 100644 index 2edecce2f..000000000 --- a/node_modules/function-bind/test/index.js +++ /dev/null @@ -1,252 +0,0 @@ -// jscs:disable requireUseStrict - -var test = require('tape'); - -var functionBind = require('../implementation'); -var getCurrentContext = function () { return this; }; - -test('functionBind is a function', function (t) { - t.equal(typeof functionBind, 'function'); - t.end(); -}); - -test('non-functions', function (t) { - var nonFunctions = [true, false, [], {}, 42, 'foo', NaN, /a/g]; - t.plan(nonFunctions.length); - for (var i = 0; i < nonFunctions.length; ++i) { - try { functionBind.call(nonFunctions[i]); } catch (ex) { - t.ok(ex instanceof TypeError, 'throws when given ' + String(nonFunctions[i])); - } - } - t.end(); -}); - -test('without a context', function (t) { - t.test('binds properly', function (st) { - var args, context; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - context = this; - }) - }; - namespace.func(1, 2, 3); - st.deepEqual(args, [1, 2, 3]); - st.equal(context, getCurrentContext.call()); - st.end(); - }); - - t.test('binds properly, and still supplies bound arguments', function (st) { - var args, context; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - context = this; - }, undefined, 1, 2, 3) - }; - namespace.func(4, 5, 6); - st.deepEqual(args, [1, 2, 3, 4, 5, 6]); - st.equal(context, getCurrentContext.call()); - st.end(); - }); - - t.test('returns properly', function (st) { - var args; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - return this; - }, null) - }; - var context = namespace.func(1, 2, 3); - st.equal(context, getCurrentContext.call(), 'returned context is namespaced context'); - st.deepEqual(args, [1, 2, 3], 'passed arguments are correct'); - st.end(); - }); - - t.test('returns properly with bound arguments', function (st) { - var args; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - return this; - }, null, 1, 2, 3) - }; - var context = namespace.func(4, 5, 6); - st.equal(context, getCurrentContext.call(), 'returned context is namespaced context'); - st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct'); - st.end(); - }); - - t.test('called as a constructor', function (st) { - var thunkify = function (value) { - return function () { return value; }; - }; - st.test('returns object value', function (sst) { - var expectedReturnValue = [1, 2, 3]; - var Constructor = functionBind.call(thunkify(expectedReturnValue), null); - var result = new Constructor(); - sst.equal(result, expectedReturnValue); - sst.end(); - }); - - st.test('does not return primitive value', function (sst) { - var Constructor = functionBind.call(thunkify(42), null); - var result = new Constructor(); - sst.notEqual(result, 42); - sst.end(); - }); - - st.test('object from bound constructor is instance of original and bound constructor', function (sst) { - var A = function (x) { - this.name = x || 'A'; - }; - var B = functionBind.call(A, null, 'B'); - - var result = new B(); - sst.ok(result instanceof B, 'result is instance of bound constructor'); - sst.ok(result instanceof A, 'result is instance of original constructor'); - sst.end(); - }); - - st.end(); - }); - - t.end(); -}); - -test('with a context', function (t) { - t.test('with no bound arguments', function (st) { - var args, context; - var boundContext = {}; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - context = this; - }, boundContext) - }; - namespace.func(1, 2, 3); - st.equal(context, boundContext, 'binds a context properly'); - st.deepEqual(args, [1, 2, 3], 'supplies passed arguments'); - st.end(); - }); - - t.test('with bound arguments', function (st) { - var args, context; - var boundContext = {}; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - context = this; - }, boundContext, 1, 2, 3) - }; - namespace.func(4, 5, 6); - st.equal(context, boundContext, 'binds a context properly'); - st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'supplies bound and passed arguments'); - st.end(); - }); - - t.test('returns properly', function (st) { - var boundContext = {}; - var args; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - return this; - }, boundContext) - }; - var context = namespace.func(1, 2, 3); - st.equal(context, boundContext, 'returned context is bound context'); - st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context'); - st.deepEqual(args, [1, 2, 3], 'passed arguments are correct'); - st.end(); - }); - - t.test('returns properly with bound arguments', function (st) { - var boundContext = {}; - var args; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - return this; - }, boundContext, 1, 2, 3) - }; - var context = namespace.func(4, 5, 6); - st.equal(context, boundContext, 'returned context is bound context'); - st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context'); - st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct'); - st.end(); - }); - - t.test('passes the correct arguments when called as a constructor', function (st) { - var expected = { name: 'Correct' }; - var namespace = { - Func: functionBind.call(function (arg) { - return arg; - }, { name: 'Incorrect' }) - }; - var returned = new namespace.Func(expected); - st.equal(returned, expected, 'returns the right arg when called as a constructor'); - st.end(); - }); - - t.test('has the new instance\'s context when called as a constructor', function (st) { - var actualContext; - var expectedContext = { foo: 'bar' }; - var namespace = { - Func: functionBind.call(function () { - actualContext = this; - }, expectedContext) - }; - var result = new namespace.Func(); - st.equal(result instanceof namespace.Func, true); - st.notEqual(actualContext, expectedContext); - st.end(); - }); - - t.end(); -}); - -test('bound function length', function (t) { - t.test('sets a correct length without thisArg', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }); - st.equal(subject.length, 3); - st.equal(subject(1, 2, 3), 6); - st.end(); - }); - - t.test('sets a correct length with thisArg', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}); - st.equal(subject.length, 3); - st.equal(subject(1, 2, 3), 6); - st.end(); - }); - - t.test('sets a correct length without thisArg and first argument', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1); - st.equal(subject.length, 2); - st.equal(subject(2, 3), 6); - st.end(); - }); - - t.test('sets a correct length with thisArg and first argument', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1); - st.equal(subject.length, 2); - st.equal(subject(2, 3), 6); - st.end(); - }); - - t.test('sets a correct length without thisArg and too many arguments', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1, 2, 3, 4); - st.equal(subject.length, 0); - st.equal(subject(), 6); - st.end(); - }); - - t.test('sets a correct length with thisArg and too many arguments', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1, 2, 3, 4); - st.equal(subject.length, 0); - st.equal(subject(), 6); - st.end(); - }); -}); diff --git a/node_modules/garnish/LICENSE.md b/node_modules/garnish/LICENSE.md deleted file mode 100644 index 89a78cf22..000000000 --- a/node_modules/garnish/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) -Copyright (c) 2015 Matt DesLauriers - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE -OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/node_modules/garnish/README.md b/node_modules/garnish/README.md deleted file mode 100644 index 9ba8f0683..000000000 --- a/node_modules/garnish/README.md +++ /dev/null @@ -1,119 +0,0 @@ -# garnish - -[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges) - -Prettifies [ndjson](http://ndjson.org/) or [bole](https://github.com/rvagg/bole) logs from [budo](https://github.com/mattdesl/budo), [wzrd](https://github.com/maxogden/wzrd/) and other tools. - -Example with [budo](https://github.com/mattdesl/budo), which uses this under the hood. - - - -## Install - -```sh -npm install garnish [-g|--save-dev] -``` - -## Usage - -### CLI - -Pipe a ndjson emitter into `garnish` like so: - -```sh -node app.js | garnish [opts] - -Options: - - --level, -l the minimum debug level, default 'debug' - --name, -n the default app name -``` - -Where `level` can be `debug`, `info`, `warn`, `error`. - -### API - -#### `garnish([opt])` - -Returns a duplexer that parses input as ndjson, and writes a pretty-printed result. Options: - -- `level` (String) - - the minimum log level to print (default `'debug'`) - - the order is as follows: `debug`, `info`, `warn`, `error` -- `name` (String) - - the default name for your logger; a message's `name` field will not be printed when it matches this default name, to reduce redundant/obvious information in the logs. - -## format - -Typically, you would use [bole](https://github.com/rvagg/bole) or [ndjson](https://www.npmjs.com/package/ndjson) to write the content to garnish. You can also write ndjson to `stdout` like so: - -```js -// a log message -console.log({ - name: 'myApp', - level: 'warn', - message: 'not found' -}) - -// a typical server message -console.log({ - name: 'myApp', - type: 'generated', - level: 'info', - url: '/foo.png', - statusCode: 200, - contentLength: 12800, // in bytes - elapsed: 120 // in milliseconds -}) -``` - - -Currently garnish styles the following: - -- `level` - - the log level e.g. `debug`, `info`, `warn`, `error` (default `debug`) - only shown if `message` is present -- `name` - - an optional event or application name. It's recommended to always have a name. -- `message` - - an event message. -- `url` - - a url (stripped to pathname), useful for router logging. -- `statusCode` - - an HTTP statusCode. Codes `>=400` are displayed in red. -- `contentLength` - - the response size; if a `number`, bytes are assumed -- `elapsed` - - time elapsed since the previous related event; if a `number`, milliseconds are assumed -- `type` - - the type of event logged -- `colors` - - an optional color mapping for custom styles - -You can use the `colors` field to override any of the default colors with a new [ANSI style](https://github.com/chalk/ansi-styles). - -For example, the following will print `elapsed` in yellow if it passes our threshold: - -```js -function logTime (msg) { - var now = Date.now() - var time = now - lastTime - lastTime = now - - console.log({ - name: 'app', - message: msg, - elapsed: time + ' ms', - colors: { - elapsed: time > 1000 ? 'yellow' : 'green' - } - }) -} -``` - -## See Also - -- [bistre](https://github.com/hughsk/bistre) - -## License - -MIT, see [LICENSE.md](http://github.com/mattdesl/garnish/blob/master/LICENSE.md) for details. diff --git a/node_modules/garnish/bin/cmd.js b/node_modules/garnish/bin/cmd.js deleted file mode 100755 index 4170346be..000000000 --- a/node_modules/garnish/bin/cmd.js +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env node -var stdout = require('stdout-stream') -var garnish = require('../') -var argv = require('minimist')(process.argv.slice(2), { - alias: { - level: 'l', - name: 'n' - } -}) - -process.stdin.resume() -process.stdin.setEncoding('utf8') -process.stdin - .pipe(garnish(argv)) - .pipe(stdout) diff --git a/node_modules/garnish/index.js b/node_modules/garnish/index.js deleted file mode 100644 index 44a44493d..000000000 --- a/node_modules/garnish/index.js +++ /dev/null @@ -1,59 +0,0 @@ -var split = require('split2') -var eol = require('os').EOL - -var renderer = require('./lib/renderer') -var levels = require('./lib/levels') - -module.exports = garnish - -function garnish (opt) { - opt = opt || {} - - var loggerLevel = opt.level || 'debug' - var render = renderer.create(opt.name) - - return split(parse) - - function parse (line) { - try { - var obj = JSON.parse(line) - - if (obj.name === 'http' && obj.message === 'request') return - if (typeof obj.level === 'number') toBunyan(obj) - - // check if we need to style it - if (!renderer.isStyleObject(obj)) return line + eol - obj.level = obj.level || 'info' - - // allow user to filter to a specific level - if (!levels.valid(loggerLevel, obj.level)) return - - // errors should be formatted differently - if (typeof obj.err === 'object') return renderer.renderError(obj) + eol - - if (typeof obj.message === 'object') { - return renderer.renderObject(obj) + eol - } - - return render(obj) + eol - } catch (e) { - return line + eol - } - } -} - -// mutate a bole log to bunyan log -// obj -> null -function toBunyan (obj) { - if (obj.msg && !obj.message) { - obj.message = obj.msg - delete obj.msg - } - - if (typeof obj.level === 'number') { - if (obj.level === 20) obj.level = 'debug' - if (obj.level === 30) obj.level = 'info' - if (obj.level === 40) obj.level = 'warn' - if (obj.level === 50) obj.level = 'error' - } -} diff --git a/node_modules/garnish/lib/levels.js b/node_modules/garnish/lib/levels.js deleted file mode 100644 index 7db7ec961..000000000 --- a/node_modules/garnish/lib/levels.js +++ /dev/null @@ -1,34 +0,0 @@ -var padRight = require('pad-right') - -var colors = { - debug: 'cyan', - info: 'dim', - warn: 'yellow', - error: 'red' -} - -var padLen = Object.keys(colors).reduce(function (prev, a) { - return Math.max(prev, a.length) -}, 0) - -var levels = Object.keys(colors) - -// whether the message level is valid for the given logger -module.exports.valid = function (logLevel, msgLevel) { - var levelIdx = levels.indexOf(logLevel) - var msgIdx = levels.indexOf(msgLevel) - if (msgIdx === -1 || levelIdx === -1) return true - return msgIdx >= levelIdx -} - -// stringify with padding -module.exports.stringify = function (level) { - return padRight(level, padLen, ' ') -} - -// get a level's default color -module.exports.color = function (level) { - return colors[level] -} - -module.exports.maxLength = padLen diff --git a/node_modules/garnish/lib/renderer.js b/node_modules/garnish/lib/renderer.js deleted file mode 100644 index cd09e54fb..000000000 --- a/node_modules/garnish/lib/renderer.js +++ /dev/null @@ -1,192 +0,0 @@ -var chalk = require('chalk') -var stripUrl = require('url-trim') -var now = require('right-now') -var levels = require('./levels') -var padLeft = require('pad-left') -var padRight = require('pad-right') -var prettyBytes = require('prettier-bytes') -var prettyMs = require('pretty-ms') - -var paddings = { - method: 6, - statusCode: 3, - contentLength: 8, - elapsed: 7 -} - -var leftAligns = [ 'method' ] - -var ansiStyles = Object.keys(chalk.styles) -var keys = [ - 'time', - 'level', - 'elapsed', - 'contentLength', - 'message', - 'method', - 'statusCode', - 'url', - 'type', - 'name' -] - -var startTime = now() - -exports.isStyleObject = function (data) { - // skip false/undefined/etc - if (typeof data !== 'object' || !data) { - return false - } - // ensure we have something worth styling - return keys.some(function (key) { - return data.hasOwnProperty(key) - }) -} - -exports.renderError = function (data) { - var timeOff = String(Math.round((now() - startTime) / 1000) % 10000) - var line = '[' + padLeft(timeOff, 4, '0') + '] ' - line += chalk['magenta']('(' + data.name + ')') + '\n' - line += chalk.red(data.err.stack) + '\n' - return line -} - -exports.renderObject = function (data) { - var timeOff = String(Math.round((now() - startTime) / 1000) % 10000) - var line = '' - line += '[' + padLeft(timeOff, 4, '0') + '] ' - line += levels.stringify(data.level) - line += chalk['magenta']('(' + data.name + ')') + '\n' - line += destructureMessage(data.message) - return line -} - -exports.create = function (defaultName) { - return function render (data) { - var level = data.level - var name = data.name - - // some default colors - var defaultColors = { - level: levels.color(level) || 'yellow', - name: 'magenta', - time: 'dim', - statusCode: data.statusCode >= 400 ? 'red' : 'green', - contentLength: 'dim', - elapsed: 'dim', - url: 'bold', - method: 'dim', - type: 'dim' - } - - // possible user overrides - var colors = data.colors || {} - - if (typeof data.message === 'object') { - data.message = destructureMessage(data.message) - } - - // clean up the messages a little - if (level) { - data.level = levels.stringify(level) - } - - if (name) { - data.name = name === defaultName ? '' : ('(' + name + ')') - } - - if (data.url) data.url = stripUrl(data.url) - if (data.type) data.type = '(' + data.type + ')' - - var line = [] - var timeOff = String(Math.round((now() - startTime) / 1000) % 10000) - data.time = '[' + padLeft(timeOff, 4, '0') + ']' - - if (!data.message) { - data.level = level = '' - } - - var alignLeft = true - - // render each of our valid keys - keys.forEach(function (key) { - var value = data[key] - - // skip empty data - if (!value && typeof value !== 'number') { - return - } - - // compact formatting - if (key === 'elapsed') value = fixElapsed(value) - if (key === 'contentLength') value = fixSize(value) - - // pad to length - if (key in paddings) { - var left = alignLeft || leftAligns.indexOf(key) >= 0 - var padFn = left ? padRight : padLeft - value = padFn.call(padFn, value, paddings[key], ' ') - alignLeft = false - } - - // colorize chunk - var newColor = getColor(key, colors, defaultColors) - - if (newColor) { - value = chalk[newColor](value) - } - - line.push(value) - }) - return line.join(' ') - } -} - -function fixElapsed (time) { - if (typeof time === 'string' && /s$/i.test(time)) { - return time - } - if (/infinity/i.test(time)) return time - var ms = parseInt(time, 10) - return ms > 9999 ? prettyMs(ms) : (ms + 'ms') -} - -function fixSize (size) { - if (typeof size === 'string' && /s$/i.test(size)) { - return size - } - if (/infinity/i.test(size)) return size - var bytes = parseInt(size, 10) - return bytes > 9999 - ? prettyBytes(bytes) - .replace(/ /, '') - : (bytes + 'B') -} - -function getColor (key, colors, defaultColors) { - // try to apply user style - var newColor = colors[key] - - // use default if style is invalid - if (ansiStyles.indexOf(newColor) === -1) { - newColor = null - } - return newColor || defaultColors[key] -} - -// destructure a message onto an object if the message -// is an object. -// obj -> str -function destructureMessage (msg) { - const keys = Object.keys(msg) - var res = '' - for (var i = 0; i < keys.length; i++) { - var key = keys[i] - var val = msg[key] - if (i !== 0) res += '\n' - res += chalk.blue(' "' + key + '"') - res += ': ' - res += chalk.green('"' + val + '"') - } - return res -} diff --git a/node_modules/garnish/package.json b/node_modules/garnish/package.json deleted file mode 100644 index 99a1726af..000000000 --- a/node_modules/garnish/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "_from": "garnish@^5.0.0", - "_id": "garnish@5.2.0", - "_inBundle": false, - "_integrity": "sha1-vtQ2WTguSxmOM8eTiXvnxwHmVXc=", - "_location": "/garnish", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "garnish@^5.0.0", - "name": "garnish", - "escapedName": "garnish", - "rawSpec": "^5.0.0", - "saveSpec": null, - "fetchSpec": "^5.0.0" - }, - "_requiredBy": [ - "/budo" - ], - "_resolved": "https://registry.npmjs.org/garnish/-/garnish-5.2.0.tgz", - "_shasum": "bed43659382e4b198e33c793897be7c701e65577", - "_spec": "garnish@^5.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", - "author": { - "name": "Matt DesLauriers", - "email": "dave.des@gmail.com", - "url": "https://github.com/mattdesl" - }, - "bin": { - "garnish": "./bin/cmd.js" - }, - "bugs": { - "url": "https://github.com/mattdesl/garnish/issues" - }, - "bundleDependencies": false, - "dependencies": { - "chalk": "^0.5.1", - "minimist": "^1.1.0", - "pad-left": "^2.0.0", - "pad-right": "^0.2.2", - "prettier-bytes": "^1.0.3", - "pretty-ms": "^2.1.0", - "right-now": "^1.0.0", - "split2": "^0.2.1", - "stdout-stream": "^1.4.0", - "url-trim": "^1.0.0" - }, - "deprecated": false, - "description": "prettifies ndjson from wzrd and similar tools", - "devDependencies": { - "browserify": "^8.1.3", - "standard": "^4.5.4", - "strip-ansi": "^2.0.1", - "tape": "^3.5.0", - "wzrd": "^1.2.1" - }, - "homepage": "https://github.com/mattdesl/garnish", - "keywords": [ - "prettify", - "pretty", - "print", - "pretty-print", - "ndjson", - "bundle", - "bundler", - "browserify", - "wzrd", - "beefy", - "wizz" - ], - "license": "MIT", - "main": "index.js", - "name": "garnish", - "repository": { - "type": "git", - "url": "git://github.com/mattdesl/garnish.git" - }, - "scripts": { - "demo": "node test/app.js | ./bin/cmd.js", - "start": "node test/server.js", - "test": "standard && node test/test.js", - "wzrd": "wzrd test/demo.js | ./bin/cmd.js" - }, - "version": "5.2.0" -} diff --git a/node_modules/get-assigned-identifiers/.travis.yml b/node_modules/get-assigned-identifiers/.travis.yml deleted file mode 100644 index 989f79196..000000000 --- a/node_modules/get-assigned-identifiers/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - 8 - - 6 - - 4 -cache: - directories: - - ~/.npm diff --git a/node_modules/get-assigned-identifiers/CHANGELOG.md b/node_modules/get-assigned-identifiers/CHANGELOG.md deleted file mode 100644 index fe525db0d..000000000 --- a/node_modules/get-assigned-identifiers/CHANGELOG.md +++ /dev/null @@ -1,17 +0,0 @@ -# get-destructure-identifiers change log - -All notable changes to this project will be documented in this file. - -This project adheres to [Semantic Versioning](http://semver.org/). - -## 1.2.0 / 2018-02-08 - -* support object rest destructuring `{...a} = b` - -## 1.1.0 / 2017-12-02 - -* support import declarations - -## 1.0.0 / 2017-11-11 - -* initial release diff --git a/node_modules/get-assigned-identifiers/LICENSE.md b/node_modules/get-assigned-identifiers/LICENSE.md deleted file mode 100644 index 04361d9e4..000000000 --- a/node_modules/get-assigned-identifiers/LICENSE.md +++ /dev/null @@ -1,15 +0,0 @@ -# [Apache License 2.0](https://spdx.org/licenses/Apache-2.0) - -Copyright 2017 Renée Kooi - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -> http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/node_modules/get-assigned-identifiers/README.md b/node_modules/get-assigned-identifiers/README.md deleted file mode 100644 index 06957e4cc..000000000 --- a/node_modules/get-assigned-identifiers/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# get-assigned-identifiers - -get a list of identifiers that are initialised by a JavaScript AST node. - -[![npm][npm-image]][npm-url] -[![travis][travis-image]][travis-url] -[![standard][standard-image]][standard-url] - -[npm-image]: https://img.shields.io/npm/v/get-assigned-identifiers.svg?style=flat-square -[npm-url]: https://www.npmjs.com/package/get-assigned-identifiers -[travis-image]: https://img.shields.io/travis/goto-bus-stop/get-assigned-identifiers.svg?style=flat-square -[travis-url]: https://travis-ci.org/goto-bus-stop/get-assigned-identifiers -[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square -[standard-url]: http://npm.im/standard - -## Install - -``` -npm install get-assigned-identifiers -``` - -## Usage - -```js -var getAssignedIdentifiers = require('get-assigned-identifiers') - -var ast = parse(` - var { a, b: [ c,, ...x ], d } = whatever() -`) -var node = ast.body[0].declarations[0].id -getAssignedIdentifiers(node) -// → [{ name: 'a' }, { name: 'c' }, { name: 'x' }, { name: 'd' }] -``` - -## API - -### `getAssignedIdentifiers(node)` - -Return an array of AST Nodes referencing identifiers that are initialised by the `node`, taking into account destructuring. - -If `node` is not an identifier or destructuring node, this returns an empty array. - -## License - -[Apache-2.0](LICENSE.md) diff --git a/node_modules/get-assigned-identifiers/index.js b/node_modules/get-assigned-identifiers/index.js deleted file mode 100644 index 5933f8378..000000000 --- a/node_modules/get-assigned-identifiers/index.js +++ /dev/null @@ -1,57 +0,0 @@ -var assert = require('assert') - -/** - * Get a list of all identifiers that are initialised by this (possibly destructuring) - * node. - * - * eg with input: - * - * var { a: [b, ...c], d } = xyz - * - * this returns the nodes for 'b', 'c', and 'd' - */ -module.exports = function getAssignedIdentifiers (node, identifiers) { - assert.equal(typeof node, 'object', 'get-assigned-identifiers: node must be object') - assert.equal(typeof node.type, 'string', 'get-assigned-identifiers: node must have a type') - - identifiers = identifiers || [] - - if (node.type === 'ImportDeclaration') { - node.specifiers.forEach(function (el) { - getAssignedIdentifiers(el, identifiers) - }) - } - - if (node.type === 'ImportDefaultSpecifier' || node.type === 'ImportNamespaceSpecifier' || node.type === 'ImportSpecifier') { - node = node.local - } - - if (node.type === 'RestElement') { - node = node.argument - } - - if (node.type === 'ArrayPattern') { - node.elements.forEach(function (el) { - // `el` might be `null` in case of `[x,,y] = whatever` - if (el) { - getAssignedIdentifiers(el, identifiers) - } - }) - } - - if (node.type === 'ObjectPattern') { - node.properties.forEach(function (prop) { - if (prop.type === 'Property') { - getAssignedIdentifiers(prop.value, identifiers) - } else if (prop.type === 'RestElement') { - getAssignedIdentifiers(prop, identifiers) - } - }) - } - - if (node.type === 'Identifier') { - identifiers.push(node) - } - - return identifiers -} diff --git a/node_modules/get-assigned-identifiers/package.json b/node_modules/get-assigned-identifiers/package.json deleted file mode 100644 index 4fdaabe3e..000000000 --- a/node_modules/get-assigned-identifiers/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "_from": "get-assigned-identifiers@^1.2.0", - "_id": "get-assigned-identifiers@1.2.0", - "_inBundle": false, - "_integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==", - "_location": "/get-assigned-identifiers", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "get-assigned-identifiers@^1.2.0", - "name": "get-assigned-identifiers", - "escapedName": "get-assigned-identifiers", - "rawSpec": "^1.2.0", - "saveSpec": null, - "fetchSpec": "^1.2.0" - }, - "_requiredBy": [ - "/undeclared-identifiers" - ], - "_resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", - "_shasum": "6dbf411de648cbaf8d9169ebb0d2d576191e2ff1", - "_spec": "get-assigned-identifiers@^1.2.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/undeclared-identifiers", - "author": { - "name": "Renée Kooi", - "email": "renee@kooi.me" - }, - "bugs": { - "url": "https://github.com/goto-bus-stop/get-assigned-identifiers/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "get a list of identifiers that are initialised by a JavaScript AST node.", - "devDependencies": { - "acorn": "^5.4.1", - "standard": "^10.0.3", - "tape": "^4.8.0" - }, - "homepage": "https://github.com/goto-bus-stop/get-assigned-identifiers", - "keywords": [ - "ast", - "bindings", - "destructuring", - "identifiers", - "javascript", - "names", - "node" - ], - "license": "Apache-2.0", - "main": "index.js", - "name": "get-assigned-identifiers", - "repository": { - "type": "git", - "url": "git+https://github.com/goto-bus-stop/get-assigned-identifiers.git" - }, - "scripts": { - "test": "standard && tape test/*.js" - }, - "version": "1.2.0" -} diff --git a/node_modules/get-assigned-identifiers/test/index.js b/node_modules/get-assigned-identifiers/test/index.js deleted file mode 100644 index 3fbb2dd9a..000000000 --- a/node_modules/get-assigned-identifiers/test/index.js +++ /dev/null @@ -1,122 +0,0 @@ -var test = require('tape') -var assert = require('assert') -var parse = require('acorn').parse -var getAssignedIdentifiers = require('../') - -function getName (node) { - assert.equal(node.type, 'Identifier', 'Returned node must be an Identifier') - return node.name -} - -test('example', function (t) { - t.plan(1) - - var ast = parse(` - var { a, b: [ c,, ...x ], d } = whatever() - `) - var node = ast.body[0].declarations[0].id - t.deepEqual(getAssignedIdentifiers(node).map(getName), [ - 'a', - 'c', - 'x', - 'd' - ]) -}) - -test('simple identifiers', function (t) { - t.plan(1) - var ast = parse(` - var xyz = whatever() - `) - var node = ast.body[0].declarations[0].id - t.deepEqual(getAssignedIdentifiers(node).map(getName), [ 'xyz' ]) -}) - -test('array destructuring', function (t) { - t.plan(1) - var ast = parse(` - var [a, b, c] = whatever() - `) - var node = ast.body[0].declarations[0].id - t.deepEqual(getAssignedIdentifiers(node).map(getName), [ 'a', 'b', 'c' ]) -}) - -test('array destructuring with rest element', function (t) { - t.plan(1) - var ast = parse(` - var [a, b, ...rest] = whatever() - `) - var node = ast.body[0].declarations[0].id - t.deepEqual(getAssignedIdentifiers(node).map(getName), [ 'a', 'b', 'rest' ]) -}) - -test('array destructuring with holes', function (t) { - t.plan(1) - var ast = parse(` - var [a, b,,,,,, boop] = whatever() - `) - var node = ast.body[0].declarations[0].id - t.deepEqual(getAssignedIdentifiers(node).map(getName), [ 'a', 'b', 'boop' ]) -}) - -test('nested array destructuring', function (t) { - t.plan(1) - var ast = parse(` - var [a, [[[b]], ...c], boop] = whatever() - `) - var node = ast.body[0].declarations[0].id - t.deepEqual(getAssignedIdentifiers(node).map(getName), [ 'a', 'b', 'c', 'boop' ]) -}) - -test('object destructuring', function (t) { - t.plan(1) - var ast = parse(` - var {a, b} = whatever() - `) - var node = ast.body[0].declarations[0].id - t.deepEqual(getAssignedIdentifiers(node).map(getName), [ 'a', 'b' ]) -}) - -test('object destructuring with different names', function (t) { - t.plan(1) - var ast = parse(` - var {a: b, b: lol} = whatever() - `) - var node = ast.body[0].declarations[0].id - t.deepEqual(getAssignedIdentifiers(node).map(getName), [ 'b', 'lol' ]) -}) - -test('nested object destructuring', function (t) { - t.plan(1) - var ast = parse(` - var {a: {b}, b: lol, c: { - d, e: { f: g } - }} = whatever() - `) - var node = ast.body[0].declarations[0].id - t.deepEqual(getAssignedIdentifiers(node).map(getName), [ 'b', 'lol', 'd', 'g' ]) -}) - -test('object rest destructuring', function (t) { - t.plan(1) - var ast = parse(` - var {a, ...b} = whatever() - `, { ecmaVersion: 9 }) - var node = ast.body[0].declarations[0].id - t.deepEqual(getAssignedIdentifiers(node).map(getName), [ 'a', 'b' ]) -}) - -test('import declarations', function (t) { - t.plan(2) - var ast = parse(` - import x, { y, z as a } from 'module' - `, { sourceType: 'module' }) - var node = ast.body[0] - t.deepEqual(getAssignedIdentifiers(node).map(getName), [ 'x', 'y', 'a' ]) - - ast = parse(` - import * as ns from 'module' - `, { sourceType: 'module' }) - node = ast.body[0] - t.deepEqual(getAssignedIdentifiers(node).map(getName), [ 'ns' ]) -}) diff --git a/node_modules/get-ports/LICENSE.md b/node_modules/get-ports/LICENSE.md deleted file mode 100644 index 9b10ce2a8..000000000 --- a/node_modules/get-ports/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) -Copyright (c) 2015 Jam3 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE -OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/node_modules/get-ports/README.md b/node_modules/get-ports/README.md deleted file mode 100644 index 0af2fef8b..000000000 --- a/node_modules/get-ports/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# get-ports - -[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges) - -Finds multiple open ports after your specified base ports, and below the max range. - -Unlike [getport](https://github.com/mikeal/getport) or [get-port](https://github.com/sindresorhus/get-port), this is useful for situations where you need multiple servers to run on open ports. - -If not all ports could be found, the error callback is triggered. - -## Install - -```sh -npm install get-ports --save -``` - -## Example - -The resulting `ports` array is parallel to your input (base) ports. - -For example, if port `8000` and `9966` are already in use: - -```js -var getPorts = require('get-ports') - -getPorts([ 8000, 9966 ], function (err, ports) { - if (err) throw new Error('could not open servers') - - console.log(ports) - //=> [ 8001, 9967 ] -}) -``` - -## Usage - -[![NPM](https://nodei.co/npm/get-ports.png)](https://www.npmjs.com/package/get-ports) - -#### `getPorts(basePorts, [maxPort], callback)` - -For the given array of `basePorts`, tries to find the next available port from each one. This keeps track of available ports to ensure there are no conflicts in the final result. - -If the finite number `maxPort` is specified, the portfinding will fail when it reaches that maximum port. Defaults to 60000. - -The callback is called with `(err, ports)`, where `err` will be an Error if any of the portfindings failed (i.e. no open ports within range). If successful, `err` will be null and `ports` will be an array, parallel to `basePorts`, with the found port numbers. - -## License - -MIT, see [LICENSE.md](http://github.com/Jam3/get-ports/blob/master/LICENSE.md) for details. diff --git a/node_modules/get-ports/index.js b/node_modules/get-ports/index.js deleted file mode 100644 index 5aecfa83f..000000000 --- a/node_modules/get-ports/index.js +++ /dev/null @@ -1,50 +0,0 @@ -var mapLimit = require('map-limit') -var net = require('net') -var DEFAULT_MAX_PORT = 65535 - -module.exports = getPorts -function getPorts (basePorts, maxPort, cb) { - if (!Array.isArray(basePorts)) { - throw new TypeError('must provide array of ports as first argument') - } - if (typeof maxPort !== 'number') { - cb = maxPort - maxPort = DEFAULT_MAX_PORT - } - if (typeof cb !== 'function') { - throw new TypeError('must provide callback function') - } - if (!isFinite(maxPort)) { - throw new TypeError('maxPort must be a finite number') - } - - var usedPorts = [] - mapLimit(basePorts, 1, function (base, next) { - getNextPort(base, function (err, port) { - if (err) return next(new Error('no ports found after ' + base)) - next(null, port) - }) - }, cb) - - function getNextPort (basePort, cb) { - // skip used ports - while (basePort < maxPort && usedPorts.indexOf(basePort) >= 0) { - basePort++ - } - - if (basePort >= maxPort) { - return process.nextTick(function () { - cb(new Error('no open ports')) - }) - } - - var c = net.connect(basePort, function () { - c.destroy() - getNextPort(basePort + 1, cb) - }) - c.on('error', function () { - usedPorts.push(basePort) - cb(null, basePort) - }) - } -} diff --git a/node_modules/get-ports/package.json b/node_modules/get-ports/package.json deleted file mode 100644 index 05e8b94e1..000000000 --- a/node_modules/get-ports/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_from": "get-ports@^1.0.2", - "_id": "get-ports@1.0.3", - "_inBundle": false, - "_integrity": "sha1-9AvVgKyn7A77e5bL/L6wPviUteg=", - "_location": "/get-ports", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "get-ports@^1.0.2", - "name": "get-ports", - "escapedName": "get-ports", - "rawSpec": "^1.0.2", - "saveSpec": null, - "fetchSpec": "^1.0.2" - }, - "_requiredBy": [ - "/budo" - ], - "_resolved": "https://registry.npmjs.org/get-ports/-/get-ports-1.0.3.tgz", - "_shasum": "f40bd580aca7ec0efb7b96cbfcbeb03ef894b5e8", - "_spec": "get-ports@^1.0.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", - "author": { - "name": "Matt DesLauriers", - "email": "dave.des@gmail.com", - "url": "https://github.com/mattdesl" - }, - "bugs": { - "url": "https://github.com/Jam3/get-ports/issues" - }, - "bundleDependencies": false, - "dependencies": { - "map-limit": "0.0.1" - }, - "deprecated": false, - "description": "gets multiple open ports", - "devDependencies": { - "faucet": "0.0.1", - "standard": "^5.3.1", - "tape": "^4.2.1" - }, - "homepage": "https://github.com/Jam3/get-ports", - "keywords": [ - "get", - "port", - "find", - "portfind", - "finding", - "finds", - "gets", - "portfinding", - "portfinder", - "multiple" - ], - "license": "MIT", - "main": "index.js", - "name": "get-ports", - "repository": { - "type": "git", - "url": "git://github.com/Jam3/get-ports.git" - }, - "scripts": { - "test": "standard && node test.js | faucet" - }, - "version": "1.0.3" -} diff --git a/node_modules/get-stream/buffer-stream.js b/node_modules/get-stream/buffer-stream.js deleted file mode 100644 index ae45d3d9e..000000000 --- a/node_modules/get-stream/buffer-stream.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; -const PassThrough = require('stream').PassThrough; - -module.exports = opts => { - opts = Object.assign({}, opts); - - const array = opts.array; - let encoding = opts.encoding; - const buffer = encoding === 'buffer'; - let objectMode = false; - - if (array) { - objectMode = !(encoding || buffer); - } else { - encoding = encoding || 'utf8'; - } - - if (buffer) { - encoding = null; - } - - let len = 0; - const ret = []; - const stream = new PassThrough({objectMode}); - - if (encoding) { - stream.setEncoding(encoding); - } - - stream.on('data', chunk => { - ret.push(chunk); - - if (objectMode) { - len = ret.length; - } else { - len += chunk.length; - } - }); - - stream.getBufferedValue = () => { - if (array) { - return ret; - } - - return buffer ? Buffer.concat(ret, len) : ret.join(''); - }; - - stream.getBufferedLength = () => len; - - return stream; -}; diff --git a/node_modules/get-stream/index.js b/node_modules/get-stream/index.js deleted file mode 100644 index 2dc5ee96a..000000000 --- a/node_modules/get-stream/index.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; -const bufferStream = require('./buffer-stream'); - -function getStream(inputStream, opts) { - if (!inputStream) { - return Promise.reject(new Error('Expected a stream')); - } - - opts = Object.assign({maxBuffer: Infinity}, opts); - - const maxBuffer = opts.maxBuffer; - let stream; - let clean; - - const p = new Promise((resolve, reject) => { - const error = err => { - if (err) { // null check - err.bufferedData = stream.getBufferedValue(); - } - - reject(err); - }; - - stream = bufferStream(opts); - inputStream.once('error', error); - inputStream.pipe(stream); - - stream.on('data', () => { - if (stream.getBufferedLength() > maxBuffer) { - reject(new Error('maxBuffer exceeded')); - } - }); - stream.once('error', error); - stream.on('end', resolve); - - clean = () => { - // some streams doesn't implement the `stream.Readable` interface correctly - if (inputStream.unpipe) { - inputStream.unpipe(stream); - } - }; - }); - - p.then(clean, clean); - - return p.then(() => stream.getBufferedValue()); -} - -module.exports = getStream; -module.exports.buffer = (stream, opts) => getStream(stream, Object.assign({}, opts, {encoding: 'buffer'})); -module.exports.array = (stream, opts) => getStream(stream, Object.assign({}, opts, {array: true})); diff --git a/node_modules/get-stream/license b/node_modules/get-stream/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/get-stream/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/get-stream/package.json b/node_modules/get-stream/package.json deleted file mode 100644 index 78eecdea3..000000000 --- a/node_modules/get-stream/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "_from": "get-stream@^3.0.0", - "_id": "get-stream@3.0.0", - "_inBundle": false, - "_integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "_location": "/get-stream", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "get-stream@^3.0.0", - "name": "get-stream", - "escapedName": "get-stream", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/execa" - ], - "_resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "_shasum": "8e943d1358dc37555054ecbe2edb05aa174ede14", - "_spec": "get-stream@^3.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/execa", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/get-stream/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Get a stream as a string, buffer, or array", - "devDependencies": { - "ava": "*", - "into-stream": "^3.0.0", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js", - "buffer-stream.js" - ], - "homepage": "https://github.com/sindresorhus/get-stream#readme", - "keywords": [ - "get", - "stream", - "promise", - "concat", - "string", - "str", - "text", - "buffer", - "read", - "data", - "consume", - "readable", - "readablestream", - "array", - "object", - "obj" - ], - "license": "MIT", - "name": "get-stream", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/get-stream.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "3.0.0", - "xo": { - "esnext": true - } -} diff --git a/node_modules/get-stream/readme.md b/node_modules/get-stream/readme.md deleted file mode 100644 index 73b188fb4..000000000 --- a/node_modules/get-stream/readme.md +++ /dev/null @@ -1,117 +0,0 @@ -# get-stream [![Build Status](https://travis-ci.org/sindresorhus/get-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/get-stream) - -> Get a stream as a string, buffer, or array - - -## Install - -``` -$ npm install --save get-stream -``` - - -## Usage - -```js -const fs = require('fs'); -const getStream = require('get-stream'); -const stream = fs.createReadStream('unicorn.txt'); - -getStream(stream).then(str => { - console.log(str); - /* - ,,))))))));, - __)))))))))))))), - \|/ -\(((((''''((((((((. - -*-==//////(('' . `)))))), - /|\ ))| o ;-. '((((( ,(, - ( `| / ) ;))))' ,_))^;(~ - | | | ,))((((_ _____------~~~-. %,;(;(>';'~ - o_); ; )))(((` ~---~ `:: \ %%~~)(v;(`('~ - ; ''''```` `: `:::|\,__,%% );`'; ~ - | _ ) / `:|`----' `-' - ______/\/~ | / / - /~;;.____/;;' / ___--,-( `;;;/ - / // _;______;'------~~~~~ /;;/\ / - // | | / ; \;;,\ - (<_ | ; /',/-----' _> - \_| ||_ //~;~~~~~~~~~ - `\_| (,~~ - \~\ - ~~ - */ -}); -``` - - -## API - -The methods returns a promise that resolves when the `end` event fires on the stream, indicating that there is no more data to be read. The stream is switched to flowing mode. - -### getStream(stream, [options]) - -Get the `stream` as a string. - -#### options - -##### encoding - -Type: `string`
    -Default: `utf8` - -[Encoding](https://nodejs.org/api/buffer.html#buffer_buffer) of the incoming stream. - -##### maxBuffer - -Type: `number`
    -Default: `Infinity` - -Maximum length of the returned string. If it exceeds this value before the stream ends, the promise will be rejected. - -### getStream.buffer(stream, [options]) - -Get the `stream` as a buffer. - -It honors the `maxBuffer` option as above, but it refers to byte length rather than string length. - -### getStream.array(stream, [options]) - -Get the `stream` as an array of values. - -It honors both the `maxBuffer` and `encoding` options. The behavior changes slightly based on the encoding chosen: - -- When `encoding` is unset, it assumes an [object mode stream](https://nodesource.com/blog/understanding-object-streams/) and collects values emitted from `stream` unmodified. In this case `maxBuffer` refers to the number of items in the array (not the sum of their sizes). - -- When `encoding` is set to `buffer`, it collects an array of buffers. `maxBuffer` refers to the summed byte lengths of every buffer in the array. - -- When `encoding` is set to anything else, it collects an array of strings. `maxBuffer` refers to the summed character lengths of every string in the array. - - -## Errors - -If the input stream emits an `error` event, the promise will be rejected with the error. The buffered data will be attached to the `bufferedData` property of the error. - -```js -getStream(streamThatErrorsAtTheEnd('unicorn')) - .catch(err => { - console.log(err.bufferedData); - //=> 'unicorn' - }); -``` - - -## FAQ - -### How is this different from [`concat-stream`](https://github.com/maxogden/concat-stream)? - -This module accepts a stream instead of being one and returns a promise instead of using a callback. The API is simpler and it only supports returning a string, buffer, or array. It doesn't have a fragile type inference. You explicitly choose what you want. And it doesn't depend on the huge `readable-stream` package. - - -## Related - -- [get-stdin](https://github.com/sindresorhus/get-stdin) - Get stdin as a string or buffer - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/get-value/LICENSE b/node_modules/get-value/LICENSE deleted file mode 100644 index 39245ac1c..000000000 --- a/node_modules/get-value/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2016, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/get-value/index.js b/node_modules/get-value/index.js deleted file mode 100644 index 5879a8848..000000000 --- a/node_modules/get-value/index.js +++ /dev/null @@ -1,50 +0,0 @@ -/*! - * get-value - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -module.exports = function(obj, prop, a, b, c) { - if (!isObject(obj) || !prop) { - return obj; - } - - prop = toString(prop); - - // allowing for multiple properties to be passed as - // a string or array, but much faster (3-4x) than doing - // `[].slice.call(arguments)` - if (a) prop += '.' + toString(a); - if (b) prop += '.' + toString(b); - if (c) prop += '.' + toString(c); - - if (prop in obj) { - return obj[prop]; - } - - var segs = prop.split('.'); - var len = segs.length; - var i = -1; - - while (obj && (++i < len)) { - var key = segs[i]; - while (key[key.length - 1] === '\\') { - key = key.slice(0, -1) + '.' + segs[++i]; - } - obj = obj[key]; - } - return obj; -}; - -function isObject(val) { - return val !== null && (typeof val === 'object' || typeof val === 'function'); -} - -function toString(val) { - if (!val) return ''; - if (Array.isArray(val)) { - return val.join('.'); - } - return val; -} diff --git a/node_modules/get-value/package.json b/node_modules/get-value/package.json deleted file mode 100644 index 76db558d6..000000000 --- a/node_modules/get-value/package.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "_from": "get-value@^2.0.6", - "_id": "get-value@2.0.6", - "_inBundle": false, - "_integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "_location": "/get-value", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "get-value@^2.0.6", - "name": "get-value", - "escapedName": "get-value", - "rawSpec": "^2.0.6", - "saveSpec": null, - "fetchSpec": "^2.0.6" - }, - "_requiredBy": [ - "/cache-base", - "/has-value", - "/union-value", - "/unset-value/has-value" - ], - "_resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "_shasum": "dc15ca1c672387ca76bd37ac0a395ba2042a2c28", - "_spec": "get-value@^2.0.6", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/cache-base", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/get-value/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Use property paths (`a.b.c`) to get a nested value from an object.", - "devDependencies": { - "ansi-bold": "^0.1.1", - "arr-reduce": "^1.0.1", - "benchmarked": "^0.1.4", - "dot-prop": "^2.2.0", - "getobject": "^0.1.0", - "gulp": "^3.9.0", - "gulp-eslint": "^1.1.1", - "gulp-format-md": "^0.1.5", - "gulp-istanbul": "^0.10.2", - "gulp-mocha": "^2.1.3", - "isobject": "^2.0.0", - "matched": "^0.3.2", - "minimist": "^1.2.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/get-value", - "keywords": [ - "get", - "key", - "nested", - "object", - "path", - "paths", - "prop", - "properties", - "property", - "props", - "segment", - "value", - "values" - ], - "license": "MIT", - "main": "index.js", - "name": "get-value", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/get-value.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "run": true, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "has-any", - "has-any-deep", - "has-value", - "set-value", - "unset-value" - ] - }, - "reflinks": [ - "verb", - "verb-readme-generator" - ], - "lint": { - "reflinks": true - } - }, - "version": "2.0.6" -} diff --git a/node_modules/glob-base/LICENSE b/node_modules/glob-base/LICENSE deleted file mode 100644 index 65f90aca8..000000000 --- a/node_modules/glob-base/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/glob-base/README.md b/node_modules/glob-base/README.md deleted file mode 100644 index 1da2e82f1..000000000 --- a/node_modules/glob-base/README.md +++ /dev/null @@ -1,158 +0,0 @@ -# glob-base [![NPM version](https://badge.fury.io/js/glob-base.svg)](http://badge.fury.io/js/glob-base) [![Build Status](https://travis-ci.org/jonschlinkert/glob-base.svg)](https://travis-ci.org/jonschlinkert/glob-base) - -> Returns an object with the (non-glob) base path and the actual pattern. - -Use [glob-parent](https://github.com/es128/glob-parent) if you just want the base path. - -## Install with [npm](npmjs.org) - -```bash -npm i glob-base --save -``` - -## Related projects -* [glob-parent](https://github.com/es128/glob-parent): Strips glob magic from a string to provide the parent path -* [micromatch](https://github.com/jonschlinkert/micromatch): Glob matching for javascript/node.js. A faster alternative to minimatch (10-45x faster on avg), with all the features you're used to using in your Grunt and gulp tasks. -* [parse-glob](https://github.com/jonschlinkert/parse-glob): Parse a glob pattern into an object of tokens. -* [is-glob](https://github.com/jonschlinkert/is-glob): Returns `true` if the given string looks like a glob pattern. -* [braces](https://github.com/jonschlinkert/braces): Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces specification. -* [fill-range](https://github.com/jonschlinkert/fill-range): Fill in a range of numbers or letters, optionally passing an increment or multiplier to use. -* [expand-range](https://github.com/jonschlinkert/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See the benchmarks. Used by micromatch. - -## Usage - -```js -var globBase = require('glob-base'); - -globBase('a/b/.git/'); -//=> { base: 'a/b/.git/', isGlob: false, glob: '' }) - -globBase('a/b/**/e'); -//=> { base: 'a/b', isGlob: true, glob: '**/e' } - -globBase('a/b/*.{foo,bar}'); -//=> { base: 'a/b', isGlob: true, glob: '*.{foo,bar}' } - -globBase('a/b/.git/**'); -//=> { base: 'a/b/.git', isGlob: true, glob: '**' } - -globBase('a/b/c/*.md'); -//=> { base: 'a/b/c', isGlob: true, glob: '*.md' } - -globBase('a/b/c/.*.md'); -//=> { base: 'a/b/c', isGlob: true, glob: '.*.md' } - -globBase('a/b/{c,d}'); -//=> { base: 'a/b', isGlob: true, glob: '{c,d}' } - -globBase('!*.min.js'); -//=> { base: '.', isGlob: true, glob: '!*.min.js' } - -globBase('!foo'); -//=> { base: '.', isGlob: true, glob: '!foo' } - -globBase('!foo/(a|b).min.js'); -//=> { base: '.', isGlob: true, glob: '!foo/(a|b).min.js' } - -globBase(''); -//=> { base: '.', isGlob: false, glob: '' } - -globBase('**/*.md'); -//=> { base: '.', isGlob: true, glob: '**/*.md' } - -globBase('**/*.min.js'); -//=> { base: '.', isGlob: true, glob: '**/*.min.js' } - -globBase('**/.*'); -//=> { base: '.', isGlob: true, glob: '**/.*' } - -globBase('**/d'); -//=> { base: '.', isGlob: true, glob: '**/d' } - -globBase('*.*'); -//=> { base: '.', isGlob: true, glob: '*.*' } - -globBase('*.min.js'); -//=> { base: '.', isGlob: true, glob: '*.min.js' } - -globBase('*/*'); -//=> { base: '.', isGlob: true, glob: '*/*' } - -globBase('*b'); -//=> { base: '.', isGlob: true, glob: '*b' } - -globBase('.'); -//=> { base: '.', isGlob: false, glob: '.' } - -globBase('.*'); -//=> { base: '.', isGlob: true, glob: '.*' } - -globBase('./*'); -//=> { base: '.', isGlob: true, glob: '*' } - -globBase('/a'); -//=> { base: '/', isGlob: false, glob: 'a' } - -globBase('@(a|b)/e.f.g/'); -//=> { base: '.', isGlob: true, glob: '@(a|b)/e.f.g/' } - -globBase('[a-c]b*'); -//=> { base: '.', isGlob: true, glob: '[a-c]b*' } - -globBase('a'); -//=> { base: '.', isGlob: false, glob: 'a' } - -globBase('a.min.js'); -//=> { base: '.', isGlob: false, glob: 'a.min.js' } - -globBase('a/'); -//=> { base: 'a/', isGlob: false, glob: '' } - -globBase('a/**/j/**/z/*.md'); -//=> { base: 'a', isGlob: true, glob: '**/j/**/z/*.md' } - -globBase('a/*/c/*.md'); -//=> { base: 'a', isGlob: true, glob: '*/c/*.md' } - -globBase('a/?/c.md'); -//=> { base: 'a', isGlob: true, glob: '?/c.md' } - -globBase('a/??/c.js'); -//=> { base: 'a', isGlob: true, glob: '??/c.js' } - -globBase('a?b'); -//=> { base: '.', isGlob: true, glob: 'a?b' } - -globBase('bb'); -//=> { base: '.', isGlob: false, glob: 'bb' } - -globBase('c.md'); -//=> { base: '.', isGlob: false, glob: 'c.md' } -``` - -## Running tests -Install dev dependencies. - -```bash -npm i -d && npm test -``` - - -## Contributing -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/glob-base/issues) - - -## Author - -**Jon Schlinkert** - -+ [github/jonschlinkert](https://github.com/jonschlinkert) -+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License -Copyright (c) 2015 Jon Schlinkert -Released under the MIT license - -*** - -_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 08, 2015._ diff --git a/node_modules/glob-base/index.js b/node_modules/glob-base/index.js deleted file mode 100644 index 564b4a885..000000000 --- a/node_modules/glob-base/index.js +++ /dev/null @@ -1,51 +0,0 @@ -/*! - * glob-base - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var path = require('path'); -var parent = require('glob-parent'); -var isGlob = require('is-glob'); - -module.exports = function globBase(pattern) { - if (typeof pattern !== 'string') { - throw new TypeError('glob-base expects a string.'); - } - - var res = {}; - res.base = parent(pattern); - res.isGlob = isGlob(pattern); - - if (res.base !== '.') { - res.glob = pattern.substr(res.base.length); - if (res.glob.charAt(0) === '/') { - res.glob = res.glob.substr(1); - } - } else { - res.glob = pattern; - } - - if (!res.isGlob) { - res.base = dirname(pattern); - res.glob = res.base !== '.' - ? pattern.substr(res.base.length) - : pattern; - } - - if (res.glob.substr(0, 2) === './') { - res.glob = res.glob.substr(2); - } - if (res.glob.charAt(0) === '/') { - res.glob = res.glob.substr(1); - } - return res; -}; - -function dirname(glob) { - if (glob.slice(-1) === '/') return glob; - return path.dirname(glob); -} diff --git a/node_modules/glob-base/package.json b/node_modules/glob-base/package.json deleted file mode 100644 index 70f0dcf2a..000000000 --- a/node_modules/glob-base/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_from": "glob-base@^0.3.0", - "_id": "glob-base@0.3.0", - "_inBundle": false, - "_integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "_location": "/glob-base", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "glob-base@^0.3.0", - "name": "glob-base", - "escapedName": "glob-base", - "rawSpec": "^0.3.0", - "saveSpec": null, - "fetchSpec": "^0.3.0" - }, - "_requiredBy": [ - "/parse-glob" - ], - "_resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "_shasum": "dbb164f6221b1c0b1ccf82aea328b497df0ea3c4", - "_spec": "glob-base@^0.3.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/parse-glob", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/glob-base/issues" - }, - "bundleDependencies": false, - "dependencies": { - "glob-parent": "^2.0.0", - "is-glob": "^2.0.0" - }, - "deprecated": false, - "description": "Returns an object with the (non-glob) base path and the actual pattern.", - "devDependencies": { - "mocha": "*", - "should": "^5.1.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/glob-base", - "keywords": [ - "base", - "directory", - "dirname", - "expression", - "glob", - "parent", - "path", - "pattern", - "regex", - "regular", - "root" - ], - "license": { - "type": "MIT", - "url": "https://github.com/jonschlinkert/glob-base/blob/master/LICENSE" - }, - "main": "index.js", - "name": "glob-base", - "repository": { - "type": "git", - "url": "git://github.com/jonschlinkert/glob-base.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "0.3.0" -} diff --git a/node_modules/glob-parent/.npmignore b/node_modules/glob-parent/.npmignore deleted file mode 100644 index 33e391f0e..000000000 --- a/node_modules/glob-parent/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules -.DS_Store -npm-debug.log -coverage diff --git a/node_modules/glob-parent/.travis.yml b/node_modules/glob-parent/.travis.yml deleted file mode 100644 index 18fc42f69..000000000 --- a/node_modules/glob-parent/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - "4" - - "iojs-v3" - - "iojs-v2" - - "iojs-v1" - - "0.12" - - "0.10" diff --git a/node_modules/glob-parent/LICENSE b/node_modules/glob-parent/LICENSE deleted file mode 100644 index 734076d8a..000000000 --- a/node_modules/glob-parent/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) 2015 Elan Shanker - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/glob-parent/README.md b/node_modules/glob-parent/README.md deleted file mode 100644 index ff5310d3b..000000000 --- a/node_modules/glob-parent/README.md +++ /dev/null @@ -1,43 +0,0 @@ -glob-parent [![Build Status](https://travis-ci.org/es128/glob-parent.svg)](https://travis-ci.org/es128/glob-parent) [![Coverage Status](https://img.shields.io/coveralls/es128/glob-parent.svg)](https://coveralls.io/r/es128/glob-parent?branch=master) -====== -Javascript module to extract the non-magic parent path from a glob string. - -[![NPM](https://nodei.co/npm/glob-parent.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/glob-parent/) -[![NPM](https://nodei.co/npm-dl/glob-parent.png?height=3&months=9)](https://nodei.co/npm-dl/glob-parent/) - -Usage ------ -```sh -npm install glob-parent --save -``` - -```js -var globParent = require('glob-parent'); - -globParent('path/to/*.js'); // 'path/to' -globParent('/root/path/to/*.js'); // '/root/path/to' -globParent('/*.js'); // '/' -globParent('*.js'); // '.' -globParent('**/*.js'); // '.' -globParent('path/{to,from}'); // 'path' -globParent('path/!(to|from)'); // 'path' -globParent('path/?(to|from)'); // 'path' -globParent('path/+(to|from)'); // 'path' -globParent('path/*(to|from)'); // 'path' -globParent('path/@(to|from)'); // 'path' -globParent('path/**/*'); // 'path' - -// if provided a non-glob path, returns the nearest dir -globParent('path/foo/bar.js'); // 'path/foo' -globParent('path/foo/'); // 'path/foo' -globParent('path/foo'); // 'path' (see issue #3 for details) - -``` - -Change Log ----------- -[See release notes page on GitHub](https://github.com/es128/glob-parent/releases) - -License -------- -[ISC](https://raw.github.com/es128/glob-parent/master/LICENSE) diff --git a/node_modules/glob-parent/index.js b/node_modules/glob-parent/index.js deleted file mode 100644 index 61615f1ac..000000000 --- a/node_modules/glob-parent/index.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -var path = require('path'); -var isglob = require('is-glob'); - -module.exports = function globParent(str) { - str += 'a'; // preserves full path in case of trailing path separator - do {str = path.dirname(str)} while (isglob(str)); - return str; -}; diff --git a/node_modules/glob-parent/package.json b/node_modules/glob-parent/package.json deleted file mode 100644 index da6626b09..000000000 --- a/node_modules/glob-parent/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "_from": "glob-parent@^2.0.0", - "_id": "glob-parent@2.0.0", - "_inBundle": false, - "_integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "_location": "/glob-parent", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "glob-parent@^2.0.0", - "name": "glob-parent", - "escapedName": "glob-parent", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/chokidar", - "/glob-base" - ], - "_resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "_shasum": "81383d72db054fcccf5336daa902f182f6edbb28", - "_spec": "glob-parent@^2.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/chokidar", - "author": { - "name": "Elan Shanker" - }, - "bugs": { - "url": "https://github.com/es128/glob-parent/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-glob": "^2.0.0" - }, - "deprecated": false, - "description": "Strips glob magic from a string to provide the parent path", - "devDependencies": { - "coveralls": "^2.11.2", - "istanbul": "^0.3.5", - "mocha": "^2.1.0" - }, - "homepage": "https://github.com/es128/glob-parent", - "keywords": [ - "glob", - "parent", - "strip", - "path", - "directory", - "base" - ], - "license": "ISC", - "main": "index.js", - "name": "glob-parent", - "repository": { - "type": "git", - "url": "git+https://github.com/es128/glob-parent.git" - }, - "scripts": { - "test": "istanbul cover _mocha && cat ./coverage/lcov.info | coveralls" - }, - "version": "2.0.0" -} diff --git a/node_modules/glob-parent/test.js b/node_modules/glob-parent/test.js deleted file mode 100644 index 01156d2ff..000000000 --- a/node_modules/glob-parent/test.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -var gp = require('./'); -var assert = require('assert'); - -describe('glob-parent', function() { - it('should strip glob magic to return parent path', function() { - assert.equal(gp('path/to/*.js'), 'path/to'); - assert.equal(gp('/root/path/to/*.js'), '/root/path/to'); - assert.equal(gp('/*.js'), '/'); - assert.equal(gp('*.js'), '.'); - assert.equal(gp('**/*.js'), '.'); - assert.equal(gp('path/{to,from}'), 'path'); - assert.equal(gp('path/!(to|from)'), 'path'); - assert.equal(gp('path/?(to|from)'), 'path'); - assert.equal(gp('path/+(to|from)'), 'path'); - assert.equal(gp('path/*(to|from)'), 'path'); - assert.equal(gp('path/@(to|from)'), 'path'); - assert.equal(gp('path/**/*'), 'path'); - assert.equal(gp('path/**/subdir/foo.*'), 'path'); - }); - - it('should return parent dirname from non-glob paths', function() { - assert.equal(gp('path/foo/bar.js'), 'path/foo'); - assert.equal(gp('path/foo/'), 'path/foo'); - assert.equal(gp('path/foo'), 'path'); - }); -}); diff --git a/node_modules/glob/LICENSE b/node_modules/glob/LICENSE deleted file mode 100644 index 19129e315..000000000 --- a/node_modules/glob/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/glob/README.md b/node_modules/glob/README.md deleted file mode 100644 index baa1d1ba8..000000000 --- a/node_modules/glob/README.md +++ /dev/null @@ -1,368 +0,0 @@ -# Glob - -Match files using the patterns the shell uses, like stars and stuff. - -[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) - -This is a glob implementation in JavaScript. It uses the `minimatch` -library to do its matching. - -![](oh-my-glob.gif) - -## Usage - -Install with npm - -``` -npm i glob -``` - -```javascript -var glob = require("glob") - -// options is optional -glob("**/*.js", options, function (er, files) { - // files is an array of filenames. - // If the `nonull` option is set, and nothing - // was found, then files is ["**/*.js"] - // er is an error object or null. -}) -``` - -## Glob Primer - -"Globs" are the patterns you type when you do stuff like `ls *.js` on -the command line, or put `build/*` in a `.gitignore` file. - -Before parsing the path part patterns, braced sections are expanded -into a set. Braced sections start with `{` and end with `}`, with any -number of comma-delimited sections within. Braced sections may contain -slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. - -The following characters have special magic meaning when used in a -path portion: - -* `*` Matches 0 or more characters in a single path portion -* `?` Matches 1 character -* `[...]` Matches a range of characters, similar to a RegExp range. - If the first character of the range is `!` or `^` then it matches - any character not in the range. -* `!(pattern|pattern|pattern)` Matches anything that does not match - any of the patterns provided. -* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the - patterns provided. -* `+(pattern|pattern|pattern)` Matches one or more occurrences of the - patterns provided. -* `*(a|b|c)` Matches zero or more occurrences of the patterns provided -* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns - provided -* `**` If a "globstar" is alone in a path portion, then it matches - zero or more directories and subdirectories searching for matches. - It does not crawl symlinked directories. - -### Dots - -If a file or directory path portion has a `.` as the first character, -then it will not match any glob pattern unless that pattern's -corresponding path part also has a `.` as its first character. - -For example, the pattern `a/.*/c` would match the file at `a/.b/c`. -However the pattern `a/*/c` would not, because `*` does not start with -a dot character. - -You can make glob treat dots as normal characters by setting -`dot:true` in the options. - -### Basename Matching - -If you set `matchBase:true` in the options, and the pattern has no -slashes in it, then it will seek for any file anywhere in the tree -with a matching basename. For example, `*.js` would match -`test/simple/basic.js`. - -### Empty Sets - -If no matching files are found, then an empty array is returned. This -differs from the shell, where the pattern itself is returned. For -example: - - $ echo a*s*d*f - a*s*d*f - -To get the bash-style behavior, set the `nonull:true` in the options. - -### See Also: - -* `man sh` -* `man bash` (Search for "Pattern Matching") -* `man 3 fnmatch` -* `man 5 gitignore` -* [minimatch documentation](https://github.com/isaacs/minimatch) - -## glob.hasMagic(pattern, [options]) - -Returns `true` if there are any special characters in the pattern, and -`false` otherwise. - -Note that the options affect the results. If `noext:true` is set in -the options object, then `+(a|b)` will not be considered a magic -pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` -then that is considered magical, unless `nobrace:true` is set in the -options. - -## glob(pattern, [options], cb) - -* `pattern` `{String}` Pattern to be matched -* `options` `{Object}` -* `cb` `{Function}` - * `err` `{Error | null}` - * `matches` `{Array}` filenames found matching the pattern - -Perform an asynchronous glob search. - -## glob.sync(pattern, [options]) - -* `pattern` `{String}` Pattern to be matched -* `options` `{Object}` -* return: `{Array}` filenames found matching the pattern - -Perform a synchronous glob search. - -## Class: glob.Glob - -Create a Glob object by instantiating the `glob.Glob` class. - -```javascript -var Glob = require("glob").Glob -var mg = new Glob(pattern, options, cb) -``` - -It's an EventEmitter, and starts walking the filesystem to find matches -immediately. - -### new glob.Glob(pattern, [options], [cb]) - -* `pattern` `{String}` pattern to search for -* `options` `{Object}` -* `cb` `{Function}` Called when an error occurs, or matches are found - * `err` `{Error | null}` - * `matches` `{Array}` filenames found matching the pattern - -Note that if the `sync` flag is set in the options, then matches will -be immediately available on the `g.found` member. - -### Properties - -* `minimatch` The minimatch object that the glob uses. -* `options` The options object passed in. -* `aborted` Boolean which is set to true when calling `abort()`. There - is no way at this time to continue a glob search after aborting, but - you can re-use the statCache to avoid having to duplicate syscalls. -* `cache` Convenience object. Each field has the following possible - values: - * `false` - Path does not exist - * `true` - Path exists - * `'FILE'` - Path exists, and is not a directory - * `'DIR'` - Path exists, and is a directory - * `[file, entries, ...]` - Path exists, is a directory, and the - array value is the results of `fs.readdir` -* `statCache` Cache of `fs.stat` results, to prevent statting the same - path multiple times. -* `symlinks` A record of which paths are symbolic links, which is - relevant in resolving `**` patterns. -* `realpathCache` An optional object which is passed to `fs.realpath` - to minimize unnecessary syscalls. It is stored on the instantiated - Glob object, and may be re-used. - -### Events - -* `end` When the matching is finished, this is emitted with all the - matches found. If the `nonull` option is set, and no match was found, - then the `matches` list contains the original pattern. The matches - are sorted, unless the `nosort` flag is set. -* `match` Every time a match is found, this is emitted with the specific - thing that matched. It is not deduplicated or resolved to a realpath. -* `error` Emitted when an unexpected error is encountered, or whenever - any fs error occurs if `options.strict` is set. -* `abort` When `abort()` is called, this event is raised. - -### Methods - -* `pause` Temporarily stop the search -* `resume` Resume the search -* `abort` Stop the search forever - -### Options - -All the options that can be passed to Minimatch can also be passed to -Glob to change pattern matching behavior. Also, some have been added, -or have glob-specific ramifications. - -All options are false by default, unless otherwise noted. - -All options are added to the Glob object, as well. - -If you are running many `glob` operations, you can pass a Glob object -as the `options` argument to a subsequent operation to shortcut some -`stat` and `readdir` calls. At the very least, you may pass in shared -`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that -parallel glob operations will be sped up by sharing information about -the filesystem. - -* `cwd` The current working directory in which to search. Defaults - to `process.cwd()`. -* `root` The place where patterns starting with `/` will be mounted - onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix - systems, and `C:\` or some such on Windows.) -* `dot` Include `.dot` files in normal matches and `globstar` matches. - Note that an explicit dot in a portion of the pattern will always - match dot files. -* `nomount` By default, a pattern starting with a forward-slash will be - "mounted" onto the root setting, so that a valid filesystem path is - returned. Set this flag to disable that behavior. -* `mark` Add a `/` character to directory matches. Note that this - requires additional stat calls. -* `nosort` Don't sort the results. -* `stat` Set to true to stat *all* results. This reduces performance - somewhat, and is completely unnecessary, unless `readdir` is presumed - to be an untrustworthy indicator of file existence. -* `silent` When an unusual error is encountered when attempting to - read a directory, a warning will be printed to stderr. Set the - `silent` option to true to suppress these warnings. -* `strict` When an unusual error is encountered when attempting to - read a directory, the process will just continue on in search of - other matches. Set the `strict` option to raise an error in these - cases. -* `cache` See `cache` property above. Pass in a previously generated - cache object to save some fs calls. -* `statCache` A cache of results of filesystem information, to prevent - unnecessary stat calls. While it should not normally be necessary - to set this, you may pass the statCache from one glob() call to the - options object of another, if you know that the filesystem will not - change between calls. (See "Race Conditions" below.) -* `symlinks` A cache of known symbolic links. You may pass in a - previously generated `symlinks` object to save `lstat` calls when - resolving `**` matches. -* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. -* `nounique` In some cases, brace-expanded patterns can result in the - same file showing up multiple times in the result set. By default, - this implementation prevents duplicates in the result set. Set this - flag to disable that behavior. -* `nonull` Set to never return an empty set, instead returning a set - containing the pattern itself. This is the default in glob(3). -* `debug` Set to enable debug logging in minimatch and glob. -* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. -* `noglobstar` Do not match `**` against multiple filenames. (Ie, - treat it as a normal `*` instead.) -* `noext` Do not match `+(a|b)` "extglob" patterns. -* `nocase` Perform a case-insensitive match. Note: on - case-insensitive filesystems, non-magic patterns will match by - default, since `stat` and `readdir` will not raise errors. -* `matchBase` Perform a basename-only match if the pattern does not - contain any slash characters. That is, `*.js` would be treated as - equivalent to `**/*.js`, matching all js files in all directories. -* `nodir` Do not match directories, only files. (Note: to match - *only* directories, simply put a `/` at the end of the pattern.) -* `ignore` Add a pattern or an array of glob patterns to exclude matches. - Note: `ignore` patterns are *always* in `dot:true` mode, regardless - of any other settings. -* `follow` Follow symlinked directories when expanding `**` patterns. - Note that this can result in a lot of duplicate references in the - presence of cyclic links. -* `realpath` Set to true to call `fs.realpath` on all of the results. - In the case of a symlink that cannot be resolved, the full absolute - path to the matched entry is returned (though it will usually be a - broken symlink) -* `absolute` Set to true to always receive absolute paths for matched - files. Unlike `realpath`, this also affects the values returned in - the `match` event. - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between node-glob and other -implementations, and are intentional. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.3, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -Note that symlinked directories are not crawled as part of a `**`, -though their contents may match against subsequent portions of the -pattern. This prevents infinite loops and duplicates and the like. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then glob returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. - -### Comments and Negation - -Previously, this module let you mark a pattern as a "comment" if it -started with a `#` character, or a "negated" pattern if it started -with a `!` character. - -These options were deprecated in version 5, and removed in version 6. - -To specify things that should not match, use the `ignore` option. - -## Windows - -**Please only use forward-slashes in glob expressions.** - -Though windows uses either `/` or `\` as its path separator, only `/` -characters are used by this glob implementation. You must use -forward-slashes **only** in glob expressions. Back-slashes will always -be interpreted as escape characters, not path separators. - -Results from absolute patterns such as `/foo/*` are mounted onto the -root setting using `path.join`. On windows, this will by default result -in `/foo/*` matching `C:\foo\bar.txt`. - -## Race Conditions - -Glob searching, by its very nature, is susceptible to race conditions, -since it relies on directory walking and such. - -As a result, it is possible that a file that exists when glob looks for -it may have been deleted or modified by the time it returns the result. - -As part of its internal implementation, this program caches all stat -and readdir calls that it makes, in order to cut down on system -overhead. However, this also makes it even more susceptible to races, -especially if the cache or statCache objects are reused between glob -calls. - -Users are thus advised not to use a glob result as a guarantee of -filesystem state in the face of rapid changes. For the vast majority -of operations, this is never a problem. - -## Contributing - -Any change to behavior (including bugfixes) must come with a test. - -Patches that fail tests or reduce performance will be rejected. - -``` -# to run tests -npm test - -# to re-generate test fixtures -npm run test-regen - -# to benchmark against bash/zsh -npm run bench - -# to profile javascript -npm run prof -``` diff --git a/node_modules/glob/changelog.md b/node_modules/glob/changelog.md deleted file mode 100644 index 41636771e..000000000 --- a/node_modules/glob/changelog.md +++ /dev/null @@ -1,67 +0,0 @@ -## 7.0 - -- Raise error if `options.cwd` is specified, and not a directory - -## 6.0 - -- Remove comment and negation pattern support -- Ignore patterns are always in `dot:true` mode - -## 5.0 - -- Deprecate comment and negation patterns -- Fix regression in `mark` and `nodir` options from making all cache - keys absolute path. -- Abort if `fs.readdir` returns an error that's unexpected -- Don't emit `match` events for ignored items -- Treat ENOTSUP like ENOTDIR in readdir - -## 4.5 - -- Add `options.follow` to always follow directory symlinks in globstar -- Add `options.realpath` to call `fs.realpath` on all results -- Always cache based on absolute path - -## 4.4 - -- Add `options.ignore` -- Fix handling of broken symlinks - -## 4.3 - -- Bump minimatch to 2.x -- Pass all tests on Windows - -## 4.2 - -- Add `glob.hasMagic` function -- Add `options.nodir` flag - -## 4.1 - -- Refactor sync and async implementations for performance -- Throw if callback provided to sync glob function -- Treat symbolic links in globstar results the same as Bash 4.3 - -## 4.0 - -- Use `^` for dependency versions (bumped major because this breaks - older npm versions) -- Ensure callbacks are only ever called once -- switch to ISC license - -## 3.x - -- Rewrite in JavaScript -- Add support for setting root, cwd, and windows support -- Cache many fs calls -- Add globstar support -- emit match events - -## 2.x - -- Use `glob.h` and `fnmatch.h` from NetBSD - -## 1.x - -- `glob.h` static binding. diff --git a/node_modules/glob/common.js b/node_modules/glob/common.js deleted file mode 100644 index 66651bb3a..000000000 --- a/node_modules/glob/common.js +++ /dev/null @@ -1,240 +0,0 @@ -exports.alphasort = alphasort -exports.alphasorti = alphasorti -exports.setopts = setopts -exports.ownProp = ownProp -exports.makeAbs = makeAbs -exports.finish = finish -exports.mark = mark -exports.isIgnored = isIgnored -exports.childrenIgnored = childrenIgnored - -function ownProp (obj, field) { - return Object.prototype.hasOwnProperty.call(obj, field) -} - -var path = require("path") -var minimatch = require("minimatch") -var isAbsolute = require("path-is-absolute") -var Minimatch = minimatch.Minimatch - -function alphasorti (a, b) { - return a.toLowerCase().localeCompare(b.toLowerCase()) -} - -function alphasort (a, b) { - return a.localeCompare(b) -} - -function setupIgnores (self, options) { - self.ignore = options.ignore || [] - - if (!Array.isArray(self.ignore)) - self.ignore = [self.ignore] - - if (self.ignore.length) { - self.ignore = self.ignore.map(ignoreMap) - } -} - -// ignore patterns are always in dot:true mode. -function ignoreMap (pattern) { - var gmatcher = null - if (pattern.slice(-3) === '/**') { - var gpattern = pattern.replace(/(\/\*\*)+$/, '') - gmatcher = new Minimatch(gpattern, { dot: true }) - } - - return { - matcher: new Minimatch(pattern, { dot: true }), - gmatcher: gmatcher - } -} - -function setopts (self, pattern, options) { - if (!options) - options = {} - - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") - } - pattern = "**/" + pattern - } - - self.silent = !!options.silent - self.pattern = pattern - self.strict = options.strict !== false - self.realpath = !!options.realpath - self.realpathCache = options.realpathCache || Object.create(null) - self.follow = !!options.follow - self.dot = !!options.dot - self.mark = !!options.mark - self.nodir = !!options.nodir - if (self.nodir) - self.mark = true - self.sync = !!options.sync - self.nounique = !!options.nounique - self.nonull = !!options.nonull - self.nosort = !!options.nosort - self.nocase = !!options.nocase - self.stat = !!options.stat - self.noprocess = !!options.noprocess - self.absolute = !!options.absolute - - self.maxLength = options.maxLength || Infinity - self.cache = options.cache || Object.create(null) - self.statCache = options.statCache || Object.create(null) - self.symlinks = options.symlinks || Object.create(null) - - setupIgnores(self, options) - - self.changedCwd = false - var cwd = process.cwd() - if (!ownProp(options, "cwd")) - self.cwd = cwd - else { - self.cwd = path.resolve(options.cwd) - self.changedCwd = self.cwd !== cwd - } - - self.root = options.root || path.resolve(self.cwd, "/") - self.root = path.resolve(self.root) - if (process.platform === "win32") - self.root = self.root.replace(/\\/g, "/") - - // TODO: is an absolute `cwd` supposed to be resolved against `root`? - // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') - self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) - if (process.platform === "win32") - self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") - self.nomount = !!options.nomount - - // disable comments and negation in Minimatch. - // Note that they are not supported in Glob itself anyway. - options.nonegate = true - options.nocomment = true - - self.minimatch = new Minimatch(pattern, options) - self.options = self.minimatch.options -} - -function finish (self) { - var nou = self.nounique - var all = nou ? [] : Object.create(null) - - for (var i = 0, l = self.matches.length; i < l; i ++) { - var matches = self.matches[i] - if (!matches || Object.keys(matches).length === 0) { - if (self.nonull) { - // do like the shell, and spit out the literal glob - var literal = self.minimatch.globSet[i] - if (nou) - all.push(literal) - else - all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) - all.push.apply(all, m) - else - m.forEach(function (m) { - all[m] = true - }) - } - } - - if (!nou) - all = Object.keys(all) - - if (!self.nosort) - all = all.sort(self.nocase ? alphasorti : alphasort) - - // at *some* point we statted all of these - if (self.mark) { - for (var i = 0; i < all.length; i++) { - all[i] = self._mark(all[i]) - } - if (self.nodir) { - all = all.filter(function (e) { - var notDir = !(/\/$/.test(e)) - var c = self.cache[e] || self.cache[makeAbs(self, e)] - if (notDir && c) - notDir = c !== 'DIR' && !Array.isArray(c) - return notDir - }) - } - } - - if (self.ignore.length) - all = all.filter(function(m) { - return !isIgnored(self, m) - }) - - self.found = all -} - -function mark (self, p) { - var abs = makeAbs(self, p) - var c = self.cache[abs] - var m = p - if (c) { - var isDir = c === 'DIR' || Array.isArray(c) - var slash = p.slice(-1) === '/' - - if (isDir && !slash) - m += '/' - else if (!isDir && slash) - m = m.slice(0, -1) - - if (m !== p) { - var mabs = makeAbs(self, m) - self.statCache[mabs] = self.statCache[abs] - self.cache[mabs] = self.cache[abs] - } - } - - return m -} - -// lotta situps... -function makeAbs (self, f) { - var abs = f - if (f.charAt(0) === '/') { - abs = path.join(self.root, f) - } else if (isAbsolute(f) || f === '') { - abs = f - } else if (self.changedCwd) { - abs = path.resolve(self.cwd, f) - } else { - abs = path.resolve(f) - } - - if (process.platform === 'win32') - abs = abs.replace(/\\/g, '/') - - return abs -} - - -// Return true, if pattern ends with globstar '**', for the accompanying parent directory. -// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents -function isIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) - }) -} - -function childrenIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return !!(item.gmatcher && item.gmatcher.match(path)) - }) -} diff --git a/node_modules/glob/glob.js b/node_modules/glob/glob.js deleted file mode 100644 index 58dec0f6c..000000000 --- a/node_modules/glob/glob.js +++ /dev/null @@ -1,790 +0,0 @@ -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern, false) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern, inGlobStar) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// -// If inGlobStar and PREFIX is symlink and points to dir -// set ENTRIES = [] -// else readdir(PREFIX) as ENTRIES -// If fail, END -// -// with ENTRIES -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// // Mark that this entry is a globstar match -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. - -module.exports = glob - -var fs = require('fs') -var rp = require('fs.realpath') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var inherits = require('inherits') -var EE = require('events').EventEmitter -var path = require('path') -var assert = require('assert') -var isAbsolute = require('path-is-absolute') -var globSync = require('./sync.js') -var common = require('./common.js') -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var setopts = common.setopts -var ownProp = common.ownProp -var inflight = require('inflight') -var util = require('util') -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -var once = require('once') - -function glob (pattern, options, cb) { - if (typeof options === 'function') cb = options, options = {} - if (!options) options = {} - - if (options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return globSync(pattern, options) - } - - return new Glob(pattern, options, cb) -} - -glob.sync = globSync -var GlobSync = glob.GlobSync = globSync.GlobSync - -// old api surface -glob.glob = glob - -function extend (origin, add) { - if (add === null || typeof add !== 'object') { - return origin - } - - var keys = Object.keys(add) - var i = keys.length - while (i--) { - origin[keys[i]] = add[keys[i]] - } - return origin -} - -glob.hasMagic = function (pattern, options_) { - var options = extend({}, options_) - options.noprocess = true - - var g = new Glob(pattern, options) - var set = g.minimatch.set - - if (!pattern) - return false - - if (set.length > 1) - return true - - for (var j = 0; j < set[0].length; j++) { - if (typeof set[0][j] !== 'string') - return true - } - - return false -} - -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } - - if (options && options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return new GlobSync(pattern, options) - } - - if (!(this instanceof Glob)) - return new Glob(pattern, options, cb) - - setopts(this, pattern, options) - this._didRealPath = false - - // process each pattern in the minimatch set - var n = this.minimatch.set.length - - // The matches are stored as {: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) - - if (typeof cb === 'function') { - cb = once(cb) - this.on('error', cb) - this.on('end', function (matches) { - cb(null, matches) - }) - } - - var self = this - this._processing = 0 - - this._emitQueue = [] - this._processQueue = [] - this.paused = false - - if (this.noprocess) - return this - - if (n === 0) - return done() - - var sync = true - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false, done) - } - sync = false - - function done () { - --self._processing - if (self._processing <= 0) { - if (sync) { - process.nextTick(function () { - self._finish() - }) - } else { - self._finish() - } - } - } -} - -Glob.prototype._finish = function () { - assert(this instanceof Glob) - if (this.aborted) - return - - if (this.realpath && !this._didRealpath) - return this._realpath() - - common.finish(this) - this.emit('end', this.found) -} - -Glob.prototype._realpath = function () { - if (this._didRealpath) - return - - this._didRealpath = true - - var n = this.matches.length - if (n === 0) - return this._finish() - - var self = this - for (var i = 0; i < this.matches.length; i++) - this._realpathSet(i, next) - - function next () { - if (--n === 0) - self._finish() - } -} - -Glob.prototype._realpathSet = function (index, cb) { - var matchset = this.matches[index] - if (!matchset) - return cb() - - var found = Object.keys(matchset) - var self = this - var n = found.length - - if (n === 0) - return cb() - - var set = this.matches[index] = Object.create(null) - found.forEach(function (p, i) { - // If there's a problem with the stat, then it means that - // one or more of the links in the realpath couldn't be - // resolved. just return the abs value in that case. - p = self._makeAbs(p) - rp.realpath(p, self.realpathCache, function (er, real) { - if (!er) - set[real] = true - else if (er.syscall === 'stat') - set[p] = true - else - self.emit('error', er) // srsly wtf right here - - if (--n === 0) { - self.matches[index] = set - cb() - } - }) - }) -} - -Glob.prototype._mark = function (p) { - return common.mark(this, p) -} - -Glob.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} - -Glob.prototype.abort = function () { - this.aborted = true - this.emit('abort') -} - -Glob.prototype.pause = function () { - if (!this.paused) { - this.paused = true - this.emit('pause') - } -} - -Glob.prototype.resume = function () { - if (this.paused) { - this.emit('resume') - this.paused = false - if (this._emitQueue.length) { - var eq = this._emitQueue.slice(0) - this._emitQueue.length = 0 - for (var i = 0; i < eq.length; i ++) { - var e = eq[i] - this._emitMatch(e[0], e[1]) - } - } - if (this._processQueue.length) { - var pq = this._processQueue.slice(0) - this._processQueue.length = 0 - for (var i = 0; i < pq.length; i ++) { - var p = pq[i] - this._processing-- - this._process(p[0], p[1], p[2], p[3]) - } - } - } -} - -Glob.prototype._process = function (pattern, index, inGlobStar, cb) { - assert(this instanceof Glob) - assert(typeof cb === 'function') - - if (this.aborted) - return - - this._processing++ - if (this.paused) { - this._processQueue.push([pattern, index, inGlobStar, cb]) - return - } - - //console.error('PROCESS %d', this._processing, pattern) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index, cb) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip _processing - if (childrenIgnored(this, read)) - return cb() - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) -} - -Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - -Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return cb() - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return cb() - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return cb() - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - this._process([e].concat(remain), index, inGlobStar, cb) - } - cb() -} - -Glob.prototype._emitMatch = function (index, e) { - if (this.aborted) - return - - if (isIgnored(this, e)) - return - - if (this.paused) { - this._emitQueue.push([index, e]) - return - } - - var abs = isAbsolute(e) ? e : this._makeAbs(e) - - if (this.mark) - e = this._mark(e) - - if (this.absolute) - e = abs - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - - var st = this.statCache[abs] - if (st) - this.emit('stat', e, st) - - this.emit('match', e) -} - -Glob.prototype._readdirInGlobStar = function (abs, cb) { - if (this.aborted) - return - - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false, cb) - - var lstatkey = 'lstat\0' + abs - var self = this - var lstatcb = inflight(lstatkey, lstatcb_) - - if (lstatcb) - fs.lstat(abs, lstatcb) - - function lstatcb_ (er, lstat) { - if (er && er.code === 'ENOENT') - return cb() - - var isSym = lstat && lstat.isSymbolicLink() - self.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) { - self.cache[abs] = 'FILE' - cb() - } else - self._readdir(abs, false, cb) - } -} - -Glob.prototype._readdir = function (abs, inGlobStar, cb) { - if (this.aborted) - return - - cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) - if (!cb) - return - - //console.error('RD %j %j', +inGlobStar, abs) - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs, cb) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return cb() - - if (Array.isArray(c)) - return cb(null, c) - } - - var self = this - fs.readdir(abs, readdirCb(this, abs, cb)) -} - -function readdirCb (self, abs, cb) { - return function (er, entries) { - if (er) - self._readdirError(abs, er, cb) - else - self._readdirEntries(abs, entries, cb) - } -} - -Glob.prototype._readdirEntries = function (abs, entries, cb) { - if (this.aborted) - return - - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - return cb(null, entries) -} - -Glob.prototype._readdirError = function (f, er, cb) { - if (this.aborted) - return - - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - this.emit('error', error) - this.abort() - } - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) { - this.emit('error', er) - // If the error is handled, then we abort - // if not, we threw out of here - this.abort() - } - if (!this.silent) - console.error('glob error', er) - break - } - - return cb() -} - -Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - - -Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - //console.error('pgs2', prefix, remain[0], entries) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return cb() - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false, cb) - - var isSym = this.symlinks[abs] - var len = entries.length - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return cb() - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true, cb) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true, cb) - } - - cb() -} - -Glob.prototype._processSimple = function (prefix, index, cb) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var self = this - this._stat(prefix, function (er, exists) { - self._processSimple2(prefix, index, er, exists, cb) - }) -} -Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { - - //console.error('ps2', prefix, exists) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return cb() - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) - cb() -} - -// Returns either 'DIR', 'FILE', or false -Glob.prototype._stat = function (f, cb) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return cb() - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return cb(null, c) - - if (needDir && c === 'FILE') - return cb() - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (stat !== undefined) { - if (stat === false) - return cb(null, stat) - else { - var type = stat.isDirectory() ? 'DIR' : 'FILE' - if (needDir && type === 'FILE') - return cb() - else - return cb(null, type, stat) - } - } - - var self = this - var statcb = inflight('stat\0' + abs, lstatcb_) - if (statcb) - fs.lstat(abs, statcb) - - function lstatcb_ (er, lstat) { - if (lstat && lstat.isSymbolicLink()) { - // If it's a symlink, then treat it as the target, unless - // the target does not exist, then treat it as a file. - return fs.stat(abs, function (er, stat) { - if (er) - self._stat2(f, abs, null, lstat, cb) - else - self._stat2(f, abs, er, stat, cb) - }) - } else { - self._stat2(f, abs, er, lstat, cb) - } - } -} - -Glob.prototype._stat2 = function (f, abs, er, stat, cb) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return cb() - } - - var needDir = f.slice(-1) === '/' - this.statCache[abs] = stat - - if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) - return cb(null, false, stat) - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c === 'FILE') - return cb() - - return cb(null, c, stat) -} diff --git a/node_modules/glob/package.json b/node_modules/glob/package.json deleted file mode 100644 index 01e23ba20..000000000 --- a/node_modules/glob/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "_from": "glob@^7.1.0", - "_id": "glob@7.1.3", - "_inBundle": false, - "_integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "_location": "/glob", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "glob@^7.1.0", - "name": "glob", - "escapedName": "glob", - "rawSpec": "^7.1.0", - "saveSpec": null, - "fetchSpec": "^7.1.0" - }, - "_requiredBy": [ - "/browserify" - ], - "_resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "_shasum": "3960832d3f1574108342dafd3a67b332c0969df1", - "_spec": "glob@^7.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/node-glob/issues" - }, - "bundleDependencies": false, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "deprecated": false, - "description": "a little globber", - "devDependencies": { - "mkdirp": "0", - "rimraf": "^2.2.8", - "tap": "^12.0.1", - "tick": "0.0.6" - }, - "engines": { - "node": "*" - }, - "files": [ - "glob.js", - "sync.js", - "common.js" - ], - "homepage": "https://github.com/isaacs/node-glob#readme", - "license": "ISC", - "main": "glob.js", - "name": "glob", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-glob.git" - }, - "scripts": { - "bench": "bash benchmark.sh", - "benchclean": "node benchclean.js", - "prepublish": "npm run benchclean", - "prof": "bash prof.sh && cat profile.txt", - "profclean": "rm -f v8.log profile.txt", - "test": "tap test/*.js --cov", - "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" - }, - "version": "7.1.3" -} diff --git a/node_modules/glob/sync.js b/node_modules/glob/sync.js deleted file mode 100644 index c952134ba..000000000 --- a/node_modules/glob/sync.js +++ /dev/null @@ -1,486 +0,0 @@ -module.exports = globSync -globSync.GlobSync = GlobSync - -var fs = require('fs') -var rp = require('fs.realpath') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var Glob = require('./glob.js').Glob -var util = require('util') -var path = require('path') -var assert = require('assert') -var isAbsolute = require('path-is-absolute') -var common = require('./common.js') -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var setopts = common.setopts -var ownProp = common.ownProp -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -function globSync (pattern, options) { - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - return new GlobSync(pattern, options).found -} - -function GlobSync (pattern, options) { - if (!pattern) - throw new Error('must provide pattern') - - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - if (!(this instanceof GlobSync)) - return new GlobSync(pattern, options) - - setopts(this, pattern, options) - - if (this.noprocess) - return this - - var n = this.minimatch.set.length - this.matches = new Array(n) - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false) - } - this._finish() -} - -GlobSync.prototype._finish = function () { - assert(this instanceof GlobSync) - if (this.realpath) { - var self = this - this.matches.forEach(function (matchset, index) { - var set = self.matches[index] = Object.create(null) - for (var p in matchset) { - try { - p = self._makeAbs(p) - var real = rp.realpathSync(p, self.realpathCache) - set[real] = true - } catch (er) { - if (er.syscall === 'stat') - set[self._makeAbs(p)] = true - else - throw er - } - } - }) - } - common.finish(this) -} - - -GlobSync.prototype._process = function (pattern, index, inGlobStar) { - assert(this instanceof GlobSync) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // See if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip processing - if (childrenIgnored(this, read)) - return - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar) -} - - -GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar) - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix.slice(-1) !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) - newPattern = [prefix, e] - else - newPattern = [e] - this._process(newPattern.concat(remain), index, inGlobStar) - } -} - - -GlobSync.prototype._emitMatch = function (index, e) { - if (isIgnored(this, e)) - return - - var abs = this._makeAbs(e) - - if (this.mark) - e = this._mark(e) - - if (this.absolute) { - e = abs - } - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - - if (this.stat) - this._stat(e) -} - - -GlobSync.prototype._readdirInGlobStar = function (abs) { - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false) - - var entries - var lstat - var stat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - if (er.code === 'ENOENT') { - // lstat failed, doesn't exist - return null - } - } - - var isSym = lstat && lstat.isSymbolicLink() - this.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) - this.cache[abs] = 'FILE' - else - entries = this._readdir(abs, false) - - return entries -} - -GlobSync.prototype._readdir = function (abs, inGlobStar) { - var entries - - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return null - - if (Array.isArray(c)) - return c - } - - try { - return this._readdirEntries(abs, fs.readdirSync(abs)) - } catch (er) { - this._readdirError(abs, er) - return null - } -} - -GlobSync.prototype._readdirEntries = function (abs, entries) { - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - - // mark and cache dir-ness - return entries -} - -GlobSync.prototype._readdirError = function (f, er) { - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - throw error - } - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) - throw er - if (!this.silent) - console.error('glob error', er) - break - } -} - -GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { - - var entries = this._readdir(abs, inGlobStar) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false) - - var len = entries.length - var isSym = this.symlinks[abs] - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true) - } -} - -GlobSync.prototype._processSimple = function (prefix, index) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var exists = this._stat(prefix) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) -} - -// Returns either 'DIR', 'FILE', or false -GlobSync.prototype._stat = function (f) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return false - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return c - - if (needDir && c === 'FILE') - return false - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (!stat) { - var lstat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return false - } - } - - if (lstat && lstat.isSymbolicLink()) { - try { - stat = fs.statSync(abs) - } catch (er) { - stat = lstat - } - } else { - stat = lstat - } - } - - this.statCache[abs] = stat - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - - this.cache[abs] = this.cache[abs] || c - - if (needDir && c === 'FILE') - return false - - return c -} - -GlobSync.prototype._mark = function (p) { - return common.mark(this, p) -} - -GlobSync.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} diff --git a/node_modules/graceful-fs/LICENSE b/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 9d2c80369..000000000 --- a/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter, Ben Noordhuis, and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/graceful-fs/README.md b/node_modules/graceful-fs/README.md deleted file mode 100644 index 5273a50ad..000000000 --- a/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,133 +0,0 @@ -# graceful-fs - -graceful-fs functions as a drop-in replacement for the fs module, -making various improvements. - -The improvements are meant to normalize behavior across different -platforms and environments, and to make filesystem access more -resilient to errors. - -## Improvements over [fs module](https://nodejs.org/api/fs.html) - -* Queues up `open` and `readdir` calls, and retries them once - something closes if there is an EMFILE error from too many file - descriptors. -* fixes `lchmod` for Node versions prior to 0.6.2. -* implements `fs.lutimes` if possible. Otherwise it becomes a noop. -* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or - `lchown` if the user isn't root. -* makes `lchmod` and `lchown` become noops, if not available. -* retries reading a file if `read` results in EAGAIN error. - -On Windows, it retries renaming a file for up to one second if `EACCESS` -or `EPERM` error occurs, likely because antivirus software has locked -the directory. - -## USAGE - -```javascript -// use just like fs -var fs = require('graceful-fs') - -// now go and do stuff with it... -fs.readFileSync('some-file-or-whatever') -``` - -## Global Patching - -If you want to patch the global fs module (or any other fs-like -module) you can do this: - -```javascript -// Make sure to read the caveat below. -var realFs = require('fs') -var gracefulFs = require('graceful-fs') -gracefulFs.gracefulify(realFs) -``` - -This should only ever be done at the top-level application layer, in -order to delay on EMFILE errors from any fs-using dependencies. You -should **not** do this in a library, because it can cause unexpected -delays in other parts of the program. - -## Changes - -This module is fairly stable at this point, and used by a lot of -things. That being said, because it implements a subtle behavior -change in a core part of the node API, even modest changes can be -extremely breaking, and the versioning is thus biased towards -bumping the major when in doubt. - -The main change between major versions has been switching between -providing a fully-patched `fs` module vs monkey-patching the node core -builtin, and the approach by which a non-monkey-patched `fs` was -created. - -The goal is to trade `EMFILE` errors for slower fs operations. So, if -you try to open a zillion files, rather than crashing, `open` -operations will be queued up and wait for something else to `close`. - -There are advantages to each approach. Monkey-patching the fs means -that no `EMFILE` errors can possibly occur anywhere in your -application, because everything is using the same core `fs` module, -which is patched. However, it can also obviously cause undesirable -side-effects, especially if the module is loaded multiple times. - -Implementing a separate-but-identical patched `fs` module is more -surgical (and doesn't run the risk of patching multiple times), but -also imposes the challenge of keeping in sync with the core module. - -The current approach loads the `fs` module, and then creates a -lookalike object that has all the same methods, except a few that are -patched. It is safe to use in all versions of Node from 0.8 through -7.0. - -### v4 - -* Do not monkey-patch the fs module. This module may now be used as a - drop-in dep, and users can opt into monkey-patching the fs builtin - if their app requires it. - -### v3 - -* Monkey-patch fs, because the eval approach no longer works on recent - node. -* fixed possible type-error throw if rename fails on windows -* verify that we *never* get EMFILE errors -* Ignore ENOSYS from chmod/chown -* clarify that graceful-fs must be used as a drop-in - -### v2.1.0 - -* Use eval rather than monkey-patching fs. -* readdir: Always sort the results -* win32: requeue a file if error has an OK status - -### v2.0 - -* A return to monkey patching -* wrap process.cwd - -### v1.1 - -* wrap readFile -* Wrap fs.writeFile. -* readdir protection -* Don't clobber the fs builtin -* Handle fs.read EAGAIN errors by trying again -* Expose the curOpen counter -* No-op lchown/lchmod if not implemented -* fs.rename patch only for win32 -* Patch fs.rename to handle AV software on Windows -* Close #4 Chown should not fail on einval or eperm if non-root -* Fix isaacs/fstream#1 Only wrap fs one time -* Fix #3 Start at 1024 max files, then back off on EMFILE -* lutimes that doens't blow up on Linux -* A full on-rewrite using a queue instead of just swallowing the EMFILE error -* Wrap Read/Write streams as well - -### 1.0 - -* Update engines for node 0.6 -* Be lstat-graceful on Windows -* first diff --git a/node_modules/graceful-fs/fs.js b/node_modules/graceful-fs/fs.js deleted file mode 100644 index 8ad4a3839..000000000 --- a/node_modules/graceful-fs/fs.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict' - -var fs = require('fs') - -module.exports = clone(fs) - -function clone (obj) { - if (obj === null || typeof obj !== 'object') - return obj - - if (obj instanceof Object) - var copy = { __proto__: obj.__proto__ } - else - var copy = Object.create(null) - - Object.getOwnPropertyNames(obj).forEach(function (key) { - Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) - }) - - return copy -} diff --git a/node_modules/graceful-fs/graceful-fs.js b/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index 33b30d2e9..000000000 --- a/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,262 +0,0 @@ -var fs = require('fs') -var polyfills = require('./polyfills.js') -var legacy = require('./legacy-streams.js') -var queue = [] - -var util = require('util') - -function noop () {} - -var debug = noop -if (util.debuglog) - debug = util.debuglog('gfs4') -else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) - debug = function() { - var m = util.format.apply(util, arguments) - m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') - console.error(m) - } - -if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { - process.on('exit', function() { - debug(queue) - require('assert').equal(queue.length, 0) - }) -} - -module.exports = patch(require('./fs.js')) -if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) { - module.exports = patch(fs) -} - -// Always patch fs.close/closeSync, because we want to -// retry() whenever a close happens *anywhere* in the program. -// This is essential when multiple graceful-fs instances are -// in play at the same time. -module.exports.close = -fs.close = (function (fs$close) { return function (fd, cb) { - return fs$close.call(fs, fd, function (err) { - if (!err) - retry() - - if (typeof cb === 'function') - cb.apply(this, arguments) - }) -}})(fs.close) - -module.exports.closeSync = -fs.closeSync = (function (fs$closeSync) { return function (fd) { - // Note that graceful-fs also retries when fs.closeSync() fails. - // Looks like a bug to me, although it's probably a harmless one. - var rval = fs$closeSync.apply(fs, arguments) - retry() - return rval -}})(fs.closeSync) - -function patch (fs) { - // Everything that references the open() function needs to be in here - polyfills(fs) - fs.gracefulify = patch - fs.FileReadStream = ReadStream; // Legacy name. - fs.FileWriteStream = WriteStream; // Legacy name. - fs.createReadStream = createReadStream - fs.createWriteStream = createWriteStream - var fs$readFile = fs.readFile - fs.readFile = readFile - function readFile (path, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$readFile(path, options, cb) - - function go$readFile (path, options, cb) { - return fs$readFile(path, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$readFile, [path, options, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - var fs$writeFile = fs.writeFile - fs.writeFile = writeFile - function writeFile (path, data, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$writeFile(path, data, options, cb) - - function go$writeFile (path, data, options, cb) { - return fs$writeFile(path, data, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$writeFile, [path, data, options, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - var fs$appendFile = fs.appendFile - if (fs$appendFile) - fs.appendFile = appendFile - function appendFile (path, data, options, cb) { - if (typeof options === 'function') - cb = options, options = null - - return go$appendFile(path, data, options, cb) - - function go$appendFile (path, data, options, cb) { - return fs$appendFile(path, data, options, function (err) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$appendFile, [path, data, options, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - var fs$readdir = fs.readdir - fs.readdir = readdir - function readdir (path, options, cb) { - var args = [path] - if (typeof options !== 'function') { - args.push(options) - } else { - cb = options - } - args.push(go$readdir$cb) - - return go$readdir(args) - - function go$readdir$cb (err, files) { - if (files && files.sort) - files.sort() - - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$readdir, [args]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - } - } - - function go$readdir (args) { - return fs$readdir.apply(fs, args) - } - - if (process.version.substr(0, 4) === 'v0.8') { - var legStreams = legacy(fs) - ReadStream = legStreams.ReadStream - WriteStream = legStreams.WriteStream - } - - var fs$ReadStream = fs.ReadStream - ReadStream.prototype = Object.create(fs$ReadStream.prototype) - ReadStream.prototype.open = ReadStream$open - - var fs$WriteStream = fs.WriteStream - WriteStream.prototype = Object.create(fs$WriteStream.prototype) - WriteStream.prototype.open = WriteStream$open - - fs.ReadStream = ReadStream - fs.WriteStream = WriteStream - - function ReadStream (path, options) { - if (this instanceof ReadStream) - return fs$ReadStream.apply(this, arguments), this - else - return ReadStream.apply(Object.create(ReadStream.prototype), arguments) - } - - function ReadStream$open () { - var that = this - open(that.path, that.flags, that.mode, function (err, fd) { - if (err) { - if (that.autoClose) - that.destroy() - - that.emit('error', err) - } else { - that.fd = fd - that.emit('open', fd) - that.read() - } - }) - } - - function WriteStream (path, options) { - if (this instanceof WriteStream) - return fs$WriteStream.apply(this, arguments), this - else - return WriteStream.apply(Object.create(WriteStream.prototype), arguments) - } - - function WriteStream$open () { - var that = this - open(that.path, that.flags, that.mode, function (err, fd) { - if (err) { - that.destroy() - that.emit('error', err) - } else { - that.fd = fd - that.emit('open', fd) - } - }) - } - - function createReadStream (path, options) { - return new ReadStream(path, options) - } - - function createWriteStream (path, options) { - return new WriteStream(path, options) - } - - var fs$open = fs.open - fs.open = open - function open (path, flags, mode, cb) { - if (typeof mode === 'function') - cb = mode, mode = null - - return go$open(path, flags, mode, cb) - - function go$open (path, flags, mode, cb) { - return fs$open(path, flags, mode, function (err, fd) { - if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$open, [path, flags, mode, cb]]) - else { - if (typeof cb === 'function') - cb.apply(this, arguments) - retry() - } - }) - } - } - - return fs -} - -function enqueue (elem) { - debug('ENQUEUE', elem[0].name, elem[1]) - queue.push(elem) -} - -function retry () { - var elem = queue.shift() - if (elem) { - debug('RETRY', elem[0].name, elem[1]) - elem[0].apply(null, elem[1]) - } -} diff --git a/node_modules/graceful-fs/legacy-streams.js b/node_modules/graceful-fs/legacy-streams.js deleted file mode 100644 index d617b50fc..000000000 --- a/node_modules/graceful-fs/legacy-streams.js +++ /dev/null @@ -1,118 +0,0 @@ -var Stream = require('stream').Stream - -module.exports = legacy - -function legacy (fs) { - return { - ReadStream: ReadStream, - WriteStream: WriteStream - } - - function ReadStream (path, options) { - if (!(this instanceof ReadStream)) return new ReadStream(path, options); - - Stream.call(this); - - var self = this; - - this.path = path; - this.fd = null; - this.readable = true; - this.paused = false; - - this.flags = 'r'; - this.mode = 438; /*=0666*/ - this.bufferSize = 64 * 1024; - - options = options || {}; - - // Mixin options into this - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } - - if (this.encoding) this.setEncoding(this.encoding); - - if (this.start !== undefined) { - if ('number' !== typeof this.start) { - throw TypeError('start must be a Number'); - } - if (this.end === undefined) { - this.end = Infinity; - } else if ('number' !== typeof this.end) { - throw TypeError('end must be a Number'); - } - - if (this.start > this.end) { - throw new Error('start must be <= end'); - } - - this.pos = this.start; - } - - if (this.fd !== null) { - process.nextTick(function() { - self._read(); - }); - return; - } - - fs.open(this.path, this.flags, this.mode, function (err, fd) { - if (err) { - self.emit('error', err); - self.readable = false; - return; - } - - self.fd = fd; - self.emit('open', fd); - self._read(); - }) - } - - function WriteStream (path, options) { - if (!(this instanceof WriteStream)) return new WriteStream(path, options); - - Stream.call(this); - - this.path = path; - this.fd = null; - this.writable = true; - - this.flags = 'w'; - this.encoding = 'binary'; - this.mode = 438; /*=0666*/ - this.bytesWritten = 0; - - options = options || {}; - - // Mixin options into this - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } - - if (this.start !== undefined) { - if ('number' !== typeof this.start) { - throw TypeError('start must be a Number'); - } - if (this.start < 0) { - throw new Error('start must be >= zero'); - } - - this.pos = this.start; - } - - this.busy = false; - this._queue = []; - - if (this.fd === null) { - this._open = fs.open; - this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); - this.flush(); - } - } -} diff --git a/node_modules/graceful-fs/package.json b/node_modules/graceful-fs/package.json deleted file mode 100644 index c0f51572a..000000000 --- a/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "_from": "graceful-fs@^4.1.11", - "_id": "graceful-fs@4.1.11", - "_inBundle": false, - "_integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "_location": "/graceful-fs", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "graceful-fs@^4.1.11", - "name": "graceful-fs", - "escapedName": "graceful-fs", - "rawSpec": "^4.1.11", - "saveSpec": null, - "fetchSpec": "^4.1.11" - }, - "_requiredBy": [ - "/readdirp" - ], - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "_shasum": "0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658", - "_spec": "graceful-fs@^4.1.11", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp", - "bugs": { - "url": "https://github.com/isaacs/node-graceful-fs/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "A drop-in replacement for fs, making various improvements.", - "devDependencies": { - "mkdirp": "^0.5.0", - "rimraf": "^2.2.8", - "tap": "^5.4.2" - }, - "directories": { - "test": "test" - }, - "engines": { - "node": ">=0.4.0" - }, - "files": [ - "fs.js", - "graceful-fs.js", - "legacy-streams.js", - "polyfills.js" - ], - "homepage": "https://github.com/isaacs/node-graceful-fs#readme", - "keywords": [ - "fs", - "module", - "reading", - "retry", - "retries", - "queue", - "error", - "errors", - "handling", - "EMFILE", - "EAGAIN", - "EINVAL", - "EPERM", - "EACCESS" - ], - "license": "ISC", - "main": "graceful-fs.js", - "name": "graceful-fs", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/node-graceful-fs.git" - }, - "scripts": { - "test": "node test.js | tap -" - }, - "version": "4.1.11" -} diff --git a/node_modules/graceful-fs/polyfills.js b/node_modules/graceful-fs/polyfills.js deleted file mode 100644 index 4c6aca78a..000000000 --- a/node_modules/graceful-fs/polyfills.js +++ /dev/null @@ -1,330 +0,0 @@ -var fs = require('./fs.js') -var constants = require('constants') - -var origCwd = process.cwd -var cwd = null - -var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform - -process.cwd = function() { - if (!cwd) - cwd = origCwd.call(process) - return cwd -} -try { - process.cwd() -} catch (er) {} - -var chdir = process.chdir -process.chdir = function(d) { - cwd = null - chdir.call(process, d) -} - -module.exports = patch - -function patch (fs) { - // (re-)implement some things that are known busted or missing. - - // lchmod, broken prior to 0.6.2 - // back-port the fix here. - if (constants.hasOwnProperty('O_SYMLINK') && - process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - patchLchmod(fs) - } - - // lutimes implementation, or no-op - if (!fs.lutimes) { - patchLutimes(fs) - } - - // https://github.com/isaacs/node-graceful-fs/issues/4 - // Chown should not fail on einval or eperm if non-root. - // It should not fail on enosys ever, as this just indicates - // that a fs doesn't support the intended operation. - - fs.chown = chownFix(fs.chown) - fs.fchown = chownFix(fs.fchown) - fs.lchown = chownFix(fs.lchown) - - fs.chmod = chmodFix(fs.chmod) - fs.fchmod = chmodFix(fs.fchmod) - fs.lchmod = chmodFix(fs.lchmod) - - fs.chownSync = chownFixSync(fs.chownSync) - fs.fchownSync = chownFixSync(fs.fchownSync) - fs.lchownSync = chownFixSync(fs.lchownSync) - - fs.chmodSync = chmodFixSync(fs.chmodSync) - fs.fchmodSync = chmodFixSync(fs.fchmodSync) - fs.lchmodSync = chmodFixSync(fs.lchmodSync) - - fs.stat = statFix(fs.stat) - fs.fstat = statFix(fs.fstat) - fs.lstat = statFix(fs.lstat) - - fs.statSync = statFixSync(fs.statSync) - fs.fstatSync = statFixSync(fs.fstatSync) - fs.lstatSync = statFixSync(fs.lstatSync) - - // if lchmod/lchown do not exist, then make them no-ops - if (!fs.lchmod) { - fs.lchmod = function (path, mode, cb) { - if (cb) process.nextTick(cb) - } - fs.lchmodSync = function () {} - } - if (!fs.lchown) { - fs.lchown = function (path, uid, gid, cb) { - if (cb) process.nextTick(cb) - } - fs.lchownSync = function () {} - } - - // on Windows, A/V software can lock the directory, causing this - // to fail with an EACCES or EPERM if the directory contains newly - // created files. Try again on failure, for up to 60 seconds. - - // Set the timeout this long because some Windows Anti-Virus, such as Parity - // bit9, may lock files for up to a minute, causing npm package install - // failures. Also, take care to yield the scheduler. Windows scheduling gives - // CPU to a busy looping process, which can cause the program causing the lock - // contention to be starved of CPU by node, so the contention doesn't resolve. - if (platform === "win32") { - fs.rename = (function (fs$rename) { return function (from, to, cb) { - var start = Date.now() - var backoff = 0; - fs$rename(from, to, function CB (er) { - if (er - && (er.code === "EACCES" || er.code === "EPERM") - && Date.now() - start < 60000) { - setTimeout(function() { - fs.stat(to, function (stater, st) { - if (stater && stater.code === "ENOENT") - fs$rename(from, to, CB); - else - cb(er) - }) - }, backoff) - if (backoff < 100) - backoff += 10; - return; - } - if (cb) cb(er) - }) - }})(fs.rename) - } - - // if read() returns EAGAIN, then just try it again. - fs.read = (function (fs$read) { return function (fd, buffer, offset, length, position, callback_) { - var callback - if (callback_ && typeof callback_ === 'function') { - var eagCounter = 0 - callback = function (er, _, __) { - if (er && er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - return fs$read.call(fs, fd, buffer, offset, length, position, callback) - } - callback_.apply(this, arguments) - } - } - return fs$read.call(fs, fd, buffer, offset, length, position, callback) - }})(fs.read) - - fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) { - var eagCounter = 0 - while (true) { - try { - return fs$readSync.call(fs, fd, buffer, offset, length, position) - } catch (er) { - if (er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - continue - } - throw er - } - } - }})(fs.readSync) -} - -function patchLchmod (fs) { - fs.lchmod = function (path, mode, callback) { - fs.open( path - , constants.O_WRONLY | constants.O_SYMLINK - , mode - , function (err, fd) { - if (err) { - if (callback) callback(err) - return - } - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - fs.fchmod(fd, mode, function (err) { - fs.close(fd, function(err2) { - if (callback) callback(err || err2) - }) - }) - }) - } - - fs.lchmodSync = function (path, mode) { - var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) - - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - var threw = true - var ret - try { - ret = fs.fchmodSync(fd, mode) - threw = false - } finally { - if (threw) { - try { - fs.closeSync(fd) - } catch (er) {} - } else { - fs.closeSync(fd) - } - } - return ret - } -} - -function patchLutimes (fs) { - if (constants.hasOwnProperty("O_SYMLINK")) { - fs.lutimes = function (path, at, mt, cb) { - fs.open(path, constants.O_SYMLINK, function (er, fd) { - if (er) { - if (cb) cb(er) - return - } - fs.futimes(fd, at, mt, function (er) { - fs.close(fd, function (er2) { - if (cb) cb(er || er2) - }) - }) - }) - } - - fs.lutimesSync = function (path, at, mt) { - var fd = fs.openSync(path, constants.O_SYMLINK) - var ret - var threw = true - try { - ret = fs.futimesSync(fd, at, mt) - threw = false - } finally { - if (threw) { - try { - fs.closeSync(fd) - } catch (er) {} - } else { - fs.closeSync(fd) - } - } - return ret - } - - } else { - fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } - fs.lutimesSync = function () {} - } -} - -function chmodFix (orig) { - if (!orig) return orig - return function (target, mode, cb) { - return orig.call(fs, target, mode, function (er) { - if (chownErOk(er)) er = null - if (cb) cb.apply(this, arguments) - }) - } -} - -function chmodFixSync (orig) { - if (!orig) return orig - return function (target, mode) { - try { - return orig.call(fs, target, mode) - } catch (er) { - if (!chownErOk(er)) throw er - } - } -} - - -function chownFix (orig) { - if (!orig) return orig - return function (target, uid, gid, cb) { - return orig.call(fs, target, uid, gid, function (er) { - if (chownErOk(er)) er = null - if (cb) cb.apply(this, arguments) - }) - } -} - -function chownFixSync (orig) { - if (!orig) return orig - return function (target, uid, gid) { - try { - return orig.call(fs, target, uid, gid) - } catch (er) { - if (!chownErOk(er)) throw er - } - } -} - - -function statFix (orig) { - if (!orig) return orig - // Older versions of Node erroneously returned signed integers for - // uid + gid. - return function (target, cb) { - return orig.call(fs, target, function (er, stats) { - if (!stats) return cb.apply(this, arguments) - if (stats.uid < 0) stats.uid += 0x100000000 - if (stats.gid < 0) stats.gid += 0x100000000 - if (cb) cb.apply(this, arguments) - }) - } -} - -function statFixSync (orig) { - if (!orig) return orig - // Older versions of Node erroneously returned signed integers for - // uid + gid. - return function (target) { - var stats = orig.call(fs, target) - if (stats.uid < 0) stats.uid += 0x100000000 - if (stats.gid < 0) stats.gid += 0x100000000 - return stats; - } -} - -// ENOSYS means that the fs doesn't support the op. Just ignore -// that, because it doesn't matter. -// -// if there's no getuid, or if getuid() is something other -// than 0, and the error is EINVAL or EPERM, then just ignore -// it. -// -// This specific case is a silent failure in cp, install, tar, -// and most other unix tools that manage permissions. -// -// When running as root, or if other types of errors are -// encountered, then it's strict. -function chownErOk (er) { - if (!er) - return true - - if (er.code === "ENOSYS") - return true - - var nonroot = !process.getuid || process.getuid() !== 0 - if (nonroot) { - if (er.code === "EINVAL" || er.code === "EPERM") - return true - } - - return false -} diff --git a/node_modules/has-ansi/cli.js b/node_modules/has-ansi/cli.js deleted file mode 100755 index e0956fcc7..000000000 --- a/node_modules/has-ansi/cli.js +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env node -'use strict'; -var pkg = require('./package.json'); -var hasAnsi = require('./'); -var input = process.argv[2]; - -function stdin(cb) { - var ret = ''; - process.stdin.setEncoding('utf8'); - process.stdin.on('data', function (data) { - ret += data; - }); - process.stdin.on('end', function () { - cb(ret); - }); -} - -function help() { - console.log([ - pkg.description, - '', - 'Usage', - ' $ has-ansi ', - ' $ echo | has-ansi', - '', - 'Exits with code 0 if input has ANSI escape codes and 1 if not' - ].join('\n')); -} - -function init(data) { - process.exit(hasAnsi(data) ? 0 : 1); -} - -if (process.argv.indexOf('--help') !== -1) { - help(); - return; -} - -if (process.argv.indexOf('--version') !== -1) { - console.log(pkg.version); - return; -} - -if (process.stdin.isTTY) { - if (!input) { - help(); - return; - } - - init(input); -} else { - stdin(init); -} diff --git a/node_modules/has-ansi/index.js b/node_modules/has-ansi/index.js deleted file mode 100644 index 98fae0676..000000000 --- a/node_modules/has-ansi/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -var ansiRegex = require('ansi-regex'); -var re = new RegExp(ansiRegex().source); // remove the `g` flag -module.exports = re.test.bind(re); diff --git a/node_modules/has-ansi/package.json b/node_modules/has-ansi/package.json deleted file mode 100644 index 9c84fb851..000000000 --- a/node_modules/has-ansi/package.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "_from": "has-ansi@^0.1.0", - "_id": "has-ansi@0.1.0", - "_inBundle": false, - "_integrity": "sha1-hPJlqujA5qiKEtcCKJS3VoiUxi4=", - "_location": "/has-ansi", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "has-ansi@^0.1.0", - "name": "has-ansi", - "escapedName": "has-ansi", - "rawSpec": "^0.1.0", - "saveSpec": null, - "fetchSpec": "^0.1.0" - }, - "_requiredBy": [ - "/chalk" - ], - "_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz", - "_shasum": "84f265aae8c0e6a88a12d7022894b7568894c62e", - "_spec": "has-ansi@^0.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/chalk", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "bin": { - "has-ansi": "cli.js" - }, - "bugs": { - "url": "https://github.com/sindresorhus/has-ansi/issues" - }, - "bundleDependencies": false, - "dependencies": { - "ansi-regex": "^0.2.0" - }, - "deprecated": false, - "description": "Check if a string has ANSI escape codes", - "devDependencies": { - "mocha": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js", - "cli.js" - ], - "homepage": "https://github.com/sindresorhus/has-ansi#readme", - "keywords": [ - "cli", - "bin", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "string", - "tty", - "escape", - "shell", - "xterm", - "command-line", - "text", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "pattern", - "has" - ], - "license": "MIT", - "name": "has-ansi", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/has-ansi.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "0.1.0" -} diff --git a/node_modules/has-ansi/readme.md b/node_modules/has-ansi/readme.md deleted file mode 100644 index 070221231..000000000 --- a/node_modules/has-ansi/readme.md +++ /dev/null @@ -1,45 +0,0 @@ -# has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi) - -> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -```sh -$ npm install --save has-ansi -``` - - -## Usage - -```js -var hasAnsi = require('has-ansi'); - -hasAnsi('\u001b[4mcake\u001b[0m'); -//=> true - -hasAnsi('cake'); -//=> false -``` - - -## CLI - -```sh -$ npm install --global has-ansi -``` - -``` -$ has-ansi --help - -Usage - $ has-ansi - $ echo | has-ansi - -Exits with code 0 if input has ANSI escape codes and 1 if not -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/has-value/LICENSE b/node_modules/has-value/LICENSE deleted file mode 100644 index d734237bd..000000000 --- a/node_modules/has-value/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/has-value/README.md b/node_modules/has-value/README.md deleted file mode 100644 index f9b428c9a..000000000 --- a/node_modules/has-value/README.md +++ /dev/null @@ -1,149 +0,0 @@ -# has-value [![NPM version](https://img.shields.io/npm/v/has-value.svg?style=flat)](https://www.npmjs.com/package/has-value) [![NPM monthly downloads](https://img.shields.io/npm/dm/has-value.svg?style=flat)](https://npmjs.org/package/has-value) [![NPM total downloads](https://img.shields.io/npm/dt/has-value.svg?style=flat)](https://npmjs.org/package/has-value) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/has-value.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/has-value) - -> Returns true if a value exists, false if empty. Works with deeply nested values using object paths. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save has-value -``` - -**Works for:** - -* booleans -* functions -* numbers -* strings -* nulls -* object -* arrays - -## Usage - -Works with property values (supports object-path notation, like `foo.bar`) or a single value: - -```js -var hasValue = require('has-value'); - -hasValue('foo'); -hasValue({foo: 'bar'}, 'foo'); -hasValue({a: {b: {c: 'foo'}}}, 'a.b.c'); -//=> true - -hasValue(''); -hasValue({foo: ''}, 'foo'); -//=> false - -hasValue(0); -hasValue(1); -hasValue({foo: 0}, 'foo'); -hasValue({foo: 1}, 'foo'); -hasValue({foo: null}, 'foo'); -hasValue({foo: {bar: 'a'}}}, 'foo'); -hasValue({foo: {bar: 'a'}}}, 'foo.bar'); -//=> true - -hasValue({foo: {}}}, 'foo'); -hasValue({foo: {bar: {}}}}, 'foo.bar'); -hasValue({foo: undefined}, 'foo'); -//=> false - -hasValue([]); -hasValue([[]]); -hasValue([[], []]); -hasValue([undefined]); -hasValue({foo: []}, 'foo'); -//=> false - -hasValue([0]); -hasValue([null]); -hasValue(['foo']); -hasValue({foo: ['a']}, 'foo'); -//=> true - -hasValue(function() {}) -hasValue(function(foo) {}) -hasValue({foo: function(foo) {}}, 'foo'); -hasValue({foo: function() {}}, 'foo'); -//=> true - -hasValue(true); -hasValue(false); -hasValue({foo: true}, 'foo'); -hasValue({foo: false}, 'foo'); -//=> true -``` - -## isEmpty - -To do the opposite and test for empty values, do: - -```js -function isEmpty(o) { - return !hasValue.apply(hasValue, arguments); -} -``` - -## Release history - -### v1.0.0 - -* `zero` always returns true -* `array` now recurses, so that an array of empty arrays will return `false` -* `null` now returns true - -## About - -### Related projects - -* [define-property](https://www.npmjs.com/package/define-property): Define a non-enumerable property on an object. | [homepage](https://github.com/jonschlinkert/define-property "Define a non-enumerable property on an object.") -* [get-value](https://www.npmjs.com/package/get-value): Use property paths (`a.b.c`) to get a nested value from an object. | [homepage](https://github.com/jonschlinkert/get-value "Use property paths (`a.b.c`) to get a nested value from an object.") -* [set-value](https://www.npmjs.com/package/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/jonschlinkert/set-value "Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths.") -* [unset-value](https://www.npmjs.com/package/unset-value): Delete nested properties from an object using dot notation. | [homepage](https://github.com/jonschlinkert/unset-value "Delete nested properties from an object using dot notation.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 17 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [rmharrison](https://github.com/rmharrison) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 19, 2017._ \ No newline at end of file diff --git a/node_modules/has-value/index.js b/node_modules/has-value/index.js deleted file mode 100644 index c23749488..000000000 --- a/node_modules/has-value/index.js +++ /dev/null @@ -1,16 +0,0 @@ -/*! - * has-value - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var isObject = require('isobject'); -var hasValues = require('has-values'); -var get = require('get-value'); - -module.exports = function(val, prop) { - return hasValues(isObject(val) && prop ? get(val, prop) : val); -}; diff --git a/node_modules/has-value/node_modules/isobject/LICENSE b/node_modules/has-value/node_modules/isobject/LICENSE deleted file mode 100644 index 943e71d05..000000000 --- a/node_modules/has-value/node_modules/isobject/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert. - -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. \ No newline at end of file diff --git a/node_modules/has-value/node_modules/isobject/README.md b/node_modules/has-value/node_modules/isobject/README.md deleted file mode 100644 index d01feaa40..000000000 --- a/node_modules/has-value/node_modules/isobject/README.md +++ /dev/null @@ -1,122 +0,0 @@ -# isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM monthly downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![NPM total downloads](https://img.shields.io/npm/dt/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/isobject) - -> Returns true if the value is an object and not an array or null. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save isobject -``` - -Install with [yarn](https://yarnpkg.com): - -```sh -$ yarn add isobject -``` - -Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install isobject -``` -Install with [bower](https://bower.io/) - -```sh -$ bower install isobject -``` - -## Usage - -```js -var isObject = require('isobject'); -``` - -**True** - -All of the following return `true`: - -```js -isObject({}); -isObject(Object.create({})); -isObject(Object.create(Object.prototype)); -isObject(Object.create(null)); -isObject({}); -isObject(new Foo); -isObject(/foo/); -``` - -**False** - -All of the following return `false`: - -```js -isObject(); -isObject(function () {}); -isObject(1); -isObject([]); -isObject(undefined); -isObject(null); -``` - -## About - -### Related projects - -* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") -* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") -* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") -* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 29 | [jonschlinkert](https://github.com/jonschlinkert) | -| 4 | [doowb](https://github.com/doowb) | -| 1 | [magnudae](https://github.com/magnudae) | -| 1 | [LeSuisse](https://github.com/LeSuisse) | -| 1 | [tmcw](https://github.com/tmcw) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 30, 2017._ \ No newline at end of file diff --git a/node_modules/has-value/node_modules/isobject/index.d.ts b/node_modules/has-value/node_modules/isobject/index.d.ts deleted file mode 100644 index 55f81c275..000000000 --- a/node_modules/has-value/node_modules/isobject/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export = isObject; - -declare function isObject(val: any): boolean; - -declare namespace isObject {} diff --git a/node_modules/has-value/node_modules/isobject/index.js b/node_modules/has-value/node_modules/isobject/index.js deleted file mode 100644 index 2d59958bf..000000000 --- a/node_modules/has-value/node_modules/isobject/index.js +++ /dev/null @@ -1,12 +0,0 @@ -/*! - * isobject - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -module.exports = function isObject(val) { - return val != null && typeof val === 'object' && Array.isArray(val) === false; -}; diff --git a/node_modules/has-value/node_modules/isobject/package.json b/node_modules/has-value/node_modules/isobject/package.json deleted file mode 100644 index 97db41b40..000000000 --- a/node_modules/has-value/node_modules/isobject/package.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "_from": "isobject@^3.0.0", - "_id": "isobject@3.0.1", - "_inBundle": false, - "_integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "_location": "/has-value/isobject", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "isobject@^3.0.0", - "name": "isobject", - "escapedName": "isobject", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/has-value" - ], - "_resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "_shasum": "4e431e92b11a9731636aa1f9c8d1ccbcfdab78df", - "_spec": "isobject@^3.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/has-value", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/isobject/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "url": "https://github.com/LeSuisse" - }, - { - "name": "Brian Woodward", - "url": "https://twitter.com/doowb" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Magnús Dæhlen", - "url": "https://github.com/magnudae" - }, - { - "name": "Tom MacWright", - "url": "https://macwright.org" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "Returns true if the value is an object and not an array or null.", - "devDependencies": { - "gulp-format-md": "^0.1.9", - "mocha": "^2.4.5" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.d.ts", - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/isobject", - "keywords": [ - "check", - "is", - "is-object", - "isobject", - "kind", - "kind-of", - "kindof", - "native", - "object", - "type", - "typeof", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "isobject", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/isobject.git" - }, - "scripts": { - "test": "mocha" - }, - "types": "index.d.ts", - "verb": { - "related": { - "list": [ - "extend-shallow", - "is-plain-object", - "kind-of", - "merge-deep" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "verb" - ] - }, - "version": "3.0.1" -} diff --git a/node_modules/has-value/package.json b/node_modules/has-value/package.json deleted file mode 100644 index 88b815fc8..000000000 --- a/node_modules/has-value/package.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "_from": "has-value@^1.0.0", - "_id": "has-value@1.0.0", - "_inBundle": false, - "_integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "_location": "/has-value", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "has-value@^1.0.0", - "name": "has-value", - "escapedName": "has-value", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/cache-base" - ], - "_resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "_shasum": "18b281da585b1c5c51def24c930ed29a0be6b177", - "_spec": "has-value@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/cache-base", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/has-value/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Ryan M Harrison", - "url": "https://linkedin.com/in/harrisonrm" - } - ], - "dependencies": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - }, - "deprecated": false, - "description": "Returns true if a value exists, false if empty. Works with deeply nested values using object paths.", - "devDependencies": { - "gulp-format-md": "^0.1.12", - "mocha": "^3.4.1" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/has-value", - "keywords": [ - "array", - "boolean", - "empty", - "find", - "function", - "has", - "hasOwn", - "javascript", - "js", - "key", - "keys", - "node.js", - "null", - "number", - "object", - "properties", - "property", - "string", - "type", - "util", - "utilities", - "utility", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "has-value", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/has-value.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "run": true, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "define-property", - "get-value", - "set-value", - "unset-value" - ] - }, - "reflinks": [], - "lint": { - "reflinks": true - } - }, - "version": "1.0.0" -} diff --git a/node_modules/has-values/LICENSE b/node_modules/has-values/LICENSE deleted file mode 100644 index d734237bd..000000000 --- a/node_modules/has-values/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/has-values/README.md b/node_modules/has-values/README.md deleted file mode 100644 index 98d4367af..000000000 --- a/node_modules/has-values/README.md +++ /dev/null @@ -1,129 +0,0 @@ -# has-values [![NPM version](https://img.shields.io/npm/v/has-values.svg?style=flat)](https://www.npmjs.com/package/has-values) [![NPM monthly downloads](https://img.shields.io/npm/dm/has-values.svg?style=flat)](https://npmjs.org/package/has-values) [![NPM total downloads](https://img.shields.io/npm/dt/has-values.svg?style=flat)](https://npmjs.org/package/has-values) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/has-values.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/has-values) - -> Returns true if any values exist, false if empty. Works for booleans, functions, numbers, strings, nulls, objects and arrays. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save has-values -``` - -## Usage - -```js -var hasValue = require('has-values'); - -hasValue('a'); -//=> true - -hasValue(''); -//=> false - -hasValue(1); -//=> true - -hasValue(0); -//=> false - -hasValue({a: 'a'}}); -//=> true - -hasValue({}); -hasValue({foo: undefined}); -//=> false - -hasValue({foo: null}); -//=> true - -hasValue(['a']); -//=> true - -hasValue([]); -hasValue([[], []]); -hasValue([[[]]]); -//=> false - -hasValue(['foo']); -hasValue([0]); -//=> true - -hasValue(function(foo) {}); -//=> true - -hasValue(function() {}); -//=> true - -hasValue(true); -//=> true - -hasValue(false); -//=> true -``` - -## isEmpty - -To test for empty values, do: - -```js -function isEmpty(o, isZero) { - return !hasValue(o, isZero); -} -``` - -## Release history - -### v1.0.0 - -* `zero` always returns true -* `array` now recurses, so that an array of empty arrays will return `false` -* `null` now returns true - -## About - -### Related projects - -* [has-value](https://www.npmjs.com/package/has-value): Returns true if a value exists, false if empty. Works with deeply nested values using… [more](https://github.com/jonschlinkert/has-value) | [homepage](https://github.com/jonschlinkert/has-value "Returns true if a value exists, false if empty. Works with deeply nested values using object paths.") -* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") -* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") -* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") -* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 19, 2017._ \ No newline at end of file diff --git a/node_modules/has-values/index.js b/node_modules/has-values/index.js deleted file mode 100644 index 9bebb9fcb..000000000 --- a/node_modules/has-values/index.js +++ /dev/null @@ -1,60 +0,0 @@ -/*! - * has-values - * - * Copyright (c) 2014-2015, 2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var typeOf = require('kind-of'); -var isNumber = require('is-number'); - -module.exports = function hasValue(val) { - // is-number checks for NaN and other edge cases - if (isNumber(val)) { - return true; - } - - switch (typeOf(val)) { - case 'null': - case 'boolean': - case 'function': - return true; - case 'string': - case 'arguments': - return val.length !== 0; - case 'error': - return val.message !== ''; - case 'array': - var len = val.length; - if (len === 0) { - return false; - } - for (var i = 0; i < len; i++) { - if (hasValue(val[i])) { - return true; - } - } - return false; - case 'file': - case 'map': - case 'set': - return val.size !== 0; - case 'object': - var keys = Object.keys(val); - if (keys.length === 0) { - return false; - } - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (hasValue(val[key])) { - return true; - } - } - return false; - default: { - return false; - } - } -}; diff --git a/node_modules/has-values/node_modules/is-number/LICENSE b/node_modules/has-values/node_modules/is-number/LICENSE deleted file mode 100644 index 842218cf0..000000000 --- a/node_modules/has-values/node_modules/is-number/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2016, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/has-values/node_modules/is-number/README.md b/node_modules/has-values/node_modules/is-number/README.md deleted file mode 100644 index 281165dce..000000000 --- a/node_modules/has-values/node_modules/is-number/README.md +++ /dev/null @@ -1,115 +0,0 @@ -# is-number [![NPM version](https://img.shields.io/npm/v/is-number.svg?style=flat)](https://www.npmjs.com/package/is-number) [![NPM downloads](https://img.shields.io/npm/dm/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-number.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-number) - -> Returns true if the value is a number. comprehensive tests. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save is-number -``` - -## Usage - -To understand some of the rationale behind the decisions made in this library (and to learn about some oddities of number evaluation in JavaScript), [see this gist](https://gist.github.com/jonschlinkert/e30c70c713da325d0e81). - -```js -var isNumber = require('is-number'); -``` - -### true - -See the [tests](./test.js) for more examples. - -```js -isNumber(5e3) //=> 'true' -isNumber(0xff) //=> 'true' -isNumber(-1.1) //=> 'true' -isNumber(0) //=> 'true' -isNumber(1) //=> 'true' -isNumber(1.1) //=> 'true' -isNumber(10) //=> 'true' -isNumber(10.10) //=> 'true' -isNumber(100) //=> 'true' -isNumber('-1.1') //=> 'true' -isNumber('0') //=> 'true' -isNumber('012') //=> 'true' -isNumber('0xff') //=> 'true' -isNumber('1') //=> 'true' -isNumber('1.1') //=> 'true' -isNumber('10') //=> 'true' -isNumber('10.10') //=> 'true' -isNumber('100') //=> 'true' -isNumber('5e3') //=> 'true' -isNumber(parseInt('012')) //=> 'true' -isNumber(parseFloat('012')) //=> 'true' -``` - -### False - -See the [tests](./test.js) for more examples. - -```js -isNumber('foo') //=> 'false' -isNumber([1]) //=> 'false' -isNumber([]) //=> 'false' -isNumber(function () {}) //=> 'false' -isNumber(Infinity) //=> 'false' -isNumber(NaN) //=> 'false' -isNumber(new Array('abc')) //=> 'false' -isNumber(new Array(2)) //=> 'false' -isNumber(new Buffer('abc')) //=> 'false' -isNumber(null) //=> 'false' -isNumber(undefined) //=> 'false' -isNumber({abc: 'abc'}) //=> 'false' -``` - -## About - -### Related projects - -* [even](https://www.npmjs.com/package/even): Get the even numbered items from an array. | [homepage](https://github.com/jonschlinkert/even "Get the even numbered items from an array.") -* [is-even](https://www.npmjs.com/package/is-even): Return true if the given number is even. | [homepage](https://github.com/jonschlinkert/is-even "Return true if the given number is even.") -* [is-odd](https://www.npmjs.com/package/is-odd): Returns true if the given number is odd. | [homepage](https://github.com/jonschlinkert/is-odd "Returns true if the given number is odd.") -* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") -* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") -* [odd](https://www.npmjs.com/package/odd): Get the odd numbered items from an array. | [homepage](https://github.com/jonschlinkert/odd "Get the odd numbered items from an array.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Building docs - -_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ - -To generate the readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install -g verb verb-generate-readme && verb -``` - -### Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -### License - -Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/is-number/blob/master/LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.30, on September 10, 2016._ \ No newline at end of file diff --git a/node_modules/has-values/node_modules/is-number/index.js b/node_modules/has-values/node_modules/is-number/index.js deleted file mode 100644 index 7a2a45bed..000000000 --- a/node_modules/has-values/node_modules/is-number/index.js +++ /dev/null @@ -1,22 +0,0 @@ -/*! - * is-number - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var typeOf = require('kind-of'); - -module.exports = function isNumber(num) { - var type = typeOf(num); - - if (type === 'string') { - if (!num.trim()) return false; - } else if (type !== 'number') { - return false; - } - - return (num - num + 1) >= 0; -}; diff --git a/node_modules/has-values/node_modules/is-number/node_modules/kind-of/LICENSE b/node_modules/has-values/node_modules/is-number/node_modules/kind-of/LICENSE deleted file mode 100644 index d734237bd..000000000 --- a/node_modules/has-values/node_modules/is-number/node_modules/kind-of/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/has-values/node_modules/is-number/node_modules/kind-of/README.md b/node_modules/has-values/node_modules/is-number/node_modules/kind-of/README.md deleted file mode 100644 index 6a9df36d3..000000000 --- a/node_modules/has-values/node_modules/is-number/node_modules/kind-of/README.md +++ /dev/null @@ -1,261 +0,0 @@ -# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) - -> Get the native type of a value. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save kind-of -``` - -## Install - -Install with [bower](https://bower.io/) - -```sh -$ bower install kind-of --save -``` - -## Usage - -> es5, browser and es6 ready - -```js -var kindOf = require('kind-of'); - -kindOf(undefined); -//=> 'undefined' - -kindOf(null); -//=> 'null' - -kindOf(true); -//=> 'boolean' - -kindOf(false); -//=> 'boolean' - -kindOf(new Boolean(true)); -//=> 'boolean' - -kindOf(new Buffer('')); -//=> 'buffer' - -kindOf(42); -//=> 'number' - -kindOf(new Number(42)); -//=> 'number' - -kindOf('str'); -//=> 'string' - -kindOf(new String('str')); -//=> 'string' - -kindOf(arguments); -//=> 'arguments' - -kindOf({}); -//=> 'object' - -kindOf(Object.create(null)); -//=> 'object' - -kindOf(new Test()); -//=> 'object' - -kindOf(new Date()); -//=> 'date' - -kindOf([]); -//=> 'array' - -kindOf([1, 2, 3]); -//=> 'array' - -kindOf(new Array()); -//=> 'array' - -kindOf(/foo/); -//=> 'regexp' - -kindOf(new RegExp('foo')); -//=> 'regexp' - -kindOf(function () {}); -//=> 'function' - -kindOf(function * () {}); -//=> 'function' - -kindOf(new Function()); -//=> 'function' - -kindOf(new Map()); -//=> 'map' - -kindOf(new WeakMap()); -//=> 'weakmap' - -kindOf(new Set()); -//=> 'set' - -kindOf(new WeakSet()); -//=> 'weakset' - -kindOf(Symbol('str')); -//=> 'symbol' - -kindOf(new Int8Array()); -//=> 'int8array' - -kindOf(new Uint8Array()); -//=> 'uint8array' - -kindOf(new Uint8ClampedArray()); -//=> 'uint8clampedarray' - -kindOf(new Int16Array()); -//=> 'int16array' - -kindOf(new Uint16Array()); -//=> 'uint16array' - -kindOf(new Int32Array()); -//=> 'int32array' - -kindOf(new Uint32Array()); -//=> 'uint32array' - -kindOf(new Float32Array()); -//=> 'float32array' - -kindOf(new Float64Array()); -//=> 'float64array' -``` - -## Benchmarks - -Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). -Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `WeakSet`. - -```bash -#1: array - current x 23,329,397 ops/sec ±0.82% (94 runs sampled) - lib-type-of x 4,170,273 ops/sec ±0.55% (94 runs sampled) - lib-typeof x 9,686,935 ops/sec ±0.59% (98 runs sampled) - -#2: boolean - current x 27,197,115 ops/sec ±0.85% (94 runs sampled) - lib-type-of x 3,145,791 ops/sec ±0.73% (97 runs sampled) - lib-typeof x 9,199,562 ops/sec ±0.44% (99 runs sampled) - -#3: date - current x 20,190,117 ops/sec ±0.86% (92 runs sampled) - lib-type-of x 5,166,970 ops/sec ±0.74% (94 runs sampled) - lib-typeof x 9,610,821 ops/sec ±0.50% (96 runs sampled) - -#4: function - current x 23,855,460 ops/sec ±0.60% (97 runs sampled) - lib-type-of x 5,667,740 ops/sec ±0.54% (100 runs sampled) - lib-typeof x 10,010,644 ops/sec ±0.44% (100 runs sampled) - -#5: null - current x 27,061,047 ops/sec ±0.97% (96 runs sampled) - lib-type-of x 13,965,573 ops/sec ±0.62% (97 runs sampled) - lib-typeof x 8,460,194 ops/sec ±0.61% (97 runs sampled) - -#6: number - current x 25,075,682 ops/sec ±0.53% (99 runs sampled) - lib-type-of x 2,266,405 ops/sec ±0.41% (98 runs sampled) - lib-typeof x 9,821,481 ops/sec ±0.45% (99 runs sampled) - -#7: object - current x 3,348,980 ops/sec ±0.49% (99 runs sampled) - lib-type-of x 3,245,138 ops/sec ±0.60% (94 runs sampled) - lib-typeof x 9,262,952 ops/sec ±0.59% (99 runs sampled) - -#8: regex - current x 21,284,827 ops/sec ±0.72% (96 runs sampled) - lib-type-of x 4,689,241 ops/sec ±0.43% (100 runs sampled) - lib-typeof x 8,957,593 ops/sec ±0.62% (98 runs sampled) - -#9: string - current x 25,379,234 ops/sec ±0.58% (96 runs sampled) - lib-type-of x 3,635,148 ops/sec ±0.76% (93 runs sampled) - lib-typeof x 9,494,134 ops/sec ±0.49% (98 runs sampled) - -#10: undef - current x 27,459,221 ops/sec ±1.01% (93 runs sampled) - lib-type-of x 14,360,433 ops/sec ±0.52% (99 runs sampled) - lib-typeof x 23,202,868 ops/sec ±0.59% (94 runs sampled) - -``` - -## Optimizations - -In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: - -1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. -2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. -3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` - -## About - -### Related projects - -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") -* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") -* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 59 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [miguelmota](https://github.com/miguelmota) | -| 1 | [dtothefp](https://github.com/dtothefp) | -| 1 | [ksheedlo](https://github.com/ksheedlo) | -| 1 | [pdehaan](https://github.com/pdehaan) | -| 1 | [laggingreflex](https://github.com/laggingreflex) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 16, 2017._ \ No newline at end of file diff --git a/node_modules/has-values/node_modules/is-number/node_modules/kind-of/index.js b/node_modules/has-values/node_modules/is-number/node_modules/kind-of/index.js deleted file mode 100644 index b52c2917f..000000000 --- a/node_modules/has-values/node_modules/is-number/node_modules/kind-of/index.js +++ /dev/null @@ -1,116 +0,0 @@ -var isBuffer = require('is-buffer'); -var toString = Object.prototype.toString; - -/** - * Get the native `typeof` a value. - * - * @param {*} `val` - * @return {*} Native javascript type - */ - -module.exports = function kindOf(val) { - // primitivies - if (typeof val === 'undefined') { - return 'undefined'; - } - if (val === null) { - return 'null'; - } - if (val === true || val === false || val instanceof Boolean) { - return 'boolean'; - } - if (typeof val === 'string' || val instanceof String) { - return 'string'; - } - if (typeof val === 'number' || val instanceof Number) { - return 'number'; - } - - // functions - if (typeof val === 'function' || val instanceof Function) { - return 'function'; - } - - // array - if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { - return 'array'; - } - - // check for instances of RegExp and Date before calling `toString` - if (val instanceof RegExp) { - return 'regexp'; - } - if (val instanceof Date) { - return 'date'; - } - - // other objects - var type = toString.call(val); - - if (type === '[object RegExp]') { - return 'regexp'; - } - if (type === '[object Date]') { - return 'date'; - } - if (type === '[object Arguments]') { - return 'arguments'; - } - if (type === '[object Error]') { - return 'error'; - } - - // buffer - if (isBuffer(val)) { - return 'buffer'; - } - - // es6: Map, WeakMap, Set, WeakSet - if (type === '[object Set]') { - return 'set'; - } - if (type === '[object WeakSet]') { - return 'weakset'; - } - if (type === '[object Map]') { - return 'map'; - } - if (type === '[object WeakMap]') { - return 'weakmap'; - } - if (type === '[object Symbol]') { - return 'symbol'; - } - - // typed arrays - if (type === '[object Int8Array]') { - return 'int8array'; - } - if (type === '[object Uint8Array]') { - return 'uint8array'; - } - if (type === '[object Uint8ClampedArray]') { - return 'uint8clampedarray'; - } - if (type === '[object Int16Array]') { - return 'int16array'; - } - if (type === '[object Uint16Array]') { - return 'uint16array'; - } - if (type === '[object Int32Array]') { - return 'int32array'; - } - if (type === '[object Uint32Array]') { - return 'uint32array'; - } - if (type === '[object Float32Array]') { - return 'float32array'; - } - if (type === '[object Float64Array]') { - return 'float64array'; - } - - // must be a plain object - return 'object'; -}; diff --git a/node_modules/has-values/node_modules/is-number/node_modules/kind-of/package.json b/node_modules/has-values/node_modules/is-number/node_modules/kind-of/package.json deleted file mode 100644 index d6a392d69..000000000 --- a/node_modules/has-values/node_modules/is-number/node_modules/kind-of/package.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "_from": "kind-of@^3.0.2", - "_id": "kind-of@3.2.2", - "_inBundle": false, - "_integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "_location": "/has-values/is-number/kind-of", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "kind-of@^3.0.2", - "name": "kind-of", - "escapedName": "kind-of", - "rawSpec": "^3.0.2", - "saveSpec": null, - "fetchSpec": "^3.0.2" - }, - "_requiredBy": [ - "/has-values/is-number" - ], - "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "_shasum": "31ea21a734bab9bbb0f32466d893aea51e4a3c64", - "_spec": "kind-of@^3.0.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/has-values/node_modules/is-number", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/kind-of/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "David Fox-Powell", - "url": "https://dtothefp.github.io/me" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Ken Sheedlo", - "url": "kensheedlo.com" - }, - { - "name": "laggingreflex", - "url": "https://github.com/laggingreflex" - }, - { - "name": "Miguel Mota", - "url": "https://miguelmota.com" - }, - { - "name": "Peter deHaan", - "url": "http://about.me/peterdehaan" - } - ], - "dependencies": { - "is-buffer": "^1.1.5" - }, - "deprecated": false, - "description": "Get the native type of a value.", - "devDependencies": { - "ansi-bold": "^0.1.1", - "benchmarked": "^1.0.0", - "browserify": "^14.3.0", - "glob": "^7.1.1", - "gulp-format-md": "^0.1.12", - "mocha": "^3.3.0", - "type-of": "^2.0.1", - "typeof": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/kind-of", - "keywords": [ - "arguments", - "array", - "boolean", - "check", - "date", - "function", - "is", - "is-type", - "is-type-of", - "kind", - "kind-of", - "number", - "object", - "of", - "regexp", - "string", - "test", - "type", - "type-of", - "typeof", - "types" - ], - "license": "MIT", - "main": "index.js", - "name": "kind-of", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/kind-of.git" - }, - "scripts": { - "prepublish": "browserify -o browser.js -e index.js -s index --bare", - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "is-glob", - "is-number", - "is-primitive" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "verb" - ] - }, - "version": "3.2.2" -} diff --git a/node_modules/has-values/node_modules/is-number/package.json b/node_modules/has-values/node_modules/is-number/package.json deleted file mode 100644 index 903acef4b..000000000 --- a/node_modules/has-values/node_modules/is-number/package.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "_from": "is-number@^3.0.0", - "_id": "is-number@3.0.0", - "_inBundle": false, - "_integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "_location": "/has-values/is-number", - "_phantomChildren": { - "is-buffer": "1.1.6" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-number@^3.0.0", - "name": "is-number", - "escapedName": "is-number", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/has-values" - ], - "_resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "_shasum": "24fd6201a4782cf50561c810276afc7d12d71195", - "_spec": "is-number@^3.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/has-values", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-number/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Charlike Mike Reagent", - "url": "http://www.tunnckocore.tk" - }, - { - "name": "Jon Schlinkert", - "email": "jon.schlinkert@sellside.com", - "url": "http://twitter.com/jonschlinkert" - } - ], - "dependencies": { - "kind-of": "^3.0.2" - }, - "deprecated": false, - "description": "Returns true if the value is a number. comprehensive tests.", - "devDependencies": { - "benchmarked": "^0.2.5", - "chalk": "^1.1.3", - "gulp-format-md": "^0.1.10", - "mocha": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-number", - "keywords": [ - "check", - "coerce", - "coercion", - "integer", - "is", - "is-nan", - "is-num", - "is-number", - "istype", - "kind", - "math", - "nan", - "num", - "number", - "numeric", - "test", - "type", - "typeof", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "is-number", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-number.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "even", - "is-even", - "is-odd", - "is-primitive", - "kind-of", - "odd" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "verb", - "verb-generate-readme" - ] - }, - "version": "3.0.0" -} diff --git a/node_modules/has-values/node_modules/kind-of/LICENSE b/node_modules/has-values/node_modules/kind-of/LICENSE deleted file mode 100644 index d734237bd..000000000 --- a/node_modules/has-values/node_modules/kind-of/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/has-values/node_modules/kind-of/README.md b/node_modules/has-values/node_modules/kind-of/README.md deleted file mode 100644 index 83469b0b6..000000000 --- a/node_modules/has-values/node_modules/kind-of/README.md +++ /dev/null @@ -1,267 +0,0 @@ -# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) - -> Get the native type of a value. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save kind-of -``` - -Install with [bower](https://bower.io/) - -```sh -$ bower install kind-of --save -``` - -## Usage - -> es5, browser and es6 ready - -```js -var kindOf = require('kind-of'); - -kindOf(undefined); -//=> 'undefined' - -kindOf(null); -//=> 'null' - -kindOf(true); -//=> 'boolean' - -kindOf(false); -//=> 'boolean' - -kindOf(new Boolean(true)); -//=> 'boolean' - -kindOf(new Buffer('')); -//=> 'buffer' - -kindOf(42); -//=> 'number' - -kindOf(new Number(42)); -//=> 'number' - -kindOf('str'); -//=> 'string' - -kindOf(new String('str')); -//=> 'string' - -kindOf(arguments); -//=> 'arguments' - -kindOf({}); -//=> 'object' - -kindOf(Object.create(null)); -//=> 'object' - -kindOf(new Test()); -//=> 'object' - -kindOf(new Date()); -//=> 'date' - -kindOf([]); -//=> 'array' - -kindOf([1, 2, 3]); -//=> 'array' - -kindOf(new Array()); -//=> 'array' - -kindOf(/foo/); -//=> 'regexp' - -kindOf(new RegExp('foo')); -//=> 'regexp' - -kindOf(function () {}); -//=> 'function' - -kindOf(function * () {}); -//=> 'function' - -kindOf(new Function()); -//=> 'function' - -kindOf(new Map()); -//=> 'map' - -kindOf(new WeakMap()); -//=> 'weakmap' - -kindOf(new Set()); -//=> 'set' - -kindOf(new WeakSet()); -//=> 'weakset' - -kindOf(Symbol('str')); -//=> 'symbol' - -kindOf(new Int8Array()); -//=> 'int8array' - -kindOf(new Uint8Array()); -//=> 'uint8array' - -kindOf(new Uint8ClampedArray()); -//=> 'uint8clampedarray' - -kindOf(new Int16Array()); -//=> 'int16array' - -kindOf(new Uint16Array()); -//=> 'uint16array' - -kindOf(new Int32Array()); -//=> 'int32array' - -kindOf(new Uint32Array()); -//=> 'uint32array' - -kindOf(new Float32Array()); -//=> 'float32array' - -kindOf(new Float64Array()); -//=> 'float64array' -``` - -## Benchmarks - -Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). -Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `WeakSet`. - -```bash -#1: array - current x 23,329,397 ops/sec ±0.82% (94 runs sampled) - lib-type-of x 4,170,273 ops/sec ±0.55% (94 runs sampled) - lib-typeof x 9,686,935 ops/sec ±0.59% (98 runs sampled) - -#2: boolean - current x 27,197,115 ops/sec ±0.85% (94 runs sampled) - lib-type-of x 3,145,791 ops/sec ±0.73% (97 runs sampled) - lib-typeof x 9,199,562 ops/sec ±0.44% (99 runs sampled) - -#3: date - current x 20,190,117 ops/sec ±0.86% (92 runs sampled) - lib-type-of x 5,166,970 ops/sec ±0.74% (94 runs sampled) - lib-typeof x 9,610,821 ops/sec ±0.50% (96 runs sampled) - -#4: function - current x 23,855,460 ops/sec ±0.60% (97 runs sampled) - lib-type-of x 5,667,740 ops/sec ±0.54% (100 runs sampled) - lib-typeof x 10,010,644 ops/sec ±0.44% (100 runs sampled) - -#5: null - current x 27,061,047 ops/sec ±0.97% (96 runs sampled) - lib-type-of x 13,965,573 ops/sec ±0.62% (97 runs sampled) - lib-typeof x 8,460,194 ops/sec ±0.61% (97 runs sampled) - -#6: number - current x 25,075,682 ops/sec ±0.53% (99 runs sampled) - lib-type-of x 2,266,405 ops/sec ±0.41% (98 runs sampled) - lib-typeof x 9,821,481 ops/sec ±0.45% (99 runs sampled) - -#7: object - current x 3,348,980 ops/sec ±0.49% (99 runs sampled) - lib-type-of x 3,245,138 ops/sec ±0.60% (94 runs sampled) - lib-typeof x 9,262,952 ops/sec ±0.59% (99 runs sampled) - -#8: regex - current x 21,284,827 ops/sec ±0.72% (96 runs sampled) - lib-type-of x 4,689,241 ops/sec ±0.43% (100 runs sampled) - lib-typeof x 8,957,593 ops/sec ±0.62% (98 runs sampled) - -#9: string - current x 25,379,234 ops/sec ±0.58% (96 runs sampled) - lib-type-of x 3,635,148 ops/sec ±0.76% (93 runs sampled) - lib-typeof x 9,494,134 ops/sec ±0.49% (98 runs sampled) - -#10: undef - current x 27,459,221 ops/sec ±1.01% (93 runs sampled) - lib-type-of x 14,360,433 ops/sec ±0.52% (99 runs sampled) - lib-typeof x 23,202,868 ops/sec ±0.59% (94 runs sampled) - -``` - -## Release history - -### v4.0.0 - -**Added** - -* `promise` support - -## Optimizations - -In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: - -1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. -2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. -3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` - -## About - -### Related projects - -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") -* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") -* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 64 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [miguelmota](https://github.com/miguelmota) | -| 1 | [dtothefp](https://github.com/dtothefp) | -| 1 | [ksheedlo](https://github.com/ksheedlo) | -| 1 | [pdehaan](https://github.com/pdehaan) | -| 1 | [laggingreflex](https://github.com/laggingreflex) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 19, 2017._ \ No newline at end of file diff --git a/node_modules/has-values/node_modules/kind-of/index.js b/node_modules/has-values/node_modules/kind-of/index.js deleted file mode 100644 index 4c0233bc7..000000000 --- a/node_modules/has-values/node_modules/kind-of/index.js +++ /dev/null @@ -1,119 +0,0 @@ -var isBuffer = require('is-buffer'); -var toString = Object.prototype.toString; - -/** - * Get the native `typeof` a value. - * - * @param {*} `val` - * @return {*} Native javascript type - */ - -module.exports = function kindOf(val) { - // primitivies - if (typeof val === 'undefined') { - return 'undefined'; - } - if (val === null) { - return 'null'; - } - if (val === true || val === false || val instanceof Boolean) { - return 'boolean'; - } - if (typeof val === 'string' || val instanceof String) { - return 'string'; - } - if (typeof val === 'number' || val instanceof Number) { - return 'number'; - } - - // functions - if (typeof val === 'function' || val instanceof Function) { - return 'function'; - } - - // array - if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { - return 'array'; - } - - // check for instances of RegExp and Date before calling `toString` - if (val instanceof RegExp) { - return 'regexp'; - } - if (val instanceof Date) { - return 'date'; - } - - // other objects - var type = toString.call(val); - - if (type === '[object RegExp]') { - return 'regexp'; - } - if (type === '[object Date]') { - return 'date'; - } - if (type === '[object Arguments]') { - return 'arguments'; - } - if (type === '[object Error]') { - return 'error'; - } - if (type === '[object Promise]') { - return 'promise'; - } - - // buffer - if (isBuffer(val)) { - return 'buffer'; - } - - // es6: Map, WeakMap, Set, WeakSet - if (type === '[object Set]') { - return 'set'; - } - if (type === '[object WeakSet]') { - return 'weakset'; - } - if (type === '[object Map]') { - return 'map'; - } - if (type === '[object WeakMap]') { - return 'weakmap'; - } - if (type === '[object Symbol]') { - return 'symbol'; - } - - // typed arrays - if (type === '[object Int8Array]') { - return 'int8array'; - } - if (type === '[object Uint8Array]') { - return 'uint8array'; - } - if (type === '[object Uint8ClampedArray]') { - return 'uint8clampedarray'; - } - if (type === '[object Int16Array]') { - return 'int16array'; - } - if (type === '[object Uint16Array]') { - return 'uint16array'; - } - if (type === '[object Int32Array]') { - return 'int32array'; - } - if (type === '[object Uint32Array]') { - return 'uint32array'; - } - if (type === '[object Float32Array]') { - return 'float32array'; - } - if (type === '[object Float64Array]') { - return 'float64array'; - } - - // must be a plain object - return 'object'; -}; diff --git a/node_modules/has-values/node_modules/kind-of/package.json b/node_modules/has-values/node_modules/kind-of/package.json deleted file mode 100644 index 5393dd8bd..000000000 --- a/node_modules/has-values/node_modules/kind-of/package.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "_from": "kind-of@^4.0.0", - "_id": "kind-of@4.0.0", - "_inBundle": false, - "_integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "_location": "/has-values/kind-of", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "kind-of@^4.0.0", - "name": "kind-of", - "escapedName": "kind-of", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/has-values" - ], - "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "_shasum": "20813df3d712928b207378691a45066fae72dd57", - "_spec": "kind-of@^4.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/has-values", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/kind-of/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "David Fox-Powell", - "url": "https://dtothefp.github.io/me" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Ken Sheedlo", - "url": "kensheedlo.com" - }, - { - "name": "laggingreflex", - "url": "https://github.com/laggingreflex" - }, - { - "name": "Miguel Mota", - "url": "https://miguelmota.com" - }, - { - "name": "Peter deHaan", - "url": "http://about.me/peterdehaan" - } - ], - "dependencies": { - "is-buffer": "^1.1.5" - }, - "deprecated": false, - "description": "Get the native type of a value.", - "devDependencies": { - "ansi-bold": "^0.1.1", - "benchmarked": "^1.1.1", - "browserify": "^14.3.0", - "glob": "^7.1.1", - "gulp-format-md": "^0.1.12", - "mocha": "^3.4.1", - "type-of": "^2.0.1", - "typeof": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/kind-of", - "keywords": [ - "arguments", - "array", - "boolean", - "check", - "date", - "function", - "is", - "is-type", - "is-type-of", - "kind", - "kind-of", - "number", - "object", - "of", - "regexp", - "string", - "test", - "type", - "type-of", - "typeof", - "types" - ], - "license": "MIT", - "main": "index.js", - "name": "kind-of", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/kind-of.git" - }, - "scripts": { - "prepublish": "browserify -o browser.js -e index.js -s index --bare", - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "is-glob", - "is-number", - "is-primitive" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "verb" - ] - }, - "version": "4.0.0" -} diff --git a/node_modules/has-values/package.json b/node_modules/has-values/package.json deleted file mode 100644 index 18bc7a107..000000000 --- a/node_modules/has-values/package.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "_from": "has-values@^1.0.0", - "_id": "has-values@1.0.0", - "_inBundle": false, - "_integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "_location": "/has-values", - "_phantomChildren": { - "is-buffer": "1.1.6" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "has-values@^1.0.0", - "name": "has-values", - "escapedName": "has-values", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/has-value" - ], - "_resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "_shasum": "95b0b63fec2146619a6fe57fe75628d5a39efe4f", - "_spec": "has-values@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/has-value", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/has-values/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "deprecated": false, - "description": "Returns true if any values exist, false if empty. Works for booleans, functions, numbers, strings, nulls, objects and arrays. ", - "devDependencies": { - "gulp-format-md": "^0.1.12", - "mocha": "^3.4.1" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/has-values", - "keywords": [ - "array", - "boolean", - "empty", - "find", - "function", - "has", - "hasOwn", - "javascript", - "js", - "key", - "keys", - "node.js", - "null", - "number", - "object", - "properties", - "property", - "string", - "type", - "util", - "utilities", - "utility", - "value", - "values" - ], - "license": "MIT", - "main": "index.js", - "name": "has-values", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/has-values.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "run": true, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "has-value", - "kind-of", - "is-number", - "is-plain-object", - "isobject" - ] - }, - "reflinks": [ - "verb" - ], - "lint": { - "reflinks": true - } - }, - "version": "1.0.0" -} diff --git a/node_modules/has/LICENSE-MIT b/node_modules/has/LICENSE-MIT deleted file mode 100644 index ae7014d38..000000000 --- a/node_modules/has/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 Thiago de Arruda - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/has/README.md b/node_modules/has/README.md deleted file mode 100644 index 635e3a4ba..000000000 --- a/node_modules/has/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# has - -> Object.prototype.hasOwnProperty.call shortcut - -## Installation - -```sh -npm install --save has -``` - -## Usage - -```js -var has = require('has'); - -has({}, 'hasOwnProperty'); // false -has(Object.prototype, 'hasOwnProperty'); // true -``` diff --git a/node_modules/has/package.json b/node_modules/has/package.json deleted file mode 100644 index b9a370cd8..000000000 --- a/node_modules/has/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "_from": "has@^1.0.0", - "_id": "has@1.0.3", - "_inBundle": false, - "_integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "_location": "/has", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "has@^1.0.0", - "name": "has", - "escapedName": "has", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/browserify" - ], - "_resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "_shasum": "722d7cbfc1f6aa8241f16dd814e011e1f41e8796", - "_spec": "has@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "Thiago de Arruda", - "email": "tpadilha84@gmail.com" - }, - "bugs": { - "url": "https://github.com/tarruda/has/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jordan Harband", - "email": "ljharb@gmail.com", - "url": "http://ljharb.codes" - } - ], - "dependencies": { - "function-bind": "^1.1.1" - }, - "deprecated": false, - "description": "Object.prototype.hasOwnProperty.call shortcut", - "devDependencies": { - "@ljharb/eslint-config": "^12.2.1", - "eslint": "^4.19.1", - "tape": "^4.9.0" - }, - "engines": { - "node": ">= 0.4.0" - }, - "homepage": "https://github.com/tarruda/has", - "license": "MIT", - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/tarruda/has/blob/master/LICENSE-MIT" - } - ], - "main": "./src", - "name": "has", - "repository": { - "type": "git", - "url": "git://github.com/tarruda/has.git" - }, - "scripts": { - "lint": "eslint .", - "pretest": "npm run lint", - "test": "tape test" - }, - "version": "1.0.3" -} diff --git a/node_modules/has/src/index.js b/node_modules/has/src/index.js deleted file mode 100644 index dd92dd909..000000000 --- a/node_modules/has/src/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var bind = require('function-bind'); - -module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); diff --git a/node_modules/has/test/index.js b/node_modules/has/test/index.js deleted file mode 100644 index 43d480b2c..000000000 --- a/node_modules/has/test/index.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -var test = require('tape'); -var has = require('../'); - -test('has', function (t) { - t.equal(has({}, 'hasOwnProperty'), false, 'object literal does not have own property "hasOwnProperty"'); - t.equal(has(Object.prototype, 'hasOwnProperty'), true, 'Object.prototype has own property "hasOwnProperty"'); - t.end(); -}); diff --git a/node_modules/hash-base/LICENSE b/node_modules/hash-base/LICENSE deleted file mode 100644 index 6f02ae800..000000000 --- a/node_modules/hash-base/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Kirill Fomichev - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/hash-base/README.md b/node_modules/hash-base/README.md deleted file mode 100644 index 83ae2edcc..000000000 --- a/node_modules/hash-base/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# hash-base - -[![NPM Package](https://img.shields.io/npm/v/hash-base.svg?style=flat-square)](https://www.npmjs.org/package/hash-base) -[![Build Status](https://img.shields.io/travis/crypto-browserify/hash-base.svg?branch=master&style=flat-square)](https://travis-ci.org/crypto-browserify/hash-base) -[![Dependency status](https://img.shields.io/david/crypto-browserify/hash-base.svg?style=flat-square)](https://david-dm.org/crypto-browserify/hash-base#info=dependencies) - -[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) - -Abstract base class to inherit from if you want to create streams implementing the same API as node crypto [Hash][1] (for [Cipher][2] / [Decipher][3] check [crypto-browserify/cipher-base][4]). - -## Example - -```js -const HashBase = require('hash-base') -const inherits = require('inherits') - -// our hash function is XOR sum of all bytes -function MyHash () { - HashBase.call(this, 1) // in bytes - - this._sum = 0x00 -} - -inherits(MyHash, HashBase) - -MyHash.prototype._update = function () { - for (let i = 0; i < this._block.length; ++i) this._sum ^= this._block[i] -} - -MyHash.prototype._digest = function () { - return this._sum -} - -const data = Buffer.from([ 0x00, 0x42, 0x01 ]) -const hash = new MyHash().update(data).digest() -console.log(hash) // => 67 -``` -You also can check [source code](index.js) or [crypto-browserify/md5.js][5] - -## LICENSE - -MIT - -[1]: https://nodejs.org/api/crypto.html#crypto_class_hash -[2]: https://nodejs.org/api/crypto.html#crypto_class_cipher -[3]: https://nodejs.org/api/crypto.html#crypto_class_decipher -[4]: https://github.com/crypto-browserify/cipher-base -[5]: https://github.com/crypto-browserify/md5.js diff --git a/node_modules/hash-base/index.js b/node_modules/hash-base/index.js deleted file mode 100644 index bf788daa4..000000000 --- a/node_modules/hash-base/index.js +++ /dev/null @@ -1,95 +0,0 @@ -'use strict' -var Buffer = require('safe-buffer').Buffer -var Transform = require('stream').Transform -var inherits = require('inherits') - -function throwIfNotStringOrBuffer (val, prefix) { - if (!Buffer.isBuffer(val) && typeof val !== 'string') { - throw new TypeError(prefix + ' must be a string or a buffer') - } -} - -function HashBase (blockSize) { - Transform.call(this) - - this._block = Buffer.allocUnsafe(blockSize) - this._blockSize = blockSize - this._blockOffset = 0 - this._length = [0, 0, 0, 0] - - this._finalized = false -} - -inherits(HashBase, Transform) - -HashBase.prototype._transform = function (chunk, encoding, callback) { - var error = null - try { - this.update(chunk, encoding) - } catch (err) { - error = err - } - - callback(error) -} - -HashBase.prototype._flush = function (callback) { - var error = null - try { - this.push(this.digest()) - } catch (err) { - error = err - } - - callback(error) -} - -HashBase.prototype.update = function (data, encoding) { - throwIfNotStringOrBuffer(data, 'Data') - if (this._finalized) throw new Error('Digest already called') - if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding) - - // consume data - var block = this._block - var offset = 0 - while (this._blockOffset + data.length - offset >= this._blockSize) { - for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++] - this._update() - this._blockOffset = 0 - } - while (offset < data.length) block[this._blockOffset++] = data[offset++] - - // update length - for (var j = 0, carry = data.length * 8; carry > 0; ++j) { - this._length[j] += carry - carry = (this._length[j] / 0x0100000000) | 0 - if (carry > 0) this._length[j] -= 0x0100000000 * carry - } - - return this -} - -HashBase.prototype._update = function () { - throw new Error('_update is not implemented') -} - -HashBase.prototype.digest = function (encoding) { - if (this._finalized) throw new Error('Digest already called') - this._finalized = true - - var digest = this._digest() - if (encoding !== undefined) digest = digest.toString(encoding) - - // reset state - this._block.fill(0) - this._blockOffset = 0 - for (var i = 0; i < 4; ++i) this._length[i] = 0 - - return digest -} - -HashBase.prototype._digest = function () { - throw new Error('_digest is not implemented') -} - -module.exports = HashBase diff --git a/node_modules/hash-base/package.json b/node_modules/hash-base/package.json deleted file mode 100644 index 7db3851ea..000000000 --- a/node_modules/hash-base/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "_from": "hash-base@^3.0.0", - "_id": "hash-base@3.0.4", - "_inBundle": false, - "_integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", - "_location": "/hash-base", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "hash-base@^3.0.0", - "name": "hash-base", - "escapedName": "hash-base", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/md5.js", - "/ripemd160" - ], - "_resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", - "_shasum": "5fc8686847ecd73499403319a6b0a3f3f6ae4918", - "_spec": "hash-base@^3.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/md5.js", - "author": { - "name": "Kirill Fomichev", - "email": "fanatid@ya.ru", - "url": "https://github.com/fanatid" - }, - "bugs": { - "url": "https://github.com/crypto-browserify/hash-base/issues" - }, - "bundleDependencies": false, - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - }, - "deprecated": false, - "description": "abstract base class for hash-streams", - "devDependencies": { - "nyc": "^8.3.2", - "standard": "*", - "tape": "^4.2.0" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/crypto-browserify/hash-base", - "keywords": [ - "hash", - "stream" - ], - "license": "MIT", - "main": "index.js", - "name": "hash-base", - "repository": { - "type": "git", - "url": "git+https://github.com/crypto-browserify/hash-base.git" - }, - "scripts": { - "coverage": "nyc node test/*.js", - "lint": "standard", - "test": "npm run lint && npm run unit", - "unit": "node test/*.js" - }, - "version": "3.0.4" -} diff --git a/node_modules/hash.js/.eslintrc.js b/node_modules/hash.js/.eslintrc.js deleted file mode 100644 index 614f8fc40..000000000 --- a/node_modules/hash.js/.eslintrc.js +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - 'env': { - 'browser': true, - 'commonjs': true, - 'node': true, - 'es6': true - }, - 'parserOptions': { - 'ecmaVersion': 8 - }, - 'extends': 'eslint:recommended', - 'rules': { - 'indent': [ - 'error', - 2, - { - 'FunctionDeclaration': { - 'parameters': 'first' - }, - 'FunctionExpression': { - 'parameters': 'first' - }, - 'CallExpression': { - 'arguments': 'first' - } - } - ], - 'linebreak-style': [ - 'error', - 'unix' - ], - 'quotes': [ - 'error', - 'single' - ], - 'semi': [ - 'error', - 'always' - ] - } -}; diff --git a/node_modules/hash.js/.travis.yml b/node_modules/hash.js/.travis.yml deleted file mode 100644 index 92b8cdd42..000000000 --- a/node_modules/hash.js/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -sudo: false -language: node_js -node_js: - - "4" - - "6" - - "stable" -branches: - only: - - master diff --git a/node_modules/hash.js/README.md b/node_modules/hash.js/README.md deleted file mode 100644 index 006d3bbf5..000000000 --- a/node_modules/hash.js/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# hash.js [![Build Status](https://secure.travis-ci.org/indutny/hash.js.svg)](http://travis-ci.org/indutny/hash.js) - -Just a bike-shed. - -## Install - -```sh -npm install hash.js -``` - -## Usage - -```js -var hash = require('hash.js') -hash.sha256().update('abc').digest('hex') -``` - -## Selective hash usage - -```js -var sha512 = require('hash.js/lib/hash/sha/512'); -sha512().update('abc').digest('hex'); -``` - -#### LICENSE - -This software is licensed under the MIT License. - -Copyright Fedor Indutny, 2014. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the -following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/hash.js/lib/hash.d.ts b/node_modules/hash.js/lib/hash.d.ts deleted file mode 100644 index abbb5c531..000000000 --- a/node_modules/hash.js/lib/hash.d.ts +++ /dev/null @@ -1,106 +0,0 @@ -declare var hash: Hash; - -declare module "hash.js" { - export = hash; -} - -interface BlockHash { - hmacStrength: number - padLength: number - endian: 'big' | 'little' -} - -interface MessageDigest { - blockSize: number - outSize: number - update(msg: any, enc?: 'hex'): T - digest(): number[] - digest(enc: 'hex'): string -} - -interface Hash { - hmac: HmacConstructor - ripemd: RipemdSet - ripemd160: Ripemd160Constructor - sha: ShaSet - sha1: Sha1Constructor - sha224: Sha224Constructor - sha256: Sha256Constructor - sha384: Sha384Constructor - sha512: Sha512Constructor - utils: Utils -} - -interface Utils { - toArray(msg: any, enc: 'hex'): Array - toHex(msg: any): string -} - -interface RipemdSet { - ripemd160: Ripemd160Constructor -} - -interface ShaSet { - sha1: Sha1Constructor - sha224: Sha224Constructor - sha256: Sha256Constructor - sha384: Sha384Constructor - sha512: Sha512Constructor -} - -interface HmacConstructor { (hash: BlockHash, key: any, enc?: 'hex'): Hmac } -interface Ripemd160Constructor { (): Ripemd160 } -interface Sha1Constructor { (): Sha1; } -interface Sha224Constructor { (): Sha224; } -interface Sha256Constructor { (): Sha256; } -interface Sha384Constructor { (): Sha384; } -interface Sha512Constructor { (): Sha512; } - -interface Hmac extends MessageDigest { - blockSize: 512 - outSize: 160 -} - -interface Ripemd160 extends BlockHash, MessageDigest { - blockSize: 512 - hmacStrength: 192 - outSize: 160 - padLength: 64 - endian: 'little' -} - -interface Sha1 extends BlockHash, MessageDigest { - blockSize: 512 - hmacStrength: 80 - outSize: 160 - padLength: 64 - endian: 'big' -} -interface Sha224 extends BlockHash, MessageDigest { - blockSize: 512 - hmacStrength: 192 - outSize: 224 - padLength: 64 - endian: 'big' -} -interface Sha256 extends BlockHash, MessageDigest { - blockSize: 512 - hmacStrength: 192 - outSize: 256 - padLength: 64 - endian: 'big' -} -interface Sha384 extends BlockHash, MessageDigest { - blockSize: 1024 - hmacStrength: 192 - outSize: 384 - padLength: 128 - endian: 'big' -} -interface Sha512 extends BlockHash, MessageDigest { - blockSize: 1024 - hmacStrength: 192 - outSize: 512 - padLength: 128 - endian: 'big' -} diff --git a/node_modules/hash.js/lib/hash.js b/node_modules/hash.js/lib/hash.js deleted file mode 100644 index f59b67301..000000000 --- a/node_modules/hash.js/lib/hash.js +++ /dev/null @@ -1,15 +0,0 @@ -var hash = exports; - -hash.utils = require('./hash/utils'); -hash.common = require('./hash/common'); -hash.sha = require('./hash/sha'); -hash.ripemd = require('./hash/ripemd'); -hash.hmac = require('./hash/hmac'); - -// Proxy hash functions to the main object -hash.sha1 = hash.sha.sha1; -hash.sha256 = hash.sha.sha256; -hash.sha224 = hash.sha.sha224; -hash.sha384 = hash.sha.sha384; -hash.sha512 = hash.sha.sha512; -hash.ripemd160 = hash.ripemd.ripemd160; diff --git a/node_modules/hash.js/lib/hash/common.js b/node_modules/hash.js/lib/hash/common.js deleted file mode 100644 index c49f47631..000000000 --- a/node_modules/hash.js/lib/hash/common.js +++ /dev/null @@ -1,92 +0,0 @@ -'use strict'; - -var utils = require('./utils'); -var assert = require('minimalistic-assert'); - -function BlockHash() { - this.pending = null; - this.pendingTotal = 0; - this.blockSize = this.constructor.blockSize; - this.outSize = this.constructor.outSize; - this.hmacStrength = this.constructor.hmacStrength; - this.padLength = this.constructor.padLength / 8; - this.endian = 'big'; - - this._delta8 = this.blockSize / 8; - this._delta32 = this.blockSize / 32; -} -exports.BlockHash = BlockHash; - -BlockHash.prototype.update = function update(msg, enc) { - // Convert message to array, pad it, and join into 32bit blocks - msg = utils.toArray(msg, enc); - if (!this.pending) - this.pending = msg; - else - this.pending = this.pending.concat(msg); - this.pendingTotal += msg.length; - - // Enough data, try updating - if (this.pending.length >= this._delta8) { - msg = this.pending; - - // Process pending data in blocks - var r = msg.length % this._delta8; - this.pending = msg.slice(msg.length - r, msg.length); - if (this.pending.length === 0) - this.pending = null; - - msg = utils.join32(msg, 0, msg.length - r, this.endian); - for (var i = 0; i < msg.length; i += this._delta32) - this._update(msg, i, i + this._delta32); - } - - return this; -}; - -BlockHash.prototype.digest = function digest(enc) { - this.update(this._pad()); - assert(this.pending === null); - - return this._digest(enc); -}; - -BlockHash.prototype._pad = function pad() { - var len = this.pendingTotal; - var bytes = this._delta8; - var k = bytes - ((len + this.padLength) % bytes); - var res = new Array(k + this.padLength); - res[0] = 0x80; - for (var i = 1; i < k; i++) - res[i] = 0; - - // Append length - len <<= 3; - if (this.endian === 'big') { - for (var t = 8; t < this.padLength; t++) - res[i++] = 0; - - res[i++] = 0; - res[i++] = 0; - res[i++] = 0; - res[i++] = 0; - res[i++] = (len >>> 24) & 0xff; - res[i++] = (len >>> 16) & 0xff; - res[i++] = (len >>> 8) & 0xff; - res[i++] = len & 0xff; - } else { - res[i++] = len & 0xff; - res[i++] = (len >>> 8) & 0xff; - res[i++] = (len >>> 16) & 0xff; - res[i++] = (len >>> 24) & 0xff; - res[i++] = 0; - res[i++] = 0; - res[i++] = 0; - res[i++] = 0; - - for (t = 8; t < this.padLength; t++) - res[i++] = 0; - } - - return res; -}; diff --git a/node_modules/hash.js/lib/hash/hmac.js b/node_modules/hash.js/lib/hash/hmac.js deleted file mode 100644 index faff12d3b..000000000 --- a/node_modules/hash.js/lib/hash/hmac.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -var utils = require('./utils'); -var assert = require('minimalistic-assert'); - -function Hmac(hash, key, enc) { - if (!(this instanceof Hmac)) - return new Hmac(hash, key, enc); - this.Hash = hash; - this.blockSize = hash.blockSize / 8; - this.outSize = hash.outSize / 8; - this.inner = null; - this.outer = null; - - this._init(utils.toArray(key, enc)); -} -module.exports = Hmac; - -Hmac.prototype._init = function init(key) { - // Shorten key, if needed - if (key.length > this.blockSize) - key = new this.Hash().update(key).digest(); - assert(key.length <= this.blockSize); - - // Add padding to key - for (var i = key.length; i < this.blockSize; i++) - key.push(0); - - for (i = 0; i < key.length; i++) - key[i] ^= 0x36; - this.inner = new this.Hash().update(key); - - // 0x36 ^ 0x5c = 0x6a - for (i = 0; i < key.length; i++) - key[i] ^= 0x6a; - this.outer = new this.Hash().update(key); -}; - -Hmac.prototype.update = function update(msg, enc) { - this.inner.update(msg, enc); - return this; -}; - -Hmac.prototype.digest = function digest(enc) { - this.outer.update(this.inner.digest()); - return this.outer.digest(enc); -}; diff --git a/node_modules/hash.js/lib/hash/ripemd.js b/node_modules/hash.js/lib/hash/ripemd.js deleted file mode 100644 index 2dcdff273..000000000 --- a/node_modules/hash.js/lib/hash/ripemd.js +++ /dev/null @@ -1,146 +0,0 @@ -'use strict'; - -var utils = require('./utils'); -var common = require('./common'); - -var rotl32 = utils.rotl32; -var sum32 = utils.sum32; -var sum32_3 = utils.sum32_3; -var sum32_4 = utils.sum32_4; -var BlockHash = common.BlockHash; - -function RIPEMD160() { - if (!(this instanceof RIPEMD160)) - return new RIPEMD160(); - - BlockHash.call(this); - - this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ]; - this.endian = 'little'; -} -utils.inherits(RIPEMD160, BlockHash); -exports.ripemd160 = RIPEMD160; - -RIPEMD160.blockSize = 512; -RIPEMD160.outSize = 160; -RIPEMD160.hmacStrength = 192; -RIPEMD160.padLength = 64; - -RIPEMD160.prototype._update = function update(msg, start) { - var A = this.h[0]; - var B = this.h[1]; - var C = this.h[2]; - var D = this.h[3]; - var E = this.h[4]; - var Ah = A; - var Bh = B; - var Ch = C; - var Dh = D; - var Eh = E; - for (var j = 0; j < 80; j++) { - var T = sum32( - rotl32( - sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)), - s[j]), - E); - A = E; - E = D; - D = rotl32(C, 10); - C = B; - B = T; - T = sum32( - rotl32( - sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)), - sh[j]), - Eh); - Ah = Eh; - Eh = Dh; - Dh = rotl32(Ch, 10); - Ch = Bh; - Bh = T; - } - T = sum32_3(this.h[1], C, Dh); - this.h[1] = sum32_3(this.h[2], D, Eh); - this.h[2] = sum32_3(this.h[3], E, Ah); - this.h[3] = sum32_3(this.h[4], A, Bh); - this.h[4] = sum32_3(this.h[0], B, Ch); - this.h[0] = T; -}; - -RIPEMD160.prototype._digest = function digest(enc) { - if (enc === 'hex') - return utils.toHex32(this.h, 'little'); - else - return utils.split32(this.h, 'little'); -}; - -function f(j, x, y, z) { - if (j <= 15) - return x ^ y ^ z; - else if (j <= 31) - return (x & y) | ((~x) & z); - else if (j <= 47) - return (x | (~y)) ^ z; - else if (j <= 63) - return (x & z) | (y & (~z)); - else - return x ^ (y | (~z)); -} - -function K(j) { - if (j <= 15) - return 0x00000000; - else if (j <= 31) - return 0x5a827999; - else if (j <= 47) - return 0x6ed9eba1; - else if (j <= 63) - return 0x8f1bbcdc; - else - return 0xa953fd4e; -} - -function Kh(j) { - if (j <= 15) - return 0x50a28be6; - else if (j <= 31) - return 0x5c4dd124; - else if (j <= 47) - return 0x6d703ef3; - else if (j <= 63) - return 0x7a6d76e9; - else - return 0x00000000; -} - -var r = [ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, - 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, - 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, - 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13 -]; - -var rh = [ - 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, - 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, - 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, - 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, - 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11 -]; - -var s = [ - 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, - 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, - 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, - 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, - 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 -]; - -var sh = [ - 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, - 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, - 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, - 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, - 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 -]; diff --git a/node_modules/hash.js/lib/hash/sha.js b/node_modules/hash.js/lib/hash/sha.js deleted file mode 100644 index f34a38d7b..000000000 --- a/node_modules/hash.js/lib/hash/sha.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -exports.sha1 = require('./sha/1'); -exports.sha224 = require('./sha/224'); -exports.sha256 = require('./sha/256'); -exports.sha384 = require('./sha/384'); -exports.sha512 = require('./sha/512'); diff --git a/node_modules/hash.js/lib/hash/sha/1.js b/node_modules/hash.js/lib/hash/sha/1.js deleted file mode 100644 index fcdfa2946..000000000 --- a/node_modules/hash.js/lib/hash/sha/1.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict'; - -var utils = require('../utils'); -var common = require('../common'); -var shaCommon = require('./common'); - -var rotl32 = utils.rotl32; -var sum32 = utils.sum32; -var sum32_5 = utils.sum32_5; -var ft_1 = shaCommon.ft_1; -var BlockHash = common.BlockHash; - -var sha1_K = [ - 0x5A827999, 0x6ED9EBA1, - 0x8F1BBCDC, 0xCA62C1D6 -]; - -function SHA1() { - if (!(this instanceof SHA1)) - return new SHA1(); - - BlockHash.call(this); - this.h = [ - 0x67452301, 0xefcdab89, 0x98badcfe, - 0x10325476, 0xc3d2e1f0 ]; - this.W = new Array(80); -} - -utils.inherits(SHA1, BlockHash); -module.exports = SHA1; - -SHA1.blockSize = 512; -SHA1.outSize = 160; -SHA1.hmacStrength = 80; -SHA1.padLength = 64; - -SHA1.prototype._update = function _update(msg, start) { - var W = this.W; - - for (var i = 0; i < 16; i++) - W[i] = msg[start + i]; - - for(; i < W.length; i++) - W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1); - - var a = this.h[0]; - var b = this.h[1]; - var c = this.h[2]; - var d = this.h[3]; - var e = this.h[4]; - - for (i = 0; i < W.length; i++) { - var s = ~~(i / 20); - var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]); - e = d; - d = c; - c = rotl32(b, 30); - b = a; - a = t; - } - - this.h[0] = sum32(this.h[0], a); - this.h[1] = sum32(this.h[1], b); - this.h[2] = sum32(this.h[2], c); - this.h[3] = sum32(this.h[3], d); - this.h[4] = sum32(this.h[4], e); -}; - -SHA1.prototype._digest = function digest(enc) { - if (enc === 'hex') - return utils.toHex32(this.h, 'big'); - else - return utils.split32(this.h, 'big'); -}; diff --git a/node_modules/hash.js/lib/hash/sha/224.js b/node_modules/hash.js/lib/hash/sha/224.js deleted file mode 100644 index c69882db5..000000000 --- a/node_modules/hash.js/lib/hash/sha/224.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -var utils = require('../utils'); -var SHA256 = require('./256'); - -function SHA224() { - if (!(this instanceof SHA224)) - return new SHA224(); - - SHA256.call(this); - this.h = [ - 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, - 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ]; -} -utils.inherits(SHA224, SHA256); -module.exports = SHA224; - -SHA224.blockSize = 512; -SHA224.outSize = 224; -SHA224.hmacStrength = 192; -SHA224.padLength = 64; - -SHA224.prototype._digest = function digest(enc) { - // Just truncate output - if (enc === 'hex') - return utils.toHex32(this.h.slice(0, 7), 'big'); - else - return utils.split32(this.h.slice(0, 7), 'big'); -}; - diff --git a/node_modules/hash.js/lib/hash/sha/256.js b/node_modules/hash.js/lib/hash/sha/256.js deleted file mode 100644 index 6dbd6a0c4..000000000 --- a/node_modules/hash.js/lib/hash/sha/256.js +++ /dev/null @@ -1,105 +0,0 @@ -'use strict'; - -var utils = require('../utils'); -var common = require('../common'); -var shaCommon = require('./common'); -var assert = require('minimalistic-assert'); - -var sum32 = utils.sum32; -var sum32_4 = utils.sum32_4; -var sum32_5 = utils.sum32_5; -var ch32 = shaCommon.ch32; -var maj32 = shaCommon.maj32; -var s0_256 = shaCommon.s0_256; -var s1_256 = shaCommon.s1_256; -var g0_256 = shaCommon.g0_256; -var g1_256 = shaCommon.g1_256; - -var BlockHash = common.BlockHash; - -var sha256_K = [ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, - 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, - 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, - 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, - 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, - 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, - 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, - 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, - 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -]; - -function SHA256() { - if (!(this instanceof SHA256)) - return new SHA256(); - - BlockHash.call(this); - this.h = [ - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, - 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 - ]; - this.k = sha256_K; - this.W = new Array(64); -} -utils.inherits(SHA256, BlockHash); -module.exports = SHA256; - -SHA256.blockSize = 512; -SHA256.outSize = 256; -SHA256.hmacStrength = 192; -SHA256.padLength = 64; - -SHA256.prototype._update = function _update(msg, start) { - var W = this.W; - - for (var i = 0; i < 16; i++) - W[i] = msg[start + i]; - for (; i < W.length; i++) - W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]); - - var a = this.h[0]; - var b = this.h[1]; - var c = this.h[2]; - var d = this.h[3]; - var e = this.h[4]; - var f = this.h[5]; - var g = this.h[6]; - var h = this.h[7]; - - assert(this.k.length === W.length); - for (i = 0; i < W.length; i++) { - var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]); - var T2 = sum32(s0_256(a), maj32(a, b, c)); - h = g; - g = f; - f = e; - e = sum32(d, T1); - d = c; - c = b; - b = a; - a = sum32(T1, T2); - } - - this.h[0] = sum32(this.h[0], a); - this.h[1] = sum32(this.h[1], b); - this.h[2] = sum32(this.h[2], c); - this.h[3] = sum32(this.h[3], d); - this.h[4] = sum32(this.h[4], e); - this.h[5] = sum32(this.h[5], f); - this.h[6] = sum32(this.h[6], g); - this.h[7] = sum32(this.h[7], h); -}; - -SHA256.prototype._digest = function digest(enc) { - if (enc === 'hex') - return utils.toHex32(this.h, 'big'); - else - return utils.split32(this.h, 'big'); -}; diff --git a/node_modules/hash.js/lib/hash/sha/384.js b/node_modules/hash.js/lib/hash/sha/384.js deleted file mode 100644 index 01df25608..000000000 --- a/node_modules/hash.js/lib/hash/sha/384.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -var utils = require('../utils'); - -var SHA512 = require('./512'); - -function SHA384() { - if (!(this instanceof SHA384)) - return new SHA384(); - - SHA512.call(this); - this.h = [ - 0xcbbb9d5d, 0xc1059ed8, - 0x629a292a, 0x367cd507, - 0x9159015a, 0x3070dd17, - 0x152fecd8, 0xf70e5939, - 0x67332667, 0xffc00b31, - 0x8eb44a87, 0x68581511, - 0xdb0c2e0d, 0x64f98fa7, - 0x47b5481d, 0xbefa4fa4 ]; -} -utils.inherits(SHA384, SHA512); -module.exports = SHA384; - -SHA384.blockSize = 1024; -SHA384.outSize = 384; -SHA384.hmacStrength = 192; -SHA384.padLength = 128; - -SHA384.prototype._digest = function digest(enc) { - if (enc === 'hex') - return utils.toHex32(this.h.slice(0, 12), 'big'); - else - return utils.split32(this.h.slice(0, 12), 'big'); -}; diff --git a/node_modules/hash.js/lib/hash/sha/512.js b/node_modules/hash.js/lib/hash/sha/512.js deleted file mode 100644 index c371a2590..000000000 --- a/node_modules/hash.js/lib/hash/sha/512.js +++ /dev/null @@ -1,330 +0,0 @@ -'use strict'; - -var utils = require('../utils'); -var common = require('../common'); -var assert = require('minimalistic-assert'); - -var rotr64_hi = utils.rotr64_hi; -var rotr64_lo = utils.rotr64_lo; -var shr64_hi = utils.shr64_hi; -var shr64_lo = utils.shr64_lo; -var sum64 = utils.sum64; -var sum64_hi = utils.sum64_hi; -var sum64_lo = utils.sum64_lo; -var sum64_4_hi = utils.sum64_4_hi; -var sum64_4_lo = utils.sum64_4_lo; -var sum64_5_hi = utils.sum64_5_hi; -var sum64_5_lo = utils.sum64_5_lo; - -var BlockHash = common.BlockHash; - -var sha512_K = [ - 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, - 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc, - 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, - 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118, - 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, - 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2, - 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, - 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694, - 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, - 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65, - 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, - 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5, - 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, - 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4, - 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, - 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70, - 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, - 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df, - 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, - 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b, - 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, - 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30, - 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, - 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8, - 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, - 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8, - 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, - 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3, - 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, - 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec, - 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, - 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b, - 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, - 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178, - 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6, - 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b, - 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, - 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c, - 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, - 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817 -]; - -function SHA512() { - if (!(this instanceof SHA512)) - return new SHA512(); - - BlockHash.call(this); - this.h = [ - 0x6a09e667, 0xf3bcc908, - 0xbb67ae85, 0x84caa73b, - 0x3c6ef372, 0xfe94f82b, - 0xa54ff53a, 0x5f1d36f1, - 0x510e527f, 0xade682d1, - 0x9b05688c, 0x2b3e6c1f, - 0x1f83d9ab, 0xfb41bd6b, - 0x5be0cd19, 0x137e2179 ]; - this.k = sha512_K; - this.W = new Array(160); -} -utils.inherits(SHA512, BlockHash); -module.exports = SHA512; - -SHA512.blockSize = 1024; -SHA512.outSize = 512; -SHA512.hmacStrength = 192; -SHA512.padLength = 128; - -SHA512.prototype._prepareBlock = function _prepareBlock(msg, start) { - var W = this.W; - - // 32 x 32bit words - for (var i = 0; i < 32; i++) - W[i] = msg[start + i]; - for (; i < W.length; i += 2) { - var c0_hi = g1_512_hi(W[i - 4], W[i - 3]); // i - 2 - var c0_lo = g1_512_lo(W[i - 4], W[i - 3]); - var c1_hi = W[i - 14]; // i - 7 - var c1_lo = W[i - 13]; - var c2_hi = g0_512_hi(W[i - 30], W[i - 29]); // i - 15 - var c2_lo = g0_512_lo(W[i - 30], W[i - 29]); - var c3_hi = W[i - 32]; // i - 16 - var c3_lo = W[i - 31]; - - W[i] = sum64_4_hi( - c0_hi, c0_lo, - c1_hi, c1_lo, - c2_hi, c2_lo, - c3_hi, c3_lo); - W[i + 1] = sum64_4_lo( - c0_hi, c0_lo, - c1_hi, c1_lo, - c2_hi, c2_lo, - c3_hi, c3_lo); - } -}; - -SHA512.prototype._update = function _update(msg, start) { - this._prepareBlock(msg, start); - - var W = this.W; - - var ah = this.h[0]; - var al = this.h[1]; - var bh = this.h[2]; - var bl = this.h[3]; - var ch = this.h[4]; - var cl = this.h[5]; - var dh = this.h[6]; - var dl = this.h[7]; - var eh = this.h[8]; - var el = this.h[9]; - var fh = this.h[10]; - var fl = this.h[11]; - var gh = this.h[12]; - var gl = this.h[13]; - var hh = this.h[14]; - var hl = this.h[15]; - - assert(this.k.length === W.length); - for (var i = 0; i < W.length; i += 2) { - var c0_hi = hh; - var c0_lo = hl; - var c1_hi = s1_512_hi(eh, el); - var c1_lo = s1_512_lo(eh, el); - var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl); - var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl); - var c3_hi = this.k[i]; - var c3_lo = this.k[i + 1]; - var c4_hi = W[i]; - var c4_lo = W[i + 1]; - - var T1_hi = sum64_5_hi( - c0_hi, c0_lo, - c1_hi, c1_lo, - c2_hi, c2_lo, - c3_hi, c3_lo, - c4_hi, c4_lo); - var T1_lo = sum64_5_lo( - c0_hi, c0_lo, - c1_hi, c1_lo, - c2_hi, c2_lo, - c3_hi, c3_lo, - c4_hi, c4_lo); - - c0_hi = s0_512_hi(ah, al); - c0_lo = s0_512_lo(ah, al); - c1_hi = maj64_hi(ah, al, bh, bl, ch, cl); - c1_lo = maj64_lo(ah, al, bh, bl, ch, cl); - - var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo); - var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo); - - hh = gh; - hl = gl; - - gh = fh; - gl = fl; - - fh = eh; - fl = el; - - eh = sum64_hi(dh, dl, T1_hi, T1_lo); - el = sum64_lo(dl, dl, T1_hi, T1_lo); - - dh = ch; - dl = cl; - - ch = bh; - cl = bl; - - bh = ah; - bl = al; - - ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo); - al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo); - } - - sum64(this.h, 0, ah, al); - sum64(this.h, 2, bh, bl); - sum64(this.h, 4, ch, cl); - sum64(this.h, 6, dh, dl); - sum64(this.h, 8, eh, el); - sum64(this.h, 10, fh, fl); - sum64(this.h, 12, gh, gl); - sum64(this.h, 14, hh, hl); -}; - -SHA512.prototype._digest = function digest(enc) { - if (enc === 'hex') - return utils.toHex32(this.h, 'big'); - else - return utils.split32(this.h, 'big'); -}; - -function ch64_hi(xh, xl, yh, yl, zh) { - var r = (xh & yh) ^ ((~xh) & zh); - if (r < 0) - r += 0x100000000; - return r; -} - -function ch64_lo(xh, xl, yh, yl, zh, zl) { - var r = (xl & yl) ^ ((~xl) & zl); - if (r < 0) - r += 0x100000000; - return r; -} - -function maj64_hi(xh, xl, yh, yl, zh) { - var r = (xh & yh) ^ (xh & zh) ^ (yh & zh); - if (r < 0) - r += 0x100000000; - return r; -} - -function maj64_lo(xh, xl, yh, yl, zh, zl) { - var r = (xl & yl) ^ (xl & zl) ^ (yl & zl); - if (r < 0) - r += 0x100000000; - return r; -} - -function s0_512_hi(xh, xl) { - var c0_hi = rotr64_hi(xh, xl, 28); - var c1_hi = rotr64_hi(xl, xh, 2); // 34 - var c2_hi = rotr64_hi(xl, xh, 7); // 39 - - var r = c0_hi ^ c1_hi ^ c2_hi; - if (r < 0) - r += 0x100000000; - return r; -} - -function s0_512_lo(xh, xl) { - var c0_lo = rotr64_lo(xh, xl, 28); - var c1_lo = rotr64_lo(xl, xh, 2); // 34 - var c2_lo = rotr64_lo(xl, xh, 7); // 39 - - var r = c0_lo ^ c1_lo ^ c2_lo; - if (r < 0) - r += 0x100000000; - return r; -} - -function s1_512_hi(xh, xl) { - var c0_hi = rotr64_hi(xh, xl, 14); - var c1_hi = rotr64_hi(xh, xl, 18); - var c2_hi = rotr64_hi(xl, xh, 9); // 41 - - var r = c0_hi ^ c1_hi ^ c2_hi; - if (r < 0) - r += 0x100000000; - return r; -} - -function s1_512_lo(xh, xl) { - var c0_lo = rotr64_lo(xh, xl, 14); - var c1_lo = rotr64_lo(xh, xl, 18); - var c2_lo = rotr64_lo(xl, xh, 9); // 41 - - var r = c0_lo ^ c1_lo ^ c2_lo; - if (r < 0) - r += 0x100000000; - return r; -} - -function g0_512_hi(xh, xl) { - var c0_hi = rotr64_hi(xh, xl, 1); - var c1_hi = rotr64_hi(xh, xl, 8); - var c2_hi = shr64_hi(xh, xl, 7); - - var r = c0_hi ^ c1_hi ^ c2_hi; - if (r < 0) - r += 0x100000000; - return r; -} - -function g0_512_lo(xh, xl) { - var c0_lo = rotr64_lo(xh, xl, 1); - var c1_lo = rotr64_lo(xh, xl, 8); - var c2_lo = shr64_lo(xh, xl, 7); - - var r = c0_lo ^ c1_lo ^ c2_lo; - if (r < 0) - r += 0x100000000; - return r; -} - -function g1_512_hi(xh, xl) { - var c0_hi = rotr64_hi(xh, xl, 19); - var c1_hi = rotr64_hi(xl, xh, 29); // 61 - var c2_hi = shr64_hi(xh, xl, 6); - - var r = c0_hi ^ c1_hi ^ c2_hi; - if (r < 0) - r += 0x100000000; - return r; -} - -function g1_512_lo(xh, xl) { - var c0_lo = rotr64_lo(xh, xl, 19); - var c1_lo = rotr64_lo(xl, xh, 29); // 61 - var c2_lo = shr64_lo(xh, xl, 6); - - var r = c0_lo ^ c1_lo ^ c2_lo; - if (r < 0) - r += 0x100000000; - return r; -} diff --git a/node_modules/hash.js/lib/hash/sha/common.js b/node_modules/hash.js/lib/hash/sha/common.js deleted file mode 100644 index d41b46431..000000000 --- a/node_modules/hash.js/lib/hash/sha/common.js +++ /dev/null @@ -1,49 +0,0 @@ -'use strict'; - -var utils = require('../utils'); -var rotr32 = utils.rotr32; - -function ft_1(s, x, y, z) { - if (s === 0) - return ch32(x, y, z); - if (s === 1 || s === 3) - return p32(x, y, z); - if (s === 2) - return maj32(x, y, z); -} -exports.ft_1 = ft_1; - -function ch32(x, y, z) { - return (x & y) ^ ((~x) & z); -} -exports.ch32 = ch32; - -function maj32(x, y, z) { - return (x & y) ^ (x & z) ^ (y & z); -} -exports.maj32 = maj32; - -function p32(x, y, z) { - return x ^ y ^ z; -} -exports.p32 = p32; - -function s0_256(x) { - return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22); -} -exports.s0_256 = s0_256; - -function s1_256(x) { - return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25); -} -exports.s1_256 = s1_256; - -function g0_256(x) { - return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3); -} -exports.g0_256 = g0_256; - -function g1_256(x) { - return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10); -} -exports.g1_256 = g1_256; diff --git a/node_modules/hash.js/lib/hash/utils.js b/node_modules/hash.js/lib/hash/utils.js deleted file mode 100644 index 3d7d4ea7e..000000000 --- a/node_modules/hash.js/lib/hash/utils.js +++ /dev/null @@ -1,253 +0,0 @@ -'use strict'; - -var assert = require('minimalistic-assert'); -var inherits = require('inherits'); - -exports.inherits = inherits; - -function toArray(msg, enc) { - if (Array.isArray(msg)) - return msg.slice(); - if (!msg) - return []; - var res = []; - if (typeof msg === 'string') { - if (!enc) { - for (var i = 0; i < msg.length; i++) { - var c = msg.charCodeAt(i); - var hi = c >> 8; - var lo = c & 0xff; - if (hi) - res.push(hi, lo); - else - res.push(lo); - } - } else if (enc === 'hex') { - msg = msg.replace(/[^a-z0-9]+/ig, ''); - if (msg.length % 2 !== 0) - msg = '0' + msg; - for (i = 0; i < msg.length; i += 2) - res.push(parseInt(msg[i] + msg[i + 1], 16)); - } - } else { - for (i = 0; i < msg.length; i++) - res[i] = msg[i] | 0; - } - return res; -} -exports.toArray = toArray; - -function toHex(msg) { - var res = ''; - for (var i = 0; i < msg.length; i++) - res += zero2(msg[i].toString(16)); - return res; -} -exports.toHex = toHex; - -function htonl(w) { - var res = (w >>> 24) | - ((w >>> 8) & 0xff00) | - ((w << 8) & 0xff0000) | - ((w & 0xff) << 24); - return res >>> 0; -} -exports.htonl = htonl; - -function toHex32(msg, endian) { - var res = ''; - for (var i = 0; i < msg.length; i++) { - var w = msg[i]; - if (endian === 'little') - w = htonl(w); - res += zero8(w.toString(16)); - } - return res; -} -exports.toHex32 = toHex32; - -function zero2(word) { - if (word.length === 1) - return '0' + word; - else - return word; -} -exports.zero2 = zero2; - -function zero8(word) { - if (word.length === 7) - return '0' + word; - else if (word.length === 6) - return '00' + word; - else if (word.length === 5) - return '000' + word; - else if (word.length === 4) - return '0000' + word; - else if (word.length === 3) - return '00000' + word; - else if (word.length === 2) - return '000000' + word; - else if (word.length === 1) - return '0000000' + word; - else - return word; -} -exports.zero8 = zero8; - -function join32(msg, start, end, endian) { - var len = end - start; - assert(len % 4 === 0); - var res = new Array(len / 4); - for (var i = 0, k = start; i < res.length; i++, k += 4) { - var w; - if (endian === 'big') - w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3]; - else - w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k]; - res[i] = w >>> 0; - } - return res; -} -exports.join32 = join32; - -function split32(msg, endian) { - var res = new Array(msg.length * 4); - for (var i = 0, k = 0; i < msg.length; i++, k += 4) { - var m = msg[i]; - if (endian === 'big') { - res[k] = m >>> 24; - res[k + 1] = (m >>> 16) & 0xff; - res[k + 2] = (m >>> 8) & 0xff; - res[k + 3] = m & 0xff; - } else { - res[k + 3] = m >>> 24; - res[k + 2] = (m >>> 16) & 0xff; - res[k + 1] = (m >>> 8) & 0xff; - res[k] = m & 0xff; - } - } - return res; -} -exports.split32 = split32; - -function rotr32(w, b) { - return (w >>> b) | (w << (32 - b)); -} -exports.rotr32 = rotr32; - -function rotl32(w, b) { - return (w << b) | (w >>> (32 - b)); -} -exports.rotl32 = rotl32; - -function sum32(a, b) { - return (a + b) >>> 0; -} -exports.sum32 = sum32; - -function sum32_3(a, b, c) { - return (a + b + c) >>> 0; -} -exports.sum32_3 = sum32_3; - -function sum32_4(a, b, c, d) { - return (a + b + c + d) >>> 0; -} -exports.sum32_4 = sum32_4; - -function sum32_5(a, b, c, d, e) { - return (a + b + c + d + e) >>> 0; -} -exports.sum32_5 = sum32_5; - -function sum64(buf, pos, ah, al) { - var bh = buf[pos]; - var bl = buf[pos + 1]; - - var lo = (al + bl) >>> 0; - var hi = (lo < al ? 1 : 0) + ah + bh; - buf[pos] = hi >>> 0; - buf[pos + 1] = lo; -} -exports.sum64 = sum64; - -function sum64_hi(ah, al, bh, bl) { - var lo = (al + bl) >>> 0; - var hi = (lo < al ? 1 : 0) + ah + bh; - return hi >>> 0; -} -exports.sum64_hi = sum64_hi; - -function sum64_lo(ah, al, bh, bl) { - var lo = al + bl; - return lo >>> 0; -} -exports.sum64_lo = sum64_lo; - -function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) { - var carry = 0; - var lo = al; - lo = (lo + bl) >>> 0; - carry += lo < al ? 1 : 0; - lo = (lo + cl) >>> 0; - carry += lo < cl ? 1 : 0; - lo = (lo + dl) >>> 0; - carry += lo < dl ? 1 : 0; - - var hi = ah + bh + ch + dh + carry; - return hi >>> 0; -} -exports.sum64_4_hi = sum64_4_hi; - -function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) { - var lo = al + bl + cl + dl; - return lo >>> 0; -} -exports.sum64_4_lo = sum64_4_lo; - -function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { - var carry = 0; - var lo = al; - lo = (lo + bl) >>> 0; - carry += lo < al ? 1 : 0; - lo = (lo + cl) >>> 0; - carry += lo < cl ? 1 : 0; - lo = (lo + dl) >>> 0; - carry += lo < dl ? 1 : 0; - lo = (lo + el) >>> 0; - carry += lo < el ? 1 : 0; - - var hi = ah + bh + ch + dh + eh + carry; - return hi >>> 0; -} -exports.sum64_5_hi = sum64_5_hi; - -function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { - var lo = al + bl + cl + dl + el; - - return lo >>> 0; -} -exports.sum64_5_lo = sum64_5_lo; - -function rotr64_hi(ah, al, num) { - var r = (al << (32 - num)) | (ah >>> num); - return r >>> 0; -} -exports.rotr64_hi = rotr64_hi; - -function rotr64_lo(ah, al, num) { - var r = (ah << (32 - num)) | (al >>> num); - return r >>> 0; -} -exports.rotr64_lo = rotr64_lo; - -function shr64_hi(ah, al, num) { - return ah >>> num; -} -exports.shr64_hi = shr64_hi; - -function shr64_lo(ah, al, num) { - var r = (ah << (32 - num)) | (al >>> num); - return r >>> 0; -} -exports.shr64_lo = shr64_lo; diff --git a/node_modules/hash.js/package.json b/node_modules/hash.js/package.json deleted file mode 100644 index 7245dcdc4..000000000 --- a/node_modules/hash.js/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "_from": "hash.js@^1.0.0", - "_id": "hash.js@1.1.5", - "_inBundle": false, - "_integrity": "sha512-eWI5HG9Np+eHV1KQhisXWwM+4EPPYe5dFX1UZZH7k/E3JzDEazVH+VGlZi6R94ZqImq+A3D1mCEtrFIfg/E7sA==", - "_location": "/hash.js", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "hash.js@^1.0.0", - "name": "hash.js", - "escapedName": "hash.js", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/elliptic", - "/hmac-drbg" - ], - "_resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.5.tgz", - "_shasum": "e38ab4b85dfb1e0c40fe9265c0e9b54854c23812", - "_spec": "hash.js@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/elliptic", - "author": { - "name": "Fedor Indutny", - "email": "fedor@indutny.com" - }, - "bugs": { - "url": "https://github.com/indutny/hash.js/issues" - }, - "bundleDependencies": false, - "dependencies": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - }, - "deprecated": false, - "description": "Various hash functions that could be run by both browser and node", - "devDependencies": { - "eslint": "^4.19.1", - "mocha": "^5.2.0" - }, - "homepage": "https://github.com/indutny/hash.js", - "keywords": [ - "hash", - "sha256", - "sha224", - "hmac" - ], - "license": "MIT", - "main": "lib/hash.js", - "name": "hash.js", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/indutny/hash.js.git" - }, - "scripts": { - "lint": "eslint lib/*.js lib/**/*.js lib/**/**/*.js test/*.js", - "test": "mocha --reporter=spec test/*-test.js && npm run lint" - }, - "typings": "lib/hash.d.ts", - "version": "1.1.5" -} diff --git a/node_modules/hash.js/test/hash-test.js b/node_modules/hash.js/test/hash-test.js deleted file mode 100644 index 6a36efc6f..000000000 --- a/node_modules/hash.js/test/hash-test.js +++ /dev/null @@ -1,124 +0,0 @@ -'use strict'; -/* global describe it */ - -var assert = require('assert'); -var hash = require('../'); - -describe('Hash', function() { - function test(fn, cases) { - for (var i = 0; i < cases.length; i++) { - var msg = cases[i][0]; - var res = cases[i][1]; - var enc = cases[i][2]; - - var dgst = fn().update(msg, enc).digest('hex'); - assert.equal(dgst, res); - - // Split message - dgst = fn().update(msg.slice(0, 2), enc) - .update(msg.slice(2), enc) - .digest('hex'); - assert.equal(dgst, res); - } - } - - it('should support sha256', function() { - assert.equal(hash.sha256.blockSize, 512); - assert.equal(hash.sha256.outSize, 256); - - test(hash.sha256, [ - [ 'abc', - 'ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad' ], - [ 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq', - '248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1' ], - [ 'deadbeef', - '5f78c33274e43fa9de5659265c1d917e25c03722dcb0b8d27db8d5feaa813953', - 'hex' ], - ]); - }); - - it('should support sha224', function() { - assert.equal(hash.sha224.blockSize, 512); - assert.equal(hash.sha224.outSize, 224); - - test(hash.sha224, [ - [ 'abc', - '23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7' ], - [ 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq', - '75388b16512776cc5dba5da1fd890150b0c6455cb4f58b1952522525' ], - [ 'deadbeef', - '55b9eee5f60cc362ddc07676f620372611e22272f60fdbec94f243f8', - 'hex' ], - ]); - }); - - it('should support ripemd160', function() { - assert.equal(hash.ripemd160.blockSize, 512); - assert.equal(hash.ripemd160.outSize, 160); - - test(hash.ripemd160, [ - [ '', '9c1185a5c5e9fc54612808977ee8f548b2258d31'], - [ 'abc', - '8eb208f7e05d987a9b044a8e98c6b087f15a0bfc' ], - [ 'message digest', - '5d0689ef49d2fae572b881b123a85ffa21595f36' ], - [ 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq', - '12a053384a9c0c88e405a06c27dcf49ada62eb2b' ], - [ 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', - 'b0e20b6e3116640286ed3a87a5713079b21f5189' ], - ]); - }); - - it('should support sha1', function() { - assert.equal(hash.sha1.blockSize, 512); - assert.equal(hash.sha1.outSize, 160); - - test(hash.sha1, [ - [ '', - 'da39a3ee5e6b4b0d3255bfef95601890afd80709' ], - [ 'abc', - 'a9993e364706816aba3e25717850c26c9cd0d89d' ], - [ 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq', - '84983e441c3bd26ebaae4aa1f95129e5e54670f1' ], - [ 'deadbeef', - 'd78f8bb992a56a597f6c7a1fb918bb78271367eb', - 'hex' ], - ]); - }); - - it('should support sha512', function() { - assert.equal(hash.sha512.blockSize, 1024); - assert.equal(hash.sha512.outSize, 512); - - test(hash.sha512, [ - [ 'abc', - 'ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a' + - '2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f' - ], - [ - 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn' + - 'hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu', - '8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018' + - '501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909' - ] - ]); - }); - - it('should support sha384', function() { - assert.equal(hash.sha384.blockSize, 1024); - assert.equal(hash.sha384.outSize, 384); - - test(hash.sha384, [ - [ 'abc', - 'cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed' + - '8086072ba1e7cc2358baeca134c825a7' - ], - [ - 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn' + - 'hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu', - '09330c33f71147e83d192fc782cd1b4753111b173b3b05d22fa08086e3b0f712' + - 'fcc7c71a557e2db966c3e9fa91746039' - ] - ]); - }); -}); diff --git a/node_modules/hash.js/test/hmac-test.js b/node_modules/hash.js/test/hmac-test.js deleted file mode 100644 index 6fe18e38e..000000000 --- a/node_modules/hash.js/test/hmac-test.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict'; -/* global describe it */ - -var assert = require('assert'); -var hash = require('../'); - -describe('Hmac', function() { - describe('mixed test vector', function() { - test({ - name: 'nist 1', - key: '00010203 04050607 08090A0B 0C0D0E0F' + - '10111213 14151617 18191A1B 1C1D1E1F 20212223 24252627' + - '28292A2B 2C2D2E2F 30313233 34353637 38393A3B 3C3D3E3F', - msg: 'Sample message for keylen=blocklen', - res: '8bb9a1db9806f20df7f77b82138c7914d174d59e13dc4d0169c9057b133e1d62' - }); - test({ - name: 'nist 2', - key: '00010203 04050607' + - '08090A0B 0C0D0E0F 10111213 14151617 18191A1B 1C1D1E1F', - msg: 'Sample message for keylen -``` - -for node.js, you may install it via npm: - -```bash -npm install heap -``` - -then require it: - -``` -var Heap = require('heap'); -``` - -Examples -------- - - -push and pop - -```js -var heap = new Heap(); -heap.push(3); -heap.push(1); -heap.push(2); -heap.pop(); // 1 -``` - -custom comparison function - -```js -var heap = new Heap(function(a, b) { - return a.foo - b.foo; -}); -heap.push({foo: 3}); -heap.push({foo: 1}); -heap.push({foo: 2}); -heap.pop(); // {foo: 1} -``` - -find 3 largest/smallest items in an array - -```js -var array = [1, 3, 4, 2, 5]; -Heap.nlargest(array, 3); // [5, 4, 3] -Heap.nsmallest(array, 3); // [1, 2, 3] -``` - -Document --------- - -This module exposes only one object, namely the Heap class. - -### Constructor: Heap([cmp]) ### - -The constructor receives a comparison function as an optional parameter. If omitted, the heap is built as a min-heap, which means that the smallest element will be popped out first. - -If the comparison function is supplied, the heap will be built according to the -return value of the comparison function. - -* if cmp(a, b) < 0, then item a will come prior to b -* if cmp(a, b) > 0, then item b will come prior to a - -So, the comparison function has the following form: - -```js -function cmp(a, b) { - if (a is prior to b) { - return -1; - } - if (b is prior to a) { - return 1; - } - return 0; -} -``` - -To compare numbers, simply: - -```js -function cmp(a, b) { - return a - b; -} -``` - -### Instance Methods ### - -**push(item)** (alias: **insert**) - -Push item onto heap. - -**pop()** - -Pop the smallest item off the heap and return it. - -**peek()** (alias: **top** / **front**) - -Return the smallest item of the heap. - -**replace(item)** - -Pop and return the current smallest value, and add the new item. - -This is more efficient than pop() followed by push(), and can be -more appropriate when using a fixed size heap. Note that the value -returned may be larger than item! - -**pushpop(item)** - -Fast version of a push followed by a pop. - -**heapify()** - -Rebuild the heap. This method may come handy when the priority of the -internal data is being modified. - -**updateItem(item)** - -Update the position of the given item in the heap. -This function should be called every time the item is being modified. - -**empty()** - -Determine whether the heap is empty. - -**size()** - -Get the number of elements stored in the heap. - -**toArray()** - -Return the array representation of the heap. (note: the array is a shallow copy of the heap's internal nodes) - -**clone()** (alias: **copy**) - -Return a clone of the heap. (note: the internal data is a shallow copy of the original one) - -### Static Methods ### - -NOTE: All the static methods are designed to be applied on arrays. - -**push(array, item, [cmp])** - -Push item onto array, maintaining the heap invariant. - -**pop(array, [cmp])** - -Pop the smallest item off the array, maintaining the heap invariant. - -**replace(array, item, [cmp])** - -Pop and return the current smallest value, and add the new item. - -This is more efficient than heappop() followed by heappush(), and can be -more appropriate when using a fixed size heap. Note that the value -returned may be larger than item! - -**pushpop(array, item, [cmp])** - -Fast version of a heappush followed by a heappop. - -**heapify(array, [cmp])** - -Build the heap. - -**updateItem(array, item, [cmp])** - -Update the position of the given item in the heap. -This function should be called every time the item is being modified. - -**nlargest(array, n, [cmp])** - -Find the n largest elements in a dataset. - -**nsmallest(array, n, [cmp])** - -Find the n smallest elements in a dataset. - - -License -------- - -Ported by Xueqiao Xu <xueqiaoxu@gmail.com> - -PSF LICENSE AGREEMENT FOR PYTHON 2.7.2 - -1. This LICENSE AGREEMENT is between the Python Software Foundation (“PSF”), and the Individual or Organization (“Licensee”) accessing and otherwise using Python 2.7.2 software in source or binary form and its associated documentation. -2. Subject to the terms and conditions of this License Agreement, PSF hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python 2.7.2 alone or in any derivative version, provided, however, that PSF’s License Agreement and PSF’s notice of copyright, i.e., “Copyright © 2001-2012 Python Software Foundation; All Rights Reserved” are retained in Python 2.7.2 alone or in any derivative version prepared by Licensee. -3. In the event Licensee prepares a derivative work that is based on or incorporates Python 2.7.2 or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to Python 2.7.2. -4. PSF is making Python 2.7.2 available to Licensee on an “AS IS” basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 2.7.2 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. -5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON 2.7.2 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 2.7.2, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. -6. This License Agreement will automatically terminate upon a material breach of its terms and conditions. -7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between PSF and Licensee. This License Agreement does not grant permission to use PSF trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third party. -8. By copying, installing or otherwise using Python 2.7.2, Licensee agrees to be bound by the terms and conditions of this License Agreement. diff --git a/node_modules/heap/bower.json b/node_modules/heap/bower.json deleted file mode 100644 index 010e8763d..000000000 --- a/node_modules/heap/bower.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name" : "heap" - , "version" : "0.2.5" - , "description" : "binary heap (priority queue) algorithms (ported from Python's heapq module)" - , "homepage" : "https://github.com/qiao/heap.js" - , "keywords" : ["algorithm", "data structure", "heap"] - , "author" : "Xueqiao Xu " - , "main" : "lib/heap.js" - , "dependencies" : {} - , "devDependencies" : {} - , "repository" : { - "type" : "git" - , "url" : "git://github.com/qiao/heap.js.git" - } - , "licenses" : [{ - "type" : "PSF" - , "url" : "http://docs.python.org/license.html" - }] -} diff --git a/node_modules/heap/index.js b/node_modules/heap/index.js deleted file mode 100644 index f4c5e9091..000000000 --- a/node_modules/heap/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/heap'); diff --git a/node_modules/heap/lib/heap.js b/node_modules/heap/lib/heap.js deleted file mode 100644 index e185c6f9c..000000000 --- a/node_modules/heap/lib/heap.js +++ /dev/null @@ -1,375 +0,0 @@ -// Generated by CoffeeScript 1.8.0 -(function() { - var Heap, defaultCmp, floor, heapify, heappop, heappush, heappushpop, heapreplace, insort, min, nlargest, nsmallest, updateItem, _siftdown, _siftup; - - floor = Math.floor, min = Math.min; - - - /* - Default comparison function to be used - */ - - defaultCmp = function(x, y) { - if (x < y) { - return -1; - } - if (x > y) { - return 1; - } - return 0; - }; - - - /* - Insert item x in list a, and keep it sorted assuming a is sorted. - - If x is already in a, insert it to the right of the rightmost x. - - Optional args lo (default 0) and hi (default a.length) bound the slice - of a to be searched. - */ - - insort = function(a, x, lo, hi, cmp) { - var mid; - if (lo == null) { - lo = 0; - } - if (cmp == null) { - cmp = defaultCmp; - } - if (lo < 0) { - throw new Error('lo must be non-negative'); - } - if (hi == null) { - hi = a.length; - } - while (lo < hi) { - mid = floor((lo + hi) / 2); - if (cmp(x, a[mid]) < 0) { - hi = mid; - } else { - lo = mid + 1; - } - } - return ([].splice.apply(a, [lo, lo - lo].concat(x)), x); - }; - - - /* - Push item onto heap, maintaining the heap invariant. - */ - - heappush = function(array, item, cmp) { - if (cmp == null) { - cmp = defaultCmp; - } - array.push(item); - return _siftdown(array, 0, array.length - 1, cmp); - }; - - - /* - Pop the smallest item off the heap, maintaining the heap invariant. - */ - - heappop = function(array, cmp) { - var lastelt, returnitem; - if (cmp == null) { - cmp = defaultCmp; - } - lastelt = array.pop(); - if (array.length) { - returnitem = array[0]; - array[0] = lastelt; - _siftup(array, 0, cmp); - } else { - returnitem = lastelt; - } - return returnitem; - }; - - - /* - Pop and return the current smallest value, and add the new item. - - This is more efficient than heappop() followed by heappush(), and can be - more appropriate when using a fixed size heap. Note that the value - returned may be larger than item! That constrains reasonable use of - this routine unless written as part of a conditional replacement: - if item > array[0] - item = heapreplace(array, item) - */ - - heapreplace = function(array, item, cmp) { - var returnitem; - if (cmp == null) { - cmp = defaultCmp; - } - returnitem = array[0]; - array[0] = item; - _siftup(array, 0, cmp); - return returnitem; - }; - - - /* - Fast version of a heappush followed by a heappop. - */ - - heappushpop = function(array, item, cmp) { - var _ref; - if (cmp == null) { - cmp = defaultCmp; - } - if (array.length && cmp(array[0], item) < 0) { - _ref = [array[0], item], item = _ref[0], array[0] = _ref[1]; - _siftup(array, 0, cmp); - } - return item; - }; - - - /* - Transform list into a heap, in-place, in O(array.length) time. - */ - - heapify = function(array, cmp) { - var i, _i, _j, _len, _ref, _ref1, _results, _results1; - if (cmp == null) { - cmp = defaultCmp; - } - _ref1 = (function() { - _results1 = []; - for (var _j = 0, _ref = floor(array.length / 2); 0 <= _ref ? _j < _ref : _j > _ref; 0 <= _ref ? _j++ : _j--){ _results1.push(_j); } - return _results1; - }).apply(this).reverse(); - _results = []; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - i = _ref1[_i]; - _results.push(_siftup(array, i, cmp)); - } - return _results; - }; - - - /* - Update the position of the given item in the heap. - This function should be called every time the item is being modified. - */ - - updateItem = function(array, item, cmp) { - var pos; - if (cmp == null) { - cmp = defaultCmp; - } - pos = array.indexOf(item); - if (pos === -1) { - return; - } - _siftdown(array, 0, pos, cmp); - return _siftup(array, pos, cmp); - }; - - - /* - Find the n largest elements in a dataset. - */ - - nlargest = function(array, n, cmp) { - var elem, result, _i, _len, _ref; - if (cmp == null) { - cmp = defaultCmp; - } - result = array.slice(0, n); - if (!result.length) { - return result; - } - heapify(result, cmp); - _ref = array.slice(n); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - elem = _ref[_i]; - heappushpop(result, elem, cmp); - } - return result.sort(cmp).reverse(); - }; - - - /* - Find the n smallest elements in a dataset. - */ - - nsmallest = function(array, n, cmp) { - var elem, i, los, result, _i, _j, _len, _ref, _ref1, _results; - if (cmp == null) { - cmp = defaultCmp; - } - if (n * 10 <= array.length) { - result = array.slice(0, n).sort(cmp); - if (!result.length) { - return result; - } - los = result[result.length - 1]; - _ref = array.slice(n); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - elem = _ref[_i]; - if (cmp(elem, los) < 0) { - insort(result, elem, 0, null, cmp); - result.pop(); - los = result[result.length - 1]; - } - } - return result; - } - heapify(array, cmp); - _results = []; - for (i = _j = 0, _ref1 = min(n, array.length); 0 <= _ref1 ? _j < _ref1 : _j > _ref1; i = 0 <= _ref1 ? ++_j : --_j) { - _results.push(heappop(array, cmp)); - } - return _results; - }; - - _siftdown = function(array, startpos, pos, cmp) { - var newitem, parent, parentpos; - if (cmp == null) { - cmp = defaultCmp; - } - newitem = array[pos]; - while (pos > startpos) { - parentpos = (pos - 1) >> 1; - parent = array[parentpos]; - if (cmp(newitem, parent) < 0) { - array[pos] = parent; - pos = parentpos; - continue; - } - break; - } - return array[pos] = newitem; - }; - - _siftup = function(array, pos, cmp) { - var childpos, endpos, newitem, rightpos, startpos; - if (cmp == null) { - cmp = defaultCmp; - } - endpos = array.length; - startpos = pos; - newitem = array[pos]; - childpos = 2 * pos + 1; - while (childpos < endpos) { - rightpos = childpos + 1; - if (rightpos < endpos && !(cmp(array[childpos], array[rightpos]) < 0)) { - childpos = rightpos; - } - array[pos] = array[childpos]; - pos = childpos; - childpos = 2 * pos + 1; - } - array[pos] = newitem; - return _siftdown(array, startpos, pos, cmp); - }; - - Heap = (function() { - Heap.push = heappush; - - Heap.pop = heappop; - - Heap.replace = heapreplace; - - Heap.pushpop = heappushpop; - - Heap.heapify = heapify; - - Heap.updateItem = updateItem; - - Heap.nlargest = nlargest; - - Heap.nsmallest = nsmallest; - - function Heap(cmp) { - this.cmp = cmp != null ? cmp : defaultCmp; - this.nodes = []; - } - - Heap.prototype.push = function(x) { - return heappush(this.nodes, x, this.cmp); - }; - - Heap.prototype.pop = function() { - return heappop(this.nodes, this.cmp); - }; - - Heap.prototype.peek = function() { - return this.nodes[0]; - }; - - Heap.prototype.contains = function(x) { - return this.nodes.indexOf(x) !== -1; - }; - - Heap.prototype.replace = function(x) { - return heapreplace(this.nodes, x, this.cmp); - }; - - Heap.prototype.pushpop = function(x) { - return heappushpop(this.nodes, x, this.cmp); - }; - - Heap.prototype.heapify = function() { - return heapify(this.nodes, this.cmp); - }; - - Heap.prototype.updateItem = function(x) { - return updateItem(this.nodes, x, this.cmp); - }; - - Heap.prototype.clear = function() { - return this.nodes = []; - }; - - Heap.prototype.empty = function() { - return this.nodes.length === 0; - }; - - Heap.prototype.size = function() { - return this.nodes.length; - }; - - Heap.prototype.clone = function() { - var heap; - heap = new Heap(); - heap.nodes = this.nodes.slice(0); - return heap; - }; - - Heap.prototype.toArray = function() { - return this.nodes.slice(0); - }; - - Heap.prototype.insert = Heap.prototype.push; - - Heap.prototype.top = Heap.prototype.peek; - - Heap.prototype.front = Heap.prototype.peek; - - Heap.prototype.has = Heap.prototype.contains; - - Heap.prototype.copy = Heap.prototype.clone; - - return Heap; - - })(); - - (function(root, factory) { - if (typeof define === 'function' && define.amd) { - return define([], factory); - } else if (typeof exports === 'object') { - return module.exports = factory(); - } else { - return root.Heap = factory(); - } - })(this, function() { - return Heap; - }); - -}).call(this); diff --git a/node_modules/heap/package.json b/node_modules/heap/package.json deleted file mode 100644 index 7956e65ce..000000000 --- a/node_modules/heap/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "_from": "heap@^0.2.6", - "_id": "heap@0.2.6", - "_inBundle": false, - "_integrity": "sha1-CH4fELBGky/IWU3Z5tN4r8nR5aw=", - "_location": "/heap", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "heap@^0.2.6", - "name": "heap", - "escapedName": "heap", - "rawSpec": "^0.2.6", - "saveSpec": null, - "fetchSpec": "^0.2.6" - }, - "_requiredBy": [ - "/cytoscape" - ], - "_resolved": "https://registry.npmjs.org/heap/-/heap-0.2.6.tgz", - "_shasum": "087e1f10b046932fc8594dd9e6d378afc9d1e5ac", - "_spec": "heap@^0.2.6", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/cytoscape", - "author": { - "name": "Xueqiao Xu", - "email": "xueqiaoxu@gmail.com" - }, - "bugs": { - "url": "https://github.com/qiao/heap.js/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "binary heap (priority queue) algorithms (ported from Python's heapq module)", - "devDependencies": { - "coffee-script": "1.3.x", - "mocha": "2.1.x", - "should": "0.6.x" - }, - "homepage": "https://github.com/qiao/heap.js", - "keywords": [ - "algorithm", - "data structure", - "heap" - ], - "licenses": [ - { - "type": "PSF", - "url": "http://docs.python.org/license.html" - } - ], - "main": "./index.js", - "name": "heap", - "repository": { - "type": "git", - "url": "git://github.com/qiao/heap.js.git" - }, - "scripts": { - "test": "make test" - }, - "version": "0.2.6" -} diff --git a/node_modules/heap/src/heap.coffee b/node_modules/heap/src/heap.coffee deleted file mode 100644 index 8d6047393..000000000 --- a/node_modules/heap/src/heap.coffee +++ /dev/null @@ -1,218 +0,0 @@ -{floor, min} = Math - -### -Default comparison function to be used -### -defaultCmp = (x, y) -> - return -1 if x < y - return 1 if x > y - 0 - -### -Insert item x in list a, and keep it sorted assuming a is sorted. - -If x is already in a, insert it to the right of the rightmost x. - -Optional args lo (default 0) and hi (default a.length) bound the slice -of a to be searched. -### -insort = (a, x, lo=0, hi, cmp=defaultCmp) -> - throw new Error('lo must be non-negative') if lo < 0 - hi ?= a.length - while lo < hi - mid = floor((lo + hi) / 2) - if cmp(x, a[mid]) < 0 - hi = mid - else - lo = mid + 1 - a[lo...lo] = x - -### -Push item onto heap, maintaining the heap invariant. -### -heappush = (array, item, cmp=defaultCmp) -> - array.push(item) - _siftdown(array, 0, array.length - 1, cmp) - -### -Pop the smallest item off the heap, maintaining the heap invariant. -### -heappop = (array, cmp=defaultCmp) -> - lastelt = array.pop() - if array.length - returnitem = array[0] - array[0] = lastelt - _siftup(array, 0, cmp) - else - returnitem = lastelt - returnitem - -### -Pop and return the current smallest value, and add the new item. - -This is more efficient than heappop() followed by heappush(), and can be -more appropriate when using a fixed size heap. Note that the value -returned may be larger than item! That constrains reasonable use of -this routine unless written as part of a conditional replacement: - if item > array[0] - item = heapreplace(array, item) -### -heapreplace = (array, item, cmp=defaultCmp) -> - returnitem = array[0] - array[0] = item - _siftup(array, 0, cmp) - returnitem - -### -Fast version of a heappush followed by a heappop. -### -heappushpop = (array, item, cmp=defaultCmp) -> - if array.length and cmp(array[0], item) < 0 - [item, array[0]] = [array[0], item] - _siftup(array, 0, cmp) - item - -### -Transform list into a heap, in-place, in O(array.length) time. -### -heapify = (array, cmp=defaultCmp) -> - for i in [0...floor(array.length / 2)].reverse() - _siftup(array, i, cmp) - -### -Update the position of the given item in the heap. -This function should be called every time the item is being modified. -### -updateItem = (array, item, cmp=defaultCmp) -> - pos = array.indexOf(item) - return if pos is -1 - _siftdown(array, 0, pos, cmp) - _siftup(array, pos, cmp) - -### -Find the n largest elements in a dataset. -### -nlargest = (array, n, cmp=defaultCmp) -> - result = array[0...n] - return result unless result.length - heapify(result, cmp) - heappushpop(result, elem, cmp) for elem in array[n..] - result.sort(cmp).reverse() - -### -Find the n smallest elements in a dataset. -### -nsmallest = (array, n, cmp=defaultCmp) -> - if n * 10 <= array.length - result = array[0...n].sort(cmp) - return result unless result.length - los = result[result.length - 1] - for elem in array[n..] - if cmp(elem, los) < 0 - insort(result, elem, 0, null, cmp) - result.pop() - los = result[result.length - 1] - return result - - heapify(array, cmp) - (heappop(array, cmp) for i in [0...min(n, array.length)]) - -_siftdown = (array, startpos, pos, cmp=defaultCmp) -> - newitem = array[pos] - while pos > startpos - parentpos = (pos - 1) >> 1 - parent = array[parentpos] - if cmp(newitem, parent) < 0 - array[pos] = parent - pos = parentpos - continue - break - array[pos] = newitem - -_siftup = (array, pos, cmp=defaultCmp) -> - endpos = array.length - startpos = pos - newitem = array[pos] - childpos = 2 * pos + 1 - while childpos < endpos - rightpos = childpos + 1 - if rightpos < endpos and not (cmp(array[childpos], array[rightpos]) < 0) - childpos = rightpos - array[pos] = array[childpos] - pos = childpos - childpos = 2 * pos + 1 - array[pos] = newitem - _siftdown(array, startpos, pos, cmp) - -class Heap - @push: heappush - @pop: heappop - @replace: heapreplace - @pushpop: heappushpop - @heapify: heapify - @updateItem: updateItem - @nlargest: nlargest - @nsmallest: nsmallest - - constructor: (@cmp=defaultCmp) -> - @nodes = [] - - push: (x) -> - heappush(@nodes, x, @cmp) - - pop: -> - heappop(@nodes, @cmp) - - peek: -> - @nodes[0] - - contains: (x) -> - @nodes.indexOf(x) isnt -1 - - replace: (x) -> - heapreplace(@nodes, x, @cmp) - - pushpop: (x) -> - heappushpop(@nodes, x, @cmp) - - heapify: -> - heapify(@nodes, @cmp) - - updateItem: (x) -> - updateItem(@nodes, x, @cmp) - - clear: -> - @nodes = [] - - empty: -> - @nodes.length is 0 - - size: -> - @nodes.length - - clone: -> - heap = new Heap() - heap.nodes = @nodes.slice(0) - heap - - toArray: -> - @nodes.slice(0) - - # aliases - insert: @::push - top: @::peek - front: @::peek - has: @::contains - copy: @::clone - - -# exports to global -((root, factory) -> - if typeof define is 'function' and define.amd - define [], factory - else if typeof exports is 'object' - module.exports = factory() - else - root.Heap = factory() -) @, -> Heap - diff --git a/node_modules/heap/test/heap.test.coffee b/node_modules/heap/test/heap.test.coffee deleted file mode 100644 index 6c1d3f21a..000000000 --- a/node_modules/heap/test/heap.test.coffee +++ /dev/null @@ -1,100 +0,0 @@ -Heap = require '..' -{random} = Math - -describe 'Heap#push, Heap#pop', -> - it 'should sort an array using push and pop', -> - heap = new Heap - heap.push(random()) for i in [1..10] - sorted = (heap.pop() until heap.empty()) - sorted.slice().sort().should.eql(sorted) - - it 'should work with custom comparison function', -> - cmp = (a, b) -> - return -1 if a > b - return 1 if a < b - 0 - heap = new Heap(cmp) - heap.push(random()) for i in [1..10] - sorted = (heap.pop() until heap.empty()) - sorted.slice().sort().reverse().should.eql(sorted) - -describe 'Heap#replace', -> - it 'should behave like pop() followed by push()', -> - heap = new Heap - heap.push(v) for v in [1..5] - heap.replace(3).should.eql(1) - heap.toArray().sort().should.eql([2,3,3,4,5]) - -describe 'Heap#pushpop', -> - it 'should behave like push() followed by pop()', -> - heap = new Heap - heap.push(v) for v in [1..5] - heap.pushpop(6).should.eql(1) - heap.toArray().sort().should.eql([2..6]) - -describe 'Heap#contains', -> - it 'should return whether it contains the value', -> - heap = new Heap - heap.push(v) for v in [1..5] - heap.contains(v).should.be.true for v in [1..5] - heap.contains(0).should.be.false - heap.contains(6).should.be.false - -describe 'Heap#peek', -> - it 'should return the top value', -> - heap = new Heap - heap.push(1) - heap.peek().should.eql(1) - heap.push(2) - heap.peek().should.eql(1) - heap.pop() - heap.peek().should.eql(2) - -describe 'Heap#clone', -> - it 'should return a cloned heap', -> - a = new Heap - a.push(v) for v in [1..5] - b = a.clone() - a.toArray().should.eql(b.toArray()) - -describe 'Heap.nsmallest', -> - it 'should return exactly n elements when size() >= n', -> - Heap.nsmallest([1..10], 3).should.eql([1..3]) - - array = [1,3,2,1,3,4,4,2,3,4,5,1,2,3,4,5,2,1,3,4,5,6,7,2] - Heap.nsmallest(array, 2).should.eql([1, 1]) - - it 'should return size() elements when size() <= n', -> - Heap.nsmallest([3..1], 10).should.eql([1..3]) - -describe 'Heap.nlargest', -> - it 'should return exactly n elements when size() >= n', -> - Heap.nlargest([1..10], 3).should.eql([10..8]) - - it 'should return size() elements when size() <= n', -> - Heap.nlargest([3..1], 10).should.eql([3..1]) - -describe 'Heap#updateItem', -> - it 'should return correct order', -> - a = x: 1 - b = x: 2 - c = x: 3 - h = new Heap (m, n) -> m.x - n.x - h.push(a) - h.push(b) - h.push(c) - c.x = 0 - h.updateItem(c) - h.pop().should.eql(c) - it 'should return correct order when used statically', -> - a = x: 1 - b = x: 2 - c = x: 3 - h = [] - cmp = (m, n) -> m.x - n.x - Heap.push(h, a, cmp) - Heap.push(h, b, cmp) - Heap.push(h, c, cmp) - c.x = 0 - Heap.updateItem(h, c, cmp) - Heap.pop(h, cmp).should.eql(c) diff --git a/node_modules/hmac-drbg/.npmignore b/node_modules/hmac-drbg/.npmignore deleted file mode 100644 index 1ca957177..000000000 --- a/node_modules/hmac-drbg/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log diff --git a/node_modules/hmac-drbg/.travis.yml b/node_modules/hmac-drbg/.travis.yml deleted file mode 100644 index ce24b7a77..000000000 --- a/node_modules/hmac-drbg/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -sudo: false - -language: node_js - -node_js: - - "4" - - "6" - - "stable" - -script: - - npm test diff --git a/node_modules/hmac-drbg/README.md b/node_modules/hmac-drbg/README.md deleted file mode 100644 index 7323899fc..000000000 --- a/node_modules/hmac-drbg/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# hmac-drbg -[![Build Status](https://secure.travis-ci.org/indutny/hmac-drbg.svg)](http://travis-ci.org/indutny/hmac-drbg) -[![NPM version](https://badge.fury.io/js/hmac-drbg.svg)](http://badge.fury.io/js/hmac-drbg) - -JS-only implementation of [HMAC DRBG][0]. - -## Usage - -```js -const DRBG = require('hmac-drbg'); -const hash = require('hash.js'); - -const d = new DRBG({ - hash: hash.sha256, - entropy: '0123456789abcdef', - nonce: '0123456789abcdef', - pers: '0123456789abcdef' /* or `null` */ -}); - -d.generate(32, 'hex'); -``` - -#### LICENSE - -This software is licensed under the MIT License. - -Copyright Fedor Indutny, 2017. - -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. - -[0]: http://csrc.nist.gov/groups/ST/toolkit/documents/rng/HashBlockCipherDRBG.pdf diff --git a/node_modules/hmac-drbg/lib/hmac-drbg.js b/node_modules/hmac-drbg/lib/hmac-drbg.js deleted file mode 100644 index 9051a52cd..000000000 --- a/node_modules/hmac-drbg/lib/hmac-drbg.js +++ /dev/null @@ -1,113 +0,0 @@ -'use strict'; - -var hash = require('hash.js'); -var utils = require('minimalistic-crypto-utils'); -var assert = require('minimalistic-assert'); - -function HmacDRBG(options) { - if (!(this instanceof HmacDRBG)) - return new HmacDRBG(options); - this.hash = options.hash; - this.predResist = !!options.predResist; - - this.outLen = this.hash.outSize; - this.minEntropy = options.minEntropy || this.hash.hmacStrength; - - this._reseed = null; - this.reseedInterval = null; - this.K = null; - this.V = null; - - var entropy = utils.toArray(options.entropy, options.entropyEnc || 'hex'); - var nonce = utils.toArray(options.nonce, options.nonceEnc || 'hex'); - var pers = utils.toArray(options.pers, options.persEnc || 'hex'); - assert(entropy.length >= (this.minEntropy / 8), - 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits'); - this._init(entropy, nonce, pers); -} -module.exports = HmacDRBG; - -HmacDRBG.prototype._init = function init(entropy, nonce, pers) { - var seed = entropy.concat(nonce).concat(pers); - - this.K = new Array(this.outLen / 8); - this.V = new Array(this.outLen / 8); - for (var i = 0; i < this.V.length; i++) { - this.K[i] = 0x00; - this.V[i] = 0x01; - } - - this._update(seed); - this._reseed = 1; - this.reseedInterval = 0x1000000000000; // 2^48 -}; - -HmacDRBG.prototype._hmac = function hmac() { - return new hash.hmac(this.hash, this.K); -}; - -HmacDRBG.prototype._update = function update(seed) { - var kmac = this._hmac() - .update(this.V) - .update([ 0x00 ]); - if (seed) - kmac = kmac.update(seed); - this.K = kmac.digest(); - this.V = this._hmac().update(this.V).digest(); - if (!seed) - return; - - this.K = this._hmac() - .update(this.V) - .update([ 0x01 ]) - .update(seed) - .digest(); - this.V = this._hmac().update(this.V).digest(); -}; - -HmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) { - // Optional entropy enc - if (typeof entropyEnc !== 'string') { - addEnc = add; - add = entropyEnc; - entropyEnc = null; - } - - entropy = utils.toArray(entropy, entropyEnc); - add = utils.toArray(add, addEnc); - - assert(entropy.length >= (this.minEntropy / 8), - 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits'); - - this._update(entropy.concat(add || [])); - this._reseed = 1; -}; - -HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) { - if (this._reseed > this.reseedInterval) - throw new Error('Reseed is required'); - - // Optional encoding - if (typeof enc !== 'string') { - addEnc = add; - add = enc; - enc = null; - } - - // Optional additional data - if (add) { - add = utils.toArray(add, addEnc || 'hex'); - this._update(add); - } - - var temp = []; - while (temp.length < len) { - this.V = this._hmac().update(this.V).digest(); - temp = temp.concat(this.V); - } - - var res = temp.slice(0, len); - this._update(add); - this._reseed++; - return utils.encode(res, enc); -}; diff --git a/node_modules/hmac-drbg/package.json b/node_modules/hmac-drbg/package.json deleted file mode 100644 index cad634476..000000000 --- a/node_modules/hmac-drbg/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "_from": "hmac-drbg@^1.0.0", - "_id": "hmac-drbg@1.0.1", - "_inBundle": false, - "_integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "_location": "/hmac-drbg", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "hmac-drbg@^1.0.0", - "name": "hmac-drbg", - "escapedName": "hmac-drbg", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/elliptic" - ], - "_resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "_shasum": "d2745701025a6c775a6c545793ed502fc0c649a1", - "_spec": "hmac-drbg@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/elliptic", - "author": { - "name": "Fedor Indutny", - "email": "fedor@indutny.com" - }, - "bugs": { - "url": "https://github.com/indutny/hmac-drbg/issues" - }, - "bundleDependencies": false, - "dependencies": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - }, - "deprecated": false, - "description": "Deterministic random bit generator (hmac)", - "devDependencies": { - "mocha": "^3.2.0" - }, - "homepage": "https://github.com/indutny/hmac-drbg#readme", - "keywords": [ - "hmac", - "drbg", - "prng" - ], - "license": "MIT", - "main": "lib/hmac-drbg.js", - "name": "hmac-drbg", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/indutny/hmac-drbg.git" - }, - "scripts": { - "test": "mocha --reporter=spec test/*-test.js" - }, - "version": "1.0.1" -} diff --git a/node_modules/hmac-drbg/test/drbg-test.js b/node_modules/hmac-drbg/test/drbg-test.js deleted file mode 100644 index 14fd28a84..000000000 --- a/node_modules/hmac-drbg/test/drbg-test.js +++ /dev/null @@ -1,91 +0,0 @@ -'use strict'; - -const assert = require('assert'); -const HmacDRBG = require('../'); -const hash = require('hash.js'); - -describe('Hmac_DRBG', () => { - it('should support hmac-drbg-sha256', () => { - function doDrbg(opt) { - const drbg = HmacDRBG({ - hash: hash.sha256, - entropy: opt.entropy, - entropyEnc: 'utf8', - nonce: opt.nonce, - nonceEnc: 'utf8', - pers: opt.pers, - persEnc: 'utf8' - }); - return drbg.generate(opt.size, 'hex'); - } - - const test = [ - { - entropy: 'totally random0123456789', - nonce: 'secret nonce', - pers: 'my drbg', - size: 32, - res: '018ec5f8e08c41e5ac974eb129ac297c5388ee1864324fa13d9b15cf98d9a157' - }, - { - entropy: 'totally random0123456789', - nonce: 'secret nonce', - pers: null, - size: 32, - res: 'ed5d61ecf0ef38258e62f03bbb49f19f2cd07ba5145a840d83b134d5963b3633' - } - ]; - for (let i = 0; i < test.length; i++) - assert.equal(doDrbg(test[i]), test[i].res); - }); - - describe('NIST vector', function() { - require('./fixtures/hmac-drbg-nist.json').forEach(function (opt) { - it('should not fail at ' + opt.name, function() { - const drbg = HmacDRBG({ - hash: hash.sha256, - entropy: opt.entropy, - nonce: opt.nonce, - pers: opt.pers - }); - - let last; - for (let i = 0; i < opt.add.length; i++) { - let add = opt.add[i]; - last = drbg.generate(opt.expected.length / 2, 'hex', add); - } - assert.equal(last, opt.expected); - }); - }); - }); - - describe('reseeding', function() { - it('should reseed', function() { - const entropy = 'totally random string with many chars that I typed ' + - 'in agony'; - const nonce = 'nonce'; - const pers = 'pers'; - - const original = HmacDRBG({ - hash: hash.sha256, - entropy, - nonce, - pers - }); - const reseeded = HmacDRBG({ - hash: hash.sha256, - entropy, - nonce, - pers - }); - - assert.strictEqual(original.generate(32, 'hex'), - reseeded.generate(32, 'hex')); - - reseeded.reseed('another absolutely random string'); - - assert.notEqual(original.generate(32, 'hex'), - reseeded.generate(32, 'hex')); - }); - }); -}); diff --git a/node_modules/hmac-drbg/test/fixtures/hmac-drbg-nist.json b/node_modules/hmac-drbg/test/fixtures/hmac-drbg-nist.json deleted file mode 100644 index fce148a8e..000000000 --- a/node_modules/hmac-drbg/test/fixtures/hmac-drbg-nist.json +++ /dev/null @@ -1,332 +0,0 @@ -[ - { - "name": "0", - "entropy": "ca851911349384bffe89de1cbdc46e6831e44d34a4fb935ee285dd14b71a7488", - "nonce": "659ba96c601dc69fc902940805ec0ca8", - "pers": null, - "add": [ - null, - null - ], - "expected": "e528e9abf2dece54d47c7e75e5fe302149f817ea9fb4bee6f4199697d04d5b89d54fbb978a15b5c443c9ec21036d2460b6f73ebad0dc2aba6e624abf07745bc107694bb7547bb0995f70de25d6b29e2d3011bb19d27676c07162c8b5ccde0668961df86803482cb37ed6d5c0bb8d50cf1f50d476aa0458bdaba806f48be9dcb8" - }, - { - "name": "1", - "entropy": "79737479ba4e7642a221fcfd1b820b134e9e3540a35bb48ffae29c20f5418ea3", - "nonce": "3593259c092bef4129bc2c6c9e19f343", - "pers": null, - "add": [ - null, - null - ], - "expected": "cf5ad5984f9e43917aa9087380dac46e410ddc8a7731859c84e9d0f31bd43655b924159413e2293b17610f211e09f770f172b8fb693a35b85d3b9e5e63b1dc252ac0e115002e9bedfb4b5b6fd43f33b8e0eafb2d072e1a6fee1f159df9b51e6c8da737e60d5032dd30544ec51558c6f080bdbdab1de8a939e961e06b5f1aca37" - }, - { - "name": "2", - "entropy": "b340907445b97a8b589264de4a17c0bea11bb53ad72f9f33297f05d2879d898d", - "nonce": "65cb27735d83c0708f72684ea58f7ee5", - "pers": null, - "add": [ - null, - null - ], - "expected": "75183aaaf3574bc68003352ad655d0e9ce9dd17552723b47fab0e84ef903694a32987eeddbdc48efd24195dbdac8a46ba2d972f5808f23a869e71343140361f58b243e62722088fe10a98e43372d252b144e00c89c215a76a121734bdc485486f65c0b16b8963524a3a70e6f38f169c12f6cbdd169dd48fe4421a235847a23ff" - }, - { - "name": "3", - "entropy": "8e159f60060a7d6a7e6fe7c9f769c30b98acb1240b25e7ee33f1da834c0858e7", - "nonce": "c39d35052201bdcce4e127a04f04d644", - "pers": null, - "add": [ - null, - null - ], - "expected": "62910a77213967ea93d6457e255af51fc79d49629af2fccd81840cdfbb4910991f50a477cbd29edd8a47c4fec9d141f50dfde7c4d8fcab473eff3cc2ee9e7cc90871f180777a97841597b0dd7e779eff9784b9cc33689fd7d48c0dcd341515ac8fecf5c55a6327aea8d58f97220b7462373e84e3b7417a57e80ce946d6120db5" - }, - { - "name": "4", - "entropy": "74755f196305f7fb6689b2fe6835dc1d81484fc481a6b8087f649a1952f4df6a", - "nonce": "c36387a544a5f2b78007651a7b74b749", - "pers": null, - "add": [ - null, - null - ], - "expected": "b2896f3af4375dab67e8062d82c1a005ef4ed119d13a9f18371b1b873774418684805fd659bfd69964f83a5cfe08667ddad672cafd16befffa9faed49865214f703951b443e6dca22edb636f3308380144b9333de4bcb0735710e4d9266786342fc53babe7bdbe3c01a3addb7f23c63ce2834729fabbd419b47beceb4a460236" - }, - { - "name": "5", - "entropy": "4b222718f56a3260b3c2625a4cf80950b7d6c1250f170bd5c28b118abdf23b2f", - "nonce": "7aed52d0016fcaef0b6492bc40bbe0e9", - "pers": null, - "add": [ - null, - null - ], - "expected": "a6da029b3665cd39fd50a54c553f99fed3626f4902ffe322dc51f0670dfe8742ed48415cf04bbad5ed3b23b18b7892d170a7dcf3ef8052d5717cb0c1a8b3010d9a9ea5de70ae5356249c0e098946030c46d9d3d209864539444374d8fbcae068e1d6548fa59e6562e6b2d1acbda8da0318c23752ebc9be0c1c1c5b3cf66dd967" - }, - { - "name": "6", - "entropy": "b512633f27fb182a076917e39888ba3ff35d23c3742eb8f3c635a044163768e0", - "nonce": "e2c39b84629a3de5c301db5643af1c21", - "pers": null, - "add": [ - null, - null - ], - "expected": "fb931d0d0194a97b48d5d4c231fdad5c61aedf1c3a55ac24983ecbf38487b1c93396c6b86ff3920cfa8c77e0146de835ea5809676e702dee6a78100da9aa43d8ec0bf5720befa71f82193205ac2ea403e8d7e0e6270b366dc4200be26afd9f63b7e79286a35c688c57cbff55ac747d4c28bb80a2b2097b3b62ea439950d75dff" - }, - { - "name": "7", - "entropy": "aae3ffc8605a975befefcea0a7a286642bc3b95fb37bd0eb0585a4cabf8b3d1e", - "nonce": "9504c3c0c4310c1c0746a036c91d9034", - "pers": null, - "add": [ - null, - null - ], - "expected": "2819bd3b0d216dad59ddd6c354c4518153a2b04374b07c49e64a8e4d055575dfbc9a8fcde68bd257ff1ba5c6000564b46d6dd7ecd9c5d684fd757df62d85211575d3562d7814008ab5c8bc00e7b5a649eae2318665b55d762de36eba00c2906c0e0ec8706edb493e51ca5eb4b9f015dc932f262f52a86b11c41e9a6d5b3bd431" - }, - { - "name": "8", - "entropy": "b9475210b79b87180e746df704b3cbc7bf8424750e416a7fbb5ce3ef25a82cc6", - "nonce": "24baf03599c10df6ef44065d715a93f7", - "pers": null, - "add": [ - null, - null - ], - "expected": "ae12d784f796183c50db5a1a283aa35ed9a2b685dacea97c596ff8c294906d1b1305ba1f80254eb062b874a8dfffa3378c809ab2869aa51a4e6a489692284a25038908a347342175c38401193b8afc498077e10522bec5c70882b7f760ea5946870bd9fc72961eedbe8bff4fd58c7cc1589bb4f369ed0d3bf26c5bbc62e0b2b2" - }, - { - "name": "9", - "entropy": "27838eb44ceccb4e36210703ebf38f659bc39dd3277cd76b7a9bcd6bc964b628", - "nonce": "39cfe0210db2e7b0eb52a387476e7ea1", - "pers": null, - "add": [ - null, - null - ], - "expected": "e5e72a53605d2aaa67832f97536445ab774dd9bff7f13a0d11fd27bf6593bfb52309f2d4f09d147192199ea584503181de87002f4ee085c7dc18bf32ce5315647a3708e6f404d6588c92b2dda599c131aa350d18c747b33dc8eda15cf40e95263d1231e1b4b68f8d829f86054d49cfdb1b8d96ab0465110569c8583a424a099a" - }, - { - "name": "10", - "entropy": "d7129e4f47008ad60c9b5d081ff4ca8eb821a6e4deb91608bf4e2647835373a5", - "nonce": "a72882773f78c2fc4878295840a53012", - "pers": null, - "add": [ - null, - null - ], - "expected": "0cbf48585c5de9183b7ff76557f8fc9ebcfdfde07e588a8641156f61b7952725bbee954f87e9b937513b16bba0f2e523d095114658e00f0f3772175acfcb3240a01de631c19c5a834c94cc58d04a6837f0d2782fa53d2f9f65178ee9c837222494c799e64c60406069bd319549b889fa00a0032dd7ba5b1cc9edbf58de82bfcd" - }, - { - "name": "11", - "entropy": "67fe5e300c513371976c80de4b20d4473889c9f1214bce718bc32d1da3ab7532", - "nonce": "e256d88497738a33923aa003a8d7845c", - "pers": null, - "add": [ - null, - null - ], - "expected": "b44660d64ef7bcebc7a1ab71f8407a02285c7592d755ae6766059e894f694373ed9c776c0cfc8594413eefb400ed427e158d687e28da3ecc205e0f7370fb089676bbb0fa591ec8d916c3d5f18a3eb4a417120705f3e2198154cd60648dbfcfc901242e15711cacd501b2c2826abe870ba32da785ed6f1fdc68f203d1ab43a64f" - }, - { - "name": "12", - "entropy": "de8142541255c46d66efc6173b0fe3ffaf5936c897a3ce2e9d5835616aafa2cb", - "nonce": "d01f9002c407127bc3297a561d89b81d", - "pers": null, - "add": [ - null, - null - ], - "expected": "64d1020929d74716446d8a4e17205d0756b5264867811aa24d0d0da8644db25d5cde474143c57d12482f6bf0f31d10af9d1da4eb6d701bdd605a8db74fb4e77f79aaa9e450afda50b18d19fae68f03db1d7b5f1738d2fdce9ad3ee9461b58ee242daf7a1d72c45c9213eca34e14810a9fca5208d5c56d8066bab1586f1513de7" - }, - { - "name": "13", - "entropy": "4a8e0bd90bdb12f7748ad5f147b115d7385bb1b06aee7d8b76136a25d779bcb7", - "nonce": "7f3cce4af8c8ce3c45bdf23c6b181a00", - "pers": null, - "add": [ - null, - null - ], - "expected": "320c7ca4bbeb7af977bc054f604b5086a3f237aa5501658112f3e7a33d2231f5536d2c85c1dad9d9b0bf7f619c81be4854661626839c8c10ae7fdc0c0b571be34b58d66da553676167b00e7d8e49f416aacb2926c6eb2c66ec98bffae20864cf92496db15e3b09e530b7b9648be8d3916b3c20a3a779bec7d66da63396849aaf" - }, - { - "name": "14", - "entropy": "451ed024bc4b95f1025b14ec3616f5e42e80824541dc795a2f07500f92adc665", - "nonce": "2f28e6ee8de5879db1eccd58c994e5f0", - "pers": null, - "add": [ - null, - null - ], - "expected": "3fb637085ab75f4e95655faae95885166a5fbb423bb03dbf0543be063bcd48799c4f05d4e522634d9275fe02e1edd920e26d9accd43709cb0d8f6e50aa54a5f3bdd618be23cf73ef736ed0ef7524b0d14d5bef8c8aec1cf1ed3e1c38a808b35e61a44078127c7cb3a8fd7addfa50fcf3ff3bc6d6bc355d5436fe9b71eb44f7fd" - }, - { - "name": "0 with additional data", - "entropy": "d3cc4d1acf3dde0c4bd2290d262337042dc632948223d3a2eaab87da44295fbd", - "nonce": "0109b0e729f457328aa18569a9224921", - "pers": null, - "add": [ - "3c311848183c9a212a26f27f8c6647e40375e466a0857cc39c4e47575d53f1f6", - "fcb9abd19ccfbccef88c9c39bfb3dd7b1c12266c9808992e305bc3cff566e4e4" - ], - "expected": "9c7b758b212cd0fcecd5daa489821712e3cdea4467b560ef5ddc24ab47749a1f1ffdbbb118f4e62fcfca3371b8fbfc5b0646b83e06bfbbab5fac30ea09ea2bc76f1ea568c9be0444b2cc90517b20ca825f2d0eccd88e7175538b85d90ab390183ca6395535d34473af6b5a5b88f5a59ee7561573337ea819da0dcc3573a22974" - }, - { - "name": "1 with additional data", - "entropy": "f97a3cfd91faa046b9e61b9493d436c4931f604b22f1081521b3419151e8ff06", - "nonce": "11f3a7d43595357d58120bd1e2dd8aed", - "pers": null, - "add": [ - "517289afe444a0fe5ed1a41dbbb5eb17150079bdd31e29cf2ff30034d8268e3b", - "88028d29ef80b4e6f0fe12f91d7449fe75062682e89c571440c0c9b52c42a6e0" - ], - "expected": "c6871cff0824fe55ea7689a52229886730450e5d362da5bf590dcf9acd67fed4cb32107df5d03969a66b1f6494fdf5d63d5b4d0d34ea7399a07d0116126d0d518c7c55ba46e12f62efc8fe28a51c9d428e6d371d7397ab319fc73ded4722e5b4f30004032a6128df5e7497ecf82ca7b0a50e867ef6728a4f509a8c859087039c" - }, - { - "name": "2 with additional data", - "entropy": "0f2f23d64f481cabec7abb01db3aabf125c3173a044b9bf26844300b69dcac8b", - "nonce": "9a5ae13232b43aa19cfe8d7958b4b590", - "pers": null, - "add": [ - "ec4c7a62acab73385f567da10e892ff395a0929f959231a5628188ce0c26e818", - "6b97b8c6b6bb8935e676c410c17caa8042aa3145f856d0a32b641e4ae5298648" - ], - "expected": "7480a361058bd9afa3db82c9d7586e42269102013f6ec5c269b6d05f17987847748684766b44918fd4b65e1648622fc0e0954178b0279dfc9fa99b66c6f53e51c4860131e9e0644287a4afe4ca8e480417e070db68008a97c3397e4b320b5d1a1d7e1d18a95cfedd7d1e74997052bf649d132deb9ec53aae7dafdab55e6dae93" - }, - { - "name": "3 with additional data", - "entropy": "53c56660c78481be9c63284e005fcc14fbc7fb27732c9bf1366d01a426765a31", - "nonce": "dc7a14d0eb5b0b3534e717a0b3c64614", - "pers": null, - "add": [ - "3aa848706ecb877f5bedf4ffc332d57c22e08747a47e75cff6f0fd1316861c95", - "9a401afa739b8f752fddacd291e0b854f5eff4a55b515e20cb319852189d3722" - ], - "expected": "5c0eb420e0bf41ce9323e815310e4e8303cd677a8a8b023f31f0d79f0ca15aeb636099a369fd074d69889865eac1b72ab3cbfebdb8cf460b00072802e2ec648b1349a5303be4ccaadd729f1a9ea17482fd026aaeb93f1602bc1404b9853adde40d6c34b844cf148bc088941ecfc1642c8c0b9778e45f3b07e06e21ee2c9e0300" - }, - { - "name": "4 with additional data", - "entropy": "f63c804404902db334c54bb298fc271a21d7acd9f770278e089775710bf4fdd7", - "nonce": "3e45009ea9cb2a36ba1aa4bf39178200", - "pers": null, - "add": [ - "d165a13dc8cc43f3f0952c3f5d3de4136954d983683d4a3e6d2dc4c89bf23423", - "75106bc86d0336df85097f6af8e80e2da59046a03fa65b06706b8bbc7ffc6785" - ], - "expected": "6363139bba32c22a0f5cd23ca6d437b5669b7d432f786b8af445471bee0b2d24c9d5f2f93717cbe00d1f010cc3b9c515fc9f7336d53d4d26ba5c0d76a90186663c8582eb739c7b6578a3328bf68dc2cec2cd89b3a90201f6993adcc854df0f5c6974d0f5570765a15fe03dbce28942dd2fd16ba2027e68abac83926969349af8" - }, - { - "name": "5 with additional data", - "entropy": "2aaca9147da66c176615726b69e3e851cc3537f5f279fe7344233d8e44cfc99d", - "nonce": "4e171f080af9a6081bee9f183ac9e340", - "pers": null, - "add": [ - "d75a2a6eb66c3833e50f5ec3d2e434cf791448d618026d0c360806d120ded669", - "b643b74c15b37612e6577ed7ca2a4c67a78d560af9eb50a4108fca742e87b8d6" - ], - "expected": "501dcdc977f4ba856f24eaa4968b374bebb3166b280334cb510232c31ebffde10fa47b7840ef3fe3b77725c2272d3a1d4219baf23e0290c622271edcced58838cf428f0517425d2e19e0d8c89377eecfc378245f283236fafa466c914b99672ceafab369e8889a0c866d8bd639db9fb797254262c6fd44cfa9045ad6340a60ef" - }, - { - "name": "6 with additional data", - "entropy": "a2e4cd48a5cf918d6f55942d95fcb4e8465cdc4f77b7c52b6fae5b16a25ca306", - "nonce": "bef036716440db6e6d333d9d760b7ca8", - "pers": null, - "add": [ - "bfa591c7287f3f931168f95e38869441d1f9a11035ad8ea625bb61b9ea17591c", - "c00c735463bca215adc372cb892b05e939bf669583341c06d4e31d0e5b363a37" - ], - "expected": "e7d136af69926a5421d4266ee0420fd729f2a4f7c295d3c966bdfa05268180b508b8a2852d1b3a06fd2ab3e13c54005123ef319f42d0c6d3a575e6e7e1496cb28aacadbcf83740fba8f35fcee04bb2ed8a51db3d3362b01094a62fb57e33c99a432f29fce6676cffbbcc05107e794e75e44a02d5e6d9d748c5fbff00a0178d65" - }, - { - "name": "7 with additional data", - "entropy": "95a67771cba69011a79776e713145d309edae56fad5fd6d41d83eaff89df6e5e", - "nonce": "be5b5164e31ecc51ba6f7c3c5199eb33", - "pers": null, - "add": [ - "065f693b229a7c4fd373cd15b3807552dd9bf98c5485cef361949d4e7d774b53", - "9afb62406f0e812c4f156d58b19a656c904813c1b4a45a0029ae7f50731f8014" - ], - "expected": "f61b61a6e79a41183e8ed6647899d2dc85cdaf5c3abf5c7f3bf37685946dc28f4923dc842f2d4326bd6ce0d50a84cb3ba869d72a36e246910eba6512ba36cd7ed3a5437c9245b00a344308c792b668b458d3c3e16dee2fbec41867da31084d46d8ec168de2148ef64fc5b72069abf5a6ada1ead2b7146bb793ff1c9c3690fa56" - }, - { - "name": "8 with additional data", - "entropy": "a459e1815cbca4514ec8094d5ab2414a557ba6fe10e613c345338d0521e4bf90", - "nonce": "62221392e2552e76cd0d36df6e6068eb", - "pers": null, - "add": [ - "0a3642b02b23b3ef62c701a63401124022f5b896de86dab6e6c7451497aa1dcc", - "c80514865901371c45ba92d9f95d50bb7c9dd1768cb3dfbc45b968da94965c6e" - ], - "expected": "464e6977b8adaef307c9623e41c357013249c9ffd77f405f3925cebb69f151ce8fbb6a277164002aee7858fc224f6499042aa1e6322deee9a5d133c31d640e12a7487c731ba03ad866a24675badb1d79220c40be689f79c2a0be93cb4dada3e0eac4ab140cb91998b6f11953e68f2319b050c40f71c34de9905ae41b2de1c2f6" - }, - { - "name": "9 with additional data", - "entropy": "252c2cad613e002478162861880979ee4e323025eebb6fb2e0aa9f200e28e0a1", - "nonce": "d001bc9a8f2c8c242e4369df0c191989", - "pers": null, - "add": [ - "9bcfc61cb2bc000034bb3db980eb47c76fb5ecdd40553eff113368d639b947fd", - "8b0565c767c2610ee0014582e9fbecb96e173005b60e9581503a6dca5637a26e" - ], - "expected": "e96c15fe8a60692b0a7d67171e0195ff6e1c87aab844221e71700d1bbee75feea695f6a740c9760bbe0e812ecf4061d8f0955bc0195e18c4fd1516ebca50ba6a6db86881737dbab8321707675479b87611db6af2c97ea361a5484555ead454defb1a64335de964fc803d40f3a6f057893d2afc25725754f4f00abc51920743dc" - }, - { - "name": "10 with additional data", - "entropy": "8be0ca6adc8b3870c9d69d6021bc1f1d8eb9e649073d35ee6c5aa0b7e56ad8a5", - "nonce": "9d1265f7d51fdb65377f1e6edd6ae0e4", - "pers": null, - "add": [ - "da86167ac997c406bb7979f423986a84ec6614d6caa7afc10aff0699a9b2cf7f", - "e4baa3c555950b53e2bfdba480cb4c94b59381bac1e33947e0c22e838a9534cf" - ], - "expected": "64384ecc4ea6b458efc227ca697eac5510092265520c0a0d8a0ccf9ed3ca9d58074671188c6a7ad16d0b050cdc072c125d7298d3a31d9f044a9ee40da0089a84fea28cc7f05f1716db952fad29a0e779635cb7a912a959be67be2f0a4170aace2981802e2ff6467e5b46f0ffbff3b42ba5935fd553c82482ac266acf1cd247d7" - }, - { - "name": "11 with additional data", - "entropy": "d43a75b6adf26d60322284cb12ac38327792442aa8f040f60a2f331b33ac4a8f", - "nonce": "0682f8b091f811afacaacaec9b04d279", - "pers": null, - "add": [ - "7fd3b8f512940da7de5d80199d9a7b42670c04a945775a3dba869546cbb9bc65", - "2575db20bc7aafc2a90a5dabab760db851d754777bc9f05616af1858b24ff3da" - ], - "expected": "0da7a8dc73c163014bf0841913d3067806456bbca6d5de92b85534c6545467313648d71ef17c923d090dc92cff8d4d1a9a2bb63e001dc2e8ab1a597999be3d6cf70ff63fee9985801395fbd4f4990430c4259fcae4fa1fcd73dc3187ccc102d04af7c07532885e5a226fc42809c48f22eecf4f6ab996ae4fcb144786957d9f41" - }, - { - "name": "12 with additional data", - "entropy": "64352f236af5d32067a529a8fd05ba00a338c9de306371a0b00c36e610a48d18", - "nonce": "df99ed2c7608c870624b962a5dc68acd", - "pers": null, - "add": [ - "da416335e7aaf60cf3d06fb438735ce796aad09034f8969c8f8c3f81e32fef24", - "a28c07c21a2297311adf172c19e83ca0a87731bdffb80548978d2d1cd82cf8a3" - ], - "expected": "132b9f25868729e3853d3c51f99a3b5fae6d4204bea70890daf62e042b776a526c8fb831b80a6d5d3f153237df1fd39b6fd9137963f5516d9cdd4e3f9195c46e9972c15d3edc6606e3368bde1594977fb88d0ca6e6f5f3d057ccadc7d7dab77dfc42658a1e972aa446b20d418286386a52dfc1c714d2ac548713268b0b709729" - }, - { - "name": "13 with additional data", - "entropy": "282f4d2e05a2cd30e9087f5633089389449f04bac11df718c90bb351cd3653a5", - "nonce": "90a7daf3c0de9ea286081efc4a684dfb", - "pers": null, - "add": [ - "2630b4ccc7271cc379cb580b0aaede3d3aa8c1c7ba002cf791f0752c3d739007", - "c31d69de499f1017be44e3d4fa77ecebc6a9b9934749fcf136f267b29115d2cc" - ], - "expected": "c899094520e0197c37b91dd50778e20a5b950decfb308d39f1db709447ae48f6101d9abe63a783fbb830eec1d359a5f61a2013728966d349213ee96382614aa4135058a967627183810c6622a2158cababe3b8ab99169c89e362108bf5955b4ffc47440f87e4bad0d36bc738e737e072e64d8842e7619f1be0af1141f05afe2d" - }, - { - "name": "14 with additional data", - "entropy": "13c752b9e745ce77bbc7c0dbda982313d3fe66f903e83ebd8dbe4ff0c11380e9", - "nonce": "f1a533095d6174164bd7c82532464ae7", - "pers": null, - "add": [ - "4f53db89b9ba7fc00767bc751fb8f3c103fe0f76acd6d5c7891ab15b2b7cf67c", - "582c2a7d34679088cca6bd28723c99aac07db46c332dc0153d1673256903b446" - ], - "expected": "6311f4c0c4cd1f86bd48349abb9eb930d4f63df5e5f7217d1d1b91a71d8a6938b0ad2b3e897bd7e3d8703db125fab30e03464fad41e5ddf5bf9aeeb5161b244468cfb26a9d956931a5412c97d64188b0da1bd907819c686f39af82e91cfeef0cbffb5d1e229e383bed26d06412988640706815a6e820796876f416653e464961" - } -] diff --git a/node_modules/htmlescape/.npmignore b/node_modules/htmlescape/.npmignore deleted file mode 100644 index e2a6af879..000000000 --- a/node_modules/htmlescape/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -/.gitignore -/CHANGELOG.md -/LICENSE -/test diff --git a/node_modules/htmlescape/CHANGELOG.md b/node_modules/htmlescape/CHANGELOG.md deleted file mode 100644 index d03d62042..000000000 --- a/node_modules/htmlescape/CHANGELOG.md +++ /dev/null @@ -1,9 +0,0 @@ -1.0.0 / 2014-09-29 -================== - - * No more API changes - -0.0.1 / 2014-09-28 -================== - - * Initial release diff --git a/node_modules/htmlescape/LICENSE b/node_modules/htmlescape/LICENSE deleted file mode 100644 index bdff13e87..000000000 --- a/node_modules/htmlescape/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Andres Suarez - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/htmlescape/README.md b/node_modules/htmlescape/README.md deleted file mode 100644 index 870ba1669..000000000 --- a/node_modules/htmlescape/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# htmlescape - -Properly escape JSON for usage as an object literal inside of a ` -``` diff --git a/node_modules/htmlescape/htmlescape.js b/node_modules/htmlescape/htmlescape.js deleted file mode 100644 index 5f0ce6c72..000000000 --- a/node_modules/htmlescape/htmlescape.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Properly escape JSON for usage as an object literal inside of a ` - - diff --git a/node_modules/hyperx/example/deku/main.js b/node_modules/hyperx/example/deku/main.js deleted file mode 100644 index 15cff4505..000000000 --- a/node_modules/hyperx/example/deku/main.js +++ /dev/null @@ -1,23 +0,0 @@ -var deku = require('deku') -var hyperx = require('../..') -var hx = hyperx(deku.element) - -var render = deku.createApp(document.querySelector('#content')) - -var state = { - times: 0 -} - -rerender() - -function rerender () { - render(hx`
    -

    clicked ${state.times} times

    - -
    `) - - function increment () { - state.times += 1 - rerender() - } -} diff --git a/node_modules/hyperx/example/deku/package.json b/node_modules/hyperx/example/deku/package.json deleted file mode 100644 index 851145e48..000000000 --- a/node_modules/hyperx/example/deku/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "scripts": { - "watch": "watchify main.js -o bundle.js -dv", - "build": "browserify main.js > bundle.js" - } -} diff --git a/node_modules/hyperx/example/hyperscript.js b/node_modules/hyperx/example/hyperscript.js deleted file mode 100644 index 9e43a283e..000000000 --- a/node_modules/hyperx/example/hyperscript.js +++ /dev/null @@ -1,15 +0,0 @@ -var h = require('hyperscript') -var hyperx = require('../') -var hx = hyperx(h) - -var title = 'world' -var wow = [1,2,3] -var tree = hx`
    -

    hello ${title}!

    - ${hx`cool`} - wow - ${wow.map(function (w) { - return hx`${w}\n` - })} -
    ` -console.log(tree.outerHTML) diff --git a/node_modules/hyperx/example/main_loop/index.html b/node_modules/hyperx/example/main_loop/index.html deleted file mode 100644 index f170d108e..000000000 --- a/node_modules/hyperx/example/main_loop/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - -
    - - - diff --git a/node_modules/hyperx/example/main_loop/main.js b/node_modules/hyperx/example/main_loop/main.js deleted file mode 100644 index 3ed6fb4e9..000000000 --- a/node_modules/hyperx/example/main_loop/main.js +++ /dev/null @@ -1,18 +0,0 @@ -var vdom = require('virtual-dom') -var hyperx = require('../../') -var hx = hyperx(vdom.h) - -var main = require('main-loop') -var loop = main({ times: 0 }, render, vdom) -document.querySelector('#content').appendChild(loop.target) - -function render (state) { - return hx`
    -

    clicked ${state.times} times

    - -
    ` - - function onclick () { - loop.update({ times: state.times + 1 }) - } -} diff --git a/node_modules/hyperx/example/main_loop/package.json b/node_modules/hyperx/example/main_loop/package.json deleted file mode 100644 index 851145e48..000000000 --- a/node_modules/hyperx/example/main_loop/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "scripts": { - "watch": "watchify main.js -o bundle.js -dv", - "build": "browserify main.js > bundle.js" - } -} diff --git a/node_modules/hyperx/example/react.js b/node_modules/hyperx/example/react.js deleted file mode 100644 index 88bbd779d..000000000 --- a/node_modules/hyperx/example/react.js +++ /dev/null @@ -1,16 +0,0 @@ -var React = require('react') -var toString = require('react-dom/server').renderToString -var hyperx = require('../') -var hx = hyperx(React.createElement) - -var title = 'world' -var wow = [1,2,3] -var tree = hx`
    -

    hello ${title}!

    - ${hx`cool`} - wow - ${wow.map(function (w, i) { - return hx`${w}\n` - })} -
    ` -console.log(toString(tree)) diff --git a/node_modules/hyperx/example/react_browser/index.html b/node_modules/hyperx/example/react_browser/index.html deleted file mode 100644 index f170d108e..000000000 --- a/node_modules/hyperx/example/react_browser/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - -
    - - - diff --git a/node_modules/hyperx/example/react_browser/main.js b/node_modules/hyperx/example/react_browser/main.js deleted file mode 100644 index 983e68eaf..000000000 --- a/node_modules/hyperx/example/react_browser/main.js +++ /dev/null @@ -1,18 +0,0 @@ -var React = require('react') -var render = require('react-dom').render -var hyperx = require('../../') -var hx = hyperx(React.createElement) - -var App = React.createClass({ - getInitialState: function () { return { n: 0 } }, - render: function () { - return hx`
    -

    clicked ${this.state.n} times

    - -
    ` - }, - handleClick: function () { - this.setState({ n: this.state.n + 1 }) - } -}) -render(React.createElement(App), document.querySelector('#content')) diff --git a/node_modules/hyperx/example/react_browser/package.json b/node_modules/hyperx/example/react_browser/package.json deleted file mode 100644 index 851145e48..000000000 --- a/node_modules/hyperx/example/react_browser/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "scripts": { - "watch": "watchify main.js -o bundle.js -dv", - "build": "browserify main.js > bundle.js" - } -} diff --git a/node_modules/hyperx/example/vdom.js b/node_modules/hyperx/example/vdom.js deleted file mode 100644 index d7e771449..000000000 --- a/node_modules/hyperx/example/vdom.js +++ /dev/null @@ -1,15 +0,0 @@ -var vdom = require('virtual-dom') -var hyperx = require('../') -var hx = hyperx(vdom.h) - -var title = 'world' -var wow = [1,2,3] -var tree = hx`
    -

    hello ${title}!

    - ${hx`cool`} - wow - ${wow.map(function (w, i) { - return hx`${w}\n` - })} -
    ` -console.log(vdom.create(tree).toString()) diff --git a/node_modules/hyperx/index.js b/node_modules/hyperx/index.js deleted file mode 100644 index cf19752b7..000000000 --- a/node_modules/hyperx/index.js +++ /dev/null @@ -1,294 +0,0 @@ -var attrToProp = require('hyperscript-attribute-to-property') - -var VAR = 0, TEXT = 1, OPEN = 2, CLOSE = 3, ATTR = 4 -var ATTR_KEY = 5, ATTR_KEY_W = 6 -var ATTR_VALUE_W = 7, ATTR_VALUE = 8 -var ATTR_VALUE_SQ = 9, ATTR_VALUE_DQ = 10 -var ATTR_EQ = 11, ATTR_BREAK = 12 -var COMMENT = 13 - -module.exports = function (h, opts) { - if (!opts) opts = {} - var concat = opts.concat || function (a, b) { - return String(a) + String(b) - } - if (opts.attrToProp !== false) { - h = attrToProp(h) - } - - return function (strings) { - var state = TEXT, reg = '' - var arglen = arguments.length - var parts = [] - - for (var i = 0; i < strings.length; i++) { - if (i < arglen - 1) { - var arg = arguments[i+1] - var p = parse(strings[i]) - var xstate = state - if (xstate === ATTR_VALUE_DQ) xstate = ATTR_VALUE - if (xstate === ATTR_VALUE_SQ) xstate = ATTR_VALUE - if (xstate === ATTR_VALUE_W) xstate = ATTR_VALUE - if (xstate === ATTR) xstate = ATTR_KEY - if (xstate === OPEN) { - if (reg === '/') { - p.push([ OPEN, '/', arg ]) - reg = '' - } else { - p.push([ OPEN, arg ]) - } - } else { - p.push([ VAR, xstate, arg ]) - } - parts.push.apply(parts, p) - } else parts.push.apply(parts, parse(strings[i])) - } - - var tree = [null,{},[]] - var stack = [[tree,-1]] - for (var i = 0; i < parts.length; i++) { - var cur = stack[stack.length-1][0] - var p = parts[i], s = p[0] - if (s === OPEN && /^\//.test(p[1])) { - var ix = stack[stack.length-1][1] - if (stack.length > 1) { - stack.pop() - stack[stack.length-1][0][2][ix] = h( - cur[0], cur[1], cur[2].length ? cur[2] : undefined - ) - } - } else if (s === OPEN) { - var c = [p[1],{},[]] - cur[2].push(c) - stack.push([c,cur[2].length-1]) - } else if (s === ATTR_KEY || (s === VAR && p[1] === ATTR_KEY)) { - var key = '' - var copyKey - for (; i < parts.length; i++) { - if (parts[i][0] === ATTR_KEY) { - key = concat(key, parts[i][1]) - } else if (parts[i][0] === VAR && parts[i][1] === ATTR_KEY) { - if (typeof parts[i][2] === 'object' && !key) { - for (copyKey in parts[i][2]) { - if (parts[i][2].hasOwnProperty(copyKey) && !cur[1][copyKey]) { - cur[1][copyKey] = parts[i][2][copyKey] - } - } - } else { - key = concat(key, parts[i][2]) - } - } else break - } - if (parts[i][0] === ATTR_EQ) i++ - var j = i - for (; i < parts.length; i++) { - if (parts[i][0] === ATTR_VALUE || parts[i][0] === ATTR_KEY) { - if (!cur[1][key]) cur[1][key] = strfn(parts[i][1]) - else parts[i][1]==="" || (cur[1][key] = concat(cur[1][key], parts[i][1])); - } else if (parts[i][0] === VAR - && (parts[i][1] === ATTR_VALUE || parts[i][1] === ATTR_KEY)) { - if (!cur[1][key]) cur[1][key] = strfn(parts[i][2]) - else parts[i][2]==="" || (cur[1][key] = concat(cur[1][key], parts[i][2])); - } else { - if (key.length && !cur[1][key] && i === j - && (parts[i][0] === CLOSE || parts[i][0] === ATTR_BREAK)) { - // https://html.spec.whatwg.org/multipage/infrastructure.html#boolean-attributes - // empty string is falsy, not well behaved value in browser - cur[1][key] = key.toLowerCase() - } - if (parts[i][0] === CLOSE) { - i-- - } - break - } - } - } else if (s === ATTR_KEY) { - cur[1][p[1]] = true - } else if (s === VAR && p[1] === ATTR_KEY) { - cur[1][p[2]] = true - } else if (s === CLOSE) { - if (selfClosing(cur[0]) && stack.length) { - var ix = stack[stack.length-1][1] - stack.pop() - stack[stack.length-1][0][2][ix] = h( - cur[0], cur[1], cur[2].length ? cur[2] : undefined - ) - } - } else if (s === VAR && p[1] === TEXT) { - if (p[2] === undefined || p[2] === null) p[2] = '' - else if (!p[2]) p[2] = concat('', p[2]) - if (Array.isArray(p[2][0])) { - cur[2].push.apply(cur[2], p[2]) - } else { - cur[2].push(p[2]) - } - } else if (s === TEXT) { - cur[2].push(p[1]) - } else if (s === ATTR_EQ || s === ATTR_BREAK) { - // no-op - } else { - throw new Error('unhandled: ' + s) - } - } - - if (tree[2].length > 1 && /^\s*$/.test(tree[2][0])) { - tree[2].shift() - } - - if (tree[2].length > 2 - || (tree[2].length === 2 && /\S/.test(tree[2][1]))) { - throw new Error( - 'multiple root elements must be wrapped in an enclosing tag' - ) - } - if (Array.isArray(tree[2][0]) && typeof tree[2][0][0] === 'string' - && Array.isArray(tree[2][0][2])) { - tree[2][0] = h(tree[2][0][0], tree[2][0][1], tree[2][0][2]) - } - return tree[2][0] - - function parse (str) { - var res = [] - if (state === ATTR_VALUE_W) state = ATTR - for (var i = 0; i < str.length; i++) { - var c = str.charAt(i) - if (state === TEXT && c === '<') { - if (reg.length) res.push([TEXT, reg]) - reg = '' - state = OPEN - } else if (c === '>' && !quot(state) && state !== COMMENT) { - if (state === OPEN && reg.length) { - res.push([OPEN,reg]) - } else if (state === ATTR_KEY) { - res.push([ATTR_KEY,reg]) - } else if (state === ATTR_VALUE && reg.length) { - res.push([ATTR_VALUE,reg]) - } - res.push([CLOSE]) - reg = '' - state = TEXT - } else if (state === COMMENT && /-$/.test(reg) && c === '-') { - if (opts.comments) { - res.push([ATTR_VALUE,reg.substr(0, reg.length - 1)],[CLOSE]) - } - reg = '' - state = TEXT - } else if (state === OPEN && /^!--$/.test(reg)) { - if (opts.comments) { - res.push([OPEN, reg],[ATTR_KEY,'comment'],[ATTR_EQ]) - } - reg = c - state = COMMENT - } else if (state === TEXT || state === COMMENT) { - reg += c - } else if (state === OPEN && c === '/' && reg.length) { - // no-op, self closing tag without a space
    - } else if (state === OPEN && /\s/.test(c)) { - if (reg.length) { - res.push([OPEN, reg]) - } - reg = '' - state = ATTR - } else if (state === OPEN) { - reg += c - } else if (state === ATTR && /[^\s"'=/]/.test(c)) { - state = ATTR_KEY - reg = c - } else if (state === ATTR && /\s/.test(c)) { - if (reg.length) res.push([ATTR_KEY,reg]) - res.push([ATTR_BREAK]) - } else if (state === ATTR_KEY && /\s/.test(c)) { - res.push([ATTR_KEY,reg]) - reg = '' - state = ATTR_KEY_W - } else if (state === ATTR_KEY && c === '=') { - res.push([ATTR_KEY,reg],[ATTR_EQ]) - reg = '' - state = ATTR_VALUE_W - } else if (state === ATTR_KEY) { - reg += c - } else if ((state === ATTR_KEY_W || state === ATTR) && c === '=') { - res.push([ATTR_EQ]) - state = ATTR_VALUE_W - } else if ((state === ATTR_KEY_W || state === ATTR) && !/\s/.test(c)) { - res.push([ATTR_BREAK]) - if (/[\w-]/.test(c)) { - reg += c - state = ATTR_KEY - } else state = ATTR - } else if (state === ATTR_VALUE_W && c === '"') { - state = ATTR_VALUE_DQ - } else if (state === ATTR_VALUE_W && c === "'") { - state = ATTR_VALUE_SQ - } else if (state === ATTR_VALUE_DQ && c === '"') { - res.push([ATTR_VALUE,reg],[ATTR_BREAK]) - reg = '' - state = ATTR - } else if (state === ATTR_VALUE_SQ && c === "'") { - res.push([ATTR_VALUE,reg],[ATTR_BREAK]) - reg = '' - state = ATTR - } else if (state === ATTR_VALUE_W && !/\s/.test(c)) { - state = ATTR_VALUE - i-- - } else if (state === ATTR_VALUE && /\s/.test(c)) { - res.push([ATTR_VALUE,reg],[ATTR_BREAK]) - reg = '' - state = ATTR - } else if (state === ATTR_VALUE || state === ATTR_VALUE_SQ - || state === ATTR_VALUE_DQ) { - reg += c - } - } - if (state === TEXT && reg.length) { - res.push([TEXT,reg]) - reg = '' - } else if (state === ATTR_VALUE && reg.length) { - res.push([ATTR_VALUE,reg]) - reg = '' - } else if (state === ATTR_VALUE_DQ && reg.length) { - res.push([ATTR_VALUE,reg]) - reg = '' - } else if (state === ATTR_VALUE_SQ && reg.length) { - res.push([ATTR_VALUE,reg]) - reg = '' - } else if (state === ATTR_KEY) { - res.push([ATTR_KEY,reg]) - reg = '' - } - return res - } - } - - function strfn (x) { - if (typeof x === 'function') return x - else if (typeof x === 'string') return x - else if (x && typeof x === 'object') return x - else return concat('', x) - } -} - -function quot (state) { - return state === ATTR_VALUE_SQ || state === ATTR_VALUE_DQ -} - -var hasOwn = Object.prototype.hasOwnProperty -function has (obj, key) { return hasOwn.call(obj, key) } - -var closeRE = RegExp('^(' + [ - 'area', 'base', 'basefont', 'bgsound', 'br', 'col', 'command', 'embed', - 'frame', 'hr', 'img', 'input', 'isindex', 'keygen', 'link', 'meta', 'param', - 'source', 'track', 'wbr', '!--', - // SVG TAGS - 'animate', 'animateTransform', 'circle', 'cursor', 'desc', 'ellipse', - 'feBlend', 'feColorMatrix', 'feComposite', - 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', - 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', - 'feGaussianBlur', 'feImage', 'feMergeNode', 'feMorphology', - 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', - 'feTurbulence', 'font-face-format', 'font-face-name', 'font-face-uri', - 'glyph', 'glyphRef', 'hkern', 'image', 'line', 'missing-glyph', 'mpath', - 'path', 'polygon', 'polyline', 'rect', 'set', 'stop', 'tref', 'use', 'view', - 'vkern' -].join('|') + ')(?:[\.#][a-zA-Z0-9\u007F-\uFFFF_:-]+)*$') -function selfClosing (tag) { return closeRE.test(tag) } diff --git a/node_modules/hyperx/package.json b/node_modules/hyperx/package.json deleted file mode 100644 index 90f88994b..000000000 --- a/node_modules/hyperx/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_from": "hyperx@^2.3.0", - "_id": "hyperx@2.4.0", - "_inBundle": false, - "_integrity": "sha512-43jbOQfVkm9U0oAyBZ4Vt2eB0hZWS5EyrOhR3ZbgUrcprutGu9s/C476OVFL3QU1iynKO5s9kZsWrZm19gJKjg==", - "_location": "/hyperx", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "hyperx@^2.3.0", - "name": "hyperx", - "escapedName": "hyperx", - "rawSpec": "^2.3.0", - "saveSpec": null, - "fetchSpec": "^2.3.0" - }, - "_requiredBy": [ - "/bel" - ], - "_resolved": "https://registry.npmjs.org/hyperx/-/hyperx-2.4.0.tgz", - "_shasum": "397d6815d25785fee3c9f4968cbaafc1d8b36d39", - "_spec": "hyperx@^2.3.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/bel", - "author": { - "name": "substack" - }, - "bugs": { - "url": "https://github.com/substack/hyperx/issues" - }, - "bundleDependencies": false, - "dependencies": { - "hyperscript-attribute-to-property": "^1.0.0" - }, - "deprecated": false, - "description": "tagged template string virtual dom builder", - "devDependencies": { - "covert": "^1.1.0", - "hyperscript": "^1.4.7", - "tape": "^4.4.0", - "virtual-dom": "^2.1.1" - }, - "directories": { - "example": "example", - "test": "test" - }, - "homepage": "https://github.com/substack/hyperx#readme", - "keywords": [ - "jsx", - "virtual-dom", - "vdom", - "react", - "hyperscript", - "template string", - "template", - "es6" - ], - "license": "BSD", - "main": "index.js", - "name": "hyperx", - "repository": { - "type": "git", - "url": "git+https://github.com/substack/hyperx.git" - }, - "scripts": { - "coverage": "covert test/*.js", - "test": "tape test/*.js" - }, - "version": "2.4.0" -} diff --git a/node_modules/hyperx/readme.markdown b/node_modules/hyperx/readme.markdown deleted file mode 100644 index 9ebff7d33..000000000 --- a/node_modules/hyperx/readme.markdown +++ /dev/null @@ -1,203 +0,0 @@ -# hyperx - -tagged template string virtual dom builder - -This module is similar to JSX, but provided as a standards-compliant ES6 tagged -template string function. - -hyperx works with [virtual-dom](https://npmjs.com/package/virtual-dom), -[react](https://npmjs.com/package/react), -[hyperscript](https://npmjs.com/package/hyperscript), or any DOM builder with a -hyperscript-style API: `h(tagName, attrs, children)`. - -You might also want to check out the [hyperxify][2] browserify transform to -statically compile hyperx into javascript expressions to save sending the hyperx -parser down the wire. - -[2]: https://npmjs.com/package/hyperxify - -# compatibility - -[Template strings][1] are available in: -node 4+, chrome 41, firefox 34, edge, opera 28, safari 9 - -If you're targeting these platforms, there's no need to use a transpiler! - -[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/template_strings - -# examples - -## virtual-dom node example - -``` js -var vdom = require('virtual-dom') -var hyperx = require('hyperx') -var hx = hyperx(vdom.h) - -var title = 'world' -var wow = [1,2,3] -var tree = hx`
    -

    hello ${title}!

    - ${hx`cool`} - wow - ${wow.map(function (w, i) { - return hx`${w}\n` - })} -
    ` -console.log(vdom.create(tree).toString()) -``` - -output: - -``` -$ node vdom.js -
    -

    hello world!

    - cool - wow - 123 -
    -``` - -## react node example - -``` js -var React = require('react') -var toString = require('react-dom/server').renderToString -var hyperx = require('hyperx') -var hx = hyperx(React.createElement) - -var title = 'world' -var wow = [1,2,3] -var tree = hx`
    -

    hello ${title}!

    - ${hx`cool`} - wow - ${wow.map(function (w, i) { - return hx`${w}\n` - })} -
    ` -console.log(toString(tree)) -``` - -## hyperscript node example - -``` js -var h = require('hyperscript') -var hyperx = require('hyperx') -var hx = hyperx(h) - -var title = 'world' -var wow = [1,2,3] -var tree = hx`
    -

    hello ${title}!

    - ${hx`cool`} - wow - ${wow.map(function (w) { - return hx`${w}\n` - })} -
    ` -console.log(tree.outerHTML) -``` - -## virtual-dom/main-loop browser example - -``` js -var vdom = require('virtual-dom') -var hyperx = require('hyperx') -var hx = hyperx(vdom.h) - -var main = require('main-loop') -var loop = main({ times: 0 }, render, vdom) -document.querySelector('#content').appendChild(loop.target) - -function render (state) { - return hx`
    -

    clicked ${state.times} times

    - -
    ` - - function onclick () { - loop.update({ times: state.times + 1 }) - } -} -``` - -## react browser example - -``` js -var React = require('react') -var render = require('react-dom').render -var hyperx = require('hyperx') -var hx = hyperx(React.createElement) - -var App = React.createClass({ - getInitialState: function () { return { n: 0 } }, - render: function () { - return hx`
    -

    clicked ${this.state.n} times

    - -
    ` - }, - handleClick: function () { - this.setState({ n: this.state.n + 1 }) - } -}) -render(React.createElement(App), document.querySelector('#content')) -``` - -## console.log example - -``` js -var hyperx = require('hyperx') - -var convertTaggedTemplateOutputToDomBuilder = hyperx(function (tagName, attrs, children) { - console.log(tagName, attrs, children) -}) - -convertTaggedTemplateOutputToDomBuilder`

    hello world

    ` - -// Running this produces: h1 {} [ 'hello world' ] -``` - - -# api - -``` -var hyperx = require('hyperx') -``` - -## var hx = hyperx(h, opts={}) - -Return a tagged template function `hx` from a hyperscript-style factory function -`h`. - -Values to use for `h`: - -* virtual-dom - `vdom.h` -* react - `React.createElement` -* hyperscript - hyperscript - -Optionally provide: - -* `opts.concat(a, b)` - custom concatenation function to combine quasiliteral -strings with expressions. The `h` factory function will receive the objects -returned by the concatenation function and can make specific use of them. This -is useful if you want to implement a pre-processor to generate javascript from -hyperx syntax. -* `opts.attrToProp` - turn off attribute to property conversions when `false` - -# prior art - -* http://www.2ality.com/2014/07/jsx-template-strings.html?m=1 -* http://facebook.github.io/jsx/#why-not-template-literals (respectfully disagree) - -# license - -BSD - -# install - -``` -npm install hyperx -``` diff --git a/node_modules/hyperx/test/attr.js b/node_modules/hyperx/test/attr.js deleted file mode 100644 index 0cd385948..000000000 --- a/node_modules/hyperx/test/attr.js +++ /dev/null @@ -1,76 +0,0 @@ -var test = require('tape') -var vdom = require('virtual-dom') -var hyperx = require('../') -var hx = hyperx(vdom.h) - -test('class', function (t) { - var tree = hx`
    ` - t.equal(vdom.create(tree).toString(), '
    ') - t.end() -}) - -test('boolean attribute', function (t) { - var tree = hx`` - t.equal(vdom.create(tree).toString(), '') - t.end() -}) - -test('boolean attribute followed by normal attribute', function (t) { - var tree = hx`` - t.equal(vdom.create(tree).toString(), '') - t.end() -}) - -test('boolean attribute preceded by normal attribute', function (t) { - var tree = hx`` - t.equal(vdom.create(tree).toString(), '') - t.end() -}) - -test('unquoted attribute', function (t) { - var tree = hx`
    ` - t.equal(vdom.create(tree).toString(), '
    ') - t.end() -}) - -test('unquoted attribute preceded by boolean attribute', function (t) { - var tree = hx`` - t.equal(vdom.create(tree).toString(), '') - t.end() -}) - -test('unquoted attribute succeeded by boolean attribute', function (t) { - var tree = hx`` - t.equal(vdom.create(tree).toString(), '') - t.end() -}) - -test('unquoted attribute preceded by normal attribute', function (t) { - var tree = hx`
    ` - t.equal(vdom.create(tree).toString(), '
    ') - t.end() -}) - -test('unquoted attribute succeeded by normal attribute', function (t) { - var tree = hx`
    ` - t.equal(vdom.create(tree).toString(), '
    ') - t.end() -}) - -test('consecutive unquoted attributes', function (t) { - var tree = hx`
    ` - t.equal(vdom.create(tree).toString(), '
    ') - t.end() -}) - -test('strange leading character attributes', function (t) { - var tree = hx`
    ` - t.equal(vdom.create(tree).toString(), '
    ') - t.end() -}) - -test('strange inbetween character attributes', function (t) { - var tree = hx`
    ` - t.equal(vdom.create(tree).toString(), `
    `) - t.end() -}) diff --git a/node_modules/hyperx/test/attr_to_prop.js b/node_modules/hyperx/test/attr_to_prop.js deleted file mode 100644 index 831fa8502..000000000 --- a/node_modules/hyperx/test/attr_to_prop.js +++ /dev/null @@ -1,29 +0,0 @@ -var test = require('tape') -var vdom = require('virtual-dom') -var hyperx = require('../') -var hx = hyperx(vdom.h) - -test('class to className', function (t) { - var tree = hx`
    ` - t.deepEqual(tree.properties, { className: 'wow' }) - t.end() -}) - -test('for to htmlFor', function (t) { - var tree = hx`
    ` - t.deepEqual(tree.properties, { htmlFor: 'wow' }) - t.end() -}) - -test('http-equiv to httpEquiv', function (t) { - var tree = hx`` - t.deepEqual(tree.properties, { content: '30', httpEquiv: 'refresh' }) - t.end() -}) - -test('no transform', t => { - var hx = hyperx(vdom.h, { attrToProp: false }) - var tree = hx`
    ` - t.deepEqual(tree.properties, { class: 'wow' }) - t.end() -}) diff --git a/node_modules/hyperx/test/br.js b/node_modules/hyperx/test/br.js deleted file mode 100644 index b2f437efc..000000000 --- a/node_modules/hyperx/test/br.js +++ /dev/null @@ -1,10 +0,0 @@ -var test = require('tape') -var vdom = require('virtual-dom') -var hyperx = require('../') -var hx = hyperx(vdom.h) - -test('self closing tags without a space', function (t) { - var tree = hx`
    a
    b
    ` - t.equal(vdom.create(tree).toString(), '
    a
    b
    ') - t.end() -}) diff --git a/node_modules/hyperx/test/children.js b/node_modules/hyperx/test/children.js deleted file mode 100644 index 654f368d6..000000000 --- a/node_modules/hyperx/test/children.js +++ /dev/null @@ -1,42 +0,0 @@ -var test = require('tape') -var vdom = require('virtual-dom') -var hyperx = require('../') -var hx = hyperx(vdom.h) - -test('1 child', function (t) { - var tree = hx`
    foobar
    ` - t.equal(vdom.create(tree).toString(), '
    foobar
    ') - t.end() -}) - -test('no children', function (t) { - var tree = hx`` - t.equal(vdom.create(tree).toString(), '') - t.end() -}) - -test('multiple children', function (t) { - var html = `
    -

    title

    -
    - -
    -
    ` - var tree = hx` -
    -

    title

    -
    - -
    -
    ` - t.equal(vdom.create(tree).toString(), html) - t.end() -}) diff --git a/node_modules/hyperx/test/comment.js b/node_modules/hyperx/test/comment.js deleted file mode 100644 index f87347947..000000000 --- a/node_modules/hyperx/test/comment.js +++ /dev/null @@ -1,51 +0,0 @@ -var test = require('tape') -var hyperx = require('../') -var hx = hyperx(createElement) -var hxc = hyperx(createElement, {comments: true}) - -function createElement(tag, props, children) { - if (tag === '!--') { - return `` - } - return `<${tag}>${children ? children.join('') : ''}` -} - -test('1 comment', function (t) { - var tree = hxc`` - t.equal(tree, '') - t.end() -}) - -test('with crazy characters', function (t) { - var tree = hxc`` - t.equal(tree, '') - t.end() -}) - -test('as child', function (t) { - var tree = hxc`
    ` - t.equal(tree, '
    ') - t.end() -}) - -test('many comments', function (t) { - var html = `
    - - bar - -
    ` - var tree = hxc` -
    - - bar - -
    ` - t.equal(tree, html) - t.end() -}) - -test('excluded by default', function (t) { - var tree = hx`
    ` - t.equal(tree, '
    ') - t.end() -}) diff --git a/node_modules/hyperx/test/concat.js b/node_modules/hyperx/test/concat.js deleted file mode 100644 index b8b25d3a8..000000000 --- a/node_modules/hyperx/test/concat.js +++ /dev/null @@ -1,49 +0,0 @@ -var test = require('tape') -var vdom = require('virtual-dom') -var hyperx = require('../') -var hx = hyperx(function (tagName, opts, children) { - return { - expr: 'h(' + JSON.stringify(tagName) - + ',' + JSON.stringify(opts) - + ',[' + children.map(child).join(',') - + '])' - } - function child (c) { - if (c.expr) return c.expr - else if (Array.isArray(c)) return c.map(child).join(',') - else return JSON.stringify(c) - } -}, { concat: concat }) - -function concat (a, b) { - if (!a.expr && !b.expr) return String(a) + String(b) - var aexpr, bexpr - if (a.expr) aexpr = '(' + a.expr + ')' - else aexpr = JSON.stringify(a) - if (b.expr) bexpr = '(' + b.expr + ')' - else bexpr = JSON.stringify(b) - return { expr: aexpr + '+' + bexpr } -} - -var expected = `
    -

    hello world!

    - cool - wow - 123 -
    ` - -test('vdom', function (t) { - var title = 'world' - var wow = [1,2,3] - var str = hx`
    -

    hello ${title}!

    - ${hx`cool`} - wow - ${wow.map(function (w, i) { - return hx`${w}\n` - })} -
    `.expr - var tree = Function(['h'],'return ' + str)(vdom.h) - t.equal(vdom.create(tree).toString(), expected) - t.end() -}) diff --git a/node_modules/hyperx/test/esc.js b/node_modules/hyperx/test/esc.js deleted file mode 100644 index 65be7e22f..000000000 --- a/node_modules/hyperx/test/esc.js +++ /dev/null @@ -1,24 +0,0 @@ -var test = require('tape') -var vdom = require('virtual-dom') -var hyperx = require('../') -var hx = hyperx(vdom.h) - -test('escape double quotes', function (t) { - var value = '">' - var tree = hx`` - t.equal( - vdom.create(tree).toString(), - `` - ) - t.end() -}) - -test('escape single quotes', function (t) { - var value = "'>" - var tree = hx`` - t.equal( - vdom.create(tree).toString(), - `` - ) - t.end() -}) diff --git a/node_modules/hyperx/test/ignore_surounding_whitespace.js b/node_modules/hyperx/test/ignore_surounding_whitespace.js deleted file mode 100644 index b54cc0678..000000000 --- a/node_modules/hyperx/test/ignore_surounding_whitespace.js +++ /dev/null @@ -1,19 +0,0 @@ -var test = require('tape') -var vdom = require('virtual-dom') -var hyperx = require('../') -var hx = hyperx(vdom.h) - -test('ignore whitespace surrounding an element', function (t) { - var tree = hx`
    `; - t.equal(vdom.create(tree).toString(), '
    ') - tree = hx` -
    `; - t.equal(vdom.create(tree).toString(), '
    ') - tree = hx` -
    - `; - t.equal(vdom.create(tree).toString(), '
    ') - // It shouldn't strip whitespace from a text node - t.equal(hx` hello world `, ' hello world ') - t.end() -}) diff --git a/node_modules/hyperx/test/key.js b/node_modules/hyperx/test/key.js deleted file mode 100644 index b60cb6035..000000000 --- a/node_modules/hyperx/test/key.js +++ /dev/null @@ -1,72 +0,0 @@ -var test = require('tape') -var vdom = require('virtual-dom') -var hyperx = require('../') -var hx = hyperx(vdom.h) - -test('key', function (t) { - var key = 'type' - var value = 'text' - var tree = hx`` - t.equal(vdom.create(tree).toString(), '') - t.end() -}) - -test('pre key', function (t) { - var key = 'ype' - var value = 'text' - var tree = hx`` - t.equal(vdom.create(tree).toString(), '') - t.end() -}) - -test('post key', function (t) { - var key = 'typ' - var value = 'text' - var tree = hx`` - t.equal(vdom.create(tree).toString(), '') - t.end() -}) - -test('pre post key', function (t) { - var key = 'yp' - var value = 'text' - var tree = hx`` - t.equal(vdom.create(tree).toString(), '') - t.end() -}) - -test('boolean key', function (t) { - var key = 'checked' - var tree = hx`` - t.equal(vdom.create(tree).toString(), - '') - t.end() -}) - -test('multiple keys', function (t) { - var props = { - type: 'text', - 'data-special': 'true' - } - var key = 'data-' - var value = 'bar' - var tree = hx`` - t.equal(vdom.create(tree).toString(), '') - t.end() -}) - -test('multiple keys dont overwrite existing ones', function (t) { - var props = { - type: 'text' - } - var tree = hx`` - t.equal(vdom.create(tree).toString(), '') - t.end() -}) - -// https://github.com/choojs/hyperx/issues/55 -test('unquoted key does not make void element eat adjacent elements', function (t) { - var tree = hx`sometext` - t.equal(vdom.create(tree).toString(), 'sometext') - t.end() -}) diff --git a/node_modules/hyperx/test/multi_elem_error.js b/node_modules/hyperx/test/multi_elem_error.js deleted file mode 100644 index a8834ccbf..000000000 --- a/node_modules/hyperx/test/multi_elem_error.js +++ /dev/null @@ -1,12 +0,0 @@ -var test = require('tape') -var vdom = require('virtual-dom') -var hyperx = require('../') -var hx = hyperx(vdom.h) - -test('multiple element error', function (t) { - t.plan(1) - t.throws(function () { - var tree = hx`
    one
    two
    ` - }, 'exception') - t.end() -}) diff --git a/node_modules/hyperx/test/style.js b/node_modules/hyperx/test/style.js deleted file mode 100644 index 7eef5b544..000000000 --- a/node_modules/hyperx/test/style.js +++ /dev/null @@ -1,17 +0,0 @@ -var test = require('tape') -var vdom = require('virtual-dom') -var hyperx = require('../') -var hx = hyperx(vdom.h) - -test('style', function (t) { - var key = 'type' - var value = 'text' - var tree = hx`` - t.equal( - vdom.create(tree).toString(), - '' - ) - t.end() -}) diff --git a/node_modules/hyperx/test/svg.js b/node_modules/hyperx/test/svg.js deleted file mode 100644 index 1ee0fa1df..000000000 --- a/node_modules/hyperx/test/svg.js +++ /dev/null @@ -1,21 +0,0 @@ -var test = require('tape') -var vdom = require('virtual-dom') -var hyperx = require('../') -var hx = hyperx(vdom.h) - -test('svg mixed with html', function (t) { - var expected = `
    -

    test

    - - - -
    ` - var tree = hx`
    -

    test

    - - - -
    ` - t.equal(vdom.create(tree).toString(), expected) - t.end() -}) diff --git a/node_modules/hyperx/test/tags.js b/node_modules/hyperx/test/tags.js deleted file mode 100644 index 7d9dc7aab..000000000 --- a/node_modules/hyperx/test/tags.js +++ /dev/null @@ -1,23 +0,0 @@ -var test = require('tape') -var vdom = require('virtual-dom') -var hyperx = require('../') -var hx = hyperx(vdom.h) - -test('tag as string variable', function (t) { - var tag = 'div' - var tree = hx`<${tag} class="wow">` - t.equal(vdom.create(tree).toString(), '
    ') - t.end() -}) - -test('tag as function variable', function (t) { - var customTag = function () {} - var h = function (tag, attrs, children) { - t.equal(tag, customTag) - t.deepEqual(attrs, { className: 'wow' }) - t.deepEqual(children, [ 'child' ]) - t.end() - } - var hx = hyperx(h) - var tree = hx`<${customTag} class="wow">child` -}) diff --git a/node_modules/hyperx/test/title.js b/node_modules/hyperx/test/title.js deleted file mode 100644 index 98e040760..000000000 --- a/node_modules/hyperx/test/title.js +++ /dev/null @@ -1,10 +0,0 @@ -var test = require('tape') -var vdom = require('virtual-dom') -var hyperx = require('../') -var hx = hyperx(vdom.h) - -test('title html tag', function (t) { - var tree = hx`hello` - t.equal(vdom.create(tree).toString(), 'hello') - t.end() -}) diff --git a/node_modules/hyperx/test/types.js b/node_modules/hyperx/test/types.js deleted file mode 100644 index 13f6c2195..000000000 --- a/node_modules/hyperx/test/types.js +++ /dev/null @@ -1,28 +0,0 @@ -var test = require('tape') -var vdom = require('virtual-dom') -var hyperx = require('../') -var hx = hyperx(vdom.h) - -test('undefined value (empty)', function (t) { - var tree = hx`
    ${undefined}
    ` - t.equal(vdom.create(tree).toString(), '
    ') - t.end() -}) - -test('null value (empty)', function (t) { - var tree = hx`
    ${null}
    ` - t.equal(vdom.create(tree).toString(), '
    ') - t.end() -}) - -test('boolean value', function (t) { - var tree = hx`
    ${false}
    ` - t.equal(vdom.create(tree).toString(), '
    false
    ') - t.end() -}) - -test('numeric value', function (t) { - var tree = hx`
    ${555}
    ` - t.equal(vdom.create(tree).toString(), '
    555
    ') - t.end() -}) diff --git a/node_modules/hyperx/test/value.js b/node_modules/hyperx/test/value.js deleted file mode 100644 index c4621e003..000000000 --- a/node_modules/hyperx/test/value.js +++ /dev/null @@ -1,36 +0,0 @@ -var test = require('tape') -var vdom = require('virtual-dom') -var hyperx = require('../') -var hx = hyperx(vdom.h) - -test('value', function (t) { - var key = 'type' - var value = 'text' - var tree = hx`` - t.equal(vdom.create(tree).toString(), '') - t.end() -}) - -test('pre value', function (t) { - var key = 'type' - var value = 'ext' - var tree = hx`` - t.equal(vdom.create(tree).toString(), '') - t.end() -}) - -test('post key', function (t) { - var key = 'type' - var value = 'tex' - var tree = hx`` - t.equal(vdom.create(tree).toString(), '') - t.end() -}) - -test('pre post key', function (t) { - var key = 'type' - var value = 'ex' - var tree = hx`` - t.equal(vdom.create(tree).toString(), '') - t.end() -}) diff --git a/node_modules/hyperx/test/vdom.js b/node_modules/hyperx/test/vdom.js deleted file mode 100644 index 77532323c..000000000 --- a/node_modules/hyperx/test/vdom.js +++ /dev/null @@ -1,26 +0,0 @@ -var test = require('tape') -var vdom = require('virtual-dom') -var hyperx = require('../') -var hx = hyperx(vdom.h) - -var expected = `
    -

    hello world!

    - cool - wow - 123 -
    ` - -test('vdom', function (t) { - var title = 'world' - var wow = [1,2,3] - var tree = hx`
    -

    hello ${title}!

    - ${hx`cool`} - wow - ${wow.map(function (w, i) { - return hx`${w}\n` - })} -
    ` - t.equal(vdom.create(tree).toString(), expected) - t.end() -}) diff --git a/node_modules/hyperx/test/z_hyperscript.js b/node_modules/hyperx/test/z_hyperscript.js deleted file mode 100644 index 74513ee8f..000000000 --- a/node_modules/hyperx/test/z_hyperscript.js +++ /dev/null @@ -1,27 +0,0 @@ -var test = require('tape') -var h = require('hyperscript') -var hyperx = require('../') -var hx = hyperx(h) - -// We cant use custom attributes y="" with hyperscript in the browser, use data-y="" instead -var expected = `
    -

    hello world!

    - cool - wow - 123 -
    ` - -test('hyperscript', function (t) { - var title = 'world' - var wow = [1,2,3] - var tree = hx`
    -

    hello ${title}!

    - ${hx`cool`} - wow - ${wow.map(function (w) { - return hx`${w}\n` - })} -
    ` - t.equal(tree.outerHTML, expected) - t.end() -}) diff --git a/node_modules/ieee754/LICENSE b/node_modules/ieee754/LICENSE deleted file mode 100644 index f37a2ebe2..000000000 --- a/node_modules/ieee754/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2008, Fair Oaks Labs, Inc. -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 Fair Oaks Labs, 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. diff --git a/node_modules/ieee754/README.md b/node_modules/ieee754/README.md deleted file mode 100644 index cb7527b3c..000000000 --- a/node_modules/ieee754/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# ieee754 [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] - -[travis-image]: https://img.shields.io/travis/feross/ieee754/master.svg -[travis-url]: https://travis-ci.org/feross/ieee754 -[npm-image]: https://img.shields.io/npm/v/ieee754.svg -[npm-url]: https://npmjs.org/package/ieee754 -[downloads-image]: https://img.shields.io/npm/dm/ieee754.svg -[downloads-url]: https://npmjs.org/package/ieee754 -[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg -[standard-url]: https://standardjs.com - -[![saucelabs][saucelabs-image]][saucelabs-url] - -[saucelabs-image]: https://saucelabs.com/browser-matrix/ieee754.svg -[saucelabs-url]: https://saucelabs.com/u/ieee754 - -### Read/write IEEE754 floating point numbers from/to a Buffer or array-like object. - -## install - -``` -npm install ieee754 -``` - -## methods - -`var ieee754 = require('ieee754')` - -The `ieee754` object has the following functions: - -``` -ieee754.read = function (buffer, offset, isLE, mLen, nBytes) -ieee754.write = function (buffer, value, offset, isLE, mLen, nBytes) -``` - -The arguments mean the following: - -- buffer = the buffer -- offset = offset into the buffer -- value = value to set (only for `write`) -- isLe = is little endian? -- mLen = mantissa length -- nBytes = number of bytes - -## what is ieee754? - -The IEEE Standard for Floating-Point Arithmetic (IEEE 754) is a technical standard for floating-point computation. [Read more](http://en.wikipedia.org/wiki/IEEE_floating_point). - -## license - -BSD 3 Clause. Copyright (c) 2008, Fair Oaks Labs, Inc. diff --git a/node_modules/ieee754/index.js b/node_modules/ieee754/index.js deleted file mode 100644 index e87e6ff58..000000000 --- a/node_modules/ieee754/index.js +++ /dev/null @@ -1,84 +0,0 @@ -exports.read = function (buffer, offset, isLE, mLen, nBytes) { - var e, m - var eLen = (nBytes * 8) - mLen - 1 - var eMax = (1 << eLen) - 1 - var eBias = eMax >> 1 - var nBits = -7 - var i = isLE ? (nBytes - 1) : 0 - var d = isLE ? -1 : 1 - var s = buffer[offset + i] - - i += d - - e = s & ((1 << (-nBits)) - 1) - s >>= (-nBits) - nBits += eLen - for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} - - m = e & ((1 << (-nBits)) - 1) - e >>= (-nBits) - nBits += mLen - for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} - - if (e === 0) { - e = 1 - eBias - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity) - } else { - m = m + Math.pow(2, mLen) - e = e - eBias - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen) -} - -exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c - var eLen = (nBytes * 8) - mLen - 1 - var eMax = (1 << eLen) - 1 - var eBias = eMax >> 1 - var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) - var i = isLE ? 0 : (nBytes - 1) - var d = isLE ? 1 : -1 - var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 - - value = Math.abs(value) - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0 - e = eMax - } else { - e = Math.floor(Math.log(value) / Math.LN2) - if (value * (c = Math.pow(2, -e)) < 1) { - e-- - c *= 2 - } - if (e + eBias >= 1) { - value += rt / c - } else { - value += rt * Math.pow(2, 1 - eBias) - } - if (value * c >= 2) { - e++ - c /= 2 - } - - if (e + eBias >= eMax) { - m = 0 - e = eMax - } else if (e + eBias >= 1) { - m = ((value * c) - 1) * Math.pow(2, mLen) - e = e + eBias - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) - e = 0 - } - } - - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} - - e = (e << mLen) | m - eLen += mLen - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} - - buffer[offset + i - d] |= s * 128 -} diff --git a/node_modules/ieee754/package.json b/node_modules/ieee754/package.json deleted file mode 100644 index 2131f07af..000000000 --- a/node_modules/ieee754/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_from": "ieee754@^1.1.4", - "_id": "ieee754@1.1.12", - "_inBundle": false, - "_integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==", - "_location": "/ieee754", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ieee754@^1.1.4", - "name": "ieee754", - "escapedName": "ieee754", - "rawSpec": "^1.1.4", - "saveSpec": null, - "fetchSpec": "^1.1.4" - }, - "_requiredBy": [ - "/buffer" - ], - "_resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", - "_shasum": "50bf24e5b9c8bb98af4964c941cdb0918da7b60b", - "_spec": "ieee754@^1.1.4", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/buffer", - "author": { - "name": "Feross Aboukhadijeh", - "email": "feross@feross.org", - "url": "http://feross.org" - }, - "bugs": { - "url": "https://github.com/feross/ieee754/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Romain Beauxis", - "email": "toots@rastageeks.org" - } - ], - "deprecated": false, - "description": "Read/write IEEE754 floating point numbers from/to a Buffer or array-like object", - "devDependencies": { - "airtap": "0.0.7", - "standard": "*", - "tape": "^4.0.0" - }, - "homepage": "https://github.com/feross/ieee754#readme", - "keywords": [ - "IEEE 754", - "buffer", - "convert", - "floating point", - "ieee754" - ], - "license": "BSD-3-Clause", - "main": "index.js", - "name": "ieee754", - "repository": { - "type": "git", - "url": "git://github.com/feross/ieee754.git" - }, - "scripts": { - "test": "standard && npm run test-node && npm run test-browser", - "test-browser": "airtap -- test/*.js", - "test-browser-local": "airtap --local -- test/*.js", - "test-node": "tape test/*.js" - }, - "version": "1.1.12" -} diff --git a/node_modules/individual/.npmignore b/node_modules/individual/.npmignore deleted file mode 100644 index 7ce4923d1..000000000 --- a/node_modules/individual/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules -*.log -*.err -coverage diff --git a/node_modules/individual/.travis.yml b/node_modules/individual/.travis.yml deleted file mode 100644 index c6314e120..000000000 --- a/node_modules/individual/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" - - "0.11" -before_install: npm i npm@latest -g -script: npm run travis diff --git a/node_modules/individual/LICENCE b/node_modules/individual/LICENCE deleted file mode 100644 index a23e08a85..000000000 --- a/node_modules/individual/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012 Raynos. - -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. \ No newline at end of file diff --git a/node_modules/individual/README.md b/node_modules/individual/README.md deleted file mode 100644 index 5ff408891..000000000 --- a/node_modules/individual/README.md +++ /dev/null @@ -1,69 +0,0 @@ -# individual - -[![build status][build-png]][build] [![Coverage Status][cover-png]][cover] [![Davis Dependency status][dep-png]][dep] - -[![NPM][npm-png]][npm] - -[![browser support][test-png]][test] - -Garantueed individual values - -## Example - -```js -var Individual = require("individual") - -var moduleCache = Individual("__MY_MODULE_CACHE", {}) - -// moduleCache is a individual variable local to this file. -// It will always be the same value and defaults to {}. -``` - -This gives you a singleton value by a unique name (it stores it -as a global variable). - -## Use cases - -Your module has an internal cache. If your module is loaded - twice, (someone didn't npm dedup and has two copies of your - module) you would have two seperate caches that dont talk - to each other. - -Best case your cache is less efficient. Worst case you have a - cache because the native C++ extension you talk to crashes - if you instantiate something twice. - -You need a garantuee that this value is an individual, there is - only one of it. - -I use it myself because opening a SockJS websocket to the same - URI twice causes an infinite loop. I need a garantuee that - I have an individual value for the SockJS connection so I - can see whether I already have an open connection. - -## WHY GLOBALS >:( - -I can't imagine any other way to do it. I hate it too. Make a - pull request if you know the real solution - -## Installation - -`npm install individual` - -## Contributors - - - Raynos - -## MIT Licenced - - [build-png]: https://secure.travis-ci.org/Raynos/individual.png - [build]: https://travis-ci.org/Raynos/individual - [cover-png]: https://coveralls.io/repos/Raynos/individual/badge.png - [cover]: https://coveralls.io/r/Raynos/individual - [dep-png]: https://david-dm.org/Raynos/individual.png - [dep]: https://david-dm.org/Raynos/individual - [test-png]: https://ci.testling.com/Raynos/individual.png - [test]: https://ci.testling.com/Raynos/individual - [npm-png]: https://nodei.co/npm/individual.png?stars&downloads - [npm]: https://nodei.co/npm/individual - diff --git a/node_modules/individual/index.js b/node_modules/individual/index.js deleted file mode 100644 index 2cb8483c3..000000000 --- a/node_modules/individual/index.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -/*global window, global*/ - -var root = typeof window !== 'undefined' ? - window : typeof global !== 'undefined' ? - global : {}; - -module.exports = Individual; - -function Individual(key, value) { - if (key in root) { - return root[key]; - } - - root[key] = value; - - return value; -} diff --git a/node_modules/individual/one-version.js b/node_modules/individual/one-version.js deleted file mode 100644 index 0a169efc9..000000000 --- a/node_modules/individual/one-version.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -var Individual = require('./index.js'); - -module.exports = OneVersion; - -function OneVersion(moduleName, version, defaultValue) { - var key = '__INDIVIDUAL_ONE_VERSION_' + moduleName; - var enforceKey = key + '_ENFORCE_SINGLETON'; - - var versionValue = Individual(enforceKey, version); - - if (versionValue !== version) { - throw new Error('Can only have one copy of ' + - moduleName + '.\n' + - 'You already have version ' + versionValue + - ' installed.\n' + - 'This means you cannot install version ' + version); - } - - return Individual(key, defaultValue); -} diff --git a/node_modules/individual/package.json b/node_modules/individual/package.json deleted file mode 100644 index 0ee604b52..000000000 --- a/node_modules/individual/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "_from": "individual@>=3.0.0 <3.1.0-0", - "_id": "individual@3.0.0", - "_inBundle": false, - "_integrity": "sha1-58pPhfiVewGHNPKFdQ3CLsL5hi0=", - "_location": "/individual", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "individual@>=3.0.0 <3.1.0-0", - "name": "individual", - "escapedName": "individual", - "rawSpec": ">=3.0.0 <3.1.0-0", - "saveSpec": null, - "fetchSpec": ">=3.0.0 <3.1.0-0" - }, - "_requiredBy": [ - "/bole" - ], - "_resolved": "https://registry.npmjs.org/individual/-/individual-3.0.0.tgz", - "_shasum": "e7ca4f85f8957b018734f285750dc22ec2f9862d", - "_spec": "individual@>=3.0.0 <3.1.0-0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/bole", - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "bugs": { - "url": "https://github.com/Raynos/individual/issues", - "email": "raynos2@gmail.com" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jake Verbaten" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "Garantueed individual values", - "devDependencies": { - "coveralls": "^2.10.0", - "istanbul": "^0.2.7", - "run-browser": "^1.3.1", - "tape": "^2.12.3" - }, - "homepage": "https://github.com/Raynos/individual", - "keywords": [], - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/Raynos/individual/raw/master/LICENSE" - } - ], - "main": "index", - "name": "individual", - "repository": { - "type": "git", - "url": "git://github.com/Raynos/individual.git" - }, - "scripts": { - "cover": "istanbul cover --report none --print detail test.js", - "test": "node test.js", - "travis": "npm run cover -s && istanbul report lcov && ((cat coverage/lcov.info | coveralls) || exit 0)" - }, - "testling": { - "files": "test.js", - "browsers": [ - "ie/8..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "version": "3.0.0" -} diff --git a/node_modules/individual/test.js b/node_modules/individual/test.js deleted file mode 100644 index bf593dbee..000000000 --- a/node_modules/individual/test.js +++ /dev/null @@ -1,25 +0,0 @@ -var test = require('tape'); - -var Individual = require('./index.js'); - -test('can create Individual', function (assert) { - var obj = Individual('someName', 42); - - assert.equal(obj, 42); - - var obj2 = Individual('someName', 50); - - assert.equal(obj, 42); - - assert.end(); -}); - -test('different keys', function (assert) { - var obj = Individual('someName2', 42); - var obj2 = Individual('otherName2', 50); - - assert.equal(obj, 42); - assert.equal(obj2, 50); - - assert.end(); -}); diff --git a/node_modules/inflight/LICENSE b/node_modules/inflight/LICENSE deleted file mode 100644 index 05eeeb88c..000000000 --- a/node_modules/inflight/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/inflight/README.md b/node_modules/inflight/README.md deleted file mode 100644 index 6dc892917..000000000 --- a/node_modules/inflight/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# inflight - -Add callbacks to requests in flight to avoid async duplication - -## USAGE - -```javascript -var inflight = require('inflight') - -// some request that does some stuff -function req(key, callback) { - // key is any random string. like a url or filename or whatever. - // - // will return either a falsey value, indicating that the - // request for this key is already in flight, or a new callback - // which when called will call all callbacks passed to inflightk - // with the same key - callback = inflight(key, callback) - - // If we got a falsey value back, then there's already a req going - if (!callback) return - - // this is where you'd fetch the url or whatever - // callback is also once()-ified, so it can safely be assigned - // to multiple events etc. First call wins. - setTimeout(function() { - callback(null, key) - }, 100) -} - -// only assigns a single setTimeout -// when it dings, all cbs get called -req('foo', cb1) -req('foo', cb2) -req('foo', cb3) -req('foo', cb4) -``` diff --git a/node_modules/inflight/inflight.js b/node_modules/inflight/inflight.js deleted file mode 100644 index 48202b3ca..000000000 --- a/node_modules/inflight/inflight.js +++ /dev/null @@ -1,54 +0,0 @@ -var wrappy = require('wrappy') -var reqs = Object.create(null) -var once = require('once') - -module.exports = wrappy(inflight) - -function inflight (key, cb) { - if (reqs[key]) { - reqs[key].push(cb) - return null - } else { - reqs[key] = [cb] - return makeres(key) - } -} - -function makeres (key) { - return once(function RES () { - var cbs = reqs[key] - var len = cbs.length - var args = slice(arguments) - - // XXX It's somewhat ambiguous whether a new callback added in this - // pass should be queued for later execution if something in the - // list of callbacks throws, or if it should just be discarded. - // However, it's such an edge case that it hardly matters, and either - // choice is likely as surprising as the other. - // As it happens, we do go ahead and schedule it for later execution. - try { - for (var i = 0; i < len; i++) { - cbs[i].apply(null, args) - } - } finally { - if (cbs.length > len) { - // added more in the interim. - // de-zalgo, just in case, but don't call again. - cbs.splice(0, len) - process.nextTick(function () { - RES.apply(null, args) - }) - } else { - delete reqs[key] - } - } - }) -} - -function slice (args) { - var length = args.length - var array = [] - - for (var i = 0; i < length; i++) array[i] = args[i] - return array -} diff --git a/node_modules/inflight/package.json b/node_modules/inflight/package.json deleted file mode 100644 index 0bfb6cb93..000000000 --- a/node_modules/inflight/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "_from": "inflight@^1.0.4", - "_id": "inflight@1.0.6", - "_inBundle": false, - "_integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "_location": "/inflight", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "inflight@^1.0.4", - "name": "inflight", - "escapedName": "inflight", - "rawSpec": "^1.0.4", - "saveSpec": null, - "fetchSpec": "^1.0.4" - }, - "_requiredBy": [ - "/glob" - ], - "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "_shasum": "49bd6331d7d02d0c09bc910a1075ba8165b56df9", - "_spec": "inflight@^1.0.4", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/glob", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/inflight/issues" - }, - "bundleDependencies": false, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - }, - "deprecated": false, - "description": "Add callbacks to requests in flight to avoid async duplication", - "devDependencies": { - "tap": "^7.1.2" - }, - "files": [ - "inflight.js" - ], - "homepage": "https://github.com/isaacs/inflight", - "license": "ISC", - "main": "inflight.js", - "name": "inflight", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/inflight.git" - }, - "scripts": { - "test": "tap test.js --100" - }, - "version": "1.0.6" -} diff --git a/node_modules/inherits/LICENSE b/node_modules/inherits/LICENSE deleted file mode 100644 index dea3013d6..000000000 --- a/node_modules/inherits/LICENSE +++ /dev/null @@ -1,16 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. - diff --git a/node_modules/inherits/README.md b/node_modules/inherits/README.md deleted file mode 100644 index b1c566585..000000000 --- a/node_modules/inherits/README.md +++ /dev/null @@ -1,42 +0,0 @@ -Browser-friendly inheritance fully compatible with standard node.js -[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). - -This package exports standard `inherits` from node.js `util` module in -node environment, but also provides alternative browser-friendly -implementation through [browser -field](https://gist.github.com/shtylman/4339901). Alternative -implementation is a literal copy of standard one located in standalone -module to avoid requiring of `util`. It also has a shim for old -browsers with no `Object.create` support. - -While keeping you sure you are using standard `inherits` -implementation in node.js environment, it allows bundlers such as -[browserify](https://github.com/substack/node-browserify) to not -include full `util` package to your client code if all you need is -just `inherits` function. It worth, because browser shim for `util` -package is large and `inherits` is often the single function you need -from it. - -It's recommended to use this package instead of -`require('util').inherits` for any code that has chances to be used -not only in node.js but in browser too. - -## usage - -```js -var inherits = require('inherits'); -// then use exactly as the standard one -``` - -## note on version ~1.0 - -Version ~1.0 had completely different motivation and is not compatible -neither with 2.0 nor with standard node.js `inherits`. - -If you are using version ~1.0 and planning to switch to ~2.0, be -careful: - -* new version uses `super_` instead of `super` for referencing - superclass -* new version overwrites current prototype while old one preserves any - existing fields on it diff --git a/node_modules/inherits/inherits.js b/node_modules/inherits/inherits.js deleted file mode 100644 index 3b94763a7..000000000 --- a/node_modules/inherits/inherits.js +++ /dev/null @@ -1,7 +0,0 @@ -try { - var util = require('util'); - if (typeof util.inherits !== 'function') throw ''; - module.exports = util.inherits; -} catch (e) { - module.exports = require('./inherits_browser.js'); -} diff --git a/node_modules/inherits/inherits_browser.js b/node_modules/inherits/inherits_browser.js deleted file mode 100644 index c1e78a75e..000000000 --- a/node_modules/inherits/inherits_browser.js +++ /dev/null @@ -1,23 +0,0 @@ -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 - } -} diff --git a/node_modules/inherits/package.json b/node_modules/inherits/package.json deleted file mode 100644 index 022ca1a68..000000000 --- a/node_modules/inherits/package.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "_from": "inherits@~2.0.1", - "_id": "inherits@2.0.3", - "_inBundle": false, - "_integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "_location": "/inherits", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "inherits@~2.0.1", - "name": "inherits", - "escapedName": "inherits", - "rawSpec": "~2.0.1", - "saveSpec": null, - "fetchSpec": "~2.0.1" - }, - "_requiredBy": [ - "/asn1.js", - "/browserify", - "/browserify-aes", - "/browserify-des", - "/browserify-sign", - "/chokidar", - "/cipher-base", - "/concat-stream", - "/create-hash", - "/create-hmac", - "/crypto-browserify", - "/des.js", - "/elliptic", - "/from2", - "/glob", - "/hash-base", - "/hash.js", - "/http-errors", - "/labeled-stream-splicer", - "/md5.js", - "/module-deps", - "/readable-stream", - "/ripemd160", - "/sha.js", - "/split2/readable-stream", - "/stream-browserify", - "/stream-http", - "/stream-splicer", - "/util" - ], - "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "_shasum": "633c2c83e3da42a502f52466022480f4208261de", - "_spec": "inherits@~2.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "browser": "./inherits_browser.js", - "bugs": { - "url": "https://github.com/isaacs/inherits/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", - "devDependencies": { - "tap": "^7.1.0" - }, - "files": [ - "inherits.js", - "inherits_browser.js" - ], - "homepage": "https://github.com/isaacs/inherits#readme", - "keywords": [ - "inheritance", - "class", - "klass", - "oop", - "object-oriented", - "inherits", - "browser", - "browserify" - ], - "license": "ISC", - "main": "./inherits.js", - "name": "inherits", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/inherits.git" - }, - "scripts": { - "test": "node test" - }, - "version": "2.0.3" -} diff --git a/node_modules/inject-lr-script/LICENSE.md b/node_modules/inject-lr-script/LICENSE.md deleted file mode 100644 index 89a78cf22..000000000 --- a/node_modules/inject-lr-script/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) -Copyright (c) 2015 Matt DesLauriers - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE -OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/node_modules/inject-lr-script/index.js b/node_modules/inject-lr-script/index.js deleted file mode 100644 index 9b52de8f6..000000000 --- a/node_modules/inject-lr-script/index.js +++ /dev/null @@ -1,42 +0,0 @@ -var respModifier = require('resp-modifier') -var path = require('path') - -module.exports = injectLiveReloadSnippet -function injectLiveReloadSnippet (opts) { - opts = opts || {} - - var modifier = respModifier({ - rules: [ - { match: /]*>/i, fn: prepend } - ] - }) - - var fn = function (req, res, next) { - var ext = path.extname(req.url) - if (!ext || /\.html?$/i.test(ext)) { - if (!req.headers.accept) { - req.headers.accept = 'text/html' - } - } - modifier(req, res, next) - } - - fn.host = opts.host - fn.port = opts.port - fn.path = opts.path - fn.local = opts.local - - function snippet () { - var host = fn.host || 'localhost' - var port = fn.port || 35729 - var scriptPath = fn.path || '/livereload.js?snipver=1' - var src = fn.local ? scriptPath : ('//' + host + ':' + port + scriptPath) - return '' - } - - function prepend (req, res, body) { - return body + snippet() - } - - return fn -} diff --git a/node_modules/inject-lr-script/package.json b/node_modules/inject-lr-script/package.json deleted file mode 100644 index 3ed0cffea..000000000 --- a/node_modules/inject-lr-script/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_from": "inject-lr-script@^2.1.0", - "_id": "inject-lr-script@2.1.0", - "_inBundle": false, - "_integrity": "sha1-5htehMEYczkGy+oB7D10Zpijn2U=", - "_location": "/inject-lr-script", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "inject-lr-script@^2.1.0", - "name": "inject-lr-script", - "escapedName": "inject-lr-script", - "rawSpec": "^2.1.0", - "saveSpec": null, - "fetchSpec": "^2.1.0" - }, - "_requiredBy": [ - "/budo" - ], - "_resolved": "https://registry.npmjs.org/inject-lr-script/-/inject-lr-script-2.1.0.tgz", - "_shasum": "e61b5e84c118733906cbea01ec3d746698a39f65", - "_spec": "inject-lr-script@^2.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", - "author": { - "name": "Matt DesLauriers", - "email": "dave.des@gmail.com", - "url": "https://github.com/mattdesl" - }, - "bugs": { - "url": "https://github.com/mattdesl/inject-lr-script/issues" - }, - "bundleDependencies": false, - "dependencies": { - "resp-modifier": "^6.0.0" - }, - "deprecated": false, - "description": "inject live reload into HTML content", - "devDependencies": { - "request": "^2.53.0", - "serve-static": "^1.10.2", - "stacked": "^1.1.1", - "standard": "^5.4.1", - "tape": "^3.5.0" - }, - "homepage": "https://github.com/mattdesl/inject-lr-script", - "keywords": [ - "inject", - "live", - "reload", - "tiny-lr", - "lr", - "tiny", - "tinyreload", - "html" - ], - "license": "MIT", - "main": "index.js", - "name": "inject-lr-script", - "repository": { - "type": "git", - "url": "git://github.com/mattdesl/inject-lr-script.git" - }, - "scripts": { - "test": "standard && node test/test.js" - }, - "version": "2.1.0" -} diff --git a/node_modules/inline-source-map/.npmignore b/node_modules/inline-source-map/.npmignore deleted file mode 100644 index de78e273f..000000000 --- a/node_modules/inline-source-map/.npmignore +++ /dev/null @@ -1,16 +0,0 @@ -lib-cov -*.seed -*.log -*.csv -*.dat -*.out -*.pid -*.gz - -pids -logs -results - -node_modules -npm-debug.log -tmp diff --git a/node_modules/inline-source-map/.travis.yml b/node_modules/inline-source-map/.travis.yml deleted file mode 100644 index ac342082c..000000000 --- a/node_modules/inline-source-map/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -sudo: false -language: node_js -node_js: - - 0.10 - - 0.12 - - io.js -before_install: - - npm install --global npm diff --git a/node_modules/inline-source-map/LICENSE b/node_modules/inline-source-map/LICENSE deleted file mode 100644 index 41702c504..000000000 --- a/node_modules/inline-source-map/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2013 Thorsten Lorenz. -All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/inline-source-map/README.md b/node_modules/inline-source-map/README.md deleted file mode 100644 index 82c6b8b6a..000000000 --- a/node_modules/inline-source-map/README.md +++ /dev/null @@ -1,89 +0,0 @@ -# inline-source-map [![build status](https://secure.travis-ci.org/thlorenz/inline-source-map.png)](http://travis-ci.org/thlorenz/inline-source-map) - -Adds source mappings and base64 encodes them, so they can be inlined in your generated file. - -```js -var generator = require('inline-source-map'); - -// default charset 'utf-8' is configurable -var gen = generator({ charset: 'utf-8' }) - .addMappings('foo.js', [{ original: { line: 2, column: 3 } , generated: { line: 5, column: 10 } }], { line: 5 }) - .addGeneratedMappings('bar.js', 'var a = 2;\nconsole.log(a)', { line: 23, column: 22 }); - -console.log('base64 mapping:', gen.base64Encode()); -console.log('inline mapping url:', gen.inlineMappingUrl()); -``` - -``` -base64 mapping: eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmb28uanMiLCJiYXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O1VBQ0c7Ozs7Ozs7Ozs7Ozs7O3NCQ0RIO3NCQUNBIn0= -inline mapping url: //@ sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJmb28uanMiLCJiYXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O1VBQ0c7Ozs7Ozs7Ozs7Ozs7O3NCQ0RIO3NCQUNBIn0= -``` - -## API - -### addMappings(sourceFile, mappings, offset) - -``` -/** - * Adds the given mappings to the generator and offsets them if offset is given - * - * @name addMappings - * @function - * @param sourceFile {String} name of the source file - * @param mappings {Array{{Object}} each object has the form { original: { line: _, column: _ }, generated: { line: _, column: _ } } - * @param offset {Object} offset to apply to each mapping. Has the form { line: _, column: _ } - * @return {Object} the generator to allow chaining - */ -``` - -### addGeneratedMappings(sourceFile, source, offset) - -``` -/** - * Generates mappings for the given source and adds them, assuming that no translation from original to generated is necessary. - * - * @name addGeneratedMappings - * @function - * @param sourceFile {String} name of the source file - * @param source {String} source of the file - * @param offset {Object} offset to apply to each mapping. Has the form { line: _, column: _ } - * @return {Object} the generator to allow chaining - */ -``` - -### addSourceContent(sourceFile, sourceContent) - -``` -/** - * Adds source content for the given source file. - * - * @name addSourceContent - * @function - * @param sourceFile {String} The source file for which a mapping is included - * @param sourceContent {String} The content of the source file - * @return {Object} The generator to allow chaining - */ -``` - - -### base64Encode() - -``` -/** - * @name base64Encode - * @function - * @return {String} bas64 encoded representation of the added mappings - */ -``` - -If source contents were added, this will be included in the encoded mappings. - -### inlineMappingUrl() - -``` -/** - * @name inlineMappingUrl - * @function - * @return {String} comment with base64 encoded representation of the added mappings. Can be inlined at the end of the generated file. - */ -``` diff --git a/node_modules/inline-source-map/example/foo-bar.js b/node_modules/inline-source-map/example/foo-bar.js deleted file mode 100644 index 247ee3082..000000000 --- a/node_modules/inline-source-map/example/foo-bar.js +++ /dev/null @@ -1,8 +0,0 @@ -var generator = require('..'); - -var gen = generator() - .addMappings('foo.js', [{ original: { line: 2, column: 3 } , generated: { line: 5, column: 10 } }], { line: 5 }) - .addGeneratedMappings('bar.js', 'var a = 2;\nconsole.log(a)', { line: 23, column: 22 }); - -console.log('base64 mapping', gen.base64Encode()); -console.log('inline mapping url', gen.inlineMappingUrl()); diff --git a/node_modules/inline-source-map/index.js b/node_modules/inline-source-map/index.js deleted file mode 100644 index df74d6126..000000000 --- a/node_modules/inline-source-map/index.js +++ /dev/null @@ -1,135 +0,0 @@ -'use strict'; -var SourceMapGenerator = require('source-map').SourceMapGenerator; - -function offsetMapping(mapping, offset) { - return { line: offset.line + mapping.line, column: offset.column + mapping.column }; -} - -function newlinesIn(src) { - if (!src) return 0; - var newlines = src.match(/\n/g); - - return newlines ? newlines.length : 0; -} - -function Generator(opts) { - opts = opts || {}; - this.generator = new SourceMapGenerator({ file: opts.file || '', sourceRoot: opts.sourceRoot || '' }); - this.sourcesContent = undefined; - this.opts = opts; -} - -/** - * Adds the given mappings to the generator and offsets them if offset is given - * - * @name addMappings - * @function - * @param sourceFile {String} name of the source file - * @param mappings {Array{{Object}} each object has the form { original: { line: _, column: _ }, generated: { line: _, column: _ } } - * @param offset {Object} offset to apply to each mapping. Has the form { line: _, column: _ } - * @return {Object} the generator to allow chaining - */ -Generator.prototype.addMappings = function (sourceFile, mappings, offset) { - var generator = this.generator; - - offset = offset || {}; - offset.line = offset.hasOwnProperty('line') ? offset.line : 0; - offset.column = offset.hasOwnProperty('column') ? offset.column : 0; - - mappings.forEach(function (m) { - // only set source if we have original position to handle edgecase (see inline-source-map tests) - generator.addMapping({ - source : m.original ? sourceFile : undefined - , original : m.original - , generated : offsetMapping(m.generated, offset) - }); - }); - return this; -}; - -/** - * Generates mappings for the given source, assuming that no translation from original to generated is necessary. - * - * @name addGeneratedMappings - * @function - * @param sourceFile {String} name of the source file - * @param source {String} source of the file - * @param offset {Object} offset to apply to each mapping. Has the form { line: _, column: _ } - * @return {Object} the generator to allow chaining - */ -Generator.prototype.addGeneratedMappings = function (sourceFile, source, offset) { - var mappings = [] - , linesToGenerate = newlinesIn(source) + 1; - - for (var line = 1; line <= linesToGenerate; line++) { - var location = { line: line, column: 0 }; - mappings.push({ original: location, generated: location }); - } - - return this.addMappings(sourceFile, mappings, offset); -}; - -/** - * Adds source content for the given source file. - * - * @name addSourceContent - * @function - * @param sourceFile {String} The source file for which a mapping is included - * @param sourcesContent {String} The content of the source file - * @return {Object} The generator to allow chaining - */ -Generator.prototype.addSourceContent = function (sourceFile, sourcesContent) { - this.sourcesContent = this.sourcesContent || {}; - this.sourcesContent[sourceFile] = sourcesContent; - return this; -}; - -/** - * @name base64Encode - * @function - * @return {String} bas64 encoded representation of the added mappings - */ -Generator.prototype.base64Encode = function () { - var map = this.toString(); - return new Buffer(map).toString('base64'); -}; - -/** - * @name inlineMappingUrl - * @function - * @return {String} comment with base64 encoded representation of the added mappings. Can be inlined at the end of the generated file. - */ -Generator.prototype.inlineMappingUrl = function () { - var charset = this.opts.charset || 'utf-8'; - return '//# sourceMappingURL=data:application/json;charset=' + charset + ';base64,' + this.base64Encode(); -}; - -Generator.prototype.toJSON = function () { - var map = this.generator.toJSON(); - if (!this.sourcesContent) return map; - - var toSourcesContent = (function (s) { - if (typeof this.sourcesContent[s] === 'string') { - return this.sourcesContent[s]; - } else { - return null; - } - }).bind(this); - map.sourcesContent = map.sources.map(toSourcesContent); - return map; -}; - -Generator.prototype.toString = function () { - return JSON.stringify(this); -}; - -Generator.prototype._mappings = function () { - return this.generator._mappings._array; -}; - -Generator.prototype.gen = function () { - return this.generator; -}; - -module.exports = function (opts) { return new Generator(opts); }; -module.exports.Generator = Generator; diff --git a/node_modules/inline-source-map/package.json b/node_modules/inline-source-map/package.json deleted file mode 100644 index d67309de1..000000000 --- a/node_modules/inline-source-map/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "_from": "inline-source-map@~0.6.0", - "_id": "inline-source-map@0.6.2", - "_inBundle": false, - "_integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", - "_location": "/inline-source-map", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "inline-source-map@~0.6.0", - "name": "inline-source-map", - "escapedName": "inline-source-map", - "rawSpec": "~0.6.0", - "saveSpec": null, - "fetchSpec": "~0.6.0" - }, - "_requiredBy": [ - "/combine-source-map" - ], - "_resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", - "_shasum": "f9393471c18a79d1724f863fa38b586370ade2a5", - "_spec": "inline-source-map@~0.6.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/combine-source-map", - "author": { - "name": "Thorsten Lorenz", - "email": "thlorenz@gmx.de", - "url": "http://thlorenz.com" - }, - "bugs": { - "url": "https://github.com/thlorenz/inline-source-map/issues" - }, - "bundleDependencies": false, - "dependencies": { - "source-map": "~0.5.3" - }, - "deprecated": false, - "description": "Adds source mappings and base64 encodes them, so they can be inlined in your generated file.", - "devDependencies": { - "nave": "~0.5.0", - "tap": "~0.7.0" - }, - "engine": { - "node": ">=0.6" - }, - "homepage": "https://github.com/thlorenz/inline-source-map", - "keywords": [ - "source", - "map", - "inline", - "base64", - "bundle", - "generate", - "transpile" - ], - "license": "MIT", - "main": "index.js", - "name": "inline-source-map", - "repository": { - "type": "git", - "url": "git://github.com/thlorenz/inline-source-map.git" - }, - "scripts": { - "test": "if [ -e $TRAVIS ]; then npm run test-all; else npm run test-main; fi", - "test-0.10": "nave use 0.10 npm run test-main", - "test-0.12": "nave use 0.12 npm run test-main", - "test-0.8": "nave use 0.8 npm run test-main", - "test-all": "npm run test-main && npm run test-0.8 && npm run test-0.10 && npm run test-0.12", - "test-main": "tap test/*.js" - }, - "version": "0.6.2" -} diff --git a/node_modules/inline-source-map/test/inline-source-map.js b/node_modules/inline-source-map/test/inline-source-map.js deleted file mode 100644 index a6b9f5ee3..000000000 --- a/node_modules/inline-source-map/test/inline-source-map.js +++ /dev/null @@ -1,342 +0,0 @@ -'use strict'; -/*jshint asi: true*/ - -var test = require('tap').test -var generator = require('..'); - -var foo = '' + function foo () { - var hello = 'hello'; - var world = 'world'; - console.log('%s %s', hello, world); -} - -var bar = '' + function bar () { - console.log('yes?'); -} - -function decode(base64) { - return new Buffer(base64, 'base64').toString(); -} - -function inspect(obj, depth) { - console.error(require('util').inspect(obj, false, depth || 5, true)); -} - -test('generated mappings', function (t) { - - t.test('one file no offset', function (t) { - var gen = generator() - .addGeneratedMappings('foo.js', foo) - - t.deepEqual( - gen._mappings() - , [ { generatedLine: 1, - generatedColumn: 0, - originalLine: 1, - originalColumn: 0, - source: 'foo.js', - name: null }, - { generatedLine: 2, - generatedColumn: 0, - originalLine: 2, - originalColumn: 0, - source: 'foo.js', - name: null }, - { generatedLine: 3, - generatedColumn: 0, - originalLine: 3, - originalColumn: 0, - source: 'foo.js', - name: null }, - { generatedLine: 4, - generatedColumn: 0, - originalLine: 4, - originalColumn: 0, - source: 'foo.js', - name: null }, - { generatedLine: 5, - generatedColumn: 0, - originalLine: 5, - originalColumn: 0, - source: 'foo.js', - name: null } ] - , 'generates correct mappings' - ) - - t.deepEqual( - JSON.parse(decode(gen.base64Encode())) - , {"version":3,"file":"","sources":["foo.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA","sourceRoot":""} - , 'encodes generated mappings' - ) - t.equal( - gen.inlineMappingUrl() - , '//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6IiIsInNvdXJjZVJvb3QiOiIifQ==' - , 'returns correct inline mapping url' - ) - t.end() - }) - - t.test('two files no offset', function (t) { - var gen = generator() - .addGeneratedMappings('foo.js', foo) - .addGeneratedMappings('bar.js', bar) - - t.deepEqual( - gen._mappings() - , [ { generatedLine: 1, - generatedColumn: 0, - originalLine: 1, - originalColumn: 0, - source: 'foo.js', - name: null }, - { generatedLine: 2, - generatedColumn: 0, - originalLine: 2, - originalColumn: 0, - source: 'foo.js', - name: null }, - { generatedLine: 3, - generatedColumn: 0, - originalLine: 3, - originalColumn: 0, - source: 'foo.js', - name: null }, - { generatedLine: 4, - generatedColumn: 0, - originalLine: 4, - originalColumn: 0, - source: 'foo.js', - name: null }, - { generatedLine: 5, - generatedColumn: 0, - originalLine: 5, - originalColumn: 0, - source: 'foo.js', - name: null }, - { generatedLine: 1, - generatedColumn: 0, - originalLine: 1, - originalColumn: 0, - source: 'bar.js', - name: null }, - { generatedLine: 2, - generatedColumn: 0, - originalLine: 2, - originalColumn: 0, - source: 'bar.js', - name: null }, - { generatedLine: 3, - generatedColumn: 0, - originalLine: 3, - originalColumn: 0, - source: 'bar.js', - name: null } ] - , 'generates correct mappings' - ) - t.deepEqual( - JSON.parse(decode(gen.base64Encode())) - , {"version":3,"file":"","sources":["foo.js","bar.js"],"names":[],"mappings":"ACAA,ADAA;ACCA,ADAA;ACCA,ADAA;AACA;AACA","sourceRoot": ""} - , 'encodes generated mappings' - ) - t.equal( - gen.inlineMappingUrl() - , '//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvby5qcyIsImJhci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUNBQSxBREFBO0FDQ0EsQURBQTtBQ0NBLEFEQUE7QUFDQTtBQUNBIiwiZmlsZSI6IiIsInNvdXJjZVJvb3QiOiIifQ==' - , 'returns correct inline mapping url' - ) - t.end() - }) - - t.test('one line source', function (t) { - var gen = generator().addGeneratedMappings('one-liner.js', 'console.log("line one");') - t.deepEqual( - gen._mappings() - , [ { generatedLine: 1, - generatedColumn: 0, - originalLine: 1, - originalColumn: 0, - source: 'one-liner.js', - name: null } ] - , 'generates correct mappings' - ) - t.end() - }) - - t.test('with offset', function (t) { - var gen = generator() - .addGeneratedMappings('foo.js', foo, { line: 20 }) - .addGeneratedMappings('bar.js', bar, { line: 23, column: 22 }) - - t.deepEqual( - gen._mappings() - , [ { generatedLine: 21, - generatedColumn: 0, - originalLine: 1, - originalColumn: 0, - source: 'foo.js', - name: null }, - { generatedLine: 22, - generatedColumn: 0, - originalLine: 2, - originalColumn: 0, - source: 'foo.js', - name: null }, - { generatedLine: 23, - generatedColumn: 0, - originalLine: 3, - originalColumn: 0, - source: 'foo.js', - name: null }, - { generatedLine: 24, - generatedColumn: 0, - originalLine: 4, - originalColumn: 0, - source: 'foo.js', - name: null }, - { generatedLine: 25, - generatedColumn: 0, - originalLine: 5, - originalColumn: 0, - source: 'foo.js', - name: null }, - { generatedLine: 24, - generatedColumn: 22, - originalLine: 1, - originalColumn: 0, - source: 'bar.js', - name: null }, - { generatedLine: 25, - generatedColumn: 22, - originalLine: 2, - originalColumn: 0, - source: 'bar.js', - name: null }, - { generatedLine: 26, - generatedColumn: 22, - originalLine: 3, - originalColumn: 0, - source: 'bar.js', - name: null } ] - , 'generates correct mappings' - ) - - t.deepEqual( - JSON.parse(decode(gen.base64Encode())) - , {"version":3,"file":"","sources":["foo.js","bar.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA,sBCHA;ADIA,sBCHA;sBACA", "sourceRoot": ""} - , 'encodes generated mappings with offset' - ) - t.end() - }) -}) - -test('given mappings, with one having no original', function (t) { - t.test('no offset', function (t) { - var gen = generator() - .addMappings('foo.js', [{ original: { line: 2, column: 3 } , generated: { line: 5, column: 10 } }]) - - // This addresses an edgecase in which a transpiler generates mappings but doesn't include the original position. - // If we set source to sourceFile (as usual) in that case, the mappings are considered invalid by the source-map module's - // SourceMapGenerator. Keeping source undefined fixes this problem. - // Raised issue: https://github.com/thlorenz/inline-source-map/issues/2 - // Validate function: https://github.com/mozilla/source-map/blob/a3372ea78e662582087dd25ebda999c06424e047/lib/source-map/source-map-generator.js#L232 - .addMappings('bar.js', [ - { original: { line: 6, column: 0 } , generated: { line: 7, column: 20 } } - , { generated: { line: 8, column: 30 } } - ]) - - t.deepEqual( - gen._mappings() - , [ { generatedLine: 5, - generatedColumn: 10, - originalLine: 2, - originalColumn: 3, - source: 'foo.js', - name: null }, - { generatedLine: 7, - generatedColumn: 20, - originalLine: 6, - originalColumn: 0, - source: 'bar.js', - name: null }, - { generatedLine: 8, - generatedColumn: 30, - originalLine: false, - originalColumn: false, - source: undefined, - name: null } ] - , 'adds correct mappings' - ) - t.deepEqual( - JSON.parse(decode(gen.base64Encode())) - , {"version":3,"file":"","sources":["foo.js","bar.js"],"names":[],"mappings":";;;;UACG;;oBCIH;8B", sourceRoot: ""} - , 'encodes generated mappings' - ) - t.equal( - gen.inlineMappingUrl() - , '//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvby5qcyIsImJhci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O1VBQ0c7O29CQ0lIOzhCIiwiZmlsZSI6IiIsInNvdXJjZVJvb3QiOiIifQ==' - , 'returns correct inline mapping url' - ) - t.end() - }) - - t.test('with offset', function (t) { - var gen = generator() - .addMappings('foo.js', [{ original: { line: 2, column: 3 } , generated: { line: 5, column: 10 } }], { line: 5 }) - .addMappings('bar.js', [{ original: { line: 6, column: 0 } , generated: { line: 7, column: 20 } }, { generated: { line: 8, column: 30 } }], { line: 9, column: 3 }) - - t.deepEqual( - gen._mappings() - , [ { generatedLine: 10, - generatedColumn: 10, - originalLine: 2, - originalColumn: 3, - source: 'foo.js', - name: null }, - { generatedLine: 16, - generatedColumn: 23, - originalLine: 6, - originalColumn: 0, - source: 'bar.js', - name: null }, - { generatedLine: 17, - generatedColumn: 33, - originalLine: false, - originalColumn: false, - source: undefined, - name: null } ] - , 'adds correct mappings' - ) - t.deepEqual( - JSON.parse(decode(gen.base64Encode())) - , {"version":3,"file":"","sources":["foo.js","bar.js"],"names":[],"mappings":";;;;;;;;;UACG;;;;;;uBCIH;iC", sourceRoot: ""} - , 'encodes mappings with offset' - ) - t.end() - }) -}); - -test('inline mapping url with charset opt', function(t){ - t.test('set inline mapping url charset to gbk', function(t){ - var gen = generator({charset: 'gbk'}) - .addGeneratedMappings('foo.js', foo); - t.equal( - gen.inlineMappingUrl(), - '//# sourceMappingURL=data:application/json;charset=gbk;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6IiIsInNvdXJjZVJvb3QiOiIifQ==', - 'charset set to gbk' - ); - - t.end(); - }); - - t.test('default charset should be utf-8', function(t){ - var gen = generator() - .addGeneratedMappings('foo.js', foo); - - t.equal( - gen.inlineMappingUrl(), - '//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6IiIsInNvdXJjZVJvb3QiOiIifQ==', - 'charset default to utf-8' - ); - - t.end(); - }); -}); diff --git a/node_modules/inline-source-map/test/source-content.js b/node_modules/inline-source-map/test/source-content.js deleted file mode 100644 index d18997d65..000000000 --- a/node_modules/inline-source-map/test/source-content.js +++ /dev/null @@ -1,143 +0,0 @@ -'use strict'; -/*jshint asi: true*/ - -var test = require('tap').test -var generator = require('..'); - -var foo = '' + function foo () { - var hello = 'hello'; - var world = 'world'; - console.log('%s %s', hello, world); -} - -var bar = '' + function bar () { - console.log('yes?'); -} - -function decode(base64) { - return new Buffer(base64, 'base64').toString(); -} - -function inspect(obj, depth) { - console.log(require('util').inspect(obj, false, depth || 5, true)); -} - -test('generated mappings', function (t) { - - t.test('one file with source content', function (t) { - var gen = generator() - .addGeneratedMappings('foo.js', foo) - .addSourceContent('foo.js', foo) - - t.deepEqual( - gen.toJSON() - , { "version": 3, - "file": "", - "sources": [ - "foo.js" - ], - "names": [], - "mappings": "AAAA;AACA;AACA;AACA;AACA", - "sourceRoot": "", - "sourcesContent": [ - "function foo() {\n var hello = 'hello';\n var world = 'world';\n console.log('%s %s', hello, world);\n}" - ], - } - , 'includes source content' - ) - - t.equal( - decode(gen.base64Encode()) - , '{"version":3,"sources":["foo.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA","file":"","sourceRoot":"","sourcesContent":["function foo() {\\n var hello = \'hello\';\\n var world = \'world\';\\n console.log(\'%s %s\', hello, world);\\n}"]}' - , 'encodes generated mappings including source content' - ) - t.equal( - gen.inlineMappingUrl() - , '//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6IiIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJmdW5jdGlvbiBmb28oKSB7XG4gIHZhciBoZWxsbyA9ICdoZWxsbyc7XG4gIHZhciB3b3JsZCA9ICd3b3JsZCc7XG4gIGNvbnNvbGUubG9nKCclcyAlcycsIGhlbGxvLCB3b3JsZCk7XG59Il19' - , 'returns correct inline mapping url including source content' - ) - t.end() - }) - - t.test('two files with source content', function (t) { - var gen = generator() - .addGeneratedMappings('foo.js', foo) - .addSourceContent('foo.js', foo) - .addGeneratedMappings('bar.js', bar) - .addSourceContent('bar.js', bar) - - t.deepEqual( - gen.toJSON() - , { "version": 3, - "file": "", - "sources": [ - "foo.js", - "bar.js" - ], - "names": [], - "mappings": "ACAA,ADAA;ACCA,ADAA;ACCA,ADAA;AACA;AACA", - "sourceRoot": "", - "sourcesContent": [ - "function foo() {\n var hello = 'hello';\n var world = 'world';\n console.log('%s %s', hello, world);\n}", - "function bar() {\n console.log('yes?');\n}" - ], - } - , 'includes source content for both files' - ) - - t.deepEqual( - decode(gen.base64Encode()) - , '{"version":3,"sources":["foo.js","bar.js"],"names":[],"mappings":"ACAA,ADAA;ACCA,ADAA;ACCA,ADAA;AACA;AACA","file":"","sourceRoot":"","sourcesContent":["function foo() {\\n var hello = \'hello\';\\n var world = \'world\';\\n console.log(\'%s %s\', hello, world);\\n}","function bar() {\\n console.log(\'yes?\');\\n}"]}' - , 'encodes generated mappings including source content' - ) - t.equal( - gen.inlineMappingUrl() - , '//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvby5qcyIsImJhci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUNBQSxBREFBO0FDQ0EsQURBQTtBQ0NBLEFEQUE7QUFDQTtBQUNBIiwiZmlsZSI6IiIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJmdW5jdGlvbiBmb28oKSB7XG4gIHZhciBoZWxsbyA9ICdoZWxsbyc7XG4gIHZhciB3b3JsZCA9ICd3b3JsZCc7XG4gIGNvbnNvbGUubG9nKCclcyAlcycsIGhlbGxvLCB3b3JsZCk7XG59IiwiZnVuY3Rpb24gYmFyKCkge1xuICBjb25zb2xlLmxvZygneWVzPycpO1xufSJdfQ==' - , 'returns correct inline mapping url including source content' - ) - t.end() - }) - - t.test('two files, only one with source content', function (t) { - var gen = generator() - .addGeneratedMappings('foo.js', foo) - .addGeneratedMappings('bar.js', bar) - .addSourceContent('bar.js', bar) - - t.deepEqual( - gen.toJSON() - , { "version": 3, - "file": "", - "sources": [ - "foo.js", - "bar.js" - ], - "names": [], - "mappings": "ACAA,ADAA;ACCA,ADAA;ACCA,ADAA;AACA;AACA", - "sourcesContent": [ null, "function bar() {\n console.log('yes?');\n}" ], - "sourceRoot": "" - } - , 'includes source content for the file with source content and [null] for the other file' - ) - - t.deepEqual( - decode(gen.base64Encode()) - , '{"version":3,"sources":["foo.js","bar.js"],"names":[],"mappings":"ACAA,ADAA;ACCA,ADAA;ACCA,ADAA;AACA;AACA","file":"","sourceRoot":"","sourcesContent":[null,"function bar() {\\n console.log(\'yes?\');\\n}"]}' - , 'encodes generated mappings including source content' - ) - t.equal( - gen.inlineMappingUrl() - , '//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvby5qcyIsImJhci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUNBQSxBREFBO0FDQ0EsQURBQTtBQ0NBLEFEQUE7QUFDQTtBQUNBIiwiZmlsZSI6IiIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzQ29udGVudCI6W251bGwsImZ1bmN0aW9uIGJhcigpIHtcbiAgY29uc29sZS5sb2coJ3llcz8nKTtcbn0iXX0=' - , 'returns correct inline mapping url including source content' - ) - t.end() - }) - - t.test('one file with empty source', function (t) { - var gen = generator() - .addGeneratedMappings('empty.js', '') - .addSourceContent('empty.js', '') - t.deepEqual(gen.toJSON()["sourcesContent"], [""]) - t.end() - }); -}) diff --git a/node_modules/insert-css/LICENSE b/node_modules/insert-css/LICENSE deleted file mode 100644 index ee27ba4b4..000000000 --- a/node_modules/insert-css/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/insert-css/example/bundle.js b/node_modules/insert-css/example/bundle.js deleted file mode 100644 index ace6f6d3b..000000000 --- a/node_modules/insert-css/example/bundle.js +++ /dev/null @@ -1,31 +0,0 @@ -;(function(e,t,n,r){function i(r){if(!n[r]){if(!t[r]){if(e)return e(r);throw new Error("Cannot find module '"+r+"'")}var s=n[r]={exports:{}};t[r][0](function(e){var n=t[r][1][e];return i(n?n:e)},s,s.exports)}return n[r].exports}for(var s=0;s= 0) return; - inserted.push(css); - - var elem = document.createElement('style'); - var text = document.createTextNode(css); - elem.appendChild(text); - - if (document.head.childNodes.length) { - document.head.insertBefore(elem, document.head.childNodes[0]); - } - else { - document.head.appendChild(elem); - } -}; - -},{}],2:[function(require,module,exports){ -// nothing to see here... no file methods for the browser - -},{}]},{},[1]) -; \ No newline at end of file diff --git a/node_modules/insert-css/example/index.html b/node_modules/insert-css/example/index.html deleted file mode 100644 index 907497298..000000000 --- a/node_modules/insert-css/example/index.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/node_modules/insert-css/example/insert.js b/node_modules/insert-css/example/insert.js deleted file mode 100644 index a8a226435..000000000 --- a/node_modules/insert-css/example/insert.js +++ /dev/null @@ -1,5 +0,0 @@ -var fs = require('fs'); -var insertCss = require('../'); -var css = fs.readFileSync(__dirname + '/style.css'); -insertCss(css); -document.body.appendChild(document.createTextNode('HELLO CRUEL WORLD')); diff --git a/node_modules/insert-css/example/style.css b/node_modules/insert-css/example/style.css deleted file mode 100644 index 01efe8977..000000000 --- a/node_modules/insert-css/example/style.css +++ /dev/null @@ -1,4 +0,0 @@ -body { - background-color: purple; - color: yellow; -} diff --git a/node_modules/insert-css/index.js b/node_modules/insert-css/index.js deleted file mode 100644 index 51753a564..000000000 --- a/node_modules/insert-css/index.js +++ /dev/null @@ -1,22 +0,0 @@ -var inserted = {}; - -module.exports = function (css, options) { - if (inserted[css]) return; - inserted[css] = true; - - var elem = document.createElement('style'); - elem.setAttribute('type', 'text/css'); - - if ('textContent' in elem) { - elem.textContent = css; - } else { - elem.styleSheet.cssText = css; - } - - var head = document.getElementsByTagName('head')[0]; - if (options && options.prepend) { - head.insertBefore(elem, head.childNodes[0]); - } else { - head.appendChild(elem); - } -}; diff --git a/node_modules/insert-css/package.json b/node_modules/insert-css/package.json deleted file mode 100644 index 127b61e76..000000000 --- a/node_modules/insert-css/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_from": "insert-css@^0.2.0", - "_id": "insert-css@0.2.0", - "_inBundle": false, - "_integrity": "sha1-0VeJlxZi2YmcKJd/tiINU4HSRRo=", - "_location": "/insert-css", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "insert-css@^0.2.0", - "name": "insert-css", - "escapedName": "insert-css", - "rawSpec": "^0.2.0", - "saveSpec": null, - "fetchSpec": "^0.2.0" - }, - "_requiredBy": [ - "/csjs-inject" - ], - "_resolved": "https://registry.npmjs.org/insert-css/-/insert-css-0.2.0.tgz", - "_shasum": "d15789971662d9899c28977fb6220d5381d2451a", - "_spec": "insert-css@^0.2.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/csjs-inject", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/insert-css/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "insert a string of css into the ", - "devDependencies": { - "computed-style": "~0.1.3", - "tape": "^2.13.3" - }, - "homepage": "https://github.com/substack/insert-css", - "keywords": [ - "css", - "insert", - "dom", - "browser", - "browserify" - ], - "license": "MIT", - "main": "index.js", - "name": "insert-css", - "repository": { - "type": "git", - "url": "git://github.com/substack/insert-css.git" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/6..latest", - "chrome/20..latest", - "firefox/10..latest", - "safari/latest", - "opera/11.0..latest", - "iphone/6", - "ipad/6" - ] - }, - "version": "0.2.0" -} diff --git a/node_modules/insert-css/readme.markdown b/node_modules/insert-css/readme.markdown deleted file mode 100644 index bac37bd4e..000000000 --- a/node_modules/insert-css/readme.markdown +++ /dev/null @@ -1,53 +0,0 @@ -# insert-css - -insert a string of css into the `` - -[![browser support](https://ci.testling.com/substack/insert-css.png)](https://ci.testling.com/substack/insert-css) - -# example - -suppose we've got some css: - -``` css -body { - background-color: purple; - color: yellow; -} -``` - -and we want to bundle that css into a js file so that we can write an entirely -self-contained module: - -``` js -var fs = require('fs'); -var insertCss = require('insert-css'); -var css = fs.readFileSync(__dirname + '/style.css'); -insertCss(css); -document.body.appendChild(document.createTextNode('HELLO CRUEL WORLD')); -``` - -optionally prepend the css to the head with the `prepend` option: - -``` js -insertCss(css, { prepend: true }); -``` - -compile with [browserify](http://browserify.org) using -[brfs](https://github.com/substack/brfs) to inline the `fs.readFile()` -call: - -``` -$ browserify -t brfs insert.js > bundle.js -``` - -Now plop that bundle.js into a script tag and you'll have a self-contained js -blob with inline css! - -``` html - - - - - - -``` diff --git a/node_modules/insert-css/test/insert.js b/node_modules/insert-css/test/insert.js deleted file mode 100644 index 5b0c22116..000000000 --- a/node_modules/insert-css/test/insert.js +++ /dev/null @@ -1,48 +0,0 @@ -var test = require('tape'); -var insertCss = require('../'); -var getStyle = require('computed-style'); - -var css = 'body { background-color: purple; color: yellow; }'; - -test(function (t) { - t.plan(10); - - var before = colors(); - t.ok(before.bg === 'rgba(0,0,0,0)' || before.bg === 'transparent'); - t.ok(before.fg === 'rgb(0,0,0)' || before.fg === '#000000'); - - insertCss(css, { prepend: true }); - - var after = colors(); - t.ok(after.bg === 'rgb(128,0,128)' || after.bg === 'purple'); - t.ok(after.fg === 'rgb(255,255,0)' || after.fg === 'yellow'); - - var resetStyle = 'body { background-color: transparent; color: #000000; }'; - insertCss(resetStyle); - - var reset = colors(); - t.ok(reset.bg === 'rgba(0,0,0,0)' || reset.bg === 'transparent'); - t.ok(reset.fg === 'rgb(0,0,0)' || reset.fg === '#000000'); - - var resetStyle = 'body { background-color: green; color: pink; }'; - insertCss(resetStyle, { prepend: true }); - - var reset = colors(); - t.ok(reset.bg === 'rgba(0,0,0,0)' || reset.bg === 'transparent'); - t.ok(reset.fg === 'rgb(0,0,0)' || reset.fg === '#000000'); - - var resetStyle = 'body { background-color: yellow; color: purple; }'; - insertCss(resetStyle, { prepend: false }); - - var reset = colors(); - t.ok(reset.bg === 'rgb(255,255,0)' || reset.bg === 'yellow'); - t.ok(reset.fg === 'rgb(128,0,128)' || reset.fg === 'purple'); -}); - -function colors () { - var body = document.getElementsByTagName('body')[0]; - return { - bg: getStyle(body, 'backgroundColor').replace(/\s+/g, ''), - fg: getStyle(body, 'color').replace(/\s+/g, '') - }; -} diff --git a/node_modules/insert-module-globals/.travis.yml b/node_modules/insert-module-globals/.travis.yml deleted file mode 100644 index 4eaf0db4c..000000000 --- a/node_modules/insert-module-globals/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - "0.10" - - "0.12" - - node diff --git a/node_modules/insert-module-globals/LICENSE b/node_modules/insert-module-globals/LICENSE deleted file mode 100644 index ee27ba4b4..000000000 --- a/node_modules/insert-module-globals/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/insert-module-globals/appveyor.yml b/node_modules/insert-module-globals/appveyor.yml deleted file mode 100644 index 9ca7511ac..000000000 --- a/node_modules/insert-module-globals/appveyor.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: "{build}" - -environment: - matrix: - - nodejs_version: "" # lastest - - nodejs_version: "0.12" - - nodejs_version: "0.10" - -install: - - ps: Install-Product node $env:nodejs_version - - npm install - -build: off - -test_script: - - node --version - - npm --version - - npm test diff --git a/node_modules/insert-module-globals/bench/.gitattributes b/node_modules/insert-module-globals/bench/.gitattributes deleted file mode 100644 index e5789cac6..000000000 --- a/node_modules/insert-module-globals/bench/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -jquery-3.3.1.js -diff diff --git a/node_modules/insert-module-globals/bench/index.js b/node_modules/insert-module-globals/bench/index.js deleted file mode 100644 index e138aef5a..000000000 --- a/node_modules/insert-module-globals/bench/index.js +++ /dev/null @@ -1,15 +0,0 @@ -var bench = require('nanobench'); -var path = require('path'); -var fs = require('fs'); -var insert = require('../'); - -bench('jquery', function (b) { - var source = fs.readFileSync(path.join(__dirname, 'jquery-3.3.1.js')); - b.start(); - var stream = insert(); - stream.on('data', function() {}); - stream.on('end', function () { - b.end(); - }); - stream.end(source); -}); diff --git a/node_modules/insert-module-globals/bin/cmd.js b/node_modules/insert-module-globals/bin/cmd.js deleted file mode 100755 index 3efe095e5..000000000 --- a/node_modules/insert-module-globals/bin/cmd.js +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env node - -var insert = require('../'); -var through = require('through2'); -var concat = require('concat-stream'); -var JSONStream = require('JSONStream'); - -var basedir = process.argv[2] || process.cwd(); - -process.stdin - .pipe(JSONStream.parse([ true ])) - .pipe(through.obj(write)) - .pipe(JSONStream.stringify()) - .pipe(process.stdout) -; - -function write (row, enc, next) { - var self = this; - var s = insert(row.id, { basedir: basedir }); - s.pipe(concat(function (src) { - row.source = src.toString('utf8'); - self.push(row); - next(); - })); - s.end(row.source); -} diff --git a/node_modules/insert-module-globals/example/files/foo/index.js b/node_modules/insert-module-globals/example/files/foo/index.js deleted file mode 100644 index 1f477ad78..000000000 --- a/node_modules/insert-module-globals/example/files/foo/index.js +++ /dev/null @@ -1,6 +0,0 @@ -process.nextTick(function () { - console.log('in foo/index.js: ' + JSON.stringify({ - __filename: __filename, - __dirname: __dirname - })); -}); diff --git a/node_modules/insert-module-globals/example/files/main.js b/node_modules/insert-module-globals/example/files/main.js deleted file mode 100644 index 4b359a25e..000000000 --- a/node_modules/insert-module-globals/example/files/main.js +++ /dev/null @@ -1,6 +0,0 @@ -console.log('in main.js: ' + JSON.stringify({ - __filename: __filename, - __dirname: __dirname -})); - -require('./foo'); diff --git a/node_modules/insert-module-globals/example/insert.js b/node_modules/insert-module-globals/example/insert.js deleted file mode 100644 index d2caefcf0..000000000 --- a/node_modules/insert-module-globals/example/insert.js +++ /dev/null @@ -1,12 +0,0 @@ -var mdeps = require('module-deps'); -var bpack = require('browser-pack'); -var insert = require('../'); -function inserter (file) { - return insert(file, { basedir: __dirname + '/files' }); -} - -var files = [ __dirname + '/files/main.js' ]; -mdeps(files, { transform: inserter }) - .pipe(bpack({ raw: true })) - .pipe(process.stdout) -; diff --git a/node_modules/insert-module-globals/index.js b/node_modules/insert-module-globals/index.js deleted file mode 100644 index c697437e0..000000000 --- a/node_modules/insert-module-globals/index.js +++ /dev/null @@ -1,194 +0,0 @@ -var undeclaredIdentifiers = require('undeclared-identifiers'); -var through = require('through2'); -var merge = require('xtend'); -var parse = require('acorn-node').parse; - -var path = require('path'); -var isAbsolute = path.isAbsolute || require('path-is-absolute'); -var processPath = require.resolve('process/browser.js'); -var isbufferPath = require.resolve('is-buffer') -var combineSourceMap = require('combine-source-map'); - -function getRelativeRequirePath(fullPath, fromPath) { - var relpath = path.relative(path.dirname(fromPath), fullPath); - // If fullPath is in the same directory or a subdirectory of fromPath, - // relpath will result in something like "index.js", "src/abc.js". - // require() needs "./" prepended to these paths. - if (!/^\./.test(relpath) && !isAbsolute(relpath)) { - relpath = "./" + relpath; - } - // On Windows: Convert path separators to what require() expects - if (path.sep === '\\') { - relpath = relpath.replace(/\\/g, '/'); - } - return relpath; -} - -var defaultVars = { - process: function (file) { - var relpath = getRelativeRequirePath(processPath, file); - return 'require(' + JSON.stringify(relpath) + ')'; - }, - global: function () { - return 'typeof global !== "undefined" ? global : ' - + 'typeof self !== "undefined" ? self : ' - + 'typeof window !== "undefined" ? window : {}' - ; - }, - 'Buffer.isBuffer': function (file) { - var relpath = getRelativeRequirePath(isbufferPath, file); - return 'require(' + JSON.stringify(relpath) + ')'; - }, - Buffer: function () { - return 'require("buffer").Buffer'; - }, - setImmediate: function () { - return 'require("timers").setImmediate'; - }, - clearImmediate: function () { - return 'require("timers").clearImmediate'; - }, - __filename: function (file, basedir) { - var relpath = path.relative(basedir, file); - // standardize path separators, use slash in Windows too - if ( path.sep === '\\' ) { - relpath = relpath.replace(/\\/g, '/'); - } - var filename = '/' + relpath; - return JSON.stringify(filename); - }, - __dirname: function (file, basedir) { - var relpath = path.relative(basedir, file); - // standardize path separators, use slash in Windows too - if ( path.sep === '\\' ) { - relpath = relpath.replace(/\\/g, '/'); - } - var dir = path.dirname('/' + relpath ); - return JSON.stringify(dir); - } -}; - -module.exports = function (file, opts) { - if (/\.json$/i.test(file)) return through(); - if (!opts) opts = {}; - - var basedir = opts.basedir || '/'; - var vars = merge(defaultVars, opts.vars); - var varNames = Object.keys(vars).filter(function(name) { - return typeof vars[name] === 'function'; - }); - - var quick = RegExp(varNames.map(function (name) { - return '\\b' + name + '\\b'; - }).join('|')); - - var chunks = []; - - return through(write, end); - - function write (chunk, enc, next) { chunks.push(chunk); next() } - - function end () { - var self = this; - var source = Buffer.isBuffer(chunks[0]) - ? Buffer.concat(chunks).toString('utf8') - : chunks.join('') - ; - source = source - .replace(/^\ufeff/, '') - .replace(/^#![^\n]*\n/, '\n'); - - if (opts.always !== true && !quick.test(source)) { - this.push(source); - this.push(null); - return; - } - - try { - var undeclared = opts.always - ? { identifiers: varNames, properties: [] } - : undeclaredIdentifiers(parse(source), { wildcard: true }) - ; - } - catch (err) { - var e = new SyntaxError( - (err.message || err) + ' while parsing ' + file - ); - e.type = 'syntax'; - e.filename = file; - return this.emit('error', e); - } - - var globals = {}; - - varNames.forEach(function (name) { - if (!/\./.test(name)) return; - var parts = name.split('.') - var prop = undeclared.properties.indexOf(name) - if (prop === -1 || countprops(undeclared.properties, parts[0]) > 1) return; - var value = vars[name](file, basedir); - if (!value) return; - globals[parts[0]] = '{' - + JSON.stringify(parts[1]) + ':' + value + '}'; - self.emit('global', name); - }); - varNames.forEach(function (name) { - if (/\./.test(name)) return; - if (globals[name]) return; - if (undeclared.identifiers.indexOf(name) < 0) return; - var value = vars[name](file, basedir); - if (!value) return; - globals[name] = value; - self.emit('global', name); - }); - - this.push(closeOver(globals, source, file, opts)); - this.push(null); - } -}; - -module.exports.vars = defaultVars; - -function closeOver (globals, src, file, opts) { - var keys = Object.keys(globals); - if (keys.length === 0) return src; - var values = keys.map(function (key) { return globals[key] }); - - var wrappedSource; - if (keys.length <= 3) { - wrappedSource = '(function (' + keys.join(',') + '){\n' - + src + '\n}).call(this,' + values.join(',') + ')' - ; - } - else { - // necessary to make arguments[3..6] still work for workerify etc - // a,b,c,arguments[3..6],d,e,f... - var extra = [ '__argument0', '__argument1', '__argument2', '__argument3' ]; - var names = keys.slice(0,3).concat(extra).concat(keys.slice(3)); - values.splice(3, 0, - 'arguments[3]','arguments[4]', - 'arguments[5]','arguments[6]' - ); - wrappedSource = '(function (' + names.join(',') + '){\n' - + src + '\n}).call(this,' + values.join(',') + ')'; - } - - // Generate source maps if wanted. Including the right offset for - // the wrapped source. - if (!opts.debug) { - return wrappedSource; - } - var sourceFile = path.relative(opts.basedir, file) - .replace(/\\/g, '/'); - var sourceMap = combineSourceMap.create().addFile( - { sourceFile: sourceFile, source: src}, - { line: 1 }); - return combineSourceMap.removeComments(wrappedSource) + "\n" - + sourceMap.comment(); -} - -function countprops (props, name) { - return props.filter(function (prop) { - return prop.slice(0, name.length + 1) === name + '.'; - }).length; -} diff --git a/node_modules/insert-module-globals/package.json b/node_modules/insert-module-globals/package.json deleted file mode 100644 index 80db1f07d..000000000 --- a/node_modules/insert-module-globals/package.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "_from": "insert-module-globals@^7.0.0", - "_id": "insert-module-globals@7.2.0", - "_inBundle": false, - "_integrity": "sha512-VE6NlW+WGn2/AeOMd496AHFYmE7eLKkUY6Ty31k4og5vmA3Fjuwe9v6ifH6Xx/Hz27QvdoMoviw1/pqWRB09Sw==", - "_location": "/insert-module-globals", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "insert-module-globals@^7.0.0", - "name": "insert-module-globals", - "escapedName": "insert-module-globals", - "rawSpec": "^7.0.0", - "saveSpec": null, - "fetchSpec": "^7.0.0" - }, - "_requiredBy": [ - "/browserify" - ], - "_resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.0.tgz", - "_shasum": "ec87e5b42728479e327bd5c5c71611ddfb4752ba", - "_spec": "insert-module-globals@^7.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bin": { - "insert-module-globals": "bin/cmd.js" - }, - "bugs": { - "url": "https://github.com/browserify/insert-module-globals/issues" - }, - "bundleDependencies": false, - "dependencies": { - "JSONStream": "^1.0.3", - "acorn-node": "^1.5.2", - "combine-source-map": "^0.8.0", - "concat-stream": "^1.6.1", - "is-buffer": "^1.1.0", - "path-is-absolute": "^1.0.1", - "process": "~0.11.0", - "through2": "^2.0.0", - "undeclared-identifiers": "^1.1.2", - "xtend": "^4.0.0" - }, - "deprecated": false, - "description": "insert implicit module globals into a module-deps stream", - "devDependencies": { - "browser-pack": "^6.0.0", - "buffer": "^4.9.1", - "convert-source-map": "~1.1.0", - "module-deps": "^4.0.2", - "nanobench": "^2.1.1", - "tape": "^4.2.0", - "timers-browserify": "^1.4.2" - }, - "homepage": "https://github.com/browserify/insert-module-globals", - "keywords": [ - "__filename", - "__dirname", - "global", - "process", - "module-deps", - "browser-pack", - "browserify" - ], - "license": "MIT", - "main": "index.js", - "name": "insert-module-globals", - "repository": { - "type": "git", - "url": "git://github.com/browserify/insert-module-globals.git" - }, - "scripts": { - "test": "tape test/*.js" - }, - "version": "7.2.0" -} diff --git a/node_modules/insert-module-globals/readme.markdown b/node_modules/insert-module-globals/readme.markdown deleted file mode 100644 index 0d5491aa3..000000000 --- a/node_modules/insert-module-globals/readme.markdown +++ /dev/null @@ -1,146 +0,0 @@ -# insert-module-globals - -insert implicit module globals -(`__filename`, `__dirname`, `process`, `global`, `setImmediate`, `clearImmediate` and `Buffer`) -as a browserify-style transform - -[![build status](https://secure.travis-ci.org/browserify/insert-module-globals.png)](http://travis-ci.org/browserify/insert-module-globals) - -# example - -``` js -var mdeps = require('module-deps'); -var bpack = require('browser-pack'); -var insert = require('insert-module-globals'); -function inserter (file) { - return insert(file, { basedir: __dirname + '/files' }); -} - -var files = [ __dirname + '/files/main.js' ]; -mdeps(files, { transform: inserter }) - .pipe(bpack({ raw: true })) - .pipe(process.stdout) -; -``` - -``` -$ node example/insert.js | node -in main.js: {"__filename":"/main.js","__dirname":"/"} -in foo/index.js: {"__filename":"/foo/index.js","__dirname":"/foo"} -``` - -or use the command-line scripts: - -``` -$ module-deps main.js | insert-module-globals | browser-pack | node -in main.js: {"__filename":"/main.js","__dirname":"/"} -in foo/index.js: {"__filename":"/foo/index.js","__dirname":"/foo"} -``` - -or use insert-module-globals as a transform: - -``` -$ module-deps main.js --transform insert-module-globals | browser-pack | node -in main.js: {"__filename":"/main.js","__dirname":"/"} -in foo/index.js: {"__filename":"/foo/index.js","__dirname":"/foo"} -``` - -# methods - -``` js -var insertGlobals = require('insert-module-globals') -``` - -## var inserter = insertGlobals(file, opts) - -Return a transform stream `inserter` for the filename `file` that will accept a -javascript file as input and will output the file with a closure around the -contents as necessary to define extra builtins. - -When `opts.always` is true, wrap every file with all the global variables -without parsing. This is handy because parsing the scope can take a long time, -so you can prioritize fast builds over saving bytes in the final output. When -`opts.always` is truthy but not true, avoid parsing but perform a quick test to -determine if wrapping should be skipped. - -Use `opts.vars` to override the default inserted variables, or set -`opts.vars[name]` to `undefined` to not insert a variable which would otherwise -be inserted. - -`opts.vars` properties with a `.` in their name will be executed instead of the -parent object if ONLY that property is used. For example, `"Buffer.isBuffer"` -will mask `"Buffer"` only when there is a `Buffer.isBuffer()` call in a file and -no other references to `Buffer`. - -If `opts.debug` is true, an inline source map will be generated to compensate -for the extra lines. - -# events - -## inserter.on('global', function (name) {}) - -When a global is detected, the inserter stream emits a `'global'` event. - -# usage - -``` -usage: insert-module-globals {basedir} -``` - -# install - -With [npm](https://npmjs.org), to get the library do: - -``` -npm install insert-module-globals -``` - -and to get the bin script do: - -``` -npm install -g insert-module-globals -``` - -# insert custom globals. - -`insert-module-globals` can also insert arbitary globals into files. -Pass in an object of functions as the `vars` option. - -``` js -var vars = { - process: function (file, basedir) { - return { - id: "path/to/custom_process.js", - source: customProcessContent - } - }, - Buffer: function (file, basedir) { - return { - id: 'path/to/custom_buffer.js', - source: customProcessContent, - //suffix is optional - //it's used to extract the value from the module. - //it becomes: require(...).Buffer in this case. - suffix: '.Buffer' - } - }, - Math: function () { - //if you return a string, - //it's simply set as the value. - return '{}' - //^ any attempt to use Math[x] will throw! - } -} - -function inserter (file) { - return insert(file, { vars: vars }); -} -mdeps(files, { transform: inserter }) - .pipe(bpack({ raw: true })) - .pipe(process.stdout) -``` - - -# license - -MIT diff --git a/node_modules/insert-module-globals/test/always.js b/node_modules/insert-module-globals/test/always.js deleted file mode 100644 index 05f3f5cac..000000000 --- a/node_modules/insert-module-globals/test/always.js +++ /dev/null @@ -1,108 +0,0 @@ -var test = require('tape') -var mdeps = require('module-deps'); -var bpack = require('browser-pack'); -var insert = require('../'); -var concat = require('concat-stream'); -var vm = require('vm'); - -test('always true insert', function (t) { - t.plan(10); - var s = mdeps({ - modules: { - buffer: require.resolve('buffer/'), - timers: require.resolve('timers-browserify') - } - }); - s.pipe(bpack({ raw: true })).pipe(concat(function (src) { - var c = { - t: t, - process: 'sandbox process', - Buffer: 'sandbox Buffer', - __filename: 'sandbox __filename', - __dirname: 'sandbox __dirname', - custom: 'sandbox custom', - self: { xyz: 555 } - }; - vm.runInNewContext(src, c); - })); - s.write({ transform: inserter({ always: true }), global: true }); - s.end(__dirname + '/always/main.js'); -}); - -test('always true insert custom globals without defaults', function (t) { - t.plan(7); - var s = mdeps({ - modules: { - buffer: require.resolve('buffer/'), - timers: require.resolve('timers-browserify') - } - }); - s.pipe(bpack({ raw: true })).pipe(concat(function (src) { - var c = { - t: t, - process: 'sandbox process', - Buffer: 'sandbox Buffer', - __filename: 'sandbox __filename', - __dirname: 'sandbox __dirname', - custom: 'sandbox custom', - self: { xyz: 555 } - }; - vm.runInNewContext(src, c); - })); - s.write({ - transform: inserter({ always: true, vars: { - global: {}, - process: undefined, - Buffer: undefined, - __filename: undefined, - __dirname: undefined, - custom: function() { return '"inserted custom"' } - }}), - global: true - }); - s.end(__dirname + '/always/custom_globals_without_defaults.js'); -}); - -test('always truthy-but-not-true insert hidden from quick test is not really inserted; true is', function (t) { - t.plan(2); - var testit = function(always, expected) { - var s = mdeps({ - modules: { - buffer: require.resolve('buffer/'), - timers: require.resolve('timers-browserify') - } - }); - s.pipe(bpack({ raw: true })).pipe(concat(function (src) { - var c = { - t: t, - process: 'sandbox process', - Buffer: 'sandbox Buffer', - __filename: 'sandbox __filename', - __dirname: 'sandbox __dirname', - custom: 'sandbox custom', - expected: expected, - self: { xyz: 555 } - }; - vm.runInNewContext(src, c); - })); - s.write({ - transform: inserter({ always: always, vars: { - custom: function() { return '"inserted custom"' } - }}), - global: true - }) - s.end(__dirname + '/always/hidden_from_quick_test.js'); - }; - - var always = 'truthy', expected = 'sandbox custom'; - testit(always, expected); - - always = true; expected = 'inserted custom'; - testit(always, expected); -}); - -function inserter (opts) { - return function (file) { - return insert(file, opts); - }; -} diff --git a/node_modules/insert-module-globals/test/always/custom_globals_without_defaults.js b/node_modules/insert-module-globals/test/always/custom_globals_without_defaults.js deleted file mode 100644 index 4609487e7..000000000 --- a/node_modules/insert-module-globals/test/always/custom_globals_without_defaults.js +++ /dev/null @@ -1,7 +0,0 @@ -t.equal(eval('process'), 'sandbox process'); -t.equal(eval('typeof global'), 'undefined'); -t.equal(eval('self.xyz'), 555); -t.equal(eval('Buffer'), 'sandbox Buffer'); -t.equal(eval('__filename'), 'sandbox __filename'); -t.equal(eval('__dirname'), 'sandbox __dirname'); -t.equal(eval('custom'), 'inserted custom'); diff --git a/node_modules/insert-module-globals/test/always/hidden_from_quick_test.js b/node_modules/insert-module-globals/test/always/hidden_from_quick_test.js deleted file mode 100644 index 1c01491d2..000000000 --- a/node_modules/insert-module-globals/test/always/hidden_from_quick_test.js +++ /dev/null @@ -1 +0,0 @@ -t.equal(eval('cust' + 'om'), eval('expected')); diff --git a/node_modules/insert-module-globals/test/always/main.js b/node_modules/insert-module-globals/test/always/main.js deleted file mode 100644 index 50942a0cc..000000000 --- a/node_modules/insert-module-globals/test/always/main.js +++ /dev/null @@ -1,10 +0,0 @@ -t.equal(eval('typeof process'), 'object'); -t.equal(eval('typeof process.nextTick'), 'function'); -t.equal(eval('typeof global'), 'object'); -t.equal(eval('global.xyz'), 555); -t.equal(eval('typeof Buffer'), 'function'); -t.equal(eval('typeof __filename'), 'string'); -t.notEqual(eval('__filename'), 'sandbox __filename'); -t.equal(eval('typeof __dirname'), 'string'); -t.notEqual(eval('__dirname'), 'sandbox __dirname'); -t.equal(eval('custom'), 'sandbox custom'); diff --git a/node_modules/insert-module-globals/test/global.js b/node_modules/insert-module-globals/test/global.js deleted file mode 100644 index 64a9ebead..000000000 --- a/node_modules/insert-module-globals/test/global.js +++ /dev/null @@ -1,64 +0,0 @@ -var test = require('tape'); -var vm = require('vm'); -var concat = require('concat-stream'); - -var path = require('path'); -var insert = require('../'); -var bpack = require('browser-pack'); -var mdeps = require('module-deps'); - -test('insert globals', function (t) { - var expected = [ 'global' ]; - t.plan(2 + expected.length); - - var deps = mdeps() - var pack = bpack({ raw: true }); - - deps.pipe(pack); - - pack.pipe(concat(function (src) { - var c = { - t : t, - a : 555, - }; - c.self = c; - vm.runInNewContext(src, c); - })); - - deps.write({ - transform: function (file) { - var tr = inserter(file) - tr.on('global', function (name) { - t.equal(name, expected.shift()); - }); - return tr; - }, - global: true - }); - deps.end(__dirname + '/global/main.js'); -}); - -test('__filename and __dirname', function (t) { - t.plan(2); - - var file = path.join(__dirname, 'global', 'filename.js'); - var deps = mdeps() - var pack = bpack({ raw: true }); - - deps.pipe(pack); - - pack.pipe(concat(function (src) { - var c = {}; - vm.runInNewContext('require=' + src, c); - var x = c.require(file); - t.equal(x.filename, '/filename.js'); - t.equal(x.dirname, '/'); - })); - - deps.write({ transform: inserter, global: true }); - deps.end(file); -}); - -function inserter (file) { - return insert(file, { basedir: __dirname + '/global' }); -} diff --git a/node_modules/insert-module-globals/test/global/filename.js b/node_modules/insert-module-globals/test/global/filename.js deleted file mode 100644 index 85dc112bf..000000000 --- a/node_modules/insert-module-globals/test/global/filename.js +++ /dev/null @@ -1,2 +0,0 @@ -exports.filename = __filename; -exports.dirname = __dirname; diff --git a/node_modules/insert-module-globals/test/global/main.js b/node_modules/insert-module-globals/test/global/main.js deleted file mode 100644 index d77852b23..000000000 --- a/node_modules/insert-module-globals/test/global/main.js +++ /dev/null @@ -1,2 +0,0 @@ -t.equal(a, 555); -t.equal(a, global.a); diff --git a/node_modules/insert-module-globals/test/immediate.js b/node_modules/insert-module-globals/test/immediate.js deleted file mode 100644 index a5c482b69..000000000 --- a/node_modules/insert-module-globals/test/immediate.js +++ /dev/null @@ -1,30 +0,0 @@ -var test = require('tape'); -var mdeps = require('module-deps'); -var bpack = require('browser-pack'); -var insert = require('../'); -var concat = require('concat-stream'); -var vm = require('vm'); - -test('immediate', function (t) { - t.plan(3); - var deps = mdeps({ - modules: { timers: require.resolve('timers-browserify') } - }); - var pack = bpack({ raw: true, hasExports: true }); - deps.pipe(pack).pipe(concat(function (src) { - var c = { - setTimeout: setTimeout, - clearTimeout: clearTimeout, - T: t - }; - t.ok(/require\("timers"\)/.test(src), 'timers required in source'); - t.notOk(/require\("\//.test(src), 'absolute path not required in source'); - vm.runInNewContext(src, c); - })); - deps.write({ transform: inserter, global: true }); - deps.end({ id: 'main', file: __dirname + '/immediate/main.js' }); -}); - -function inserter (file) { - return insert(file, { basedir: __dirname + '/immediate' }); -} diff --git a/node_modules/insert-module-globals/test/immediate/main.js b/node_modules/insert-module-globals/test/immediate/main.js deleted file mode 100644 index fc53cc702..000000000 --- a/node_modules/insert-module-globals/test/immediate/main.js +++ /dev/null @@ -1,8 +0,0 @@ -var immediate = setImmediate(function () { - T.fail('should have been cleared') -}) -setImmediate(function () { - T.pass('should call setImmediate') -}) - -clearImmediate(immediate) diff --git a/node_modules/insert-module-globals/test/insert.js b/node_modules/insert-module-globals/test/insert.js deleted file mode 100644 index 8fe3b39cf..000000000 --- a/node_modules/insert-module-globals/test/insert.js +++ /dev/null @@ -1,46 +0,0 @@ -var test = require('tape'); -var mdeps = require('module-deps'); -var bpack = require('browser-pack'); -var insert = require('../'); -var concat = require('concat-stream'); -var vm = require('vm'); - -test('process.nextTick inserts', function (t) { - t.plan(4); - var s = mdeps() - s.pipe(bpack({ raw: true })).pipe(concat(function (src) { - var c = { - t: t, - setTimeout: setTimeout, - clearTimeout: clearTimeout - }; - vm.runInNewContext(src, c); - })); - s.write({ transform: inserter, global: true }) - s.end(__dirname + '/insert/main.js'); -}); - -test('buffer inserts', function (t) { - t.plan(2); - var s = mdeps({ - modules: { buffer: require.resolve('buffer/') } - }); - s.pipe(bpack({ raw: true })).pipe(concat(function (src) { - var c = { - t: t, - setTimeout: setTimeout, - clearTimeout: clearTimeout, - Uint8Array: Uint8Array, - DataView: DataView - }; - vm.runInNewContext(src, c); - })); - s.write({ transform: inserter, global: true }) - s.end(__dirname + '/insert/buffer.js'); -}); - -function inserter (file) { - return insert(file, { - basedir: __dirname + '/insert' - }); -} diff --git a/node_modules/insert-module-globals/test/insert/buffer.js b/node_modules/insert-module-globals/test/insert/buffer.js deleted file mode 100644 index 54153e4d6..000000000 --- a/node_modules/insert-module-globals/test/insert/buffer.js +++ /dev/null @@ -1 +0,0 @@ -require('./foo/buf'); diff --git a/node_modules/insert-module-globals/test/insert/foo/buf.js b/node_modules/insert-module-globals/test/insert/foo/buf.js deleted file mode 100644 index ea13200ae..000000000 --- a/node_modules/insert-module-globals/test/insert/foo/buf.js +++ /dev/null @@ -1,4 +0,0 @@ -process.nextTick(function () { - t.equal(Buffer('abc').toString('base64'), 'YWJj'); - t.equal(Buffer([98,99,100]).toString(), 'bcd'); -}); diff --git a/node_modules/insert-module-globals/test/insert/foo/index.js b/node_modules/insert-module-globals/test/insert/foo/index.js deleted file mode 100644 index 0945157e4..000000000 --- a/node_modules/insert-module-globals/test/insert/foo/index.js +++ /dev/null @@ -1,4 +0,0 @@ -process.nextTick(function () { - t.equal(__filename, '/foo/index.js'); - t.equal(__dirname, '/foo'); -}); diff --git a/node_modules/insert-module-globals/test/insert/main.js b/node_modules/insert-module-globals/test/insert/main.js deleted file mode 100644 index 957a73d73..000000000 --- a/node_modules/insert-module-globals/test/insert/main.js +++ /dev/null @@ -1,4 +0,0 @@ -t.equal(__filename, '/main.js'); -t.equal(__dirname, '/'); - -require('./foo'); diff --git a/node_modules/insert-module-globals/test/isbuffer.js b/node_modules/insert-module-globals/test/isbuffer.js deleted file mode 100644 index 4ff6819ba..000000000 --- a/node_modules/insert-module-globals/test/isbuffer.js +++ /dev/null @@ -1,64 +0,0 @@ -var test = require('tape'); -var mdeps = require('module-deps'); -var bpack = require('browser-pack'); -var insert = require('../'); -var concat = require('concat-stream'); -var vm = require('vm'); -// use is-buffer instead of builtin Buffer.isBuffer. The builtin -// does `instanceof` which does not work on the browserified version -var isBuffer = require('is-buffer'); - -test('isbuffer', function (t) { - t.plan(5); - var deps = mdeps() - var pack = bpack({ raw: true, hasExports: true }); - deps.pipe(pack).pipe(concat(function (src) { - var c = { global: {} }; - vm.runInNewContext(src, c); - t.equal(c.require('main')(Buffer('wow')), true, 'is a buffer'); - t.equal(c.require('main')('wow'), false, 'not a buffer (string)'); - t.equal(c.require('main')({}), false, 'not a buffer (object)'); - t.notOk(/require\("buffer"\)/.test(src), 'buffer not required in source') - t.notOk(/require\("\//.test(src), 'absolute path not required in source') - })); - deps.write({ transform: inserter, global: true }); - deps.end({ id: 'main', file: __dirname + '/isbuffer/main.js' }); -}); - -test('isbuffer (and Buffer.from)', function (t) { - t.plan(5); - var deps = mdeps() - var pack = bpack({ raw: true, hasExports: true }); - deps.pipe(pack).pipe(concat(function (src) { - var c = { global: {} }; - vm.runInNewContext(src, c); - t.equal(c.require('main')(c.require('main').a()), true, 'is a buffer'); - t.equal(c.require('main')('wow'), false, 'is not a buffer'); - t.equal(isBuffer(c.require('main').a()), true, 'is a buffer'); - t.ok(/require\("buffer"\)/.test(src), 'buffer required in source') - t.equal(c.require('main').a().toString('hex'), 'abcd', 'is a buffer'); - })); - deps.write({ transform: inserter, global: true }); - deps.end({ id: 'main', file: __dirname + '/isbuffer/both.js' }); -}); - -test('isbuffer (and new Buffer)', function (t) { - t.plan(5); - var deps = mdeps() - var pack = bpack({ raw: true, hasExports: true }); - deps.pipe(pack).pipe(concat(function (src) { - var c = { global: {} }; - vm.runInNewContext(src, c); - t.equal(c.require('main')(c.require('main').a()), true, 'is a buffer'); - t.equal(c.require('main')('wow'), false, 'is not a buffer'); - t.equal(isBuffer(c.require('main').a()), true, 'is a buffer'); - t.ok(/require\("buffer"\)/.test(src), 'buffer required in source') - t.equal(c.require('main').a().toString('utf8'), 'abcd', 'is a buffer'); - })); - deps.write({ transform: inserter, global: true }); - deps.end({ id: 'main', file: __dirname + '/isbuffer/new.js' }); -}); - -function inserter (file) { - return insert(file, { basedir: __dirname + '/isbuffer' }); -} diff --git a/node_modules/insert-module-globals/test/isbuffer/both.js b/node_modules/insert-module-globals/test/isbuffer/both.js deleted file mode 100644 index d4927e141..000000000 --- a/node_modules/insert-module-globals/test/isbuffer/both.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = function (buf) { - return Buffer.isBuffer(buf); -}; -module.exports.a = function () { - return Buffer.from('abcd', 'hex'); -}; diff --git a/node_modules/insert-module-globals/test/isbuffer/main.js b/node_modules/insert-module-globals/test/isbuffer/main.js deleted file mode 100644 index c610fa193..000000000 --- a/node_modules/insert-module-globals/test/isbuffer/main.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function (buf) { - return Buffer.isBuffer(buf); -}; diff --git a/node_modules/insert-module-globals/test/isbuffer/new.js b/node_modules/insert-module-globals/test/isbuffer/new.js deleted file mode 100644 index 46d9fe25e..000000000 --- a/node_modules/insert-module-globals/test/isbuffer/new.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = function (buf) { - return Buffer.isBuffer(buf); -}; -module.exports.a = function () { - return new Buffer('abcd'); -}; diff --git a/node_modules/insert-module-globals/test/return.js b/node_modules/insert-module-globals/test/return.js deleted file mode 100644 index 7514f1f55..000000000 --- a/node_modules/insert-module-globals/test/return.js +++ /dev/null @@ -1,27 +0,0 @@ -var test = require('tape'); -var mdeps = require('module-deps'); -var bpack = require('browser-pack'); -var insert = require('../'); -var concat = require('concat-stream'); -var vm = require('vm'); - -test('early return', function (t) { - t.plan(4); - var s = mdeps() - s.pipe(bpack({ raw: true })).pipe(concat(function (src) { - var c = { - t: t, - setTimeout: setTimeout, - clearTimeout: clearTimeout - }; - vm.runInNewContext(src, c); - })); - s.write({ transform: inserter, global: true }); - s.end(__dirname + '/return/main.js'); -}); - -function inserter (file) { - return insert(file, { - basedir: __dirname + '/return' - }); -} diff --git a/node_modules/insert-module-globals/test/return/foo/index.js b/node_modules/insert-module-globals/test/return/foo/index.js deleted file mode 100644 index 0945157e4..000000000 --- a/node_modules/insert-module-globals/test/return/foo/index.js +++ /dev/null @@ -1,4 +0,0 @@ -process.nextTick(function () { - t.equal(__filename, '/foo/index.js'); - t.equal(__dirname, '/foo'); -}); diff --git a/node_modules/insert-module-globals/test/return/main.js b/node_modules/insert-module-globals/test/return/main.js deleted file mode 100644 index c7d354cf4..000000000 --- a/node_modules/insert-module-globals/test/return/main.js +++ /dev/null @@ -1,6 +0,0 @@ -t.equal(__filename, '/main.js'); -t.equal(__dirname, '/'); - -require('./foo'); - -return; diff --git a/node_modules/insert-module-globals/test/roots.js b/node_modules/insert-module-globals/test/roots.js deleted file mode 100644 index 5bd2d9e0c..000000000 --- a/node_modules/insert-module-globals/test/roots.js +++ /dev/null @@ -1,35 +0,0 @@ -var test = require('tape'); -var mdeps = require('module-deps'); -var bpack = require('browser-pack'); -var insert = require('../'); -var concat = require('concat-stream'); -var path = require('path'); -var fs = require('fs'); -var vm = require('vm'); - -test('windows partitions', { skip: process.platform !== 'win32' }, function (t) { - t.plan(1); - var deps = mdeps() - var pack = bpack({ raw: true, hasExports: true }); - deps.pipe(pack).pipe(concat(function (src) { - var c = { - console: { log: log } - }; - vm.runInNewContext(src, c); - function log (value) { - t.equal(typeof value, 'function'); - } - })); - deps.write({ transform: inserter, global: true }); - deps.end({ - id: 'main', - file: 'D:\\test.js', - source: fs.readFileSync(__dirname + '/roots/main.js') - }); -}); - -function inserter (file) { - return insert(file, { - basedir: path.join(__dirname, '..') - }); -} diff --git a/node_modules/insert-module-globals/test/roots/main.js b/node_modules/insert-module-globals/test/roots/main.js deleted file mode 100644 index 55f4d10cd..000000000 --- a/node_modules/insert-module-globals/test/roots/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log(Buffer.isBuffer) diff --git a/node_modules/insert-module-globals/test/sourcemap.js b/node_modules/insert-module-globals/test/sourcemap.js deleted file mode 100644 index b1e3a7149..000000000 --- a/node_modules/insert-module-globals/test/sourcemap.js +++ /dev/null @@ -1,41 +0,0 @@ -var test = require('tape'); -var convert = require('convert-source-map'); -var insert = require('../'); -var mdeps = require('module-deps'); -var vm = require('vm'); -var path = require('path'); - -test('sourcemap', function (t) { - t.plan(6); - - var file = __dirname + '/sourcemap/main.js'; - var deps = mdeps() - - deps.on('data', function(row) { - var src = row.source; - - var sm = convert.fromSource(src).toObject(); - t.deepEqual(sm.sources, [ 'test/sourcemap/main_es6.js' ]); - t.deepEqual(sm.sourcesContent, [ 'console.log(`${__dirname}`, `${__filename}`);\n' ]); - t.deepEqual(sm.mappings, ';AAAA,OAAO,CAAC,GAAG,MAAI,SAAS,OAAO,UAAU,CAAG,CAAC'); - - t.equal(src.match(convert.commentRegex).length, 1); - - var c = { - console: { - log: function(dirname, filename) { - t.equal(dirname, '/'); - t.equal(filename, '/main.js'); - } - }, - }; - vm.runInNewContext(src, c); - }); - - deps.write({ transform: inserter, global: true }); - deps.end(file); -}); - -function inserter (file) { - return insert(file, { debug: true, basedir: __dirname + '/sourcemap' }); -} diff --git a/node_modules/insert-module-globals/test/sourcemap/main.js b/node_modules/insert-module-globals/test/sourcemap/main.js deleted file mode 100644 index 7d6f3c747..000000000 --- a/node_modules/insert-module-globals/test/sourcemap/main.js +++ /dev/null @@ -1,3 +0,0 @@ -console.log("" + __dirname, "" + __filename); - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3Qvc291cmNlbWFwL21haW5fZXM2LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sQ0FBQyxHQUFHLE1BQUksU0FBUyxPQUFPLFVBQVUsQ0FBRyxDQUFDIiwiZmlsZSI6InVuZGVmaW5lZCIsInNvdXJjZXNDb250ZW50IjpbImNvbnNvbGUubG9nKGAke19fZGlybmFtZX1gLCBgJHtfX2ZpbGVuYW1lfWApO1xuIl19 diff --git a/node_modules/insert-module-globals/test/sourcemap/main_es6.js b/node_modules/insert-module-globals/test/sourcemap/main_es6.js deleted file mode 100644 index f74babd6b..000000000 --- a/node_modules/insert-module-globals/test/sourcemap/main_es6.js +++ /dev/null @@ -1 +0,0 @@ -console.log(`${__dirname}`, `${__filename}`); diff --git a/node_modules/insert-module-globals/test/subdir.js b/node_modules/insert-module-globals/test/subdir.js deleted file mode 100644 index d9a515b1a..000000000 --- a/node_modules/insert-module-globals/test/subdir.js +++ /dev/null @@ -1,37 +0,0 @@ -var test = require('tape'); -var mdeps = require('module-deps'); -var bpack = require('browser-pack'); -var insert = require('../'); -var concat = require('concat-stream'); -var path = require('path'); -var fs = require('fs'); -var vm = require('vm'); - -test('subdir', function (t) { - t.plan(1); - var deps = mdeps() - var pack = bpack({ raw: true, hasExports: true }); - deps.pipe(pack).pipe(concat(function (src) { - var c = { - console: { log: log } - }; - vm.runInNewContext(src, c); - function log (value) { - t.equal(value, false); - } - })); - deps.write({ transform: inserter, global: true }); - deps.end({ - id: 'main', - // Fake the file path so that the relative path to is-buffer becomes - // "node_modules/is-buffer/index.js" - file: path.join(__dirname, '../subdir_test.js'), - source: fs.readFileSync(__dirname + '/subdir/main.js') - }); -}); - -function inserter (file) { - return insert(file, { - basedir: path.join(__dirname, '..') - }); -} diff --git a/node_modules/insert-module-globals/test/subdir/main.js b/node_modules/insert-module-globals/test/subdir/main.js deleted file mode 100644 index 74f9f1936..000000000 --- a/node_modules/insert-module-globals/test/subdir/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log(Buffer.isBuffer("test")) diff --git a/node_modules/insert-module-globals/test/subdir/node_modules/is-buffer/index.js b/node_modules/insert-module-globals/test/subdir/node_modules/is-buffer/index.js deleted file mode 100644 index 9cce39659..000000000 --- a/node_modules/insert-module-globals/test/subdir/node_modules/is-buffer/index.js +++ /dev/null @@ -1,21 +0,0 @@ -/*! - * Determine if an object is a Buffer - * - * @author Feross Aboukhadijeh - * @license MIT - */ - -// The _isBuffer check is for Safari 5-7 support, because it's missing -// Object.prototype.constructor. Remove this eventually -module.exports = function (obj) { - return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) -} - -function isBuffer (obj) { - return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) -} - -// For Node v0.10 support. Remove this eventually. -function isSlowBuffer (obj) { - return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) -} diff --git a/node_modules/insert-module-globals/test/unprefix.js b/node_modules/insert-module-globals/test/unprefix.js deleted file mode 100644 index e87dc80e1..000000000 --- a/node_modules/insert-module-globals/test/unprefix.js +++ /dev/null @@ -1,34 +0,0 @@ -var test = require('tape'); -var vm = require('vm'); -var concat = require('concat-stream'); - -var path = require('path'); -var insert = require('../'); -var bpack = require('browser-pack'); -var mdeps = require('module-deps'); - -test('unprefix - remove shebang and bom', function (t) { - t.plan(3); - - var file = path.join(__dirname, 'unprefix', 'main.js'); - var deps = mdeps(); - var pack = bpack({ raw: true }); - - deps.pipe(pack); - - pack.pipe(concat(function (src) { - var c = {}; - vm.runInNewContext('require=' + src, c); - var x = c.require(file); - t.equal(x.filename, '/hello.js'); - t.equal(x.dirname, '/'); - t.notOk(/\ufeff/.test(src.toString())); - })); - - deps.write({ transform: inserter, global: true }); - deps.end(file); -}); - -function inserter (file) { - return insert(file, { basedir: __dirname + '/unprefix' }); -} diff --git a/node_modules/insert-module-globals/test/unprefix/hello.js b/node_modules/insert-module-globals/test/unprefix/hello.js deleted file mode 100644 index 993372f0f..000000000 --- a/node_modules/insert-module-globals/test/unprefix/hello.js +++ /dev/null @@ -1,2 +0,0 @@ -exports.filename = __filename; -exports.dirname = __dirname; diff --git a/node_modules/insert-module-globals/test/unprefix/main.js b/node_modules/insert-module-globals/test/unprefix/main.js deleted file mode 100644 index 6a1f3711e..000000000 --- a/node_modules/insert-module-globals/test/unprefix/main.js +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node - -module.exports = require('./hello'); diff --git a/node_modules/internal-ip/index.js b/node_modules/internal-ip/index.js deleted file mode 100644 index 7c6d4cec3..000000000 --- a/node_modules/internal-ip/index.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; -const os = require('os'); -const defaultGateway = require('default-gateway'); -const ipaddr = require('ipaddr.js'); - -function findIp(gateway) { - const interfaces = os.networkInterfaces(); - const gatewayIp = ipaddr.parse(gateway); - let ip; - - // Look for the matching interface in all local interfaces - Object.keys(interfaces).some(name => { - return interfaces[name].some(addr => { - const prefix = ipaddr.parse(addr.netmask).prefixLengthFromSubnetMask(); - const net = ipaddr.parseCIDR(`${addr.address}/${prefix}`); - - if (net[0] && net[0].kind() === gatewayIp.kind() && gatewayIp.match(net)) { - ip = net[0].toString(); - } - - return Boolean(ip); - }); - }); - - return ip; -} - -function promise(family) { - return defaultGateway[family]().then(result => { - return findIp(result.gateway) || null; - }).catch(() => null); -} - -function sync(family) { - try { - const result = defaultGateway[family].sync(); - return findIp(result.gateway) || null; - } catch (err) { - return null; - } -} - -module.exports.v6 = () => promise('v6'); -module.exports.v4 = () => promise('v4'); - -module.exports.v6.sync = () => sync('v6'); -module.exports.v4.sync = () => sync('v4'); diff --git a/node_modules/internal-ip/license b/node_modules/internal-ip/license deleted file mode 100644 index e7af2f771..000000000 --- a/node_modules/internal-ip/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/internal-ip/package.json b/node_modules/internal-ip/package.json deleted file mode 100644 index 577de47ef..000000000 --- a/node_modules/internal-ip/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "_from": "internal-ip@^3.0.1", - "_id": "internal-ip@3.0.1", - "_inBundle": false, - "_integrity": "sha512-NXXgESC2nNVtU+pqmC9e6R8B1GpKxzsAQhffvh5AL79qKnodd+L7tnEQmTiUAVngqLalPbSqRA7XGIEL5nCd0Q==", - "_location": "/internal-ip", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "internal-ip@^3.0.1", - "name": "internal-ip", - "escapedName": "internal-ip", - "rawSpec": "^3.0.1", - "saveSpec": null, - "fetchSpec": "^3.0.1" - }, - "_requiredBy": [ - "/budo" - ], - "_resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-3.0.1.tgz", - "_shasum": "df5c99876e1d2eb2ea2d74f520e3f669a00ece27", - "_spec": "internal-ip@^3.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/internal-ip/issues" - }, - "bundleDependencies": false, - "dependencies": { - "default-gateway": "^2.6.0", - "ipaddr.js": "^1.5.2" - }, - "deprecated": false, - "description": "Get your internal IP address", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/internal-ip#readme", - "keywords": [ - "ip", - "ipv6", - "ipv4", - "address", - "internal", - "local", - "machine", - "system", - "net", - "gateway" - ], - "license": "MIT", - "name": "internal-ip", - "os": [ - "android", - "darwin", - "freebsd", - "linux", - "openbsd", - "sunos", - "win32" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/internal-ip.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "3.0.1" -} diff --git a/node_modules/internal-ip/readme.md b/node_modules/internal-ip/readme.md deleted file mode 100644 index 277abd13b..000000000 --- a/node_modules/internal-ip/readme.md +++ /dev/null @@ -1,49 +0,0 @@ -# internal-ip [![Build Status](https://travis-ci.org/sindresorhus/internal-ip.svg?branch=master)](https://travis-ci.org/sindresorhus/internal-ip) - -> Get your internal IP address - - -## Install - -``` -$ npm install internal-ip -``` - - -## Usage - -```js -const internalIp = require('internal-ip'); - -internalIp.v6().then(ip => { - console.log(ip); - //=> 'fe80::1' -}); - -internalIp.v4().then(ip => { - console.log(ip); - //=> '10.0.0.79' -}); - -console.log(internalIp.v6.sync()) -//=> 'fe80::1' - -console.log(internalIp.v4.sync()) -//=> '10.0.0.79' -``` - -The module returns the address of the internet-facing interface, as determined from the default gateway. When the adress cannot be determined for any reason, `null` will be returned. - -The module relies on operating systems tools. On Linux and Android, the `ip` command must be available, which depending on distribution might not be installed by default. It is usually provided by the `iproute2` package. - - -## Related - -- [internal-ip-cli](https://github.com/sindresorhus/internal-ip-cli) - CLI for this module -- [public-ip](https://github.com/sindresorhus/public-ip) - Get your public IP address -- [default-gateway](https://github.com/silverwind/default-gateway) - Get your default gateway address - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/ip-regex/index.js b/node_modules/ip-regex/index.js deleted file mode 100644 index 973e5f41c..000000000 --- a/node_modules/ip-regex/index.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; - -const v4 = '(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}'; - -const v6seg = '[0-9a-fA-F]{1,4}'; -const v6 = ` -( -(?:${v6seg}:){7}(?:${v6seg}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8 -(?:${v6seg}:){6}(?:${v4}|:${v6seg}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4 -(?:${v6seg}:){5}(?::${v4}|(:${v6seg}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4 -(?:${v6seg}:){4}(?:(:${v6seg}){0,1}:${v4}|(:${v6seg}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4 -(?:${v6seg}:){3}(?:(:${v6seg}){0,2}:${v4}|(:${v6seg}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4 -(?:${v6seg}:){2}(?:(:${v6seg}){0,3}:${v4}|(:${v6seg}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4 -(?:${v6seg}:){1}(?:(:${v6seg}){0,4}:${v4}|(:${v6seg}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4 -(?::((?::${v6seg}){0,5}:${v4}|(?::${v6seg}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4 -)(%[0-9a-zA-Z]{1,})? // %eth0 %1 -`.replace(/\s*\/\/.*$/gm, '').replace(/\n/g, '').trim(); - -const ip = module.exports = opts => opts && opts.exact ? - new RegExp(`(?:^${v4}$)|(?:^${v6}$)`) : - new RegExp(`(?:${v4})|(?:${v6})`, 'g'); - -ip.v4 = opts => opts && opts.exact ? new RegExp(`^${v4}$`) : new RegExp(v4, 'g'); -ip.v6 = opts => opts && opts.exact ? new RegExp(`^${v6}$`) : new RegExp(v6, 'g'); diff --git a/node_modules/ip-regex/license b/node_modules/ip-regex/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/ip-regex/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/ip-regex/package.json b/node_modules/ip-regex/package.json deleted file mode 100644 index 6f951eeaf..000000000 --- a/node_modules/ip-regex/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_from": "ip-regex@^2.1.0", - "_id": "ip-regex@2.1.0", - "_inBundle": false, - "_integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", - "_location": "/ip-regex", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ip-regex@^2.1.0", - "name": "ip-regex", - "escapedName": "ip-regex", - "rawSpec": "^2.1.0", - "saveSpec": null, - "fetchSpec": "^2.1.0" - }, - "_requiredBy": [ - "/default-gateway" - ], - "_resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", - "_shasum": "fa78bf5d2e6913c911ce9f819ee5146bb6d844e9", - "_spec": "ip-regex@^2.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/default-gateway", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/ip-regex/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Regular expression for matching IP addresses (IPv4 & IPv6)", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/ip-regex#readme", - "keywords": [ - "ip", - "ipv6", - "ipv4", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "text", - "pattern", - "internet", - "protocol", - "address", - "validate" - ], - "license": "MIT", - "name": "ip-regex", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/ip-regex.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.1.0", - "xo": { - "esnext": true - } -} diff --git a/node_modules/ip-regex/readme.md b/node_modules/ip-regex/readme.md deleted file mode 100644 index 66bc7f273..000000000 --- a/node_modules/ip-regex/readme.md +++ /dev/null @@ -1,63 +0,0 @@ -# ip-regex [![Build Status](https://travis-ci.org/sindresorhus/ip-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/ip-regex) - -> Regular expression for matching IP addresses - - -## Install - -``` -$ npm install --save ip-regex -``` - - -## Usage - -```js -const ipRegex = require('ip-regex'); - -// Contains an IP address? -ipRegex().test('unicorn 192.168.0.1'); -//=> true - -// Is an IP address? -ipRegex({exact: true}).test('unicorn 192.168.0.1'); -//=> false - -ipRegex.v6({exact: true}).test('1:2:3:4:5:6:7:8'); -//=> true - -'unicorn 192.168.0.1 cake 1:2:3:4:5:6:7:8 rainbow'.match(ipRegex()); -//=> ['192.168.0.1', '1:2:3:4:5:6:7:8'] -``` - - -## API - -### ipRegex([options]) - -Returns a regex for matching both IPv4 and IPv6. - -### ipRegex.v4([options]) - -Returns a regex for matching IPv4. - -### ipRegex.v6([options]) - -Returns a regex for matching IPv6. - -#### options.exact - -Type: `boolean`
    -Default: `false` *(Matches any IP address in a string)* - -Only match an exact string. Useful with `RegExp#test()` to check if a string is an IP address. - - -## Related - -- [is-ip](https://github.com/sindresorhus/is-ip) - Check if a string is an IP address - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/ipaddr.js/README.md b/node_modules/ipaddr.js/README.md deleted file mode 100644 index 6876a3b82..000000000 --- a/node_modules/ipaddr.js/README.md +++ /dev/null @@ -1,233 +0,0 @@ -# ipaddr.js — an IPv6 and IPv4 address manipulation library [![Build Status](https://travis-ci.org/whitequark/ipaddr.js.svg)](https://travis-ci.org/whitequark/ipaddr.js) - -ipaddr.js is a small (1.9K minified and gzipped) library for manipulating -IP addresses in JavaScript environments. It runs on both CommonJS runtimes -(e.g. [nodejs]) and in a web browser. - -ipaddr.js allows you to verify and parse string representation of an IP -address, match it against a CIDR range or range list, determine if it falls -into some reserved ranges (examples include loopback and private ranges), -and convert between IPv4 and IPv4-mapped IPv6 addresses. - -[nodejs]: http://nodejs.org - -## Installation - -`npm install ipaddr.js` - -or - -`bower install ipaddr.js` - -## API - -ipaddr.js defines one object in the global scope: `ipaddr`. In CommonJS, -it is exported from the module: - -```js -var ipaddr = require('ipaddr.js'); -``` - -The API consists of several global methods and two classes: ipaddr.IPv6 and ipaddr.IPv4. - -### Global methods - -There are three global methods defined: `ipaddr.isValid`, `ipaddr.parse` and -`ipaddr.process`. All of them receive a string as a single parameter. - -The `ipaddr.isValid` method returns `true` if the address is a valid IPv4 or -IPv6 address, and `false` otherwise. It does not throw any exceptions. - -The `ipaddr.parse` method returns an object representing the IP address, -or throws an `Error` if the passed string is not a valid representation of an -IP address. - -The `ipaddr.process` method works just like the `ipaddr.parse` one, but it -automatically converts IPv4-mapped IPv6 addresses to their IPv4 counterparts -before returning. It is useful when you have a Node.js instance listening -on an IPv6 socket, and the `net.ivp6.bindv6only` sysctl parameter (or its -equivalent on non-Linux OS) is set to 0. In this case, you can accept IPv4 -connections on your IPv6-only socket, but the remote address will be mangled. -Use `ipaddr.process` method to automatically demangle it. - -### Object representation - -Parsing methods return an object which descends from `ipaddr.IPv6` or -`ipaddr.IPv4`. These objects share some properties, but most of them differ. - -#### Shared properties - -One can determine the type of address by calling `addr.kind()`. It will return -either `"ipv6"` or `"ipv4"`. - -An address can be converted back to its string representation with `addr.toString()`. -Note that this method: - * does not return the original string used to create the object (in fact, there is - no way of getting that string) - * returns a compact representation (when it is applicable) - -A `match(range, bits)` method can be used to check if the address falls into a -certain CIDR range. -Note that an address can be (obviously) matched only against an address of the same type. - -For example: - -```js -var addr = ipaddr.parse("2001:db8:1234::1"); -var range = ipaddr.parse("2001:db8::"); - -addr.match(range, 32); // => true -``` - -Alternatively, `match` can also be called as `match([range, bits])`. In this way, -it can be used together with the `parseCIDR(string)` method, which parses an IP -address together with a CIDR range. - -For example: - -```js -var addr = ipaddr.parse("2001:db8:1234::1"); - -addr.match(ipaddr.parseCIDR("2001:db8::/32")); // => true -``` - -A `range()` method returns one of predefined names for several special ranges defined -by IP protocols. The exact names (and their respective CIDR ranges) can be looked up -in the source: [IPv6 ranges] and [IPv4 ranges]. Some common ones include `"unicast"` -(the default one) and `"reserved"`. - -You can match against your own range list by using -`ipaddr.subnetMatch(address, rangeList, defaultName)` method. It can work with a mix of IPv6 or IPv4 addresses, and accepts a name-to-subnet map as the range list. For example: - -```js -var rangeList = { - documentationOnly: [ ipaddr.parse('2001:db8::'), 32 ], - tunnelProviders: [ - [ ipaddr.parse('2001:470::'), 32 ], // he.net - [ ipaddr.parse('2001:5c0::'), 32 ] // freenet6 - ] -}; -ipaddr.subnetMatch(ipaddr.parse('2001:470:8:66::1'), rangeList, 'unknown'); // => "tunnelProviders" -``` - -The addresses can be converted to their byte representation with `toByteArray()`. -(Actually, JavaScript mostly does not know about byte buffers. They are emulated with -arrays of numbers, each in range of 0..255.) - -```js -var bytes = ipaddr.parse('2a00:1450:8007::68').toByteArray(); // ipv6.google.com -bytes // => [42, 0x00, 0x14, 0x50, 0x80, 0x07, 0x00, , 0x00, 0x68 ] -``` - -The `ipaddr.IPv4` and `ipaddr.IPv6` objects have some methods defined, too. All of them -have the same interface for both protocols, and are similar to global methods. - -`ipaddr.IPvX.isValid(string)` can be used to check if the string is a valid address -for particular protocol, and `ipaddr.IPvX.parse(string)` is the error-throwing parser. - -`ipaddr.IPvX.isValid(string)` uses the same format for parsing as the POSIX `inet_ntoa` function, which accepts unusual formats like `0xc0.168.1.1` or `0x10000000`. The function `ipaddr.IPv4.isValidFourPartDecimal(string)` validates the IPv4 address and also ensures that it is written in four-part decimal format. - -[IPv6 ranges]: https://github.com/whitequark/ipaddr.js/blob/master/src/ipaddr.coffee#L186 -[IPv4 ranges]: https://github.com/whitequark/ipaddr.js/blob/master/src/ipaddr.coffee#L71 - -#### IPv6 properties - -Sometimes you will want to convert IPv6 not to a compact string representation (with -the `::` substitution); the `toNormalizedString()` method will return an address where -all zeroes are explicit. - -For example: - -```js -var addr = ipaddr.parse("2001:0db8::0001"); -addr.toString(); // => "2001:db8::1" -addr.toNormalizedString(); // => "2001:db8:0:0:0:0:0:1" -``` - -The `isIPv4MappedAddress()` method will return `true` if this address is an IPv4-mapped -one, and `toIPv4Address()` will return an IPv4 object address. - -To access the underlying binary representation of the address, use `addr.parts`. - -```js -var addr = ipaddr.parse("2001:db8:10::1234:DEAD"); -addr.parts // => [0x2001, 0xdb8, 0x10, 0, 0, 0, 0x1234, 0xdead] -``` - -A IPv6 zone index can be accessed via `addr.zoneId`: - -```js -var addr = ipaddr.parse("2001:db8::%eth0"); -addr.zoneId // => 'eth0' -``` - -#### IPv4 properties - -`toIPv4MappedAddress()` will return a corresponding IPv4-mapped IPv6 address. - -To access the underlying representation of the address, use `addr.octets`. - -```js -var addr = ipaddr.parse("192.168.1.1"); -addr.octets // => [192, 168, 1, 1] -``` - -`prefixLengthFromSubnetMask()` will return a CIDR prefix length for a valid IPv4 netmask or -false if the netmask is not valid. - -```js -ipaddr.IPv4.parse('255.255.255.240').prefixLengthFromSubnetMask() == 28 -ipaddr.IPv4.parse('255.192.164.0').prefixLengthFromSubnetMask() == null -``` - -`subnetMaskFromPrefixLength()` will return an IPv4 netmask for a valid CIDR prefix length. - -```js -ipaddr.IPv4.subnetMaskFromPrefixLength(24) == "255.255.255.0" -ipaddr.IPv4.subnetMaskFromPrefixLength(29) == "255.255.255.248" -``` - -`broadcastAddressFromCIDR()` will return the broadcast address for a given IPv4 interface and netmask in CIDR notation. -```js -ipaddr.IPv4.broadcastAddressFromCIDR("172.0.0.1/24") == "172.0.0.255" -``` -`networkAddressFromCIDR()` will return the network address for a given IPv4 interface and netmask in CIDR notation. -```js -ipaddr.IPv4.networkAddressFromCIDR("172.0.0.1/24") == "172.0.0.0" -``` - -#### Conversion - -IPv4 and IPv6 can be converted bidirectionally to and from network byte order (MSB) byte arrays. - -The `fromByteArray()` method will take an array and create an appropriate IPv4 or IPv6 object -if the input satisfies the requirements. For IPv4 it has to be an array of four 8-bit values, -while for IPv6 it has to be an array of sixteen 8-bit values. - -For example: -```js -var addr = ipaddr.fromByteArray([0x7f, 0, 0, 1]); -addr.toString(); // => "127.0.0.1" -``` - -or - -```js -var addr = ipaddr.fromByteArray([0x20, 1, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]) -addr.toString(); // => "2001:db8::1" -``` - -Both objects also offer a `toByteArray()` method, which returns an array in network byte order (MSB). - -For example: -```js -var addr = ipaddr.parse("127.0.0.1"); -addr.toByteArray(); // => [0x7f, 0, 0, 1] -``` - -or - -```js -var addr = ipaddr.parse("2001:db8::1"); -addr.toByteArray(); // => [0x20, 1, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] -``` diff --git a/node_modules/ipaddr.js/ipaddr.min.js b/node_modules/ipaddr.js/ipaddr.min.js deleted file mode 100644 index 56c227caf..000000000 --- a/node_modules/ipaddr.js/ipaddr.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var r,t,n,e,i,o,a,s;t={},s=this,"undefined"!=typeof module&&null!==module&&module.exports?module.exports=t:s.ipaddr=t,a=function(r,t,n,e){var i,o;if(r.length!==t.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");for(i=0;e>0;){if((o=n-e)<0&&(o=0),r[i]>>o!=t[i]>>o)return!1;e-=n,i+=1}return!0},t.subnetMatch=function(r,t,n){var e,i,o,a,s;null==n&&(n="unicast");for(o in t)for(!(a=t[o])[0]||a[0]instanceof Array||(a=[a]),e=0,i=a.length;e=0;t=n+=-1){if(!((e=this.octets[t])in a))return null;if(o=a[e],i&&0!==o)return null;8!==o&&(i=!0),r+=o}return 32-r},r}(),n="(0?\\d+|0x[a-f0-9]+)",e={fourOctet:new RegExp("^"+n+"\\."+n+"\\."+n+"\\."+n+"$","i"),longValue:new RegExp("^"+n+"$","i")},t.IPv4.parser=function(r){var t,n,i,o,a;if(n=function(r){return"0"===r[0]&&"x"!==r[1]?parseInt(r,8):parseInt(r)},t=r.match(e.fourOctet))return function(){var r,e,o,a;for(a=[],r=0,e=(o=t.slice(1,6)).length;r4294967295||a<0)throw new Error("ipaddr: address outside defined range");return function(){var r,t;for(t=[],o=r=0;r<=24;o=r+=8)t.push(a>>o&255);return t}().reverse()}return null},t.IPv6=function(){function r(r,t){var n,e,i,o,a,s;if(16===r.length)for(this.parts=[],n=e=0;e<=14;n=e+=2)this.parts.push(r[n]<<8|r[n+1]);else{if(8!==r.length)throw new Error("ipaddr: ipv6 part count should be 8 or 16");this.parts=r}for(i=0,o=(s=this.parts).length;i>8),r.push(255&e);return r},r.prototype.toNormalizedString=function(){var r,t,n;return r=function(){var r,n,e,i;for(i=[],r=0,n=(e=this.parts).length;r>8,255&r,n>>8,255&n])},r.prototype.prefixLengthFromSubnetMask=function(){var r,t,n,e,i,o,a;for(a={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},r=0,i=!1,t=n=7;n>=0;t=n+=-1){if(!((e=this.parts[t])in a))return null;if(o=a[e],i&&0!==o)return null;16!==o&&(i=!0),r+=o}return 128-r},r}(),i="(?:[0-9a-f]+::?)+",o={zoneIndex:new RegExp("%[0-9a-z]{1,}","i"),native:new RegExp("^(::)?("+i+")?([0-9a-f]+)?(::)?(%[0-9a-z]{1,})?$","i"),transitional:new RegExp("^((?:"+i+")|(?:::)(?:"+i+")?)"+n+"\\."+n+"\\."+n+"\\."+n+"(%[0-9a-z]{1,})?$","i")},r=function(r,t){var n,e,i,a,s,p;if(r.indexOf("::")!==r.lastIndexOf("::"))return null;for((p=(r.match(o.zoneIndex)||[])[0])&&(p=p.substring(1),r=r.replace(/%.+$/,"")),n=0,e=-1;(e=r.indexOf(":",e+1))>=0;)n++;if("::"===r.substr(0,2)&&n--,"::"===r.substr(-2,2)&&n--,n>t)return null;for(s=t-n,a=":";s--;)a+="0:";return":"===(r=r.replace("::",a))[0]&&(r=r.slice(1)),":"===r[r.length-1]&&(r=r.slice(0,-1)),t=function(){var t,n,e,o;for(o=[],t=0,n=(e=r.split(":")).length;t=0&&t<=32)return e=[this.parse(n[1]),t],Object.defineProperty(e,"toString",{value:function(){return this.join("/")}}),e;throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},t.IPv4.subnetMaskFromPrefixLength=function(r){var t,n,e;if((r=parseInt(r))<0||r>32)throw new Error("ipaddr: invalid IPv4 prefix length");for(e=[0,0,0,0],n=0,t=Math.floor(r/8);n=0&&t<=128)return e=[this.parse(n[1]),t],Object.defineProperty(e,"toString",{value:function(){return this.join("/")}}),e;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},t.isValid=function(r){return t.IPv6.isValid(r)||t.IPv4.isValid(r)},t.parse=function(r){if(t.IPv6.isValid(r))return t.IPv6.parse(r);if(t.IPv4.isValid(r))return t.IPv4.parse(r);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},t.parseCIDR=function(r){try{return t.IPv6.parseCIDR(r)}catch(n){n;try{return t.IPv4.parseCIDR(r)}catch(r){throw r,new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},t.fromByteArray=function(r){var n;if(4===(n=r.length))return new t.IPv4(r);if(16===n)return new t.IPv6(r);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},t.process=function(r){var t;return"ipv6"===(t=this.parse(r)).kind()&&t.isIPv4MappedAddress()?t.toIPv4Address():t}}).call(this); \ No newline at end of file diff --git a/node_modules/ipaddr.js/lib/ipaddr.js b/node_modules/ipaddr.js/lib/ipaddr.js deleted file mode 100644 index ab5d74b4e..000000000 --- a/node_modules/ipaddr.js/lib/ipaddr.js +++ /dev/null @@ -1,636 +0,0 @@ -(function() { - var expandIPv6, ipaddr, ipv4Part, ipv4Regexes, ipv6Part, ipv6Regexes, matchCIDR, root, zoneIndex; - - ipaddr = {}; - - root = this; - - if ((typeof module !== "undefined" && module !== null) && module.exports) { - module.exports = ipaddr; - } else { - root['ipaddr'] = ipaddr; - } - - matchCIDR = function(first, second, partSize, cidrBits) { - var part, shift; - if (first.length !== second.length) { - throw new Error("ipaddr: cannot match CIDR for objects with different lengths"); - } - part = 0; - while (cidrBits > 0) { - shift = partSize - cidrBits; - if (shift < 0) { - shift = 0; - } - if (first[part] >> shift !== second[part] >> shift) { - return false; - } - cidrBits -= partSize; - part += 1; - } - return true; - }; - - ipaddr.subnetMatch = function(address, rangeList, defaultName) { - var k, len, rangeName, rangeSubnets, subnet; - if (defaultName == null) { - defaultName = 'unicast'; - } - for (rangeName in rangeList) { - rangeSubnets = rangeList[rangeName]; - if (rangeSubnets[0] && !(rangeSubnets[0] instanceof Array)) { - rangeSubnets = [rangeSubnets]; - } - for (k = 0, len = rangeSubnets.length; k < len; k++) { - subnet = rangeSubnets[k]; - if (address.kind() === subnet[0].kind()) { - if (address.match.apply(address, subnet)) { - return rangeName; - } - } - } - } - return defaultName; - }; - - ipaddr.IPv4 = (function() { - function IPv4(octets) { - var k, len, octet; - if (octets.length !== 4) { - throw new Error("ipaddr: ipv4 octet count should be 4"); - } - for (k = 0, len = octets.length; k < len; k++) { - octet = octets[k]; - if (!((0 <= octet && octet <= 255))) { - throw new Error("ipaddr: ipv4 octet should fit in 8 bits"); - } - } - this.octets = octets; - } - - IPv4.prototype.kind = function() { - return 'ipv4'; - }; - - IPv4.prototype.toString = function() { - return this.octets.join("."); - }; - - IPv4.prototype.toNormalizedString = function() { - return this.toString(); - }; - - IPv4.prototype.toByteArray = function() { - return this.octets.slice(0); - }; - - IPv4.prototype.match = function(other, cidrRange) { - var ref; - if (cidrRange === void 0) { - ref = other, other = ref[0], cidrRange = ref[1]; - } - if (other.kind() !== 'ipv4') { - throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one"); - } - return matchCIDR(this.octets, other.octets, 8, cidrRange); - }; - - IPv4.prototype.SpecialRanges = { - unspecified: [[new IPv4([0, 0, 0, 0]), 8]], - broadcast: [[new IPv4([255, 255, 255, 255]), 32]], - multicast: [[new IPv4([224, 0, 0, 0]), 4]], - linkLocal: [[new IPv4([169, 254, 0, 0]), 16]], - loopback: [[new IPv4([127, 0, 0, 0]), 8]], - carrierGradeNat: [[new IPv4([100, 64, 0, 0]), 10]], - "private": [[new IPv4([10, 0, 0, 0]), 8], [new IPv4([172, 16, 0, 0]), 12], [new IPv4([192, 168, 0, 0]), 16]], - reserved: [[new IPv4([192, 0, 0, 0]), 24], [new IPv4([192, 0, 2, 0]), 24], [new IPv4([192, 88, 99, 0]), 24], [new IPv4([198, 51, 100, 0]), 24], [new IPv4([203, 0, 113, 0]), 24], [new IPv4([240, 0, 0, 0]), 4]] - }; - - IPv4.prototype.range = function() { - return ipaddr.subnetMatch(this, this.SpecialRanges); - }; - - IPv4.prototype.toIPv4MappedAddress = function() { - return ipaddr.IPv6.parse("::ffff:" + (this.toString())); - }; - - IPv4.prototype.prefixLengthFromSubnetMask = function() { - var cidr, i, k, octet, stop, zeros, zerotable; - zerotable = { - 0: 8, - 128: 7, - 192: 6, - 224: 5, - 240: 4, - 248: 3, - 252: 2, - 254: 1, - 255: 0 - }; - cidr = 0; - stop = false; - for (i = k = 3; k >= 0; i = k += -1) { - octet = this.octets[i]; - if (octet in zerotable) { - zeros = zerotable[octet]; - if (stop && zeros !== 0) { - return null; - } - if (zeros !== 8) { - stop = true; - } - cidr += zeros; - } else { - return null; - } - } - return 32 - cidr; - }; - - return IPv4; - - })(); - - ipv4Part = "(0?\\d+|0x[a-f0-9]+)"; - - ipv4Regexes = { - fourOctet: new RegExp("^" + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "$", 'i'), - longValue: new RegExp("^" + ipv4Part + "$", 'i') - }; - - ipaddr.IPv4.parser = function(string) { - var match, parseIntAuto, part, shift, value; - parseIntAuto = function(string) { - if (string[0] === "0" && string[1] !== "x") { - return parseInt(string, 8); - } else { - return parseInt(string); - } - }; - if (match = string.match(ipv4Regexes.fourOctet)) { - return (function() { - var k, len, ref, results; - ref = match.slice(1, 6); - results = []; - for (k = 0, len = ref.length; k < len; k++) { - part = ref[k]; - results.push(parseIntAuto(part)); - } - return results; - })(); - } else if (match = string.match(ipv4Regexes.longValue)) { - value = parseIntAuto(match[1]); - if (value > 0xffffffff || value < 0) { - throw new Error("ipaddr: address outside defined range"); - } - return ((function() { - var k, results; - results = []; - for (shift = k = 0; k <= 24; shift = k += 8) { - results.push((value >> shift) & 0xff); - } - return results; - })()).reverse(); - } else { - return null; - } - }; - - ipaddr.IPv6 = (function() { - function IPv6(parts, zoneId) { - var i, k, l, len, part, ref; - if (parts.length === 16) { - this.parts = []; - for (i = k = 0; k <= 14; i = k += 2) { - this.parts.push((parts[i] << 8) | parts[i + 1]); - } - } else if (parts.length === 8) { - this.parts = parts; - } else { - throw new Error("ipaddr: ipv6 part count should be 8 or 16"); - } - ref = this.parts; - for (l = 0, len = ref.length; l < len; l++) { - part = ref[l]; - if (!((0 <= part && part <= 0xffff))) { - throw new Error("ipaddr: ipv6 part should fit in 16 bits"); - } - } - if (zoneId) { - this.zoneId = zoneId; - } - } - - IPv6.prototype.kind = function() { - return 'ipv6'; - }; - - IPv6.prototype.toString = function() { - return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/, '::'); - }; - - IPv6.prototype.toByteArray = function() { - var bytes, k, len, part, ref; - bytes = []; - ref = this.parts; - for (k = 0, len = ref.length; k < len; k++) { - part = ref[k]; - bytes.push(part >> 8); - bytes.push(part & 0xff); - } - return bytes; - }; - - IPv6.prototype.toNormalizedString = function() { - var addr, part, suffix; - addr = ((function() { - var k, len, ref, results; - ref = this.parts; - results = []; - for (k = 0, len = ref.length; k < len; k++) { - part = ref[k]; - results.push(part.toString(16)); - } - return results; - }).call(this)).join(":"); - suffix = ''; - if (this.zoneId) { - suffix = '%' + this.zoneId; - } - return addr + suffix; - }; - - IPv6.prototype.match = function(other, cidrRange) { - var ref; - if (cidrRange === void 0) { - ref = other, other = ref[0], cidrRange = ref[1]; - } - if (other.kind() !== 'ipv6') { - throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one"); - } - return matchCIDR(this.parts, other.parts, 16, cidrRange); - }; - - IPv6.prototype.SpecialRanges = { - unspecified: [new IPv6([0, 0, 0, 0, 0, 0, 0, 0]), 128], - linkLocal: [new IPv6([0xfe80, 0, 0, 0, 0, 0, 0, 0]), 10], - multicast: [new IPv6([0xff00, 0, 0, 0, 0, 0, 0, 0]), 8], - loopback: [new IPv6([0, 0, 0, 0, 0, 0, 0, 1]), 128], - uniqueLocal: [new IPv6([0xfc00, 0, 0, 0, 0, 0, 0, 0]), 7], - ipv4Mapped: [new IPv6([0, 0, 0, 0, 0, 0xffff, 0, 0]), 96], - rfc6145: [new IPv6([0, 0, 0, 0, 0xffff, 0, 0, 0]), 96], - rfc6052: [new IPv6([0x64, 0xff9b, 0, 0, 0, 0, 0, 0]), 96], - '6to4': [new IPv6([0x2002, 0, 0, 0, 0, 0, 0, 0]), 16], - teredo: [new IPv6([0x2001, 0, 0, 0, 0, 0, 0, 0]), 32], - reserved: [[new IPv6([0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]), 32]] - }; - - IPv6.prototype.range = function() { - return ipaddr.subnetMatch(this, this.SpecialRanges); - }; - - IPv6.prototype.isIPv4MappedAddress = function() { - return this.range() === 'ipv4Mapped'; - }; - - IPv6.prototype.toIPv4Address = function() { - var high, low, ref; - if (!this.isIPv4MappedAddress()) { - throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4"); - } - ref = this.parts.slice(-2), high = ref[0], low = ref[1]; - return new ipaddr.IPv4([high >> 8, high & 0xff, low >> 8, low & 0xff]); - }; - - IPv6.prototype.prefixLengthFromSubnetMask = function() { - var cidr, i, k, part, stop, zeros, zerotable; - zerotable = { - 0: 16, - 32768: 15, - 49152: 14, - 57344: 13, - 61440: 12, - 63488: 11, - 64512: 10, - 65024: 9, - 65280: 8, - 65408: 7, - 65472: 6, - 65504: 5, - 65520: 4, - 65528: 3, - 65532: 2, - 65534: 1, - 65535: 0 - }; - cidr = 0; - stop = false; - for (i = k = 7; k >= 0; i = k += -1) { - part = this.parts[i]; - if (part in zerotable) { - zeros = zerotable[part]; - if (stop && zeros !== 0) { - return null; - } - if (zeros !== 16) { - stop = true; - } - cidr += zeros; - } else { - return null; - } - } - return 128 - cidr; - }; - - return IPv6; - - })(); - - ipv6Part = "(?:[0-9a-f]+::?)+"; - - zoneIndex = "%[0-9a-z]{1,}"; - - ipv6Regexes = { - zoneIndex: new RegExp(zoneIndex, 'i'), - "native": new RegExp("^(::)?(" + ipv6Part + ")?([0-9a-f]+)?(::)?(" + zoneIndex + ")?$", 'i'), - transitional: new RegExp(("^((?:" + ipv6Part + ")|(?:::)(?:" + ipv6Part + ")?)") + (ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part) + ("(" + zoneIndex + ")?$"), 'i') - }; - - expandIPv6 = function(string, parts) { - var colonCount, lastColon, part, replacement, replacementCount, zoneId; - if (string.indexOf('::') !== string.lastIndexOf('::')) { - return null; - } - zoneId = (string.match(ipv6Regexes['zoneIndex']) || [])[0]; - if (zoneId) { - zoneId = zoneId.substring(1); - string = string.replace(/%.+$/, ''); - } - colonCount = 0; - lastColon = -1; - while ((lastColon = string.indexOf(':', lastColon + 1)) >= 0) { - colonCount++; - } - if (string.substr(0, 2) === '::') { - colonCount--; - } - if (string.substr(-2, 2) === '::') { - colonCount--; - } - if (colonCount > parts) { - return null; - } - replacementCount = parts - colonCount; - replacement = ':'; - while (replacementCount--) { - replacement += '0:'; - } - string = string.replace('::', replacement); - if (string[0] === ':') { - string = string.slice(1); - } - if (string[string.length - 1] === ':') { - string = string.slice(0, -1); - } - parts = (function() { - var k, len, ref, results; - ref = string.split(":"); - results = []; - for (k = 0, len = ref.length; k < len; k++) { - part = ref[k]; - results.push(parseInt(part, 16)); - } - return results; - })(); - return { - parts: parts, - zoneId: zoneId - }; - }; - - ipaddr.IPv6.parser = function(string) { - var addr, k, len, match, octet, octets, zoneId; - if (ipv6Regexes['native'].test(string)) { - return expandIPv6(string, 8); - } else if (match = string.match(ipv6Regexes['transitional'])) { - zoneId = match[6] || ''; - addr = expandIPv6(match[1].slice(0, -1) + zoneId, 6); - if (addr.parts) { - octets = [parseInt(match[2]), parseInt(match[3]), parseInt(match[4]), parseInt(match[5])]; - for (k = 0, len = octets.length; k < len; k++) { - octet = octets[k]; - if (!((0 <= octet && octet <= 255))) { - return null; - } - } - addr.parts.push(octets[0] << 8 | octets[1]); - addr.parts.push(octets[2] << 8 | octets[3]); - return { - parts: addr.parts, - zoneId: addr.zoneId - }; - } - } - return null; - }; - - ipaddr.IPv4.isIPv4 = ipaddr.IPv6.isIPv6 = function(string) { - return this.parser(string) !== null; - }; - - ipaddr.IPv4.isValid = function(string) { - var e; - try { - new this(this.parser(string)); - return true; - } catch (error1) { - e = error1; - return false; - } - }; - - ipaddr.IPv4.isValidFourPartDecimal = function(string) { - if (ipaddr.IPv4.isValid(string) && string.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/)) { - return true; - } else { - return false; - } - }; - - ipaddr.IPv6.isValid = function(string) { - var addr, e; - if (typeof string === "string" && string.indexOf(":") === -1) { - return false; - } - try { - addr = this.parser(string); - new this(addr.parts, addr.zoneId); - return true; - } catch (error1) { - e = error1; - return false; - } - }; - - ipaddr.IPv4.parse = function(string) { - var parts; - parts = this.parser(string); - if (parts === null) { - throw new Error("ipaddr: string is not formatted like ip address"); - } - return new this(parts); - }; - - ipaddr.IPv6.parse = function(string) { - var addr; - addr = this.parser(string); - if (addr.parts === null) { - throw new Error("ipaddr: string is not formatted like ip address"); - } - return new this(addr.parts, addr.zoneId); - }; - - ipaddr.IPv4.parseCIDR = function(string) { - var maskLength, match, parsed; - if (match = string.match(/^(.+)\/(\d+)$/)) { - maskLength = parseInt(match[2]); - if (maskLength >= 0 && maskLength <= 32) { - parsed = [this.parse(match[1]), maskLength]; - Object.defineProperty(parsed, 'toString', { - value: function() { - return this.join('/'); - } - }); - return parsed; - } - } - throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range"); - }; - - ipaddr.IPv4.subnetMaskFromPrefixLength = function(prefix) { - var filledOctetCount, j, octets; - prefix = parseInt(prefix); - if (prefix < 0 || prefix > 32) { - throw new Error('ipaddr: invalid IPv4 prefix length'); - } - octets = [0, 0, 0, 0]; - j = 0; - filledOctetCount = Math.floor(prefix / 8); - while (j < filledOctetCount) { - octets[j] = 255; - j++; - } - if (filledOctetCount < 4) { - octets[filledOctetCount] = Math.pow(2, prefix % 8) - 1 << 8 - (prefix % 8); - } - return new this(octets); - }; - - ipaddr.IPv4.broadcastAddressFromCIDR = function(string) { - var cidr, error, i, ipInterfaceOctets, octets, subnetMaskOctets; - try { - cidr = this.parseCIDR(string); - ipInterfaceOctets = cidr[0].toByteArray(); - subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray(); - octets = []; - i = 0; - while (i < 4) { - octets.push(parseInt(ipInterfaceOctets[i], 10) | parseInt(subnetMaskOctets[i], 10) ^ 255); - i++; - } - return new this(octets); - } catch (error1) { - error = error1; - throw new Error('ipaddr: the address does not have IPv4 CIDR format'); - } - }; - - ipaddr.IPv4.networkAddressFromCIDR = function(string) { - var cidr, error, i, ipInterfaceOctets, octets, subnetMaskOctets; - try { - cidr = this.parseCIDR(string); - ipInterfaceOctets = cidr[0].toByteArray(); - subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray(); - octets = []; - i = 0; - while (i < 4) { - octets.push(parseInt(ipInterfaceOctets[i], 10) & parseInt(subnetMaskOctets[i], 10)); - i++; - } - return new this(octets); - } catch (error1) { - error = error1; - throw new Error('ipaddr: the address does not have IPv4 CIDR format'); - } - }; - - ipaddr.IPv6.parseCIDR = function(string) { - var maskLength, match, parsed; - if (match = string.match(/^(.+)\/(\d+)$/)) { - maskLength = parseInt(match[2]); - if (maskLength >= 0 && maskLength <= 128) { - parsed = [this.parse(match[1]), maskLength]; - Object.defineProperty(parsed, 'toString', { - value: function() { - return this.join('/'); - } - }); - return parsed; - } - } - throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range"); - }; - - ipaddr.isValid = function(string) { - return ipaddr.IPv6.isValid(string) || ipaddr.IPv4.isValid(string); - }; - - ipaddr.parse = function(string) { - if (ipaddr.IPv6.isValid(string)) { - return ipaddr.IPv6.parse(string); - } else if (ipaddr.IPv4.isValid(string)) { - return ipaddr.IPv4.parse(string); - } else { - throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format"); - } - }; - - ipaddr.parseCIDR = function(string) { - var e; - try { - return ipaddr.IPv6.parseCIDR(string); - } catch (error1) { - e = error1; - try { - return ipaddr.IPv4.parseCIDR(string); - } catch (error1) { - e = error1; - throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format"); - } - } - }; - - ipaddr.fromByteArray = function(bytes) { - var length; - length = bytes.length; - if (length === 4) { - return new ipaddr.IPv4(bytes); - } else if (length === 16) { - return new ipaddr.IPv6(bytes); - } else { - throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address"); - } - }; - - ipaddr.process = function(string) { - var addr; - addr = this.parse(string); - if (addr.kind() === 'ipv6' && addr.isIPv4MappedAddress()) { - return addr.toIPv4Address(); - } else { - return addr; - } - }; - -}).call(this); diff --git a/node_modules/ipaddr.js/lib/ipaddr.js.d.ts b/node_modules/ipaddr.js/lib/ipaddr.js.d.ts deleted file mode 100644 index ef01ac4fb..000000000 --- a/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +++ /dev/null @@ -1,71 +0,0 @@ - - -declare module "ipaddr.js" { - - type IPv4Range = 'unicast' | 'unspecified' | 'broadcast' | 'multicast' | 'linkLocal' | 'loopback' | 'carrierGradeNat' | 'private' | 'reserved'; - type IPv6Range = 'unicast' | 'unspecified' | 'linkLocal' | 'multicast' | 'loopback' | 'uniqueLocal' | 'ipv4Mapped' | 'rfc6145' | 'rfc6052' | '6to4' | 'teredo' | 'reserved'; - - interface RangeList { - [name: string]: [T, number] | [T, number][]; - } - - - // Common methods/properties for IPv4 and IPv6 classes. - class IP { - - prefixLengthFromSubnetMask(): number | false; - toByteArray(): number[]; - toNormalizedString(): string; - toString(): string; - } - - namespace Address { - - export function isValid(addr: string): boolean; - export function fromByteArray(bytes: number[]): IPv4 | IPv6; - export function parse(addr: string): IPv4 | IPv6; - export function parseCIDR(mask: string): [IPv4 | IPv6, number]; - export function process(address: string): IPv4 | IPv6; - export function subnetMatch(addr: IPv4, rangeList: RangeList, defaultName?: string): string; - export function subnetMatch(addr: IPv6, rangeList: RangeList, defaultName?: string): string; - - export class IPv4 extends IP { - static broadcastAddressFromCIDR(addr: string): IPv4; - static isIPv4(addr: string): boolean; - static isValidFourPartDecimal(addr: string): boolean; - static isValid(addr: string): boolean; - static networkAddressFromCIDR(addr: string): IPv4; - static parse(addr: string): IPv4; - static parseCIDR(addr: string): [IPv4, number]; - static subnetMaskFromPrefixLength(prefix: number): IPv4; - constructor(octets: number[]); - - kind(): 'ipv4'; - match(addr: IPv4, bits: number): boolean; - match(mask: [IPv4, number]): boolean; - range(): IPv4Range; - subnetMatch(rangeList: RangeList, defaultName?: string): string; - toIPv4MappedAddress(): IPv6; - } - - export class IPv6 extends IP { - static broadcastAddressFromCIDR(addr: string): IPv6; - static isIPv6(addr: string): boolean; - static isValid(addr: string): boolean; - static parse(addr: string): IPv6; - static parseCIDR(addr: string): [IPv6, number]; - static subnetMaskFromPrefixLength(prefix: number): IPv6; - constructor(octets: number[]); - - isIPv4MappedAddress(): boolean; - kind(): 'ipv6'; - match(addr: IPv6, bits: number): boolean; - match(mask: [IPv6, number]): boolean; - range(): IPv6Range; - subnetMatch(rangeList: RangeList, defaultName?: string): string; - toIPv4Address(): IPv4; - } - } - - export = Address; -} diff --git a/node_modules/ipaddr.js/package.json b/node_modules/ipaddr.js/package.json deleted file mode 100644 index 64d00bff3..000000000 --- a/node_modules/ipaddr.js/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_from": "ipaddr.js@^1.5.2", - "_id": "ipaddr.js@1.8.1", - "_inBundle": false, - "_integrity": "sha1-+kt5+kf9Pe9eOxWYJRYcClGclCc=", - "_location": "/ipaddr.js", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ipaddr.js@^1.5.2", - "name": "ipaddr.js", - "escapedName": "ipaddr.js", - "rawSpec": "^1.5.2", - "saveSpec": null, - "fetchSpec": "^1.5.2" - }, - "_requiredBy": [ - "/internal-ip" - ], - "_resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.1.tgz", - "_shasum": "fa4b79fa47fd3def5e3b159825161c0a519c9427", - "_spec": "ipaddr.js@^1.5.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/internal-ip", - "author": { - "name": "whitequark", - "email": "whitequark@whitequark.org" - }, - "bugs": { - "url": "https://github.com/whitequark/ipaddr.js/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "A library for manipulating IPv4 and IPv6 addresses in JavaScript.", - "devDependencies": { - "coffee-script": "~1.12.6", - "nodeunit": ">=0.8.2 <0.8.7", - "uglify-js": "~3.0.19" - }, - "directories": { - "lib": "./lib" - }, - "engines": { - "node": ">= 0.10" - }, - "files": [ - "lib/", - "ipaddr.min.js" - ], - "homepage": "https://github.com/whitequark/ipaddr.js#readme", - "keywords": [ - "ip", - "ipv4", - "ipv6" - ], - "license": "MIT", - "main": "./lib/ipaddr.js", - "name": "ipaddr.js", - "repository": { - "type": "git", - "url": "git://github.com/whitequark/ipaddr.js.git" - }, - "scripts": { - "test": "cake build test" - }, - "types": "./lib/ipaddr.js.d.ts", - "version": "1.8.1" -} diff --git a/node_modules/is-accessor-descriptor/LICENSE b/node_modules/is-accessor-descriptor/LICENSE deleted file mode 100644 index 65f90aca8..000000000 --- a/node_modules/is-accessor-descriptor/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/is-accessor-descriptor/README.md b/node_modules/is-accessor-descriptor/README.md deleted file mode 100644 index 3743fe6bc..000000000 --- a/node_modules/is-accessor-descriptor/README.md +++ /dev/null @@ -1,123 +0,0 @@ -# is-accessor-descriptor [![NPM version](https://img.shields.io/npm/v/is-accessor-descriptor.svg)](https://www.npmjs.com/package/is-accessor-descriptor) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-accessor-descriptor.svg)](https://travis-ci.org/jonschlinkert/is-accessor-descriptor) - -> Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. - -- [Install](#install) -- [Usage](#usage) -- [Examples](#examples) -- [API](#api) -- [Related projects](#related-projects) -- [Running tests](#running-tests) -- [Contributing](#contributing) -- [Author](#author) -- [License](#license) - -_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm i is-accessor-descriptor --save -``` - -## Usage - -```js -var isAccessor = require('is-accessor-descriptor'); - -isAccessor({get: function() {}}); -//=> true -``` - -You may also pass an object and property name to check if the property is an accessor: - -```js -isAccessor(foo, 'bar'); -``` - -## Examples - -`false` when not an object - -```js -isAccessor('a') -isAccessor(null) -isAccessor([]) -//=> false -``` - -`true` when the object has valid properties - -and the properties all have the correct JavaScript types: - -```js -isAccessor({get: noop, set: noop}) -isAccessor({get: noop}) -isAccessor({set: noop}) -//=> true -``` - -`false` when the object has invalid properties - -```js -isAccessor({get: noop, set: noop, bar: 'baz'}) -isAccessor({get: noop, writable: true}) -isAccessor({get: noop, value: true}) -//=> false -``` - -`false` when an accessor is not a function - -```js -isAccessor({get: noop, set: 'baz'}) -isAccessor({get: 'foo', set: noop}) -isAccessor({get: 'foo', bar: 'baz'}) -isAccessor({get: 'foo', set: 'baz'}) -//=> false -``` - -`false` when a value is not the correct type - -```js -isAccessor({get: noop, set: noop, enumerable: 'foo'}) -isAccessor({set: noop, configurable: 'foo'}) -isAccessor({get: noop, configurable: 'foo'}) -//=> false -``` - -## Related projects - -* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor) -* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor) -* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://www.npmjs.com/package/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor) -* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject) - -## Running tests - -Install dev dependencies: - -```sh -$ npm i -d && npm test -``` - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-accessor-descriptor/issues/new). - -## Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert) -Released under the MIT license. - -*** - -_This file was generated by [verb](https://github.com/verbose/verb) on December 28, 2015._ \ No newline at end of file diff --git a/node_modules/is-accessor-descriptor/index.js b/node_modules/is-accessor-descriptor/index.js deleted file mode 100644 index 2ca4af8bd..000000000 --- a/node_modules/is-accessor-descriptor/index.js +++ /dev/null @@ -1,69 +0,0 @@ -/*! - * is-accessor-descriptor - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var typeOf = require('kind-of'); - -// accessor descriptor properties -var accessor = { - get: 'function', - set: 'function', - configurable: 'boolean', - enumerable: 'boolean' -}; - -function isAccessorDescriptor(obj, prop) { - if (typeof prop === 'string') { - var val = Object.getOwnPropertyDescriptor(obj, prop); - return typeof val !== 'undefined'; - } - - if (typeOf(obj) !== 'object') { - return false; - } - - if (has(obj, 'value') || has(obj, 'writable')) { - return false; - } - - if (!has(obj, 'get') || typeof obj.get !== 'function') { - return false; - } - - // tldr: it's valid to have "set" be undefined - // "set" might be undefined if `Object.getOwnPropertyDescriptor` - // was used to get the value, and only `get` was defined by the user - if (has(obj, 'set') && typeof obj[key] !== 'function' && typeof obj[key] !== 'undefined') { - return false; - } - - for (var key in obj) { - if (!accessor.hasOwnProperty(key)) { - continue; - } - - if (typeOf(obj[key]) === accessor[key]) { - continue; - } - - if (typeof obj[key] !== 'undefined') { - return false; - } - } - return true; -} - -function has(obj, key) { - return {}.hasOwnProperty.call(obj, key); -} - -/** - * Expose `isAccessorDescriptor` - */ - -module.exports = isAccessorDescriptor; diff --git a/node_modules/is-accessor-descriptor/package.json b/node_modules/is-accessor-descriptor/package.json deleted file mode 100644 index b6137f874..000000000 --- a/node_modules/is-accessor-descriptor/package.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "_from": "is-accessor-descriptor@^0.1.6", - "_id": "is-accessor-descriptor@0.1.6", - "_inBundle": false, - "_integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "_location": "/is-accessor-descriptor", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-accessor-descriptor@^0.1.6", - "name": "is-accessor-descriptor", - "escapedName": "is-accessor-descriptor", - "rawSpec": "^0.1.6", - "saveSpec": null, - "fetchSpec": "^0.1.6" - }, - "_requiredBy": [ - "/is-descriptor" - ], - "_resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "_shasum": "a9e12cb3ae8d876727eeef3843f8a0897b5c98d6", - "_spec": "is-accessor-descriptor@^0.1.6", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/is-descriptor", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-accessor-descriptor/issues" - }, - "bundleDependencies": false, - "dependencies": { - "kind-of": "^3.0.2" - }, - "deprecated": false, - "description": "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.", - "devDependencies": { - "mocha": "*", - "should": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-accessor-descriptor", - "keywords": [ - "accessor", - "check", - "data", - "descriptor", - "get", - "getter", - "is", - "keys", - "object", - "properties", - "property", - "set", - "setter", - "type", - "valid", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "is-accessor-descriptor", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-accessor-descriptor.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "is-accessor-descriptor", - "is-data-descriptor", - "is-descriptor", - "isobject" - ] - }, - "plugins": [ - "gulp-format-md" - ], - "layout": "default" - }, - "version": "0.1.6" -} diff --git a/node_modules/is-binary-path/index.js b/node_modules/is-binary-path/index.js deleted file mode 100644 index 6c8c7e728..000000000 --- a/node_modules/is-binary-path/index.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; -var path = require('path'); -var binaryExtensions = require('binary-extensions'); -var exts = Object.create(null); - -binaryExtensions.forEach(function (el) { - exts[el] = true; -}); - -module.exports = function (filepath) { - return path.extname(filepath).slice(1).toLowerCase() in exts; -}; diff --git a/node_modules/is-binary-path/license b/node_modules/is-binary-path/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/is-binary-path/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/is-binary-path/package.json b/node_modules/is-binary-path/package.json deleted file mode 100644 index 6f9197e67..000000000 --- a/node_modules/is-binary-path/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "_from": "is-binary-path@^1.0.0", - "_id": "is-binary-path@1.0.1", - "_inBundle": false, - "_integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "_location": "/is-binary-path", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-binary-path@^1.0.0", - "name": "is-binary-path", - "escapedName": "is-binary-path", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/chokidar" - ], - "_resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "_shasum": "75f16642b480f187a711c814161fd3a4a7655898", - "_spec": "is-binary-path@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/chokidar", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/is-binary-path/issues" - }, - "bundleDependencies": false, - "dependencies": { - "binary-extensions": "^1.0.0" - }, - "deprecated": false, - "description": "Check if a filepath is a binary file", - "devDependencies": { - "ava": "0.0.4" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/is-binary-path#readme", - "keywords": [ - "bin", - "binary", - "ext", - "extensions", - "extension", - "file", - "path", - "check", - "detect", - "is" - ], - "license": "MIT", - "name": "is-binary-path", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is-binary-path.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.0.1" -} diff --git a/node_modules/is-binary-path/readme.md b/node_modules/is-binary-path/readme.md deleted file mode 100644 index a17d6a245..000000000 --- a/node_modules/is-binary-path/readme.md +++ /dev/null @@ -1,34 +0,0 @@ -# is-binary-path [![Build Status](https://travis-ci.org/sindresorhus/is-binary-path.svg?branch=master)](https://travis-ci.org/sindresorhus/is-binary-path) - -> Check if a filepath is a binary file - - -## Install - -``` -$ npm install --save is-binary-path -``` - - -## Usage - -```js -var isBinaryPath = require('is-binary-path'); - -isBinaryPath('src/unicorn.png'); -//=> true - -isBinaryPath('src/unicorn.txt'); -//=> false -``` - - -## Related - -- [`binary-extensions`](https://github.com/sindresorhus/binary-extensions) - List of binary file extensions -- [`is-text-path`](https://github.com/sindresorhus/is-text-path) - Check if a filepath is a text file - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/is-buffer/LICENSE b/node_modules/is-buffer/LICENSE deleted file mode 100644 index 0c068ceec..000000000 --- a/node_modules/is-buffer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Feross Aboukhadijeh - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/is-buffer/README.md b/node_modules/is-buffer/README.md deleted file mode 100644 index cce0a8cf9..000000000 --- a/node_modules/is-buffer/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# is-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] - -[travis-image]: https://img.shields.io/travis/feross/is-buffer/master.svg -[travis-url]: https://travis-ci.org/feross/is-buffer -[npm-image]: https://img.shields.io/npm/v/is-buffer.svg -[npm-url]: https://npmjs.org/package/is-buffer -[downloads-image]: https://img.shields.io/npm/dm/is-buffer.svg -[downloads-url]: https://npmjs.org/package/is-buffer -[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg -[standard-url]: https://standardjs.com - -#### Determine if an object is a [`Buffer`](http://nodejs.org/api/buffer.html) (including the [browserify Buffer](https://github.com/feross/buffer)) - -[![saucelabs][saucelabs-image]][saucelabs-url] - -[saucelabs-image]: https://saucelabs.com/browser-matrix/is-buffer.svg -[saucelabs-url]: https://saucelabs.com/u/is-buffer - -## Why not use `Buffer.isBuffer`? - -This module lets you check if an object is a `Buffer` without using `Buffer.isBuffer` (which includes the whole [buffer](https://github.com/feross/buffer) module in [browserify](http://browserify.org/)). - -It's future-proof and works in node too! - -## install - -```bash -npm install is-buffer -``` - -## usage - -```js -var isBuffer = require('is-buffer') - -isBuffer(new Buffer(4)) // true - -isBuffer(undefined) // false -isBuffer(null) // false -isBuffer('') // false -isBuffer(true) // false -isBuffer(false) // false -isBuffer(0) // false -isBuffer(1) // false -isBuffer(1.0) // false -isBuffer('string') // false -isBuffer({}) // false -isBuffer(function foo () {}) // false -``` - -## license - -MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org). diff --git a/node_modules/is-buffer/index.js b/node_modules/is-buffer/index.js deleted file mode 100644 index 9cce39659..000000000 --- a/node_modules/is-buffer/index.js +++ /dev/null @@ -1,21 +0,0 @@ -/*! - * Determine if an object is a Buffer - * - * @author Feross Aboukhadijeh - * @license MIT - */ - -// The _isBuffer check is for Safari 5-7 support, because it's missing -// Object.prototype.constructor. Remove this eventually -module.exports = function (obj) { - return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) -} - -function isBuffer (obj) { - return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) -} - -// For Node v0.10 support. Remove this eventually. -function isSlowBuffer (obj) { - return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) -} diff --git a/node_modules/is-buffer/package.json b/node_modules/is-buffer/package.json deleted file mode 100644 index 4624e880d..000000000 --- a/node_modules/is-buffer/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "_from": "is-buffer@^1.1.0", - "_id": "is-buffer@1.1.6", - "_inBundle": false, - "_integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "_location": "/is-buffer", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-buffer@^1.1.0", - "name": "is-buffer", - "escapedName": "is-buffer", - "rawSpec": "^1.1.0", - "saveSpec": null, - "fetchSpec": "^1.1.0" - }, - "_requiredBy": [ - "/has-values/is-number/kind-of", - "/has-values/kind-of", - "/insert-module-globals", - "/kind-of", - "/md5", - "/readdirp/expand-brackets/is-accessor-descriptor/kind-of", - "/readdirp/expand-brackets/is-data-descriptor/kind-of", - "/readdirp/is-number/kind-of" - ], - "_resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "_shasum": "efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be", - "_spec": "is-buffer@^1.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/insert-module-globals", - "author": { - "name": "Feross Aboukhadijeh", - "email": "feross@feross.org", - "url": "http://feross.org/" - }, - "bugs": { - "url": "https://github.com/feross/is-buffer/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Determine if an object is a Buffer", - "devDependencies": { - "standard": "*", - "tape": "^4.0.0", - "zuul": "^3.0.0" - }, - "homepage": "https://github.com/feross/is-buffer#readme", - "keywords": [ - "buffer", - "buffers", - "type", - "core buffer", - "browser buffer", - "browserify", - "typed array", - "uint32array", - "int16array", - "int32array", - "float32array", - "float64array", - "browser", - "arraybuffer", - "dataview" - ], - "license": "MIT", - "main": "index.js", - "name": "is-buffer", - "repository": { - "type": "git", - "url": "git://github.com/feross/is-buffer.git" - }, - "scripts": { - "test": "standard && npm run test-node && npm run test-browser", - "test-browser": "zuul -- test/*.js", - "test-browser-local": "zuul --local -- test/*.js", - "test-node": "tape test/*.js" - }, - "testling": { - "files": "test/*.js" - }, - "version": "1.1.6" -} diff --git a/node_modules/is-buffer/test/basic.js b/node_modules/is-buffer/test/basic.js deleted file mode 100644 index be4f8e438..000000000 --- a/node_modules/is-buffer/test/basic.js +++ /dev/null @@ -1,24 +0,0 @@ -var isBuffer = require('../') -var test = require('tape') - -test('is-buffer', function (t) { - t.equal(isBuffer(Buffer.alloc(4)), true, 'new Buffer(4)') - t.equal(isBuffer(Buffer.allocUnsafeSlow(100)), true, 'SlowBuffer(100)') - - t.equal(isBuffer(undefined), false, 'undefined') - t.equal(isBuffer(null), false, 'null') - t.equal(isBuffer(''), false, 'empty string') - t.equal(isBuffer(true), false, 'true') - t.equal(isBuffer(false), false, 'false') - t.equal(isBuffer(0), false, '0') - t.equal(isBuffer(1), false, '1') - t.equal(isBuffer(1.0), false, '1.0') - t.equal(isBuffer('string'), false, 'string') - t.equal(isBuffer({}), false, '{}') - t.equal(isBuffer([]), false, '[]') - t.equal(isBuffer(function foo () {}), false, 'function foo () {}') - t.equal(isBuffer({ isBuffer: null }), false, '{ isBuffer: null }') - t.equal(isBuffer({ isBuffer: function () { throw new Error() } }), false, '{ isBuffer: function () { throw new Error() } }') - - t.end() -}) diff --git a/node_modules/is-data-descriptor/LICENSE b/node_modules/is-data-descriptor/LICENSE deleted file mode 100644 index 65f90aca8..000000000 --- a/node_modules/is-data-descriptor/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/is-data-descriptor/README.md b/node_modules/is-data-descriptor/README.md deleted file mode 100644 index 41e1643f1..000000000 --- a/node_modules/is-data-descriptor/README.md +++ /dev/null @@ -1,128 +0,0 @@ -# is-data-descriptor [![NPM version](https://img.shields.io/npm/v/is-data-descriptor.svg)](https://www.npmjs.com/package/is-data-descriptor) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-data-descriptor.svg)](https://travis-ci.org/jonschlinkert/is-data-descriptor) - -> Returns true if a value has the characteristics of a valid JavaScript data descriptor. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm i is-data-descriptor --save -``` - -## Usage - -```js -var isDataDesc = require('is-data-descriptor'); -``` - -## Examples - -`true` when the descriptor has valid properties with valid values. - -```js -// `value` can be anything -isDataDesc({value: 'foo'}) -isDataDesc({value: function() {}}) -isDataDesc({value: true}) -//=> true -``` - -`false` when not an object - -```js -isDataDesc('a') -//=> false -isDataDesc(null) -//=> false -isDataDesc([]) -//=> false -``` - -`false` when the object has invalid properties - -```js -isDataDesc({value: 'foo', bar: 'baz'}) -//=> false -isDataDesc({value: 'foo', bar: 'baz'}) -//=> false -isDataDesc({value: 'foo', get: function(){}}) -//=> false -isDataDesc({get: function(){}, value: 'foo'}) -//=> false -``` - -`false` when a value is not the correct type - -```js -isDataDesc({value: 'foo', enumerable: 'foo'}) -//=> false -isDataDesc({value: 'foo', configurable: 'foo'}) -//=> false -isDataDesc({value: 'foo', writable: 'foo'}) -//=> false -``` - -## Valid properties - -The only valid data descriptor properties are the following: - -* `configurable` (required) -* `enumerable` (required) -* `value` (optional) -* `writable` (optional) - -To be a valid data descriptor, either `value` or `writable` must be defined. - -**Invalid properties** - -A descriptor may have additional _invalid_ properties (an error will **not** be thrown). - -```js -var foo = {}; - -Object.defineProperty(foo, 'bar', { - enumerable: true, - whatever: 'blah', // invalid, but doesn't cause an error - get: function() { - return 'baz'; - } -}); - -console.log(foo.bar); -//=> 'baz' -``` - -## Related projects - -* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor) -* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://www.npmjs.com/package/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor) -* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject) - -## Running tests - -Install dev dependencies: - -```sh -$ npm i -d && npm test -``` - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-data-descriptor/issues/new). - -## Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert) -Released under the MIT license. - -*** - -_This file was generated by [verb](https://github.com/verbose/verb) on December 28, 2015._ \ No newline at end of file diff --git a/node_modules/is-data-descriptor/index.js b/node_modules/is-data-descriptor/index.js deleted file mode 100644 index d4d09c92a..000000000 --- a/node_modules/is-data-descriptor/index.js +++ /dev/null @@ -1,55 +0,0 @@ -/*! - * is-data-descriptor - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var typeOf = require('kind-of'); - -// data descriptor properties -var data = { - configurable: 'boolean', - enumerable: 'boolean', - writable: 'boolean' -}; - -function isDataDescriptor(obj, prop) { - if (typeOf(obj) !== 'object') { - return false; - } - - if (typeof prop === 'string') { - var val = Object.getOwnPropertyDescriptor(obj, prop); - return typeof val !== 'undefined'; - } - - if (!('value' in obj) && !('writable' in obj)) { - return false; - } - - for (var key in obj) { - if (key === 'value') continue; - - if (!data.hasOwnProperty(key)) { - continue; - } - - if (typeOf(obj[key]) === data[key]) { - continue; - } - - if (typeof obj[key] !== 'undefined') { - return false; - } - } - return true; -} - -/** - * Expose `isDataDescriptor` - */ - -module.exports = isDataDescriptor; diff --git a/node_modules/is-data-descriptor/package.json b/node_modules/is-data-descriptor/package.json deleted file mode 100644 index 3a0e1f4a7..000000000 --- a/node_modules/is-data-descriptor/package.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "_from": "is-data-descriptor@^0.1.4", - "_id": "is-data-descriptor@0.1.4", - "_inBundle": false, - "_integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "_location": "/is-data-descriptor", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-data-descriptor@^0.1.4", - "name": "is-data-descriptor", - "escapedName": "is-data-descriptor", - "rawSpec": "^0.1.4", - "saveSpec": null, - "fetchSpec": "^0.1.4" - }, - "_requiredBy": [ - "/is-descriptor" - ], - "_resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "_shasum": "0b5ee648388e2c860282e793f1856fec3f301b56", - "_spec": "is-data-descriptor@^0.1.4", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/is-descriptor", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-data-descriptor/issues" - }, - "bundleDependencies": false, - "dependencies": { - "kind-of": "^3.0.2" - }, - "deprecated": false, - "description": "Returns true if a value has the characteristics of a valid JavaScript data descriptor.", - "devDependencies": { - "mocha": "*", - "should": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-data-descriptor", - "keywords": [ - "accessor", - "check", - "data", - "descriptor", - "get", - "getter", - "is", - "keys", - "object", - "properties", - "property", - "set", - "setter", - "type", - "valid", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "is-data-descriptor", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-data-descriptor.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "is-accessor-descriptor", - "is-data-descriptor", - "is-descriptor", - "isobject" - ] - }, - "plugins": [ - "gulp-format-md" - ] - }, - "version": "0.1.4" -} diff --git a/node_modules/is-descriptor/LICENSE b/node_modules/is-descriptor/LICENSE deleted file mode 100644 index c0d7f1362..000000000 --- a/node_modules/is-descriptor/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2017, Jon Schlinkert. - -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. \ No newline at end of file diff --git a/node_modules/is-descriptor/README.md b/node_modules/is-descriptor/README.md deleted file mode 100644 index 658e53301..000000000 --- a/node_modules/is-descriptor/README.md +++ /dev/null @@ -1,193 +0,0 @@ -# is-descriptor [![NPM version](https://img.shields.io/npm/v/is-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-descriptor) - -> Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save is-descriptor -``` - -## Usage - -```js -var isDescriptor = require('is-descriptor'); - -isDescriptor({value: 'foo'}) -//=> true -isDescriptor({get: function(){}, set: function(){}}) -//=> true -isDescriptor({get: 'foo', set: function(){}}) -//=> false -``` - -You may also check for a descriptor by passing an object as the first argument and property name (`string`) as the second argument. - -```js -var obj = {}; -obj.foo = 'abc'; - -Object.defineProperty(obj, 'bar', { - value: 'xyz' -}); - -isDescriptor(obj, 'foo'); -//=> true -isDescriptor(obj, 'bar'); -//=> true -``` - -## Examples - -### value type - -`false` when not an object - -```js -isDescriptor('a'); -//=> false -isDescriptor(null); -//=> false -isDescriptor([]); -//=> false -``` - -### data descriptor - -`true` when the object has valid properties with valid values. - -```js -isDescriptor({value: 'foo'}); -//=> true -isDescriptor({value: noop}); -//=> true -``` - -`false` when the object has invalid properties - -```js -isDescriptor({value: 'foo', bar: 'baz'}); -//=> false -isDescriptor({value: 'foo', bar: 'baz'}); -//=> false -isDescriptor({value: 'foo', get: noop}); -//=> false -isDescriptor({get: noop, value: noop}); -//=> false -``` - -`false` when a value is not the correct type - -```js -isDescriptor({value: 'foo', enumerable: 'foo'}); -//=> false -isDescriptor({value: 'foo', configurable: 'foo'}); -//=> false -isDescriptor({value: 'foo', writable: 'foo'}); -//=> false -``` - -### accessor descriptor - -`true` when the object has valid properties with valid values. - -```js -isDescriptor({get: noop, set: noop}); -//=> true -isDescriptor({get: noop}); -//=> true -isDescriptor({set: noop}); -//=> true -``` - -`false` when the object has invalid properties - -```js -isDescriptor({get: noop, set: noop, bar: 'baz'}); -//=> false -isDescriptor({get: noop, writable: true}); -//=> false -isDescriptor({get: noop, value: true}); -//=> false -``` - -`false` when an accessor is not a function - -```js -isDescriptor({get: noop, set: 'baz'}); -//=> false -isDescriptor({get: 'foo', set: noop}); -//=> false -isDescriptor({get: 'foo', bar: 'baz'}); -//=> false -isDescriptor({get: 'foo', set: 'baz'}); -//=> false -``` - -`false` when a value is not the correct type - -```js -isDescriptor({get: noop, set: noop, enumerable: 'foo'}); -//=> false -isDescriptor({set: noop, configurable: 'foo'}); -//=> false -isDescriptor({get: noop, configurable: 'foo'}); -//=> false -``` - -## About - -### Related projects - -* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.") -* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.") -* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.") -* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 24 | [jonschlinkert](https://github.com/jonschlinkert) | -| 1 | [doowb](https://github.com/doowb) | -| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 22, 2017._ \ No newline at end of file diff --git a/node_modules/is-descriptor/index.js b/node_modules/is-descriptor/index.js deleted file mode 100644 index c9b91d762..000000000 --- a/node_modules/is-descriptor/index.js +++ /dev/null @@ -1,22 +0,0 @@ -/*! - * is-descriptor - * - * Copyright (c) 2015-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var typeOf = require('kind-of'); -var isAccessor = require('is-accessor-descriptor'); -var isData = require('is-data-descriptor'); - -module.exports = function isDescriptor(obj, key) { - if (typeOf(obj) !== 'object') { - return false; - } - if ('get' in obj) { - return isAccessor(obj, key); - } - return isData(obj, key); -}; diff --git a/node_modules/is-descriptor/node_modules/kind-of/LICENSE b/node_modules/is-descriptor/node_modules/kind-of/LICENSE deleted file mode 100644 index 3f2eca18f..000000000 --- a/node_modules/is-descriptor/node_modules/kind-of/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/is-descriptor/node_modules/kind-of/README.md b/node_modules/is-descriptor/node_modules/kind-of/README.md deleted file mode 100644 index 170bf3049..000000000 --- a/node_modules/is-descriptor/node_modules/kind-of/README.md +++ /dev/null @@ -1,342 +0,0 @@ -# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) - -> Get the native type of a value. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save kind-of -``` - -Install with [bower](https://bower.io/) - -```sh -$ bower install kind-of --save -``` - -## Why use this? - -1. [it's fast](#benchmarks) | [optimizations](#optimizations) -2. [better type checking](#better-type-checking) - -## Usage - -> es5, browser and es6 ready - -```js -var kindOf = require('kind-of'); - -kindOf(undefined); -//=> 'undefined' - -kindOf(null); -//=> 'null' - -kindOf(true); -//=> 'boolean' - -kindOf(false); -//=> 'boolean' - -kindOf(new Boolean(true)); -//=> 'boolean' - -kindOf(new Buffer('')); -//=> 'buffer' - -kindOf(42); -//=> 'number' - -kindOf(new Number(42)); -//=> 'number' - -kindOf('str'); -//=> 'string' - -kindOf(new String('str')); -//=> 'string' - -kindOf(arguments); -//=> 'arguments' - -kindOf({}); -//=> 'object' - -kindOf(Object.create(null)); -//=> 'object' - -kindOf(new Test()); -//=> 'object' - -kindOf(new Date()); -//=> 'date' - -kindOf([]); -//=> 'array' - -kindOf([1, 2, 3]); -//=> 'array' - -kindOf(new Array()); -//=> 'array' - -kindOf(/foo/); -//=> 'regexp' - -kindOf(new RegExp('foo')); -//=> 'regexp' - -kindOf(function () {}); -//=> 'function' - -kindOf(function * () {}); -//=> 'function' - -kindOf(new Function()); -//=> 'function' - -kindOf(new Map()); -//=> 'map' - -kindOf(new WeakMap()); -//=> 'weakmap' - -kindOf(new Set()); -//=> 'set' - -kindOf(new WeakSet()); -//=> 'weakset' - -kindOf(Symbol('str')); -//=> 'symbol' - -kindOf(new Int8Array()); -//=> 'int8array' - -kindOf(new Uint8Array()); -//=> 'uint8array' - -kindOf(new Uint8ClampedArray()); -//=> 'uint8clampedarray' - -kindOf(new Int16Array()); -//=> 'int16array' - -kindOf(new Uint16Array()); -//=> 'uint16array' - -kindOf(new Int32Array()); -//=> 'int32array' - -kindOf(new Uint32Array()); -//=> 'uint32array' - -kindOf(new Float32Array()); -//=> 'float32array' - -kindOf(new Float64Array()); -//=> 'float64array' -``` - -## Release history - -### v4.0.0 - -**Added** - -* `promise` support - -### v5.0.0 - -**Added** - -* `Set Iterator` and `Map Iterator` support - -**Fixed** - -* Now returns `generatorfunction` for generator functions - -## Benchmarks - -Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). -Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `WeakSet`. - -```bash -#1: array - current x 23,329,397 ops/sec ±0.82% (94 runs sampled) - lib-type-of x 4,170,273 ops/sec ±0.55% (94 runs sampled) - lib-typeof x 9,686,935 ops/sec ±0.59% (98 runs sampled) - -#2: boolean - current x 27,197,115 ops/sec ±0.85% (94 runs sampled) - lib-type-of x 3,145,791 ops/sec ±0.73% (97 runs sampled) - lib-typeof x 9,199,562 ops/sec ±0.44% (99 runs sampled) - -#3: date - current x 20,190,117 ops/sec ±0.86% (92 runs sampled) - lib-type-of x 5,166,970 ops/sec ±0.74% (94 runs sampled) - lib-typeof x 9,610,821 ops/sec ±0.50% (96 runs sampled) - -#4: function - current x 23,855,460 ops/sec ±0.60% (97 runs sampled) - lib-type-of x 5,667,740 ops/sec ±0.54% (100 runs sampled) - lib-typeof x 10,010,644 ops/sec ±0.44% (100 runs sampled) - -#5: null - current x 27,061,047 ops/sec ±0.97% (96 runs sampled) - lib-type-of x 13,965,573 ops/sec ±0.62% (97 runs sampled) - lib-typeof x 8,460,194 ops/sec ±0.61% (97 runs sampled) - -#6: number - current x 25,075,682 ops/sec ±0.53% (99 runs sampled) - lib-type-of x 2,266,405 ops/sec ±0.41% (98 runs sampled) - lib-typeof x 9,821,481 ops/sec ±0.45% (99 runs sampled) - -#7: object - current x 3,348,980 ops/sec ±0.49% (99 runs sampled) - lib-type-of x 3,245,138 ops/sec ±0.60% (94 runs sampled) - lib-typeof x 9,262,952 ops/sec ±0.59% (99 runs sampled) - -#8: regex - current x 21,284,827 ops/sec ±0.72% (96 runs sampled) - lib-type-of x 4,689,241 ops/sec ±0.43% (100 runs sampled) - lib-typeof x 8,957,593 ops/sec ±0.62% (98 runs sampled) - -#9: string - current x 25,379,234 ops/sec ±0.58% (96 runs sampled) - lib-type-of x 3,635,148 ops/sec ±0.76% (93 runs sampled) - lib-typeof x 9,494,134 ops/sec ±0.49% (98 runs sampled) - -#10: undef - current x 27,459,221 ops/sec ±1.01% (93 runs sampled) - lib-type-of x 14,360,433 ops/sec ±0.52% (99 runs sampled) - lib-typeof x 23,202,868 ops/sec ±0.59% (94 runs sampled) - -``` - -## Optimizations - -In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: - -1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. -2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. -3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` -4. There is no reason to make the code in a microlib as terse as possible, just to win points for making it shorter. It's always better to favor performant code over terse code. You will always only be using a single `require()` statement to use the library anyway, regardless of how the code is written. - -## Better type checking - -kind-of is more correct than other type checking libs I've looked at. For example, here are some differing results from other popular libs: - -### [typeof](https://github.com/CodingFu/typeof) lib - -Incorrectly tests instances of custom constructors (pretty common): - -```js -var typeOf = require('typeof'); -function Test() {} -console.log(typeOf(new Test())); -//=> 'test' -``` - -Returns `object` instead of `arguments`: - -```js -function foo() { - console.log(typeOf(arguments)) //=> 'object' -} -foo(); -``` - -### [type-of](https://github.com/ForbesLindesay/type-of) lib - -Incorrectly returns `object` for generator functions, buffers, `Map`, `Set`, `WeakMap` and `WeakSet`: - -```js -function * foo() {} -console.log(typeOf(foo)); -//=> 'object' -console.log(typeOf(new Buffer(''))); -//=> 'object' -console.log(typeOf(new Map())); -//=> 'object' -console.log(typeOf(new Set())); -//=> 'object' -console.log(typeOf(new WeakMap())); -//=> 'object' -console.log(typeOf(new WeakSet())); -//=> 'object' -``` - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    - -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") -* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") -* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 82 | [jonschlinkert](https://github.com/jonschlinkert) | -| 3 | [aretecode](https://github.com/aretecode) | -| 2 | [miguelmota](https://github.com/miguelmota) | -| 1 | [dtothefp](https://github.com/dtothefp) | -| 1 | [ksheedlo](https://github.com/ksheedlo) | -| 1 | [pdehaan](https://github.com/pdehaan) | -| 1 | [laggingreflex](https://github.com/laggingreflex) | -| 1 | [charlike](https://github.com/charlike) | - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on October 13, 2017._ \ No newline at end of file diff --git a/node_modules/is-descriptor/node_modules/kind-of/index.js b/node_modules/is-descriptor/node_modules/kind-of/index.js deleted file mode 100644 index fc5cde96e..000000000 --- a/node_modules/is-descriptor/node_modules/kind-of/index.js +++ /dev/null @@ -1,147 +0,0 @@ -var toString = Object.prototype.toString; - -/** - * Get the native `typeof` a value. - * - * @param {*} `val` - * @return {*} Native javascript type - */ - -module.exports = function kindOf(val) { - var type = typeof val; - - // primitivies - if (type === 'undefined') { - return 'undefined'; - } - if (val === null) { - return 'null'; - } - if (val === true || val === false || val instanceof Boolean) { - return 'boolean'; - } - if (type === 'string' || val instanceof String) { - return 'string'; - } - if (type === 'number' || val instanceof Number) { - return 'number'; - } - - // functions - if (type === 'function' || val instanceof Function) { - if (typeof val.constructor.name !== 'undefined' && val.constructor.name.slice(0, 9) === 'Generator') { - return 'generatorfunction'; - } - return 'function'; - } - - // array - if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { - return 'array'; - } - - // check for instances of RegExp and Date before calling `toString` - if (val instanceof RegExp) { - return 'regexp'; - } - if (val instanceof Date) { - return 'date'; - } - - // other objects - type = toString.call(val); - - if (type === '[object RegExp]') { - return 'regexp'; - } - if (type === '[object Date]') { - return 'date'; - } - if (type === '[object Arguments]') { - return 'arguments'; - } - if (type === '[object Error]') { - return 'error'; - } - if (type === '[object Promise]') { - return 'promise'; - } - - // buffer - if (isBuffer(val)) { - return 'buffer'; - } - - // es6: Map, WeakMap, Set, WeakSet - if (type === '[object Set]') { - return 'set'; - } - if (type === '[object WeakSet]') { - return 'weakset'; - } - if (type === '[object Map]') { - return 'map'; - } - if (type === '[object WeakMap]') { - return 'weakmap'; - } - if (type === '[object Symbol]') { - return 'symbol'; - } - - if (type === '[object Map Iterator]') { - return 'mapiterator'; - } - if (type === '[object Set Iterator]') { - return 'setiterator'; - } - if (type === '[object String Iterator]') { - return 'stringiterator'; - } - if (type === '[object Array Iterator]') { - return 'arrayiterator'; - } - - // typed arrays - if (type === '[object Int8Array]') { - return 'int8array'; - } - if (type === '[object Uint8Array]') { - return 'uint8array'; - } - if (type === '[object Uint8ClampedArray]') { - return 'uint8clampedarray'; - } - if (type === '[object Int16Array]') { - return 'int16array'; - } - if (type === '[object Uint16Array]') { - return 'uint16array'; - } - if (type === '[object Int32Array]') { - return 'int32array'; - } - if (type === '[object Uint32Array]') { - return 'uint32array'; - } - if (type === '[object Float32Array]') { - return 'float32array'; - } - if (type === '[object Float64Array]') { - return 'float64array'; - } - - // must be a plain object - return 'object'; -}; - -/** - * If you need to support Safari 5-7 (8-10 yr-old browser), - * take a look at https://github.com/feross/is-buffer - */ - -function isBuffer(val) { - return val.constructor - && typeof val.constructor.isBuffer === 'function' - && val.constructor.isBuffer(val); -} diff --git a/node_modules/is-descriptor/node_modules/kind-of/package.json b/node_modules/is-descriptor/node_modules/kind-of/package.json deleted file mode 100644 index 20708754a..000000000 --- a/node_modules/is-descriptor/node_modules/kind-of/package.json +++ /dev/null @@ -1,146 +0,0 @@ -{ - "_from": "kind-of@^5.0.0", - "_id": "kind-of@5.1.0", - "_inBundle": false, - "_integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "_location": "/is-descriptor/kind-of", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "kind-of@^5.0.0", - "name": "kind-of", - "escapedName": "kind-of", - "rawSpec": "^5.0.0", - "saveSpec": null, - "fetchSpec": "^5.0.0" - }, - "_requiredBy": [ - "/is-descriptor" - ], - "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "_shasum": "729c91e2d857b7a419a1f9aa65685c4c33f5845d", - "_spec": "kind-of@^5.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/is-descriptor", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/kind-of/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "David Fox-Powell", - "url": "https://dtothefp.github.io/me" - }, - { - "name": "James", - "url": "https://twitter.com/aretecode" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Ken Sheedlo", - "url": "kensheedlo.com" - }, - { - "name": "laggingreflex", - "url": "https://github.com/laggingreflex" - }, - { - "name": "Miguel Mota", - "url": "https://miguelmota.com" - }, - { - "name": "Peter deHaan", - "url": "http://about.me/peterdehaan" - }, - { - "name": "tunnckoCore", - "url": "https://i.am.charlike.online" - } - ], - "deprecated": false, - "description": "Get the native type of a value.", - "devDependencies": { - "ansi-bold": "^0.1.1", - "benchmarked": "^1.1.1", - "browserify": "^14.4.0", - "gulp-format-md": "^0.1.12", - "matched": "^0.4.4", - "mocha": "^3.4.2", - "type-of": "^2.0.1", - "typeof": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/kind-of", - "keywords": [ - "arguments", - "array", - "boolean", - "check", - "date", - "function", - "is", - "is-type", - "is-type-of", - "kind", - "kind-of", - "number", - "object", - "of", - "regexp", - "string", - "test", - "type", - "type-of", - "typeof", - "types" - ], - "license": "MIT", - "main": "index.js", - "name": "kind-of", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/kind-of.git" - }, - "scripts": { - "prepublish": "browserify -o browser.js -e index.js -s index --bare", - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "is-glob", - "is-number", - "is-primitive" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "type-of", - "typeof", - "verb" - ] - }, - "version": "5.1.0" -} diff --git a/node_modules/is-descriptor/package.json b/node_modules/is-descriptor/package.json deleted file mode 100644 index 70d28f9d3..000000000 --- a/node_modules/is-descriptor/package.json +++ /dev/null @@ -1,117 +0,0 @@ -{ - "_from": "is-descriptor@^0.1.0", - "_id": "is-descriptor@0.1.6", - "_inBundle": false, - "_integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "_location": "/is-descriptor", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-descriptor@^0.1.0", - "name": "is-descriptor", - "escapedName": "is-descriptor", - "rawSpec": "^0.1.0", - "saveSpec": null, - "fetchSpec": "^0.1.0" - }, - "_requiredBy": [ - "/class-utils/define-property", - "/object-copy/define-property", - "/snapdragon/define-property", - "/static-extend/define-property" - ], - "_resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "_shasum": "366d8240dde487ca51823b1ab9f07a10a78251ca", - "_spec": "is-descriptor@^0.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/class-utils/node_modules/define-property", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-descriptor/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Brian Woodward", - "url": "https://twitter.com/doowb" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "url": "https://github.com/wtgtybhertgeghgtwtg" - } - ], - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "deprecated": false, - "description": "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.", - "devDependencies": { - "gulp-format-md": "^1.0.0", - "mocha": "^3.4.2" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-descriptor", - "keywords": [ - "accessor", - "check", - "data", - "descriptor", - "get", - "getter", - "is", - "keys", - "object", - "properties", - "property", - "set", - "setter", - "type", - "valid", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "is-descriptor", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-descriptor.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "is-accessor-descriptor", - "is-data-descriptor", - "is-descriptor", - "isobject" - ] - }, - "plugins": [ - "gulp-format-md" - ], - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "lint": { - "reflinks": true - } - }, - "version": "0.1.6" -} diff --git a/node_modules/is-dotfile/LICENSE b/node_modules/is-dotfile/LICENSE deleted file mode 100644 index 83b56e709..000000000 --- a/node_modules/is-dotfile/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/is-dotfile/README.md b/node_modules/is-dotfile/README.md deleted file mode 100644 index d69912bb1..000000000 --- a/node_modules/is-dotfile/README.md +++ /dev/null @@ -1,95 +0,0 @@ -# is-dotfile [![NPM version](https://img.shields.io/npm/v/is-dotfile.svg?style=flat)](https://www.npmjs.com/package/is-dotfile) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-dotfile.svg?style=flat)](https://npmjs.org/package/is-dotfile) [![NPM total downloads](https://img.shields.io/npm/dt/is-dotfile.svg?style=flat)](https://npmjs.org/package/is-dotfile) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-dotfile.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-dotfile) - -> Return true if a file path is (or has) a dotfile. Returns false if the path is a dot directory. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save is-dotfile -``` - -## Usage - -To be considered a dotfile, it must be the last filename in the path, like `.gitignore`. Otherwise it's a [dot directory](https://github.com/jonschlinkert/is-dotdir), like `.git/` and `.github/`. - -```js -var isDotfile = require('is-dotfile'); -``` - -**false** - -All of the following return `false`: - -```js -isDotfile('a/b/c.js'); -isDotfile('/.git/foo'); -isDotfile('a/b/c/.git/foo'); -//=> false -``` - -**true** - -All of the following return `true`: - -```js -isDotfile('a/b/.gitignore'); -isDotfile('.gitignore'); -isDotfile('/.gitignore'); -//=> true -``` - -## About - -### Related projects - -* [dotdir-regex](https://www.npmjs.com/package/dotdir-regex): Regex for matching dot-directories, like `.git/` | [homepage](https://github.com/regexps/dotdir-regex "Regex for matching dot-directories, like `.git/`") -* [dotfile-regex](https://www.npmjs.com/package/dotfile-regex): Regular expresson for matching dotfiles. | [homepage](https://github.com/regexps/dotfile-regex "Regular expresson for matching dotfiles.") -* [is-dotdir](https://www.npmjs.com/package/is-dotdir): Returns true if a path is a dot-directory. | [homepage](https://github.com/jonschlinkert/is-dotdir "Returns true if a path is a dot-directory.") -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 13 | [jonschlinkert](https://github.com/jonschlinkert) | -| 1 | [Lykathia](https://github.com/Lykathia) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 30, 2017._ \ No newline at end of file diff --git a/node_modules/is-dotfile/index.js b/node_modules/is-dotfile/index.js deleted file mode 100644 index 46cb20b14..000000000 --- a/node_modules/is-dotfile/index.js +++ /dev/null @@ -1,14 +0,0 @@ -/*! - * is-dotfile - * - * Copyright (c) 2015-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -module.exports = function(str) { - if (str.charCodeAt(0) === 46 /* . */ && str.indexOf('/', 1) === -1) { - return true; - } - var slash = str.lastIndexOf('/'); - return slash !== -1 ? str.charCodeAt(slash + 1) === 46 /* . */ : false; -}; diff --git a/node_modules/is-dotfile/package.json b/node_modules/is-dotfile/package.json deleted file mode 100644 index 18ef11107..000000000 --- a/node_modules/is-dotfile/package.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "_from": "is-dotfile@^1.0.0", - "_id": "is-dotfile@1.0.3", - "_inBundle": false, - "_integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", - "_location": "/is-dotfile", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-dotfile@^1.0.0", - "name": "is-dotfile", - "escapedName": "is-dotfile", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/parse-glob" - ], - "_resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "_shasum": "a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1", - "_spec": "is-dotfile@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/parse-glob", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-dotfile/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Evan Lowry", - "url": "http://exitiumonline.com" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - } - ], - "deprecated": false, - "description": "Return true if a file path is (or has) a dotfile. Returns false if the path is a dot directory.", - "devDependencies": { - "benchmarked": "^0.1.3", - "dotfile-regex": "^0.1.2", - "gulp-format-md": "^0.1.12", - "mocha": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-dotfile", - "keywords": [ - "detect", - "dot", - "dotfile", - "expression", - "file", - "filepath", - "find", - "fs", - "is", - "match", - "path", - "regex", - "regexp", - "regular" - ], - "license": "MIT", - "main": "index.js", - "name": "is-dotfile", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-dotfile.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "dotdir-regex", - "dotfile-regex", - "is-dotdir", - "is-glob" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - } - }, - "version": "1.0.3" -} diff --git a/node_modules/is-electron/LICENSE b/node_modules/is-electron/LICENSE deleted file mode 100644 index a1666f156..000000000 --- a/node_modules/is-electron/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Cheton Wu - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/is-electron/README.md b/node_modules/is-electron/README.md deleted file mode 100644 index fec2cd15b..000000000 --- a/node_modules/is-electron/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# is-electron [![build status](https://travis-ci.org/cheton/is-electron.svg?branch=master)](https://travis-ci.org/cheton/is-electron) [![Coverage Status](https://coveralls.io/repos/github/cheton/is-electron/badge.svg?branch=master)](https://coveralls.io/github/cheton/is-electron?branch=master) - -[![NPM](https://nodei.co/npm/is-electron.png?downloads=true&stars=true)](https://www.npmjs.com/package/is-electron) - -Detect if running in Electron. - -## Installation - -```bash -npm install --save is-electron -``` - -## Usage - -```js -import isElectron from 'is-electron'; - -console.log(isElectron()); -``` - -## License - -Copyright (c) 2016 Cheton Wu - -Licensed under the [MIT License](LICENSE). diff --git a/node_modules/is-electron/index.js b/node_modules/is-electron/index.js deleted file mode 100644 index a5c65da87..000000000 --- a/node_modules/is-electron/index.js +++ /dev/null @@ -1,21 +0,0 @@ -// https://github.com/electron/electron/issues/2288 -function isElectron() { - // Renderer process - if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') { - return true; - } - - // Main process - if (typeof process !== 'undefined' && typeof process.versions === 'object' && !!process.versions.electron) { - return true; - } - - // Detect the user agent when the `nodeIntegration` option is set to true - if (typeof navigator === 'object' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Electron') >= 0) { - return true; - } - - return false; -} - -module.exports = isElectron; diff --git a/node_modules/is-electron/package.json b/node_modules/is-electron/package.json deleted file mode 100644 index d9581181e..000000000 --- a/node_modules/is-electron/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "_from": "is-electron@^2.0.0", - "_id": "is-electron@2.1.0", - "_inBundle": false, - "_integrity": "sha512-dkg5xT383+M6zIbbXW/z7n2nz4SFUi2OSyhntnFYkRdtV+HVEfdjEK+5AWisfYgkpe3WYjTIuh7toaKmSfFVWw==", - "_location": "/is-electron", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-electron@^2.0.0", - "name": "is-electron", - "escapedName": "is-electron", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/bel" - ], - "_resolved": "https://registry.npmjs.org/is-electron/-/is-electron-2.1.0.tgz", - "_shasum": "37dd2e9e7167efa8bafce86c0c25762bc4b851fa", - "_spec": "is-electron@^2.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/bel", - "author": { - "name": "Cheton Wu", - "email": "cheton@gmail.com" - }, - "bugs": { - "url": "https://github.com/cheton/is-electron/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Detect if running in Electron.", - "devDependencies": { - "coveralls": "^2.11.9", - "tap": "^5.7.2" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/cheton/is-electron", - "keywords": [ - "atom", - "electron", - "renderer", - "process" - ], - "license": "MIT", - "main": "index.js", - "name": "is-electron", - "nyc": { - "exclude": [] - }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/cheton/is-electron.git" - }, - "scripts": { - "coveralls": "tap --coverage --coverage-report=text-lcov test/*.js | node_modules/.bin/coveralls", - "test": "tap --coverage test/*.js" - }, - "version": "2.1.0" -} diff --git a/node_modules/is-equal-shallow/LICENSE b/node_modules/is-equal-shallow/LICENSE deleted file mode 100644 index 65f90aca8..000000000 --- a/node_modules/is-equal-shallow/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/is-equal-shallow/README.md b/node_modules/is-equal-shallow/README.md deleted file mode 100644 index 11422761f..000000000 --- a/node_modules/is-equal-shallow/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# is-equal-shallow [![NPM version](https://badge.fury.io/js/is-equal-shallow.svg)](http://badge.fury.io/js/is-equal-shallow) [![Build Status](https://travis-ci.org/jonschlinkert/is-equal-shallow.svg)](https://travis-ci.org/jonschlinkert/is-equal-shallow) - -> Does a shallow comparison of two objects, returning false if the keys or values differ. - -The purpose of this lib is to do the fastest comparison possible of two objects when the values will predictably be primitives. - -* only compares objects. -* only compares the first level of each object -* values must be primitives. If a value is not a primitive, even if the values are the same, `false` is returned. - -Install with [npm](https://www.npmjs.com/) - -```sh -$ npm i is-equal-shallow --save -``` - -## Usage - -```js -var equals = require('is-equal-shallow'); -equals(object_a, object_b); -``` - -**Examples** - -```js -equals({a: true, b: true}, {a: true, b: true}); -//=> 'true' - -equals({a: true, b: false}, {c: false, b: false}); -//=> 'false' - -equals({a: true, b: false}, {a: false, b: false}); -//=> 'false' -``` - -Strict comparison for equality: - -```js -equals({a: true, b: true}, {a: true, b: 'true'}); -//=> 'false' -``` - -When values are not primitives, `false` is always returned: - -```js -equals({ b: {}}, { b: {}}); -//=> 'false' - -equals({ b: []}, { b: []}); -//=> 'false' -``` - -## Related projects - -Other object utils: - -* [clone-deep](https://github.com/jonschlinkert/clone-deep): Recursively (deep) clone JavaScript native types, like Object, Array, RegExp, Date as well as primitives. -* [for-in](https://github.com/jonschlinkert/for-in): Iterate over the own and inherited enumerable properties of an objecte, and return an object… [more](https://github.com/jonschlinkert/for-in) -* [for-own](https://github.com/jonschlinkert/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) -* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor. -* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null. - -## Running tests - -Install dev dependencies: - -```sh -$ npm i -d && npm test -``` - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-equal-shallow/issues/new) - -## Author - -**Jon Schlinkert** - -+ [github/jonschlinkert](https://github.com/jonschlinkert) -+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2015 Jon Schlinkert -Released under the MIT license. - -*** - -_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 22, 2015._ \ No newline at end of file diff --git a/node_modules/is-equal-shallow/index.js b/node_modules/is-equal-shallow/index.js deleted file mode 100644 index 1006eef10..000000000 --- a/node_modules/is-equal-shallow/index.js +++ /dev/null @@ -1,27 +0,0 @@ -/*! - * is-equal-shallow - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var isPrimitive = require('is-primitive'); - -module.exports = function isEqual(a, b) { - if (!a && !b) { return true; } - if (!a && b || a && !b) { return false; } - - var numKeysA = 0, numKeysB = 0, key; - for (key in b) { - numKeysB++; - if (!isPrimitive(b[key]) || !a.hasOwnProperty(key) || (a[key] !== b[key])) { - return false; - } - } - for (key in a) { - numKeysA++; - } - return numKeysA === numKeysB; -}; diff --git a/node_modules/is-equal-shallow/package.json b/node_modules/is-equal-shallow/package.json deleted file mode 100644 index 70b8bf97b..000000000 --- a/node_modules/is-equal-shallow/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "_from": "is-equal-shallow@^0.1.3", - "_id": "is-equal-shallow@0.1.3", - "_inBundle": false, - "_integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", - "_location": "/is-equal-shallow", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-equal-shallow@^0.1.3", - "name": "is-equal-shallow", - "escapedName": "is-equal-shallow", - "rawSpec": "^0.1.3", - "saveSpec": null, - "fetchSpec": "^0.1.3" - }, - "_requiredBy": [ - "/regex-cache" - ], - "_resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "_shasum": "2238098fc221de0bcfa5d9eac4c45d638aa1c534", - "_spec": "is-equal-shallow@^0.1.3", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/regex-cache", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-equal-shallow/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-primitive": "^2.0.0" - }, - "deprecated": false, - "description": "Does a shallow comparison of two objects, returning false if the keys or values differ.", - "devDependencies": { - "mocha": "*", - "should": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-equal-shallow", - "keywords": [ - "compare", - "comparison", - "equal", - "equals", - "is", - "is-equal", - "key", - "object", - "same", - "shallow", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "is-equal-shallow", - "repository": { - "type": "git", - "url": "git://github.com/jonschlinkert/is-equal-shallow.git" - }, - "scripts": { - "test": "mocha" - }, - "verbiage": { - "related": { - "description": "Other object utils:", - "list": [ - "is-plain-object", - "isobject", - "for-in", - "for-own", - "clone-deep" - ] - } - }, - "version": "0.1.3" -} diff --git a/node_modules/is-extendable/LICENSE b/node_modules/is-extendable/LICENSE deleted file mode 100644 index 65f90aca8..000000000 --- a/node_modules/is-extendable/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/is-extendable/README.md b/node_modules/is-extendable/README.md deleted file mode 100644 index e4cfaebcb..000000000 --- a/node_modules/is-extendable/README.md +++ /dev/null @@ -1,72 +0,0 @@ -# is-extendable [![NPM version](https://badge.fury.io/js/is-extendable.svg)](http://badge.fury.io/js/is-extendable) - -> Returns true if a value is any of the object types: array, regexp, plain object, function or date. This is useful for determining if a value can be extended, e.g. "can the value have keys?" - -## Install - -Install with [npm](https://www.npmjs.com/) - -```sh -$ npm i is-extendable --save -``` - -## Usage - -```js -var isExtendable = require('is-extendable'); -``` - -Returns true if the value is any of the following: - -* `array` -* `regexp` -* `plain object` -* `function` -* `date` -* `error` - -## Notes - -All objects in JavaScript can have keys, but it's a pain to check for this, since we ether need to verify that the value is not `null` or `undefined` and: - -* the value is not a primitive, or -* that the object is an `object`, `function` - -Also note that an `extendable` object is not the same as an [extensible object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible), which is one that (in es6) is not sealed, frozen, or marked as non-extensible using `preventExtensions`. - -## Related projects - -* [assign-deep](https://github.com/jonschlinkert/assign-deep): Deeply assign the enumerable properties of source objects to a destination object. -* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. -* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null. -* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor. -* [is-equal-shallow](https://github.com/jonschlinkert/is-equal-shallow): Does a shallow comparison of two objects, returning false if the keys or values differ. -* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value. - -## Running tests - -Install dev dependencies: - -```sh -$ npm i -d && npm test -``` - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-extendable/issues/new) - -## Author - -**Jon Schlinkert** - -+ [github/jonschlinkert](https://github.com/jonschlinkert) -+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2015 Jon Schlinkert -Released under the MIT license. - -*** - -_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 04, 2015._ \ No newline at end of file diff --git a/node_modules/is-extendable/index.js b/node_modules/is-extendable/index.js deleted file mode 100644 index 4ee71a44a..000000000 --- a/node_modules/is-extendable/index.js +++ /dev/null @@ -1,13 +0,0 @@ -/*! - * is-extendable - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -module.exports = function isExtendable(val) { - return typeof val !== 'undefined' && val !== null - && (typeof val === 'object' || typeof val === 'function'); -}; diff --git a/node_modules/is-extendable/package.json b/node_modules/is-extendable/package.json deleted file mode 100644 index db8ff7f6a..000000000 --- a/node_modules/is-extendable/package.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "_from": "is-extendable@^0.1.1", - "_id": "is-extendable@0.1.1", - "_inBundle": false, - "_integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "_location": "/is-extendable", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-extendable@^0.1.1", - "name": "is-extendable", - "escapedName": "is-extendable", - "rawSpec": "^0.1.1", - "saveSpec": null, - "fetchSpec": "^0.1.1" - }, - "_requiredBy": [ - "/object.omit", - "/readdirp/braces/extend-shallow", - "/readdirp/expand-brackets/extend-shallow", - "/readdirp/extglob/extend-shallow", - "/readdirp/fill-range/extend-shallow", - "/set-value", - "/set-value/extend-shallow", - "/snapdragon/extend-shallow", - "/union-value", - "/union-value/extend-shallow", - "/union-value/set-value" - ], - "_resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "_shasum": "62b110e289a471418e3ec36a617d472e301dfc89", - "_spec": "is-extendable@^0.1.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/object.omit", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-extendable/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Returns true if a value is any of the object types: array, regexp, plain object, function or date. This is useful for determining if a value can be extended, e.g. \"can the value have keys?\"", - "devDependencies": { - "mocha": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-extendable", - "keywords": [ - "array", - "assign", - "check", - "date", - "extend", - "extensible", - "function", - "is", - "object", - "regex", - "test" - ], - "license": "MIT", - "main": "index.js", - "name": "is-extendable", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-extendable.git" - }, - "scripts": { - "test": "mocha" - }, - "verbiage": { - "related": { - "list": [ - "isobject", - "is-plain-object", - "kind-of", - "is-extendable", - "is-equal-shallow", - "extend-shallow", - "assign-deep" - ] - } - }, - "version": "0.1.1" -} diff --git a/node_modules/is-extglob/LICENSE b/node_modules/is-extglob/LICENSE deleted file mode 100644 index fa30c4cb3..000000000 --- a/node_modules/is-extglob/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/is-extglob/README.md b/node_modules/is-extglob/README.md deleted file mode 100644 index 80e7128d6..000000000 --- a/node_modules/is-extglob/README.md +++ /dev/null @@ -1,75 +0,0 @@ -# is-extglob [![NPM version](https://badge.fury.io/js/is-extglob.svg)](http://badge.fury.io/js/is-extglob) [![Build Status](https://travis-ci.org/jonschlinkert/is-extglob.svg)](https://travis-ci.org/jonschlinkert/is-extglob) - -> Returns true if a string has an extglob. - -## Install with [npm](npmjs.org) - -```bash -npm i is-extglob --save -``` - -## Usage - -```js -var isExtglob = require('is-extglob'); -``` - -**True** - -```js -isExtglob('?(abc)'); -isExtglob('@(abc)'); -isExtglob('!(abc)'); -isExtglob('*(abc)'); -isExtglob('+(abc)'); -``` - -**False** - -Everything else... - -```js -isExtglob('foo.js'); -isExtglob('!foo.js'); -isExtglob('*.js'); -isExtglob('**/abc.js'); -isExtglob('abc/*.js'); -isExtglob('abc/(aaa|bbb).js'); -isExtglob('abc/[a-z].js'); -isExtglob('abc/{a,b}.js'); -isExtglob('abc/?.js'); -isExtglob('abc.js'); -isExtglob('abc/def/ghi.js'); -``` - -## Related -* [extglob](https://github.com/jonschlinkert/extglob): Extended globs. extglobs add the expressive power of regular expressions to glob patterns. -* [micromatch](https://github.com/jonschlinkert/micromatch): Glob matching for javascript/node.js. A faster alternative to minimatch (10-45x faster on avg), with all the features you're used to using in your Grunt and gulp tasks. -* [parse-glob](https://github.com/jonschlinkert/parse-glob): Parse a glob pattern into an object of tokens. - -## Run tests -Install dev dependencies. - -```bash -npm i -d && npm test -``` - - -## Contributing -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-extglob/issues) - - -## Author - -**Jon Schlinkert** - -+ [github/jonschlinkert](https://github.com/jonschlinkert) -+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License -Copyright (c) 2015 Jon Schlinkert -Released under the MIT license - -*** - -_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 06, 2015._ \ No newline at end of file diff --git a/node_modules/is-extglob/index.js b/node_modules/is-extglob/index.js deleted file mode 100644 index 803047f74..000000000 --- a/node_modules/is-extglob/index.js +++ /dev/null @@ -1,11 +0,0 @@ -/*! - * is-extglob - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -module.exports = function isExtglob(str) { - return typeof str === 'string' - && /[@?!+*]\(/.test(str); -}; diff --git a/node_modules/is-extglob/package.json b/node_modules/is-extglob/package.json deleted file mode 100644 index d060bee78..000000000 --- a/node_modules/is-extglob/package.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "_from": "is-extglob@^1.0.0", - "_id": "is-extglob@1.0.0", - "_inBundle": false, - "_integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "_location": "/is-extglob", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-extglob@^1.0.0", - "name": "is-extglob", - "escapedName": "is-extglob", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/extglob", - "/is-glob", - "/micromatch", - "/parse-glob" - ], - "_resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "_shasum": "ac468177c4943405a092fc8f29760c6ffc6206c0", - "_spec": "is-extglob@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/micromatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-extglob/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Returns true if a string has an extglob.", - "devDependencies": { - "mocha": "*", - "should": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-extglob", - "keywords": [ - "bash", - "braces", - "check", - "exec", - "extglob", - "expression", - "glob", - "globbing", - "globstar", - "match", - "matches", - "pattern", - "regex", - "regular", - "string", - "test" - ], - "license": "MIT", - "main": "index.js", - "name": "is-extglob", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-extglob.git" - }, - "scripts": { - "prepublish": "browserify -o browser.js -e index.js", - "test": "mocha" - }, - "version": "1.0.0" -} diff --git a/node_modules/is-finite/index.js b/node_modules/is-finite/index.js deleted file mode 100644 index 806738750..000000000 --- a/node_modules/is-finite/index.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; -var numberIsNan = require('number-is-nan'); - -module.exports = Number.isFinite || function (val) { - return !(typeof val !== 'number' || numberIsNan(val) || val === Infinity || val === -Infinity); -}; diff --git a/node_modules/is-finite/license b/node_modules/is-finite/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/is-finite/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/is-finite/package.json b/node_modules/is-finite/package.json deleted file mode 100644 index 9cc6eef8d..000000000 --- a/node_modules/is-finite/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_from": "is-finite@^1.0.1", - "_id": "is-finite@1.0.2", - "_inBundle": false, - "_integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "_location": "/is-finite", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-finite@^1.0.1", - "name": "is-finite", - "escapedName": "is-finite", - "rawSpec": "^1.0.1", - "saveSpec": null, - "fetchSpec": "^1.0.1" - }, - "_requiredBy": [ - "/pretty-ms" - ], - "_resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "_shasum": "cc6677695602be550ef11e8b4aa6305342b6d0aa", - "_spec": "is-finite@^1.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/pretty-ms", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/is-finite/issues" - }, - "bundleDependencies": false, - "dependencies": { - "number-is-nan": "^1.0.0" - }, - "deprecated": false, - "description": "ES2015 Number.isFinite() ponyfill", - "devDependencies": { - "ava": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/is-finite#readme", - "keywords": [ - "es2015", - "ponyfill", - "polyfill", - "shim", - "number", - "finite", - "is" - ], - "license": "MIT", - "name": "is-finite", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is-finite.git" - }, - "scripts": { - "test": "ava" - }, - "version": "1.0.2" -} diff --git a/node_modules/is-finite/readme.md b/node_modules/is-finite/readme.md deleted file mode 100644 index 567710ca2..000000000 --- a/node_modules/is-finite/readme.md +++ /dev/null @@ -1,28 +0,0 @@ -# is-finite [![Build Status](https://travis-ci.org/sindresorhus/is-finite.svg?branch=master)](https://travis-ci.org/sindresorhus/is-finite) - -> ES2015 [`Number.isFinite()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite) [ponyfill](https://ponyfill.com) - - -## Install - -```sh -$ npm install --save is-finite -``` - - -## Usage - -```js -var numIsFinite = require('is-finite'); - -numIsFinite(4); -//=> true - -numIsFinite(Infinity); -//=> false -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/is-glob/LICENSE b/node_modules/is-glob/LICENSE deleted file mode 100644 index fa30c4cb3..000000000 --- a/node_modules/is-glob/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/is-glob/README.md b/node_modules/is-glob/README.md deleted file mode 100644 index b16254293..000000000 --- a/node_modules/is-glob/README.md +++ /dev/null @@ -1,105 +0,0 @@ -# is-glob [![NPM version](https://badge.fury.io/js/is-glob.svg)](http://badge.fury.io/js/is-glob) [![Build Status](https://travis-ci.org/jonschlinkert/is-glob.svg)](https://travis-ci.org/jonschlinkert/is-glob) - -> Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience. - -Also take a look at [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob). - -## Install - -Install with [npm](https://www.npmjs.com/) - -```sh -$ npm i is-glob --save -``` - -## Usage - -```js -var isGlob = require('is-glob'); -``` - -**True** - -Patterns that have glob characters or regex patterns will return `true`: - -```js -isGlob('!foo.js'); -isGlob('*.js'); -isGlob('**/abc.js'); -isGlob('abc/*.js'); -isGlob('abc/(aaa|bbb).js'); -isGlob('abc/[a-z].js'); -isGlob('abc/{a,b}.js'); -isGlob('abc/?.js'); -//=> true -``` - -Extglobs - -```js -isGlob('abc/@(a).js'); -isGlob('abc/!(a).js'); -isGlob('abc/+(a).js'); -isGlob('abc/*(a).js'); -isGlob('abc/?(a).js'); -//=> true -``` - -**False** - -Patterns that do not have glob patterns return `false`: - -```js -isGlob('abc.js'); -isGlob('abc/def/ghi.js'); -isGlob('foo.js'); -isGlob('abc/@.js'); -isGlob('abc/+.js'); -isGlob(); -isGlob(null); -//=> false -``` - -Arrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)): - -```js -isGlob(['**/*.js']); -isGlob(['foo.js']); -//=> false -``` - -## Related - -* [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob) -* [is-extglob](https://www.npmjs.com/package/is-extglob): Returns true if a string has an extglob. | [homepage](https://github.com/jonschlinkert/is-extglob) -* [is-posix-bracket](https://www.npmjs.com/package/is-posix-bracket): Returns true if the given string is a POSIX bracket expression (POSIX character class). | [homepage](https://github.com/jonschlinkert/is-posix-bracket) -* [is-valid-glob](https://www.npmjs.com/package/is-valid-glob): Return true if a value is a valid glob pattern or patterns. | [homepage](https://github.com/jonschlinkert/is-valid-glob) -* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just… [more](https://www.npmjs.com/package/micromatch) | [homepage](https://github.com/jonschlinkert/micromatch) - -## Run tests - -Install dev dependencies: - -```sh -$ npm i -d && npm test -``` - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-glob/issues/new). - -## Author - -**Jon Schlinkert** - -+ [github/jonschlinkert](https://github.com/jonschlinkert) -+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2015 Jon Schlinkert -Released under the MIT license. - -*** - -_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 02, 2015._ \ No newline at end of file diff --git a/node_modules/is-glob/index.js b/node_modules/is-glob/index.js deleted file mode 100644 index ef27bba4f..000000000 --- a/node_modules/is-glob/index.js +++ /dev/null @@ -1,14 +0,0 @@ -/*! - * is-glob - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -var isExtglob = require('is-extglob'); - -module.exports = function isGlob(str) { - return typeof str === 'string' - && (/[*!?{}(|)[\]]/.test(str) - || isExtglob(str)); -}; \ No newline at end of file diff --git a/node_modules/is-glob/package.json b/node_modules/is-glob/package.json deleted file mode 100644 index ea357ad6d..000000000 --- a/node_modules/is-glob/package.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "_from": "is-glob@^2.0.0", - "_id": "is-glob@2.0.1", - "_inBundle": false, - "_integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "_location": "/is-glob", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-glob@^2.0.0", - "name": "is-glob", - "escapedName": "is-glob", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/chokidar", - "/glob-base", - "/glob-parent", - "/micromatch", - "/parse-glob" - ], - "_resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "_shasum": "d096f926a3ded5600f3fdfd91198cb0888c2d863", - "_spec": "is-glob@^2.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/chokidar", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-glob/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-extglob": "^1.0.0" - }, - "deprecated": false, - "description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.", - "devDependencies": { - "mocha": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-glob", - "keywords": [ - "bash", - "braces", - "check", - "exec", - "extglob", - "expression", - "glob", - "globbing", - "globstar", - "match", - "matches", - "pattern", - "regex", - "regular", - "string", - "test" - ], - "license": "MIT", - "main": "index.js", - "name": "is-glob", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-glob.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "has-glob", - "is-extglob", - "is-posix-bracket", - "is-valid-glob", - "micromatch" - ] - } - }, - "version": "2.0.1" -} diff --git a/node_modules/is-number/LICENSE b/node_modules/is-number/LICENSE deleted file mode 100644 index fa30c4cb3..000000000 --- a/node_modules/is-number/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/is-number/README.md b/node_modules/is-number/README.md deleted file mode 100644 index 8395f9131..000000000 --- a/node_modules/is-number/README.md +++ /dev/null @@ -1,103 +0,0 @@ -# is-number [![NPM version](https://badge.fury.io/js/is-number.svg)](http://badge.fury.io/js/is-number) [![Build Status](https://travis-ci.org/jonschlinkert/is-number.svg)](https://travis-ci.org/jonschlinkert/is-number) - -> Returns true if the value is a number. comprehensive tests. - -To understand some of the rationale behind the decisions made in this library (and to learn about some oddities of number evaluation in JavaScript), [see this gist](https://gist.github.com/jonschlinkert/e30c70c713da325d0e81). - -## Install - -Install with [npm](https://www.npmjs.com/) - -```sh -$ npm i is-number --save -``` - -## Usage - -```js -var isNumber = require('is-number'); -``` - -### true - -See the [tests](./test.js) for more examples. - -```js -isNumber(5e3) //=> 'true' -isNumber(0xff) //=> 'true' -isNumber(-1.1) //=> 'true' -isNumber(0) //=> 'true' -isNumber(1) //=> 'true' -isNumber(1.1) //=> 'true' -isNumber(10) //=> 'true' -isNumber(10.10) //=> 'true' -isNumber(100) //=> 'true' -isNumber('-1.1') //=> 'true' -isNumber('0') //=> 'true' -isNumber('012') //=> 'true' -isNumber('0xff') //=> 'true' -isNumber('1') //=> 'true' -isNumber('1.1') //=> 'true' -isNumber('10') //=> 'true' -isNumber('10.10') //=> 'true' -isNumber('100') //=> 'true' -isNumber('5e3') //=> 'true' -isNumber(parseInt('012')) //=> 'true' -isNumber(parseFloat('012')) //=> 'true' -``` - -### False - -See the [tests](./test.js) for more examples. - -```js -isNumber('foo') //=> 'false' -isNumber([1]) //=> 'false' -isNumber([]) //=> 'false' -isNumber(function () {}) //=> 'false' -isNumber(Infinity) //=> 'false' -isNumber(NaN) //=> 'false' -isNumber(new Array('abc')) //=> 'false' -isNumber(new Array(2)) //=> 'false' -isNumber(new Buffer('abc')) //=> 'false' -isNumber(null) //=> 'false' -isNumber(undefined) //=> 'false' -isNumber({abc: 'abc'}) //=> 'false' -``` - -## Other projects - -* [even](https://www.npmjs.com/package/even): Get the even numbered items from an array. | [homepage](https://github.com/jonschlinkert/even) -* [is-even](https://www.npmjs.com/package/is-even): Return true if the given number is even. | [homepage](https://github.com/jonschlinkert/is-even) -* [is-odd](https://www.npmjs.com/package/is-odd): Returns true if the given number is odd. | [homepage](https://github.com/jonschlinkert/is-odd) -* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive) -* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of) -* [odd](https://www.npmjs.com/package/odd): Get the odd numbered items from an array. | [homepage](https://github.com/jonschlinkert/odd) - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-number/issues/new). - -## Run tests - -Install dev dependencies: - -```sh -$ npm i -d && npm test -``` - -## Author - -**Jon Schlinkert** - -+ [github/jonschlinkert](https://github.com/jonschlinkert) -+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2015 Jon Schlinkert -Released under the MIT license. - -*** - -_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on November 22, 2015._ \ No newline at end of file diff --git a/node_modules/is-number/index.js b/node_modules/is-number/index.js deleted file mode 100644 index 96ec66d5e..000000000 --- a/node_modules/is-number/index.js +++ /dev/null @@ -1,19 +0,0 @@ -/*! - * is-number - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var typeOf = require('kind-of'); - -module.exports = function isNumber(num) { - var type = typeOf(num); - if (type !== 'number' && type !== 'string') { - return false; - } - var n = +num; - return (n - n + 1) >= 0 && num !== ''; -}; diff --git a/node_modules/is-number/package.json b/node_modules/is-number/package.json deleted file mode 100644 index 7d91be0a8..000000000 --- a/node_modules/is-number/package.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "_from": "is-number@^2.1.0", - "_id": "is-number@2.1.0", - "_inBundle": false, - "_integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", - "_location": "/is-number", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-number@^2.1.0", - "name": "is-number", - "escapedName": "is-number", - "rawSpec": "^2.1.0", - "saveSpec": null, - "fetchSpec": "^2.1.0" - }, - "_requiredBy": [ - "/fill-range" - ], - "_resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "_shasum": "01fcbbb393463a548f2f466cce16dece49db908f", - "_spec": "is-number@^2.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/fill-range", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-number/issues" - }, - "bundleDependencies": false, - "dependencies": { - "kind-of": "^3.0.2" - }, - "deprecated": false, - "description": "Returns true if the value is a number. comprehensive tests.", - "devDependencies": { - "benchmarked": "^0.1.3", - "chalk": "^0.5.1", - "mocha": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-number", - "keywords": [ - "check", - "coerce", - "coercion", - "integer", - "is", - "is number", - "is-number", - "istype", - "kind of", - "math", - "number", - "test", - "type", - "typeof", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "is-number", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-number.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "kind-of", - "is-primitive", - "even", - "odd", - "is-even", - "is-odd" - ] - } - }, - "version": "2.1.0" -} diff --git a/node_modules/is-plain-object/LICENSE b/node_modules/is-plain-object/LICENSE deleted file mode 100644 index 3f2eca18f..000000000 --- a/node_modules/is-plain-object/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/is-plain-object/README.md b/node_modules/is-plain-object/README.md deleted file mode 100644 index 1f9d0c82d..000000000 --- a/node_modules/is-plain-object/README.md +++ /dev/null @@ -1,104 +0,0 @@ -# is-plain-object [![NPM version](https://img.shields.io/npm/v/is-plain-object.svg?style=flat)](https://www.npmjs.com/package/is-plain-object) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-plain-object.svg?style=flat)](https://npmjs.org/package/is-plain-object) [![NPM total downloads](https://img.shields.io/npm/dt/is-plain-object.svg?style=flat)](https://npmjs.org/package/is-plain-object) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-plain-object.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-plain-object) - -> Returns true if an object was created by the `Object` constructor. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save is-plain-object -``` - -Use [isobject](https://github.com/jonschlinkert/isobject) if you only want to check if the value is an object and not an array or null. - -## Usage - -```js -var isPlainObject = require('is-plain-object'); -``` - -**true** when created by the `Object` constructor. - -```js -isPlainObject(Object.create({})); -//=> true -isPlainObject(Object.create(Object.prototype)); -//=> true -isPlainObject({foo: 'bar'}); -//=> true -isPlainObject({}); -//=> true -``` - -**false** when not created by the `Object` constructor. - -```js -isPlainObject(1); -//=> false -isPlainObject(['foo', 'bar']); -//=> false -isPlainObject([]); -//=> false -isPlainObject(new Foo); -//=> false -isPlainObject(null); -//=> false -isPlainObject(Object.create(null)); -//=> false -``` - -## About - -### Related projects - -* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") -* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") -* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 17 | [jonschlinkert](https://github.com/jonschlinkert) | -| 6 | [stevenvachon](https://github.com/stevenvachon) | -| 3 | [onokumus](https://github.com/onokumus) | -| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 11, 2017._ \ No newline at end of file diff --git a/node_modules/is-plain-object/index.d.ts b/node_modules/is-plain-object/index.d.ts deleted file mode 100644 index 74a44e976..000000000 --- a/node_modules/is-plain-object/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export = isPlainObject; - -declare function isPlainObject(o: any): boolean; - -declare namespace isPlainObject {} diff --git a/node_modules/is-plain-object/index.js b/node_modules/is-plain-object/index.js deleted file mode 100644 index c3284849e..000000000 --- a/node_modules/is-plain-object/index.js +++ /dev/null @@ -1,37 +0,0 @@ -/*! - * is-plain-object - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var isObject = require('isobject'); - -function isObjectObject(o) { - return isObject(o) === true - && Object.prototype.toString.call(o) === '[object Object]'; -} - -module.exports = function isPlainObject(o) { - var ctor,prot; - - if (isObjectObject(o) === false) return false; - - // If has modified constructor - ctor = o.constructor; - if (typeof ctor !== 'function') return false; - - // If has modified prototype - prot = ctor.prototype; - if (isObjectObject(prot) === false) return false; - - // If constructor does not have an Object-specific method - if (prot.hasOwnProperty('isPrototypeOf') === false) { - return false; - } - - // Most likely a plain Object - return true; -}; diff --git a/node_modules/is-plain-object/node_modules/isobject/LICENSE b/node_modules/is-plain-object/node_modules/isobject/LICENSE deleted file mode 100644 index 943e71d05..000000000 --- a/node_modules/is-plain-object/node_modules/isobject/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert. - -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. \ No newline at end of file diff --git a/node_modules/is-plain-object/node_modules/isobject/README.md b/node_modules/is-plain-object/node_modules/isobject/README.md deleted file mode 100644 index d01feaa40..000000000 --- a/node_modules/is-plain-object/node_modules/isobject/README.md +++ /dev/null @@ -1,122 +0,0 @@ -# isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM monthly downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![NPM total downloads](https://img.shields.io/npm/dt/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/isobject) - -> Returns true if the value is an object and not an array or null. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save isobject -``` - -Install with [yarn](https://yarnpkg.com): - -```sh -$ yarn add isobject -``` - -Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install isobject -``` -Install with [bower](https://bower.io/) - -```sh -$ bower install isobject -``` - -## Usage - -```js -var isObject = require('isobject'); -``` - -**True** - -All of the following return `true`: - -```js -isObject({}); -isObject(Object.create({})); -isObject(Object.create(Object.prototype)); -isObject(Object.create(null)); -isObject({}); -isObject(new Foo); -isObject(/foo/); -``` - -**False** - -All of the following return `false`: - -```js -isObject(); -isObject(function () {}); -isObject(1); -isObject([]); -isObject(undefined); -isObject(null); -``` - -## About - -### Related projects - -* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") -* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") -* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") -* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 29 | [jonschlinkert](https://github.com/jonschlinkert) | -| 4 | [doowb](https://github.com/doowb) | -| 1 | [magnudae](https://github.com/magnudae) | -| 1 | [LeSuisse](https://github.com/LeSuisse) | -| 1 | [tmcw](https://github.com/tmcw) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 30, 2017._ \ No newline at end of file diff --git a/node_modules/is-plain-object/node_modules/isobject/index.d.ts b/node_modules/is-plain-object/node_modules/isobject/index.d.ts deleted file mode 100644 index 55f81c275..000000000 --- a/node_modules/is-plain-object/node_modules/isobject/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export = isObject; - -declare function isObject(val: any): boolean; - -declare namespace isObject {} diff --git a/node_modules/is-plain-object/node_modules/isobject/index.js b/node_modules/is-plain-object/node_modules/isobject/index.js deleted file mode 100644 index 2d59958bf..000000000 --- a/node_modules/is-plain-object/node_modules/isobject/index.js +++ /dev/null @@ -1,12 +0,0 @@ -/*! - * isobject - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -module.exports = function isObject(val) { - return val != null && typeof val === 'object' && Array.isArray(val) === false; -}; diff --git a/node_modules/is-plain-object/node_modules/isobject/package.json b/node_modules/is-plain-object/node_modules/isobject/package.json deleted file mode 100644 index 5a4695df9..000000000 --- a/node_modules/is-plain-object/node_modules/isobject/package.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "_from": "isobject@^3.0.1", - "_id": "isobject@3.0.1", - "_inBundle": false, - "_integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "_location": "/is-plain-object/isobject", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "isobject@^3.0.1", - "name": "isobject", - "escapedName": "isobject", - "rawSpec": "^3.0.1", - "saveSpec": null, - "fetchSpec": "^3.0.1" - }, - "_requiredBy": [ - "/is-plain-object" - ], - "_resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "_shasum": "4e431e92b11a9731636aa1f9c8d1ccbcfdab78df", - "_spec": "isobject@^3.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/is-plain-object", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/isobject/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "url": "https://github.com/LeSuisse" - }, - { - "name": "Brian Woodward", - "url": "https://twitter.com/doowb" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Magnús Dæhlen", - "url": "https://github.com/magnudae" - }, - { - "name": "Tom MacWright", - "url": "https://macwright.org" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "Returns true if the value is an object and not an array or null.", - "devDependencies": { - "gulp-format-md": "^0.1.9", - "mocha": "^2.4.5" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.d.ts", - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/isobject", - "keywords": [ - "check", - "is", - "is-object", - "isobject", - "kind", - "kind-of", - "kindof", - "native", - "object", - "type", - "typeof", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "isobject", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/isobject.git" - }, - "scripts": { - "test": "mocha" - }, - "types": "index.d.ts", - "verb": { - "related": { - "list": [ - "extend-shallow", - "is-plain-object", - "kind-of", - "merge-deep" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "verb" - ] - }, - "version": "3.0.1" -} diff --git a/node_modules/is-plain-object/package.json b/node_modules/is-plain-object/package.json deleted file mode 100644 index 12d82f912..000000000 --- a/node_modules/is-plain-object/package.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "_from": "is-plain-object@^2.0.3", - "_id": "is-plain-object@2.0.4", - "_inBundle": false, - "_integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "_location": "/is-plain-object", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-plain-object@^2.0.3", - "name": "is-plain-object", - "escapedName": "is-plain-object", - "rawSpec": "^2.0.3", - "saveSpec": null, - "fetchSpec": "^2.0.3" - }, - "_requiredBy": [ - "/extend-shallow/is-extendable", - "/mixin-deep/is-extendable", - "/set-value", - "/union-value/set-value" - ], - "_resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "_shasum": "2c163b3fafb1b606d9d17928f05c2a1c38e07677", - "_spec": "is-plain-object@^2.0.3", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/set-value", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-plain-object/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Osman Nuri Okumuş", - "url": "http://onokumus.com" - }, - { - "name": "Steven Vachon", - "url": "https://svachon.com" - }, - { - "url": "https://github.com/wtgtybhertgeghgtwtg" - } - ], - "dependencies": { - "isobject": "^3.0.1" - }, - "deprecated": false, - "description": "Returns true if an object was created by the `Object` constructor.", - "devDependencies": { - "browserify": "^14.4.0", - "chai": "^4.0.2", - "gulp-format-md": "^1.0.0", - "mocha": "^3.4.2", - "mocha-phantomjs": "^4.1.0", - "phantomjs": "^2.1.7", - "uglify-js": "^3.0.24" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.d.ts", - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-plain-object", - "keywords": [ - "check", - "is", - "is-object", - "isobject", - "javascript", - "kind", - "kind-of", - "object", - "plain", - "type", - "typeof", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "is-plain-object", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-plain-object.git" - }, - "scripts": { - "browserify": "browserify index.js --standalone isPlainObject | uglifyjs --compress --mangle -o browser/is-plain-object.js", - "test": "npm run test_node && npm run browserify && npm run test_browser", - "test_browser": "mocha-phantomjs test/browser.html", - "test_node": "mocha" - }, - "types": "index.d.ts", - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "is-number", - "isobject", - "kind-of" - ] - }, - "lint": { - "reflinks": true - } - }, - "version": "2.0.4" -} diff --git a/node_modules/is-posix-bracket/LICENSE b/node_modules/is-posix-bracket/LICENSE deleted file mode 100644 index 1e49edf81..000000000 --- a/node_modules/is-posix-bracket/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2016, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/is-posix-bracket/README.md b/node_modules/is-posix-bracket/README.md deleted file mode 100644 index 1d06a4d9e..000000000 --- a/node_modules/is-posix-bracket/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# is-posix-bracket [![NPM version](https://img.shields.io/npm/v/is-posix-bracket.svg?style=flat)](https://www.npmjs.com/package/is-posix-bracket) [![NPM downloads](https://img.shields.io/npm/dm/is-posix-bracket.svg?style=flat)](https://npmjs.org/package/is-posix-bracket) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-posix-bracket.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-posix-bracket) - -> Returns true if the given string is a POSIX bracket expression (POSIX character class). - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install is-posix-bracket --save -``` - -## Usage - -```js -var isPosixBracket = require('is-posix-bracket'); - -isPosixBracket('[foo:]]'); -//=> false -isPosixBracket('[xdigit:]]'); -//=> false -isPosixBracket('[[:xdigit:]]'); -//=> true -isPosixBracket('[[:xdigit:]]'); -//=> true -isPosixBracket('[[:alpha:]123]'); -//=> true -isPosixBracket('[[:alpha:]123]'); -//=> true -isPosixBracket('[a-c[:digit:]x-z]'); -//=> true -isPosixBracket('[:al:]'); -//=> true -isPosixBracket('[abc[:punct:][0-9]'); -//=> true -``` - -## Related projects - -You might also be interested in these projects: - -* [braces](https://www.npmjs.com/package/braces): Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces… [more](https://www.npmjs.com/package/braces) | [homepage](https://github.com/jonschlinkert/braces) -* [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/jonschlinkert/expand-brackets) -* [is-extglob](https://www.npmjs.com/package/is-extglob): Returns true if a string has an extglob. | [homepage](https://github.com/jonschlinkert/is-extglob) -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern.… [more](https://www.npmjs.com/package/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob) -* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just… [more](https://www.npmjs.com/package/micromatch) | [homepage](https://github.com/jonschlinkert/micromatch) - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-posix-bracket/issues/new). - -## Building docs - -Generate readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install verb && npm run docs -``` - -Or, if [verb](https://github.com/verbose/verb) is installed globally: - -```sh -$ verb -``` - -## Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -## Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/is-posix-bracket/blob/master/LICENSE). - -*** - -_This file was generated by [verb](https://github.com/verbose/verb), v, on April 05, 2016._ \ No newline at end of file diff --git a/node_modules/is-posix-bracket/index.js b/node_modules/is-posix-bracket/index.js deleted file mode 100644 index 7cf1de55b..000000000 --- a/node_modules/is-posix-bracket/index.js +++ /dev/null @@ -1,10 +0,0 @@ -/*! - * is-posix-bracket - * - * Copyright (c) 2015-2016, Jon Schlinkert. - * Licensed under the MIT License. - */ - -module.exports = function isPosixBracket(str) { - return typeof str === 'string' && /\[([:.=+])(?:[^\[\]]|)+\1\]/.test(str); -}; diff --git a/node_modules/is-posix-bracket/package.json b/node_modules/is-posix-bracket/package.json deleted file mode 100644 index eb7524bb8..000000000 --- a/node_modules/is-posix-bracket/package.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "_from": "is-posix-bracket@^0.1.0", - "_id": "is-posix-bracket@0.1.1", - "_inBundle": false, - "_integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", - "_location": "/is-posix-bracket", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-posix-bracket@^0.1.0", - "name": "is-posix-bracket", - "escapedName": "is-posix-bracket", - "rawSpec": "^0.1.0", - "saveSpec": null, - "fetchSpec": "^0.1.0" - }, - "_requiredBy": [ - "/expand-brackets" - ], - "_resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "_shasum": "3334dc79774368e92f016e6fbc0a88f5cd6e6bc4", - "_spec": "is-posix-bracket@^0.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/expand-brackets", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-posix-bracket/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Returns true if the given string is a POSIX bracket expression (POSIX character class).", - "devDependencies": { - "gulp-format-md": "^0.1.7", - "mocha": "^2.4.5" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-posix-bracket", - "keywords": [ - "braces", - "brackets", - "character", - "character-class", - "class", - "expression", - "posix", - "regex", - "regexp", - "regular" - ], - "license": "MIT", - "main": "index.js", - "name": "is-posix-bracket", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-posix-bracket.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "run": true, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "braces", - "expand-brackets", - "is-extglob", - "is-glob", - "micromatch" - ] - }, - "reflinks": [ - "verb" - ], - "lint": { - "reflinks": true - } - }, - "version": "0.1.1" -} diff --git a/node_modules/is-primitive/LICENSE b/node_modules/is-primitive/LICENSE deleted file mode 100644 index fa30c4cb3..000000000 --- a/node_modules/is-primitive/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/is-primitive/README.md b/node_modules/is-primitive/README.md deleted file mode 100644 index e1c306428..000000000 --- a/node_modules/is-primitive/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# is-primitive [![NPM version](https://badge.fury.io/js/is-primitive.svg)](http://badge.fury.io/js/is-primitive) [![Build Status](https://travis-ci.org/jonschlinkert/is-primitive.svg)](https://travis-ci.org/jonschlinkert/is-primitive) - -> Returns `true` if the value is a primitive. - -## Install with [npm](npmjs.org) - -```bash -npm i is-primitive --save -``` - -## Running tests -Install dev dependencies. - -```bash -npm i -d && npm test -``` - -## Usage - -```js -var isPrimitive = require('is-primitive'); -isPrimitive('abc'); -//=> true - -isPrimitive(42); -//=> true - -isPrimitive(false); -//=> true - -isPrimitive(true); -//=> true - -isPrimitive({}); -//=> false - -isPrimitive([]); -//=> false - -isPrimitive(function(){}); -//=> false -``` - -## Author - -**Jon Schlinkert** - -+ [github/jonschlinkert](https://github.com/jonschlinkert) -+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License -Copyright (c) 2014-2015 Jon Schlinkert -Released under the MIT license - -*** - -_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 16, 2015._ \ No newline at end of file diff --git a/node_modules/is-primitive/index.js b/node_modules/is-primitive/index.js deleted file mode 100644 index 55f11cf05..000000000 --- a/node_modules/is-primitive/index.js +++ /dev/null @@ -1,13 +0,0 @@ -/*! - * is-primitive - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -// see http://jsperf.com/testing-value-is-primitive/7 -module.exports = function isPrimitive(value) { - return value == null || (typeof value !== 'function' && typeof value !== 'object'); -}; diff --git a/node_modules/is-primitive/package.json b/node_modules/is-primitive/package.json deleted file mode 100644 index 33bfdbc6c..000000000 --- a/node_modules/is-primitive/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "_from": "is-primitive@^2.0.0", - "_id": "is-primitive@2.0.0", - "_inBundle": false, - "_integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "_location": "/is-primitive", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-primitive@^2.0.0", - "name": "is-primitive", - "escapedName": "is-primitive", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/is-equal-shallow" - ], - "_resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "_shasum": "207bab91638499c07b2adf240a41a87210034575", - "_spec": "is-primitive@^2.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/is-equal-shallow", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-primitive/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Returns `true` if the value is a primitive. ", - "devDependencies": { - "mocha": "*", - "should": "^4.0.4" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-primitive", - "keywords": [ - "boolean", - "check", - "number", - "primitive", - "string", - "symbol", - "type", - "typeof", - "util" - ], - "license": { - "type": "MIT", - "url": "https://github.com/jonschlinkert/is-primitive/blob/master/LICENSE" - }, - "main": "index.js", - "name": "is-primitive", - "repository": { - "type": "git", - "url": "git://github.com/jonschlinkert/is-primitive.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "2.0.0" -} diff --git a/node_modules/is-stream/index.js b/node_modules/is-stream/index.js deleted file mode 100644 index 6f7ec91a4..000000000 --- a/node_modules/is-stream/index.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -var isStream = module.exports = function (stream) { - return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function'; -}; - -isStream.writable = function (stream) { - return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object'; -}; - -isStream.readable = function (stream) { - return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object'; -}; - -isStream.duplex = function (stream) { - return isStream.writable(stream) && isStream.readable(stream); -}; - -isStream.transform = function (stream) { - return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object'; -}; diff --git a/node_modules/is-stream/license b/node_modules/is-stream/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/is-stream/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/is-stream/package.json b/node_modules/is-stream/package.json deleted file mode 100644 index f4a380798..000000000 --- a/node_modules/is-stream/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_from": "is-stream@^1.1.0", - "_id": "is-stream@1.1.0", - "_inBundle": false, - "_integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "_location": "/is-stream", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-stream@^1.1.0", - "name": "is-stream", - "escapedName": "is-stream", - "rawSpec": "^1.1.0", - "saveSpec": null, - "fetchSpec": "^1.1.0" - }, - "_requiredBy": [ - "/execa" - ], - "_resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "_shasum": "12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44", - "_spec": "is-stream@^1.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/execa", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/is-stream/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Check if something is a Node.js stream", - "devDependencies": { - "ava": "*", - "tempfile": "^1.1.0", - "xo": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/is-stream#readme", - "keywords": [ - "stream", - "type", - "streams", - "writable", - "readable", - "duplex", - "transform", - "check", - "detect", - "is" - ], - "license": "MIT", - "name": "is-stream", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is-stream.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.1.0" -} diff --git a/node_modules/is-stream/readme.md b/node_modules/is-stream/readme.md deleted file mode 100644 index d8afce81d..000000000 --- a/node_modules/is-stream/readme.md +++ /dev/null @@ -1,42 +0,0 @@ -# is-stream [![Build Status](https://travis-ci.org/sindresorhus/is-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/is-stream) - -> Check if something is a [Node.js stream](https://nodejs.org/api/stream.html) - - -## Install - -``` -$ npm install --save is-stream -``` - - -## Usage - -```js -const fs = require('fs'); -const isStream = require('is-stream'); - -isStream(fs.createReadStream('unicorn.png')); -//=> true - -isStream({}); -//=> false -``` - - -## API - -### isStream(stream) - -#### isStream.writable(stream) - -#### isStream.readable(stream) - -#### isStream.duplex(stream) - -#### isStream.transform(stream) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/is-windows/LICENSE b/node_modules/is-windows/LICENSE deleted file mode 100644 index f8de06305..000000000 --- a/node_modules/is-windows/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2018, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/is-windows/README.md b/node_modules/is-windows/README.md deleted file mode 100644 index 485bfdecb..000000000 --- a/node_modules/is-windows/README.md +++ /dev/null @@ -1,95 +0,0 @@ -# is-windows [![NPM version](https://img.shields.io/npm/v/is-windows.svg?style=flat)](https://www.npmjs.com/package/is-windows) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-windows.svg?style=flat)](https://npmjs.org/package/is-windows) [![NPM total downloads](https://img.shields.io/npm/dt/is-windows.svg?style=flat)](https://npmjs.org/package/is-windows) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-windows.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-windows) - -> Returns true if the platform is windows. UMD module, works with node.js, commonjs, browser, AMD, electron, etc. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save is-windows -``` - -## Heads up! - -As of `v0.2.0` this module always returns a function. - -## Node.js usage - -```js -var isWindows = require('is-windows'); - -console.log(isWindows()); -//=> returns true if the platform is windows -``` - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    - -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [is-absolute](https://www.npmjs.com/package/is-absolute): Returns true if a file path is absolute. Does not rely on the path module… [more](https://github.com/jonschlinkert/is-absolute) | [homepage](https://github.com/jonschlinkert/is-absolute "Returns true if a file path is absolute. Does not rely on the path module and can be used as a polyfill for node.js native `path.isAbolute`.") -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") -* [is-relative](https://www.npmjs.com/package/is-relative): Returns `true` if the path appears to be relative. | [homepage](https://github.com/jonschlinkert/is-relative "Returns `true` if the path appears to be relative.") -* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") -* [window-size](https://www.npmjs.com/package/window-size): Reliable way to get the height and width of terminal/console, since it's not calculated or… [more](https://github.com/jonschlinkert/window-size) | [homepage](https://github.com/jonschlinkert/window-size "Reliable way to get the height and width of terminal/console, since it's not calculated or updated the same way on all platforms, environments and node.js versions.") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 11 | [jonschlinkert](https://github.com/jonschlinkert) | -| 4 | [doowb](https://github.com/doowb) | -| 1 | [SimenB](https://github.com/SimenB) | -| 1 | [gucong3000](https://github.com/gucong3000) | - -### Author - -**Jon Schlinkert** - -* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on February 14, 2018._ \ No newline at end of file diff --git a/node_modules/is-windows/index.js b/node_modules/is-windows/index.js deleted file mode 100644 index 55d43e092..000000000 --- a/node_modules/is-windows/index.js +++ /dev/null @@ -1,27 +0,0 @@ -/*! - * is-windows - * - * Copyright © 2015-2018, Jon Schlinkert. - * Released under the MIT License. - */ - -(function(factory) { - if (exports && typeof exports === 'object' && typeof module !== 'undefined') { - module.exports = factory(); - } else if (typeof define === 'function' && define.amd) { - define([], factory); - } else if (typeof window !== 'undefined') { - window.isWindows = factory(); - } else if (typeof global !== 'undefined') { - global.isWindows = factory(); - } else if (typeof self !== 'undefined') { - self.isWindows = factory(); - } else { - this.isWindows = factory(); - } -})(function() { - 'use strict'; - return function isWindows() { - return process && (process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE)); - }; -}); diff --git a/node_modules/is-windows/package.json b/node_modules/is-windows/package.json deleted file mode 100644 index f2c7ad3fe..000000000 --- a/node_modules/is-windows/package.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "_from": "is-windows@^1.0.2", - "_id": "is-windows@1.0.2", - "_inBundle": false, - "_integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "_location": "/is-windows", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-windows@^1.0.2", - "name": "is-windows", - "escapedName": "is-windows", - "rawSpec": "^1.0.2", - "saveSpec": null, - "fetchSpec": "^1.0.2" - }, - "_requiredBy": [ - "/nanomatch" - ], - "_resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "_shasum": "d1850eb9791ecd18e6182ce12a30f396634bb19d", - "_spec": "is-windows@^1.0.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/nanomatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-windows/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Simen Bekkhus", - "url": "https://github.com/SimenB" - }, - { - "name": "刘祺", - "url": "gucong.co.cc" - } - ], - "deprecated": false, - "description": "Returns true if the platform is windows. UMD module, works with node.js, commonjs, browser, AMD, electron, etc.", - "devDependencies": { - "gulp-format-md": "^1.0.0", - "mocha": "^3.5.3" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-windows", - "keywords": [ - "check", - "cywin", - "is", - "is-windows", - "nix", - "operating system", - "os", - "platform", - "process", - "unix", - "win", - "win32", - "windows" - ], - "license": "MIT", - "main": "index.js", - "name": "is-windows", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-windows.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "is-absolute", - "is-glob", - "is-relative", - "isobject", - "window-size" - ] - }, - "lint": { - "reflinks": true - }, - "reflinks": [ - "verb" - ] - }, - "version": "1.0.2" -} diff --git a/node_modules/isarray/.npmignore b/node_modules/isarray/.npmignore deleted file mode 100644 index 3c3629e64..000000000 --- a/node_modules/isarray/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/isarray/.travis.yml b/node_modules/isarray/.travis.yml deleted file mode 100644 index cc4dba29d..000000000 --- a/node_modules/isarray/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" diff --git a/node_modules/isarray/Makefile b/node_modules/isarray/Makefile deleted file mode 100644 index 787d56e1e..000000000 --- a/node_modules/isarray/Makefile +++ /dev/null @@ -1,6 +0,0 @@ - -test: - @node_modules/.bin/tape test.js - -.PHONY: test - diff --git a/node_modules/isarray/README.md b/node_modules/isarray/README.md deleted file mode 100644 index 16d2c59c6..000000000 --- a/node_modules/isarray/README.md +++ /dev/null @@ -1,60 +0,0 @@ - -# isarray - -`Array#isArray` for older browsers. - -[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray) -[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray) - -[![browser support](https://ci.testling.com/juliangruber/isarray.png) -](https://ci.testling.com/juliangruber/isarray) - -## Usage - -```js -var isArray = require('isarray'); - -console.log(isArray([])); // => true -console.log(isArray({})); // => false -``` - -## Installation - -With [npm](http://npmjs.org) do - -```bash -$ npm install isarray -``` - -Then bundle for the browser with -[browserify](https://github.com/substack/browserify). - -With [component](http://component.io) do - -```bash -$ component install juliangruber/isarray -``` - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/isarray/component.json b/node_modules/isarray/component.json deleted file mode 100644 index 9e31b6838..000000000 --- a/node_modules/isarray/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name" : "isarray", - "description" : "Array#isArray for older browsers", - "version" : "0.0.1", - "repository" : "juliangruber/isarray", - "homepage": "https://github.com/juliangruber/isarray", - "main" : "index.js", - "scripts" : [ - "index.js" - ], - "dependencies" : {}, - "keywords": ["browser","isarray","array"], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT" -} diff --git a/node_modules/isarray/index.js b/node_modules/isarray/index.js deleted file mode 100644 index a57f63495..000000000 --- a/node_modules/isarray/index.js +++ /dev/null @@ -1,5 +0,0 @@ -var toString = {}.toString; - -module.exports = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; -}; diff --git a/node_modules/isarray/package.json b/node_modules/isarray/package.json deleted file mode 100644 index 1741d1912..000000000 --- a/node_modules/isarray/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "_from": "isarray@~1.0.0", - "_id": "isarray@1.0.0", - "_inBundle": false, - "_integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "_location": "/isarray", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "isarray@~1.0.0", - "name": "isarray", - "escapedName": "isarray", - "rawSpec": "~1.0.0", - "saveSpec": null, - "fetchSpec": "~1.0.0" - }, - "_requiredBy": [ - "/isobject", - "/readable-stream", - "/unset-value/has-value/isobject" - ], - "_resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "_shasum": "bb935d48582cba168c06834957a54a3e07124f11", - "_spec": "isarray@~1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readable-stream", - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "bugs": { - "url": "https://github.com/juliangruber/isarray/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Array#isArray for older browsers", - "devDependencies": { - "tape": "~2.13.4" - }, - "homepage": "https://github.com/juliangruber/isarray", - "keywords": [ - "browser", - "isarray", - "array" - ], - "license": "MIT", - "main": "index.js", - "name": "isarray", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/isarray.git" - }, - "scripts": { - "test": "tape test.js" - }, - "testling": { - "files": "test.js", - "browsers": [ - "ie/8..latest", - "firefox/17..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "version": "1.0.0" -} diff --git a/node_modules/isarray/test.js b/node_modules/isarray/test.js deleted file mode 100644 index e0c3444d8..000000000 --- a/node_modules/isarray/test.js +++ /dev/null @@ -1,20 +0,0 @@ -var isArray = require('./'); -var test = require('tape'); - -test('is array', function(t){ - t.ok(isArray([])); - t.notOk(isArray({})); - t.notOk(isArray(null)); - t.notOk(isArray(false)); - - var obj = {}; - obj[0] = true; - t.notOk(isArray(obj)); - - var arr = []; - arr.foo = 'bar'; - t.ok(isArray(arr)); - - t.end(); -}); - diff --git a/node_modules/isexe/.npmignore b/node_modules/isexe/.npmignore deleted file mode 100644 index c1cb757ac..000000000 --- a/node_modules/isexe/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.nyc_output/ -coverage/ diff --git a/node_modules/isexe/LICENSE b/node_modules/isexe/LICENSE deleted file mode 100644 index 19129e315..000000000 --- a/node_modules/isexe/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/isexe/README.md b/node_modules/isexe/README.md deleted file mode 100644 index 35769e844..000000000 --- a/node_modules/isexe/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# isexe - -Minimal module to check if a file is executable, and a normal file. - -Uses `fs.stat` and tests against the `PATHEXT` environment variable on -Windows. - -## USAGE - -```javascript -var isexe = require('isexe') -isexe('some-file-name', function (err, isExe) { - if (err) { - console.error('probably file does not exist or something', err) - } else if (isExe) { - console.error('this thing can be run') - } else { - console.error('cannot be run') - } -}) - -// same thing but synchronous, throws errors -var isExe = isexe.sync('some-file-name') - -// treat errors as just "not executable" -isexe('maybe-missing-file', { ignoreErrors: true }, callback) -var isExe = isexe.sync('maybe-missing-file', { ignoreErrors: true }) -``` - -## API - -### `isexe(path, [options], [callback])` - -Check if the path is executable. If no callback provided, and a -global `Promise` object is available, then a Promise will be returned. - -Will raise whatever errors may be raised by `fs.stat`, unless -`options.ignoreErrors` is set to true. - -### `isexe.sync(path, [options])` - -Same as `isexe` but returns the value and throws any errors raised. - -### Options - -* `ignoreErrors` Treat all errors as "no, this is not executable", but - don't raise them. -* `uid` Number to use as the user id -* `gid` Number to use as the group id -* `pathExt` List of path extensions to use instead of `PATHEXT` - environment variable on Windows. diff --git a/node_modules/isexe/index.js b/node_modules/isexe/index.js deleted file mode 100644 index 553fb32b1..000000000 --- a/node_modules/isexe/index.js +++ /dev/null @@ -1,57 +0,0 @@ -var fs = require('fs') -var core -if (process.platform === 'win32' || global.TESTING_WINDOWS) { - core = require('./windows.js') -} else { - core = require('./mode.js') -} - -module.exports = isexe -isexe.sync = sync - -function isexe (path, options, cb) { - if (typeof options === 'function') { - cb = options - options = {} - } - - if (!cb) { - if (typeof Promise !== 'function') { - throw new TypeError('callback not provided') - } - - return new Promise(function (resolve, reject) { - isexe(path, options || {}, function (er, is) { - if (er) { - reject(er) - } else { - resolve(is) - } - }) - }) - } - - core(path, options || {}, function (er, is) { - // ignore EACCES because that just means we aren't allowed to run it - if (er) { - if (er.code === 'EACCES' || options && options.ignoreErrors) { - er = null - is = false - } - } - cb(er, is) - }) -} - -function sync (path, options) { - // my kingdom for a filtered catch - try { - return core.sync(path, options || {}) - } catch (er) { - if (options && options.ignoreErrors || er.code === 'EACCES') { - return false - } else { - throw er - } - } -} diff --git a/node_modules/isexe/mode.js b/node_modules/isexe/mode.js deleted file mode 100644 index 1995ea4a0..000000000 --- a/node_modules/isexe/mode.js +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = isexe -isexe.sync = sync - -var fs = require('fs') - -function isexe (path, options, cb) { - fs.stat(path, function (er, stat) { - cb(er, er ? false : checkStat(stat, options)) - }) -} - -function sync (path, options) { - return checkStat(fs.statSync(path), options) -} - -function checkStat (stat, options) { - return stat.isFile() && checkMode(stat, options) -} - -function checkMode (stat, options) { - var mod = stat.mode - var uid = stat.uid - var gid = stat.gid - - var myUid = options.uid !== undefined ? - options.uid : process.getuid && process.getuid() - var myGid = options.gid !== undefined ? - options.gid : process.getgid && process.getgid() - - var u = parseInt('100', 8) - var g = parseInt('010', 8) - var o = parseInt('001', 8) - var ug = u | g - - var ret = (mod & o) || - (mod & g) && gid === myGid || - (mod & u) && uid === myUid || - (mod & ug) && myUid === 0 - - return ret -} diff --git a/node_modules/isexe/package.json b/node_modules/isexe/package.json deleted file mode 100644 index 2e8db5bcc..000000000 --- a/node_modules/isexe/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "_from": "isexe@^2.0.0", - "_id": "isexe@2.0.0", - "_inBundle": false, - "_integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "_location": "/isexe", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "isexe@^2.0.0", - "name": "isexe", - "escapedName": "isexe", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/which" - ], - "_resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "_shasum": "e8fbf374dc556ff8947a10dcb0572d633f2cfa10", - "_spec": "isexe@^2.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/which", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/isexe/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Minimal module to check if a file is executable.", - "devDependencies": { - "mkdirp": "^0.5.1", - "rimraf": "^2.5.0", - "tap": "^10.3.0" - }, - "directories": { - "test": "test" - }, - "homepage": "https://github.com/isaacs/isexe#readme", - "keywords": [], - "license": "ISC", - "main": "index.js", - "name": "isexe", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/isexe.git" - }, - "scripts": { - "postpublish": "git push origin --all; git push origin --tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap test/*.js --100" - }, - "version": "2.0.0" -} diff --git a/node_modules/isexe/test/basic.js b/node_modules/isexe/test/basic.js deleted file mode 100644 index d926df64b..000000000 --- a/node_modules/isexe/test/basic.js +++ /dev/null @@ -1,221 +0,0 @@ -var t = require('tap') -var fs = require('fs') -var path = require('path') -var fixture = path.resolve(__dirname, 'fixtures') -var meow = fixture + '/meow.cat' -var mine = fixture + '/mine.cat' -var ours = fixture + '/ours.cat' -var fail = fixture + '/fail.false' -var noent = fixture + '/enoent.exe' -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') - -var isWindows = process.platform === 'win32' -var hasAccess = typeof fs.access === 'function' -var winSkip = isWindows && 'windows' -var accessSkip = !hasAccess && 'no fs.access function' -var hasPromise = typeof Promise === 'function' -var promiseSkip = !hasPromise && 'no global Promise' - -function reset () { - delete require.cache[require.resolve('../')] - return require('../') -} - -t.test('setup fixtures', function (t) { - rimraf.sync(fixture) - mkdirp.sync(fixture) - fs.writeFileSync(meow, '#!/usr/bin/env cat\nmeow\n') - fs.chmodSync(meow, parseInt('0755', 8)) - fs.writeFileSync(fail, '#!/usr/bin/env false\n') - fs.chmodSync(fail, parseInt('0644', 8)) - fs.writeFileSync(mine, '#!/usr/bin/env cat\nmine\n') - fs.chmodSync(mine, parseInt('0744', 8)) - fs.writeFileSync(ours, '#!/usr/bin/env cat\nours\n') - fs.chmodSync(ours, parseInt('0754', 8)) - t.end() -}) - -t.test('promise', { skip: promiseSkip }, function (t) { - var isexe = reset() - t.test('meow async', function (t) { - isexe(meow).then(function (is) { - t.ok(is) - t.end() - }) - }) - t.test('fail async', function (t) { - isexe(fail).then(function (is) { - t.notOk(is) - t.end() - }) - }) - t.test('noent async', function (t) { - isexe(noent).catch(function (er) { - t.ok(er) - t.end() - }) - }) - t.test('noent ignore async', function (t) { - isexe(noent, { ignoreErrors: true }).then(function (is) { - t.notOk(is) - t.end() - }) - }) - t.end() -}) - -t.test('no promise', function (t) { - global.Promise = null - var isexe = reset() - t.throws('try to meow a promise', function () { - isexe(meow) - }) - t.end() -}) - -t.test('access', { skip: accessSkip || winSkip }, function (t) { - runTest(t) -}) - -t.test('mode', { skip: winSkip }, function (t) { - delete fs.access - delete fs.accessSync - var isexe = reset() - t.ok(isexe.sync(ours, { uid: 0, gid: 0 })) - t.ok(isexe.sync(mine, { uid: 0, gid: 0 })) - runTest(t) -}) - -t.test('windows', function (t) { - global.TESTING_WINDOWS = true - var pathExt = '.EXE;.CAT;.CMD;.COM' - t.test('pathExt option', function (t) { - runTest(t, { pathExt: '.EXE;.CAT;.CMD;.COM' }) - }) - t.test('pathExt env', function (t) { - process.env.PATHEXT = pathExt - runTest(t) - }) - t.test('no pathExt', function (t) { - // with a pathExt of '', any filename is fine. - // so the "fail" one would still pass. - runTest(t, { pathExt: '', skipFail: true }) - }) - t.test('pathext with empty entry', function (t) { - // with a pathExt of '', any filename is fine. - // so the "fail" one would still pass. - runTest(t, { pathExt: ';' + pathExt, skipFail: true }) - }) - t.end() -}) - -t.test('cleanup', function (t) { - rimraf.sync(fixture) - t.end() -}) - -function runTest (t, options) { - var isexe = reset() - - var optionsIgnore = Object.create(options || {}) - optionsIgnore.ignoreErrors = true - - if (!options || !options.skipFail) { - t.notOk(isexe.sync(fail, options)) - } - t.notOk(isexe.sync(noent, optionsIgnore)) - if (!options) { - t.ok(isexe.sync(meow)) - } else { - t.ok(isexe.sync(meow, options)) - } - - t.ok(isexe.sync(mine, options)) - t.ok(isexe.sync(ours, options)) - t.throws(function () { - isexe.sync(noent, options) - }) - - t.test('meow async', function (t) { - if (!options) { - isexe(meow, function (er, is) { - if (er) { - throw er - } - t.ok(is) - t.end() - }) - } else { - isexe(meow, options, function (er, is) { - if (er) { - throw er - } - t.ok(is) - t.end() - }) - } - }) - - t.test('mine async', function (t) { - isexe(mine, options, function (er, is) { - if (er) { - throw er - } - t.ok(is) - t.end() - }) - }) - - t.test('ours async', function (t) { - isexe(ours, options, function (er, is) { - if (er) { - throw er - } - t.ok(is) - t.end() - }) - }) - - if (!options || !options.skipFail) { - t.test('fail async', function (t) { - isexe(fail, options, function (er, is) { - if (er) { - throw er - } - t.notOk(is) - t.end() - }) - }) - } - - t.test('noent async', function (t) { - isexe(noent, options, function (er, is) { - t.ok(er) - t.notOk(is) - t.end() - }) - }) - - t.test('noent ignore async', function (t) { - isexe(noent, optionsIgnore, function (er, is) { - if (er) { - throw er - } - t.notOk(is) - t.end() - }) - }) - - t.test('directory is not executable', function (t) { - isexe(__dirname, options, function (er, is) { - if (er) { - throw er - } - t.notOk(is) - t.end() - }) - }) - - t.end() -} diff --git a/node_modules/isexe/windows.js b/node_modules/isexe/windows.js deleted file mode 100644 index 34996734d..000000000 --- a/node_modules/isexe/windows.js +++ /dev/null @@ -1,42 +0,0 @@ -module.exports = isexe -isexe.sync = sync - -var fs = require('fs') - -function checkPathExt (path, options) { - var pathext = options.pathExt !== undefined ? - options.pathExt : process.env.PATHEXT - - if (!pathext) { - return true - } - - pathext = pathext.split(';') - if (pathext.indexOf('') !== -1) { - return true - } - for (var i = 0; i < pathext.length; i++) { - var p = pathext[i].toLowerCase() - if (p && path.substr(-p.length).toLowerCase() === p) { - return true - } - } - return false -} - -function checkStat (stat, path, options) { - if (!stat.isSymbolicLink() && !stat.isFile()) { - return false - } - return checkPathExt(path, options) -} - -function isexe (path, options, cb) { - fs.stat(path, function (er, stat) { - cb(er, er ? false : checkStat(stat, path, options)) - }) -} - -function sync (path, options) { - return checkStat(fs.statSync(path), path, options) -} diff --git a/node_modules/isobject/LICENSE b/node_modules/isobject/LICENSE deleted file mode 100644 index 39245ac1c..000000000 --- a/node_modules/isobject/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2016, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/isobject/README.md b/node_modules/isobject/README.md deleted file mode 100644 index 9dd897aa0..000000000 --- a/node_modules/isobject/README.md +++ /dev/null @@ -1,112 +0,0 @@ -# isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat)](https://travis-ci.org/jonschlinkert/isobject) - -Returns true if the value is an object and not an array or null. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install isobject --save -``` - -Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install isobject -``` - -Install with [bower](http://bower.io/) - -```sh -$ bower install isobject -``` - -## Usage - -```js -var isObject = require('isobject'); -``` - -**True** - -All of the following return `true`: - -```js -isObject({}); -isObject(Object.create({})); -isObject(Object.create(Object.prototype)); -isObject(Object.create(null)); -isObject({}); -isObject(new Foo); -isObject(/foo/); -``` - -**False** - -All of the following return `false`: - -```js -isObject(); -isObject(function () {}); -isObject(1); -isObject([]); -isObject(undefined); -isObject(null); -``` - -## Related projects - -You might also be interested in these projects: - -[merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep) - -* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow) -* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object) -* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of) - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/isobject/issues/new). - -## Building docs - -Generate readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install verb && npm run docs -``` - -Or, if [verb](https://github.com/verbose/verb) is installed globally: - -```sh -$ verb -``` - -## Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -## Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/isobject/blob/master/LICENSE). - -*** - -_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on April 25, 2016._ \ No newline at end of file diff --git a/node_modules/isobject/index.js b/node_modules/isobject/index.js deleted file mode 100644 index aa0dce0bb..000000000 --- a/node_modules/isobject/index.js +++ /dev/null @@ -1,14 +0,0 @@ -/*! - * isobject - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var isArray = require('isarray'); - -module.exports = function isObject(val) { - return val != null && typeof val === 'object' && isArray(val) === false; -}; diff --git a/node_modules/isobject/package.json b/node_modules/isobject/package.json deleted file mode 100644 index a7dbc40e2..000000000 --- a/node_modules/isobject/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "_from": "isobject@^2.0.0", - "_id": "isobject@2.1.0", - "_inBundle": false, - "_integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "_location": "/isobject", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "isobject@^2.0.0", - "name": "isobject", - "escapedName": "isobject", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/fill-range" - ], - "_resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "_shasum": "f065561096a3f1da2ef46272f815c840d87e0c89", - "_spec": "isobject@^2.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/fill-range", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/isobject/issues" - }, - "bundleDependencies": false, - "dependencies": { - "isarray": "1.0.0" - }, - "deprecated": false, - "description": "Returns true if the value is an object and not an array or null.", - "devDependencies": { - "gulp-format-md": "^0.1.9", - "mocha": "^2.4.5" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/isobject", - "keywords": [ - "check", - "is", - "is-object", - "isobject", - "kind", - "kind-of", - "kindof", - "native", - "object", - "type", - "typeof", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "isobject", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/isobject.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "merge-deep", - "extend-shallow", - "is-plain-object", - "kind-of" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "verb" - ] - }, - "version": "2.1.0" -} diff --git a/node_modules/json-stable-stringify/.travis.yml b/node_modules/json-stable-stringify/.travis.yml deleted file mode 100644 index cc4dba29d..000000000 --- a/node_modules/json-stable-stringify/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" diff --git a/node_modules/json-stable-stringify/LICENSE b/node_modules/json-stable-stringify/LICENSE deleted file mode 100644 index ee27ba4b4..000000000 --- a/node_modules/json-stable-stringify/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/json-stable-stringify/example/key_cmp.js b/node_modules/json-stable-stringify/example/key_cmp.js deleted file mode 100644 index d5f66752d..000000000 --- a/node_modules/json-stable-stringify/example/key_cmp.js +++ /dev/null @@ -1,7 +0,0 @@ -var stringify = require('../'); - -var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; -var s = stringify(obj, function (a, b) { - return a.key < b.key ? 1 : -1; -}); -console.log(s); diff --git a/node_modules/json-stable-stringify/example/nested.js b/node_modules/json-stable-stringify/example/nested.js deleted file mode 100644 index 9a672fc65..000000000 --- a/node_modules/json-stable-stringify/example/nested.js +++ /dev/null @@ -1,3 +0,0 @@ -var stringify = require('../'); -var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; -console.log(stringify(obj)); diff --git a/node_modules/json-stable-stringify/example/str.js b/node_modules/json-stable-stringify/example/str.js deleted file mode 100644 index 9b4b3cd28..000000000 --- a/node_modules/json-stable-stringify/example/str.js +++ /dev/null @@ -1,3 +0,0 @@ -var stringify = require('../'); -var obj = { c: 6, b: [4,5], a: 3 }; -console.log(stringify(obj)); diff --git a/node_modules/json-stable-stringify/example/value_cmp.js b/node_modules/json-stable-stringify/example/value_cmp.js deleted file mode 100644 index 09f1c5f79..000000000 --- a/node_modules/json-stable-stringify/example/value_cmp.js +++ /dev/null @@ -1,7 +0,0 @@ -var stringify = require('../'); - -var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; -var s = stringify(obj, function (a, b) { - return a.value < b.value ? 1 : -1; -}); -console.log(s); diff --git a/node_modules/json-stable-stringify/index.js b/node_modules/json-stable-stringify/index.js deleted file mode 100644 index 1d609bf59..000000000 --- a/node_modules/json-stable-stringify/index.js +++ /dev/null @@ -1,50 +0,0 @@ -var json = typeof JSON !== 'undefined' ? JSON : require('jsonify'); - -module.exports = function (obj, opts) { - if (!opts) opts = {}; - if (typeof opts === 'function') opts = { cmp: opts }; - var cmp = opts.cmp && (function (f) { - return function (node) { - return function (a, b) { - var aobj = { key: a, value: node[a] }; - var bobj = { key: b, value: node[b] }; - return f(aobj, bobj); - }; - }; - })(opts.cmp); - - return (function stringify (node) { - if (typeof node !== 'object' || node === null) { - return json.stringify(node); - } - if (isArray(node)) { - var out = []; - for (var i = 0; i < node.length; i++) { - out.push(stringify(node[i])); - } - return '[' + out.join(',') + ']'; - } - else { - var keys = objectKeys(node).sort(cmp && cmp(node)); - var out = []; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - out.push(stringify(key) + ':' + stringify(node[key])); - } - return '{' + out.join(',') + '}'; - } - })(obj); -}; - -var isArray = Array.isArray || function (x) { - return {}.toString.call(x) === '[object Array]'; -}; - -var objectKeys = Object.keys || function (obj) { - var has = Object.prototype.hasOwnProperty || function () { return true }; - var keys = []; - for (var key in obj) { - if (has.call(obj, key)) keys.push(key); - } - return keys; -}; diff --git a/node_modules/json-stable-stringify/package.json b/node_modules/json-stable-stringify/package.json deleted file mode 100644 index 8ae5d4cff..000000000 --- a/node_modules/json-stable-stringify/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "_from": "json-stable-stringify@~0.0.0", - "_id": "json-stable-stringify@0.0.1", - "_inBundle": false, - "_integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=", - "_location": "/json-stable-stringify", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "json-stable-stringify@~0.0.0", - "name": "json-stable-stringify", - "escapedName": "json-stable-stringify", - "rawSpec": "~0.0.0", - "saveSpec": null, - "fetchSpec": "~0.0.0" - }, - "_requiredBy": [ - "/shasum" - ], - "_resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", - "_shasum": "611c23e814db375527df851193db59dd2af27f45", - "_spec": "json-stable-stringify@~0.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/shasum", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/json-stable-stringify/issues" - }, - "bundleDependencies": false, - "dependencies": { - "jsonify": "~0.0.0" - }, - "deprecated": false, - "description": "deterministic JSON.stringify() with custom sorting to get deterministic hashes from stringified results", - "devDependencies": { - "tape": "~1.0.4" - }, - "homepage": "https://github.com/substack/json-stable-stringify", - "keywords": [ - "json", - "stringify", - "deterministic", - "hash", - "sort", - "stable" - ], - "license": "MIT", - "main": "index.js", - "name": "json-stable-stringify", - "repository": { - "type": "git", - "url": "git://github.com/substack/json-stable-stringify.git" - }, - "scripts": { - "test": "tape test/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "ff/5", - "ff/latest", - "chrome/15", - "chrome/latest", - "safari/latest", - "opera/latest" - ] - }, - "version": "0.0.1" -} diff --git a/node_modules/json-stable-stringify/readme.markdown b/node_modules/json-stable-stringify/readme.markdown deleted file mode 100644 index 3a3d00c7e..000000000 --- a/node_modules/json-stable-stringify/readme.markdown +++ /dev/null @@ -1,90 +0,0 @@ -# json-stable-stringify - -deterministic version of `JSON.stringify()` so you can get a consistent hash -from stringified results - -You can also pass in a custom comparison function. - -[![browser support](https://ci.testling.com/substack/json-stable-stringify.png)](https://ci.testling.com/substack/json-stable-stringify) - -[![build status](https://secure.travis-ci.org/substack/json-stable-stringify.png)](http://travis-ci.org/substack/json-stable-stringify) - -# example - -``` js -var stringify = require('json-stable-stringify'); -var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; -console.log(stringify(obj)); -``` - -output: - -``` -{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8} -``` - -# methods - -``` js -var stringify = require('json-stable-stringify') -``` - -## var str = stringify(obj, opts) - -Return a deterministic stringified string `str` from the object `obj`. - -If `opts` is given, you can supply an `opts.cmp` to have a custom comparison -function for object keys. Your function `opts.cmp` is called with these -parameters: - -``` js -opts.cmp({ key: akey, value: avalue }, { key: bkey, value: bvalue }) -``` - -For example, to sort on the object key names in reverse order you could write: - -``` js -var stringify = require('json-stable-stringify'); - -var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; -var s = stringify(obj, function (a, b) { - return a.key < b.key ? 1 : -1; -}); -console.log(s); -``` - -which results in the output string: - -``` -{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3} -``` - -Or if you wanted to sort on the object values in reverse order, you could write: - -``` -var stringify = require('json-stable-stringify'); - -var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; -var s = stringify(obj, function (a, b) { - return a.value < b.value ? 1 : -1; -}); -console.log(s); -``` - -which outputs: - -``` -{"d":6,"c":5,"b":[{"z":3,"y":2,"x":1},9],"a":10} -``` - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install json-stable-stringify -``` - -# license - -MIT diff --git a/node_modules/json-stable-stringify/test/cmp.js b/node_modules/json-stable-stringify/test/cmp.js deleted file mode 100644 index 2dbb39355..000000000 --- a/node_modules/json-stable-stringify/test/cmp.js +++ /dev/null @@ -1,11 +0,0 @@ -var test = require('tape'); -var stringify = require('../'); - -test('custom comparison function', function (t) { - t.plan(1); - var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; - var s = stringify(obj, function (a, b) { - return a.key < b.key ? 1 : -1; - }); - t.equal(s, '{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3}'); -}); diff --git a/node_modules/json-stable-stringify/test/nested.js b/node_modules/json-stable-stringify/test/nested.js deleted file mode 100644 index 43459f2b8..000000000 --- a/node_modules/json-stable-stringify/test/nested.js +++ /dev/null @@ -1,8 +0,0 @@ -var test = require('tape'); -var stringify = require('../'); - -test('nested', function (t) { - t.plan(1); - var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; - t.equal(stringify(obj), '{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8}'); -}); diff --git a/node_modules/json-stable-stringify/test/str.js b/node_modules/json-stable-stringify/test/str.js deleted file mode 100644 index d0e915937..000000000 --- a/node_modules/json-stable-stringify/test/str.js +++ /dev/null @@ -1,8 +0,0 @@ -var test = require('tape'); -var stringify = require('../'); - -test('simple object', function (t) { - t.plan(1); - var obj = { c: 6, b: [4,5], a: 3, z: null }; - t.equal(stringify(obj), '{"a":3,"b":[4,5],"c":6,"z":null}'); -}); diff --git a/node_modules/json-stringify-safe/.npmignore b/node_modules/json-stringify-safe/.npmignore deleted file mode 100644 index 17d6b3677..000000000 --- a/node_modules/json-stringify-safe/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/*.tgz diff --git a/node_modules/json-stringify-safe/CHANGELOG.md b/node_modules/json-stringify-safe/CHANGELOG.md deleted file mode 100644 index 42bcb60af..000000000 --- a/node_modules/json-stringify-safe/CHANGELOG.md +++ /dev/null @@ -1,14 +0,0 @@ -## Unreleased -- Fixes stringify to only take ancestors into account when checking - circularity. - It previously assumed every visited object was circular which led to [false - positives][issue9]. - Uses the tiny serializer I wrote for [Must.js][must] a year and a half ago. -- Fixes calling the `replacer` function in the proper context (`thisArg`). -- Fixes calling the `cycleReplacer` function in the proper context (`thisArg`). -- Speeds serializing by a factor of - Big-O(h-my-god-it-linearly-searched-every-object) it had ever seen. Searching - only the ancestors for a circular references speeds up things considerably. - -[must]: https://github.com/moll/js-must -[issue9]: https://github.com/isaacs/json-stringify-safe/issues/9 diff --git a/node_modules/json-stringify-safe/LICENSE b/node_modules/json-stringify-safe/LICENSE deleted file mode 100644 index 19129e315..000000000 --- a/node_modules/json-stringify-safe/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/json-stringify-safe/Makefile b/node_modules/json-stringify-safe/Makefile deleted file mode 100644 index 36088c723..000000000 --- a/node_modules/json-stringify-safe/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -NODE_OPTS = -TEST_OPTS = - -love: - @echo "Feel like makin' love." - -test: - @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R dot $(TEST_OPTS) - -spec: - @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R spec $(TEST_OPTS) - -autotest: - @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R dot --watch $(TEST_OPTS) - -autospec: - @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R spec --watch $(TEST_OPTS) - -pack: - @file=$$(npm pack); echo "$$file"; tar tf "$$file" - -publish: - npm publish - -tag: - git tag "v$$(node -e 'console.log(require("./package").version)')" - -clean: - rm -f *.tgz - npm prune --production - -.PHONY: love -.PHONY: test spec autotest autospec -.PHONY: pack publish tag -.PHONY: clean diff --git a/node_modules/json-stringify-safe/README.md b/node_modules/json-stringify-safe/README.md deleted file mode 100644 index a11f302a3..000000000 --- a/node_modules/json-stringify-safe/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# json-stringify-safe - -Like JSON.stringify, but doesn't throw on circular references. - -## Usage - -Takes the same arguments as `JSON.stringify`. - -```javascript -var stringify = require('json-stringify-safe'); -var circularObj = {}; -circularObj.circularRef = circularObj; -circularObj.list = [ circularObj, circularObj ]; -console.log(stringify(circularObj, null, 2)); -``` - -Output: - -```json -{ - "circularRef": "[Circular]", - "list": [ - "[Circular]", - "[Circular]" - ] -} -``` - -## Details - -``` -stringify(obj, serializer, indent, decycler) -``` - -The first three arguments are the same as to JSON.stringify. The last -is an argument that's only used when the object has been seen already. - -The default `decycler` function returns the string `'[Circular]'`. -If, for example, you pass in `function(k,v){}` (return nothing) then it -will prune cycles. If you pass in `function(k,v){ return {foo: 'bar'}}`, -then cyclical objects will always be represented as `{"foo":"bar"}` in -the result. - -``` -stringify.getSerialize(serializer, decycler) -``` - -Returns a serializer that can be used elsewhere. This is the actual -function that's passed to JSON.stringify. - -**Note** that the function returned from `getSerialize` is stateful for now, so -do **not** use it more than once. diff --git a/node_modules/json-stringify-safe/package.json b/node_modules/json-stringify-safe/package.json deleted file mode 100644 index ba8123f65..000000000 --- a/node_modules/json-stringify-safe/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_from": "json-stringify-safe@>=5.0.0 <5.1.0-0", - "_id": "json-stringify-safe@5.0.1", - "_inBundle": false, - "_integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "_location": "/json-stringify-safe", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "json-stringify-safe@>=5.0.0 <5.1.0-0", - "name": "json-stringify-safe", - "escapedName": "json-stringify-safe", - "rawSpec": ">=5.0.0 <5.1.0-0", - "saveSpec": null, - "fetchSpec": ">=5.0.0 <5.1.0-0" - }, - "_requiredBy": [ - "/bole" - ], - "_resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "_shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb", - "_spec": "json-stringify-safe@>=5.0.0 <5.1.0-0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/bole", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "bugs": { - "url": "https://github.com/isaacs/json-stringify-safe/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Andri Möll", - "email": "andri@dot.ee", - "url": "http://themoll.com" - } - ], - "deprecated": false, - "description": "Like JSON.stringify, but doesn't blow up on circular refs.", - "devDependencies": { - "mocha": ">= 2.1.0 < 3", - "must": ">= 0.12 < 0.13", - "sinon": ">= 1.12.2 < 2" - }, - "homepage": "https://github.com/isaacs/json-stringify-safe", - "keywords": [ - "json", - "stringify", - "circular", - "safe" - ], - "license": "ISC", - "main": "stringify.js", - "name": "json-stringify-safe", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/json-stringify-safe.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "5.0.1" -} diff --git a/node_modules/json-stringify-safe/stringify.js b/node_modules/json-stringify-safe/stringify.js deleted file mode 100644 index 124a45218..000000000 --- a/node_modules/json-stringify-safe/stringify.js +++ /dev/null @@ -1,27 +0,0 @@ -exports = module.exports = stringify -exports.getSerialize = serializer - -function stringify(obj, replacer, spaces, cycleReplacer) { - return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces) -} - -function serializer(replacer, cycleReplacer) { - var stack = [], keys = [] - - if (cycleReplacer == null) cycleReplacer = function(key, value) { - if (stack[0] === value) return "[Circular ~]" - return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]" - } - - return function(key, value) { - if (stack.length > 0) { - var thisPos = stack.indexOf(this) - ~thisPos ? stack.splice(thisPos + 1) : stack.push(this) - ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key) - if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value) - } - else stack.push(value) - - return replacer == null ? value : replacer.call(this, key, value) - } -} diff --git a/node_modules/json-stringify-safe/test/mocha.opts b/node_modules/json-stringify-safe/test/mocha.opts deleted file mode 100644 index 2544e5861..000000000 --- a/node_modules/json-stringify-safe/test/mocha.opts +++ /dev/null @@ -1,2 +0,0 @@ ---recursive ---require must diff --git a/node_modules/json-stringify-safe/test/stringify_test.js b/node_modules/json-stringify-safe/test/stringify_test.js deleted file mode 100644 index 5b3258317..000000000 --- a/node_modules/json-stringify-safe/test/stringify_test.js +++ /dev/null @@ -1,246 +0,0 @@ -var Sinon = require("sinon") -var stringify = require("..") -function jsonify(obj) { return JSON.stringify(obj, null, 2) } - -describe("Stringify", function() { - it("must stringify circular objects", function() { - var obj = {name: "Alice"} - obj.self = obj - var json = stringify(obj, null, 2) - json.must.eql(jsonify({name: "Alice", self: "[Circular ~]"})) - }) - - it("must stringify circular objects with intermediaries", function() { - var obj = {name: "Alice"} - obj.identity = {self: obj} - var json = stringify(obj, null, 2) - json.must.eql(jsonify({name: "Alice", identity: {self: "[Circular ~]"}})) - }) - - it("must stringify circular objects deeper", function() { - var obj = {name: "Alice", child: {name: "Bob"}} - obj.child.self = obj.child - - stringify(obj, null, 2).must.eql(jsonify({ - name: "Alice", - child: {name: "Bob", self: "[Circular ~.child]"} - })) - }) - - it("must stringify circular objects deeper with intermediaries", function() { - var obj = {name: "Alice", child: {name: "Bob"}} - obj.child.identity = {self: obj.child} - - stringify(obj, null, 2).must.eql(jsonify({ - name: "Alice", - child: {name: "Bob", identity: {self: "[Circular ~.child]"}} - })) - }) - - it("must stringify circular objects in an array", function() { - var obj = {name: "Alice"} - obj.self = [obj, obj] - - stringify(obj, null, 2).must.eql(jsonify({ - name: "Alice", self: ["[Circular ~]", "[Circular ~]"] - })) - }) - - it("must stringify circular objects deeper in an array", function() { - var obj = {name: "Alice", children: [{name: "Bob"}, {name: "Eve"}]} - obj.children[0].self = obj.children[0] - obj.children[1].self = obj.children[1] - - stringify(obj, null, 2).must.eql(jsonify({ - name: "Alice", - children: [ - {name: "Bob", self: "[Circular ~.children.0]"}, - {name: "Eve", self: "[Circular ~.children.1]"} - ] - })) - }) - - it("must stringify circular arrays", function() { - var obj = [] - obj.push(obj) - obj.push(obj) - var json = stringify(obj, null, 2) - json.must.eql(jsonify(["[Circular ~]", "[Circular ~]"])) - }) - - it("must stringify circular arrays with intermediaries", function() { - var obj = [] - obj.push({name: "Alice", self: obj}) - obj.push({name: "Bob", self: obj}) - - stringify(obj, null, 2).must.eql(jsonify([ - {name: "Alice", self: "[Circular ~]"}, - {name: "Bob", self: "[Circular ~]"} - ])) - }) - - it("must stringify repeated objects in objects", function() { - var obj = {} - var alice = {name: "Alice"} - obj.alice1 = alice - obj.alice2 = alice - - stringify(obj, null, 2).must.eql(jsonify({ - alice1: {name: "Alice"}, - alice2: {name: "Alice"} - })) - }) - - it("must stringify repeated objects in arrays", function() { - var alice = {name: "Alice"} - var obj = [alice, alice] - var json = stringify(obj, null, 2) - json.must.eql(jsonify([{name: "Alice"}, {name: "Alice"}])) - }) - - it("must call given decycler and use its output", function() { - var obj = {} - obj.a = obj - obj.b = obj - - var decycle = Sinon.spy(function() { return decycle.callCount }) - var json = stringify(obj, null, 2, decycle) - json.must.eql(jsonify({a: 1, b: 2}, null, 2)) - - decycle.callCount.must.equal(2) - decycle.thisValues[0].must.equal(obj) - decycle.args[0][0].must.equal("a") - decycle.args[0][1].must.equal(obj) - decycle.thisValues[1].must.equal(obj) - decycle.args[1][0].must.equal("b") - decycle.args[1][1].must.equal(obj) - }) - - it("must call replacer and use its output", function() { - var obj = {name: "Alice", child: {name: "Bob"}} - - var replacer = Sinon.spy(bangString) - var json = stringify(obj, replacer, 2) - json.must.eql(jsonify({name: "Alice!", child: {name: "Bob!"}})) - - replacer.callCount.must.equal(4) - replacer.args[0][0].must.equal("") - replacer.args[0][1].must.equal(obj) - replacer.thisValues[1].must.equal(obj) - replacer.args[1][0].must.equal("name") - replacer.args[1][1].must.equal("Alice") - replacer.thisValues[2].must.equal(obj) - replacer.args[2][0].must.equal("child") - replacer.args[2][1].must.equal(obj.child) - replacer.thisValues[3].must.equal(obj.child) - replacer.args[3][0].must.equal("name") - replacer.args[3][1].must.equal("Bob") - }) - - it("must call replacer after describing circular references", function() { - var obj = {name: "Alice"} - obj.self = obj - - var replacer = Sinon.spy(bangString) - var json = stringify(obj, replacer, 2) - json.must.eql(jsonify({name: "Alice!", self: "[Circular ~]!"})) - - replacer.callCount.must.equal(3) - replacer.args[0][0].must.equal("") - replacer.args[0][1].must.equal(obj) - replacer.thisValues[1].must.equal(obj) - replacer.args[1][0].must.equal("name") - replacer.args[1][1].must.equal("Alice") - replacer.thisValues[2].must.equal(obj) - replacer.args[2][0].must.equal("self") - replacer.args[2][1].must.equal("[Circular ~]") - }) - - it("must call given decycler and use its output for nested objects", - function() { - var obj = {} - obj.a = obj - obj.b = {self: obj} - - var decycle = Sinon.spy(function() { return decycle.callCount }) - var json = stringify(obj, null, 2, decycle) - json.must.eql(jsonify({a: 1, b: {self: 2}})) - - decycle.callCount.must.equal(2) - decycle.args[0][0].must.equal("a") - decycle.args[0][1].must.equal(obj) - decycle.args[1][0].must.equal("self") - decycle.args[1][1].must.equal(obj) - }) - - it("must use decycler's output when it returned null", function() { - var obj = {a: "b"} - obj.self = obj - obj.selves = [obj, obj] - - function decycle() { return null } - stringify(obj, null, 2, decycle).must.eql(jsonify({ - a: "b", - self: null, - selves: [null, null] - })) - }) - - it("must use decycler's output when it returned undefined", function() { - var obj = {a: "b"} - obj.self = obj - obj.selves = [obj, obj] - - function decycle() {} - stringify(obj, null, 2, decycle).must.eql(jsonify({ - a: "b", - selves: [null, null] - })) - }) - - it("must throw given a decycler that returns a cycle", function() { - var obj = {} - obj.self = obj - var err - function identity(key, value) { return value } - try { stringify(obj, null, 2, identity) } catch (ex) { err = ex } - err.must.be.an.instanceof(TypeError) - }) - - describe(".getSerialize", function() { - it("must stringify circular objects", function() { - var obj = {a: "b"} - obj.circularRef = obj - obj.list = [obj, obj] - - var json = JSON.stringify(obj, stringify.getSerialize(), 2) - json.must.eql(jsonify({ - "a": "b", - "circularRef": "[Circular ~]", - "list": ["[Circular ~]", "[Circular ~]"] - })) - }) - - // This is the behavior as of Mar 3, 2015. - // The serializer function keeps state inside the returned function and - // so far I'm not sure how to not do that. JSON.stringify's replacer is not - // called _after_ serialization. - xit("must return a function that could be called twice", function() { - var obj = {name: "Alice"} - obj.self = obj - - var json - var serializer = stringify.getSerialize() - - json = JSON.stringify(obj, serializer, 2) - json.must.eql(jsonify({name: "Alice", self: "[Circular ~]"})) - - json = JSON.stringify(obj, serializer, 2) - json.must.eql(jsonify({name: "Alice", self: "[Circular ~]"})) - }) - }) -}) - -function bangString(key, value) { - return typeof value == "string" ? value + "!" : value -} diff --git a/node_modules/jsonify/README.markdown b/node_modules/jsonify/README.markdown deleted file mode 100644 index 71d9a93b5..000000000 --- a/node_modules/jsonify/README.markdown +++ /dev/null @@ -1,34 +0,0 @@ -jsonify -======= - -This module provides Douglas Crockford's JSON implementation without modifying -any globals. - -`stringify` and `parse` are merely exported without respect to whether or not a -global `JSON` object exists. - -methods -======= - -var json = require('jsonify'); - -json.parse(source, reviver) ---------------------------- - -Return a new javascript object from a parse of the `source` string. - -If a `reviver` function is specified, walk the structure passing each name/value -pair to `reviver.call(parent, key, value)` to transform the `value` before -parsing it. - -json.stringify(value, replacer, space) --------------------------------------- - -Return a string representation for `value`. - -If `replacer` is specified, walk the structure passing each name/value pair to -`replacer.call(parent, key, value)` to transform the `value` before stringifying -it. - -If `space` is a number, indent the result by that many spaces. -If `space` is a string, use `space` as the indentation. diff --git a/node_modules/jsonify/index.js b/node_modules/jsonify/index.js deleted file mode 100644 index f728a1605..000000000 --- a/node_modules/jsonify/index.js +++ /dev/null @@ -1,2 +0,0 @@ -exports.parse = require('./lib/parse'); -exports.stringify = require('./lib/stringify'); diff --git a/node_modules/jsonify/lib/parse.js b/node_modules/jsonify/lib/parse.js deleted file mode 100644 index 30e2f0143..000000000 --- a/node_modules/jsonify/lib/parse.js +++ /dev/null @@ -1,273 +0,0 @@ -var at, // The index of the current character - ch, // The current character - escapee = { - '"': '"', - '\\': '\\', - '/': '/', - b: '\b', - f: '\f', - n: '\n', - r: '\r', - t: '\t' - }, - text, - - error = function (m) { - // Call error when something is wrong. - throw { - name: 'SyntaxError', - message: m, - at: at, - text: text - }; - }, - - next = function (c) { - // If a c parameter is provided, verify that it matches the current character. - if (c && c !== ch) { - error("Expected '" + c + "' instead of '" + ch + "'"); - } - - // Get the next character. When there are no more characters, - // return the empty string. - - ch = text.charAt(at); - at += 1; - return ch; - }, - - number = function () { - // Parse a number value. - var number, - string = ''; - - if (ch === '-') { - string = '-'; - next('-'); - } - 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(); - } - } - number = +string; - if (!isFinite(number)) { - error("Bad number"); - } else { - return number; - } - }, - - string = function () { - // Parse a string value. - var hex, - i, - string = '', - uffff; - - // When parsing for string values, we must look for " and \ characters. - if (ch === '"') { - while (next()) { - if (ch === '"') { - 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 (typeof escapee[ch] === 'string') { - string += escapee[ch]; - } else { - break; - } - } else { - string += ch; - } - } - } - error("Bad string"); - }, - - white = function () { - -// Skip whitespace. - - while (ch && ch <= ' ') { - next(); - } - }, - - 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; - } - error("Unexpected '" + ch + "'"); - }, - - value, // Place holder for the value function. - - array = function () { - -// Parse an array value. - - var array = []; - - if (ch === '[') { - next('['); - white(); - if (ch === ']') { - next(']'); - return array; // empty array - } - while (ch) { - array.push(value()); - white(); - if (ch === ']') { - next(']'); - return array; - } - next(','); - white(); - } - } - error("Bad array"); - }, - - object = function () { - -// Parse an object value. - - var key, - object = {}; - - if (ch === '{') { - next('{'); - white(); - if (ch === '}') { - next('}'); - return object; // empty object - } - while (ch) { - key = string(); - white(); - next(':'); - if (Object.hasOwnProperty.call(object, key)) { - error('Duplicate key "' + key + '"'); - } - object[key] = value(); - white(); - 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 '"': - return string(); - 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. - -module.exports = function (source, reviver) { - var result; - - text = source; - at = 0; - 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; -}; diff --git a/node_modules/jsonify/lib/stringify.js b/node_modules/jsonify/lib/stringify.js deleted file mode 100644 index 134587081..000000000 --- a/node_modules/jsonify/lib/stringify.js +++ /dev/null @@ -1,154 +0,0 @@ -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, - gap, - indent, - meta = { // table of character substitutions - '\b': '\\b', - '\t': '\\t', - '\n': '\\n', - '\f': '\\f', - '\r': '\\r', - '"' : '\\"', - '\\': '\\\\' - }, - rep; - -function quote(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 + '"'; -} - -function str(key, holder) { - // Produce a string from holder[key]. - var i, // The loop counter. - k, // The member key. - v, // The member value. - length, - mind = gap, - partial, - value = holder[key]; - - // If the value has a toJSON method, call it to obtain a replacement value. - if (value && typeof value === 'object' && - typeof value.toJSON === 'function') { - value = value.toJSON(key); - } - - // If we were called with a replacer function, then call the replacer to - // obtain a replacement value. - if (typeof rep === 'function') { - value = rep.call(holder, key, value); - } - - // What happens next depends on the value's type. - switch (typeof value) { - case 'string': - return quote(value); - - case 'number': - // JSON numbers must be finite. Encode non-finite numbers as null. - return isFinite(value) ? String(value) : 'null'; - - case 'boolean': - case 'null': - // If the value is a boolean or null, convert it to a string. Note: - // typeof null does not produce 'null'. The case is included here in - // the remote chance that this gets fixed someday. - return String(value); - - case 'object': - if (!value) return 'null'; - gap += indent; - partial = []; - - // Array.isArray - if (Object.prototype.toString.apply(value) === '[object Array]') { - length = value.length; - for (i = 0; i < length; i += 1) { - partial[i] = str(i, value) || 'null'; - } - - // Join all of the elements together, separated with commas, and - // wrap them in brackets. - v = partial.length === 0 ? '[]' : gap ? - '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : - '[' + partial.join(',') + ']'; - gap = mind; - return v; - } - - // If the replacer is an array, use it to select the members to be - // stringified. - if (rep && typeof rep === 'object') { - length = rep.length; - for (i = 0; i < length; i += 1) { - k = rep[i]; - if (typeof k === 'string') { - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } - else { - // Otherwise, iterate through all of the keys in the object. - for (k in value) { - if (Object.prototype.hasOwnProperty.call(value, k)) { - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } - - // Join all of the member texts together, separated with commas, - // and wrap them in braces. - - v = partial.length === 0 ? '{}' : gap ? - '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : - '{' + partial.join(',') + '}'; - gap = mind; - return v; - } -} - -module.exports = function (value, replacer, space) { - var i; - gap = ''; - indent = ''; - - // If the space parameter is a number, make an indent string containing that - // many spaces. - if (typeof space === 'number') { - for (i = 0; i < space; i += 1) { - indent += ' '; - } - } - // If the space parameter is a string, it will be used as the indent string. - else if (typeof space === 'string') { - indent = space; - } - - // If there is a replacer, it must be a function or an array. - // Otherwise, throw an error. - rep = replacer; - if (replacer && typeof replacer !== 'function' - && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) { - throw new Error('JSON.stringify'); - } - - // Make a fake root object containing our value under the key of ''. - // Return the result of stringifying the value. - return str('', {'': value}); -}; diff --git a/node_modules/jsonify/package.json b/node_modules/jsonify/package.json deleted file mode 100644 index c9e9f5646..000000000 --- a/node_modules/jsonify/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "_from": "jsonify@~0.0.0", - "_id": "jsonify@0.0.0", - "_inBundle": false, - "_integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", - "_location": "/jsonify", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "jsonify@~0.0.0", - "name": "jsonify", - "escapedName": "jsonify", - "rawSpec": "~0.0.0", - "saveSpec": null, - "fetchSpec": "~0.0.0" - }, - "_requiredBy": [ - "/json-stable-stringify", - "/shell-quote" - ], - "_resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "_shasum": "2c74b6ee41d93ca51b7b5aaee8f503631d252a73", - "_spec": "jsonify@~0.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/json-stable-stringify", - "author": { - "name": "Douglas Crockford", - "url": "http://crockford.com/" - }, - "bugs": { - "url": "https://github.com/substack/jsonify/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "JSON without touching any globals", - "devDependencies": { - "garbage": "0.0.x", - "tap": "0.0.x" - }, - "directories": { - "lib": ".", - "test": "test" - }, - "engines": { - "node": "*" - }, - "homepage": "https://github.com/substack/jsonify#readme", - "keywords": [ - "json", - "browser" - ], - "license": "Public Domain", - "main": "index.js", - "name": "jsonify", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/substack/jsonify.git" - }, - "scripts": { - "test": "tap test" - }, - "version": "0.0.0" -} diff --git a/node_modules/jsonify/test/parse.js b/node_modules/jsonify/test/parse.js deleted file mode 100644 index e2313f55a..000000000 --- a/node_modules/jsonify/test/parse.js +++ /dev/null @@ -1,16 +0,0 @@ -var test = require('tap').test; -var json = require('../'); -var garbage = require('garbage'); - -test('parse', function (t) { - for (var i = 0; i < 50; i++) { - var s = JSON.stringify(garbage(50)); - - t.deepEqual( - json.parse(s), - JSON.parse(s) - ); - } - - t.end(); -}); diff --git a/node_modules/jsonify/test/stringify.js b/node_modules/jsonify/test/stringify.js deleted file mode 100644 index 89b0b6703..000000000 --- a/node_modules/jsonify/test/stringify.js +++ /dev/null @@ -1,15 +0,0 @@ -var test = require('tap').test; -var json = require('../'); -var garbage = require('garbage'); - -test('stringify', function (t) { - for (var i = 0; i < 50; i++) { - var obj = garbage(50); - t.equal( - json.stringify(obj), - JSON.stringify(obj) - ); - } - - t.end(); -}); diff --git a/node_modules/jsonparse/.npmignore b/node_modules/jsonparse/.npmignore deleted file mode 100644 index b512c09d4..000000000 --- a/node_modules/jsonparse/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules \ No newline at end of file diff --git a/node_modules/jsonparse/LICENSE b/node_modules/jsonparse/LICENSE deleted file mode 100644 index 6dc24be5e..000000000 --- a/node_modules/jsonparse/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -The MIT License - -Copyright (c) 2012 Tim Caswell - -Permission is hereby granted, free of charge, -to any person obtaining a copy of this software and -associated documentation files (the "Software"), to -deal in the Software without restriction, including -without limitation the rights to use, copy, modify, -merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom -the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/jsonparse/README.markdown b/node_modules/jsonparse/README.markdown deleted file mode 100644 index 0f405d359..000000000 --- a/node_modules/jsonparse/README.markdown +++ /dev/null @@ -1,11 +0,0 @@ -This is a streaming JSON parser. For a simpler, sax-based version see this gist: https://gist.github.com/1821394 - -The MIT License (MIT) -Copyright (c) 2011-2012 Tim Caswell - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/node_modules/jsonparse/bench.js b/node_modules/jsonparse/bench.js deleted file mode 100644 index b36d92f7e..000000000 --- a/node_modules/jsonparse/bench.js +++ /dev/null @@ -1,26 +0,0 @@ -var fs = require('fs'), - Parser = require('./jsonparse'); - - -var json = fs.readFileSync("samplejson/basic.json"); - - -while (true) { - var start = Date.now(); - for (var i = 0; i < 1000; i++) { - JSON.parse(json); - } - var first = Date.now() - start; - - start = Date.now(); - var p = new Parser(); - for (var i = 0; i < 1000; i++) { - p.write(json); - } - var second = Date.now() - start; - - - console.log("JSON.parse took %s", first); - console.log("streaming parser took %s", second); - console.log("streaming is %s times slower", second / first); -} diff --git a/node_modules/jsonparse/examples/twitterfeed.js b/node_modules/jsonparse/examples/twitterfeed.js deleted file mode 100644 index 10210d470..000000000 --- a/node_modules/jsonparse/examples/twitterfeed.js +++ /dev/null @@ -1,30 +0,0 @@ -var Parser = require('../jsonparse'); -var Http = require('http'); -require('./colors'); -var p = new Parser(); -var cred = require('./credentials'); -var client = Http.createClient(80, "stream.twitter.com"); -var request = client.request("GET", "/1/statuses/sample.json", { - "Host": "stream.twitter.com", - "Authorization": (new Buffer(cred.username + ":" + cred.password)).toString("base64") -}); -request.on('response', function (response) { - console.log(response.statusCode); - console.dir(response.headers); - response.on('data', function (chunk) { - p.write(chunk); - }); - response.on('end', function () { - console.log("END"); - }); -}); -request.end(); -var text = "", name = ""; -p.onValue = function (value) { - if (this.stack.length === 1 && this.key === 'text') { text = value; } - if (this.stack.length === 2 && this.key === 'name' && this.stack[1].key === 'user') { name = value; } - if (this.stack.length === 0) { - console.log(text.blue + " - " + name.yellow); - text = name = ""; - } -}; diff --git a/node_modules/jsonparse/jsonparse.js b/node_modules/jsonparse/jsonparse.js deleted file mode 100644 index 39910608b..000000000 --- a/node_modules/jsonparse/jsonparse.js +++ /dev/null @@ -1,413 +0,0 @@ -/*global Buffer*/ -// Named constants with unique integer values -var C = {}; -// Tokens -var LEFT_BRACE = C.LEFT_BRACE = 0x1; -var RIGHT_BRACE = C.RIGHT_BRACE = 0x2; -var LEFT_BRACKET = C.LEFT_BRACKET = 0x3; -var RIGHT_BRACKET = C.RIGHT_BRACKET = 0x4; -var COLON = C.COLON = 0x5; -var COMMA = C.COMMA = 0x6; -var TRUE = C.TRUE = 0x7; -var FALSE = C.FALSE = 0x8; -var NULL = C.NULL = 0x9; -var STRING = C.STRING = 0xa; -var NUMBER = C.NUMBER = 0xb; -// Tokenizer States -var START = C.START = 0x11; -var STOP = C.STOP = 0x12; -var TRUE1 = C.TRUE1 = 0x21; -var TRUE2 = C.TRUE2 = 0x22; -var TRUE3 = C.TRUE3 = 0x23; -var FALSE1 = C.FALSE1 = 0x31; -var FALSE2 = C.FALSE2 = 0x32; -var FALSE3 = C.FALSE3 = 0x33; -var FALSE4 = C.FALSE4 = 0x34; -var NULL1 = C.NULL1 = 0x41; -var NULL2 = C.NULL2 = 0x42; -var NULL3 = C.NULL3 = 0x43; -var NUMBER1 = C.NUMBER1 = 0x51; -var NUMBER3 = C.NUMBER3 = 0x53; -var STRING1 = C.STRING1 = 0x61; -var STRING2 = C.STRING2 = 0x62; -var STRING3 = C.STRING3 = 0x63; -var STRING4 = C.STRING4 = 0x64; -var STRING5 = C.STRING5 = 0x65; -var STRING6 = C.STRING6 = 0x66; -// Parser States -var VALUE = C.VALUE = 0x71; -var KEY = C.KEY = 0x72; -// Parser Modes -var OBJECT = C.OBJECT = 0x81; -var ARRAY = C.ARRAY = 0x82; -// Character constants -var BACK_SLASH = "\\".charCodeAt(0); -var FORWARD_SLASH = "\/".charCodeAt(0); -var BACKSPACE = "\b".charCodeAt(0); -var FORM_FEED = "\f".charCodeAt(0); -var NEWLINE = "\n".charCodeAt(0); -var CARRIAGE_RETURN = "\r".charCodeAt(0); -var TAB = "\t".charCodeAt(0); - -var STRING_BUFFER_SIZE = 64 * 1024; - -function Parser() { - this.tState = START; - this.value = undefined; - - this.string = undefined; // string data - this.stringBuffer = Buffer.alloc ? Buffer.alloc(STRING_BUFFER_SIZE) : new Buffer(STRING_BUFFER_SIZE); - this.stringBufferOffset = 0; - this.unicode = undefined; // unicode escapes - this.highSurrogate = undefined; - - this.key = undefined; - this.mode = undefined; - this.stack = []; - this.state = VALUE; - this.bytes_remaining = 0; // number of bytes remaining in multi byte utf8 char to read after split boundary - this.bytes_in_sequence = 0; // bytes in multi byte utf8 char to read - this.temp_buffs = { "2": new Buffer(2), "3": new Buffer(3), "4": new Buffer(4) }; // for rebuilding chars split before boundary is reached - - // Stream offset - this.offset = -1; -} - -// Slow code to string converter (only used when throwing syntax errors) -Parser.toknam = function (code) { - var keys = Object.keys(C); - for (var i = 0, l = keys.length; i < l; i++) { - var key = keys[i]; - if (C[key] === code) { return key; } - } - return code && ("0x" + code.toString(16)); -}; - -var proto = Parser.prototype; -proto.onError = function (err) { throw err; }; -proto.charError = function (buffer, i) { - this.tState = STOP; - this.onError(new Error("Unexpected " + JSON.stringify(String.fromCharCode(buffer[i])) + " at position " + i + " in state " + Parser.toknam(this.tState))); -}; -proto.appendStringChar = function (char) { - if (this.stringBufferOffset >= STRING_BUFFER_SIZE) { - this.string += this.stringBuffer.toString('utf8'); - this.stringBufferOffset = 0; - } - - this.stringBuffer[this.stringBufferOffset++] = char; -}; -proto.appendStringBuf = function (buf, start, end) { - var size = buf.length; - if (typeof start === 'number') { - if (typeof end === 'number') { - if (end < 0) { - // adding a negative end decreeses the size - size = buf.length - start + end; - } else { - size = end - start; - } - } else { - size = buf.length - start; - } - } - - if (size < 0) { - size = 0; - } - - if (this.stringBufferOffset + size > STRING_BUFFER_SIZE) { - this.string += this.stringBuffer.toString('utf8', 0, this.stringBufferOffset); - this.stringBufferOffset = 0; - } - - buf.copy(this.stringBuffer, this.stringBufferOffset, start, end); - this.stringBufferOffset += size; -}; -proto.write = function (buffer) { - if (typeof buffer === "string") buffer = new Buffer(buffer); - var n; - for (var i = 0, l = buffer.length; i < l; i++) { - if (this.tState === START){ - n = buffer[i]; - this.offset++; - if(n === 0x7b){ this.onToken(LEFT_BRACE, "{"); // { - }else if(n === 0x7d){ this.onToken(RIGHT_BRACE, "}"); // } - }else if(n === 0x5b){ this.onToken(LEFT_BRACKET, "["); // [ - }else if(n === 0x5d){ this.onToken(RIGHT_BRACKET, "]"); // ] - }else if(n === 0x3a){ this.onToken(COLON, ":"); // : - }else if(n === 0x2c){ this.onToken(COMMA, ","); // , - }else if(n === 0x74){ this.tState = TRUE1; // t - }else if(n === 0x66){ this.tState = FALSE1; // f - }else if(n === 0x6e){ this.tState = NULL1; // n - }else if(n === 0x22){ // " - this.string = ""; - this.stringBufferOffset = 0; - this.tState = STRING1; - }else if(n === 0x2d){ this.string = "-"; this.tState = NUMBER1; // - - }else{ - if (n >= 0x30 && n < 0x40) { // 1-9 - this.string = String.fromCharCode(n); this.tState = NUMBER3; - } else if (n === 0x20 || n === 0x09 || n === 0x0a || n === 0x0d) { - // whitespace - } else { - return this.charError(buffer, i); - } - } - }else if (this.tState === STRING1){ // After open quote - n = buffer[i]; // get current byte from buffer - // check for carry over of a multi byte char split between data chunks - // & fill temp buffer it with start of this data chunk up to the boundary limit set in the last iteration - if (this.bytes_remaining > 0) { - for (var j = 0; j < this.bytes_remaining; j++) { - this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence - this.bytes_remaining + j] = buffer[j]; - } - - this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]); - this.bytes_in_sequence = this.bytes_remaining = 0; - i = i + j - 1; - } else if (this.bytes_remaining === 0 && n >= 128) { // else if no remainder bytes carried over, parse multi byte (>=128) chars one at a time - if (n <= 193 || n > 244) { - return this.onError(new Error("Invalid UTF-8 character at position " + i + " in state " + Parser.toknam(this.tState))); - } - if ((n >= 194) && (n <= 223)) this.bytes_in_sequence = 2; - if ((n >= 224) && (n <= 239)) this.bytes_in_sequence = 3; - if ((n >= 240) && (n <= 244)) this.bytes_in_sequence = 4; - if ((this.bytes_in_sequence + i) > buffer.length) { // if bytes needed to complete char fall outside buffer length, we have a boundary split - for (var k = 0; k <= (buffer.length - 1 - i); k++) { - this.temp_buffs[this.bytes_in_sequence][k] = buffer[i + k]; // fill temp buffer of correct size with bytes available in this chunk - } - this.bytes_remaining = (i + this.bytes_in_sequence) - buffer.length; - i = buffer.length - 1; - } else { - this.appendStringBuf(buffer, i, i + this.bytes_in_sequence); - i = i + this.bytes_in_sequence - 1; - } - } else if (n === 0x22) { - this.tState = START; - this.string += this.stringBuffer.toString('utf8', 0, this.stringBufferOffset); - this.stringBufferOffset = 0; - this.onToken(STRING, this.string); - this.offset += Buffer.byteLength(this.string, 'utf8') + 1; - this.string = undefined; - } - else if (n === 0x5c) { - this.tState = STRING2; - } - else if (n >= 0x20) { this.appendStringChar(n); } - else { - return this.charError(buffer, i); - } - }else if (this.tState === STRING2){ // After backslash - n = buffer[i]; - if(n === 0x22){ this.appendStringChar(n); this.tState = STRING1; - }else if(n === 0x5c){ this.appendStringChar(BACK_SLASH); this.tState = STRING1; - }else if(n === 0x2f){ this.appendStringChar(FORWARD_SLASH); this.tState = STRING1; - }else if(n === 0x62){ this.appendStringChar(BACKSPACE); this.tState = STRING1; - }else if(n === 0x66){ this.appendStringChar(FORM_FEED); this.tState = STRING1; - }else if(n === 0x6e){ this.appendStringChar(NEWLINE); this.tState = STRING1; - }else if(n === 0x72){ this.appendStringChar(CARRIAGE_RETURN); this.tState = STRING1; - }else if(n === 0x74){ this.appendStringChar(TAB); this.tState = STRING1; - }else if(n === 0x75){ this.unicode = ""; this.tState = STRING3; - }else{ - return this.charError(buffer, i); - } - }else if (this.tState === STRING3 || this.tState === STRING4 || this.tState === STRING5 || this.tState === STRING6){ // unicode hex codes - n = buffer[i]; - // 0-9 A-F a-f - if ((n >= 0x30 && n < 0x40) || (n > 0x40 && n <= 0x46) || (n > 0x60 && n <= 0x66)) { - this.unicode += String.fromCharCode(n); - if (this.tState++ === STRING6) { - var intVal = parseInt(this.unicode, 16); - this.unicode = undefined; - if (this.highSurrogate !== undefined && intVal >= 0xDC00 && intVal < (0xDFFF + 1)) { //<56320,57343> - lowSurrogate - this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate, intVal))); - this.highSurrogate = undefined; - } else if (this.highSurrogate === undefined && intVal >= 0xD800 && intVal < (0xDBFF + 1)) { //<55296,56319> - highSurrogate - this.highSurrogate = intVal; - } else { - if (this.highSurrogate !== undefined) { - this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate))); - this.highSurrogate = undefined; - } - this.appendStringBuf(new Buffer(String.fromCharCode(intVal))); - } - this.tState = STRING1; - } - } else { - return this.charError(buffer, i); - } - } else if (this.tState === NUMBER1 || this.tState === NUMBER3) { - n = buffer[i]; - - switch (n) { - case 0x30: // 0 - case 0x31: // 1 - case 0x32: // 2 - case 0x33: // 3 - case 0x34: // 4 - case 0x35: // 5 - case 0x36: // 6 - case 0x37: // 7 - case 0x38: // 8 - case 0x39: // 9 - case 0x2e: // . - case 0x65: // e - case 0x45: // E - case 0x2b: // + - case 0x2d: // - - this.string += String.fromCharCode(n); - this.tState = NUMBER3; - break; - default: - this.tState = START; - var result = Number(this.string); - - if (isNaN(result)){ - return this.charError(buffer, i); - } - - if ((this.string.match(/[0-9]+/) == this.string) && (result.toString() != this.string)) { - // Long string of digits which is an ID string and not valid and/or safe JavaScript integer Number - this.onToken(STRING, this.string); - } else { - this.onToken(NUMBER, result); - } - - this.offset += this.string.length - 1; - this.string = undefined; - i--; - break; - } - }else if (this.tState === TRUE1){ // r - if (buffer[i] === 0x72) { this.tState = TRUE2; } - else { return this.charError(buffer, i); } - }else if (this.tState === TRUE2){ // u - if (buffer[i] === 0x75) { this.tState = TRUE3; } - else { return this.charError(buffer, i); } - }else if (this.tState === TRUE3){ // e - if (buffer[i] === 0x65) { this.tState = START; this.onToken(TRUE, true); this.offset+= 3; } - else { return this.charError(buffer, i); } - }else if (this.tState === FALSE1){ // a - if (buffer[i] === 0x61) { this.tState = FALSE2; } - else { return this.charError(buffer, i); } - }else if (this.tState === FALSE2){ // l - if (buffer[i] === 0x6c) { this.tState = FALSE3; } - else { return this.charError(buffer, i); } - }else if (this.tState === FALSE3){ // s - if (buffer[i] === 0x73) { this.tState = FALSE4; } - else { return this.charError(buffer, i); } - }else if (this.tState === FALSE4){ // e - if (buffer[i] === 0x65) { this.tState = START; this.onToken(FALSE, false); this.offset+= 4; } - else { return this.charError(buffer, i); } - }else if (this.tState === NULL1){ // u - if (buffer[i] === 0x75) { this.tState = NULL2; } - else { return this.charError(buffer, i); } - }else if (this.tState === NULL2){ // l - if (buffer[i] === 0x6c) { this.tState = NULL3; } - else { return this.charError(buffer, i); } - }else if (this.tState === NULL3){ // l - if (buffer[i] === 0x6c) { this.tState = START; this.onToken(NULL, null); this.offset += 3; } - else { return this.charError(buffer, i); } - } - } -}; -proto.onToken = function (token, value) { - // Override this to get events -}; - -proto.parseError = function (token, value) { - this.tState = STOP; - this.onError(new Error("Unexpected " + Parser.toknam(token) + (value ? ("(" + JSON.stringify(value) + ")") : "") + " in state " + Parser.toknam(this.state))); -}; -proto.push = function () { - this.stack.push({value: this.value, key: this.key, mode: this.mode}); -}; -proto.pop = function () { - var value = this.value; - var parent = this.stack.pop(); - this.value = parent.value; - this.key = parent.key; - this.mode = parent.mode; - this.emit(value); - if (!this.mode) { this.state = VALUE; } -}; -proto.emit = function (value) { - if (this.mode) { this.state = COMMA; } - this.onValue(value); -}; -proto.onValue = function (value) { - // Override me -}; -proto.onToken = function (token, value) { - if(this.state === VALUE){ - if(token === STRING || token === NUMBER || token === TRUE || token === FALSE || token === NULL){ - if (this.value) { - this.value[this.key] = value; - } - this.emit(value); - }else if(token === LEFT_BRACE){ - this.push(); - if (this.value) { - this.value = this.value[this.key] = {}; - } else { - this.value = {}; - } - this.key = undefined; - this.state = KEY; - this.mode = OBJECT; - }else if(token === LEFT_BRACKET){ - this.push(); - if (this.value) { - this.value = this.value[this.key] = []; - } else { - this.value = []; - } - this.key = 0; - this.mode = ARRAY; - this.state = VALUE; - }else if(token === RIGHT_BRACE){ - if (this.mode === OBJECT) { - this.pop(); - } else { - return this.parseError(token, value); - } - }else if(token === RIGHT_BRACKET){ - if (this.mode === ARRAY) { - this.pop(); - } else { - return this.parseError(token, value); - } - }else{ - return this.parseError(token, value); - } - }else if(this.state === KEY){ - if (token === STRING) { - this.key = value; - this.state = COLON; - } else if (token === RIGHT_BRACE) { - this.pop(); - } else { - return this.parseError(token, value); - } - }else if(this.state === COLON){ - if (token === COLON) { this.state = VALUE; } - else { return this.parseError(token, value); } - }else if(this.state === COMMA){ - if (token === COMMA) { - if (this.mode === ARRAY) { this.key++; this.state = VALUE; } - else if (this.mode === OBJECT) { this.state = KEY; } - - } else if (token === RIGHT_BRACKET && this.mode === ARRAY || token === RIGHT_BRACE && this.mode === OBJECT) { - this.pop(); - } else { - return this.parseError(token, value); - } - }else{ - return this.parseError(token, value); - } -}; - -Parser.C = C; - -module.exports = Parser; diff --git a/node_modules/jsonparse/package.json b/node_modules/jsonparse/package.json deleted file mode 100644 index 1a30cda77..000000000 --- a/node_modules/jsonparse/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "_from": "jsonparse@^1.2.0", - "_id": "jsonparse@1.3.1", - "_inBundle": false, - "_integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", - "_location": "/jsonparse", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "jsonparse@^1.2.0", - "name": "jsonparse", - "escapedName": "jsonparse", - "rawSpec": "^1.2.0", - "saveSpec": null, - "fetchSpec": "^1.2.0" - }, - "_requiredBy": [ - "/JSONStream" - ], - "_resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "_shasum": "3f4dae4a91fac315f71062f8521cc239f1366280", - "_spec": "jsonparse@^1.2.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/JSONStream", - "author": { - "name": "Tim Caswell", - "email": "tim@creationix.com" - }, - "bugs": { - "url": "http://github.com/creationix/jsonparse/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "This is a pure-js JSON streaming parser for node.js", - "devDependencies": { - "tap": "~0.3.3", - "tape": "~0.1.1" - }, - "engines": [ - "node >= 0.2.0" - ], - "homepage": "https://github.com/creationix/jsonparse#readme", - "license": "MIT", - "main": "jsonparse.js", - "name": "jsonparse", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/creationix/jsonparse.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "tags": [ - "json", - "stream" - ], - "version": "1.3.1" -} diff --git a/node_modules/jsonparse/samplejson/basic.json b/node_modules/jsonparse/samplejson/basic.json deleted file mode 100644 index 950dff9e9..000000000 --- a/node_modules/jsonparse/samplejson/basic.json +++ /dev/null @@ -1,167 +0,0 @@ -[ - { - }, - { - "image": [ - {"shape": "rect", "fill": "#333", "stroke": "#999", "x": 0.5e+1, "y": 0.5, "z": 0.8e-0, "w": 0.5e5, "u": 2E10, "foo": 2E+1, "bar": 2E-0, "width": 47, "height": 47} - ], - "jumpable": 3, - "solid": { - "1": [2,4], - "2": [], - "3": [2,6], - "4": [], - "5": [2,8,1,3,7,9,4,6], - "6": [], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": true,"3": true,"7": true,"9": true} - }, - { - "image": [ - {"shape": "polygon", "fill": "#248", "stroke": "#48f", "points": [[0.5,47.5],[47.5,47.5],[47.5,0.5]]} - ], - "solid": { - "1": [2,4], - "2": [1], - "3": [2], - "4": [], - "5": [2,8,1,3,7,9,4,6], - "6": [], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": true,"3": true,"7": false,"9": true} - }, - { - "image": [ - {"shape": "polygon", "fill": "#248", "stroke": "#48f", "points": [[0.5,0.5],[47.5,47.5],[0.5,47.5]]} - ], - "solid": { - "1": [2], - "2": [3], - "3": [2,6], - "4": [], - "5": [2,8,1,3,7,9,4,6], - "6": [], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": true,"3": true,"7": true,"9": false} - }, - { - "image": [ - {"shape": "polygon", "fill": "#333", "stroke": "#999", "points": [[0.5,0.5],[47.5,47.5],[47.5,0.5]]} - ], - "jumpable": 3, - "solid": { - "1": [2,4], - "2": [], - "3": [2,6], - "4": [], - "5": [2,8,1,3,7,9,4,6], - "6": [3], - "7": [4,8], - "8": [7], - "9": [6,8] - }, - "corners": {"1": false,"3": true,"7": true,"9": true} - }, - { - "image": [ - {"shape": "polygon", "fill": "#333", "stroke": "#999", "points": [[0.5,0.5],[0.5,47.5],[47.5,0.5]]} - ], - "jumpable": 3, - "solid": { - "1": [2,4], - "2": [], - "3": [2,6], - "4": [1], - "5": [2,8,1,3,7,9,4,6], - "6": [], - "7": [4,8], - "8": [9], - "9": [6,8] - }, - "corners": {"1": true,"3": false,"7": true,"9": true} - }, - { - "image": [ - {"shape": "polygon", "fill": "#482", "stroke": "#8f4", "points": [[0.5,47.5],[0.5,23.5],[24.5,23.5],[24.5,0.5],[47.5,0.5],[47.5,47.5]]} - ], - "jumpable": 3, - "solid": { - "1": [2,4], - "2": [], - "3": [6,2], - "4": [], - "5": [2,8,1,3,7,9,4,6], - "6": [9], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": true,"3": true,"7": false,"9": true} - }, - { - "image": [ - {"shape": "polygon", "fill": "#482", "stroke": "#8f4", "points": [[0.5,0.5],[23.5,0.5],[23.5,24.5],[47.5,24.5],[47.5,47.5],[0.5,47.5]]} - ], - "jumpable": 3, - "solid": { - "1": [4,2], - "2": [], - "3": [2,6], - "4": [7], - "5": [2,8,1,3,7,9,4,6], - "6": [], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": true,"3": true,"7": true,"9": false} - }, - { - "image": [ - {"shape": "circle", "fill": "#ff0", "stroke": "#ff8", "cx": 24, "cy": 24, "r": 18} - ], - "item": true - }, - { - "image": [ - {"shape": "polygon", "fill": "#842", "stroke": "#f84", "points": [[4.5,0.5],[14.5,0.5],[14.5,17.5],[34,17.5],[33.5,0.5],[43.5,0.5],[43.5,47.5],[33.5,47.5],[33.5,30.5],[14.5,30.5],[14.5,47.5],[4.5,47.5]]} - ], - "jumpable": 3 - }, - { - "image": [ - {"shape": "polygon", "fill": "#333", "stroke": "#999", "points": [[0.5,0.5],[47.5,0.5],[24,47.5]]} - ], - "jumpable": 3, - "solid": { - "1": [2,4], - "2": [], - "3": [2,6], - "4": [1], - "5": [2,8,1,3,7,9,4,6], - "6": [3], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": false,"3": false,"7": true,"9": true} - }, - { - "image": [ - {"shape": "rect", "fill": "#114acb", "x": 0.5, "y": 0.5, "width": 47, "height": 47}, - {"shape": "polygon", "fill": "rgba(255,255,255,0.30)", "points": [[0.5,0.5],[47.5,0.5],[40,8],[8,8],[8,40],[0.5,47.5]]}, - {"shape": "polygon", "fill": "rgba(0,0,0,0.30)", "points": [[47.5,0.5],[48,48],[0.5,47.5],[8,40],[40,40],[40,8]]}, - {"shape": "polygon", "fill": "rgb(255,255,0)", "stroke": "rgba(255,255,0,0.5)", "points": [[24,9],[35,20],[26,29],[26,33],[22,33],[22,27],[29,20],[24,15],[16,23],[13,20]]}, - {"shape": "rect", "fill": "rgb(255,255,0)", "stroke": "rgba(255,255,0,0.5)", "x": 22, "y":35, "width": 4, "height": 4} - ] - } -] diff --git a/node_modules/jsonparse/samplejson/basic2.json b/node_modules/jsonparse/samplejson/basic2.json deleted file mode 100644 index 3a6919b2e..000000000 --- a/node_modules/jsonparse/samplejson/basic2.json +++ /dev/null @@ -1,180 +0,0 @@ -[ - { - }, - { - "image": [ - {"shape": "rect", "fill": "#333", "stroke": "#999", "x": 0.5, "y": 0.5, "width": 47, "height": 47} - ], - "jumpable": 3, - "solid": { - "1": [2,4], - "2": [], - "3": [2,6], - "4": [], - "5": [2,8,1,3,7,9,4,6], - "6": [], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": true,"3": true,"7": true,"9": true} - }, - { - "image": [ - {"shape": "polygon", "fill": "#248", "stroke": "#48f", "points": [[0.5,47.5],[47.5,47.5],[47.5,0.5]]} - ], - "solid": { - "1": [2,4], - "2": [1], - "3": [2], - "4": [], - "5": [2,8,1,3,7,9,4,6], - "6": [], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": true,"3": true,"7": false,"9": true} - }, - { - "image": [ - {"shape": "polygon", "fill": "#248", "stroke": "#48f", "points": [[0.5,0.5],[47.5,47.5],[0.5,47.5]]} - ], - "solid": { - "1": [2], - "2": [3], - "3": [2,6], - "4": [], - "5": [2,8,1,3,7,9,4,6], - "6": [], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": true,"3": true,"7": true,"9": false} - }, - { - "image": [ - {"shape": "polygon", "fill": "#333", "stroke": "#999", "points": [[0.5,0.5],[47.5,47.5],[47.5,0.5]]} - ], - "jumpable": 3, - "solid": { - "1": [2,4], - "2": [], - "3": [2,6], - "4": [], - "5": [2,8,1,3,7,9,4,6], - "6": [3], - "7": [4,8], - "8": [7], - "9": [6,8] - }, - "corners": {"1": false,"3": true,"7": true,"9": true} - }, - { - "image": [ - {"shape": "polygon", "fill": "#333", "stroke": "#999", "points": [[0.5,0.5],[0.5,47.5],[47.5,0.5]]} - ], - "jumpable": 3, - "solid": { - "1": [2,4], - "2": [], - "3": [2,6], - "4": [1], - "5": [2,8,1,3,7,9,4,6], - "6": [], - "7": [4,8], - "8": [9], - "9": [6,8] - }, - "corners": {"1": true,"3": false,"7": true,"9": true} - }, - { - "image": [ - {"shape": "polygon", "fill": "#482", "stroke": "#8f4", "points": [[0.5,47.5],[0.5,23.5],[24.5,23.5],[24.5,0.5],[47.5,0.5],[47.5,47.5]]} - ], - "jumpable": 3, - "solid": { - "1": [2,4], - "2": [], - "3": [6,2], - "4": [], - "5": [2,8,1,3,7,9,4,6], - "6": [9], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": true,"3": true,"7": false,"9": true} - }, - { - "image": [ - {"shape": "polygon", "fill": "#482", "stroke": "#8f4", "points": [[0.5,0.5],[23.5,0.5],[23.5,24.5],[47.5,24.5],[47.5,47.5],[0.5,47.5]]} - ], - "jumpable": 3, - "solid": { - "1": [4,2], - "2": [], - "3": [2,6], - "4": [7], - "5": [2,8,1,3,7,9,4,6], - "6": [], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": true,"3": true,"7": true,"9": false} - }, - { - "image": [ - {"shape": "circle", "fill": "#ff0", "stroke": "#ff8", "cx": 24, "cy": 24, "r": 18} - ], - "item": true - }, - { - "image": [ - {"shape": "polygon", "fill": "#842", "stroke": "#f84", "points": [[4.5,0.5],[14.5,0.5],[14.5,17.5],[34,17.5],[33.5,0.5],[43.5,0.5],[43.5,47.5],[33.5,47.5],[33.5,30.5],[14.5,30.5],[14.5,47.5],[4.5,47.5]]} - ], - "jumpable": 3 - }, - { - "image": [ - {"shape": "polygon", "fill": "#333", "stroke": "#999", "points": [[0.5,0.5],[47.5,0.5],[24,47.5]]} - ], - "jumpable": 3, - "solid": { - "1": [2,4], - "2": [], - "3": [2,6], - "4": [1], - "5": [2,8,1,3,7,9,4,6], - "6": [3], - "7": [4,8], - "8": [], - "9": [6,8] - }, - "corners": {"1": false,"3": false,"7": true,"9": true} - }, - { - "image": [ - {"shape": "rect", "fill": "#114acb", "x": 0.5, "y": 0.5, "width": 47, "height": 47}, - {"shape": "polygon", "fill": "rgba(255,255,255,0.30)", "points": [[0.5,0.5],[47.5,0.5],[40,8],[8,8],[8,40],[0.5,47.5]]}, - {"shape": "polygon", "fill": "rgba(0,0,0,0.30)", "points": [[47.5,0.5],[48,48],[0.5,47.5],[8,40],[40,40],[40,8]]}, - {"shape": "polygon", "fill": "rgb(255,255,0)", "stroke": "rgba(255,255,0,0.5)", "points": [[24,9],[35,20],[26,29],[26,33],[22,33],[22,27],[29,20],[24,15],[16,23],[13,20]]}, - {"shape": "rect", "fill": "rgb(255,255,0)", "stroke": "rgba(255,255,0,0.5)", "x": 22, "y":35, "width": 4, "height": 4} - ], - "item": true - }, - { - "image": [ - {"shape": "circle", "fill": "#80f", "stroke": "#88f", "cx": 24, "cy": 24, "r": 18} - ], - "item": true - }, - { - "image": [ - {"shape": "circle", "fill": "#4f4", "stroke": "#8f8", "cx": 24, "cy": 24, "r": 18} - ], - "item": true - } -] diff --git a/node_modules/jsonparse/test/big-token.js b/node_modules/jsonparse/test/big-token.js deleted file mode 100644 index 36046317e..000000000 --- a/node_modules/jsonparse/test/big-token.js +++ /dev/null @@ -1,24 +0,0 @@ -var stream = require('stream'); -var JsonParse = require('../jsonparse'); -var test = require('tape'); - -test('can handle large tokens without running out of memory', function (t) { - var parser = new JsonParse(); - var chunkSize = 1024; - var chunks = 1024 * 200; // 200mb - var quote = Buffer.from ? Buffer.from('"') : new Buffer('"'); - t.plan(1); - - parser.onToken = function (type, value) { - t.equal(value.length, chunkSize * chunks, 'token should be size of input json'); - t.end(); - }; - - parser.write(quote); - for (var i = 0; i < chunks; ++i) { - var buf = Buffer.alloc ? Buffer.alloc(chunkSize) : new Buffer(chunkSize); - buf.fill('a'); - parser.write(buf); - } - parser.write(quote); -}); diff --git a/node_modules/jsonparse/test/boundary.js b/node_modules/jsonparse/test/boundary.js deleted file mode 100644 index 6671f5f93..000000000 --- a/node_modules/jsonparse/test/boundary.js +++ /dev/null @@ -1,110 +0,0 @@ -var test = require('tape'); -var Parser = require('../'); - -test('2 byte utf8 \'De\' character: д', function (t) { - t.plan(1); - - var p = new Parser(); - p.onValue = function (value) { - t.equal(value, 'д'); - }; - - var de_buffer = new Buffer([0xd0, 0xb4]); - - p.write('"'); - p.write(de_buffer); - p.write('"'); - -}); - -test('3 byte utf8 \'Han\' character: 我', function (t) { - t.plan(1); - - var p = new Parser(); - p.onValue = function (value) { - t.equal(value, '我'); - }; - - var han_buffer = new Buffer([0xe6, 0x88, 0x91]); - p.write('"'); - p.write(han_buffer); - p.write('"'); -}); - -test('4 byte utf8 character (unicode scalar U+2070E): 𠜎', function (t) { - t.plan(1); - - var p = new Parser(); - p.onValue = function (value) { - t.equal(value, '𠜎'); - }; - - var Ux2070E_buffer = new Buffer([0xf0, 0xa0, 0x9c, 0x8e]); - p.write('"'); - p.write(Ux2070E_buffer); - p.write('"'); -}); - -test('3 byte utf8 \'Han\' character chunked inbetween 2nd and 3rd byte: 我', function (t) { - t.plan(1); - - var p = new Parser(); - p.onValue = function (value) { - t.equal(value, '我'); - }; - - var han_buffer_first = new Buffer([0xe6, 0x88]); - var han_buffer_second = new Buffer([0x91]); - p.write('"'); - p.write(han_buffer_first); - p.write(han_buffer_second); - p.write('"'); -}); - -test('4 byte utf8 character (unicode scalar U+2070E) chunked inbetween 2nd and 3rd byte: 𠜎', function (t) { - t.plan(1); - - var p = new Parser(); - p.onValue = function (value) { - t.equal(value, '𠜎'); - }; - - var Ux2070E_buffer_first = new Buffer([0xf0, 0xa0]); - var Ux2070E_buffer_second = new Buffer([0x9c, 0x8e]); - p.write('"'); - p.write(Ux2070E_buffer_first); - p.write(Ux2070E_buffer_second); - p.write('"'); -}); - -test('1-4 byte utf8 character string chunked inbetween random bytes: Aж文𠜱B', function (t) { - t.plan(1); - -var p = new Parser(); - p.onValue = function (value) { - t.equal(value, 'Aж文𠜱B'); - }; - - var eclectic_buffer = new Buffer([0x41, // A - 0xd0, 0xb6, // ж - 0xe6, 0x96, 0x87, // 文 - 0xf0, 0xa0, 0x9c, 0xb1, // 𠜱 - 0x42]); // B - - var rand_chunk = Math.floor(Math.random() * (eclectic_buffer.length)); - var first_buffer = eclectic_buffer.slice(0, rand_chunk); - var second_buffer = eclectic_buffer.slice(rand_chunk); - - //console.log('eclectic_buffer: ' + eclectic_buffer) - //console.log('sliced from 0 to ' + rand_chunk); - //console.log(first_buffer); - //console.log('then sliced from ' + rand_chunk + ' to the end'); - //console.log(second_buffer); - - console.log('chunked after offset ' + rand_chunk); - p.write('"'); - p.write(first_buffer); - p.write(second_buffer); - p.write('"'); - -}); \ No newline at end of file diff --git a/node_modules/jsonparse/test/offset.js b/node_modules/jsonparse/test/offset.js deleted file mode 100644 index 9a552ab05..000000000 --- a/node_modules/jsonparse/test/offset.js +++ /dev/null @@ -1,67 +0,0 @@ -var test = require('tape'); -var Parser = require('../'); - -var input = '{\n "string": "value",\n "number": 3,\n "object"'; -var input2 = ': {\n "key": "vд"\n },\n "array": [\n -1,\n 12\n ]\n '; -var input3 = '"null": null, "true": true, "false": false, "frac": 3.14 }'; - -var offsets = [ - [ 0, Parser.C.LEFT_BRACE ], - [ 4, Parser.C.STRING ], - [ 12, Parser.C.COLON ], - [ 14, Parser.C.STRING ], - [ 21, Parser.C.COMMA ], - [ 25, Parser.C.STRING ], - [ 33, Parser.C.COLON ], - [ 35, Parser.C.NUMBER ], - [ 36, Parser.C.COMMA ], - [ 40, Parser.C.STRING ], - [ 48, Parser.C.COLON ], - [ 50, Parser.C.LEFT_BRACE ], - [ 54, Parser.C.STRING ], - [ 59, Parser.C.COLON ], - [ 61, Parser.C.STRING ], - [ 69, Parser.C.RIGHT_BRACE ], - [ 70, Parser.C.COMMA ], - [ 74, Parser.C.STRING ], - [ 81, Parser.C.COLON ], - [ 83, Parser.C.LEFT_BRACKET ], - [ 87, Parser.C.NUMBER ], - [ 89, Parser.C.COMMA ], - [ 93, Parser.C.NUMBER ], - [ 98, Parser.C.RIGHT_BRACKET ], - [ 102, Parser.C.STRING ], - [ 108, Parser.C.COLON ], - [ 110, Parser.C.NULL ], - [ 114, Parser.C.COMMA ], - [ 116, Parser.C.STRING ], - [ 122, Parser.C.COLON ], - [ 124, Parser.C.TRUE ], - [ 128, Parser.C.COMMA ], - [ 130, Parser.C.STRING ], - [ 137, Parser.C.COLON ], - [ 139, Parser.C.FALSE ], - [ 144, Parser.C.COMMA ], - [ 146, Parser.C.STRING ], - [ 152, Parser.C.COLON ], - [ 154, Parser.C.NUMBER ], - [ 159, Parser.C.RIGHT_BRACE ] -]; - -test('offset', function(t) { - t.plan(offsets.length * 2 + 1); - - var p = new Parser(); - var i = 0; - p.onToken = function (token) { - t.equal(p.offset, offsets[i][0]); - t.equal(token, offsets[i][1]); - i++; - }; - - p.write(input); - p.write(input2); - p.write(input3); - - t.equal(i, offsets.length); -}); diff --git a/node_modules/jsonparse/test/primitives.js b/node_modules/jsonparse/test/primitives.js deleted file mode 100644 index 33cae169a..000000000 --- a/node_modules/jsonparse/test/primitives.js +++ /dev/null @@ -1,57 +0,0 @@ -var test = require('tape'); -var Parser = require('../'); - -var expected = [ - [ [], '' ], - [ [], 'Hello' ], - [ [], 'This"is' ], - [ [], '\r\n\f\t\\/"' ], - [ [], 'Λάμβδα' ], - [ [], '\\' ], - [ [], '/' ], - [ [], '"' ], - [ [ 0 ], 0 ], - [ [ 1 ], 1 ], - [ [ 2 ], -1 ], - [ [], [ 0, 1, -1 ] ], - [ [ 0 ], 1 ], - [ [ 1 ], 1.1 ], - [ [ 2 ], -1.1 ], - [ [ 3 ], -1 ], - [ [], [ 1, 1.1, -1.1, -1 ] ], - [ [ 0 ], -1 ], - [ [], [ -1 ] ], - [ [ 0 ], -0.1 ], - [ [], [ -0.1 ] ], - [ [ 0 ], 6.02e+23 ], - [ [], [ 6.02e+23 ] ], - [ [ 0 ], '7161093205057351174' ], - [ [], [ '7161093205057351174'] ] -]; - -test('primitives', function (t) { - t.plan(25); - - var p = new Parser(); - p.onValue = function (value) { - var keys = this.stack - .slice(1) - .map(function (item) { return item.key }) - .concat(this.key !== undefined ? this.key : []) - ; - t.deepEqual( - [ keys, value ], - expected.shift() - ); - }; - - p.write('"""Hello""This\\"is""\\r\\n\\f\\t\\\\\\/\\""'); - p.write('"\\u039b\\u03ac\\u03bc\\u03b2\\u03b4\\u03b1"'); - p.write('"\\\\"'); - p.write('"\\/"'); - p.write('"\\""'); - p.write('[0,1,-1]'); - p.write('[1.0,1.1,-1.1,-1.0][-1][-0.1]'); - p.write('[6.02e23]'); - p.write('[7161093205057351174]'); -}); diff --git a/node_modules/jsonparse/test/surrogate.js b/node_modules/jsonparse/test/surrogate.js deleted file mode 100644 index c048f3706..000000000 --- a/node_modules/jsonparse/test/surrogate.js +++ /dev/null @@ -1,26 +0,0 @@ -var test = require('tape'); -var Parser = require('../'); - -test('parse surrogate pair', function (t) { - t.plan(1); - - var p = new Parser(); - p.onValue = function (value) { - t.equal(value, '😋'); - }; - - p.write('"\\uD83D\\uDE0B"'); -}); - -test('parse chunked surrogate pair', function (t) { - t.plan(1); - - var p = new Parser(); - p.onValue = function (value) { - t.equal(value, '😋'); - }; - - p.write('"\\uD83D'); - p.write('\\uDE0B"'); -}); - diff --git a/node_modules/jsonparse/test/unvalid.js b/node_modules/jsonparse/test/unvalid.js deleted file mode 100644 index 7715cc0ef..000000000 --- a/node_modules/jsonparse/test/unvalid.js +++ /dev/null @@ -1,15 +0,0 @@ -var test = require('tape'); -var Parser = require('../'); - -test('unvalid', function (t) { - var count = 0; - - var p = new Parser(); - p.onError = function (value) { - count++; - t.equal(1, count); - t.end(); - }; - - p.write('{"test": eer['); -}); diff --git a/node_modules/jsonparse/test/utf8.js b/node_modules/jsonparse/test/utf8.js deleted file mode 100644 index 6cb842f3e..000000000 --- a/node_modules/jsonparse/test/utf8.js +++ /dev/null @@ -1,38 +0,0 @@ -var test = require('tape'); -var Parser = require('../'); - -test('3 bytes of utf8', function (t) { - t.plan(1); - - var p = new Parser(); - p.onValue = function (value) { - t.equal(value, '├──'); - }; - - p.write('"├──"'); -}); - -test('utf8 snowman', function (t) { - t.plan(1); - - var p = new Parser(); - p.onValue = function (value) { - t.equal(value, '☃'); - }; - - p.write('"☃"'); -}); - -test('utf8 with regular ascii', function (t) { - t.plan(4); - - var p = new Parser(); - var expected = [ "snow: ☃!", "xyz", "¡que!" ]; - expected.push(expected.slice()); - - p.onValue = function (value) { - t.deepEqual(value, expected.shift()); - }; - - p.write('["snow: ☃!","xyz","¡que!"]'); -}); diff --git a/node_modules/kind-of/LICENSE b/node_modules/kind-of/LICENSE deleted file mode 100644 index d734237bd..000000000 --- a/node_modules/kind-of/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/kind-of/README.md b/node_modules/kind-of/README.md deleted file mode 100644 index 6a9df36d3..000000000 --- a/node_modules/kind-of/README.md +++ /dev/null @@ -1,261 +0,0 @@ -# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) - -> Get the native type of a value. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save kind-of -``` - -## Install - -Install with [bower](https://bower.io/) - -```sh -$ bower install kind-of --save -``` - -## Usage - -> es5, browser and es6 ready - -```js -var kindOf = require('kind-of'); - -kindOf(undefined); -//=> 'undefined' - -kindOf(null); -//=> 'null' - -kindOf(true); -//=> 'boolean' - -kindOf(false); -//=> 'boolean' - -kindOf(new Boolean(true)); -//=> 'boolean' - -kindOf(new Buffer('')); -//=> 'buffer' - -kindOf(42); -//=> 'number' - -kindOf(new Number(42)); -//=> 'number' - -kindOf('str'); -//=> 'string' - -kindOf(new String('str')); -//=> 'string' - -kindOf(arguments); -//=> 'arguments' - -kindOf({}); -//=> 'object' - -kindOf(Object.create(null)); -//=> 'object' - -kindOf(new Test()); -//=> 'object' - -kindOf(new Date()); -//=> 'date' - -kindOf([]); -//=> 'array' - -kindOf([1, 2, 3]); -//=> 'array' - -kindOf(new Array()); -//=> 'array' - -kindOf(/foo/); -//=> 'regexp' - -kindOf(new RegExp('foo')); -//=> 'regexp' - -kindOf(function () {}); -//=> 'function' - -kindOf(function * () {}); -//=> 'function' - -kindOf(new Function()); -//=> 'function' - -kindOf(new Map()); -//=> 'map' - -kindOf(new WeakMap()); -//=> 'weakmap' - -kindOf(new Set()); -//=> 'set' - -kindOf(new WeakSet()); -//=> 'weakset' - -kindOf(Symbol('str')); -//=> 'symbol' - -kindOf(new Int8Array()); -//=> 'int8array' - -kindOf(new Uint8Array()); -//=> 'uint8array' - -kindOf(new Uint8ClampedArray()); -//=> 'uint8clampedarray' - -kindOf(new Int16Array()); -//=> 'int16array' - -kindOf(new Uint16Array()); -//=> 'uint16array' - -kindOf(new Int32Array()); -//=> 'int32array' - -kindOf(new Uint32Array()); -//=> 'uint32array' - -kindOf(new Float32Array()); -//=> 'float32array' - -kindOf(new Float64Array()); -//=> 'float64array' -``` - -## Benchmarks - -Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). -Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `WeakSet`. - -```bash -#1: array - current x 23,329,397 ops/sec ±0.82% (94 runs sampled) - lib-type-of x 4,170,273 ops/sec ±0.55% (94 runs sampled) - lib-typeof x 9,686,935 ops/sec ±0.59% (98 runs sampled) - -#2: boolean - current x 27,197,115 ops/sec ±0.85% (94 runs sampled) - lib-type-of x 3,145,791 ops/sec ±0.73% (97 runs sampled) - lib-typeof x 9,199,562 ops/sec ±0.44% (99 runs sampled) - -#3: date - current x 20,190,117 ops/sec ±0.86% (92 runs sampled) - lib-type-of x 5,166,970 ops/sec ±0.74% (94 runs sampled) - lib-typeof x 9,610,821 ops/sec ±0.50% (96 runs sampled) - -#4: function - current x 23,855,460 ops/sec ±0.60% (97 runs sampled) - lib-type-of x 5,667,740 ops/sec ±0.54% (100 runs sampled) - lib-typeof x 10,010,644 ops/sec ±0.44% (100 runs sampled) - -#5: null - current x 27,061,047 ops/sec ±0.97% (96 runs sampled) - lib-type-of x 13,965,573 ops/sec ±0.62% (97 runs sampled) - lib-typeof x 8,460,194 ops/sec ±0.61% (97 runs sampled) - -#6: number - current x 25,075,682 ops/sec ±0.53% (99 runs sampled) - lib-type-of x 2,266,405 ops/sec ±0.41% (98 runs sampled) - lib-typeof x 9,821,481 ops/sec ±0.45% (99 runs sampled) - -#7: object - current x 3,348,980 ops/sec ±0.49% (99 runs sampled) - lib-type-of x 3,245,138 ops/sec ±0.60% (94 runs sampled) - lib-typeof x 9,262,952 ops/sec ±0.59% (99 runs sampled) - -#8: regex - current x 21,284,827 ops/sec ±0.72% (96 runs sampled) - lib-type-of x 4,689,241 ops/sec ±0.43% (100 runs sampled) - lib-typeof x 8,957,593 ops/sec ±0.62% (98 runs sampled) - -#9: string - current x 25,379,234 ops/sec ±0.58% (96 runs sampled) - lib-type-of x 3,635,148 ops/sec ±0.76% (93 runs sampled) - lib-typeof x 9,494,134 ops/sec ±0.49% (98 runs sampled) - -#10: undef - current x 27,459,221 ops/sec ±1.01% (93 runs sampled) - lib-type-of x 14,360,433 ops/sec ±0.52% (99 runs sampled) - lib-typeof x 23,202,868 ops/sec ±0.59% (94 runs sampled) - -``` - -## Optimizations - -In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: - -1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. -2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. -3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` - -## About - -### Related projects - -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") -* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") -* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 59 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [miguelmota](https://github.com/miguelmota) | -| 1 | [dtothefp](https://github.com/dtothefp) | -| 1 | [ksheedlo](https://github.com/ksheedlo) | -| 1 | [pdehaan](https://github.com/pdehaan) | -| 1 | [laggingreflex](https://github.com/laggingreflex) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 16, 2017._ \ No newline at end of file diff --git a/node_modules/kind-of/index.js b/node_modules/kind-of/index.js deleted file mode 100644 index b52c2917f..000000000 --- a/node_modules/kind-of/index.js +++ /dev/null @@ -1,116 +0,0 @@ -var isBuffer = require('is-buffer'); -var toString = Object.prototype.toString; - -/** - * Get the native `typeof` a value. - * - * @param {*} `val` - * @return {*} Native javascript type - */ - -module.exports = function kindOf(val) { - // primitivies - if (typeof val === 'undefined') { - return 'undefined'; - } - if (val === null) { - return 'null'; - } - if (val === true || val === false || val instanceof Boolean) { - return 'boolean'; - } - if (typeof val === 'string' || val instanceof String) { - return 'string'; - } - if (typeof val === 'number' || val instanceof Number) { - return 'number'; - } - - // functions - if (typeof val === 'function' || val instanceof Function) { - return 'function'; - } - - // array - if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { - return 'array'; - } - - // check for instances of RegExp and Date before calling `toString` - if (val instanceof RegExp) { - return 'regexp'; - } - if (val instanceof Date) { - return 'date'; - } - - // other objects - var type = toString.call(val); - - if (type === '[object RegExp]') { - return 'regexp'; - } - if (type === '[object Date]') { - return 'date'; - } - if (type === '[object Arguments]') { - return 'arguments'; - } - if (type === '[object Error]') { - return 'error'; - } - - // buffer - if (isBuffer(val)) { - return 'buffer'; - } - - // es6: Map, WeakMap, Set, WeakSet - if (type === '[object Set]') { - return 'set'; - } - if (type === '[object WeakSet]') { - return 'weakset'; - } - if (type === '[object Map]') { - return 'map'; - } - if (type === '[object WeakMap]') { - return 'weakmap'; - } - if (type === '[object Symbol]') { - return 'symbol'; - } - - // typed arrays - if (type === '[object Int8Array]') { - return 'int8array'; - } - if (type === '[object Uint8Array]') { - return 'uint8array'; - } - if (type === '[object Uint8ClampedArray]') { - return 'uint8clampedarray'; - } - if (type === '[object Int16Array]') { - return 'int16array'; - } - if (type === '[object Uint16Array]') { - return 'uint16array'; - } - if (type === '[object Int32Array]') { - return 'int32array'; - } - if (type === '[object Uint32Array]') { - return 'uint32array'; - } - if (type === '[object Float32Array]') { - return 'float32array'; - } - if (type === '[object Float64Array]') { - return 'float64array'; - } - - // must be a plain object - return 'object'; -}; diff --git a/node_modules/kind-of/package.json b/node_modules/kind-of/package.json deleted file mode 100644 index a522e8890..000000000 --- a/node_modules/kind-of/package.json +++ /dev/null @@ -1,146 +0,0 @@ -{ - "_from": "kind-of@^3.0.2", - "_id": "kind-of@3.2.2", - "_inBundle": false, - "_integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "_location": "/kind-of", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "kind-of@^3.0.2", - "name": "kind-of", - "escapedName": "kind-of", - "rawSpec": "^3.0.2", - "saveSpec": null, - "fetchSpec": "^3.0.2" - }, - "_requiredBy": [ - "/is-accessor-descriptor", - "/is-data-descriptor", - "/is-number", - "/micromatch", - "/object-copy", - "/snapdragon-util", - "/to-object-path", - "/to-regex-range/is-number" - ], - "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "_shasum": "31ea21a734bab9bbb0f32466d893aea51e4a3c64", - "_spec": "kind-of@^3.0.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/micromatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/kind-of/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "David Fox-Powell", - "url": "https://dtothefp.github.io/me" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Ken Sheedlo", - "url": "kensheedlo.com" - }, - { - "name": "laggingreflex", - "url": "https://github.com/laggingreflex" - }, - { - "name": "Miguel Mota", - "url": "https://miguelmota.com" - }, - { - "name": "Peter deHaan", - "url": "http://about.me/peterdehaan" - } - ], - "dependencies": { - "is-buffer": "^1.1.5" - }, - "deprecated": false, - "description": "Get the native type of a value.", - "devDependencies": { - "ansi-bold": "^0.1.1", - "benchmarked": "^1.0.0", - "browserify": "^14.3.0", - "glob": "^7.1.1", - "gulp-format-md": "^0.1.12", - "mocha": "^3.3.0", - "type-of": "^2.0.1", - "typeof": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/kind-of", - "keywords": [ - "arguments", - "array", - "boolean", - "check", - "date", - "function", - "is", - "is-type", - "is-type-of", - "kind", - "kind-of", - "number", - "object", - "of", - "regexp", - "string", - "test", - "type", - "type-of", - "typeof", - "types" - ], - "license": "MIT", - "main": "index.js", - "name": "kind-of", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/kind-of.git" - }, - "scripts": { - "prepublish": "browserify -o browser.js -e index.js -s index --bare", - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "is-glob", - "is-number", - "is-primitive" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "verb" - ] - }, - "version": "3.2.2" -} diff --git a/node_modules/labeled-stream-splicer/.travis.yml b/node_modules/labeled-stream-splicer/.travis.yml deleted file mode 100644 index 9672e1293..000000000 --- a/node_modules/labeled-stream-splicer/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" -before_install: - - npm install -g npm@~1.4.6 diff --git a/node_modules/labeled-stream-splicer/LICENSE b/node_modules/labeled-stream-splicer/LICENSE deleted file mode 100644 index ee27ba4b4..000000000 --- a/node_modules/labeled-stream-splicer/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/labeled-stream-splicer/example/browser/bar.js b/node_modules/labeled-stream-splicer/example/browser/bar.js deleted file mode 100644 index c57fa530a..000000000 --- a/node_modules/labeled-stream-splicer/example/browser/bar.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function (n) { - return n * 100; -}; diff --git a/node_modules/labeled-stream-splicer/example/browser/foo.js b/node_modules/labeled-stream-splicer/example/browser/foo.js deleted file mode 100644 index c62e63856..000000000 --- a/node_modules/labeled-stream-splicer/example/browser/foo.js +++ /dev/null @@ -1,5 +0,0 @@ -var bar = require('./bar'); - -module.exports = function (n) { - return n * 111 + bar(n); -}; diff --git a/node_modules/labeled-stream-splicer/example/browser/main.js b/node_modules/labeled-stream-splicer/example/browser/main.js deleted file mode 100644 index 8c71d7997..000000000 --- a/node_modules/labeled-stream-splicer/example/browser/main.js +++ /dev/null @@ -1,2 +0,0 @@ -var foo = require('./foo'); -console.log('main: ' + foo(5)); diff --git a/node_modules/labeled-stream-splicer/example/browser/xyz.js b/node_modules/labeled-stream-splicer/example/browser/xyz.js deleted file mode 100644 index dff6877a8..000000000 --- a/node_modules/labeled-stream-splicer/example/browser/xyz.js +++ /dev/null @@ -1,2 +0,0 @@ -var foo = require('./foo'); -console.log('xyz: ' + foo(6)); diff --git a/node_modules/labeled-stream-splicer/example/bundle.js b/node_modules/labeled-stream-splicer/example/bundle.js deleted file mode 100644 index 06f119d86..000000000 --- a/node_modules/labeled-stream-splicer/example/bundle.js +++ /dev/null @@ -1,16 +0,0 @@ -var splicer = require('../'); -var through = require('through2'); -var deps = require('module-deps'); -var pack = require('browser-pack'); - -var pipeline = splicer.obj([ - 'deps', [ deps(__dirname + '/browser/main.js') ], - 'pack', [ pack({ raw: true }) ], - process.stdout -]); - -pipeline.get('deps').push(through.obj(function (row, enc, next) { - row.source = row.source.toUpperCase(); - this.push(row); - next(); -})); diff --git a/node_modules/labeled-stream-splicer/index.js b/node_modules/labeled-stream-splicer/index.js deleted file mode 100644 index 59a93b272..000000000 --- a/node_modules/labeled-stream-splicer/index.js +++ /dev/null @@ -1,65 +0,0 @@ -var Splicer = require('stream-splicer'); -var inherits = require('inherits'); -var isarray = require('isarray'); - -module.exports = Labeled; -inherits(Labeled, Splicer); - -module.exports.obj = function (streams, opts) { - if (!opts) opts = {}; - opts.objectMode = true; - return new Labeled(streams, opts); -}; - -function Labeled (streams, opts) { - if (!(this instanceof Labeled)) return new Labeled(streams, opts); - Splicer.call(this, [], opts); - - var reps = []; - for (var i = 0; i < streams.length; i++) { - var s = streams[i]; - if (typeof s === 'string') continue; - if (isarray(s)) { - s = new Labeled(s, opts); - } - if (i >= 0 && typeof streams[i-1] === 'string') { - s.label = streams[i-1]; - } - reps.push(s); - } - if (typeof streams[i-1] === 'string') { - reps.push(new Labeled([], opts)); - } - this.splice.apply(this, [0,0].concat(reps)); -} - -Labeled.prototype.indexOf = function (stream) { - if (typeof stream === 'string') { - for (var i = 0; i < this._streams.length; i++) { - if (this._streams[i].label === stream) return i; - } - return -1; - } - else { - return Splicer.prototype.indexOf.call(this, stream); - } -}; - -Labeled.prototype.get = function (key) { - if (typeof key === 'string') { - var ix = this.indexOf(key); - if (ix < 0) return undefined; - return this._streams[ix]; - } - else return Splicer.prototype.get.call(this, key); -}; - -Labeled.prototype.splice = function (key) { - var ix; - if (typeof key === 'string') { - ix = this.indexOf(key); - } - else ix = key; - var args = [ ix ].concat([].slice.call(arguments, 1)); - return Splicer.prototype.splice.apply(this, args); -}; diff --git a/node_modules/labeled-stream-splicer/node_modules/isarray/README.md b/node_modules/labeled-stream-splicer/node_modules/isarray/README.md deleted file mode 100644 index 9c681fa2f..000000000 --- a/node_modules/labeled-stream-splicer/node_modules/isarray/README.md +++ /dev/null @@ -1,62 +0,0 @@ - -# isarray - -`Array#isArray` for older browsers and deprecated Node.js versions. - -[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray) -[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray) - -[![browser support](https://ci.testling.com/juliangruber/isarray.png) -](https://ci.testling.com/juliangruber/isarray) - -__Just use Array.isArray directly__, unless you need to support those older versions. - -## Usage - -```js -var isArray = require('isarray'); - -console.log(isArray([])); // => true -console.log(isArray({})); // => false -``` - -## Installation - -With [npm](https://npmjs.org) do - -```bash -$ npm install isarray -``` - -Then bundle for the browser with -[browserify](https://github.com/substack/node-browserify). - -## Sponsors - -This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! - -Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/labeled-stream-splicer/node_modules/isarray/index.js b/node_modules/labeled-stream-splicer/node_modules/isarray/index.js deleted file mode 100644 index a57f63495..000000000 --- a/node_modules/labeled-stream-splicer/node_modules/isarray/index.js +++ /dev/null @@ -1,5 +0,0 @@ -var toString = {}.toString; - -module.exports = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; -}; diff --git a/node_modules/labeled-stream-splicer/node_modules/isarray/package.json b/node_modules/labeled-stream-splicer/node_modules/isarray/package.json deleted file mode 100644 index 41a615986..000000000 --- a/node_modules/labeled-stream-splicer/node_modules/isarray/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "_from": "isarray@^2.0.4", - "_id": "isarray@2.0.4", - "_inBundle": false, - "_integrity": "sha512-GMxXOiUirWg1xTKRipM0Ek07rX+ubx4nNVElTJdNLYmNO/2YrDkgJGw9CljXn+r4EWiDQg/8lsRdHyg2PJuUaA==", - "_location": "/labeled-stream-splicer/isarray", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "isarray@^2.0.4", - "name": "isarray", - "escapedName": "isarray", - "rawSpec": "^2.0.4", - "saveSpec": null, - "fetchSpec": "^2.0.4" - }, - "_requiredBy": [ - "/labeled-stream-splicer" - ], - "_resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.4.tgz", - "_shasum": "38e7bcbb0f3ba1b7933c86ba1894ddfc3781bbb7", - "_spec": "isarray@^2.0.4", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/labeled-stream-splicer", - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "bugs": { - "url": "https://github.com/juliangruber/isarray/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Array#isArray for older browsers", - "devDependencies": { - "tape": "~2.13.4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/juliangruber/isarray", - "keywords": [ - "browser", - "isarray", - "array" - ], - "license": "MIT", - "main": "index.js", - "name": "isarray", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/isarray.git" - }, - "scripts": { - "test": "tape test.js" - }, - "testling": { - "files": "test.js", - "browsers": [ - "ie/8..latest", - "firefox/17..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "version": "2.0.4" -} diff --git a/node_modules/labeled-stream-splicer/package.json b/node_modules/labeled-stream-splicer/package.json deleted file mode 100644 index 84d1c7a7d..000000000 --- a/node_modules/labeled-stream-splicer/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "_from": "labeled-stream-splicer@^2.0.0", - "_id": "labeled-stream-splicer@2.0.1", - "_inBundle": false, - "_integrity": "sha512-MC94mHZRvJ3LfykJlTUipBqenZz1pacOZEMhhQ8dMGcDHs0SBE5GbsavUXV7YtP3icBW17W0Zy1I0lfASmo9Pg==", - "_location": "/labeled-stream-splicer", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "labeled-stream-splicer@^2.0.0", - "name": "labeled-stream-splicer", - "escapedName": "labeled-stream-splicer", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/browserify" - ], - "_resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.1.tgz", - "_shasum": "9cffa32fd99e1612fd1d86a8db962416d5292926", - "_spec": "labeled-stream-splicer@^2.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/labeled-stream-splicer/issues" - }, - "bundleDependencies": false, - "dependencies": { - "inherits": "^2.0.1", - "isarray": "^2.0.4", - "stream-splicer": "^2.0.0" - }, - "deprecated": false, - "description": "stream splicer with labels", - "devDependencies": { - "browser-pack": "^2.0.1", - "concat-stream": "^1.4.6", - "module-deps": "^2.1.2", - "tape": "^2.12.1", - "through2": "^1.0.0" - }, - "homepage": "https://github.com/substack/labeled-stream-splicer", - "keywords": [ - "splice", - "stream", - "labels", - "mutable", - "pipeline" - ], - "license": "MIT", - "main": "index.js", - "name": "labeled-stream-splicer", - "repository": { - "type": "git", - "url": "git://github.com/substack/labeled-stream-splicer.git" - }, - "scripts": { - "test": "tape test/*.js" - }, - "version": "2.0.1" -} diff --git a/node_modules/labeled-stream-splicer/readme.markdown b/node_modules/labeled-stream-splicer/readme.markdown deleted file mode 100644 index c8e08e20d..000000000 --- a/node_modules/labeled-stream-splicer/readme.markdown +++ /dev/null @@ -1,124 +0,0 @@ -# labeled-stream-splicer - -[stream splicer](https://npmjs.org/package/stream-splicer) with labels - -[![build status](https://secure.travis-ci.org/substack/labeled-stream-splicer.png)](http://travis-ci.org/substack/labeled-stream-splicer) - -# example - -Here's an example that exposes a label for `deps` and `pack`: - -``` js -var splicer = require('labeled-stream-splicer'); -var through = require('through2'); -var deps = require('module-deps'); -var pack = require('browser-pack'); -var lstream = require('lstream'); - -var pipeline = splicer.obj([ - 'deps', [ deps() ], - 'pack', [ pack({ raw: true }) ] -]); - -pipeline.get('deps').unshift(lstream()); - -pipeline.get('deps').push(through.obj(function (row, enc, next) { - row.source = row.source.toUpperCase(); - this.push(row); - next(); -})); - -process.stdin.pipe(pipeline).pipe(process.stdout); -``` - -Here the `deps` sub-pipeline is augmented with a post-transformation that -uppercases its source input. - -# methods - -``` js -var splicer = require('labeled-stream-splicer') -``` - -The API is the same as -[stream-splicer](https://npmjs.org/package/stream-splicer), -except that `pipeline.get()`, `pipeline.splice()`, and `pipeline.indexOf()` can -accept string labels in addition to numeric indexes. - -## var pipeline = splicer(streams, opts) - -Create a `pipeline` duplex stream given an array of `streams`. Each `stream` -will be piped to the next. Writes to `pipeline` get written to the first stream -and data for reads from `pipeline` come from the last stream. - -To signify a label, a stream may have a `.label` property or a string may be -placed in the `streams` array. - -For example, for streams `[ a, 'foo', b, c, 'bar', d ]`, this pipeline is -constructed internally: - -``` -a.pipe(b).pipe(c).pipe(d) -``` - -with a label `'foo`' that points to `b` and a label `'bar'` that points to `d`. -If `a` or `c` has a `.label` property, that label would be used for addressing. - -Input will get written into `a`. Output will be read from `d`. - -If any of the elements in `streams` are arrays, they will be converted into -nested labeled pipelines. This is useful if you want to expose a hookable -pipeline with grouped insertion points. - -## var pipeline = splicer.obj(streams, opts) - -Create a `pipeline` with `opts.objectMode` set to true for convenience. - -## var removed = pipeline.splice(index, howMany, stream, ...) - -Splice the pipeline starting at `index`, removing `howMany` streams and -replacing them with each additional `stream` argument provided. - -The streams that were removed from the splice and returned. - -`index` can be an integer index or a label. - -## pipeline.push(stream, ...) - -Push one or more streams to the end of the pipeline. - -The stream arguments may have a `label` property that will be used for string -lookups. - -## var stream = pipeline.pop() - -Pop a stream from the end of the pipeline. - -## pipeline.unshift(stream, ...) - -Unshift one or more streams to the begining of the pipeline. - -The stream arguments may have a `label` property that will be used for string -lookups. - -## var stream = pipeline.shift() - -Shift a stream from the begining of the pipeline. - -## var stream = pipeline.get(index) - -Return the stream at index `index`. - -`index` can be an integer or a string label. - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install labeled-stream-splicer -``` - -# license - -MIT diff --git a/node_modules/labeled-stream-splicer/test/bundle.js b/node_modules/labeled-stream-splicer/test/bundle.js deleted file mode 100644 index 2cafc3c1c..000000000 --- a/node_modules/labeled-stream-splicer/test/bundle.js +++ /dev/null @@ -1,27 +0,0 @@ -var test = require('tape'); -var splicer = require('../'); -var through = require('through2'); -var deps = require('module-deps'); -var pack = require('browser-pack'); -var concat = require('concat-stream'); - -test('bundle', function (t) { - t.plan(1); - - var pipeline = splicer.obj([ - 'deps', [ deps(__dirname + '/bundle/main.js') ], - 'pack', [ pack({ raw: true }) ] - ]); - pipeline.pipe(concat(function (body) { - Function([ 'console' ], body.toString('utf8'))({ log: log }); - function log (msg) { - t.equal(msg, 'main: 56055'); - } - })); - - pipeline.get('deps').push(through.obj(function (row, enc, next) { - row.source = row.source.replace(/111/g, '11111'); - this.push(row); - next(); - })); -}); diff --git a/node_modules/labeled-stream-splicer/test/bundle/bar.js b/node_modules/labeled-stream-splicer/test/bundle/bar.js deleted file mode 100644 index c57fa530a..000000000 --- a/node_modules/labeled-stream-splicer/test/bundle/bar.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function (n) { - return n * 100; -}; diff --git a/node_modules/labeled-stream-splicer/test/bundle/foo.js b/node_modules/labeled-stream-splicer/test/bundle/foo.js deleted file mode 100644 index c62e63856..000000000 --- a/node_modules/labeled-stream-splicer/test/bundle/foo.js +++ /dev/null @@ -1,5 +0,0 @@ -var bar = require('./bar'); - -module.exports = function (n) { - return n * 111 + bar(n); -}; diff --git a/node_modules/labeled-stream-splicer/test/bundle/main.js b/node_modules/labeled-stream-splicer/test/bundle/main.js deleted file mode 100644 index 8c71d7997..000000000 --- a/node_modules/labeled-stream-splicer/test/bundle/main.js +++ /dev/null @@ -1,2 +0,0 @@ -var foo = require('./foo'); -console.log('main: ' + foo(5)); diff --git a/node_modules/labeled-stream-splicer/test/bundle/xyz.js b/node_modules/labeled-stream-splicer/test/bundle/xyz.js deleted file mode 100644 index dff6877a8..000000000 --- a/node_modules/labeled-stream-splicer/test/bundle/xyz.js +++ /dev/null @@ -1,2 +0,0 @@ -var foo = require('./foo'); -console.log('xyz: ' + foo(6)); diff --git a/node_modules/lodash.debounce/LICENSE b/node_modules/lodash.debounce/LICENSE deleted file mode 100644 index e0c69d560..000000000 --- a/node_modules/lodash.debounce/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -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. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/node_modules/lodash.debounce/README.md b/node_modules/lodash.debounce/README.md deleted file mode 100644 index 52e638c74..000000000 --- a/node_modules/lodash.debounce/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.debounce v4.0.8 - -The [lodash](https://lodash.com/) method `_.debounce` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.debounce -``` - -In Node.js: -```js -var debounce = require('lodash.debounce'); -``` - -See the [documentation](https://lodash.com/docs#debounce) or [package source](https://github.com/lodash/lodash/blob/4.0.8-npm-packages/lodash.debounce) for more details. diff --git a/node_modules/lodash.debounce/index.js b/node_modules/lodash.debounce/index.js deleted file mode 100644 index ac5707d72..000000000 --- a/node_modules/lodash.debounce/index.js +++ /dev/null @@ -1,377 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** Used as references for various `Number` constants. */ -var NAN = 0 / 0; - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; - -/** Used to detect bad signed hexadecimal string values. */ -var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - -/** Used to detect binary string values. */ -var reIsBinary = /^0b[01]+$/i; - -/** Used to detect octal string values. */ -var reIsOctal = /^0o[0-7]+$/i; - -/** Built-in method references without a dependency on `root`. */ -var freeParseInt = parseInt; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max, - nativeMin = Math.min; - -/** - * Gets the timestamp of the number of milliseconds that have elapsed since - * the Unix epoch (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Date - * @returns {number} Returns the timestamp. - * @example - * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => Logs the number of milliseconds it took for the deferred invocation. - */ -var now = function() { - return root.Date.now(); -}; - -/** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed `func` invocations and a `flush` method to immediately invoke them. - * Provide `options` to indicate whether `func` should be invoked on the - * leading and/or trailing edge of the `wait` timeout. The `func` is invoked - * with the last arguments provided to the debounced function. Subsequent - * calls to the debounced function return the result of the last `func` - * invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the debounced function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=false] - * Specify invoking on the leading edge of the timeout. - * @param {number} [options.maxWait] - * The maximum time `func` is allowed to be delayed before it's invoked. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // Avoid costly calculations while the window size is in flux. - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // Invoke `sendMail` when clicked, debouncing subsequent calls. - * jQuery(element).on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // Ensure `batchLog` is invoked once after 1 second of debounced calls. - * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); - * var source = new EventSource('/stream'); - * jQuery(source).on('message', debounced); - * - * // Cancel the trailing debounced invocation. - * jQuery(window).on('popstate', debounced.cancel); - */ -function debounce(func, wait, options) { - var lastArgs, - lastThis, - maxWait, - result, - timerId, - lastCallTime, - lastInvokeTime = 0, - leading = false, - maxing = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = toNumber(wait) || 0; - if (isObject(options)) { - leading = !!options.leading; - maxing = 'maxWait' in options; - maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - - function invokeFunc(time) { - var args = lastArgs, - thisArg = lastThis; - - lastArgs = lastThis = undefined; - lastInvokeTime = time; - result = func.apply(thisArg, args); - return result; - } - - function leadingEdge(time) { - // Reset any `maxWait` timer. - lastInvokeTime = time; - // Start the timer for the trailing edge. - timerId = setTimeout(timerExpired, wait); - // Invoke the leading edge. - return leading ? invokeFunc(time) : result; - } - - function remainingWait(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime, - result = wait - timeSinceLastCall; - - return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; - } - - function shouldInvoke(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime; - - // Either this is the first call, activity has stopped and we're at the - // trailing edge, the system time has gone backwards and we're treating - // it as the trailing edge, or we've hit the `maxWait` limit. - return (lastCallTime === undefined || (timeSinceLastCall >= wait) || - (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); - } - - function timerExpired() { - var time = now(); - if (shouldInvoke(time)) { - return trailingEdge(time); - } - // Restart the timer. - timerId = setTimeout(timerExpired, remainingWait(time)); - } - - function trailingEdge(time) { - timerId = undefined; - - // Only invoke if we have `lastArgs` which means `func` has been - // debounced at least once. - if (trailing && lastArgs) { - return invokeFunc(time); - } - lastArgs = lastThis = undefined; - return result; - } - - function cancel() { - if (timerId !== undefined) { - clearTimeout(timerId); - } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = undefined; - } - - function flush() { - return timerId === undefined ? result : trailingEdge(now()); - } - - function debounced() { - var time = now(), - isInvoking = shouldInvoke(time); - - lastArgs = arguments; - lastThis = this; - lastCallTime = time; - - if (isInvoking) { - if (timerId === undefined) { - return leadingEdge(lastCallTime); - } - if (maxing) { - // Handle invocations in a tight loop. - timerId = setTimeout(timerExpired, wait); - return invokeFunc(lastCallTime); - } - } - if (timerId === undefined) { - timerId = setTimeout(timerExpired, wait); - } - return result; - } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ -function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); -} - -module.exports = debounce; diff --git a/node_modules/lodash.debounce/package.json b/node_modules/lodash.debounce/package.json deleted file mode 100644 index 7366973e2..000000000 --- a/node_modules/lodash.debounce/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_from": "lodash.debounce@^4.0.8", - "_id": "lodash.debounce@4.0.8", - "_inBundle": false, - "_integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", - "_location": "/lodash.debounce", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "lodash.debounce@^4.0.8", - "name": "lodash.debounce", - "escapedName": "lodash.debounce", - "rawSpec": "^4.0.8", - "saveSpec": null, - "fetchSpec": "^4.0.8" - }, - "_requiredBy": [ - "/cytoscape" - ], - "_resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "_shasum": "82d79bff30a67c4005ffd5e2515300ad9ca4d7af", - "_spec": "lodash.debounce@^4.0.8", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/cytoscape", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine.bublitz@gmail.com", - "url": "https://github.com/phated" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "deprecated": false, - "description": "The lodash method `_.debounce` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash-modularized", - "debounce" - ], - "license": "MIT", - "name": "lodash.debounce", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.0.8" -} diff --git a/node_modules/lodash.memoize/LICENSE.txt b/node_modules/lodash.memoize/LICENSE.txt deleted file mode 100644 index 9cd87e5dc..000000000 --- a/node_modules/lodash.memoize/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/lodash.memoize/README.md b/node_modules/lodash.memoize/README.md deleted file mode 100644 index a417e274a..000000000 --- a/node_modules/lodash.memoize/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash.memoize v3.0.4 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.memoize` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.memoize -``` - -In Node.js/io.js: - -```js -var memoize = require('lodash.memoize'); -``` - -See the [documentation](https://lodash.com/docs#memoize) or [package source](https://github.com/lodash/lodash/blob/3.0.4-npm-packages/lodash.memoize) for more details. diff --git a/node_modules/lodash.memoize/index.js b/node_modules/lodash.memoize/index.js deleted file mode 100644 index 8cb054a4c..000000000 --- a/node_modules/lodash.memoize/index.js +++ /dev/null @@ -1,167 +0,0 @@ -/** - * lodash 3.0.4 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Creates a cache object to store key/value pairs. - * - * @private - * @static - * @name Cache - * @memberOf _.memoize - */ -function MapCache() { - this.__data__ = {}; -} - -/** - * Removes `key` and its value from the cache. - * - * @private - * @name delete - * @memberOf _.memoize.Cache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed successfully, else `false`. - */ -function mapDelete(key) { - return this.has(key) && delete this.__data__[key]; -} - -/** - * Gets the cached value for `key`. - * - * @private - * @name get - * @memberOf _.memoize.Cache - * @param {string} key The key of the value to get. - * @returns {*} Returns the cached value. - */ -function mapGet(key) { - return key == '__proto__' ? undefined : this.__data__[key]; -} - -/** - * Checks if a cached value for `key` exists. - * - * @private - * @name has - * @memberOf _.memoize.Cache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapHas(key) { - return key != '__proto__' && hasOwnProperty.call(this.__data__, key); -} - -/** - * Sets `value` to `key` of the cache. - * - * @private - * @name set - * @memberOf _.memoize.Cache - * @param {string} key The key of the value to cache. - * @param {*} value The value to cache. - * @returns {Object} Returns the cache object. - */ -function mapSet(key, value) { - if (key != '__proto__') { - this.__data__[key] = value; - } - return this; -} - -/** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is coerced to a string and used as the - * cache key. The `func` is invoked with the `this` binding of the memoized - * function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the [`Map`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-properties-of-the-map-prototype-object) - * method interface of `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoizing function. - * @example - * - * var upperCase = _.memoize(function(string) { - * return string.toUpperCase(); - * }); - * - * upperCase('fred'); - * // => 'FRED' - * - * // modifying the result cache - * upperCase.cache.set('fred', 'BARNEY'); - * upperCase('fred'); - * // => 'BARNEY' - * - * // replacing `_.memoize.Cache` - * var object = { 'user': 'fred' }; - * var other = { 'user': 'barney' }; - * var identity = _.memoize(_.identity); - * - * identity(object); - * // => { 'user': 'fred' } - * identity(other); - * // => { 'user': 'fred' } - * - * _.memoize.Cache = WeakMap; - * var identity = _.memoize(_.identity); - * - * identity(object); - * // => { 'user': 'fred' } - * identity(other); - * // => { 'user': 'barney' } - */ -function memoize(func, resolver) { - if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result); - return result; - }; - memoized.cache = new memoize.Cache; - return memoized; -} - -// Add functions to the `Map` cache. -MapCache.prototype['delete'] = mapDelete; -MapCache.prototype.get = mapGet; -MapCache.prototype.has = mapHas; -MapCache.prototype.set = mapSet; - -// Assign cache to `_.memoize`. -memoize.Cache = MapCache; - -module.exports = memoize; diff --git a/node_modules/lodash.memoize/package.json b/node_modules/lodash.memoize/package.json deleted file mode 100644 index c33f18275..000000000 --- a/node_modules/lodash.memoize/package.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "_from": "lodash.memoize@~3.0.3", - "_id": "lodash.memoize@3.0.4", - "_inBundle": false, - "_integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", - "_location": "/lodash.memoize", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "lodash.memoize@~3.0.3", - "name": "lodash.memoize", - "escapedName": "lodash.memoize", - "rawSpec": "~3.0.3", - "saveSpec": null, - "fetchSpec": "~3.0.3" - }, - "_requiredBy": [ - "/combine-source-map" - ], - "_resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", - "_shasum": "2dcbd2c287cbc0a55cc42328bd0c736150d53e3f", - "_spec": "lodash.memoize@~3.0.3", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/combine-source-map", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "deprecated": false, - "description": "The modern build of lodash’s `_.memoize` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash", - "lodash-modularized", - "stdlib", - "util" - ], - "license": "MIT", - "name": "lodash.memoize", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "3.0.4" -} diff --git a/node_modules/map-cache/LICENSE b/node_modules/map-cache/LICENSE deleted file mode 100644 index 1e49edf81..000000000 --- a/node_modules/map-cache/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2016, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/map-cache/README.md b/node_modules/map-cache/README.md deleted file mode 100644 index 6260b29fc..000000000 --- a/node_modules/map-cache/README.md +++ /dev/null @@ -1,145 +0,0 @@ -# map-cache [![NPM version](https://img.shields.io/npm/v/map-cache.svg?style=flat)](https://www.npmjs.com/package/map-cache) [![NPM downloads](https://img.shields.io/npm/dm/map-cache.svg?style=flat)](https://npmjs.org/package/map-cache) [![Build Status](https://img.shields.io/travis/jonschlinkert/map-cache.svg?style=flat)](https://travis-ci.org/jonschlinkert/map-cache) - -Basic cache object for storing key-value pairs. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install map-cache --save -``` - -Based on MapCache in Lo-dash v3.0. [MIT License](https://github.com/lodash/lodash/blob/master/LICENSE.txt) - -## Usage - -```js -var MapCache = require('map-cache'); -var mapCache = new MapCache(); -``` - -## API - -### [MapCache](index.js#L28) - -Creates a cache object to store key/value pairs. - -**Example** - -```js -var cache = new MapCache(); -``` - -### [.set](index.js#L45) - -Adds `value` to `key` on the cache. - -**Params** - -* `key` **{String}**: The key of the value to cache. -* `value` **{any}**: The value to cache. -* `returns` **{Object}**: Returns the `Cache` object for chaining. - -**Example** - -```js -cache.set('foo', 'bar'); -``` - -### [.get](index.js#L65) - -Gets the cached value for `key`. - -**Params** - -* `key` **{String}**: The key of the value to get. -* `returns` **{any}**: Returns the cached value. - -**Example** - -```js -cache.get('foo'); -//=> 'bar' -``` - -### [.has](index.js#L82) - -Checks if a cached value for `key` exists. - -**Params** - -* `key` **{String}**: The key of the entry to check. -* `returns` **{Boolean}**: Returns `true` if an entry for `key` exists, else `false`. - -**Example** - -```js -cache.has('foo'); -//=> true -``` - -### [.del](index.js#L98) - -Removes `key` and its value from the cache. - -**Params** - -* `key` **{String}**: The key of the value to remove. -* `returns` **{Boolean}**: Returns `true` if the entry was removed successfully, else `false`. - -**Example** - -```js -cache.del('foo'); -``` - -## Related projects - -You might also be interested in these projects: - -* [cache-base](https://www.npmjs.com/package/cache-base): Basic object cache with `get`, `set`, `del`, and `has` methods for node.js/javascript projects. | [homepage](https://github.com/jonschlinkert/cache-base) -* [config-cache](https://www.npmjs.com/package/config-cache): General purpose JavaScript object storage methods. | [homepage](https://github.com/jonschlinkert/config-cache) -* [option-cache](https://www.npmjs.com/package/option-cache): Simple API for managing options in JavaScript applications. | [homepage](https://github.com/jonschlinkert/option-cache) - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/map-cache/issues/new). - -## Building docs - -Generate readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install verb && npm run docs -``` - -Or, if [verb](https://github.com/verbose/verb) is installed globally: - -```sh -$ verb -``` - -## Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -## Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/map-cache/blob/master/LICENSE). - -*** - -_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on May 10, 2016._ \ No newline at end of file diff --git a/node_modules/map-cache/index.js b/node_modules/map-cache/index.js deleted file mode 100644 index f86842f29..000000000 --- a/node_modules/map-cache/index.js +++ /dev/null @@ -1,100 +0,0 @@ -/*! - * map-cache - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var hasOwn = Object.prototype.hasOwnProperty; - -/** - * Expose `MapCache` - */ - -module.exports = MapCache; - -/** - * Creates a cache object to store key/value pairs. - * - * ```js - * var cache = new MapCache(); - * ``` - * - * @api public - */ - -function MapCache(data) { - this.__data__ = data || {}; -} - -/** - * Adds `value` to `key` on the cache. - * - * ```js - * cache.set('foo', 'bar'); - * ``` - * - * @param {String} `key` The key of the value to cache. - * @param {*} `value` The value to cache. - * @returns {Object} Returns the `Cache` object for chaining. - * @api public - */ - -MapCache.prototype.set = function mapSet(key, value) { - if (key !== '__proto__') { - this.__data__[key] = value; - } - return this; -}; - -/** - * Gets the cached value for `key`. - * - * ```js - * cache.get('foo'); - * //=> 'bar' - * ``` - * - * @param {String} `key` The key of the value to get. - * @returns {*} Returns the cached value. - * @api public - */ - -MapCache.prototype.get = function mapGet(key) { - return key === '__proto__' ? undefined : this.__data__[key]; -}; - -/** - * Checks if a cached value for `key` exists. - * - * ```js - * cache.has('foo'); - * //=> true - * ``` - * - * @param {String} `key` The key of the entry to check. - * @returns {Boolean} Returns `true` if an entry for `key` exists, else `false`. - * @api public - */ - -MapCache.prototype.has = function mapHas(key) { - return key !== '__proto__' && hasOwn.call(this.__data__, key); -}; - -/** - * Removes `key` and its value from the cache. - * - * ```js - * cache.del('foo'); - * ``` - * @title .del - * @param {String} `key` The key of the value to remove. - * @returns {Boolean} Returns `true` if the entry was removed successfully, else `false`. - * @api public - */ - -MapCache.prototype.del = function mapDelete(key) { - return this.has(key) && delete this.__data__[key]; -}; diff --git a/node_modules/map-cache/package.json b/node_modules/map-cache/package.json deleted file mode 100644 index d38468417..000000000 --- a/node_modules/map-cache/package.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "_from": "map-cache@^0.2.2", - "_id": "map-cache@0.2.2", - "_inBundle": false, - "_integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "_location": "/map-cache", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "map-cache@^0.2.2", - "name": "map-cache", - "escapedName": "map-cache", - "rawSpec": "^0.2.2", - "saveSpec": null, - "fetchSpec": "^0.2.2" - }, - "_requiredBy": [ - "/fragment-cache", - "/snapdragon" - ], - "_resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "_shasum": "c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf", - "_spec": "map-cache@^0.2.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/snapdragon", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/map-cache/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Basic cache object for storing key-value pairs.", - "devDependencies": { - "gulp-format-md": "^0.1.9", - "should": "^8.3.1" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/map-cache", - "keywords": [ - "cache", - "get", - "has", - "object", - "set", - "storage", - "store" - ], - "license": "MIT", - "main": "index.js", - "name": "map-cache", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/map-cache.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "run": true, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "config-cache", - "option-cache", - "cache-base" - ] - }, - "reflinks": [ - "verb" - ], - "lint": { - "reflinks": true - } - }, - "version": "0.2.2" -} diff --git a/node_modules/map-limit/LICENSE.md b/node_modules/map-limit/LICENSE.md deleted file mode 100644 index 146cb32a7..000000000 --- a/node_modules/map-limit/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -## The MIT License (MIT) ## - -Copyright (c) 2014 Hugh Kennedy - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/map-limit/README.md b/node_modules/map-limit/README.md deleted file mode 100644 index f0ec5e69e..000000000 --- a/node_modules/map-limit/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# map-limit [![Flattr this!](https://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=hughskennedy&url=http://github.com/hughsk/map-limit&title=map-limit&description=hughsk/map-limit%20on%20GitHub&language=en_GB&tags=flattr,github,javascript&category=software)[![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges) # - -[async.mapLimit](https://github.com/caolan/async#maplimitarr-limit-iterator-callback)'s -functionality available as a standalone npm module. - -I often find myself pulling in [async](http://github.com/caolan/async) for this -method alone, so in the spirit of breaking things into smaller pieces here's -that method as a single thing you can require. - -## Usage ## - -[![map-limit](https://nodei.co/npm/map-limit.png?mini=true)](https://nodei.co/npm/map-limit) - -### `mapLimit(arr, limit, iterator, callback)` ### - -The same as map only no more than "limit" iterators will be simultaneously -running at any time. - -Note that the items are not processed in batches, so there is no guarantee -that the first "limit" iterator functions will complete before any others are -started. - -#### Arguments #### - -* **arr** - An array to iterate over. -* **limit** - The maximum number of iterators to run at any time. -* **iterator(item, callback)** - A function to apply to each item in the array. The iterator is passed a callback(err, transformed) which must be called once it has completed with an error (which can be null) and a transformed item. -* **callback(err, results)** - A callback which is called after all the iterator functions have finished, or an error has occurred. Results is an array of the transformed items from the original array. - -## License ## - -MIT. See [LICENSE.md](http://github.com/hughsk/map-limit/blob/master/LICENSE.md) for details. diff --git a/node_modules/map-limit/index.js b/node_modules/map-limit/index.js deleted file mode 100644 index 7b6e01ab2..000000000 --- a/node_modules/map-limit/index.js +++ /dev/null @@ -1,54 +0,0 @@ -var once = require('once') -var noop = function noop(){} - -module.exports = mapLimit - -function mapLimit(arr, limit, iterator, callback) { - var complete = 0 - var aborted = false - var results = [] - var queued = 0 - var l = arr.length - var i = 0 - - callback = once(callback || noop) - if (typeof iterator !== 'function') throw new Error( - 'Iterator function must be passed as the third argument' - ) - - for (var r = 0; r < l; r++) { - results[r] = null - } - - flush() - - function flush() { - if (complete === l) - return callback(null, results) - - while (queued < limit) { - if (aborted) break - if (i === l) break - push() - } - } - - function abort(err) { - aborted = true - return callback(err) - } - - function push() { - var idx = i++ - - queued += 1 - - iterator(arr[idx], function(err, result) { - if (err) return abort(err) - results[idx] = result - complete += 1 - queued -= 1 - flush() - }) - } -} diff --git a/node_modules/map-limit/node_modules/once/LICENSE b/node_modules/map-limit/node_modules/once/LICENSE deleted file mode 100644 index 19129e315..000000000 --- a/node_modules/map-limit/node_modules/once/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/map-limit/node_modules/once/README.md b/node_modules/map-limit/node_modules/once/README.md deleted file mode 100644 index a2981ea07..000000000 --- a/node_modules/map-limit/node_modules/once/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# once - -Only call a function once. - -## usage - -```javascript -var once = require('once') - -function load (file, cb) { - cb = once(cb) - loader.load('file') - loader.once('load', cb) - loader.once('error', cb) -} -``` - -Or add to the Function.prototype in a responsible way: - -```javascript -// only has to be done once -require('once').proto() - -function load (file, cb) { - cb = cb.once() - loader.load('file') - loader.once('load', cb) - loader.once('error', cb) -} -``` - -Ironically, the prototype feature makes this module twice as -complicated as necessary. - -To check whether you function has been called, use `fn.called`. Once the -function is called for the first time the return value of the original -function is saved in `fn.value` and subsequent calls will continue to -return this value. - -```javascript -var once = require('once') - -function load (cb) { - cb = once(cb) - var stream = createStream() - stream.once('data', cb) - stream.once('end', function () { - if (!cb.called) cb(new Error('not found')) - }) -} -``` diff --git a/node_modules/map-limit/node_modules/once/once.js b/node_modules/map-limit/node_modules/once/once.js deleted file mode 100644 index 2e1e721bf..000000000 --- a/node_modules/map-limit/node_modules/once/once.js +++ /dev/null @@ -1,21 +0,0 @@ -var wrappy = require('wrappy') -module.exports = wrappy(once) - -once.proto = once(function () { - Object.defineProperty(Function.prototype, 'once', { - value: function () { - return once(this) - }, - configurable: true - }) -}) - -function once (fn) { - var f = function () { - if (f.called) return f.value - f.called = true - return f.value = fn.apply(this, arguments) - } - f.called = false - return f -} diff --git a/node_modules/map-limit/node_modules/once/package.json b/node_modules/map-limit/node_modules/once/package.json deleted file mode 100644 index 067bf8ffa..000000000 --- a/node_modules/map-limit/node_modules/once/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_from": "once@~1.3.0", - "_id": "once@1.3.3", - "_inBundle": false, - "_integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", - "_location": "/map-limit/once", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "once@~1.3.0", - "name": "once", - "escapedName": "once", - "rawSpec": "~1.3.0", - "saveSpec": null, - "fetchSpec": "~1.3.0" - }, - "_requiredBy": [ - "/map-limit" - ], - "_resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", - "_shasum": "b2e261557ce4c314ec8304f3fa82663e4297ca20", - "_spec": "once@~1.3.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/map-limit", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/once/issues" - }, - "bundleDependencies": false, - "dependencies": { - "wrappy": "1" - }, - "deprecated": false, - "description": "Run a function exactly one time", - "devDependencies": { - "tap": "^1.2.0" - }, - "directories": { - "test": "test" - }, - "files": [ - "once.js" - ], - "homepage": "https://github.com/isaacs/once#readme", - "keywords": [ - "once", - "function", - "one", - "single" - ], - "license": "ISC", - "main": "once.js", - "name": "once", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/once.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "1.3.3" -} diff --git a/node_modules/map-limit/package.json b/node_modules/map-limit/package.json deleted file mode 100644 index 7fdade65f..000000000 --- a/node_modules/map-limit/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_from": "map-limit@0.0.1", - "_id": "map-limit@0.0.1", - "_inBundle": false, - "_integrity": "sha1-63lhAxwPDo0AG/LVb6toXViCLzg=", - "_location": "/map-limit", - "_phantomChildren": { - "wrappy": "1.0.2" - }, - "_requested": { - "type": "version", - "registry": true, - "raw": "map-limit@0.0.1", - "name": "map-limit", - "escapedName": "map-limit", - "rawSpec": "0.0.1", - "saveSpec": null, - "fetchSpec": "0.0.1" - }, - "_requiredBy": [ - "/get-ports" - ], - "_resolved": "https://registry.npmjs.org/map-limit/-/map-limit-0.0.1.tgz", - "_shasum": "eb7961031c0f0e8d001bf2d56fab685d58822f38", - "_spec": "map-limit@0.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/get-ports", - "author": { - "name": "Hugh Kennedy", - "email": "hughskennedy@gmail.com", - "url": "http://hughsk.io/" - }, - "browser": "index.js", - "bugs": { - "url": "https://github.com/hughsk/map-limit/issues" - }, - "bundleDependencies": false, - "dependencies": { - "once": "~1.3.0" - }, - "deprecated": false, - "description": "async.mapLimit's functionality available as a standalone npm module", - "devDependencies": { - "tape": "~2.4.2" - }, - "homepage": "https://github.com/hughsk/map-limit", - "keywords": [ - "async", - "map", - "limit" - ], - "license": "MIT", - "main": "index.js", - "name": "map-limit", - "repository": { - "type": "git", - "url": "git://github.com/hughsk/map-limit.git" - }, - "scripts": { - "test": "node test" - }, - "version": "0.0.1" -} diff --git a/node_modules/map-limit/test.js b/node_modules/map-limit/test.js deleted file mode 100644 index c410ae769..000000000 --- a/node_modules/map-limit/test.js +++ /dev/null @@ -1,39 +0,0 @@ -var test = require('tape') -var mapl = require('./') - -test('basic', function(t) { - var items = [1, 2, 3, 4, 5] - var goals = [2, 4, 6, 8,10] - - t.plan(2) - - mapl(items, 5, function(item, next) { - next(null, item * 2) - }, function(err, results) { - t.ifError(err) - t.deepEqual(results, goals) - }) -}) - -test('stalled', function(t) { - var items = [1, 2, 3, 4, 5, 6, 7, 8] - var goals = [2, 4, 6, 8,10,12,14,16] - var n = 0 - - t.plan(6) - - mapl(items, 2, function(item, next) { - setTimeout(function() { - n += 1 - next(null, item * 2) - }, 150) - }, function(err, results) { - t.ifError(err) - t.deepEqual(results, goals) - }) - - setTimeout(function() { t.equal(n, 2) }, 225) - setTimeout(function() { t.equal(n, 4) }, 350) - setTimeout(function() { t.equal(n, 6) }, 475) - setTimeout(function() { t.equal(n, 8) }, 625) -}) diff --git a/node_modules/map-visit/LICENSE b/node_modules/map-visit/LICENSE deleted file mode 100644 index 83b56e709..000000000 --- a/node_modules/map-visit/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/map-visit/README.md b/node_modules/map-visit/README.md deleted file mode 100644 index 5ab02d450..000000000 --- a/node_modules/map-visit/README.md +++ /dev/null @@ -1,155 +0,0 @@ -# map-visit [![NPM version](https://img.shields.io/npm/v/map-visit.svg?style=flat)](https://www.npmjs.com/package/map-visit) [![NPM monthly downloads](https://img.shields.io/npm/dm/map-visit.svg?style=flat)](https://npmjs.org/package/map-visit) [![NPM total downloads](https://img.shields.io/npm/dt/map-visit.svg?style=flat)](https://npmjs.org/package/map-visit) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/map-visit.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/map-visit) - -> Map `visit` over an array of objects. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save map-visit -``` - -## Usage - -```js -var mapVisit = require('map-visit'); -``` - -## What does this do? - -**Assign/Merge/Extend vs. Visit** - -Let's say you want to add a `set` method to your application that will: - -* set key-value pairs on a `data` object -* extend objects onto the `data` object -* extend arrays of objects onto the data object - -**Example using `extend`** - -Here is one way to accomplish this using Lo-Dash's `extend` (comparable to `Object.assign`): - -```js -var _ = require('lodash'); - -var obj = { - data: {}, - set: function (key, value) { - if (Array.isArray(key)) { - _.extend.apply(_, [obj.data].concat(key)); - } else if (typeof key === 'object') { - _.extend(obj.data, key); - } else { - obj.data[key] = value; - } - } -}; - -obj.set('a', 'a'); -obj.set([{b: 'b'}, {c: 'c'}]); -obj.set({d: {e: 'f'}}); - -console.log(obj.data); -//=> {a: 'a', b: 'b', c: 'c', d: { e: 'f' }} -``` - -The above approach works fine for most use cases. However, **if you also want to emit an event** each time a property is added to the `data` object, or you want more control over what happens as the object is extended, a better approach would be to use `visit`. - -**Example using `visit`** - -In this approach: - -* when an array is passed to `set`, the `mapVisit` library calls the `set` method on each object in the array. -* when an object is passed, `visit` calls `set` on each property in the object. - -As a result, the `data` event will be emitted every time a property is added to `data` (events are just an example, you can use this approach to perform any necessary logic every time the method is called). - -```js -var mapVisit = require('map-visit'); -var visit = require('object-visit'); - -var obj = { - data: {}, - set: function (key, value) { - if (Array.isArray(key)) { - mapVisit(obj, 'set', key); - } else if (typeof key === 'object') { - visit(obj, 'set', key); - } else { - // simulate an event-emitter - console.log('emit', key, value); - obj.data[key] = value; - } - } -}; - -obj.set('a', 'a'); -obj.set([{b: 'b'}, {c: 'c'}]); -obj.set({d: {e: 'f'}}); -obj.set({g: 'h', i: 'j', k: 'l'}); - -console.log(obj.data); -//=> {a: 'a', b: 'b', c: 'c', d: { e: 'f' }, g: 'h', i: 'j', k: 'l'} - -// events would look something like: -// emit a a -// emit b b -// emit c c -// emit d { e: 'f' } -// emit g h -// emit i j -// emit k l -``` - -## About - -### Related projects - -* [collection-visit](https://www.npmjs.com/package/collection-visit): Visit a method over the items in an object, or map visit over the objects… [more](https://github.com/jonschlinkert/collection-visit) | [homepage](https://github.com/jonschlinkert/collection-visit "Visit a method over the items in an object, or map visit over the objects in an array.") -* [object-visit](https://www.npmjs.com/package/object-visit): Call a specified method on each value in the given object. | [homepage](https://github.com/jonschlinkert/object-visit "Call a specified method on each value in the given object.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 15 | [jonschlinkert](https://github.com/jonschlinkert) | -| 7 | [doowb](https://github.com/doowb) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 09, 2017._ \ No newline at end of file diff --git a/node_modules/map-visit/index.js b/node_modules/map-visit/index.js deleted file mode 100644 index bc54ccc4e..000000000 --- a/node_modules/map-visit/index.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -var util = require('util'); -var visit = require('object-visit'); - -/** - * Map `visit` over an array of objects. - * - * @param {Object} `collection` The context in which to invoke `method` - * @param {String} `method` Name of the method to call on `collection` - * @param {Object} `arr` Array of objects. - */ - -module.exports = function mapVisit(collection, method, val) { - if (isObject(val)) { - return visit.apply(null, arguments); - } - - if (!Array.isArray(val)) { - throw new TypeError('expected an array: ' + util.inspect(val)); - } - - var args = [].slice.call(arguments, 3); - - for (var i = 0; i < val.length; i++) { - var ele = val[i]; - if (isObject(ele)) { - visit.apply(null, [collection, method, ele].concat(args)); - } else { - collection[method].apply(collection, [ele].concat(args)); - } - } -}; - -function isObject(val) { - return val && (typeof val === 'function' || (!Array.isArray(val) && typeof val === 'object')); -} diff --git a/node_modules/map-visit/package.json b/node_modules/map-visit/package.json deleted file mode 100644 index d02c0b21c..000000000 --- a/node_modules/map-visit/package.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "_from": "map-visit@^1.0.0", - "_id": "map-visit@1.0.0", - "_inBundle": false, - "_integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "_location": "/map-visit", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "map-visit@^1.0.0", - "name": "map-visit", - "escapedName": "map-visit", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/collection-visit" - ], - "_resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "_shasum": "ecdca8f13144e660f1b5bd41f12f3479d98dfb8f", - "_spec": "map-visit@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/collection-visit", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/map-visit/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Brian Woodward", - "email": "brian.woodward@gmail.com", - "url": "https://twitter.com/doowb" - }, - { - "name": "Jon Schlinkert", - "email": "jon.schlinkert@sellside.com", - "url": "http://twitter.com/jonschlinkert" - } - ], - "dependencies": { - "object-visit": "^1.0.0" - }, - "deprecated": false, - "description": "Map `visit` over an array of objects.", - "devDependencies": { - "clone-deep": "^0.2.4", - "extend-shallow": "^2.0.1", - "gulp-format-md": "^0.1.12", - "lodash": "^4.17.4", - "mocha": "^3.2.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/map-visit", - "keywords": [ - "array", - "arrays", - "function", - "helper", - "invoke", - "key", - "map", - "method", - "object", - "objects", - "value", - "visit", - "visitor" - ], - "license": "MIT", - "main": "index.js", - "name": "map-visit", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/map-visit.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "related": { - "list": [ - "collection-visit", - "object-visit" - ] - }, - "reflinks": [ - "verb", - "verb-generate-readme" - ] - }, - "version": "1.0.0" -} diff --git a/node_modules/math-random/.npmignore b/node_modules/math-random/.npmignore deleted file mode 100644 index 8d87b1d26..000000000 --- a/node_modules/math-random/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/* diff --git a/node_modules/math-random/.travis.yml b/node_modules/math-random/.travis.yml deleted file mode 100644 index 054c803eb..000000000 --- a/node_modules/math-random/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "6" - - "4" - - "0.12" - - "0.10" diff --git a/node_modules/math-random/browser.js b/node_modules/math-random/browser.js deleted file mode 100644 index cde412ed0..000000000 --- a/node_modules/math-random/browser.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = (function (global) { - var uint32 = 'Uint32Array' in global - var crypto = global.crypto || global.msCrypto - var rando = crypto && typeof crypto.getRandomValues === 'function' - var good = uint32 && crypto && rando - if (!good) return Math.random - - var arr = new Uint32Array(1) - var max = Math.pow(2, 32) - function random () { - crypto.getRandomValues(arr) - return arr[0] / max - } - - random.cryptographic = true - return random -})(typeof self !== 'undefined' ? self : window) diff --git a/node_modules/math-random/node.js b/node_modules/math-random/node.js deleted file mode 100644 index da6783ebe..000000000 --- a/node_modules/math-random/node.js +++ /dev/null @@ -1,13 +0,0 @@ -var crypto = require('crypto') -var max = Math.pow(2, 32) - -module.exports = random -module.exports.cryptographic = true - -function random () { - var buf = crypto - .randomBytes(4) - .toString('hex') - - return parseInt(buf, 16) / max -} diff --git a/node_modules/math-random/package.json b/node_modules/math-random/package.json deleted file mode 100644 index 9e80f3b83..000000000 --- a/node_modules/math-random/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "_from": "math-random@^1.0.1", - "_id": "math-random@1.0.1", - "_inBundle": false, - "_integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", - "_location": "/math-random", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "math-random@^1.0.1", - "name": "math-random", - "escapedName": "math-random", - "rawSpec": "^1.0.1", - "saveSpec": null, - "fetchSpec": "^1.0.1" - }, - "_requiredBy": [ - "/randomatic" - ], - "_resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", - "_shasum": "8b3aac588b8a66e4975e3cdea67f7bb329601fac", - "_spec": "math-random@^1.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/randomatic", - "author": { - "name": "Michael Rhodes" - }, - "browser": "browser.js", - "bugs": { - "url": "https://github.com/michaelrhodes/math-random/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "a drop-in replacement for Math.random that uses cryptographically secure random number generation, where available", - "devDependencies": { - "array-unique": "~0.2.1", - "tape": "~4.2.2" - }, - "homepage": "https://github.com/michaelrhodes/math-random", - "keywords": [ - "Math.random", - "crypto.getRandomValues" - ], - "license": "MIT", - "main": "node.js", - "name": "math-random", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/michaelrhodes/math-random.git" - }, - "scripts": { - "test": "tape test.js" - }, - "testling": { - "files": "test.js" - }, - "version": "1.0.1" -} diff --git a/node_modules/math-random/readme.md b/node_modules/math-random/readme.md deleted file mode 100644 index 17beb7068..000000000 --- a/node_modules/math-random/readme.md +++ /dev/null @@ -1,26 +0,0 @@ -# math-random - -math-random is an drop-in replacement for Math.random that uses cryptographically secure random number generation, where available. It works in both browser and node environments. - -[![Build status](https://travis-ci.org/michaelrhodes/math-random.svg?branch=master)](https://travis-ci.org/michaelrhodes/math-random) - -## Install - -```sh -npm install math-random -``` - -### Usage - -```js -var random = require('math-random') - -console.log(random()) -=> 0.584293719381094 - -console.log(random.cryptographic) -=> true || undefined -``` - -### License -[MIT](http://opensource.org/licenses/MIT) diff --git a/node_modules/math-random/test.js b/node_modules/math-random/test.js deleted file mode 100644 index b7706b7df..000000000 --- a/node_modules/math-random/test.js +++ /dev/null @@ -1,26 +0,0 @@ -var test = require('tape') -var unique = require('array-unique') -var random = require('./') - -test('it works', function (assert) { - var number, l = 1000, cache = [] - - for (var i = 0; i < l; i++) { - number = random() - if (number <= 0) { - assert.fail('a random number was less than or equal to zero') - assert.end() - return - } - if (number >= 1) { - assert.fail('a random number was greater than or equal to one') - assert.end() - return - } - cache.push(number) - } - - assert.pass('all ' + l + ' random numbers were greater than zero and less than one') - assert.equal(cache.length, unique(cache).length, 'all ' + l + ' random numbers were unique') - assert.end() -}) diff --git a/node_modules/md5.js/LICENSE b/node_modules/md5.js/LICENSE deleted file mode 100644 index 6f02ae800..000000000 --- a/node_modules/md5.js/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Kirill Fomichev - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/md5.js/README.md b/node_modules/md5.js/README.md deleted file mode 100644 index 36316e1b3..000000000 --- a/node_modules/md5.js/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# md5.js - -[![NPM Package](https://img.shields.io/npm/v/md5.js.svg?style=flat-square)](https://www.npmjs.org/package/md5.js) -[![Build Status](https://img.shields.io/travis/crypto-browserify/md5.js.svg?branch=master&style=flat-square)](https://travis-ci.org/crypto-browserify/md5.js) -[![Dependency status](https://img.shields.io/david/crypto-browserify/md5.js.svg?style=flat-square)](https://david-dm.org/crypto-browserify/md5.js#info=dependencies) - -[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) - -Node style `md5` on pure JavaScript. - -From [NIST SP 800-131A][1]: *md5 is no longer acceptable where collision resistance is required such as digital signatures.* - -## Example - -```js -var MD5 = require('md5.js') - -console.log(new MD5().update('42').digest('hex')) -// => a1d0c6e83f027327d8461063f4ac58a6 - -var md5stream = new MD5() -md5stream.end('42') -console.log(md5stream.read().toString('hex')) -// => a1d0c6e83f027327d8461063f4ac58a6 -``` - -## LICENSE [MIT](LICENSE) - -[1]: http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar1.pdf diff --git a/node_modules/md5.js/index.js b/node_modules/md5.js/index.js deleted file mode 100644 index cbfa2e378..000000000 --- a/node_modules/md5.js/index.js +++ /dev/null @@ -1,146 +0,0 @@ -'use strict' -var inherits = require('inherits') -var HashBase = require('hash-base') -var Buffer = require('safe-buffer').Buffer - -var ARRAY16 = new Array(16) - -function MD5 () { - HashBase.call(this, 64) - - // state - this._a = 0x67452301 - this._b = 0xefcdab89 - this._c = 0x98badcfe - this._d = 0x10325476 -} - -inherits(MD5, HashBase) - -MD5.prototype._update = function () { - var M = ARRAY16 - for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4) - - var a = this._a - var b = this._b - var c = this._c - var d = this._d - - a = fnF(a, b, c, d, M[0], 0xd76aa478, 7) - d = fnF(d, a, b, c, M[1], 0xe8c7b756, 12) - c = fnF(c, d, a, b, M[2], 0x242070db, 17) - b = fnF(b, c, d, a, M[3], 0xc1bdceee, 22) - a = fnF(a, b, c, d, M[4], 0xf57c0faf, 7) - d = fnF(d, a, b, c, M[5], 0x4787c62a, 12) - c = fnF(c, d, a, b, M[6], 0xa8304613, 17) - b = fnF(b, c, d, a, M[7], 0xfd469501, 22) - a = fnF(a, b, c, d, M[8], 0x698098d8, 7) - d = fnF(d, a, b, c, M[9], 0x8b44f7af, 12) - c = fnF(c, d, a, b, M[10], 0xffff5bb1, 17) - b = fnF(b, c, d, a, M[11], 0x895cd7be, 22) - a = fnF(a, b, c, d, M[12], 0x6b901122, 7) - d = fnF(d, a, b, c, M[13], 0xfd987193, 12) - c = fnF(c, d, a, b, M[14], 0xa679438e, 17) - b = fnF(b, c, d, a, M[15], 0x49b40821, 22) - - a = fnG(a, b, c, d, M[1], 0xf61e2562, 5) - d = fnG(d, a, b, c, M[6], 0xc040b340, 9) - c = fnG(c, d, a, b, M[11], 0x265e5a51, 14) - b = fnG(b, c, d, a, M[0], 0xe9b6c7aa, 20) - a = fnG(a, b, c, d, M[5], 0xd62f105d, 5) - d = fnG(d, a, b, c, M[10], 0x02441453, 9) - c = fnG(c, d, a, b, M[15], 0xd8a1e681, 14) - b = fnG(b, c, d, a, M[4], 0xe7d3fbc8, 20) - a = fnG(a, b, c, d, M[9], 0x21e1cde6, 5) - d = fnG(d, a, b, c, M[14], 0xc33707d6, 9) - c = fnG(c, d, a, b, M[3], 0xf4d50d87, 14) - b = fnG(b, c, d, a, M[8], 0x455a14ed, 20) - a = fnG(a, b, c, d, M[13], 0xa9e3e905, 5) - d = fnG(d, a, b, c, M[2], 0xfcefa3f8, 9) - c = fnG(c, d, a, b, M[7], 0x676f02d9, 14) - b = fnG(b, c, d, a, M[12], 0x8d2a4c8a, 20) - - a = fnH(a, b, c, d, M[5], 0xfffa3942, 4) - d = fnH(d, a, b, c, M[8], 0x8771f681, 11) - c = fnH(c, d, a, b, M[11], 0x6d9d6122, 16) - b = fnH(b, c, d, a, M[14], 0xfde5380c, 23) - a = fnH(a, b, c, d, M[1], 0xa4beea44, 4) - d = fnH(d, a, b, c, M[4], 0x4bdecfa9, 11) - c = fnH(c, d, a, b, M[7], 0xf6bb4b60, 16) - b = fnH(b, c, d, a, M[10], 0xbebfbc70, 23) - a = fnH(a, b, c, d, M[13], 0x289b7ec6, 4) - d = fnH(d, a, b, c, M[0], 0xeaa127fa, 11) - c = fnH(c, d, a, b, M[3], 0xd4ef3085, 16) - b = fnH(b, c, d, a, M[6], 0x04881d05, 23) - a = fnH(a, b, c, d, M[9], 0xd9d4d039, 4) - d = fnH(d, a, b, c, M[12], 0xe6db99e5, 11) - c = fnH(c, d, a, b, M[15], 0x1fa27cf8, 16) - b = fnH(b, c, d, a, M[2], 0xc4ac5665, 23) - - a = fnI(a, b, c, d, M[0], 0xf4292244, 6) - d = fnI(d, a, b, c, M[7], 0x432aff97, 10) - c = fnI(c, d, a, b, M[14], 0xab9423a7, 15) - b = fnI(b, c, d, a, M[5], 0xfc93a039, 21) - a = fnI(a, b, c, d, M[12], 0x655b59c3, 6) - d = fnI(d, a, b, c, M[3], 0x8f0ccc92, 10) - c = fnI(c, d, a, b, M[10], 0xffeff47d, 15) - b = fnI(b, c, d, a, M[1], 0x85845dd1, 21) - a = fnI(a, b, c, d, M[8], 0x6fa87e4f, 6) - d = fnI(d, a, b, c, M[15], 0xfe2ce6e0, 10) - c = fnI(c, d, a, b, M[6], 0xa3014314, 15) - b = fnI(b, c, d, a, M[13], 0x4e0811a1, 21) - a = fnI(a, b, c, d, M[4], 0xf7537e82, 6) - d = fnI(d, a, b, c, M[11], 0xbd3af235, 10) - c = fnI(c, d, a, b, M[2], 0x2ad7d2bb, 15) - b = fnI(b, c, d, a, M[9], 0xeb86d391, 21) - - this._a = (this._a + a) | 0 - this._b = (this._b + b) | 0 - this._c = (this._c + c) | 0 - this._d = (this._d + d) | 0 -} - -MD5.prototype._digest = function () { - // create padding and handle blocks - this._block[this._blockOffset++] = 0x80 - if (this._blockOffset > 56) { - this._block.fill(0, this._blockOffset, 64) - this._update() - this._blockOffset = 0 - } - - this._block.fill(0, this._blockOffset, 56) - this._block.writeUInt32LE(this._length[0], 56) - this._block.writeUInt32LE(this._length[1], 60) - this._update() - - // produce result - var buffer = Buffer.allocUnsafe(16) - buffer.writeInt32LE(this._a, 0) - buffer.writeInt32LE(this._b, 4) - buffer.writeInt32LE(this._c, 8) - buffer.writeInt32LE(this._d, 12) - return buffer -} - -function rotl (x, n) { - return (x << n) | (x >>> (32 - n)) -} - -function fnF (a, b, c, d, m, k, s) { - return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + b) | 0 -} - -function fnG (a, b, c, d, m, k, s) { - return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + b) | 0 -} - -function fnH (a, b, c, d, m, k, s) { - return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + b) | 0 -} - -function fnI (a, b, c, d, m, k, s) { - return (rotl((a + ((c ^ (b | (~d)))) + m + k) | 0, s) + b) | 0 -} - -module.exports = MD5 diff --git a/node_modules/md5.js/package.json b/node_modules/md5.js/package.json deleted file mode 100644 index ba5341dbd..000000000 --- a/node_modules/md5.js/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_from": "md5.js@^1.3.4", - "_id": "md5.js@1.3.5", - "_inBundle": false, - "_integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "_location": "/md5.js", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "md5.js@^1.3.4", - "name": "md5.js", - "escapedName": "md5.js", - "rawSpec": "^1.3.4", - "saveSpec": null, - "fetchSpec": "^1.3.4" - }, - "_requiredBy": [ - "/create-hash", - "/evp_bytestokey" - ], - "_resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "_shasum": "b5d07b8e3216e3e27cd728d72f70d1e6a342005f", - "_spec": "md5.js@^1.3.4", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/create-hash", - "author": { - "name": "Kirill Fomichev", - "email": "fanatid@ya.ru", - "url": "https://github.com/fanatid" - }, - "bugs": { - "url": "https://github.com/crypto-browserify/md5.js/issues" - }, - "bundleDependencies": false, - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - }, - "deprecated": false, - "description": "node style md5 on pure JavaScript", - "devDependencies": { - "hash-test-vectors": "^1.3.2", - "standard": "^7.0.0", - "tape": "^4.2.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/crypto-browserify/md5.js", - "keywords": [ - "crypto", - "md5" - ], - "license": "MIT", - "main": "index.js", - "name": "md5.js", - "repository": { - "type": "git", - "url": "git+https://github.com/crypto-browserify/md5.js.git" - }, - "scripts": { - "lint": "standard", - "test": "npm run lint && npm run unit", - "unit": "node test/*.js" - }, - "version": "1.3.5" -} diff --git a/node_modules/md5/.npmignore b/node_modules/md5/.npmignore deleted file mode 100644 index d5d9f0f4b..000000000 --- a/node_modules/md5/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/mocha diff --git a/node_modules/md5/.travis.yml b/node_modules/md5/.travis.yml deleted file mode 100644 index 811124587..000000000 --- a/node_modules/md5/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 \ No newline at end of file diff --git a/node_modules/md5/LICENSE b/node_modules/md5/LICENSE deleted file mode 100644 index f476d11e7..000000000 --- a/node_modules/md5/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright © 2011-2012, Paul Vorbach. -Copyright © 2009, Jeff Mott. - -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 Crypto-JS 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 HOLDER 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. diff --git a/node_modules/md5/README.md b/node_modules/md5/README.md deleted file mode 100644 index c449a333c..000000000 --- a/node_modules/md5/README.md +++ /dev/null @@ -1,108 +0,0 @@ -# MD5 - -[![build status](https://secure.travis-ci.org/pvorb/node-md5.png)](http://travis-ci.org/pvorb/node-md5) - -a JavaScript function for hashing messages with MD5. - -## Installation - -You can use this package on the server side as well as the client side. - -### [Node.js](http://nodejs.org/): - -~~~ -npm install md5 -~~~ - - -## API - -~~~ javascript -md5(message) -~~~ - - * `message` -- `String` or `Buffer` - * returns `String` - - -## Usage - -~~~ javascript -var md5 = require('md5'); - -console.log(md5('message')); -~~~ - -This will print the following - -~~~ -78e731027d8fd50ed642340b7c9a63b3 -~~~ - -It supports buffers, too - -~~~ javascript -var fs = require('fs'); -var md5 = require('md5'); - -fs.readFile('example.txt', function(err, buf) { - console.log(md5(buf)); -}); -~~~ - -## Versions - -Before version 2.0.0 there were two packages called md5 on npm, one lowercase, -one uppercase (the one you're looking at). As of version 2.0.0, all new versions -of this module will go to lowercase [md5](https://www.npmjs.com/package/md5) on -npm. To use the correct version, users of this module will have to change their -code from `require('MD5')` to `require('md5')` if they want to use versions >= -2.0.0. - - -## Bugs and Issues - -If you encounter any bugs or issues, feel free to open an issue at -[github](https://github.com/pvorb/node-md5/issues). - - -## Credits - -This package is based on the work of Jeff Mott, who did a pure JS implementation -of the MD5 algorithm that was published by Ronald L. Rivest in 1991. I needed a -npm package of the algorithm, so I used Jeff’s implementation for this package. -The original implementation can be found in the -[CryptoJS](http://code.google.com/p/crypto-js/) project. - - -## License - -~~~ -Copyright © 2011-2015, Paul Vorbach. -Copyright © 2009, Jeff Mott. - -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 Crypto-JS 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 HOLDER 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. -~~~ diff --git a/node_modules/md5/md5.js b/node_modules/md5/md5.js deleted file mode 100644 index e20b1f717..000000000 --- a/node_modules/md5/md5.js +++ /dev/null @@ -1,160 +0,0 @@ -(function(){ - var crypt = require('crypt'), - utf8 = require('charenc').utf8, - isBuffer = require('is-buffer'), - bin = require('charenc').bin, - - // The core - md5 = function (message, options) { - // Convert to byte array - if (message.constructor == String) - if (options && options.encoding === 'binary') - message = bin.stringToBytes(message); - else - message = utf8.stringToBytes(message); - else if (isBuffer(message)) - message = Array.prototype.slice.call(message, 0); - else if (!Array.isArray(message)) - message = message.toString(); - // else, assume byte array already - - var m = crypt.bytesToWords(message), - l = message.length * 8, - a = 1732584193, - b = -271733879, - c = -1732584194, - d = 271733878; - - // Swap endian - for (var i = 0; i < m.length; i++) { - m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF | - ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00; - } - - // Padding - m[l >>> 5] |= 0x80 << (l % 32); - m[(((l + 64) >>> 9) << 4) + 14] = l; - - // Method shortcuts - var FF = md5._ff, - GG = md5._gg, - HH = md5._hh, - II = md5._ii; - - for (var i = 0; i < m.length; i += 16) { - - var aa = a, - bb = b, - cc = c, - dd = d; - - a = FF(a, b, c, d, m[i+ 0], 7, -680876936); - d = FF(d, a, b, c, m[i+ 1], 12, -389564586); - c = FF(c, d, a, b, m[i+ 2], 17, 606105819); - b = FF(b, c, d, a, m[i+ 3], 22, -1044525330); - a = FF(a, b, c, d, m[i+ 4], 7, -176418897); - d = FF(d, a, b, c, m[i+ 5], 12, 1200080426); - c = FF(c, d, a, b, m[i+ 6], 17, -1473231341); - b = FF(b, c, d, a, m[i+ 7], 22, -45705983); - a = FF(a, b, c, d, m[i+ 8], 7, 1770035416); - d = FF(d, a, b, c, m[i+ 9], 12, -1958414417); - c = FF(c, d, a, b, m[i+10], 17, -42063); - b = FF(b, c, d, a, m[i+11], 22, -1990404162); - a = FF(a, b, c, d, m[i+12], 7, 1804603682); - d = FF(d, a, b, c, m[i+13], 12, -40341101); - c = FF(c, d, a, b, m[i+14], 17, -1502002290); - b = FF(b, c, d, a, m[i+15], 22, 1236535329); - - a = GG(a, b, c, d, m[i+ 1], 5, -165796510); - d = GG(d, a, b, c, m[i+ 6], 9, -1069501632); - c = GG(c, d, a, b, m[i+11], 14, 643717713); - b = GG(b, c, d, a, m[i+ 0], 20, -373897302); - a = GG(a, b, c, d, m[i+ 5], 5, -701558691); - d = GG(d, a, b, c, m[i+10], 9, 38016083); - c = GG(c, d, a, b, m[i+15], 14, -660478335); - b = GG(b, c, d, a, m[i+ 4], 20, -405537848); - a = GG(a, b, c, d, m[i+ 9], 5, 568446438); - d = GG(d, a, b, c, m[i+14], 9, -1019803690); - c = GG(c, d, a, b, m[i+ 3], 14, -187363961); - b = GG(b, c, d, a, m[i+ 8], 20, 1163531501); - a = GG(a, b, c, d, m[i+13], 5, -1444681467); - d = GG(d, a, b, c, m[i+ 2], 9, -51403784); - c = GG(c, d, a, b, m[i+ 7], 14, 1735328473); - b = GG(b, c, d, a, m[i+12], 20, -1926607734); - - a = HH(a, b, c, d, m[i+ 5], 4, -378558); - d = HH(d, a, b, c, m[i+ 8], 11, -2022574463); - c = HH(c, d, a, b, m[i+11], 16, 1839030562); - b = HH(b, c, d, a, m[i+14], 23, -35309556); - a = HH(a, b, c, d, m[i+ 1], 4, -1530992060); - d = HH(d, a, b, c, m[i+ 4], 11, 1272893353); - c = HH(c, d, a, b, m[i+ 7], 16, -155497632); - b = HH(b, c, d, a, m[i+10], 23, -1094730640); - a = HH(a, b, c, d, m[i+13], 4, 681279174); - d = HH(d, a, b, c, m[i+ 0], 11, -358537222); - c = HH(c, d, a, b, m[i+ 3], 16, -722521979); - b = HH(b, c, d, a, m[i+ 6], 23, 76029189); - a = HH(a, b, c, d, m[i+ 9], 4, -640364487); - d = HH(d, a, b, c, m[i+12], 11, -421815835); - c = HH(c, d, a, b, m[i+15], 16, 530742520); - b = HH(b, c, d, a, m[i+ 2], 23, -995338651); - - a = II(a, b, c, d, m[i+ 0], 6, -198630844); - d = II(d, a, b, c, m[i+ 7], 10, 1126891415); - c = II(c, d, a, b, m[i+14], 15, -1416354905); - b = II(b, c, d, a, m[i+ 5], 21, -57434055); - a = II(a, b, c, d, m[i+12], 6, 1700485571); - d = II(d, a, b, c, m[i+ 3], 10, -1894986606); - c = II(c, d, a, b, m[i+10], 15, -1051523); - b = II(b, c, d, a, m[i+ 1], 21, -2054922799); - a = II(a, b, c, d, m[i+ 8], 6, 1873313359); - d = II(d, a, b, c, m[i+15], 10, -30611744); - c = II(c, d, a, b, m[i+ 6], 15, -1560198380); - b = II(b, c, d, a, m[i+13], 21, 1309151649); - a = II(a, b, c, d, m[i+ 4], 6, -145523070); - d = II(d, a, b, c, m[i+11], 10, -1120210379); - c = II(c, d, a, b, m[i+ 2], 15, 718787259); - b = II(b, c, d, a, m[i+ 9], 21, -343485551); - - a = (a + aa) >>> 0; - b = (b + bb) >>> 0; - c = (c + cc) >>> 0; - d = (d + dd) >>> 0; - } - - return crypt.endian([a, b, c, d]); - }; - - // Auxiliary functions - md5._ff = function (a, b, c, d, x, s, t) { - var n = a + (b & c | ~b & d) + (x >>> 0) + t; - return ((n << s) | (n >>> (32 - s))) + b; - }; - md5._gg = function (a, b, c, d, x, s, t) { - var n = a + (b & d | c & ~d) + (x >>> 0) + t; - return ((n << s) | (n >>> (32 - s))) + b; - }; - md5._hh = function (a, b, c, d, x, s, t) { - var n = a + (b ^ c ^ d) + (x >>> 0) + t; - return ((n << s) | (n >>> (32 - s))) + b; - }; - md5._ii = function (a, b, c, d, x, s, t) { - var n = a + (c ^ (b | ~d)) + (x >>> 0) + t; - return ((n << s) | (n >>> (32 - s))) + b; - }; - - // Package private blocksize - md5._blocksize = 16; - md5._digestsize = 16; - - module.exports = function (message, options) { - if (message === undefined || message === null) - throw new Error('Illegal argument ' + message); - - var digestbytes = crypt.wordsToBytes(md5(message, options)); - return options && options.asBytes ? digestbytes : - options && options.asString ? bin.bytesToString(digestbytes) : - crypt.bytesToHex(digestbytes); - }; - -})(); diff --git a/node_modules/md5/package.json b/node_modules/md5/package.json deleted file mode 100644 index 6440e11d6..000000000 --- a/node_modules/md5/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_from": "md5@^2.2.1", - "_id": "md5@2.2.1", - "_inBundle": false, - "_integrity": "sha1-U6s41f48iJG6RlMp6iP6wFQBJvk=", - "_location": "/md5", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "md5@^2.2.1", - "name": "md5", - "escapedName": "md5", - "rawSpec": "^2.2.1", - "saveSpec": null, - "fetchSpec": "^2.2.1" - }, - "_requiredBy": [ - "/pem" - ], - "_resolved": "https://registry.npmjs.org/md5/-/md5-2.2.1.tgz", - "_shasum": "53ab38d5fe3c8891ba465329ea23fac0540126f9", - "_spec": "md5@^2.2.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/pem", - "author": { - "name": "Paul Vorbach", - "email": "paul@vorba.ch", - "url": "http://paul.vorba.ch" - }, - "bugs": { - "url": "https://github.com/pvorb/node-md5/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "salba" - } - ], - "dependencies": { - "charenc": "~0.0.1", - "crypt": "~0.0.1", - "is-buffer": "~1.1.1" - }, - "deprecated": false, - "description": "js function for hashing messages with MD5", - "devDependencies": { - "mocha": "~2.3.4" - }, - "homepage": "https://github.com/pvorb/node-md5#readme", - "license": "BSD-3-Clause", - "main": "md5.js", - "name": "md5", - "optionalDependencies": {}, - "repository": { - "type": "git", - "url": "git://github.com/pvorb/node-md5.git" - }, - "scripts": { - "test": "mocha" - }, - "tags": [ - "md5", - "hash", - "encryption", - "message digest" - ], - "version": "2.2.1" -} diff --git a/node_modules/md5/test.js b/node_modules/md5/test.js deleted file mode 100644 index db6378bfc..000000000 --- a/node_modules/md5/test.js +++ /dev/null @@ -1,45 +0,0 @@ -var md5 = require('./md5.js'); -var assert = require('assert'); - -describe('md5', function () { - - it('should throw an error for `undefined`', function() { - assert.throws(function() { - md5(undefined); - }); - }); - - it('should throw an error for `null`', function() { - assert.throws(function() { - md5(null); - }); - }); - - it('should return the expected MD5 hash for "message"', function() { - assert.equal('78e731027d8fd50ed642340b7c9a63b3', md5('message')); - }); - - it('should not return the same hash for random numbers twice', function() { - var msg1 = Math.floor((Math.random() * 100000) + 1) + (new Date).getTime(); - var msg2 = Math.floor((Math.random() * 100000) + 1) + (new Date).getTime(); - - if (msg1 !== msg2) { - assert.notEqual(md5(msg1), md5(msg2)); - } else { - assert.equal(md5(msg1), md5(msg1)); - } - }); - - it('should support Node.js Buffers', function() { - var buffer = new Buffer('message áßäöü', 'utf8'); - - assert.equal(md5(buffer), md5('message áßäöü')); - }) - - it('should be able to use a binary encoded string', function() { - var hash1 = md5('abc', { asString: true }); - var hash2 = md5(hash1 + 'a', { asString: true, encoding : 'binary' }); - var hash3 = md5(hash1 + 'a', { encoding : 'binary' }); - assert.equal(hash3, '131f0ac52813044f5110e4aec638c169'); - }); -}); diff --git a/node_modules/micromatch/LICENSE b/node_modules/micromatch/LICENSE deleted file mode 100755 index fa30c4cb3..000000000 --- a/node_modules/micromatch/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/micromatch/README.md b/node_modules/micromatch/README.md deleted file mode 100644 index 8fb391910..000000000 --- a/node_modules/micromatch/README.md +++ /dev/null @@ -1,689 +0,0 @@ -# micromatch [![NPM version](https://img.shields.io/npm/v/micromatch.svg?style=flat)](https://www.npmjs.com/package/micromatch) [![NPM downloads](https://img.shields.io/npm/dm/micromatch.svg?style=flat)](https://npmjs.org/package/micromatch) [![Build Status](https://img.shields.io/travis/jonschlinkert/micromatch.svg?style=flat)](https://travis-ci.org/jonschlinkert/micromatch) - -> Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. - -Micromatch supports all of the same matching features as [minimatch](https://github.com/isaacs/minimatch) and [multimatch](https://github.com/sindresorhus/multimatch). - -* [mm()](#usage) is the same as [multimatch()](https://github.com/sindresorhus/multimatch) -* [mm.match()](#match) is the same as [minimatch.match()](https://github.com/isaacs/minimatch) -* use [mm.isMatch()](#ismatch) instead of [minimatch()](https://github.com/isaacs/minimatch) - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save micromatch -``` - -## Start matching! - -```js -var mm = require('micromatch'); -console.log(mm([''])) -``` - -*** - -### Features - -* [Drop-in replacement](#switch-from-minimatch) for [minimatch](https://github.com/isaacs/minimatch) and [multimatch](https://github.com/sindresorhus/multimatch) -* Built-in support for multiple glob patterns, like `['foo/*.js', '!bar.js']` -* [Brace Expansion](https://github.com/jonschlinkert/braces) (`foo/bar-{1..5}.md`, `one/{two,three}/four.md`) -* Typical glob patterns, like `**/*`, `a/b/*.js`, or `['foo/*.js', '!bar.js']` -* Methods like `.isMatch()`, `.contains()` and `.any()` - -**Extended globbing features:** - -* Logical `OR` (`foo/bar/(abc|xyz).js`) -* Regex character classes (`foo/bar/baz-[1-5].js`) -* POSIX [bracket expressions](https://github.com/jonschlinkert/expand-brackets) (`**/[[:alpha:][:digit:]]/`) -* [extglobs](https://github.com/jonschlinkert/extglob) (`**/+(x|y)`, `!(a|b)`, etc). - -You can combine these to create whatever matching patterns you need. - -**Example** - -```js -// double-negation! -mm(['fa', 'fb', 'f', 'fo'], '!(f!(o))'); -//=> ['fo'] -``` - -## Why switch to micromatch? - -* Native support for multiple glob patterns, no need for wrappers like [multimatch](https://github.com/sindresorhus/multimatch) -* [10-55x faster](#benchmarks) and more performant than [minimatch](https://github.com/isaacs/minimatch) and [multimatch](https://github.com/sindresorhus/multimatch). This is achieved through a combination of caching and regex optimization strategies, a fundamentally different approach than minimatch. -* More extensive support for the Bash 4.3 specification -* More complete extglob support -* Extensive [unit tests](./test) (approx. 1,300 tests). Minimatch fails many of the tests. - -### Switch from minimatch - -Use `mm.isMatch()` instead of `minimatch()`: - -```js -mm.isMatch('foo', 'b*'); -//=> false -``` - -Use `mm.match()` instead of `minimatch.match()`: - -```js -mm.match(['foo', 'bar'], 'b*'); -//=> 'bar' -``` - -### Switch from multimatch - -Same signature: - -```js -mm(['foo', 'bar', 'baz'], ['f*', '*z']); -//=> ['foo', 'baz'] -``` - -*** - -## Usage - -Add micromatch to your node.js project: - -```js -var mm = require('micromatch'); -``` - -**Signature** - -```js -mm(array_of_strings, glob_patterns[, options]); -``` - -**Example** - -```js -mm(['foo', 'bar', 'baz'], 'b*'); -//=> ['bar', 'baz'] -``` - -### Usage examples - -**Brace expansion** - -Match files with `.js` or `.txt` extensions. - -```js -mm(['a.js', 'b.md', 'c.txt'], '*.{js,txt}'); -//=> ['a.js', 'c.txt'] -``` - -**Extglobs** - -Match anything except for files with the `.md` extension. - -```js -mm(files, '**/*.!(md)'); - -//=> ['a.js', 'c.txt'] -``` - -**Multiple patterns** - -Match using an array of patterns. - -```js -mm(['a.md', 'b.js', 'c.txt', 'd.json'], ['*.md', '*.txt']); -//=> ['a.md', 'c.txt'] -``` - -**Negation patterns:** - -Behavior is designed to be what users would expect, based on conventions that are already well-established. - -* [minimatch](https://github.com/isaacs/minimatch) behavior is used when the pattern is a string, so patterns are **inclusive by default**. -* [multimatch](https://github.com/sindresorhus/multimatch) behavior is used when an array of patterns is passed, so patterns are **exclusive by default**. - -```js -mm(['a.js', 'b.md', 'c.txt'], '!*.{js,txt}'); -//=> ['b.md'] - -mm(['a.md', 'b.js', 'c.txt', 'd.json'], ['*.*', '!*.{js,txt}']); -//=> ['a.md', 'd.json'] -``` - -*** - -## API methods - -```js -var mm = require('micromatch'); -``` - -### .match - -```js -mm.match(array, globString); -``` - -Return an array of files that match the given glob pattern. Useful if you only need to use a single glob pattern. - -**Example** - -```js -mm.match(['ab', 'a/b', 'bb', 'b/c'], '?b'); -//=> ['ab', 'bb'] - -mm.match(['ab', 'a/b', 'bb', 'b/c'], '*/b'); -//=> ['a/b'] -``` - -### .isMatch - -```js -mm.isMatch(filepath, globString); -``` - -Returns true if a file path matches the given glob pattern. - -**Example** - -```js -mm.isMatch('.verb.md', '*.md'); -//=> false - -mm.isMatch('.verb.md', '*.md', {dot: true}); -//=> true -``` - -### .contains - -Returns true if any part of a file path matches the given glob pattern. Think of this is "has path" versus "is path". - -**Example** - -`.isMatch()` would return false for both of the following: - -```js -mm.contains('a/b/c', 'a/b'); -//=> true - -mm.contains('a/b/c', 'a/*'); -//=> true -``` - -### .matcher - -Returns a function for matching using the supplied pattern. e.g. create your own "matcher". The advantage of this method is that the pattern can be compiled outside of a loop. - -**Pattern** - -Can be any of the following: - -* `glob/string` -* `regex` -* `function` - -**Example** - -```js -var isMatch = mm.matcher('*.md'); -var files = []; - -['a.md', 'b.txt', 'c.md'].forEach(function(fp) { - if (isMatch(fp)) { - files.push(fp); - } -}); -``` - -### .filter - -Returns a function that can be passed to `Array#filter()`. - -**Params** - -* `patterns` **{String|Array}**: - -**Examples** - -Single glob: - -```js -var fn = mm.filter('*.md'); -['a.js', 'b.txt', 'c.md'].filter(fn); -//=> ['c.md'] - -var fn = mm.filter('[a-c]'); -['a', 'b', 'c', 'd', 'e'].filter(fn); -//=> ['a', 'b', 'c'] -``` - -Array of glob patterns: - -```js -var arr = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]; - -var fn = mm.filter(['{1..10}', '![7-9]', '!{3..4}']); -arr.filter(fn); -//=> [1, 2, 5, 6, 10] -``` - -_(Internally this function generates the matching function by using the [matcher](#matcher) method. You can use the [matcher](#matcher) method directly to create your own filter function)_ - -### .any - -Returns true if a file path matches any of the given patterns. - -```js -mm.any(filepath, patterns, options); -``` - -**Params** - -* filepath `{String}`: The file path to test. -* patterns `{String|Array}`: One or more glob patterns -* options: `{Object}`: options to pass to the `.matcher()` method. - -**Example** - -```js -mm.any('abc', ['!*z']); -//=> true -mm.any('abc', ['a*', 'z*']); -//=> true -mm.any('abc', 'a*'); -//=> true -mm.any('abc', ['z*']); -//=> false -``` - -### .expand - -Returns an object with a regex-compatible string and tokens. - -```js -mm.expand('*.js'); - -// when `track` is enabled (for debugging), the `history` array is used -// to record each mutation to the glob pattern as it's converted to regex -{ options: { track: false, dot: undefined, makeRe: true, negated: false }, - pattern: '(.*\\/|^)bar\\/(?:(?!(?:^|\\/)\\.).)*?', - history: [], - tokens: - { path: - { whole: '**/bar/**', - dirname: '**/bar/', - filename: '**', - basename: '**', - extname: '', - ext: '' }, - is: - { glob: true, - negated: false, - globstar: true, - dotfile: false, - dotdir: false }, - match: {}, - original: '**/bar/**', - pattern: '**/bar/**', - base: '' } } -``` - -### .makeRe - -Create a regular expression for matching file paths based on the given pattern: - -```js -mm.makeRe('*.js'); -//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ -``` - -## Options - -### options.unixify - -Normalize slashes in file paths and glob patterns to forward slashes. - -Type: `{Boolean}` - -Default: `undefined` on non-windows, `true` on windows. - -### options.dot - -Match dotfiles. Same behavior as [minimatch](https://github.com/isaacs/minimatch). - -Type: `{Boolean}` - -Default: `false` - -### options.unescape - -Unescape slashes in glob patterns. Use cautiously, especially on windows. - -Type: `{Boolean}` - -Default: `undefined` - -**Example** - -```js -mm.isMatch('abc', '\\a\\b\\c', {unescape: true}); -//=> true -``` - -### options.nodupes - -Remove duplicate elements from the result array. - -Type: `{Boolean}` - -Default: `undefined` - -**Example** - -Example of using the `unescape` and `nodupes` options together: - -```js -mm.match(['abc', '\\a\\b\\c'], '\\a\\b\\c', {unescape: true}); -//=> ['abc', 'abc'] - -mm.match(['abc', '\\a\\b\\c'], '\\a\\b\\c', {unescape: true, nodupes: true}); -//=> ['abc'] -``` - -### options.matchBase - -Allow glob patterns without slashes to match a file path based on its basename. . Same behavior as [minimatch](https://github.com/isaacs/minimatch). - -Type: `{Boolean}` - -Default: `false` - -**Example** - -```js -mm(['a/b.js', 'a/c.md'], '*.js'); -//=> [] - -mm(['a/b.js', 'a/c.md'], '*.js', {matchBase: true}); -//=> ['a/b.js'] -``` - -### options.nobraces - -Don't expand braces in glob patterns. Same behavior as [minimatch](https://github.com/isaacs/minimatch) `nobrace`. - -Type: `{Boolean}` - -Default: `undefined` - -See [braces](https://github.com/jonschlinkert/braces) for more information about extended brace expansion. - -### options.nobrackets - -Don't expand POSIX bracket expressions. - -Type: `{Boolean}` - -Default: `undefined` - -See [expand-brackets](https://github.com/jonschlinkert/expand-brackets) for more information about extended bracket expressions. - -### options.noextglob - -Don't expand extended globs. - -Type: `{Boolean}` - -Default: `undefined` - -See [extglob](https://github.com/jonschlinkert/extglob) for more information about extended globs. - -### options.nocase - -Use a case-insensitive regex for matching files. Same behavior as [minimatch](https://github.com/isaacs/minimatch). - -Type: `{Boolean}` - -Default: `false` - -### options.nonegate - -Disallow negation (`!`) patterns. - -Type: `{Boolean}` - -Default: `false` - -### options.nonull - -If `true`, when no matches are found the actual (array-ified) glob pattern is returned instead of an empty array. Same behavior as [minimatch](https://github.com/isaacs/minimatch). - -Type: `{Boolean}` - -Default: `false` - -### options.cache - -Cache the platform (e.g. `win32`) to prevent this from being looked up for every filepath. - -Type: `{Boolean}` - -Default: `true` - -*** - -## Other features - -Micromatch also supports the following. - -### Extended globbing - -#### extglobs - -Extended globbing, as described by the bash man page: - -| **pattern** | **regex equivalent** | **description** | -| --- | --- | --- | -| `?(pattern-list)` | `(... | ...)?` | Matches zero or one occurrence of the given patterns | -| `*(pattern-list)` | `(... | ...)*` | Matches zero or more occurrences of the given patterns | -| `+(pattern-list)` | `(... | ...)+` | Matches one or more occurrences of the given patterns | -| `@(pattern-list)` | `(... | ...)` * | Matches one of the given patterns | -| `!(pattern-list)` | N/A | Matches anything except one of the given patterns | - -* `@` isn't a RegEx character. - -Powered by [extglob](https://github.com/jonschlinkert/extglob). Visit that library for the full range of options or to report extglob related issues. - -See [extglob](https://github.com/jonschlinkert/extglob) for more information about extended globs. - -#### brace expansion - -In simple cases, brace expansion appears to work the same way as the logical `OR` operator. For example, `(a|b)` will achieve the same result as `{a,b}`. - -Here are some powerful features unique to brace expansion (versus character classes): - -* range expansion: `a{1..3}b/*.js` expands to: `['a1b/*.js', 'a2b/*.js', 'a3b/*.js']` -* nesting: `a{c,{d,e}}b/*.js` expands to: `['acb/*.js', 'adb/*.js', 'aeb/*.js']` - -Visit [braces](https://github.com/jonschlinkert/braces) to ask questions and create an issue related to brace-expansion, or to see the full range of features and options related to brace expansion. - -#### regex character classes - -With the exception of brace expansion (`{a,b}`, `{1..5}`, etc), most of the special characters convert directly to regex, so you can expect them to follow the same rules and produce the same results as regex. - -For example, given the list: `['a.js', 'b.js', 'c.js', 'd.js', 'E.js']`: - -* `[ac].js`: matches both `a` and `c`, returning `['a.js', 'c.js']` -* `[b-d].js`: matches from `b` to `d`, returning `['b.js', 'c.js', 'd.js']` -* `[b-d].js`: matches from `b` to `d`, returning `['b.js', 'c.js', 'd.js']` -* `a/[A-Z].js`: matches and uppercase letter, returning `['a/E.md']` - -Learn about [regex character classes](http://www.regular-expressions.info/charclass.html). - -#### regex groups - -Given `['a.js', 'b.js', 'c.js', 'd.js', 'E.js']`: - -* `(a|c).js`: would match either `a` or `c`, returning `['a.js', 'c.js']` -* `(b|d).js`: would match either `b` or `d`, returning `['b.js', 'd.js']` -* `(b|[A-Z]).js`: would match either `b` or an uppercase letter, returning `['b.js', 'E.js']` - -As with regex, parenthese can be nested, so patterns like `((a|b)|c)/b` will work. But it might be easier to achieve your goal using brace expansion. - -#### POSIX bracket expressions - -**Example** - -```js -mm.isMatch('a1', '[[:alpha:][:digit:]]'); -//=> true -``` - -See [expand-brackets](https://github.com/jonschlinkert/expand-brackets) for more information about extended bracket expressions. - -*** - -## Notes - -Whenever possible parsing behavior for patterns is based on globbing specifications in Bash 4.3. Patterns that aren't described by Bash follow wildmatch spec (used by git). - -## Benchmarks - -Run the [benchmarks](./benchmark): - -```bash -node benchmark -``` - -As of July 15, 2016: - -```bash -#1: basename-braces - micromatch x 26,420 ops/sec ±0.89% (91 runs sampled) - minimatch x 3,507 ops/sec ±0.64% (97 runs sampled) - -#2: basename - micromatch x 25,315 ops/sec ±0.82% (93 runs sampled) - minimatch x 4,398 ops/sec ±0.86% (94 runs sampled) - -#3: braces-no-glob - micromatch x 341,254 ops/sec ±0.78% (93 runs sampled) - minimatch x 30,197 ops/sec ±1.12% (91 runs sampled) - -#4: braces - micromatch x 54,649 ops/sec ±0.74% (94 runs sampled) - minimatch x 3,095 ops/sec ±0.82% (95 runs sampled) - -#5: immediate - micromatch x 16,719 ops/sec ±0.79% (95 runs sampled) - minimatch x 4,348 ops/sec ±0.86% (96 runs sampled) - -#6: large - micromatch x 721 ops/sec ±0.77% (94 runs sampled) - minimatch x 17.73 ops/sec ±1.08% (50 runs sampled) - -#7: long - micromatch x 5,051 ops/sec ±0.87% (97 runs sampled) - minimatch x 628 ops/sec ±0.83% (94 runs sampled) - -#8: mid - micromatch x 51,280 ops/sec ±0.80% (95 runs sampled) - minimatch x 1,923 ops/sec ±0.84% (95 runs sampled) - -#9: multi-patterns - micromatch x 22,440 ops/sec ±0.97% (94 runs sampled) - minimatch x 2,481 ops/sec ±1.10% (94 runs sampled) - -#10: no-glob - micromatch x 722,823 ops/sec ±1.30% (87 runs sampled) - minimatch x 52,967 ops/sec ±1.09% (94 runs sampled) - -#11: range - micromatch x 243,471 ops/sec ±0.79% (94 runs sampled) - minimatch x 11,736 ops/sec ±0.82% (96 runs sampled) - -#12: shallow - micromatch x 190,874 ops/sec ±0.98% (95 runs sampled) - minimatch x 21,699 ops/sec ±0.81% (97 runs sampled) - -#13: short - micromatch x 496,393 ops/sec ±3.86% (90 runs sampled) - minimatch x 53,765 ops/sec ±0.75% (95 runs sampled) -``` - -## Tests - -### Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -### Coverage - -As of July 15, 2016: - -```sh -Statements : 100% (441/441) -Branches : 100% (270/270) -Functions : 100% (54/54) -Lines : 100% (429/429) -``` - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -Please be sure to run the benchmarks before/after any code changes to judge the impact before you do a PR. thanks! - -## Related - -* [braces](https://www.npmjs.com/package/braces): Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces… [more](https://github.com/jonschlinkert/braces) | [homepage](https://github.com/jonschlinkert/braces "Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces specification.") -* [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/jonschlinkert/expand-brackets "Expand POSIX bracket expressions (character classes) in glob patterns.") -* [expand-range](https://www.npmjs.com/package/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See… [more](https://github.com/jonschlinkert/expand-range) | [homepage](https://github.com/jonschlinkert/expand-range "Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See the benchmarks. Used by micromatch.") -* [extglob](https://www.npmjs.com/package/extglob): Convert extended globs to regex-compatible strings. Add (almost) the expressive power of regular expressions to… [more](https://github.com/jonschlinkert/extglob) | [homepage](https://github.com/jonschlinkert/extglob "Convert extended globs to regex-compatible strings. Add (almost) the expressive power of regular expressions to glob patterns.") -* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or multiplier to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or multiplier to use.") -* [gulp-micromatch](https://www.npmjs.com/package/gulp-micromatch): Filter vinyl files with glob patterns, string, regexp, array, object or matcher function. micromatch stream. | [homepage](https://github.com/tunnckocore/gulp-micromatch#readme "Filter vinyl files with glob patterns, string, regexp, array, object or matcher function. micromatch stream.") -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") -* [parse-glob](https://www.npmjs.com/package/parse-glob): Parse a glob pattern into an object of tokens. | [homepage](https://github.com/jonschlinkert/parse-glob "Parse a glob pattern into an object of tokens.") - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -## Building docs - -_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ - -To generate the readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install -g verb verb-generate-readme && verb -``` - -## Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -## Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/micromatch/blob/master/LICENSE). - -*** - -_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on July 15, 2016._ \ No newline at end of file diff --git a/node_modules/micromatch/index.js b/node_modules/micromatch/index.js deleted file mode 100755 index f898ec176..000000000 --- a/node_modules/micromatch/index.js +++ /dev/null @@ -1,431 +0,0 @@ -/*! - * micromatch - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var expand = require('./lib/expand'); -var utils = require('./lib/utils'); - -/** - * The main function. Pass an array of filepaths, - * and a string or array of glob patterns - * - * @param {Array|String} `files` - * @param {Array|String} `patterns` - * @param {Object} `opts` - * @return {Array} Array of matches - */ - -function micromatch(files, patterns, opts) { - if (!files || !patterns) return []; - opts = opts || {}; - - if (typeof opts.cache === 'undefined') { - opts.cache = true; - } - - if (!Array.isArray(patterns)) { - return match(files, patterns, opts); - } - - var len = patterns.length, i = 0; - var omit = [], keep = []; - - while (len--) { - var glob = patterns[i++]; - if (typeof glob === 'string' && glob.charCodeAt(0) === 33 /* ! */) { - omit.push.apply(omit, match(files, glob.slice(1), opts)); - } else { - keep.push.apply(keep, match(files, glob, opts)); - } - } - return utils.diff(keep, omit); -} - -/** - * Return an array of files that match the given glob pattern. - * - * This function is called by the main `micromatch` function If you only - * need to pass a single pattern you might get very minor speed improvements - * using this function. - * - * @param {Array} `files` - * @param {String} `pattern` - * @param {Object} `options` - * @return {Array} - */ - -function match(files, pattern, opts) { - if (utils.typeOf(files) !== 'string' && !Array.isArray(files)) { - throw new Error(msg('match', 'files', 'a string or array')); - } - - files = utils.arrayify(files); - opts = opts || {}; - - var negate = opts.negate || false; - var orig = pattern; - - if (typeof pattern === 'string') { - negate = pattern.charAt(0) === '!'; - if (negate) { - pattern = pattern.slice(1); - } - - // we need to remove the character regardless, - // so the above logic is still needed - if (opts.nonegate === true) { - negate = false; - } - } - - var _isMatch = matcher(pattern, opts); - var len = files.length, i = 0; - var res = []; - - while (i < len) { - var file = files[i++]; - var fp = utils.unixify(file, opts); - - if (!_isMatch(fp)) { continue; } - res.push(fp); - } - - if (res.length === 0) { - if (opts.failglob === true) { - throw new Error('micromatch.match() found no matches for: "' + orig + '".'); - } - - if (opts.nonull || opts.nullglob) { - res.push(utils.unescapeGlob(orig)); - } - } - - // if `negate` was defined, diff negated files - if (negate) { res = utils.diff(files, res); } - - // if `ignore` was defined, diff ignored filed - if (opts.ignore && opts.ignore.length) { - pattern = opts.ignore; - opts = utils.omit(opts, ['ignore']); - res = utils.diff(res, micromatch(res, pattern, opts)); - } - - if (opts.nodupes) { - return utils.unique(res); - } - return res; -} - -/** - * Returns a function that takes a glob pattern or array of glob patterns - * to be used with `Array#filter()`. (Internally this function generates - * the matching function using the [matcher] method). - * - * ```js - * var fn = mm.filter('[a-c]'); - * ['a', 'b', 'c', 'd', 'e'].filter(fn); - * //=> ['a', 'b', 'c'] - * ``` - * @param {String|Array} `patterns` Can be a glob or array of globs. - * @param {Options} `opts` Options to pass to the [matcher] method. - * @return {Function} Filter function to be passed to `Array#filter()`. - */ - -function filter(patterns, opts) { - if (!Array.isArray(patterns) && typeof patterns !== 'string') { - throw new TypeError(msg('filter', 'patterns', 'a string or array')); - } - - patterns = utils.arrayify(patterns); - var len = patterns.length, i = 0; - var patternMatchers = Array(len); - while (i < len) { - patternMatchers[i] = matcher(patterns[i++], opts); - } - - return function(fp) { - if (fp == null) return []; - var len = patternMatchers.length, i = 0; - var res = true; - - fp = utils.unixify(fp, opts); - while (i < len) { - var fn = patternMatchers[i++]; - if (!fn(fp)) { - res = false; - break; - } - } - return res; - }; -} - -/** - * Returns true if the filepath contains the given - * pattern. Can also return a function for matching. - * - * ```js - * isMatch('foo.md', '*.md', {}); - * //=> true - * - * isMatch('*.md', {})('foo.md') - * //=> true - * ``` - * @param {String} `fp` - * @param {String} `pattern` - * @param {Object} `opts` - * @return {Boolean} - */ - -function isMatch(fp, pattern, opts) { - if (typeof fp !== 'string') { - throw new TypeError(msg('isMatch', 'filepath', 'a string')); - } - - fp = utils.unixify(fp, opts); - if (utils.typeOf(pattern) === 'object') { - return matcher(fp, pattern); - } - return matcher(pattern, opts)(fp); -} - -/** - * Returns true if the filepath matches the - * given pattern. - */ - -function contains(fp, pattern, opts) { - if (typeof fp !== 'string') { - throw new TypeError(msg('contains', 'pattern', 'a string')); - } - - opts = opts || {}; - opts.contains = (pattern !== ''); - fp = utils.unixify(fp, opts); - - if (opts.contains && !utils.isGlob(pattern)) { - return fp.indexOf(pattern) !== -1; - } - return matcher(pattern, opts)(fp); -} - -/** - * Returns true if a file path matches any of the - * given patterns. - * - * @param {String} `fp` The filepath to test. - * @param {String|Array} `patterns` Glob patterns to use. - * @param {Object} `opts` Options to pass to the `matcher()` function. - * @return {String} - */ - -function any(fp, patterns, opts) { - if (!Array.isArray(patterns) && typeof patterns !== 'string') { - throw new TypeError(msg('any', 'patterns', 'a string or array')); - } - - patterns = utils.arrayify(patterns); - var len = patterns.length; - - fp = utils.unixify(fp, opts); - while (len--) { - var isMatch = matcher(patterns[len], opts); - if (isMatch(fp)) { - return true; - } - } - return false; -} - -/** - * Filter the keys of an object with the given `glob` pattern - * and `options` - * - * @param {Object} `object` - * @param {Pattern} `object` - * @return {Array} - */ - -function matchKeys(obj, glob, options) { - if (utils.typeOf(obj) !== 'object') { - throw new TypeError(msg('matchKeys', 'first argument', 'an object')); - } - - var fn = matcher(glob, options); - var res = {}; - - for (var key in obj) { - if (obj.hasOwnProperty(key) && fn(key)) { - res[key] = obj[key]; - } - } - return res; -} - -/** - * Return a function for matching based on the - * given `pattern` and `options`. - * - * @param {String} `pattern` - * @param {Object} `options` - * @return {Function} - */ - -function matcher(pattern, opts) { - // pattern is a function - if (typeof pattern === 'function') { - return pattern; - } - // pattern is a regex - if (pattern instanceof RegExp) { - return function(fp) { - return pattern.test(fp); - }; - } - - if (typeof pattern !== 'string') { - throw new TypeError(msg('matcher', 'pattern', 'a string, regex, or function')); - } - - // strings, all the way down... - pattern = utils.unixify(pattern, opts); - - // pattern is a non-glob string - if (!utils.isGlob(pattern)) { - return utils.matchPath(pattern, opts); - } - // pattern is a glob string - var re = makeRe(pattern, opts); - - // `matchBase` is defined - if (opts && opts.matchBase) { - return utils.hasFilename(re, opts); - } - // `matchBase` is not defined - return function(fp) { - fp = utils.unixify(fp, opts); - return re.test(fp); - }; -} - -/** - * Create and cache a regular expression for matching - * file paths. - * - * If the leading character in the `glob` is `!`, a negation - * regex is returned. - * - * @param {String} `glob` - * @param {Object} `options` - * @return {RegExp} - */ - -function toRegex(glob, options) { - // clone options to prevent mutating the original object - var opts = Object.create(options || {}); - var flags = opts.flags || ''; - if (opts.nocase && flags.indexOf('i') === -1) { - flags += 'i'; - } - - var parsed = expand(glob, opts); - - // pass in tokens to avoid parsing more than once - opts.negated = opts.negated || parsed.negated; - opts.negate = opts.negated; - glob = wrapGlob(parsed.pattern, opts); - var re; - - try { - re = new RegExp(glob, flags); - return re; - } catch (err) { - err.reason = 'micromatch invalid regex: (' + re + ')'; - if (opts.strict) throw new SyntaxError(err); - } - - // we're only here if a bad pattern was used and the user - // passed `options.silent`, so match nothing - return /$^/; -} - -/** - * Create the regex to do the matching. If the leading - * character in the `glob` is `!` a negation regex is returned. - * - * @param {String} `glob` - * @param {Boolean} `negate` - */ - -function wrapGlob(glob, opts) { - var prefix = (opts && !opts.contains) ? '^' : ''; - var after = (opts && !opts.contains) ? '$' : ''; - glob = ('(?:' + glob + ')' + after); - if (opts && opts.negate) { - return prefix + ('(?!^' + glob + ').*$'); - } - return prefix + glob; -} - -/** - * Create and cache a regular expression for matching file paths. - * If the leading character in the `glob` is `!`, a negation - * regex is returned. - * - * @param {String} `glob` - * @param {Object} `options` - * @return {RegExp} - */ - -function makeRe(glob, opts) { - if (utils.typeOf(glob) !== 'string') { - throw new Error(msg('makeRe', 'glob', 'a string')); - } - return utils.cache(toRegex, glob, opts); -} - -/** - * Make error messages consistent. Follows this format: - * - * ```js - * msg(methodName, argNumber, nativeType); - * // example: - * msg('matchKeys', 'first', 'an object'); - * ``` - * - * @param {String} `method` - * @param {String} `num` - * @param {String} `type` - * @return {String} - */ - -function msg(method, what, type) { - return 'micromatch.' + method + '(): ' + what + ' should be ' + type + '.'; -} - -/** - * Public methods - */ - -/* eslint no-multi-spaces: 0 */ -micromatch.any = any; -micromatch.braces = micromatch.braceExpand = utils.braces; -micromatch.contains = contains; -micromatch.expand = expand; -micromatch.filter = filter; -micromatch.isMatch = isMatch; -micromatch.makeRe = makeRe; -micromatch.match = match; -micromatch.matcher = matcher; -micromatch.matchKeys = matchKeys; - -/** - * Expose `micromatch` - */ - -module.exports = micromatch; diff --git a/node_modules/micromatch/lib/chars.js b/node_modules/micromatch/lib/chars.js deleted file mode 100644 index a1ffe3714..000000000 --- a/node_modules/micromatch/lib/chars.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict'; - -var chars = {}, unesc, temp; - -function reverse(object, prepender) { - return Object.keys(object).reduce(function(reversed, key) { - var newKey = prepender ? prepender + key : key; // Optionally prepend a string to key. - reversed[object[key]] = newKey; // Swap key and value. - return reversed; // Return the result. - }, {}); -} - -/** - * Regex for common characters - */ - -chars.escapeRegex = { - '?': /\?/g, - '@': /\@/g, - '!': /\!/g, - '+': /\+/g, - '*': /\*/g, - '(': /\(/g, - ')': /\)/g, - '[': /\[/g, - ']': /\]/g -}; - -/** - * Escape characters - */ - -chars.ESC = { - '?': '__UNESC_QMRK__', - '@': '__UNESC_AMPE__', - '!': '__UNESC_EXCL__', - '+': '__UNESC_PLUS__', - '*': '__UNESC_STAR__', - ',': '__UNESC_COMMA__', - '(': '__UNESC_LTPAREN__', - ')': '__UNESC_RTPAREN__', - '[': '__UNESC_LTBRACK__', - ']': '__UNESC_RTBRACK__' -}; - -/** - * Unescape characters - */ - -chars.UNESC = unesc || (unesc = reverse(chars.ESC, '\\')); - -chars.ESC_TEMP = { - '?': '__TEMP_QMRK__', - '@': '__TEMP_AMPE__', - '!': '__TEMP_EXCL__', - '*': '__TEMP_STAR__', - '+': '__TEMP_PLUS__', - ',': '__TEMP_COMMA__', - '(': '__TEMP_LTPAREN__', - ')': '__TEMP_RTPAREN__', - '[': '__TEMP_LTBRACK__', - ']': '__TEMP_RTBRACK__' -}; - -chars.TEMP = temp || (temp = reverse(chars.ESC_TEMP)); - -module.exports = chars; diff --git a/node_modules/micromatch/lib/expand.js b/node_modules/micromatch/lib/expand.js deleted file mode 100644 index e99b081eb..000000000 --- a/node_modules/micromatch/lib/expand.js +++ /dev/null @@ -1,304 +0,0 @@ -/*! - * micromatch - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var utils = require('./utils'); -var Glob = require('./glob'); - -/** - * Expose `expand` - */ - -module.exports = expand; - -/** - * Expand a glob pattern to resolve braces and - * similar patterns before converting to regex. - * - * @param {String|Array} `pattern` - * @param {Array} `files` - * @param {Options} `opts` - * @return {Array} - */ - -function expand(pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('micromatch.expand(): argument should be a string.'); - } - - var glob = new Glob(pattern, options || {}); - var opts = glob.options; - - if (!utils.isGlob(pattern)) { - glob.pattern = glob.pattern.replace(/([\/.])/g, '\\$1'); - return glob; - } - - glob.pattern = glob.pattern.replace(/(\+)(?!\()/g, '\\$1'); - glob.pattern = glob.pattern.split('$').join('\\$'); - - if (typeof opts.braces !== 'boolean' && typeof opts.nobraces !== 'boolean') { - opts.braces = true; - } - - if (glob.pattern === '.*') { - return { - pattern: '\\.' + star, - tokens: tok, - options: opts - }; - } - - if (glob.pattern === '*') { - return { - pattern: oneStar(opts.dot), - tokens: tok, - options: opts - }; - } - - // parse the glob pattern into tokens - glob.parse(); - var tok = glob.tokens; - tok.is.negated = opts.negated; - - // dotfile handling - if ((opts.dotfiles === true || tok.is.dotfile) && opts.dot !== false) { - opts.dotfiles = true; - opts.dot = true; - } - - if ((opts.dotdirs === true || tok.is.dotdir) && opts.dot !== false) { - opts.dotdirs = true; - opts.dot = true; - } - - // check for braces with a dotfile pattern - if (/[{,]\./.test(glob.pattern)) { - opts.makeRe = false; - opts.dot = true; - } - - if (opts.nonegate !== true) { - opts.negated = glob.negated; - } - - // if the leading character is a dot or a slash, escape it - if (glob.pattern.charAt(0) === '.' && glob.pattern.charAt(1) !== '/') { - glob.pattern = '\\' + glob.pattern; - } - - /** - * Extended globs - */ - - // expand braces, e.g `{1..5}` - glob.track('before braces'); - if (tok.is.braces) { - glob.braces(); - } - glob.track('after braces'); - - // expand extglobs, e.g `foo/!(a|b)` - glob.track('before extglob'); - if (tok.is.extglob) { - glob.extglob(); - } - glob.track('after extglob'); - - // expand brackets, e.g `[[:alpha:]]` - glob.track('before brackets'); - if (tok.is.brackets) { - glob.brackets(); - } - glob.track('after brackets'); - - // special patterns - glob._replace('[!', '[^'); - glob._replace('(?', '(%~'); - glob._replace(/\[\]/, '\\[\\]'); - glob._replace('/[', '/' + (opts.dot ? dotfiles : nodot) + '[', true); - glob._replace('/?', '/' + (opts.dot ? dotfiles : nodot) + '[^/]', true); - glob._replace('/.', '/(?=.)\\.', true); - - // windows drives - glob._replace(/^(\w):([\\\/]+?)/gi, '(?=.)$1:$2', true); - - // negate slashes in exclusion ranges - if (glob.pattern.indexOf('[^') !== -1) { - glob.pattern = negateSlash(glob.pattern); - } - - if (opts.globstar !== false && glob.pattern === '**') { - glob.pattern = globstar(opts.dot); - - } else { - glob.pattern = balance(glob.pattern, '[', ']'); - glob.escape(glob.pattern); - - // if the pattern has `**` - if (tok.is.globstar) { - glob.pattern = collapse(glob.pattern, '/**'); - glob.pattern = collapse(glob.pattern, '**/'); - glob._replace('/**/', '(?:/' + globstar(opts.dot) + '/|/)', true); - glob._replace(/\*{2,}/g, '**'); - - // 'foo/*' - glob._replace(/(\w+)\*(?!\/)/g, '$1[^/]*?', true); - glob._replace(/\*\*\/\*(\w)/g, globstar(opts.dot) + '\\/' + (opts.dot ? dotfiles : nodot) + '[^/]*?$1', true); - - if (opts.dot !== true) { - glob._replace(/\*\*\/(.)/g, '(?:**\\/|)$1'); - } - - // 'foo/**' or '{**,*}', but not 'foo**' - if (tok.path.dirname !== '' || /,\*\*|\*\*,/.test(glob.orig)) { - glob._replace('**', globstar(opts.dot), true); - } - } - - // ends with /* - glob._replace(/\/\*$/, '\\/' + oneStar(opts.dot), true); - // ends with *, no slashes - glob._replace(/(?!\/)\*$/, star, true); - // has 'n*.' (partial wildcard w/ file extension) - glob._replace(/([^\/]+)\*/, '$1' + oneStar(true), true); - // has '*' - glob._replace('*', oneStar(opts.dot), true); - glob._replace('?.', '?\\.', true); - glob._replace('?:', '?:', true); - - glob._replace(/\?+/g, function(match) { - var len = match.length; - if (len === 1) { - return qmark; - } - return qmark + '{' + len + '}'; - }); - - // escape '.abc' => '\\.abc' - glob._replace(/\.([*\w]+)/g, '\\.$1'); - // fix '[^\\\\/]' - glob._replace(/\[\^[\\\/]+\]/g, qmark); - // '///' => '\/' - glob._replace(/\/+/g, '\\/'); - // '\\\\\\' => '\\' - glob._replace(/\\{2,}/g, '\\'); - } - - // unescape previously escaped patterns - glob.unescape(glob.pattern); - glob._replace('__UNESC_STAR__', '*'); - - // escape dots that follow qmarks - glob._replace('?.', '?\\.'); - - // remove unnecessary slashes in character classes - glob._replace('[^\\/]', qmark); - - if (glob.pattern.length > 1) { - if (/^[\[?*]/.test(glob.pattern)) { - // only prepend the string if we don't want to match dotfiles - glob.pattern = (opts.dot ? dotfiles : nodot) + glob.pattern; - } - } - - return glob; -} - -/** - * Collapse repeated character sequences. - * - * ```js - * collapse('a/../../../b', '../'); - * //=> 'a/../b' - * ``` - * - * @param {String} `str` - * @param {String} `ch` Character sequence to collapse - * @return {String} - */ - -function collapse(str, ch) { - var res = str.split(ch); - var isFirst = res[0] === ''; - var isLast = res[res.length - 1] === ''; - res = res.filter(Boolean); - if (isFirst) res.unshift(''); - if (isLast) res.push(''); - return res.join(ch); -} - -/** - * Negate slashes in exclusion ranges, per glob spec: - * - * ```js - * negateSlash('[^foo]'); - * //=> '[^\\/foo]' - * ``` - * - * @param {String} `str` glob pattern - * @return {String} - */ - -function negateSlash(str) { - return str.replace(/\[\^([^\]]*?)\]/g, function(match, inner) { - if (inner.indexOf('/') === -1) { - inner = '\\/' + inner; - } - return '[^' + inner + ']'; - }); -} - -/** - * Escape imbalanced braces/bracket. This is a very - * basic, naive implementation that only does enough - * to serve the purpose. - */ - -function balance(str, a, b) { - var aarr = str.split(a); - var alen = aarr.join('').length; - var blen = str.split(b).join('').length; - - if (alen !== blen) { - str = aarr.join('\\' + a); - return str.split(b).join('\\' + b); - } - return str; -} - -/** - * Special patterns to be converted to regex. - * Heuristics are used to simplify patterns - * and speed up processing. - */ - -/* eslint no-multi-spaces: 0 */ -var qmark = '[^/]'; -var star = qmark + '*?'; -var nodot = '(?!\\.)(?=.)'; -var dotfileGlob = '(?:\\/|^)\\.{1,2}($|\\/)'; -var dotfiles = '(?!' + dotfileGlob + ')(?=.)'; -var twoStarDot = '(?:(?!' + dotfileGlob + ').)*?'; - -/** - * Create a regex for `*`. - * - * If `dot` is true, or the pattern does not begin with - * a leading star, then return the simpler regex. - */ - -function oneStar(dotfile) { - return dotfile ? '(?!' + dotfileGlob + ')(?=.)' + star : (nodot + star); -} - -function globstar(dotfile) { - if (dotfile) { return twoStarDot; } - return '(?:(?!(?:\\/|^)\\.).)*?'; -} diff --git a/node_modules/micromatch/lib/glob.js b/node_modules/micromatch/lib/glob.js deleted file mode 100644 index c61332673..000000000 --- a/node_modules/micromatch/lib/glob.js +++ /dev/null @@ -1,193 +0,0 @@ -'use strict'; - -var chars = require('./chars'); -var utils = require('./utils'); - -/** - * Expose `Glob` - */ - -var Glob = module.exports = function Glob(pattern, options) { - if (!(this instanceof Glob)) { - return new Glob(pattern, options); - } - this.options = options || {}; - this.pattern = pattern; - this.history = []; - this.tokens = {}; - this.init(pattern); -}; - -/** - * Initialize defaults - */ - -Glob.prototype.init = function(pattern) { - this.orig = pattern; - this.negated = this.isNegated(); - this.options.track = this.options.track || false; - this.options.makeRe = true; -}; - -/** - * Push a change into `glob.history`. Useful - * for debugging. - */ - -Glob.prototype.track = function(msg) { - if (this.options.track) { - this.history.push({msg: msg, pattern: this.pattern}); - } -}; - -/** - * Return true if `glob.pattern` was negated - * with `!`, also remove the `!` from the pattern. - * - * @return {Boolean} - */ - -Glob.prototype.isNegated = function() { - if (this.pattern.charCodeAt(0) === 33 /* '!' */) { - this.pattern = this.pattern.slice(1); - return true; - } - return false; -}; - -/** - * Expand braces in the given glob pattern. - * - * We only need to use the [braces] lib when - * patterns are nested. - */ - -Glob.prototype.braces = function() { - if (this.options.nobraces !== true && this.options.nobrace !== true) { - // naive/fast check for imbalanced characters - var a = this.pattern.match(/[\{\(\[]/g); - var b = this.pattern.match(/[\}\)\]]/g); - - // if imbalanced, don't optimize the pattern - if (a && b && (a.length !== b.length)) { - this.options.makeRe = false; - } - - // expand brace patterns and join the resulting array - var expanded = utils.braces(this.pattern, this.options); - this.pattern = expanded.join('|'); - } -}; - -/** - * Expand bracket expressions in `glob.pattern` - */ - -Glob.prototype.brackets = function() { - if (this.options.nobrackets !== true) { - this.pattern = utils.brackets(this.pattern); - } -}; - -/** - * Expand bracket expressions in `glob.pattern` - */ - -Glob.prototype.extglob = function() { - if (this.options.noextglob === true) return; - - if (utils.isExtglob(this.pattern)) { - this.pattern = utils.extglob(this.pattern, {escape: true}); - } -}; - -/** - * Parse the given pattern - */ - -Glob.prototype.parse = function(pattern) { - this.tokens = utils.parseGlob(pattern || this.pattern, true); - return this.tokens; -}; - -/** - * Replace `a` with `b`. Also tracks the change before and - * after each replacement. This is disabled by default, but - * can be enabled by setting `options.track` to true. - * - * Also, when the pattern is a string, `.split()` is used, - * because it's much faster than replace. - * - * @param {RegExp|String} `a` - * @param {String} `b` - * @param {Boolean} `escape` When `true`, escapes `*` and `?` in the replacement. - * @return {String} - */ - -Glob.prototype._replace = function(a, b, escape) { - this.track('before (find): "' + a + '" (replace with): "' + b + '"'); - if (escape) b = esc(b); - if (a && b && typeof a === 'string') { - this.pattern = this.pattern.split(a).join(b); - } else { - this.pattern = this.pattern.replace(a, b); - } - this.track('after'); -}; - -/** - * Escape special characters in the given string. - * - * @param {String} `str` Glob pattern - * @return {String} - */ - -Glob.prototype.escape = function(str) { - this.track('before escape: '); - var re = /["\\](['"]?[^"'\\]['"]?)/g; - - this.pattern = str.replace(re, function($0, $1) { - var o = chars.ESC; - var ch = o && o[$1]; - if (ch) { - return ch; - } - if (/[a-z]/i.test($0)) { - return $0.split('\\').join(''); - } - return $0; - }); - - this.track('after escape: '); -}; - -/** - * Unescape special characters in the given string. - * - * @param {String} `str` - * @return {String} - */ - -Glob.prototype.unescape = function(str) { - var re = /__([A-Z]+)_([A-Z]+)__/g; - this.pattern = str.replace(re, function($0, $1) { - return chars[$1][$0]; - }); - this.pattern = unesc(this.pattern); -}; - -/** - * Escape/unescape utils - */ - -function esc(str) { - str = str.split('?').join('%~'); - str = str.split('*').join('%%'); - return str; -} - -function unesc(str) { - str = str.split('%~').join('?'); - str = str.split('%%').join('*'); - return str; -} diff --git a/node_modules/micromatch/lib/utils.js b/node_modules/micromatch/lib/utils.js deleted file mode 100644 index 7c24a5106..000000000 --- a/node_modules/micromatch/lib/utils.js +++ /dev/null @@ -1,149 +0,0 @@ -'use strict'; - -var win32 = process && process.platform === 'win32'; -var path = require('path'); -var fileRe = require('filename-regex'); -var utils = module.exports; - -/** - * Module dependencies - */ - -utils.diff = require('arr-diff'); -utils.unique = require('array-unique'); -utils.braces = require('braces'); -utils.brackets = require('expand-brackets'); -utils.extglob = require('extglob'); -utils.isExtglob = require('is-extglob'); -utils.isGlob = require('is-glob'); -utils.typeOf = require('kind-of'); -utils.normalize = require('normalize-path'); -utils.omit = require('object.omit'); -utils.parseGlob = require('parse-glob'); -utils.cache = require('regex-cache'); - -/** - * Get the filename of a filepath - * - * @param {String} `string` - * @return {String} - */ - -utils.filename = function filename(fp) { - var seg = fp.match(fileRe()); - return seg && seg[0]; -}; - -/** - * Returns a function that returns true if the given - * pattern is the same as a given `filepath` - * - * @param {String} `pattern` - * @return {Function} - */ - -utils.isPath = function isPath(pattern, opts) { - opts = opts || {}; - return function(fp) { - var unixified = utils.unixify(fp, opts); - if(opts.nocase){ - return pattern.toLowerCase() === unixified.toLowerCase(); - } - return pattern === unixified; - }; -}; - -/** - * Returns a function that returns true if the given - * pattern contains a `filepath` - * - * @param {String} `pattern` - * @return {Function} - */ - -utils.hasPath = function hasPath(pattern, opts) { - return function(fp) { - return utils.unixify(pattern, opts).indexOf(fp) !== -1; - }; -}; - -/** - * Returns a function that returns true if the given - * pattern matches or contains a `filepath` - * - * @param {String} `pattern` - * @return {Function} - */ - -utils.matchPath = function matchPath(pattern, opts) { - var fn = (opts && opts.contains) - ? utils.hasPath(pattern, opts) - : utils.isPath(pattern, opts); - return fn; -}; - -/** - * Returns a function that returns true if the given - * regex matches the `filename` of a file path. - * - * @param {RegExp} `re` - * @return {Boolean} - */ - -utils.hasFilename = function hasFilename(re) { - return function(fp) { - var name = utils.filename(fp); - return name && re.test(name); - }; -}; - -/** - * Coerce `val` to an array - * - * @param {*} val - * @return {Array} - */ - -utils.arrayify = function arrayify(val) { - return !Array.isArray(val) - ? [val] - : val; -}; - -/** - * Normalize all slashes in a file path or glob pattern to - * forward slashes. - */ - -utils.unixify = function unixify(fp, opts) { - if (opts && opts.unixify === false) return fp; - if (opts && opts.unixify === true || win32 || path.sep === '\\') { - return utils.normalize(fp, false); - } - if (opts && opts.unescape === true) { - return fp ? fp.toString().replace(/\\(\w)/g, '$1') : ''; - } - return fp; -}; - -/** - * Escape/unescape utils - */ - -utils.escapePath = function escapePath(fp) { - return fp.replace(/[\\.]/g, '\\$&'); -}; - -utils.unescapeGlob = function unescapeGlob(fp) { - return fp.replace(/[\\"']/g, ''); -}; - -utils.escapeRe = function escapeRe(str) { - return str.replace(/[-[\\$*+?.#^\s{}(|)\]]/g, '\\$&'); -}; - -/** - * Expose `utils` - */ - -module.exports = utils; diff --git a/node_modules/micromatch/package.json b/node_modules/micromatch/package.json deleted file mode 100644 index 2772f9d59..000000000 --- a/node_modules/micromatch/package.json +++ /dev/null @@ -1,146 +0,0 @@ -{ - "_from": "micromatch@^2.2.0", - "_id": "micromatch@2.3.11", - "_inBundle": false, - "_integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "_location": "/micromatch", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "micromatch@^2.2.0", - "name": "micromatch", - "escapedName": "micromatch", - "rawSpec": "^2.2.0", - "saveSpec": null, - "fetchSpec": "^2.2.0" - }, - "_requiredBy": [ - "/anymatch", - "/budo" - ], - "_resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "_shasum": "86677c97d1720b363431d04d0d15293bd38c1565", - "_spec": "micromatch@^2.2.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/micromatch/issues" - }, - "bundleDependencies": false, - "dependencies": { - "arr-diff": "^2.0.0", - "array-unique": "^0.2.1", - "braces": "^1.8.2", - "expand-brackets": "^0.1.4", - "extglob": "^0.3.1", - "filename-regex": "^2.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.1", - "kind-of": "^3.0.2", - "normalize-path": "^2.0.1", - "object.omit": "^2.0.0", - "parse-glob": "^3.0.4", - "regex-cache": "^0.4.2" - }, - "deprecated": false, - "description": "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.", - "devDependencies": { - "benchmarked": "^0.1.4", - "chalk": "^1.1.1", - "gulp": "^3.9.0", - "gulp-eslint": "^1.1.1", - "gulp-format-md": "^0.1.8", - "gulp-istanbul": "^0.10.1", - "gulp-mocha": "^2.1.3", - "minimatch": "^3.0.0", - "minimist": "^1.2.0", - "mocha": "^2", - "multimatch": "^2.0.0", - "should": "^8", - "write": "^0.2.1" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js", - "lib" - ], - "homepage": "https://github.com/jonschlinkert/micromatch", - "keywords": [ - "bash", - "expand", - "expansion", - "expression", - "file", - "files", - "filter", - "find", - "glob", - "globbing", - "globs", - "globstar", - "match", - "matcher", - "matches", - "matching", - "minimatch", - "multimatch", - "path", - "pattern", - "patterns", - "regex", - "regexp", - "regular", - "shell", - "wildcard" - ], - "license": "MIT", - "main": "index.js", - "name": "micromatch", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/micromatch.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "braces", - "expand-brackets", - "expand-range", - "extglob", - "fill-range", - "gulp-micromatch", - "is-glob", - "parse-glob" - ] - }, - "reflinks": [ - "braces", - "expand-brackets", - "extglob", - "minimatch", - "multimatch", - "verb" - ], - "toc": false, - "layout": false, - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - } - }, - "version": "2.3.11" -} diff --git a/node_modules/miller-rabin/.npmignore b/node_modules/miller-rabin/.npmignore deleted file mode 100644 index 1ca957177..000000000 --- a/node_modules/miller-rabin/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log diff --git a/node_modules/miller-rabin/1.js b/node_modules/miller-rabin/1.js deleted file mode 100644 index 92953789e..000000000 --- a/node_modules/miller-rabin/1.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -const BN = require('bn.js'); - -const p = new BN('2e1b162f326430f5ac6af10f96b2a8350e01675d22324c9f', 'hex'); - -console.log(p.bitLength()); diff --git a/node_modules/miller-rabin/README.md b/node_modules/miller-rabin/README.md deleted file mode 100644 index e9d76f67c..000000000 --- a/node_modules/miller-rabin/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# Miller-Rabin - -#### LICENSE - -This software is licensed under the MIT License. - -Copyright Fedor Indutny, 2014. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the -following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/miller-rabin/bin/miller-rabin b/node_modules/miller-rabin/bin/miller-rabin deleted file mode 100755 index 2e18dfd53..000000000 --- a/node_modules/miller-rabin/bin/miller-rabin +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env node -var bn = require('bn.js'); -var fs = require('fs'); -var mr = require('../').create(); - -var num = ''; -if (process.argv[2]) { - num += fs.readFileSync(process.argv[2]); - start(num); -} else { - process.stdin.on('data', function(chunk) { - num += chunk.toString().replace(/[^0-9a-f]/gi, ''); - }); - process.stdin.once('end', function() { - start(num); - }); -} - -function start(text) { - var num = new bn(text, 16); - - var divisor = mr.getDivisor(num); - if (!divisor) - process.exit(1); - if (divisor.cmpn(1) === 0) - process.exit(0); - - console.log(divisor.toString(16)); -} diff --git a/node_modules/miller-rabin/lib/mr.js b/node_modules/miller-rabin/lib/mr.js deleted file mode 100644 index 60d2a8ef9..000000000 --- a/node_modules/miller-rabin/lib/mr.js +++ /dev/null @@ -1,115 +0,0 @@ -var bn = require('bn.js'); -var brorand = require('brorand'); - -function MillerRabin(rand) { - this.rand = rand || new brorand.Rand(); -} -module.exports = MillerRabin; - -MillerRabin.create = function create(rand) { - return new MillerRabin(rand); -}; - -MillerRabin.prototype._randbelow = function _randbelow(n) { - var len = n.bitLength(); - var min_bytes = Math.ceil(len / 8); - - // Generage random bytes until a number less than n is found. - // This ensures that 0..n-1 have an equal probability of being selected. - do - var a = new bn(this.rand.generate(min_bytes)); - while (a.cmp(n) >= 0); - - return a; -}; - -MillerRabin.prototype._randrange = function _randrange(start, stop) { - // Generate a random number greater than or equal to start and less than stop. - var size = stop.sub(start); - return start.add(this._randbelow(size)); -}; - -MillerRabin.prototype.test = function test(n, k, cb) { - var len = n.bitLength(); - var red = bn.mont(n); - var rone = new bn(1).toRed(red); - - if (!k) - k = Math.max(1, (len / 48) | 0); - - // Find d and s, (n - 1) = (2 ^ s) * d; - var n1 = n.subn(1); - for (var s = 0; !n1.testn(s); s++) {} - var d = n.shrn(s); - - var rn1 = n1.toRed(red); - - var prime = true; - for (; k > 0; k--) { - var a = this._randrange(new bn(2), n1); - if (cb) - cb(a); - - var x = a.toRed(red).redPow(d); - if (x.cmp(rone) === 0 || x.cmp(rn1) === 0) - continue; - - for (var i = 1; i < s; i++) { - x = x.redSqr(); - - if (x.cmp(rone) === 0) - return false; - if (x.cmp(rn1) === 0) - break; - } - - if (i === s) - return false; - } - - return prime; -}; - -MillerRabin.prototype.getDivisor = function getDivisor(n, k) { - var len = n.bitLength(); - var red = bn.mont(n); - var rone = new bn(1).toRed(red); - - if (!k) - k = Math.max(1, (len / 48) | 0); - - // Find d and s, (n - 1) = (2 ^ s) * d; - var n1 = n.subn(1); - for (var s = 0; !n1.testn(s); s++) {} - var d = n.shrn(s); - - var rn1 = n1.toRed(red); - - for (; k > 0; k--) { - var a = this._randrange(new bn(2), n1); - - var g = n.gcd(a); - if (g.cmpn(1) !== 0) - return g; - - var x = a.toRed(red).redPow(d); - if (x.cmp(rone) === 0 || x.cmp(rn1) === 0) - continue; - - for (var i = 1; i < s; i++) { - x = x.redSqr(); - - if (x.cmp(rone) === 0) - return x.fromRed().subn(1).gcd(n); - if (x.cmp(rn1) === 0) - break; - } - - if (i === s) { - x = x.redSqr(); - return x.fromRed().subn(1).gcd(n); - } - } - - return false; -}; diff --git a/node_modules/miller-rabin/package.json b/node_modules/miller-rabin/package.json deleted file mode 100644 index d3acf9583..000000000 --- a/node_modules/miller-rabin/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_from": "miller-rabin@^4.0.0", - "_id": "miller-rabin@4.0.1", - "_inBundle": false, - "_integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "_location": "/miller-rabin", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "miller-rabin@^4.0.0", - "name": "miller-rabin", - "escapedName": "miller-rabin", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/diffie-hellman" - ], - "_resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "_shasum": "f080351c865b0dc562a8462966daa53543c78a4d", - "_spec": "miller-rabin@^4.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/diffie-hellman", - "author": { - "name": "Fedor Indutny", - "email": "fedor@indutny.com" - }, - "bin": { - "miller-rabin": "bin/miller-rabin" - }, - "bugs": { - "url": "https://github.com/indutny/miller-rabin/issues" - }, - "bundleDependencies": false, - "dependencies": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - }, - "deprecated": false, - "description": "Miller Rabin algorithm for primality test", - "devDependencies": { - "mocha": "^2.0.1" - }, - "homepage": "https://github.com/indutny/miller-rabin", - "keywords": [ - "prime", - "miller-rabin", - "bignumber" - ], - "license": "MIT", - "main": "lib/mr.js", - "name": "miller-rabin", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/indutny/miller-rabin.git" - }, - "scripts": { - "test": "mocha --reporter=spec test/**/*-test.js" - }, - "version": "4.0.1" -} diff --git a/node_modules/miller-rabin/test.js b/node_modules/miller-rabin/test.js deleted file mode 100644 index 74b2ccfe4..000000000 --- a/node_modules/miller-rabin/test.js +++ /dev/null @@ -1,25 +0,0 @@ -var mr = require('./').create(); -var BN = require('bn.js'); - -var p = new BN( - `00:d3:99:af:83:02:de:91:f8:cc:1b:4e:2e:e0:18: - b3:0a:41:a4:77:98:d2:ad:66:0f:dc:17:85:ca:58: - b4:e4:88:55:c5:0a:82:08:7c:fb:70:a9:41:30:be: - af:50:d2:ce:93:cd:46:83:47:6e:c0:51:a7:10:e6: - 66:d1:08:e8:3d:b8:ce:fe:3e:4e:48:96:82:15:f7: - 2c:83:80:05:f2:14:3a:a4:5a:44:2b:22:22:67:e5: - 21:23:b7:cb:0f:71:5b:12:8b:3d:81:f6:5e:dc:99: - 8f:f9:80:38:75:57:c2:dd:9b:7a:b2:24:97:42:60: - 92:1f:1d:8a:68:c5:b8:7f:5d:c0:53:3d:15:f2:95: - b8:1d:8b:c2:e6:ca:a6:4c:bd:bf:88:9f:3e:d3:d7: - 24:18:27:62:6e:d0:52:75:68:9f:2a:c9:39:af:95: - 55:bb:11:08:dc:51:e9:8b:5a:38:e0:c0:e9:d8:a6: - 71:a5:03:f9:a7:2c:dd:1a:63:8e:7f:f0:36:68:a0: - 44:f8:09:48:3d:bd:de:b3:2d:3a:2f:73:88:8a:0c: - e2:7f:9b:dd:e8:c2:0e:ee:21:e4:a7:f9:4d:46:2f: - a7:f6:6d:fa:88:2e:95:60:ac:53:2e:45:a2:9d:9e: - c4:80:fc:c7:49:c9:42:bb:2b:66:f6:14:6d:7f:03: - 4e:f3`.replace(/[^a-f0-9]/g, ''), 16); -console.time(); -mr.test(p); -console.timeEnd(); diff --git a/node_modules/miller-rabin/test/api-test.js b/node_modules/miller-rabin/test/api-test.js deleted file mode 100644 index dee094d95..000000000 --- a/node_modules/miller-rabin/test/api-test.js +++ /dev/null @@ -1,18 +0,0 @@ -var assert = require('assert'); -var mr = require('../').create(); -var bn = require('bn.js'); - -describe('Miller-Rabin', function() { - it('should test number for primality', function() { - assert(!mr.test(new bn(221))); - assert(mr.test(new bn(257))); - - var p = new bn('dba8191813fe8f51eaae1de70213aafede8f323f95f32cff' + - '8b64ebada275cfb18a446a0150e5fdaee246244c5f002ce0' + - 'aca97584be1745f2dd1eea2849c52aac8c4b5fb78a1c4da7' + - '052774338d3310a6e020c46168cb1f94014e9312511cc4fb' + - '79d695bb732449f0e015745b86bfa371dc6ca7386e9c7309' + - '5549c2e4b8002873', 16); - assert(mr.test(p)); - }); -}); diff --git a/node_modules/mime/LICENSE b/node_modules/mime/LICENSE deleted file mode 100644 index d3f46f7e1..000000000 --- a/node_modules/mime/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2010 Benjamin Thomas, Robert Kieffer - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/mime/README.md b/node_modules/mime/README.md deleted file mode 100644 index 506fbe550..000000000 --- a/node_modules/mime/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# mime - -Comprehensive MIME type mapping API based on mime-db module. - -## Install - -Install with [npm](http://github.com/isaacs/npm): - - npm install mime - -## Contributing / Testing - - npm run test - -## Command Line - - mime [path_string] - -E.g. - - > mime scripts/jquery.js - application/javascript - -## API - Queries - -### mime.lookup(path) -Get the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g. - -```js -var mime = require('mime'); - -mime.lookup('/path/to/file.txt'); // => 'text/plain' -mime.lookup('file.txt'); // => 'text/plain' -mime.lookup('.TXT'); // => 'text/plain' -mime.lookup('htm'); // => 'text/html' -``` - -### mime.default_type -Sets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.) - -### mime.extension(type) -Get the default extension for `type` - -```js -mime.extension('text/html'); // => 'html' -mime.extension('application/octet-stream'); // => 'bin' -``` - -### mime.charsets.lookup() - -Map mime-type to charset - -```js -mime.charsets.lookup('text/plain'); // => 'UTF-8' -``` - -(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.) - -## API - Defining Custom Types - -Custom type mappings can be added on a per-project basis via the following APIs. - -### mime.define() - -Add custom mime/extension mappings - -```js -mime.define({ - 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'], - 'application/x-my-type': ['x-mt', 'x-mtt'], - // etc ... -}); - -mime.lookup('x-sft'); // => 'text/x-some-format' -``` - -The first entry in the extensions array is returned by `mime.extension()`. E.g. - -```js -mime.extension('text/x-some-format'); // => 'x-sf' -``` - -### mime.load(filepath) - -Load mappings from an Apache ".types" format file - -```js -mime.load('./my_project.types'); -``` -The .types file format is simple - See the `types` dir for examples. diff --git a/node_modules/mime/build/build.js b/node_modules/mime/build/build.js deleted file mode 100644 index ed5313e3c..000000000 --- a/node_modules/mime/build/build.js +++ /dev/null @@ -1,11 +0,0 @@ -var db = require('mime-db'); - -var mapByType = {}; -Object.keys(db).forEach(function(key) { - var extensions = db[key].extensions; - if (extensions) { - mapByType[key] = extensions; - } -}); - -console.log(JSON.stringify(mapByType)); diff --git a/node_modules/mime/build/test.js b/node_modules/mime/build/test.js deleted file mode 100644 index 010c42b98..000000000 --- a/node_modules/mime/build/test.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Usage: node test.js - */ - -var mime = require('../mime'); -var assert = require('assert'); -var path = require('path'); - -// -// Test mime lookups -// - -assert.equal('text/plain', mime.lookup('text.txt')); // normal file -assert.equal('text/plain', mime.lookup('TEXT.TXT')); // uppercase -assert.equal('text/plain', mime.lookup('dir/text.txt')); // dir + file -assert.equal('text/plain', mime.lookup('.text.txt')); // hidden file -assert.equal('text/plain', mime.lookup('.txt')); // nameless -assert.equal('text/plain', mime.lookup('txt')); // extension-only -assert.equal('text/plain', mime.lookup('/txt')); // extension-less () -assert.equal('text/plain', mime.lookup('\\txt')); // Windows, extension-less -assert.equal('application/octet-stream', mime.lookup('text.nope')); // unrecognized -assert.equal('fallback', mime.lookup('text.fallback', 'fallback')); // alternate default - -// -// Test extensions -// - -assert.equal('txt', mime.extension(mime.types.text)); -assert.equal('html', mime.extension(mime.types.htm)); -assert.equal('bin', mime.extension('application/octet-stream')); -assert.equal('bin', mime.extension('application/octet-stream ')); -assert.equal('html', mime.extension(' text/html; charset=UTF-8')); -assert.equal('html', mime.extension('text/html; charset=UTF-8 ')); -assert.equal('html', mime.extension('text/html; charset=UTF-8')); -assert.equal('html', mime.extension('text/html ; charset=UTF-8')); -assert.equal('html', mime.extension('text/html;charset=UTF-8')); -assert.equal('html', mime.extension('text/Html;charset=UTF-8')); -assert.equal(undefined, mime.extension('unrecognized')); - -// -// Test node.types lookups -// - -assert.equal('application/font-woff', mime.lookup('file.woff')); -assert.equal('application/octet-stream', mime.lookup('file.buffer')); -// TODO: Uncomment once #157 is resolved -// assert.equal('audio/mp4', mime.lookup('file.m4a')); -assert.equal('font/otf', mime.lookup('file.otf')); - -// -// Test charsets -// - -assert.equal('UTF-8', mime.charsets.lookup('text/plain')); -assert.equal('UTF-8', mime.charsets.lookup(mime.types.js)); -assert.equal('UTF-8', mime.charsets.lookup(mime.types.json)); -assert.equal(undefined, mime.charsets.lookup(mime.types.bin)); -assert.equal('fallback', mime.charsets.lookup('application/octet-stream', 'fallback')); - -console.log('\nAll tests passed'); diff --git a/node_modules/mime/cli.js b/node_modules/mime/cli.js deleted file mode 100755 index 20b1ffeb2..000000000 --- a/node_modules/mime/cli.js +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env node - -var mime = require('./mime.js'); -var file = process.argv[2]; -var type = mime.lookup(file); - -process.stdout.write(type + '\n'); - diff --git a/node_modules/mime/mime.js b/node_modules/mime/mime.js deleted file mode 100644 index d7efbde70..000000000 --- a/node_modules/mime/mime.js +++ /dev/null @@ -1,108 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -function Mime() { - // Map of extension -> mime type - this.types = Object.create(null); - - // Map of mime type -> extension - this.extensions = Object.create(null); -} - -/** - * Define mimetype -> extension mappings. Each key is a mime-type that maps - * to an array of extensions associated with the type. The first extension is - * used as the default extension for the type. - * - * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); - * - * @param map (Object) type definitions - */ -Mime.prototype.define = function (map) { - for (var type in map) { - var exts = map[type]; - for (var i = 0; i < exts.length; i++) { - if (process.env.DEBUG_MIME && this.types[exts[i]]) { - console.warn((this._loading || "define()").replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' + - this.types[exts[i]] + ' to ' + type); - } - - this.types[exts[i]] = type; - } - - // Default extension is the first one we encounter - if (!this.extensions[type]) { - this.extensions[type] = exts[0]; - } - } -}; - -/** - * Load an Apache2-style ".types" file - * - * This may be called multiple times (it's expected). Where files declare - * overlapping types/extensions, the last file wins. - * - * @param file (String) path of file to load. - */ -Mime.prototype.load = function(file) { - this._loading = file; - // Read file and split into lines - var map = {}, - content = fs.readFileSync(file, 'ascii'), - lines = content.split(/[\r\n]+/); - - lines.forEach(function(line) { - // Clean up whitespace/comments, and split into fields - var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/); - map[fields.shift()] = fields; - }); - - this.define(map); - - this._loading = null; -}; - -/** - * Lookup a mime type based on extension - */ -Mime.prototype.lookup = function(path, fallback) { - var ext = path.replace(/^.*[\.\/\\]/, '').toLowerCase(); - - return this.types[ext] || fallback || this.default_type; -}; - -/** - * Return file extension associated with a mime type - */ -Mime.prototype.extension = function(mimeType) { - var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase(); - return this.extensions[type]; -}; - -// Default instance -var mime = new Mime(); - -// Define built-in types -mime.define(require('./types.json')); - -// Default type -mime.default_type = mime.lookup('bin'); - -// -// Additional API specific to the default instance -// - -mime.Mime = Mime; - -/** - * Lookup a charset based on mime type. - */ -mime.charsets = { - lookup: function(mimeType, fallback) { - // Assume text types are utf8 - return (/^text\/|^application\/(javascript|json)/).test(mimeType) ? 'UTF-8' : fallback; - } -}; - -module.exports = mime; diff --git a/node_modules/mime/package.json b/node_modules/mime/package.json deleted file mode 100644 index 0711a389a..000000000 --- a/node_modules/mime/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "_from": "mime@1.4.1", - "_id": "mime@1.4.1", - "_inBundle": false, - "_integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", - "_location": "/mime", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "mime@1.4.1", - "name": "mime", - "escapedName": "mime", - "rawSpec": "1.4.1", - "saveSpec": null, - "fetchSpec": "1.4.1" - }, - "_requiredBy": [ - "/send" - ], - "_resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "_shasum": "121f9ebc49e3766f311a76e1fa1c8003c4b03aa6", - "_spec": "mime@1.4.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/send", - "author": { - "name": "Robert Kieffer", - "email": "robert@broofa.com", - "url": "http://github.com/broofa" - }, - "bin": { - "mime": "cli.js" - }, - "bugs": { - "url": "https://github.com/broofa/node-mime/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Benjamin Thomas", - "email": "benjamin@benjaminthomas.org", - "url": "http://github.com/bentomas" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "A comprehensive library for mime-type mapping", - "devDependencies": { - "mime-db": "1.30.0" - }, - "homepage": "https://github.com/broofa/node-mime#readme", - "keywords": [ - "util", - "mime" - ], - "license": "MIT", - "main": "mime.js", - "name": "mime", - "repository": { - "url": "git+https://github.com/broofa/node-mime.git", - "type": "git" - }, - "scripts": { - "prepublish": "node build/build.js > types.json", - "test": "node build/test.js" - }, - "version": "1.4.1" -} diff --git a/node_modules/mime/types.json b/node_modules/mime/types.json deleted file mode 100644 index 5369cd1ca..000000000 --- a/node_modules/mime/types.json +++ /dev/null @@ -1 +0,0 @@ -{"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":["woff"],"application/font-woff2":["woff2"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/prs.cww":["cww"],"application/pskc+xml":["pskcxml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/voicexml+xml":["vxml"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-otf":["otf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-ttf":["ttf","ttc"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["iso"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["exe"],"application/x-msdownload":["exe","dll","com","bat","msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","wmz","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["prc","pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["3gpp"],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp3":["mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/wav":["wav"],"audio/wave":["wav"],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["ra"],"audio/x-wav":["wav"],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/otf":["otf"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jpeg":["jpeg","jpg","jpe"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["bmp"],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/rtf":["rtf"],"text/sgml":["sgml","sgm"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/xml":["xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]} diff --git a/node_modules/minimalistic-assert/LICENSE b/node_modules/minimalistic-assert/LICENSE deleted file mode 100644 index adca66b32..000000000 --- a/node_modules/minimalistic-assert/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2015 Calvin Metcalf - -Permission to use, copy, modify, and/or distribute this software for any purpose -with or without fee is hereby granted, provided that the above copyright notice -and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/node_modules/minimalistic-assert/index.js b/node_modules/minimalistic-assert/index.js deleted file mode 100644 index 70b4ea5bb..000000000 --- a/node_modules/minimalistic-assert/index.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = assert; - -function assert(val, msg) { - if (!val) - throw new Error(msg || 'Assertion failed'); -} - -assert.equal = function assertEqual(l, r, msg) { - if (l != r) - throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r)); -}; diff --git a/node_modules/minimalistic-assert/package.json b/node_modules/minimalistic-assert/package.json deleted file mode 100644 index a46dab98f..000000000 --- a/node_modules/minimalistic-assert/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "_from": "minimalistic-assert@^1.0.0", - "_id": "minimalistic-assert@1.0.1", - "_inBundle": false, - "_integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "_location": "/minimalistic-assert", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "minimalistic-assert@^1.0.0", - "name": "minimalistic-assert", - "escapedName": "minimalistic-assert", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/asn1.js", - "/des.js", - "/elliptic", - "/hash.js", - "/hmac-drbg" - ], - "_resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "_shasum": "2e194de044626d4a10e7f7fbc00ce73e83e4d5c7", - "_spec": "minimalistic-assert@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/des.js", - "author": "", - "bugs": { - "url": "https://github.com/calvinmetcalf/minimalistic-assert/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "minimalistic-assert ===", - "homepage": "https://github.com/calvinmetcalf/minimalistic-assert", - "license": "ISC", - "main": "index.js", - "name": "minimalistic-assert", - "repository": { - "type": "git", - "url": "git+https://github.com/calvinmetcalf/minimalistic-assert.git" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "version": "1.0.1" -} diff --git a/node_modules/minimalistic-assert/readme.md b/node_modules/minimalistic-assert/readme.md deleted file mode 100644 index 2ca0d256e..000000000 --- a/node_modules/minimalistic-assert/readme.md +++ /dev/null @@ -1,4 +0,0 @@ -minimalistic-assert -=== - -very minimalistic assert module. diff --git a/node_modules/minimalistic-crypto-utils/.npmignore b/node_modules/minimalistic-crypto-utils/.npmignore deleted file mode 100644 index 1ca957177..000000000 --- a/node_modules/minimalistic-crypto-utils/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log diff --git a/node_modules/minimalistic-crypto-utils/.travis.yml b/node_modules/minimalistic-crypto-utils/.travis.yml deleted file mode 100644 index ce24b7a77..000000000 --- a/node_modules/minimalistic-crypto-utils/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -sudo: false - -language: node_js - -node_js: - - "4" - - "6" - - "stable" - -script: - - npm test diff --git a/node_modules/minimalistic-crypto-utils/README.md b/node_modules/minimalistic-crypto-utils/README.md deleted file mode 100644 index 9e58eba89..000000000 --- a/node_modules/minimalistic-crypto-utils/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# minimalistic-crypto-utils -[![Build Status](https://secure.travis-ci.org/indutny/minimalistic-crypto-utils.svg)](http://travis-ci.org/indutny/minimalistic-crypto-utils) -[![NPM version](https://badge.fury.io/js/minimalistic-crypto-utils.svg)](http://badge.fury.io/js/minimalistic-crypto-utils) - -Very minimal utils that are required in order to write reasonable JS-only -crypto module. - -## Usage - -```js -const utils = require('minimalistic-crypto-utils'); - -utils.toArray('abcd', 'hex'); -utils.encode([ 1, 2, 3, 4 ], 'hex'); -utils.toHex([ 1, 2, 3, 4 ]); -``` - -#### LICENSE - -This software is licensed under the MIT License. - -Copyright Fedor Indutny, 2017. - -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. - -[0]: http://tools.ietf.org/html/rfc6979 -[1]: https://github.com/indutny/bn.js -[2]: https://github.com/indutny/hash.js -[3]: https://github.com/bitchan/eccrypto -[4]: https://github.com/wanderer/secp256k1-node diff --git a/node_modules/minimalistic-crypto-utils/lib/utils.js b/node_modules/minimalistic-crypto-utils/lib/utils.js deleted file mode 100644 index cd48daf12..000000000 --- a/node_modules/minimalistic-crypto-utils/lib/utils.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; - -var utils = exports; - -function toArray(msg, enc) { - if (Array.isArray(msg)) - return msg.slice(); - if (!msg) - return []; - var res = []; - if (typeof msg !== 'string') { - for (var i = 0; i < msg.length; i++) - res[i] = msg[i] | 0; - return res; - } - if (enc === 'hex') { - msg = msg.replace(/[^a-z0-9]+/ig, ''); - if (msg.length % 2 !== 0) - msg = '0' + msg; - for (var i = 0; i < msg.length; i += 2) - res.push(parseInt(msg[i] + msg[i + 1], 16)); - } else { - for (var i = 0; i < msg.length; i++) { - var c = msg.charCodeAt(i); - var hi = c >> 8; - var lo = c & 0xff; - if (hi) - res.push(hi, lo); - else - res.push(lo); - } - } - return res; -} -utils.toArray = toArray; - -function zero2(word) { - if (word.length === 1) - return '0' + word; - else - return word; -} -utils.zero2 = zero2; - -function toHex(msg) { - var res = ''; - for (var i = 0; i < msg.length; i++) - res += zero2(msg[i].toString(16)); - return res; -} -utils.toHex = toHex; - -utils.encode = function encode(arr, enc) { - if (enc === 'hex') - return toHex(arr); - else - return arr; -}; diff --git a/node_modules/minimalistic-crypto-utils/package.json b/node_modules/minimalistic-crypto-utils/package.json deleted file mode 100644 index 0365fedc6..000000000 --- a/node_modules/minimalistic-crypto-utils/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "_from": "minimalistic-crypto-utils@^1.0.0", - "_id": "minimalistic-crypto-utils@1.0.1", - "_inBundle": false, - "_integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "_location": "/minimalistic-crypto-utils", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "minimalistic-crypto-utils@^1.0.0", - "name": "minimalistic-crypto-utils", - "escapedName": "minimalistic-crypto-utils", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/elliptic", - "/hmac-drbg" - ], - "_resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "_shasum": "f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a", - "_spec": "minimalistic-crypto-utils@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/elliptic", - "author": { - "name": "Fedor Indutny", - "email": "fedor@indutny.com" - }, - "bugs": { - "url": "https://github.com/indutny/minimalistic-crypto-utils/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Minimalistic tools for JS crypto modules", - "devDependencies": { - "mocha": "^3.2.0" - }, - "homepage": "https://github.com/indutny/minimalistic-crypto-utils#readme", - "keywords": [ - "minimalistic", - "utils", - "crypto" - ], - "license": "MIT", - "main": "lib/utils.js", - "name": "minimalistic-crypto-utils", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/indutny/minimalistic-crypto-utils.git" - }, - "scripts": { - "test": "mocha --reporter=spec test/*-test.js" - }, - "version": "1.0.1" -} diff --git a/node_modules/minimalistic-crypto-utils/test/utils-test.js b/node_modules/minimalistic-crypto-utils/test/utils-test.js deleted file mode 100644 index 3da812dbc..000000000 --- a/node_modules/minimalistic-crypto-utils/test/utils-test.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -const assert = require('assert'); -const utils = require('../'); - -describe('utils', () => { - it('should convert to array', () => { - assert.deepEqual(utils.toArray('1234', 'hex'), [ 0x12, 0x34 ]); - assert.deepEqual(utils.toArray('1234'), [ 49, 50, 51, 52 ]); - assert.deepEqual(utils.toArray('1234', 'utf8'), [ 49, 50, 51, 52 ]); - assert.deepEqual(utils.toArray('\u1234234'), [ 18, 52, 50, 51, 52 ]); - assert.deepEqual(utils.toArray([ 1, 2, 3, 4 ]), [ 1, 2, 3, 4 ]); - }); - - it('should zero pad byte to hex', () => { - assert.equal(utils.zero2('0'), '00'); - assert.equal(utils.zero2('01'), '01'); - }); - - it('should convert to hex', () => { - assert.equal(utils.toHex([ 0, 1, 2, 3 ]), '00010203'); - }); - - it('should encode', () => { - assert.deepEqual(utils.encode([ 0, 1, 2, 3 ]), [ 0, 1, 2, 3 ]); - assert.deepEqual(utils.encode([ 0, 1, 2, 3 ], 'hex'), '00010203'); - }); -}); diff --git a/node_modules/minimatch/LICENSE b/node_modules/minimatch/LICENSE deleted file mode 100644 index 19129e315..000000000 --- a/node_modules/minimatch/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/minimatch/README.md b/node_modules/minimatch/README.md deleted file mode 100644 index ad72b8133..000000000 --- a/node_modules/minimatch/README.md +++ /dev/null @@ -1,209 +0,0 @@ -# minimatch - -A minimal matching utility. - -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) - - -This is the matching library used internally by npm. - -It works by converting glob expressions into JavaScript `RegExp` -objects. - -## Usage - -```javascript -var minimatch = require("minimatch") - -minimatch("bar.foo", "*.foo") // true! -minimatch("bar.foo", "*.bar") // false! -minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! -``` - -## Features - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` - -## Minimatch Class - -Create a minimatch object by instantiating the `minimatch.Minimatch` class. - -```javascript -var Minimatch = require("minimatch").Minimatch -var mm = new Minimatch(pattern, options) -``` - -### Properties - -* `pattern` The original pattern the minimatch object represents. -* `options` The options supplied to the constructor. -* `set` A 2-dimensional array of regexp or string expressions. - Each row in the - array corresponds to a brace-expanded pattern. Each item in the row - corresponds to a single path-part. For example, the pattern - `{a,b/c}/d` would expand to a set of patterns like: - - [ [ a, d ] - , [ b, c, d ] ] - - If a portion of the pattern doesn't have any "magic" in it - (that is, it's something like `"foo"` rather than `fo*o?`), then it - will be left as a string rather than converted to a regular - expression. - -* `regexp` Created by the `makeRe` method. A single regular expression - expressing the entire pattern. This is useful in cases where you wish - to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. -* `negate` True if the pattern is negated. -* `comment` True if the pattern is a comment. -* `empty` True if the pattern is `""`. - -### Methods - -* `makeRe` Generate the `regexp` member if necessary, and return it. - Will return `false` if the pattern is invalid. -* `match(fname)` Return true if the filename matches the pattern, or - false otherwise. -* `matchOne(fileArray, patternArray, partial)` Take a `/`-split - filename, and match it against a single row in the `regExpSet`. This - method is mainly for internal use, but is exposed so that it can be - used by a glob-walker that needs to avoid excessive filesystem calls. - -All other methods are internal, and will be called as necessary. - -### minimatch(path, pattern, options) - -Main export. Tests a path against the pattern using the options. - -```javascript -var isJS = minimatch(file, "*.js", { matchBase: true }) -``` - -### minimatch.filter(pattern, options) - -Returns a function that tests its -supplied argument, suitable for use with `Array.filter`. Example: - -```javascript -var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) -``` - -### minimatch.match(list, pattern, options) - -Match against the list of -files, in the style of fnmatch or glob. If nothing is matched, and -options.nonull is set, then return a list containing the pattern itself. - -```javascript -var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) -``` - -### minimatch.makeRe(pattern, options) - -Make a regular expression object from the pattern. - -## Options - -All options are `false` by default. - -### debug - -Dump a ton of stuff to stderr. - -### nobrace - -Do not expand `{a,b}` and `{1..3}` brace sets. - -### noglobstar - -Disable `**` matching against multiple folder names. - -### dot - -Allow patterns to match filenames starting with a period, even if -the pattern does not explicitly have a period in that spot. - -Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` -is set. - -### noext - -Disable "extglob" style patterns like `+(a|b)`. - -### nocase - -Perform a case-insensitive match. - -### nonull - -When a match is not found by `minimatch.match`, return a list containing -the pattern itself if this option is set. When not set, an empty list -is returned if there are no matches. - -### matchBase - -If set, then patterns without slashes will be matched -against the basename of the path if it contains slashes. For example, -`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. - -### nocomment - -Suppress the behavior of treating `#` at the start of a pattern as a -comment. - -### nonegate - -Suppress the behavior of treating a leading `!` character as negation. - -### flipNegate - -Returns from negate expressions the same as if they were not negated. -(Ie, true on a hit, false on a miss.) - - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between minimatch and other -implementations, and are intentional. - -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.1, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then minimatch.match returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. diff --git a/node_modules/minimatch/minimatch.js b/node_modules/minimatch/minimatch.js deleted file mode 100644 index 5b5f8cf44..000000000 --- a/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,923 +0,0 @@ -module.exports = minimatch -minimatch.Minimatch = Minimatch - -var path = { sep: '/' } -try { - path = require('path') -} catch (er) {} - -var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = require('brace-expansion') - -var plTypes = { - '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, - '?': { open: '(?:', close: ')?' }, - '+': { open: '(?:', close: ')+' }, - '*': { open: '(?:', close: ')*' }, - '@': { open: '(?:', close: ')' } -} - -// any single thing other than / -// don't need to escape / when using new RegExp() -var qmark = '[^/]' - -// * => any number of characters -var star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') - -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} - -// normalizes slashes. -var slashSplit = /\/+/ - -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -function ext (a, b) { - a = a || {} - b = b || {} - var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch - - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - - return m -} - -Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch - return minimatch.defaults(def).Minimatch -} - -function minimatch (p, pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - // "" only matches "" - if (pattern.trim() === '') return p === '' - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } - - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - pattern = pattern.trim() - - // windows support: need to use /, not \ - if (path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.debug = function () {} - -Minimatch.prototype.make = make -function make () { - // don't do it more than once. - if (this._made) return - - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = console.error - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - this.debug(this.pattern, set) - - // glob --> 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, '\\$&') -} diff --git a/node_modules/minimatch/package.json b/node_modules/minimatch/package.json deleted file mode 100644 index d29a82c56..000000000 --- a/node_modules/minimatch/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "_from": "minimatch@^3.0.4", - "_id": "minimatch@3.0.4", - "_inBundle": false, - "_integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "_location": "/minimatch", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "minimatch@^3.0.4", - "name": "minimatch", - "escapedName": "minimatch", - "rawSpec": "^3.0.4", - "saveSpec": null, - "fetchSpec": "^3.0.4" - }, - "_requiredBy": [ - "/glob", - "/resp-modifier" - ], - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "_shasum": "5166e286457f03306064be5497e8dbb0c3d32083", - "_spec": "minimatch@^3.0.4", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/glob", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" - }, - "bundleDependencies": false, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "deprecated": false, - "description": "a glob matcher in javascript", - "devDependencies": { - "tap": "^10.3.2" - }, - "engines": { - "node": "*" - }, - "files": [ - "minimatch.js" - ], - "homepage": "https://github.com/isaacs/minimatch#readme", - "license": "ISC", - "main": "minimatch.js", - "name": "minimatch", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "scripts": { - "postpublish": "git push origin --all; git push origin --tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap test/*.js --cov" - }, - "version": "3.0.4" -} diff --git a/node_modules/minimist/.travis.yml b/node_modules/minimist/.travis.yml deleted file mode 100644 index 74c57bf15..000000000 --- a/node_modules/minimist/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" - - "0.12" - - "iojs" -before_install: - - npm install -g npm@~1.4.6 diff --git a/node_modules/minimist/LICENSE b/node_modules/minimist/LICENSE deleted file mode 100644 index ee27ba4b4..000000000 --- a/node_modules/minimist/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/minimist/example/parse.js b/node_modules/minimist/example/parse.js deleted file mode 100644 index abff3e8ee..000000000 --- a/node_modules/minimist/example/parse.js +++ /dev/null @@ -1,2 +0,0 @@ -var argv = require('../')(process.argv.slice(2)); -console.dir(argv); diff --git a/node_modules/minimist/index.js b/node_modules/minimist/index.js deleted file mode 100644 index 6a0559d58..000000000 --- a/node_modules/minimist/index.js +++ /dev/null @@ -1,236 +0,0 @@ -module.exports = function (args, opts) { - if (!opts) opts = {}; - - var flags = { bools : {}, strings : {}, unknownFn: null }; - - if (typeof opts['unknown'] === 'function') { - flags.unknownFn = opts['unknown']; - } - - if (typeof opts['boolean'] === 'boolean' && opts['boolean']) { - flags.allBools = true; - } else { - [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { - flags.bools[key] = true; - }); - } - - var aliases = {}; - Object.keys(opts.alias || {}).forEach(function (key) { - aliases[key] = [].concat(opts.alias[key]); - aliases[key].forEach(function (x) { - aliases[x] = [key].concat(aliases[key].filter(function (y) { - return x !== y; - })); - }); - }); - - [].concat(opts.string).filter(Boolean).forEach(function (key) { - flags.strings[key] = true; - if (aliases[key]) { - flags.strings[aliases[key]] = true; - } - }); - - var defaults = opts['default'] || {}; - - var argv = { _ : [] }; - Object.keys(flags.bools).forEach(function (key) { - setArg(key, defaults[key] === undefined ? false : defaults[key]); - }); - - var notFlags = []; - - if (args.indexOf('--') !== -1) { - notFlags = args.slice(args.indexOf('--')+1); - args = args.slice(0, args.indexOf('--')); - } - - function argDefined(key, arg) { - return (flags.allBools && /^--[^=]+$/.test(arg)) || - flags.strings[key] || flags.bools[key] || aliases[key]; - } - - function setArg (key, val, arg) { - if (arg && flags.unknownFn && !argDefined(key, arg)) { - if (flags.unknownFn(arg) === false) return; - } - - var value = !flags.strings[key] && isNumber(val) - ? Number(val) : val - ; - setKey(argv, key.split('.'), value); - - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), value); - }); - } - - function setKey (obj, keys, value) { - var o = obj; - keys.slice(0,-1).forEach(function (key) { - if (o[key] === undefined) o[key] = {}; - o = o[key]; - }); - - var key = keys[keys.length - 1]; - if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') { - o[key] = value; - } - else if (Array.isArray(o[key])) { - o[key].push(value); - } - else { - o[key] = [ o[key], value ]; - } - } - - function aliasIsBoolean(key) { - return aliases[key].some(function (x) { - return flags.bools[x]; - }); - } - - for (var i = 0; i < args.length; i++) { - var arg = args[i]; - - if (/^--.+=/.test(arg)) { - // Using [\s\S] instead of . because js doesn't support the - // 'dotall' regex modifier. See: - // http://stackoverflow.com/a/1068308/13216 - var m = arg.match(/^--([^=]+)=([\s\S]*)$/); - var key = m[1]; - var value = m[2]; - if (flags.bools[key]) { - value = value !== 'false'; - } - setArg(key, value, arg); - } - else if (/^--no-.+/.test(arg)) { - var key = arg.match(/^--no-(.+)/)[1]; - setArg(key, false, arg); - } - else if (/^--.+/.test(arg)) { - var key = arg.match(/^--(.+)/)[1]; - var next = args[i + 1]; - if (next !== undefined && !/^-/.test(next) - && !flags.bools[key] - && !flags.allBools - && (aliases[key] ? !aliasIsBoolean(key) : true)) { - setArg(key, next, arg); - i++; - } - else if (/^(true|false)$/.test(next)) { - setArg(key, next === 'true', arg); - i++; - } - else { - setArg(key, flags.strings[key] ? '' : true, arg); - } - } - else if (/^-[^-]+/.test(arg)) { - var letters = arg.slice(1,-1).split(''); - - var broken = false; - for (var j = 0; j < letters.length; j++) { - var next = arg.slice(j+2); - - if (next === '-') { - setArg(letters[j], next, arg) - continue; - } - - if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) { - setArg(letters[j], next.split('=')[1], arg); - broken = true; - break; - } - - if (/[A-Za-z]/.test(letters[j]) - && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { - setArg(letters[j], next, arg); - broken = true; - break; - } - - if (letters[j+1] && letters[j+1].match(/\W/)) { - setArg(letters[j], arg.slice(j+2), arg); - broken = true; - break; - } - else { - setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg); - } - } - - var key = arg.slice(-1)[0]; - if (!broken && key !== '-') { - if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) - && !flags.bools[key] - && (aliases[key] ? !aliasIsBoolean(key) : true)) { - setArg(key, args[i+1], arg); - i++; - } - else if (args[i+1] && /true|false/.test(args[i+1])) { - setArg(key, args[i+1] === 'true', arg); - i++; - } - else { - setArg(key, flags.strings[key] ? '' : true, arg); - } - } - } - else { - if (!flags.unknownFn || flags.unknownFn(arg) !== false) { - argv._.push( - flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) - ); - } - if (opts.stopEarly) { - argv._.push.apply(argv._, args.slice(i + 1)); - break; - } - } - } - - Object.keys(defaults).forEach(function (key) { - if (!hasKey(argv, key.split('.'))) { - setKey(argv, key.split('.'), defaults[key]); - - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), defaults[key]); - }); - } - }); - - if (opts['--']) { - argv['--'] = new Array(); - notFlags.forEach(function(key) { - argv['--'].push(key); - }); - } - else { - notFlags.forEach(function(key) { - argv._.push(key); - }); - } - - return argv; -}; - -function hasKey (obj, keys) { - var o = obj; - keys.slice(0,-1).forEach(function (key) { - o = (o[key] || {}); - }); - - var key = keys[keys.length - 1]; - return key in o; -} - -function isNumber (x) { - if (typeof x === 'number') return true; - if (/^0x[0-9a-f]+$/i.test(x)) return true; - return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); -} - diff --git a/node_modules/minimist/package.json b/node_modules/minimist/package.json deleted file mode 100644 index 7a80eead5..000000000 --- a/node_modules/minimist/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "_from": "minimist@^1.1.0", - "_id": "minimist@1.2.0", - "_inBundle": false, - "_integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "_location": "/minimist", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "minimist@^1.1.0", - "name": "minimist", - "escapedName": "minimist", - "rawSpec": "^1.1.0", - "saveSpec": null, - "fetchSpec": "^1.1.0" - }, - "_requiredBy": [ - "/detective", - "/garnish", - "/subarg" - ], - "_resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "_shasum": "a35008b20f41383eec1fb914f4cd5df79a264284", - "_spec": "minimist@^1.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/subarg", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/minimist/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "parse argument options", - "devDependencies": { - "covert": "^1.0.0", - "tap": "~0.4.0", - "tape": "^3.5.0" - }, - "homepage": "https://github.com/substack/minimist", - "keywords": [ - "argv", - "getopt", - "parser", - "optimist" - ], - "license": "MIT", - "main": "index.js", - "name": "minimist", - "repository": { - "type": "git", - "url": "git://github.com/substack/minimist.git" - }, - "scripts": { - "coverage": "covert test/*.js", - "test": "tap test/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/6..latest", - "ff/5", - "firefox/latest", - "chrome/10", - "chrome/latest", - "safari/5.1", - "safari/latest", - "opera/12" - ] - }, - "version": "1.2.0" -} diff --git a/node_modules/minimist/readme.markdown b/node_modules/minimist/readme.markdown deleted file mode 100644 index 30a74cf8c..000000000 --- a/node_modules/minimist/readme.markdown +++ /dev/null @@ -1,91 +0,0 @@ -# minimist - -parse argument options - -This module is the guts of optimist's argument parser without all the -fanciful decoration. - -[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist) - -[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist) - -# example - -``` js -var argv = require('minimist')(process.argv.slice(2)); -console.dir(argv); -``` - -``` -$ node example/parse.js -a beep -b boop -{ _: [], a: 'beep', b: 'boop' } -``` - -``` -$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz -{ _: [ 'foo', 'bar', 'baz' ], - x: 3, - y: 4, - n: 5, - a: true, - b: true, - c: true, - beep: 'boop' } -``` - -# methods - -``` js -var parseArgs = require('minimist') -``` - -## var argv = parseArgs(args, opts={}) - -Return an argument object `argv` populated with the array arguments from `args`. - -`argv._` contains all the arguments that didn't have an option associated with -them. - -Numeric-looking arguments will be returned as numbers unless `opts.string` or -`opts.boolean` is set for that argument name. - -Any arguments after `'--'` will not be parsed and will end up in `argv._`. - -options can be: - -* `opts.string` - a string or array of strings argument names to always treat as -strings -* `opts.boolean` - a boolean, string or array of strings to always treat as -booleans. if `true` will treat all double hyphenated arguments without equal signs -as boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`) -* `opts.alias` - an object mapping string names to strings or arrays of string -argument names to use as aliases -* `opts.default` - an object mapping string argument names to default values -* `opts.stopEarly` - when true, populate `argv._` with everything after the -first non-option -* `opts['--']` - when true, populate `argv._` with everything before the `--` -and `argv['--']` with everything after the `--`. Here's an example: -* `opts.unknown` - a function which is invoked with a command line parameter not -defined in the `opts` configuration object. If the function returns `false`, the -unknown option is not added to `argv`. - -``` -> require('./')('one two three -- four five --six'.split(' '), { '--': true }) -{ _: [ 'one', 'two', 'three' ], - '--': [ 'four', 'five', '--six' ] } -``` - -Note that with `opts['--']` set, parsing for arguments still stops after the -`--`. - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install minimist -``` - -# license - -MIT diff --git a/node_modules/minimist/test/all_bool.js b/node_modules/minimist/test/all_bool.js deleted file mode 100644 index ac835483d..000000000 --- a/node_modules/minimist/test/all_bool.js +++ /dev/null @@ -1,32 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('flag boolean true (default all --args to boolean)', function (t) { - var argv = parse(['moo', '--honk', 'cow'], { - boolean: true - }); - - t.deepEqual(argv, { - honk: true, - _: ['moo', 'cow'] - }); - - t.deepEqual(typeof argv.honk, 'boolean'); - t.end(); -}); - -test('flag boolean true only affects double hyphen arguments without equals signs', function (t) { - var argv = parse(['moo', '--honk', 'cow', '-p', '55', '--tacos=good'], { - boolean: true - }); - - t.deepEqual(argv, { - honk: true, - tacos: 'good', - p: 55, - _: ['moo', 'cow'] - }); - - t.deepEqual(typeof argv.honk, 'boolean'); - t.end(); -}); diff --git a/node_modules/minimist/test/bool.js b/node_modules/minimist/test/bool.js deleted file mode 100644 index 14b0717ce..000000000 --- a/node_modules/minimist/test/bool.js +++ /dev/null @@ -1,166 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('flag boolean default false', function (t) { - var argv = parse(['moo'], { - boolean: ['t', 'verbose'], - default: { verbose: false, t: false } - }); - - t.deepEqual(argv, { - verbose: false, - t: false, - _: ['moo'] - }); - - t.deepEqual(typeof argv.verbose, 'boolean'); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); - -}); - -test('boolean groups', function (t) { - var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { - boolean: ['x','y','z'] - }); - - t.deepEqual(argv, { - x : true, - y : false, - z : true, - _ : [ 'one', 'two', 'three' ] - }); - - t.deepEqual(typeof argv.x, 'boolean'); - t.deepEqual(typeof argv.y, 'boolean'); - t.deepEqual(typeof argv.z, 'boolean'); - t.end(); -}); -test('boolean and alias with chainable api', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var opts = { - herp: { alias: 'h', boolean: true } - }; - var aliasedArgv = parse(aliased, { - boolean: 'herp', - alias: { h: 'herp' } - }); - var propertyArgv = parse(regular, { - boolean: 'herp', - alias: { h: 'herp' } - }); - var expected = { - herp: true, - h: true, - '_': [ 'derp' ] - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -test('boolean and alias with options hash', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var opts = { - alias: { 'h': 'herp' }, - boolean: 'herp' - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - var expected = { - herp: true, - h: true, - '_': [ 'derp' ] - }; - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -test('boolean and alias array with options hash', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var alt = [ '--harp', 'derp' ]; - var opts = { - alias: { 'h': ['herp', 'harp'] }, - boolean: 'h' - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - var altPropertyArgv = parse(alt, opts); - var expected = { - harp: true, - herp: true, - h: true, - '_': [ 'derp' ] - }; - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.same(altPropertyArgv, expected); - t.end(); -}); - -test('boolean and alias using explicit true', function (t) { - var aliased = [ '-h', 'true' ]; - var regular = [ '--herp', 'true' ]; - var opts = { - alias: { h: 'herp' }, - boolean: 'h' - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - var expected = { - herp: true, - h: true, - '_': [ ] - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -// regression, see https://github.com/substack/node-optimist/issues/71 -test('boolean and --x=true', function(t) { - var parsed = parse(['--boool', '--other=true'], { - boolean: 'boool' - }); - - t.same(parsed.boool, true); - t.same(parsed.other, 'true'); - - parsed = parse(['--boool', '--other=false'], { - boolean: 'boool' - }); - - t.same(parsed.boool, true); - t.same(parsed.other, 'false'); - t.end(); -}); - -test('boolean --boool=true', function (t) { - var parsed = parse(['--boool=true'], { - default: { - boool: false - }, - boolean: ['boool'] - }); - - t.same(parsed.boool, true); - t.end(); -}); - -test('boolean --boool=false', function (t) { - var parsed = parse(['--boool=false'], { - default: { - boool: true - }, - boolean: ['boool'] - }); - - t.same(parsed.boool, false); - t.end(); -}); diff --git a/node_modules/minimist/test/dash.js b/node_modules/minimist/test/dash.js deleted file mode 100644 index 5a4fa5be4..000000000 --- a/node_modules/minimist/test/dash.js +++ /dev/null @@ -1,31 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('-', function (t) { - t.plan(5); - t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] }); - t.deepEqual(parse([ '-' ]), { _: [ '-' ] }); - t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] }); - t.deepEqual( - parse([ '-b', '-' ], { boolean: 'b' }), - { b: true, _: [ '-' ] } - ); - t.deepEqual( - parse([ '-s', '-' ], { string: 's' }), - { s: '-', _: [] } - ); -}); - -test('-a -- b', function (t) { - t.plan(3); - t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] }); - t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); - t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); -}); - -test('move arguments after the -- into their own `--` array', function(t) { - t.plan(1); - t.deepEqual( - parse([ '--name', 'John', 'before', '--', 'after' ], { '--': true }), - { name: 'John', _: [ 'before' ], '--': [ 'after' ] }); -}); diff --git a/node_modules/minimist/test/default_bool.js b/node_modules/minimist/test/default_bool.js deleted file mode 100644 index 780a31127..000000000 --- a/node_modules/minimist/test/default_bool.js +++ /dev/null @@ -1,35 +0,0 @@ -var test = require('tape'); -var parse = require('../'); - -test('boolean default true', function (t) { - var argv = parse([], { - boolean: 'sometrue', - default: { sometrue: true } - }); - t.equal(argv.sometrue, true); - t.end(); -}); - -test('boolean default false', function (t) { - var argv = parse([], { - boolean: 'somefalse', - default: { somefalse: false } - }); - t.equal(argv.somefalse, false); - t.end(); -}); - -test('boolean default to null', function (t) { - var argv = parse([], { - boolean: 'maybe', - default: { maybe: null } - }); - t.equal(argv.maybe, null); - var argv = parse(['--maybe'], { - boolean: 'maybe', - default: { maybe: null } - }); - t.equal(argv.maybe, true); - t.end(); - -}) diff --git a/node_modules/minimist/test/dotted.js b/node_modules/minimist/test/dotted.js deleted file mode 100644 index d8b3e856e..000000000 --- a/node_modules/minimist/test/dotted.js +++ /dev/null @@ -1,22 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('dotted alias', function (t) { - var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); - t.equal(argv.a.b, 22); - t.equal(argv.aa.bb, 22); - t.end(); -}); - -test('dotted default', function (t) { - var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); - t.equal(argv.a.b, 11); - t.equal(argv.aa.bb, 11); - t.end(); -}); - -test('dotted default with no alias', function (t) { - var argv = parse('', {default: {'a.b': 11}}); - t.equal(argv.a.b, 11); - t.end(); -}); diff --git a/node_modules/minimist/test/kv_short.js b/node_modules/minimist/test/kv_short.js deleted file mode 100644 index f813b3050..000000000 --- a/node_modules/minimist/test/kv_short.js +++ /dev/null @@ -1,16 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('short -k=v' , function (t) { - t.plan(1); - - var argv = parse([ '-b=123' ]); - t.deepEqual(argv, { b: 123, _: [] }); -}); - -test('multi short -k=v' , function (t) { - t.plan(1); - - var argv = parse([ '-a=whatever', '-b=robots' ]); - t.deepEqual(argv, { a: 'whatever', b: 'robots', _: [] }); -}); diff --git a/node_modules/minimist/test/long.js b/node_modules/minimist/test/long.js deleted file mode 100644 index 5d3a1e09d..000000000 --- a/node_modules/minimist/test/long.js +++ /dev/null @@ -1,31 +0,0 @@ -var test = require('tape'); -var parse = require('../'); - -test('long opts', function (t) { - t.deepEqual( - parse([ '--bool' ]), - { bool : true, _ : [] }, - 'long boolean' - ); - t.deepEqual( - parse([ '--pow', 'xixxle' ]), - { pow : 'xixxle', _ : [] }, - 'long capture sp' - ); - t.deepEqual( - parse([ '--pow=xixxle' ]), - { pow : 'xixxle', _ : [] }, - 'long capture eq' - ); - t.deepEqual( - parse([ '--host', 'localhost', '--port', '555' ]), - { host : 'localhost', port : 555, _ : [] }, - 'long captures sp' - ); - t.deepEqual( - parse([ '--host=localhost', '--port=555' ]), - { host : 'localhost', port : 555, _ : [] }, - 'long captures eq' - ); - t.end(); -}); diff --git a/node_modules/minimist/test/num.js b/node_modules/minimist/test/num.js deleted file mode 100644 index 2cc77f4d6..000000000 --- a/node_modules/minimist/test/num.js +++ /dev/null @@ -1,36 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('nums', function (t) { - var argv = parse([ - '-x', '1234', - '-y', '5.67', - '-z', '1e7', - '-w', '10f', - '--hex', '0xdeadbeef', - '789' - ]); - t.deepEqual(argv, { - x : 1234, - y : 5.67, - z : 1e7, - w : '10f', - hex : 0xdeadbeef, - _ : [ 789 ] - }); - t.deepEqual(typeof argv.x, 'number'); - t.deepEqual(typeof argv.y, 'number'); - t.deepEqual(typeof argv.z, 'number'); - t.deepEqual(typeof argv.w, 'string'); - t.deepEqual(typeof argv.hex, 'number'); - t.deepEqual(typeof argv._[0], 'number'); - t.end(); -}); - -test('already a number', function (t) { - var argv = parse([ '-x', 1234, 789 ]); - t.deepEqual(argv, { x : 1234, _ : [ 789 ] }); - t.deepEqual(typeof argv.x, 'number'); - t.deepEqual(typeof argv._[0], 'number'); - t.end(); -}); diff --git a/node_modules/minimist/test/parse.js b/node_modules/minimist/test/parse.js deleted file mode 100644 index 7b4a2a17c..000000000 --- a/node_modules/minimist/test/parse.js +++ /dev/null @@ -1,197 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('parse args', function (t) { - t.deepEqual( - parse([ '--no-moo' ]), - { moo : false, _ : [] }, - 'no' - ); - t.deepEqual( - parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), - { v : ['a','b','c'], _ : [] }, - 'multi' - ); - t.end(); -}); - -test('comprehensive', function (t) { - t.deepEqual( - parse([ - '--name=meowmers', 'bare', '-cats', 'woo', - '-h', 'awesome', '--multi=quux', - '--key', 'value', - '-b', '--bool', '--no-meep', '--multi=baz', - '--', '--not-a-flag', 'eek' - ]), - { - c : true, - a : true, - t : true, - s : 'woo', - h : 'awesome', - b : true, - bool : true, - key : 'value', - multi : [ 'quux', 'baz' ], - meep : false, - name : 'meowmers', - _ : [ 'bare', '--not-a-flag', 'eek' ] - } - ); - t.end(); -}); - -test('flag boolean', function (t) { - var argv = parse([ '-t', 'moo' ], { boolean: 't' }); - t.deepEqual(argv, { t : true, _ : [ 'moo' ] }); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); -}); - -test('flag boolean value', function (t) { - var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], { - boolean: [ 't', 'verbose' ], - default: { verbose: true } - }); - - t.deepEqual(argv, { - verbose: false, - t: true, - _: ['moo'] - }); - - t.deepEqual(typeof argv.verbose, 'boolean'); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); -}); - -test('newlines in params' , function (t) { - var args = parse([ '-s', "X\nX" ]) - t.deepEqual(args, { _ : [], s : "X\nX" }); - - // reproduce in bash: - // VALUE="new - // line" - // node program.js --s="$VALUE" - args = parse([ "--s=X\nX" ]) - t.deepEqual(args, { _ : [], s : "X\nX" }); - t.end(); -}); - -test('strings' , function (t) { - var s = parse([ '-s', '0001234' ], { string: 's' }).s; - t.equal(s, '0001234'); - t.equal(typeof s, 'string'); - - var x = parse([ '-x', '56' ], { string: 'x' }).x; - t.equal(x, '56'); - t.equal(typeof x, 'string'); - t.end(); -}); - -test('stringArgs', function (t) { - var s = parse([ ' ', ' ' ], { string: '_' })._; - t.same(s.length, 2); - t.same(typeof s[0], 'string'); - t.same(s[0], ' '); - t.same(typeof s[1], 'string'); - t.same(s[1], ' '); - t.end(); -}); - -test('empty strings', function(t) { - var s = parse([ '-s' ], { string: 's' }).s; - t.equal(s, ''); - t.equal(typeof s, 'string'); - - var str = parse([ '--str' ], { string: 'str' }).str; - t.equal(str, ''); - t.equal(typeof str, 'string'); - - var letters = parse([ '-art' ], { - string: [ 'a', 't' ] - }); - - t.equal(letters.a, ''); - t.equal(letters.r, true); - t.equal(letters.t, ''); - - t.end(); -}); - - -test('string and alias', function(t) { - var x = parse([ '--str', '000123' ], { - string: 's', - alias: { s: 'str' } - }); - - t.equal(x.str, '000123'); - t.equal(typeof x.str, 'string'); - t.equal(x.s, '000123'); - t.equal(typeof x.s, 'string'); - - var y = parse([ '-s', '000123' ], { - string: 'str', - alias: { str: 's' } - }); - - t.equal(y.str, '000123'); - t.equal(typeof y.str, 'string'); - t.equal(y.s, '000123'); - t.equal(typeof y.s, 'string'); - t.end(); -}); - -test('slashBreak', function (t) { - t.same( - parse([ '-I/foo/bar/baz' ]), - { I : '/foo/bar/baz', _ : [] } - ); - t.same( - parse([ '-xyz/foo/bar/baz' ]), - { x : true, y : true, z : '/foo/bar/baz', _ : [] } - ); - t.end(); -}); - -test('alias', function (t) { - var argv = parse([ '-f', '11', '--zoom', '55' ], { - alias: { z: 'zoom' } - }); - t.equal(argv.zoom, 55); - t.equal(argv.z, argv.zoom); - t.equal(argv.f, 11); - t.end(); -}); - -test('multiAlias', function (t) { - var argv = parse([ '-f', '11', '--zoom', '55' ], { - alias: { z: [ 'zm', 'zoom' ] } - }); - t.equal(argv.zoom, 55); - t.equal(argv.z, argv.zoom); - t.equal(argv.z, argv.zm); - t.equal(argv.f, 11); - t.end(); -}); - -test('nested dotted objects', function (t) { - var argv = parse([ - '--foo.bar', '3', '--foo.baz', '4', - '--foo.quux.quibble', '5', '--foo.quux.o_O', - '--beep.boop' - ]); - - t.same(argv.foo, { - bar : 3, - baz : 4, - quux : { - quibble : 5, - o_O : true - } - }); - t.same(argv.beep, { boop : true }); - t.end(); -}); diff --git a/node_modules/minimist/test/parse_modified.js b/node_modules/minimist/test/parse_modified.js deleted file mode 100644 index ab620dc5e..000000000 --- a/node_modules/minimist/test/parse_modified.js +++ /dev/null @@ -1,9 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('parse with modifier functions' , function (t) { - t.plan(1); - - var argv = parse([ '-b', '123' ], { boolean: 'b' }); - t.deepEqual(argv, { b: true, _: [123] }); -}); diff --git a/node_modules/minimist/test/short.js b/node_modules/minimist/test/short.js deleted file mode 100644 index d513a1c25..000000000 --- a/node_modules/minimist/test/short.js +++ /dev/null @@ -1,67 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('numeric short args', function (t) { - t.plan(2); - t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] }); - t.deepEqual( - parse([ '-123', '456' ]), - { 1: true, 2: true, 3: 456, _: [] } - ); -}); - -test('short', function (t) { - t.deepEqual( - parse([ '-b' ]), - { b : true, _ : [] }, - 'short boolean' - ); - t.deepEqual( - parse([ 'foo', 'bar', 'baz' ]), - { _ : [ 'foo', 'bar', 'baz' ] }, - 'bare' - ); - t.deepEqual( - parse([ '-cats' ]), - { c : true, a : true, t : true, s : true, _ : [] }, - 'group' - ); - t.deepEqual( - parse([ '-cats', 'meow' ]), - { c : true, a : true, t : true, s : 'meow', _ : [] }, - 'short group next' - ); - t.deepEqual( - parse([ '-h', 'localhost' ]), - { h : 'localhost', _ : [] }, - 'short capture' - ); - t.deepEqual( - parse([ '-h', 'localhost', '-p', '555' ]), - { h : 'localhost', p : 555, _ : [] }, - 'short captures' - ); - t.end(); -}); - -test('mixed short bool and capture', function (t) { - t.same( - parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), - { - f : true, p : 555, h : 'localhost', - _ : [ 'script.js' ] - } - ); - t.end(); -}); - -test('short and long', function (t) { - t.deepEqual( - parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), - { - f : true, p : 555, h : 'localhost', - _ : [ 'script.js' ] - } - ); - t.end(); -}); diff --git a/node_modules/minimist/test/stop_early.js b/node_modules/minimist/test/stop_early.js deleted file mode 100644 index bdf9fbcb0..000000000 --- a/node_modules/minimist/test/stop_early.js +++ /dev/null @@ -1,15 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('stops parsing on the first non-option when stopEarly is set', function (t) { - var argv = parse(['--aaa', 'bbb', 'ccc', '--ddd'], { - stopEarly: true - }); - - t.deepEqual(argv, { - aaa: 'bbb', - _: ['ccc', '--ddd'] - }); - - t.end(); -}); diff --git a/node_modules/minimist/test/unknown.js b/node_modules/minimist/test/unknown.js deleted file mode 100644 index 462a36bdd..000000000 --- a/node_modules/minimist/test/unknown.js +++ /dev/null @@ -1,102 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('boolean and alias is not unknown', function (t) { - var unknown = []; - function unknownFn(arg) { - unknown.push(arg); - return false; - } - var aliased = [ '-h', 'true', '--derp', 'true' ]; - var regular = [ '--herp', 'true', '-d', 'true' ]; - var opts = { - alias: { h: 'herp' }, - boolean: 'h', - unknown: unknownFn - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - - t.same(unknown, ['--derp', '-d']); - t.end(); -}); - -test('flag boolean true any double hyphen argument is not unknown', function (t) { - var unknown = []; - function unknownFn(arg) { - unknown.push(arg); - return false; - } - var argv = parse(['--honk', '--tacos=good', 'cow', '-p', '55'], { - boolean: true, - unknown: unknownFn - }); - t.same(unknown, ['--tacos=good', 'cow', '-p']); - t.same(argv, { - honk: true, - _: [] - }); - t.end(); -}); - -test('string and alias is not unknown', function (t) { - var unknown = []; - function unknownFn(arg) { - unknown.push(arg); - return false; - } - var aliased = [ '-h', 'hello', '--derp', 'goodbye' ]; - var regular = [ '--herp', 'hello', '-d', 'moon' ]; - var opts = { - alias: { h: 'herp' }, - string: 'h', - unknown: unknownFn - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - - t.same(unknown, ['--derp', '-d']); - t.end(); -}); - -test('default and alias is not unknown', function (t) { - var unknown = []; - function unknownFn(arg) { - unknown.push(arg); - return false; - } - var aliased = [ '-h', 'hello' ]; - var regular = [ '--herp', 'hello' ]; - var opts = { - default: { 'h': 'bar' }, - alias: { 'h': 'herp' }, - unknown: unknownFn - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - - t.same(unknown, []); - t.end(); - unknownFn(); // exercise fn for 100% coverage -}); - -test('value following -- is not unknown', function (t) { - var unknown = []; - function unknownFn(arg) { - unknown.push(arg); - return false; - } - var aliased = [ '--bad', '--', 'good', 'arg' ]; - var opts = { - '--': true, - unknown: unknownFn - }; - var argv = parse(aliased, opts); - - t.same(unknown, ['--bad']); - t.same(argv, { - '--': ['good', 'arg'], - '_': [] - }) - t.end(); -}); diff --git a/node_modules/minimist/test/whitespace.js b/node_modules/minimist/test/whitespace.js deleted file mode 100644 index 8a52a58ce..000000000 --- a/node_modules/minimist/test/whitespace.js +++ /dev/null @@ -1,8 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('whitespace should be whitespace' , function (t) { - t.plan(1); - var x = parse([ '-x', '\t' ]).x; - t.equal(x, '\t'); -}); diff --git a/node_modules/mixin-deep/LICENSE b/node_modules/mixin-deep/LICENSE deleted file mode 100644 index 99c936915..000000000 --- a/node_modules/mixin-deep/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2015, 2017, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/mixin-deep/README.md b/node_modules/mixin-deep/README.md deleted file mode 100644 index 111bde00b..000000000 --- a/node_modules/mixin-deep/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# mixin-deep [![NPM version](https://img.shields.io/npm/v/mixin-deep.svg?style=flat)](https://www.npmjs.com/package/mixin-deep) [![NPM monthly downloads](https://img.shields.io/npm/dm/mixin-deep.svg?style=flat)](https://npmjs.org/package/mixin-deep) [![NPM total downloads](https://img.shields.io/npm/dt/mixin-deep.svg?style=flat)](https://npmjs.org/package/mixin-deep) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/mixin-deep.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/mixin-deep) - -> Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save mixin-deep -``` - -## Usage - -```js -var mixinDeep = require('mixin-deep'); - -mixinDeep({a: {aa: 'aa'}}, {a: {bb: 'bb'}}, {a: {cc: 'cc'}}); -//=> { a: { aa: 'aa', bb: 'bb', cc: 'cc' } } -``` - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [defaults-deep](https://www.npmjs.com/package/defaults-deep): Like `extend` but recursively copies only the missing properties/values to the target object. | [homepage](https://github.com/jonschlinkert/defaults-deep "Like `extend` but recursively copies only the missing properties/values to the target object.") -* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") -* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") -* [mixin-object](https://www.npmjs.com/package/mixin-object): Mixin the own and inherited properties of other objects onto the first object. Pass an… [more](https://github.com/jonschlinkert/mixin-object) | [homepage](https://github.com/jonschlinkert/mixin-object "Mixin the own and inherited properties of other objects onto the first object. Pass an empty object as the first arg to shallow clone.") - -### Author - -**Jon Schlinkert** - -* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on December 09, 2017._ \ No newline at end of file diff --git a/node_modules/mixin-deep/index.js b/node_modules/mixin-deep/index.js deleted file mode 100644 index 909fbef75..000000000 --- a/node_modules/mixin-deep/index.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -var isExtendable = require('is-extendable'); -var forIn = require('for-in'); - -function mixinDeep(target, objects) { - var len = arguments.length, i = 0; - while (++i < len) { - var obj = arguments[i]; - if (isObject(obj)) { - forIn(obj, copy, target); - } - } - return target; -} - -/** - * Copy properties from the source object to the - * target object. - * - * @param {*} `val` - * @param {String} `key` - */ - -function copy(val, key) { - if (key === '__proto__') { - return; - } - - var obj = this[key]; - if (isObject(val) && isObject(obj)) { - mixinDeep(obj, val); - } else { - this[key] = val; - } -} - -/** - * Returns true if `val` is an object or function. - * - * @param {any} val - * @return {Boolean} - */ - -function isObject(val) { - return isExtendable(val) && !Array.isArray(val); -} - -/** - * Expose `mixinDeep` - */ - -module.exports = mixinDeep; diff --git a/node_modules/mixin-deep/node_modules/is-extendable/LICENSE b/node_modules/mixin-deep/node_modules/is-extendable/LICENSE deleted file mode 100644 index c0d7f1362..000000000 --- a/node_modules/mixin-deep/node_modules/is-extendable/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2017, Jon Schlinkert. - -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. \ No newline at end of file diff --git a/node_modules/mixin-deep/node_modules/is-extendable/README.md b/node_modules/mixin-deep/node_modules/is-extendable/README.md deleted file mode 100644 index 875b56a73..000000000 --- a/node_modules/mixin-deep/node_modules/is-extendable/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# is-extendable [![NPM version](https://img.shields.io/npm/v/is-extendable.svg?style=flat)](https://www.npmjs.com/package/is-extendable) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-extendable.svg?style=flat)](https://npmjs.org/package/is-extendable) [![NPM total downloads](https://img.shields.io/npm/dt/is-extendable.svg?style=flat)](https://npmjs.org/package/is-extendable) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-extendable.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-extendable) - -> Returns true if a value is a plain object, array or function. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save is-extendable -``` - -## Usage - -```js -var isExtendable = require('is-extendable'); -``` - -Returns true if the value is any of the following: - -* array -* plain object -* function - -## Notes - -All objects in JavaScript can have keys, but it's a pain to check for this, since we ether need to verify that the value is not `null` or `undefined` and: - -* the value is not a primitive, or -* that the object is a plain object, function or array - -Also note that an `extendable` object is not the same as an [extensible object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible), which is one that (in es6) is not sealed, frozen, or marked as non-extensible using `preventExtensions`. - -## Release history - -### v1.0.0 - 2017/07/20 - -**Breaking changes** - -* No longer considers date, regex or error objects to be extendable - -## About - -### Related projects - -* [assign-deep](https://www.npmjs.com/package/assign-deep): Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target… [more](https://github.com/jonschlinkert/assign-deep) | [homepage](https://github.com/jonschlinkert/assign-deep "Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target (first) object.") -* [is-equal-shallow](https://www.npmjs.com/package/is-equal-shallow): Does a shallow comparison of two objects, returning false if the keys or values differ. | [homepage](https://github.com/jonschlinkert/is-equal-shallow "Does a shallow comparison of two objects, returning false if the keys or values differ.") -* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") -* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") -* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 20, 2017._ \ No newline at end of file diff --git a/node_modules/mixin-deep/node_modules/is-extendable/index.d.ts b/node_modules/mixin-deep/node_modules/is-extendable/index.d.ts deleted file mode 100644 index b96d50754..000000000 --- a/node_modules/mixin-deep/node_modules/is-extendable/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export = isExtendable; - -declare function isExtendable(val: any): boolean; - -declare namespace isExtendable {} diff --git a/node_modules/mixin-deep/node_modules/is-extendable/index.js b/node_modules/mixin-deep/node_modules/is-extendable/index.js deleted file mode 100644 index a8b26ad08..000000000 --- a/node_modules/mixin-deep/node_modules/is-extendable/index.js +++ /dev/null @@ -1,14 +0,0 @@ -/*! - * is-extendable - * - * Copyright (c) 2015-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var isPlainObject = require('is-plain-object'); - -module.exports = function isExtendable(val) { - return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); -}; diff --git a/node_modules/mixin-deep/node_modules/is-extendable/package.json b/node_modules/mixin-deep/node_modules/is-extendable/package.json deleted file mode 100644 index 1322c8454..000000000 --- a/node_modules/mixin-deep/node_modules/is-extendable/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "_from": "is-extendable@^1.0.1", - "_id": "is-extendable@1.0.1", - "_inBundle": false, - "_integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "_location": "/mixin-deep/is-extendable", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-extendable@^1.0.1", - "name": "is-extendable", - "escapedName": "is-extendable", - "rawSpec": "^1.0.1", - "saveSpec": null, - "fetchSpec": "^1.0.1" - }, - "_requiredBy": [ - "/mixin-deep" - ], - "_resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "_shasum": "a7470f9e426733d81bd81e1155264e3a3507cab4", - "_spec": "is-extendable@^1.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/mixin-deep", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-extendable/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-plain-object": "^2.0.4" - }, - "deprecated": false, - "description": "Returns true if a value is a plain object, array or function.", - "devDependencies": { - "gulp-format-md": "^1.0.0", - "mocha": "^3.4.2" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/jonschlinkert/is-extendable", - "keywords": [ - "array", - "assign", - "check", - "date", - "extend", - "extendable", - "extensible", - "function", - "is", - "object", - "regex", - "test" - ], - "license": "MIT", - "main": "index.js", - "name": "is-extendable", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-extendable.git" - }, - "scripts": { - "test": "mocha" - }, - "types": "index.d.ts", - "verb": { - "related": { - "list": [ - "assign-deep", - "is-equal-shallow", - "is-plain-object", - "isobject", - "kind-of" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - } - }, - "version": "1.0.1" -} diff --git a/node_modules/mixin-deep/package.json b/node_modules/mixin-deep/package.json deleted file mode 100644 index e1d08f32e..000000000 --- a/node_modules/mixin-deep/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "_from": "mixin-deep@^1.2.0", - "_id": "mixin-deep@1.3.1", - "_inBundle": false, - "_integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", - "_location": "/mixin-deep", - "_phantomChildren": { - "is-plain-object": "2.0.4" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "mixin-deep@^1.2.0", - "name": "mixin-deep", - "escapedName": "mixin-deep", - "rawSpec": "^1.2.0", - "saveSpec": null, - "fetchSpec": "^1.2.0" - }, - "_requiredBy": [ - "/base" - ], - "_resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "_shasum": "a49e7268dce1a0d9698e45326c5626df3543d0fe", - "_spec": "mixin-deep@^1.2.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/base", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/mixin-deep/issues" - }, - "bundleDependencies": false, - "dependencies": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "deprecated": false, - "description": "Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone.", - "devDependencies": { - "gulp-format-md": "^1.0.0", - "mocha": "^3.5.3", - "should": "^13.1.3" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/mixin-deep", - "keywords": [ - "deep", - "extend", - "key", - "keys", - "merge", - "mixin", - "object", - "prop", - "properties", - "util", - "values" - ], - "license": "MIT", - "main": "index.js", - "name": "mixin-deep", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/mixin-deep.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "defaults-deep", - "extend-shallow", - "merge-deep", - "mixin-object" - ] - }, - "lint": { - "reflinks": true - } - }, - "version": "1.3.1" -} diff --git a/node_modules/mkdirp/.travis.yml b/node_modules/mkdirp/.travis.yml deleted file mode 100644 index 74c57bf15..000000000 --- a/node_modules/mkdirp/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" - - "0.12" - - "iojs" -before_install: - - npm install -g npm@~1.4.6 diff --git a/node_modules/mkdirp/LICENSE b/node_modules/mkdirp/LICENSE deleted file mode 100644 index 432d1aeb0..000000000 --- a/node_modules/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright 2010 James Halliday (mail@substack.net) - -This project is free software released under the MIT/X11 license: - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/mkdirp/bin/cmd.js b/node_modules/mkdirp/bin/cmd.js deleted file mode 100755 index d95de15ae..000000000 --- a/node_modules/mkdirp/bin/cmd.js +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env node - -var mkdirp = require('../'); -var minimist = require('minimist'); -var fs = require('fs'); - -var argv = minimist(process.argv.slice(2), { - alias: { m: 'mode', h: 'help' }, - string: [ 'mode' ] -}); -if (argv.help) { - fs.createReadStream(__dirname + '/usage.txt').pipe(process.stdout); - return; -} - -var paths = argv._.slice(); -var mode = argv.mode ? parseInt(argv.mode, 8) : undefined; - -(function next () { - if (paths.length === 0) return; - var p = paths.shift(); - - if (mode === undefined) mkdirp(p, cb) - else mkdirp(p, mode, cb) - - function cb (err) { - if (err) { - console.error(err.message); - process.exit(1); - } - else next(); - } -})(); diff --git a/node_modules/mkdirp/bin/usage.txt b/node_modules/mkdirp/bin/usage.txt deleted file mode 100644 index f952aa2c7..000000000 --- a/node_modules/mkdirp/bin/usage.txt +++ /dev/null @@ -1,12 +0,0 @@ -usage: mkdirp [DIR1,DIR2..] {OPTIONS} - - Create each supplied directory including any necessary parent directories that - don't yet exist. - - If the directory already exists, do nothing. - -OPTIONS are: - - -m, --mode If a directory needs to be created, set the mode as an octal - permission string. - diff --git a/node_modules/mkdirp/examples/pow.js b/node_modules/mkdirp/examples/pow.js deleted file mode 100644 index e6924212e..000000000 --- a/node_modules/mkdirp/examples/pow.js +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/node_modules/mkdirp/index.js b/node_modules/mkdirp/index.js deleted file mode 100644 index 6ce241b58..000000000 --- a/node_modules/mkdirp/index.js +++ /dev/null @@ -1,98 +0,0 @@ -var path = require('path'); -var fs = require('fs'); -var _0777 = parseInt('0777', 8); - -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, opts, f, made) { - if (typeof opts === 'function') { - f = opts; - opts = {}; - } - else if (!opts || typeof opts !== 'object') { - opts = { mode: opts }; - } - - var mode = opts.mode; - var xfs = opts.fs || fs; - - if (mode === undefined) { - mode = _0777 & (~process.umask()); - } - if (!made) made = null; - - var cb = f || function () {}; - p = path.resolve(p); - - xfs.mkdir(p, mode, function (er) { - if (!er) { - made = made || p; - return cb(null, made); - } - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), opts, function (er, made) { - if (er) cb(er, made); - else mkdirP(p, opts, cb, made); - }); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - xfs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original error be the failure reason. - if (er2 || !stat.isDirectory()) cb(er, made) - else cb(null, made); - }); - break; - } - }); -} - -mkdirP.sync = function sync (p, opts, made) { - if (!opts || typeof opts !== 'object') { - opts = { mode: opts }; - } - - var mode = opts.mode; - var xfs = opts.fs || fs; - - if (mode === undefined) { - mode = _0777 & (~process.umask()); - } - if (!made) made = null; - - p = path.resolve(p); - - try { - xfs.mkdirSync(p, mode); - made = made || p; - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - made = sync(path.dirname(p), opts, made); - sync(p, opts, made); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - var stat; - try { - stat = xfs.statSync(p); - } - catch (err1) { - throw err0; - } - if (!stat.isDirectory()) throw err0; - break; - } - } - - return made; -}; diff --git a/node_modules/mkdirp/node_modules/minimist/.travis.yml b/node_modules/mkdirp/node_modules/minimist/.travis.yml deleted file mode 100644 index cc4dba29d..000000000 --- a/node_modules/mkdirp/node_modules/minimist/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" diff --git a/node_modules/mkdirp/node_modules/minimist/LICENSE b/node_modules/mkdirp/node_modules/minimist/LICENSE deleted file mode 100644 index ee27ba4b4..000000000 --- a/node_modules/mkdirp/node_modules/minimist/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/mkdirp/node_modules/minimist/example/parse.js b/node_modules/mkdirp/node_modules/minimist/example/parse.js deleted file mode 100644 index abff3e8ee..000000000 --- a/node_modules/mkdirp/node_modules/minimist/example/parse.js +++ /dev/null @@ -1,2 +0,0 @@ -var argv = require('../')(process.argv.slice(2)); -console.dir(argv); diff --git a/node_modules/mkdirp/node_modules/minimist/index.js b/node_modules/mkdirp/node_modules/minimist/index.js deleted file mode 100644 index 584f551a6..000000000 --- a/node_modules/mkdirp/node_modules/minimist/index.js +++ /dev/null @@ -1,187 +0,0 @@ -module.exports = function (args, opts) { - if (!opts) opts = {}; - - var flags = { bools : {}, strings : {} }; - - [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { - flags.bools[key] = true; - }); - - [].concat(opts.string).filter(Boolean).forEach(function (key) { - flags.strings[key] = true; - }); - - var aliases = {}; - Object.keys(opts.alias || {}).forEach(function (key) { - aliases[key] = [].concat(opts.alias[key]); - aliases[key].forEach(function (x) { - aliases[x] = [key].concat(aliases[key].filter(function (y) { - return x !== y; - })); - }); - }); - - var defaults = opts['default'] || {}; - - var argv = { _ : [] }; - Object.keys(flags.bools).forEach(function (key) { - setArg(key, defaults[key] === undefined ? false : defaults[key]); - }); - - var notFlags = []; - - if (args.indexOf('--') !== -1) { - notFlags = args.slice(args.indexOf('--')+1); - args = args.slice(0, args.indexOf('--')); - } - - function setArg (key, val) { - var value = !flags.strings[key] && isNumber(val) - ? Number(val) : val - ; - setKey(argv, key.split('.'), value); - - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), value); - }); - } - - for (var i = 0; i < args.length; i++) { - var arg = args[i]; - - if (/^--.+=/.test(arg)) { - // Using [\s\S] instead of . because js doesn't support the - // 'dotall' regex modifier. See: - // http://stackoverflow.com/a/1068308/13216 - var m = arg.match(/^--([^=]+)=([\s\S]*)$/); - setArg(m[1], m[2]); - } - else if (/^--no-.+/.test(arg)) { - var key = arg.match(/^--no-(.+)/)[1]; - setArg(key, false); - } - else if (/^--.+/.test(arg)) { - var key = arg.match(/^--(.+)/)[1]; - var next = args[i + 1]; - if (next !== undefined && !/^-/.test(next) - && !flags.bools[key] - && (aliases[key] ? !flags.bools[aliases[key]] : true)) { - setArg(key, next); - i++; - } - else if (/^(true|false)$/.test(next)) { - setArg(key, next === 'true'); - i++; - } - else { - setArg(key, flags.strings[key] ? '' : true); - } - } - else if (/^-[^-]+/.test(arg)) { - var letters = arg.slice(1,-1).split(''); - - var broken = false; - for (var j = 0; j < letters.length; j++) { - var next = arg.slice(j+2); - - if (next === '-') { - setArg(letters[j], next) - continue; - } - - if (/[A-Za-z]/.test(letters[j]) - && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { - setArg(letters[j], next); - broken = true; - break; - } - - if (letters[j+1] && letters[j+1].match(/\W/)) { - setArg(letters[j], arg.slice(j+2)); - broken = true; - break; - } - else { - setArg(letters[j], flags.strings[letters[j]] ? '' : true); - } - } - - var key = arg.slice(-1)[0]; - if (!broken && key !== '-') { - if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) - && !flags.bools[key] - && (aliases[key] ? !flags.bools[aliases[key]] : true)) { - setArg(key, args[i+1]); - i++; - } - else if (args[i+1] && /true|false/.test(args[i+1])) { - setArg(key, args[i+1] === 'true'); - i++; - } - else { - setArg(key, flags.strings[key] ? '' : true); - } - } - } - else { - argv._.push( - flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) - ); - } - } - - Object.keys(defaults).forEach(function (key) { - if (!hasKey(argv, key.split('.'))) { - setKey(argv, key.split('.'), defaults[key]); - - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), defaults[key]); - }); - } - }); - - notFlags.forEach(function(key) { - argv._.push(key); - }); - - return argv; -}; - -function hasKey (obj, keys) { - var o = obj; - keys.slice(0,-1).forEach(function (key) { - o = (o[key] || {}); - }); - - var key = keys[keys.length - 1]; - return key in o; -} - -function setKey (obj, keys, value) { - var o = obj; - keys.slice(0,-1).forEach(function (key) { - if (o[key] === undefined) o[key] = {}; - o = o[key]; - }); - - var key = keys[keys.length - 1]; - if (o[key] === undefined || typeof o[key] === 'boolean') { - o[key] = value; - } - else if (Array.isArray(o[key])) { - o[key].push(value); - } - else { - o[key] = [ o[key], value ]; - } -} - -function isNumber (x) { - if (typeof x === 'number') return true; - if (/^0x[0-9a-f]+$/i.test(x)) return true; - return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); -} - -function longest (xs) { - return Math.max.apply(null, xs.map(function (x) { return x.length })); -} diff --git a/node_modules/mkdirp/node_modules/minimist/package.json b/node_modules/mkdirp/node_modules/minimist/package.json deleted file mode 100644 index 060870161..000000000 --- a/node_modules/mkdirp/node_modules/minimist/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "_from": "minimist@0.0.8", - "_id": "minimist@0.0.8", - "_inBundle": false, - "_integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "_location": "/mkdirp/minimist", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "minimist@0.0.8", - "name": "minimist", - "escapedName": "minimist", - "rawSpec": "0.0.8", - "saveSpec": null, - "fetchSpec": "0.0.8" - }, - "_requiredBy": [ - "/mkdirp" - ], - "_resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "_shasum": "857fcabfc3397d2625b8228262e86aa7a011b05d", - "_spec": "minimist@0.0.8", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/mkdirp", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/minimist/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "parse argument options", - "devDependencies": { - "tap": "~0.4.0", - "tape": "~1.0.4" - }, - "homepage": "https://github.com/substack/minimist", - "keywords": [ - "argv", - "getopt", - "parser", - "optimist" - ], - "license": "MIT", - "main": "index.js", - "name": "minimist", - "repository": { - "type": "git", - "url": "git://github.com/substack/minimist.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/6..latest", - "ff/5", - "firefox/latest", - "chrome/10", - "chrome/latest", - "safari/5.1", - "safari/latest", - "opera/12" - ] - }, - "version": "0.0.8" -} diff --git a/node_modules/mkdirp/node_modules/minimist/readme.markdown b/node_modules/mkdirp/node_modules/minimist/readme.markdown deleted file mode 100644 index c25635323..000000000 --- a/node_modules/mkdirp/node_modules/minimist/readme.markdown +++ /dev/null @@ -1,73 +0,0 @@ -# minimist - -parse argument options - -This module is the guts of optimist's argument parser without all the -fanciful decoration. - -[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist) - -[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist) - -# example - -``` js -var argv = require('minimist')(process.argv.slice(2)); -console.dir(argv); -``` - -``` -$ node example/parse.js -a beep -b boop -{ _: [], a: 'beep', b: 'boop' } -``` - -``` -$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz -{ _: [ 'foo', 'bar', 'baz' ], - x: 3, - y: 4, - n: 5, - a: true, - b: true, - c: true, - beep: 'boop' } -``` - -# methods - -``` js -var parseArgs = require('minimist') -``` - -## var argv = parseArgs(args, opts={}) - -Return an argument object `argv` populated with the array arguments from `args`. - -`argv._` contains all the arguments that didn't have an option associated with -them. - -Numeric-looking arguments will be returned as numbers unless `opts.string` or -`opts.boolean` is set for that argument name. - -Any arguments after `'--'` will not be parsed and will end up in `argv._`. - -options can be: - -* `opts.string` - a string or array of strings argument names to always treat as -strings -* `opts.boolean` - a string or array of strings to always treat as booleans -* `opts.alias` - an object mapping string names to strings or arrays of string -argument names to use as aliases -* `opts.default` - an object mapping string argument names to default values - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install minimist -``` - -# license - -MIT diff --git a/node_modules/mkdirp/node_modules/minimist/test/dash.js b/node_modules/mkdirp/node_modules/minimist/test/dash.js deleted file mode 100644 index 8b034b99a..000000000 --- a/node_modules/mkdirp/node_modules/minimist/test/dash.js +++ /dev/null @@ -1,24 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('-', function (t) { - t.plan(5); - t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] }); - t.deepEqual(parse([ '-' ]), { _: [ '-' ] }); - t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] }); - t.deepEqual( - parse([ '-b', '-' ], { boolean: 'b' }), - { b: true, _: [ '-' ] } - ); - t.deepEqual( - parse([ '-s', '-' ], { string: 's' }), - { s: '-', _: [] } - ); -}); - -test('-a -- b', function (t) { - t.plan(3); - t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] }); - t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); - t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); -}); diff --git a/node_modules/mkdirp/node_modules/minimist/test/default_bool.js b/node_modules/mkdirp/node_modules/minimist/test/default_bool.js deleted file mode 100644 index f0041ee40..000000000 --- a/node_modules/mkdirp/node_modules/minimist/test/default_bool.js +++ /dev/null @@ -1,20 +0,0 @@ -var test = require('tape'); -var parse = require('../'); - -test('boolean default true', function (t) { - var argv = parse([], { - boolean: 'sometrue', - default: { sometrue: true } - }); - t.equal(argv.sometrue, true); - t.end(); -}); - -test('boolean default false', function (t) { - var argv = parse([], { - boolean: 'somefalse', - default: { somefalse: false } - }); - t.equal(argv.somefalse, false); - t.end(); -}); diff --git a/node_modules/mkdirp/node_modules/minimist/test/dotted.js b/node_modules/mkdirp/node_modules/minimist/test/dotted.js deleted file mode 100644 index ef0ae349b..000000000 --- a/node_modules/mkdirp/node_modules/minimist/test/dotted.js +++ /dev/null @@ -1,16 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('dotted alias', function (t) { - var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); - t.equal(argv.a.b, 22); - t.equal(argv.aa.bb, 22); - t.end(); -}); - -test('dotted default', function (t) { - var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); - t.equal(argv.a.b, 11); - t.equal(argv.aa.bb, 11); - t.end(); -}); diff --git a/node_modules/mkdirp/node_modules/minimist/test/long.js b/node_modules/mkdirp/node_modules/minimist/test/long.js deleted file mode 100644 index 5d3a1e09d..000000000 --- a/node_modules/mkdirp/node_modules/minimist/test/long.js +++ /dev/null @@ -1,31 +0,0 @@ -var test = require('tape'); -var parse = require('../'); - -test('long opts', function (t) { - t.deepEqual( - parse([ '--bool' ]), - { bool : true, _ : [] }, - 'long boolean' - ); - t.deepEqual( - parse([ '--pow', 'xixxle' ]), - { pow : 'xixxle', _ : [] }, - 'long capture sp' - ); - t.deepEqual( - parse([ '--pow=xixxle' ]), - { pow : 'xixxle', _ : [] }, - 'long capture eq' - ); - t.deepEqual( - parse([ '--host', 'localhost', '--port', '555' ]), - { host : 'localhost', port : 555, _ : [] }, - 'long captures sp' - ); - t.deepEqual( - parse([ '--host=localhost', '--port=555' ]), - { host : 'localhost', port : 555, _ : [] }, - 'long captures eq' - ); - t.end(); -}); diff --git a/node_modules/mkdirp/node_modules/minimist/test/parse.js b/node_modules/mkdirp/node_modules/minimist/test/parse.js deleted file mode 100644 index 8a9064669..000000000 --- a/node_modules/mkdirp/node_modules/minimist/test/parse.js +++ /dev/null @@ -1,318 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('parse args', function (t) { - t.deepEqual( - parse([ '--no-moo' ]), - { moo : false, _ : [] }, - 'no' - ); - t.deepEqual( - parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), - { v : ['a','b','c'], _ : [] }, - 'multi' - ); - t.end(); -}); - -test('comprehensive', function (t) { - t.deepEqual( - parse([ - '--name=meowmers', 'bare', '-cats', 'woo', - '-h', 'awesome', '--multi=quux', - '--key', 'value', - '-b', '--bool', '--no-meep', '--multi=baz', - '--', '--not-a-flag', 'eek' - ]), - { - c : true, - a : true, - t : true, - s : 'woo', - h : 'awesome', - b : true, - bool : true, - key : 'value', - multi : [ 'quux', 'baz' ], - meep : false, - name : 'meowmers', - _ : [ 'bare', '--not-a-flag', 'eek' ] - } - ); - t.end(); -}); - -test('nums', function (t) { - var argv = parse([ - '-x', '1234', - '-y', '5.67', - '-z', '1e7', - '-w', '10f', - '--hex', '0xdeadbeef', - '789' - ]); - t.deepEqual(argv, { - x : 1234, - y : 5.67, - z : 1e7, - w : '10f', - hex : 0xdeadbeef, - _ : [ 789 ] - }); - t.deepEqual(typeof argv.x, 'number'); - t.deepEqual(typeof argv.y, 'number'); - t.deepEqual(typeof argv.z, 'number'); - t.deepEqual(typeof argv.w, 'string'); - t.deepEqual(typeof argv.hex, 'number'); - t.deepEqual(typeof argv._[0], 'number'); - t.end(); -}); - -test('flag boolean', function (t) { - var argv = parse([ '-t', 'moo' ], { boolean: 't' }); - t.deepEqual(argv, { t : true, _ : [ 'moo' ] }); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); -}); - -test('flag boolean value', function (t) { - var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], { - boolean: [ 't', 'verbose' ], - default: { verbose: true } - }); - - t.deepEqual(argv, { - verbose: false, - t: true, - _: ['moo'] - }); - - t.deepEqual(typeof argv.verbose, 'boolean'); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); -}); - -test('flag boolean default false', function (t) { - var argv = parse(['moo'], { - boolean: ['t', 'verbose'], - default: { verbose: false, t: false } - }); - - t.deepEqual(argv, { - verbose: false, - t: false, - _: ['moo'] - }); - - t.deepEqual(typeof argv.verbose, 'boolean'); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); - -}); - -test('boolean groups', function (t) { - var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { - boolean: ['x','y','z'] - }); - - t.deepEqual(argv, { - x : true, - y : false, - z : true, - _ : [ 'one', 'two', 'three' ] - }); - - t.deepEqual(typeof argv.x, 'boolean'); - t.deepEqual(typeof argv.y, 'boolean'); - t.deepEqual(typeof argv.z, 'boolean'); - t.end(); -}); - -test('newlines in params' , function (t) { - var args = parse([ '-s', "X\nX" ]) - t.deepEqual(args, { _ : [], s : "X\nX" }); - - // reproduce in bash: - // VALUE="new - // line" - // node program.js --s="$VALUE" - args = parse([ "--s=X\nX" ]) - t.deepEqual(args, { _ : [], s : "X\nX" }); - t.end(); -}); - -test('strings' , function (t) { - var s = parse([ '-s', '0001234' ], { string: 's' }).s; - t.equal(s, '0001234'); - t.equal(typeof s, 'string'); - - var x = parse([ '-x', '56' ], { string: 'x' }).x; - t.equal(x, '56'); - t.equal(typeof x, 'string'); - t.end(); -}); - -test('stringArgs', function (t) { - var s = parse([ ' ', ' ' ], { string: '_' })._; - t.same(s.length, 2); - t.same(typeof s[0], 'string'); - t.same(s[0], ' '); - t.same(typeof s[1], 'string'); - t.same(s[1], ' '); - t.end(); -}); - -test('empty strings', function(t) { - var s = parse([ '-s' ], { string: 's' }).s; - t.equal(s, ''); - t.equal(typeof s, 'string'); - - var str = parse([ '--str' ], { string: 'str' }).str; - t.equal(str, ''); - t.equal(typeof str, 'string'); - - var letters = parse([ '-art' ], { - string: [ 'a', 't' ] - }); - - t.equal(letters.a, ''); - t.equal(letters.r, true); - t.equal(letters.t, ''); - - t.end(); -}); - - -test('slashBreak', function (t) { - t.same( - parse([ '-I/foo/bar/baz' ]), - { I : '/foo/bar/baz', _ : [] } - ); - t.same( - parse([ '-xyz/foo/bar/baz' ]), - { x : true, y : true, z : '/foo/bar/baz', _ : [] } - ); - t.end(); -}); - -test('alias', function (t) { - var argv = parse([ '-f', '11', '--zoom', '55' ], { - alias: { z: 'zoom' } - }); - t.equal(argv.zoom, 55); - t.equal(argv.z, argv.zoom); - t.equal(argv.f, 11); - t.end(); -}); - -test('multiAlias', function (t) { - var argv = parse([ '-f', '11', '--zoom', '55' ], { - alias: { z: [ 'zm', 'zoom' ] } - }); - t.equal(argv.zoom, 55); - t.equal(argv.z, argv.zoom); - t.equal(argv.z, argv.zm); - t.equal(argv.f, 11); - t.end(); -}); - -test('nested dotted objects', function (t) { - var argv = parse([ - '--foo.bar', '3', '--foo.baz', '4', - '--foo.quux.quibble', '5', '--foo.quux.o_O', - '--beep.boop' - ]); - - t.same(argv.foo, { - bar : 3, - baz : 4, - quux : { - quibble : 5, - o_O : true - } - }); - t.same(argv.beep, { boop : true }); - t.end(); -}); - -test('boolean and alias with chainable api', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var opts = { - herp: { alias: 'h', boolean: true } - }; - var aliasedArgv = parse(aliased, { - boolean: 'herp', - alias: { h: 'herp' } - }); - var propertyArgv = parse(regular, { - boolean: 'herp', - alias: { h: 'herp' } - }); - var expected = { - herp: true, - h: true, - '_': [ 'derp' ] - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -test('boolean and alias with options hash', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var opts = { - alias: { 'h': 'herp' }, - boolean: 'herp' - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - var expected = { - herp: true, - h: true, - '_': [ 'derp' ] - }; - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -test('boolean and alias using explicit true', function (t) { - var aliased = [ '-h', 'true' ]; - var regular = [ '--herp', 'true' ]; - var opts = { - alias: { h: 'herp' }, - boolean: 'h' - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - var expected = { - herp: true, - h: true, - '_': [ ] - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -// regression, see https://github.com/substack/node-optimist/issues/71 -test('boolean and --x=true', function(t) { - var parsed = parse(['--boool', '--other=true'], { - boolean: 'boool' - }); - - t.same(parsed.boool, true); - t.same(parsed.other, 'true'); - - parsed = parse(['--boool', '--other=false'], { - boolean: 'boool' - }); - - t.same(parsed.boool, true); - t.same(parsed.other, 'false'); - t.end(); -}); diff --git a/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js b/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js deleted file mode 100644 index 21851b036..000000000 --- a/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js +++ /dev/null @@ -1,9 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('parse with modifier functions' , function (t) { - t.plan(1); - - var argv = parse([ '-b', '123' ], { boolean: 'b' }); - t.deepEqual(argv, { b: true, _: ['123'] }); -}); diff --git a/node_modules/mkdirp/node_modules/minimist/test/short.js b/node_modules/mkdirp/node_modules/minimist/test/short.js deleted file mode 100644 index d513a1c25..000000000 --- a/node_modules/mkdirp/node_modules/minimist/test/short.js +++ /dev/null @@ -1,67 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('numeric short args', function (t) { - t.plan(2); - t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] }); - t.deepEqual( - parse([ '-123', '456' ]), - { 1: true, 2: true, 3: 456, _: [] } - ); -}); - -test('short', function (t) { - t.deepEqual( - parse([ '-b' ]), - { b : true, _ : [] }, - 'short boolean' - ); - t.deepEqual( - parse([ 'foo', 'bar', 'baz' ]), - { _ : [ 'foo', 'bar', 'baz' ] }, - 'bare' - ); - t.deepEqual( - parse([ '-cats' ]), - { c : true, a : true, t : true, s : true, _ : [] }, - 'group' - ); - t.deepEqual( - parse([ '-cats', 'meow' ]), - { c : true, a : true, t : true, s : 'meow', _ : [] }, - 'short group next' - ); - t.deepEqual( - parse([ '-h', 'localhost' ]), - { h : 'localhost', _ : [] }, - 'short capture' - ); - t.deepEqual( - parse([ '-h', 'localhost', '-p', '555' ]), - { h : 'localhost', p : 555, _ : [] }, - 'short captures' - ); - t.end(); -}); - -test('mixed short bool and capture', function (t) { - t.same( - parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), - { - f : true, p : 555, h : 'localhost', - _ : [ 'script.js' ] - } - ); - t.end(); -}); - -test('short and long', function (t) { - t.deepEqual( - parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), - { - f : true, p : 555, h : 'localhost', - _ : [ 'script.js' ] - } - ); - t.end(); -}); diff --git a/node_modules/mkdirp/node_modules/minimist/test/whitespace.js b/node_modules/mkdirp/node_modules/minimist/test/whitespace.js deleted file mode 100644 index 8a52a58ce..000000000 --- a/node_modules/mkdirp/node_modules/minimist/test/whitespace.js +++ /dev/null @@ -1,8 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('whitespace should be whitespace' , function (t) { - t.plan(1); - var x = parse([ '-x', '\t' ]).x; - t.equal(x, '\t'); -}); diff --git a/node_modules/mkdirp/package.json b/node_modules/mkdirp/package.json deleted file mode 100644 index cfb489467..000000000 --- a/node_modules/mkdirp/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_from": "mkdirp@^0.5.0", - "_id": "mkdirp@0.5.1", - "_inBundle": false, - "_integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "_location": "/mkdirp", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "mkdirp@^0.5.0", - "name": "mkdirp", - "escapedName": "mkdirp", - "rawSpec": "^0.5.0", - "saveSpec": null, - "fetchSpec": "^0.5.0" - }, - "_requiredBy": [ - "/browserify" - ], - "_resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "_shasum": "30057438eac6cf7f8c4767f38648d6697d75c903", - "_spec": "mkdirp@^0.5.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bin": { - "mkdirp": "bin/cmd.js" - }, - "bugs": { - "url": "https://github.com/substack/node-mkdirp/issues" - }, - "bundleDependencies": false, - "dependencies": { - "minimist": "0.0.8" - }, - "deprecated": false, - "description": "Recursively mkdir, like `mkdir -p`", - "devDependencies": { - "mock-fs": "2 >=2.7.0", - "tap": "1" - }, - "homepage": "https://github.com/substack/node-mkdirp#readme", - "keywords": [ - "mkdir", - "directory" - ], - "license": "MIT", - "main": "index.js", - "name": "mkdirp", - "repository": { - "type": "git", - "url": "git+https://github.com/substack/node-mkdirp.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "0.5.1" -} diff --git a/node_modules/mkdirp/readme.markdown b/node_modules/mkdirp/readme.markdown deleted file mode 100644 index 3cc131538..000000000 --- a/node_modules/mkdirp/readme.markdown +++ /dev/null @@ -1,100 +0,0 @@ -# mkdirp - -Like `mkdir -p`, but in node.js! - -[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) - -# example - -## pow.js - -```js -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); -``` - -Output - -``` -pow! -``` - -And now /tmp/foo/bar/baz exists, huzzah! - -# methods - -```js -var mkdirp = require('mkdirp'); -``` - -## mkdirp(dir, opts, cb) - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `opts.mode`. If `opts` is a non-object, it will be treated as -the `opts.mode`. - -If `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -`cb(err, made)` fires with the error or the first directory `made` -that had to be created, if any. - -You can optionally pass in an alternate `fs` implementation by passing in -`opts.fs`. Your implementation should have `opts.fs.mkdir(path, mode, cb)` and -`opts.fs.stat(path, cb)`. - -## mkdirp.sync(dir, opts) - -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `opts.mode`. If `opts` is a non-object, it will be -treated as the `opts.mode`. - -If `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -Returns the first directory that had to be created, if any. - -You can optionally pass in an alternate `fs` implementation by passing in -`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` and -`opts.fs.statSync(path)`. - -# usage - -This package also ships with a `mkdirp` command. - -``` -usage: mkdirp [DIR1,DIR2..] {OPTIONS} - - Create each supplied directory including any necessary parent directories that - don't yet exist. - - If the directory already exists, do nothing. - -OPTIONS are: - - -m, --mode If a directory needs to be created, set the mode as an octal - permission string. - -``` - -# install - -With [npm](http://npmjs.org) do: - -``` -npm install mkdirp -``` - -to get the library, or - -``` -npm install -g mkdirp -``` - -to get the command. - -# license - -MIT diff --git a/node_modules/mkdirp/test/chmod.js b/node_modules/mkdirp/test/chmod.js deleted file mode 100644 index 6a404b932..000000000 --- a/node_modules/mkdirp/test/chmod.js +++ /dev/null @@ -1,41 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); -var _0744 = parseInt('0744', 8); - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -test('chmod-pre', function (t) { - var mode = _0744 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.equal(stat && stat.mode & _0777, mode, 'should be 0744'); - t.end(); - }); - }); -}); - -test('chmod', function (t) { - var mode = _0755 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.end(); - }); - }); -}); diff --git a/node_modules/mkdirp/test/clobber.js b/node_modules/mkdirp/test/clobber.js deleted file mode 100644 index 2433b9ad5..000000000 --- a/node_modules/mkdirp/test/clobber.js +++ /dev/null @@ -1,38 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; -var _0755 = parseInt('0755', 8); - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -// a file in the way -var itw = ps.slice(0, 3).join('/'); - - -test('clobber-pre', function (t) { - console.error("about to write to "+itw) - fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); - - fs.stat(itw, function (er, stat) { - t.ifError(er) - t.ok(stat && stat.isFile(), 'should be file') - t.end() - }) -}) - -test('clobber', function (t) { - t.plan(2); - mkdirp(file, _0755, function (err) { - t.ok(err); - t.equal(err.code, 'ENOTDIR'); - t.end(); - }); -}); diff --git a/node_modules/mkdirp/test/mkdirp.js b/node_modules/mkdirp/test/mkdirp.js deleted file mode 100644 index eaa8921c7..000000000 --- a/node_modules/mkdirp/test/mkdirp.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('woo', function (t) { - t.plan(5); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, _0755, function (err) { - t.ifError(err); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }) - }) - }); -}); diff --git a/node_modules/mkdirp/test/opts_fs.js b/node_modules/mkdirp/test/opts_fs.js deleted file mode 100644 index 97186b62e..000000000 --- a/node_modules/mkdirp/test/opts_fs.js +++ /dev/null @@ -1,29 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var test = require('tap').test; -var mockfs = require('mock-fs'); -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('opts.fs', function (t) { - t.plan(5); - - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/beep/boop/' + [x,y,z].join('/'); - var xfs = mockfs.fs(); - - mkdirp(file, { fs: xfs, mode: _0755 }, function (err) { - t.ifError(err); - xfs.exists(file, function (ex) { - t.ok(ex, 'created file'); - xfs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }); - }); -}); diff --git a/node_modules/mkdirp/test/opts_fs_sync.js b/node_modules/mkdirp/test/opts_fs_sync.js deleted file mode 100644 index 6c370aa6e..000000000 --- a/node_modules/mkdirp/test/opts_fs_sync.js +++ /dev/null @@ -1,27 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var test = require('tap').test; -var mockfs = require('mock-fs'); -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('opts.fs sync', function (t) { - t.plan(4); - - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/beep/boop/' + [x,y,z].join('/'); - var xfs = mockfs.fs(); - - mkdirp.sync(file, { fs: xfs, mode: _0755 }); - xfs.exists(file, function (ex) { - t.ok(ex, 'created file'); - xfs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }); -}); diff --git a/node_modules/mkdirp/test/perm.js b/node_modules/mkdirp/test/perm.js deleted file mode 100644 index fbce44b82..000000000 --- a/node_modules/mkdirp/test/perm.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('async perm', function (t) { - t.plan(5); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); - - mkdirp(file, _0755, function (err) { - t.ifError(err); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }) - }) - }); -}); - -test('async root perm', function (t) { - mkdirp('/tmp', _0755, function (err) { - if (err) t.fail(err); - t.end(); - }); - t.end(); -}); diff --git a/node_modules/mkdirp/test/perm_sync.js b/node_modules/mkdirp/test/perm_sync.js deleted file mode 100644 index 398229fe5..000000000 --- a/node_modules/mkdirp/test/perm_sync.js +++ /dev/null @@ -1,36 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('sync perm', function (t) { - t.plan(4); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; - - mkdirp.sync(file, _0755); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }); -}); - -test('sync root perm', function (t) { - t.plan(3); - - var file = '/tmp'; - mkdirp.sync(file, _0755); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.ok(stat.isDirectory(), 'target not a directory'); - }) - }); -}); diff --git a/node_modules/mkdirp/test/race.js b/node_modules/mkdirp/test/race.js deleted file mode 100644 index b0b9e183c..000000000 --- a/node_modules/mkdirp/test/race.js +++ /dev/null @@ -1,37 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('race', function (t) { - t.plan(10); - var ps = [ '', 'tmp' ]; - - for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); - } - var file = ps.join('/'); - - var res = 2; - mk(file); - - mk(file); - - function mk (file, cb) { - mkdirp(file, _0755, function (err) { - t.ifError(err); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }) - }); - } -}); diff --git a/node_modules/mkdirp/test/rel.js b/node_modules/mkdirp/test/rel.js deleted file mode 100644 index 4ddb34276..000000000 --- a/node_modules/mkdirp/test/rel.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('rel', function (t) { - t.plan(5); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var cwd = process.cwd(); - process.chdir('/tmp'); - - var file = [x,y,z].join('/'); - - mkdirp(file, _0755, function (err) { - t.ifError(err); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - process.chdir(cwd); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }) - }) - }); -}); diff --git a/node_modules/mkdirp/test/return.js b/node_modules/mkdirp/test/return.js deleted file mode 100644 index bce68e561..000000000 --- a/node_modules/mkdirp/test/return.js +++ /dev/null @@ -1,25 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(4); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, '/tmp/' + x); - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, null); - }); - }); -}); diff --git a/node_modules/mkdirp/test/return_sync.js b/node_modules/mkdirp/test/return_sync.js deleted file mode 100644 index 7c222d355..000000000 --- a/node_modules/mkdirp/test/return_sync.js +++ /dev/null @@ -1,24 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - // Note that this will throw on failure, which will fail the test. - var made = mkdirp.sync(file); - t.equal(made, '/tmp/' + x); - - // making the same file again should have no effect. - made = mkdirp.sync(file); - t.equal(made, null); -}); diff --git a/node_modules/mkdirp/test/root.js b/node_modules/mkdirp/test/root.js deleted file mode 100644 index 9e7d079d9..000000000 --- a/node_modules/mkdirp/test/root.js +++ /dev/null @@ -1,19 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; -var _0755 = parseInt('0755', 8); - -test('root', function (t) { - // '/' on unix, 'c:/' on windows. - var file = path.resolve('/'); - - mkdirp(file, _0755, function (err) { - if (err) throw err - fs.stat(file, function (er, stat) { - if (er) throw er - t.ok(stat.isDirectory(), 'target is a directory'); - t.end(); - }) - }); -}); diff --git a/node_modules/mkdirp/test/sync.js b/node_modules/mkdirp/test/sync.js deleted file mode 100644 index 8c8dc938c..000000000 --- a/node_modules/mkdirp/test/sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('sync', function (t) { - t.plan(4); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file, _0755); - } catch (err) { - t.fail(err); - return t.end(); - } - - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }); -}); diff --git a/node_modules/mkdirp/test/umask.js b/node_modules/mkdirp/test/umask.js deleted file mode 100644 index 2033c63a4..000000000 --- a/node_modules/mkdirp/test/umask.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('implicit mode from umask', function (t) { - t.plan(5); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, function (err) { - t.ifError(err); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0777 & (~process.umask())); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }) - }); -}); diff --git a/node_modules/mkdirp/test/umask_sync.js b/node_modules/mkdirp/test/umask_sync.js deleted file mode 100644 index 11a761474..000000000 --- a/node_modules/mkdirp/test/umask_sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('umask sync modes', function (t) { - t.plan(4); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file); - } catch (err) { - t.fail(err); - return t.end(); - } - - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, (_0777 & (~process.umask()))); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }); -}); diff --git a/node_modules/module-deps/.travis.yml b/node_modules/module-deps/.travis.yml deleted file mode 100644 index a459790bd..000000000 --- a/node_modules/module-deps/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: node_js -node_js: - - "9" - - "8" - - "6" - - "4" - - "iojs" - - "0.12" - - "0.10" - - "0.8" -sudo: false -before_install: - # Old npm certs are untrusted https://github.com/npm/npm/issues/20191 - - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.8" ]; then export NPM_CONFIG_STRICT_SSL=false; fi' - - 'nvm install-latest-npm' -matrix: - fast_finish: true diff --git a/node_modules/module-deps/CHANGELOG.md b/node_modules/module-deps/CHANGELOG.md deleted file mode 100644 index 6db38834e..000000000 --- a/node_modules/module-deps/CHANGELOG.md +++ /dev/null @@ -1,26 +0,0 @@ -# module-deps Change Log -All notable changes to this project will be documented in this file. -This project adheres to [Semantic Versioning](http://semver.org/). - -## 6.1.0 - 2018-05-16 -* Add a `detect` option for custom dependency detection [#63](https://github.com/browserify/module-deps/pull/63), [2dcc339](https://github.com/browserify/module-deps/commit/2dcc3399ee67ba51ed26d9a0605a8ccdc70c9db7) - -## 6.0.2 - 2018-03-28 -* Fix missing 'file' event when file has a syntax error [#146](https://github.com/browserify/module-deps/pull/146) - -## 6.0.1 - 2018-03-27 -* Fix crash when file has a transform and a syntax error [#145](https://github.com/browserify/module-deps/pull/145) - -## 6.0.0 - 2018-02-07 -* Ignore package.json files that do not contain JSON objects [#142](https://github.com/browserify/module-deps/pull/142) -* Don't preserve symlinks when resolving transforms, matching Node resolution behaviour [#133](https://github.com/browserify/module-deps/pull/133) -* Fix 'file' events with `persistentCache` [#127](https://github.com/browserify/module-deps/pull/127) -* Add dependencies to a file when transforms emit 'dep' event [#141](https://github.com/browserify/module-deps/pull/141) - -## 5.0.1 - 2018-01-06 -* Restore support for node < 4.0.0. - -## 5.0.0 - 2018-01-02 -* Update deps -* Drop support for node < 0.12 due due to detective dropping support -* Add engines field set to `>=4.0.0` diff --git a/node_modules/module-deps/LICENSE b/node_modules/module-deps/LICENSE deleted file mode 100644 index ee27ba4b4..000000000 --- a/node_modules/module-deps/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/module-deps/bin/cmd.js b/node_modules/module-deps/bin/cmd.js deleted file mode 100755 index c776ed7f1..000000000 --- a/node_modules/module-deps/bin/cmd.js +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env node -var mdeps = require('../'); -var subarg = require('subarg'); -var fs = require('fs'); -var path = require('path'); - -var argv = subarg(process.argv.slice(2), { - alias: { h: 'help', t: 'transform', g: 'globalTransform' } -}); -if (argv.help) return usage(0); - -var JSONStream = require('JSONStream'); - -var files = argv._.map(function (file) { - if (file === '-') return process.stdin; - return path.resolve(file); -}); -var md = mdeps(argv); -md.pipe(JSONStream.stringify()).pipe(process.stdout); - -files.forEach(function (file) { md.write(file) }); -md.end(); - -function usage (code) { - var r = fs.createReadStream(__dirname + '/usage.txt'); - r.pipe(process.stdout); - if (code) r.on('end', function () { process.exit(code) }); -} diff --git a/node_modules/module-deps/bin/usage.txt b/node_modules/module-deps/bin/usage.txt deleted file mode 100644 index 8bbcbab24..000000000 --- a/node_modules/module-deps/bin/usage.txt +++ /dev/null @@ -1,9 +0,0 @@ -module-deps [FILES] OPTIONS - - Generate json output for the entry point FILES. - -OPTIONS are: - - -t TRANSFORM Apply a TRANSFORM. - -g TRANSFORM Apply a global TRANSFORM. - diff --git a/node_modules/module-deps/example/deps.js b/node_modules/module-deps/example/deps.js deleted file mode 100644 index 437c5e1a3..000000000 --- a/node_modules/module-deps/example/deps.js +++ /dev/null @@ -1,6 +0,0 @@ -var mdeps = require('../'); -var JSONStream = require('JSONStream'); - -var md = mdeps(); -md.pipe(JSONStream.stringify()).pipe(process.stdout); -md.end({ file: __dirname + '/files/main.js' }); diff --git a/node_modules/module-deps/example/files/bar.js b/node_modules/module-deps/example/files/bar.js deleted file mode 100644 index c57fa530a..000000000 --- a/node_modules/module-deps/example/files/bar.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function (n) { - return n * 100; -}; diff --git a/node_modules/module-deps/example/files/foo.js b/node_modules/module-deps/example/files/foo.js deleted file mode 100644 index c62e63856..000000000 --- a/node_modules/module-deps/example/files/foo.js +++ /dev/null @@ -1,5 +0,0 @@ -var bar = require('./bar'); - -module.exports = function (n) { - return n * 111 + bar(n); -}; diff --git a/node_modules/module-deps/example/files/main.js b/node_modules/module-deps/example/files/main.js deleted file mode 100644 index 8c71d7997..000000000 --- a/node_modules/module-deps/example/files/main.js +++ /dev/null @@ -1,2 +0,0 @@ -var foo = require('./foo'); -console.log('main: ' + foo(5)); diff --git a/node_modules/module-deps/example/files/xyz.js b/node_modules/module-deps/example/files/xyz.js deleted file mode 100644 index dff6877a8..000000000 --- a/node_modules/module-deps/example/files/xyz.js +++ /dev/null @@ -1,2 +0,0 @@ -var foo = require('./foo'); -console.log('xyz: ' + foo(6)); diff --git a/node_modules/module-deps/index.js b/node_modules/module-deps/index.js deleted file mode 100644 index ac455c48f..000000000 --- a/node_modules/module-deps/index.js +++ /dev/null @@ -1,625 +0,0 @@ -var fs = require('fs'); -var path = require('path'); -var relativePath = require('cached-path-relative'); - -var browserResolve = require('browser-resolve'); -var nodeResolve = require('resolve'); -var detective = require('detective'); -var through = require('through2'); -var concat = require('concat-stream'); -var parents = require('parents'); -var combine = require('stream-combiner2'); -var duplexer = require('duplexer2'); -var xtend = require('xtend'); -var defined = require('defined'); - -var inherits = require('inherits'); -var Transform = require('readable-stream').Transform; - -module.exports = Deps; -inherits(Deps, Transform); - -function Deps (opts) { - var self = this; - if (!(this instanceof Deps)) return new Deps(opts); - Transform.call(this, { objectMode: true }); - - if (!opts) opts = {}; - - this.basedir = opts.basedir || process.cwd(); - this.persistentCache = opts.persistentCache || function (file, id, pkg, fallback, cb) { - process.nextTick(function () { - fallback(null, cb); - }); - }; - this.cache = opts.cache; - this.fileCache = opts.fileCache; - this.pkgCache = opts.packageCache || {}; - this.pkgFileCache = {}; - this.pkgFileCachePending = {}; - this._emittedPkg = {}; - this._transformDeps = {}; - this.visited = {}; - this.walking = {}; - this.entries = []; - this._input = []; - - this.paths = opts.paths || process.env.NODE_PATH || ''; - if (typeof this.paths === 'string') { - var delimiter = path.delimiter || (process.platform === 'win32' ? ';' : ':'); - this.paths = this.paths.split(delimiter); - } - this.paths = this.paths - .filter(Boolean) - .map(function (p) { - return path.resolve(self.basedir, p); - }); - - this.transforms = [].concat(opts.transform).filter(Boolean); - this.globalTransforms = [].concat(opts.globalTransform).filter(Boolean); - this.resolver = opts.resolve || browserResolve; - this.detective = opts.detect || detective; - this.options = xtend(opts); - if (!this.options.modules) this.options.modules = {}; - - // If the caller passes options.expose, store resolved pathnames for exposed - // modules in it. If not, set it anyway so it's defined later. - if (!this.options.expose) this.options.expose = {}; - this.pending = 0; - this.inputPending = 0; - - var topfile = path.join(this.basedir, '__fake.js'); - this.top = { - id: topfile, - filename: topfile, - paths: this.paths, - basedir: this.basedir - }; -} - -Deps.prototype._isTopLevel = function (file) { - var isTopLevel = this.entries.some(function (main) { - var m = relativePath(path.dirname(main), file); - return m.split(/[\\\/]/).indexOf('node_modules') < 0; - }); - if (!isTopLevel) { - var m = relativePath(this.basedir, file); - isTopLevel = m.split(/[\\\/]/).indexOf('node_modules') < 0; - } - return isTopLevel; -}; - -Deps.prototype._transform = function (row, enc, next) { - var self = this; - if (typeof row === 'string') { - row = { file: row }; - } - if (row.transform && row.global) { - this.globalTransforms.push([ row.transform, row.options ]); - return next(); - } - else if (row.transform) { - this.transforms.push([ row.transform, row.options ]); - return next(); - } - - self.pending ++; - var basedir = defined(row.basedir, self.basedir); - - if (row.entry !== false) { - self.entries.push(path.resolve(basedir, row.file || row.id)); - } - - self.lookupPackage(row.file, function (err, pkg) { - if (err && self.options.ignoreMissing) { - self.emit('missing', row.file, self.top); - self.pending --; - return next(); - } - if (err) return self.emit('error', err) - self.pending --; - self._input.push({ row: row, pkg: pkg }); - next(); - }); -}; - -Deps.prototype._flush = function () { - var self = this; - var files = {}; - self._input.forEach(function (r) { - var w = r.row, f = files[w.file || w.id]; - if (f) { - f.row.entry = f.row.entry || w.entry; - var ex = f.row.expose || w.expose; - f.row.expose = ex; - if (ex && f.row.file === f.row.id && w.file !== w.id) { - f.row.id = w.id; - } - } - else files[w.file || w.id] = r; - }); - - Object.keys(files).forEach(function (key) { - var r = files[key]; - var pkg = r.pkg || {}; - var dir = r.row.file ? path.dirname(r.row.file) : self.basedir; - if (!pkg.__dirname) pkg.__dirname = dir; - self.walk(r.row, xtend(self.top, { - filename: path.join(dir, '_fake.js') - })); - }); - if (this.pending === 0) this.push(null); - this._ended = true; -}; - -Deps.prototype.resolve = function (id, parent, cb) { - var self = this; - var opts = self.options; - - if (xhas(self.cache, parent.id, 'deps', id) - && self.cache[parent.id].deps[id]) { - var file = self.cache[parent.id].deps[id]; - var pkg = self.pkgCache[file]; - if (pkg) return cb(null, file, pkg); - return self.lookupPackage(file, function (err, pkg) { - cb(null, file, pkg); - }); - } - - parent.packageFilter = function (p, x) { - var pkgdir = path.dirname(x); - if (opts.packageFilter) p = opts.packageFilter(p, x); - p.__dirname = pkgdir; - - return p; - }; - - if (opts.extensions) parent.extensions = opts.extensions; - if (opts.modules) parent.modules = opts.modules; - - self.resolver(id, parent, function onresolve (err, file, pkg, fakePath) { - if (err) return cb(err); - if (!file) return cb(new Error( - 'module not found: "' + id + '" from file ' - + parent.filename - )); - - if (!pkg || !pkg.__dirname) { - self.lookupPackage(file, function (err, p) { - if (err) return cb(err); - if (!p) p = {}; - if (!p.__dirname) p.__dirname = path.dirname(file); - self.pkgCache[file] = p; - onresolve(err, file, opts.packageFilter - ? opts.packageFilter(p, p.__dirname) : p, - fakePath - ); - }); - } - else cb(err, file, pkg, fakePath); - }); -}; - -Deps.prototype.readFile = function (file, id, pkg) { - var self = this; - if (xhas(this.fileCache, file)) { - return toStream(this.fileCache[file]); - } - var rs = fs.createReadStream(file, { - encoding: 'utf8' - }); - return rs; -}; - -Deps.prototype.getTransforms = function (file, pkg, opts) { - if (!opts) opts = {}; - var self = this; - - var isTopLevel; - if (opts.builtin || opts.inNodeModules) isTopLevel = false; - else isTopLevel = this._isTopLevel(file); - - var transforms = [].concat(isTopLevel ? this.transforms : []) - .concat(getTransforms(pkg, { - globalTransform: this.globalTransforms, - transformKey: this.options.transformKey - })) - ; - if (transforms.length === 0) return through(); - - var pending = transforms.length; - var streams = []; - var input = through(); - var output = through(); - var dup = duplexer(input, output); - - for (var i = 0; i < transforms.length; i++) (function (i) { - makeTransform(transforms[i], function (err, trs) { - if (err) { - return dup.emit('error', err); - } - streams[i] = trs; - if (-- pending === 0) done(); - }); - })(i); - return dup; - - function done () { - var middle = combine.apply(null, streams); - middle.on('error', function (err) { - err.message += ' while parsing file: ' + file; - if (!err.filename) err.filename = file; - dup.emit('error', err); - }); - input.pipe(middle).pipe(output); - } - - function makeTransform (tr, cb) { - var trOpts = {}; - if (Array.isArray(tr)) { - trOpts = tr[1] || {}; - tr = tr[0]; - } - trOpts._flags = trOpts.hasOwnProperty('_flags') ? trOpts._flags : self.options; - if (typeof tr === 'function') { - var t = tr(file, trOpts); - // allow transforms to `stream.emit('dep', path)` to add dependencies for this file - t.on('dep', function (dep) { - if (!self._transformDeps[file]) self._transformDeps[file] = []; - self._transformDeps[file].push(dep); - }); - self.emit('transform', t, file); - nextTick(cb, null, wrapTransform(t)); - } - else { - loadTransform(tr, trOpts, function (err, trs) { - if (err) return cb(err); - cb(null, wrapTransform(trs)); - }); - } - } - - function loadTransform (id, trOpts, cb) { - var params = { - basedir: path.dirname(file), - preserveSymlinks: false - }; - nodeResolve(id, params, function nr (err, res, again) { - if (err && again) return cb && cb(err); - - if (err) { - params.basedir = pkg.__dirname; - return nodeResolve(id, params, function (e, r) { - nr(e, r, true); - }); - } - - if (!res) return cb(new Error( - 'cannot find transform module ' + tr - + ' while transforming ' + file - )); - - var r = require(res); - if (typeof r !== 'function') { - return cb(new Error( - 'Unexpected ' + typeof r + ' exported by the ' - + JSON.stringify(res) + ' package. ' - + 'Expected a transform function.' - )); - } - - var trs = r(file, trOpts); - // allow transforms to `stream.emit('dep', path)` to add dependencies for this file - trs.on('dep', function (dep) { - if (!self._transformDeps[file]) self._transformDeps[file] = []; - self._transformDeps[file].push(dep); - }); - self.emit('transform', trs, file); - cb(null, trs); - }); - } -}; - -Deps.prototype.walk = function (id, parent, cb) { - var self = this; - var opts = self.options; - this.pending ++; - - var rec = {}; - var input; - if (typeof id === 'object') { - rec = xtend(id); - if (rec.entry === false) delete rec.entry; - id = rec.file || rec.id; - input = true; - this.inputPending ++; - } - - self.resolve(id, parent, function (err, file, pkg, fakePath) { - // this is checked early because parent.modules is also modified - // by this function. - var builtin = has(parent.modules, id); - - if (rec.expose) { - // Set options.expose to make the resolved pathname available to the - // caller. They may or may not have requested it, but it's harmless - // to set this if they didn't. - self.options.expose[rec.expose] = - self.options.modules[rec.expose] = file; - } - if (pkg && !self._emittedPkg[pkg.__dirname]) { - self._emittedPkg[pkg.__dirname] = true; - self.emit('package', pkg); - } - - if (opts.postFilter && !opts.postFilter(id, file, pkg)) { - if (--self.pending === 0) self.push(null); - if (input) --self.inputPending; - return cb && cb(null, undefined); - } - if (err && rec.source) { - file = rec.file; - - var ts = self.getTransforms(file, pkg); - ts.on('error', function (err) { - self.emit('error', err); - }); - ts.pipe(concat(function (body) { - rec.source = body.toString('utf8'); - fromSource(file, rec.source, pkg); - })); - return ts.end(rec.source); - } - if (err && self.options.ignoreMissing) { - if (--self.pending === 0) self.push(null); - if (input) --self.inputPending; - self.emit('missing', id, parent); - return cb && cb(null, undefined); - } - if (err) return self.emit('error', err); - if (self.visited[file]) { - if (-- self.pending === 0) self.push(null); - if (input) --self.inputPending; - return cb && cb(null, file); - } - self.visited[file] = true; - - if (rec.source) { - var ts = self.getTransforms(file, pkg); - ts.on('error', function (err) { - self.emit('error', err); - }); - ts.pipe(concat(function (body) { - rec.source = body.toString('utf8'); - fromSource(file, rec.source, pkg); - })); - return ts.end(rec.source); - } - - var c = self.cache && self.cache[file]; - if (c) return fromDeps(file, c.source, c.package, fakePath, Object.keys(c.deps)); - - self.persistentCache(file, id, pkg, persistentCacheFallback, function (err, c) { - self.emit('file', file, id); - if (err) { - self.emit('error', err); - return; - } - fromDeps(file, c.source, c.package, fakePath, Object.keys(c.deps)); - }); - - function persistentCacheFallback (dataAsString, cb) { - var stream = dataAsString ? toStream(dataAsString) : self.readFile(file, id, pkg).on('error', cb); - stream - .pipe(self.getTransforms(fakePath || file, pkg, { - builtin: builtin, - inNodeModules: parent.inNodeModules - })) - .on('error', cb) - .pipe(concat(function (body) { - var src = body.toString('utf8'); - try { var deps = getDeps(file, src); } - catch (err) { cb(err); } - if (deps) { - cb(null, { - source: src, - package: pkg, - deps: deps.reduce(function (deps, dep) { - deps[dep] = true; - return deps; - }, {}) - }); - } - })); - } - }); - - function getDeps (file, src) { - var deps = rec.noparse ? [] : self.parseDeps(file, src); - // dependencies emitted by transforms - if (self._transformDeps[file]) deps = deps.concat(self._transformDeps[file]); - return deps; - } - - function fromSource (file, src, pkg, fakePath) { - var deps = getDeps(file, src); - if (deps) fromDeps(file, src, pkg, fakePath, deps); - } - - function fromDeps (file, src, pkg, fakePath, deps) { - var p = deps.length; - var resolved = {}; - - if (input) --self.inputPending; - - (function resolve () { - if (self.inputPending > 0) return setTimeout(resolve); - deps.forEach(function (id) { - if (opts.filter && !opts.filter(id)) { - resolved[id] = false; - if (--p === 0) done(); - return; - } - var isTopLevel = self._isTopLevel(fakePath || file); - var current = { - id: file, - filename: file, - paths: self.paths, - package: pkg, - inNodeModules: parent.inNodeModules || !isTopLevel - }; - self.walk(id, current, function (err, r) { - resolved[id] = r; - if (--p === 0) done(); - }); - }); - if (deps.length === 0) done(); - })(); - - function done () { - if (!rec.id) rec.id = file; - if (!rec.source) rec.source = src; - if (!rec.deps) rec.deps = resolved; - if (!rec.file) rec.file = file; - - if (self.entries.indexOf(file) >= 0) { - rec.entry = true; - } - self.push(rec); - - if (cb) cb(null, file); - if (-- self.pending === 0) self.push(null); - } - } -}; - -Deps.prototype.parseDeps = function (file, src, cb) { - var self = this; - if (this.options.noParse === true) return []; - if (/\.json$/.test(file)) return []; - - if (Array.isArray(this.options.noParse) - && this.options.noParse.indexOf(file) >= 0) { - return []; - } - - try { var deps = self.detective(src) } - catch (ex) { - var message = ex && ex.message ? ex.message : ex; - throw new Error( - 'Parsing file ' + file + ': ' + message - ); - } - return deps; -}; - -Deps.prototype.lookupPackage = function (file, cb) { - var self = this; - - var cached = this.pkgCache[file]; - if (cached) return nextTick(cb, null, cached); - if (cached === false) return nextTick(cb, null, undefined); - - var dirs = parents(file ? path.dirname(file) : self.basedir); - - (function next () { - if (dirs.length === 0) { - self.pkgCache[file] = false; - return cb(null, undefined); - } - var dir = dirs.shift(); - if (dir.split(/[\\\/]/).slice(-1)[0] === 'node_modules') { - return cb(null, undefined); - } - - var pkgfile = path.join(dir, 'package.json'); - - var cached = self.pkgCache[pkgfile]; - if (cached) return nextTick(cb, null, cached); - else if (cached === false) return next(); - - var pcached = self.pkgFileCachePending[pkgfile]; - if (pcached) return pcached.push(onpkg); - pcached = self.pkgFileCachePending[pkgfile] = []; - - fs.readFile(pkgfile, function (err, src) { - if (err) return onpkg(); - try { var pkg = JSON.parse(src) } - catch (err) { - return onpkg(new Error([ - err + ' while parsing json file ' + pkgfile - ].join(''))); - } - pkg.__dirname = dir; - - self.pkgCache[pkgfile] = pkg; - self.pkgCache[file] = pkg; - onpkg(null, pkg); - }); - - function onpkg (err, pkg) { - if (self.pkgFileCachePending[pkgfile]) { - var fns = self.pkgFileCachePending[pkgfile]; - delete self.pkgFileCachePending[pkgfile]; - fns.forEach(function (f) { f(err, pkg) }); - } - if (err) cb(err); - else if (pkg && typeof pkg === 'object') cb(null, pkg); - else { - self.pkgCache[pkgfile] = false; - next(); - } - } - })(); -}; - -function getTransforms (pkg, opts) { - var trx = []; - if (opts.transformKey) { - var n = pkg; - var keys = opts.transformKey; - for (var i = 0; i < keys.length; i++) { - if (n && typeof n === 'object') n = n[keys[i]]; - else break; - } - if (i === keys.length) { - trx = [].concat(n).filter(Boolean); - } - } - return trx.concat(opts.globalTransform || []); -} - -function nextTick (cb) { - var args = [].slice.call(arguments, 1); - process.nextTick(function () { cb.apply(null, args) }); -} - -function xhas (obj) { - if (!obj) return false; - for (var i = 1; i < arguments.length; i++) { - var key = arguments[i]; - if (!has(obj, key)) return false; - obj = obj[key]; - } - return true; -} - -function toStream (dataAsString) { - var tr = through(); - tr.push(dataAsString); - tr.push(null); - return tr; -} - -function has (obj, key) { - return obj && Object.prototype.hasOwnProperty.call(obj, key); -} - -function wrapTransform (tr) { - if (typeof tr.read === 'function') return tr; - var input = through(), output = through(); - input.pipe(tr).pipe(output); - var wrapper = duplexer(input, output); - tr.on('error', function (err) { wrapper.emit('error', err) }); - return wrapper; -} diff --git a/node_modules/module-deps/package.json b/node_modules/module-deps/package.json deleted file mode 100644 index 6bc7e1fc0..000000000 --- a/node_modules/module-deps/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "_from": "module-deps@^6.0.0", - "_id": "module-deps@6.1.0", - "_inBundle": false, - "_integrity": "sha512-NPs5N511VD1rrVJihSso/LiBShRbJALYBKzDW91uZYy7BpjnO4bGnZL3HjZ9yKcFdZUWwaYjDz9zxbuP7vKMuQ==", - "_location": "/module-deps", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "module-deps@^6.0.0", - "name": "module-deps", - "escapedName": "module-deps", - "rawSpec": "^6.0.0", - "saveSpec": null, - "fetchSpec": "^6.0.0" - }, - "_requiredBy": [ - "/browserify" - ], - "_resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.1.0.tgz", - "_shasum": "d1e1efc481c6886269f7112c52c3236188e16479", - "_spec": "module-deps@^6.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bin": { - "module-deps": "bin/cmd.js" - }, - "bugs": { - "url": "https://github.com/browserify/module-deps/issues" - }, - "bundleDependencies": false, - "dependencies": { - "JSONStream": "^1.0.3", - "browser-resolve": "^1.7.0", - "cached-path-relative": "^1.0.0", - "concat-stream": "~1.6.0", - "defined": "^1.0.0", - "detective": "^5.0.2", - "duplexer2": "^0.1.2", - "inherits": "^2.0.1", - "parents": "^1.0.0", - "readable-stream": "^2.0.2", - "resolve": "^1.4.0", - "stream-combiner2": "^1.1.1", - "subarg": "^1.0.0", - "through2": "^2.0.0", - "xtend": "^4.0.0" - }, - "deprecated": false, - "description": "walk the dependency graph to generate json output that can be fed into browser-pack", - "devDependencies": { - "browser-pack": "^6.0.2", - "tap": "^1.0.0" - }, - "engines": { - "node": ">= 0.8.0" - }, - "homepage": "https://github.com/browserify/module-deps", - "keywords": [ - "dependency", - "graph", - "browser", - "require", - "module", - "exports", - "json" - ], - "license": "MIT", - "main": "index.js", - "name": "module-deps", - "repository": { - "type": "git", - "url": "git://github.com/browserify/module-deps.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "6.1.0" -} diff --git a/node_modules/module-deps/readme.markdown b/node_modules/module-deps/readme.markdown deleted file mode 100644 index e7805e0ce..000000000 --- a/node_modules/module-deps/readme.markdown +++ /dev/null @@ -1,312 +0,0 @@ -# module-deps - -walk the dependency graph to generate json output that can be fed into -[browser-pack](https://github.com/browserify/browser-pack) - -[![build status](https://secure.travis-ci.org/browserify/module-deps.png)](http://travis-ci.org/browserify/module-deps) - -# example - -``` js -var mdeps = require('module-deps'); -var JSONStream = require('JSONStream'); - -var md = mdeps(); -md.pipe(JSONStream.stringify()).pipe(process.stdout); -md.end({ file: __dirname + '/files/main.js' }); -``` - -output: - -```json -$ node example/deps.js -[ -{"id":"/home/substack/projects/module-deps/example/files/main.js","source":"var foo = require('./foo');\nconsole.log('main: ' + foo(5));\n","entry":true,"deps":{"./foo":"/home/substack/projects/module-deps/example/files/foo.js"}} -, -{"id":"/home/substack/projects/module-deps/example/files/foo.js","source":"var bar = require('./bar');\n\nmodule.exports = function (n) {\n return n * 111 + bar(n);\n};\n","deps":{"./bar":"/home/substack/projects/module-deps/example/files/bar.js"}} -, -{"id":"/home/substack/projects/module-deps/example/files/bar.js","source":"module.exports = function (n) {\n return n * 100;\n};\n","deps":{}} -] -``` - -and you can feed this json data into -[browser-pack](https://github.com/browserify/browser-pack): - -```bash -$ node example/deps.js | browser-pack | node -main: 1055 -``` - -# usage - -``` -usage: module-deps [files] - - generate json output from each entry file - -``` - -# methods - -``` js -var mdeps = require('module-deps') -``` - -## var d = mdeps(opts={}) - -Return an object transform stream `d` that expects entry filenames or -`{ id: ..., file: ... }` objects as input and produces objects for every -dependency from a recursive module traversal as output. - -Each file in `files` can be a string filename or a stream. - -Optionally pass in some `opts`: - -* `opts.transform` - a string or array of string transforms (see below) - -* `opts.transformKey` - an array path of strings showing where to look in the -package.json for source transformations. If falsy, don't look at the -package.json at all. - -* `opts.resolve` - custom resolve function using the -`opts.resolve(id, parent, cb)` signature that -[browser-resolve](https://github.com/shtylman/node-browser-resolve) has - -* `opts.detect` - a custom dependency detection function. `opts.detect(source)` -should return an array of dependency module names. By default -[detective](https://github.com/browserify/detective) is used. - -* `opts.filter` - a function (id) to skip resolution of some module `id` strings. -If defined, `opts.filter(id)` should return truthy for all the ids to include -and falsey for all the ids to skip. - -* `opts.postFilter` - a function (id, file, pkg) that gets called after `id` has -been resolved. Return false to skip this file. - -* `opts.packageFilter` - transform the parsed package.json contents before using -the values. `opts.packageFilter(pkg, dir)` should return the new `pkg` object to -use. - -* `opts.noParse` - an array of absolute paths to not parse for dependencies. Use -this for large dependencies like jquery or threejs which take forever to parse. - -* `opts.cache` - an object mapping filenames to file objects to skip costly io - -* `opts.packageCache` - an object mapping filenames to their parent package.json -contents for browser fields, main entries, and transforms - -* `opts.fileCache` - an object mapping filenames to raw source to avoid reading -from disk. - -* `opts.persistentCache` - a complex cache handler that allows async and persistent - caching of data. A `persistentCache` needs to follow this interface: - ```js - function persistentCache ( - file, // the path to the file that is loaded - id, // the id that is used to reference this file - pkg, // the package that this file belongs to fallback - fallback, // async fallback handler to be called if the cache doesn't hold the given file - cb // callback handler that receives the cache data - ) { - if (hasError()) { - return cb(error) // Pass any error to the callback - } - - var fileData = fs.readFileSync(file) - var key = keyFromFile(file, fileData) - - if (db.has(key)) { - return cb(null, { - source: db.get(key).toString(), - package: pkg, // The package for housekeeping - deps: { - 'id': // id that is used to reference a required file - 'file' // file path to the required file - } - }) - } - // - // The fallback will process the file in case the file is not - // in cache. - // - // Note that if your implementation doesn't need the file data - // then you can pass `null` instead of the source and the fallback will - // fetch the data by itself. - // - fallback(fileData, function (error, cacheableEntry) { - if (error) { - return cb(error) - } - db.addToCache(key, cacheableEntry) - cb(null, cacheableEntry) - }) - } - ``` - -* `opts.paths` - array of global paths to search. Defaults to splitting on `':'` -in `process.env.NODE_PATH` - -* `opts.ignoreMissing` - ignore files that failed to resolve - -# input objects - -Input objects should be string filenames or objects with these parameters: - -* `row.file` - filename -* `row.entry` - whether to treat this file as an entry point, defaults to - `true`. Set to `false` to include this file, but not run it automatically. -* `row.expose` - name to be exposed as -* `row.noparse` - when true, don't parse the file contents for dependencies - -or objects can specify transforms: - -* `row.transform` - string name, path, or function -* `row.options` - transform options as an object -* `row.global` - boolean, whether the transform is global - -# output objects - -Output objects describe files with dependencies. They have these properties: - -* `row.id` - an identifier for the file, used in the `row.deps` prperty -* `row.file` - path to the source file -* `row.entry` - true if the file is an entry point -* `row.expose` - name to be exposed as -* `row.source` - source file content as a string -* `row.deps` - object describing dependencies. The keys are strings as used - in `require()` calls in the file, and values are the row IDs (file paths) - of dependencies. - -# events - -## d.on('transform', function (tr, file) {}) - -Every time a transform is applied to a `file`, a `'transform'` event fires with -the instantiated transform stream `tr`. - -## d.on('file', function (file) {}) - -Every time a file is read, this event fires with the file path. - -## d.on('missing', function (id, parent) {}) - -When `opts.ignoreMissing` is enabled, this event fires for each missing package. - -## d.on('package', function (pkg) {}) - -Every time a package is read, this event fires. The directory name of the -package is available in `pkg.__dirname`. - -# transforms - -module-deps can be configured to run source transformations on files before -parsing them for `require()` calls. These transforms are useful if you want to -compile a language like [coffeescript](http://coffeescript.org/) on the fly or -if you want to load static assets into your bundle by parsing the AST for -`fs.readFileSync()` calls. - -If the transform is a function, it should take the `file` name as an argument -and return a through stream that will be written file contents and should output -the new transformed file contents. - -If the transform is a string, it is treated as a module name that will resolve -to a module that is expected to follow this format: - -``` js -var through = require('through2'); -module.exports = function (file, opts) { return through() }; -``` - -You don't necessarily need to use the -[through2](https://github.com/rvagg/through2) module to create a -readable/writable filter stream for transforming file contents, but this is an -easy way to do it. - -module-deps looks for `require()` calls and adds their arguments as dependencies -of a file. Transform streams can emit `'dep'` events to include additional -dependencies that are not consumed with `require()`. - -When you call `mdeps()` with an `opts.transform`, the transformations you -specify will not be run for any files in node_modules/. This is because modules -you include should be self-contained and not need to worry about guarding -themselves against transformations that may happen upstream. - -Modules can apply their own transformations by setting a transformation pipeline -in their package.json at the `opts.transformKey` path. These transformations -only apply to the files directly in the module itself, not to the module's -dependants nor to its dependencies. - -## package.json transformKey - -Transform keys live at a configurable location in the package.json denoted by -the `opts.transformKey` array. - -For a transformKey of `['foo','bar']`, the transformKey can be a single string -(`"fff"`): - -``` json -{ - "foo": { - "bar": "fff" - } -} -``` - -or an array of strings (`["fff","ggg"]`): - -``` json -{ - "foo": { - "bar": ["fff","ggg"] - } -} -``` - -If you want to pass options to the transforms, you can use a 2-element array -inside of the primary array. Here `fff` gets an options object with `{"x":3}` -and `ggg` gets `{"y":4}`: - -``` json -{ - "foo": { - "bar": [["fff",{"x":3}],["ggg",{"y":4}]] - } -} -``` - -Options sent to the module-deps constructor are also provided under -`opts._flags`. These options are sometimes required if your transform -needs to do something different when browserify is run in debug mode, for -example. - -# usage - -``` -module-deps [FILES] OPTIONS - - Generate json output for the entry point FILES. - -OPTIONS are: - - -t TRANSFORM Apply a TRANSFORM. - -g TRANSFORM Apply a global TRANSFORM. - -``` - -# install - -With [npm](http://npmjs.org), to get the module do: - -``` -npm install module-deps -``` - -and to get the `module-deps` command do: - -``` -npm install -g module-deps -``` - -# license - -MIT diff --git a/node_modules/module-deps/test/bundle.js b/node_modules/module-deps/test/bundle.js deleted file mode 100644 index adf12efe4..000000000 --- a/node_modules/module-deps/test/bundle.js +++ /dev/null @@ -1,23 +0,0 @@ -var parser = require('../'); -var test = require('tap').test; -var JSONStream = require('JSONStream'); -var packer = require('browser-pack'); -var path = require('path'); - -test('bundle', function (t) { - t.plan(1); - var p = parser(); - p.end(path.join(__dirname, '/files/main.js')); - p.on('error', t.fail.bind(t)); - var pack = packer(); - - p.pipe(JSONStream.stringify()).pipe(pack); - - var src = ''; - pack.on('data', function (buf) { src += buf }); - pack.on('end', function () { - Function('console', src)({ - log: function (s) { t.equal(s, 'main: 1055') } - }); - }); -}); diff --git a/node_modules/module-deps/test/cache.js b/node_modules/module-deps/test/cache.js deleted file mode 100644 index 95c8afb5b..000000000 --- a/node_modules/module-deps/test/cache.js +++ /dev/null @@ -1,50 +0,0 @@ -var parser = require('../'); -var test = require('tap').test; -var path = require('path'); - -var files = { - foo: path.join(__dirname, '/files/foo.js'), - bar: path.join(__dirname, '/files/bar.js') -}; - -var sources = { - foo: 'notreal foo', - bar: 'notreal bar' -}; - -var cache = {}; -cache[files.foo] = { - source: sources.foo, - deps: { './bar': files.bar } -}; -cache[files.bar] = { - source: sources.bar, - deps: {} -}; - -test('uses cache', function (t) { - t.plan(1); - var p = parser({ cache: cache }); - p.end({ id: 'foo', file: files.foo, entry: false }); - - var rows = []; - p.on('data', function (row) { rows.push(row) }); - p.on('end', function () { - t.same(rows.sort(cmp), [ - { - id: 'foo', - file: files.foo, - source: sources.foo, - deps: { './bar': files.bar } - }, - { - id: files.bar, - file: files.bar, - source: sources.bar, - deps: {} - } - ].sort(cmp)); - }); -}); - -function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/cache_expose.js b/node_modules/module-deps/test/cache_expose.js deleted file mode 100644 index d52dc69fc..000000000 --- a/node_modules/module-deps/test/cache_expose.js +++ /dev/null @@ -1,54 +0,0 @@ -var parser = require('../'); -var test = require('tap').test; -var path = require('path'); - -var files = { - foo: path.join(__dirname, '/files/foo.js'), - bar: path.join(__dirname, '/files/bar.js') -}; - -var sources = { - foo: 'notreal foo', - bar: 'notreal bar' -}; - -var cache = {}; -cache[files.foo] = { - source: sources.foo, - deps: { './bar': files.bar } -}; -cache[files.bar] = { - source: sources.bar, - deps: {} -}; - -test('cache preserves expose and entry', function (t) { - t.plan(1); - var p = parser({ cache: cache }); - p.write({ id: files.bar, expose: 'bar2', entry: false }); - p.end({ id: 'foo', file: files.foo, entry: true, expose: 'foo2' }); - - var rows = []; - p.on('data', function (row) { rows.push(row) }); - p.on('end', function () { - t.same(rows.sort(cmp), [ - { - id: 'foo', - expose: 'foo2', - entry: true, - file: files.foo, - source: sources.foo, - deps: { './bar': files.bar } - }, - { - id: files.bar, - expose: 'bar2', - file: files.bar, - source: sources.bar, - deps: {} - } - ].sort(cmp)); - }); -}); - -function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/cache_partial.js b/node_modules/module-deps/test/cache_partial.js deleted file mode 100644 index ca98c119f..000000000 --- a/node_modules/module-deps/test/cache_partial.js +++ /dev/null @@ -1,47 +0,0 @@ -var parser = require('../'); -var test = require('tap').test; -var fs = require('fs'); -var path = require('path'); - -var files = { - foo: path.join(__dirname, '/files/foo.js'), - bar: path.join(__dirname, '/files/bar.js') -}; - -var sources = { - foo: 'notreal foo', - bar: fs.readFileSync(files.bar, 'utf8') -}; - -var cache = {}; -cache[files.foo] = { - source: sources.foo, - deps: { './bar': files.bar } -}; - -test('uses cache and reads from disk', function (t) { - t.plan(1); - var p = parser({ cache: cache }); - p.end({ id: 'foo', file: files.foo, entry: false }); - - var rows = []; - p.on('data', function (row) { rows.push(row) }); - p.on('end', function () { - t.same(rows.sort(cmp), [ - { - id: 'foo', - file: files.foo, - source: sources.foo, - deps: { './bar': files.bar } - }, - { - id: files.bar, - file: files.bar, - source: sources.bar, - deps: {} - } - ].sort(cmp)); - }); -}); - -function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/cache_partial_expose.js b/node_modules/module-deps/test/cache_partial_expose.js deleted file mode 100644 index 1d5280b5b..000000000 --- a/node_modules/module-deps/test/cache_partial_expose.js +++ /dev/null @@ -1,104 +0,0 @@ -var parser = require('../'); -var test = require('tap').test; -var fs = require('fs'); -var path = require('path'); -var xtend = require('xtend'); - -var files = { - abc: path.join(__dirname, '/expose/lib/abc.js'), - xyz: path.join(__dirname, '/expose/lib/xyz.js'), - foo: path.join(__dirname, '/expose/foo.js'), - bar: path.join(__dirname, '/expose/bar.js'), - main: path.join(__dirname, '/expose/main.js') -}; - -var sources = Object.keys(files).reduce(function (acc, file) { - acc[file] = fs.readFileSync(files[file], 'utf8'); - return acc; -}, {}); - -var cache = {}; -cache[files.abc] = { - source: sources.abc, - deps: {} -}; -cache[files.xyz] = { - source: sources.xyz, - deps: {'../foo': files.foo} -}; -cache[files.foo] = { - source: sources.foo, - deps: {'./lib/abc': files.abc} -}; -cache[files.bar] = { - source: sources.bar, - deps: {xyz: files.xyz} -}; -cache[files.main] = { - source: sources.main, - deps: { - abc: files.abc, - xyz: files.xyz, - './bar': files.bar - } -}; - -test('preserves expose and entry with partial cache', function(t) { - t.plan(1); - - var partialCache = xtend(cache); - delete partialCache[files.bar]; - - var p = parser({ cache: partialCache }); - p.write({ id: 'abc', file: files.abc, expose: 'abc' }); - p.write({ id: 'xyz', file: files.xyz, expose: 'xyz' }); - p.end({ id: 'main', file: files.main, entry: true }); - - var rows = []; - p.on('data', function (row) { rows.push(row); }); - p.on('end', function () { - t.same(rows.sort(cmp), [ - { - id: files.bar, - file: files.bar, - source: sources.bar, - deps: {xyz: files.xyz} - }, - { - file: files.foo, - id: files.foo, - source: sources.foo, - deps: {'./lib/abc': files.abc} - }, - { - id: 'abc', - file: files.abc, - source: sources.abc, - deps: {}, - entry: true, - expose: 'abc' - }, - { - id: 'main', - file: files.main, - source: sources.main, - deps: { - './bar': files.bar, - abc: files.abc, - xyz: files.xyz - }, - entry: true - }, - { - id: 'xyz', - file: files.xyz, - source: sources.xyz, - deps: {'../foo': files.foo}, - entry: true, - expose: 'xyz' - } - ].sort(cmp)); - }); -}); - -function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/cache_persistent.js b/node_modules/module-deps/test/cache_persistent.js deleted file mode 100644 index 13c827ee7..000000000 --- a/node_modules/module-deps/test/cache_persistent.js +++ /dev/null @@ -1,122 +0,0 @@ -var parser = require('../'); -var test = require('tap').test; -var path = require('path'); -var fs = require('fs'); - -var files = { - foo: path.join(__dirname, '/files/foo.js'), - bar: path.join(__dirname, '/files/bar.js') -}; - -test('uses persistent cache', function (t) { - t.plan(1); - var p = parser({ - persistentCache: function (file, id, pkg, fallback, cb) { - if (file === files.bar) { - return fallback(null, cb); - } - cb(null, { - source: 'file at ' + file + '@' + id, - package: pkg, - deps: { './bar': files.bar } - }); - } - }); - p.end({ id: 'foo', file: files.foo, entry: false }); - - var rows = []; - p.on('data', function (row) { rows.push(row) }); - p.on('end', function () { - t.same(rows.sort(cmp), [ - { - id: files.bar, - file: files.bar, - source: fs.readFileSync(files.bar, 'utf8'), - deps: {} - }, - { - id: 'foo', - file: files.foo, - source: 'file at ' + files.foo + '@' + files.foo, - deps: { './bar': files.bar } - } - ].sort(cmp)); - }); -}); - -test('passes persistent cache error through', function (t) { - t.plan(1); - var p = parser({ - persistentCache: function (file, id, pkg, fallback, cb) { - cb(new Error('foo')); - } - }); - p.end({ id: 'foo', file: files.foo, entry: false }); - p.on('error', function (err) { t.equals(err.message, 'foo') }); -}); - -test('allow passing of the raw source as string', function (t) { - t.plan(1); - var p = parser({ - persistentCache: function (file, id, pkg, fallback, cb) { - fallback(fs.readFileSync(files.bar, 'utf8'), cb); - } - }); - p.end({ id: 'foo', file: files.foo, entry: false }); - - var rows = []; - p.on('data', function (row) { rows.push(row) }); - p.on('end', function () { - t.same(rows.sort(cmp), [ - { - id: 'foo', - file: files.foo, - source: fs.readFileSync(files.bar, 'utf8'), - deps: {} - } - ].sort(cmp)); - }); -}); - -test('send file event with persistent cache', function (t) { - t.plan(2); - var p = parser({ - persistentCache: function (file, id, pkg, fallback, cb) { - cb(null, { - source: 'file at ' + file + '@' + id, - package: pkg, - deps: {} - }); - } - }); - p.end({ id: 'foo', file: files.foo, entry: false }); - p.on('file', function (file, id) { - t.same(file, path.resolve(files.foo)); - t.same(id, path.resolve(files.foo)); - }); -}); - -test('errors of transforms occur in the correct order with a persistent cache', function (t) { - t.plan(3); - var p = parser({ - transform: [ - path.join(__dirname, 'cache_persistent', 'error_transform') - ], - persistentCache: function (file, id, pkg, fallback, cb) { - fallback(fs.readFileSync(files.foo, 'utf8'), cb); - } - }); - p.end({ id: 'foo', file: files.foo, entry: false }); - var order = 0; - p.on('file', function (file, id) { - t.same(order, 0); - order += 1; - }); - p.on('error', function (err) { - t.same(order, 1); - t.same(err.message, 'rawr while parsing file: ' + path.resolve(files.foo)); - }); -}); - - -function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/cache_persistent/error_transform.js b/node_modules/module-deps/test/cache_persistent/error_transform.js deleted file mode 100644 index 0cfddab56..000000000 --- a/node_modules/module-deps/test/cache_persistent/error_transform.js +++ /dev/null @@ -1,6 +0,0 @@ -var through = require('through2'); -module.exports = function (file) { - return through(function (chunk, enc, callback) { - callback(new Error('rawr')); - }); -}; diff --git a/node_modules/module-deps/test/cycle.js b/node_modules/module-deps/test/cycle.js deleted file mode 100644 index e2e3e9e5f..000000000 --- a/node_modules/module-deps/test/cycle.js +++ /dev/null @@ -1,19 +0,0 @@ -var mdeps = require('../'); -var test = require('tap').test; -var JSONStream = require('JSONStream'); -var packer = require('browser-pack'); -var concat = require('concat-stream'); -var path = require('path'); - -test('cycle', function (t) { - t.plan(1); - var p = mdeps(); - p.end(path.join(__dirname, '/cycle/main.js')); - var pack = packer(); - - p.pipe(JSONStream.stringify()).pipe(pack).pipe(concat(function (src) { - Function('console', src.toString('utf8'))({ - log: function (msg) { t.equal(msg, 333) } - }); - })); -}); diff --git a/node_modules/module-deps/test/cycle/bar.js b/node_modules/module-deps/test/cycle/bar.js deleted file mode 100644 index c78d1a5f2..000000000 --- a/node_modules/module-deps/test/cycle/bar.js +++ /dev/null @@ -1,3 +0,0 @@ -var foo = require('./foo.js'); - -module.exports = function (n) { return foo.p(n, 1) }; diff --git a/node_modules/module-deps/test/cycle/foo.js b/node_modules/module-deps/test/cycle/foo.js deleted file mode 100644 index 174496878..000000000 --- a/node_modules/module-deps/test/cycle/foo.js +++ /dev/null @@ -1,4 +0,0 @@ -var bar = require('./bar.js'); - -exports.ooo = function (n) { return n * bar(110) }; -exports.p = function (a, b) { return a + b } diff --git a/node_modules/module-deps/test/cycle/main.js b/node_modules/module-deps/test/cycle/main.js deleted file mode 100644 index 6601355f4..000000000 --- a/node_modules/module-deps/test/cycle/main.js +++ /dev/null @@ -1,4 +0,0 @@ -var foo = require('./foo.js'); -var bar = require('./bar.js'); - -console.log(foo.ooo(bar(2))); diff --git a/node_modules/module-deps/test/deps.js b/node_modules/module-deps/test/deps.js deleted file mode 100644 index f269bc769..000000000 --- a/node_modules/module-deps/test/deps.js +++ /dev/null @@ -1,49 +0,0 @@ -var parser = require('../'); -var test = require('tap').test; -var fs = require('fs'); -var path = require('path'); - -var files = { - main: path.join(__dirname, '/files/main.js'), - foo: path.join(__dirname, '/files/foo.js'), - bar: path.join(__dirname, '/files/bar.js') -}; - -var sources = Object.keys(files).reduce(function (acc, file) { - acc[file] = fs.readFileSync(files[file], 'utf8'); - return acc; -}, {}); - -test('deps', function (t) { - t.plan(1); - var p = parser(); - p.end({ file: files.main, entry: true }); - - var rows = []; - p.on('data', function (row) { rows.push(row) }); - p.on('end', function () { - t.same(rows.sort(cmp), [ - { - id: files.main, - file: files.main, - source: sources.main, - entry: true, - deps: { './foo': files.foo } - }, - { - id: files.foo, - file: files.foo, - source: sources.foo, - deps: { './bar': files.bar } - }, - { - id: files.bar, - file: files.bar, - source: sources.bar, - deps: {} - } - ].sort(cmp)); - }); -}); - -function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/detect.js b/node_modules/module-deps/test/detect.js deleted file mode 100644 index a5544590e..000000000 --- a/node_modules/module-deps/test/detect.js +++ /dev/null @@ -1,32 +0,0 @@ -var parser = require('../'); -var test = require('tap').test; -var JSONStream = require('JSONStream'); -var packer = require('browser-pack'); -var path = require('path'); - -test('detect', function (t) { - t.plan(1); - var p = parser({ - detect: function (source) { - var rx = /require\(["'](.*?)["']\)/g; - var m, deps = []; - while (m = rx.exec(source)) { - deps.push(m[1]); - } - return deps; - } - }); - p.end(path.join(__dirname, '/files/main.js')); - p.on('error', t.fail.bind(t)); - var pack = packer(); - - p.pipe(JSONStream.stringify()).pipe(pack); - - var src = ''; - pack.on('data', function (buf) { src += buf }); - pack.on('end', function () { - Function('console', src)({ - log: function (s) { t.equal(s, 'main: 1055') } - }); - }); -}); diff --git a/node_modules/module-deps/test/dotdot.js b/node_modules/module-deps/test/dotdot.js deleted file mode 100644 index d5f5fdde6..000000000 --- a/node_modules/module-deps/test/dotdot.js +++ /dev/null @@ -1,20 +0,0 @@ -var mdeps = require('../'); -var test = require('tap').test; -var through = require('through2'); -var path = require('path'); - -test('dotdot', function (t) { - var expected = [ - path.join(__dirname, '/dotdot/index.js'), - path.join(__dirname, '/dotdot/abc/index.js') - ]; - t.plan(expected.length); - - var d = mdeps(); - d.end(path.join(__dirname, '/dotdot/abc/index.js')); - - d.pipe(through.obj(function (row, enc, next) { - t.deepEqual(row.file, expected.shift()); - next(); - })); -}); diff --git a/node_modules/module-deps/test/dotdot/abc/index.js b/node_modules/module-deps/test/dotdot/abc/index.js deleted file mode 100644 index 67f2534eb..000000000 --- a/node_modules/module-deps/test/dotdot/abc/index.js +++ /dev/null @@ -1,2 +0,0 @@ -var x = require('..'); -console.log(x); diff --git a/node_modules/module-deps/test/dotdot/index.js b/node_modules/module-deps/test/dotdot/index.js deleted file mode 100644 index afec73603..000000000 --- a/node_modules/module-deps/test/dotdot/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'whatever' diff --git a/node_modules/module-deps/test/expose.js b/node_modules/module-deps/test/expose.js deleted file mode 100644 index 947e79845..000000000 --- a/node_modules/module-deps/test/expose.js +++ /dev/null @@ -1,41 +0,0 @@ -var parser = require('../'); -var test = require('tap').test; -var fs = require('fs'); -var path = require('path'); - -var files = { - foo: path.join(__dirname, '/files/foo.js'), - bar: path.join(__dirname, '/files/bar.js') -}; - -var sources = Object.keys(files).reduce(function (acc, file) { - acc[file] = fs.readFileSync(files[file], 'utf8'); - return acc; -}, {}); - -test('single id export', function (t) { - t.plan(1); - var p = parser(); - p.end({ id: 'foo', file: files.foo, entry: false }); - - var rows = []; - p.on('data', function (row) { rows.push(row) }); - p.on('end', function () { - t.same(rows.sort(cmp), [ - { - id: 'foo', - file: files.foo, - source: sources.foo, - deps: { './bar': files.bar } - }, - { - id: files.bar, - file: files.bar, - source: sources.bar, - deps: {} - } - ].sort(cmp)); - }); -}); - -function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/expose/bar.js b/node_modules/module-deps/test/expose/bar.js deleted file mode 100644 index 31559ceef..000000000 --- a/node_modules/module-deps/test/expose/bar.js +++ /dev/null @@ -1 +0,0 @@ -require('xyz'); diff --git a/node_modules/module-deps/test/expose/foo.js b/node_modules/module-deps/test/expose/foo.js deleted file mode 100644 index aa7d3b95a..000000000 --- a/node_modules/module-deps/test/expose/foo.js +++ /dev/null @@ -1 +0,0 @@ -require('./lib/abc'); diff --git a/node_modules/module-deps/test/expose/lib/abc.js b/node_modules/module-deps/test/expose/lib/abc.js deleted file mode 100644 index d13b53674..000000000 --- a/node_modules/module-deps/test/expose/lib/abc.js +++ /dev/null @@ -1 +0,0 @@ -console.log('abc'); diff --git a/node_modules/module-deps/test/expose/lib/xyz.js b/node_modules/module-deps/test/expose/lib/xyz.js deleted file mode 100644 index a44c530b0..000000000 --- a/node_modules/module-deps/test/expose/lib/xyz.js +++ /dev/null @@ -1,2 +0,0 @@ -require('../foo'); -console.log('xyz'); diff --git a/node_modules/module-deps/test/expose/main.js b/node_modules/module-deps/test/expose/main.js deleted file mode 100644 index 00c0e24fc..000000000 --- a/node_modules/module-deps/test/expose/main.js +++ /dev/null @@ -1,3 +0,0 @@ -require('abc'); -require('xyz'); -require('./bar'); diff --git a/node_modules/module-deps/test/file_cache.js b/node_modules/module-deps/test/file_cache.js deleted file mode 100644 index 0a03c8774..000000000 --- a/node_modules/module-deps/test/file_cache.js +++ /dev/null @@ -1,58 +0,0 @@ -var mdeps = require('../'); -var test = require('tap').test; -var path = require('path'); -var through = require('through2'); - -var files = { - foo: path.join(__dirname, '/files/foo.js'), - bar: path.join(__dirname, '/files/bar.js') -}; - -var sources = { - foo: 'require("./bar"); var tongs;', - bar: 'notreal tongs' -}; - -var fileCache = {}; -fileCache[files.foo] = sources.foo; -fileCache[files.bar] = sources.bar; - -var specialReplace = function(input) { - return input.replace(/tongs/g, 'tangs'); -}; - -test('uses file cache', function (t) { - t.plan(1); - var p = mdeps({ - fileCache: fileCache, - transform: function (file) { - return through(function (buf, enc, next) { - this.push(specialReplace(String(buf))); - next(); - }); - }, - transformKey: [ 'browserify', 'transform' ] - }); - p.end({ id: 'foo', file: files.foo, entry: false }); - - var rows = []; - p.on('data', function (row) { rows.push(row) }); - p.on('end', function () { - t.same(rows.sort(cmp), [ - { - id: 'foo', - file: files.foo, - source: specialReplace(sources.foo), - deps: { './bar': files.bar } - }, - { - id: files.bar, - file: files.bar, - source: specialReplace(sources.bar), - deps: {} - } - ].sort(cmp)); - }); -}); - -function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/files/bar.js b/node_modules/module-deps/test/files/bar.js deleted file mode 100644 index c57fa530a..000000000 --- a/node_modules/module-deps/test/files/bar.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function (n) { - return n * 100; -}; diff --git a/node_modules/module-deps/test/files/extra.js b/node_modules/module-deps/test/files/extra.js deleted file mode 100644 index 3e842e734..000000000 --- a/node_modules/module-deps/test/files/extra.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 555 diff --git a/node_modules/module-deps/test/files/filterable.js b/node_modules/module-deps/test/files/filterable.js deleted file mode 100644 index 9374ed272..000000000 --- a/node_modules/module-deps/test/files/filterable.js +++ /dev/null @@ -1,10 +0,0 @@ - -module.exports = { - events: require('events'), - fs : require('fs'), - net : require('net'), - http : require('http'), - https : require('https'), - dgram : require('dgram'), - dns : require('dns') -} diff --git a/node_modules/module-deps/test/files/foo.js b/node_modules/module-deps/test/files/foo.js deleted file mode 100644 index c62e63856..000000000 --- a/node_modules/module-deps/test/files/foo.js +++ /dev/null @@ -1,5 +0,0 @@ -var bar = require('./bar'); - -module.exports = function (n) { - return n * 111 + bar(n); -}; diff --git a/node_modules/module-deps/test/files/main.js b/node_modules/module-deps/test/files/main.js deleted file mode 100644 index 8c71d7997..000000000 --- a/node_modules/module-deps/test/files/main.js +++ /dev/null @@ -1,2 +0,0 @@ -var foo = require('./foo'); -console.log('main: ' + foo(5)); diff --git a/node_modules/module-deps/test/files/pkg_filter/one.js b/node_modules/module-deps/test/files/pkg_filter/one.js deleted file mode 100644 index e8f7328d6..000000000 --- a/node_modules/module-deps/test/files/pkg_filter/one.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 1 diff --git a/node_modules/module-deps/test/files/pkg_filter/package.json b/node_modules/module-deps/test/files/pkg_filter/package.json deleted file mode 100644 index 0b4f872fc..000000000 --- a/node_modules/module-deps/test/files/pkg_filter/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "one.js" -} diff --git a/node_modules/module-deps/test/files/pkg_filter/test.js b/node_modules/module-deps/test/files/pkg_filter/test.js deleted file mode 100644 index 87697b9d3..000000000 --- a/node_modules/module-deps/test/files/pkg_filter/test.js +++ /dev/null @@ -1 +0,0 @@ -t.equal(require('./'), 2); diff --git a/node_modules/module-deps/test/files/pkg_filter/two.js b/node_modules/module-deps/test/files/pkg_filter/two.js deleted file mode 100644 index 4afe2eded..000000000 --- a/node_modules/module-deps/test/files/pkg_filter/two.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 2 diff --git a/node_modules/module-deps/test/files/quotes/bar.js b/node_modules/module-deps/test/files/quotes/bar.js deleted file mode 100644 index 52b5cbb33..000000000 --- a/node_modules/module-deps/test/files/quotes/bar.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'success'; diff --git a/node_modules/module-deps/test/files/quotes/baz.js b/node_modules/module-deps/test/files/quotes/baz.js deleted file mode 100644 index 52b5cbb33..000000000 --- a/node_modules/module-deps/test/files/quotes/baz.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'success'; diff --git a/node_modules/module-deps/test/files/quotes/foo.js b/node_modules/module-deps/test/files/quotes/foo.js deleted file mode 100644 index 52b5cbb33..000000000 --- a/node_modules/module-deps/test/files/quotes/foo.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'success'; diff --git a/node_modules/module-deps/test/files/quotes/main.js b/node_modules/module-deps/test/files/quotes/main.js deleted file mode 100644 index 8e459175d..000000000 --- a/node_modules/module-deps/test/files/quotes/main.js +++ /dev/null @@ -1,3 +0,0 @@ -var foo = require('./foo'); -var bar = require("./bar"); -var baz = require(`./baz`); diff --git a/node_modules/module-deps/test/files/syntax_error.js b/node_modules/module-deps/test/files/syntax_error.js deleted file mode 100644 index d2c024ec6..000000000 --- a/node_modules/module-deps/test/files/syntax_error.js +++ /dev/null @@ -1,2 +0,0 @@ -const a = require('a'); -const a = 0; diff --git a/node_modules/module-deps/test/files/tr_2dep_module/f.js b/node_modules/module-deps/test/files/tr_2dep_module/f.js deleted file mode 100644 index 39c9ea4be..000000000 --- a/node_modules/module-deps/test/files/tr_2dep_module/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = function (x) { return x + BBB } diff --git a/node_modules/module-deps/test/files/tr_2dep_module/main.js b/node_modules/module-deps/test/files/tr_2dep_module/main.js deleted file mode 100644 index b7d22ab6f..000000000 --- a/node_modules/module-deps/test/files/tr_2dep_module/main.js +++ /dev/null @@ -1,7 +0,0 @@ -var f = require('./f.js'); -var m = require('m'); -var g = require('g'); - -t.equal(m(f(AAA)), 777, 'transformation scope'); -t.equal(g(3), 333, 'sub-transformation applied'); -t.equal(typeof GGG, 'undefined', 'GGG leak'); diff --git a/node_modules/module-deps/test/files/tr_global/main.js b/node_modules/module-deps/test/files/tr_global/main.js deleted file mode 100644 index 493931839..000000000 --- a/node_modules/module-deps/test/files/tr_global/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log(AAA + BBB + CCC + DDD + EEE + FFF); diff --git a/node_modules/module-deps/test/files/tr_global/package.json b/node_modules/module-deps/test/files/tr_global/package.json deleted file mode 100644 index 08b4f7136..000000000 --- a/node_modules/module-deps/test/files/tr_global/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browserify": { - "transform": [ "tr-a", "tr-b" ] - } -} diff --git a/node_modules/module-deps/test/files/tr_module/f.js b/node_modules/module-deps/test/files/tr_module/f.js deleted file mode 100644 index 39c9ea4be..000000000 --- a/node_modules/module-deps/test/files/tr_module/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = function (x) { return x + BBB } diff --git a/node_modules/module-deps/test/files/tr_module/index.js b/node_modules/module-deps/test/files/tr_module/index.js deleted file mode 100644 index b61f675e6..000000000 --- a/node_modules/module-deps/test/files/tr_module/index.js +++ /dev/null @@ -1,8 +0,0 @@ -var through = require('through2'); - -module.exports = function (file) { - return through(function (buf, enc, next) { - this.push(String(buf).replace(/XXX/g, '123')); - next(); - }); -}; diff --git a/node_modules/module-deps/test/files/tr_module/main.js b/node_modules/module-deps/test/files/tr_module/main.js deleted file mode 100644 index 19775fb66..000000000 --- a/node_modules/module-deps/test/files/tr_module/main.js +++ /dev/null @@ -1,8 +0,0 @@ -var f = require('./f.js'); -var m = require('m'); -var g = require('g'); - -t.equal(m(f(AAA)), 555, 'transformation scope'); -t.equal(g(3), 333, 'sub-transformation applied'); -t.equal(typeof GGG, 'undefined', 'GGG leak'); -t.equal(XXX, 123, 'XXX'); diff --git a/node_modules/module-deps/test/files/tr_module/package.json b/node_modules/module-deps/test/files/tr_module/package.json deleted file mode 100644 index efba40639..000000000 --- a/node_modules/module-deps/test/files/tr_module/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browserify": { - "transform": [ "./xxx.js" ] - } -} diff --git a/node_modules/module-deps/test/files/tr_module/xxx.js b/node_modules/module-deps/test/files/tr_module/xxx.js deleted file mode 100644 index b61f675e6..000000000 --- a/node_modules/module-deps/test/files/tr_module/xxx.js +++ /dev/null @@ -1,8 +0,0 @@ -var through = require('through2'); - -module.exports = function (file) { - return through(function (buf, enc, next) { - this.push(String(buf).replace(/XXX/g, '123')); - next(); - }); -}; diff --git a/node_modules/module-deps/test/files/tr_no_entry/main.js b/node_modules/module-deps/test/files/tr_no_entry/main.js deleted file mode 100644 index 4f1d73371..000000000 --- a/node_modules/module-deps/test/files/tr_no_entry/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log(AAA) diff --git a/node_modules/module-deps/test/files/tr_rel/package.json b/node_modules/module-deps/test/files/tr_rel/package.json deleted file mode 100644 index efba40639..000000000 --- a/node_modules/module-deps/test/files/tr_rel/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "browserify": { - "transform": [ "./xxx.js" ] - } -} diff --git a/node_modules/module-deps/test/files/tr_rel/subdir/main.js b/node_modules/module-deps/test/files/tr_rel/subdir/main.js deleted file mode 100644 index f03552207..000000000 --- a/node_modules/module-deps/test/files/tr_rel/subdir/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log(XXX * 3) diff --git a/node_modules/module-deps/test/files/tr_rel/xxx.js b/node_modules/module-deps/test/files/tr_rel/xxx.js deleted file mode 100644 index f8b47b11d..000000000 --- a/node_modules/module-deps/test/files/tr_rel/xxx.js +++ /dev/null @@ -1,8 +0,0 @@ -var through = require('through2'); - -module.exports = function (file) { - return through(function (buf, enc, next) { - this.push(String(buf).replace(/XXX/g, '111')); - next(); - }); -}; diff --git a/node_modules/module-deps/test/files/tr_sh/f.js b/node_modules/module-deps/test/files/tr_sh/f.js deleted file mode 100644 index 39c9ea4be..000000000 --- a/node_modules/module-deps/test/files/tr_sh/f.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = function (x) { return x + BBB } diff --git a/node_modules/module-deps/test/files/tr_sh/main.js b/node_modules/module-deps/test/files/tr_sh/main.js deleted file mode 100644 index 084b20e04..000000000 --- a/node_modules/module-deps/test/files/tr_sh/main.js +++ /dev/null @@ -1,7 +0,0 @@ -var f = require('./f.js'); -var m = require('m'); -var g = require('g'); - -t.equal(m(f(AAA)), 555, 'transformation scope'); -t.equal(g(3), 333, 'sub-transformation applied'); -t.equal(typeof GGG, 'undefined', 'GGG leak'); diff --git a/node_modules/module-deps/test/files/tr_sh/tr_a.js b/node_modules/module-deps/test/files/tr_sh/tr_a.js deleted file mode 100644 index 397adcb6b..000000000 --- a/node_modules/module-deps/test/files/tr_sh/tr_a.js +++ /dev/null @@ -1,7 +0,0 @@ -var through = require('through2'); -module.exports = function (file) { - return through(function (buf, enc, next) { - this.push(String(buf).replace(/AAA/g, '5')); - next(); - }); -}; diff --git a/node_modules/module-deps/test/files/tr_sh/tr_b.js b/node_modules/module-deps/test/files/tr_sh/tr_b.js deleted file mode 100644 index 6dfcb4efc..000000000 --- a/node_modules/module-deps/test/files/tr_sh/tr_b.js +++ /dev/null @@ -1,7 +0,0 @@ -var through = require('through2'); -module.exports = function (file) { - return through(function (buf, enc, next) { - this.push(String(buf).replace(/BBB/g, '50')); - next(); - }); -}; diff --git a/node_modules/module-deps/test/files/tr_whole_package/f.js b/node_modules/module-deps/test/files/tr_whole_package/f.js deleted file mode 100644 index 39d983d5c..000000000 --- a/node_modules/module-deps/test/files/tr_whole_package/f.js +++ /dev/null @@ -1,3 +0,0 @@ -var calc = require('algo').calc; - -module.exports = function (x) { return calc(x); } diff --git a/node_modules/module-deps/test/files/tr_whole_package/main.js b/node_modules/module-deps/test/files/tr_whole_package/main.js deleted file mode 100644 index 5b61c2414..000000000 --- a/node_modules/module-deps/test/files/tr_whole_package/main.js +++ /dev/null @@ -1,3 +0,0 @@ -var f = require('./f.js'); - -t.equal(f(14), 11, 'transformation scope'); diff --git a/node_modules/module-deps/test/files/transformdeps.js b/node_modules/module-deps/test/files/transformdeps.js deleted file mode 100644 index 0f1253062..000000000 --- a/node_modules/module-deps/test/files/transformdeps.js +++ /dev/null @@ -1 +0,0 @@ -// dependencies added by transform diff --git a/node_modules/module-deps/test/files/unicode/bar.js b/node_modules/module-deps/test/files/unicode/bar.js deleted file mode 100644 index 7ebb0ae44..000000000 --- a/node_modules/module-deps/test/files/unicode/bar.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function (ñ) { - return ñ * 100; -}; diff --git a/node_modules/module-deps/test/files/unicode/foo.js b/node_modules/module-deps/test/files/unicode/foo.js deleted file mode 100644 index 6541c71ab..000000000 --- a/node_modules/module-deps/test/files/unicode/foo.js +++ /dev/null @@ -1,5 +0,0 @@ -var é = require('./bar'); - -module.exports = function (ñ) { - return ñ * 111 + é(n); -}; diff --git a/node_modules/module-deps/test/files/unicode/main.js b/node_modules/module-deps/test/files/unicode/main.js deleted file mode 100644 index bb2095eb8..000000000 --- a/node_modules/module-deps/test/files/unicode/main.js +++ /dev/null @@ -1,2 +0,0 @@ -var π = require('./foo'); -console.log('main: ' + foo(5)); diff --git a/node_modules/module-deps/test/files/xyz.js b/node_modules/module-deps/test/files/xyz.js deleted file mode 100644 index dff6877a8..000000000 --- a/node_modules/module-deps/test/files/xyz.js +++ /dev/null @@ -1,2 +0,0 @@ -var foo = require('./foo'); -console.log('xyz: ' + foo(6)); diff --git a/node_modules/module-deps/test/filter.js b/node_modules/module-deps/test/filter.js deleted file mode 100644 index f66c12e24..000000000 --- a/node_modules/module-deps/test/filter.js +++ /dev/null @@ -1,36 +0,0 @@ -var test = require('tap').test; -var path = require('path') -var mdeps = require('../') - -var core = ['events', 'util', 'dns', 'dgram', 'http', 'https', 'net', 'fs'] - -var collect = [] - -var entry = path.join(__dirname, 'files', 'filterable.js') - -test('can filter core deps', function (t) { - var p = mdeps({ - filter: function (e) { - return !~core.indexOf(e) - } - }) - p.on('data', function (d) { - collect.push(d) - t.equal(d.id, entry) - t.deepEqual(d.deps, { - events: false, - fs: false, - net: false, - http: false, - https: false, - dgram: false, - dns: false - }) - t.equal(d.entry, true) - }); - p.on('end', function () { - t.equal(collect.length, 1) - t.end() - }); - p.end(entry); -}) diff --git a/node_modules/module-deps/test/ignore_missing.js b/node_modules/module-deps/test/ignore_missing.js deleted file mode 100644 index a86845756..000000000 --- a/node_modules/module-deps/test/ignore_missing.js +++ /dev/null @@ -1,60 +0,0 @@ -var parser = require('../'); -var test = require('tap').test; -var fs = require('fs'); -var path = require('path'); - -var files = { - main: path.join(__dirname, '/ignore_missing/main.js'), - other: path.join(__dirname, '/ignore_missing/other.js') -}; - -var sources = Object.keys(files).reduce(function (acc, file) { - acc[file] = fs.readFileSync(files[file], 'utf8'); - return acc; -}, {}); - -test('ignoreMissing', function (t) { - t.plan(1); - var p = parser({ignoreMissing: true}); - p.end({file: files.main, entry: true}); - - var rows = []; - p.on('data', function (row) { rows.push(row) }); - p.on('end', function () { - t.same(rows.sort(cmp), [ - { - id: files.main, - file: files.main, - source: sources.main, - entry: true, - deps: { './other': files.other } - }, - { - id: files.other, - file: files.other, - source: sources.other, - deps: { 'missingModule': undefined } - } - ].sort(cmp)); - }); -}); - -test('ignoreMissing off', function (t) { - t.plan(1); - var p = parser(); - p.end({file: files.main, entry: true}); - - var rows = []; - p.on('data', function (row) { rows.push(row) }); - p.on('error', function (err) { - t.match( - String(err), - /Cannot find module 'missingModule'/ - ); - }); - p.on('end', function () { - t.fail('should have errored'); - }); -}); - -function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/ignore_missing/main.js b/node_modules/module-deps/test/ignore_missing/main.js deleted file mode 100644 index 709d2dba6..000000000 --- a/node_modules/module-deps/test/ignore_missing/main.js +++ /dev/null @@ -1 +0,0 @@ -require('./other'); diff --git a/node_modules/module-deps/test/ignore_missing/other.js b/node_modules/module-deps/test/ignore_missing/other.js deleted file mode 100644 index d173b34d2..000000000 --- a/node_modules/module-deps/test/ignore_missing/other.js +++ /dev/null @@ -1 +0,0 @@ -require('missingModule'); diff --git a/node_modules/module-deps/test/ignore_missing_cache.js b/node_modules/module-deps/test/ignore_missing_cache.js deleted file mode 100644 index 715201518..000000000 --- a/node_modules/module-deps/test/ignore_missing_cache.js +++ /dev/null @@ -1,52 +0,0 @@ -var parser = require('../'); -var test = require('tap').test; -var fs = require('fs'); -var path = require('path'); - -var files = { - main: path.join(__dirname, '/ignore_missing/main.js'), - other: path.join(__dirname, '/ignore_missing/other.js') -}; - -var sources = Object.keys(files).reduce(function (acc, file) { - acc[file] = fs.readFileSync(files[file], 'utf8'); - return acc; -}, {}); - -var cache = {}; -cache[files.main] = { - source: sources.main, - deps: { './other': files.other } -}; -cache[files.other] = { - source: sources.other, - deps: { 'missingModule': undefined } -}; - -test('ignoreMissing with cache', function (t) { - t.plan(1); - var p = parser({ cache: cache, ignoreMissing: true }); - p.end({file: files.main, entry: true}); - - var rows = []; - p.on('data', function (row) { rows.push(row) }); - p.on('end', function () { - t.same(rows.sort(cmp), [ - { - id: files.main, - file: files.main, - source: sources.main, - entry: true, - deps: { './other': files.other } - }, - { - id: files.other, - file: files.other, - source: sources.other, - deps: { 'missingModule': undefined } - } - ].sort(cmp)); - }); -}); - -function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/invalid_pkg.js b/node_modules/module-deps/test/invalid_pkg.js deleted file mode 100644 index 943563286..000000000 --- a/node_modules/module-deps/test/invalid_pkg.js +++ /dev/null @@ -1,16 +0,0 @@ -var mdeps = require('../'); -var test = require('tap').test; -var path = require('path'); -var fs = require('fs'); - -test('invalid pkg', function (t) { - var d = mdeps(); - d.on('package', function (pkg_) { -// console.error({pkg_}); - }); - d.end(path.join(__dirname, '/invalid_pkg/file.js')); - d.on('data', function () {}); - d.on('end', function () { - t.end(); - }); -}); diff --git a/node_modules/module-deps/test/invalid_pkg/file.js b/node_modules/module-deps/test/invalid_pkg/file.js deleted file mode 100644 index 9d59a3b4c..000000000 --- a/node_modules/module-deps/test/invalid_pkg/file.js +++ /dev/null @@ -1 +0,0 @@ -require('./') diff --git a/node_modules/module-deps/test/invalid_pkg/index.js b/node_modules/module-deps/test/invalid_pkg/index.js deleted file mode 100644 index 27aff7fdd..000000000 --- a/node_modules/module-deps/test/invalid_pkg/index.js +++ /dev/null @@ -1 +0,0 @@ -T.pass() diff --git a/node_modules/module-deps/test/invalid_pkg/package.json b/node_modules/module-deps/test/invalid_pkg/package.json deleted file mode 100644 index 7deb8b173..000000000 --- a/node_modules/module-deps/test/invalid_pkg/package.json +++ /dev/null @@ -1 +0,0 @@ -"just a string" diff --git a/node_modules/module-deps/test/noparse.js b/node_modules/module-deps/test/noparse.js deleted file mode 100644 index accbabae1..000000000 --- a/node_modules/module-deps/test/noparse.js +++ /dev/null @@ -1,43 +0,0 @@ -var parser = require('../'); -var test = require('tap').test; -var fs = require('fs'); -var path = require('path'); - -var files = { - main: path.join(__dirname, '/files/main.js'), - foo: path.join(__dirname, '/files/foo.js'), - bar: path.join(__dirname, '/files/bar.js') -}; - -var sources = Object.keys(files).reduce(function (acc, file) { - acc[file] = fs.readFileSync(files[file], 'utf8'); - return acc; -}, {}); - -test('noParse', function (t) { - t.plan(1); - var p = parser({ noParse: [ files.foo ] }); - p.end(files.main); - var rows = []; - - p.on('data', function (row) { rows.push(row) }); - p.on('end', function () { - t.deepEqual(rows.sort(cmp), [ - { - id: files.main, - file: files.main, - source: sources.main, - entry: true, - deps: { './foo': files.foo } - }, - { - id: files.foo, - file: files.foo, - source: sources.foo, - deps: {} - } - ].sort(cmp)); - }); -}); - -function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/noparse_row.js b/node_modules/module-deps/test/noparse_row.js deleted file mode 100644 index e418da0f1..000000000 --- a/node_modules/module-deps/test/noparse_row.js +++ /dev/null @@ -1,39 +0,0 @@ -var parser = require('../'); -var test = require('tap').test; -var fs = require('fs'); -var concat = require('concat-stream'); -var path = require('path'); - -var files = { - main: path.join(__dirname, '/files/main.js'), - foo: path.join(__dirname, '/files/foo.js'), - bar: path.join(__dirname, '/files/bar.js') -}; - -var sources = Object.keys(files).reduce(function (acc, file) { - acc[file] = fs.readFileSync(files[file], 'utf8'); - return acc; -}, {}); - -test('noParse row', function (t) { - t.plan(1); - var p = parser(); - p.end({ file: files.main, noparse: true }); - var rows = []; - - p.on('data', function (row) { rows.push(row) }); - p.on('end', function () { - t.deepEqual(rows.sort(cmp), [ - { - id: files.main, - file: files.main, - source: sources.main, - entry: true, - noparse: true, - deps: {} - } - ].sort(cmp)); - }); -}); - -function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/pkg.js b/node_modules/module-deps/test/pkg.js deleted file mode 100644 index 6826d1c52..000000000 --- a/node_modules/module-deps/test/pkg.js +++ /dev/null @@ -1,20 +0,0 @@ -var mdeps = require('../'); -var test = require('tap').test; -var path = require('path'); -var fs = require('fs'); - -var dirname = path.join(__dirname, '/pkg'); - -test('pkg', function (t) { - t.plan(4); - - var d = mdeps(); - d.on('package', function (pkg_) { - var pkg = JSON.parse(fs.readFileSync(dirname + pkg_.dir + '/package.json')); - pkg.__dirname = path.join(dirname, pkg_.dir); - - t.deepEqual(pkg_, pkg); - }); - d.end(path.join(__dirname, '/pkg/main.js')); - d.resume(); -}); diff --git a/node_modules/module-deps/test/pkg/main.js b/node_modules/module-deps/test/pkg/main.js deleted file mode 100644 index 100fc1f73..000000000 --- a/node_modules/module-deps/test/pkg/main.js +++ /dev/null @@ -1,2 +0,0 @@ -require('pkga'); -require('pkgb'); diff --git a/node_modules/module-deps/test/pkg/package.json b/node_modules/module-deps/test/pkg/package.json deleted file mode 100644 index e6c480b19..000000000 --- a/node_modules/module-deps/test/pkg/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "dir": "", - "main": "index.js" -} diff --git a/node_modules/module-deps/test/pkg_filter.js b/node_modules/module-deps/test/pkg_filter.js deleted file mode 100644 index f383a6b49..000000000 --- a/node_modules/module-deps/test/pkg_filter.js +++ /dev/null @@ -1,26 +0,0 @@ -var mdeps = require('../'); -var test = require('tap').test; -var JSONStream = require('JSONStream'); -var packer = require('browser-pack'); -var concat = require('concat-stream'); -var path = require('path'); - -test('pkg filter', function (t) { - t.plan(3); - - var p = mdeps({ - packageFilter: function (pkg) { - t.equal(pkg.main, 'one.js'); - pkg.main = 'two.js' - return pkg; - } - }); - p.end(path.join(__dirname, '/files/pkg_filter/test.js')); - - var pack = packer(); - p.pipe(JSONStream.stringify()).pipe(pack); - - pack.pipe(concat(function (src) { - Function('t', src)(t); - })); -}); diff --git a/node_modules/module-deps/test/quotes.js b/node_modules/module-deps/test/quotes.js deleted file mode 100644 index eb60e2f5e..000000000 --- a/node_modules/module-deps/test/quotes.js +++ /dev/null @@ -1,42 +0,0 @@ -var parser = require('../'); -var test = require('tap').test; -var fs = require('fs'); -var path = require('path'); - -var files = { - main: path.join(__dirname, '/files/quotes/main.js'), - foo: path.join(__dirname, '/files/quotes/foo.js'), - bar: path.join(__dirname, '/files/quotes/bar.js'), - baz: path.join(__dirname, '/files/quotes/baz.js') -}; - -var sources = Object.keys(files).reduce(function (acc, file) { - acc[file] = fs.readFileSync(files[file], 'utf8'); - return acc; -}, {}); - -test('different quote styles', function (t) { - t.plan(1); - var p = parser(); - p.end(files.main); - var main = null - - p.on('data', function (row) { - if (row.id === files.main) { - main = row - } - }); - p.on('end', function () { - t.same(main, { - id: files.main, - file: files.main, - source: sources.main, - entry: true, - deps: { - './foo': files.foo, - './bar': files.bar, - './baz': files.baz - } - }); - }); -}); diff --git a/node_modules/module-deps/test/row_expose.js b/node_modules/module-deps/test/row_expose.js deleted file mode 100644 index 006e944cc..000000000 --- a/node_modules/module-deps/test/row_expose.js +++ /dev/null @@ -1,24 +0,0 @@ -var parser = require('../'); -var test = require('tap').test; -var through = require('through2'); -var path = require('path'); - -// Test that p.options.expose is defined and that the row is properly exposed -// (resolved to the absolute pathname corresponding to the `file` value passed -// in the row, and set in opts.expose). -test('row is exposed', function (t) { - t.plan(1); - var common_path = path.join(__dirname, '/files/main'); - var opts = { expose: {} }; - var p = parser(opts); - // Note pathname without extension. - p.end({ file: common_path, expose: "whatever" }); - p.on('error', t.fail.bind(t)); - - p.pipe(through.obj()); - - p.on('end', function () { - // Note pathname with extension. - t.equal(opts.expose.whatever, common_path + '.js'); - }); -}); diff --git a/node_modules/module-deps/test/row_expose_name_is_file_transform.js b/node_modules/module-deps/test/row_expose_name_is_file_transform.js deleted file mode 100644 index d93ec1f20..000000000 --- a/node_modules/module-deps/test/row_expose_name_is_file_transform.js +++ /dev/null @@ -1,32 +0,0 @@ -var parser = require('../'); -var test = require('tap').test; -var through = require('through2'); -var path = require('path'); - -// test that (non global) transforms are applied to an exposed module, where in the -// exposed name is identical to the file path. -test('row is exposed with a name equal to the path, and transformed', function (t) { - t.plan(2); - var exposed_path = path.join(__dirname, '/files/main.js'); - var found_exposed_path = false; - var opts = { - expose: {}, - transform: function(file) { - if (file === exposed_path) { - found_exposed_path = true; - } - return through(); - } - }; - - var p = parser(opts); - p.end({ file: exposed_path, expose: exposed_path }); - p.on('error', t.fail.bind(t)); - - p.pipe(through.obj()); - - p.on('end', function () { - t.equal(opts.expose[exposed_path], exposed_path); - t.ok(found_exposed_path); - }); -}); diff --git a/node_modules/module-deps/test/row_expose_transform.js b/node_modules/module-deps/test/row_expose_transform.js deleted file mode 100644 index 1b2d9eed7..000000000 --- a/node_modules/module-deps/test/row_expose_transform.js +++ /dev/null @@ -1,31 +0,0 @@ -var parser = require('../'); -var test = require('tap').test; -var through = require('through2'); -var path = require('path'); - -// test that (non global) transforms are applied to an exposed module -test('row is exposed and transformed', function (t) { - t.plan(2); - var exposed_path = path.join(__dirname, '/files/main.js'); - var found_exposed_path = false; - var opts = { - expose: {}, - transform: function(file) { - if (file === exposed_path) { - found_exposed_path = true; - } - return through(); - } - }; - - var p = parser(opts); - p.end({ file: exposed_path, expose: "whatever" }); - p.on('error', t.fail.bind(t)); - - p.pipe(through.obj()); - - p.on('end', function () { - t.equal(opts.expose.whatever, exposed_path); - t.ok(found_exposed_path); - }); -}); diff --git a/node_modules/module-deps/test/source.js b/node_modules/module-deps/test/source.js deleted file mode 100644 index 2c96e56e4..000000000 --- a/node_modules/module-deps/test/source.js +++ /dev/null @@ -1,61 +0,0 @@ -var parser = require('../'); -var test = require('tap').test; -var fs = require('fs'); -var path = require('path'); - -var files = { - main: path.join(__dirname, '/files/main.js'), - foo: path.join(__dirname, '/files/foo.js'), - bar: path.join(__dirname, '/files/bar.js'), - extra: path.join(__dirname, '/files/extra.js') -}; -var sources = { - foo: fs.readFileSync(files.foo, 'utf8'), - bar: fs.readFileSync(files.bar, 'utf8'), - extra: fs.readFileSync(files.extra, 'utf8'), - main: "console.log(require('./foo')(5)); require('./extra.js')" -}; - -test('source', function (t) { - t.plan(1); - var p = parser(); - p.end({ - file: files.main, - source: sources.main, - entry: true - }); - - var rows = []; - p.on('data', function (row) { rows.push(row) }); - p.on('end', function () { - t.same(rows.sort(cmp), [ - { - id: files.main, - file: files.main, - source: sources.main, - entry: true, - deps: { './foo': files.foo, './extra.js': files.extra } - }, - { - id: files.foo, - file: files.foo, - source: sources.foo, - deps: { './bar': files.bar } - }, - { - id: files.bar, - file: files.bar, - source: sources.bar, - deps: {} - }, - { - id: files.extra, - file: files.extra, - source: sources.extra, - deps: {} - }, - ].sort(cmp)); - }); -}); - -function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/syntax.js b/node_modules/module-deps/test/syntax.js deleted file mode 100644 index 43d2764a3..000000000 --- a/node_modules/module-deps/test/syntax.js +++ /dev/null @@ -1,23 +0,0 @@ -var mdeps = require('../'); -var test = require('tap').test; -var JSONStream = require('JSONStream'); -var packer = require('browser-pack'); -var through = require('through2'); -var path = require('path'); - -test('syntax error', function (t) { - t.plan(2); - var input = path.join(__dirname, '/files/syntax_error.js'); - // ensure transformDeps functionality does not break when parse errors happen - // see https://github.com/browserify/module-deps/commit/9fe46d5#commitcomment-28273437 - var p = mdeps({ - transform: function () { return through(); } - }); - p.on('file', function (file) { - t.equal(file, input, 'should emit a file event even if there was an error'); - }); - p.on('error', function (err) { - t.ok(err); - }); - p.end(input); -}); diff --git a/node_modules/module-deps/test/tr_2dep_module.js b/node_modules/module-deps/test/tr_2dep_module.js deleted file mode 100644 index 6ba8f8918..000000000 --- a/node_modules/module-deps/test/tr_2dep_module.js +++ /dev/null @@ -1,23 +0,0 @@ -var mdeps = require('../'); -var test = require('tap').test; -var JSONStream = require('JSONStream'); -var packer = require('browser-pack'); -var path = require('path'); - -test('transform', function (t) { - t.plan(3); - var p = mdeps({ - transform: [ 'insert-aaa', 'insert-bbb' ], - transformKey: [ 'browserify', 'transform' ] - }); - p.end(path.join(__dirname, '/files/tr_2dep_module/main.js')); - var pack = packer(); - - p.pipe(JSONStream.stringify()).pipe(pack); - - var src = ''; - pack.on('data', function (buf) { src += buf }); - pack.on('end', function () { - Function('t', src)(t); - }); -}); diff --git a/node_modules/module-deps/test/tr_deps.js b/node_modules/module-deps/test/tr_deps.js deleted file mode 100644 index f00a854da..000000000 --- a/node_modules/module-deps/test/tr_deps.js +++ /dev/null @@ -1,60 +0,0 @@ -var parser = require('../'); -var through = require('through2'); -var test = require('tap').test; -var fs = require('fs'); -var path = require('path'); - -var files = { - transformdeps: path.join(__dirname, '/files/transformdeps.js'), - foo: path.join(__dirname, '/files/foo.js'), - bar: path.join(__dirname, '/files/bar.js') -}; - -var sources = Object.keys(files).reduce(function (acc, file) { - acc[file] = fs.readFileSync(files[file], 'utf8'); - return acc; -}, {}); - -test('deps added by transforms', function (t) { - t.plan(1); - var p = parser(); - p.write({ transform: transform, options: {} }); - p.end({ file: files.transformdeps, entry: true }); - function transform (file) { - if (file === files.transformdeps) return through(function(chunk, enc, cb) { - cb(null, chunk); - }, function (cb) { - this.emit('dep', './foo'); - cb(); - }); - return through(); - } - - var rows = []; - p.on('data', function (row) { rows.push(row) }); - p.on('end', function () { - t.same(rows.sort(cmp), [ - { - id: files.transformdeps, - file: files.transformdeps, - source: sources.transformdeps, - entry: true, - deps: { './foo': files.foo } - }, - { - id: files.foo, - file: files.foo, - source: sources.foo, - deps: { './bar': files.bar } - }, - { - id: files.bar, - file: files.bar, - source: sources.bar, - deps: {} - } - ].sort(cmp)); - }); -}); - -function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/tr_err.js b/node_modules/module-deps/test/tr_err.js deleted file mode 100644 index 29322da01..000000000 --- a/node_modules/module-deps/test/tr_err.js +++ /dev/null @@ -1,21 +0,0 @@ -var mdeps = require('../'); -var test = require('tap').test; -var JSONStream = require('JSONStream'); -var packer = require('browser-pack'); -var through = require('through2'); -var path = require('path'); - -test('transform', function (t) { - t.plan(1); - var p = mdeps({ - transform: function (file) { - return through(function () { - this.emit('error', new Error('rawr')); - }); - } - }); - p.on('error', function (err) { - t.ok(/tr_sh[\\\/]main\.js/.test(err)); - }); - p.end(path.join(__dirname, '/files/tr_sh/main.js')); -}); diff --git a/node_modules/module-deps/test/tr_flags.js b/node_modules/module-deps/test/tr_flags.js deleted file mode 100644 index c94fa6006..000000000 --- a/node_modules/module-deps/test/tr_flags.js +++ /dev/null @@ -1,44 +0,0 @@ -var through = require('through2'); -var mdeps = require('../'); -var test = require('tap').test; - -test('--debug passed to transforms', function (t) { - var empty = require.resolve('./tr_flags/empty.js'); - - t.plan(5); - - var p - [true, false].forEach(function(debug) { - p = mdeps({ - debug: debug, - transform: function (file, opts) { - t.equal(opts._flags.debug, debug, 'debug: ' + debug); - return through(); - } - }) - p.on('error', function (err) { return t.fail(err.message) }) - p.end(empty); - - p = mdeps({ debug: debug }) - p.write({ - transform: function (file, opts) { - t.equal(opts._flags.debug, debug, 'debug: ' + debug); - return through(); - }, - options: {} - }) - p.on('error', function (err) { return t.fail(err.message) }) - p.end(empty); - }); - - p = mdeps({ debug: true }) - p.write({ - transform: function (file, opts) { - t.equal(opts._flags, Infinity, 'transform arguments are preserved'); - return through(); - }, - options: { _flags: Infinity } - }) - p.on('error', function (err) { return t.fail(err.message) }) - p.end(empty); -}); diff --git a/node_modules/module-deps/test/tr_flags/empty.js b/node_modules/module-deps/test/tr_flags/empty.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/module-deps/test/tr_fn.js b/node_modules/module-deps/test/tr_fn.js deleted file mode 100644 index 127f4adc5..000000000 --- a/node_modules/module-deps/test/tr_fn.js +++ /dev/null @@ -1,32 +0,0 @@ -var mdeps = require('../'); -var test = require('tap').test; -var JSONStream = require('JSONStream'); -var packer = require('browser-pack'); -var through = require('through2'); -var path = require('path'); - -test('transform', function (t) { - t.plan(3); - var p = mdeps({ - transform: function (file) { - return through(function (buf, enc, next) { - this.push(String(buf) - .replace(/AAA/g, '5') - .replace(/BBB/g, '50') - ); - next(); - }); - }, - transformKey: [ 'browserify', 'transform' ] - }); - p.end(path.join(__dirname, '/files/tr_sh/main.js')); - var pack = packer(); - - p.pipe(JSONStream.stringify()).pipe(pack); - - var src = ''; - pack.on('data', function (buf) { src += buf }); - pack.on('end', function () { - Function('t', src)(t); - }); -}); diff --git a/node_modules/module-deps/test/tr_global.js b/node_modules/module-deps/test/tr_global.js deleted file mode 100644 index 2b4695e43..000000000 --- a/node_modules/module-deps/test/tr_global.js +++ /dev/null @@ -1,29 +0,0 @@ -var mdeps = require('../'); -var test = require('tap').test; -var JSONStream = require('JSONStream'); -var packer = require('browser-pack'); -var concat = require('concat-stream'); -var path = require('path'); - -test('global transforms', function (t) { - t.plan(1); - - var p = mdeps({ - transform: [ 'tr-c', 'tr-d' ], - globalTransform: [ - path.join(__dirname, '/files/tr_global/node_modules/tr-e'), - path.join(__dirname, '/files/tr_global/node_modules/tr-f') - ], - transformKey: [ 'browserify', 'transform' ] - }); - p.end(path.join(__dirname, '/files/tr_global/main.js')); - var pack = packer(); - - p.pipe(JSONStream.stringify()).pipe(pack).pipe(concat(function (src) { - Function(['console'], src)({ - log: function (msg) { - t.equal(msg, 111111); - } - }); - })); -}); diff --git a/node_modules/module-deps/test/tr_module.js b/node_modules/module-deps/test/tr_module.js deleted file mode 100644 index f781746c3..000000000 --- a/node_modules/module-deps/test/tr_module.js +++ /dev/null @@ -1,23 +0,0 @@ -var mdeps = require('../'); -var test = require('tap').test; -var JSONStream = require('JSONStream'); -var packer = require('browser-pack'); -var path = require('path'); - -test('transform', function (t) { - t.plan(4); - var p = mdeps({ - transform: [ 'insert-aaa', 'insert-bbb' ], - transformKey: [ 'browserify', 'transform' ] - }); - p.end(path.join(__dirname, '/files/tr_module/main.js')); - var pack = packer(); - - p.pipe(JSONStream.stringify()).pipe(pack); - - var src = ''; - pack.on('data', function (buf) { src += buf }); - pack.on('end', function () { - Function('t', src)(t); - }); -}); diff --git a/node_modules/module-deps/test/tr_no_entry.js b/node_modules/module-deps/test/tr_no_entry.js deleted file mode 100644 index e4428572a..000000000 --- a/node_modules/module-deps/test/tr_no_entry.js +++ /dev/null @@ -1,31 +0,0 @@ -var mdeps = require('../'); -var test = require('tap').test; -var JSONStream = require('JSONStream'); -var packer = require('browser-pack'); -var through = require('through2'); -var concat = require('concat-stream'); -var path = require('path'); - -test('transform no entry', function (t) { - t.plan(1); - var p = mdeps({ - transform: [ function (file) { - return through(function (buf, enc, next) { - this.push(String(buf).replace(/AAA/g, '"WOW"')); - next(); - }); - } ] - }); - p.end({ - file: path.join(__dirname, '/files/tr_no_entry/main.js'), - id: 'xxx' - }); - - p.pipe(JSONStream.stringify()).pipe(packer()) - .pipe(concat(function (body) { - var con = { log: function (x) { t.equal(x, 'WOW') } }; - var src = 'require=' + body.toString('utf8') + ';require("xxx")'; - Function('console', src)(con); - })) - ; -}); diff --git a/node_modules/module-deps/test/tr_opts.js b/node_modules/module-deps/test/tr_opts.js deleted file mode 100644 index 6d2405ab2..000000000 --- a/node_modules/module-deps/test/tr_opts.js +++ /dev/null @@ -1,21 +0,0 @@ -var mdeps = require('../'); -var test = require('tap').test; -var JSONStream = require('JSONStream'); -var packer = require('browser-pack'); -var concat = require('concat-stream'); -var path = require('path'); - -test('transform options', function (t) { - t.plan(1); - var p = mdeps({ - transformKey: [ 'mdtr' ] - }); - p.end(path.join(__dirname, '/tr_opts/main.js')); - var pack = packer(); - - p.pipe(JSONStream.stringify()).pipe(pack).pipe(concat(function (src) { - Function('console', src.toString('utf8'))({ - log: function (msg) { t.equal(msg, 999) } - }); - })); -}); diff --git a/node_modules/module-deps/test/tr_opts/main.js b/node_modules/module-deps/test/tr_opts/main.js deleted file mode 100644 index d1efe1ce5..000000000 --- a/node_modules/module-deps/test/tr_opts/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log(FFF * GGG * HHH); diff --git a/node_modules/module-deps/test/tr_opts/package.json b/node_modules/module-deps/test/tr_opts/package.json deleted file mode 100644 index 51b32e977..000000000 --- a/node_modules/module-deps/test/tr_opts/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "mdtr": [ - [ "fff", { "x": 3 } ], - [ "ggg", { "z": 111 } ], - [ "hhh" ] - ] -} diff --git a/node_modules/module-deps/test/tr_rel.js b/node_modules/module-deps/test/tr_rel.js deleted file mode 100644 index 4e340c428..000000000 --- a/node_modules/module-deps/test/tr_rel.js +++ /dev/null @@ -1,24 +0,0 @@ -var mdeps = require('../'); -var test = require('tap').test; -var JSONStream = require('JSONStream'); -var packer = require('browser-pack'); -var path = require('path'); - -test('transform', function (t) { - t.plan(1); - var p = mdeps({ - transformKey: [ 'browserify', 'transform' ] - }); - p.end(path.join(__dirname, '/files/tr_rel/subdir/main.js')); - var pack = packer(); - - p.pipe(JSONStream.stringify()).pipe(pack); - - var src = ''; - pack.on('data', function (buf) { src += buf }); - pack.on('end', function () { - Function('console', src)({ log: function (msg) { - t.equal(msg, 333); - } }); - }); -}); diff --git a/node_modules/module-deps/test/tr_sh.js b/node_modules/module-deps/test/tr_sh.js deleted file mode 100644 index a46f599d0..000000000 --- a/node_modules/module-deps/test/tr_sh.js +++ /dev/null @@ -1,23 +0,0 @@ -var mdeps = require('../'); -var test = require('tap').test; -var JSONStream = require('JSONStream'); -var packer = require('browser-pack'); -var path = require('path'); - -test('transform', function (t) { - t.plan(3); - var p = mdeps({ - transform: [ './tr_a.js', './tr_b.js' ], - transformKey: [ 'browserify', 'transform' ] - }); - p.end(path.join(__dirname, '/files/tr_sh/main.js')); - var pack = packer(); - - p.pipe(JSONStream.stringify()).pipe(pack); - - var src = ''; - pack.on('data', function (buf) { src += buf }); - pack.on('end', function () { - Function('t', src)(t); - }); -}); diff --git a/node_modules/module-deps/test/tr_whole_package.js b/node_modules/module-deps/test/tr_whole_package.js deleted file mode 100644 index a2a31310e..000000000 --- a/node_modules/module-deps/test/tr_whole_package.js +++ /dev/null @@ -1,22 +0,0 @@ -var mdeps = require('../'); -var test = require('tap').test; -var JSONStream = require('JSONStream'); -var packer = require('browser-pack'); -var path = require('path'); - -test('transform', function (t) { - t.plan(1); - var p = mdeps({ - transformKey: [ 'browserify', 'transform' ] - }); - p.end(path.join(__dirname, '/files/tr_whole_package/main.js')); - var pack = packer(); - - p.pipe(JSONStream.stringify()).pipe(pack); - - var src = ''; - pack.on('data', function (buf) { src += buf }); - pack.on('end', function () { - Function('t', src)(t); - }); -}); diff --git a/node_modules/module-deps/test/tr_write.js b/node_modules/module-deps/test/tr_write.js deleted file mode 100644 index 1d709d979..000000000 --- a/node_modules/module-deps/test/tr_write.js +++ /dev/null @@ -1,32 +0,0 @@ -var mdeps = require('../'); -var test = require('tap').test; -var JSONStream = require('JSONStream'); -var packer = require('browser-pack'); -var path = require('path'); -var concat = require('concat-stream'); - -test('transform write', function (t) { - t.plan(1); - var p = mdeps(); - - p.write({ - transform: 'insert-www', - options: {} - }); - p.write({ - file: path.join(__dirname, 'tr_write/main.js'), - id: path.join(__dirname, 'tr_write/main.js'), - entry: true - }); - p.end(); - - var pack = packer(); - p.pipe(JSONStream.stringify()).pipe(pack); - - pack.pipe(concat(function (buf) { - var src = buf.toString('utf8'); - Function('console', src)({ log: function (msg) { - t.equal(msg, 'WORLD WIDE WOW'); - } }); - })); -}); diff --git a/node_modules/module-deps/test/tr_write/main.js b/node_modules/module-deps/test/tr_write/main.js deleted file mode 100644 index 70f753251..000000000 --- a/node_modules/module-deps/test/tr_write/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log(WWW.toUpperCase()); diff --git a/node_modules/module-deps/test/undef_file.js b/node_modules/module-deps/test/undef_file.js deleted file mode 100644 index 83f390523..000000000 --- a/node_modules/module-deps/test/undef_file.js +++ /dev/null @@ -1,49 +0,0 @@ -var parser = require('../'); -var test = require('tap').test; -var fs = require('fs'); -var path = require('path'); - -var files = { - main: path.join(__dirname, '/files/main.js'), - foo: path.join(__dirname, '/files/foo.js'), - bar: path.join(__dirname, '/files/bar.js') -}; - -var sources = Object.keys(files).reduce(function (acc, file) { - acc[file] = fs.readFileSync(files[file], 'utf8'); - return acc; -}, {}); - -test('undef file', function (t) { - t.plan(1); - var p = parser(); - p.end({ id: files.main, entry: true }); - - var rows = []; - p.on('data', function (row) { rows.push(row) }); - p.on('end', function () { - t.same(rows.sort(cmp), [ - { - id: files.main, - file: files.main, - source: sources.main, - entry: true, - deps: { './foo': files.foo } - }, - { - id: files.foo, - file: files.foo, - source: sources.foo, - deps: { './bar': files.bar } - }, - { - id: files.bar, - file: files.bar, - source: sources.bar, - deps: {} - } - ].sort(cmp)); - }); -}); - -function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/module-deps/test/unicode.js b/node_modules/module-deps/test/unicode.js deleted file mode 100644 index 682f0f85b..000000000 --- a/node_modules/module-deps/test/unicode.js +++ /dev/null @@ -1,49 +0,0 @@ -var parser = require('../'); -var test = require('tap').test; -var fs = require('fs'); -var path = require('path'); - -var files = { - main: path.join(__dirname, '/files/unicode/main.js'), - foo: path.join(__dirname, '/files/unicode/foo.js'), - bar: path.join(__dirname, '/files/unicode/bar.js') -}; - -var sources = Object.keys(files).reduce(function (acc, file) { - acc[file] = fs.readFileSync(files[file], 'utf8'); - return acc; -}, {}); - -test('unicode deps', function (t) { - t.plan(1); - var p = parser(); - p.end(files.main); - var rows = []; - - p.on('data', function (row) { rows.push(row) }); - p.on('end', function () { - t.same(rows.sort(cmp), [ - { - id: files.main, - file: files.main, - source: sources.main, - entry: true, - deps: { './foo': files.foo } - }, - { - id: files.foo, - file: files.foo, - source: sources.foo, - deps: { './bar': files.bar } - }, - { - id: files.bar, - file: files.bar, - source: sources.bar, - deps: {} - } - ].sort(cmp)); - }); -}); - -function cmp (a, b) { return a.id < b.id ? -1 : 1 } diff --git a/node_modules/ms/index.js b/node_modules/ms/index.js deleted file mode 100644 index 6a522b16b..000000000 --- a/node_modules/ms/index.js +++ /dev/null @@ -1,152 +0,0 @@ -/** - * 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'; -} diff --git a/node_modules/ms/license.md b/node_modules/ms/license.md deleted file mode 100644 index 69b61253a..000000000 --- a/node_modules/ms/license.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Zeit, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/ms/package.json b/node_modules/ms/package.json deleted file mode 100644 index 1588dd768..000000000 --- a/node_modules/ms/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_from": "ms@2.0.0", - "_id": "ms@2.0.0", - "_inBundle": false, - "_integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "_location": "/ms", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "ms@2.0.0", - "name": "ms", - "escapedName": "ms", - "rawSpec": "2.0.0", - "saveSpec": null, - "fetchSpec": "2.0.0" - }, - "_requiredBy": [ - "/debug", - "/send" - ], - "_resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "_shasum": "5608aeadfc00be6c2901df5f9861788de0d597c8", - "_spec": "ms@2.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/debug", - "bugs": { - "url": "https://github.com/zeit/ms/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Tiny milisecond conversion utility", - "devDependencies": { - "eslint": "3.19.0", - "expect.js": "0.3.1", - "husky": "0.13.3", - "lint-staged": "3.4.1", - "mocha": "3.4.1" - }, - "eslintConfig": { - "extends": "eslint:recommended", - "env": { - "node": true, - "es6": true - } - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/zeit/ms#readme", - "license": "MIT", - "lint-staged": { - "*.js": [ - "npm run lint", - "prettier --single-quote --write", - "git add" - ] - }, - "main": "./index", - "name": "ms", - "repository": { - "type": "git", - "url": "git+https://github.com/zeit/ms.git" - }, - "scripts": { - "lint": "eslint lib/* bin/*", - "precommit": "lint-staged", - "test": "mocha tests.js" - }, - "version": "2.0.0" -} diff --git a/node_modules/ms/readme.md b/node_modules/ms/readme.md deleted file mode 100644 index 84a9974cc..000000000 --- a/node_modules/ms/readme.md +++ /dev/null @@ -1,51 +0,0 @@ -# ms - -[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) -[![Slack Channel](http://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/) - -Use this package to easily convert various time formats to milliseconds. - -## Examples - -```js -ms('2 days') // 172800000 -ms('1d') // 86400000 -ms('10h') // 36000000 -ms('2.5 hrs') // 9000000 -ms('2h') // 7200000 -ms('1m') // 60000 -ms('5s') // 5000 -ms('1y') // 31557600000 -ms('100') // 100 -``` - -### Convert from milliseconds - -```js -ms(60000) // "1m" -ms(2 * 60000) // "2m" -ms(ms('10 hours')) // "10h" -``` - -### Time format written-out - -```js -ms(60000, { long: true }) // "1 minute" -ms(2 * 60000, { long: true }) // "2 minutes" -ms(ms('10 hours'), { long: true }) // "10 hours" -``` - -## Features - -- Works both in [node](https://nodejs.org) and in the browser. -- If a number is supplied to `ms`, a string with a unit is returned. -- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`). -- If you pass a string with a number and a valid unit, the number of equivalent ms is returned. - -## Caught a bug? - -1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device -2. Link the package to the global module directory: `npm link` -3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, node will now use your clone of ms! - -As always, you can run the tests using: `npm test` diff --git a/node_modules/nanomatch/CHANGELOG.md b/node_modules/nanomatch/CHANGELOG.md deleted file mode 100644 index 8c3aead9a..000000000 --- a/node_modules/nanomatch/CHANGELOG.md +++ /dev/null @@ -1,57 +0,0 @@ -## History - -### key - -Changelog entries are classified using the following labels _(from [keep-a-changelog][]_): - -- `added`: for new features -- `changed`: for changes in existing functionality -- `deprecated`: for once-stable features removed in upcoming releases -- `removed`: for deprecated features removed in this release -- `fixed`: for any bug fixes -- `bumped`: updated dependencies, only minor or higher will be listed. - -### [1.1.0] - 2017-04-11 - -**Fixed** - -- adds support for unclosed quotes - -**Added** - -- adds support for `options.noglobstar` - -### [1.0.4] - 2017-04-06 - -Housekeeping updates. Adds documentation section about escaping, cleans up utils. - -### [1.0.3] - 2017-04-06 - -This release includes fixes for windows path edge cases and other improvements for stricter adherence to bash spec. - -**Fixed** - -- More windows path edge cases - -**Added** - -- Support for bash-like quoted strings for escaping sequences of characters, such as `foo/"**"/bar` where `**` should be matched literally and not evaluated as special characters. - -### [1.0.1] - 2016-12-12 - -**Added** - -- Support for windows path edge cases where backslashes are used in brackets or other unusual combinations. - -### [1.0.0] - 2016-12-12 - -Stable release. - -### [0.1.0] - 2016-10-08 - -First release. - -[Unreleased]: https://github.com/jonschlinkert/nanomatch/compare/0.1.0...HEAD -[0.2.0]: https://github.com/jonschlinkert/nanomatch/compare/0.1.0...0.2.0 - -[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog diff --git a/node_modules/nanomatch/LICENSE b/node_modules/nanomatch/LICENSE deleted file mode 100644 index 7c9987bc6..000000000 --- a/node_modules/nanomatch/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016-2018, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/nanomatch/README.md b/node_modules/nanomatch/README.md deleted file mode 100644 index bdd35a94a..000000000 --- a/node_modules/nanomatch/README.md +++ /dev/null @@ -1,1148 +0,0 @@ -# nanomatch [![NPM version](https://img.shields.io/npm/v/nanomatch.svg?style=flat)](https://www.npmjs.com/package/nanomatch) [![NPM monthly downloads](https://img.shields.io/npm/dm/nanomatch.svg?style=flat)](https://npmjs.org/package/nanomatch) [![NPM total downloads](https://img.shields.io/npm/dt/nanomatch.svg?style=flat)](https://npmjs.org/package/nanomatch) [![Linux Build Status](https://img.shields.io/travis/micromatch/nanomatch.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/nanomatch) [![Windows Build Status](https://img.shields.io/appveyor/ci/micromatch/nanomatch.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/micromatch/nanomatch) - -> Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces) - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Table of Contents - -
    -Details - -- [Install](#install) -- [What is nanomatch?](#what-is-nanomatch) -- [Getting started](#getting-started) - * [Installing nanomatch](#installing-nanomatch) - * [Usage](#usage) -- [Documentation](#documentation) - * [Escaping](#escaping) -- [API](#api) -- [Options](#options) - * [options.basename](#optionsbasename) - * [options.bash](#optionsbash) - * [options.cache](#optionscache) - * [options.dot](#optionsdot) - * [options.failglob](#optionsfailglob) - * [options.ignore](#optionsignore) - * [options.matchBase](#optionsmatchbase) - * [options.nocase](#optionsnocase) - * [options.nodupes](#optionsnodupes) - * [options.noglobstar](#optionsnoglobstar) - * [options.nonegate](#optionsnonegate) - * [options.nonull](#optionsnonull) - * [options.nullglob](#optionsnullglob) - * [options.slash](#optionsslash) - * [options.star](#optionsstar) - * [options.snapdragon](#optionssnapdragon) - * [options.sourcemap](#optionssourcemap) - * [options.unescape](#optionsunescape) - * [options.unixify](#optionsunixify) -- [Features](#features) -- [Bash expansion libs](#bash-expansion-libs) -- [Benchmarks](#benchmarks) - * [Running benchmarks](#running-benchmarks) - * [Nanomatch vs. Minimatch vs. Multimatch](#nanomatch-vs-minimatch-vs-multimatch) -- [About](#about) - -
    - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save nanomatch -``` - -
    -Release history - -## History - -### key - -Changelog entries are classified using the following labels _(from [keep-a-changelog](https://github.com/olivierlacan/keep-a-changelog)_): - -* `added`: for new features -* `changed`: for changes in existing functionality -* `deprecated`: for once-stable features removed in upcoming releases -* `removed`: for deprecated features removed in this release -* `fixed`: for any bug fixes -* `bumped`: updated dependencies, only minor or higher will be listed. - -### [1.1.0](https://github.com/micromatch/nanomatch/compare/1.0.4...1.1.0) - 2017-04-11 - -**Fixed** - -* adds support for unclosed quotes - -**Added** - -* adds support for `options.noglobstar` - -### [1.0.4](https://github.com/micromatch/nanomatch/compare/1.0.3...1.0.4) - 2017-04-06 - -Housekeeping updates. Adds documentation section about escaping, cleans up utils. - -### [1.0.3](https://github.com/micromatch/nanomatch/compare/1.0.1...1.0.3) - 2017-04-06 - -This release includes fixes for windows path edge cases and other improvements for stricter adherence to bash spec. - -**Fixed** - -* More windows path edge cases - -**Added** - -* Support for bash-like quoted strings for escaping sequences of characters, such as `foo/"**"/bar` where `**` should be matched literally and not evaluated as special characters. - -### [1.0.1](https://github.com/micromatch/nanomatch/compare/1.0.0...1.0.1) - 2016-12-12 - -**Added** - -* Support for windows path edge cases where backslashes are used in brackets or other unusual combinations. - -### [1.0.0](https://github.com/micromatch/nanomatch/compare/0.1.0...1.0.0) - 2016-12-12 - -Stable release. - -### [0.1.0] - 2016-10-08 - -First release. - -
    - -## What is nanomatch? - -Nanomatch is a fast and accurate glob matcher with full support for standard Bash glob features, including the following "metacharacters": `*`, `**`, `?` and `[...]`. - -**Learn more** - -* [Getting started](#getting-started): learn how to install and begin using nanomatch -* [Features](#features): jump to info about supported patterns, and a glob matching reference -* [API documentation](#api): jump to available options and methods -* [Unit tests](test): visit unit tests. there is no better way to learn a code library than spending time the unit tests. Nanomatch has 36,000 unit tests - go become a glob matching ninja! - -
    -How is this different? - -**Speed and accuracy** - -Nanomatch uses [snapdragon](https://github.com/jonschlinkert/snapdragon) for parsing and compiling globs, which results in: - -* Granular control over the entire conversion process in a way that is easy to understand, reason about, and customize. -* Faster matching, from a combination of optimized glob patterns and (optional) caching. -* Much greater accuracy than minimatch. In fact, nanomatch passes _all of the spec tests_ from bash, including some that bash still fails. However, since there is no real specification for globs, if you encounter a pattern that yields unexpected match results [after researching previous issues](../../issues), [please let us know](../../issues/new). - -**Basic globbing only** - -Nanomatch supports [basic globbing only](#features), which is limited to `*`, `**`, `?` and regex-like brackets. - -If you need support for the other [bash "expansion" types](#bash-expansion-libs) (in addition to the wildcard matching provided by nanomatch), consider using [micromatch](https://github.com/micromatch/micromatch) instead. _(micromatch >=3.0.0 uses the nanomatch parser and compiler for basic glob matching)_ - -
    - -## Getting started - -### Installing nanomatch - -**Install with [yarn](https://yarnpkg.com/)** - -```sh -$ yarn add nanomatch -``` - -**Install with [npm](https://npmjs.com)** - -```sh -$ npm install nanomatch -``` - -### Usage - -Add nanomatch to your project using node's `require()` system: - -```js -var nanomatch = require('nanomatch'); - -// the main export is a function that takes an array of strings to match -// and a string or array of patterns to use for matching -nanomatch(list, patterns[, options]); -``` - -**Params** - -* `list` **{String|Array}**: List of strings to perform matches against. This is often a list of file paths. -* `patterns` **{String|Array}**: One or more [glob paterns](#features) to use for matching. -* `options` **{Object}**: Any [supported options](#options) may be passed - -**Examples** - -```js -var nm = require('nanomatch'); -console.log(nm(['a', 'b/b', 'c/c/c'], '*')); -//=> ['a'] - -console.log(nm(['a', 'b/b', 'c/c/c'], '*/*')); -//=> ['b/b'] - -console.log(nm(['a', 'b/b', 'c/c/c'], '**')); -//=> ['a', 'b/b', 'c/c/c'] -``` - -See the [API documentation](#api) for available methods and [options](https://github.com/einaros/options.js). - -## Documentation - -### Escaping - -_Backslashes and quotes_ can be used to escape characters, forcing nanomatch to regard those characters as a literal characters. - -**Backslashes** - -Use backslashes to escape single characters. For example, the following pattern would match `foo/*/bar` exactly: - -```js -'foo/\*/bar' -``` - -The following pattern would match `foo/` followed by a literal `*`, followed by zero or more of any characters besides `/`, followed by `/bar`. - -```js -'foo/\**/bar' -``` - -**Quoted strings** - -Use single or double quotes to escape sequences of characters. For example, the following patterns would match `foo/**/bar` exactly: - -```js -'foo/"**"/bar' -'foo/\'**\'/bar' -"foo/'**'/bar" -``` - -**Matching literal quotes** - -If you need to match quotes literally, you can escape them as well. For example, the following will match `foo/"*"/bar`, `foo/"a"/bar`, `foo/"b"/bar`, or `foo/"c"/bar`: - -```js -'foo/\\"*\\"/bar' -``` - -And the following will match `foo/'*'/bar`, `foo/'a'/bar`, `foo/'b'/bar`, or `foo/'c'/bar`: - -```js -'foo/\\\'*\\\'/bar' -``` - -## API - -### [nanomatch](index.js#L40) - -The main function takes a list of strings and one or more glob patterns to use for matching. - -**Params** - -* `list` **{Array}**: A list of strings to match -* `patterns` **{String|Array}**: One or more glob patterns to use for matching. -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Array}**: Returns an array of matches - -**Example** - -```js -var nm = require('nanomatch'); -nm(list, patterns[, options]); - -console.log(nm(['a.js', 'a.txt'], ['*.js'])); -//=> [ 'a.js' ] -``` - -### [.match](index.js#L106) - -Similar to the main function, but `pattern` must be a string. - -**Params** - -* `list` **{Array}**: Array of strings to match -* `pattern` **{String}**: Glob pattern to use for matching. -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Array}**: Returns an array of matches - -**Example** - -```js -var nm = require('nanomatch'); -nm.match(list, pattern[, options]); - -console.log(nm.match(['a.a', 'a.aa', 'a.b', 'a.c'], '*.a')); -//=> ['a.a', 'a.aa'] -``` - -### [.isMatch](index.js#L167) - -Returns true if the specified `string` matches the given glob `pattern`. - -**Params** - -* `string` **{String}**: String to match -* `pattern` **{String}**: Glob pattern to use for matching. -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Boolean}**: Returns true if the string matches the glob pattern. - -**Example** - -```js -var nm = require('nanomatch'); -nm.isMatch(string, pattern[, options]); - -console.log(nm.isMatch('a.a', '*.a')); -//=> true -console.log(nm.isMatch('a.b', '*.a')); -//=> false -``` - -### [.some](index.js#L205) - -Returns true if some of the elements in the given `list` match any of the given glob `patterns`. - -**Params** - -* `list` **{String|Array}**: The string or array of strings to test. Returns as soon as the first match is found. -* `patterns` **{String|Array}**: One or more glob patterns to use for matching. -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Boolean}**: Returns true if any patterns match `str` - -**Example** - -```js -var nm = require('nanomatch'); -nm.some(list, patterns[, options]); - -console.log(nm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); -// true -console.log(nm.some(['foo.js'], ['*.js', '!foo.js'])); -// false -``` - -### [.every](index.js#L243) - -Returns true if every element in the given `list` matches at least one of the given glob `patterns`. - -**Params** - -* `list` **{String|Array}**: The string or array of strings to test. -* `patterns` **{String|Array}**: One or more glob patterns to use for matching. -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Boolean}**: Returns true if any patterns match `str` - -**Example** - -```js -var nm = require('nanomatch'); -nm.every(list, patterns[, options]); - -console.log(nm.every('foo.js', ['foo.js'])); -// true -console.log(nm.every(['foo.js', 'bar.js'], ['*.js'])); -// true -console.log(nm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); -// false -console.log(nm.every(['foo.js'], ['*.js', '!foo.js'])); -// false -``` - -### [.any](index.js#L277) - -Returns true if **any** of the given glob `patterns` match the specified `string`. - -**Params** - -* `str` **{String|Array}**: The string to test. -* `patterns` **{String|Array}**: One or more glob patterns to use for matching. -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Boolean}**: Returns true if any patterns match `str` - -**Example** - -```js -var nm = require('nanomatch'); -nm.any(string, patterns[, options]); - -console.log(nm.any('a.a', ['b.*', '*.a'])); -//=> true -console.log(nm.any('a.a', 'b.*')); -//=> false -``` - -### [.all](index.js#L325) - -Returns true if **all** of the given `patterns` match the specified string. - -**Params** - -* `str` **{String|Array}**: The string to test. -* `patterns` **{String|Array}**: One or more glob patterns to use for matching. -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Boolean}**: Returns true if any patterns match `str` - -**Example** - -```js -var nm = require('nanomatch'); -nm.all(string, patterns[, options]); - -console.log(nm.all('foo.js', ['foo.js'])); -// true - -console.log(nm.all('foo.js', ['*.js', '!foo.js'])); -// false - -console.log(nm.all('foo.js', ['*.js', 'foo.js'])); -// true - -console.log(nm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); -// true -``` - -### [.not](index.js#L359) - -Returns a list of strings that _**do not match any**_ of the given `patterns`. - -**Params** - -* `list` **{Array}**: Array of strings to match. -* `patterns` **{String|Array}**: One or more glob pattern to use for matching. -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Array}**: Returns an array of strings that **do not match** the given patterns. - -**Example** - -```js -var nm = require('nanomatch'); -nm.not(list, patterns[, options]); - -console.log(nm.not(['a.a', 'b.b', 'c.c'], '*.a')); -//=> ['b.b', 'c.c'] -``` - -### [.contains](index.js#L394) - -Returns true if the given `string` contains the given pattern. Similar to [.isMatch](#isMatch) but the pattern can match any part of the string. - -**Params** - -* `str` **{String}**: The string to match. -* `patterns` **{String|Array}**: Glob pattern to use for matching. -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Boolean}**: Returns true if the patter matches any part of `str`. - -**Example** - -```js -var nm = require('nanomatch'); -nm.contains(string, pattern[, options]); - -console.log(nm.contains('aa/bb/cc', '*b')); -//=> true -console.log(nm.contains('aa/bb/cc', '*d')); -//=> false -``` - -### [.matchKeys](index.js#L450) - -Filter the keys of the given object with the given `glob` pattern and `options`. Does not attempt to match nested keys. If you need this feature, use [glob-object](https://github.com/jonschlinkert/glob-object) instead. - -**Params** - -* `object` **{Object}**: The object with keys to filter. -* `patterns` **{String|Array}**: One or more glob patterns to use for matching. -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Object}**: Returns an object with only keys that match the given patterns. - -**Example** - -```js -var nm = require('nanomatch'); -nm.matchKeys(object, patterns[, options]); - -var obj = { aa: 'a', ab: 'b', ac: 'c' }; -console.log(nm.matchKeys(obj, '*b')); -//=> { ab: 'b' } -``` - -### [.matcher](index.js#L479) - -Returns a memoized matcher function from the given glob `pattern` and `options`. The returned function takes a string to match as its only argument and returns true if the string is a match. - -**Params** - -* `pattern` **{String}**: Glob pattern -* `options` **{Object}**: See available [options](#options) for changing how matches are performed. -* `returns` **{Function}**: Returns a matcher function. - -**Example** - -```js -var nm = require('nanomatch'); -nm.matcher(pattern[, options]); - -var isMatch = nm.matcher('*.!(*a)'); -console.log(isMatch('a.a')); -//=> false -console.log(isMatch('a.b')); -//=> true -``` - -### [.capture](index.js#L560) - -Returns an array of matches captured by `pattern` in `string, or`null` if the pattern did not match. - -**Params** - -* `pattern` **{String}**: Glob pattern to use for matching. -* `string` **{String}**: String to match -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Boolean}**: Returns an array of captures if the string matches the glob pattern, otherwise `null`. - -**Example** - -```js -var nm = require('nanomatch'); -nm.capture(pattern, string[, options]); - -console.log(nm.capture('test/*.js', 'test/foo.js')); -//=> ['foo'] -console.log(nm.capture('test/*.js', 'foo/bar.css')); -//=> null -``` - -### [.makeRe](index.js#L595) - -Create a regular expression from the given glob `pattern`. - -**Params** - -* `pattern` **{String}**: A glob pattern to convert to regex. -* `options` **{Object}**: See available [options](#options) for changing how matches are performed. -* `returns` **{RegExp}**: Returns a regex created from the given pattern. - -**Example** - -```js -var nm = require('nanomatch'); -nm.makeRe(pattern[, options]); - -console.log(nm.makeRe('*.js')); -//=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ -``` - -### [.create](index.js#L658) - -Parses the given glob `pattern` and returns an object with the compiled `output` and optional source `map`. - -**Params** - -* `pattern` **{String}**: Glob pattern to parse and compile. -* `options` **{Object}**: Any [options](#options) to change how parsing and compiling is performed. -* `returns` **{Object}**: Returns an object with the parsed AST, compiled string and optional source map. - -**Example** - -```js -var nm = require('nanomatch'); -nm.create(pattern[, options]); - -console.log(nm.create('abc/*.js')); -// { options: { source: 'string', sourcemap: true }, -// state: {}, -// compilers: -// { ... }, -// output: '(\\.[\\\\\\/])?abc\\/(?!\\.)(?=.)[^\\/]*?\\.js', -// ast: -// { type: 'root', -// errors: [], -// nodes: -// [ ... ], -// dot: false, -// input: 'abc/*.js' }, -// parsingErrors: [], -// map: -// { version: 3, -// sources: [ 'string' ], -// names: [], -// mappings: 'AAAA,GAAG,EAAC,kBAAC,EAAC,EAAE', -// sourcesContent: [ 'abc/*.js' ] }, -// position: { line: 1, column: 28 }, -// content: {}, -// files: {}, -// idx: 6 } -``` - -### [.parse](index.js#L697) - -Parse the given `str` with the given `options`. - -**Params** - -* `str` **{String}** -* `options` **{Object}** -* `returns` **{Object}**: Returns an AST - -**Example** - -```js -var nm = require('nanomatch'); -nm.parse(pattern[, options]); - -var ast = nm.parse('a/{b,c}/d'); -console.log(ast); -// { type: 'root', -// errors: [], -// input: 'a/{b,c}/d', -// nodes: -// [ { type: 'bos', val: '' }, -// { type: 'text', val: 'a/' }, -// { type: 'brace', -// nodes: -// [ { type: 'brace.open', val: '{' }, -// { type: 'text', val: 'b,c' }, -// { type: 'brace.close', val: '}' } ] }, -// { type: 'text', val: '/d' }, -// { type: 'eos', val: '' } ] } -``` - -### [.compile](index.js#L745) - -Compile the given `ast` or string with the given `options`. - -**Params** - -* `ast` **{Object|String}** -* `options` **{Object}** -* `returns` **{Object}**: Returns an object that has an `output` property with the compiled string. - -**Example** - -```js -var nm = require('nanomatch'); -nm.compile(ast[, options]); - -var ast = nm.parse('a/{b,c}/d'); -console.log(nm.compile(ast)); -// { options: { source: 'string' }, -// state: {}, -// compilers: -// { eos: [Function], -// noop: [Function], -// bos: [Function], -// brace: [Function], -// 'brace.open': [Function], -// text: [Function], -// 'brace.close': [Function] }, -// output: [ 'a/(b|c)/d' ], -// ast: -// { ... }, -// parsingErrors: [] } -``` - -### [.clearCache](index.js#L768) - -Clear the regex cache. - -**Example** - -```js -nm.clearCache(); -``` - -## Options - -
    -basename - -### options.basename - -Allow glob patterns without slashes to match a file path based on its basename. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `matchBase`. - -Type: `boolean` - -Default: `false` - -**Example** - -```js -nm(['a/b.js', 'a/c.md'], '*.js'); -//=> [] - -nm(['a/b.js', 'a/c.md'], '*.js', {matchBase: true}); -//=> ['a/b.js'] -``` - -
    - -
    -bash - -### options.bash - -Enabled by default, this option enforces bash-like behavior with stars immediately following a bracket expression. Bash bracket expressions are similar to regex character classes, but unlike regex, a star following a bracket expression **does not repeat the bracketed characters**. Instead, the star is treated the same as an other star. - -Type: `boolean` - -Default: `true` - -**Example** - -```js -var files = ['abc', 'ajz']; -console.log(nm(files, '[a-c]*')); -//=> ['abc', 'ajz'] - -console.log(nm(files, '[a-c]*', {bash: false})); -``` - -
    - -
    -cache - -### options.cache - -Disable regex and function memoization. - -Type: `boolean` - -Default: `undefined` - -
    - -
    -dot - -### options.dot - -Match dotfiles. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `dot`. - -Type: `boolean` - -Default: `false` - -
    - -
    -failglob - -### options.failglob - -Similar to the `--failglob` behavior in Bash, throws an error when no matches are found. - -Type: `boolean` - -Default: `undefined` - -
    - -
    -ignore - -### options.ignore - -String or array of glob patterns to match files to ignore. - -Type: `String|Array` - -Default: `undefined` - -
    - -
    -matchBase - -### options.matchBase - -Alias for [options.basename](#options-basename). - -
    - -
    -nocase - -### options.nocase - -Use a case-insensitive regex for matching files. Same behavior as [minimatch](https://github.com/isaacs/minimatch). - -Type: `boolean` - -Default: `undefined` - -
    - -
    -nodupes - -### options.nodupes - -Remove duplicate elements from the result array. - -Type: `boolean` - -Default: `true` (enabled by default) - -**Example** - -Example of using the `unescape` and `nodupes` options together: - -```js -nm.match(['a/b/c', 'a/b/c'], '**'); -//=> ['abc'] - -nm.match(['a/b/c', 'a/b/c'], '**', {nodupes: false}); -//=> ['a/b/c', 'a/b/c'] -``` - -
    - -
    -nonegate - -### options.noglobstar - -Disable matching with globstars (`**`). - -Type: `boolean` - -Default: `undefined` - -```js -nm(['a/b', 'a/b/c', 'a/b/c/d'], 'a/**'); -//=> ['a/b', 'a/b/c', 'a/b/c/d'] - -nm(['a/b', 'a/b/c', 'a/b/c/d'], 'a/**', {noglobstar: true}); -//=> ['a/b'] -``` - -
    - -
    -nonegate - -### options.nonegate - -Disallow negation (`!`) patterns, and treat leading `!` as a literal character to match. - -Type: `boolean` - -Default: `undefined` - -
    - -
    -nonull - -### options.nonull - -Alias for [options.nullglob](#options-nullglob). - -
    - -
    -nullglob - -### options.nullglob - -If `true`, when no matches are found the actual (arrayified) glob pattern is returned instead of an empty array. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `nonull`. - -Type: `boolean` - -Default: `undefined` - -
    - -
    -slash - -### options.slash - -Customize the slash character(s) to use for matching. - -Type: `string|function` - -Default: `[/\\]` (forward slash and backslash) - -
    - -
    -star - -### options.star - -Customize the star character(s) to use for matching. It's not recommended that you modify this unless you have advanced knowledge of the compiler and matching rules. - -Type: `string|function` - -Default: `[^/\\]*?` - -
    - -
    -snapdragon - -### options.snapdragon - -Pass your own instance of [snapdragon](https://github.com/jonschlinkert/snapdragon) to customize parsers or compilers. - -Type: `object` - -Default: `undefined` - -
    - -
    -snapdragon - -### options.sourcemap - -Generate a source map by enabling the `sourcemap` option with the `.parse`, `.compile`, or `.create` methods. - -**Examples** - -```js -var nm = require('nanomatch'); - -var res = nm.create('abc/*.js', {sourcemap: true}); -console.log(res.map); -// { version: 3, -// sources: [ 'string' ], -// names: [], -// mappings: 'AAAA,GAAG,EAAC,iBAAC,EAAC,EAAE', -// sourcesContent: [ 'abc/*.js' ] } - -var ast = nm.parse('abc/**/*.js'); -var res = nm.compile(ast, {sourcemap: true}); -console.log(res.map); -// { version: 3, -// sources: [ 'string' ], -// names: [], -// mappings: 'AAAA,GAAG,EAAC,2BAAE,EAAC,iBAAC,EAAC,EAAE', -// sourcesContent: [ 'abc/**/*.js' ] } -``` - -
    - -
    -unescape - -### options.unescape - -Remove backslashes from returned matches. - -Type: `boolean` - -Default: `undefined` - -**Example** - -In this example we want to match a literal `*`: - -```js -nm.match(['abc', 'a\\*c'], 'a\\*c'); -//=> ['a\\*c'] - -nm.match(['abc', 'a\\*c'], 'a\\*c', {unescape: true}); -//=> ['a*c'] -``` - -
    - -
    -unixify - -### options.unixify - -Convert path separators on returned files to posix/unix-style forward slashes. - -Type: `boolean` - -Default: `true` - -**Example** - -```js -nm.match(['a\\b\\c'], 'a/**'); -//=> ['a/b/c'] - -nm.match(['a\\b\\c'], {unixify: false}); -//=> ['a\\b\\c'] -``` - -
    - -## Features - -Nanomatch has full support for standard Bash glob features, including the following "metacharacters": `*`, `**`, `?` and `[...]`. - -Here are some examples of how they work: - -| **Pattern** | **Description** | -| --- | --- | -| `*` | Matches any string except for `/`, leading `.`, or `/.` inside a path | -| `**` | Matches any string including `/`, but not a leading `.` or `/.` inside a path. More than two stars (e.g. `***` is treated the same as one star, and `**` loses its special meaning | when it's not the only thing in a path segment, per Bash specifications) | -| `foo*` | Matches any string beginning with `foo` | -| `*bar*` | Matches any string containing `bar` (beginning, middle or end) | -| `*.min.js` | Matches any string ending with `.min.js` | -| `[abc]*.js` | Matches any string beginning with `a`, `b`, or `c` and ending with `.js` | -| `abc?` | Matches `abcd` or `abcz` but not `abcde` | - -The exceptions noted for `*` apply to all patterns that contain a `*`. - -**Not supported** - -The following extended-globbing features are not supported: - -* [brace expansion](https://github.com/jonschlinkert/braces) (e.g. `{a,b,c}`) -* [extglobs](https://github.com/jonschlinkert/extglob) (e.g. `@(a|!(c|d))`) -* [POSIX brackets](https://github.com/jonschlinkert/expand-brackets) (e.g. `[[:alpha:][:digit:]]`) - -If you need any of these features consider using [micromatch](https://github.com/micromatch/micromatch) instead. - -## Bash expansion libs - -Nanomatch is part of a suite of libraries aimed at bringing the power and expressiveness of [Bash's](https://www.gnu.org/software/bash/) matching and expansion capabilities to JavaScript, _and - as you can see by the [benchmarks](#benchmarks) - without sacrificing speed_. - -| **Related library** | **Matching Type** | **Example** | **Description** | -| --- | --- | --- | --- | -| `nanomatch` (you are here) | Wildcards | `*` | [Filename expansion](https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html#Filename-Expansion), also referred to as globbing and pathname expansion, allows the use of [wildcards](#features) for matching. | -| [expand-tilde](https://github.com/jonschlinkert/expand-tilde) | Tildes | `~` | [Tilde expansion](https://www.gnu.org/software/bash/manual/html_node/Tilde-Expansion.html#Tilde-Expansion) converts the leading tilde in a file path to the user home directory. | -| [braces](https://github.com/jonschlinkert/braces) | Braces | `{a,b,c}` | [Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html) | -| [expand-brackets](https://github.com/jonschlinkert/expand-brackets) | Brackets | `[[:alpha:]]` | [POSIX character classes](https://www.gnu.org/software/grep/manual/html_node/Character-Classes-and-Bracket-Expressions.html) (also referred to as POSIX brackets, or POSIX character classes) | -| [extglob](https://github.com/jonschlinkert/extglob) | Parens | `!(a\ | b)` | [Extglobs](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html#Pattern-Matching) | -| [micromatch](https://github.com/micromatch/micromatch) | All | all | Micromatch is built on top of the other libraries. | - -There are many resources available on the web if you want to dive deeper into how these features work in Bash. - -## Benchmarks - -### Running benchmarks - -Install dev dependencies: - -```bash -npm i -d && node benchmark -``` - -### Nanomatch vs. Minimatch vs. Multimatch - -```bash -# globstar-basic (182 bytes) - minimatch x 69,512 ops/sec ±1.92% (88 runs sampled) - multimatch x 63,376 ops/sec ±1.41% (89 runs sampled) - nanomatch x 432,451 ops/sec ±0.92% (88 runs sampled) - - fastest is nanomatch (by 651% avg) - -# large-list-globstar (485686 bytes) - minimatch x 34.02 ops/sec ±1.42% (59 runs sampled) - multimatch x 33.58 ops/sec ±1.97% (58 runs sampled) - nanomatch x 483 ops/sec ±1.06% (86 runs sampled) - - fastest is nanomatch (by 1429% avg) - -# long-list-globstar (194085 bytes) - minimatch x 383 ops/sec ±0.74% (90 runs sampled) - multimatch x 378 ops/sec ±0.59% (89 runs sampled) - nanomatch x 990 ops/sec ±1.14% (85 runs sampled) - - fastest is nanomatch (by 260% avg) - -# negation-basic (132 bytes) - minimatch x 242,145 ops/sec ±1.17% (89 runs sampled) - multimatch x 76,403 ops/sec ±0.78% (92 runs sampled) - nanomatch x 537,253 ops/sec ±1.44% (86 runs sampled) - - fastest is nanomatch (by 337% avg) - -# not-glob-basic (93 bytes) - minimatch x 252,402 ops/sec ±1.33% (89 runs sampled) - multimatch x 209,954 ops/sec ±1.30% (90 runs sampled) - nanomatch x 1,716,468 ops/sec ±1.13% (86 runs sampled) - - fastest is nanomatch (by 742% avg) - -# star-basic (93 bytes) - minimatch x 182,780 ops/sec ±1.41% (91 runs sampled) - multimatch x 153,210 ops/sec ±0.72% (89 runs sampled) - nanomatch x 599,621 ops/sec ±1.22% (90 runs sampled) - - fastest is nanomatch (by 357% avg) - -``` - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards. - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    - -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [extglob](https://www.npmjs.com/package/extglob): Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob… [more](https://github.com/micromatch/extglob) | [homepage](https://github.com/micromatch/extglob "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.") -* [is-extglob](https://www.npmjs.com/package/is-extglob): Returns true if a string has an extglob. | [homepage](https://github.com/jonschlinkert/is-extglob "Returns true if a string has an extglob.") -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") -* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/micromatch/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 164 | [jonschlinkert](https://github.com/jonschlinkert) | -| 1 | [devongovett](https://github.com/devongovett) | - -### Author - -**Jon Schlinkert** - -* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on February 18, 2018._ \ No newline at end of file diff --git a/node_modules/nanomatch/index.js b/node_modules/nanomatch/index.js deleted file mode 100644 index dddc6128e..000000000 --- a/node_modules/nanomatch/index.js +++ /dev/null @@ -1,838 +0,0 @@ -'use strict'; - -/** - * Module dependencies - */ - -var util = require('util'); -var toRegex = require('to-regex'); -var extend = require('extend-shallow'); - -/** - * Local dependencies - */ - -var compilers = require('./lib/compilers'); -var parsers = require('./lib/parsers'); -var cache = require('./lib/cache'); -var utils = require('./lib/utils'); -var MAX_LENGTH = 1024 * 64; - -/** - * The main function takes a list of strings and one or more - * glob patterns to use for matching. - * - * ```js - * var nm = require('nanomatch'); - * nm(list, patterns[, options]); - * - * console.log(nm(['a.js', 'a.txt'], ['*.js'])); - * //=> [ 'a.js' ] - * ``` - * @param {Array} `list` A list of strings to match - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Array} Returns an array of matches - * @summary false - * @api public - */ - -function nanomatch(list, patterns, options) { - patterns = utils.arrayify(patterns); - list = utils.arrayify(list); - - var len = patterns.length; - if (list.length === 0 || len === 0) { - return []; - } - - if (len === 1) { - return nanomatch.match(list, patterns[0], options); - } - - var negated = false; - var omit = []; - var keep = []; - var idx = -1; - - while (++idx < len) { - var pattern = patterns[idx]; - - if (typeof pattern === 'string' && pattern.charCodeAt(0) === 33 /* ! */) { - omit.push.apply(omit, nanomatch.match(list, pattern.slice(1), options)); - negated = true; - } else { - keep.push.apply(keep, nanomatch.match(list, pattern, options)); - } - } - - // minimatch.match parity - if (negated && keep.length === 0) { - if (options && options.unixify === false) { - keep = list.slice(); - } else { - var unixify = utils.unixify(options); - for (var i = 0; i < list.length; i++) { - keep.push(unixify(list[i])); - } - } - } - - var matches = utils.diff(keep, omit); - if (!options || options.nodupes !== false) { - return utils.unique(matches); - } - - return matches; -} - -/** - * Similar to the main function, but `pattern` must be a string. - * - * ```js - * var nm = require('nanomatch'); - * nm.match(list, pattern[, options]); - * - * console.log(nm.match(['a.a', 'a.aa', 'a.b', 'a.c'], '*.a')); - * //=> ['a.a', 'a.aa'] - * ``` - * @param {Array} `list` Array of strings to match - * @param {String} `pattern` Glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Array} Returns an array of matches - * @api public - */ - -nanomatch.match = function(list, pattern, options) { - if (Array.isArray(pattern)) { - throw new TypeError('expected pattern to be a string'); - } - - var unixify = utils.unixify(options); - var isMatch = memoize('match', pattern, options, nanomatch.matcher); - var matches = []; - - list = utils.arrayify(list); - var len = list.length; - var idx = -1; - - while (++idx < len) { - var ele = list[idx]; - if (ele === pattern || isMatch(ele)) { - matches.push(utils.value(ele, unixify, options)); - } - } - - // if no options were passed, uniquify results and return - if (typeof options === 'undefined') { - return utils.unique(matches); - } - - if (matches.length === 0) { - if (options.failglob === true) { - throw new Error('no matches found for "' + pattern + '"'); - } - if (options.nonull === true || options.nullglob === true) { - return [options.unescape ? utils.unescape(pattern) : pattern]; - } - } - - // if `opts.ignore` was defined, diff ignored list - if (options.ignore) { - matches = nanomatch.not(matches, options.ignore, options); - } - - return options.nodupes !== false ? utils.unique(matches) : matches; -}; - -/** - * Returns true if the specified `string` matches the given glob `pattern`. - * - * ```js - * var nm = require('nanomatch'); - * nm.isMatch(string, pattern[, options]); - * - * console.log(nm.isMatch('a.a', '*.a')); - * //=> true - * console.log(nm.isMatch('a.b', '*.a')); - * //=> false - * ``` - * @param {String} `string` String to match - * @param {String} `pattern` Glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if the string matches the glob pattern. - * @api public - */ - -nanomatch.isMatch = function(str, pattern, options) { - if (typeof str !== 'string') { - throw new TypeError('expected a string: "' + util.inspect(str) + '"'); - } - - if (utils.isEmptyString(str) || utils.isEmptyString(pattern)) { - return false; - } - - var equals = utils.equalsPattern(options); - if (equals(str)) { - return true; - } - - var isMatch = memoize('isMatch', pattern, options, nanomatch.matcher); - return isMatch(str); -}; - -/** - * Returns true if some of the elements in the given `list` match any of the - * given glob `patterns`. - * - * ```js - * var nm = require('nanomatch'); - * nm.some(list, patterns[, options]); - * - * console.log(nm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); - * // true - * console.log(nm.some(['foo.js'], ['*.js', '!foo.js'])); - * // false - * ``` - * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -nanomatch.some = function(list, patterns, options) { - if (typeof list === 'string') { - list = [list]; - } - - for (var i = 0; i < list.length; i++) { - if (nanomatch(list[i], patterns, options).length === 1) { - return true; - } - } - - return false; -}; - -/** - * Returns true if every element in the given `list` matches - * at least one of the given glob `patterns`. - * - * ```js - * var nm = require('nanomatch'); - * nm.every(list, patterns[, options]); - * - * console.log(nm.every('foo.js', ['foo.js'])); - * // true - * console.log(nm.every(['foo.js', 'bar.js'], ['*.js'])); - * // true - * console.log(nm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); - * // false - * console.log(nm.every(['foo.js'], ['*.js', '!foo.js'])); - * // false - * ``` - * @param {String|Array} `list` The string or array of strings to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -nanomatch.every = function(list, patterns, options) { - if (typeof list === 'string') { - list = [list]; - } - - for (var i = 0; i < list.length; i++) { - if (nanomatch(list[i], patterns, options).length !== 1) { - return false; - } - } - - return true; -}; - -/** - * Returns true if **any** of the given glob `patterns` - * match the specified `string`. - * - * ```js - * var nm = require('nanomatch'); - * nm.any(string, patterns[, options]); - * - * console.log(nm.any('a.a', ['b.*', '*.a'])); - * //=> true - * console.log(nm.any('a.a', 'b.*')); - * //=> false - * ``` - * @param {String|Array} `str` The string to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -nanomatch.any = function(str, patterns, options) { - if (typeof str !== 'string') { - throw new TypeError('expected a string: "' + util.inspect(str) + '"'); - } - - if (utils.isEmptyString(str) || utils.isEmptyString(patterns)) { - return false; - } - - if (typeof patterns === 'string') { - patterns = [patterns]; - } - - for (var i = 0; i < patterns.length; i++) { - if (nanomatch.isMatch(str, patterns[i], options)) { - return true; - } - } - return false; -}; - -/** - * Returns true if **all** of the given `patterns` - * match the specified string. - * - * ```js - * var nm = require('nanomatch'); - * nm.all(string, patterns[, options]); - * - * console.log(nm.all('foo.js', ['foo.js'])); - * // true - * - * console.log(nm.all('foo.js', ['*.js', '!foo.js'])); - * // false - * - * console.log(nm.all('foo.js', ['*.js', 'foo.js'])); - * // true - * - * console.log(nm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); - * // true - * ``` - * @param {String|Array} `str` The string to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -nanomatch.all = function(str, patterns, options) { - if (typeof str !== 'string') { - throw new TypeError('expected a string: "' + util.inspect(str) + '"'); - } - - if (typeof patterns === 'string') { - patterns = [patterns]; - } - - for (var i = 0; i < patterns.length; i++) { - if (!nanomatch.isMatch(str, patterns[i], options)) { - return false; - } - } - return true; -}; - -/** - * Returns a list of strings that _**do not match any**_ of the given `patterns`. - * - * ```js - * var nm = require('nanomatch'); - * nm.not(list, patterns[, options]); - * - * console.log(nm.not(['a.a', 'b.b', 'c.c'], '*.a')); - * //=> ['b.b', 'c.c'] - * ``` - * @param {Array} `list` Array of strings to match. - * @param {String|Array} `patterns` One or more glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Array} Returns an array of strings that **do not match** the given patterns. - * @api public - */ - -nanomatch.not = function(list, patterns, options) { - var opts = extend({}, options); - var ignore = opts.ignore; - delete opts.ignore; - - list = utils.arrayify(list); - - var matches = utils.diff(list, nanomatch(list, patterns, opts)); - if (ignore) { - matches = utils.diff(matches, nanomatch(list, ignore)); - } - - return opts.nodupes !== false ? utils.unique(matches) : matches; -}; - -/** - * Returns true if the given `string` contains the given pattern. Similar - * to [.isMatch](#isMatch) but the pattern can match any part of the string. - * - * ```js - * var nm = require('nanomatch'); - * nm.contains(string, pattern[, options]); - * - * console.log(nm.contains('aa/bb/cc', '*b')); - * //=> true - * console.log(nm.contains('aa/bb/cc', '*d')); - * //=> false - * ``` - * @param {String} `str` The string to match. - * @param {String|Array} `patterns` Glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if the patter matches any part of `str`. - * @api public - */ - -nanomatch.contains = function(str, patterns, options) { - if (typeof str !== 'string') { - throw new TypeError('expected a string: "' + util.inspect(str) + '"'); - } - - if (typeof patterns === 'string') { - if (utils.isEmptyString(str) || utils.isEmptyString(patterns)) { - return false; - } - - var equals = utils.equalsPattern(patterns, options); - if (equals(str)) { - return true; - } - var contains = utils.containsPattern(patterns, options); - if (contains(str)) { - return true; - } - } - - var opts = extend({}, options, {contains: true}); - return nanomatch.any(str, patterns, opts); -}; - -/** - * Returns true if the given pattern and options should enable - * the `matchBase` option. - * @return {Boolean} - * @api private - */ - -nanomatch.matchBase = function(pattern, options) { - if (pattern && pattern.indexOf('/') !== -1 || !options) return false; - return options.basename === true || options.matchBase === true; -}; - -/** - * Filter the keys of the given object with the given `glob` pattern - * and `options`. Does not attempt to match nested keys. If you need this feature, - * use [glob-object][] instead. - * - * ```js - * var nm = require('nanomatch'); - * nm.matchKeys(object, patterns[, options]); - * - * var obj = { aa: 'a', ab: 'b', ac: 'c' }; - * console.log(nm.matchKeys(obj, '*b')); - * //=> { ab: 'b' } - * ``` - * @param {Object} `object` The object with keys to filter. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Object} Returns an object with only keys that match the given patterns. - * @api public - */ - -nanomatch.matchKeys = function(obj, patterns, options) { - if (!utils.isObject(obj)) { - throw new TypeError('expected the first argument to be an object'); - } - var keys = nanomatch(Object.keys(obj), patterns, options); - return utils.pick(obj, keys); -}; - -/** - * Returns a memoized matcher function from the given glob `pattern` and `options`. - * The returned function takes a string to match as its only argument and returns - * true if the string is a match. - * - * ```js - * var nm = require('nanomatch'); - * nm.matcher(pattern[, options]); - * - * var isMatch = nm.matcher('*.!(*a)'); - * console.log(isMatch('a.a')); - * //=> false - * console.log(isMatch('a.b')); - * //=> true - * ``` - * @param {String} `pattern` Glob pattern - * @param {Object} `options` See available [options](#options) for changing how matches are performed. - * @return {Function} Returns a matcher function. - * @api public - */ - -nanomatch.matcher = function matcher(pattern, options) { - if (utils.isEmptyString(pattern)) { - return function() { - return false; - }; - } - - if (Array.isArray(pattern)) { - return compose(pattern, options, matcher); - } - - // if pattern is a regex - if (pattern instanceof RegExp) { - return test(pattern); - } - - // if pattern is invalid - if (!utils.isString(pattern)) { - throw new TypeError('expected pattern to be an array, string or regex'); - } - - // if pattern is a non-glob string - if (!utils.hasSpecialChars(pattern)) { - if (options && options.nocase === true) { - pattern = pattern.toLowerCase(); - } - return utils.matchPath(pattern, options); - } - - // if pattern is a glob string - var re = nanomatch.makeRe(pattern, options); - - // if `options.matchBase` or `options.basename` is defined - if (nanomatch.matchBase(pattern, options)) { - return utils.matchBasename(re, options); - } - - function test(regex) { - var equals = utils.equalsPattern(options); - var unixify = utils.unixify(options); - - return function(str) { - if (equals(str)) { - return true; - } - - if (regex.test(unixify(str))) { - return true; - } - return false; - }; - } - - // create matcher function - var matcherFn = test(re); - // set result object from compiler on matcher function, - // as a non-enumerable property. useful for debugging - utils.define(matcherFn, 'result', re.result); - return matcherFn; -}; - -/** - * Returns an array of matches captured by `pattern` in `string, or - * `null` if the pattern did not match. - * - * ```js - * var nm = require('nanomatch'); - * nm.capture(pattern, string[, options]); - * - * console.log(nm.capture('test/*.js', 'test/foo.js')); - * //=> ['foo'] - * console.log(nm.capture('test/*.js', 'foo/bar.css')); - * //=> null - * ``` - * @param {String} `pattern` Glob pattern to use for matching. - * @param {String} `string` String to match - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns an array of captures if the string matches the glob pattern, otherwise `null`. - * @api public - */ - -nanomatch.capture = function(pattern, str, options) { - var re = nanomatch.makeRe(pattern, extend({capture: true}, options)); - var unixify = utils.unixify(options); - - function match() { - return function(string) { - var match = re.exec(unixify(string)); - if (!match) { - return null; - } - - return match.slice(1); - }; - } - - var capture = memoize('capture', pattern, options, match); - return capture(str); -}; - -/** - * Create a regular expression from the given glob `pattern`. - * - * ```js - * var nm = require('nanomatch'); - * nm.makeRe(pattern[, options]); - * - * console.log(nm.makeRe('*.js')); - * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ - * ``` - * @param {String} `pattern` A glob pattern to convert to regex. - * @param {Object} `options` See available [options](#options) for changing how matches are performed. - * @return {RegExp} Returns a regex created from the given pattern. - * @api public - */ - -nanomatch.makeRe = function(pattern, options) { - if (pattern instanceof RegExp) { - return pattern; - } - - if (typeof pattern !== 'string') { - throw new TypeError('expected pattern to be a string'); - } - - if (pattern.length > MAX_LENGTH) { - throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters'); - } - - function makeRe() { - var opts = utils.extend({wrap: false}, options); - var result = nanomatch.create(pattern, opts); - var regex = toRegex(result.output, opts); - utils.define(regex, 'result', result); - return regex; - } - - return memoize('makeRe', pattern, options, makeRe); -}; - -/** - * Parses the given glob `pattern` and returns an object with the compiled `output` - * and optional source `map`. - * - * ```js - * var nm = require('nanomatch'); - * nm.create(pattern[, options]); - * - * console.log(nm.create('abc/*.js')); - * // { options: { source: 'string', sourcemap: true }, - * // state: {}, - * // compilers: - * // { ... }, - * // output: '(\\.[\\\\\\/])?abc\\/(?!\\.)(?=.)[^\\/]*?\\.js', - * // ast: - * // { type: 'root', - * // errors: [], - * // nodes: - * // [ ... ], - * // dot: false, - * // input: 'abc/*.js' }, - * // parsingErrors: [], - * // map: - * // { version: 3, - * // sources: [ 'string' ], - * // names: [], - * // mappings: 'AAAA,GAAG,EAAC,kBAAC,EAAC,EAAE', - * // sourcesContent: [ 'abc/*.js' ] }, - * // position: { line: 1, column: 28 }, - * // content: {}, - * // files: {}, - * // idx: 6 } - * ``` - * @param {String} `pattern` Glob pattern to parse and compile. - * @param {Object} `options` Any [options](#options) to change how parsing and compiling is performed. - * @return {Object} Returns an object with the parsed AST, compiled string and optional source map. - * @api public - */ - -nanomatch.create = function(pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('expected a string'); - } - function create() { - return nanomatch.compile(nanomatch.parse(pattern, options), options); - } - return memoize('create', pattern, options, create); -}; - -/** - * Parse the given `str` with the given `options`. - * - * ```js - * var nm = require('nanomatch'); - * nm.parse(pattern[, options]); - * - * var ast = nm.parse('a/{b,c}/d'); - * console.log(ast); - * // { type: 'root', - * // errors: [], - * // input: 'a/{b,c}/d', - * // nodes: - * // [ { type: 'bos', val: '' }, - * // { type: 'text', val: 'a/' }, - * // { type: 'brace', - * // nodes: - * // [ { type: 'brace.open', val: '{' }, - * // { type: 'text', val: 'b,c' }, - * // { type: 'brace.close', val: '}' } ] }, - * // { type: 'text', val: '/d' }, - * // { type: 'eos', val: '' } ] } - * ``` - * @param {String} `str` - * @param {Object} `options` - * @return {Object} Returns an AST - * @api public - */ - -nanomatch.parse = function(pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('expected a string'); - } - - function parse() { - var snapdragon = utils.instantiate(null, options); - parsers(snapdragon, options); - - var ast = snapdragon.parse(pattern, options); - utils.define(ast, 'snapdragon', snapdragon); - ast.input = pattern; - return ast; - } - - return memoize('parse', pattern, options, parse); -}; - -/** - * Compile the given `ast` or string with the given `options`. - * - * ```js - * var nm = require('nanomatch'); - * nm.compile(ast[, options]); - * - * var ast = nm.parse('a/{b,c}/d'); - * console.log(nm.compile(ast)); - * // { options: { source: 'string' }, - * // state: {}, - * // compilers: - * // { eos: [Function], - * // noop: [Function], - * // bos: [Function], - * // brace: [Function], - * // 'brace.open': [Function], - * // text: [Function], - * // 'brace.close': [Function] }, - * // output: [ 'a/(b|c)/d' ], - * // ast: - * // { ... }, - * // parsingErrors: [] } - * ``` - * @param {Object|String} `ast` - * @param {Object} `options` - * @return {Object} Returns an object that has an `output` property with the compiled string. - * @api public - */ - -nanomatch.compile = function(ast, options) { - if (typeof ast === 'string') { - ast = nanomatch.parse(ast, options); - } - - function compile() { - var snapdragon = utils.instantiate(ast, options); - compilers(snapdragon, options); - return snapdragon.compile(ast, options); - } - - return memoize('compile', ast.input, options, compile); -}; - -/** - * Clear the regex cache. - * - * ```js - * nm.clearCache(); - * ``` - * @api public - */ - -nanomatch.clearCache = function() { - nanomatch.cache.__data__ = {}; -}; - -/** - * Compose a matcher function with the given patterns. - * This allows matcher functions to be compiled once and - * called multiple times. - */ - -function compose(patterns, options, matcher) { - var matchers; - - return memoize('compose', String(patterns), options, function() { - return function(file) { - // delay composition until it's invoked the first time, - // after that it won't be called again - if (!matchers) { - matchers = []; - for (var i = 0; i < patterns.length; i++) { - matchers.push(matcher(patterns[i], options)); - } - } - - var len = matchers.length; - while (len--) { - if (matchers[len](file) === true) { - return true; - } - } - return false; - }; - }); -} - -/** - * Memoize a generated regex or function. A unique key is generated - * from the `type` (usually method name), the `pattern`, and - * user-defined options. - */ - -function memoize(type, pattern, options, fn) { - var key = utils.createKey(type + '=' + pattern, options); - - if (options && options.cache === false) { - return fn(pattern, options); - } - - if (cache.has(type, key)) { - return cache.get(type, key); - } - - var val = fn(pattern, options); - cache.set(type, key, val); - return val; -} - -/** - * Expose compiler, parser and cache on `nanomatch` - */ - -nanomatch.compilers = compilers; -nanomatch.parsers = parsers; -nanomatch.cache = cache; - -/** - * Expose `nanomatch` - * @type {Function} - */ - -module.exports = nanomatch; diff --git a/node_modules/nanomatch/lib/cache.js b/node_modules/nanomatch/lib/cache.js deleted file mode 100644 index fffc4c17a..000000000 --- a/node_modules/nanomatch/lib/cache.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = new (require('fragment-cache'))(); diff --git a/node_modules/nanomatch/lib/compilers.js b/node_modules/nanomatch/lib/compilers.js deleted file mode 100644 index d7a786e7a..000000000 --- a/node_modules/nanomatch/lib/compilers.js +++ /dev/null @@ -1,339 +0,0 @@ -'use strict'; - -/** -* Nanomatch compilers -*/ - -module.exports = function(nanomatch, options) { - function slash() { - if (options && typeof options.slash === 'string') { - return options.slash; - } - if (options && typeof options.slash === 'function') { - return options.slash.call(nanomatch); - } - return '\\\\/'; - } - - function star() { - if (options && typeof options.star === 'string') { - return options.star; - } - if (options && typeof options.star === 'function') { - return options.star.call(nanomatch); - } - return '[^' + slash() + ']*?'; - } - - var ast = nanomatch.ast = nanomatch.parser.ast; - ast.state = nanomatch.parser.state; - nanomatch.compiler.state = ast.state; - nanomatch.compiler - - /** - * Negation / escaping - */ - - .set('not', function(node) { - var prev = this.prev(); - if (this.options.nonegate === true || prev.type !== 'bos') { - return this.emit('\\' + node.val, node); - } - return this.emit(node.val, node); - }) - .set('escape', function(node) { - if (this.options.unescape && /^[-\w_.]/.test(node.val)) { - return this.emit(node.val, node); - } - return this.emit('\\' + node.val, node); - }) - .set('quoted', function(node) { - return this.emit(node.val, node); - }) - - /** - * Regex - */ - - .set('dollar', function(node) { - if (node.parent.type === 'bracket') { - return this.emit(node.val, node); - } - return this.emit('\\' + node.val, node); - }) - - /** - * Dot: "." - */ - - .set('dot', function(node) { - if (node.dotfiles === true) this.dotfiles = true; - return this.emit('\\' + node.val, node); - }) - - /** - * Slashes: "/" and "\" - */ - - .set('backslash', function(node) { - return this.emit(node.val, node); - }) - .set('slash', function(node, nodes, i) { - var val = '[' + slash() + ']'; - var parent = node.parent; - var prev = this.prev(); - - // set "node.hasSlash" to true on all ancestor parens nodes - while (parent.type === 'paren' && !parent.hasSlash) { - parent.hasSlash = true; - parent = parent.parent; - } - - if (prev.addQmark) { - val += '?'; - } - - // word boundary - if (node.rest.slice(0, 2) === '\\b') { - return this.emit(val, node); - } - - // globstars - if (node.parsed === '**' || node.parsed === './**') { - this.output = '(?:' + this.output; - return this.emit(val + ')?', node); - } - - // negation - if (node.parsed === '!**' && this.options.nonegate !== true) { - return this.emit(val + '?\\b', node); - } - return this.emit(val, node); - }) - - /** - * Square brackets - */ - - .set('bracket', function(node) { - var close = node.close; - var open = !node.escaped ? '[' : '\\['; - var negated = node.negated; - var inner = node.inner; - var val = node.val; - - if (node.escaped === true) { - inner = inner.replace(/\\?(\W)/g, '\\$1'); - negated = ''; - } - - if (inner === ']-') { - inner = '\\]\\-'; - } - - if (negated && inner.indexOf('.') === -1) { - inner += '.'; - } - if (negated && inner.indexOf('/') === -1) { - inner += '/'; - } - - val = open + negated + inner + close; - return this.emit(val, node); - }) - - /** - * Square: "[.]" (only matches a single character in brackets) - */ - - .set('square', function(node) { - var val = (/^\W/.test(node.val) ? '\\' : '') + node.val; - return this.emit(val, node); - }) - - /** - * Question mark: "?" - */ - - .set('qmark', function(node) { - var prev = this.prev(); - // don't use "slash" variable so that we always avoid - // matching backslashes and slashes with a qmark - var val = '[^.\\\\/]'; - if (this.options.dot || (prev.type !== 'bos' && prev.type !== 'slash')) { - val = '[^\\\\/]'; - } - - if (node.parsed.slice(-1) === '(') { - var ch = node.rest.charAt(0); - if (ch === '!' || ch === '=' || ch === ':') { - return this.emit(node.val, node); - } - } - - if (node.val.length > 1) { - val += '{' + node.val.length + '}'; - } - return this.emit(val, node); - }) - - /** - * Plus - */ - - .set('plus', function(node) { - var prev = node.parsed.slice(-1); - if (prev === ']' || prev === ')') { - return this.emit(node.val, node); - } - if (!this.output || (/[?*+]/.test(ch) && node.parent.type !== 'bracket')) { - return this.emit('\\+', node); - } - var ch = this.output.slice(-1); - if (/\w/.test(ch) && !node.inside) { - return this.emit('+\\+?', node); - } - return this.emit('+', node); - }) - - /** - * globstar: '**' - */ - - .set('globstar', function(node, nodes, i) { - if (!this.output) { - this.state.leadingGlobstar = true; - } - - var prev = this.prev(); - var before = this.prev(2); - var next = this.next(); - var after = this.next(2); - var type = prev.type; - var val = node.val; - - if (prev.type === 'slash' && next.type === 'slash') { - if (before.type === 'text') { - this.output += '?'; - - if (after.type !== 'text') { - this.output += '\\b'; - } - } - } - - var parsed = node.parsed; - if (parsed.charAt(0) === '!') { - parsed = parsed.slice(1); - } - - var isInside = node.isInside.paren || node.isInside.brace; - if (parsed && type !== 'slash' && type !== 'bos' && !isInside) { - val = star(); - } else { - val = this.options.dot !== true - ? '(?:(?!(?:[' + slash() + ']|^)\\.).)*?' - : '(?:(?!(?:[' + slash() + ']|^)(?:\\.{1,2})($|[' + slash() + ']))(?!\\.{2}).)*?'; - } - - if ((type === 'slash' || type === 'bos') && this.options.dot !== true) { - val = '(?!\\.)' + val; - } - - if (prev.type === 'slash' && next.type === 'slash' && before.type !== 'text') { - if (after.type === 'text' || after.type === 'star') { - node.addQmark = true; - } - } - - if (this.options.capture) { - val = '(' + val + ')'; - } - - return this.emit(val, node); - }) - - /** - * Star: "*" - */ - - .set('star', function(node, nodes, i) { - var prior = nodes[i - 2] || {}; - var prev = this.prev(); - var next = this.next(); - var type = prev.type; - - function isStart(n) { - return n.type === 'bos' || n.type === 'slash'; - } - - if (this.output === '' && this.options.contains !== true) { - this.output = '(?![' + slash() + '])'; - } - - if (type === 'bracket' && this.options.bash === false) { - var str = next && next.type === 'bracket' ? star() : '*?'; - if (!prev.nodes || prev.nodes[1].type !== 'posix') { - return this.emit(str, node); - } - } - - var prefix = !this.dotfiles && type !== 'text' && type !== 'escape' - ? (this.options.dot ? '(?!(?:^|[' + slash() + '])\\.{1,2}(?:$|[' + slash() + ']))' : '(?!\\.)') - : ''; - - if (isStart(prev) || (isStart(prior) && type === 'not')) { - if (prefix !== '(?!\\.)') { - prefix += '(?!(\\.{2}|\\.[' + slash() + ']))(?=.)'; - } else { - prefix += '(?=.)'; - } - } else if (prefix === '(?!\\.)') { - prefix = ''; - } - - if (prev.type === 'not' && prior.type === 'bos' && this.options.dot === true) { - this.output = '(?!\\.)' + this.output; - } - - var output = prefix + star(); - if (this.options.capture) { - output = '(' + output + ')'; - } - - return this.emit(output, node); - }) - - /** - * Text - */ - - .set('text', function(node) { - return this.emit(node.val, node); - }) - - /** - * End-of-string - */ - - .set('eos', function(node) { - var prev = this.prev(); - var val = node.val; - - this.output = '(?:\\.[' + slash() + '](?=.))?' + this.output; - if (this.state.metachar && prev.type !== 'qmark' && prev.type !== 'slash') { - val += (this.options.contains ? '[' + slash() + ']?' : '(?:[' + slash() + ']|$)'); - } - - return this.emit(val, node); - }); - - /** - * Allow custom compilers to be passed on options - */ - - if (options && typeof options.compilers === 'function') { - options.compilers(nanomatch.compiler); - } -}; - diff --git a/node_modules/nanomatch/lib/parsers.js b/node_modules/nanomatch/lib/parsers.js deleted file mode 100644 index f87df8f34..000000000 --- a/node_modules/nanomatch/lib/parsers.js +++ /dev/null @@ -1,386 +0,0 @@ -'use strict'; - -var regexNot = require('regex-not'); -var toRegex = require('to-regex'); - -/** - * Characters to use in negation regex (we want to "not" match - * characters that are matched by other parsers) - */ - -var cached; -var NOT_REGEX = '[\\[!*+?$^"\'.\\\\/]+'; -var not = createTextRegex(NOT_REGEX); - -/** - * Nanomatch parsers - */ - -module.exports = function(nanomatch, options) { - var parser = nanomatch.parser; - var opts = parser.options; - - parser.state = { - slashes: 0, - paths: [] - }; - - parser.ast.state = parser.state; - parser - - /** - * Beginning-of-string - */ - - .capture('prefix', function() { - if (this.parsed) return; - var m = this.match(/^\.[\\/]/); - if (!m) return; - this.state.strictOpen = !!this.options.strictOpen; - this.state.addPrefix = true; - }) - - /** - * Escape: "\\." - */ - - .capture('escape', function() { - if (this.isInside('bracket')) return; - var pos = this.position(); - var m = this.match(/^(?:\\(.)|([$^]))/); - if (!m) return; - - return pos({ - type: 'escape', - val: m[2] || m[1] - }); - }) - - /** - * Quoted strings - */ - - .capture('quoted', function() { - var pos = this.position(); - var m = this.match(/^["']/); - if (!m) return; - - var quote = m[0]; - if (this.input.indexOf(quote) === -1) { - return pos({ - type: 'escape', - val: quote - }); - } - - var tok = advanceTo(this.input, quote); - this.consume(tok.len); - - return pos({ - type: 'quoted', - val: tok.esc - }); - }) - - /** - * Negations: "!" - */ - - .capture('not', function() { - var parsed = this.parsed; - var pos = this.position(); - var m = this.match(this.notRegex || /^!+/); - if (!m) return; - var val = m[0]; - - var isNegated = (val.length % 2) === 1; - if (parsed === '' && !isNegated) { - val = ''; - } - - // if nothing has been parsed, we know `!` is at the start, - // so we need to wrap the result in a negation regex - if (parsed === '' && isNegated && this.options.nonegate !== true) { - this.bos.val = '(?!^(?:'; - this.append = ')$).*'; - val = ''; - } - return pos({ - type: 'not', - val: val - }); - }) - - /** - * Dot: "." - */ - - .capture('dot', function() { - var parsed = this.parsed; - var pos = this.position(); - var m = this.match(/^\.+/); - if (!m) return; - - var val = m[0]; - this.state.dot = val === '.' && (parsed === '' || parsed.slice(-1) === '/'); - - return pos({ - type: 'dot', - dotfiles: this.state.dot, - val: val - }); - }) - - /** - * Plus: "+" - */ - - .capture('plus', /^\+(?!\()/) - - /** - * Question mark: "?" - */ - - .capture('qmark', function() { - var parsed = this.parsed; - var pos = this.position(); - var m = this.match(/^\?+(?!\()/); - if (!m) return; - - this.state.metachar = true; - this.state.qmark = true; - - return pos({ - type: 'qmark', - parsed: parsed, - val: m[0] - }); - }) - - /** - * Globstar: "**" - */ - - .capture('globstar', function() { - var parsed = this.parsed; - var pos = this.position(); - var m = this.match(/^\*{2}(?![*(])(?=[,)/]|$)/); - if (!m) return; - - var type = opts.noglobstar !== true ? 'globstar' : 'star'; - var node = pos({type: type, parsed: parsed}); - this.state.metachar = true; - - while (this.input.slice(0, 4) === '/**/') { - this.input = this.input.slice(3); - } - - node.isInside = { - brace: this.isInside('brace'), - paren: this.isInside('paren') - }; - - if (type === 'globstar') { - this.state.globstar = true; - node.val = '**'; - - } else { - this.state.star = true; - node.val = '*'; - } - - return node; - }) - - /** - * Star: "*" - */ - - .capture('star', function() { - var pos = this.position(); - var starRe = /^(?:\*(?![*(])|[*]{3,}(?!\()|[*]{2}(?![(/]|$)|\*(?=\*\())/; - var m = this.match(starRe); - if (!m) return; - - this.state.metachar = true; - this.state.star = true; - return pos({ - type: 'star', - val: m[0] - }); - }) - - /** - * Slash: "/" - */ - - .capture('slash', function() { - var pos = this.position(); - var m = this.match(/^\//); - if (!m) return; - - this.state.slashes++; - return pos({ - type: 'slash', - val: m[0] - }); - }) - - /** - * Backslash: "\\" - */ - - .capture('backslash', function() { - var pos = this.position(); - var m = this.match(/^\\(?![*+?(){}[\]'"])/); - if (!m) return; - - var val = m[0]; - - if (this.isInside('bracket')) { - val = '\\'; - } else if (val.length > 1) { - val = '\\\\'; - } - - return pos({ - type: 'backslash', - val: val - }); - }) - - /** - * Square: "[.]" - */ - - .capture('square', function() { - if (this.isInside('bracket')) return; - var pos = this.position(); - var m = this.match(/^\[([^!^\\])\]/); - if (!m) return; - - return pos({ - type: 'square', - val: m[1] - }); - }) - - /** - * Brackets: "[...]" (basic, this can be overridden by other parsers) - */ - - .capture('bracket', function() { - var pos = this.position(); - var m = this.match(/^(?:\[([!^]?)([^\]]+|\]-)(\]|[^*+?]+)|\[)/); - if (!m) return; - - var val = m[0]; - var negated = m[1] ? '^' : ''; - var inner = (m[2] || '').replace(/\\\\+/, '\\\\'); - var close = m[3] || ''; - - if (m[2] && inner.length < m[2].length) { - val = val.replace(/\\\\+/, '\\\\'); - } - - var esc = this.input.slice(0, 2); - if (inner === '' && esc === '\\]') { - inner += esc; - this.consume(2); - - var str = this.input; - var idx = -1; - var ch; - - while ((ch = str[++idx])) { - this.consume(1); - if (ch === ']') { - close = ch; - break; - } - inner += ch; - } - } - - return pos({ - type: 'bracket', - val: val, - escaped: close !== ']', - negated: negated, - inner: inner, - close: close - }); - }) - - /** - * Text - */ - - .capture('text', function() { - if (this.isInside('bracket')) return; - var pos = this.position(); - var m = this.match(not); - if (!m || !m[0]) return; - - return pos({ - type: 'text', - val: m[0] - }); - }); - - /** - * Allow custom parsers to be passed on options - */ - - if (options && typeof options.parsers === 'function') { - options.parsers(nanomatch.parser); - } -}; - -/** - * Advance to the next non-escaped character - */ - -function advanceTo(input, endChar) { - var ch = input.charAt(0); - var tok = { len: 1, val: '', esc: '' }; - var idx = 0; - - function advance() { - if (ch !== '\\') { - tok.esc += '\\' + ch; - tok.val += ch; - } - - ch = input.charAt(++idx); - tok.len++; - - if (ch === '\\') { - advance(); - advance(); - } - } - - while (ch && ch !== endChar) { - advance(); - } - return tok; -} - -/** - * Create text regex - */ - -function createTextRegex(pattern) { - if (cached) return cached; - var opts = {contains: true, strictClose: false}; - var not = regexNot.create(pattern, opts); - var re = toRegex('^(?:[*]\\((?=.)|' + not + ')', opts); - return (cached = re); -} - -/** - * Expose negation string - */ - -module.exports.not = NOT_REGEX; diff --git a/node_modules/nanomatch/lib/utils.js b/node_modules/nanomatch/lib/utils.js deleted file mode 100644 index 0cf1501d2..000000000 --- a/node_modules/nanomatch/lib/utils.js +++ /dev/null @@ -1,379 +0,0 @@ -'use strict'; - -var utils = module.exports; -var path = require('path'); - -/** - * Module dependencies - */ - -var isWindows = require('is-windows')(); -var Snapdragon = require('snapdragon'); -utils.define = require('define-property'); -utils.diff = require('arr-diff'); -utils.extend = require('extend-shallow'); -utils.pick = require('object.pick'); -utils.typeOf = require('kind-of'); -utils.unique = require('array-unique'); - -/** - * Returns true if the given value is effectively an empty string - */ - -utils.isEmptyString = function(val) { - return String(val) === '' || String(val) === './'; -}; - -/** - * Returns true if the platform is windows, or `path.sep` is `\\`. - * This is defined as a function to allow `path.sep` to be set in unit tests, - * or by the user, if there is a reason to do so. - * @return {Boolean} - */ - -utils.isWindows = function() { - return path.sep === '\\' || isWindows === true; -}; - -/** - * Return the last element from an array - */ - -utils.last = function(arr, n) { - return arr[arr.length - (n || 1)]; -}; - -/** - * Get the `Snapdragon` instance to use - */ - -utils.instantiate = function(ast, options) { - var snapdragon; - // if an instance was created by `.parse`, use that instance - if (utils.typeOf(ast) === 'object' && ast.snapdragon) { - snapdragon = ast.snapdragon; - // if the user supplies an instance on options, use that instance - } else if (utils.typeOf(options) === 'object' && options.snapdragon) { - snapdragon = options.snapdragon; - // create a new instance - } else { - snapdragon = new Snapdragon(options); - } - - utils.define(snapdragon, 'parse', function(str, options) { - var parsed = Snapdragon.prototype.parse.call(this, str, options); - parsed.input = str; - - // escape unmatched brace/bracket/parens - var last = this.parser.stack.pop(); - if (last && this.options.strictErrors !== true) { - var open = last.nodes[0]; - var inner = last.nodes[1]; - if (last.type === 'bracket') { - if (inner.val.charAt(0) === '[') { - inner.val = '\\' + inner.val; - } - - } else { - open.val = '\\' + open.val; - var sibling = open.parent.nodes[1]; - if (sibling.type === 'star') { - sibling.loose = true; - } - } - } - - // add non-enumerable parser reference - utils.define(parsed, 'parser', this.parser); - return parsed; - }); - - return snapdragon; -}; - -/** - * Create the key to use for memoization. The key is generated - * by iterating over the options and concatenating key-value pairs - * to the pattern string. - */ - -utils.createKey = function(pattern, options) { - if (typeof options === 'undefined') { - return pattern; - } - var key = pattern; - for (var prop in options) { - if (options.hasOwnProperty(prop)) { - key += ';' + prop + '=' + String(options[prop]); - } - } - return key; -}; - -/** - * Cast `val` to an array - * @return {Array} - */ - -utils.arrayify = function(val) { - if (typeof val === 'string') return [val]; - return val ? (Array.isArray(val) ? val : [val]) : []; -}; - -/** - * Return true if `val` is a non-empty string - */ - -utils.isString = function(val) { - return typeof val === 'string'; -}; - -/** - * Return true if `val` is a non-empty string - */ - -utils.isRegex = function(val) { - return utils.typeOf(val) === 'regexp'; -}; - -/** - * Return true if `val` is a non-empty string - */ - -utils.isObject = function(val) { - return utils.typeOf(val) === 'object'; -}; - -/** - * Escape regex characters in the given string - */ - -utils.escapeRegex = function(str) { - return str.replace(/[-[\]{}()^$|*+?.\\/\s]/g, '\\$&'); -}; - -/** - * Combines duplicate characters in the provided `input` string. - * @param {String} `input` - * @returns {String} - */ - -utils.combineDupes = function(input, patterns) { - patterns = utils.arrayify(patterns).join('|').split('|'); - patterns = patterns.map(function(s) { - return s.replace(/\\?([+*\\/])/g, '\\$1'); - }); - var substr = patterns.join('|'); - var regex = new RegExp('(' + substr + ')(?=\\1)', 'g'); - return input.replace(regex, ''); -}; - -/** - * Returns true if the given `str` has special characters - */ - -utils.hasSpecialChars = function(str) { - return /(?:(?:(^|\/)[!.])|[*?+()|[\]{}]|[+@]\()/.test(str); -}; - -/** - * Normalize slashes in the given filepath. - * - * @param {String} `filepath` - * @return {String} - */ - -utils.toPosixPath = function(str) { - return str.replace(/\\+/g, '/'); -}; - -/** - * Strip backslashes before special characters in a string. - * - * @param {String} `str` - * @return {String} - */ - -utils.unescape = function(str) { - return utils.toPosixPath(str.replace(/\\(?=[*+?!.])/g, '')); -}; - -/** - * Strip the drive letter from a windows filepath - * @param {String} `fp` - * @return {String} - */ - -utils.stripDrive = function(fp) { - return utils.isWindows() ? fp.replace(/^[a-z]:[\\/]+?/i, '/') : fp; -}; - -/** - * Strip the prefix from a filepath - * @param {String} `fp` - * @return {String} - */ - -utils.stripPrefix = function(str) { - if (str.charAt(0) === '.' && (str.charAt(1) === '/' || str.charAt(1) === '\\')) { - return str.slice(2); - } - return str; -}; - -/** - * Returns true if `str` is a common character that doesn't need - * to be processed to be used for matching. - * @param {String} `str` - * @return {Boolean} - */ - -utils.isSimpleChar = function(str) { - return str.trim() === '' || str === '.'; -}; - -/** - * Returns true if the given str is an escaped or - * unescaped path character - */ - -utils.isSlash = function(str) { - return str === '/' || str === '\\/' || str === '\\' || str === '\\\\'; -}; - -/** - * Returns a function that returns true if the given - * pattern matches or contains a `filepath` - * - * @param {String} `pattern` - * @return {Function} - */ - -utils.matchPath = function(pattern, options) { - return (options && options.contains) - ? utils.containsPattern(pattern, options) - : utils.equalsPattern(pattern, options); -}; - -/** - * Returns true if the given (original) filepath or unixified path are equal - * to the given pattern. - */ - -utils._equals = function(filepath, unixPath, pattern) { - return pattern === filepath || pattern === unixPath; -}; - -/** - * Returns true if the given (original) filepath or unixified path contain - * the given pattern. - */ - -utils._contains = function(filepath, unixPath, pattern) { - return filepath.indexOf(pattern) !== -1 || unixPath.indexOf(pattern) !== -1; -}; - -/** - * Returns a function that returns true if the given - * pattern is the same as a given `filepath` - * - * @param {String} `pattern` - * @return {Function} - */ - -utils.equalsPattern = function(pattern, options) { - var unixify = utils.unixify(options); - options = options || {}; - - return function fn(filepath) { - var equal = utils._equals(filepath, unixify(filepath), pattern); - if (equal === true || options.nocase !== true) { - return equal; - } - var lower = filepath.toLowerCase(); - return utils._equals(lower, unixify(lower), pattern); - }; -}; - -/** - * Returns a function that returns true if the given - * pattern contains a `filepath` - * - * @param {String} `pattern` - * @return {Function} - */ - -utils.containsPattern = function(pattern, options) { - var unixify = utils.unixify(options); - options = options || {}; - - return function(filepath) { - var contains = utils._contains(filepath, unixify(filepath), pattern); - if (contains === true || options.nocase !== true) { - return contains; - } - var lower = filepath.toLowerCase(); - return utils._contains(lower, unixify(lower), pattern); - }; -}; - -/** - * Returns a function that returns true if the given - * regex matches the `filename` of a file path. - * - * @param {RegExp} `re` Matching regex - * @return {Function} - */ - -utils.matchBasename = function(re) { - return function(filepath) { - return re.test(filepath) || re.test(path.basename(filepath)); - }; -}; - -/** - * Returns the given value unchanced. - * @return {any} - */ - -utils.identity = function(val) { - return val; -}; - -/** - * Determines the filepath to return based on the provided options. - * @return {any} - */ - -utils.value = function(str, unixify, options) { - if (options && options.unixify === false) { - return str; - } - if (options && typeof options.unixify === 'function') { - return options.unixify(str); - } - return unixify(str); -}; - -/** - * Returns a function that normalizes slashes in a string to forward - * slashes, strips `./` from beginning of paths, and optionally unescapes - * special characters. - * @return {Function} - */ - -utils.unixify = function(options) { - var opts = options || {}; - return function(filepath) { - if (opts.stripPrefix !== false) { - filepath = utils.stripPrefix(filepath); - } - if (opts.unescape === true) { - filepath = utils.unescape(filepath); - } - if (opts.unixify === true || utils.isWindows()) { - filepath = utils.toPosixPath(filepath); - } - return filepath; - }; -}; diff --git a/node_modules/nanomatch/node_modules/arr-diff/LICENSE b/node_modules/nanomatch/node_modules/arr-diff/LICENSE deleted file mode 100755 index d734237bd..000000000 --- a/node_modules/nanomatch/node_modules/arr-diff/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/nanomatch/node_modules/arr-diff/README.md b/node_modules/nanomatch/node_modules/arr-diff/README.md deleted file mode 100644 index 961f5c3f1..000000000 --- a/node_modules/nanomatch/node_modules/arr-diff/README.md +++ /dev/null @@ -1,130 +0,0 @@ -# arr-diff [![NPM version](https://img.shields.io/npm/v/arr-diff.svg?style=flat)](https://www.npmjs.com/package/arr-diff) [![NPM monthly downloads](https://img.shields.io/npm/dm/arr-diff.svg?style=flat)](https://npmjs.org/package/arr-diff) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/arr-diff.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/arr-diff) - -> Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save arr-diff -``` - -Install with [yarn](https://yarnpkg.com): - -```sh -$ yarn add arr-diff -``` - -Install with [bower](https://bower.io/) - -```sh -$ bower install arr-diff --save -``` - -## Usage - -Returns the difference between the first array and additional arrays. - -```js -var diff = require('arr-diff'); - -var a = ['a', 'b', 'c', 'd']; -var b = ['b', 'c']; - -console.log(diff(a, b)) -//=> ['a', 'd'] -``` - -## Benchmarks - -This library versus [array-differ](https://github.com/sindresorhus/array-differ), on April 14, 2017: - -``` -Benchmarking: (4 of 4) - · long-dupes - · long - · med - · short - -# benchmark/fixtures/long-dupes.js (100804 bytes) - arr-diff-3.0.0 x 822 ops/sec ±0.67% (86 runs sampled) - arr-diff-4.0.0 x 2,141 ops/sec ±0.42% (89 runs sampled) - array-differ x 708 ops/sec ±0.70% (89 runs sampled) - - fastest is arr-diff-4.0.0 - -# benchmark/fixtures/long.js (94529 bytes) - arr-diff-3.0.0 x 882 ops/sec ±0.60% (87 runs sampled) - arr-diff-4.0.0 x 2,329 ops/sec ±0.97% (83 runs sampled) - array-differ x 769 ops/sec ±0.61% (90 runs sampled) - - fastest is arr-diff-4.0.0 - -# benchmark/fixtures/med.js (708 bytes) - arr-diff-3.0.0 x 856,150 ops/sec ±0.42% (89 runs sampled) - arr-diff-4.0.0 x 4,665,249 ops/sec ±1.06% (89 runs sampled) - array-differ x 653,888 ops/sec ±1.02% (86 runs sampled) - - fastest is arr-diff-4.0.0 - -# benchmark/fixtures/short.js (60 bytes) - arr-diff-3.0.0 x 3,078,467 ops/sec ±0.77% (93 runs sampled) - arr-diff-4.0.0 x 9,213,296 ops/sec ±0.65% (89 runs sampled) - array-differ x 1,337,051 ops/sec ±0.91% (92 runs sampled) - - fastest is arr-diff-4.0.0 -``` - -## About - -### Related projects - -* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays. This is the fastest implementation of array flatten.") -* [array-filter](https://www.npmjs.com/package/array-filter): Array#filter for older browsers. | [homepage](https://github.com/juliangruber/array-filter "Array#filter for older browsers.") -* [array-intersection](https://www.npmjs.com/package/array-intersection): Return an array with the unique values present in _all_ given arrays using strict equality… [more](https://github.com/jonschlinkert/array-intersection) | [homepage](https://github.com/jonschlinkert/array-intersection "Return an array with the unique values present in _all_ given arrays using strict equality for comparisons.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 33 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [paulmillr](https://github.com/paulmillr) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 14, 2017._ \ No newline at end of file diff --git a/node_modules/nanomatch/node_modules/arr-diff/index.js b/node_modules/nanomatch/node_modules/arr-diff/index.js deleted file mode 100644 index 90f280772..000000000 --- a/node_modules/nanomatch/node_modules/arr-diff/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/*! - * arr-diff - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -module.exports = function diff(arr/*, arrays*/) { - var len = arguments.length; - var idx = 0; - while (++idx < len) { - arr = diffArray(arr, arguments[idx]); - } - return arr; -}; - -function diffArray(one, two) { - if (!Array.isArray(two)) { - return one.slice(); - } - - var tlen = two.length - var olen = one.length; - var idx = -1; - var arr = []; - - while (++idx < olen) { - var ele = one[idx]; - - var hasEle = false; - for (var i = 0; i < tlen; i++) { - var val = two[i]; - - if (ele === val) { - hasEle = true; - break; - } - } - - if (hasEle === false) { - arr.push(ele); - } - } - return arr; -} diff --git a/node_modules/nanomatch/node_modules/arr-diff/package.json b/node_modules/nanomatch/node_modules/arr-diff/package.json deleted file mode 100644 index 27d8ba7bb..000000000 --- a/node_modules/nanomatch/node_modules/arr-diff/package.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "_from": "arr-diff@^4.0.0", - "_id": "arr-diff@4.0.0", - "_inBundle": false, - "_integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "_location": "/nanomatch/arr-diff", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "arr-diff@^4.0.0", - "name": "arr-diff", - "escapedName": "arr-diff", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/nanomatch" - ], - "_resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "_shasum": "d6461074febfec71e7e15235761a329a5dc7c520", - "_spec": "arr-diff@^4.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/nanomatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/arr-diff/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jon Schlinkert", - "email": "jon.schlinkert@sellside.com", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Paul Miller", - "email": "paul+gh@paulmillr.com", - "url": "paulmillr.com" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.", - "devDependencies": { - "ansi-bold": "^0.1.1", - "arr-flatten": "^1.0.1", - "array-differ": "^1.0.0", - "benchmarked": "^0.2.4", - "gulp-format-md": "^0.1.9", - "minimist": "^1.2.0", - "mocha": "^2.4.5" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/arr-diff", - "keywords": [ - "arr", - "array", - "array differ", - "array-differ", - "diff", - "differ", - "difference" - ], - "license": "MIT", - "main": "index.js", - "name": "arr-diff", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/arr-diff.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "arr-flatten", - "array-filter", - "array-intersection" - ] - }, - "reflinks": [ - "array-differ", - "verb" - ], - "lint": { - "reflinks": true - } - }, - "version": "4.0.0" -} diff --git a/node_modules/nanomatch/node_modules/array-unique/LICENSE b/node_modules/nanomatch/node_modules/array-unique/LICENSE deleted file mode 100755 index 842218cf0..000000000 --- a/node_modules/nanomatch/node_modules/array-unique/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2016, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/nanomatch/node_modules/array-unique/README.md b/node_modules/nanomatch/node_modules/array-unique/README.md deleted file mode 100755 index 41c8c904e..000000000 --- a/node_modules/nanomatch/node_modules/array-unique/README.md +++ /dev/null @@ -1,77 +0,0 @@ -# array-unique [![NPM version](https://img.shields.io/npm/v/array-unique.svg?style=flat)](https://www.npmjs.com/package/array-unique) [![NPM downloads](https://img.shields.io/npm/dm/array-unique.svg?style=flat)](https://npmjs.org/package/array-unique) [![Build Status](https://img.shields.io/travis/jonschlinkert/array-unique.svg?style=flat)](https://travis-ci.org/jonschlinkert/array-unique) - -Remove duplicate values from an array. Fastest ES5 implementation. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save array-unique -``` - -## Usage - -```js -var unique = require('array-unique'); - -var arr = ['a', 'b', 'c', 'c']; -console.log(unique(arr)) //=> ['a', 'b', 'c'] -console.log(arr) //=> ['a', 'b', 'c'] - -/* The above modifies the input array. To prevent that at a slight performance cost: */ -var unique = require("array-unique").immutable; - -var arr = ['a', 'b', 'c', 'c']; -console.log(unique(arr)) //=> ['a', 'b', 'c'] -console.log(arr) //=> ['a', 'b', 'c', 'c'] -``` - -## About - -### Related projects - -* [arr-diff](https://www.npmjs.com/package/arr-diff): Returns an array with only the unique values from the first array, by excluding all… [more](https://github.com/jonschlinkert/arr-diff) | [homepage](https://github.com/jonschlinkert/arr-diff "Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.") -* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays. This is the fastest implementation of array flatten.") -* [arr-map](https://www.npmjs.com/package/arr-map): Faster, node.js focused alternative to JavaScript's native array map. | [homepage](https://github.com/jonschlinkert/arr-map "Faster, node.js focused alternative to JavaScript's native array map.") -* [arr-pluck](https://www.npmjs.com/package/arr-pluck): Retrieves the value of a specified property from all elements in the collection. | [homepage](https://github.com/jonschlinkert/arr-pluck "Retrieves the value of a specified property from all elements in the collection.") -* [arr-reduce](https://www.npmjs.com/package/arr-reduce): Fast array reduce that also loops over sparse elements. | [homepage](https://github.com/jonschlinkert/arr-reduce "Fast array reduce that also loops over sparse elements.") -* [arr-union](https://www.npmjs.com/package/arr-union): Combines a list of arrays, returning a single array with unique values, using strict equality… [more](https://github.com/jonschlinkert/arr-union) | [homepage](https://github.com/jonschlinkert/arr-union "Combines a list of arrays, returning a single array with unique values, using strict equality for comparisons.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Building docs - -_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ - -To generate the readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install -g verb verb-generate-readme && verb -``` - -### Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -### License - -Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/array-unique/blob/master/LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.28, on July 31, 2016._ \ No newline at end of file diff --git a/node_modules/nanomatch/node_modules/array-unique/index.js b/node_modules/nanomatch/node_modules/array-unique/index.js deleted file mode 100644 index 7e481e072..000000000 --- a/node_modules/nanomatch/node_modules/array-unique/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/*! - * array-unique - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -module.exports = function unique(arr) { - if (!Array.isArray(arr)) { - throw new TypeError('array-unique expects an array.'); - } - - var len = arr.length; - var i = -1; - - while (i++ < len) { - var j = i + 1; - - for (; j < arr.length; ++j) { - if (arr[i] === arr[j]) { - arr.splice(j--, 1); - } - } - } - return arr; -}; - -module.exports.immutable = function uniqueImmutable(arr) { - if (!Array.isArray(arr)) { - throw new TypeError('array-unique expects an array.'); - } - - var arrLen = arr.length; - var newArr = new Array(arrLen); - - for (var i = 0; i < arrLen; i++) { - newArr[i] = arr[i]; - } - - return module.exports(newArr); -}; diff --git a/node_modules/nanomatch/node_modules/array-unique/package.json b/node_modules/nanomatch/node_modules/array-unique/package.json deleted file mode 100644 index 44a7b4e4c..000000000 --- a/node_modules/nanomatch/node_modules/array-unique/package.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "_from": "array-unique@^0.3.2", - "_id": "array-unique@0.3.2", - "_inBundle": false, - "_integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "_location": "/nanomatch/array-unique", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "array-unique@^0.3.2", - "name": "array-unique", - "escapedName": "array-unique", - "rawSpec": "^0.3.2", - "saveSpec": null, - "fetchSpec": "^0.3.2" - }, - "_requiredBy": [ - "/nanomatch" - ], - "_resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "_shasum": "a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428", - "_spec": "array-unique@^0.3.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/nanomatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/array-unique/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Remove duplicate values from an array. Fastest ES5 implementation.", - "devDependencies": { - "array-uniq": "^1.0.2", - "benchmarked": "^0.1.3", - "gulp-format-md": "^0.1.9", - "mocha": "^2.5.3", - "should": "^10.0.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js", - "LICENSE", - "README.md" - ], - "homepage": "https://github.com/jonschlinkert/array-unique", - "keywords": [ - "array", - "unique" - ], - "license": "MIT", - "main": "index.js", - "name": "array-unique", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/array-unique.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "arr-diff", - "arr-union", - "arr-flatten", - "arr-reduce", - "arr-map", - "arr-pluck" - ] - }, - "reflinks": [ - "verb", - "verb-generate-readme" - ], - "lint": { - "reflinks": true - } - }, - "version": "0.3.2" -} diff --git a/node_modules/nanomatch/node_modules/kind-of/CHANGELOG.md b/node_modules/nanomatch/node_modules/kind-of/CHANGELOG.md deleted file mode 100644 index fb30b06df..000000000 --- a/node_modules/nanomatch/node_modules/kind-of/CHANGELOG.md +++ /dev/null @@ -1,157 +0,0 @@ -# Release history - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). - -
    - Guiding Principles - -- Changelogs are for humans, not machines. -- There should be an entry for every single version. -- The same types of changes should be grouped. -- Versions and sections should be linkable. -- The latest version comes first. -- The release date of each versions is displayed. -- Mention whether you follow Semantic Versioning. - -
    - -
    - Types of changes - -Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_): - -- `Added` for new features. -- `Changed` for changes in existing functionality. -- `Deprecated` for soon-to-be removed features. -- `Removed` for now removed features. -- `Fixed` for any bug fixes. -- `Security` in case of vulnerabilities. - -
    - -## [6.0.0] - 2017-10-13 - -- refactor code to be more performant -- refactor benchmarks - -## [5.1.0] - 2017-10-13 - -**Added** - -- Merge pull request #15 from aretecode/patch-1 -- adds support and tests for string & array iterators - -**Changed** - -- updates benchmarks - -## [5.0.2] - 2017-08-02 - -- Merge pull request #14 from struct78/master -- Added `undefined` check - -## [5.0.0] - 2017-06-21 - -- Merge pull request #12 from aretecode/iterator -- Set Iterator + Map Iterator -- streamline `isbuffer`, minor edits - -## [4.0.0] - 2017-05-19 - -- Merge pull request #8 from tunnckoCore/master -- update deps - -## [3.2.2] - 2017-05-16 - -- fix version - -## [3.2.1] - 2017-05-16 - -- add browserify - -## [3.2.0] - 2017-04-25 - -- Merge pull request #10 from ksheedlo/unrequire-buffer -- add `promise` support and tests -- Remove unnecessary `Buffer` check - -## [3.1.0] - 2016-12-07 - -- Merge pull request #7 from laggingreflex/err -- add support for `error` and tests -- run update - -## [3.0.4] - 2016-07-29 - -- move tests -- run update - -## [3.0.3] - 2016-05-03 - -- fix prepublish script -- remove unused dep - -## [3.0.0] - 2015-11-17 - -- add typed array support -- Merge pull request #5 from miguelmota/typed-arrays -- adds new tests - -## [2.0.1] - 2015-08-21 - -- use `is-buffer` module - -## [2.0.0] - 2015-05-31 - -- Create fallback for `Array.isArray` if used as a browser package -- Merge pull request #2 from dtothefp/patch-1 -- Merge pull request #3 from pdehaan/patch-1 -- Merge branch 'master' of https://github.com/chorks/kind-of into chorks-master -- optimizations, mostly date and regex - -## [1.1.0] - 2015-02-09 - -- adds `buffer` support -- adds tests for `buffer` - -## [1.0.0] - 2015-01-19 - -- update benchmarks -- optimizations based on benchmarks - -## [0.1.2] - 2014-10-26 - -- return `typeof` value if it's not an object. very slight speed improvement -- use `.slice` -- adds benchmarks - -## [0.1.0] - 2014-9-26 - -- first commit - -[6.0.0]: https://github.com/jonschlinkert/kind-of/compare/5.1.0...6.0.0 -[5.1.0]: https://github.com/jonschlinkert/kind-of/compare/5.0.2...5.1.0 -[5.0.2]: https://github.com/jonschlinkert/kind-of/compare/5.0.1...5.0.2 -[5.0.1]: https://github.com/jonschlinkert/kind-of/compare/5.0.0...5.0.1 -[5.0.0]: https://github.com/jonschlinkert/kind-of/compare/4.0.0...5.0.0 -[4.0.0]: https://github.com/jonschlinkert/kind-of/compare/3.2.2...4.0.0 -[3.2.2]: https://github.com/jonschlinkert/kind-of/compare/3.2.1...3.2.2 -[3.2.1]: https://github.com/jonschlinkert/kind-of/compare/3.2.0...3.2.1 -[3.2.0]: https://github.com/jonschlinkert/kind-of/compare/3.1.0...3.2.0 -[3.1.0]: https://github.com/jonschlinkert/kind-of/compare/3.0.4...3.1.0 -[3.0.4]: https://github.com/jonschlinkert/kind-of/compare/3.0.3...3.0.4 -[3.0.3]: https://github.com/jonschlinkert/kind-of/compare/3.0.0...3.0.3 -[3.0.0]: https://github.com/jonschlinkert/kind-of/compare/2.0.1...3.0.0 -[2.0.1]: https://github.com/jonschlinkert/kind-of/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/jonschlinkert/kind-of/compare/1.1.0...2.0.0 -[1.1.0]: https://github.com/jonschlinkert/kind-of/compare/1.0.0...1.1.0 -[1.0.0]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...1.0.0 -[0.1.2]: https://github.com/jonschlinkert/kind-of/compare/0.1.0...0.1.2 -[0.1.0]: https://github.com/jonschlinkert/kind-of/commit/2fae09b0b19b1aadb558e9be39f0c3ef6034eb87 - -[Unreleased]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...HEAD -[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog - diff --git a/node_modules/nanomatch/node_modules/kind-of/LICENSE b/node_modules/nanomatch/node_modules/kind-of/LICENSE deleted file mode 100644 index 3f2eca18f..000000000 --- a/node_modules/nanomatch/node_modules/kind-of/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/nanomatch/node_modules/kind-of/README.md b/node_modules/nanomatch/node_modules/kind-of/README.md deleted file mode 100644 index 4b0d4a818..000000000 --- a/node_modules/nanomatch/node_modules/kind-of/README.md +++ /dev/null @@ -1,365 +0,0 @@ -# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) - -> Get the native type of a value. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save kind-of -``` - -Install with [bower](https://bower.io/) - -```sh -$ bower install kind-of --save -``` - -## Why use this? - -1. [it's fast](#benchmarks) | [optimizations](#optimizations) -2. [better type checking](#better-type-checking) - -## Usage - -> es5, es6, and browser ready - -```js -var kindOf = require('kind-of'); - -kindOf(undefined); -//=> 'undefined' - -kindOf(null); -//=> 'null' - -kindOf(true); -//=> 'boolean' - -kindOf(false); -//=> 'boolean' - -kindOf(new Buffer('')); -//=> 'buffer' - -kindOf(42); -//=> 'number' - -kindOf('str'); -//=> 'string' - -kindOf(arguments); -//=> 'arguments' - -kindOf({}); -//=> 'object' - -kindOf(Object.create(null)); -//=> 'object' - -kindOf(new Test()); -//=> 'object' - -kindOf(new Date()); -//=> 'date' - -kindOf([1, 2, 3]); -//=> 'array' - -kindOf(/foo/); -//=> 'regexp' - -kindOf(new RegExp('foo')); -//=> 'regexp' - -kindOf(new Error('error')); -//=> 'error' - -kindOf(function () {}); -//=> 'function' - -kindOf(function * () {}); -//=> 'generatorfunction' - -kindOf(Symbol('str')); -//=> 'symbol' - -kindOf(new Map()); -//=> 'map' - -kindOf(new WeakMap()); -//=> 'weakmap' - -kindOf(new Set()); -//=> 'set' - -kindOf(new WeakSet()); -//=> 'weakset' - -kindOf(new Int8Array()); -//=> 'int8array' - -kindOf(new Uint8Array()); -//=> 'uint8array' - -kindOf(new Uint8ClampedArray()); -//=> 'uint8clampedarray' - -kindOf(new Int16Array()); -//=> 'int16array' - -kindOf(new Uint16Array()); -//=> 'uint16array' - -kindOf(new Int32Array()); -//=> 'int32array' - -kindOf(new Uint32Array()); -//=> 'uint32array' - -kindOf(new Float32Array()); -//=> 'float32array' - -kindOf(new Float64Array()); -//=> 'float64array' -``` - -## Benchmarks - -Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). - -```bash -# arguments (32 bytes) - kind-of x 17,024,098 ops/sec ±1.90% (86 runs sampled) - lib-type-of x 11,926,235 ops/sec ±1.34% (83 runs sampled) - lib-typeof x 9,245,257 ops/sec ±1.22% (87 runs sampled) - - fastest is kind-of (by 161% avg) - -# array (22 bytes) - kind-of x 17,196,492 ops/sec ±1.07% (88 runs sampled) - lib-type-of x 8,838,283 ops/sec ±1.02% (87 runs sampled) - lib-typeof x 8,677,848 ops/sec ±0.87% (87 runs sampled) - - fastest is kind-of (by 196% avg) - -# boolean (24 bytes) - kind-of x 16,841,600 ops/sec ±1.10% (86 runs sampled) - lib-type-of x 8,096,787 ops/sec ±0.95% (87 runs sampled) - lib-typeof x 8,423,345 ops/sec ±1.15% (86 runs sampled) - - fastest is kind-of (by 204% avg) - -# buffer (38 bytes) - kind-of x 14,848,060 ops/sec ±1.05% (86 runs sampled) - lib-type-of x 3,671,577 ops/sec ±1.49% (87 runs sampled) - lib-typeof x 8,360,236 ops/sec ±1.24% (86 runs sampled) - - fastest is kind-of (by 247% avg) - -# date (30 bytes) - kind-of x 16,067,761 ops/sec ±1.58% (86 runs sampled) - lib-type-of x 8,954,436 ops/sec ±1.40% (87 runs sampled) - lib-typeof x 8,488,307 ops/sec ±1.51% (84 runs sampled) - - fastest is kind-of (by 184% avg) - -# error (36 bytes) - kind-of x 9,634,090 ops/sec ±1.12% (89 runs sampled) - lib-type-of x 7,735,624 ops/sec ±1.32% (86 runs sampled) - lib-typeof x 7,442,160 ops/sec ±1.11% (90 runs sampled) - - fastest is kind-of (by 127% avg) - -# function (34 bytes) - kind-of x 10,031,494 ops/sec ±1.27% (86 runs sampled) - lib-type-of x 9,502,757 ops/sec ±1.17% (89 runs sampled) - lib-typeof x 8,278,985 ops/sec ±1.08% (88 runs sampled) - - fastest is kind-of (by 113% avg) - -# null (24 bytes) - kind-of x 18,159,808 ops/sec ±1.92% (86 runs sampled) - lib-type-of x 12,927,635 ops/sec ±1.01% (88 runs sampled) - lib-typeof x 7,958,234 ops/sec ±1.21% (89 runs sampled) - - fastest is kind-of (by 174% avg) - -# number (22 bytes) - kind-of x 17,846,779 ops/sec ±0.91% (85 runs sampled) - lib-type-of x 3,316,636 ops/sec ±1.19% (86 runs sampled) - lib-typeof x 2,329,477 ops/sec ±2.21% (85 runs sampled) - - fastest is kind-of (by 632% avg) - -# object-plain (47 bytes) - kind-of x 7,085,155 ops/sec ±1.05% (88 runs sampled) - lib-type-of x 8,870,930 ops/sec ±1.06% (83 runs sampled) - lib-typeof x 8,716,024 ops/sec ±1.05% (87 runs sampled) - - fastest is lib-type-of (by 112% avg) - -# regex (25 bytes) - kind-of x 14,196,052 ops/sec ±1.65% (84 runs sampled) - lib-type-of x 9,554,164 ops/sec ±1.25% (88 runs sampled) - lib-typeof x 8,359,691 ops/sec ±1.07% (87 runs sampled) - - fastest is kind-of (by 158% avg) - -# string (33 bytes) - kind-of x 16,131,428 ops/sec ±1.41% (85 runs sampled) - lib-type-of x 7,273,172 ops/sec ±1.05% (87 runs sampled) - lib-typeof x 7,382,635 ops/sec ±1.17% (85 runs sampled) - - fastest is kind-of (by 220% avg) - -# symbol (34 bytes) - kind-of x 17,011,537 ops/sec ±1.24% (86 runs sampled) - lib-type-of x 3,492,454 ops/sec ±1.23% (89 runs sampled) - lib-typeof x 7,471,235 ops/sec ±2.48% (87 runs sampled) - - fastest is kind-of (by 310% avg) - -# template-strings (36 bytes) - kind-of x 15,434,250 ops/sec ±1.46% (83 runs sampled) - lib-type-of x 7,157,907 ops/sec ±0.97% (87 runs sampled) - lib-typeof x 7,517,986 ops/sec ±0.92% (86 runs sampled) - - fastest is kind-of (by 210% avg) - -# undefined (29 bytes) - kind-of x 19,167,115 ops/sec ±1.71% (87 runs sampled) - lib-type-of x 15,477,740 ops/sec ±1.63% (85 runs sampled) - lib-typeof x 19,075,495 ops/sec ±1.17% (83 runs sampled) - - fastest is lib-typeof,kind-of - -``` - -## Optimizations - -In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: - -1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. -2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. -3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` -4. There is no reason to make the code in a microlib as terse as possible, just to win points for making it shorter. It's always better to favor performant code over terse code. You will always only be using a single `require()` statement to use the library anyway, regardless of how the code is written. - -## Better type checking - -kind-of seems to be more consistently "correct" than other type checking libs I've looked at. For example, here are some differing results from other popular libs: - -### [typeof](https://github.com/CodingFu/typeof) lib - -Incorrectly identifies instances of custom constructors (pretty common): - -```js -var typeOf = require('typeof'); -function Test() {} -console.log(typeOf(new Test())); -//=> 'test' -``` - -Returns `object` instead of `arguments`: - -```js -function foo() { - console.log(typeOf(arguments)) //=> 'object' -} -foo(); -``` - -### [type-of](https://github.com/ForbesLindesay/type-of) lib - -Incorrectly returns `object` for generator functions, buffers, `Map`, `Set`, `WeakMap` and `WeakSet`: - -```js -function * foo() {} -console.log(typeOf(foo)); -//=> 'object' -console.log(typeOf(new Buffer(''))); -//=> 'object' -console.log(typeOf(new Map())); -//=> 'object' -console.log(typeOf(new Set())); -//=> 'object' -console.log(typeOf(new WeakMap())); -//=> 'object' -console.log(typeOf(new WeakSet())); -//=> 'object' -``` - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    - -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") -* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") -* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 98 | [jonschlinkert](https://github.com/jonschlinkert) | -| 3 | [aretecode](https://github.com/aretecode) | -| 2 | [miguelmota](https://github.com/miguelmota) | -| 1 | [dtothefp](https://github.com/dtothefp) | -| 1 | [ianstormtaylor](https://github.com/ianstormtaylor) | -| 1 | [ksheedlo](https://github.com/ksheedlo) | -| 1 | [pdehaan](https://github.com/pdehaan) | -| 1 | [laggingreflex](https://github.com/laggingreflex) | -| 1 | [charlike-old](https://github.com/charlike-old) | - -### Author - -**Jon Schlinkert** - -* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on December 01, 2017._ \ No newline at end of file diff --git a/node_modules/nanomatch/node_modules/kind-of/index.js b/node_modules/nanomatch/node_modules/kind-of/index.js deleted file mode 100644 index aa2bb3944..000000000 --- a/node_modules/nanomatch/node_modules/kind-of/index.js +++ /dev/null @@ -1,129 +0,0 @@ -var toString = Object.prototype.toString; - -module.exports = function kindOf(val) { - if (val === void 0) return 'undefined'; - if (val === null) return 'null'; - - var type = typeof val; - if (type === 'boolean') return 'boolean'; - if (type === 'string') return 'string'; - if (type === 'number') return 'number'; - if (type === 'symbol') return 'symbol'; - if (type === 'function') { - return isGeneratorFn(val) ? 'generatorfunction' : 'function'; - } - - if (isArray(val)) return 'array'; - if (isBuffer(val)) return 'buffer'; - if (isArguments(val)) return 'arguments'; - if (isDate(val)) return 'date'; - if (isError(val)) return 'error'; - if (isRegexp(val)) return 'regexp'; - - switch (ctorName(val)) { - case 'Symbol': return 'symbol'; - case 'Promise': return 'promise'; - - // Set, Map, WeakSet, WeakMap - case 'WeakMap': return 'weakmap'; - case 'WeakSet': return 'weakset'; - case 'Map': return 'map'; - case 'Set': return 'set'; - - // 8-bit typed arrays - case 'Int8Array': return 'int8array'; - case 'Uint8Array': return 'uint8array'; - case 'Uint8ClampedArray': return 'uint8clampedarray'; - - // 16-bit typed arrays - case 'Int16Array': return 'int16array'; - case 'Uint16Array': return 'uint16array'; - - // 32-bit typed arrays - case 'Int32Array': return 'int32array'; - case 'Uint32Array': return 'uint32array'; - case 'Float32Array': return 'float32array'; - case 'Float64Array': return 'float64array'; - } - - if (isGeneratorObj(val)) { - return 'generator'; - } - - // Non-plain objects - type = toString.call(val); - switch (type) { - case '[object Object]': return 'object'; - // iterators - case '[object Map Iterator]': return 'mapiterator'; - case '[object Set Iterator]': return 'setiterator'; - case '[object String Iterator]': return 'stringiterator'; - case '[object Array Iterator]': return 'arrayiterator'; - } - - // other - return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); -}; - -function ctorName(val) { - return val.constructor ? val.constructor.name : null; -} - -function isArray(val) { - if (Array.isArray) return Array.isArray(val); - return val instanceof Array; -} - -function isError(val) { - return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'); -} - -function isDate(val) { - if (val instanceof Date) return true; - return typeof val.toDateString === 'function' - && typeof val.getDate === 'function' - && typeof val.setDate === 'function'; -} - -function isRegexp(val) { - if (val instanceof RegExp) return true; - return typeof val.flags === 'string' - && typeof val.ignoreCase === 'boolean' - && typeof val.multiline === 'boolean' - && typeof val.global === 'boolean'; -} - -function isGeneratorFn(name, val) { - return ctorName(name) === 'GeneratorFunction'; -} - -function isGeneratorObj(val) { - return typeof val.throw === 'function' - && typeof val.return === 'function' - && typeof val.next === 'function'; -} - -function isArguments(val) { - try { - if (typeof val.length === 'number' && typeof val.callee === 'function') { - return true; - } - } catch (err) { - if (err.message.indexOf('callee') !== -1) { - return true; - } - } - return false; -} - -/** - * If you need to support Safari 5-7 (8-10 yr-old browser), - * take a look at https://github.com/feross/is-buffer - */ - -function isBuffer(val) { - if (val.constructor && typeof val.constructor.isBuffer === 'function') { - return val.constructor.isBuffer(val); - } - return false; -} diff --git a/node_modules/nanomatch/node_modules/kind-of/package.json b/node_modules/nanomatch/node_modules/kind-of/package.json deleted file mode 100644 index 08621dd07..000000000 --- a/node_modules/nanomatch/node_modules/kind-of/package.json +++ /dev/null @@ -1,143 +0,0 @@ -{ - "_from": "kind-of@^6.0.2", - "_id": "kind-of@6.0.2", - "_inBundle": false, - "_integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "_location": "/nanomatch/kind-of", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "kind-of@^6.0.2", - "name": "kind-of", - "escapedName": "kind-of", - "rawSpec": "^6.0.2", - "saveSpec": null, - "fetchSpec": "^6.0.2" - }, - "_requiredBy": [ - "/nanomatch" - ], - "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "_shasum": "01146b36a6218e64e58f3a8d66de5d7fc6f6d051", - "_spec": "kind-of@^6.0.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/nanomatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/kind-of/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "David Fox-Powell", - "url": "https://dtothefp.github.io/me" - }, - { - "name": "James", - "url": "https://twitter.com/aretecode" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Ken Sheedlo", - "url": "kensheedlo.com" - }, - { - "name": "laggingreflex", - "url": "https://github.com/laggingreflex" - }, - { - "name": "Miguel Mota", - "url": "https://miguelmota.com" - }, - { - "name": "Peter deHaan", - "url": "http://about.me/peterdehaan" - }, - { - "name": "tunnckoCore", - "url": "https://i.am.charlike.online" - } - ], - "deprecated": false, - "description": "Get the native type of a value.", - "devDependencies": { - "benchmarked": "^2.0.0", - "browserify": "^14.4.0", - "gulp-format-md": "^1.0.0", - "mocha": "^4.0.1", - "write": "^1.0.3" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/kind-of", - "keywords": [ - "arguments", - "array", - "boolean", - "check", - "date", - "function", - "is", - "is-type", - "is-type-of", - "kind", - "kind-of", - "number", - "object", - "of", - "regexp", - "string", - "test", - "type", - "type-of", - "typeof", - "types" - ], - "license": "MIT", - "main": "index.js", - "name": "kind-of", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/kind-of.git" - }, - "scripts": { - "prepublish": "browserify -o browser.js -e index.js -s index --bare", - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "related": { - "list": [ - "is-glob", - "is-number", - "is-primitive" - ] - }, - "reflinks": [ - "type-of", - "typeof", - "verb" - ] - }, - "version": "6.0.2" -} diff --git a/node_modules/nanomatch/package.json b/node_modules/nanomatch/package.json deleted file mode 100644 index 5e15ee775..000000000 --- a/node_modules/nanomatch/package.json +++ /dev/null @@ -1,171 +0,0 @@ -{ - "_from": "nanomatch@^1.2.9", - "_id": "nanomatch@1.2.13", - "_inBundle": false, - "_integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "_location": "/nanomatch", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "nanomatch@^1.2.9", - "name": "nanomatch", - "escapedName": "nanomatch", - "rawSpec": "^1.2.9", - "saveSpec": null, - "fetchSpec": "^1.2.9" - }, - "_requiredBy": [ - "/readdirp/micromatch" - ], - "_resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "_shasum": "b87a8aa4fc0de8fe6be88895b38983ff265bd119", - "_spec": "nanomatch@^1.2.9", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/micromatch/nanomatch/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Devon Govett", - "url": "http://badassjs.com" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - } - ], - "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "deprecated": false, - "description": "Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces)", - "devDependencies": { - "bash-match": "^1.0.2", - "for-own": "^1.0.0", - "gulp": "^3.9.1", - "gulp-format-md": "^1.0.0", - "gulp-istanbul": "^1.1.3", - "gulp-mocha": "^5.0.0", - "helper-changelog": "^0.3.0", - "minimatch": "^3.0.4", - "minimist": "^1.2.0", - "mocha": "^3.5.3", - "multimatch": "^2.1.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js", - "lib" - ], - "homepage": "https://github.com/micromatch/nanomatch", - "keywords": [ - "bash", - "expand", - "expansion", - "expression", - "file", - "files", - "filter", - "find", - "glob", - "globbing", - "globs", - "globstar", - "match", - "matcher", - "matches", - "matching", - "micromatch", - "minimatch", - "multimatch", - "nanomatch", - "path", - "pattern", - "patterns", - "regex", - "regexp", - "regular", - "shell", - "wildcard" - ], - "license": "MIT", - "lintDeps": { - "dependencies": { - "options": { - "lock": { - "snapdragon": "^0.8.1" - } - } - }, - "devDependencies": { - "files": { - "options": { - "ignore": [ - "benchmark/**" - ] - } - } - } - }, - "main": "index.js", - "name": "nanomatch", - "repository": { - "type": "git", - "url": "git+https://github.com/micromatch/nanomatch.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": "collapsible", - "layout": "default", - "tasks": [ - "readme" - ], - "helpers": [ - "helper-changelog" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "extglob", - "is-extglob", - "is-glob", - "micromatch" - ] - }, - "reflinks": [ - "expand-brackets", - "expand-tilde", - "glob-object", - "micromatch", - "minimatch", - "options", - "snapdragon" - ], - "lint": { - "reflinks": true - } - }, - "version": "1.2.13" -} diff --git a/node_modules/nice-try/CHANGELOG.md b/node_modules/nice-try/CHANGELOG.md deleted file mode 100644 index 9e6baf2fb..000000000 --- a/node_modules/nice-try/CHANGELOG.md +++ /dev/null @@ -1,21 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). - -## [1.0.5] - 2018-08-25 - -### Changed - -- Removed `prepublish` script from `package.json` - -## [1.0.4] - 2017-08-08 - -### New - -- Added a changelog - -### Changed - -- Ignore `yarn.lock` and `package-lock.json` files \ No newline at end of file diff --git a/node_modules/nice-try/LICENSE b/node_modules/nice-try/LICENSE deleted file mode 100644 index 681c8f507..000000000 --- a/node_modules/nice-try/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 Tobias Reich - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/nice-try/README.md b/node_modules/nice-try/README.md deleted file mode 100644 index 5b83b7882..000000000 --- a/node_modules/nice-try/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# nice-try - -[![Travis Build Status](https://travis-ci.org/electerious/nice-try.svg?branch=master)](https://travis-ci.org/electerious/nice-try) [![AppVeyor Status](https://ci.appveyor.com/api/projects/status/8tqb09wrwci3xf8l?svg=true)](https://ci.appveyor.com/project/electerious/nice-try) [![Coverage Status](https://coveralls.io/repos/github/electerious/nice-try/badge.svg?branch=master)](https://coveralls.io/github/electerious/nice-try?branch=master) [![Dependencies](https://david-dm.org/electerious/nice-try.svg)](https://david-dm.org/electerious/nice-try#info=dependencies) [![Greenkeeper badge](https://badges.greenkeeper.io/electerious/nice-try.svg)](https://greenkeeper.io/) - -A function that tries to execute a function and discards any error that occurs. - -## Install - -``` -npm install nice-try -``` - -## Usage - -```js -const niceTry = require('nice-try') - -niceTry(() => JSON.parse('true')) // true -niceTry(() => JSON.parse('truee')) // undefined -niceTry() // undefined -niceTry(true) // undefined -``` - -## API - -### Parameters - -- `fn` `{Function}` Function that might or might not throw an error. - -### Returns - -- `{?*}` Return-value of the function when no error occurred. \ No newline at end of file diff --git a/node_modules/nice-try/package.json b/node_modules/nice-try/package.json deleted file mode 100644 index b4150c7b4..000000000 --- a/node_modules/nice-try/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "_from": "nice-try@^1.0.4", - "_id": "nice-try@1.0.5", - "_inBundle": false, - "_integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "_location": "/nice-try", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "nice-try@^1.0.4", - "name": "nice-try", - "escapedName": "nice-try", - "rawSpec": "^1.0.4", - "saveSpec": null, - "fetchSpec": "^1.0.4" - }, - "_requiredBy": [ - "/cross-spawn" - ], - "_resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "_shasum": "a3378a7696ce7d223e88fc9b764bd7ef1089e366", - "_spec": "nice-try@^1.0.4", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/cross-spawn", - "authors": [ - "Tobias Reich " - ], - "bugs": { - "url": "https://github.com/electerious/nice-try/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Tries to execute a function and discards any error that occurs", - "devDependencies": { - "chai": "^4.1.2", - "coveralls": "^3.0.0", - "mocha": "^5.1.1", - "nyc": "^12.0.1" - }, - "files": [ - "src" - ], - "homepage": "https://github.com/electerious/nice-try", - "keywords": [ - "try", - "catch", - "error" - ], - "license": "MIT", - "main": "src/index.js", - "name": "nice-try", - "repository": { - "type": "git", - "url": "git+https://github.com/electerious/nice-try.git" - }, - "scripts": { - "coveralls": "nyc report --reporter=text-lcov | coveralls", - "test": "nyc node_modules/mocha/bin/_mocha" - }, - "version": "1.0.5" -} diff --git a/node_modules/nice-try/src/index.js b/node_modules/nice-try/src/index.js deleted file mode 100644 index 837506f2c..000000000 --- a/node_modules/nice-try/src/index.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict' - -/** - * Tries to execute a function and discards any error that occurs. - * @param {Function} fn - Function that might or might not throw an error. - * @returns {?*} Return-value of the function when no error occurred. - */ -module.exports = function(fn) { - - try { return fn() } catch (e) {} - -} \ No newline at end of file diff --git a/node_modules/normalize-path/LICENSE b/node_modules/normalize-path/LICENSE deleted file mode 100644 index d734237bd..000000000 --- a/node_modules/normalize-path/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/normalize-path/README.md b/node_modules/normalize-path/README.md deleted file mode 100644 index daa0edda3..000000000 --- a/node_modules/normalize-path/README.md +++ /dev/null @@ -1,92 +0,0 @@ -# normalize-path [![NPM version](https://img.shields.io/npm/v/normalize-path.svg?style=flat)](https://www.npmjs.com/package/normalize-path) [![NPM monthly downloads](https://img.shields.io/npm/dm/normalize-path.svg?style=flat)](https://npmjs.org/package/normalize-path) [![NPM total downloads](https://img.shields.io/npm/dt/normalize-path.svg?style=flat)](https://npmjs.org/package/normalize-path) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/normalize-path.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/normalize-path) - -> Normalize file path slashes to be unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes unless disabled. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save normalize-path -``` - -## Usage - -```js -var normalize = require('normalize-path'); - -normalize('\\foo\\bar\\baz\\'); -//=> '/foo/bar/baz' - -normalize('./foo/bar/baz/'); -//=> './foo/bar/baz' -``` - -Pass `false` as the last argument to **keep** trailing slashes: - -```js -normalize('./foo/bar/baz/', false); -//=> './foo/bar/baz/' - -normalize('foo\\bar\\baz\\', false); -//=> 'foo/bar/baz/' -``` - -## About - -### Related projects - -* [contains-path](https://www.npmjs.com/package/contains-path): Return true if a file path contains the given path. | [homepage](https://github.com/jonschlinkert/contains-path "Return true if a file path contains the given path.") -* [ends-with](https://www.npmjs.com/package/ends-with): Returns `true` if the given `string` or `array` ends with `suffix` using strict equality for… [more](https://github.com/jonschlinkert/ends-with) | [homepage](https://github.com/jonschlinkert/ends-with "Returns `true` if the given `string` or `array` ends with `suffix` using strict equality for comparisons.") -* [is-absolute](https://www.npmjs.com/package/is-absolute): Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute. | [homepage](https://github.com/jonschlinkert/is-absolute "Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute.") -* [is-relative](https://www.npmjs.com/package/is-relative): Returns `true` if the path appears to be relative. | [homepage](https://github.com/jonschlinkert/is-relative "Returns `true` if the path appears to be relative.") -* [parse-filepath](https://www.npmjs.com/package/parse-filepath): Pollyfill for node.js `path.parse`, parses a filepath into an object. | [homepage](https://github.com/jonschlinkert/parse-filepath "Pollyfill for node.js `path.parse`, parses a filepath into an object.") -* [path-ends-with](https://www.npmjs.com/package/path-ends-with): Return `true` if a file path ends with the given string/suffix. | [homepage](https://github.com/jonschlinkert/path-ends-with "Return `true` if a file path ends with the given string/suffix.") -* [path-segments](https://www.npmjs.com/package/path-segments): Get n specific segments of a file path, e.g. first 2, last 3, etc. | [homepage](https://github.com/jonschlinkert/path-segments "Get n specific segments of a file path, e.g. first 2, last 3, etc.") -* [rewrite-ext](https://www.npmjs.com/package/rewrite-ext): Automatically re-write the destination extension of a filepath based on the source extension. e.g… [more](https://github.com/jonschlinkert/rewrite-ext) | [homepage](https://github.com/jonschlinkert/rewrite-ext "Automatically re-write the destination extension of a filepath based on the source extension. e.g `.coffee` => `.js`. This will only rename the ext, no other path parts are modified.") -* [unixify](https://www.npmjs.com/package/unixify): Convert Windows file paths to unix paths. | [homepage](https://github.com/jonschlinkert/unixify "Convert Windows file paths to unix paths.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 31 | [jonschlinkert](https://github.com/jonschlinkert) | -| 1 | [phated](https://github.com/phated) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.3, on March 29, 2017._ \ No newline at end of file diff --git a/node_modules/normalize-path/index.js b/node_modules/normalize-path/index.js deleted file mode 100644 index 4a4f8ccdb..000000000 --- a/node_modules/normalize-path/index.js +++ /dev/null @@ -1,19 +0,0 @@ -/*! - * normalize-path - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -var removeTrailingSeparator = require('remove-trailing-separator'); - -module.exports = function normalizePath(str, stripTrailing) { - if (typeof str !== 'string') { - throw new TypeError('expected a string'); - } - str = str.replace(/[\\\/]+/g, '/'); - if (stripTrailing !== false) { - str = removeTrailingSeparator(str); - } - return str; -}; diff --git a/node_modules/normalize-path/package.json b/node_modules/normalize-path/package.json deleted file mode 100644 index 619111610..000000000 --- a/node_modules/normalize-path/package.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "_from": "normalize-path@^2.0.0", - "_id": "normalize-path@2.1.1", - "_inBundle": false, - "_integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "_location": "/normalize-path", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "normalize-path@^2.0.0", - "name": "normalize-path", - "escapedName": "normalize-path", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/anymatch", - "/micromatch" - ], - "_resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "_shasum": "1ab28b556e198363a8c1a6f7e6fa20137fe6aed9", - "_spec": "normalize-path@^2.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/anymatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/normalize-path/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Blaine Bublitz", - "email": "blaine.bublitz@gmail.com", - "url": "https://twitter.com/BlaineBublitz" - }, - { - "name": "Jon Schlinkert", - "email": "jon.schlinkert@sellside.com", - "url": "http://twitter.com/jonschlinkert" - } - ], - "dependencies": { - "remove-trailing-separator": "^1.0.1" - }, - "deprecated": false, - "description": "Normalize file path slashes to be unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes unless disabled.", - "devDependencies": { - "benchmarked": "^0.1.1", - "gulp-format-md": "^0.1.11", - "minimist": "^1.2.0", - "mocha": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/normalize-path", - "keywords": [ - "backslash", - "file", - "filepath", - "fix", - "forward", - "fp", - "fs", - "normalize", - "path", - "slash", - "slashes", - "trailing", - "unix", - "urix" - ], - "license": "MIT", - "main": "index.js", - "name": "normalize-path", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/normalize-path.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "contains-path", - "ends-with", - "is-absolute", - "is-relative", - "parse-filepath", - "path-ends-with", - "path-segments", - "rewrite-ext", - "unixify" - ], - "description": "Other useful libraries for working with paths in node.js:" - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - } - }, - "version": "2.1.1" -} diff --git a/node_modules/npm-run-path/index.js b/node_modules/npm-run-path/index.js deleted file mode 100644 index 56f31e471..000000000 --- a/node_modules/npm-run-path/index.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; -const path = require('path'); -const pathKey = require('path-key'); - -module.exports = opts => { - opts = Object.assign({ - cwd: process.cwd(), - path: process.env[pathKey()] - }, opts); - - let prev; - let pth = path.resolve(opts.cwd); - const ret = []; - - while (prev !== pth) { - ret.push(path.join(pth, 'node_modules/.bin')); - prev = pth; - pth = path.resolve(pth, '..'); - } - - // ensure the running `node` binary is used - ret.push(path.dirname(process.execPath)); - - return ret.concat(opts.path).join(path.delimiter); -}; - -module.exports.env = opts => { - opts = Object.assign({ - env: process.env - }, opts); - - const env = Object.assign({}, opts.env); - const path = pathKey({env}); - - opts.path = env[path]; - env[path] = module.exports(opts); - - return env; -}; diff --git a/node_modules/npm-run-path/license b/node_modules/npm-run-path/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/npm-run-path/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/npm-run-path/package.json b/node_modules/npm-run-path/package.json deleted file mode 100644 index 8d9813e8e..000000000 --- a/node_modules/npm-run-path/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_from": "npm-run-path@^2.0.0", - "_id": "npm-run-path@2.0.2", - "_inBundle": false, - "_integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "_location": "/npm-run-path", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "npm-run-path@^2.0.0", - "name": "npm-run-path", - "escapedName": "npm-run-path", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/execa" - ], - "_resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "_shasum": "35a9232dfa35d7067b4cb2ddf2357b1871536c5f", - "_spec": "npm-run-path@^2.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/execa", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/npm-run-path/issues" - }, - "bundleDependencies": false, - "dependencies": { - "path-key": "^2.0.0" - }, - "deprecated": false, - "description": "Get your PATH prepended with locally installed binaries", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/npm-run-path#readme", - "keywords": [ - "npm", - "run", - "path", - "package", - "bin", - "binary", - "binaries", - "script", - "cli", - "command-line", - "execute", - "executable" - ], - "license": "MIT", - "name": "npm-run-path", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/npm-run-path.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.0.2", - "xo": { - "esnext": true - } -} diff --git a/node_modules/npm-run-path/readme.md b/node_modules/npm-run-path/readme.md deleted file mode 100644 index 4ff4722a6..000000000 --- a/node_modules/npm-run-path/readme.md +++ /dev/null @@ -1,81 +0,0 @@ -# npm-run-path [![Build Status](https://travis-ci.org/sindresorhus/npm-run-path.svg?branch=master)](https://travis-ci.org/sindresorhus/npm-run-path) - -> Get your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) prepended with locally installed binaries - -In [npm run scripts](https://docs.npmjs.com/cli/run-script) you can execute locally installed binaries by name. This enables the same outside npm. - - -## Install - -``` -$ npm install --save npm-run-path -``` - - -## Usage - -```js -const childProcess = require('child_process'); -const npmRunPath = require('npm-run-path'); - -console.log(process.env.PATH); -//=> '/usr/local/bin' - -console.log(npmRunPath()); -//=> '/Users/sindresorhus/dev/foo/node_modules/.bin:/Users/sindresorhus/dev/node_modules/.bin:/Users/sindresorhus/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/usr/local/bin' - -// `foo` is a locally installed binary -childProcess.execFileSync('foo', { - env: npmRunPath.env() -}); -``` - - -## API - -### npmRunPath([options]) - -#### options - -##### cwd - -Type: `string`
    -Default: `process.cwd()` - -Working directory. - -##### path - -Type: `string`
    -Default: [`PATH`](https://github.com/sindresorhus/path-key) - -PATH to be appended.
    -Set it to an empty string to exclude the default PATH. - -### npmRunPath.env([options]) - -#### options - -##### cwd - -Type: `string`
    -Default: `process.cwd()` - -Working directory. - -##### env - -Type: `Object` - -Accepts an object of environment variables, like `process.env`, and modifies the PATH using the correct [PATH key](https://github.com/sindresorhus/path-key). Use this if you're modifying the PATH for use in the `child_process` options. - - -## Related - -- [npm-run-path-cli](https://github.com/sindresorhus/npm-run-path-cli) - CLI for this module -- [execa](https://github.com/sindresorhus/execa) - Execute a locally installed binary - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/number-is-nan/index.js b/node_modules/number-is-nan/index.js deleted file mode 100644 index 79be4b9cb..000000000 --- a/node_modules/number-is-nan/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -module.exports = Number.isNaN || function (x) { - return x !== x; -}; diff --git a/node_modules/number-is-nan/license b/node_modules/number-is-nan/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/number-is-nan/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/number-is-nan/package.json b/node_modules/number-is-nan/package.json deleted file mode 100644 index 813fd7c3e..000000000 --- a/node_modules/number-is-nan/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "_from": "number-is-nan@^1.0.0", - "_id": "number-is-nan@1.0.1", - "_inBundle": false, - "_integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "_location": "/number-is-nan", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "number-is-nan@^1.0.0", - "name": "number-is-nan", - "escapedName": "number-is-nan", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/is-finite" - ], - "_resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "_shasum": "097b602b53422a522c1afb8790318336941a011d", - "_spec": "number-is-nan@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/is-finite", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/number-is-nan/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "ES2015 Number.isNaN() ponyfill", - "devDependencies": { - "ava": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/number-is-nan#readme", - "keywords": [ - "es2015", - "ecmascript", - "ponyfill", - "polyfill", - "shim", - "number", - "is", - "nan", - "not" - ], - "license": "MIT", - "name": "number-is-nan", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/number-is-nan.git" - }, - "scripts": { - "test": "ava" - }, - "version": "1.0.1" -} diff --git a/node_modules/number-is-nan/readme.md b/node_modules/number-is-nan/readme.md deleted file mode 100644 index 246350871..000000000 --- a/node_modules/number-is-nan/readme.md +++ /dev/null @@ -1,28 +0,0 @@ -# number-is-nan [![Build Status](https://travis-ci.org/sindresorhus/number-is-nan.svg?branch=master)](https://travis-ci.org/sindresorhus/number-is-nan) - -> ES2015 [`Number.isNaN()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) [ponyfill](https://ponyfill.com) - - -## Install - -``` -$ npm install --save number-is-nan -``` - - -## Usage - -```js -var numberIsNan = require('number-is-nan'); - -numberIsNan(NaN); -//=> true - -numberIsNan('unicorn'); -//=> false -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/object-assign/index.js b/node_modules/object-assign/index.js deleted file mode 100644 index 0930cf889..000000000 --- a/node_modules/object-assign/index.js +++ /dev/null @@ -1,90 +0,0 @@ -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ - -'use strict'; -/* 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; -}; diff --git a/node_modules/object-assign/license b/node_modules/object-assign/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/object-assign/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/object-assign/package.json b/node_modules/object-assign/package.json deleted file mode 100644 index 100bf33da..000000000 --- a/node_modules/object-assign/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "_from": "object-assign@^4.0.1", - "_id": "object-assign@4.1.1", - "_inBundle": false, - "_integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "_location": "/object-assign", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "object-assign@^4.0.1", - "name": "object-assign", - "escapedName": "object-assign", - "rawSpec": "^4.0.1", - "saveSpec": null, - "fetchSpec": "^4.0.1" - }, - "_requiredBy": [ - "/opn", - "/query-string", - "/watchify-middleware" - ], - "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "_shasum": "2109adc7965887cfc05cbbd442cac8bfbb360863", - "_spec": "object-assign@^4.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/opn", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/object-assign/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "ES2015 `Object.assign()` ponyfill", - "devDependencies": { - "ava": "^0.16.0", - "lodash": "^4.16.4", - "matcha": "^0.7.0", - "xo": "^0.16.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/object-assign#readme", - "keywords": [ - "object", - "assign", - "extend", - "properties", - "es2015", - "ecmascript", - "harmony", - "ponyfill", - "prollyfill", - "polyfill", - "shim", - "browser" - ], - "license": "MIT", - "name": "object-assign", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/object-assign.git" - }, - "scripts": { - "bench": "matcha bench.js", - "test": "xo && ava" - }, - "version": "4.1.1" -} diff --git a/node_modules/object-assign/readme.md b/node_modules/object-assign/readme.md deleted file mode 100644 index 1be09d35c..000000000 --- a/node_modules/object-assign/readme.md +++ /dev/null @@ -1,61 +0,0 @@ -# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) - -> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com) - - -## Use the built-in - -Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari), -support `Object.assign()` :tada:. If you target only those environments, then by all -means, use `Object.assign()` instead of this package. - - -## Install - -``` -$ npm install --save object-assign -``` - - -## Usage - -```js -const objectAssign = require('object-assign'); - -objectAssign({foo: 0}, {bar: 1}); -//=> {foo: 0, bar: 1} - -// multiple sources -objectAssign({foo: 0}, {bar: 1}, {baz: 2}); -//=> {foo: 0, bar: 1, baz: 2} - -// overwrites equal keys -objectAssign({foo: 0}, {foo: 1}, {foo: 2}); -//=> {foo: 2} - -// ignores null and undefined sources -objectAssign({foo: 0}, null, {bar: 1}, undefined); -//=> {foo: 0, bar: 1} -``` - - -## API - -### objectAssign(target, [source, ...]) - -Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. - - -## Resources - -- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) - - -## Related - -- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/object-copy/LICENSE b/node_modules/object-copy/LICENSE deleted file mode 100644 index e28e60323..000000000 --- a/node_modules/object-copy/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/object-copy/index.js b/node_modules/object-copy/index.js deleted file mode 100644 index f9faa2235..000000000 --- a/node_modules/object-copy/index.js +++ /dev/null @@ -1,174 +0,0 @@ -'use strict'; - -var typeOf = require('kind-of'); -var copyDescriptor = require('copy-descriptor'); -var define = require('define-property'); - -/** - * Copy static properties, prototype properties, and descriptors from one object to another. - * - * ```js - * function App() {} - * var proto = App.prototype; - * App.prototype.set = function() {}; - * App.prototype.get = function() {}; - * - * var obj = {}; - * copy(obj, proto); - * ``` - * @param {Object} `receiver` - * @param {Object} `provider` - * @param {String|Array} `omit` One or more properties to omit - * @return {Object} - * @api public - */ - -function copy(receiver, provider, omit) { - if (!isObject(receiver)) { - throw new TypeError('expected receiving object to be an object.'); - } - if (!isObject(provider)) { - throw new TypeError('expected providing object to be an object.'); - } - - var props = nativeKeys(provider); - var keys = Object.keys(provider); - var len = props.length; - omit = arrayify(omit); - - while (len--) { - var key = props[len]; - - if (has(keys, key)) { - define(receiver, key, provider[key]); - } else if (!(key in receiver) && !has(omit, key)) { - copyDescriptor(receiver, provider, key); - } - } -}; - -/** - * Return true if the given value is an object or function - */ - -function isObject(val) { - return typeOf(val) === 'object' || typeof val === 'function'; -} - -/** - * Returns true if an array has any of the given elements, or an - * object has any of the give keys. - * - * ```js - * has(['a', 'b', 'c'], 'c'); - * //=> true - * - * has(['a', 'b', 'c'], ['c', 'z']); - * //=> true - * - * has({a: 'b', c: 'd'}, ['c', 'z']); - * //=> true - * ``` - * @param {Object} `obj` - * @param {String|Array} `val` - * @return {Boolean} - */ - -function has(obj, val) { - val = arrayify(val); - var len = val.length; - - if (isObject(obj)) { - for (var key in obj) { - if (val.indexOf(key) > -1) { - return true; - } - } - - var keys = nativeKeys(obj); - return has(keys, val); - } - - if (Array.isArray(obj)) { - var arr = obj; - while (len--) { - if (arr.indexOf(val[len]) > -1) { - return true; - } - } - return false; - } - - throw new TypeError('expected an array or object.'); -} - -/** - * Cast the given value to an array. - * - * ```js - * arrayify('foo'); - * //=> ['foo'] - * - * arrayify(['foo']); - * //=> ['foo'] - * ``` - * - * @param {String|Array} `val` - * @return {Array} - */ - -function arrayify(val) { - return val ? (Array.isArray(val) ? val : [val]) : []; -} - -/** - * Returns true if a value has a `contructor` - * - * ```js - * hasConstructor({}); - * //=> true - * - * hasConstructor(Object.create(null)); - * //=> false - * ``` - * @param {Object} `value` - * @return {Boolean} - */ - -function hasConstructor(val) { - return isObject(val) && typeof val.constructor !== 'undefined'; -} - -/** - * Get the native `ownPropertyNames` from the constructor of the - * given `object`. An empty array is returned if the object does - * not have a constructor. - * - * ```js - * nativeKeys({a: 'b', b: 'c', c: 'd'}) - * //=> ['a', 'b', 'c'] - * - * nativeKeys(function(){}) - * //=> ['length', 'caller'] - * ``` - * - * @param {Object} `obj` Object that has a `constructor`. - * @return {Array} Array of keys. - */ - -function nativeKeys(val) { - if (!hasConstructor(val)) return []; - return Object.getOwnPropertyNames(val); -} - -/** - * Expose `copy` - */ - -module.exports = copy; - -/** - * Expose `copy.has` for tests - */ - -module.exports.has = has; diff --git a/node_modules/object-copy/node_modules/define-property/LICENSE b/node_modules/object-copy/node_modules/define-property/LICENSE deleted file mode 100644 index 65f90aca8..000000000 --- a/node_modules/object-copy/node_modules/define-property/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/object-copy/node_modules/define-property/README.md b/node_modules/object-copy/node_modules/define-property/README.md deleted file mode 100644 index 8cac698ad..000000000 --- a/node_modules/object-copy/node_modules/define-property/README.md +++ /dev/null @@ -1,77 +0,0 @@ -# define-property [![NPM version](https://badge.fury.io/js/define-property.svg)](http://badge.fury.io/js/define-property) - -> Define a non-enumerable property on an object. - -## Install - -Install with [npm](https://www.npmjs.com/) - -```sh -$ npm i define-property --save -``` - -## Usage - -**Params** - -* `obj`: The object on which to define the property. -* `prop`: The name of the property to be defined or modified. -* `descriptor`: The descriptor for the property being defined or modified. - -```js -var define = require('define-property'); -var obj = {}; -define(obj, 'foo', function(val) { - return val.toUpperCase(); -}); - -console.log(obj); -//=> {} - -console.log(obj.foo('bar')); -//=> 'BAR' -``` - -**get/set** - -```js -define(obj, 'foo', { - get: function() {}, - set: function() {} -}); -``` - -## Related projects - -* [delegate-object](https://www.npmjs.com/package/delegate-object): Copy properties from an object to another object, where properties with function values will be… [more](https://www.npmjs.com/package/delegate-object) | [homepage](https://github.com/doowb/delegate-object) -* [forward-object](https://www.npmjs.com/package/forward-object): Copy properties from an object to another object, where properties with function values will be… [more](https://www.npmjs.com/package/forward-object) | [homepage](https://github.com/doowb/forward-object) -* [mixin-deep](https://www.npmjs.com/package/mixin-deep): Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. | [homepage](https://github.com/jonschlinkert/mixin-deep) -* [mixin-object](https://www.npmjs.com/package/mixin-object): Mixin the own and inherited properties of other objects onto the first object. Pass an… [more](https://www.npmjs.com/package/mixin-object) | [homepage](https://github.com/jonschlinkert/mixin-object) - -## Running tests - -Install dev dependencies: - -```sh -$ npm i -d && npm test -``` - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/define-property/issues/new). - -## Author - -**Jon Schlinkert** - -+ [github/jonschlinkert](https://github.com/jonschlinkert) -+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2015 Jon Schlinkert -Released under the MIT license. - -*** - -_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 31, 2015._ diff --git a/node_modules/object-copy/node_modules/define-property/index.js b/node_modules/object-copy/node_modules/define-property/index.js deleted file mode 100644 index 3e0e5e133..000000000 --- a/node_modules/object-copy/node_modules/define-property/index.js +++ /dev/null @@ -1,31 +0,0 @@ -/*! - * define-property - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var isDescriptor = require('is-descriptor'); - -module.exports = function defineProperty(obj, prop, val) { - if (typeof obj !== 'object' && typeof obj !== 'function') { - throw new TypeError('expected an object or function.'); - } - - if (typeof prop !== 'string') { - throw new TypeError('expected `prop` to be a string.'); - } - - if (isDescriptor(val) && ('set' in val || 'get' in val)) { - return Object.defineProperty(obj, prop, val); - } - - return Object.defineProperty(obj, prop, { - configurable: true, - enumerable: false, - writable: true, - value: val - }); -}; diff --git a/node_modules/object-copy/node_modules/define-property/package.json b/node_modules/object-copy/node_modules/define-property/package.json deleted file mode 100644 index c1c6e4250..000000000 --- a/node_modules/object-copy/node_modules/define-property/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "_from": "define-property@^0.2.5", - "_id": "define-property@0.2.5", - "_inBundle": false, - "_integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "_location": "/object-copy/define-property", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "define-property@^0.2.5", - "name": "define-property", - "escapedName": "define-property", - "rawSpec": "^0.2.5", - "saveSpec": null, - "fetchSpec": "^0.2.5" - }, - "_requiredBy": [ - "/object-copy" - ], - "_resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "_shasum": "c35b1ef918ec3c990f9a5bc57be04aacec5c8116", - "_spec": "define-property@^0.2.5", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/object-copy", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/define-property/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "deprecated": false, - "description": "Define a non-enumerable property on an object.", - "devDependencies": { - "mocha": "*", - "should": "^7.0.4" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/define-property", - "keywords": [ - "define", - "define-property", - "enumerable", - "key", - "non", - "non-enumerable", - "object", - "prop", - "property", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "define-property", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/define-property.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "mixin-deep", - "mixin-object", - "delegate-object", - "forward-object" - ] - } - }, - "version": "0.2.5" -} diff --git a/node_modules/object-copy/package.json b/node_modules/object-copy/package.json deleted file mode 100644 index c35b48781..000000000 --- a/node_modules/object-copy/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "_from": "object-copy@^0.1.0", - "_id": "object-copy@0.1.0", - "_inBundle": false, - "_integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "_location": "/object-copy", - "_phantomChildren": { - "is-descriptor": "0.1.6" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "object-copy@^0.1.0", - "name": "object-copy", - "escapedName": "object-copy", - "rawSpec": "^0.1.0", - "saveSpec": null, - "fetchSpec": "^0.1.0" - }, - "_requiredBy": [ - "/static-extend" - ], - "_resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "_shasum": "7e7d858b781bd7c991a41ba975ed3812754e998c", - "_spec": "object-copy@^0.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/static-extend", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/object-copy/issues" - }, - "bundleDependencies": false, - "dependencies": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "deprecated": false, - "description": "Copy static properties, prototype properties, and descriptors from one object to another.", - "devDependencies": { - "gulp-format-md": "*", - "mocha": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/object-copy", - "keywords": [ - "copy", - "object" - ], - "license": "MIT", - "main": "index.js", - "name": "object-copy", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/object-copy.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "layout": "default", - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [] - }, - "reflinks": [ - "verb" - ] - }, - "version": "0.1.0" -} diff --git a/node_modules/object-visit/LICENSE b/node_modules/object-visit/LICENSE deleted file mode 100644 index ec85897eb..000000000 --- a/node_modules/object-visit/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015, 2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/object-visit/README.md b/node_modules/object-visit/README.md deleted file mode 100644 index 64015cb9a..000000000 --- a/node_modules/object-visit/README.md +++ /dev/null @@ -1,83 +0,0 @@ -# object-visit [![NPM version](https://img.shields.io/npm/v/object-visit.svg?style=flat)](https://www.npmjs.com/package/object-visit) [![NPM monthly downloads](https://img.shields.io/npm/dm/object-visit.svg?style=flat)](https://npmjs.org/package/object-visit) [![NPM total downloads](https://img.shields.io/npm/dt/object-visit.svg?style=flat)](https://npmjs.org/package/object-visit) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/object-visit.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/object-visit) - -> Call a specified method on each value in the given object. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save object-visit -``` - -## Usage - -```js -var visit = require('object-visit'); - -var ctx = { - data: {}, - set: function (key, value) { - if (typeof key === 'object') { - visit(ctx, 'set', key); - } else { - ctx.data[key] = value; - } - } -}; - -ctx.set('a', 'a'); -ctx.set('b', 'b'); -ctx.set('c', 'c'); -ctx.set({d: {e: 'f'}}); - -console.log(ctx.data); -//=> {a: 'a', b: 'b', c: 'c', d: { e: 'f' }}; -``` - -## About - -### Related projects - -* [base-methods](https://www.npmjs.com/package/base-methods): base-methods is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… [more](https://github.com/jonschlinkert/base-methods) | [homepage](https://github.com/jonschlinkert/base-methods "base-methods is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting with a handful of common methods, like `set`, `get`, `del` and `use`.") -* [collection-visit](https://www.npmjs.com/package/collection-visit): Visit a method over the items in an object, or map visit over the objects… [more](https://github.com/jonschlinkert/collection-visit) | [homepage](https://github.com/jonschlinkert/collection-visit "Visit a method over the items in an object, or map visit over the objects in an array.") -* [define-property](https://www.npmjs.com/package/define-property): Define a non-enumerable property on an object. | [homepage](https://github.com/jonschlinkert/define-property "Define a non-enumerable property on an object.") -* [map-visit](https://www.npmjs.com/package/map-visit): Map `visit` over an array of objects. | [homepage](https://github.com/jonschlinkert/map-visit "Map `visit` over an array of objects.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 30, 2017._ \ No newline at end of file diff --git a/node_modules/object-visit/index.js b/node_modules/object-visit/index.js deleted file mode 100644 index fcaeda925..000000000 --- a/node_modules/object-visit/index.js +++ /dev/null @@ -1,33 +0,0 @@ -/*! - * object-visit - * - * Copyright (c) 2015, 2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var isObject = require('isobject'); - -module.exports = function visit(thisArg, method, target, val) { - if (!isObject(thisArg) && typeof thisArg !== 'function') { - throw new Error('object-visit expects `thisArg` to be an object.'); - } - - if (typeof method !== 'string') { - throw new Error('object-visit expects `method` name to be a string'); - } - - if (typeof thisArg[method] !== 'function') { - return thisArg; - } - - var args = [].slice.call(arguments, 3); - target = target || {}; - - for (var key in target) { - var arr = [key, target[key]].concat(args); - thisArg[method].apply(thisArg, arr); - } - return thisArg; -}; diff --git a/node_modules/object-visit/node_modules/isobject/LICENSE b/node_modules/object-visit/node_modules/isobject/LICENSE deleted file mode 100644 index 943e71d05..000000000 --- a/node_modules/object-visit/node_modules/isobject/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert. - -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. \ No newline at end of file diff --git a/node_modules/object-visit/node_modules/isobject/README.md b/node_modules/object-visit/node_modules/isobject/README.md deleted file mode 100644 index d01feaa40..000000000 --- a/node_modules/object-visit/node_modules/isobject/README.md +++ /dev/null @@ -1,122 +0,0 @@ -# isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM monthly downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![NPM total downloads](https://img.shields.io/npm/dt/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/isobject) - -> Returns true if the value is an object and not an array or null. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save isobject -``` - -Install with [yarn](https://yarnpkg.com): - -```sh -$ yarn add isobject -``` - -Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install isobject -``` -Install with [bower](https://bower.io/) - -```sh -$ bower install isobject -``` - -## Usage - -```js -var isObject = require('isobject'); -``` - -**True** - -All of the following return `true`: - -```js -isObject({}); -isObject(Object.create({})); -isObject(Object.create(Object.prototype)); -isObject(Object.create(null)); -isObject({}); -isObject(new Foo); -isObject(/foo/); -``` - -**False** - -All of the following return `false`: - -```js -isObject(); -isObject(function () {}); -isObject(1); -isObject([]); -isObject(undefined); -isObject(null); -``` - -## About - -### Related projects - -* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") -* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") -* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") -* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 29 | [jonschlinkert](https://github.com/jonschlinkert) | -| 4 | [doowb](https://github.com/doowb) | -| 1 | [magnudae](https://github.com/magnudae) | -| 1 | [LeSuisse](https://github.com/LeSuisse) | -| 1 | [tmcw](https://github.com/tmcw) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 30, 2017._ \ No newline at end of file diff --git a/node_modules/object-visit/node_modules/isobject/index.d.ts b/node_modules/object-visit/node_modules/isobject/index.d.ts deleted file mode 100644 index 55f81c275..000000000 --- a/node_modules/object-visit/node_modules/isobject/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export = isObject; - -declare function isObject(val: any): boolean; - -declare namespace isObject {} diff --git a/node_modules/object-visit/node_modules/isobject/index.js b/node_modules/object-visit/node_modules/isobject/index.js deleted file mode 100644 index 2d59958bf..000000000 --- a/node_modules/object-visit/node_modules/isobject/index.js +++ /dev/null @@ -1,12 +0,0 @@ -/*! - * isobject - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -module.exports = function isObject(val) { - return val != null && typeof val === 'object' && Array.isArray(val) === false; -}; diff --git a/node_modules/object-visit/node_modules/isobject/package.json b/node_modules/object-visit/node_modules/isobject/package.json deleted file mode 100644 index 093e77ccb..000000000 --- a/node_modules/object-visit/node_modules/isobject/package.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "_from": "isobject@^3.0.0", - "_id": "isobject@3.0.1", - "_inBundle": false, - "_integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "_location": "/object-visit/isobject", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "isobject@^3.0.0", - "name": "isobject", - "escapedName": "isobject", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/object-visit" - ], - "_resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "_shasum": "4e431e92b11a9731636aa1f9c8d1ccbcfdab78df", - "_spec": "isobject@^3.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/object-visit", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/isobject/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "url": "https://github.com/LeSuisse" - }, - { - "name": "Brian Woodward", - "url": "https://twitter.com/doowb" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Magnús Dæhlen", - "url": "https://github.com/magnudae" - }, - { - "name": "Tom MacWright", - "url": "https://macwright.org" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "Returns true if the value is an object and not an array or null.", - "devDependencies": { - "gulp-format-md": "^0.1.9", - "mocha": "^2.4.5" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.d.ts", - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/isobject", - "keywords": [ - "check", - "is", - "is-object", - "isobject", - "kind", - "kind-of", - "kindof", - "native", - "object", - "type", - "typeof", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "isobject", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/isobject.git" - }, - "scripts": { - "test": "mocha" - }, - "types": "index.d.ts", - "verb": { - "related": { - "list": [ - "extend-shallow", - "is-plain-object", - "kind-of", - "merge-deep" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "verb" - ] - }, - "version": "3.0.1" -} diff --git a/node_modules/object-visit/package.json b/node_modules/object-visit/package.json deleted file mode 100644 index 94d0f7b1c..000000000 --- a/node_modules/object-visit/package.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "_from": "object-visit@^1.0.0", - "_id": "object-visit@1.0.1", - "_inBundle": false, - "_integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "_location": "/object-visit", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "object-visit@^1.0.0", - "name": "object-visit", - "escapedName": "object-visit", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/collection-visit", - "/map-visit" - ], - "_resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "_shasum": "f79c4493af0c5377b59fe39d395e41042dd045bb", - "_spec": "object-visit@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/collection-visit", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/object-visit/issues" - }, - "bundleDependencies": false, - "dependencies": { - "isobject": "^3.0.0" - }, - "deprecated": false, - "description": "Call a specified method on each value in the given object.", - "devDependencies": { - "gulp": "^3.9.1", - "gulp-eslint": "^3.0.1", - "gulp-format-md": "^0.1.12", - "gulp-istanbul": "^1.1.1", - "gulp-mocha": "^3.0.0", - "mocha": "^3.2.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/object-visit", - "keywords": [ - "context", - "function", - "helper", - "key", - "method", - "object", - "value", - "visit", - "visitor" - ], - "license": "MIT", - "main": "index.js", - "name": "object-visit", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/object-visit.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "base-methods", - "collection-visit", - "define-property", - "map-visit" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - } - }, - "version": "1.0.1" -} diff --git a/node_modules/object.omit/LICENSE b/node_modules/object.omit/LICENSE deleted file mode 100644 index 842218cf0..000000000 --- a/node_modules/object.omit/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2016, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/object.omit/README.md b/node_modules/object.omit/README.md deleted file mode 100644 index 246efe092..000000000 --- a/node_modules/object.omit/README.md +++ /dev/null @@ -1,118 +0,0 @@ -# object.omit [![NPM version](https://img.shields.io/npm/v/object.omit.svg?style=flat)](https://www.npmjs.com/package/object.omit) [![NPM monthly downloads](https://img.shields.io/npm/dm/object.omit.svg?style=flat)](https://npmjs.org/package/object.omit) [![NPM total downloads](https://img.shields.io/npm/dt/object.omit.svg?style=flat)](https://npmjs.org/package/object.omit) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/object.omit.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/object.omit) - -> Return a copy of an object excluding the given key, or array of keys. Also accepts an optional filter function as the last argument. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save object.omit -``` - -## Usage - -```js -var omit = require('object.omit'); -``` - -Pass a string `key` to omit: - -```js -omit({a: 'a', b: 'b', c: 'c'}, 'a') -//=> { b: 'b', c: 'c' } -``` - -Pass an array of `keys` to omit: - -```js -omit({a: 'a', b: 'b', c: 'c'}, ['a', 'c']) -//=> { b: 'b' } -``` - -Returns the object if no keys are passed: - -```js -omit({a: 'a', b: 'b', c: 'c'}) -//=> {a: 'a', b: 'b', c: 'c'} -``` - -Returns an empty object if no value is passed. - -```js -omit() -//=> {} -``` - -### Filter function - -An optional filter function may be passed as the last argument, with or without keys passed on the arguments: - -**filter on keys** - -```js -var res = omit({a: 'a', b: 'b', c: 'c'}, function (val, key) { - return key === 'a'; -}); -//=> {a: 'a'} -``` - -**filter on values** - -```js -var fn = function() {}; -var obj = {a: 'a', b: 'b', c: fn}; - -var res = omit(obj, ['a'], function (val, key) { - return typeof val !== 'function'; -}); -//=> {b: 'b'} -``` - -## About - -### Related projects - -* [object.defaults](https://www.npmjs.com/package/object.defaults): Like `extend` but only copies missing properties/values to the target object. | [homepage](https://github.com/jonschlinkert/object.defaults "Like `extend` but only copies missing properties/values to the target object.") -* [object.filter](https://www.npmjs.com/package/object.filter): Create a new object filtered to have only properties for which the callback returns true. | [homepage](https://github.com/jonschlinkert/object.filter "Create a new object filtered to have only properties for which the callback returns true.") -* [object.pick](https://www.npmjs.com/package/object.pick): Returns a filtered copy of an object with only the specified keys, similar to `_.pick… [more](https://github.com/jonschlinkert/object.pick) | [homepage](https://github.com/jonschlinkert/object.pick "Returns a filtered copy of an object with only the specified keys, similar to`_.pick` from lodash / underscore.") -* [object.pluck](https://www.npmjs.com/package/object.pluck): Like pluck from underscore / lo-dash, but returns an object composed of specified properties, with… [more](https://github.com/jonschlinkert/object.pluck) | [homepage](https://github.com/jonschlinkert/object.pluck "Like pluck from underscore / lo-dash, but returns an object composed of specified properties, with values unmodified from those of the original object.") -* [object.reduce](https://www.npmjs.com/package/object.reduce): Reduces an object to a value that is the accumulated result of running each property… [more](https://github.com/jonschlinkert/object.reduce) | [homepage](https://github.com/jonschlinkert/object.reduce "Reduces an object to a value that is the accumulated result of running each property in the object through a callback.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Building docs - -_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ - -To generate the readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install -g verb verb-generate-readme && verb -``` - -### Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -### License - -Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/object.omit/blob/master/LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on October 27, 2016._ \ No newline at end of file diff --git a/node_modules/object.omit/index.js b/node_modules/object.omit/index.js deleted file mode 100644 index 503a3c303..000000000 --- a/node_modules/object.omit/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/*! - * object.omit - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var isObject = require('is-extendable'); -var forOwn = require('for-own'); - -module.exports = function omit(obj, keys) { - if (!isObject(obj)) return {}; - - keys = [].concat.apply([], [].slice.call(arguments, 1)); - var last = keys[keys.length - 1]; - var res = {}, fn; - - if (typeof last === 'function') { - fn = keys.pop(); - } - - var isFunction = typeof fn === 'function'; - if (!keys.length && !isFunction) { - return obj; - } - - forOwn(obj, function(value, key) { - if (keys.indexOf(key) === -1) { - - if (!isFunction) { - res[key] = value; - } else if (fn(value, key, obj)) { - res[key] = value; - } - } - }); - return res; -}; diff --git a/node_modules/object.omit/package.json b/node_modules/object.omit/package.json deleted file mode 100644 index f361a8de1..000000000 --- a/node_modules/object.omit/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "_from": "object.omit@^2.0.0", - "_id": "object.omit@2.0.1", - "_inBundle": false, - "_integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", - "_location": "/object.omit", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "object.omit@^2.0.0", - "name": "object.omit", - "escapedName": "object.omit", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/micromatch" - ], - "_resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "_shasum": "1a9c744829f39dbb858c76ca3579ae2a54ebd1fa", - "_spec": "object.omit@^2.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/micromatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/object.omit/issues" - }, - "bundleDependencies": false, - "dependencies": { - "for-own": "^0.1.4", - "is-extendable": "^0.1.1" - }, - "deprecated": false, - "description": "Return a copy of an object excluding the given key, or array of keys. Also accepts an optional filter function as the last argument.", - "devDependencies": { - "gulp-format-md": "^0.1.11", - "mocha": "^3.1.2", - "should": "^11.1.1" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/object.omit", - "keywords": [ - "clear", - "delete", - "key", - "object", - "omit", - "property", - "remove", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "object.omit", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/object.omit.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "object.defaults", - "object.filter", - "object.pick", - "object.pluck", - "object.reduce" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "verb", - "verb-generate-readme" - ] - }, - "version": "2.0.1" -} diff --git a/node_modules/object.pick/LICENSE b/node_modules/object.pick/LICENSE deleted file mode 100644 index 39245ac1c..000000000 --- a/node_modules/object.pick/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2016, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/object.pick/README.md b/node_modules/object.pick/README.md deleted file mode 100644 index 48f745348..000000000 --- a/node_modules/object.pick/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# object.pick [![NPM version](https://img.shields.io/npm/v/object.pick.svg?style=flat)](https://www.npmjs.com/package/object.pick) [![NPM monthly downloads](https://img.shields.io/npm/dm/object.pick.svg?style=flat)](https://npmjs.org/package/object.pick) [![NPM total downloads](https://img.shields.io/npm/dt/object.pick.svg?style=flat)](https://npmjs.org/package/object.pick) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/object.pick.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/object.pick) - -> Returns a filtered copy of an object with only the specified keys, similar to `_.pick` from lodash / underscore. - -You might also be interested in [object.omit](https://github.com/jonschlinkert/object.omit). - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save object.pick -``` - -## benchmarks - -This is the [fastest implementation](http://jsperf.com/pick-props) I tested. Pull requests welcome! - -## Usage - -```js -var pick = require('object.pick'); - -pick({a: 'a', b: 'b'}, 'a') -//=> {a: 'a'} - -pick({a: 'a', b: 'b', c: 'c'}, ['a', 'b']) -//=> {a: 'a', b: 'b'} -``` - -## About - -### Related projects - -* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") -* [get-value](https://www.npmjs.com/package/get-value): Use property paths (`a.b.c`) to get a nested value from an object. | [homepage](https://github.com/jonschlinkert/get-value "Use property paths (`a.b.c`) to get a nested value from an object.") -* [mixin-deep](https://www.npmjs.com/package/mixin-deep): Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. | [homepage](https://github.com/jonschlinkert/mixin-deep "Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone.") -* [set-value](https://www.npmjs.com/package/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/jonschlinkert/set-value "Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Building docs - -_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ - -To generate the readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install -g verb verb-generate-readme && verb -``` - -### Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -### License - -Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/object.pick/blob/master/LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on October 27, 2016._ \ No newline at end of file diff --git a/node_modules/object.pick/index.js b/node_modules/object.pick/index.js deleted file mode 100644 index 0ce01782a..000000000 --- a/node_modules/object.pick/index.js +++ /dev/null @@ -1,35 +0,0 @@ -/*! - * object.pick - * - * Copyright (c) 2014-2015 Jon Schlinkert, contributors. - * Licensed under the MIT License - */ - -'use strict'; - -var isObject = require('isobject'); - -module.exports = function pick(obj, keys) { - if (!isObject(obj) && typeof obj !== 'function') { - return {}; - } - - var res = {}; - if (typeof keys === 'string') { - if (keys in obj) { - res[keys] = obj[keys]; - } - return res; - } - - var len = keys.length; - var idx = -1; - - while (++idx < len) { - var key = keys[idx]; - if (key in obj) { - res[key] = obj[key]; - } - } - return res; -}; diff --git a/node_modules/object.pick/node_modules/isobject/LICENSE b/node_modules/object.pick/node_modules/isobject/LICENSE deleted file mode 100644 index 943e71d05..000000000 --- a/node_modules/object.pick/node_modules/isobject/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert. - -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. \ No newline at end of file diff --git a/node_modules/object.pick/node_modules/isobject/README.md b/node_modules/object.pick/node_modules/isobject/README.md deleted file mode 100644 index d01feaa40..000000000 --- a/node_modules/object.pick/node_modules/isobject/README.md +++ /dev/null @@ -1,122 +0,0 @@ -# isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM monthly downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![NPM total downloads](https://img.shields.io/npm/dt/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/isobject) - -> Returns true if the value is an object and not an array or null. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save isobject -``` - -Install with [yarn](https://yarnpkg.com): - -```sh -$ yarn add isobject -``` - -Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install isobject -``` -Install with [bower](https://bower.io/) - -```sh -$ bower install isobject -``` - -## Usage - -```js -var isObject = require('isobject'); -``` - -**True** - -All of the following return `true`: - -```js -isObject({}); -isObject(Object.create({})); -isObject(Object.create(Object.prototype)); -isObject(Object.create(null)); -isObject({}); -isObject(new Foo); -isObject(/foo/); -``` - -**False** - -All of the following return `false`: - -```js -isObject(); -isObject(function () {}); -isObject(1); -isObject([]); -isObject(undefined); -isObject(null); -``` - -## About - -### Related projects - -* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") -* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") -* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") -* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 29 | [jonschlinkert](https://github.com/jonschlinkert) | -| 4 | [doowb](https://github.com/doowb) | -| 1 | [magnudae](https://github.com/magnudae) | -| 1 | [LeSuisse](https://github.com/LeSuisse) | -| 1 | [tmcw](https://github.com/tmcw) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 30, 2017._ \ No newline at end of file diff --git a/node_modules/object.pick/node_modules/isobject/index.d.ts b/node_modules/object.pick/node_modules/isobject/index.d.ts deleted file mode 100644 index 55f81c275..000000000 --- a/node_modules/object.pick/node_modules/isobject/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export = isObject; - -declare function isObject(val: any): boolean; - -declare namespace isObject {} diff --git a/node_modules/object.pick/node_modules/isobject/index.js b/node_modules/object.pick/node_modules/isobject/index.js deleted file mode 100644 index 2d59958bf..000000000 --- a/node_modules/object.pick/node_modules/isobject/index.js +++ /dev/null @@ -1,12 +0,0 @@ -/*! - * isobject - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -module.exports = function isObject(val) { - return val != null && typeof val === 'object' && Array.isArray(val) === false; -}; diff --git a/node_modules/object.pick/node_modules/isobject/package.json b/node_modules/object.pick/node_modules/isobject/package.json deleted file mode 100644 index eff09e365..000000000 --- a/node_modules/object.pick/node_modules/isobject/package.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "_from": "isobject@^3.0.1", - "_id": "isobject@3.0.1", - "_inBundle": false, - "_integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "_location": "/object.pick/isobject", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "isobject@^3.0.1", - "name": "isobject", - "escapedName": "isobject", - "rawSpec": "^3.0.1", - "saveSpec": null, - "fetchSpec": "^3.0.1" - }, - "_requiredBy": [ - "/object.pick" - ], - "_resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "_shasum": "4e431e92b11a9731636aa1f9c8d1ccbcfdab78df", - "_spec": "isobject@^3.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/object.pick", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/isobject/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "url": "https://github.com/LeSuisse" - }, - { - "name": "Brian Woodward", - "url": "https://twitter.com/doowb" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Magnús Dæhlen", - "url": "https://github.com/magnudae" - }, - { - "name": "Tom MacWright", - "url": "https://macwright.org" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "Returns true if the value is an object and not an array or null.", - "devDependencies": { - "gulp-format-md": "^0.1.9", - "mocha": "^2.4.5" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.d.ts", - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/isobject", - "keywords": [ - "check", - "is", - "is-object", - "isobject", - "kind", - "kind-of", - "kindof", - "native", - "object", - "type", - "typeof", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "isobject", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/isobject.git" - }, - "scripts": { - "test": "mocha" - }, - "types": "index.d.ts", - "verb": { - "related": { - "list": [ - "extend-shallow", - "is-plain-object", - "kind-of", - "merge-deep" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "verb" - ] - }, - "version": "3.0.1" -} diff --git a/node_modules/object.pick/package.json b/node_modules/object.pick/package.json deleted file mode 100644 index bd6119720..000000000 --- a/node_modules/object.pick/package.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "_from": "object.pick@^1.3.0", - "_id": "object.pick@1.3.0", - "_inBundle": false, - "_integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "_location": "/object.pick", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "object.pick@^1.3.0", - "name": "object.pick", - "escapedName": "object.pick", - "rawSpec": "^1.3.0", - "saveSpec": null, - "fetchSpec": "^1.3.0" - }, - "_requiredBy": [ - "/nanomatch", - "/readdirp/micromatch" - ], - "_resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "_shasum": "87a10ac4c1694bd2e1cbf53591a66141fb5dd747", - "_spec": "object.pick@^1.3.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/object.pick/issues" - }, - "bundleDependencies": false, - "dependencies": { - "isobject": "^3.0.1" - }, - "deprecated": false, - "description": "Returns a filtered copy of an object with only the specified keys, similar to `_.pick` from lodash / underscore.", - "devDependencies": { - "gulp-format-md": "^1.0.0", - "mocha": "^3.1.2", - "vinyl": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/object.pick", - "keywords": [ - "object", - "pick" - ], - "license": "MIT", - "main": "index.js", - "name": "object.pick", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/object.pick.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "run": true, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "extend-shallow", - "get-value", - "mixin-deep", - "set-value" - ], - "highlight": "object.omit" - }, - "reflinks": [ - "verb" - ], - "lint": { - "reflinks": true - } - }, - "version": "1.3.0" -} diff --git a/node_modules/on-finished/HISTORY.md b/node_modules/on-finished/HISTORY.md deleted file mode 100644 index 98ff0e992..000000000 --- a/node_modules/on-finished/HISTORY.md +++ /dev/null @@ -1,88 +0,0 @@ -2.3.0 / 2015-05-26 -================== - - * Add defined behavior for HTTP `CONNECT` requests - * Add defined behavior for HTTP `Upgrade` requests - * deps: ee-first@1.1.1 - -2.2.1 / 2015-04-22 -================== - - * Fix `isFinished(req)` when data buffered - -2.2.0 / 2014-12-22 -================== - - * Add message object to callback arguments - -2.1.1 / 2014-10-22 -================== - - * Fix handling of pipelined requests - -2.1.0 / 2014-08-16 -================== - - * Check if `socket` is detached - * Return `undefined` for `isFinished` if state unknown - -2.0.0 / 2014-08-16 -================== - - * Add `isFinished` function - * Move to `jshttp` organization - * Remove support for plain socket argument - * Rename to `on-finished` - * Support both `req` and `res` as arguments - * deps: ee-first@1.0.5 - -1.2.2 / 2014-06-10 -================== - - * Reduce listeners added to emitters - - avoids "event emitter leak" warnings when used multiple times on same request - -1.2.1 / 2014-06-08 -================== - - * Fix returned value when already finished - -1.2.0 / 2014-06-05 -================== - - * Call callback when called on already-finished socket - -1.1.4 / 2014-05-27 -================== - - * Support node.js 0.8 - -1.1.3 / 2014-04-30 -================== - - * Make sure errors passed as instanceof `Error` - -1.1.2 / 2014-04-18 -================== - - * Default the `socket` to passed-in object - -1.1.1 / 2014-01-16 -================== - - * Rename module to `finished` - -1.1.0 / 2013-12-25 -================== - - * Call callback when called on already-errored socket - -1.0.1 / 2013-12-20 -================== - - * Actually pass the error to the callback - -1.0.0 / 2013-12-20 -================== - - * Initial release diff --git a/node_modules/on-finished/LICENSE b/node_modules/on-finished/LICENSE deleted file mode 100644 index 5931fd23e..000000000 --- a/node_modules/on-finished/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2013 Jonathan Ong -Copyright (c) 2014 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/on-finished/README.md b/node_modules/on-finished/README.md deleted file mode 100644 index a0e115744..000000000 --- a/node_modules/on-finished/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# on-finished - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Execute a callback when a HTTP request closes, finishes, or errors. - -## Install - -```sh -$ npm install on-finished -``` - -## API - -```js -var onFinished = require('on-finished') -``` - -### onFinished(res, listener) - -Attach a listener to listen for the response to finish. The listener will -be invoked only once when the response finished. If the response finished -to an error, the first argument will contain the error. If the response -has already finished, the listener will be invoked. - -Listening to the end of a response would be used to close things associated -with the response, like open files. - -Listener is invoked as `listener(err, res)`. - -```js -onFinished(res, function (err, res) { - // clean up open fds, etc. - // err contains the error is request error'd -}) -``` - -### onFinished(req, listener) - -Attach a listener to listen for the request to finish. The listener will -be invoked only once when the request finished. If the request finished -to an error, the first argument will contain the error. If the request -has already finished, the listener will be invoked. - -Listening to the end of a request would be used to know when to continue -after reading the data. - -Listener is invoked as `listener(err, req)`. - -```js -var data = '' - -req.setEncoding('utf8') -res.on('data', function (str) { - data += str -}) - -onFinished(req, function (err, req) { - // data is read unless there is err -}) -``` - -### onFinished.isFinished(res) - -Determine if `res` is already finished. This would be useful to check and -not even start certain operations if the response has already finished. - -### onFinished.isFinished(req) - -Determine if `req` is already finished. This would be useful to check and -not even start certain operations if the request has already finished. - -## Special Node.js requests - -### HTTP CONNECT method - -The meaning of the `CONNECT` method from RFC 7231, section 4.3.6: - -> The CONNECT method requests that the recipient establish a tunnel to -> the destination origin server identified by the request-target and, -> if successful, thereafter restrict its behavior to blind forwarding -> of packets, in both directions, until the tunnel is closed. Tunnels -> are commonly used to create an end-to-end virtual connection, through -> one or more proxies, which can then be secured using TLS (Transport -> Layer Security, [RFC5246]). - -In Node.js, these request objects come from the `'connect'` event on -the HTTP server. - -When this module is used on a HTTP `CONNECT` request, the request is -considered "finished" immediately, **due to limitations in the Node.js -interface**. This means if the `CONNECT` request contains a request entity, -the request will be considered "finished" even before it has been read. - -There is no such thing as a response object to a `CONNECT` request in -Node.js, so there is no support for for one. - -### HTTP Upgrade request - -The meaning of the `Upgrade` header from RFC 7230, section 6.1: - -> The "Upgrade" header field is intended to provide a simple mechanism -> for transitioning from HTTP/1.1 to some other protocol on the same -> connection. - -In Node.js, these request objects come from the `'upgrade'` event on -the HTTP server. - -When this module is used on a HTTP request with an `Upgrade` header, the -request is considered "finished" immediately, **due to limitations in the -Node.js interface**. This means if the `Upgrade` request contains a request -entity, the request will be considered "finished" even before it has been -read. - -There is no such thing as a response object to a `Upgrade` request in -Node.js, so there is no support for for one. - -## Example - -The following code ensures that file descriptors are always closed -once the response finishes. - -```js -var destroy = require('destroy') -var http = require('http') -var onFinished = require('on-finished') - -http.createServer(function onRequest(req, res) { - var stream = fs.createReadStream('package.json') - stream.pipe(res) - onFinished(res, function (err) { - destroy(stream) - }) -}) -``` - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/on-finished.svg -[npm-url]: https://npmjs.org/package/on-finished -[node-version-image]: https://img.shields.io/node/v/on-finished.svg -[node-version-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/jshttp/on-finished/master.svg -[travis-url]: https://travis-ci.org/jshttp/on-finished -[coveralls-image]: https://img.shields.io/coveralls/jshttp/on-finished/master.svg -[coveralls-url]: https://coveralls.io/r/jshttp/on-finished?branch=master -[downloads-image]: https://img.shields.io/npm/dm/on-finished.svg -[downloads-url]: https://npmjs.org/package/on-finished diff --git a/node_modules/on-finished/index.js b/node_modules/on-finished/index.js deleted file mode 100644 index 9abd98f9d..000000000 --- a/node_modules/on-finished/index.js +++ /dev/null @@ -1,196 +0,0 @@ -/*! - * on-finished - * Copyright(c) 2013 Jonathan Ong - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = onFinished -module.exports.isFinished = isFinished - -/** - * Module dependencies. - * @private - */ - -var first = require('ee-first') - -/** - * Variables. - * @private - */ - -/* istanbul ignore next */ -var defer = typeof setImmediate === 'function' - ? setImmediate - : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) } - -/** - * Invoke callback when the response has finished, useful for - * cleaning up resources afterwards. - * - * @param {object} msg - * @param {function} listener - * @return {object} - * @public - */ - -function onFinished(msg, listener) { - if (isFinished(msg) !== false) { - defer(listener, null, msg) - return msg - } - - // attach the listener to the message - attachListener(msg, listener) - - return msg -} - -/** - * Determine if message is already finished. - * - * @param {object} msg - * @return {boolean} - * @public - */ - -function isFinished(msg) { - var socket = msg.socket - - if (typeof msg.finished === 'boolean') { - // OutgoingMessage - return Boolean(msg.finished || (socket && !socket.writable)) - } - - if (typeof msg.complete === 'boolean') { - // IncomingMessage - return Boolean(msg.upgrade || !socket || !socket.readable || (msg.complete && !msg.readable)) - } - - // don't know - return undefined -} - -/** - * Attach a finished listener to the message. - * - * @param {object} msg - * @param {function} callback - * @private - */ - -function attachFinishedListener(msg, callback) { - var eeMsg - var eeSocket - var finished = false - - function onFinish(error) { - eeMsg.cancel() - eeSocket.cancel() - - finished = true - callback(error) - } - - // finished on first message event - eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish) - - function onSocket(socket) { - // remove listener - msg.removeListener('socket', onSocket) - - if (finished) return - if (eeMsg !== eeSocket) return - - // finished on first socket event - eeSocket = first([[socket, 'error', 'close']], onFinish) - } - - if (msg.socket) { - // socket already assigned - onSocket(msg.socket) - return - } - - // wait for socket to be assigned - msg.on('socket', onSocket) - - if (msg.socket === undefined) { - // node.js 0.8 patch - patchAssignSocket(msg, onSocket) - } -} - -/** - * Attach the listener to the message. - * - * @param {object} msg - * @return {function} - * @private - */ - -function attachListener(msg, listener) { - var attached = msg.__onFinished - - // create a private single listener with queue - if (!attached || !attached.queue) { - attached = msg.__onFinished = createListener(msg) - attachFinishedListener(msg, attached) - } - - attached.queue.push(listener) -} - -/** - * Create listener on message. - * - * @param {object} msg - * @return {function} - * @private - */ - -function createListener(msg) { - function listener(err) { - if (msg.__onFinished === listener) msg.__onFinished = null - if (!listener.queue) return - - var queue = listener.queue - listener.queue = null - - for (var i = 0; i < queue.length; i++) { - queue[i](err, msg) - } - } - - listener.queue = [] - - return listener -} - -/** - * Patch ServerResponse.prototype.assignSocket for node.js 0.8. - * - * @param {ServerResponse} res - * @param {function} callback - * @private - */ - -function patchAssignSocket(res, callback) { - var assignSocket = res.assignSocket - - if (typeof assignSocket !== 'function') return - - // res.on('socket', callback) is broken in 0.8 - res.assignSocket = function _assignSocket(socket) { - assignSocket.call(this, socket) - callback(socket) - } -} diff --git a/node_modules/on-finished/package.json b/node_modules/on-finished/package.json deleted file mode 100644 index 2e0bdb34c..000000000 --- a/node_modules/on-finished/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "_from": "on-finished@^2.3.0", - "_id": "on-finished@2.3.0", - "_inBundle": false, - "_integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "_location": "/on-finished", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "on-finished@^2.3.0", - "name": "on-finished", - "escapedName": "on-finished", - "rawSpec": "^2.3.0", - "saveSpec": null, - "fetchSpec": "^2.3.0" - }, - "_requiredBy": [ - "/budo", - "/send" - ], - "_resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "_shasum": "20f1336481b083cd75337992a16971aa2d906947", - "_spec": "on-finished@^2.3.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", - "bugs": { - "url": "https://github.com/jshttp/on-finished/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - }, - { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com" - } - ], - "dependencies": { - "ee-first": "1.1.1" - }, - "deprecated": false, - "description": "Execute a callback when a request closes, finishes, or errors", - "devDependencies": { - "istanbul": "0.3.9", - "mocha": "2.2.5" - }, - "engines": { - "node": ">= 0.8" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "index.js" - ], - "homepage": "https://github.com/jshttp/on-finished#readme", - "license": "MIT", - "name": "on-finished", - "repository": { - "type": "git", - "url": "git+https://github.com/jshttp/on-finished.git" - }, - "scripts": { - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" - }, - "version": "2.3.0" -} diff --git a/node_modules/on-headers/HISTORY.md b/node_modules/on-headers/HISTORY.md deleted file mode 100644 index e51ff0176..000000000 --- a/node_modules/on-headers/HISTORY.md +++ /dev/null @@ -1,16 +0,0 @@ -1.0.1 / 2015-09-29 -================== - - * perf: enable strict mode - -1.0.0 / 2014-08-10 -================== - - * Honor `res.statusCode` change in `listener` - * Move to `jshttp` orgainzation - * Prevent `arguments`-related de-opt - -0.0.0 / 2014-05-13 -================== - - * Initial implementation diff --git a/node_modules/on-headers/LICENSE b/node_modules/on-headers/LICENSE deleted file mode 100644 index b7dce6cf9..000000000 --- a/node_modules/on-headers/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/on-headers/README.md b/node_modules/on-headers/README.md deleted file mode 100644 index 48ed9aefa..000000000 --- a/node_modules/on-headers/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# on-headers - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Execute a listener when a response is about to write headers. - -## Installation - -```sh -$ npm install on-headers -``` - -## API - -```js -var onHeaders = require('on-headers') -``` - -### onHeaders(res, listener) - -This will add the listener `listener` to fire when headers are emitted for `res`. -The listener is passed the `response` object as it's context (`this`). Headers are -considered to be emitted only once, right before they are sent to the client. - -When this is called multiple times on the same `res`, the `listener`s are fired -in the reverse order they were added. - -## Examples - -```js -var http = require('http') -var onHeaders = require('on-headers') - -http -.createServer(onRequest) -.listen(3000) - -function addPoweredBy() { - // set if not set by end of request - if (!this.getHeader('X-Powered-By')) { - this.setHeader('X-Powered-By', 'Node.js') - } -} - -function onRequest(req, res) { - onHeaders(res, addPoweredBy) - - res.setHeader('Content-Type', 'text/plain') - res.end('hello!') -} -``` - -## Testing - -```sh -$ npm test -``` - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/on-headers.svg -[npm-url]: https://npmjs.org/package/on-headers -[node-version-image]: https://img.shields.io/node/v/on-headers.svg -[node-version-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/jshttp/on-headers/master.svg -[travis-url]: https://travis-ci.org/jshttp/on-headers -[coveralls-image]: https://img.shields.io/coveralls/jshttp/on-headers/master.svg -[coveralls-url]: https://coveralls.io/r/jshttp/on-headers?branch=master -[downloads-image]: https://img.shields.io/npm/dm/on-headers.svg -[downloads-url]: https://npmjs.org/package/on-headers diff --git a/node_modules/on-headers/index.js b/node_modules/on-headers/index.js deleted file mode 100644 index 089f2b342..000000000 --- a/node_modules/on-headers/index.js +++ /dev/null @@ -1,93 +0,0 @@ -/*! - * on-headers - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Reference to Array slice. - */ - -var slice = Array.prototype.slice - -/** - * Execute a listener when a response is about to write headers. - * - * @param {Object} res - * @return {Function} listener - * @api public - */ - -module.exports = function onHeaders(res, listener) { - if (!res) { - throw new TypeError('argument res is required') - } - - if (typeof listener !== 'function') { - throw new TypeError('argument listener must be a function') - } - - res.writeHead = createWriteHead(res.writeHead, listener) -} - -function createWriteHead(prevWriteHead, listener) { - var fired = false; - - // return function with core name and argument list - return function writeHead(statusCode) { - // set headers from arguments - var args = setWriteHeadHeaders.apply(this, arguments); - - // fire listener - if (!fired) { - fired = true - listener.call(this) - - // pass-along an updated status code - if (typeof args[0] === 'number' && this.statusCode !== args[0]) { - args[0] = this.statusCode - args.length = 1 - } - } - - prevWriteHead.apply(this, args); - } -} - -function setWriteHeadHeaders(statusCode) { - var length = arguments.length - var headerIndex = length > 1 && typeof arguments[1] === 'string' - ? 2 - : 1 - - var headers = length >= headerIndex + 1 - ? arguments[headerIndex] - : undefined - - this.statusCode = statusCode - - // the following block is from node.js core - if (Array.isArray(headers)) { - // handle array case - for (var i = 0, len = headers.length; i < len; ++i) { - this.setHeader(headers[i][0], headers[i][1]) - } - } else if (headers) { - // handle object case - var keys = Object.keys(headers) - for (var i = 0; i < keys.length; i++) { - var k = keys[i] - if (k) this.setHeader(k, headers[k]) - } - } - - // copy leading arguments - var args = new Array(Math.min(length, headerIndex)) - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i] - } - - return args -} diff --git a/node_modules/on-headers/package.json b/node_modules/on-headers/package.json deleted file mode 100644 index dad530642..000000000 --- a/node_modules/on-headers/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_from": "on-headers@^1.0.1", - "_id": "on-headers@1.0.1", - "_inBundle": false, - "_integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=", - "_location": "/on-headers", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "on-headers@^1.0.1", - "name": "on-headers", - "escapedName": "on-headers", - "rawSpec": "^1.0.1", - "saveSpec": null, - "fetchSpec": "^1.0.1" - }, - "_requiredBy": [ - "/budo" - ], - "_resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", - "_shasum": "928f5d0f470d49342651ea6794b0857c100693f7", - "_spec": "on-headers@^1.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", - "author": { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - }, - "bugs": { - "url": "https://github.com/jshttp/on-headers/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Execute a listener when a response is about to write headers", - "devDependencies": { - "istanbul": "0.3.21", - "mocha": "2.3.3", - "supertest": "1.1.0" - }, - "engines": { - "node": ">= 0.8" - }, - "files": [ - "LICENSE", - "HISTORY.md", - "README.md", - "index.js" - ], - "homepage": "https://github.com/jshttp/on-headers#readme", - "keywords": [ - "event", - "headers", - "http", - "onheaders" - ], - "license": "MIT", - "name": "on-headers", - "repository": { - "type": "git", - "url": "git+https://github.com/jshttp/on-headers.git" - }, - "scripts": { - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" - }, - "version": "1.0.1" -} diff --git a/node_modules/once/LICENSE b/node_modules/once/LICENSE deleted file mode 100644 index 19129e315..000000000 --- a/node_modules/once/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/once/README.md b/node_modules/once/README.md deleted file mode 100644 index 1f1ffca93..000000000 --- a/node_modules/once/README.md +++ /dev/null @@ -1,79 +0,0 @@ -# once - -Only call a function once. - -## usage - -```javascript -var once = require('once') - -function load (file, cb) { - cb = once(cb) - loader.load('file') - loader.once('load', cb) - loader.once('error', cb) -} -``` - -Or add to the Function.prototype in a responsible way: - -```javascript -// only has to be done once -require('once').proto() - -function load (file, cb) { - cb = cb.once() - loader.load('file') - loader.once('load', cb) - loader.once('error', cb) -} -``` - -Ironically, the prototype feature makes this module twice as -complicated as necessary. - -To check whether you function has been called, use `fn.called`. Once the -function is called for the first time the return value of the original -function is saved in `fn.value` and subsequent calls will continue to -return this value. - -```javascript -var once = require('once') - -function load (cb) { - cb = once(cb) - var stream = createStream() - stream.once('data', cb) - stream.once('end', function () { - if (!cb.called) cb(new Error('not found')) - }) -} -``` - -## `once.strict(func)` - -Throw an error if the function is called twice. - -Some functions are expected to be called only once. Using `once` for them would -potentially hide logical errors. - -In the example below, the `greet` function has to call the callback only once: - -```javascript -function greet (name, cb) { - // return is missing from the if statement - // when no name is passed, the callback is called twice - if (!name) cb('Hello anonymous') - cb('Hello ' + name) -} - -function log (msg) { - console.log(msg) -} - -// this will print 'Hello anonymous' but the logical error will be missed -greet(null, once(msg)) - -// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time -greet(null, once.strict(msg)) -``` diff --git a/node_modules/once/once.js b/node_modules/once/once.js deleted file mode 100644 index 235406736..000000000 --- a/node_modules/once/once.js +++ /dev/null @@ -1,42 +0,0 @@ -var wrappy = require('wrappy') -module.exports = wrappy(once) -module.exports.strict = wrappy(onceStrict) - -once.proto = once(function () { - Object.defineProperty(Function.prototype, 'once', { - value: function () { - return once(this) - }, - configurable: true - }) - - Object.defineProperty(Function.prototype, 'onceStrict', { - value: function () { - return onceStrict(this) - }, - configurable: true - }) -}) - -function once (fn) { - var f = function () { - if (f.called) return f.value - f.called = true - return f.value = fn.apply(this, arguments) - } - f.called = false - return f -} - -function onceStrict (fn) { - var f = function () { - if (f.called) - throw new Error(f.onceError) - f.called = true - return f.value = fn.apply(this, arguments) - } - var name = fn.name || 'Function wrapped with `once`' - f.onceError = name + " shouldn't be called more than once" - f.called = false - return f -} diff --git a/node_modules/once/package.json b/node_modules/once/package.json deleted file mode 100644 index 0f1ac82ef..000000000 --- a/node_modules/once/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_from": "once@^1.3.2", - "_id": "once@1.4.0", - "_inBundle": false, - "_integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "_location": "/once", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "once@^1.3.2", - "name": "once", - "escapedName": "once", - "rawSpec": "^1.3.2", - "saveSpec": null, - "fetchSpec": "^1.3.2" - }, - "_requiredBy": [ - "/budo", - "/glob", - "/inflight" - ], - "_resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "_shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1", - "_spec": "once@^1.3.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/once/issues" - }, - "bundleDependencies": false, - "dependencies": { - "wrappy": "1" - }, - "deprecated": false, - "description": "Run a function exactly one time", - "devDependencies": { - "tap": "^7.0.1" - }, - "directories": { - "test": "test" - }, - "files": [ - "once.js" - ], - "homepage": "https://github.com/isaacs/once#readme", - "keywords": [ - "once", - "function", - "one", - "single" - ], - "license": "ISC", - "main": "once.js", - "name": "once", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/once.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "1.4.0" -} diff --git a/node_modules/opn/index.js b/node_modules/opn/index.js deleted file mode 100644 index 2ca4c7f30..000000000 --- a/node_modules/opn/index.js +++ /dev/null @@ -1,97 +0,0 @@ -'use strict'; -var path = require('path'); -var childProcess = require('child_process'); -var objectAssign = require('object-assign'); - -module.exports = function (target, opts, cb) { - if (typeof target !== 'string') { - throw new Error('Expected a `target`'); - } - - if (typeof opts === 'function') { - cb = opts; - opts = null; - } - - opts = objectAssign({wait: true}, opts); - - var cmd; - var appArgs = []; - var args = []; - var cpOpts = {}; - - if (Array.isArray(opts.app)) { - appArgs = opts.app.slice(1); - opts.app = opts.app[0]; - } - - if (process.platform === 'darwin') { - cmd = 'open'; - - if (cb && opts.wait) { - args.push('-W'); - } - - if (opts.app) { - args.push('-a', opts.app); - } - - if (appArgs.length > 0) { - args.push('--args'); - args = args.concat(appArgs); - } - } else if (process.platform === 'win32') { - cmd = 'cmd'; - args.push('/c', 'start'); - target = target.replace(/&/g, '^&'); - - if (cb && opts.wait) { - args.push('/wait'); - } - - if (opts.app) { - args.push(opts.app); - } - - if (appArgs.length > 0) { - args = args.concat(appArgs); - } - } else { - if (opts.app) { - cmd = opts.app; - } else { - cmd = path.join(__dirname, 'xdg-open'); - } - - if (appArgs.length > 0) { - args = args.concat(appArgs); - } - - if (!(cb && opts.wait)) { - // xdg-open will block the process unless - // stdio is ignored even if it's unref'd - cpOpts.stdio = 'ignore'; - } - } - - args.push(target); - - var cp = childProcess.spawn(cmd, args, cpOpts); - - if (cb) { - cp.once('error', cb); - - cp.once('close', function (code) { - if (code > 0) { - cb(new Error('Exited with code ' + code)); - return; - } - - cb(); - }); - } else { - cp.unref(); - } - - return cp; -}; diff --git a/node_modules/opn/license b/node_modules/opn/license deleted file mode 100644 index ced6f6b30..000000000 --- a/node_modules/opn/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/opn/package.json b/node_modules/opn/package.json deleted file mode 100644 index aa2d51f61..000000000 --- a/node_modules/opn/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_from": "opn@^3.0.2", - "_id": "opn@3.0.3", - "_inBundle": false, - "_integrity": "sha1-ttmec5n3jWXDuq/+8fsojpuFJDo=", - "_location": "/opn", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "opn@^3.0.2", - "name": "opn", - "escapedName": "opn", - "rawSpec": "^3.0.2", - "saveSpec": null, - "fetchSpec": "^3.0.2" - }, - "_requiredBy": [ - "/budo" - ], - "_resolved": "http://registry.npmjs.org/opn/-/opn-3.0.3.tgz", - "_shasum": "b6d99e7399f78d65c3baaffef1fb288e9b85243a", - "_spec": "opn@^3.0.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/opn/issues" - }, - "bundleDependencies": false, - "dependencies": { - "object-assign": "^4.0.1" - }, - "deprecated": false, - "description": "A better node-open. Opens stuff like websites, files, executables. Cross-platform.", - "devDependencies": { - "mocha": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js", - "xdg-open" - ], - "homepage": "https://github.com/sindresorhus/opn#readme", - "keywords": [ - "app", - "open", - "opn", - "opener", - "opens", - "launch", - "start", - "xdg-open", - "xdg", - "default", - "cmd", - "browser", - "editor", - "executable", - "exe", - "url", - "urls", - "arguments", - "args", - "spawn", - "exec", - "child", - "process", - "website", - "file" - ], - "license": "MIT", - "name": "opn", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/opn.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "3.0.3" -} diff --git a/node_modules/opn/readme.md b/node_modules/opn/readme.md deleted file mode 100644 index 5951cad75..000000000 --- a/node_modules/opn/readme.md +++ /dev/null @@ -1,93 +0,0 @@ -# opn - -> A better [node-open](https://github.com/pwnall/node-open). Opens stuff like websites, files, executables. Cross-platform. - - -#### Why? - -- Actively maintained -- Supports app arguments -- Safer as it uses `spawn` instead of `exec` -- Fixes most of the open `node-open` issues -- Includes the latest [`xdg-open` script](http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=c55122295c2a480fa721a9614f0e2d42b2949c18) for Linux - - -## Install - -``` -$ npm install --save opn -``` - - -## Usage - -```js -var opn = require('opn'); - -opn('unicorn.png'); -// opens the image in the default image viewer - -opn('http://sindresorhus.com'); -// opens the url in the default browser - -opn('http://sindresorhus.com', {app: 'firefox'}); -// specify the app to open in - -opn('http://sindresorhus.com', {app: ['google chrome', '--incognito']}); -// specify app arguments -``` - - -## API - -Uses the command `open` on OS X, `start` on Windows and `xdg-open` on other platforms. - -### opn(target, [options], [callback]) - -Returns the [spawned child process](https://nodejs.org/api/child_process.html#child_process_class_childprocess). You'd normally not need to use this for anything, but it can be useful if you'd like to attach custom event listeners or perform other operations directly on the spawned process. - -#### target - -*Required* -Type: `string` - -The thing you want to open. Can be a URL, file, or executable. - -Opens in the default app for the file type. Eg. URLs opens in your default browser. - -#### options - -Type: `object` - -##### wait - -Type: `boolean` -Default: `true` - -Wait for the opened app to exit before calling the `callback`. If `false` it's called immediately when opening the app. - -On Windows you have to explicitly specify an app for it to be able to wait. - -##### app - -Type: `string`, `array` - -Specify the app to open the `target` with, or an array with the app and app arguments. - -The app name is platform dependent. Don't hard code it in reusable modules. Eg. Chrome is `google chrome` on OS X, `google-chrome` on Linux and `chrome` on Windows. - -#### callback(error) - -Type: `function` - -Called when the opened app exits, or if `wait: false`, immediately when opening. - - -## Related - -- [opn-cli](https://github.com/sindresorhus/opn-cli) - CLI for this module - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/opn/xdg-open b/node_modules/opn/xdg-open deleted file mode 100755 index 9be7f32f6..000000000 --- a/node_modules/opn/xdg-open +++ /dev/null @@ -1,861 +0,0 @@ -#!/bin/sh -#--------------------------------------------- -# xdg-open -# -# Utility script to open a URL in the registered default application. -# -# Refer to the usage() function below for usage. -# -# Copyright 2009-2010, Fathi Boudra -# Copyright 2009-2010, Rex Dieter -# Copyright 2006, Kevin Krammer -# Copyright 2006, Jeremy White -# -# LICENSE: -# -# 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. -# -#--------------------------------------------- - -manualpage() -{ -cat << _MANUALPAGE -Name - - xdg-open - opens a file or URL in the user's preferred - application - -Synopsis - - xdg-open { file | URL } - - xdg-open { --help | --manual | --version } - -Description - - xdg-open opens a file or URL in the user's preferred - application. If a URL is provided the URL will be opened in the - user's preferred web browser. If a file is provided the file - will be opened in the preferred application for files of that - type. xdg-open supports file, ftp, http and https URLs. - - xdg-open is for use inside a desktop session only. It is not - recommended to use xdg-open as root. - -Options - - --help - Show command synopsis. - - --manual - Show this manual page. - - --version - Show the xdg-utils version information. - -Exit Codes - - An exit code of 0 indicates success while a non-zero exit code - indicates failure. The following failure codes can be returned: - - 1 - Error in command line syntax. - - 2 - One of the files passed on the command line did not - exist. - - 3 - A required tool could not be found. - - 4 - The action failed. - -Examples - -xdg-open 'http://www.freedesktop.org/' - - Opens the freedesktop.org website in the user's default - browser. - -xdg-open /tmp/foobar.png - - Opens the PNG image file /tmp/foobar.png in the user's default - image viewing application. -_MANUALPAGE -} - -usage() -{ -cat << _USAGE - xdg-open - opens a file or URL in the user's preferred - application - -Synopsis - - xdg-open { file | URL } - - xdg-open { --help | --manual | --version } - -_USAGE -} - -#@xdg-utils-common@ - -#---------------------------------------------------------------------------- -# Common utility functions included in all XDG wrapper scripts -#---------------------------------------------------------------------------- - -DEBUG() -{ - [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && return 0; - [ ${XDG_UTILS_DEBUG_LEVEL} -lt $1 ] && return 0; - shift - echo "$@" >&2 -} - -# This handles backslashes but not quote marks. -first_word() -{ - read first rest - echo "$first" -} - -#------------------------------------------------------------- -# map a binary to a .desktop file -binary_to_desktop_file() -{ - search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" - binary="`which "$1"`" - binary="`readlink -f "$binary"`" - base="`basename "$binary"`" - IFS=: - for dir in $search; do - unset IFS - [ "$dir" ] || continue - [ -d "$dir/applications" ] || [ -d "$dir/applnk" ] || continue - for file in "$dir"/applications/*.desktop "$dir"/applications/*/*.desktop "$dir"/applnk/*.desktop "$dir"/applnk/*/*.desktop; do - [ -r "$file" ] || continue - # Check to make sure it's worth the processing. - grep -q "^Exec.*$base" "$file" || continue - # Make sure it's a visible desktop file (e.g. not "preferred-web-browser.desktop"). - grep -Eq "^(NoDisplay|Hidden)=true" "$file" && continue - command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" - command="`which "$command"`" - if [ x"`readlink -f "$command"`" = x"$binary" ]; then - # Fix any double slashes that got added path composition - echo "$file" | sed -e 's,//*,/,g' - return - fi - done - done -} - -#------------------------------------------------------------- -# map a .desktop file to a binary -## FIXME: handle vendor dir case -desktop_file_to_binary() -{ - search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" - desktop="`basename "$1"`" - IFS=: - for dir in $search; do - unset IFS - [ "$dir" ] && [ -d "$dir/applications" ] || continue - file="$dir/applications/$desktop" - [ -r "$file" ] || continue - # Remove any arguments (%F, %f, %U, %u, etc.). - command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" - command="`which "$command"`" - readlink -f "$command" - return - done -} - -#------------------------------------------------------------- -# Exit script on successfully completing the desired operation - -exit_success() -{ - if [ $# -gt 0 ]; then - echo "$@" - echo - fi - - exit 0 -} - - -#----------------------------------------- -# Exit script on malformed arguments, not enough arguments -# or missing required option. -# prints usage information - -exit_failure_syntax() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - echo "Try 'xdg-open --help' for more information." >&2 - else - usage - echo "Use 'man xdg-open' or 'xdg-open --manual' for additional info." - fi - - exit 1 -} - -#------------------------------------------------------------- -# Exit script on missing file specified on command line - -exit_failure_file_missing() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - fi - - exit 2 -} - -#------------------------------------------------------------- -# Exit script on failure to locate necessary tool applications - -exit_failure_operation_impossible() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - fi - - exit 3 -} - -#------------------------------------------------------------- -# Exit script on failure returned by a tool application - -exit_failure_operation_failed() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - fi - - exit 4 -} - -#------------------------------------------------------------ -# Exit script on insufficient permission to read a specified file - -exit_failure_file_permission_read() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - fi - - exit 5 -} - -#------------------------------------------------------------ -# Exit script on insufficient permission to write a specified file - -exit_failure_file_permission_write() -{ - if [ $# -gt 0 ]; then - echo "xdg-open: $@" >&2 - fi - - exit 6 -} - -check_input_file() -{ - if [ ! -e "$1" ]; then - exit_failure_file_missing "file '$1' does not exist" - fi - if [ ! -r "$1" ]; then - exit_failure_file_permission_read "no permission to read file '$1'" - fi -} - -check_vendor_prefix() -{ - file_label="$2" - [ -n "$file_label" ] || file_label="filename" - file=`basename "$1"` - case "$file" in - [[:alpha:]]*-*) - return - ;; - esac - - echo "xdg-open: $file_label '$file' does not have a proper vendor prefix" >&2 - echo 'A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated' >&2 - echo 'with a dash ("-"). An example '"$file_label"' is '"'example-$file'" >&2 - echo "Use --novendor to override or 'xdg-open --manual' for additional info." >&2 - exit 1 -} - -check_output_file() -{ - # if the file exists, check if it is writeable - # if it does not exists, check if we are allowed to write on the directory - if [ -e "$1" ]; then - if [ ! -w "$1" ]; then - exit_failure_file_permission_write "no permission to write to file '$1'" - fi - else - DIR=`dirname "$1"` - if [ ! -w "$DIR" ] || [ ! -x "$DIR" ]; then - exit_failure_file_permission_write "no permission to create file '$1'" - fi - fi -} - -#---------------------------------------- -# Checks for shared commands, e.g. --help - -check_common_commands() -{ - while [ $# -gt 0 ] ; do - parm="$1" - shift - - case "$parm" in - --help) - usage - echo "Use 'man xdg-open' or 'xdg-open --manual' for additional info." - exit_success - ;; - - --manual) - manualpage - exit_success - ;; - - --version) - echo "xdg-open 1.1.0 rc3" - exit_success - ;; - esac - done -} - -check_common_commands "$@" - -[ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && unset XDG_UTILS_DEBUG_LEVEL; -if [ ${XDG_UTILS_DEBUG_LEVEL-0} -lt 1 ]; then - # Be silent - xdg_redirect_output=" > /dev/null 2> /dev/null" -else - # All output to stderr - xdg_redirect_output=" >&2" -fi - -#-------------------------------------- -# Checks for known desktop environments -# set variable DE to the desktop environments name, lowercase - -detectDE() -{ - # see https://bugs.freedesktop.org/show_bug.cgi?id=34164 - unset GREP_OPTIONS - - if [ -n "${XDG_CURRENT_DESKTOP}" ]; then - case "${XDG_CURRENT_DESKTOP}" in - ENLIGHTENMENT) - DE=enlightenment; - ;; - GNOME) - DE=gnome; - ;; - KDE) - DE=kde; - ;; - LXDE) - DE=lxde; - ;; - MATE) - DE=mate; - ;; - XFCE) - DE=xfce - ;; - esac - fi - - if [ x"$DE" = x"" ]; then - # classic fallbacks - if [ x"$KDE_FULL_SESSION" != x"" ]; then DE=kde; - elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; - elif [ x"$MATE_DESKTOP_SESSION_ID" != x"" ]; then DE=mate; - elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome; - elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; - elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null 2>&1; then DE=xfce - elif echo $DESKTOP | grep -q '^Enlightenment'; then DE=enlightenment; - fi - fi - - if [ x"$DE" = x"" ]; then - # fallback to checking $DESKTOP_SESSION - case "$DESKTOP_SESSION" in - gnome) - DE=gnome; - ;; - LXDE|Lubuntu) - DE=lxde; - ;; - MATE) - DE=mate; - ;; - xfce|xfce4|'Xfce Session') - DE=xfce; - ;; - esac - fi - - if [ x"$DE" = x"" ]; then - # fallback to uname output for other platforms - case "$(uname 2>/dev/null)" in - Darwin) - DE=darwin; - ;; - esac - fi - - if [ x"$DE" = x"gnome" ]; then - # gnome-default-applications-properties is only available in GNOME 2.x - # but not in GNOME 3.x - which gnome-default-applications-properties > /dev/null 2>&1 || DE="gnome3" - fi -} - -#---------------------------------------------------------------------------- -# kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4 -# It also always returns 1 in KDE 3.4 and earlier -# Simply return 0 in such case - -kfmclient_fix_exit_code() -{ - version=`LC_ALL=C.UTF-8 kde-config --version 2>/dev/null | grep '^KDE'` - major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'` - minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'` - release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'` - test "$major" -gt 3 && return $1 - test "$minor" -gt 5 && return $1 - test "$release" -gt 4 && return $1 - return 0 -} - -# This handles backslashes but not quote marks. -last_word() -{ - read first rest - echo "$rest" -} - -# Get the value of a key in a desktop file's Desktop Entry group. -# Example: Use get_key foo.desktop Exec -# to get the values of the Exec= key for the Desktop Entry group. -get_key() -{ - local file="${1}" - local key="${2}" - local desktop_entry="" - - IFS_="${IFS}" - IFS="" - while read line - do - case "$line" in - "[Desktop Entry]") - desktop_entry="y" - ;; - # Reset match flag for other groups - "["*) - desktop_entry="" - ;; - "${key}="*) - # Only match Desktop Entry group - if [ -n "${desktop_entry}" ] - then - echo "${line}" | cut -d= -f 2- - fi - esac - done < "${file}" - IFS="${IFS_}" -} - -open_darwin() -{ - open "$1" - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_kde() -{ - if [ -n "${KDE_SESSION_VERSION}" ]; then - case "${KDE_SESSION_VERSION}" in - 4) - kde-open "$1" - ;; - 5) - kde-open${KDE_SESSION_VERSION} "$1" - ;; - esac - else - kfmclient exec "$1" - kfmclient_fix_exit_code $? - fi - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_gnome() -{ - if gvfs-open --help 2>/dev/null 1>&2; then - gvfs-open "$1" - else - gnome-open "$1" - fi - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_mate() -{ - if gvfs-open --help 2>/dev/null 1>&2; then - gvfs-open "$1" - else - mate-open "$1" - fi - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_xfce() -{ - exo-open "$1" - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -open_enlightenment() -{ - enlightenment_open "$1" - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -#----------------------------------------- -# Recursively search .desktop file - -search_desktop_file() -{ - local default="$1" - local dir="$2" - local target="$3" - - local file="" - # look for both vendor-app.desktop, vendor/app.desktop - if [ -r "$dir/$default" ]; then - file="$dir/$default" - elif [ -r "$dir/`echo $default | sed -e 's|-|/|'`" ]; then - file="$dir/`echo $default | sed -e 's|-|/|'`" - fi - - if [ -r "$file" ] ; then - command="$(get_key "${file}" "Exec" | first_word)" - command_exec=`which $command 2>/dev/null` - icon="$(get_key "${file}" "Icon")" - # FIXME: Actually LC_MESSAGES should be used as described in - # http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s04.html - localised_name="$(get_key "${file}" "Name")" - set -- $(get_key "${file}" "Exec" | last_word) - # We need to replace any occurrence of "%f", "%F" and - # the like by the target file. We examine each - # argument and append the modified argument to the - # end then shift. - local args=$# - local replaced=0 - while [ $args -gt 0 ]; do - case $1 in - %[c]) - replaced=1 - arg="${localised_name}" - shift - set -- "$@" "$arg" - ;; - %[fFuU]) - replaced=1 - arg="$target" - shift - set -- "$@" "$arg" - ;; - %[i]) - replaced=1 - shift - set -- "$@" "--icon" "$icon" - ;; - *) - arg="$1" - shift - set -- "$@" "$arg" - ;; - esac - args=$(( $args - 1 )) - done - [ $replaced -eq 1 ] || set -- "$@" "$target" - "$command_exec" "$@" - - if [ $? -eq 0 ]; then - exit_success - fi - fi - - for d in $dir/*/; do - [ -d "$d" ] && search_desktop_file "$default" "$d" "$target" - done -} - - -open_generic_xdg_mime() -{ - filetype="$2" - default=`xdg-mime query default "$filetype"` - if [ -n "$default" ] ; then - xdg_user_dir="$XDG_DATA_HOME" - [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" - - xdg_system_dirs="$XDG_DATA_DIRS" - [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/ - -DEBUG 3 "$xdg_user_dir:$xdg_system_dirs" - for x in `echo "$xdg_user_dir:$xdg_system_dirs" | sed 's/:/ /g'`; do - search_desktop_file "$default" "$x/applications/" "$1" - done - fi -} - -open_generic_xdg_file_mime() -{ - filetype=`xdg-mime query filetype "$1" | sed "s/;.*//"` - open_generic_xdg_mime "$1" "$filetype" -} - -open_generic_xdg_x_scheme_handler() -{ - scheme="`echo $1 | sed -n 's/\(^[[:alnum:]+\.-]*\):.*$/\1/p'`" - if [ -n $scheme ]; then - filetype="x-scheme-handler/$scheme" - open_generic_xdg_mime "$1" "$filetype" - fi -} - -open_generic() -{ - # Paths or file:// URLs - if (echo "$1" | grep -q '^file://' || - ! echo "$1" | egrep -q '^[[:alpha:]+\.\-]+:'); then - - local file="$1" - - # Decode URLs - if echo "$file" | grep -q '^file:///'; then - file=${file#file://} - file="$(printf "$(echo "$file" | sed -e 's@%\([a-f0-9A-F]\{2\}\)@\\x\1@g')")" - fi - file_check=${file%%#*} - file_check=${file_check%%\?*} - check_input_file "$file_check" - - filetype=`xdg-mime query filetype "$file_check" | sed "s/;.*//"` - open_generic_xdg_mime "$file" "$filetype" - - if which run-mailcap 2>/dev/null 1>&2; then - run-mailcap --action=view "$file" - if [ $? -eq 0 ]; then - exit_success - fi - fi - - if mimeopen -v 2>/dev/null 1>&2; then - mimeopen -L -n "$file" - if [ $? -eq 0 ]; then - exit_success - fi - fi - fi - - open_generic_xdg_x_scheme_handler "$1" - - IFS=":" - for browser in $BROWSER; do - if [ x"$browser" != x"" ]; then - - browser_with_arg=`printf "$browser" "$1" 2>/dev/null` - if [ $? -ne 0 ]; then - browser_with_arg=$browser; - fi - - if [ x"$browser_with_arg" = x"$browser" ]; then - eval '$browser "$1"'$xdg_redirect_output; - else eval '$browser_with_arg'$xdg_redirect_output; - fi - - if [ $? -eq 0 ]; then - exit_success; - fi - fi - done - - exit_failure_operation_impossible "no method available for opening '$1'" -} - -open_lxde() -{ - # pcmanfm only knows how to handle file:// urls and filepaths, it seems. - if (echo "$1" | grep -q '^file://' || - ! echo "$1" | egrep -q '^[[:alpha:]+\.\-]+:') - then - local file="$1" - - # handle relative paths - if ! echo "$file" | egrep -q '^(file://)?/'; then - file="$(pwd)/$file" - fi - - pcmanfm "$file" - - else - open_generic "$1" - fi - - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed - fi -} - -[ x"$1" != x"" ] || exit_failure_syntax - -url= -while [ $# -gt 0 ] ; do - parm="$1" - shift - - case "$parm" in - -*) - exit_failure_syntax "unexpected option '$parm'" - ;; - - *) - if [ -n "$url" ] ; then - exit_failure_syntax "unexpected argument '$parm'" - fi - url="$parm" - ;; - esac -done - -if [ -z "${url}" ] ; then - exit_failure_syntax "file or URL argument missing" -fi - -detectDE - -if [ x"$DE" = x"" ]; then - DE=generic -fi - -DEBUG 2 "Selected DE $DE" - -# sanitize BROWSER (avoid caling ourselves in particular) -case "${BROWSER}" in - *:"xdg-open"|"xdg-open":*) - BROWSER=$(echo $BROWSER | sed -e 's|:xdg-open||g' -e 's|xdg-open:||g') - ;; - "xdg-open") - BROWSER= - ;; -esac - -# if BROWSER variable is not set, check some well known browsers instead -if [ x"$BROWSER" = x"" ]; then - BROWSER=links2:elinks:links:lynx:w3m - if [ -n "$DISPLAY" ]; then - BROWSER=x-www-browser:firefox:seamonkey:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER - fi -fi - -case "$DE" in - kde) - open_kde "$url" - ;; - - gnome*) - open_gnome "$url" - ;; - - mate) - open_mate "$url" - ;; - - xfce) - open_xfce "$url" - ;; - - lxde) - open_lxde "$url" - ;; - - enlightenment) - open_enlightenment "$url" - ;; - - generic) - open_generic "$url" - ;; - - *) - exit_failure_operation_impossible "no method available for opening '$url'" - ;; -esac diff --git a/node_modules/options/.npmignore b/node_modules/options/.npmignore deleted file mode 100644 index 1b18fb395..000000000 --- a/node_modules/options/.npmignore +++ /dev/null @@ -1,7 +0,0 @@ -npm-debug.log -node_modules -.*.swp -.lock-* -build/ - -test diff --git a/node_modules/options/Makefile b/node_modules/options/Makefile deleted file mode 100644 index 7496b6fcc..000000000 --- a/node_modules/options/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -ALL_TESTS = $(shell find test/ -name '*.test.js') - -run-tests: - @./node_modules/.bin/mocha \ - -t 2000 \ - $(TESTFLAGS) \ - $(TESTS) - -test: - @$(MAKE) NODE_PATH=lib TESTS="$(ALL_TESTS)" run-tests - -.PHONY: test diff --git a/node_modules/options/README.md b/node_modules/options/README.md deleted file mode 100644 index 0dabc7551..000000000 --- a/node_modules/options/README.md +++ /dev/null @@ -1,69 +0,0 @@ -# options.js # - -A very light-weight in-code option parsers for node.js. - -## Usage ## - -``` js -var Options = require("options"); - -// Create an Options object -function foo(options) { - var default_options = { - foo : "bar" - }; - - // Create an option object with default value - var opts = new Options(default_options); - - // Merge options - opts = opts.merge(options); - - // Reset to default value - opts.reset(); - - // Copy selected attributes out - var seled_att = opts.copy("foo"); - - // Read json options from a file. - opts.read("options.file"); // Sync - opts.read("options.file", function(err){ // Async - if(err){ // If error occurs - console.log("File error."); - }else{ - // No error - } - }); - - // Attributes defined or not - opts.isDefinedAndNonNull("foobar"); - opts.isDefined("foobar"); -} - -``` - - -## License ## - -(The MIT License) - -Copyright (c) 2012 Einar Otto Stangvik <einaros@gmail.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/options/lib/options.js b/node_modules/options/lib/options.js deleted file mode 100644 index 4fc45e90a..000000000 --- a/node_modules/options/lib/options.js +++ /dev/null @@ -1,86 +0,0 @@ -/*! - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -var fs = require('fs'); - -function Options(defaults) { - var internalValues = {}; - var values = this.value = {}; - Object.keys(defaults).forEach(function(key) { - internalValues[key] = defaults[key]; - Object.defineProperty(values, key, { - get: function() { return internalValues[key]; }, - configurable: false, - enumerable: true - }); - }); - this.reset = function() { - Object.keys(defaults).forEach(function(key) { - internalValues[key] = defaults[key]; - }); - return this; - }; - this.merge = function(options, required) { - options = options || {}; - if (Object.prototype.toString.call(required) === '[object Array]') { - var missing = []; - for (var i = 0, l = required.length; i < l; ++i) { - var key = required[i]; - if (!(key in options)) { - missing.push(key); - } - } - if (missing.length > 0) { - if (missing.length > 1) { - throw new Error('options ' + - missing.slice(0, missing.length - 1).join(', ') + ' and ' + - missing[missing.length - 1] + ' must be defined'); - } - else throw new Error('option ' + missing[0] + ' must be defined'); - } - } - Object.keys(options).forEach(function(key) { - if (key in internalValues) { - internalValues[key] = options[key]; - } - }); - return this; - }; - this.copy = function(keys) { - var obj = {}; - Object.keys(defaults).forEach(function(key) { - if (keys.indexOf(key) !== -1) { - obj[key] = values[key]; - } - }); - return obj; - }; - this.read = function(filename, cb) { - if (typeof cb == 'function') { - var self = this; - fs.readFile(filename, function(error, data) { - if (error) return cb(error); - var conf = JSON.parse(data); - self.merge(conf); - cb(); - }); - } - else { - var conf = JSON.parse(fs.readFileSync(filename)); - this.merge(conf); - } - return this; - }; - this.isDefined = function(key) { - return typeof values[key] != 'undefined'; - }; - this.isDefinedAndNonNull = function(key) { - return typeof values[key] != 'undefined' && values[key] !== null; - }; - Object.freeze(values); - Object.freeze(this); -} - -module.exports = Options; diff --git a/node_modules/options/package.json b/node_modules/options/package.json deleted file mode 100644 index 886f8741a..000000000 --- a/node_modules/options/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "_from": "options@>=0.0.5", - "_id": "options@0.0.6", - "_inBundle": false, - "_integrity": "sha1-7CLTEoBrtT5zF3Pnza788cZDEo8=", - "_location": "/options", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "options@>=0.0.5", - "name": "options", - "escapedName": "options", - "rawSpec": ">=0.0.5", - "saveSpec": null, - "fetchSpec": ">=0.0.5" - }, - "_requiredBy": [ - "/ws" - ], - "_resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz", - "_shasum": "ec22d312806bb53e731773e7cdaefcf1c643128f", - "_spec": "options@>=0.0.5", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/ws", - "author": { - "name": "Einar Otto Stangvik", - "email": "einaros@gmail.com", - "url": "http://2x.io" - }, - "bugs": { - "url": "https://github.com/einaros/options.js/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "A very light-weight in-code option parsers for node.js.", - "devDependencies": { - "mocha": "latest" - }, - "engines": { - "node": ">=0.4.0" - }, - "homepage": "https://github.com/einaros/options.js#readme", - "main": "lib/options", - "name": "options", - "repository": { - "type": "git", - "url": "git://github.com/einaros/options.js.git" - }, - "scripts": { - "test": "make test" - }, - "version": "0.0.6" -} diff --git a/node_modules/os-browserify/.npmignore b/node_modules/os-browserify/.npmignore deleted file mode 100644 index f356293ee..000000000 --- a/node_modules/os-browserify/.npmignore +++ /dev/null @@ -1,14 +0,0 @@ -lib-cov -*.seed -*.log -*.csv -*.dat -*.out -*.pid -*.gz - -pids -logs -results - -npm-debug.log diff --git a/node_modules/os-browserify/LICENSE b/node_modules/os-browserify/LICENSE deleted file mode 100644 index 4b870dac2..000000000 --- a/node_modules/os-browserify/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2017 CoderPuppy - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/os-browserify/README.md b/node_modules/os-browserify/README.md deleted file mode 100644 index 4dd7d6ebc..000000000 --- a/node_modules/os-browserify/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# os-browserify - -The [os](https://nodejs.org/api/os.html) module from node.js, but for browsers. - -When you `require('os')` in [browserify](http://github.com/substack/node-browserify), this module will be loaded. diff --git a/node_modules/os-browserify/browser.js b/node_modules/os-browserify/browser.js deleted file mode 100644 index 22d9a2ad4..000000000 --- a/node_modules/os-browserify/browser.js +++ /dev/null @@ -1,49 +0,0 @@ -exports.endianness = function () { return 'LE' }; - -exports.hostname = function () { - if (typeof location !== 'undefined') { - return location.hostname - } - else return ''; -}; - -exports.loadavg = function () { return [] }; - -exports.uptime = function () { return 0 }; - -exports.freemem = function () { - return Number.MAX_VALUE; -}; - -exports.totalmem = function () { - return Number.MAX_VALUE; -}; - -exports.cpus = function () { return [] }; - -exports.type = function () { return 'Browser' }; - -exports.release = function () { - if (typeof navigator !== 'undefined') { - return navigator.appVersion; - } - return ''; -}; - -exports.networkInterfaces -= exports.getNetworkInterfaces -= function () { return {} }; - -exports.arch = function () { return 'javascript' }; - -exports.platform = function () { return 'browser' }; - -exports.tmpdir = exports.tmpDir = function () { - return '/tmp'; -}; - -exports.EOL = '\n'; - -exports.homedir = function () { - return '/' -}; diff --git a/node_modules/os-browserify/main.js b/node_modules/os-browserify/main.js deleted file mode 100644 index 5910697d8..000000000 --- a/node_modules/os-browserify/main.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('os'); diff --git a/node_modules/os-browserify/package.json b/node_modules/os-browserify/package.json deleted file mode 100644 index 5eb0bc764..000000000 --- a/node_modules/os-browserify/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "_from": "os-browserify@~0.3.0", - "_id": "os-browserify@0.3.0", - "_inBundle": false, - "_integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", - "_location": "/os-browserify", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "os-browserify@~0.3.0", - "name": "os-browserify", - "escapedName": "os-browserify", - "rawSpec": "~0.3.0", - "saveSpec": null, - "fetchSpec": "~0.3.0" - }, - "_requiredBy": [ - "/browserify" - ], - "_resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "_shasum": "854373c7f5c2315914fc9bfc6bd8238fdda1ec27", - "_spec": "os-browserify@~0.3.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "CoderPuppy", - "email": "coderpup@gmail.com" - }, - "browser": "browser.js", - "bugs": { - "url": "https://github.com/CoderPuppy/os-browserify/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "The [os](https://nodejs.org/api/os.html) module from node.js, but for browsers.", - "homepage": "https://github.com/CoderPuppy/os-browserify#readme", - "jspm": { - "map": { - "./main.js": { - "node": "@node/os", - "browser": "./browser.js" - } - } - }, - "license": "MIT", - "main": "main.js", - "name": "os-browserify", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/CoderPuppy/os-browserify.git" - }, - "version": "0.3.0" -} diff --git a/node_modules/os-tmpdir/index.js b/node_modules/os-tmpdir/index.js deleted file mode 100644 index 2077b1ce7..000000000 --- a/node_modules/os-tmpdir/index.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; -var isWindows = process.platform === 'win32'; -var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/; - -// https://github.com/nodejs/node/blob/3e7a14381497a3b73dda68d05b5130563cdab420/lib/os.js#L25-L43 -module.exports = function () { - var path; - - if (isWindows) { - path = process.env.TEMP || - process.env.TMP || - (process.env.SystemRoot || process.env.windir) + '\\temp'; - } else { - path = process.env.TMPDIR || - process.env.TMP || - process.env.TEMP || - '/tmp'; - } - - if (trailingSlashRe.test(path)) { - path = path.slice(0, -1); - } - - return path; -}; diff --git a/node_modules/os-tmpdir/license b/node_modules/os-tmpdir/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/os-tmpdir/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/os-tmpdir/package.json b/node_modules/os-tmpdir/package.json deleted file mode 100644 index 8013e112a..000000000 --- a/node_modules/os-tmpdir/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "_from": "os-tmpdir@^1.0.1", - "_id": "os-tmpdir@1.0.2", - "_inBundle": false, - "_integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "_location": "/os-tmpdir", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "os-tmpdir@^1.0.1", - "name": "os-tmpdir", - "escapedName": "os-tmpdir", - "rawSpec": "^1.0.1", - "saveSpec": null, - "fetchSpec": "^1.0.1" - }, - "_requiredBy": [ - "/pem" - ], - "_resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "_shasum": "bbe67406c79aa85c5cfec766fe5734555dfa1274", - "_spec": "os-tmpdir@^1.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/pem", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/os-tmpdir/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Node.js os.tmpdir() ponyfill", - "devDependencies": { - "ava": "*", - "xo": "^0.16.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/os-tmpdir#readme", - "keywords": [ - "built-in", - "core", - "ponyfill", - "polyfill", - "shim", - "os", - "tmpdir", - "tempdir", - "tmp", - "temp", - "dir", - "directory", - "env", - "environment" - ], - "license": "MIT", - "name": "os-tmpdir", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/os-tmpdir.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.2" -} diff --git a/node_modules/os-tmpdir/readme.md b/node_modules/os-tmpdir/readme.md deleted file mode 100644 index c09f7ed8d..000000000 --- a/node_modules/os-tmpdir/readme.md +++ /dev/null @@ -1,32 +0,0 @@ -# os-tmpdir [![Build Status](https://travis-ci.org/sindresorhus/os-tmpdir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-tmpdir) - -> Node.js [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) [ponyfill](https://ponyfill.com) - -Use this instead of `require('os').tmpdir()` to get a consistent behavior on different Node.js versions (even 0.8). - - -## Install - -``` -$ npm install --save os-tmpdir -``` - - -## Usage - -```js -const osTmpdir = require('os-tmpdir'); - -osTmpdir(); -//=> '/var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T' -``` - - -## API - -See the [`os.tmpdir()` docs](https://nodejs.org/api/os.html#os_os_tmpdir). - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/outpipe/.npmignore b/node_modules/outpipe/.npmignore deleted file mode 100644 index a0a4bd493..000000000 --- a/node_modules/outpipe/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -example/output -node_modules diff --git a/node_modules/outpipe/LICENSE b/node_modules/outpipe/LICENSE deleted file mode 100644 index ee27ba4b4..000000000 --- a/node_modules/outpipe/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/outpipe/bin/echo.js b/node_modules/outpipe/bin/echo.js deleted file mode 100755 index e1846d701..000000000 --- a/node_modules/outpipe/bin/echo.js +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -process.stdin.pipe(process.stdout); diff --git a/node_modules/outpipe/example/input/x.js b/node_modules/outpipe/example/input/x.js deleted file mode 100644 index 9aaeebd91..000000000 --- a/node_modules/outpipe/example/input/x.js +++ /dev/null @@ -1,4 +0,0 @@ -for (var i = 0; i < 100; i++) { - var n = 500; - console.log('i=', i); -} diff --git a/node_modules/outpipe/example/input/y.js b/node_modules/outpipe/example/input/y.js deleted file mode 100644 index 58f01c939..000000000 --- a/node_modules/outpipe/example/input/y.js +++ /dev/null @@ -1,5 +0,0 @@ -(function () { - var x = 5; - var x = 6; - console.log('ogre') -})(); diff --git a/node_modules/outpipe/example/input/z.js b/node_modules/outpipe/example/input/z.js deleted file mode 100644 index e346bb697..000000000 --- a/node_modules/outpipe/example/input/z.js +++ /dev/null @@ -1,2 +0,0 @@ -if (false) console.log('welcome!') -console.log('keep out') diff --git a/node_modules/outpipe/example/watch.js b/node_modules/outpipe/example/watch.js deleted file mode 100644 index b694e79bc..000000000 --- a/node_modules/outpipe/example/watch.js +++ /dev/null @@ -1,19 +0,0 @@ -var outpipe = require('../'); -var gaze = require('gaze'); -var fs = require('fs'); - -var minimist = require('minimist'); -var argv = minimist(process.argv.slice(2), { - alias: { o: 'output' } -}); - -var file = argv._[0]; -gaze(file, function (err, w) { - w.on('changed', read); -}); -read(); - -function read () { - var r = fs.createReadStream(file); - r.pipe(outpipe(argv.output)); -} diff --git a/node_modules/outpipe/index.js b/node_modules/outpipe/index.js deleted file mode 100644 index 38b5a6afa..000000000 --- a/node_modules/outpipe/index.js +++ /dev/null @@ -1,34 +0,0 @@ -var parse = require('shell-quote').parse; -var exec = require('child_process').exec; -var path = require('path'); -var echo = process.execPath + ' ' + path.join(__dirname, 'bin/echo'); -var fs = require('fs'); - -module.exports = function (str, opts) { - var parts = parse(str); - for (var i = 0; i < parts.length; i++) { - if (parts[i].op) break; - } - if (i === parts.length) { // no ops - var w = fs.createWriteStream(str); - w.once('finish', function () { w.emit('exit', 0) }); - w.once('error', function (err) { w.emit('exit', 1) }); - return w; - } - else { - if (parts[parts.length-1].op === '|') { - str += echo; - } - if (parts[0].op === '|') { - str = echo + str; - } - if (parts[0].op === '>') { - str = echo + str; - } - } - var p = exec(str, opts); - p.stderr.pipe(process.stderr, { end: false }); - p.stdout.pipe(process.stdout, { end: false }); - p.once('exit', function (code) { p.stdin.emit('exit', code) }); - return p.stdin; -}; diff --git a/node_modules/outpipe/package.json b/node_modules/outpipe/package.json deleted file mode 100644 index 8361b3440..000000000 --- a/node_modules/outpipe/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_from": "outpipe@^1.1.0", - "_id": "outpipe@1.1.1", - "_inBundle": false, - "_integrity": "sha1-UM+GFjZeh+Ax4ppeyTOaPaRyX6I=", - "_location": "/outpipe", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "outpipe@^1.1.0", - "name": "outpipe", - "escapedName": "outpipe", - "rawSpec": "^1.1.0", - "saveSpec": null, - "fetchSpec": "^1.1.0" - }, - "_requiredBy": [ - "/watchify" - ], - "_resolved": "https://registry.npmjs.org/outpipe/-/outpipe-1.1.1.tgz", - "_shasum": "50cf8616365e87e031e29a5ec9339a3da4725fa2", - "_spec": "outpipe@^1.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/watchify", - "author": { - "name": "substack" - }, - "bugs": { - "url": "https://github.com/substack/outpipe/issues" - }, - "bundleDependencies": false, - "dependencies": { - "shell-quote": "^1.4.2" - }, - "deprecated": false, - "description": "write output to a file through shell commands", - "devDependencies": { - "gaze": "^0.5.1", - "minimist": "^1.1.0", - "osenv": "^0.1.0", - "tape": "^3.5.0", - "xtend": "^4.0.0" - }, - "directories": { - "example": "example" - }, - "homepage": "https://github.com/substack/outpipe", - "keywords": [ - "output", - "file", - "pipe", - "shell", - "exec", - "spawn", - "createWriteStream", - "redirect" - ], - "license": "MIT", - "main": "index.js", - "name": "outpipe", - "repository": { - "type": "git", - "url": "git://github.com/substack/outpipe.git" - }, - "scripts": { - "test": "tape test/*.js" - }, - "version": "1.1.1" -} diff --git a/node_modules/outpipe/readme.markdown b/node_modules/outpipe/readme.markdown deleted file mode 100644 index efd4136fc..000000000 --- a/node_modules/outpipe/readme.markdown +++ /dev/null @@ -1,117 +0,0 @@ -# outpipe - -write output to a file through shell commands - -# purpose - -Suppose you have a tool like -[watchify](https://npmjs.com/package/watchify) -or [factor-bundle](https://npmjs.com/package/factor-bundle) -that write to multiple files or write to the same file more than once. - -If you want to pipe the output of these tools to other programs, such as -minification with the `uglify` command, it's very difficult! You might need to -use the tool's API or use a separate command to watch for changes to the output -files. Ick. - -You don't get the elegance of something like: - -``` sh -$ browserify main.js | uglifyjs -cm | gzip > bundle.js.gz -``` - -Until now! With this library and a hypothetical version of watchify, you could -do: - -``` sh -$ watchify main.js -dv -o 'uglifyjs -cm | gzip > bundle.js.gz' -``` - -# example - -Here's a small watcher program that will just copy input files to a destination, -but transforms can be applied along the way with shell pipes and redirects. - -``` js -var outpipe = require('outpipe'); -var gaze = require('gaze'); -var fs = require('fs'); - -var minimist = require('minimist'); -var argv = minimist(process.argv.slice(2), { - alias: { o: 'output' } -}); - -var file = argv._[0]; -gaze(file, function (err, w) { - w.on('changed', read); -}); -read(); - -function read () { - var r = fs.createReadStream(file); - r.pipe(outpipe(argv.output)); -} -``` - -We can run the program with a single output file: - -``` sh -$ node watch.js input/x.js -o output/hmm.js -``` - -which just copies `x.js` to `output/hmm.js` whenever `x.js` changes. - -We could also run a minification step using the `uglify` command: - -``` sh -$ node watch.js input/x.js -o 'uglifyjs -cm > output/wow.js' -``` - -or we can just print the size of the minified and gzipped output to stdout: - -``` sh -$ node watch.js input/x.js -o 'uglifyjs -cm | gzip | wc -c' -123 -``` - -or we could write that size to a file: - -``` sh -$ node watch.js input/x.js -o 'uglifyjs -cm | gzip | wc -c > size.txt' -``` - -# methods - -``` js -var outpipe = require('outpipe') -``` - -## var w = outpipe(cmd, opts={}) - -Return a writable stream `w` that will pipe output to the command string `cmd`. - -If `cmd` has no operators (`|` or `>`), it will write to a file. - -Otherwise, each command between pipes will be executed and output is written to -a file if `>` is given. - -`opts` can be: - -* `opts.env` - an object mapping environment variables to their values or a -`function (key) {}` that returns the values. - -stdout and stderr are forwarded to process.stdout and process.stderr if -unhandled in the command. - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install outpipe -``` - -# license - -MIT diff --git a/node_modules/outpipe/test/cmd.js b/node_modules/outpipe/test/cmd.js deleted file mode 100644 index baa536c96..000000000 --- a/node_modules/outpipe/test/cmd.js +++ /dev/null @@ -1,19 +0,0 @@ -var outpipe = require('../'); -var test = require('tape'); -var fs = require('fs'); -var path = require('path'); -var tmpdir = require('osenv').tmpdir(); - -test('cmd', function (t) { - t.plan(2); - var file = path.join(tmpdir, 'outpipe-' + Math.random()); - var p = outpipe('wc -c > ' + file); - p.end('wow'); - - p.once('exit', function () { - fs.readFile(file, 'utf8', function (err, src) { - t.ifError(err); - t.equal(src, '3\n'); - }); - }); -}); diff --git a/node_modules/outpipe/test/outfile.js b/node_modules/outpipe/test/outfile.js deleted file mode 100644 index de5340cfa..000000000 --- a/node_modules/outpipe/test/outfile.js +++ /dev/null @@ -1,19 +0,0 @@ -var outpipe = require('../'); -var test = require('tape'); -var fs = require('fs'); -var path = require('path'); -var tmpdir = require('osenv').tmpdir(); - -test('outfile', function (t) { - t.plan(2); - var file = path.join(tmpdir, 'outpipe-' + Math.random()); - var p = outpipe(file); - p.end('wow'); - - p.once('exit', function () { - fs.readFile(file, 'utf8', function (err, src) { - t.ifError(err); - t.equal(src, 'wow'); - }); - }); -}); diff --git a/node_modules/p-finally/index.js b/node_modules/p-finally/index.js deleted file mode 100644 index 52b7b49c5..000000000 --- a/node_modules/p-finally/index.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; -module.exports = (promise, onFinally) => { - onFinally = onFinally || (() => {}); - - return promise.then( - val => new Promise(resolve => { - resolve(onFinally()); - }).then(() => val), - err => new Promise(resolve => { - resolve(onFinally()); - }).then(() => { - throw err; - }) - ); -}; diff --git a/node_modules/p-finally/license b/node_modules/p-finally/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/p-finally/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/p-finally/package.json b/node_modules/p-finally/package.json deleted file mode 100644 index 5cafc490a..000000000 --- a/node_modules/p-finally/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "_from": "p-finally@^1.0.0", - "_id": "p-finally@1.0.0", - "_inBundle": false, - "_integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "_location": "/p-finally", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "p-finally@^1.0.0", - "name": "p-finally", - "escapedName": "p-finally", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/execa" - ], - "_resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "_shasum": "3fbcfb15b899a44123b34b6dcc18b724336a2cae", - "_spec": "p-finally@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/execa", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/p-finally/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "`Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/p-finally#readme", - "keywords": [ - "promise", - "finally", - "handler", - "function", - "async", - "await", - "promises", - "settled", - "ponyfill", - "polyfill", - "shim", - "bluebird" - ], - "license": "MIT", - "name": "p-finally", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/p-finally.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.0", - "xo": { - "esnext": true - } -} diff --git a/node_modules/p-finally/readme.md b/node_modules/p-finally/readme.md deleted file mode 100644 index 09ef36416..000000000 --- a/node_modules/p-finally/readme.md +++ /dev/null @@ -1,47 +0,0 @@ -# p-finally [![Build Status](https://travis-ci.org/sindresorhus/p-finally.svg?branch=master)](https://travis-ci.org/sindresorhus/p-finally) - -> [`Promise#finally()`](https://github.com/tc39/proposal-promise-finally) [ponyfill](https://ponyfill.com) - Invoked when the promise is settled regardless of outcome - -Useful for cleanup. - - -## Install - -``` -$ npm install --save p-finally -``` - - -## Usage - -```js -const pFinally = require('p-finally'); - -const dir = createTempDir(); - -pFinally(write(dir), () => cleanup(dir)); -``` - - -## API - -### pFinally(promise, [onFinally]) - -Returns a `Promise`. - -#### onFinally - -Type: `Function` - -Note: Throwing or returning a rejected promise will reject `promise` with the rejection reason. - - -## Related - -- [p-try](https://github.com/sindresorhus/p-try) - `Promise#try()` ponyfill - Starts a promise chain -- [More…](https://github.com/sindresorhus/promise-fun) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/pad-left/LICENSE b/node_modules/pad-left/LICENSE deleted file mode 100644 index 39245ac1c..000000000 --- a/node_modules/pad-left/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2016, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/pad-left/README.md b/node_modules/pad-left/README.md deleted file mode 100644 index eae0f48eb..000000000 --- a/node_modules/pad-left/README.md +++ /dev/null @@ -1,134 +0,0 @@ -# pad-left [![NPM version](https://img.shields.io/npm/v/pad-left.svg?style=flat)](https://www.npmjs.com/package/pad-left) [![NPM downloads](https://img.shields.io/npm/dm/pad-left.svg?style=flat)](https://npmjs.org/package/pad-left) [![Build Status](https://img.shields.io/travis/jonschlinkert/pad-left.svg?style=flat)](https://travis-ci.org/jonschlinkert/pad-left) - -Left pad a string with zeros or a specified string. Fastest implementation. - -You might also be interested in [word-wrap](https://github.com/jonschlinkert/word-wrap). - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install pad-left --save -``` - -## Usage - -```js -var pad = require('pad-left'); -pad( '4', 4, '0') // 0004 -pad( '35', 4, '0') // 0035 -pad('459', 4, '0') // 0459 -``` - -## Benchmarks - -Benchmarks for node.js v6.1.0 versus [left-pad](https://github.com/stevemao/left-pad). - -```sh -# benchmark/fixtures/10-custom-char.js (37 bytes) - pad-left x 14,940,947 ops/sec ±0.81% (87 runs sampled) - left-pad x 7,901,604 ops/sec ±1.17% (86 runs sampled) - -# benchmark/fixtures/10.js (32 bytes) - pad-left x 13,305,123 ops/sec ±1.53% (84 runs sampled) - left-pad x 6,979,536 ops/sec ±1.13% (84 runs sampled) - -# benchmark/fixtures/100-custom-char.js (38 bytes) - pad-left x 14,227,637 ops/sec ±1.41% (81 runs sampled) - left-pad x 1,352,240 ops/sec ±1.51% (86 runs sampled) - -# benchmark/fixtures/100.js (34 bytes) - pad-left x 15,664,561 ops/sec ±0.99% (83 runs sampled) - left-pad x 1,247,316 ops/sec ±0.96% (87 runs sampled) - -# benchmark/fixtures/1000-custom-char.js (40 bytes) - pad-left x 15,210,294 ops/sec ±1.15% (87 runs sampled) - left-pad x 159,958 ops/sec ±1.01% (88 runs sampled) - -# benchmark/fixtures/1000.js (35 bytes) - pad-left x 14,157,425 ops/sec ±1.10% (88 runs sampled) - left-pad x 143,805 ops/sec ±1.08% (87 runs sampled) -``` - -Benchmarks for node.js v6.1.0 versus [stevemao/left-pad](https://github.com/stevemao/left-pad). - -```sh -# benchmark/fixtures/10-custom-char.js (37 bytes) - pad-left x 13,251,037 ops/sec ±1.40% (84 runs sampled) - left-pad x 10,745,530 ops/sec ±1.18% (86 runs sampled) - -# benchmark/fixtures/10.js (32 bytes) - pad-left x 13,644,357 ops/sec ±1.33% (87 runs sampled) - left-pad x 20,107,245 ops/sec ±1.00% (88 runs sampled) - -# benchmark/fixtures/100-custom-char.js (38 bytes) - pad-left x 15,650,330 ops/sec ±1.01% (86 runs sampled) - left-pad x 9,706,877 ops/sec ±1.13% (87 runs sampled) - -# benchmark/fixtures/1000-custom-char.js (40 bytes) - pad-left x 17,255,593 ops/sec ±0.99% (88 runs sampled) - left-pad x 6,312,637 ops/sec ±1.16% (87 runs sampled) - -# benchmark/fixtures/1000.js (35 bytes) - pad-left x 15,679,410 ops/sec ±0.99% (90 runs sampled) - left-pad x 6,439,580 ops/sec ±1.08% (86 runs sampled) -``` - -## Related projects - -You might also be interested in these projects: - -* [align-text](https://www.npmjs.com/package/align-text): Align the text in a string. | [homepage](https://github.com/jonschlinkert/align-text) -* [center-align](https://www.npmjs.com/package/center-align): Center-align the text in a string. | [homepage](https://github.com/jonschlinkert/center-align) -* [justified](https://www.npmjs.com/package/justified): Wrap words to a specified length and justified the text. | [homepage](https://github.com/jonschlinkert/justified) -* [pad-right](https://www.npmjs.com/package/pad-right): Right pad a string with zeros or a specified string. Fastest implementation. | [homepage](https://github.com/jonschlinkert/pad-right) -* [repeat-string](https://www.npmjs.com/package/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string. | [homepage](https://github.com/jonschlinkert/repeat-string) -* [right-align-keys](https://www.npmjs.com/package/right-align-keys): Right align the keys of an object. | [homepage](https://github.com/jonschlinkert/right-align-keys) -* [right-align-values](https://www.npmjs.com/package/right-align-values): Right align the values of a given property for each object in an array. Useful… [more](https://www.npmjs.com/package/right-align-values) | [homepage](https://github.com/jonschlinkert/right-align-values) -* [right-align](https://www.npmjs.com/package/right-align): Right-align the text in a string. | [homepage](https://github.com/jonschlinkert/right-align) -* [right-pad-keys](https://www.npmjs.com/package/right-pad-keys): Right pad the keys of an object. | [homepage](https://github.com/jonschlinkert/right-pad-keys) -* [right-pad-values](https://www.npmjs.com/package/right-pad-values): Right pad the values of a given property for each object in an array. Useful… [more](https://www.npmjs.com/package/right-pad-values) | [homepage](https://github.com/jonschlinkert/right-pad-values) -* [word-wrap](https://www.npmjs.com/package/word-wrap): Wrap words to a specified length. | [homepage](https://github.com/jonschlinkert/word-wrap) - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/pad-left/issues/new). - -## Building docs - -Generate readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install verb && npm run docs -``` - -Or, if [verb](https://github.com/verbose/verb) is installed globally: - -```sh -$ verb -``` - -## Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -## Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/pad-left/blob/master/LICENSE). - -*** - -_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on May 07, 2016._ \ No newline at end of file diff --git a/node_modules/pad-left/index.js b/node_modules/pad-left/index.js deleted file mode 100755 index ecec233ca..000000000 --- a/node_modules/pad-left/index.js +++ /dev/null @@ -1,28 +0,0 @@ -/*! - * pad-left - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT license. - */ - -'use strict'; - -var repeat = require('repeat-string'); - -module.exports = function padLeft(str, num, ch) { - str = str.toString(); - - if (typeof num === 'undefined') { - return str; - } - - if (ch === 0) { - ch = '0'; - } else if (ch) { - ch = ch.toString(); - } else { - ch = ' '; - } - - return repeat(ch, num - str.length) + str; -}; diff --git a/node_modules/pad-left/package.json b/node_modules/pad-left/package.json deleted file mode 100644 index 818be2235..000000000 --- a/node_modules/pad-left/package.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "_from": "pad-left@^2.0.0", - "_id": "pad-left@2.1.0", - "_inBundle": false, - "_integrity": "sha1-FuajstRKjhOMsIOMx8tAOk/J6ZQ=", - "_location": "/pad-left", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "pad-left@^2.0.0", - "name": "pad-left", - "escapedName": "pad-left", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/garnish" - ], - "_resolved": "https://registry.npmjs.org/pad-left/-/pad-left-2.1.0.tgz", - "_shasum": "16e6a3b2d44a8e138cb0838cc7cb403a4fc9e994", - "_spec": "pad-left@^2.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/garnish", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/pad-left/issues" - }, - "bundleDependencies": false, - "dependencies": { - "repeat-string": "^1.5.4" - }, - "deprecated": false, - "description": "Left pad a string with zeros or a specified string. Fastest implementation.", - "devDependencies": { - "benchmarked": "^0.2.5", - "gulp-format-md": "^0.1.9", - "left-pad": "github:stevemao/left-pad", - "minimist": "^1.2.0", - "mocha": "^2.4.5", - "should": "^8.3.1" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/pad-left", - "keywords": [ - "align", - "fill", - "left", - "pad", - "pad-left", - "padded", - "padding", - "spaces", - "string", - "zero", - "zero-fill", - "zeros" - ], - "license": "MIT", - "main": "index.js", - "name": "pad-left", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/pad-left.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "run": true, - "toc": false, - "layout": "default", - "options": { - "helper": { - "copyright": { - "start": 2014 - } - } - }, - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "highlight": "word-wrap", - "list": [ - "align-text", - "center-align", - "justified", - "pad-right", - "repeat-string", - "right-align", - "right-align-keys", - "right-align-values", - "right-pad-keys", - "right-pad-values", - "word-wrap" - ] - }, - "reflinks": [ - "verb", - "left-pad" - ], - "lint": { - "reflinks": true - } - }, - "version": "2.1.0" -} diff --git a/node_modules/pad-right/LICENSE b/node_modules/pad-right/LICENSE deleted file mode 100644 index b576e8d48..000000000 --- a/node_modules/pad-right/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/pad-right/README.md b/node_modules/pad-right/README.md deleted file mode 100644 index 97106f463..000000000 --- a/node_modules/pad-right/README.md +++ /dev/null @@ -1,71 +0,0 @@ -# pad-right [![NPM version](https://badge.fury.io/js/pad-right.svg)](http://badge.fury.io/js/pad-right) - -> Right pad a string with zeros or a specified string. Fastest implementation. - -Install with [npm](https://www.npmjs.com/) - -```sh -$ npm i pad-right --save -``` - -## Run tests - -```bash -npm test -``` - -## Usage - -```js -var pad = require('pad-right'); -pad('abc', 5) -// 'abc00' -pad('abc', 10) -// 'abc0000000' -pad('abc', 10, '~') -// 'abc~~~~~~~' -pad('abc', 10, ' ') -// 'abc ' -``` - -## Related - -* [align-text](https://github.com/jonschlinkert/align-text): Align the text in a string. -* [center-align](https://github.com/jonschlinkert/center-align): Center-align the text in a string. -* [justified](https://github.com/jonschlinkert/justified): Wrap words to a specified length and justified the text. -* [pad-left](https://github.com/jonschlinkert/pad-left): Left pad a string with zeros or a specified string. Fastest implementation. -* [repeat-string](https://github.com/jonschlinkert/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string. -* [right-align](https://github.com/jonschlinkert/right-align): Right-align the text in a string. -* [right-align-keys](https://github.com/jonschlinkert/right-align-keys): Right align the keys of an object. -* [right-align-values](https://github.com/jonschlinkert/right-align-values): Right align the values of a given property for each object in an array. Useful… [more](https://github.com/jonschlinkert/right-align-values) -* [right-pad-keys](https://github.com/jonschlinkert/right-pad-keys): Right pad the keys of an object. -* [right-pad-values](https://github.com/jonschlinkert/right-pad-values): Right pad the values of a given property for each object in an array. Useful… [more](https://github.com/jonschlinkert/right-pad-values) -* [word-wrap](https://github.com/jonschlinkert/word-wrap): Wrap words to a specified length. - -## Running tests - -Install dev dependencies: - -```sh -$ npm i -d && npm test -``` - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/pad-right/issues/new) - -## Author - -**Jon Schlinkert** - -+ [github/jonschlinkert](https://github.com/jonschlinkert) -+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2014-2015 Jon Schlinkert -Released under the MIT license. - -*** - -_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 15, 2015._ \ No newline at end of file diff --git a/node_modules/pad-right/index.js b/node_modules/pad-right/index.js deleted file mode 100644 index 701276669..000000000 --- a/node_modules/pad-right/index.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -var repeat = require('repeat-string'); - -module.exports = function padLeft(val, num, str) { - var padding = ''; - var diff = num - val.length; - - // Breakpoints based on benchmarks to use the fastest approach - // for the given number of zeros - if (diff <= 5 && !str) { - padding = '00000'; - } else if (diff <= 25 && !str) { - padding = '000000000000000000000000000'; - } else { - return val + repeat(str || '0', diff); - } - - return val + padding.slice(0, diff); -}; diff --git a/node_modules/pad-right/package.json b/node_modules/pad-right/package.json deleted file mode 100644 index af3a1214e..000000000 --- a/node_modules/pad-right/package.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "_from": "pad-right@^0.2.2", - "_id": "pad-right@0.2.2", - "_inBundle": false, - "_integrity": "sha1-b7ySQEXSRPKiokRQMGDTv8YAl3Q=", - "_location": "/pad-right", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "pad-right@^0.2.2", - "name": "pad-right", - "escapedName": "pad-right", - "rawSpec": "^0.2.2", - "saveSpec": null, - "fetchSpec": "^0.2.2" - }, - "_requiredBy": [ - "/garnish" - ], - "_resolved": "https://registry.npmjs.org/pad-right/-/pad-right-0.2.2.tgz", - "_shasum": "6fbc924045d244f2a2a244503060d3bfc6009774", - "_spec": "pad-right@^0.2.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/garnish", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/pad-right/issues" - }, - "bundleDependencies": false, - "dependencies": { - "repeat-string": "^1.5.2" - }, - "deprecated": false, - "description": "Right pad a string with zeros or a specified string. Fastest implementation.", - "devDependencies": { - "mocha": "*", - "should": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/pad-right", - "keywords": [ - "align", - "alignment", - "fill", - "left", - "pad", - "pad-left", - "pad-right", - "padded", - "padding", - "right", - "right-pad", - "spaces", - "string", - "zero", - "zero-fill", - "zeros" - ], - "license": "MIT", - "main": "index.js", - "name": "pad-right", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/pad-right.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "align-text", - "center-align", - "justified", - "pad-left", - "repeat-string", - "right-align", - "right-align-keys", - "right-align-values", - "right-pad-keys", - "right-pad-values", - "word-wrap" - ] - } - }, - "version": "0.2.2" -} diff --git a/node_modules/pako/CHANGELOG.md b/node_modules/pako/CHANGELOG.md deleted file mode 100644 index 3ba89dde0..000000000 --- a/node_modules/pako/CHANGELOG.md +++ /dev/null @@ -1,118 +0,0 @@ -1.0.6 / 2017-09-14 ------------------- - -- Improve @std/esm compatibility. - - -1.0.5 / 2017-03-17 ------------------- - -- Maintenance. More formal `zlib` attribution and related - changes, #93. Thanks to @bastien-roucaries for the help. - - -1.0.4 / 2016-12-15 ------------------- - -- Bump dev dependencies. -- Make sure `err.message` is filled on throw. -- Code examples for utf-16 string encoding & object compression. - - -1.0.3 / 2016-07-25 ------------------- - -- Maintenance: re-release to properly display latest version in npm registry - and badges. Because `npm publish` timestamp used instead of versions. - - -1.0.2 / 2016-07-21 ------------------- - -- Fixed nasty bug in deflate (wrong `d_buf` offset), which could cause - broken data in some rare cases. -- Also released as 0.2.9 to give chance to old dependents, not updated to 1.x - version. - - -1.0.1 / 2016-04-01 ------------------- - -- Added dictionary support. Thanks to @dignifiedquire. - - -1.0.0 / 2016-02-17 ------------------- - -- Maintenance release (semver, coding style). - - -0.2.8 / 2015-09-14 ------------------- - -- Fixed regression after 0.2.4 for edge conditions in inflate wrapper (#65). - Added more tests to cover possible cases. - - -0.2.7 / 2015-06-09 ------------------- - -- Added Z_SYNC_FLUSH support. Thanks to @TinoLange. - - -0.2.6 / 2015-03-24 ------------------- - -- Allow ArrayBuffer input. - - -0.2.5 / 2014-07-19 ------------------- - -- Workaround for Chrome 38.0.2096.0 script parser bug, #30. - - -0.2.4 / 2014-07-07 ------------------- - -- Fixed bug in inflate wrapper, #29 - - -0.2.3 / 2014-06-09 ------------------- - -- Maintenance release, dependencies update. - - -0.2.2 / 2014-06-04 ------------------- - -- Fixed iOS 5.1 Safari issue with `apply(typed_array)`, #26. - - -0.2.1 / 2014-05-01 ------------------- - -- Fixed collision on switch dynamic/fixed tables. - - -0.2.0 / 2014-04-18 ------------------- - -- Added custom gzip headers support. -- Added strings support. -- Improved memory allocations for small chunks. -- ZStream properties rename/cleanup. -- More coverage tests. - - -0.1.1 / 2014-03-20 ------------------- - -- Bugfixes for inflate/deflate. - - -0.1.0 / 2014-03-15 ------------------- - -- First release. diff --git a/node_modules/pako/LICENSE b/node_modules/pako/LICENSE deleted file mode 100644 index a934ef8db..000000000 --- a/node_modules/pako/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -(The MIT License) - -Copyright (C) 2014-2017 by Vitaly Puzrin and Andrei Tuputcyn - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/pako/README.md b/node_modules/pako/README.md deleted file mode 100644 index c58572a59..000000000 --- a/node_modules/pako/README.md +++ /dev/null @@ -1,182 +0,0 @@ -pako -========================================== - -[![Build Status](https://travis-ci.org/nodeca/pako.svg?branch=master)](https://travis-ci.org/nodeca/pako) -[![NPM version](https://img.shields.io/npm/v/pako.svg)](https://www.npmjs.org/package/pako) - -> zlib port to javascript, very fast! - -__Why pako is cool:__ - -- Almost as fast in modern JS engines as C implementation (see benchmarks). -- Works in browsers, you can browserify any separate component. -- Chunking support for big blobs. -- Results are binary equal to well known [zlib](http://www.zlib.net/) (now contains ported zlib v1.2.8). - -This project was done to understand how fast JS can be and is it necessary to -develop native C modules for CPU-intensive tasks. Enjoy the result! - - -__Famous projects, using pako:__ - -- [browserify](http://browserify.org/) (via [browserify-zlib](https://github.com/devongovett/browserify-zlib)) -- [JSZip](http://stuk.github.io/jszip/) -- [mincer](https://github.com/nodeca/mincer) -- [JS-Git](https://github.com/creationix/js-git) and - [Tedit](https://chrome.google.com/webstore/detail/tedit-development-environ/ooekdijbnbbjdfjocaiflnjgoohnblgf) - by [@creationix](https://github.com/creationix) - - -__Benchmarks:__ - -``` -node v0.10.26, 1mb sample: - - deflate-dankogai x 4.73 ops/sec ±0.82% (15 runs sampled) - deflate-gildas x 4.58 ops/sec ±2.33% (15 runs sampled) - deflate-imaya x 3.22 ops/sec ±3.95% (12 runs sampled) - ! deflate-pako x 6.99 ops/sec ±0.51% (21 runs sampled) - deflate-pako-string x 5.89 ops/sec ±0.77% (18 runs sampled) - deflate-pako-untyped x 4.39 ops/sec ±1.58% (14 runs sampled) - * deflate-zlib x 14.71 ops/sec ±4.23% (59 runs sampled) - inflate-dankogai x 32.16 ops/sec ±0.13% (56 runs sampled) - inflate-imaya x 30.35 ops/sec ±0.92% (53 runs sampled) - ! inflate-pako x 69.89 ops/sec ±1.46% (71 runs sampled) - inflate-pako-string x 19.22 ops/sec ±1.86% (49 runs sampled) - inflate-pako-untyped x 17.19 ops/sec ±0.85% (32 runs sampled) - * inflate-zlib x 70.03 ops/sec ±1.64% (81 runs sampled) - -node v0.11.12, 1mb sample: - - deflate-dankogai x 5.60 ops/sec ±0.49% (17 runs sampled) - deflate-gildas x 5.06 ops/sec ±6.00% (16 runs sampled) - deflate-imaya x 3.52 ops/sec ±3.71% (13 runs sampled) - ! deflate-pako x 11.52 ops/sec ±0.22% (32 runs sampled) - deflate-pako-string x 9.53 ops/sec ±1.12% (27 runs sampled) - deflate-pako-untyped x 5.44 ops/sec ±0.72% (17 runs sampled) - * deflate-zlib x 14.05 ops/sec ±3.34% (63 runs sampled) - inflate-dankogai x 42.19 ops/sec ±0.09% (56 runs sampled) - inflate-imaya x 79.68 ops/sec ±1.07% (68 runs sampled) - ! inflate-pako x 97.52 ops/sec ±0.83% (80 runs sampled) - inflate-pako-string x 45.19 ops/sec ±1.69% (57 runs sampled) - inflate-pako-untyped x 24.35 ops/sec ±2.59% (40 runs sampled) - * inflate-zlib x 60.32 ops/sec ±1.36% (69 runs sampled) -``` - -zlib's test is partially affected by marshalling (that make sense for inflate only). -You can change deflate level to 0 in benchmark source, to investigate details. -For deflate level 6 results can be considered as correct. - -__Install:__ - -node.js: - -``` -npm install pako -``` - -browser: - -``` -bower install pako -``` - - -Example & API -------------- - -Full docs - http://nodeca.github.io/pako/ - -```javascript -var pako = require('pako'); - -// Deflate -// -var input = new Uint8Array(); -//... fill input data here -var output = pako.deflate(input); - -// Inflate (simple wrapper can throw exception on broken stream) -// -var compressed = new Uint8Array(); -//... fill data to uncompress here -try { - var result = pako.inflate(compressed); -} catch (err) { - console.log(err); -} - -// -// Alternate interface for chunking & without exceptions -// - -var inflator = new pako.Inflate(); - -inflator.push(chunk1, false); -inflator.push(chunk2, false); -... -inflator.push(chunkN, true); // true -> last chunk - -if (inflator.err) { - console.log(inflator.msg); -} - -var output = inflator.result; - -``` - -Sometime you can wish to work with strings. For example, to send -big objects as json to server. Pako detects input data type. You can -force output to be string with option `{ to: 'string' }`. - -```javascript -var pako = require('pako'); - -var test = { my: 'super', puper: [456, 567], awesome: 'pako' }; - -var binaryString = pako.deflate(JSON.stringify(test), { to: 'string' }); - -// -// Here you can do base64 encode, make xhr requests and so on. -// - -var restored = JSON.parse(pako.inflate(binaryString, { to: 'string' })); -``` - - -Notes ------ - -Pako does not contain some specific zlib functions: - -- __deflate__ - methods `deflateCopy`, `deflateBound`, `deflateParams`, - `deflatePending`, `deflatePrime`, `deflateTune`. -- __inflate__ - methods `inflateCopy`, `inflateMark`, - `inflatePrime`, `inflateGetDictionary`, `inflateSync`, `inflateSyncPoint`, `inflateUndermine`. -- High level inflate/deflate wrappers (classes) may not support some flush - modes. Those should work: Z_NO_FLUSH, Z_FINISH, Z_SYNC_FLUSH. - - -Authors -------- - -- Andrey Tupitsin [@anrd83](https://github.com/andr83) -- Vitaly Puzrin [@puzrin](https://github.com/puzrin) - -Personal thanks to: - -- Vyacheslav Egorov ([@mraleph](https://github.com/mraleph)) for his awesome - tutorials about optimising JS code for v8, [IRHydra](http://mrale.ph/irhydra/) - tool and his advices. -- David Duponchel ([@dduponchel](https://github.com/dduponchel)) for help with - testing. - -Original implementation (in C): - -- [zlib](http://zlib.net/) by Jean-loup Gailly and Mark Adler. - - -License -------- - -MIT diff --git a/node_modules/pako/dist/pako.js b/node_modules/pako/dist/pako.js deleted file mode 100644 index fc92282a0..000000000 --- a/node_modules/pako/dist/pako.js +++ /dev/null @@ -1,6809 +0,0 @@ -/* pako 1.0.6 nodeca/pako */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.pako = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o Array - * - * Chunks of output data, if [[Deflate#onData]] not overridden. - **/ - -/** - * Deflate.result -> Uint8Array|Array - * - * Compressed result, generated by default [[Deflate#onData]] - * and [[Deflate#onEnd]] handlers. Filled after you push last chunk - * (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you - * push a chunk with explicit flush (call [[Deflate#push]] with - * `Z_SYNC_FLUSH` param). - **/ - -/** - * Deflate.err -> Number - * - * Error code after deflate finished. 0 (Z_OK) on success. - * You will not need it in real life, because deflate errors - * are possible only on wrong options or bad `onData` / `onEnd` - * custom handlers. - **/ - -/** - * Deflate.msg -> String - * - * Error message, if [[Deflate.err]] != 0 - **/ - - -/** - * new Deflate(options) - * - options (Object): zlib deflate options. - * - * Creates new deflator instance with specified params. Throws exception - * on bad params. Supported options: - * - * - `level` - * - `windowBits` - * - `memLevel` - * - `strategy` - * - `dictionary` - * - * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) - * for more information on these. - * - * Additional options, for internal needs: - * - * - `chunkSize` - size of generated data chunks (16K by default) - * - `raw` (Boolean) - do raw deflate - * - `gzip` (Boolean) - create gzip wrapper - * - `to` (String) - if equal to 'string', then result will be "binary string" - * (each char code [0..255]) - * - `header` (Object) - custom header for gzip - * - `text` (Boolean) - true if compressed data believed to be text - * - `time` (Number) - modification time, unix timestamp - * - `os` (Number) - operation system code - * - `extra` (Array) - array of bytes with extra data (max 65536) - * - `name` (String) - file name (binary string) - * - `comment` (String) - comment (binary string) - * - `hcrc` (Boolean) - true if header crc should be added - * - * ##### Example: - * - * ```javascript - * var pako = require('pako') - * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) - * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); - * - * var deflate = new pako.Deflate({ level: 3}); - * - * deflate.push(chunk1, false); - * deflate.push(chunk2, true); // true -> last chunk - * - * if (deflate.err) { throw new Error(deflate.err); } - * - * console.log(deflate.result); - * ``` - **/ -function Deflate(options) { - if (!(this instanceof Deflate)) return new Deflate(options); - - this.options = utils.assign({ - level: Z_DEFAULT_COMPRESSION, - method: Z_DEFLATED, - chunkSize: 16384, - windowBits: 15, - memLevel: 8, - strategy: Z_DEFAULT_STRATEGY, - to: '' - }, options || {}); - - var opt = this.options; - - if (opt.raw && (opt.windowBits > 0)) { - opt.windowBits = -opt.windowBits; - } - - else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) { - opt.windowBits += 16; - } - - this.err = 0; // error code, if happens (0 = Z_OK) - this.msg = ''; // error message - this.ended = false; // used to avoid multiple onEnd() calls - this.chunks = []; // chunks of compressed data - - this.strm = new ZStream(); - this.strm.avail_out = 0; - - var status = zlib_deflate.deflateInit2( - this.strm, - opt.level, - opt.method, - opt.windowBits, - opt.memLevel, - opt.strategy - ); - - if (status !== Z_OK) { - throw new Error(msg[status]); - } - - if (opt.header) { - zlib_deflate.deflateSetHeader(this.strm, opt.header); - } - - if (opt.dictionary) { - var dict; - // Convert data if needed - if (typeof opt.dictionary === 'string') { - // If we need to compress text, change encoding to utf8. - dict = strings.string2buf(opt.dictionary); - } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { - dict = new Uint8Array(opt.dictionary); - } else { - dict = opt.dictionary; - } - - status = zlib_deflate.deflateSetDictionary(this.strm, dict); - - if (status !== Z_OK) { - throw new Error(msg[status]); - } - - this._dict_set = true; - } -} - -/** - * Deflate#push(data[, mode]) -> Boolean - * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be - * converted to utf8 byte sequence. - * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. - * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH. - * - * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with - * new compressed chunks. Returns `true` on success. The last data block must have - * mode Z_FINISH (or `true`). That will flush internal pending buffers and call - * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you - * can use mode Z_SYNC_FLUSH, keeping the compression context. - * - * On fail call [[Deflate#onEnd]] with error code and return false. - * - * We strongly recommend to use `Uint8Array` on input for best speed (output - * array format is detected automatically). Also, don't skip last param and always - * use the same type in your code (boolean or number). That will improve JS speed. - * - * For regular `Array`-s make sure all elements are [0..255]. - * - * ##### Example - * - * ```javascript - * push(chunk, false); // push one of data chunks - * ... - * push(chunk, true); // push last chunk - * ``` - **/ -Deflate.prototype.push = function (data, mode) { - var strm = this.strm; - var chunkSize = this.options.chunkSize; - var status, _mode; - - if (this.ended) { return false; } - - _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH); - - // Convert data if needed - if (typeof data === 'string') { - // If we need to compress text, change encoding to utf8. - strm.input = strings.string2buf(data); - } else if (toString.call(data) === '[object ArrayBuffer]') { - strm.input = new Uint8Array(data); - } else { - strm.input = data; - } - - strm.next_in = 0; - strm.avail_in = strm.input.length; - - do { - if (strm.avail_out === 0) { - strm.output = new utils.Buf8(chunkSize); - strm.next_out = 0; - strm.avail_out = chunkSize; - } - status = zlib_deflate.deflate(strm, _mode); /* no bad return value */ - - if (status !== Z_STREAM_END && status !== Z_OK) { - this.onEnd(status); - this.ended = true; - return false; - } - if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) { - if (this.options.to === 'string') { - this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out))); - } else { - this.onData(utils.shrinkBuf(strm.output, strm.next_out)); - } - } - } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END); - - // Finalize on the last chunk. - if (_mode === Z_FINISH) { - status = zlib_deflate.deflateEnd(this.strm); - this.onEnd(status); - this.ended = true; - return status === Z_OK; - } - - // callback interim results if Z_SYNC_FLUSH. - if (_mode === Z_SYNC_FLUSH) { - this.onEnd(Z_OK); - strm.avail_out = 0; - return true; - } - - return true; -}; - - -/** - * Deflate#onData(chunk) -> Void - * - chunk (Uint8Array|Array|String): output data. Type of array depends - * on js engine support. When string output requested, each chunk - * will be string. - * - * By default, stores data blocks in `chunks[]` property and glue - * those in `onEnd`. Override this handler, if you need another behaviour. - **/ -Deflate.prototype.onData = function (chunk) { - this.chunks.push(chunk); -}; - - -/** - * Deflate#onEnd(status) -> Void - * - status (Number): deflate status. 0 (Z_OK) on success, - * other if not. - * - * Called once after you tell deflate that the input stream is - * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH) - * or if an error happened. By default - join collected chunks, - * free memory and fill `results` / `err` properties. - **/ -Deflate.prototype.onEnd = function (status) { - // On success - join - if (status === Z_OK) { - if (this.options.to === 'string') { - this.result = this.chunks.join(''); - } else { - this.result = utils.flattenChunks(this.chunks); - } - } - this.chunks = []; - this.err = status; - this.msg = this.strm.msg; -}; - - -/** - * deflate(data[, options]) -> Uint8Array|Array|String - * - data (Uint8Array|Array|String): input data to compress. - * - options (Object): zlib deflate options. - * - * Compress `data` with deflate algorithm and `options`. - * - * Supported options are: - * - * - level - * - windowBits - * - memLevel - * - strategy - * - dictionary - * - * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) - * for more information on these. - * - * Sugar (options): - * - * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify - * negative windowBits implicitly. - * - `to` (String) - if equal to 'string', then result will be "binary string" - * (each char code [0..255]) - * - * ##### Example: - * - * ```javascript - * var pako = require('pako') - * , data = Uint8Array([1,2,3,4,5,6,7,8,9]); - * - * console.log(pako.deflate(data)); - * ``` - **/ -function deflate(input, options) { - var deflator = new Deflate(options); - - deflator.push(input, true); - - // That will never happens, if you don't cheat with options :) - if (deflator.err) { throw deflator.msg || msg[deflator.err]; } - - return deflator.result; -} - - -/** - * deflateRaw(data[, options]) -> Uint8Array|Array|String - * - data (Uint8Array|Array|String): input data to compress. - * - options (Object): zlib deflate options. - * - * The same as [[deflate]], but creates raw data, without wrapper - * (header and adler32 crc). - **/ -function deflateRaw(input, options) { - options = options || {}; - options.raw = true; - return deflate(input, options); -} - - -/** - * gzip(data[, options]) -> Uint8Array|Array|String - * - data (Uint8Array|Array|String): input data to compress. - * - options (Object): zlib deflate options. - * - * The same as [[deflate]], but create gzip wrapper instead of - * deflate one. - **/ -function gzip(input, options) { - options = options || {}; - options.gzip = true; - return deflate(input, options); -} - - -exports.Deflate = Deflate; -exports.deflate = deflate; -exports.deflateRaw = deflateRaw; -exports.gzip = gzip; - -},{"./utils/common":3,"./utils/strings":4,"./zlib/deflate":8,"./zlib/messages":13,"./zlib/zstream":15}],2:[function(require,module,exports){ -'use strict'; - - -var zlib_inflate = require('./zlib/inflate'); -var utils = require('./utils/common'); -var strings = require('./utils/strings'); -var c = require('./zlib/constants'); -var msg = require('./zlib/messages'); -var ZStream = require('./zlib/zstream'); -var GZheader = require('./zlib/gzheader'); - -var toString = Object.prototype.toString; - -/** - * class Inflate - * - * Generic JS-style wrapper for zlib calls. If you don't need - * streaming behaviour - use more simple functions: [[inflate]] - * and [[inflateRaw]]. - **/ - -/* internal - * inflate.chunks -> Array - * - * Chunks of output data, if [[Inflate#onData]] not overridden. - **/ - -/** - * Inflate.result -> Uint8Array|Array|String - * - * Uncompressed result, generated by default [[Inflate#onData]] - * and [[Inflate#onEnd]] handlers. Filled after you push last chunk - * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you - * push a chunk with explicit flush (call [[Inflate#push]] with - * `Z_SYNC_FLUSH` param). - **/ - -/** - * Inflate.err -> Number - * - * Error code after inflate finished. 0 (Z_OK) on success. - * Should be checked if broken data possible. - **/ - -/** - * Inflate.msg -> String - * - * Error message, if [[Inflate.err]] != 0 - **/ - - -/** - * new Inflate(options) - * - options (Object): zlib inflate options. - * - * Creates new inflator instance with specified params. Throws exception - * on bad params. Supported options: - * - * - `windowBits` - * - `dictionary` - * - * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) - * for more information on these. - * - * Additional options, for internal needs: - * - * - `chunkSize` - size of generated data chunks (16K by default) - * - `raw` (Boolean) - do raw inflate - * - `to` (String) - if equal to 'string', then result will be converted - * from utf8 to utf16 (javascript) string. When string output requested, - * chunk length can differ from `chunkSize`, depending on content. - * - * By default, when no options set, autodetect deflate/gzip data format via - * wrapper header. - * - * ##### Example: - * - * ```javascript - * var pako = require('pako') - * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) - * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); - * - * var inflate = new pako.Inflate({ level: 3}); - * - * inflate.push(chunk1, false); - * inflate.push(chunk2, true); // true -> last chunk - * - * if (inflate.err) { throw new Error(inflate.err); } - * - * console.log(inflate.result); - * ``` - **/ -function Inflate(options) { - if (!(this instanceof Inflate)) return new Inflate(options); - - this.options = utils.assign({ - chunkSize: 16384, - windowBits: 0, - to: '' - }, options || {}); - - var opt = this.options; - - // Force window size for `raw` data, if not set directly, - // because we have no header for autodetect. - if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) { - opt.windowBits = -opt.windowBits; - if (opt.windowBits === 0) { opt.windowBits = -15; } - } - - // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate - if ((opt.windowBits >= 0) && (opt.windowBits < 16) && - !(options && options.windowBits)) { - opt.windowBits += 32; - } - - // Gzip header has no info about windows size, we can do autodetect only - // for deflate. So, if window size not set, force it to max when gzip possible - if ((opt.windowBits > 15) && (opt.windowBits < 48)) { - // bit 3 (16) -> gzipped data - // bit 4 (32) -> autodetect gzip/deflate - if ((opt.windowBits & 15) === 0) { - opt.windowBits |= 15; - } - } - - this.err = 0; // error code, if happens (0 = Z_OK) - this.msg = ''; // error message - this.ended = false; // used to avoid multiple onEnd() calls - this.chunks = []; // chunks of compressed data - - this.strm = new ZStream(); - this.strm.avail_out = 0; - - var status = zlib_inflate.inflateInit2( - this.strm, - opt.windowBits - ); - - if (status !== c.Z_OK) { - throw new Error(msg[status]); - } - - this.header = new GZheader(); - - zlib_inflate.inflateGetHeader(this.strm, this.header); -} - -/** - * Inflate#push(data[, mode]) -> Boolean - * - data (Uint8Array|Array|ArrayBuffer|String): input data - * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. - * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH. - * - * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with - * new output chunks. Returns `true` on success. The last data block must have - * mode Z_FINISH (or `true`). That will flush internal pending buffers and call - * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you - * can use mode Z_SYNC_FLUSH, keeping the decompression context. - * - * On fail call [[Inflate#onEnd]] with error code and return false. - * - * We strongly recommend to use `Uint8Array` on input for best speed (output - * format is detected automatically). Also, don't skip last param and always - * use the same type in your code (boolean or number). That will improve JS speed. - * - * For regular `Array`-s make sure all elements are [0..255]. - * - * ##### Example - * - * ```javascript - * push(chunk, false); // push one of data chunks - * ... - * push(chunk, true); // push last chunk - * ``` - **/ -Inflate.prototype.push = function (data, mode) { - var strm = this.strm; - var chunkSize = this.options.chunkSize; - var dictionary = this.options.dictionary; - var status, _mode; - var next_out_utf8, tail, utf8str; - var dict; - - // Flag to properly process Z_BUF_ERROR on testing inflate call - // when we check that all output data was flushed. - var allowBufError = false; - - if (this.ended) { return false; } - _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH); - - // Convert data if needed - if (typeof data === 'string') { - // Only binary strings can be decompressed on practice - strm.input = strings.binstring2buf(data); - } else if (toString.call(data) === '[object ArrayBuffer]') { - strm.input = new Uint8Array(data); - } else { - strm.input = data; - } - - strm.next_in = 0; - strm.avail_in = strm.input.length; - - do { - if (strm.avail_out === 0) { - strm.output = new utils.Buf8(chunkSize); - strm.next_out = 0; - strm.avail_out = chunkSize; - } - - status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */ - - if (status === c.Z_NEED_DICT && dictionary) { - // Convert data if needed - if (typeof dictionary === 'string') { - dict = strings.string2buf(dictionary); - } else if (toString.call(dictionary) === '[object ArrayBuffer]') { - dict = new Uint8Array(dictionary); - } else { - dict = dictionary; - } - - status = zlib_inflate.inflateSetDictionary(this.strm, dict); - - } - - if (status === c.Z_BUF_ERROR && allowBufError === true) { - status = c.Z_OK; - allowBufError = false; - } - - if (status !== c.Z_STREAM_END && status !== c.Z_OK) { - this.onEnd(status); - this.ended = true; - return false; - } - - if (strm.next_out) { - if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) { - - if (this.options.to === 'string') { - - next_out_utf8 = strings.utf8border(strm.output, strm.next_out); - - tail = strm.next_out - next_out_utf8; - utf8str = strings.buf2string(strm.output, next_out_utf8); - - // move tail - strm.next_out = tail; - strm.avail_out = chunkSize - tail; - if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); } - - this.onData(utf8str); - - } else { - this.onData(utils.shrinkBuf(strm.output, strm.next_out)); - } - } - } - - // When no more input data, we should check that internal inflate buffers - // are flushed. The only way to do it when avail_out = 0 - run one more - // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR. - // Here we set flag to process this error properly. - // - // NOTE. Deflate does not return error in this case and does not needs such - // logic. - if (strm.avail_in === 0 && strm.avail_out === 0) { - allowBufError = true; - } - - } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END); - - if (status === c.Z_STREAM_END) { - _mode = c.Z_FINISH; - } - - // Finalize on the last chunk. - if (_mode === c.Z_FINISH) { - status = zlib_inflate.inflateEnd(this.strm); - this.onEnd(status); - this.ended = true; - return status === c.Z_OK; - } - - // callback interim results if Z_SYNC_FLUSH. - if (_mode === c.Z_SYNC_FLUSH) { - this.onEnd(c.Z_OK); - strm.avail_out = 0; - return true; - } - - return true; -}; - - -/** - * Inflate#onData(chunk) -> Void - * - chunk (Uint8Array|Array|String): output data. Type of array depends - * on js engine support. When string output requested, each chunk - * will be string. - * - * By default, stores data blocks in `chunks[]` property and glue - * those in `onEnd`. Override this handler, if you need another behaviour. - **/ -Inflate.prototype.onData = function (chunk) { - this.chunks.push(chunk); -}; - - -/** - * Inflate#onEnd(status) -> Void - * - status (Number): inflate status. 0 (Z_OK) on success, - * other if not. - * - * Called either after you tell inflate that the input stream is - * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH) - * or if an error happened. By default - join collected chunks, - * free memory and fill `results` / `err` properties. - **/ -Inflate.prototype.onEnd = function (status) { - // On success - join - if (status === c.Z_OK) { - if (this.options.to === 'string') { - // Glue & convert here, until we teach pako to send - // utf8 aligned strings to onData - this.result = this.chunks.join(''); - } else { - this.result = utils.flattenChunks(this.chunks); - } - } - this.chunks = []; - this.err = status; - this.msg = this.strm.msg; -}; - - -/** - * inflate(data[, options]) -> Uint8Array|Array|String - * - data (Uint8Array|Array|String): input data to decompress. - * - options (Object): zlib inflate options. - * - * Decompress `data` with inflate/ungzip and `options`. Autodetect - * format via wrapper header by default. That's why we don't provide - * separate `ungzip` method. - * - * Supported options are: - * - * - windowBits - * - * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) - * for more information. - * - * Sugar (options): - * - * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify - * negative windowBits implicitly. - * - `to` (String) - if equal to 'string', then result will be converted - * from utf8 to utf16 (javascript) string. When string output requested, - * chunk length can differ from `chunkSize`, depending on content. - * - * - * ##### Example: - * - * ```javascript - * var pako = require('pako') - * , input = pako.deflate([1,2,3,4,5,6,7,8,9]) - * , output; - * - * try { - * output = pako.inflate(input); - * } catch (err) - * console.log(err); - * } - * ``` - **/ -function inflate(input, options) { - var inflator = new Inflate(options); - - inflator.push(input, true); - - // That will never happens, if you don't cheat with options :) - if (inflator.err) { throw inflator.msg || msg[inflator.err]; } - - return inflator.result; -} - - -/** - * inflateRaw(data[, options]) -> Uint8Array|Array|String - * - data (Uint8Array|Array|String): input data to decompress. - * - options (Object): zlib inflate options. - * - * The same as [[inflate]], but creates raw data, without wrapper - * (header and adler32 crc). - **/ -function inflateRaw(input, options) { - options = options || {}; - options.raw = true; - return inflate(input, options); -} - - -/** - * ungzip(data[, options]) -> Uint8Array|Array|String - * - data (Uint8Array|Array|String): input data to decompress. - * - options (Object): zlib inflate options. - * - * Just shortcut to [[inflate]], because it autodetects format - * by header.content. Done for convenience. - **/ - - -exports.Inflate = Inflate; -exports.inflate = inflate; -exports.inflateRaw = inflateRaw; -exports.ungzip = inflate; - -},{"./utils/common":3,"./utils/strings":4,"./zlib/constants":6,"./zlib/gzheader":9,"./zlib/inflate":11,"./zlib/messages":13,"./zlib/zstream":15}],3:[function(require,module,exports){ -'use strict'; - - -var TYPED_OK = (typeof Uint8Array !== 'undefined') && - (typeof Uint16Array !== 'undefined') && - (typeof Int32Array !== 'undefined'); - -function _has(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} - -exports.assign = function (obj /*from1, from2, from3, ...*/) { - var sources = Array.prototype.slice.call(arguments, 1); - while (sources.length) { - var source = sources.shift(); - if (!source) { continue; } - - if (typeof source !== 'object') { - throw new TypeError(source + 'must be non-object'); - } - - for (var p in source) { - if (_has(source, p)) { - obj[p] = source[p]; - } - } - } - - return obj; -}; - - -// reduce buffer size, avoiding mem copy -exports.shrinkBuf = function (buf, size) { - if (buf.length === size) { return buf; } - if (buf.subarray) { return buf.subarray(0, size); } - buf.length = size; - return buf; -}; - - -var fnTyped = { - arraySet: function (dest, src, src_offs, len, dest_offs) { - if (src.subarray && dest.subarray) { - dest.set(src.subarray(src_offs, src_offs + len), dest_offs); - return; - } - // Fallback to ordinary array - for (var i = 0; i < len; i++) { - dest[dest_offs + i] = src[src_offs + i]; - } - }, - // Join array of chunks to single array. - flattenChunks: function (chunks) { - var i, l, len, pos, chunk, result; - - // calculate data length - len = 0; - for (i = 0, l = chunks.length; i < l; i++) { - len += chunks[i].length; - } - - // join chunks - result = new Uint8Array(len); - pos = 0; - for (i = 0, l = chunks.length; i < l; i++) { - chunk = chunks[i]; - result.set(chunk, pos); - pos += chunk.length; - } - - return result; - } -}; - -var fnUntyped = { - arraySet: function (dest, src, src_offs, len, dest_offs) { - for (var i = 0; i < len; i++) { - dest[dest_offs + i] = src[src_offs + i]; - } - }, - // Join array of chunks to single array. - flattenChunks: function (chunks) { - return [].concat.apply([], chunks); - } -}; - - -// Enable/Disable typed arrays use, for testing -// -exports.setTyped = function (on) { - if (on) { - exports.Buf8 = Uint8Array; - exports.Buf16 = Uint16Array; - exports.Buf32 = Int32Array; - exports.assign(exports, fnTyped); - } else { - exports.Buf8 = Array; - exports.Buf16 = Array; - exports.Buf32 = Array; - exports.assign(exports, fnUntyped); - } -}; - -exports.setTyped(TYPED_OK); - -},{}],4:[function(require,module,exports){ -// String encode/decode helpers -'use strict'; - - -var utils = require('./common'); - - -// Quick check if we can use fast array to bin string conversion -// -// - apply(Array) can fail on Android 2.2 -// - apply(Uint8Array) can fail on iOS 5.1 Safari -// -var STR_APPLY_OK = true; -var STR_APPLY_UIA_OK = true; - -try { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; } -try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; } - - -// Table with utf8 lengths (calculated by first byte of sequence) -// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS, -// because max possible codepoint is 0x10ffff -var _utf8len = new utils.Buf8(256); -for (var q = 0; q < 256; q++) { - _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1); -} -_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start - - -// convert string to array (typed, when possible) -exports.string2buf = function (str) { - var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; - - // count binary size - for (m_pos = 0; m_pos < str_len; m_pos++) { - c = str.charCodeAt(m_pos); - if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { - c2 = str.charCodeAt(m_pos + 1); - if ((c2 & 0xfc00) === 0xdc00) { - c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); - m_pos++; - } - } - buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4; - } - - // allocate buffer - buf = new utils.Buf8(buf_len); - - // convert - for (i = 0, m_pos = 0; i < buf_len; m_pos++) { - c = str.charCodeAt(m_pos); - if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { - c2 = str.charCodeAt(m_pos + 1); - if ((c2 & 0xfc00) === 0xdc00) { - c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); - m_pos++; - } - } - if (c < 0x80) { - /* one byte */ - buf[i++] = c; - } else if (c < 0x800) { - /* two bytes */ - buf[i++] = 0xC0 | (c >>> 6); - buf[i++] = 0x80 | (c & 0x3f); - } else if (c < 0x10000) { - /* three bytes */ - buf[i++] = 0xE0 | (c >>> 12); - buf[i++] = 0x80 | (c >>> 6 & 0x3f); - buf[i++] = 0x80 | (c & 0x3f); - } else { - /* four bytes */ - buf[i++] = 0xf0 | (c >>> 18); - buf[i++] = 0x80 | (c >>> 12 & 0x3f); - buf[i++] = 0x80 | (c >>> 6 & 0x3f); - buf[i++] = 0x80 | (c & 0x3f); - } - } - - return buf; -}; - -// Helper (used in 2 places) -function buf2binstring(buf, len) { - // use fallback for big arrays to avoid stack overflow - if (len < 65537) { - if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) { - return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len)); - } - } - - var result = ''; - for (var i = 0; i < len; i++) { - result += String.fromCharCode(buf[i]); - } - return result; -} - - -// Convert byte array to binary string -exports.buf2binstring = function (buf) { - return buf2binstring(buf, buf.length); -}; - - -// Convert binary string (typed, when possible) -exports.binstring2buf = function (str) { - var buf = new utils.Buf8(str.length); - for (var i = 0, len = buf.length; i < len; i++) { - buf[i] = str.charCodeAt(i); - } - return buf; -}; - - -// convert array to string -exports.buf2string = function (buf, max) { - var i, out, c, c_len; - var len = max || buf.length; - - // Reserve max possible length (2 words per char) - // NB: by unknown reasons, Array is significantly faster for - // String.fromCharCode.apply than Uint16Array. - var utf16buf = new Array(len * 2); - - for (out = 0, i = 0; i < len;) { - c = buf[i++]; - // quick process ascii - if (c < 0x80) { utf16buf[out++] = c; continue; } - - c_len = _utf8len[c]; - // skip 5 & 6 byte codes - if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; } - - // apply mask on first byte - c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07; - // join the rest - while (c_len > 1 && i < len) { - c = (c << 6) | (buf[i++] & 0x3f); - c_len--; - } - - // terminated by end of string? - if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; } - - if (c < 0x10000) { - utf16buf[out++] = c; - } else { - c -= 0x10000; - utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff); - utf16buf[out++] = 0xdc00 | (c & 0x3ff); - } - } - - return buf2binstring(utf16buf, out); -}; - - -// Calculate max possible position in utf8 buffer, -// that will not break sequence. If that's not possible -// - (very small limits) return max size as is. -// -// buf[] - utf8 bytes array -// max - length limit (mandatory); -exports.utf8border = function (buf, max) { - var pos; - - max = max || buf.length; - if (max > buf.length) { max = buf.length; } - - // go back from last position, until start of sequence found - pos = max - 1; - while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; } - - // Very small and broken sequence, - // return max, because we should return something anyway. - if (pos < 0) { return max; } - - // If we came to start of buffer - that means buffer is too small, - // return max too. - if (pos === 0) { return max; } - - return (pos + _utf8len[buf[pos]] > max) ? pos : max; -}; - -},{"./common":3}],5:[function(require,module,exports){ -'use strict'; - -// Note: adler32 takes 12% for level 0 and 2% for level 6. -// It isn't worth it to make additional optimizations as in original. -// Small size is preferable. - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -function adler32(adler, buf, len, pos) { - var s1 = (adler & 0xffff) |0, - s2 = ((adler >>> 16) & 0xffff) |0, - n = 0; - - while (len !== 0) { - // Set limit ~ twice less than 5552, to keep - // s2 in 31-bits, because we force signed ints. - // in other case %= will fail. - n = len > 2000 ? 2000 : len; - len -= n; - - do { - s1 = (s1 + buf[pos++]) |0; - s2 = (s2 + s1) |0; - } while (--n); - - s1 %= 65521; - s2 %= 65521; - } - - return (s1 | (s2 << 16)) |0; -} - - -module.exports = adler32; - -},{}],6:[function(require,module,exports){ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -module.exports = { - - /* Allowed flush values; see deflate() and inflate() below for details */ - Z_NO_FLUSH: 0, - Z_PARTIAL_FLUSH: 1, - Z_SYNC_FLUSH: 2, - Z_FULL_FLUSH: 3, - Z_FINISH: 4, - Z_BLOCK: 5, - Z_TREES: 6, - - /* Return codes for the compression/decompression functions. Negative values - * are errors, positive values are used for special but normal events. - */ - Z_OK: 0, - Z_STREAM_END: 1, - Z_NEED_DICT: 2, - Z_ERRNO: -1, - Z_STREAM_ERROR: -2, - Z_DATA_ERROR: -3, - //Z_MEM_ERROR: -4, - Z_BUF_ERROR: -5, - //Z_VERSION_ERROR: -6, - - /* compression levels */ - Z_NO_COMPRESSION: 0, - Z_BEST_SPEED: 1, - Z_BEST_COMPRESSION: 9, - Z_DEFAULT_COMPRESSION: -1, - - - Z_FILTERED: 1, - Z_HUFFMAN_ONLY: 2, - Z_RLE: 3, - Z_FIXED: 4, - Z_DEFAULT_STRATEGY: 0, - - /* Possible values of the data_type field (though see inflate()) */ - Z_BINARY: 0, - Z_TEXT: 1, - //Z_ASCII: 1, // = Z_TEXT (deprecated) - Z_UNKNOWN: 2, - - /* The deflate compression method */ - Z_DEFLATED: 8 - //Z_NULL: null // Use -1 or null inline, depending on var type -}; - -},{}],7:[function(require,module,exports){ -'use strict'; - -// Note: we can't get significant speed boost here. -// So write code to minimize size - no pregenerated tables -// and array tools dependencies. - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -// Use ordinary array, since untyped makes no boost here -function makeTable() { - var c, table = []; - - for (var n = 0; n < 256; n++) { - c = n; - for (var k = 0; k < 8; k++) { - c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); - } - table[n] = c; - } - - return table; -} - -// Create table on load. Just 255 signed longs. Not a problem. -var crcTable = makeTable(); - - -function crc32(crc, buf, len, pos) { - var t = crcTable, - end = pos + len; - - crc ^= -1; - - for (var i = pos; i < end; i++) { - crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF]; - } - - return (crc ^ (-1)); // >>> 0; -} - - -module.exports = crc32; - -},{}],8:[function(require,module,exports){ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -var utils = require('../utils/common'); -var trees = require('./trees'); -var adler32 = require('./adler32'); -var crc32 = require('./crc32'); -var msg = require('./messages'); - -/* Public constants ==========================================================*/ -/* ===========================================================================*/ - - -/* Allowed flush values; see deflate() and inflate() below for details */ -var Z_NO_FLUSH = 0; -var Z_PARTIAL_FLUSH = 1; -//var Z_SYNC_FLUSH = 2; -var Z_FULL_FLUSH = 3; -var Z_FINISH = 4; -var Z_BLOCK = 5; -//var Z_TREES = 6; - - -/* Return codes for the compression/decompression functions. Negative values - * are errors, positive values are used for special but normal events. - */ -var Z_OK = 0; -var Z_STREAM_END = 1; -//var Z_NEED_DICT = 2; -//var Z_ERRNO = -1; -var Z_STREAM_ERROR = -2; -var Z_DATA_ERROR = -3; -//var Z_MEM_ERROR = -4; -var Z_BUF_ERROR = -5; -//var Z_VERSION_ERROR = -6; - - -/* compression levels */ -//var Z_NO_COMPRESSION = 0; -//var Z_BEST_SPEED = 1; -//var Z_BEST_COMPRESSION = 9; -var Z_DEFAULT_COMPRESSION = -1; - - -var Z_FILTERED = 1; -var Z_HUFFMAN_ONLY = 2; -var Z_RLE = 3; -var Z_FIXED = 4; -var Z_DEFAULT_STRATEGY = 0; - -/* Possible values of the data_type field (though see inflate()) */ -//var Z_BINARY = 0; -//var Z_TEXT = 1; -//var Z_ASCII = 1; // = Z_TEXT -var Z_UNKNOWN = 2; - - -/* The deflate compression method */ -var Z_DEFLATED = 8; - -/*============================================================================*/ - - -var MAX_MEM_LEVEL = 9; -/* Maximum value for memLevel in deflateInit2 */ -var MAX_WBITS = 15; -/* 32K LZ77 window */ -var DEF_MEM_LEVEL = 8; - - -var LENGTH_CODES = 29; -/* number of length codes, not counting the special END_BLOCK code */ -var LITERALS = 256; -/* number of literal bytes 0..255 */ -var L_CODES = LITERALS + 1 + LENGTH_CODES; -/* number of Literal or Length codes, including the END_BLOCK code */ -var D_CODES = 30; -/* number of distance codes */ -var BL_CODES = 19; -/* number of codes used to transfer the bit lengths */ -var HEAP_SIZE = 2 * L_CODES + 1; -/* maximum heap size */ -var MAX_BITS = 15; -/* All codes must not exceed MAX_BITS bits */ - -var MIN_MATCH = 3; -var MAX_MATCH = 258; -var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1); - -var PRESET_DICT = 0x20; - -var INIT_STATE = 42; -var EXTRA_STATE = 69; -var NAME_STATE = 73; -var COMMENT_STATE = 91; -var HCRC_STATE = 103; -var BUSY_STATE = 113; -var FINISH_STATE = 666; - -var BS_NEED_MORE = 1; /* block not completed, need more input or more output */ -var BS_BLOCK_DONE = 2; /* block flush performed */ -var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */ -var BS_FINISH_DONE = 4; /* finish done, accept no more input or output */ - -var OS_CODE = 0x03; // Unix :) . Don't detect, use this default. - -function err(strm, errorCode) { - strm.msg = msg[errorCode]; - return errorCode; -} - -function rank(f) { - return ((f) << 1) - ((f) > 4 ? 9 : 0); -} - -function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } - - -/* ========================================================================= - * Flush as much pending output as possible. All deflate() output goes - * through this function so some applications may wish to modify it - * to avoid allocating a large strm->output buffer and copying into it. - * (See also read_buf()). - */ -function flush_pending(strm) { - var s = strm.state; - - //_tr_flush_bits(s); - var len = s.pending; - if (len > strm.avail_out) { - len = strm.avail_out; - } - if (len === 0) { return; } - - utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out); - strm.next_out += len; - s.pending_out += len; - strm.total_out += len; - strm.avail_out -= len; - s.pending -= len; - if (s.pending === 0) { - s.pending_out = 0; - } -} - - -function flush_block_only(s, last) { - trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last); - s.block_start = s.strstart; - flush_pending(s.strm); -} - - -function put_byte(s, b) { - s.pending_buf[s.pending++] = b; -} - - -/* ========================================================================= - * Put a short in the pending buffer. The 16-bit value is put in MSB order. - * IN assertion: the stream state is correct and there is enough room in - * pending_buf. - */ -function putShortMSB(s, b) { -// put_byte(s, (Byte)(b >> 8)); -// put_byte(s, (Byte)(b & 0xff)); - s.pending_buf[s.pending++] = (b >>> 8) & 0xff; - s.pending_buf[s.pending++] = b & 0xff; -} - - -/* =========================================================================== - * Read a new buffer from the current input stream, update the adler32 - * and total number of bytes read. All deflate() input goes through - * this function so some applications may wish to modify it to avoid - * allocating a large strm->input buffer and copying from it. - * (See also flush_pending()). - */ -function read_buf(strm, buf, start, size) { - var len = strm.avail_in; - - if (len > size) { len = size; } - if (len === 0) { return 0; } - - strm.avail_in -= len; - - // zmemcpy(buf, strm->next_in, len); - utils.arraySet(buf, strm.input, strm.next_in, len, start); - if (strm.state.wrap === 1) { - strm.adler = adler32(strm.adler, buf, len, start); - } - - else if (strm.state.wrap === 2) { - strm.adler = crc32(strm.adler, buf, len, start); - } - - strm.next_in += len; - strm.total_in += len; - - return len; -} - - -/* =========================================================================== - * Set match_start to the longest match starting at the given string and - * return its length. Matches shorter or equal to prev_length are discarded, - * in which case the result is equal to prev_length and match_start is - * garbage. - * IN assertions: cur_match is the head of the hash chain for the current - * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 - * OUT assertion: the match length is not greater than s->lookahead. - */ -function longest_match(s, cur_match) { - var chain_length = s.max_chain_length; /* max hash chain length */ - var scan = s.strstart; /* current string */ - var match; /* matched string */ - var len; /* length of current match */ - var best_len = s.prev_length; /* best match length so far */ - var nice_match = s.nice_match; /* stop if match long enough */ - var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ? - s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/; - - var _win = s.window; // shortcut - - var wmask = s.w_mask; - var prev = s.prev; - - /* Stop when cur_match becomes <= limit. To simplify the code, - * we prevent matches with the string of window index 0. - */ - - var strend = s.strstart + MAX_MATCH; - var scan_end1 = _win[scan + best_len - 1]; - var scan_end = _win[scan + best_len]; - - /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. - * It is easy to get rid of this optimization if necessary. - */ - // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); - - /* Do not waste too much time if we already have a good match: */ - if (s.prev_length >= s.good_match) { - chain_length >>= 2; - } - /* Do not look for matches beyond the end of the input. This is necessary - * to make deflate deterministic. - */ - if (nice_match > s.lookahead) { nice_match = s.lookahead; } - - // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); - - do { - // Assert(cur_match < s->strstart, "no future"); - match = cur_match; - - /* Skip to next match if the match length cannot increase - * or if the match length is less than 2. Note that the checks below - * for insufficient lookahead only occur occasionally for performance - * reasons. Therefore uninitialized memory will be accessed, and - * conditional jumps will be made that depend on those values. - * However the length of the match is limited to the lookahead, so - * the output of deflate is not affected by the uninitialized values. - */ - - if (_win[match + best_len] !== scan_end || - _win[match + best_len - 1] !== scan_end1 || - _win[match] !== _win[scan] || - _win[++match] !== _win[scan + 1]) { - continue; - } - - /* The check at best_len-1 can be removed because it will be made - * again later. (This heuristic is not always a win.) - * It is not necessary to compare scan[2] and match[2] since they - * are always equal when the other bytes match, given that - * the hash keys are equal and that HASH_BITS >= 8. - */ - scan += 2; - match++; - // Assert(*scan == *match, "match[2]?"); - - /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. - */ - do { - /*jshint noempty:false*/ - } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && - _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && - _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && - _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && - scan < strend); - - // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); - - len = MAX_MATCH - (strend - scan); - scan = strend - MAX_MATCH; - - if (len > best_len) { - s.match_start = cur_match; - best_len = len; - if (len >= nice_match) { - break; - } - scan_end1 = _win[scan + best_len - 1]; - scan_end = _win[scan + best_len]; - } - } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0); - - if (best_len <= s.lookahead) { - return best_len; - } - return s.lookahead; -} - - -/* =========================================================================== - * Fill the window when the lookahead becomes insufficient. - * Updates strstart and lookahead. - * - * IN assertion: lookahead < MIN_LOOKAHEAD - * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD - * At least one byte has been read, or avail_in == 0; reads are - * performed for at least two bytes (required for the zip translate_eol - * option -- not supported here). - */ -function fill_window(s) { - var _w_size = s.w_size; - var p, n, m, more, str; - - //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); - - do { - more = s.window_size - s.lookahead - s.strstart; - - // JS ints have 32 bit, block below not needed - /* Deal with !@#$% 64K limit: */ - //if (sizeof(int) <= 2) { - // if (more == 0 && s->strstart == 0 && s->lookahead == 0) { - // more = wsize; - // - // } else if (more == (unsigned)(-1)) { - // /* Very unlikely, but possible on 16 bit machine if - // * strstart == 0 && lookahead == 1 (input done a byte at time) - // */ - // more--; - // } - //} - - - /* If the window is almost full and there is insufficient lookahead, - * move the upper half to the lower one to make room in the upper half. - */ - if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) { - - utils.arraySet(s.window, s.window, _w_size, _w_size, 0); - s.match_start -= _w_size; - s.strstart -= _w_size; - /* we now have strstart >= MAX_DIST */ - s.block_start -= _w_size; - - /* Slide the hash table (could be avoided with 32 bit values - at the expense of memory usage). We slide even when level == 0 - to keep the hash table consistent if we switch back to level > 0 - later. (Using level 0 permanently is not an optimal usage of - zlib, so we don't care about this pathological case.) - */ - - n = s.hash_size; - p = n; - do { - m = s.head[--p]; - s.head[p] = (m >= _w_size ? m - _w_size : 0); - } while (--n); - - n = _w_size; - p = n; - do { - m = s.prev[--p]; - s.prev[p] = (m >= _w_size ? m - _w_size : 0); - /* If n is not on any hash chain, prev[n] is garbage but - * its value will never be used. - */ - } while (--n); - - more += _w_size; - } - if (s.strm.avail_in === 0) { - break; - } - - /* If there was no sliding: - * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && - * more == window_size - lookahead - strstart - * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) - * => more >= window_size - 2*WSIZE + 2 - * In the BIG_MEM or MMAP case (not yet supported), - * window_size == input_size + MIN_LOOKAHEAD && - * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. - * Otherwise, window_size == 2*WSIZE so more >= 2. - * If there was sliding, more >= WSIZE. So in all cases, more >= 2. - */ - //Assert(more >= 2, "more < 2"); - n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more); - s.lookahead += n; - - /* Initialize the hash value now that we have some input: */ - if (s.lookahead + s.insert >= MIN_MATCH) { - str = s.strstart - s.insert; - s.ins_h = s.window[str]; - - /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask; -//#if MIN_MATCH != 3 -// Call update_hash() MIN_MATCH-3 more times -//#endif - while (s.insert) { - /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; - - s.prev[str & s.w_mask] = s.head[s.ins_h]; - s.head[s.ins_h] = str; - str++; - s.insert--; - if (s.lookahead + s.insert < MIN_MATCH) { - break; - } - } - } - /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, - * but this is not important since only literal bytes will be emitted. - */ - - } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0); - - /* If the WIN_INIT bytes after the end of the current data have never been - * written, then zero those bytes in order to avoid memory check reports of - * the use of uninitialized (or uninitialised as Julian writes) bytes by - * the longest match routines. Update the high water mark for the next - * time through here. WIN_INIT is set to MAX_MATCH since the longest match - * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. - */ -// if (s.high_water < s.window_size) { -// var curr = s.strstart + s.lookahead; -// var init = 0; -// -// if (s.high_water < curr) { -// /* Previous high water mark below current data -- zero WIN_INIT -// * bytes or up to end of window, whichever is less. -// */ -// init = s.window_size - curr; -// if (init > WIN_INIT) -// init = WIN_INIT; -// zmemzero(s->window + curr, (unsigned)init); -// s->high_water = curr + init; -// } -// else if (s->high_water < (ulg)curr + WIN_INIT) { -// /* High water mark at or above current data, but below current data -// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up -// * to end of window, whichever is less. -// */ -// init = (ulg)curr + WIN_INIT - s->high_water; -// if (init > s->window_size - s->high_water) -// init = s->window_size - s->high_water; -// zmemzero(s->window + s->high_water, (unsigned)init); -// s->high_water += init; -// } -// } -// -// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, -// "not enough room for search"); -} - -/* =========================================================================== - * Copy without compression as much as possible from the input stream, return - * the current block state. - * This function does not insert new strings in the dictionary since - * uncompressible data is probably not useful. This function is used - * only for the level=0 compression option. - * NOTE: this function should be optimized to avoid extra copying from - * window to pending_buf. - */ -function deflate_stored(s, flush) { - /* Stored blocks are limited to 0xffff bytes, pending_buf is limited - * to pending_buf_size, and each stored block has a 5 byte header: - */ - var max_block_size = 0xffff; - - if (max_block_size > s.pending_buf_size - 5) { - max_block_size = s.pending_buf_size - 5; - } - - /* Copy as much as possible from input to output: */ - for (;;) { - /* Fill the window as much as possible: */ - if (s.lookahead <= 1) { - - //Assert(s->strstart < s->w_size+MAX_DIST(s) || - // s->block_start >= (long)s->w_size, "slide too late"); -// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) || -// s.block_start >= s.w_size)) { -// throw new Error("slide too late"); -// } - - fill_window(s); - if (s.lookahead === 0 && flush === Z_NO_FLUSH) { - return BS_NEED_MORE; - } - - if (s.lookahead === 0) { - break; - } - /* flush the current block */ - } - //Assert(s->block_start >= 0L, "block gone"); -// if (s.block_start < 0) throw new Error("block gone"); - - s.strstart += s.lookahead; - s.lookahead = 0; - - /* Emit a stored block if pending_buf will be full: */ - var max_start = s.block_start + max_block_size; - - if (s.strstart === 0 || s.strstart >= max_start) { - /* strstart == 0 is possible when wraparound on 16-bit machine */ - s.lookahead = s.strstart - max_start; - s.strstart = max_start; - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - - - } - /* Flush if we may have to slide, otherwise block_start may become - * negative and the data will be gone: - */ - if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - } - - s.insert = 0; - - if (flush === Z_FINISH) { - /*** FLUSH_BLOCK(s, 1); ***/ - flush_block_only(s, true); - if (s.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - /***/ - return BS_FINISH_DONE; - } - - if (s.strstart > s.block_start) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - - return BS_NEED_MORE; -} - -/* =========================================================================== - * Compress as much as possible from the input stream, return the current - * block state. - * This function does not perform lazy evaluation of matches and inserts - * new strings in the dictionary only for unmatched strings or for short - * matches. It is used only for the fast compression options. - */ -function deflate_fast(s, flush) { - var hash_head; /* head of the hash chain */ - var bflush; /* set if current block must be flushed */ - - for (;;) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - if (s.lookahead < MIN_LOOKAHEAD) { - fill_window(s); - if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { - return BS_NEED_MORE; - } - if (s.lookahead === 0) { - break; /* flush the current block */ - } - } - - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - hash_head = 0/*NIL*/; - if (s.lookahead >= MIN_MATCH) { - /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; - hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; - s.head[s.ins_h] = s.strstart; - /***/ - } - - /* Find the longest match, discarding those <= prev_length. - * At this point we have always match_length < MIN_MATCH - */ - if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - s.match_length = longest_match(s, hash_head); - /* longest_match() sets match_start */ - } - if (s.match_length >= MIN_MATCH) { - // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only - - /*** _tr_tally_dist(s, s.strstart - s.match_start, - s.match_length - MIN_MATCH, bflush); ***/ - bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); - - s.lookahead -= s.match_length; - - /* Insert new strings in the hash table only if the match length - * is not too large. This saves time but degrades compression. - */ - if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) { - s.match_length--; /* string at strstart already in table */ - do { - s.strstart++; - /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; - hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; - s.head[s.ins_h] = s.strstart; - /***/ - /* strstart never exceeds WSIZE-MAX_MATCH, so there are - * always MIN_MATCH bytes ahead. - */ - } while (--s.match_length !== 0); - s.strstart++; - } else - { - s.strstart += s.match_length; - s.match_length = 0; - s.ins_h = s.window[s.strstart]; - /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask; - -//#if MIN_MATCH != 3 -// Call UPDATE_HASH() MIN_MATCH-3 more times -//#endif - /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not - * matter since it will be recomputed at next deflate call. - */ - } - } else { - /* No match, output a literal byte */ - //Tracevv((stderr,"%c", s.window[s.strstart])); - /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = trees._tr_tally(s, 0, s.window[s.strstart]); - - s.lookahead--; - s.strstart++; - } - if (bflush) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - } - s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1); - if (flush === Z_FINISH) { - /*** FLUSH_BLOCK(s, 1); ***/ - flush_block_only(s, true); - if (s.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - /***/ - return BS_FINISH_DONE; - } - if (s.last_lit) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - return BS_BLOCK_DONE; -} - -/* =========================================================================== - * Same as above, but achieves better compression. We use a lazy - * evaluation for matches: a match is finally adopted only if there is - * no better match at the next window position. - */ -function deflate_slow(s, flush) { - var hash_head; /* head of hash chain */ - var bflush; /* set if current block must be flushed */ - - var max_insert; - - /* Process the input block. */ - for (;;) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - if (s.lookahead < MIN_LOOKAHEAD) { - fill_window(s); - if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { - return BS_NEED_MORE; - } - if (s.lookahead === 0) { break; } /* flush the current block */ - } - - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - hash_head = 0/*NIL*/; - if (s.lookahead >= MIN_MATCH) { - /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; - hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; - s.head[s.ins_h] = s.strstart; - /***/ - } - - /* Find the longest match, discarding those <= prev_length. - */ - s.prev_length = s.match_length; - s.prev_match = s.match_start; - s.match_length = MIN_MATCH - 1; - - if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match && - s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - s.match_length = longest_match(s, hash_head); - /* longest_match() sets match_start */ - - if (s.match_length <= 5 && - (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { - - /* If prev_match is also MIN_MATCH, match_start is garbage - * but we will ignore the current match anyway. - */ - s.match_length = MIN_MATCH - 1; - } - } - /* If there was a match at the previous step and the current - * match is not better, output the previous match: - */ - if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { - max_insert = s.strstart + s.lookahead - MIN_MATCH; - /* Do not insert strings in hash table beyond this. */ - - //check_match(s, s.strstart-1, s.prev_match, s.prev_length); - - /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match, - s.prev_length - MIN_MATCH, bflush);***/ - bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH); - /* Insert in hash table all strings up to the end of the match. - * strstart-1 and strstart are already inserted. If there is not - * enough lookahead, the last two strings are not inserted in - * the hash table. - */ - s.lookahead -= s.prev_length - 1; - s.prev_length -= 2; - do { - if (++s.strstart <= max_insert) { - /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; - hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; - s.head[s.ins_h] = s.strstart; - /***/ - } - } while (--s.prev_length !== 0); - s.match_available = 0; - s.match_length = MIN_MATCH - 1; - s.strstart++; - - if (bflush) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - - } else if (s.match_available) { - /* If there was no match at the previous position, output a - * single literal. If there was a match but the current match - * is longer, truncate the previous match to a single literal. - */ - //Tracevv((stderr,"%c", s->window[s->strstart-1])); - /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ - bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); - - if (bflush) { - /*** FLUSH_BLOCK_ONLY(s, 0) ***/ - flush_block_only(s, false); - /***/ - } - s.strstart++; - s.lookahead--; - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - } else { - /* There is no previous match to compare with, wait for - * the next step to decide. - */ - s.match_available = 1; - s.strstart++; - s.lookahead--; - } - } - //Assert (flush != Z_NO_FLUSH, "no flush?"); - if (s.match_available) { - //Tracevv((stderr,"%c", s->window[s->strstart-1])); - /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ - bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); - - s.match_available = 0; - } - s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; - if (flush === Z_FINISH) { - /*** FLUSH_BLOCK(s, 1); ***/ - flush_block_only(s, true); - if (s.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - /***/ - return BS_FINISH_DONE; - } - if (s.last_lit) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - - return BS_BLOCK_DONE; -} - - -/* =========================================================================== - * For Z_RLE, simply look for runs of bytes, generate matches only of distance - * one. Do not maintain a hash table. (It will be regenerated if this run of - * deflate switches away from Z_RLE.) - */ -function deflate_rle(s, flush) { - var bflush; /* set if current block must be flushed */ - var prev; /* byte at distance one to match */ - var scan, strend; /* scan goes up to strend for length of run */ - - var _win = s.window; - - for (;;) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the longest run, plus one for the unrolled loop. - */ - if (s.lookahead <= MAX_MATCH) { - fill_window(s); - if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) { - return BS_NEED_MORE; - } - if (s.lookahead === 0) { break; } /* flush the current block */ - } - - /* See how many times the previous byte repeats */ - s.match_length = 0; - if (s.lookahead >= MIN_MATCH && s.strstart > 0) { - scan = s.strstart - 1; - prev = _win[scan]; - if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { - strend = s.strstart + MAX_MATCH; - do { - /*jshint noempty:false*/ - } while (prev === _win[++scan] && prev === _win[++scan] && - prev === _win[++scan] && prev === _win[++scan] && - prev === _win[++scan] && prev === _win[++scan] && - prev === _win[++scan] && prev === _win[++scan] && - scan < strend); - s.match_length = MAX_MATCH - (strend - scan); - if (s.match_length > s.lookahead) { - s.match_length = s.lookahead; - } - } - //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); - } - - /* Emit match if have run of MIN_MATCH or longer, else emit literal */ - if (s.match_length >= MIN_MATCH) { - //check_match(s, s.strstart, s.strstart - 1, s.match_length); - - /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/ - bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH); - - s.lookahead -= s.match_length; - s.strstart += s.match_length; - s.match_length = 0; - } else { - /* No match, output a literal byte */ - //Tracevv((stderr,"%c", s->window[s->strstart])); - /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = trees._tr_tally(s, 0, s.window[s.strstart]); - - s.lookahead--; - s.strstart++; - } - if (bflush) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - } - s.insert = 0; - if (flush === Z_FINISH) { - /*** FLUSH_BLOCK(s, 1); ***/ - flush_block_only(s, true); - if (s.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - /***/ - return BS_FINISH_DONE; - } - if (s.last_lit) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - return BS_BLOCK_DONE; -} - -/* =========================================================================== - * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. - * (It will be regenerated if this run of deflate switches away from Huffman.) - */ -function deflate_huff(s, flush) { - var bflush; /* set if current block must be flushed */ - - for (;;) { - /* Make sure that we have a literal to write. */ - if (s.lookahead === 0) { - fill_window(s); - if (s.lookahead === 0) { - if (flush === Z_NO_FLUSH) { - return BS_NEED_MORE; - } - break; /* flush the current block */ - } - } - - /* Output a literal byte */ - s.match_length = 0; - //Tracevv((stderr,"%c", s->window[s->strstart])); - /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = trees._tr_tally(s, 0, s.window[s.strstart]); - s.lookahead--; - s.strstart++; - if (bflush) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - } - s.insert = 0; - if (flush === Z_FINISH) { - /*** FLUSH_BLOCK(s, 1); ***/ - flush_block_only(s, true); - if (s.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - /***/ - return BS_FINISH_DONE; - } - if (s.last_lit) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - return BS_BLOCK_DONE; -} - -/* Values for max_lazy_match, good_match and max_chain_length, depending on - * the desired pack level (0..9). The values given below have been tuned to - * exclude worst case performance for pathological files. Better values may be - * found for specific files. - */ -function Config(good_length, max_lazy, nice_length, max_chain, func) { - this.good_length = good_length; - this.max_lazy = max_lazy; - this.nice_length = nice_length; - this.max_chain = max_chain; - this.func = func; -} - -var configuration_table; - -configuration_table = [ - /* good lazy nice chain */ - new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */ - new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */ - new Config(4, 5, 16, 8, deflate_fast), /* 2 */ - new Config(4, 6, 32, 32, deflate_fast), /* 3 */ - - new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */ - new Config(8, 16, 32, 32, deflate_slow), /* 5 */ - new Config(8, 16, 128, 128, deflate_slow), /* 6 */ - new Config(8, 32, 128, 256, deflate_slow), /* 7 */ - new Config(32, 128, 258, 1024, deflate_slow), /* 8 */ - new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */ -]; - - -/* =========================================================================== - * Initialize the "longest match" routines for a new zlib stream - */ -function lm_init(s) { - s.window_size = 2 * s.w_size; - - /*** CLEAR_HASH(s); ***/ - zero(s.head); // Fill with NIL (= 0); - - /* Set the default configuration parameters: - */ - s.max_lazy_match = configuration_table[s.level].max_lazy; - s.good_match = configuration_table[s.level].good_length; - s.nice_match = configuration_table[s.level].nice_length; - s.max_chain_length = configuration_table[s.level].max_chain; - - s.strstart = 0; - s.block_start = 0; - s.lookahead = 0; - s.insert = 0; - s.match_length = s.prev_length = MIN_MATCH - 1; - s.match_available = 0; - s.ins_h = 0; -} - - -function DeflateState() { - this.strm = null; /* pointer back to this zlib stream */ - this.status = 0; /* as the name implies */ - this.pending_buf = null; /* output still pending */ - this.pending_buf_size = 0; /* size of pending_buf */ - this.pending_out = 0; /* next pending byte to output to the stream */ - this.pending = 0; /* nb of bytes in the pending buffer */ - this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ - this.gzhead = null; /* gzip header information to write */ - this.gzindex = 0; /* where in extra, name, or comment */ - this.method = Z_DEFLATED; /* can only be DEFLATED */ - this.last_flush = -1; /* value of flush param for previous deflate call */ - - this.w_size = 0; /* LZ77 window size (32K by default) */ - this.w_bits = 0; /* log2(w_size) (8..16) */ - this.w_mask = 0; /* w_size - 1 */ - - this.window = null; - /* Sliding window. Input bytes are read into the second half of the window, - * and move to the first half later to keep a dictionary of at least wSize - * bytes. With this organization, matches are limited to a distance of - * wSize-MAX_MATCH bytes, but this ensures that IO is always - * performed with a length multiple of the block size. - */ - - this.window_size = 0; - /* Actual size of window: 2*wSize, except when the user input buffer - * is directly used as sliding window. - */ - - this.prev = null; - /* Link to older string with same hash index. To limit the size of this - * array to 64K, this link is maintained only for the last 32K strings. - * An index in this array is thus a window index modulo 32K. - */ - - this.head = null; /* Heads of the hash chains or NIL. */ - - this.ins_h = 0; /* hash index of string to be inserted */ - this.hash_size = 0; /* number of elements in hash table */ - this.hash_bits = 0; /* log2(hash_size) */ - this.hash_mask = 0; /* hash_size-1 */ - - this.hash_shift = 0; - /* Number of bits by which ins_h must be shifted at each input - * step. It must be such that after MIN_MATCH steps, the oldest - * byte no longer takes part in the hash key, that is: - * hash_shift * MIN_MATCH >= hash_bits - */ - - this.block_start = 0; - /* Window position at the beginning of the current output block. Gets - * negative when the window is moved backwards. - */ - - this.match_length = 0; /* length of best match */ - this.prev_match = 0; /* previous match */ - this.match_available = 0; /* set if previous match exists */ - this.strstart = 0; /* start of string to insert */ - this.match_start = 0; /* start of matching string */ - this.lookahead = 0; /* number of valid bytes ahead in window */ - - this.prev_length = 0; - /* Length of the best match at previous step. Matches not greater than this - * are discarded. This is used in the lazy match evaluation. - */ - - this.max_chain_length = 0; - /* To speed up deflation, hash chains are never searched beyond this - * length. A higher limit improves compression ratio but degrades the - * speed. - */ - - this.max_lazy_match = 0; - /* Attempt to find a better match only when the current match is strictly - * smaller than this value. This mechanism is used only for compression - * levels >= 4. - */ - // That's alias to max_lazy_match, don't use directly - //this.max_insert_length = 0; - /* Insert new strings in the hash table only if the match length is not - * greater than this length. This saves time but degrades compression. - * max_insert_length is used only for compression levels <= 3. - */ - - this.level = 0; /* compression level (1..9) */ - this.strategy = 0; /* favor or force Huffman coding*/ - - this.good_match = 0; - /* Use a faster search when the previous match is longer than this */ - - this.nice_match = 0; /* Stop searching when current match exceeds this */ - - /* used by trees.c: */ - - /* Didn't use ct_data typedef below to suppress compiler warning */ - - // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ - // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ - // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ - - // Use flat array of DOUBLE size, with interleaved fata, - // because JS does not support effective - this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2); - this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2); - this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2); - zero(this.dyn_ltree); - zero(this.dyn_dtree); - zero(this.bl_tree); - - this.l_desc = null; /* desc. for literal tree */ - this.d_desc = null; /* desc. for distance tree */ - this.bl_desc = null; /* desc. for bit length tree */ - - //ush bl_count[MAX_BITS+1]; - this.bl_count = new utils.Buf16(MAX_BITS + 1); - /* number of codes at each bit length for an optimal tree */ - - //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ - this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */ - zero(this.heap); - - this.heap_len = 0; /* number of elements in the heap */ - this.heap_max = 0; /* element of largest frequency */ - /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. - * The same heap array is used to build all trees. - */ - - this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1]; - zero(this.depth); - /* Depth of each subtree used as tie breaker for trees of equal frequency - */ - - this.l_buf = 0; /* buffer index for literals or lengths */ - - this.lit_bufsize = 0; - /* Size of match buffer for literals/lengths. There are 4 reasons for - * limiting lit_bufsize to 64K: - * - frequencies can be kept in 16 bit counters - * - if compression is not successful for the first block, all input - * data is still in the window so we can still emit a stored block even - * when input comes from standard input. (This can also be done for - * all blocks if lit_bufsize is not greater than 32K.) - * - if compression is not successful for a file smaller than 64K, we can - * even emit a stored file instead of a stored block (saving 5 bytes). - * This is applicable only for zip (not gzip or zlib). - * - creating new Huffman trees less frequently may not provide fast - * adaptation to changes in the input data statistics. (Take for - * example a binary file with poorly compressible code followed by - * a highly compressible string table.) Smaller buffer sizes give - * fast adaptation but have of course the overhead of transmitting - * trees more frequently. - * - I can't count above 4 - */ - - this.last_lit = 0; /* running index in l_buf */ - - this.d_buf = 0; - /* Buffer index for distances. To simplify the code, d_buf and l_buf have - * the same number of elements. To use different lengths, an extra flag - * array would be necessary. - */ - - this.opt_len = 0; /* bit length of current block with optimal trees */ - this.static_len = 0; /* bit length of current block with static trees */ - this.matches = 0; /* number of string matches in current block */ - this.insert = 0; /* bytes at end of window left to insert */ - - - this.bi_buf = 0; - /* Output buffer. bits are inserted starting at the bottom (least - * significant bits). - */ - this.bi_valid = 0; - /* Number of valid bits in bi_buf. All bits above the last valid bit - * are always zero. - */ - - // Used for window memory init. We safely ignore it for JS. That makes - // sense only for pointers and memory check tools. - //this.high_water = 0; - /* High water mark offset in window for initialized bytes -- bytes above - * this are set to zero in order to avoid memory check warnings when - * longest match routines access bytes past the input. This is then - * updated to the new high water mark. - */ -} - - -function deflateResetKeep(strm) { - var s; - - if (!strm || !strm.state) { - return err(strm, Z_STREAM_ERROR); - } - - strm.total_in = strm.total_out = 0; - strm.data_type = Z_UNKNOWN; - - s = strm.state; - s.pending = 0; - s.pending_out = 0; - - if (s.wrap < 0) { - s.wrap = -s.wrap; - /* was made negative by deflate(..., Z_FINISH); */ - } - s.status = (s.wrap ? INIT_STATE : BUSY_STATE); - strm.adler = (s.wrap === 2) ? - 0 // crc32(0, Z_NULL, 0) - : - 1; // adler32(0, Z_NULL, 0) - s.last_flush = Z_NO_FLUSH; - trees._tr_init(s); - return Z_OK; -} - - -function deflateReset(strm) { - var ret = deflateResetKeep(strm); - if (ret === Z_OK) { - lm_init(strm.state); - } - return ret; -} - - -function deflateSetHeader(strm, head) { - if (!strm || !strm.state) { return Z_STREAM_ERROR; } - if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; } - strm.state.gzhead = head; - return Z_OK; -} - - -function deflateInit2(strm, level, method, windowBits, memLevel, strategy) { - if (!strm) { // === Z_NULL - return Z_STREAM_ERROR; - } - var wrap = 1; - - if (level === Z_DEFAULT_COMPRESSION) { - level = 6; - } - - if (windowBits < 0) { /* suppress zlib wrapper */ - wrap = 0; - windowBits = -windowBits; - } - - else if (windowBits > 15) { - wrap = 2; /* write gzip wrapper instead */ - windowBits -= 16; - } - - - if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || - windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || - strategy < 0 || strategy > Z_FIXED) { - return err(strm, Z_STREAM_ERROR); - } - - - if (windowBits === 8) { - windowBits = 9; - } - /* until 256-byte window bug fixed */ - - var s = new DeflateState(); - - strm.state = s; - s.strm = strm; - - s.wrap = wrap; - s.gzhead = null; - s.w_bits = windowBits; - s.w_size = 1 << s.w_bits; - s.w_mask = s.w_size - 1; - - s.hash_bits = memLevel + 7; - s.hash_size = 1 << s.hash_bits; - s.hash_mask = s.hash_size - 1; - s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); - - s.window = new utils.Buf8(s.w_size * 2); - s.head = new utils.Buf16(s.hash_size); - s.prev = new utils.Buf16(s.w_size); - - // Don't need mem init magic for JS. - //s.high_water = 0; /* nothing written to s->window yet */ - - s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ - - s.pending_buf_size = s.lit_bufsize * 4; - - //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); - //s->pending_buf = (uchf *) overlay; - s.pending_buf = new utils.Buf8(s.pending_buf_size); - - // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`) - //s->d_buf = overlay + s->lit_bufsize/sizeof(ush); - s.d_buf = 1 * s.lit_bufsize; - - //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; - s.l_buf = (1 + 2) * s.lit_bufsize; - - s.level = level; - s.strategy = strategy; - s.method = method; - - return deflateReset(strm); -} - -function deflateInit(strm, level) { - return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); -} - - -function deflate(strm, flush) { - var old_flush, s; - var beg, val; // for gzip header write only - - if (!strm || !strm.state || - flush > Z_BLOCK || flush < 0) { - return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR; - } - - s = strm.state; - - if (!strm.output || - (!strm.input && strm.avail_in !== 0) || - (s.status === FINISH_STATE && flush !== Z_FINISH)) { - return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR); - } - - s.strm = strm; /* just in case */ - old_flush = s.last_flush; - s.last_flush = flush; - - /* Write the header */ - if (s.status === INIT_STATE) { - - if (s.wrap === 2) { // GZIP header - strm.adler = 0; //crc32(0L, Z_NULL, 0); - put_byte(s, 31); - put_byte(s, 139); - put_byte(s, 8); - if (!s.gzhead) { // s->gzhead == Z_NULL - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, s.level === 9 ? 2 : - (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? - 4 : 0)); - put_byte(s, OS_CODE); - s.status = BUSY_STATE; - } - else { - put_byte(s, (s.gzhead.text ? 1 : 0) + - (s.gzhead.hcrc ? 2 : 0) + - (!s.gzhead.extra ? 0 : 4) + - (!s.gzhead.name ? 0 : 8) + - (!s.gzhead.comment ? 0 : 16) - ); - put_byte(s, s.gzhead.time & 0xff); - put_byte(s, (s.gzhead.time >> 8) & 0xff); - put_byte(s, (s.gzhead.time >> 16) & 0xff); - put_byte(s, (s.gzhead.time >> 24) & 0xff); - put_byte(s, s.level === 9 ? 2 : - (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? - 4 : 0)); - put_byte(s, s.gzhead.os & 0xff); - if (s.gzhead.extra && s.gzhead.extra.length) { - put_byte(s, s.gzhead.extra.length & 0xff); - put_byte(s, (s.gzhead.extra.length >> 8) & 0xff); - } - if (s.gzhead.hcrc) { - strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0); - } - s.gzindex = 0; - s.status = EXTRA_STATE; - } - } - else // DEFLATE header - { - var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8; - var level_flags = -1; - - if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { - level_flags = 0; - } else if (s.level < 6) { - level_flags = 1; - } else if (s.level === 6) { - level_flags = 2; - } else { - level_flags = 3; - } - header |= (level_flags << 6); - if (s.strstart !== 0) { header |= PRESET_DICT; } - header += 31 - (header % 31); - - s.status = BUSY_STATE; - putShortMSB(s, header); - - /* Save the adler32 of the preset dictionary: */ - if (s.strstart !== 0) { - putShortMSB(s, strm.adler >>> 16); - putShortMSB(s, strm.adler & 0xffff); - } - strm.adler = 1; // adler32(0L, Z_NULL, 0); - } - } - -//#ifdef GZIP - if (s.status === EXTRA_STATE) { - if (s.gzhead.extra/* != Z_NULL*/) { - beg = s.pending; /* start of bytes to update crc */ - - while (s.gzindex < (s.gzhead.extra.length & 0xffff)) { - if (s.pending === s.pending_buf_size) { - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); - } - flush_pending(strm); - beg = s.pending; - if (s.pending === s.pending_buf_size) { - break; - } - } - put_byte(s, s.gzhead.extra[s.gzindex] & 0xff); - s.gzindex++; - } - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); - } - if (s.gzindex === s.gzhead.extra.length) { - s.gzindex = 0; - s.status = NAME_STATE; - } - } - else { - s.status = NAME_STATE; - } - } - if (s.status === NAME_STATE) { - if (s.gzhead.name/* != Z_NULL*/) { - beg = s.pending; /* start of bytes to update crc */ - //int val; - - do { - if (s.pending === s.pending_buf_size) { - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); - } - flush_pending(strm); - beg = s.pending; - if (s.pending === s.pending_buf_size) { - val = 1; - break; - } - } - // JS specific: little magic to add zero terminator to end of string - if (s.gzindex < s.gzhead.name.length) { - val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff; - } else { - val = 0; - } - put_byte(s, val); - } while (val !== 0); - - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); - } - if (val === 0) { - s.gzindex = 0; - s.status = COMMENT_STATE; - } - } - else { - s.status = COMMENT_STATE; - } - } - if (s.status === COMMENT_STATE) { - if (s.gzhead.comment/* != Z_NULL*/) { - beg = s.pending; /* start of bytes to update crc */ - //int val; - - do { - if (s.pending === s.pending_buf_size) { - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); - } - flush_pending(strm); - beg = s.pending; - if (s.pending === s.pending_buf_size) { - val = 1; - break; - } - } - // JS specific: little magic to add zero terminator to end of string - if (s.gzindex < s.gzhead.comment.length) { - val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff; - } else { - val = 0; - } - put_byte(s, val); - } while (val !== 0); - - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); - } - if (val === 0) { - s.status = HCRC_STATE; - } - } - else { - s.status = HCRC_STATE; - } - } - if (s.status === HCRC_STATE) { - if (s.gzhead.hcrc) { - if (s.pending + 2 > s.pending_buf_size) { - flush_pending(strm); - } - if (s.pending + 2 <= s.pending_buf_size) { - put_byte(s, strm.adler & 0xff); - put_byte(s, (strm.adler >> 8) & 0xff); - strm.adler = 0; //crc32(0L, Z_NULL, 0); - s.status = BUSY_STATE; - } - } - else { - s.status = BUSY_STATE; - } - } -//#endif - - /* Flush as much pending output as possible */ - if (s.pending !== 0) { - flush_pending(strm); - if (strm.avail_out === 0) { - /* Since avail_out is 0, deflate will be called again with - * more output space, but possibly with both pending and - * avail_in equal to zero. There won't be anything to do, - * but this is not an error situation so make sure we - * return OK instead of BUF_ERROR at next call of deflate: - */ - s.last_flush = -1; - return Z_OK; - } - - /* Make sure there is something to do and avoid duplicate consecutive - * flushes. For repeated and useless calls with Z_FINISH, we keep - * returning Z_STREAM_END instead of Z_BUF_ERROR. - */ - } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && - flush !== Z_FINISH) { - return err(strm, Z_BUF_ERROR); - } - - /* User must not provide more input after the first FINISH: */ - if (s.status === FINISH_STATE && strm.avail_in !== 0) { - return err(strm, Z_BUF_ERROR); - } - - /* Start a new block or continue the current one. - */ - if (strm.avail_in !== 0 || s.lookahead !== 0 || - (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) { - var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) : - (s.strategy === Z_RLE ? deflate_rle(s, flush) : - configuration_table[s.level].func(s, flush)); - - if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) { - s.status = FINISH_STATE; - } - if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) { - if (strm.avail_out === 0) { - s.last_flush = -1; - /* avoid BUF_ERROR next call, see above */ - } - return Z_OK; - /* If flush != Z_NO_FLUSH && avail_out == 0, the next call - * of deflate should use the same flush parameter to make sure - * that the flush is complete. So we don't have to output an - * empty block here, this will be done at next call. This also - * ensures that for a very small output buffer, we emit at most - * one empty block. - */ - } - if (bstate === BS_BLOCK_DONE) { - if (flush === Z_PARTIAL_FLUSH) { - trees._tr_align(s); - } - else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ - - trees._tr_stored_block(s, 0, 0, false); - /* For a full flush, this empty block will be recognized - * as a special marker by inflate_sync(). - */ - if (flush === Z_FULL_FLUSH) { - /*** CLEAR_HASH(s); ***/ /* forget history */ - zero(s.head); // Fill with NIL (= 0); - - if (s.lookahead === 0) { - s.strstart = 0; - s.block_start = 0; - s.insert = 0; - } - } - } - flush_pending(strm); - if (strm.avail_out === 0) { - s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */ - return Z_OK; - } - } - } - //Assert(strm->avail_out > 0, "bug2"); - //if (strm.avail_out <= 0) { throw new Error("bug2");} - - if (flush !== Z_FINISH) { return Z_OK; } - if (s.wrap <= 0) { return Z_STREAM_END; } - - /* Write the trailer */ - if (s.wrap === 2) { - put_byte(s, strm.adler & 0xff); - put_byte(s, (strm.adler >> 8) & 0xff); - put_byte(s, (strm.adler >> 16) & 0xff); - put_byte(s, (strm.adler >> 24) & 0xff); - put_byte(s, strm.total_in & 0xff); - put_byte(s, (strm.total_in >> 8) & 0xff); - put_byte(s, (strm.total_in >> 16) & 0xff); - put_byte(s, (strm.total_in >> 24) & 0xff); - } - else - { - putShortMSB(s, strm.adler >>> 16); - putShortMSB(s, strm.adler & 0xffff); - } - - flush_pending(strm); - /* If avail_out is zero, the application will call deflate again - * to flush the rest. - */ - if (s.wrap > 0) { s.wrap = -s.wrap; } - /* write the trailer only once! */ - return s.pending !== 0 ? Z_OK : Z_STREAM_END; -} - -function deflateEnd(strm) { - var status; - - if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { - return Z_STREAM_ERROR; - } - - status = strm.state.status; - if (status !== INIT_STATE && - status !== EXTRA_STATE && - status !== NAME_STATE && - status !== COMMENT_STATE && - status !== HCRC_STATE && - status !== BUSY_STATE && - status !== FINISH_STATE - ) { - return err(strm, Z_STREAM_ERROR); - } - - strm.state = null; - - return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; -} - - -/* ========================================================================= - * Initializes the compression dictionary from the given byte - * sequence without producing any compressed output. - */ -function deflateSetDictionary(strm, dictionary) { - var dictLength = dictionary.length; - - var s; - var str, n; - var wrap; - var avail; - var next; - var input; - var tmpDict; - - if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { - return Z_STREAM_ERROR; - } - - s = strm.state; - wrap = s.wrap; - - if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) { - return Z_STREAM_ERROR; - } - - /* when using zlib wrappers, compute Adler-32 for provided dictionary */ - if (wrap === 1) { - /* adler32(strm->adler, dictionary, dictLength); */ - strm.adler = adler32(strm.adler, dictionary, dictLength, 0); - } - - s.wrap = 0; /* avoid computing Adler-32 in read_buf */ - - /* if dictionary would fill window, just replace the history */ - if (dictLength >= s.w_size) { - if (wrap === 0) { /* already empty otherwise */ - /*** CLEAR_HASH(s); ***/ - zero(s.head); // Fill with NIL (= 0); - s.strstart = 0; - s.block_start = 0; - s.insert = 0; - } - /* use the tail */ - // dictionary = dictionary.slice(dictLength - s.w_size); - tmpDict = new utils.Buf8(s.w_size); - utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0); - dictionary = tmpDict; - dictLength = s.w_size; - } - /* insert dictionary into window and hash */ - avail = strm.avail_in; - next = strm.next_in; - input = strm.input; - strm.avail_in = dictLength; - strm.next_in = 0; - strm.input = dictionary; - fill_window(s); - while (s.lookahead >= MIN_MATCH) { - str = s.strstart; - n = s.lookahead - (MIN_MATCH - 1); - do { - /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; - - s.prev[str & s.w_mask] = s.head[s.ins_h]; - - s.head[s.ins_h] = str; - str++; - } while (--n); - s.strstart = str; - s.lookahead = MIN_MATCH - 1; - fill_window(s); - } - s.strstart += s.lookahead; - s.block_start = s.strstart; - s.insert = s.lookahead; - s.lookahead = 0; - s.match_length = s.prev_length = MIN_MATCH - 1; - s.match_available = 0; - strm.next_in = next; - strm.input = input; - strm.avail_in = avail; - s.wrap = wrap; - return Z_OK; -} - - -exports.deflateInit = deflateInit; -exports.deflateInit2 = deflateInit2; -exports.deflateReset = deflateReset; -exports.deflateResetKeep = deflateResetKeep; -exports.deflateSetHeader = deflateSetHeader; -exports.deflate = deflate; -exports.deflateEnd = deflateEnd; -exports.deflateSetDictionary = deflateSetDictionary; -exports.deflateInfo = 'pako deflate (from Nodeca project)'; - -/* Not implemented -exports.deflateBound = deflateBound; -exports.deflateCopy = deflateCopy; -exports.deflateParams = deflateParams; -exports.deflatePending = deflatePending; -exports.deflatePrime = deflatePrime; -exports.deflateTune = deflateTune; -*/ - -},{"../utils/common":3,"./adler32":5,"./crc32":7,"./messages":13,"./trees":14}],9:[function(require,module,exports){ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -function GZheader() { - /* true if compressed data believed to be text */ - this.text = 0; - /* modification time */ - this.time = 0; - /* extra flags (not used when writing a gzip file) */ - this.xflags = 0; - /* operating system */ - this.os = 0; - /* pointer to extra field or Z_NULL if none */ - this.extra = null; - /* extra field length (valid if extra != Z_NULL) */ - this.extra_len = 0; // Actually, we don't need it in JS, - // but leave for few code modifications - - // - // Setup limits is not necessary because in js we should not preallocate memory - // for inflate use constant limit in 65536 bytes - // - - /* space at extra (only when reading header) */ - // this.extra_max = 0; - /* pointer to zero-terminated file name or Z_NULL */ - this.name = ''; - /* space at name (only when reading header) */ - // this.name_max = 0; - /* pointer to zero-terminated comment or Z_NULL */ - this.comment = ''; - /* space at comment (only when reading header) */ - // this.comm_max = 0; - /* true if there was or will be a header crc */ - this.hcrc = 0; - /* true when done reading gzip header (not used when writing a gzip file) */ - this.done = false; -} - -module.exports = GZheader; - -},{}],10:[function(require,module,exports){ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -// See state defs from inflate.js -var BAD = 30; /* got a data error -- remain here until reset */ -var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ - -/* - Decode literal, length, and distance codes and write out the resulting - literal and match bytes until either not enough input or output is - available, an end-of-block is encountered, or a data error is encountered. - When large enough input and output buffers are supplied to inflate(), for - example, a 16K input buffer and a 64K output buffer, more than 95% of the - inflate execution time is spent in this routine. - - Entry assumptions: - - state.mode === LEN - strm.avail_in >= 6 - strm.avail_out >= 258 - start >= strm.avail_out - state.bits < 8 - - On return, state.mode is one of: - - LEN -- ran out of enough output space or enough available input - TYPE -- reached end of block code, inflate() to interpret next block - BAD -- error in block data - - Notes: - - - The maximum input bits used by a length/distance pair is 15 bits for the - length code, 5 bits for the length extra, 15 bits for the distance code, - and 13 bits for the distance extra. This totals 48 bits, or six bytes. - Therefore if strm.avail_in >= 6, then there is enough input to avoid - checking for available input while decoding. - - - The maximum bytes that a single length/distance pair can output is 258 - bytes, which is the maximum length that can be coded. inflate_fast() - requires strm.avail_out >= 258 for each loop to avoid checking for - output space. - */ -module.exports = function inflate_fast(strm, start) { - var state; - var _in; /* local strm.input */ - var last; /* have enough input while in < last */ - var _out; /* local strm.output */ - var beg; /* inflate()'s initial strm.output */ - var end; /* while out < end, enough space available */ -//#ifdef INFLATE_STRICT - var dmax; /* maximum distance from zlib header */ -//#endif - var wsize; /* window size or zero if not using window */ - var whave; /* valid bytes in the window */ - var wnext; /* window write index */ - // Use `s_window` instead `window`, avoid conflict with instrumentation tools - var s_window; /* allocated sliding window, if wsize != 0 */ - var hold; /* local strm.hold */ - var bits; /* local strm.bits */ - var lcode; /* local strm.lencode */ - var dcode; /* local strm.distcode */ - var lmask; /* mask for first level of length codes */ - var dmask; /* mask for first level of distance codes */ - var here; /* retrieved table entry */ - var op; /* code bits, operation, extra bits, or */ - /* window position, window bytes to copy */ - var len; /* match length, unused bytes */ - var dist; /* match distance */ - var from; /* where to copy match from */ - var from_source; - - - var input, output; // JS specific, because we have no pointers - - /* copy state to local variables */ - state = strm.state; - //here = state.here; - _in = strm.next_in; - input = strm.input; - last = _in + (strm.avail_in - 5); - _out = strm.next_out; - output = strm.output; - beg = _out - (start - strm.avail_out); - end = _out + (strm.avail_out - 257); -//#ifdef INFLATE_STRICT - dmax = state.dmax; -//#endif - wsize = state.wsize; - whave = state.whave; - wnext = state.wnext; - s_window = state.window; - hold = state.hold; - bits = state.bits; - lcode = state.lencode; - dcode = state.distcode; - lmask = (1 << state.lenbits) - 1; - dmask = (1 << state.distbits) - 1; - - - /* decode literals and length/distances until end-of-block or not enough - input data or output space */ - - top: - do { - if (bits < 15) { - hold += input[_in++] << bits; - bits += 8; - hold += input[_in++] << bits; - bits += 8; - } - - here = lcode[hold & lmask]; - - dolen: - for (;;) { // Goto emulation - op = here >>> 24/*here.bits*/; - hold >>>= op; - bits -= op; - op = (here >>> 16) & 0xff/*here.op*/; - if (op === 0) { /* literal */ - //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? - // "inflate: literal '%c'\n" : - // "inflate: literal 0x%02x\n", here.val)); - output[_out++] = here & 0xffff/*here.val*/; - } - else if (op & 16) { /* length base */ - len = here & 0xffff/*here.val*/; - op &= 15; /* number of extra bits */ - if (op) { - if (bits < op) { - hold += input[_in++] << bits; - bits += 8; - } - len += hold & ((1 << op) - 1); - hold >>>= op; - bits -= op; - } - //Tracevv((stderr, "inflate: length %u\n", len)); - if (bits < 15) { - hold += input[_in++] << bits; - bits += 8; - hold += input[_in++] << bits; - bits += 8; - } - here = dcode[hold & dmask]; - - dodist: - for (;;) { // goto emulation - op = here >>> 24/*here.bits*/; - hold >>>= op; - bits -= op; - op = (here >>> 16) & 0xff/*here.op*/; - - if (op & 16) { /* distance base */ - dist = here & 0xffff/*here.val*/; - op &= 15; /* number of extra bits */ - if (bits < op) { - hold += input[_in++] << bits; - bits += 8; - if (bits < op) { - hold += input[_in++] << bits; - bits += 8; - } - } - dist += hold & ((1 << op) - 1); -//#ifdef INFLATE_STRICT - if (dist > dmax) { - strm.msg = 'invalid distance too far back'; - state.mode = BAD; - break top; - } -//#endif - hold >>>= op; - bits -= op; - //Tracevv((stderr, "inflate: distance %u\n", dist)); - op = _out - beg; /* max distance in output */ - if (dist > op) { /* see if copy from window */ - op = dist - op; /* distance back in window */ - if (op > whave) { - if (state.sane) { - strm.msg = 'invalid distance too far back'; - state.mode = BAD; - break top; - } - -// (!) This block is disabled in zlib defaults, -// don't enable it for binary compatibility -//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR -// if (len <= op - whave) { -// do { -// output[_out++] = 0; -// } while (--len); -// continue top; -// } -// len -= op - whave; -// do { -// output[_out++] = 0; -// } while (--op > whave); -// if (op === 0) { -// from = _out - dist; -// do { -// output[_out++] = output[from++]; -// } while (--len); -// continue top; -// } -//#endif - } - from = 0; // window index - from_source = s_window; - if (wnext === 0) { /* very common case */ - from += wsize - op; - if (op < len) { /* some from window */ - len -= op; - do { - output[_out++] = s_window[from++]; - } while (--op); - from = _out - dist; /* rest from output */ - from_source = output; - } - } - else if (wnext < op) { /* wrap around window */ - from += wsize + wnext - op; - op -= wnext; - if (op < len) { /* some from end of window */ - len -= op; - do { - output[_out++] = s_window[from++]; - } while (--op); - from = 0; - if (wnext < len) { /* some from start of window */ - op = wnext; - len -= op; - do { - output[_out++] = s_window[from++]; - } while (--op); - from = _out - dist; /* rest from output */ - from_source = output; - } - } - } - else { /* contiguous in window */ - from += wnext - op; - if (op < len) { /* some from window */ - len -= op; - do { - output[_out++] = s_window[from++]; - } while (--op); - from = _out - dist; /* rest from output */ - from_source = output; - } - } - while (len > 2) { - output[_out++] = from_source[from++]; - output[_out++] = from_source[from++]; - output[_out++] = from_source[from++]; - len -= 3; - } - if (len) { - output[_out++] = from_source[from++]; - if (len > 1) { - output[_out++] = from_source[from++]; - } - } - } - else { - from = _out - dist; /* copy direct from output */ - do { /* minimum length is three */ - output[_out++] = output[from++]; - output[_out++] = output[from++]; - output[_out++] = output[from++]; - len -= 3; - } while (len > 2); - if (len) { - output[_out++] = output[from++]; - if (len > 1) { - output[_out++] = output[from++]; - } - } - } - } - else if ((op & 64) === 0) { /* 2nd level distance code */ - here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; - continue dodist; - } - else { - strm.msg = 'invalid distance code'; - state.mode = BAD; - break top; - } - - break; // need to emulate goto via "continue" - } - } - else if ((op & 64) === 0) { /* 2nd level length code */ - here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; - continue dolen; - } - else if (op & 32) { /* end-of-block */ - //Tracevv((stderr, "inflate: end of block\n")); - state.mode = TYPE; - break top; - } - else { - strm.msg = 'invalid literal/length code'; - state.mode = BAD; - break top; - } - - break; // need to emulate goto via "continue" - } - } while (_in < last && _out < end); - - /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ - len = bits >> 3; - _in -= len; - bits -= len << 3; - hold &= (1 << bits) - 1; - - /* update state and return */ - strm.next_in = _in; - strm.next_out = _out; - strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last)); - strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end)); - state.hold = hold; - state.bits = bits; - return; -}; - -},{}],11:[function(require,module,exports){ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -var utils = require('../utils/common'); -var adler32 = require('./adler32'); -var crc32 = require('./crc32'); -var inflate_fast = require('./inffast'); -var inflate_table = require('./inftrees'); - -var CODES = 0; -var LENS = 1; -var DISTS = 2; - -/* Public constants ==========================================================*/ -/* ===========================================================================*/ - - -/* Allowed flush values; see deflate() and inflate() below for details */ -//var Z_NO_FLUSH = 0; -//var Z_PARTIAL_FLUSH = 1; -//var Z_SYNC_FLUSH = 2; -//var Z_FULL_FLUSH = 3; -var Z_FINISH = 4; -var Z_BLOCK = 5; -var Z_TREES = 6; - - -/* Return codes for the compression/decompression functions. Negative values - * are errors, positive values are used for special but normal events. - */ -var Z_OK = 0; -var Z_STREAM_END = 1; -var Z_NEED_DICT = 2; -//var Z_ERRNO = -1; -var Z_STREAM_ERROR = -2; -var Z_DATA_ERROR = -3; -var Z_MEM_ERROR = -4; -var Z_BUF_ERROR = -5; -//var Z_VERSION_ERROR = -6; - -/* The deflate compression method */ -var Z_DEFLATED = 8; - - -/* STATES ====================================================================*/ -/* ===========================================================================*/ - - -var HEAD = 1; /* i: waiting for magic header */ -var FLAGS = 2; /* i: waiting for method and flags (gzip) */ -var TIME = 3; /* i: waiting for modification time (gzip) */ -var OS = 4; /* i: waiting for extra flags and operating system (gzip) */ -var EXLEN = 5; /* i: waiting for extra length (gzip) */ -var EXTRA = 6; /* i: waiting for extra bytes (gzip) */ -var NAME = 7; /* i: waiting for end of file name (gzip) */ -var COMMENT = 8; /* i: waiting for end of comment (gzip) */ -var HCRC = 9; /* i: waiting for header crc (gzip) */ -var DICTID = 10; /* i: waiting for dictionary check value */ -var DICT = 11; /* waiting for inflateSetDictionary() call */ -var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ -var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */ -var STORED = 14; /* i: waiting for stored size (length and complement) */ -var COPY_ = 15; /* i/o: same as COPY below, but only first time in */ -var COPY = 16; /* i/o: waiting for input or output to copy stored block */ -var TABLE = 17; /* i: waiting for dynamic block table lengths */ -var LENLENS = 18; /* i: waiting for code length code lengths */ -var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */ -var LEN_ = 20; /* i: same as LEN below, but only first time in */ -var LEN = 21; /* i: waiting for length/lit/eob code */ -var LENEXT = 22; /* i: waiting for length extra bits */ -var DIST = 23; /* i: waiting for distance code */ -var DISTEXT = 24; /* i: waiting for distance extra bits */ -var MATCH = 25; /* o: waiting for output space to copy string */ -var LIT = 26; /* o: waiting for output space to write literal */ -var CHECK = 27; /* i: waiting for 32-bit check value */ -var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */ -var DONE = 29; /* finished check, done -- remain here until reset */ -var BAD = 30; /* got a data error -- remain here until reset */ -var MEM = 31; /* got an inflate() memory error -- remain here until reset */ -var SYNC = 32; /* looking for synchronization bytes to restart inflate() */ - -/* ===========================================================================*/ - - - -var ENOUGH_LENS = 852; -var ENOUGH_DISTS = 592; -//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); - -var MAX_WBITS = 15; -/* 32K LZ77 window */ -var DEF_WBITS = MAX_WBITS; - - -function zswap32(q) { - return (((q >>> 24) & 0xff) + - ((q >>> 8) & 0xff00) + - ((q & 0xff00) << 8) + - ((q & 0xff) << 24)); -} - - -function InflateState() { - this.mode = 0; /* current inflate mode */ - this.last = false; /* true if processing last block */ - this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ - this.havedict = false; /* true if dictionary provided */ - this.flags = 0; /* gzip header method and flags (0 if zlib) */ - this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */ - this.check = 0; /* protected copy of check value */ - this.total = 0; /* protected copy of output count */ - // TODO: may be {} - this.head = null; /* where to save gzip header information */ - - /* sliding window */ - this.wbits = 0; /* log base 2 of requested window size */ - this.wsize = 0; /* window size or zero if not using window */ - this.whave = 0; /* valid bytes in the window */ - this.wnext = 0; /* window write index */ - this.window = null; /* allocated sliding window, if needed */ - - /* bit accumulator */ - this.hold = 0; /* input bit accumulator */ - this.bits = 0; /* number of bits in "in" */ - - /* for string and stored block copying */ - this.length = 0; /* literal or length of data to copy */ - this.offset = 0; /* distance back to copy string from */ - - /* for table and code decoding */ - this.extra = 0; /* extra bits needed */ - - /* fixed and dynamic code tables */ - this.lencode = null; /* starting table for length/literal codes */ - this.distcode = null; /* starting table for distance codes */ - this.lenbits = 0; /* index bits for lencode */ - this.distbits = 0; /* index bits for distcode */ - - /* dynamic table building */ - this.ncode = 0; /* number of code length code lengths */ - this.nlen = 0; /* number of length code lengths */ - this.ndist = 0; /* number of distance code lengths */ - this.have = 0; /* number of code lengths in lens[] */ - this.next = null; /* next available space in codes[] */ - - this.lens = new utils.Buf16(320); /* temporary storage for code lengths */ - this.work = new utils.Buf16(288); /* work area for code table building */ - - /* - because we don't have pointers in js, we use lencode and distcode directly - as buffers so we don't need codes - */ - //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */ - this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */ - this.distdyn = null; /* dynamic table for distance codes (JS specific) */ - this.sane = 0; /* if false, allow invalid distance too far */ - this.back = 0; /* bits back of last unprocessed length/lit */ - this.was = 0; /* initial length of match */ -} - -function inflateResetKeep(strm) { - var state; - - if (!strm || !strm.state) { return Z_STREAM_ERROR; } - state = strm.state; - strm.total_in = strm.total_out = state.total = 0; - strm.msg = ''; /*Z_NULL*/ - if (state.wrap) { /* to support ill-conceived Java test suite */ - strm.adler = state.wrap & 1; - } - state.mode = HEAD; - state.last = 0; - state.havedict = 0; - state.dmax = 32768; - state.head = null/*Z_NULL*/; - state.hold = 0; - state.bits = 0; - //state.lencode = state.distcode = state.next = state.codes; - state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS); - state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS); - - state.sane = 1; - state.back = -1; - //Tracev((stderr, "inflate: reset\n")); - return Z_OK; -} - -function inflateReset(strm) { - var state; - - if (!strm || !strm.state) { return Z_STREAM_ERROR; } - state = strm.state; - state.wsize = 0; - state.whave = 0; - state.wnext = 0; - return inflateResetKeep(strm); - -} - -function inflateReset2(strm, windowBits) { - var wrap; - var state; - - /* get the state */ - if (!strm || !strm.state) { return Z_STREAM_ERROR; } - state = strm.state; - - /* extract wrap request from windowBits parameter */ - if (windowBits < 0) { - wrap = 0; - windowBits = -windowBits; - } - else { - wrap = (windowBits >> 4) + 1; - if (windowBits < 48) { - windowBits &= 15; - } - } - - /* set number of window bits, free window if different */ - if (windowBits && (windowBits < 8 || windowBits > 15)) { - return Z_STREAM_ERROR; - } - if (state.window !== null && state.wbits !== windowBits) { - state.window = null; - } - - /* update state and reset the rest of it */ - state.wrap = wrap; - state.wbits = windowBits; - return inflateReset(strm); -} - -function inflateInit2(strm, windowBits) { - var ret; - var state; - - if (!strm) { return Z_STREAM_ERROR; } - //strm.msg = Z_NULL; /* in case we return an error */ - - state = new InflateState(); - - //if (state === Z_NULL) return Z_MEM_ERROR; - //Tracev((stderr, "inflate: allocated\n")); - strm.state = state; - state.window = null/*Z_NULL*/; - ret = inflateReset2(strm, windowBits); - if (ret !== Z_OK) { - strm.state = null/*Z_NULL*/; - } - return ret; -} - -function inflateInit(strm) { - return inflateInit2(strm, DEF_WBITS); -} - - -/* - Return state with length and distance decoding tables and index sizes set to - fixed code decoding. Normally this returns fixed tables from inffixed.h. - If BUILDFIXED is defined, then instead this routine builds the tables the - first time it's called, and returns those tables the first time and - thereafter. This reduces the size of the code by about 2K bytes, in - exchange for a little execution time. However, BUILDFIXED should not be - used for threaded applications, since the rewriting of the tables and virgin - may not be thread-safe. - */ -var virgin = true; - -var lenfix, distfix; // We have no pointers in JS, so keep tables separate - -function fixedtables(state) { - /* build fixed huffman tables if first call (may not be thread safe) */ - if (virgin) { - var sym; - - lenfix = new utils.Buf32(512); - distfix = new utils.Buf32(32); - - /* literal/length table */ - sym = 0; - while (sym < 144) { state.lens[sym++] = 8; } - while (sym < 256) { state.lens[sym++] = 9; } - while (sym < 280) { state.lens[sym++] = 7; } - while (sym < 288) { state.lens[sym++] = 8; } - - inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); - - /* distance table */ - sym = 0; - while (sym < 32) { state.lens[sym++] = 5; } - - inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); - - /* do this just once */ - virgin = false; - } - - state.lencode = lenfix; - state.lenbits = 9; - state.distcode = distfix; - state.distbits = 5; -} - - -/* - Update the window with the last wsize (normally 32K) bytes written before - returning. If window does not exist yet, create it. This is only called - when a window is already in use, or when output has been written during this - inflate call, but the end of the deflate stream has not been reached yet. - It is also called to create a window for dictionary data when a dictionary - is loaded. - - Providing output buffers larger than 32K to inflate() should provide a speed - advantage, since only the last 32K of output is copied to the sliding window - upon return from inflate(), and since all distances after the first 32K of - output will fall in the output data, making match copies simpler and faster. - The advantage may be dependent on the size of the processor's data caches. - */ -function updatewindow(strm, src, end, copy) { - var dist; - var state = strm.state; - - /* if it hasn't been done already, allocate space for the window */ - if (state.window === null) { - state.wsize = 1 << state.wbits; - state.wnext = 0; - state.whave = 0; - - state.window = new utils.Buf8(state.wsize); - } - - /* copy state->wsize or less output bytes into the circular window */ - if (copy >= state.wsize) { - utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0); - state.wnext = 0; - state.whave = state.wsize; - } - else { - dist = state.wsize - state.wnext; - if (dist > copy) { - dist = copy; - } - //zmemcpy(state->window + state->wnext, end - copy, dist); - utils.arraySet(state.window, src, end - copy, dist, state.wnext); - copy -= dist; - if (copy) { - //zmemcpy(state->window, end - copy, copy); - utils.arraySet(state.window, src, end - copy, copy, 0); - state.wnext = copy; - state.whave = state.wsize; - } - else { - state.wnext += dist; - if (state.wnext === state.wsize) { state.wnext = 0; } - if (state.whave < state.wsize) { state.whave += dist; } - } - } - return 0; -} - -function inflate(strm, flush) { - var state; - var input, output; // input/output buffers - var next; /* next input INDEX */ - var put; /* next output INDEX */ - var have, left; /* available input and output */ - var hold; /* bit buffer */ - var bits; /* bits in bit buffer */ - var _in, _out; /* save starting available input and output */ - var copy; /* number of stored or match bytes to copy */ - var from; /* where to copy match bytes from */ - var from_source; - var here = 0; /* current decoding table entry */ - var here_bits, here_op, here_val; // paked "here" denormalized (JS specific) - //var last; /* parent table entry */ - var last_bits, last_op, last_val; // paked "last" denormalized (JS specific) - var len; /* length to copy for repeats, bits to drop */ - var ret; /* return code */ - var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */ - var opts; - - var n; // temporary var for NEED_BITS - - var order = /* permutation of code lengths */ - [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]; - - - if (!strm || !strm.state || !strm.output || - (!strm.input && strm.avail_in !== 0)) { - return Z_STREAM_ERROR; - } - - state = strm.state; - if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */ - - - //--- LOAD() --- - put = strm.next_out; - output = strm.output; - left = strm.avail_out; - next = strm.next_in; - input = strm.input; - have = strm.avail_in; - hold = state.hold; - bits = state.bits; - //--- - - _in = have; - _out = left; - ret = Z_OK; - - inf_leave: // goto emulation - for (;;) { - switch (state.mode) { - case HEAD: - if (state.wrap === 0) { - state.mode = TYPEDO; - break; - } - //=== NEEDBITS(16); - while (bits < 16) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */ - state.check = 0/*crc32(0L, Z_NULL, 0)*/; - //=== CRC2(state.check, hold); - hbuf[0] = hold & 0xff; - hbuf[1] = (hold >>> 8) & 0xff; - state.check = crc32(state.check, hbuf, 2, 0); - //===// - - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = FLAGS; - break; - } - state.flags = 0; /* expect zlib header */ - if (state.head) { - state.head.done = false; - } - if (!(state.wrap & 1) || /* check if zlib header allowed */ - (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) { - strm.msg = 'incorrect header check'; - state.mode = BAD; - break; - } - if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) { - strm.msg = 'unknown compression method'; - state.mode = BAD; - break; - } - //--- DROPBITS(4) ---// - hold >>>= 4; - bits -= 4; - //---// - len = (hold & 0x0f)/*BITS(4)*/ + 8; - if (state.wbits === 0) { - state.wbits = len; - } - else if (len > state.wbits) { - strm.msg = 'invalid window size'; - state.mode = BAD; - break; - } - state.dmax = 1 << len; - //Tracev((stderr, "inflate: zlib header ok\n")); - strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; - state.mode = hold & 0x200 ? DICTID : TYPE; - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - break; - case FLAGS: - //=== NEEDBITS(16); */ - while (bits < 16) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - state.flags = hold; - if ((state.flags & 0xff) !== Z_DEFLATED) { - strm.msg = 'unknown compression method'; - state.mode = BAD; - break; - } - if (state.flags & 0xe000) { - strm.msg = 'unknown header flags set'; - state.mode = BAD; - break; - } - if (state.head) { - state.head.text = ((hold >> 8) & 1); - } - if (state.flags & 0x0200) { - //=== CRC2(state.check, hold); - hbuf[0] = hold & 0xff; - hbuf[1] = (hold >>> 8) & 0xff; - state.check = crc32(state.check, hbuf, 2, 0); - //===// - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = TIME; - /* falls through */ - case TIME: - //=== NEEDBITS(32); */ - while (bits < 32) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - if (state.head) { - state.head.time = hold; - } - if (state.flags & 0x0200) { - //=== CRC4(state.check, hold) - hbuf[0] = hold & 0xff; - hbuf[1] = (hold >>> 8) & 0xff; - hbuf[2] = (hold >>> 16) & 0xff; - hbuf[3] = (hold >>> 24) & 0xff; - state.check = crc32(state.check, hbuf, 4, 0); - //=== - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = OS; - /* falls through */ - case OS: - //=== NEEDBITS(16); */ - while (bits < 16) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - if (state.head) { - state.head.xflags = (hold & 0xff); - state.head.os = (hold >> 8); - } - if (state.flags & 0x0200) { - //=== CRC2(state.check, hold); - hbuf[0] = hold & 0xff; - hbuf[1] = (hold >>> 8) & 0xff; - state.check = crc32(state.check, hbuf, 2, 0); - //===// - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = EXLEN; - /* falls through */ - case EXLEN: - if (state.flags & 0x0400) { - //=== NEEDBITS(16); */ - while (bits < 16) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - state.length = hold; - if (state.head) { - state.head.extra_len = hold; - } - if (state.flags & 0x0200) { - //=== CRC2(state.check, hold); - hbuf[0] = hold & 0xff; - hbuf[1] = (hold >>> 8) & 0xff; - state.check = crc32(state.check, hbuf, 2, 0); - //===// - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - } - else if (state.head) { - state.head.extra = null/*Z_NULL*/; - } - state.mode = EXTRA; - /* falls through */ - case EXTRA: - if (state.flags & 0x0400) { - copy = state.length; - if (copy > have) { copy = have; } - if (copy) { - if (state.head) { - len = state.head.extra_len - state.length; - if (!state.head.extra) { - // Use untyped array for more convenient processing later - state.head.extra = new Array(state.head.extra_len); - } - utils.arraySet( - state.head.extra, - input, - next, - // extra field is limited to 65536 bytes - // - no need for additional size check - copy, - /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ - len - ); - //zmemcpy(state.head.extra + len, next, - // len + copy > state.head.extra_max ? - // state.head.extra_max - len : copy); - } - if (state.flags & 0x0200) { - state.check = crc32(state.check, input, copy, next); - } - have -= copy; - next += copy; - state.length -= copy; - } - if (state.length) { break inf_leave; } - } - state.length = 0; - state.mode = NAME; - /* falls through */ - case NAME: - if (state.flags & 0x0800) { - if (have === 0) { break inf_leave; } - copy = 0; - do { - // TODO: 2 or 1 bytes? - len = input[next + copy++]; - /* use constant limit because in js we should not preallocate memory */ - if (state.head && len && - (state.length < 65536 /*state.head.name_max*/)) { - state.head.name += String.fromCharCode(len); - } - } while (len && copy < have); - - if (state.flags & 0x0200) { - state.check = crc32(state.check, input, copy, next); - } - have -= copy; - next += copy; - if (len) { break inf_leave; } - } - else if (state.head) { - state.head.name = null; - } - state.length = 0; - state.mode = COMMENT; - /* falls through */ - case COMMENT: - if (state.flags & 0x1000) { - if (have === 0) { break inf_leave; } - copy = 0; - do { - len = input[next + copy++]; - /* use constant limit because in js we should not preallocate memory */ - if (state.head && len && - (state.length < 65536 /*state.head.comm_max*/)) { - state.head.comment += String.fromCharCode(len); - } - } while (len && copy < have); - if (state.flags & 0x0200) { - state.check = crc32(state.check, input, copy, next); - } - have -= copy; - next += copy; - if (len) { break inf_leave; } - } - else if (state.head) { - state.head.comment = null; - } - state.mode = HCRC; - /* falls through */ - case HCRC: - if (state.flags & 0x0200) { - //=== NEEDBITS(16); */ - while (bits < 16) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - if (hold !== (state.check & 0xffff)) { - strm.msg = 'header crc mismatch'; - state.mode = BAD; - break; - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - } - if (state.head) { - state.head.hcrc = ((state.flags >> 9) & 1); - state.head.done = true; - } - strm.adler = state.check = 0; - state.mode = TYPE; - break; - case DICTID: - //=== NEEDBITS(32); */ - while (bits < 32) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - strm.adler = state.check = zswap32(hold); - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = DICT; - /* falls through */ - case DICT: - if (state.havedict === 0) { - //--- RESTORE() --- - strm.next_out = put; - strm.avail_out = left; - strm.next_in = next; - strm.avail_in = have; - state.hold = hold; - state.bits = bits; - //--- - return Z_NEED_DICT; - } - strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; - state.mode = TYPE; - /* falls through */ - case TYPE: - if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; } - /* falls through */ - case TYPEDO: - if (state.last) { - //--- BYTEBITS() ---// - hold >>>= bits & 7; - bits -= bits & 7; - //---// - state.mode = CHECK; - break; - } - //=== NEEDBITS(3); */ - while (bits < 3) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - state.last = (hold & 0x01)/*BITS(1)*/; - //--- DROPBITS(1) ---// - hold >>>= 1; - bits -= 1; - //---// - - switch ((hold & 0x03)/*BITS(2)*/) { - case 0: /* stored block */ - //Tracev((stderr, "inflate: stored block%s\n", - // state.last ? " (last)" : "")); - state.mode = STORED; - break; - case 1: /* fixed block */ - fixedtables(state); - //Tracev((stderr, "inflate: fixed codes block%s\n", - // state.last ? " (last)" : "")); - state.mode = LEN_; /* decode codes */ - if (flush === Z_TREES) { - //--- DROPBITS(2) ---// - hold >>>= 2; - bits -= 2; - //---// - break inf_leave; - } - break; - case 2: /* dynamic block */ - //Tracev((stderr, "inflate: dynamic codes block%s\n", - // state.last ? " (last)" : "")); - state.mode = TABLE; - break; - case 3: - strm.msg = 'invalid block type'; - state.mode = BAD; - } - //--- DROPBITS(2) ---// - hold >>>= 2; - bits -= 2; - //---// - break; - case STORED: - //--- BYTEBITS() ---// /* go to byte boundary */ - hold >>>= bits & 7; - bits -= bits & 7; - //---// - //=== NEEDBITS(32); */ - while (bits < 32) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) { - strm.msg = 'invalid stored block lengths'; - state.mode = BAD; - break; - } - state.length = hold & 0xffff; - //Tracev((stderr, "inflate: stored length %u\n", - // state.length)); - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = COPY_; - if (flush === Z_TREES) { break inf_leave; } - /* falls through */ - case COPY_: - state.mode = COPY; - /* falls through */ - case COPY: - copy = state.length; - if (copy) { - if (copy > have) { copy = have; } - if (copy > left) { copy = left; } - if (copy === 0) { break inf_leave; } - //--- zmemcpy(put, next, copy); --- - utils.arraySet(output, input, next, copy, put); - //---// - have -= copy; - next += copy; - left -= copy; - put += copy; - state.length -= copy; - break; - } - //Tracev((stderr, "inflate: stored end\n")); - state.mode = TYPE; - break; - case TABLE: - //=== NEEDBITS(14); */ - while (bits < 14) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257; - //--- DROPBITS(5) ---// - hold >>>= 5; - bits -= 5; - //---// - state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1; - //--- DROPBITS(5) ---// - hold >>>= 5; - bits -= 5; - //---// - state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4; - //--- DROPBITS(4) ---// - hold >>>= 4; - bits -= 4; - //---// -//#ifndef PKZIP_BUG_WORKAROUND - if (state.nlen > 286 || state.ndist > 30) { - strm.msg = 'too many length or distance symbols'; - state.mode = BAD; - break; - } -//#endif - //Tracev((stderr, "inflate: table sizes ok\n")); - state.have = 0; - state.mode = LENLENS; - /* falls through */ - case LENLENS: - while (state.have < state.ncode) { - //=== NEEDBITS(3); - while (bits < 3) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - state.lens[order[state.have++]] = (hold & 0x07);//BITS(3); - //--- DROPBITS(3) ---// - hold >>>= 3; - bits -= 3; - //---// - } - while (state.have < 19) { - state.lens[order[state.have++]] = 0; - } - // We have separate tables & no pointers. 2 commented lines below not needed. - //state.next = state.codes; - //state.lencode = state.next; - // Switch to use dynamic table - state.lencode = state.lendyn; - state.lenbits = 7; - - opts = { bits: state.lenbits }; - ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); - state.lenbits = opts.bits; - - if (ret) { - strm.msg = 'invalid code lengths set'; - state.mode = BAD; - break; - } - //Tracev((stderr, "inflate: code lengths ok\n")); - state.have = 0; - state.mode = CODELENS; - /* falls through */ - case CODELENS: - while (state.have < state.nlen + state.ndist) { - for (;;) { - here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/ - here_bits = here >>> 24; - here_op = (here >>> 16) & 0xff; - here_val = here & 0xffff; - - if ((here_bits) <= bits) { break; } - //--- PULLBYTE() ---// - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - //---// - } - if (here_val < 16) { - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - state.lens[state.have++] = here_val; - } - else { - if (here_val === 16) { - //=== NEEDBITS(here.bits + 2); - n = here_bits + 2; - while (bits < n) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - if (state.have === 0) { - strm.msg = 'invalid bit length repeat'; - state.mode = BAD; - break; - } - len = state.lens[state.have - 1]; - copy = 3 + (hold & 0x03);//BITS(2); - //--- DROPBITS(2) ---// - hold >>>= 2; - bits -= 2; - //---// - } - else if (here_val === 17) { - //=== NEEDBITS(here.bits + 3); - n = here_bits + 3; - while (bits < n) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - len = 0; - copy = 3 + (hold & 0x07);//BITS(3); - //--- DROPBITS(3) ---// - hold >>>= 3; - bits -= 3; - //---// - } - else { - //=== NEEDBITS(here.bits + 7); - n = here_bits + 7; - while (bits < n) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - len = 0; - copy = 11 + (hold & 0x7f);//BITS(7); - //--- DROPBITS(7) ---// - hold >>>= 7; - bits -= 7; - //---// - } - if (state.have + copy > state.nlen + state.ndist) { - strm.msg = 'invalid bit length repeat'; - state.mode = BAD; - break; - } - while (copy--) { - state.lens[state.have++] = len; - } - } - } - - /* handle error breaks in while */ - if (state.mode === BAD) { break; } - - /* check for end-of-block code (better have one) */ - if (state.lens[256] === 0) { - strm.msg = 'invalid code -- missing end-of-block'; - state.mode = BAD; - break; - } - - /* build code tables -- note: do not change the lenbits or distbits - values here (9 and 6) without reading the comments in inftrees.h - concerning the ENOUGH constants, which depend on those values */ - state.lenbits = 9; - - opts = { bits: state.lenbits }; - ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); - // We have separate tables & no pointers. 2 commented lines below not needed. - // state.next_index = opts.table_index; - state.lenbits = opts.bits; - // state.lencode = state.next; - - if (ret) { - strm.msg = 'invalid literal/lengths set'; - state.mode = BAD; - break; - } - - state.distbits = 6; - //state.distcode.copy(state.codes); - // Switch to use dynamic table - state.distcode = state.distdyn; - opts = { bits: state.distbits }; - ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); - // We have separate tables & no pointers. 2 commented lines below not needed. - // state.next_index = opts.table_index; - state.distbits = opts.bits; - // state.distcode = state.next; - - if (ret) { - strm.msg = 'invalid distances set'; - state.mode = BAD; - break; - } - //Tracev((stderr, 'inflate: codes ok\n')); - state.mode = LEN_; - if (flush === Z_TREES) { break inf_leave; } - /* falls through */ - case LEN_: - state.mode = LEN; - /* falls through */ - case LEN: - if (have >= 6 && left >= 258) { - //--- RESTORE() --- - strm.next_out = put; - strm.avail_out = left; - strm.next_in = next; - strm.avail_in = have; - state.hold = hold; - state.bits = bits; - //--- - inflate_fast(strm, _out); - //--- LOAD() --- - put = strm.next_out; - output = strm.output; - left = strm.avail_out; - next = strm.next_in; - input = strm.input; - have = strm.avail_in; - hold = state.hold; - bits = state.bits; - //--- - - if (state.mode === TYPE) { - state.back = -1; - } - break; - } - state.back = 0; - for (;;) { - here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/ - here_bits = here >>> 24; - here_op = (here >>> 16) & 0xff; - here_val = here & 0xffff; - - if (here_bits <= bits) { break; } - //--- PULLBYTE() ---// - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - //---// - } - if (here_op && (here_op & 0xf0) === 0) { - last_bits = here_bits; - last_op = here_op; - last_val = here_val; - for (;;) { - here = state.lencode[last_val + - ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)]; - here_bits = here >>> 24; - here_op = (here >>> 16) & 0xff; - here_val = here & 0xffff; - - if ((last_bits + here_bits) <= bits) { break; } - //--- PULLBYTE() ---// - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - //---// - } - //--- DROPBITS(last.bits) ---// - hold >>>= last_bits; - bits -= last_bits; - //---// - state.back += last_bits; - } - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - state.back += here_bits; - state.length = here_val; - if (here_op === 0) { - //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? - // "inflate: literal '%c'\n" : - // "inflate: literal 0x%02x\n", here.val)); - state.mode = LIT; - break; - } - if (here_op & 32) { - //Tracevv((stderr, "inflate: end of block\n")); - state.back = -1; - state.mode = TYPE; - break; - } - if (here_op & 64) { - strm.msg = 'invalid literal/length code'; - state.mode = BAD; - break; - } - state.extra = here_op & 15; - state.mode = LENEXT; - /* falls through */ - case LENEXT: - if (state.extra) { - //=== NEEDBITS(state.extra); - n = state.extra; - while (bits < n) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/; - //--- DROPBITS(state.extra) ---// - hold >>>= state.extra; - bits -= state.extra; - //---// - state.back += state.extra; - } - //Tracevv((stderr, "inflate: length %u\n", state.length)); - state.was = state.length; - state.mode = DIST; - /* falls through */ - case DIST: - for (;;) { - here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/ - here_bits = here >>> 24; - here_op = (here >>> 16) & 0xff; - here_val = here & 0xffff; - - if ((here_bits) <= bits) { break; } - //--- PULLBYTE() ---// - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - //---// - } - if ((here_op & 0xf0) === 0) { - last_bits = here_bits; - last_op = here_op; - last_val = here_val; - for (;;) { - here = state.distcode[last_val + - ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)]; - here_bits = here >>> 24; - here_op = (here >>> 16) & 0xff; - here_val = here & 0xffff; - - if ((last_bits + here_bits) <= bits) { break; } - //--- PULLBYTE() ---// - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - //---// - } - //--- DROPBITS(last.bits) ---// - hold >>>= last_bits; - bits -= last_bits; - //---// - state.back += last_bits; - } - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - state.back += here_bits; - if (here_op & 64) { - strm.msg = 'invalid distance code'; - state.mode = BAD; - break; - } - state.offset = here_val; - state.extra = (here_op) & 15; - state.mode = DISTEXT; - /* falls through */ - case DISTEXT: - if (state.extra) { - //=== NEEDBITS(state.extra); - n = state.extra; - while (bits < n) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/; - //--- DROPBITS(state.extra) ---// - hold >>>= state.extra; - bits -= state.extra; - //---// - state.back += state.extra; - } -//#ifdef INFLATE_STRICT - if (state.offset > state.dmax) { - strm.msg = 'invalid distance too far back'; - state.mode = BAD; - break; - } -//#endif - //Tracevv((stderr, "inflate: distance %u\n", state.offset)); - state.mode = MATCH; - /* falls through */ - case MATCH: - if (left === 0) { break inf_leave; } - copy = _out - left; - if (state.offset > copy) { /* copy from window */ - copy = state.offset - copy; - if (copy > state.whave) { - if (state.sane) { - strm.msg = 'invalid distance too far back'; - state.mode = BAD; - break; - } -// (!) This block is disabled in zlib defaults, -// don't enable it for binary compatibility -//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR -// Trace((stderr, "inflate.c too far\n")); -// copy -= state.whave; -// if (copy > state.length) { copy = state.length; } -// if (copy > left) { copy = left; } -// left -= copy; -// state.length -= copy; -// do { -// output[put++] = 0; -// } while (--copy); -// if (state.length === 0) { state.mode = LEN; } -// break; -//#endif - } - if (copy > state.wnext) { - copy -= state.wnext; - from = state.wsize - copy; - } - else { - from = state.wnext - copy; - } - if (copy > state.length) { copy = state.length; } - from_source = state.window; - } - else { /* copy from output */ - from_source = output; - from = put - state.offset; - copy = state.length; - } - if (copy > left) { copy = left; } - left -= copy; - state.length -= copy; - do { - output[put++] = from_source[from++]; - } while (--copy); - if (state.length === 0) { state.mode = LEN; } - break; - case LIT: - if (left === 0) { break inf_leave; } - output[put++] = state.length; - left--; - state.mode = LEN; - break; - case CHECK: - if (state.wrap) { - //=== NEEDBITS(32); - while (bits < 32) { - if (have === 0) { break inf_leave; } - have--; - // Use '|' instead of '+' to make sure that result is signed - hold |= input[next++] << bits; - bits += 8; - } - //===// - _out -= left; - strm.total_out += _out; - state.total += _out; - if (_out) { - strm.adler = state.check = - /*UPDATE(state.check, put - _out, _out);*/ - (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out)); - - } - _out = left; - // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too - if ((state.flags ? hold : zswap32(hold)) !== state.check) { - strm.msg = 'incorrect data check'; - state.mode = BAD; - break; - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - //Tracev((stderr, "inflate: check matches trailer\n")); - } - state.mode = LENGTH; - /* falls through */ - case LENGTH: - if (state.wrap && state.flags) { - //=== NEEDBITS(32); - while (bits < 32) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - if (hold !== (state.total & 0xffffffff)) { - strm.msg = 'incorrect length check'; - state.mode = BAD; - break; - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - //Tracev((stderr, "inflate: length matches trailer\n")); - } - state.mode = DONE; - /* falls through */ - case DONE: - ret = Z_STREAM_END; - break inf_leave; - case BAD: - ret = Z_DATA_ERROR; - break inf_leave; - case MEM: - return Z_MEM_ERROR; - case SYNC: - /* falls through */ - default: - return Z_STREAM_ERROR; - } - } - - // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave" - - /* - Return from inflate(), updating the total counts and the check value. - If there was no progress during the inflate() call, return a buffer - error. Call updatewindow() to create and/or update the window state. - Note: a memory error from inflate() is non-recoverable. - */ - - //--- RESTORE() --- - strm.next_out = put; - strm.avail_out = left; - strm.next_in = next; - strm.avail_in = have; - state.hold = hold; - state.bits = bits; - //--- - - if (state.wsize || (_out !== strm.avail_out && state.mode < BAD && - (state.mode < CHECK || flush !== Z_FINISH))) { - if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) { - state.mode = MEM; - return Z_MEM_ERROR; - } - } - _in -= strm.avail_in; - _out -= strm.avail_out; - strm.total_in += _in; - strm.total_out += _out; - state.total += _out; - if (state.wrap && _out) { - strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ - (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out)); - } - strm.data_type = state.bits + (state.last ? 64 : 0) + - (state.mode === TYPE ? 128 : 0) + - (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); - if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) { - ret = Z_BUF_ERROR; - } - return ret; -} - -function inflateEnd(strm) { - - if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) { - return Z_STREAM_ERROR; - } - - var state = strm.state; - if (state.window) { - state.window = null; - } - strm.state = null; - return Z_OK; -} - -function inflateGetHeader(strm, head) { - var state; - - /* check state */ - if (!strm || !strm.state) { return Z_STREAM_ERROR; } - state = strm.state; - if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; } - - /* save header structure */ - state.head = head; - head.done = false; - return Z_OK; -} - -function inflateSetDictionary(strm, dictionary) { - var dictLength = dictionary.length; - - var state; - var dictid; - var ret; - - /* check state */ - if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; } - state = strm.state; - - if (state.wrap !== 0 && state.mode !== DICT) { - return Z_STREAM_ERROR; - } - - /* check for correct dictionary identifier */ - if (state.mode === DICT) { - dictid = 1; /* adler32(0, null, 0)*/ - /* dictid = adler32(dictid, dictionary, dictLength); */ - dictid = adler32(dictid, dictionary, dictLength, 0); - if (dictid !== state.check) { - return Z_DATA_ERROR; - } - } - /* copy dictionary to window using updatewindow(), which will amend the - existing dictionary if appropriate */ - ret = updatewindow(strm, dictionary, dictLength, dictLength); - if (ret) { - state.mode = MEM; - return Z_MEM_ERROR; - } - state.havedict = 1; - // Tracev((stderr, "inflate: dictionary set\n")); - return Z_OK; -} - -exports.inflateReset = inflateReset; -exports.inflateReset2 = inflateReset2; -exports.inflateResetKeep = inflateResetKeep; -exports.inflateInit = inflateInit; -exports.inflateInit2 = inflateInit2; -exports.inflate = inflate; -exports.inflateEnd = inflateEnd; -exports.inflateGetHeader = inflateGetHeader; -exports.inflateSetDictionary = inflateSetDictionary; -exports.inflateInfo = 'pako inflate (from Nodeca project)'; - -/* Not implemented -exports.inflateCopy = inflateCopy; -exports.inflateGetDictionary = inflateGetDictionary; -exports.inflateMark = inflateMark; -exports.inflatePrime = inflatePrime; -exports.inflateSync = inflateSync; -exports.inflateSyncPoint = inflateSyncPoint; -exports.inflateUndermine = inflateUndermine; -*/ - -},{"../utils/common":3,"./adler32":5,"./crc32":7,"./inffast":10,"./inftrees":12}],12:[function(require,module,exports){ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -var utils = require('../utils/common'); - -var MAXBITS = 15; -var ENOUGH_LENS = 852; -var ENOUGH_DISTS = 592; -//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); - -var CODES = 0; -var LENS = 1; -var DISTS = 2; - -var lbase = [ /* Length codes 257..285 base */ - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, - 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 -]; - -var lext = [ /* Length codes 257..285 extra */ - 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78 -]; - -var dbase = [ /* Distance codes 0..29 base */ - 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, - 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, - 8193, 12289, 16385, 24577, 0, 0 -]; - -var dext = [ /* Distance codes 0..29 extra */ - 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, - 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, - 28, 28, 29, 29, 64, 64 -]; - -module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) -{ - var bits = opts.bits; - //here = opts.here; /* table entry for duplication */ - - var len = 0; /* a code's length in bits */ - var sym = 0; /* index of code symbols */ - var min = 0, max = 0; /* minimum and maximum code lengths */ - var root = 0; /* number of index bits for root table */ - var curr = 0; /* number of index bits for current table */ - var drop = 0; /* code bits to drop for sub-table */ - var left = 0; /* number of prefix codes available */ - var used = 0; /* code entries in table used */ - var huff = 0; /* Huffman code */ - var incr; /* for incrementing code, index */ - var fill; /* index for replicating entries */ - var low; /* low bits for current root entry */ - var mask; /* mask for low root bits */ - var next; /* next available space in table */ - var base = null; /* base value table to use */ - var base_index = 0; -// var shoextra; /* extra bits table to use */ - var end; /* use base and extra for symbol > end */ - var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */ - var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */ - var extra = null; - var extra_index = 0; - - var here_bits, here_op, here_val; - - /* - Process a set of code lengths to create a canonical Huffman code. The - code lengths are lens[0..codes-1]. Each length corresponds to the - symbols 0..codes-1. The Huffman code is generated by first sorting the - symbols by length from short to long, and retaining the symbol order - for codes with equal lengths. Then the code starts with all zero bits - for the first code of the shortest length, and the codes are integer - increments for the same length, and zeros are appended as the length - increases. For the deflate format, these bits are stored backwards - from their more natural integer increment ordering, and so when the - decoding tables are built in the large loop below, the integer codes - are incremented backwards. - - This routine assumes, but does not check, that all of the entries in - lens[] are in the range 0..MAXBITS. The caller must assure this. - 1..MAXBITS is interpreted as that code length. zero means that that - symbol does not occur in this code. - - The codes are sorted by computing a count of codes for each length, - creating from that a table of starting indices for each length in the - sorted table, and then entering the symbols in order in the sorted - table. The sorted table is work[], with that space being provided by - the caller. - - The length counts are used for other purposes as well, i.e. finding - the minimum and maximum length codes, determining if there are any - codes at all, checking for a valid set of lengths, and looking ahead - at length counts to determine sub-table sizes when building the - decoding tables. - */ - - /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ - for (len = 0; len <= MAXBITS; len++) { - count[len] = 0; - } - for (sym = 0; sym < codes; sym++) { - count[lens[lens_index + sym]]++; - } - - /* bound code lengths, force root to be within code lengths */ - root = bits; - for (max = MAXBITS; max >= 1; max--) { - if (count[max] !== 0) { break; } - } - if (root > max) { - root = max; - } - if (max === 0) { /* no symbols to code at all */ - //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */ - //table.bits[opts.table_index] = 1; //here.bits = (var char)1; - //table.val[opts.table_index++] = 0; //here.val = (var short)0; - table[table_index++] = (1 << 24) | (64 << 16) | 0; - - - //table.op[opts.table_index] = 64; - //table.bits[opts.table_index] = 1; - //table.val[opts.table_index++] = 0; - table[table_index++] = (1 << 24) | (64 << 16) | 0; - - opts.bits = 1; - return 0; /* no symbols, but wait for decoding to report error */ - } - for (min = 1; min < max; min++) { - if (count[min] !== 0) { break; } - } - if (root < min) { - root = min; - } - - /* check for an over-subscribed or incomplete set of lengths */ - left = 1; - for (len = 1; len <= MAXBITS; len++) { - left <<= 1; - left -= count[len]; - if (left < 0) { - return -1; - } /* over-subscribed */ - } - if (left > 0 && (type === CODES || max !== 1)) { - return -1; /* incomplete set */ - } - - /* generate offsets into symbol table for each length for sorting */ - offs[1] = 0; - for (len = 1; len < MAXBITS; len++) { - offs[len + 1] = offs[len] + count[len]; - } - - /* sort symbols by length, by symbol order within each length */ - for (sym = 0; sym < codes; sym++) { - if (lens[lens_index + sym] !== 0) { - work[offs[lens[lens_index + sym]]++] = sym; - } - } - - /* - Create and fill in decoding tables. In this loop, the table being - filled is at next and has curr index bits. The code being used is huff - with length len. That code is converted to an index by dropping drop - bits off of the bottom. For codes where len is less than drop + curr, - those top drop + curr - len bits are incremented through all values to - fill the table with replicated entries. - - root is the number of index bits for the root table. When len exceeds - root, sub-tables are created pointed to by the root entry with an index - of the low root bits of huff. This is saved in low to check for when a - new sub-table should be started. drop is zero when the root table is - being filled, and drop is root when sub-tables are being filled. - - When a new sub-table is needed, it is necessary to look ahead in the - code lengths to determine what size sub-table is needed. The length - counts are used for this, and so count[] is decremented as codes are - entered in the tables. - - used keeps track of how many table entries have been allocated from the - provided *table space. It is checked for LENS and DIST tables against - the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in - the initial root table size constants. See the comments in inftrees.h - for more information. - - sym increments through all symbols, and the loop terminates when - all codes of length max, i.e. all codes, have been processed. This - routine permits incomplete codes, so another loop after this one fills - in the rest of the decoding tables with invalid code markers. - */ - - /* set up for code type */ - // poor man optimization - use if-else instead of switch, - // to avoid deopts in old v8 - if (type === CODES) { - base = extra = work; /* dummy value--not used */ - end = 19; - - } else if (type === LENS) { - base = lbase; - base_index -= 257; - extra = lext; - extra_index -= 257; - end = 256; - - } else { /* DISTS */ - base = dbase; - extra = dext; - end = -1; - } - - /* initialize opts for loop */ - huff = 0; /* starting code */ - sym = 0; /* starting code symbol */ - len = min; /* starting code length */ - next = table_index; /* current table to fill in */ - curr = root; /* current table index bits */ - drop = 0; /* current bits to drop from code for index */ - low = -1; /* trigger new sub-table when len > root */ - used = 1 << root; /* use root table entries */ - mask = used - 1; /* mask for comparing low */ - - /* check available table space */ - if ((type === LENS && used > ENOUGH_LENS) || - (type === DISTS && used > ENOUGH_DISTS)) { - return 1; - } - - /* process all codes and make table entries */ - for (;;) { - /* create table entry */ - here_bits = len - drop; - if (work[sym] < end) { - here_op = 0; - here_val = work[sym]; - } - else if (work[sym] > end) { - here_op = extra[extra_index + work[sym]]; - here_val = base[base_index + work[sym]]; - } - else { - here_op = 32 + 64; /* end of block */ - here_val = 0; - } - - /* replicate for those indices with low len bits equal to huff */ - incr = 1 << (len - drop); - fill = 1 << curr; - min = fill; /* save offset to next table */ - do { - fill -= incr; - table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0; - } while (fill !== 0); - - /* backwards increment the len-bit code huff */ - incr = 1 << (len - 1); - while (huff & incr) { - incr >>= 1; - } - if (incr !== 0) { - huff &= incr - 1; - huff += incr; - } else { - huff = 0; - } - - /* go to next symbol, update count, len */ - sym++; - if (--count[len] === 0) { - if (len === max) { break; } - len = lens[lens_index + work[sym]]; - } - - /* create new sub-table if needed */ - if (len > root && (huff & mask) !== low) { - /* if first time, transition to sub-tables */ - if (drop === 0) { - drop = root; - } - - /* increment past last table */ - next += min; /* here min is 1 << curr */ - - /* determine length of next table */ - curr = len - drop; - left = 1 << curr; - while (curr + drop < max) { - left -= count[curr + drop]; - if (left <= 0) { break; } - curr++; - left <<= 1; - } - - /* check for enough space */ - used += 1 << curr; - if ((type === LENS && used > ENOUGH_LENS) || - (type === DISTS && used > ENOUGH_DISTS)) { - return 1; - } - - /* point entry in root table to sub-table */ - low = huff & mask; - /*table.op[low] = curr; - table.bits[low] = root; - table.val[low] = next - opts.table_index;*/ - table[low] = (root << 24) | (curr << 16) | (next - table_index) |0; - } - } - - /* fill in remaining table entry if code is incomplete (guaranteed to have - at most one remaining entry, since if the code is incomplete, the - maximum code length that was allowed to get this far is one bit) */ - if (huff !== 0) { - //table.op[next + huff] = 64; /* invalid code marker */ - //table.bits[next + huff] = len - drop; - //table.val[next + huff] = 0; - table[next + huff] = ((len - drop) << 24) | (64 << 16) |0; - } - - /* set return parameters */ - //opts.table_index += used; - opts.bits = root; - return 0; -}; - -},{"../utils/common":3}],13:[function(require,module,exports){ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -module.exports = { - 2: 'need dictionary', /* Z_NEED_DICT 2 */ - 1: 'stream end', /* Z_STREAM_END 1 */ - 0: '', /* Z_OK 0 */ - '-1': 'file error', /* Z_ERRNO (-1) */ - '-2': 'stream error', /* Z_STREAM_ERROR (-2) */ - '-3': 'data error', /* Z_DATA_ERROR (-3) */ - '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */ - '-5': 'buffer error', /* Z_BUF_ERROR (-5) */ - '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */ -}; - -},{}],14:[function(require,module,exports){ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -var utils = require('../utils/common'); - -/* Public constants ==========================================================*/ -/* ===========================================================================*/ - - -//var Z_FILTERED = 1; -//var Z_HUFFMAN_ONLY = 2; -//var Z_RLE = 3; -var Z_FIXED = 4; -//var Z_DEFAULT_STRATEGY = 0; - -/* Possible values of the data_type field (though see inflate()) */ -var Z_BINARY = 0; -var Z_TEXT = 1; -//var Z_ASCII = 1; // = Z_TEXT -var Z_UNKNOWN = 2; - -/*============================================================================*/ - - -function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } - -// From zutil.h - -var STORED_BLOCK = 0; -var STATIC_TREES = 1; -var DYN_TREES = 2; -/* The three kinds of block type */ - -var MIN_MATCH = 3; -var MAX_MATCH = 258; -/* The minimum and maximum match lengths */ - -// From deflate.h -/* =========================================================================== - * Internal compression state. - */ - -var LENGTH_CODES = 29; -/* number of length codes, not counting the special END_BLOCK code */ - -var LITERALS = 256; -/* number of literal bytes 0..255 */ - -var L_CODES = LITERALS + 1 + LENGTH_CODES; -/* number of Literal or Length codes, including the END_BLOCK code */ - -var D_CODES = 30; -/* number of distance codes */ - -var BL_CODES = 19; -/* number of codes used to transfer the bit lengths */ - -var HEAP_SIZE = 2 * L_CODES + 1; -/* maximum heap size */ - -var MAX_BITS = 15; -/* All codes must not exceed MAX_BITS bits */ - -var Buf_size = 16; -/* size of bit buffer in bi_buf */ - - -/* =========================================================================== - * Constants - */ - -var MAX_BL_BITS = 7; -/* Bit length codes must not exceed MAX_BL_BITS bits */ - -var END_BLOCK = 256; -/* end of block literal code */ - -var REP_3_6 = 16; -/* repeat previous bit length 3-6 times (2 bits of repeat count) */ - -var REPZ_3_10 = 17; -/* repeat a zero length 3-10 times (3 bits of repeat count) */ - -var REPZ_11_138 = 18; -/* repeat a zero length 11-138 times (7 bits of repeat count) */ - -/* eslint-disable comma-spacing,array-bracket-spacing */ -var extra_lbits = /* extra bits for each length code */ - [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]; - -var extra_dbits = /* extra bits for each distance code */ - [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]; - -var extra_blbits = /* extra bits for each bit length code */ - [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]; - -var bl_order = - [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]; -/* eslint-enable comma-spacing,array-bracket-spacing */ - -/* The lengths of the bit length codes are sent in order of decreasing - * probability, to avoid transmitting the lengths for unused bit length codes. - */ - -/* =========================================================================== - * Local data. These are initialized only once. - */ - -// We pre-fill arrays with 0 to avoid uninitialized gaps - -var DIST_CODE_LEN = 512; /* see definition of array dist_code below */ - -// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1 -var static_ltree = new Array((L_CODES + 2) * 2); -zero(static_ltree); -/* The static literal tree. Since the bit lengths are imposed, there is no - * need for the L_CODES extra codes used during heap construction. However - * The codes 286 and 287 are needed to build a canonical tree (see _tr_init - * below). - */ - -var static_dtree = new Array(D_CODES * 2); -zero(static_dtree); -/* The static distance tree. (Actually a trivial tree since all codes use - * 5 bits.) - */ - -var _dist_code = new Array(DIST_CODE_LEN); -zero(_dist_code); -/* Distance codes. The first 256 values correspond to the distances - * 3 .. 258, the last 256 values correspond to the top 8 bits of - * the 15 bit distances. - */ - -var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); -zero(_length_code); -/* length code for each normalized match length (0 == MIN_MATCH) */ - -var base_length = new Array(LENGTH_CODES); -zero(base_length); -/* First normalized length for each code (0 = MIN_MATCH) */ - -var base_dist = new Array(D_CODES); -zero(base_dist); -/* First normalized distance for each code (0 = distance of 1) */ - - -function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) { - - this.static_tree = static_tree; /* static tree or NULL */ - this.extra_bits = extra_bits; /* extra bits for each code or NULL */ - this.extra_base = extra_base; /* base index for extra_bits */ - this.elems = elems; /* max number of elements in the tree */ - this.max_length = max_length; /* max bit length for the codes */ - - // show if `static_tree` has data or dummy - needed for monomorphic objects - this.has_stree = static_tree && static_tree.length; -} - - -var static_l_desc; -var static_d_desc; -var static_bl_desc; - - -function TreeDesc(dyn_tree, stat_desc) { - this.dyn_tree = dyn_tree; /* the dynamic tree */ - this.max_code = 0; /* largest code with non zero frequency */ - this.stat_desc = stat_desc; /* the corresponding static tree */ -} - - - -function d_code(dist) { - return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)]; -} - - -/* =========================================================================== - * Output a short LSB first on the stream. - * IN assertion: there is enough room in pendingBuf. - */ -function put_short(s, w) { -// put_byte(s, (uch)((w) & 0xff)); -// put_byte(s, (uch)((ush)(w) >> 8)); - s.pending_buf[s.pending++] = (w) & 0xff; - s.pending_buf[s.pending++] = (w >>> 8) & 0xff; -} - - -/* =========================================================================== - * Send a value on a given number of bits. - * IN assertion: length <= 16 and value fits in length bits. - */ -function send_bits(s, value, length) { - if (s.bi_valid > (Buf_size - length)) { - s.bi_buf |= (value << s.bi_valid) & 0xffff; - put_short(s, s.bi_buf); - s.bi_buf = value >> (Buf_size - s.bi_valid); - s.bi_valid += length - Buf_size; - } else { - s.bi_buf |= (value << s.bi_valid) & 0xffff; - s.bi_valid += length; - } -} - - -function send_code(s, c, tree) { - send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/); -} - - -/* =========================================================================== - * Reverse the first len bits of a code, using straightforward code (a faster - * method would use a table) - * IN assertion: 1 <= len <= 15 - */ -function bi_reverse(code, len) { - var res = 0; - do { - res |= code & 1; - code >>>= 1; - res <<= 1; - } while (--len > 0); - return res >>> 1; -} - - -/* =========================================================================== - * Flush the bit buffer, keeping at most 7 bits in it. - */ -function bi_flush(s) { - if (s.bi_valid === 16) { - put_short(s, s.bi_buf); - s.bi_buf = 0; - s.bi_valid = 0; - - } else if (s.bi_valid >= 8) { - s.pending_buf[s.pending++] = s.bi_buf & 0xff; - s.bi_buf >>= 8; - s.bi_valid -= 8; - } -} - - -/* =========================================================================== - * Compute the optimal bit lengths for a tree and update the total bit length - * for the current block. - * IN assertion: the fields freq and dad are set, heap[heap_max] and - * above are the tree nodes sorted by increasing frequency. - * OUT assertions: the field len is set to the optimal bit length, the - * array bl_count contains the frequencies for each bit length. - * The length opt_len is updated; static_len is also updated if stree is - * not null. - */ -function gen_bitlen(s, desc) -// deflate_state *s; -// tree_desc *desc; /* the tree descriptor */ -{ - var tree = desc.dyn_tree; - var max_code = desc.max_code; - var stree = desc.stat_desc.static_tree; - var has_stree = desc.stat_desc.has_stree; - var extra = desc.stat_desc.extra_bits; - var base = desc.stat_desc.extra_base; - var max_length = desc.stat_desc.max_length; - var h; /* heap index */ - var n, m; /* iterate over the tree elements */ - var bits; /* bit length */ - var xbits; /* extra bits */ - var f; /* frequency */ - var overflow = 0; /* number of elements with bit length too large */ - - for (bits = 0; bits <= MAX_BITS; bits++) { - s.bl_count[bits] = 0; - } - - /* In a first pass, compute the optimal bit lengths (which may - * overflow in the case of the bit length tree). - */ - tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */ - - for (h = s.heap_max + 1; h < HEAP_SIZE; h++) { - n = s.heap[h]; - bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1; - if (bits > max_length) { - bits = max_length; - overflow++; - } - tree[n * 2 + 1]/*.Len*/ = bits; - /* We overwrite tree[n].Dad which is no longer needed */ - - if (n > max_code) { continue; } /* not a leaf node */ - - s.bl_count[bits]++; - xbits = 0; - if (n >= base) { - xbits = extra[n - base]; - } - f = tree[n * 2]/*.Freq*/; - s.opt_len += f * (bits + xbits); - if (has_stree) { - s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits); - } - } - if (overflow === 0) { return; } - - // Trace((stderr,"\nbit length overflow\n")); - /* This happens for example on obj2 and pic of the Calgary corpus */ - - /* Find the first bit length which could increase: */ - do { - bits = max_length - 1; - while (s.bl_count[bits] === 0) { bits--; } - s.bl_count[bits]--; /* move one leaf down the tree */ - s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */ - s.bl_count[max_length]--; - /* The brother of the overflow item also moves one step up, - * but this does not affect bl_count[max_length] - */ - overflow -= 2; - } while (overflow > 0); - - /* Now recompute all bit lengths, scanning in increasing frequency. - * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all - * lengths instead of fixing only the wrong ones. This idea is taken - * from 'ar' written by Haruhiko Okumura.) - */ - for (bits = max_length; bits !== 0; bits--) { - n = s.bl_count[bits]; - while (n !== 0) { - m = s.heap[--h]; - if (m > max_code) { continue; } - if (tree[m * 2 + 1]/*.Len*/ !== bits) { - // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); - s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/; - tree[m * 2 + 1]/*.Len*/ = bits; - } - n--; - } - } -} - - -/* =========================================================================== - * Generate the codes for a given tree and bit counts (which need not be - * optimal). - * IN assertion: the array bl_count contains the bit length statistics for - * the given tree and the field len is set for all tree elements. - * OUT assertion: the field code is set for all tree elements of non - * zero code length. - */ -function gen_codes(tree, max_code, bl_count) -// ct_data *tree; /* the tree to decorate */ -// int max_code; /* largest code with non zero frequency */ -// ushf *bl_count; /* number of codes at each bit length */ -{ - var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */ - var code = 0; /* running code value */ - var bits; /* bit index */ - var n; /* code index */ - - /* The distribution counts are first used to generate the code values - * without bit reversal. - */ - for (bits = 1; bits <= MAX_BITS; bits++) { - next_code[bits] = code = (code + bl_count[bits - 1]) << 1; - } - /* Check that the bit counts in bl_count are consistent. The last code - * must be all ones. - */ - //Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */ - length = 0; - for (code = 0; code < LENGTH_CODES - 1; code++) { - base_length[code] = length; - for (n = 0; n < (1 << extra_lbits[code]); n++) { - _length_code[length++] = code; - } - } - //Assert (length == 256, "tr_static_init: length != 256"); - /* Note that the length 255 (match length 258) can be represented - * in two different ways: code 284 + 5 bits or code 285, so we - * overwrite length_code[255] to use the best encoding: - */ - _length_code[length - 1] = code; - - /* Initialize the mapping dist (0..32K) -> dist code (0..29) */ - dist = 0; - for (code = 0; code < 16; code++) { - base_dist[code] = dist; - for (n = 0; n < (1 << extra_dbits[code]); n++) { - _dist_code[dist++] = code; - } - } - //Assert (dist == 256, "tr_static_init: dist != 256"); - dist >>= 7; /* from now on, all distances are divided by 128 */ - for (; code < D_CODES; code++) { - base_dist[code] = dist << 7; - for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) { - _dist_code[256 + dist++] = code; - } - } - //Assert (dist == 256, "tr_static_init: 256+dist != 512"); - - /* Construct the codes of the static literal tree */ - for (bits = 0; bits <= MAX_BITS; bits++) { - bl_count[bits] = 0; - } - - n = 0; - while (n <= 143) { - static_ltree[n * 2 + 1]/*.Len*/ = 8; - n++; - bl_count[8]++; - } - while (n <= 255) { - static_ltree[n * 2 + 1]/*.Len*/ = 9; - n++; - bl_count[9]++; - } - while (n <= 279) { - static_ltree[n * 2 + 1]/*.Len*/ = 7; - n++; - bl_count[7]++; - } - while (n <= 287) { - static_ltree[n * 2 + 1]/*.Len*/ = 8; - n++; - bl_count[8]++; - } - /* Codes 286 and 287 do not exist, but we must include them in the - * tree construction to get a canonical Huffman tree (longest code - * all ones) - */ - gen_codes(static_ltree, L_CODES + 1, bl_count); - - /* The static distance tree is trivial: */ - for (n = 0; n < D_CODES; n++) { - static_dtree[n * 2 + 1]/*.Len*/ = 5; - static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5); - } - - // Now data ready and we can init static trees - static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); - static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); - static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); - - //static_init_done = true; -} - - -/* =========================================================================== - * Initialize a new block. - */ -function init_block(s) { - var n; /* iterates over tree elements */ - - /* Initialize the trees. */ - for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; } - for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; } - for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; } - - s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1; - s.opt_len = s.static_len = 0; - s.last_lit = s.matches = 0; -} - - -/* =========================================================================== - * Flush the bit buffer and align the output on a byte boundary - */ -function bi_windup(s) -{ - if (s.bi_valid > 8) { - put_short(s, s.bi_buf); - } else if (s.bi_valid > 0) { - //put_byte(s, (Byte)s->bi_buf); - s.pending_buf[s.pending++] = s.bi_buf; - } - s.bi_buf = 0; - s.bi_valid = 0; -} - -/* =========================================================================== - * Copy a stored block, storing first the length and its - * one's complement if requested. - */ -function copy_block(s, buf, len, header) -//DeflateState *s; -//charf *buf; /* the input data */ -//unsigned len; /* its length */ -//int header; /* true if block header must be written */ -{ - bi_windup(s); /* align on byte boundary */ - - if (header) { - put_short(s, len); - put_short(s, ~len); - } -// while (len--) { -// put_byte(s, *buf++); -// } - utils.arraySet(s.pending_buf, s.window, buf, len, s.pending); - s.pending += len; -} - -/* =========================================================================== - * Compares to subtrees, using the tree depth as tie breaker when - * the subtrees have equal frequency. This minimizes the worst case length. - */ -function smaller(tree, n, m, depth) { - var _n2 = n * 2; - var _m2 = m * 2; - return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ || - (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m])); -} - -/* =========================================================================== - * Restore the heap property by moving down the tree starting at node k, - * exchanging a node with the smallest of its two sons if necessary, stopping - * when the heap property is re-established (each father smaller than its - * two sons). - */ -function pqdownheap(s, tree, k) -// deflate_state *s; -// ct_data *tree; /* the tree to restore */ -// int k; /* node to move down */ -{ - var v = s.heap[k]; - var j = k << 1; /* left son of k */ - while (j <= s.heap_len) { - /* Set j to the smallest of the two sons: */ - if (j < s.heap_len && - smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) { - j++; - } - /* Exit if v is smaller than both sons */ - if (smaller(tree, v, s.heap[j], s.depth)) { break; } - - /* Exchange v with the smallest son */ - s.heap[k] = s.heap[j]; - k = j; - - /* And continue down the tree, setting j to the left son of k */ - j <<= 1; - } - s.heap[k] = v; -} - - -// inlined manually -// var SMALLEST = 1; - -/* =========================================================================== - * Send the block data compressed using the given Huffman trees - */ -function compress_block(s, ltree, dtree) -// deflate_state *s; -// const ct_data *ltree; /* literal tree */ -// const ct_data *dtree; /* distance tree */ -{ - var dist; /* distance of matched string */ - var lc; /* match length or unmatched char (if dist == 0) */ - var lx = 0; /* running index in l_buf */ - var code; /* the code to send */ - var extra; /* number of extra bits to send */ - - if (s.last_lit !== 0) { - do { - dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]); - lc = s.pending_buf[s.l_buf + lx]; - lx++; - - if (dist === 0) { - send_code(s, lc, ltree); /* send a literal byte */ - //Tracecv(isgraph(lc), (stderr," '%c' ", lc)); - } else { - /* Here, lc is the match length - MIN_MATCH */ - code = _length_code[lc]; - send_code(s, code + LITERALS + 1, ltree); /* send the length code */ - extra = extra_lbits[code]; - if (extra !== 0) { - lc -= base_length[code]; - send_bits(s, lc, extra); /* send the extra length bits */ - } - dist--; /* dist is now the match distance - 1 */ - code = d_code(dist); - //Assert (code < D_CODES, "bad d_code"); - - send_code(s, code, dtree); /* send the distance code */ - extra = extra_dbits[code]; - if (extra !== 0) { - dist -= base_dist[code]; - send_bits(s, dist, extra); /* send the extra distance bits */ - } - } /* literal or match pair ? */ - - /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ - //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx, - // "pendingBuf overflow"); - - } while (lx < s.last_lit); - } - - send_code(s, END_BLOCK, ltree); -} - - -/* =========================================================================== - * Construct one Huffman tree and assigns the code bit strings and lengths. - * Update the total bit length for the current block. - * IN assertion: the field freq is set for all tree elements. - * OUT assertions: the fields len and code are set to the optimal bit length - * and corresponding code. The length opt_len is updated; static_len is - * also updated if stree is not null. The field max_code is set. - */ -function build_tree(s, desc) -// deflate_state *s; -// tree_desc *desc; /* the tree descriptor */ -{ - var tree = desc.dyn_tree; - var stree = desc.stat_desc.static_tree; - var has_stree = desc.stat_desc.has_stree; - var elems = desc.stat_desc.elems; - var n, m; /* iterate over heap elements */ - var max_code = -1; /* largest code with non zero frequency */ - var node; /* new node being created */ - - /* Construct the initial heap, with least frequent element in - * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. - * heap[0] is not used. - */ - s.heap_len = 0; - s.heap_max = HEAP_SIZE; - - for (n = 0; n < elems; n++) { - if (tree[n * 2]/*.Freq*/ !== 0) { - s.heap[++s.heap_len] = max_code = n; - s.depth[n] = 0; - - } else { - tree[n * 2 + 1]/*.Len*/ = 0; - } - } - - /* The pkzip format requires that at least one distance code exists, - * and that at least one bit should be sent even if there is only one - * possible code. So to avoid special checks later on we force at least - * two codes of non zero frequency. - */ - while (s.heap_len < 2) { - node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0); - tree[node * 2]/*.Freq*/ = 1; - s.depth[node] = 0; - s.opt_len--; - - if (has_stree) { - s.static_len -= stree[node * 2 + 1]/*.Len*/; - } - /* node is 0 or 1 so it does not have extra bits */ - } - desc.max_code = max_code; - - /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, - * establish sub-heaps of increasing lengths: - */ - for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); } - - /* Construct the Huffman tree by repeatedly combining the least two - * frequent nodes. - */ - node = elems; /* next internal node of the tree */ - do { - //pqremove(s, tree, n); /* n = node of least frequency */ - /*** pqremove ***/ - n = s.heap[1/*SMALLEST*/]; - s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--]; - pqdownheap(s, tree, 1/*SMALLEST*/); - /***/ - - m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */ - - s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */ - s.heap[--s.heap_max] = m; - - /* Create a new node father of n and m */ - tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/; - s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1; - tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node; - - /* and insert the new node in the heap */ - s.heap[1/*SMALLEST*/] = node++; - pqdownheap(s, tree, 1/*SMALLEST*/); - - } while (s.heap_len >= 2); - - s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/]; - - /* At this point, the fields freq and dad are set. We can now - * generate the bit lengths. - */ - gen_bitlen(s, desc); - - /* The field len is now set, we can generate the bit codes */ - gen_codes(tree, max_code, s.bl_count); -} - - -/* =========================================================================== - * Scan a literal or distance tree to determine the frequencies of the codes - * in the bit length tree. - */ -function scan_tree(s, tree, max_code) -// deflate_state *s; -// ct_data *tree; /* the tree to be scanned */ -// int max_code; /* and its largest code of non zero frequency */ -{ - var n; /* iterates over all tree elements */ - var prevlen = -1; /* last emitted length */ - var curlen; /* length of current code */ - - var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */ - - var count = 0; /* repeat count of the current code */ - var max_count = 7; /* max repeat count */ - var min_count = 4; /* min repeat count */ - - if (nextlen === 0) { - max_count = 138; - min_count = 3; - } - tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */ - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; - nextlen = tree[(n + 1) * 2 + 1]/*.Len*/; - - if (++count < max_count && curlen === nextlen) { - continue; - - } else if (count < min_count) { - s.bl_tree[curlen * 2]/*.Freq*/ += count; - - } else if (curlen !== 0) { - - if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; } - s.bl_tree[REP_3_6 * 2]/*.Freq*/++; - - } else if (count <= 10) { - s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++; - - } else { - s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++; - } - - count = 0; - prevlen = curlen; - - if (nextlen === 0) { - max_count = 138; - min_count = 3; - - } else if (curlen === nextlen) { - max_count = 6; - min_count = 3; - - } else { - max_count = 7; - min_count = 4; - } - } -} - - -/* =========================================================================== - * Send a literal or distance tree in compressed form, using the codes in - * bl_tree. - */ -function send_tree(s, tree, max_code) -// deflate_state *s; -// ct_data *tree; /* the tree to be scanned */ -// int max_code; /* and its largest code of non zero frequency */ -{ - var n; /* iterates over all tree elements */ - var prevlen = -1; /* last emitted length */ - var curlen; /* length of current code */ - - var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */ - - var count = 0; /* repeat count of the current code */ - var max_count = 7; /* max repeat count */ - var min_count = 4; /* min repeat count */ - - /* tree[max_code+1].Len = -1; */ /* guard already set */ - if (nextlen === 0) { - max_count = 138; - min_count = 3; - } - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; - nextlen = tree[(n + 1) * 2 + 1]/*.Len*/; - - if (++count < max_count && curlen === nextlen) { - continue; - - } else if (count < min_count) { - do { send_code(s, curlen, s.bl_tree); } while (--count !== 0); - - } else if (curlen !== 0) { - if (curlen !== prevlen) { - send_code(s, curlen, s.bl_tree); - count--; - } - //Assert(count >= 3 && count <= 6, " 3_6?"); - send_code(s, REP_3_6, s.bl_tree); - send_bits(s, count - 3, 2); - - } else if (count <= 10) { - send_code(s, REPZ_3_10, s.bl_tree); - send_bits(s, count - 3, 3); - - } else { - send_code(s, REPZ_11_138, s.bl_tree); - send_bits(s, count - 11, 7); - } - - count = 0; - prevlen = curlen; - if (nextlen === 0) { - max_count = 138; - min_count = 3; - - } else if (curlen === nextlen) { - max_count = 6; - min_count = 3; - - } else { - max_count = 7; - min_count = 4; - } - } -} - - -/* =========================================================================== - * Construct the Huffman tree for the bit lengths and return the index in - * bl_order of the last bit length code to send. - */ -function build_bl_tree(s) { - var max_blindex; /* index of last bit length code of non zero freq */ - - /* Determine the bit length frequencies for literal and distance trees */ - scan_tree(s, s.dyn_ltree, s.l_desc.max_code); - scan_tree(s, s.dyn_dtree, s.d_desc.max_code); - - /* Build the bit length tree: */ - build_tree(s, s.bl_desc); - /* opt_len now includes the length of the tree representations, except - * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. - */ - - /* Determine the number of bit length codes to send. The pkzip format - * requires that at least 4 bit length codes be sent. (appnote.txt says - * 3 but the actual value used is 4.) - */ - for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { - if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) { - break; - } - } - /* Update opt_len to include the bit length tree and counts */ - s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; - //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", - // s->opt_len, s->static_len)); - - return max_blindex; -} - - -/* =========================================================================== - * Send the header for a block using dynamic Huffman trees: the counts, the - * lengths of the bit length codes, the literal tree and the distance tree. - * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. - */ -function send_all_trees(s, lcodes, dcodes, blcodes) -// deflate_state *s; -// int lcodes, dcodes, blcodes; /* number of codes for each tree */ -{ - var rank; /* index in bl_order */ - - //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); - //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, - // "too many codes"); - //Tracev((stderr, "\nbl counts: ")); - send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */ - send_bits(s, dcodes - 1, 5); - send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */ - for (rank = 0; rank < blcodes; rank++) { - //Tracev((stderr, "\nbl code %2d ", bl_order[rank])); - send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3); - } - //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); - - send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */ - //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); - - send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */ - //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); -} - - -/* =========================================================================== - * Check if the data type is TEXT or BINARY, using the following algorithm: - * - TEXT if the two conditions below are satisfied: - * a) There are no non-portable control characters belonging to the - * "black list" (0..6, 14..25, 28..31). - * b) There is at least one printable character belonging to the - * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). - * - BINARY otherwise. - * - The following partially-portable control characters form a - * "gray list" that is ignored in this detection algorithm: - * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). - * IN assertion: the fields Freq of dyn_ltree are set. - */ -function detect_data_type(s) { - /* black_mask is the bit mask of black-listed bytes - * set bits 0..6, 14..25, and 28..31 - * 0xf3ffc07f = binary 11110011111111111100000001111111 - */ - var black_mask = 0xf3ffc07f; - var n; - - /* Check for non-textual ("black-listed") bytes. */ - for (n = 0; n <= 31; n++, black_mask >>>= 1) { - if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) { - return Z_BINARY; - } - } - - /* Check for textual ("white-listed") bytes. */ - if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 || - s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) { - return Z_TEXT; - } - for (n = 32; n < LITERALS; n++) { - if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) { - return Z_TEXT; - } - } - - /* There are no "black-listed" or "white-listed" bytes: - * this stream either is empty or has tolerated ("gray-listed") bytes only. - */ - return Z_BINARY; -} - - -var static_init_done = false; - -/* =========================================================================== - * Initialize the tree data structures for a new zlib stream. - */ -function _tr_init(s) -{ - - if (!static_init_done) { - tr_static_init(); - static_init_done = true; - } - - s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc); - s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc); - s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc); - - s.bi_buf = 0; - s.bi_valid = 0; - - /* Initialize the first block of the first file: */ - init_block(s); -} - - -/* =========================================================================== - * Send a stored block - */ -function _tr_stored_block(s, buf, stored_len, last) -//DeflateState *s; -//charf *buf; /* input block */ -//ulg stored_len; /* length of input block */ -//int last; /* one if this is the last block for a file */ -{ - send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */ - copy_block(s, buf, stored_len, true); /* with header */ -} - - -/* =========================================================================== - * Send one empty static block to give enough lookahead for inflate. - * This takes 10 bits, of which 7 may remain in the bit buffer. - */ -function _tr_align(s) { - send_bits(s, STATIC_TREES << 1, 3); - send_code(s, END_BLOCK, static_ltree); - bi_flush(s); -} - - -/* =========================================================================== - * Determine the best encoding for the current block: dynamic trees, static - * trees or store, and output the encoded block to the zip file. - */ -function _tr_flush_block(s, buf, stored_len, last) -//DeflateState *s; -//charf *buf; /* input block, or NULL if too old */ -//ulg stored_len; /* length of input block */ -//int last; /* one if this is the last block for a file */ -{ - var opt_lenb, static_lenb; /* opt_len and static_len in bytes */ - var max_blindex = 0; /* index of last bit length code of non zero freq */ - - /* Build the Huffman trees unless a stored block is forced */ - if (s.level > 0) { - - /* Check if the file is binary or text */ - if (s.strm.data_type === Z_UNKNOWN) { - s.strm.data_type = detect_data_type(s); - } - - /* Construct the literal and distance trees */ - build_tree(s, s.l_desc); - // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len, - // s->static_len)); - - build_tree(s, s.d_desc); - // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len, - // s->static_len)); - /* At this point, opt_len and static_len are the total bit lengths of - * the compressed block data, excluding the tree representations. - */ - - /* Build the bit length tree for the above two trees, and get the index - * in bl_order of the last bit length code to send. - */ - max_blindex = build_bl_tree(s); - - /* Determine the best encoding. Compute the block lengths in bytes. */ - opt_lenb = (s.opt_len + 3 + 7) >>> 3; - static_lenb = (s.static_len + 3 + 7) >>> 3; - - // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", - // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, - // s->last_lit)); - - if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; } - - } else { - // Assert(buf != (char*)0, "lost buf"); - opt_lenb = static_lenb = stored_len + 5; /* force a stored block */ - } - - if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) { - /* 4: two words for the lengths */ - - /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. - * Otherwise we can't have processed more than WSIZE input bytes since - * the last block flush, because compression would have been - * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to - * transform a block into a stored block. - */ - _tr_stored_block(s, buf, stored_len, last); - - } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { - - send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3); - compress_block(s, static_ltree, static_dtree); - - } else { - send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3); - send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1); - compress_block(s, s.dyn_ltree, s.dyn_dtree); - } - // Assert (s->compressed_len == s->bits_sent, "bad compressed size"); - /* The above check is made mod 2^32, for files larger than 512 MB - * and uLong implemented on 32 bits. - */ - init_block(s); - - if (last) { - bi_windup(s); - } - // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, - // s->compressed_len-7*last)); -} - -/* =========================================================================== - * Save the match info and tally the frequency counts. Return true if - * the current block must be flushed. - */ -function _tr_tally(s, dist, lc) -// deflate_state *s; -// unsigned dist; /* distance of matched string */ -// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ -{ - //var out_length, in_length, dcode; - - s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff; - s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff; - - s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff; - s.last_lit++; - - if (dist === 0) { - /* lc is the unmatched char */ - s.dyn_ltree[lc * 2]/*.Freq*/++; - } else { - s.matches++; - /* Here, lc is the match length - MIN_MATCH */ - dist--; /* dist = match distance - 1 */ - //Assert((ush)dist < (ush)MAX_DIST(s) && - // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && - // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); - - s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++; - s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++; - } - -// (!) This block is disabled in zlib defaults, -// don't enable it for binary compatibility - -//#ifdef TRUNCATE_BLOCK -// /* Try to guess if it is profitable to stop the current block here */ -// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) { -// /* Compute an upper bound for the compressed length */ -// out_length = s.last_lit*8; -// in_length = s.strstart - s.block_start; -// -// for (dcode = 0; dcode < D_CODES; dcode++) { -// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]); -// } -// out_length >>>= 3; -// //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", -// // s->last_lit, in_length, out_length, -// // 100L - out_length*100L/in_length)); -// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) { -// return true; -// } -// } -//#endif - - return (s.last_lit === s.lit_bufsize - 1); - /* We avoid equality with lit_bufsize because of wraparound at 64K - * on 16 bit machines and because stored blocks are restricted to - * 64K-1 bytes. - */ -} - -exports._tr_init = _tr_init; -exports._tr_stored_block = _tr_stored_block; -exports._tr_flush_block = _tr_flush_block; -exports._tr_tally = _tr_tally; -exports._tr_align = _tr_align; - -},{"../utils/common":3}],15:[function(require,module,exports){ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -function ZStream() { - /* next input byte */ - this.input = null; // JS specific, because we have no pointers - this.next_in = 0; - /* number of bytes available at input */ - this.avail_in = 0; - /* total number of input bytes read so far */ - this.total_in = 0; - /* next output byte should be put there */ - this.output = null; // JS specific, because we have no pointers - this.next_out = 0; - /* remaining free space at output */ - this.avail_out = 0; - /* total number of bytes output so far */ - this.total_out = 0; - /* last error message, NULL if no error */ - this.msg = ''/*Z_NULL*/; - /* not visible by applications */ - this.state = null; - /* best guess about the data type: binary or text */ - this.data_type = 2/*Z_UNKNOWN*/; - /* adler32 value of the uncompressed data */ - this.adler = 0; -} - -module.exports = ZStream; - -},{}],"/":[function(require,module,exports){ -// Top level file is just a mixin of submodules & constants -'use strict'; - -var assign = require('./lib/utils/common').assign; - -var deflate = require('./lib/deflate'); -var inflate = require('./lib/inflate'); -var constants = require('./lib/zlib/constants'); - -var pako = {}; - -assign(pako, deflate, inflate, constants); - -module.exports = pako; - -},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/") -}); \ No newline at end of file diff --git a/node_modules/pako/dist/pako.min.js b/node_modules/pako/dist/pako.min.js deleted file mode 100644 index 73024f7a6..000000000 --- a/node_modules/pako/dist/pako.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).pako=t()}}(function(){return function t(e,a,i){function n(s,o){if(!a[s]){if(!e[s]){var l="function"==typeof require&&require;if(!o&&l)return l(s,!0);if(r)return r(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var d=a[s]={exports:{}};e[s][0].call(d.exports,function(t){var a=e[s][1][t];return n(a||t)},d,d.exports,t,e,a,i)}return a[s].exports}for(var r="function"==typeof require&&require,s=0;s0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var a=r.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==f)throw new Error(l[a]);if(e.header&&r.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(n="string"==typeof e.dictionary?o.string2buf(e.dictionary):"[object ArrayBuffer]"===d.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(a=r.deflateSetDictionary(this.strm,n))!==f)throw new Error(l[a]);this._dict_set=!0}}function n(t,e){var a=new i(e);if(a.push(t,!0),a.err)throw a.msg||l[a.err];return a.result}var r=t("./zlib/deflate"),s=t("./utils/common"),o=t("./utils/strings"),l=t("./zlib/messages"),h=t("./zlib/zstream"),d=Object.prototype.toString,f=0,_=-1,u=0,c=8;i.prototype.push=function(t,e){var a,i,n=this.strm,l=this.options.chunkSize;if(this.ended)return!1;i=e===~~e?e:!0===e?4:0,"string"==typeof t?n.input=o.string2buf(t):"[object ArrayBuffer]"===d.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;do{if(0===n.avail_out&&(n.output=new s.Buf8(l),n.next_out=0,n.avail_out=l),1!==(a=r.deflate(n,i))&&a!==f)return this.onEnd(a),this.ended=!0,!1;0!==n.avail_out&&(0!==n.avail_in||4!==i&&2!==i)||("string"===this.options.to?this.onData(o.buf2binstring(s.shrinkBuf(n.output,n.next_out))):this.onData(s.shrinkBuf(n.output,n.next_out)))}while((n.avail_in>0||0===n.avail_out)&&1!==a);return 4===i?(a=r.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===f):2!==i||(this.onEnd(f),n.avail_out=0,!0)},i.prototype.onData=function(t){this.chunks.push(t)},i.prototype.onEnd=function(t){t===f&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},a.Deflate=i,a.deflate=n,a.deflateRaw=function(t,e){return e=e||{},e.raw=!0,n(t,e)},a.gzip=function(t,e){return e=e||{},e.gzip=!0,n(t,e)}},{"./utils/common":3,"./utils/strings":4,"./zlib/deflate":8,"./zlib/messages":13,"./zlib/zstream":15}],2:[function(t,e,a){"use strict";function i(t){if(!(this instanceof i))return new i(t);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var a=r.inflateInit2(this.strm,e.windowBits);if(a!==l.Z_OK)throw new Error(h[a]);this.header=new f,r.inflateGetHeader(this.strm,this.header)}function n(t,e){var a=new i(e);if(a.push(t,!0),a.err)throw a.msg||h[a.err];return a.result}var r=t("./zlib/inflate"),s=t("./utils/common"),o=t("./utils/strings"),l=t("./zlib/constants"),h=t("./zlib/messages"),d=t("./zlib/zstream"),f=t("./zlib/gzheader"),_=Object.prototype.toString;i.prototype.push=function(t,e){var a,i,n,h,d,f,u=this.strm,c=this.options.chunkSize,b=this.options.dictionary,g=!1;if(this.ended)return!1;i=e===~~e?e:!0===e?l.Z_FINISH:l.Z_NO_FLUSH,"string"==typeof t?u.input=o.binstring2buf(t):"[object ArrayBuffer]"===_.call(t)?u.input=new Uint8Array(t):u.input=t,u.next_in=0,u.avail_in=u.input.length;do{if(0===u.avail_out&&(u.output=new s.Buf8(c),u.next_out=0,u.avail_out=c),(a=r.inflate(u,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&b&&(f="string"==typeof b?o.string2buf(b):"[object ArrayBuffer]"===_.call(b)?new Uint8Array(b):b,a=r.inflateSetDictionary(this.strm,f)),a===l.Z_BUF_ERROR&&!0===g&&(a=l.Z_OK,g=!1),a!==l.Z_STREAM_END&&a!==l.Z_OK)return this.onEnd(a),this.ended=!0,!1;u.next_out&&(0!==u.avail_out&&a!==l.Z_STREAM_END&&(0!==u.avail_in||i!==l.Z_FINISH&&i!==l.Z_SYNC_FLUSH)||("string"===this.options.to?(n=o.utf8border(u.output,u.next_out),h=u.next_out-n,d=o.buf2string(u.output,n),u.next_out=h,u.avail_out=c-h,h&&s.arraySet(u.output,u.output,n,h,0),this.onData(d)):this.onData(s.shrinkBuf(u.output,u.next_out)))),0===u.avail_in&&0===u.avail_out&&(g=!0)}while((u.avail_in>0||0===u.avail_out)&&a!==l.Z_STREAM_END);return a===l.Z_STREAM_END&&(i=l.Z_FINISH),i===l.Z_FINISH?(a=r.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===l.Z_OK):i!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),u.avail_out=0,!0)},i.prototype.onData=function(t){this.chunks.push(t)},i.prototype.onEnd=function(t){t===l.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},a.Inflate=i,a.inflate=n,a.inflateRaw=function(t,e){return e=e||{},e.raw=!0,n(t,e)},a.ungzip=n},{"./utils/common":3,"./utils/strings":4,"./zlib/constants":6,"./zlib/gzheader":9,"./zlib/inflate":11,"./zlib/messages":13,"./zlib/zstream":15}],3:[function(t,e,a){"use strict";function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;a.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(var n in a)i(a,n)&&(t[n]=a[n])}}return t},a.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var r={arraySet:function(t,e,a,i,n){if(e.subarray&&t.subarray)t.set(e.subarray(a,a+i),n);else for(var r=0;r=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1;o[254]=o[254]=1,a.string2buf=function(t){var e,a,i,r,s,o=t.length,l=0;for(r=0;r>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},a.buf2binstring=function(t){return i(t,t.length)},a.binstring2buf=function(t){for(var e=new n.Buf8(t.length),a=0,i=e.length;a4)h[n++]=65533,a+=s-1;else{for(r&=2===s?31:3===s?15:7;s>1&&a1?h[n++]=65533:r<65536?h[n++]=r:(r-=65536,h[n++]=55296|r>>10&1023,h[n++]=56320|1023&r)}return i(h,n)},a.utf8border=function(t,e){var a;for((e=e||t.length)>t.length&&(e=t.length),a=e-1;a>=0&&128==(192&t[a]);)a--;return a<0?e:0===a?e:a+o[t[a]]>e?a:e}},{"./common":3}],5:[function(t,e,a){"use strict";e.exports=function(t,e,a,i){for(var n=65535&t|0,r=t>>>16&65535|0,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{r=r+(n=n+e[i++]|0)|0}while(--s);n%=65521,r%=65521}return n|r<<16|0}},{}],6:[function(t,e,a){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],7:[function(t,e,a){"use strict";var i=function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}();e.exports=function(t,e,a,n){var r=i,s=n+a;t^=-1;for(var o=n;o>>8^r[255&(t^e[o])];return-1^t}},{}],8:[function(t,e,a){"use strict";function i(t,e){return t.msg=A[e],e}function n(t){return(t<<1)-(t>4?9:0)}function r(t){for(var e=t.length;--e>=0;)t[e]=0}function s(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(z.arraySet(t.output,e.pending_buf,e.pending_out,a,t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))}function o(t,e){B._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,s(t.strm)}function l(t,e){t.pending_buf[t.pending++]=e}function h(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function d(t,e,a,i){var n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,z.arraySet(e,t.input,t.next_in,n,a),1===t.state.wrap?t.adler=S(t.adler,e,n,a):2===t.state.wrap&&(t.adler=E(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)}function f(t,e){var a,i,n=t.max_chain_length,r=t.strstart,s=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-it?t.strstart-(t.w_size-it):0,h=t.window,d=t.w_mask,f=t.prev,_=t.strstart+at,u=h[r+s-1],c=h[r+s];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(a=e,h[a+s]===c&&h[a+s-1]===u&&h[a]===h[r]&&h[++a]===h[r+1]){r+=2,a++;do{}while(h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&r<_);if(i=at-(_-r),r=_-at,i>s){if(t.match_start=e,s=i,i>=o)break;u=h[r+s-1],c=h[r+s]}}}while((e=f[e&d])>l&&0!=--n);return s<=t.lookahead?s:t.lookahead}function _(t){var e,a,i,n,r,s=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-it)){z.arraySet(t.window,t.window,s,s,0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{i=t.head[--e],t.head[e]=i>=s?i-s:0}while(--a);e=a=s;do{i=t.prev[--e],t.prev[e]=i>=s?i-s:0}while(--a);n+=s}if(0===t.strm.avail_in)break;if(a=d(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=a,t.lookahead+t.insert>=et)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=(t.ins_h<=et&&(t.ins_h=(t.ins_h<=et)if(i=B._tr_tally(t,t.strstart-t.match_start,t.match_length-et),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=et){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<=et&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=et-1)),t.prev_length>=et&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-et,i=B._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-et),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=(t.ins_h<=et&&t.strstart>0&&(n=t.strstart-1,(i=s[n])===s[++n]&&i===s[++n]&&i===s[++n])){r=t.strstart+at;do{}while(i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=et?(a=B._tr_tally(t,1,t.match_length-et),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=B._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(o(t,!1),0===t.strm.avail_out))return _t}return t.insert=0,e===N?(o(t,!0),0===t.strm.avail_out?ct:bt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?_t:ut}function g(t,e){for(var a;;){if(0===t.lookahead&&(_(t),0===t.lookahead)){if(e===Z)return _t;break}if(t.match_length=0,a=B._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(o(t,!1),0===t.strm.avail_out))return _t}return t.insert=0,e===N?(o(t,!0),0===t.strm.avail_out?ct:bt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?_t:ut}function m(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}function w(t){t.window_size=2*t.w_size,r(t.head),t.max_lazy_match=x[t.level].max_lazy,t.good_match=x[t.level].good_length,t.nice_match=x[t.level].nice_length,t.max_chain_length=x[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=et-1,t.match_available=0,t.ins_h=0}function p(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=q,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new z.Buf16(2*$),this.dyn_dtree=new z.Buf16(2*(2*Q+1)),this.bl_tree=new z.Buf16(2*(2*V+1)),r(this.dyn_ltree),r(this.dyn_dtree),r(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new z.Buf16(tt+1),this.heap=new z.Buf16(2*J+1),r(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new z.Buf16(2*J+1),r(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function v(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=Y,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?rt:dt,t.adler=2===e.wrap?0:1,e.last_flush=Z,B._tr_init(e),D):i(t,U)}function k(t){var e=v(t);return e===D&&w(t.state),e}function y(t,e,a,n,r,s){if(!t)return U;var o=1;if(e===L&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),r<1||r>G||a!==q||n<8||n>15||e<0||e>9||s<0||s>M)return i(t,U);8===n&&(n=9);var l=new p;return t.state=l,l.strm=t,l.wrap=o,l.gzhead=null,l.w_bits=n,l.w_size=1<t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(_(t),0===t.lookahead&&e===Z)return _t;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+a;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,o(t,!1),0===t.strm.avail_out))return _t;if(t.strstart-t.block_start>=t.w_size-it&&(o(t,!1),0===t.strm.avail_out))return _t}return t.insert=0,e===N?(o(t,!0),0===t.strm.avail_out?ct:bt):(t.strstart>t.block_start&&(o(t,!1),t.strm.avail_out),_t)}),new m(4,4,8,4,u),new m(4,5,16,8,u),new m(4,6,32,32,u),new m(4,4,16,16,c),new m(8,16,32,32,c),new m(8,16,128,128,c),new m(8,32,128,256,c),new m(32,128,258,1024,c),new m(32,258,258,4096,c)],a.deflateInit=function(t,e){return y(t,e,q,X,W,P)},a.deflateInit2=y,a.deflateReset=k,a.deflateResetKeep=v,a.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?U:(t.state.gzhead=e,D):U},a.deflate=function(t,e){var a,o,d,f;if(!t||!t.state||e>O||e<0)return t?i(t,U):U;if(o=t.state,!t.output||!t.input&&0!==t.avail_in||o.status===ft&&e!==N)return i(t,0===t.avail_out?F:U);if(o.strm=t,a=o.last_flush,o.last_flush=e,o.status===rt)if(2===o.wrap)t.adler=0,l(o,31),l(o,139),l(o,8),o.gzhead?(l(o,(o.gzhead.text?1:0)+(o.gzhead.hcrc?2:0)+(o.gzhead.extra?4:0)+(o.gzhead.name?8:0)+(o.gzhead.comment?16:0)),l(o,255&o.gzhead.time),l(o,o.gzhead.time>>8&255),l(o,o.gzhead.time>>16&255),l(o,o.gzhead.time>>24&255),l(o,9===o.level?2:o.strategy>=j||o.level<2?4:0),l(o,255&o.gzhead.os),o.gzhead.extra&&o.gzhead.extra.length&&(l(o,255&o.gzhead.extra.length),l(o,o.gzhead.extra.length>>8&255)),o.gzhead.hcrc&&(t.adler=E(t.adler,o.pending_buf,o.pending,0)),o.gzindex=0,o.status=st):(l(o,0),l(o,0),l(o,0),l(o,0),l(o,0),l(o,9===o.level?2:o.strategy>=j||o.level<2?4:0),l(o,gt),o.status=dt);else{var _=q+(o.w_bits-8<<4)<<8;_|=(o.strategy>=j||o.level<2?0:o.level<6?1:6===o.level?2:3)<<6,0!==o.strstart&&(_|=nt),_+=31-_%31,o.status=dt,h(o,_),0!==o.strstart&&(h(o,t.adler>>>16),h(o,65535&t.adler)),t.adler=1}if(o.status===st)if(o.gzhead.extra){for(d=o.pending;o.gzindex<(65535&o.gzhead.extra.length)&&(o.pending!==o.pending_buf_size||(o.gzhead.hcrc&&o.pending>d&&(t.adler=E(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending!==o.pending_buf_size));)l(o,255&o.gzhead.extra[o.gzindex]),o.gzindex++;o.gzhead.hcrc&&o.pending>d&&(t.adler=E(t.adler,o.pending_buf,o.pending-d,d)),o.gzindex===o.gzhead.extra.length&&(o.gzindex=0,o.status=ot)}else o.status=ot;if(o.status===ot)if(o.gzhead.name){d=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>d&&(t.adler=E(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending===o.pending_buf_size)){f=1;break}f=o.gzindexd&&(t.adler=E(t.adler,o.pending_buf,o.pending-d,d)),0===f&&(o.gzindex=0,o.status=lt)}else o.status=lt;if(o.status===lt)if(o.gzhead.comment){d=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>d&&(t.adler=E(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending===o.pending_buf_size)){f=1;break}f=o.gzindexd&&(t.adler=E(t.adler,o.pending_buf,o.pending-d,d)),0===f&&(o.status=ht)}else o.status=ht;if(o.status===ht&&(o.gzhead.hcrc?(o.pending+2>o.pending_buf_size&&s(t),o.pending+2<=o.pending_buf_size&&(l(o,255&t.adler),l(o,t.adler>>8&255),t.adler=0,o.status=dt)):o.status=dt),0!==o.pending){if(s(t),0===t.avail_out)return o.last_flush=-1,D}else if(0===t.avail_in&&n(e)<=n(a)&&e!==N)return i(t,F);if(o.status===ft&&0!==t.avail_in)return i(t,F);if(0!==t.avail_in||0!==o.lookahead||e!==Z&&o.status!==ft){var u=o.strategy===j?g(o,e):o.strategy===K?b(o,e):x[o.level].func(o,e);if(u!==ct&&u!==bt||(o.status=ft),u===_t||u===ct)return 0===t.avail_out&&(o.last_flush=-1),D;if(u===ut&&(e===R?B._tr_align(o):e!==O&&(B._tr_stored_block(o,0,0,!1),e===C&&(r(o.head),0===o.lookahead&&(o.strstart=0,o.block_start=0,o.insert=0))),s(t),0===t.avail_out))return o.last_flush=-1,D}return e!==N?D:o.wrap<=0?I:(2===o.wrap?(l(o,255&t.adler),l(o,t.adler>>8&255),l(o,t.adler>>16&255),l(o,t.adler>>24&255),l(o,255&t.total_in),l(o,t.total_in>>8&255),l(o,t.total_in>>16&255),l(o,t.total_in>>24&255)):(h(o,t.adler>>>16),h(o,65535&t.adler)),s(t),o.wrap>0&&(o.wrap=-o.wrap),0!==o.pending?D:I)},a.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==rt&&e!==st&&e!==ot&&e!==lt&&e!==ht&&e!==dt&&e!==ft?i(t,U):(t.state=null,e===dt?i(t,T):D):U},a.deflateSetDictionary=function(t,e){var a,i,n,s,o,l,h,d,f=e.length;if(!t||!t.state)return U;if(a=t.state,2===(s=a.wrap)||1===s&&a.status!==rt||a.lookahead)return U;for(1===s&&(t.adler=S(t.adler,e,f,0)),a.wrap=0,f>=a.w_size&&(0===s&&(r(a.head),a.strstart=0,a.block_start=0,a.insert=0),d=new z.Buf8(a.w_size),z.arraySet(d,e,f-a.w_size,a.w_size,0),e=d,f=a.w_size),o=t.avail_in,l=t.next_in,h=t.input,t.avail_in=f,t.next_in=0,t.input=e,_(a);a.lookahead>=et;){i=a.strstart,n=a.lookahead-(et-1);do{a.ins_h=(a.ins_h<>>24,u>>>=v,c-=v,0===(v=p>>>16&255))S[r++]=65535&p;else{if(!(16&v)){if(0==(64&v)){p=b[(65535&p)+(u&(1<>>=v,c-=v),c<15&&(u+=B[i++]<>>24,u>>>=v,c-=v,!(16&(v=p>>>16&255))){if(0==(64&v)){p=g[(65535&p)+(u&(1<l){t.msg="invalid distance too far back",a.mode=30;break t}if(u>>>=v,c-=v,v=r-s,y>v){if((v=y-v)>d&&a.sane){t.msg="invalid distance too far back",a.mode=30;break t}if(x=0,z=_,0===f){if(x+=h-v,v2;)S[r++]=z[x++],S[r++]=z[x++],S[r++]=z[x++],k-=3;k&&(S[r++]=z[x++],k>1&&(S[r++]=z[x++]))}else{x=r-y;do{S[r++]=S[x++],S[r++]=S[x++],S[r++]=S[x++],k-=3}while(k>2);k&&(S[r++]=S[x++],k>1&&(S[r++]=S[x++]))}break}}break}}while(i>3,u&=(1<<(c-=k<<3))-1,t.next_in=i,t.next_out=r,t.avail_in=i>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function n(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new u.Buf16(320),this.work=new u.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function r(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=N,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new u.Buf32(dt),e.distcode=e.distdyn=new u.Buf32(ft),e.sane=1,e.back=-1,z):E}function s(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,r(t)):E}function o(t,e){var a,i;return t&&t.state?(i=t.state,e<0?(a=0,e=-e):(a=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?E:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,s(t))):E}function l(t,e){var a,i;return t?(i=new n,t.state=i,i.window=null,(a=o(t,e))!==z&&(t.state=null),a):E}function h(t){if(ut){var e;for(f=new u.Buf32(512),_=new u.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(m(p,t.lens,0,288,f,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;m(v,t.lens,0,32,_,0,t.work,{bits:5}),ut=!1}t.lencode=f,t.lenbits=9,t.distcode=_,t.distbits=5}function d(t,e,a,i){var n,r=t.state;return null===r.window&&(r.wsize=1<=r.wsize?(u.arraySet(r.window,e,a-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):((n=r.wsize-r.wnext)>i&&(n=i),u.arraySet(r.window,e,a-i,n,r.wnext),(i-=n)?(u.arraySet(r.window,e,a-i,i,0),r.wnext=i,r.whave=r.wsize):(r.wnext+=n,r.wnext===r.wsize&&(r.wnext=0),r.whave>>8&255,a.check=b(a.check,Et,2,0),_=0,dt=0,a.mode=O;break}if(a.flags=0,a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&_)<<8)+(_>>8))%31){t.msg="incorrect header check",a.mode=ot;break}if((15&_)!==C){t.msg="unknown compression method",a.mode=ot;break}if(_>>>=4,dt-=4,yt=8+(15&_),0===a.wbits)a.wbits=yt;else if(yt>a.wbits){t.msg="invalid window size",a.mode=ot;break}a.dmax=1<>8&1),512&a.flags&&(Et[0]=255&_,Et[1]=_>>>8&255,a.check=b(a.check,Et,2,0)),_=0,dt=0,a.mode=D;case D:for(;dt<32;){if(0===l)break t;l--,_+=n[s++]<>>8&255,Et[2]=_>>>16&255,Et[3]=_>>>24&255,a.check=b(a.check,Et,4,0)),_=0,dt=0,a.mode=I;case I:for(;dt<16;){if(0===l)break t;l--,_+=n[s++]<>8),512&a.flags&&(Et[0]=255&_,Et[1]=_>>>8&255,a.check=b(a.check,Et,2,0)),_=0,dt=0,a.mode=U;case U:if(1024&a.flags){for(;dt<16;){if(0===l)break t;l--,_+=n[s++]<>>8&255,a.check=b(a.check,Et,2,0)),_=0,dt=0}else a.head&&(a.head.extra=null);a.mode=T;case T:if(1024&a.flags&&((ut=a.length)>l&&(ut=l),ut&&(a.head&&(yt=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Array(a.head.extra_len)),u.arraySet(a.head.extra,n,s,ut,yt)),512&a.flags&&(a.check=b(a.check,n,ut,s)),l-=ut,s+=ut,a.length-=ut),a.length))break t;a.length=0,a.mode=F;case F:if(2048&a.flags){if(0===l)break t;ut=0;do{yt=n[s+ut++],a.head&&yt&&a.length<65536&&(a.head.name+=String.fromCharCode(yt))}while(yt&&ut>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=M;break;case j:for(;dt<32;){if(0===l)break t;l--,_+=n[s++]<>>=7&dt,dt-=7&dt,a.mode=nt;break}for(;dt<3;){if(0===l)break t;l--,_+=n[s++]<>>=1,dt-=1,3&_){case 0:a.mode=Y;break;case 1:if(h(a),a.mode=Q,e===x){_>>>=2,dt-=2;break t}break;case 2:a.mode=X;break;case 3:t.msg="invalid block type",a.mode=ot}_>>>=2,dt-=2;break;case Y:for(_>>>=7&dt,dt-=7&dt;dt<32;){if(0===l)break t;l--,_+=n[s++]<>>16^65535)){t.msg="invalid stored block lengths",a.mode=ot;break}if(a.length=65535&_,_=0,dt=0,a.mode=q,e===x)break t;case q:a.mode=G;case G:if(ut=a.length){if(ut>l&&(ut=l),ut>f&&(ut=f),0===ut)break t;u.arraySet(r,n,s,ut,o),l-=ut,s+=ut,f-=ut,o+=ut,a.length-=ut;break}a.mode=M;break;case X:for(;dt<14;){if(0===l)break t;l--,_+=n[s++]<>>=5,dt-=5,a.ndist=1+(31&_),_>>>=5,dt-=5,a.ncode=4+(15&_),_>>>=4,dt-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=ot;break}a.have=0,a.mode=W;case W:for(;a.have>>=3,dt-=3}for(;a.have<19;)a.lens[At[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,zt={bits:a.lenbits},xt=m(w,a.lens,0,19,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid code lengths set",a.mode=ot;break}a.have=0,a.mode=J;case J:for(;a.have>>24,mt=St>>>16&255,wt=65535&St,!(gt<=dt);){if(0===l)break t;l--,_+=n[s++]<>>=gt,dt-=gt,a.lens[a.have++]=wt;else{if(16===wt){for(Bt=gt+2;dt>>=gt,dt-=gt,0===a.have){t.msg="invalid bit length repeat",a.mode=ot;break}yt=a.lens[a.have-1],ut=3+(3&_),_>>>=2,dt-=2}else if(17===wt){for(Bt=gt+3;dt>>=gt)),_>>>=3,dt-=3}else{for(Bt=gt+7;dt>>=gt)),_>>>=7,dt-=7}if(a.have+ut>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=ot;break}for(;ut--;)a.lens[a.have++]=yt}}if(a.mode===ot)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=ot;break}if(a.lenbits=9,zt={bits:a.lenbits},xt=m(p,a.lens,0,a.nlen,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid literal/lengths set",a.mode=ot;break}if(a.distbits=6,a.distcode=a.distdyn,zt={bits:a.distbits},xt=m(v,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,zt),a.distbits=zt.bits,xt){t.msg="invalid distances set",a.mode=ot;break}if(a.mode=Q,e===x)break t;case Q:a.mode=V;case V:if(l>=6&&f>=258){t.next_out=o,t.avail_out=f,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=dt,g(t,_t),o=t.next_out,r=t.output,f=t.avail_out,s=t.next_in,n=t.input,l=t.avail_in,_=a.hold,dt=a.bits,a.mode===M&&(a.back=-1);break}for(a.back=0;St=a.lencode[_&(1<>>24,mt=St>>>16&255,wt=65535&St,!(gt<=dt);){if(0===l)break t;l--,_+=n[s++]<>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=dt);){if(0===l)break t;l--,_+=n[s++]<>>=pt,dt-=pt,a.back+=pt}if(_>>>=gt,dt-=gt,a.back+=gt,a.length=wt,0===mt){a.mode=it;break}if(32&mt){a.back=-1,a.mode=M;break}if(64&mt){t.msg="invalid literal/length code",a.mode=ot;break}a.extra=15&mt,a.mode=$;case $:if(a.extra){for(Bt=a.extra;dt>>=a.extra,dt-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=tt;case tt:for(;St=a.distcode[_&(1<>>24,mt=St>>>16&255,wt=65535&St,!(gt<=dt);){if(0===l)break t;l--,_+=n[s++]<>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=dt);){if(0===l)break t;l--,_+=n[s++]<>>=pt,dt-=pt,a.back+=pt}if(_>>>=gt,dt-=gt,a.back+=gt,64&mt){t.msg="invalid distance code",a.mode=ot;break}a.offset=wt,a.extra=15&mt,a.mode=et;case et:if(a.extra){for(Bt=a.extra;dt>>=a.extra,dt-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=ot;break}a.mode=at;case at:if(0===f)break t;if(ut=_t-f,a.offset>ut){if((ut=a.offset-ut)>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=ot;break}ut>a.wnext?(ut-=a.wnext,ct=a.wsize-ut):ct=a.wnext-ut,ut>a.length&&(ut=a.length),bt=a.window}else bt=r,ct=o-a.offset,ut=a.length;ut>f&&(ut=f),f-=ut,a.length-=ut;do{r[o++]=bt[ct++]}while(--ut);0===a.length&&(a.mode=V);break;case it:if(0===f)break t;r[o++]=a.length,f--,a.mode=V;break;case nt:if(a.wrap){for(;dt<32;){if(0===l)break t;l--,_|=n[s++]<=1&&0===I[S];S--);if(E>S&&(E=S),0===S)return h[d++]=20971520,h[d++]=20971520,_.bits=1,0;for(B=1;B0&&(0===t||1!==S))return-1;for(U[1]=0,x=1;x<15;x++)U[x+1]=U[x]+I[x];for(z=0;z852||2===t&&C>592)return 1;for(;;){p=x-Z,f[z]w?(v=T[F+f[z]],k=O[D+f[z]]):(v=96,k=0),u=1<>Z)+(c-=u)]=p<<24|v<<16|k|0}while(0!==c);for(u=1<>=1;if(0!==u?(N&=u-1,N+=u):N=0,z++,0==--I[x]){if(x===S)break;x=e[a+f[z]]}if(x>E&&(N&g)!==b){for(0===Z&&(Z=E),m+=B,R=1<<(A=x-Z);A+Z852||2===t&&C>592)return 1;h[b=N&g]=E<<24|A<<16|m-d|0}}return 0!==N&&(h[m+N]=x-Z<<24|64<<16|0),_.bits=E,0}},{"../utils/common":3}],13:[function(t,e,a){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],14:[function(t,e,a){"use strict";function i(t){for(var e=t.length;--e>=0;)t[e]=0}function n(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function r(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function s(t){return t<256?et[t]:et[256+(t>>>7)]}function o(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function l(t,e,a){t.bi_valid>M-a?(t.bi_buf|=e<>M-t.bi_valid,t.bi_valid+=a-M):(t.bi_buf|=e<>>=1,a<<=1}while(--e>0);return a>>>1}function f(t){16===t.bi_valid?(o(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function _(t,e){var a,i,n,r,s,o,l=e.dyn_tree,h=e.max_code,d=e.stat_desc.static_tree,f=e.stat_desc.has_stree,_=e.stat_desc.extra_bits,u=e.stat_desc.extra_base,c=e.stat_desc.max_length,b=0;for(r=0;r<=K;r++)t.bl_count[r]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;ac&&(r=c,b++),l[2*i+1]=r,i>h||(t.bl_count[r]++,s=0,i>=u&&(s=_[i-u]),o=l[2*i],t.opt_len+=o*(r+s),f&&(t.static_len+=o*(d[2*i+1]+s)));if(0!==b){do{for(r=c-1;0===t.bl_count[r];)r--;t.bl_count[r]--,t.bl_count[r+1]+=2,t.bl_count[c]--,b-=2}while(b>0);for(r=c;0!==r;r--)for(i=t.bl_count[r];0!==i;)(n=t.heap[--a])>h||(l[2*n+1]!==r&&(t.opt_len+=(r-l[2*n+1])*l[2*n],l[2*n+1]=r),i--)}}function u(t,e,a){var i,n,r=new Array(K+1),s=0;for(i=1;i<=K;i++)r[i]=s=s+a[i-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=d(r[o]++,o))}}function c(){var t,e,a,i,r,s=new Array(K+1);for(a=0,i=0;i>=7;i8?o(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function m(t,e,a,i){g(t),i&&(o(t,a),o(t,~a)),A.arraySet(t.pending_buf,t.window,e,a,t.pending),t.pending+=a}function w(t,e,a,i){var n=2*e,r=2*a;return t[n]>1;a>=1;a--)p(t,r,a);n=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],p(t,r,1),i=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=i,r[2*n]=r[2*a]+r[2*i],t.depth[n]=(t.depth[a]>=t.depth[i]?t.depth[a]:t.depth[i])+1,r[2*a+1]=r[2*i+1]=n,t.heap[1]=n++,p(t,r,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],_(t,e),u(r,h,t.bl_count)}function y(t,e,a){var i,n,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=s,s=e[2*(i+1)+1],++o=3&&0===t.bl_tree[2*V[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function B(t,e,a,i){var n;for(l(t,e-257,5),l(t,a-1,5),l(t,i-4,4),n=0;n>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return R;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return C;for(e=32;e0?(t.strm.data_type===N&&(t.strm.data_type=S(t)),k(t,t.l_desc),k(t,t.d_desc),s=z(t),n=t.opt_len+3+7>>>3,(r=t.static_len+3+7>>>3)<=n&&(n=r)):n=r=a+5,a+4<=n&&-1!==e?E(t,e,a,i):t.strategy===Z||r===n?(l(t,(D<<1)+(i?1:0),3),v(t,$,tt)):(l(t,(I<<1)+(i?1:0),3),B(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),v(t,t.dyn_ltree,t.dyn_dtree)),b(t),i&&g(t)},a._tr_tally=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(at[a]+T+1)]++,t.dyn_dtree[2*s(e)]++),t.last_lit===t.lit_bufsize-1},a._tr_align=function(t){l(t,D<<1,3),h(t,Y,$),f(t)}},{"../utils/common":3}],15:[function(t,e,a){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/":[function(t,e,a){"use strict";var i={};(0,t("./lib/utils/common").assign)(i,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=i},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/")}); diff --git a/node_modules/pako/dist/pako_deflate.js b/node_modules/pako/dist/pako_deflate.js deleted file mode 100644 index 6998a82c3..000000000 --- a/node_modules/pako/dist/pako_deflate.js +++ /dev/null @@ -1,3993 +0,0 @@ -/* pako 1.0.6 nodeca/pako */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.pako = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1); -} -_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start - - -// convert string to array (typed, when possible) -exports.string2buf = function (str) { - var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; - - // count binary size - for (m_pos = 0; m_pos < str_len; m_pos++) { - c = str.charCodeAt(m_pos); - if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { - c2 = str.charCodeAt(m_pos + 1); - if ((c2 & 0xfc00) === 0xdc00) { - c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); - m_pos++; - } - } - buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4; - } - - // allocate buffer - buf = new utils.Buf8(buf_len); - - // convert - for (i = 0, m_pos = 0; i < buf_len; m_pos++) { - c = str.charCodeAt(m_pos); - if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { - c2 = str.charCodeAt(m_pos + 1); - if ((c2 & 0xfc00) === 0xdc00) { - c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); - m_pos++; - } - } - if (c < 0x80) { - /* one byte */ - buf[i++] = c; - } else if (c < 0x800) { - /* two bytes */ - buf[i++] = 0xC0 | (c >>> 6); - buf[i++] = 0x80 | (c & 0x3f); - } else if (c < 0x10000) { - /* three bytes */ - buf[i++] = 0xE0 | (c >>> 12); - buf[i++] = 0x80 | (c >>> 6 & 0x3f); - buf[i++] = 0x80 | (c & 0x3f); - } else { - /* four bytes */ - buf[i++] = 0xf0 | (c >>> 18); - buf[i++] = 0x80 | (c >>> 12 & 0x3f); - buf[i++] = 0x80 | (c >>> 6 & 0x3f); - buf[i++] = 0x80 | (c & 0x3f); - } - } - - return buf; -}; - -// Helper (used in 2 places) -function buf2binstring(buf, len) { - // use fallback for big arrays to avoid stack overflow - if (len < 65537) { - if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) { - return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len)); - } - } - - var result = ''; - for (var i = 0; i < len; i++) { - result += String.fromCharCode(buf[i]); - } - return result; -} - - -// Convert byte array to binary string -exports.buf2binstring = function (buf) { - return buf2binstring(buf, buf.length); -}; - - -// Convert binary string (typed, when possible) -exports.binstring2buf = function (str) { - var buf = new utils.Buf8(str.length); - for (var i = 0, len = buf.length; i < len; i++) { - buf[i] = str.charCodeAt(i); - } - return buf; -}; - - -// convert array to string -exports.buf2string = function (buf, max) { - var i, out, c, c_len; - var len = max || buf.length; - - // Reserve max possible length (2 words per char) - // NB: by unknown reasons, Array is significantly faster for - // String.fromCharCode.apply than Uint16Array. - var utf16buf = new Array(len * 2); - - for (out = 0, i = 0; i < len;) { - c = buf[i++]; - // quick process ascii - if (c < 0x80) { utf16buf[out++] = c; continue; } - - c_len = _utf8len[c]; - // skip 5 & 6 byte codes - if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; } - - // apply mask on first byte - c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07; - // join the rest - while (c_len > 1 && i < len) { - c = (c << 6) | (buf[i++] & 0x3f); - c_len--; - } - - // terminated by end of string? - if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; } - - if (c < 0x10000) { - utf16buf[out++] = c; - } else { - c -= 0x10000; - utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff); - utf16buf[out++] = 0xdc00 | (c & 0x3ff); - } - } - - return buf2binstring(utf16buf, out); -}; - - -// Calculate max possible position in utf8 buffer, -// that will not break sequence. If that's not possible -// - (very small limits) return max size as is. -// -// buf[] - utf8 bytes array -// max - length limit (mandatory); -exports.utf8border = function (buf, max) { - var pos; - - max = max || buf.length; - if (max > buf.length) { max = buf.length; } - - // go back from last position, until start of sequence found - pos = max - 1; - while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; } - - // Very small and broken sequence, - // return max, because we should return something anyway. - if (pos < 0) { return max; } - - // If we came to start of buffer - that means buffer is too small, - // return max too. - if (pos === 0) { return max; } - - return (pos + _utf8len[buf[pos]] > max) ? pos : max; -}; - -},{"./common":1}],3:[function(require,module,exports){ -'use strict'; - -// Note: adler32 takes 12% for level 0 and 2% for level 6. -// It isn't worth it to make additional optimizations as in original. -// Small size is preferable. - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -function adler32(adler, buf, len, pos) { - var s1 = (adler & 0xffff) |0, - s2 = ((adler >>> 16) & 0xffff) |0, - n = 0; - - while (len !== 0) { - // Set limit ~ twice less than 5552, to keep - // s2 in 31-bits, because we force signed ints. - // in other case %= will fail. - n = len > 2000 ? 2000 : len; - len -= n; - - do { - s1 = (s1 + buf[pos++]) |0; - s2 = (s2 + s1) |0; - } while (--n); - - s1 %= 65521; - s2 %= 65521; - } - - return (s1 | (s2 << 16)) |0; -} - - -module.exports = adler32; - -},{}],4:[function(require,module,exports){ -'use strict'; - -// Note: we can't get significant speed boost here. -// So write code to minimize size - no pregenerated tables -// and array tools dependencies. - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -// Use ordinary array, since untyped makes no boost here -function makeTable() { - var c, table = []; - - for (var n = 0; n < 256; n++) { - c = n; - for (var k = 0; k < 8; k++) { - c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); - } - table[n] = c; - } - - return table; -} - -// Create table on load. Just 255 signed longs. Not a problem. -var crcTable = makeTable(); - - -function crc32(crc, buf, len, pos) { - var t = crcTable, - end = pos + len; - - crc ^= -1; - - for (var i = pos; i < end; i++) { - crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF]; - } - - return (crc ^ (-1)); // >>> 0; -} - - -module.exports = crc32; - -},{}],5:[function(require,module,exports){ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -var utils = require('../utils/common'); -var trees = require('./trees'); -var adler32 = require('./adler32'); -var crc32 = require('./crc32'); -var msg = require('./messages'); - -/* Public constants ==========================================================*/ -/* ===========================================================================*/ - - -/* Allowed flush values; see deflate() and inflate() below for details */ -var Z_NO_FLUSH = 0; -var Z_PARTIAL_FLUSH = 1; -//var Z_SYNC_FLUSH = 2; -var Z_FULL_FLUSH = 3; -var Z_FINISH = 4; -var Z_BLOCK = 5; -//var Z_TREES = 6; - - -/* Return codes for the compression/decompression functions. Negative values - * are errors, positive values are used for special but normal events. - */ -var Z_OK = 0; -var Z_STREAM_END = 1; -//var Z_NEED_DICT = 2; -//var Z_ERRNO = -1; -var Z_STREAM_ERROR = -2; -var Z_DATA_ERROR = -3; -//var Z_MEM_ERROR = -4; -var Z_BUF_ERROR = -5; -//var Z_VERSION_ERROR = -6; - - -/* compression levels */ -//var Z_NO_COMPRESSION = 0; -//var Z_BEST_SPEED = 1; -//var Z_BEST_COMPRESSION = 9; -var Z_DEFAULT_COMPRESSION = -1; - - -var Z_FILTERED = 1; -var Z_HUFFMAN_ONLY = 2; -var Z_RLE = 3; -var Z_FIXED = 4; -var Z_DEFAULT_STRATEGY = 0; - -/* Possible values of the data_type field (though see inflate()) */ -//var Z_BINARY = 0; -//var Z_TEXT = 1; -//var Z_ASCII = 1; // = Z_TEXT -var Z_UNKNOWN = 2; - - -/* The deflate compression method */ -var Z_DEFLATED = 8; - -/*============================================================================*/ - - -var MAX_MEM_LEVEL = 9; -/* Maximum value for memLevel in deflateInit2 */ -var MAX_WBITS = 15; -/* 32K LZ77 window */ -var DEF_MEM_LEVEL = 8; - - -var LENGTH_CODES = 29; -/* number of length codes, not counting the special END_BLOCK code */ -var LITERALS = 256; -/* number of literal bytes 0..255 */ -var L_CODES = LITERALS + 1 + LENGTH_CODES; -/* number of Literal or Length codes, including the END_BLOCK code */ -var D_CODES = 30; -/* number of distance codes */ -var BL_CODES = 19; -/* number of codes used to transfer the bit lengths */ -var HEAP_SIZE = 2 * L_CODES + 1; -/* maximum heap size */ -var MAX_BITS = 15; -/* All codes must not exceed MAX_BITS bits */ - -var MIN_MATCH = 3; -var MAX_MATCH = 258; -var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1); - -var PRESET_DICT = 0x20; - -var INIT_STATE = 42; -var EXTRA_STATE = 69; -var NAME_STATE = 73; -var COMMENT_STATE = 91; -var HCRC_STATE = 103; -var BUSY_STATE = 113; -var FINISH_STATE = 666; - -var BS_NEED_MORE = 1; /* block not completed, need more input or more output */ -var BS_BLOCK_DONE = 2; /* block flush performed */ -var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */ -var BS_FINISH_DONE = 4; /* finish done, accept no more input or output */ - -var OS_CODE = 0x03; // Unix :) . Don't detect, use this default. - -function err(strm, errorCode) { - strm.msg = msg[errorCode]; - return errorCode; -} - -function rank(f) { - return ((f) << 1) - ((f) > 4 ? 9 : 0); -} - -function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } - - -/* ========================================================================= - * Flush as much pending output as possible. All deflate() output goes - * through this function so some applications may wish to modify it - * to avoid allocating a large strm->output buffer and copying into it. - * (See also read_buf()). - */ -function flush_pending(strm) { - var s = strm.state; - - //_tr_flush_bits(s); - var len = s.pending; - if (len > strm.avail_out) { - len = strm.avail_out; - } - if (len === 0) { return; } - - utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out); - strm.next_out += len; - s.pending_out += len; - strm.total_out += len; - strm.avail_out -= len; - s.pending -= len; - if (s.pending === 0) { - s.pending_out = 0; - } -} - - -function flush_block_only(s, last) { - trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last); - s.block_start = s.strstart; - flush_pending(s.strm); -} - - -function put_byte(s, b) { - s.pending_buf[s.pending++] = b; -} - - -/* ========================================================================= - * Put a short in the pending buffer. The 16-bit value is put in MSB order. - * IN assertion: the stream state is correct and there is enough room in - * pending_buf. - */ -function putShortMSB(s, b) { -// put_byte(s, (Byte)(b >> 8)); -// put_byte(s, (Byte)(b & 0xff)); - s.pending_buf[s.pending++] = (b >>> 8) & 0xff; - s.pending_buf[s.pending++] = b & 0xff; -} - - -/* =========================================================================== - * Read a new buffer from the current input stream, update the adler32 - * and total number of bytes read. All deflate() input goes through - * this function so some applications may wish to modify it to avoid - * allocating a large strm->input buffer and copying from it. - * (See also flush_pending()). - */ -function read_buf(strm, buf, start, size) { - var len = strm.avail_in; - - if (len > size) { len = size; } - if (len === 0) { return 0; } - - strm.avail_in -= len; - - // zmemcpy(buf, strm->next_in, len); - utils.arraySet(buf, strm.input, strm.next_in, len, start); - if (strm.state.wrap === 1) { - strm.adler = adler32(strm.adler, buf, len, start); - } - - else if (strm.state.wrap === 2) { - strm.adler = crc32(strm.adler, buf, len, start); - } - - strm.next_in += len; - strm.total_in += len; - - return len; -} - - -/* =========================================================================== - * Set match_start to the longest match starting at the given string and - * return its length. Matches shorter or equal to prev_length are discarded, - * in which case the result is equal to prev_length and match_start is - * garbage. - * IN assertions: cur_match is the head of the hash chain for the current - * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 - * OUT assertion: the match length is not greater than s->lookahead. - */ -function longest_match(s, cur_match) { - var chain_length = s.max_chain_length; /* max hash chain length */ - var scan = s.strstart; /* current string */ - var match; /* matched string */ - var len; /* length of current match */ - var best_len = s.prev_length; /* best match length so far */ - var nice_match = s.nice_match; /* stop if match long enough */ - var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ? - s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/; - - var _win = s.window; // shortcut - - var wmask = s.w_mask; - var prev = s.prev; - - /* Stop when cur_match becomes <= limit. To simplify the code, - * we prevent matches with the string of window index 0. - */ - - var strend = s.strstart + MAX_MATCH; - var scan_end1 = _win[scan + best_len - 1]; - var scan_end = _win[scan + best_len]; - - /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. - * It is easy to get rid of this optimization if necessary. - */ - // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); - - /* Do not waste too much time if we already have a good match: */ - if (s.prev_length >= s.good_match) { - chain_length >>= 2; - } - /* Do not look for matches beyond the end of the input. This is necessary - * to make deflate deterministic. - */ - if (nice_match > s.lookahead) { nice_match = s.lookahead; } - - // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); - - do { - // Assert(cur_match < s->strstart, "no future"); - match = cur_match; - - /* Skip to next match if the match length cannot increase - * or if the match length is less than 2. Note that the checks below - * for insufficient lookahead only occur occasionally for performance - * reasons. Therefore uninitialized memory will be accessed, and - * conditional jumps will be made that depend on those values. - * However the length of the match is limited to the lookahead, so - * the output of deflate is not affected by the uninitialized values. - */ - - if (_win[match + best_len] !== scan_end || - _win[match + best_len - 1] !== scan_end1 || - _win[match] !== _win[scan] || - _win[++match] !== _win[scan + 1]) { - continue; - } - - /* The check at best_len-1 can be removed because it will be made - * again later. (This heuristic is not always a win.) - * It is not necessary to compare scan[2] and match[2] since they - * are always equal when the other bytes match, given that - * the hash keys are equal and that HASH_BITS >= 8. - */ - scan += 2; - match++; - // Assert(*scan == *match, "match[2]?"); - - /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. - */ - do { - /*jshint noempty:false*/ - } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && - _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && - _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && - _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && - scan < strend); - - // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); - - len = MAX_MATCH - (strend - scan); - scan = strend - MAX_MATCH; - - if (len > best_len) { - s.match_start = cur_match; - best_len = len; - if (len >= nice_match) { - break; - } - scan_end1 = _win[scan + best_len - 1]; - scan_end = _win[scan + best_len]; - } - } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0); - - if (best_len <= s.lookahead) { - return best_len; - } - return s.lookahead; -} - - -/* =========================================================================== - * Fill the window when the lookahead becomes insufficient. - * Updates strstart and lookahead. - * - * IN assertion: lookahead < MIN_LOOKAHEAD - * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD - * At least one byte has been read, or avail_in == 0; reads are - * performed for at least two bytes (required for the zip translate_eol - * option -- not supported here). - */ -function fill_window(s) { - var _w_size = s.w_size; - var p, n, m, more, str; - - //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); - - do { - more = s.window_size - s.lookahead - s.strstart; - - // JS ints have 32 bit, block below not needed - /* Deal with !@#$% 64K limit: */ - //if (sizeof(int) <= 2) { - // if (more == 0 && s->strstart == 0 && s->lookahead == 0) { - // more = wsize; - // - // } else if (more == (unsigned)(-1)) { - // /* Very unlikely, but possible on 16 bit machine if - // * strstart == 0 && lookahead == 1 (input done a byte at time) - // */ - // more--; - // } - //} - - - /* If the window is almost full and there is insufficient lookahead, - * move the upper half to the lower one to make room in the upper half. - */ - if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) { - - utils.arraySet(s.window, s.window, _w_size, _w_size, 0); - s.match_start -= _w_size; - s.strstart -= _w_size; - /* we now have strstart >= MAX_DIST */ - s.block_start -= _w_size; - - /* Slide the hash table (could be avoided with 32 bit values - at the expense of memory usage). We slide even when level == 0 - to keep the hash table consistent if we switch back to level > 0 - later. (Using level 0 permanently is not an optimal usage of - zlib, so we don't care about this pathological case.) - */ - - n = s.hash_size; - p = n; - do { - m = s.head[--p]; - s.head[p] = (m >= _w_size ? m - _w_size : 0); - } while (--n); - - n = _w_size; - p = n; - do { - m = s.prev[--p]; - s.prev[p] = (m >= _w_size ? m - _w_size : 0); - /* If n is not on any hash chain, prev[n] is garbage but - * its value will never be used. - */ - } while (--n); - - more += _w_size; - } - if (s.strm.avail_in === 0) { - break; - } - - /* If there was no sliding: - * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && - * more == window_size - lookahead - strstart - * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) - * => more >= window_size - 2*WSIZE + 2 - * In the BIG_MEM or MMAP case (not yet supported), - * window_size == input_size + MIN_LOOKAHEAD && - * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. - * Otherwise, window_size == 2*WSIZE so more >= 2. - * If there was sliding, more >= WSIZE. So in all cases, more >= 2. - */ - //Assert(more >= 2, "more < 2"); - n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more); - s.lookahead += n; - - /* Initialize the hash value now that we have some input: */ - if (s.lookahead + s.insert >= MIN_MATCH) { - str = s.strstart - s.insert; - s.ins_h = s.window[str]; - - /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask; -//#if MIN_MATCH != 3 -// Call update_hash() MIN_MATCH-3 more times -//#endif - while (s.insert) { - /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; - - s.prev[str & s.w_mask] = s.head[s.ins_h]; - s.head[s.ins_h] = str; - str++; - s.insert--; - if (s.lookahead + s.insert < MIN_MATCH) { - break; - } - } - } - /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, - * but this is not important since only literal bytes will be emitted. - */ - - } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0); - - /* If the WIN_INIT bytes after the end of the current data have never been - * written, then zero those bytes in order to avoid memory check reports of - * the use of uninitialized (or uninitialised as Julian writes) bytes by - * the longest match routines. Update the high water mark for the next - * time through here. WIN_INIT is set to MAX_MATCH since the longest match - * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. - */ -// if (s.high_water < s.window_size) { -// var curr = s.strstart + s.lookahead; -// var init = 0; -// -// if (s.high_water < curr) { -// /* Previous high water mark below current data -- zero WIN_INIT -// * bytes or up to end of window, whichever is less. -// */ -// init = s.window_size - curr; -// if (init > WIN_INIT) -// init = WIN_INIT; -// zmemzero(s->window + curr, (unsigned)init); -// s->high_water = curr + init; -// } -// else if (s->high_water < (ulg)curr + WIN_INIT) { -// /* High water mark at or above current data, but below current data -// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up -// * to end of window, whichever is less. -// */ -// init = (ulg)curr + WIN_INIT - s->high_water; -// if (init > s->window_size - s->high_water) -// init = s->window_size - s->high_water; -// zmemzero(s->window + s->high_water, (unsigned)init); -// s->high_water += init; -// } -// } -// -// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, -// "not enough room for search"); -} - -/* =========================================================================== - * Copy without compression as much as possible from the input stream, return - * the current block state. - * This function does not insert new strings in the dictionary since - * uncompressible data is probably not useful. This function is used - * only for the level=0 compression option. - * NOTE: this function should be optimized to avoid extra copying from - * window to pending_buf. - */ -function deflate_stored(s, flush) { - /* Stored blocks are limited to 0xffff bytes, pending_buf is limited - * to pending_buf_size, and each stored block has a 5 byte header: - */ - var max_block_size = 0xffff; - - if (max_block_size > s.pending_buf_size - 5) { - max_block_size = s.pending_buf_size - 5; - } - - /* Copy as much as possible from input to output: */ - for (;;) { - /* Fill the window as much as possible: */ - if (s.lookahead <= 1) { - - //Assert(s->strstart < s->w_size+MAX_DIST(s) || - // s->block_start >= (long)s->w_size, "slide too late"); -// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) || -// s.block_start >= s.w_size)) { -// throw new Error("slide too late"); -// } - - fill_window(s); - if (s.lookahead === 0 && flush === Z_NO_FLUSH) { - return BS_NEED_MORE; - } - - if (s.lookahead === 0) { - break; - } - /* flush the current block */ - } - //Assert(s->block_start >= 0L, "block gone"); -// if (s.block_start < 0) throw new Error("block gone"); - - s.strstart += s.lookahead; - s.lookahead = 0; - - /* Emit a stored block if pending_buf will be full: */ - var max_start = s.block_start + max_block_size; - - if (s.strstart === 0 || s.strstart >= max_start) { - /* strstart == 0 is possible when wraparound on 16-bit machine */ - s.lookahead = s.strstart - max_start; - s.strstart = max_start; - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - - - } - /* Flush if we may have to slide, otherwise block_start may become - * negative and the data will be gone: - */ - if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - } - - s.insert = 0; - - if (flush === Z_FINISH) { - /*** FLUSH_BLOCK(s, 1); ***/ - flush_block_only(s, true); - if (s.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - /***/ - return BS_FINISH_DONE; - } - - if (s.strstart > s.block_start) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - - return BS_NEED_MORE; -} - -/* =========================================================================== - * Compress as much as possible from the input stream, return the current - * block state. - * This function does not perform lazy evaluation of matches and inserts - * new strings in the dictionary only for unmatched strings or for short - * matches. It is used only for the fast compression options. - */ -function deflate_fast(s, flush) { - var hash_head; /* head of the hash chain */ - var bflush; /* set if current block must be flushed */ - - for (;;) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - if (s.lookahead < MIN_LOOKAHEAD) { - fill_window(s); - if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { - return BS_NEED_MORE; - } - if (s.lookahead === 0) { - break; /* flush the current block */ - } - } - - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - hash_head = 0/*NIL*/; - if (s.lookahead >= MIN_MATCH) { - /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; - hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; - s.head[s.ins_h] = s.strstart; - /***/ - } - - /* Find the longest match, discarding those <= prev_length. - * At this point we have always match_length < MIN_MATCH - */ - if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - s.match_length = longest_match(s, hash_head); - /* longest_match() sets match_start */ - } - if (s.match_length >= MIN_MATCH) { - // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only - - /*** _tr_tally_dist(s, s.strstart - s.match_start, - s.match_length - MIN_MATCH, bflush); ***/ - bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); - - s.lookahead -= s.match_length; - - /* Insert new strings in the hash table only if the match length - * is not too large. This saves time but degrades compression. - */ - if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) { - s.match_length--; /* string at strstart already in table */ - do { - s.strstart++; - /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; - hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; - s.head[s.ins_h] = s.strstart; - /***/ - /* strstart never exceeds WSIZE-MAX_MATCH, so there are - * always MIN_MATCH bytes ahead. - */ - } while (--s.match_length !== 0); - s.strstart++; - } else - { - s.strstart += s.match_length; - s.match_length = 0; - s.ins_h = s.window[s.strstart]; - /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask; - -//#if MIN_MATCH != 3 -// Call UPDATE_HASH() MIN_MATCH-3 more times -//#endif - /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not - * matter since it will be recomputed at next deflate call. - */ - } - } else { - /* No match, output a literal byte */ - //Tracevv((stderr,"%c", s.window[s.strstart])); - /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = trees._tr_tally(s, 0, s.window[s.strstart]); - - s.lookahead--; - s.strstart++; - } - if (bflush) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - } - s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1); - if (flush === Z_FINISH) { - /*** FLUSH_BLOCK(s, 1); ***/ - flush_block_only(s, true); - if (s.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - /***/ - return BS_FINISH_DONE; - } - if (s.last_lit) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - return BS_BLOCK_DONE; -} - -/* =========================================================================== - * Same as above, but achieves better compression. We use a lazy - * evaluation for matches: a match is finally adopted only if there is - * no better match at the next window position. - */ -function deflate_slow(s, flush) { - var hash_head; /* head of hash chain */ - var bflush; /* set if current block must be flushed */ - - var max_insert; - - /* Process the input block. */ - for (;;) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - if (s.lookahead < MIN_LOOKAHEAD) { - fill_window(s); - if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { - return BS_NEED_MORE; - } - if (s.lookahead === 0) { break; } /* flush the current block */ - } - - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - hash_head = 0/*NIL*/; - if (s.lookahead >= MIN_MATCH) { - /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; - hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; - s.head[s.ins_h] = s.strstart; - /***/ - } - - /* Find the longest match, discarding those <= prev_length. - */ - s.prev_length = s.match_length; - s.prev_match = s.match_start; - s.match_length = MIN_MATCH - 1; - - if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match && - s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - s.match_length = longest_match(s, hash_head); - /* longest_match() sets match_start */ - - if (s.match_length <= 5 && - (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { - - /* If prev_match is also MIN_MATCH, match_start is garbage - * but we will ignore the current match anyway. - */ - s.match_length = MIN_MATCH - 1; - } - } - /* If there was a match at the previous step and the current - * match is not better, output the previous match: - */ - if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { - max_insert = s.strstart + s.lookahead - MIN_MATCH; - /* Do not insert strings in hash table beyond this. */ - - //check_match(s, s.strstart-1, s.prev_match, s.prev_length); - - /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match, - s.prev_length - MIN_MATCH, bflush);***/ - bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH); - /* Insert in hash table all strings up to the end of the match. - * strstart-1 and strstart are already inserted. If there is not - * enough lookahead, the last two strings are not inserted in - * the hash table. - */ - s.lookahead -= s.prev_length - 1; - s.prev_length -= 2; - do { - if (++s.strstart <= max_insert) { - /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; - hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; - s.head[s.ins_h] = s.strstart; - /***/ - } - } while (--s.prev_length !== 0); - s.match_available = 0; - s.match_length = MIN_MATCH - 1; - s.strstart++; - - if (bflush) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - - } else if (s.match_available) { - /* If there was no match at the previous position, output a - * single literal. If there was a match but the current match - * is longer, truncate the previous match to a single literal. - */ - //Tracevv((stderr,"%c", s->window[s->strstart-1])); - /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ - bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); - - if (bflush) { - /*** FLUSH_BLOCK_ONLY(s, 0) ***/ - flush_block_only(s, false); - /***/ - } - s.strstart++; - s.lookahead--; - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - } else { - /* There is no previous match to compare with, wait for - * the next step to decide. - */ - s.match_available = 1; - s.strstart++; - s.lookahead--; - } - } - //Assert (flush != Z_NO_FLUSH, "no flush?"); - if (s.match_available) { - //Tracevv((stderr,"%c", s->window[s->strstart-1])); - /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ - bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); - - s.match_available = 0; - } - s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; - if (flush === Z_FINISH) { - /*** FLUSH_BLOCK(s, 1); ***/ - flush_block_only(s, true); - if (s.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - /***/ - return BS_FINISH_DONE; - } - if (s.last_lit) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - - return BS_BLOCK_DONE; -} - - -/* =========================================================================== - * For Z_RLE, simply look for runs of bytes, generate matches only of distance - * one. Do not maintain a hash table. (It will be regenerated if this run of - * deflate switches away from Z_RLE.) - */ -function deflate_rle(s, flush) { - var bflush; /* set if current block must be flushed */ - var prev; /* byte at distance one to match */ - var scan, strend; /* scan goes up to strend for length of run */ - - var _win = s.window; - - for (;;) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the longest run, plus one for the unrolled loop. - */ - if (s.lookahead <= MAX_MATCH) { - fill_window(s); - if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) { - return BS_NEED_MORE; - } - if (s.lookahead === 0) { break; } /* flush the current block */ - } - - /* See how many times the previous byte repeats */ - s.match_length = 0; - if (s.lookahead >= MIN_MATCH && s.strstart > 0) { - scan = s.strstart - 1; - prev = _win[scan]; - if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { - strend = s.strstart + MAX_MATCH; - do { - /*jshint noempty:false*/ - } while (prev === _win[++scan] && prev === _win[++scan] && - prev === _win[++scan] && prev === _win[++scan] && - prev === _win[++scan] && prev === _win[++scan] && - prev === _win[++scan] && prev === _win[++scan] && - scan < strend); - s.match_length = MAX_MATCH - (strend - scan); - if (s.match_length > s.lookahead) { - s.match_length = s.lookahead; - } - } - //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); - } - - /* Emit match if have run of MIN_MATCH or longer, else emit literal */ - if (s.match_length >= MIN_MATCH) { - //check_match(s, s.strstart, s.strstart - 1, s.match_length); - - /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/ - bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH); - - s.lookahead -= s.match_length; - s.strstart += s.match_length; - s.match_length = 0; - } else { - /* No match, output a literal byte */ - //Tracevv((stderr,"%c", s->window[s->strstart])); - /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = trees._tr_tally(s, 0, s.window[s.strstart]); - - s.lookahead--; - s.strstart++; - } - if (bflush) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - } - s.insert = 0; - if (flush === Z_FINISH) { - /*** FLUSH_BLOCK(s, 1); ***/ - flush_block_only(s, true); - if (s.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - /***/ - return BS_FINISH_DONE; - } - if (s.last_lit) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - return BS_BLOCK_DONE; -} - -/* =========================================================================== - * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. - * (It will be regenerated if this run of deflate switches away from Huffman.) - */ -function deflate_huff(s, flush) { - var bflush; /* set if current block must be flushed */ - - for (;;) { - /* Make sure that we have a literal to write. */ - if (s.lookahead === 0) { - fill_window(s); - if (s.lookahead === 0) { - if (flush === Z_NO_FLUSH) { - return BS_NEED_MORE; - } - break; /* flush the current block */ - } - } - - /* Output a literal byte */ - s.match_length = 0; - //Tracevv((stderr,"%c", s->window[s->strstart])); - /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = trees._tr_tally(s, 0, s.window[s.strstart]); - s.lookahead--; - s.strstart++; - if (bflush) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - } - s.insert = 0; - if (flush === Z_FINISH) { - /*** FLUSH_BLOCK(s, 1); ***/ - flush_block_only(s, true); - if (s.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - /***/ - return BS_FINISH_DONE; - } - if (s.last_lit) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - return BS_BLOCK_DONE; -} - -/* Values for max_lazy_match, good_match and max_chain_length, depending on - * the desired pack level (0..9). The values given below have been tuned to - * exclude worst case performance for pathological files. Better values may be - * found for specific files. - */ -function Config(good_length, max_lazy, nice_length, max_chain, func) { - this.good_length = good_length; - this.max_lazy = max_lazy; - this.nice_length = nice_length; - this.max_chain = max_chain; - this.func = func; -} - -var configuration_table; - -configuration_table = [ - /* good lazy nice chain */ - new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */ - new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */ - new Config(4, 5, 16, 8, deflate_fast), /* 2 */ - new Config(4, 6, 32, 32, deflate_fast), /* 3 */ - - new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */ - new Config(8, 16, 32, 32, deflate_slow), /* 5 */ - new Config(8, 16, 128, 128, deflate_slow), /* 6 */ - new Config(8, 32, 128, 256, deflate_slow), /* 7 */ - new Config(32, 128, 258, 1024, deflate_slow), /* 8 */ - new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */ -]; - - -/* =========================================================================== - * Initialize the "longest match" routines for a new zlib stream - */ -function lm_init(s) { - s.window_size = 2 * s.w_size; - - /*** CLEAR_HASH(s); ***/ - zero(s.head); // Fill with NIL (= 0); - - /* Set the default configuration parameters: - */ - s.max_lazy_match = configuration_table[s.level].max_lazy; - s.good_match = configuration_table[s.level].good_length; - s.nice_match = configuration_table[s.level].nice_length; - s.max_chain_length = configuration_table[s.level].max_chain; - - s.strstart = 0; - s.block_start = 0; - s.lookahead = 0; - s.insert = 0; - s.match_length = s.prev_length = MIN_MATCH - 1; - s.match_available = 0; - s.ins_h = 0; -} - - -function DeflateState() { - this.strm = null; /* pointer back to this zlib stream */ - this.status = 0; /* as the name implies */ - this.pending_buf = null; /* output still pending */ - this.pending_buf_size = 0; /* size of pending_buf */ - this.pending_out = 0; /* next pending byte to output to the stream */ - this.pending = 0; /* nb of bytes in the pending buffer */ - this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ - this.gzhead = null; /* gzip header information to write */ - this.gzindex = 0; /* where in extra, name, or comment */ - this.method = Z_DEFLATED; /* can only be DEFLATED */ - this.last_flush = -1; /* value of flush param for previous deflate call */ - - this.w_size = 0; /* LZ77 window size (32K by default) */ - this.w_bits = 0; /* log2(w_size) (8..16) */ - this.w_mask = 0; /* w_size - 1 */ - - this.window = null; - /* Sliding window. Input bytes are read into the second half of the window, - * and move to the first half later to keep a dictionary of at least wSize - * bytes. With this organization, matches are limited to a distance of - * wSize-MAX_MATCH bytes, but this ensures that IO is always - * performed with a length multiple of the block size. - */ - - this.window_size = 0; - /* Actual size of window: 2*wSize, except when the user input buffer - * is directly used as sliding window. - */ - - this.prev = null; - /* Link to older string with same hash index. To limit the size of this - * array to 64K, this link is maintained only for the last 32K strings. - * An index in this array is thus a window index modulo 32K. - */ - - this.head = null; /* Heads of the hash chains or NIL. */ - - this.ins_h = 0; /* hash index of string to be inserted */ - this.hash_size = 0; /* number of elements in hash table */ - this.hash_bits = 0; /* log2(hash_size) */ - this.hash_mask = 0; /* hash_size-1 */ - - this.hash_shift = 0; - /* Number of bits by which ins_h must be shifted at each input - * step. It must be such that after MIN_MATCH steps, the oldest - * byte no longer takes part in the hash key, that is: - * hash_shift * MIN_MATCH >= hash_bits - */ - - this.block_start = 0; - /* Window position at the beginning of the current output block. Gets - * negative when the window is moved backwards. - */ - - this.match_length = 0; /* length of best match */ - this.prev_match = 0; /* previous match */ - this.match_available = 0; /* set if previous match exists */ - this.strstart = 0; /* start of string to insert */ - this.match_start = 0; /* start of matching string */ - this.lookahead = 0; /* number of valid bytes ahead in window */ - - this.prev_length = 0; - /* Length of the best match at previous step. Matches not greater than this - * are discarded. This is used in the lazy match evaluation. - */ - - this.max_chain_length = 0; - /* To speed up deflation, hash chains are never searched beyond this - * length. A higher limit improves compression ratio but degrades the - * speed. - */ - - this.max_lazy_match = 0; - /* Attempt to find a better match only when the current match is strictly - * smaller than this value. This mechanism is used only for compression - * levels >= 4. - */ - // That's alias to max_lazy_match, don't use directly - //this.max_insert_length = 0; - /* Insert new strings in the hash table only if the match length is not - * greater than this length. This saves time but degrades compression. - * max_insert_length is used only for compression levels <= 3. - */ - - this.level = 0; /* compression level (1..9) */ - this.strategy = 0; /* favor or force Huffman coding*/ - - this.good_match = 0; - /* Use a faster search when the previous match is longer than this */ - - this.nice_match = 0; /* Stop searching when current match exceeds this */ - - /* used by trees.c: */ - - /* Didn't use ct_data typedef below to suppress compiler warning */ - - // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ - // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ - // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ - - // Use flat array of DOUBLE size, with interleaved fata, - // because JS does not support effective - this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2); - this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2); - this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2); - zero(this.dyn_ltree); - zero(this.dyn_dtree); - zero(this.bl_tree); - - this.l_desc = null; /* desc. for literal tree */ - this.d_desc = null; /* desc. for distance tree */ - this.bl_desc = null; /* desc. for bit length tree */ - - //ush bl_count[MAX_BITS+1]; - this.bl_count = new utils.Buf16(MAX_BITS + 1); - /* number of codes at each bit length for an optimal tree */ - - //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ - this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */ - zero(this.heap); - - this.heap_len = 0; /* number of elements in the heap */ - this.heap_max = 0; /* element of largest frequency */ - /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. - * The same heap array is used to build all trees. - */ - - this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1]; - zero(this.depth); - /* Depth of each subtree used as tie breaker for trees of equal frequency - */ - - this.l_buf = 0; /* buffer index for literals or lengths */ - - this.lit_bufsize = 0; - /* Size of match buffer for literals/lengths. There are 4 reasons for - * limiting lit_bufsize to 64K: - * - frequencies can be kept in 16 bit counters - * - if compression is not successful for the first block, all input - * data is still in the window so we can still emit a stored block even - * when input comes from standard input. (This can also be done for - * all blocks if lit_bufsize is not greater than 32K.) - * - if compression is not successful for a file smaller than 64K, we can - * even emit a stored file instead of a stored block (saving 5 bytes). - * This is applicable only for zip (not gzip or zlib). - * - creating new Huffman trees less frequently may not provide fast - * adaptation to changes in the input data statistics. (Take for - * example a binary file with poorly compressible code followed by - * a highly compressible string table.) Smaller buffer sizes give - * fast adaptation but have of course the overhead of transmitting - * trees more frequently. - * - I can't count above 4 - */ - - this.last_lit = 0; /* running index in l_buf */ - - this.d_buf = 0; - /* Buffer index for distances. To simplify the code, d_buf and l_buf have - * the same number of elements. To use different lengths, an extra flag - * array would be necessary. - */ - - this.opt_len = 0; /* bit length of current block with optimal trees */ - this.static_len = 0; /* bit length of current block with static trees */ - this.matches = 0; /* number of string matches in current block */ - this.insert = 0; /* bytes at end of window left to insert */ - - - this.bi_buf = 0; - /* Output buffer. bits are inserted starting at the bottom (least - * significant bits). - */ - this.bi_valid = 0; - /* Number of valid bits in bi_buf. All bits above the last valid bit - * are always zero. - */ - - // Used for window memory init. We safely ignore it for JS. That makes - // sense only for pointers and memory check tools. - //this.high_water = 0; - /* High water mark offset in window for initialized bytes -- bytes above - * this are set to zero in order to avoid memory check warnings when - * longest match routines access bytes past the input. This is then - * updated to the new high water mark. - */ -} - - -function deflateResetKeep(strm) { - var s; - - if (!strm || !strm.state) { - return err(strm, Z_STREAM_ERROR); - } - - strm.total_in = strm.total_out = 0; - strm.data_type = Z_UNKNOWN; - - s = strm.state; - s.pending = 0; - s.pending_out = 0; - - if (s.wrap < 0) { - s.wrap = -s.wrap; - /* was made negative by deflate(..., Z_FINISH); */ - } - s.status = (s.wrap ? INIT_STATE : BUSY_STATE); - strm.adler = (s.wrap === 2) ? - 0 // crc32(0, Z_NULL, 0) - : - 1; // adler32(0, Z_NULL, 0) - s.last_flush = Z_NO_FLUSH; - trees._tr_init(s); - return Z_OK; -} - - -function deflateReset(strm) { - var ret = deflateResetKeep(strm); - if (ret === Z_OK) { - lm_init(strm.state); - } - return ret; -} - - -function deflateSetHeader(strm, head) { - if (!strm || !strm.state) { return Z_STREAM_ERROR; } - if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; } - strm.state.gzhead = head; - return Z_OK; -} - - -function deflateInit2(strm, level, method, windowBits, memLevel, strategy) { - if (!strm) { // === Z_NULL - return Z_STREAM_ERROR; - } - var wrap = 1; - - if (level === Z_DEFAULT_COMPRESSION) { - level = 6; - } - - if (windowBits < 0) { /* suppress zlib wrapper */ - wrap = 0; - windowBits = -windowBits; - } - - else if (windowBits > 15) { - wrap = 2; /* write gzip wrapper instead */ - windowBits -= 16; - } - - - if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || - windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || - strategy < 0 || strategy > Z_FIXED) { - return err(strm, Z_STREAM_ERROR); - } - - - if (windowBits === 8) { - windowBits = 9; - } - /* until 256-byte window bug fixed */ - - var s = new DeflateState(); - - strm.state = s; - s.strm = strm; - - s.wrap = wrap; - s.gzhead = null; - s.w_bits = windowBits; - s.w_size = 1 << s.w_bits; - s.w_mask = s.w_size - 1; - - s.hash_bits = memLevel + 7; - s.hash_size = 1 << s.hash_bits; - s.hash_mask = s.hash_size - 1; - s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); - - s.window = new utils.Buf8(s.w_size * 2); - s.head = new utils.Buf16(s.hash_size); - s.prev = new utils.Buf16(s.w_size); - - // Don't need mem init magic for JS. - //s.high_water = 0; /* nothing written to s->window yet */ - - s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ - - s.pending_buf_size = s.lit_bufsize * 4; - - //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); - //s->pending_buf = (uchf *) overlay; - s.pending_buf = new utils.Buf8(s.pending_buf_size); - - // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`) - //s->d_buf = overlay + s->lit_bufsize/sizeof(ush); - s.d_buf = 1 * s.lit_bufsize; - - //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; - s.l_buf = (1 + 2) * s.lit_bufsize; - - s.level = level; - s.strategy = strategy; - s.method = method; - - return deflateReset(strm); -} - -function deflateInit(strm, level) { - return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); -} - - -function deflate(strm, flush) { - var old_flush, s; - var beg, val; // for gzip header write only - - if (!strm || !strm.state || - flush > Z_BLOCK || flush < 0) { - return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR; - } - - s = strm.state; - - if (!strm.output || - (!strm.input && strm.avail_in !== 0) || - (s.status === FINISH_STATE && flush !== Z_FINISH)) { - return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR); - } - - s.strm = strm; /* just in case */ - old_flush = s.last_flush; - s.last_flush = flush; - - /* Write the header */ - if (s.status === INIT_STATE) { - - if (s.wrap === 2) { // GZIP header - strm.adler = 0; //crc32(0L, Z_NULL, 0); - put_byte(s, 31); - put_byte(s, 139); - put_byte(s, 8); - if (!s.gzhead) { // s->gzhead == Z_NULL - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, s.level === 9 ? 2 : - (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? - 4 : 0)); - put_byte(s, OS_CODE); - s.status = BUSY_STATE; - } - else { - put_byte(s, (s.gzhead.text ? 1 : 0) + - (s.gzhead.hcrc ? 2 : 0) + - (!s.gzhead.extra ? 0 : 4) + - (!s.gzhead.name ? 0 : 8) + - (!s.gzhead.comment ? 0 : 16) - ); - put_byte(s, s.gzhead.time & 0xff); - put_byte(s, (s.gzhead.time >> 8) & 0xff); - put_byte(s, (s.gzhead.time >> 16) & 0xff); - put_byte(s, (s.gzhead.time >> 24) & 0xff); - put_byte(s, s.level === 9 ? 2 : - (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? - 4 : 0)); - put_byte(s, s.gzhead.os & 0xff); - if (s.gzhead.extra && s.gzhead.extra.length) { - put_byte(s, s.gzhead.extra.length & 0xff); - put_byte(s, (s.gzhead.extra.length >> 8) & 0xff); - } - if (s.gzhead.hcrc) { - strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0); - } - s.gzindex = 0; - s.status = EXTRA_STATE; - } - } - else // DEFLATE header - { - var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8; - var level_flags = -1; - - if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { - level_flags = 0; - } else if (s.level < 6) { - level_flags = 1; - } else if (s.level === 6) { - level_flags = 2; - } else { - level_flags = 3; - } - header |= (level_flags << 6); - if (s.strstart !== 0) { header |= PRESET_DICT; } - header += 31 - (header % 31); - - s.status = BUSY_STATE; - putShortMSB(s, header); - - /* Save the adler32 of the preset dictionary: */ - if (s.strstart !== 0) { - putShortMSB(s, strm.adler >>> 16); - putShortMSB(s, strm.adler & 0xffff); - } - strm.adler = 1; // adler32(0L, Z_NULL, 0); - } - } - -//#ifdef GZIP - if (s.status === EXTRA_STATE) { - if (s.gzhead.extra/* != Z_NULL*/) { - beg = s.pending; /* start of bytes to update crc */ - - while (s.gzindex < (s.gzhead.extra.length & 0xffff)) { - if (s.pending === s.pending_buf_size) { - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); - } - flush_pending(strm); - beg = s.pending; - if (s.pending === s.pending_buf_size) { - break; - } - } - put_byte(s, s.gzhead.extra[s.gzindex] & 0xff); - s.gzindex++; - } - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); - } - if (s.gzindex === s.gzhead.extra.length) { - s.gzindex = 0; - s.status = NAME_STATE; - } - } - else { - s.status = NAME_STATE; - } - } - if (s.status === NAME_STATE) { - if (s.gzhead.name/* != Z_NULL*/) { - beg = s.pending; /* start of bytes to update crc */ - //int val; - - do { - if (s.pending === s.pending_buf_size) { - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); - } - flush_pending(strm); - beg = s.pending; - if (s.pending === s.pending_buf_size) { - val = 1; - break; - } - } - // JS specific: little magic to add zero terminator to end of string - if (s.gzindex < s.gzhead.name.length) { - val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff; - } else { - val = 0; - } - put_byte(s, val); - } while (val !== 0); - - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); - } - if (val === 0) { - s.gzindex = 0; - s.status = COMMENT_STATE; - } - } - else { - s.status = COMMENT_STATE; - } - } - if (s.status === COMMENT_STATE) { - if (s.gzhead.comment/* != Z_NULL*/) { - beg = s.pending; /* start of bytes to update crc */ - //int val; - - do { - if (s.pending === s.pending_buf_size) { - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); - } - flush_pending(strm); - beg = s.pending; - if (s.pending === s.pending_buf_size) { - val = 1; - break; - } - } - // JS specific: little magic to add zero terminator to end of string - if (s.gzindex < s.gzhead.comment.length) { - val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff; - } else { - val = 0; - } - put_byte(s, val); - } while (val !== 0); - - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); - } - if (val === 0) { - s.status = HCRC_STATE; - } - } - else { - s.status = HCRC_STATE; - } - } - if (s.status === HCRC_STATE) { - if (s.gzhead.hcrc) { - if (s.pending + 2 > s.pending_buf_size) { - flush_pending(strm); - } - if (s.pending + 2 <= s.pending_buf_size) { - put_byte(s, strm.adler & 0xff); - put_byte(s, (strm.adler >> 8) & 0xff); - strm.adler = 0; //crc32(0L, Z_NULL, 0); - s.status = BUSY_STATE; - } - } - else { - s.status = BUSY_STATE; - } - } -//#endif - - /* Flush as much pending output as possible */ - if (s.pending !== 0) { - flush_pending(strm); - if (strm.avail_out === 0) { - /* Since avail_out is 0, deflate will be called again with - * more output space, but possibly with both pending and - * avail_in equal to zero. There won't be anything to do, - * but this is not an error situation so make sure we - * return OK instead of BUF_ERROR at next call of deflate: - */ - s.last_flush = -1; - return Z_OK; - } - - /* Make sure there is something to do and avoid duplicate consecutive - * flushes. For repeated and useless calls with Z_FINISH, we keep - * returning Z_STREAM_END instead of Z_BUF_ERROR. - */ - } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && - flush !== Z_FINISH) { - return err(strm, Z_BUF_ERROR); - } - - /* User must not provide more input after the first FINISH: */ - if (s.status === FINISH_STATE && strm.avail_in !== 0) { - return err(strm, Z_BUF_ERROR); - } - - /* Start a new block or continue the current one. - */ - if (strm.avail_in !== 0 || s.lookahead !== 0 || - (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) { - var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) : - (s.strategy === Z_RLE ? deflate_rle(s, flush) : - configuration_table[s.level].func(s, flush)); - - if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) { - s.status = FINISH_STATE; - } - if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) { - if (strm.avail_out === 0) { - s.last_flush = -1; - /* avoid BUF_ERROR next call, see above */ - } - return Z_OK; - /* If flush != Z_NO_FLUSH && avail_out == 0, the next call - * of deflate should use the same flush parameter to make sure - * that the flush is complete. So we don't have to output an - * empty block here, this will be done at next call. This also - * ensures that for a very small output buffer, we emit at most - * one empty block. - */ - } - if (bstate === BS_BLOCK_DONE) { - if (flush === Z_PARTIAL_FLUSH) { - trees._tr_align(s); - } - else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ - - trees._tr_stored_block(s, 0, 0, false); - /* For a full flush, this empty block will be recognized - * as a special marker by inflate_sync(). - */ - if (flush === Z_FULL_FLUSH) { - /*** CLEAR_HASH(s); ***/ /* forget history */ - zero(s.head); // Fill with NIL (= 0); - - if (s.lookahead === 0) { - s.strstart = 0; - s.block_start = 0; - s.insert = 0; - } - } - } - flush_pending(strm); - if (strm.avail_out === 0) { - s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */ - return Z_OK; - } - } - } - //Assert(strm->avail_out > 0, "bug2"); - //if (strm.avail_out <= 0) { throw new Error("bug2");} - - if (flush !== Z_FINISH) { return Z_OK; } - if (s.wrap <= 0) { return Z_STREAM_END; } - - /* Write the trailer */ - if (s.wrap === 2) { - put_byte(s, strm.adler & 0xff); - put_byte(s, (strm.adler >> 8) & 0xff); - put_byte(s, (strm.adler >> 16) & 0xff); - put_byte(s, (strm.adler >> 24) & 0xff); - put_byte(s, strm.total_in & 0xff); - put_byte(s, (strm.total_in >> 8) & 0xff); - put_byte(s, (strm.total_in >> 16) & 0xff); - put_byte(s, (strm.total_in >> 24) & 0xff); - } - else - { - putShortMSB(s, strm.adler >>> 16); - putShortMSB(s, strm.adler & 0xffff); - } - - flush_pending(strm); - /* If avail_out is zero, the application will call deflate again - * to flush the rest. - */ - if (s.wrap > 0) { s.wrap = -s.wrap; } - /* write the trailer only once! */ - return s.pending !== 0 ? Z_OK : Z_STREAM_END; -} - -function deflateEnd(strm) { - var status; - - if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { - return Z_STREAM_ERROR; - } - - status = strm.state.status; - if (status !== INIT_STATE && - status !== EXTRA_STATE && - status !== NAME_STATE && - status !== COMMENT_STATE && - status !== HCRC_STATE && - status !== BUSY_STATE && - status !== FINISH_STATE - ) { - return err(strm, Z_STREAM_ERROR); - } - - strm.state = null; - - return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; -} - - -/* ========================================================================= - * Initializes the compression dictionary from the given byte - * sequence without producing any compressed output. - */ -function deflateSetDictionary(strm, dictionary) { - var dictLength = dictionary.length; - - var s; - var str, n; - var wrap; - var avail; - var next; - var input; - var tmpDict; - - if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { - return Z_STREAM_ERROR; - } - - s = strm.state; - wrap = s.wrap; - - if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) { - return Z_STREAM_ERROR; - } - - /* when using zlib wrappers, compute Adler-32 for provided dictionary */ - if (wrap === 1) { - /* adler32(strm->adler, dictionary, dictLength); */ - strm.adler = adler32(strm.adler, dictionary, dictLength, 0); - } - - s.wrap = 0; /* avoid computing Adler-32 in read_buf */ - - /* if dictionary would fill window, just replace the history */ - if (dictLength >= s.w_size) { - if (wrap === 0) { /* already empty otherwise */ - /*** CLEAR_HASH(s); ***/ - zero(s.head); // Fill with NIL (= 0); - s.strstart = 0; - s.block_start = 0; - s.insert = 0; - } - /* use the tail */ - // dictionary = dictionary.slice(dictLength - s.w_size); - tmpDict = new utils.Buf8(s.w_size); - utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0); - dictionary = tmpDict; - dictLength = s.w_size; - } - /* insert dictionary into window and hash */ - avail = strm.avail_in; - next = strm.next_in; - input = strm.input; - strm.avail_in = dictLength; - strm.next_in = 0; - strm.input = dictionary; - fill_window(s); - while (s.lookahead >= MIN_MATCH) { - str = s.strstart; - n = s.lookahead - (MIN_MATCH - 1); - do { - /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; - - s.prev[str & s.w_mask] = s.head[s.ins_h]; - - s.head[s.ins_h] = str; - str++; - } while (--n); - s.strstart = str; - s.lookahead = MIN_MATCH - 1; - fill_window(s); - } - s.strstart += s.lookahead; - s.block_start = s.strstart; - s.insert = s.lookahead; - s.lookahead = 0; - s.match_length = s.prev_length = MIN_MATCH - 1; - s.match_available = 0; - strm.next_in = next; - strm.input = input; - strm.avail_in = avail; - s.wrap = wrap; - return Z_OK; -} - - -exports.deflateInit = deflateInit; -exports.deflateInit2 = deflateInit2; -exports.deflateReset = deflateReset; -exports.deflateResetKeep = deflateResetKeep; -exports.deflateSetHeader = deflateSetHeader; -exports.deflate = deflate; -exports.deflateEnd = deflateEnd; -exports.deflateSetDictionary = deflateSetDictionary; -exports.deflateInfo = 'pako deflate (from Nodeca project)'; - -/* Not implemented -exports.deflateBound = deflateBound; -exports.deflateCopy = deflateCopy; -exports.deflateParams = deflateParams; -exports.deflatePending = deflatePending; -exports.deflatePrime = deflatePrime; -exports.deflateTune = deflateTune; -*/ - -},{"../utils/common":1,"./adler32":3,"./crc32":4,"./messages":6,"./trees":7}],6:[function(require,module,exports){ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -module.exports = { - 2: 'need dictionary', /* Z_NEED_DICT 2 */ - 1: 'stream end', /* Z_STREAM_END 1 */ - 0: '', /* Z_OK 0 */ - '-1': 'file error', /* Z_ERRNO (-1) */ - '-2': 'stream error', /* Z_STREAM_ERROR (-2) */ - '-3': 'data error', /* Z_DATA_ERROR (-3) */ - '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */ - '-5': 'buffer error', /* Z_BUF_ERROR (-5) */ - '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */ -}; - -},{}],7:[function(require,module,exports){ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -var utils = require('../utils/common'); - -/* Public constants ==========================================================*/ -/* ===========================================================================*/ - - -//var Z_FILTERED = 1; -//var Z_HUFFMAN_ONLY = 2; -//var Z_RLE = 3; -var Z_FIXED = 4; -//var Z_DEFAULT_STRATEGY = 0; - -/* Possible values of the data_type field (though see inflate()) */ -var Z_BINARY = 0; -var Z_TEXT = 1; -//var Z_ASCII = 1; // = Z_TEXT -var Z_UNKNOWN = 2; - -/*============================================================================*/ - - -function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } - -// From zutil.h - -var STORED_BLOCK = 0; -var STATIC_TREES = 1; -var DYN_TREES = 2; -/* The three kinds of block type */ - -var MIN_MATCH = 3; -var MAX_MATCH = 258; -/* The minimum and maximum match lengths */ - -// From deflate.h -/* =========================================================================== - * Internal compression state. - */ - -var LENGTH_CODES = 29; -/* number of length codes, not counting the special END_BLOCK code */ - -var LITERALS = 256; -/* number of literal bytes 0..255 */ - -var L_CODES = LITERALS + 1 + LENGTH_CODES; -/* number of Literal or Length codes, including the END_BLOCK code */ - -var D_CODES = 30; -/* number of distance codes */ - -var BL_CODES = 19; -/* number of codes used to transfer the bit lengths */ - -var HEAP_SIZE = 2 * L_CODES + 1; -/* maximum heap size */ - -var MAX_BITS = 15; -/* All codes must not exceed MAX_BITS bits */ - -var Buf_size = 16; -/* size of bit buffer in bi_buf */ - - -/* =========================================================================== - * Constants - */ - -var MAX_BL_BITS = 7; -/* Bit length codes must not exceed MAX_BL_BITS bits */ - -var END_BLOCK = 256; -/* end of block literal code */ - -var REP_3_6 = 16; -/* repeat previous bit length 3-6 times (2 bits of repeat count) */ - -var REPZ_3_10 = 17; -/* repeat a zero length 3-10 times (3 bits of repeat count) */ - -var REPZ_11_138 = 18; -/* repeat a zero length 11-138 times (7 bits of repeat count) */ - -/* eslint-disable comma-spacing,array-bracket-spacing */ -var extra_lbits = /* extra bits for each length code */ - [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]; - -var extra_dbits = /* extra bits for each distance code */ - [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]; - -var extra_blbits = /* extra bits for each bit length code */ - [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]; - -var bl_order = - [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]; -/* eslint-enable comma-spacing,array-bracket-spacing */ - -/* The lengths of the bit length codes are sent in order of decreasing - * probability, to avoid transmitting the lengths for unused bit length codes. - */ - -/* =========================================================================== - * Local data. These are initialized only once. - */ - -// We pre-fill arrays with 0 to avoid uninitialized gaps - -var DIST_CODE_LEN = 512; /* see definition of array dist_code below */ - -// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1 -var static_ltree = new Array((L_CODES + 2) * 2); -zero(static_ltree); -/* The static literal tree. Since the bit lengths are imposed, there is no - * need for the L_CODES extra codes used during heap construction. However - * The codes 286 and 287 are needed to build a canonical tree (see _tr_init - * below). - */ - -var static_dtree = new Array(D_CODES * 2); -zero(static_dtree); -/* The static distance tree. (Actually a trivial tree since all codes use - * 5 bits.) - */ - -var _dist_code = new Array(DIST_CODE_LEN); -zero(_dist_code); -/* Distance codes. The first 256 values correspond to the distances - * 3 .. 258, the last 256 values correspond to the top 8 bits of - * the 15 bit distances. - */ - -var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); -zero(_length_code); -/* length code for each normalized match length (0 == MIN_MATCH) */ - -var base_length = new Array(LENGTH_CODES); -zero(base_length); -/* First normalized length for each code (0 = MIN_MATCH) */ - -var base_dist = new Array(D_CODES); -zero(base_dist); -/* First normalized distance for each code (0 = distance of 1) */ - - -function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) { - - this.static_tree = static_tree; /* static tree or NULL */ - this.extra_bits = extra_bits; /* extra bits for each code or NULL */ - this.extra_base = extra_base; /* base index for extra_bits */ - this.elems = elems; /* max number of elements in the tree */ - this.max_length = max_length; /* max bit length for the codes */ - - // show if `static_tree` has data or dummy - needed for monomorphic objects - this.has_stree = static_tree && static_tree.length; -} - - -var static_l_desc; -var static_d_desc; -var static_bl_desc; - - -function TreeDesc(dyn_tree, stat_desc) { - this.dyn_tree = dyn_tree; /* the dynamic tree */ - this.max_code = 0; /* largest code with non zero frequency */ - this.stat_desc = stat_desc; /* the corresponding static tree */ -} - - - -function d_code(dist) { - return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)]; -} - - -/* =========================================================================== - * Output a short LSB first on the stream. - * IN assertion: there is enough room in pendingBuf. - */ -function put_short(s, w) { -// put_byte(s, (uch)((w) & 0xff)); -// put_byte(s, (uch)((ush)(w) >> 8)); - s.pending_buf[s.pending++] = (w) & 0xff; - s.pending_buf[s.pending++] = (w >>> 8) & 0xff; -} - - -/* =========================================================================== - * Send a value on a given number of bits. - * IN assertion: length <= 16 and value fits in length bits. - */ -function send_bits(s, value, length) { - if (s.bi_valid > (Buf_size - length)) { - s.bi_buf |= (value << s.bi_valid) & 0xffff; - put_short(s, s.bi_buf); - s.bi_buf = value >> (Buf_size - s.bi_valid); - s.bi_valid += length - Buf_size; - } else { - s.bi_buf |= (value << s.bi_valid) & 0xffff; - s.bi_valid += length; - } -} - - -function send_code(s, c, tree) { - send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/); -} - - -/* =========================================================================== - * Reverse the first len bits of a code, using straightforward code (a faster - * method would use a table) - * IN assertion: 1 <= len <= 15 - */ -function bi_reverse(code, len) { - var res = 0; - do { - res |= code & 1; - code >>>= 1; - res <<= 1; - } while (--len > 0); - return res >>> 1; -} - - -/* =========================================================================== - * Flush the bit buffer, keeping at most 7 bits in it. - */ -function bi_flush(s) { - if (s.bi_valid === 16) { - put_short(s, s.bi_buf); - s.bi_buf = 0; - s.bi_valid = 0; - - } else if (s.bi_valid >= 8) { - s.pending_buf[s.pending++] = s.bi_buf & 0xff; - s.bi_buf >>= 8; - s.bi_valid -= 8; - } -} - - -/* =========================================================================== - * Compute the optimal bit lengths for a tree and update the total bit length - * for the current block. - * IN assertion: the fields freq and dad are set, heap[heap_max] and - * above are the tree nodes sorted by increasing frequency. - * OUT assertions: the field len is set to the optimal bit length, the - * array bl_count contains the frequencies for each bit length. - * The length opt_len is updated; static_len is also updated if stree is - * not null. - */ -function gen_bitlen(s, desc) -// deflate_state *s; -// tree_desc *desc; /* the tree descriptor */ -{ - var tree = desc.dyn_tree; - var max_code = desc.max_code; - var stree = desc.stat_desc.static_tree; - var has_stree = desc.stat_desc.has_stree; - var extra = desc.stat_desc.extra_bits; - var base = desc.stat_desc.extra_base; - var max_length = desc.stat_desc.max_length; - var h; /* heap index */ - var n, m; /* iterate over the tree elements */ - var bits; /* bit length */ - var xbits; /* extra bits */ - var f; /* frequency */ - var overflow = 0; /* number of elements with bit length too large */ - - for (bits = 0; bits <= MAX_BITS; bits++) { - s.bl_count[bits] = 0; - } - - /* In a first pass, compute the optimal bit lengths (which may - * overflow in the case of the bit length tree). - */ - tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */ - - for (h = s.heap_max + 1; h < HEAP_SIZE; h++) { - n = s.heap[h]; - bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1; - if (bits > max_length) { - bits = max_length; - overflow++; - } - tree[n * 2 + 1]/*.Len*/ = bits; - /* We overwrite tree[n].Dad which is no longer needed */ - - if (n > max_code) { continue; } /* not a leaf node */ - - s.bl_count[bits]++; - xbits = 0; - if (n >= base) { - xbits = extra[n - base]; - } - f = tree[n * 2]/*.Freq*/; - s.opt_len += f * (bits + xbits); - if (has_stree) { - s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits); - } - } - if (overflow === 0) { return; } - - // Trace((stderr,"\nbit length overflow\n")); - /* This happens for example on obj2 and pic of the Calgary corpus */ - - /* Find the first bit length which could increase: */ - do { - bits = max_length - 1; - while (s.bl_count[bits] === 0) { bits--; } - s.bl_count[bits]--; /* move one leaf down the tree */ - s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */ - s.bl_count[max_length]--; - /* The brother of the overflow item also moves one step up, - * but this does not affect bl_count[max_length] - */ - overflow -= 2; - } while (overflow > 0); - - /* Now recompute all bit lengths, scanning in increasing frequency. - * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all - * lengths instead of fixing only the wrong ones. This idea is taken - * from 'ar' written by Haruhiko Okumura.) - */ - for (bits = max_length; bits !== 0; bits--) { - n = s.bl_count[bits]; - while (n !== 0) { - m = s.heap[--h]; - if (m > max_code) { continue; } - if (tree[m * 2 + 1]/*.Len*/ !== bits) { - // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); - s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/; - tree[m * 2 + 1]/*.Len*/ = bits; - } - n--; - } - } -} - - -/* =========================================================================== - * Generate the codes for a given tree and bit counts (which need not be - * optimal). - * IN assertion: the array bl_count contains the bit length statistics for - * the given tree and the field len is set for all tree elements. - * OUT assertion: the field code is set for all tree elements of non - * zero code length. - */ -function gen_codes(tree, max_code, bl_count) -// ct_data *tree; /* the tree to decorate */ -// int max_code; /* largest code with non zero frequency */ -// ushf *bl_count; /* number of codes at each bit length */ -{ - var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */ - var code = 0; /* running code value */ - var bits; /* bit index */ - var n; /* code index */ - - /* The distribution counts are first used to generate the code values - * without bit reversal. - */ - for (bits = 1; bits <= MAX_BITS; bits++) { - next_code[bits] = code = (code + bl_count[bits - 1]) << 1; - } - /* Check that the bit counts in bl_count are consistent. The last code - * must be all ones. - */ - //Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */ - length = 0; - for (code = 0; code < LENGTH_CODES - 1; code++) { - base_length[code] = length; - for (n = 0; n < (1 << extra_lbits[code]); n++) { - _length_code[length++] = code; - } - } - //Assert (length == 256, "tr_static_init: length != 256"); - /* Note that the length 255 (match length 258) can be represented - * in two different ways: code 284 + 5 bits or code 285, so we - * overwrite length_code[255] to use the best encoding: - */ - _length_code[length - 1] = code; - - /* Initialize the mapping dist (0..32K) -> dist code (0..29) */ - dist = 0; - for (code = 0; code < 16; code++) { - base_dist[code] = dist; - for (n = 0; n < (1 << extra_dbits[code]); n++) { - _dist_code[dist++] = code; - } - } - //Assert (dist == 256, "tr_static_init: dist != 256"); - dist >>= 7; /* from now on, all distances are divided by 128 */ - for (; code < D_CODES; code++) { - base_dist[code] = dist << 7; - for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) { - _dist_code[256 + dist++] = code; - } - } - //Assert (dist == 256, "tr_static_init: 256+dist != 512"); - - /* Construct the codes of the static literal tree */ - for (bits = 0; bits <= MAX_BITS; bits++) { - bl_count[bits] = 0; - } - - n = 0; - while (n <= 143) { - static_ltree[n * 2 + 1]/*.Len*/ = 8; - n++; - bl_count[8]++; - } - while (n <= 255) { - static_ltree[n * 2 + 1]/*.Len*/ = 9; - n++; - bl_count[9]++; - } - while (n <= 279) { - static_ltree[n * 2 + 1]/*.Len*/ = 7; - n++; - bl_count[7]++; - } - while (n <= 287) { - static_ltree[n * 2 + 1]/*.Len*/ = 8; - n++; - bl_count[8]++; - } - /* Codes 286 and 287 do not exist, but we must include them in the - * tree construction to get a canonical Huffman tree (longest code - * all ones) - */ - gen_codes(static_ltree, L_CODES + 1, bl_count); - - /* The static distance tree is trivial: */ - for (n = 0; n < D_CODES; n++) { - static_dtree[n * 2 + 1]/*.Len*/ = 5; - static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5); - } - - // Now data ready and we can init static trees - static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); - static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); - static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); - - //static_init_done = true; -} - - -/* =========================================================================== - * Initialize a new block. - */ -function init_block(s) { - var n; /* iterates over tree elements */ - - /* Initialize the trees. */ - for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; } - for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; } - for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; } - - s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1; - s.opt_len = s.static_len = 0; - s.last_lit = s.matches = 0; -} - - -/* =========================================================================== - * Flush the bit buffer and align the output on a byte boundary - */ -function bi_windup(s) -{ - if (s.bi_valid > 8) { - put_short(s, s.bi_buf); - } else if (s.bi_valid > 0) { - //put_byte(s, (Byte)s->bi_buf); - s.pending_buf[s.pending++] = s.bi_buf; - } - s.bi_buf = 0; - s.bi_valid = 0; -} - -/* =========================================================================== - * Copy a stored block, storing first the length and its - * one's complement if requested. - */ -function copy_block(s, buf, len, header) -//DeflateState *s; -//charf *buf; /* the input data */ -//unsigned len; /* its length */ -//int header; /* true if block header must be written */ -{ - bi_windup(s); /* align on byte boundary */ - - if (header) { - put_short(s, len); - put_short(s, ~len); - } -// while (len--) { -// put_byte(s, *buf++); -// } - utils.arraySet(s.pending_buf, s.window, buf, len, s.pending); - s.pending += len; -} - -/* =========================================================================== - * Compares to subtrees, using the tree depth as tie breaker when - * the subtrees have equal frequency. This minimizes the worst case length. - */ -function smaller(tree, n, m, depth) { - var _n2 = n * 2; - var _m2 = m * 2; - return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ || - (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m])); -} - -/* =========================================================================== - * Restore the heap property by moving down the tree starting at node k, - * exchanging a node with the smallest of its two sons if necessary, stopping - * when the heap property is re-established (each father smaller than its - * two sons). - */ -function pqdownheap(s, tree, k) -// deflate_state *s; -// ct_data *tree; /* the tree to restore */ -// int k; /* node to move down */ -{ - var v = s.heap[k]; - var j = k << 1; /* left son of k */ - while (j <= s.heap_len) { - /* Set j to the smallest of the two sons: */ - if (j < s.heap_len && - smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) { - j++; - } - /* Exit if v is smaller than both sons */ - if (smaller(tree, v, s.heap[j], s.depth)) { break; } - - /* Exchange v with the smallest son */ - s.heap[k] = s.heap[j]; - k = j; - - /* And continue down the tree, setting j to the left son of k */ - j <<= 1; - } - s.heap[k] = v; -} - - -// inlined manually -// var SMALLEST = 1; - -/* =========================================================================== - * Send the block data compressed using the given Huffman trees - */ -function compress_block(s, ltree, dtree) -// deflate_state *s; -// const ct_data *ltree; /* literal tree */ -// const ct_data *dtree; /* distance tree */ -{ - var dist; /* distance of matched string */ - var lc; /* match length or unmatched char (if dist == 0) */ - var lx = 0; /* running index in l_buf */ - var code; /* the code to send */ - var extra; /* number of extra bits to send */ - - if (s.last_lit !== 0) { - do { - dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]); - lc = s.pending_buf[s.l_buf + lx]; - lx++; - - if (dist === 0) { - send_code(s, lc, ltree); /* send a literal byte */ - //Tracecv(isgraph(lc), (stderr," '%c' ", lc)); - } else { - /* Here, lc is the match length - MIN_MATCH */ - code = _length_code[lc]; - send_code(s, code + LITERALS + 1, ltree); /* send the length code */ - extra = extra_lbits[code]; - if (extra !== 0) { - lc -= base_length[code]; - send_bits(s, lc, extra); /* send the extra length bits */ - } - dist--; /* dist is now the match distance - 1 */ - code = d_code(dist); - //Assert (code < D_CODES, "bad d_code"); - - send_code(s, code, dtree); /* send the distance code */ - extra = extra_dbits[code]; - if (extra !== 0) { - dist -= base_dist[code]; - send_bits(s, dist, extra); /* send the extra distance bits */ - } - } /* literal or match pair ? */ - - /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ - //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx, - // "pendingBuf overflow"); - - } while (lx < s.last_lit); - } - - send_code(s, END_BLOCK, ltree); -} - - -/* =========================================================================== - * Construct one Huffman tree and assigns the code bit strings and lengths. - * Update the total bit length for the current block. - * IN assertion: the field freq is set for all tree elements. - * OUT assertions: the fields len and code are set to the optimal bit length - * and corresponding code. The length opt_len is updated; static_len is - * also updated if stree is not null. The field max_code is set. - */ -function build_tree(s, desc) -// deflate_state *s; -// tree_desc *desc; /* the tree descriptor */ -{ - var tree = desc.dyn_tree; - var stree = desc.stat_desc.static_tree; - var has_stree = desc.stat_desc.has_stree; - var elems = desc.stat_desc.elems; - var n, m; /* iterate over heap elements */ - var max_code = -1; /* largest code with non zero frequency */ - var node; /* new node being created */ - - /* Construct the initial heap, with least frequent element in - * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. - * heap[0] is not used. - */ - s.heap_len = 0; - s.heap_max = HEAP_SIZE; - - for (n = 0; n < elems; n++) { - if (tree[n * 2]/*.Freq*/ !== 0) { - s.heap[++s.heap_len] = max_code = n; - s.depth[n] = 0; - - } else { - tree[n * 2 + 1]/*.Len*/ = 0; - } - } - - /* The pkzip format requires that at least one distance code exists, - * and that at least one bit should be sent even if there is only one - * possible code. So to avoid special checks later on we force at least - * two codes of non zero frequency. - */ - while (s.heap_len < 2) { - node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0); - tree[node * 2]/*.Freq*/ = 1; - s.depth[node] = 0; - s.opt_len--; - - if (has_stree) { - s.static_len -= stree[node * 2 + 1]/*.Len*/; - } - /* node is 0 or 1 so it does not have extra bits */ - } - desc.max_code = max_code; - - /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, - * establish sub-heaps of increasing lengths: - */ - for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); } - - /* Construct the Huffman tree by repeatedly combining the least two - * frequent nodes. - */ - node = elems; /* next internal node of the tree */ - do { - //pqremove(s, tree, n); /* n = node of least frequency */ - /*** pqremove ***/ - n = s.heap[1/*SMALLEST*/]; - s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--]; - pqdownheap(s, tree, 1/*SMALLEST*/); - /***/ - - m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */ - - s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */ - s.heap[--s.heap_max] = m; - - /* Create a new node father of n and m */ - tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/; - s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1; - tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node; - - /* and insert the new node in the heap */ - s.heap[1/*SMALLEST*/] = node++; - pqdownheap(s, tree, 1/*SMALLEST*/); - - } while (s.heap_len >= 2); - - s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/]; - - /* At this point, the fields freq and dad are set. We can now - * generate the bit lengths. - */ - gen_bitlen(s, desc); - - /* The field len is now set, we can generate the bit codes */ - gen_codes(tree, max_code, s.bl_count); -} - - -/* =========================================================================== - * Scan a literal or distance tree to determine the frequencies of the codes - * in the bit length tree. - */ -function scan_tree(s, tree, max_code) -// deflate_state *s; -// ct_data *tree; /* the tree to be scanned */ -// int max_code; /* and its largest code of non zero frequency */ -{ - var n; /* iterates over all tree elements */ - var prevlen = -1; /* last emitted length */ - var curlen; /* length of current code */ - - var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */ - - var count = 0; /* repeat count of the current code */ - var max_count = 7; /* max repeat count */ - var min_count = 4; /* min repeat count */ - - if (nextlen === 0) { - max_count = 138; - min_count = 3; - } - tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */ - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; - nextlen = tree[(n + 1) * 2 + 1]/*.Len*/; - - if (++count < max_count && curlen === nextlen) { - continue; - - } else if (count < min_count) { - s.bl_tree[curlen * 2]/*.Freq*/ += count; - - } else if (curlen !== 0) { - - if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; } - s.bl_tree[REP_3_6 * 2]/*.Freq*/++; - - } else if (count <= 10) { - s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++; - - } else { - s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++; - } - - count = 0; - prevlen = curlen; - - if (nextlen === 0) { - max_count = 138; - min_count = 3; - - } else if (curlen === nextlen) { - max_count = 6; - min_count = 3; - - } else { - max_count = 7; - min_count = 4; - } - } -} - - -/* =========================================================================== - * Send a literal or distance tree in compressed form, using the codes in - * bl_tree. - */ -function send_tree(s, tree, max_code) -// deflate_state *s; -// ct_data *tree; /* the tree to be scanned */ -// int max_code; /* and its largest code of non zero frequency */ -{ - var n; /* iterates over all tree elements */ - var prevlen = -1; /* last emitted length */ - var curlen; /* length of current code */ - - var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */ - - var count = 0; /* repeat count of the current code */ - var max_count = 7; /* max repeat count */ - var min_count = 4; /* min repeat count */ - - /* tree[max_code+1].Len = -1; */ /* guard already set */ - if (nextlen === 0) { - max_count = 138; - min_count = 3; - } - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; - nextlen = tree[(n + 1) * 2 + 1]/*.Len*/; - - if (++count < max_count && curlen === nextlen) { - continue; - - } else if (count < min_count) { - do { send_code(s, curlen, s.bl_tree); } while (--count !== 0); - - } else if (curlen !== 0) { - if (curlen !== prevlen) { - send_code(s, curlen, s.bl_tree); - count--; - } - //Assert(count >= 3 && count <= 6, " 3_6?"); - send_code(s, REP_3_6, s.bl_tree); - send_bits(s, count - 3, 2); - - } else if (count <= 10) { - send_code(s, REPZ_3_10, s.bl_tree); - send_bits(s, count - 3, 3); - - } else { - send_code(s, REPZ_11_138, s.bl_tree); - send_bits(s, count - 11, 7); - } - - count = 0; - prevlen = curlen; - if (nextlen === 0) { - max_count = 138; - min_count = 3; - - } else if (curlen === nextlen) { - max_count = 6; - min_count = 3; - - } else { - max_count = 7; - min_count = 4; - } - } -} - - -/* =========================================================================== - * Construct the Huffman tree for the bit lengths and return the index in - * bl_order of the last bit length code to send. - */ -function build_bl_tree(s) { - var max_blindex; /* index of last bit length code of non zero freq */ - - /* Determine the bit length frequencies for literal and distance trees */ - scan_tree(s, s.dyn_ltree, s.l_desc.max_code); - scan_tree(s, s.dyn_dtree, s.d_desc.max_code); - - /* Build the bit length tree: */ - build_tree(s, s.bl_desc); - /* opt_len now includes the length of the tree representations, except - * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. - */ - - /* Determine the number of bit length codes to send. The pkzip format - * requires that at least 4 bit length codes be sent. (appnote.txt says - * 3 but the actual value used is 4.) - */ - for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { - if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) { - break; - } - } - /* Update opt_len to include the bit length tree and counts */ - s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; - //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", - // s->opt_len, s->static_len)); - - return max_blindex; -} - - -/* =========================================================================== - * Send the header for a block using dynamic Huffman trees: the counts, the - * lengths of the bit length codes, the literal tree and the distance tree. - * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. - */ -function send_all_trees(s, lcodes, dcodes, blcodes) -// deflate_state *s; -// int lcodes, dcodes, blcodes; /* number of codes for each tree */ -{ - var rank; /* index in bl_order */ - - //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); - //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, - // "too many codes"); - //Tracev((stderr, "\nbl counts: ")); - send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */ - send_bits(s, dcodes - 1, 5); - send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */ - for (rank = 0; rank < blcodes; rank++) { - //Tracev((stderr, "\nbl code %2d ", bl_order[rank])); - send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3); - } - //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); - - send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */ - //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); - - send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */ - //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); -} - - -/* =========================================================================== - * Check if the data type is TEXT or BINARY, using the following algorithm: - * - TEXT if the two conditions below are satisfied: - * a) There are no non-portable control characters belonging to the - * "black list" (0..6, 14..25, 28..31). - * b) There is at least one printable character belonging to the - * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). - * - BINARY otherwise. - * - The following partially-portable control characters form a - * "gray list" that is ignored in this detection algorithm: - * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). - * IN assertion: the fields Freq of dyn_ltree are set. - */ -function detect_data_type(s) { - /* black_mask is the bit mask of black-listed bytes - * set bits 0..6, 14..25, and 28..31 - * 0xf3ffc07f = binary 11110011111111111100000001111111 - */ - var black_mask = 0xf3ffc07f; - var n; - - /* Check for non-textual ("black-listed") bytes. */ - for (n = 0; n <= 31; n++, black_mask >>>= 1) { - if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) { - return Z_BINARY; - } - } - - /* Check for textual ("white-listed") bytes. */ - if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 || - s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) { - return Z_TEXT; - } - for (n = 32; n < LITERALS; n++) { - if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) { - return Z_TEXT; - } - } - - /* There are no "black-listed" or "white-listed" bytes: - * this stream either is empty or has tolerated ("gray-listed") bytes only. - */ - return Z_BINARY; -} - - -var static_init_done = false; - -/* =========================================================================== - * Initialize the tree data structures for a new zlib stream. - */ -function _tr_init(s) -{ - - if (!static_init_done) { - tr_static_init(); - static_init_done = true; - } - - s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc); - s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc); - s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc); - - s.bi_buf = 0; - s.bi_valid = 0; - - /* Initialize the first block of the first file: */ - init_block(s); -} - - -/* =========================================================================== - * Send a stored block - */ -function _tr_stored_block(s, buf, stored_len, last) -//DeflateState *s; -//charf *buf; /* input block */ -//ulg stored_len; /* length of input block */ -//int last; /* one if this is the last block for a file */ -{ - send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */ - copy_block(s, buf, stored_len, true); /* with header */ -} - - -/* =========================================================================== - * Send one empty static block to give enough lookahead for inflate. - * This takes 10 bits, of which 7 may remain in the bit buffer. - */ -function _tr_align(s) { - send_bits(s, STATIC_TREES << 1, 3); - send_code(s, END_BLOCK, static_ltree); - bi_flush(s); -} - - -/* =========================================================================== - * Determine the best encoding for the current block: dynamic trees, static - * trees or store, and output the encoded block to the zip file. - */ -function _tr_flush_block(s, buf, stored_len, last) -//DeflateState *s; -//charf *buf; /* input block, or NULL if too old */ -//ulg stored_len; /* length of input block */ -//int last; /* one if this is the last block for a file */ -{ - var opt_lenb, static_lenb; /* opt_len and static_len in bytes */ - var max_blindex = 0; /* index of last bit length code of non zero freq */ - - /* Build the Huffman trees unless a stored block is forced */ - if (s.level > 0) { - - /* Check if the file is binary or text */ - if (s.strm.data_type === Z_UNKNOWN) { - s.strm.data_type = detect_data_type(s); - } - - /* Construct the literal and distance trees */ - build_tree(s, s.l_desc); - // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len, - // s->static_len)); - - build_tree(s, s.d_desc); - // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len, - // s->static_len)); - /* At this point, opt_len and static_len are the total bit lengths of - * the compressed block data, excluding the tree representations. - */ - - /* Build the bit length tree for the above two trees, and get the index - * in bl_order of the last bit length code to send. - */ - max_blindex = build_bl_tree(s); - - /* Determine the best encoding. Compute the block lengths in bytes. */ - opt_lenb = (s.opt_len + 3 + 7) >>> 3; - static_lenb = (s.static_len + 3 + 7) >>> 3; - - // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", - // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, - // s->last_lit)); - - if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; } - - } else { - // Assert(buf != (char*)0, "lost buf"); - opt_lenb = static_lenb = stored_len + 5; /* force a stored block */ - } - - if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) { - /* 4: two words for the lengths */ - - /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. - * Otherwise we can't have processed more than WSIZE input bytes since - * the last block flush, because compression would have been - * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to - * transform a block into a stored block. - */ - _tr_stored_block(s, buf, stored_len, last); - - } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { - - send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3); - compress_block(s, static_ltree, static_dtree); - - } else { - send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3); - send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1); - compress_block(s, s.dyn_ltree, s.dyn_dtree); - } - // Assert (s->compressed_len == s->bits_sent, "bad compressed size"); - /* The above check is made mod 2^32, for files larger than 512 MB - * and uLong implemented on 32 bits. - */ - init_block(s); - - if (last) { - bi_windup(s); - } - // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, - // s->compressed_len-7*last)); -} - -/* =========================================================================== - * Save the match info and tally the frequency counts. Return true if - * the current block must be flushed. - */ -function _tr_tally(s, dist, lc) -// deflate_state *s; -// unsigned dist; /* distance of matched string */ -// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ -{ - //var out_length, in_length, dcode; - - s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff; - s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff; - - s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff; - s.last_lit++; - - if (dist === 0) { - /* lc is the unmatched char */ - s.dyn_ltree[lc * 2]/*.Freq*/++; - } else { - s.matches++; - /* Here, lc is the match length - MIN_MATCH */ - dist--; /* dist = match distance - 1 */ - //Assert((ush)dist < (ush)MAX_DIST(s) && - // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && - // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); - - s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++; - s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++; - } - -// (!) This block is disabled in zlib defaults, -// don't enable it for binary compatibility - -//#ifdef TRUNCATE_BLOCK -// /* Try to guess if it is profitable to stop the current block here */ -// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) { -// /* Compute an upper bound for the compressed length */ -// out_length = s.last_lit*8; -// in_length = s.strstart - s.block_start; -// -// for (dcode = 0; dcode < D_CODES; dcode++) { -// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]); -// } -// out_length >>>= 3; -// //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", -// // s->last_lit, in_length, out_length, -// // 100L - out_length*100L/in_length)); -// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) { -// return true; -// } -// } -//#endif - - return (s.last_lit === s.lit_bufsize - 1); - /* We avoid equality with lit_bufsize because of wraparound at 64K - * on 16 bit machines and because stored blocks are restricted to - * 64K-1 bytes. - */ -} - -exports._tr_init = _tr_init; -exports._tr_stored_block = _tr_stored_block; -exports._tr_flush_block = _tr_flush_block; -exports._tr_tally = _tr_tally; -exports._tr_align = _tr_align; - -},{"../utils/common":1}],8:[function(require,module,exports){ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -function ZStream() { - /* next input byte */ - this.input = null; // JS specific, because we have no pointers - this.next_in = 0; - /* number of bytes available at input */ - this.avail_in = 0; - /* total number of input bytes read so far */ - this.total_in = 0; - /* next output byte should be put there */ - this.output = null; // JS specific, because we have no pointers - this.next_out = 0; - /* remaining free space at output */ - this.avail_out = 0; - /* total number of bytes output so far */ - this.total_out = 0; - /* last error message, NULL if no error */ - this.msg = ''/*Z_NULL*/; - /* not visible by applications */ - this.state = null; - /* best guess about the data type: binary or text */ - this.data_type = 2/*Z_UNKNOWN*/; - /* adler32 value of the uncompressed data */ - this.adler = 0; -} - -module.exports = ZStream; - -},{}],"/lib/deflate.js":[function(require,module,exports){ -'use strict'; - - -var zlib_deflate = require('./zlib/deflate'); -var utils = require('./utils/common'); -var strings = require('./utils/strings'); -var msg = require('./zlib/messages'); -var ZStream = require('./zlib/zstream'); - -var toString = Object.prototype.toString; - -/* Public constants ==========================================================*/ -/* ===========================================================================*/ - -var Z_NO_FLUSH = 0; -var Z_FINISH = 4; - -var Z_OK = 0; -var Z_STREAM_END = 1; -var Z_SYNC_FLUSH = 2; - -var Z_DEFAULT_COMPRESSION = -1; - -var Z_DEFAULT_STRATEGY = 0; - -var Z_DEFLATED = 8; - -/* ===========================================================================*/ - - -/** - * class Deflate - * - * Generic JS-style wrapper for zlib calls. If you don't need - * streaming behaviour - use more simple functions: [[deflate]], - * [[deflateRaw]] and [[gzip]]. - **/ - -/* internal - * Deflate.chunks -> Array - * - * Chunks of output data, if [[Deflate#onData]] not overridden. - **/ - -/** - * Deflate.result -> Uint8Array|Array - * - * Compressed result, generated by default [[Deflate#onData]] - * and [[Deflate#onEnd]] handlers. Filled after you push last chunk - * (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you - * push a chunk with explicit flush (call [[Deflate#push]] with - * `Z_SYNC_FLUSH` param). - **/ - -/** - * Deflate.err -> Number - * - * Error code after deflate finished. 0 (Z_OK) on success. - * You will not need it in real life, because deflate errors - * are possible only on wrong options or bad `onData` / `onEnd` - * custom handlers. - **/ - -/** - * Deflate.msg -> String - * - * Error message, if [[Deflate.err]] != 0 - **/ - - -/** - * new Deflate(options) - * - options (Object): zlib deflate options. - * - * Creates new deflator instance with specified params. Throws exception - * on bad params. Supported options: - * - * - `level` - * - `windowBits` - * - `memLevel` - * - `strategy` - * - `dictionary` - * - * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) - * for more information on these. - * - * Additional options, for internal needs: - * - * - `chunkSize` - size of generated data chunks (16K by default) - * - `raw` (Boolean) - do raw deflate - * - `gzip` (Boolean) - create gzip wrapper - * - `to` (String) - if equal to 'string', then result will be "binary string" - * (each char code [0..255]) - * - `header` (Object) - custom header for gzip - * - `text` (Boolean) - true if compressed data believed to be text - * - `time` (Number) - modification time, unix timestamp - * - `os` (Number) - operation system code - * - `extra` (Array) - array of bytes with extra data (max 65536) - * - `name` (String) - file name (binary string) - * - `comment` (String) - comment (binary string) - * - `hcrc` (Boolean) - true if header crc should be added - * - * ##### Example: - * - * ```javascript - * var pako = require('pako') - * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) - * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); - * - * var deflate = new pako.Deflate({ level: 3}); - * - * deflate.push(chunk1, false); - * deflate.push(chunk2, true); // true -> last chunk - * - * if (deflate.err) { throw new Error(deflate.err); } - * - * console.log(deflate.result); - * ``` - **/ -function Deflate(options) { - if (!(this instanceof Deflate)) return new Deflate(options); - - this.options = utils.assign({ - level: Z_DEFAULT_COMPRESSION, - method: Z_DEFLATED, - chunkSize: 16384, - windowBits: 15, - memLevel: 8, - strategy: Z_DEFAULT_STRATEGY, - to: '' - }, options || {}); - - var opt = this.options; - - if (opt.raw && (opt.windowBits > 0)) { - opt.windowBits = -opt.windowBits; - } - - else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) { - opt.windowBits += 16; - } - - this.err = 0; // error code, if happens (0 = Z_OK) - this.msg = ''; // error message - this.ended = false; // used to avoid multiple onEnd() calls - this.chunks = []; // chunks of compressed data - - this.strm = new ZStream(); - this.strm.avail_out = 0; - - var status = zlib_deflate.deflateInit2( - this.strm, - opt.level, - opt.method, - opt.windowBits, - opt.memLevel, - opt.strategy - ); - - if (status !== Z_OK) { - throw new Error(msg[status]); - } - - if (opt.header) { - zlib_deflate.deflateSetHeader(this.strm, opt.header); - } - - if (opt.dictionary) { - var dict; - // Convert data if needed - if (typeof opt.dictionary === 'string') { - // If we need to compress text, change encoding to utf8. - dict = strings.string2buf(opt.dictionary); - } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { - dict = new Uint8Array(opt.dictionary); - } else { - dict = opt.dictionary; - } - - status = zlib_deflate.deflateSetDictionary(this.strm, dict); - - if (status !== Z_OK) { - throw new Error(msg[status]); - } - - this._dict_set = true; - } -} - -/** - * Deflate#push(data[, mode]) -> Boolean - * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be - * converted to utf8 byte sequence. - * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. - * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH. - * - * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with - * new compressed chunks. Returns `true` on success. The last data block must have - * mode Z_FINISH (or `true`). That will flush internal pending buffers and call - * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you - * can use mode Z_SYNC_FLUSH, keeping the compression context. - * - * On fail call [[Deflate#onEnd]] with error code and return false. - * - * We strongly recommend to use `Uint8Array` on input for best speed (output - * array format is detected automatically). Also, don't skip last param and always - * use the same type in your code (boolean or number). That will improve JS speed. - * - * For regular `Array`-s make sure all elements are [0..255]. - * - * ##### Example - * - * ```javascript - * push(chunk, false); // push one of data chunks - * ... - * push(chunk, true); // push last chunk - * ``` - **/ -Deflate.prototype.push = function (data, mode) { - var strm = this.strm; - var chunkSize = this.options.chunkSize; - var status, _mode; - - if (this.ended) { return false; } - - _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH); - - // Convert data if needed - if (typeof data === 'string') { - // If we need to compress text, change encoding to utf8. - strm.input = strings.string2buf(data); - } else if (toString.call(data) === '[object ArrayBuffer]') { - strm.input = new Uint8Array(data); - } else { - strm.input = data; - } - - strm.next_in = 0; - strm.avail_in = strm.input.length; - - do { - if (strm.avail_out === 0) { - strm.output = new utils.Buf8(chunkSize); - strm.next_out = 0; - strm.avail_out = chunkSize; - } - status = zlib_deflate.deflate(strm, _mode); /* no bad return value */ - - if (status !== Z_STREAM_END && status !== Z_OK) { - this.onEnd(status); - this.ended = true; - return false; - } - if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) { - if (this.options.to === 'string') { - this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out))); - } else { - this.onData(utils.shrinkBuf(strm.output, strm.next_out)); - } - } - } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END); - - // Finalize on the last chunk. - if (_mode === Z_FINISH) { - status = zlib_deflate.deflateEnd(this.strm); - this.onEnd(status); - this.ended = true; - return status === Z_OK; - } - - // callback interim results if Z_SYNC_FLUSH. - if (_mode === Z_SYNC_FLUSH) { - this.onEnd(Z_OK); - strm.avail_out = 0; - return true; - } - - return true; -}; - - -/** - * Deflate#onData(chunk) -> Void - * - chunk (Uint8Array|Array|String): output data. Type of array depends - * on js engine support. When string output requested, each chunk - * will be string. - * - * By default, stores data blocks in `chunks[]` property and glue - * those in `onEnd`. Override this handler, if you need another behaviour. - **/ -Deflate.prototype.onData = function (chunk) { - this.chunks.push(chunk); -}; - - -/** - * Deflate#onEnd(status) -> Void - * - status (Number): deflate status. 0 (Z_OK) on success, - * other if not. - * - * Called once after you tell deflate that the input stream is - * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH) - * or if an error happened. By default - join collected chunks, - * free memory and fill `results` / `err` properties. - **/ -Deflate.prototype.onEnd = function (status) { - // On success - join - if (status === Z_OK) { - if (this.options.to === 'string') { - this.result = this.chunks.join(''); - } else { - this.result = utils.flattenChunks(this.chunks); - } - } - this.chunks = []; - this.err = status; - this.msg = this.strm.msg; -}; - - -/** - * deflate(data[, options]) -> Uint8Array|Array|String - * - data (Uint8Array|Array|String): input data to compress. - * - options (Object): zlib deflate options. - * - * Compress `data` with deflate algorithm and `options`. - * - * Supported options are: - * - * - level - * - windowBits - * - memLevel - * - strategy - * - dictionary - * - * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) - * for more information on these. - * - * Sugar (options): - * - * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify - * negative windowBits implicitly. - * - `to` (String) - if equal to 'string', then result will be "binary string" - * (each char code [0..255]) - * - * ##### Example: - * - * ```javascript - * var pako = require('pako') - * , data = Uint8Array([1,2,3,4,5,6,7,8,9]); - * - * console.log(pako.deflate(data)); - * ``` - **/ -function deflate(input, options) { - var deflator = new Deflate(options); - - deflator.push(input, true); - - // That will never happens, if you don't cheat with options :) - if (deflator.err) { throw deflator.msg || msg[deflator.err]; } - - return deflator.result; -} - - -/** - * deflateRaw(data[, options]) -> Uint8Array|Array|String - * - data (Uint8Array|Array|String): input data to compress. - * - options (Object): zlib deflate options. - * - * The same as [[deflate]], but creates raw data, without wrapper - * (header and adler32 crc). - **/ -function deflateRaw(input, options) { - options = options || {}; - options.raw = true; - return deflate(input, options); -} - - -/** - * gzip(data[, options]) -> Uint8Array|Array|String - * - data (Uint8Array|Array|String): input data to compress. - * - options (Object): zlib deflate options. - * - * The same as [[deflate]], but create gzip wrapper instead of - * deflate one. - **/ -function gzip(input, options) { - options = options || {}; - options.gzip = true; - return deflate(input, options); -} - - -exports.Deflate = Deflate; -exports.deflate = deflate; -exports.deflateRaw = deflateRaw; -exports.gzip = gzip; - -},{"./utils/common":1,"./utils/strings":2,"./zlib/deflate":5,"./zlib/messages":6,"./zlib/zstream":8}]},{},[])("/lib/deflate.js") -}); \ No newline at end of file diff --git a/node_modules/pako/dist/pako_deflate.min.js b/node_modules/pako/dist/pako_deflate.min.js deleted file mode 100644 index 56e5c5433..000000000 --- a/node_modules/pako/dist/pako_deflate.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).pako=t()}}(function(){return function t(e,a,n){function r(s,h){if(!a[s]){if(!e[s]){var l="function"==typeof require&&require;if(!h&&l)return l(s,!0);if(i)return i(s,!0);var o=new Error("Cannot find module '"+s+"'");throw o.code="MODULE_NOT_FOUND",o}var _=a[s]={exports:{}};e[s][0].call(_.exports,function(t){var a=e[s][1][t];return r(a||t)},_,_.exports,t,e,a,n)}return a[s].exports}for(var i="function"==typeof require&&require,s=0;s=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1;h[254]=h[254]=1,a.string2buf=function(t){var e,a,n,i,s,h=t.length,l=0;for(i=0;i>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},a.buf2binstring=function(t){return n(t,t.length)},a.binstring2buf=function(t){for(var e=new r.Buf8(t.length),a=0,n=e.length;a4)o[r++]=65533,a+=s-1;else{for(i&=2===s?31:3===s?15:7;s>1&&a1?o[r++]=65533:i<65536?o[r++]=i:(i-=65536,o[r++]=55296|i>>10&1023,o[r++]=56320|1023&i)}return n(o,r)},a.utf8border=function(t,e){var a;for((e=e||t.length)>t.length&&(e=t.length),a=e-1;a>=0&&128==(192&t[a]);)a--;return a<0?e:0===a?e:a+h[t[a]]>e?a:e}},{"./common":1}],3:[function(t,e,a){"use strict";e.exports=function(t,e,a,n){for(var r=65535&t|0,i=t>>>16&65535|0,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16|0}},{}],4:[function(t,e,a){"use strict";var n=function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}();e.exports=function(t,e,a,r){var i=n,s=r+a;t^=-1;for(var h=r;h>>8^i[255&(t^e[h])];return-1^t}},{}],5:[function(t,e,a){"use strict";function n(t,e){return t.msg=S[e],e}function r(t){return(t<<1)-(t>4?9:0)}function i(t){for(var e=t.length;--e>=0;)t[e]=0}function s(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(x.arraySet(t.output,e.pending_buf,e.pending_out,a,t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))}function h(t,e){B._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,s(t.strm)}function l(t,e){t.pending_buf[t.pending++]=e}function o(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function _(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,x.arraySet(e,t.input,t.next_in,r,a),1===t.state.wrap?t.adler=A(t.adler,e,r,a):2===t.state.wrap&&(t.adler=C(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)}function d(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-nt?t.strstart-(t.w_size-nt):0,o=t.window,_=t.w_mask,d=t.prev,u=t.strstart+at,f=o[i+s-1],c=o[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(a=e,o[a+s]===c&&o[a+s-1]===f&&o[a]===o[i]&&o[++a]===o[i+1]){i+=2,a++;do{}while(o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&is){if(t.match_start=e,s=n,n>=h)break;f=o[i+s-1],c=o[i+s]}}}while((e=d[e&_])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead}function u(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-nt)){x.arraySet(t.window,t.window,s,s,0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=_(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=et)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=(t.ins_h<=et&&(t.ins_h=(t.ins_h<=et)if(n=B._tr_tally(t,t.strstart-t.match_start,t.match_length-et),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=et){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<=et&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=et-1)),t.prev_length>=et&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-et,n=B._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-et),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=(t.ins_h<=et&&t.strstart>0&&(r=t.strstart-1,(n=s[r])===s[++r]&&n===s[++r]&&n===s[++r])){i=t.strstart+at;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&rt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=et?(a=B._tr_tally(t,1,t.match_length-et),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=B._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(h(t,!1),0===t.strm.avail_out))return ut}return t.insert=0,e===D?(h(t,!0),0===t.strm.avail_out?ct:pt):t.last_lit&&(h(t,!1),0===t.strm.avail_out)?ut:ft}function g(t,e){for(var a;;){if(0===t.lookahead&&(u(t),0===t.lookahead)){if(e===j)return ut;break}if(t.match_length=0,a=B._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(h(t,!1),0===t.strm.avail_out))return ut}return t.insert=0,e===D?(h(t,!0),0===t.strm.avail_out?ct:pt):t.last_lit&&(h(t,!1),0===t.strm.avail_out)?ut:ft}function m(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}function b(t){t.window_size=2*t.w_size,i(t.head),t.max_lazy_match=z[t.level].max_lazy,t.good_match=z[t.level].good_length,t.nice_match=z[t.level].nice_length,t.max_chain_length=z[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=et-1,t.match_available=0,t.ins_h=0}function w(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=J,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new x.Buf16(2*$),this.dyn_dtree=new x.Buf16(2*(2*Y+1)),this.bl_tree=new x.Buf16(2*(2*Z+1)),i(this.dyn_ltree),i(this.dyn_dtree),i(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new x.Buf16(tt+1),this.heap=new x.Buf16(2*X+1),i(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new x.Buf16(2*X+1),i(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function v(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=G,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?it:_t,t.adler=2===e.wrap?0:1,e.last_flush=j,B._tr_init(e),O):n(t,T)}function y(t){var e=v(t);return e===O&&b(t.state),e}function k(t,e,a,r,i,s){if(!t)return T;var h=1;if(e===R&&(e=6),r<0?(h=0,r=-r):r>15&&(h=2,r-=16),i<1||i>Q||a!==J||r<8||r>15||e<0||e>9||s<0||s>M)return n(t,T);8===r&&(r=9);var l=new w;return t.state=l,l.strm=t,l.wrap=h,l.gzhead=null,l.w_bits=r,l.w_size=1<t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(u(t),0===t.lookahead&&e===j)return ut;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,h(t,!1),0===t.strm.avail_out))return ut;if(t.strstart-t.block_start>=t.w_size-nt&&(h(t,!1),0===t.strm.avail_out))return ut}return t.insert=0,e===D?(h(t,!0),0===t.strm.avail_out?ct:pt):(t.strstart>t.block_start&&(h(t,!1),t.strm.avail_out),ut)}),new m(4,4,8,4,f),new m(4,5,16,8,f),new m(4,6,32,32,f),new m(4,4,16,16,c),new m(8,16,32,32,c),new m(8,16,128,128,c),new m(8,32,128,256,c),new m(32,128,258,1024,c),new m(32,258,258,4096,c)],a.deflateInit=function(t,e){return k(t,e,J,V,W,P)},a.deflateInit2=k,a.deflateReset=y,a.deflateResetKeep=v,a.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?T:(t.state.gzhead=e,O):T},a.deflate=function(t,e){var a,h,_,d;if(!t||!t.state||e>I||e<0)return t?n(t,T):T;if(h=t.state,!t.output||!t.input&&0!==t.avail_in||h.status===dt&&e!==D)return n(t,0===t.avail_out?N:T);if(h.strm=t,a=h.last_flush,h.last_flush=e,h.status===it)if(2===h.wrap)t.adler=0,l(h,31),l(h,139),l(h,8),h.gzhead?(l(h,(h.gzhead.text?1:0)+(h.gzhead.hcrc?2:0)+(h.gzhead.extra?4:0)+(h.gzhead.name?8:0)+(h.gzhead.comment?16:0)),l(h,255&h.gzhead.time),l(h,h.gzhead.time>>8&255),l(h,h.gzhead.time>>16&255),l(h,h.gzhead.time>>24&255),l(h,9===h.level?2:h.strategy>=F||h.level<2?4:0),l(h,255&h.gzhead.os),h.gzhead.extra&&h.gzhead.extra.length&&(l(h,255&h.gzhead.extra.length),l(h,h.gzhead.extra.length>>8&255)),h.gzhead.hcrc&&(t.adler=C(t.adler,h.pending_buf,h.pending,0)),h.gzindex=0,h.status=st):(l(h,0),l(h,0),l(h,0),l(h,0),l(h,0),l(h,9===h.level?2:h.strategy>=F||h.level<2?4:0),l(h,gt),h.status=_t);else{var u=J+(h.w_bits-8<<4)<<8;u|=(h.strategy>=F||h.level<2?0:h.level<6?1:6===h.level?2:3)<<6,0!==h.strstart&&(u|=rt),u+=31-u%31,h.status=_t,o(h,u),0!==h.strstart&&(o(h,t.adler>>>16),o(h,65535&t.adler)),t.adler=1}if(h.status===st)if(h.gzhead.extra){for(_=h.pending;h.gzindex<(65535&h.gzhead.extra.length)&&(h.pending!==h.pending_buf_size||(h.gzhead.hcrc&&h.pending>_&&(t.adler=C(t.adler,h.pending_buf,h.pending-_,_)),s(t),_=h.pending,h.pending!==h.pending_buf_size));)l(h,255&h.gzhead.extra[h.gzindex]),h.gzindex++;h.gzhead.hcrc&&h.pending>_&&(t.adler=C(t.adler,h.pending_buf,h.pending-_,_)),h.gzindex===h.gzhead.extra.length&&(h.gzindex=0,h.status=ht)}else h.status=ht;if(h.status===ht)if(h.gzhead.name){_=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>_&&(t.adler=C(t.adler,h.pending_buf,h.pending-_,_)),s(t),_=h.pending,h.pending===h.pending_buf_size)){d=1;break}d=h.gzindex_&&(t.adler=C(t.adler,h.pending_buf,h.pending-_,_)),0===d&&(h.gzindex=0,h.status=lt)}else h.status=lt;if(h.status===lt)if(h.gzhead.comment){_=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>_&&(t.adler=C(t.adler,h.pending_buf,h.pending-_,_)),s(t),_=h.pending,h.pending===h.pending_buf_size)){d=1;break}d=h.gzindex_&&(t.adler=C(t.adler,h.pending_buf,h.pending-_,_)),0===d&&(h.status=ot)}else h.status=ot;if(h.status===ot&&(h.gzhead.hcrc?(h.pending+2>h.pending_buf_size&&s(t),h.pending+2<=h.pending_buf_size&&(l(h,255&t.adler),l(h,t.adler>>8&255),t.adler=0,h.status=_t)):h.status=_t),0!==h.pending){if(s(t),0===t.avail_out)return h.last_flush=-1,O}else if(0===t.avail_in&&r(e)<=r(a)&&e!==D)return n(t,N);if(h.status===dt&&0!==t.avail_in)return n(t,N);if(0!==t.avail_in||0!==h.lookahead||e!==j&&h.status!==dt){var f=h.strategy===F?g(h,e):h.strategy===K?p(h,e):z[h.level].func(h,e);if(f!==ct&&f!==pt||(h.status=dt),f===ut||f===ct)return 0===t.avail_out&&(h.last_flush=-1),O;if(f===ft&&(e===E?B._tr_align(h):e!==I&&(B._tr_stored_block(h,0,0,!1),e===U&&(i(h.head),0===h.lookahead&&(h.strstart=0,h.block_start=0,h.insert=0))),s(t),0===t.avail_out))return h.last_flush=-1,O}return e!==D?O:h.wrap<=0?q:(2===h.wrap?(l(h,255&t.adler),l(h,t.adler>>8&255),l(h,t.adler>>16&255),l(h,t.adler>>24&255),l(h,255&t.total_in),l(h,t.total_in>>8&255),l(h,t.total_in>>16&255),l(h,t.total_in>>24&255)):(o(h,t.adler>>>16),o(h,65535&t.adler)),s(t),h.wrap>0&&(h.wrap=-h.wrap),0!==h.pending?O:q)},a.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==it&&e!==st&&e!==ht&&e!==lt&&e!==ot&&e!==_t&&e!==dt?n(t,T):(t.state=null,e===_t?n(t,L):O):T},a.deflateSetDictionary=function(t,e){var a,n,r,s,h,l,o,_,d=e.length;if(!t||!t.state)return T;if(a=t.state,2===(s=a.wrap)||1===s&&a.status!==it||a.lookahead)return T;for(1===s&&(t.adler=A(t.adler,e,d,0)),a.wrap=0,d>=a.w_size&&(0===s&&(i(a.head),a.strstart=0,a.block_start=0,a.insert=0),_=new x.Buf8(a.w_size),x.arraySet(_,e,d-a.w_size,a.w_size,0),e=_,d=a.w_size),h=t.avail_in,l=t.next_in,o=t.input,t.avail_in=d,t.next_in=0,t.input=e,u(a);a.lookahead>=et;){n=a.strstart,r=a.lookahead-(et-1);do{a.ins_h=(a.ins_h<=0;)t[e]=0}function r(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function i(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function s(t){return t<256?et[t]:et[256+(t>>>7)]}function h(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function l(t,e,a){t.bi_valid>M-a?(t.bi_buf|=e<>M-t.bi_valid,t.bi_valid+=a-M):(t.bi_buf|=e<>>=1,a<<=1}while(--e>0);return a>>>1}function d(t){16===t.bi_valid?(h(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function u(t,e){var a,n,r,i,s,h,l=e.dyn_tree,o=e.max_code,_=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=K;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;ac&&(i=c,p++),l[2*n+1]=i,n>o||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(_[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>o||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}function f(t,e,a){var n,r,i=new Array(K+1),s=0;for(n=1;n<=K;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=_(i[h]++,h))}}function c(){var t,e,a,n,i,s=new Array(K+1);for(a=0,n=0;n>=7;n8?h(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function m(t,e,a,n){g(t),n&&(h(t,a),h(t,~a)),S.arraySet(t.pending_buf,t.window,e,a,t.pending),t.pending+=a}function b(t,e,a,n){var r=2*e,i=2*a;return t[r]>1;a>=1;a--)w(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],w(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,w(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],u(t,e),f(i,o,t.bl_count)}function k(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,o=4;for(0===s&&(l=138,o=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h=3&&0===t.bl_tree[2*Z[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function B(t,e,a,n){var r;for(l(t,e-257,5),l(t,a-1,5),l(t,n-4,4),r=0;r>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return E;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return U;for(e=32;e0?(t.strm.data_type===D&&(t.strm.data_type=A(t)),y(t,t.l_desc),y(t,t.d_desc),s=x(t),r=t.opt_len+3+7>>>3,(i=t.static_len+3+7>>>3)<=r&&(r=i)):r=i=a+5,a+4<=r&&-1!==e?C(t,e,a,n):t.strategy===j||i===r?(l(t,(O<<1)+(n?1:0),3),v(t,$,tt)):(l(t,(q<<1)+(n?1:0),3),B(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),v(t,t.dyn_ltree,t.dyn_dtree)),p(t),n&&g(t)},a._tr_tally=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(at[a]+L+1)]++,t.dyn_dtree[2*s(e)]++),t.last_lit===t.lit_bufsize-1},a._tr_align=function(t){l(t,O<<1,3),o(t,G,$),d(t)}},{"../utils/common":1}],8:[function(t,e,a){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/lib/deflate.js":[function(t,e,a){"use strict";function n(t){if(!(this instanceof n))return new n(t);this.options=s.assign({level:u,method:c,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var a=i.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==d)throw new Error(l[a]);if(e.header&&i.deflateSetHeader(this.strm,e.header),e.dictionary){var r;if(r="string"==typeof e.dictionary?h.string2buf(e.dictionary):"[object ArrayBuffer]"===_.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(a=i.deflateSetDictionary(this.strm,r))!==d)throw new Error(l[a]);this._dict_set=!0}}function r(t,e){var a=new n(e);if(a.push(t,!0),a.err)throw a.msg||l[a.err];return a.result}var i=t("./zlib/deflate"),s=t("./utils/common"),h=t("./utils/strings"),l=t("./zlib/messages"),o=t("./zlib/zstream"),_=Object.prototype.toString,d=0,u=-1,f=0,c=8;n.prototype.push=function(t,e){var a,n,r=this.strm,l=this.options.chunkSize;if(this.ended)return!1;n=e===~~e?e:!0===e?4:0,"string"==typeof t?r.input=h.string2buf(t):"[object ArrayBuffer]"===_.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(0===r.avail_out&&(r.output=new s.Buf8(l),r.next_out=0,r.avail_out=l),1!==(a=i.deflate(r,n))&&a!==d)return this.onEnd(a),this.ended=!0,!1;0!==r.avail_out&&(0!==r.avail_in||4!==n&&2!==n)||("string"===this.options.to?this.onData(h.buf2binstring(s.shrinkBuf(r.output,r.next_out))):this.onData(s.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||0===r.avail_out)&&1!==a);return 4===n?(a=i.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===d):2!==n||(this.onEnd(d),r.avail_out=0,!0)},n.prototype.onData=function(t){this.chunks.push(t)},n.prototype.onEnd=function(t){t===d&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},a.Deflate=n,a.deflate=r,a.deflateRaw=function(t,e){return e=e||{},e.raw=!0,r(t,e)},a.gzip=function(t,e){return e=e||{},e.gzip=!0,r(t,e)}},{"./utils/common":1,"./utils/strings":2,"./zlib/deflate":5,"./zlib/messages":6,"./zlib/zstream":8}]},{},[])("/lib/deflate.js")}); diff --git a/node_modules/pako/dist/pako_inflate.js b/node_modules/pako/dist/pako_inflate.js deleted file mode 100644 index 343c7c800..000000000 --- a/node_modules/pako/dist/pako_inflate.js +++ /dev/null @@ -1,3293 +0,0 @@ -/* pako 1.0.6 nodeca/pako */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.pako = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1); -} -_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start - - -// convert string to array (typed, when possible) -exports.string2buf = function (str) { - var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; - - // count binary size - for (m_pos = 0; m_pos < str_len; m_pos++) { - c = str.charCodeAt(m_pos); - if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { - c2 = str.charCodeAt(m_pos + 1); - if ((c2 & 0xfc00) === 0xdc00) { - c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); - m_pos++; - } - } - buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4; - } - - // allocate buffer - buf = new utils.Buf8(buf_len); - - // convert - for (i = 0, m_pos = 0; i < buf_len; m_pos++) { - c = str.charCodeAt(m_pos); - if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { - c2 = str.charCodeAt(m_pos + 1); - if ((c2 & 0xfc00) === 0xdc00) { - c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); - m_pos++; - } - } - if (c < 0x80) { - /* one byte */ - buf[i++] = c; - } else if (c < 0x800) { - /* two bytes */ - buf[i++] = 0xC0 | (c >>> 6); - buf[i++] = 0x80 | (c & 0x3f); - } else if (c < 0x10000) { - /* three bytes */ - buf[i++] = 0xE0 | (c >>> 12); - buf[i++] = 0x80 | (c >>> 6 & 0x3f); - buf[i++] = 0x80 | (c & 0x3f); - } else { - /* four bytes */ - buf[i++] = 0xf0 | (c >>> 18); - buf[i++] = 0x80 | (c >>> 12 & 0x3f); - buf[i++] = 0x80 | (c >>> 6 & 0x3f); - buf[i++] = 0x80 | (c & 0x3f); - } - } - - return buf; -}; - -// Helper (used in 2 places) -function buf2binstring(buf, len) { - // use fallback for big arrays to avoid stack overflow - if (len < 65537) { - if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) { - return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len)); - } - } - - var result = ''; - for (var i = 0; i < len; i++) { - result += String.fromCharCode(buf[i]); - } - return result; -} - - -// Convert byte array to binary string -exports.buf2binstring = function (buf) { - return buf2binstring(buf, buf.length); -}; - - -// Convert binary string (typed, when possible) -exports.binstring2buf = function (str) { - var buf = new utils.Buf8(str.length); - for (var i = 0, len = buf.length; i < len; i++) { - buf[i] = str.charCodeAt(i); - } - return buf; -}; - - -// convert array to string -exports.buf2string = function (buf, max) { - var i, out, c, c_len; - var len = max || buf.length; - - // Reserve max possible length (2 words per char) - // NB: by unknown reasons, Array is significantly faster for - // String.fromCharCode.apply than Uint16Array. - var utf16buf = new Array(len * 2); - - for (out = 0, i = 0; i < len;) { - c = buf[i++]; - // quick process ascii - if (c < 0x80) { utf16buf[out++] = c; continue; } - - c_len = _utf8len[c]; - // skip 5 & 6 byte codes - if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; } - - // apply mask on first byte - c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07; - // join the rest - while (c_len > 1 && i < len) { - c = (c << 6) | (buf[i++] & 0x3f); - c_len--; - } - - // terminated by end of string? - if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; } - - if (c < 0x10000) { - utf16buf[out++] = c; - } else { - c -= 0x10000; - utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff); - utf16buf[out++] = 0xdc00 | (c & 0x3ff); - } - } - - return buf2binstring(utf16buf, out); -}; - - -// Calculate max possible position in utf8 buffer, -// that will not break sequence. If that's not possible -// - (very small limits) return max size as is. -// -// buf[] - utf8 bytes array -// max - length limit (mandatory); -exports.utf8border = function (buf, max) { - var pos; - - max = max || buf.length; - if (max > buf.length) { max = buf.length; } - - // go back from last position, until start of sequence found - pos = max - 1; - while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; } - - // Very small and broken sequence, - // return max, because we should return something anyway. - if (pos < 0) { return max; } - - // If we came to start of buffer - that means buffer is too small, - // return max too. - if (pos === 0) { return max; } - - return (pos + _utf8len[buf[pos]] > max) ? pos : max; -}; - -},{"./common":1}],3:[function(require,module,exports){ -'use strict'; - -// Note: adler32 takes 12% for level 0 and 2% for level 6. -// It isn't worth it to make additional optimizations as in original. -// Small size is preferable. - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -function adler32(adler, buf, len, pos) { - var s1 = (adler & 0xffff) |0, - s2 = ((adler >>> 16) & 0xffff) |0, - n = 0; - - while (len !== 0) { - // Set limit ~ twice less than 5552, to keep - // s2 in 31-bits, because we force signed ints. - // in other case %= will fail. - n = len > 2000 ? 2000 : len; - len -= n; - - do { - s1 = (s1 + buf[pos++]) |0; - s2 = (s2 + s1) |0; - } while (--n); - - s1 %= 65521; - s2 %= 65521; - } - - return (s1 | (s2 << 16)) |0; -} - - -module.exports = adler32; - -},{}],4:[function(require,module,exports){ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -module.exports = { - - /* Allowed flush values; see deflate() and inflate() below for details */ - Z_NO_FLUSH: 0, - Z_PARTIAL_FLUSH: 1, - Z_SYNC_FLUSH: 2, - Z_FULL_FLUSH: 3, - Z_FINISH: 4, - Z_BLOCK: 5, - Z_TREES: 6, - - /* Return codes for the compression/decompression functions. Negative values - * are errors, positive values are used for special but normal events. - */ - Z_OK: 0, - Z_STREAM_END: 1, - Z_NEED_DICT: 2, - Z_ERRNO: -1, - Z_STREAM_ERROR: -2, - Z_DATA_ERROR: -3, - //Z_MEM_ERROR: -4, - Z_BUF_ERROR: -5, - //Z_VERSION_ERROR: -6, - - /* compression levels */ - Z_NO_COMPRESSION: 0, - Z_BEST_SPEED: 1, - Z_BEST_COMPRESSION: 9, - Z_DEFAULT_COMPRESSION: -1, - - - Z_FILTERED: 1, - Z_HUFFMAN_ONLY: 2, - Z_RLE: 3, - Z_FIXED: 4, - Z_DEFAULT_STRATEGY: 0, - - /* Possible values of the data_type field (though see inflate()) */ - Z_BINARY: 0, - Z_TEXT: 1, - //Z_ASCII: 1, // = Z_TEXT (deprecated) - Z_UNKNOWN: 2, - - /* The deflate compression method */ - Z_DEFLATED: 8 - //Z_NULL: null // Use -1 or null inline, depending on var type -}; - -},{}],5:[function(require,module,exports){ -'use strict'; - -// Note: we can't get significant speed boost here. -// So write code to minimize size - no pregenerated tables -// and array tools dependencies. - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -// Use ordinary array, since untyped makes no boost here -function makeTable() { - var c, table = []; - - for (var n = 0; n < 256; n++) { - c = n; - for (var k = 0; k < 8; k++) { - c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); - } - table[n] = c; - } - - return table; -} - -// Create table on load. Just 255 signed longs. Not a problem. -var crcTable = makeTable(); - - -function crc32(crc, buf, len, pos) { - var t = crcTable, - end = pos + len; - - crc ^= -1; - - for (var i = pos; i < end; i++) { - crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF]; - } - - return (crc ^ (-1)); // >>> 0; -} - - -module.exports = crc32; - -},{}],6:[function(require,module,exports){ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -function GZheader() { - /* true if compressed data believed to be text */ - this.text = 0; - /* modification time */ - this.time = 0; - /* extra flags (not used when writing a gzip file) */ - this.xflags = 0; - /* operating system */ - this.os = 0; - /* pointer to extra field or Z_NULL if none */ - this.extra = null; - /* extra field length (valid if extra != Z_NULL) */ - this.extra_len = 0; // Actually, we don't need it in JS, - // but leave for few code modifications - - // - // Setup limits is not necessary because in js we should not preallocate memory - // for inflate use constant limit in 65536 bytes - // - - /* space at extra (only when reading header) */ - // this.extra_max = 0; - /* pointer to zero-terminated file name or Z_NULL */ - this.name = ''; - /* space at name (only when reading header) */ - // this.name_max = 0; - /* pointer to zero-terminated comment or Z_NULL */ - this.comment = ''; - /* space at comment (only when reading header) */ - // this.comm_max = 0; - /* true if there was or will be a header crc */ - this.hcrc = 0; - /* true when done reading gzip header (not used when writing a gzip file) */ - this.done = false; -} - -module.exports = GZheader; - -},{}],7:[function(require,module,exports){ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -// See state defs from inflate.js -var BAD = 30; /* got a data error -- remain here until reset */ -var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ - -/* - Decode literal, length, and distance codes and write out the resulting - literal and match bytes until either not enough input or output is - available, an end-of-block is encountered, or a data error is encountered. - When large enough input and output buffers are supplied to inflate(), for - example, a 16K input buffer and a 64K output buffer, more than 95% of the - inflate execution time is spent in this routine. - - Entry assumptions: - - state.mode === LEN - strm.avail_in >= 6 - strm.avail_out >= 258 - start >= strm.avail_out - state.bits < 8 - - On return, state.mode is one of: - - LEN -- ran out of enough output space or enough available input - TYPE -- reached end of block code, inflate() to interpret next block - BAD -- error in block data - - Notes: - - - The maximum input bits used by a length/distance pair is 15 bits for the - length code, 5 bits for the length extra, 15 bits for the distance code, - and 13 bits for the distance extra. This totals 48 bits, or six bytes. - Therefore if strm.avail_in >= 6, then there is enough input to avoid - checking for available input while decoding. - - - The maximum bytes that a single length/distance pair can output is 258 - bytes, which is the maximum length that can be coded. inflate_fast() - requires strm.avail_out >= 258 for each loop to avoid checking for - output space. - */ -module.exports = function inflate_fast(strm, start) { - var state; - var _in; /* local strm.input */ - var last; /* have enough input while in < last */ - var _out; /* local strm.output */ - var beg; /* inflate()'s initial strm.output */ - var end; /* while out < end, enough space available */ -//#ifdef INFLATE_STRICT - var dmax; /* maximum distance from zlib header */ -//#endif - var wsize; /* window size or zero if not using window */ - var whave; /* valid bytes in the window */ - var wnext; /* window write index */ - // Use `s_window` instead `window`, avoid conflict with instrumentation tools - var s_window; /* allocated sliding window, if wsize != 0 */ - var hold; /* local strm.hold */ - var bits; /* local strm.bits */ - var lcode; /* local strm.lencode */ - var dcode; /* local strm.distcode */ - var lmask; /* mask for first level of length codes */ - var dmask; /* mask for first level of distance codes */ - var here; /* retrieved table entry */ - var op; /* code bits, operation, extra bits, or */ - /* window position, window bytes to copy */ - var len; /* match length, unused bytes */ - var dist; /* match distance */ - var from; /* where to copy match from */ - var from_source; - - - var input, output; // JS specific, because we have no pointers - - /* copy state to local variables */ - state = strm.state; - //here = state.here; - _in = strm.next_in; - input = strm.input; - last = _in + (strm.avail_in - 5); - _out = strm.next_out; - output = strm.output; - beg = _out - (start - strm.avail_out); - end = _out + (strm.avail_out - 257); -//#ifdef INFLATE_STRICT - dmax = state.dmax; -//#endif - wsize = state.wsize; - whave = state.whave; - wnext = state.wnext; - s_window = state.window; - hold = state.hold; - bits = state.bits; - lcode = state.lencode; - dcode = state.distcode; - lmask = (1 << state.lenbits) - 1; - dmask = (1 << state.distbits) - 1; - - - /* decode literals and length/distances until end-of-block or not enough - input data or output space */ - - top: - do { - if (bits < 15) { - hold += input[_in++] << bits; - bits += 8; - hold += input[_in++] << bits; - bits += 8; - } - - here = lcode[hold & lmask]; - - dolen: - for (;;) { // Goto emulation - op = here >>> 24/*here.bits*/; - hold >>>= op; - bits -= op; - op = (here >>> 16) & 0xff/*here.op*/; - if (op === 0) { /* literal */ - //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? - // "inflate: literal '%c'\n" : - // "inflate: literal 0x%02x\n", here.val)); - output[_out++] = here & 0xffff/*here.val*/; - } - else if (op & 16) { /* length base */ - len = here & 0xffff/*here.val*/; - op &= 15; /* number of extra bits */ - if (op) { - if (bits < op) { - hold += input[_in++] << bits; - bits += 8; - } - len += hold & ((1 << op) - 1); - hold >>>= op; - bits -= op; - } - //Tracevv((stderr, "inflate: length %u\n", len)); - if (bits < 15) { - hold += input[_in++] << bits; - bits += 8; - hold += input[_in++] << bits; - bits += 8; - } - here = dcode[hold & dmask]; - - dodist: - for (;;) { // goto emulation - op = here >>> 24/*here.bits*/; - hold >>>= op; - bits -= op; - op = (here >>> 16) & 0xff/*here.op*/; - - if (op & 16) { /* distance base */ - dist = here & 0xffff/*here.val*/; - op &= 15; /* number of extra bits */ - if (bits < op) { - hold += input[_in++] << bits; - bits += 8; - if (bits < op) { - hold += input[_in++] << bits; - bits += 8; - } - } - dist += hold & ((1 << op) - 1); -//#ifdef INFLATE_STRICT - if (dist > dmax) { - strm.msg = 'invalid distance too far back'; - state.mode = BAD; - break top; - } -//#endif - hold >>>= op; - bits -= op; - //Tracevv((stderr, "inflate: distance %u\n", dist)); - op = _out - beg; /* max distance in output */ - if (dist > op) { /* see if copy from window */ - op = dist - op; /* distance back in window */ - if (op > whave) { - if (state.sane) { - strm.msg = 'invalid distance too far back'; - state.mode = BAD; - break top; - } - -// (!) This block is disabled in zlib defaults, -// don't enable it for binary compatibility -//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR -// if (len <= op - whave) { -// do { -// output[_out++] = 0; -// } while (--len); -// continue top; -// } -// len -= op - whave; -// do { -// output[_out++] = 0; -// } while (--op > whave); -// if (op === 0) { -// from = _out - dist; -// do { -// output[_out++] = output[from++]; -// } while (--len); -// continue top; -// } -//#endif - } - from = 0; // window index - from_source = s_window; - if (wnext === 0) { /* very common case */ - from += wsize - op; - if (op < len) { /* some from window */ - len -= op; - do { - output[_out++] = s_window[from++]; - } while (--op); - from = _out - dist; /* rest from output */ - from_source = output; - } - } - else if (wnext < op) { /* wrap around window */ - from += wsize + wnext - op; - op -= wnext; - if (op < len) { /* some from end of window */ - len -= op; - do { - output[_out++] = s_window[from++]; - } while (--op); - from = 0; - if (wnext < len) { /* some from start of window */ - op = wnext; - len -= op; - do { - output[_out++] = s_window[from++]; - } while (--op); - from = _out - dist; /* rest from output */ - from_source = output; - } - } - } - else { /* contiguous in window */ - from += wnext - op; - if (op < len) { /* some from window */ - len -= op; - do { - output[_out++] = s_window[from++]; - } while (--op); - from = _out - dist; /* rest from output */ - from_source = output; - } - } - while (len > 2) { - output[_out++] = from_source[from++]; - output[_out++] = from_source[from++]; - output[_out++] = from_source[from++]; - len -= 3; - } - if (len) { - output[_out++] = from_source[from++]; - if (len > 1) { - output[_out++] = from_source[from++]; - } - } - } - else { - from = _out - dist; /* copy direct from output */ - do { /* minimum length is three */ - output[_out++] = output[from++]; - output[_out++] = output[from++]; - output[_out++] = output[from++]; - len -= 3; - } while (len > 2); - if (len) { - output[_out++] = output[from++]; - if (len > 1) { - output[_out++] = output[from++]; - } - } - } - } - else if ((op & 64) === 0) { /* 2nd level distance code */ - here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; - continue dodist; - } - else { - strm.msg = 'invalid distance code'; - state.mode = BAD; - break top; - } - - break; // need to emulate goto via "continue" - } - } - else if ((op & 64) === 0) { /* 2nd level length code */ - here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; - continue dolen; - } - else if (op & 32) { /* end-of-block */ - //Tracevv((stderr, "inflate: end of block\n")); - state.mode = TYPE; - break top; - } - else { - strm.msg = 'invalid literal/length code'; - state.mode = BAD; - break top; - } - - break; // need to emulate goto via "continue" - } - } while (_in < last && _out < end); - - /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ - len = bits >> 3; - _in -= len; - bits -= len << 3; - hold &= (1 << bits) - 1; - - /* update state and return */ - strm.next_in = _in; - strm.next_out = _out; - strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last)); - strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end)); - state.hold = hold; - state.bits = bits; - return; -}; - -},{}],8:[function(require,module,exports){ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -var utils = require('../utils/common'); -var adler32 = require('./adler32'); -var crc32 = require('./crc32'); -var inflate_fast = require('./inffast'); -var inflate_table = require('./inftrees'); - -var CODES = 0; -var LENS = 1; -var DISTS = 2; - -/* Public constants ==========================================================*/ -/* ===========================================================================*/ - - -/* Allowed flush values; see deflate() and inflate() below for details */ -//var Z_NO_FLUSH = 0; -//var Z_PARTIAL_FLUSH = 1; -//var Z_SYNC_FLUSH = 2; -//var Z_FULL_FLUSH = 3; -var Z_FINISH = 4; -var Z_BLOCK = 5; -var Z_TREES = 6; - - -/* Return codes for the compression/decompression functions. Negative values - * are errors, positive values are used for special but normal events. - */ -var Z_OK = 0; -var Z_STREAM_END = 1; -var Z_NEED_DICT = 2; -//var Z_ERRNO = -1; -var Z_STREAM_ERROR = -2; -var Z_DATA_ERROR = -3; -var Z_MEM_ERROR = -4; -var Z_BUF_ERROR = -5; -//var Z_VERSION_ERROR = -6; - -/* The deflate compression method */ -var Z_DEFLATED = 8; - - -/* STATES ====================================================================*/ -/* ===========================================================================*/ - - -var HEAD = 1; /* i: waiting for magic header */ -var FLAGS = 2; /* i: waiting for method and flags (gzip) */ -var TIME = 3; /* i: waiting for modification time (gzip) */ -var OS = 4; /* i: waiting for extra flags and operating system (gzip) */ -var EXLEN = 5; /* i: waiting for extra length (gzip) */ -var EXTRA = 6; /* i: waiting for extra bytes (gzip) */ -var NAME = 7; /* i: waiting for end of file name (gzip) */ -var COMMENT = 8; /* i: waiting for end of comment (gzip) */ -var HCRC = 9; /* i: waiting for header crc (gzip) */ -var DICTID = 10; /* i: waiting for dictionary check value */ -var DICT = 11; /* waiting for inflateSetDictionary() call */ -var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ -var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */ -var STORED = 14; /* i: waiting for stored size (length and complement) */ -var COPY_ = 15; /* i/o: same as COPY below, but only first time in */ -var COPY = 16; /* i/o: waiting for input or output to copy stored block */ -var TABLE = 17; /* i: waiting for dynamic block table lengths */ -var LENLENS = 18; /* i: waiting for code length code lengths */ -var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */ -var LEN_ = 20; /* i: same as LEN below, but only first time in */ -var LEN = 21; /* i: waiting for length/lit/eob code */ -var LENEXT = 22; /* i: waiting for length extra bits */ -var DIST = 23; /* i: waiting for distance code */ -var DISTEXT = 24; /* i: waiting for distance extra bits */ -var MATCH = 25; /* o: waiting for output space to copy string */ -var LIT = 26; /* o: waiting for output space to write literal */ -var CHECK = 27; /* i: waiting for 32-bit check value */ -var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */ -var DONE = 29; /* finished check, done -- remain here until reset */ -var BAD = 30; /* got a data error -- remain here until reset */ -var MEM = 31; /* got an inflate() memory error -- remain here until reset */ -var SYNC = 32; /* looking for synchronization bytes to restart inflate() */ - -/* ===========================================================================*/ - - - -var ENOUGH_LENS = 852; -var ENOUGH_DISTS = 592; -//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); - -var MAX_WBITS = 15; -/* 32K LZ77 window */ -var DEF_WBITS = MAX_WBITS; - - -function zswap32(q) { - return (((q >>> 24) & 0xff) + - ((q >>> 8) & 0xff00) + - ((q & 0xff00) << 8) + - ((q & 0xff) << 24)); -} - - -function InflateState() { - this.mode = 0; /* current inflate mode */ - this.last = false; /* true if processing last block */ - this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ - this.havedict = false; /* true if dictionary provided */ - this.flags = 0; /* gzip header method and flags (0 if zlib) */ - this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */ - this.check = 0; /* protected copy of check value */ - this.total = 0; /* protected copy of output count */ - // TODO: may be {} - this.head = null; /* where to save gzip header information */ - - /* sliding window */ - this.wbits = 0; /* log base 2 of requested window size */ - this.wsize = 0; /* window size or zero if not using window */ - this.whave = 0; /* valid bytes in the window */ - this.wnext = 0; /* window write index */ - this.window = null; /* allocated sliding window, if needed */ - - /* bit accumulator */ - this.hold = 0; /* input bit accumulator */ - this.bits = 0; /* number of bits in "in" */ - - /* for string and stored block copying */ - this.length = 0; /* literal or length of data to copy */ - this.offset = 0; /* distance back to copy string from */ - - /* for table and code decoding */ - this.extra = 0; /* extra bits needed */ - - /* fixed and dynamic code tables */ - this.lencode = null; /* starting table for length/literal codes */ - this.distcode = null; /* starting table for distance codes */ - this.lenbits = 0; /* index bits for lencode */ - this.distbits = 0; /* index bits for distcode */ - - /* dynamic table building */ - this.ncode = 0; /* number of code length code lengths */ - this.nlen = 0; /* number of length code lengths */ - this.ndist = 0; /* number of distance code lengths */ - this.have = 0; /* number of code lengths in lens[] */ - this.next = null; /* next available space in codes[] */ - - this.lens = new utils.Buf16(320); /* temporary storage for code lengths */ - this.work = new utils.Buf16(288); /* work area for code table building */ - - /* - because we don't have pointers in js, we use lencode and distcode directly - as buffers so we don't need codes - */ - //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */ - this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */ - this.distdyn = null; /* dynamic table for distance codes (JS specific) */ - this.sane = 0; /* if false, allow invalid distance too far */ - this.back = 0; /* bits back of last unprocessed length/lit */ - this.was = 0; /* initial length of match */ -} - -function inflateResetKeep(strm) { - var state; - - if (!strm || !strm.state) { return Z_STREAM_ERROR; } - state = strm.state; - strm.total_in = strm.total_out = state.total = 0; - strm.msg = ''; /*Z_NULL*/ - if (state.wrap) { /* to support ill-conceived Java test suite */ - strm.adler = state.wrap & 1; - } - state.mode = HEAD; - state.last = 0; - state.havedict = 0; - state.dmax = 32768; - state.head = null/*Z_NULL*/; - state.hold = 0; - state.bits = 0; - //state.lencode = state.distcode = state.next = state.codes; - state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS); - state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS); - - state.sane = 1; - state.back = -1; - //Tracev((stderr, "inflate: reset\n")); - return Z_OK; -} - -function inflateReset(strm) { - var state; - - if (!strm || !strm.state) { return Z_STREAM_ERROR; } - state = strm.state; - state.wsize = 0; - state.whave = 0; - state.wnext = 0; - return inflateResetKeep(strm); - -} - -function inflateReset2(strm, windowBits) { - var wrap; - var state; - - /* get the state */ - if (!strm || !strm.state) { return Z_STREAM_ERROR; } - state = strm.state; - - /* extract wrap request from windowBits parameter */ - if (windowBits < 0) { - wrap = 0; - windowBits = -windowBits; - } - else { - wrap = (windowBits >> 4) + 1; - if (windowBits < 48) { - windowBits &= 15; - } - } - - /* set number of window bits, free window if different */ - if (windowBits && (windowBits < 8 || windowBits > 15)) { - return Z_STREAM_ERROR; - } - if (state.window !== null && state.wbits !== windowBits) { - state.window = null; - } - - /* update state and reset the rest of it */ - state.wrap = wrap; - state.wbits = windowBits; - return inflateReset(strm); -} - -function inflateInit2(strm, windowBits) { - var ret; - var state; - - if (!strm) { return Z_STREAM_ERROR; } - //strm.msg = Z_NULL; /* in case we return an error */ - - state = new InflateState(); - - //if (state === Z_NULL) return Z_MEM_ERROR; - //Tracev((stderr, "inflate: allocated\n")); - strm.state = state; - state.window = null/*Z_NULL*/; - ret = inflateReset2(strm, windowBits); - if (ret !== Z_OK) { - strm.state = null/*Z_NULL*/; - } - return ret; -} - -function inflateInit(strm) { - return inflateInit2(strm, DEF_WBITS); -} - - -/* - Return state with length and distance decoding tables and index sizes set to - fixed code decoding. Normally this returns fixed tables from inffixed.h. - If BUILDFIXED is defined, then instead this routine builds the tables the - first time it's called, and returns those tables the first time and - thereafter. This reduces the size of the code by about 2K bytes, in - exchange for a little execution time. However, BUILDFIXED should not be - used for threaded applications, since the rewriting of the tables and virgin - may not be thread-safe. - */ -var virgin = true; - -var lenfix, distfix; // We have no pointers in JS, so keep tables separate - -function fixedtables(state) { - /* build fixed huffman tables if first call (may not be thread safe) */ - if (virgin) { - var sym; - - lenfix = new utils.Buf32(512); - distfix = new utils.Buf32(32); - - /* literal/length table */ - sym = 0; - while (sym < 144) { state.lens[sym++] = 8; } - while (sym < 256) { state.lens[sym++] = 9; } - while (sym < 280) { state.lens[sym++] = 7; } - while (sym < 288) { state.lens[sym++] = 8; } - - inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); - - /* distance table */ - sym = 0; - while (sym < 32) { state.lens[sym++] = 5; } - - inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); - - /* do this just once */ - virgin = false; - } - - state.lencode = lenfix; - state.lenbits = 9; - state.distcode = distfix; - state.distbits = 5; -} - - -/* - Update the window with the last wsize (normally 32K) bytes written before - returning. If window does not exist yet, create it. This is only called - when a window is already in use, or when output has been written during this - inflate call, but the end of the deflate stream has not been reached yet. - It is also called to create a window for dictionary data when a dictionary - is loaded. - - Providing output buffers larger than 32K to inflate() should provide a speed - advantage, since only the last 32K of output is copied to the sliding window - upon return from inflate(), and since all distances after the first 32K of - output will fall in the output data, making match copies simpler and faster. - The advantage may be dependent on the size of the processor's data caches. - */ -function updatewindow(strm, src, end, copy) { - var dist; - var state = strm.state; - - /* if it hasn't been done already, allocate space for the window */ - if (state.window === null) { - state.wsize = 1 << state.wbits; - state.wnext = 0; - state.whave = 0; - - state.window = new utils.Buf8(state.wsize); - } - - /* copy state->wsize or less output bytes into the circular window */ - if (copy >= state.wsize) { - utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0); - state.wnext = 0; - state.whave = state.wsize; - } - else { - dist = state.wsize - state.wnext; - if (dist > copy) { - dist = copy; - } - //zmemcpy(state->window + state->wnext, end - copy, dist); - utils.arraySet(state.window, src, end - copy, dist, state.wnext); - copy -= dist; - if (copy) { - //zmemcpy(state->window, end - copy, copy); - utils.arraySet(state.window, src, end - copy, copy, 0); - state.wnext = copy; - state.whave = state.wsize; - } - else { - state.wnext += dist; - if (state.wnext === state.wsize) { state.wnext = 0; } - if (state.whave < state.wsize) { state.whave += dist; } - } - } - return 0; -} - -function inflate(strm, flush) { - var state; - var input, output; // input/output buffers - var next; /* next input INDEX */ - var put; /* next output INDEX */ - var have, left; /* available input and output */ - var hold; /* bit buffer */ - var bits; /* bits in bit buffer */ - var _in, _out; /* save starting available input and output */ - var copy; /* number of stored or match bytes to copy */ - var from; /* where to copy match bytes from */ - var from_source; - var here = 0; /* current decoding table entry */ - var here_bits, here_op, here_val; // paked "here" denormalized (JS specific) - //var last; /* parent table entry */ - var last_bits, last_op, last_val; // paked "last" denormalized (JS specific) - var len; /* length to copy for repeats, bits to drop */ - var ret; /* return code */ - var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */ - var opts; - - var n; // temporary var for NEED_BITS - - var order = /* permutation of code lengths */ - [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]; - - - if (!strm || !strm.state || !strm.output || - (!strm.input && strm.avail_in !== 0)) { - return Z_STREAM_ERROR; - } - - state = strm.state; - if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */ - - - //--- LOAD() --- - put = strm.next_out; - output = strm.output; - left = strm.avail_out; - next = strm.next_in; - input = strm.input; - have = strm.avail_in; - hold = state.hold; - bits = state.bits; - //--- - - _in = have; - _out = left; - ret = Z_OK; - - inf_leave: // goto emulation - for (;;) { - switch (state.mode) { - case HEAD: - if (state.wrap === 0) { - state.mode = TYPEDO; - break; - } - //=== NEEDBITS(16); - while (bits < 16) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */ - state.check = 0/*crc32(0L, Z_NULL, 0)*/; - //=== CRC2(state.check, hold); - hbuf[0] = hold & 0xff; - hbuf[1] = (hold >>> 8) & 0xff; - state.check = crc32(state.check, hbuf, 2, 0); - //===// - - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = FLAGS; - break; - } - state.flags = 0; /* expect zlib header */ - if (state.head) { - state.head.done = false; - } - if (!(state.wrap & 1) || /* check if zlib header allowed */ - (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) { - strm.msg = 'incorrect header check'; - state.mode = BAD; - break; - } - if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) { - strm.msg = 'unknown compression method'; - state.mode = BAD; - break; - } - //--- DROPBITS(4) ---// - hold >>>= 4; - bits -= 4; - //---// - len = (hold & 0x0f)/*BITS(4)*/ + 8; - if (state.wbits === 0) { - state.wbits = len; - } - else if (len > state.wbits) { - strm.msg = 'invalid window size'; - state.mode = BAD; - break; - } - state.dmax = 1 << len; - //Tracev((stderr, "inflate: zlib header ok\n")); - strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; - state.mode = hold & 0x200 ? DICTID : TYPE; - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - break; - case FLAGS: - //=== NEEDBITS(16); */ - while (bits < 16) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - state.flags = hold; - if ((state.flags & 0xff) !== Z_DEFLATED) { - strm.msg = 'unknown compression method'; - state.mode = BAD; - break; - } - if (state.flags & 0xe000) { - strm.msg = 'unknown header flags set'; - state.mode = BAD; - break; - } - if (state.head) { - state.head.text = ((hold >> 8) & 1); - } - if (state.flags & 0x0200) { - //=== CRC2(state.check, hold); - hbuf[0] = hold & 0xff; - hbuf[1] = (hold >>> 8) & 0xff; - state.check = crc32(state.check, hbuf, 2, 0); - //===// - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = TIME; - /* falls through */ - case TIME: - //=== NEEDBITS(32); */ - while (bits < 32) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - if (state.head) { - state.head.time = hold; - } - if (state.flags & 0x0200) { - //=== CRC4(state.check, hold) - hbuf[0] = hold & 0xff; - hbuf[1] = (hold >>> 8) & 0xff; - hbuf[2] = (hold >>> 16) & 0xff; - hbuf[3] = (hold >>> 24) & 0xff; - state.check = crc32(state.check, hbuf, 4, 0); - //=== - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = OS; - /* falls through */ - case OS: - //=== NEEDBITS(16); */ - while (bits < 16) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - if (state.head) { - state.head.xflags = (hold & 0xff); - state.head.os = (hold >> 8); - } - if (state.flags & 0x0200) { - //=== CRC2(state.check, hold); - hbuf[0] = hold & 0xff; - hbuf[1] = (hold >>> 8) & 0xff; - state.check = crc32(state.check, hbuf, 2, 0); - //===// - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = EXLEN; - /* falls through */ - case EXLEN: - if (state.flags & 0x0400) { - //=== NEEDBITS(16); */ - while (bits < 16) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - state.length = hold; - if (state.head) { - state.head.extra_len = hold; - } - if (state.flags & 0x0200) { - //=== CRC2(state.check, hold); - hbuf[0] = hold & 0xff; - hbuf[1] = (hold >>> 8) & 0xff; - state.check = crc32(state.check, hbuf, 2, 0); - //===// - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - } - else if (state.head) { - state.head.extra = null/*Z_NULL*/; - } - state.mode = EXTRA; - /* falls through */ - case EXTRA: - if (state.flags & 0x0400) { - copy = state.length; - if (copy > have) { copy = have; } - if (copy) { - if (state.head) { - len = state.head.extra_len - state.length; - if (!state.head.extra) { - // Use untyped array for more convenient processing later - state.head.extra = new Array(state.head.extra_len); - } - utils.arraySet( - state.head.extra, - input, - next, - // extra field is limited to 65536 bytes - // - no need for additional size check - copy, - /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ - len - ); - //zmemcpy(state.head.extra + len, next, - // len + copy > state.head.extra_max ? - // state.head.extra_max - len : copy); - } - if (state.flags & 0x0200) { - state.check = crc32(state.check, input, copy, next); - } - have -= copy; - next += copy; - state.length -= copy; - } - if (state.length) { break inf_leave; } - } - state.length = 0; - state.mode = NAME; - /* falls through */ - case NAME: - if (state.flags & 0x0800) { - if (have === 0) { break inf_leave; } - copy = 0; - do { - // TODO: 2 or 1 bytes? - len = input[next + copy++]; - /* use constant limit because in js we should not preallocate memory */ - if (state.head && len && - (state.length < 65536 /*state.head.name_max*/)) { - state.head.name += String.fromCharCode(len); - } - } while (len && copy < have); - - if (state.flags & 0x0200) { - state.check = crc32(state.check, input, copy, next); - } - have -= copy; - next += copy; - if (len) { break inf_leave; } - } - else if (state.head) { - state.head.name = null; - } - state.length = 0; - state.mode = COMMENT; - /* falls through */ - case COMMENT: - if (state.flags & 0x1000) { - if (have === 0) { break inf_leave; } - copy = 0; - do { - len = input[next + copy++]; - /* use constant limit because in js we should not preallocate memory */ - if (state.head && len && - (state.length < 65536 /*state.head.comm_max*/)) { - state.head.comment += String.fromCharCode(len); - } - } while (len && copy < have); - if (state.flags & 0x0200) { - state.check = crc32(state.check, input, copy, next); - } - have -= copy; - next += copy; - if (len) { break inf_leave; } - } - else if (state.head) { - state.head.comment = null; - } - state.mode = HCRC; - /* falls through */ - case HCRC: - if (state.flags & 0x0200) { - //=== NEEDBITS(16); */ - while (bits < 16) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - if (hold !== (state.check & 0xffff)) { - strm.msg = 'header crc mismatch'; - state.mode = BAD; - break; - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - } - if (state.head) { - state.head.hcrc = ((state.flags >> 9) & 1); - state.head.done = true; - } - strm.adler = state.check = 0; - state.mode = TYPE; - break; - case DICTID: - //=== NEEDBITS(32); */ - while (bits < 32) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - strm.adler = state.check = zswap32(hold); - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = DICT; - /* falls through */ - case DICT: - if (state.havedict === 0) { - //--- RESTORE() --- - strm.next_out = put; - strm.avail_out = left; - strm.next_in = next; - strm.avail_in = have; - state.hold = hold; - state.bits = bits; - //--- - return Z_NEED_DICT; - } - strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; - state.mode = TYPE; - /* falls through */ - case TYPE: - if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; } - /* falls through */ - case TYPEDO: - if (state.last) { - //--- BYTEBITS() ---// - hold >>>= bits & 7; - bits -= bits & 7; - //---// - state.mode = CHECK; - break; - } - //=== NEEDBITS(3); */ - while (bits < 3) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - state.last = (hold & 0x01)/*BITS(1)*/; - //--- DROPBITS(1) ---// - hold >>>= 1; - bits -= 1; - //---// - - switch ((hold & 0x03)/*BITS(2)*/) { - case 0: /* stored block */ - //Tracev((stderr, "inflate: stored block%s\n", - // state.last ? " (last)" : "")); - state.mode = STORED; - break; - case 1: /* fixed block */ - fixedtables(state); - //Tracev((stderr, "inflate: fixed codes block%s\n", - // state.last ? " (last)" : "")); - state.mode = LEN_; /* decode codes */ - if (flush === Z_TREES) { - //--- DROPBITS(2) ---// - hold >>>= 2; - bits -= 2; - //---// - break inf_leave; - } - break; - case 2: /* dynamic block */ - //Tracev((stderr, "inflate: dynamic codes block%s\n", - // state.last ? " (last)" : "")); - state.mode = TABLE; - break; - case 3: - strm.msg = 'invalid block type'; - state.mode = BAD; - } - //--- DROPBITS(2) ---// - hold >>>= 2; - bits -= 2; - //---// - break; - case STORED: - //--- BYTEBITS() ---// /* go to byte boundary */ - hold >>>= bits & 7; - bits -= bits & 7; - //---// - //=== NEEDBITS(32); */ - while (bits < 32) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) { - strm.msg = 'invalid stored block lengths'; - state.mode = BAD; - break; - } - state.length = hold & 0xffff; - //Tracev((stderr, "inflate: stored length %u\n", - // state.length)); - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = COPY_; - if (flush === Z_TREES) { break inf_leave; } - /* falls through */ - case COPY_: - state.mode = COPY; - /* falls through */ - case COPY: - copy = state.length; - if (copy) { - if (copy > have) { copy = have; } - if (copy > left) { copy = left; } - if (copy === 0) { break inf_leave; } - //--- zmemcpy(put, next, copy); --- - utils.arraySet(output, input, next, copy, put); - //---// - have -= copy; - next += copy; - left -= copy; - put += copy; - state.length -= copy; - break; - } - //Tracev((stderr, "inflate: stored end\n")); - state.mode = TYPE; - break; - case TABLE: - //=== NEEDBITS(14); */ - while (bits < 14) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257; - //--- DROPBITS(5) ---// - hold >>>= 5; - bits -= 5; - //---// - state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1; - //--- DROPBITS(5) ---// - hold >>>= 5; - bits -= 5; - //---// - state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4; - //--- DROPBITS(4) ---// - hold >>>= 4; - bits -= 4; - //---// -//#ifndef PKZIP_BUG_WORKAROUND - if (state.nlen > 286 || state.ndist > 30) { - strm.msg = 'too many length or distance symbols'; - state.mode = BAD; - break; - } -//#endif - //Tracev((stderr, "inflate: table sizes ok\n")); - state.have = 0; - state.mode = LENLENS; - /* falls through */ - case LENLENS: - while (state.have < state.ncode) { - //=== NEEDBITS(3); - while (bits < 3) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - state.lens[order[state.have++]] = (hold & 0x07);//BITS(3); - //--- DROPBITS(3) ---// - hold >>>= 3; - bits -= 3; - //---// - } - while (state.have < 19) { - state.lens[order[state.have++]] = 0; - } - // We have separate tables & no pointers. 2 commented lines below not needed. - //state.next = state.codes; - //state.lencode = state.next; - // Switch to use dynamic table - state.lencode = state.lendyn; - state.lenbits = 7; - - opts = { bits: state.lenbits }; - ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); - state.lenbits = opts.bits; - - if (ret) { - strm.msg = 'invalid code lengths set'; - state.mode = BAD; - break; - } - //Tracev((stderr, "inflate: code lengths ok\n")); - state.have = 0; - state.mode = CODELENS; - /* falls through */ - case CODELENS: - while (state.have < state.nlen + state.ndist) { - for (;;) { - here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/ - here_bits = here >>> 24; - here_op = (here >>> 16) & 0xff; - here_val = here & 0xffff; - - if ((here_bits) <= bits) { break; } - //--- PULLBYTE() ---// - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - //---// - } - if (here_val < 16) { - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - state.lens[state.have++] = here_val; - } - else { - if (here_val === 16) { - //=== NEEDBITS(here.bits + 2); - n = here_bits + 2; - while (bits < n) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - if (state.have === 0) { - strm.msg = 'invalid bit length repeat'; - state.mode = BAD; - break; - } - len = state.lens[state.have - 1]; - copy = 3 + (hold & 0x03);//BITS(2); - //--- DROPBITS(2) ---// - hold >>>= 2; - bits -= 2; - //---// - } - else if (here_val === 17) { - //=== NEEDBITS(here.bits + 3); - n = here_bits + 3; - while (bits < n) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - len = 0; - copy = 3 + (hold & 0x07);//BITS(3); - //--- DROPBITS(3) ---// - hold >>>= 3; - bits -= 3; - //---// - } - else { - //=== NEEDBITS(here.bits + 7); - n = here_bits + 7; - while (bits < n) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - len = 0; - copy = 11 + (hold & 0x7f);//BITS(7); - //--- DROPBITS(7) ---// - hold >>>= 7; - bits -= 7; - //---// - } - if (state.have + copy > state.nlen + state.ndist) { - strm.msg = 'invalid bit length repeat'; - state.mode = BAD; - break; - } - while (copy--) { - state.lens[state.have++] = len; - } - } - } - - /* handle error breaks in while */ - if (state.mode === BAD) { break; } - - /* check for end-of-block code (better have one) */ - if (state.lens[256] === 0) { - strm.msg = 'invalid code -- missing end-of-block'; - state.mode = BAD; - break; - } - - /* build code tables -- note: do not change the lenbits or distbits - values here (9 and 6) without reading the comments in inftrees.h - concerning the ENOUGH constants, which depend on those values */ - state.lenbits = 9; - - opts = { bits: state.lenbits }; - ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); - // We have separate tables & no pointers. 2 commented lines below not needed. - // state.next_index = opts.table_index; - state.lenbits = opts.bits; - // state.lencode = state.next; - - if (ret) { - strm.msg = 'invalid literal/lengths set'; - state.mode = BAD; - break; - } - - state.distbits = 6; - //state.distcode.copy(state.codes); - // Switch to use dynamic table - state.distcode = state.distdyn; - opts = { bits: state.distbits }; - ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); - // We have separate tables & no pointers. 2 commented lines below not needed. - // state.next_index = opts.table_index; - state.distbits = opts.bits; - // state.distcode = state.next; - - if (ret) { - strm.msg = 'invalid distances set'; - state.mode = BAD; - break; - } - //Tracev((stderr, 'inflate: codes ok\n')); - state.mode = LEN_; - if (flush === Z_TREES) { break inf_leave; } - /* falls through */ - case LEN_: - state.mode = LEN; - /* falls through */ - case LEN: - if (have >= 6 && left >= 258) { - //--- RESTORE() --- - strm.next_out = put; - strm.avail_out = left; - strm.next_in = next; - strm.avail_in = have; - state.hold = hold; - state.bits = bits; - //--- - inflate_fast(strm, _out); - //--- LOAD() --- - put = strm.next_out; - output = strm.output; - left = strm.avail_out; - next = strm.next_in; - input = strm.input; - have = strm.avail_in; - hold = state.hold; - bits = state.bits; - //--- - - if (state.mode === TYPE) { - state.back = -1; - } - break; - } - state.back = 0; - for (;;) { - here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/ - here_bits = here >>> 24; - here_op = (here >>> 16) & 0xff; - here_val = here & 0xffff; - - if (here_bits <= bits) { break; } - //--- PULLBYTE() ---// - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - //---// - } - if (here_op && (here_op & 0xf0) === 0) { - last_bits = here_bits; - last_op = here_op; - last_val = here_val; - for (;;) { - here = state.lencode[last_val + - ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)]; - here_bits = here >>> 24; - here_op = (here >>> 16) & 0xff; - here_val = here & 0xffff; - - if ((last_bits + here_bits) <= bits) { break; } - //--- PULLBYTE() ---// - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - //---// - } - //--- DROPBITS(last.bits) ---// - hold >>>= last_bits; - bits -= last_bits; - //---// - state.back += last_bits; - } - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - state.back += here_bits; - state.length = here_val; - if (here_op === 0) { - //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? - // "inflate: literal '%c'\n" : - // "inflate: literal 0x%02x\n", here.val)); - state.mode = LIT; - break; - } - if (here_op & 32) { - //Tracevv((stderr, "inflate: end of block\n")); - state.back = -1; - state.mode = TYPE; - break; - } - if (here_op & 64) { - strm.msg = 'invalid literal/length code'; - state.mode = BAD; - break; - } - state.extra = here_op & 15; - state.mode = LENEXT; - /* falls through */ - case LENEXT: - if (state.extra) { - //=== NEEDBITS(state.extra); - n = state.extra; - while (bits < n) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/; - //--- DROPBITS(state.extra) ---// - hold >>>= state.extra; - bits -= state.extra; - //---// - state.back += state.extra; - } - //Tracevv((stderr, "inflate: length %u\n", state.length)); - state.was = state.length; - state.mode = DIST; - /* falls through */ - case DIST: - for (;;) { - here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/ - here_bits = here >>> 24; - here_op = (here >>> 16) & 0xff; - here_val = here & 0xffff; - - if ((here_bits) <= bits) { break; } - //--- PULLBYTE() ---// - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - //---// - } - if ((here_op & 0xf0) === 0) { - last_bits = here_bits; - last_op = here_op; - last_val = here_val; - for (;;) { - here = state.distcode[last_val + - ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)]; - here_bits = here >>> 24; - here_op = (here >>> 16) & 0xff; - here_val = here & 0xffff; - - if ((last_bits + here_bits) <= bits) { break; } - //--- PULLBYTE() ---// - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - //---// - } - //--- DROPBITS(last.bits) ---// - hold >>>= last_bits; - bits -= last_bits; - //---// - state.back += last_bits; - } - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - state.back += here_bits; - if (here_op & 64) { - strm.msg = 'invalid distance code'; - state.mode = BAD; - break; - } - state.offset = here_val; - state.extra = (here_op) & 15; - state.mode = DISTEXT; - /* falls through */ - case DISTEXT: - if (state.extra) { - //=== NEEDBITS(state.extra); - n = state.extra; - while (bits < n) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/; - //--- DROPBITS(state.extra) ---// - hold >>>= state.extra; - bits -= state.extra; - //---// - state.back += state.extra; - } -//#ifdef INFLATE_STRICT - if (state.offset > state.dmax) { - strm.msg = 'invalid distance too far back'; - state.mode = BAD; - break; - } -//#endif - //Tracevv((stderr, "inflate: distance %u\n", state.offset)); - state.mode = MATCH; - /* falls through */ - case MATCH: - if (left === 0) { break inf_leave; } - copy = _out - left; - if (state.offset > copy) { /* copy from window */ - copy = state.offset - copy; - if (copy > state.whave) { - if (state.sane) { - strm.msg = 'invalid distance too far back'; - state.mode = BAD; - break; - } -// (!) This block is disabled in zlib defaults, -// don't enable it for binary compatibility -//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR -// Trace((stderr, "inflate.c too far\n")); -// copy -= state.whave; -// if (copy > state.length) { copy = state.length; } -// if (copy > left) { copy = left; } -// left -= copy; -// state.length -= copy; -// do { -// output[put++] = 0; -// } while (--copy); -// if (state.length === 0) { state.mode = LEN; } -// break; -//#endif - } - if (copy > state.wnext) { - copy -= state.wnext; - from = state.wsize - copy; - } - else { - from = state.wnext - copy; - } - if (copy > state.length) { copy = state.length; } - from_source = state.window; - } - else { /* copy from output */ - from_source = output; - from = put - state.offset; - copy = state.length; - } - if (copy > left) { copy = left; } - left -= copy; - state.length -= copy; - do { - output[put++] = from_source[from++]; - } while (--copy); - if (state.length === 0) { state.mode = LEN; } - break; - case LIT: - if (left === 0) { break inf_leave; } - output[put++] = state.length; - left--; - state.mode = LEN; - break; - case CHECK: - if (state.wrap) { - //=== NEEDBITS(32); - while (bits < 32) { - if (have === 0) { break inf_leave; } - have--; - // Use '|' instead of '+' to make sure that result is signed - hold |= input[next++] << bits; - bits += 8; - } - //===// - _out -= left; - strm.total_out += _out; - state.total += _out; - if (_out) { - strm.adler = state.check = - /*UPDATE(state.check, put - _out, _out);*/ - (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out)); - - } - _out = left; - // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too - if ((state.flags ? hold : zswap32(hold)) !== state.check) { - strm.msg = 'incorrect data check'; - state.mode = BAD; - break; - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - //Tracev((stderr, "inflate: check matches trailer\n")); - } - state.mode = LENGTH; - /* falls through */ - case LENGTH: - if (state.wrap && state.flags) { - //=== NEEDBITS(32); - while (bits < 32) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - if (hold !== (state.total & 0xffffffff)) { - strm.msg = 'incorrect length check'; - state.mode = BAD; - break; - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - //Tracev((stderr, "inflate: length matches trailer\n")); - } - state.mode = DONE; - /* falls through */ - case DONE: - ret = Z_STREAM_END; - break inf_leave; - case BAD: - ret = Z_DATA_ERROR; - break inf_leave; - case MEM: - return Z_MEM_ERROR; - case SYNC: - /* falls through */ - default: - return Z_STREAM_ERROR; - } - } - - // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave" - - /* - Return from inflate(), updating the total counts and the check value. - If there was no progress during the inflate() call, return a buffer - error. Call updatewindow() to create and/or update the window state. - Note: a memory error from inflate() is non-recoverable. - */ - - //--- RESTORE() --- - strm.next_out = put; - strm.avail_out = left; - strm.next_in = next; - strm.avail_in = have; - state.hold = hold; - state.bits = bits; - //--- - - if (state.wsize || (_out !== strm.avail_out && state.mode < BAD && - (state.mode < CHECK || flush !== Z_FINISH))) { - if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) { - state.mode = MEM; - return Z_MEM_ERROR; - } - } - _in -= strm.avail_in; - _out -= strm.avail_out; - strm.total_in += _in; - strm.total_out += _out; - state.total += _out; - if (state.wrap && _out) { - strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ - (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out)); - } - strm.data_type = state.bits + (state.last ? 64 : 0) + - (state.mode === TYPE ? 128 : 0) + - (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); - if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) { - ret = Z_BUF_ERROR; - } - return ret; -} - -function inflateEnd(strm) { - - if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) { - return Z_STREAM_ERROR; - } - - var state = strm.state; - if (state.window) { - state.window = null; - } - strm.state = null; - return Z_OK; -} - -function inflateGetHeader(strm, head) { - var state; - - /* check state */ - if (!strm || !strm.state) { return Z_STREAM_ERROR; } - state = strm.state; - if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; } - - /* save header structure */ - state.head = head; - head.done = false; - return Z_OK; -} - -function inflateSetDictionary(strm, dictionary) { - var dictLength = dictionary.length; - - var state; - var dictid; - var ret; - - /* check state */ - if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; } - state = strm.state; - - if (state.wrap !== 0 && state.mode !== DICT) { - return Z_STREAM_ERROR; - } - - /* check for correct dictionary identifier */ - if (state.mode === DICT) { - dictid = 1; /* adler32(0, null, 0)*/ - /* dictid = adler32(dictid, dictionary, dictLength); */ - dictid = adler32(dictid, dictionary, dictLength, 0); - if (dictid !== state.check) { - return Z_DATA_ERROR; - } - } - /* copy dictionary to window using updatewindow(), which will amend the - existing dictionary if appropriate */ - ret = updatewindow(strm, dictionary, dictLength, dictLength); - if (ret) { - state.mode = MEM; - return Z_MEM_ERROR; - } - state.havedict = 1; - // Tracev((stderr, "inflate: dictionary set\n")); - return Z_OK; -} - -exports.inflateReset = inflateReset; -exports.inflateReset2 = inflateReset2; -exports.inflateResetKeep = inflateResetKeep; -exports.inflateInit = inflateInit; -exports.inflateInit2 = inflateInit2; -exports.inflate = inflate; -exports.inflateEnd = inflateEnd; -exports.inflateGetHeader = inflateGetHeader; -exports.inflateSetDictionary = inflateSetDictionary; -exports.inflateInfo = 'pako inflate (from Nodeca project)'; - -/* Not implemented -exports.inflateCopy = inflateCopy; -exports.inflateGetDictionary = inflateGetDictionary; -exports.inflateMark = inflateMark; -exports.inflatePrime = inflatePrime; -exports.inflateSync = inflateSync; -exports.inflateSyncPoint = inflateSyncPoint; -exports.inflateUndermine = inflateUndermine; -*/ - -},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(require,module,exports){ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -var utils = require('../utils/common'); - -var MAXBITS = 15; -var ENOUGH_LENS = 852; -var ENOUGH_DISTS = 592; -//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); - -var CODES = 0; -var LENS = 1; -var DISTS = 2; - -var lbase = [ /* Length codes 257..285 base */ - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, - 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 -]; - -var lext = [ /* Length codes 257..285 extra */ - 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78 -]; - -var dbase = [ /* Distance codes 0..29 base */ - 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, - 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, - 8193, 12289, 16385, 24577, 0, 0 -]; - -var dext = [ /* Distance codes 0..29 extra */ - 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, - 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, - 28, 28, 29, 29, 64, 64 -]; - -module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) -{ - var bits = opts.bits; - //here = opts.here; /* table entry for duplication */ - - var len = 0; /* a code's length in bits */ - var sym = 0; /* index of code symbols */ - var min = 0, max = 0; /* minimum and maximum code lengths */ - var root = 0; /* number of index bits for root table */ - var curr = 0; /* number of index bits for current table */ - var drop = 0; /* code bits to drop for sub-table */ - var left = 0; /* number of prefix codes available */ - var used = 0; /* code entries in table used */ - var huff = 0; /* Huffman code */ - var incr; /* for incrementing code, index */ - var fill; /* index for replicating entries */ - var low; /* low bits for current root entry */ - var mask; /* mask for low root bits */ - var next; /* next available space in table */ - var base = null; /* base value table to use */ - var base_index = 0; -// var shoextra; /* extra bits table to use */ - var end; /* use base and extra for symbol > end */ - var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */ - var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */ - var extra = null; - var extra_index = 0; - - var here_bits, here_op, here_val; - - /* - Process a set of code lengths to create a canonical Huffman code. The - code lengths are lens[0..codes-1]. Each length corresponds to the - symbols 0..codes-1. The Huffman code is generated by first sorting the - symbols by length from short to long, and retaining the symbol order - for codes with equal lengths. Then the code starts with all zero bits - for the first code of the shortest length, and the codes are integer - increments for the same length, and zeros are appended as the length - increases. For the deflate format, these bits are stored backwards - from their more natural integer increment ordering, and so when the - decoding tables are built in the large loop below, the integer codes - are incremented backwards. - - This routine assumes, but does not check, that all of the entries in - lens[] are in the range 0..MAXBITS. The caller must assure this. - 1..MAXBITS is interpreted as that code length. zero means that that - symbol does not occur in this code. - - The codes are sorted by computing a count of codes for each length, - creating from that a table of starting indices for each length in the - sorted table, and then entering the symbols in order in the sorted - table. The sorted table is work[], with that space being provided by - the caller. - - The length counts are used for other purposes as well, i.e. finding - the minimum and maximum length codes, determining if there are any - codes at all, checking for a valid set of lengths, and looking ahead - at length counts to determine sub-table sizes when building the - decoding tables. - */ - - /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ - for (len = 0; len <= MAXBITS; len++) { - count[len] = 0; - } - for (sym = 0; sym < codes; sym++) { - count[lens[lens_index + sym]]++; - } - - /* bound code lengths, force root to be within code lengths */ - root = bits; - for (max = MAXBITS; max >= 1; max--) { - if (count[max] !== 0) { break; } - } - if (root > max) { - root = max; - } - if (max === 0) { /* no symbols to code at all */ - //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */ - //table.bits[opts.table_index] = 1; //here.bits = (var char)1; - //table.val[opts.table_index++] = 0; //here.val = (var short)0; - table[table_index++] = (1 << 24) | (64 << 16) | 0; - - - //table.op[opts.table_index] = 64; - //table.bits[opts.table_index] = 1; - //table.val[opts.table_index++] = 0; - table[table_index++] = (1 << 24) | (64 << 16) | 0; - - opts.bits = 1; - return 0; /* no symbols, but wait for decoding to report error */ - } - for (min = 1; min < max; min++) { - if (count[min] !== 0) { break; } - } - if (root < min) { - root = min; - } - - /* check for an over-subscribed or incomplete set of lengths */ - left = 1; - for (len = 1; len <= MAXBITS; len++) { - left <<= 1; - left -= count[len]; - if (left < 0) { - return -1; - } /* over-subscribed */ - } - if (left > 0 && (type === CODES || max !== 1)) { - return -1; /* incomplete set */ - } - - /* generate offsets into symbol table for each length for sorting */ - offs[1] = 0; - for (len = 1; len < MAXBITS; len++) { - offs[len + 1] = offs[len] + count[len]; - } - - /* sort symbols by length, by symbol order within each length */ - for (sym = 0; sym < codes; sym++) { - if (lens[lens_index + sym] !== 0) { - work[offs[lens[lens_index + sym]]++] = sym; - } - } - - /* - Create and fill in decoding tables. In this loop, the table being - filled is at next and has curr index bits. The code being used is huff - with length len. That code is converted to an index by dropping drop - bits off of the bottom. For codes where len is less than drop + curr, - those top drop + curr - len bits are incremented through all values to - fill the table with replicated entries. - - root is the number of index bits for the root table. When len exceeds - root, sub-tables are created pointed to by the root entry with an index - of the low root bits of huff. This is saved in low to check for when a - new sub-table should be started. drop is zero when the root table is - being filled, and drop is root when sub-tables are being filled. - - When a new sub-table is needed, it is necessary to look ahead in the - code lengths to determine what size sub-table is needed. The length - counts are used for this, and so count[] is decremented as codes are - entered in the tables. - - used keeps track of how many table entries have been allocated from the - provided *table space. It is checked for LENS and DIST tables against - the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in - the initial root table size constants. See the comments in inftrees.h - for more information. - - sym increments through all symbols, and the loop terminates when - all codes of length max, i.e. all codes, have been processed. This - routine permits incomplete codes, so another loop after this one fills - in the rest of the decoding tables with invalid code markers. - */ - - /* set up for code type */ - // poor man optimization - use if-else instead of switch, - // to avoid deopts in old v8 - if (type === CODES) { - base = extra = work; /* dummy value--not used */ - end = 19; - - } else if (type === LENS) { - base = lbase; - base_index -= 257; - extra = lext; - extra_index -= 257; - end = 256; - - } else { /* DISTS */ - base = dbase; - extra = dext; - end = -1; - } - - /* initialize opts for loop */ - huff = 0; /* starting code */ - sym = 0; /* starting code symbol */ - len = min; /* starting code length */ - next = table_index; /* current table to fill in */ - curr = root; /* current table index bits */ - drop = 0; /* current bits to drop from code for index */ - low = -1; /* trigger new sub-table when len > root */ - used = 1 << root; /* use root table entries */ - mask = used - 1; /* mask for comparing low */ - - /* check available table space */ - if ((type === LENS && used > ENOUGH_LENS) || - (type === DISTS && used > ENOUGH_DISTS)) { - return 1; - } - - /* process all codes and make table entries */ - for (;;) { - /* create table entry */ - here_bits = len - drop; - if (work[sym] < end) { - here_op = 0; - here_val = work[sym]; - } - else if (work[sym] > end) { - here_op = extra[extra_index + work[sym]]; - here_val = base[base_index + work[sym]]; - } - else { - here_op = 32 + 64; /* end of block */ - here_val = 0; - } - - /* replicate for those indices with low len bits equal to huff */ - incr = 1 << (len - drop); - fill = 1 << curr; - min = fill; /* save offset to next table */ - do { - fill -= incr; - table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0; - } while (fill !== 0); - - /* backwards increment the len-bit code huff */ - incr = 1 << (len - 1); - while (huff & incr) { - incr >>= 1; - } - if (incr !== 0) { - huff &= incr - 1; - huff += incr; - } else { - huff = 0; - } - - /* go to next symbol, update count, len */ - sym++; - if (--count[len] === 0) { - if (len === max) { break; } - len = lens[lens_index + work[sym]]; - } - - /* create new sub-table if needed */ - if (len > root && (huff & mask) !== low) { - /* if first time, transition to sub-tables */ - if (drop === 0) { - drop = root; - } - - /* increment past last table */ - next += min; /* here min is 1 << curr */ - - /* determine length of next table */ - curr = len - drop; - left = 1 << curr; - while (curr + drop < max) { - left -= count[curr + drop]; - if (left <= 0) { break; } - curr++; - left <<= 1; - } - - /* check for enough space */ - used += 1 << curr; - if ((type === LENS && used > ENOUGH_LENS) || - (type === DISTS && used > ENOUGH_DISTS)) { - return 1; - } - - /* point entry in root table to sub-table */ - low = huff & mask; - /*table.op[low] = curr; - table.bits[low] = root; - table.val[low] = next - opts.table_index;*/ - table[low] = (root << 24) | (curr << 16) | (next - table_index) |0; - } - } - - /* fill in remaining table entry if code is incomplete (guaranteed to have - at most one remaining entry, since if the code is incomplete, the - maximum code length that was allowed to get this far is one bit) */ - if (huff !== 0) { - //table.op[next + huff] = 64; /* invalid code marker */ - //table.bits[next + huff] = len - drop; - //table.val[next + huff] = 0; - table[next + huff] = ((len - drop) << 24) | (64 << 16) |0; - } - - /* set return parameters */ - //opts.table_index += used; - opts.bits = root; - return 0; -}; - -},{"../utils/common":1}],10:[function(require,module,exports){ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -module.exports = { - 2: 'need dictionary', /* Z_NEED_DICT 2 */ - 1: 'stream end', /* Z_STREAM_END 1 */ - 0: '', /* Z_OK 0 */ - '-1': 'file error', /* Z_ERRNO (-1) */ - '-2': 'stream error', /* Z_STREAM_ERROR (-2) */ - '-3': 'data error', /* Z_DATA_ERROR (-3) */ - '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */ - '-5': 'buffer error', /* Z_BUF_ERROR (-5) */ - '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */ -}; - -},{}],11:[function(require,module,exports){ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -function ZStream() { - /* next input byte */ - this.input = null; // JS specific, because we have no pointers - this.next_in = 0; - /* number of bytes available at input */ - this.avail_in = 0; - /* total number of input bytes read so far */ - this.total_in = 0; - /* next output byte should be put there */ - this.output = null; // JS specific, because we have no pointers - this.next_out = 0; - /* remaining free space at output */ - this.avail_out = 0; - /* total number of bytes output so far */ - this.total_out = 0; - /* last error message, NULL if no error */ - this.msg = ''/*Z_NULL*/; - /* not visible by applications */ - this.state = null; - /* best guess about the data type: binary or text */ - this.data_type = 2/*Z_UNKNOWN*/; - /* adler32 value of the uncompressed data */ - this.adler = 0; -} - -module.exports = ZStream; - -},{}],"/lib/inflate.js":[function(require,module,exports){ -'use strict'; - - -var zlib_inflate = require('./zlib/inflate'); -var utils = require('./utils/common'); -var strings = require('./utils/strings'); -var c = require('./zlib/constants'); -var msg = require('./zlib/messages'); -var ZStream = require('./zlib/zstream'); -var GZheader = require('./zlib/gzheader'); - -var toString = Object.prototype.toString; - -/** - * class Inflate - * - * Generic JS-style wrapper for zlib calls. If you don't need - * streaming behaviour - use more simple functions: [[inflate]] - * and [[inflateRaw]]. - **/ - -/* internal - * inflate.chunks -> Array - * - * Chunks of output data, if [[Inflate#onData]] not overridden. - **/ - -/** - * Inflate.result -> Uint8Array|Array|String - * - * Uncompressed result, generated by default [[Inflate#onData]] - * and [[Inflate#onEnd]] handlers. Filled after you push last chunk - * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you - * push a chunk with explicit flush (call [[Inflate#push]] with - * `Z_SYNC_FLUSH` param). - **/ - -/** - * Inflate.err -> Number - * - * Error code after inflate finished. 0 (Z_OK) on success. - * Should be checked if broken data possible. - **/ - -/** - * Inflate.msg -> String - * - * Error message, if [[Inflate.err]] != 0 - **/ - - -/** - * new Inflate(options) - * - options (Object): zlib inflate options. - * - * Creates new inflator instance with specified params. Throws exception - * on bad params. Supported options: - * - * - `windowBits` - * - `dictionary` - * - * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) - * for more information on these. - * - * Additional options, for internal needs: - * - * - `chunkSize` - size of generated data chunks (16K by default) - * - `raw` (Boolean) - do raw inflate - * - `to` (String) - if equal to 'string', then result will be converted - * from utf8 to utf16 (javascript) string. When string output requested, - * chunk length can differ from `chunkSize`, depending on content. - * - * By default, when no options set, autodetect deflate/gzip data format via - * wrapper header. - * - * ##### Example: - * - * ```javascript - * var pako = require('pako') - * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) - * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); - * - * var inflate = new pako.Inflate({ level: 3}); - * - * inflate.push(chunk1, false); - * inflate.push(chunk2, true); // true -> last chunk - * - * if (inflate.err) { throw new Error(inflate.err); } - * - * console.log(inflate.result); - * ``` - **/ -function Inflate(options) { - if (!(this instanceof Inflate)) return new Inflate(options); - - this.options = utils.assign({ - chunkSize: 16384, - windowBits: 0, - to: '' - }, options || {}); - - var opt = this.options; - - // Force window size for `raw` data, if not set directly, - // because we have no header for autodetect. - if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) { - opt.windowBits = -opt.windowBits; - if (opt.windowBits === 0) { opt.windowBits = -15; } - } - - // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate - if ((opt.windowBits >= 0) && (opt.windowBits < 16) && - !(options && options.windowBits)) { - opt.windowBits += 32; - } - - // Gzip header has no info about windows size, we can do autodetect only - // for deflate. So, if window size not set, force it to max when gzip possible - if ((opt.windowBits > 15) && (opt.windowBits < 48)) { - // bit 3 (16) -> gzipped data - // bit 4 (32) -> autodetect gzip/deflate - if ((opt.windowBits & 15) === 0) { - opt.windowBits |= 15; - } - } - - this.err = 0; // error code, if happens (0 = Z_OK) - this.msg = ''; // error message - this.ended = false; // used to avoid multiple onEnd() calls - this.chunks = []; // chunks of compressed data - - this.strm = new ZStream(); - this.strm.avail_out = 0; - - var status = zlib_inflate.inflateInit2( - this.strm, - opt.windowBits - ); - - if (status !== c.Z_OK) { - throw new Error(msg[status]); - } - - this.header = new GZheader(); - - zlib_inflate.inflateGetHeader(this.strm, this.header); -} - -/** - * Inflate#push(data[, mode]) -> Boolean - * - data (Uint8Array|Array|ArrayBuffer|String): input data - * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. - * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH. - * - * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with - * new output chunks. Returns `true` on success. The last data block must have - * mode Z_FINISH (or `true`). That will flush internal pending buffers and call - * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you - * can use mode Z_SYNC_FLUSH, keeping the decompression context. - * - * On fail call [[Inflate#onEnd]] with error code and return false. - * - * We strongly recommend to use `Uint8Array` on input for best speed (output - * format is detected automatically). Also, don't skip last param and always - * use the same type in your code (boolean or number). That will improve JS speed. - * - * For regular `Array`-s make sure all elements are [0..255]. - * - * ##### Example - * - * ```javascript - * push(chunk, false); // push one of data chunks - * ... - * push(chunk, true); // push last chunk - * ``` - **/ -Inflate.prototype.push = function (data, mode) { - var strm = this.strm; - var chunkSize = this.options.chunkSize; - var dictionary = this.options.dictionary; - var status, _mode; - var next_out_utf8, tail, utf8str; - var dict; - - // Flag to properly process Z_BUF_ERROR on testing inflate call - // when we check that all output data was flushed. - var allowBufError = false; - - if (this.ended) { return false; } - _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH); - - // Convert data if needed - if (typeof data === 'string') { - // Only binary strings can be decompressed on practice - strm.input = strings.binstring2buf(data); - } else if (toString.call(data) === '[object ArrayBuffer]') { - strm.input = new Uint8Array(data); - } else { - strm.input = data; - } - - strm.next_in = 0; - strm.avail_in = strm.input.length; - - do { - if (strm.avail_out === 0) { - strm.output = new utils.Buf8(chunkSize); - strm.next_out = 0; - strm.avail_out = chunkSize; - } - - status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */ - - if (status === c.Z_NEED_DICT && dictionary) { - // Convert data if needed - if (typeof dictionary === 'string') { - dict = strings.string2buf(dictionary); - } else if (toString.call(dictionary) === '[object ArrayBuffer]') { - dict = new Uint8Array(dictionary); - } else { - dict = dictionary; - } - - status = zlib_inflate.inflateSetDictionary(this.strm, dict); - - } - - if (status === c.Z_BUF_ERROR && allowBufError === true) { - status = c.Z_OK; - allowBufError = false; - } - - if (status !== c.Z_STREAM_END && status !== c.Z_OK) { - this.onEnd(status); - this.ended = true; - return false; - } - - if (strm.next_out) { - if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) { - - if (this.options.to === 'string') { - - next_out_utf8 = strings.utf8border(strm.output, strm.next_out); - - tail = strm.next_out - next_out_utf8; - utf8str = strings.buf2string(strm.output, next_out_utf8); - - // move tail - strm.next_out = tail; - strm.avail_out = chunkSize - tail; - if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); } - - this.onData(utf8str); - - } else { - this.onData(utils.shrinkBuf(strm.output, strm.next_out)); - } - } - } - - // When no more input data, we should check that internal inflate buffers - // are flushed. The only way to do it when avail_out = 0 - run one more - // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR. - // Here we set flag to process this error properly. - // - // NOTE. Deflate does not return error in this case and does not needs such - // logic. - if (strm.avail_in === 0 && strm.avail_out === 0) { - allowBufError = true; - } - - } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END); - - if (status === c.Z_STREAM_END) { - _mode = c.Z_FINISH; - } - - // Finalize on the last chunk. - if (_mode === c.Z_FINISH) { - status = zlib_inflate.inflateEnd(this.strm); - this.onEnd(status); - this.ended = true; - return status === c.Z_OK; - } - - // callback interim results if Z_SYNC_FLUSH. - if (_mode === c.Z_SYNC_FLUSH) { - this.onEnd(c.Z_OK); - strm.avail_out = 0; - return true; - } - - return true; -}; - - -/** - * Inflate#onData(chunk) -> Void - * - chunk (Uint8Array|Array|String): output data. Type of array depends - * on js engine support. When string output requested, each chunk - * will be string. - * - * By default, stores data blocks in `chunks[]` property and glue - * those in `onEnd`. Override this handler, if you need another behaviour. - **/ -Inflate.prototype.onData = function (chunk) { - this.chunks.push(chunk); -}; - - -/** - * Inflate#onEnd(status) -> Void - * - status (Number): inflate status. 0 (Z_OK) on success, - * other if not. - * - * Called either after you tell inflate that the input stream is - * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH) - * or if an error happened. By default - join collected chunks, - * free memory and fill `results` / `err` properties. - **/ -Inflate.prototype.onEnd = function (status) { - // On success - join - if (status === c.Z_OK) { - if (this.options.to === 'string') { - // Glue & convert here, until we teach pako to send - // utf8 aligned strings to onData - this.result = this.chunks.join(''); - } else { - this.result = utils.flattenChunks(this.chunks); - } - } - this.chunks = []; - this.err = status; - this.msg = this.strm.msg; -}; - - -/** - * inflate(data[, options]) -> Uint8Array|Array|String - * - data (Uint8Array|Array|String): input data to decompress. - * - options (Object): zlib inflate options. - * - * Decompress `data` with inflate/ungzip and `options`. Autodetect - * format via wrapper header by default. That's why we don't provide - * separate `ungzip` method. - * - * Supported options are: - * - * - windowBits - * - * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) - * for more information. - * - * Sugar (options): - * - * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify - * negative windowBits implicitly. - * - `to` (String) - if equal to 'string', then result will be converted - * from utf8 to utf16 (javascript) string. When string output requested, - * chunk length can differ from `chunkSize`, depending on content. - * - * - * ##### Example: - * - * ```javascript - * var pako = require('pako') - * , input = pako.deflate([1,2,3,4,5,6,7,8,9]) - * , output; - * - * try { - * output = pako.inflate(input); - * } catch (err) - * console.log(err); - * } - * ``` - **/ -function inflate(input, options) { - var inflator = new Inflate(options); - - inflator.push(input, true); - - // That will never happens, if you don't cheat with options :) - if (inflator.err) { throw inflator.msg || msg[inflator.err]; } - - return inflator.result; -} - - -/** - * inflateRaw(data[, options]) -> Uint8Array|Array|String - * - data (Uint8Array|Array|String): input data to decompress. - * - options (Object): zlib inflate options. - * - * The same as [[inflate]], but creates raw data, without wrapper - * (header and adler32 crc). - **/ -function inflateRaw(input, options) { - options = options || {}; - options.raw = true; - return inflate(input, options); -} - - -/** - * ungzip(data[, options]) -> Uint8Array|Array|String - * - data (Uint8Array|Array|String): input data to decompress. - * - options (Object): zlib inflate options. - * - * Just shortcut to [[inflate]], because it autodetects format - * by header.content. Done for convenience. - **/ - - -exports.Inflate = Inflate; -exports.inflate = inflate; -exports.inflateRaw = inflateRaw; -exports.ungzip = inflate; - -},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js") -}); \ No newline at end of file diff --git a/node_modules/pako/dist/pako_inflate.min.js b/node_modules/pako/dist/pako_inflate.min.js deleted file mode 100644 index 466cd74a5..000000000 --- a/node_modules/pako/dist/pako_inflate.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).pako=e()}}(function(){return function e(t,i,n){function a(o,s){if(!i[o]){if(!t[o]){var f="function"==typeof require&&require;if(!s&&f)return f(o,!0);if(r)return r(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var d=i[o]={exports:{}};t[o][0].call(d.exports,function(e){var i=t[o][1][e];return a(i||e)},d,d.exports,e,t,i,n)}return i[o].exports}for(var r="function"==typeof require&&require,o=0;o=252?6:f>=248?5:f>=240?4:f>=224?3:f>=192?2:1;s[254]=s[254]=1,i.string2buf=function(e){var t,i,n,r,o,s=e.length,f=0;for(r=0;r>>6,t[o++]=128|63&i):i<65536?(t[o++]=224|i>>>12,t[o++]=128|i>>>6&63,t[o++]=128|63&i):(t[o++]=240|i>>>18,t[o++]=128|i>>>12&63,t[o++]=128|i>>>6&63,t[o++]=128|63&i);return t},i.buf2binstring=function(e){return n(e,e.length)},i.binstring2buf=function(e){for(var t=new a.Buf8(e.length),i=0,n=t.length;i4)l[a++]=65533,i+=o-1;else{for(r&=2===o?31:3===o?15:7;o>1&&i1?l[a++]=65533:r<65536?l[a++]=r:(r-=65536,l[a++]=55296|r>>10&1023,l[a++]=56320|1023&r)}return n(l,a)},i.utf8border=function(e,t){var i;for((t=t||e.length)>e.length&&(t=e.length),i=t-1;i>=0&&128==(192&e[i]);)i--;return i<0?t:0===i?t:i+s[e[i]]>t?i:t}},{"./common":1}],3:[function(e,t,i){"use strict";t.exports=function(e,t,i,n){for(var a=65535&e|0,r=e>>>16&65535|0,o=0;0!==i;){i-=o=i>2e3?2e3:i;do{r=r+(a=a+t[n++]|0)|0}while(--o);a%=65521,r%=65521}return a|r<<16|0}},{}],4:[function(e,t,i){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(e,t,i){"use strict";var n=function(){for(var e,t=[],i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}();t.exports=function(e,t,i,a){var r=n,o=a+i;e^=-1;for(var s=a;s>>8^r[255&(e^t[s])];return-1^e}},{}],6:[function(e,t,i){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],7:[function(e,t,i){"use strict";t.exports=function(e,t){var i,n,a,r,o,s,f,l,d,u,c,h,b,w,m,k,_,g,v,p,x,y,S,E,B;i=e.state,n=e.next_in,E=e.input,a=n+(e.avail_in-5),r=e.next_out,B=e.output,o=r-(t-e.avail_out),s=r+(e.avail_out-257),f=i.dmax,l=i.wsize,d=i.whave,u=i.wnext,c=i.window,h=i.hold,b=i.bits,w=i.lencode,m=i.distcode,k=(1<>>24,h>>>=v,b-=v,0===(v=g>>>16&255))B[r++]=65535&g;else{if(!(16&v)){if(0==(64&v)){g=w[(65535&g)+(h&(1<>>=v,b-=v),b<15&&(h+=E[n++]<>>24,h>>>=v,b-=v,!(16&(v=g>>>16&255))){if(0==(64&v)){g=m[(65535&g)+(h&(1<f){e.msg="invalid distance too far back",i.mode=30;break e}if(h>>>=v,b-=v,v=r-o,x>v){if((v=x-v)>d&&i.sane){e.msg="invalid distance too far back",i.mode=30;break e}if(y=0,S=c,0===u){if(y+=l-v,v2;)B[r++]=S[y++],B[r++]=S[y++],B[r++]=S[y++],p-=3;p&&(B[r++]=S[y++],p>1&&(B[r++]=S[y++]))}else{y=r-x;do{B[r++]=B[y++],B[r++]=B[y++],B[r++]=B[y++],p-=3}while(p>2);p&&(B[r++]=B[y++],p>1&&(B[r++]=B[y++]))}break}}break}}while(n>3,h&=(1<<(b-=p<<3))-1,e.next_in=n,e.next_out=r,e.avail_in=n>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function a(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new h.Buf16(320),this.work=new h.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function r(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=O,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new h.Buf32(de),t.distcode=t.distdyn=new h.Buf32(ue),t.sane=1,t.back=-1,S):Z}function o(e){var t;return e&&e.state?(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,r(e)):Z}function s(e,t){var i,n;return e&&e.state?(n=e.state,t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Z:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,o(e))):Z}function f(e,t){var i,n;return e?(n=new a,e.state=n,n.window=null,(i=s(e,t))!==S&&(e.state=null),i):Z}function l(e){if(he){var t;for(u=new h.Buf32(512),c=new h.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(k(g,e.lens,0,288,u,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;k(v,e.lens,0,32,c,0,e.work,{bits:5}),he=!1}e.lencode=u,e.lenbits=9,e.distcode=c,e.distbits=5}function d(e,t,i,n){var a,r=e.state;return null===r.window&&(r.wsize=1<=r.wsize?(h.arraySet(r.window,t,i-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):((a=r.wsize-r.wnext)>n&&(a=n),h.arraySet(r.window,t,i-n,a,r.wnext),(n-=a)?(h.arraySet(r.window,t,i-n,n,0),r.wnext=n,r.whave=r.wsize):(r.wnext+=a,r.wnext===r.wsize&&(r.wnext=0),r.whave>>8&255,i.check=w(i.check,Ze,2,0),c=0,de=0,i.mode=C;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",i.mode=se;break}if((15&c)!==N){e.msg="unknown compression method",i.mode=se;break}if(c>>>=4,de-=4,xe=8+(15&c),0===i.wbits)i.wbits=xe;else if(xe>i.wbits){e.msg="invalid window size",i.mode=se;break}i.dmax=1<>8&1),512&i.flags&&(Ze[0]=255&c,Ze[1]=c>>>8&255,i.check=w(i.check,Ze,2,0)),c=0,de=0,i.mode=I;case I:for(;de<32;){if(0===f)break e;f--,c+=a[o++]<>>8&255,Ze[2]=c>>>16&255,Ze[3]=c>>>24&255,i.check=w(i.check,Ze,4,0)),c=0,de=0,i.mode=T;case T:for(;de<16;){if(0===f)break e;f--,c+=a[o++]<>8),512&i.flags&&(Ze[0]=255&c,Ze[1]=c>>>8&255,i.check=w(i.check,Ze,2,0)),c=0,de=0,i.mode=U;case U:if(1024&i.flags){for(;de<16;){if(0===f)break e;f--,c+=a[o++]<>>8&255,i.check=w(i.check,Ze,2,0)),c=0,de=0}else i.head&&(i.head.extra=null);i.mode=D;case D:if(1024&i.flags&&((he=i.length)>f&&(he=f),he&&(i.head&&(xe=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),h.arraySet(i.head.extra,a,o,he,xe)),512&i.flags&&(i.check=w(i.check,a,he,o)),f-=he,o+=he,i.length-=he),i.length))break e;i.length=0,i.mode=F;case F:if(2048&i.flags){if(0===f)break e;he=0;do{xe=a[o+he++],i.head&&xe&&i.length<65536&&(i.head.name+=String.fromCharCode(xe))}while(xe&&he>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=K;break;case j:for(;de<32;){if(0===f)break e;f--,c+=a[o++]<>>=7&de,de-=7&de,i.mode=ae;break}for(;de<3;){if(0===f)break e;f--,c+=a[o++]<>>=1,de-=1,3&c){case 0:i.mode=Y;break;case 1:if(l(i),i.mode=Q,t===y){c>>>=2,de-=2;break e}break;case 2:i.mode=X;break;case 3:e.msg="invalid block type",i.mode=se}c>>>=2,de-=2;break;case Y:for(c>>>=7&de,de-=7&de;de<32;){if(0===f)break e;f--,c+=a[o++]<>>16^65535)){e.msg="invalid stored block lengths",i.mode=se;break}if(i.length=65535&c,c=0,de=0,i.mode=q,t===y)break e;case q:i.mode=G;case G:if(he=i.length){if(he>f&&(he=f),he>u&&(he=u),0===he)break e;h.arraySet(r,a,o,he,s),f-=he,o+=he,u-=he,s+=he,i.length-=he;break}i.mode=K;break;case X:for(;de<14;){if(0===f)break e;f--,c+=a[o++]<>>=5,de-=5,i.ndist=1+(31&c),c>>>=5,de-=5,i.ncode=4+(15&c),c>>>=4,de-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=se;break}i.have=0,i.mode=W;case W:for(;i.have>>=3,de-=3}for(;i.have<19;)i.lens[Ae[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,Se={bits:i.lenbits},ye=k(_,i.lens,0,19,i.lencode,0,i.work,Se),i.lenbits=Se.bits,ye){e.msg="invalid code lengths set",i.mode=se;break}i.have=0,i.mode=J;case J:for(;i.have>>24,ke=Be>>>16&255,_e=65535&Be,!(me<=de);){if(0===f)break e;f--,c+=a[o++]<>>=me,de-=me,i.lens[i.have++]=_e;else{if(16===_e){for(Ee=me+2;de>>=me,de-=me,0===i.have){e.msg="invalid bit length repeat",i.mode=se;break}xe=i.lens[i.have-1],he=3+(3&c),c>>>=2,de-=2}else if(17===_e){for(Ee=me+3;de>>=me)),c>>>=3,de-=3}else{for(Ee=me+7;de>>=me)),c>>>=7,de-=7}if(i.have+he>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=se;break}for(;he--;)i.lens[i.have++]=xe}}if(i.mode===se)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=se;break}if(i.lenbits=9,Se={bits:i.lenbits},ye=k(g,i.lens,0,i.nlen,i.lencode,0,i.work,Se),i.lenbits=Se.bits,ye){e.msg="invalid literal/lengths set",i.mode=se;break}if(i.distbits=6,i.distcode=i.distdyn,Se={bits:i.distbits},ye=k(v,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,Se),i.distbits=Se.bits,ye){e.msg="invalid distances set",i.mode=se;break}if(i.mode=Q,t===y)break e;case Q:i.mode=V;case V:if(f>=6&&u>=258){e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=f,i.hold=c,i.bits=de,m(e,ce),s=e.next_out,r=e.output,u=e.avail_out,o=e.next_in,a=e.input,f=e.avail_in,c=i.hold,de=i.bits,i.mode===K&&(i.back=-1);break}for(i.back=0;Be=i.lencode[c&(1<>>24,ke=Be>>>16&255,_e=65535&Be,!(me<=de);){if(0===f)break e;f--,c+=a[o++]<>ge)],me=Be>>>24,ke=Be>>>16&255,_e=65535&Be,!(ge+me<=de);){if(0===f)break e;f--,c+=a[o++]<>>=ge,de-=ge,i.back+=ge}if(c>>>=me,de-=me,i.back+=me,i.length=_e,0===ke){i.mode=ne;break}if(32&ke){i.back=-1,i.mode=K;break}if(64&ke){e.msg="invalid literal/length code",i.mode=se;break}i.extra=15&ke,i.mode=$;case $:if(i.extra){for(Ee=i.extra;de>>=i.extra,de-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=ee;case ee:for(;Be=i.distcode[c&(1<>>24,ke=Be>>>16&255,_e=65535&Be,!(me<=de);){if(0===f)break e;f--,c+=a[o++]<>ge)],me=Be>>>24,ke=Be>>>16&255,_e=65535&Be,!(ge+me<=de);){if(0===f)break e;f--,c+=a[o++]<>>=ge,de-=ge,i.back+=ge}if(c>>>=me,de-=me,i.back+=me,64&ke){e.msg="invalid distance code",i.mode=se;break}i.offset=_e,i.extra=15&ke,i.mode=te;case te:if(i.extra){for(Ee=i.extra;de>>=i.extra,de-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=se;break}i.mode=ie;case ie:if(0===u)break e;if(he=ce-u,i.offset>he){if((he=i.offset-he)>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=se;break}he>i.wnext?(he-=i.wnext,be=i.wsize-he):be=i.wnext-he,he>i.length&&(he=i.length),we=i.window}else we=r,be=s-i.offset,he=i.length;he>u&&(he=u),u-=he,i.length-=he;do{r[s++]=we[be++]}while(--he);0===i.length&&(i.mode=V);break;case ne:if(0===u)break e;r[s++]=i.length,u--,i.mode=V;break;case ae:if(i.wrap){for(;de<32;){if(0===f)break e;f--,c|=a[o++]<=1&&0===T[B];B--);if(Z>B&&(Z=B),0===B)return l[d++]=20971520,l[d++]=20971520,c.bits=1,0;for(E=1;E0&&(0===e||1!==B))return-1;for(U[1]=0,y=1;y<15;y++)U[y+1]=U[y]+T[y];for(S=0;S852||2===e&&N>592)return 1;for(;;){g=y-z,u[S]<_?(v=0,p=u[S]):u[S]>_?(v=D[F+u[S]],p=C[I+u[S]]):(v=96,p=0),h=1<>z)+(b-=h)]=g<<24|v<<16|p|0}while(0!==b);for(h=1<>=1;if(0!==h?(O&=h-1,O+=h):O=0,S++,0==--T[y]){if(y===B)break;y=t[i+u[S]]}if(y>Z&&(O&m)!==w){for(0===z&&(z=Z),k+=E,R=1<<(A=y-z);A+z852||2===e&&N>592)return 1;l[w=O&m]=Z<<24|A<<16|k-d|0}}return 0!==O&&(l[k+O]=y-z<<24|64<<16|0),c.bits=Z,0}},{"../utils/common":1}],10:[function(e,t,i){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(e,t,i){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/lib/inflate.js":[function(e,t,i){"use strict";function n(e){if(!(this instanceof n))return new n(e);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var i=r.inflateInit2(this.strm,t.windowBits);if(i!==f.Z_OK)throw new Error(l[i]);this.header=new u,r.inflateGetHeader(this.strm,this.header)}function a(e,t){var i=new n(t);if(i.push(e,!0),i.err)throw i.msg||l[i.err];return i.result}var r=e("./zlib/inflate"),o=e("./utils/common"),s=e("./utils/strings"),f=e("./zlib/constants"),l=e("./zlib/messages"),d=e("./zlib/zstream"),u=e("./zlib/gzheader"),c=Object.prototype.toString;n.prototype.push=function(e,t){var i,n,a,l,d,u,h=this.strm,b=this.options.chunkSize,w=this.options.dictionary,m=!1;if(this.ended)return!1;n=t===~~t?t:!0===t?f.Z_FINISH:f.Z_NO_FLUSH,"string"==typeof e?h.input=s.binstring2buf(e):"[object ArrayBuffer]"===c.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new o.Buf8(b),h.next_out=0,h.avail_out=b),(i=r.inflate(h,f.Z_NO_FLUSH))===f.Z_NEED_DICT&&w&&(u="string"==typeof w?s.string2buf(w):"[object ArrayBuffer]"===c.call(w)?new Uint8Array(w):w,i=r.inflateSetDictionary(this.strm,u)),i===f.Z_BUF_ERROR&&!0===m&&(i=f.Z_OK,m=!1),i!==f.Z_STREAM_END&&i!==f.Z_OK)return this.onEnd(i),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&i!==f.Z_STREAM_END&&(0!==h.avail_in||n!==f.Z_FINISH&&n!==f.Z_SYNC_FLUSH)||("string"===this.options.to?(a=s.utf8border(h.output,h.next_out),l=h.next_out-a,d=s.buf2string(h.output,a),h.next_out=l,h.avail_out=b-l,l&&o.arraySet(h.output,h.output,a,l,0),this.onData(d)):this.onData(o.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(m=!0)}while((h.avail_in>0||0===h.avail_out)&&i!==f.Z_STREAM_END);return i===f.Z_STREAM_END&&(n=f.Z_FINISH),n===f.Z_FINISH?(i=r.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===f.Z_OK):n!==f.Z_SYNC_FLUSH||(this.onEnd(f.Z_OK),h.avail_out=0,!0)},n.prototype.onData=function(e){this.chunks.push(e)},n.prototype.onEnd=function(e){e===f.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},i.Inflate=n,i.inflate=a,i.inflateRaw=function(e,t){return t=t||{},t.raw=!0,a(e,t)},i.ungzip=a},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")}); diff --git a/node_modules/pako/index.js b/node_modules/pako/index.js deleted file mode 100644 index cd0725152..000000000 --- a/node_modules/pako/index.js +++ /dev/null @@ -1,14 +0,0 @@ -// Top level file is just a mixin of submodules & constants -'use strict'; - -var assign = require('./lib/utils/common').assign; - -var deflate = require('./lib/deflate'); -var inflate = require('./lib/inflate'); -var constants = require('./lib/zlib/constants'); - -var pako = {}; - -assign(pako, deflate, inflate, constants); - -module.exports = pako; diff --git a/node_modules/pako/lib/deflate.js b/node_modules/pako/lib/deflate.js deleted file mode 100644 index efeb00c7b..000000000 --- a/node_modules/pako/lib/deflate.js +++ /dev/null @@ -1,400 +0,0 @@ -'use strict'; - - -var zlib_deflate = require('./zlib/deflate'); -var utils = require('./utils/common'); -var strings = require('./utils/strings'); -var msg = require('./zlib/messages'); -var ZStream = require('./zlib/zstream'); - -var toString = Object.prototype.toString; - -/* Public constants ==========================================================*/ -/* ===========================================================================*/ - -var Z_NO_FLUSH = 0; -var Z_FINISH = 4; - -var Z_OK = 0; -var Z_STREAM_END = 1; -var Z_SYNC_FLUSH = 2; - -var Z_DEFAULT_COMPRESSION = -1; - -var Z_DEFAULT_STRATEGY = 0; - -var Z_DEFLATED = 8; - -/* ===========================================================================*/ - - -/** - * class Deflate - * - * Generic JS-style wrapper for zlib calls. If you don't need - * streaming behaviour - use more simple functions: [[deflate]], - * [[deflateRaw]] and [[gzip]]. - **/ - -/* internal - * Deflate.chunks -> Array - * - * Chunks of output data, if [[Deflate#onData]] not overridden. - **/ - -/** - * Deflate.result -> Uint8Array|Array - * - * Compressed result, generated by default [[Deflate#onData]] - * and [[Deflate#onEnd]] handlers. Filled after you push last chunk - * (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you - * push a chunk with explicit flush (call [[Deflate#push]] with - * `Z_SYNC_FLUSH` param). - **/ - -/** - * Deflate.err -> Number - * - * Error code after deflate finished. 0 (Z_OK) on success. - * You will not need it in real life, because deflate errors - * are possible only on wrong options or bad `onData` / `onEnd` - * custom handlers. - **/ - -/** - * Deflate.msg -> String - * - * Error message, if [[Deflate.err]] != 0 - **/ - - -/** - * new Deflate(options) - * - options (Object): zlib deflate options. - * - * Creates new deflator instance with specified params. Throws exception - * on bad params. Supported options: - * - * - `level` - * - `windowBits` - * - `memLevel` - * - `strategy` - * - `dictionary` - * - * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) - * for more information on these. - * - * Additional options, for internal needs: - * - * - `chunkSize` - size of generated data chunks (16K by default) - * - `raw` (Boolean) - do raw deflate - * - `gzip` (Boolean) - create gzip wrapper - * - `to` (String) - if equal to 'string', then result will be "binary string" - * (each char code [0..255]) - * - `header` (Object) - custom header for gzip - * - `text` (Boolean) - true if compressed data believed to be text - * - `time` (Number) - modification time, unix timestamp - * - `os` (Number) - operation system code - * - `extra` (Array) - array of bytes with extra data (max 65536) - * - `name` (String) - file name (binary string) - * - `comment` (String) - comment (binary string) - * - `hcrc` (Boolean) - true if header crc should be added - * - * ##### Example: - * - * ```javascript - * var pako = require('pako') - * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) - * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); - * - * var deflate = new pako.Deflate({ level: 3}); - * - * deflate.push(chunk1, false); - * deflate.push(chunk2, true); // true -> last chunk - * - * if (deflate.err) { throw new Error(deflate.err); } - * - * console.log(deflate.result); - * ``` - **/ -function Deflate(options) { - if (!(this instanceof Deflate)) return new Deflate(options); - - this.options = utils.assign({ - level: Z_DEFAULT_COMPRESSION, - method: Z_DEFLATED, - chunkSize: 16384, - windowBits: 15, - memLevel: 8, - strategy: Z_DEFAULT_STRATEGY, - to: '' - }, options || {}); - - var opt = this.options; - - if (opt.raw && (opt.windowBits > 0)) { - opt.windowBits = -opt.windowBits; - } - - else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) { - opt.windowBits += 16; - } - - this.err = 0; // error code, if happens (0 = Z_OK) - this.msg = ''; // error message - this.ended = false; // used to avoid multiple onEnd() calls - this.chunks = []; // chunks of compressed data - - this.strm = new ZStream(); - this.strm.avail_out = 0; - - var status = zlib_deflate.deflateInit2( - this.strm, - opt.level, - opt.method, - opt.windowBits, - opt.memLevel, - opt.strategy - ); - - if (status !== Z_OK) { - throw new Error(msg[status]); - } - - if (opt.header) { - zlib_deflate.deflateSetHeader(this.strm, opt.header); - } - - if (opt.dictionary) { - var dict; - // Convert data if needed - if (typeof opt.dictionary === 'string') { - // If we need to compress text, change encoding to utf8. - dict = strings.string2buf(opt.dictionary); - } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { - dict = new Uint8Array(opt.dictionary); - } else { - dict = opt.dictionary; - } - - status = zlib_deflate.deflateSetDictionary(this.strm, dict); - - if (status !== Z_OK) { - throw new Error(msg[status]); - } - - this._dict_set = true; - } -} - -/** - * Deflate#push(data[, mode]) -> Boolean - * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be - * converted to utf8 byte sequence. - * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. - * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH. - * - * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with - * new compressed chunks. Returns `true` on success. The last data block must have - * mode Z_FINISH (or `true`). That will flush internal pending buffers and call - * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you - * can use mode Z_SYNC_FLUSH, keeping the compression context. - * - * On fail call [[Deflate#onEnd]] with error code and return false. - * - * We strongly recommend to use `Uint8Array` on input for best speed (output - * array format is detected automatically). Also, don't skip last param and always - * use the same type in your code (boolean or number). That will improve JS speed. - * - * For regular `Array`-s make sure all elements are [0..255]. - * - * ##### Example - * - * ```javascript - * push(chunk, false); // push one of data chunks - * ... - * push(chunk, true); // push last chunk - * ``` - **/ -Deflate.prototype.push = function (data, mode) { - var strm = this.strm; - var chunkSize = this.options.chunkSize; - var status, _mode; - - if (this.ended) { return false; } - - _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH); - - // Convert data if needed - if (typeof data === 'string') { - // If we need to compress text, change encoding to utf8. - strm.input = strings.string2buf(data); - } else if (toString.call(data) === '[object ArrayBuffer]') { - strm.input = new Uint8Array(data); - } else { - strm.input = data; - } - - strm.next_in = 0; - strm.avail_in = strm.input.length; - - do { - if (strm.avail_out === 0) { - strm.output = new utils.Buf8(chunkSize); - strm.next_out = 0; - strm.avail_out = chunkSize; - } - status = zlib_deflate.deflate(strm, _mode); /* no bad return value */ - - if (status !== Z_STREAM_END && status !== Z_OK) { - this.onEnd(status); - this.ended = true; - return false; - } - if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) { - if (this.options.to === 'string') { - this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out))); - } else { - this.onData(utils.shrinkBuf(strm.output, strm.next_out)); - } - } - } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END); - - // Finalize on the last chunk. - if (_mode === Z_FINISH) { - status = zlib_deflate.deflateEnd(this.strm); - this.onEnd(status); - this.ended = true; - return status === Z_OK; - } - - // callback interim results if Z_SYNC_FLUSH. - if (_mode === Z_SYNC_FLUSH) { - this.onEnd(Z_OK); - strm.avail_out = 0; - return true; - } - - return true; -}; - - -/** - * Deflate#onData(chunk) -> Void - * - chunk (Uint8Array|Array|String): output data. Type of array depends - * on js engine support. When string output requested, each chunk - * will be string. - * - * By default, stores data blocks in `chunks[]` property and glue - * those in `onEnd`. Override this handler, if you need another behaviour. - **/ -Deflate.prototype.onData = function (chunk) { - this.chunks.push(chunk); -}; - - -/** - * Deflate#onEnd(status) -> Void - * - status (Number): deflate status. 0 (Z_OK) on success, - * other if not. - * - * Called once after you tell deflate that the input stream is - * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH) - * or if an error happened. By default - join collected chunks, - * free memory and fill `results` / `err` properties. - **/ -Deflate.prototype.onEnd = function (status) { - // On success - join - if (status === Z_OK) { - if (this.options.to === 'string') { - this.result = this.chunks.join(''); - } else { - this.result = utils.flattenChunks(this.chunks); - } - } - this.chunks = []; - this.err = status; - this.msg = this.strm.msg; -}; - - -/** - * deflate(data[, options]) -> Uint8Array|Array|String - * - data (Uint8Array|Array|String): input data to compress. - * - options (Object): zlib deflate options. - * - * Compress `data` with deflate algorithm and `options`. - * - * Supported options are: - * - * - level - * - windowBits - * - memLevel - * - strategy - * - dictionary - * - * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) - * for more information on these. - * - * Sugar (options): - * - * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify - * negative windowBits implicitly. - * - `to` (String) - if equal to 'string', then result will be "binary string" - * (each char code [0..255]) - * - * ##### Example: - * - * ```javascript - * var pako = require('pako') - * , data = Uint8Array([1,2,3,4,5,6,7,8,9]); - * - * console.log(pako.deflate(data)); - * ``` - **/ -function deflate(input, options) { - var deflator = new Deflate(options); - - deflator.push(input, true); - - // That will never happens, if you don't cheat with options :) - if (deflator.err) { throw deflator.msg || msg[deflator.err]; } - - return deflator.result; -} - - -/** - * deflateRaw(data[, options]) -> Uint8Array|Array|String - * - data (Uint8Array|Array|String): input data to compress. - * - options (Object): zlib deflate options. - * - * The same as [[deflate]], but creates raw data, without wrapper - * (header and adler32 crc). - **/ -function deflateRaw(input, options) { - options = options || {}; - options.raw = true; - return deflate(input, options); -} - - -/** - * gzip(data[, options]) -> Uint8Array|Array|String - * - data (Uint8Array|Array|String): input data to compress. - * - options (Object): zlib deflate options. - * - * The same as [[deflate]], but create gzip wrapper instead of - * deflate one. - **/ -function gzip(input, options) { - options = options || {}; - options.gzip = true; - return deflate(input, options); -} - - -exports.Deflate = Deflate; -exports.deflate = deflate; -exports.deflateRaw = deflateRaw; -exports.gzip = gzip; diff --git a/node_modules/pako/lib/inflate.js b/node_modules/pako/lib/inflate.js deleted file mode 100644 index 4028130be..000000000 --- a/node_modules/pako/lib/inflate.js +++ /dev/null @@ -1,418 +0,0 @@ -'use strict'; - - -var zlib_inflate = require('./zlib/inflate'); -var utils = require('./utils/common'); -var strings = require('./utils/strings'); -var c = require('./zlib/constants'); -var msg = require('./zlib/messages'); -var ZStream = require('./zlib/zstream'); -var GZheader = require('./zlib/gzheader'); - -var toString = Object.prototype.toString; - -/** - * class Inflate - * - * Generic JS-style wrapper for zlib calls. If you don't need - * streaming behaviour - use more simple functions: [[inflate]] - * and [[inflateRaw]]. - **/ - -/* internal - * inflate.chunks -> Array - * - * Chunks of output data, if [[Inflate#onData]] not overridden. - **/ - -/** - * Inflate.result -> Uint8Array|Array|String - * - * Uncompressed result, generated by default [[Inflate#onData]] - * and [[Inflate#onEnd]] handlers. Filled after you push last chunk - * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you - * push a chunk with explicit flush (call [[Inflate#push]] with - * `Z_SYNC_FLUSH` param). - **/ - -/** - * Inflate.err -> Number - * - * Error code after inflate finished. 0 (Z_OK) on success. - * Should be checked if broken data possible. - **/ - -/** - * Inflate.msg -> String - * - * Error message, if [[Inflate.err]] != 0 - **/ - - -/** - * new Inflate(options) - * - options (Object): zlib inflate options. - * - * Creates new inflator instance with specified params. Throws exception - * on bad params. Supported options: - * - * - `windowBits` - * - `dictionary` - * - * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) - * for more information on these. - * - * Additional options, for internal needs: - * - * - `chunkSize` - size of generated data chunks (16K by default) - * - `raw` (Boolean) - do raw inflate - * - `to` (String) - if equal to 'string', then result will be converted - * from utf8 to utf16 (javascript) string. When string output requested, - * chunk length can differ from `chunkSize`, depending on content. - * - * By default, when no options set, autodetect deflate/gzip data format via - * wrapper header. - * - * ##### Example: - * - * ```javascript - * var pako = require('pako') - * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) - * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); - * - * var inflate = new pako.Inflate({ level: 3}); - * - * inflate.push(chunk1, false); - * inflate.push(chunk2, true); // true -> last chunk - * - * if (inflate.err) { throw new Error(inflate.err); } - * - * console.log(inflate.result); - * ``` - **/ -function Inflate(options) { - if (!(this instanceof Inflate)) return new Inflate(options); - - this.options = utils.assign({ - chunkSize: 16384, - windowBits: 0, - to: '' - }, options || {}); - - var opt = this.options; - - // Force window size for `raw` data, if not set directly, - // because we have no header for autodetect. - if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) { - opt.windowBits = -opt.windowBits; - if (opt.windowBits === 0) { opt.windowBits = -15; } - } - - // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate - if ((opt.windowBits >= 0) && (opt.windowBits < 16) && - !(options && options.windowBits)) { - opt.windowBits += 32; - } - - // Gzip header has no info about windows size, we can do autodetect only - // for deflate. So, if window size not set, force it to max when gzip possible - if ((opt.windowBits > 15) && (opt.windowBits < 48)) { - // bit 3 (16) -> gzipped data - // bit 4 (32) -> autodetect gzip/deflate - if ((opt.windowBits & 15) === 0) { - opt.windowBits |= 15; - } - } - - this.err = 0; // error code, if happens (0 = Z_OK) - this.msg = ''; // error message - this.ended = false; // used to avoid multiple onEnd() calls - this.chunks = []; // chunks of compressed data - - this.strm = new ZStream(); - this.strm.avail_out = 0; - - var status = zlib_inflate.inflateInit2( - this.strm, - opt.windowBits - ); - - if (status !== c.Z_OK) { - throw new Error(msg[status]); - } - - this.header = new GZheader(); - - zlib_inflate.inflateGetHeader(this.strm, this.header); -} - -/** - * Inflate#push(data[, mode]) -> Boolean - * - data (Uint8Array|Array|ArrayBuffer|String): input data - * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. - * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH. - * - * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with - * new output chunks. Returns `true` on success. The last data block must have - * mode Z_FINISH (or `true`). That will flush internal pending buffers and call - * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you - * can use mode Z_SYNC_FLUSH, keeping the decompression context. - * - * On fail call [[Inflate#onEnd]] with error code and return false. - * - * We strongly recommend to use `Uint8Array` on input for best speed (output - * format is detected automatically). Also, don't skip last param and always - * use the same type in your code (boolean or number). That will improve JS speed. - * - * For regular `Array`-s make sure all elements are [0..255]. - * - * ##### Example - * - * ```javascript - * push(chunk, false); // push one of data chunks - * ... - * push(chunk, true); // push last chunk - * ``` - **/ -Inflate.prototype.push = function (data, mode) { - var strm = this.strm; - var chunkSize = this.options.chunkSize; - var dictionary = this.options.dictionary; - var status, _mode; - var next_out_utf8, tail, utf8str; - var dict; - - // Flag to properly process Z_BUF_ERROR on testing inflate call - // when we check that all output data was flushed. - var allowBufError = false; - - if (this.ended) { return false; } - _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH); - - // Convert data if needed - if (typeof data === 'string') { - // Only binary strings can be decompressed on practice - strm.input = strings.binstring2buf(data); - } else if (toString.call(data) === '[object ArrayBuffer]') { - strm.input = new Uint8Array(data); - } else { - strm.input = data; - } - - strm.next_in = 0; - strm.avail_in = strm.input.length; - - do { - if (strm.avail_out === 0) { - strm.output = new utils.Buf8(chunkSize); - strm.next_out = 0; - strm.avail_out = chunkSize; - } - - status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */ - - if (status === c.Z_NEED_DICT && dictionary) { - // Convert data if needed - if (typeof dictionary === 'string') { - dict = strings.string2buf(dictionary); - } else if (toString.call(dictionary) === '[object ArrayBuffer]') { - dict = new Uint8Array(dictionary); - } else { - dict = dictionary; - } - - status = zlib_inflate.inflateSetDictionary(this.strm, dict); - - } - - if (status === c.Z_BUF_ERROR && allowBufError === true) { - status = c.Z_OK; - allowBufError = false; - } - - if (status !== c.Z_STREAM_END && status !== c.Z_OK) { - this.onEnd(status); - this.ended = true; - return false; - } - - if (strm.next_out) { - if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) { - - if (this.options.to === 'string') { - - next_out_utf8 = strings.utf8border(strm.output, strm.next_out); - - tail = strm.next_out - next_out_utf8; - utf8str = strings.buf2string(strm.output, next_out_utf8); - - // move tail - strm.next_out = tail; - strm.avail_out = chunkSize - tail; - if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); } - - this.onData(utf8str); - - } else { - this.onData(utils.shrinkBuf(strm.output, strm.next_out)); - } - } - } - - // When no more input data, we should check that internal inflate buffers - // are flushed. The only way to do it when avail_out = 0 - run one more - // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR. - // Here we set flag to process this error properly. - // - // NOTE. Deflate does not return error in this case and does not needs such - // logic. - if (strm.avail_in === 0 && strm.avail_out === 0) { - allowBufError = true; - } - - } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END); - - if (status === c.Z_STREAM_END) { - _mode = c.Z_FINISH; - } - - // Finalize on the last chunk. - if (_mode === c.Z_FINISH) { - status = zlib_inflate.inflateEnd(this.strm); - this.onEnd(status); - this.ended = true; - return status === c.Z_OK; - } - - // callback interim results if Z_SYNC_FLUSH. - if (_mode === c.Z_SYNC_FLUSH) { - this.onEnd(c.Z_OK); - strm.avail_out = 0; - return true; - } - - return true; -}; - - -/** - * Inflate#onData(chunk) -> Void - * - chunk (Uint8Array|Array|String): output data. Type of array depends - * on js engine support. When string output requested, each chunk - * will be string. - * - * By default, stores data blocks in `chunks[]` property and glue - * those in `onEnd`. Override this handler, if you need another behaviour. - **/ -Inflate.prototype.onData = function (chunk) { - this.chunks.push(chunk); -}; - - -/** - * Inflate#onEnd(status) -> Void - * - status (Number): inflate status. 0 (Z_OK) on success, - * other if not. - * - * Called either after you tell inflate that the input stream is - * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH) - * or if an error happened. By default - join collected chunks, - * free memory and fill `results` / `err` properties. - **/ -Inflate.prototype.onEnd = function (status) { - // On success - join - if (status === c.Z_OK) { - if (this.options.to === 'string') { - // Glue & convert here, until we teach pako to send - // utf8 aligned strings to onData - this.result = this.chunks.join(''); - } else { - this.result = utils.flattenChunks(this.chunks); - } - } - this.chunks = []; - this.err = status; - this.msg = this.strm.msg; -}; - - -/** - * inflate(data[, options]) -> Uint8Array|Array|String - * - data (Uint8Array|Array|String): input data to decompress. - * - options (Object): zlib inflate options. - * - * Decompress `data` with inflate/ungzip and `options`. Autodetect - * format via wrapper header by default. That's why we don't provide - * separate `ungzip` method. - * - * Supported options are: - * - * - windowBits - * - * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) - * for more information. - * - * Sugar (options): - * - * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify - * negative windowBits implicitly. - * - `to` (String) - if equal to 'string', then result will be converted - * from utf8 to utf16 (javascript) string. When string output requested, - * chunk length can differ from `chunkSize`, depending on content. - * - * - * ##### Example: - * - * ```javascript - * var pako = require('pako') - * , input = pako.deflate([1,2,3,4,5,6,7,8,9]) - * , output; - * - * try { - * output = pako.inflate(input); - * } catch (err) - * console.log(err); - * } - * ``` - **/ -function inflate(input, options) { - var inflator = new Inflate(options); - - inflator.push(input, true); - - // That will never happens, if you don't cheat with options :) - if (inflator.err) { throw inflator.msg || msg[inflator.err]; } - - return inflator.result; -} - - -/** - * inflateRaw(data[, options]) -> Uint8Array|Array|String - * - data (Uint8Array|Array|String): input data to decompress. - * - options (Object): zlib inflate options. - * - * The same as [[inflate]], but creates raw data, without wrapper - * (header and adler32 crc). - **/ -function inflateRaw(input, options) { - options = options || {}; - options.raw = true; - return inflate(input, options); -} - - -/** - * ungzip(data[, options]) -> Uint8Array|Array|String - * - data (Uint8Array|Array|String): input data to decompress. - * - options (Object): zlib inflate options. - * - * Just shortcut to [[inflate]], because it autodetects format - * by header.content. Done for convenience. - **/ - - -exports.Inflate = Inflate; -exports.inflate = inflate; -exports.inflateRaw = inflateRaw; -exports.ungzip = inflate; diff --git a/node_modules/pako/lib/utils/common.js b/node_modules/pako/lib/utils/common.js deleted file mode 100644 index 58be4beb4..000000000 --- a/node_modules/pako/lib/utils/common.js +++ /dev/null @@ -1,105 +0,0 @@ -'use strict'; - - -var TYPED_OK = (typeof Uint8Array !== 'undefined') && - (typeof Uint16Array !== 'undefined') && - (typeof Int32Array !== 'undefined'); - -function _has(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} - -exports.assign = function (obj /*from1, from2, from3, ...*/) { - var sources = Array.prototype.slice.call(arguments, 1); - while (sources.length) { - var source = sources.shift(); - if (!source) { continue; } - - if (typeof source !== 'object') { - throw new TypeError(source + 'must be non-object'); - } - - for (var p in source) { - if (_has(source, p)) { - obj[p] = source[p]; - } - } - } - - return obj; -}; - - -// reduce buffer size, avoiding mem copy -exports.shrinkBuf = function (buf, size) { - if (buf.length === size) { return buf; } - if (buf.subarray) { return buf.subarray(0, size); } - buf.length = size; - return buf; -}; - - -var fnTyped = { - arraySet: function (dest, src, src_offs, len, dest_offs) { - if (src.subarray && dest.subarray) { - dest.set(src.subarray(src_offs, src_offs + len), dest_offs); - return; - } - // Fallback to ordinary array - for (var i = 0; i < len; i++) { - dest[dest_offs + i] = src[src_offs + i]; - } - }, - // Join array of chunks to single array. - flattenChunks: function (chunks) { - var i, l, len, pos, chunk, result; - - // calculate data length - len = 0; - for (i = 0, l = chunks.length; i < l; i++) { - len += chunks[i].length; - } - - // join chunks - result = new Uint8Array(len); - pos = 0; - for (i = 0, l = chunks.length; i < l; i++) { - chunk = chunks[i]; - result.set(chunk, pos); - pos += chunk.length; - } - - return result; - } -}; - -var fnUntyped = { - arraySet: function (dest, src, src_offs, len, dest_offs) { - for (var i = 0; i < len; i++) { - dest[dest_offs + i] = src[src_offs + i]; - } - }, - // Join array of chunks to single array. - flattenChunks: function (chunks) { - return [].concat.apply([], chunks); - } -}; - - -// Enable/Disable typed arrays use, for testing -// -exports.setTyped = function (on) { - if (on) { - exports.Buf8 = Uint8Array; - exports.Buf16 = Uint16Array; - exports.Buf32 = Int32Array; - exports.assign(exports, fnTyped); - } else { - exports.Buf8 = Array; - exports.Buf16 = Array; - exports.Buf32 = Array; - exports.assign(exports, fnUntyped); - } -}; - -exports.setTyped(TYPED_OK); diff --git a/node_modules/pako/lib/utils/strings.js b/node_modules/pako/lib/utils/strings.js deleted file mode 100644 index 313c27b9b..000000000 --- a/node_modules/pako/lib/utils/strings.js +++ /dev/null @@ -1,185 +0,0 @@ -// String encode/decode helpers -'use strict'; - - -var utils = require('./common'); - - -// Quick check if we can use fast array to bin string conversion -// -// - apply(Array) can fail on Android 2.2 -// - apply(Uint8Array) can fail on iOS 5.1 Safari -// -var STR_APPLY_OK = true; -var STR_APPLY_UIA_OK = true; - -try { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; } -try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; } - - -// Table with utf8 lengths (calculated by first byte of sequence) -// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS, -// because max possible codepoint is 0x10ffff -var _utf8len = new utils.Buf8(256); -for (var q = 0; q < 256; q++) { - _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1); -} -_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start - - -// convert string to array (typed, when possible) -exports.string2buf = function (str) { - var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; - - // count binary size - for (m_pos = 0; m_pos < str_len; m_pos++) { - c = str.charCodeAt(m_pos); - if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { - c2 = str.charCodeAt(m_pos + 1); - if ((c2 & 0xfc00) === 0xdc00) { - c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); - m_pos++; - } - } - buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4; - } - - // allocate buffer - buf = new utils.Buf8(buf_len); - - // convert - for (i = 0, m_pos = 0; i < buf_len; m_pos++) { - c = str.charCodeAt(m_pos); - if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) { - c2 = str.charCodeAt(m_pos + 1); - if ((c2 & 0xfc00) === 0xdc00) { - c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); - m_pos++; - } - } - if (c < 0x80) { - /* one byte */ - buf[i++] = c; - } else if (c < 0x800) { - /* two bytes */ - buf[i++] = 0xC0 | (c >>> 6); - buf[i++] = 0x80 | (c & 0x3f); - } else if (c < 0x10000) { - /* three bytes */ - buf[i++] = 0xE0 | (c >>> 12); - buf[i++] = 0x80 | (c >>> 6 & 0x3f); - buf[i++] = 0x80 | (c & 0x3f); - } else { - /* four bytes */ - buf[i++] = 0xf0 | (c >>> 18); - buf[i++] = 0x80 | (c >>> 12 & 0x3f); - buf[i++] = 0x80 | (c >>> 6 & 0x3f); - buf[i++] = 0x80 | (c & 0x3f); - } - } - - return buf; -}; - -// Helper (used in 2 places) -function buf2binstring(buf, len) { - // use fallback for big arrays to avoid stack overflow - if (len < 65537) { - if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) { - return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len)); - } - } - - var result = ''; - for (var i = 0; i < len; i++) { - result += String.fromCharCode(buf[i]); - } - return result; -} - - -// Convert byte array to binary string -exports.buf2binstring = function (buf) { - return buf2binstring(buf, buf.length); -}; - - -// Convert binary string (typed, when possible) -exports.binstring2buf = function (str) { - var buf = new utils.Buf8(str.length); - for (var i = 0, len = buf.length; i < len; i++) { - buf[i] = str.charCodeAt(i); - } - return buf; -}; - - -// convert array to string -exports.buf2string = function (buf, max) { - var i, out, c, c_len; - var len = max || buf.length; - - // Reserve max possible length (2 words per char) - // NB: by unknown reasons, Array is significantly faster for - // String.fromCharCode.apply than Uint16Array. - var utf16buf = new Array(len * 2); - - for (out = 0, i = 0; i < len;) { - c = buf[i++]; - // quick process ascii - if (c < 0x80) { utf16buf[out++] = c; continue; } - - c_len = _utf8len[c]; - // skip 5 & 6 byte codes - if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; } - - // apply mask on first byte - c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07; - // join the rest - while (c_len > 1 && i < len) { - c = (c << 6) | (buf[i++] & 0x3f); - c_len--; - } - - // terminated by end of string? - if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; } - - if (c < 0x10000) { - utf16buf[out++] = c; - } else { - c -= 0x10000; - utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff); - utf16buf[out++] = 0xdc00 | (c & 0x3ff); - } - } - - return buf2binstring(utf16buf, out); -}; - - -// Calculate max possible position in utf8 buffer, -// that will not break sequence. If that's not possible -// - (very small limits) return max size as is. -// -// buf[] - utf8 bytes array -// max - length limit (mandatory); -exports.utf8border = function (buf, max) { - var pos; - - max = max || buf.length; - if (max > buf.length) { max = buf.length; } - - // go back from last position, until start of sequence found - pos = max - 1; - while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; } - - // Very small and broken sequence, - // return max, because we should return something anyway. - if (pos < 0) { return max; } - - // If we came to start of buffer - that means buffer is too small, - // return max too. - if (pos === 0) { return max; } - - return (pos + _utf8len[buf[pos]] > max) ? pos : max; -}; diff --git a/node_modules/pako/lib/zlib/README b/node_modules/pako/lib/zlib/README deleted file mode 100644 index 88a875247..000000000 --- a/node_modules/pako/lib/zlib/README +++ /dev/null @@ -1,59 +0,0 @@ -Content of this folder follows zlib C sources as close as possible. -That's intended to simplify maintainability and guarantee equal API -and result. - -Key differences: - -- Everything is in JavaScript. -- No platform-dependent blocks. -- Some things like crc32 rewritten to keep size small and make JIT - work better. -- Some code is different due missed features in JS (macros, pointers, - structures, header files) -- Specific API methods are not implemented (see notes in root readme) - -This port is based on zlib 1.2.8. - -This port is under zlib license (see below) with contribution and addition of javascript -port under expat license (see LICENSE at root of project) - -Copyright: -(C) 1995-2013 Jean-loup Gailly and Mark Adler -(C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin - - -From zlib's README -============================================================================= - -Acknowledgments: - - The deflate format used by zlib was defined by Phil Katz. The deflate and - zlib specifications were written by L. Peter Deutsch. Thanks to all the - people who reported problems and suggested various improvements in zlib; they - are too numerous to cite here. - -Copyright notice: - - (C) 1995-2013 Jean-loup Gailly and Mark Adler - -Copyright (c) <''year''> <''copyright holders''> - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. - - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu diff --git a/node_modules/pako/lib/zlib/adler32.js b/node_modules/pako/lib/zlib/adler32.js deleted file mode 100644 index d440a9810..000000000 --- a/node_modules/pako/lib/zlib/adler32.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -// Note: adler32 takes 12% for level 0 and 2% for level 6. -// It isn't worth it to make additional optimizations as in original. -// Small size is preferable. - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -function adler32(adler, buf, len, pos) { - var s1 = (adler & 0xffff) |0, - s2 = ((adler >>> 16) & 0xffff) |0, - n = 0; - - while (len !== 0) { - // Set limit ~ twice less than 5552, to keep - // s2 in 31-bits, because we force signed ints. - // in other case %= will fail. - n = len > 2000 ? 2000 : len; - len -= n; - - do { - s1 = (s1 + buf[pos++]) |0; - s2 = (s2 + s1) |0; - } while (--n); - - s1 %= 65521; - s2 %= 65521; - } - - return (s1 | (s2 << 16)) |0; -} - - -module.exports = adler32; diff --git a/node_modules/pako/lib/zlib/constants.js b/node_modules/pako/lib/zlib/constants.js deleted file mode 100644 index 569b87241..000000000 --- a/node_modules/pako/lib/zlib/constants.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -module.exports = { - - /* Allowed flush values; see deflate() and inflate() below for details */ - Z_NO_FLUSH: 0, - Z_PARTIAL_FLUSH: 1, - Z_SYNC_FLUSH: 2, - Z_FULL_FLUSH: 3, - Z_FINISH: 4, - Z_BLOCK: 5, - Z_TREES: 6, - - /* Return codes for the compression/decompression functions. Negative values - * are errors, positive values are used for special but normal events. - */ - Z_OK: 0, - Z_STREAM_END: 1, - Z_NEED_DICT: 2, - Z_ERRNO: -1, - Z_STREAM_ERROR: -2, - Z_DATA_ERROR: -3, - //Z_MEM_ERROR: -4, - Z_BUF_ERROR: -5, - //Z_VERSION_ERROR: -6, - - /* compression levels */ - Z_NO_COMPRESSION: 0, - Z_BEST_SPEED: 1, - Z_BEST_COMPRESSION: 9, - Z_DEFAULT_COMPRESSION: -1, - - - Z_FILTERED: 1, - Z_HUFFMAN_ONLY: 2, - Z_RLE: 3, - Z_FIXED: 4, - Z_DEFAULT_STRATEGY: 0, - - /* Possible values of the data_type field (though see inflate()) */ - Z_BINARY: 0, - Z_TEXT: 1, - //Z_ASCII: 1, // = Z_TEXT (deprecated) - Z_UNKNOWN: 2, - - /* The deflate compression method */ - Z_DEFLATED: 8 - //Z_NULL: null // Use -1 or null inline, depending on var type -}; diff --git a/node_modules/pako/lib/zlib/crc32.js b/node_modules/pako/lib/zlib/crc32.js deleted file mode 100644 index 6a9609246..000000000 --- a/node_modules/pako/lib/zlib/crc32.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; - -// Note: we can't get significant speed boost here. -// So write code to minimize size - no pregenerated tables -// and array tools dependencies. - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -// Use ordinary array, since untyped makes no boost here -function makeTable() { - var c, table = []; - - for (var n = 0; n < 256; n++) { - c = n; - for (var k = 0; k < 8; k++) { - c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); - } - table[n] = c; - } - - return table; -} - -// Create table on load. Just 255 signed longs. Not a problem. -var crcTable = makeTable(); - - -function crc32(crc, buf, len, pos) { - var t = crcTable, - end = pos + len; - - crc ^= -1; - - for (var i = pos; i < end; i++) { - crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF]; - } - - return (crc ^ (-1)); // >>> 0; -} - - -module.exports = crc32; diff --git a/node_modules/pako/lib/zlib/deflate.js b/node_modules/pako/lib/zlib/deflate.js deleted file mode 100644 index f88ba1864..000000000 --- a/node_modules/pako/lib/zlib/deflate.js +++ /dev/null @@ -1,1874 +0,0 @@ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -var utils = require('../utils/common'); -var trees = require('./trees'); -var adler32 = require('./adler32'); -var crc32 = require('./crc32'); -var msg = require('./messages'); - -/* Public constants ==========================================================*/ -/* ===========================================================================*/ - - -/* Allowed flush values; see deflate() and inflate() below for details */ -var Z_NO_FLUSH = 0; -var Z_PARTIAL_FLUSH = 1; -//var Z_SYNC_FLUSH = 2; -var Z_FULL_FLUSH = 3; -var Z_FINISH = 4; -var Z_BLOCK = 5; -//var Z_TREES = 6; - - -/* Return codes for the compression/decompression functions. Negative values - * are errors, positive values are used for special but normal events. - */ -var Z_OK = 0; -var Z_STREAM_END = 1; -//var Z_NEED_DICT = 2; -//var Z_ERRNO = -1; -var Z_STREAM_ERROR = -2; -var Z_DATA_ERROR = -3; -//var Z_MEM_ERROR = -4; -var Z_BUF_ERROR = -5; -//var Z_VERSION_ERROR = -6; - - -/* compression levels */ -//var Z_NO_COMPRESSION = 0; -//var Z_BEST_SPEED = 1; -//var Z_BEST_COMPRESSION = 9; -var Z_DEFAULT_COMPRESSION = -1; - - -var Z_FILTERED = 1; -var Z_HUFFMAN_ONLY = 2; -var Z_RLE = 3; -var Z_FIXED = 4; -var Z_DEFAULT_STRATEGY = 0; - -/* Possible values of the data_type field (though see inflate()) */ -//var Z_BINARY = 0; -//var Z_TEXT = 1; -//var Z_ASCII = 1; // = Z_TEXT -var Z_UNKNOWN = 2; - - -/* The deflate compression method */ -var Z_DEFLATED = 8; - -/*============================================================================*/ - - -var MAX_MEM_LEVEL = 9; -/* Maximum value for memLevel in deflateInit2 */ -var MAX_WBITS = 15; -/* 32K LZ77 window */ -var DEF_MEM_LEVEL = 8; - - -var LENGTH_CODES = 29; -/* number of length codes, not counting the special END_BLOCK code */ -var LITERALS = 256; -/* number of literal bytes 0..255 */ -var L_CODES = LITERALS + 1 + LENGTH_CODES; -/* number of Literal or Length codes, including the END_BLOCK code */ -var D_CODES = 30; -/* number of distance codes */ -var BL_CODES = 19; -/* number of codes used to transfer the bit lengths */ -var HEAP_SIZE = 2 * L_CODES + 1; -/* maximum heap size */ -var MAX_BITS = 15; -/* All codes must not exceed MAX_BITS bits */ - -var MIN_MATCH = 3; -var MAX_MATCH = 258; -var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1); - -var PRESET_DICT = 0x20; - -var INIT_STATE = 42; -var EXTRA_STATE = 69; -var NAME_STATE = 73; -var COMMENT_STATE = 91; -var HCRC_STATE = 103; -var BUSY_STATE = 113; -var FINISH_STATE = 666; - -var BS_NEED_MORE = 1; /* block not completed, need more input or more output */ -var BS_BLOCK_DONE = 2; /* block flush performed */ -var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */ -var BS_FINISH_DONE = 4; /* finish done, accept no more input or output */ - -var OS_CODE = 0x03; // Unix :) . Don't detect, use this default. - -function err(strm, errorCode) { - strm.msg = msg[errorCode]; - return errorCode; -} - -function rank(f) { - return ((f) << 1) - ((f) > 4 ? 9 : 0); -} - -function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } - - -/* ========================================================================= - * Flush as much pending output as possible. All deflate() output goes - * through this function so some applications may wish to modify it - * to avoid allocating a large strm->output buffer and copying into it. - * (See also read_buf()). - */ -function flush_pending(strm) { - var s = strm.state; - - //_tr_flush_bits(s); - var len = s.pending; - if (len > strm.avail_out) { - len = strm.avail_out; - } - if (len === 0) { return; } - - utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out); - strm.next_out += len; - s.pending_out += len; - strm.total_out += len; - strm.avail_out -= len; - s.pending -= len; - if (s.pending === 0) { - s.pending_out = 0; - } -} - - -function flush_block_only(s, last) { - trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last); - s.block_start = s.strstart; - flush_pending(s.strm); -} - - -function put_byte(s, b) { - s.pending_buf[s.pending++] = b; -} - - -/* ========================================================================= - * Put a short in the pending buffer. The 16-bit value is put in MSB order. - * IN assertion: the stream state is correct and there is enough room in - * pending_buf. - */ -function putShortMSB(s, b) { -// put_byte(s, (Byte)(b >> 8)); -// put_byte(s, (Byte)(b & 0xff)); - s.pending_buf[s.pending++] = (b >>> 8) & 0xff; - s.pending_buf[s.pending++] = b & 0xff; -} - - -/* =========================================================================== - * Read a new buffer from the current input stream, update the adler32 - * and total number of bytes read. All deflate() input goes through - * this function so some applications may wish to modify it to avoid - * allocating a large strm->input buffer and copying from it. - * (See also flush_pending()). - */ -function read_buf(strm, buf, start, size) { - var len = strm.avail_in; - - if (len > size) { len = size; } - if (len === 0) { return 0; } - - strm.avail_in -= len; - - // zmemcpy(buf, strm->next_in, len); - utils.arraySet(buf, strm.input, strm.next_in, len, start); - if (strm.state.wrap === 1) { - strm.adler = adler32(strm.adler, buf, len, start); - } - - else if (strm.state.wrap === 2) { - strm.adler = crc32(strm.adler, buf, len, start); - } - - strm.next_in += len; - strm.total_in += len; - - return len; -} - - -/* =========================================================================== - * Set match_start to the longest match starting at the given string and - * return its length. Matches shorter or equal to prev_length are discarded, - * in which case the result is equal to prev_length and match_start is - * garbage. - * IN assertions: cur_match is the head of the hash chain for the current - * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 - * OUT assertion: the match length is not greater than s->lookahead. - */ -function longest_match(s, cur_match) { - var chain_length = s.max_chain_length; /* max hash chain length */ - var scan = s.strstart; /* current string */ - var match; /* matched string */ - var len; /* length of current match */ - var best_len = s.prev_length; /* best match length so far */ - var nice_match = s.nice_match; /* stop if match long enough */ - var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ? - s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/; - - var _win = s.window; // shortcut - - var wmask = s.w_mask; - var prev = s.prev; - - /* Stop when cur_match becomes <= limit. To simplify the code, - * we prevent matches with the string of window index 0. - */ - - var strend = s.strstart + MAX_MATCH; - var scan_end1 = _win[scan + best_len - 1]; - var scan_end = _win[scan + best_len]; - - /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. - * It is easy to get rid of this optimization if necessary. - */ - // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); - - /* Do not waste too much time if we already have a good match: */ - if (s.prev_length >= s.good_match) { - chain_length >>= 2; - } - /* Do not look for matches beyond the end of the input. This is necessary - * to make deflate deterministic. - */ - if (nice_match > s.lookahead) { nice_match = s.lookahead; } - - // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); - - do { - // Assert(cur_match < s->strstart, "no future"); - match = cur_match; - - /* Skip to next match if the match length cannot increase - * or if the match length is less than 2. Note that the checks below - * for insufficient lookahead only occur occasionally for performance - * reasons. Therefore uninitialized memory will be accessed, and - * conditional jumps will be made that depend on those values. - * However the length of the match is limited to the lookahead, so - * the output of deflate is not affected by the uninitialized values. - */ - - if (_win[match + best_len] !== scan_end || - _win[match + best_len - 1] !== scan_end1 || - _win[match] !== _win[scan] || - _win[++match] !== _win[scan + 1]) { - continue; - } - - /* The check at best_len-1 can be removed because it will be made - * again later. (This heuristic is not always a win.) - * It is not necessary to compare scan[2] and match[2] since they - * are always equal when the other bytes match, given that - * the hash keys are equal and that HASH_BITS >= 8. - */ - scan += 2; - match++; - // Assert(*scan == *match, "match[2]?"); - - /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. - */ - do { - /*jshint noempty:false*/ - } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && - _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && - _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && - _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && - scan < strend); - - // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); - - len = MAX_MATCH - (strend - scan); - scan = strend - MAX_MATCH; - - if (len > best_len) { - s.match_start = cur_match; - best_len = len; - if (len >= nice_match) { - break; - } - scan_end1 = _win[scan + best_len - 1]; - scan_end = _win[scan + best_len]; - } - } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0); - - if (best_len <= s.lookahead) { - return best_len; - } - return s.lookahead; -} - - -/* =========================================================================== - * Fill the window when the lookahead becomes insufficient. - * Updates strstart and lookahead. - * - * IN assertion: lookahead < MIN_LOOKAHEAD - * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD - * At least one byte has been read, or avail_in == 0; reads are - * performed for at least two bytes (required for the zip translate_eol - * option -- not supported here). - */ -function fill_window(s) { - var _w_size = s.w_size; - var p, n, m, more, str; - - //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); - - do { - more = s.window_size - s.lookahead - s.strstart; - - // JS ints have 32 bit, block below not needed - /* Deal with !@#$% 64K limit: */ - //if (sizeof(int) <= 2) { - // if (more == 0 && s->strstart == 0 && s->lookahead == 0) { - // more = wsize; - // - // } else if (more == (unsigned)(-1)) { - // /* Very unlikely, but possible on 16 bit machine if - // * strstart == 0 && lookahead == 1 (input done a byte at time) - // */ - // more--; - // } - //} - - - /* If the window is almost full and there is insufficient lookahead, - * move the upper half to the lower one to make room in the upper half. - */ - if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) { - - utils.arraySet(s.window, s.window, _w_size, _w_size, 0); - s.match_start -= _w_size; - s.strstart -= _w_size; - /* we now have strstart >= MAX_DIST */ - s.block_start -= _w_size; - - /* Slide the hash table (could be avoided with 32 bit values - at the expense of memory usage). We slide even when level == 0 - to keep the hash table consistent if we switch back to level > 0 - later. (Using level 0 permanently is not an optimal usage of - zlib, so we don't care about this pathological case.) - */ - - n = s.hash_size; - p = n; - do { - m = s.head[--p]; - s.head[p] = (m >= _w_size ? m - _w_size : 0); - } while (--n); - - n = _w_size; - p = n; - do { - m = s.prev[--p]; - s.prev[p] = (m >= _w_size ? m - _w_size : 0); - /* If n is not on any hash chain, prev[n] is garbage but - * its value will never be used. - */ - } while (--n); - - more += _w_size; - } - if (s.strm.avail_in === 0) { - break; - } - - /* If there was no sliding: - * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && - * more == window_size - lookahead - strstart - * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) - * => more >= window_size - 2*WSIZE + 2 - * In the BIG_MEM or MMAP case (not yet supported), - * window_size == input_size + MIN_LOOKAHEAD && - * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. - * Otherwise, window_size == 2*WSIZE so more >= 2. - * If there was sliding, more >= WSIZE. So in all cases, more >= 2. - */ - //Assert(more >= 2, "more < 2"); - n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more); - s.lookahead += n; - - /* Initialize the hash value now that we have some input: */ - if (s.lookahead + s.insert >= MIN_MATCH) { - str = s.strstart - s.insert; - s.ins_h = s.window[str]; - - /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask; -//#if MIN_MATCH != 3 -// Call update_hash() MIN_MATCH-3 more times -//#endif - while (s.insert) { - /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; - - s.prev[str & s.w_mask] = s.head[s.ins_h]; - s.head[s.ins_h] = str; - str++; - s.insert--; - if (s.lookahead + s.insert < MIN_MATCH) { - break; - } - } - } - /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, - * but this is not important since only literal bytes will be emitted. - */ - - } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0); - - /* If the WIN_INIT bytes after the end of the current data have never been - * written, then zero those bytes in order to avoid memory check reports of - * the use of uninitialized (or uninitialised as Julian writes) bytes by - * the longest match routines. Update the high water mark for the next - * time through here. WIN_INIT is set to MAX_MATCH since the longest match - * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. - */ -// if (s.high_water < s.window_size) { -// var curr = s.strstart + s.lookahead; -// var init = 0; -// -// if (s.high_water < curr) { -// /* Previous high water mark below current data -- zero WIN_INIT -// * bytes or up to end of window, whichever is less. -// */ -// init = s.window_size - curr; -// if (init > WIN_INIT) -// init = WIN_INIT; -// zmemzero(s->window + curr, (unsigned)init); -// s->high_water = curr + init; -// } -// else if (s->high_water < (ulg)curr + WIN_INIT) { -// /* High water mark at or above current data, but below current data -// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up -// * to end of window, whichever is less. -// */ -// init = (ulg)curr + WIN_INIT - s->high_water; -// if (init > s->window_size - s->high_water) -// init = s->window_size - s->high_water; -// zmemzero(s->window + s->high_water, (unsigned)init); -// s->high_water += init; -// } -// } -// -// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, -// "not enough room for search"); -} - -/* =========================================================================== - * Copy without compression as much as possible from the input stream, return - * the current block state. - * This function does not insert new strings in the dictionary since - * uncompressible data is probably not useful. This function is used - * only for the level=0 compression option. - * NOTE: this function should be optimized to avoid extra copying from - * window to pending_buf. - */ -function deflate_stored(s, flush) { - /* Stored blocks are limited to 0xffff bytes, pending_buf is limited - * to pending_buf_size, and each stored block has a 5 byte header: - */ - var max_block_size = 0xffff; - - if (max_block_size > s.pending_buf_size - 5) { - max_block_size = s.pending_buf_size - 5; - } - - /* Copy as much as possible from input to output: */ - for (;;) { - /* Fill the window as much as possible: */ - if (s.lookahead <= 1) { - - //Assert(s->strstart < s->w_size+MAX_DIST(s) || - // s->block_start >= (long)s->w_size, "slide too late"); -// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) || -// s.block_start >= s.w_size)) { -// throw new Error("slide too late"); -// } - - fill_window(s); - if (s.lookahead === 0 && flush === Z_NO_FLUSH) { - return BS_NEED_MORE; - } - - if (s.lookahead === 0) { - break; - } - /* flush the current block */ - } - //Assert(s->block_start >= 0L, "block gone"); -// if (s.block_start < 0) throw new Error("block gone"); - - s.strstart += s.lookahead; - s.lookahead = 0; - - /* Emit a stored block if pending_buf will be full: */ - var max_start = s.block_start + max_block_size; - - if (s.strstart === 0 || s.strstart >= max_start) { - /* strstart == 0 is possible when wraparound on 16-bit machine */ - s.lookahead = s.strstart - max_start; - s.strstart = max_start; - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - - - } - /* Flush if we may have to slide, otherwise block_start may become - * negative and the data will be gone: - */ - if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - } - - s.insert = 0; - - if (flush === Z_FINISH) { - /*** FLUSH_BLOCK(s, 1); ***/ - flush_block_only(s, true); - if (s.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - /***/ - return BS_FINISH_DONE; - } - - if (s.strstart > s.block_start) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - - return BS_NEED_MORE; -} - -/* =========================================================================== - * Compress as much as possible from the input stream, return the current - * block state. - * This function does not perform lazy evaluation of matches and inserts - * new strings in the dictionary only for unmatched strings or for short - * matches. It is used only for the fast compression options. - */ -function deflate_fast(s, flush) { - var hash_head; /* head of the hash chain */ - var bflush; /* set if current block must be flushed */ - - for (;;) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - if (s.lookahead < MIN_LOOKAHEAD) { - fill_window(s); - if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { - return BS_NEED_MORE; - } - if (s.lookahead === 0) { - break; /* flush the current block */ - } - } - - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - hash_head = 0/*NIL*/; - if (s.lookahead >= MIN_MATCH) { - /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; - hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; - s.head[s.ins_h] = s.strstart; - /***/ - } - - /* Find the longest match, discarding those <= prev_length. - * At this point we have always match_length < MIN_MATCH - */ - if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - s.match_length = longest_match(s, hash_head); - /* longest_match() sets match_start */ - } - if (s.match_length >= MIN_MATCH) { - // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only - - /*** _tr_tally_dist(s, s.strstart - s.match_start, - s.match_length - MIN_MATCH, bflush); ***/ - bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); - - s.lookahead -= s.match_length; - - /* Insert new strings in the hash table only if the match length - * is not too large. This saves time but degrades compression. - */ - if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) { - s.match_length--; /* string at strstart already in table */ - do { - s.strstart++; - /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; - hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; - s.head[s.ins_h] = s.strstart; - /***/ - /* strstart never exceeds WSIZE-MAX_MATCH, so there are - * always MIN_MATCH bytes ahead. - */ - } while (--s.match_length !== 0); - s.strstart++; - } else - { - s.strstart += s.match_length; - s.match_length = 0; - s.ins_h = s.window[s.strstart]; - /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask; - -//#if MIN_MATCH != 3 -// Call UPDATE_HASH() MIN_MATCH-3 more times -//#endif - /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not - * matter since it will be recomputed at next deflate call. - */ - } - } else { - /* No match, output a literal byte */ - //Tracevv((stderr,"%c", s.window[s.strstart])); - /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = trees._tr_tally(s, 0, s.window[s.strstart]); - - s.lookahead--; - s.strstart++; - } - if (bflush) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - } - s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1); - if (flush === Z_FINISH) { - /*** FLUSH_BLOCK(s, 1); ***/ - flush_block_only(s, true); - if (s.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - /***/ - return BS_FINISH_DONE; - } - if (s.last_lit) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - return BS_BLOCK_DONE; -} - -/* =========================================================================== - * Same as above, but achieves better compression. We use a lazy - * evaluation for matches: a match is finally adopted only if there is - * no better match at the next window position. - */ -function deflate_slow(s, flush) { - var hash_head; /* head of hash chain */ - var bflush; /* set if current block must be flushed */ - - var max_insert; - - /* Process the input block. */ - for (;;) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the next match, plus MIN_MATCH bytes to insert the - * string following the next match. - */ - if (s.lookahead < MIN_LOOKAHEAD) { - fill_window(s); - if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { - return BS_NEED_MORE; - } - if (s.lookahead === 0) { break; } /* flush the current block */ - } - - /* Insert the string window[strstart .. strstart+2] in the - * dictionary, and set hash_head to the head of the hash chain: - */ - hash_head = 0/*NIL*/; - if (s.lookahead >= MIN_MATCH) { - /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; - hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; - s.head[s.ins_h] = s.strstart; - /***/ - } - - /* Find the longest match, discarding those <= prev_length. - */ - s.prev_length = s.match_length; - s.prev_match = s.match_start; - s.match_length = MIN_MATCH - 1; - - if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match && - s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) { - /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ - s.match_length = longest_match(s, hash_head); - /* longest_match() sets match_start */ - - if (s.match_length <= 5 && - (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { - - /* If prev_match is also MIN_MATCH, match_start is garbage - * but we will ignore the current match anyway. - */ - s.match_length = MIN_MATCH - 1; - } - } - /* If there was a match at the previous step and the current - * match is not better, output the previous match: - */ - if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { - max_insert = s.strstart + s.lookahead - MIN_MATCH; - /* Do not insert strings in hash table beyond this. */ - - //check_match(s, s.strstart-1, s.prev_match, s.prev_length); - - /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match, - s.prev_length - MIN_MATCH, bflush);***/ - bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH); - /* Insert in hash table all strings up to the end of the match. - * strstart-1 and strstart are already inserted. If there is not - * enough lookahead, the last two strings are not inserted in - * the hash table. - */ - s.lookahead -= s.prev_length - 1; - s.prev_length -= 2; - do { - if (++s.strstart <= max_insert) { - /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; - hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; - s.head[s.ins_h] = s.strstart; - /***/ - } - } while (--s.prev_length !== 0); - s.match_available = 0; - s.match_length = MIN_MATCH - 1; - s.strstart++; - - if (bflush) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - - } else if (s.match_available) { - /* If there was no match at the previous position, output a - * single literal. If there was a match but the current match - * is longer, truncate the previous match to a single literal. - */ - //Tracevv((stderr,"%c", s->window[s->strstart-1])); - /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ - bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); - - if (bflush) { - /*** FLUSH_BLOCK_ONLY(s, 0) ***/ - flush_block_only(s, false); - /***/ - } - s.strstart++; - s.lookahead--; - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - } else { - /* There is no previous match to compare with, wait for - * the next step to decide. - */ - s.match_available = 1; - s.strstart++; - s.lookahead--; - } - } - //Assert (flush != Z_NO_FLUSH, "no flush?"); - if (s.match_available) { - //Tracevv((stderr,"%c", s->window[s->strstart-1])); - /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ - bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); - - s.match_available = 0; - } - s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; - if (flush === Z_FINISH) { - /*** FLUSH_BLOCK(s, 1); ***/ - flush_block_only(s, true); - if (s.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - /***/ - return BS_FINISH_DONE; - } - if (s.last_lit) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - - return BS_BLOCK_DONE; -} - - -/* =========================================================================== - * For Z_RLE, simply look for runs of bytes, generate matches only of distance - * one. Do not maintain a hash table. (It will be regenerated if this run of - * deflate switches away from Z_RLE.) - */ -function deflate_rle(s, flush) { - var bflush; /* set if current block must be flushed */ - var prev; /* byte at distance one to match */ - var scan, strend; /* scan goes up to strend for length of run */ - - var _win = s.window; - - for (;;) { - /* Make sure that we always have enough lookahead, except - * at the end of the input file. We need MAX_MATCH bytes - * for the longest run, plus one for the unrolled loop. - */ - if (s.lookahead <= MAX_MATCH) { - fill_window(s); - if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) { - return BS_NEED_MORE; - } - if (s.lookahead === 0) { break; } /* flush the current block */ - } - - /* See how many times the previous byte repeats */ - s.match_length = 0; - if (s.lookahead >= MIN_MATCH && s.strstart > 0) { - scan = s.strstart - 1; - prev = _win[scan]; - if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { - strend = s.strstart + MAX_MATCH; - do { - /*jshint noempty:false*/ - } while (prev === _win[++scan] && prev === _win[++scan] && - prev === _win[++scan] && prev === _win[++scan] && - prev === _win[++scan] && prev === _win[++scan] && - prev === _win[++scan] && prev === _win[++scan] && - scan < strend); - s.match_length = MAX_MATCH - (strend - scan); - if (s.match_length > s.lookahead) { - s.match_length = s.lookahead; - } - } - //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); - } - - /* Emit match if have run of MIN_MATCH or longer, else emit literal */ - if (s.match_length >= MIN_MATCH) { - //check_match(s, s.strstart, s.strstart - 1, s.match_length); - - /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/ - bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH); - - s.lookahead -= s.match_length; - s.strstart += s.match_length; - s.match_length = 0; - } else { - /* No match, output a literal byte */ - //Tracevv((stderr,"%c", s->window[s->strstart])); - /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = trees._tr_tally(s, 0, s.window[s.strstart]); - - s.lookahead--; - s.strstart++; - } - if (bflush) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - } - s.insert = 0; - if (flush === Z_FINISH) { - /*** FLUSH_BLOCK(s, 1); ***/ - flush_block_only(s, true); - if (s.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - /***/ - return BS_FINISH_DONE; - } - if (s.last_lit) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - return BS_BLOCK_DONE; -} - -/* =========================================================================== - * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. - * (It will be regenerated if this run of deflate switches away from Huffman.) - */ -function deflate_huff(s, flush) { - var bflush; /* set if current block must be flushed */ - - for (;;) { - /* Make sure that we have a literal to write. */ - if (s.lookahead === 0) { - fill_window(s); - if (s.lookahead === 0) { - if (flush === Z_NO_FLUSH) { - return BS_NEED_MORE; - } - break; /* flush the current block */ - } - } - - /* Output a literal byte */ - s.match_length = 0; - //Tracevv((stderr,"%c", s->window[s->strstart])); - /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = trees._tr_tally(s, 0, s.window[s.strstart]); - s.lookahead--; - s.strstart++; - if (bflush) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - } - s.insert = 0; - if (flush === Z_FINISH) { - /*** FLUSH_BLOCK(s, 1); ***/ - flush_block_only(s, true); - if (s.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - /***/ - return BS_FINISH_DONE; - } - if (s.last_lit) { - /*** FLUSH_BLOCK(s, 0); ***/ - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - /***/ - } - return BS_BLOCK_DONE; -} - -/* Values for max_lazy_match, good_match and max_chain_length, depending on - * the desired pack level (0..9). The values given below have been tuned to - * exclude worst case performance for pathological files. Better values may be - * found for specific files. - */ -function Config(good_length, max_lazy, nice_length, max_chain, func) { - this.good_length = good_length; - this.max_lazy = max_lazy; - this.nice_length = nice_length; - this.max_chain = max_chain; - this.func = func; -} - -var configuration_table; - -configuration_table = [ - /* good lazy nice chain */ - new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */ - new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */ - new Config(4, 5, 16, 8, deflate_fast), /* 2 */ - new Config(4, 6, 32, 32, deflate_fast), /* 3 */ - - new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */ - new Config(8, 16, 32, 32, deflate_slow), /* 5 */ - new Config(8, 16, 128, 128, deflate_slow), /* 6 */ - new Config(8, 32, 128, 256, deflate_slow), /* 7 */ - new Config(32, 128, 258, 1024, deflate_slow), /* 8 */ - new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */ -]; - - -/* =========================================================================== - * Initialize the "longest match" routines for a new zlib stream - */ -function lm_init(s) { - s.window_size = 2 * s.w_size; - - /*** CLEAR_HASH(s); ***/ - zero(s.head); // Fill with NIL (= 0); - - /* Set the default configuration parameters: - */ - s.max_lazy_match = configuration_table[s.level].max_lazy; - s.good_match = configuration_table[s.level].good_length; - s.nice_match = configuration_table[s.level].nice_length; - s.max_chain_length = configuration_table[s.level].max_chain; - - s.strstart = 0; - s.block_start = 0; - s.lookahead = 0; - s.insert = 0; - s.match_length = s.prev_length = MIN_MATCH - 1; - s.match_available = 0; - s.ins_h = 0; -} - - -function DeflateState() { - this.strm = null; /* pointer back to this zlib stream */ - this.status = 0; /* as the name implies */ - this.pending_buf = null; /* output still pending */ - this.pending_buf_size = 0; /* size of pending_buf */ - this.pending_out = 0; /* next pending byte to output to the stream */ - this.pending = 0; /* nb of bytes in the pending buffer */ - this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ - this.gzhead = null; /* gzip header information to write */ - this.gzindex = 0; /* where in extra, name, or comment */ - this.method = Z_DEFLATED; /* can only be DEFLATED */ - this.last_flush = -1; /* value of flush param for previous deflate call */ - - this.w_size = 0; /* LZ77 window size (32K by default) */ - this.w_bits = 0; /* log2(w_size) (8..16) */ - this.w_mask = 0; /* w_size - 1 */ - - this.window = null; - /* Sliding window. Input bytes are read into the second half of the window, - * and move to the first half later to keep a dictionary of at least wSize - * bytes. With this organization, matches are limited to a distance of - * wSize-MAX_MATCH bytes, but this ensures that IO is always - * performed with a length multiple of the block size. - */ - - this.window_size = 0; - /* Actual size of window: 2*wSize, except when the user input buffer - * is directly used as sliding window. - */ - - this.prev = null; - /* Link to older string with same hash index. To limit the size of this - * array to 64K, this link is maintained only for the last 32K strings. - * An index in this array is thus a window index modulo 32K. - */ - - this.head = null; /* Heads of the hash chains or NIL. */ - - this.ins_h = 0; /* hash index of string to be inserted */ - this.hash_size = 0; /* number of elements in hash table */ - this.hash_bits = 0; /* log2(hash_size) */ - this.hash_mask = 0; /* hash_size-1 */ - - this.hash_shift = 0; - /* Number of bits by which ins_h must be shifted at each input - * step. It must be such that after MIN_MATCH steps, the oldest - * byte no longer takes part in the hash key, that is: - * hash_shift * MIN_MATCH >= hash_bits - */ - - this.block_start = 0; - /* Window position at the beginning of the current output block. Gets - * negative when the window is moved backwards. - */ - - this.match_length = 0; /* length of best match */ - this.prev_match = 0; /* previous match */ - this.match_available = 0; /* set if previous match exists */ - this.strstart = 0; /* start of string to insert */ - this.match_start = 0; /* start of matching string */ - this.lookahead = 0; /* number of valid bytes ahead in window */ - - this.prev_length = 0; - /* Length of the best match at previous step. Matches not greater than this - * are discarded. This is used in the lazy match evaluation. - */ - - this.max_chain_length = 0; - /* To speed up deflation, hash chains are never searched beyond this - * length. A higher limit improves compression ratio but degrades the - * speed. - */ - - this.max_lazy_match = 0; - /* Attempt to find a better match only when the current match is strictly - * smaller than this value. This mechanism is used only for compression - * levels >= 4. - */ - // That's alias to max_lazy_match, don't use directly - //this.max_insert_length = 0; - /* Insert new strings in the hash table only if the match length is not - * greater than this length. This saves time but degrades compression. - * max_insert_length is used only for compression levels <= 3. - */ - - this.level = 0; /* compression level (1..9) */ - this.strategy = 0; /* favor or force Huffman coding*/ - - this.good_match = 0; - /* Use a faster search when the previous match is longer than this */ - - this.nice_match = 0; /* Stop searching when current match exceeds this */ - - /* used by trees.c: */ - - /* Didn't use ct_data typedef below to suppress compiler warning */ - - // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ - // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ - // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ - - // Use flat array of DOUBLE size, with interleaved fata, - // because JS does not support effective - this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2); - this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2); - this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2); - zero(this.dyn_ltree); - zero(this.dyn_dtree); - zero(this.bl_tree); - - this.l_desc = null; /* desc. for literal tree */ - this.d_desc = null; /* desc. for distance tree */ - this.bl_desc = null; /* desc. for bit length tree */ - - //ush bl_count[MAX_BITS+1]; - this.bl_count = new utils.Buf16(MAX_BITS + 1); - /* number of codes at each bit length for an optimal tree */ - - //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ - this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */ - zero(this.heap); - - this.heap_len = 0; /* number of elements in the heap */ - this.heap_max = 0; /* element of largest frequency */ - /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. - * The same heap array is used to build all trees. - */ - - this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1]; - zero(this.depth); - /* Depth of each subtree used as tie breaker for trees of equal frequency - */ - - this.l_buf = 0; /* buffer index for literals or lengths */ - - this.lit_bufsize = 0; - /* Size of match buffer for literals/lengths. There are 4 reasons for - * limiting lit_bufsize to 64K: - * - frequencies can be kept in 16 bit counters - * - if compression is not successful for the first block, all input - * data is still in the window so we can still emit a stored block even - * when input comes from standard input. (This can also be done for - * all blocks if lit_bufsize is not greater than 32K.) - * - if compression is not successful for a file smaller than 64K, we can - * even emit a stored file instead of a stored block (saving 5 bytes). - * This is applicable only for zip (not gzip or zlib). - * - creating new Huffman trees less frequently may not provide fast - * adaptation to changes in the input data statistics. (Take for - * example a binary file with poorly compressible code followed by - * a highly compressible string table.) Smaller buffer sizes give - * fast adaptation but have of course the overhead of transmitting - * trees more frequently. - * - I can't count above 4 - */ - - this.last_lit = 0; /* running index in l_buf */ - - this.d_buf = 0; - /* Buffer index for distances. To simplify the code, d_buf and l_buf have - * the same number of elements. To use different lengths, an extra flag - * array would be necessary. - */ - - this.opt_len = 0; /* bit length of current block with optimal trees */ - this.static_len = 0; /* bit length of current block with static trees */ - this.matches = 0; /* number of string matches in current block */ - this.insert = 0; /* bytes at end of window left to insert */ - - - this.bi_buf = 0; - /* Output buffer. bits are inserted starting at the bottom (least - * significant bits). - */ - this.bi_valid = 0; - /* Number of valid bits in bi_buf. All bits above the last valid bit - * are always zero. - */ - - // Used for window memory init. We safely ignore it for JS. That makes - // sense only for pointers and memory check tools. - //this.high_water = 0; - /* High water mark offset in window for initialized bytes -- bytes above - * this are set to zero in order to avoid memory check warnings when - * longest match routines access bytes past the input. This is then - * updated to the new high water mark. - */ -} - - -function deflateResetKeep(strm) { - var s; - - if (!strm || !strm.state) { - return err(strm, Z_STREAM_ERROR); - } - - strm.total_in = strm.total_out = 0; - strm.data_type = Z_UNKNOWN; - - s = strm.state; - s.pending = 0; - s.pending_out = 0; - - if (s.wrap < 0) { - s.wrap = -s.wrap; - /* was made negative by deflate(..., Z_FINISH); */ - } - s.status = (s.wrap ? INIT_STATE : BUSY_STATE); - strm.adler = (s.wrap === 2) ? - 0 // crc32(0, Z_NULL, 0) - : - 1; // adler32(0, Z_NULL, 0) - s.last_flush = Z_NO_FLUSH; - trees._tr_init(s); - return Z_OK; -} - - -function deflateReset(strm) { - var ret = deflateResetKeep(strm); - if (ret === Z_OK) { - lm_init(strm.state); - } - return ret; -} - - -function deflateSetHeader(strm, head) { - if (!strm || !strm.state) { return Z_STREAM_ERROR; } - if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; } - strm.state.gzhead = head; - return Z_OK; -} - - -function deflateInit2(strm, level, method, windowBits, memLevel, strategy) { - if (!strm) { // === Z_NULL - return Z_STREAM_ERROR; - } - var wrap = 1; - - if (level === Z_DEFAULT_COMPRESSION) { - level = 6; - } - - if (windowBits < 0) { /* suppress zlib wrapper */ - wrap = 0; - windowBits = -windowBits; - } - - else if (windowBits > 15) { - wrap = 2; /* write gzip wrapper instead */ - windowBits -= 16; - } - - - if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || - windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || - strategy < 0 || strategy > Z_FIXED) { - return err(strm, Z_STREAM_ERROR); - } - - - if (windowBits === 8) { - windowBits = 9; - } - /* until 256-byte window bug fixed */ - - var s = new DeflateState(); - - strm.state = s; - s.strm = strm; - - s.wrap = wrap; - s.gzhead = null; - s.w_bits = windowBits; - s.w_size = 1 << s.w_bits; - s.w_mask = s.w_size - 1; - - s.hash_bits = memLevel + 7; - s.hash_size = 1 << s.hash_bits; - s.hash_mask = s.hash_size - 1; - s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); - - s.window = new utils.Buf8(s.w_size * 2); - s.head = new utils.Buf16(s.hash_size); - s.prev = new utils.Buf16(s.w_size); - - // Don't need mem init magic for JS. - //s.high_water = 0; /* nothing written to s->window yet */ - - s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ - - s.pending_buf_size = s.lit_bufsize * 4; - - //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); - //s->pending_buf = (uchf *) overlay; - s.pending_buf = new utils.Buf8(s.pending_buf_size); - - // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`) - //s->d_buf = overlay + s->lit_bufsize/sizeof(ush); - s.d_buf = 1 * s.lit_bufsize; - - //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; - s.l_buf = (1 + 2) * s.lit_bufsize; - - s.level = level; - s.strategy = strategy; - s.method = method; - - return deflateReset(strm); -} - -function deflateInit(strm, level) { - return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); -} - - -function deflate(strm, flush) { - var old_flush, s; - var beg, val; // for gzip header write only - - if (!strm || !strm.state || - flush > Z_BLOCK || flush < 0) { - return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR; - } - - s = strm.state; - - if (!strm.output || - (!strm.input && strm.avail_in !== 0) || - (s.status === FINISH_STATE && flush !== Z_FINISH)) { - return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR); - } - - s.strm = strm; /* just in case */ - old_flush = s.last_flush; - s.last_flush = flush; - - /* Write the header */ - if (s.status === INIT_STATE) { - - if (s.wrap === 2) { // GZIP header - strm.adler = 0; //crc32(0L, Z_NULL, 0); - put_byte(s, 31); - put_byte(s, 139); - put_byte(s, 8); - if (!s.gzhead) { // s->gzhead == Z_NULL - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, s.level === 9 ? 2 : - (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? - 4 : 0)); - put_byte(s, OS_CODE); - s.status = BUSY_STATE; - } - else { - put_byte(s, (s.gzhead.text ? 1 : 0) + - (s.gzhead.hcrc ? 2 : 0) + - (!s.gzhead.extra ? 0 : 4) + - (!s.gzhead.name ? 0 : 8) + - (!s.gzhead.comment ? 0 : 16) - ); - put_byte(s, s.gzhead.time & 0xff); - put_byte(s, (s.gzhead.time >> 8) & 0xff); - put_byte(s, (s.gzhead.time >> 16) & 0xff); - put_byte(s, (s.gzhead.time >> 24) & 0xff); - put_byte(s, s.level === 9 ? 2 : - (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? - 4 : 0)); - put_byte(s, s.gzhead.os & 0xff); - if (s.gzhead.extra && s.gzhead.extra.length) { - put_byte(s, s.gzhead.extra.length & 0xff); - put_byte(s, (s.gzhead.extra.length >> 8) & 0xff); - } - if (s.gzhead.hcrc) { - strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0); - } - s.gzindex = 0; - s.status = EXTRA_STATE; - } - } - else // DEFLATE header - { - var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8; - var level_flags = -1; - - if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { - level_flags = 0; - } else if (s.level < 6) { - level_flags = 1; - } else if (s.level === 6) { - level_flags = 2; - } else { - level_flags = 3; - } - header |= (level_flags << 6); - if (s.strstart !== 0) { header |= PRESET_DICT; } - header += 31 - (header % 31); - - s.status = BUSY_STATE; - putShortMSB(s, header); - - /* Save the adler32 of the preset dictionary: */ - if (s.strstart !== 0) { - putShortMSB(s, strm.adler >>> 16); - putShortMSB(s, strm.adler & 0xffff); - } - strm.adler = 1; // adler32(0L, Z_NULL, 0); - } - } - -//#ifdef GZIP - if (s.status === EXTRA_STATE) { - if (s.gzhead.extra/* != Z_NULL*/) { - beg = s.pending; /* start of bytes to update crc */ - - while (s.gzindex < (s.gzhead.extra.length & 0xffff)) { - if (s.pending === s.pending_buf_size) { - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); - } - flush_pending(strm); - beg = s.pending; - if (s.pending === s.pending_buf_size) { - break; - } - } - put_byte(s, s.gzhead.extra[s.gzindex] & 0xff); - s.gzindex++; - } - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); - } - if (s.gzindex === s.gzhead.extra.length) { - s.gzindex = 0; - s.status = NAME_STATE; - } - } - else { - s.status = NAME_STATE; - } - } - if (s.status === NAME_STATE) { - if (s.gzhead.name/* != Z_NULL*/) { - beg = s.pending; /* start of bytes to update crc */ - //int val; - - do { - if (s.pending === s.pending_buf_size) { - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); - } - flush_pending(strm); - beg = s.pending; - if (s.pending === s.pending_buf_size) { - val = 1; - break; - } - } - // JS specific: little magic to add zero terminator to end of string - if (s.gzindex < s.gzhead.name.length) { - val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff; - } else { - val = 0; - } - put_byte(s, val); - } while (val !== 0); - - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); - } - if (val === 0) { - s.gzindex = 0; - s.status = COMMENT_STATE; - } - } - else { - s.status = COMMENT_STATE; - } - } - if (s.status === COMMENT_STATE) { - if (s.gzhead.comment/* != Z_NULL*/) { - beg = s.pending; /* start of bytes to update crc */ - //int val; - - do { - if (s.pending === s.pending_buf_size) { - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); - } - flush_pending(strm); - beg = s.pending; - if (s.pending === s.pending_buf_size) { - val = 1; - break; - } - } - // JS specific: little magic to add zero terminator to end of string - if (s.gzindex < s.gzhead.comment.length) { - val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff; - } else { - val = 0; - } - put_byte(s, val); - } while (val !== 0); - - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); - } - if (val === 0) { - s.status = HCRC_STATE; - } - } - else { - s.status = HCRC_STATE; - } - } - if (s.status === HCRC_STATE) { - if (s.gzhead.hcrc) { - if (s.pending + 2 > s.pending_buf_size) { - flush_pending(strm); - } - if (s.pending + 2 <= s.pending_buf_size) { - put_byte(s, strm.adler & 0xff); - put_byte(s, (strm.adler >> 8) & 0xff); - strm.adler = 0; //crc32(0L, Z_NULL, 0); - s.status = BUSY_STATE; - } - } - else { - s.status = BUSY_STATE; - } - } -//#endif - - /* Flush as much pending output as possible */ - if (s.pending !== 0) { - flush_pending(strm); - if (strm.avail_out === 0) { - /* Since avail_out is 0, deflate will be called again with - * more output space, but possibly with both pending and - * avail_in equal to zero. There won't be anything to do, - * but this is not an error situation so make sure we - * return OK instead of BUF_ERROR at next call of deflate: - */ - s.last_flush = -1; - return Z_OK; - } - - /* Make sure there is something to do and avoid duplicate consecutive - * flushes. For repeated and useless calls with Z_FINISH, we keep - * returning Z_STREAM_END instead of Z_BUF_ERROR. - */ - } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && - flush !== Z_FINISH) { - return err(strm, Z_BUF_ERROR); - } - - /* User must not provide more input after the first FINISH: */ - if (s.status === FINISH_STATE && strm.avail_in !== 0) { - return err(strm, Z_BUF_ERROR); - } - - /* Start a new block or continue the current one. - */ - if (strm.avail_in !== 0 || s.lookahead !== 0 || - (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) { - var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) : - (s.strategy === Z_RLE ? deflate_rle(s, flush) : - configuration_table[s.level].func(s, flush)); - - if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) { - s.status = FINISH_STATE; - } - if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) { - if (strm.avail_out === 0) { - s.last_flush = -1; - /* avoid BUF_ERROR next call, see above */ - } - return Z_OK; - /* If flush != Z_NO_FLUSH && avail_out == 0, the next call - * of deflate should use the same flush parameter to make sure - * that the flush is complete. So we don't have to output an - * empty block here, this will be done at next call. This also - * ensures that for a very small output buffer, we emit at most - * one empty block. - */ - } - if (bstate === BS_BLOCK_DONE) { - if (flush === Z_PARTIAL_FLUSH) { - trees._tr_align(s); - } - else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ - - trees._tr_stored_block(s, 0, 0, false); - /* For a full flush, this empty block will be recognized - * as a special marker by inflate_sync(). - */ - if (flush === Z_FULL_FLUSH) { - /*** CLEAR_HASH(s); ***/ /* forget history */ - zero(s.head); // Fill with NIL (= 0); - - if (s.lookahead === 0) { - s.strstart = 0; - s.block_start = 0; - s.insert = 0; - } - } - } - flush_pending(strm); - if (strm.avail_out === 0) { - s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */ - return Z_OK; - } - } - } - //Assert(strm->avail_out > 0, "bug2"); - //if (strm.avail_out <= 0) { throw new Error("bug2");} - - if (flush !== Z_FINISH) { return Z_OK; } - if (s.wrap <= 0) { return Z_STREAM_END; } - - /* Write the trailer */ - if (s.wrap === 2) { - put_byte(s, strm.adler & 0xff); - put_byte(s, (strm.adler >> 8) & 0xff); - put_byte(s, (strm.adler >> 16) & 0xff); - put_byte(s, (strm.adler >> 24) & 0xff); - put_byte(s, strm.total_in & 0xff); - put_byte(s, (strm.total_in >> 8) & 0xff); - put_byte(s, (strm.total_in >> 16) & 0xff); - put_byte(s, (strm.total_in >> 24) & 0xff); - } - else - { - putShortMSB(s, strm.adler >>> 16); - putShortMSB(s, strm.adler & 0xffff); - } - - flush_pending(strm); - /* If avail_out is zero, the application will call deflate again - * to flush the rest. - */ - if (s.wrap > 0) { s.wrap = -s.wrap; } - /* write the trailer only once! */ - return s.pending !== 0 ? Z_OK : Z_STREAM_END; -} - -function deflateEnd(strm) { - var status; - - if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { - return Z_STREAM_ERROR; - } - - status = strm.state.status; - if (status !== INIT_STATE && - status !== EXTRA_STATE && - status !== NAME_STATE && - status !== COMMENT_STATE && - status !== HCRC_STATE && - status !== BUSY_STATE && - status !== FINISH_STATE - ) { - return err(strm, Z_STREAM_ERROR); - } - - strm.state = null; - - return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; -} - - -/* ========================================================================= - * Initializes the compression dictionary from the given byte - * sequence without producing any compressed output. - */ -function deflateSetDictionary(strm, dictionary) { - var dictLength = dictionary.length; - - var s; - var str, n; - var wrap; - var avail; - var next; - var input; - var tmpDict; - - if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { - return Z_STREAM_ERROR; - } - - s = strm.state; - wrap = s.wrap; - - if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) { - return Z_STREAM_ERROR; - } - - /* when using zlib wrappers, compute Adler-32 for provided dictionary */ - if (wrap === 1) { - /* adler32(strm->adler, dictionary, dictLength); */ - strm.adler = adler32(strm.adler, dictionary, dictLength, 0); - } - - s.wrap = 0; /* avoid computing Adler-32 in read_buf */ - - /* if dictionary would fill window, just replace the history */ - if (dictLength >= s.w_size) { - if (wrap === 0) { /* already empty otherwise */ - /*** CLEAR_HASH(s); ***/ - zero(s.head); // Fill with NIL (= 0); - s.strstart = 0; - s.block_start = 0; - s.insert = 0; - } - /* use the tail */ - // dictionary = dictionary.slice(dictLength - s.w_size); - tmpDict = new utils.Buf8(s.w_size); - utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0); - dictionary = tmpDict; - dictLength = s.w_size; - } - /* insert dictionary into window and hash */ - avail = strm.avail_in; - next = strm.next_in; - input = strm.input; - strm.avail_in = dictLength; - strm.next_in = 0; - strm.input = dictionary; - fill_window(s); - while (s.lookahead >= MIN_MATCH) { - str = s.strstart; - n = s.lookahead - (MIN_MATCH - 1); - do { - /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ - s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; - - s.prev[str & s.w_mask] = s.head[s.ins_h]; - - s.head[s.ins_h] = str; - str++; - } while (--n); - s.strstart = str; - s.lookahead = MIN_MATCH - 1; - fill_window(s); - } - s.strstart += s.lookahead; - s.block_start = s.strstart; - s.insert = s.lookahead; - s.lookahead = 0; - s.match_length = s.prev_length = MIN_MATCH - 1; - s.match_available = 0; - strm.next_in = next; - strm.input = input; - strm.avail_in = avail; - s.wrap = wrap; - return Z_OK; -} - - -exports.deflateInit = deflateInit; -exports.deflateInit2 = deflateInit2; -exports.deflateReset = deflateReset; -exports.deflateResetKeep = deflateResetKeep; -exports.deflateSetHeader = deflateSetHeader; -exports.deflate = deflate; -exports.deflateEnd = deflateEnd; -exports.deflateSetDictionary = deflateSetDictionary; -exports.deflateInfo = 'pako deflate (from Nodeca project)'; - -/* Not implemented -exports.deflateBound = deflateBound; -exports.deflateCopy = deflateCopy; -exports.deflateParams = deflateParams; -exports.deflatePending = deflatePending; -exports.deflatePrime = deflatePrime; -exports.deflateTune = deflateTune; -*/ diff --git a/node_modules/pako/lib/zlib/gzheader.js b/node_modules/pako/lib/zlib/gzheader.js deleted file mode 100644 index 9582cba60..000000000 --- a/node_modules/pako/lib/zlib/gzheader.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -function GZheader() { - /* true if compressed data believed to be text */ - this.text = 0; - /* modification time */ - this.time = 0; - /* extra flags (not used when writing a gzip file) */ - this.xflags = 0; - /* operating system */ - this.os = 0; - /* pointer to extra field or Z_NULL if none */ - this.extra = null; - /* extra field length (valid if extra != Z_NULL) */ - this.extra_len = 0; // Actually, we don't need it in JS, - // but leave for few code modifications - - // - // Setup limits is not necessary because in js we should not preallocate memory - // for inflate use constant limit in 65536 bytes - // - - /* space at extra (only when reading header) */ - // this.extra_max = 0; - /* pointer to zero-terminated file name or Z_NULL */ - this.name = ''; - /* space at name (only when reading header) */ - // this.name_max = 0; - /* pointer to zero-terminated comment or Z_NULL */ - this.comment = ''; - /* space at comment (only when reading header) */ - // this.comm_max = 0; - /* true if there was or will be a header crc */ - this.hcrc = 0; - /* true when done reading gzip header (not used when writing a gzip file) */ - this.done = false; -} - -module.exports = GZheader; diff --git a/node_modules/pako/lib/zlib/inffast.js b/node_modules/pako/lib/zlib/inffast.js deleted file mode 100644 index 4cc958fee..000000000 --- a/node_modules/pako/lib/zlib/inffast.js +++ /dev/null @@ -1,345 +0,0 @@ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -// See state defs from inflate.js -var BAD = 30; /* got a data error -- remain here until reset */ -var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ - -/* - Decode literal, length, and distance codes and write out the resulting - literal and match bytes until either not enough input or output is - available, an end-of-block is encountered, or a data error is encountered. - When large enough input and output buffers are supplied to inflate(), for - example, a 16K input buffer and a 64K output buffer, more than 95% of the - inflate execution time is spent in this routine. - - Entry assumptions: - - state.mode === LEN - strm.avail_in >= 6 - strm.avail_out >= 258 - start >= strm.avail_out - state.bits < 8 - - On return, state.mode is one of: - - LEN -- ran out of enough output space or enough available input - TYPE -- reached end of block code, inflate() to interpret next block - BAD -- error in block data - - Notes: - - - The maximum input bits used by a length/distance pair is 15 bits for the - length code, 5 bits for the length extra, 15 bits for the distance code, - and 13 bits for the distance extra. This totals 48 bits, or six bytes. - Therefore if strm.avail_in >= 6, then there is enough input to avoid - checking for available input while decoding. - - - The maximum bytes that a single length/distance pair can output is 258 - bytes, which is the maximum length that can be coded. inflate_fast() - requires strm.avail_out >= 258 for each loop to avoid checking for - output space. - */ -module.exports = function inflate_fast(strm, start) { - var state; - var _in; /* local strm.input */ - var last; /* have enough input while in < last */ - var _out; /* local strm.output */ - var beg; /* inflate()'s initial strm.output */ - var end; /* while out < end, enough space available */ -//#ifdef INFLATE_STRICT - var dmax; /* maximum distance from zlib header */ -//#endif - var wsize; /* window size or zero if not using window */ - var whave; /* valid bytes in the window */ - var wnext; /* window write index */ - // Use `s_window` instead `window`, avoid conflict with instrumentation tools - var s_window; /* allocated sliding window, if wsize != 0 */ - var hold; /* local strm.hold */ - var bits; /* local strm.bits */ - var lcode; /* local strm.lencode */ - var dcode; /* local strm.distcode */ - var lmask; /* mask for first level of length codes */ - var dmask; /* mask for first level of distance codes */ - var here; /* retrieved table entry */ - var op; /* code bits, operation, extra bits, or */ - /* window position, window bytes to copy */ - var len; /* match length, unused bytes */ - var dist; /* match distance */ - var from; /* where to copy match from */ - var from_source; - - - var input, output; // JS specific, because we have no pointers - - /* copy state to local variables */ - state = strm.state; - //here = state.here; - _in = strm.next_in; - input = strm.input; - last = _in + (strm.avail_in - 5); - _out = strm.next_out; - output = strm.output; - beg = _out - (start - strm.avail_out); - end = _out + (strm.avail_out - 257); -//#ifdef INFLATE_STRICT - dmax = state.dmax; -//#endif - wsize = state.wsize; - whave = state.whave; - wnext = state.wnext; - s_window = state.window; - hold = state.hold; - bits = state.bits; - lcode = state.lencode; - dcode = state.distcode; - lmask = (1 << state.lenbits) - 1; - dmask = (1 << state.distbits) - 1; - - - /* decode literals and length/distances until end-of-block or not enough - input data or output space */ - - top: - do { - if (bits < 15) { - hold += input[_in++] << bits; - bits += 8; - hold += input[_in++] << bits; - bits += 8; - } - - here = lcode[hold & lmask]; - - dolen: - for (;;) { // Goto emulation - op = here >>> 24/*here.bits*/; - hold >>>= op; - bits -= op; - op = (here >>> 16) & 0xff/*here.op*/; - if (op === 0) { /* literal */ - //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? - // "inflate: literal '%c'\n" : - // "inflate: literal 0x%02x\n", here.val)); - output[_out++] = here & 0xffff/*here.val*/; - } - else if (op & 16) { /* length base */ - len = here & 0xffff/*here.val*/; - op &= 15; /* number of extra bits */ - if (op) { - if (bits < op) { - hold += input[_in++] << bits; - bits += 8; - } - len += hold & ((1 << op) - 1); - hold >>>= op; - bits -= op; - } - //Tracevv((stderr, "inflate: length %u\n", len)); - if (bits < 15) { - hold += input[_in++] << bits; - bits += 8; - hold += input[_in++] << bits; - bits += 8; - } - here = dcode[hold & dmask]; - - dodist: - for (;;) { // goto emulation - op = here >>> 24/*here.bits*/; - hold >>>= op; - bits -= op; - op = (here >>> 16) & 0xff/*here.op*/; - - if (op & 16) { /* distance base */ - dist = here & 0xffff/*here.val*/; - op &= 15; /* number of extra bits */ - if (bits < op) { - hold += input[_in++] << bits; - bits += 8; - if (bits < op) { - hold += input[_in++] << bits; - bits += 8; - } - } - dist += hold & ((1 << op) - 1); -//#ifdef INFLATE_STRICT - if (dist > dmax) { - strm.msg = 'invalid distance too far back'; - state.mode = BAD; - break top; - } -//#endif - hold >>>= op; - bits -= op; - //Tracevv((stderr, "inflate: distance %u\n", dist)); - op = _out - beg; /* max distance in output */ - if (dist > op) { /* see if copy from window */ - op = dist - op; /* distance back in window */ - if (op > whave) { - if (state.sane) { - strm.msg = 'invalid distance too far back'; - state.mode = BAD; - break top; - } - -// (!) This block is disabled in zlib defaults, -// don't enable it for binary compatibility -//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR -// if (len <= op - whave) { -// do { -// output[_out++] = 0; -// } while (--len); -// continue top; -// } -// len -= op - whave; -// do { -// output[_out++] = 0; -// } while (--op > whave); -// if (op === 0) { -// from = _out - dist; -// do { -// output[_out++] = output[from++]; -// } while (--len); -// continue top; -// } -//#endif - } - from = 0; // window index - from_source = s_window; - if (wnext === 0) { /* very common case */ - from += wsize - op; - if (op < len) { /* some from window */ - len -= op; - do { - output[_out++] = s_window[from++]; - } while (--op); - from = _out - dist; /* rest from output */ - from_source = output; - } - } - else if (wnext < op) { /* wrap around window */ - from += wsize + wnext - op; - op -= wnext; - if (op < len) { /* some from end of window */ - len -= op; - do { - output[_out++] = s_window[from++]; - } while (--op); - from = 0; - if (wnext < len) { /* some from start of window */ - op = wnext; - len -= op; - do { - output[_out++] = s_window[from++]; - } while (--op); - from = _out - dist; /* rest from output */ - from_source = output; - } - } - } - else { /* contiguous in window */ - from += wnext - op; - if (op < len) { /* some from window */ - len -= op; - do { - output[_out++] = s_window[from++]; - } while (--op); - from = _out - dist; /* rest from output */ - from_source = output; - } - } - while (len > 2) { - output[_out++] = from_source[from++]; - output[_out++] = from_source[from++]; - output[_out++] = from_source[from++]; - len -= 3; - } - if (len) { - output[_out++] = from_source[from++]; - if (len > 1) { - output[_out++] = from_source[from++]; - } - } - } - else { - from = _out - dist; /* copy direct from output */ - do { /* minimum length is three */ - output[_out++] = output[from++]; - output[_out++] = output[from++]; - output[_out++] = output[from++]; - len -= 3; - } while (len > 2); - if (len) { - output[_out++] = output[from++]; - if (len > 1) { - output[_out++] = output[from++]; - } - } - } - } - else if ((op & 64) === 0) { /* 2nd level distance code */ - here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; - continue dodist; - } - else { - strm.msg = 'invalid distance code'; - state.mode = BAD; - break top; - } - - break; // need to emulate goto via "continue" - } - } - else if ((op & 64) === 0) { /* 2nd level length code */ - here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; - continue dolen; - } - else if (op & 32) { /* end-of-block */ - //Tracevv((stderr, "inflate: end of block\n")); - state.mode = TYPE; - break top; - } - else { - strm.msg = 'invalid literal/length code'; - state.mode = BAD; - break top; - } - - break; // need to emulate goto via "continue" - } - } while (_in < last && _out < end); - - /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ - len = bits >> 3; - _in -= len; - bits -= len << 3; - hold &= (1 << bits) - 1; - - /* update state and return */ - strm.next_in = _in; - strm.next_out = _out; - strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last)); - strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end)); - state.hold = hold; - state.bits = bits; - return; -}; diff --git a/node_modules/pako/lib/zlib/inflate.js b/node_modules/pako/lib/zlib/inflate.js deleted file mode 100644 index 638484484..000000000 --- a/node_modules/pako/lib/zlib/inflate.js +++ /dev/null @@ -1,1556 +0,0 @@ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -var utils = require('../utils/common'); -var adler32 = require('./adler32'); -var crc32 = require('./crc32'); -var inflate_fast = require('./inffast'); -var inflate_table = require('./inftrees'); - -var CODES = 0; -var LENS = 1; -var DISTS = 2; - -/* Public constants ==========================================================*/ -/* ===========================================================================*/ - - -/* Allowed flush values; see deflate() and inflate() below for details */ -//var Z_NO_FLUSH = 0; -//var Z_PARTIAL_FLUSH = 1; -//var Z_SYNC_FLUSH = 2; -//var Z_FULL_FLUSH = 3; -var Z_FINISH = 4; -var Z_BLOCK = 5; -var Z_TREES = 6; - - -/* Return codes for the compression/decompression functions. Negative values - * are errors, positive values are used for special but normal events. - */ -var Z_OK = 0; -var Z_STREAM_END = 1; -var Z_NEED_DICT = 2; -//var Z_ERRNO = -1; -var Z_STREAM_ERROR = -2; -var Z_DATA_ERROR = -3; -var Z_MEM_ERROR = -4; -var Z_BUF_ERROR = -5; -//var Z_VERSION_ERROR = -6; - -/* The deflate compression method */ -var Z_DEFLATED = 8; - - -/* STATES ====================================================================*/ -/* ===========================================================================*/ - - -var HEAD = 1; /* i: waiting for magic header */ -var FLAGS = 2; /* i: waiting for method and flags (gzip) */ -var TIME = 3; /* i: waiting for modification time (gzip) */ -var OS = 4; /* i: waiting for extra flags and operating system (gzip) */ -var EXLEN = 5; /* i: waiting for extra length (gzip) */ -var EXTRA = 6; /* i: waiting for extra bytes (gzip) */ -var NAME = 7; /* i: waiting for end of file name (gzip) */ -var COMMENT = 8; /* i: waiting for end of comment (gzip) */ -var HCRC = 9; /* i: waiting for header crc (gzip) */ -var DICTID = 10; /* i: waiting for dictionary check value */ -var DICT = 11; /* waiting for inflateSetDictionary() call */ -var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ -var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */ -var STORED = 14; /* i: waiting for stored size (length and complement) */ -var COPY_ = 15; /* i/o: same as COPY below, but only first time in */ -var COPY = 16; /* i/o: waiting for input or output to copy stored block */ -var TABLE = 17; /* i: waiting for dynamic block table lengths */ -var LENLENS = 18; /* i: waiting for code length code lengths */ -var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */ -var LEN_ = 20; /* i: same as LEN below, but only first time in */ -var LEN = 21; /* i: waiting for length/lit/eob code */ -var LENEXT = 22; /* i: waiting for length extra bits */ -var DIST = 23; /* i: waiting for distance code */ -var DISTEXT = 24; /* i: waiting for distance extra bits */ -var MATCH = 25; /* o: waiting for output space to copy string */ -var LIT = 26; /* o: waiting for output space to write literal */ -var CHECK = 27; /* i: waiting for 32-bit check value */ -var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */ -var DONE = 29; /* finished check, done -- remain here until reset */ -var BAD = 30; /* got a data error -- remain here until reset */ -var MEM = 31; /* got an inflate() memory error -- remain here until reset */ -var SYNC = 32; /* looking for synchronization bytes to restart inflate() */ - -/* ===========================================================================*/ - - - -var ENOUGH_LENS = 852; -var ENOUGH_DISTS = 592; -//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); - -var MAX_WBITS = 15; -/* 32K LZ77 window */ -var DEF_WBITS = MAX_WBITS; - - -function zswap32(q) { - return (((q >>> 24) & 0xff) + - ((q >>> 8) & 0xff00) + - ((q & 0xff00) << 8) + - ((q & 0xff) << 24)); -} - - -function InflateState() { - this.mode = 0; /* current inflate mode */ - this.last = false; /* true if processing last block */ - this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ - this.havedict = false; /* true if dictionary provided */ - this.flags = 0; /* gzip header method and flags (0 if zlib) */ - this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */ - this.check = 0; /* protected copy of check value */ - this.total = 0; /* protected copy of output count */ - // TODO: may be {} - this.head = null; /* where to save gzip header information */ - - /* sliding window */ - this.wbits = 0; /* log base 2 of requested window size */ - this.wsize = 0; /* window size or zero if not using window */ - this.whave = 0; /* valid bytes in the window */ - this.wnext = 0; /* window write index */ - this.window = null; /* allocated sliding window, if needed */ - - /* bit accumulator */ - this.hold = 0; /* input bit accumulator */ - this.bits = 0; /* number of bits in "in" */ - - /* for string and stored block copying */ - this.length = 0; /* literal or length of data to copy */ - this.offset = 0; /* distance back to copy string from */ - - /* for table and code decoding */ - this.extra = 0; /* extra bits needed */ - - /* fixed and dynamic code tables */ - this.lencode = null; /* starting table for length/literal codes */ - this.distcode = null; /* starting table for distance codes */ - this.lenbits = 0; /* index bits for lencode */ - this.distbits = 0; /* index bits for distcode */ - - /* dynamic table building */ - this.ncode = 0; /* number of code length code lengths */ - this.nlen = 0; /* number of length code lengths */ - this.ndist = 0; /* number of distance code lengths */ - this.have = 0; /* number of code lengths in lens[] */ - this.next = null; /* next available space in codes[] */ - - this.lens = new utils.Buf16(320); /* temporary storage for code lengths */ - this.work = new utils.Buf16(288); /* work area for code table building */ - - /* - because we don't have pointers in js, we use lencode and distcode directly - as buffers so we don't need codes - */ - //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */ - this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */ - this.distdyn = null; /* dynamic table for distance codes (JS specific) */ - this.sane = 0; /* if false, allow invalid distance too far */ - this.back = 0; /* bits back of last unprocessed length/lit */ - this.was = 0; /* initial length of match */ -} - -function inflateResetKeep(strm) { - var state; - - if (!strm || !strm.state) { return Z_STREAM_ERROR; } - state = strm.state; - strm.total_in = strm.total_out = state.total = 0; - strm.msg = ''; /*Z_NULL*/ - if (state.wrap) { /* to support ill-conceived Java test suite */ - strm.adler = state.wrap & 1; - } - state.mode = HEAD; - state.last = 0; - state.havedict = 0; - state.dmax = 32768; - state.head = null/*Z_NULL*/; - state.hold = 0; - state.bits = 0; - //state.lencode = state.distcode = state.next = state.codes; - state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS); - state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS); - - state.sane = 1; - state.back = -1; - //Tracev((stderr, "inflate: reset\n")); - return Z_OK; -} - -function inflateReset(strm) { - var state; - - if (!strm || !strm.state) { return Z_STREAM_ERROR; } - state = strm.state; - state.wsize = 0; - state.whave = 0; - state.wnext = 0; - return inflateResetKeep(strm); - -} - -function inflateReset2(strm, windowBits) { - var wrap; - var state; - - /* get the state */ - if (!strm || !strm.state) { return Z_STREAM_ERROR; } - state = strm.state; - - /* extract wrap request from windowBits parameter */ - if (windowBits < 0) { - wrap = 0; - windowBits = -windowBits; - } - else { - wrap = (windowBits >> 4) + 1; - if (windowBits < 48) { - windowBits &= 15; - } - } - - /* set number of window bits, free window if different */ - if (windowBits && (windowBits < 8 || windowBits > 15)) { - return Z_STREAM_ERROR; - } - if (state.window !== null && state.wbits !== windowBits) { - state.window = null; - } - - /* update state and reset the rest of it */ - state.wrap = wrap; - state.wbits = windowBits; - return inflateReset(strm); -} - -function inflateInit2(strm, windowBits) { - var ret; - var state; - - if (!strm) { return Z_STREAM_ERROR; } - //strm.msg = Z_NULL; /* in case we return an error */ - - state = new InflateState(); - - //if (state === Z_NULL) return Z_MEM_ERROR; - //Tracev((stderr, "inflate: allocated\n")); - strm.state = state; - state.window = null/*Z_NULL*/; - ret = inflateReset2(strm, windowBits); - if (ret !== Z_OK) { - strm.state = null/*Z_NULL*/; - } - return ret; -} - -function inflateInit(strm) { - return inflateInit2(strm, DEF_WBITS); -} - - -/* - Return state with length and distance decoding tables and index sizes set to - fixed code decoding. Normally this returns fixed tables from inffixed.h. - If BUILDFIXED is defined, then instead this routine builds the tables the - first time it's called, and returns those tables the first time and - thereafter. This reduces the size of the code by about 2K bytes, in - exchange for a little execution time. However, BUILDFIXED should not be - used for threaded applications, since the rewriting of the tables and virgin - may not be thread-safe. - */ -var virgin = true; - -var lenfix, distfix; // We have no pointers in JS, so keep tables separate - -function fixedtables(state) { - /* build fixed huffman tables if first call (may not be thread safe) */ - if (virgin) { - var sym; - - lenfix = new utils.Buf32(512); - distfix = new utils.Buf32(32); - - /* literal/length table */ - sym = 0; - while (sym < 144) { state.lens[sym++] = 8; } - while (sym < 256) { state.lens[sym++] = 9; } - while (sym < 280) { state.lens[sym++] = 7; } - while (sym < 288) { state.lens[sym++] = 8; } - - inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); - - /* distance table */ - sym = 0; - while (sym < 32) { state.lens[sym++] = 5; } - - inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); - - /* do this just once */ - virgin = false; - } - - state.lencode = lenfix; - state.lenbits = 9; - state.distcode = distfix; - state.distbits = 5; -} - - -/* - Update the window with the last wsize (normally 32K) bytes written before - returning. If window does not exist yet, create it. This is only called - when a window is already in use, or when output has been written during this - inflate call, but the end of the deflate stream has not been reached yet. - It is also called to create a window for dictionary data when a dictionary - is loaded. - - Providing output buffers larger than 32K to inflate() should provide a speed - advantage, since only the last 32K of output is copied to the sliding window - upon return from inflate(), and since all distances after the first 32K of - output will fall in the output data, making match copies simpler and faster. - The advantage may be dependent on the size of the processor's data caches. - */ -function updatewindow(strm, src, end, copy) { - var dist; - var state = strm.state; - - /* if it hasn't been done already, allocate space for the window */ - if (state.window === null) { - state.wsize = 1 << state.wbits; - state.wnext = 0; - state.whave = 0; - - state.window = new utils.Buf8(state.wsize); - } - - /* copy state->wsize or less output bytes into the circular window */ - if (copy >= state.wsize) { - utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0); - state.wnext = 0; - state.whave = state.wsize; - } - else { - dist = state.wsize - state.wnext; - if (dist > copy) { - dist = copy; - } - //zmemcpy(state->window + state->wnext, end - copy, dist); - utils.arraySet(state.window, src, end - copy, dist, state.wnext); - copy -= dist; - if (copy) { - //zmemcpy(state->window, end - copy, copy); - utils.arraySet(state.window, src, end - copy, copy, 0); - state.wnext = copy; - state.whave = state.wsize; - } - else { - state.wnext += dist; - if (state.wnext === state.wsize) { state.wnext = 0; } - if (state.whave < state.wsize) { state.whave += dist; } - } - } - return 0; -} - -function inflate(strm, flush) { - var state; - var input, output; // input/output buffers - var next; /* next input INDEX */ - var put; /* next output INDEX */ - var have, left; /* available input and output */ - var hold; /* bit buffer */ - var bits; /* bits in bit buffer */ - var _in, _out; /* save starting available input and output */ - var copy; /* number of stored or match bytes to copy */ - var from; /* where to copy match bytes from */ - var from_source; - var here = 0; /* current decoding table entry */ - var here_bits, here_op, here_val; // paked "here" denormalized (JS specific) - //var last; /* parent table entry */ - var last_bits, last_op, last_val; // paked "last" denormalized (JS specific) - var len; /* length to copy for repeats, bits to drop */ - var ret; /* return code */ - var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */ - var opts; - - var n; // temporary var for NEED_BITS - - var order = /* permutation of code lengths */ - [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]; - - - if (!strm || !strm.state || !strm.output || - (!strm.input && strm.avail_in !== 0)) { - return Z_STREAM_ERROR; - } - - state = strm.state; - if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */ - - - //--- LOAD() --- - put = strm.next_out; - output = strm.output; - left = strm.avail_out; - next = strm.next_in; - input = strm.input; - have = strm.avail_in; - hold = state.hold; - bits = state.bits; - //--- - - _in = have; - _out = left; - ret = Z_OK; - - inf_leave: // goto emulation - for (;;) { - switch (state.mode) { - case HEAD: - if (state.wrap === 0) { - state.mode = TYPEDO; - break; - } - //=== NEEDBITS(16); - while (bits < 16) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */ - state.check = 0/*crc32(0L, Z_NULL, 0)*/; - //=== CRC2(state.check, hold); - hbuf[0] = hold & 0xff; - hbuf[1] = (hold >>> 8) & 0xff; - state.check = crc32(state.check, hbuf, 2, 0); - //===// - - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = FLAGS; - break; - } - state.flags = 0; /* expect zlib header */ - if (state.head) { - state.head.done = false; - } - if (!(state.wrap & 1) || /* check if zlib header allowed */ - (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) { - strm.msg = 'incorrect header check'; - state.mode = BAD; - break; - } - if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) { - strm.msg = 'unknown compression method'; - state.mode = BAD; - break; - } - //--- DROPBITS(4) ---// - hold >>>= 4; - bits -= 4; - //---// - len = (hold & 0x0f)/*BITS(4)*/ + 8; - if (state.wbits === 0) { - state.wbits = len; - } - else if (len > state.wbits) { - strm.msg = 'invalid window size'; - state.mode = BAD; - break; - } - state.dmax = 1 << len; - //Tracev((stderr, "inflate: zlib header ok\n")); - strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; - state.mode = hold & 0x200 ? DICTID : TYPE; - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - break; - case FLAGS: - //=== NEEDBITS(16); */ - while (bits < 16) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - state.flags = hold; - if ((state.flags & 0xff) !== Z_DEFLATED) { - strm.msg = 'unknown compression method'; - state.mode = BAD; - break; - } - if (state.flags & 0xe000) { - strm.msg = 'unknown header flags set'; - state.mode = BAD; - break; - } - if (state.head) { - state.head.text = ((hold >> 8) & 1); - } - if (state.flags & 0x0200) { - //=== CRC2(state.check, hold); - hbuf[0] = hold & 0xff; - hbuf[1] = (hold >>> 8) & 0xff; - state.check = crc32(state.check, hbuf, 2, 0); - //===// - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = TIME; - /* falls through */ - case TIME: - //=== NEEDBITS(32); */ - while (bits < 32) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - if (state.head) { - state.head.time = hold; - } - if (state.flags & 0x0200) { - //=== CRC4(state.check, hold) - hbuf[0] = hold & 0xff; - hbuf[1] = (hold >>> 8) & 0xff; - hbuf[2] = (hold >>> 16) & 0xff; - hbuf[3] = (hold >>> 24) & 0xff; - state.check = crc32(state.check, hbuf, 4, 0); - //=== - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = OS; - /* falls through */ - case OS: - //=== NEEDBITS(16); */ - while (bits < 16) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - if (state.head) { - state.head.xflags = (hold & 0xff); - state.head.os = (hold >> 8); - } - if (state.flags & 0x0200) { - //=== CRC2(state.check, hold); - hbuf[0] = hold & 0xff; - hbuf[1] = (hold >>> 8) & 0xff; - state.check = crc32(state.check, hbuf, 2, 0); - //===// - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = EXLEN; - /* falls through */ - case EXLEN: - if (state.flags & 0x0400) { - //=== NEEDBITS(16); */ - while (bits < 16) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - state.length = hold; - if (state.head) { - state.head.extra_len = hold; - } - if (state.flags & 0x0200) { - //=== CRC2(state.check, hold); - hbuf[0] = hold & 0xff; - hbuf[1] = (hold >>> 8) & 0xff; - state.check = crc32(state.check, hbuf, 2, 0); - //===// - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - } - else if (state.head) { - state.head.extra = null/*Z_NULL*/; - } - state.mode = EXTRA; - /* falls through */ - case EXTRA: - if (state.flags & 0x0400) { - copy = state.length; - if (copy > have) { copy = have; } - if (copy) { - if (state.head) { - len = state.head.extra_len - state.length; - if (!state.head.extra) { - // Use untyped array for more convenient processing later - state.head.extra = new Array(state.head.extra_len); - } - utils.arraySet( - state.head.extra, - input, - next, - // extra field is limited to 65536 bytes - // - no need for additional size check - copy, - /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ - len - ); - //zmemcpy(state.head.extra + len, next, - // len + copy > state.head.extra_max ? - // state.head.extra_max - len : copy); - } - if (state.flags & 0x0200) { - state.check = crc32(state.check, input, copy, next); - } - have -= copy; - next += copy; - state.length -= copy; - } - if (state.length) { break inf_leave; } - } - state.length = 0; - state.mode = NAME; - /* falls through */ - case NAME: - if (state.flags & 0x0800) { - if (have === 0) { break inf_leave; } - copy = 0; - do { - // TODO: 2 or 1 bytes? - len = input[next + copy++]; - /* use constant limit because in js we should not preallocate memory */ - if (state.head && len && - (state.length < 65536 /*state.head.name_max*/)) { - state.head.name += String.fromCharCode(len); - } - } while (len && copy < have); - - if (state.flags & 0x0200) { - state.check = crc32(state.check, input, copy, next); - } - have -= copy; - next += copy; - if (len) { break inf_leave; } - } - else if (state.head) { - state.head.name = null; - } - state.length = 0; - state.mode = COMMENT; - /* falls through */ - case COMMENT: - if (state.flags & 0x1000) { - if (have === 0) { break inf_leave; } - copy = 0; - do { - len = input[next + copy++]; - /* use constant limit because in js we should not preallocate memory */ - if (state.head && len && - (state.length < 65536 /*state.head.comm_max*/)) { - state.head.comment += String.fromCharCode(len); - } - } while (len && copy < have); - if (state.flags & 0x0200) { - state.check = crc32(state.check, input, copy, next); - } - have -= copy; - next += copy; - if (len) { break inf_leave; } - } - else if (state.head) { - state.head.comment = null; - } - state.mode = HCRC; - /* falls through */ - case HCRC: - if (state.flags & 0x0200) { - //=== NEEDBITS(16); */ - while (bits < 16) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - if (hold !== (state.check & 0xffff)) { - strm.msg = 'header crc mismatch'; - state.mode = BAD; - break; - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - } - if (state.head) { - state.head.hcrc = ((state.flags >> 9) & 1); - state.head.done = true; - } - strm.adler = state.check = 0; - state.mode = TYPE; - break; - case DICTID: - //=== NEEDBITS(32); */ - while (bits < 32) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - strm.adler = state.check = zswap32(hold); - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = DICT; - /* falls through */ - case DICT: - if (state.havedict === 0) { - //--- RESTORE() --- - strm.next_out = put; - strm.avail_out = left; - strm.next_in = next; - strm.avail_in = have; - state.hold = hold; - state.bits = bits; - //--- - return Z_NEED_DICT; - } - strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; - state.mode = TYPE; - /* falls through */ - case TYPE: - if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; } - /* falls through */ - case TYPEDO: - if (state.last) { - //--- BYTEBITS() ---// - hold >>>= bits & 7; - bits -= bits & 7; - //---// - state.mode = CHECK; - break; - } - //=== NEEDBITS(3); */ - while (bits < 3) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - state.last = (hold & 0x01)/*BITS(1)*/; - //--- DROPBITS(1) ---// - hold >>>= 1; - bits -= 1; - //---// - - switch ((hold & 0x03)/*BITS(2)*/) { - case 0: /* stored block */ - //Tracev((stderr, "inflate: stored block%s\n", - // state.last ? " (last)" : "")); - state.mode = STORED; - break; - case 1: /* fixed block */ - fixedtables(state); - //Tracev((stderr, "inflate: fixed codes block%s\n", - // state.last ? " (last)" : "")); - state.mode = LEN_; /* decode codes */ - if (flush === Z_TREES) { - //--- DROPBITS(2) ---// - hold >>>= 2; - bits -= 2; - //---// - break inf_leave; - } - break; - case 2: /* dynamic block */ - //Tracev((stderr, "inflate: dynamic codes block%s\n", - // state.last ? " (last)" : "")); - state.mode = TABLE; - break; - case 3: - strm.msg = 'invalid block type'; - state.mode = BAD; - } - //--- DROPBITS(2) ---// - hold >>>= 2; - bits -= 2; - //---// - break; - case STORED: - //--- BYTEBITS() ---// /* go to byte boundary */ - hold >>>= bits & 7; - bits -= bits & 7; - //---// - //=== NEEDBITS(32); */ - while (bits < 32) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) { - strm.msg = 'invalid stored block lengths'; - state.mode = BAD; - break; - } - state.length = hold & 0xffff; - //Tracev((stderr, "inflate: stored length %u\n", - // state.length)); - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - state.mode = COPY_; - if (flush === Z_TREES) { break inf_leave; } - /* falls through */ - case COPY_: - state.mode = COPY; - /* falls through */ - case COPY: - copy = state.length; - if (copy) { - if (copy > have) { copy = have; } - if (copy > left) { copy = left; } - if (copy === 0) { break inf_leave; } - //--- zmemcpy(put, next, copy); --- - utils.arraySet(output, input, next, copy, put); - //---// - have -= copy; - next += copy; - left -= copy; - put += copy; - state.length -= copy; - break; - } - //Tracev((stderr, "inflate: stored end\n")); - state.mode = TYPE; - break; - case TABLE: - //=== NEEDBITS(14); */ - while (bits < 14) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257; - //--- DROPBITS(5) ---// - hold >>>= 5; - bits -= 5; - //---// - state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1; - //--- DROPBITS(5) ---// - hold >>>= 5; - bits -= 5; - //---// - state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4; - //--- DROPBITS(4) ---// - hold >>>= 4; - bits -= 4; - //---// -//#ifndef PKZIP_BUG_WORKAROUND - if (state.nlen > 286 || state.ndist > 30) { - strm.msg = 'too many length or distance symbols'; - state.mode = BAD; - break; - } -//#endif - //Tracev((stderr, "inflate: table sizes ok\n")); - state.have = 0; - state.mode = LENLENS; - /* falls through */ - case LENLENS: - while (state.have < state.ncode) { - //=== NEEDBITS(3); - while (bits < 3) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - state.lens[order[state.have++]] = (hold & 0x07);//BITS(3); - //--- DROPBITS(3) ---// - hold >>>= 3; - bits -= 3; - //---// - } - while (state.have < 19) { - state.lens[order[state.have++]] = 0; - } - // We have separate tables & no pointers. 2 commented lines below not needed. - //state.next = state.codes; - //state.lencode = state.next; - // Switch to use dynamic table - state.lencode = state.lendyn; - state.lenbits = 7; - - opts = { bits: state.lenbits }; - ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); - state.lenbits = opts.bits; - - if (ret) { - strm.msg = 'invalid code lengths set'; - state.mode = BAD; - break; - } - //Tracev((stderr, "inflate: code lengths ok\n")); - state.have = 0; - state.mode = CODELENS; - /* falls through */ - case CODELENS: - while (state.have < state.nlen + state.ndist) { - for (;;) { - here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/ - here_bits = here >>> 24; - here_op = (here >>> 16) & 0xff; - here_val = here & 0xffff; - - if ((here_bits) <= bits) { break; } - //--- PULLBYTE() ---// - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - //---// - } - if (here_val < 16) { - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - state.lens[state.have++] = here_val; - } - else { - if (here_val === 16) { - //=== NEEDBITS(here.bits + 2); - n = here_bits + 2; - while (bits < n) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - if (state.have === 0) { - strm.msg = 'invalid bit length repeat'; - state.mode = BAD; - break; - } - len = state.lens[state.have - 1]; - copy = 3 + (hold & 0x03);//BITS(2); - //--- DROPBITS(2) ---// - hold >>>= 2; - bits -= 2; - //---// - } - else if (here_val === 17) { - //=== NEEDBITS(here.bits + 3); - n = here_bits + 3; - while (bits < n) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - len = 0; - copy = 3 + (hold & 0x07);//BITS(3); - //--- DROPBITS(3) ---// - hold >>>= 3; - bits -= 3; - //---// - } - else { - //=== NEEDBITS(here.bits + 7); - n = here_bits + 7; - while (bits < n) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - len = 0; - copy = 11 + (hold & 0x7f);//BITS(7); - //--- DROPBITS(7) ---// - hold >>>= 7; - bits -= 7; - //---// - } - if (state.have + copy > state.nlen + state.ndist) { - strm.msg = 'invalid bit length repeat'; - state.mode = BAD; - break; - } - while (copy--) { - state.lens[state.have++] = len; - } - } - } - - /* handle error breaks in while */ - if (state.mode === BAD) { break; } - - /* check for end-of-block code (better have one) */ - if (state.lens[256] === 0) { - strm.msg = 'invalid code -- missing end-of-block'; - state.mode = BAD; - break; - } - - /* build code tables -- note: do not change the lenbits or distbits - values here (9 and 6) without reading the comments in inftrees.h - concerning the ENOUGH constants, which depend on those values */ - state.lenbits = 9; - - opts = { bits: state.lenbits }; - ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); - // We have separate tables & no pointers. 2 commented lines below not needed. - // state.next_index = opts.table_index; - state.lenbits = opts.bits; - // state.lencode = state.next; - - if (ret) { - strm.msg = 'invalid literal/lengths set'; - state.mode = BAD; - break; - } - - state.distbits = 6; - //state.distcode.copy(state.codes); - // Switch to use dynamic table - state.distcode = state.distdyn; - opts = { bits: state.distbits }; - ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); - // We have separate tables & no pointers. 2 commented lines below not needed. - // state.next_index = opts.table_index; - state.distbits = opts.bits; - // state.distcode = state.next; - - if (ret) { - strm.msg = 'invalid distances set'; - state.mode = BAD; - break; - } - //Tracev((stderr, 'inflate: codes ok\n')); - state.mode = LEN_; - if (flush === Z_TREES) { break inf_leave; } - /* falls through */ - case LEN_: - state.mode = LEN; - /* falls through */ - case LEN: - if (have >= 6 && left >= 258) { - //--- RESTORE() --- - strm.next_out = put; - strm.avail_out = left; - strm.next_in = next; - strm.avail_in = have; - state.hold = hold; - state.bits = bits; - //--- - inflate_fast(strm, _out); - //--- LOAD() --- - put = strm.next_out; - output = strm.output; - left = strm.avail_out; - next = strm.next_in; - input = strm.input; - have = strm.avail_in; - hold = state.hold; - bits = state.bits; - //--- - - if (state.mode === TYPE) { - state.back = -1; - } - break; - } - state.back = 0; - for (;;) { - here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/ - here_bits = here >>> 24; - here_op = (here >>> 16) & 0xff; - here_val = here & 0xffff; - - if (here_bits <= bits) { break; } - //--- PULLBYTE() ---// - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - //---// - } - if (here_op && (here_op & 0xf0) === 0) { - last_bits = here_bits; - last_op = here_op; - last_val = here_val; - for (;;) { - here = state.lencode[last_val + - ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)]; - here_bits = here >>> 24; - here_op = (here >>> 16) & 0xff; - here_val = here & 0xffff; - - if ((last_bits + here_bits) <= bits) { break; } - //--- PULLBYTE() ---// - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - //---// - } - //--- DROPBITS(last.bits) ---// - hold >>>= last_bits; - bits -= last_bits; - //---// - state.back += last_bits; - } - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - state.back += here_bits; - state.length = here_val; - if (here_op === 0) { - //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? - // "inflate: literal '%c'\n" : - // "inflate: literal 0x%02x\n", here.val)); - state.mode = LIT; - break; - } - if (here_op & 32) { - //Tracevv((stderr, "inflate: end of block\n")); - state.back = -1; - state.mode = TYPE; - break; - } - if (here_op & 64) { - strm.msg = 'invalid literal/length code'; - state.mode = BAD; - break; - } - state.extra = here_op & 15; - state.mode = LENEXT; - /* falls through */ - case LENEXT: - if (state.extra) { - //=== NEEDBITS(state.extra); - n = state.extra; - while (bits < n) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/; - //--- DROPBITS(state.extra) ---// - hold >>>= state.extra; - bits -= state.extra; - //---// - state.back += state.extra; - } - //Tracevv((stderr, "inflate: length %u\n", state.length)); - state.was = state.length; - state.mode = DIST; - /* falls through */ - case DIST: - for (;;) { - here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/ - here_bits = here >>> 24; - here_op = (here >>> 16) & 0xff; - here_val = here & 0xffff; - - if ((here_bits) <= bits) { break; } - //--- PULLBYTE() ---// - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - //---// - } - if ((here_op & 0xf0) === 0) { - last_bits = here_bits; - last_op = here_op; - last_val = here_val; - for (;;) { - here = state.distcode[last_val + - ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)]; - here_bits = here >>> 24; - here_op = (here >>> 16) & 0xff; - here_val = here & 0xffff; - - if ((last_bits + here_bits) <= bits) { break; } - //--- PULLBYTE() ---// - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - //---// - } - //--- DROPBITS(last.bits) ---// - hold >>>= last_bits; - bits -= last_bits; - //---// - state.back += last_bits; - } - //--- DROPBITS(here.bits) ---// - hold >>>= here_bits; - bits -= here_bits; - //---// - state.back += here_bits; - if (here_op & 64) { - strm.msg = 'invalid distance code'; - state.mode = BAD; - break; - } - state.offset = here_val; - state.extra = (here_op) & 15; - state.mode = DISTEXT; - /* falls through */ - case DISTEXT: - if (state.extra) { - //=== NEEDBITS(state.extra); - n = state.extra; - while (bits < n) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/; - //--- DROPBITS(state.extra) ---// - hold >>>= state.extra; - bits -= state.extra; - //---// - state.back += state.extra; - } -//#ifdef INFLATE_STRICT - if (state.offset > state.dmax) { - strm.msg = 'invalid distance too far back'; - state.mode = BAD; - break; - } -//#endif - //Tracevv((stderr, "inflate: distance %u\n", state.offset)); - state.mode = MATCH; - /* falls through */ - case MATCH: - if (left === 0) { break inf_leave; } - copy = _out - left; - if (state.offset > copy) { /* copy from window */ - copy = state.offset - copy; - if (copy > state.whave) { - if (state.sane) { - strm.msg = 'invalid distance too far back'; - state.mode = BAD; - break; - } -// (!) This block is disabled in zlib defaults, -// don't enable it for binary compatibility -//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR -// Trace((stderr, "inflate.c too far\n")); -// copy -= state.whave; -// if (copy > state.length) { copy = state.length; } -// if (copy > left) { copy = left; } -// left -= copy; -// state.length -= copy; -// do { -// output[put++] = 0; -// } while (--copy); -// if (state.length === 0) { state.mode = LEN; } -// break; -//#endif - } - if (copy > state.wnext) { - copy -= state.wnext; - from = state.wsize - copy; - } - else { - from = state.wnext - copy; - } - if (copy > state.length) { copy = state.length; } - from_source = state.window; - } - else { /* copy from output */ - from_source = output; - from = put - state.offset; - copy = state.length; - } - if (copy > left) { copy = left; } - left -= copy; - state.length -= copy; - do { - output[put++] = from_source[from++]; - } while (--copy); - if (state.length === 0) { state.mode = LEN; } - break; - case LIT: - if (left === 0) { break inf_leave; } - output[put++] = state.length; - left--; - state.mode = LEN; - break; - case CHECK: - if (state.wrap) { - //=== NEEDBITS(32); - while (bits < 32) { - if (have === 0) { break inf_leave; } - have--; - // Use '|' instead of '+' to make sure that result is signed - hold |= input[next++] << bits; - bits += 8; - } - //===// - _out -= left; - strm.total_out += _out; - state.total += _out; - if (_out) { - strm.adler = state.check = - /*UPDATE(state.check, put - _out, _out);*/ - (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out)); - - } - _out = left; - // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too - if ((state.flags ? hold : zswap32(hold)) !== state.check) { - strm.msg = 'incorrect data check'; - state.mode = BAD; - break; - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - //Tracev((stderr, "inflate: check matches trailer\n")); - } - state.mode = LENGTH; - /* falls through */ - case LENGTH: - if (state.wrap && state.flags) { - //=== NEEDBITS(32); - while (bits < 32) { - if (have === 0) { break inf_leave; } - have--; - hold += input[next++] << bits; - bits += 8; - } - //===// - if (hold !== (state.total & 0xffffffff)) { - strm.msg = 'incorrect length check'; - state.mode = BAD; - break; - } - //=== INITBITS(); - hold = 0; - bits = 0; - //===// - //Tracev((stderr, "inflate: length matches trailer\n")); - } - state.mode = DONE; - /* falls through */ - case DONE: - ret = Z_STREAM_END; - break inf_leave; - case BAD: - ret = Z_DATA_ERROR; - break inf_leave; - case MEM: - return Z_MEM_ERROR; - case SYNC: - /* falls through */ - default: - return Z_STREAM_ERROR; - } - } - - // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave" - - /* - Return from inflate(), updating the total counts and the check value. - If there was no progress during the inflate() call, return a buffer - error. Call updatewindow() to create and/or update the window state. - Note: a memory error from inflate() is non-recoverable. - */ - - //--- RESTORE() --- - strm.next_out = put; - strm.avail_out = left; - strm.next_in = next; - strm.avail_in = have; - state.hold = hold; - state.bits = bits; - //--- - - if (state.wsize || (_out !== strm.avail_out && state.mode < BAD && - (state.mode < CHECK || flush !== Z_FINISH))) { - if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) { - state.mode = MEM; - return Z_MEM_ERROR; - } - } - _in -= strm.avail_in; - _out -= strm.avail_out; - strm.total_in += _in; - strm.total_out += _out; - state.total += _out; - if (state.wrap && _out) { - strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ - (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out)); - } - strm.data_type = state.bits + (state.last ? 64 : 0) + - (state.mode === TYPE ? 128 : 0) + - (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); - if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) { - ret = Z_BUF_ERROR; - } - return ret; -} - -function inflateEnd(strm) { - - if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) { - return Z_STREAM_ERROR; - } - - var state = strm.state; - if (state.window) { - state.window = null; - } - strm.state = null; - return Z_OK; -} - -function inflateGetHeader(strm, head) { - var state; - - /* check state */ - if (!strm || !strm.state) { return Z_STREAM_ERROR; } - state = strm.state; - if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; } - - /* save header structure */ - state.head = head; - head.done = false; - return Z_OK; -} - -function inflateSetDictionary(strm, dictionary) { - var dictLength = dictionary.length; - - var state; - var dictid; - var ret; - - /* check state */ - if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; } - state = strm.state; - - if (state.wrap !== 0 && state.mode !== DICT) { - return Z_STREAM_ERROR; - } - - /* check for correct dictionary identifier */ - if (state.mode === DICT) { - dictid = 1; /* adler32(0, null, 0)*/ - /* dictid = adler32(dictid, dictionary, dictLength); */ - dictid = adler32(dictid, dictionary, dictLength, 0); - if (dictid !== state.check) { - return Z_DATA_ERROR; - } - } - /* copy dictionary to window using updatewindow(), which will amend the - existing dictionary if appropriate */ - ret = updatewindow(strm, dictionary, dictLength, dictLength); - if (ret) { - state.mode = MEM; - return Z_MEM_ERROR; - } - state.havedict = 1; - // Tracev((stderr, "inflate: dictionary set\n")); - return Z_OK; -} - -exports.inflateReset = inflateReset; -exports.inflateReset2 = inflateReset2; -exports.inflateResetKeep = inflateResetKeep; -exports.inflateInit = inflateInit; -exports.inflateInit2 = inflateInit2; -exports.inflate = inflate; -exports.inflateEnd = inflateEnd; -exports.inflateGetHeader = inflateGetHeader; -exports.inflateSetDictionary = inflateSetDictionary; -exports.inflateInfo = 'pako inflate (from Nodeca project)'; - -/* Not implemented -exports.inflateCopy = inflateCopy; -exports.inflateGetDictionary = inflateGetDictionary; -exports.inflateMark = inflateMark; -exports.inflatePrime = inflatePrime; -exports.inflateSync = inflateSync; -exports.inflateSyncPoint = inflateSyncPoint; -exports.inflateUndermine = inflateUndermine; -*/ diff --git a/node_modules/pako/lib/zlib/inftrees.js b/node_modules/pako/lib/zlib/inftrees.js deleted file mode 100644 index ec4e4e909..000000000 --- a/node_modules/pako/lib/zlib/inftrees.js +++ /dev/null @@ -1,343 +0,0 @@ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -var utils = require('../utils/common'); - -var MAXBITS = 15; -var ENOUGH_LENS = 852; -var ENOUGH_DISTS = 592; -//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); - -var CODES = 0; -var LENS = 1; -var DISTS = 2; - -var lbase = [ /* Length codes 257..285 base */ - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, - 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 -]; - -var lext = [ /* Length codes 257..285 extra */ - 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78 -]; - -var dbase = [ /* Distance codes 0..29 base */ - 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, - 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, - 8193, 12289, 16385, 24577, 0, 0 -]; - -var dext = [ /* Distance codes 0..29 extra */ - 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, - 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, - 28, 28, 29, 29, 64, 64 -]; - -module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) -{ - var bits = opts.bits; - //here = opts.here; /* table entry for duplication */ - - var len = 0; /* a code's length in bits */ - var sym = 0; /* index of code symbols */ - var min = 0, max = 0; /* minimum and maximum code lengths */ - var root = 0; /* number of index bits for root table */ - var curr = 0; /* number of index bits for current table */ - var drop = 0; /* code bits to drop for sub-table */ - var left = 0; /* number of prefix codes available */ - var used = 0; /* code entries in table used */ - var huff = 0; /* Huffman code */ - var incr; /* for incrementing code, index */ - var fill; /* index for replicating entries */ - var low; /* low bits for current root entry */ - var mask; /* mask for low root bits */ - var next; /* next available space in table */ - var base = null; /* base value table to use */ - var base_index = 0; -// var shoextra; /* extra bits table to use */ - var end; /* use base and extra for symbol > end */ - var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */ - var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */ - var extra = null; - var extra_index = 0; - - var here_bits, here_op, here_val; - - /* - Process a set of code lengths to create a canonical Huffman code. The - code lengths are lens[0..codes-1]. Each length corresponds to the - symbols 0..codes-1. The Huffman code is generated by first sorting the - symbols by length from short to long, and retaining the symbol order - for codes with equal lengths. Then the code starts with all zero bits - for the first code of the shortest length, and the codes are integer - increments for the same length, and zeros are appended as the length - increases. For the deflate format, these bits are stored backwards - from their more natural integer increment ordering, and so when the - decoding tables are built in the large loop below, the integer codes - are incremented backwards. - - This routine assumes, but does not check, that all of the entries in - lens[] are in the range 0..MAXBITS. The caller must assure this. - 1..MAXBITS is interpreted as that code length. zero means that that - symbol does not occur in this code. - - The codes are sorted by computing a count of codes for each length, - creating from that a table of starting indices for each length in the - sorted table, and then entering the symbols in order in the sorted - table. The sorted table is work[], with that space being provided by - the caller. - - The length counts are used for other purposes as well, i.e. finding - the minimum and maximum length codes, determining if there are any - codes at all, checking for a valid set of lengths, and looking ahead - at length counts to determine sub-table sizes when building the - decoding tables. - */ - - /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ - for (len = 0; len <= MAXBITS; len++) { - count[len] = 0; - } - for (sym = 0; sym < codes; sym++) { - count[lens[lens_index + sym]]++; - } - - /* bound code lengths, force root to be within code lengths */ - root = bits; - for (max = MAXBITS; max >= 1; max--) { - if (count[max] !== 0) { break; } - } - if (root > max) { - root = max; - } - if (max === 0) { /* no symbols to code at all */ - //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */ - //table.bits[opts.table_index] = 1; //here.bits = (var char)1; - //table.val[opts.table_index++] = 0; //here.val = (var short)0; - table[table_index++] = (1 << 24) | (64 << 16) | 0; - - - //table.op[opts.table_index] = 64; - //table.bits[opts.table_index] = 1; - //table.val[opts.table_index++] = 0; - table[table_index++] = (1 << 24) | (64 << 16) | 0; - - opts.bits = 1; - return 0; /* no symbols, but wait for decoding to report error */ - } - for (min = 1; min < max; min++) { - if (count[min] !== 0) { break; } - } - if (root < min) { - root = min; - } - - /* check for an over-subscribed or incomplete set of lengths */ - left = 1; - for (len = 1; len <= MAXBITS; len++) { - left <<= 1; - left -= count[len]; - if (left < 0) { - return -1; - } /* over-subscribed */ - } - if (left > 0 && (type === CODES || max !== 1)) { - return -1; /* incomplete set */ - } - - /* generate offsets into symbol table for each length for sorting */ - offs[1] = 0; - for (len = 1; len < MAXBITS; len++) { - offs[len + 1] = offs[len] + count[len]; - } - - /* sort symbols by length, by symbol order within each length */ - for (sym = 0; sym < codes; sym++) { - if (lens[lens_index + sym] !== 0) { - work[offs[lens[lens_index + sym]]++] = sym; - } - } - - /* - Create and fill in decoding tables. In this loop, the table being - filled is at next and has curr index bits. The code being used is huff - with length len. That code is converted to an index by dropping drop - bits off of the bottom. For codes where len is less than drop + curr, - those top drop + curr - len bits are incremented through all values to - fill the table with replicated entries. - - root is the number of index bits for the root table. When len exceeds - root, sub-tables are created pointed to by the root entry with an index - of the low root bits of huff. This is saved in low to check for when a - new sub-table should be started. drop is zero when the root table is - being filled, and drop is root when sub-tables are being filled. - - When a new sub-table is needed, it is necessary to look ahead in the - code lengths to determine what size sub-table is needed. The length - counts are used for this, and so count[] is decremented as codes are - entered in the tables. - - used keeps track of how many table entries have been allocated from the - provided *table space. It is checked for LENS and DIST tables against - the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in - the initial root table size constants. See the comments in inftrees.h - for more information. - - sym increments through all symbols, and the loop terminates when - all codes of length max, i.e. all codes, have been processed. This - routine permits incomplete codes, so another loop after this one fills - in the rest of the decoding tables with invalid code markers. - */ - - /* set up for code type */ - // poor man optimization - use if-else instead of switch, - // to avoid deopts in old v8 - if (type === CODES) { - base = extra = work; /* dummy value--not used */ - end = 19; - - } else if (type === LENS) { - base = lbase; - base_index -= 257; - extra = lext; - extra_index -= 257; - end = 256; - - } else { /* DISTS */ - base = dbase; - extra = dext; - end = -1; - } - - /* initialize opts for loop */ - huff = 0; /* starting code */ - sym = 0; /* starting code symbol */ - len = min; /* starting code length */ - next = table_index; /* current table to fill in */ - curr = root; /* current table index bits */ - drop = 0; /* current bits to drop from code for index */ - low = -1; /* trigger new sub-table when len > root */ - used = 1 << root; /* use root table entries */ - mask = used - 1; /* mask for comparing low */ - - /* check available table space */ - if ((type === LENS && used > ENOUGH_LENS) || - (type === DISTS && used > ENOUGH_DISTS)) { - return 1; - } - - /* process all codes and make table entries */ - for (;;) { - /* create table entry */ - here_bits = len - drop; - if (work[sym] < end) { - here_op = 0; - here_val = work[sym]; - } - else if (work[sym] > end) { - here_op = extra[extra_index + work[sym]]; - here_val = base[base_index + work[sym]]; - } - else { - here_op = 32 + 64; /* end of block */ - here_val = 0; - } - - /* replicate for those indices with low len bits equal to huff */ - incr = 1 << (len - drop); - fill = 1 << curr; - min = fill; /* save offset to next table */ - do { - fill -= incr; - table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0; - } while (fill !== 0); - - /* backwards increment the len-bit code huff */ - incr = 1 << (len - 1); - while (huff & incr) { - incr >>= 1; - } - if (incr !== 0) { - huff &= incr - 1; - huff += incr; - } else { - huff = 0; - } - - /* go to next symbol, update count, len */ - sym++; - if (--count[len] === 0) { - if (len === max) { break; } - len = lens[lens_index + work[sym]]; - } - - /* create new sub-table if needed */ - if (len > root && (huff & mask) !== low) { - /* if first time, transition to sub-tables */ - if (drop === 0) { - drop = root; - } - - /* increment past last table */ - next += min; /* here min is 1 << curr */ - - /* determine length of next table */ - curr = len - drop; - left = 1 << curr; - while (curr + drop < max) { - left -= count[curr + drop]; - if (left <= 0) { break; } - curr++; - left <<= 1; - } - - /* check for enough space */ - used += 1 << curr; - if ((type === LENS && used > ENOUGH_LENS) || - (type === DISTS && used > ENOUGH_DISTS)) { - return 1; - } - - /* point entry in root table to sub-table */ - low = huff & mask; - /*table.op[low] = curr; - table.bits[low] = root; - table.val[low] = next - opts.table_index;*/ - table[low] = (root << 24) | (curr << 16) | (next - table_index) |0; - } - } - - /* fill in remaining table entry if code is incomplete (guaranteed to have - at most one remaining entry, since if the code is incomplete, the - maximum code length that was allowed to get this far is one bit) */ - if (huff !== 0) { - //table.op[next + huff] = 64; /* invalid code marker */ - //table.bits[next + huff] = len - drop; - //table.val[next + huff] = 0; - table[next + huff] = ((len - drop) << 24) | (64 << 16) |0; - } - - /* set return parameters */ - //opts.table_index += used; - opts.bits = root; - return 0; -}; diff --git a/node_modules/pako/lib/zlib/messages.js b/node_modules/pako/lib/zlib/messages.js deleted file mode 100644 index 426daec6b..000000000 --- a/node_modules/pako/lib/zlib/messages.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -module.exports = { - 2: 'need dictionary', /* Z_NEED_DICT 2 */ - 1: 'stream end', /* Z_STREAM_END 1 */ - 0: '', /* Z_OK 0 */ - '-1': 'file error', /* Z_ERRNO (-1) */ - '-2': 'stream error', /* Z_STREAM_ERROR (-2) */ - '-3': 'data error', /* Z_DATA_ERROR (-3) */ - '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */ - '-5': 'buffer error', /* Z_BUF_ERROR (-5) */ - '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */ -}; diff --git a/node_modules/pako/lib/zlib/trees.js b/node_modules/pako/lib/zlib/trees.js deleted file mode 100644 index 2a81992e5..000000000 --- a/node_modules/pako/lib/zlib/trees.js +++ /dev/null @@ -1,1220 +0,0 @@ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -var utils = require('../utils/common'); - -/* Public constants ==========================================================*/ -/* ===========================================================================*/ - - -//var Z_FILTERED = 1; -//var Z_HUFFMAN_ONLY = 2; -//var Z_RLE = 3; -var Z_FIXED = 4; -//var Z_DEFAULT_STRATEGY = 0; - -/* Possible values of the data_type field (though see inflate()) */ -var Z_BINARY = 0; -var Z_TEXT = 1; -//var Z_ASCII = 1; // = Z_TEXT -var Z_UNKNOWN = 2; - -/*============================================================================*/ - - -function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } - -// From zutil.h - -var STORED_BLOCK = 0; -var STATIC_TREES = 1; -var DYN_TREES = 2; -/* The three kinds of block type */ - -var MIN_MATCH = 3; -var MAX_MATCH = 258; -/* The minimum and maximum match lengths */ - -// From deflate.h -/* =========================================================================== - * Internal compression state. - */ - -var LENGTH_CODES = 29; -/* number of length codes, not counting the special END_BLOCK code */ - -var LITERALS = 256; -/* number of literal bytes 0..255 */ - -var L_CODES = LITERALS + 1 + LENGTH_CODES; -/* number of Literal or Length codes, including the END_BLOCK code */ - -var D_CODES = 30; -/* number of distance codes */ - -var BL_CODES = 19; -/* number of codes used to transfer the bit lengths */ - -var HEAP_SIZE = 2 * L_CODES + 1; -/* maximum heap size */ - -var MAX_BITS = 15; -/* All codes must not exceed MAX_BITS bits */ - -var Buf_size = 16; -/* size of bit buffer in bi_buf */ - - -/* =========================================================================== - * Constants - */ - -var MAX_BL_BITS = 7; -/* Bit length codes must not exceed MAX_BL_BITS bits */ - -var END_BLOCK = 256; -/* end of block literal code */ - -var REP_3_6 = 16; -/* repeat previous bit length 3-6 times (2 bits of repeat count) */ - -var REPZ_3_10 = 17; -/* repeat a zero length 3-10 times (3 bits of repeat count) */ - -var REPZ_11_138 = 18; -/* repeat a zero length 11-138 times (7 bits of repeat count) */ - -/* eslint-disable comma-spacing,array-bracket-spacing */ -var extra_lbits = /* extra bits for each length code */ - [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]; - -var extra_dbits = /* extra bits for each distance code */ - [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]; - -var extra_blbits = /* extra bits for each bit length code */ - [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]; - -var bl_order = - [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]; -/* eslint-enable comma-spacing,array-bracket-spacing */ - -/* The lengths of the bit length codes are sent in order of decreasing - * probability, to avoid transmitting the lengths for unused bit length codes. - */ - -/* =========================================================================== - * Local data. These are initialized only once. - */ - -// We pre-fill arrays with 0 to avoid uninitialized gaps - -var DIST_CODE_LEN = 512; /* see definition of array dist_code below */ - -// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1 -var static_ltree = new Array((L_CODES + 2) * 2); -zero(static_ltree); -/* The static literal tree. Since the bit lengths are imposed, there is no - * need for the L_CODES extra codes used during heap construction. However - * The codes 286 and 287 are needed to build a canonical tree (see _tr_init - * below). - */ - -var static_dtree = new Array(D_CODES * 2); -zero(static_dtree); -/* The static distance tree. (Actually a trivial tree since all codes use - * 5 bits.) - */ - -var _dist_code = new Array(DIST_CODE_LEN); -zero(_dist_code); -/* Distance codes. The first 256 values correspond to the distances - * 3 .. 258, the last 256 values correspond to the top 8 bits of - * the 15 bit distances. - */ - -var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); -zero(_length_code); -/* length code for each normalized match length (0 == MIN_MATCH) */ - -var base_length = new Array(LENGTH_CODES); -zero(base_length); -/* First normalized length for each code (0 = MIN_MATCH) */ - -var base_dist = new Array(D_CODES); -zero(base_dist); -/* First normalized distance for each code (0 = distance of 1) */ - - -function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) { - - this.static_tree = static_tree; /* static tree or NULL */ - this.extra_bits = extra_bits; /* extra bits for each code or NULL */ - this.extra_base = extra_base; /* base index for extra_bits */ - this.elems = elems; /* max number of elements in the tree */ - this.max_length = max_length; /* max bit length for the codes */ - - // show if `static_tree` has data or dummy - needed for monomorphic objects - this.has_stree = static_tree && static_tree.length; -} - - -var static_l_desc; -var static_d_desc; -var static_bl_desc; - - -function TreeDesc(dyn_tree, stat_desc) { - this.dyn_tree = dyn_tree; /* the dynamic tree */ - this.max_code = 0; /* largest code with non zero frequency */ - this.stat_desc = stat_desc; /* the corresponding static tree */ -} - - - -function d_code(dist) { - return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)]; -} - - -/* =========================================================================== - * Output a short LSB first on the stream. - * IN assertion: there is enough room in pendingBuf. - */ -function put_short(s, w) { -// put_byte(s, (uch)((w) & 0xff)); -// put_byte(s, (uch)((ush)(w) >> 8)); - s.pending_buf[s.pending++] = (w) & 0xff; - s.pending_buf[s.pending++] = (w >>> 8) & 0xff; -} - - -/* =========================================================================== - * Send a value on a given number of bits. - * IN assertion: length <= 16 and value fits in length bits. - */ -function send_bits(s, value, length) { - if (s.bi_valid > (Buf_size - length)) { - s.bi_buf |= (value << s.bi_valid) & 0xffff; - put_short(s, s.bi_buf); - s.bi_buf = value >> (Buf_size - s.bi_valid); - s.bi_valid += length - Buf_size; - } else { - s.bi_buf |= (value << s.bi_valid) & 0xffff; - s.bi_valid += length; - } -} - - -function send_code(s, c, tree) { - send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/); -} - - -/* =========================================================================== - * Reverse the first len bits of a code, using straightforward code (a faster - * method would use a table) - * IN assertion: 1 <= len <= 15 - */ -function bi_reverse(code, len) { - var res = 0; - do { - res |= code & 1; - code >>>= 1; - res <<= 1; - } while (--len > 0); - return res >>> 1; -} - - -/* =========================================================================== - * Flush the bit buffer, keeping at most 7 bits in it. - */ -function bi_flush(s) { - if (s.bi_valid === 16) { - put_short(s, s.bi_buf); - s.bi_buf = 0; - s.bi_valid = 0; - - } else if (s.bi_valid >= 8) { - s.pending_buf[s.pending++] = s.bi_buf & 0xff; - s.bi_buf >>= 8; - s.bi_valid -= 8; - } -} - - -/* =========================================================================== - * Compute the optimal bit lengths for a tree and update the total bit length - * for the current block. - * IN assertion: the fields freq and dad are set, heap[heap_max] and - * above are the tree nodes sorted by increasing frequency. - * OUT assertions: the field len is set to the optimal bit length, the - * array bl_count contains the frequencies for each bit length. - * The length opt_len is updated; static_len is also updated if stree is - * not null. - */ -function gen_bitlen(s, desc) -// deflate_state *s; -// tree_desc *desc; /* the tree descriptor */ -{ - var tree = desc.dyn_tree; - var max_code = desc.max_code; - var stree = desc.stat_desc.static_tree; - var has_stree = desc.stat_desc.has_stree; - var extra = desc.stat_desc.extra_bits; - var base = desc.stat_desc.extra_base; - var max_length = desc.stat_desc.max_length; - var h; /* heap index */ - var n, m; /* iterate over the tree elements */ - var bits; /* bit length */ - var xbits; /* extra bits */ - var f; /* frequency */ - var overflow = 0; /* number of elements with bit length too large */ - - for (bits = 0; bits <= MAX_BITS; bits++) { - s.bl_count[bits] = 0; - } - - /* In a first pass, compute the optimal bit lengths (which may - * overflow in the case of the bit length tree). - */ - tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */ - - for (h = s.heap_max + 1; h < HEAP_SIZE; h++) { - n = s.heap[h]; - bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1; - if (bits > max_length) { - bits = max_length; - overflow++; - } - tree[n * 2 + 1]/*.Len*/ = bits; - /* We overwrite tree[n].Dad which is no longer needed */ - - if (n > max_code) { continue; } /* not a leaf node */ - - s.bl_count[bits]++; - xbits = 0; - if (n >= base) { - xbits = extra[n - base]; - } - f = tree[n * 2]/*.Freq*/; - s.opt_len += f * (bits + xbits); - if (has_stree) { - s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits); - } - } - if (overflow === 0) { return; } - - // Trace((stderr,"\nbit length overflow\n")); - /* This happens for example on obj2 and pic of the Calgary corpus */ - - /* Find the first bit length which could increase: */ - do { - bits = max_length - 1; - while (s.bl_count[bits] === 0) { bits--; } - s.bl_count[bits]--; /* move one leaf down the tree */ - s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */ - s.bl_count[max_length]--; - /* The brother of the overflow item also moves one step up, - * but this does not affect bl_count[max_length] - */ - overflow -= 2; - } while (overflow > 0); - - /* Now recompute all bit lengths, scanning in increasing frequency. - * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all - * lengths instead of fixing only the wrong ones. This idea is taken - * from 'ar' written by Haruhiko Okumura.) - */ - for (bits = max_length; bits !== 0; bits--) { - n = s.bl_count[bits]; - while (n !== 0) { - m = s.heap[--h]; - if (m > max_code) { continue; } - if (tree[m * 2 + 1]/*.Len*/ !== bits) { - // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); - s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/; - tree[m * 2 + 1]/*.Len*/ = bits; - } - n--; - } - } -} - - -/* =========================================================================== - * Generate the codes for a given tree and bit counts (which need not be - * optimal). - * IN assertion: the array bl_count contains the bit length statistics for - * the given tree and the field len is set for all tree elements. - * OUT assertion: the field code is set for all tree elements of non - * zero code length. - */ -function gen_codes(tree, max_code, bl_count) -// ct_data *tree; /* the tree to decorate */ -// int max_code; /* largest code with non zero frequency */ -// ushf *bl_count; /* number of codes at each bit length */ -{ - var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */ - var code = 0; /* running code value */ - var bits; /* bit index */ - var n; /* code index */ - - /* The distribution counts are first used to generate the code values - * without bit reversal. - */ - for (bits = 1; bits <= MAX_BITS; bits++) { - next_code[bits] = code = (code + bl_count[bits - 1]) << 1; - } - /* Check that the bit counts in bl_count are consistent. The last code - * must be all ones. - */ - //Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */ - length = 0; - for (code = 0; code < LENGTH_CODES - 1; code++) { - base_length[code] = length; - for (n = 0; n < (1 << extra_lbits[code]); n++) { - _length_code[length++] = code; - } - } - //Assert (length == 256, "tr_static_init: length != 256"); - /* Note that the length 255 (match length 258) can be represented - * in two different ways: code 284 + 5 bits or code 285, so we - * overwrite length_code[255] to use the best encoding: - */ - _length_code[length - 1] = code; - - /* Initialize the mapping dist (0..32K) -> dist code (0..29) */ - dist = 0; - for (code = 0; code < 16; code++) { - base_dist[code] = dist; - for (n = 0; n < (1 << extra_dbits[code]); n++) { - _dist_code[dist++] = code; - } - } - //Assert (dist == 256, "tr_static_init: dist != 256"); - dist >>= 7; /* from now on, all distances are divided by 128 */ - for (; code < D_CODES; code++) { - base_dist[code] = dist << 7; - for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) { - _dist_code[256 + dist++] = code; - } - } - //Assert (dist == 256, "tr_static_init: 256+dist != 512"); - - /* Construct the codes of the static literal tree */ - for (bits = 0; bits <= MAX_BITS; bits++) { - bl_count[bits] = 0; - } - - n = 0; - while (n <= 143) { - static_ltree[n * 2 + 1]/*.Len*/ = 8; - n++; - bl_count[8]++; - } - while (n <= 255) { - static_ltree[n * 2 + 1]/*.Len*/ = 9; - n++; - bl_count[9]++; - } - while (n <= 279) { - static_ltree[n * 2 + 1]/*.Len*/ = 7; - n++; - bl_count[7]++; - } - while (n <= 287) { - static_ltree[n * 2 + 1]/*.Len*/ = 8; - n++; - bl_count[8]++; - } - /* Codes 286 and 287 do not exist, but we must include them in the - * tree construction to get a canonical Huffman tree (longest code - * all ones) - */ - gen_codes(static_ltree, L_CODES + 1, bl_count); - - /* The static distance tree is trivial: */ - for (n = 0; n < D_CODES; n++) { - static_dtree[n * 2 + 1]/*.Len*/ = 5; - static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5); - } - - // Now data ready and we can init static trees - static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); - static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); - static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); - - //static_init_done = true; -} - - -/* =========================================================================== - * Initialize a new block. - */ -function init_block(s) { - var n; /* iterates over tree elements */ - - /* Initialize the trees. */ - for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; } - for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; } - for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; } - - s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1; - s.opt_len = s.static_len = 0; - s.last_lit = s.matches = 0; -} - - -/* =========================================================================== - * Flush the bit buffer and align the output on a byte boundary - */ -function bi_windup(s) -{ - if (s.bi_valid > 8) { - put_short(s, s.bi_buf); - } else if (s.bi_valid > 0) { - //put_byte(s, (Byte)s->bi_buf); - s.pending_buf[s.pending++] = s.bi_buf; - } - s.bi_buf = 0; - s.bi_valid = 0; -} - -/* =========================================================================== - * Copy a stored block, storing first the length and its - * one's complement if requested. - */ -function copy_block(s, buf, len, header) -//DeflateState *s; -//charf *buf; /* the input data */ -//unsigned len; /* its length */ -//int header; /* true if block header must be written */ -{ - bi_windup(s); /* align on byte boundary */ - - if (header) { - put_short(s, len); - put_short(s, ~len); - } -// while (len--) { -// put_byte(s, *buf++); -// } - utils.arraySet(s.pending_buf, s.window, buf, len, s.pending); - s.pending += len; -} - -/* =========================================================================== - * Compares to subtrees, using the tree depth as tie breaker when - * the subtrees have equal frequency. This minimizes the worst case length. - */ -function smaller(tree, n, m, depth) { - var _n2 = n * 2; - var _m2 = m * 2; - return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ || - (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m])); -} - -/* =========================================================================== - * Restore the heap property by moving down the tree starting at node k, - * exchanging a node with the smallest of its two sons if necessary, stopping - * when the heap property is re-established (each father smaller than its - * two sons). - */ -function pqdownheap(s, tree, k) -// deflate_state *s; -// ct_data *tree; /* the tree to restore */ -// int k; /* node to move down */ -{ - var v = s.heap[k]; - var j = k << 1; /* left son of k */ - while (j <= s.heap_len) { - /* Set j to the smallest of the two sons: */ - if (j < s.heap_len && - smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) { - j++; - } - /* Exit if v is smaller than both sons */ - if (smaller(tree, v, s.heap[j], s.depth)) { break; } - - /* Exchange v with the smallest son */ - s.heap[k] = s.heap[j]; - k = j; - - /* And continue down the tree, setting j to the left son of k */ - j <<= 1; - } - s.heap[k] = v; -} - - -// inlined manually -// var SMALLEST = 1; - -/* =========================================================================== - * Send the block data compressed using the given Huffman trees - */ -function compress_block(s, ltree, dtree) -// deflate_state *s; -// const ct_data *ltree; /* literal tree */ -// const ct_data *dtree; /* distance tree */ -{ - var dist; /* distance of matched string */ - var lc; /* match length or unmatched char (if dist == 0) */ - var lx = 0; /* running index in l_buf */ - var code; /* the code to send */ - var extra; /* number of extra bits to send */ - - if (s.last_lit !== 0) { - do { - dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]); - lc = s.pending_buf[s.l_buf + lx]; - lx++; - - if (dist === 0) { - send_code(s, lc, ltree); /* send a literal byte */ - //Tracecv(isgraph(lc), (stderr," '%c' ", lc)); - } else { - /* Here, lc is the match length - MIN_MATCH */ - code = _length_code[lc]; - send_code(s, code + LITERALS + 1, ltree); /* send the length code */ - extra = extra_lbits[code]; - if (extra !== 0) { - lc -= base_length[code]; - send_bits(s, lc, extra); /* send the extra length bits */ - } - dist--; /* dist is now the match distance - 1 */ - code = d_code(dist); - //Assert (code < D_CODES, "bad d_code"); - - send_code(s, code, dtree); /* send the distance code */ - extra = extra_dbits[code]; - if (extra !== 0) { - dist -= base_dist[code]; - send_bits(s, dist, extra); /* send the extra distance bits */ - } - } /* literal or match pair ? */ - - /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ - //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx, - // "pendingBuf overflow"); - - } while (lx < s.last_lit); - } - - send_code(s, END_BLOCK, ltree); -} - - -/* =========================================================================== - * Construct one Huffman tree and assigns the code bit strings and lengths. - * Update the total bit length for the current block. - * IN assertion: the field freq is set for all tree elements. - * OUT assertions: the fields len and code are set to the optimal bit length - * and corresponding code. The length opt_len is updated; static_len is - * also updated if stree is not null. The field max_code is set. - */ -function build_tree(s, desc) -// deflate_state *s; -// tree_desc *desc; /* the tree descriptor */ -{ - var tree = desc.dyn_tree; - var stree = desc.stat_desc.static_tree; - var has_stree = desc.stat_desc.has_stree; - var elems = desc.stat_desc.elems; - var n, m; /* iterate over heap elements */ - var max_code = -1; /* largest code with non zero frequency */ - var node; /* new node being created */ - - /* Construct the initial heap, with least frequent element in - * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. - * heap[0] is not used. - */ - s.heap_len = 0; - s.heap_max = HEAP_SIZE; - - for (n = 0; n < elems; n++) { - if (tree[n * 2]/*.Freq*/ !== 0) { - s.heap[++s.heap_len] = max_code = n; - s.depth[n] = 0; - - } else { - tree[n * 2 + 1]/*.Len*/ = 0; - } - } - - /* The pkzip format requires that at least one distance code exists, - * and that at least one bit should be sent even if there is only one - * possible code. So to avoid special checks later on we force at least - * two codes of non zero frequency. - */ - while (s.heap_len < 2) { - node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0); - tree[node * 2]/*.Freq*/ = 1; - s.depth[node] = 0; - s.opt_len--; - - if (has_stree) { - s.static_len -= stree[node * 2 + 1]/*.Len*/; - } - /* node is 0 or 1 so it does not have extra bits */ - } - desc.max_code = max_code; - - /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, - * establish sub-heaps of increasing lengths: - */ - for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); } - - /* Construct the Huffman tree by repeatedly combining the least two - * frequent nodes. - */ - node = elems; /* next internal node of the tree */ - do { - //pqremove(s, tree, n); /* n = node of least frequency */ - /*** pqremove ***/ - n = s.heap[1/*SMALLEST*/]; - s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--]; - pqdownheap(s, tree, 1/*SMALLEST*/); - /***/ - - m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */ - - s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */ - s.heap[--s.heap_max] = m; - - /* Create a new node father of n and m */ - tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/; - s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1; - tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node; - - /* and insert the new node in the heap */ - s.heap[1/*SMALLEST*/] = node++; - pqdownheap(s, tree, 1/*SMALLEST*/); - - } while (s.heap_len >= 2); - - s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/]; - - /* At this point, the fields freq and dad are set. We can now - * generate the bit lengths. - */ - gen_bitlen(s, desc); - - /* The field len is now set, we can generate the bit codes */ - gen_codes(tree, max_code, s.bl_count); -} - - -/* =========================================================================== - * Scan a literal or distance tree to determine the frequencies of the codes - * in the bit length tree. - */ -function scan_tree(s, tree, max_code) -// deflate_state *s; -// ct_data *tree; /* the tree to be scanned */ -// int max_code; /* and its largest code of non zero frequency */ -{ - var n; /* iterates over all tree elements */ - var prevlen = -1; /* last emitted length */ - var curlen; /* length of current code */ - - var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */ - - var count = 0; /* repeat count of the current code */ - var max_count = 7; /* max repeat count */ - var min_count = 4; /* min repeat count */ - - if (nextlen === 0) { - max_count = 138; - min_count = 3; - } - tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */ - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; - nextlen = tree[(n + 1) * 2 + 1]/*.Len*/; - - if (++count < max_count && curlen === nextlen) { - continue; - - } else if (count < min_count) { - s.bl_tree[curlen * 2]/*.Freq*/ += count; - - } else if (curlen !== 0) { - - if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; } - s.bl_tree[REP_3_6 * 2]/*.Freq*/++; - - } else if (count <= 10) { - s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++; - - } else { - s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++; - } - - count = 0; - prevlen = curlen; - - if (nextlen === 0) { - max_count = 138; - min_count = 3; - - } else if (curlen === nextlen) { - max_count = 6; - min_count = 3; - - } else { - max_count = 7; - min_count = 4; - } - } -} - - -/* =========================================================================== - * Send a literal or distance tree in compressed form, using the codes in - * bl_tree. - */ -function send_tree(s, tree, max_code) -// deflate_state *s; -// ct_data *tree; /* the tree to be scanned */ -// int max_code; /* and its largest code of non zero frequency */ -{ - var n; /* iterates over all tree elements */ - var prevlen = -1; /* last emitted length */ - var curlen; /* length of current code */ - - var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */ - - var count = 0; /* repeat count of the current code */ - var max_count = 7; /* max repeat count */ - var min_count = 4; /* min repeat count */ - - /* tree[max_code+1].Len = -1; */ /* guard already set */ - if (nextlen === 0) { - max_count = 138; - min_count = 3; - } - - for (n = 0; n <= max_code; n++) { - curlen = nextlen; - nextlen = tree[(n + 1) * 2 + 1]/*.Len*/; - - if (++count < max_count && curlen === nextlen) { - continue; - - } else if (count < min_count) { - do { send_code(s, curlen, s.bl_tree); } while (--count !== 0); - - } else if (curlen !== 0) { - if (curlen !== prevlen) { - send_code(s, curlen, s.bl_tree); - count--; - } - //Assert(count >= 3 && count <= 6, " 3_6?"); - send_code(s, REP_3_6, s.bl_tree); - send_bits(s, count - 3, 2); - - } else if (count <= 10) { - send_code(s, REPZ_3_10, s.bl_tree); - send_bits(s, count - 3, 3); - - } else { - send_code(s, REPZ_11_138, s.bl_tree); - send_bits(s, count - 11, 7); - } - - count = 0; - prevlen = curlen; - if (nextlen === 0) { - max_count = 138; - min_count = 3; - - } else if (curlen === nextlen) { - max_count = 6; - min_count = 3; - - } else { - max_count = 7; - min_count = 4; - } - } -} - - -/* =========================================================================== - * Construct the Huffman tree for the bit lengths and return the index in - * bl_order of the last bit length code to send. - */ -function build_bl_tree(s) { - var max_blindex; /* index of last bit length code of non zero freq */ - - /* Determine the bit length frequencies for literal and distance trees */ - scan_tree(s, s.dyn_ltree, s.l_desc.max_code); - scan_tree(s, s.dyn_dtree, s.d_desc.max_code); - - /* Build the bit length tree: */ - build_tree(s, s.bl_desc); - /* opt_len now includes the length of the tree representations, except - * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. - */ - - /* Determine the number of bit length codes to send. The pkzip format - * requires that at least 4 bit length codes be sent. (appnote.txt says - * 3 but the actual value used is 4.) - */ - for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { - if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) { - break; - } - } - /* Update opt_len to include the bit length tree and counts */ - s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; - //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", - // s->opt_len, s->static_len)); - - return max_blindex; -} - - -/* =========================================================================== - * Send the header for a block using dynamic Huffman trees: the counts, the - * lengths of the bit length codes, the literal tree and the distance tree. - * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. - */ -function send_all_trees(s, lcodes, dcodes, blcodes) -// deflate_state *s; -// int lcodes, dcodes, blcodes; /* number of codes for each tree */ -{ - var rank; /* index in bl_order */ - - //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); - //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, - // "too many codes"); - //Tracev((stderr, "\nbl counts: ")); - send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */ - send_bits(s, dcodes - 1, 5); - send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */ - for (rank = 0; rank < blcodes; rank++) { - //Tracev((stderr, "\nbl code %2d ", bl_order[rank])); - send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3); - } - //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); - - send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */ - //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); - - send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */ - //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); -} - - -/* =========================================================================== - * Check if the data type is TEXT or BINARY, using the following algorithm: - * - TEXT if the two conditions below are satisfied: - * a) There are no non-portable control characters belonging to the - * "black list" (0..6, 14..25, 28..31). - * b) There is at least one printable character belonging to the - * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). - * - BINARY otherwise. - * - The following partially-portable control characters form a - * "gray list" that is ignored in this detection algorithm: - * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). - * IN assertion: the fields Freq of dyn_ltree are set. - */ -function detect_data_type(s) { - /* black_mask is the bit mask of black-listed bytes - * set bits 0..6, 14..25, and 28..31 - * 0xf3ffc07f = binary 11110011111111111100000001111111 - */ - var black_mask = 0xf3ffc07f; - var n; - - /* Check for non-textual ("black-listed") bytes. */ - for (n = 0; n <= 31; n++, black_mask >>>= 1) { - if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) { - return Z_BINARY; - } - } - - /* Check for textual ("white-listed") bytes. */ - if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 || - s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) { - return Z_TEXT; - } - for (n = 32; n < LITERALS; n++) { - if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) { - return Z_TEXT; - } - } - - /* There are no "black-listed" or "white-listed" bytes: - * this stream either is empty or has tolerated ("gray-listed") bytes only. - */ - return Z_BINARY; -} - - -var static_init_done = false; - -/* =========================================================================== - * Initialize the tree data structures for a new zlib stream. - */ -function _tr_init(s) -{ - - if (!static_init_done) { - tr_static_init(); - static_init_done = true; - } - - s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc); - s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc); - s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc); - - s.bi_buf = 0; - s.bi_valid = 0; - - /* Initialize the first block of the first file: */ - init_block(s); -} - - -/* =========================================================================== - * Send a stored block - */ -function _tr_stored_block(s, buf, stored_len, last) -//DeflateState *s; -//charf *buf; /* input block */ -//ulg stored_len; /* length of input block */ -//int last; /* one if this is the last block for a file */ -{ - send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */ - copy_block(s, buf, stored_len, true); /* with header */ -} - - -/* =========================================================================== - * Send one empty static block to give enough lookahead for inflate. - * This takes 10 bits, of which 7 may remain in the bit buffer. - */ -function _tr_align(s) { - send_bits(s, STATIC_TREES << 1, 3); - send_code(s, END_BLOCK, static_ltree); - bi_flush(s); -} - - -/* =========================================================================== - * Determine the best encoding for the current block: dynamic trees, static - * trees or store, and output the encoded block to the zip file. - */ -function _tr_flush_block(s, buf, stored_len, last) -//DeflateState *s; -//charf *buf; /* input block, or NULL if too old */ -//ulg stored_len; /* length of input block */ -//int last; /* one if this is the last block for a file */ -{ - var opt_lenb, static_lenb; /* opt_len and static_len in bytes */ - var max_blindex = 0; /* index of last bit length code of non zero freq */ - - /* Build the Huffman trees unless a stored block is forced */ - if (s.level > 0) { - - /* Check if the file is binary or text */ - if (s.strm.data_type === Z_UNKNOWN) { - s.strm.data_type = detect_data_type(s); - } - - /* Construct the literal and distance trees */ - build_tree(s, s.l_desc); - // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len, - // s->static_len)); - - build_tree(s, s.d_desc); - // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len, - // s->static_len)); - /* At this point, opt_len and static_len are the total bit lengths of - * the compressed block data, excluding the tree representations. - */ - - /* Build the bit length tree for the above two trees, and get the index - * in bl_order of the last bit length code to send. - */ - max_blindex = build_bl_tree(s); - - /* Determine the best encoding. Compute the block lengths in bytes. */ - opt_lenb = (s.opt_len + 3 + 7) >>> 3; - static_lenb = (s.static_len + 3 + 7) >>> 3; - - // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", - // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, - // s->last_lit)); - - if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; } - - } else { - // Assert(buf != (char*)0, "lost buf"); - opt_lenb = static_lenb = stored_len + 5; /* force a stored block */ - } - - if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) { - /* 4: two words for the lengths */ - - /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. - * Otherwise we can't have processed more than WSIZE input bytes since - * the last block flush, because compression would have been - * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to - * transform a block into a stored block. - */ - _tr_stored_block(s, buf, stored_len, last); - - } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { - - send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3); - compress_block(s, static_ltree, static_dtree); - - } else { - send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3); - send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1); - compress_block(s, s.dyn_ltree, s.dyn_dtree); - } - // Assert (s->compressed_len == s->bits_sent, "bad compressed size"); - /* The above check is made mod 2^32, for files larger than 512 MB - * and uLong implemented on 32 bits. - */ - init_block(s); - - if (last) { - bi_windup(s); - } - // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, - // s->compressed_len-7*last)); -} - -/* =========================================================================== - * Save the match info and tally the frequency counts. Return true if - * the current block must be flushed. - */ -function _tr_tally(s, dist, lc) -// deflate_state *s; -// unsigned dist; /* distance of matched string */ -// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ -{ - //var out_length, in_length, dcode; - - s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff; - s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff; - - s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff; - s.last_lit++; - - if (dist === 0) { - /* lc is the unmatched char */ - s.dyn_ltree[lc * 2]/*.Freq*/++; - } else { - s.matches++; - /* Here, lc is the match length - MIN_MATCH */ - dist--; /* dist = match distance - 1 */ - //Assert((ush)dist < (ush)MAX_DIST(s) && - // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && - // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); - - s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++; - s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++; - } - -// (!) This block is disabled in zlib defaults, -// don't enable it for binary compatibility - -//#ifdef TRUNCATE_BLOCK -// /* Try to guess if it is profitable to stop the current block here */ -// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) { -// /* Compute an upper bound for the compressed length */ -// out_length = s.last_lit*8; -// in_length = s.strstart - s.block_start; -// -// for (dcode = 0; dcode < D_CODES; dcode++) { -// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]); -// } -// out_length >>>= 3; -// //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", -// // s->last_lit, in_length, out_length, -// // 100L - out_length*100L/in_length)); -// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) { -// return true; -// } -// } -//#endif - - return (s.last_lit === s.lit_bufsize - 1); - /* We avoid equality with lit_bufsize because of wraparound at 64K - * on 16 bit machines and because stored blocks are restricted to - * 64K-1 bytes. - */ -} - -exports._tr_init = _tr_init; -exports._tr_stored_block = _tr_stored_block; -exports._tr_flush_block = _tr_flush_block; -exports._tr_tally = _tr_tally; -exports._tr_align = _tr_align; diff --git a/node_modules/pako/lib/zlib/zstream.js b/node_modules/pako/lib/zlib/zstream.js deleted file mode 100644 index 122acfef0..000000000 --- a/node_modules/pako/lib/zlib/zstream.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -// (C) 1995-2013 Jean-loup Gailly and Mark Adler -// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. - -function ZStream() { - /* next input byte */ - this.input = null; // JS specific, because we have no pointers - this.next_in = 0; - /* number of bytes available at input */ - this.avail_in = 0; - /* total number of input bytes read so far */ - this.total_in = 0; - /* next output byte should be put there */ - this.output = null; // JS specific, because we have no pointers - this.next_out = 0; - /* remaining free space at output */ - this.avail_out = 0; - /* total number of bytes output so far */ - this.total_out = 0; - /* last error message, NULL if no error */ - this.msg = ''/*Z_NULL*/; - /* not visible by applications */ - this.state = null; - /* best guess about the data type: binary or text */ - this.data_type = 2/*Z_UNKNOWN*/; - /* adler32 value of the uncompressed data */ - this.adler = 0; -} - -module.exports = ZStream; diff --git a/node_modules/pako/package.json b/node_modules/pako/package.json deleted file mode 100644 index caa1f580b..000000000 --- a/node_modules/pako/package.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "_from": "pako@~1.0.5", - "_id": "pako@1.0.6", - "_inBundle": false, - "_integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", - "_location": "/pako", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "pako@~1.0.5", - "name": "pako", - "escapedName": "pako", - "rawSpec": "~1.0.5", - "saveSpec": null, - "fetchSpec": "~1.0.5" - }, - "_requiredBy": [ - "/browserify-zlib" - ], - "_resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", - "_shasum": "0101211baa70c4bca4a0f63f2206e97b7dfaf258", - "_spec": "pako@~1.0.5", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify-zlib", - "bugs": { - "url": "https://github.com/nodeca/pako/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Andrei Tuputcyn", - "url": "https://github.com/andr83" - }, - { - "name": "Vitaly Puzrin", - "url": "https://github.com/puzrin" - }, - { - "name": "Friedel Ziegelmayer", - "url": "https://github.com/dignifiedquire" - }, - { - "name": "Kirill Efimov", - "url": "https://github.com/Kirill89" - }, - { - "name": "Jean-loup Gailly" - }, - { - "name": "Mark Adler" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "zlib port to javascript - fast, modularized, with browser support", - "devDependencies": { - "ansi": "^0.3.1", - "benchmark": "^2.1.4", - "bluebird": "^3.5.0", - "browserify": "^14.4.0", - "eslint": "^3.12.2", - "grunt": "^1.0.1", - "grunt-cli": "^1.2.0", - "grunt-contrib-connect": "^1.0.2", - "grunt-saucelabs": "^9.0.0", - "istanbul": "^0.4.5", - "mocha": "^3.2.0", - "multiparty": "^4.1.3", - "ndoc": "^5.0.1", - "uglify-js": "^3.0.25", - "zlibjs": "^0.3.1" - }, - "files": [ - "index.js", - "dist/", - "lib/" - ], - "homepage": "https://github.com/nodeca/pako", - "keywords": [ - "zlib", - "deflate", - "inflate", - "gzip" - ], - "license": "(MIT AND Zlib)", - "name": "pako", - "repository": { - "type": "git", - "url": "git+https://github.com/nodeca/pako.git" - }, - "scripts": { - "test": "make test" - }, - "version": "1.0.6" -} diff --git a/node_modules/parents/.travis.yml b/node_modules/parents/.travis.yml deleted file mode 100644 index 895dbd362..000000000 --- a/node_modules/parents/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 diff --git a/node_modules/parents/LICENSE b/node_modules/parents/LICENSE deleted file mode 100644 index ee27ba4b4..000000000 --- a/node_modules/parents/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/parents/example/dirname.js b/node_modules/parents/example/dirname.js deleted file mode 100644 index c9d381b20..000000000 --- a/node_modules/parents/example/dirname.js +++ /dev/null @@ -1,3 +0,0 @@ -var parents = require('../'); -var dirs = parents(__dirname); -console.dir(dirs); diff --git a/node_modules/parents/example/win32.js b/node_modules/parents/example/win32.js deleted file mode 100644 index 11b85d6e5..000000000 --- a/node_modules/parents/example/win32.js +++ /dev/null @@ -1,5 +0,0 @@ -var parents = require('../'); -var dir = 'C:\\Program Files\\Maxis\\Sim City 2000\\cities'; - -var dirs = parents(dir, { platform : 'win32' }); -console.dir(dirs); diff --git a/node_modules/parents/index.js b/node_modules/parents/index.js deleted file mode 100644 index 84a963979..000000000 --- a/node_modules/parents/index.js +++ /dev/null @@ -1,48 +0,0 @@ -var pathPlatform = require('path-platform'); - -module.exports = function (cwd, opts) { - if (cwd === undefined) cwd = process.cwd(); - if (!opts) opts = {}; - var platform = opts.platform || process.platform; - - var isWindows = /^win/.test(platform); - var path = isWindows ? pathPlatform.win32 : pathPlatform; - var normalize = !isWindows ? path.normalize : - path.normalize('c:') === 'c:.' ? fixNormalize(path.normalize) : - path.normalize; - var sep = isWindows ? /[\\\/]/ : '/'; - var init = isWindows ? '' : '/'; - - var join = function (x, y) { - var ps = [ x, y ].filter(function (p) { - return p && typeof p === 'string' - }); - - return normalize(ps.join(isWindows ? '\\' : '/')); - }; - - var res = normalize(cwd) - .split(sep) - .reduce(function (acc,dir,ix) { - return acc.concat(join(acc[ix], dir)) - }, [init]) - .slice(1) - .reverse() - ; - if (res[0] === res[1]) return [ res[0] ]; - if (isWindows && /^\\/.test(cwd)) { - return res.slice(0,-1).map(function (d) { - var ch = d.charAt(0) - return ch === '\\' ? d : - ch === '.' ? '\\' + d.slice(1) : - '\\' + d - }); - } - return res; - - function fixNormalize(fn) { - return function(p) { - return fn(p).replace(/:\.$/, ':') - } - } -} diff --git a/node_modules/parents/package.json b/node_modules/parents/package.json deleted file mode 100644 index 1abd5f095..000000000 --- a/node_modules/parents/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_from": "parents@^1.0.1", - "_id": "parents@1.0.1", - "_inBundle": false, - "_integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", - "_location": "/parents", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "parents@^1.0.1", - "name": "parents", - "escapedName": "parents", - "rawSpec": "^1.0.1", - "saveSpec": null, - "fetchSpec": "^1.0.1" - }, - "_requiredBy": [ - "/browserify", - "/module-deps" - ], - "_resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", - "_shasum": "fedd4d2bf193a77745fe71e371d73c3307d9c751", - "_spec": "parents@^1.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bin": {}, - "bugs": { - "url": "https://github.com/substack/node-parents/issues" - }, - "bundleDependencies": false, - "dependencies": { - "path-platform": "~0.11.15" - }, - "deprecated": false, - "description": "return all the parent directories for a directory", - "devDependencies": { - "tap": "~0.2.5" - }, - "directories": { - "example": "example", - "test": "test" - }, - "engine": { - "node": ">=0.6" - }, - "homepage": "https://github.com/substack/node-parents", - "keywords": [ - "directory", - "parent", - "path", - "tree" - ], - "license": "MIT", - "main": "index.js", - "name": "parents", - "repository": { - "type": "git", - "url": "git://github.com/substack/node-parents.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "1.0.1" -} diff --git a/node_modules/parents/readme.markdown b/node_modules/parents/readme.markdown deleted file mode 100644 index fe3bc1f0f..000000000 --- a/node_modules/parents/readme.markdown +++ /dev/null @@ -1,75 +0,0 @@ -# parents - -Return all the parent directories of a directory, inclusive of that directory. - -[![build status](https://secure.travis-ci.org/substack/node-parents.png)](http://travis-ci.org/substack/node-parents) - -# example - -## dirname - -``` js -var parents = require('parents'); -var dirs = parents(__dirname); -console.dir(dirs); -``` - -*** - -``` -[ '/home/substack/projects/node-parents/example', - '/home/substack/projects/node-parents', - '/home/substack/projects', - '/home/substack', - '/home', - '/' ] -``` - -## win32 - -``` js -var parents = require('parents'); -var dir = 'C:\\Program Files\\Maxis\\Sim City 2000\\cities'; - -var dirs = parents(dir, { platform : 'win32' }); -console.dir(dirs); -``` - -*** - -``` -[ 'C:\\Program Files\\Maxis\\Sim City 2000\\cities', - 'C:\\Program Files\\Maxis\\Sim City 2000', - 'C:\\Program Files\\Maxis', - 'C:\\Program Files', - 'C:' ] -``` - -# methods - -``` js -var parents = require('parents') -``` - -## parents(dir, opts) - -Return an array of the parent directories of `dir`, including and starting with -`dir`. If a `dir` isn't specified, `process.cwd()` will be used. - -Optionally specify an `opts.platform` to control whether the separator and paths -works the unixy way with `'/'` or the windowsy way where sometimes things use -`'/'` and sometimes they use `'\\'` and also there are leading drive letters and -other exotic features. If `opts.platform` isn't specified, `process.platform` -will be used. Anything that matches `/^win/` will use the windowsy behavior. - -# install - -With [npm](http://npmjs.org) do: - -``` -npm install parents -``` - -# licence - -MIT diff --git a/node_modules/parents/test/dirname.js b/node_modules/parents/test/dirname.js deleted file mode 100644 index 317d131ce..000000000 --- a/node_modules/parents/test/dirname.js +++ /dev/null @@ -1,20 +0,0 @@ -var test = require('tap').test; -var parents = require('../'); - -test('dirname', function (t) { - var dirs = parents('/foo/bar/baz/quux'); - t.same(dirs, [ - '/foo/bar/baz/quux', - '/foo/bar/baz', - '/foo/bar', - '/foo', - '/', - ]); - t.end(); -}); - -test('root', function (t) { - var dirs = parents('/'); - t.same(dirs, [ '/' ]); - t.end(); -}); diff --git a/node_modules/parents/test/win32.js b/node_modules/parents/test/win32.js deleted file mode 100644 index c6f2ece80..000000000 --- a/node_modules/parents/test/win32.js +++ /dev/null @@ -1,34 +0,0 @@ -var test = require('tap').test; -var parents = require('../'); - -test('win32', function (t) { - var dir = 'c:\\Program Files\\Maxis\\Sim City 2000\\cities'; - var dirs = parents(dir, { platform : 'win32' }); - t.same(dirs, [ - 'c:\\Program Files\\Maxis\\Sim City 2000\\cities', - 'c:\\Program Files\\Maxis\\Sim City 2000', - 'c:\\Program Files\\Maxis', - 'c:\\Program Files', - 'c:', - ]); - t.end(); -}); - -test('win32 c:', function (t) { - var dirs = parents('c:\\', { platform : 'win32' }); - t.same(dirs, [ 'c:' ]); - t.end(); -}); - -test('win32 network drive', function (t) { - var dirs = parents( - '\\storageserver01\\Active Projects\\ProjectA', - { platform : 'win32' } - ); - t.same(dirs, [ - '\\storageserver01\\Active Projects\\ProjectA', - '\\storageserver01\\Active Projects', - '\\storageserver01' - ]); - t.end(); -}); diff --git a/node_modules/parse-asn1/.travis.yml b/node_modules/parse-asn1/.travis.yml deleted file mode 100644 index ea321ccc5..000000000 --- a/node_modules/parse-asn1/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -sudo: false -language: node_js -node_js: - - "0.12" - - "iojs" -env: - - TEST_SUITE=standard - - TEST_SUITE=unit -script: "npm run-script $TEST_SUITE" diff --git a/node_modules/parse-asn1/LICENSE b/node_modules/parse-asn1/LICENSE deleted file mode 100644 index e0efcf251..000000000 --- a/node_modules/parse-asn1/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2017, crypto-browserify contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/parse-asn1/README.md b/node_modules/parse-asn1/README.md deleted file mode 100644 index 9cd4c153e..000000000 --- a/node_modules/parse-asn1/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# parse-asn1 - -[![TRAVIS](https://secure.travis-ci.org/crypto-browserify/parse-asn1.png)](http://travis-ci.org/crypto-browserify/parse-asn1) -[![NPM](http://img.shields.io/npm/v/parse-asn1.svg)](https://www.npmjs.org/package/parse-asn1) - -[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) - -utility library for parsing asn1 files for use with browserify-sign. diff --git a/node_modules/parse-asn1/aesid.json b/node_modules/parse-asn1/aesid.json deleted file mode 100644 index 24f653b40..000000000 --- a/node_modules/parse-asn1/aesid.json +++ /dev/null @@ -1,13 +0,0 @@ -{"2.16.840.1.101.3.4.1.1": "aes-128-ecb", -"2.16.840.1.101.3.4.1.2": "aes-128-cbc", -"2.16.840.1.101.3.4.1.3": "aes-128-ofb", -"2.16.840.1.101.3.4.1.4": "aes-128-cfb", -"2.16.840.1.101.3.4.1.21": "aes-192-ecb", -"2.16.840.1.101.3.4.1.22": "aes-192-cbc", -"2.16.840.1.101.3.4.1.23": "aes-192-ofb", -"2.16.840.1.101.3.4.1.24": "aes-192-cfb", -"2.16.840.1.101.3.4.1.41": "aes-256-ecb", -"2.16.840.1.101.3.4.1.42": "aes-256-cbc", -"2.16.840.1.101.3.4.1.43": "aes-256-ofb", -"2.16.840.1.101.3.4.1.44": "aes-256-cfb" -} \ No newline at end of file diff --git a/node_modules/parse-asn1/asn1.js b/node_modules/parse-asn1/asn1.js deleted file mode 100644 index 6cac822cf..000000000 --- a/node_modules/parse-asn1/asn1.js +++ /dev/null @@ -1,122 +0,0 @@ -// from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js -// Fedor, you are amazing. -'use strict' - -var asn1 = require('asn1.js') - -exports.certificate = require('./certificate') - -var RSAPrivateKey = asn1.define('RSAPrivateKey', function () { - this.seq().obj( - this.key('version').int(), - this.key('modulus').int(), - this.key('publicExponent').int(), - this.key('privateExponent').int(), - this.key('prime1').int(), - this.key('prime2').int(), - this.key('exponent1').int(), - this.key('exponent2').int(), - this.key('coefficient').int() - ) -}) -exports.RSAPrivateKey = RSAPrivateKey - -var RSAPublicKey = asn1.define('RSAPublicKey', function () { - this.seq().obj( - this.key('modulus').int(), - this.key('publicExponent').int() - ) -}) -exports.RSAPublicKey = RSAPublicKey - -var PublicKey = asn1.define('SubjectPublicKeyInfo', function () { - this.seq().obj( - this.key('algorithm').use(AlgorithmIdentifier), - this.key('subjectPublicKey').bitstr() - ) -}) -exports.PublicKey = PublicKey - -var AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', function () { - this.seq().obj( - this.key('algorithm').objid(), - this.key('none').null_().optional(), - this.key('curve').objid().optional(), - this.key('params').seq().obj( - this.key('p').int(), - this.key('q').int(), - this.key('g').int() - ).optional() - ) -}) - -var PrivateKeyInfo = asn1.define('PrivateKeyInfo', function () { - this.seq().obj( - this.key('version').int(), - this.key('algorithm').use(AlgorithmIdentifier), - this.key('subjectPrivateKey').octstr() - ) -}) -exports.PrivateKey = PrivateKeyInfo -var EncryptedPrivateKeyInfo = asn1.define('EncryptedPrivateKeyInfo', function () { - this.seq().obj( - this.key('algorithm').seq().obj( - this.key('id').objid(), - this.key('decrypt').seq().obj( - this.key('kde').seq().obj( - this.key('id').objid(), - this.key('kdeparams').seq().obj( - this.key('salt').octstr(), - this.key('iters').int() - ) - ), - this.key('cipher').seq().obj( - this.key('algo').objid(), - this.key('iv').octstr() - ) - ) - ), - this.key('subjectPrivateKey').octstr() - ) -}) - -exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo - -var DSAPrivateKey = asn1.define('DSAPrivateKey', function () { - this.seq().obj( - this.key('version').int(), - this.key('p').int(), - this.key('q').int(), - this.key('g').int(), - this.key('pub_key').int(), - this.key('priv_key').int() - ) -}) -exports.DSAPrivateKey = DSAPrivateKey - -exports.DSAparam = asn1.define('DSAparam', function () { - this.int() -}) - -var ECPrivateKey = asn1.define('ECPrivateKey', function () { - this.seq().obj( - this.key('version').int(), - this.key('privateKey').octstr(), - this.key('parameters').optional().explicit(0).use(ECParameters), - this.key('publicKey').optional().explicit(1).bitstr() - ) -}) -exports.ECPrivateKey = ECPrivateKey - -var ECParameters = asn1.define('ECParameters', function () { - this.choice({ - namedCurve: this.objid() - }) -}) - -exports.signature = asn1.define('signature', function () { - this.seq().obj( - this.key('r').int(), - this.key('s').int() - ) -}) diff --git a/node_modules/parse-asn1/certificate.js b/node_modules/parse-asn1/certificate.js deleted file mode 100644 index 1acfe559e..000000000 --- a/node_modules/parse-asn1/certificate.js +++ /dev/null @@ -1,88 +0,0 @@ -// from https://github.com/Rantanen/node-dtls/blob/25a7dc861bda38cfeac93a723500eea4f0ac2e86/Certificate.js -// thanks to @Rantanen - -'use strict' - -var asn = require('asn1.js') - -var Time = asn.define('Time', function () { - this.choice({ - utcTime: this.utctime(), - generalTime: this.gentime() - }) -}) - -var AttributeTypeValue = asn.define('AttributeTypeValue', function () { - this.seq().obj( - this.key('type').objid(), - this.key('value').any() - ) -}) - -var AlgorithmIdentifier = asn.define('AlgorithmIdentifier', function () { - this.seq().obj( - this.key('algorithm').objid(), - this.key('parameters').optional() - ) -}) - -var SubjectPublicKeyInfo = asn.define('SubjectPublicKeyInfo', function () { - this.seq().obj( - this.key('algorithm').use(AlgorithmIdentifier), - this.key('subjectPublicKey').bitstr() - ) -}) - -var RelativeDistinguishedName = asn.define('RelativeDistinguishedName', function () { - this.setof(AttributeTypeValue) -}) - -var RDNSequence = asn.define('RDNSequence', function () { - this.seqof(RelativeDistinguishedName) -}) - -var Name = asn.define('Name', function () { - this.choice({ - rdnSequence: this.use(RDNSequence) - }) -}) - -var Validity = asn.define('Validity', function () { - this.seq().obj( - this.key('notBefore').use(Time), - this.key('notAfter').use(Time) - ) -}) - -var Extension = asn.define('Extension', function () { - this.seq().obj( - this.key('extnID').objid(), - this.key('critical').bool().def(false), - this.key('extnValue').octstr() - ) -}) - -var TBSCertificate = asn.define('TBSCertificate', function () { - this.seq().obj( - this.key('version').explicit(0).int(), - this.key('serialNumber').int(), - this.key('signature').use(AlgorithmIdentifier), - this.key('issuer').use(Name), - this.key('validity').use(Validity), - this.key('subject').use(Name), - this.key('subjectPublicKeyInfo').use(SubjectPublicKeyInfo), - this.key('issuerUniqueID').implicit(1).bitstr().optional(), - this.key('subjectUniqueID').implicit(2).bitstr().optional(), - this.key('extensions').explicit(3).seqof(Extension).optional() - ) -}) - -var X509Certificate = asn.define('X509Certificate', function () { - this.seq().obj( - this.key('tbsCertificate').use(TBSCertificate), - this.key('signatureAlgorithm').use(AlgorithmIdentifier), - this.key('signatureValue').bitstr() - ) -}) - -module.exports = X509Certificate diff --git a/node_modules/parse-asn1/fixProc.js b/node_modules/parse-asn1/fixProc.js deleted file mode 100644 index b50042ab0..000000000 --- a/node_modules/parse-asn1/fixProc.js +++ /dev/null @@ -1,30 +0,0 @@ -// adapted from https://github.com/apatil/pemstrip -var findProc = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m -var startRegex = /^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----/m -var fullRegex = /^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m -var evp = require('evp_bytestokey') -var ciphers = require('browserify-aes') -module.exports = function (okey, password) { - var key = okey.toString() - var match = key.match(findProc) - var decrypted - if (!match) { - var match2 = key.match(fullRegex) - decrypted = new Buffer(match2[2].replace(/[\r\n]/g, ''), 'base64') - } else { - var suite = 'aes' + match[1] - var iv = new Buffer(match[2], 'hex') - var cipherText = new Buffer(match[3].replace(/[\r\n]/g, ''), 'base64') - var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key - var out = [] - var cipher = ciphers.createDecipheriv(suite, cipherKey, iv) - out.push(cipher.update(cipherText)) - out.push(cipher.final()) - decrypted = Buffer.concat(out) - } - var tag = key.match(startRegex)[1] - return { - tag: tag, - data: decrypted - } -} diff --git a/node_modules/parse-asn1/index.js b/node_modules/parse-asn1/index.js deleted file mode 100644 index 14932dfc0..000000000 --- a/node_modules/parse-asn1/index.js +++ /dev/null @@ -1,106 +0,0 @@ -var asn1 = require('./asn1') -var aesid = require('./aesid.json') -var fixProc = require('./fixProc') -var ciphers = require('browserify-aes') -var compat = require('pbkdf2') -module.exports = parseKeys - -function parseKeys (buffer) { - var password - if (typeof buffer === 'object' && !Buffer.isBuffer(buffer)) { - password = buffer.passphrase - buffer = buffer.key - } - if (typeof buffer === 'string') { - buffer = new Buffer(buffer) - } - - var stripped = fixProc(buffer, password) - - var type = stripped.tag - var data = stripped.data - var subtype, ndata - switch (type) { - case 'CERTIFICATE': - ndata = asn1.certificate.decode(data, 'der').tbsCertificate.subjectPublicKeyInfo - // falls through - case 'PUBLIC KEY': - if (!ndata) { - ndata = asn1.PublicKey.decode(data, 'der') - } - subtype = ndata.algorithm.algorithm.join('.') - switch (subtype) { - case '1.2.840.113549.1.1.1': - return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, 'der') - case '1.2.840.10045.2.1': - ndata.subjectPrivateKey = ndata.subjectPublicKey - return { - type: 'ec', - data: ndata - } - case '1.2.840.10040.4.1': - ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, 'der') - return { - type: 'dsa', - data: ndata.algorithm.params - } - default: throw new Error('unknown key id ' + subtype) - } - throw new Error('unknown key type ' + type) - case 'ENCRYPTED PRIVATE KEY': - data = asn1.EncryptedPrivateKey.decode(data, 'der') - data = decrypt(data, password) - // falls through - case 'PRIVATE KEY': - ndata = asn1.PrivateKey.decode(data, 'der') - subtype = ndata.algorithm.algorithm.join('.') - switch (subtype) { - case '1.2.840.113549.1.1.1': - return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, 'der') - case '1.2.840.10045.2.1': - return { - curve: ndata.algorithm.curve, - privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, 'der').privateKey - } - case '1.2.840.10040.4.1': - ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, 'der') - return { - type: 'dsa', - params: ndata.algorithm.params - } - default: throw new Error('unknown key id ' + subtype) - } - throw new Error('unknown key type ' + type) - case 'RSA PUBLIC KEY': - return asn1.RSAPublicKey.decode(data, 'der') - case 'RSA PRIVATE KEY': - return asn1.RSAPrivateKey.decode(data, 'der') - case 'DSA PRIVATE KEY': - return { - type: 'dsa', - params: asn1.DSAPrivateKey.decode(data, 'der') - } - case 'EC PRIVATE KEY': - data = asn1.ECPrivateKey.decode(data, 'der') - return { - curve: data.parameters.value, - privateKey: data.privateKey - } - default: throw new Error('unknown key type ' + type) - } -} -parseKeys.signature = asn1.signature -function decrypt (data, password) { - var salt = data.algorithm.decrypt.kde.kdeparams.salt - var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10) - var algo = aesid[data.algorithm.decrypt.cipher.algo.join('.')] - var iv = data.algorithm.decrypt.cipher.iv - var cipherText = data.subjectPrivateKey - var keylen = parseInt(algo.split('-')[1], 10) / 8 - var key = compat.pbkdf2Sync(password, salt, iters, keylen) - var cipher = ciphers.createDecipheriv(algo, key, iv) - var out = [] - out.push(cipher.update(cipherText)) - out.push(cipher.final()) - return Buffer.concat(out) -} diff --git a/node_modules/parse-asn1/package-lock.json.1909017369 b/node_modules/parse-asn1/package-lock.json.1909017369 deleted file mode 100644 index e69de29bb..000000000 diff --git a/node_modules/parse-asn1/package.json b/node_modules/parse-asn1/package.json deleted file mode 100644 index d57f07d4b..000000000 --- a/node_modules/parse-asn1/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "_from": "parse-asn1@^5.0.0", - "_id": "parse-asn1@5.1.1", - "_inBundle": false, - "_integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", - "_location": "/parse-asn1", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "parse-asn1@^5.0.0", - "name": "parse-asn1", - "escapedName": "parse-asn1", - "rawSpec": "^5.0.0", - "saveSpec": null, - "fetchSpec": "^5.0.0" - }, - "_requiredBy": [ - "/browserify-sign", - "/public-encrypt" - ], - "_resolved": "http://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", - "_shasum": "f6bf293818332bd0dab54efb16087724745e6ca8", - "_spec": "parse-asn1@^5.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify-sign", - "author": "", - "bugs": { - "url": "https://github.com/crypto-browserify/parse-asn1/issues" - }, - "bundleDependencies": false, - "dependencies": { - "asn1.js": "^4.0.0", - "browserify-aes": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3" - }, - "deprecated": false, - "description": "utility library for parsing asn1 files for use with browserify-sign.", - "devDependencies": { - "standard": "^5.0.0", - "tape": "^3.4.0" - }, - "homepage": "https://github.com/crypto-browserify/parse-asn1#readme", - "license": "ISC", - "main": "index.js", - "name": "parse-asn1", - "repository": { - "type": "git", - "url": "git://github.com/crypto-browserify/parse-asn1.git" - }, - "scripts": { - "standard": "standard", - "test": "npm run standard && npm run unit", - "unit": "node ./test" - }, - "version": "5.1.1" -} diff --git a/node_modules/parse-asn1/test/1024.priv b/node_modules/parse-asn1/test/1024.priv deleted file mode 100644 index 720621692..000000000 --- a/node_modules/parse-asn1/test/1024.priv +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAKulUTZ8B1qccZ8c -DXRGSY08gW8KvLlcxxxGC4gZHNT3CBUF8n5R4KE30aZyYZ/rtsQZu05juZJxaJ0q -mbe75dlQ5d+Xc9BMXeQg/MpTZw5TAN7OIdGYYpFBe+1PLZ6wEfjkYrMqMUcfq2Lq -hTLdAbvBJnuRcYZLqmBeOQ8FTrKrAgMBAAECgYEAnkHRbEPU3/WISSQrP36iyCb2 -S/SBZwKkzmvCrBxDWhPeDswp9c/2JY76rNWfLzy8iXgUG8WUzvHje61Qh3gmBcKe -bUaTGl4Vy8Ha1YBADo5RfRrdm0FE4tvgvu/TkqFqpBBZweu54285hk5zlG7n/D7Y -dnNXUpu5MlNb5x3gW0kCQQDUL//cwcXUxY/evaJP4jSe+ZwEQZo+zXRLiPUulBoV -aw28CVMuxdgwqAo1X1IKefPeUaf7RQu8gCKaRnpGuEuXAkEAzxZTfMmvmCUDIew4 -5Gk6bK265XQWdhcgiq254lpBGOYmDj9yCE7yA+zmASQwMsXTdQOi1hOCEyrXuSJ5 -c++EDQJAFh3WrnzoEPByuYXMmET8tSFRWMQ5vpgNqh3haHR5b4gUC2hxaiunCBNL -1RpVY9AoUiDywGcG/SPh93CnKB3niwJBAKP7AtsifZgVXtiizB4aMThTjVYaSZrz -D0Kg9DuHylpkDChmFu77TGrNUQgAVuYtfhb/bRblVa/F0hJ4eQHT3JUCQBVT68tb -OgRUk0aP9tC3021VN82X6+klowSQN8oBPX8+TfDWSUilp/+j24Hky+Z29Do7yR/R -qutnL92CvBlVLV4= ------END PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/1024.pub b/node_modules/parse-asn1/test/1024.pub deleted file mode 100644 index 2dba785d6..000000000 --- a/node_modules/parse-asn1/test/1024.pub +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrpVE2fAdanHGfHA10RkmNPIFv -Cry5XMccRguIGRzU9wgVBfJ+UeChN9GmcmGf67bEGbtOY7mScWidKpm3u+XZUOXf -l3PQTF3kIPzKU2cOUwDeziHRmGKRQXvtTy2esBH45GKzKjFHH6ti6oUy3QG7wSZ7 -kXGGS6pgXjkPBU6yqwIDAQAB ------END PUBLIC KEY----- diff --git a/node_modules/parse-asn1/test/dsa.1024.priv b/node_modules/parse-asn1/test/dsa.1024.priv deleted file mode 100644 index 1145b7d70..000000000 --- a/node_modules/parse-asn1/test/dsa.1024.priv +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN DSA PARAMETERS----- -MIIBHgKBgQDdFg3WQmpOZxObxraIe4rrbUhrBw99fbnz99IvLj60sM/7Uk7eHYvp -UrPaJBIcjPy68BjV4ekDljuPpFoAorsLzyvVSHuNvN6I/bRGm1TCOjDFVe98Oz6k -XmI6pRfIF0TiIPXkel/sWIfBYa1lqdoW82h9FIjhbxVHrKGfvMEc9wIVAOzmJHec -s6yBm+nE3+OmpWFYj0ylAoGAYxO6mFSoIY7PDRyRzKJEnULSzYXd3FoMkPwDCd5I -ch/piIoAUIIQ542TL54GT9wuiCL+0D48qi9GWKasPZABfPQ008WOzmKzD8ncrUTd -a7pzvUvdmwldA4Aa5/5xSXwtpK+DDye7KPlu+oi1BF6uj4TgfeGr1uxouxC2WhBE -qH0= ------END DSA PARAMETERS----- ------BEGIN PRIVATE KEY----- -MIIBSwIBADCCASwGByqGSM44BAEwggEfAoGBAOY0KsTt5EpJ4LtlD3xRS5mDiGE1 -CMNp0S9X0sK8kP8Aps8iYwMLbZYglk18GCNnCk4SjbAnZHSB3kaIv6AKQc2J8W2Y -V5se3VhpKOFst7bqRtkGsl8uJtGlKTiXNclkv2jsKOrsBokSD1USGCECTNeMt3Og -ziRcZ1dS+djSOZ2nAhUAzB96SpxlAak+K/QLVJ+lDe5DcY0CgYEAtxX1/Hckvhlh -HQyKZWLQsDfZBILbhc+OLDpOyT6cJS/sJzfFIYZgK5M3rOS4OmzdYfJccQAuGq+T -VJQ3VcYOdbrIANJV8CDrn4jkkejTzJI6fCwAkPWOyxw8kbV1Hsoy6WLfSCHKpBUc -rogAqRGESqBVTawjyF/ECX667y/P49MEFgIUSeRVRgAXsLmeWR/V4Rh9Hex+9+s= ------END PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/dsa.1024.pub b/node_modules/parse-asn1/test/dsa.1024.pub deleted file mode 100644 index 80a731ea3..000000000 --- a/node_modules/parse-asn1/test/dsa.1024.pub +++ /dev/null @@ -1,12 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIIBtzCCASwGByqGSM44BAEwggEfAoGBAOY0KsTt5EpJ4LtlD3xRS5mDiGE1CMNp -0S9X0sK8kP8Aps8iYwMLbZYglk18GCNnCk4SjbAnZHSB3kaIv6AKQc2J8W2YV5se -3VhpKOFst7bqRtkGsl8uJtGlKTiXNclkv2jsKOrsBokSD1USGCECTNeMt3OgziRc -Z1dS+djSOZ2nAhUAzB96SpxlAak+K/QLVJ+lDe5DcY0CgYEAtxX1/HckvhlhHQyK -ZWLQsDfZBILbhc+OLDpOyT6cJS/sJzfFIYZgK5M3rOS4OmzdYfJccQAuGq+TVJQ3 -VcYOdbrIANJV8CDrn4jkkejTzJI6fCwAkPWOyxw8kbV1Hsoy6WLfSCHKpBUcrogA -qRGESqBVTawjyF/ECX667y/P49MDgYQAAoGAXYmxO4+52C1gBzh7GgTwNLJl7bLn -gOhKTFlKhT36VjMjeFfdXmBVBVbfUottKZby/gVX1IXT38PStB/dswbF45bGDdoS -zMFjYmHTtLtrU/4hReVtvb5MYmrPDFX58SwcSRRO/cH6WJPvfu4Aq0cJZA9Kb0B9 -5Wo18JxAqvPtTB8= ------END PUBLIC KEY----- diff --git a/node_modules/parse-asn1/test/dsa.2048.priv b/node_modules/parse-asn1/test/dsa.2048.priv deleted file mode 100644 index 2a77c2ee7..000000000 --- a/node_modules/parse-asn1/test/dsa.2048.priv +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN DSA PRIVATE KEY----- -MIIDVQIBAAKCAQEA0jDs9lLWX//NXYE1kNKw4UiDVMHHEtTF1OzJvBJvUh3/xMlU -ic8mUpIMU5mt7BTjcijyLLl/TeNBcI/xDvWH3PAfCjP1CmNzOMHwU6wKA4Q20m5v -zjauVycd7loRm5h+1XyD2JL1KmQTzhIIRAmRTeXMnr8LAHidYfUKmzCOCCrnctlE -EOh1S6e7BFxQBRrlUxZF0LTjcAz31rrjIH6wKkYR4mnpGuI2vVJ+qHGmEhvq1hAb -DvP0GN0iofxHlIVqOlfXYCZO388ZabfcBOQG57tTofm8aS4pnXCgbok9wEYPgbU5 -n6fEvDGOOObQyY109hZZaDJmfygr5mmD0TIXrQIhAMVBhV4liqAN2MrT/+ZUH6hY -+DhTazzSNLIZKQ5gfd+1AoIBADqHGUVQa9pbwyjbzooeWdijUM9W5P7UUj1OjrA0 -HIkcx37qHiYOVFqHpbjDs3tbgRBxBX5zBpwuhywC/6OetDiqzDy7zZCV/YMn06d2 -ncW2Ctjp3KPl7of39+HgXXePgTdKcfkjH9upJQTko88rA4NWwZbHYeA3Lv7DcA11 -XY3+TQHcxMtxf/E6aePjANJBsJsQjYLy3WyUiS87jkgi0Bigjg/cD3Nel4LToCTR -JvQ4m3w3T4W0xL1+8nPjRZ2q0GgmxZzPfwALrwiSYMgGZC/ov43wqOs6WXs0NnpJ -moU4oxutC/uDvTZmJvRj77FINjK0ZA20jmNvWmTIeEm1Xn4CggEABeRpOymQS5IS -X+u9ya7C+P3MPIRGm4dcWPWgPpD1QcclNYLGnhRp7JazNsbbPMjnx1qtF+2qjfy9 -JDeWTAR8qfCNVmQHPAhJsJtV0C/V4PUii71FRNPVC3EAYbcBk8deMGoUg99cxSac -6MCxIIOxuUKWpw8XPlMVpuXc8+lIMTYCPeLGinmT4DQ573t0MS6U3Ck/987xjkH9 -sos7zcYn3vnjywDCxXMidC0eUK1rxAAuY7PL4vQiKwXq8kFtWiKAnns/Zm5LTjiZ -NrwlhNlU2wQVvyIcKaGfSRPheb69IbP+9qp5b7Xe7DNWdo48S0jl2KAFeZ91BnhM -TH6WPtMpjQIgOaTTn6xYK0kZvvH3lZXrzkjp4aNlNY65R0JAKKNsx3s= ------END DSA PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/dsa.2048.pub b/node_modules/parse-asn1/test/dsa.2048.pub deleted file mode 100644 index 9f6cac1cc..000000000 --- a/node_modules/parse-asn1/test/dsa.2048.pub +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIIDRjCCAjkGByqGSM44BAEwggIsAoIBAQDSMOz2UtZf/81dgTWQ0rDhSINUwccS -1MXU7Mm8Em9SHf/EyVSJzyZSkgxTma3sFONyKPIsuX9N40Fwj/EO9Yfc8B8KM/UK -Y3M4wfBTrAoDhDbSbm/ONq5XJx3uWhGbmH7VfIPYkvUqZBPOEghECZFN5cyevwsA -eJ1h9QqbMI4IKudy2UQQ6HVLp7sEXFAFGuVTFkXQtONwDPfWuuMgfrAqRhHiaeka -4ja9Un6ocaYSG+rWEBsO8/QY3SKh/EeUhWo6V9dgJk7fzxlpt9wE5Abnu1Oh+bxp -LimdcKBuiT3ARg+BtTmfp8S8MY445tDJjXT2FlloMmZ/KCvmaYPRMhetAiEAxUGF -XiWKoA3YytP/5lQfqFj4OFNrPNI0shkpDmB937UCggEAOocZRVBr2lvDKNvOih5Z -2KNQz1bk/tRSPU6OsDQciRzHfuoeJg5UWoeluMOze1uBEHEFfnMGnC6HLAL/o560 -OKrMPLvNkJX9gyfTp3adxbYK2Onco+Xuh/f34eBdd4+BN0px+SMf26klBOSjzysD -g1bBlsdh4Dcu/sNwDXVdjf5NAdzEy3F/8Tpp4+MA0kGwmxCNgvLdbJSJLzuOSCLQ -GKCOD9wPc16XgtOgJNEm9DibfDdPhbTEvX7yc+NFnarQaCbFnM9/AAuvCJJgyAZk -L+i/jfCo6zpZezQ2ekmahTijG60L+4O9NmYm9GPvsUg2MrRkDbSOY29aZMh4SbVe -fgOCAQUAAoIBAAXkaTspkEuSEl/rvcmuwvj9zDyERpuHXFj1oD6Q9UHHJTWCxp4U -aeyWszbG2zzI58darRftqo38vSQ3lkwEfKnwjVZkBzwISbCbVdAv1eD1Iou9RUTT -1QtxAGG3AZPHXjBqFIPfXMUmnOjAsSCDsblClqcPFz5TFabl3PPpSDE2Aj3ixop5 -k+A0Oe97dDEulNwpP/fO8Y5B/bKLO83GJ97548sAwsVzInQtHlCta8QALmOzy+L0 -IisF6vJBbVoigJ57P2ZuS044mTa8JYTZVNsEFb8iHCmhn0kT4Xm+vSGz/vaqeW+1 -3uwzVnaOPEtI5digBXmfdQZ4TEx+lj7TKY0= ------END PUBLIC KEY----- diff --git a/node_modules/parse-asn1/test/ec.pass.priv b/node_modules/parse-asn1/test/ec.pass.priv deleted file mode 100644 index bf1836d55..000000000 --- a/node_modules/parse-asn1/test/ec.pass.priv +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN ENCRYPTED PRIVATE KEY----- -MIHeMEkGCSqGSIb3DQEFDTA8MBsGCSqGSIb3DQEFDDAOBAi9LqZQx4JFXAICCAAw -HQYJYIZIAWUDBAECBBA+js1fG4Rv/yRN7oZvxbgyBIGQ/D4yj86M1x8lMsnAHQ/K -7/ryb/baDNHqN9LTZanEGBuyxgrTzt08SiL+h91yFGMoaly029K1VgEI8Lxu5Np/ -A+LK7ewh73ABzsbuxYdcXI+rKnrvLN9Tt6veDs4GlqTTsWwq5wF0C+6gaYRBXA74 -T1b6NykGh2UNL5U5pHZEYdOVLz+lRJL7gYqlweNHP/S3 ------END ENCRYPTED PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/ec.priv b/node_modules/parse-asn1/test/ec.priv deleted file mode 100644 index 25fffbd87..000000000 --- a/node_modules/parse-asn1/test/ec.priv +++ /dev/null @@ -1,5 +0,0 @@ ------BEGIN EC PRIVATE KEY----- -MHQCAQEEIDF6Xv8Sv//wGUWD+c780ppGrU0QdZWCAzxAQPQX8r/uoAcGBSuBBAAK -oUQDQgAEIZeowDylls4K/wfBjO18bYo7gGx8nYQRija4e/qEMikOHJai7geeUreU -r5Xky/Ax7s2dGtegsPNsPgGe5MpQvg== ------END EC PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/ec.pub b/node_modules/parse-asn1/test/ec.pub deleted file mode 100644 index 2e39e5bb6..000000000 --- a/node_modules/parse-asn1/test/ec.pub +++ /dev/null @@ -1,4 +0,0 @@ ------BEGIN PUBLIC KEY----- -MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEIZeowDylls4K/wfBjO18bYo7gGx8nYQR -ija4e/qEMikOHJai7geeUreUr5Xky/Ax7s2dGtegsPNsPgGe5MpQvg== ------END PUBLIC KEY----- diff --git a/node_modules/parse-asn1/test/index.js b/node_modules/parse-asn1/test/index.js deleted file mode 100644 index 85cb0ab4b..000000000 --- a/node_modules/parse-asn1/test/index.js +++ /dev/null @@ -1,138 +0,0 @@ -var test = require('tape') -var fs = require('fs') -var parseKey = require('../') -var rsa1024 = { - private: fs.readFileSync(__dirname + '/rsa.1024.priv'), - public: fs.readFileSync(__dirname + '/rsa.1024.pub') -} -var rsa2028 = { - private: fs.readFileSync(__dirname + '/rsa.2028.priv'), - public: fs.readFileSync(__dirname + '/rsa.2028.pub') -} -var nonrsa1024 = { - private: fs.readFileSync(__dirname + '/1024.priv'), - public: fs.readFileSync(__dirname + '/1024.pub') -} -var pass1024 = { - private: { - passphrase: 'fooo', - key: fs.readFileSync(__dirname + '/pass.1024.priv') - }, - public: fs.readFileSync(__dirname + '/pass.1024.pub') -} -var ec = { - private: fs.readFileSync(__dirname + '/ec.priv'), - public: fs.readFileSync(__dirname + '/ec.pub') -} -var ecpass = { - private: { - key: fs.readFileSync(__dirname + '/ec.pass.priv'), - passphrase: 'bard' - }, - public: fs.readFileSync(__dirname + '/ec.pub') -} -var dsa = { - private: fs.readFileSync(__dirname + '/dsa.1024.priv'), - public: fs.readFileSync(__dirname + '/dsa.1024.pub') -} -var dsa2 = { - private: fs.readFileSync(__dirname + '/dsa.2048.priv'), - public: fs.readFileSync(__dirname + '/dsa.2048.pub') -} -var dsapass = { - private: { - key: fs.readFileSync(__dirname + '/pass.dsa.1024.priv'), - passphrase: 'password' - }, - public: fs.readFileSync(__dirname + '/pass.dsa.1024.pub') -} -var dsapass2 = { - private: { - key: fs.readFileSync(__dirname + '/pass2.dsa.1024.priv'), - passphrase: 'password' - }, - public: fs.readFileSync(__dirname + '/pass2.dsa.1024.pub') -} -var rsapass = { - private: { - key: fs.readFileSync(__dirname + '/pass.rsa.1024.priv'), - passphrase: 'password' - }, - public: fs.readFileSync(__dirname + '/pass.rsa.1024.pub') -} -var rsapass2 = { - private: { - key: fs.readFileSync(__dirname + '/pass.rsa.2028.priv'), - passphrase: 'password' - }, - public: fs.readFileSync(__dirname + '/pass.rsa.2028.pub') -} -var cert = { - private: fs.readFileSync(__dirname + '/rsa.1024.priv'), - public: fs.readFileSync(__dirname + '/node.cert') -} -var i = 0 -function testIt (keys) { - test('key ' + (++i), function (t) { - t.plan(2) - t.ok(parseKey(keys.public), 'public key') - t.ok(parseKey(keys.private), 'private key') - }) -} - -function testEOL (keys) { - var publicKey = keys.public.toString() - var newLineRegex = /\r?\n/g - var genPrivate = function (replace) { - if (keys.private.key) { - return { key: keys.private.key.toString().replace(newLineRegex, replace), passphrase: keys.private.passphrase } - } else { - return keys.private.toString().replace(newLineRegex, replace) - } - } - var testN = { - private: genPrivate('\n'), - public: publicKey.replace(newLineRegex, '\n') - } - testIt(testN) - var testR = { - private: genPrivate('\r'), - public: publicKey.replace(newLineRegex, '\r') - } - testIt(testR) - var testRN = { - private: genPrivate('\r\n'), - public: publicKey.replace(newLineRegex, '\r\n') - } - testIt(testRN) -} - -testIt(dsa) -testIt(dsa2) -testIt(rsa1024) -testIt(ec) -testIt(rsa2028) -testIt(nonrsa1024) -testIt(ecpass) -testIt(dsapass) -testIt(dsapass2) -testIt(rsapass) -testIt(rsapass2) -testIt(pass1024) -testIt(pass1024) -testIt(cert) - -testEOL(dsa) -testEOL(dsa2) -testEOL(rsa1024) -testEOL(ec) -testEOL(rsa2028) -testEOL(nonrsa1024) -testEOL(ecpass) -testEOL(dsapass) -testEOL(dsapass2) -testEOL(rsapass) -testEOL(rsapass2) -testEOL(pass1024) -testEOL(pass1024) -testEOL(cert) diff --git a/node_modules/parse-asn1/test/node.cert b/node_modules/parse-asn1/test/node.cert deleted file mode 100644 index a3c1e4a0a..000000000 --- a/node_modules/parse-asn1/test/node.cert +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDXDCCAsWgAwIBAgIJAKL0UG+mRkSPMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNV -BAYTAlVLMRQwEgYDVQQIEwtBY2tuYWNrIEx0ZDETMBEGA1UEBxMKUmh5cyBKb25l -czEQMA4GA1UEChMHbm9kZS5qczEdMBsGA1UECxMUVGVzdCBUTFMgQ2VydGlmaWNh -dGUxEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0wOTExMTEwOTUyMjJaFw0yOTExMDYw -OTUyMjJaMH0xCzAJBgNVBAYTAlVLMRQwEgYDVQQIEwtBY2tuYWNrIEx0ZDETMBEG -A1UEBxMKUmh5cyBKb25lczEQMA4GA1UEChMHbm9kZS5qczEdMBsGA1UECxMUVGVz -dCBUTFMgQ2VydGlmaWNhdGUxEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG -9w0BAQEFAAOBjQAwgYkCgYEA8d8Hc6atq78Jt1HLp9agA/wpQfsFvkYUdZ1YsdvO -kL2janjwHQgMMCy/Njal3FUEW0OLPebKZUJ8L44JBXSlVxU4zyiiSOWld8EkTetR -AVT3WKQq3ud+cnxv7g8rGRQp1UHZwmdbZ1wEfAYq8QjYx6m1ciMgRo7DaDQhD29k -d+UCAwEAAaOB4zCB4DAdBgNVHQ4EFgQUL9miTJn+HKNuTmx/oMWlZP9cd4QwgbAG -A1UdIwSBqDCBpYAUL9miTJn+HKNuTmx/oMWlZP9cd4ShgYGkfzB9MQswCQYDVQQG -EwJVSzEUMBIGA1UECBMLQWNrbmFjayBMdGQxEzARBgNVBAcTClJoeXMgSm9uZXMx -EDAOBgNVBAoTB25vZGUuanMxHTAbBgNVBAsTFFRlc3QgVExTIENlcnRpZmljYXRl -MRIwEAYDVQQDEwlsb2NhbGhvc3SCCQCi9FBvpkZEjzAMBgNVHRMEBTADAQH/MA0G -CSqGSIb3DQEBBQUAA4GBADRXXA2xSUK5W1i3oLYWW6NEDVWkTQ9RveplyeS9MOkP -e7yPcpz0+O0ZDDrxR9chAiZ7fmdBBX1Tr+pIuCrG/Ud49SBqeS5aMJGVwiSd7o1n -dhU2Sz3Q60DwJEL1VenQHiVYlWWtqXBThe9ggqRPnCfsCRTP8qifKkjk45zWPcpN ------END CERTIFICATE----- diff --git a/node_modules/parse-asn1/test/pass.1024.priv b/node_modules/parse-asn1/test/pass.1024.priv deleted file mode 100644 index b9f388450..000000000 --- a/node_modules/parse-asn1/test/pass.1024.priv +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN ENCRYPTED PRIVATE KEY----- -MIICzzBJBgkqhkiG9w0BBQ0wPDAbBgkqhkiG9w0BBQwwDgQIji3ZZ6JbsA4CAggA -MB0GCWCGSAFlAwQBFgQQC6MKblq8zyX90/KmgotsMQSCAoDghNf+yxPC/KRh7F3O -k0lMgtDkV+wCLDv7aBvUqy8Ry2zqFPIlfLb8XtSW943XEu6KUI13IZPEr8p9h1ve -Iye6L0g6uAgbFxBE2DwBBSI7mYr7lokr4v0k+inMKf4JeRdI9XWgwOILKTGf1vH7 -PhvBnqLhOg6BIOuF426qpiyYlmRda74d0Th4o6ZyhyMSzPI1XbWSg719Ew3N/tLe -OHdYl0eFrgNjq+xO4Ev+W7eNIh/XBMQtk9wo+mxeNdldRnX822HxTsL8fSSPs+9T -W5M/2EBTJMSsswSjZyFkq8ehtxovI2u0IBX1IiPulyUZLnSNPDV1eUVClK6rk+q1 -kVsfJhUr2qvIjNlQWlbEXQj4VwGtgl0++l8vdpj59MuN2J3Nx5TNMLjA6BYAa/tr -Bu928QoT7ET+SGx5XKCwKb5fwXmDlV5zZC4kZWTaF/d/Icvj5F+fDZuYFg1JOXNZ -+q2oA1qMYaHGX6lF3pbO84ebg1iwQTDM8iIqFeSMGUJTnk/3a7sqfaWQbEQwGb+X -fXnSTwkF+wO2rriPbFvWyzecWu67zDCP0ZWUgGb86sSJCM7xRGShESwCjOrb88F1 -5SZjyIqogrkc3IWiLH9gc5U8d86qoFjJnP6BfwYks1UIyXNGKfZTCqICpMphV+IS -b0N2jprjLTkWR6nxYGSH1bkKMs7x1M0FBLWWLAZqPn9X3pe6JwIBds04O6XjF0un -oxwDjcJdoxVs7PgRiM5d1Tubqu2zmpCCmXNiqi9B0+rV9/jHg9IA5gUfvYdCcEv+ -oAr90I+2+PuBFa9lgdbDV6DtZk4bSYluqamxVeLPg/vrewYfVfDv6jftfY1D0DEy -69H0 ------END ENCRYPTED PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/pass.1024.pub b/node_modules/parse-asn1/test/pass.1024.pub deleted file mode 100644 index 617e7fb10..000000000 --- a/node_modules/parse-asn1/test/pass.1024.pub +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDSK/7i5BV0x+gmX16Wrm7kRkCZ -y1QUt6wiM2g+SAZTYR0381VnSMX2cv7CpN3499lZj1rL5S7YTaZZwX3RvU5fz56/ -eDX6ciL/PZsbclN2KdkMWYgmcb9J1zUeoMQ3cjfFUCdQZ/ZvDWa+wY2Zg8os2Bow -AoufHtYHm3eOly/cWwIDAQAB ------END PUBLIC KEY----- diff --git a/node_modules/parse-asn1/test/pass.dsa.1024.priv b/node_modules/parse-asn1/test/pass.dsa.1024.priv deleted file mode 100644 index aab5fc2f1..000000000 --- a/node_modules/parse-asn1/test/pass.dsa.1024.priv +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN ENCRYPTED PRIVATE KEY----- -MIIBnzBJBgkqhkiG9w0BBQ0wPDAbBgkqhkiG9w0BBQwwDgQI1z4IJORFws4CAggA -MB0GCWCGSAFlAwQBAgQQq7f0CuKCTITfPS5Xax1H4wSCAVDFyIjYVXfBNe+BARqz -Tfo09y4vKkErOb7Sz4bQkAjRLjOXiUjM4eTNtivml8NqVrQTKAghN+ggxj416OD4 -oq6Ns7Ncbd4Xm5Ni8wrrWbJxVog6rAa/ioU0sfgRExYy/xE2Q9KkW+VE7SUwanwY -e81Od9qNM5KhZGM1yUSKa0JA6Xqb8dAqBo9rVt8DceumB9OP83xV3fLEimSZfR6p -slA1P/dTvKxwhpguQe4Z3OkzTzGCxyboqeRW1woNHKbxjzzSHcaki9SHQm3xpUW8 -hRAJd6OtDnLbkE9MnC+UcI3mjru1xfnR5MU7qG7e9nvOhEDVaDkiK3DbrSf0B0Bi -p1hyX1XsSXDewSEd/mlfMLdD8WecgUtl9ea7JzxY3/6R78yB951I5TmY45mp/v+N -tbxEv29B65UKf0ac7gVw4LNy8JF2ef/L/meEmBoIAE71f+8= ------END ENCRYPTED PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/pass.dsa.1024.pub b/node_modules/parse-asn1/test/pass.dsa.1024.pub deleted file mode 100644 index 80a731ea3..000000000 --- a/node_modules/parse-asn1/test/pass.dsa.1024.pub +++ /dev/null @@ -1,12 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIIBtzCCASwGByqGSM44BAEwggEfAoGBAOY0KsTt5EpJ4LtlD3xRS5mDiGE1CMNp -0S9X0sK8kP8Aps8iYwMLbZYglk18GCNnCk4SjbAnZHSB3kaIv6AKQc2J8W2YV5se -3VhpKOFst7bqRtkGsl8uJtGlKTiXNclkv2jsKOrsBokSD1USGCECTNeMt3OgziRc -Z1dS+djSOZ2nAhUAzB96SpxlAak+K/QLVJ+lDe5DcY0CgYEAtxX1/HckvhlhHQyK -ZWLQsDfZBILbhc+OLDpOyT6cJS/sJzfFIYZgK5M3rOS4OmzdYfJccQAuGq+TVJQ3 -VcYOdbrIANJV8CDrn4jkkejTzJI6fCwAkPWOyxw8kbV1Hsoy6WLfSCHKpBUcrogA -qRGESqBVTawjyF/ECX667y/P49MDgYQAAoGAXYmxO4+52C1gBzh7GgTwNLJl7bLn -gOhKTFlKhT36VjMjeFfdXmBVBVbfUottKZby/gVX1IXT38PStB/dswbF45bGDdoS -zMFjYmHTtLtrU/4hReVtvb5MYmrPDFX58SwcSRRO/cH6WJPvfu4Aq0cJZA9Kb0B9 -5Wo18JxAqvPtTB8= ------END PUBLIC KEY----- diff --git a/node_modules/parse-asn1/test/pass.rsa.1024.priv b/node_modules/parse-asn1/test/pass.rsa.1024.priv deleted file mode 100644 index b67bd8043..000000000 --- a/node_modules/parse-asn1/test/pass.rsa.1024.priv +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: AES-192-CBC,04D2D7882E0C474E07E542FE997D2A49 - -vfB5Gtm34n3SeI6JELjWiGw6O+j+tGR6Wbi3SNeAZkfSA8PTjei6PVHr+dGK5zMd -nTckd0EpxItqxEdtLK6GtBIa9KRd3cEbayHmyyybH2FC4STXJCUFBe2eb7ZKmnCl -RB5FcmAqExif+QOJwHnZw6DTzq+oGSwi9cSoy2qE62FgXkj8uKAYcBLONmsP1YQA -4zIub4bnEbIghL/swEB/HVS86FyMCsMXrHEOnSuUUBf/UfZFNypI6kVUNXlItnN1 -14eeRsBD37VkL7dAQPMx+Dwm7DbU07QWrVvzgmWlu3KqR0tRNA9e4a5f14XOYxgS -HZ+XVZK8iAd+76OnprlFtGDowDXGM0wUXPYq5j8WpKxNsVs2RV+S6U0gQLoSqNxt -We7UPWZufzEdjTUO8q9KhdGqFmJ53XIYClZf0bp148b+Bk3P+dN5TbmKQEfulScn -rTLTRo34fdTIAJr5BJh0OXGNs9rFlMJ9Nz4FwVTEB1DMerXtt9ICdhud9BktRhvq -axgoz+XA3LrBrlPPcrSCZyIYjZFydGSkzg439OyDEZ6+uRmc0qhWA4j6AgXx6gGR -NvvypoFVKvXqEq/2F+SVyyMGrm4xPmsr/HUBeE9SmuTzNzDfVAM/xerqIoR2szR0 -O0hwtOj4fk7//cd1CjFzd0JiF/SqMkHxkdbmIC9qlhshkWlQbvvhbefodYPuGxmj -L1TaPgX36OcrQSodzyWBN5tSmmX1Nmftcz7iwc4AKrqkdnM3sPS3SczsAjMWrjRr -7iYhdPQSZtxVCTjACU3h7scNAg9AU6l4YZrowR//J6U= ------END RSA PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/pass.rsa.1024.pub b/node_modules/parse-asn1/test/pass.rsa.1024.pub deleted file mode 100644 index 3506c331c..000000000 --- a/node_modules/parse-asn1/test/pass.rsa.1024.pub +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIGcMA0GCSqGSIb3DQEBAQUAA4GKADCBhgJ/OwswbFo/uyC8ltGf/yA1A+gV5IGd -nAgPbUSI3GzbHCA+x+TLG/tLvbRw3r1smppY/jkkpiVW1ErSMuN0uixp5gb78Z9r -H1XpWb5WWgp3WaY/9EHMjMdOkQ/9LVZvRvl/M/Fi6owP+q+amJI1BEjECYfbhGL3 -rmlVdq4qXc40QwIDAQAB ------END PUBLIC KEY----- diff --git a/node_modules/parse-asn1/test/pass.rsa.2028.priv b/node_modules/parse-asn1/test/pass.rsa.2028.priv deleted file mode 100644 index 99e821352..000000000 --- a/node_modules/parse-asn1/test/pass.rsa.2028.priv +++ /dev/null @@ -1,30 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: AES-256-CBC,7A6A055AD675947A657041422F06D439 - -HQdjzAKUuqqKhZHmpzzY/monfqFhiHnZ5c24jtR9fM4aQJXf/e1fz6MEhyIz6XON -sb4CnXZstnxUuVWDkHEu6KWQ/dKALgiDUuT+UdMawVoVPGdgyWZp35pQPWi3fT2V -XZn58YkG8bO3Y403eZPyhadOefD1VtuFuK6/f90jjzx6ZDnwveXpYgFV7Jy1/pFd -cLLMf07C+hbk416nX6UVipWe4GH+ADFom5ZCfAaUotM7n8i149dULNF4YYi2wP31 -1YaDH5vf1CqiaieDY7xLzpEixwJz6ZEg3gLXaUvz2MpF8owiGI3eP0g7voWp3xt4 -TQx/qDURlaXiaRriWdWtpKyW1MFuJ5+KdNtR1/kXr2BLPB/ZLwyqtynUy8ZYpb4+ -WIRYpUGeb//ZHGhlCH7CRMdABsal4wTwnzi9fW4Ax96ecJ2SlwCuKxwS7iEq2y1/ -FAfGwsE+XufHhme5p6XjKfiHx+zJMIB2NMkrm+wm4PbMTrGVnw5/41/r6XxOB8fe -iKi12Jth4dusc1vYGYfzKop9uEM6CZ6+Chqzb+Zyh/xUiZVlCX/BYnxr7yXUm9aR -PHQgxkn2Act8FgQB3Kgs3jCiCRIJrlsnybeWzQ3YO9TjC4MxygmmwODDBpsOKnEi -kXXS54+cZFjcsva4uJVwhAywRPVUkLzmTkH0tGiwCHjeQNECm+TLahkkEIXrVTb9 -c9creNXMgE6jVVz+R43HXsGvTcgMcBLyFRQJe2nVaj/dQ5JbF4uqNnQzRjAbD34K -uTpFaJ/kmlgcmeScRLnwaoYwFlmhSC+bK0dfY1Jr6AQRA6IDP7nIjqWNDCHNBB8r -Qj1v2KWoVQe3xNHaXhkbJPbA2DKlUIqffkBVtMKtt9KuG3Rccf3bVYAW6oid73/D -z7DMAF5G/OpVR8VbGh1WxXuR7zEVDUwpwsp9ek5dqN8BnBz1ppdZNIKqzszneckU -s2l/6mZBmgV1Nfy/cQU6U5s3S1Xc75UDQVLms3CIOpFTRIpecNTdfa31fYy/svy0 -M2lWTbCva0dOyuvMUhTgBL4I7Qa2dUMPXHMZatV5ooHYq/BZJA1r84C5cM5r+umE -2LLv/BlUr7RaQHhaKGn4Qhpzo5yRDE9mEqDpLVkbg8SxMsdf/pEF5/VyUwA9t8RT -fKVsInRd386tDqJSDbSFqKTvLztr/5YCyzZzvC2YB1voko/caOGd2d/G51Ij+bXU -xEN8U4fHDBsHwPUGb31uZUhTXpL37KiOqZmXFoH2usmuvx882XvyGcV0F4tstMaR -KLKzl2PwqzAYGFexLkYKMz0TYIeN6h3b86ETazPPU49nkaEU23Dx21J2Rb3UlH+I -lDQF3wuH1QlYiTnlcVa/Zu4QQg0/iP8ALkZ06mvn9e9mOtnA8gsh4B2oLqc19VLU -bcpv40dV1H3W9Lcx9B8JYUp0c/Oyno1D7Yj3tjGcwMKECmUpHi4kksehVo0/P933 -xmFmC6eyWYVdO9upvY/vKSB7b1dMt85iWr3gnMsSfRYc6jsbSxdjOPST46UsIzjx -wa1DS6+Bv5tiaC4uC6X+0tCAZo+UOQMYUbTGRR/7g/c= ------END RSA PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/pass.rsa.2028.pub b/node_modules/parse-asn1/test/pass.rsa.2028.pub deleted file mode 100644 index 655cc3a4d..000000000 --- a/node_modules/parse-asn1/test/pass.rsa.2028.pub +++ /dev/null @@ -1,9 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIIBHjANBgkqhkiG9w0BAQEFAAOCAQsAMIIBBgKB/gy7mjaWgPeFdVYDZWRCA9BN -iv3pPb0es27+FKY0hszLaOw47ExCtAWpDsH48TXAfyHBYwBLguayfk4LGIupxb+C -GMbRo3xEp0CbfY1Jby26T9vGjRC1foHDDUJG84uaRbyHqaf4i6zt4gVR+xlAEIjk -aFAAK8cOoXAT1CVqGLLljUCchL8PjaHj/yriZ/S7rdwlI3LnABxwwmLrmR/v71Wt -pmO/aNG8N+1po+QwaghTkyQ59E/ZvAuOkFWHok2q/R6PYAa2jdZ9zim0FqOP+nkQ -aEDRbBFBmBqTv5fFGfk2WsAfKf/RG0/VFd+ZeM5251TeTvXH695nlSGauVl9AgMB -AAE= ------END PUBLIC KEY----- diff --git a/node_modules/parse-asn1/test/pass2.dsa.1024.priv b/node_modules/parse-asn1/test/pass2.dsa.1024.priv deleted file mode 100644 index 29e367344..000000000 --- a/node_modules/parse-asn1/test/pass2.dsa.1024.priv +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN DSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: AES-128-CBC,DC173C6DFD455EBE462A35D6AB9A603A - -FoC3sxbdUFJTaNtRpooMxaX2lcQRLUz8qcRhzDBn5a1kaMHp2JM3KlHK5aauybT4 -ilmlKJ9sSm8pFLAWPKbkczSgZ+X6p/51v4zaEJSebZ98p32kQk87XJQE7aYroxYV -UfM5PSOoKWilj+LZQQEXV10qDoYGrnbSdoNSxYW5V1a1aP+ua0EO7m9MUYkoLxi3 -SJ/s2h/5KM3TOz7d7DOZuSoNm+0n6YC4aqQnR3lmEtAXEYLQqLhH2Q3FTKTHwBQw -HgMBAzcXOS1YSw6Ekwh1eZamizrOEC4I6oZEHoUBqRfbsQ8tu77kDq2ovQSyn8Fp -SeE64m3GgZOYdfcDuNZ0ccmm3shBBfTfD9AwR+1thklKO3oaaLEHb6TmnkD79rEz -9WsiVxoN7vqqWdgoeyl7REOB6WLQp8kYS4FoRG0QB/ZS8Hs/Tf17QPnrQNiMkvP7 -sJSHmlaMKXjWXK0VoN94kfZKUXwkzLD1VXuXFCnUkznWU0tahYi06b8/SVXc6EG+ -0mzylckH7UnjOQfxSFAlZ+e/PiX80tcPakxYbk+f1Nv7L0NOyhrDv18KUbv9mEpV -Ysild1m7/QSF0u1qmjmGNQ== ------END DSA PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/pass2.dsa.1024.pub b/node_modules/parse-asn1/test/pass2.dsa.1024.pub deleted file mode 100644 index 80a731ea3..000000000 --- a/node_modules/parse-asn1/test/pass2.dsa.1024.pub +++ /dev/null @@ -1,12 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIIBtzCCASwGByqGSM44BAEwggEfAoGBAOY0KsTt5EpJ4LtlD3xRS5mDiGE1CMNp -0S9X0sK8kP8Aps8iYwMLbZYglk18GCNnCk4SjbAnZHSB3kaIv6AKQc2J8W2YV5se -3VhpKOFst7bqRtkGsl8uJtGlKTiXNclkv2jsKOrsBokSD1USGCECTNeMt3OgziRc -Z1dS+djSOZ2nAhUAzB96SpxlAak+K/QLVJ+lDe5DcY0CgYEAtxX1/HckvhlhHQyK -ZWLQsDfZBILbhc+OLDpOyT6cJS/sJzfFIYZgK5M3rOS4OmzdYfJccQAuGq+TVJQ3 -VcYOdbrIANJV8CDrn4jkkejTzJI6fCwAkPWOyxw8kbV1Hsoy6WLfSCHKpBUcrogA -qRGESqBVTawjyF/ECX667y/P49MDgYQAAoGAXYmxO4+52C1gBzh7GgTwNLJl7bLn -gOhKTFlKhT36VjMjeFfdXmBVBVbfUottKZby/gVX1IXT38PStB/dswbF45bGDdoS -zMFjYmHTtLtrU/4hReVtvb5MYmrPDFX58SwcSRRO/cH6WJPvfu4Aq0cJZA9Kb0B9 -5Wo18JxAqvPtTB8= ------END PUBLIC KEY----- diff --git a/node_modules/parse-asn1/test/rsa.1024.priv b/node_modules/parse-asn1/test/rsa.1024.priv deleted file mode 100644 index d3b5fdab6..000000000 --- a/node_modules/parse-asn1/test/rsa.1024.priv +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICVAIBAAJ/OwswbFo/uyC8ltGf/yA1A+gV5IGdnAgPbUSI3GzbHCA+x+TLG/tL -vbRw3r1smppY/jkkpiVW1ErSMuN0uixp5gb78Z9rH1XpWb5WWgp3WaY/9EHMjMdO -kQ/9LVZvRvl/M/Fi6owP+q+amJI1BEjECYfbhGL3rmlVdq4qXc40QwIDAQABAn8I -VZ0BPoAOhyF33KFMHxy8r28fsVgxJUYgM3NqQgdv4fFawCYXjhJz9duU5YJGFJGJ -WUGeHlkyYFlpi4f3m7tY7JawmQUWB0MNSoKHI3cgDX4/tfBN8ni+cO0eSoR5czBY -EsAHBU47p1awNFAHwd+ZEuv9H4RmMn7p279rQTtpAkAH3Nqs2/vrRF2cZUN4fIXf -4xHsQBByUayGq8a3J0UGaSFWv68zTUKFherr9uZotNp7NJ4jBXiARw0q8docXUG1 -AkAHgmOKHoORtAmikqpmFEJZOtsXMaLCIm4EszPo5ciYoLMBcVit09AdiQlt7ZJL -DY02svU1b0agCZ97kDkmHDkXAkACa8M9JELuDs/P/vIGYDkMVatIFfW6bWF02eFG -taWwMqCcSEsWvbw0xqYt34jURpNbCjmCyQVwYfAw/+TLhP9dAkAFwRjdwjw37qpj -ddg1mNiu37b7swFxmkiMOXZRxaNNsfb56A14RpN3zob3QdGUybGodMIKTFbmU/lu -CjqAxafJAkAG2yf6RWbwFIWfMyt7WYCh0VaGBCcgy574AinVieEo3ZZyFfC63+xm -3uoaNy4iLoJv4GCjqUBz3ZfcVaO/DDWG ------END RSA PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/rsa.1024.pub b/node_modules/parse-asn1/test/rsa.1024.pub deleted file mode 100644 index 7ba06369b..000000000 --- a/node_modules/parse-asn1/test/rsa.1024.pub +++ /dev/null @@ -1,5 +0,0 @@ ------BEGIN RSA PUBLIC KEY----- -MIGGAn87CzBsWj+7ILyW0Z//IDUD6BXkgZ2cCA9tRIjcbNscID7H5Msb+0u9tHDe -vWyamlj+OSSmJVbUStIy43S6LGnmBvvxn2sfVelZvlZaCndZpj/0QcyMx06RD/0t -Vm9G+X8z8WLqjA/6r5qYkjUESMQJh9uEYveuaVV2ripdzjRDAgMBAAE= ------END RSA PUBLIC KEY----- diff --git a/node_modules/parse-asn1/test/rsa.2028.priv b/node_modules/parse-asn1/test/rsa.2028.priv deleted file mode 100644 index 10e651d86..000000000 --- a/node_modules/parse-asn1/test/rsa.2028.priv +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEjwIBAAKB/gy7mjaWgPeFdVYDZWRCA9BNiv3pPb0es27+FKY0hszLaOw47ExC -tAWpDsH48TXAfyHBYwBLguayfk4LGIupxb+CGMbRo3xEp0CbfY1Jby26T9vGjRC1 -foHDDUJG84uaRbyHqaf4i6zt4gVR+xlAEIjkaFAAK8cOoXAT1CVqGLLljUCchL8P -jaHj/yriZ/S7rdwlI3LnABxwwmLrmR/v71WtpmO/aNG8N+1po+QwaghTkyQ59E/Z -vAuOkFWHok2q/R6PYAa2jdZ9zim0FqOP+nkQaEDRbBFBmBqTv5fFGfk2WsAfKf/R -G0/VFd+ZeM5251TeTvXH695nlSGauVl9AgMBAAECgf4LrWHY/l54ouThZWvvbrug -pfz6sJX2g9l7yXmWlEWsPECVo/7SUbpYFpt6OZy99zSg+IKbGqWKfdhoKrTwIVtC -L0YZ0NlmdnANSIz0roxQG7ZxkL5+vHSw/PmD9x4Uwf+Cz8hATCmNBv1qc60dkyuW -4CLqe72qaTiVWRoO1iagQghNcLoo6vSy65ExLaCDTPha7yu2vw4hFZpWiEjW4dxf -rFdLiix52BC86YlAlxME/rLg8IJVvilbyo9aWdXmxOaUTLRv6PkFD1/gVdw8V9Qr -SLN9FlK2kkjiX0dzoibvZw3tMnt3yydAx0X87+sMRVahC1bp3kVPz4Hy0EWX4QJ/ -PM31vGiuITk2NCd51DXt1Ltn2OP5FaJSmCaEjh0XkU4qouYyjXWt8Bu6BTCl2vua -Fg0Uji9C+IkPLmaUMbMIOwaTk8cWqLthSxsLe70J5OkGrgfKUM/w+BHH1Pt/Pjzj -C++l0kiFaOVDVaAV9GpLPLCBoK/PC9Rb/rxMMoCCNwJ/NZuedIny2w3LMii77h/T -zSvergNGhjY6Rnva8lLXJ6dlrkcPAyps3gWwxqj4NR0T+GM0bDUPVLb7M07XV7SX -v7VJGm52JbRGwM1ss+r8XTTNemeGk+WRxG7TgtsMqYGXLfB8Qxk/f5/Mcc00Tl8u -wXFNsfxJxmt6AbsTr3g36wJ/IhOnibz9Ad+nchlBnN3QeW3CKHqzaR18voqvtVm2 -kJfHK15prH/sSGmxmiEGgrCJTZxtDbaNCO7/VBjnKudUUIhCAwsLtuq0/zub9vAd -8G1scfIpv5qaSNzmKoX8bOwArvrS6wP7yKrcTsuWIlHD8rJVI7IEDnQoTp5G8fK1 -hwJ/MIh8M5v0r5dUYEv6oIJWGcle6AH1JmsP5WIafgq72Z2288pHcCFHwNY8Dg9J -76QswVLnUhPTlmm3EOOPGEtam2iAD5r0Afytlb4lbNoQsj2szeXONDXB+6oueajh -VNELUr8HcSP5lgzRZjJW6aFIzj9LDRmQnUAOjGSXVOQtEwJ/MCQZ7N/v4dIKeDRA -8d8UExZ3+gGHumziztGRJ0tQryZH2PakP5I7V+1l7qEUnJ2c3mF+e1v41Ep9LCvh -bzrPKw9dxh18g4b+7bMpsWPnsraKh6ipxc7aaOaZV0Dxgez4zcZu0P1olO0cN3KM -nxJ0Pds3R8bAhNCDdS2JZaRp5Q== ------END RSA PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/rsa.2028.pub b/node_modules/parse-asn1/test/rsa.2028.pub deleted file mode 100644 index b36dca4d6..000000000 --- a/node_modules/parse-asn1/test/rsa.2028.pub +++ /dev/null @@ -1,8 +0,0 @@ ------BEGIN RSA PUBLIC KEY----- -MIIBBgKB/gy7mjaWgPeFdVYDZWRCA9BNiv3pPb0es27+FKY0hszLaOw47ExCtAWp -DsH48TXAfyHBYwBLguayfk4LGIupxb+CGMbRo3xEp0CbfY1Jby26T9vGjRC1foHD -DUJG84uaRbyHqaf4i6zt4gVR+xlAEIjkaFAAK8cOoXAT1CVqGLLljUCchL8PjaHj -/yriZ/S7rdwlI3LnABxwwmLrmR/v71WtpmO/aNG8N+1po+QwaghTkyQ59E/ZvAuO -kFWHok2q/R6PYAa2jdZ9zim0FqOP+nkQaEDRbBFBmBqTv5fFGfk2WsAfKf/RG0/V -Fd+ZeM5251TeTvXH695nlSGauVl9AgMBAAE= ------END RSA PUBLIC KEY----- diff --git a/node_modules/parse-asn1/test/vector.js b/node_modules/parse-asn1/test/vector.js deleted file mode 100644 index 4b8d8cf53..000000000 --- a/node_modules/parse-asn1/test/vector.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - p: new Buffer('86F5CA03DCFEB225063FF830A0C769B9DD9D6153AD91D7CE27F787C43278B447E6533B86B18BED6E8A48B784A14C252C5BE0DBF60B86D6385BD2F12FB763ED8873ABFD3F5BA2E0A8C0A59082EAC056935E529DAF7C610467899C77ADEDFC846C881870B7B19B2B58F9BE0521A17002E3BDD6B86685EE90B3D9A1B02B782B1779', 'hex'), - q: new Buffer('996F967F6C8E388D9E28D01E205FBA957A5698B1', 'hex'), - g: new Buffer('07B0F92546150B62514BB771E2A0C0CE387F03BDA6C56B505209FF25FD3C133D89BBCD97E904E09114D9A7DEFDEADFC9078EA544D2E401AEECC40BB9FBBF78FD87995A10A1C27CB7789B594BA7EFB5C4326A9FE59A070E136DB77175464ADCA417BE5DCE2F40D10A46A3A3943F26AB7FD9C0398FF8C76EE0A56826A8A88F1DBD', 'hex'), - x: new Buffer('411602CB19A6CCC34494D79D98EF1E7ED5AF25F7', 'hex'), - y: new Buffer('5DF5E01DED31D0297E274E1691C192FE5868FEF9E19A84776454B100CF16F65392195A38B90523E2542EE61871C0440CB87C322FC4B4D2EC5E1E7EC766E1BE8D4CE935437DC11C3C8FD426338933EBFE739CB3465F4D3668C5E473508253B1E682F65CBDC4FAE93C2EA212390E54905A86E2223170B44EAA7DA5DD9FFCFB7F3B', 'hex') -} diff --git a/node_modules/parse-asn1/test/vector.priv b/node_modules/parse-asn1/test/vector.priv deleted file mode 100644 index 178bd1e68..000000000 --- a/node_modules/parse-asn1/test/vector.priv +++ /dev/null @@ -1,12 +0,0 @@ ------BEGIN DSA PRIVATE KEY----- -MIIBugIBAAKBgQCG9coD3P6yJQY/+DCgx2m53Z1hU62R184n94fEMni0R+ZTO4ax -i+1uiki3hKFMJSxb4Nv2C4bWOFvS8S+3Y+2Ic6v9P1ui4KjApZCC6sBWk15Sna98 -YQRniZx3re38hGyIGHC3sZsrWPm+BSGhcALjvda4ZoXukLPZobAreCsXeQIVAJlv -ln9sjjiNnijQHiBfupV6VpixAoGAB7D5JUYVC2JRS7dx4qDAzjh/A72mxWtQUgn/ -Jf08Ez2Ju82X6QTgkRTZp9796t/JB46lRNLkAa7sxAu5+794/YeZWhChwny3eJtZ -S6fvtcQyap/lmgcOE223cXVGStykF75dzi9A0QpGo6OUPyarf9nAOY/4x27gpWgm -qKiPHb0CgYBd9eAd7THQKX4nThaRwZL+WGj++eGahHdkVLEAzxb2U5IZWji5BSPi -VC7mGHHARAy4fDIvxLTS7F4efsdm4b6NTOk1Q33BHDyP1CYziTPr/nOcs0ZfTTZo -xeRzUIJTseaC9ly9xPrpPC6iEjkOVJBahuIiMXC0Tqp9pd2f/Pt/OwIUQRYCyxmm -zMNElNedmO8eftWvJfc= ------END DSA PRIVATE KEY----- diff --git a/node_modules/parse-asn1/test/vector2.priv b/node_modules/parse-asn1/test/vector2.priv deleted file mode 100644 index ef53f6146..000000000 --- a/node_modules/parse-asn1/test/vector2.priv +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN DSA PRIVATE KEY----- -MIIDVQIBAAKCAQEAnbb7WVG2a7b+HhQPHSzlUCN0Fh/WU43xZIIYZC8LXEjI96Qa -rfoYcyS4dnT6GCKwDx7PgTaUPXxVdXJk5aGkT/4BLpk24AwdPpMQsBx9F5gF0wWL -Kp9Ltvlxa/5hF8a1s8xNm+NBEErUqArWyU4AX0uZPhTwketRdDvzMFDDjeI1Vn4b -NMPWpcDOqhoPNoITw9GYQ9C0sJ3Ln8ctOcjeQfG/FNS7RWPKKDcWIcrTMktqLTkh -Rb6/rHSIBSNvXKL+krhxzY+cNtMpK1UJyoyqd6Kt/Hv9d92m9xElp0Vv6hU+QzJW -oiYcagbtNpN5fnmV+tWqu8++PtonQeN1QEriWwIhAPLDEZN0znbJNWmQtGU3Shfy -P57TUIm9lp9hxt3pmYwfAoIBAFx/9rBvjxQ/6CiEM0k+R2nE2Yis5b4loOJICWcH -FsYT17DO5pMvj6p8RNLLJFI9pT++T27DWViS0apYxDKKBsRqFWYufqpwOh3s+Luy -0F2+LrlWwUKjOGYdEEYcDRNUcghQV/NJQwn/pzxhH3izKtu1dAw2HJ81vpCZfbIB -Ti71qmF4L1Kr64vWQyxN0Je8VCOyhdr7YNw2ToFh9KKjWso6ELHE0gPMdqRwozr9 -y92SlZhZq9i1bhclJS146sZucbqa4/HdJIcZmHQ5PNTYMhhoAGVHYOHjTAnk0VUX -n57A3ERz+Za9zm7tHKvti28Rb3rZz1Bd8PmY40qydRSw/+cCggEAZnCYxlRCbHjX -+CAerGwgPvAw1DYFAywvH6k35SN9vZSfNKCiVk/hJtyLcVxRQYAs4JecgkZGPEDm -tr2qJRP6YRcocWwuT9U7yVuJ5plJ2WUS6HO5yPjf1JnMMSiCVhreyzH2WOk0wMGX -8sTZawXLrWc4Hnt2iJHk2jhD0k2UzftRJum4vyHoNY7g4KMO8T/WpmTA3ONzH3+0 -mkhFpP2CVGh5cqLTglmcm6xODteZgZMHiRMDJVgTSXZBC4nSwXHRI6w1/ZdyGVl6p9FcGppCjlkZT3XHIevLz65EaWpJmvp04EKZ8TICZgFjjLh6t5GQ1KCYY -xXajuxlYck4mWvq3wIgacdUjCHQ3+prmlHJ6tTifDPTs/GAMW5byrkskz8OTbw= ------END DSA PRIVATE KEY----- diff --git a/node_modules/parse-glob/LICENSE b/node_modules/parse-glob/LICENSE deleted file mode 100644 index 65f90aca8..000000000 --- a/node_modules/parse-glob/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/parse-glob/README.md b/node_modules/parse-glob/README.md deleted file mode 100644 index 000ccd99c..000000000 --- a/node_modules/parse-glob/README.md +++ /dev/null @@ -1,115 +0,0 @@ -# parse-glob [![NPM version](https://badge.fury.io/js/parse-glob.svg)](http://badge.fury.io/js/parse-glob) [![Build Status](https://travis-ci.org/jonschlinkert/parse-glob.svg)](https://travis-ci.org/jonschlinkert/parse-glob) - -> Parse a glob pattern into an object of tokens. - -**Changes from v1.0.0 to v3.0.4** - -* all path-related properties are now on the `path` object -* all boolean properties are now on the `is` object -* adds `base` property - -See the [properties](#properties) section for details. - -Install with [npm](https://www.npmjs.com/) - -```sh -$ npm i parse-glob --save -``` - -* parses 1,000+ glob patterns in 29ms (2.3 GHz Intel Core i7) -* Extensive [unit tests](./test.js) (more than 1,000 lines), covering wildcards, globstars, character classes, brace patterns, extglobs, dotfiles and other complex patterns. - -See the tests for [hundreds of examples](./test.js). - -## Usage - -```js -var parseGlob = require('parse-glob'); -``` - -**Example** - -```js -parseGlob('a/b/c/**/*.{yml,json}'); -``` - -**Returns:** - -```js -{ orig: 'a/b/c/**/*.{yml,json}', - is: - { glob: true, - negated: false, - extglob: false, - braces: true, - brackets: false, - globstar: true, - dotfile: false, - dotdir: false }, - glob: '**/*.{yml,json}', - base: 'a/b/c', - path: - { dirname: 'a/b/c/**/', - basename: '*.{yml,json}', - filename: '*', - extname: '.{yml,json}', - ext: '{yml,json}' } } -``` - -## Properties - -The object returned by parseGlob has the following properties: - -* `orig`: a copy of the original, unmodified glob pattern -* `is`: an object with boolean information about the glob: - - `glob`: true if the pattern actually a glob pattern - - `negated`: true if it's a negation pattern (`!**/foo.js`) - - `extglob`: true if it has extglobs (`@(foo|bar)`) - - `braces`: true if it has braces (`{1..2}` or `.{txt,md}`) - - `brackets`: true if it has POSIX brackets (`[[:alpha:]]`) - - `globstar`: true if the pattern has a globstar (double star, `**`) - - `dotfile`: true if the pattern should match dotfiles - - `dotdir`: true if the pattern should match dot-directories (like `.git`) -* `glob`: the glob pattern part of the string, if any -* `base`: the non-glob part of the string, if any -* `path`: file path segments - - `dirname`: directory - - `basename`: file name with extension - - `filename`: file name without extension - - `extname`: file extension with dot - - `ext`: file extension without dot - -## Related -* [glob-base](https://www.npmjs.com/package/glob-base): Returns an object with the (non-glob) base path and the actual pattern. | [homepage](https://github.com/jonschlinkert/glob-base) -* [glob-parent](https://www.npmjs.com/package/glob-parent): Strips glob magic from a string to provide the parent path | [homepage](https://github.com/es128/glob-parent) -* [glob-path-regex](https://www.npmjs.com/package/glob-path-regex): Regular expression for matching the parts of glob pattern. | [homepage](https://github.com/regexps/glob-path-regex) -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern. | [homepage](https://github.com/jonschlinkert/is-glob) -* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just… [more](https://www.npmjs.com/package/micromatch) | [homepage](https://github.com/jonschlinkert/micromatch) - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/parse-glob/issues/new). - -## Tests - -Install dev dependencies: - -```sh -$ npm i -d && npm test -``` - -## Author - -**Jon Schlinkert** - -+ [github/jonschlinkert](https://github.com/jonschlinkert) -+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2014-2015 Jon Schlinkert -Released under the MIT license. - -*** - -_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on September 22, 2015._ \ No newline at end of file diff --git a/node_modules/parse-glob/index.js b/node_modules/parse-glob/index.js deleted file mode 100644 index 4ab691afc..000000000 --- a/node_modules/parse-glob/index.js +++ /dev/null @@ -1,156 +0,0 @@ -/*! - * parse-glob - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var isGlob = require('is-glob'); -var findBase = require('glob-base'); -var extglob = require('is-extglob'); -var dotfile = require('is-dotfile'); - -/** - * Expose `cache` - */ - -var cache = module.exports.cache = {}; - -/** - * Parse a glob pattern into tokens. - * - * When no paths or '**' are in the glob, we use a - * different strategy for parsing the filename, since - * file names can contain braces and other difficult - * patterns. such as: - * - * - `*.{a,b}` - * - `(**|*.js)` - */ - -module.exports = function parseGlob(glob) { - if (cache.hasOwnProperty(glob)) { - return cache[glob]; - } - - var tok = {}; - tok.orig = glob; - tok.is = {}; - - // unescape dots and slashes in braces/brackets - glob = escape(glob); - - var parsed = findBase(glob); - tok.is.glob = parsed.isGlob; - - tok.glob = parsed.glob; - tok.base = parsed.base; - var segs = /([^\/]*)$/.exec(glob); - - tok.path = {}; - tok.path.dirname = ''; - tok.path.basename = segs[1] || ''; - tok.path.dirname = glob.split(tok.path.basename).join('') || ''; - var basename = (tok.path.basename || '').split('.') || ''; - tok.path.filename = basename[0] || ''; - tok.path.extname = basename.slice(1).join('.') || ''; - tok.path.ext = ''; - - if (isGlob(tok.path.dirname) && !tok.path.basename) { - if (!/\/$/.test(tok.glob)) { - tok.path.basename = tok.glob; - } - tok.path.dirname = tok.base; - } - - if (glob.indexOf('/') === -1 && !tok.is.globstar) { - tok.path.dirname = ''; - tok.path.basename = tok.orig; - } - - var dot = tok.path.basename.indexOf('.'); - if (dot !== -1) { - tok.path.filename = tok.path.basename.slice(0, dot); - tok.path.extname = tok.path.basename.slice(dot); - } - - if (tok.path.extname.charAt(0) === '.') { - var exts = tok.path.extname.split('.'); - tok.path.ext = exts[exts.length - 1]; - } - - // unescape dots and slashes in braces/brackets - tok.glob = unescape(tok.glob); - tok.path.dirname = unescape(tok.path.dirname); - tok.path.basename = unescape(tok.path.basename); - tok.path.filename = unescape(tok.path.filename); - tok.path.extname = unescape(tok.path.extname); - - // Booleans - var is = (glob && tok.is.glob); - tok.is.negated = glob && glob.charAt(0) === '!'; - tok.is.extglob = glob && extglob(glob); - tok.is.braces = has(is, glob, '{'); - tok.is.brackets = has(is, glob, '[:'); - tok.is.globstar = has(is, glob, '**'); - tok.is.dotfile = dotfile(tok.path.basename) || dotfile(tok.path.filename); - tok.is.dotdir = dotdir(tok.path.dirname); - return (cache[glob] = tok); -} - -/** - * Returns true if the glob matches dot-directories. - * - * @param {Object} `tok` The tokens object - * @param {Object} `path` The path object - * @return {Object} - */ - -function dotdir(base) { - if (base.indexOf('/.') !== -1) { - return true; - } - if (base.charAt(0) === '.' && base.charAt(1) !== '/') { - return true; - } - return false; -} - -/** - * Returns true if the pattern has the given `ch`aracter(s) - * - * @param {Object} `glob` The glob pattern. - * @param {Object} `ch` The character to test for - * @return {Object} - */ - -function has(is, glob, ch) { - return is && glob.indexOf(ch) !== -1; -} - -/** - * Escape/unescape utils - */ - -function escape(str) { - var re = /\{([^{}]*?)}|\(([^()]*?)\)|\[([^\[\]]*?)\]/g; - return str.replace(re, function (outter, braces, parens, brackets) { - var inner = braces || parens || brackets; - if (!inner) { return outter; } - return outter.split(inner).join(esc(inner)); - }); -} - -function esc(str) { - str = str.split('/').join('__SLASH__'); - str = str.split('.').join('__DOT__'); - return str; -} - -function unescape(str) { - str = str.split('__SLASH__').join('/'); - str = str.split('__DOT__').join('.'); - return str; -} diff --git a/node_modules/parse-glob/package.json b/node_modules/parse-glob/package.json deleted file mode 100644 index 0e5a29821..000000000 --- a/node_modules/parse-glob/package.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "_from": "parse-glob@^3.0.4", - "_id": "parse-glob@3.0.4", - "_inBundle": false, - "_integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", - "_location": "/parse-glob", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "parse-glob@^3.0.4", - "name": "parse-glob", - "escapedName": "parse-glob", - "rawSpec": "^3.0.4", - "saveSpec": null, - "fetchSpec": "^3.0.4" - }, - "_requiredBy": [ - "/micromatch" - ], - "_resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "_shasum": "b2c376cfb11f35513badd173ef0bb6e3a388391c", - "_spec": "parse-glob@^3.0.4", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/micromatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/parse-glob/issues" - }, - "bundleDependencies": false, - "dependencies": { - "glob-base": "^0.3.0", - "is-dotfile": "^1.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.0" - }, - "deprecated": false, - "description": "Parse a glob pattern into an object of tokens.", - "devDependencies": { - "browserify": "^9.0.3", - "lodash": "^3.3.1", - "mocha": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/parse-glob", - "keywords": [ - "glob", - "match", - "bash", - "expand", - "expansion", - "expression", - "file", - "files", - "filter", - "find", - "glob", - "globbing", - "globs", - "globstar", - "match", - "matcher", - "matches", - "matching", - "path", - "pattern", - "patterns", - "regex", - "regexp", - "regular", - "shell", - "wildcard" - ], - "license": "MIT", - "main": "index.js", - "name": "parse-glob", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/parse-glob.git" - }, - "scripts": { - "prepublish": "browserify -o browser.js -e index.js", - "test": "mocha" - }, - "version": "3.0.4" -} diff --git a/node_modules/parse-ms/index.js b/node_modules/parse-ms/index.js deleted file mode 100644 index 838cb2ef0..000000000 --- a/node_modules/parse-ms/index.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; -module.exports = function (ms) { - if (typeof ms !== 'number') { - throw new TypeError('Expected a number'); - } - - var roundTowardZero = ms > 0 ? Math.floor : Math.ceil; - - return { - days: roundTowardZero(ms / 86400000), - hours: roundTowardZero(ms / 3600000) % 24, - minutes: roundTowardZero(ms / 60000) % 60, - seconds: roundTowardZero(ms / 1000) % 60, - milliseconds: roundTowardZero(ms) % 1000 - }; -}; diff --git a/node_modules/parse-ms/license b/node_modules/parse-ms/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/parse-ms/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/parse-ms/package.json b/node_modules/parse-ms/package.json deleted file mode 100644 index 3f5bda445..000000000 --- a/node_modules/parse-ms/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_from": "parse-ms@^1.0.0", - "_id": "parse-ms@1.0.1", - "_inBundle": false, - "_integrity": "sha1-VjRtR0nXjyNDDKDHE4UK75GqNh0=", - "_location": "/parse-ms", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "parse-ms@^1.0.0", - "name": "parse-ms", - "escapedName": "parse-ms", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/pretty-ms" - ], - "_resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-1.0.1.tgz", - "_shasum": "56346d4749d78f23430ca0c713850aef91aa361d", - "_spec": "parse-ms@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/pretty-ms", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/parse-ms/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Parse milliseconds into an object", - "devDependencies": { - "mocha": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/parse-ms#readme", - "keywords": [ - "browser", - "parse", - "time", - "ms", - "milliseconds", - "duration", - "period", - "range" - ], - "license": "MIT", - "name": "parse-ms", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/parse-ms.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "1.0.1" -} diff --git a/node_modules/parse-ms/readme.md b/node_modules/parse-ms/readme.md deleted file mode 100644 index 6e907d32e..000000000 --- a/node_modules/parse-ms/readme.md +++ /dev/null @@ -1,23 +0,0 @@ -# parse-ms [![Build Status](https://travis-ci.org/sindresorhus/parse-ms.svg?branch=master)](https://travis-ci.org/sindresorhus/parse-ms) - -> Parse milliseconds into an object - - -## Install - -```sh -$ npm install --save parse-ms -``` - - -## Usage - -```js -parseMs(1337000001); -//=> { days: 15, hours: 11, minutes: 23, seconds: 20, milliseconds: 1 } -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/parseurl/HISTORY.md b/node_modules/parseurl/HISTORY.md deleted file mode 100644 index 4803393a9..000000000 --- a/node_modules/parseurl/HISTORY.md +++ /dev/null @@ -1,53 +0,0 @@ -1.3.2 / 2017-09-09 -================== - - * perf: reduce overhead for full URLs - * perf: unroll the "fast-path" `RegExp` - -1.3.1 / 2016-01-17 -================== - - * perf: enable strict mode - -1.3.0 / 2014-08-09 -================== - - * Add `parseurl.original` for parsing `req.originalUrl` with fallback - * Return `undefined` if `req.url` is `undefined` - -1.2.0 / 2014-07-21 -================== - - * Cache URLs based on original value - * Remove no-longer-needed URL mis-parse work-around - * Simplify the "fast-path" `RegExp` - -1.1.3 / 2014-07-08 -================== - - * Fix typo - -1.1.2 / 2014-07-08 -================== - - * Seriously fix Node.js 0.8 compatibility - -1.1.1 / 2014-07-08 -================== - - * Fix Node.js 0.8 compatibility - -1.1.0 / 2014-07-08 -================== - - * Incorporate URL href-only parse fast-path - -1.0.1 / 2014-03-08 -================== - - * Add missing `require` - -1.0.0 / 2014-03-08 -================== - - * Genesis from `connect` diff --git a/node_modules/parseurl/LICENSE b/node_modules/parseurl/LICENSE deleted file mode 100644 index 27653d3db..000000000 --- a/node_modules/parseurl/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ - -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2014-2017 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/parseurl/README.md b/node_modules/parseurl/README.md deleted file mode 100644 index a5ccc51b0..000000000 --- a/node_modules/parseurl/README.md +++ /dev/null @@ -1,124 +0,0 @@ -# parseurl - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Parse a URL with memoization. - -## Install - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```sh -$ npm install parseurl -``` - -## API - -```js -var parseurl = require('parseurl') -``` - -### parseurl(req) - -Parse the URL of the given request object (looks at the `req.url` property) -and return the result. The result is the same as `url.parse` in Node.js core. -Calling this function multiple times on the same `req` where `req.url` does -not change will return a cached parsed object, rather than parsing again. - -### parseurl.original(req) - -Parse the original URL of the given request object and return the result. -This works by trying to parse `req.originalUrl` if it is a string, otherwise -parses `req.url`. The result is the same as `url.parse` in Node.js core. -Calling this function multiple times on the same `req` where `req.originalUrl` -does not change will return a cached parsed object, rather than parsing again. - -## Benchmark - -```bash -$ npm run-script bench - -> parseurl@1.3.2 bench nodejs-parseurl -> node benchmark/index.js - - http_parser@2.7.0 - node@4.8.4 - v8@4.5.103.47 - uv@1.9.1 - zlib@1.2.11 - ares@1.10.1-DEV - icu@56.1 - modules@46 - openssl@1.0.2k - -> node benchmark/fullurl.js - - Parsing URL "http://localhost:8888/foo/bar?user=tj&pet=fluffy" - - 3 tests completed. - - fasturl x 1,246,766 ops/sec ±0.74% (188 runs sampled) - nativeurl x 91,536 ops/sec ±0.54% (189 runs sampled) - parseurl x 90,645 ops/sec ±0.38% (189 runs sampled) - -> node benchmark/pathquery.js - - Parsing URL "/foo/bar?user=tj&pet=fluffy" - - 3 tests completed. - - fasturl x 2,077,650 ops/sec ±0.69% (186 runs sampled) - nativeurl x 638,669 ops/sec ±0.67% (189 runs sampled) - parseurl x 2,431,842 ops/sec ±0.71% (189 runs sampled) - -> node benchmark/samerequest.js - - Parsing URL "/foo/bar?user=tj&pet=fluffy" on same request object - - 3 tests completed. - - fasturl x 2,135,391 ops/sec ±0.69% (188 runs sampled) - nativeurl x 672,809 ops/sec ±3.83% (186 runs sampled) - parseurl x 11,604,947 ops/sec ±0.70% (189 runs sampled) - -> node benchmark/simplepath.js - - Parsing URL "/foo/bar" - - 3 tests completed. - - fasturl x 4,961,391 ops/sec ±0.97% (186 runs sampled) - nativeurl x 914,931 ops/sec ±0.83% (186 runs sampled) - parseurl x 7,559,196 ops/sec ±0.66% (188 runs sampled) - -> node benchmark/slash.js - - Parsing URL "/" - - 3 tests completed. - - fasturl x 4,053,379 ops/sec ±0.91% (187 runs sampled) - nativeurl x 963,999 ops/sec ±0.58% (189 runs sampled) - parseurl x 11,516,143 ops/sec ±0.58% (188 runs sampled) -``` - -## License - - [MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/parseurl.svg -[npm-url]: https://npmjs.org/package/parseurl -[node-version-image]: https://img.shields.io/node/v/parseurl.svg -[node-version-url]: https://nodejs.org/en/download/ -[travis-image]: https://img.shields.io/travis/pillarjs/parseurl/master.svg -[travis-url]: https://travis-ci.org/pillarjs/parseurl -[coveralls-image]: https://img.shields.io/coveralls/pillarjs/parseurl/master.svg -[coveralls-url]: https://coveralls.io/r/pillarjs/parseurl?branch=master -[downloads-image]: https://img.shields.io/npm/dm/parseurl.svg -[downloads-url]: https://npmjs.org/package/parseurl diff --git a/node_modules/parseurl/index.js b/node_modules/parseurl/index.js deleted file mode 100644 index 603eabe12..000000000 --- a/node_modules/parseurl/index.js +++ /dev/null @@ -1,154 +0,0 @@ -/*! - * parseurl - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2014-2017 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var url = require('url') -var parse = url.parse -var Url = url.Url - -/** - * Module exports. - * @public - */ - -module.exports = parseurl -module.exports.original = originalurl - -/** - * Parse the `req` url with memoization. - * - * @param {ServerRequest} req - * @return {Object} - * @public - */ - -function parseurl (req) { - var url = req.url - - if (url === undefined) { - // URL is undefined - return undefined - } - - var parsed = req._parsedUrl - - if (fresh(url, parsed)) { - // Return cached URL parse - return parsed - } - - // Parse the URL - parsed = fastparse(url) - parsed._raw = url - - return (req._parsedUrl = parsed) -}; - -/** - * Parse the `req` original url with fallback and memoization. - * - * @param {ServerRequest} req - * @return {Object} - * @public - */ - -function originalurl (req) { - var url = req.originalUrl - - if (typeof url !== 'string') { - // Fallback - return parseurl(req) - } - - var parsed = req._parsedOriginalUrl - - if (fresh(url, parsed)) { - // Return cached URL parse - return parsed - } - - // Parse the URL - parsed = fastparse(url) - parsed._raw = url - - return (req._parsedOriginalUrl = parsed) -}; - -/** - * Parse the `str` url with fast-path short-cut. - * - * @param {string} str - * @return {Object} - * @private - */ - -function fastparse (str) { - if (typeof str !== 'string' || str.charCodeAt(0) !== 0x2f /* / */) { - return parse(str) - } - - var pathname = str - var query = null - var search = null - - // This takes the regexp from https://github.com/joyent/node/pull/7878 - // Which is /^(\/[^?#\s]*)(\?[^#\s]*)?$/ - // And unrolls it into a for loop - for (var i = 1; i < str.length; i++) { - switch (str.charCodeAt(i)) { - case 0x3f: /* ? */ - if (search === null) { - pathname = str.substring(0, i) - query = str.substring(i + 1) - search = str.substring(i) - } - break - case 0x09: /* \t */ - case 0x0a: /* \n */ - case 0x0c: /* \f */ - case 0x0d: /* \r */ - case 0x20: /* */ - case 0x23: /* # */ - case 0xa0: - case 0xfeff: - return parse(str) - } - } - - var url = Url !== undefined - ? new Url() - : {} - url.path = str - url.href = str - url.pathname = pathname - url.query = query - url.search = search - - return url -} - -/** - * Determine if parsed is still fresh for url. - * - * @param {string} url - * @param {object} parsedUrl - * @return {boolean} - * @private - */ - -function fresh (url, parsedUrl) { - return typeof parsedUrl === 'object' && - parsedUrl !== null && - (Url === undefined || parsedUrl instanceof Url) && - parsedUrl._raw === url -} diff --git a/node_modules/parseurl/package.json b/node_modules/parseurl/package.json deleted file mode 100644 index 5dfa1b3f9..000000000 --- a/node_modules/parseurl/package.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "_from": "parseurl@~1.3.2", - "_id": "parseurl@1.3.2", - "_inBundle": false, - "_integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=", - "_location": "/parseurl", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "parseurl@~1.3.2", - "name": "parseurl", - "escapedName": "parseurl", - "rawSpec": "~1.3.2", - "saveSpec": null, - "fetchSpec": "~1.3.2" - }, - "_requiredBy": [ - "/serve-static" - ], - "_resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", - "_shasum": "fc289d4ed8993119460c156253262cdc8de65bf3", - "_spec": "parseurl@~1.3.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/serve-static", - "bugs": { - "url": "https://github.com/pillarjs/parseurl/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - }, - { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com" - } - ], - "deprecated": false, - "description": "parse a url with memoization", - "devDependencies": { - "beautify-benchmark": "0.2.4", - "benchmark": "2.1.4", - "eslint": "3.19.0", - "eslint-config-standard": "10.2.1", - "eslint-plugin-import": "2.7.0", - "eslint-plugin-node": "5.1.1", - "eslint-plugin-promise": "3.5.0", - "eslint-plugin-standard": "3.0.1", - "fast-url-parser": "1.1.3", - "istanbul": "0.4.5", - "mocha": "2.5.3" - }, - "engines": { - "node": ">= 0.8" - }, - "files": [ - "LICENSE", - "HISTORY.md", - "README.md", - "index.js" - ], - "homepage": "https://github.com/pillarjs/parseurl#readme", - "license": "MIT", - "name": "parseurl", - "repository": { - "type": "git", - "url": "git+https://github.com/pillarjs/parseurl.git" - }, - "scripts": { - "bench": "node benchmark/index.js", - "lint": "eslint .", - "test": "mocha --check-leaks --bail --reporter spec test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec test/" - }, - "version": "1.3.2" -} diff --git a/node_modules/pascalcase/LICENSE b/node_modules/pascalcase/LICENSE deleted file mode 100644 index 65f90aca8..000000000 --- a/node_modules/pascalcase/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/pascalcase/README.md b/node_modules/pascalcase/README.md deleted file mode 100644 index fa3fd00fe..000000000 --- a/node_modules/pascalcase/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# pascalcase [![NPM version](https://badge.fury.io/js/pascalcase.svg)](http://badge.fury.io/js/pascalcase) - -> Convert a string to pascal-case. - -## Install - -Install with [npm](https://www.npmjs.com/) - -```sh -$ npm i pascalcase --save -``` - -## Usage - -```js -var pascalcase = require('pascalcase'); - -pascalcase('a'); -//=> 'A' - -pascalcase('foo bar baz'); -//=> 'FooBarBaz' - -pascalcase('foo_bar-baz'); -//=> 'FooBarBaz' - -pascalcase('foo.bar.baz'); -//=> 'FooBarBaz' - -pascalcase('foo/bar/baz'); -//=> 'FooBarBaz' - -pascalcase('foo[bar)baz'); -//=> 'FooBarBaz' - -pascalcase('#foo+bar*baz'); -//=> 'FooBarBaz' - -pascalcase('$foo~bar`baz'); -//=> 'FooBarBaz' - -pascalcase('_foo_bar-baz-'); -//=> 'FooBarBaz' -``` - -## Related projects - -* [justified](https://github.com/jonschlinkert/justified): Wrap words to a specified length and justified the text. -* [pad-left](https://github.com/jonschlinkert/pad-left): Left pad a string with zeros or a specified string. Fastest implementation. -* [pad-right](https://github.com/jonschlinkert/pad-right): Right pad a string with zeros or a specified string. Fastest implementation. -* [repeat-string](https://github.com/jonschlinkert/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string. -* [word-wrap](https://github.com/jonschlinkert/word-wrap): Wrap words to a specified length. - -## Running tests - -Install dev dependencies: - -```sh -$ npm i -d && npm test -``` - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/pascalcase/issues/new) - -## Author - -**Jon Schlinkert** - -+ [github/jonschlinkert](https://github.com/jonschlinkert) -+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2015 Jon Schlinkert -Released under the MIT license. - -*** - -_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 19, 2015._ \ No newline at end of file diff --git a/node_modules/pascalcase/index.js b/node_modules/pascalcase/index.js deleted file mode 100644 index 7e8159ce4..000000000 --- a/node_modules/pascalcase/index.js +++ /dev/null @@ -1,21 +0,0 @@ -/*! - * pascalcase - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -function pascalcase(str) { - if (typeof str !== 'string') { - throw new TypeError('expected a string.'); - } - str = str.replace(/([A-Z])/g, ' $1'); - if (str.length === 1) { return str.toUpperCase(); } - str = str.replace(/^[\W_]+|[\W_]+$/g, '').toLowerCase(); - str = str.charAt(0).toUpperCase() + str.slice(1); - return str.replace(/[\W_]+(\w|$)/g, function (_, ch) { - return ch.toUpperCase(); - }); -} - -module.exports = pascalcase; diff --git a/node_modules/pascalcase/package.json b/node_modules/pascalcase/package.json deleted file mode 100644 index 8abd29599..000000000 --- a/node_modules/pascalcase/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_from": "pascalcase@^0.1.1", - "_id": "pascalcase@0.1.1", - "_inBundle": false, - "_integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "_location": "/pascalcase", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "pascalcase@^0.1.1", - "name": "pascalcase", - "escapedName": "pascalcase", - "rawSpec": "^0.1.1", - "saveSpec": null, - "fetchSpec": "^0.1.1" - }, - "_requiredBy": [ - "/base" - ], - "_resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "_shasum": "b363e55e8006ca6fe21784d2db22bd15d7917f14", - "_spec": "pascalcase@^0.1.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/base", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/pascalcase/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Convert a string to pascal-case.", - "devDependencies": { - "mocha": "*", - "should": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/pascalcase", - "keywords": [ - "camelcase", - "case", - "casing", - "pascal", - "pascal-case", - "pascalcase", - "string" - ], - "license": "MIT", - "main": "index.js", - "name": "pascalcase", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/pascalcase.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "pad-left", - "pad-right", - "word-wrap", - "repeat-string", - "justified" - ] - } - }, - "version": "0.1.1" -} diff --git a/node_modules/path-browserify/LICENSE b/node_modules/path-browserify/LICENSE deleted file mode 100644 index ee27ba4b4..000000000 --- a/node_modules/path-browserify/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/path-browserify/index.js b/node_modules/path-browserify/index.js deleted file mode 100644 index 208658a21..000000000 --- a/node_modules/path-browserify/index.js +++ /dev/null @@ -1,302 +0,0 @@ -// .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); - } -; diff --git a/node_modules/path-browserify/package.json b/node_modules/path-browserify/package.json deleted file mode 100644 index 004e0cc97..000000000 --- a/node_modules/path-browserify/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "_from": "path-browserify@~0.0.0", - "_id": "path-browserify@0.0.1", - "_inBundle": false, - "_integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", - "_location": "/path-browserify", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "path-browserify@~0.0.0", - "name": "path-browserify", - "escapedName": "path-browserify", - "rawSpec": "~0.0.0", - "saveSpec": null, - "fetchSpec": "~0.0.0" - }, - "_requiredBy": [ - "/browserify" - ], - "_resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", - "_shasum": "e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a", - "_spec": "path-browserify@~0.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/path-browserify/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "the path module from node core for browsers", - "devDependencies": { - "tape": "~1.0.4" - }, - "homepage": "https://github.com/substack/path-browserify", - "keywords": [ - "path", - "browser", - "browserify" - ], - "license": "MIT", - "main": "index.js", - "name": "path-browserify", - "repository": { - "type": "git", - "url": "git://github.com/substack/path-browserify.git" - }, - "scripts": { - "test": "node test/test-path.js" - }, - "version": "0.0.1" -} diff --git a/node_modules/path-browserify/readme.markdown b/node_modules/path-browserify/readme.markdown deleted file mode 100644 index 8ae1dd89e..000000000 --- a/node_modules/path-browserify/readme.markdown +++ /dev/null @@ -1,3 +0,0 @@ -# path-browserify - -the path module from node core for browsers diff --git a/node_modules/path-browserify/test/test-path.js b/node_modules/path-browserify/test/test-path.js deleted file mode 100644 index 29496e43e..000000000 --- a/node_modules/path-browserify/test/test-path.js +++ /dev/null @@ -1,424 +0,0 @@ -// 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 assert = require('assert'); - -var path = require('.'); - -var isWindows = process.platform === 'win32'; - -// Mock the node.js path -var f = __dirname + '/simple/test-path.js'; - -assert.equal(path.basename(f), 'test-path.js'); -assert.equal(path.basename(f, '.js'), 'test-path'); -assert.equal(path.basename(''), ''); -assert.equal(path.basename('/dir/basename.ext'), 'basename.ext'); -assert.equal(path.basename('/basename.ext'), 'basename.ext'); -assert.equal(path.basename('basename.ext'), 'basename.ext'); -assert.equal(path.basename('basename.ext/'), 'basename.ext'); -assert.equal(path.basename('basename.ext//'), 'basename.ext'); - -if (isWindows) { - // On Windows a backslash acts as a path separator. - assert.equal(path.basename('\\dir\\basename.ext'), 'basename.ext'); - assert.equal(path.basename('\\basename.ext'), 'basename.ext'); - assert.equal(path.basename('basename.ext'), 'basename.ext'); - assert.equal(path.basename('basename.ext\\'), 'basename.ext'); - assert.equal(path.basename('basename.ext\\\\'), 'basename.ext'); - -} else { - // On unix a backslash is just treated as any other character. - assert.equal(path.basename('\\dir\\basename.ext'), '\\dir\\basename.ext'); - assert.equal(path.basename('\\basename.ext'), '\\basename.ext'); - assert.equal(path.basename('basename.ext'), 'basename.ext'); - assert.equal(path.basename('basename.ext\\'), 'basename.ext\\'); - assert.equal(path.basename('basename.ext\\\\'), 'basename.ext\\\\'); -} - -// POSIX filenames may include control characters -// c.f. http://www.dwheeler.com/essays/fixing-unix-linux-filenames.html -if (!isWindows) { - var controlCharFilename = 'Icon' + String.fromCharCode(13); - assert.equal(path.basename('/a/b/' + controlCharFilename), - controlCharFilename); -} - -assert.equal(path.extname(f), '.js'); - -assert.equal(path.dirname(f).substr(-11), - isWindows ? 'test\\simple' : 'test/simple'); -assert.equal(path.dirname('/a/b/'), '/a'); -assert.equal(path.dirname('/a/b'), '/a'); -assert.equal(path.dirname('/a'), '/'); -assert.equal(path.dirname(''), '.'); -assert.equal(path.dirname('/'), '/'); -assert.equal(path.dirname('////'), '/'); - -if (isWindows) { - assert.equal(path.dirname('c:\\'), 'c:\\'); - assert.equal(path.dirname('c:\\foo'), 'c:\\'); - assert.equal(path.dirname('c:\\foo\\'), 'c:\\'); - assert.equal(path.dirname('c:\\foo\\bar'), 'c:\\foo'); - assert.equal(path.dirname('c:\\foo\\bar\\'), 'c:\\foo'); - assert.equal(path.dirname('c:\\foo\\bar\\baz'), 'c:\\foo\\bar'); - assert.equal(path.dirname('\\'), '\\'); - assert.equal(path.dirname('\\foo'), '\\'); - assert.equal(path.dirname('\\foo\\'), '\\'); - assert.equal(path.dirname('\\foo\\bar'), '\\foo'); - assert.equal(path.dirname('\\foo\\bar\\'), '\\foo'); - assert.equal(path.dirname('\\foo\\bar\\baz'), '\\foo\\bar'); - assert.equal(path.dirname('c:'), 'c:'); - assert.equal(path.dirname('c:foo'), 'c:'); - assert.equal(path.dirname('c:foo\\'), 'c:'); - assert.equal(path.dirname('c:foo\\bar'), 'c:foo'); - assert.equal(path.dirname('c:foo\\bar\\'), 'c:foo'); - assert.equal(path.dirname('c:foo\\bar\\baz'), 'c:foo\\bar'); - assert.equal(path.dirname('\\\\unc\\share'), '\\\\unc\\share'); - assert.equal(path.dirname('\\\\unc\\share\\foo'), '\\\\unc\\share\\'); - assert.equal(path.dirname('\\\\unc\\share\\foo\\'), '\\\\unc\\share\\'); - assert.equal(path.dirname('\\\\unc\\share\\foo\\bar'), - '\\\\unc\\share\\foo'); - assert.equal(path.dirname('\\\\unc\\share\\foo\\bar\\'), - '\\\\unc\\share\\foo'); - assert.equal(path.dirname('\\\\unc\\share\\foo\\bar\\baz'), - '\\\\unc\\share\\foo\\bar'); -} - - -assert.equal(path.extname(''), ''); -assert.equal(path.extname('/path/to/file'), ''); -assert.equal(path.extname('/path/to/file.ext'), '.ext'); -assert.equal(path.extname('/path.to/file.ext'), '.ext'); -assert.equal(path.extname('/path.to/file'), ''); -assert.equal(path.extname('/path.to/.file'), ''); -assert.equal(path.extname('/path.to/.file.ext'), '.ext'); -assert.equal(path.extname('/path/to/f.ext'), '.ext'); -assert.equal(path.extname('/path/to/..ext'), '.ext'); -assert.equal(path.extname('file'), ''); -assert.equal(path.extname('file.ext'), '.ext'); -assert.equal(path.extname('.file'), ''); -assert.equal(path.extname('.file.ext'), '.ext'); -assert.equal(path.extname('/file'), ''); -assert.equal(path.extname('/file.ext'), '.ext'); -assert.equal(path.extname('/.file'), ''); -assert.equal(path.extname('/.file.ext'), '.ext'); -assert.equal(path.extname('.path/file.ext'), '.ext'); -assert.equal(path.extname('file.ext.ext'), '.ext'); -assert.equal(path.extname('file.'), '.'); -assert.equal(path.extname('.'), ''); -assert.equal(path.extname('./'), ''); -assert.equal(path.extname('.file.ext'), '.ext'); -assert.equal(path.extname('.file'), ''); -assert.equal(path.extname('.file.'), '.'); -assert.equal(path.extname('.file..'), '.'); -assert.equal(path.extname('..'), ''); -assert.equal(path.extname('../'), ''); -assert.equal(path.extname('..file.ext'), '.ext'); -assert.equal(path.extname('..file'), '.file'); -assert.equal(path.extname('..file.'), '.'); -assert.equal(path.extname('..file..'), '.'); -assert.equal(path.extname('...'), '.'); -assert.equal(path.extname('...ext'), '.ext'); -assert.equal(path.extname('....'), '.'); -assert.equal(path.extname('file.ext/'), '.ext'); -assert.equal(path.extname('file.ext//'), '.ext'); -assert.equal(path.extname('file/'), ''); -assert.equal(path.extname('file//'), ''); -assert.equal(path.extname('file./'), '.'); -assert.equal(path.extname('file.//'), '.'); - -if (isWindows) { - // On windows, backspace is a path separator. - assert.equal(path.extname('.\\'), ''); - assert.equal(path.extname('..\\'), ''); - assert.equal(path.extname('file.ext\\'), '.ext'); - assert.equal(path.extname('file.ext\\\\'), '.ext'); - assert.equal(path.extname('file\\'), ''); - assert.equal(path.extname('file\\\\'), ''); - assert.equal(path.extname('file.\\'), '.'); - assert.equal(path.extname('file.\\\\'), '.'); - -} else { - // On unix, backspace is a valid name component like any other character. - assert.equal(path.extname('.\\'), ''); - assert.equal(path.extname('..\\'), '.\\'); - assert.equal(path.extname('file.ext\\'), '.ext\\'); - assert.equal(path.extname('file.ext\\\\'), '.ext\\\\'); - assert.equal(path.extname('file\\'), ''); - assert.equal(path.extname('file\\\\'), ''); - assert.equal(path.extname('file.\\'), '.\\'); - assert.equal(path.extname('file.\\\\'), '.\\\\'); -} - -// path.join tests -var failures = []; -var joinTests = - // arguments result - [[['.', 'x/b', '..', '/b/c.js'], 'x/b/c.js'], - [['/.', 'x/b', '..', '/b/c.js'], '/x/b/c.js'], - [['/foo', '../../../bar'], '/bar'], - [['foo', '../../../bar'], '../../bar'], - [['foo/', '../../../bar'], '../../bar'], - [['foo/x', '../../../bar'], '../bar'], - [['foo/x', './bar'], 'foo/x/bar'], - [['foo/x/', './bar'], 'foo/x/bar'], - [['foo/x/', '.', 'bar'], 'foo/x/bar'], - [['./'], './'], - [['.', './'], './'], - [['.', '.', '.'], '.'], - [['.', './', '.'], '.'], - [['.', '/./', '.'], '.'], - [['.', '/////./', '.'], '.'], - [['.'], '.'], - [['', '.'], '.'], - [['', 'foo'], 'foo'], - [['foo', '/bar'], 'foo/bar'], - [['', '/foo'], '/foo'], - [['', '', '/foo'], '/foo'], - [['', '', 'foo'], 'foo'], - [['foo', ''], 'foo'], - [['foo/', ''], 'foo/'], - [['foo', '', '/bar'], 'foo/bar'], - [['./', '..', '/foo'], '../foo'], - [['./', '..', '..', '/foo'], '../../foo'], - [['.', '..', '..', '/foo'], '../../foo'], - [['', '..', '..', '/foo'], '../../foo'], - [['/'], '/'], - [['/', '.'], '/'], - [['/', '..'], '/'], - [['/', '..', '..'], '/'], - [[''], '.'], - [['', ''], '.'], - [[' /foo'], ' /foo'], - [[' ', 'foo'], ' /foo'], - [[' ', '.'], ' '], - [[' ', '/'], ' /'], - [[' ', ''], ' '], - [['/', 'foo'], '/foo'], - [['/', '/foo'], '/foo'], - [['/', '//foo'], '/foo'], - [['/', '', '/foo'], '/foo'], - [['', '/', 'foo'], '/foo'], - [['', '/', '/foo'], '/foo'] - ]; - -// Windows-specific join tests -if (isWindows) { - joinTests = joinTests.concat( - [// UNC path expected - [['//foo/bar'], '//foo/bar/'], - [['\\/foo/bar'], '//foo/bar/'], - [['\\\\foo/bar'], '//foo/bar/'], - // UNC path expected - server and share separate - [['//foo', 'bar'], '//foo/bar/'], - [['//foo/', 'bar'], '//foo/bar/'], - [['//foo', '/bar'], '//foo/bar/'], - // UNC path expected - questionable - [['//foo', '', 'bar'], '//foo/bar/'], - [['//foo/', '', 'bar'], '//foo/bar/'], - [['//foo/', '', '/bar'], '//foo/bar/'], - // UNC path expected - even more questionable - [['', '//foo', 'bar'], '//foo/bar/'], - [['', '//foo/', 'bar'], '//foo/bar/'], - [['', '//foo/', '/bar'], '//foo/bar/'], - // No UNC path expected (no double slash in first component) - [['\\', 'foo/bar'], '/foo/bar'], - [['\\', '/foo/bar'], '/foo/bar'], - [['', '/', '/foo/bar'], '/foo/bar'], - // No UNC path expected (no non-slashes in first component - questionable) - [['//', 'foo/bar'], '/foo/bar'], - [['//', '/foo/bar'], '/foo/bar'], - [['\\\\', '/', '/foo/bar'], '/foo/bar'], - [['//'], '/'], - // No UNC path expected (share name missing - questionable). - [['//foo'], '/foo'], - [['//foo/'], '/foo/'], - [['//foo', '/'], '/foo/'], - [['//foo', '', '/'], '/foo/'], - // No UNC path expected (too many leading slashes - questionable) - [['///foo/bar'], '/foo/bar'], - [['////foo', 'bar'], '/foo/bar'], - [['\\\\\\/foo/bar'], '/foo/bar'], - // Drive-relative vs drive-absolute paths. This merely describes the - // status quo, rather than being obviously right - [['c:'], 'c:.'], - [['c:.'], 'c:.'], - [['c:', ''], 'c:.'], - [['', 'c:'], 'c:.'], - [['c:.', '/'], 'c:./'], - [['c:.', 'file'], 'c:file'], - [['c:', '/'], 'c:/'], - [['c:', 'file'], 'c:/file'] - ]); -} - -// Run the join tests. -joinTests.forEach(function(test) { - var actual = path.join.apply(path, test[0]); - var expected = isWindows ? test[1].replace(/\//g, '\\') : test[1]; - var message = 'path.join(' + test[0].map(JSON.stringify).join(',') + ')' + - '\n expect=' + JSON.stringify(expected) + - '\n actual=' + JSON.stringify(actual); - if (actual !== expected) failures.push('\n' + message); - // assert.equal(actual, expected, message); -}); -assert.equal(failures.length, 0, failures.join('')); -var joinThrowTests = [true, false, 7, null, {}, undefined, [], NaN]; -joinThrowTests.forEach(function(test) { - assert.throws(function() { - path.join(test); - }, TypeError); - assert.throws(function() { - path.resolve(test); - }, TypeError); -}); - - -// path normalize tests -if (isWindows) { - assert.equal(path.normalize('./fixtures///b/../b/c.js'), - 'fixtures\\b\\c.js'); - assert.equal(path.normalize('/foo/../../../bar'), '\\bar'); - assert.equal(path.normalize('a//b//../b'), 'a\\b'); - assert.equal(path.normalize('a//b//./c'), 'a\\b\\c'); - assert.equal(path.normalize('a//b//.'), 'a\\b'); - assert.equal(path.normalize('//server/share/dir/file.ext'), - '\\\\server\\share\\dir\\file.ext'); -} else { - assert.equal(path.normalize('./fixtures///b/../b/c.js'), - 'fixtures/b/c.js'); - assert.equal(path.normalize('/foo/../../../bar'), '/bar'); - assert.equal(path.normalize('a//b//../b'), 'a/b'); - assert.equal(path.normalize('a//b//./c'), 'a/b/c'); - assert.equal(path.normalize('a//b//.'), 'a/b'); -} - -// path.resolve tests -if (isWindows) { - // windows - var resolveTests = - // arguments result - [[['c:/blah\\blah', 'd:/games', 'c:../a'], 'c:\\blah\\a'], - [['c:/ignore', 'd:\\a/b\\c/d', '\\e.exe'], 'd:\\e.exe'], - [['c:/ignore', 'c:/some/file'], 'c:\\some\\file'], - [['d:/ignore', 'd:some/dir//'], 'd:\\ignore\\some\\dir'], - [['.'], process.cwd()], - [['//server/share', '..', 'relative\\'], '\\\\server\\share\\relative'], - [['c:/', '//'], 'c:\\'], - [['c:/', '//dir'], 'c:\\dir'], - [['c:/', '//server/share'], '\\\\server\\share\\'], - [['c:/', '//server//share'], '\\\\server\\share\\'], - [['c:/', '///some//dir'], 'c:\\some\\dir'] - ]; -} else { - // Posix - var resolveTests = - // arguments result - [[['/var/lib', '../', 'file/'], '/var/file'], - [['/var/lib', '/../', 'file/'], '/file'], - [['a/b/c/', '../../..'], process.cwd()], - [['.'], process.cwd()], - [['/some/dir', '.', '/absolute/'], '/absolute']]; -} -var failures = []; -resolveTests.forEach(function(test) { - var actual = path.resolve.apply(path, test[0]); - var expected = test[1]; - var message = 'path.resolve(' + test[0].map(JSON.stringify).join(',') + ')' + - '\n expect=' + JSON.stringify(expected) + - '\n actual=' + JSON.stringify(actual); - if (actual !== expected) failures.push('\n' + message); - // assert.equal(actual, expected, message); -}); -assert.equal(failures.length, 0, failures.join('')); - -// path.isAbsolute tests -if (isWindows) { - assert.equal(path.isAbsolute('//server/file'), true); - assert.equal(path.isAbsolute('\\\\server\\file'), true); - assert.equal(path.isAbsolute('C:/Users/'), true); - assert.equal(path.isAbsolute('C:\\Users\\'), true); - assert.equal(path.isAbsolute('C:cwd/another'), false); - assert.equal(path.isAbsolute('C:cwd\\another'), false); - assert.equal(path.isAbsolute('directory/directory'), false); - assert.equal(path.isAbsolute('directory\\directory'), false); -} else { - assert.equal(path.isAbsolute('/home/foo'), true); - assert.equal(path.isAbsolute('/home/foo/..'), true); - assert.equal(path.isAbsolute('bar/'), false); - assert.equal(path.isAbsolute('./baz'), false); -} - -// path.relative tests -if (isWindows) { - // windows - var relativeTests = - // arguments result - [['c:/blah\\blah', 'd:/games', 'd:\\games'], - ['c:/aaaa/bbbb', 'c:/aaaa', '..'], - ['c:/aaaa/bbbb', 'c:/cccc', '..\\..\\cccc'], - ['c:/aaaa/bbbb', 'c:/aaaa/bbbb', ''], - ['c:/aaaa/bbbb', 'c:/aaaa/cccc', '..\\cccc'], - ['c:/aaaa/', 'c:/aaaa/cccc', 'cccc'], - ['c:/', 'c:\\aaaa\\bbbb', 'aaaa\\bbbb'], - ['c:/aaaa/bbbb', 'd:\\', 'd:\\']]; -} else { - // posix - var relativeTests = - // arguments result - [['/var/lib', '/var', '..'], - ['/var/lib', '/bin', '../../bin'], - ['/var/lib', '/var/lib', ''], - ['/var/lib', '/var/apache', '../apache'], - ['/var/', '/var/lib', 'lib'], - ['/', '/var/lib', 'var/lib']]; -} -var failures = []; -relativeTests.forEach(function(test) { - var actual = path.relative(test[0], test[1]); - var expected = test[2]; - var message = 'path.relative(' + - test.slice(0, 2).map(JSON.stringify).join(',') + - ')' + - '\n expect=' + JSON.stringify(expected) + - '\n actual=' + JSON.stringify(actual); - if (actual !== expected) failures.push('\n' + message); -}); -assert.equal(failures.length, 0, failures.join('')); - -// path.sep tests -if (isWindows) { - // windows - assert.equal(path.sep, '\\'); -} else { - // posix - assert.equal(path.sep, '/'); -} - -// path.delimiter tests -if (isWindows) { - // windows - assert.equal(path.delimiter, ';'); -} else { - // posix - assert.equal(path.delimiter, ':'); -} diff --git a/node_modules/path-is-absolute/index.js b/node_modules/path-is-absolute/index.js deleted file mode 100644 index 22aa6c356..000000000 --- a/node_modules/path-is-absolute/index.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -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; diff --git a/node_modules/path-is-absolute/license b/node_modules/path-is-absolute/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/path-is-absolute/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/path-is-absolute/package.json b/node_modules/path-is-absolute/package.json deleted file mode 100644 index 743b26d97..000000000 --- a/node_modules/path-is-absolute/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_from": "path-is-absolute@^1.0.1", - "_id": "path-is-absolute@1.0.1", - "_inBundle": false, - "_integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "_location": "/path-is-absolute", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "path-is-absolute@^1.0.1", - "name": "path-is-absolute", - "escapedName": "path-is-absolute", - "rawSpec": "^1.0.1", - "saveSpec": null, - "fetchSpec": "^1.0.1" - }, - "_requiredBy": [ - "/budo", - "/chokidar", - "/glob", - "/insert-module-globals" - ], - "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "_shasum": "174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f", - "_spec": "path-is-absolute@^1.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/path-is-absolute/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Node.js 0.12 path.isAbsolute() ponyfill", - "devDependencies": { - "xo": "^0.16.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/path-is-absolute#readme", - "keywords": [ - "path", - "paths", - "file", - "dir", - "absolute", - "isabsolute", - "is-absolute", - "built-in", - "util", - "utils", - "core", - "ponyfill", - "polyfill", - "shim", - "is", - "detect", - "check" - ], - "license": "MIT", - "name": "path-is-absolute", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/path-is-absolute.git" - }, - "scripts": { - "test": "xo && node test.js" - }, - "version": "1.0.1" -} diff --git a/node_modules/path-is-absolute/readme.md b/node_modules/path-is-absolute/readme.md deleted file mode 100644 index 8dbdf5fcb..000000000 --- a/node_modules/path-is-absolute/readme.md +++ /dev/null @@ -1,59 +0,0 @@ -# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) - -> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com) - - -## Install - -``` -$ npm install --save path-is-absolute -``` - - -## Usage - -```js -const pathIsAbsolute = require('path-is-absolute'); - -// Running on Linux -pathIsAbsolute('/home/foo'); -//=> true -pathIsAbsolute('C:/Users/foo'); -//=> false - -// Running on Windows -pathIsAbsolute('C:/Users/foo'); -//=> true -pathIsAbsolute('/home/foo'); -//=> false - -// Running on any OS -pathIsAbsolute.posix('/home/foo'); -//=> true -pathIsAbsolute.posix('C:/Users/foo'); -//=> false -pathIsAbsolute.win32('C:/Users/foo'); -//=> true -pathIsAbsolute.win32('/home/foo'); -//=> false -``` - - -## API - -See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). - -### pathIsAbsolute(path) - -### pathIsAbsolute.posix(path) - -POSIX specific version. - -### pathIsAbsolute.win32(path) - -Windows specific version. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/path-key/index.js b/node_modules/path-key/index.js deleted file mode 100644 index 62c8250ab..000000000 --- a/node_modules/path-key/index.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; -module.exports = opts => { - opts = opts || {}; - - const env = opts.env || process.env; - const platform = opts.platform || process.platform; - - if (platform !== 'win32') { - return 'PATH'; - } - - return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path'; -}; diff --git a/node_modules/path-key/license b/node_modules/path-key/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/path-key/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/path-key/package.json b/node_modules/path-key/package.json deleted file mode 100644 index b71aeddba..000000000 --- a/node_modules/path-key/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "_from": "path-key@^2.0.1", - "_id": "path-key@2.0.1", - "_inBundle": false, - "_integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "_location": "/path-key", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "path-key@^2.0.1", - "name": "path-key", - "escapedName": "path-key", - "rawSpec": "^2.0.1", - "saveSpec": null, - "fetchSpec": "^2.0.1" - }, - "_requiredBy": [ - "/cross-spawn", - "/npm-run-path" - ], - "_resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "_shasum": "411cadb574c5a140d3a4b1910d40d80cc9f40b40", - "_spec": "path-key@^2.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/cross-spawn", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/path-key/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Get the PATH environment variable key cross-platform", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/path-key#readme", - "keywords": [ - "path", - "key", - "environment", - "env", - "variable", - "var", - "get", - "cross-platform", - "windows" - ], - "license": "MIT", - "name": "path-key", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/path-key.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.0.1", - "xo": { - "esnext": true - } -} diff --git a/node_modules/path-key/readme.md b/node_modules/path-key/readme.md deleted file mode 100644 index cb5710aac..000000000 --- a/node_modules/path-key/readme.md +++ /dev/null @@ -1,51 +0,0 @@ -# path-key [![Build Status](https://travis-ci.org/sindresorhus/path-key.svg?branch=master)](https://travis-ci.org/sindresorhus/path-key) - -> Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform - -It's usually `PATH`, but on Windows it can be any casing like `Path`... - - -## Install - -``` -$ npm install --save path-key -``` - - -## Usage - -```js -const pathKey = require('path-key'); - -const key = pathKey(); -//=> 'PATH' - -const PATH = process.env[key]; -//=> '/usr/local/bin:/usr/bin:/bin' -``` - - -## API - -### pathKey([options]) - -#### options - -##### env - -Type: `Object`
    -Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env) - -Use a custom environment variables object. - -#### platform - -Type: `string`
    -Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform) - -Get the PATH key for a specific platform. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/path-parse/.travis.yml b/node_modules/path-parse/.travis.yml deleted file mode 100644 index dae31da96..000000000 --- a/node_modules/path-parse/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: node_js -node_js: - - "0.12" - - "0.11" - - "0.10" - - "0.10.12" - - "0.8" - - "0.6" - - "iojs" diff --git a/node_modules/path-parse/LICENSE b/node_modules/path-parse/LICENSE deleted file mode 100644 index 810f3dbea..000000000 --- a/node_modules/path-parse/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Javier Blanco - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/path-parse/README.md b/node_modules/path-parse/README.md deleted file mode 100644 index 05097f86a..000000000 --- a/node_modules/path-parse/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# path-parse [![Build Status](https://travis-ci.org/jbgutierrez/path-parse.svg?branch=master)](https://travis-ci.org/jbgutierrez/path-parse) - -> Node.js [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) [ponyfill](https://ponyfill.com). - -## Install - -``` -$ npm install --save path-parse -``` - -## Usage - -```js -var pathParse = require('path-parse'); - -pathParse('/home/user/dir/file.txt'); -//=> { -// root : "/", -// dir : "/home/user/dir", -// base : "file.txt", -// ext : ".txt", -// name : "file" -// } -``` - -## API - -See [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) docs. - -### pathParse(path) - -### pathParse.posix(path) - -The Posix specific version. - -### pathParse.win32(path) - -The Windows specific version. - -## License - -MIT © [Javier Blanco](http://jbgutierrez.info) diff --git a/node_modules/path-parse/index.js b/node_modules/path-parse/index.js deleted file mode 100644 index 3b7601fe4..000000000 --- a/node_modules/path-parse/index.js +++ /dev/null @@ -1,93 +0,0 @@ -'use strict'; - -var isWindows = process.platform === 'win32'; - -// Regex to split a windows path into three parts: [*, device, slash, -// tail] windows-only -var splitDeviceRe = - /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; - -// Regex to split the tail part of the above into [*, dir, basename, ext] -var splitTailRe = - /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/; - -var win32 = {}; - -// Function to split a filename into [root, dir, basename, ext] -function win32SplitPath(filename) { - // Separate device+slash from tail - var result = splitDeviceRe.exec(filename), - device = (result[1] || '') + (result[2] || ''), - tail = result[3] || ''; - // Split the tail into dir, basename and extension - var result2 = splitTailRe.exec(tail), - dir = result2[1], - basename = result2[2], - ext = result2[3]; - return [device, dir, basename, ext]; -} - -win32.parse = function(pathString) { - if (typeof pathString !== 'string') { - throw new TypeError( - "Parameter 'pathString' must be a string, not " + typeof pathString - ); - } - var allParts = win32SplitPath(pathString); - if (!allParts || allParts.length !== 4) { - throw new TypeError("Invalid path '" + pathString + "'"); - } - return { - root: allParts[0], - dir: allParts[0] + allParts[1].slice(0, -1), - base: allParts[2], - ext: allParts[3], - name: allParts[2].slice(0, allParts[2].length - allParts[3].length) - }; -}; - - - -// Split a filename into [root, dir, basename, ext], unix version -// 'root' is just a slash, or nothing. -var splitPathRe = - /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; -var posix = {}; - - -function posixSplitPath(filename) { - return splitPathRe.exec(filename).slice(1); -} - - -posix.parse = function(pathString) { - if (typeof pathString !== 'string') { - throw new TypeError( - "Parameter 'pathString' must be a string, not " + typeof pathString - ); - } - var allParts = posixSplitPath(pathString); - if (!allParts || allParts.length !== 4) { - throw new TypeError("Invalid path '" + pathString + "'"); - } - allParts[1] = allParts[1] || ''; - allParts[2] = allParts[2] || ''; - allParts[3] = allParts[3] || ''; - - return { - root: allParts[0], - dir: allParts[0] + allParts[1].slice(0, -1), - base: allParts[2], - ext: allParts[3], - name: allParts[2].slice(0, allParts[2].length - allParts[3].length) - }; -}; - - -if (isWindows) - module.exports = win32.parse; -else /* posix */ - module.exports = posix.parse; - -module.exports.posix = posix.parse; -module.exports.win32 = win32.parse; diff --git a/node_modules/path-parse/package.json b/node_modules/path-parse/package.json deleted file mode 100644 index 7116c65c0..000000000 --- a/node_modules/path-parse/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "_from": "path-parse@^1.0.5", - "_id": "path-parse@1.0.6", - "_inBundle": false, - "_integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "_location": "/path-parse", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "path-parse@^1.0.5", - "name": "path-parse", - "escapedName": "path-parse", - "rawSpec": "^1.0.5", - "saveSpec": null, - "fetchSpec": "^1.0.5" - }, - "_requiredBy": [ - "/resolve" - ], - "_resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "_shasum": "d62dbb5679405d72c4737ec58600e9ddcf06d24c", - "_spec": "path-parse@^1.0.5", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/resolve", - "author": { - "name": "Javier Blanco", - "email": "http://jbgutierrez.info" - }, - "bugs": { - "url": "https://github.com/jbgutierrez/path-parse/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Node.js path.parse() ponyfill", - "homepage": "https://github.com/jbgutierrez/path-parse#readme", - "keywords": [ - "path", - "paths", - "file", - "dir", - "parse", - "built-in", - "util", - "utils", - "core", - "ponyfill", - "polyfill", - "shim" - ], - "license": "MIT", - "main": "index.js", - "name": "path-parse", - "repository": { - "type": "git", - "url": "git+https://github.com/jbgutierrez/path-parse.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.0.6" -} diff --git a/node_modules/path-parse/test.js b/node_modules/path-parse/test.js deleted file mode 100644 index 0b30c1239..000000000 --- a/node_modules/path-parse/test.js +++ /dev/null @@ -1,77 +0,0 @@ -var assert = require('assert'); -var pathParse = require('./index'); - -var winParseTests = [ - [{ root: 'C:\\', dir: 'C:\\path\\dir', base: 'index.html', ext: '.html', name: 'index' }, 'C:\\path\\dir\\index.html'], - [{ root: 'C:\\', dir: 'C:\\another_path\\DIR\\1\\2\\33', base: 'index', ext: '', name: 'index' }, 'C:\\another_path\\DIR\\1\\2\\33\\index'], - [{ root: '', dir: 'another_path\\DIR with spaces\\1\\2\\33', base: 'index', ext: '', name: 'index' }, 'another_path\\DIR with spaces\\1\\2\\33\\index'], - [{ root: '\\', dir: '\\foo', base: 'C:', ext: '', name: 'C:' }, '\\foo\\C:'], - [{ root: '', dir: '', base: 'file', ext: '', name: 'file' }, 'file'], - [{ root: '', dir: '.', base: 'file', ext: '', name: 'file' }, '.\\file'], - - // unc - [{ root: '\\\\server\\share\\', dir: '\\\\server\\share\\', base: 'file_path', ext: '', name: 'file_path' }, '\\\\server\\share\\file_path'], - [{ root: '\\\\server two\\shared folder\\', dir: '\\\\server two\\shared folder\\', base: 'file path.zip', ext: '.zip', name: 'file path' }, '\\\\server two\\shared folder\\file path.zip'], - [{ root: '\\\\teela\\admin$\\', dir: '\\\\teela\\admin$\\', base: 'system32', ext: '', name: 'system32' }, '\\\\teela\\admin$\\system32'], - [{ root: '\\\\?\\UNC\\', dir: '\\\\?\\UNC\\server', base: 'share', ext: '', name: 'share' }, '\\\\?\\UNC\\server\\share'] -]; - -var winSpecialCaseFormatTests = [ - [{dir: 'some\\dir'}, 'some\\dir\\'], - [{base: 'index.html'}, 'index.html'], - [{}, ''] -]; - -var unixParseTests = [ - [{ root: '/', dir: '/home/user/dir', base: 'file.txt', ext: '.txt', name: 'file' }, '/home/user/dir/file.txt'], - [{ root: '/', dir: '/home/user/a dir', base: 'another File.zip', ext: '.zip', name: 'another File' }, '/home/user/a dir/another File.zip'], - [{ root: '/', dir: '/home/user/a dir/', base: 'another&File.', ext: '.', name: 'another&File' }, '/home/user/a dir//another&File.'], - [{ root: '/', dir: '/home/user/a$$$dir/', base: 'another File.zip', ext: '.zip', name: 'another File' }, '/home/user/a$$$dir//another File.zip'], - [{ root: '', dir: 'user/dir', base: 'another File.zip', ext: '.zip', name: 'another File' }, 'user/dir/another File.zip'], - [{ root: '', dir: '', base: 'file', ext: '', name: 'file' }, 'file'], - [{ root: '', dir: '', base: '.\\file', ext: '', name: '.\\file' }, '.\\file'], - [{ root: '', dir: '.', base: 'file', ext: '', name: 'file' }, './file'], - [{ root: '', dir: '', base: 'C:\\foo', ext: '', name: 'C:\\foo' }, 'C:\\foo'] -]; - -var unixSpecialCaseFormatTests = [ - [{dir: 'some/dir'}, 'some/dir/'], - [{base: 'index.html'}, 'index.html'], - [{}, ''] -]; - -var errors = [ - {input: null, message: /Parameter 'pathString' must be a string, not/}, - {input: {}, message: /Parameter 'pathString' must be a string, not object/}, - {input: true, message: /Parameter 'pathString' must be a string, not boolean/}, - {input: 1, message: /Parameter 'pathString' must be a string, not number/}, - {input: undefined, message: /Parameter 'pathString' must be a string, not undefined/}, -]; - -checkParseFormat(pathParse.win32, winParseTests); -checkParseFormat(pathParse.posix, unixParseTests); -checkErrors(pathParse.win32); -checkErrors(pathParse.posix); - -function checkErrors(parse) { - errors.forEach(function(errorCase) { - try { - parse(errorCase.input); - } catch(err) { - assert.ok(err instanceof TypeError); - assert.ok( - errorCase.message.test(err.message), - 'expected ' + errorCase.message + ' to match ' + err.message - ); - return; - } - - assert.fail('should have thrown'); - }); -} - -function checkParseFormat(parse, testCases) { - testCases.forEach(function(testCase) { - assert.deepEqual(parse(testCase[1]), testCase[0]); - }); -} diff --git a/node_modules/path-platform/LICENSE b/node_modules/path-platform/LICENSE deleted file mode 100644 index cfa529ec7..000000000 --- a/node_modules/path-platform/LICENSE +++ /dev/null @@ -1,3 +0,0 @@ -MIT -- see https://github.com/joyent/node for license - -This file is pulled directly from Node.js diff --git a/node_modules/path-platform/README.md b/node_modules/path-platform/README.md deleted file mode 100644 index 9892dbdcf..000000000 --- a/node_modules/path-platform/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# path-platform - -This is a transitional package for those not on 0.12 that provides a compatible -interface to the builtin `path` module, but adds `path.posix` and `path.win32` -so you can `path.posix.normalize` on a win32 platform, or vice versa. diff --git a/node_modules/path-platform/package.json b/node_modules/path-platform/package.json deleted file mode 100644 index 42342bd5e..000000000 --- a/node_modules/path-platform/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "_from": "path-platform@~0.11.15", - "_id": "path-platform@0.11.15", - "_inBundle": false, - "_integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=", - "_location": "/path-platform", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "path-platform@~0.11.15", - "name": "path-platform", - "escapedName": "path-platform", - "rawSpec": "~0.11.15", - "saveSpec": null, - "fetchSpec": "~0.11.15" - }, - "_requiredBy": [ - "/parents" - ], - "_resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", - "_shasum": "e864217f74c36850f0852b78dc7bf7d4a5721bf2", - "_spec": "path-platform@~0.11.15", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/parents", - "author": { - "name": "Timothy J Fontaine", - "email": "tjfontaine@gmail.com", - "url": "http://atxconsulting.com" - }, - "bugs": { - "url": "http://github.com/tjfontaine/node-path-platform/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Provide access to win32 and posix path operations; sourced directly from upstream Node.js", - "engines": { - "node": ">= 0.8.0" - }, - "homepage": "http://github.com/tjfontaine/node-path-platform", - "keywords": [ - "path", - "platform", - "posix", - "win32" - ], - "license": "MIT", - "main": "path.js", - "name": "path-platform", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/tjfontaine/node-path-platform.git" - }, - "version": "0.11.15" -} diff --git a/node_modules/path-platform/path.js b/node_modules/path-platform/path.js deleted file mode 100644 index 0a7a7075c..000000000 --- a/node_modules/path-platform/path.js +++ /dev/null @@ -1,643 +0,0 @@ -// 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 isWindows = process.platform === 'win32'; -var util = require('util'); - -var _path = require('path'); - -// we are new enough we already have this from the system, just export the -// system then -if (_path.posix) { - module.exports = _path; - return; -} - -// resolves . and .. elements in a path array with directory names there -// must be no slashes 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) { - var res = []; - for (var i = 0; i < parts.length; i++) { - var p = parts[i]; - - // ignore empty parts - if (!p || p === '.') - continue; - - if (p === '..') { - if (res.length && res[res.length - 1] !== '..') { - res.pop(); - } else if (allowAboveRoot) { - res.push('..'); - } - } else { - res.push(p); - } - } - - return res; -} - -// Regex to split a windows path into three parts: [*, device, slash, -// tail] windows-only -var splitDeviceRe = - /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; - -// Regex to split the tail part of the above into [*, dir, basename, ext] -var splitTailRe = - /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/; - -var win32 = {}; - -// Function to split a filename into [root, dir, basename, ext] -function win32SplitPath(filename) { - // Separate device+slash from tail - var result = splitDeviceRe.exec(filename), - device = (result[1] || '') + (result[2] || ''), - tail = result[3] || ''; - // Split the tail into dir, basename and extension - var result2 = splitTailRe.exec(tail), - dir = result2[1], - basename = result2[2], - ext = result2[3]; - return [device, dir, basename, ext]; -} - -var normalizeUNCRoot = function(device) { - return '\\\\' + device.replace(/^[\\\/]+/, '').replace(/[\\\/]+/g, '\\'); -}; - -// path.resolve([from ...], to) -win32.resolve = function() { - var resolvedDevice = '', - resolvedTail = '', - resolvedAbsolute = false; - - for (var i = arguments.length - 1; i >= -1; i--) { - var path; - if (i >= 0) { - path = arguments[i]; - } else if (!resolvedDevice) { - path = process.cwd(); - } else { - // Windows has the concept of drive-specific current working - // directories. If we've resolved a drive letter but not yet an - // absolute path, get cwd for that drive. We're sure the device is not - // an unc path at this points, because unc paths are always absolute. - path = process.env['=' + resolvedDevice]; - // Verify that a drive-local cwd was found and that it actually points - // to our drive. If not, default to the drive's root. - if (!path || path.substr(0, 3).toLowerCase() !== - resolvedDevice.toLowerCase() + '\\') { - path = resolvedDevice + '\\'; - } - } - - // Skip empty and invalid entries - if (!util.isString(path)) { - throw new TypeError('Arguments to path.resolve must be strings'); - } else if (!path) { - continue; - } - - var result = splitDeviceRe.exec(path), - device = result[1] || '', - isUnc = device && device.charAt(1) !== ':', - isAbsolute = win32.isAbsolute(path), - tail = result[3]; - - if (device && - resolvedDevice && - device.toLowerCase() !== resolvedDevice.toLowerCase()) { - // This path points to another device so it is not applicable - continue; - } - - if (!resolvedDevice) { - resolvedDevice = device; - } - if (!resolvedAbsolute) { - resolvedTail = tail + '\\' + resolvedTail; - resolvedAbsolute = isAbsolute; - } - - if (resolvedDevice && resolvedAbsolute) { - break; - } - } - - // Convert slashes to backslashes when `resolvedDevice` points to an UNC - // root. Also squash multiple slashes into a single one where appropriate. - if (isUnc) { - resolvedDevice = normalizeUNCRoot(resolvedDevice); - } - - // 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 tail path - resolvedTail = normalizeArray(resolvedTail.split(/[\\\/]+/), - !resolvedAbsolute).join('\\'); - - // If device is a drive letter, we'll normalize to lower case. - if (resolvedDevice && resolvedDevice.charAt(1) === ':') { - resolvedDevice = resolvedDevice[0].toLowerCase() + - resolvedDevice.substr(1); - } - - return (resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail) || - '.'; -}; - - -win32.normalize = function(path) { - var result = splitDeviceRe.exec(path), - device = result[1] || '', - isUnc = device && device.charAt(1) !== ':', - isAbsolute = win32.isAbsolute(path), - tail = result[3], - trailingSlash = /[\\\/]$/.test(tail); - - // If device is a drive letter, we'll normalize to lower case. - if (device && device.charAt(1) === ':') { - device = device[0].toLowerCase() + device.substr(1); - } - - // Normalize the tail path - tail = normalizeArray(tail.split(/[\\\/]+/), !isAbsolute).join('\\'); - - if (!tail && !isAbsolute) { - tail = '.'; - } - if (tail && trailingSlash) { - tail += '\\'; - } - - // Convert slashes to backslashes when `device` points to an UNC root. - // Also squash multiple slashes into a single one where appropriate. - if (isUnc) { - device = normalizeUNCRoot(device); - } - - return device + (isAbsolute ? '\\' : '') + tail; -}; - - -win32.isAbsolute = function(path) { - var result = splitDeviceRe.exec(path), - device = result[1] || '', - isUnc = !!device && device.charAt(1) !== ':'; - // UNC paths are always absolute - return !!result[2] || isUnc; -}; - -win32.join = function() { - function f(p) { - if (!util.isString(p)) { - throw new TypeError('Arguments to path.join must be strings'); - } - return p; - } - - var paths = Array.prototype.filter.call(arguments, f); - var joined = paths.join('\\'); - - // Make sure that the joined path doesn't start with two slashes, because - // normalize() will mistake it for an UNC path then. - // - // This step is skipped when it is very clear that the user actually - // intended to point at an UNC path. This is assumed when the first - // non-empty string arguments starts with exactly two slashes followed by - // at least one more non-slash character. - // - // Note that for normalize() to treat a path as an UNC path it needs to - // have at least 2 components, so we don't filter for that here. - // This means that the user can use join to construct UNC paths from - // a server name and a share name; for example: - // path.join('//server', 'share') -> '\\\\server\\share\') - if (!/^[\\\/]{2}[^\\\/]/.test(paths[0])) { - joined = joined.replace(/^[\\\/]{2,}/, '\\'); - } - - return win32.normalize(joined); -}; - - -// path.relative(from, to) -// it will solve the relative path from 'from' to 'to', for instance: -// from = 'C:\\orandea\\test\\aaa' -// to = 'C:\\orandea\\impl\\bbb' -// The output of the function should be: '..\\..\\impl\\bbb' -win32.relative = function(from, to) { - from = win32.resolve(from); - to = win32.resolve(to); - - // windows is not case sensitive - var lowerFrom = from.toLowerCase(); - var lowerTo = to.toLowerCase(); - - 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 + 1); - } - - var toParts = trim(to.split('\\')); - - var lowerFromParts = trim(lowerFrom.split('\\')); - var lowerToParts = trim(lowerTo.split('\\')); - - var length = Math.min(lowerFromParts.length, lowerToParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (lowerFromParts[i] !== lowerToParts[i]) { - samePartsLength = i; - break; - } - } - - if (samePartsLength == 0) { - return to; - } - - var outputParts = []; - for (var i = samePartsLength; i < lowerFromParts.length; i++) { - outputParts.push('..'); - } - - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - - return outputParts.join('\\'); -}; - - -win32._makeLong = function(path) { - // Note: this will *probably* throw somewhere. - if (!util.isString(path)) - return path; - - if (!path) { - return ''; - } - - var resolvedPath = win32.resolve(path); - - if (/^[a-zA-Z]\:\\/.test(resolvedPath)) { - // path is local filesystem path, which needs to be converted - // to long UNC path. - return '\\\\?\\' + resolvedPath; - } else if (/^\\\\[^?.]/.test(resolvedPath)) { - // path is network UNC path, which needs to be converted - // to long UNC path. - return '\\\\?\\UNC\\' + resolvedPath.substring(2); - } - - return path; -}; - - -win32.dirname = function(path) { - var result = win32SplitPath(path), - root = result[0], - dir = result[1]; - - if (!root && !dir) { - // No dirname whatsoever - return '.'; - } - - if (dir) { - // It has a dirname, strip trailing slash - dir = dir.substr(0, dir.length - 1); - } - - return root + dir; -}; - - -win32.basename = function(path, ext) { - var f = win32SplitPath(path)[2]; - // TODO: make this comparison case-insensitive on windows? - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; -}; - - -win32.extname = function(path) { - return win32SplitPath(path)[3]; -}; - - -win32.format = function(pathObject) { - if (!util.isObject(pathObject)) { - throw new TypeError( - "Parameter 'pathObject' must be an object, not " + typeof pathObject - ); - } - - var root = pathObject.root || ''; - - if (!util.isString(root)) { - throw new TypeError( - "'pathObject.root' must be a string or undefined, not " + - typeof pathObject.root - ); - } - - var dir = pathObject.dir; - var base = pathObject.base || ''; - if (dir.slice(dir.length - 1, dir.length) === win32.sep) { - return dir + base; - } - - if (dir) { - return dir + win32.sep + base; - } - - return base; -}; - - -win32.parse = function(pathString) { - if (!util.isString(pathString)) { - throw new TypeError( - "Parameter 'pathString' must be a string, not " + typeof pathString - ); - } - var allParts = win32SplitPath(pathString); - if (!allParts || allParts.length !== 4) { - throw new TypeError("Invalid path '" + pathString + "'"); - } - return { - root: allParts[0], - dir: allParts[0] + allParts[1].slice(0, allParts[1].length - 1), - base: allParts[2], - ext: allParts[3], - name: allParts[2].slice(0, allParts[2].length - allParts[3].length) - }; -}; - - -win32.sep = '\\'; -win32.delimiter = ';'; - - -// Split a filename into [root, dir, basename, ext], unix version -// 'root' is just a slash, or nothing. -var splitPathRe = - /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; -var posix = {}; - - -function posixSplitPath(filename) { - return splitPathRe.exec(filename).slice(1); -} - - -// path.resolve([from ...], to) -// posix version -posix.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 (!util.isString(path)) { - 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(resolvedPath.split('/'), - !resolvedAbsolute).join('/'); - - return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; -}; - -// path.normalize(path) -// posix version -posix.normalize = function(path) { - var isAbsolute = posix.isAbsolute(path), - trailingSlash = path.substr(-1) === '/'; - - // Normalize the path - path = normalizeArray(path.split('/'), !isAbsolute).join('/'); - - if (!path && !isAbsolute) { - path = '.'; - } - if (path && trailingSlash) { - path += '/'; - } - - return (isAbsolute ? '/' : '') + path; -}; - -// posix version -posix.isAbsolute = function(path) { - return path.charAt(0) === '/'; -}; - -// posix version -posix.join = function() { - var path = ''; - for (var i = 0; i < arguments.length; i++) { - var segment = arguments[i]; - if (!util.isString(segment)) { - throw new TypeError('Arguments to path.join must be strings'); - } - if (segment) { - if (!path) { - path += segment; - } else { - path += '/' + segment; - } - } - } - return posix.normalize(path); -}; - - -// path.relative(from, to) -// posix version -posix.relative = function(from, to) { - from = posix.resolve(from).substr(1); - to = posix.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 + 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('/'); -}; - - -posix._makeLong = function(path) { - return path; -}; - - -posix.dirname = function(path) { - var result = posixSplitPath(path), - root = result[0], - dir = result[1]; - - if (!root && !dir) { - // No dirname whatsoever - return '.'; - } - - if (dir) { - // It has a dirname, strip trailing slash - dir = dir.substr(0, dir.length - 1); - } - - return root + dir; -}; - - -posix.basename = function(path, ext) { - var f = posixSplitPath(path)[2]; - // TODO: make this comparison case-insensitive on windows? - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; -}; - - -posix.extname = function(path) { - return posixSplitPath(path)[3]; -}; - - -posix.format = function(pathObject) { - if (!util.isObject(pathObject)) { - throw new TypeError( - "Parameter 'pathObject' must be an object, not " + typeof pathObject - ); - } - - var root = pathObject.root || ''; - - if (!util.isString(root)) { - throw new TypeError( - "'pathObject.root' must be a string or undefined, not " + - typeof pathObject.root - ); - } - - var dir = pathObject.dir ? pathObject.dir + posix.sep : ''; - var base = pathObject.base || ''; - return dir + base; -}; - - -posix.parse = function(pathString) { - if (!util.isString(pathString)) { - throw new TypeError( - "Parameter 'pathString' must be a string, not " + typeof pathString - ); - } - var allParts = posixSplitPath(pathString); - if (!allParts || allParts.length !== 4) { - throw new TypeError("Invalid path '" + pathString + "'"); - } - allParts[1] = allParts[1] || ''; - allParts[2] = allParts[2] || ''; - allParts[3] = allParts[3] || ''; - - return { - root: allParts[0], - dir: allParts[0] + allParts[1].slice(0, allParts[1].length - 1), - base: allParts[2], - ext: allParts[3], - name: allParts[2].slice(0, allParts[2].length - allParts[3].length) - }; -}; - - -posix.sep = '/'; -posix.delimiter = ':'; - - -if (isWindows) - module.exports = win32; -else /* posix */ - module.exports = posix; - -module.exports.posix = posix; -module.exports.win32 = win32; diff --git a/node_modules/pbkdf2/LICENSE b/node_modules/pbkdf2/LICENSE deleted file mode 100644 index a115b5242..000000000 --- a/node_modules/pbkdf2/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Daniel Cousens - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/pbkdf2/README.md b/node_modules/pbkdf2/README.md deleted file mode 100644 index 614934f72..000000000 --- a/node_modules/pbkdf2/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# pbkdf2 - -[![NPM Package](https://img.shields.io/npm/v/pbkdf2.svg?style=flat-square)](https://www.npmjs.org/package/pbkdf2) -[![Build Status](https://img.shields.io/travis/crypto-browserify/pbkdf2.svg?branch=master&style=flat-square)](https://travis-ci.org/crypto-browserify/pbkdf2) -[![Dependency status](https://img.shields.io/david/crypto-browserify/pbkdf2.svg?style=flat-square)](https://david-dm.org/crypto-browserify/pbkdf2#info=dependencies) - -[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) - -This library provides the functionality of PBKDF2 with the ability to use any supported hashing algorithm returned from `crypto.getHashes()` - - -## Usage - -```js -var pbkdf2 = require('pbkdf2') -var derivedKey = pbkdf2.pbkdf2Sync('password', 'salt', 1, 32, 'sha512') - -... -``` - -For more information on the API, please see the relevant [Node documentation](https://nodejs.org/api/crypto.html#crypto_crypto_pbkdf2_password_salt_iterations_keylen_digest_callback). - -For high performance, use the `async` variant (`pbkdf2.pbkdf2`), not `pbkdf2.pbkdf2Sync`, this variant has the oppurtunity to use `window.crypto.subtle` when browserified. - - -## Credits - -This module is a derivative of [cryptocoinjs/pbkdf2-sha256](https://github.com/cryptocoinjs/pbkdf2-sha256/), so thanks to [JP Richardson](https://github.com/jprichardson/) for laying the ground work. - -Thank you to [FangDun Cai](https://github.com/fundon) for donating the package name on npm, if you're looking for his previous module it is located at [fundon/pbkdf2](https://github.com/fundon/pbkdf2). diff --git a/node_modules/pbkdf2/browser.js b/node_modules/pbkdf2/browser.js deleted file mode 100644 index ac5fdd8d6..000000000 --- a/node_modules/pbkdf2/browser.js +++ /dev/null @@ -1,2 +0,0 @@ -exports.pbkdf2 = require('./lib/async') -exports.pbkdf2Sync = require('./lib/sync') diff --git a/node_modules/pbkdf2/index.js b/node_modules/pbkdf2/index.js deleted file mode 100644 index fc2f8d96f..000000000 --- a/node_modules/pbkdf2/index.js +++ /dev/null @@ -1,31 +0,0 @@ -var checkParameters = require('./lib/precondition') -var native = require('crypto') - -function nativePBKDF2 (password, salt, iterations, keylen, digest, callback) { - checkParameters(password, salt, iterations, keylen) - - if (typeof digest === 'function') { - callback = digest - digest = 'sha1' - } - if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2') - - return native.pbkdf2(password, salt, iterations, keylen, digest, callback) -} - -function nativePBKDF2Sync (password, salt, iterations, keylen, digest) { - checkParameters(password, salt, iterations, keylen) - digest = digest || 'sha1' - return native.pbkdf2Sync(password, salt, iterations, keylen, digest) -} - -/* istanbul ignore next */ -if (!native.pbkdf2Sync || native.pbkdf2Sync.toString().indexOf('keylen, digest') === -1) { - exports.pbkdf2Sync = require('./lib/sync') - exports.pbkdf2 = require('./lib/async') - -// native -} else { - exports.pbkdf2Sync = nativePBKDF2Sync - exports.pbkdf2 = nativePBKDF2 -} diff --git a/node_modules/pbkdf2/lib/async.js b/node_modules/pbkdf2/lib/async.js deleted file mode 100644 index b20da7c8b..000000000 --- a/node_modules/pbkdf2/lib/async.js +++ /dev/null @@ -1,100 +0,0 @@ -var checkParameters = require('./precondition') -var defaultEncoding = require('./default-encoding') -var sync = require('./sync') -var Buffer = require('safe-buffer').Buffer - -var ZERO_BUF -var subtle = global.crypto && global.crypto.subtle -var toBrowser = { - 'sha': 'SHA-1', - 'sha-1': 'SHA-1', - 'sha1': 'SHA-1', - 'sha256': 'SHA-256', - 'sha-256': 'SHA-256', - 'sha384': 'SHA-384', - 'sha-384': 'SHA-384', - 'sha-512': 'SHA-512', - 'sha512': 'SHA-512' -} -var checks = [] -function checkNative (algo) { - if (global.process && !global.process.browser) { - return Promise.resolve(false) - } - if (!subtle || !subtle.importKey || !subtle.deriveBits) { - return Promise.resolve(false) - } - if (checks[algo] !== undefined) { - return checks[algo] - } - ZERO_BUF = ZERO_BUF || Buffer.alloc(8) - var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo) - .then(function () { - return true - }).catch(function () { - return false - }) - checks[algo] = prom - return prom -} - -function browserPbkdf2 (password, salt, iterations, length, algo) { - return subtle.importKey( - 'raw', password, {name: 'PBKDF2'}, false, ['deriveBits'] - ).then(function (key) { - return subtle.deriveBits({ - name: 'PBKDF2', - salt: salt, - iterations: iterations, - hash: { - name: algo - } - }, key, length << 3) - }).then(function (res) { - return Buffer.from(res) - }) -} - -function resolvePromise (promise, callback) { - promise.then(function (out) { - process.nextTick(function () { - callback(null, out) - }) - }, function (e) { - process.nextTick(function () { - callback(e) - }) - }) -} -module.exports = function (password, salt, iterations, keylen, digest, callback) { - if (typeof digest === 'function') { - callback = digest - digest = undefined - } - - digest = digest || 'sha1' - var algo = toBrowser[digest.toLowerCase()] - - if (!algo || typeof global.Promise !== 'function') { - return process.nextTick(function () { - var out - try { - out = sync(password, salt, iterations, keylen, digest) - } catch (e) { - return callback(e) - } - callback(null, out) - }) - } - - checkParameters(password, salt, iterations, keylen) - if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2') - if (!Buffer.isBuffer(password)) password = Buffer.from(password, defaultEncoding) - if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, defaultEncoding) - - resolvePromise(checkNative(algo).then(function (resp) { - if (resp) return browserPbkdf2(password, salt, iterations, keylen, algo) - - return sync(password, salt, iterations, keylen, digest) - }), callback) -} diff --git a/node_modules/pbkdf2/lib/default-encoding.js b/node_modules/pbkdf2/lib/default-encoding.js deleted file mode 100644 index 13b8db92f..000000000 --- a/node_modules/pbkdf2/lib/default-encoding.js +++ /dev/null @@ -1,10 +0,0 @@ -var defaultEncoding -/* istanbul ignore next */ -if (process.browser) { - defaultEncoding = 'utf-8' -} else { - var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10) - - defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary' -} -module.exports = defaultEncoding diff --git a/node_modules/pbkdf2/lib/precondition.js b/node_modules/pbkdf2/lib/precondition.js deleted file mode 100644 index 683db5630..000000000 --- a/node_modules/pbkdf2/lib/precondition.js +++ /dev/null @@ -1,28 +0,0 @@ -var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs - -function checkBuffer (buf, name) { - if (typeof buf !== 'string' && !Buffer.isBuffer(buf)) { - throw new TypeError(name + ' must be a buffer or string') - } -} - -module.exports = function (password, salt, iterations, keylen) { - checkBuffer(password, 'Password') - checkBuffer(salt, 'Salt') - - if (typeof iterations !== 'number') { - throw new TypeError('Iterations not a number') - } - - if (iterations < 0) { - throw new TypeError('Bad iterations') - } - - if (typeof keylen !== 'number') { - throw new TypeError('Key length not a number') - } - - if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */ - throw new TypeError('Bad key length') - } -} diff --git a/node_modules/pbkdf2/lib/sync-browser.js b/node_modules/pbkdf2/lib/sync-browser.js deleted file mode 100644 index 55c8c6d34..000000000 --- a/node_modules/pbkdf2/lib/sync-browser.js +++ /dev/null @@ -1,104 +0,0 @@ -var md5 = require('create-hash/md5') -var RIPEMD160 = require('ripemd160') -var sha = require('sha.js') - -var checkParameters = require('./precondition') -var defaultEncoding = require('./default-encoding') -var Buffer = require('safe-buffer').Buffer -var ZEROS = Buffer.alloc(128) -var sizes = { - md5: 16, - sha1: 20, - sha224: 28, - sha256: 32, - sha384: 48, - sha512: 64, - rmd160: 20, - ripemd160: 20 -} - -function Hmac (alg, key, saltLen) { - var hash = getDigest(alg) - var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64 - - if (key.length > blocksize) { - key = hash(key) - } else if (key.length < blocksize) { - key = Buffer.concat([key, ZEROS], blocksize) - } - - var ipad = Buffer.allocUnsafe(blocksize + sizes[alg]) - var opad = Buffer.allocUnsafe(blocksize + sizes[alg]) - for (var i = 0; i < blocksize; i++) { - ipad[i] = key[i] ^ 0x36 - opad[i] = key[i] ^ 0x5C - } - - var ipad1 = Buffer.allocUnsafe(blocksize + saltLen + 4) - ipad.copy(ipad1, 0, 0, blocksize) - this.ipad1 = ipad1 - this.ipad2 = ipad - this.opad = opad - this.alg = alg - this.blocksize = blocksize - this.hash = hash - this.size = sizes[alg] -} - -Hmac.prototype.run = function (data, ipad) { - data.copy(ipad, this.blocksize) - var h = this.hash(ipad) - h.copy(this.opad, this.blocksize) - return this.hash(this.opad) -} - -function getDigest (alg) { - function shaFunc (data) { - return sha(alg).update(data).digest() - } - function rmd160Func (data) { - return new RIPEMD160().update(data).digest() - } - - if (alg === 'rmd160' || alg === 'ripemd160') return rmd160Func - if (alg === 'md5') return md5 - return shaFunc -} - -function pbkdf2 (password, salt, iterations, keylen, digest) { - checkParameters(password, salt, iterations, keylen) - - if (!Buffer.isBuffer(password)) password = Buffer.from(password, defaultEncoding) - if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, defaultEncoding) - - digest = digest || 'sha1' - - var hmac = new Hmac(digest, password, salt.length) - - var DK = Buffer.allocUnsafe(keylen) - var block1 = Buffer.allocUnsafe(salt.length + 4) - salt.copy(block1, 0, 0, salt.length) - - var destPos = 0 - var hLen = sizes[digest] - var l = Math.ceil(keylen / hLen) - - for (var i = 1; i <= l; i++) { - block1.writeUInt32BE(i, salt.length) - - var T = hmac.run(block1, hmac.ipad1) - var U = T - - for (var j = 1; j < iterations; j++) { - U = hmac.run(U, hmac.ipad2) - for (var k = 0; k < hLen; k++) T[k] ^= U[k] - } - - T.copy(DK, destPos) - destPos += hLen - } - - return DK -} - -module.exports = pbkdf2 diff --git a/node_modules/pbkdf2/lib/sync.js b/node_modules/pbkdf2/lib/sync.js deleted file mode 100644 index f691e31a6..000000000 --- a/node_modules/pbkdf2/lib/sync.js +++ /dev/null @@ -1,51 +0,0 @@ -var sizes = { - md5: 16, - sha1: 20, - sha224: 28, - sha256: 32, - sha384: 48, - sha512: 64, - rmd160: 20, - ripemd160: 20 -} - -var createHmac = require('create-hmac') -var checkParameters = require('../lib/precondition') -var defaultEncoding = require('../lib/default-encoding') -var Buffer = require('safe-buffer').Buffer - -function pbkdf2 (password, salt, iterations, keylen, digest) { - checkParameters(password, salt, iterations, keylen) - - if (!Buffer.isBuffer(password)) password = Buffer.from(password, defaultEncoding) - if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, defaultEncoding) - - digest = digest || 'sha1' - - var DK = Buffer.allocUnsafe(keylen) - var block1 = Buffer.allocUnsafe(salt.length + 4) - salt.copy(block1, 0, 0, salt.length) - - var destPos = 0 - var hLen = sizes[digest] - var l = Math.ceil(keylen / hLen) - - for (var i = 1; i <= l; i++) { - block1.writeUInt32BE(i, salt.length) - - var T = createHmac(digest, password).update(block1).digest() - var U = T - - for (var j = 1; j < iterations; j++) { - U = createHmac(digest, password).update(U).digest() - for (var k = 0; k < hLen; k++) T[k] ^= U[k] - } - - T.copy(DK, destPos) - destPos += hLen - } - - return DK -} - -module.exports = pbkdf2 diff --git a/node_modules/pbkdf2/package.json b/node_modules/pbkdf2/package.json deleted file mode 100644 index 8a9121145..000000000 --- a/node_modules/pbkdf2/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "_from": "pbkdf2@^3.0.3", - "_id": "pbkdf2@3.0.17", - "_inBundle": false, - "_integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", - "_location": "/pbkdf2", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "pbkdf2@^3.0.3", - "name": "pbkdf2", - "escapedName": "pbkdf2", - "rawSpec": "^3.0.3", - "saveSpec": null, - "fetchSpec": "^3.0.3" - }, - "_requiredBy": [ - "/crypto-browserify", - "/parse-asn1" - ], - "_resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", - "_shasum": "976c206530617b14ebb32114239f7b09336e93a6", - "_spec": "pbkdf2@^3.0.3", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/crypto-browserify", - "author": { - "name": "Daniel Cousens" - }, - "browser": { - "./index.js": "./browser.js", - "./lib/sync.js": "./lib/sync-browser.js" - }, - "bugs": { - "url": "https://github.com/crypto-browserify/pbkdf2/issues" - }, - "bundleDependencies": false, - "dependencies": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - }, - "deprecated": false, - "description": "This library provides the functionality of PBKDF2 with the ability to use any supported hashing algorithm returned from crypto.getHashes()", - "devDependencies": { - "benchmark": "^2.1.4", - "browserify": "*", - "nyc": "^6.4.0", - "standard": "*", - "tape": "^4.5.1" - }, - "engines": { - "node": ">=0.12" - }, - "files": [ - "browser.js", - "index.js", - "lib/" - ], - "homepage": "https://github.com/crypto-browserify/pbkdf2", - "keywords": [ - "pbkdf2", - "kdf", - "salt", - "hash" - ], - "license": "MIT", - "main": "index.js", - "name": "pbkdf2", - "nyc": { - "exclude": [ - "lib/async.js", - "test/bundle.js" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/crypto-browserify/pbkdf2.git" - }, - "scripts": { - "bench": "node bench/", - "bundle-test": "browserify test/index.js > test/bundle.js", - "coverage": "nyc --check-coverage --branches 95 --functions 95 tape test/*.js", - "coverage-html": "nyc report --reporter=html", - "coverage-report": "nyc report --reporter=lcov", - "lint": "standard", - "prepublish": "npm run test", - "test": "npm run lint && npm run unit", - "unit": "tape test/*.js" - }, - "standard": { - "ignore": [ - "test/bundle.js" - ] - }, - "version": "3.0.17" -} diff --git a/node_modules/pelo/README.md b/node_modules/pelo/README.md deleted file mode 100644 index 8c5cb9057..000000000 --- a/node_modules/pelo/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# pelo (work in progress) - -Lightning fast server-side rendering with tagged template literals - -A tiny library that enables lightning fast server-side rendering with [hyperx](https://github.com/substack/hyperx)-like libraries such as `bel`, `yo-yo` and `choo/html`. It replaces the tag function of those libraries and just renders string without creating intermediate objects. - -## Installing - -```sh -npm install pelo -``` - -## Usage - -`ssr.js`: Call `pelo.replace(moduleId)` before you require any view module, `bel` in this case. - -```js -const pelo = require('pelo') -pelo.replace('bel') -const view = require('./view') - -const renderedString = view('pelo').toString() -``` - -`view.js`: You don't need to change your view files at all. You can use them for client-side rendering and server-side rendering. - -```js -const html = require('bel') - -module.exports = function helloView(name) { - return html`

    Hello, ${name}

    ` -} -``` - -## Benchmark - -Rendering a simple view 10,000 times: - -```js -node benchmark.js -``` - -| tag | time (ms) | -| ---- | --------- | -| pelo | 219.093 | -| bel | 1982.610 | - -## Motivation - -Server-side rendering with modern JavaScript frameworks is slow. In general, they focus on the client-side, and generate virtual/real DOMs for efficient DOM updates from templates. However, this approach is a bit overkill when we focus on server-side rendering. Because the templates already look like HTML, it should be faster if they directly render HTML strings without creating intermediate object representations. - -With [`bel`](https://github.com/shama/bel), we can write HTML with tagged template literals and use them to create declarative views on browser. If we can use the same template also for directly generating HTML string on server-side, it will be a huge win. - -## Thanks - -Thanks [@yoshuawuyts](https://github.com/yoshuawuyts) for lots of advice! diff --git a/node_modules/pelo/app.js b/node_modules/pelo/app.js deleted file mode 100644 index c9bd163f1..000000000 --- a/node_modules/pelo/app.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict' - -module.exports = function () { - // Allow `bel` to be swapped in benchmarking - const html = require('bel') - - const greeting = 'Hello' - const name = 'special characters, <, >, &' - const drinks = [ - { name: 'Cafe Latte', price: 3.0, sold: false }, - { name: 'Cappucino', price: 2.9, sold: true }, - { name: 'Club Mate', price: 2.2, sold: true }, - { name: 'Berliner Weiße', price: 3.5, sold: false } - ] - - const listeners = [] - function onChange (listener) { - listeners.push(listener) - } - function notifyChange () { - listeners.forEach((listener) => listener()) - } - - function deleteDrink (drink) { - const index = drinks.indexOf(drink) - if (index >= 0) { - drinks.splice(index, 1) - } - notifyChange() - } - - function drinkView (drink, deleteDrink) { - return html` -
  • - ${drink.name} is € ${drink.price} - -
  • - ` - } - - function mainView (greeting, name, drinks, deleteDrink) { - return html` -
    -

    ${greeting}, ${name}!

    - ${drinks.length > 0 ? html` -
      - ${drinks.map(drink => drinkView(drink, deleteDrink))} -
    - ` : html` -

    All drinks are gone!

    - `} -

    - attributes: ' }} /> -

    -
    - ` - } - - function render () { - return mainView(greeting, name, drinks, deleteDrink) - } - - return { - render: render, - onChange: onChange - } -} diff --git a/node_modules/pelo/bundle.js b/node_modules/pelo/bundle.js deleted file mode 100644 index 390a2e397..000000000 --- a/node_modules/pelo/bundle.js +++ /dev/null @@ -1,1053 +0,0 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o listener()) - } - - function deleteDrink (drink) { - const index = drinks.indexOf(drink) - if (index >= 0) { - drinks.splice(index, 1) - } - notifyChange() - } - - function drinkView (drink, deleteDrink) { - return html` -
  • - ${drink.name} is € ${drink.price} - -
  • - ` - } - - function mainView (greeting, name, drinks, deleteDrink) { - return html` -
    -

    ${greeting}, ${name}!

    - ${drinks.length > 0 ? html` -
      - ${drinks.map(drink => drinkView(drink, deleteDrink))} -
    - ` : html` -

    All drinks are gone!

    - `} -
    - ` - } - - function render () { - return mainView(greeting, name, drinks, deleteDrink) - } - - return { - render: render, - onChange: onChange - } -} - -},{"bel":3}],2:[function(require,module,exports){ -'use strict' - -const nanomorph = require('nanomorph') - -const createApp = require('./app') - -const app = createApp() - -const root = document.getElementById('root') -const tree = root.firstElementChild -nanomorph(tree, app.render()) -app.onChange(() => { - nanomorph(tree, app.render()) -}) - -},{"./app":1,"nanomorph":10}],3:[function(require,module,exports){ -var document = require('global/document') -var hyperx = require('hyperx') -var onload = require('on-load') - -var SVGNS = 'http://www.w3.org/2000/svg' -var XLINKNS = 'http://www.w3.org/1999/xlink' - -var BOOL_PROPS = { - autofocus: 1, - checked: 1, - defaultchecked: 1, - disabled: 1, - formnovalidate: 1, - indeterminate: 1, - readonly: 1, - required: 1, - selected: 1, - willvalidate: 1 -} -var COMMENT_TAG = '!--' -var SVG_TAGS = [ - 'svg', - 'altGlyph', 'altGlyphDef', 'altGlyphItem', 'animate', 'animateColor', - 'animateMotion', 'animateTransform', 'circle', 'clipPath', 'color-profile', - 'cursor', 'defs', 'desc', 'ellipse', 'feBlend', 'feColorMatrix', - 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', - 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', - 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', - 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', - 'feSpotLight', 'feTile', 'feTurbulence', 'filter', 'font', 'font-face', - 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', - 'foreignObject', 'g', 'glyph', 'glyphRef', 'hkern', 'image', 'line', - 'linearGradient', 'marker', 'mask', 'metadata', 'missing-glyph', 'mpath', - 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', - 'set', 'stop', 'switch', 'symbol', 'text', 'textPath', 'title', 'tref', - 'tspan', 'use', 'view', 'vkern' -] - -function belCreateElement (tag, props, children) { - var el - - // If an svg tag, it needs a namespace - if (SVG_TAGS.indexOf(tag) !== -1) { - props.namespace = SVGNS - } - - // If we are using a namespace - var ns = false - if (props.namespace) { - ns = props.namespace - delete props.namespace - } - - // Create the element - if (ns) { - el = document.createElementNS(ns, tag) - } else if (tag === COMMENT_TAG) { - return document.createComment(props.comment) - } else { - el = document.createElement(tag) - } - - // If adding onload events - if (props.onload || props.onunload) { - var load = props.onload || function () {} - var unload = props.onunload || function () {} - onload(el, function belOnload () { - load(el) - }, function belOnunload () { - unload(el) - }, - // We have to use non-standard `caller` to find who invokes `belCreateElement` - belCreateElement.caller.caller.caller) - delete props.onload - delete props.onunload - } - - // Create the properties - for (var p in props) { - if (props.hasOwnProperty(p)) { - var key = p.toLowerCase() - var val = props[p] - // Normalize className - if (key === 'classname') { - key = 'class' - p = 'class' - } - // The for attribute gets transformed to htmlFor, but we just set as for - if (p === 'htmlFor') { - p = 'for' - } - // If a property is boolean, set itself to the key - if (BOOL_PROPS[key]) { - if (val === 'true') val = key - else if (val === 'false') continue - } - // If a property prefers being set directly vs setAttribute - if (key.slice(0, 2) === 'on') { - el[p] = val - } else { - if (ns) { - if (p === 'xlink:href') { - el.setAttributeNS(XLINKNS, p, val) - } else if (/^xmlns($|:)/i.test(p)) { - // skip xmlns definitions - } else { - el.setAttributeNS(null, p, val) - } - } else { - el.setAttribute(p, val) - } - } - } - } - - function appendChild (childs) { - if (!Array.isArray(childs)) return - for (var i = 0; i < childs.length; i++) { - var node = childs[i] - if (Array.isArray(node)) { - appendChild(node) - continue - } - - if (typeof node === 'number' || - typeof node === 'boolean' || - typeof node === 'function' || - node instanceof Date || - node instanceof RegExp) { - node = node.toString() - } - - if (typeof node === 'string') { - if (el.lastChild && el.lastChild.nodeName === '#text') { - el.lastChild.nodeValue += node - continue - } - node = document.createTextNode(node) - } - - if (node && node.nodeType) { - el.appendChild(node) - } - } - } - appendChild(children) - - return el -} - -module.exports = hyperx(belCreateElement, {comments: true}) -module.exports.default = module.exports -module.exports.createElement = belCreateElement - -},{"global/document":5,"hyperx":8,"on-load":13}],4:[function(require,module,exports){ - -},{}],5:[function(require,module,exports){ -(function (global){ -var topLevel = typeof global !== 'undefined' ? global : - typeof window !== 'undefined' ? window : {} -var minDoc = require('min-document'); - -var doccy; - -if (typeof document !== 'undefined') { - doccy = document; -} else { - doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4']; - - if (!doccy) { - doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc; - } -} - -module.exports = doccy; - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"min-document":4}],6:[function(require,module,exports){ -(function (global){ -var win; - -if (typeof window !== "undefined") { - win = window; -} else if (typeof global !== "undefined") { - win = global; -} else if (typeof self !== "undefined"){ - win = self; -} else { - win = {}; -} - -module.exports = win; - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],7:[function(require,module,exports){ -module.exports = attributeToProperty - -var transform = { - 'class': 'className', - 'for': 'htmlFor', - 'http-equiv': 'httpEquiv' -} - -function attributeToProperty (h) { - return function (tagName, attrs, children) { - for (var attr in attrs) { - if (attr in transform) { - attrs[transform[attr]] = attrs[attr] - delete attrs[attr] - } - } - return h(tagName, attrs, children) - } -} - -},{}],8:[function(require,module,exports){ -var attrToProp = require('hyperscript-attribute-to-property') - -var VAR = 0, TEXT = 1, OPEN = 2, CLOSE = 3, ATTR = 4 -var ATTR_KEY = 5, ATTR_KEY_W = 6 -var ATTR_VALUE_W = 7, ATTR_VALUE = 8 -var ATTR_VALUE_SQ = 9, ATTR_VALUE_DQ = 10 -var ATTR_EQ = 11, ATTR_BREAK = 12 -var COMMENT = 13 - -module.exports = function (h, opts) { - if (!opts) opts = {} - var concat = opts.concat || function (a, b) { - return String(a) + String(b) - } - if (opts.attrToProp !== false) { - h = attrToProp(h) - } - - return function (strings) { - var state = TEXT, reg = '' - var arglen = arguments.length - var parts = [] - - for (var i = 0; i < strings.length; i++) { - if (i < arglen - 1) { - var arg = arguments[i+1] - var p = parse(strings[i]) - var xstate = state - if (xstate === ATTR_VALUE_DQ) xstate = ATTR_VALUE - if (xstate === ATTR_VALUE_SQ) xstate = ATTR_VALUE - if (xstate === ATTR_VALUE_W) xstate = ATTR_VALUE - if (xstate === ATTR) xstate = ATTR_KEY - p.push([ VAR, xstate, arg ]) - parts.push.apply(parts, p) - } else parts.push.apply(parts, parse(strings[i])) - } - - var tree = [null,{},[]] - var stack = [[tree,-1]] - for (var i = 0; i < parts.length; i++) { - var cur = stack[stack.length-1][0] - var p = parts[i], s = p[0] - if (s === OPEN && /^\//.test(p[1])) { - var ix = stack[stack.length-1][1] - if (stack.length > 1) { - stack.pop() - stack[stack.length-1][0][2][ix] = h( - cur[0], cur[1], cur[2].length ? cur[2] : undefined - ) - } - } else if (s === OPEN) { - var c = [p[1],{},[]] - cur[2].push(c) - stack.push([c,cur[2].length-1]) - } else if (s === ATTR_KEY || (s === VAR && p[1] === ATTR_KEY)) { - var key = '' - var copyKey - for (; i < parts.length; i++) { - if (parts[i][0] === ATTR_KEY) { - key = concat(key, parts[i][1]) - } else if (parts[i][0] === VAR && parts[i][1] === ATTR_KEY) { - if (typeof parts[i][2] === 'object' && !key) { - for (copyKey in parts[i][2]) { - if (parts[i][2].hasOwnProperty(copyKey) && !cur[1][copyKey]) { - cur[1][copyKey] = parts[i][2][copyKey] - } - } - } else { - key = concat(key, parts[i][2]) - } - } else break - } - if (parts[i][0] === ATTR_EQ) i++ - var j = i - for (; i < parts.length; i++) { - if (parts[i][0] === ATTR_VALUE || parts[i][0] === ATTR_KEY) { - if (!cur[1][key]) cur[1][key] = strfn(parts[i][1]) - else cur[1][key] = concat(cur[1][key], parts[i][1]) - } else if (parts[i][0] === VAR - && (parts[i][1] === ATTR_VALUE || parts[i][1] === ATTR_KEY)) { - if (!cur[1][key]) cur[1][key] = strfn(parts[i][2]) - else cur[1][key] = concat(cur[1][key], parts[i][2]) - } else { - if (key.length && !cur[1][key] && i === j - && (parts[i][0] === CLOSE || parts[i][0] === ATTR_BREAK)) { - // https://html.spec.whatwg.org/multipage/infrastructure.html#boolean-attributes - // empty string is falsy, not well behaved value in browser - cur[1][key] = key.toLowerCase() - } - break - } - } - } else if (s === ATTR_KEY) { - cur[1][p[1]] = true - } else if (s === VAR && p[1] === ATTR_KEY) { - cur[1][p[2]] = true - } else if (s === CLOSE) { - if (selfClosing(cur[0]) && stack.length) { - var ix = stack[stack.length-1][1] - stack.pop() - stack[stack.length-1][0][2][ix] = h( - cur[0], cur[1], cur[2].length ? cur[2] : undefined - ) - } - } else if (s === VAR && p[1] === TEXT) { - if (p[2] === undefined || p[2] === null) p[2] = '' - else if (!p[2]) p[2] = concat('', p[2]) - if (Array.isArray(p[2][0])) { - cur[2].push.apply(cur[2], p[2]) - } else { - cur[2].push(p[2]) - } - } else if (s === TEXT) { - cur[2].push(p[1]) - } else if (s === ATTR_EQ || s === ATTR_BREAK) { - // no-op - } else { - throw new Error('unhandled: ' + s) - } - } - - if (tree[2].length > 1 && /^\s*$/.test(tree[2][0])) { - tree[2].shift() - } - - if (tree[2].length > 2 - || (tree[2].length === 2 && /\S/.test(tree[2][1]))) { - throw new Error( - 'multiple root elements must be wrapped in an enclosing tag' - ) - } - if (Array.isArray(tree[2][0]) && typeof tree[2][0][0] === 'string' - && Array.isArray(tree[2][0][2])) { - tree[2][0] = h(tree[2][0][0], tree[2][0][1], tree[2][0][2]) - } - return tree[2][0] - - function parse (str) { - var res = [] - if (state === ATTR_VALUE_W) state = ATTR - for (var i = 0; i < str.length; i++) { - var c = str.charAt(i) - if (state === TEXT && c === '<') { - if (reg.length) res.push([TEXT, reg]) - reg = '' - state = OPEN - } else if (c === '>' && !quot(state) && state !== COMMENT) { - if (state === OPEN) { - res.push([OPEN,reg]) - } else if (state === ATTR_KEY) { - res.push([ATTR_KEY,reg]) - } else if (state === ATTR_VALUE && reg.length) { - res.push([ATTR_VALUE,reg]) - } - res.push([CLOSE]) - reg = '' - state = TEXT - } else if (state === COMMENT && /-$/.test(reg) && c === '-') { - if (opts.comments) { - res.push([ATTR_VALUE,reg.substr(0, reg.length - 1)],[CLOSE]) - } - reg = '' - state = TEXT - } else if (state === OPEN && /^!--$/.test(reg)) { - if (opts.comments) { - res.push([OPEN, reg],[ATTR_KEY,'comment'],[ATTR_EQ]) - } - reg = c - state = COMMENT - } else if (state === TEXT || state === COMMENT) { - reg += c - } else if (state === OPEN && /\s/.test(c)) { - res.push([OPEN, reg]) - reg = '' - state = ATTR - } else if (state === OPEN) { - reg += c - } else if (state === ATTR && /[^\s"'=/]/.test(c)) { - state = ATTR_KEY - reg = c - } else if (state === ATTR && /\s/.test(c)) { - if (reg.length) res.push([ATTR_KEY,reg]) - res.push([ATTR_BREAK]) - } else if (state === ATTR_KEY && /\s/.test(c)) { - res.push([ATTR_KEY,reg]) - reg = '' - state = ATTR_KEY_W - } else if (state === ATTR_KEY && c === '=') { - res.push([ATTR_KEY,reg],[ATTR_EQ]) - reg = '' - state = ATTR_VALUE_W - } else if (state === ATTR_KEY) { - reg += c - } else if ((state === ATTR_KEY_W || state === ATTR) && c === '=') { - res.push([ATTR_EQ]) - state = ATTR_VALUE_W - } else if ((state === ATTR_KEY_W || state === ATTR) && !/\s/.test(c)) { - res.push([ATTR_BREAK]) - if (/[\w-]/.test(c)) { - reg += c - state = ATTR_KEY - } else state = ATTR - } else if (state === ATTR_VALUE_W && c === '"') { - state = ATTR_VALUE_DQ - } else if (state === ATTR_VALUE_W && c === "'") { - state = ATTR_VALUE_SQ - } else if (state === ATTR_VALUE_DQ && c === '"') { - res.push([ATTR_VALUE,reg],[ATTR_BREAK]) - reg = '' - state = ATTR - } else if (state === ATTR_VALUE_SQ && c === "'") { - res.push([ATTR_VALUE,reg],[ATTR_BREAK]) - reg = '' - state = ATTR - } else if (state === ATTR_VALUE_W && !/\s/.test(c)) { - state = ATTR_VALUE - i-- - } else if (state === ATTR_VALUE && /\s/.test(c)) { - res.push([ATTR_VALUE,reg],[ATTR_BREAK]) - reg = '' - state = ATTR - } else if (state === ATTR_VALUE || state === ATTR_VALUE_SQ - || state === ATTR_VALUE_DQ) { - reg += c - } - } - if (state === TEXT && reg.length) { - res.push([TEXT,reg]) - reg = '' - } else if (state === ATTR_VALUE && reg.length) { - res.push([ATTR_VALUE,reg]) - reg = '' - } else if (state === ATTR_VALUE_DQ && reg.length) { - res.push([ATTR_VALUE,reg]) - reg = '' - } else if (state === ATTR_VALUE_SQ && reg.length) { - res.push([ATTR_VALUE,reg]) - reg = '' - } else if (state === ATTR_KEY) { - res.push([ATTR_KEY,reg]) - reg = '' - } - return res - } - } - - function strfn (x) { - if (typeof x === 'function') return x - else if (typeof x === 'string') return x - else if (x && typeof x === 'object') return x - else return concat('', x) - } -} - -function quot (state) { - return state === ATTR_VALUE_SQ || state === ATTR_VALUE_DQ -} - -var hasOwn = Object.prototype.hasOwnProperty -function has (obj, key) { return hasOwn.call(obj, key) } - -var closeRE = RegExp('^(' + [ - 'area', 'base', 'basefont', 'bgsound', 'br', 'col', 'command', 'embed', - 'frame', 'hr', 'img', 'input', 'isindex', 'keygen', 'link', 'meta', 'param', - 'source', 'track', 'wbr', '!--', - // SVG TAGS - 'animate', 'animateTransform', 'circle', 'cursor', 'desc', 'ellipse', - 'feBlend', 'feColorMatrix', 'feComposite', - 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', - 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', - 'feGaussianBlur', 'feImage', 'feMergeNode', 'feMorphology', - 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', - 'feTurbulence', 'font-face-format', 'font-face-name', 'font-face-uri', - 'glyph', 'glyphRef', 'hkern', 'image', 'line', 'missing-glyph', 'mpath', - 'path', 'polygon', 'polyline', 'rect', 'set', 'stop', 'tref', 'use', 'view', - 'vkern' -].join('|') + ')(?:[\.#][a-zA-Z0-9\u007F-\uFFFF_:-]+)*$') -function selfClosing (tag) { return closeRE.test(tag) } - -},{"hyperscript-attribute-to-property":7}],9:[function(require,module,exports){ -assert.notEqual = notEqual -assert.notOk = notOk -assert.equal = equal -assert.ok = assert - -module.exports = assert - -function equal (a, b, m) { - assert(a == b, m) // eslint-disable-line eqeqeq -} - -function notEqual (a, b, m) { - assert(a != b, m) // eslint-disable-line eqeqeq -} - -function notOk (t, m) { - assert(!t, m) -} - -function assert (t, m) { - if (!t) throw new Error(m || 'AssertionError') -} - -},{}],10:[function(require,module,exports){ -var assert = require('assert') -var morph = require('./lib/morph') - -var TEXT_NODE = 3 -// var DEBUG = false - -module.exports = nanomorph - -// Morph one tree into another tree -// -// no parent -// -> same: diff and walk children -// -> not same: replace and return -// old node doesn't exist -// -> insert new node -// new node doesn't exist -// -> delete old node -// nodes are not the same -// -> diff nodes and apply patch to old node -// nodes are the same -// -> walk all child nodes and append to old node -function nanomorph (oldTree, newTree) { - // if (DEBUG) { - // console.log( - // 'nanomorph\nold\n %s\nnew\n %s', - // oldTree && oldTree.outerHTML, - // newTree && newTree.outerHTML - // ) - // } - assert.equal(typeof oldTree, 'object', 'nanomorph: oldTree should be an object') - assert.equal(typeof newTree, 'object', 'nanomorph: newTree should be an object') - var tree = walk(newTree, oldTree) - // if (DEBUG) console.log('=> morphed\n %s', tree.outerHTML) - return tree -} - -// Walk and morph a dom tree -function walk (newNode, oldNode) { - // if (DEBUG) { - // console.log( - // 'walk\nold\n %s\nnew\n %s', - // oldNode && oldNode.outerHTML, - // newNode && newNode.outerHTML - // ) - // } - if (!oldNode) { - return newNode - } else if (!newNode) { - return null - } else if (newNode.isSameNode && newNode.isSameNode(oldNode)) { - return oldNode - } else if (newNode.tagName !== oldNode.tagName) { - return newNode - } else { - morph(newNode, oldNode) - updateChildren(newNode, oldNode) - return oldNode - } -} - -// Update the children of elements -// (obj, obj) -> null -function updateChildren (newNode, oldNode) { - // if (DEBUG) { - // console.log( - // 'updateChildren\nold\n %s\nnew\n %s', - // oldNode && oldNode.outerHTML, - // newNode && newNode.outerHTML - // ) - // } - var oldChild, newChild, morphed, oldMatch - - // The offset is only ever increased, and used for [i - offset] in the loop - var offset = 0 - - for (var i = 0; ; i++) { - oldChild = oldNode.childNodes[i] - newChild = newNode.childNodes[i - offset] - // if (DEBUG) { - // console.log( - // '===\n- old\n %s\n- new\n %s', - // oldChild && oldChild.outerHTML, - // newChild && newChild.outerHTML - // ) - // } - // Both nodes are empty, do nothing - if (!oldChild && !newChild) { - break - - // There is no new child, remove old - } else if (!newChild) { - oldNode.removeChild(oldChild) - i-- - - // There is no old child, add new - } else if (!oldChild) { - oldNode.appendChild(newChild) - offset++ - - // Both nodes are the same, morph - } else if (same(newChild, oldChild)) { - morphed = walk(newChild, oldChild) - if (morphed !== oldChild) { - oldNode.replaceChild(morphed, oldChild) - offset++ - } - - // Both nodes do not share an ID or a placeholder, try reorder - } else { - oldMatch = null - - // Try and find a similar node somewhere in the tree - for (var j = i; j < oldNode.childNodes.length; j++) { - if (same(oldNode.childNodes[j], newChild)) { - oldMatch = oldNode.childNodes[j] - break - } - } - - // If there was a node with the same ID or placeholder in the old list - if (oldMatch) { - morphed = walk(newChild, oldMatch) - if (morphed !== oldMatch) offset++ - oldNode.insertBefore(morphed, oldChild) - - // It's safe to morph two nodes in-place if neither has an ID - } else if (!newChild.id && !oldChild.id) { - morphed = walk(newChild, oldChild) - if (morphed !== oldChild) { - oldNode.replaceChild(morphed, oldChild) - offset++ - } - - // Insert the node at the index if we couldn't morph or find a matching node - } else { - oldNode.insertBefore(newChild, oldChild) - offset++ - } - } - } -} - -function same (a, b) { - if (a.id) return a.id === b.id - if (a.isSameNode) return a.isSameNode(b) - if (a.tagName !== b.tagName) return false - if (a.type === TEXT_NODE) return a.nodeValue === b.nodeValue - return false -} - -},{"./lib/morph":12,"assert":9}],11:[function(require,module,exports){ -module.exports = [ - // attribute events (can be set with attributes) - 'onclick', - 'ondblclick', - 'onmousedown', - 'onmouseup', - 'onmouseover', - 'onmousemove', - 'onmouseout', - 'onmouseenter', - 'onmouseleave', - 'ontouchcancel', - 'ontouchend', - 'ontouchmove', - 'ontouchstart', - 'ondragstart', - 'ondrag', - 'ondragenter', - 'ondragleave', - 'ondragover', - 'ondrop', - 'ondragend', - 'onkeydown', - 'onkeypress', - 'onkeyup', - 'onunload', - 'onabort', - 'onerror', - 'onresize', - 'onscroll', - 'onselect', - 'onchange', - 'onsubmit', - 'onreset', - 'onfocus', - 'onblur', - 'oninput', - // other common events - 'oncontextmenu', - 'onfocusin', - 'onfocusout' -] - -},{}],12:[function(require,module,exports){ -var events = require('./events') -var eventsLength = events.length - -var ELEMENT_NODE = 1 -var TEXT_NODE = 3 -var COMMENT_NODE = 8 - -module.exports = morph - -// diff elements and apply the resulting patch to the old node -// (obj, obj) -> null -function morph (newNode, oldNode) { - var nodeType = newNode.nodeType - var nodeName = newNode.nodeName - - if (nodeType === ELEMENT_NODE) { - copyAttrs(newNode, oldNode) - } - - if (nodeType === TEXT_NODE || nodeType === COMMENT_NODE) { - if (oldNode.nodeValue !== newNode.nodeValue) { - oldNode.nodeValue = newNode.nodeValue - } - } - - // Some DOM nodes are weird - // https://github.com/patrick-steele-idem/morphdom/blob/master/src/specialElHandlers.js - if (nodeName === 'INPUT') updateInput(newNode, oldNode) - else if (nodeName === 'OPTION') updateOption(newNode, oldNode) - else if (nodeName === 'TEXTAREA') updateTextarea(newNode, oldNode) - - copyEvents(newNode, oldNode) -} - -function copyAttrs (newNode, oldNode) { - var oldAttrs = oldNode.attributes - var newAttrs = newNode.attributes - var attrNamespaceURI = null - var attrValue = null - var fromValue = null - var attrName = null - var attr = null - - for (var i = newAttrs.length - 1; i >= 0; --i) { - attr = newAttrs[i] - attrName = attr.name - attrNamespaceURI = attr.namespaceURI - attrValue = attr.value - if (attrNamespaceURI) { - attrName = attr.localName || attrName - fromValue = oldNode.getAttributeNS(attrNamespaceURI, attrName) - if (fromValue !== attrValue) { - oldNode.setAttributeNS(attrNamespaceURI, attrName, attrValue) - } - } else { - if (!oldNode.hasAttribute(attrName)) { - oldNode.setAttribute(attrName, attrValue) - } else { - fromValue = oldNode.getAttribute(attrName) - if (fromValue !== attrValue) { - // apparently values are always cast to strings, ah well - if (attrValue === 'null' || attrValue === 'undefined') { - oldNode.removeAttribute(attrName) - } else { - oldNode.setAttribute(attrName, attrValue) - } - } - } - } - } - - // Remove any extra attributes found on the original DOM element that - // weren't found on the target element. - for (var j = oldAttrs.length - 1; j >= 0; --j) { - attr = oldAttrs[j] - if (attr.specified !== false) { - attrName = attr.name - attrNamespaceURI = attr.namespaceURI - - if (attrNamespaceURI) { - attrName = attr.localName || attrName - if (!newNode.hasAttributeNS(attrNamespaceURI, attrName)) { - oldNode.removeAttributeNS(attrNamespaceURI, attrName) - } - } else { - if (!newNode.hasAttributeNS(null, attrName)) { - oldNode.removeAttribute(attrName) - } - } - } - } -} - -function copyEvents (newNode, oldNode) { - for (var i = 0; i < eventsLength; i++) { - var ev = events[i] - if (newNode[ev]) { // if new element has a whitelisted attribute - oldNode[ev] = newNode[ev] // update existing element - } else if (oldNode[ev]) { // if existing element has it and new one doesnt - oldNode[ev] = undefined // remove it from existing element - } - } -} - -function updateOption (newNode, oldNode) { - updateAttribute(newNode, oldNode, 'selected') -} - -// The "value" attribute is special for the element since it sets the -// initial value. Changing the "value" attribute without changing the "value" -// property will have no effect since it is only used to the set the initial -// value. Similar for the "checked" attribute, and "disabled". -function updateInput (newNode, oldNode) { - var newValue = newNode.value - var oldValue = oldNode.value - - updateAttribute(newNode, oldNode, 'checked') - updateAttribute(newNode, oldNode, 'disabled') - - if (newValue !== oldValue) { - oldNode.setAttribute('value', newValue) - oldNode.value = newValue - } - - if (newValue === 'null') { - oldNode.value = '' - oldNode.removeAttribute('value') - } - - if (!newNode.hasAttributeNS(null, 'value')) { - oldNode.removeAttribute('value') - } else if (oldNode.type === 'range') { - // this is so elements like slider move their UI thingy - oldNode.value = newValue - } -} - -function updateTextarea (newNode, oldNode) { - var newValue = newNode.value - if (newValue !== oldNode.value) { - oldNode.value = newValue - } - - if (oldNode.firstChild && oldNode.firstChild.nodeValue !== newValue) { - // Needed for IE. Apparently IE sets the placeholder as the - // node value and vise versa. This ignores an empty update. - if (newValue === '' && oldNode.firstChild.nodeValue === oldNode.placeholder) { - return - } - - oldNode.firstChild.nodeValue = newValue - } -} - -function updateAttribute (newNode, oldNode, name) { - if (newNode[name] !== oldNode[name]) { - oldNode[name] = newNode[name] - if (newNode[name]) { - oldNode.setAttribute(name, '') - } else { - oldNode.removeAttribute(name) - } - } -} - -},{"./events":11}],13:[function(require,module,exports){ -/* global MutationObserver */ -var document = require('global/document') -var window = require('global/window') -var watch = Object.create(null) -var KEY_ID = 'onloadid' + (new Date() % 9e6).toString(36) -var KEY_ATTR = 'data-' + KEY_ID -var INDEX = 0 - -if (window && window.MutationObserver) { - var observer = new MutationObserver(function (mutations) { - if (Object.keys(watch).length < 1) return - for (var i = 0; i < mutations.length; i++) { - if (mutations[i].attributeName === KEY_ATTR) { - eachAttr(mutations[i], turnon, turnoff) - continue - } - eachMutation(mutations[i].removedNodes, turnoff) - eachMutation(mutations[i].addedNodes, turnon) - } - }) - observer.observe(document.body, { - childList: true, - subtree: true, - attributes: true, - attributeOldValue: true, - attributeFilter: [KEY_ATTR] - }) -} - -module.exports = function onload (el, on, off, caller) { - on = on || function () {} - off = off || function () {} - el.setAttribute(KEY_ATTR, 'o' + INDEX) - watch['o' + INDEX] = [on, off, 0, caller || onload.caller] - INDEX += 1 - return el -} - -function turnon (index, el) { - if (watch[index][0] && watch[index][2] === 0) { - watch[index][0](el) - watch[index][2] = 1 - } -} - -function turnoff (index, el) { - if (watch[index][1] && watch[index][2] === 1) { - watch[index][1](el) - watch[index][2] = 0 - } -} - -function eachAttr (mutation, on, off) { - var newValue = mutation.target.getAttribute(KEY_ATTR) - if (sameOrigin(mutation.oldValue, newValue)) { - watch[newValue] = watch[mutation.oldValue] - return - } - if (watch[mutation.oldValue]) { - off(mutation.oldValue, mutation.target) - } - if (watch[newValue]) { - on(newValue, mutation.target) - } -} - -function sameOrigin (oldValue, newValue) { - if (!oldValue || !newValue) return false - return watch[oldValue][3] === watch[newValue][3] -} - -function eachMutation (nodes, fn) { - var keys = Object.keys(watch) - for (var i = 0; i < nodes.length; i++) { - if (nodes[i] && nodes[i].getAttribute && nodes[i].getAttribute(KEY_ATTR)) { - var onloadid = nodes[i].getAttribute(KEY_ATTR) - keys.forEach(function (k) { - if (onloadid === k) { - fn(k, nodes[i]) - } - }) - } - if (nodes[i].childNodes.length > 0) { - eachMutation(nodes[i].childNodes, fn) - } - } -} - -},{"global/document":5,"global/window":6}]},{},[2]); diff --git a/node_modules/pelo/client.js b/node_modules/pelo/client.js deleted file mode 100644 index a8895d5f0..000000000 --- a/node_modules/pelo/client.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict' - -const nanomorph = require('nanomorph') - -const createApp = require('./app') - -const app = createApp() - -const root = document.getElementById('root') -const tree = root.firstElementChild -nanomorph(tree, app.render()) -app.onChange(() => { - nanomorph(tree, app.render()) -}) diff --git a/node_modules/pelo/index.js b/node_modules/pelo/index.js deleted file mode 100644 index 1fbe8a338..000000000 --- a/node_modules/pelo/index.js +++ /dev/null @@ -1,106 +0,0 @@ -'use strict' - -const Module = require('module') - -var BOOL_PROPS = [ - 'autofocus', 'checked', 'defaultchecked', 'disabled', 'formnovalidate', - 'indeterminate', 'readonly', 'required', 'selected', 'willvalidate' -] - -var BOOL_PROP_PATTERN = new RegExp(' (' + BOOL_PROPS.join('|') + '|onclick)=(""|\'\')', 'ig') -var DISABLED_PATTERN = new RegExp('disabled=("true"|\'true\')', 'ig') - -const replaceMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - '\'': ''' -} -const replaceMapRE = new RegExp(Object.keys(replaceMap).join('|'), 'g') - -function replaceMapper (matched){ - return replaceMap[matched] -} - -function escape (value) { - return value.toString().replace(replaceMapRE, replaceMapper) -} - -function handleValue (value) { - if (value === null || value === undefined || value === false) { - return '' - } - - if (Array.isArray(value)) { - // Suppose that each item is a result of html``. - return value.join('') - } - // Ignore event handlers. - // onclick=${(e) => doSomething(e)} - // will become - // onclick="" - const valueType = typeof value - if (valueType === 'function') { - return '' - } - - if (valueType === 'object' && value.constructor.name !== 'String') { - return objToString(value) - } - - if (value.__encoded) { - return value - } - - return escape(value) -} - -function stringify () { - var pieces = arguments[0] - var output = '' - for (var i = 0; i < pieces.length - 1; i++) { - var piece = pieces[i] - var value = handleValue(arguments[i + 1]) - if (piece[piece.length - 1] === '=') { - output += piece + '"' + value + '"' - } else { - output += piece + value - } - } - output += pieces[i] - output = output - .replace(DISABLED_PATTERN, 'disabled="disabled"') - .replace(BOOL_PROP_PATTERN, '') - - // HACK: Avoid double encoding by marking encoded string - // You cannot add properties to string literals - // eslint-disable-next-line no-new-wrappers - const wrapper = new String(output) - wrapper.__encoded = true - return wrapper -} - -function objToString (obj) { - var values = '' - const keys = Object.keys(obj) - for (var i = 0; i < keys.length - 1; i++) { - values += keys[i] + '="' + escape(obj[keys[i]] || '') + '" ' - } - return values + keys[i] + '="' + escape(obj[keys[i]] || '') + '"' -} - -function replace (moduleId) { - const originalRequire = Module.prototype.require - Module.prototype.require = function (id) { - if (id === moduleId) { - return stringify - } else { - return originalRequire.apply(this, arguments) - } - } -} - -stringify.replace = replace - -module.exports = stringify diff --git a/node_modules/pelo/package.json b/node_modules/pelo/package.json deleted file mode 100644 index f9da378ae..000000000 --- a/node_modules/pelo/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_from": "pelo@^0.1.0", - "_id": "pelo@0.1.0", - "_inBundle": false, - "_integrity": "sha512-+oVixa69fxS/X+3s1DaSJVQLG/ukHfjK2pHCmpIgjRChp73lnAfbqOYZ0MEo5C5yVkYeUJSoWAcRK0lx0hvOjQ==", - "_location": "/pelo", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "pelo@^0.1.0", - "name": "pelo", - "escapedName": "pelo", - "rawSpec": "^0.1.0", - "saveSpec": null, - "fetchSpec": "^0.1.0" - }, - "_requiredBy": [ - "/bel" - ], - "_resolved": "https://registry.npmjs.org/pelo/-/pelo-0.1.0.tgz", - "_shasum": "54157d3bc63c10da65504d6b801f0b535584c11b", - "_spec": "pelo@^0.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/bel", - "author": { - "name": "Shuhei Kagawa", - "email": "shuhei.kagawa@gmail.com" - }, - "bugs": { - "url": "https://github.com/shuhei/pelo/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Lightning fast server-side rendering with tagged template literals", - "devDependencies": { - "bel": "^4.6.0", - "browserify": "^14.3.0", - "html-minifier": "^3.5.6", - "nanomorph": "^5.1.3", - "standard": "^10.0.2", - "tape": "^4.8.0" - }, - "homepage": "https://github.com/shuhei/pelo", - "license": "ISC", - "main": "index.js", - "name": "pelo", - "repository": { - "type": "git", - "url": "git+https://github.com/shuhei/pelo.git" - }, - "scripts": { - "build": "browserify client.js > bundle.js", - "compare": "node compare.js", - "start": "npm run build && node server.js", - "test": "tape '**/*.test.js' && node benchmark.js" - }, - "version": "0.1.0" -} diff --git a/node_modules/pelo/server.js b/node_modules/pelo/server.js deleted file mode 100644 index c6d37e092..000000000 --- a/node_modules/pelo/server.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict' - -const http = require('http') -const fs = require('fs') - -const pelo = require('.') -pelo.replace('bel') -const createApp = require('./app') - -const app = createApp() - -function layout (content) { - return ` - - - - - Hello - - - -
    - ${content} -
    - - - - ` -} - -const server = http.createServer((req, res) => { - if (req.url === '/bundle.js') { - res.writeHead(200, { - 'Content-Type': 'text/javascript' - }) - fs.createReadStream('./bundle.js').pipe(res) - return - } - - const content = app.render() - const body = layout(content) - res.writeHead(200, { - 'Content-Type': 'text/html' - }) - res.end(body) -}) -server.on('listening', () => { - console.log('Listening on', server.address()); -}); -server.listen(8080) diff --git a/node_modules/pelo/yarn.lock b/node_modules/pelo/yarn.lock deleted file mode 100644 index 08bf7ce91..000000000 --- a/node_modules/pelo/yarn.lock +++ /dev/null @@ -1,2049 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -JSONStream@^1.0.3: - version "1.3.1" - resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.1.tgz#707f761e01dae9e16f1bcf93703b78c70966579a" - dependencies: - jsonparse "^1.2.0" - through ">=2.2.7 <3" - -acorn-jsx@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" - dependencies: - acorn "^3.0.4" - -acorn@^3.0.4: - version "3.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" - -acorn@^4.0.3: - version "4.0.11" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.11.tgz#edcda3bd937e7556410d42ed5860f67399c794c0" - -acorn@^5.0.1: - version "5.0.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.0.3.tgz#c460df08491463f028ccb82eab3730bf01087b3d" - -ajv-keywords@^1.0.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" - -ajv@^4.7.0: - version "4.11.7" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.7.tgz#8655a5d86d0824985cc471a1d913fb6729a0ec48" - dependencies: - co "^4.6.0" - json-stable-stringify "^1.0.1" - -ansi-escapes@^1.1.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - -argparse@^1.0.7: - version "1.0.9" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" - dependencies: - sprintf-js "~1.0.2" - -array-filter@~0.0.0: - version "0.0.1" - resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec" - -array-map@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" - -array-reduce@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b" - -array-union@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" - dependencies: - array-uniq "^1.0.1" - -array-uniq@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" - -array.prototype.find@^2.0.1: - version "2.0.4" - resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.0.4.tgz#556a5c5362c08648323ddaeb9de9d14bc1864c90" - dependencies: - define-properties "^1.1.2" - es-abstract "^1.7.0" - -arrify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - -asn1.js@^4.0.0: - version "4.9.1" - resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.1.tgz#48ba240b45a9280e94748990ba597d216617fd40" - dependencies: - bn.js "^4.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - -assert@^1.4.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" - dependencies: - util "0.10.3" - -astw@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/astw/-/astw-2.2.0.tgz#7bd41784d32493987aeb239b6b4e1c57a873b917" - dependencies: - acorn "^4.0.3" - -babel-code-frame@^6.16.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" - dependencies: - chalk "^1.1.0" - esutils "^2.0.2" - js-tokens "^3.0.0" - -balanced-match@^0.4.1: - version "0.4.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - -base64-js@^1.0.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.0.tgz#a39992d723584811982be5e290bb6a53d86700f1" - -bel@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/bel/-/bel-4.6.0.tgz#3ade16e236ab2204d8d1c66eac4bd573793ac999" - dependencies: - global "^4.3.0" - hyperx "^2.3.0" - on-load "^3.2.0" - -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: - version "4.11.6" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" - -brace-expansion@^1.0.0: - version "1.1.7" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.7.tgz#3effc3c50e000531fb720eaff80f0ae8ef23cf59" - dependencies: - balanced-match "^0.4.1" - concat-map "0.0.1" - -brace-expansion@^1.1.7: - version "1.1.8" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -brorand@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - -browser-pack@^6.0.1: - version "6.0.2" - resolved "https://registry.yarnpkg.com/browser-pack/-/browser-pack-6.0.2.tgz#f86cd6cef4f5300c8e63e07a4d512f65fbff4531" - dependencies: - JSONStream "^1.0.3" - combine-source-map "~0.7.1" - defined "^1.0.0" - through2 "^2.0.0" - umd "^3.0.0" - -browser-resolve@^1.11.0, browser-resolve@^1.7.0: - version "1.11.2" - resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" - dependencies: - resolve "1.1.7" - -browserify-aes@^1.0.0, browserify-aes@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.0.6.tgz#5e7725dbdef1fd5930d4ebab48567ce451c48a0a" - dependencies: - buffer-xor "^1.0.2" - cipher-base "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.0" - inherits "^2.0.1" - -browserify-cipher@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.0.tgz#9988244874bf5ed4e28da95666dcd66ac8fc363a" - dependencies: - browserify-aes "^1.0.4" - browserify-des "^1.0.0" - evp_bytestokey "^1.0.0" - -browserify-des@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.0.tgz#daa277717470922ed2fe18594118a175439721dd" - dependencies: - cipher-base "^1.0.1" - des.js "^1.0.0" - inherits "^2.0.1" - -browserify-rsa@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" - dependencies: - bn.js "^4.1.0" - randombytes "^2.0.1" - -browserify-sign@^4.0.0: - version "4.0.4" - resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" - dependencies: - bn.js "^4.1.1" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.2" - elliptic "^6.0.0" - inherits "^2.0.1" - parse-asn1 "^5.0.0" - -browserify-zlib@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" - dependencies: - pako "~1.0.5" - -browserify@^14.3.0: - version "14.5.0" - resolved "https://registry.yarnpkg.com/browserify/-/browserify-14.5.0.tgz#0bbbce521acd6e4d1d54d8e9365008efb85a9cc5" - dependencies: - JSONStream "^1.0.3" - assert "^1.4.0" - browser-pack "^6.0.1" - browser-resolve "^1.11.0" - browserify-zlib "~0.2.0" - buffer "^5.0.2" - cached-path-relative "^1.0.0" - concat-stream "~1.5.1" - console-browserify "^1.1.0" - constants-browserify "~1.0.0" - crypto-browserify "^3.0.0" - defined "^1.0.0" - deps-sort "^2.0.0" - domain-browser "~1.1.0" - duplexer2 "~0.1.2" - events "~1.1.0" - glob "^7.1.0" - has "^1.0.0" - htmlescape "^1.1.0" - https-browserify "^1.0.0" - inherits "~2.0.1" - insert-module-globals "^7.0.0" - labeled-stream-splicer "^2.0.0" - module-deps "^4.0.8" - os-browserify "~0.3.0" - parents "^1.0.1" - path-browserify "~0.0.0" - process "~0.11.0" - punycode "^1.3.2" - querystring-es3 "~0.2.0" - read-only-stream "^2.0.0" - readable-stream "^2.0.2" - resolve "^1.1.4" - shasum "^1.0.0" - shell-quote "^1.6.1" - stream-browserify "^2.0.0" - stream-http "^2.0.0" - string_decoder "~1.0.0" - subarg "^1.0.0" - syntax-error "^1.1.1" - through2 "^2.0.0" - timers-browserify "^1.0.1" - tty-browserify "~0.0.0" - url "~0.11.0" - util "~0.10.1" - vm-browserify "~0.0.1" - xtend "^4.0.0" - -buffer-shims@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" - -buffer-xor@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - -buffer@^5.0.2: - version "5.0.6" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.0.6.tgz#2ea669f7eec0b6eda05b08f8b5ff661b28573588" - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - -builtin-modules@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" - -builtin-status-codes@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" - -cached-path-relative@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cached-path-relative/-/cached-path-relative-1.0.1.tgz#d09c4b52800aa4c078e2dd81a869aac90d2e54e7" - -caller-path@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" - dependencies: - callsites "^0.2.0" - -callsites@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" - -camel-case@3.0.x: - version "3.0.0" - resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73" - dependencies: - no-case "^2.2.0" - upper-case "^1.1.1" - -chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -cipher-base@^1.0.0, cipher-base@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.3.tgz#eeabf194419ce900da3018c207d212f2a6df0a07" - dependencies: - inherits "^2.0.1" - -circular-json@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d" - -clean-css@4.1.x: - version "4.1.9" - resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.1.9.tgz#35cee8ae7687a49b98034f70de00c4edd3826301" - dependencies: - source-map "0.5.x" - -cli-cursor@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" - dependencies: - restore-cursor "^1.0.1" - -cli-width@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - -combine-source-map@~0.7.1: - version "0.7.2" - resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.7.2.tgz#0870312856b307a87cc4ac486f3a9a62aeccc09e" - dependencies: - convert-source-map "~1.1.0" - inline-source-map "~0.6.0" - lodash.memoize "~3.0.3" - source-map "~0.5.3" - -commander@2.11.x, commander@~2.11.0: - version "2.11.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - -concat-stream@^1.5.2, concat-stream@~1.5.0, concat-stream@~1.5.1: - version "1.5.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.5.2.tgz#708978624d856af41a5a741defdd261da752c266" - dependencies: - inherits "~2.0.1" - readable-stream "~2.0.0" - typedarray "~0.0.5" - -console-browserify@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" - dependencies: - date-now "^0.1.4" - -constants-browserify@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" - -contains-path@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" - -convert-source-map@~1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.1.3.tgz#4829c877e9fe49b3161f3bf3673888e204699860" - -core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - -create-ecdh@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.0.tgz#888c723596cdf7612f6498233eebd7a35301737d" - dependencies: - bn.js "^4.1.0" - elliptic "^6.0.0" - -create-hash@^1.1.0, create-hash@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.2.tgz#51210062d7bb7479f6c65bb41a92208b1d61abad" - dependencies: - cipher-base "^1.0.1" - inherits "^2.0.1" - ripemd160 "^1.0.0" - sha.js "^2.3.6" - -create-hmac@^1.1.0, create-hmac@^1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.4.tgz#d3fb4ba253eb8b3f56e39ea2fbcb8af747bd3170" - dependencies: - create-hash "^1.1.0" - inherits "^2.0.1" - -crypto-browserify@^3.0.0: - version "3.11.0" - resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.11.0.tgz#3652a0906ab9b2a7e0c3ce66a408e957a2485522" - dependencies: - browserify-cipher "^1.0.0" - browserify-sign "^4.0.0" - create-ecdh "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.0" - diffie-hellman "^5.0.0" - inherits "^2.0.1" - pbkdf2 "^3.0.3" - public-encrypt "^4.0.0" - randombytes "^2.0.0" - -d@1: - version "1.0.0" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" - dependencies: - es5-ext "^0.10.9" - -date-now@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" - -debug-log@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" - -debug@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" - dependencies: - ms "0.7.1" - -debug@^2.1.1, debug@^2.2.0: - version "2.6.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.4.tgz#7586a9b3c39741c0282ae33445c4e8ac74734fe0" - dependencies: - ms "0.7.3" - -deep-equal@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" - -deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - -define-properties@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" - dependencies: - foreach "^2.0.5" - object-keys "^1.0.8" - -defined@^1.0.0, defined@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" - -deglob@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/deglob/-/deglob-2.1.0.tgz#4d44abe16ef32c779b4972bd141a80325029a14a" - dependencies: - find-root "^1.0.0" - glob "^7.0.5" - ignore "^3.0.9" - pkg-config "^1.1.0" - run-parallel "^1.1.2" - uniq "^1.0.1" - -del@^2.0.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" - dependencies: - globby "^5.0.0" - is-path-cwd "^1.0.0" - is-path-in-cwd "^1.0.0" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - rimraf "^2.2.8" - -deps-sort@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/deps-sort/-/deps-sort-2.0.0.tgz#091724902e84658260eb910748cccd1af6e21fb5" - dependencies: - JSONStream "^1.0.3" - shasum "^1.0.0" - subarg "^1.0.0" - through2 "^2.0.0" - -des.js@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" - dependencies: - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - -detective@^4.0.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/detective/-/detective-4.5.0.tgz#6e5a8c6b26e6c7a254b1c6b6d7490d98ec91edd1" - dependencies: - acorn "^4.0.3" - defined "^1.0.0" - -diffie-hellman@^5.0.0: - version "5.0.2" - resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e" - dependencies: - bn.js "^4.1.0" - miller-rabin "^4.0.0" - randombytes "^2.0.0" - -doctrine@1.5.0, doctrine@^1.2.2: - version "1.5.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" - dependencies: - esutils "^2.0.2" - isarray "^1.0.0" - -doctrine@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.0.tgz#c73d8d2909d22291e1a007a395804da8b665fe63" - dependencies: - esutils "^2.0.2" - isarray "^1.0.0" - -dom-walk@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.1.tgz#672226dc74c8f799ad35307df936aba11acd6018" - -domain-browser@~1.1.0: - version "1.1.7" - resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc" - -duplexer2@^0.1.2, duplexer2@~0.1.0, duplexer2@~0.1.2: - version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" - dependencies: - readable-stream "^2.0.2" - -elliptic@^6.0.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df" - dependencies: - bn.js "^4.4.0" - brorand "^1.0.1" - hash.js "^1.0.0" - hmac-drbg "^1.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.0" - -error-ex@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" - dependencies: - is-arrayish "^0.2.1" - -es-abstract@^1.5.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.9.0.tgz#690829a07cae36b222e7fd9b75c0d0573eb25227" - dependencies: - es-to-primitive "^1.1.1" - function-bind "^1.1.1" - has "^1.0.1" - is-callable "^1.1.3" - is-regex "^1.0.4" - -es-abstract@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.7.0.tgz#dfade774e01bfcd97f96180298c449c8623fb94c" - dependencies: - es-to-primitive "^1.1.1" - function-bind "^1.1.0" - is-callable "^1.1.3" - is-regex "^1.0.3" - -es-to-primitive@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" - dependencies: - is-callable "^1.1.1" - is-date-object "^1.0.1" - is-symbol "^1.0.1" - -es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14: - version "0.10.15" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.15.tgz#c330a5934c1ee21284a7c081a86e5fd937c91ea6" - dependencies: - es6-iterator "2" - es6-symbol "~3.1" - -es6-iterator@2, es6-iterator@^2.0.1, es6-iterator@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.1.tgz#8e319c9f0453bf575d374940a655920e59ca5512" - dependencies: - d "1" - es5-ext "^0.10.14" - es6-symbol "^3.1" - -es6-map@^0.1.3: - version "0.1.5" - resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" - dependencies: - d "1" - es5-ext "~0.10.14" - es6-iterator "~2.0.1" - es6-set "~0.1.5" - es6-symbol "~3.1.1" - event-emitter "~0.3.5" - -es6-set@~0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" - dependencies: - d "1" - es5-ext "~0.10.14" - es6-iterator "~2.0.1" - es6-symbol "3.1.1" - event-emitter "~0.3.5" - -es6-symbol@3.1.1, es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1, es6-symbol@~3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" - dependencies: - d "1" - es5-ext "~0.10.14" - -es6-weak-map@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" - dependencies: - d "1" - es5-ext "^0.10.14" - es6-iterator "^2.0.1" - es6-symbol "^3.1.1" - -escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - -escope@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" - dependencies: - es6-map "^0.1.3" - es6-weak-map "^2.0.1" - esrecurse "^4.1.0" - estraverse "^4.1.1" - -eslint-config-standard-jsx@4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/eslint-config-standard-jsx/-/eslint-config-standard-jsx-4.0.2.tgz#009e53c4ddb1e9ee70b4650ffe63a7f39f8836e1" - -eslint-config-standard@10.2.1: - version "10.2.1" - resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-10.2.1.tgz#c061e4d066f379dc17cd562c64e819b4dd454591" - -eslint-import-resolver-node@^0.2.0: - version "0.2.3" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.2.3.tgz#5add8106e8c928db2cba232bcd9efa846e3da16c" - dependencies: - debug "^2.2.0" - object-assign "^4.0.1" - resolve "^1.1.6" - -eslint-module-utils@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.0.0.tgz#a6f8c21d901358759cdc35dbac1982ae1ee58bce" - dependencies: - debug "2.2.0" - pkg-dir "^1.0.0" - -eslint-plugin-import@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.2.0.tgz#72ba306fad305d67c4816348a4699a4229ac8b4e" - dependencies: - builtin-modules "^1.1.1" - contains-path "^0.1.0" - debug "^2.2.0" - doctrine "1.5.0" - eslint-import-resolver-node "^0.2.0" - eslint-module-utils "^2.0.0" - has "^1.0.1" - lodash.cond "^4.3.0" - minimatch "^3.0.3" - pkg-up "^1.0.0" - -eslint-plugin-node@~4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-4.2.2.tgz#82959ca9aed79fcbd28bb1b188d05cac04fb3363" - dependencies: - ignore "^3.0.11" - minimatch "^3.0.2" - object-assign "^4.0.1" - resolve "^1.1.7" - semver "5.3.0" - -eslint-plugin-promise@~3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-3.5.0.tgz#78fbb6ffe047201627569e85a6c5373af2a68fca" - -eslint-plugin-react@~6.10.0: - version "6.10.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-6.10.3.tgz#c5435beb06774e12c7db2f6abaddcbf900cd3f78" - dependencies: - array.prototype.find "^2.0.1" - doctrine "^1.2.2" - has "^1.0.1" - jsx-ast-utils "^1.3.4" - object.assign "^4.0.4" - -eslint-plugin-standard@~3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz#34d0c915b45edc6f010393c7eef3823b08565cf2" - -eslint@~3.19.0: - version "3.19.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.19.0.tgz#c8fc6201c7f40dd08941b87c085767386a679acc" - dependencies: - babel-code-frame "^6.16.0" - chalk "^1.1.3" - concat-stream "^1.5.2" - debug "^2.1.1" - doctrine "^2.0.0" - escope "^3.6.0" - espree "^3.4.0" - esquery "^1.0.0" - estraverse "^4.2.0" - esutils "^2.0.2" - file-entry-cache "^2.0.0" - glob "^7.0.3" - globals "^9.14.0" - ignore "^3.2.0" - imurmurhash "^0.1.4" - inquirer "^0.12.0" - is-my-json-valid "^2.10.0" - is-resolvable "^1.0.0" - js-yaml "^3.5.1" - json-stable-stringify "^1.0.0" - levn "^0.3.0" - lodash "^4.0.0" - mkdirp "^0.5.0" - natural-compare "^1.4.0" - optionator "^0.8.2" - path-is-inside "^1.0.1" - pluralize "^1.2.1" - progress "^1.1.8" - require-uncached "^1.0.2" - shelljs "^0.7.5" - strip-bom "^3.0.0" - strip-json-comments "~2.0.1" - table "^3.7.8" - text-table "~0.2.0" - user-home "^2.0.0" - -espree@^3.4.0: - version "3.4.2" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.2.tgz#38dbdedbedc95b8961a1fbf04734a8f6a9c8c592" - dependencies: - acorn "^5.0.1" - acorn-jsx "^3.0.0" - -esprima@^3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" - -esquery@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa" - dependencies: - estraverse "^4.0.0" - -esrecurse@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.1.0.tgz#4713b6536adf7f2ac4f327d559e7756bff648220" - dependencies: - estraverse "~4.1.0" - object-assign "^4.0.1" - -estraverse@^4.0.0, estraverse@^4.1.1, estraverse@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" - -estraverse@~4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.1.1.tgz#f6caca728933a850ef90661d0e17982ba47111a2" - -esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - -event-emitter@~0.3.5: - version "0.3.5" - resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" - dependencies: - d "1" - es5-ext "~0.10.14" - -events@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" - -evp_bytestokey@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz#497b66ad9fef65cd7c08a6180824ba1476b66e53" - dependencies: - create-hash "^1.1.1" - -exit-hook@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" - -fast-levenshtein@~2.0.4: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - -figures@^1.3.5: - version "1.7.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" - dependencies: - escape-string-regexp "^1.0.5" - object-assign "^4.1.0" - -file-entry-cache@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" - dependencies: - flat-cache "^1.2.1" - object-assign "^4.0.1" - -find-root@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.0.0.tgz#962ff211aab25c6520feeeb8d6287f8f6e95807a" - -find-up@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" - dependencies: - path-exists "^2.0.0" - pinkie-promise "^2.0.0" - -find-up@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - dependencies: - locate-path "^2.0.0" - -flat-cache@^1.2.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.2.tgz#fa86714e72c21db88601761ecf2f555d1abc6b96" - dependencies: - circular-json "^0.3.1" - del "^2.0.2" - graceful-fs "^4.1.2" - write "^0.2.1" - -for-each@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.2.tgz#2c40450b9348e97f281322593ba96704b9abd4d4" - dependencies: - is-function "~1.0.0" - -foreach@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - -function-bind@^1.0.2, function-bind@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" - -function-bind@^1.1.1, function-bind@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - -generate-function@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" - -generate-object-property@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" - dependencies: - is-property "^1.0.0" - -get-stdin@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" - -glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.0: - version "7.1.1" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.2" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@~7.1.2: - version "7.1.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -global@^4.3.0: - version "4.3.2" - resolved "https://registry.yarnpkg.com/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f" - dependencies: - min-document "^2.19.0" - process "~0.5.1" - -globals@^9.14.0: - version "9.17.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.17.0.tgz#0c0ca696d9b9bb694d2e5470bd37777caad50286" - -globby@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" - dependencies: - array-union "^1.0.1" - arrify "^1.0.0" - glob "^7.0.3" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - -graceful-fs@^4.1.2: - version "4.1.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - dependencies: - ansi-regex "^2.0.0" - -has@^1.0.0, has@^1.0.1, has@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" - dependencies: - function-bind "^1.0.2" - -hash.js@^1.0.0, hash.js@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.0.3.tgz#1332ff00156c0a0ffdd8236013d07b77a0451573" - dependencies: - inherits "^2.0.1" - -he@1.1.x: - version "1.1.1" - resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" - -hmac-drbg@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - dependencies: - hash.js "^1.0.3" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.1" - -html-minifier@^3.5.6: - version "3.5.6" - resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.6.tgz#7e4e661a09999599c7d8e8a2b8d7fb7430bb5c3e" - dependencies: - camel-case "3.0.x" - clean-css "4.1.x" - commander "2.11.x" - he "1.1.x" - ncname "1.0.x" - param-case "2.1.x" - relateurl "0.2.x" - uglify-js "3.1.x" - -htmlescape@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/htmlescape/-/htmlescape-1.1.1.tgz#3a03edc2214bca3b66424a3e7959349509cb0351" - -https-browserify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" - -hyperscript-attribute-to-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/hyperscript-attribute-to-property/-/hyperscript-attribute-to-property-1.0.0.tgz#825308d49bb8e2957923f731981bcc811cad7aff" - -hyperx@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/hyperx/-/hyperx-2.3.0.tgz#70f473d66d4ad550ddd1c83e4be2651276bbf1e2" - dependencies: - hyperscript-attribute-to-property "^1.0.0" - -ieee754@^1.1.4: - version "1.1.8" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" - -ignore@^3.0.11, ignore@^3.0.9, ignore@^3.2.0: - version "3.2.7" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.7.tgz#4810ca5f1d8eca5595213a34b94f2eb4ed926bbd" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - -indexof@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@^2.0.1, inherits@~2.0.1, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - -inherits@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" - -inline-source-map@~0.6.0: - version "0.6.2" - resolved "https://registry.yarnpkg.com/inline-source-map/-/inline-source-map-0.6.2.tgz#f9393471c18a79d1724f863fa38b586370ade2a5" - dependencies: - source-map "~0.5.3" - -inquirer@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" - dependencies: - ansi-escapes "^1.1.0" - ansi-regex "^2.0.0" - chalk "^1.0.0" - cli-cursor "^1.0.1" - cli-width "^2.0.0" - figures "^1.3.5" - lodash "^4.3.0" - readline2 "^1.0.1" - run-async "^0.1.0" - rx-lite "^3.1.2" - string-width "^1.0.1" - strip-ansi "^3.0.0" - through "^2.3.6" - -insert-module-globals@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/insert-module-globals/-/insert-module-globals-7.0.1.tgz#c03bf4e01cb086d5b5e5ace8ad0afe7889d638c3" - dependencies: - JSONStream "^1.0.3" - combine-source-map "~0.7.1" - concat-stream "~1.5.1" - is-buffer "^1.1.0" - lexical-scope "^1.2.0" - process "~0.11.0" - through2 "^2.0.0" - xtend "^4.0.0" - -interpret@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90" - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - -is-buffer@^1.1.0: - version "1.1.5" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc" - -is-callable@^1.1.1, is-callable@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2" - -is-date-object@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - -is-function@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" - -is-my-json-valid@^2.10.0: - version "2.16.0" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693" - dependencies: - generate-function "^2.0.0" - generate-object-property "^1.1.0" - jsonpointer "^4.0.0" - xtend "^4.0.0" - -is-path-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" - -is-path-in-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" - dependencies: - is-path-inside "^1.0.0" - -is-path-inside@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.0.tgz#fc06e5a1683fbda13de667aff717bbc10a48f37f" - dependencies: - path-is-inside "^1.0.1" - -is-property@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" - -is-regex@^1.0.3, is-regex@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" - dependencies: - has "^1.0.1" - -is-resolvable@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.0.tgz#8df57c61ea2e3c501408d100fb013cf8d6e0cc62" - dependencies: - tryit "^1.0.1" - -is-symbol@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" - -isarray@^1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - -isarray@~0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - -js-tokens@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" - -js-yaml@^3.5.1: - version "3.8.3" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.3.tgz#33a05ec481c850c8875929166fe1beb61c728766" - dependencies: - argparse "^1.0.7" - esprima "^3.1.1" - -json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" - dependencies: - jsonify "~0.0.0" - -json-stable-stringify@~0.0.0: - version "0.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz#611c23e814db375527df851193db59dd2af27f45" - dependencies: - jsonify "~0.0.0" - -jsonify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" - -jsonparse@^1.2.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.0.tgz#85fc245b1d9259acc6941960b905adf64e7de0e8" - -jsonpointer@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" - -jsx-ast-utils@^1.3.4: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz#3867213e8dd79bf1e8f2300c0cfc1efb182c0df1" - -labeled-stream-splicer@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/labeled-stream-splicer/-/labeled-stream-splicer-2.0.0.tgz#a52e1d138024c00b86b1c0c91f677918b8ae0a59" - dependencies: - inherits "^2.0.1" - isarray "~0.0.1" - stream-splicer "^2.0.0" - -levn@^0.3.0, levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -lexical-scope@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/lexical-scope/-/lexical-scope-1.2.0.tgz#fcea5edc704a4b3a8796cdca419c3a0afaf22df4" - dependencies: - astw "^2.0.0" - -load-json-file@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" - dependencies: - graceful-fs "^4.1.2" - parse-json "^2.2.0" - pify "^2.0.0" - strip-bom "^3.0.0" - -locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - dependencies: - p-locate "^2.0.0" - path-exists "^3.0.0" - -lodash.cond@^4.3.0: - version "4.5.2" - resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5" - -lodash.memoize@~3.0.3: - version "3.0.4" - resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f" - -lodash@^4.0.0, lodash@^4.3.0: - version "4.17.4" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" - -lower-case@^1.1.1: - version "1.1.4" - resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac" - -miller-rabin@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.0.tgz#4a62fb1d42933c05583982f4c716f6fb9e6c6d3d" - dependencies: - bn.js "^4.0.0" - brorand "^1.0.1" - -min-document@^2.19.0: - version "2.19.0" - resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" - dependencies: - dom-walk "^0.1.0" - -minimalistic-assert@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz#702be2dda6b37f4836bcb3f5db56641b64a1d3d3" - -minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" - -minimatch@^3.0.2, minimatch@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" - dependencies: - brace-expansion "^1.0.0" - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -minimist@^1.1.0, minimist@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - -mkdirp@^0.5.0, mkdirp@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - dependencies: - minimist "0.0.8" - -module-deps@^4.0.8: - version "4.1.1" - resolved "https://registry.yarnpkg.com/module-deps/-/module-deps-4.1.1.tgz#23215833f1da13fd606ccb8087b44852dcb821fd" - dependencies: - JSONStream "^1.0.3" - browser-resolve "^1.7.0" - cached-path-relative "^1.0.0" - concat-stream "~1.5.0" - defined "^1.0.0" - detective "^4.0.0" - duplexer2 "^0.1.2" - inherits "^2.0.1" - parents "^1.0.0" - readable-stream "^2.0.2" - resolve "^1.1.3" - stream-combiner2 "^1.1.1" - subarg "^1.0.0" - through2 "^2.0.0" - xtend "^4.0.0" - -ms@0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" - -ms@0.7.3: - version "0.7.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.3.tgz#708155a5e44e33f5fd0fc53e81d0d40a91be1fff" - -mute-stream@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" - -nanoassert@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/nanoassert/-/nanoassert-1.1.0.tgz#4f3152e09540fde28c76f44b19bbcd1d5a42478d" - -nanomorph@^5.1.3: - version "5.1.3" - resolved "https://registry.yarnpkg.com/nanomorph/-/nanomorph-5.1.3.tgz#65b81912bb32278aaa7aacc9ccd99b4508f6a21d" - dependencies: - nanoassert "^1.1.0" - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - -ncname@1.0.x: - version "1.0.0" - resolved "https://registry.yarnpkg.com/ncname/-/ncname-1.0.0.tgz#5b57ad18b1ca092864ef62b0b1ed8194f383b71c" - dependencies: - xml-char-classes "^1.0.0" - -no-case@^2.2.0: - version "2.3.2" - resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.2.tgz#60b813396be39b3f1288a4c1ed5d1e7d28b464ac" - dependencies: - lower-case "^1.1.1" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - -object-assign@^4.0.1, object-assign@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - -object-inspect@~1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.3.0.tgz#5b1eb8e6742e2ee83342a637034d844928ba2f6d" - -object-keys@^1.0.10, object-keys@^1.0.8: - version "1.0.11" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" - -object.assign@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.0.4.tgz#b1c9cc044ef1b9fe63606fc141abbb32e14730cc" - dependencies: - define-properties "^1.1.2" - function-bind "^1.1.0" - object-keys "^1.0.10" - -on-load@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/on-load/-/on-load-3.2.0.tgz#dd3145d3a5c2faa5666920d1df674b69f0c2f66f" - dependencies: - global "^4.3.0" - -once@^1.3.0: - version "1.3.3" - resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20" - dependencies: - wrappy "1" - -onetime@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" - -optionator@^0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.4" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - wordwrap "~1.0.0" - -os-browserify@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" - -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - -p-limit@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" - -p-locate@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - dependencies: - p-limit "^1.1.0" - -pako@~1.0.5: - version "1.0.6" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.6.tgz#0101211baa70c4bca4a0f63f2206e97b7dfaf258" - -param-case@2.1.x: - version "2.1.1" - resolved "https://registry.yarnpkg.com/param-case/-/param-case-2.1.1.tgz#df94fd8cf6531ecf75e6bef9a0858fbc72be2247" - dependencies: - no-case "^2.2.0" - -parents@^1.0.0, parents@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parents/-/parents-1.0.1.tgz#fedd4d2bf193a77745fe71e371d73c3307d9c751" - dependencies: - path-platform "~0.11.15" - -parse-asn1@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.0.tgz#37c4f9b7ed3ab65c74817b5f2480937fbf97c712" - dependencies: - asn1.js "^4.0.0" - browserify-aes "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.0" - pbkdf2 "^3.0.3" - -parse-json@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" - dependencies: - error-ex "^1.2.0" - -path-browserify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" - -path-exists@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" - dependencies: - pinkie-promise "^2.0.0" - -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - -path-is-inside@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - -path-parse@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" - -path-platform@~0.11.15: - version "0.11.15" - resolved "https://registry.yarnpkg.com/path-platform/-/path-platform-0.11.15.tgz#e864217f74c36850f0852b78dc7bf7d4a5721bf2" - -pbkdf2@^3.0.3: - version "3.0.9" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.9.tgz#f2c4b25a600058b3c3773c086c37dbbee1ffe693" - dependencies: - create-hmac "^1.1.2" - -pify@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - -pkg-conf@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-conf/-/pkg-conf-2.0.0.tgz#071c87650403bccfb9c627f58751bfe47c067279" - dependencies: - find-up "^2.0.0" - load-json-file "^2.0.0" - -pkg-config@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/pkg-config/-/pkg-config-1.1.1.tgz#557ef22d73da3c8837107766c52eadabde298fe4" - dependencies: - debug-log "^1.0.0" - find-root "^1.0.0" - xtend "^4.0.1" - -pkg-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" - dependencies: - find-up "^1.0.0" - -pkg-up@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-1.0.0.tgz#3e08fb461525c4421624a33b9f7e6d0af5b05a26" - dependencies: - find-up "^1.0.0" - -pluralize@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - -process-nextick-args@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" - -process@~0.11.0: - version "0.11.9" - resolved "https://registry.yarnpkg.com/process/-/process-0.11.9.tgz#7bd5ad21aa6253e7da8682264f1e11d11c0318c1" - -process@~0.5.1: - version "0.5.2" - resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf" - -progress@^1.1.8: - version "1.1.8" - resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" - -public-encrypt@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6" - dependencies: - bn.js "^4.1.0" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - parse-asn1 "^5.0.0" - randombytes "^2.0.1" - -punycode@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - -punycode@^1.3.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - -querystring-es3@~0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" - -querystring@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - -randombytes@^2.0.0, randombytes@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.3.tgz#674c99760901c3c4112771a31e521dc349cc09ec" - -read-only-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/read-only-stream/-/read-only-stream-2.0.0.tgz#2724fd6a8113d73764ac288d4386270c1dbf17f0" - dependencies: - readable-stream "^2.0.2" - -readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.6: - version "2.2.9" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.9.tgz#cf78ec6f4a6d1eb43d26488cac97f042e74b7fc8" - dependencies: - buffer-shims "~1.0.0" - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~1.0.0" - util-deprecate "~1.0.1" - -readable-stream@~2.0.0: - version "2.0.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - -readline2@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/readline2/-/readline2-1.0.1.tgz#41059608ffc154757b715d9989d199ffbf372e35" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - mute-stream "0.0.5" - -rechoir@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" - dependencies: - resolve "^1.1.6" - -relateurl@0.2.x: - version "0.2.7" - resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" - -require-uncached@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" - dependencies: - caller-path "^0.1.0" - resolve-from "^1.0.0" - -resolve-from@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" - -resolve@1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" - -resolve@^1.1.3, resolve@^1.1.4, resolve@^1.1.6, resolve@^1.1.7: - version "1.3.3" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" - dependencies: - path-parse "^1.0.5" - -resolve@~1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.4.0.tgz#a75be01c53da25d934a98ebd0e4c4a7312f92a86" - dependencies: - path-parse "^1.0.5" - -restore-cursor@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" - dependencies: - exit-hook "^1.0.0" - onetime "^1.0.0" - -resumer@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759" - dependencies: - through "~2.3.4" - -rimraf@^2.2.8: - version "2.6.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" - dependencies: - glob "^7.0.5" - -ripemd160@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-1.0.1.tgz#93a4bbd4942bc574b69a8fa57c71de10ecca7d6e" - -run-async@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389" - dependencies: - once "^1.3.0" - -run-parallel@^1.1.2: - version "1.1.6" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.6.tgz#29003c9a2163e01e2d2dfc90575f2c6c1d61a039" - -rx-lite@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" - -semver@5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" - -sha.js@^2.3.6, sha.js@~2.4.4: - version "2.4.8" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.8.tgz#37068c2c476b6baf402d14a49c67f597921f634f" - dependencies: - inherits "^2.0.1" - -shasum@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/shasum/-/shasum-1.0.2.tgz#e7012310d8f417f4deb5712150e5678b87ae565f" - dependencies: - json-stable-stringify "~0.0.0" - sha.js "~2.4.4" - -shell-quote@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767" - dependencies: - array-filter "~0.0.0" - array-map "~0.0.0" - array-reduce "~0.0.0" - jsonify "~0.0.0" - -shelljs@^0.7.5: - version "0.7.7" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.7.tgz#b2f5c77ef97148f4b4f6e22682e10bba8667cff1" - dependencies: - glob "^7.0.0" - interpret "^1.0.0" - rechoir "^0.6.2" - -slice-ansi@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" - -source-map@0.5.x: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - -source-map@~0.5.3: - version "0.5.6" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" - -source-map@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - -standard-engine@~7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/standard-engine/-/standard-engine-7.0.0.tgz#ebb77b9c8fc2c8165ffa353bd91ba0dff41af690" - dependencies: - deglob "^2.1.0" - get-stdin "^5.0.1" - minimist "^1.1.0" - pkg-conf "^2.0.0" - -standard@^10.0.2: - version "10.0.3" - resolved "https://registry.yarnpkg.com/standard/-/standard-10.0.3.tgz#7869bcbf422bdeeaab689a1ffb1fea9677dd50ea" - dependencies: - eslint "~3.19.0" - eslint-config-standard "10.2.1" - eslint-config-standard-jsx "4.0.2" - eslint-plugin-import "~2.2.0" - eslint-plugin-node "~4.2.2" - eslint-plugin-promise "~3.5.0" - eslint-plugin-react "~6.10.0" - eslint-plugin-standard "~3.0.1" - standard-engine "~7.0.0" - -stream-browserify@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" - dependencies: - inherits "~2.0.1" - readable-stream "^2.0.2" - -stream-combiner2@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/stream-combiner2/-/stream-combiner2-1.1.1.tgz#fb4d8a1420ea362764e21ad4780397bebcb41cbe" - dependencies: - duplexer2 "~0.1.0" - readable-stream "^2.0.2" - -stream-http@^2.0.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.7.0.tgz#cec1f4e3b494bc4a81b451808970f8b20b4ed5f6" - dependencies: - builtin-status-codes "^3.0.0" - inherits "^2.0.1" - readable-stream "^2.2.6" - to-arraybuffer "^1.0.0" - xtend "^4.0.0" - -stream-splicer@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/stream-splicer/-/stream-splicer-2.0.0.tgz#1b63be438a133e4b671cc1935197600175910d83" - dependencies: - inherits "^2.0.1" - readable-stream "^2.0.2" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -string-width@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.0.0.tgz#635c5436cc72a6e0c387ceca278d4e2eec52687e" - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^3.0.0" - -string.prototype.trim@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea" - dependencies: - define-properties "^1.1.2" - es-abstract "^1.5.0" - function-bind "^1.0.2" - -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - -string_decoder@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.0.tgz#f06f41157b664d86069f84bdbdc9b0d8ab281667" - dependencies: - buffer-shims "~1.0.0" - -strip-ansi@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - dependencies: - ansi-regex "^2.0.0" - -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - -strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - -subarg@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/subarg/-/subarg-1.0.0.tgz#f62cf17581e996b48fc965699f54c06ae268b8d2" - dependencies: - minimist "^1.1.0" - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - -syntax-error@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/syntax-error/-/syntax-error-1.3.0.tgz#1ed9266c4d40be75dc55bf9bb1cb77062bb96ca1" - dependencies: - acorn "^4.0.3" - -table@^3.7.8: - version "3.8.3" - resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" - dependencies: - ajv "^4.7.0" - ajv-keywords "^1.0.0" - chalk "^1.1.1" - lodash "^4.0.0" - slice-ansi "0.0.4" - string-width "^2.0.0" - -tape@^4.8.0: - version "4.8.0" - resolved "https://registry.yarnpkg.com/tape/-/tape-4.8.0.tgz#f6a9fec41cc50a1de50fa33603ab580991f6068e" - dependencies: - deep-equal "~1.0.1" - defined "~1.0.0" - for-each "~0.3.2" - function-bind "~1.1.0" - glob "~7.1.2" - has "~1.0.1" - inherits "~2.0.3" - minimist "~1.2.0" - object-inspect "~1.3.0" - resolve "~1.4.0" - resumer "~0.0.0" - string.prototype.trim "~1.1.2" - through "~2.3.8" - -text-table@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - -through2@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" - dependencies: - readable-stream "^2.1.5" - xtend "~4.0.1" - -"through@>=2.2.7 <3", through@^2.3.6, through@~2.3.4, through@~2.3.8: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - -timers-browserify@^1.0.1: - version "1.4.2" - resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-1.4.2.tgz#c9c58b575be8407375cb5e2462dacee74359f41d" - dependencies: - process "~0.11.0" - -to-arraybuffer@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" - -tryit@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" - -tty-browserify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - dependencies: - prelude-ls "~1.1.2" - -typedarray@~0.0.5: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - -uglify-js@3.1.x: - version "3.1.6" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.1.6.tgz#918832602036e95d2318e11f27ee8461a8592c5d" - dependencies: - commander "~2.11.0" - source-map "~0.6.1" - -umd@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/umd/-/umd-3.0.1.tgz#8ae556e11011f63c2596708a8837259f01b3d60e" - -uniq@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" - -upper-case@^1.1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-1.1.3.tgz#f6b4501c2ec4cdd26ba78be7222961de77621598" - -url@~0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - dependencies: - punycode "1.3.2" - querystring "0.2.0" - -user-home@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" - dependencies: - os-homedir "^1.0.0" - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - -util@0.10.3, util@~0.10.1: - version "0.10.3" - resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" - dependencies: - inherits "2.0.1" - -vm-browserify@~0.0.1: - version "0.0.4" - resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" - dependencies: - indexof "0.0.1" - -wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - -write@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" - dependencies: - mkdirp "^0.5.1" - -xml-char-classes@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/xml-char-classes/-/xml-char-classes-1.0.0.tgz#64657848a20ffc5df583a42ad8a277b4512bbc4d" - -xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" diff --git a/node_modules/pem/.eslintignore b/node_modules/pem/.eslintignore deleted file mode 100644 index 62562b74a..000000000 --- a/node_modules/pem/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -coverage -node_modules diff --git a/node_modules/pem/.eslintrc.js b/node_modules/pem/.eslintrc.js deleted file mode 100644 index 7d401489e..000000000 --- a/node_modules/pem/.eslintrc.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - 'env': { - 'mocha': true, - 'node': true - }, - 'extends': 'standard', - 'plugins': [ - 'markdown', - 'json' - ] -} diff --git a/node_modules/pem/.travis.yml b/node_modules/pem/.travis.yml deleted file mode 100644 index 26c43b66d..000000000 --- a/node_modules/pem/.travis.yml +++ /dev/null @@ -1,63 +0,0 @@ -language: node_js -sudo: required -notifications: - email: - recipients: - - github@josef-froehle.de - on_success: change - on_failure: change -node_js: - - '10' - - '8' - - '6' -env: - global: - - OPENSSL_DIR=/openssl - - TARGET=x86_64-unknown-linux-gnu - matrix: - - LIBRARY=openssl VERSION=0.9.8zh - - LIBRARY=openssl VERSION=1.0.1u - - LIBRARY=openssl VERSION=1.0.2p - - LIBRARY=openssl VERSION=1.1.0i - - LIBRARY=libressl VERSION=2.4.5 - - LIBRARY=libressl VERSION=2.6.5 - - LIBRARY=libressl VERSION=2.7.4 - - LIBRARY=libressl VERSION=2.8.0 -matrix: - exclude: - - node_js: '6' - - node_js: '8' - include: - - node_js: '6' - env: - - OPENSSL_DIR="" - - node_js: '8' - env: - - OPENSSL_DIR="" -before_install: - - sudo apt-get install -y haveged - - | - if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" != "false" ]]; then - #git clone "https://github.com/$TRAVIS_REPO_SLUG.git" "$TRAVIS_REPO_SLUG"; - #cd "$TRAVIS_REPO_SLUG"; - ( set -euo pipefail - if [[ "${TRAVIS_COMMIT}" != "$(git rev-parse HEAD)" ]]; then - echo "Commit $(git rev-parse HEAD) doesn't match expected commit ${TRAVIS_COMMIT}" - git checkout "${TRAVIS_COMMIT}" - fi - ) - fi -before_script: - - npm prune - - npm install -g travis-deploy-once - - sudo haveged -w 2048 -script: - - if [[ "$OPENSSL_DIR" != "" ]]; then "./bin/test_build_openssl.sh" ; fi - - npm run test -after_success: -# - if [[ "$TRAVIS_NODE_VERSION" == "8" && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then npm run aftersuccess ; fi - - if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then travis-deploy-once -b 3 && npm run changelog && npm run semantic-release ; fi -# - if [[ "$TRAVIS_NODE_VERSION" == "8" && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then npm run aftersuccess -- -push ; fi -branches: - except: - - /^v\d+\.\d+\.\d+$/ diff --git a/node_modules/pem/CHANGELOG.md b/node_modules/pem/CHANGELOG.md deleted file mode 100644 index 0529b2fa0..000000000 --- a/node_modules/pem/CHANGELOG.md +++ /dev/null @@ -1,38 +0,0 @@ -## [1.13.1](https://github.com/Dexus/pem/compare/v1.13.0...v1.13.1) (2018-09-14) - - -### Bug Fixes - -* **package:** remove -utf8 option ([4d10fb2](https://github.com/Dexus/pem/commit/4d10fb2)), closes [#214](https://github.com/Dexus/pem/issues/214) - -# [1.13.0](https://github.com/Dexus/pem/compare/v1.12.8...v1.13.0) (2018-09-11) - - -### Features - -* **package:** add promisify methods pem.promisify.FUNCTIONNAME ([8a0c1bc](https://github.com/Dexus/pem/commit/8a0c1bc)) - -## [1.12.8](https://github.com/Dexus/pem/compare/v1.12.7...v1.12.8) (2018-09-11) - - -### Bug Fixes - -* **package:** dep updates and fix deprecated api ([610a403](https://github.com/Dexus/pem/commit/610a403)) -* **package:** fix deprecated api ([6fdfd32](https://github.com/Dexus/pem/commit/6fdfd32)) -* **package:** fix deprecated api ([3fbe212](https://github.com/Dexus/pem/commit/3fbe212)) -* **pem:** allow utf8 charset in fields ([2cb97aa](https://github.com/Dexus/pem/commit/2cb97aa)) - -## [1.12.7](https://github.com/Dexus/pem/compare/v1.12.6...v1.12.7) (2018-09-11) - - -### Bug Fixes - -* **package:** fix fetchCertificate to list all infos ([3f13a0d](https://github.com/Dexus/pem/commit/3f13a0d)), closes [#196](https://github.com/Dexus/pem/issues/196) -* **package:** fix fetchCertificate to list all infos ([e6a8f3c](https://github.com/Dexus/pem/commit/e6a8f3c)), closes [#196](https://github.com/Dexus/pem/issues/196) - -## [1.12.6](https://github.com/Dexus/pem/compare/v1.12.5...v1.12.6) (2018-09-10) - - -### Bug Fixes - -* **package:** Update package ([ba9de04](https://github.com/Dexus/pem/commit/ba9de04)) diff --git a/node_modules/pem/CODE_OF_CONDUCT.md b/node_modules/pem/CODE_OF_CONDUCT.md deleted file mode 100644 index fc5296d01..000000000 --- a/node_modules/pem/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,84 +0,0 @@ -# Code of Conduct - -## 1. Purpose - -A primary goal of PEM is to be inclusive to the largest number of contributors, with the most varied and diverse backgrounds possible. As such, we are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion (or lack thereof). - -This code of conduct outlines our expectations for all those who participate in our community, as well as the consequences for unacceptable behavior. - -We invite all those who participate in PEM to help us create safe and positive experiences for everyone. - -## 2. Open Source Citizenship - -A supplemental goal of this Code of Conduct is to increase open source citizenship by encouraging participants to recognize and strengthen the relationships between our actions and their effects on our community. - -Communities mirror the societies in which they exist and positive action is essential to counteract the many forms of inequality and abuses of power that exist in society. - -If you see someone who is making an extra effort to ensure our community is welcoming, friendly, and encourages all participants to contribute to the fullest extent, we want to know. - -## 3. Expected Behavior - -The following behaviors are expected and requested of all community members: - -* Participate in an authentic and active way. In doing so, you contribute to the health and longevity of this community. -* Exercise consideration and respect in your speech and actions. -* Attempt collaboration before conflict. -* Refrain from demeaning, discriminatory, or harassing behavior and speech. -* Be mindful of your surroundings and of your fellow participants. Alert community leaders if you notice a dangerous situation, someone in distress, or violations of this Code of Conduct, even if they seem inconsequential. -* Remember that community event venues may be shared with members of the public; please be respectful to all patrons of these locations. - -## 4. Unacceptable Behavior - -The following behaviors are considered harassment and are unacceptable within our community: - -* Violence, threats of violence or violent language directed against another person. -* Sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory jokes and language. -* Posting or displaying sexually explicit or violent material. -* Posting or threatening to post other people’s personally identifying information ("doxing"). -* Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability. -* Inappropriate photography or recording. -* Inappropriate physical contact. You should have someone’s consent before touching them. -* Unwelcome sexual attention. This includes, sexualized comments or jokes; inappropriate touching, groping, and unwelcomed sexual advances. -* Deliberate intimidation, stalking or following (online or in person). -* Advocating for, or encouraging, any of the above behavior. -* Sustained disruption of community events, including talks and presentations. - -## 5. Consequences of Unacceptable Behavior - -Unacceptable behavior from any community member, including sponsors and those with decision-making authority, will not be tolerated. - -Anyone asked to stop unacceptable behavior is expected to comply immediately. - -If a community member engages in unacceptable behavior, the community organizers may take any action they deem appropriate, up to and including a temporary ban or permanent expulsion from the community without warning (and without refund in the case of a paid event). - -## 6. Reporting Guidelines - -If you are subject to or witness unacceptable behavior, or have any other concerns, please notify a community organizer as soon as possible. github@josef-froehle.de. - - - -Additionally, community organizers are available to help community members engage with local law enforcement or to otherwise help those experiencing unacceptable behavior feel safe. In the context of in-person events, organizers will also provide escorts as desired by the person experiencing distress. - -## 7. Addressing Grievances - -If you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify Dexus with a concise description of your grievance. Your grievance will be handled in accordance with our existing governing policies. - - - -## 8. Scope - -We expect all community participants (contributors, paid or otherwise; sponsors; and other guests) to abide by this Code of Conduct in all community venues–online and in-person–as well as in all one-on-one communications pertaining to community business. - -This code of conduct and its related procedures also applies to unacceptable behavior occurring outside the scope of community activities when such behavior has the potential to adversely affect the safety and well-being of community members. - -## 9. Contact info - -github@josef-froehle.de - -## 10. License and attribution - -This Code of Conduct is distributed under a [Creative Commons Attribution-ShareAlike license](http://creativecommons.org/licenses/by-sa/3.0/). - -Portions of text derived from the [Django Code of Conduct](https://www.djangoproject.com/conduct/) and the [Geek Feminism Anti-Harassment Policy](http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Policy). - -Retrieved on November 22, 2016 from [http://citizencodeofconduct.org/](http://citizencodeofconduct.org/) diff --git a/node_modules/pem/CONTRIBUTING.md b/node_modules/pem/CONTRIBUTING.md deleted file mode 100644 index 736f094bb..000000000 --- a/node_modules/pem/CONTRIBUTING.md +++ /dev/null @@ -1,78 +0,0 @@ -We love and appreciate contributions to Haraka. - -### To contribute money - -1. Create an issue -2. Use [Bountysource](https://www.bountysource.com/teams/dexus/issues) to post a bounty on that issue - -### To contribute code, use the Github "Pull Request" mechanism - -#### Overview - -1. fork, by clicking the Fork button on the [GitHub Project Page](https://github.com/Dexus/pem) -2. checkout a copy -3. create a branch -4. make changes -5. push changes to your fork -6. submit Pull Request - -#### Detailed Example - -```sh -export GHUSERNAME=CHANGE_THIS -git clone https://github.com/$GHUSERNAME/pem.git -cd pem -git checkout -b new_branch -$EDITOR lib/pem.js -git add lib/pem.js -git commit -git push origin new_branch -``` - -The `git commit` step(s) will launch you into `$EDITOR` where the first line should be a summary of the change(s) in less than 50 characters. Additional paragraphs can be added starting on line 3. - -To submit new_branch as a Pull Request, visit the [pem project page](https://github.com/Dexus/pem) where your recently pushed branches will appear with a green "Pull Request" button. - -### Rebase - -On branches with more than a couple commits, it's usually best to squash the commits (condense them into one) before submitting the change(s) as a PR. Notable exceptions to the single commit guideline are: - -* where there are multiple logical changes, put each in a commit (easier to review and revert) -* whitespace changes belong in their own commit -* no-op code refactoring is separate from functional changes - -To rebase: - -```sh -git remote add pem https://github.com/Dexus/pem.git -git remote update pem -git rebase -i pem/master -``` - -Change all but the first "pick" lines to "s" and save your changes. Your $EDITOR will then present you with all of the commit messages. Edit them and save. Then force push your branch: - -`git push -f` - -### General Guidelines - -* New features **must** be documented -* New features **should** include tests - -### Style conventions - -Standard Javascript - - -## Tests - -* run all tests: npm run test diff --git a/node_modules/pem/HISTORY.md b/node_modules/pem/HISTORY.md deleted file mode 100644 index 0dd944c04..000000000 --- a/node_modules/pem/HISTORY.md +++ /dev/null @@ -1,96 +0,0 @@ -### Changelog - -All notable changes to this project will be documented in this file. Dates are displayed in UTC. - -Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - -#### [v1.13.0](https://github.com/Dexus/pem/compare/v1.12.8...v1.13.0) - -> 11 September 2018 - -- chore(release): 1.13.0 [skip ci] [`d5a20dd`](https://github.com/Dexus/pem/commit/d5a20ddaa4a0a6b5a79a0ec11afd4757d7176501) -- feat(package): add promisify methods pem.promisify.FUNCTIONNAME [`8a0c1bc`](https://github.com/Dexus/pem/commit/8a0c1bc5f22b213fc4386212a036c2ccb2006524) -- chore(package): add auto-changelog for history.md [`3a90fcb`](https://github.com/Dexus/pem/commit/3a90fcb5f5e0980ce5b48bd31fe850fecd702856) - -#### [v1.12.8](https://github.com/Dexus/pem/compare/v1.12.7...v1.12.8) - -> 11 September 2018 - -- chore(release): 1.12.8 [skip ci] [`a3d8edb`](https://github.com/Dexus/pem/commit/a3d8edb194d5dd354a6adf0cfd5978255f86ae6e) -- chore(package): fix node version dep [`515a518`](https://github.com/Dexus/pem/commit/515a51839f44bd3ec127040ffe5a0276051ce113) -- fix(package): fix deprecated api [`6fdfd32`](https://github.com/Dexus/pem/commit/6fdfd3209c1dd5d50d829c2f6db73a7df43c260c) - -#### [v1.12.7](https://github.com/Dexus/pem/compare/v1.12.6...v1.12.7) - -> 11 September 2018 - -- fix(package): fix fetchCertificate to list all infos [`#196`](https://github.com/Dexus/pem/issues/196) -- fix(package): fix fetchCertificate to list all infos [`#196`](https://github.com/Dexus/pem/issues/196) -- chore(release): 1.12.7 [skip ci] [`7d33439`](https://github.com/Dexus/pem/commit/7d33439f2ec68360a1e0176d4888b3cd18664c0b) - -#### [v1.12.6](https://github.com/Dexus/pem/compare/v1.12.5...v1.12.6) - -> 10 September 2018 - -- Added support for -CAserial flag via options.serialFile for createCer… [`#171`](https://github.com/Dexus/pem/pull/171) -- Fix broken public key detection from PKCS#8 formatted private keys [`#212`](https://github.com/Dexus/pem/pull/212) -- Added support to specify the parameter encoding of an ecparam key [`#207`](https://github.com/Dexus/pem/pull/207) -- Update travis-deploy-once to the latest version 🚀 [`#199`](https://github.com/Dexus/pem/pull/199) -- Update eslint-plugin-import to the latest version 🚀 [`#194`](https://github.com/Dexus/pem/pull/194) -- chore(release): 1.12.6 [skip ci] [`6975c5d`](https://github.com/Dexus/pem/commit/6975c5d7086dee5261514cf050efd16d55abcdec) -- fix(package): Update package [`ba9de04`](https://github.com/Dexus/pem/commit/ba9de04149bd877f6cf1bef3f0a854a6b8852e8a) -- fix(package) Update package [`40b8f42`](https://github.com/Dexus/pem/commit/40b8f42ce52766fc64824a625487bef1ffdb467c) - -#### [v1.12.5](https://github.com/Dexus/pem/compare/v1.12.4...v1.12.5) - -> 9 April 2018 - -- fix: Ensure synchronous tmpfile writes, deletes [`37d7cdd`](https://github.com/Dexus/pem/commit/37d7cddecc2fc8eefd7192d85c4115ea3c45db31) -- Ensure synchronous tmpfile writes, deletes [`85a00fb`](https://github.com/Dexus/pem/commit/85a00fbd65b50db7508f094d5ffb4f20d5ef0392) -- update bin/aftersuccess.sh [`371cc25`](https://github.com/Dexus/pem/commit/371cc254ba12e488b9925da21cdd9f17f69107a3) - -#### [v1.12.4](https://github.com/Dexus/pem/compare/v1.12.3...v1.12.4) - -> 4 April 2018 - -- fix: pin eslint-plugin-import to 2.10.0 [`#191`](https://github.com/Dexus/pem/pull/191) -- chore(package): update semantic-release to version 15.1.5 [`#190`](https://github.com/Dexus/pem/pull/190) -- chore(package): update cross-env to version 5.1.4 [`#189`](https://github.com/Dexus/pem/pull/189) -- Update eslint-config-standard to the latest version 🚀 [`#186`](https://github.com/Dexus/pem/pull/186) -- Update eslint-plugin-node to the latest version 🚀 [`#185`](https://github.com/Dexus/pem/pull/185) -- Update mocha to the latest version 🚀 [`#183`](https://github.com/Dexus/pem/pull/183) -- Update semantic-release to the latest version 🚀 [`#182`](https://github.com/Dexus/pem/pull/182) -- Update semantic-release to the latest version 🚀 [`#178`](https://github.com/Dexus/pem/pull/178) -- Update travis-deploy-once to the latest version 🚀 [`#181`](https://github.com/Dexus/pem/pull/181) -- chore(package): update cross-env to version 5.1.2 [`#180`](https://github.com/Dexus/pem/pull/180) -- Update docco to the latest version 🚀 [`#177`](https://github.com/Dexus/pem/pull/177) -- readCertificateInfo reports email addresses in subjectAltName field [`#170`](https://github.com/Dexus/pem/pull/170) -- chore(package): update semantic-release to version 15.1.5 [`#182`](https://github.com/Dexus/pem/issues/182) -- Update HISTORY.md via TravisCI [`8e89517`](https://github.com/Dexus/pem/commit/8e895178e7701e4f0fea7a5d98a41be10a4ce457) -- Update aftersuccess.sh [`e64edc9`](https://github.com/Dexus/pem/commit/e64edc98eea628736eb4d0ab04add946f878a989) -- Update aftersuccess.sh [`91df068`](https://github.com/Dexus/pem/commit/91df068ec55ec65cda9c62d55503f1a1ad6424d6) - -#### [v1.12.3](https://github.com/Dexus/pem/compare/v1.12.2...v1.12.3) - -> 10 October 2017 - -- Update HISTORY.md via TravisCI [`904f74d`](https://github.com/Dexus/pem/commit/904f74dd3c53ec2c68551230e518fd16af7b2efd) -- fix(package): #117 verifySigningChain optional CA certificates [`b6aafd4`](https://github.com/Dexus/pem/commit/b6aafd4909cca8b6a1b660eb42561b0dc5d1d5fa) - -#### [v1.12.2](https://github.com/Dexus/pem/compare/v1.12.1...v1.12.2) - -> 8 October 2017 - -- fix #150: serial can now be an 20 octets string, number or hex [`#150`](https://github.com/Dexus/pem/issues/150) -- Update HISTORY.md via TravisCI [`b58a0b2`](https://github.com/Dexus/pem/commit/b58a0b2ea8af3620337de3bf17dfebf21a5dd353) -- fix(package): build and release #150 fix and create HISTORY after release. [`e948217`](https://github.com/Dexus/pem/commit/e948217f34157024ec629d5d1111cbcef0c94e6a) -- chore(release-flow): change HISTORY.md only on master [`6da3254`](https://github.com/Dexus/pem/commit/6da325403b80a06d91d0cca2c46667c07414dbf5) - -#### v1.12.1 - -> 7 October 2017 - -- fix #159; renamed helper methods [`#159`](https://github.com/Dexus/pem/issues/159) -- change template for docs [`10672e4`](https://github.com/Dexus/pem/commit/10672e4d2d7e0c9e856e5bc1af90c4977da2ee8b) -- update template for docs [`2f95e38`](https://github.com/Dexus/pem/commit/2f95e3802ca2c742ec3c9f09591d4d34be165158) -- fix(tests): renamed helper functions [`0073032`](https://github.com/Dexus/pem/commit/007303276a16a03394361ab290d3d93a74ed77c8) diff --git a/node_modules/pem/LICENSE b/node_modules/pem/LICENSE deleted file mode 100644 index 6723091a7..000000000 --- a/node_modules/pem/LICENSE +++ /dev/null @@ -1,17 +0,0 @@ -Copyright (c) 2012 Andris Reinman -Copyright (c) 2016 Josef Fröhle - -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 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. \ No newline at end of file diff --git a/node_modules/pem/README.md b/node_modules/pem/README.md deleted file mode 100644 index 010d54b12..000000000 --- a/node_modules/pem/README.md +++ /dev/null @@ -1,332 +0,0 @@ -pem -=== - -Create private keys and certificates with node.js - -[![Build Status](https://secure.travis-ci.org/Dexus/pem.png)](http://travis-ci.org/Dexus/pem) [![npm version](https://badge.fury.io/js/pem.svg)](http://badge.fury.io/js/pem) [![npm downloads](https://img.shields.io/npm/dt/pem.svg)](https://www.npmjs.com/package/pem) [![pem documentation](https://img.shields.io/badge/pem-documentation-0099ff.svg?style=flat)](https://www.deineagentur.com/projects/pem) [![Greenkeeper badge](https://badges.greenkeeper.io/Dexus/pem.svg)](https://greenkeeper.io/) - - -[![JavaScript Style Guide](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/standard/standard) - -## Installation - -Install with npm - - npm install pem - -## Examples - -Here are some examples for creating an SSL key/cert on the fly, and running an HTTPS server on port 443. 443 is the standard HTTPS port, but requires root permissions on most systems. To get around this, you could use a higher port number, like 4300, and use https://localhost:4300 to access your server. - -### Basic https -```javascript -var https = require('https') -var pem = require('pem') - -pem.createCertificate({ days: 1, selfSigned: true }, function (err, keys) { - if (err) { - throw err - } - https.createServer({ key: keys.serviceKey, cert: keys.certificate }, function (req, res) { - res.end('o hai!') - }).listen(443) -}) -``` - -### Express -```javascript -var https = require('https') -var pem = require('pem') -var express = require('express') - -pem.createCertificate({ days: 1, selfSigned: true }, function (err, keys) { - if (err) { - throw err - } - var app = express() - - app.get('/', function (req, res) { - res.send('o hai!') - }) - - https.createServer({ key: keys.serviceKey, cert: keys.certificate }, app).listen(443) -}) -``` - -## API -Please have a look into the [API documentation](https://www.deineagentur.com/projects/pem/index.html). - -_we had to clean up a bit_ - - -### Custom extensions config file - -You can specify custom OpenSSL extensions using the `config` or `extFile` options for `createCertificate` (or using `csrConfigFile` with `createCSR`). - -`extFile` and `csrConfigFile` should be paths to the extension files. While `config` will generate a temporary file from the supplied file contents. - -If you specify `config` then the `v3_req` section of your config file will be used. - -The following would be an example of a Certificate Authority extensions file: - - [req] - req_extensions = v3_req - distinguished_name = req_distinguished_name - - [req_distinguished_name] - commonName = Common Name - commonName_max = 64 - - [v3_req] - basicConstraints = critical,CA:TRUE - -While the following would specify subjectAltNames in the resulting certificate: - - [req] - req_extensions = v3_req - - [ v3_req ] - basicConstraints = CA:FALSE - keyUsage = nonRepudiation, digitalSignature, keyEncipherment - subjectAltName = @alt_names - - [alt_names] - DNS.1 = host1.example.com - DNS.2 = host2.example.com - DNS.3 = host3.example.com - -Note that `createCertificate` and `createCSR` supports the `altNames` option which would be easier to use in most cases. - -**Warning: If you specify `altNames` the custom extensions file will not be passed to OpenSSL.** - -### Setting openssl location - -In some systems the `openssl` executable might not be available by the default name or it is not included in $PATH. In this case you can define the location of the executable yourself as a one time action after you have loaded the pem module: - -```javascript -var pem = require('pem') -pem.config({ - pathOpenSSL: '/usr/local/bin/openssl' -}) -// do something with the pem module -``` - -### Specialthanks to - -- Andris Reinman (@andris9) - Initiator of pem - -## License - -**MIT** diff --git a/node_modules/pem/bin/test_build_openssl.sh b/node_modules/pem/bin/test_build_openssl.sh deleted file mode 100755 index bf61dd522..000000000 --- a/node_modules/pem/bin/test_build_openssl.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -set -e - -if [ -d "${OPENSSL_DIR}" ]; then - exit 0 -fi - -NORMALPATH=$(pwd) - -sudo apt-get install -y --no-install-recommends curl - -case "${LIBRARY}" in -"libressl") - URL1="http://ftp.eu.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${VERSION}.tar.gz" - URL2="http://ftp3.usa.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${VERSION}.tar.gz" - ;; -"openssl") - URL1="https://openssl.org/source/openssl-${VERSION}.tar.gz" - URL2="http://mirrors.ibiblio.org/openssl/source/openssl-${VERSION}.tar.gz" - ;; -esac - -case "${TARGET}" in -"x86_64-unknown-linux-gnu") - OS_COMPILER=linux-x86_64 - ;; -"i686-unknown-linux-gnu") - OS_COMPILER=linux-elf - OS_FLAGS=-m32 - ;; -"arm-unknown-linux-gnueabihf") - OS_COMPILER=linux-armv4 - export AR=arm-linux-gnueabihf-ar - export CC=arm-linux-gnueabihf-gcc - ;; -esac - -mkdir -p /tmp/build -cd /tmp/build - -OUT=/tmp/openssl.tgz -MAX_REDIRECTS=5 -curl -o ${OUT} -L --max-redirs ${MAX_REDIRECTS} "${URL1}" \ - || curl -o ${OUT} -L --max-redirs ${MAX_REDIRECTS} "${URL2}" - -tar --strip-components=1 -xzf ${OUT} - -case "${LIBRARY}" in -"openssl") - ./Configure --prefix="${OPENSSL_DIR}" ${OS_COMPILER} -fPIC -g ${OS_FLAGS} no-shared -static - ;; -"libressl") - ./configure --prefix="${OPENSSL_DIR}" --disable-shared --with-pic - ;; -esac - -make "-j$(nproc)" -sudo make install_sw - -case "${LIBRARY}" in -"openssl") - if [[ ! -f "${OPENSSL_DIR}/ssl/openssl.cnf" ]]; then sudo mkdir -p "${OPENSSL_DIR}/ssl" && sudo cp apps/openssl.cnf "${OPENSSL_DIR}/ssl/openssl.cnf" ; fi - ;; -"libressl") - if [[ ! -f "${OPENSSL_DIR}/ssl/openssl.cnf" ]]; then sudo mkdir -p "${OPENSSL_DIR}/ssl" && sudo cp apps/openssl/openssl.cnf "${OPENSSL_DIR}/ssl/openssl.cnf" ; fi - ;; -esac - -sudo chmod -Rf 0755 /openssl - -cd "${NORMALPATH}" - -rm -r -f node_modules && npm i diff --git a/node_modules/pem/jsdoc.json b/node_modules/pem/jsdoc.json deleted file mode 100644 index fb02f7513..000000000 --- a/node_modules/pem/jsdoc.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "tags": { - "allowUnknownTags": false - }, - "source": { - "include": "./lib", - "includePattern": ".js$", - "excludePattern": "(node_modules/|test/|docs)" - }, - "plugins": ["plugins/markdown"], - "templates": { - "cleverLinks": true, - "monospaceLinks": true, - "outputSourceFiles": true, - "outputSourcePath": true, - "dateFormat": "MMMM Do YYYY, HH:mm Z", - "systemName": "pem", - "footer": "", - "copyright": "Copyright (c) 2012 Andris Reinman; 2016 Josef Fröhle", - "navType": "vertical", - "linenums": true, - "collapseSymbols": false, - "inverseNav": true, - "highlightTutorialCode": true, - "protocol": "html://", - "syntaxTheme": "dark" - }, - "markdown": { - "parser": "gfm", - "hardwrap": true - }, - "opts": { - "verbose": true, - "encoding": "utf8", - "destination": "docs/jsdoc/", - "recurse": true, - "readme": "./README.md", - "template": "node_modules/@deineagenturug/docdash" - }, - "docdash": { - "static": true, - "sort": true - } -} diff --git a/node_modules/pem/lib/convert.js b/node_modules/pem/lib/convert.js deleted file mode 100644 index 3096a6c83..000000000 --- a/node_modules/pem/lib/convert.js +++ /dev/null @@ -1,278 +0,0 @@ -'use strict' - -var openssl = require('./openssl.js') -var helper = require('./helper.js') - -// PEM format: .pem, .crt, .cer (!bin), .key -// base64 encoded; the cert file might also include the private key; so key file is optional - -// DER format: .der, .cer (bin) -// binary encoded format; cannot include key file - -// PKCS#7 / P7B format: .p7b, .p7c -// contains cert and ca chain cert files, but not the key file -// A PKCS7 certificate is serialized using either PEM or DER format. - -// PKCS#12 / PFX format: .pfx, .p12 -// contains all files: key file, cert and ca chain cert files - -/** - * pem convert module - * - * @module convert - */ - -/** - * conversion from PEM to DER format - * if private key is included in PEM encoded file, it won't be included in DER file - * use this method with type 'rsa' to export private key in that case - * @param {String} pathIN path of the PEM encoded certificate file - * @param {String} pathOUT path of the DER encoded certificate file to generate - * @param {String} [type] type of file, use 'rsa' for key file, 'x509' otherwise or leave this parameter out - * @param {Function} callback callback method called with error, boolean result - */ -module.exports.PEM2DER = function (pathIN, pathOUT, type, callback) { - if (!callback && typeof type === 'function') { - callback = type - type = 'x509' - } - var params = [ - type, - '-outform', - 'der', - '-in', - pathIN, - '-out', - pathOUT - ] - openssl.spawnWrapper(params, false, function (error, code) { - if (error) { - callback(error) - } else { - callback(null, code === 0) - } - }) -} - -/** - * conversion from DER to PEM format - * @param {String} pathIN path of the DER encoded certificate file - * @param {String} pathOUT path of the PEM encoded certificate file to generate - * @param {String} [type] type of file, use 'rsa' for key file, 'x509' otherwise or leave this parameter out - * @param {Function} callback callback method called with error, boolean result - */ -module.exports.DER2PEM = function (pathIN, pathOUT, type, callback) { - if (!callback && typeof type === 'function') { - callback = type - type = 'x509' - } - var params = [ - type, - '-inform', - 'der', - '-in', - pathIN, - '-out', - pathOUT - ] - openssl.spawnWrapper(params, false, function (error, code) { - if (error) { - callback(error) - } else { - callback(null, code === 0) - } - }) -} - -/** - * conversion from PEM to P7B format - * @param {Object} pathBundleIN paths of the PEM encoded certificate files ({cert: '...', ca: '...' or ['...', ...]}) - * @param {String} pathOUT path of the P7B encoded certificate file to generate - * @param {Function} callback callback method called with error, boolean result - */ -module.exports.PEM2P7B = function (pathBundleIN, pathOUT, callback) { - var params = [ - 'crl2pkcs7', - '-nocrl', - '-certfile', - pathBundleIN.cert, - '-out', - pathOUT - ] - if (pathBundleIN.ca) { - if (!Array.isArray(pathBundleIN.ca)) { - pathBundleIN.ca = [ pathBundleIN.ca ] - } - pathBundleIN.ca.forEach(function (ca) { - params.push('-certfile') - params.push(ca) - }) - } - openssl.spawnWrapper(params, false, function (error, code) { - if (error) { - callback(error) - } else { - callback(null, code === 0) - } - }) -} - -/** - * conversion from P7B to PEM format - * @param {String} pathIN path of the P7B encoded certificate file - * @param {String} pathOUT path of the PEM encoded certificate file to generate - * @param {Function} callback callback method called with error, boolean result - */ -module.exports.P7B2PEM = function (pathIN, pathOUT, callback) { - var params = [ - 'pkcs7', - '-print_certs', - '-in', - pathIN, - '-out', - pathOUT - ] - openssl.spawnWrapper(params, false, function (error, code) { - if (error) { - callback(error) - } else { - callback(null, code === 0) - } - }) -}// TODO: CA also included? - -/** - * conversion from PEM to PFX - * @param {Object} pathBundleIN paths of the PEM encoded certificate files ({cert: '...', key: '...', ca: '...' or ['...', ...]}) - * @param {String} pathOUT path of the PFX encoded certificate file to generate - * @param {String} password password to set for accessing the PFX file - * @param {Function} callback callback method called with error, boolean result - */ -module.exports.PEM2PFX = function (pathBundleIN, pathOUT, password, callback) { - var params = [ - 'pkcs12', - '-export', - '-out', - pathOUT, - '-inkey', - pathBundleIN.key, - '-in', - pathBundleIN.cert - ] - if (pathBundleIN.ca) { - if (!Array.isArray(pathBundleIN.ca)) { - pathBundleIN.ca = [ pathBundleIN.ca ] - } - pathBundleIN.ca.forEach(function (ca) { - params.push('-certfile') - params.push(ca) - }) - } - var delTempPWFiles = [] - helper.createPasswordFile({ 'cipher': '', 'password': password, 'passType': 'in' }, params, delTempPWFiles[delTempPWFiles.length]) - helper.createPasswordFile({ 'cipher': '', 'password': password, 'passType': 'out' }, params, delTempPWFiles[delTempPWFiles.length]) - openssl.spawnWrapper(params, false, function (error, code) { - function done (error) { - if (error) { - callback(error) - } else { - callback(null, code === 0) - } - } - helper.deleteTempFiles(delTempPWFiles, function (fsErr) { - done(error || fsErr) - }) - }) -} - -/** - * conversion from PFX to PEM - * @param {Object} pathIN path of the PFX encoded certificate file - * @param {String} pathOUT path of the PEM encoded certificate file to generate - * @param {String} password password to set for accessing the PFX file - * @param {Function} callback callback method called with error, boolean result - */ -module.exports.PFX2PEM = function (pathIN, pathOUT, password, callback) { - var params = [ - 'pkcs12', - '-in', - pathIN, - '-out', - pathOUT, - '-nodes' - ] - var delTempPWFiles = [] - helper.createPasswordFile({ 'cipher': '', 'password': password, 'passType': 'in' }, params, delTempPWFiles[delTempPWFiles.length]) - helper.createPasswordFile({ 'cipher': '', 'password': password, 'passType': 'out' }, params, delTempPWFiles[delTempPWFiles.length]) - openssl.spawnWrapper(params, false, function (error, code) { - function done (error) { - if (error) { - callback(error) - } else { - callback(null, code === 0) - } - } - helper.deleteTempFiles(delTempPWFiles, function (fsErr) { - done(error || fsErr) - }) - }) -} - -/** - * conversion from P7B to PFX/PKCS#12 - * @param {Object} pathBundleIN paths of the PEM encoded certificate files ({cert: '...', key: '...', ca: '...' or ['...', ...]}) - * @param {String} pathOUT path of the PFX certificate file to generate - * @param {String} password password to be set for the PFX file and to be used to access the key file - * @param {Function} callback callback method called with error, boolean result - */ -module.exports.P7B2PFX = function (pathBundleIN, pathOUT, password, callback) { - var tmpfile = pathBundleIN.cert.replace(/\.[^.]+$/, '.cer') - var params = [ - 'pkcs7', - '-print_certs', - '-in', - pathBundleIN.cert, - '-out', - tmpfile - ] - openssl.spawnWrapper(params, false, function (error, code) { - if (error) { - callback(error) - } else { - var params = [ - 'pkcs12', - '-export', - '-in', - tmpfile, - '-inkey', - pathBundleIN.key, - '-out', - pathOUT - ] - if (pathBundleIN.ca) { - if (!Array.isArray(pathBundleIN.ca)) { - pathBundleIN.ca = [ pathBundleIN.ca ] - } - pathBundleIN.ca.forEach(function (ca) { - params.push('-certfile') - params.push(ca) - }) - } - var delTempPWFiles = [tmpfile] - helper.createPasswordFile({ 'cipher': '', 'password': password, 'passType': 'in' }, params, delTempPWFiles[delTempPWFiles.length]) - helper.createPasswordFile({ 'cipher': '', 'password': password, 'passType': 'out' }, params, delTempPWFiles[delTempPWFiles.length]) - openssl.spawnWrapper(params, false, function (error, code) { - function done (error) { - if (error) { - callback(error) - } else { - callback(null, code === 0) - } - } - helper.deleteTempFiles(delTempPWFiles, function (fsErr) { - done(error || fsErr) - }) - }) - } - }) -} diff --git a/node_modules/pem/lib/helper.js b/node_modules/pem/lib/helper.js deleted file mode 100644 index e9a2bf776..000000000 --- a/node_modules/pem/lib/helper.js +++ /dev/null @@ -1,137 +0,0 @@ -'use strict' - -var pathlib = require('path') -var fs = require('fs') -var crypto = require('crypto') -var osTmpdir = require('os-tmpdir') -var tempDir = process.env.PEMJS_TMPDIR || osTmpdir() -/** - * pem helper module - * - * @module helper - */ - -/** - * helper function to check is the string a number or not - * @param {String} str String that should be checked to be a number - */ -module.exports.isNumber = function (str) { - if (Array.isArray(str)) { - return false - } - /* - var bstr = str && str.toString() - str = str + '' - - return bstr - parseFloat(bstr) + 1 >= 0 && - !/^\s+|\s+$/g.test(str) && /^\d+$/g.test(str) && - !isNaN(str) && !isNaN(parseFloat(str)) - */ - return /^\d+$/g.test(str) -} - -/** - * helper function to check is the string a hexaceximal value - * @param {String} hex String that should be checked to be a hexaceximal - */ -module.exports.isHex = function isHex (hex) { - return /^(0x){0,1}([0-9A-F]{1,40}|[0-9A-F]{1,40})$/gi.test(hex) -} - -/** - * helper function to convert a string to a hexaceximal value - * @param {String} str String that should be converted to a hexaceximal - */ -module.exports.toHex = function toHex (str) { - var hex = '' - for (var i = 0; i < str.length; i++) { - hex += '' + str.charCodeAt(i).toString(16) - } - return hex -} - -// cipherPassword returns an array of supported ciphers. -/** - * list of supported ciphers - * @type {Array} - */ -module.exports.ciphers = ['aes128', 'aes192', 'aes256', 'camellia128', 'camellia192', 'camellia256', 'des', 'des3', 'idea'] -var ciphers = module.exports.ciphers - -/** - * Creates a PasswordFile to hide the password form process infos via `ps auxf` etc. - * @param {Object} options object of cipher, password and passType, mustPass, {cipher:'aes128', password:'xxxx', passType:"in/out/word"}, if the object empty we do nothing - * @param {String} options.cipher cipher like 'aes128', 'aes192', 'aes256', 'camellia128', 'camellia192', 'camellia256', 'des', 'des3', 'idea' - * @param {String} options.password password can be empty or at last 4 to 1023 chars - * @param {String} options.passType passType: can be in/out/word for passIN/passOUT/passWORD - * @param {Boolean} options.mustPass mustPass is used when you need to set the pass like as "-password pass:" most needed when empty password - * @param {Object} params params will be extended with the data that need for the openssl command. IS USED AS POINTER! - * @param {String} PasswordFile PasswordFile is the filePath that later need to deleted, after the openssl command. IS USED AS POINTER! - * @return {Boolean} result - */ -module.exports.createPasswordFile = function (options, params, PasswordFile) { - if (!options || !options.hasOwnProperty('password') || !options.hasOwnProperty('passType') || !/^(word|in|out)$/.test(options.passType)) { - return false - } - PasswordFile = pathlib.join(tempDir, crypto.randomBytes(20).toString('hex')) - options.password = options.password.trim() - if (options.password === '') { - options.mustPass = true - } - if (options.cipher && (ciphers.indexOf(options.cipher) !== -1)) { - params.push('-' + options.cipher) - } - params.push('-pass' + options.passType) - if (options.mustPass) { - params.push('pass:' + options.password) - } else { - fs.writeFileSync(PasswordFile, options.password) - params.push('file:' + PasswordFile) - } - return true -} - -/** - * Deletes a file or an array of files - * @param {Array} files array of files that shoudld be deleted - * @param {errorCallback} callback Callback function with an error object - */ -module.exports.deleteTempFiles = function (files, callback) { - var rmFiles = [] - if (typeof files === 'string') { - rmFiles.push(files) - } else if (Array.isArray(files)) { - rmFiles = files - } else { - return callback(new Error('Unexcepted files parameter type; only string or array supported')) - } - var deleteSeries = function (list, finalCallback) { - if (list.length) { - var file = list.shift() - var myCallback = function (err) { - if (err && err.code === 'ENOENT') { - // file doens't exist - return deleteSeries(list, finalCallback) - } else if (err) { - // other errors, e.g. maybe we don't have enough permission - return finalCallback(err) - } else { - return deleteSeries(list, finalCallback) - } - } - if (file && typeof file === 'string') { - fs.unlink(file, myCallback) - } else { - return deleteSeries(list, finalCallback) - } - } else { - return finalCallback(null) // no errors - } - } - deleteSeries(rmFiles, callback) -} -/** - * Callback for return an error object. - * @callback errorCallback - * @param {Error} err - An Error Object or null - */ diff --git a/node_modules/pem/lib/openssl.js b/node_modules/pem/lib/openssl.js deleted file mode 100644 index aa397b2c8..000000000 --- a/node_modules/pem/lib/openssl.js +++ /dev/null @@ -1,257 +0,0 @@ -var helper = require('./helper.js') -var cpspawn = require('child_process').spawn -var pathlib = require('path') -var fs = require('fs') -var osTmpdir = require('os-tmpdir') -var crypto = require('crypto') -var which = require('which') -var settings = {} -var tempDir = process.env.PEMJS_TMPDIR || osTmpdir() - -/** - * pem openssl module - * - * @module openssl - */ - -/** - * configue this openssl module - * - * @static - * @param {String} option name e.g. pathOpenSSL, openSslVersion; TODO rethink nomenclature - * @param {*} value value - */ -function set (option, value) { - settings[option] = value -} - -/** - * get configuration setting value - * - * @static - * @param {String} option name - */ -function get (option) { - return settings[option] || null -} - -/** - * Spawn an openssl command - * - * @static - * @param {Array} params Array of openssl command line parameters - * @param {String} searchStr String to use to find data - * @param {Array} [tmpfiles] list of temporary files - * @param {Function} callback Called with (error, stdout-substring) - */ -function exec (params, searchStr, tmpfiles, callback) { - if (!callback && typeof tmpfiles === 'function') { - callback = tmpfiles - tmpfiles = false - } - - spawnWrapper(params, tmpfiles, function (err, code, stdout, stderr) { - var start, end - - if (err) { - return callback(err) - } - - if ((start = stdout.match(new RegExp('\\-+BEGIN ' + searchStr + '\\-+$', 'm')))) { - start = start.index - } else { - start = -1 - } - - // To get the full EC key with parameters and private key - if (searchStr === 'EC PARAMETERS') { - searchStr = 'EC PRIVATE KEY' - } - - if ((end = stdout.match(new RegExp('^\\-+END ' + searchStr + '\\-+', 'm')))) { - end = end.index + end[0].length - } else { - end = -1 - } - - if (start >= 0 && end >= 0) { - return callback(null, stdout.substring(start, end)) - } else { - return callback(new Error(searchStr + ' not found from openssl output:\n---stdout---\n' + stdout + '\n---stderr---\n' + stderr + '\ncode: ' + code)) - } - }) -} - -/** - * Spawn an openssl command and get binary output - * - * @static - * @param {Array} params Array of openssl command line parameters - * @param {Array} [tmpfiles] list of temporary files - * @param {Function} callback Called with (error, stdout) -*/ -function execBinary (params, tmpfiles, callback) { - if (!callback && typeof tmpfiles === 'function') { - callback = tmpfiles - tmpfiles = false - } - spawnWrapper(params, tmpfiles, true, function (err, code, stdout, stderr) { - if (err) { - return callback(err) - } - return callback(null, stdout) - }) -} - -/** - * Generically spawn openSSL, without processing the result - * - * @static - * @param {Array} params The parameters to pass to openssl - * @param {Boolean} binary Output of openssl is binary or text - * @param {Function} callback Called with (error, exitCode, stdout, stderr) - */ -function spawn (params, binary, callback) { - var pathBin = get('pathOpenSSL') || process.env.OPENSSL_BIN || 'openssl' - - testOpenSSLPath(pathBin, function (err) { - if (err) { - return callback(err) - } - var openssl = cpspawn(pathBin, params) - var stderr = '' - - var stdout = (binary ? Buffer.alloc(0) : '') - openssl.stdout.on('data', function (data) { - if (!binary) { - stdout += data.toString('binary') - } else { - stdout = Buffer.concat([stdout, data]) - } - }) - - openssl.stderr.on('data', function (data) { - stderr += data.toString('binary') - }) - // We need both the return code and access to all of stdout. Stdout isn't - // *really* available until the close event fires; the timing nuance was - // making this fail periodically. - var needed = 2 // wait for both exit and close. - var code = -1 - var finished = false - var done = function (err) { - if (finished) { - return - } - - if (err) { - finished = true - return callback(err) - } - - if (--needed < 1) { - finished = true - if (code) { - if (code === 2 && (stderr === '' || /depth lookup: unable to/.test(stderr))) { - return callback(null, code, stdout, stderr) - } - return callback(new Error('Invalid openssl exit code: ' + code + '\n% openssl ' + params.join(' ') + '\n' + stderr), code) - } else { - return callback(null, code, stdout, stderr) - } - } - } - - openssl.on('error', done) - - openssl.on('exit', function (ret) { - code = ret - done() - }) - - openssl.on('close', function () { - stdout = (binary ? stdout : Buffer.from(stdout, 'binary').toString('utf-8')) - stderr = Buffer.from(stderr, 'binary').toString('utf-8') - done() - }) - }) -} - -/** - * Wrapper for spawn method - * - * @static - * @param {Array} params The parameters to pass to openssl - * @param {Array} [tmpfiles] list of temporary files - * @param {Boolean} [binary] Output of openssl is binary or text - * @param {Function} callback Called with (error, exitCode, stdout, stderr) - */ -function spawnWrapper (params, tmpfiles, binary, callback) { - if (!callback && typeof binary === 'function') { - callback = binary - binary = false - } - - var files = [] - var delTempPWFiles = [] - - if (tmpfiles) { - tmpfiles = [].concat(tmpfiles) - var fpath, i - for (i = 0; i < params.length; i++) { - if (params[i] === '--TMPFILE--') { - fpath = pathlib.join(tempDir, crypto.randomBytes(20).toString('hex')) - files.push({ - path: fpath, - contents: tmpfiles.shift() - }) - params[i] = fpath - delTempPWFiles.push(fpath) - } - } - } - - var file - for (i = 0; i < files.length; i++) { - file = files[i] - fs.writeFileSync(file.path, file.contents) - } - - spawn(params, binary, function (err, code, stdout, stderr) { - helper.deleteTempFiles(delTempPWFiles, function (fsErr) { - callback(err || fsErr, code, stdout, stderr) - }) - }) -} - -/** - * Validates the pathBin for the openssl command - * - * @private - * @param {String} pathBin The path to OpenSSL Bin - * @param {Function} callback Callback function with an error object - */ -function testOpenSSLPath (pathBin, callback) { - which(pathBin, function (error) { - if (error) { - return callback(new Error('Could not find openssl on your system on this path: ' + pathBin)) - } - callback() - }) -} - -/* Once PEM is imported, the openSslVersion is set with this function. */ -spawn(['version'], false, function (err, code, stdout, stderr) { - var text = String(stdout) + '\n' + String(stderr) + '\n' + String(err) - var tmp = text.match(/^LibreSSL/i) - set('openSslVersion', (tmp && tmp[0] ? 'LibreSSL' : 'openssl').toUpperCase()) -}) - -module.exports = { - exec: exec, - execBinary: execBinary, - spawn: spawn, - spawnWrapper: spawnWrapper, - set: set, - get: get -} diff --git a/node_modules/pem/lib/pem.js b/node_modules/pem/lib/pem.js deleted file mode 100644 index 873017819..000000000 --- a/node_modules/pem/lib/pem.js +++ /dev/null @@ -1,1288 +0,0 @@ -'use strict' - -/** - * pem module - * - * @module pem - */ - -const { promisify } = require('es6-promisify') -var net = require('net') -var helper = require('./helper.js') -var openssl = require('./openssl.js') - -module.exports.createPrivateKey = createPrivateKey -module.exports.createDhparam = createDhparam -module.exports.createEcparam = createEcparam -module.exports.createCSR = createCSR -module.exports.createCertificate = createCertificate -module.exports.readCertificateInfo = readCertificateInfo -module.exports.getPublicKey = getPublicKey -module.exports.getFingerprint = getFingerprint -module.exports.getModulus = getModulus -module.exports.getDhparamInfo = getDhparamInfo -module.exports.createPkcs12 = createPkcs12 -module.exports.readPkcs12 = readPkcs12 -module.exports.verifySigningChain = verifySigningChain -module.exports.checkCertificate = checkCertificate -module.exports.checkPkcs12 = checkPkcs12 -module.exports.config = config - -/** - * quick access the convert module - * @type {module:convert} - */ -module.exports.convert = require('./convert.js') - -var KEY_START = '-----BEGIN PRIVATE KEY-----' -var KEY_END = '-----END PRIVATE KEY-----' -var RSA_KEY_START = '-----BEGIN RSA PRIVATE KEY-----' -var RSA_KEY_END = '-----END RSA PRIVATE KEY-----' -var ENCRYPTED_KEY_START = '-----BEGIN ENCRYPTED PRIVATE KEY-----' -var ENCRYPTED_KEY_END = '-----END ENCRYPTED PRIVATE KEY-----' -var CERT_START = '-----BEGIN CERTIFICATE-----' -var CERT_END = '-----END CERTIFICATE-----' - -/** - * Creates a private key - * - * @static - * @param {Number} [keyBitsize=2048] Size of the key, defaults to 2048bit - * @param {Object} [options] object of cipher and password {cipher:'aes128',password:'xxx'}, defaults empty object - * @param {String} [options.cipher] string of the cipher for the encryption - needed with password - * @param {String} [options.password] string of the cipher password for the encryption needed with cipher - * @param {Function} callback Callback function with an error object and {key} - */ -function createPrivateKey (keyBitsize, options, callback) { - if (!callback && !options && typeof keyBitsize === 'function') { - callback = keyBitsize - keyBitsize = undefined - options = {} - } else if (!callback && keyBitsize && typeof options === 'function') { - callback = options - options = {} - } - - keyBitsize = Number(keyBitsize) || 2048 - - var params = ['genrsa'] - var delTempPWFiles = [] - - if (options && options.cipher && (Number(helper.ciphers.indexOf(options.cipher)) !== -1) && options.password) { - helper.createPasswordFile({ 'cipher': options.cipher, 'password': options.password, 'passType': 'out' }, params, delTempPWFiles[delTempPWFiles.length]) - } - - params.push(keyBitsize) - - openssl.exec(params, 'RSA PRIVATE KEY', function (sslErr, key) { - function done (err) { - if (err) { - return callback(err) - } - callback(null, { - key: key - }) - } - helper.deleteTempFiles(delTempPWFiles, function (fsErr) { - done(sslErr || fsErr) - }) - }) -} - -/** - * Creates a dhparam key - * - * @static - * @param {Number} [keyBitsize=512] Size of the key, defaults to 512bit - * @param {Function} callback Callback function with an error object and {dhparam} - */ -function createDhparam (keyBitsize, callback) { - if (!callback && typeof keyBitsize === 'function') { - callback = keyBitsize - keyBitsize = undefined - } - - keyBitsize = Number(keyBitsize) || 512 - - var params = ['dhparam', - '-outform', - 'PEM', - keyBitsize - ] - - openssl.exec(params, 'DH PARAMETERS', function (error, dhparam) { - if (error) { - return callback(error) - } - return callback(null, { - dhparam: dhparam - }) - }) -} - -/** - * Creates a ecparam key - * @static - * @param {String} [keyName=secp256k1] Name of the key, defaults to secp256k1 - * @param {String} [paramEnc=explicit] Encoding of the elliptic curve parameters, defaults to explicit - * @param {Boolean} [noOut=false] This option inhibits the output of the encoded version of the parameters. - * @param {Function} callback Callback function with an error object and {ecparam} - */ -function createEcparam (keyName, paramEnc, noOut, callback) { - if (!callback && typeof noOut === 'undefined' && !paramEnc && typeof keyName === 'function') { - callback = keyName - keyName = undefined - } else if (!callback && typeof noOut === 'undefined' && keyName && typeof paramEnc === 'function') { - callback = paramEnc - paramEnc = undefined - } else if (!callback && typeof noOut === 'function' && keyName && paramEnc) { - callback = noOut - noOut = undefined - } - - keyName = keyName || 'secp256k1' - paramEnc = paramEnc || 'explicit' - noOut = noOut || false - - var params = ['ecparam', - '-name', - keyName, - '-genkey', - '-param_enc', - paramEnc - ] - - var searchString = 'EC PARAMETERS' - if (noOut) { - params.push('-noout') - searchString = 'EC PRIVATE KEY' - } - - openssl.exec(params, searchString, function (error, ecparam) { - if (error) { - return callback(error) - } - return callback(null, { - ecparam: ecparam - }) - }) -} - -/** - * Creates a Certificate Signing Request - * If client key is undefined, a new key is created automatically. The used key is included - * in the callback return as clientKey - * @static - * @param {Object} [options] Optional options object - * @param {String} [options.clientKey] Optional client key to use - * @param {Number} [options.keyBitsize] If clientKey is undefined, bit size to use for generating a new key (defaults to 2048) - * @param {String} [options.hash] Hash function to use (either md5 sha1 or sha256, defaults to sha256) - * @param {String} [options.country] CSR country field - * @param {String} [options.state] CSR state field - * @param {String} [options.locality] CSR locality field - * @param {String} [options.organization] CSR organization field - * @param {String} [options.organizationUnit] CSR organizational unit field - * @param {String} [options.commonName='localhost'] CSR common name field - * @param {String} [options.emailAddress] CSR email address field - * @param {String} [options.csrConfigFile] CSR config file - * @param {Array} [options.altNames] is a list of subjectAltNames in the subjectAltName field - * @param {Function} callback Callback function with an error object and {csr, clientKey} - */ -function createCSR (options, callback) { - if (!callback && typeof options === 'function') { - callback = options - options = undefined - } - - options = options || {} - - // http://stackoverflow.com/questions/14089872/why-does-node-js-accept-ip-addresses-in-certificates-only-for-san-not-for-cn - if (options.commonName && (net.isIPv4(options.commonName) || net.isIPv6(options.commonName))) { - if (!options.altNames) { - options.altNames = [options.commonName] - } else if (options.altNames.indexOf(options.commonName) === -1) { - options.altNames = options.altNames.concat([options.commonName]) - } - } - - if (!options.clientKey) { - createPrivateKey(options.keyBitsize || 2048, function (error, keyData) { - if (error) { - return callback(error) - } - options.clientKey = keyData.key - createCSR(options, callback) - }) - return - } - - var params = ['req', - '-new', - '-' + (options.hash || 'sha256') - ] - - if (options.csrConfigFile) { - params.push('-config') - params.push(options.csrConfigFile) - } else { - params.push('-subj') - params.push(generateCSRSubject(options)) - } - - params.push('-key') - params.push('--TMPFILE--') - - var tmpfiles = [options.clientKey] - var config = null - - if (options.altNames && Array.isArray(options.altNames) && options.altNames.length) { - params.push('-extensions') - params.push('v3_req') - params.push('-config') - params.push('--TMPFILE--') - var altNamesRep = [] - for (var i = 0; i < options.altNames.length; i++) { - altNamesRep.push((net.isIP(options.altNames[i]) ? 'IP' : 'DNS') + '.' + (i + 1) + ' = ' + options.altNames[i]) - } - - tmpfiles.push(config = [ - '[req]', - 'req_extensions = v3_req', - 'distinguished_name = req_distinguished_name', - '[v3_req]', - 'subjectAltName = @alt_names', - '[alt_names]', - altNamesRep.join('\n'), - '[req_distinguished_name]', - 'commonName = Common Name', - 'commonName_max = 64' - ].join('\n')) - } else if (options.config) { - config = options.config - } - - var delTempPWFiles = [] - if (options.clientKeyPassword) { - helper.createPasswordFile({ 'cipher': '', 'password': options.clientKeyPassword, 'passType': 'in' }, params, delTempPWFiles[delTempPWFiles.length]) - } - - openssl.exec(params, 'CERTIFICATE REQUEST', tmpfiles, function (sslErr, data) { - function done (err) { - if (err) { - return callback(err) - } - callback(null, { - csr: data, - config: config, - clientKey: options.clientKey - }) - } - helper.deleteTempFiles(delTempPWFiles, function (fsErr) { - done(sslErr || fsErr) - }) - }) -} - -/** - * Creates a certificate based on a CSR. If CSR is not defined, a new one - * will be generated automatically. For CSR generation all the options values - * can be used as with createCSR. - * @static - * @param {Object} [options] Optional options object - * @param {String} [options.serviceCertificate] PEM encoded certificate - * @param {String} [options.serviceKey] Private key for signing the certificate, if not defined a new one is generated - * @param {String} [options.serviceKeyPassword] Password of the service key - * @param {Boolean} [options.selfSigned] If set to true and serviceKey is not defined, use clientKey for signing - * @param {String|Number} [options.serial] Set a serial max. 20 octets - only together with options.serviceCertificate - * @param {String} [options.serialFile] Set the name of the serial file, without extension. - only together with options.serviceCertificate and never in tandem with options.serial - * @param {String} [options.hash] Hash function to use (either md5 sha1 or sha256, defaults to sha256) - * @param {String} [options.csr] CSR for the certificate, if not defined a new one is generated - * @param {Number} [options.days] Certificate expire time in days - * @param {String} [options.clientKeyPassword] Password of the client key - * @param {String} [options.extFile] extension config file - without '-extensions v3_req' - * @param {String} [options.config] extension config file - with '-extensions v3_req' - * @param {Function} callback Callback function with an error object and {certificate, csr, clientKey, serviceKey} - */ -function createCertificate (options, callback) { - if (!callback && typeof options === 'function') { - callback = options - options = undefined - } - - options = options || {} - - if (!options.csr) { - createCSR(options, function (error, keyData) { - if (error) { - return callback(error) - } - options.csr = keyData.csr - options.config = keyData.config - options.clientKey = keyData.clientKey - createCertificate(options, callback) - }) - return - } - - if (!options.serviceKey) { - if (options.selfSigned) { - options.serviceKey = options.clientKey - } else { - createPrivateKey(options.keyBitsize || 2048, function (error, keyData) { - if (error) { - return callback(error) - } - options.serviceKey = keyData.key - createCertificate(options, callback) - }) - return - } - } - - var params = ['x509', - '-req', - '-' + (options.hash || 'sha256'), - '-days', - Number(options.days) || '365', - '-in', - '--TMPFILE--' - ] - var tmpfiles = [options.csr] - var delTempPWFiles = [] - - if (options.serviceCertificate) { - params.push('-CA') - params.push('--TMPFILE--') - params.push('-CAkey') - params.push('--TMPFILE--') - if (options.serial) { - params.push('-set_serial') - if (helper.isNumber(options.serial)) { - // set the serial to the max lenth of 20 octets () - // A certificate serial number is not decimal conforming. That is the - // bytes in a serial number do not necessarily map to a printable ASCII - // character. - // eg: 0x00 is a valid serial number and can not be represented in a - // human readable format (atleast one that can be directly mapped to - // the ACSII table). - params.push('0x' + ('0000000000000000000000000000000000000000' + options.serial.toString(16)).slice(-40)) - } else { - if (helper.isHex(options.serial)) { - if (options.serial.startsWith('0x')) { - options.serial = options.serial.substring(2, options.serial.length) - } - params.push('0x' + ('0000000000000000000000000000000000000000' + options.serial).slice(-40)) - } else { - params.push('0x' + ('0000000000000000000000000000000000000000' + helper.toHex(options.serial)).slice(-40)) - } - } - } else { - params.push('-CAcreateserial') - if (options.serialFile) { - params.push('-CAserial') - params.push(options.serialFile + '.srl') - } - } - if (options.serviceKeyPassword) { - helper.createPasswordFile({ 'cipher': '', 'password': options.serviceKeyPassword, 'passType': 'in' }, params, delTempPWFiles[delTempPWFiles.length]) - } - tmpfiles.push(options.serviceCertificate) - tmpfiles.push(options.serviceKey) - } else { - params.push('-signkey') - params.push('--TMPFILE--') - if (options.serviceKeyPassword) { - helper.createPasswordFile({ 'cipher': '', 'password': options.serviceKeyPassword, 'passType': 'in' }, params, delTempPWFiles[delTempPWFiles.length]) - } - tmpfiles.push(options.serviceKey) - } - - if (options.config) { - params.push('-extensions') - params.push('v3_req') - params.push('-extfile') - params.push('--TMPFILE--') - tmpfiles.push(options.config) - } else if (options.extFile) { - params.push('-extfile') - params.push(options.extFile) - } - - if (options.clientKeyPassword) { - helper.createPasswordFile({ 'cipher': '', 'password': options.clientKeyPassword, 'passType': 'in' }, params, delTempPWFiles[delTempPWFiles.length]) - } - - openssl.exec(params, 'CERTIFICATE', tmpfiles, function (sslErr, data) { - function done (err) { - if (err) { - return callback(err) - } - var response = { - csr: options.csr, - clientKey: options.clientKey, - certificate: data, - serviceKey: options.serviceKey - } - return callback(null, response) - } - - helper.deleteTempFiles(delTempPWFiles, function (fsErr) { - done(sslErr || fsErr) - }) - }) -} - -/** - * Exports a public key from a private key, CSR or certificate - * @static - * @param {String} certificate PEM encoded private key, CSR or certificate - * @param {Function} callback Callback function with an error object and {publicKey} - */ -function getPublicKey (certificate, callback) { - if (!callback && typeof certificate === 'function') { - callback = certificate - certificate = undefined - } - - certificate = (certificate || '').toString() - - var params - - if (certificate.match(/BEGIN(\sNEW)? CERTIFICATE REQUEST/)) { - params = ['req', - '-in', - '--TMPFILE--', - '-pubkey', - '-noout' - ] - } else if (certificate.match(/BEGIN RSA PRIVATE KEY/) || certificate.match(/BEGIN PRIVATE KEY/)) { - params = ['rsa', - '-in', - '--TMPFILE--', - '-pubout' - ] - } else { - params = ['x509', - '-in', - '--TMPFILE--', - '-pubkey', - '-noout' - ] - } - - openssl.exec(params, 'PUBLIC KEY', certificate, function (error, key) { - if (error) { - return callback(error) - } - return callback(null, { - publicKey: key - }) - }) -} - -/** - * Reads subject data from a certificate or a CSR - * @static - * @param {String} certificate PEM encoded CSR or certificate - * @param {Function} callback Callback function with an error object and {country, state, locality, organization, organizationUnit, commonName, emailAddress} - */ -function readCertificateInfo (certificate, callback) { - if (!callback && typeof certificate === 'function') { - callback = certificate - certificate = undefined - } - - certificate = (certificate || '').toString() - var isMatch = certificate.match(/BEGIN(\sNEW)? CERTIFICATE REQUEST/) - var type = isMatch ? 'req' : 'x509' - var params = [type, - '-noout', - '-nameopt', - 'RFC2253,sep_multiline,space_eq,-esc_msb,utf8', - '-text', - '-in', - '--TMPFILE--' - ] - openssl.spawnWrapper(params, certificate, function (err, code, stdout, stderr) { - if (err) { - return callback(err) - } else if (stderr) { - return callback(stderr) - } - return fetchCertificateData(stdout, callback) - }) -} - -/** - * get the modulus from a certificate, a CSR or a private key - * @static - * @param {String} certificate PEM encoded, CSR PEM encoded, or private key - * @param {String} [password] password for the certificate - * @param {String} [hash] hash function to use (up to now `md5` supported) (default: none) - * @param {Function} callback Callback function with an error object and {modulus} - */ -function getModulus (certificate, password, hash, callback) { - if (!callback && !hash && typeof password === 'function') { - callback = password - password = undefined - hash = false - } else if (!callback && hash && typeof hash === 'function') { - callback = hash - hash = false - // password will be falsy if not provided - } - // adding hash function to params, is not supported by openssl. - // process piping would be the right way (... | openssl md5) - // No idea how this can be achieved in easy with the current build in methods - // of pem. - if (hash && hash !== 'md5') { - hash = false - } - - certificate = (Buffer.isBuffer(certificate) && certificate.toString()) || certificate - - var type = '' - if (certificate.match(/BEGIN(\sNEW)? CERTIFICATE REQUEST/)) { - type = 'req' - } else if (certificate.match(/BEGIN RSA PRIVATE KEY/) || certificate.match(/BEGIN PRIVATE KEY/)) { - type = 'rsa' - } else { - type = 'x509' - } - var params = [ - type, - '-noout', - '-modulus', - '-in', - '--TMPFILE--' - ] - var delTempPWFiles = [] - if (password) { - helper.createPasswordFile({ 'cipher': '', 'password': password, 'passType': 'in' }, params, delTempPWFiles[delTempPWFiles.length]) - } - - openssl.spawnWrapper(params, certificate, function (sslErr, code, stdout, stderr) { - function done (err) { - if (err) { - return callback(err) - } - var match = stdout.match(/Modulus=([0-9a-fA-F]+)$/m) - if (match) { - return callback(null, { - modulus: hash ? require(hash)(match[1]) : match[1] - }) - } else { - return callback(new Error('No modulus')) - } - } - helper.deleteTempFiles(delTempPWFiles, function (fsErr) { - done(sslErr || fsErr || stderr) - }) - }) -} - -/** - * get the size and prime of DH parameters - * @static - * @param {String} DH parameters PEM encoded - * @param {Function} callback Callback function with an error object and {size, prime} - */ -function getDhparamInfo (dh, callback) { - dh = (Buffer.isBuffer(dh) && dh.toString()) || dh - - var params = [ - 'dhparam', - '-text', - '-in', - '--TMPFILE--' - ] - - openssl.spawnWrapper(params, dh, function (err, code, stdout, stderr) { - if (err) { - return callback(err) - } else if (stderr) { - return callback(stderr) - } - - var result = {} - var match = stdout.match(/Parameters: \((\d+) bit\)/) - - if (match) { - result.size = Number(match[1]) - } - - var prime = '' - stdout.split('\n').forEach(function (line) { - if (/\s+([0-9a-f][0-9a-f]:)+[0-9a-f]?[0-9a-f]?/g.test(line)) { - prime += line.trim() - } - }) - - if (prime) { - result.prime = prime - } - - if (!match && !prime) { - return callback(new Error('No DH info found')) - } - - return callback(null, result) - }) -} - -/** - * config the pem module - * @static - * @param {Object} options - */ -function config (options) { - Object.keys(options).forEach(function (k) { - openssl.set(k, options[k]) - }) -} - -/** - * Gets the fingerprint for a certificate - * @static - * @param {String} PEM encoded certificate - * @param {String} [hash] hash function to use (either `md5`, `sha1` or `sha256`, defaults to `sha1`) - * @param {Function} callback Callback function with an error object and {fingerprint} - */ -function getFingerprint (certificate, hash, callback) { - if (!callback && typeof hash === 'function') { - callback = hash - hash = undefined - } - - hash = hash || 'sha1' - - var params = ['x509', - '-in', - '--TMPFILE--', - '-fingerprint', - '-noout', - '-' + hash - ] - - openssl.spawnWrapper(params, certificate, function (err, code, stdout, stderr) { - if (err) { - return callback(err) - } else if (stderr) { - return callback(stderr) - } - var match = stdout.match(/Fingerprint=([0-9a-fA-F:]+)$/m) - if (match) { - return callback(null, { - fingerprint: match[1] - }) - } else { - return callback(new Error('No fingerprint')) - } - }) -} - -/** - * Export private key and certificate to a PKCS12 keystore - * @static - * @param {String} PEM encoded private key - * @param {String} PEM encoded certificate - * @param {String} Password of the result PKCS12 file - * @param {Object} [options] object of cipher and optional client key password {cipher:'aes128', clientKeyPassword: 'xxxx', certFiles: ['file1','file2']} - * @param {Function} callback Callback function with an error object and {pkcs12} - */ -function createPkcs12 (key, certificate, password, options, callback) { - if (!callback && typeof options === 'function') { - callback = options - options = {} - } - - var params = ['pkcs12', '-export'] - var delTempPWFiles = [] - - if (options.cipher && options.clientKeyPassword) { - // NOTICE: The password field is needed! self if it is empty. - // create password file for the import "-passin" - helper.createPasswordFile({ 'cipher': options.cipher, 'password': options.clientKeyPassword, 'passType': 'in' }, params, delTempPWFiles[delTempPWFiles.length]) - } - // NOTICE: The password field is needed! self if it is empty. - // create password file for the password "-password" - helper.createPasswordFile({ 'cipher': '', 'password': password, 'passType': 'word' }, params, delTempPWFiles[delTempPWFiles.length]) - - params.push('-in') - params.push('--TMPFILE--') - params.push('-inkey') - params.push('--TMPFILE--') - - var tmpfiles = [certificate, key] - - if (options.certFiles) { - tmpfiles.push(options.certFiles.join('')) - - params.push('-certfile') - params.push('--TMPFILE--') - } - - openssl.execBinary(params, tmpfiles, function (sslErr, pkcs12) { - function done (err) { - if (err) { - return callback(err) - } - return callback(null, { - pkcs12: pkcs12 - }) - } - helper.deleteTempFiles(delTempPWFiles, function (fsErr) { - done(sslErr || fsErr) - }) - }) -} - -/** - * read sslcert data from Pkcs12 file. Results are provided in callback response in object notation ({cert: .., ca:..., key:...}) - * @static - * @param {Buffer|String} bufferOrPath Buffer or path to file - * @param {Object} [options] openssl options - * @param {Function} callback Called with error object and sslcert bundle object - */ -function readPkcs12 (bufferOrPath, options, callback) { - if (!callback && typeof options === 'function') { - callback = options - options = {} - } - - options.p12Password = options.p12Password || '' - - var tmpfiles = [] - var delTempPWFiles = [] - var args = ['pkcs12', '-in', bufferOrPath] - - helper.createPasswordFile({ 'cipher': '', 'password': options.p12Password, 'passType': 'in' }, args, delTempPWFiles[delTempPWFiles.length]) - - if (Buffer.isBuffer(bufferOrPath)) { - tmpfiles = [bufferOrPath] - args[2] = '--TMPFILE--' - } - - if (options.clientKeyPassword) { - helper.createPasswordFile({ 'cipher': '', 'password': options.clientKeyPassword, 'passType': 'out' }, args, delTempPWFiles[delTempPWFiles.length]) - } else { - args.push('-nodes') - } - - openssl.execBinary(args, tmpfiles, function (sslErr, stdout) { - function done (err) { - var keybundle = {} - - if (err && err.message.indexOf('No such file or directory') !== -1) { - err.code = 'ENOENT' - } - - if (!err) { - var certs = readFromString(stdout, CERT_START, CERT_END) - keybundle.cert = certs.shift() - keybundle.ca = certs - keybundle.key = readFromString(stdout, KEY_START, KEY_END).pop() - - if (keybundle.key) { - // convert to RSA key - return openssl.exec(['rsa', '-in', '--TMPFILE--'], 'RSA PRIVATE KEY', [keybundle.key], function (err, key) { - keybundle.key = key - - return callback(err, keybundle) - }) - } - - if (options.clientKeyPassword) { - keybundle.key = readFromString(stdout, ENCRYPTED_KEY_START, ENCRYPTED_KEY_END).pop() - } else { - keybundle.key = readFromString(stdout, RSA_KEY_START, RSA_KEY_END).pop() - } - } - - return callback(err, keybundle) - } - helper.deleteTempFiles(delTempPWFiles, function (fsErr) { - done(sslErr || fsErr) - }) - }) -} - -/** - * Check a certificate - * @static - * @param {String} PEM encoded certificate - * @param {String} [passphrase] password for the certificate - * @param {Function} callback Callback function with an error object and a boolean valid - */ -function checkCertificate (certificate, passphrase, callback) { - var params - var delTempPWFiles = [] - - if (!callback && typeof passphrase === 'function') { - callback = passphrase - passphrase = undefined - } - certificate = (certificate || '').toString() - - if (certificate.match(/BEGIN(\sNEW)? CERTIFICATE REQUEST/)) { - params = ['req', '-text', '-noout', '-verify', '-in', '--TMPFILE--'] - } else if (certificate.match(/BEGIN RSA PRIVATE KEY/) || certificate.match(/BEGIN PRIVATE KEY/)) { - params = ['rsa', '-noout', '-check', '-in', '--TMPFILE--'] - } else { - params = ['x509', '-text', '-noout', '-in', '--TMPFILE--'] - } - if (passphrase) { - helper.createPasswordFile({ 'cipher': '', 'password': passphrase, 'passType': 'in' }, params, delTempPWFiles[delTempPWFiles.length]) - } - - openssl.spawnWrapper(params, certificate, function (sslErr, code, stdout, stderr) { - function done (err) { - if (err && err.toString().trim() !== 'verify OK') { - return callback(err) - } - var result - switch (params[0]) { - case 'rsa': - result = /^Rsa key ok$/i.test(stdout.trim()) - break - default: - result = /Signature Algorithm/im.test(stdout) - break - } - - callback(null, result) - } - helper.deleteTempFiles(delTempPWFiles, function (fsErr) { - done(sslErr || fsErr || stderr) - }) - }) -} - -/** - * check a PKCS#12 file (.pfx or.p12) - * @static - * @param {Buffer|String} bufferOrPath PKCS#12 certificate - * @param {String} [passphrase] optional passphrase which will be used to open the keystore - * @param {Function} callback Callback function with an error object and a boolean valid - */ -function checkPkcs12 (bufferOrPath, passphrase, callback) { - if (!callback && typeof passphrase === 'function') { - callback = passphrase - passphrase = '' - } - - var tmpfiles = [] - var delTempPWFiles = [] - var args = ['pkcs12', '-info', '-in', bufferOrPath, '-noout', '-maciter', '-nodes'] - - helper.createPasswordFile({ 'cipher': '', 'password': passphrase, 'passType': 'in' }, args, delTempPWFiles[delTempPWFiles.length]) - - if (Buffer.isBuffer(bufferOrPath)) { - tmpfiles = [bufferOrPath] - args[3] = '--TMPFILE--' - } - - openssl.spawnWrapper(args, tmpfiles, function (sslErr, code, stdout, stderr) { - function done (err) { - if (err) { - return callback(err) - } - callback(null, (/MAC verified OK/im.test(stderr) || (!(/MAC verified OK/im.test(stderr)) && !(/Mac verify error/im.test(stderr))))) - } - helper.deleteTempFiles(delTempPWFiles, function (fsErr) { - done(sslErr || fsErr) - }) - }) -} - -/** - * Verifies the signing chain of the passed certificate - * @static - * @param {String|Array} PEM encoded certificate include intermediate certificates - * @param {String|Array} [List] of CA certificates - * @param {Function} callback Callback function with an error object and a boolean valid - */ -function verifySigningChain (certificate, ca, callback) { - if (!callback && typeof ca === 'function') { - callback = ca - ca = undefined - } - if (!Array.isArray(certificate)) { - certificate = [certificate] - } - if (!Array.isArray(ca) && ca !== undefined) { - if (ca !== '') { - ca = [ca] - } - } - - var files = [] - - if (ca !== undefined) { - // ca certificates - files.push(ca.join('\n')) - } - // certificate incl. intermediate certificates - files.push(certificate.join('\n')) - - var params = ['verify'] - - if (ca !== undefined) { - // ca certificates - params.push('-CAfile') - params.push('--TMPFILE--') - } - // certificate incl. intermediate certificates - params.push('--TMPFILE--') - - openssl.spawnWrapper(params, files, function (err, code, stdout, stderr) { - if (err) { - return callback(err) - } - - callback(null, stdout.trim().slice(-4) === ': OK') - }) -} - -// HELPER FUNCTIONS -function fetchCertificateData (certData, callback) { - certData = (certData || '').toString() - - var serial, subject, tmp, issuer - var certValues = { - issuer: {} - } - var validity = {} - var san - - var ky, i - - // serial - if ((serial = certData.match(/\s*Serial Number:\r?\n?\s*([^\r\n]*)\r?\n\s*\b/)) && serial.length > 1) { - certValues.serial = serial[1] - } - - if ((subject = certData.match(/\s*Subject:\r?\n(\s*(([a-zA-Z0-9.]+)\s=\s[^\r\n]+\r?\n))*\s*\b/)) && subject.length > 1) { - subject = subject[0] - tmp = matchAll(subject, /\s([a-zA-Z0-9.]+)\s=\s([^\r\n].*)/g) - for (i = 0; i < tmp.length; i++) { - ky = tmp[i][1].trim() - if (ky.match('(C|ST|L|O|OU|CN|emailAddress|DC)') || ky === '') { - continue - } - certValues[ky] = tmp[i][2].trim() - } - - // country - tmp = subject.match(/\sC\s=\s([^\r\n].*?)[\r\n]/) - certValues.country = (tmp && tmp[1]) || '' - - // state - tmp = subject.match(/\sST\s=\s([^\r\n].*?)[\r\n]/) - certValues.state = (tmp && tmp[1]) || '' - - // locality - tmp = subject.match(/\sL\s=\s([^\r\n].*?)[\r\n]/) - certValues.locality = (tmp && tmp[1]) || '' - - // organization - tmp = matchAll(subject, /\sO\s=\s([^\r\n].*)/g) - certValues.organization = tmp ? (tmp.length > 1 ? tmp.sort(function (t, n) { - var e = t[1].toUpperCase() - var r = n[1].toUpperCase() - return r > e ? -1 : e > r ? 1 : 0 - }).sort(function (t, n) { - return t[1].length - n[1].length - }).map(function (t) { - return t[1] - }) : tmp[0][1]) : '' - - // unit - tmp = matchAll(subject, /\sOU\s=\s([^\r\n].*)/g) - certValues.organizationUnit = tmp ? (tmp.length > 1 ? tmp.sort(function (t, n) { - var e = t[1].toUpperCase() - var r = n[1].toUpperCase() - return r > e ? -1 : e > r ? 1 : 0 - }).sort(function (t, n) { - return t[1].length - n[1].length - }).map(function (t) { - return t[1] - }) : tmp[0][1]) : '' - - // common name - tmp = matchAll(subject, /\sCN\s=\s([^\r\n].*)/g) - certValues.commonName = tmp ? (tmp.length > 1 ? tmp.sort(function (t, n) { - var e = t[1].toUpperCase() - var r = n[1].toUpperCase() - return r > e ? -1 : e > r ? 1 : 0 - }).sort(function (t, n) { - return t[1].length - n[1].length - }).map(function (t) { - return t[1] - }) : tmp[0][1]) : '' - - // email - tmp = matchAll(subject, /emailAddress\s=\s([^\r\n].*)/g) - certValues.emailAddress = tmp ? (tmp.length > 1 ? tmp.sort(function (t, n) { - var e = t[1].toUpperCase() - var r = n[1].toUpperCase() - return r > e ? -1 : e > r ? 1 : 0 - }).sort(function (t, n) { - return t[1].length - n[1].length - }).map(function (t) { - return t[1] - }) : tmp[0][1]) : '' - - // DC name - tmp = matchAll(subject, /\sDC\s=\s([^\r\n].*)/g) - certValues.dc = tmp ? (tmp.length > 1 ? tmp.sort(function (t, n) { - var e = t[1].toUpperCase() - var r = n[1].toUpperCase() - return r > e ? -1 : e > r ? 1 : 0 - }).sort(function (t, n) { - return t[1].length - n[1].length - }).map(function (t) { - return t[1] - }) : tmp[0][1]) : '' - } - - if ((issuer = certData.match(/\s*Issuer:\r?\n(\s*([a-zA-Z0-9.]+)\s=\s[^\r\n].*\r?\n)*\s*\b/)) && issuer.length > 1) { - issuer = issuer[0] - tmp = matchAll(issuer, /\s([a-zA-Z0-9.]+)\s=\s([^\r\n].*)/g) - for (i = 0; i < tmp.length; i++) { - ky = tmp[i][1].toString() - if (ky.match('(C|ST|L|O|OU|CN|emailAddress|DC)')) { - continue - } - certValues.issuer[ky] = tmp[i][2].toString() - } - - // country - tmp = issuer.match(/\sC\s=\s([^\r\n].*?)[\r\n]/) - certValues.issuer.country = (tmp && tmp[1]) || '' - - // state - tmp = issuer.match(/\sST\s=\s([^\r\n].*?)[\r\n]/) - certValues.issuer.state = (tmp && tmp[1]) || '' - - // locality - tmp = issuer.match(/\sL\s=\s([^\r\n].*?)[\r\n]/) - certValues.issuer.locality = (tmp && tmp[1]) || '' - - // organization - tmp = matchAll(issuer, /\sO\s=\s([^\r\n].*)/g) - certValues.issuer.organization = tmp ? (tmp.length > 1 ? tmp.sort(function (t, n) { - var e = t[1].toUpperCase() - var r = n[1].toUpperCase() - return r > e ? -1 : e > r ? 1 : 0 - }).sort(function (t, n) { - return t[1].length - n[1].length - }).map(function (t) { - return t[1] - }) : tmp[0][1]) : '' - - // unit - tmp = matchAll(issuer, /\sOU\s=\s([^\r\n].*)/g) - certValues.issuer.organizationUnit = tmp ? (tmp.length > 1 ? tmp.sort(function (t, n) { - var e = t[1].toUpperCase() - var - r = n[1].toUpperCase() - return r > e ? -1 : e > r ? 1 : 0 - }).sort(function (t, n) { - return t[1].length - n[1].length - }).map(function (t) { - return t[1] - }) : tmp[0][1]) : '' - - // common name - tmp = matchAll(issuer, /\sCN\s=\s([^\r\n].*)/g) - certValues.issuer.commonName = tmp ? (tmp.length > 1 ? tmp.sort(function (t, n) { - var e = t[1].toUpperCase() - var - r = n[1].toUpperCase() - return r > e ? -1 : e > r ? 1 : 0 - }).sort(function (t, n) { - return t[1].length - n[1].length - }).map(function (t) { - return t[1] - }) : tmp[0][1]) : '' - - // DC name - tmp = matchAll(issuer, /\sDC\s=\s([^\r\n].*)/g) - certValues.issuer.dc = tmp ? (tmp.length > 1 ? tmp.sort(function (t, n) { - var e = t[1].toUpperCase() - var - r = n[1].toUpperCase() - return r > e ? -1 : e > r ? 1 : 0 - }).sort(function (t, n) { - return t[1].length - n[1].length - }).map(function (t) { - return t[1] - }) : tmp[0][1]) : '' - } - - // SAN - if ((san = certData.match(/X509v3 Subject Alternative Name: \r?\n([^\r\n]*)\r?\n/)) && san.length > 1) { - san = san[1].trim() + '\n' - certValues.san = {} - - // hostnames - tmp = pregMatchAll('DNS:([^,\\r\\n].*?)[,\\r\\n]', san) - certValues.san.dns = tmp || '' - - // IP-Addresses IPv4 & IPv6 - tmp = pregMatchAll('IP Address:([^,\\r\\n].*?)[,\\r\\n\\s]', san) - certValues.san.ip = tmp || '' - - // Email Addresses - tmp = pregMatchAll('email:([^,\\r\\n].*?)[,\\r\\n\\s]', san) - certValues.san.email = tmp || '' - } - - // Validity - if ((tmp = certData.match(/Not Before\s?:\s?([^\r\n]*)\r?\n/)) && tmp.length > 1) { - validity.start = Date.parse((tmp && tmp[1]) || '') - } - - if ((tmp = certData.match(/Not After\s?:\s?([^\r\n]*)\r?\n/)) && tmp.length > 1) { - validity.end = Date.parse((tmp && tmp[1]) || '') - } - - if (validity.start && validity.end) { - certValues.validity = validity - } - // Validity end - - // Signature Algorithm - if ((tmp = certData.match(/Signature Algorithm: ([^\r\n]*)\r?\n/)) && tmp.length > 1) { - certValues.signatureAlgorithm = (tmp && tmp[1]) || '' - } - - // Public Key - if ((tmp = certData.match(/Public[ -]Key: ([^\r\n]*)\r?\n/)) && tmp.length > 1) { - certValues.publicKeySize = ((tmp && tmp[1]) || '').replace(/[()]/g, '') - } - - // Public Key Algorithm - if ((tmp = certData.match(/Public Key Algorithm: ([^\r\n]*)\r?\n/)) && tmp.length > 1) { - certValues.publicKeyAlgorithm = (tmp && tmp[1]) || '' - } - - callback(null, certValues) -} - -function matchAll (str, regexp) { - var matches = [] - str.replace(regexp, function () { - var arr = ([]).slice.call(arguments, 0) - var extras = arr.splice(-2) - arr.index = extras[0] - arr.input = extras[1] - matches.push(arr) - }) - return matches.length ? matches : null -} - -function pregMatchAll (regex, haystack) { - var globalRegex = new RegExp(regex, 'g') - var globalMatch = haystack.match(globalRegex) || [] - var matchArray = [] - var nonGlobalRegex, nonGlobalMatch - for (var i = 0; i < globalMatch.length; i++) { - nonGlobalRegex = new RegExp(regex) - nonGlobalMatch = globalMatch[i].match(nonGlobalRegex) - matchArray.push(nonGlobalMatch[1]) - } - return matchArray -} - -function generateCSRSubject (options) { - options = options || {} - - var csrData = { - C: options.country || options.C, - ST: options.state || options.ST, - L: options.locality || options.L, - O: options.organization || options.O, - OU: options.organizationUnit || options.OU, - CN: options.commonName || options.CN || 'localhost', - DC: options.dc || options.DC || '', - emailAddress: options.emailAddress - } - - var csrBuilder = Object.keys(csrData).map(function (key) { - if (csrData[key]) { - if (typeof csrData[key] === 'object' && csrData[key].length >= 1) { - var tmpStr = '' - csrData[key].map(function (o) { - tmpStr += '/' + key + '=' + o.replace(/[^\w .*\-,@']+/g, ' ').trim() - }) - return tmpStr - } else { - return '/' + key + '=' + csrData[key].replace(/[^\w .*\-,@']+/g, ' ').trim() - } - } - }) - - return csrBuilder.join('') -} - -function readFromString (string, start, end) { - if (Buffer.isBuffer(string)) { - string = string.toString('utf8') - } - - var output = [] - - if (!string) { - return output - } - - var offset = string.indexOf(start) - - while (offset !== -1) { - string = string.substring(offset) - - var endOffset = string.indexOf(end) - - if (endOffset === -1) { - break - } - - endOffset += end.length - - output.push(string.substring(0, endOffset)) - offset = string.indexOf(start, endOffset) - } - - return output -} - -// promisify not tested yet -/** - * Verifies the signing chain of the passed certificate - * @namespace - * @name promisified - * @property {function} createPrivateKey @see createPrivateKey - * @property {function} createDhparam - The default number of players. - * @property {function} createEcparam - The default level for the party. - * @property {function} createCSR - The default treasure. - * @property {function} createCertificate - How much gold the party starts with. - */ -module.exports.promisified = { - createPrivateKey: promisify(createPrivateKey), - createDhparam: promisify(createDhparam), - createEcparam: promisify(createEcparam), - createCSR: promisify(createCSR), - createCertificate: promisify(createCertificate), - readCertificateInfo: promisify(readCertificateInfo), - getPublicKey: promisify(getPublicKey), - getFingerprint: promisify(getFingerprint), - getModulus: promisify(getModulus), - getDhparamInfo: promisify(getDhparamInfo), - createPkcs12: promisify(createPkcs12), - readPkcs12: promisify(readPkcs12), - verifySigningChain: promisify(verifySigningChain), - checkCertificate: promisify(checkCertificate), - checkPkcs12: promisify(checkPkcs12) -} diff --git a/node_modules/pem/mocha.opts b/node_modules/pem/mocha.opts deleted file mode 100644 index 7e92d4382..000000000 --- a/node_modules/pem/mocha.opts +++ /dev/null @@ -1,6 +0,0 @@ ---recursive ---bail ---inline-diffs ---reporter spec ---check-leaks ---use_strict diff --git a/node_modules/pem/package.json b/node_modules/pem/package.json deleted file mode 100644 index 321d46bf8..000000000 --- a/node_modules/pem/package.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "_from": "pem@^1.8.3", - "_id": "pem@1.13.1", - "_inBundle": false, - "_integrity": "sha512-gA/kl8/MWWBaVRRv8M4iRkaJXEbp0L9NyG5ggZlbvQxylZAq5K5wGesAZifs89kwL/m4EGdekXtBMOzXM9rv7w==", - "_location": "/pem", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "pem@^1.8.3", - "name": "pem", - "escapedName": "pem", - "rawSpec": "^1.8.3", - "saveSpec": null, - "fetchSpec": "^1.8.3" - }, - "_requiredBy": [ - "/budo" - ], - "_resolved": "https://registry.npmjs.org/pem/-/pem-1.13.1.tgz", - "_shasum": "57dd3e0c044fbcf709db026a737e1aad7dc8330f", - "_spec": "pem@^1.8.3", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", - "author": { - "name": "Andris Reinman", - "email": "andris@kreata.ee" - }, - "bugs": { - "url": "https://github.com/Dexus/pem/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Josef Fröhle", - "email": "github@josef-froehle.de", - "url": "https://www.josef-froehle.de/" - } - ], - "dependencies": { - "es6-promisify": "^6.0.0", - "md5": "^2.2.1", - "os-tmpdir": "^1.0.1", - "which": "^1.3.1" - }, - "deprecated": false, - "description": "Create private keys and certificates with node.js and io.js", - "devDependencies": { - "@deineagenturug/docdash": "^0.4.1", - "@semantic-release/changelog": "^3.0.0", - "@semantic-release/git": "^7.0.4", - "@semantic-release/github": "^5.0.5", - "@semantic-release/npm": "^5.0.4", - "ajv": "^6.0.0", - "auto-changelog": "^1.8.0", - "chai": "^4.1.2", - "cross-env": "^5.2.0", - "dirty-chai": "^2.0.1", - "docco": "^0.8.0", - "eslint": "^5.5.0", - "eslint-config-standard": "^12.0.0", - "eslint-plugin-import": "2.14.0", - "eslint-plugin-json": "^1.2.1", - "eslint-plugin-markdown": "^1.0.0-beta.8", - "eslint-plugin-node": "^7.0.1", - "eslint-plugin-promise": "^4.0.1", - "eslint-plugin-standard": "^4.0.0", - "jsdoc": "^3.5.5", - "marked": "^0.5.0", - "mocha": "^5.2.0", - "nyc": "^13.1.0", - "semantic-release": "^15.9.15", - "travis-deploy-once": "^5.0.7" - }, - "engines": { - "node": ">=6.0.0" - }, - "homepage": "https://github.com/Dexus/pem#readme", - "license": "MIT", - "main": "lib/pem", - "name": "pem", - "nyc": { - "reporter": [ - "html", - "text" - ], - "exclude": [ - "**/*.spec.js", - "test/pem.helper.js" - ] - }, - "release": { - "debug": false, - "verifyConditions": [ - "@semantic-release/changelog", - "@semantic-release/npm", - "@semantic-release/git", - "@semantic-release/github" - ], - "prepare": [ - "@semantic-release/changelog", - "@semantic-release/npm", - { - "path": "@semantic-release/git", - "assets": [ - "CHANGELOG.md", - "HISTORY.md", - "package.json", - "package-lock.json", - "npm-shrinkwrap.json" - ], - "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" - } - ], - "publish": [ - "@semantic-release/npm", - "@semantic-release/github" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Dexus/pem.git" - }, - "scripts": { - "changelog": "auto-changelog --output HISTORY.md", - "coverage": "cross-env NODE_ENV=development nyc ./node_modules/.bin/_mocha --opts mocha.opts $(find . -type f -name '*.spec.js' ! -path './nyc_output/*' ! -path './coverage/*' ! -path './node_modules/*')", - "docco": "docco -l parallel -o docs/docco lib/helper.js lib/openssl.js lib/pem.js", - "documentation": "npm run docco --silent && npm run jsdoc --silent", - "jsdoc": "jsdoc -c jsdoc.json", - "lint": "eslint --fix --config=./.eslintrc.js lib/*.js *.md *.json lib/*.js test/*.js test/*.spec.js", - "semantic-release": "semantic-release", - "test": "npm run lint --silent && npm run coverage --silent" - }, - "version": "1.13.1" -} diff --git a/node_modules/pem/test/convert.spec.js b/node_modules/pem/test/convert.spec.js deleted file mode 100644 index 55e3fe4be..000000000 --- a/node_modules/pem/test/convert.spec.js +++ /dev/null @@ -1,255 +0,0 @@ -'use strict' - -var pem = require('..') -var pemHelper = require('../lib/helper.js') -var fs = require('fs') -var hlp = require('./pem.helper.js') -var chai = require('chai') -var dirtyChai = require('dirty-chai') -var expect = chai.expect -chai.use(dirtyChai) - -describe('convert.js tests', function () { - after(function (done) { - var tmpfiles - tmpfiles = [ - './test/fixtures/tmp.der', - './test/fixtures/tmp.pem', - './test/fixtures/tmp.p7b', - './test/fixtures/tmp.pfx' - ] - pemHelper.deleteTempFiles(tmpfiles, function (fsErr) { - hlp.checkError(fsErr) - done() - }) - }) - - describe('trigger error case', function () { - before(function () { - pem.config({ - pathOpenSSL: 'zzzzzzzzzzz' - }) - }) - it('#.PEM2DER()', function (done) { - pem.convert.PEM2DER('./test/fixtures/nopkey.pem', './test/fixtures/tmp.der', function (error, result) { - hlp.checkError(error, true) - done() - }) - }) - it('#.DER2PEM()', function (done) { - pem.convert.DER2PEM('./test/fixtures/tmp.der', './test/fixtures/tmp.pem', function (error, result) { - hlp.checkError(error, true) - done() - }) - }) - it('#.PEM2P7B()', function (done) { - pem.convert.PEM2P7B({ cert: './test/fixtures/nopkey.pem' }, './test/fixtures/tmp.p7b', function (error, result) { - hlp.checkError(error, true) - done() - }) - }) - it('#.P7B2PEM()', function (done) { - pem.convert.P7B2PEM('./test/fixtures/tmp.p7b', './test/fixtures/tmp.pem', function (error, result) { - hlp.checkError(error, true) - done() - }) - }) - it('#.PEM2PFX()', function (done) { - var pathIN = { - cert: './test/fixtures/test.crt', - key: './test/fixtures/testnopw.key' - } - // password is required to encrypt the .pfx file; enforced by openssl - pem.convert.PEM2PFX(pathIN, './test/fixtures/tmp.pfx', 'password', function (error, result) { - hlp.checkError(error, true) - done() - }) - }) - it('#.PFX2PEM()', function (done) { - pem.convert.PFX2PEM('./test/fixtures/tmp.pfx', './test/fixtures/tmp.pem', 'password', function (error, result) { - hlp.checkError(error, true) - done() - }) - }) - it('#.P7B2PFX() [error in 1st step]', function (done) { - pem.convert.P7B2PFX({ cert: './test/fixtures/test.p7b', key: './test/fixtures/test.key', ca: './test/fixtures/GeoTrust_Primary_CA.pem' }, './test/fixtures/tmp.pfx', 'password', function (error, result) { - hlp.checkError(error, true) - done() - }) - }) - it('#.P7B2PFX() [error in 2nd step]', function (done) { - pem.config({ - pathOpenSSL: process.env.OPENSSL_BIN || 'openssl' - }) - pem.convert.P7B2PFX({ cert: './test/fixtures/test.p7b', key: './test/fixtures/test404.key', ca: './test/fixtures/ca404.pem' }, './test/fixtures/tmp.pfx', 'password', function (error, result) { - hlp.checkError(error, true) - done() - }) - }) - }) - - describe('check all success cases', function () { - it('#.PEM2DER() [not providing type]', function (done) { - pem.convert.PEM2DER('./test/fixtures/nopkey.pem', './test/fixtures/tmp.der', function (error, result) { - hlp.checkError(error) - expect(result).to.be.true() - done() - }) - }) - - it('#.PEM2DER() [providing type]', function (done) { - pem.convert.PEM2DER('./test/fixtures/nopkey.pem', './test/fixtures/tmp.der', 'x509', function (error, result) { - hlp.checkError(error) - expect(result).to.be.true() - done() - }) - }) - - it('#.DER2PEM() [not providing type]', function (done) { - pem.convert.DER2PEM('./test/fixtures/tmp.der', './test/fixtures/tmp.pem', function (error, result) { - hlp.checkError(error) - expect(result).to.be.true() - var f1 = fs.readFileSync('./test/fixtures/nopkey.pem').toString() - var f2 = fs.readFileSync('./test/fixtures/tmp.pem').toString() - expect(f1).to.equal(f2) - done() - }) - }) - - it('#.DER2PEM() [providing type]', function (done) { - pem.convert.DER2PEM('./test/fixtures/tmp.der', './test/fixtures/tmp.pem', 'x509', function (error, result) { - hlp.checkError(error) - expect(result).to.be.true() - var f1 = fs.readFileSync('./test/fixtures/nopkey.pem').toString() - var f2 = fs.readFileSync('./test/fixtures/tmp.pem').toString() - expect(f1).to.equal(f2) - done() - }) - }) - - it('#.PEM2P7B() [providing a CA cert; no array format]', function (done) { - pem.convert.PEM2P7B({ cert: './test/fixtures/nopkey.pem', ca: './test/fixtures/GeoTrust_Primary_CA.pem' }, './test/fixtures/tmp.p7b', function (error, result) { - hlp.checkError(error) - expect(result).to.be.true() - done() - }) - }) - - it('#.PEM2P7B() [providing a CA cert; array format]', function (done) { - pem.convert.PEM2P7B({ cert: './test/fixtures/nopkey.pem', ca: ['./test/fixtures/GeoTrust_Primary_CA.pem'] }, './test/fixtures/tmp.p7b', function (error, result) { - hlp.checkError(error) - expect(result).to.be.true() - done() - }) - }) - - it('#.PEM2P7B() [not providing a CA cert]', function (done) { - pem.convert.PEM2P7B({ cert: './test/fixtures/nopkey.pem' }, './test/fixtures/tmp.p7b', function (error, result) { - hlp.checkError(error) - expect(result).to.be.true() - done() - }) - }) - - it('#.P7B2PEM()', function (done) { - pem.convert.P7B2PEM('./test/fixtures/tmp.p7b', './test/fixtures/tmp.pem', function (error, result) { - hlp.checkError(error) - expect(result).to.be.true() - var f1 = fs.readFileSync('./test/fixtures/nopkey.pem').toString() - var f2 = fs.readFileSync('./test/fixtures/tmp.pem').toString() - // can't directly compare as f2 comes with x509v3 header which might not be included in source file - pem.readCertificateInfo(f1, function (error, d1) { - hlp.checkError(error) - pem.readCertificateInfo(f2, function (error, d2) { - hlp.checkError(error) - expect(d1).to.eql(d2) - }) - done() - }) - }) - }) - - it('#.PEM2PFX() [no password protected key file]', function (done) { - var pathIN = { - cert: './test/fixtures/test.crt', - key: './test/fixtures/testnopw.key' - } - // password is required to encrypt the .pfx file; enforced by openssl - pem.convert.PEM2PFX(pathIN, './test/fixtures/tmp.pfx', 'password', function (error, result) { - hlp.checkError(error) - expect(result).to.be.true() - done() - }) - }) - - it('#.PEM2PFX() [password protected key file]', function (done) { - var pathIN = { - cert: './test/fixtures/test.crt', - key: './test/fixtures/test.key' - } - pem.convert.PEM2PFX(pathIN, './test/fixtures/tmp.pfx', 'password', function (error, result) { - hlp.checkError(error) - expect(result).to.be.true() - done() - }) - }) - - it('#.PEM2PFX() [providing CA cert; no array format]', function (done) { - var pathIN = { - cert: './test/fixtures/test.crt', - key: './test/fixtures/test.key', - ca: './test/fixtures/GeoTrust_Primary_CA.pem' - } - pem.convert.PEM2PFX(pathIN, './test/fixtures/tmp.pfx', 'password', function (error, result) { - hlp.checkError(error) - expect(result).to.be.true() - done() - }) - }) - - it('#.PEM2PFX() [providing CA cert; array format]', function (done) { - var pathIN = { - cert: './test/fixtures/test.crt', - key: './test/fixtures/test.key', - ca: ['./test/fixtures/GeoTrust_Primary_CA.pem'] - } - pem.convert.PEM2PFX(pathIN, './test/fixtures/tmp.pfx', 'password', function (error, result) { - hlp.checkError(error) - expect(result).to.be.true() - done() - }) - }) - - it('#.PFX2PEM()', function (done) { - pem.convert.PFX2PEM('./test/fixtures/tmp.pfx', './test/fixtures/tmp.pem', 'password', function (error, result) { - hlp.checkError(error) - expect(result).to.be.true() - done() - }) - }) - - it('#.P7B2PFX() [providing ca cert; no array format]', function (done) { - pem.convert.P7B2PFX({ cert: './test/fixtures/test.p7b', key: './test/fixtures/test.key', ca: './test/fixtures/GeoTrust_Primary_CA.pem' }, './test/fixtures/tmp.pfx', 'password', function (error, result) { - hlp.checkError(error) - expect(result).to.be.true() - done() - }) - }) - - it('#.P7B2PFX() [providing ca cert; array format]', function (done) { - pem.convert.P7B2PFX({ cert: './test/fixtures/test.p7b', key: './test/fixtures/test.key', ca: ['./test/fixtures/GeoTrust_Primary_CA.pem'] }, './test/fixtures/tmp.pfx', 'password', function (error, result) { - hlp.checkError(error) - expect(result).to.be.true() - done() - }) - }) - - it('#.P7B2PFX() [not providing ca cert]', function (done) { - pem.convert.P7B2PFX({ cert: './test/fixtures/test.p7b', key: './test/fixtures/test.key' }, './test/fixtures/tmp.pfx', 'password', function (error, result) { - hlp.checkError(error) - expect(result).to.be.true() - done() - }) - }) - }) -}) diff --git a/node_modules/pem/test/fixtures/GeoTrust_Primary_CA.pem b/node_modules/pem/test/fixtures/GeoTrust_Primary_CA.pem deleted file mode 100644 index 41372438b..000000000 --- a/node_modules/pem/test/fixtures/GeoTrust_Primary_CA.pem +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBY -MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMo -R2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEx -MjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgxCzAJBgNVBAYTAlVTMRYwFAYDVQQK -Ew1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQcmltYXJ5IENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9 -AWbK7hWNb6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjA -ZIVcFU2Ix7e64HXprQU9nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE0 -7e9GceBrAqg1cmuXm2bgyxx5X9gaBGgeRwLmnWDiNpcB3841kt++Z8dtd1k7j53W -kBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGttm/81w7a4DSwDRp35+MI -mO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4G -A1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJ -KoZIhvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ1 -6CePbJC/kRYkRj5KTs4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl -4b7UVXGYNTq+k+qurUKykG/g/CFNNWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6K -oKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHaFloxt/m0cYASSJlyc1pZU8Fj -UjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG1riR/aYNKxoU -AT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk= ------END CERTIFICATE----- diff --git a/node_modules/pem/test/fixtures/cn_openssl.crt b/node_modules/pem/test/fixtures/cn_openssl.crt deleted file mode 100644 index 79d250bae..000000000 --- a/node_modules/pem/test/fixtures/cn_openssl.crt +++ /dev/null @@ -1,34 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIF7zCCA9egAwIBAgIJAIunRBcrTt9GMA0GCSqGSIb3DQEBCwUAMIGKMRUwEwYD -VQQDDAzkuK3lm73pk7booYwxHzAdBgkqhkiG9w0BCQEWEGVudmVrQGVudmVrLm5h -bWUxGzAZBgNVBAoMEuazleWFsOWFi+emj+WIhuihjDESMBAGA1UECwwJ5YWL56aP -5YiGMRIwEAYDVQQHDAnlhbDlhYvnpo8xCzAJBgNVBAYTAlJVMB4XDTE4MDkxMTIw -MjU0M1oXDTE5MDkxMTIwMjU0M1owgYoxFTATBgNVBAMMDOS4reWbvemTtuihjDEf -MB0GCSqGSIb3DQEJARYQZW52ZWtAZW52ZWsubmFtZTEbMBkGA1UECgwS5rOV5YWw -5YWL56aP5YiG6KGMMRIwEAYDVQQLDAnlhYvnpo/liIYxEjAQBgNVBAcMCeWFsOWF -i+emjzELMAkGA1UEBhMCUlUwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC -AQC/FZCosDlD/6CeAmVtM8mtccjbzpMSuMzGNd2h40Nz156a4gdCveoLmna4Kxud -2tlkH9MfhHZRHjoscS3E/r3MbQj8MfLV6NOV39YZeKpibKVHUxH4NKW0QoauWh9R -uzdVm9G5cZScs1lernELLP4G2DoOlc3GYJq5TzCM/XHPOyHvF7ORsmSoBHpjCxHB -QWqVjCY0/2owQaTD4WSaC9Kouf1RA6efm2WqrnN7RqtApJn/1AgiN7tMvob855/2 -EoSrb04MVOe49NnyF5epWxvdiI3LwCabpXQ+zZ9GQLAQdbLhn/IYIFZMYVOCXFq2 -3cun2fdW9c+oTzHNcaNe1Xj2mwMfnxkRUYKicqcI5/BNcDIxIyPIlYprHC2jBieO -M7Sl24+N9hX6V/mlcIAYttdTtGjM+ZzmGyaD+8dW1RmVsWGMbxW0eHtt55I46HKu -YB0G5CleuG4KmZVB9eILrycCpniVabsr35YNj2rxYOrbozu3QqmvDwfBd5c2wNfg -xmXIOvRjpQU1wcZlMc8QFUP7PQqdBJoYz9oieSY/9BwD/OwldhAFA6UH4q0xJbhD -qBp8VhVc4cI9gb484cZxel22smpiKGRqTwcLwpwJvk1+PZuU28Exe116ThYE0kiy -YD8B0If+eHeyGaxESzoG7YY1o1qY4QNsbxTK4oL1sWzYiwIDAQABo1YwVDAJBgNV -HRMEAjAAMAsGA1UdDwQEAwIFoDA6BgNVHREEMzAxggtleGFtcGxlLmNvbYIRKi5h -cHAuZXhhbXBsZS5jb22CD3d3dy5leGFtcGxlLmNvbTANBgkqhkiG9w0BAQsFAAOC -AgEALwUbyLP3pvjYiKvy54BLobrLtdQiD6jNUR6VyUpCxmNIZXC0k7V5Xdte5pAs -qrf6YJyCzea/Z3AZL/RrVDKSRTU/yFgPJL6LUsfpdaL9bcrD2E79dlWuzj90ovp6 -poPebkFSsWoS0sDjzafCVccICR/r7Hdae1ITcIMrfgWPMZ134A1cU43V21Sj5qy2 -18hrErzDEUCBM1mpI2AAs8bhotLT5oVW5M7cvLmOVYja+ahoKHIf+waoIm5f4ofY -JsnqyPk7GXRFkWpagEZVIcCBtcBGo3yMNVHwY7H1G4KmgMaPeHKwBXWqmfBzWAq9 -tWn49pFB8uNPHoFmE/IQIngHcziuaGBduiEOAbJfncSQfQY9RoZEy7SfkOY4FMp7 -mRY2SVEa0m0Lvt9HZuxsQsoMYsHuihCEIKnPfr8bcn/+qvctOc4I6A5LnfVNxv93 -Gw/ZbmoAYPL23RkzP3uxl3f9vMwfNIwl5wGFbXdcxl3KBT/FG4ruvyfDY8PMfeoR -qdF7Ns7y/aUEthiRk/66zMFyywyXWu8vG8tw1sy8WpBVjc7tNgfSuKt1sCASmcRx -zcEDebyLF2rNLuqP8BrJcFG9s5+SRq5gp0X1CNXV9N6WpulyA3L3XgJuLb1I7dDT -9kRcesNkaKfT4/STBU09lXRF4N+Y68UywYjg8yl0xVVtIjo= ------END CERTIFICATE----- diff --git a/node_modules/pem/test/fixtures/cn_openssl.csr b/node_modules/pem/test/fixtures/cn_openssl.csr deleted file mode 100644 index cb7370427..000000000 --- a/node_modules/pem/test/fixtures/cn_openssl.csr +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIDCDCCAfACAQAwgYoxFTATBgNVBAMMDOS4reWbvemTtuihjDEfMB0GCSqGSIb3 -DQEJARYQZW52ZWtAZW52ZWsubmFtZTEbMBkGA1UECgwS5rOV5YWw5YWL56aP5YiG -6KGMMRIwEAYDVQQLDAnlhYvnpo/liIYxEjAQBgNVBAcMCeWFsOWFi+emjzELMAkG -A1UEBhMCUlUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCqhXFd9CPZ -FQzzPGQL8mdPHNLg2xxbcDLUtT7S1B3L1cOBacb9cF6bEUqeIUqZILcTgHODb/Oh -/HSyzwVo1LspqjAbP3e/eBrqkkCo7fH1I6iaKK6CqGv7232YgNKA0i5FXjV7VDGO -ewA5foQVqk5G/PlNhO79vIBDf+7dGHKpn8rCrf7OtBsvtVruMruA++1Sqpf2Vd+f -X+sCr2SvlJbddt66MycICv7kg05sJ/fEYuQQMj1VeRn2ZVbx+K6eKGIl6Z4ow7Y0 -/jqlP1UTFpDGLp0MelAUtm9ytDmyclFCfBk371H9K16gkM8dppG0CKMdjrfSP5a5 -MGu6DdloawUxAgMBAAGgODA2BgkqhkiG9w0BCQ4xKTAnMCUGA1UdEQQeMByCC2V4 -YW1wbGUuY29tgg0qLmV4YW1wbGUuY29tMA0GCSqGSIb3DQEBCwUAA4IBAQBu3ROV -8aDYNWTi2+qwC8XbMV/07Pj+SQ9MI8PT8ePh3DTIzYsFGO0eO3yKRS6srPd8bkGN -6YFcot3/9XQdHbCeBJo/O0bTinqTd8yHlgsfymj83zdIZTIxeRsW3cmKA/swjDAC -p5fMSWYNID5ChaFz+B7H7Pcoisu+aIAaKw8zzLW1uWwzv5xnLSS1aeRE/FSiSs76 -zP8Jedpfc8F4FVyswgp6QTQVgf9RLg9UTLbv/wqXi/R/MYvSRLDVNwZl09Ky9Q+N -ErbreM847nGGyY+yAk6JRwhuiqbjxMSfRpzezbGEaea/VH/7+OqnEPtaZBV8rOqu -2WO/PNGuXswH8x/e ------END CERTIFICATE REQUEST----- diff --git a/node_modules/pem/test/fixtures/cn_openssl.key b/node_modules/pem/test/fixtures/cn_openssl.key deleted file mode 100644 index c7e5bbf84..000000000 --- a/node_modules/pem/test/fixtures/cn_openssl.key +++ /dev/null @@ -1,52 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQC/FZCosDlD/6Ce -AmVtM8mtccjbzpMSuMzGNd2h40Nz156a4gdCveoLmna4Kxud2tlkH9MfhHZRHjos -cS3E/r3MbQj8MfLV6NOV39YZeKpibKVHUxH4NKW0QoauWh9RuzdVm9G5cZScs1le -rnELLP4G2DoOlc3GYJq5TzCM/XHPOyHvF7ORsmSoBHpjCxHBQWqVjCY0/2owQaTD -4WSaC9Kouf1RA6efm2WqrnN7RqtApJn/1AgiN7tMvob855/2EoSrb04MVOe49Nny -F5epWxvdiI3LwCabpXQ+zZ9GQLAQdbLhn/IYIFZMYVOCXFq23cun2fdW9c+oTzHN -caNe1Xj2mwMfnxkRUYKicqcI5/BNcDIxIyPIlYprHC2jBieOM7Sl24+N9hX6V/ml -cIAYttdTtGjM+ZzmGyaD+8dW1RmVsWGMbxW0eHtt55I46HKuYB0G5CleuG4KmZVB -9eILrycCpniVabsr35YNj2rxYOrbozu3QqmvDwfBd5c2wNfgxmXIOvRjpQU1wcZl -Mc8QFUP7PQqdBJoYz9oieSY/9BwD/OwldhAFA6UH4q0xJbhDqBp8VhVc4cI9gb48 -4cZxel22smpiKGRqTwcLwpwJvk1+PZuU28Exe116ThYE0kiyYD8B0If+eHeyGaxE -SzoG7YY1o1qY4QNsbxTK4oL1sWzYiwIDAQABAoICAApit6wTd+lUOXydELowuGNu -7cXUonXACZE0WEl2OrJPI9WzN0XPYKskyBMWdLfNr0cb27O41V1vUSYdOKmeVt6H -hpd+d35c2zMoKVDVGB2lXg5UW4OsCN2VSBCt4Unl7QoAIBP+Ml+Z99+Hh6ld1qi0 -k+M7DSYdFgvAXBktpUPoKN3/4cinc4UWSTic32grkAl0xpbW0wSwbK4g0AD3Z4m4 -IiaHFlM8dPgj5y7qFmC7EYuwEIkbkliHenrAdBdBxmgy8oEFFFsfI8FeuuV/iDIw -O9S5KuAGzBylvGRrG6apXwGYWeYpy8b2+zz4nA2YXHtRA3p8fb7eHwzVglWjMKHO -fgVMx+lPRbMjwp6zO6B8CJCpL45Ts3MRzcj+kPTgH0DOA4H1RtSX8VF2sj2fqPNg -xjJ6yBIzcO62QYMOYy3GXNWDak3lF7uZnfVYTu/pN09wUpxwuLYsoDKEQnYrYbfy -ZfDMe/8x6NZ8saPUy75eq2MViTKOWrhHrV+kPUriFD/S08YsajyYdW4UNy9gTmhH -S2t5cz5bM5ppQikLI9E1ZOnC/BTmtOqyp3VddY34VlrKmlE8kKuHjuXclL5zSD5o -+yzKVGSRoLVx0rx3H+t5Ginypk8C8MItgZ/fzKr1pCGppY+5SYFVi0MF9mfqHpzN -z4e1e36TW7x60rD619ARAoIBAQD0ML/Hvk0hRby6n258lOvLgmDPTDFCFMN3m9Sj -9wklWC5Az0SuFJgCL6UQXUPOd5j+eLLk8ZR1zPq/0kBgLe7vKhSeHLqwqAZ9qL3b -BakxCcUxieP+YEdqcNMpMBL5uJaSU89lpAiXheroewwEp4+wVOFrrUovBLld15Ri -P+O23N9LpS0Mktu/srxwlU7zsEi5SLeo8RQuHDjvshCuUTmV0ekiQUyCmvRuvLbJ -KqvPMfMTaaJpB1SYLYkMwI8Q4fUJWSP76GVMCGJNY1QXeqJn3bDRixOrAJYMBg0E -U58m3FbCVX0mr2wwcY8z/8A1WBqWDdddRoxSZ2Zajftthbm9AoIBAQDIU1LY2UAm -iOfp7LDaca5sslnncm79FpZyoWqaZSskM0qF4u3zSUNgJQf+IIJDwD9m6WZWB/XU -2Jc8OpA2FufDCQyRmLhHWXaNl1YXnHBCP6AEaDqF7/Go3OmFL7Z0wbISSHqFr6sf -PRjpVenI9eGNS51IqeGHhTbJkRyTbDYG1DyDiKMa7sHhu8u1feqQjzMKCCEXVRaR -Nvf+IRTf9nZfMCUMhiP26zb8xKLUgmwohETFiax3J9uHN3thROl0EfyBbNJC0qFB -SS+HUdffJFDovdC4Z7sebg9cYYNF8NojK89LMtZ++M/4IqmA6swSaR3AqaVpomxX -KChoZNIyBavnAoIBAGAoHiz6rAaxHmtiwrA+OEfwNE0NFMyPvpUIAQj8C1bwTW5p -8AKYy2748gfqofvYrp9uSgvLcYmdyRPmKEF3dQIq0OmeKInN8Jhk7TYlGYXc8hDa -2rPdl+G7QfuTGbXKUUiXxjChEl0Qd/tKEOZ4USW/lvC+0VqIgrIIZT73J6Vnfmqc -RYwQ/IWVTY0LzoY5YbnMf74ACNFLfcQtm1H5XDK58RLzIbzAZgaBO30l13gElFKN -o022fEJck/44iV29jK88seXNkq4JEySkO4XvXaqG6szo9jq9RVjAvTl58E7uLx/h -aCHmrDS7UwfH6xlWc0mpc6ggUrtUSkLYbCypnwUCggEBAIuJjsHBwm+VGYXV+vKO -ESNhsEIJccoU+8LpMOpO4hgbKiPMiFbYh3fnE4QufM5YkVFL7p6qeNBD9kRbvqwO -lG1EVl7sdCAu7ud9rNhRfdiHnRy0xV8aXchz6K1/KKZ3bWRS3BVW4emmkz2lPG1g -6DWVn/9HZfMSFbGdxLvjulZTa7trZ8GQ4bgtKZ5IESWUucaZFwO7nzaThXac8H94 -m8d+L7Bjl5WdDfZPueQw3Mn0KDs4xMtTFhU/zk9Ywwy4opw8gtFNCkoBgnvNxIKI -N1uHLGXmy25M16JPwjLrq+an04Lb7JERGzwKWOuVoYSJd9IF2VSVcMXdERh2cfup -+60CggEATnzogQm0ysLp8qA8uqvvYBh2XuQwuoVYedbRkxEOoaBgr0iUf6xWtaNb -dFpd3pad4ubT4wUuZfqYwfm3qOThmTih13/4P/6kFR1dC5HwD4AXLrJgvYns+HdV -z4jf45WCqHnJdWw9DjH3UJ3xysdshCNL29ywNCF0ldF37HhdVQK1bGJ1T4jjXfof -CMBBDEwP7SYO0YE/5LtxBPn/0Fw3tTixDvofGh8qnEnCK+hwNMAnPjANBRyvdL2N -gBMs5svby2vT0FXsrwNAEOVufjelUGyyBQW0nrZz7nsnOKqOFZJtpmXBnlMAwoO8 -arLIdCWiu5/CkI+NEdAJShlznkh4nQ== ------END PRIVATE KEY----- diff --git a/node_modules/pem/test/fixtures/cn_openssl_config.conf b/node_modules/pem/test/fixtures/cn_openssl_config.conf deleted file mode 100644 index 2d65cd76f..000000000 --- a/node_modules/pem/test/fixtures/cn_openssl_config.conf +++ /dev/null @@ -1,38 +0,0 @@ -# openssl req -new -utf8 -nameopt multiline,utf8 -config Dokumente/git/dexus-pem/test/fixtures/cn_openssl_config.conf -newkey rsa:2048 -nodes -keyout Dokumente/git/dexus-pem/test/fixtures/cn_openssl.key -out Dokumente/git/dexus-pem/test/fixtures/cn_openssl.csr -# openssl req -x509 -newkey rsa:4096 -sha256 -utf8 -days 365 -nodes \ - -config Dokumente/git/dexus-pem/test/fixtures/cn_openssl_config.conf \ - -keyout Dokumente/git/dexus-pem/test/fixtures/cn_openssl.key \ - -out Dokumente/git/dexus-pem/test/fixtures/cn_openssl.crt - -HOME = . -RANDFILE = $ENV::HOME/.rnd - -[CA_default] -copy_extensions = copy - -[req] -default_bits = 4096 -prompt = no -string_mask = utf8only -utf8 = yes -default_md = sha256 -distinguished_name = dn -x509_extensions = v3_ca - -[dn] -CN = 中国银行 # Site description -emailAddress = envek@envek.name -O = 法兰克福分行 # My company -OU = 克福分 # My dept -L = 兰克福 # Moscow -C = RU - -[v3_ca] -basicConstraints = CA:FALSE -keyUsage = digitalSignature, keyEncipherment -subjectAltName = @alternate_names - -[alternate_names] -DNS.1 = example.com -DNS.2 = *.app.example.com -DNS.3 = www.example.com diff --git a/node_modules/pem/test/fixtures/google.com.pem b/node_modules/pem/test/fixtures/google.com.pem deleted file mode 100644 index 0d3c09550..000000000 --- a/node_modules/pem/test/fixtures/google.com.pem +++ /dev/null @@ -1,68 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDwjCCAqqgAwIBAgIIMPfmgdxQ04QwDQYJKoZIhvcNAQELBQAwSTELMAkGA1UE -BhMCVVMxEzARBgNVBAoTCkdvb2dsZSBJbmMxJTAjBgNVBAMTHEdvb2dsZSBJbnRl -cm5ldCBBdXRob3JpdHkgRzIwHhcNMTcwOTI2MTA1OTAwWhcNMTcxMjE5MTA1OTAw -WjBoMQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwN -TW91bnRhaW4gVmlldzETMBEGA1UECgwKR29vZ2xlIEluYzEXMBUGA1UEAwwOd3d3 -Lmdvb2dsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQptqSsDzHdgCpE -2bLsaN1aKT/np0r/I2bQ2QZueQvOWKwaJD5Kt6s6HE1LUZ/omxTwacgT7HDWmj8f -bhMEZ45No4IBWDCCAVQwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAsG -A1UdDwQEAwIHgDAZBgNVHREEEjAQgg53d3cuZ29vZ2xlLmNvbTBoBggrBgEFBQcB -AQRcMFowKwYIKwYBBQUHMAKGH2h0dHA6Ly9wa2kuZ29vZ2xlLmNvbS9HSUFHMi5j -cnQwKwYIKwYBBQUHMAGGH2h0dHA6Ly9jbGllbnRzMS5nb29nbGUuY29tL29jc3Aw -HQYDVR0OBBYEFD1fAbfuUfW5VEUWBvJeq8hsdnzlMAwGA1UdEwEB/wQCMAAwHwYD -VR0jBBgwFoAUSt0GFhu89mi1dvWBtrtiGrpagS8wIQYDVR0gBBowGDAMBgorBgEE -AdZ5AgUBMAgGBmeBDAECAjAwBgNVHR8EKTAnMCWgI6Ahhh9odHRwOi8vcGtpLmdv -b2dsZS5jb20vR0lBRzIuY3JsMA0GCSqGSIb3DQEBCwUAA4IBAQBEd6FLPzPDnVVS -HLBtKfb5Gv3rkLku4wy13QORTK1yU+c2cbWCiVXyU8rXUqWLeFfjNw5Z6/2vvNRF -SQ2G/isM+GdT42UI0cPxYV+oLfxcQU9pu2FnsIaq1mSu0ckIe7gFSXRnUZWOHMur -WkSP+4EwUZlXgK/h06fy3Ran1NmBglwWGF3MXAGgNeFeKSRtszn8pClOaWOmjNt8 -pzp6KfJIaZV0y1ss1I8x1XnR7EFbG+9vPQpsB2xhEPqyC78QoazaCS3y9AyFrpzb -Ig2jZRLdtq9bLhsEb1jSM3qIECCiPu0AwNLU+508PVyYXlvRTfwMVo1PfllWhiMP -Ub8Y7gCe ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEKDCCAxCgAwIBAgIQAQAhJYiw+lmnd+8Fe2Yn3zANBgkqhkiG9w0BAQsFADBC -MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMS -R2VvVHJ1c3QgR2xvYmFsIENBMB4XDTE3MDUyMjExMzIzN1oXDTE4MTIzMTIzNTk1 -OVowSTELMAkGA1UEBhMCVVMxEzARBgNVBAoTCkdvb2dsZSBJbmMxJTAjBgNVBAMT -HEdvb2dsZSBJbnRlcm5ldCBBdXRob3JpdHkgRzIwggEiMA0GCSqGSIb3DQEBAQUA -A4IBDwAwggEKAoIBAQCcKgR3XNhQkToGo4Lg2FBIvIk/8RlwGohGfuCPxfGJziHu -Wv5hDbcyRImgdAtTT1WkzoJile7rWV/G4QWAEsRelD+8W0g49FP3JOb7kekVxM/0 -Uw30SvyfVN59vqBrb4fA0FAfKDADQNoIc1Fsf/86PKc3Bo69SxEE630k3ub5/DFx -+5TVYPMuSq9C0svqxGoassxT3RVLix/IGWEfzZ2oPmMrhDVpZYTIGcVGIvhTlb7j -gEoQxirsupcgEcc5mRAEoPBhepUljE5SdeK27QjKFPzOImqzTs9GA5eXA37Asd57 -r0Uzz7o+cbfe9CUlwg01iZ2d+w4ReYkeN8WvjnJpAgMBAAGjggERMIIBDTAfBgNV -HSMEGDAWgBTAephojYn7qwVkDBF9qn1luMrMTjAdBgNVHQ4EFgQUSt0GFhu89mi1 -dvWBtrtiGrpagS8wDgYDVR0PAQH/BAQDAgEGMC4GCCsGAQUFBwEBBCIwIDAeBggr -BgEFBQcwAYYSaHR0cDovL2cuc3ltY2QuY29tMBIGA1UdEwEB/wQIMAYBAf8CAQAw -NQYDVR0fBC4wLDAqoCigJoYkaHR0cDovL2cuc3ltY2IuY29tL2NybHMvZ3RnbG9i -YWwuY3JsMCEGA1UdIAQaMBgwDAYKKwYBBAHWeQIFATAIBgZngQwBAgIwHQYDVR0l -BBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMA0GCSqGSIb3DQEBCwUAA4IBAQDKSeWs -12Rkd1u+cfrP9B4jx5ppY1Rf60zWGSgjZGaOHMeHgGRfBIsmr5jfCnC8vBk97nsz -qX+99AXUcLsFJnnqmseYuQcZZTTMPOk/xQH6bwx+23pwXEz+LQDwyr4tjrSogPsB -E4jLnD/lu3fKOmc2887VJwJyQ6C9bgLxRwVxPgFZ6RGeGvOED4Cmong1L7bHon8X -fOGLVq7uZ4hRJzBgpWJSwzfVO+qFKgE4h6LPcK2kesnE58rF2rwjMvL+GMJ74N87 -L9TQEOaWTPtEtyFkDbkAlDASJodYmDkFOA/MgkgMCkdm7r+0X8T/cKjhf4t5K7hl -MqO5tzHpCvX2HzLc ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT -MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i -YWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQG -EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3Qg -R2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD9 -9BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjoBbdq -fnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv -iS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU -1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+ -bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoW -MPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA -ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l -uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn -Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS -tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF -PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un -hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV -5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw== ------END CERTIFICATE----- diff --git a/node_modules/pem/test/fixtures/idsrv3test.pfx b/node_modules/pem/test/fixtures/idsrv3test.pfx deleted file mode 100644 index 0247dea03f0cc23694291f21310f3ae88880e2bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3395 zcmY*ac{tQ<7yiu{V_$|rA%;e>y=E+9O_nU#g|hFBC`-tmWsqeoSyGW9LYA!AlQm0d zlqs?cuRUcMvVK$7_r34+{c)aipZh-Nxy~QY_1q{N(`7J-3WZ}lgwlyV(0Q=O1fl`u z;TYE;IL2iPy@0|&nf_0rK7rt<4^TL2G9|X44F8>Cqz8fXaF7!e4sw9vh0_0zrd-Yp zq5aB`c0pwf*#!pE3`1~`u};|qLmAL66%SqGD&c1ok7w*g=3CPGVk4GBqUnz5R$^lb z8Dv(rRpfX7yvJ$AZ8B=IukK|?oWq7THPW9AE8<%>%oONtPAOw&x8_?KHa0J|WVwA0 zIe9iq|#j@0h-r2z9#p>N7n4=mGfXBZdZv zm>}$|9($ZRdyt-g#VGBa?>B!qNzif-i+FE)kucwfM0uQ_?eH5E22H7{O&W(b9&xxe z%p<>vWCX)-exQO)Be=&=gf&-c#+j`(NUetfn}WVXG{= z^!3S{N|*XdJW@10Ikf3}LcuN>qA~Ixlg<}c;VO{NzpbcV)gX{XXMvCF$|Bihu8%Mj`v7 z@JI#bMy0mL?ntjDyu>tItFCrcM?2T4qxi{DAYXF4re+jt!0KM!4AX1-`m6J2B-j7$ ztQmXW9+nsyVA76pGD!SNDBJX7<=P3^TAtMP*S&|$8V_zcInNp6F})=P6L9WM3skx( zrU*k+zF?-S=hmjpL4Q3zv>!AS5ZdH` zP7@1%4o~2pGsTCkqHI#fTE9t6L}0I0RV#X80*5W8dQ!d^3i!EAcx!{g?Ymhx9_uH| z%5-;5L5^5@FPajHS9ShoBMyy!p(c{qxOAL#hI6ENh505_rZ0?SGHg>G?cH-JcX$bP zvvcygKZ|q33xcOvl0F>Lq;-3oT1}&U{+hFQhdrnZ&f3Cd?*G~+e;NZj-CLQ#d7u*d z-zLck*=~$_*oTD=7glD2s_n4ZBbndKCJM<*Y#U_RIHLGB-|y!WU`T^)1|P6xbeP|G zVeM+?bDY~u1~eh71YCS>5m|2W++)$^^VxHSdmxwhWqlh$#}_R*QJIE}!YhyC22(}y z-pGi)Mp$4isupi_SdyK1kwa|ypqYxDZM%%-W8XLUrq=uHuIVLfoLXn0Ft*+*&7DasMmP3gdi3$so3cjv zU3_I_!HIUJ-KLn$?yVs^q%Nt?{K4vH$8|KG-fP7I-JGh){ZkukKp&IeTFS zofK|@;`zesc<{wV&~=^Lpxwgq@1SZU!pFuL4xnXwJhXzpFXWPHqe5C^&F$XOKSyA*?hARwF^42%X)?En0pbR1|X1Ofs80A>9z2}c|9=>s8v zEFceP0#bk)B`W|LfCL~z!7_mQA0!RPQ8WpPf}*g$)hhsoqDlYhLQ^z_KfESzA7%UR z0wA<8pCMoXxBgEJg#e8I z^!ZaN7vLt~Loo#6Kiktl^Kj613iSpI0w}5OUj_7kE&%=Q0@7Z?>>U#@$=@yzfrG{o ztFTv(L~LX}xO!x0^EITtLxl@_o6uy5gghAR{hz9rAUI9X6qKa_Nw%q za~SdO27));Ss1O7WmAmU?z>@+sX7%|EH>F*@OZUVn!`%vFPjg13@;Tl|_JIFJuO?ibe+@(=CitY0KN zmhw8P&DGlJBqvEH_i~51(xCCqvU$O5a^w(gap!{;x$=mI;>(I{4_^3{xSVlt0*&Z-y38aD8;?f`*U1VzA?{YPa$fn^V7$cGLd)&c%khfmt-qvZ_d8X! z7hHsG8{dHEPrBwl**uN9qgJ5pDa-DS;*TkBvMr}WsGRp(tl&q zOLj#>q5fr!g3h>N*4Lo!^2f&yedb9`Kc@UII#(J*#=~mQpg7_^@Qad_`7&Rw^Q13P zmkj26C2^Lfg&(Un^M{l&&Z~Al#>~&po-IRgbH;zV|EZU6sq2W4r<`>`jAnHJX0F#X zoYLuTJJ&S__HOHM}CU)!}{mUnHM4&H-PJ zDgU|rTaFE6VJ^#8$-7}h}^b=$AFm^Ju%|Irt#Xm@y!x8ht)nP}yX zak6LD=XrWjz}YIk=NKi;Oyzuyhr4N#>$;BIHeVmO7CwR&BH~$h($R>lxm#|jH)hMo z7Cl?fME$4w@i!`TUwnfzepq`tb2MXQ>vjOez4DO&G+ zwbxqf;c;Lz7e^2GJN4&pn)*n036&#X{M)L}3jNt9WQoG#Ltw0 zBSd@4uASn_19~vFMd|jhEOlmOnzg#t-W`Y8`{ihls#Ej*@-YyvQR5@XB{Zgn*UU@bPjBb)ma-dM*TyAY#Qr-I?}ssTqWiQUU~9nVL8urj8g zB=?6~(E%Bt>5<*!OPB%-9y0pkl!uu8}JyuP^C{VwK-!6&8CcOsFR z#AD|e+mNE9i#41w#l(h}rbw&h^*Xp8>93ZTvg}r-DJps1W6hRpeV*HGw|(EWnX7>t zi;7~9X)yDN{8DJzLpxCoH*tL3SHK!$Z}tQc<%NTk$t)S*4<=4>wFvMd!y)pV_liw) z7Z+8=AXg^QgwL(&DRsQU5*({(LDt{G-4Rx#dhx6AP+_msH%Jue6QCy=B0w?y#4k$7;> z=5ttmpV&vFVv}ZY>6NE%#+W))M)nU;WMS%-mtLT!)&4oAMhnY2Hb@dJUGXLb^4wIex}=co7n{7tD1N!| zw63xzN%ImPTf3iZ?X@yq6*F$jX5my$Q%SSyOrlD)y}jkyw`e{y&l34ahp)821A!iS z4-;-p@j6Gn!f>FJQ2ZzwD76?f6_^_WN5dA?3G%E0bF79+L#MT|(Yv~t5ct?-mV0Fj V%$88{h~I%@Xjg7x^oQR@_8&Ry9S;Bi diff --git a/node_modules/pem/test/fixtures/inclpkey.pem b/node_modules/pem/test/fixtures/inclpkey.pem deleted file mode 100644 index 1e97918d1..000000000 --- a/node_modules/pem/test/fixtures/inclpkey.pem +++ /dev/null @@ -1,86 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIJKAIBAAKCAgEA18CnxulIxFNAs3bZLzcoPaPEQtB2zQibUOMcUeUUcvoroLEG -I/PBrZJ8ef4VVNHlZ2La7YGqfuKxUKn72CkJ2oRNPPRuE6sL1e6AYzJ9V6+DPBwn -7exn1v0cEy1Av9Hav3q2Z36wdTttYZ3MbBqX8Vben4DTFmC7im9Gm740dcNM0vHI -8z6YKDDkyy0lYWJIvi7c7ZCTrnS3+klDZSCsjv5SbACOUT62msZPRBx7hBe9XPY2 -6UyRiW9OrawQQcXFZYogyPcno+qsW3QJmSeIYMdEaRgMMhp38kdTRuMSxWmVRRWa -FGB2IKe1jFG/WlcZWseovAvEMMoL5tD4xKiE2SSikvaE8hPqpJOX/u132C91eiw5 -iDxEVgrvElfVno81jn+E5xrRGY0j27XOxX/hiG0E1gHe8HI+UZUdTzC2MgoPhLUA -NOS/gHEQYhTBMlqppt7CWOhS62ZauF7CBnymajPyHopBB1O7a0GSWYV5BKnfVkzg -Yh6Yh5UHsRBJNJyQTAuDJSefASf70MRuUMz1AkcsRZox5c59ho/b/YPqpgBJcRRE -oY6duqSkz50VIC1ndkKBY6J2Tksitd492PjgQ3+jEPBz+27hajeZ3IejBUwp9WMU -m+ujOpsrtFH1BQPeQeXLGo5260eTU5BxxY+GX54LTTOcPIiKkJ+QpjWQgfECAwEA -AQKCAgEAuKLJsiMwP7sTcsHxyUNFr8J3kco+8OY9rLI/KSKHJoJLVcBJBflztOvY -lLnJXYYm8RwbSQgfdWjg36wot2sfYJ66TsDLdw95GIJ74uhxddng0E80KJuYndaL -8SlX8RBRSG5mrRkxP5I04EYfjCASCdoSuKORgeQUersRzPSwhls1YozCMNBPfI2j -LvEavUVUBVWrga6pg7GlRI7wGxokMlcZCA5NvN+Te87cROivF3MNfgHDKlJ5dgkI -Zv4KB4+Nh4D236ULim6pQ7aBBE1dm5zMQbfvr+0Q2wkJDnADP2hE8xMygd+vF/EO -H+BRhqllLFgTYaIcKriuCMCrM/kXff0Wz/zgqRzoUBvYTkL1dBWWNxnDe2nN0UUl -C6fE9RRHJqOGJDDeKDe7S65h08Mbxxh4ZOaRBnxtOygvILza2rGRZ3kxPgPqcSIX -HU3e76OOL5IrXV+C6Z0RX6Fckm2bu1Ado1iXS2xXWDCR0AVl/ADhVIOl5uV9iBoW -eGV1E8uNbCkAZXdAVWXEfU780qN4QCcNmL+Do2nkC/z7E78/m7bTIsk3bXKg3eyc -dm5Sz0I5MrrSliE3WNZDL3RqbTQB+b7/e1MhuIW4pBCtePzbrfl6c/RJ9NjVp3nM -x25cSx8pwCSDh1O63Tjs7S/YwLXOAm86QrsLsNZKh15KG5BTNoUCggEBAP7c6LPt -ZUIHt5r6g1Yb38pR/y2e4d5x9HT/ej6WPCocILcBpHHgOreIER9ZchhrjWvldsk5 -N97TCPolGalKj/NxOdOCyTg4h79z/ivSTDzp+6XAtT/hkf0ylKszxaudbp/2BCpR -/ioBqhcxTlpLEv89VGuGL69U1vySP0ulqfad7Qs3Oig1/tee8bFnj73RR31iDEda -vuDllni7ZM74Q/ibM1T82b9CQyX5VliZbfqMGW6o1mzQEclV8VDBXetJKla3LysF -peiegN1Cu7qxVqymBxoN1ON2x6UMJs2h63dDCrbM6j2j8uA22/RmBE0OtD8QboAH -9q6TSHHmbiJAhysCggEBANi3E5sLY1SdyFTIw0xf/KKjqYQanDo44sZgpN718AtC -gVIf0cn2phIfUx4zHMygQFs0jdo2dghSYIV827/5+X8hmWthVZOTWaQvgcME9PCA -adWn4WcM6VMycWLFsKQzq5hTak17KUx56JETZOti0BKKy4kSr+NcS1ojFJILM0M3 -M1SlXvOIxmZa5QUKR5ZasUiXyFQxv6PiREhM5ppku6NnX+Iroygj09rz/7TrX4Di -ivOi3mUJK/G5047aASR2TbAweKAJ1HYQ1wZkZONAluMRaPruzwQlPFmDmwggNT6a -qW+1vLWd1KRQmoPsPTOX0OwNQq96dOJV59TsnpeWjVMCggEAO/JMDd493f0gs6RO -9hcSWW1V/y4K5J6bKFXbNBN0TVdWXpVVT6+1P+wSUvRgANxzZDiR6xy5RoEO8H9/ -fLFcEJ/GQTjXCZFKZL7svvP1GLLUjRU5zK/K/epCy84epZIfLiLYsfedN9YyYsgn -LNfRvRV44N2sI6pp8viXSLzLsIVO9z9jP4gLzD3HjbnVNomeLiC80J/Im++EqBsz -x/bfTf97YHck5Ha6gpkWNTrJgpAnfz7ZSLjcJiY/34XMCIaqHcFyp8TpVEDMAL8s -luoVgACBVSCBvYr3xJuKGP4H+4JaZ8rlIeCJRTHCJMdGJbXasaa0xwqYfFGKTbgs -mYPiBwKCAQAa6RDsLcvV1AnuTUfDEiBC6ePA3bUMnce7LoEKlquKGmYIlp7sX05b -7bvagipPVo7nRG1g7WZWvjPyH4ECI75RhRCR/vIrcx6sfqG0X8cynh+GQmSA8V9/ -z0G5LCc1HJ1wOtt2Z5bHQlQYv7nGaOzBgK6phMKGjw1kUfrZ774b2JztI+PYheFt -EFhj+dTN3NEq3H4pxkuvxAcKm1H/Vgbe0ZVcdmK6N0i1ZZsZEik3zenHOzA2h58H -UzXsBTIjHvWirUItTUsupgStbIYCmiCibaUFk+Xs89q8mtUDe0xhS79CeeTHAKRJ -CyFExG8NGwr8ZOEk/SXKfTRegktnM3C1AoIBACF8jJNF9hlI0nxjKt4TP1jUTCx1 -Jz25APXDpgfMyOatLa5LGP37/FHJwehxim17CrBmE4ahIin7myqZ5MSaf81Dr0qq -k0dWj16h9P6TvfcNl2iwT4VIwx0uy2faWBED1DrCJcuQCy5nPrts2ZIaAWPi1t3t -VbDKQvs+KXBEeqh0qYcYkejUXqIF0uKUFLjiQmZssjpL5RHqqWuYKbO87n+Jod1L -TjGRHdbP0zF2U0LdjM17rc2hpJ3qrmgJ7pOLzbXMcOr+NP1ojRCArXhQ4iLs7D8T -eHw9QH4luJYtnmk7x03izLMQdLWcKnUbqh/xOVPyazgJHXwRxwNXpMsBVGY= ------END RSA PRIVATE KEY----- ------BEGIN CERTIFICATE----- -MIIGJzCCBA+gAwIBAgIBAzANBgkqhkiG9w0BAQUFADCBsjELMAkGA1UEBhMCRlIx -DzANBgNVBAgMBkFsc2FjZTETMBEGA1UEBwwKU3RyYXNib3VyZzEYMBYGA1UECgwP -d3d3LmZyZWVsYW4ub3JnMRAwDgYDVQQLDAdmcmVlbGFuMS0wKwYDVQQDDCRGcmVl -bGFuIFNhbXBsZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxIjAgBgkqhkiG9w0BCQEW -E2NvbnRhY3RAZnJlZWxhbi5vcmcwHhcNMTIwNDI3MTA1NDUzWhcNMjIwNDI1MTA1 -NDUzWjB+MQswCQYDVQQGEwJGUjEPMA0GA1UECAwGQWxzYWNlMRgwFgYDVQQKDA93 -d3cuZnJlZWxhbi5vcmcxEDAOBgNVBAsMB2ZyZWVsYW4xDjAMBgNVBAMMBWNhcm9s -MSIwIAYJKoZIhvcNAQkBFhNjb250YWN0QGZyZWVsYW4ub3JnMIICIjANBgkqhkiG -9w0BAQEFAAOCAg8AMIICCgKCAgEA18CnxulIxFNAs3bZLzcoPaPEQtB2zQibUOMc -UeUUcvoroLEGI/PBrZJ8ef4VVNHlZ2La7YGqfuKxUKn72CkJ2oRNPPRuE6sL1e6A -YzJ9V6+DPBwn7exn1v0cEy1Av9Hav3q2Z36wdTttYZ3MbBqX8Vben4DTFmC7im9G -m740dcNM0vHI8z6YKDDkyy0lYWJIvi7c7ZCTrnS3+klDZSCsjv5SbACOUT62msZP -RBx7hBe9XPY26UyRiW9OrawQQcXFZYogyPcno+qsW3QJmSeIYMdEaRgMMhp38kdT -RuMSxWmVRRWaFGB2IKe1jFG/WlcZWseovAvEMMoL5tD4xKiE2SSikvaE8hPqpJOX -/u132C91eiw5iDxEVgrvElfVno81jn+E5xrRGY0j27XOxX/hiG0E1gHe8HI+UZUd -TzC2MgoPhLUANOS/gHEQYhTBMlqppt7CWOhS62ZauF7CBnymajPyHopBB1O7a0GS -WYV5BKnfVkzgYh6Yh5UHsRBJNJyQTAuDJSefASf70MRuUMz1AkcsRZox5c59ho/b -/YPqpgBJcRREoY6duqSkz50VIC1ndkKBY6J2Tksitd492PjgQ3+jEPBz+27hajeZ -3IejBUwp9WMUm+ujOpsrtFH1BQPeQeXLGo5260eTU5BxxY+GX54LTTOcPIiKkJ+Q -pjWQgfECAwEAAaN7MHkwCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNT -TCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFLVdDU9V9nUaI7P1jLxr -WraWbK7gMB8GA1UdIwQYMBaAFCNsLT0+KV14uGw+quK7Lh5sh/JTMA0GCSqGSIb3 -DQEBBQUAA4ICAQC/P+cWorqxz9Z584TtpRA+YEIO1RrG6bE5hlou3a62txYzMxc+ -g/eh97QbCXSPmw2OTMeh1mZsAjq18nKqyeSzxp1uwEjcOSEwGKBvywm+3g9jgwQy -c6e8QjS3odwhIQiGZbwuxXiu+/6r+4uFv2Hg4qpSXx4NGSITlHq0vVwwjUMitOkT -Yn4+9eJ6KjvaH1dKXbhsTPVuNLm9tB/ciNAoIKIMMeh/OiO4YEjITuECYq4A+9Cl -dsvq89d1DZ5WSMEuRMcMnwOzrJbFoqAGnivD67UEFTN5Sp4olB0oUJjj67V0aX9p -vGFy0YrM+4m+UTSBEXv6is/nv4GRNBoRY5JB62J9eipaK6OFNls5CEBrDby37TZC -YEXuDCfxQTie25mPD/8b6gKYnxkhM8qiR4nLHalMlLY9suK/HfcSjQH/d9ZyZXDK -gI6iLXgMsp2EOlD56I6FA1jrCtNb01XQvX3eyFuA6g5T1jWGYBDtvQb0WRVkdUy9 -L/uK+sHQwtloCSuakcQAsWV9bajCQtHX8XGu25Yz56kpJ/OJjcishxT6pc/sthum -A5PX739JsNUi/p5aG+H/6eNx+ukJP7QaM646YCfS5i8S9DJUvim+/BSlKi2ZiOCd -0MYH4Xb7lmAOTNmTvSYpKo9J2fZ9erw0MYSBTyjh6F7PRbHBiivgUnJfGQ== ------END CERTIFICATE----- diff --git a/node_modules/pem/test/fixtures/nopkey.der b/node_modules/pem/test/fixtures/nopkey.der deleted file mode 100644 index 2457364ef9fa0aaffa38bdc374bed033711075cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 965 zcmXqLVm@fl#H_V|nTe5!iHT3nfR~L^tIebBJ1-+6D=ULR<7`8215P&PP!={}Ca(ZP zJ_8;QheMb(BtN?{-%!AS55#8|W_Qjg&DYH?H54@92Z?YAbGQ{H=4G3>xEM+ph=GK- zh55r%lblnFN)&=i3kvd!N?)g53U0QbjD{JDin|W8)PTQtFsMq&IVgG`+M^nBRZ)A#gH)YtB z_bNG5_~9($dt4h&3h}E$r*WO|2aeHykReP+N%$J`pvDg^3XZ!fgY0OXJKJx zVqIV$3*zvxh_Q%-Y53*Fd@}O(a;ovm%}Czqd`{t{LE{CGyfRDU34_L?4I)XOtKYI+ z*?4tMy~oq{M^B0-{=F%pM0p1Or$dlzrUne}x--|FXUEc wR#^1Mv`&o5ICKyWUbKhS4ICQ}j(NErHYMi~VE($RN09!^V`v3p{ diff --git a/node_modules/pem/test/fixtures/nopkey.pem b/node_modules/pem/test/fixtures/nopkey.pem deleted file mode 100644 index e251f0abb..000000000 --- a/node_modules/pem/test/fixtures/nopkey.pem +++ /dev/null @@ -1,23 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDwTCCAyqgAwIBAgICDh4wDQYJKoZIhvcNAQEFBQAwgZsxCzAJBgNVBAYTAkpQ -MQ4wDAYDVQQIEwVUb2t5bzEQMA4GA1UEBxMHQ2h1by1rdTERMA8GA1UEChMIRnJh -bms0REQxGDAWBgNVBAsTD1dlYkNlcnQgU3VwcG9ydDEYMBYGA1UEAxMPRnJhbms0 -REQgV2ViIENBMSMwIQYJKoZIhvcNAQkBFhRzdXBwb3J0QGZyYW5rNGRkLmNvbTAi -GA8wMDAwMDEwMTAwMDAwMVoYDzk5OTkxMjMxMjM1OTU5WjCBgTELMAkGA1UEBhMC -SlAxDjAMBgNVBAgTBVRva3lvMREwDwYDVQQKEwhGcmFuazRERDEQMA4GA1UECxMH -U3VwcG9ydDEiMCAGCSqGSIb3DQEJARYTcHVibGljQGZyYW5rNGRkLmNvbTEZMBcG -A1UEAxMQd3d3LmZyYW5rNGRkLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC -gYEA4rkBL30FzR2ZHZ1vpF9kGBO0DMwhu2pcrkcLJ0SEuf52ggo+md0tPis8f1KN -Tchxj6DtxWT3c7ECW0c1ALpu6mNVE+GaM94KsckSDehoPfbLjT9Apcc/F0mqvDsC -N6fPdDixWrjx6xKT7xXi3lCy1yIKRMHA6Ha+T4qPyyCyMPECAwEAAaOCASYwggEi -MAwGA1UdEwEB/wQCMAAwCwYDVR0PBAQDAgWgMB0GA1UdDgQWBBRWKE5tXPIyS0pC -fE5taGO5Q84gyTCB0AYDVR0jBIHIMIHFgBRi83vtBtSx1Zx/SOXvxckVYf3ZEaGB -oaSBnjCBmzELMAkGA1UEBhMCSlAxDjAMBgNVBAgTBVRva3lvMRAwDgYDVQQHEwdD -aHVvLWt1MREwDwYDVQQKEwhGcmFuazRERDEYMBYGA1UECxMPV2ViQ2VydCBTdXBw -b3J0MRgwFgYDVQQDEw9GcmFuazRERCBXZWIgQ0ExIzAhBgkqhkiG9w0BCQEWFHN1 -cHBvcnRAZnJhbms0ZGQuY29tggkAxscECbwiW6AwEwYDVR0lBAwwCgYIKwYBBQUH -AwEwDQYJKoZIhvcNAQEFBQADgYEAfXCfXcePJwnMKc06qLa336cEPpXEsPed1bw4 -xiIXfgZ39duBnN+Nv4a49Yl2kbh4JO8tcr5h8WYAI/a/69w8qBFQBUAjTEY/+lcw -9/6wU7UA3kh7yexeqDiNTRflnPUv3sfiVdLDTjqLWWAxGS8L26PjVaCUFfJLNiYJ -jerREgM= ------END CERTIFICATE----- diff --git a/node_modules/pem/test/fixtures/pem196.pem b/node_modules/pem/test/fixtures/pem196.pem deleted file mode 100644 index 0845368ad..000000000 --- a/node_modules/pem/test/fixtures/pem196.pem +++ /dev/null @@ -1,35 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIGFjCCA/6gAwIBAgIIJ5ucCoLSHoowDQYJKoZIhvcNAQELBQAwSzEsMCoGA1UE -AwwjRW50aWRhZCBDZXJ0aWZpY2Fkb3JhIFB1YmxpY2EgQURTSUIxDjAMBgNVBAoM -BUFEU0lCMQswCQYDVQQGEwJCTzAeFw0xODA0MTkyMjAxMzFaFw0xODA0MjIyMjAx -MzFaME0xCzAJBgNVBC4TAkNJMRswGQYDVQQDDBJJTFNFIFNJTEVTIEJFQ0VSUkEx -CzAJBgNVBAYTAkJPMRQwEgYHKwYBAQEBAAwHNDcxMjI4NjCCASIwDQYJKoZIhvcN -AQEBBQADggEPADCCAQoCggEBANU/nRjNgV359qnNoeGFDc54ZSu+ewUgerYa3N0Q -z67vm1RihYo5dWgZRb4SSWMh9fJxSEjr2DpWOpOwhOGj1+0LGdHFVeDRyaF2ftEE -TXtR3Zif//uYQe4IkIGPBovqhbMMChMoR6yEQp41nZXdy1MUFAUc/jv20uKy2kwW -EGbMlhZolZTxb+usyFPBXswmd2zyoiQc9rza36aaXwFo5kX5g5h1ZICdWFybuexW -B3PjU7zc/MgSD2fUeq6DZnQZuhjQEe6IeiOALsDPFIFmxA71CA7elfIPOi/FuyCb -T9nytF5aIKzoXqX+FgzpRJnJnLMYju8GCPtXHd15eba9MOUCAwEAAaOCAfowggH2 -MIGFBggrBgEFBQcBAQR5MHcwQwYIKwYBBQUHMAKGN2h0dHBzOi8vd2VidGVzdC5m -aXJtYWRpZ2l0YWwuYm8vdGVzdGZpcm1hZGlnaXRhbF9iby5wZW0wMAYIKwYBBQUH -MAGGJGh0dHA6Ly93ZWJ0ZXN0LmZpcm1hZGlnaXRhbC5iby9vY3NwLzAdBgNVHQ4E -FgQUWIM6e2y6hsQpY5q9mwW1Pi12puUwHwYDVR0jBBgwFoAUdaV7ANOxKdxh5iBJ -pnkWLGdmvUIwVAYDVR0gBE0wSzBJBgxgRAAAAAEOAQIAAQEwOTA3BggrBgEFBQcC -ARYraHR0cHM6Ly93ZWJ0ZXN0LmZpcm1hZGlnaXRhbC5iby9lY2Fkc2liLnBkZjCB -nAYDVR0fBIGUMIGRMIGOoDugOYY3aHR0cHM6Ly93ZWJ0ZXN0LmZpcm1hZGlnaXRh -bC5iby90ZXN0ZmlybWFkaWdpdGFsX2JvLmNybKJPpE0wSzEsMCoGA1UEAwwjRW50 -aWRhZCBDZXJ0aWZpY2Fkb3JhIFB1YmxpY2EgQURTSUIxDjAMBgNVBAoMBUFEU0lC -MQswCQYDVQQGEwJCTzAOBgNVHQ8BAf8EBAMCBPAwJwYDVR0lBCAwHgYIKwYBBQUH -AwIGCCsGAQUFBwMDBggrBgEFBQcDBDANBgkqhkiG9w0BAQsFAAOCAgEAT9ms6z1g -ardIFD3l90bv8tug7ktK9Rp4d6DLuAjvgDN6fuXCNSwH4nydMJSUS9KlHAaBtFVD -7/RLDVIcoq+FQStXuAjZnOP3fAPgnPr8601rXFhrF2cP1Z7yTR88L9SRu4Xhordl -qPUiSnY1mKiwb7NvjKrFd1Md5zdAraCLtGJw8JGy/QbJIATq+spHTRb7sXnrNh++ -AoZOAx//8lzZkQcO8fZjwFvhXYcaRrafzKUnbU1KuTSx7KKnROzrtO8dHafiJ8/0 -wAWemFkV7fGSDq7IVN1YSTp46vNh4GDt9613x+vE2CLPlWATFDhC6o7b7+0J+g8q -Ac0uUBzqSIhh5HRFIbSmC6o2I48JDB8bWWApjyh6rDpJhvl6cUHbyOzFSceXmf+S -UPvMHk/4A1mpXyrbPCX4zkREyoydxwWNhL/QJWiXF7gKR3miXUVFIiv+RIiT97fC -/GYcLF1RgJENPI7j2JFbqXGXpxoozLziESp51NxTpiusKqUQhBerq/MM97uENwX7 -qr1Qdti0YqKVeth7vgkzhdlSzyyNqripalR/O58uFxRSedU+qLmeT6rJW6FU7KHr -Nr/lVEdzOCFyBln866lF/qN2oLkxJvJCjjuRKbgTzv7V2a5itR4B+4DMUh+iiygb -aptRpqCDtfmC6IjiFUCL4RiwwyxsYgsuwsI= ------END CERTIFICATE----- \ No newline at end of file diff --git a/node_modules/pem/test/fixtures/ru_openssl.crt b/node_modules/pem/test/fixtures/ru_openssl.crt deleted file mode 100644 index efd463d71..000000000 --- a/node_modules/pem/test/fixtures/ru_openssl.crt +++ /dev/null @@ -1,36 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIGTTCCBDWgAwIBAgIJAIHtPbhZDAgJMA0GCSqGSIb3DQEBCwUAMIG5MSQwIgYD -VQQDDBvQntC/0LjRgdCw0L3QuNC1INGB0LDQudGC0LAxHzAdBgkqhkiG9w0BCQEW -EGVudmVrQGVudmVrLm5hbWUxIDAeBgNVBAoMF9Cc0L7RjyDQutC+0LzQv9Cw0L3Q -uNGPMSowKAYDVQQLDCHQnNC+0ZEg0L/QvtC00YDQsNC30LTQtdC70LXQvdC40LUx -FTATBgNVBAcMDNCc0L7RgdC60LLQsDELMAkGA1UEBhMCUlUwHhcNMTgwOTExMjAy -NjU1WhcNMTkwOTExMjAyNjU1WjCBuTEkMCIGA1UEAwwb0J7Qv9C40YHQsNC90LjQ -tSDRgdCw0LnRgtCwMR8wHQYJKoZIhvcNAQkBFhBlbnZla0BlbnZlay5uYW1lMSAw -HgYDVQQKDBfQnNC+0Y8g0LrQvtC80L/QsNC90LjRjzEqMCgGA1UECwwh0JzQvtGR -INC/0L7QtNGA0LDQt9C00LXQu9C10L3QuNC1MRUwEwYDVQQHDAzQnNC+0YHQutCy -0LAxCzAJBgNVBAYTAlJVMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA -mG1gvqlNWIPvUKA5um5GdOUssI5R9MdjoUBFVaZKva8DRDGyI/TcHUmfx2DfiDX3 -Xaa6iez7E4LYvKwiMqmYFSZZa5fVlYz2ggbmldudTnoc7pWzsDafhIwfEVuZAftC -J/LvjIDSZcItPCe+lCwzkLZSZNeR4xS4IUKpMcd2q+8YA1SgBynsNWHU/yv0YVKX -O25bpCvlWXi+5gNt06gZv9gcCH9PsrMJb0S3ZozeG/VLb056zuUUic8URzhuhdJU -0OaXAImRaN7LDE9Ya1gitbvKyP5a93pxIb+B95Gs0YTb98QAYeMChkhdETOww4aJ -hyROJJci/uS/einmAn3AHv9qkFjC9erMvejnaQlTl6hFKtVc3vbvWLfLoGBV4vB5 -tI1O6Bht6m/SOMJ7bFA8T/v+Sp0iWFyGiUFuLUxnLb3sWbrjnp5WWRJXcqmbnV/I -yJu1+4YrdqsWF5LMCmZZNynUiBEjICcLWGIdXsUcRFQRRs4hTdxZO9+gwEPIM32t -2QQKmqWuElIWNsRqQ5o9UTUorT+qPSAi2ajeDHh31yzqTRTm7DG6rieJfI7JvYdv -rTSD7zsK51Y/wmNB43JnRDaIo3zPA4J2c/WO1HQd+LUsJqTdS74j5ac+9NJM8PJY -ZOTKQ2oJ2BMYDuJLV9cG4vz6VoGZSV99bBwE/Fbdm/MCAwEAAaNWMFQwCQYDVR0T -BAIwADALBgNVHQ8EBAMCBaAwOgYDVR0RBDMwMYILZXhhbXBsZS5jb22CESouYXBw -LmV4YW1wbGUuY29tgg93d3cuZXhhbXBsZS5jb20wDQYJKoZIhvcNAQELBQADggIB -AIiEFg9fRBEPQlfGH/fL3BLFT5al+oZPT3G+AYefMfMg7gXl07uBXCpOzhSfxoWw -to2wvORN3Du4vjRbeCLXYAuLX0jz/TgfRDlomLz7u9FND/YftsrLVGvdUE/SPfDm -vPvwA8ga0hNytHJIUFdXSjikCcY2EdBy9c06OW3q9AUEIvlFMexe+aJ8N0y7j5oU -K+2GWqhXR9boqcPIH5l48lYYKlhtpK6lBF1w/EqTxhXZYYRUOtfhPu5+Z/w2sgzF -HtbChDNX7u0IDCTJlQtkbLv7PV0k/PAVkf6ublexfoGhSaycCT75J3KMKofB+8/K -WpymjMtWWHaTVGzbd7ipdXdY/cRqN5qAgiArxYKaYNCu6UUEF/MD38dVjnymD1mN -rG1iIiytFifxnRzU3iUNRgSAyYZGhx9zYkdthS3zjPVvEvPjpTXRFhw9M4pl/dpc -M4z3kAjFaSEiS+Pzump/2T/BIi7s/MdtLMj2OoLTBjusCpRkugKHIUN4ET/glF4B -J/Jb5bMQXeXZ+HPg3gUAgJ9DCjcatxoIS8CGkW8NsYRAYtYKPGsVhXEovWKkNaFv -6wlHomLRIo5lQ0ZyX+VQ6FWEOnN6JMMuonZexrXrHm7WWvCL9BYOL7sj3jtfHUfI -xrFS+TZNYSGp8NqwiofG8tzK0ax7A6XmkKD5SG9i34se ------END CERTIFICATE----- diff --git a/node_modules/pem/test/fixtures/ru_openssl.csr b/node_modules/pem/test/fixtures/ru_openssl.csr deleted file mode 100644 index e8c7d2373..000000000 --- a/node_modules/pem/test/fixtures/ru_openssl.csr +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIDNzCCAh8CAQAwgbkxJDAiBgNVBAMMG9Ce0L/QuNGB0LDQvdC40LUg0YHQsNC5 -0YLQsDEfMB0GCSqGSIb3DQEJARYQZW52ZWtAZW52ZWsubmFtZTEgMB4GA1UECgwX -0JzQvtGPINC60L7QvNC/0LDQvdC40Y8xKjAoBgNVBAsMIdCc0L7RkSDQv9C+0LTR -gNCw0LfQtNC10LvQtdC90LjQtTEVMBMGA1UEBwwM0JzQvtGB0LrQstCwMQswCQYD -VQQGEwJSVTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANiwspBlQzk6 -Yo8EBaVHy/k9vNMpifcbcThux7xLXgwlRgnf8dcfFAzr6WDNGuFJaVihB6TjHKUb -gbafEDrorAiXC+PLe7rgN+tTbgN9r4qhSslRWVplkN4ZEByNAPHvbAW+8dAn7a3O -2tgTtTRSwCrPb53WxtJ4inSb70kKneTF90Ey3kUbRX93V71+nbdQAdxuXAWlLao9 -5QQRBdESjGeFuT6mpjlobRWnWDvcl6QMItF25PjBUF2Klmhk7nk2pyxkDAIkkdRe -JFAU136EoL+2OPSvAfrHR8b0YiZ9GCn6CwTt+5l6TaA19jEkpvmi70+oA2ss9+uu -u7NnpN9+Kn8CAwEAAaA4MDYGCSqGSIb3DQEJDjEpMCcwJQYDVR0RBB4wHIILZXhh -bXBsZS5jb22CDSouZXhhbXBsZS5jb20wDQYJKoZIhvcNAQELBQADggEBAMnzJVf1 -8nPMJa4B87Am+6BWSfxZfUV19CcKK8AtFpQSMUhulLaBa2962jXOHuqEGIj7kxq2 -byBb+6BEay8Oz57bTXthQJ+xr7bDf3XqsOoFy1oWDlZnstxAnl6UeJY8a6uCBqyY -tvdOaf80tntCjjMZ1eNMzg3eEFYl5OCG77SZf0vcST/lf8/ObUA/A190mUmUHktK -WDzI5AgaCDSuE9j8rsHeIyUxuEqb6T/MbeNfbHjUEwHrKnItMY099QtVbDmZ4dPr -axUyIatyGV6Fgn1ABplwBQiRC+6gc3+LJmc4etn5dSgdi0S3HtxYVY6oEfmmYkn5 -zdfhrg3O7xnDqto= ------END CERTIFICATE REQUEST----- diff --git a/node_modules/pem/test/fixtures/ru_openssl.key b/node_modules/pem/test/fixtures/ru_openssl.key deleted file mode 100644 index c7f82b228..000000000 --- a/node_modules/pem/test/fixtures/ru_openssl.key +++ /dev/null @@ -1,52 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIJQQIBADANBgkqhkiG9w0BAQEFAASCCSswggknAgEAAoICAQCYbWC+qU1Yg+9Q -oDm6bkZ05SywjlH0x2OhQEVVpkq9rwNEMbIj9NwdSZ/HYN+INfddprqJ7PsTgti8 -rCIyqZgVJllrl9WVjPaCBuaV251OehzulbOwNp+EjB8RW5kB+0In8u+MgNJlwi08 -J76ULDOQtlJk15HjFLghQqkxx3ar7xgDVKAHKew1YdT/K/RhUpc7blukK+VZeL7m -A23TqBm/2BwIf0+yswlvRLdmjN4b9UtvTnrO5RSJzxRHOG6F0lTQ5pcAiZFo3ssM -T1hrWCK1u8rI/lr3enEhv4H3kazRhNv3xABh4wKGSF0RM7DDhomHJE4klyL+5L96 -KeYCfcAe/2qQWML16sy96OdpCVOXqEUq1Vze9u9Yt8ugYFXi8Hm0jU7oGG3qb9I4 -wntsUDxP+/5KnSJYXIaJQW4tTGctvexZuuOenlZZEldyqZudX8jIm7X7hit2qxYX -kswKZlk3KdSIESMgJwtYYh1exRxEVBFGziFN3Fk736DAQ8gzfa3ZBAqapa4SUhY2 -xGpDmj1RNSitP6o9ICLZqN4MeHfXLOpNFObsMbquJ4l8jsm9h2+tNIPvOwrnVj/C -Y0HjcmdENoijfM8DgnZz9Y7UdB34tSwmpN1LviPlpz700kzw8lhk5MpDagnYExgO -4ktX1wbi/PpWgZlJX31sHAT8Vt2b8wIDAQABAoICAHwTVNP+dlJeGxjzQ+qIx1ty -DX2ua/Int+bTrVy5308mPi9tkIeKUv6YJrKiHXMAEtqt1FxfhkVslkaGi9PXj09w -Bwv47UguFZ7kRSCpQxRVfGWNgFYpMJIxiTyU5ijhwQlJzEr/tcRVWoMECzMMA/GB -J/KkM0G4ZOXWIGm/5s6v8kkLwrPyIS+W8k3AFs5971LWU0yA2tGI40PSeLz4sfUi -0jbsgxCAgmaLdgrJEieJ9ZymMntlp+FBqk0LF5RhEN93RGWQlcfay0e68st2U9LB -CaGwwpV+msaQ4BeJAjcOwgueBX2ozy5Fi1RsUi/mvN4/5EgOqtL3mxGzN2LBv/d5 -3D8D5TuiFtR5uHX4jNO8TLQ4/34EqurqELsydq/I3EduxwbzVV0qw9gp/KgftZ+c -wuZvjoqwsJyleK6XAsBipjszGZvWDHoM6F20rU5kAw8gTInwIjtFgb/CpzOnUqlK -zBlWsyE6tEdyLak94d9qWbuArjAEWY8DMeWcEHnr9H/g42JkO1pCVA6eXk/fBy0+ -SVWGsmSxm3nDMk0WoATqsvO4UBAj2pxdSmy4QlyPzCq/fri3bXYuNaMkohsGJWzI -y0d65bgOV6hCYpHTvTRvcza+OHNbBjOUgOfYhMift3uAh3ETS5VIlWSO7T4dCWYD -IoxqXkYp7oP7F2oO+srxAoIBAQDKQULRlz7dW+jyaiBOHSZzq5ZmaIt57phkvY6b -071FCvnjYM1R7lxyxOiT+iJVxrMTDZKzE36OkQI2oQcA73/qfBNMsxueW8Fe5QRZ -rUTXxImjpyqPSW0iba+9Ei0Q0tkfIVDlBKt/O/EXTHfeg58XrHwMCIOfCyq18znr -avhb5c/+hA8nGx1qYt9HJifnRnkC7tvMh1YNoZAKhXV/DCLEkSnR+KJkoMEqRKzH -pSUGB5+qn9axBk8dTQhkkYt5RuFyzZuS5nO3U6x+Wn0xnSsP5xbTC4iklWvFWNH6 -XMbebTCly72bnJcEbIIiZQA+tGBts5xBMA9DxYD/+XjTl13JAoIBAQDA7oENPg7m -7HDRyK3XYeYEOyMz+9JcugnhTAjf4sxI/rvqfs7aMN8hWY+rkkpdhFCX3g9SWsaY -DFqIf7AC6cq3p9EajEAHqQNUq1YqJAKZJCg5054UbZzBrT3R2BELCW7nCKIKu08C -jDShIsMdHVNB6CPOlurjQhBGtfi4IMaxSV4hdnZ/Mb7gk+GbAR3AVpLqBBePRGG7 -0H6Ke8+0qdYrFnTx4XCXDJMTQzfobn9lxsS1lhrwE8yLhrlGFXDkV0POgObvio8N -36zRX8m0RHZ1WJxuW/CfnMEcqswx41ieYckTOFmJ+VUOyqjYSb+d2lMWcgKDCyAW -nm67a3qTWdnbAoIBAHEFEt+oErsDtyJvZ2n/JBOTGNJVLUuPppz0yBIPuj4wqf8D -gvh7qDGCEy1No44nIL5O4WEsTZZBNeltBkrhiqtvdiFwHMjbIS1z8IBkMIoaC4fl -zASR1Whdvsx6sbArAqVAqsGvYF4TEuAgHQO8rVQ/UHow78waI13VctI4zlwcCaSC -Cy2hG0jtwzMxAS9d1BVtgGnEXrPzSlh2x3edQnhxXds1gxmUMxz5j0to302FSRXB -h+kYS3FmMIByTGwSzbynZH4sRRF2sndQ/ZCR8RRL4BdC5LKDxNtcjMnIumBkx8B+ -H5ArasBQGlA5/G8NwKzMp05OGtmWLkXcFEa42PECggEAL/keTdSoj/Mq+n8T+wJ0 -14h88GglnrkDy+nEKyeR9HSi9WQiu057rSc/+kGeDDLid2DYHnpD93ra6CYX9iF8 -Lr6j2B4Xrc/w7BTOkBv0KXA8MGTWYe3/lIknXg6D7mKiGQCkilaZBuEmFQs3yP2J -vlGi1bPhJDFBKtQEzIQZ4+uCZH+4Z1hPRjh/WLOmWjUswtPRp+YxByqIzJaMxzeT -8ZLb8WlFPcn6qEeGl10igIQ0VZLFj/zcV7VgTHT4ZU7tpWOYCOhDOgfsSQOwfAqq -CfPGsgpagtXPjvlJXP5TAs792LGiUhSVeeAaq+1qoC2xi1s+FKenivhKQIAxMoKd -EQKCAQAf5JLEpUtQUYDvV7oF/Q9HUdaF214Tdnz44FfW91R5TRsmwwGnTkyOUtHo -d/XWb2veV8LtLNh5A/v0SHGIbMSQGrQ/5dLNmuDDrvyTzeuV4DTxi/tlv+vHko73 -8r9olAAqs7uz43hOBLDj814yUYGqwCmczOzacE8FvJAGZt6Lz7k3lt3fv/t8OVkr -cXvI6yHmYyXXBOR/NMDzSd8Az+3YQ1QuWh3dxZHbglbAPuVVgbxiSdcvrivn/v0D -er8piuPKboEtLfPNk/2XLDRJK3VRUCMWyTwMB0aXZYYgOs5gpJsYS+UmAHnOrYra -hNKjP4pz5JpmD4tLqZQD3rLH8vOg ------END PRIVATE KEY----- diff --git a/node_modules/pem/test/fixtures/ru_openssl_config.conf b/node_modules/pem/test/fixtures/ru_openssl_config.conf deleted file mode 100644 index 3fcc6442f..000000000 --- a/node_modules/pem/test/fixtures/ru_openssl_config.conf +++ /dev/null @@ -1,40 +0,0 @@ -# openssl req -new -utf8 -nameopt multiline,utf8 -config Dokumente/git/dexus-pem/test/fixtures/ru_openssl_config.conf -newkey rsa:2048 -nodes -keyout Dokumente/git/dexus-pem/test/fixtures/ru_openssl.key -out Dokumente/git/dexus-pem/test/fixtures/ru_openssl.csr -# openssl req -x509 -newkey rsa:4096 -sha256 -utf8 -days 365 -nodes \ - -config Dokumente/git/dexus-pem/test/fixtures/ru_openssl_config.conf \ - -keyout Dokumente/git/dexus-pem/test/fixtures/ru_openssl.key \ - -out Dokumente/git/dexus-pem/test/fixtures/ru_openssl.crt - -HOME = . -RANDFILE = $ENV::HOME/.rnd - -[CA_default] -copy_extensions = copy -string_mask = utf8only -utf8 = yes - -[req] -default_bits = 4096 -prompt = no -string_mask = utf8only -utf8 = yes -default_md = sha256 -distinguished_name = dn -x509_extensions = v3_ca - -[dn] -CN = Описание сайта # Site description -emailAddress = envek@envek.name -O = Моя компания # My company -OU = Моё подразделение # My dept -L = Москва # Moscow -C = RU - -[v3_ca] -basicConstraints = CA:FALSE -keyUsage = digitalSignature, keyEncipherment -subjectAltName = @alternate_names - -[alternate_names] -DNS.1 = example.com -DNS.2 = *.app.example.com -DNS.3 = www.example.com diff --git a/node_modules/pem/test/fixtures/test.cnf b/node_modules/pem/test/fixtures/test.cnf deleted file mode 100644 index d1b14e8db..000000000 --- a/node_modules/pem/test/fixtures/test.cnf +++ /dev/null @@ -1,26 +0,0 @@ -[ req ] -default_bits = 4096 -days = 9999 -distinguished_name = req_distinguished_name -attributes = req_attributes -prompt = no -x509_extensions = v3_ca - -[ req_distinguished_name ] -C = EE -ST = Harjumaa -L = Tallinn -O = Node.ee -OU = test -CN = www.node.ee -emailAddress = andris@node.ee - -[ req_attributes ] -challengePassword = challengePass - -[ v3_ca ] -authorityInfoAccess = @issuer_info - -[ issuer_info ] -OCSP;URI.0 = http://ocsp.node.ee/ -caIssuers;URI.0 = http://node.ee/ca.cert diff --git a/node_modules/pem/test/fixtures/test.crt b/node_modules/pem/test/fixtures/test.crt deleted file mode 100644 index 3c146c568..000000000 --- a/node_modules/pem/test/fixtures/test.crt +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIChTCCAe4CCQDbGP0P9s69azANBgkqhkiG9w0BAQsFADCBhjELMAkGA1UEBhMC -WlcxGzAZBgNVBAgMEk1hdGViZWxlbGFuZCBOb3J0aDERMA8GA1UEBwwIQnVsYXdh -eW8xDDAKBgNVBAoMA0J5bzELMAkGA1UECwwCSVQxDzANBgNVBAMMBmJ5by56dzEb -MBkGCSqGSIb3DQEJARYMYWRtaW5AYnlvLnp3MB4XDTE1MDQxMDA5NTM1OVoXDTE2 -MDQwOTA5NTM1OVowgYYxCzAJBgNVBAYTAlpXMRswGQYDVQQIDBJNYXRlYmVsZWxh -bmQgTm9ydGgxETAPBgNVBAcMCEJ1bGF3YXlvMQwwCgYDVQQKDANCeW8xCzAJBgNV -BAsMAklUMQ8wDQYDVQQDDAZieW8uencxGzAZBgkqhkiG9w0BCQEWDGFkbWluQGJ5 -by56dzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0q4cDxLRslRKvG2pw5Gx -7fsq7YyiTokoBaDavNold5Vvayi02Mc7dqIanr/ckc0AqgiDd5Kw2bBAYmQpWiDn -pZxp79JIV+gGh7pkiB4wDzvRBXMcew72B9uuYEeUQ8eonE/Yro0ZnD0ZGmBiuk/6 -5xyWNikBhfPLnb2V+Cr/EKsCAwEAATANBgkqhkiG9w0BAQsFAAOBgQAwigr+o+Y+ -5BiL6MuHLTaC+lcv9r2GTHb7wNea674Db3Bi3u6FgmyMsZ8npPSlR0t/YZcFWtRM -y4uXmw5zUutGZTbO/JFxts6kPV+a76mnNm71fF4QINkemmojvJyPZq9N+hV16dba -v1m+dTK7hDZvpd/sM5bMtqWEq4aHkGhujw== ------END CERTIFICATE----- \ No newline at end of file diff --git a/node_modules/pem/test/fixtures/test.csr b/node_modules/pem/test/fixtures/test.csr deleted file mode 100644 index 7851a725e..000000000 --- a/node_modules/pem/test/fixtures/test.csr +++ /dev/null @@ -1,13 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIB3jCCAUcCAQAwgYYxCzAJBgNVBAYTAlpXMRswGQYDVQQIDBJNYXRlYmVsZWxh -bmQgTm9ydGgxETAPBgNVBAcMCEJ1bGF3YXlvMQwwCgYDVQQKDANCeW8xCzAJBgNV -BAsMAklUMQ8wDQYDVQQDDAZieW8uencxGzAZBgkqhkiG9w0BCQEWDGFkbWluQGJ5 -by56dzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0q4cDxLRslRKvG2pw5Gx -7fsq7YyiTokoBaDavNold5Vvayi02Mc7dqIanr/ckc0AqgiDd5Kw2bBAYmQpWiDn -pZxp79JIV+gGh7pkiB4wDzvRBXMcew72B9uuYEeUQ8eonE/Yro0ZnD0ZGmBiuk/6 -5xyWNikBhfPLnb2V+Cr/EKsCAwEAAaAXMBUGCSqGSIb3DQEJAjEIDAZCeW8gQ28w -DQYJKoZIhvcNAQELBQADgYEAxP+4Z2POlTlCBYpGhhKpTBbRDeAQakXqGBlB7ZC2 -0K4fSxuAGVArLV5rbPDHlzNCtmF8mvt55F7zVny4YQ8BHE7ujV3SWtiAr0Otq9VV -WG5LmBLAbyrrUZloHJEpX0wPgQDmMdLhkDkbcjcKOT6WKNW5q36MW+Q9nViStGD5 -lJg= ------END CERTIFICATE REQUEST----- \ No newline at end of file diff --git a/node_modules/pem/test/fixtures/test.dh b/node_modules/pem/test/fixtures/test.dh deleted file mode 100644 index b8b18b14c..000000000 --- a/node_modules/pem/test/fixtures/test.dh +++ /dev/null @@ -1,5 +0,0 @@ ------BEGIN DH PARAMETERS----- -MIGHAoGBAMYXwgiuPY6TqxODWXbRRWx6eWoJuGkjKN8RjhBiLxFJzwgpdfONv5iG -IHHGI8/IfhHI78Mqq+5z3z8L16fuOYnpbaDa2BSUdHZQQmFiCV748lOv9he08UJ5 -qgrFgdgi56V4FdRs2EHJnezvYmviAbIsi8imn+9TVed4DnOmuE1rAgEC ------END DH PARAMETERS----- diff --git a/node_modules/pem/test/fixtures/test.key b/node_modules/pem/test/fixtures/test.key deleted file mode 100644 index ec1c5ece3..000000000 --- a/node_modules/pem/test/fixtures/test.key +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: DES-EDE3-CBC,8D7649F2550A3AD6 - -iD68IbbRZDJuiYBqiEMLSfQQqcbXr4CeHFVkAYxCKN785tg+icShBeYXP2H2Oa7m -dmFBNrtuPclUjk1VFeDcRhd1WwabuSbKJkV26bqIwYKSa1blDcgviSvIc8OgN06G -K7kX+3jQzUMeSj+B1phyysCSoSU059oJvcNknBOEe67ersYZhXWFDOxVOeCnpsVA -xDPRGVWa5g5jj0WqcXey/oC/hUccX8w8RZJLSBurIxfWBGy1QtsnopNRaxs5gqXj -FCucQtYTMwRzA0c65/6yDrYrnv3v0mmCKBKXoTvhcmxkE/Ejrk0+ydxlgWXoMjOD -CzuDy8xQ2KN2/62fb0Eb6LwnI3EHceXAO9GbgpCTXDZt0yoKMBDZFYA1+TuYBXJj -RRcKDcF+gt1VdloSkAWIaDwypnPi0xngsJbzNIHKoSKYPuxWdUXB5rThbSdPki5x -r8La88LBK6/WarJevce8Ggg/KCAx5ng/w9XzQDlMSNVT6Ht+gGe6+69XjBA5IyIo -bymu9PlwRMMYEeEcH53tGXcCgSkzlDs2Cc+1+JUypZpX4oggNV5YhsmLZS5BtPFs -9i3lA7RsxXoV0u1BTgHIqrH58IKaXN9xs0ceie3cLR5tcSiSsU9sh3wpjZ2AZ/Q5 -zjoHuyzQVxY14qlE3uWzI9vJtc/kCkQ4D8wdBRVM8uRzf+YGYKRbI6vvsSICeLuW -n82E2zin77HnIOGVHPJ5aNaTQD91Ubxxv7lVeuxZf2tgejs2DbJraKOtOmHLd9GA -Zb5G9TdFMxVcXq18xUMm/Rbkj8ugALxRy8CGNSrTFTPHaEwYxqhnAQ== ------END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/node_modules/pem/test/fixtures/test.p7b b/node_modules/pem/test/fixtures/test.p7b deleted file mode 100644 index 430c129f5..000000000 --- a/node_modules/pem/test/fixtures/test.p7b +++ /dev/null @@ -1,17 +0,0 @@ ------BEGIN PKCS7----- -MIICtgYJKoZIhvcNAQcCoIICpzCCAqMCAQExADALBgkqhkiG9w0BBwGgggKJMIIC -hTCCAe4CCQDbGP0P9s69azANBgkqhkiG9w0BAQsFADCBhjELMAkGA1UEBhMCWlcx -GzAZBgNVBAgMEk1hdGViZWxlbGFuZCBOb3J0aDERMA8GA1UEBwwIQnVsYXdheW8x -DDAKBgNVBAoMA0J5bzELMAkGA1UECwwCSVQxDzANBgNVBAMMBmJ5by56dzEbMBkG -CSqGSIb3DQEJARYMYWRtaW5AYnlvLnp3MB4XDTE1MDQxMDA5NTM1OVoXDTE2MDQw -OTA5NTM1OVowgYYxCzAJBgNVBAYTAlpXMRswGQYDVQQIDBJNYXRlYmVsZWxhbmQg -Tm9ydGgxETAPBgNVBAcMCEJ1bGF3YXlvMQwwCgYDVQQKDANCeW8xCzAJBgNVBAsM -AklUMQ8wDQYDVQQDDAZieW8uencxGzAZBgkqhkiG9w0BCQEWDGFkbWluQGJ5by56 -dzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0q4cDxLRslRKvG2pw5Gx7fsq -7YyiTokoBaDavNold5Vvayi02Mc7dqIanr/ckc0AqgiDd5Kw2bBAYmQpWiDnpZxp -79JIV+gGh7pkiB4wDzvRBXMcew72B9uuYEeUQ8eonE/Yro0ZnD0ZGmBiuk/65xyW -NikBhfPLnb2V+Cr/EKsCAwEAATANBgkqhkiG9w0BAQsFAAOBgQAwigr+o+Y+5BiL -6MuHLTaC+lcv9r2GTHb7wNea674Db3Bi3u6FgmyMsZ8npPSlR0t/YZcFWtRMy4uX -mw5zUutGZTbO/JFxts6kPV+a76mnNm71fF4QINkemmojvJyPZq9N+hV16dbav1m+ -dTK7hDZvpd/sM5bMtqWEq4aHkGhuj6EAMQA= ------END PKCS7----- diff --git a/node_modules/pem/test/fixtures/testnopw.key b/node_modules/pem/test/fixtures/testnopw.key deleted file mode 100644 index d507c834e..000000000 --- a/node_modules/pem/test/fixtures/testnopw.key +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQDSrhwPEtGyVEq8banDkbHt+yrtjKJOiSgFoNq82iV3lW9rKLTY -xzt2ohqev9yRzQCqCIN3krDZsEBiZClaIOelnGnv0khX6AaHumSIHjAPO9EFcxx7 -DvYH265gR5RDx6icT9iujRmcPRkaYGK6T/rnHJY2KQGF88udvZX4Kv8QqwIDAQAB -AoGALuEtPzFp1eupwaoJR4pI9HKaR8euahlc/XugkLtd8PEgnNCvBTm4Aprpn3+D -3jGmvy8rydSrY5UzjnFJPlPqF2kWkQaBFtqBJpQFjCPDbQ3nwVoaEN7X/lz3v91M -BdoMT36CPvzDwtdrA3U16Jd1JOV09DxP/7jAuvrP3zvuoOkCQQD/eXu/UL++xUb8 -BH4hkookSWrRJHIsRw5gktMoo2tGhe0AXVDh+3Eg8KNfvy2T/PqI7z/pn3QTcjn6 -hJlG7ujVAkEA0x0KUstDNB8FEn64xfmmbCWJ/kyYm3dtiR1ByvqNBJ4Dt3IAIwnP -1ww9NWJfZta34nUzI97rDLyvBubaN0rTfwJBAM1kDOIt+EpWbpBUyFcTai5sPA1y -4LvKULvBrzQ/1hI3v+gIHevg6/3QmXhzyh/tRjrrJpYb1QWBUy2eh2Bo2RUCQQCl -hPROG62yFMwORyqpleXkjr4VkopoAgfwY+7srOqZfyZc0tXGou/ApIjs7Rbtc1Wz -CL6y1hkl4F2+JItcpJ8TAkBUGA1T46IMHtQ4D7HaemPup+ve7gwYx2c1EDlLYAc/ -M9y+va/N+2k6DAMHUNIRktmgYsA5inGT/QCftLql4v+5 ------END RSA PRIVATE KEY----- diff --git a/node_modules/pem/test/helper.spec.js b/node_modules/pem/test/helper.spec.js deleted file mode 100644 index b13cf3a83..000000000 --- a/node_modules/pem/test/helper.spec.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict' - -var fs = require('fs') -var helper = require('../lib/helper.js') -var hlp = require('./pem.helper.js') -var chai = require('chai') -var dirtyChai = require('dirty-chai') -chai.use(dirtyChai) - -// NOTE: we cover here only the test cases left in coverage report -describe('helper.js tests', function () { - describe('#.createPasswordFile()', function () { - it('invalid options [not sufficient object keys]', function (done) { - var tmpfiles = [] - var bufferOrPath = fs.readFileSync('./test/fixtures/idsrv3test.pfx') - helper.createPasswordFile( - {}, - ['pkcs12', '-info', '-in', bufferOrPath, '-noout', '-maciter', '-nodes'], - tmpfiles[tmpfiles.length] - ) - helper.deleteTempFiles(tmpfiles, function (fsErr) { - hlp.checkError(fsErr) - done() - }) - }) - it('invalid options [no password and passType option]', function (done) { - var tmpfiles = [] - var bufferOrPath = fs.readFileSync('./test/fixtures/idsrv3test.pfx') - helper.createPasswordFile( - { cipher: '', bla: true, blub: true }, - ['pkcs12', '-info', '-in', bufferOrPath, '-noout', '-maciter', '-nodes'], - tmpfiles[tmpfiles.length] - ) - helper.deleteTempFiles(tmpfiles, function (fsErr) { - hlp.checkError(fsErr) - done() - }) - }) - it('mustPass option', function (done) { - var tmpfiles = [] - var bufferOrPath = fs.readFileSync('./test/fixtures/idsrv3test.pfx') - helper.createPasswordFile( - { cipher: '', password: 'gregegegeg', passType: 'in', mustPass: 'password' }, - ['pkcs12', '-info', '-in', bufferOrPath, '-noout', '-maciter', '-nodes'], - tmpfiles[tmpfiles.length] - ) - helper.deleteTempFiles(tmpfiles, function (fsErr) { - hlp.checkError(fsErr) - done() - }) - }) - }) - - describe('#.deleteTempFiles()', function () { - it('files argument typeof string', function (done) { - helper.deleteTempFiles('404.pem', function (fsErr) { - hlp.checkError(fsErr) - done() - }) - }) - it('files argument invalid type', function (done) { - helper.deleteTempFiles(true, function (fsErr) { - hlp.checkError(fsErr, true) - done() - }) - }) - it('files argument array contains non-string value', function (done) { - helper.deleteTempFiles([true], function (fsErr) { - hlp.checkError(fsErr) - done() - }) - }) - it.skip('other error than ENOENT occured', function (done) { - // TODO - }) - }) -}) diff --git a/node_modules/pem/test/openssl.spec.js b/node_modules/pem/test/openssl.spec.js deleted file mode 100644 index d33e8049d..000000000 --- a/node_modules/pem/test/openssl.spec.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict' - -var openssl = require('../lib/openssl.js') -var hlp = require('./pem.helper.js') -var chai = require('chai') -var dirtyChai = require('dirty-chai') -var expect = chai.expect -chai.use(dirtyChai) - -// NOTE: we cover here only the test cases left in coverage report -describe('openssl.js tests', function () { - describe('#.exec()', function () { - it('search string not found', function (done) { - openssl.exec([ - 'dhparam', - '-outform', - 'PEM', - 128 - ], 'DH PARAMETERS 404', function (error) { - hlp.checkError(error, true) - done() - }) - }) - }) - - describe('#.execBinary()', function () { - it('no tmpfiles parameter', function (done) { - openssl.execBinary([ - 'dhparam', - '-outform', - 'PEM', - 128 - ], function (error, result) { - hlp.checkError(error) - expect(result).to.be.ok() - done() - }) - }) - }) - - describe('#.spawn()', function () { - it.skip('error case [openssl return code 2]', function (done) { - // TODO; couldn't figure an example out - }) - // TODO; I expect some more cases in here or code cleanup required - }) -}) diff --git a/node_modules/pem/test/pem.helper.js b/node_modules/pem/test/pem.helper.js deleted file mode 100644 index 8a295ad29..000000000 --- a/node_modules/pem/test/pem.helper.js +++ /dev/null @@ -1,132 +0,0 @@ -'use strict' - -var fs = require('fs') -var chai = require('chai') -var dirtyChai = require('dirty-chai') -var expect = chai.expect -chai.use(dirtyChai) - -process.env.PEMJS_TMPDIR = './tmp' - -if (process.env.TRAVIS === 'true' && process.env.OPENSSL_DIR !== '') { - process.env.OPENSSL_BIN = '/openssl/bin/openssl' -} - -function checkTmpEmpty () { - expect(fs.readdirSync(process.env.PEMJS_TMPDIR)).to.be.empty() -} - -function checkError (error, expectError) { - if (expectError) { - expect(error).to.be.ok() - if (expectError !== true) { // object - Object.keys(expectError).forEach(function (k) { - expect(error[k]).to.equal(expectError[k]) // code, message, ... - }) - } - } else { expect(error).to.not.be.ok() } -} - -function checkEcparam (data, min, max) { - expect(data).to.be.an('object').that.has.property('ecparam') - expect(data.ecparam).to.be.a('string') - expect(/^\r?\n*-----BEGIN EC PARAMETERS-----\r?\n/.test(data.ecparam)).to.be.true() - expect(/\r?\n-----END EC PARAMETERS-----\r?\n/.test(data.ecparam)).to.be.true() - expect(/\r?\n-----BEGIN EC PRIVATE KEY-----\r?\n/.test(data.ecparam)).to.be.true() - expect(/\r?\n-----END EC PRIVATE KEY-----\r?\n*$/.test(data.ecparam)).to.be.true() - var matchup = /-----BEGIN EC PRIVATE KEY-----[\s\S]+-----END EC PRIVATE KEY-----/.exec(data.ecparam) - expect(matchup[0].trim().length).to.be.within(min + 1, max - 1) -} - -function checkEcparamNoOut (data, min, max) { - expect(data).to.be.an('object').that.has.property('ecparam') - expect(data.ecparam).to.be.a('string') - expect(/^\r?\n*-----BEGIN EC PRIVATE KEY-----\r?\n/.test(data.ecparam)).to.be.true() - expect(/\r?\n-----END EC PRIVATE KEY-----\r?\n*$/.test(data.ecparam)).to.be.true() - var matchup = /-----BEGIN EC PRIVATE KEY-----[\s\S]+-----END EC PRIVATE KEY-----/.exec(data.ecparam) - expect(matchup[0].trim().length).to.be.within(min + 1, max - 1) -} - -function checkDhparam (data, min, max) { - expect(data).to.be.an('object').that.has.property('dhparam') - expect(data.dhparam).to.be.a('string') - expect(/^\r?\n*-----BEGIN DH PARAMETERS-----\r?\n/.test(data.dhparam)).to.be.true() - expect(/\r?\n-----END DH PARAMETERS-----\r?\n*$/.test(data.dhparam)).to.be.true() - expect(data.dhparam.trim().length).to.be.within(min + 1, max - 1) -} - -function checkPrivateKey (data, min, max, encrypted) { - expect(data).to.be.an('object').that.has.property('key') - expect(data.key).to.be.a('string') - if (encrypted) { expect(/ENCRYPTED\r?\n/.test(data.key)).to.be.true() } - expect(/^\r?\n*-----BEGIN RSA PRIVATE KEY-----\r?\n/.test(data.key)).to.be.true() - expect(/\r?\n-----END RSA PRIVATE KEY-----\r?\n*$/.test(data.key)).to.be.true() - expect(data.key.trim().length).to.be.within(min + 1, max - 1) -} - -function checkCSR (data, expectClientKey) { - expect(data).to.be.an('object'); - ['clientKey', 'csr'].forEach(function (k) { - expect(data).to.have.property(k) - expect(data[k]).to.be.a('string') - }) - if (expectClientKey) { expect(data.clientKey).to.equal(expectClientKey) } - expect(/^\r?\n*-----BEGIN CERTIFICATE REQUEST-----\r?\n/.test(data.csr)).to.be.true() - expect(/\r?\n-----END CERTIFICATE REQUEST-----\r?\n*$/.test(data.csr)).to.be.true() -} - -function checkCertificate (data, selfsigned) { - expect(data).to.be.an('object'); - ['certificate', 'clientKey', 'serviceKey', 'csr'].forEach(function (k) { - expect(data).to.have.property(k) - expect(data[k]).to.be.a('string') - }) - expect(/^\r?\n*-----BEGIN CERTIFICATE-----\r?\n/.test(data.certificate)).to.be.true() - expect(/\r?\n-----END CERTIFICATE-----\r?\n*$/.test(data.certificate)).to.be.true() - if (selfsigned) { expect(data.clientKey).to.equal(data.serviceKey) } else { expect(data.clientKey).to.not.equal(data.serviceKey) } -} - -function checkCertificateData (data, info) { - expect(data).to.deep.equal(info) -} - -function checkPublicKey (data) { - expect(data).to.be.an('object').that.has.property('publicKey') - expect(data.publicKey).to.be.a('string') - expect(/^\r?\n*-----BEGIN PUBLIC KEY-----\r?\n/.test(data.publicKey)).to.be.true() - expect(/\r?\n-----END PUBLIC KEY-----\r?\n*$/.test(data.publicKey)).to.be.true() -} - -function checkFingerprint (data) { - expect(data).to.be.an('object').that.has.property('fingerprint') - expect(data.fingerprint).to.be.a('string') - expect(/^[0-9A-F]{2}(:[0-9A-F]{2}){19}$/.test(data.fingerprint)).to.be.true() -} - -function checkModulus (data, encryptAlgorithm) { - expect(data).to.be.an('object').that.has.property('modulus') - expect(data.modulus).to.be.a('string') - switch (encryptAlgorithm) { - case 'md5': - expect(/^[a-f0-9]{32}$/i.test(data.modulus)).to.be.true() - break - default: - expect(/^[0-9A-F]*$/.test(data.modulus)).to.be.true() - break - } -} - -module.exports = { - checkTmpEmpty: checkTmpEmpty, - checkError: checkError, - checkDhparam: checkDhparam, - checkEcparam: checkEcparam, - checkEcparamNoOut: checkEcparamNoOut, - checkPrivateKey: checkPrivateKey, - checkCSR: checkCSR, - checkCertificate: checkCertificate, - checkCertificateData: checkCertificateData, - checkPublicKey: checkPublicKey, - checkFingerprint: checkFingerprint, - checkModulus: checkModulus -} diff --git a/node_modules/pem/test/pem.spec.js b/node_modules/pem/test/pem.spec.js deleted file mode 100644 index 0ddbb1ecf..000000000 --- a/node_modules/pem/test/pem.spec.js +++ /dev/null @@ -1,963 +0,0 @@ -'use strict' - -var pem = require('..') -var fs = require('fs') -var hlp = require('./pem.helper.js') -var chai = require('chai') -var dirtyChai = require('dirty-chai') -var expect = chai.expect -chai.use(dirtyChai) - -describe('General Tests', function () { - this.timeout(300000)// 5 minutes - this.slow(2000)// 2 seconds - - describe('Requirements', function () { - it('Create tmp folder', function () { - expect(function () { - if (!fs.existsSync(process.env.PEMJS_TMPDIR)) { - fs.mkdirSync(process.env.PEMJS_TMPDIR) - } - }).to.not.throw() - }) - - it('Return an error if openssl was not found', function (done) { - pem.config({ - pathOpenSSL: 'zzzzzzzzzzz' - }) - pem.createPrivateKey(function (error) { - hlp.checkError(error, true) - pem.config({ - pathOpenSSL: process.env.OPENSSL_BIN || 'openssl' - }) - pem.createPrivateKey(function (error) { - hlp.checkError(error) - done() - }) - }) - }) - }) - - describe('#.createDhparam tests', function () { - it('Create default sized dhparam key', function (done) { - pem.createDhparam(function (error, data) { - hlp.checkError(error) - hlp.checkDhparam(data, 150, 160) - hlp.checkTmpEmpty() - done() - }) - }) - it('Create 1024bit dhparam key', function (done) { - this.timeout(600000)// 10 minutes - pem.createDhparam(1024, function (error, data) { - hlp.checkError(error) - hlp.checkDhparam(data, 240, 250) - hlp.checkTmpEmpty() - done() - }) - }) - }) - - describe('#.createEcparam tests', function () { - it('Create default ecparam key', function (done) { - pem.createEcparam(function (error, data) { - hlp.checkError(error) - hlp.checkEcparam(data, 430, 470) - hlp.checkTmpEmpty() - done() - }) - }) - it('Create secp521k1 ecparam key', function (done) { - pem.createEcparam('secp521r1', function (error, data) { - hlp.checkError(error) - hlp.checkEcparam(data, 960, 1000) - hlp.checkTmpEmpty() - done() - }) - }) - it('Create prime256v1 ecparam key', function (done) { - pem.createEcparam('prime256v1', function (error, data) { - hlp.checkError(error) - hlp.checkEcparam(data, 430, 570) - hlp.checkTmpEmpty() - done() - }) - }) - it('Create prime256v1 ecparam key with named_curve param encoding', function (done) { - pem.createEcparam('prime256v1', 'named_curve', function (error, data) { - hlp.checkError(error) - hlp.checkEcparam(data, 200, 430) - hlp.checkTmpEmpty() - done() - }) - }) - it('Create prime256v1 ecparam key with noOut set to true', function (done) { - pem.createEcparam('prime256v1', 'named_curve', true, function (error, data) { - hlp.checkError(error) - hlp.checkEcparamNoOut(data, 200, 430) - hlp.checkTmpEmpty() - done() - }) - }) - it('Create prime256v1 ecparam key with noOut set to false', function (done) { - pem.createEcparam('prime256v1', 'named_curve', false, function (error, data) { - hlp.checkError(error) - hlp.checkEcparam(data, 200, 430) - hlp.checkTmpEmpty() - done() - }) - }) - }) - - describe('#.createPrivateKey tests', function () { - describe('default sized private key', function () { - var pkey - it('create private key', function (done) { - pem.createPrivateKey(function (error, data) { - hlp.checkError(error) - hlp.checkPrivateKey(data, 850, 1900) - hlp.checkTmpEmpty() - pkey = data - done() - }) - }) - - it('get its public key', function (done) { - pem.getPublicKey(pkey.key, function (error, data) { - hlp.checkError(error) - hlp.checkPublicKey(data) - hlp.checkTmpEmpty() - done() - }) - }) - - it('create csr and check key', function (done) { - pem.createCSR({ - clientKey: pkey.key - }, function (error, data) { - hlp.checkError(error) - hlp.checkCSR(data, pkey.key) - hlp.checkTmpEmpty() - done() - }) - }) - - it('create pkcs12 w/o password', function (done) { - pem.createCertificate({ - clientKey: pkey.key, - selfSigned: true - }, function (error, data) { - hlp.checkError(error) - - pem.createPkcs12(data.clientKey, data.certificate, 'mypassword', function (error, pkcs12) { - hlp.checkError(error) - expect(pkcs12).to.be.ok() - hlp.checkTmpEmpty() - done() - }) - }) - }) - }) - - describe('2048bit Private key', function () { - var pwkey - it('create private key', function (done) { - pem.createPrivateKey(2048, function (error, data) { - hlp.checkError(error) - hlp.checkPrivateKey(data, 1650, 1710) - hlp.checkTmpEmpty() - done() - }) - }) - - it('create private key with password', function (done) { - pem.createPrivateKey(2048, { - cipher: 'aes128', - password: 'min4chars' - }, function (error, data) { - hlp.checkError(error) - hlp.checkPrivateKey(data, 1700, 1800, true) - hlp.checkTmpEmpty() - pwkey = data - done() - }) - }) - - it('create csr using private key with password', function (done) { - pem.createCSR({ - clientKey: pwkey.key, - clientKeyPassword: 'min4chars' - }, function (error, data) { - hlp.checkError(error) - hlp.checkCSR(data, pwkey.key) - hlp.checkTmpEmpty() - done() - }) - }) - - it('create cert using pkey w/ password; create pkcs12', function (done) { - pem.createCertificate({ - clientKey: pwkey.key, - clientKeyPassword: 'min4chars', - selfSigned: true - }, function (error, data) { - hlp.checkError(error) - hlp.checkCertificate(data, true) - hlp.checkTmpEmpty() - - pem.createPkcs12(data.clientKey, data.certificate, 'mypassword', { - cipher: 'aes256', - clientKeyPassword: 'min4chars' - }, function (error, pkcs12) { - hlp.checkError(error) - expect(pkcs12).to.be.ok() - hlp.checkTmpEmpty() - done() - }) - }) - }) - }) - }) - - describe('#.createCSR tests', function () { - it('Create default CSR; get its public key; read its data', function (done) { - pem.createCSR(function (error, data1) { - hlp.checkError(error) - hlp.checkCSR(data1) - hlp.checkTmpEmpty() - - pem.getPublicKey(data1.clientKey, function (error, data2) { - hlp.checkError(error) - hlp.checkPublicKey(data2) - hlp.checkTmpEmpty() - - pem.readCertificateInfo(data1.csr, function (error, data3) { - hlp.checkError(error) - hlp.checkCertificateData(data3, { - issuer: {}, - country: '', - state: '', - locality: '', - organization: '', - organizationUnit: '', - commonName: 'localhost', - emailAddress: '', - dc: '', - signatureAlgorithm: 'sha256WithRSAEncryption', - publicKeyAlgorithm: 'rsaEncryption', - publicKeySize: '2048 bit' - }) - hlp.checkTmpEmpty() - done() - }) - }) - }) - }) - - it('Create CSR using config file', function (done) { - pem.createCSR({ - csrConfigFile: './test/fixtures/test.cnf' - }, function (error, data) { - hlp.checkError(error) - hlp.checkCSR(data) - hlp.checkTmpEmpty() - - pem.readCertificateInfo(data.csr, function (error, data) { - hlp.checkError(error) - hlp.checkCertificateData(data, { - issuer: {}, - country: 'EE', - state: 'Harjumaa', - locality: 'Tallinn', - organization: 'Node.ee', - organizationUnit: 'test', - commonName: 'www.node.ee', - emailAddress: 'andris@node.ee', - dc: '', - signatureAlgorithm: 'sha256WithRSAEncryption', - publicKeyAlgorithm: 'rsaEncryption', - publicKeySize: '2048 bit' - }) - hlp.checkTmpEmpty() - done() - }) - }) - }) - - it('Create CSR with multiple organizations using config file', function (done) { - pem.createCSR({ - issuer: {}, - country: 'EE', - state: 'Harjumaa', - locality: 'Tallinn', - organization: ['Node2.ee', 'Node.ee'], - organizationUnit: 'test', - commonName: 'www.node.ee', - emailAddress: 'andris@node.ee', - dc: '', - signatureAlgorithm: 'sha256WithRSAEncryption', - publicKeyAlgorithm: 'rsaEncryption', - publicKeySize: '2048 bit' - }, function (error, data) { - hlp.checkError(error) - hlp.checkCSR(data) - hlp.checkTmpEmpty() - - pem.readCertificateInfo(data.csr, function (error, data) { - hlp.checkError(error) - hlp.checkCertificateData(data, { - issuer: {}, - country: 'EE', - state: 'Harjumaa', - locality: 'Tallinn', - organization: ['Node.ee', 'Node2.ee'], - organizationUnit: 'test', - commonName: 'www.node.ee', - emailAddress: 'andris@node.ee', - dc: '', - signatureAlgorithm: 'sha256WithRSAEncryption', - publicKeyAlgorithm: 'rsaEncryption', - publicKeySize: '2048 bit' - }) - hlp.checkTmpEmpty() - done() - }) - }) - }) - - it('Read edited cert data from CSR', function (done) { - var certInfo = { - issuer: {}, - country: 'EE', - state: 'Harjumaa', - locality: 'Tallinn', - organization: 'Node.ee', - organizationUnit: 'test', - commonName: 'www.node.ee', - emailAddress: 'andris@node.ee', - dc: '', - signatureAlgorithm: 'sha256WithRSAEncryption', - publicKeyAlgorithm: 'rsaEncryption', - publicKeySize: '2048 bit' - } - pem.createCSR(Object.create(certInfo), function (error, data) { - hlp.checkError(error) - hlp.checkCSR(data) - hlp.checkTmpEmpty() - - pem.readCertificateInfo(data.csr, function (error, data) { - hlp.checkError(error) - hlp.checkCertificateData(data, certInfo) - hlp.checkTmpEmpty() - done() - }) - }) - }) - }) - - describe('#.createCertificate tests', function () { - describe('Default certificate', function () { - var cert - it('Create default certificate', function (done) { - pem.createCertificate(function (error, data) { - hlp.checkError(error) - hlp.checkCertificate(data) - hlp.checkTmpEmpty() - cert = data - done() - }) - }) - - it('get its public key', function (done) { - pem.getPublicKey(cert.clientKey, function (error, data) { - hlp.checkError(error) - hlp.checkPublicKey(data) - hlp.checkTmpEmpty() - done() - }) - }) - - it('get its fingerprint', function (done) { - pem.getFingerprint(cert.certificate, function (error, data) { - hlp.checkError(error) - hlp.checkFingerprint(data) - hlp.checkTmpEmpty() - done() - }) - }) - - it('get its modulus [not hashed]', function (done) { - pem.getModulus(cert.certificate, function (error, - data) { - hlp.checkError(error) - hlp.checkModulus(data) - hlp.checkTmpEmpty() - done() - }) - }) - - it('get its modulus [md5 hashed]', function (done) { - pem.getModulus(cert.certificate, null, 'md5', - function (error, data) { - hlp.checkError(error) - hlp.checkModulus(data, 'md5') - hlp.checkTmpEmpty() - done() - }) - }) - - it('read its data', function (done) { - pem.readCertificateInfo(cert.certificate, function ( - error, data) { - hlp.checkError(error); - ['validity', 'serial', 'signatureAlgorithm', - 'publicKeySize', 'publicKeyAlgorithm' - ].forEach(function (k) { - if (data[k]) { delete data[k] } - }) - hlp.checkCertificateData(data, { - issuer: { - country: '', - state: '', - locality: '', - organization: '', - organizationUnit: '', - commonName: 'localhost', - dc: '' - }, - country: '', - state: '', - locality: '', - organization: '', - organizationUnit: '', - commonName: 'localhost', - emailAddress: '', - dc: '' - }) - hlp.checkTmpEmpty() - done() - }) - }) - }) - - describe('CA certificate', function () { - var ca - it('create ca certificate', function (done) { - pem.createCertificate({ - commonName: 'CA Certificate' - }, - function (error, data) { - hlp.checkError(error) - hlp.checkCertificate(data) - hlp.checkTmpEmpty() - ca = data - done() - }) - }) - it('create certificate with text serial "demo-serial"', function (done) { - pem.createCertificate({ - serviceKey: ca.serviceKey, - serviceCertificate: ca.certificate, - serial: 'demo-serial' - }, - function (error, data) { - hlp.checkError(error) - hlp.checkCertificate(data) - hlp.checkTmpEmpty() - pem.readCertificateInfo(data.certificate, function (error, data) { - hlp.checkError(error); - ['validity', 'serial'].forEach(function (k) { - if (data[k]) { - delete data[k] - } - }) - hlp.checkTmpEmpty() - done() - }) - }) - }) - it('create certificate with hex serial "0x1234567890abcdef"', function (done) { - pem.createCertificate({ - serviceKey: ca.serviceKey, - serviceCertificate: ca.certificate, - serial: '0x1234567890abcdef' - }, - function (error, data) { - hlp.checkError(error) - hlp.checkCertificate(data) - hlp.checkTmpEmpty() - pem.readCertificateInfo(data.certificate, function (error, data) { - hlp.checkError(error); - ['validity', 'serial'].forEach(function (k) { - if (data[k]) { - delete data[k] - } - }) - hlp.checkTmpEmpty() - done() - }) - }) - }) - it('create certificate with hex serial "1234567890abcdef"', function (done) { - pem.createCertificate({ - serviceKey: ca.serviceKey, - serviceCertificate: ca.certificate, - serial: '1234567890abcdef' - }, - function (error, data) { - hlp.checkError(error) - hlp.checkCertificate(data) - hlp.checkTmpEmpty() - pem.readCertificateInfo(data.certificate, function (error, data) { - hlp.checkError(error); - ['validity', 'serial'].forEach(function (k) { - if (data[k]) { - delete data[k] - } - }) - hlp.checkTmpEmpty() - done() - }) - }) - }) - it('create certificate with number serial "1234567890"', function (done) { - pem.createCertificate({ - serviceKey: ca.serviceKey, - serviceCertificate: ca.certificate, - serial: 1234567890 - }, - function (error, data) { - hlp.checkError(error) - hlp.checkCertificate(data) - hlp.checkTmpEmpty() - pem.readCertificateInfo(data.certificate, function (error, data) { - hlp.checkError(error); - ['validity', 'serial'].forEach(function (k) { - if (data[k]) { - delete data[k] - } - }) - hlp.checkTmpEmpty() - done() - }) - }) - }) - it('verify signing chain; create and read PKCS12', function (done) { - pem.createCertificate({ - serviceKey: ca.serviceKey, - serviceCertificate: ca.certificate, - serial: Date.now() - }, function (error, data) { - hlp.checkError(error) - hlp.checkCertificate(data) - hlp.checkTmpEmpty() - - pem.verifySigningChain(data.certificate, - ca.certificate, - function (error, valid) { - hlp.checkError(error) - expect(valid).to.be.true() - - pem.createPkcs12(data.clientKey, - data.certificate, '', { - certFiles: [ca.certificate] - }, - function (error, d) { - hlp.checkError(error) - expect(d).to.be.ok() - hlp.checkTmpEmpty() - - pem.readPkcs12(d.pkcs12, - function (error, keystore) { - hlp.checkError(error) - expect(keystore).to.be.an('object') - expect(keystore).to.have.property('ca') - expect(keystore).to.have.property('cert') - expect(keystore).to.have.property('key') - expect(keystore.ca).to.be.an('array') - expect(keystore.cert).to.be.an('string') - expect(keystore.key).to.be.an('string') - expect(keystore.ca[0]).to.equal(ca.certificate) - expect(keystore.cert).to.equal(data.certificate) - expect(keystore.key).to.equal(data.clientKey) - done() - }) - }) - }) - }) - }) - it('Fail to verify invalid sigining chain', function (done) { - pem.createCertificate({ - serviceKey: ca.serviceKey, - serviceCertificate: ca.certificate, - serial: Date.now() - }, function (error, data) { - hlp.checkError(error) - hlp.checkCertificate(data) - hlp.checkTmpEmpty() - - pem.verifySigningChain(data.certificate, - data.certificate, - function (error, valid) { - hlp.checkError(error) - expect(valid).to.be.false() - done() - }) - }) - }) - it('Verify google.com certificate without provided CA certificates', function (done) { - var certificate = fs.readFileSync('./test/fixtures/google.com.pem').toString() - pem.verifySigningChain(certificate, function (error, valid) { - hlp.checkError(error) - expect(valid).to.be.false() - done() - }) - }) - it('Verify deep sigining chain', function (done) { - pem.createCertificate({ - commonName: 'Intermediate CA Certificate', - serviceKey: ca.serviceKey, - serviceCertificate: ca.certificate, - serial: Date.now() - }, function (error, intermediate) { - hlp.checkError(error) - hlp.checkCertificate(intermediate) - hlp.checkTmpEmpty() - - pem.createCertificate({ - serviceKey: intermediate.clientKey, - serviceCertificate: intermediate.certificate, - serial: Date.now() - // days: 1024 - }, function (error, cert) { - hlp.checkError(error) - hlp.checkCertificate(cert) - hlp.checkTmpEmpty() - - // chain check ok - pem.verifySigningChain([intermediate.certificate, cert.certificate], [ - ca.certificate, intermediate.certificate - ], function (error, valid) { - hlp.checkError(error) - expect(valid).to.be.true() - - // chain check fails -> missing ca cert in chain - pem.verifySigningChain(cert.certificate, [ - intermediate.certificate - ], function (error, valid) { - hlp.checkError(error) - expect(valid).to.be.false() - - // chain check fails -> missing intermediate cert in chain - pem.verifySigningChain( - cert.certificate, [ - ca.certificate - ], - function (error, - valid) { - hlp.checkError(error) - expect(valid).to.be.false() - done() - }) - }) - }) - }) - }) - }) - }) - - it('Create self signed certificate', function (done) { - pem.createCertificate({ - selfSigned: true - }, function (error, data) { - hlp.checkError(error) - hlp.checkCertificate(data, true) - hlp.checkTmpEmpty() - done() - }) - }) - it('Create and verify wildcard certificate', function (done) { - var certInfo = { - commonName: '*.node.ee' - } - pem.createCertificate(Object.create(certInfo), function (error, data) { - hlp.checkError(error) - hlp.checkCertificate(data) - hlp.checkTmpEmpty() - - pem.readCertificateInfo(data.certificate, function (error, data) { - hlp.checkError(error) - expect(data).to.be.an('object').that.has.property('commonName') - expect(data.commonName).to.equal(certInfo.commonName) - hlp.checkTmpEmpty() - done() - }) - }) - }) - it('Read edited cert data from certificate', function (done) { - var certInfo = { - issuer: { - country: 'EE', - state: 'Harjumaa', - locality: 'Tallinn', - organization: 'Node.ee', - organizationUnit: 'test', - commonName: 'www.node.ee', - dc: '' - }, - country: 'EE', - state: 'Harjumaa', - locality: 'Tallinn', - organization: 'Node.ee', - organizationUnit: 'test', - commonName: 'www.node.ee', - emailAddress: 'andris@node.ee', - dc: '', - signatureAlgorithm: 'sha256WithRSAEncryption', - publicKeyAlgorithm: 'rsaEncryption', - publicKeySize: '2048 bit' - } - pem.createCertificate(Object.create(certInfo), function (error, data) { - hlp.checkError(error) - hlp.checkCertificate(data) - hlp.checkTmpEmpty() - - pem.readCertificateInfo(data.certificate, function (error, data) { - hlp.checkError(error); - ['validity', 'serial'].forEach(function (k) { - if (data[k]) { delete data[k] } - }) - hlp.checkCertificateData(data, certInfo) - hlp.checkTmpEmpty() - done() - }) - }) - }) - - it('Read CertInformation form ./test/fixtures/pem196.pem', function (done) { - var certInfo = { - issuer: { - country: 'BO', - state: '', - locality: '', - organization: 'ADSIB', - organizationUnit: '', - commonName: 'Entidad Certificadora Publica ADSIB', - dc: '' - }, - serial: '2854046357827755658 (0x279b9c0a82d21e8a)', - '1.3.6.1.1.1.1.0': '#0C0734373132323836', - dnQualifier: 'CI', - country: 'BO', - state: '', - locality: '', - organization: '', - organizationUnit: '', - commonName: 'ILSE SILES BECERRA', - emailAddress: '', - dc: '', - validity: { - start: 1524175291000, - end: 1524434491000 - }, - signatureAlgorithm: 'sha256WithRSAEncryption', - publicKeySize: '2048 bit', - publicKeyAlgorithm: 'rsaEncryption' - } - - var d = fs.readFileSync('./test/fixtures/pem196.pem').toString() - pem.readCertificateInfo(d, function (error, data) { - if (data.serial) delete data.serial - if (certInfo.serial) delete certInfo.serial - hlp.checkError(error) - hlp.checkCertificateData(data, certInfo) - hlp.checkTmpEmpty() - done() - }) - }) - - it('Read CertInformation from ./test/fixtures/ru_openssl.crt', function (done) { - var certInfo = { - issuer: { - country: 'RU', - state: '', - locality: 'Москва', - organization: 'Моя компания', - organizationUnit: 'Моё подразделение', - commonName: 'Описание сайта', - dc: '' - }, - country: 'RU', - state: '', - locality: 'Москва', - organization: 'Моя компания', - organizationUnit: 'Моё подразделение', - commonName: 'Описание сайта', - emailAddress: 'envek@envek.name', - dc: '', - validity: { - end: 1568233615000, - start: 1536697615000 - }, - san: { - dns: [ - 'example.com', - '*.app.example.com', - 'www.example.com' - ], - email: [], - ip: [] - }, - signatureAlgorithm: 'sha256WithRSAEncryption', - publicKeySize: '4096 bit', - publicKeyAlgorithm: 'rsaEncryption' - } - - var d = fs.readFileSync('./test/fixtures/ru_openssl.crt').toString() - pem.readCertificateInfo(d, function (error, data) { - if (data.serial) delete data.serial - if (certInfo.serial) delete certInfo.serial - hlp.checkError(error) - hlp.checkCertificateData(data, certInfo) - hlp.checkTmpEmpty() - done() - }) - }) - - it('Read CertInformation from ./test/fixtures/cn_openssl.crt', function (done) { - var certInfo = { - issuer: { - country: 'RU', - state: '', - locality: '兰克福', - organization: '法兰克福分行', - organizationUnit: '克福分', - commonName: '中国银行', - dc: '' - }, - serial: '2854046357827755658 (0x279b9c0a82d21e8a)', - country: 'RU', - state: '', - locality: '兰克福', - organization: '法兰克福分行', - organizationUnit: '克福分', - commonName: '中国银行', - emailAddress: 'envek@envek.name', - dc: '', - validity: { - end: 1568233543000, - start: 1536697543000 - }, - san: { - dns: [ - 'example.com', - '*.app.example.com', - 'www.example.com' - ], - email: [], - ip: [] - }, - signatureAlgorithm: 'sha256WithRSAEncryption', - publicKeySize: '4096 bit', - publicKeyAlgorithm: 'rsaEncryption' - } - - var d = fs.readFileSync('./test/fixtures/cn_openssl.crt').toString() - pem.readCertificateInfo(d, function (error, data) { - if (data.serial) delete data.serial - if (certInfo.serial) delete certInfo.serial - hlp.checkError(error) - hlp.checkCertificateData(data, certInfo) - hlp.checkTmpEmpty() - done() - }) - }) - }) - - describe('#.checkCertificate tests', function () { - it('Check certificate file @ ./test/fixtures/test.key', function (done) { - var d = fs.readFileSync('./test/fixtures/test.key').toString() - pem.checkCertificate(d, 'password', function (error, result) { - hlp.checkError(error) - expect(result).to.be.ok() - done() - }) - }) - it('Check certificate file @ ./test/fixtures/test.crt', function (done) { - var d = fs.readFileSync('./test/fixtures/test.crt').toString() - pem.checkCertificate(d, function (error, result) { - hlp.checkError(error) - expect(result).to.be.ok() - done() - }) - }) - it('Check certificate file @ ./test/fixtures/test.csr', function (done) { - var d = fs.readFileSync('./test/fixtures/test.csr').toString() - pem.checkCertificate(d, function (error, result) { - hlp.checkError(error) - expect(result).to.be.ok() - done() - }) - }) - }) - - describe('#.getModulus tests', function () { - it('Check matching modulus of key and cert file', function (done) { - var f = fs.readFileSync('./test/fixtures/test.crt').toString() - pem.getModulus(f, function (error, data1) { - hlp.checkError(error) - hlp.checkModulus(data1) - hlp.checkTmpEmpty() - - f = fs.readFileSync('./test/fixtures/test.key').toString() - pem.getModulus(f, 'password', function (error, data2) { - hlp.checkError(error) - hlp.checkModulus(data2) - expect(data1.modulus).to.equal(data2.modulus) - hlp.checkTmpEmpty() - done() - }) - }) - }) - }) - - describe('#.getDhparamInfo tests', function () { - it('Get DH param info', function (done) { - var dh = fs.readFileSync('./test/fixtures/test.dh').toString() - pem.getDhparamInfo(dh, function (error, data) { - hlp.checkError(error) - var size = (data && data.size) || 0 - var prime = ((data && data.prime) || '').toString() - expect(size).to.be.a('number') - expect(size).to.equal(1024) - expect(prime).to.be.a('string') - expect(/([0-9a-f][0-9a-f]:)+[0-9a-f][0-9a-f]$/g.test(prime)).to.be.true() - hlp.checkTmpEmpty() - done() - }) - }) - }) - - describe('#.readPkcs12 tests', function () { - it('Respond with ENOENT for missing PKCS12 file', function ( - done) { - pem.readPkcs12('/i/do/not/exist.p12', function (error) { - hlp.checkError(error, { - code: 'ENOENT' - }) - done() - }) - }) - }) - - describe('#.checkPkcs12 tests', function () { - it('Check PKCS12 keystore', function (done) { - var pkcs12 = fs.readFileSync('./test/fixtures/idsrv3test.pfx') - pem.checkPkcs12(pkcs12, 'idsrv3test', function (error, result) { - hlp.checkError(error) - expect(result).to.be.ok() - done() - }) - }) - }) -}) diff --git a/node_modules/plur/index.js b/node_modules/plur/index.js deleted file mode 100644 index 0a16a559c..000000000 --- a/node_modules/plur/index.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; -module.exports = function (str, plural, count) { - if (typeof plural === 'number') { - count = plural; - plural = str + 's'; - } - - return count === 1 ? str : plural; -}; diff --git a/node_modules/plur/license b/node_modules/plur/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/plur/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/plur/package.json b/node_modules/plur/package.json deleted file mode 100644 index c1f7dc100..000000000 --- a/node_modules/plur/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_from": "plur@^1.0.0", - "_id": "plur@1.0.0", - "_inBundle": false, - "_integrity": "sha1-24XGgU9eXlo7Se/CjWBP7GKXUVY=", - "_location": "/plur", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "plur@^1.0.0", - "name": "plur", - "escapedName": "plur", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/pretty-ms" - ], - "_resolved": "https://registry.npmjs.org/plur/-/plur-1.0.0.tgz", - "_shasum": "db85c6814f5e5e5a3b49efc28d604fec62975156", - "_spec": "plur@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/pretty-ms", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/plur/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Naively pluralize a word", - "devDependencies": { - "ava": "0.0.4" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/plur#readme", - "keywords": [ - "plur", - "plural", - "plurals", - "pluralize", - "singular", - "count", - "word", - "string", - "str", - "naive", - "simple" - ], - "license": "MIT", - "name": "plur", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/plur.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.0.0" -} diff --git a/node_modules/plur/readme.md b/node_modules/plur/readme.md deleted file mode 100644 index ebc7d43f0..000000000 --- a/node_modules/plur/readme.md +++ /dev/null @@ -1,52 +0,0 @@ -# plur [![Build Status](https://travis-ci.org/sindresorhus/plur.svg?branch=master)](https://travis-ci.org/sindresorhus/plur) - -> Naively pluralize a word - - -## Install - -``` -$ npm install --save plur -``` - - -## Usage - -```js -var plur = require('plur'); - -plur('unicorn', 4); -//=> 'unicorns' - -plur('hero', 'heroes', 4); -//=> 'heroes' -``` - - -## API - -### plur(word, [plural], count) - -#### word - -Type: `string` - -Word to pluralize. - -#### plural - -Type: `string` -Default: `word` + `s` - -Pluralized word. - -#### count - -Type: `number` - -Count to determine whether to use singular or plural. - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/posix-character-classes/LICENSE b/node_modules/posix-character-classes/LICENSE deleted file mode 100644 index b11cb7968..000000000 --- a/node_modules/posix-character-classes/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016-2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/posix-character-classes/README.md b/node_modules/posix-character-classes/README.md deleted file mode 100644 index 894ae237a..000000000 --- a/node_modules/posix-character-classes/README.md +++ /dev/null @@ -1,103 +0,0 @@ -# posix-character-classes [![NPM version](https://img.shields.io/npm/v/posix-character-classes.svg?style=flat)](https://www.npmjs.com/package/posix-character-classes) [![NPM monthly downloads](https://img.shields.io/npm/dm/posix-character-classes.svg?style=flat)](https://npmjs.org/package/posix-character-classes) [![NPM total downloads](https://img.shields.io/npm/dt/posix-character-classes.svg?style=flat)](https://npmjs.org/package/posix-character-classes) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/posix-character-classes.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/posix-character-classes) - -> POSIX character classes for creating regular expressions. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save posix-character-classes -``` - -Install with [yarn](https://yarnpkg.com): - -```sh -$ yarn add posix-character-classes -``` - -## Usage - -```js -var posix = require('posix-character-classes'); -console.log(posix.alpha); -//=> 'A-Za-z' -``` - -## POSIX Character classes - -The POSIX standard supports the following classes or categories of charactersh (note that classes must be defined within brackets)[1]: - -| **POSIX class** | **Equivalent to** | **Matches** | -| --- | --- | --- | -| `[:alnum:]` | `[A-Za-z0-9]` | digits, uppercase and lowercase letters | -| `[:alpha:]` | `[A-Za-z]` | upper- and lowercase letters | -| `[:ascii:]` | `[\x00-\x7F]` | ASCII characters | -| `[:blank:]` | `[ \t]` | space and TAB characters only | -| `[:cntrl:]` | `[\x00-\x1F\x7F]` | Control characters | -| `[:digit:]` | `[0-9]` | digits | -| `[:graph:]` | `[^[:cntrl:]]` | graphic characters (all characters which have graphic representation) | -| `[:lower:]` | `[a-z]` | lowercase letters | -| `[:print:]` | `[[:graph] ]` | graphic characters and space | -| `[:punct:]` | ``[-!"#$%&'()*+,./:;<=>?@[]^_`{ | }~]`` | all punctuation characters (all graphic characters except letters and digits) | -| `[:space:]` | `[ \t\n\r\f\v]` | all blank (whitespace) characters, including spaces, tabs, new lines, carriage returns, form feeds, and vertical tabs | -| `[:upper:]` | `[A-Z]` | uppercase letters | -| `[:word:]` | `[A-Za-z0-9_]` | word characters | -| `[:xdigit:]` | `[0-9A-Fa-f]` | hexadecimal digits | - -## Examples - -* `a[[:digit:]]b` matches `a0b`, `a1b`, ..., `a9b`. -* `a[:digit:]b` is invalid, character classes must be enclosed in brackets -* `[[:digit:]abc]` matches any digit, as well as `a`, `b`, and `c`. -* `[abc[:digit:]]` is the same as the previous, matching any digit, as well as `a`, `b`, and `c` -* `[^ABZ[:lower:]]` matches any character except lowercase letters, `A`, `B`, and `Z`. - -## About - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 20, 2017._ - -
    -
    -
      -
    1. table and examples are based on the WikiBooks page for [Regular Expressions/POSIX Basic Regular Expressions](https://en.wikibooks.org/wiki/Regular_Expressions/POSIX_Basic_Regular_Expressions), which is available under the [Creative Commons Attribution-ShareAlike License](https://creativecommons.org/licenses/by-sa/3.0/). - -
    2. -
    -
    \ No newline at end of file diff --git a/node_modules/posix-character-classes/index.js b/node_modules/posix-character-classes/index.js deleted file mode 100644 index 19f1c9866..000000000 --- a/node_modules/posix-character-classes/index.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -/** - * POSIX character classes - */ - -module.exports = { - alnum: 'a-zA-Z0-9', - alpha: 'a-zA-Z', - ascii: '\\x00-\\x7F', - blank: ' \\t', - cntrl: '\\x00-\\x1F\\x7F', - digit: '0-9', - graph: '\\x21-\\x7E', - lower: 'a-z', - print: '\\x20-\\x7E ', - punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', - space: ' \\t\\r\\n\\v\\f', - upper: 'A-Z', - word: 'A-Za-z0-9_', - xdigit: 'A-Fa-f0-9' -}; diff --git a/node_modules/posix-character-classes/package.json b/node_modules/posix-character-classes/package.json deleted file mode 100644 index 0445adc76..000000000 --- a/node_modules/posix-character-classes/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "_from": "posix-character-classes@^0.1.0", - "_id": "posix-character-classes@0.1.1", - "_inBundle": false, - "_integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "_location": "/posix-character-classes", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "posix-character-classes@^0.1.0", - "name": "posix-character-classes", - "escapedName": "posix-character-classes", - "rawSpec": "^0.1.0", - "saveSpec": null, - "fetchSpec": "^0.1.0" - }, - "_requiredBy": [ - "/readdirp/expand-brackets" - ], - "_resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "_shasum": "01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab", - "_spec": "posix-character-classes@^0.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/expand-brackets", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/posix-character-classes/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "POSIX character classes for creating regular expressions.", - "devDependencies": { - "gulp-format-md": "^0.1.12", - "mocha": "^3.2.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/posix-character-classes", - "keywords": [ - "character", - "classes", - "posix" - ], - "license": "MIT", - "main": "index.js", - "name": "posix-character-classes", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/posix-character-classes.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "reflinks": [ - "verb", - "verb-generate-readme" - ], - "lint": { - "reflinks": true - }, - "related-list": [ - "micromatch", - "nanomatch", - "extglob", - "expand-brackets" - ] - }, - "version": "0.1.1" -} diff --git a/node_modules/preserve/.gitattributes b/node_modules/preserve/.gitattributes deleted file mode 100644 index 759c2c5af..000000000 --- a/node_modules/preserve/.gitattributes +++ /dev/null @@ -1,14 +0,0 @@ -# Enforce Unix newlines -*.* text eol=lf -*.css text eol=lf -*.html text eol=lf -*.js text eol=lf -*.json text eol=lf -*.less text eol=lf -*.md text eol=lf -*.yml text eol=lf - -*.jpg binary -*.gif binary -*.png binary -*.jpeg binary \ No newline at end of file diff --git a/node_modules/preserve/.jshintrc b/node_modules/preserve/.jshintrc deleted file mode 100644 index e72045d2b..000000000 --- a/node_modules/preserve/.jshintrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "asi": false, - "boss": true, - "curly": true, - "eqeqeq": true, - "eqnull": true, - "esnext": true, - "immed": true, - "latedef": true, - "laxcomma": false, - "newcap": true, - "noarg": true, - "node": true, - "sub": true, - "undef": true, - "unused": true, - "globals": { - "define": true, - "before": true, - "after": true, - "describe": true, - "it": true - } -} \ No newline at end of file diff --git a/node_modules/preserve/.npmignore b/node_modules/preserve/.npmignore deleted file mode 100644 index 1a2e47f0d..000000000 --- a/node_modules/preserve/.npmignore +++ /dev/null @@ -1,53 +0,0 @@ -# Numerous always-ignore extensions -*.csv -*.dat -*.diff -*.err -*.gz -*.log -*.orig -*.out -*.pid -*.rar -*.rej -*.seed -*.swo -*.swp -*.vi -*.yo-rc.json -*.zip -*~ -.ruby-version -lib-cov -npm-debug.log - -# Always-ignore dirs -/bower_components/ -/node_modules/ -/temp/ -/tmp/ -/vendor/ -_gh_pages - -# OS or Editor folders -*.esproj -*.komodoproject -.komodotools -*.sublime-* -._* -.cache -.DS_Store -.idea -.project -.settings -.tmproj -nbproject -Thumbs.db - -# grunt-html-validation -validation-status.json -validation-report.json - -# misc -TODO.md -benchmark \ No newline at end of file diff --git a/node_modules/preserve/.travis.yml b/node_modules/preserve/.travis.yml deleted file mode 100644 index ff74a054e..000000000 --- a/node_modules/preserve/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - '0.10' \ No newline at end of file diff --git a/node_modules/preserve/.verb.md b/node_modules/preserve/.verb.md deleted file mode 100644 index 72344a9eb..000000000 --- a/node_modules/preserve/.verb.md +++ /dev/null @@ -1,59 +0,0 @@ -# {%= name %} {%= badge("fury") %} - -> {%= description %} - -Useful for protecting tokens, like templates in HTML, from being mutated when the string is transformed in some way, like from a formatter/beautifier. - -**Example without `preserve`** - -Let's say you want to use [js-beautify] on a string of html with Lo-Dash/Underscore templates, such as: `
    • <%= name %>
    `: - -js-beautify will render the template unusable (and apply incorrect formatting because of the unfamiliar syntax from the Lo-Dash template): - -```html -
      -
    • - <%=n ame %> -
    • -
    -``` - -**Example with `preserve`** - -Correct. - -```html -
      -
    • <%= name %>
    • -
    -``` - -For the record, this is just a random example, I've had very few issues with js-beautify in general. But with or without js-beautify, this kind of token mangling does happen sometimes when you use formatters, beautifiers or similar tools. - -## Install -{%= include("install-npm", {save: true}) %} - -## Run tests - -```bash -npm test -``` - -## API -{%= apidocs("index.js") %} - -## Contributing -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue]({%= bugs.url %}) - -## Author -{%= include("author") %} - -## License -{%= copyright() %} -{%= license() %} - -*** - -{%= include("footer") %} - -[js-beautify]: https://github.com/beautify-web/js-beautify \ No newline at end of file diff --git a/node_modules/preserve/LICENSE b/node_modules/preserve/LICENSE deleted file mode 100644 index 5a9956a75..000000000 --- a/node_modules/preserve/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/preserve/README.md b/node_modules/preserve/README.md deleted file mode 100644 index 75000b933..000000000 --- a/node_modules/preserve/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# preserve [![NPM version](https://badge.fury.io/js/preserve.svg)](http://badge.fury.io/js/preserve) - -> Temporarily substitute tokens in the given `string` with placeholders, then put them back after transforming the string. - -Useful for protecting tokens, like templates in HTML, from being mutated when the string is transformed in some way, like from a formatter/beautifier. - -**Example without `preserve`** - -Let's say you want to use [js-beautify] on a string of html with Lo-Dash/Underscore templates, such as: `
    • <%= name %>
    `: - -js-beautify will render the template unusable (and apply incorrect formatting because of the unfamiliar syntax from the Lo-Dash template): - -```html -
      -
    • - <%=n ame %> -
    • -
    -``` - -**Example with `preserve`** - -Correct. - -```html -
      -
    • <%= name %>
    • -
    -``` - -For the record, this is just a random example, I've had very few issues with js-beautify in general. But with or without js-beautify, this kind of token mangling does happen sometimes when you use formatters, beautifiers or similar tools. - -## Install -## Install with [npm](npmjs.org) - -```bash -npm i preserve --save -``` - -## Run tests - -```bash -npm test -``` - -## API -### [.before](index.js#L23) - -Replace tokens in `str` with a temporary, heuristic placeholder. - -* `str` **{String}** -* `returns` **{String}**: String with placeholders. - -```js -tokens.before('{a\\,b}'); -//=> '{__ID1__}' -``` - -### [.after](index.js#L44) - -Replace placeholders in `str` with original tokens. - -* `str` **{String}**: String with placeholders -* `returns` **{String}** `str`: String with original tokens. - -```js -tokens.after('{__ID1__}'); -//=> '{a\\,b}' -``` - - -## Contributing -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/preserve/issues) - -## Author - -**Jon Schlinkert** - -+ [github/jonschlinkert](https://github.com/jonschlinkert) -+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License -Copyright (c) 2015-2015, Jon Schlinkert. -Released under the MIT license - -*** - -_This file was generated by [verb](https://github.com/assemble/verb) on January 10, 2015._ - -[js-beautify]: https://github.com/beautify-web/js-beautify \ No newline at end of file diff --git a/node_modules/preserve/index.js b/node_modules/preserve/index.js deleted file mode 100644 index a6c5d481d..000000000 --- a/node_modules/preserve/index.js +++ /dev/null @@ -1,54 +0,0 @@ -/*! - * preserve - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT license. - */ - -'use strict'; - -/** - * Replace tokens in `str` with a temporary, heuristic placeholder. - * - * ```js - * tokens.before('{a\\,b}'); - * //=> '{__ID1__}' - * ``` - * - * @param {String} `str` - * @return {String} String with placeholders. - * @api public - */ - -exports.before = function before(str, re) { - return str.replace(re, function (match) { - var id = randomize(); - cache[id] = match; - return '__ID' + id + '__'; - }); -}; - -/** - * Replace placeholders in `str` with original tokens. - * - * ```js - * tokens.after('{__ID1__}'); - * //=> '{a\\,b}' - * ``` - * - * @param {String} `str` String with placeholders - * @return {String} `str` String with original tokens. - * @api public - */ - -exports.after = function after(str) { - return str.replace(/__ID(.{5})__/g, function (_, id) { - return cache[id]; - }); -}; - -function randomize() { - return Math.random().toString().slice(2, 7); -} - -var cache = {}; \ No newline at end of file diff --git a/node_modules/preserve/package.json b/node_modules/preserve/package.json deleted file mode 100644 index fce64cb07..000000000 --- a/node_modules/preserve/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "_from": "preserve@^0.2.0", - "_id": "preserve@0.2.0", - "_inBundle": false, - "_integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "_location": "/preserve", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "preserve@^0.2.0", - "name": "preserve", - "escapedName": "preserve", - "rawSpec": "^0.2.0", - "saveSpec": null, - "fetchSpec": "^0.2.0" - }, - "_requiredBy": [ - "/braces" - ], - "_resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "_shasum": "815ed1f6ebc65926f865b310c0713bcb3315ce4b", - "_spec": "preserve@^0.2.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/braces", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/preserve/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Temporarily substitute tokens in the given `string` with placeholders, then put them back after transforming the string.", - "devDependencies": { - "benchmarked": "^0.1.3", - "chalk": "^0.5.1", - "js-beautify": "^1.5.4", - "mocha": "*", - "should": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "homepage": "https://github.com/jonschlinkert/preserve", - "keywords": [ - "escape", - "format", - "placeholder", - "placeholders", - "prettify", - "regex", - "replace", - "template", - "templates", - "token", - "tokens" - ], - "license": { - "type": "MIT", - "url": "https://github.com/jonschlinkert/preserve/blob/master/LICENSE-MIT" - }, - "main": "index.js", - "name": "preserve", - "repository": { - "type": "git", - "url": "git://github.com/jonschlinkert/preserve.git" - }, - "scripts": { - "test": "mocha -R spec" - }, - "version": "0.2.0" -} diff --git a/node_modules/preserve/test.js b/node_modules/preserve/test.js deleted file mode 100644 index 9bf174f12..000000000 --- a/node_modules/preserve/test.js +++ /dev/null @@ -1,48 +0,0 @@ -/*! - * preserve - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License - */ - -'use strict'; - -var should = require('should'); -var tokens = require('./'); - -var re = /<%=\s*[^>]+%>/g; -var pretty = function(str) { - return require('js-beautify').html(str, { - indent_char: ' ', - indent_size: 2, - }); -}; - -describe('preserve tokens', function () { - var testRe = /__ID.{5}__\n__ID.{5}__\n__ID.{5}__/; - var re = /<%=\s*[^>]+%>/g; - - it('should (e.g. shouldn\'t, but will) mangle tokens in the given string', function () { - var html = pretty('
    • <%= name %>
    '); - html.should.equal('
      \n
    • \n <%=n ame %>\n
    • \n
    '); - }); - - it('should preserve tokens in the given string', function () { - var html = tokens.after(pretty(tokens.before('
    • <%= name %>
    ', re))); - html.should.equal('
      \n
    • <%= name %>
    • \n
    '); - }); - - describe('.before()', function () { - it('should replace matches with placeholder tokens:', function () { - tokens.before('<%= a %>\n<%= b %>\n<%= c %>', re).should.match(testRe); - }); - }); - - describe('tokens.after()', function () { - it('should replace placeholder tokens with original values:', function () { - var before = tokens.before('<%= a %>\n<%= b %>\n<%= c %>', re); - before.should.match(testRe); - tokens.after(before).should.equal('<%= a %>\n<%= b %>\n<%= c %>'); - }); - }); -}); diff --git a/node_modules/prettier-bytes/.npmignore b/node_modules/prettier-bytes/.npmignore deleted file mode 100644 index 123ae94d0..000000000 --- a/node_modules/prettier-bytes/.npmignore +++ /dev/null @@ -1,27 +0,0 @@ -# Logs -logs -*.log - -# Runtime data -pids -*.pid -*.seed - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directory -# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git -node_modules diff --git a/node_modules/prettier-bytes/.travis.yml b/node_modules/prettier-bytes/.travis.yml deleted file mode 100644 index 5ce0575b2..000000000 --- a/node_modules/prettier-bytes/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: node_js -node_js: - - 'stable' - - '0.12' - - '0.10' -sudo: false -cache: - directories: - - node_modules diff --git a/node_modules/prettier-bytes/CHANGELOG.md b/node_modules/prettier-bytes/CHANGELOG.md deleted file mode 100644 index a50094f03..000000000 --- a/node_modules/prettier-bytes/CHANGELOG.md +++ /dev/null @@ -1,7 +0,0 @@ -# prettier-bytes change log - -All notable changes to this project will be documented in this file. -This project adheres to [Semantic Versioning](http://semver.org/). - -## Unreleased -* engage diff --git a/node_modules/prettier-bytes/CONTRIBUTING.md b/node_modules/prettier-bytes/CONTRIBUTING.md deleted file mode 100644 index 9a7d3616a..000000000 --- a/node_modules/prettier-bytes/CONTRIBUTING.md +++ /dev/null @@ -1,61 +0,0 @@ -# Contributing Guidelines - -Contributions welcome! - -**Before spending lots of time on something, ask for feedback on your idea first!** - -Please search issues and pull requests before adding something new to avoid duplicating efforts and conversations. - -In addition to improving the project by refactoring code and implementing relevant features, this project welcomes the following types of contributions: - -- **Ideas**: participate in an issue thread or start your own to have your voice heard. -- **Writing**: contribute your expertise in an area by helping expand the included content. -- **Copy editing**: fix typos, clarify language, and generally improve the quality of the content. -- **Formatting**: help keep content easy to read with consistent formatting. - -## Installing - -Fork and clone the repo, then `npm install` to install all dependencies. - -## Testing - -Tests are run with `npm test`. Unless you're creating a failing test to increase test coverage or show a problem, please make sure all tests are passing before submitting a pull request. - -## Code Style - -[![standard][standard-image]][standard-url] - -This repository uses [`standard`][standard-url] to maintain code style and consistency and avoid style arguments. `npm test` runs `standard` so you don't have to! - -[standard-image]: https://cdn.rawgit.com/feross/standard/master/badge.svg -[standard-url]: https://github.com/feross/standard -[semistandard-image]: https://cdn.rawgit.com/flet/semistandard/master/badge.svg -[semistandard-url]: https://github.com/Flet/semistandard - ---- - -# Collaborating Guidelines - -**This is an OPEN Open Source Project.** - -## What? - -Individuals making significant and valuable contributions are given commit access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project. - -## Rules - -There are a few basic ground rules for collaborators: - -1. **No `--force` pushes** or modifying the Git history in any way. -1. **Non-master branches** ought to be used for ongoing work. -1. **External API changes and significant modifications** ought to be subject to an **internal pull request** to solicit feedback from other collaborators. -1. Internal pull requests to solicit feedback are *encouraged* for any other non-trivial contribution but left to the discretion of the contributor. -1. Contributors should attempt to adhere to the prevailing code style. - -## Releases - -Declaring formal releases remains the prerogative of the project maintainer. - -## Changes to this arrangement - -This is an experiment and feedback is welcome! This document may also be subject to pull requests or changes by collaborators where you believe you have something valuable to add or change. diff --git a/node_modules/prettier-bytes/LICENSE b/node_modules/prettier-bytes/LICENSE deleted file mode 100644 index 91e21962b..000000000 --- a/node_modules/prettier-bytes/LICENSE +++ /dev/null @@ -1,5 +0,0 @@ -Copyright (c) 2016, Dan Flettre - -Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/prettier-bytes/README.md b/node_modules/prettier-bytes/README.md deleted file mode 100644 index a4c850a14..000000000 --- a/node_modules/prettier-bytes/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# prettier-bytes - -[![npm][npm-image]][npm-url] -[![travis][travis-image]][travis-url] -[![standard][standard-image]][standard-url] - -[npm-image]: https://img.shields.io/npm/v/prettier-bytes.svg?style=flat-square -[npm-url]: https://www.npmjs.com/package/prettier-bytes -[travis-image]: https://img.shields.io/travis/Flet/prettier-bytes.svg?style=flat-square -[travis-url]: https://travis-ci.org/Flet/prettier-bytes -[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square -[standard-url]: http://npm.im/standard - -Augment pretty-bytes to make the output a little more readable (and a little less precise) - -Differences from `pretty-bytes`: - - The fractional portion is rounded to one digit (ex: `2.1 MB`). - - If there is more than one digit to the left of the decimal, the fractional portion is rounded off (ex: `11 KB`). - - Changed `kB` to `KB`, for more prettiness. Regular users are not likely to care about the technical difference. - - No dependencies. - -## Install - -``` -npm install prettier-bytes -``` - -## Usage - -```js -var prettierBytes = require('prettier-bytes') - -var pretty = prettierBytes(1337) -console.log(pretty) -// logs 1.3 KB -``` - -Examples from test output: -```bash - ✔ bytes: 2 -> 2 B - ✔ bytes: 9 -> 9 B - ✔ bytes: 25 -> 25 B - ✔ bytes: 235 -> 235 B - ✔ bytes: 2335 -> 2.3 KB - ✔ bytes: 23552 -> 24 KB - ✔ bytes: 235520 -> 236 KB - ✔ bytes: 2355520 -> 2.4 MB - ✔ bytes: 23555520 -> 24 MB - ✔ bytes: 235555520 -> 236 MB - ✔ bytes: 2355555520 -> 2.4 GB - ✔ bytes: 23555555520 -> 24 GB - ✔ bytes: 235556555520 -> 236 GB - ✔ bytes: 2355556655520 -> 2.4 TB - ✔ bytes: 23555566655520 -> 24 TB - ✔ bytes: 235555566665520 -> 236 TB -``` - -## Contributing - -Contributions welcome! Please read the [contributing guidelines](CONTRIBUTING.md) first. - -## License - -[ISC](LICENSE) diff --git a/node_modules/prettier-bytes/index.js b/node_modules/prettier-bytes/index.js deleted file mode 100644 index fbbe78053..000000000 --- a/node_modules/prettier-bytes/index.js +++ /dev/null @@ -1,30 +0,0 @@ -module.exports = prettierBytes - -function prettierBytes (num) { - if (typeof num !== 'number' || isNaN(num)) { - throw new TypeError('Expected a number, got ' + typeof num) - } - - var neg = num < 0 - var units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'] - - if (neg) { - num = -num - } - - if (num < 1) { - return (neg ? '-' : '') + num + ' B' - } - - var exponent = Math.min(Math.floor(Math.log(num) / Math.log(1000)), units.length - 1) - num = Number(num / Math.pow(1000, exponent)) - var unit = units[exponent] - - if (num >= 10 || num % 1 === 0) { - // Do not show decimals when the number is two-digit, or if the number has no - // decimal component. - return (neg ? '-' : '') + num.toFixed(0) + ' ' + unit - } else { - return (neg ? '-' : '') + num.toFixed(1) + ' ' + unit - } -} diff --git a/node_modules/prettier-bytes/package.json b/node_modules/prettier-bytes/package.json deleted file mode 100644 index 8cfdde7a9..000000000 --- a/node_modules/prettier-bytes/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_from": "prettier-bytes@^1.0.3", - "_id": "prettier-bytes@1.0.4", - "_inBundle": false, - "_integrity": "sha1-mUsCqkb2mcULYle1+qp/4lV+YtY=", - "_location": "/prettier-bytes", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "prettier-bytes@^1.0.3", - "name": "prettier-bytes", - "escapedName": "prettier-bytes", - "rawSpec": "^1.0.3", - "saveSpec": null, - "fetchSpec": "^1.0.3" - }, - "_requiredBy": [ - "/garnish" - ], - "_resolved": "https://registry.npmjs.org/prettier-bytes/-/prettier-bytes-1.0.4.tgz", - "_shasum": "994b02aa46f699c50b6257b5faaa7fe2557e62d6", - "_spec": "prettier-bytes@^1.0.3", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/garnish", - "author": { - "name": "Dan Flettre", - "email": "flettre@gmail.com" - }, - "bugs": { - "url": "https://github.com/Flet/prettier-bytes/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "augment pretty-bytes to make the output a little more readable (and a little less precise)", - "devDependencies": { - "standard": "*", - "tap-spec": "^4.0.2", - "tape": "^4.0.0" - }, - "homepage": "https://github.com/Flet/prettier-bytes", - "keywords": [ - "bytes", - "output", - "pretty", - "pretty-bytes" - ], - "license": "ISC", - "main": "index.js", - "name": "prettier-bytes", - "repository": { - "type": "git", - "url": "git+https://github.com/Flet/prettier-bytes.git" - }, - "scripts": { - "test": "tape test/*.js | tap-spec && standard" - }, - "version": "1.0.4" -} diff --git a/node_modules/prettier-bytes/test/index.js b/node_modules/prettier-bytes/test/index.js deleted file mode 100644 index 10597194b..000000000 --- a/node_modules/prettier-bytes/test/index.js +++ /dev/null @@ -1,44 +0,0 @@ -var test = require('tape') - -var prettierBytes = require('../') - -var testData = [ - [2, '2 B'], - [9, '9 B'], - [25, '25 B'], - [235, '235 B'], - [2335, '2.3 KB'], - [23552, '24 KB'], - [235520, '236 KB'], - [2355520, '2.4 MB'], - [23555520, '24 MB'], - [235555520, '236 MB'], - [2355555520, '2.4 GB'], - [23555555520, '24 GB'], - [235556555520, '236 GB'], - [2355556655520, '2.4 TB'], - [23555566655520, '24 TB'], - [235555566665520, '236 TB'] -] - -test('pretty bytes', function (t) { - testData.forEach(function (data) { - t.equals(prettierBytes(data[0]), data[1], 'bytes: ' + data[0] + ' -> ' + data[1]) - }) - - t.end() -}) - -test('throws on non-number', function (t) { - t.throws(function () { - prettierBytes('this is a string') - }) - t.end() -}) - -test('throws on NaN', function (t) { - t.throws(function () { - prettierBytes(NaN) - }) - t.end() -}) diff --git a/node_modules/pretty-ms/index.js b/node_modules/pretty-ms/index.js deleted file mode 100644 index 74aadf440..000000000 --- a/node_modules/pretty-ms/index.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; -var parseMs = require('parse-ms'); -var plur = require('plur'); -var isFinitePonyfill = require('is-finite'); - -module.exports = function (ms, opts) { - if (!isFinitePonyfill(ms)) { - throw new TypeError('Expected a finite number'); - } - - opts = opts || {}; - - if (ms < 1000) { - var msDecimalDigits = typeof opts.msDecimalDigits === 'number' ? opts.msDecimalDigits : 0; - return (msDecimalDigits ? ms.toFixed(msDecimalDigits) : Math.ceil(ms)) + (opts.verbose ? ' ' + plur('millisecond', Math.ceil(ms)) : 'ms'); - } - - var ret = []; - - var add = function (val, long, short, valStr) { - if (val === 0) { - return; - } - - var postfix = opts.verbose ? ' ' + plur(long, val) : short; - - ret.push((valStr || val) + postfix); - }; - - var parsed = parseMs(ms); - - add(parsed.days, 'day', 'd'); - add(parsed.hours, 'hour', 'h'); - add(parsed.minutes, 'minute', 'm'); - - if (opts.compact) { - add(parsed.seconds, 'second', 's'); - return '~' + ret[0]; - } - - var sec = ms / 1000 % 60; - var secDecimalDigits = typeof opts.secDecimalDigits === 'number' ? opts.secDecimalDigits : 1; - var secStr = sec.toFixed(secDecimalDigits).replace(/\.0$/, ''); - add(sec, 'second', 's', secStr); - - return ret.join(' '); -}; diff --git a/node_modules/pretty-ms/license b/node_modules/pretty-ms/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/pretty-ms/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/pretty-ms/package.json b/node_modules/pretty-ms/package.json deleted file mode 100644 index da4e56820..000000000 --- a/node_modules/pretty-ms/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "_from": "pretty-ms@^2.1.0", - "_id": "pretty-ms@2.1.0", - "_inBundle": false, - "_integrity": "sha1-QlfCVt8/sLRR1q/6qwIYhBJpgdw=", - "_location": "/pretty-ms", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "pretty-ms@^2.1.0", - "name": "pretty-ms", - "escapedName": "pretty-ms", - "rawSpec": "^2.1.0", - "saveSpec": null, - "fetchSpec": "^2.1.0" - }, - "_requiredBy": [ - "/garnish" - ], - "_resolved": "http://registry.npmjs.org/pretty-ms/-/pretty-ms-2.1.0.tgz", - "_shasum": "4257c256df3fb0b451d6affaab021884126981dc", - "_spec": "pretty-ms@^2.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/garnish", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/pretty-ms/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-finite": "^1.0.1", - "parse-ms": "^1.0.0", - "plur": "^1.0.0" - }, - "deprecated": false, - "description": "Convert milliseconds to a human readable string: 1337000000 → 15d 11h 23m 20s", - "devDependencies": { - "mocha": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/pretty-ms#readme", - "keywords": [ - "pretty", - "prettify", - "human", - "humanize", - "humanized", - "readable", - "time", - "ms", - "milliseconds", - "duration", - "period", - "range", - "text", - "string", - "str", - "number", - "hrtime" - ], - "license": "MIT", - "name": "pretty-ms", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/pretty-ms.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "2.1.0" -} diff --git a/node_modules/pretty-ms/readme.md b/node_modules/pretty-ms/readme.md deleted file mode 100644 index 2a1bf780f..000000000 --- a/node_modules/pretty-ms/readme.md +++ /dev/null @@ -1,89 +0,0 @@ -# pretty-ms [![Build Status](https://travis-ci.org/sindresorhus/pretty-ms.svg?branch=master)](https://travis-ci.org/sindresorhus/pretty-ms) - -> Convert milliseconds to a human readable string: `1337000000` → `15d 11h 23m 20s` - - -## Usage - -``` -$ npm install --save pretty-ms -``` - -```js -var prettyMs = require('pretty-ms'); - -prettyMs(1337000000); -//=> '15d 11h 23m 20s' - -prettyMs(1337); -//=> '1.3s' - -prettyMs(133); -//=> '133ms' - -// compact option -prettyMs(1337, {compact: true}); -//=> '~1s' - -// verbose option -prettyMs(1335669000, {verbose: true}); -//=> '15 days 11 hours 1 minute 9 seconds' - -// can be useful for time durations -prettyMs(new Date(2014, 0, 1, 10, 40) - new Date(2014, 0, 1, 10, 5)) -//=> '35m' -``` - - -## API - -### prettyMs(milliseconds, [options]) - -#### milliseconds - -*Required* -Type: `number` - -Milliseconds to humanize. - -#### options - -##### secDecimalDigits - -Type: `number` -Default: `1` - -Number of digits to appear after the seconds decimal point. - -##### msDecimalDigits - -Type: `number` -Default: `0` - -Number of digits to appear after the milliseconds decimal point. - -Useful in combination with [`process.hrtime()`](https://nodejs.org/api/process.html#process_process_hrtime). - -##### compact - -Type: `boolean` -Default: `false` - -Only show the first unit: `1h 10m` → `~1h`. - -##### verbose - -Type: `boolean` -Default: `false` - -Use full-length units: `5h 1m 45s` → `5 hours 1 minute 45 seconds` - - -## Related - -- [pretty-ms-cli](https://github.com/sindresorhus/pretty-ms-cli) - CLI for this module - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/process-nextick-args/index.js b/node_modules/process-nextick-args/index.js deleted file mode 100644 index 5f585e8e7..000000000 --- a/node_modules/process-nextick-args/index.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -if (!process.version || - process.version.indexOf('v0.') === 0 || - process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { - module.exports = { nextTick: nextTick }; -} else { - module.exports = process -} - -function nextTick(fn, arg1, arg2, arg3) { - if (typeof fn !== 'function') { - throw new TypeError('"callback" argument must be a function'); - } - var len = arguments.length; - var args, i; - switch (len) { - case 0: - case 1: - return process.nextTick(fn); - case 2: - return process.nextTick(function afterTickOne() { - fn.call(null, arg1); - }); - case 3: - return process.nextTick(function afterTickTwo() { - fn.call(null, arg1, arg2); - }); - case 4: - return process.nextTick(function afterTickThree() { - fn.call(null, arg1, arg2, arg3); - }); - default: - args = new Array(len - 1); - i = 0; - while (i < args.length) { - args[i++] = arguments[i]; - } - return process.nextTick(function afterTick() { - fn.apply(null, args); - }); - } -} - diff --git a/node_modules/process-nextick-args/license.md b/node_modules/process-nextick-args/license.md deleted file mode 100644 index c67e3532b..000000000 --- a/node_modules/process-nextick-args/license.md +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2015 Calvin Metcalf - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE.** diff --git a/node_modules/process-nextick-args/package.json b/node_modules/process-nextick-args/package.json deleted file mode 100644 index 7cf00938a..000000000 --- a/node_modules/process-nextick-args/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "_from": "process-nextick-args@~2.0.0", - "_id": "process-nextick-args@2.0.0", - "_inBundle": false, - "_integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "_location": "/process-nextick-args", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "process-nextick-args@~2.0.0", - "name": "process-nextick-args", - "escapedName": "process-nextick-args", - "rawSpec": "~2.0.0", - "saveSpec": null, - "fetchSpec": "~2.0.0" - }, - "_requiredBy": [ - "/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "_shasum": "a37d732f4271b4ab1ad070d35508e8290788ffaa", - "_spec": "process-nextick-args@~2.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readable-stream", - "author": "", - "bugs": { - "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "process.nextTick but always with args", - "devDependencies": { - "tap": "~0.2.6" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/calvinmetcalf/process-nextick-args", - "license": "MIT", - "main": "index.js", - "name": "process-nextick-args", - "repository": { - "type": "git", - "url": "git+https://github.com/calvinmetcalf/process-nextick-args.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "2.0.0" -} diff --git a/node_modules/process-nextick-args/readme.md b/node_modules/process-nextick-args/readme.md deleted file mode 100644 index ecb432c9b..000000000 --- a/node_modules/process-nextick-args/readme.md +++ /dev/null @@ -1,18 +0,0 @@ -process-nextick-args -===== - -[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args) - -```bash -npm install --save process-nextick-args -``` - -Always be able to pass arguments to process.nextTick, no matter the platform - -```js -var pna = require('process-nextick-args'); - -pna.nextTick(function (a, b, c) { - console.log(a, b, c); -}, 'step', 3, 'profit'); -``` diff --git a/node_modules/process/.eslintrc b/node_modules/process/.eslintrc deleted file mode 100644 index 1e7aab73e..000000000 --- a/node_modules/process/.eslintrc +++ /dev/null @@ -1,21 +0,0 @@ -{ -extends: "eslint:recommended", - "env": { - "node": true, - "browser": true, - "es6" : true, - "mocha": true - }, - "rules": { - "indent": [2, 4], - "brace-style": [2, "1tbs"], - "quotes": [2, "single"], - "no-console": 0, - "no-shadow": 0, - "no-use-before-define": [2, "nofunc"], - "no-underscore-dangle": 0, - "no-constant-condition": 0, - "space-after-function-name": 0, - "consistent-return": 0 - } -} diff --git a/node_modules/process/LICENSE b/node_modules/process/LICENSE deleted file mode 100644 index b8c1246cf..000000000 --- a/node_modules/process/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2013 Roman Shtylman - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/process/README.md b/node_modules/process/README.md deleted file mode 100644 index 6570729b2..000000000 --- a/node_modules/process/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# process - -```require('process');``` just like any other module. - -Works in node.js and browsers via the browser.js shim provided with the module. - -## browser implementation - -The goal of this module is not to be a full-fledged alternative to the builtin process module. This module mostly exists to provide the nextTick functionality and little more. We keep this module lean because it will often be included by default by tools like browserify when it detects a module has used the `process` global. - -It also exposes a "browser" member (i.e. `process.browser`) which is `true` in this implementation but `undefined` in node. This can be used in isomorphic code that adjusts it's behavior depending on which environment it's running in. - -If you are looking to provide other process methods, I suggest you monkey patch them onto the process global in your app. A list of user created patches is below. - -* [hrtime](https://github.com/kumavis/browser-process-hrtime) -* [stdout](https://github.com/kumavis/browser-stdout) - -## package manager notes - -If you are writing a bundler to package modules for client side use, make sure you use the ```browser``` field hint in package.json. - -See https://gist.github.com/4339901 for details. - -The [browserify](https://github.com/substack/node-browserify) module will properly handle this field when bundling your files. - - diff --git a/node_modules/process/browser.js b/node_modules/process/browser.js deleted file mode 100644 index d05936230..000000000 --- a/node_modules/process/browser.js +++ /dev/null @@ -1,184 +0,0 @@ -// 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; }; diff --git a/node_modules/process/index.js b/node_modules/process/index.js deleted file mode 100644 index 8d8ed7df4..000000000 --- a/node_modules/process/index.js +++ /dev/null @@ -1,2 +0,0 @@ -// for now just expose the builtin process global from node.js -module.exports = global.process; diff --git a/node_modules/process/package.json b/node_modules/process/package.json deleted file mode 100644 index 810bef308..000000000 --- a/node_modules/process/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "_from": "process@~0.11.0", - "_id": "process@0.11.10", - "_inBundle": false, - "_integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "_location": "/process", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "process@~0.11.0", - "name": "process", - "escapedName": "process", - "rawSpec": "~0.11.0", - "saveSpec": null, - "fetchSpec": "~0.11.0" - }, - "_requiredBy": [ - "/browserify", - "/insert-module-globals", - "/timers-browserify" - ], - "_resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "_shasum": "7332300e840161bda3e69a1d1d91a7d4bc16f182", - "_spec": "process@~0.11.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "Roman Shtylman", - "email": "shtylman@gmail.com" - }, - "browser": "./browser.js", - "bugs": { - "url": "https://github.com/shtylman/node-process/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "process information for node.js and browsers", - "devDependencies": { - "mocha": "2.2.1", - "zuul": "^3.10.3" - }, - "engines": { - "node": ">= 0.6.0" - }, - "homepage": "https://github.com/shtylman/node-process#readme", - "keywords": [ - "process" - ], - "license": "MIT", - "main": "./index.js", - "name": "process", - "repository": { - "type": "git", - "url": "git://github.com/shtylman/node-process.git" - }, - "scripts": { - "browser": "zuul --no-coverage --ui mocha-bdd --local 8080 -- test.js", - "test": "mocha test.js" - }, - "version": "0.11.10" -} diff --git a/node_modules/process/test.js b/node_modules/process/test.js deleted file mode 100644 index 8ba579c0a..000000000 --- a/node_modules/process/test.js +++ /dev/null @@ -1,199 +0,0 @@ -var assert = require('assert'); -var ourProcess = require('./browser'); -describe('test against our process', function () { - test(ourProcess); -}); -if (!process.browser) { - describe('test against node', function () { - test(process); - }); - vmtest(); -} -function test (ourProcess) { - describe('test arguments', function () { - it ('works', function (done) { - var order = 0; - - - ourProcess.nextTick(function (num) { - assert.equal(num, order++, 'first one works'); - ourProcess.nextTick(function (num) { - assert.equal(num, order++, 'recursive one is 4th'); - }, 3); - }, 0); - ourProcess.nextTick(function (num) { - assert.equal(num, order++, 'second one starts'); - ourProcess.nextTick(function (num) { - assert.equal(num, order++, 'this is third'); - ourProcess.nextTick(function (num) { - assert.equal(num, order++, 'this is last'); - done(); - }, 5); - }, 4); - }, 1); - ourProcess.nextTick(function (num) { - - assert.equal(num, order++, '3rd schedualed happens after the error'); - }, 2); - }); - }); -if (!process.browser) { - describe('test errors', function (t) { - it ('works', function (done) { - var order = 0; - process.removeAllListeners('uncaughtException'); - process.once('uncaughtException', function(err) { - assert.equal(2, order++, 'error is third'); - ourProcess.nextTick(function () { - assert.equal(5, order++, 'schedualed in error is last'); - done(); - }); - }); - ourProcess.nextTick(function () { - assert.equal(0, order++, 'first one works'); - ourProcess.nextTick(function () { - assert.equal(4, order++, 'recursive one is 4th'); - }); - }); - ourProcess.nextTick(function () { - assert.equal(1, order++, 'second one starts'); - throw(new Error('an error is thrown')); - }); - ourProcess.nextTick(function () { - assert.equal(3, order++, '3rd schedualed happens after the error'); - }); - }); - }); -} - describe('rename globals', function (t) { - var oldTimeout = setTimeout; - var oldClear = clearTimeout; - - it('clearTimeout', function (done){ - - var ok = true; - clearTimeout = function () { - ok = false; - } - var ran = false; - function cleanup() { - clearTimeout = oldClear; - var err; - try { - assert.ok(ok, 'fake clearTimeout ran'); - assert.ok(ran, 'should have run'); - } catch (e) { - err = e; - } - done(err); - } - setTimeout(cleanup, 1000); - ourProcess.nextTick(function () { - ran = true; - }); - }); - it('just setTimeout', function (done){ - - - setTimeout = function () { - setTimeout = oldTimeout; - try { - assert.ok(false, 'fake setTimeout called') - } catch (e) { - done(e); - } - - } - - ourProcess.nextTick(function () { - setTimeout = oldTimeout; - done(); - }); - }); - }); -} -function vmtest() { - var vm = require('vm'); - var fs = require('fs'); - var process = fs.readFileSync('./browser.js', {encoding: 'utf8'}); - - - describe('should work in vm in strict mode with no globals', function () { - it('should parse', function (done) { - var str = '"use strict";var module = {exports:{}};'; - str += process; - str += 'this.works = process.browser;'; - var script = new vm.Script(str); - var context = { - works: false - }; - script.runInNewContext(context); - assert.ok(context.works); - done(); - }); - it('setTimeout throws error', function (done) { - var str = '"use strict";var module = {exports:{}};'; - str += process; - str += 'try {process.nextTick(function () {})} catch (e){this.works = e;}'; - var script = new vm.Script(str); - var context = { - works: false - }; - script.runInNewContext(context); - assert.ok(context.works); - done(); - }); - it('should generally work', function (done) { - var str = '"use strict";var module = {exports:{}};'; - str += process; - str += 'process.nextTick(function () {assert.ok(true);done();})'; - var script = new vm.Script(str); - var context = { - clearTimeout: clearTimeout, - setTimeout: setTimeout, - done: done, - assert: assert - }; - script.runInNewContext(context); - }); - it('late defs setTimeout', function (done) { - var str = '"use strict";var module = {exports:{}};'; - str += process; - str += 'var setTimeout = hiddenSetTimeout;process.nextTick(function () {assert.ok(true);done();})'; - var script = new vm.Script(str); - var context = { - clearTimeout: clearTimeout, - hiddenSetTimeout: setTimeout, - done: done, - assert: assert - }; - script.runInNewContext(context); - }); - it('late defs clearTimeout', function (done) { - var str = '"use strict";var module = {exports:{}};'; - str += process; - str += 'var clearTimeout = hiddenClearTimeout;process.nextTick(function () {assert.ok(true);done();})'; - var script = new vm.Script(str); - var context = { - hiddenClearTimeout: clearTimeout, - setTimeout: setTimeout, - done: done, - assert: assert - }; - script.runInNewContext(context); - }); - it('late defs setTimeout and then redefine', function (done) { - var str = '"use strict";var module = {exports:{}};'; - str += process; - str += 'var setTimeout = hiddenSetTimeout;process.nextTick(function () {setTimeout = function (){throw new Error("foo")};hiddenSetTimeout(function(){process.nextTick(function (){assert.ok(true);done();});});});'; - var script = new vm.Script(str); - var context = { - clearTimeout: clearTimeout, - hiddenSetTimeout: setTimeout, - done: done, - assert: assert - }; - script.runInNewContext(context); - }); - }); -} diff --git a/node_modules/public-encrypt/.travis.yml b/node_modules/public-encrypt/.travis.yml deleted file mode 100644 index 1b7266674..000000000 --- a/node_modules/public-encrypt/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.10" - - "0.11" - - "0.12" - - iojs \ No newline at end of file diff --git a/node_modules/public-encrypt/LICENSE b/node_modules/public-encrypt/LICENSE deleted file mode 100644 index c9ddc0feb..000000000 --- a/node_modules/public-encrypt/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2017 Calvin Metcalf - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/public-encrypt/browser.js b/node_modules/public-encrypt/browser.js deleted file mode 100644 index 4032f6866..000000000 --- a/node_modules/public-encrypt/browser.js +++ /dev/null @@ -1,10 +0,0 @@ -exports.publicEncrypt = require('./publicEncrypt') -exports.privateDecrypt = require('./privateDecrypt') - -exports.privateEncrypt = function privateEncrypt (key, buf) { - return exports.publicEncrypt(key, buf, true) -} - -exports.publicDecrypt = function publicDecrypt (key, buf) { - return exports.privateDecrypt(key, buf, true) -} diff --git a/node_modules/public-encrypt/index.js b/node_modules/public-encrypt/index.js deleted file mode 100644 index 6ff4014e8..000000000 --- a/node_modules/public-encrypt/index.js +++ /dev/null @@ -1,18 +0,0 @@ -var crypto = require('crypto') -if (typeof crypto.publicEncrypt !== 'function') { - crypto = require('./browser') -} -exports.publicEncrypt = crypto.publicEncrypt -exports.privateDecrypt = crypto.privateDecrypt - -if (typeof crypto.privateEncrypt !== 'function') { - exports.privateEncrypt = require('./browser').privateEncrypt -} else { - exports.privateEncrypt = crypto.privateEncrypt -} - -if (typeof crypto.publicDecrypt !== 'function') { - exports.publicDecrypt = require('./browser').publicDecrypt -} else { - exports.publicDecrypt = crypto.publicDecrypt -} diff --git a/node_modules/public-encrypt/mgf.js b/node_modules/public-encrypt/mgf.js deleted file mode 100644 index b966f317b..000000000 --- a/node_modules/public-encrypt/mgf.js +++ /dev/null @@ -1,19 +0,0 @@ -var createHash = require('create-hash') -var Buffer = require('safe-buffer').Buffer - -module.exports = function (seed, len) { - var t = Buffer.alloc(0) - var i = 0 - var c - while (t.length < len) { - c = i2ops(i++) - t = Buffer.concat([t, createHash('sha1').update(seed).update(c).digest()]) - } - return t.slice(0, len) -} - -function i2ops (c) { - var out = Buffer.allocUnsafe(4) - out.writeUInt32BE(c, 0) - return out -} diff --git a/node_modules/public-encrypt/package.json b/node_modules/public-encrypt/package.json deleted file mode 100644 index a849a3de5..000000000 --- a/node_modules/public-encrypt/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "_from": "public-encrypt@^4.0.0", - "_id": "public-encrypt@4.0.3", - "_inBundle": false, - "_integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "_location": "/public-encrypt", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "public-encrypt@^4.0.0", - "name": "public-encrypt", - "escapedName": "public-encrypt", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/crypto-browserify" - ], - "_resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "_shasum": "4fcc9d77a07e48ba7527e7cbe0de33d0701331e0", - "_spec": "public-encrypt@^4.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/crypto-browserify", - "author": { - "name": "Calvin Metcalf" - }, - "browser": "browser.js", - "bugs": { - "url": "https://github.com/crypto-browserify/publicEncrypt/issues" - }, - "bundleDependencies": false, - "dependencies": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - }, - "deprecated": false, - "description": "browserify version of publicEncrypt & privateDecrypt", - "devDependencies": { - "standard": "^12.0.0", - "tap-spec": "^2.1.2", - "tape": "^3.0.3" - }, - "directories": { - "test": "test" - }, - "homepage": "https://github.com/crypto-browserify/publicEncrypt", - "license": "MIT", - "main": "index.js", - "name": "public-encrypt", - "repository": { - "type": "git", - "url": "git+https://github.com/crypto-browserify/publicEncrypt.git" - }, - "scripts": { - "lint": "standard", - "test": "node test/index.js | tspec" - }, - "version": "4.0.3" -} diff --git a/node_modules/public-encrypt/privateDecrypt.js b/node_modules/public-encrypt/privateDecrypt.js deleted file mode 100644 index 8fc6dfecb..000000000 --- a/node_modules/public-encrypt/privateDecrypt.js +++ /dev/null @@ -1,105 +0,0 @@ -var parseKeys = require('parse-asn1') -var mgf = require('./mgf') -var xor = require('./xor') -var BN = require('bn.js') -var crt = require('browserify-rsa') -var createHash = require('create-hash') -var withPublic = require('./withPublic') -var Buffer = require('safe-buffer').Buffer - -module.exports = function privateDecrypt (privateKey, enc, reverse) { - var padding - if (privateKey.padding) { - padding = privateKey.padding - } else if (reverse) { - padding = 1 - } else { - padding = 4 - } - - var key = parseKeys(privateKey) - var k = key.modulus.byteLength() - if (enc.length > k || new BN(enc).cmp(key.modulus) >= 0) { - throw new Error('decryption error') - } - var msg - if (reverse) { - msg = withPublic(new BN(enc), key) - } else { - msg = crt(enc, key) - } - var zBuffer = Buffer.alloc(k - msg.length) - msg = Buffer.concat([zBuffer, msg], k) - if (padding === 4) { - return oaep(key, msg) - } else if (padding === 1) { - return pkcs1(key, msg, reverse) - } else if (padding === 3) { - return msg - } else { - throw new Error('unknown padding') - } -} - -function oaep (key, msg) { - var k = key.modulus.byteLength() - var iHash = createHash('sha1').update(Buffer.alloc(0)).digest() - var hLen = iHash.length - if (msg[0] !== 0) { - throw new Error('decryption error') - } - var maskedSeed = msg.slice(1, hLen + 1) - var maskedDb = msg.slice(hLen + 1) - var seed = xor(maskedSeed, mgf(maskedDb, hLen)) - var db = xor(maskedDb, mgf(seed, k - hLen - 1)) - if (compare(iHash, db.slice(0, hLen))) { - throw new Error('decryption error') - } - var i = hLen - while (db[i] === 0) { - i++ - } - if (db[i++] !== 1) { - throw new Error('decryption error') - } - return db.slice(i) -} - -function pkcs1 (key, msg, reverse) { - var p1 = msg.slice(0, 2) - var i = 2 - var status = 0 - while (msg[i++] !== 0) { - if (i >= msg.length) { - status++ - break - } - } - var ps = msg.slice(2, i - 1) - - if ((p1.toString('hex') !== '0002' && !reverse) || (p1.toString('hex') !== '0001' && reverse)) { - status++ - } - if (ps.length < 8) { - status++ - } - if (status) { - throw new Error('decryption error') - } - return msg.slice(i) -} -function compare (a, b) { - a = Buffer.from(a) - b = Buffer.from(b) - var dif = 0 - var len = a.length - if (a.length !== b.length) { - dif++ - len = Math.min(a.length, b.length) - } - var i = -1 - while (++i < len) { - dif += (a[i] ^ b[i]) - } - return dif -} diff --git a/node_modules/public-encrypt/publicEncrypt.js b/node_modules/public-encrypt/publicEncrypt.js deleted file mode 100644 index 122aa7652..000000000 --- a/node_modules/public-encrypt/publicEncrypt.js +++ /dev/null @@ -1,88 +0,0 @@ -var parseKeys = require('parse-asn1') -var randomBytes = require('randombytes') -var createHash = require('create-hash') -var mgf = require('./mgf') -var xor = require('./xor') -var BN = require('bn.js') -var withPublic = require('./withPublic') -var crt = require('browserify-rsa') -var Buffer = require('safe-buffer').Buffer - -module.exports = function publicEncrypt (publicKey, msg, reverse) { - var padding - if (publicKey.padding) { - padding = publicKey.padding - } else if (reverse) { - padding = 1 - } else { - padding = 4 - } - var key = parseKeys(publicKey) - var paddedMsg - if (padding === 4) { - paddedMsg = oaep(key, msg) - } else if (padding === 1) { - paddedMsg = pkcs1(key, msg, reverse) - } else if (padding === 3) { - paddedMsg = new BN(msg) - if (paddedMsg.cmp(key.modulus) >= 0) { - throw new Error('data too long for modulus') - } - } else { - throw new Error('unknown padding') - } - if (reverse) { - return crt(paddedMsg, key) - } else { - return withPublic(paddedMsg, key) - } -} - -function oaep (key, msg) { - var k = key.modulus.byteLength() - var mLen = msg.length - var iHash = createHash('sha1').update(Buffer.alloc(0)).digest() - var hLen = iHash.length - var hLen2 = 2 * hLen - if (mLen > k - hLen2 - 2) { - throw new Error('message too long') - } - var ps = Buffer.alloc(k - mLen - hLen2 - 2) - var dblen = k - hLen - 1 - var seed = randomBytes(hLen) - var maskedDb = xor(Buffer.concat([iHash, ps, Buffer.alloc(1, 1), msg], dblen), mgf(seed, dblen)) - var maskedSeed = xor(seed, mgf(maskedDb, hLen)) - return new BN(Buffer.concat([Buffer.alloc(1), maskedSeed, maskedDb], k)) -} -function pkcs1 (key, msg, reverse) { - var mLen = msg.length - var k = key.modulus.byteLength() - if (mLen > k - 11) { - throw new Error('message too long') - } - var ps - if (reverse) { - ps = Buffer.alloc(k - mLen - 3, 0xff) - } else { - ps = nonZero(k - mLen - 3) - } - return new BN(Buffer.concat([Buffer.from([0, reverse ? 1 : 2]), ps, Buffer.alloc(1), msg], k)) -} -function nonZero (len) { - var out = Buffer.allocUnsafe(len) - var i = 0 - var cache = randomBytes(len * 2) - var cur = 0 - var num - while (i < len) { - if (cur === cache.length) { - cache = randomBytes(len * 2) - cur = 0 - } - num = cache[cur++] - if (num) { - out[i++] = num - } - } - return out -} diff --git a/node_modules/public-encrypt/readme.md b/node_modules/public-encrypt/readme.md deleted file mode 100644 index 96fe944f8..000000000 --- a/node_modules/public-encrypt/readme.md +++ /dev/null @@ -1,8 +0,0 @@ -publicEncrypt -=== - -[![Build Status](https://travis-ci.org/crypto-browserify/publicEncrypt.svg)](https://travis-ci.org/crypto-browserify/publicEncrypt) - -publicEncrypt/privateDecrypt for browserify - -[Blog post about the moving parts that have gone into this.](http://calvinmetcalf.com/post/109301244759/porting-nodejs-crypto-to-the-browser-part-3) diff --git a/node_modules/public-encrypt/test/1024.priv b/node_modules/public-encrypt/test/1024.priv deleted file mode 100644 index 720621692..000000000 --- a/node_modules/public-encrypt/test/1024.priv +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAKulUTZ8B1qccZ8c -DXRGSY08gW8KvLlcxxxGC4gZHNT3CBUF8n5R4KE30aZyYZ/rtsQZu05juZJxaJ0q -mbe75dlQ5d+Xc9BMXeQg/MpTZw5TAN7OIdGYYpFBe+1PLZ6wEfjkYrMqMUcfq2Lq -hTLdAbvBJnuRcYZLqmBeOQ8FTrKrAgMBAAECgYEAnkHRbEPU3/WISSQrP36iyCb2 -S/SBZwKkzmvCrBxDWhPeDswp9c/2JY76rNWfLzy8iXgUG8WUzvHje61Qh3gmBcKe -bUaTGl4Vy8Ha1YBADo5RfRrdm0FE4tvgvu/TkqFqpBBZweu54285hk5zlG7n/D7Y -dnNXUpu5MlNb5x3gW0kCQQDUL//cwcXUxY/evaJP4jSe+ZwEQZo+zXRLiPUulBoV -aw28CVMuxdgwqAo1X1IKefPeUaf7RQu8gCKaRnpGuEuXAkEAzxZTfMmvmCUDIew4 -5Gk6bK265XQWdhcgiq254lpBGOYmDj9yCE7yA+zmASQwMsXTdQOi1hOCEyrXuSJ5 -c++EDQJAFh3WrnzoEPByuYXMmET8tSFRWMQ5vpgNqh3haHR5b4gUC2hxaiunCBNL -1RpVY9AoUiDywGcG/SPh93CnKB3niwJBAKP7AtsifZgVXtiizB4aMThTjVYaSZrz -D0Kg9DuHylpkDChmFu77TGrNUQgAVuYtfhb/bRblVa/F0hJ4eQHT3JUCQBVT68tb -OgRUk0aP9tC3021VN82X6+klowSQN8oBPX8+TfDWSUilp/+j24Hky+Z29Do7yR/R -qutnL92CvBlVLV4= ------END PRIVATE KEY----- diff --git a/node_modules/public-encrypt/test/1024.pub b/node_modules/public-encrypt/test/1024.pub deleted file mode 100644 index 2dba785d6..000000000 --- a/node_modules/public-encrypt/test/1024.pub +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrpVE2fAdanHGfHA10RkmNPIFv -Cry5XMccRguIGRzU9wgVBfJ+UeChN9GmcmGf67bEGbtOY7mScWidKpm3u+XZUOXf -l3PQTF3kIPzKU2cOUwDeziHRmGKRQXvtTy2esBH45GKzKjFHH6ti6oUy3QG7wSZ7 -kXGGS6pgXjkPBU6yqwIDAQAB ------END PUBLIC KEY----- diff --git a/node_modules/public-encrypt/test/ec.pass.priv b/node_modules/public-encrypt/test/ec.pass.priv deleted file mode 100644 index bf1836d55..000000000 --- a/node_modules/public-encrypt/test/ec.pass.priv +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN ENCRYPTED PRIVATE KEY----- -MIHeMEkGCSqGSIb3DQEFDTA8MBsGCSqGSIb3DQEFDDAOBAi9LqZQx4JFXAICCAAw -HQYJYIZIAWUDBAECBBA+js1fG4Rv/yRN7oZvxbgyBIGQ/D4yj86M1x8lMsnAHQ/K -7/ryb/baDNHqN9LTZanEGBuyxgrTzt08SiL+h91yFGMoaly029K1VgEI8Lxu5Np/ -A+LK7ewh73ABzsbuxYdcXI+rKnrvLN9Tt6veDs4GlqTTsWwq5wF0C+6gaYRBXA74 -T1b6NykGh2UNL5U5pHZEYdOVLz+lRJL7gYqlweNHP/S3 ------END ENCRYPTED PRIVATE KEY----- diff --git a/node_modules/public-encrypt/test/ec.priv b/node_modules/public-encrypt/test/ec.priv deleted file mode 100644 index 25fffbd87..000000000 --- a/node_modules/public-encrypt/test/ec.priv +++ /dev/null @@ -1,5 +0,0 @@ ------BEGIN EC PRIVATE KEY----- -MHQCAQEEIDF6Xv8Sv//wGUWD+c780ppGrU0QdZWCAzxAQPQX8r/uoAcGBSuBBAAK -oUQDQgAEIZeowDylls4K/wfBjO18bYo7gGx8nYQRija4e/qEMikOHJai7geeUreU -r5Xky/Ax7s2dGtegsPNsPgGe5MpQvg== ------END EC PRIVATE KEY----- diff --git a/node_modules/public-encrypt/test/ec.pub b/node_modules/public-encrypt/test/ec.pub deleted file mode 100644 index 2e39e5bb6..000000000 --- a/node_modules/public-encrypt/test/ec.pub +++ /dev/null @@ -1,4 +0,0 @@ ------BEGIN PUBLIC KEY----- -MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEIZeowDylls4K/wfBjO18bYo7gGx8nYQR -ija4e/qEMikOHJai7geeUreUr5Xky/Ax7s2dGtegsPNsPgGe5MpQvg== ------END PUBLIC KEY----- diff --git a/node_modules/public-encrypt/test/index.js b/node_modules/public-encrypt/test/index.js deleted file mode 100644 index 85b32e30f..000000000 --- a/node_modules/public-encrypt/test/index.js +++ /dev/null @@ -1,113 +0,0 @@ -var test = require('tape') -var fs = require('fs') -var parseKeys = require('parse-asn1') -var Buffer = require('safe-buffer').Buffer -var path = require('path') - -require('./nodeTests') -var rsa1024 = { - private: fs.readFileSync(path.join(__dirname, 'rsa.1024.priv')), - public: fs.readFileSync(path.join(__dirname, 'rsa.1024.pub')) -} -var rsa1024priv = { - private: fs.readFileSync(path.join(__dirname, 'rsa.1024.priv')), - public: fs.readFileSync(path.join(__dirname, 'rsa.1024.priv')) -} - -var rsa2028 = { - private: fs.readFileSync(path.join(__dirname, 'rsa.2028.priv')), - public: fs.readFileSync(path.join(__dirname, 'rsa.2028.pub')) -} -var nonrsa1024 = { - private: fs.readFileSync(path.join(__dirname, '1024.priv')), - public: fs.readFileSync(path.join(__dirname, '1024.pub')) -} -var nonrsa1024str = { - private: fs.readFileSync(path.join(__dirname, '1024.priv')).toString(), - public: fs.readFileSync(path.join(__dirname, '1024.pub')).toString() -} -var pass1024 = { - private: { - passphrase: 'fooo', - key: fs.readFileSync(path.join(__dirname, 'pass.1024.priv')) - }, - public: fs.readFileSync(path.join(__dirname, 'pass.1024.pub')) -} -var pass2028 = { - private: { - passphrase: 'password', - key: fs.readFileSync(path.join(__dirname, 'rsa.pass.priv')) - }, - public: fs.readFileSync(path.join(__dirname, 'rsa.pass.pub')) -} - -var nodeCrypto = require('../') -var myCrypto = require('../browser') -function _testIt (keys, message, t) { - var pub = keys.public - var priv = keys.private - t.test(message.toString(), function (t) { - t.plan(8) - - var myEnc = myCrypto.publicEncrypt(pub, message) - var nodeEnc = nodeCrypto.publicEncrypt(pub, message) - t.equals(myCrypto.privateDecrypt(priv, myEnc).toString('hex'), message.toString('hex'), 'my decrypter my message') - t.equals(myCrypto.privateDecrypt(priv, nodeEnc).toString('hex'), message.toString('hex'), 'my decrypter node\'s message') - t.equals(nodeCrypto.privateDecrypt(priv, myEnc).toString('hex'), message.toString('hex'), 'node decrypter my message') - t.equals(nodeCrypto.privateDecrypt(priv, nodeEnc).toString('hex'), message.toString('hex'), 'node decrypter node\'s message') - myEnc = myCrypto.privateEncrypt(priv, message) - nodeEnc = nodeCrypto.privateEncrypt(priv, message) - t.equals(myCrypto.publicDecrypt(pub, myEnc).toString('hex'), message.toString('hex'), 'reverse methods my decrypter my message') - t.equals(myCrypto.publicDecrypt(pub, nodeEnc).toString('hex'), message.toString('hex'), 'reverse methods my decrypter node\'s message') - t.equals(nodeCrypto.publicDecrypt(pub, myEnc).toString('hex'), message.toString('hex'), 'reverse methods node decrypter my message') - t.equals(nodeCrypto.publicDecrypt(pub, nodeEnc).toString('hex'), message.toString('hex'), 'reverse methods node decrypter node\'s message') - }) -} -function testIt (keys, message, t) { - _testIt(keys, message, t) - _testIt(paddingObject(keys, 1), Buffer.concat([message, Buffer.from(' with RSA_PKCS1_PADDING')]), t) - var parsedKey = parseKeys(keys.public) - var k = parsedKey.modulus.byteLength() - var zBuf = Buffer.alloc(k) - var msg = Buffer.concat([zBuf, message, Buffer.from(' with no padding')]).slice(-k) - _testIt(paddingObject(keys, 3), msg, t) -} -function paddingObject (keys, padding) { - return { - public: addPadding(keys.public, padding), - private: addPadding(keys.private, padding) - } -} -function addPadding (key, padding) { - if (typeof key === 'string' || Buffer.isBuffer(key)) { - return { - key: key, - padding: padding - } - } - var out = { - key: key.key, - padding: padding - } - if ('passphrase' in key) { - out.passphrase = key.passphrase - } - return out -} -function testRun (i) { - test('run ' + i, function (t) { - testIt(rsa1024priv, Buffer.from('1024 2 private keys'), t) - testIt(rsa1024, Buffer.from('1024 keys'), t) - testIt(rsa2028, Buffer.from('2028 keys'), t) - testIt(nonrsa1024, Buffer.from('1024 keys non-rsa key'), t) - testIt(pass1024, Buffer.from('1024 keys and password'), t) - testIt(nonrsa1024str, Buffer.from('1024 keys non-rsa key as a string'), t) - testIt(pass2028, Buffer.from('2028 rsa key with variant passwords'), t) - }) -} - -var i = 0 -var num = 20 -while (++i <= num) { - testRun(i) -} diff --git a/node_modules/public-encrypt/test/nodeTests.js b/node_modules/public-encrypt/test/nodeTests.js deleted file mode 100644 index f022e071c..000000000 --- a/node_modules/public-encrypt/test/nodeTests.js +++ /dev/null @@ -1,51 +0,0 @@ -var crypto = require('../browser') -var test = require('tape') -var fs = require('fs') -var Buffer = require('safe-buffer').Buffer -var path = require('path') -// Test RSA encryption/decryption -test('node tests', function (t) { - var keyPem = fs.readFileSync(path.join(__dirname, 'test_key.pem'), 'ascii') - var rsaPubPem = fs.readFileSync(path.join(__dirname, 'test_rsa_pubkey.pem'), - 'ascii') - var rsaKeyPem = fs.readFileSync(path.join(__dirname, 'test_rsa_privkey.pem'), - 'ascii') - var rsaKeyPemEncrypted = fs.readFileSync(path.join( - __dirname, 'test_rsa_privkey_encrypted.pem'), 'ascii') - var input = 'I AM THE WALRUS' - var bufferToEncrypt = Buffer.from(input) - - var encryptedBuffer = crypto.publicEncrypt(rsaPubPem, bufferToEncrypt) - - var decryptedBuffer = crypto.privateDecrypt(rsaKeyPem, encryptedBuffer) - t.equal(input, decryptedBuffer.toString()) - - var decryptedBufferWithPassword = crypto.privateDecrypt({ - key: rsaKeyPemEncrypted, - passphrase: 'password' - }, encryptedBuffer) - t.equal(input, decryptedBufferWithPassword.toString()) - - // encryptedBuffer = crypto.publicEncrypt(certPem, bufferToEncrypt); - - // decryptedBuffer = crypto.privateDecrypt(keyPem, encryptedBuffer); - // t.equal(input, decryptedBuffer.toString()); - - encryptedBuffer = crypto.publicEncrypt(keyPem, bufferToEncrypt) - - decryptedBuffer = crypto.privateDecrypt(keyPem, encryptedBuffer) - t.equal(input, decryptedBuffer.toString()) - - encryptedBuffer = crypto.privateEncrypt(keyPem, bufferToEncrypt) - - decryptedBuffer = crypto.publicDecrypt(keyPem, encryptedBuffer) - t.equal(input, decryptedBuffer.toString()) - - t.throws(function () { - crypto.privateDecrypt({ - key: rsaKeyPemEncrypted, - passphrase: 'wrong' - }, encryptedBuffer) - }) - t.end() -}) diff --git a/node_modules/public-encrypt/test/pass.1024.priv b/node_modules/public-encrypt/test/pass.1024.priv deleted file mode 100644 index b9f388450..000000000 --- a/node_modules/public-encrypt/test/pass.1024.priv +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN ENCRYPTED PRIVATE KEY----- -MIICzzBJBgkqhkiG9w0BBQ0wPDAbBgkqhkiG9w0BBQwwDgQIji3ZZ6JbsA4CAggA -MB0GCWCGSAFlAwQBFgQQC6MKblq8zyX90/KmgotsMQSCAoDghNf+yxPC/KRh7F3O -k0lMgtDkV+wCLDv7aBvUqy8Ry2zqFPIlfLb8XtSW943XEu6KUI13IZPEr8p9h1ve -Iye6L0g6uAgbFxBE2DwBBSI7mYr7lokr4v0k+inMKf4JeRdI9XWgwOILKTGf1vH7 -PhvBnqLhOg6BIOuF426qpiyYlmRda74d0Th4o6ZyhyMSzPI1XbWSg719Ew3N/tLe -OHdYl0eFrgNjq+xO4Ev+W7eNIh/XBMQtk9wo+mxeNdldRnX822HxTsL8fSSPs+9T -W5M/2EBTJMSsswSjZyFkq8ehtxovI2u0IBX1IiPulyUZLnSNPDV1eUVClK6rk+q1 -kVsfJhUr2qvIjNlQWlbEXQj4VwGtgl0++l8vdpj59MuN2J3Nx5TNMLjA6BYAa/tr -Bu928QoT7ET+SGx5XKCwKb5fwXmDlV5zZC4kZWTaF/d/Icvj5F+fDZuYFg1JOXNZ -+q2oA1qMYaHGX6lF3pbO84ebg1iwQTDM8iIqFeSMGUJTnk/3a7sqfaWQbEQwGb+X -fXnSTwkF+wO2rriPbFvWyzecWu67zDCP0ZWUgGb86sSJCM7xRGShESwCjOrb88F1 -5SZjyIqogrkc3IWiLH9gc5U8d86qoFjJnP6BfwYks1UIyXNGKfZTCqICpMphV+IS -b0N2jprjLTkWR6nxYGSH1bkKMs7x1M0FBLWWLAZqPn9X3pe6JwIBds04O6XjF0un -oxwDjcJdoxVs7PgRiM5d1Tubqu2zmpCCmXNiqi9B0+rV9/jHg9IA5gUfvYdCcEv+ -oAr90I+2+PuBFa9lgdbDV6DtZk4bSYluqamxVeLPg/vrewYfVfDv6jftfY1D0DEy -69H0 ------END ENCRYPTED PRIVATE KEY----- diff --git a/node_modules/public-encrypt/test/pass.1024.pub b/node_modules/public-encrypt/test/pass.1024.pub deleted file mode 100644 index 617e7fb10..000000000 --- a/node_modules/public-encrypt/test/pass.1024.pub +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDSK/7i5BV0x+gmX16Wrm7kRkCZ -y1QUt6wiM2g+SAZTYR0381VnSMX2cv7CpN3499lZj1rL5S7YTaZZwX3RvU5fz56/ -eDX6ciL/PZsbclN2KdkMWYgmcb9J1zUeoMQ3cjfFUCdQZ/ZvDWa+wY2Zg8os2Bow -AoufHtYHm3eOly/cWwIDAQAB ------END PUBLIC KEY----- diff --git a/node_modules/public-encrypt/test/rsa.1024.priv b/node_modules/public-encrypt/test/rsa.1024.priv deleted file mode 100644 index d3b5fdab6..000000000 --- a/node_modules/public-encrypt/test/rsa.1024.priv +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICVAIBAAJ/OwswbFo/uyC8ltGf/yA1A+gV5IGdnAgPbUSI3GzbHCA+x+TLG/tL -vbRw3r1smppY/jkkpiVW1ErSMuN0uixp5gb78Z9rH1XpWb5WWgp3WaY/9EHMjMdO -kQ/9LVZvRvl/M/Fi6owP+q+amJI1BEjECYfbhGL3rmlVdq4qXc40QwIDAQABAn8I -VZ0BPoAOhyF33KFMHxy8r28fsVgxJUYgM3NqQgdv4fFawCYXjhJz9duU5YJGFJGJ -WUGeHlkyYFlpi4f3m7tY7JawmQUWB0MNSoKHI3cgDX4/tfBN8ni+cO0eSoR5czBY -EsAHBU47p1awNFAHwd+ZEuv9H4RmMn7p279rQTtpAkAH3Nqs2/vrRF2cZUN4fIXf -4xHsQBByUayGq8a3J0UGaSFWv68zTUKFherr9uZotNp7NJ4jBXiARw0q8docXUG1 -AkAHgmOKHoORtAmikqpmFEJZOtsXMaLCIm4EszPo5ciYoLMBcVit09AdiQlt7ZJL -DY02svU1b0agCZ97kDkmHDkXAkACa8M9JELuDs/P/vIGYDkMVatIFfW6bWF02eFG -taWwMqCcSEsWvbw0xqYt34jURpNbCjmCyQVwYfAw/+TLhP9dAkAFwRjdwjw37qpj -ddg1mNiu37b7swFxmkiMOXZRxaNNsfb56A14RpN3zob3QdGUybGodMIKTFbmU/lu -CjqAxafJAkAG2yf6RWbwFIWfMyt7WYCh0VaGBCcgy574AinVieEo3ZZyFfC63+xm -3uoaNy4iLoJv4GCjqUBz3ZfcVaO/DDWG ------END RSA PRIVATE KEY----- diff --git a/node_modules/public-encrypt/test/rsa.1024.pub b/node_modules/public-encrypt/test/rsa.1024.pub deleted file mode 100644 index 7ba06369b..000000000 --- a/node_modules/public-encrypt/test/rsa.1024.pub +++ /dev/null @@ -1,5 +0,0 @@ ------BEGIN RSA PUBLIC KEY----- -MIGGAn87CzBsWj+7ILyW0Z//IDUD6BXkgZ2cCA9tRIjcbNscID7H5Msb+0u9tHDe -vWyamlj+OSSmJVbUStIy43S6LGnmBvvxn2sfVelZvlZaCndZpj/0QcyMx06RD/0t -Vm9G+X8z8WLqjA/6r5qYkjUESMQJh9uEYveuaVV2ripdzjRDAgMBAAE= ------END RSA PUBLIC KEY----- diff --git a/node_modules/public-encrypt/test/rsa.2028.priv b/node_modules/public-encrypt/test/rsa.2028.priv deleted file mode 100644 index 10e651d86..000000000 --- a/node_modules/public-encrypt/test/rsa.2028.priv +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEjwIBAAKB/gy7mjaWgPeFdVYDZWRCA9BNiv3pPb0es27+FKY0hszLaOw47ExC -tAWpDsH48TXAfyHBYwBLguayfk4LGIupxb+CGMbRo3xEp0CbfY1Jby26T9vGjRC1 -foHDDUJG84uaRbyHqaf4i6zt4gVR+xlAEIjkaFAAK8cOoXAT1CVqGLLljUCchL8P -jaHj/yriZ/S7rdwlI3LnABxwwmLrmR/v71WtpmO/aNG8N+1po+QwaghTkyQ59E/Z -vAuOkFWHok2q/R6PYAa2jdZ9zim0FqOP+nkQaEDRbBFBmBqTv5fFGfk2WsAfKf/R -G0/VFd+ZeM5251TeTvXH695nlSGauVl9AgMBAAECgf4LrWHY/l54ouThZWvvbrug -pfz6sJX2g9l7yXmWlEWsPECVo/7SUbpYFpt6OZy99zSg+IKbGqWKfdhoKrTwIVtC -L0YZ0NlmdnANSIz0roxQG7ZxkL5+vHSw/PmD9x4Uwf+Cz8hATCmNBv1qc60dkyuW -4CLqe72qaTiVWRoO1iagQghNcLoo6vSy65ExLaCDTPha7yu2vw4hFZpWiEjW4dxf -rFdLiix52BC86YlAlxME/rLg8IJVvilbyo9aWdXmxOaUTLRv6PkFD1/gVdw8V9Qr -SLN9FlK2kkjiX0dzoibvZw3tMnt3yydAx0X87+sMRVahC1bp3kVPz4Hy0EWX4QJ/ -PM31vGiuITk2NCd51DXt1Ltn2OP5FaJSmCaEjh0XkU4qouYyjXWt8Bu6BTCl2vua -Fg0Uji9C+IkPLmaUMbMIOwaTk8cWqLthSxsLe70J5OkGrgfKUM/w+BHH1Pt/Pjzj -C++l0kiFaOVDVaAV9GpLPLCBoK/PC9Rb/rxMMoCCNwJ/NZuedIny2w3LMii77h/T -zSvergNGhjY6Rnva8lLXJ6dlrkcPAyps3gWwxqj4NR0T+GM0bDUPVLb7M07XV7SX -v7VJGm52JbRGwM1ss+r8XTTNemeGk+WRxG7TgtsMqYGXLfB8Qxk/f5/Mcc00Tl8u -wXFNsfxJxmt6AbsTr3g36wJ/IhOnibz9Ad+nchlBnN3QeW3CKHqzaR18voqvtVm2 -kJfHK15prH/sSGmxmiEGgrCJTZxtDbaNCO7/VBjnKudUUIhCAwsLtuq0/zub9vAd -8G1scfIpv5qaSNzmKoX8bOwArvrS6wP7yKrcTsuWIlHD8rJVI7IEDnQoTp5G8fK1 -hwJ/MIh8M5v0r5dUYEv6oIJWGcle6AH1JmsP5WIafgq72Z2288pHcCFHwNY8Dg9J -76QswVLnUhPTlmm3EOOPGEtam2iAD5r0Afytlb4lbNoQsj2szeXONDXB+6oueajh -VNELUr8HcSP5lgzRZjJW6aFIzj9LDRmQnUAOjGSXVOQtEwJ/MCQZ7N/v4dIKeDRA -8d8UExZ3+gGHumziztGRJ0tQryZH2PakP5I7V+1l7qEUnJ2c3mF+e1v41Ep9LCvh -bzrPKw9dxh18g4b+7bMpsWPnsraKh6ipxc7aaOaZV0Dxgez4zcZu0P1olO0cN3KM -nxJ0Pds3R8bAhNCDdS2JZaRp5Q== ------END RSA PRIVATE KEY----- diff --git a/node_modules/public-encrypt/test/rsa.2028.pub b/node_modules/public-encrypt/test/rsa.2028.pub deleted file mode 100644 index b36dca4d6..000000000 --- a/node_modules/public-encrypt/test/rsa.2028.pub +++ /dev/null @@ -1,8 +0,0 @@ ------BEGIN RSA PUBLIC KEY----- -MIIBBgKB/gy7mjaWgPeFdVYDZWRCA9BNiv3pPb0es27+FKY0hszLaOw47ExCtAWp -DsH48TXAfyHBYwBLguayfk4LGIupxb+CGMbRo3xEp0CbfY1Jby26T9vGjRC1foHD -DUJG84uaRbyHqaf4i6zt4gVR+xlAEIjkaFAAK8cOoXAT1CVqGLLljUCchL8PjaHj -/yriZ/S7rdwlI3LnABxwwmLrmR/v71WtpmO/aNG8N+1po+QwaghTkyQ59E/ZvAuO -kFWHok2q/R6PYAa2jdZ9zim0FqOP+nkQaEDRbBFBmBqTv5fFGfk2WsAfKf/RG0/V -Fd+ZeM5251TeTvXH695nlSGauVl9AgMBAAE= ------END RSA PUBLIC KEY----- diff --git a/node_modules/public-encrypt/test/rsa.pass.priv b/node_modules/public-encrypt/test/rsa.pass.priv deleted file mode 100644 index 99e821352..000000000 --- a/node_modules/public-encrypt/test/rsa.pass.priv +++ /dev/null @@ -1,30 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: AES-256-CBC,7A6A055AD675947A657041422F06D439 - -HQdjzAKUuqqKhZHmpzzY/monfqFhiHnZ5c24jtR9fM4aQJXf/e1fz6MEhyIz6XON -sb4CnXZstnxUuVWDkHEu6KWQ/dKALgiDUuT+UdMawVoVPGdgyWZp35pQPWi3fT2V -XZn58YkG8bO3Y403eZPyhadOefD1VtuFuK6/f90jjzx6ZDnwveXpYgFV7Jy1/pFd -cLLMf07C+hbk416nX6UVipWe4GH+ADFom5ZCfAaUotM7n8i149dULNF4YYi2wP31 -1YaDH5vf1CqiaieDY7xLzpEixwJz6ZEg3gLXaUvz2MpF8owiGI3eP0g7voWp3xt4 -TQx/qDURlaXiaRriWdWtpKyW1MFuJ5+KdNtR1/kXr2BLPB/ZLwyqtynUy8ZYpb4+ -WIRYpUGeb//ZHGhlCH7CRMdABsal4wTwnzi9fW4Ax96ecJ2SlwCuKxwS7iEq2y1/ -FAfGwsE+XufHhme5p6XjKfiHx+zJMIB2NMkrm+wm4PbMTrGVnw5/41/r6XxOB8fe -iKi12Jth4dusc1vYGYfzKop9uEM6CZ6+Chqzb+Zyh/xUiZVlCX/BYnxr7yXUm9aR -PHQgxkn2Act8FgQB3Kgs3jCiCRIJrlsnybeWzQ3YO9TjC4MxygmmwODDBpsOKnEi -kXXS54+cZFjcsva4uJVwhAywRPVUkLzmTkH0tGiwCHjeQNECm+TLahkkEIXrVTb9 -c9creNXMgE6jVVz+R43HXsGvTcgMcBLyFRQJe2nVaj/dQ5JbF4uqNnQzRjAbD34K -uTpFaJ/kmlgcmeScRLnwaoYwFlmhSC+bK0dfY1Jr6AQRA6IDP7nIjqWNDCHNBB8r -Qj1v2KWoVQe3xNHaXhkbJPbA2DKlUIqffkBVtMKtt9KuG3Rccf3bVYAW6oid73/D -z7DMAF5G/OpVR8VbGh1WxXuR7zEVDUwpwsp9ek5dqN8BnBz1ppdZNIKqzszneckU -s2l/6mZBmgV1Nfy/cQU6U5s3S1Xc75UDQVLms3CIOpFTRIpecNTdfa31fYy/svy0 -M2lWTbCva0dOyuvMUhTgBL4I7Qa2dUMPXHMZatV5ooHYq/BZJA1r84C5cM5r+umE -2LLv/BlUr7RaQHhaKGn4Qhpzo5yRDE9mEqDpLVkbg8SxMsdf/pEF5/VyUwA9t8RT -fKVsInRd386tDqJSDbSFqKTvLztr/5YCyzZzvC2YB1voko/caOGd2d/G51Ij+bXU -xEN8U4fHDBsHwPUGb31uZUhTXpL37KiOqZmXFoH2usmuvx882XvyGcV0F4tstMaR -KLKzl2PwqzAYGFexLkYKMz0TYIeN6h3b86ETazPPU49nkaEU23Dx21J2Rb3UlH+I -lDQF3wuH1QlYiTnlcVa/Zu4QQg0/iP8ALkZ06mvn9e9mOtnA8gsh4B2oLqc19VLU -bcpv40dV1H3W9Lcx9B8JYUp0c/Oyno1D7Yj3tjGcwMKECmUpHi4kksehVo0/P933 -xmFmC6eyWYVdO9upvY/vKSB7b1dMt85iWr3gnMsSfRYc6jsbSxdjOPST46UsIzjx -wa1DS6+Bv5tiaC4uC6X+0tCAZo+UOQMYUbTGRR/7g/c= ------END RSA PRIVATE KEY----- diff --git a/node_modules/public-encrypt/test/rsa.pass.pub b/node_modules/public-encrypt/test/rsa.pass.pub deleted file mode 100644 index 655cc3a4d..000000000 --- a/node_modules/public-encrypt/test/rsa.pass.pub +++ /dev/null @@ -1,9 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIIBHjANBgkqhkiG9w0BAQEFAAOCAQsAMIIBBgKB/gy7mjaWgPeFdVYDZWRCA9BN -iv3pPb0es27+FKY0hszLaOw47ExCtAWpDsH48TXAfyHBYwBLguayfk4LGIupxb+C -GMbRo3xEp0CbfY1Jby26T9vGjRC1foHDDUJG84uaRbyHqaf4i6zt4gVR+xlAEIjk -aFAAK8cOoXAT1CVqGLLljUCchL8PjaHj/yriZ/S7rdwlI3LnABxwwmLrmR/v71Wt -pmO/aNG8N+1po+QwaghTkyQ59E/ZvAuOkFWHok2q/R6PYAa2jdZ9zim0FqOP+nkQ -aEDRbBFBmBqTv5fFGfk2WsAfKf/RG0/VFd+ZeM5251TeTvXH695nlSGauVl9AgMB -AAE= ------END PUBLIC KEY----- diff --git a/node_modules/public-encrypt/test/test_cert.pem b/node_modules/public-encrypt/test/test_cert.pem deleted file mode 100644 index a3c1e4a0a..000000000 --- a/node_modules/public-encrypt/test/test_cert.pem +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDXDCCAsWgAwIBAgIJAKL0UG+mRkSPMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNV -BAYTAlVLMRQwEgYDVQQIEwtBY2tuYWNrIEx0ZDETMBEGA1UEBxMKUmh5cyBKb25l -czEQMA4GA1UEChMHbm9kZS5qczEdMBsGA1UECxMUVGVzdCBUTFMgQ2VydGlmaWNh -dGUxEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0wOTExMTEwOTUyMjJaFw0yOTExMDYw -OTUyMjJaMH0xCzAJBgNVBAYTAlVLMRQwEgYDVQQIEwtBY2tuYWNrIEx0ZDETMBEG -A1UEBxMKUmh5cyBKb25lczEQMA4GA1UEChMHbm9kZS5qczEdMBsGA1UECxMUVGVz -dCBUTFMgQ2VydGlmaWNhdGUxEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG -9w0BAQEFAAOBjQAwgYkCgYEA8d8Hc6atq78Jt1HLp9agA/wpQfsFvkYUdZ1YsdvO -kL2janjwHQgMMCy/Njal3FUEW0OLPebKZUJ8L44JBXSlVxU4zyiiSOWld8EkTetR -AVT3WKQq3ud+cnxv7g8rGRQp1UHZwmdbZ1wEfAYq8QjYx6m1ciMgRo7DaDQhD29k -d+UCAwEAAaOB4zCB4DAdBgNVHQ4EFgQUL9miTJn+HKNuTmx/oMWlZP9cd4QwgbAG -A1UdIwSBqDCBpYAUL9miTJn+HKNuTmx/oMWlZP9cd4ShgYGkfzB9MQswCQYDVQQG -EwJVSzEUMBIGA1UECBMLQWNrbmFjayBMdGQxEzARBgNVBAcTClJoeXMgSm9uZXMx -EDAOBgNVBAoTB25vZGUuanMxHTAbBgNVBAsTFFRlc3QgVExTIENlcnRpZmljYXRl -MRIwEAYDVQQDEwlsb2NhbGhvc3SCCQCi9FBvpkZEjzAMBgNVHRMEBTADAQH/MA0G -CSqGSIb3DQEBBQUAA4GBADRXXA2xSUK5W1i3oLYWW6NEDVWkTQ9RveplyeS9MOkP -e7yPcpz0+O0ZDDrxR9chAiZ7fmdBBX1Tr+pIuCrG/Ud49SBqeS5aMJGVwiSd7o1n -dhU2Sz3Q60DwJEL1VenQHiVYlWWtqXBThe9ggqRPnCfsCRTP8qifKkjk45zWPcpN ------END CERTIFICATE----- diff --git a/node_modules/public-encrypt/test/test_key.pem b/node_modules/public-encrypt/test/test_key.pem deleted file mode 100644 index 48fd93c99..000000000 --- a/node_modules/public-encrypt/test/test_key.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQDx3wdzpq2rvwm3Ucun1qAD/ClB+wW+RhR1nVix286QvaNqePAd -CAwwLL82NqXcVQRbQ4s95splQnwvjgkFdKVXFTjPKKJI5aV3wSRN61EBVPdYpCre -535yfG/uDysZFCnVQdnCZ1tnXAR8BirxCNjHqbVyIyBGjsNoNCEPb2R35QIDAQAB -AoGBAJNem9C4ftrFNGtQ2DB0Udz7uDuucepkErUy4MbFsc947GfENjDKJXr42Kx0 -kYx09ImS1vUpeKpH3xiuhwqe7tm4FsCBg4TYqQle14oxxm7TNeBwwGC3OB7hiokb -aAjbPZ1hAuNs6ms3Ybvvj6Lmxzx42m8O5DXCG2/f+KMvaNUhAkEA/ekrOsWkNoW9 -2n3m+msdVuxeek4B87EoTOtzCXb1dybIZUVv4J48VAiM43hhZHWZck2boD/hhwjC -M5NWd4oY6QJBAPPcgBVNdNZSZ8hR4ogI4nzwWrQhl9MRbqqtfOn2TK/tjMv10ALg -lPmn3SaPSNRPKD2hoLbFuHFERlcS79pbCZ0CQQChX3PuIna/gDitiJ8oQLOg7xEM -wk9TRiDK4kl2lnhjhe6PDpaQN4E4F0cTuwqLAoLHtrNWIcOAQvzKMrYdu1MhAkBm -Et3qDMnjDAs05lGT72QeN90/mPAcASf5eTTYGahv21cb6IBxM+AnwAPpqAAsHhYR -9h13Y7uYbaOjvuF23LRhAkBoI9eaSMn+l81WXOVUHnzh3ZwB4GuTyxMXXNOhuiFd -0z4LKAMh99Z4xQmqSoEkXsfM4KPpfhYjF/bwIcP5gOei ------END RSA PRIVATE KEY----- diff --git a/node_modules/public-encrypt/test/test_rsa_privkey.pem b/node_modules/public-encrypt/test/test_rsa_privkey.pem deleted file mode 100644 index 425518a06..000000000 --- a/node_modules/public-encrypt/test/test_rsa_privkey.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXgIBAAKBgQDCFENGw33yGihy92pDjZQhl0C36rPJj+CvfSC8+q28hxA161QF -NUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6Z4UMR7EOcpfdUE9Hf3m/hs+F -UR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJwoYi+1hqp1fIekaxsyQIDAQAB -AoGBAJR8ZkCUvx5kzv+utdl7T5MnordT1TvoXXJGXK7ZZ+UuvMNUCdN2QPc4sBiA -QWvLw1cSKt5DsKZ8UETpYPy8pPYnnDEz2dDYiaew9+xEpubyeW2oH4Zx71wqBtOK -kqwrXa/pzdpiucRRjk6vE6YY7EBBs/g7uanVpGibOVAEsqH1AkEA7DkjVH28WDUg -f1nqvfn2Kj6CT7nIcE3jGJsZZ7zlZmBmHFDONMLUrXR/Zm3pR5m0tCmBqa5RK95u -412jt1dPIwJBANJT3v8pnkth48bQo/fKel6uEYyboRtA5/uHuHkZ6FQF7OUkGogc -mSJluOdc5t6hI1VsLn0QZEjQZMEOWr+wKSMCQQCC4kXJEsHAve77oP6HtG/IiEn7 -kpyUXRNvFsDE0czpJJBvL/aRFUJxuRK91jhjC68sA7NsKMGg5OXb5I5Jj36xAkEA -gIT7aFOYBFwGgQAQkWNKLvySgKbAZRTeLBacpHMuQdl1DfdntvAyqpAZ0lY0RKmW -G6aFKaqQfOXKCyWoUiVknQJAXrlgySFci/2ueKlIE1QqIiLSZ8V8OlpFLRnb1pzI -7U1yQXnTAEFYM560yJlzUpOb1V4cScGd365tiSMvxLOvTA== ------END RSA PRIVATE KEY----- diff --git a/node_modules/public-encrypt/test/test_rsa_privkey_encrypted.pem b/node_modules/public-encrypt/test/test_rsa_privkey_encrypted.pem deleted file mode 100644 index 08e761719..000000000 --- a/node_modules/public-encrypt/test/test_rsa_privkey_encrypted.pem +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: AES-128-CBC,9D916E00476DFF9E70FA4BA9E3A6CB0E - -oj0VC35ShSEqlfJ0rLGgkqJCyIK+mXSsa/X/xAur+lI/RVOVTWd7oQQGTdI/0rLX -PdQR02Na3X9Rptezh6J04PfMGeFysxdT6RpC+rkHRPVbN0F4TqxSNNXzkwK70+EF -dSuDMyVKv9YN4wWDf0g6VKe4ShAH/sqICQBrVyzWyYLvH/hwZmZZ1QEab6ylIKtb -EJunwu9BxVVA04bbuATKkKjJOqDn0fG8hb4bYbyD02dJwgLePzzn36F31kcBCEHI -tESlD3RsS+EtfpfgPkplXNOhqYzkD9auDb7Zy+ZwL20fjnJb75OSGu8gOg3KTljt -mApZOg0nJ5Jk9ATAdyzyVSFOM1Hhcw12ws06Dq9KRnXgO6bbuadLTFRDdvSYDFvD -ijUb+97UolQfYIXQMqXli3EIvHr7CTWe/3mpoDgK1mtr0+923Bm97XgE7KSr0L46 -n5QpNjCZf1vbXldNmW+TRifiJMgtVdS7x0N4vqDPNEe+FelVv3U4Pz3HIOtFuWLr -ZCxlgVxJY4IsyYlV0ItQjIv8fJiAyemZdO2lA9K6h0eEF+9Apr3i79JGWUi74p5D -Ooak4le0Va9O34f6FxCGn/a54A6bhKu24Ub/0gr/e4WRa7693euEdgIAZXhtMu2Z -taU5SKjjXPzjmRCM2kINHTCENlaU4oFzTmj3TYY/jdKyNP1bHa07NhlomladkIHK -GD6HaYkcbuwvh8hOPsopSwuS+NqjnGPq9Vv4ecBC+9veDEmpIE1iR6FK9Hjrre88 -kLoMQNmA+vuc8jG4/FIHM3SauQiR1ZJ6+zkz97kcmOf+X7LRaS4j6lfFR6qHiJ6y ------END RSA PRIVATE KEY----- diff --git a/node_modules/public-encrypt/test/test_rsa_pubkey.pem b/node_modules/public-encrypt/test/test_rsa_pubkey.pem deleted file mode 100644 index b3bbf6cb9..000000000 --- a/node_modules/public-encrypt/test/test_rsa_pubkey.pem +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCFENGw33yGihy92pDjZQhl0C3 -6rPJj+CvfSC8+q28hxA161QFNUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6 -Z4UMR7EOcpfdUE9Hf3m/hs+FUR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJw -oYi+1hqp1fIekaxsyQIDAQAB ------END PUBLIC KEY----- diff --git a/node_modules/public-encrypt/withPublic.js b/node_modules/public-encrypt/withPublic.js deleted file mode 100644 index 417a1bf7b..000000000 --- a/node_modules/public-encrypt/withPublic.js +++ /dev/null @@ -1,12 +0,0 @@ -var BN = require('bn.js') -var Buffer = require('safe-buffer').Buffer - -function withPublic (paddedMsg, key) { - return Buffer.from(paddedMsg - .toRed(BN.mont(key.modulus)) - .redPow(new BN(key.publicExponent)) - .fromRed() - .toArray()) -} - -module.exports = withPublic diff --git a/node_modules/public-encrypt/xor.js b/node_modules/public-encrypt/xor.js deleted file mode 100644 index 10d2764e8..000000000 --- a/node_modules/public-encrypt/xor.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = function xor (a, b) { - var len = a.length - var i = -1 - while (++i < len) { - a[i] ^= b[i] - } - return a -} diff --git a/node_modules/punycode/LICENSE-MIT.txt b/node_modules/punycode/LICENSE-MIT.txt deleted file mode 100644 index a41e0a7ef..000000000 --- a/node_modules/punycode/LICENSE-MIT.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright Mathias Bynens - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/punycode/README.md b/node_modules/punycode/README.md deleted file mode 100644 index 7ad7d1faa..000000000 --- a/node_modules/punycode/README.md +++ /dev/null @@ -1,176 +0,0 @@ -# Punycode.js [![Build status](https://travis-ci.org/bestiejs/punycode.js.svg?branch=master)](https://travis-ci.org/bestiejs/punycode.js) [![Code coverage status](http://img.shields.io/coveralls/bestiejs/punycode.js/master.svg)](https://coveralls.io/r/bestiejs/punycode.js) [![Dependency status](https://gemnasium.com/bestiejs/punycode.js.svg)](https://gemnasium.com/bestiejs/punycode.js) - -A robust Punycode converter that fully complies to [RFC 3492](https://tools.ietf.org/html/rfc3492) and [RFC 5891](https://tools.ietf.org/html/rfc5891), and works on nearly all JavaScript platforms. - -This JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm: - -* [The C example code from RFC 3492](https://tools.ietf.org/html/rfc3492#appendix-C) -* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c) -* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c) -* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287) -* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072)) - -This project is [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with [Node.js v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc) and [io.js v1.0.0+](https://github.com/iojs/io.js/blob/v1.x/lib/punycode.js). - -## Installation - -Via [npm](https://www.npmjs.com/) (only required for Node.js releases older than v0.6.2): - -```bash -npm install punycode -``` - -Via [Bower](http://bower.io/): - -```bash -bower install punycode -``` - -Via [Component](https://github.com/component/component): - -```bash -component install bestiejs/punycode.js -``` - -In a browser: - -```html - -``` - -In [Node.js](https://nodejs.org/), [io.js](https://iojs.org/), [Narwhal](http://narwhaljs.org/), and [RingoJS](http://ringojs.org/): - -```js -var punycode = require('punycode'); -``` - -In [Rhino](http://www.mozilla.org/rhino/): - -```js -load('punycode.js'); -``` - -Using an AMD loader like [RequireJS](http://requirejs.org/): - -```js -require( - { - 'paths': { - 'punycode': 'path/to/punycode' - } - }, - ['punycode'], - function(punycode) { - console.log(punycode); - } -); -``` - -## API - -### `punycode.decode(string)` - -Converts a Punycode string of ASCII symbols to a string of Unicode symbols. - -```js -// decode domain name parts -punycode.decode('maana-pta'); // 'mañana' -punycode.decode('--dqo34k'); // '☃-⌘' -``` - -### `punycode.encode(string)` - -Converts a string of Unicode symbols to a Punycode string of ASCII symbols. - -```js -// encode domain name parts -punycode.encode('mañana'); // 'maana-pta' -punycode.encode('☃-⌘'); // '--dqo34k' -``` - -### `punycode.toUnicode(input)` - -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. - -```js -// decode domain names -punycode.toUnicode('xn--maana-pta.com'); -// → 'mañana.com' -punycode.toUnicode('xn----dqo34k.com'); -// → '☃-⌘.com' - -// decode email addresses -punycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'); -// → 'джумла@джpумлатест.bрфa' -``` - -### `punycode.toASCII(input)` - -Converts a lowercased Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that’s already in ASCII. - -```js -// encode domain names -punycode.toASCII('mañana.com'); -// → 'xn--maana-pta.com' -punycode.toASCII('☃-⌘.com'); -// → 'xn----dqo34k.com' - -// encode email addresses -punycode.toASCII('джумла@джpумлатест.bрфa'); -// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq' -``` - -### `punycode.ucs2` - -#### `punycode.ucs2.decode(string)` - -Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), 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. - -```js -punycode.ucs2.decode('abc'); -// → [0x61, 0x62, 0x63] -// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE: -punycode.ucs2.decode('\uD834\uDF06'); -// → [0x1D306] -``` - -#### `punycode.ucs2.encode(codePoints)` - -Creates a string based on an array of numeric code point values. - -```js -punycode.ucs2.encode([0x61, 0x62, 0x63]); -// → 'abc' -punycode.ucs2.encode([0x1D306]); -// → '\uD834\uDF06' -``` - -### `punycode.version` - -A string representing the current Punycode.js version number. - -## Unit tests & code coverage - -After cloning this repository, run `npm install --dev` to install the dependencies needed for Punycode.js development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`. - -Once that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, PhantomJS, and web browsers as well, use `grunt test`. - -To generate the code coverage report, use `grunt cover`. - -Feel free to fork if you see possible improvements! - -## Author - -| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | -|---| -| [Mathias Bynens](https://mathiasbynens.be/) | - -## Contributors - -| [![twitter/jdalton](https://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | -|---| -| [John-David Dalton](http://allyoucanleet.com/) | - -## License - -Punycode.js is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/punycode/package.json b/node_modules/punycode/package.json deleted file mode 100644 index 2fc07acf8..000000000 --- a/node_modules/punycode/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_from": "punycode@^1.3.2", - "_id": "punycode@1.4.1", - "_inBundle": false, - "_integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "_location": "/punycode", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "punycode@^1.3.2", - "name": "punycode", - "escapedName": "punycode", - "rawSpec": "^1.3.2", - "saveSpec": null, - "fetchSpec": "^1.3.2" - }, - "_requiredBy": [ - "/browserify" - ], - "_resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "_shasum": "c0d5a63b2718800ad8e1eb0fa5269c84dd41845e", - "_spec": "punycode@^1.3.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - }, - "bugs": { - "url": "https://github.com/bestiejs/punycode.js/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - }, - { - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - } - ], - "deprecated": false, - "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", - "devDependencies": { - "coveralls": "^2.11.4", - "grunt": "^0.4.5", - "grunt-contrib-uglify": "^0.11.0", - "grunt-shell": "^1.1.2", - "istanbul": "^0.4.1", - "qunit-extras": "^1.4.4", - "qunitjs": "~1.11.0", - "requirejs": "^2.1.22" - }, - "files": [ - "LICENSE-MIT.txt", - "punycode.js" - ], - "homepage": "https://mths.be/punycode", - "jspm": { - "map": { - "./punycode.js": { - "node": "@node/punycode" - } - } - }, - "keywords": [ - "punycode", - "unicode", - "idn", - "idna", - "dns", - "url", - "domain" - ], - "license": "MIT", - "main": "punycode.js", - "name": "punycode", - "repository": { - "type": "git", - "url": "git+https://github.com/bestiejs/punycode.js.git" - }, - "scripts": { - "test": "node tests/tests.js" - }, - "version": "1.4.1" -} diff --git a/node_modules/punycode/punycode.js b/node_modules/punycode/punycode.js deleted file mode 100644 index 2c87f6cc4..000000000 --- a/node_modules/punycode/punycode.js +++ /dev/null @@ -1,533 +0,0 @@ -/*! https://mths.be/punycode v1.4.1 by @mathias */ -;(function(root) { - - /** Detect free variables */ - var freeExports = typeof exports == 'object' && exports && - !exports.nodeType && exports; - var freeModule = typeof module == 'object' && 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 ( - typeof define == 'function' && - typeof define.amd == 'object' && - define.amd - ) { - define('punycode', function() { - return punycode; - }); - } else if (freeExports && freeModule) { - if (module.exports == freeExports) { - // in Node.js, io.js, or RingoJS v0.8.0+ - freeModule.exports = punycode; - } else { - // in Narwhal or RingoJS v0.7.0- - for (key in punycode) { - punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); - } - } - } else { - // in Rhino or a web browser - root.punycode = punycode; - } - -}(this)); diff --git a/node_modules/query-string/index.js b/node_modules/query-string/index.js deleted file mode 100644 index 2d22df2a7..000000000 --- a/node_modules/query-string/index.js +++ /dev/null @@ -1,205 +0,0 @@ -'use strict'; -var strictUriEncode = require('strict-uri-encode'); -var objectAssign = require('object-assign'); - -function encoderForArrayFormat(opts) { - switch (opts.arrayFormat) { - case 'index': - return function (key, value, index) { - return value === null ? [ - encode(key, opts), - '[', - index, - ']' - ].join('') : [ - encode(key, opts), - '[', - encode(index, opts), - ']=', - encode(value, opts) - ].join(''); - }; - - case 'bracket': - return function (key, value) { - return value === null ? encode(key, opts) : [ - encode(key, opts), - '[]=', - encode(value, opts) - ].join(''); - }; - - default: - return function (key, value) { - return value === null ? encode(key, opts) : [ - encode(key, opts), - '=', - encode(value, opts) - ].join(''); - }; - } -} - -function parserForArrayFormat(opts) { - var result; - - switch (opts.arrayFormat) { - case 'index': - return function (key, value, accumulator) { - result = /\[(\d*)\]$/.exec(key); - - key = key.replace(/\[\d*\]$/, ''); - - if (!result) { - accumulator[key] = value; - return; - } - - if (accumulator[key] === undefined) { - accumulator[key] = {}; - } - - accumulator[key][result[1]] = value; - }; - - case 'bracket': - return function (key, value, accumulator) { - result = /(\[\])$/.exec(key); - key = key.replace(/\[\]$/, ''); - - if (!result) { - accumulator[key] = value; - return; - } else if (accumulator[key] === undefined) { - accumulator[key] = [value]; - return; - } - - accumulator[key] = [].concat(accumulator[key], value); - }; - - default: - return function (key, value, accumulator) { - if (accumulator[key] === undefined) { - accumulator[key] = value; - return; - } - - accumulator[key] = [].concat(accumulator[key], value); - }; - } -} - -function encode(value, opts) { - if (opts.encode) { - return opts.strict ? strictUriEncode(value) : encodeURIComponent(value); - } - - return value; -} - -function keysSorter(input) { - if (Array.isArray(input)) { - return input.sort(); - } else if (typeof input === 'object') { - return keysSorter(Object.keys(input)).sort(function (a, b) { - return Number(a) - Number(b); - }).map(function (key) { - return input[key]; - }); - } - - return input; -} - -exports.extract = function (str) { - return str.split('?')[1] || ''; -}; - -exports.parse = function (str, opts) { - opts = objectAssign({arrayFormat: 'none'}, opts); - - var formatter = parserForArrayFormat(opts); - - // Create an object with no prototype - // https://github.com/sindresorhus/query-string/issues/47 - var ret = Object.create(null); - - if (typeof str !== 'string') { - return ret; - } - - str = str.trim().replace(/^(\?|#|&)/, ''); - - if (!str) { - return ret; - } - - str.split('&').forEach(function (param) { - var parts = param.replace(/\+/g, ' ').split('='); - // Firefox (pre 40) decodes `%3D` to `=` - // https://github.com/sindresorhus/query-string/pull/37 - var key = parts.shift(); - var val = parts.length > 0 ? parts.join('=') : undefined; - - // missing `=` should be `null`: - // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters - val = val === undefined ? null : decodeURIComponent(val); - - formatter(decodeURIComponent(key), val, ret); - }); - - return Object.keys(ret).sort().reduce(function (result, key) { - var val = ret[key]; - if (Boolean(val) && typeof val === 'object' && !Array.isArray(val)) { - // Sort object keys, not values - result[key] = keysSorter(val); - } else { - result[key] = val; - } - - return result; - }, Object.create(null)); -}; - -exports.stringify = function (obj, opts) { - var defaults = { - encode: true, - strict: true, - arrayFormat: 'none' - }; - - opts = objectAssign(defaults, opts); - - var formatter = encoderForArrayFormat(opts); - - return obj ? Object.keys(obj).sort().map(function (key) { - var val = obj[key]; - - if (val === undefined) { - return ''; - } - - if (val === null) { - return encode(key, opts); - } - - if (Array.isArray(val)) { - var result = []; - - val.slice().forEach(function (val2) { - if (val2 === undefined) { - return; - } - - result.push(formatter(key, val2, result.length)); - }); - - return result.join('&'); - } - - return encode(key, opts) + '=' + encode(val, opts); - }).filter(function (x) { - return x.length > 0; - }).join('&') : ''; -}; diff --git a/node_modules/query-string/license b/node_modules/query-string/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/query-string/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/query-string/package.json b/node_modules/query-string/package.json deleted file mode 100644 index 73b2ff1be..000000000 --- a/node_modules/query-string/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "_from": "query-string@^4.2.3", - "_id": "query-string@4.3.4", - "_inBundle": false, - "_integrity": "sha1-u7aTucqRXCMlFbIosaArYJBD2+s=", - "_location": "/query-string", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "query-string@^4.2.3", - "name": "query-string", - "escapedName": "query-string", - "rawSpec": "^4.2.3", - "saveSpec": null, - "fetchSpec": "^4.2.3" - }, - "_requiredBy": [ - "/reload-css" - ], - "_resolved": "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz", - "_shasum": "bbb693b9ca915c232515b228b1a02b609043dbeb", - "_spec": "query-string@^4.2.3", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/reload-css", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/query-string/issues" - }, - "bundleDependencies": false, - "dependencies": { - "object-assign": "^4.1.0", - "strict-uri-encode": "^1.0.0" - }, - "deprecated": false, - "description": "Parse and stringify URL query strings", - "devDependencies": { - "ava": "^0.17.0", - "xo": "^0.16.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/query-string#readme", - "keywords": [ - "browser", - "querystring", - "query", - "string", - "qs", - "param", - "parameter", - "url", - "uri", - "parse", - "stringify", - "encode", - "decode" - ], - "license": "MIT", - "name": "query-string", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/query-string.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "4.3.4" -} diff --git a/node_modules/query-string/readme.md b/node_modules/query-string/readme.md deleted file mode 100644 index f8ac0da30..000000000 --- a/node_modules/query-string/readme.md +++ /dev/null @@ -1,184 +0,0 @@ -# query-string [![Build Status](https://travis-ci.org/sindresorhus/query-string.svg?branch=master)](https://travis-ci.org/sindresorhus/query-string) - -> Parse and stringify URL [query strings](http://en.wikipedia.org/wiki/Query_string) - ---- - -

    🔥 Want to strengthen your core JavaScript skills and master ES6?
    I would personally recommend this awesome ES6 course by Wes Bos. You might also like his React course.

    - ---- - - -## Install - -``` -$ npm install --save query-string -``` - - -## Usage - -```js -const queryString = require('query-string'); - -console.log(location.search); -//=> '?foo=bar' - -const parsed = queryString.parse(location.search); -console.log(parsed); -//=> {foo: 'bar'} - -console.log(location.hash); -//=> '#token=bada55cafe' - -const parsedHash = queryString.parse(location.hash); -console.log(parsedHash); -//=> {token: 'bada55cafe'} - -parsed.foo = 'unicorn'; -parsed.ilike = 'pizza'; - -const stringified = queryString.stringify(parsed); -//=> 'foo=unicorn&ilike=pizza' - -location.search = stringified; -// note that `location.search` automatically prepends a question mark -console.log(location.search); -//=> '?foo=unicorn&ilike=pizza' -``` - - -## API - -### .parse(*string*, *[options]*) - -Parse a query string into an object. Leading `?` or `#` are ignored, so you can pass `location.search` or `location.hash` directly. - -The returned object is created with [`Object.create(null)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) and thus does not have a `prototype`. - -#### arrayFormat - -Type: `string`
    -Default: `'none'` - -Supports both `index` for an indexed array representation or `bracket` for a *bracketed* array representation. - -- `bracket`: stands for parsing correctly arrays with bracket representation on the query string, such as: - -```js -queryString.parse('foo[]=1&foo[]=2&foo[]=3', {arrayFormat: 'bracket'}); -//=> foo: [1,2,3] -``` - -- `index`: stands for parsing taking the index into account, such as: - -```js -queryString.parse('foo[0]=1&foo[1]=2&foo[3]=3', {arrayFormat: 'index'}); -//=> foo: [1,2,3] -``` - -- `none`: is the **default** option and removes any bracket representation, such as: - -```js -queryString.parse('foo=1&foo=2&foo=3'); -//=> foo: [1,2,3] -``` - -### .stringify(*object*, *[options]*) - -Stringify an object into a query string, sorting the keys. - -#### strict - -Type: `boolean`
    -Default: `true` - -Strictly encode URI components with [strict-uri-encode](https://github.com/kevva/strict-uri-encode). It uses [encodeURIComponent](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) -if set to false. You probably [don't care](https://github.com/sindresorhus/query-string/issues/42) about this option. - -#### encode - -Type: `boolean`
    -Default: `true` - -[URL encode](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) the keys and values. - -#### arrayFormat - -Type: `string`
    -Default: `'none'` - -Supports both `index` for an indexed array representation or `bracket` for a *bracketed* array representation. - -- `bracket`: stands for parsing correctly arrays with bracket representation on the query string, such as: - -```js -queryString.stringify({foo: [1,2,3]}, {arrayFormat: 'bracket'}); -// => foo[]=1&foo[]=2&foo[]=3 -``` - -- `index`: stands for parsing taking the index into account, such as: - -```js -queryString.stringify({foo: [1,2,3]}, {arrayFormat: 'index'}); -// => foo[0]=1&foo[1]=2&foo[3]=3 -``` - -- `none`: is the __default__ option and removes any bracket representation, such as: - -```js -queryString.stringify({foo: [1,2,3]}); -// => foo=1&foo=2&foo=3 -``` - -### .extract(*string*) - -Extract a query string from a URL that can be passed into `.parse()`. - - -## Nesting - -This module intentionally doesn't support nesting as it's not spec'd and varies between implementations, which causes a lot of [edge cases](https://github.com/visionmedia/node-querystring/issues). - -You're much better off just converting the object to a JSON string: - -```js -queryString.stringify({ - foo: 'bar', - nested: JSON.stringify({ - unicorn: 'cake' - }) -}); -//=> 'foo=bar&nested=%7B%22unicorn%22%3A%22cake%22%7D' -``` - -However, there is support for multiple instances of the same key: - -```js -queryString.parse('likes=cake&name=bob&likes=icecream'); -//=> {likes: ['cake', 'icecream'], name: 'bob'} - -queryString.stringify({color: ['taupe', 'chartreuse'], id: '515'}); -//=> 'color=chartreuse&color=taupe&id=515' -``` - - -## Falsy values - -Sometimes you want to unset a key, or maybe just make it present without assigning a value to it. Here is how falsy values are stringified: - -```js -queryString.stringify({foo: false}); -//=> 'foo=false' - -queryString.stringify({foo: null}); -//=> 'foo' - -queryString.stringify({foo: undefined}); -//=> '' -``` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/querystring-es3/.travis.yml b/node_modules/querystring-es3/.travis.yml deleted file mode 100644 index 895dbd362..000000000 --- a/node_modules/querystring-es3/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 diff --git a/node_modules/querystring-es3/History.md b/node_modules/querystring-es3/History.md deleted file mode 100644 index 4fddbaf78..000000000 --- a/node_modules/querystring-es3/History.md +++ /dev/null @@ -1,20 +0,0 @@ -# 0.2.0 / 2013-02-21 - - - Refactor into function per-module idiomatic style. - - Improved test coverage. - -# 0.1.0 / 2011-12-13 - - - Minor project reorganization - -# 0.0.3 / 2011-04-16 - - Support for AMD module loaders - -# 0.0.2 / 2011-04-16 - - - Ported unit tests - - Removed functionality that depended on Buffers - -# 0.0.1 / 2011-04-15 - - - Initial release diff --git a/node_modules/querystring-es3/License.md b/node_modules/querystring-es3/License.md deleted file mode 100644 index fc80e85f2..000000000 --- a/node_modules/querystring-es3/License.md +++ /dev/null @@ -1,19 +0,0 @@ - -Copyright 2012 Irakli Gozalishvili. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. diff --git a/node_modules/querystring-es3/Readme.md b/node_modules/querystring-es3/Readme.md deleted file mode 100644 index be1668df0..000000000 --- a/node_modules/querystring-es3/Readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# querystring - -[![Build Status](https://secure.travis-ci.org/mike-spainhower/querystring.png)](http://travis-ci.org/mike-spainhower/querystring) - - -[![Browser support](http://ci.testling.com/mike-spainhower/querystring.png)](http://ci.testling.com/mike-spainhower/querystring) - - - -Node's querystring module for all engines. - -## Install ## - - npm install querystring - diff --git a/node_modules/querystring-es3/decode.js b/node_modules/querystring-es3/decode.js deleted file mode 100644 index b5825c0b7..000000000 --- a/node_modules/querystring-es3/decode.js +++ /dev/null @@ -1,84 +0,0 @@ -// 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. - -'use strict'; - -// 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]'; -}; diff --git a/node_modules/querystring-es3/encode.js b/node_modules/querystring-es3/encode.js deleted file mode 100644 index 76e4cfb09..000000000 --- a/node_modules/querystring-es3/encode.js +++ /dev/null @@ -1,85 +0,0 @@ -// 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. - -'use strict'; - -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; -}; diff --git a/node_modules/querystring-es3/index.js b/node_modules/querystring-es3/index.js deleted file mode 100644 index 99826ea8a..000000000 --- a/node_modules/querystring-es3/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -exports.decode = exports.parse = require('./decode'); -exports.encode = exports.stringify = require('./encode'); diff --git a/node_modules/querystring-es3/package.json b/node_modules/querystring-es3/package.json deleted file mode 100644 index ab83a7e16..000000000 --- a/node_modules/querystring-es3/package.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "_from": "querystring-es3@~0.2.0", - "_id": "querystring-es3@0.2.1", - "_inBundle": false, - "_integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", - "_location": "/querystring-es3", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "querystring-es3@~0.2.0", - "name": "querystring-es3", - "escapedName": "querystring-es3", - "rawSpec": "~0.2.0", - "saveSpec": null, - "fetchSpec": "~0.2.0" - }, - "_requiredBy": [ - "/browserify" - ], - "_resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "_shasum": "9ec61f79049875707d69414596fd907a4d711e73", - "_spec": "querystring-es3@~0.2.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "Irakli Gozalishvili", - "email": "rfobic@gmail.com" - }, - "bugs": { - "url": "http://github.com/mike-spainhower/querystring/issues/" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Node's querystring module for all engines. (ES3 compat fork)", - "devDependencies": { - "phantomify": "~0.x.0", - "retape": "~0.x.0", - "tape": "~0.1.5", - "test": "~0.x.0" - }, - "engines": { - "node": ">=0.4.x" - }, - "homepage": "https://github.com/mike-spainhower/querystring#readme", - "id": "querystring-es3", - "keywords": [ - "commonjs", - "query", - "querystring" - ], - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/Gozala/enchain/License.md" - } - ], - "name": "querystring-es3", - "repository": { - "type": "git", - "url": "git://github.com/mike-spainhower/querystring.git", - "web": "https://github.com/mike-spainhower/querystring" - }, - "scripts": { - "test": "npm run test-node && npm run test-browser && npm run test-tap", - "test-browser": "node ./node_modules/phantomify/bin/cmd.js ./test/common-index.js", - "test-node": "node ./test/common-index.js", - "test-tap": "node ./test/tap-index.js" - }, - "testling": { - "files": "test/tap-index.js", - "browsers": { - "iexplore": [ - 9, - 10 - ], - "chrome": [ - 16, - 20, - 25, - "canary" - ], - "firefox": [ - 10, - 15, - 16, - 17, - 18, - "nightly" - ], - "safari": [ - 5, - 6 - ], - "opera": [ - 12 - ] - } - }, - "version": "0.2.1" -} diff --git a/node_modules/querystring-es3/test/common-index.js b/node_modules/querystring-es3/test/common-index.js deleted file mode 100644 index f356f9875..000000000 --- a/node_modules/querystring-es3/test/common-index.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; - -require("test").run(require("./index")) \ No newline at end of file diff --git a/node_modules/querystring-es3/test/index.js b/node_modules/querystring-es3/test/index.js deleted file mode 100644 index 62eb2ac89..000000000 --- a/node_modules/querystring-es3/test/index.js +++ /dev/null @@ -1,210 +0,0 @@ -// 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. - -"use strict"; - -// test using assert -var qs = require('../'); - -// folding block, commented to pass gjslint -// {{{ -// [ wonkyQS, canonicalQS, obj ] -var qsTestCases = [ - ['foo=918854443121279438895193', - 'foo=918854443121279438895193', - {'foo': '918854443121279438895193'}], - ['foo=bar', 'foo=bar', {'foo': 'bar'}], - ['foo=bar&foo=quux', 'foo=bar&foo=quux', {'foo': ['bar', 'quux']}], - ['foo=1&bar=2', 'foo=1&bar=2', {'foo': '1', 'bar': '2'}], - ['my+weird+field=q1%212%22%27w%245%267%2Fz8%29%3F', - 'my%20weird%20field=q1!2%22\'w%245%267%2Fz8)%3F', - {'my weird field': 'q1!2"\'w$5&7/z8)?' }], - ['foo%3Dbaz=bar', 'foo%3Dbaz=bar', {'foo=baz': 'bar'}], - ['foo=baz=bar', 'foo=baz%3Dbar', {'foo': 'baz=bar'}], - ['str=foo&arr=1&arr=2&arr=3&somenull=&undef=', - 'str=foo&arr=1&arr=2&arr=3&somenull=&undef=', - { 'str': 'foo', - 'arr': ['1', '2', '3'], - 'somenull': '', - 'undef': ''}], - [' foo = bar ', '%20foo%20=%20bar%20', {' foo ': ' bar '}], - // disable test that fails ['foo=%zx', 'foo=%25zx', {'foo': '%zx'}], - ['foo=%EF%BF%BD', 'foo=%EF%BF%BD', {'foo': '\ufffd' }], - // See: https://github.com/joyent/node/issues/1707 - ['hasOwnProperty=x&toString=foo&valueOf=bar&__defineGetter__=baz', - 'hasOwnProperty=x&toString=foo&valueOf=bar&__defineGetter__=baz', - { hasOwnProperty: 'x', - toString: 'foo', - valueOf: 'bar', - __defineGetter__: 'baz' }], - // See: https://github.com/joyent/node/issues/3058 - ['foo&bar=baz', 'foo=&bar=baz', { foo: '', bar: 'baz' }] -]; - -// [ wonkyQS, canonicalQS, obj ] -var qsColonTestCases = [ - ['foo:bar', 'foo:bar', {'foo': 'bar'}], - ['foo:bar;foo:quux', 'foo:bar;foo:quux', {'foo': ['bar', 'quux']}], - ['foo:1&bar:2;baz:quux', - 'foo:1%26bar%3A2;baz:quux', - {'foo': '1&bar:2', 'baz': 'quux'}], - ['foo%3Abaz:bar', 'foo%3Abaz:bar', {'foo:baz': 'bar'}], - ['foo:baz:bar', 'foo:baz%3Abar', {'foo': 'baz:bar'}] -]; - -// [wonkyObj, qs, canonicalObj] -var extendedFunction = function() {}; -extendedFunction.prototype = {a: 'b'}; -var qsWeirdObjects = [ - [{regexp: /./g}, 'regexp=', {'regexp': ''}], - [{regexp: new RegExp('.', 'g')}, 'regexp=', {'regexp': ''}], - [{fn: function() {}}, 'fn=', {'fn': ''}], - [{fn: new Function('')}, 'fn=', {'fn': ''}], - [{math: Math}, 'math=', {'math': ''}], - [{e: extendedFunction}, 'e=', {'e': ''}], - [{d: new Date()}, 'd=', {'d': ''}], - [{d: Date}, 'd=', {'d': ''}], - [{f: new Boolean(false), t: new Boolean(true)}, 'f=&t=', {'f': '', 't': ''}], - [{f: false, t: true}, 'f=false&t=true', {'f': 'false', 't': 'true'}], - [{n: null}, 'n=', {'n': ''}], - [{nan: NaN}, 'nan=', {'nan': ''}], - [{inf: Infinity}, 'inf=', {'inf': ''}] -]; -// }}} - -var qsNoMungeTestCases = [ - ['', {}], - ['foo=bar&foo=baz', {'foo': ['bar', 'baz']}], - ['blah=burp', {'blah': 'burp'}], - ['gragh=1&gragh=3&goo=2', {'gragh': ['1', '3'], 'goo': '2'}], - ['frappucino=muffin&goat%5B%5D=scone&pond=moose', - {'frappucino': 'muffin', 'goat[]': 'scone', 'pond': 'moose'}], - ['trololol=yes&lololo=no', {'trololol': 'yes', 'lololo': 'no'}] -]; - -exports['test basic'] = function(assert) { - assert.strictEqual('918854443121279438895193', - qs.parse('id=918854443121279438895193').id, - 'prase id=918854443121279438895193'); -}; - -exports['test that the canonical qs is parsed properly'] = function(assert) { - qsTestCases.forEach(function(testCase) { - assert.deepEqual(testCase[2], qs.parse(testCase[0]), - 'parse ' + testCase[0]); - }); -}; - - -exports['test that the colon test cases can do the same'] = function(assert) { - qsColonTestCases.forEach(function(testCase) { - assert.deepEqual(testCase[2], qs.parse(testCase[0], ';', ':'), - 'parse ' + testCase[0] + ' -> ; :'); - }); -}; - -exports['test the weird objects, that they get parsed properly'] = function(assert) { - qsWeirdObjects.forEach(function(testCase) { - assert.deepEqual(testCase[2], qs.parse(testCase[1]), - 'parse ' + testCase[1]); - }); -}; - -exports['test non munge test cases'] = function(assert) { - qsNoMungeTestCases.forEach(function(testCase) { - assert.deepEqual(testCase[0], qs.stringify(testCase[1], '&', '=', false), - 'stringify ' + JSON.stringify(testCase[1]) + ' -> & ='); - }); -}; - -exports['test the nested qs-in-qs case'] = function(assert) { - var f = qs.parse('a=b&q=x%3Dy%26y%3Dz'); - f.q = qs.parse(f.q); - assert.deepEqual(f, { a: 'b', q: { x: 'y', y: 'z' } }, - 'parse a=b&q=x%3Dy%26y%3Dz'); -}; - -exports['test nested in colon'] = function(assert) { - var f = qs.parse('a:b;q:x%3Ay%3By%3Az', ';', ':'); - f.q = qs.parse(f.q, ';', ':'); - assert.deepEqual(f, { a: 'b', q: { x: 'y', y: 'z' } }, - 'parse a:b;q:x%3Ay%3By%3Az -> ; :'); -}; - -exports['test stringifying'] = function(assert) { - qsTestCases.forEach(function(testCase) { - assert.equal(testCase[1], qs.stringify(testCase[2]), - 'stringify ' + JSON.stringify(testCase[2])); - }); - - qsColonTestCases.forEach(function(testCase) { - assert.equal(testCase[1], qs.stringify(testCase[2], ';', ':'), - 'stringify ' + JSON.stringify(testCase[2]) + ' -> ; :'); - }); - - qsWeirdObjects.forEach(function(testCase) { - assert.equal(testCase[1], qs.stringify(testCase[0]), - 'stringify ' + JSON.stringify(testCase[0])); - }); -}; - -exports['test stringifying nested'] = function(assert) { - var f = qs.stringify({ - a: 'b', - q: qs.stringify({ - x: 'y', - y: 'z' - }) - }); - assert.equal(f, 'a=b&q=x%3Dy%26y%3Dz', - JSON.stringify({ - a: 'b', - 'qs.stringify -> q': { - x: 'y', - y: 'z' - } - })); - - var threw = false; - try { qs.parse(undefined); } catch(error) { threw = true; } - assert.ok(!threw, "does not throws on undefined"); -}; - -exports['test nested in colon'] = function(assert) { - var f = qs.stringify({ - a: 'b', - q: qs.stringify({ - x: 'y', - y: 'z' - }, ';', ':') - }, ';', ':'); - assert.equal(f, 'a:b;q:x%3Ay%3By%3Az', - 'stringify ' + JSON.stringify({ - a: 'b', - 'qs.stringify -> q': { - x: 'y', - y: 'z' - } - }) + ' -> ; : '); - - - assert.deepEqual({}, qs.parse(), 'parse undefined'); -}; diff --git a/node_modules/querystring-es3/test/tap-index.js b/node_modules/querystring-es3/test/tap-index.js deleted file mode 100644 index 70679b3fc..000000000 --- a/node_modules/querystring-es3/test/tap-index.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; - -require("retape")(require("./index")) \ No newline at end of file diff --git a/node_modules/querystring/.History.md.un~ b/node_modules/querystring/.History.md.un~ deleted file mode 100644 index c96a7dd8c8c86e2e4b6af0478b1bc122b929528d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7960 zcmeI1O>0v@6ozk__}SL4mLj+rD1;VG%uP&mDblr2L05iY+Y|yOx0H0*MfHaW;zHes zKR`F`T=@gs`hk0K;X==IGN(>L?aJBB3n!DAdy@?3;XU`)S!)7yiU;&V2&^z8MM z_O~xGQz3{XCeC6fM$1j%OzWXru>3x=E^Ac0e$!mpo5+#Xq5{S_vTkUMz zuW+=IJ^08`5g#ydh*13&{hirr8vkDgRy%8%;>fZe=l$2h@R$S`78YHj-l(_SW!G%v zd987!mUrA@dr#qUMp?pSNJ_l70&gjVNBWOSOu%a%Tp;ai+aKUqn`0q4k1WKLz+3(o zyv!FzkZ`p#0hgesNr*^7R0*PsAtG=bmpCcGHEe#=fQ9Dmz#6q#%RwOxR6L$U>@xmX=tfkh&gPir=9Y8Y%7Y^LoR2jl5aQTOJ*#w5#Al zqW${GB%vb7^QPhnO@ ZFiAa69(m~N+kCx4vvqx5-`@NB>JPML-n9S# diff --git a/node_modules/querystring/.Readme.md.un~ b/node_modules/querystring/.Readme.md.un~ deleted file mode 100644 index 71613b59ba1b551647a6ba1b47180a44ac70212b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3225 zcmeHJyGjE=6dhxHHnxHY5fx2g(wK;m2tL4CM2U#VlB~&Ul8rO75g(v-*8YIKrG>3O zV4?PwVrgY5de3Y|*AUQ%YqbYXhTNHb%sprCofWHezFeNSA6e+|G>1{HPna%a9q zp?4>dB~Fx_m_f}bEc`<0w6uAF!lBtZI=41*ERw;dU*sfHzCq6QQM z(+C8rAq#$jR2#4V2qA}7&H7al*JZhx3SRRAv~Tn57%zhgoI^2MwfumpG2qeK*kR#H{5#i5Mo3~;7 L>#09+@^tYI$G;b9 diff --git a/node_modules/querystring/.package.json.un~ b/node_modules/querystring/.package.json.un~ deleted file mode 100644 index d86fe314c5aaeffce89d94a968668c5dc133ba5b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5710 zcmeHLOKTKC5T3-u_&`k*#kb>v5n;0rb>mwIL_}{n=tV>}yR&9w=i$t5j7Sb%Jt!(3 z#j~D7Px=RZ9K@@FM-@en9!0;erhB)O4H6P_n}%advIf~Yu2>IpEI{p6-nwZjxRQ_iVj17;! z7CJ2J*JjwJ>o);g0aDRz+b#V7{%--S(oLa`NW0+oTY(hIAm$NE$+IKoH;x2dTe_-tEeJ1%Z=M1ZOox*jx?OI z;BL#4u&_;g6>?JdLDdHdv+jf{mN*-jUEZjtZacu}T8rR|E0G&EBxgdCoe_|JP<3oZ zXPoEn(AB0BU5^`)>tD`Yi8Hi<9^r$q^VYWWHHj*1MG`eAH4Fdhb|Wvc+)NN4N9X%K3+ zEKs&QiS=YhP9l&-zN|bI3e_tiYvT!kL8pQ(EANE5Xp-L@KxffBJhNzqo*gxPshdMm zK?etI-&BrA!L`_lYweI$<0LH0a(RkNUQlh;oj4y(l>J8FxwY&0ao5jRyeew2 zos-I(uLPbK_$!kb(xC? zt2)(Y$kTvqZ^(7(P+!ME0h4Y(wM`b+Ts#Sv$$c2M2V_`zKp#dnPzh76GZof@h|h5W zrq(2C3>?Ad7${aGii>=7F@&MYL=<>>1t?2eW`Ch`$$B+bb0en~OsT8j8I-=rHMHF} zQ!I6w(N~VkwQ}StEA1tvTv3d)?|!(`M!&jb5IRx0!$fg^vZ61UbrHAJ%kDHfW@cd~ z(O;#|l`L}{QeLLg%tDteqM4b6{W(rzm1mM!mM6vG7$z~Zi~!6m;A}dp-<-?}fHC2X k7WsA2O1YvJ7SZOxmG@1!>PxuN-yAeobAJIY-TeCGFNStew*UYD diff --git a/node_modules/querystring/.travis.yml b/node_modules/querystring/.travis.yml deleted file mode 100644 index 895dbd362..000000000 --- a/node_modules/querystring/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 diff --git a/node_modules/querystring/History.md b/node_modules/querystring/History.md deleted file mode 100644 index 4fddbaf78..000000000 --- a/node_modules/querystring/History.md +++ /dev/null @@ -1,20 +0,0 @@ -# 0.2.0 / 2013-02-21 - - - Refactor into function per-module idiomatic style. - - Improved test coverage. - -# 0.1.0 / 2011-12-13 - - - Minor project reorganization - -# 0.0.3 / 2011-04-16 - - Support for AMD module loaders - -# 0.0.2 / 2011-04-16 - - - Ported unit tests - - Removed functionality that depended on Buffers - -# 0.0.1 / 2011-04-15 - - - Initial release diff --git a/node_modules/querystring/License.md b/node_modules/querystring/License.md deleted file mode 100644 index fc80e85f2..000000000 --- a/node_modules/querystring/License.md +++ /dev/null @@ -1,19 +0,0 @@ - -Copyright 2012 Irakli Gozalishvili. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. diff --git a/node_modules/querystring/Readme.md b/node_modules/querystring/Readme.md deleted file mode 100644 index a4fe2520d..000000000 --- a/node_modules/querystring/Readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# querystring - -[![Build Status](https://secure.travis-ci.org/Gozala/querystring.png)](http://travis-ci.org/Gozala/querystring) - - -[![Browser support](http://ci.testling.com/Gozala/querystring.png)](http://ci.testling.com/Gozala/querystring) - - - -Node's querystring module for all engines. - -## Install ## - - npm install querystring - diff --git a/node_modules/querystring/decode.js b/node_modules/querystring/decode.js deleted file mode 100644 index a6518b8ff..000000000 --- a/node_modules/querystring/decode.js +++ /dev/null @@ -1,80 +0,0 @@ -// 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. - -'use strict'; - -// 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 (Array.isArray(obj[k])) { - obj[k].push(v); - } else { - obj[k] = [obj[k], v]; - } - } - - return obj; -}; diff --git a/node_modules/querystring/encode.js b/node_modules/querystring/encode.js deleted file mode 100644 index 4f2b561b2..000000000 --- a/node_modules/querystring/encode.js +++ /dev/null @@ -1,64 +0,0 @@ -// 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. - -'use strict'; - -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 Object.keys(obj).map(function(k) { - var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; - if (Array.isArray(obj[k])) { - return obj[k].map(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)); -}; diff --git a/node_modules/querystring/index.js b/node_modules/querystring/index.js deleted file mode 100644 index 99826ea8a..000000000 --- a/node_modules/querystring/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -exports.decode = exports.parse = require('./decode'); -exports.encode = exports.stringify = require('./encode'); diff --git a/node_modules/querystring/package.json b/node_modules/querystring/package.json deleted file mode 100644 index 2a0cb9d44..000000000 --- a/node_modules/querystring/package.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "_from": "querystring@0.2.0", - "_id": "querystring@0.2.0", - "_inBundle": false, - "_integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "_location": "/querystring", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "querystring@0.2.0", - "name": "querystring", - "escapedName": "querystring", - "rawSpec": "0.2.0", - "saveSpec": null, - "fetchSpec": "0.2.0" - }, - "_requiredBy": [ - "/url" - ], - "_resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "_shasum": "b209849203bb25df820da756e747005878521620", - "_spec": "querystring@0.2.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/url", - "author": { - "name": "Irakli Gozalishvili", - "email": "rfobic@gmail.com" - }, - "bugs": { - "url": "http://github.com/Gozala/querystring/issues/" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Node's querystring module for all engines.", - "devDependencies": { - "phantomify": "~0.x.0", - "retape": "~0.x.0", - "tape": "~0.1.5", - "test": "~0.x.0" - }, - "engines": { - "node": ">=0.4.x" - }, - "homepage": "https://github.com/Gozala/querystring#readme", - "id": "querystring", - "keywords": [ - "commonjs", - "query", - "querystring" - ], - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/Gozala/enchain/License.md" - } - ], - "name": "querystring", - "repository": { - "type": "git", - "url": "git://github.com/Gozala/querystring.git", - "web": "https://github.com/Gozala/querystring" - }, - "scripts": { - "test": "npm run test-node && npm run test-browser && npm run test-tap", - "test-browser": "node ./node_modules/phantomify/bin/cmd.js ./test/common-index.js", - "test-node": "node ./test/common-index.js", - "test-tap": "node ./test/tap-index.js" - }, - "testling": { - "files": "test/tap-index.js", - "browsers": { - "iexplore": [ - 9, - 10 - ], - "chrome": [ - 16, - 20, - 25, - "canary" - ], - "firefox": [ - 10, - 15, - 16, - 17, - 18, - "nightly" - ], - "safari": [ - 5, - 6 - ], - "opera": [ - 12 - ] - } - }, - "version": "0.2.0" -} diff --git a/node_modules/querystring/test/.index.js.un~ b/node_modules/querystring/test/.index.js.un~ deleted file mode 100644 index 898eceddc9e485e85275e41f9b8b98294bb3fe08..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 975 zcmWH`%$*;a=aT=Ffr(>^0h6blXhl42hkT^^Cju)3aORMz^9E7#J=A zF*0BTa+sh3AR2}l0?m@ovVde68R9P>DS$G8!VCjM7vN0bq2T0Y?V| z!&eEQ*`RoY1wSY%7)%?%(FA6L_)q|fPnbG}(P)AN3$18)G%;e2CfTCY!qUv5R1Kw) b)Z!8)O}(PhJdM ; :'); - }); -}; - -exports['test the weird objects, that they get parsed properly'] = function(assert) { - qsWeirdObjects.forEach(function(testCase) { - assert.deepEqual(testCase[2], qs.parse(testCase[1]), - 'parse ' + testCase[1]); - }); -}; - -exports['test non munge test cases'] = function(assert) { - qsNoMungeTestCases.forEach(function(testCase) { - assert.deepEqual(testCase[0], qs.stringify(testCase[1], '&', '=', false), - 'stringify ' + JSON.stringify(testCase[1]) + ' -> & ='); - }); -}; - -exports['test the nested qs-in-qs case'] = function(assert) { - var f = qs.parse('a=b&q=x%3Dy%26y%3Dz'); - f.q = qs.parse(f.q); - assert.deepEqual(f, { a: 'b', q: { x: 'y', y: 'z' } }, - 'parse a=b&q=x%3Dy%26y%3Dz'); -}; - -exports['test nested in colon'] = function(assert) { - var f = qs.parse('a:b;q:x%3Ay%3By%3Az', ';', ':'); - f.q = qs.parse(f.q, ';', ':'); - assert.deepEqual(f, { a: 'b', q: { x: 'y', y: 'z' } }, - 'parse a:b;q:x%3Ay%3By%3Az -> ; :'); -}; - -exports['test stringifying'] = function(assert) { - qsTestCases.forEach(function(testCase) { - assert.equal(testCase[1], qs.stringify(testCase[2]), - 'stringify ' + JSON.stringify(testCase[2])); - }); - - qsColonTestCases.forEach(function(testCase) { - assert.equal(testCase[1], qs.stringify(testCase[2], ';', ':'), - 'stringify ' + JSON.stringify(testCase[2]) + ' -> ; :'); - }); - - qsWeirdObjects.forEach(function(testCase) { - assert.equal(testCase[1], qs.stringify(testCase[0]), - 'stringify ' + JSON.stringify(testCase[0])); - }); -}; - -exports['test stringifying nested'] = function(assert) { - var f = qs.stringify({ - a: 'b', - q: qs.stringify({ - x: 'y', - y: 'z' - }) - }); - assert.equal(f, 'a=b&q=x%3Dy%26y%3Dz', - JSON.stringify({ - a: 'b', - 'qs.stringify -> q': { - x: 'y', - y: 'z' - } - })); - - var threw = false; - try { qs.parse(undefined); } catch(error) { threw = true; } - assert.ok(!threw, "does not throws on undefined"); -}; - -exports['test nested in colon'] = function(assert) { - var f = qs.stringify({ - a: 'b', - q: qs.stringify({ - x: 'y', - y: 'z' - }, ';', ':') - }, ';', ':'); - assert.equal(f, 'a:b;q:x%3Ay%3By%3Az', - 'stringify ' + JSON.stringify({ - a: 'b', - 'qs.stringify -> q': { - x: 'y', - y: 'z' - } - }) + ' -> ; : '); - - - assert.deepEqual({}, qs.parse(), 'parse undefined'); -}; diff --git a/node_modules/querystring/test/tap-index.js b/node_modules/querystring/test/tap-index.js deleted file mode 100644 index 70679b3fc..000000000 --- a/node_modules/querystring/test/tap-index.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; - -require("retape")(require("./index")) \ No newline at end of file diff --git a/node_modules/randomatic/LICENSE b/node_modules/randomatic/LICENSE deleted file mode 100644 index 38a4a0bf1..000000000 --- a/node_modules/randomatic/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013-2017, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/randomatic/README.md b/node_modules/randomatic/README.md deleted file mode 100644 index 292e64225..000000000 --- a/node_modules/randomatic/README.md +++ /dev/null @@ -1,193 +0,0 @@ -# randomatic [![NPM version](https://img.shields.io/npm/v/randomatic.svg?style=flat)](https://www.npmjs.com/package/randomatic) [![NPM monthly downloads](https://img.shields.io/npm/dm/randomatic.svg?style=flat)](https://npmjs.org/package/randomatic) [![NPM total downloads](https://img.shields.io/npm/dt/randomatic.svg?style=flat)](https://npmjs.org/package/randomatic) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/randomatic.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/randomatic) - -> Generate randomized strings of a specified length using simple character sequences. The original generate-password. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save randomatic -``` - -## Usage - -```js -var randomize = require('randomatic'); -``` - -## API - -```js -randomize(pattern, length, options); -randomize.isCrypto; -``` - -* `pattern` **{String}**: (required) The pattern to use for randomizing -* `length` **{Number}**: (optional) The length of the string to generate -* `options` **{Object}**: (optional) See available [options](#options) -* `randomize.isCrypto` will be `true` when a cryptographically secure function is being used to generate random numbers. The value will be `false` when the function in use is `Math.random`. - -### pattern - -> The pattern to use for randomizing - -Patterns can contain any combination of the below characters, specified in any order. - -**Example:** - -To generate a 10-character randomized string using all available characters: - -```js -randomize('*', 10); -//=> 'x2_^-5_T[$' - -randomize('Aa0!', 10); -//=> 'LV3u~BSGhw' -``` - -* `a`: Lowercase alpha characters (`abcdefghijklmnopqrstuvwxyz'`) -* `A`: Uppercase alpha characters (`ABCDEFGHIJKLMNOPQRSTUVWXYZ'`) -* `0`: Numeric characters (`0123456789'`) -* `!`: Special characters (`~!@#$%^&()_+-={}[];\',.`) -* `*`: All characters (all of the above combined) -* `?`: Custom characters (pass a string of custom characters to the options) - -### length - -> The length of the string to generate - -**Examples:** - -* `randomize('A', 5)` will generate a 5-character, uppercase, alphabetical, randomized string, e.g. `KDJWJ`. -* `randomize('0', 2)` will generate a 2-digit random number -* `randomize('0', 3)` will generate a 3-digit random number -* `randomize('0', 12)` will generate a 12-digit random number -* `randomize('A0', 16)` will generate a 16-character, alpha-numeric randomized string - -If `length` is left undefined, the length of the pattern in the first parameter will be used. For example: - -* `randomize('00')` will generate a 2-digit random number -* `randomize('000')` will generate a 3-digit random number -* `randomize('0000')` will generate a 4-digit random number... -* `randomize('AAAAA')` will generate a 5-character, uppercase alphabetical random string... - -These are just examples, [see the tests](./test.js) for more use cases and examples. - -## options - -> These are options that can be passed as the third argument. - -#### chars - -Type: `String` - -Default: `undefined` - -Define a custom string to be randomized. - -**Example:** - -* `randomize('?', 20, {chars: 'jonschlinkert'})` will generate a 20-character randomized string from the letters contained in `jonschlinkert`. -* `randomize('?', {chars: 'jonschlinkert'})` will generate a 13-character randomized string from the letters contained in `jonschlinkert`. - -#### exclude - -Type: `String|Array` - -Default: `undefined` - -Specify a string or array of characters can are excluded from the possible characters used to generate the randomized string. - -**Example:** - -* `randomize('*', 20, { exclude: '0oOiIlL1' })` will generate a 20-character randomized string using all of possible characters except for `0oOiIlL1`. - -## Usage Examples - -* `randomize('A', 4)` (_whitespace insenstive_) would result in randomized 4-digit uppercase letters, like, `ZAKH`, `UJSL`... etc. -* `randomize('AAAA')` is equivelant to `randomize('A', 4)` -* `randomize('AAA0')` and `randomize('AA00')` and `randomize('A0A0')` are equivelant to `randomize('A0', 4)` -* `randomize('aa')`: results in double-digit, randomized, lower-case letters (`abcdefghijklmnopqrstuvwxyz`) -* `randomize('AAA')`: results in triple-digit, randomized, upper-case letters (`ABCDEFGHIJKLMNOPQRSTUVWXYZ`) -* `randomize('0', 6)`: results in six-digit, randomized numbers (`0123456789`) -* `randomize('!', 5)`: results in single-digit randomized, _valid_ non-letter characters (`~!@#$%^&()_+-={}[] -* `randomize('A!a0', 9)`: results in nine-digit, randomized characters (any of the above) - -_The order in which the characters are defined is insignificant._ - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    - -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [pad-left](https://www.npmjs.com/package/pad-left): Left pad a string with zeros or a specified string. Fastest implementation. | [homepage](https://github.com/jonschlinkert/pad-left "Left pad a string with zeros or a specified string. Fastest implementation.") -* [pad-right](https://www.npmjs.com/package/pad-right): Right pad a string with zeros or a specified string. Fastest implementation. | [homepage](https://github.com/jonschlinkert/pad-right "Right pad a string with zeros or a specified string. Fastest implementation.") -* [repeat-string](https://www.npmjs.com/package/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string. | [homepage](https://github.com/jonschlinkert/repeat-string "Repeat the given string n times. Fastest implementation for repeating a string.") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 56 | [jonschlinkert](https://github.com/jonschlinkert) | -| 6 | [doowb](https://github.com/doowb) | -| 4 | [kivlor](https://github.com/kivlor) | -| 2 | [realityking](https://github.com/realityking) | -| 2 | [ywpark1](https://github.com/ywpark1) | -| 1 | [TrySound](https://github.com/TrySound) | -| 1 | [drag0s](https://github.com/drag0s) | -| 1 | [paulmillr](https://github.com/paulmillr) | -| 1 | [sunknudsen](https://github.com/sunknudsen) | -| 1 | [faizulhaque-tp](https://github.com/faizulhaque-tp) | -| 1 | [michaelrhodes](https://github.com/michaelrhodes) | - -### Author - -**Jon Schlinkert** - -* [GitHub Profile](https://github.com/jonschlinkert) -* [Twitter Profile](https://twitter.com/jonschlinkert) -* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) - -### License - -Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on October 23, 2018._ \ No newline at end of file diff --git a/node_modules/randomatic/index.js b/node_modules/randomatic/index.js deleted file mode 100644 index dc636fb1b..000000000 --- a/node_modules/randomatic/index.js +++ /dev/null @@ -1,95 +0,0 @@ -/*! - * randomatic - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var isNumber = require('is-number'); -var typeOf = require('kind-of'); -var mathRandom = require('math-random'); - -/** - * Expose `randomatic` - */ - -module.exports = randomatic; -module.exports.isCrypto = !!mathRandom.cryptographic; - -/** - * Available mask characters - */ - -var type = { - lower: 'abcdefghijklmnopqrstuvwxyz', - upper: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', - number: '0123456789', - special: '~!@#$%^&()_+-={}[];\',.' -}; - -type.all = type.lower + type.upper + type.number + type.special; - -/** - * Generate random character sequences of a specified `length`, - * based on the given `pattern`. - * - * @param {String} `pattern` The pattern to use for generating the random string. - * @param {String} `length` The length of the string to generate. - * @param {String} `options` - * @return {String} - * @api public - */ - -function randomatic(pattern, length, options) { - if (typeof pattern === 'undefined') { - throw new Error('randomatic expects a string or number.'); - } - - var custom = false; - if (arguments.length === 1) { - if (typeof pattern === 'string') { - length = pattern.length; - - } else if (isNumber(pattern)) { - options = {}; - length = pattern; - pattern = '*'; - } - } - - if (typeOf(length) === 'object' && length.hasOwnProperty('chars')) { - options = length; - pattern = options.chars; - length = pattern.length; - custom = true; - } - - var opts = options || {}; - var mask = ''; - var res = ''; - - // Characters to be used - if (pattern.indexOf('?') !== -1) mask += opts.chars; - if (pattern.indexOf('a') !== -1) mask += type.lower; - if (pattern.indexOf('A') !== -1) mask += type.upper; - if (pattern.indexOf('0') !== -1) mask += type.number; - if (pattern.indexOf('!') !== -1) mask += type.special; - if (pattern.indexOf('*') !== -1) mask += type.all; - if (custom) mask += pattern; - - // Characters to exclude - if (opts.exclude) { - var exclude = typeOf(opts.exclude) === 'string' ? opts.exclude : opts.exclude.join(''); - exclude = exclude.replace(new RegExp('[\\]]+', 'g'), ''); - mask = mask.replace(new RegExp('[' + exclude + ']+', 'g'), ''); - - if(opts.exclude.indexOf(']') !== -1) mask = mask.replace(new RegExp('[\\]]+', 'g'), ''); - } - - while (length--) { - res += mask.charAt(parseInt(mathRandom() * mask.length, 10)); - } - return res; -}; diff --git a/node_modules/randomatic/node_modules/is-number/LICENSE b/node_modules/randomatic/node_modules/is-number/LICENSE deleted file mode 100644 index 3f2eca18f..000000000 --- a/node_modules/randomatic/node_modules/is-number/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/randomatic/node_modules/is-number/README.md b/node_modules/randomatic/node_modules/is-number/README.md deleted file mode 100644 index 6436992dc..000000000 --- a/node_modules/randomatic/node_modules/is-number/README.md +++ /dev/null @@ -1,135 +0,0 @@ -# is-number [![NPM version](https://img.shields.io/npm/v/is-number.svg?style=flat)](https://www.npmjs.com/package/is-number) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![NPM total downloads](https://img.shields.io/npm/dt/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-number.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-number) - -> Returns true if the value is a number. comprehensive tests. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save is-number -``` - -## Usage - -To understand some of the rationale behind the decisions made in this library (and to learn about some oddities of number evaluation in JavaScript), [see this gist](https://gist.github.com/jonschlinkert/e30c70c713da325d0e81). - -```js -var isNumber = require('is-number'); -``` - -### true - -See the [tests](./test.js) for more examples. - -```js -isNumber(5e3) //=> 'true' -isNumber(0xff) //=> 'true' -isNumber(-1.1) //=> 'true' -isNumber(0) //=> 'true' -isNumber(1) //=> 'true' -isNumber(1.1) //=> 'true' -isNumber(10) //=> 'true' -isNumber(10.10) //=> 'true' -isNumber(100) //=> 'true' -isNumber('-1.1') //=> 'true' -isNumber('0') //=> 'true' -isNumber('012') //=> 'true' -isNumber('0xff') //=> 'true' -isNumber('1') //=> 'true' -isNumber('1.1') //=> 'true' -isNumber('10') //=> 'true' -isNumber('10.10') //=> 'true' -isNumber('100') //=> 'true' -isNumber('5e3') //=> 'true' -isNumber(parseInt('012')) //=> 'true' -isNumber(parseFloat('012')) //=> 'true' -``` - -### False - -See the [tests](./test.js) for more examples. - -```js -isNumber('foo') //=> 'false' -isNumber([1]) //=> 'false' -isNumber([]) //=> 'false' -isNumber(function () {}) //=> 'false' -isNumber(Infinity) //=> 'false' -isNumber(NaN) //=> 'false' -isNumber(new Array('abc')) //=> 'false' -isNumber(new Array(2)) //=> 'false' -isNumber(new Buffer('abc')) //=> 'false' -isNumber(null) //=> 'false' -isNumber(undefined) //=> 'false' -isNumber({abc: 'abc'}) //=> 'false' -``` - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    - -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [even](https://www.npmjs.com/package/even): Get the even numbered items from an array. | [homepage](https://github.com/jonschlinkert/even "Get the even numbered items from an array.") -* [is-even](https://www.npmjs.com/package/is-even): Return true if the given number is even. | [homepage](https://github.com/jonschlinkert/is-even "Return true if the given number is even.") -* [is-odd](https://www.npmjs.com/package/is-odd): Returns true if the given number is odd. | [homepage](https://github.com/jonschlinkert/is-odd "Returns true if the given number is odd.") -* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") -* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") -* [odd](https://www.npmjs.com/package/odd): Get the odd numbered items from an array. | [homepage](https://github.com/jonschlinkert/odd "Get the odd numbered items from an array.") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 38 | [jonschlinkert](https://github.com/jonschlinkert) | -| 5 | [charlike](https://github.com/charlike) | - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on October 17, 2017._ \ No newline at end of file diff --git a/node_modules/randomatic/node_modules/is-number/index.js b/node_modules/randomatic/node_modules/is-number/index.js deleted file mode 100644 index 5221f4056..000000000 --- a/node_modules/randomatic/node_modules/is-number/index.js +++ /dev/null @@ -1,21 +0,0 @@ -/*! - * is-number - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -module.exports = function isNumber(num) { - var type = typeof num; - - if (type === 'string' || num instanceof String) { - // an empty string would be coerced to true with the below logic - if (!num.trim()) return false; - } else if (type !== 'number' && !(num instanceof Number)) { - return false; - } - - return (num - num + 1) >= 0; -}; diff --git a/node_modules/randomatic/node_modules/is-number/package.json b/node_modules/randomatic/node_modules/is-number/package.json deleted file mode 100644 index 22a049959..000000000 --- a/node_modules/randomatic/node_modules/is-number/package.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "_from": "is-number@^4.0.0", - "_id": "is-number@4.0.0", - "_inBundle": false, - "_integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "_location": "/randomatic/is-number", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-number@^4.0.0", - "name": "is-number", - "escapedName": "is-number", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/randomatic" - ], - "_resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "_shasum": "0026e37f5454d73e356dfe6564699867c6a7f0ff", - "_spec": "is-number@^4.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/randomatic", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-number/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "tunnckoCore", - "url": "https://i.am.charlike.online" - } - ], - "deprecated": false, - "description": "Returns true if the value is a number. comprehensive tests.", - "devDependencies": { - "benchmarked": "^2.0.0", - "chalk": "^2.1.0", - "gulp-format-md": "^1.0.0", - "mocha": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-number", - "keywords": [ - "check", - "coerce", - "coercion", - "integer", - "is", - "is-nan", - "is-num", - "is-number", - "istype", - "kind", - "math", - "nan", - "num", - "number", - "numeric", - "test", - "type", - "typeof", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "is-number", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-number.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "even", - "is-even", - "is-odd", - "is-primitive", - "kind-of", - "odd" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - } - }, - "version": "4.0.0" -} diff --git a/node_modules/randomatic/node_modules/kind-of/CHANGELOG.md b/node_modules/randomatic/node_modules/kind-of/CHANGELOG.md deleted file mode 100644 index fb30b06df..000000000 --- a/node_modules/randomatic/node_modules/kind-of/CHANGELOG.md +++ /dev/null @@ -1,157 +0,0 @@ -# Release history - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). - -
    - Guiding Principles - -- Changelogs are for humans, not machines. -- There should be an entry for every single version. -- The same types of changes should be grouped. -- Versions and sections should be linkable. -- The latest version comes first. -- The release date of each versions is displayed. -- Mention whether you follow Semantic Versioning. - -
    - -
    - Types of changes - -Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_): - -- `Added` for new features. -- `Changed` for changes in existing functionality. -- `Deprecated` for soon-to-be removed features. -- `Removed` for now removed features. -- `Fixed` for any bug fixes. -- `Security` in case of vulnerabilities. - -
    - -## [6.0.0] - 2017-10-13 - -- refactor code to be more performant -- refactor benchmarks - -## [5.1.0] - 2017-10-13 - -**Added** - -- Merge pull request #15 from aretecode/patch-1 -- adds support and tests for string & array iterators - -**Changed** - -- updates benchmarks - -## [5.0.2] - 2017-08-02 - -- Merge pull request #14 from struct78/master -- Added `undefined` check - -## [5.0.0] - 2017-06-21 - -- Merge pull request #12 from aretecode/iterator -- Set Iterator + Map Iterator -- streamline `isbuffer`, minor edits - -## [4.0.0] - 2017-05-19 - -- Merge pull request #8 from tunnckoCore/master -- update deps - -## [3.2.2] - 2017-05-16 - -- fix version - -## [3.2.1] - 2017-05-16 - -- add browserify - -## [3.2.0] - 2017-04-25 - -- Merge pull request #10 from ksheedlo/unrequire-buffer -- add `promise` support and tests -- Remove unnecessary `Buffer` check - -## [3.1.0] - 2016-12-07 - -- Merge pull request #7 from laggingreflex/err -- add support for `error` and tests -- run update - -## [3.0.4] - 2016-07-29 - -- move tests -- run update - -## [3.0.3] - 2016-05-03 - -- fix prepublish script -- remove unused dep - -## [3.0.0] - 2015-11-17 - -- add typed array support -- Merge pull request #5 from miguelmota/typed-arrays -- adds new tests - -## [2.0.1] - 2015-08-21 - -- use `is-buffer` module - -## [2.0.0] - 2015-05-31 - -- Create fallback for `Array.isArray` if used as a browser package -- Merge pull request #2 from dtothefp/patch-1 -- Merge pull request #3 from pdehaan/patch-1 -- Merge branch 'master' of https://github.com/chorks/kind-of into chorks-master -- optimizations, mostly date and regex - -## [1.1.0] - 2015-02-09 - -- adds `buffer` support -- adds tests for `buffer` - -## [1.0.0] - 2015-01-19 - -- update benchmarks -- optimizations based on benchmarks - -## [0.1.2] - 2014-10-26 - -- return `typeof` value if it's not an object. very slight speed improvement -- use `.slice` -- adds benchmarks - -## [0.1.0] - 2014-9-26 - -- first commit - -[6.0.0]: https://github.com/jonschlinkert/kind-of/compare/5.1.0...6.0.0 -[5.1.0]: https://github.com/jonschlinkert/kind-of/compare/5.0.2...5.1.0 -[5.0.2]: https://github.com/jonschlinkert/kind-of/compare/5.0.1...5.0.2 -[5.0.1]: https://github.com/jonschlinkert/kind-of/compare/5.0.0...5.0.1 -[5.0.0]: https://github.com/jonschlinkert/kind-of/compare/4.0.0...5.0.0 -[4.0.0]: https://github.com/jonschlinkert/kind-of/compare/3.2.2...4.0.0 -[3.2.2]: https://github.com/jonschlinkert/kind-of/compare/3.2.1...3.2.2 -[3.2.1]: https://github.com/jonschlinkert/kind-of/compare/3.2.0...3.2.1 -[3.2.0]: https://github.com/jonschlinkert/kind-of/compare/3.1.0...3.2.0 -[3.1.0]: https://github.com/jonschlinkert/kind-of/compare/3.0.4...3.1.0 -[3.0.4]: https://github.com/jonschlinkert/kind-of/compare/3.0.3...3.0.4 -[3.0.3]: https://github.com/jonschlinkert/kind-of/compare/3.0.0...3.0.3 -[3.0.0]: https://github.com/jonschlinkert/kind-of/compare/2.0.1...3.0.0 -[2.0.1]: https://github.com/jonschlinkert/kind-of/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/jonschlinkert/kind-of/compare/1.1.0...2.0.0 -[1.1.0]: https://github.com/jonschlinkert/kind-of/compare/1.0.0...1.1.0 -[1.0.0]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...1.0.0 -[0.1.2]: https://github.com/jonschlinkert/kind-of/compare/0.1.0...0.1.2 -[0.1.0]: https://github.com/jonschlinkert/kind-of/commit/2fae09b0b19b1aadb558e9be39f0c3ef6034eb87 - -[Unreleased]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...HEAD -[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog - diff --git a/node_modules/randomatic/node_modules/kind-of/LICENSE b/node_modules/randomatic/node_modules/kind-of/LICENSE deleted file mode 100644 index 3f2eca18f..000000000 --- a/node_modules/randomatic/node_modules/kind-of/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/randomatic/node_modules/kind-of/README.md b/node_modules/randomatic/node_modules/kind-of/README.md deleted file mode 100644 index 4b0d4a818..000000000 --- a/node_modules/randomatic/node_modules/kind-of/README.md +++ /dev/null @@ -1,365 +0,0 @@ -# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) - -> Get the native type of a value. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save kind-of -``` - -Install with [bower](https://bower.io/) - -```sh -$ bower install kind-of --save -``` - -## Why use this? - -1. [it's fast](#benchmarks) | [optimizations](#optimizations) -2. [better type checking](#better-type-checking) - -## Usage - -> es5, es6, and browser ready - -```js -var kindOf = require('kind-of'); - -kindOf(undefined); -//=> 'undefined' - -kindOf(null); -//=> 'null' - -kindOf(true); -//=> 'boolean' - -kindOf(false); -//=> 'boolean' - -kindOf(new Buffer('')); -//=> 'buffer' - -kindOf(42); -//=> 'number' - -kindOf('str'); -//=> 'string' - -kindOf(arguments); -//=> 'arguments' - -kindOf({}); -//=> 'object' - -kindOf(Object.create(null)); -//=> 'object' - -kindOf(new Test()); -//=> 'object' - -kindOf(new Date()); -//=> 'date' - -kindOf([1, 2, 3]); -//=> 'array' - -kindOf(/foo/); -//=> 'regexp' - -kindOf(new RegExp('foo')); -//=> 'regexp' - -kindOf(new Error('error')); -//=> 'error' - -kindOf(function () {}); -//=> 'function' - -kindOf(function * () {}); -//=> 'generatorfunction' - -kindOf(Symbol('str')); -//=> 'symbol' - -kindOf(new Map()); -//=> 'map' - -kindOf(new WeakMap()); -//=> 'weakmap' - -kindOf(new Set()); -//=> 'set' - -kindOf(new WeakSet()); -//=> 'weakset' - -kindOf(new Int8Array()); -//=> 'int8array' - -kindOf(new Uint8Array()); -//=> 'uint8array' - -kindOf(new Uint8ClampedArray()); -//=> 'uint8clampedarray' - -kindOf(new Int16Array()); -//=> 'int16array' - -kindOf(new Uint16Array()); -//=> 'uint16array' - -kindOf(new Int32Array()); -//=> 'int32array' - -kindOf(new Uint32Array()); -//=> 'uint32array' - -kindOf(new Float32Array()); -//=> 'float32array' - -kindOf(new Float64Array()); -//=> 'float64array' -``` - -## Benchmarks - -Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). - -```bash -# arguments (32 bytes) - kind-of x 17,024,098 ops/sec ±1.90% (86 runs sampled) - lib-type-of x 11,926,235 ops/sec ±1.34% (83 runs sampled) - lib-typeof x 9,245,257 ops/sec ±1.22% (87 runs sampled) - - fastest is kind-of (by 161% avg) - -# array (22 bytes) - kind-of x 17,196,492 ops/sec ±1.07% (88 runs sampled) - lib-type-of x 8,838,283 ops/sec ±1.02% (87 runs sampled) - lib-typeof x 8,677,848 ops/sec ±0.87% (87 runs sampled) - - fastest is kind-of (by 196% avg) - -# boolean (24 bytes) - kind-of x 16,841,600 ops/sec ±1.10% (86 runs sampled) - lib-type-of x 8,096,787 ops/sec ±0.95% (87 runs sampled) - lib-typeof x 8,423,345 ops/sec ±1.15% (86 runs sampled) - - fastest is kind-of (by 204% avg) - -# buffer (38 bytes) - kind-of x 14,848,060 ops/sec ±1.05% (86 runs sampled) - lib-type-of x 3,671,577 ops/sec ±1.49% (87 runs sampled) - lib-typeof x 8,360,236 ops/sec ±1.24% (86 runs sampled) - - fastest is kind-of (by 247% avg) - -# date (30 bytes) - kind-of x 16,067,761 ops/sec ±1.58% (86 runs sampled) - lib-type-of x 8,954,436 ops/sec ±1.40% (87 runs sampled) - lib-typeof x 8,488,307 ops/sec ±1.51% (84 runs sampled) - - fastest is kind-of (by 184% avg) - -# error (36 bytes) - kind-of x 9,634,090 ops/sec ±1.12% (89 runs sampled) - lib-type-of x 7,735,624 ops/sec ±1.32% (86 runs sampled) - lib-typeof x 7,442,160 ops/sec ±1.11% (90 runs sampled) - - fastest is kind-of (by 127% avg) - -# function (34 bytes) - kind-of x 10,031,494 ops/sec ±1.27% (86 runs sampled) - lib-type-of x 9,502,757 ops/sec ±1.17% (89 runs sampled) - lib-typeof x 8,278,985 ops/sec ±1.08% (88 runs sampled) - - fastest is kind-of (by 113% avg) - -# null (24 bytes) - kind-of x 18,159,808 ops/sec ±1.92% (86 runs sampled) - lib-type-of x 12,927,635 ops/sec ±1.01% (88 runs sampled) - lib-typeof x 7,958,234 ops/sec ±1.21% (89 runs sampled) - - fastest is kind-of (by 174% avg) - -# number (22 bytes) - kind-of x 17,846,779 ops/sec ±0.91% (85 runs sampled) - lib-type-of x 3,316,636 ops/sec ±1.19% (86 runs sampled) - lib-typeof x 2,329,477 ops/sec ±2.21% (85 runs sampled) - - fastest is kind-of (by 632% avg) - -# object-plain (47 bytes) - kind-of x 7,085,155 ops/sec ±1.05% (88 runs sampled) - lib-type-of x 8,870,930 ops/sec ±1.06% (83 runs sampled) - lib-typeof x 8,716,024 ops/sec ±1.05% (87 runs sampled) - - fastest is lib-type-of (by 112% avg) - -# regex (25 bytes) - kind-of x 14,196,052 ops/sec ±1.65% (84 runs sampled) - lib-type-of x 9,554,164 ops/sec ±1.25% (88 runs sampled) - lib-typeof x 8,359,691 ops/sec ±1.07% (87 runs sampled) - - fastest is kind-of (by 158% avg) - -# string (33 bytes) - kind-of x 16,131,428 ops/sec ±1.41% (85 runs sampled) - lib-type-of x 7,273,172 ops/sec ±1.05% (87 runs sampled) - lib-typeof x 7,382,635 ops/sec ±1.17% (85 runs sampled) - - fastest is kind-of (by 220% avg) - -# symbol (34 bytes) - kind-of x 17,011,537 ops/sec ±1.24% (86 runs sampled) - lib-type-of x 3,492,454 ops/sec ±1.23% (89 runs sampled) - lib-typeof x 7,471,235 ops/sec ±2.48% (87 runs sampled) - - fastest is kind-of (by 310% avg) - -# template-strings (36 bytes) - kind-of x 15,434,250 ops/sec ±1.46% (83 runs sampled) - lib-type-of x 7,157,907 ops/sec ±0.97% (87 runs sampled) - lib-typeof x 7,517,986 ops/sec ±0.92% (86 runs sampled) - - fastest is kind-of (by 210% avg) - -# undefined (29 bytes) - kind-of x 19,167,115 ops/sec ±1.71% (87 runs sampled) - lib-type-of x 15,477,740 ops/sec ±1.63% (85 runs sampled) - lib-typeof x 19,075,495 ops/sec ±1.17% (83 runs sampled) - - fastest is lib-typeof,kind-of - -``` - -## Optimizations - -In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: - -1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. -2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. -3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` -4. There is no reason to make the code in a microlib as terse as possible, just to win points for making it shorter. It's always better to favor performant code over terse code. You will always only be using a single `require()` statement to use the library anyway, regardless of how the code is written. - -## Better type checking - -kind-of seems to be more consistently "correct" than other type checking libs I've looked at. For example, here are some differing results from other popular libs: - -### [typeof](https://github.com/CodingFu/typeof) lib - -Incorrectly identifies instances of custom constructors (pretty common): - -```js -var typeOf = require('typeof'); -function Test() {} -console.log(typeOf(new Test())); -//=> 'test' -``` - -Returns `object` instead of `arguments`: - -```js -function foo() { - console.log(typeOf(arguments)) //=> 'object' -} -foo(); -``` - -### [type-of](https://github.com/ForbesLindesay/type-of) lib - -Incorrectly returns `object` for generator functions, buffers, `Map`, `Set`, `WeakMap` and `WeakSet`: - -```js -function * foo() {} -console.log(typeOf(foo)); -//=> 'object' -console.log(typeOf(new Buffer(''))); -//=> 'object' -console.log(typeOf(new Map())); -//=> 'object' -console.log(typeOf(new Set())); -//=> 'object' -console.log(typeOf(new WeakMap())); -//=> 'object' -console.log(typeOf(new WeakSet())); -//=> 'object' -``` - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    - -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") -* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") -* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 98 | [jonschlinkert](https://github.com/jonschlinkert) | -| 3 | [aretecode](https://github.com/aretecode) | -| 2 | [miguelmota](https://github.com/miguelmota) | -| 1 | [dtothefp](https://github.com/dtothefp) | -| 1 | [ianstormtaylor](https://github.com/ianstormtaylor) | -| 1 | [ksheedlo](https://github.com/ksheedlo) | -| 1 | [pdehaan](https://github.com/pdehaan) | -| 1 | [laggingreflex](https://github.com/laggingreflex) | -| 1 | [charlike-old](https://github.com/charlike-old) | - -### Author - -**Jon Schlinkert** - -* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on December 01, 2017._ \ No newline at end of file diff --git a/node_modules/randomatic/node_modules/kind-of/index.js b/node_modules/randomatic/node_modules/kind-of/index.js deleted file mode 100644 index aa2bb3944..000000000 --- a/node_modules/randomatic/node_modules/kind-of/index.js +++ /dev/null @@ -1,129 +0,0 @@ -var toString = Object.prototype.toString; - -module.exports = function kindOf(val) { - if (val === void 0) return 'undefined'; - if (val === null) return 'null'; - - var type = typeof val; - if (type === 'boolean') return 'boolean'; - if (type === 'string') return 'string'; - if (type === 'number') return 'number'; - if (type === 'symbol') return 'symbol'; - if (type === 'function') { - return isGeneratorFn(val) ? 'generatorfunction' : 'function'; - } - - if (isArray(val)) return 'array'; - if (isBuffer(val)) return 'buffer'; - if (isArguments(val)) return 'arguments'; - if (isDate(val)) return 'date'; - if (isError(val)) return 'error'; - if (isRegexp(val)) return 'regexp'; - - switch (ctorName(val)) { - case 'Symbol': return 'symbol'; - case 'Promise': return 'promise'; - - // Set, Map, WeakSet, WeakMap - case 'WeakMap': return 'weakmap'; - case 'WeakSet': return 'weakset'; - case 'Map': return 'map'; - case 'Set': return 'set'; - - // 8-bit typed arrays - case 'Int8Array': return 'int8array'; - case 'Uint8Array': return 'uint8array'; - case 'Uint8ClampedArray': return 'uint8clampedarray'; - - // 16-bit typed arrays - case 'Int16Array': return 'int16array'; - case 'Uint16Array': return 'uint16array'; - - // 32-bit typed arrays - case 'Int32Array': return 'int32array'; - case 'Uint32Array': return 'uint32array'; - case 'Float32Array': return 'float32array'; - case 'Float64Array': return 'float64array'; - } - - if (isGeneratorObj(val)) { - return 'generator'; - } - - // Non-plain objects - type = toString.call(val); - switch (type) { - case '[object Object]': return 'object'; - // iterators - case '[object Map Iterator]': return 'mapiterator'; - case '[object Set Iterator]': return 'setiterator'; - case '[object String Iterator]': return 'stringiterator'; - case '[object Array Iterator]': return 'arrayiterator'; - } - - // other - return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); -}; - -function ctorName(val) { - return val.constructor ? val.constructor.name : null; -} - -function isArray(val) { - if (Array.isArray) return Array.isArray(val); - return val instanceof Array; -} - -function isError(val) { - return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'); -} - -function isDate(val) { - if (val instanceof Date) return true; - return typeof val.toDateString === 'function' - && typeof val.getDate === 'function' - && typeof val.setDate === 'function'; -} - -function isRegexp(val) { - if (val instanceof RegExp) return true; - return typeof val.flags === 'string' - && typeof val.ignoreCase === 'boolean' - && typeof val.multiline === 'boolean' - && typeof val.global === 'boolean'; -} - -function isGeneratorFn(name, val) { - return ctorName(name) === 'GeneratorFunction'; -} - -function isGeneratorObj(val) { - return typeof val.throw === 'function' - && typeof val.return === 'function' - && typeof val.next === 'function'; -} - -function isArguments(val) { - try { - if (typeof val.length === 'number' && typeof val.callee === 'function') { - return true; - } - } catch (err) { - if (err.message.indexOf('callee') !== -1) { - return true; - } - } - return false; -} - -/** - * If you need to support Safari 5-7 (8-10 yr-old browser), - * take a look at https://github.com/feross/is-buffer - */ - -function isBuffer(val) { - if (val.constructor && typeof val.constructor.isBuffer === 'function') { - return val.constructor.isBuffer(val); - } - return false; -} diff --git a/node_modules/randomatic/node_modules/kind-of/package.json b/node_modules/randomatic/node_modules/kind-of/package.json deleted file mode 100644 index 3de623494..000000000 --- a/node_modules/randomatic/node_modules/kind-of/package.json +++ /dev/null @@ -1,143 +0,0 @@ -{ - "_from": "kind-of@^6.0.0", - "_id": "kind-of@6.0.2", - "_inBundle": false, - "_integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "_location": "/randomatic/kind-of", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "kind-of@^6.0.0", - "name": "kind-of", - "escapedName": "kind-of", - "rawSpec": "^6.0.0", - "saveSpec": null, - "fetchSpec": "^6.0.0" - }, - "_requiredBy": [ - "/randomatic" - ], - "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "_shasum": "01146b36a6218e64e58f3a8d66de5d7fc6f6d051", - "_spec": "kind-of@^6.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/randomatic", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/kind-of/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "David Fox-Powell", - "url": "https://dtothefp.github.io/me" - }, - { - "name": "James", - "url": "https://twitter.com/aretecode" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Ken Sheedlo", - "url": "kensheedlo.com" - }, - { - "name": "laggingreflex", - "url": "https://github.com/laggingreflex" - }, - { - "name": "Miguel Mota", - "url": "https://miguelmota.com" - }, - { - "name": "Peter deHaan", - "url": "http://about.me/peterdehaan" - }, - { - "name": "tunnckoCore", - "url": "https://i.am.charlike.online" - } - ], - "deprecated": false, - "description": "Get the native type of a value.", - "devDependencies": { - "benchmarked": "^2.0.0", - "browserify": "^14.4.0", - "gulp-format-md": "^1.0.0", - "mocha": "^4.0.1", - "write": "^1.0.3" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/kind-of", - "keywords": [ - "arguments", - "array", - "boolean", - "check", - "date", - "function", - "is", - "is-type", - "is-type-of", - "kind", - "kind-of", - "number", - "object", - "of", - "regexp", - "string", - "test", - "type", - "type-of", - "typeof", - "types" - ], - "license": "MIT", - "main": "index.js", - "name": "kind-of", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/kind-of.git" - }, - "scripts": { - "prepublish": "browserify -o browser.js -e index.js -s index --bare", - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "related": { - "list": [ - "is-glob", - "is-number", - "is-primitive" - ] - }, - "reflinks": [ - "type-of", - "typeof", - "verb" - ] - }, - "version": "6.0.2" -} diff --git a/node_modules/randomatic/package.json b/node_modules/randomatic/package.json deleted file mode 100644 index 95fd37f8f..000000000 --- a/node_modules/randomatic/package.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "_from": "randomatic@^3.0.0", - "_id": "randomatic@3.1.1", - "_inBundle": false, - "_integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", - "_location": "/randomatic", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "randomatic@^3.0.0", - "name": "randomatic", - "escapedName": "randomatic", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/fill-range" - ], - "_resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", - "_shasum": "b776efc59375984e36c537b2f51a1f0aff0da1ed", - "_spec": "randomatic@^3.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/fill-range", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/randomatic/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Bogdan Chadkin", - "url": "https://github.com/TrySound" - }, - { - "name": "Dragos Fotescu", - "url": "http://dragosfotescu.com" - }, - { - "name": "Faiz ul haque", - "url": "http://www.10pearls.com" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Michael Rhodes", - "url": "http://michaelrhod.es" - }, - { - "name": "Paul Miller", - "url": "https://paulmillr.com" - }, - { - "name": "Rouven Weßling", - "url": "www.rouvenwessling.de" - }, - { - "name": "Sun Knudsen", - "url": "https://sunknudsen.com" - } - ], - "dependencies": { - "is-number": "^4.0.0", - "kind-of": "^6.0.0", - "math-random": "^1.0.1" - }, - "deprecated": false, - "description": "Generate randomized strings of a specified length using simple character sequences. The original generate-password.", - "devDependencies": { - "ansi-bold": "^0.1.1", - "benchmarked": "^1.1.1", - "glob": "^7.1.2", - "gulp-format-md": "^0.1.12", - "mocha": "^3.4.2" - }, - "engines": { - "node": ">= 0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/randomatic", - "keywords": [ - "alpha", - "alpha-numeric", - "alphanumeric", - "characters", - "chars", - "generate", - "generate-password", - "numeric", - "password", - "rand", - "random", - "randomatic", - "randomize", - "randomized" - ], - "license": "MIT", - "main": "index.js", - "name": "randomatic", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/randomatic.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "pad-left", - "pad-right", - "repeat-string" - ] - }, - "lint": { - "reflinks": true - } - }, - "version": "3.1.1" -} diff --git a/node_modules/randombytes/.travis.yml b/node_modules/randombytes/.travis.yml deleted file mode 100644 index 69fdf7130..000000000 --- a/node_modules/randombytes/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -sudo: false -language: node_js -matrix: - include: - - node_js: '7' - env: TEST_SUITE=test - - node_js: '6' - env: TEST_SUITE=test - - node_js: '5' - env: TEST_SUITE=test - - node_js: '4' - env: TEST_SUITE=test - - node_js: '4' - env: TEST_SUITE=phantom -script: "npm run-script $TEST_SUITE" diff --git a/node_modules/randombytes/.zuul.yml b/node_modules/randombytes/.zuul.yml deleted file mode 100644 index 96d9cfbd3..000000000 --- a/node_modules/randombytes/.zuul.yml +++ /dev/null @@ -1 +0,0 @@ -ui: tape diff --git a/node_modules/randombytes/LICENSE b/node_modules/randombytes/LICENSE deleted file mode 100644 index fea9d48a4..000000000 --- a/node_modules/randombytes/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 crypto-browserify - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/randombytes/README.md b/node_modules/randombytes/README.md deleted file mode 100644 index 3bacba4d1..000000000 --- a/node_modules/randombytes/README.md +++ /dev/null @@ -1,14 +0,0 @@ -randombytes -=== - -[![Version](http://img.shields.io/npm/v/randombytes.svg)](https://www.npmjs.org/package/randombytes) [![Build Status](https://travis-ci.org/crypto-browserify/randombytes.svg?branch=master)](https://travis-ci.org/crypto-browserify/randombytes) - -randombytes from node that works in the browser. In node you just get crypto.randomBytes, but in the browser it uses .crypto/msCrypto.getRandomValues - -```js -var randomBytes = require('randombytes'); -randomBytes(16);//get 16 random bytes -randomBytes(16, function (err, resp) { - // resp is 16 random bytes -}); -``` diff --git a/node_modules/randombytes/browser.js b/node_modules/randombytes/browser.js deleted file mode 100644 index 58990c557..000000000 --- a/node_modules/randombytes/browser.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict' - -function oldBrowser () { - throw new Error('Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11') -} - -var Buffer = require('safe-buffer').Buffer -var crypto = global.crypto || global.msCrypto - -if (crypto && crypto.getRandomValues) { - module.exports = randomBytes -} else { - module.exports = oldBrowser -} - -function randomBytes (size, cb) { - // phantomjs needs to throw - if (size > 65536) throw new Error('requested too many random bytes') - // in case browserify isn't using the Uint8Array version - var rawBytes = new global.Uint8Array(size) - - // This will not work in older browsers. - // See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues - if (size > 0) { // getRandomValues fails on IE if size == 0 - crypto.getRandomValues(rawBytes) - } - - // XXX: phantomjs doesn't like a buffer being passed here - var bytes = Buffer.from(rawBytes.buffer) - - if (typeof cb === 'function') { - return process.nextTick(function () { - cb(null, bytes) - }) - } - - return bytes -} diff --git a/node_modules/randombytes/index.js b/node_modules/randombytes/index.js deleted file mode 100644 index a2d9e3911..000000000 --- a/node_modules/randombytes/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('crypto').randomBytes diff --git a/node_modules/randombytes/package.json b/node_modules/randombytes/package.json deleted file mode 100644 index 479ae6e6a..000000000 --- a/node_modules/randombytes/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "_from": "randombytes@^2.0.0", - "_id": "randombytes@2.0.6", - "_inBundle": false, - "_integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", - "_location": "/randombytes", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "randombytes@^2.0.0", - "name": "randombytes", - "escapedName": "randombytes", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/browserify-rsa", - "/crypto-browserify", - "/diffie-hellman", - "/public-encrypt", - "/randomfill" - ], - "_resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", - "_shasum": "d302c522948588848a8d300c932b44c24231da80", - "_spec": "randombytes@^2.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/crypto-browserify", - "author": "", - "browser": "browser.js", - "bugs": { - "url": "https://github.com/crypto-browserify/randombytes/issues" - }, - "bundleDependencies": false, - "dependencies": { - "safe-buffer": "^5.1.0" - }, - "deprecated": false, - "description": "random bytes from browserify stand alone", - "devDependencies": { - "phantomjs": "^1.9.9", - "standard": "^10.0.2", - "tap-spec": "^2.1.2", - "tape": "^4.6.3", - "zuul": "^3.7.2" - }, - "homepage": "https://github.com/crypto-browserify/randombytes", - "keywords": [ - "crypto", - "random" - ], - "license": "MIT", - "main": "index.js", - "name": "randombytes", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/crypto-browserify/randombytes.git" - }, - "scripts": { - "local": "zuul --local --no-coverage -- test.js", - "phantom": "zuul --phantom -- test.js", - "test": "standard && node test.js | tspec" - }, - "version": "2.0.6" -} diff --git a/node_modules/randombytes/test.js b/node_modules/randombytes/test.js deleted file mode 100644 index 8e34dcaa4..000000000 --- a/node_modules/randombytes/test.js +++ /dev/null @@ -1,56 +0,0 @@ -var test = require('tape') -var randomBytes = require('./') - -test('sync', function (t) { - t.plan(4) - t.equals(randomBytes(0).length, 0, 'len: ' + 0) - t.equals(randomBytes(3).length, 3, 'len: ' + 3) - t.equals(randomBytes(30).length, 30, 'len: ' + 30) - t.equals(randomBytes(300).length, 300, 'len: ' + 300) -}) - -test('async', function (t) { - t.plan(4) - - randomBytes(0, function (err, resp) { - if (err) throw err - - t.equals(resp.length, 0, 'len: ' + 0) - }) - - randomBytes(3, function (err, resp) { - if (err) throw err - - t.equals(resp.length, 3, 'len: ' + 3) - }) - - randomBytes(30, function (err, resp) { - if (err) throw err - - t.equals(resp.length, 30, 'len: ' + 30) - }) - - randomBytes(300, function (err, resp) { - if (err) throw err - - t.equals(resp.length, 300, 'len: ' + 300) - }) -}) - -if (process.browser) { - test('requesting to much throws', function (t) { - t.plan(1) - t.throws(function () { - randomBytes(65537) - }) - }) - - test('requesting to much throws async', function (t) { - t.plan(1) - t.throws(function () { - randomBytes(65537, function () { - t.ok(false, 'should not get here') - }) - }) - }) -} diff --git a/node_modules/randomfill/.travis.yml b/node_modules/randomfill/.travis.yml deleted file mode 100644 index 69fdf7130..000000000 --- a/node_modules/randomfill/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -sudo: false -language: node_js -matrix: - include: - - node_js: '7' - env: TEST_SUITE=test - - node_js: '6' - env: TEST_SUITE=test - - node_js: '5' - env: TEST_SUITE=test - - node_js: '4' - env: TEST_SUITE=test - - node_js: '4' - env: TEST_SUITE=phantom -script: "npm run-script $TEST_SUITE" diff --git a/node_modules/randomfill/.zuul.yml b/node_modules/randomfill/.zuul.yml deleted file mode 100644 index 96d9cfbd3..000000000 --- a/node_modules/randomfill/.zuul.yml +++ /dev/null @@ -1 +0,0 @@ -ui: tape diff --git a/node_modules/randomfill/LICENSE b/node_modules/randomfill/LICENSE deleted file mode 100644 index fea9d48a4..000000000 --- a/node_modules/randomfill/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 crypto-browserify - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/randomfill/README.md b/node_modules/randomfill/README.md deleted file mode 100644 index 1ae13adfa..000000000 --- a/node_modules/randomfill/README.md +++ /dev/null @@ -1,15 +0,0 @@ -randomfill -=== - -[![Version](http://img.shields.io/npm/v/randomfill.svg)](https://www.npmjs.org/package/randomfill) - -randomfill from node that works in the browser. In node you just get crypto.randomBytes, but in the browser it uses .crypto/msCrypto.getRandomValues - -```js -var randomFill = require('randomfill'); -var buf -randomFill.randomFillSync(16);//get 16 random bytes -randomFill.randomFill(16, function (err, resp) { - // resp is 16 random bytes -}); -``` diff --git a/node_modules/randomfill/browser.js b/node_modules/randomfill/browser.js deleted file mode 100644 index ce34a693e..000000000 --- a/node_modules/randomfill/browser.js +++ /dev/null @@ -1,108 +0,0 @@ -'use strict' - -function oldBrowser () { - throw new Error('secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11') -} -var safeBuffer = require('safe-buffer') -var randombytes = require('randombytes') -var Buffer = safeBuffer.Buffer -var kBufferMaxLength = safeBuffer.kMaxLength -var crypto = global.crypto || global.msCrypto -var kMaxUint32 = Math.pow(2, 32) - 1 -function assertOffset (offset, length) { - if (typeof offset !== 'number' || offset !== offset) { // eslint-disable-line no-self-compare - throw new TypeError('offset must be a number') - } - - if (offset > kMaxUint32 || offset < 0) { - throw new TypeError('offset must be a uint32') - } - - if (offset > kBufferMaxLength || offset > length) { - throw new RangeError('offset out of range') - } -} - -function assertSize (size, offset, length) { - if (typeof size !== 'number' || size !== size) { // eslint-disable-line no-self-compare - throw new TypeError('size must be a number') - } - - if (size > kMaxUint32 || size < 0) { - throw new TypeError('size must be a uint32') - } - - if (size + offset > length || size > kBufferMaxLength) { - throw new RangeError('buffer too small') - } -} -if ((crypto && crypto.getRandomValues) || !process.browser) { - exports.randomFill = randomFill - exports.randomFillSync = randomFillSync -} else { - exports.randomFill = oldBrowser - exports.randomFillSync = oldBrowser -} -function randomFill (buf, offset, size, cb) { - if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) { - throw new TypeError('"buf" argument must be a Buffer or Uint8Array') - } - - if (typeof offset === 'function') { - cb = offset - offset = 0 - size = buf.length - } else if (typeof size === 'function') { - cb = size - size = buf.length - offset - } else if (typeof cb !== 'function') { - throw new TypeError('"cb" argument must be a function') - } - assertOffset(offset, buf.length) - assertSize(size, offset, buf.length) - return actualFill(buf, offset, size, cb) -} - -function actualFill (buf, offset, size, cb) { - if (process.browser) { - var ourBuf = buf.buffer - var uint = new Uint8Array(ourBuf, offset, size) - crypto.getRandomValues(uint) - if (cb) { - process.nextTick(function () { - cb(null, buf) - }) - return - } - return buf - } - if (cb) { - randombytes(size, function (err, bytes) { - if (err) { - return cb(err) - } - bytes.copy(buf, offset) - cb(null, buf) - }) - return - } - var bytes = randombytes(size) - bytes.copy(buf, offset) - return buf -} -function randomFillSync (buf, offset, size) { - if (typeof offset === 'undefined') { - offset = 0 - } - if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) { - throw new TypeError('"buf" argument must be a Buffer or Uint8Array') - } - - assertOffset(offset, buf.length) - - if (size === undefined) size = buf.length - offset - - assertSize(size, offset, buf.length) - - return actualFill(buf, offset, size) -} diff --git a/node_modules/randomfill/index.js b/node_modules/randomfill/index.js deleted file mode 100644 index e2b5f7a70..000000000 --- a/node_modules/randomfill/index.js +++ /dev/null @@ -1,7 +0,0 @@ -var crypto = require('crypto') -if (typeof crypto.randomFill === 'function' && typeof crypto.randomFillSync === 'function') { - exports.randomFill = crypto.randomFill - exports.randomFillSync = crypto.randomFillSync -} else { - module.exports = require('./browser') -} diff --git a/node_modules/randomfill/package.json b/node_modules/randomfill/package.json deleted file mode 100644 index 418bf3e15..000000000 --- a/node_modules/randomfill/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_from": "randomfill@^1.0.3", - "_id": "randomfill@1.0.4", - "_inBundle": false, - "_integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "_location": "/randomfill", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "randomfill@^1.0.3", - "name": "randomfill", - "escapedName": "randomfill", - "rawSpec": "^1.0.3", - "saveSpec": null, - "fetchSpec": "^1.0.3" - }, - "_requiredBy": [ - "/crypto-browserify" - ], - "_resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "_shasum": "c92196fc86ab42be983f1bf31778224931d61458", - "_spec": "randomfill@^1.0.3", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/crypto-browserify", - "author": "", - "browser": "browser.js", - "bugs": { - "url": "https://github.com/crypto-browserify/randomfill/issues" - }, - "bundleDependencies": false, - "dependencies": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - }, - "deprecated": false, - "description": "random fill from browserify stand alone", - "devDependencies": { - "phantomjs": "^1.9.9", - "standard": "^10.0.2", - "tap-spec": "^2.1.2", - "tape": "^4.6.3", - "zuul": "^3.7.2" - }, - "homepage": "https://github.com/crypto-browserify/randomfill", - "keywords": [ - "crypto", - "random" - ], - "license": "MIT", - "main": "index.js", - "name": "randomfill", - "repository": { - "type": "git", - "url": "git+https://github.com/crypto-browserify/randomfill.git" - }, - "scripts": { - "local": "zuul --local --no-coverage -- test.js", - "phantom": "zuul --phantom -- test.js", - "test": "standard && node test.js | tspec" - }, - "version": "1.0.4" -} diff --git a/node_modules/randomfill/test.js b/node_modules/randomfill/test.js deleted file mode 100644 index eff227c2e..000000000 --- a/node_modules/randomfill/test.js +++ /dev/null @@ -1,28 +0,0 @@ -var test = require('tape') -var crypto = require('./browser') -var Buffer = require('safe-buffer').Buffer -test('sync', function (t) { - t.test('first', function (t) { - const buf = Buffer.alloc(10) - const before = buf.toString('hex') - crypto.randomFillSync(buf, 5, 5) - const after = buf.toString('hex') - t.notEqual(before, after) - t.equal(before.slice(0, 10), after.slice(0, 10)) - t.end() - }) -}) -test('async', function (t) { - t.test('first', function (t) { - const buf = Buffer.alloc(10) - const before = buf.toString('hex') - crypto.randomFill(buf, 5, 5, function (err, bufa) { - t.error(err) - const after = bufa.toString('hex') - t.notEqual(before, after) - t.equal(before.slice(0, 10), after.slice(0, 10)) - t.ok(buf === bufa, 'same buffer') - t.end() - }) - }) -}) diff --git a/node_modules/range-parser/HISTORY.md b/node_modules/range-parser/HISTORY.md deleted file mode 100644 index 5e01eef46..000000000 --- a/node_modules/range-parser/HISTORY.md +++ /dev/null @@ -1,51 +0,0 @@ -1.2.0 / 2016-06-01 -================== - - * Add `combine` option to combine overlapping ranges - -1.1.0 / 2016-05-13 -================== - - * Fix incorrectly returning -1 when there is at least one valid range - * perf: remove internal function - -1.0.3 / 2015-10-29 -================== - - * perf: enable strict mode - -1.0.2 / 2014-09-08 -================== - - * Support Node.js 0.6 - -1.0.1 / 2014-09-07 -================== - - * Move repository to jshttp - -1.0.0 / 2013-12-11 -================== - - * Add repository to package.json - * Add MIT license - -0.0.4 / 2012-06-17 -================== - - * Change ret -1 for unsatisfiable and -2 when invalid - -0.0.3 / 2012-06-17 -================== - - * Fix last-byte-pos default to len - 1 - -0.0.2 / 2012-06-14 -================== - - * Add `.type` - -0.0.1 / 2012-06-11 -================== - - * Initial release diff --git a/node_modules/range-parser/LICENSE b/node_modules/range-parser/LICENSE deleted file mode 100644 index 359995436..000000000 --- a/node_modules/range-parser/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2012-2014 TJ Holowaychuk -Copyright (c) 2015-2016 Douglas Christopher Wilson [ -// { start: 0, end: 10 }, -// { start: 50, end: 60 } -// ] -``` - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/range-parser.svg -[npm-url]: https://npmjs.org/package/range-parser -[node-version-image]: https://img.shields.io/node/v/range-parser.svg -[node-version-url]: https://nodejs.org/endownload -[travis-image]: https://img.shields.io/travis/jshttp/range-parser.svg -[travis-url]: https://travis-ci.org/jshttp/range-parser -[coveralls-image]: https://img.shields.io/coveralls/jshttp/range-parser.svg -[coveralls-url]: https://coveralls.io/r/jshttp/range-parser -[downloads-image]: https://img.shields.io/npm/dm/range-parser.svg -[downloads-url]: https://npmjs.org/package/range-parser diff --git a/node_modules/range-parser/index.js b/node_modules/range-parser/index.js deleted file mode 100644 index 83b2eb6b3..000000000 --- a/node_modules/range-parser/index.js +++ /dev/null @@ -1,158 +0,0 @@ -/*! - * range-parser - * Copyright(c) 2012-2014 TJ Holowaychuk - * Copyright(c) 2015-2016 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = rangeParser - -/** - * Parse "Range" header `str` relative to the given file `size`. - * - * @param {Number} size - * @param {String} str - * @param {Object} [options] - * @return {Array} - * @public - */ - -function rangeParser (size, str, options) { - var index = str.indexOf('=') - - if (index === -1) { - return -2 - } - - // split the range string - var arr = str.slice(index + 1).split(',') - var ranges = [] - - // add ranges type - ranges.type = str.slice(0, index) - - // parse all ranges - for (var i = 0; i < arr.length; i++) { - var range = arr[i].split('-') - var start = parseInt(range[0], 10) - var end = parseInt(range[1], 10) - - // -nnn - if (isNaN(start)) { - start = size - end - end = size - 1 - // nnn- - } else if (isNaN(end)) { - end = size - 1 - } - - // limit last-byte-pos to current length - if (end > size - 1) { - end = size - 1 - } - - // invalid or unsatisifiable - if (isNaN(start) || isNaN(end) || start > end || start < 0) { - continue - } - - // add range - ranges.push({ - start: start, - end: end - }) - } - - if (ranges.length < 1) { - // unsatisifiable - return -1 - } - - return options && options.combine - ? combineRanges(ranges) - : ranges -} - -/** - * Combine overlapping & adjacent ranges. - * @private - */ - -function combineRanges (ranges) { - var ordered = ranges.map(mapWithIndex).sort(sortByRangeStart) - - for (var j = 0, i = 1; i < ordered.length; i++) { - var range = ordered[i] - var current = ordered[j] - - if (range.start > current.end + 1) { - // next range - ordered[++j] = range - } else if (range.end > current.end) { - // extend range - current.end = range.end - current.index = Math.min(current.index, range.index) - } - } - - // trim ordered array - ordered.length = j + 1 - - // generate combined range - var combined = ordered.sort(sortByRangeIndex).map(mapWithoutIndex) - - // copy ranges type - combined.type = ranges.type - - return combined -} - -/** - * Map function to add index value to ranges. - * @private - */ - -function mapWithIndex (range, index) { - return { - start: range.start, - end: range.end, - index: index - } -} - -/** - * Map function to remove index value from ranges. - * @private - */ - -function mapWithoutIndex (range) { - return { - start: range.start, - end: range.end - } -} - -/** - * Sort function to sort ranges by index. - * @private - */ - -function sortByRangeIndex (a, b) { - return a.index - b.index -} - -/** - * Sort function to sort ranges by start position. - * @private - */ - -function sortByRangeStart (a, b) { - return a.start - b.start -} diff --git a/node_modules/range-parser/package.json b/node_modules/range-parser/package.json deleted file mode 100644 index 38f5aaadc..000000000 --- a/node_modules/range-parser/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "_from": "range-parser@~1.2.0", - "_id": "range-parser@1.2.0", - "_inBundle": false, - "_integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", - "_location": "/range-parser", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "range-parser@~1.2.0", - "name": "range-parser", - "escapedName": "range-parser", - "rawSpec": "~1.2.0", - "saveSpec": null, - "fetchSpec": "~1.2.0" - }, - "_requiredBy": [ - "/send" - ], - "_resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "_shasum": "f49be6b487894ddc40dcc94a322f611092e00d5e", - "_spec": "range-parser@~1.2.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/send", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca", - "url": "http://tjholowaychuk.com" - }, - "bugs": { - "url": "https://github.com/jshttp/range-parser/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - }, - { - "name": "James Wyatt Cready", - "email": "wyatt.cready@lanetix.com" - }, - { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com" - } - ], - "deprecated": false, - "description": "Range header field string parser", - "devDependencies": { - "eslint": "2.11.1", - "eslint-config-standard": "5.3.1", - "eslint-plugin-promise": "1.1.0", - "eslint-plugin-standard": "1.3.2", - "istanbul": "0.4.3", - "mocha": "1.21.5" - }, - "engines": { - "node": ">= 0.6" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "index.js" - ], - "homepage": "https://github.com/jshttp/range-parser#readme", - "keywords": [ - "range", - "parser", - "http" - ], - "license": "MIT", - "name": "range-parser", - "repository": { - "type": "git", - "url": "git+https://github.com/jshttp/range-parser.git" - }, - "scripts": { - "lint": "eslint **/*.js", - "test": "mocha --reporter spec", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" - }, - "version": "1.2.0" -} diff --git a/node_modules/read-only-stream/.travis.yml b/node_modules/read-only-stream/.travis.yml deleted file mode 100644 index 9672e1293..000000000 --- a/node_modules/read-only-stream/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" -before_install: - - npm install -g npm@~1.4.6 diff --git a/node_modules/read-only-stream/LICENSE b/node_modules/read-only-stream/LICENSE deleted file mode 100644 index ee27ba4b4..000000000 --- a/node_modules/read-only-stream/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/read-only-stream/example/main.js b/node_modules/read-only-stream/example/main.js deleted file mode 100644 index 22720fe3c..000000000 --- a/node_modules/read-only-stream/example/main.js +++ /dev/null @@ -1,3 +0,0 @@ -var wrap = require('./wrap.js'); -var ro = wrap(); // can't write to `ro` and muck up internal state -ro.pipe(process.stdout); diff --git a/node_modules/read-only-stream/example/wrap.js b/node_modules/read-only-stream/example/wrap.js deleted file mode 100644 index 55860810a..000000000 --- a/node_modules/read-only-stream/example/wrap.js +++ /dev/null @@ -1,8 +0,0 @@ -var through = require('through2'); -var readonly = require('../'); - -module.exports = function () { - var stream = through(); - stream.end('wooooo\n'); - return readonly(stream); -}; diff --git a/node_modules/read-only-stream/index.js b/node_modules/read-only-stream/index.js deleted file mode 100644 index 68c495deb..000000000 --- a/node_modules/read-only-stream/index.js +++ /dev/null @@ -1,30 +0,0 @@ -var Readable = require('readable-stream').Readable; - -module.exports = function (stream) { - var opts = stream._readableState; - if (typeof stream.read !== 'function') { - stream = new Readable(opts).wrap(stream); - } - - var ro = new Readable({ objectMode: opts && opts.objectMode }); - var waiting = false; - - stream.on('readable', function () { - if (waiting) { - waiting = false; - ro._read(); - } - }); - - ro._read = function () { - var buf, reads = 0; - while ((buf = stream.read()) !== null) { - ro.push(buf); - reads ++; - } - if (reads === 0) waiting = true; - }; - stream.once('end', function () { ro.push(null) }); - stream.on('error', function (err) { ro.emit('error', err) }); - return ro; -}; diff --git a/node_modules/read-only-stream/package.json b/node_modules/read-only-stream/package.json deleted file mode 100644 index 0b7307667..000000000 --- a/node_modules/read-only-stream/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "_from": "read-only-stream@^2.0.0", - "_id": "read-only-stream@2.0.0", - "_inBundle": false, - "_integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", - "_location": "/read-only-stream", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "read-only-stream@^2.0.0", - "name": "read-only-stream", - "escapedName": "read-only-stream", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/browserify" - ], - "_resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", - "_shasum": "2724fd6a8113d73764ac288d4386270c1dbf17f0", - "_spec": "read-only-stream@^2.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/read-only-stream/issues" - }, - "bundleDependencies": false, - "dependencies": { - "readable-stream": "^2.0.2" - }, - "deprecated": false, - "description": "wrap a readable/writable stream to be read-only", - "devDependencies": { - "concat-stream": "^1.4.6", - "covert": "^1.0.0", - "tape": "^4.2.0", - "through": "^2.3.4", - "through2": "^2.0.0" - }, - "homepage": "https://github.com/substack/read-only-stream", - "keywords": [ - "stream", - "readonly" - ], - "license": "MIT", - "main": "index.js", - "name": "read-only-stream", - "repository": { - "type": "git", - "url": "git://github.com/substack/read-only-stream.git" - }, - "scripts": { - "coverage": "covert test/*.js", - "test": "tape test/*.js" - }, - "version": "2.0.0" -} diff --git a/node_modules/read-only-stream/readme.markdown b/node_modules/read-only-stream/readme.markdown deleted file mode 100644 index 05e6a9db7..000000000 --- a/node_modules/read-only-stream/readme.markdown +++ /dev/null @@ -1,60 +0,0 @@ -# read-only-stream - -wrap a readable/writable stream to be read-only -to prevent mucking up the input side - -[![build status](https://secure.travis-ci.org/substack/read-only-stream.png)](http://travis-ci.org/substack/read-only-stream) - -# example - -Suppose you have a module that uses a readable/writable stream internally but -want to expose just the readable part of that internal stream. This is common if -you use the writable side internally and expose the readable side as the -interface. - -Now we can write some code like this with a `through` stream internally for -convenience: - -``` js -var through = require('through2'); -var readonly = require('read-only-stream'); - -module.exports = function () { - var stream = through(); - stream.end('wooooo\n'); - return readonly(stream); -}; -``` - -but consumers won't be able to write to the input side and break the api: - -``` js -var wrap = require('./wrap.js'); -var ro = wrap(); // can't write to `ro` and muck up internal state -ro.pipe(process.stdout); -``` - -# methods - -``` js -var readonly = require('read-only-stream') -``` - -## var ro = readonly(stream) - -Return a readable stream `ro` that wraps the readable/writable `stream` argument -given to only expose the readable side. - -`stream` can be a streams1 or streams2 stream. - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install read-only-stream -``` - -# license - -MIT diff --git a/node_modules/read-only-stream/test/error.js b/node_modules/read-only-stream/test/error.js deleted file mode 100644 index e53447c6a..000000000 --- a/node_modules/read-only-stream/test/error.js +++ /dev/null @@ -1,15 +0,0 @@ -var test = require('tape'); -var readonly = require('../'); -var through = require('through2'); - -test('error', function (t) { - t.plan(1); - - var stream = through(); - var ro = readonly(stream); - - ro.on('error', function (err) { - t.ok(err); - }); - stream.emit('error', new Error); -}); diff --git a/node_modules/read-only-stream/test/ro.js b/node_modules/read-only-stream/test/ro.js deleted file mode 100644 index b7f4a5518..000000000 --- a/node_modules/read-only-stream/test/ro.js +++ /dev/null @@ -1,22 +0,0 @@ -var test = require('tape'); -var readonly = require('../'); -var through = require('through2'); -var concat = require('concat-stream'); - -test('readonly', function (t) { - t.plan(2); - - var stream = through(); - stream.write('woo'); - - var ro = readonly(stream); - ro.pipe(concat(function (body) { - t.equal(body.toString('utf8'), 'woo'); - })); - - t.throws(function () { - ro.write('beep'); - }); - - stream.end(); -}); diff --git a/node_modules/read-only-stream/test/streams1.js b/node_modules/read-only-stream/test/streams1.js deleted file mode 100644 index dfe408fa8..000000000 --- a/node_modules/read-only-stream/test/streams1.js +++ /dev/null @@ -1,21 +0,0 @@ -var test = require('tape'); -var readonly = require('../'); -var through = require('through'); -var concat = require('concat-stream'); - -test('streams1', function (t) { - t.plan(2); - - var stream = through(); - - var ro = readonly(stream); - ro.pipe(concat(function (body) { - t.equal(body.toString('utf8'), 'woo'); - })); - - t.throws(function () { - ro.write('beep'); - }); - - stream.end('woo'); -}); diff --git a/node_modules/readable-stream/.travis.yml b/node_modules/readable-stream/.travis.yml deleted file mode 100644 index 40992555b..000000000 --- a/node_modules/readable-stream/.travis.yml +++ /dev/null @@ -1,55 +0,0 @@ -sudo: false -language: node_js -before_install: - - npm install -g npm@2 - - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g -notifications: - email: false -matrix: - fast_finish: true - include: - - node_js: '0.8' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.10' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.11' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.12' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 1 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 2 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 3 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 4 - env: TASK=test - - node_js: 5 - env: TASK=test - - node_js: 6 - env: TASK=test - - node_js: 7 - env: TASK=test - - node_js: 8 - env: TASK=test - - node_js: 9 - env: TASK=test -script: "npm run $TASK" -env: - global: - - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= - - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/node_modules/readable-stream/CONTRIBUTING.md b/node_modules/readable-stream/CONTRIBUTING.md deleted file mode 100644 index f478d58dc..000000000 --- a/node_modules/readable-stream/CONTRIBUTING.md +++ /dev/null @@ -1,38 +0,0 @@ -# Developer's Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -* (a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - -* (b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - -* (c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - -* (d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. - -## Moderation Policy - -The [Node.js Moderation Policy] applies to this WG. - -## Code of Conduct - -The [Node.js Code of Conduct][] applies to this WG. - -[Node.js Code of Conduct]: -https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md -[Node.js Moderation Policy]: -https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md diff --git a/node_modules/readable-stream/GOVERNANCE.md b/node_modules/readable-stream/GOVERNANCE.md deleted file mode 100644 index 16ffb93f2..000000000 --- a/node_modules/readable-stream/GOVERNANCE.md +++ /dev/null @@ -1,136 +0,0 @@ -### Streams Working Group - -The Node.js Streams is jointly governed by a Working Group -(WG) -that is responsible for high-level guidance of the project. - -The WG has final authority over this project including: - -* Technical direction -* Project governance and process (including this policy) -* Contribution policy -* GitHub repository hosting -* Conduct guidelines -* Maintaining the list of additional Collaborators - -For the current list of WG members, see the project -[README.md](./README.md#current-project-team-members). - -### Collaborators - -The readable-stream GitHub repository is -maintained by the WG and additional Collaborators who are added by the -WG on an ongoing basis. - -Individuals making significant and valuable contributions are made -Collaborators and given commit-access to the project. These -individuals are identified by the WG and their addition as -Collaborators is discussed during the WG meeting. - -_Note:_ If you make a significant contribution and are not considered -for commit-access log an issue or contact a WG member directly and it -will be brought up in the next WG meeting. - -Modifications of the contents of the readable-stream repository are -made on -a collaborative basis. Anybody with a GitHub account may propose a -modification via pull request and it will be considered by the project -Collaborators. All pull requests must be reviewed and accepted by a -Collaborator with sufficient expertise who is able to take full -responsibility for the change. In the case of pull requests proposed -by an existing Collaborator, an additional Collaborator is required -for sign-off. Consensus should be sought if additional Collaborators -participate and there is disagreement around a particular -modification. See _Consensus Seeking Process_ below for further detail -on the consensus model used for governance. - -Collaborators may opt to elevate significant or controversial -modifications, or modifications that have not found consensus to the -WG for discussion by assigning the ***WG-agenda*** tag to a pull -request or issue. The WG should serve as the final arbiter where -required. - -For the current list of Collaborators, see the project -[README.md](./README.md#members). - -### WG Membership - -WG seats are not time-limited. There is no fixed size of the WG. -However, the expected target is between 6 and 12, to ensure adequate -coverage of important areas of expertise, balanced with the ability to -make decisions efficiently. - -There is no specific set of requirements or qualifications for WG -membership beyond these rules. - -The WG may add additional members to the WG by unanimous consensus. - -A WG member may be removed from the WG by voluntary resignation, or by -unanimous consensus of all other WG members. - -Changes to WG membership should be posted in the agenda, and may be -suggested as any other agenda item (see "WG Meetings" below). - -If an addition or removal is proposed during a meeting, and the full -WG is not in attendance to participate, then the addition or removal -is added to the agenda for the subsequent meeting. This is to ensure -that all members are given the opportunity to participate in all -membership decisions. If a WG member is unable to attend a meeting -where a planned membership decision is being made, then their consent -is assumed. - -No more than 1/3 of the WG members may be affiliated with the same -employer. If removal or resignation of a WG member, or a change of -employment by a WG member, creates a situation where more than 1/3 of -the WG membership shares an employer, then the situation must be -immediately remedied by the resignation or removal of one or more WG -members affiliated with the over-represented employer(s). - -### WG Meetings - -The WG meets occasionally on a Google Hangout On Air. A designated moderator -approved by the WG runs the meeting. Each meeting should be -published to YouTube. - -Items are added to the WG agenda that are considered contentious or -are modifications of governance, contribution policy, WG membership, -or release process. - -The intention of the agenda is not to approve or review all patches; -that should happen continuously on GitHub and be handled by the larger -group of Collaborators. - -Any community member or contributor can ask that something be added to -the next meeting's agenda by logging a GitHub Issue. Any Collaborator, -WG member or the moderator can add the item to the agenda by adding -the ***WG-agenda*** tag to the issue. - -Prior to each WG meeting the moderator will share the Agenda with -members of the WG. WG members can add any items they like to the -agenda at the beginning of each meeting. The moderator and the WG -cannot veto or remove items. - -The WG may invite persons or representatives from certain projects to -participate in a non-voting capacity. - -The moderator is responsible for summarizing the discussion of each -agenda item and sends it as a pull request after the meeting. - -### Consensus Seeking Process - -The WG follows a -[Consensus -Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) -decision-making model. - -When an agenda item has appeared to reach a consensus the moderator -will ask "Does anyone object?" as a final call for dissent from the -consensus. - -If an agenda item cannot reach a consensus a WG member can call for -either a closing vote or a vote to table the issue to the next -meeting. The call for a vote must be seconded by a majority of the WG -or else the discussion will continue. Simple majority wins. - -Note that changes to WG membership require a majority consensus. See -"WG Membership" above. diff --git a/node_modules/readable-stream/LICENSE b/node_modules/readable-stream/LICENSE deleted file mode 100644 index 2873b3b2e..000000000 --- a/node_modules/readable-stream/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Node.js is licensed for use as follows: - -""" -Copyright Node.js contributors. All rights reserved. - -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. -""" - -This license applies to parts of Node.js originating from the -https://github.com/joyent/node repository: - -""" -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/node_modules/readable-stream/README.md b/node_modules/readable-stream/README.md deleted file mode 100644 index 23fe3f3e3..000000000 --- a/node_modules/readable-stream/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# readable-stream - -***Node-core v8.11.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) - - -[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) -[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) - - -[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) - -```bash -npm install --save readable-stream -``` - -***Node-core streams for userland*** - -This package is a mirror of the Streams2 and Streams3 implementations in -Node-core. - -Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html). - -If you want to guarantee a stable streams base, regardless of what version of -Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). - -As of version 2.0.0 **readable-stream** uses semantic versioning. - -# Streams Working Group - -`readable-stream` is maintained by the Streams Working Group, which -oversees the development and maintenance of the Streams API within -Node.js. The responsibilities of the Streams Working Group include: - -* Addressing stream issues on the Node.js issue tracker. -* Authoring and editing stream documentation within the Node.js project. -* Reviewing changes to stream subclasses within the Node.js project. -* Redirecting changes to streams from the Node.js project to this - project. -* Assisting in the implementation of stream providers within Node.js. -* Recommending versions of `readable-stream` to be included in Node.js. -* Messaging about the future of streams to give the community advance - notice of changes. - - -## Team Members - -* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> - - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B -* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> - - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 -* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> - - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D -* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> -* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> -* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> -* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> - - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E -* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> diff --git a/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md deleted file mode 100644 index 83275f192..000000000 --- a/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +++ /dev/null @@ -1,60 +0,0 @@ -# streams WG Meeting 2015-01-30 - -## Links - -* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg -* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 -* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ - -## Agenda - -Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. - -* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) -* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) -* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) -* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) - -## Minutes - -### adopt a charter - -* group: +1's all around - -### What versioning scheme should be adopted? -* group: +1’s 3.0.0 -* domenic+group: pulling in patches from other sources where appropriate -* mikeal: version independently, suggesting versions for io.js -* mikeal+domenic: work with TC to notify in advance of changes -simpler stream creation - -### streamline creation of streams -* sam: streamline creation of streams -* domenic: nice simple solution posted - but, we lose the opportunity to change the model - may not be backwards incompatible (double check keys) - - **action item:** domenic will check - -### remove implicit flowing of streams on(‘data’) -* add isFlowing / isPaused -* mikeal: worrying that we’re documenting polyfill methods – confuses users -* domenic: more reflective API is probably good, with warning labels for users -* new section for mad scientists (reflective stream access) -* calvin: name the “third state” -* mikeal: maybe borrow the name from whatwg? -* domenic: we’re missing the “third state” -* consensus: kind of difficult to name the third state -* mikeal: figure out differences in states / compat -* mathias: always flow on data – eliminates third state - * explore what it breaks - -**action items:** -* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) -* ask rod/build for infrastructure -* **chris**: explore the “flow on data” approach -* add isPaused/isFlowing -* add new docs section -* move isPaused to that section - - diff --git a/node_modules/readable-stream/duplex-browser.js b/node_modules/readable-stream/duplex-browser.js deleted file mode 100644 index f8b2db83d..000000000 --- a/node_modules/readable-stream/duplex-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/_stream_duplex.js'); diff --git a/node_modules/readable-stream/duplex.js b/node_modules/readable-stream/duplex.js deleted file mode 100644 index 46924cbfd..000000000 --- a/node_modules/readable-stream/duplex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./readable').Duplex diff --git a/node_modules/readable-stream/lib/_stream_duplex.js b/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index a1ca813e5..000000000 --- a/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,131 +0,0 @@ -// 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. - -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -/**/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - keys.push(key); - }return keys; -}; -/**/ - -module.exports = Duplex; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); - -util.inherits(Duplex, Readable); - -{ - // avoid scope creep, the keys array can then be collected - var keys = objectKeys(Writable.prototype); - for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; - } -} - -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) this.readable = false; - - if (options && options.writable === false) this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - - this.once('end', onend); -} - -Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) return; - - // no more data can be written. - // But allow more writes to happen in this tick. - pna.nextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -Object.defineProperty(Duplex.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined || this._writableState === undefined) { - return false; - } - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (this._readableState === undefined || this._writableState === undefined) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - this._writableState.destroyed = value; - } -}); - -Duplex.prototype._destroy = function (err, cb) { - this.push(null); - this.end(); - - pna.nextTick(cb, err); -}; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/_stream_passthrough.js b/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index a9c835884..000000000 --- a/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,47 +0,0 @@ -// 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. - -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -'use strict'; - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - - Transform.call(this, options); -} - -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/_stream_readable.js b/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index bf34ac65e..000000000 --- a/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,1019 +0,0 @@ -// 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. - -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -module.exports = Readable; - -/**/ -var isArray = require('isarray'); -/**/ - -/**/ -var Duplex; -/**/ - -Readable.ReadableState = ReadableState; - -/**/ -var EE = require('events').EventEmitter; - -var EElistenerCount = function (emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ -var Stream = require('./internal/streams/stream'); -/**/ - -/**/ - -var Buffer = require('safe-buffer').Buffer; -var OurUint8Array = global.Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -/**/ - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var debugUtil = require('util'); -var debug = void 0; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - -var BufferList = require('./internal/streams/BufferList'); -var destroyImpl = require('./internal/streams/destroy'); -var StringDecoder; - -util.inherits(Readable, Stream); - -var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; - -function prependListener(emitter, event, fn) { - // Sadly this is not cacheable as some libraries bundle their own - // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); - - // This is a hack to make sure that our error handler is attached before any - // userland ones. NEVER DO THIS. This is here only because this code needs - // to continue to work with older versions of Node.js that do not include - // the prependListener() method. The goal is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; -} - -function ReadableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var readableHwm = options.readableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; - - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); - - // A linked list is used to store data chunks instead of an array because the - // linked list can remove elements from the beginning faster than - // array.shift() - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the event 'readable'/'data' is emitted - // immediately, or on a later tick. We set this to true at first, because - // any actions that shouldn't happen until "later" should generally also - // not happen before the first read call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - - // has it been destroyed - this.destroyed = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -function Readable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - if (!(this instanceof Readable)) return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - if (options) { - if (typeof options.read === 'function') this._read = options.read; - - if (typeof options.destroy === 'function') this._destroy = options.destroy; - } - - Stream.call(this); -} - -Object.defineProperty(Readable.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined) { - return false; - } - return this._readableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._readableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - } -}); - -Readable.prototype.destroy = destroyImpl.destroy; -Readable.prototype._undestroy = destroyImpl.undestroy; -Readable.prototype._destroy = function (err, cb) { - this.push(null); - cb(err); -}; - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; - - if (!state.objectMode) { - if (typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = Buffer.from(chunk, encoding); - encoding = ''; - } - skipChunkCheck = true; - } - } else { - skipChunkCheck = true; - } - - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - return readableAddChunk(this, chunk, null, true, false); -}; - -function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - var state = stream._readableState; - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (addToFront) { - if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); - } else if (state.ended) { - stream.emit('error', new Error('stream.push() after EOF')); - } else { - state.reading = false; - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } - } - } else if (!addToFront) { - state.reading = false; - } - } - - return needMoreData(state); -} - -function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - - if (state.needReadable) emitReadable(stream); - } - maybeReadMore(stream, state); -} - -function chunkInvalid(state, chunk) { - var er; - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); -} - -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; - -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 8MB -var MAX_HWM = 0x800000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 to prevent increasing hwm excessively in - // tiny amounts - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - return n; -} - -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - if (n !== n) { - // Only flow one buffer at a time - if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; - } - // If we're asking for more than the current hwm, then raise the hwm. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; - // Don't have enough - if (!state.ended) { - state.needReadable = true; - return 0; - } - return state.length; -} - -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function (n) { - debug('read', n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - - if (n !== 0) state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); - - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } - - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); - - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } - - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } else if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (!state.reading) n = howMuchToRead(nOrig, state); - } - - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; - - if (ret === null) { - state.needReadable = true; - n = 0; - } else { - state.length -= n; - } - - if (state.length === 0) { - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; - - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended) endReadable(this); - } - - if (ret !== null) this.emit('data', ret); - - return ret; -}; - -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); -} - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); - } -} - -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); -} - -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - pna.nextTick(maybeReadMore_, stream, state); - } -} - -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break;else len = state.length; - } - state.readingMore = false; -} - -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function (n) { - this.emit('error', new Error('_read() is not implemented')); -}; - -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); - - dest.on('unpipe', onunpipe); - function onunpipe(readable, unpipeInfo) { - debug('onunpipe'); - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } - } - - function onend() { - debug('onend'); - dest.end(); - } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', unpipe); - src.removeListener('data', ondata); - - cleanedUp = true; - - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - - // If the user pushes more data while we're writing to dest then we'll end up - // in ondata again. However, we only want to increase awaitDrain once because - // dest will only emit one 'drain' event for the multiple writes. - // => Introduce a guard on increasing awaitDrain. - var increasedAwaitDrain = false; - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - increasedAwaitDrain = false; - var ret = dest.write(chunk); - if (false === ret && !increasedAwaitDrain) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', src._readableState.awaitDrain); - src._readableState.awaitDrain++; - increasedAwaitDrain = true; - } - src.pause(); - } - } - - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); - } - - // Make sure our error handler is attached before userland ones. - prependListener(dest, 'error', onerror); - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } - - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function () { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - var unpipeInfo = { hasUnpiped: false }; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - - if (!dest) dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this, unpipeInfo); - return this; - } - - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var i = 0; i < len; i++) { - dests[i].emit('unpipe', this, unpipeInfo); - }return this; - } - - // try to find the right one. - var index = indexOf(state.pipes, dest); - if (index === -1) return this; - - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; - - dest.emit('unpipe', this, unpipeInfo); - - return this; -}; - -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - - if (ev === 'data') { - // Start flowing on next tick if stream isn't explicitly paused - if (this._readableState.flowing !== false) this.resume(); - } else if (ev === 'readable') { - var state = this._readableState; - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.emittedReadable = false; - if (!state.reading) { - pna.nextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this); - } - } - } - - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; - -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} - -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); - } - return this; -}; - -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - pna.nextTick(resume_, stream, state); - } -} - -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } - - state.resumeScheduled = false; - state.awaitDrain = 0; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} - -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; - -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - while (state.flowing && stream.read() !== null) {} -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function (stream) { - var _this = this; - - var state = this._readableState; - var paused = false; - - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); - } - - _this.push(null); - }); - - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); - - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - - var ret = _this.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function (method) { - return function () { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } - - // proxy certain important events. - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - this._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; - - return this; -}; - -Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._readableState.highWaterMark; - } -}); - -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromList(n, state) { - // nothing buffered - if (state.length === 0) return null; - - var ret; - if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { - // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = fromListPartial(n, state.buffer, state.decoder); - } - - return ret; -} - -// Extracts only enough buffered data to satisfy the amount requested. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromListPartial(n, list, hasStrings) { - var ret; - if (n < list.head.data.length) { - // slice is the same for buffers and strings - ret = list.head.data.slice(0, n); - list.head.data = list.head.data.slice(n); - } else if (n === list.head.data.length) { - // first chunk is a perfect match - ret = list.shift(); - } else { - // result spans more than one buffer - ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); - } - return ret; -} - -// Copies a specified amount of characters from the list of buffered data -// chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBufferString(n, list) { - var p = list.head; - var c = 1; - var ret = p.data; - n -= ret.length; - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = str.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; -} - -// Copies a specified amount of bytes from the list of buffered data chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBuffer(n, list) { - var ret = Buffer.allocUnsafe(n); - var p = list.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = buf.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - pna.nextTick(endReadableNT, state, stream); - } -} - -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } -} - -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; -} \ No newline at end of file diff --git a/node_modules/readable-stream/lib/_stream_transform.js b/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index 5d1f8b876..000000000 --- a/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,214 +0,0 @@ -// 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. - -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - -'use strict'; - -module.exports = Transform; - -var Duplex = require('./_stream_duplex'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(Transform, Duplex); - -function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) { - return this.emit('error', new Error('write callback called multiple times')); - } - - ts.writechunk = null; - ts.writecb = null; - - if (data != null) // single equals check for both `null` and `undefined` - this.push(data); - - cb(er); - - var rs = this._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); - } -} - -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - - Duplex.call(this, options); - - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - - if (typeof options.flush === 'function') this._flush = options.flush; - } - - // When the writable side finishes, then flush out anything remaining. - this.on('prefinish', prefinish); -} - -function prefinish() { - var _this = this; - - if (typeof this._flush === 'function') { - this._flush(function (er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); - } -} - -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - throw new Error('_transform() is not implemented'); -}; - -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; - - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - -Transform.prototype._destroy = function (err, cb) { - var _this2 = this; - - Duplex.prototype._destroy.call(this, err, function (err2) { - cb(err2); - _this2.emit('close'); - }); -}; - -function done(stream, er, data) { - if (er) return stream.emit('error', er); - - if (data != null) // single equals check for both `null` and `undefined` - stream.push(data); - - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); - - if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); - - return stream.push(null); -} \ No newline at end of file diff --git a/node_modules/readable-stream/lib/_stream_writable.js b/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index b3f4e85a2..000000000 --- a/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,687 +0,0 @@ -// 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. - -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. - -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -module.exports = Writable; - -/* */ -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} - -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; - - this.next = null; - this.entry = null; - this.finish = function () { - onCorkedFinish(_this, state); - }; -} -/* */ - -/**/ -var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; -/**/ - -/**/ -var Duplex; -/**/ - -Writable.WritableState = WritableState; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var internalUtil = { - deprecate: require('util-deprecate') -}; -/**/ - -/**/ -var Stream = require('./internal/streams/stream'); -/**/ - -/**/ - -var Buffer = require('safe-buffer').Buffer; -var OurUint8Array = global.Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -/**/ - -var destroyImpl = require('./internal/streams/destroy'); - -util.inherits(Writable, Stream); - -function nop() {} - -function WritableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - - if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var writableHwm = options.writableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; - - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); - - // if _final has been called - this.finalCalled = false; - - // drain event flag. - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // has it been destroyed - this.destroyed = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // when true all writes will be buffered until .uncork() call - this.corked = 0; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - - this.bufferedRequest = null; - this.lastBufferedRequest = null; - - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; - - // count buffered requests - this.bufferedRequestCount = 0; - - // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - this.corkedRequestsFree = new CorkedRequest(this); -} - -WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; -}; - -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function () { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') - }); - } catch (_) {} -})(); - -// Test _writableState for inheritance to account for Duplex streams, -// whose prototype chain only points to Readable. -var realHasInstance; -if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function (object) { - if (realHasInstance.call(this, object)) return true; - if (this !== Writable) return false; - - return object && object._writableState instanceof WritableState; - } - }); -} else { - realHasInstance = function (object) { - return object instanceof this; - }; -} - -function Writable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - // Writable ctor is applied to Duplexes, too. - // `realHasInstance` is necessary because using plain `instanceof` - // would return false, as no `_writableState` property is attached. - - // Trying to use the custom `instanceof` for Writable here will also break the - // Node.js LazyTransform implementation, which has a non-trivial getter for - // `_writableState` that would lead to infinite recursion. - if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { - return new Writable(options); - } - - this._writableState = new WritableState(options, this); - - // legacy. - this.writable = true; - - if (options) { - if (typeof options.write === 'function') this._write = options.write; - - if (typeof options.writev === 'function') this._writev = options.writev; - - if (typeof options.destroy === 'function') this._destroy = options.destroy; - - if (typeof options.final === 'function') this._final = options.final; - } - - Stream.call(this); -} - -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe, not readable')); -}; - -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - pna.nextTick(cb, er); -} - -// Checks that a user-supplied chunk is valid, especially for the particular -// mode the stream is in. Currently this means that `null` is never accepted -// and undefined/non-string values are only allowed in object mode. -function validChunk(stream, state, chunk, cb) { - var valid = true; - var er = false; - - if (chunk === null) { - er = new TypeError('May not write null values to stream'); - } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - if (er) { - stream.emit('error', er); - pna.nextTick(cb, er); - valid = false; - } - return valid; -} - -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - var isBuf = !state.objectMode && _isUint8Array(chunk); - - if (isBuf && !Buffer.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - - if (typeof cb !== 'function') cb = nop; - - if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - - return ret; -}; - -Writable.prototype.cork = function () { - var state = this._writableState; - - state.corked++; -}; - -Writable.prototype.uncork = function () { - var state = this._writableState; - - if (state.corked) { - state.corked--; - - if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } -}; - -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer.from(chunk, encoding); - } - return chunk; -} - -Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - if (chunk !== newChunk) { - isBuf = true; - encoding = 'buffer'; - chunk = newChunk; - } - } - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk: chunk, - encoding: encoding, - isBuf: isBuf, - callback: cb, - next: null - }; - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - - if (sync) { - // defer the callback if we are being called synchronously - // to avoid piling up things on the stack - pna.nextTick(cb, er); - // this can emit finish, and it will always happen - // after error - pna.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - } else { - // the caller expect this to happen before if - // it is async - cb(er); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - // this can emit finish, but finish must - // always follow error - finishMaybe(stream, state); - } -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - - onwriteStateUpdate(state); - - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); - - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - /**/ - asyncWrite(afterWrite, stream, state, finished, cb); - /**/ - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} - -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - - var count = 0; - var allBuffers = true; - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } - buffer.allBuffers = allBuffers; - - doWrite(stream, state, true, state.length, buffer, '', holder.finish); - - // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - state.bufferedRequestCount = 0; - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } - - if (entry === null) state.lastBufferedRequest = null; - } - - state.bufferedRequest = entry; - state.bufferProcessing = false; -} - -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new Error('_write() is not implemented')); -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } - - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) endWritable(this, state, cb); -}; - -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} -function callFinal(stream, state) { - stream._final(function (err) { - state.pendingcb--; - if (err) { - stream.emit('error', err); - } - state.prefinished = true; - stream.emit('prefinish'); - finishMaybe(stream, state); - }); -} -function prefinish(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === 'function') { - state.pendingcb++; - state.finalCalled = true; - pna.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit('prefinish'); - } - } -} - -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - prefinish(stream, state); - if (state.pendingcb === 0) { - state.finished = true; - stream.emit('finish'); - } - } - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); - } - state.ended = true; - stream.writable = false; -} - -function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - if (state.corkedRequestsFree) { - state.corkedRequestsFree.next = corkReq; - } else { - state.corkedRequestsFree = corkReq; - } -} - -Object.defineProperty(Writable.prototype, 'destroyed', { - get: function () { - if (this._writableState === undefined) { - return false; - } - return this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._writableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._writableState.destroyed = value; - } -}); - -Writable.prototype.destroy = destroyImpl.destroy; -Writable.prototype._undestroy = destroyImpl.undestroy; -Writable.prototype._destroy = function (err, cb) { - this.end(); - cb(err); -}; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/internal/streams/BufferList.js b/node_modules/readable-stream/lib/internal/streams/BufferList.js deleted file mode 100644 index aefc68bd9..000000000 --- a/node_modules/readable-stream/lib/internal/streams/BufferList.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var Buffer = require('safe-buffer').Buffer; -var util = require('util'); - -function copyBuffer(src, target, offset) { - src.copy(target, offset); -} - -module.exports = function () { - function BufferList() { - _classCallCheck(this, BufferList); - - this.head = null; - this.tail = null; - this.length = 0; - } - - BufferList.prototype.push = function push(v) { - var entry = { data: v, next: null }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; - }; - - BufferList.prototype.unshift = function unshift(v) { - var entry = { data: v, next: this.head }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - }; - - BufferList.prototype.shift = function shift() { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; - }; - - BufferList.prototype.clear = function clear() { - this.head = this.tail = null; - this.length = 0; - }; - - BufferList.prototype.join = function join(s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - while (p = p.next) { - ret += s + p.data; - }return ret; - }; - - BufferList.prototype.concat = function concat(n) { - if (this.length === 0) return Buffer.alloc(0); - if (this.length === 1) return this.head.data; - var ret = Buffer.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } - return ret; - }; - - return BufferList; -}(); - -if (util && util.inspect && util.inspect.custom) { - module.exports.prototype[util.inspect.custom] = function () { - var obj = util.inspect({ length: this.length }); - return this.constructor.name + ' ' + obj; - }; -} \ No newline at end of file diff --git a/node_modules/readable-stream/lib/internal/streams/destroy.js b/node_modules/readable-stream/lib/internal/streams/destroy.js deleted file mode 100644 index 5a0a0d88c..000000000 --- a/node_modules/readable-stream/lib/internal/streams/destroy.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -// undocumented cb() API, needed for core, not for public API -function destroy(err, cb) { - var _this = this; - - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; - - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { - pna.nextTick(emitErrorNT, this, err); - } - return this; - } - - // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks - - if (this._readableState) { - this._readableState.destroyed = true; - } - - // if this is a duplex stream mark the writable part as destroyed as well - if (this._writableState) { - this._writableState.destroyed = true; - } - - this._destroy(err || null, function (err) { - if (!cb && err) { - pna.nextTick(emitErrorNT, _this, err); - if (_this._writableState) { - _this._writableState.errorEmitted = true; - } - } else if (cb) { - cb(err); - } - }); - - return this; -} - -function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } - - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } -} - -function emitErrorNT(self, err) { - self.emit('error', err); -} - -module.exports = { - destroy: destroy, - undestroy: undestroy -}; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/node_modules/readable-stream/lib/internal/streams/stream-browser.js deleted file mode 100644 index 9332a3fda..000000000 --- a/node_modules/readable-stream/lib/internal/streams/stream-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('events').EventEmitter; diff --git a/node_modules/readable-stream/lib/internal/streams/stream.js b/node_modules/readable-stream/lib/internal/streams/stream.js deleted file mode 100644 index ce2ad5b6e..000000000 --- a/node_modules/readable-stream/lib/internal/streams/stream.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('stream'); diff --git a/node_modules/readable-stream/package.json b/node_modules/readable-stream/package.json deleted file mode 100644 index 2c57a036c..000000000 --- a/node_modules/readable-stream/package.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "_from": "readable-stream@^2.0.2", - "_id": "readable-stream@2.3.6", - "_inBundle": false, - "_integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "_location": "/readable-stream", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "readable-stream@^2.0.2", - "name": "readable-stream", - "escapedName": "readable-stream", - "rawSpec": "^2.0.2", - "saveSpec": null, - "fetchSpec": "^2.0.2" - }, - "_requiredBy": [ - "/browserify", - "/concat-stream", - "/duplexer2", - "/from2", - "/module-deps", - "/read-only-stream", - "/readdirp", - "/stdout-stream", - "/stream-browserify", - "/stream-combiner2", - "/stream-http", - "/stream-splicer", - "/through2" - ], - "_resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "_shasum": "b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf", - "_spec": "readable-stream@^2.0.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "browser": { - "util": false, - "./readable.js": "./readable-browser.js", - "./writable.js": "./writable-browser.js", - "./duplex.js": "./duplex-browser.js", - "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" - }, - "bugs": { - "url": "https://github.com/nodejs/readable-stream/issues" - }, - "bundleDependencies": false, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "deprecated": false, - "description": "Streams3, a user-land copy of the stream library from Node.js", - "devDependencies": { - "assert": "^1.4.0", - "babel-polyfill": "^6.9.1", - "buffer": "^4.9.0", - "lolex": "^2.3.2", - "nyc": "^6.4.0", - "tap": "^0.7.0", - "tape": "^4.8.0" - }, - "homepage": "https://github.com/nodejs/readable-stream#readme", - "keywords": [ - "readable", - "stream", - "pipe" - ], - "license": "MIT", - "main": "readable.js", - "name": "readable-stream", - "nyc": { - "include": [ - "lib/**.js" - ] - }, - "repository": { - "type": "git", - "url": "git://github.com/nodejs/readable-stream.git" - }, - "scripts": { - "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", - "cover": "nyc npm test", - "report": "nyc report --reporter=lcov", - "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js" - }, - "version": "2.3.6" -} diff --git a/node_modules/readable-stream/passthrough.js b/node_modules/readable-stream/passthrough.js deleted file mode 100644 index ffd791d7f..000000000 --- a/node_modules/readable-stream/passthrough.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./readable').PassThrough diff --git a/node_modules/readable-stream/readable-browser.js b/node_modules/readable-stream/readable-browser.js deleted file mode 100644 index e50372592..000000000 --- a/node_modules/readable-stream/readable-browser.js +++ /dev/null @@ -1,7 +0,0 @@ -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = exports; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/node_modules/readable-stream/readable.js b/node_modules/readable-stream/readable.js deleted file mode 100644 index ec89ec533..000000000 --- a/node_modules/readable-stream/readable.js +++ /dev/null @@ -1,19 +0,0 @@ -var Stream = require('stream'); -if (process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream; - exports = module.exports = Stream.Readable; - exports.Readable = Stream.Readable; - exports.Writable = Stream.Writable; - exports.Duplex = Stream.Duplex; - exports.Transform = Stream.Transform; - exports.PassThrough = Stream.PassThrough; - exports.Stream = Stream; -} else { - exports = module.exports = require('./lib/_stream_readable.js'); - exports.Stream = Stream || exports; - exports.Readable = exports; - exports.Writable = require('./lib/_stream_writable.js'); - exports.Duplex = require('./lib/_stream_duplex.js'); - exports.Transform = require('./lib/_stream_transform.js'); - exports.PassThrough = require('./lib/_stream_passthrough.js'); -} diff --git a/node_modules/readable-stream/transform.js b/node_modules/readable-stream/transform.js deleted file mode 100644 index b1baba26d..000000000 --- a/node_modules/readable-stream/transform.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./readable').Transform diff --git a/node_modules/readable-stream/writable-browser.js b/node_modules/readable-stream/writable-browser.js deleted file mode 100644 index ebdde6a85..000000000 --- a/node_modules/readable-stream/writable-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/_stream_writable.js'); diff --git a/node_modules/readable-stream/writable.js b/node_modules/readable-stream/writable.js deleted file mode 100644 index 3211a6f80..000000000 --- a/node_modules/readable-stream/writable.js +++ /dev/null @@ -1,8 +0,0 @@ -var Stream = require("stream") -var Writable = require("./lib/_stream_writable.js") - -if (process.env.READABLE_STREAM === 'disable') { - module.exports = Stream && Stream.Writable || Writable -} else { - module.exports = Writable -} diff --git a/node_modules/readdirp/LICENSE b/node_modules/readdirp/LICENSE deleted file mode 100644 index 8a63b80ba..000000000 --- a/node_modules/readdirp/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -This software is released under the MIT license: - -Copyright (c) 2012-2015 Thorsten Lorenz - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/readdirp/README.md b/node_modules/readdirp/README.md deleted file mode 100644 index 431f40258..000000000 --- a/node_modules/readdirp/README.md +++ /dev/null @@ -1,204 +0,0 @@ -# readdirp [![Build Status](https://secure.travis-ci.org/thlorenz/readdirp.svg)](http://travis-ci.org/thlorenz/readdirp) - -[![NPM](https://nodei.co/npm/readdirp.png?downloads=true&stars=true)](https://nodei.co/npm/readdirp/) - -Recursive version of [fs.readdir](http://nodejs.org/docs/latest/api/fs.html#fs_fs_readdir_path_callback). Exposes a **stream api**. - -```javascript -var readdirp = require('readdirp') - , path = require('path') - , es = require('event-stream'); - -// print out all JavaScript files along with their size - -var stream = readdirp({ root: path.join(__dirname), fileFilter: '*.js' }); -stream - .on('warn', function (err) { - console.error('non-fatal error', err); - // optionally call stream.destroy() here in order to abort and cause 'close' to be emitted - }) - .on('error', function (err) { console.error('fatal error', err); }) - .pipe(es.mapSync(function (entry) { - return { path: entry.path, size: entry.stat.size }; - })) - .pipe(es.stringify()) - .pipe(process.stdout); -``` - -Meant to be one of the recursive versions of [fs](http://nodejs.org/docs/latest/api/fs.html) functions, e.g., like [mkdirp](https://github.com/substack/node-mkdirp). - -**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* - -- [Installation](#installation) -- [API](#api) - - [entry stream](#entry-stream) - - [options](#options) - - [entry info](#entry-info) - - [Filters](#filters) - - [Callback API](#callback-api) - - [allProcessed ](#allprocessed) - - [fileProcessed](#fileprocessed) -- [More Examples](#more-examples) - - [stream api](#stream-api) - - [stream api pipe](#stream-api-pipe) - - [grep](#grep) - - [using callback api](#using-callback-api) - - [tests](#tests) - - -# Installation - - npm install readdirp - -# API - -***var entryStream = readdirp (options)*** - -Reads given root recursively and returns a `stream` of [entry info](#entry-info)s. - -## entry stream - -Behaves as follows: - -- `emit('data')` passes an [entry info](#entry-info) whenever one is found -- `emit('warn')` passes a non-fatal `Error` that prevents a file/directory from being processed (i.e., if it is - inaccessible to the user) -- `emit('error')` passes a fatal `Error` which also ends the stream (i.e., when illegal options where passed) -- `emit('end')` called when all entries were found and no more will be emitted (i.e., we are done) -- `emit('close')` called when the stream is destroyed via `stream.destroy()` (which could be useful if you want to - manually abort even on a non fatal error) - at that point the stream is no longer `readable` and no more entries, - warning or errors are emitted -- to learn more about streams, consult the very detailed - [nodejs streams documentation](http://nodejs.org/api/stream.html) or the - [stream-handbook](https://github.com/substack/stream-handbook) - - -## options - -- **root**: path in which to start reading and recursing into subdirectories - -- **fileFilter**: filter to include/exclude files found (see [Filters](#filters) for more) - -- **directoryFilter**: filter to include/exclude directories found and to recurse into (see [Filters](#filters) for more) - -- **depth**: depth at which to stop recursing even if more subdirectories are found - -- **entryType**: determines if data events on the stream should be emitted for `'files'`, `'directories'`, `'both'`, or `'all'`. Setting to `'all'` will also include entries for other types of file descriptors like character devices, unix sockets and named pipes. Defaults to `'files'`. - -- **lstat**: if `true`, readdirp uses `fs.lstat` instead of `fs.stat` in order to stat files and includes symlink entries in the stream along with files. - -## entry info - -Has the following properties: - -- **parentDir** : directory in which entry was found (relative to given root) -- **fullParentDir** : full path to parent directory -- **name** : name of the file/directory -- **path** : path to the file/directory (relative to given root) -- **fullPath** : full path to the file/directory found -- **stat** : built in [stat object](http://nodejs.org/docs/v0.4.9/api/fs.html#fs.Stats) -- **Example**: (assuming root was `/User/dev/readdirp`) - - parentDir : 'test/bed/root_dir1', - fullParentDir : '/User/dev/readdirp/test/bed/root_dir1', - name : 'root_dir1_subdir1', - path : 'test/bed/root_dir1/root_dir1_subdir1', - fullPath : '/User/dev/readdirp/test/bed/root_dir1/root_dir1_subdir1', - stat : [ ... ] - -## Filters - -There are three different ways to specify filters for files and directories respectively. - -- **function**: a function that takes an entry info as a parameter and returns true to include or false to exclude the entry - -- **glob string**: a string (e.g., `*.js`) which is matched using [minimatch](https://github.com/isaacs/minimatch), so go there for more - information. - - Globstars (`**`) are not supported since specifying a recursive pattern for an already recursive function doesn't make sense. - - Negated globs (as explained in the minimatch documentation) are allowed, e.g., `!*.txt` matches everything but text files. - -- **array of glob strings**: either need to be all inclusive or all exclusive (negated) patterns otherwise an error is thrown. - - `[ '*.json', '*.js' ]` includes all JavaScript and Json files. - - - `[ '!.git', '!node_modules' ]` includes all directories except the '.git' and 'node_modules'. - -Directories that do not pass a filter will not be recursed into. - -## Callback API - -Although the stream api is recommended, readdirp also exposes a callback based api. - -***readdirp (options, callback1 [, callback2])*** - -If callback2 is given, callback1 functions as the **fileProcessed** callback, and callback2 as the **allProcessed** callback. - -If only callback1 is given, it functions as the **allProcessed** callback. - -### allProcessed - -- function with err and res parameters, e.g., `function (err, res) { ... }` -- **err**: array of errors that occurred during the operation, **res may still be present, even if errors occurred** -- **res**: collection of file/directory [entry infos](#entry-info) - -### fileProcessed - -- function with [entry info](#entry-info) parameter e.g., `function (entryInfo) { ... }` - - -# More Examples - -`on('error', ..)`, `on('warn', ..)` and `on('end', ..)` handling omitted for brevity - -```javascript -var readdirp = require('readdirp'); - -// Glob file filter -readdirp({ root: './test/bed', fileFilter: '*.js' }) - .on('data', function (entry) { - // do something with each JavaScript file entry - }); - -// Combined glob file filters -readdirp({ root: './test/bed', fileFilter: [ '*.js', '*.json' ] }) - .on('data', function (entry) { - // do something with each JavaScript and Json file entry - }); - -// Combined negated directory filters -readdirp({ root: './test/bed', directoryFilter: [ '!.git', '!*modules' ] }) - .on('data', function (entry) { - // do something with each file entry found outside '.git' or any modules directory - }); - -// Function directory filter -readdirp({ root: './test/bed', directoryFilter: function (di) { return di.name.length === 9; } }) - .on('data', function (entry) { - // do something with each file entry found inside directories whose name has length 9 - }); - -// Limiting depth -readdirp({ root: './test/bed', depth: 1 }) - .on('data', function (entry) { - // do something with each file entry found up to 1 subdirectory deep - }); - -// callback api -readdirp({ root: '.' }, function(fileInfo) { - // do something with file entry here - }, function (err, res) { - // all done, move on or do final step for all file entries here -}); -``` - -Try more examples by following [instructions](https://github.com/paulmillr/readdirp/blob/master/examples/Readme.md) -on how to get going. - -## tests - -The [readdirp tests](https://github.com/paulmillr/readdirp/blob/master/test/readdirp.js) also will give you a good idea on -how things work. - diff --git a/node_modules/readdirp/node_modules/arr-diff/LICENSE b/node_modules/readdirp/node_modules/arr-diff/LICENSE deleted file mode 100755 index d734237bd..000000000 --- a/node_modules/readdirp/node_modules/arr-diff/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/arr-diff/README.md b/node_modules/readdirp/node_modules/arr-diff/README.md deleted file mode 100644 index 961f5c3f1..000000000 --- a/node_modules/readdirp/node_modules/arr-diff/README.md +++ /dev/null @@ -1,130 +0,0 @@ -# arr-diff [![NPM version](https://img.shields.io/npm/v/arr-diff.svg?style=flat)](https://www.npmjs.com/package/arr-diff) [![NPM monthly downloads](https://img.shields.io/npm/dm/arr-diff.svg?style=flat)](https://npmjs.org/package/arr-diff) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/arr-diff.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/arr-diff) - -> Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save arr-diff -``` - -Install with [yarn](https://yarnpkg.com): - -```sh -$ yarn add arr-diff -``` - -Install with [bower](https://bower.io/) - -```sh -$ bower install arr-diff --save -``` - -## Usage - -Returns the difference between the first array and additional arrays. - -```js -var diff = require('arr-diff'); - -var a = ['a', 'b', 'c', 'd']; -var b = ['b', 'c']; - -console.log(diff(a, b)) -//=> ['a', 'd'] -``` - -## Benchmarks - -This library versus [array-differ](https://github.com/sindresorhus/array-differ), on April 14, 2017: - -``` -Benchmarking: (4 of 4) - · long-dupes - · long - · med - · short - -# benchmark/fixtures/long-dupes.js (100804 bytes) - arr-diff-3.0.0 x 822 ops/sec ±0.67% (86 runs sampled) - arr-diff-4.0.0 x 2,141 ops/sec ±0.42% (89 runs sampled) - array-differ x 708 ops/sec ±0.70% (89 runs sampled) - - fastest is arr-diff-4.0.0 - -# benchmark/fixtures/long.js (94529 bytes) - arr-diff-3.0.0 x 882 ops/sec ±0.60% (87 runs sampled) - arr-diff-4.0.0 x 2,329 ops/sec ±0.97% (83 runs sampled) - array-differ x 769 ops/sec ±0.61% (90 runs sampled) - - fastest is arr-diff-4.0.0 - -# benchmark/fixtures/med.js (708 bytes) - arr-diff-3.0.0 x 856,150 ops/sec ±0.42% (89 runs sampled) - arr-diff-4.0.0 x 4,665,249 ops/sec ±1.06% (89 runs sampled) - array-differ x 653,888 ops/sec ±1.02% (86 runs sampled) - - fastest is arr-diff-4.0.0 - -# benchmark/fixtures/short.js (60 bytes) - arr-diff-3.0.0 x 3,078,467 ops/sec ±0.77% (93 runs sampled) - arr-diff-4.0.0 x 9,213,296 ops/sec ±0.65% (89 runs sampled) - array-differ x 1,337,051 ops/sec ±0.91% (92 runs sampled) - - fastest is arr-diff-4.0.0 -``` - -## About - -### Related projects - -* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays. This is the fastest implementation of array flatten.") -* [array-filter](https://www.npmjs.com/package/array-filter): Array#filter for older browsers. | [homepage](https://github.com/juliangruber/array-filter "Array#filter for older browsers.") -* [array-intersection](https://www.npmjs.com/package/array-intersection): Return an array with the unique values present in _all_ given arrays using strict equality… [more](https://github.com/jonschlinkert/array-intersection) | [homepage](https://github.com/jonschlinkert/array-intersection "Return an array with the unique values present in _all_ given arrays using strict equality for comparisons.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 33 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [paulmillr](https://github.com/paulmillr) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 14, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/arr-diff/index.js b/node_modules/readdirp/node_modules/arr-diff/index.js deleted file mode 100644 index 90f280772..000000000 --- a/node_modules/readdirp/node_modules/arr-diff/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/*! - * arr-diff - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -module.exports = function diff(arr/*, arrays*/) { - var len = arguments.length; - var idx = 0; - while (++idx < len) { - arr = diffArray(arr, arguments[idx]); - } - return arr; -}; - -function diffArray(one, two) { - if (!Array.isArray(two)) { - return one.slice(); - } - - var tlen = two.length - var olen = one.length; - var idx = -1; - var arr = []; - - while (++idx < olen) { - var ele = one[idx]; - - var hasEle = false; - for (var i = 0; i < tlen; i++) { - var val = two[i]; - - if (ele === val) { - hasEle = true; - break; - } - } - - if (hasEle === false) { - arr.push(ele); - } - } - return arr; -} diff --git a/node_modules/readdirp/node_modules/arr-diff/package.json b/node_modules/readdirp/node_modules/arr-diff/package.json deleted file mode 100644 index 8227e5980..000000000 --- a/node_modules/readdirp/node_modules/arr-diff/package.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "_from": "arr-diff@^4.0.0", - "_id": "arr-diff@4.0.0", - "_inBundle": false, - "_integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "_location": "/readdirp/arr-diff", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "arr-diff@^4.0.0", - "name": "arr-diff", - "escapedName": "arr-diff", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/readdirp/micromatch" - ], - "_resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "_shasum": "d6461074febfec71e7e15235761a329a5dc7c520", - "_spec": "arr-diff@^4.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/arr-diff/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jon Schlinkert", - "email": "jon.schlinkert@sellside.com", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Paul Miller", - "email": "paul+gh@paulmillr.com", - "url": "paulmillr.com" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.", - "devDependencies": { - "ansi-bold": "^0.1.1", - "arr-flatten": "^1.0.1", - "array-differ": "^1.0.0", - "benchmarked": "^0.2.4", - "gulp-format-md": "^0.1.9", - "minimist": "^1.2.0", - "mocha": "^2.4.5" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/arr-diff", - "keywords": [ - "arr", - "array", - "array differ", - "array-differ", - "diff", - "differ", - "difference" - ], - "license": "MIT", - "main": "index.js", - "name": "arr-diff", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/arr-diff.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "arr-flatten", - "array-filter", - "array-intersection" - ] - }, - "reflinks": [ - "array-differ", - "verb" - ], - "lint": { - "reflinks": true - } - }, - "version": "4.0.0" -} diff --git a/node_modules/readdirp/node_modules/array-unique/LICENSE b/node_modules/readdirp/node_modules/array-unique/LICENSE deleted file mode 100755 index 842218cf0..000000000 --- a/node_modules/readdirp/node_modules/array-unique/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2016, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/array-unique/README.md b/node_modules/readdirp/node_modules/array-unique/README.md deleted file mode 100755 index 41c8c904e..000000000 --- a/node_modules/readdirp/node_modules/array-unique/README.md +++ /dev/null @@ -1,77 +0,0 @@ -# array-unique [![NPM version](https://img.shields.io/npm/v/array-unique.svg?style=flat)](https://www.npmjs.com/package/array-unique) [![NPM downloads](https://img.shields.io/npm/dm/array-unique.svg?style=flat)](https://npmjs.org/package/array-unique) [![Build Status](https://img.shields.io/travis/jonschlinkert/array-unique.svg?style=flat)](https://travis-ci.org/jonschlinkert/array-unique) - -Remove duplicate values from an array. Fastest ES5 implementation. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save array-unique -``` - -## Usage - -```js -var unique = require('array-unique'); - -var arr = ['a', 'b', 'c', 'c']; -console.log(unique(arr)) //=> ['a', 'b', 'c'] -console.log(arr) //=> ['a', 'b', 'c'] - -/* The above modifies the input array. To prevent that at a slight performance cost: */ -var unique = require("array-unique").immutable; - -var arr = ['a', 'b', 'c', 'c']; -console.log(unique(arr)) //=> ['a', 'b', 'c'] -console.log(arr) //=> ['a', 'b', 'c', 'c'] -``` - -## About - -### Related projects - -* [arr-diff](https://www.npmjs.com/package/arr-diff): Returns an array with only the unique values from the first array, by excluding all… [more](https://github.com/jonschlinkert/arr-diff) | [homepage](https://github.com/jonschlinkert/arr-diff "Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.") -* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays. This is the fastest implementation of array flatten.") -* [arr-map](https://www.npmjs.com/package/arr-map): Faster, node.js focused alternative to JavaScript's native array map. | [homepage](https://github.com/jonschlinkert/arr-map "Faster, node.js focused alternative to JavaScript's native array map.") -* [arr-pluck](https://www.npmjs.com/package/arr-pluck): Retrieves the value of a specified property from all elements in the collection. | [homepage](https://github.com/jonschlinkert/arr-pluck "Retrieves the value of a specified property from all elements in the collection.") -* [arr-reduce](https://www.npmjs.com/package/arr-reduce): Fast array reduce that also loops over sparse elements. | [homepage](https://github.com/jonschlinkert/arr-reduce "Fast array reduce that also loops over sparse elements.") -* [arr-union](https://www.npmjs.com/package/arr-union): Combines a list of arrays, returning a single array with unique values, using strict equality… [more](https://github.com/jonschlinkert/arr-union) | [homepage](https://github.com/jonschlinkert/arr-union "Combines a list of arrays, returning a single array with unique values, using strict equality for comparisons.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Building docs - -_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ - -To generate the readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install -g verb verb-generate-readme && verb -``` - -### Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -### License - -Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/array-unique/blob/master/LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.28, on July 31, 2016._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/array-unique/index.js b/node_modules/readdirp/node_modules/array-unique/index.js deleted file mode 100644 index 7e481e072..000000000 --- a/node_modules/readdirp/node_modules/array-unique/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/*! - * array-unique - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -module.exports = function unique(arr) { - if (!Array.isArray(arr)) { - throw new TypeError('array-unique expects an array.'); - } - - var len = arr.length; - var i = -1; - - while (i++ < len) { - var j = i + 1; - - for (; j < arr.length; ++j) { - if (arr[i] === arr[j]) { - arr.splice(j--, 1); - } - } - } - return arr; -}; - -module.exports.immutable = function uniqueImmutable(arr) { - if (!Array.isArray(arr)) { - throw new TypeError('array-unique expects an array.'); - } - - var arrLen = arr.length; - var newArr = new Array(arrLen); - - for (var i = 0; i < arrLen; i++) { - newArr[i] = arr[i]; - } - - return module.exports(newArr); -}; diff --git a/node_modules/readdirp/node_modules/array-unique/package.json b/node_modules/readdirp/node_modules/array-unique/package.json deleted file mode 100644 index 8048e069e..000000000 --- a/node_modules/readdirp/node_modules/array-unique/package.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "_from": "array-unique@^0.3.2", - "_id": "array-unique@0.3.2", - "_inBundle": false, - "_integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "_location": "/readdirp/array-unique", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "array-unique@^0.3.2", - "name": "array-unique", - "escapedName": "array-unique", - "rawSpec": "^0.3.2", - "saveSpec": null, - "fetchSpec": "^0.3.2" - }, - "_requiredBy": [ - "/readdirp/braces", - "/readdirp/extglob", - "/readdirp/micromatch" - ], - "_resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "_shasum": "a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428", - "_spec": "array-unique@^0.3.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/array-unique/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Remove duplicate values from an array. Fastest ES5 implementation.", - "devDependencies": { - "array-uniq": "^1.0.2", - "benchmarked": "^0.1.3", - "gulp-format-md": "^0.1.9", - "mocha": "^2.5.3", - "should": "^10.0.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js", - "LICENSE", - "README.md" - ], - "homepage": "https://github.com/jonschlinkert/array-unique", - "keywords": [ - "array", - "unique" - ], - "license": "MIT", - "main": "index.js", - "name": "array-unique", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/array-unique.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "arr-diff", - "arr-union", - "arr-flatten", - "arr-reduce", - "arr-map", - "arr-pluck" - ] - }, - "reflinks": [ - "verb", - "verb-generate-readme" - ], - "lint": { - "reflinks": true - } - }, - "version": "0.3.2" -} diff --git a/node_modules/readdirp/node_modules/braces/LICENSE b/node_modules/readdirp/node_modules/braces/LICENSE deleted file mode 100644 index d32ab4426..000000000 --- a/node_modules/readdirp/node_modules/braces/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2018, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/braces/README.md b/node_modules/readdirp/node_modules/braces/README.md deleted file mode 100644 index f909bfba1..000000000 --- a/node_modules/readdirp/node_modules/braces/README.md +++ /dev/null @@ -1,640 +0,0 @@ -# braces [![NPM version](https://img.shields.io/npm/v/braces.svg?style=flat)](https://www.npmjs.com/package/braces) [![NPM monthly downloads](https://img.shields.io/npm/dm/braces.svg?style=flat)](https://npmjs.org/package/braces) [![NPM total downloads](https://img.shields.io/npm/dt/braces.svg?style=flat)](https://npmjs.org/package/braces) [![Linux Build Status](https://img.shields.io/travis/micromatch/braces.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/braces) [![Windows Build Status](https://img.shields.io/appveyor/ci/micromatch/braces.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/micromatch/braces) - -> Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save braces -``` - -## Why use braces? - -Brace patterns are great for matching ranges. Users (and implementors) shouldn't have to think about whether or not they will break their application (or yours) from accidentally defining an aggressive brace pattern. _Braces is the only library that offers a [solution to this problem](#performance)_. - -* **Safe(r)**: Braces isn't vulnerable to DoS attacks like [brace-expansion](https://github.com/juliangruber/brace-expansion), [minimatch](https://github.com/isaacs/minimatch) and [multimatch](https://github.com/sindresorhus/multimatch) (a different bug than the [other regex DoS bug](https://medium.com/node-security/minimatch-redos-vulnerability-590da24e6d3c#.jew0b6mpc)). -* **Accurate**: complete support for the [Bash 4.3 Brace Expansion](www.gnu.org/software/bash/) specification (passes all of the Bash braces tests) -* **[fast and performant](#benchmarks)**: Starts fast, runs fast and [scales well](#performance) as patterns increase in complexity. -* **Organized code base**: with parser and compiler that are eas(y|ier) to maintain and update when edge cases crop up. -* **Well-tested**: thousands of test assertions. Passes 100% of the [minimatch](https://github.com/isaacs/minimatch) and [brace-expansion](https://github.com/juliangruber/brace-expansion) unit tests as well (as of the writing of this). - -## Usage - -The main export is a function that takes one or more brace `patterns` and `options`. - -```js -var braces = require('braces'); -braces(pattern[, options]); -``` - -By default, braces returns an optimized regex-source string. To get an array of brace patterns, use `brace.expand()`. - -The following section explains the difference in more detail. _(If you're curious about "why" braces does this by default, see [brace matching pitfalls](#brace-matching-pitfalls)_. - -### Optimized vs. expanded braces - -**Optimized** - -By default, patterns are optimized for regex and matching: - -```js -console.log(braces('a/{x,y,z}/b')); -//=> ['a/(x|y|z)/b'] -``` - -**Expanded** - -To expand patterns the same way as Bash or [minimatch](https://github.com/isaacs/minimatch), use the [.expand](#expand) method: - -```js -console.log(braces.expand('a/{x,y,z}/b')); -//=> ['a/x/b', 'a/y/b', 'a/z/b'] -``` - -Or use [options.expand](#optionsexpand): - -```js -console.log(braces('a/{x,y,z}/b', {expand: true})); -//=> ['a/x/b', 'a/y/b', 'a/z/b'] -``` - -## Features - -* [lists](#lists): Supports "lists": `a/{b,c}/d` => `['a/b/d', 'a/c/d']` -* [sequences](#sequences): Supports alphabetical or numerical "sequences" (ranges): `{1..3}` => `['1', '2', '3']` -* [steps](#steps): Supports "steps" or increments: `{2..10..2}` => `['2', '4', '6', '8', '10']` -* [escaping](#escaping) -* [options](#options) - -### Lists - -Uses [fill-range](https://github.com/jonschlinkert/fill-range) for expanding alphabetical or numeric lists: - -```js -console.log(braces('a/{foo,bar,baz}/*.js')); -//=> ['a/(foo|bar|baz)/*.js'] - -console.log(braces.expand('a/{foo,bar,baz}/*.js')); -//=> ['a/foo/*.js', 'a/bar/*.js', 'a/baz/*.js'] -``` - -### Sequences - -Uses [fill-range](https://github.com/jonschlinkert/fill-range) for expanding alphabetical or numeric ranges (bash "sequences"): - -```js -console.log(braces.expand('{1..3}')); // ['1', '2', '3'] -console.log(braces.expand('a{01..03}b')); // ['a01b', 'a02b', 'a03b'] -console.log(braces.expand('a{1..3}b')); // ['a1b', 'a2b', 'a3b'] -console.log(braces.expand('{a..c}')); // ['a', 'b', 'c'] -console.log(braces.expand('foo/{a..c}')); // ['foo/a', 'foo/b', 'foo/c'] - -// supports padded ranges -console.log(braces('a{01..03}b')); //=> [ 'a(0[1-3])b' ] -console.log(braces('a{001..300}b')); //=> [ 'a(0{2}[1-9]|0[1-9][0-9]|[12][0-9]{2}|300)b' ] -``` - -### Steps - -Steps, or increments, may be used with ranges: - -```js -console.log(braces.expand('{2..10..2}')); -//=> ['2', '4', '6', '8', '10'] - -console.log(braces('{2..10..2}')); -//=> ['(2|4|6|8|10)'] -``` - -When the [.optimize](#optimize) method is used, or [options.optimize](#optionsoptimize) is set to true, sequences are passed to [to-regex-range](https://github.com/jonschlinkert/to-regex-range) for expansion. - -### Nesting - -Brace patterns may be nested. The results of each expanded string are not sorted, and left to right order is preserved. - -**"Expanded" braces** - -```js -console.log(braces.expand('a{b,c,/{x,y}}/e')); -//=> ['ab/e', 'ac/e', 'a/x/e', 'a/y/e'] - -console.log(braces.expand('a/{x,{1..5},y}/c')); -//=> ['a/x/c', 'a/1/c', 'a/2/c', 'a/3/c', 'a/4/c', 'a/5/c', 'a/y/c'] -``` - -**"Optimized" braces** - -```js -console.log(braces('a{b,c,/{x,y}}/e')); -//=> ['a(b|c|/(x|y))/e'] - -console.log(braces('a/{x,{1..5},y}/c')); -//=> ['a/(x|([1-5])|y)/c'] -``` - -### Escaping - -**Escaping braces** - -A brace pattern will not be expanded or evaluted if _either the opening or closing brace is escaped_: - -```js -console.log(braces.expand('a\\{d,c,b}e')); -//=> ['a{d,c,b}e'] - -console.log(braces.expand('a{d,c,b\\}e')); -//=> ['a{d,c,b}e'] -``` - -**Escaping commas** - -Commas inside braces may also be escaped: - -```js -console.log(braces.expand('a{b\\,c}d')); -//=> ['a{b,c}d'] - -console.log(braces.expand('a{d\\,c,b}e')); -//=> ['ad,ce', 'abe'] -``` - -**Single items** - -Following bash conventions, a brace pattern is also not expanded when it contains a single character: - -```js -console.log(braces.expand('a{b}c')); -//=> ['a{b}c'] -``` - -## Options - -### options.maxLength - -**Type**: `Number` - -**Default**: `65,536` - -**Description**: Limit the length of the input string. Useful when the input string is generated or your application allows users to pass a string, et cetera. - -```js -console.log(braces('a/{b,c}/d', { maxLength: 3 })); //=> throws an error -``` - -### options.expand - -**Type**: `Boolean` - -**Default**: `undefined` - -**Description**: Generate an "expanded" brace pattern (this option is unncessary with the `.expand` method, which does the same thing). - -```js -console.log(braces('a/{b,c}/d', {expand: true})); -//=> [ 'a/b/d', 'a/c/d' ] -``` - -### options.optimize - -**Type**: `Boolean` - -**Default**: `true` - -**Description**: Enabled by default. - -```js -console.log(braces('a/{b,c}/d')); -//=> [ 'a/(b|c)/d' ] -``` - -### options.nodupes - -**Type**: `Boolean` - -**Default**: `true` - -**Description**: Duplicates are removed by default. To keep duplicates, pass `{nodupes: false}` on the options - -### options.rangeLimit - -**Type**: `Number` - -**Default**: `250` - -**Description**: When `braces.expand()` is used, or `options.expand` is true, brace patterns will automatically be [optimized](#optionsoptimize) when the difference between the range minimum and range maximum exceeds the `rangeLimit`. This is to prevent huge ranges from freezing your application. - -You can set this to any number, or change `options.rangeLimit` to `Inifinity` to disable this altogether. - -**Examples** - -```js -// pattern exceeds the "rangeLimit", so it's optimized automatically -console.log(braces.expand('{1..1000}')); -//=> ['([1-9]|[1-9][0-9]{1,2}|1000)'] - -// pattern does not exceed "rangeLimit", so it's NOT optimized -console.log(braces.expand('{1..100}')); -//=> ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '100'] -``` - -### options.transform - -**Type**: `Function` - -**Default**: `undefined` - -**Description**: Customize range expansion. - -```js -var range = braces.expand('x{a..e}y', { - transform: function(str) { - return 'foo' + str; - } -}); - -console.log(range); -//=> [ 'xfooay', 'xfooby', 'xfoocy', 'xfoody', 'xfooey' ] -``` - -### options.quantifiers - -**Type**: `Boolean` - -**Default**: `undefined` - -**Description**: In regular expressions, quanitifiers can be used to specify how many times a token can be repeated. For example, `a{1,3}` will match the letter `a` one to three times. - -Unfortunately, regex quantifiers happen to share the same syntax as [Bash lists](#lists) - -The `quantifiers` option tells braces to detect when [regex quantifiers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#quantifiers) are defined in the given pattern, and not to try to expand them as lists. - -**Examples** - -```js -var braces = require('braces'); -console.log(braces('a/b{1,3}/{x,y,z}')); -//=> [ 'a/b(1|3)/(x|y|z)' ] -console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true})); -//=> [ 'a/b{1,3}/(x|y|z)' ] -console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true, expand: true})); -//=> [ 'a/b{1,3}/x', 'a/b{1,3}/y', 'a/b{1,3}/z' ] -``` - -### options.unescape - -**Type**: `Boolean` - -**Default**: `undefined` - -**Description**: Strip backslashes that were used for escaping from the result. - -## What is "brace expansion"? - -Brace expansion is a type of parameter expansion that was made popular by unix shells for generating lists of strings, as well as regex-like matching when used alongside wildcards (globs). - -In addition to "expansion", braces are also used for matching. In other words: - -* [brace expansion](#brace-expansion) is for generating new lists -* [brace matching](#brace-matching) is for filtering existing lists - -
    -More about brace expansion (click to expand) - -There are two main types of brace expansion: - -1. **lists**: which are defined using comma-separated values inside curly braces: `{a,b,c}` -2. **sequences**: which are defined using a starting value and an ending value, separated by two dots: `a{1..3}b`. Optionally, a third argument may be passed to define a "step" or increment to use: `a{1..100..10}b`. These are also sometimes referred to as "ranges". - -Here are some example brace patterns to illustrate how they work: - -**Sets** - -``` -{a,b,c} => a b c -{a,b,c}{1,2} => a1 a2 b1 b2 c1 c2 -``` - -**Sequences** - -``` -{1..9} => 1 2 3 4 5 6 7 8 9 -{4..-4} => 4 3 2 1 0 -1 -2 -3 -4 -{1..20..3} => 1 4 7 10 13 16 19 -{a..j} => a b c d e f g h i j -{j..a} => j i h g f e d c b a -{a..z..3} => a d g j m p s v y -``` - -**Combination** - -Sets and sequences can be mixed together or used along with any other strings. - -``` -{a,b,c}{1..3} => a1 a2 a3 b1 b2 b3 c1 c2 c3 -foo/{a,b,c}/bar => foo/a/bar foo/b/bar foo/c/bar -``` - -The fact that braces can be "expanded" from relatively simple patterns makes them ideal for quickly generating test fixtures, file paths, and similar use cases. - -## Brace matching - -In addition to _expansion_, brace patterns are also useful for performing regular-expression-like matching. - -For example, the pattern `foo/{1..3}/bar` would match any of following strings: - -``` -foo/1/bar -foo/2/bar -foo/3/bar -``` - -But not: - -``` -baz/1/qux -baz/2/qux -baz/3/qux -``` - -Braces can also be combined with [glob patterns](https://github.com/jonschlinkert/micromatch) to perform more advanced wildcard matching. For example, the pattern `*/{1..3}/*` would match any of following strings: - -``` -foo/1/bar -foo/2/bar -foo/3/bar -baz/1/qux -baz/2/qux -baz/3/qux -``` - -## Brace matching pitfalls - -Although brace patterns offer a user-friendly way of matching ranges or sets of strings, there are also some major disadvantages and potential risks you should be aware of. - -### tldr - -**"brace bombs"** - -* brace expansion can eat up a huge amount of processing resources -* as brace patterns increase _linearly in size_, the system resources required to expand the pattern increase exponentially -* users can accidentally (or intentially) exhaust your system's resources resulting in the equivalent of a DoS attack (bonus: no programming knowledge is required!) - -For a more detailed explanation with examples, see the [geometric complexity](#geometric-complexity) section. - -### The solution - -Jump to the [performance section](#performance) to see how Braces solves this problem in comparison to other libraries. - -### Geometric complexity - -At minimum, brace patterns with sets limited to two elements have quadradic or `O(n^2)` complexity. But the complexity of the algorithm increases exponentially as the number of sets, _and elements per set_, increases, which is `O(n^c)`. - -For example, the following sets demonstrate quadratic (`O(n^2)`) complexity: - -``` -{1,2}{3,4} => (2X2) => 13 14 23 24 -{1,2}{3,4}{5,6} => (2X2X2) => 135 136 145 146 235 236 245 246 -``` - -But add an element to a set, and we get a n-fold Cartesian product with `O(n^c)` complexity: - -``` -{1,2,3}{4,5,6}{7,8,9} => (3X3X3) => 147 148 149 157 158 159 167 168 169 247 248 - 249 257 258 259 267 268 269 347 348 349 357 - 358 359 367 368 369 -``` - -Now, imagine how this complexity grows given that each element is a n-tuple: - -``` -{1..100}{1..100} => (100X100) => 10,000 elements (38.4 kB) -{1..100}{1..100}{1..100} => (100X100X100) => 1,000,000 elements (5.76 MB) -``` - -Although these examples are clearly contrived, they demonstrate how brace patterns can quickly grow out of control. - -**More information** - -Interested in learning more about brace expansion? - -* [linuxjournal/bash-brace-expansion](http://www.linuxjournal.com/content/bash-brace-expansion) -* [rosettacode/Brace_expansion](https://rosettacode.org/wiki/Brace_expansion) -* [cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) - -
    - -## Performance - -Braces is not only screaming fast, it's also more accurate the other brace expansion libraries. - -### Better algorithms - -Fortunately there is a solution to the ["brace bomb" problem](#brace-matching-pitfalls): _don't expand brace patterns into an array when they're used for matching_. - -Instead, convert the pattern into an optimized regular expression. This is easier said than done, and braces is the only library that does this currently. - -**The proof is in the numbers** - -Minimatch gets exponentially slower as patterns increase in complexity, braces does not. The following results were generated using `braces()` and `minimatch.braceExpand()`, respectively. - -| **Pattern** | **braces** | **[minimatch](https://github.com/isaacs/minimatch)** | -| --- | --- | --- | -| `{1..9007199254740991}`[1] | `298 B` (5ms 459μs) | N/A (freezes) | -| `{1..1000000000000000}` | `41 B` (1ms 15μs) | N/A (freezes) | -| `{1..100000000000000}` | `40 B` (890μs) | N/A (freezes) | -| `{1..10000000000000}` | `39 B` (2ms 49μs) | N/A (freezes) | -| `{1..1000000000000}` | `38 B` (608μs) | N/A (freezes) | -| `{1..100000000000}` | `37 B` (397μs) | N/A (freezes) | -| `{1..10000000000}` | `35 B` (983μs) | N/A (freezes) | -| `{1..1000000000}` | `34 B` (798μs) | N/A (freezes) | -| `{1..100000000}` | `33 B` (733μs) | N/A (freezes) | -| `{1..10000000}` | `32 B` (5ms 632μs) | `78.89 MB` (16s 388ms 569μs) | -| `{1..1000000}` | `31 B` (1ms 381μs) | `6.89 MB` (1s 496ms 887μs) | -| `{1..100000}` | `30 B` (950μs) | `588.89 kB` (146ms 921μs) | -| `{1..10000}` | `29 B` (1ms 114μs) | `48.89 kB` (14ms 187μs) | -| `{1..1000}` | `28 B` (760μs) | `3.89 kB` (1ms 453μs) | -| `{1..100}` | `22 B` (345μs) | `291 B` (196μs) | -| `{1..10}` | `10 B` (533μs) | `20 B` (37μs) | -| `{1..3}` | `7 B` (190μs) | `5 B` (27μs) | - -### Faster algorithms - -When you need expansion, braces is still much faster. - -_(the following results were generated using `braces.expand()` and `minimatch.braceExpand()`, respectively)_ - -| **Pattern** | **braces** | **[minimatch](https://github.com/isaacs/minimatch)** | -| --- | --- | --- | -| `{1..10000000}` | `78.89 MB` (2s 698ms 642μs) | `78.89 MB` (18s 601ms 974μs) | -| `{1..1000000}` | `6.89 MB` (458ms 576μs) | `6.89 MB` (1s 491ms 621μs) | -| `{1..100000}` | `588.89 kB` (20ms 728μs) | `588.89 kB` (156ms 919μs) | -| `{1..10000}` | `48.89 kB` (2ms 202μs) | `48.89 kB` (13ms 641μs) | -| `{1..1000}` | `3.89 kB` (1ms 796μs) | `3.89 kB` (1ms 958μs) | -| `{1..100}` | `291 B` (424μs) | `291 B` (211μs) | -| `{1..10}` | `20 B` (487μs) | `20 B` (72μs) | -| `{1..3}` | `5 B` (166μs) | `5 B` (27μs) | - -If you'd like to run these comparisons yourself, see [test/support/generate.js](test/support/generate.js). - -## Benchmarks - -### Running benchmarks - -Install dev dependencies: - -```bash -npm i -d && npm benchmark -``` - -### Latest results - -```bash -Benchmarking: (8 of 8) - · combination-nested - · combination - · escaped - · list-basic - · list-multiple - · no-braces - · sequence-basic - · sequence-multiple - -# benchmark/fixtures/combination-nested.js (52 bytes) - brace-expansion x 4,756 ops/sec ±1.09% (86 runs sampled) - braces x 11,202,303 ops/sec ±1.06% (88 runs sampled) - minimatch x 4,816 ops/sec ±0.99% (87 runs sampled) - - fastest is braces - -# benchmark/fixtures/combination.js (51 bytes) - brace-expansion x 625 ops/sec ±0.87% (87 runs sampled) - braces x 11,031,884 ops/sec ±0.72% (90 runs sampled) - minimatch x 637 ops/sec ±0.84% (88 runs sampled) - - fastest is braces - -# benchmark/fixtures/escaped.js (44 bytes) - brace-expansion x 163,325 ops/sec ±1.05% (87 runs sampled) - braces x 10,655,071 ops/sec ±1.22% (88 runs sampled) - minimatch x 147,495 ops/sec ±0.96% (88 runs sampled) - - fastest is braces - -# benchmark/fixtures/list-basic.js (40 bytes) - brace-expansion x 99,726 ops/sec ±1.07% (83 runs sampled) - braces x 10,596,584 ops/sec ±0.98% (88 runs sampled) - minimatch x 100,069 ops/sec ±1.17% (86 runs sampled) - - fastest is braces - -# benchmark/fixtures/list-multiple.js (52 bytes) - brace-expansion x 34,348 ops/sec ±1.08% (88 runs sampled) - braces x 9,264,131 ops/sec ±1.12% (88 runs sampled) - minimatch x 34,893 ops/sec ±0.87% (87 runs sampled) - - fastest is braces - -# benchmark/fixtures/no-braces.js (48 bytes) - brace-expansion x 275,368 ops/sec ±1.18% (89 runs sampled) - braces x 9,134,677 ops/sec ±0.95% (88 runs sampled) - minimatch x 3,755,954 ops/sec ±1.13% (89 runs sampled) - - fastest is braces - -# benchmark/fixtures/sequence-basic.js (41 bytes) - brace-expansion x 5,492 ops/sec ±1.35% (87 runs sampled) - braces x 8,485,034 ops/sec ±1.28% (89 runs sampled) - minimatch x 5,341 ops/sec ±1.17% (87 runs sampled) - - fastest is braces - -# benchmark/fixtures/sequence-multiple.js (51 bytes) - brace-expansion x 116 ops/sec ±0.77% (77 runs sampled) - braces x 9,445,118 ops/sec ±1.32% (84 runs sampled) - minimatch x 109 ops/sec ±1.16% (76 runs sampled) - - fastest is braces -``` - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    - -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/jonschlinkert/expand-brackets "Expand POSIX bracket expressions (character classes) in glob patterns.") -* [extglob](https://www.npmjs.com/package/extglob): Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob… [more](https://github.com/micromatch/extglob) | [homepage](https://github.com/micromatch/extglob "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.") -* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or `step` to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`") -* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/micromatch/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") -* [nanomatch](https://www.npmjs.com/package/nanomatch): Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash… [more](https://github.com/micromatch/nanomatch) | [homepage](https://github.com/micromatch/nanomatch "Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces)") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 188 | [jonschlinkert](https://github.com/jonschlinkert) | -| 4 | [doowb](https://github.com/doowb) | -| 1 | [es128](https://github.com/es128) | -| 1 | [eush77](https://github.com/eush77) | -| 1 | [hemanth](https://github.com/hemanth) | - -### Author - -**Jon Schlinkert** - -* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on February 17, 2018._ - -
    -
    -
      -
    1. this is the largest safe integer allowed in JavaScript. - -
    2. -
    -
    \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/braces/index.js b/node_modules/readdirp/node_modules/braces/index.js deleted file mode 100644 index 048e1c233..000000000 --- a/node_modules/readdirp/node_modules/braces/index.js +++ /dev/null @@ -1,318 +0,0 @@ -'use strict'; - -/** - * Module dependencies - */ - -var toRegex = require('to-regex'); -var unique = require('array-unique'); -var extend = require('extend-shallow'); - -/** - * Local dependencies - */ - -var compilers = require('./lib/compilers'); -var parsers = require('./lib/parsers'); -var Braces = require('./lib/braces'); -var utils = require('./lib/utils'); -var MAX_LENGTH = 1024 * 64; -var cache = {}; - -/** - * Convert the given `braces` pattern into a regex-compatible string. By default, only one string is generated for every input string. Set `options.expand` to true to return an array of patterns (similar to Bash or minimatch. Before using `options.expand`, it's recommended that you read the [performance notes](#performance)). - * - * ```js - * var braces = require('braces'); - * console.log(braces('{a,b,c}')); - * //=> ['(a|b|c)'] - * - * console.log(braces('{a,b,c}', {expand: true})); - * //=> ['a', 'b', 'c'] - * ``` - * @param {String} `str` - * @param {Object} `options` - * @return {String} - * @api public - */ - -function braces(pattern, options) { - var key = utils.createKey(String(pattern), options); - var arr = []; - - var disabled = options && options.cache === false; - if (!disabled && cache.hasOwnProperty(key)) { - return cache[key]; - } - - if (Array.isArray(pattern)) { - for (var i = 0; i < pattern.length; i++) { - arr.push.apply(arr, braces.create(pattern[i], options)); - } - } else { - arr = braces.create(pattern, options); - } - - if (options && options.nodupes === true) { - arr = unique(arr); - } - - if (!disabled) { - cache[key] = arr; - } - return arr; -} - -/** - * Expands a brace pattern into an array. This method is called by the main [braces](#braces) function when `options.expand` is true. Before using this method it's recommended that you read the [performance notes](#performance)) and advantages of using [.optimize](#optimize) instead. - * - * ```js - * var braces = require('braces'); - * console.log(braces.expand('a/{b,c}/d')); - * //=> ['a/b/d', 'a/c/d']; - * ``` - * @param {String} `pattern` Brace pattern - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ - -braces.expand = function(pattern, options) { - return braces.create(pattern, extend({}, options, {expand: true})); -}; - -/** - * Expands a brace pattern into a regex-compatible, optimized string. This method is called by the main [braces](#braces) function by default. - * - * ```js - * var braces = require('braces'); - * console.log(braces.expand('a/{b,c}/d')); - * //=> ['a/(b|c)/d'] - * ``` - * @param {String} `pattern` Brace pattern - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ - -braces.optimize = function(pattern, options) { - return braces.create(pattern, options); -}; - -/** - * Processes a brace pattern and returns either an expanded array (if `options.expand` is true), a highly optimized regex-compatible string. This method is called by the main [braces](#braces) function. - * - * ```js - * var braces = require('braces'); - * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) - * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' - * ``` - * @param {String} `pattern` Brace pattern - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ - -braces.create = function(pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('expected a string'); - } - - var maxLength = (options && options.maxLength) || MAX_LENGTH; - if (pattern.length >= maxLength) { - throw new Error('expected pattern to be less than ' + maxLength + ' characters'); - } - - function create() { - if (pattern === '' || pattern.length < 3) { - return [pattern]; - } - - if (utils.isEmptySets(pattern)) { - return []; - } - - if (utils.isQuotedString(pattern)) { - return [pattern.slice(1, -1)]; - } - - var proto = new Braces(options); - var result = !options || options.expand !== true - ? proto.optimize(pattern, options) - : proto.expand(pattern, options); - - // get the generated pattern(s) - var arr = result.output; - - // filter out empty strings if specified - if (options && options.noempty === true) { - arr = arr.filter(Boolean); - } - - // filter out duplicates if specified - if (options && options.nodupes === true) { - arr = unique(arr); - } - - Object.defineProperty(arr, 'result', { - enumerable: false, - value: result - }); - - return arr; - } - - return memoize('create', pattern, options, create); -}; - -/** - * Create a regular expression from the given string `pattern`. - * - * ```js - * var braces = require('braces'); - * - * console.log(braces.makeRe('id-{200..300}')); - * //=> /^(?:id-(20[0-9]|2[1-9][0-9]|300))$/ - * ``` - * @param {String} `pattern` The pattern to convert to regex. - * @param {Object} `options` - * @return {RegExp} - * @api public - */ - -braces.makeRe = function(pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('expected a string'); - } - - var maxLength = (options && options.maxLength) || MAX_LENGTH; - if (pattern.length >= maxLength) { - throw new Error('expected pattern to be less than ' + maxLength + ' characters'); - } - - function makeRe() { - var arr = braces(pattern, options); - var opts = extend({strictErrors: false}, options); - return toRegex(arr, opts); - } - - return memoize('makeRe', pattern, options, makeRe); -}; - -/** - * Parse the given `str` with the given `options`. - * - * ```js - * var braces = require('braces'); - * var ast = braces.parse('a/{b,c}/d'); - * console.log(ast); - * // { type: 'root', - * // errors: [], - * // input: 'a/{b,c}/d', - * // nodes: - * // [ { type: 'bos', val: '' }, - * // { type: 'text', val: 'a/' }, - * // { type: 'brace', - * // nodes: - * // [ { type: 'brace.open', val: '{' }, - * // { type: 'text', val: 'b,c' }, - * // { type: 'brace.close', val: '}' } ] }, - * // { type: 'text', val: '/d' }, - * // { type: 'eos', val: '' } ] } - * ``` - * @param {String} `pattern` Brace pattern to parse - * @param {Object} `options` - * @return {Object} Returns an AST - * @api public - */ - -braces.parse = function(pattern, options) { - var proto = new Braces(options); - return proto.parse(pattern, options); -}; - -/** - * Compile the given `ast` or string with the given `options`. - * - * ```js - * var braces = require('braces'); - * var ast = braces.parse('a/{b,c}/d'); - * console.log(braces.compile(ast)); - * // { options: { source: 'string' }, - * // state: {}, - * // compilers: - * // { eos: [Function], - * // noop: [Function], - * // bos: [Function], - * // brace: [Function], - * // 'brace.open': [Function], - * // text: [Function], - * // 'brace.close': [Function] }, - * // output: [ 'a/(b|c)/d' ], - * // ast: - * // { ... }, - * // parsingErrors: [] } - * ``` - * @param {Object|String} `ast` AST from [.parse](#parse). If a string is passed it will be parsed first. - * @param {Object} `options` - * @return {Object} Returns an object that has an `output` property with the compiled string. - * @api public - */ - -braces.compile = function(ast, options) { - var proto = new Braces(options); - return proto.compile(ast, options); -}; - -/** - * Clear the regex cache. - * - * ```js - * braces.clearCache(); - * ``` - * @api public - */ - -braces.clearCache = function() { - cache = braces.cache = {}; -}; - -/** - * Memoize a generated regex or function. A unique key is generated - * from the method name, pattern, and user-defined options. Set - * options.memoize to false to disable. - */ - -function memoize(type, pattern, options, fn) { - var key = utils.createKey(type + ':' + pattern, options); - var disabled = options && options.cache === false; - if (disabled) { - braces.clearCache(); - return fn(pattern, options); - } - - if (cache.hasOwnProperty(key)) { - return cache[key]; - } - - var res = fn(pattern, options); - cache[key] = res; - return res; -} - -/** - * Expose `Braces` constructor and methods - * @type {Function} - */ - -braces.Braces = Braces; -braces.compilers = compilers; -braces.parsers = parsers; -braces.cache = cache; - -/** - * Expose `braces` - * @type {Function} - */ - -module.exports = braces; diff --git a/node_modules/readdirp/node_modules/braces/lib/braces.js b/node_modules/readdirp/node_modules/braces/lib/braces.js deleted file mode 100644 index baf6bf1bc..000000000 --- a/node_modules/readdirp/node_modules/braces/lib/braces.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; - -var extend = require('extend-shallow'); -var Snapdragon = require('snapdragon'); -var compilers = require('./compilers'); -var parsers = require('./parsers'); -var utils = require('./utils'); - -/** - * Customize Snapdragon parser and renderer - */ - -function Braces(options) { - this.options = extend({}, options); -} - -/** - * Initialize braces - */ - -Braces.prototype.init = function(options) { - if (this.isInitialized) return; - this.isInitialized = true; - var opts = utils.createOptions({}, this.options, options); - this.snapdragon = this.options.snapdragon || new Snapdragon(opts); - this.compiler = this.snapdragon.compiler; - this.parser = this.snapdragon.parser; - - compilers(this.snapdragon, opts); - parsers(this.snapdragon, opts); - - /** - * Call Snapdragon `.parse` method. When AST is returned, we check to - * see if any unclosed braces are left on the stack and, if so, we iterate - * over the stack and correct the AST so that compilers are called in the correct - * order and unbalance braces are properly escaped. - */ - - utils.define(this.snapdragon, 'parse', function(pattern, options) { - var parsed = Snapdragon.prototype.parse.apply(this, arguments); - this.parser.ast.input = pattern; - - var stack = this.parser.stack; - while (stack.length) { - addParent({type: 'brace.close', val: ''}, stack.pop()); - } - - function addParent(node, parent) { - utils.define(node, 'parent', parent); - parent.nodes.push(node); - } - - // add non-enumerable parser reference - utils.define(parsed, 'parser', this.parser); - return parsed; - }); -}; - -/** - * Decorate `.parse` method - */ - -Braces.prototype.parse = function(ast, options) { - if (ast && typeof ast === 'object' && ast.nodes) return ast; - this.init(options); - return this.snapdragon.parse(ast, options); -}; - -/** - * Decorate `.compile` method - */ - -Braces.prototype.compile = function(ast, options) { - if (typeof ast === 'string') { - ast = this.parse(ast, options); - } else { - this.init(options); - } - return this.snapdragon.compile(ast, options); -}; - -/** - * Expand - */ - -Braces.prototype.expand = function(pattern) { - var ast = this.parse(pattern, {expand: true}); - return this.compile(ast, {expand: true}); -}; - -/** - * Optimize - */ - -Braces.prototype.optimize = function(pattern) { - var ast = this.parse(pattern, {optimize: true}); - return this.compile(ast, {optimize: true}); -}; - -/** - * Expose `Braces` - */ - -module.exports = Braces; diff --git a/node_modules/readdirp/node_modules/braces/lib/compilers.js b/node_modules/readdirp/node_modules/braces/lib/compilers.js deleted file mode 100644 index a3b820e41..000000000 --- a/node_modules/readdirp/node_modules/braces/lib/compilers.js +++ /dev/null @@ -1,282 +0,0 @@ -'use strict'; - -var utils = require('./utils'); - -module.exports = function(braces, options) { - braces.compiler - - /** - * bos - */ - - .set('bos', function() { - if (this.output) return; - this.ast.queue = isEscaped(this.ast) ? [this.ast.val] : []; - this.ast.count = 1; - }) - - /** - * Square brackets - */ - - .set('bracket', function(node) { - var close = node.close; - var open = !node.escaped ? '[' : '\\['; - var negated = node.negated; - var inner = node.inner; - - inner = inner.replace(/\\(?=[\\\w]|$)/g, '\\\\'); - if (inner === ']-') { - inner = '\\]\\-'; - } - - if (negated && inner.indexOf('.') === -1) { - inner += '.'; - } - if (negated && inner.indexOf('/') === -1) { - inner += '/'; - } - - var val = open + negated + inner + close; - var queue = node.parent.queue; - var last = utils.arrayify(queue.pop()); - - queue.push(utils.join(last, val)); - queue.push.apply(queue, []); - }) - - /** - * Brace - */ - - .set('brace', function(node) { - node.queue = isEscaped(node) ? [node.val] : []; - node.count = 1; - return this.mapVisit(node.nodes); - }) - - /** - * Open - */ - - .set('brace.open', function(node) { - node.parent.open = node.val; - }) - - /** - * Inner - */ - - .set('text', function(node) { - var queue = node.parent.queue; - var escaped = node.escaped; - var segs = [node.val]; - - if (node.optimize === false) { - options = utils.extend({}, options, {optimize: false}); - } - - if (node.multiplier > 1) { - node.parent.count *= node.multiplier; - } - - if (options.quantifiers === true && utils.isQuantifier(node.val)) { - escaped = true; - - } else if (node.val.length > 1) { - if (isType(node.parent, 'brace') && !isEscaped(node)) { - var expanded = utils.expand(node.val, options); - segs = expanded.segs; - - if (expanded.isOptimized) { - node.parent.isOptimized = true; - } - - // if nothing was expanded, we probably have a literal brace - if (!segs.length) { - var val = (expanded.val || node.val); - if (options.unescape !== false) { - // unescape unexpanded brace sequence/set separators - val = val.replace(/\\([,.])/g, '$1'); - // strip quotes - val = val.replace(/["'`]/g, ''); - } - - segs = [val]; - escaped = true; - } - } - - } else if (node.val === ',') { - if (options.expand) { - node.parent.queue.push(['']); - segs = ['']; - } else { - segs = ['|']; - } - } else { - escaped = true; - } - - if (escaped && isType(node.parent, 'brace')) { - if (node.parent.nodes.length <= 4 && node.parent.count === 1) { - node.parent.escaped = true; - } else if (node.parent.length <= 3) { - node.parent.escaped = true; - } - } - - if (!hasQueue(node.parent)) { - node.parent.queue = segs; - return; - } - - var last = utils.arrayify(queue.pop()); - if (node.parent.count > 1 && options.expand) { - last = multiply(last, node.parent.count); - node.parent.count = 1; - } - - queue.push(utils.join(utils.flatten(last), segs.shift())); - queue.push.apply(queue, segs); - }) - - /** - * Close - */ - - .set('brace.close', function(node) { - var queue = node.parent.queue; - var prev = node.parent.parent; - var last = prev.queue.pop(); - var open = node.parent.open; - var close = node.val; - - if (open && close && isOptimized(node, options)) { - open = '('; - close = ')'; - } - - // if a close brace exists, and the previous segment is one character - // don't wrap the result in braces or parens - var ele = utils.last(queue); - if (node.parent.count > 1 && options.expand) { - ele = multiply(queue.pop(), node.parent.count); - node.parent.count = 1; - queue.push(ele); - } - - if (close && typeof ele === 'string' && ele.length === 1) { - open = ''; - close = ''; - } - - if ((isLiteralBrace(node, options) || noInner(node)) && !node.parent.hasEmpty) { - queue.push(utils.join(open, queue.pop() || '')); - queue = utils.flatten(utils.join(queue, close)); - } - - if (typeof last === 'undefined') { - prev.queue = [queue]; - } else { - prev.queue.push(utils.flatten(utils.join(last, queue))); - } - }) - - /** - * eos - */ - - .set('eos', function(node) { - if (this.input) return; - - if (options.optimize !== false) { - this.output = utils.last(utils.flatten(this.ast.queue)); - } else if (Array.isArray(utils.last(this.ast.queue))) { - this.output = utils.flatten(this.ast.queue.pop()); - } else { - this.output = utils.flatten(this.ast.queue); - } - - if (node.parent.count > 1 && options.expand) { - this.output = multiply(this.output, node.parent.count); - } - - this.output = utils.arrayify(this.output); - this.ast.queue = []; - }); - -}; - -/** - * Multiply the segments in the current brace level - */ - -function multiply(queue, n, options) { - return utils.flatten(utils.repeat(utils.arrayify(queue), n)); -} - -/** - * Return true if `node` is escaped - */ - -function isEscaped(node) { - return node.escaped === true; -} - -/** - * Returns true if regex parens should be used for sets. If the parent `type` - * is not `brace`, then we're on a root node, which means we should never - * expand segments and open/close braces should be `{}` (since this indicates - * a brace is missing from the set) - */ - -function isOptimized(node, options) { - if (node.parent.isOptimized) return true; - return isType(node.parent, 'brace') - && !isEscaped(node.parent) - && options.expand !== true; -} - -/** - * Returns true if the value in `node` should be wrapped in a literal brace. - * @return {Boolean} - */ - -function isLiteralBrace(node, options) { - return isEscaped(node.parent) || options.optimize !== false; -} - -/** - * Returns true if the given `node` does not have an inner value. - * @return {Boolean} - */ - -function noInner(node, type) { - if (node.parent.queue.length === 1) { - return true; - } - var nodes = node.parent.nodes; - return nodes.length === 3 - && isType(nodes[0], 'brace.open') - && !isType(nodes[1], 'text') - && isType(nodes[2], 'brace.close'); -} - -/** - * Returns true if the given `node` is the given `type` - * @return {Boolean} - */ - -function isType(node, type) { - return typeof node !== 'undefined' && node.type === type; -} - -/** - * Returns true if the given `node` has a non-empty queue. - * @return {Boolean} - */ - -function hasQueue(node) { - return Array.isArray(node.queue) && node.queue.length; -} diff --git a/node_modules/readdirp/node_modules/braces/lib/parsers.js b/node_modules/readdirp/node_modules/braces/lib/parsers.js deleted file mode 100644 index 8bf3e92b5..000000000 --- a/node_modules/readdirp/node_modules/braces/lib/parsers.js +++ /dev/null @@ -1,360 +0,0 @@ -'use strict'; - -var Node = require('snapdragon-node'); -var utils = require('./utils'); - -/** - * Braces parsers - */ - -module.exports = function(braces, options) { - braces.parser - .set('bos', function() { - if (!this.parsed) { - this.ast = this.nodes[0] = new Node(this.ast); - } - }) - - /** - * Character parsers - */ - - .set('escape', function() { - var pos = this.position(); - var m = this.match(/^(?:\\(.)|\$\{)/); - if (!m) return; - - var prev = this.prev(); - var last = utils.last(prev.nodes); - - var node = pos(new Node({ - type: 'text', - multiplier: 1, - val: m[0] - })); - - if (node.val === '\\\\') { - return node; - } - - if (node.val === '${') { - var str = this.input; - var idx = -1; - var ch; - - while ((ch = str[++idx])) { - this.consume(1); - node.val += ch; - if (ch === '\\') { - node.val += str[++idx]; - continue; - } - if (ch === '}') { - break; - } - } - } - - if (this.options.unescape !== false) { - node.val = node.val.replace(/\\([{}])/g, '$1'); - } - - if (last.val === '"' && this.input.charAt(0) === '"') { - last.val = node.val; - this.consume(1); - return; - } - - return concatNodes.call(this, pos, node, prev, options); - }) - - /** - * Brackets: "[...]" (basic, this is overridden by - * other parsers in more advanced implementations) - */ - - .set('bracket', function() { - var isInside = this.isInside('brace'); - var pos = this.position(); - var m = this.match(/^(?:\[([!^]?)([^\]]{2,}|\]-)(\]|[^*+?]+)|\[)/); - if (!m) return; - - var prev = this.prev(); - var val = m[0]; - var negated = m[1] ? '^' : ''; - var inner = m[2] || ''; - var close = m[3] || ''; - - if (isInside && prev.type === 'brace') { - prev.text = prev.text || ''; - prev.text += val; - } - - var esc = this.input.slice(0, 2); - if (inner === '' && esc === '\\]') { - inner += esc; - this.consume(2); - - var str = this.input; - var idx = -1; - var ch; - - while ((ch = str[++idx])) { - this.consume(1); - if (ch === ']') { - close = ch; - break; - } - inner += ch; - } - } - - return pos(new Node({ - type: 'bracket', - val: val, - escaped: close !== ']', - negated: negated, - inner: inner, - close: close - })); - }) - - /** - * Empty braces (we capture these early to - * speed up processing in the compiler) - */ - - .set('multiplier', function() { - var isInside = this.isInside('brace'); - var pos = this.position(); - var m = this.match(/^\{((?:,|\{,+\})+)\}/); - if (!m) return; - - this.multiplier = true; - var prev = this.prev(); - var val = m[0]; - - if (isInside && prev.type === 'brace') { - prev.text = prev.text || ''; - prev.text += val; - } - - var node = pos(new Node({ - type: 'text', - multiplier: 1, - match: m, - val: val - })); - - return concatNodes.call(this, pos, node, prev, options); - }) - - /** - * Open - */ - - .set('brace.open', function() { - var pos = this.position(); - var m = this.match(/^\{(?!(?:[^\\}]?|,+)\})/); - if (!m) return; - - var prev = this.prev(); - var last = utils.last(prev.nodes); - - // if the last parsed character was an extglob character - // we need to _not optimize_ the brace pattern because - // it might be mistaken for an extglob by a downstream parser - if (last && last.val && isExtglobChar(last.val.slice(-1))) { - last.optimize = false; - } - - var open = pos(new Node({ - type: 'brace.open', - val: m[0] - })); - - var node = pos(new Node({ - type: 'brace', - nodes: [] - })); - - node.push(open); - prev.push(node); - this.push('brace', node); - }) - - /** - * Close - */ - - .set('brace.close', function() { - var pos = this.position(); - var m = this.match(/^\}/); - if (!m || !m[0]) return; - - var brace = this.pop('brace'); - var node = pos(new Node({ - type: 'brace.close', - val: m[0] - })); - - if (!this.isType(brace, 'brace')) { - if (this.options.strict) { - throw new Error('missing opening "{"'); - } - node.type = 'text'; - node.multiplier = 0; - node.escaped = true; - return node; - } - - var prev = this.prev(); - var last = utils.last(prev.nodes); - if (last.text) { - var lastNode = utils.last(last.nodes); - if (lastNode.val === ')' && /[!@*?+]\(/.test(last.text)) { - var open = last.nodes[0]; - var text = last.nodes[1]; - if (open.type === 'brace.open' && text && text.type === 'text') { - text.optimize = false; - } - } - } - - if (brace.nodes.length > 2) { - var first = brace.nodes[1]; - if (first.type === 'text' && first.val === ',') { - brace.nodes.splice(1, 1); - brace.nodes.push(first); - } - } - - brace.push(node); - }) - - /** - * Capture boundary characters - */ - - .set('boundary', function() { - var pos = this.position(); - var m = this.match(/^[$^](?!\{)/); - if (!m) return; - return pos(new Node({ - type: 'text', - val: m[0] - })); - }) - - /** - * One or zero, non-comma characters wrapped in braces - */ - - .set('nobrace', function() { - var isInside = this.isInside('brace'); - var pos = this.position(); - var m = this.match(/^\{[^,]?\}/); - if (!m) return; - - var prev = this.prev(); - var val = m[0]; - - if (isInside && prev.type === 'brace') { - prev.text = prev.text || ''; - prev.text += val; - } - - return pos(new Node({ - type: 'text', - multiplier: 0, - val: val - })); - }) - - /** - * Text - */ - - .set('text', function() { - var isInside = this.isInside('brace'); - var pos = this.position(); - var m = this.match(/^((?!\\)[^${}[\]])+/); - if (!m) return; - - var prev = this.prev(); - var val = m[0]; - - if (isInside && prev.type === 'brace') { - prev.text = prev.text || ''; - prev.text += val; - } - - var node = pos(new Node({ - type: 'text', - multiplier: 1, - val: val - })); - - return concatNodes.call(this, pos, node, prev, options); - }); -}; - -/** - * Returns true if the character is an extglob character. - */ - -function isExtglobChar(ch) { - return ch === '!' || ch === '@' || ch === '*' || ch === '?' || ch === '+'; -} - -/** - * Combine text nodes, and calculate empty sets (`{,,}`) - * @param {Function} `pos` Function to calculate node position - * @param {Object} `node` AST node - * @return {Object} - */ - -function concatNodes(pos, node, parent, options) { - node.orig = node.val; - var prev = this.prev(); - var last = utils.last(prev.nodes); - var isEscaped = false; - - if (node.val.length > 1) { - var a = node.val.charAt(0); - var b = node.val.slice(-1); - - isEscaped = (a === '"' && b === '"') - || (a === "'" && b === "'") - || (a === '`' && b === '`'); - } - - if (isEscaped && options.unescape !== false) { - node.val = node.val.slice(1, node.val.length - 1); - node.escaped = true; - } - - if (node.match) { - var match = node.match[1]; - if (!match || match.indexOf('}') === -1) { - match = node.match[0]; - } - - // replace each set with a single "," - var val = match.replace(/\{/g, ',').replace(/\}/g, ''); - node.multiplier *= val.length; - node.val = ''; - } - - var simpleText = last.type === 'text' - && last.multiplier === 1 - && node.multiplier === 1 - && node.val; - - if (simpleText) { - last.val += node.val; - return; - } - - prev.push(node); -} diff --git a/node_modules/readdirp/node_modules/braces/lib/utils.js b/node_modules/readdirp/node_modules/braces/lib/utils.js deleted file mode 100644 index 471667171..000000000 --- a/node_modules/readdirp/node_modules/braces/lib/utils.js +++ /dev/null @@ -1,343 +0,0 @@ -'use strict'; - -var splitString = require('split-string'); -var utils = module.exports; - -/** - * Module dependencies - */ - -utils.extend = require('extend-shallow'); -utils.flatten = require('arr-flatten'); -utils.isObject = require('isobject'); -utils.fillRange = require('fill-range'); -utils.repeat = require('repeat-element'); -utils.unique = require('array-unique'); - -utils.define = function(obj, key, val) { - Object.defineProperty(obj, key, { - writable: true, - configurable: true, - enumerable: false, - value: val - }); -}; - -/** - * Returns true if the given string contains only empty brace sets. - */ - -utils.isEmptySets = function(str) { - return /^(?:\{,\})+$/.test(str); -}; - -/** - * Returns true if the given string contains only empty brace sets. - */ - -utils.isQuotedString = function(str) { - var open = str.charAt(0); - if (open === '\'' || open === '"' || open === '`') { - return str.slice(-1) === open; - } - return false; -}; - -/** - * Create the key to use for memoization. The unique key is generated - * by iterating over the options and concatenating key-value pairs - * to the pattern string. - */ - -utils.createKey = function(pattern, options) { - var id = pattern; - if (typeof options === 'undefined') { - return id; - } - var keys = Object.keys(options); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - id += ';' + key + '=' + String(options[key]); - } - return id; -}; - -/** - * Normalize options - */ - -utils.createOptions = function(options) { - var opts = utils.extend.apply(null, arguments); - if (typeof opts.expand === 'boolean') { - opts.optimize = !opts.expand; - } - if (typeof opts.optimize === 'boolean') { - opts.expand = !opts.optimize; - } - if (opts.optimize === true) { - opts.makeRe = true; - } - return opts; -}; - -/** - * Join patterns in `a` to patterns in `b` - */ - -utils.join = function(a, b, options) { - options = options || {}; - a = utils.arrayify(a); - b = utils.arrayify(b); - - if (!a.length) return b; - if (!b.length) return a; - - var len = a.length; - var idx = -1; - var arr = []; - - while (++idx < len) { - var val = a[idx]; - if (Array.isArray(val)) { - for (var i = 0; i < val.length; i++) { - val[i] = utils.join(val[i], b, options); - } - arr.push(val); - continue; - } - - for (var j = 0; j < b.length; j++) { - var bval = b[j]; - - if (Array.isArray(bval)) { - arr.push(utils.join(val, bval, options)); - } else { - arr.push(val + bval); - } - } - } - return arr; -}; - -/** - * Split the given string on `,` if not escaped. - */ - -utils.split = function(str, options) { - var opts = utils.extend({sep: ','}, options); - if (typeof opts.keepQuotes !== 'boolean') { - opts.keepQuotes = true; - } - if (opts.unescape === false) { - opts.keepEscaping = true; - } - return splitString(str, opts, utils.escapeBrackets(opts)); -}; - -/** - * Expand ranges or sets in the given `pattern`. - * - * @param {String} `str` - * @param {Object} `options` - * @return {Object} - */ - -utils.expand = function(str, options) { - var opts = utils.extend({rangeLimit: 10000}, options); - var segs = utils.split(str, opts); - var tok = { segs: segs }; - - if (utils.isQuotedString(str)) { - return tok; - } - - if (opts.rangeLimit === true) { - opts.rangeLimit = 10000; - } - - if (segs.length > 1) { - if (opts.optimize === false) { - tok.val = segs[0]; - return tok; - } - - tok.segs = utils.stringifyArray(tok.segs); - } else if (segs.length === 1) { - var arr = str.split('..'); - - if (arr.length === 1) { - tok.val = tok.segs[tok.segs.length - 1] || tok.val || str; - tok.segs = []; - return tok; - } - - if (arr.length === 2 && arr[0] === arr[1]) { - tok.escaped = true; - tok.val = arr[0]; - tok.segs = []; - return tok; - } - - if (arr.length > 1) { - if (opts.optimize !== false) { - opts.optimize = true; - delete opts.expand; - } - - if (opts.optimize !== true) { - var min = Math.min(arr[0], arr[1]); - var max = Math.max(arr[0], arr[1]); - var step = arr[2] || 1; - - if (opts.rangeLimit !== false && ((max - min) / step >= opts.rangeLimit)) { - throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); - } - } - - arr.push(opts); - tok.segs = utils.fillRange.apply(null, arr); - - if (!tok.segs.length) { - tok.escaped = true; - tok.val = str; - return tok; - } - - if (opts.optimize === true) { - tok.segs = utils.stringifyArray(tok.segs); - } - - if (tok.segs === '') { - tok.val = str; - } else { - tok.val = tok.segs[0]; - } - return tok; - } - } else { - tok.val = str; - } - return tok; -}; - -/** - * Ensure commas inside brackets and parens are not split. - * @param {Object} `tok` Token from the `split-string` module - * @return {undefined} - */ - -utils.escapeBrackets = function(options) { - return function(tok) { - if (tok.escaped && tok.val === 'b') { - tok.val = '\\b'; - return; - } - - if (tok.val !== '(' && tok.val !== '[') return; - var opts = utils.extend({}, options); - var brackets = []; - var parens = []; - var stack = []; - var val = tok.val; - var str = tok.str; - var i = tok.idx - 1; - - while (++i < str.length) { - var ch = str[i]; - - if (ch === '\\') { - val += (opts.keepEscaping === false ? '' : ch) + str[++i]; - continue; - } - - if (ch === '(') { - parens.push(ch); - stack.push(ch); - } - - if (ch === '[') { - brackets.push(ch); - stack.push(ch); - } - - if (ch === ')') { - parens.pop(); - stack.pop(); - if (!stack.length) { - val += ch; - break; - } - } - - if (ch === ']') { - brackets.pop(); - stack.pop(); - if (!stack.length) { - val += ch; - break; - } - } - val += ch; - } - - tok.split = false; - tok.val = val.slice(1); - tok.idx = i; - }; -}; - -/** - * Returns true if the given string looks like a regex quantifier - * @return {Boolean} - */ - -utils.isQuantifier = function(str) { - return /^(?:[0-9]?,[0-9]|[0-9],)$/.test(str); -}; - -/** - * Cast `val` to an array. - * @param {*} `val` - */ - -utils.stringifyArray = function(arr) { - return [utils.arrayify(arr).join('|')]; -}; - -/** - * Cast `val` to an array. - * @param {*} `val` - */ - -utils.arrayify = function(arr) { - if (typeof arr === 'undefined') { - return []; - } - if (typeof arr === 'string') { - return [arr]; - } - return arr; -}; - -/** - * Returns true if the given `str` is a non-empty string - * @return {Boolean} - */ - -utils.isString = function(str) { - return str != null && typeof str === 'string'; -}; - -/** - * Get the last element from `array` - * @param {Array} `array` - * @return {*} - */ - -utils.last = function(arr, n) { - return arr[arr.length - (n || 1)]; -}; - -utils.escapeRegex = function(str) { - return str.replace(/\\?([!^*?()[\]{}+?/])/g, '\\$1'); -}; diff --git a/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/LICENSE b/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/LICENSE deleted file mode 100644 index fa30c4cb3..000000000 --- a/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/README.md b/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/README.md deleted file mode 100644 index cdc45d4ff..000000000 --- a/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# extend-shallow [![NPM version](https://badge.fury.io/js/extend-shallow.svg)](http://badge.fury.io/js/extend-shallow) [![Build Status](https://travis-ci.org/jonschlinkert/extend-shallow.svg)](https://travis-ci.org/jonschlinkert/extend-shallow) - -> Extend an object with the properties of additional objects. node.js/javascript util. - -## Install - -Install with [npm](https://www.npmjs.com/) - -```sh -$ npm i extend-shallow --save -``` - -## Usage - -```js -var extend = require('extend-shallow'); - -extend({a: 'b'}, {c: 'd'}) -//=> {a: 'b', c: 'd'} -``` - -Pass an empty object to shallow clone: - -```js -var obj = {}; -extend(obj, {a: 'b'}, {c: 'd'}) -//=> {a: 'b', c: 'd'} -``` - -## Related - -* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. -* [for-own](https://github.com/jonschlinkert/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) -* [for-in](https://github.com/jonschlinkert/for-in): Iterate over the own and inherited enumerable properties of an objecte, and return an object… [more](https://github.com/jonschlinkert/for-in) -* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor. -* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null. -* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value. - -## Running tests - -Install dev dependencies: - -```sh -$ npm i -d && npm test -``` - -## Author - -**Jon Schlinkert** - -+ [github/jonschlinkert](https://github.com/jonschlinkert) -+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2015 Jon Schlinkert -Released under the MIT license. - -*** - -_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 29, 2015._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/index.js b/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/index.js deleted file mode 100644 index 92a067fcc..000000000 --- a/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/index.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -var isObject = require('is-extendable'); - -module.exports = function extend(o/*, objects*/) { - if (!isObject(o)) { o = {}; } - - var len = arguments.length; - for (var i = 1; i < len; i++) { - var obj = arguments[i]; - - if (isObject(obj)) { - assign(o, obj); - } - } - return o; -}; - -function assign(a, b) { - for (var key in b) { - if (hasOwn(b, key)) { - a[key] = b[key]; - } - } -} - -/** - * Returns true if the given `key` is an own property of `obj`. - */ - -function hasOwn(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} diff --git a/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/package.json b/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/package.json deleted file mode 100644 index ba82f1bfd..000000000 --- a/node_modules/readdirp/node_modules/braces/node_modules/extend-shallow/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_from": "extend-shallow@^2.0.1", - "_id": "extend-shallow@2.0.1", - "_inBundle": false, - "_integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "_location": "/readdirp/braces/extend-shallow", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "extend-shallow@^2.0.1", - "name": "extend-shallow", - "escapedName": "extend-shallow", - "rawSpec": "^2.0.1", - "saveSpec": null, - "fetchSpec": "^2.0.1" - }, - "_requiredBy": [ - "/readdirp/braces" - ], - "_resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "_shasum": "51af7d614ad9a9f610ea1bafbb989d6b1c56890f", - "_spec": "extend-shallow@^2.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/braces", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/extend-shallow/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "deprecated": false, - "description": "Extend an object with the properties of additional objects. node.js/javascript util.", - "devDependencies": { - "array-slice": "^0.2.3", - "benchmarked": "^0.1.4", - "chalk": "^1.0.0", - "for-own": "^0.1.3", - "glob": "^5.0.12", - "is-plain-object": "^2.0.1", - "kind-of": "^2.0.0", - "minimist": "^1.1.1", - "mocha": "^2.2.5", - "should": "^7.0.1" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/extend-shallow", - "keywords": [ - "assign", - "extend", - "javascript", - "js", - "keys", - "merge", - "obj", - "object", - "prop", - "properties", - "property", - "props", - "shallow", - "util", - "utility", - "utils", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "extend-shallow", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/extend-shallow.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "2.0.1" -} diff --git a/node_modules/readdirp/node_modules/braces/package.json b/node_modules/readdirp/node_modules/braces/package.json deleted file mode 100644 index 59ddfed61..000000000 --- a/node_modules/readdirp/node_modules/braces/package.json +++ /dev/null @@ -1,156 +0,0 @@ -{ - "_from": "braces@^2.3.1", - "_id": "braces@2.3.2", - "_inBundle": false, - "_integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "_location": "/readdirp/braces", - "_phantomChildren": { - "is-extendable": "0.1.1" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "braces@^2.3.1", - "name": "braces", - "escapedName": "braces", - "rawSpec": "^2.3.1", - "saveSpec": null, - "fetchSpec": "^2.3.1" - }, - "_requiredBy": [ - "/readdirp/micromatch" - ], - "_resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "_shasum": "5979fd3f14cd531565e5fa2df1abfff1dfaee729", - "_spec": "braces@^2.3.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/micromatch/braces/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Brian Woodward", - "url": "https://twitter.com/doowb" - }, - { - "name": "Elan Shanker", - "url": "https://github.com/es128" - }, - { - "name": "Eugene Sharygin", - "url": "https://github.com/eush77" - }, - { - "name": "hemanth.hm", - "url": "http://h3manth.com" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - } - ], - "dependencies": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "deprecated": false, - "description": "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.", - "devDependencies": { - "ansi-cyan": "^0.1.1", - "benchmarked": "^2.0.0", - "brace-expansion": "^1.1.8", - "cross-spawn": "^5.1.0", - "gulp": "^3.9.1", - "gulp-eslint": "^4.0.0", - "gulp-format-md": "^1.0.0", - "gulp-istanbul": "^1.1.2", - "gulp-mocha": "^3.0.1", - "gulp-unused": "^0.2.1", - "is-windows": "^1.0.1", - "minimatch": "^3.0.4", - "mocha": "^3.2.0", - "noncharacters": "^1.1.0", - "text-table": "^0.2.0", - "time-diff": "^0.3.1", - "yargs-parser": "^8.0.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js", - "lib" - ], - "homepage": "https://github.com/micromatch/braces", - "keywords": [ - "alpha", - "alphabetical", - "bash", - "brace", - "braces", - "expand", - "expansion", - "filepath", - "fill", - "fs", - "glob", - "globbing", - "letter", - "match", - "matches", - "matching", - "number", - "numerical", - "path", - "range", - "ranges", - "sh" - ], - "license": "MIT", - "main": "index.js", - "name": "braces", - "repository": { - "type": "git", - "url": "git+https://github.com/micromatch/braces.git" - }, - "scripts": { - "benchmark": "node benchmark", - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "lint": { - "reflinks": true - }, - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "expand-brackets", - "extglob", - "fill-range", - "micromatch", - "nanomatch" - ] - } - }, - "version": "2.3.2" -} diff --git a/node_modules/readdirp/node_modules/expand-brackets/LICENSE b/node_modules/readdirp/node_modules/expand-brackets/LICENSE deleted file mode 100644 index 652517172..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2016, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/expand-brackets/README.md b/node_modules/readdirp/node_modules/expand-brackets/README.md deleted file mode 100644 index c0e33d080..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/README.md +++ /dev/null @@ -1,302 +0,0 @@ -# expand-brackets [![NPM version](https://img.shields.io/npm/v/expand-brackets.svg?style=flat)](https://www.npmjs.com/package/expand-brackets) [![NPM monthly downloads](https://img.shields.io/npm/dm/expand-brackets.svg?style=flat)](https://npmjs.org/package/expand-brackets) [![NPM total downloads](https://img.shields.io/npm/dt/expand-brackets.svg?style=flat)](https://npmjs.org/package/expand-brackets) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/expand-brackets.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/expand-brackets) [![Windows Build Status](https://img.shields.io/appveyor/ci/jonschlinkert/expand-brackets.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/jonschlinkert/expand-brackets) - -> Expand POSIX bracket expressions (character classes) in glob patterns. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save expand-brackets -``` - -## Usage - -```js -var brackets = require('expand-brackets'); -brackets(string[, options]); -``` - -**Params** - -The main export is a function that takes the following parameters: - -* `pattern` **{String}**: the pattern to convert -* `options` **{Object}**: optionally supply an options object -* `returns` **{String}**: returns a string that can be used to create a regex - -**Example** - -```js -console.log(brackets('[![:lower:]]')); -//=> '[^a-z]' -``` - -## API - -### [brackets](index.js#L29) - -Parses the given POSIX character class `pattern` and returns a -string that can be used for creating regular expressions for matching. - -**Params** - -* `pattern` **{String}** -* `options` **{Object}** -* `returns` **{Object}** - -### [.match](index.js#L54) - -Takes an array of strings and a POSIX character class pattern, and returns a new array with only the strings that matched the pattern. - -**Example** - -```js -var brackets = require('expand-brackets'); -console.log(brackets.match(['1', 'a', 'ab'], '[[:alpha:]]')); -//=> ['a'] - -console.log(brackets.match(['1', 'a', 'ab'], '[[:alpha:]]+')); -//=> ['a', 'ab'] -``` - -**Params** - -* `arr` **{Array}**: Array of strings to match -* `pattern` **{String}**: POSIX character class pattern(s) -* `options` **{Object}** -* `returns` **{Array}** - -### [.isMatch](index.js#L100) - -Returns true if the specified `string` matches the given brackets `pattern`. - -**Example** - -```js -var brackets = require('expand-brackets'); - -console.log(brackets.isMatch('a.a', '[[:alpha:]].[[:alpha:]]')); -//=> true -console.log(brackets.isMatch('1.2', '[[:alpha:]].[[:alpha:]]')); -//=> false -``` - -**Params** - -* `string` **{String}**: String to match -* `pattern` **{String}**: Poxis pattern -* `options` **{String}** -* `returns` **{Boolean}** - -### [.matcher](index.js#L123) - -Takes a POSIX character class pattern and returns a matcher function. The returned function takes the string to match as its only argument. - -**Example** - -```js -var brackets = require('expand-brackets'); -var isMatch = brackets.matcher('[[:lower:]].[[:upper:]]'); - -console.log(isMatch('a.a')); -//=> false -console.log(isMatch('a.A')); -//=> true -``` - -**Params** - -* `pattern` **{String}**: Poxis pattern -* `options` **{String}** -* `returns` **{Boolean}** - -### [.makeRe](index.js#L145) - -Create a regular expression from the given `pattern`. - -**Example** - -```js -var brackets = require('expand-brackets'); -var re = brackets.makeRe('[[:alpha:]]'); -console.log(re); -//=> /^(?:[a-zA-Z])$/ -``` - -**Params** - -* `pattern` **{String}**: The pattern to convert to regex. -* `options` **{Object}** -* `returns` **{RegExp}** - -### [.create](index.js#L187) - -Parses the given POSIX character class `pattern` and returns an object with the compiled `output` and optional source `map`. - -**Example** - -```js -var brackets = require('expand-brackets'); -console.log(brackets('[[:alpha:]]')); -// { options: { source: 'string' }, -// input: '[[:alpha:]]', -// state: {}, -// compilers: -// { eos: [Function], -// noop: [Function], -// bos: [Function], -// not: [Function], -// escape: [Function], -// text: [Function], -// posix: [Function], -// bracket: [Function], -// 'bracket.open': [Function], -// 'bracket.inner': [Function], -// 'bracket.literal': [Function], -// 'bracket.close': [Function] }, -// output: '[a-zA-Z]', -// ast: -// { type: 'root', -// errors: [], -// nodes: [ [Object], [Object], [Object] ] }, -// parsingErrors: [] } -``` - -**Params** - -* `pattern` **{String}** -* `options` **{Object}** -* `returns` **{Object}** - -## Options - -### options.sourcemap - -Generate a source map for the given pattern. - -**Example** - -```js -var res = brackets('[:alpha:]', {sourcemap: true}); - -console.log(res.map); -// { version: 3, -// sources: [ 'brackets' ], -// names: [], -// mappings: 'AAAA,MAAS', -// sourcesContent: [ '[:alpha:]' ] } -``` - -### POSIX Character classes - -The following named POSIX bracket expressions are supported: - -* `[:alnum:]`: Alphanumeric characters (`a-zA-Z0-9]`) -* `[:alpha:]`: Alphabetic characters (`a-zA-Z]`) -* `[:blank:]`: Space and tab (`[ t]`) -* `[:digit:]`: Digits (`[0-9]`) -* `[:lower:]`: Lowercase letters (`[a-z]`) -* `[:punct:]`: Punctuation and symbols. (`[!"#$%&'()*+, -./:;<=>?@ [\]^_``{|}~]`) -* `[:upper:]`: Uppercase letters (`[A-Z]`) -* `[:word:]`: Word characters (letters, numbers and underscores) (`[A-Za-z0-9_]`) -* `[:xdigit:]`: Hexadecimal digits (`[A-Fa-f0-9]`) - -See [posix-character-classes](https://github.com/jonschlinkert/posix-character-classes) for more details. - -**Not supported** - -* [equivalence classes](https://www.gnu.org/software/gawk/manual/html_node/Bracket-Expressions.html) are not supported -* [POSIX.2 collating symbols](https://www.gnu.org/software/gawk/manual/html_node/Bracket-Expressions.html) are not supported - -## Changelog - -### v2.0.0 - -**Breaking changes** - -* The main export now returns the compiled string, instead of the object returned from the compiler - -**Added features** - -* Adds a `.create` method to do what the main function did before v2.0.0 - -### v0.2.0 - -In addition to performance and matching improvements, the v0.2.0 refactor adds complete POSIX character class support, with the exception of equivalence classes and POSIX.2 collating symbols which are not relevant to node.js usage. - -**Added features** - -* parser is exposed, so that expand-brackets parsers can be used by upstream parsers (like [micromatch](https://github.com/jonschlinkert/micromatch)) -* compiler is exposed, so that expand-brackets compilers can be used by upstream compilers -* source maps - -**source map example** - -```js -var brackets = require('expand-brackets'); -var res = brackets('[:alpha:]'); -console.log(res.map); - -{ version: 3, - sources: [ 'brackets' ], - names: [], - mappings: 'AAAA,MAAS', - sourcesContent: [ '[:alpha:]' ] } -``` - -## About - -### Related projects - -* [braces](https://www.npmjs.com/package/braces): Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces… [more](https://github.com/jonschlinkert/braces) | [homepage](https://github.com/jonschlinkert/braces "Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces specification, without sacrificing speed.") -* [extglob](https://www.npmjs.com/package/extglob): Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob… [more](https://github.com/jonschlinkert/extglob) | [homepage](https://github.com/jonschlinkert/extglob "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.") -* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") -* [nanomatch](https://www.npmjs.com/package/nanomatch): Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash… [more](https://github.com/jonschlinkert/nanomatch) | [homepage](https://github.com/jonschlinkert/nanomatch "Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces)") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor**
    | -| --- | --- | -| 66 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [MartinKolarik](https://github.com/MartinKolarik) | -| 2 | [es128](https://github.com/es128) | -| 1 | [eush77](https://github.com/eush77) | - -### Building docs - -_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ - -To generate the readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install -g verb verb-generate-readme && verb -``` - -### Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -### License - -Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/expand-brackets/blob/master/LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on December 12, 2016._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/expand-brackets/changelog.md b/node_modules/readdirp/node_modules/expand-brackets/changelog.md deleted file mode 100644 index 0c0723ab4..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/changelog.md +++ /dev/null @@ -1,35 +0,0 @@ -## Changelog - -### v2.0.0 - -**Breaking changes** - -- The main export now returns the compiled string, instead of the object returned from the compiler - -**Added features** - -- Adds a `.create` method to do what the main function did before v2.0.0 - -### v0.2.0 - -In addition to performance and matching improvements, the v0.2.0 refactor adds complete POSIX character class support, with the exception of equivalence classes and POSIX.2 collating symbols which are not relevant to node.js usage. - -**Added features** - -- parser is exposed, so that expand-brackets parsers can be used by upstream parsers (like [micromatch][]) -- compiler is exposed, so that expand-brackets compilers can be used by upstream compilers -- source maps - -**source map example** - -```js -var brackets = require('expand-brackets'); -var res = brackets('[:alpha:]'); -console.log(res.map); - -{ version: 3, - sources: [ 'brackets' ], - names: [], - mappings: 'AAAA,MAAS', - sourcesContent: [ '[:alpha:]' ] } -``` diff --git a/node_modules/readdirp/node_modules/expand-brackets/index.js b/node_modules/readdirp/node_modules/expand-brackets/index.js deleted file mode 100644 index 74b8b1556..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/index.js +++ /dev/null @@ -1,211 +0,0 @@ -'use strict'; - -/** - * Local dependencies - */ - -var compilers = require('./lib/compilers'); -var parsers = require('./lib/parsers'); - -/** - * Module dependencies - */ - -var debug = require('debug')('expand-brackets'); -var extend = require('extend-shallow'); -var Snapdragon = require('snapdragon'); -var toRegex = require('to-regex'); - -/** - * Parses the given POSIX character class `pattern` and returns a - * string that can be used for creating regular expressions for matching. - * - * @param {String} `pattern` - * @param {Object} `options` - * @return {Object} - * @api public - */ - -function brackets(pattern, options) { - debug('initializing from <%s>', __filename); - var res = brackets.create(pattern, options); - return res.output; -} - -/** - * Takes an array of strings and a POSIX character class pattern, and returns a new - * array with only the strings that matched the pattern. - * - * ```js - * var brackets = require('expand-brackets'); - * console.log(brackets.match(['1', 'a', 'ab'], '[[:alpha:]]')); - * //=> ['a'] - * - * console.log(brackets.match(['1', 'a', 'ab'], '[[:alpha:]]+')); - * //=> ['a', 'ab'] - * ``` - * @param {Array} `arr` Array of strings to match - * @param {String} `pattern` POSIX character class pattern(s) - * @param {Object} `options` - * @return {Array} - * @api public - */ - -brackets.match = function(arr, pattern, options) { - arr = [].concat(arr); - var opts = extend({}, options); - var isMatch = brackets.matcher(pattern, opts); - var len = arr.length; - var idx = -1; - var res = []; - - while (++idx < len) { - var ele = arr[idx]; - if (isMatch(ele)) { - res.push(ele); - } - } - - if (res.length === 0) { - if (opts.failglob === true) { - throw new Error('no matches found for "' + pattern + '"'); - } - - if (opts.nonull === true || opts.nullglob === true) { - return [pattern.split('\\').join('')]; - } - } - return res; -}; - -/** - * Returns true if the specified `string` matches the given - * brackets `pattern`. - * - * ```js - * var brackets = require('expand-brackets'); - * - * console.log(brackets.isMatch('a.a', '[[:alpha:]].[[:alpha:]]')); - * //=> true - * console.log(brackets.isMatch('1.2', '[[:alpha:]].[[:alpha:]]')); - * //=> false - * ``` - * @param {String} `string` String to match - * @param {String} `pattern` Poxis pattern - * @param {String} `options` - * @return {Boolean} - * @api public - */ - -brackets.isMatch = function(str, pattern, options) { - return brackets.matcher(pattern, options)(str); -}; - -/** - * Takes a POSIX character class pattern and returns a matcher function. The returned - * function takes the string to match as its only argument. - * - * ```js - * var brackets = require('expand-brackets'); - * var isMatch = brackets.matcher('[[:lower:]].[[:upper:]]'); - * - * console.log(isMatch('a.a')); - * //=> false - * console.log(isMatch('a.A')); - * //=> true - * ``` - * @param {String} `pattern` Poxis pattern - * @param {String} `options` - * @return {Boolean} - * @api public - */ - -brackets.matcher = function(pattern, options) { - var re = brackets.makeRe(pattern, options); - return function(str) { - return re.test(str); - }; -}; - -/** - * Create a regular expression from the given `pattern`. - * - * ```js - * var brackets = require('expand-brackets'); - * var re = brackets.makeRe('[[:alpha:]]'); - * console.log(re); - * //=> /^(?:[a-zA-Z])$/ - * ``` - * @param {String} `pattern` The pattern to convert to regex. - * @param {Object} `options` - * @return {RegExp} - * @api public - */ - -brackets.makeRe = function(pattern, options) { - var res = brackets.create(pattern, options); - var opts = extend({strictErrors: false}, options); - return toRegex(res.output, opts); -}; - -/** - * Parses the given POSIX character class `pattern` and returns an object - * with the compiled `output` and optional source `map`. - * - * ```js - * var brackets = require('expand-brackets'); - * console.log(brackets('[[:alpha:]]')); - * // { options: { source: 'string' }, - * // input: '[[:alpha:]]', - * // state: {}, - * // compilers: - * // { eos: [Function], - * // noop: [Function], - * // bos: [Function], - * // not: [Function], - * // escape: [Function], - * // text: [Function], - * // posix: [Function], - * // bracket: [Function], - * // 'bracket.open': [Function], - * // 'bracket.inner': [Function], - * // 'bracket.literal': [Function], - * // 'bracket.close': [Function] }, - * // output: '[a-zA-Z]', - * // ast: - * // { type: 'root', - * // errors: [], - * // nodes: [ [Object], [Object], [Object] ] }, - * // parsingErrors: [] } - * ``` - * @param {String} `pattern` - * @param {Object} `options` - * @return {Object} - * @api public - */ - -brackets.create = function(pattern, options) { - var snapdragon = (options && options.snapdragon) || new Snapdragon(options); - compilers(snapdragon); - parsers(snapdragon); - - var ast = snapdragon.parse(pattern, options); - ast.input = pattern; - var res = snapdragon.compile(ast, options); - res.input = pattern; - return res; -}; - -/** - * Expose `brackets` constructor, parsers and compilers - */ - -brackets.compilers = compilers; -brackets.parsers = parsers; - -/** - * Expose `brackets` - * @type {Function} - */ - -module.exports = brackets; diff --git a/node_modules/readdirp/node_modules/expand-brackets/lib/compilers.js b/node_modules/readdirp/node_modules/expand-brackets/lib/compilers.js deleted file mode 100644 index fbf7fe818..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/lib/compilers.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict'; - -var posix = require('posix-character-classes'); - -module.exports = function(brackets) { - brackets.compiler - - /** - * Escaped characters - */ - - .set('escape', function(node) { - return this.emit('\\' + node.val.replace(/^\\/, ''), node); - }) - - /** - * Text - */ - - .set('text', function(node) { - return this.emit(node.val.replace(/([{}])/g, '\\$1'), node); - }) - - /** - * POSIX character classes - */ - - .set('posix', function(node) { - if (node.val === '[::]') { - return this.emit('\\[::\\]', node); - } - - var val = posix[node.inner]; - if (typeof val === 'undefined') { - val = '[' + node.inner + ']'; - } - return this.emit(val, node); - }) - - /** - * Non-posix brackets - */ - - .set('bracket', function(node) { - return this.mapVisit(node.nodes); - }) - .set('bracket.open', function(node) { - return this.emit(node.val, node); - }) - .set('bracket.inner', function(node) { - var inner = node.val; - - if (inner === '[' || inner === ']') { - return this.emit('\\' + node.val, node); - } - if (inner === '^]') { - return this.emit('^\\]', node); - } - if (inner === '^') { - return this.emit('^', node); - } - - if (/-/.test(inner) && !/(\d-\d|\w-\w)/.test(inner)) { - inner = inner.split('-').join('\\-'); - } - - var isNegated = inner.charAt(0) === '^'; - // add slashes to negated brackets, per spec - if (isNegated && inner.indexOf('/') === -1) { - inner += '/'; - } - if (isNegated && inner.indexOf('.') === -1) { - inner += '.'; - } - - // don't unescape `0` (octal literal) - inner = inner.replace(/\\([1-9])/g, '$1'); - return this.emit(inner, node); - }) - .set('bracket.close', function(node) { - var val = node.val.replace(/^\\/, ''); - if (node.parent.escaped === true) { - return this.emit('\\' + val, node); - } - return this.emit(val, node); - }); -}; diff --git a/node_modules/readdirp/node_modules/expand-brackets/lib/parsers.js b/node_modules/readdirp/node_modules/expand-brackets/lib/parsers.js deleted file mode 100644 index 450a512e4..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/lib/parsers.js +++ /dev/null @@ -1,219 +0,0 @@ -'use strict'; - -var utils = require('./utils'); -var define = require('define-property'); - -/** - * Text regex - */ - -var TEXT_REGEX = '(\\[(?=.*\\])|\\])+'; -var not = utils.createRegex(TEXT_REGEX); - -/** - * Brackets parsers - */ - -function parsers(brackets) { - brackets.state = brackets.state || {}; - brackets.parser.sets.bracket = brackets.parser.sets.bracket || []; - brackets.parser - - .capture('escape', function() { - if (this.isInside('bracket')) return; - var pos = this.position(); - var m = this.match(/^\\(.)/); - if (!m) return; - - return pos({ - type: 'escape', - val: m[0] - }); - }) - - /** - * Text parser - */ - - .capture('text', function() { - if (this.isInside('bracket')) return; - var pos = this.position(); - var m = this.match(not); - if (!m || !m[0]) return; - - return pos({ - type: 'text', - val: m[0] - }); - }) - - /** - * POSIX character classes: "[[:alpha:][:digits:]]" - */ - - .capture('posix', function() { - var pos = this.position(); - var m = this.match(/^\[:(.*?):\](?=.*\])/); - if (!m) return; - - var inside = this.isInside('bracket'); - if (inside) { - brackets.posix++; - } - - return pos({ - type: 'posix', - insideBracket: inside, - inner: m[1], - val: m[0] - }); - }) - - /** - * Bracket (noop) - */ - - .capture('bracket', function() {}) - - /** - * Open: '[' - */ - - .capture('bracket.open', function() { - var parsed = this.parsed; - var pos = this.position(); - var m = this.match(/^\[(?=.*\])/); - if (!m) return; - - var prev = this.prev(); - var last = utils.last(prev.nodes); - - if (parsed.slice(-1) === '\\' && !this.isInside('bracket')) { - last.val = last.val.slice(0, last.val.length - 1); - return pos({ - type: 'escape', - val: m[0] - }); - } - - var open = pos({ - type: 'bracket.open', - val: m[0] - }); - - if (last.type === 'bracket.open' || this.isInside('bracket')) { - open.val = '\\' + open.val; - open.type = 'bracket.inner'; - open.escaped = true; - return open; - } - - var node = pos({ - type: 'bracket', - nodes: [open] - }); - - define(node, 'parent', prev); - define(open, 'parent', node); - this.push('bracket', node); - prev.nodes.push(node); - }) - - /** - * Bracket text - */ - - .capture('bracket.inner', function() { - if (!this.isInside('bracket')) return; - var pos = this.position(); - var m = this.match(not); - if (!m || !m[0]) return; - - var next = this.input.charAt(0); - var val = m[0]; - - var node = pos({ - type: 'bracket.inner', - val: val - }); - - if (val === '\\\\') { - return node; - } - - var first = val.charAt(0); - var last = val.slice(-1); - - if (first === '!') { - val = '^' + val.slice(1); - } - - if (last === '\\' || (val === '^' && next === ']')) { - val += this.input[0]; - this.consume(1); - } - - node.val = val; - return node; - }) - - /** - * Close: ']' - */ - - .capture('bracket.close', function() { - var parsed = this.parsed; - var pos = this.position(); - var m = this.match(/^\]/); - if (!m) return; - - var prev = this.prev(); - var last = utils.last(prev.nodes); - - if (parsed.slice(-1) === '\\' && !this.isInside('bracket')) { - last.val = last.val.slice(0, last.val.length - 1); - - return pos({ - type: 'escape', - val: m[0] - }); - } - - var node = pos({ - type: 'bracket.close', - rest: this.input, - val: m[0] - }); - - if (last.type === 'bracket.open') { - node.type = 'bracket.inner'; - node.escaped = true; - return node; - } - - var bracket = this.pop('bracket'); - if (!this.isType(bracket, 'bracket')) { - if (this.options.strict) { - throw new Error('missing opening "["'); - } - node.type = 'bracket.inner'; - node.escaped = true; - return node; - } - - bracket.nodes.push(node); - define(node, 'parent', bracket); - }); -} - -/** - * Brackets parsers - */ - -module.exports = parsers; - -/** - * Expose text regex - */ - -module.exports.TEXT_REGEX = TEXT_REGEX; diff --git a/node_modules/readdirp/node_modules/expand-brackets/lib/utils.js b/node_modules/readdirp/node_modules/expand-brackets/lib/utils.js deleted file mode 100644 index 599ff5126..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/lib/utils.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -var toRegex = require('to-regex'); -var regexNot = require('regex-not'); -var cached; - -/** - * Get the last element from `array` - * @param {Array} `array` - * @return {*} - */ - -exports.last = function(arr) { - return arr[arr.length - 1]; -}; - -/** - * Create and cache regex to use for text nodes - */ - -exports.createRegex = function(pattern, include) { - if (cached) return cached; - var opts = {contains: true, strictClose: false}; - var not = regexNot.create(pattern, opts); - var re; - - if (typeof include === 'string') { - re = toRegex('^(?:' + include + '|' + not + ')', opts); - } else { - re = toRegex(not, opts); - } - - return (cached = re); -}; diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/LICENSE b/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/LICENSE deleted file mode 100644 index 65f90aca8..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/README.md b/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/README.md deleted file mode 100644 index 8cac698ad..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/README.md +++ /dev/null @@ -1,77 +0,0 @@ -# define-property [![NPM version](https://badge.fury.io/js/define-property.svg)](http://badge.fury.io/js/define-property) - -> Define a non-enumerable property on an object. - -## Install - -Install with [npm](https://www.npmjs.com/) - -```sh -$ npm i define-property --save -``` - -## Usage - -**Params** - -* `obj`: The object on which to define the property. -* `prop`: The name of the property to be defined or modified. -* `descriptor`: The descriptor for the property being defined or modified. - -```js -var define = require('define-property'); -var obj = {}; -define(obj, 'foo', function(val) { - return val.toUpperCase(); -}); - -console.log(obj); -//=> {} - -console.log(obj.foo('bar')); -//=> 'BAR' -``` - -**get/set** - -```js -define(obj, 'foo', { - get: function() {}, - set: function() {} -}); -``` - -## Related projects - -* [delegate-object](https://www.npmjs.com/package/delegate-object): Copy properties from an object to another object, where properties with function values will be… [more](https://www.npmjs.com/package/delegate-object) | [homepage](https://github.com/doowb/delegate-object) -* [forward-object](https://www.npmjs.com/package/forward-object): Copy properties from an object to another object, where properties with function values will be… [more](https://www.npmjs.com/package/forward-object) | [homepage](https://github.com/doowb/forward-object) -* [mixin-deep](https://www.npmjs.com/package/mixin-deep): Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. | [homepage](https://github.com/jonschlinkert/mixin-deep) -* [mixin-object](https://www.npmjs.com/package/mixin-object): Mixin the own and inherited properties of other objects onto the first object. Pass an… [more](https://www.npmjs.com/package/mixin-object) | [homepage](https://github.com/jonschlinkert/mixin-object) - -## Running tests - -Install dev dependencies: - -```sh -$ npm i -d && npm test -``` - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/define-property/issues/new). - -## Author - -**Jon Schlinkert** - -+ [github/jonschlinkert](https://github.com/jonschlinkert) -+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2015 Jon Schlinkert -Released under the MIT license. - -*** - -_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 31, 2015._ diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/index.js b/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/index.js deleted file mode 100644 index 3e0e5e133..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/index.js +++ /dev/null @@ -1,31 +0,0 @@ -/*! - * define-property - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var isDescriptor = require('is-descriptor'); - -module.exports = function defineProperty(obj, prop, val) { - if (typeof obj !== 'object' && typeof obj !== 'function') { - throw new TypeError('expected an object or function.'); - } - - if (typeof prop !== 'string') { - throw new TypeError('expected `prop` to be a string.'); - } - - if (isDescriptor(val) && ('set' in val || 'get' in val)) { - return Object.defineProperty(obj, prop, val); - } - - return Object.defineProperty(obj, prop, { - configurable: true, - enumerable: false, - writable: true, - value: val - }); -}; diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/package.json b/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/package.json deleted file mode 100644 index 5004497e7..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "_from": "define-property@^0.2.5", - "_id": "define-property@0.2.5", - "_inBundle": false, - "_integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "_location": "/readdirp/expand-brackets/define-property", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "define-property@^0.2.5", - "name": "define-property", - "escapedName": "define-property", - "rawSpec": "^0.2.5", - "saveSpec": null, - "fetchSpec": "^0.2.5" - }, - "_requiredBy": [ - "/readdirp/expand-brackets" - ], - "_resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "_shasum": "c35b1ef918ec3c990f9a5bc57be04aacec5c8116", - "_spec": "define-property@^0.2.5", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/expand-brackets", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/define-property/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "deprecated": false, - "description": "Define a non-enumerable property on an object.", - "devDependencies": { - "mocha": "*", - "should": "^7.0.4" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/define-property", - "keywords": [ - "define", - "define-property", - "enumerable", - "key", - "non", - "non-enumerable", - "object", - "prop", - "property", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "define-property", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/define-property.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "mixin-deep", - "mixin-object", - "delegate-object", - "forward-object" - ] - } - }, - "version": "0.2.5" -} diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/LICENSE b/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/LICENSE deleted file mode 100644 index fa30c4cb3..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/README.md b/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/README.md deleted file mode 100644 index cdc45d4ff..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# extend-shallow [![NPM version](https://badge.fury.io/js/extend-shallow.svg)](http://badge.fury.io/js/extend-shallow) [![Build Status](https://travis-ci.org/jonschlinkert/extend-shallow.svg)](https://travis-ci.org/jonschlinkert/extend-shallow) - -> Extend an object with the properties of additional objects. node.js/javascript util. - -## Install - -Install with [npm](https://www.npmjs.com/) - -```sh -$ npm i extend-shallow --save -``` - -## Usage - -```js -var extend = require('extend-shallow'); - -extend({a: 'b'}, {c: 'd'}) -//=> {a: 'b', c: 'd'} -``` - -Pass an empty object to shallow clone: - -```js -var obj = {}; -extend(obj, {a: 'b'}, {c: 'd'}) -//=> {a: 'b', c: 'd'} -``` - -## Related - -* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. -* [for-own](https://github.com/jonschlinkert/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) -* [for-in](https://github.com/jonschlinkert/for-in): Iterate over the own and inherited enumerable properties of an objecte, and return an object… [more](https://github.com/jonschlinkert/for-in) -* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor. -* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null. -* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value. - -## Running tests - -Install dev dependencies: - -```sh -$ npm i -d && npm test -``` - -## Author - -**Jon Schlinkert** - -+ [github/jonschlinkert](https://github.com/jonschlinkert) -+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2015 Jon Schlinkert -Released under the MIT license. - -*** - -_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 29, 2015._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/index.js b/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/index.js deleted file mode 100644 index 92a067fcc..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/index.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -var isObject = require('is-extendable'); - -module.exports = function extend(o/*, objects*/) { - if (!isObject(o)) { o = {}; } - - var len = arguments.length; - for (var i = 1; i < len; i++) { - var obj = arguments[i]; - - if (isObject(obj)) { - assign(o, obj); - } - } - return o; -}; - -function assign(a, b) { - for (var key in b) { - if (hasOwn(b, key)) { - a[key] = b[key]; - } - } -} - -/** - * Returns true if the given `key` is an own property of `obj`. - */ - -function hasOwn(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/package.json b/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/package.json deleted file mode 100644 index 357b559c2..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_from": "extend-shallow@^2.0.1", - "_id": "extend-shallow@2.0.1", - "_inBundle": false, - "_integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "_location": "/readdirp/expand-brackets/extend-shallow", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "extend-shallow@^2.0.1", - "name": "extend-shallow", - "escapedName": "extend-shallow", - "rawSpec": "^2.0.1", - "saveSpec": null, - "fetchSpec": "^2.0.1" - }, - "_requiredBy": [ - "/readdirp/expand-brackets" - ], - "_resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "_shasum": "51af7d614ad9a9f610ea1bafbb989d6b1c56890f", - "_spec": "extend-shallow@^2.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/expand-brackets", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/extend-shallow/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "deprecated": false, - "description": "Extend an object with the properties of additional objects. node.js/javascript util.", - "devDependencies": { - "array-slice": "^0.2.3", - "benchmarked": "^0.1.4", - "chalk": "^1.0.0", - "for-own": "^0.1.3", - "glob": "^5.0.12", - "is-plain-object": "^2.0.1", - "kind-of": "^2.0.0", - "minimist": "^1.1.1", - "mocha": "^2.2.5", - "should": "^7.0.1" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/extend-shallow", - "keywords": [ - "assign", - "extend", - "javascript", - "js", - "keys", - "merge", - "obj", - "object", - "prop", - "properties", - "property", - "props", - "shallow", - "util", - "utility", - "utils", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "extend-shallow", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/extend-shallow.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "2.0.1" -} diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/LICENSE b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/LICENSE deleted file mode 100644 index 65f90aca8..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/README.md b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/README.md deleted file mode 100644 index 3743fe6bc..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/README.md +++ /dev/null @@ -1,123 +0,0 @@ -# is-accessor-descriptor [![NPM version](https://img.shields.io/npm/v/is-accessor-descriptor.svg)](https://www.npmjs.com/package/is-accessor-descriptor) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-accessor-descriptor.svg)](https://travis-ci.org/jonschlinkert/is-accessor-descriptor) - -> Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. - -- [Install](#install) -- [Usage](#usage) -- [Examples](#examples) -- [API](#api) -- [Related projects](#related-projects) -- [Running tests](#running-tests) -- [Contributing](#contributing) -- [Author](#author) -- [License](#license) - -_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm i is-accessor-descriptor --save -``` - -## Usage - -```js -var isAccessor = require('is-accessor-descriptor'); - -isAccessor({get: function() {}}); -//=> true -``` - -You may also pass an object and property name to check if the property is an accessor: - -```js -isAccessor(foo, 'bar'); -``` - -## Examples - -`false` when not an object - -```js -isAccessor('a') -isAccessor(null) -isAccessor([]) -//=> false -``` - -`true` when the object has valid properties - -and the properties all have the correct JavaScript types: - -```js -isAccessor({get: noop, set: noop}) -isAccessor({get: noop}) -isAccessor({set: noop}) -//=> true -``` - -`false` when the object has invalid properties - -```js -isAccessor({get: noop, set: noop, bar: 'baz'}) -isAccessor({get: noop, writable: true}) -isAccessor({get: noop, value: true}) -//=> false -``` - -`false` when an accessor is not a function - -```js -isAccessor({get: noop, set: 'baz'}) -isAccessor({get: 'foo', set: noop}) -isAccessor({get: 'foo', bar: 'baz'}) -isAccessor({get: 'foo', set: 'baz'}) -//=> false -``` - -`false` when a value is not the correct type - -```js -isAccessor({get: noop, set: noop, enumerable: 'foo'}) -isAccessor({set: noop, configurable: 'foo'}) -isAccessor({get: noop, configurable: 'foo'}) -//=> false -``` - -## Related projects - -* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor) -* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor) -* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://www.npmjs.com/package/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor) -* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject) - -## Running tests - -Install dev dependencies: - -```sh -$ npm i -d && npm test -``` - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-accessor-descriptor/issues/new). - -## Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert) -Released under the MIT license. - -*** - -_This file was generated by [verb](https://github.com/verbose/verb) on December 28, 2015._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/index.js b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/index.js deleted file mode 100644 index 2ca4af8bd..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/index.js +++ /dev/null @@ -1,69 +0,0 @@ -/*! - * is-accessor-descriptor - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var typeOf = require('kind-of'); - -// accessor descriptor properties -var accessor = { - get: 'function', - set: 'function', - configurable: 'boolean', - enumerable: 'boolean' -}; - -function isAccessorDescriptor(obj, prop) { - if (typeof prop === 'string') { - var val = Object.getOwnPropertyDescriptor(obj, prop); - return typeof val !== 'undefined'; - } - - if (typeOf(obj) !== 'object') { - return false; - } - - if (has(obj, 'value') || has(obj, 'writable')) { - return false; - } - - if (!has(obj, 'get') || typeof obj.get !== 'function') { - return false; - } - - // tldr: it's valid to have "set" be undefined - // "set" might be undefined if `Object.getOwnPropertyDescriptor` - // was used to get the value, and only `get` was defined by the user - if (has(obj, 'set') && typeof obj[key] !== 'function' && typeof obj[key] !== 'undefined') { - return false; - } - - for (var key in obj) { - if (!accessor.hasOwnProperty(key)) { - continue; - } - - if (typeOf(obj[key]) === accessor[key]) { - continue; - } - - if (typeof obj[key] !== 'undefined') { - return false; - } - } - return true; -} - -function has(obj, key) { - return {}.hasOwnProperty.call(obj, key); -} - -/** - * Expose `isAccessorDescriptor` - */ - -module.exports = isAccessorDescriptor; diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/LICENSE b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/LICENSE deleted file mode 100644 index d734237bd..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/README.md b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/README.md deleted file mode 100644 index 6a9df36d3..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/README.md +++ /dev/null @@ -1,261 +0,0 @@ -# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) - -> Get the native type of a value. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save kind-of -``` - -## Install - -Install with [bower](https://bower.io/) - -```sh -$ bower install kind-of --save -``` - -## Usage - -> es5, browser and es6 ready - -```js -var kindOf = require('kind-of'); - -kindOf(undefined); -//=> 'undefined' - -kindOf(null); -//=> 'null' - -kindOf(true); -//=> 'boolean' - -kindOf(false); -//=> 'boolean' - -kindOf(new Boolean(true)); -//=> 'boolean' - -kindOf(new Buffer('')); -//=> 'buffer' - -kindOf(42); -//=> 'number' - -kindOf(new Number(42)); -//=> 'number' - -kindOf('str'); -//=> 'string' - -kindOf(new String('str')); -//=> 'string' - -kindOf(arguments); -//=> 'arguments' - -kindOf({}); -//=> 'object' - -kindOf(Object.create(null)); -//=> 'object' - -kindOf(new Test()); -//=> 'object' - -kindOf(new Date()); -//=> 'date' - -kindOf([]); -//=> 'array' - -kindOf([1, 2, 3]); -//=> 'array' - -kindOf(new Array()); -//=> 'array' - -kindOf(/foo/); -//=> 'regexp' - -kindOf(new RegExp('foo')); -//=> 'regexp' - -kindOf(function () {}); -//=> 'function' - -kindOf(function * () {}); -//=> 'function' - -kindOf(new Function()); -//=> 'function' - -kindOf(new Map()); -//=> 'map' - -kindOf(new WeakMap()); -//=> 'weakmap' - -kindOf(new Set()); -//=> 'set' - -kindOf(new WeakSet()); -//=> 'weakset' - -kindOf(Symbol('str')); -//=> 'symbol' - -kindOf(new Int8Array()); -//=> 'int8array' - -kindOf(new Uint8Array()); -//=> 'uint8array' - -kindOf(new Uint8ClampedArray()); -//=> 'uint8clampedarray' - -kindOf(new Int16Array()); -//=> 'int16array' - -kindOf(new Uint16Array()); -//=> 'uint16array' - -kindOf(new Int32Array()); -//=> 'int32array' - -kindOf(new Uint32Array()); -//=> 'uint32array' - -kindOf(new Float32Array()); -//=> 'float32array' - -kindOf(new Float64Array()); -//=> 'float64array' -``` - -## Benchmarks - -Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). -Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `WeakSet`. - -```bash -#1: array - current x 23,329,397 ops/sec ±0.82% (94 runs sampled) - lib-type-of x 4,170,273 ops/sec ±0.55% (94 runs sampled) - lib-typeof x 9,686,935 ops/sec ±0.59% (98 runs sampled) - -#2: boolean - current x 27,197,115 ops/sec ±0.85% (94 runs sampled) - lib-type-of x 3,145,791 ops/sec ±0.73% (97 runs sampled) - lib-typeof x 9,199,562 ops/sec ±0.44% (99 runs sampled) - -#3: date - current x 20,190,117 ops/sec ±0.86% (92 runs sampled) - lib-type-of x 5,166,970 ops/sec ±0.74% (94 runs sampled) - lib-typeof x 9,610,821 ops/sec ±0.50% (96 runs sampled) - -#4: function - current x 23,855,460 ops/sec ±0.60% (97 runs sampled) - lib-type-of x 5,667,740 ops/sec ±0.54% (100 runs sampled) - lib-typeof x 10,010,644 ops/sec ±0.44% (100 runs sampled) - -#5: null - current x 27,061,047 ops/sec ±0.97% (96 runs sampled) - lib-type-of x 13,965,573 ops/sec ±0.62% (97 runs sampled) - lib-typeof x 8,460,194 ops/sec ±0.61% (97 runs sampled) - -#6: number - current x 25,075,682 ops/sec ±0.53% (99 runs sampled) - lib-type-of x 2,266,405 ops/sec ±0.41% (98 runs sampled) - lib-typeof x 9,821,481 ops/sec ±0.45% (99 runs sampled) - -#7: object - current x 3,348,980 ops/sec ±0.49% (99 runs sampled) - lib-type-of x 3,245,138 ops/sec ±0.60% (94 runs sampled) - lib-typeof x 9,262,952 ops/sec ±0.59% (99 runs sampled) - -#8: regex - current x 21,284,827 ops/sec ±0.72% (96 runs sampled) - lib-type-of x 4,689,241 ops/sec ±0.43% (100 runs sampled) - lib-typeof x 8,957,593 ops/sec ±0.62% (98 runs sampled) - -#9: string - current x 25,379,234 ops/sec ±0.58% (96 runs sampled) - lib-type-of x 3,635,148 ops/sec ±0.76% (93 runs sampled) - lib-typeof x 9,494,134 ops/sec ±0.49% (98 runs sampled) - -#10: undef - current x 27,459,221 ops/sec ±1.01% (93 runs sampled) - lib-type-of x 14,360,433 ops/sec ±0.52% (99 runs sampled) - lib-typeof x 23,202,868 ops/sec ±0.59% (94 runs sampled) - -``` - -## Optimizations - -In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: - -1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. -2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. -3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` - -## About - -### Related projects - -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") -* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") -* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 59 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [miguelmota](https://github.com/miguelmota) | -| 1 | [dtothefp](https://github.com/dtothefp) | -| 1 | [ksheedlo](https://github.com/ksheedlo) | -| 1 | [pdehaan](https://github.com/pdehaan) | -| 1 | [laggingreflex](https://github.com/laggingreflex) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 16, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/index.js b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/index.js deleted file mode 100644 index b52c2917f..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/index.js +++ /dev/null @@ -1,116 +0,0 @@ -var isBuffer = require('is-buffer'); -var toString = Object.prototype.toString; - -/** - * Get the native `typeof` a value. - * - * @param {*} `val` - * @return {*} Native javascript type - */ - -module.exports = function kindOf(val) { - // primitivies - if (typeof val === 'undefined') { - return 'undefined'; - } - if (val === null) { - return 'null'; - } - if (val === true || val === false || val instanceof Boolean) { - return 'boolean'; - } - if (typeof val === 'string' || val instanceof String) { - return 'string'; - } - if (typeof val === 'number' || val instanceof Number) { - return 'number'; - } - - // functions - if (typeof val === 'function' || val instanceof Function) { - return 'function'; - } - - // array - if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { - return 'array'; - } - - // check for instances of RegExp and Date before calling `toString` - if (val instanceof RegExp) { - return 'regexp'; - } - if (val instanceof Date) { - return 'date'; - } - - // other objects - var type = toString.call(val); - - if (type === '[object RegExp]') { - return 'regexp'; - } - if (type === '[object Date]') { - return 'date'; - } - if (type === '[object Arguments]') { - return 'arguments'; - } - if (type === '[object Error]') { - return 'error'; - } - - // buffer - if (isBuffer(val)) { - return 'buffer'; - } - - // es6: Map, WeakMap, Set, WeakSet - if (type === '[object Set]') { - return 'set'; - } - if (type === '[object WeakSet]') { - return 'weakset'; - } - if (type === '[object Map]') { - return 'map'; - } - if (type === '[object WeakMap]') { - return 'weakmap'; - } - if (type === '[object Symbol]') { - return 'symbol'; - } - - // typed arrays - if (type === '[object Int8Array]') { - return 'int8array'; - } - if (type === '[object Uint8Array]') { - return 'uint8array'; - } - if (type === '[object Uint8ClampedArray]') { - return 'uint8clampedarray'; - } - if (type === '[object Int16Array]') { - return 'int16array'; - } - if (type === '[object Uint16Array]') { - return 'uint16array'; - } - if (type === '[object Int32Array]') { - return 'int32array'; - } - if (type === '[object Uint32Array]') { - return 'uint32array'; - } - if (type === '[object Float32Array]') { - return 'float32array'; - } - if (type === '[object Float64Array]') { - return 'float64array'; - } - - // must be a plain object - return 'object'; -}; diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/package.json b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/package.json deleted file mode 100644 index 5a2dad55f..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of/package.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "_from": "kind-of@^3.0.2", - "_id": "kind-of@3.2.2", - "_inBundle": false, - "_integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "_location": "/readdirp/expand-brackets/is-accessor-descriptor/kind-of", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "kind-of@^3.0.2", - "name": "kind-of", - "escapedName": "kind-of", - "rawSpec": "^3.0.2", - "saveSpec": null, - "fetchSpec": "^3.0.2" - }, - "_requiredBy": [ - "/readdirp/expand-brackets/is-accessor-descriptor" - ], - "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "_shasum": "31ea21a734bab9bbb0f32466d893aea51e4a3c64", - "_spec": "kind-of@^3.0.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/kind-of/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "David Fox-Powell", - "url": "https://dtothefp.github.io/me" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Ken Sheedlo", - "url": "kensheedlo.com" - }, - { - "name": "laggingreflex", - "url": "https://github.com/laggingreflex" - }, - { - "name": "Miguel Mota", - "url": "https://miguelmota.com" - }, - { - "name": "Peter deHaan", - "url": "http://about.me/peterdehaan" - } - ], - "dependencies": { - "is-buffer": "^1.1.5" - }, - "deprecated": false, - "description": "Get the native type of a value.", - "devDependencies": { - "ansi-bold": "^0.1.1", - "benchmarked": "^1.0.0", - "browserify": "^14.3.0", - "glob": "^7.1.1", - "gulp-format-md": "^0.1.12", - "mocha": "^3.3.0", - "type-of": "^2.0.1", - "typeof": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/kind-of", - "keywords": [ - "arguments", - "array", - "boolean", - "check", - "date", - "function", - "is", - "is-type", - "is-type-of", - "kind", - "kind-of", - "number", - "object", - "of", - "regexp", - "string", - "test", - "type", - "type-of", - "typeof", - "types" - ], - "license": "MIT", - "main": "index.js", - "name": "kind-of", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/kind-of.git" - }, - "scripts": { - "prepublish": "browserify -o browser.js -e index.js -s index --bare", - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "is-glob", - "is-number", - "is-primitive" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "verb" - ] - }, - "version": "3.2.2" -} diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/package.json b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/package.json deleted file mode 100644 index 081de213c..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/package.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "_from": "is-accessor-descriptor@^0.1.6", - "_id": "is-accessor-descriptor@0.1.6", - "_inBundle": false, - "_integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "_location": "/readdirp/expand-brackets/is-accessor-descriptor", - "_phantomChildren": { - "is-buffer": "1.1.6" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-accessor-descriptor@^0.1.6", - "name": "is-accessor-descriptor", - "escapedName": "is-accessor-descriptor", - "rawSpec": "^0.1.6", - "saveSpec": null, - "fetchSpec": "^0.1.6" - }, - "_requiredBy": [ - "/readdirp/expand-brackets/is-descriptor" - ], - "_resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "_shasum": "a9e12cb3ae8d876727eeef3843f8a0897b5c98d6", - "_spec": "is-accessor-descriptor@^0.1.6", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-accessor-descriptor/issues" - }, - "bundleDependencies": false, - "dependencies": { - "kind-of": "^3.0.2" - }, - "deprecated": false, - "description": "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.", - "devDependencies": { - "mocha": "*", - "should": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-accessor-descriptor", - "keywords": [ - "accessor", - "check", - "data", - "descriptor", - "get", - "getter", - "is", - "keys", - "object", - "properties", - "property", - "set", - "setter", - "type", - "valid", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "is-accessor-descriptor", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-accessor-descriptor.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "is-accessor-descriptor", - "is-data-descriptor", - "is-descriptor", - "isobject" - ] - }, - "plugins": [ - "gulp-format-md" - ], - "layout": "default" - }, - "version": "0.1.6" -} diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/LICENSE b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/LICENSE deleted file mode 100644 index 65f90aca8..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/README.md b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/README.md deleted file mode 100644 index 41e1643f1..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/README.md +++ /dev/null @@ -1,128 +0,0 @@ -# is-data-descriptor [![NPM version](https://img.shields.io/npm/v/is-data-descriptor.svg)](https://www.npmjs.com/package/is-data-descriptor) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-data-descriptor.svg)](https://travis-ci.org/jonschlinkert/is-data-descriptor) - -> Returns true if a value has the characteristics of a valid JavaScript data descriptor. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm i is-data-descriptor --save -``` - -## Usage - -```js -var isDataDesc = require('is-data-descriptor'); -``` - -## Examples - -`true` when the descriptor has valid properties with valid values. - -```js -// `value` can be anything -isDataDesc({value: 'foo'}) -isDataDesc({value: function() {}}) -isDataDesc({value: true}) -//=> true -``` - -`false` when not an object - -```js -isDataDesc('a') -//=> false -isDataDesc(null) -//=> false -isDataDesc([]) -//=> false -``` - -`false` when the object has invalid properties - -```js -isDataDesc({value: 'foo', bar: 'baz'}) -//=> false -isDataDesc({value: 'foo', bar: 'baz'}) -//=> false -isDataDesc({value: 'foo', get: function(){}}) -//=> false -isDataDesc({get: function(){}, value: 'foo'}) -//=> false -``` - -`false` when a value is not the correct type - -```js -isDataDesc({value: 'foo', enumerable: 'foo'}) -//=> false -isDataDesc({value: 'foo', configurable: 'foo'}) -//=> false -isDataDesc({value: 'foo', writable: 'foo'}) -//=> false -``` - -## Valid properties - -The only valid data descriptor properties are the following: - -* `configurable` (required) -* `enumerable` (required) -* `value` (optional) -* `writable` (optional) - -To be a valid data descriptor, either `value` or `writable` must be defined. - -**Invalid properties** - -A descriptor may have additional _invalid_ properties (an error will **not** be thrown). - -```js -var foo = {}; - -Object.defineProperty(foo, 'bar', { - enumerable: true, - whatever: 'blah', // invalid, but doesn't cause an error - get: function() { - return 'baz'; - } -}); - -console.log(foo.bar); -//=> 'baz' -``` - -## Related projects - -* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor) -* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://www.npmjs.com/package/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor) -* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject) - -## Running tests - -Install dev dependencies: - -```sh -$ npm i -d && npm test -``` - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-data-descriptor/issues/new). - -## Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert) -Released under the MIT license. - -*** - -_This file was generated by [verb](https://github.com/verbose/verb) on December 28, 2015._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/index.js b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/index.js deleted file mode 100644 index d4d09c92a..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/index.js +++ /dev/null @@ -1,55 +0,0 @@ -/*! - * is-data-descriptor - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var typeOf = require('kind-of'); - -// data descriptor properties -var data = { - configurable: 'boolean', - enumerable: 'boolean', - writable: 'boolean' -}; - -function isDataDescriptor(obj, prop) { - if (typeOf(obj) !== 'object') { - return false; - } - - if (typeof prop === 'string') { - var val = Object.getOwnPropertyDescriptor(obj, prop); - return typeof val !== 'undefined'; - } - - if (!('value' in obj) && !('writable' in obj)) { - return false; - } - - for (var key in obj) { - if (key === 'value') continue; - - if (!data.hasOwnProperty(key)) { - continue; - } - - if (typeOf(obj[key]) === data[key]) { - continue; - } - - if (typeof obj[key] !== 'undefined') { - return false; - } - } - return true; -} - -/** - * Expose `isDataDescriptor` - */ - -module.exports = isDataDescriptor; diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/LICENSE b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/LICENSE deleted file mode 100644 index d734237bd..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/README.md b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/README.md deleted file mode 100644 index 6a9df36d3..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/README.md +++ /dev/null @@ -1,261 +0,0 @@ -# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) - -> Get the native type of a value. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save kind-of -``` - -## Install - -Install with [bower](https://bower.io/) - -```sh -$ bower install kind-of --save -``` - -## Usage - -> es5, browser and es6 ready - -```js -var kindOf = require('kind-of'); - -kindOf(undefined); -//=> 'undefined' - -kindOf(null); -//=> 'null' - -kindOf(true); -//=> 'boolean' - -kindOf(false); -//=> 'boolean' - -kindOf(new Boolean(true)); -//=> 'boolean' - -kindOf(new Buffer('')); -//=> 'buffer' - -kindOf(42); -//=> 'number' - -kindOf(new Number(42)); -//=> 'number' - -kindOf('str'); -//=> 'string' - -kindOf(new String('str')); -//=> 'string' - -kindOf(arguments); -//=> 'arguments' - -kindOf({}); -//=> 'object' - -kindOf(Object.create(null)); -//=> 'object' - -kindOf(new Test()); -//=> 'object' - -kindOf(new Date()); -//=> 'date' - -kindOf([]); -//=> 'array' - -kindOf([1, 2, 3]); -//=> 'array' - -kindOf(new Array()); -//=> 'array' - -kindOf(/foo/); -//=> 'regexp' - -kindOf(new RegExp('foo')); -//=> 'regexp' - -kindOf(function () {}); -//=> 'function' - -kindOf(function * () {}); -//=> 'function' - -kindOf(new Function()); -//=> 'function' - -kindOf(new Map()); -//=> 'map' - -kindOf(new WeakMap()); -//=> 'weakmap' - -kindOf(new Set()); -//=> 'set' - -kindOf(new WeakSet()); -//=> 'weakset' - -kindOf(Symbol('str')); -//=> 'symbol' - -kindOf(new Int8Array()); -//=> 'int8array' - -kindOf(new Uint8Array()); -//=> 'uint8array' - -kindOf(new Uint8ClampedArray()); -//=> 'uint8clampedarray' - -kindOf(new Int16Array()); -//=> 'int16array' - -kindOf(new Uint16Array()); -//=> 'uint16array' - -kindOf(new Int32Array()); -//=> 'int32array' - -kindOf(new Uint32Array()); -//=> 'uint32array' - -kindOf(new Float32Array()); -//=> 'float32array' - -kindOf(new Float64Array()); -//=> 'float64array' -``` - -## Benchmarks - -Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). -Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `WeakSet`. - -```bash -#1: array - current x 23,329,397 ops/sec ±0.82% (94 runs sampled) - lib-type-of x 4,170,273 ops/sec ±0.55% (94 runs sampled) - lib-typeof x 9,686,935 ops/sec ±0.59% (98 runs sampled) - -#2: boolean - current x 27,197,115 ops/sec ±0.85% (94 runs sampled) - lib-type-of x 3,145,791 ops/sec ±0.73% (97 runs sampled) - lib-typeof x 9,199,562 ops/sec ±0.44% (99 runs sampled) - -#3: date - current x 20,190,117 ops/sec ±0.86% (92 runs sampled) - lib-type-of x 5,166,970 ops/sec ±0.74% (94 runs sampled) - lib-typeof x 9,610,821 ops/sec ±0.50% (96 runs sampled) - -#4: function - current x 23,855,460 ops/sec ±0.60% (97 runs sampled) - lib-type-of x 5,667,740 ops/sec ±0.54% (100 runs sampled) - lib-typeof x 10,010,644 ops/sec ±0.44% (100 runs sampled) - -#5: null - current x 27,061,047 ops/sec ±0.97% (96 runs sampled) - lib-type-of x 13,965,573 ops/sec ±0.62% (97 runs sampled) - lib-typeof x 8,460,194 ops/sec ±0.61% (97 runs sampled) - -#6: number - current x 25,075,682 ops/sec ±0.53% (99 runs sampled) - lib-type-of x 2,266,405 ops/sec ±0.41% (98 runs sampled) - lib-typeof x 9,821,481 ops/sec ±0.45% (99 runs sampled) - -#7: object - current x 3,348,980 ops/sec ±0.49% (99 runs sampled) - lib-type-of x 3,245,138 ops/sec ±0.60% (94 runs sampled) - lib-typeof x 9,262,952 ops/sec ±0.59% (99 runs sampled) - -#8: regex - current x 21,284,827 ops/sec ±0.72% (96 runs sampled) - lib-type-of x 4,689,241 ops/sec ±0.43% (100 runs sampled) - lib-typeof x 8,957,593 ops/sec ±0.62% (98 runs sampled) - -#9: string - current x 25,379,234 ops/sec ±0.58% (96 runs sampled) - lib-type-of x 3,635,148 ops/sec ±0.76% (93 runs sampled) - lib-typeof x 9,494,134 ops/sec ±0.49% (98 runs sampled) - -#10: undef - current x 27,459,221 ops/sec ±1.01% (93 runs sampled) - lib-type-of x 14,360,433 ops/sec ±0.52% (99 runs sampled) - lib-typeof x 23,202,868 ops/sec ±0.59% (94 runs sampled) - -``` - -## Optimizations - -In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: - -1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. -2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. -3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` - -## About - -### Related projects - -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") -* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") -* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 59 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [miguelmota](https://github.com/miguelmota) | -| 1 | [dtothefp](https://github.com/dtothefp) | -| 1 | [ksheedlo](https://github.com/ksheedlo) | -| 1 | [pdehaan](https://github.com/pdehaan) | -| 1 | [laggingreflex](https://github.com/laggingreflex) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 16, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/index.js b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/index.js deleted file mode 100644 index b52c2917f..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/index.js +++ /dev/null @@ -1,116 +0,0 @@ -var isBuffer = require('is-buffer'); -var toString = Object.prototype.toString; - -/** - * Get the native `typeof` a value. - * - * @param {*} `val` - * @return {*} Native javascript type - */ - -module.exports = function kindOf(val) { - // primitivies - if (typeof val === 'undefined') { - return 'undefined'; - } - if (val === null) { - return 'null'; - } - if (val === true || val === false || val instanceof Boolean) { - return 'boolean'; - } - if (typeof val === 'string' || val instanceof String) { - return 'string'; - } - if (typeof val === 'number' || val instanceof Number) { - return 'number'; - } - - // functions - if (typeof val === 'function' || val instanceof Function) { - return 'function'; - } - - // array - if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { - return 'array'; - } - - // check for instances of RegExp and Date before calling `toString` - if (val instanceof RegExp) { - return 'regexp'; - } - if (val instanceof Date) { - return 'date'; - } - - // other objects - var type = toString.call(val); - - if (type === '[object RegExp]') { - return 'regexp'; - } - if (type === '[object Date]') { - return 'date'; - } - if (type === '[object Arguments]') { - return 'arguments'; - } - if (type === '[object Error]') { - return 'error'; - } - - // buffer - if (isBuffer(val)) { - return 'buffer'; - } - - // es6: Map, WeakMap, Set, WeakSet - if (type === '[object Set]') { - return 'set'; - } - if (type === '[object WeakSet]') { - return 'weakset'; - } - if (type === '[object Map]') { - return 'map'; - } - if (type === '[object WeakMap]') { - return 'weakmap'; - } - if (type === '[object Symbol]') { - return 'symbol'; - } - - // typed arrays - if (type === '[object Int8Array]') { - return 'int8array'; - } - if (type === '[object Uint8Array]') { - return 'uint8array'; - } - if (type === '[object Uint8ClampedArray]') { - return 'uint8clampedarray'; - } - if (type === '[object Int16Array]') { - return 'int16array'; - } - if (type === '[object Uint16Array]') { - return 'uint16array'; - } - if (type === '[object Int32Array]') { - return 'int32array'; - } - if (type === '[object Uint32Array]') { - return 'uint32array'; - } - if (type === '[object Float32Array]') { - return 'float32array'; - } - if (type === '[object Float64Array]') { - return 'float64array'; - } - - // must be a plain object - return 'object'; -}; diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/package.json b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/package.json deleted file mode 100644 index 629822e91..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of/package.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "_from": "kind-of@^3.0.2", - "_id": "kind-of@3.2.2", - "_inBundle": false, - "_integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "_location": "/readdirp/expand-brackets/is-data-descriptor/kind-of", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "kind-of@^3.0.2", - "name": "kind-of", - "escapedName": "kind-of", - "rawSpec": "^3.0.2", - "saveSpec": null, - "fetchSpec": "^3.0.2" - }, - "_requiredBy": [ - "/readdirp/expand-brackets/is-data-descriptor" - ], - "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "_shasum": "31ea21a734bab9bbb0f32466d893aea51e4a3c64", - "_spec": "kind-of@^3.0.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/kind-of/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "David Fox-Powell", - "url": "https://dtothefp.github.io/me" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Ken Sheedlo", - "url": "kensheedlo.com" - }, - { - "name": "laggingreflex", - "url": "https://github.com/laggingreflex" - }, - { - "name": "Miguel Mota", - "url": "https://miguelmota.com" - }, - { - "name": "Peter deHaan", - "url": "http://about.me/peterdehaan" - } - ], - "dependencies": { - "is-buffer": "^1.1.5" - }, - "deprecated": false, - "description": "Get the native type of a value.", - "devDependencies": { - "ansi-bold": "^0.1.1", - "benchmarked": "^1.0.0", - "browserify": "^14.3.0", - "glob": "^7.1.1", - "gulp-format-md": "^0.1.12", - "mocha": "^3.3.0", - "type-of": "^2.0.1", - "typeof": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/kind-of", - "keywords": [ - "arguments", - "array", - "boolean", - "check", - "date", - "function", - "is", - "is-type", - "is-type-of", - "kind", - "kind-of", - "number", - "object", - "of", - "regexp", - "string", - "test", - "type", - "type-of", - "typeof", - "types" - ], - "license": "MIT", - "main": "index.js", - "name": "kind-of", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/kind-of.git" - }, - "scripts": { - "prepublish": "browserify -o browser.js -e index.js -s index --bare", - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "is-glob", - "is-number", - "is-primitive" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "verb" - ] - }, - "version": "3.2.2" -} diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/package.json b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/package.json deleted file mode 100644 index 30fcaa6b2..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/package.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "_from": "is-data-descriptor@^0.1.4", - "_id": "is-data-descriptor@0.1.4", - "_inBundle": false, - "_integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "_location": "/readdirp/expand-brackets/is-data-descriptor", - "_phantomChildren": { - "is-buffer": "1.1.6" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-data-descriptor@^0.1.4", - "name": "is-data-descriptor", - "escapedName": "is-data-descriptor", - "rawSpec": "^0.1.4", - "saveSpec": null, - "fetchSpec": "^0.1.4" - }, - "_requiredBy": [ - "/readdirp/expand-brackets/is-descriptor" - ], - "_resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "_shasum": "0b5ee648388e2c860282e793f1856fec3f301b56", - "_spec": "is-data-descriptor@^0.1.4", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-data-descriptor/issues" - }, - "bundleDependencies": false, - "dependencies": { - "kind-of": "^3.0.2" - }, - "deprecated": false, - "description": "Returns true if a value has the characteristics of a valid JavaScript data descriptor.", - "devDependencies": { - "mocha": "*", - "should": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-data-descriptor", - "keywords": [ - "accessor", - "check", - "data", - "descriptor", - "get", - "getter", - "is", - "keys", - "object", - "properties", - "property", - "set", - "setter", - "type", - "valid", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "is-data-descriptor", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-data-descriptor.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "is-accessor-descriptor", - "is-data-descriptor", - "is-descriptor", - "isobject" - ] - }, - "plugins": [ - "gulp-format-md" - ] - }, - "version": "0.1.4" -} diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/LICENSE b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/LICENSE deleted file mode 100644 index c0d7f1362..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2017, Jon Schlinkert. - -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. \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/README.md b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/README.md deleted file mode 100644 index 658e53301..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/README.md +++ /dev/null @@ -1,193 +0,0 @@ -# is-descriptor [![NPM version](https://img.shields.io/npm/v/is-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-descriptor) - -> Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save is-descriptor -``` - -## Usage - -```js -var isDescriptor = require('is-descriptor'); - -isDescriptor({value: 'foo'}) -//=> true -isDescriptor({get: function(){}, set: function(){}}) -//=> true -isDescriptor({get: 'foo', set: function(){}}) -//=> false -``` - -You may also check for a descriptor by passing an object as the first argument and property name (`string`) as the second argument. - -```js -var obj = {}; -obj.foo = 'abc'; - -Object.defineProperty(obj, 'bar', { - value: 'xyz' -}); - -isDescriptor(obj, 'foo'); -//=> true -isDescriptor(obj, 'bar'); -//=> true -``` - -## Examples - -### value type - -`false` when not an object - -```js -isDescriptor('a'); -//=> false -isDescriptor(null); -//=> false -isDescriptor([]); -//=> false -``` - -### data descriptor - -`true` when the object has valid properties with valid values. - -```js -isDescriptor({value: 'foo'}); -//=> true -isDescriptor({value: noop}); -//=> true -``` - -`false` when the object has invalid properties - -```js -isDescriptor({value: 'foo', bar: 'baz'}); -//=> false -isDescriptor({value: 'foo', bar: 'baz'}); -//=> false -isDescriptor({value: 'foo', get: noop}); -//=> false -isDescriptor({get: noop, value: noop}); -//=> false -``` - -`false` when a value is not the correct type - -```js -isDescriptor({value: 'foo', enumerable: 'foo'}); -//=> false -isDescriptor({value: 'foo', configurable: 'foo'}); -//=> false -isDescriptor({value: 'foo', writable: 'foo'}); -//=> false -``` - -### accessor descriptor - -`true` when the object has valid properties with valid values. - -```js -isDescriptor({get: noop, set: noop}); -//=> true -isDescriptor({get: noop}); -//=> true -isDescriptor({set: noop}); -//=> true -``` - -`false` when the object has invalid properties - -```js -isDescriptor({get: noop, set: noop, bar: 'baz'}); -//=> false -isDescriptor({get: noop, writable: true}); -//=> false -isDescriptor({get: noop, value: true}); -//=> false -``` - -`false` when an accessor is not a function - -```js -isDescriptor({get: noop, set: 'baz'}); -//=> false -isDescriptor({get: 'foo', set: noop}); -//=> false -isDescriptor({get: 'foo', bar: 'baz'}); -//=> false -isDescriptor({get: 'foo', set: 'baz'}); -//=> false -``` - -`false` when a value is not the correct type - -```js -isDescriptor({get: noop, set: noop, enumerable: 'foo'}); -//=> false -isDescriptor({set: noop, configurable: 'foo'}); -//=> false -isDescriptor({get: noop, configurable: 'foo'}); -//=> false -``` - -## About - -### Related projects - -* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.") -* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.") -* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.") -* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 24 | [jonschlinkert](https://github.com/jonschlinkert) | -| 1 | [doowb](https://github.com/doowb) | -| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 22, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/index.js b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/index.js deleted file mode 100644 index c9b91d762..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/index.js +++ /dev/null @@ -1,22 +0,0 @@ -/*! - * is-descriptor - * - * Copyright (c) 2015-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var typeOf = require('kind-of'); -var isAccessor = require('is-accessor-descriptor'); -var isData = require('is-data-descriptor'); - -module.exports = function isDescriptor(obj, key) { - if (typeOf(obj) !== 'object') { - return false; - } - if ('get' in obj) { - return isAccessor(obj, key); - } - return isData(obj, key); -}; diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/package.json b/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/package.json deleted file mode 100644 index 4c90fd896..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor/package.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "_from": "is-descriptor@^0.1.0", - "_id": "is-descriptor@0.1.6", - "_inBundle": false, - "_integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "_location": "/readdirp/expand-brackets/is-descriptor", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-descriptor@^0.1.0", - "name": "is-descriptor", - "escapedName": "is-descriptor", - "rawSpec": "^0.1.0", - "saveSpec": null, - "fetchSpec": "^0.1.0" - }, - "_requiredBy": [ - "/readdirp/expand-brackets/define-property" - ], - "_resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "_shasum": "366d8240dde487ca51823b1ab9f07a10a78251ca", - "_spec": "is-descriptor@^0.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-descriptor/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Brian Woodward", - "url": "https://twitter.com/doowb" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "url": "https://github.com/wtgtybhertgeghgtwtg" - } - ], - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "deprecated": false, - "description": "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.", - "devDependencies": { - "gulp-format-md": "^1.0.0", - "mocha": "^3.4.2" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-descriptor", - "keywords": [ - "accessor", - "check", - "data", - "descriptor", - "get", - "getter", - "is", - "keys", - "object", - "properties", - "property", - "set", - "setter", - "type", - "valid", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "is-descriptor", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-descriptor.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "is-accessor-descriptor", - "is-data-descriptor", - "is-descriptor", - "isobject" - ] - }, - "plugins": [ - "gulp-format-md" - ], - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "lint": { - "reflinks": true - } - }, - "version": "0.1.6" -} diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/LICENSE b/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/LICENSE deleted file mode 100644 index 3f2eca18f..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/README.md b/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/README.md deleted file mode 100644 index 170bf3049..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/README.md +++ /dev/null @@ -1,342 +0,0 @@ -# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) - -> Get the native type of a value. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save kind-of -``` - -Install with [bower](https://bower.io/) - -```sh -$ bower install kind-of --save -``` - -## Why use this? - -1. [it's fast](#benchmarks) | [optimizations](#optimizations) -2. [better type checking](#better-type-checking) - -## Usage - -> es5, browser and es6 ready - -```js -var kindOf = require('kind-of'); - -kindOf(undefined); -//=> 'undefined' - -kindOf(null); -//=> 'null' - -kindOf(true); -//=> 'boolean' - -kindOf(false); -//=> 'boolean' - -kindOf(new Boolean(true)); -//=> 'boolean' - -kindOf(new Buffer('')); -//=> 'buffer' - -kindOf(42); -//=> 'number' - -kindOf(new Number(42)); -//=> 'number' - -kindOf('str'); -//=> 'string' - -kindOf(new String('str')); -//=> 'string' - -kindOf(arguments); -//=> 'arguments' - -kindOf({}); -//=> 'object' - -kindOf(Object.create(null)); -//=> 'object' - -kindOf(new Test()); -//=> 'object' - -kindOf(new Date()); -//=> 'date' - -kindOf([]); -//=> 'array' - -kindOf([1, 2, 3]); -//=> 'array' - -kindOf(new Array()); -//=> 'array' - -kindOf(/foo/); -//=> 'regexp' - -kindOf(new RegExp('foo')); -//=> 'regexp' - -kindOf(function () {}); -//=> 'function' - -kindOf(function * () {}); -//=> 'function' - -kindOf(new Function()); -//=> 'function' - -kindOf(new Map()); -//=> 'map' - -kindOf(new WeakMap()); -//=> 'weakmap' - -kindOf(new Set()); -//=> 'set' - -kindOf(new WeakSet()); -//=> 'weakset' - -kindOf(Symbol('str')); -//=> 'symbol' - -kindOf(new Int8Array()); -//=> 'int8array' - -kindOf(new Uint8Array()); -//=> 'uint8array' - -kindOf(new Uint8ClampedArray()); -//=> 'uint8clampedarray' - -kindOf(new Int16Array()); -//=> 'int16array' - -kindOf(new Uint16Array()); -//=> 'uint16array' - -kindOf(new Int32Array()); -//=> 'int32array' - -kindOf(new Uint32Array()); -//=> 'uint32array' - -kindOf(new Float32Array()); -//=> 'float32array' - -kindOf(new Float64Array()); -//=> 'float64array' -``` - -## Release history - -### v4.0.0 - -**Added** - -* `promise` support - -### v5.0.0 - -**Added** - -* `Set Iterator` and `Map Iterator` support - -**Fixed** - -* Now returns `generatorfunction` for generator functions - -## Benchmarks - -Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). -Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `WeakSet`. - -```bash -#1: array - current x 23,329,397 ops/sec ±0.82% (94 runs sampled) - lib-type-of x 4,170,273 ops/sec ±0.55% (94 runs sampled) - lib-typeof x 9,686,935 ops/sec ±0.59% (98 runs sampled) - -#2: boolean - current x 27,197,115 ops/sec ±0.85% (94 runs sampled) - lib-type-of x 3,145,791 ops/sec ±0.73% (97 runs sampled) - lib-typeof x 9,199,562 ops/sec ±0.44% (99 runs sampled) - -#3: date - current x 20,190,117 ops/sec ±0.86% (92 runs sampled) - lib-type-of x 5,166,970 ops/sec ±0.74% (94 runs sampled) - lib-typeof x 9,610,821 ops/sec ±0.50% (96 runs sampled) - -#4: function - current x 23,855,460 ops/sec ±0.60% (97 runs sampled) - lib-type-of x 5,667,740 ops/sec ±0.54% (100 runs sampled) - lib-typeof x 10,010,644 ops/sec ±0.44% (100 runs sampled) - -#5: null - current x 27,061,047 ops/sec ±0.97% (96 runs sampled) - lib-type-of x 13,965,573 ops/sec ±0.62% (97 runs sampled) - lib-typeof x 8,460,194 ops/sec ±0.61% (97 runs sampled) - -#6: number - current x 25,075,682 ops/sec ±0.53% (99 runs sampled) - lib-type-of x 2,266,405 ops/sec ±0.41% (98 runs sampled) - lib-typeof x 9,821,481 ops/sec ±0.45% (99 runs sampled) - -#7: object - current x 3,348,980 ops/sec ±0.49% (99 runs sampled) - lib-type-of x 3,245,138 ops/sec ±0.60% (94 runs sampled) - lib-typeof x 9,262,952 ops/sec ±0.59% (99 runs sampled) - -#8: regex - current x 21,284,827 ops/sec ±0.72% (96 runs sampled) - lib-type-of x 4,689,241 ops/sec ±0.43% (100 runs sampled) - lib-typeof x 8,957,593 ops/sec ±0.62% (98 runs sampled) - -#9: string - current x 25,379,234 ops/sec ±0.58% (96 runs sampled) - lib-type-of x 3,635,148 ops/sec ±0.76% (93 runs sampled) - lib-typeof x 9,494,134 ops/sec ±0.49% (98 runs sampled) - -#10: undef - current x 27,459,221 ops/sec ±1.01% (93 runs sampled) - lib-type-of x 14,360,433 ops/sec ±0.52% (99 runs sampled) - lib-typeof x 23,202,868 ops/sec ±0.59% (94 runs sampled) - -``` - -## Optimizations - -In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: - -1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. -2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. -3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` -4. There is no reason to make the code in a microlib as terse as possible, just to win points for making it shorter. It's always better to favor performant code over terse code. You will always only be using a single `require()` statement to use the library anyway, regardless of how the code is written. - -## Better type checking - -kind-of is more correct than other type checking libs I've looked at. For example, here are some differing results from other popular libs: - -### [typeof](https://github.com/CodingFu/typeof) lib - -Incorrectly tests instances of custom constructors (pretty common): - -```js -var typeOf = require('typeof'); -function Test() {} -console.log(typeOf(new Test())); -//=> 'test' -``` - -Returns `object` instead of `arguments`: - -```js -function foo() { - console.log(typeOf(arguments)) //=> 'object' -} -foo(); -``` - -### [type-of](https://github.com/ForbesLindesay/type-of) lib - -Incorrectly returns `object` for generator functions, buffers, `Map`, `Set`, `WeakMap` and `WeakSet`: - -```js -function * foo() {} -console.log(typeOf(foo)); -//=> 'object' -console.log(typeOf(new Buffer(''))); -//=> 'object' -console.log(typeOf(new Map())); -//=> 'object' -console.log(typeOf(new Set())); -//=> 'object' -console.log(typeOf(new WeakMap())); -//=> 'object' -console.log(typeOf(new WeakSet())); -//=> 'object' -``` - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    - -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") -* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") -* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 82 | [jonschlinkert](https://github.com/jonschlinkert) | -| 3 | [aretecode](https://github.com/aretecode) | -| 2 | [miguelmota](https://github.com/miguelmota) | -| 1 | [dtothefp](https://github.com/dtothefp) | -| 1 | [ksheedlo](https://github.com/ksheedlo) | -| 1 | [pdehaan](https://github.com/pdehaan) | -| 1 | [laggingreflex](https://github.com/laggingreflex) | -| 1 | [charlike](https://github.com/charlike) | - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on October 13, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/index.js b/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/index.js deleted file mode 100644 index fc5cde96e..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/index.js +++ /dev/null @@ -1,147 +0,0 @@ -var toString = Object.prototype.toString; - -/** - * Get the native `typeof` a value. - * - * @param {*} `val` - * @return {*} Native javascript type - */ - -module.exports = function kindOf(val) { - var type = typeof val; - - // primitivies - if (type === 'undefined') { - return 'undefined'; - } - if (val === null) { - return 'null'; - } - if (val === true || val === false || val instanceof Boolean) { - return 'boolean'; - } - if (type === 'string' || val instanceof String) { - return 'string'; - } - if (type === 'number' || val instanceof Number) { - return 'number'; - } - - // functions - if (type === 'function' || val instanceof Function) { - if (typeof val.constructor.name !== 'undefined' && val.constructor.name.slice(0, 9) === 'Generator') { - return 'generatorfunction'; - } - return 'function'; - } - - // array - if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { - return 'array'; - } - - // check for instances of RegExp and Date before calling `toString` - if (val instanceof RegExp) { - return 'regexp'; - } - if (val instanceof Date) { - return 'date'; - } - - // other objects - type = toString.call(val); - - if (type === '[object RegExp]') { - return 'regexp'; - } - if (type === '[object Date]') { - return 'date'; - } - if (type === '[object Arguments]') { - return 'arguments'; - } - if (type === '[object Error]') { - return 'error'; - } - if (type === '[object Promise]') { - return 'promise'; - } - - // buffer - if (isBuffer(val)) { - return 'buffer'; - } - - // es6: Map, WeakMap, Set, WeakSet - if (type === '[object Set]') { - return 'set'; - } - if (type === '[object WeakSet]') { - return 'weakset'; - } - if (type === '[object Map]') { - return 'map'; - } - if (type === '[object WeakMap]') { - return 'weakmap'; - } - if (type === '[object Symbol]') { - return 'symbol'; - } - - if (type === '[object Map Iterator]') { - return 'mapiterator'; - } - if (type === '[object Set Iterator]') { - return 'setiterator'; - } - if (type === '[object String Iterator]') { - return 'stringiterator'; - } - if (type === '[object Array Iterator]') { - return 'arrayiterator'; - } - - // typed arrays - if (type === '[object Int8Array]') { - return 'int8array'; - } - if (type === '[object Uint8Array]') { - return 'uint8array'; - } - if (type === '[object Uint8ClampedArray]') { - return 'uint8clampedarray'; - } - if (type === '[object Int16Array]') { - return 'int16array'; - } - if (type === '[object Uint16Array]') { - return 'uint16array'; - } - if (type === '[object Int32Array]') { - return 'int32array'; - } - if (type === '[object Uint32Array]') { - return 'uint32array'; - } - if (type === '[object Float32Array]') { - return 'float32array'; - } - if (type === '[object Float64Array]') { - return 'float64array'; - } - - // must be a plain object - return 'object'; -}; - -/** - * If you need to support Safari 5-7 (8-10 yr-old browser), - * take a look at https://github.com/feross/is-buffer - */ - -function isBuffer(val) { - return val.constructor - && typeof val.constructor.isBuffer === 'function' - && val.constructor.isBuffer(val); -} diff --git a/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/package.json b/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/package.json deleted file mode 100644 index e3faa210c..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of/package.json +++ /dev/null @@ -1,146 +0,0 @@ -{ - "_from": "kind-of@^5.0.0", - "_id": "kind-of@5.1.0", - "_inBundle": false, - "_integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "_location": "/readdirp/expand-brackets/kind-of", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "kind-of@^5.0.0", - "name": "kind-of", - "escapedName": "kind-of", - "rawSpec": "^5.0.0", - "saveSpec": null, - "fetchSpec": "^5.0.0" - }, - "_requiredBy": [ - "/readdirp/expand-brackets/is-descriptor" - ], - "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "_shasum": "729c91e2d857b7a419a1f9aa65685c4c33f5845d", - "_spec": "kind-of@^5.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/kind-of/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "David Fox-Powell", - "url": "https://dtothefp.github.io/me" - }, - { - "name": "James", - "url": "https://twitter.com/aretecode" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Ken Sheedlo", - "url": "kensheedlo.com" - }, - { - "name": "laggingreflex", - "url": "https://github.com/laggingreflex" - }, - { - "name": "Miguel Mota", - "url": "https://miguelmota.com" - }, - { - "name": "Peter deHaan", - "url": "http://about.me/peterdehaan" - }, - { - "name": "tunnckoCore", - "url": "https://i.am.charlike.online" - } - ], - "deprecated": false, - "description": "Get the native type of a value.", - "devDependencies": { - "ansi-bold": "^0.1.1", - "benchmarked": "^1.1.1", - "browserify": "^14.4.0", - "gulp-format-md": "^0.1.12", - "matched": "^0.4.4", - "mocha": "^3.4.2", - "type-of": "^2.0.1", - "typeof": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/kind-of", - "keywords": [ - "arguments", - "array", - "boolean", - "check", - "date", - "function", - "is", - "is-type", - "is-type-of", - "kind", - "kind-of", - "number", - "object", - "of", - "regexp", - "string", - "test", - "type", - "type-of", - "typeof", - "types" - ], - "license": "MIT", - "main": "index.js", - "name": "kind-of", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/kind-of.git" - }, - "scripts": { - "prepublish": "browserify -o browser.js -e index.js -s index --bare", - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "is-glob", - "is-number", - "is-primitive" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "type-of", - "typeof", - "verb" - ] - }, - "version": "5.1.0" -} diff --git a/node_modules/readdirp/node_modules/expand-brackets/package.json b/node_modules/readdirp/node_modules/expand-brackets/package.json deleted file mode 100644 index 87197274c..000000000 --- a/node_modules/readdirp/node_modules/expand-brackets/package.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "_from": "expand-brackets@^2.1.4", - "_id": "expand-brackets@2.1.4", - "_inBundle": false, - "_integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "_location": "/readdirp/expand-brackets", - "_phantomChildren": { - "is-buffer": "1.1.6", - "is-extendable": "0.1.1" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "expand-brackets@^2.1.4", - "name": "expand-brackets", - "escapedName": "expand-brackets", - "rawSpec": "^2.1.4", - "saveSpec": null, - "fetchSpec": "^2.1.4" - }, - "_requiredBy": [ - "/readdirp/extglob" - ], - "_resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "_shasum": "b77735e315ce30f6b6eff0f83b04151a22449622", - "_spec": "expand-brackets@^2.1.4", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/extglob", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/expand-brackets/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Elan Shanker", - "url": "https://github.com/es128" - }, - { - "name": "Eugene Sharygin", - "url": "https://github.com/eush77" - }, - { - "name": "Jon Schlinkert", - "email": "jon.schlinkert@sellside.com", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Martin Kolárik", - "email": "martin@kolarik.sk", - "url": "http://kolarik.sk" - } - ], - "dependencies": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "deprecated": false, - "description": "Expand POSIX bracket expressions (character classes) in glob patterns.", - "devDependencies": { - "bash-match": "^0.1.1", - "gulp-format-md": "^0.1.10", - "helper-changelog": "^0.3.0", - "minimatch": "^3.0.3", - "mocha": "^3.0.2", - "multimatch": "^2.1.0", - "yargs-parser": "^4.0.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js", - "lib" - ], - "homepage": "https://github.com/jonschlinkert/expand-brackets", - "keywords": [ - "bracket", - "brackets", - "character class", - "expand", - "expression", - "posix" - ], - "license": "MIT", - "main": "index.js", - "name": "expand-brackets", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/expand-brackets.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "run": true, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "helpers": [ - "helper-changelog" - ], - "related": { - "list": [ - "braces", - "extglob", - "micromatch", - "nanomatch" - ] - }, - "reflinks": [ - "micromatch", - "verb", - "verb-generate-readme" - ], - "lint": { - "reflinks": true - } - }, - "version": "2.1.4" -} diff --git a/node_modules/readdirp/node_modules/extglob/LICENSE b/node_modules/readdirp/node_modules/extglob/LICENSE deleted file mode 100644 index e33d14b75..000000000 --- a/node_modules/readdirp/node_modules/extglob/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2017, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/extglob/README.md b/node_modules/readdirp/node_modules/extglob/README.md deleted file mode 100644 index 3255ea2b7..000000000 --- a/node_modules/readdirp/node_modules/extglob/README.md +++ /dev/null @@ -1,362 +0,0 @@ -# extglob [![NPM version](https://img.shields.io/npm/v/extglob.svg?style=flat)](https://www.npmjs.com/package/extglob) [![NPM monthly downloads](https://img.shields.io/npm/dm/extglob.svg?style=flat)](https://npmjs.org/package/extglob) [![NPM total downloads](https://img.shields.io/npm/dt/extglob.svg?style=flat)](https://npmjs.org/package/extglob) [![Linux Build Status](https://img.shields.io/travis/micromatch/extglob.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/extglob) [![Windows Build Status](https://img.shields.io/appveyor/ci/micromatch/extglob.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/micromatch/extglob) - -> Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save extglob -``` - -* Convert an extglob string to a regex-compatible string. -* More complete (and correct) support than [minimatch](https://github.com/isaacs/minimatch) (minimatch fails a large percentage of the extglob tests) -* Handles [negation patterns](#extglob-patterns) -* Handles [nested patterns](#extglob-patterns) -* Organized code base, easy to maintain and make changes when edge cases arise -* As you can see by the [benchmarks](#benchmarks), extglob doesn't pay with speed for it's completeness, accuracy and quality. - -**Heads up!**: This library only supports extglobs, to handle full glob patterns and other extended globbing features use [micromatch](https://github.com/jonschlinkert/micromatch) instead. - -## Usage - -The main export is a function that takes a string and options, and returns an object with the parsed AST and the compiled `.output`, which is a regex-compatible string that can be used for matching. - -```js -var extglob = require('extglob'); -console.log(extglob('!(xyz)*.js')); -``` - -## Extglob cheatsheet - -Extended globbing patterns can be defined as follows (as described by the [bash man page](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html)): - -| **pattern** | **regex equivalent** | **description** | -| --- | --- | --- | -| `?(pattern-list)` | `(...|...)?` | Matches zero or one occurrence of the given pattern(s) | -| `*(pattern-list)` | `(...|...)*` | Matches zero or more occurrences of the given pattern(s) | -| `+(pattern-list)` | `(...|...)+` | Matches one or more occurrences of the given pattern(s) | -| `@(pattern-list)` | `(...|...)` [1] | Matches one of the given pattern(s) | -| `!(pattern-list)` | N/A | Matches anything except one of the given pattern(s) | - -## API - -### [extglob](index.js#L36) - -Convert the given `extglob` pattern into a regex-compatible string. Returns an object with the compiled result and the parsed AST. - -**Params** - -* `pattern` **{String}** -* `options` **{Object}** -* `returns` **{String}** - -**Example** - -```js -var extglob = require('extglob'); -console.log(extglob('*.!(*a)')); -//=> '(?!\\.)[^/]*?\\.(?!(?!\\.)[^/]*?a\\b).*?' -``` - -### [.match](index.js#L56) - -Takes an array of strings and an extglob pattern and returns a new array that contains only the strings that match the pattern. - -**Params** - -* `list` **{Array}**: Array of strings to match -* `pattern` **{String}**: Extglob pattern -* `options` **{Object}** -* `returns` **{Array}**: Returns an array of matches - -**Example** - -```js -var extglob = require('extglob'); -console.log(extglob.match(['a.a', 'a.b', 'a.c'], '*.!(*a)')); -//=> ['a.b', 'a.c'] -``` - -### [.isMatch](index.js#L111) - -Returns true if the specified `string` matches the given extglob `pattern`. - -**Params** - -* `string` **{String}**: String to match -* `pattern` **{String}**: Extglob pattern -* `options` **{String}** -* `returns` **{Boolean}** - -**Example** - -```js -var extglob = require('extglob'); - -console.log(extglob.isMatch('a.a', '*.!(*a)')); -//=> false -console.log(extglob.isMatch('a.b', '*.!(*a)')); -//=> true -``` - -### [.contains](index.js#L150) - -Returns true if the given `string` contains the given pattern. Similar to `.isMatch` but the pattern can match any part of the string. - -**Params** - -* `str` **{String}**: The string to match. -* `pattern` **{String}**: Glob pattern to use for matching. -* `options` **{Object}** -* `returns` **{Boolean}**: Returns true if the patter matches any part of `str`. - -**Example** - -```js -var extglob = require('extglob'); -console.log(extglob.contains('aa/bb/cc', '*b')); -//=> true -console.log(extglob.contains('aa/bb/cc', '*d')); -//=> false -``` - -### [.matcher](index.js#L184) - -Takes an extglob pattern and returns a matcher function. The returned function takes the string to match as its only argument. - -**Params** - -* `pattern` **{String}**: Extglob pattern -* `options` **{String}** -* `returns` **{Boolean}** - -**Example** - -```js -var extglob = require('extglob'); -var isMatch = extglob.matcher('*.!(*a)'); - -console.log(isMatch('a.a')); -//=> false -console.log(isMatch('a.b')); -//=> true -``` - -### [.create](index.js#L214) - -Convert the given `extglob` pattern into a regex-compatible string. Returns an object with the compiled result and the parsed AST. - -**Params** - -* `str` **{String}** -* `options` **{Object}** -* `returns` **{String}** - -**Example** - -```js -var extglob = require('extglob'); -console.log(extglob.create('*.!(*a)').output); -//=> '(?!\\.)[^/]*?\\.(?!(?!\\.)[^/]*?a\\b).*?' -``` - -### [.capture](index.js#L248) - -Returns an array of matches captured by `pattern` in `string`, or `null` if the pattern did not match. - -**Params** - -* `pattern` **{String}**: Glob pattern to use for matching. -* `string` **{String}**: String to match -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Boolean}**: Returns an array of captures if the string matches the glob pattern, otherwise `null`. - -**Example** - -```js -var extglob = require('extglob'); -extglob.capture(pattern, string[, options]); - -console.log(extglob.capture('test/*.js', 'test/foo.js')); -//=> ['foo'] -console.log(extglob.capture('test/*.js', 'foo/bar.css')); -//=> null -``` - -### [.makeRe](index.js#L281) - -Create a regular expression from the given `pattern` and `options`. - -**Params** - -* `pattern` **{String}**: The pattern to convert to regex. -* `options` **{Object}** -* `returns` **{RegExp}** - -**Example** - -```js -var extglob = require('extglob'); -var re = extglob.makeRe('*.!(*a)'); -console.log(re); -//=> /^[^\/]*?\.(?![^\/]*?a)[^\/]*?$/ -``` - -## Options - -Available options are based on the options from Bash (and the option names used in bash). - -### options.nullglob - -**Type**: `boolean` - -**Default**: `undefined` - -When enabled, the pattern itself will be returned when no matches are found. - -### options.nonull - -Alias for [options.nullglob](#optionsnullglob), included for parity with minimatch. - -### options.cache - -**Type**: `boolean` - -**Default**: `undefined` - -Functions are memoized based on the given glob patterns and options. Disable memoization by setting `options.cache` to false. - -### options.failglob - -**Type**: `boolean` - -**Default**: `undefined` - -Throw an error is no matches are found. - -## Benchmarks - -Last run on December 21, 2017 - -```sh -# negation-nested (49 bytes) - extglob x 2,228,255 ops/sec ±0.98% (89 runs sampled) - minimatch x 207,875 ops/sec ±0.61% (91 runs sampled) - - fastest is extglob (by 1072% avg) - -# negation-simple (43 bytes) - extglob x 2,205,668 ops/sec ±1.00% (91 runs sampled) - minimatch x 311,923 ops/sec ±1.25% (91 runs sampled) - - fastest is extglob (by 707% avg) - -# range-false (57 bytes) - extglob x 2,263,877 ops/sec ±0.40% (94 runs sampled) - minimatch x 271,372 ops/sec ±1.02% (91 runs sampled) - - fastest is extglob (by 834% avg) - -# range-true (56 bytes) - extglob x 2,161,891 ops/sec ±0.41% (92 runs sampled) - minimatch x 268,265 ops/sec ±1.17% (91 runs sampled) - - fastest is extglob (by 806% avg) - -# star-simple (46 bytes) - extglob x 2,211,081 ops/sec ±0.49% (92 runs sampled) - minimatch x 343,319 ops/sec ±0.59% (91 runs sampled) - - fastest is extglob (by 644% avg) - -``` - -## Differences from Bash - -This library has complete parity with Bash 4.3 with only a couple of minor differences. - -* In some cases Bash returns true if the given string "contains" the pattern, whereas this library returns true if the string is an exact match for the pattern. You can relax this by setting `options.contains` to true. -* This library is more accurate than Bash and thus does not fail some of the tests that Bash 4.3 still lists as failing in their unit tests - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [braces](https://www.npmjs.com/package/braces): Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support… [more](https://github.com/micromatch/braces) | [homepage](https://github.com/micromatch/braces "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.") -* [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/jonschlinkert/expand-brackets "Expand POSIX bracket expressions (character classes) in glob patterns.") -* [expand-range](https://www.npmjs.com/package/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. Used… [more](https://github.com/jonschlinkert/expand-range) | [homepage](https://github.com/jonschlinkert/expand-range "Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. Used by [micromatch].") -* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or `step` to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`") -* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/micromatch/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 49 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [isiahmeadows](https://github.com/isiahmeadows) | -| 1 | [doowb](https://github.com/doowb) | -| 1 | [devongovett](https://github.com/devongovett) | -| 1 | [mjbvz](https://github.com/mjbvz) | -| 1 | [shinnn](https://github.com/shinnn) | - -### Author - -**Jon Schlinkert** - -* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on December 21, 2017._ - -
    -
    -
      -
    1. `@` isn "'t a RegEx character." - -
    2. -
    -
    \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/extglob/changelog.md b/node_modules/readdirp/node_modules/extglob/changelog.md deleted file mode 100644 index c9fc4fcd7..000000000 --- a/node_modules/readdirp/node_modules/extglob/changelog.md +++ /dev/null @@ -1,25 +0,0 @@ -## Changelog - -### v2.0.0 - -**Added features** - -- Adds [.capture](readme.md#capture) method for capturing matches, thanks to [devongovett](https://github.com/devongovett) - - -### v1.0.0 - -**Breaking changes** - -- The main export now returns the compiled string, instead of the object returned from the compiler - -**Added features** - -- Adds a `.create` method to do what the main function did before v1.0.0 - -**Other changes** - -- adds `expand-brackets` parsers/compilers to handle nested brackets and extglobs -- uses `to-regex` to build regex for `makeRe` method -- improves coverage -- optimizations \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/extglob/index.js b/node_modules/readdirp/node_modules/extglob/index.js deleted file mode 100644 index 116e6d5cb..000000000 --- a/node_modules/readdirp/node_modules/extglob/index.js +++ /dev/null @@ -1,331 +0,0 @@ -'use strict'; - -/** - * Module dependencies - */ - -var extend = require('extend-shallow'); -var unique = require('array-unique'); -var toRegex = require('to-regex'); - -/** - * Local dependencies - */ - -var compilers = require('./lib/compilers'); -var parsers = require('./lib/parsers'); -var Extglob = require('./lib/extglob'); -var utils = require('./lib/utils'); -var MAX_LENGTH = 1024 * 64; - -/** - * Convert the given `extglob` pattern into a regex-compatible string. Returns - * an object with the compiled result and the parsed AST. - * - * ```js - * var extglob = require('extglob'); - * console.log(extglob('*.!(*a)')); - * //=> '(?!\\.)[^/]*?\\.(?!(?!\\.)[^/]*?a\\b).*?' - * ``` - * @param {String} `pattern` - * @param {Object} `options` - * @return {String} - * @api public - */ - -function extglob(pattern, options) { - return extglob.create(pattern, options).output; -} - -/** - * Takes an array of strings and an extglob pattern and returns a new - * array that contains only the strings that match the pattern. - * - * ```js - * var extglob = require('extglob'); - * console.log(extglob.match(['a.a', 'a.b', 'a.c'], '*.!(*a)')); - * //=> ['a.b', 'a.c'] - * ``` - * @param {Array} `list` Array of strings to match - * @param {String} `pattern` Extglob pattern - * @param {Object} `options` - * @return {Array} Returns an array of matches - * @api public - */ - -extglob.match = function(list, pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('expected pattern to be a string'); - } - - list = utils.arrayify(list); - var isMatch = extglob.matcher(pattern, options); - var len = list.length; - var idx = -1; - var matches = []; - - while (++idx < len) { - var ele = list[idx]; - - if (isMatch(ele)) { - matches.push(ele); - } - } - - // if no options were passed, uniquify results and return - if (typeof options === 'undefined') { - return unique(matches); - } - - if (matches.length === 0) { - if (options.failglob === true) { - throw new Error('no matches found for "' + pattern + '"'); - } - if (options.nonull === true || options.nullglob === true) { - return [pattern.split('\\').join('')]; - } - } - - return options.nodupes !== false ? unique(matches) : matches; -}; - -/** - * Returns true if the specified `string` matches the given - * extglob `pattern`. - * - * ```js - * var extglob = require('extglob'); - * - * console.log(extglob.isMatch('a.a', '*.!(*a)')); - * //=> false - * console.log(extglob.isMatch('a.b', '*.!(*a)')); - * //=> true - * ``` - * @param {String} `string` String to match - * @param {String} `pattern` Extglob pattern - * @param {String} `options` - * @return {Boolean} - * @api public - */ - -extglob.isMatch = function(str, pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('expected pattern to be a string'); - } - - if (typeof str !== 'string') { - throw new TypeError('expected a string'); - } - - if (pattern === str) { - return true; - } - - if (pattern === '' || pattern === ' ' || pattern === '.') { - return pattern === str; - } - - var isMatch = utils.memoize('isMatch', pattern, options, extglob.matcher); - return isMatch(str); -}; - -/** - * Returns true if the given `string` contains the given pattern. Similar to `.isMatch` but - * the pattern can match any part of the string. - * - * ```js - * var extglob = require('extglob'); - * console.log(extglob.contains('aa/bb/cc', '*b')); - * //=> true - * console.log(extglob.contains('aa/bb/cc', '*d')); - * //=> false - * ``` - * @param {String} `str` The string to match. - * @param {String} `pattern` Glob pattern to use for matching. - * @param {Object} `options` - * @return {Boolean} Returns true if the patter matches any part of `str`. - * @api public - */ - -extglob.contains = function(str, pattern, options) { - if (typeof str !== 'string') { - throw new TypeError('expected a string'); - } - - if (pattern === '' || pattern === ' ' || pattern === '.') { - return pattern === str; - } - - var opts = extend({}, options, {contains: true}); - opts.strictClose = false; - opts.strictOpen = false; - return extglob.isMatch(str, pattern, opts); -}; - -/** - * Takes an extglob pattern and returns a matcher function. The returned - * function takes the string to match as its only argument. - * - * ```js - * var extglob = require('extglob'); - * var isMatch = extglob.matcher('*.!(*a)'); - * - * console.log(isMatch('a.a')); - * //=> false - * console.log(isMatch('a.b')); - * //=> true - * ``` - * @param {String} `pattern` Extglob pattern - * @param {String} `options` - * @return {Boolean} - * @api public - */ - -extglob.matcher = function(pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('expected pattern to be a string'); - } - - function matcher() { - var re = extglob.makeRe(pattern, options); - return function(str) { - return re.test(str); - }; - } - - return utils.memoize('matcher', pattern, options, matcher); -}; - -/** - * Convert the given `extglob` pattern into a regex-compatible string. Returns - * an object with the compiled result and the parsed AST. - * - * ```js - * var extglob = require('extglob'); - * console.log(extglob.create('*.!(*a)').output); - * //=> '(?!\\.)[^/]*?\\.(?!(?!\\.)[^/]*?a\\b).*?' - * ``` - * @param {String} `str` - * @param {Object} `options` - * @return {String} - * @api public - */ - -extglob.create = function(pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('expected pattern to be a string'); - } - - function create() { - var ext = new Extglob(options); - var ast = ext.parse(pattern, options); - return ext.compile(ast, options); - } - - return utils.memoize('create', pattern, options, create); -}; - -/** - * Returns an array of matches captured by `pattern` in `string`, or `null` - * if the pattern did not match. - * - * ```js - * var extglob = require('extglob'); - * extglob.capture(pattern, string[, options]); - * - * console.log(extglob.capture('test/*.js', 'test/foo.js')); - * //=> ['foo'] - * console.log(extglob.capture('test/*.js', 'foo/bar.css')); - * //=> null - * ``` - * @param {String} `pattern` Glob pattern to use for matching. - * @param {String} `string` String to match - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns an array of captures if the string matches the glob pattern, otherwise `null`. - * @api public - */ - -extglob.capture = function(pattern, str, options) { - var re = extglob.makeRe(pattern, extend({capture: true}, options)); - - function match() { - return function(string) { - var match = re.exec(string); - if (!match) { - return null; - } - - return match.slice(1); - }; - } - - var capture = utils.memoize('capture', pattern, options, match); - return capture(str); -}; - -/** - * Create a regular expression from the given `pattern` and `options`. - * - * ```js - * var extglob = require('extglob'); - * var re = extglob.makeRe('*.!(*a)'); - * console.log(re); - * //=> /^[^\/]*?\.(?![^\/]*?a)[^\/]*?$/ - * ``` - * @param {String} `pattern` The pattern to convert to regex. - * @param {Object} `options` - * @return {RegExp} - * @api public - */ - -extglob.makeRe = function(pattern, options) { - if (pattern instanceof RegExp) { - return pattern; - } - - if (typeof pattern !== 'string') { - throw new TypeError('expected pattern to be a string'); - } - - if (pattern.length > MAX_LENGTH) { - throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters'); - } - - function makeRe() { - var opts = extend({strictErrors: false}, options); - if (opts.strictErrors === true) opts.strict = true; - var res = extglob.create(pattern, opts); - return toRegex(res.output, opts); - } - - var regex = utils.memoize('makeRe', pattern, options, makeRe); - if (regex.source.length > MAX_LENGTH) { - throw new SyntaxError('potentially malicious regex detected'); - } - - return regex; -}; - -/** - * Cache - */ - -extglob.cache = utils.cache; -extglob.clearCache = function() { - extglob.cache.__data__ = {}; -}; - -/** - * Expose `Extglob` constructor, parsers and compilers - */ - -extglob.Extglob = Extglob; -extglob.compilers = compilers; -extglob.parsers = parsers; - -/** - * Expose `extglob` - * @type {Function} - */ - -module.exports = extglob; diff --git a/node_modules/readdirp/node_modules/extglob/lib/.DS_Store b/node_modules/readdirp/node_modules/extglob/lib/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 1) { - val += '{' + node.val.length + '}'; - } - return this.emit(val, node); - }) - - /** - * Plus: "+" - */ - - .set('plus', function(node) { - var prev = node.parsed.slice(-1); - if (prev === ']' || prev === ')') { - return this.emit(node.val, node); - } - var ch = this.output.slice(-1); - if (!this.output || (/[?*+]/.test(ch) && node.parent.type !== 'bracket')) { - return this.emit('\\+', node); - } - if (/\w/.test(ch) && !node.inside) { - return this.emit('+\\+?', node); - } - return this.emit('+', node); - }) - - /** - * Star: "*" - */ - - .set('star', function(node) { - var prev = this.prev(); - var prefix = prev.type !== 'text' && prev.type !== 'escape' - ? '(?!\\.)' - : ''; - - return this.emit(prefix + star.call(this, node), node); - }) - - /** - * Parens - */ - - .set('paren', function(node) { - return this.mapVisit(node.nodes); - }) - .set('paren.open', function(node) { - var capture = this.options.capture ? '(' : ''; - - switch (node.parent.prefix) { - case '!': - case '^': - return this.emit(capture + '(?:(?!(?:', node); - case '*': - case '+': - case '?': - case '@': - return this.emit(capture + '(?:', node); - default: { - var val = node.val; - if (this.options.bash === true) { - val = '\\' + val; - } else if (!this.options.capture && val === '(' && node.parent.rest[0] !== '?') { - val += '?:'; - } - - return this.emit(val, node); - } - } - }) - .set('paren.close', function(node) { - var capture = this.options.capture ? ')' : ''; - - switch (node.prefix) { - case '!': - case '^': - var prefix = /^(\)|$)/.test(node.rest) ? '$' : ''; - var str = star.call(this, node); - - // if the extglob has a slash explicitly defined, we know the user wants - // to match slashes, so we need to ensure the "star" regex allows for it - if (node.parent.hasSlash && !this.options.star && this.options.slash !== false) { - str = '.*?'; - } - - return this.emit(prefix + ('))' + str + ')') + capture, node); - case '*': - case '+': - case '?': - return this.emit(')' + node.prefix + capture, node); - case '@': - return this.emit(')' + capture, node); - default: { - var val = (this.options.bash === true ? '\\' : '') + ')'; - return this.emit(val, node); - } - } - }) - - /** - * Text - */ - - .set('text', function(node) { - var val = node.val.replace(/[\[\]]/g, '\\$&'); - return this.emit(val, node); - }); -}; diff --git a/node_modules/readdirp/node_modules/extglob/lib/extglob.js b/node_modules/readdirp/node_modules/extglob/lib/extglob.js deleted file mode 100644 index 015f92895..000000000 --- a/node_modules/readdirp/node_modules/extglob/lib/extglob.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -/** - * Module dependencies - */ - -var Snapdragon = require('snapdragon'); -var define = require('define-property'); -var extend = require('extend-shallow'); - -/** - * Local dependencies - */ - -var compilers = require('./compilers'); -var parsers = require('./parsers'); - -/** - * Customize Snapdragon parser and renderer - */ - -function Extglob(options) { - this.options = extend({source: 'extglob'}, options); - this.snapdragon = this.options.snapdragon || new Snapdragon(this.options); - this.snapdragon.patterns = this.snapdragon.patterns || {}; - this.compiler = this.snapdragon.compiler; - this.parser = this.snapdragon.parser; - - compilers(this.snapdragon); - parsers(this.snapdragon); - - /** - * Override Snapdragon `.parse` method - */ - - define(this.snapdragon, 'parse', function(str, options) { - var parsed = Snapdragon.prototype.parse.apply(this, arguments); - parsed.input = str; - - // escape unmatched brace/bracket/parens - var last = this.parser.stack.pop(); - if (last && this.options.strict !== true) { - var node = last.nodes[0]; - node.val = '\\' + node.val; - var sibling = node.parent.nodes[1]; - if (sibling.type === 'star') { - sibling.loose = true; - } - } - - // add non-enumerable parser reference - define(parsed, 'parser', this.parser); - return parsed; - }); - - /** - * Decorate `.parse` method - */ - - define(this, 'parse', function(ast, options) { - return this.snapdragon.parse.apply(this.snapdragon, arguments); - }); - - /** - * Decorate `.compile` method - */ - - define(this, 'compile', function(ast, options) { - return this.snapdragon.compile.apply(this.snapdragon, arguments); - }); - -} - -/** - * Expose `Extglob` - */ - -module.exports = Extglob; diff --git a/node_modules/readdirp/node_modules/extglob/lib/parsers.js b/node_modules/readdirp/node_modules/extglob/lib/parsers.js deleted file mode 100644 index 2ba7352e9..000000000 --- a/node_modules/readdirp/node_modules/extglob/lib/parsers.js +++ /dev/null @@ -1,156 +0,0 @@ -'use strict'; - -var brackets = require('expand-brackets'); -var define = require('define-property'); -var utils = require('./utils'); - -/** - * Characters to use in text regex (we want to "not" match - * characters that are matched by other parsers) - */ - -var TEXT_REGEX = '([!@*?+]?\\(|\\)|[*?.+\\\\]|\\[:?(?=.*\\])|:?\\])+'; -var not = utils.createRegex(TEXT_REGEX); - -/** - * Extglob parsers - */ - -function parsers(extglob) { - extglob.state = extglob.state || {}; - - /** - * Use `expand-brackets` parsers - */ - - extglob.use(brackets.parsers); - extglob.parser.sets.paren = extglob.parser.sets.paren || []; - extglob.parser - - /** - * Extglob open: "*(" - */ - - .capture('paren.open', function() { - var parsed = this.parsed; - var pos = this.position(); - var m = this.match(/^([!@*?+])?\(/); - if (!m) return; - - var prev = this.prev(); - var prefix = m[1]; - var val = m[0]; - - var open = pos({ - type: 'paren.open', - parsed: parsed, - val: val - }); - - var node = pos({ - type: 'paren', - prefix: prefix, - nodes: [open] - }); - - // if nested negation extglobs, just cancel them out to simplify - if (prefix === '!' && prev.type === 'paren' && prev.prefix === '!') { - prev.prefix = '@'; - node.prefix = '@'; - } - - define(node, 'rest', this.input); - define(node, 'parsed', parsed); - define(node, 'parent', prev); - define(open, 'parent', node); - - this.push('paren', node); - prev.nodes.push(node); - }) - - /** - * Extglob close: ")" - */ - - .capture('paren.close', function() { - var parsed = this.parsed; - var pos = this.position(); - var m = this.match(/^\)/); - if (!m) return; - - var parent = this.pop('paren'); - var node = pos({ - type: 'paren.close', - rest: this.input, - parsed: parsed, - val: m[0] - }); - - if (!this.isType(parent, 'paren')) { - if (this.options.strict) { - throw new Error('missing opening paren: "("'); - } - node.escaped = true; - return node; - } - - node.prefix = parent.prefix; - parent.nodes.push(node); - define(node, 'parent', parent); - }) - - /** - * Escape: "\\." - */ - - .capture('escape', function() { - var pos = this.position(); - var m = this.match(/^\\(.)/); - if (!m) return; - - return pos({ - type: 'escape', - val: m[0], - ch: m[1] - }); - }) - - /** - * Question marks: "?" - */ - - .capture('qmark', function() { - var parsed = this.parsed; - var pos = this.position(); - var m = this.match(/^\?+(?!\()/); - if (!m) return; - extglob.state.metachar = true; - return pos({ - type: 'qmark', - rest: this.input, - parsed: parsed, - val: m[0] - }); - }) - - /** - * Character parsers - */ - - .capture('star', /^\*(?!\()/) - .capture('plus', /^\+(?!\()/) - .capture('dot', /^\./) - .capture('text', not); -}; - -/** - * Expose text regex string - */ - -module.exports.TEXT_REGEX = TEXT_REGEX; - -/** - * Extglob parsers - */ - -module.exports = parsers; diff --git a/node_modules/readdirp/node_modules/extglob/lib/utils.js b/node_modules/readdirp/node_modules/extglob/lib/utils.js deleted file mode 100644 index 37a59fbce..000000000 --- a/node_modules/readdirp/node_modules/extglob/lib/utils.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict'; - -var regex = require('regex-not'); -var Cache = require('fragment-cache'); - -/** - * Utils - */ - -var utils = module.exports; -var cache = utils.cache = new Cache(); - -/** - * Cast `val` to an array - * @return {Array} - */ - -utils.arrayify = function(val) { - if (!Array.isArray(val)) { - return [val]; - } - return val; -}; - -/** - * Memoize a generated regex or function - */ - -utils.memoize = function(type, pattern, options, fn) { - var key = utils.createKey(type + pattern, options); - - if (cache.has(type, key)) { - return cache.get(type, key); - } - - var val = fn(pattern, options); - if (options && options.cache === false) { - return val; - } - - cache.set(type, key, val); - return val; -}; - -/** - * Create the key to use for memoization. The key is generated - * by iterating over the options and concatenating key-value pairs - * to the pattern string. - */ - -utils.createKey = function(pattern, options) { - var key = pattern; - if (typeof options === 'undefined') { - return key; - } - for (var prop in options) { - key += ';' + prop + '=' + String(options[prop]); - } - return key; -}; - -/** - * Create the regex to use for matching text - */ - -utils.createRegex = function(str) { - var opts = {contains: true, strictClose: false}; - return regex(str, opts); -}; diff --git a/node_modules/readdirp/node_modules/extglob/node_modules/define-property/LICENSE b/node_modules/readdirp/node_modules/extglob/node_modules/define-property/LICENSE deleted file mode 100644 index ec85897eb..000000000 --- a/node_modules/readdirp/node_modules/extglob/node_modules/define-property/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015, 2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/extglob/node_modules/define-property/README.md b/node_modules/readdirp/node_modules/extglob/node_modules/define-property/README.md deleted file mode 100644 index 2f1af05f3..000000000 --- a/node_modules/readdirp/node_modules/extglob/node_modules/define-property/README.md +++ /dev/null @@ -1,95 +0,0 @@ -# define-property [![NPM version](https://img.shields.io/npm/v/define-property.svg?style=flat)](https://www.npmjs.com/package/define-property) [![NPM monthly downloads](https://img.shields.io/npm/dm/define-property.svg?style=flat)](https://npmjs.org/package/define-property) [![NPM total downloads](https://img.shields.io/npm/dt/define-property.svg?style=flat)](https://npmjs.org/package/define-property) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/define-property.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/define-property) - -> Define a non-enumerable property on an object. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save define-property -``` - -Install with [yarn](https://yarnpkg.com): - -```sh -$ yarn add define-property -``` - -## Usage - -**Params** - -* `obj`: The object on which to define the property. -* `prop`: The name of the property to be defined or modified. -* `descriptor`: The descriptor for the property being defined or modified. - -```js -var define = require('define-property'); -var obj = {}; -define(obj, 'foo', function(val) { - return val.toUpperCase(); -}); - -console.log(obj); -//=> {} - -console.log(obj.foo('bar')); -//=> 'BAR' -``` - -**get/set** - -```js -define(obj, 'foo', { - get: function() {}, - set: function() {} -}); -``` - -## About - -### Related projects - -* [assign-deep](https://www.npmjs.com/package/assign-deep): Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target… [more](https://github.com/jonschlinkert/assign-deep) | [homepage](https://github.com/jonschlinkert/assign-deep "Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target (first) object.") -* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") -* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") -* [mixin-deep](https://www.npmjs.com/package/mixin-deep): Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. | [homepage](https://github.com/jonschlinkert/mixin-deep "Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 20, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/extglob/node_modules/define-property/index.js b/node_modules/readdirp/node_modules/extglob/node_modules/define-property/index.js deleted file mode 100644 index 27c19ebf6..000000000 --- a/node_modules/readdirp/node_modules/extglob/node_modules/define-property/index.js +++ /dev/null @@ -1,31 +0,0 @@ -/*! - * define-property - * - * Copyright (c) 2015, 2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var isDescriptor = require('is-descriptor'); - -module.exports = function defineProperty(obj, prop, val) { - if (typeof obj !== 'object' && typeof obj !== 'function') { - throw new TypeError('expected an object or function.'); - } - - if (typeof prop !== 'string') { - throw new TypeError('expected `prop` to be a string.'); - } - - if (isDescriptor(val) && ('set' in val || 'get' in val)) { - return Object.defineProperty(obj, prop, val); - } - - return Object.defineProperty(obj, prop, { - configurable: true, - enumerable: false, - writable: true, - value: val - }); -}; diff --git a/node_modules/readdirp/node_modules/extglob/node_modules/define-property/package.json b/node_modules/readdirp/node_modules/extglob/node_modules/define-property/package.json deleted file mode 100644 index d699ed015..000000000 --- a/node_modules/readdirp/node_modules/extglob/node_modules/define-property/package.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "_from": "define-property@^1.0.0", - "_id": "define-property@1.0.0", - "_inBundle": false, - "_integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "_location": "/readdirp/extglob/define-property", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "define-property@^1.0.0", - "name": "define-property", - "escapedName": "define-property", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/readdirp/extglob" - ], - "_resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "_shasum": "769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6", - "_spec": "define-property@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/extglob", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/define-property/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "deprecated": false, - "description": "Define a non-enumerable property on an object.", - "devDependencies": { - "gulp-format-md": "^0.1.12", - "mocha": "^3.2.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/define-property", - "keywords": [ - "define", - "define-property", - "enumerable", - "key", - "non", - "non-enumerable", - "object", - "prop", - "property", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "define-property", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/define-property.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "extend-shallow", - "merge-deep", - "assign-deep", - "mixin-deep" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - } - }, - "version": "1.0.0" -} diff --git a/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/LICENSE b/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/LICENSE deleted file mode 100644 index fa30c4cb3..000000000 --- a/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/README.md b/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/README.md deleted file mode 100644 index cdc45d4ff..000000000 --- a/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# extend-shallow [![NPM version](https://badge.fury.io/js/extend-shallow.svg)](http://badge.fury.io/js/extend-shallow) [![Build Status](https://travis-ci.org/jonschlinkert/extend-shallow.svg)](https://travis-ci.org/jonschlinkert/extend-shallow) - -> Extend an object with the properties of additional objects. node.js/javascript util. - -## Install - -Install with [npm](https://www.npmjs.com/) - -```sh -$ npm i extend-shallow --save -``` - -## Usage - -```js -var extend = require('extend-shallow'); - -extend({a: 'b'}, {c: 'd'}) -//=> {a: 'b', c: 'd'} -``` - -Pass an empty object to shallow clone: - -```js -var obj = {}; -extend(obj, {a: 'b'}, {c: 'd'}) -//=> {a: 'b', c: 'd'} -``` - -## Related - -* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. -* [for-own](https://github.com/jonschlinkert/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) -* [for-in](https://github.com/jonschlinkert/for-in): Iterate over the own and inherited enumerable properties of an objecte, and return an object… [more](https://github.com/jonschlinkert/for-in) -* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor. -* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null. -* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value. - -## Running tests - -Install dev dependencies: - -```sh -$ npm i -d && npm test -``` - -## Author - -**Jon Schlinkert** - -+ [github/jonschlinkert](https://github.com/jonschlinkert) -+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2015 Jon Schlinkert -Released under the MIT license. - -*** - -_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 29, 2015._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/index.js b/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/index.js deleted file mode 100644 index 92a067fcc..000000000 --- a/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/index.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -var isObject = require('is-extendable'); - -module.exports = function extend(o/*, objects*/) { - if (!isObject(o)) { o = {}; } - - var len = arguments.length; - for (var i = 1; i < len; i++) { - var obj = arguments[i]; - - if (isObject(obj)) { - assign(o, obj); - } - } - return o; -}; - -function assign(a, b) { - for (var key in b) { - if (hasOwn(b, key)) { - a[key] = b[key]; - } - } -} - -/** - * Returns true if the given `key` is an own property of `obj`. - */ - -function hasOwn(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} diff --git a/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/package.json b/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/package.json deleted file mode 100644 index 2b61ad110..000000000 --- a/node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_from": "extend-shallow@^2.0.1", - "_id": "extend-shallow@2.0.1", - "_inBundle": false, - "_integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "_location": "/readdirp/extglob/extend-shallow", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "extend-shallow@^2.0.1", - "name": "extend-shallow", - "escapedName": "extend-shallow", - "rawSpec": "^2.0.1", - "saveSpec": null, - "fetchSpec": "^2.0.1" - }, - "_requiredBy": [ - "/readdirp/extglob" - ], - "_resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "_shasum": "51af7d614ad9a9f610ea1bafbb989d6b1c56890f", - "_spec": "extend-shallow@^2.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/extglob", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/extend-shallow/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "deprecated": false, - "description": "Extend an object with the properties of additional objects. node.js/javascript util.", - "devDependencies": { - "array-slice": "^0.2.3", - "benchmarked": "^0.1.4", - "chalk": "^1.0.0", - "for-own": "^0.1.3", - "glob": "^5.0.12", - "is-plain-object": "^2.0.1", - "kind-of": "^2.0.0", - "minimist": "^1.1.1", - "mocha": "^2.2.5", - "should": "^7.0.1" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/extend-shallow", - "keywords": [ - "assign", - "extend", - "javascript", - "js", - "keys", - "merge", - "obj", - "object", - "prop", - "properties", - "property", - "props", - "shallow", - "util", - "utility", - "utils", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "extend-shallow", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/extend-shallow.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "2.0.1" -} diff --git a/node_modules/readdirp/node_modules/extglob/package.json b/node_modules/readdirp/node_modules/extglob/package.json deleted file mode 100644 index 6e4b78b7c..000000000 --- a/node_modules/readdirp/node_modules/extglob/package.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "_from": "extglob@^2.0.4", - "_id": "extglob@2.0.4", - "_inBundle": false, - "_integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "_location": "/readdirp/extglob", - "_phantomChildren": { - "is-descriptor": "1.0.2", - "is-extendable": "0.1.1" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "extglob@^2.0.4", - "name": "extglob", - "escapedName": "extglob", - "rawSpec": "^2.0.4", - "saveSpec": null, - "fetchSpec": "^2.0.4" - }, - "_requiredBy": [ - "/readdirp/micromatch" - ], - "_resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "_shasum": "ad00fe4dc612a9232e8718711dc5cb5ab0285543", - "_spec": "extglob@^2.0.4", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/micromatch/extglob/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Brian Woodward", - "url": "https://twitter.com/doowb" - }, - { - "name": "Devon Govett", - "url": "http://badassjs.com" - }, - { - "name": "Isiah Meadows", - "url": "https://www.isiahmeadows.com" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Matt Bierner", - "url": "http://mattbierner.com" - }, - { - "name": "Shinnosuke Watanabe", - "url": "https://shinnn.github.io" - } - ], - "dependencies": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "deprecated": false, - "description": "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.", - "devDependencies": { - "bash-match": "^1.0.2", - "for-own": "^1.0.0", - "gulp": "^3.9.1", - "gulp-eslint": "^4.0.0", - "gulp-format-md": "^1.0.0", - "gulp-istanbul": "^1.1.2", - "gulp-mocha": "^3.0.1", - "gulp-unused": "^0.2.1", - "helper-changelog": "^0.3.0", - "is-windows": "^1.0.1", - "micromatch": "^3.0.4", - "minimatch": "^3.0.4", - "minimist": "^1.2.0", - "mocha": "^3.5.0", - "multimatch": "^2.1.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js", - "lib" - ], - "homepage": "https://github.com/micromatch/extglob", - "keywords": [ - "bash", - "extended", - "extglob", - "glob", - "globbing", - "ksh", - "match", - "pattern", - "patterns", - "regex", - "test", - "wildcard" - ], - "license": "MIT", - "lintDeps": { - "devDependencies": { - "files": { - "options": { - "ignore": [ - "benchmark/**/*.js" - ] - } - } - } - }, - "main": "index.js", - "name": "extglob", - "repository": { - "type": "git", - "url": "git+https://github.com/micromatch/extglob.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "related": { - "list": [ - "braces", - "expand-brackets", - "expand-range", - "fill-range", - "micromatch" - ] - }, - "helpers": [ - "helper-changelog" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - } - }, - "version": "2.0.4" -} diff --git a/node_modules/readdirp/node_modules/fill-range/LICENSE b/node_modules/readdirp/node_modules/fill-range/LICENSE deleted file mode 100644 index d734237bd..000000000 --- a/node_modules/readdirp/node_modules/fill-range/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/fill-range/README.md b/node_modules/readdirp/node_modules/fill-range/README.md deleted file mode 100644 index bc1f8a044..000000000 --- a/node_modules/readdirp/node_modules/fill-range/README.md +++ /dev/null @@ -1,250 +0,0 @@ -# fill-range [![NPM version](https://img.shields.io/npm/v/fill-range.svg?style=flat)](https://www.npmjs.com/package/fill-range) [![NPM monthly downloads](https://img.shields.io/npm/dm/fill-range.svg?style=flat)](https://npmjs.org/package/fill-range) [![NPM total downloads](https://img.shields.io/npm/dt/fill-range.svg?style=flat)](https://npmjs.org/package/fill-range) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/fill-range.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/fill-range) - -> Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex` - -## Table of Contents - -- [Install](#install) -- [Usage](#usage) -- [Examples](#examples) -- [Options](#options) - * [options.step](#optionsstep) - * [options.strictRanges](#optionsstrictranges) - * [options.stringify](#optionsstringify) - * [options.toRegex](#optionstoregex) - * [options.transform](#optionstransform) -- [About](#about) - -_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save fill-range -``` - -Install with [yarn](https://yarnpkg.com): - -```sh -$ yarn add fill-range -``` - -## Usage - -Expands numbers and letters, optionally using a `step` as the last argument. _(Numbers may be defined as JavaScript numbers or strings)_. - -```js -var fill = require('fill-range'); -fill(from, to[, step, options]); - -// examples -console.log(fill('1', '10')); //=> '[ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10' ]' -console.log(fill('1', '10', {toRegex: true})); //=> [1-9]|10 -``` - -**Params** - -* `from`: **{String|Number}** the number or letter to start with -* `to`: **{String|Number}** the number or letter to end with -* `step`: **{String|Number|Object|Function}** Optionally pass a [step](#optionsstep) to use. -* `options`: **{Object|Function}**: See all available [options](#options) - -## Examples - -By default, an array of values is returned. - -**Alphabetical ranges** - -```js -console.log(fill('a', 'e')); //=> ['a', 'b', 'c', 'd', 'e'] -console.log(fill('A', 'E')); //=> [ 'A', 'B', 'C', 'D', 'E' ] -``` - -**Numerical ranges** - -Numbers can be defined as actual numbers or strings. - -```js -console.log(fill(1, 5)); //=> [ 1, 2, 3, 4, 5 ] -console.log(fill('1', '5')); //=> [ 1, 2, 3, 4, 5 ] -``` - -**Negative ranges** - -Numbers can be defined as actual numbers or strings. - -```js -console.log(fill('-5', '-1')); //=> [ '-5', '-4', '-3', '-2', '-1' ] -console.log(fill('-5', '5')); //=> [ '-5', '-4', '-3', '-2', '-1', '0', '1', '2', '3', '4', '5' ] -``` - -**Steps (increments)** - -```js -// numerical ranges with increments -console.log(fill('0', '25', 4)); //=> [ '0', '4', '8', '12', '16', '20', '24' ] -console.log(fill('0', '25', 5)); //=> [ '0', '5', '10', '15', '20', '25' ] -console.log(fill('0', '25', 6)); //=> [ '0', '6', '12', '18', '24' ] - -// alphabetical ranges with increments -console.log(fill('a', 'z', 4)); //=> [ 'a', 'e', 'i', 'm', 'q', 'u', 'y' ] -console.log(fill('a', 'z', 5)); //=> [ 'a', 'f', 'k', 'p', 'u', 'z' ] -console.log(fill('a', 'z', 6)); //=> [ 'a', 'g', 'm', 's', 'y' ] -``` - -## Options - -### options.step - -**Type**: `number` (formatted as a string or number) - -**Default**: `undefined` - -**Description**: The increment to use for the range. Can be used with letters or numbers. - -**Example(s)** - -```js -// numbers -console.log(fill('1', '10', 2)); //=> [ '1', '3', '5', '7', '9' ] -console.log(fill('1', '10', 3)); //=> [ '1', '4', '7', '10' ] -console.log(fill('1', '10', 4)); //=> [ '1', '5', '9' ] - -// letters -console.log(fill('a', 'z', 5)); //=> [ 'a', 'f', 'k', 'p', 'u', 'z' ] -console.log(fill('a', 'z', 7)); //=> [ 'a', 'h', 'o', 'v' ] -console.log(fill('a', 'z', 9)); //=> [ 'a', 'j', 's' ] -``` - -### options.strictRanges - -**Type**: `boolean` - -**Default**: `false` - -**Description**: By default, `null` is returned when an invalid range is passed. Enable this option to throw a `RangeError` on invalid ranges. - -**Example(s)** - -The following are all invalid: - -```js -fill('1.1', '2'); // decimals not supported in ranges -fill('a', '2'); // incompatible range values -fill(1, 10, 'foo'); // invalid "step" argument -``` - -### options.stringify - -**Type**: `boolean` - -**Default**: `undefined` - -**Description**: Cast all returned values to strings. By default, integers are returned as numbers. - -**Example(s)** - -```js -console.log(fill(1, 5)); //=> [ 1, 2, 3, 4, 5 ] -console.log(fill(1, 5, {stringify: true})); //=> [ '1', '2', '3', '4', '5' ] -``` - -### options.toRegex - -**Type**: `boolean` - -**Default**: `undefined` - -**Description**: Create a regex-compatible source string, instead of expanding values to an array. - -**Example(s)** - -```js -// alphabetical range -console.log(fill('a', 'e', {toRegex: true})); //=> '[a-e]' -// alphabetical with step -console.log(fill('a', 'z', 3, {toRegex: true})); //=> 'a|d|g|j|m|p|s|v|y' -// numerical range -console.log(fill('1', '100', {toRegex: true})); //=> '[1-9]|[1-9][0-9]|100' -// numerical range with zero padding -console.log(fill('000001', '100000', {toRegex: true})); -//=> '0{5}[1-9]|0{4}[1-9][0-9]|0{3}[1-9][0-9]{2}|0{2}[1-9][0-9]{3}|0[1-9][0-9]{4}|100000' -``` - -### options.transform - -**Type**: `function` - -**Default**: `undefined` - -**Description**: Customize each value in the returned array (or [string](#optionstoRegex)). _(you can also pass this function as the last argument to `fill()`)_. - -**Example(s)** - -```js -// increase padding by two -var arr = fill('01', '05', function(val, a, b, step, idx, arr, options) { - return repeat('0', (options.maxLength + 2) - val.length) + val; -}); - -console.log(arr); -//=> ['0001', '0002', '0003', '0004', '0005'] -``` - -## About - -### Related projects - -* [braces](https://www.npmjs.com/package/braces): Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces… [more](https://github.com/jonschlinkert/braces) | [homepage](https://github.com/jonschlinkert/braces "Fast, comprehensive, bash-like brace expansion implemented in JavaScript. Complete support for the Bash 4.3 braces specification, without sacrificing speed.") -* [expand-range](https://www.npmjs.com/package/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See… [more](https://github.com/jonschlinkert/expand-range) | [homepage](https://github.com/jonschlinkert/expand-range "Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See the benchmarks. Used by micromatch.") -* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") -* [to-regex-range](https://www.npmjs.com/package/to-regex-range): Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than… [more](https://github.com/jonschlinkert/to-regex-range) | [homepage](https://github.com/jonschlinkert/to-regex-range "Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.87 million test assertions.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 103 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [paulmillr](https://github.com/paulmillr) | -| 1 | [edorivai](https://github.com/edorivai) | -| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 23, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/fill-range/index.js b/node_modules/readdirp/node_modules/fill-range/index.js deleted file mode 100644 index 294a2edde..000000000 --- a/node_modules/readdirp/node_modules/fill-range/index.js +++ /dev/null @@ -1,208 +0,0 @@ -/*! - * fill-range - * - * Copyright (c) 2014-2015, 2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var util = require('util'); -var isNumber = require('is-number'); -var extend = require('extend-shallow'); -var repeat = require('repeat-string'); -var toRegex = require('to-regex-range'); - -/** - * Return a range of numbers or letters. - * - * @param {String} `start` Start of the range - * @param {String} `stop` End of the range - * @param {String} `step` Increment or decrement to use. - * @param {Function} `fn` Custom function to modify each element in the range. - * @return {Array} - */ - -function fillRange(start, stop, step, options) { - if (typeof start === 'undefined') { - return []; - } - - if (typeof stop === 'undefined' || start === stop) { - // special case, for handling negative zero - var isString = typeof start === 'string'; - if (isNumber(start) && !toNumber(start)) { - return [isString ? '0' : 0]; - } - return [start]; - } - - if (typeof step !== 'number' && typeof step !== 'string') { - options = step; - step = undefined; - } - - if (typeof options === 'function') { - options = { transform: options }; - } - - var opts = extend({step: step}, options); - if (opts.step && !isValidNumber(opts.step)) { - if (opts.strictRanges === true) { - throw new TypeError('expected options.step to be a number'); - } - return []; - } - - opts.isNumber = isValidNumber(start) && isValidNumber(stop); - if (!opts.isNumber && !isValid(start, stop)) { - if (opts.strictRanges === true) { - throw new RangeError('invalid range arguments: ' + util.inspect([start, stop])); - } - return []; - } - - opts.isPadded = isPadded(start) || isPadded(stop); - opts.toString = opts.stringify - || typeof opts.step === 'string' - || typeof start === 'string' - || typeof stop === 'string' - || !opts.isNumber; - - if (opts.isPadded) { - opts.maxLength = Math.max(String(start).length, String(stop).length); - } - - // support legacy minimatch/fill-range options - if (typeof opts.optimize === 'boolean') opts.toRegex = opts.optimize; - if (typeof opts.makeRe === 'boolean') opts.toRegex = opts.makeRe; - return expand(start, stop, opts); -} - -function expand(start, stop, options) { - var a = options.isNumber ? toNumber(start) : start.charCodeAt(0); - var b = options.isNumber ? toNumber(stop) : stop.charCodeAt(0); - - var step = Math.abs(toNumber(options.step)) || 1; - if (options.toRegex && step === 1) { - return toRange(a, b, start, stop, options); - } - - var zero = {greater: [], lesser: []}; - var asc = a < b; - var arr = new Array(Math.round((asc ? b - a : a - b) / step)); - var idx = 0; - - while (asc ? a <= b : a >= b) { - var val = options.isNumber ? a : String.fromCharCode(a); - if (options.toRegex && (val >= 0 || !options.isNumber)) { - zero.greater.push(val); - } else { - zero.lesser.push(Math.abs(val)); - } - - if (options.isPadded) { - val = zeros(val, options); - } - - if (options.toString) { - val = String(val); - } - - if (typeof options.transform === 'function') { - arr[idx++] = options.transform(val, a, b, step, idx, arr, options); - } else { - arr[idx++] = val; - } - - if (asc) { - a += step; - } else { - a -= step; - } - } - - if (options.toRegex === true) { - return toSequence(arr, zero, options); - } - return arr; -} - -function toRange(a, b, start, stop, options) { - if (options.isPadded) { - return toRegex(start, stop, options); - } - - if (options.isNumber) { - return toRegex(Math.min(a, b), Math.max(a, b), options); - } - - var start = String.fromCharCode(Math.min(a, b)); - var stop = String.fromCharCode(Math.max(a, b)); - return '[' + start + '-' + stop + ']'; -} - -function toSequence(arr, zeros, options) { - var greater = '', lesser = ''; - if (zeros.greater.length) { - greater = zeros.greater.join('|'); - } - if (zeros.lesser.length) { - lesser = '-(' + zeros.lesser.join('|') + ')'; - } - var res = greater && lesser - ? greater + '|' + lesser - : greater || lesser; - - if (options.capture) { - return '(' + res + ')'; - } - return res; -} - -function zeros(val, options) { - if (options.isPadded) { - var str = String(val); - var len = str.length; - var dash = ''; - if (str.charAt(0) === '-') { - dash = '-'; - str = str.slice(1); - } - var diff = options.maxLength - len; - var pad = repeat('0', diff); - val = (dash + pad + str); - } - if (options.stringify) { - return String(val); - } - return val; -} - -function toNumber(val) { - return Number(val) || 0; -} - -function isPadded(str) { - return /^-?0\d/.test(str); -} - -function isValid(min, max) { - return (isValidNumber(min) || isValidLetter(min)) - && (isValidNumber(max) || isValidLetter(max)); -} - -function isValidLetter(ch) { - return typeof ch === 'string' && ch.length === 1 && /^\w+$/.test(ch); -} - -function isValidNumber(n) { - return isNumber(n) && !/\./.test(n); -} - -/** - * Expose `fillRange` - * @type {Function} - */ - -module.exports = fillRange; diff --git a/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/LICENSE b/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/LICENSE deleted file mode 100644 index fa30c4cb3..000000000 --- a/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/README.md b/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/README.md deleted file mode 100644 index cdc45d4ff..000000000 --- a/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# extend-shallow [![NPM version](https://badge.fury.io/js/extend-shallow.svg)](http://badge.fury.io/js/extend-shallow) [![Build Status](https://travis-ci.org/jonschlinkert/extend-shallow.svg)](https://travis-ci.org/jonschlinkert/extend-shallow) - -> Extend an object with the properties of additional objects. node.js/javascript util. - -## Install - -Install with [npm](https://www.npmjs.com/) - -```sh -$ npm i extend-shallow --save -``` - -## Usage - -```js -var extend = require('extend-shallow'); - -extend({a: 'b'}, {c: 'd'}) -//=> {a: 'b', c: 'd'} -``` - -Pass an empty object to shallow clone: - -```js -var obj = {}; -extend(obj, {a: 'b'}, {c: 'd'}) -//=> {a: 'b', c: 'd'} -``` - -## Related - -* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. -* [for-own](https://github.com/jonschlinkert/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) -* [for-in](https://github.com/jonschlinkert/for-in): Iterate over the own and inherited enumerable properties of an objecte, and return an object… [more](https://github.com/jonschlinkert/for-in) -* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor. -* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null. -* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value. - -## Running tests - -Install dev dependencies: - -```sh -$ npm i -d && npm test -``` - -## Author - -**Jon Schlinkert** - -+ [github/jonschlinkert](https://github.com/jonschlinkert) -+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2015 Jon Schlinkert -Released under the MIT license. - -*** - -_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 29, 2015._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/index.js b/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/index.js deleted file mode 100644 index 92a067fcc..000000000 --- a/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/index.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -var isObject = require('is-extendable'); - -module.exports = function extend(o/*, objects*/) { - if (!isObject(o)) { o = {}; } - - var len = arguments.length; - for (var i = 1; i < len; i++) { - var obj = arguments[i]; - - if (isObject(obj)) { - assign(o, obj); - } - } - return o; -}; - -function assign(a, b) { - for (var key in b) { - if (hasOwn(b, key)) { - a[key] = b[key]; - } - } -} - -/** - * Returns true if the given `key` is an own property of `obj`. - */ - -function hasOwn(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} diff --git a/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/package.json b/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/package.json deleted file mode 100644 index 7ff07ce88..000000000 --- a/node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_from": "extend-shallow@^2.0.1", - "_id": "extend-shallow@2.0.1", - "_inBundle": false, - "_integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "_location": "/readdirp/fill-range/extend-shallow", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "extend-shallow@^2.0.1", - "name": "extend-shallow", - "escapedName": "extend-shallow", - "rawSpec": "^2.0.1", - "saveSpec": null, - "fetchSpec": "^2.0.1" - }, - "_requiredBy": [ - "/readdirp/fill-range" - ], - "_resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "_shasum": "51af7d614ad9a9f610ea1bafbb989d6b1c56890f", - "_spec": "extend-shallow@^2.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/fill-range", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/extend-shallow/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "deprecated": false, - "description": "Extend an object with the properties of additional objects. node.js/javascript util.", - "devDependencies": { - "array-slice": "^0.2.3", - "benchmarked": "^0.1.4", - "chalk": "^1.0.0", - "for-own": "^0.1.3", - "glob": "^5.0.12", - "is-plain-object": "^2.0.1", - "kind-of": "^2.0.0", - "minimist": "^1.1.1", - "mocha": "^2.2.5", - "should": "^7.0.1" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/extend-shallow", - "keywords": [ - "assign", - "extend", - "javascript", - "js", - "keys", - "merge", - "obj", - "object", - "prop", - "properties", - "property", - "props", - "shallow", - "util", - "utility", - "utils", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "extend-shallow", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/extend-shallow.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "2.0.1" -} diff --git a/node_modules/readdirp/node_modules/fill-range/package.json b/node_modules/readdirp/node_modules/fill-range/package.json deleted file mode 100644 index fc5fea9ae..000000000 --- a/node_modules/readdirp/node_modules/fill-range/package.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "_from": "fill-range@^4.0.0", - "_id": "fill-range@4.0.0", - "_inBundle": false, - "_integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "_location": "/readdirp/fill-range", - "_phantomChildren": { - "is-extendable": "0.1.1" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "fill-range@^4.0.0", - "name": "fill-range", - "escapedName": "fill-range", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/readdirp/braces" - ], - "_resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "_shasum": "d544811d428f98eb06a63dc402d2403c328c38f7", - "_spec": "fill-range@^4.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/braces", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/fill-range/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "email": "wtgtybhertgeghgtwtg@gmail.com", - "url": "https://github.com/wtgtybhertgeghgtwtg" - }, - { - "name": "Edo Rivai", - "email": "edo.rivai@gmail.com", - "url": "edo.rivai.nl" - }, - { - "name": "Jon Schlinkert", - "email": "jon.schlinkert@sellside.com", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Paul Miller", - "email": "paul+gh@paulmillr.com", - "url": "paulmillr.com" - } - ], - "dependencies": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "deprecated": false, - "description": "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`", - "devDependencies": { - "ansi-cyan": "^0.1.1", - "benchmarked": "^1.0.0", - "gulp-format-md": "^0.1.12", - "minimist": "^1.2.0", - "mocha": "^3.2.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/fill-range", - "keywords": [ - "alpha", - "alphabetical", - "array", - "bash", - "brace", - "expand", - "expansion", - "fill", - "glob", - "match", - "matches", - "matching", - "number", - "numerical", - "range", - "ranges", - "regex", - "sh" - ], - "license": "MIT", - "main": "index.js", - "name": "fill-range", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/fill-range.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "braces", - "expand-range", - "micromatch", - "to-regex-range" - ] - }, - "toc": true, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - } - }, - "version": "4.0.0" -} diff --git a/node_modules/readdirp/node_modules/is-accessor-descriptor/LICENSE b/node_modules/readdirp/node_modules/is-accessor-descriptor/LICENSE deleted file mode 100644 index e33d14b75..000000000 --- a/node_modules/readdirp/node_modules/is-accessor-descriptor/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2017, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/is-accessor-descriptor/README.md b/node_modules/readdirp/node_modules/is-accessor-descriptor/README.md deleted file mode 100644 index d198e1f05..000000000 --- a/node_modules/readdirp/node_modules/is-accessor-descriptor/README.md +++ /dev/null @@ -1,144 +0,0 @@ -# is-accessor-descriptor [![NPM version](https://img.shields.io/npm/v/is-accessor-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-accessor-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-accessor-descriptor.svg?style=flat)](https://npmjs.org/package/is-accessor-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-accessor-descriptor.svg?style=flat)](https://npmjs.org/package/is-accessor-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-accessor-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-accessor-descriptor) - -> Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save is-accessor-descriptor -``` - -## Usage - -```js -var isAccessor = require('is-accessor-descriptor'); - -isAccessor({get: function() {}}); -//=> true -``` - -You may also pass an object and property name to check if the property is an accessor: - -```js -isAccessor(foo, 'bar'); -``` - -## Examples - -`false` when not an object - -```js -isAccessor('a') -isAccessor(null) -isAccessor([]) -//=> false -``` - -`true` when the object has valid properties - -and the properties all have the correct JavaScript types: - -```js -isAccessor({get: noop, set: noop}) -isAccessor({get: noop}) -isAccessor({set: noop}) -//=> true -``` - -`false` when the object has invalid properties - -```js -isAccessor({get: noop, set: noop, bar: 'baz'}) -isAccessor({get: noop, writable: true}) -isAccessor({get: noop, value: true}) -//=> false -``` - -`false` when an accessor is not a function - -```js -isAccessor({get: noop, set: 'baz'}) -isAccessor({get: 'foo', set: noop}) -isAccessor({get: 'foo', bar: 'baz'}) -isAccessor({get: 'foo', set: 'baz'}) -//=> false -``` - -`false` when a value is not the correct type - -```js -isAccessor({get: noop, set: noop, enumerable: 'foo'}) -isAccessor({set: noop, configurable: 'foo'}) -isAccessor({get: noop, configurable: 'foo'}) -//=> false -``` - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    - -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.") -* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.") -* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.") -* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") -* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 22 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [realityking](https://github.com/realityking) | - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on November 01, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/is-accessor-descriptor/index.js b/node_modules/readdirp/node_modules/is-accessor-descriptor/index.js deleted file mode 100644 index d2e6fe8b9..000000000 --- a/node_modules/readdirp/node_modules/is-accessor-descriptor/index.js +++ /dev/null @@ -1,69 +0,0 @@ -/*! - * is-accessor-descriptor - * - * Copyright (c) 2015-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var typeOf = require('kind-of'); - -// accessor descriptor properties -var accessor = { - get: 'function', - set: 'function', - configurable: 'boolean', - enumerable: 'boolean' -}; - -function isAccessorDescriptor(obj, prop) { - if (typeof prop === 'string') { - var val = Object.getOwnPropertyDescriptor(obj, prop); - return typeof val !== 'undefined'; - } - - if (typeOf(obj) !== 'object') { - return false; - } - - if (has(obj, 'value') || has(obj, 'writable')) { - return false; - } - - if (!has(obj, 'get') || typeof obj.get !== 'function') { - return false; - } - - // tldr: it's valid to have "set" be undefined - // "set" might be undefined if `Object.getOwnPropertyDescriptor` - // was used to get the value, and only `get` was defined by the user - if (has(obj, 'set') && typeof obj[key] !== 'function' && typeof obj[key] !== 'undefined') { - return false; - } - - for (var key in obj) { - if (!accessor.hasOwnProperty(key)) { - continue; - } - - if (typeOf(obj[key]) === accessor[key]) { - continue; - } - - if (typeof obj[key] !== 'undefined') { - return false; - } - } - return true; -} - -function has(obj, key) { - return {}.hasOwnProperty.call(obj, key); -} - -/** - * Expose `isAccessorDescriptor` - */ - -module.exports = isAccessorDescriptor; diff --git a/node_modules/readdirp/node_modules/is-accessor-descriptor/package.json b/node_modules/readdirp/node_modules/is-accessor-descriptor/package.json deleted file mode 100644 index f159b1ce9..000000000 --- a/node_modules/readdirp/node_modules/is-accessor-descriptor/package.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "_from": "is-accessor-descriptor@^1.0.0", - "_id": "is-accessor-descriptor@1.0.0", - "_inBundle": false, - "_integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "_location": "/readdirp/is-accessor-descriptor", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-accessor-descriptor@^1.0.0", - "name": "is-accessor-descriptor", - "escapedName": "is-accessor-descriptor", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/readdirp/is-descriptor" - ], - "_resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "_shasum": "169c2f6d3df1f992618072365c9b0ea1f6878656", - "_spec": "is-accessor-descriptor@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/is-descriptor", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-accessor-descriptor/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Rouven Weßling", - "url": "www.rouvenwessling.de" - } - ], - "dependencies": { - "kind-of": "^6.0.0" - }, - "deprecated": false, - "description": "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.", - "devDependencies": { - "gulp-format-md": "^1.0.0", - "mocha": "^3.5.3" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-accessor-descriptor", - "keywords": [ - "accessor", - "check", - "data", - "descriptor", - "get", - "getter", - "is", - "keys", - "object", - "properties", - "property", - "set", - "setter", - "type", - "valid", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "is-accessor-descriptor", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-accessor-descriptor.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "is-accessor-descriptor", - "is-data-descriptor", - "is-descriptor", - "is-plain-object", - "isobject" - ] - }, - "lint": { - "reflinks": true - } - }, - "version": "1.0.0" -} diff --git a/node_modules/readdirp/node_modules/is-data-descriptor/LICENSE b/node_modules/readdirp/node_modules/is-data-descriptor/LICENSE deleted file mode 100644 index e33d14b75..000000000 --- a/node_modules/readdirp/node_modules/is-data-descriptor/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2017, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/is-data-descriptor/README.md b/node_modules/readdirp/node_modules/is-data-descriptor/README.md deleted file mode 100644 index 42b071446..000000000 --- a/node_modules/readdirp/node_modules/is-data-descriptor/README.md +++ /dev/null @@ -1,161 +0,0 @@ -# is-data-descriptor [![NPM version](https://img.shields.io/npm/v/is-data-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-data-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-data-descriptor.svg?style=flat)](https://npmjs.org/package/is-data-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-data-descriptor.svg?style=flat)](https://npmjs.org/package/is-data-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-data-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-data-descriptor) - -> Returns true if a value has the characteristics of a valid JavaScript data descriptor. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save is-data-descriptor -``` - -## Usage - -```js -var isDataDesc = require('is-data-descriptor'); -``` - -## Examples - -`true` when the descriptor has valid properties with valid values. - -```js -// `value` can be anything -isDataDesc({value: 'foo'}) -isDataDesc({value: function() {}}) -isDataDesc({value: true}) -//=> true -``` - -`false` when not an object - -```js -isDataDesc('a') -//=> false -isDataDesc(null) -//=> false -isDataDesc([]) -//=> false -``` - -`false` when the object has invalid properties - -```js -isDataDesc({value: 'foo', bar: 'baz'}) -//=> false -isDataDesc({value: 'foo', bar: 'baz'}) -//=> false -isDataDesc({value: 'foo', get: function(){}}) -//=> false -isDataDesc({get: function(){}, value: 'foo'}) -//=> false -``` - -`false` when a value is not the correct type - -```js -isDataDesc({value: 'foo', enumerable: 'foo'}) -//=> false -isDataDesc({value: 'foo', configurable: 'foo'}) -//=> false -isDataDesc({value: 'foo', writable: 'foo'}) -//=> false -``` - -## Valid properties - -The only valid data descriptor properties are the following: - -* `configurable` (required) -* `enumerable` (required) -* `value` (optional) -* `writable` (optional) - -To be a valid data descriptor, either `value` or `writable` must be defined. - -**Invalid properties** - -A descriptor may have additional _invalid_ properties (an error will **not** be thrown). - -```js -var foo = {}; - -Object.defineProperty(foo, 'bar', { - enumerable: true, - whatever: 'blah', // invalid, but doesn't cause an error - get: function() { - return 'baz'; - } -}); - -console.log(foo.bar); -//=> 'baz' -``` - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    - -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.") -* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.") -* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.") -* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 21 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [realityking](https://github.com/realityking) | - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on November 01, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/is-data-descriptor/index.js b/node_modules/readdirp/node_modules/is-data-descriptor/index.js deleted file mode 100644 index cfeae3619..000000000 --- a/node_modules/readdirp/node_modules/is-data-descriptor/index.js +++ /dev/null @@ -1,49 +0,0 @@ -/*! - * is-data-descriptor - * - * Copyright (c) 2015-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var typeOf = require('kind-of'); - -module.exports = function isDataDescriptor(obj, prop) { - // data descriptor properties - var data = { - configurable: 'boolean', - enumerable: 'boolean', - writable: 'boolean' - }; - - if (typeOf(obj) !== 'object') { - return false; - } - - if (typeof prop === 'string') { - var val = Object.getOwnPropertyDescriptor(obj, prop); - return typeof val !== 'undefined'; - } - - if (!('value' in obj) && !('writable' in obj)) { - return false; - } - - for (var key in obj) { - if (key === 'value') continue; - - if (!data.hasOwnProperty(key)) { - continue; - } - - if (typeOf(obj[key]) === data[key]) { - continue; - } - - if (typeof obj[key] !== 'undefined') { - return false; - } - } - return true; -}; diff --git a/node_modules/readdirp/node_modules/is-data-descriptor/package.json b/node_modules/readdirp/node_modules/is-data-descriptor/package.json deleted file mode 100644 index 6d3cbab24..000000000 --- a/node_modules/readdirp/node_modules/is-data-descriptor/package.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "_from": "is-data-descriptor@^1.0.0", - "_id": "is-data-descriptor@1.0.0", - "_inBundle": false, - "_integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "_location": "/readdirp/is-data-descriptor", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-data-descriptor@^1.0.0", - "name": "is-data-descriptor", - "escapedName": "is-data-descriptor", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/readdirp/is-descriptor" - ], - "_resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "_shasum": "d84876321d0e7add03990406abbbbd36ba9268c7", - "_spec": "is-data-descriptor@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/is-descriptor", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-data-descriptor/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Rouven Weßling", - "url": "www.rouvenwessling.de" - } - ], - "dependencies": { - "kind-of": "^6.0.0" - }, - "deprecated": false, - "description": "Returns true if a value has the characteristics of a valid JavaScript data descriptor.", - "devDependencies": { - "gulp-format-md": "^1.0.0", - "mocha": "^3.5.3" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-data-descriptor", - "keywords": [ - "accessor", - "check", - "data", - "descriptor", - "get", - "getter", - "is", - "keys", - "object", - "properties", - "property", - "set", - "setter", - "type", - "valid", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "is-data-descriptor", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-data-descriptor.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "is-accessor-descriptor", - "is-data-descriptor", - "is-descriptor", - "isobject" - ] - }, - "lint": { - "reflinks": true - } - }, - "version": "1.0.0" -} diff --git a/node_modules/readdirp/node_modules/is-descriptor/LICENSE b/node_modules/readdirp/node_modules/is-descriptor/LICENSE deleted file mode 100644 index c0d7f1362..000000000 --- a/node_modules/readdirp/node_modules/is-descriptor/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2017, Jon Schlinkert. - -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. \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/is-descriptor/README.md b/node_modules/readdirp/node_modules/is-descriptor/README.md deleted file mode 100644 index 658e53301..000000000 --- a/node_modules/readdirp/node_modules/is-descriptor/README.md +++ /dev/null @@ -1,193 +0,0 @@ -# is-descriptor [![NPM version](https://img.shields.io/npm/v/is-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-descriptor) - -> Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save is-descriptor -``` - -## Usage - -```js -var isDescriptor = require('is-descriptor'); - -isDescriptor({value: 'foo'}) -//=> true -isDescriptor({get: function(){}, set: function(){}}) -//=> true -isDescriptor({get: 'foo', set: function(){}}) -//=> false -``` - -You may also check for a descriptor by passing an object as the first argument and property name (`string`) as the second argument. - -```js -var obj = {}; -obj.foo = 'abc'; - -Object.defineProperty(obj, 'bar', { - value: 'xyz' -}); - -isDescriptor(obj, 'foo'); -//=> true -isDescriptor(obj, 'bar'); -//=> true -``` - -## Examples - -### value type - -`false` when not an object - -```js -isDescriptor('a'); -//=> false -isDescriptor(null); -//=> false -isDescriptor([]); -//=> false -``` - -### data descriptor - -`true` when the object has valid properties with valid values. - -```js -isDescriptor({value: 'foo'}); -//=> true -isDescriptor({value: noop}); -//=> true -``` - -`false` when the object has invalid properties - -```js -isDescriptor({value: 'foo', bar: 'baz'}); -//=> false -isDescriptor({value: 'foo', bar: 'baz'}); -//=> false -isDescriptor({value: 'foo', get: noop}); -//=> false -isDescriptor({get: noop, value: noop}); -//=> false -``` - -`false` when a value is not the correct type - -```js -isDescriptor({value: 'foo', enumerable: 'foo'}); -//=> false -isDescriptor({value: 'foo', configurable: 'foo'}); -//=> false -isDescriptor({value: 'foo', writable: 'foo'}); -//=> false -``` - -### accessor descriptor - -`true` when the object has valid properties with valid values. - -```js -isDescriptor({get: noop, set: noop}); -//=> true -isDescriptor({get: noop}); -//=> true -isDescriptor({set: noop}); -//=> true -``` - -`false` when the object has invalid properties - -```js -isDescriptor({get: noop, set: noop, bar: 'baz'}); -//=> false -isDescriptor({get: noop, writable: true}); -//=> false -isDescriptor({get: noop, value: true}); -//=> false -``` - -`false` when an accessor is not a function - -```js -isDescriptor({get: noop, set: 'baz'}); -//=> false -isDescriptor({get: 'foo', set: noop}); -//=> false -isDescriptor({get: 'foo', bar: 'baz'}); -//=> false -isDescriptor({get: 'foo', set: 'baz'}); -//=> false -``` - -`false` when a value is not the correct type - -```js -isDescriptor({get: noop, set: noop, enumerable: 'foo'}); -//=> false -isDescriptor({set: noop, configurable: 'foo'}); -//=> false -isDescriptor({get: noop, configurable: 'foo'}); -//=> false -``` - -## About - -### Related projects - -* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.") -* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.") -* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.") -* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 24 | [jonschlinkert](https://github.com/jonschlinkert) | -| 1 | [doowb](https://github.com/doowb) | -| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 22, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/is-descriptor/index.js b/node_modules/readdirp/node_modules/is-descriptor/index.js deleted file mode 100644 index c9b91d762..000000000 --- a/node_modules/readdirp/node_modules/is-descriptor/index.js +++ /dev/null @@ -1,22 +0,0 @@ -/*! - * is-descriptor - * - * Copyright (c) 2015-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var typeOf = require('kind-of'); -var isAccessor = require('is-accessor-descriptor'); -var isData = require('is-data-descriptor'); - -module.exports = function isDescriptor(obj, key) { - if (typeOf(obj) !== 'object') { - return false; - } - if ('get' in obj) { - return isAccessor(obj, key); - } - return isData(obj, key); -}; diff --git a/node_modules/readdirp/node_modules/is-descriptor/package.json b/node_modules/readdirp/node_modules/is-descriptor/package.json deleted file mode 100644 index c058e6e59..000000000 --- a/node_modules/readdirp/node_modules/is-descriptor/package.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "_from": "is-descriptor@^1.0.0", - "_id": "is-descriptor@1.0.2", - "_inBundle": false, - "_integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "_location": "/readdirp/is-descriptor", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-descriptor@^1.0.0", - "name": "is-descriptor", - "escapedName": "is-descriptor", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/readdirp/extglob/define-property" - ], - "_resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "_shasum": "3b159746a66604b04f8c81524ba365c5f14d86ec", - "_spec": "is-descriptor@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/extglob/node_modules/define-property", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-descriptor/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Brian Woodward", - "url": "https://twitter.com/doowb" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "url": "https://github.com/wtgtybhertgeghgtwtg" - } - ], - "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - }, - "deprecated": false, - "description": "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.", - "devDependencies": { - "gulp-format-md": "^1.0.0", - "mocha": "^3.5.3" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-descriptor", - "keywords": [ - "accessor", - "check", - "data", - "descriptor", - "get", - "getter", - "is", - "keys", - "object", - "properties", - "property", - "set", - "setter", - "type", - "valid", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "is-descriptor", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-descriptor.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "is-accessor-descriptor", - "is-data-descriptor", - "is-descriptor", - "isobject" - ] - }, - "plugins": [ - "gulp-format-md" - ], - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "lint": { - "reflinks": true - } - }, - "version": "1.0.2" -} diff --git a/node_modules/readdirp/node_modules/is-number/LICENSE b/node_modules/readdirp/node_modules/is-number/LICENSE deleted file mode 100644 index 842218cf0..000000000 --- a/node_modules/readdirp/node_modules/is-number/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2016, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/is-number/README.md b/node_modules/readdirp/node_modules/is-number/README.md deleted file mode 100644 index 281165dce..000000000 --- a/node_modules/readdirp/node_modules/is-number/README.md +++ /dev/null @@ -1,115 +0,0 @@ -# is-number [![NPM version](https://img.shields.io/npm/v/is-number.svg?style=flat)](https://www.npmjs.com/package/is-number) [![NPM downloads](https://img.shields.io/npm/dm/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-number.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-number) - -> Returns true if the value is a number. comprehensive tests. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save is-number -``` - -## Usage - -To understand some of the rationale behind the decisions made in this library (and to learn about some oddities of number evaluation in JavaScript), [see this gist](https://gist.github.com/jonschlinkert/e30c70c713da325d0e81). - -```js -var isNumber = require('is-number'); -``` - -### true - -See the [tests](./test.js) for more examples. - -```js -isNumber(5e3) //=> 'true' -isNumber(0xff) //=> 'true' -isNumber(-1.1) //=> 'true' -isNumber(0) //=> 'true' -isNumber(1) //=> 'true' -isNumber(1.1) //=> 'true' -isNumber(10) //=> 'true' -isNumber(10.10) //=> 'true' -isNumber(100) //=> 'true' -isNumber('-1.1') //=> 'true' -isNumber('0') //=> 'true' -isNumber('012') //=> 'true' -isNumber('0xff') //=> 'true' -isNumber('1') //=> 'true' -isNumber('1.1') //=> 'true' -isNumber('10') //=> 'true' -isNumber('10.10') //=> 'true' -isNumber('100') //=> 'true' -isNumber('5e3') //=> 'true' -isNumber(parseInt('012')) //=> 'true' -isNumber(parseFloat('012')) //=> 'true' -``` - -### False - -See the [tests](./test.js) for more examples. - -```js -isNumber('foo') //=> 'false' -isNumber([1]) //=> 'false' -isNumber([]) //=> 'false' -isNumber(function () {}) //=> 'false' -isNumber(Infinity) //=> 'false' -isNumber(NaN) //=> 'false' -isNumber(new Array('abc')) //=> 'false' -isNumber(new Array(2)) //=> 'false' -isNumber(new Buffer('abc')) //=> 'false' -isNumber(null) //=> 'false' -isNumber(undefined) //=> 'false' -isNumber({abc: 'abc'}) //=> 'false' -``` - -## About - -### Related projects - -* [even](https://www.npmjs.com/package/even): Get the even numbered items from an array. | [homepage](https://github.com/jonschlinkert/even "Get the even numbered items from an array.") -* [is-even](https://www.npmjs.com/package/is-even): Return true if the given number is even. | [homepage](https://github.com/jonschlinkert/is-even "Return true if the given number is even.") -* [is-odd](https://www.npmjs.com/package/is-odd): Returns true if the given number is odd. | [homepage](https://github.com/jonschlinkert/is-odd "Returns true if the given number is odd.") -* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") -* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") -* [odd](https://www.npmjs.com/package/odd): Get the odd numbered items from an array. | [homepage](https://github.com/jonschlinkert/odd "Get the odd numbered items from an array.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Building docs - -_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ - -To generate the readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install -g verb verb-generate-readme && verb -``` - -### Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -### License - -Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/is-number/blob/master/LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.30, on September 10, 2016._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/is-number/index.js b/node_modules/readdirp/node_modules/is-number/index.js deleted file mode 100644 index 7a2a45bed..000000000 --- a/node_modules/readdirp/node_modules/is-number/index.js +++ /dev/null @@ -1,22 +0,0 @@ -/*! - * is-number - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var typeOf = require('kind-of'); - -module.exports = function isNumber(num) { - var type = typeOf(num); - - if (type === 'string') { - if (!num.trim()) return false; - } else if (type !== 'number') { - return false; - } - - return (num - num + 1) >= 0; -}; diff --git a/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/LICENSE b/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/LICENSE deleted file mode 100644 index d734237bd..000000000 --- a/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/README.md b/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/README.md deleted file mode 100644 index 6a9df36d3..000000000 --- a/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/README.md +++ /dev/null @@ -1,261 +0,0 @@ -# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) - -> Get the native type of a value. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save kind-of -``` - -## Install - -Install with [bower](https://bower.io/) - -```sh -$ bower install kind-of --save -``` - -## Usage - -> es5, browser and es6 ready - -```js -var kindOf = require('kind-of'); - -kindOf(undefined); -//=> 'undefined' - -kindOf(null); -//=> 'null' - -kindOf(true); -//=> 'boolean' - -kindOf(false); -//=> 'boolean' - -kindOf(new Boolean(true)); -//=> 'boolean' - -kindOf(new Buffer('')); -//=> 'buffer' - -kindOf(42); -//=> 'number' - -kindOf(new Number(42)); -//=> 'number' - -kindOf('str'); -//=> 'string' - -kindOf(new String('str')); -//=> 'string' - -kindOf(arguments); -//=> 'arguments' - -kindOf({}); -//=> 'object' - -kindOf(Object.create(null)); -//=> 'object' - -kindOf(new Test()); -//=> 'object' - -kindOf(new Date()); -//=> 'date' - -kindOf([]); -//=> 'array' - -kindOf([1, 2, 3]); -//=> 'array' - -kindOf(new Array()); -//=> 'array' - -kindOf(/foo/); -//=> 'regexp' - -kindOf(new RegExp('foo')); -//=> 'regexp' - -kindOf(function () {}); -//=> 'function' - -kindOf(function * () {}); -//=> 'function' - -kindOf(new Function()); -//=> 'function' - -kindOf(new Map()); -//=> 'map' - -kindOf(new WeakMap()); -//=> 'weakmap' - -kindOf(new Set()); -//=> 'set' - -kindOf(new WeakSet()); -//=> 'weakset' - -kindOf(Symbol('str')); -//=> 'symbol' - -kindOf(new Int8Array()); -//=> 'int8array' - -kindOf(new Uint8Array()); -//=> 'uint8array' - -kindOf(new Uint8ClampedArray()); -//=> 'uint8clampedarray' - -kindOf(new Int16Array()); -//=> 'int16array' - -kindOf(new Uint16Array()); -//=> 'uint16array' - -kindOf(new Int32Array()); -//=> 'int32array' - -kindOf(new Uint32Array()); -//=> 'uint32array' - -kindOf(new Float32Array()); -//=> 'float32array' - -kindOf(new Float64Array()); -//=> 'float64array' -``` - -## Benchmarks - -Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). -Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `WeakSet`. - -```bash -#1: array - current x 23,329,397 ops/sec ±0.82% (94 runs sampled) - lib-type-of x 4,170,273 ops/sec ±0.55% (94 runs sampled) - lib-typeof x 9,686,935 ops/sec ±0.59% (98 runs sampled) - -#2: boolean - current x 27,197,115 ops/sec ±0.85% (94 runs sampled) - lib-type-of x 3,145,791 ops/sec ±0.73% (97 runs sampled) - lib-typeof x 9,199,562 ops/sec ±0.44% (99 runs sampled) - -#3: date - current x 20,190,117 ops/sec ±0.86% (92 runs sampled) - lib-type-of x 5,166,970 ops/sec ±0.74% (94 runs sampled) - lib-typeof x 9,610,821 ops/sec ±0.50% (96 runs sampled) - -#4: function - current x 23,855,460 ops/sec ±0.60% (97 runs sampled) - lib-type-of x 5,667,740 ops/sec ±0.54% (100 runs sampled) - lib-typeof x 10,010,644 ops/sec ±0.44% (100 runs sampled) - -#5: null - current x 27,061,047 ops/sec ±0.97% (96 runs sampled) - lib-type-of x 13,965,573 ops/sec ±0.62% (97 runs sampled) - lib-typeof x 8,460,194 ops/sec ±0.61% (97 runs sampled) - -#6: number - current x 25,075,682 ops/sec ±0.53% (99 runs sampled) - lib-type-of x 2,266,405 ops/sec ±0.41% (98 runs sampled) - lib-typeof x 9,821,481 ops/sec ±0.45% (99 runs sampled) - -#7: object - current x 3,348,980 ops/sec ±0.49% (99 runs sampled) - lib-type-of x 3,245,138 ops/sec ±0.60% (94 runs sampled) - lib-typeof x 9,262,952 ops/sec ±0.59% (99 runs sampled) - -#8: regex - current x 21,284,827 ops/sec ±0.72% (96 runs sampled) - lib-type-of x 4,689,241 ops/sec ±0.43% (100 runs sampled) - lib-typeof x 8,957,593 ops/sec ±0.62% (98 runs sampled) - -#9: string - current x 25,379,234 ops/sec ±0.58% (96 runs sampled) - lib-type-of x 3,635,148 ops/sec ±0.76% (93 runs sampled) - lib-typeof x 9,494,134 ops/sec ±0.49% (98 runs sampled) - -#10: undef - current x 27,459,221 ops/sec ±1.01% (93 runs sampled) - lib-type-of x 14,360,433 ops/sec ±0.52% (99 runs sampled) - lib-typeof x 23,202,868 ops/sec ±0.59% (94 runs sampled) - -``` - -## Optimizations - -In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: - -1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. -2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. -3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` - -## About - -### Related projects - -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") -* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") -* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 59 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [miguelmota](https://github.com/miguelmota) | -| 1 | [dtothefp](https://github.com/dtothefp) | -| 1 | [ksheedlo](https://github.com/ksheedlo) | -| 1 | [pdehaan](https://github.com/pdehaan) | -| 1 | [laggingreflex](https://github.com/laggingreflex) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 16, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/index.js b/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/index.js deleted file mode 100644 index b52c2917f..000000000 --- a/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/index.js +++ /dev/null @@ -1,116 +0,0 @@ -var isBuffer = require('is-buffer'); -var toString = Object.prototype.toString; - -/** - * Get the native `typeof` a value. - * - * @param {*} `val` - * @return {*} Native javascript type - */ - -module.exports = function kindOf(val) { - // primitivies - if (typeof val === 'undefined') { - return 'undefined'; - } - if (val === null) { - return 'null'; - } - if (val === true || val === false || val instanceof Boolean) { - return 'boolean'; - } - if (typeof val === 'string' || val instanceof String) { - return 'string'; - } - if (typeof val === 'number' || val instanceof Number) { - return 'number'; - } - - // functions - if (typeof val === 'function' || val instanceof Function) { - return 'function'; - } - - // array - if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { - return 'array'; - } - - // check for instances of RegExp and Date before calling `toString` - if (val instanceof RegExp) { - return 'regexp'; - } - if (val instanceof Date) { - return 'date'; - } - - // other objects - var type = toString.call(val); - - if (type === '[object RegExp]') { - return 'regexp'; - } - if (type === '[object Date]') { - return 'date'; - } - if (type === '[object Arguments]') { - return 'arguments'; - } - if (type === '[object Error]') { - return 'error'; - } - - // buffer - if (isBuffer(val)) { - return 'buffer'; - } - - // es6: Map, WeakMap, Set, WeakSet - if (type === '[object Set]') { - return 'set'; - } - if (type === '[object WeakSet]') { - return 'weakset'; - } - if (type === '[object Map]') { - return 'map'; - } - if (type === '[object WeakMap]') { - return 'weakmap'; - } - if (type === '[object Symbol]') { - return 'symbol'; - } - - // typed arrays - if (type === '[object Int8Array]') { - return 'int8array'; - } - if (type === '[object Uint8Array]') { - return 'uint8array'; - } - if (type === '[object Uint8ClampedArray]') { - return 'uint8clampedarray'; - } - if (type === '[object Int16Array]') { - return 'int16array'; - } - if (type === '[object Uint16Array]') { - return 'uint16array'; - } - if (type === '[object Int32Array]') { - return 'int32array'; - } - if (type === '[object Uint32Array]') { - return 'uint32array'; - } - if (type === '[object Float32Array]') { - return 'float32array'; - } - if (type === '[object Float64Array]') { - return 'float64array'; - } - - // must be a plain object - return 'object'; -}; diff --git a/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/package.json b/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/package.json deleted file mode 100644 index c2712ca74..000000000 --- a/node_modules/readdirp/node_modules/is-number/node_modules/kind-of/package.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "_from": "kind-of@^3.0.2", - "_id": "kind-of@3.2.2", - "_inBundle": false, - "_integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "_location": "/readdirp/is-number/kind-of", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "kind-of@^3.0.2", - "name": "kind-of", - "escapedName": "kind-of", - "rawSpec": "^3.0.2", - "saveSpec": null, - "fetchSpec": "^3.0.2" - }, - "_requiredBy": [ - "/readdirp/is-number" - ], - "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "_shasum": "31ea21a734bab9bbb0f32466d893aea51e4a3c64", - "_spec": "kind-of@^3.0.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/is-number", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/kind-of/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "David Fox-Powell", - "url": "https://dtothefp.github.io/me" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Ken Sheedlo", - "url": "kensheedlo.com" - }, - { - "name": "laggingreflex", - "url": "https://github.com/laggingreflex" - }, - { - "name": "Miguel Mota", - "url": "https://miguelmota.com" - }, - { - "name": "Peter deHaan", - "url": "http://about.me/peterdehaan" - } - ], - "dependencies": { - "is-buffer": "^1.1.5" - }, - "deprecated": false, - "description": "Get the native type of a value.", - "devDependencies": { - "ansi-bold": "^0.1.1", - "benchmarked": "^1.0.0", - "browserify": "^14.3.0", - "glob": "^7.1.1", - "gulp-format-md": "^0.1.12", - "mocha": "^3.3.0", - "type-of": "^2.0.1", - "typeof": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/kind-of", - "keywords": [ - "arguments", - "array", - "boolean", - "check", - "date", - "function", - "is", - "is-type", - "is-type-of", - "kind", - "kind-of", - "number", - "object", - "of", - "regexp", - "string", - "test", - "type", - "type-of", - "typeof", - "types" - ], - "license": "MIT", - "main": "index.js", - "name": "kind-of", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/kind-of.git" - }, - "scripts": { - "prepublish": "browserify -o browser.js -e index.js -s index --bare", - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "is-glob", - "is-number", - "is-primitive" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "verb" - ] - }, - "version": "3.2.2" -} diff --git a/node_modules/readdirp/node_modules/is-number/package.json b/node_modules/readdirp/node_modules/is-number/package.json deleted file mode 100644 index 9a6bba5a9..000000000 --- a/node_modules/readdirp/node_modules/is-number/package.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "_from": "is-number@^3.0.0", - "_id": "is-number@3.0.0", - "_inBundle": false, - "_integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "_location": "/readdirp/is-number", - "_phantomChildren": { - "is-buffer": "1.1.6" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-number@^3.0.0", - "name": "is-number", - "escapedName": "is-number", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/readdirp/fill-range" - ], - "_resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "_shasum": "24fd6201a4782cf50561c810276afc7d12d71195", - "_spec": "is-number@^3.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/fill-range", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-number/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Charlike Mike Reagent", - "url": "http://www.tunnckocore.tk" - }, - { - "name": "Jon Schlinkert", - "email": "jon.schlinkert@sellside.com", - "url": "http://twitter.com/jonschlinkert" - } - ], - "dependencies": { - "kind-of": "^3.0.2" - }, - "deprecated": false, - "description": "Returns true if the value is a number. comprehensive tests.", - "devDependencies": { - "benchmarked": "^0.2.5", - "chalk": "^1.1.3", - "gulp-format-md": "^0.1.10", - "mocha": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-number", - "keywords": [ - "check", - "coerce", - "coercion", - "integer", - "is", - "is-nan", - "is-num", - "is-number", - "istype", - "kind", - "math", - "nan", - "num", - "number", - "numeric", - "test", - "type", - "typeof", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "is-number", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-number.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "even", - "is-even", - "is-odd", - "is-primitive", - "kind-of", - "odd" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "verb", - "verb-generate-readme" - ] - }, - "version": "3.0.0" -} diff --git a/node_modules/readdirp/node_modules/isobject/LICENSE b/node_modules/readdirp/node_modules/isobject/LICENSE deleted file mode 100644 index 943e71d05..000000000 --- a/node_modules/readdirp/node_modules/isobject/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert. - -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. \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/isobject/README.md b/node_modules/readdirp/node_modules/isobject/README.md deleted file mode 100644 index d01feaa40..000000000 --- a/node_modules/readdirp/node_modules/isobject/README.md +++ /dev/null @@ -1,122 +0,0 @@ -# isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM monthly downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![NPM total downloads](https://img.shields.io/npm/dt/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/isobject) - -> Returns true if the value is an object and not an array or null. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save isobject -``` - -Install with [yarn](https://yarnpkg.com): - -```sh -$ yarn add isobject -``` - -Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install isobject -``` -Install with [bower](https://bower.io/) - -```sh -$ bower install isobject -``` - -## Usage - -```js -var isObject = require('isobject'); -``` - -**True** - -All of the following return `true`: - -```js -isObject({}); -isObject(Object.create({})); -isObject(Object.create(Object.prototype)); -isObject(Object.create(null)); -isObject({}); -isObject(new Foo); -isObject(/foo/); -``` - -**False** - -All of the following return `false`: - -```js -isObject(); -isObject(function () {}); -isObject(1); -isObject([]); -isObject(undefined); -isObject(null); -``` - -## About - -### Related projects - -* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") -* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") -* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") -* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 29 | [jonschlinkert](https://github.com/jonschlinkert) | -| 4 | [doowb](https://github.com/doowb) | -| 1 | [magnudae](https://github.com/magnudae) | -| 1 | [LeSuisse](https://github.com/LeSuisse) | -| 1 | [tmcw](https://github.com/tmcw) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 30, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/isobject/index.d.ts b/node_modules/readdirp/node_modules/isobject/index.d.ts deleted file mode 100644 index 55f81c275..000000000 --- a/node_modules/readdirp/node_modules/isobject/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export = isObject; - -declare function isObject(val: any): boolean; - -declare namespace isObject {} diff --git a/node_modules/readdirp/node_modules/isobject/index.js b/node_modules/readdirp/node_modules/isobject/index.js deleted file mode 100644 index 2d59958bf..000000000 --- a/node_modules/readdirp/node_modules/isobject/index.js +++ /dev/null @@ -1,12 +0,0 @@ -/*! - * isobject - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -module.exports = function isObject(val) { - return val != null && typeof val === 'object' && Array.isArray(val) === false; -}; diff --git a/node_modules/readdirp/node_modules/isobject/package.json b/node_modules/readdirp/node_modules/isobject/package.json deleted file mode 100644 index 45d7a0490..000000000 --- a/node_modules/readdirp/node_modules/isobject/package.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "_from": "isobject@^3.0.1", - "_id": "isobject@3.0.1", - "_inBundle": false, - "_integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "_location": "/readdirp/isobject", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "isobject@^3.0.1", - "name": "isobject", - "escapedName": "isobject", - "rawSpec": "^3.0.1", - "saveSpec": null, - "fetchSpec": "^3.0.1" - }, - "_requiredBy": [ - "/readdirp/braces" - ], - "_resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "_shasum": "4e431e92b11a9731636aa1f9c8d1ccbcfdab78df", - "_spec": "isobject@^3.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/braces", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/isobject/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "url": "https://github.com/LeSuisse" - }, - { - "name": "Brian Woodward", - "url": "https://twitter.com/doowb" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Magnús Dæhlen", - "url": "https://github.com/magnudae" - }, - { - "name": "Tom MacWright", - "url": "https://macwright.org" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "Returns true if the value is an object and not an array or null.", - "devDependencies": { - "gulp-format-md": "^0.1.9", - "mocha": "^2.4.5" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.d.ts", - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/isobject", - "keywords": [ - "check", - "is", - "is-object", - "isobject", - "kind", - "kind-of", - "kindof", - "native", - "object", - "type", - "typeof", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "isobject", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/isobject.git" - }, - "scripts": { - "test": "mocha" - }, - "types": "index.d.ts", - "verb": { - "related": { - "list": [ - "extend-shallow", - "is-plain-object", - "kind-of", - "merge-deep" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "verb" - ] - }, - "version": "3.0.1" -} diff --git a/node_modules/readdirp/node_modules/kind-of/CHANGELOG.md b/node_modules/readdirp/node_modules/kind-of/CHANGELOG.md deleted file mode 100644 index fb30b06df..000000000 --- a/node_modules/readdirp/node_modules/kind-of/CHANGELOG.md +++ /dev/null @@ -1,157 +0,0 @@ -# Release history - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). - -
    - Guiding Principles - -- Changelogs are for humans, not machines. -- There should be an entry for every single version. -- The same types of changes should be grouped. -- Versions and sections should be linkable. -- The latest version comes first. -- The release date of each versions is displayed. -- Mention whether you follow Semantic Versioning. - -
    - -
    - Types of changes - -Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_): - -- `Added` for new features. -- `Changed` for changes in existing functionality. -- `Deprecated` for soon-to-be removed features. -- `Removed` for now removed features. -- `Fixed` for any bug fixes. -- `Security` in case of vulnerabilities. - -
    - -## [6.0.0] - 2017-10-13 - -- refactor code to be more performant -- refactor benchmarks - -## [5.1.0] - 2017-10-13 - -**Added** - -- Merge pull request #15 from aretecode/patch-1 -- adds support and tests for string & array iterators - -**Changed** - -- updates benchmarks - -## [5.0.2] - 2017-08-02 - -- Merge pull request #14 from struct78/master -- Added `undefined` check - -## [5.0.0] - 2017-06-21 - -- Merge pull request #12 from aretecode/iterator -- Set Iterator + Map Iterator -- streamline `isbuffer`, minor edits - -## [4.0.0] - 2017-05-19 - -- Merge pull request #8 from tunnckoCore/master -- update deps - -## [3.2.2] - 2017-05-16 - -- fix version - -## [3.2.1] - 2017-05-16 - -- add browserify - -## [3.2.0] - 2017-04-25 - -- Merge pull request #10 from ksheedlo/unrequire-buffer -- add `promise` support and tests -- Remove unnecessary `Buffer` check - -## [3.1.0] - 2016-12-07 - -- Merge pull request #7 from laggingreflex/err -- add support for `error` and tests -- run update - -## [3.0.4] - 2016-07-29 - -- move tests -- run update - -## [3.0.3] - 2016-05-03 - -- fix prepublish script -- remove unused dep - -## [3.0.0] - 2015-11-17 - -- add typed array support -- Merge pull request #5 from miguelmota/typed-arrays -- adds new tests - -## [2.0.1] - 2015-08-21 - -- use `is-buffer` module - -## [2.0.0] - 2015-05-31 - -- Create fallback for `Array.isArray` if used as a browser package -- Merge pull request #2 from dtothefp/patch-1 -- Merge pull request #3 from pdehaan/patch-1 -- Merge branch 'master' of https://github.com/chorks/kind-of into chorks-master -- optimizations, mostly date and regex - -## [1.1.0] - 2015-02-09 - -- adds `buffer` support -- adds tests for `buffer` - -## [1.0.0] - 2015-01-19 - -- update benchmarks -- optimizations based on benchmarks - -## [0.1.2] - 2014-10-26 - -- return `typeof` value if it's not an object. very slight speed improvement -- use `.slice` -- adds benchmarks - -## [0.1.0] - 2014-9-26 - -- first commit - -[6.0.0]: https://github.com/jonschlinkert/kind-of/compare/5.1.0...6.0.0 -[5.1.0]: https://github.com/jonschlinkert/kind-of/compare/5.0.2...5.1.0 -[5.0.2]: https://github.com/jonschlinkert/kind-of/compare/5.0.1...5.0.2 -[5.0.1]: https://github.com/jonschlinkert/kind-of/compare/5.0.0...5.0.1 -[5.0.0]: https://github.com/jonschlinkert/kind-of/compare/4.0.0...5.0.0 -[4.0.0]: https://github.com/jonschlinkert/kind-of/compare/3.2.2...4.0.0 -[3.2.2]: https://github.com/jonschlinkert/kind-of/compare/3.2.1...3.2.2 -[3.2.1]: https://github.com/jonschlinkert/kind-of/compare/3.2.0...3.2.1 -[3.2.0]: https://github.com/jonschlinkert/kind-of/compare/3.1.0...3.2.0 -[3.1.0]: https://github.com/jonschlinkert/kind-of/compare/3.0.4...3.1.0 -[3.0.4]: https://github.com/jonschlinkert/kind-of/compare/3.0.3...3.0.4 -[3.0.3]: https://github.com/jonschlinkert/kind-of/compare/3.0.0...3.0.3 -[3.0.0]: https://github.com/jonschlinkert/kind-of/compare/2.0.1...3.0.0 -[2.0.1]: https://github.com/jonschlinkert/kind-of/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/jonschlinkert/kind-of/compare/1.1.0...2.0.0 -[1.1.0]: https://github.com/jonschlinkert/kind-of/compare/1.0.0...1.1.0 -[1.0.0]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...1.0.0 -[0.1.2]: https://github.com/jonschlinkert/kind-of/compare/0.1.0...0.1.2 -[0.1.0]: https://github.com/jonschlinkert/kind-of/commit/2fae09b0b19b1aadb558e9be39f0c3ef6034eb87 - -[Unreleased]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...HEAD -[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog - diff --git a/node_modules/readdirp/node_modules/kind-of/LICENSE b/node_modules/readdirp/node_modules/kind-of/LICENSE deleted file mode 100644 index 3f2eca18f..000000000 --- a/node_modules/readdirp/node_modules/kind-of/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/kind-of/README.md b/node_modules/readdirp/node_modules/kind-of/README.md deleted file mode 100644 index 4b0d4a818..000000000 --- a/node_modules/readdirp/node_modules/kind-of/README.md +++ /dev/null @@ -1,365 +0,0 @@ -# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) - -> Get the native type of a value. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save kind-of -``` - -Install with [bower](https://bower.io/) - -```sh -$ bower install kind-of --save -``` - -## Why use this? - -1. [it's fast](#benchmarks) | [optimizations](#optimizations) -2. [better type checking](#better-type-checking) - -## Usage - -> es5, es6, and browser ready - -```js -var kindOf = require('kind-of'); - -kindOf(undefined); -//=> 'undefined' - -kindOf(null); -//=> 'null' - -kindOf(true); -//=> 'boolean' - -kindOf(false); -//=> 'boolean' - -kindOf(new Buffer('')); -//=> 'buffer' - -kindOf(42); -//=> 'number' - -kindOf('str'); -//=> 'string' - -kindOf(arguments); -//=> 'arguments' - -kindOf({}); -//=> 'object' - -kindOf(Object.create(null)); -//=> 'object' - -kindOf(new Test()); -//=> 'object' - -kindOf(new Date()); -//=> 'date' - -kindOf([1, 2, 3]); -//=> 'array' - -kindOf(/foo/); -//=> 'regexp' - -kindOf(new RegExp('foo')); -//=> 'regexp' - -kindOf(new Error('error')); -//=> 'error' - -kindOf(function () {}); -//=> 'function' - -kindOf(function * () {}); -//=> 'generatorfunction' - -kindOf(Symbol('str')); -//=> 'symbol' - -kindOf(new Map()); -//=> 'map' - -kindOf(new WeakMap()); -//=> 'weakmap' - -kindOf(new Set()); -//=> 'set' - -kindOf(new WeakSet()); -//=> 'weakset' - -kindOf(new Int8Array()); -//=> 'int8array' - -kindOf(new Uint8Array()); -//=> 'uint8array' - -kindOf(new Uint8ClampedArray()); -//=> 'uint8clampedarray' - -kindOf(new Int16Array()); -//=> 'int16array' - -kindOf(new Uint16Array()); -//=> 'uint16array' - -kindOf(new Int32Array()); -//=> 'int32array' - -kindOf(new Uint32Array()); -//=> 'uint32array' - -kindOf(new Float32Array()); -//=> 'float32array' - -kindOf(new Float64Array()); -//=> 'float64array' -``` - -## Benchmarks - -Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). - -```bash -# arguments (32 bytes) - kind-of x 17,024,098 ops/sec ±1.90% (86 runs sampled) - lib-type-of x 11,926,235 ops/sec ±1.34% (83 runs sampled) - lib-typeof x 9,245,257 ops/sec ±1.22% (87 runs sampled) - - fastest is kind-of (by 161% avg) - -# array (22 bytes) - kind-of x 17,196,492 ops/sec ±1.07% (88 runs sampled) - lib-type-of x 8,838,283 ops/sec ±1.02% (87 runs sampled) - lib-typeof x 8,677,848 ops/sec ±0.87% (87 runs sampled) - - fastest is kind-of (by 196% avg) - -# boolean (24 bytes) - kind-of x 16,841,600 ops/sec ±1.10% (86 runs sampled) - lib-type-of x 8,096,787 ops/sec ±0.95% (87 runs sampled) - lib-typeof x 8,423,345 ops/sec ±1.15% (86 runs sampled) - - fastest is kind-of (by 204% avg) - -# buffer (38 bytes) - kind-of x 14,848,060 ops/sec ±1.05% (86 runs sampled) - lib-type-of x 3,671,577 ops/sec ±1.49% (87 runs sampled) - lib-typeof x 8,360,236 ops/sec ±1.24% (86 runs sampled) - - fastest is kind-of (by 247% avg) - -# date (30 bytes) - kind-of x 16,067,761 ops/sec ±1.58% (86 runs sampled) - lib-type-of x 8,954,436 ops/sec ±1.40% (87 runs sampled) - lib-typeof x 8,488,307 ops/sec ±1.51% (84 runs sampled) - - fastest is kind-of (by 184% avg) - -# error (36 bytes) - kind-of x 9,634,090 ops/sec ±1.12% (89 runs sampled) - lib-type-of x 7,735,624 ops/sec ±1.32% (86 runs sampled) - lib-typeof x 7,442,160 ops/sec ±1.11% (90 runs sampled) - - fastest is kind-of (by 127% avg) - -# function (34 bytes) - kind-of x 10,031,494 ops/sec ±1.27% (86 runs sampled) - lib-type-of x 9,502,757 ops/sec ±1.17% (89 runs sampled) - lib-typeof x 8,278,985 ops/sec ±1.08% (88 runs sampled) - - fastest is kind-of (by 113% avg) - -# null (24 bytes) - kind-of x 18,159,808 ops/sec ±1.92% (86 runs sampled) - lib-type-of x 12,927,635 ops/sec ±1.01% (88 runs sampled) - lib-typeof x 7,958,234 ops/sec ±1.21% (89 runs sampled) - - fastest is kind-of (by 174% avg) - -# number (22 bytes) - kind-of x 17,846,779 ops/sec ±0.91% (85 runs sampled) - lib-type-of x 3,316,636 ops/sec ±1.19% (86 runs sampled) - lib-typeof x 2,329,477 ops/sec ±2.21% (85 runs sampled) - - fastest is kind-of (by 632% avg) - -# object-plain (47 bytes) - kind-of x 7,085,155 ops/sec ±1.05% (88 runs sampled) - lib-type-of x 8,870,930 ops/sec ±1.06% (83 runs sampled) - lib-typeof x 8,716,024 ops/sec ±1.05% (87 runs sampled) - - fastest is lib-type-of (by 112% avg) - -# regex (25 bytes) - kind-of x 14,196,052 ops/sec ±1.65% (84 runs sampled) - lib-type-of x 9,554,164 ops/sec ±1.25% (88 runs sampled) - lib-typeof x 8,359,691 ops/sec ±1.07% (87 runs sampled) - - fastest is kind-of (by 158% avg) - -# string (33 bytes) - kind-of x 16,131,428 ops/sec ±1.41% (85 runs sampled) - lib-type-of x 7,273,172 ops/sec ±1.05% (87 runs sampled) - lib-typeof x 7,382,635 ops/sec ±1.17% (85 runs sampled) - - fastest is kind-of (by 220% avg) - -# symbol (34 bytes) - kind-of x 17,011,537 ops/sec ±1.24% (86 runs sampled) - lib-type-of x 3,492,454 ops/sec ±1.23% (89 runs sampled) - lib-typeof x 7,471,235 ops/sec ±2.48% (87 runs sampled) - - fastest is kind-of (by 310% avg) - -# template-strings (36 bytes) - kind-of x 15,434,250 ops/sec ±1.46% (83 runs sampled) - lib-type-of x 7,157,907 ops/sec ±0.97% (87 runs sampled) - lib-typeof x 7,517,986 ops/sec ±0.92% (86 runs sampled) - - fastest is kind-of (by 210% avg) - -# undefined (29 bytes) - kind-of x 19,167,115 ops/sec ±1.71% (87 runs sampled) - lib-type-of x 15,477,740 ops/sec ±1.63% (85 runs sampled) - lib-typeof x 19,075,495 ops/sec ±1.17% (83 runs sampled) - - fastest is lib-typeof,kind-of - -``` - -## Optimizations - -In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: - -1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. -2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. -3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` -4. There is no reason to make the code in a microlib as terse as possible, just to win points for making it shorter. It's always better to favor performant code over terse code. You will always only be using a single `require()` statement to use the library anyway, regardless of how the code is written. - -## Better type checking - -kind-of seems to be more consistently "correct" than other type checking libs I've looked at. For example, here are some differing results from other popular libs: - -### [typeof](https://github.com/CodingFu/typeof) lib - -Incorrectly identifies instances of custom constructors (pretty common): - -```js -var typeOf = require('typeof'); -function Test() {} -console.log(typeOf(new Test())); -//=> 'test' -``` - -Returns `object` instead of `arguments`: - -```js -function foo() { - console.log(typeOf(arguments)) //=> 'object' -} -foo(); -``` - -### [type-of](https://github.com/ForbesLindesay/type-of) lib - -Incorrectly returns `object` for generator functions, buffers, `Map`, `Set`, `WeakMap` and `WeakSet`: - -```js -function * foo() {} -console.log(typeOf(foo)); -//=> 'object' -console.log(typeOf(new Buffer(''))); -//=> 'object' -console.log(typeOf(new Map())); -//=> 'object' -console.log(typeOf(new Set())); -//=> 'object' -console.log(typeOf(new WeakMap())); -//=> 'object' -console.log(typeOf(new WeakSet())); -//=> 'object' -``` - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    - -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") -* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") -* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 98 | [jonschlinkert](https://github.com/jonschlinkert) | -| 3 | [aretecode](https://github.com/aretecode) | -| 2 | [miguelmota](https://github.com/miguelmota) | -| 1 | [dtothefp](https://github.com/dtothefp) | -| 1 | [ianstormtaylor](https://github.com/ianstormtaylor) | -| 1 | [ksheedlo](https://github.com/ksheedlo) | -| 1 | [pdehaan](https://github.com/pdehaan) | -| 1 | [laggingreflex](https://github.com/laggingreflex) | -| 1 | [charlike-old](https://github.com/charlike-old) | - -### Author - -**Jon Schlinkert** - -* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on December 01, 2017._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/kind-of/index.js b/node_modules/readdirp/node_modules/kind-of/index.js deleted file mode 100644 index aa2bb3944..000000000 --- a/node_modules/readdirp/node_modules/kind-of/index.js +++ /dev/null @@ -1,129 +0,0 @@ -var toString = Object.prototype.toString; - -module.exports = function kindOf(val) { - if (val === void 0) return 'undefined'; - if (val === null) return 'null'; - - var type = typeof val; - if (type === 'boolean') return 'boolean'; - if (type === 'string') return 'string'; - if (type === 'number') return 'number'; - if (type === 'symbol') return 'symbol'; - if (type === 'function') { - return isGeneratorFn(val) ? 'generatorfunction' : 'function'; - } - - if (isArray(val)) return 'array'; - if (isBuffer(val)) return 'buffer'; - if (isArguments(val)) return 'arguments'; - if (isDate(val)) return 'date'; - if (isError(val)) return 'error'; - if (isRegexp(val)) return 'regexp'; - - switch (ctorName(val)) { - case 'Symbol': return 'symbol'; - case 'Promise': return 'promise'; - - // Set, Map, WeakSet, WeakMap - case 'WeakMap': return 'weakmap'; - case 'WeakSet': return 'weakset'; - case 'Map': return 'map'; - case 'Set': return 'set'; - - // 8-bit typed arrays - case 'Int8Array': return 'int8array'; - case 'Uint8Array': return 'uint8array'; - case 'Uint8ClampedArray': return 'uint8clampedarray'; - - // 16-bit typed arrays - case 'Int16Array': return 'int16array'; - case 'Uint16Array': return 'uint16array'; - - // 32-bit typed arrays - case 'Int32Array': return 'int32array'; - case 'Uint32Array': return 'uint32array'; - case 'Float32Array': return 'float32array'; - case 'Float64Array': return 'float64array'; - } - - if (isGeneratorObj(val)) { - return 'generator'; - } - - // Non-plain objects - type = toString.call(val); - switch (type) { - case '[object Object]': return 'object'; - // iterators - case '[object Map Iterator]': return 'mapiterator'; - case '[object Set Iterator]': return 'setiterator'; - case '[object String Iterator]': return 'stringiterator'; - case '[object Array Iterator]': return 'arrayiterator'; - } - - // other - return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); -}; - -function ctorName(val) { - return val.constructor ? val.constructor.name : null; -} - -function isArray(val) { - if (Array.isArray) return Array.isArray(val); - return val instanceof Array; -} - -function isError(val) { - return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'); -} - -function isDate(val) { - if (val instanceof Date) return true; - return typeof val.toDateString === 'function' - && typeof val.getDate === 'function' - && typeof val.setDate === 'function'; -} - -function isRegexp(val) { - if (val instanceof RegExp) return true; - return typeof val.flags === 'string' - && typeof val.ignoreCase === 'boolean' - && typeof val.multiline === 'boolean' - && typeof val.global === 'boolean'; -} - -function isGeneratorFn(name, val) { - return ctorName(name) === 'GeneratorFunction'; -} - -function isGeneratorObj(val) { - return typeof val.throw === 'function' - && typeof val.return === 'function' - && typeof val.next === 'function'; -} - -function isArguments(val) { - try { - if (typeof val.length === 'number' && typeof val.callee === 'function') { - return true; - } - } catch (err) { - if (err.message.indexOf('callee') !== -1) { - return true; - } - } - return false; -} - -/** - * If you need to support Safari 5-7 (8-10 yr-old browser), - * take a look at https://github.com/feross/is-buffer - */ - -function isBuffer(val) { - if (val.constructor && typeof val.constructor.isBuffer === 'function') { - return val.constructor.isBuffer(val); - } - return false; -} diff --git a/node_modules/readdirp/node_modules/kind-of/package.json b/node_modules/readdirp/node_modules/kind-of/package.json deleted file mode 100644 index f87fa5e46..000000000 --- a/node_modules/readdirp/node_modules/kind-of/package.json +++ /dev/null @@ -1,146 +0,0 @@ -{ - "_from": "kind-of@^6.0.2", - "_id": "kind-of@6.0.2", - "_inBundle": false, - "_integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "_location": "/readdirp/kind-of", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "kind-of@^6.0.2", - "name": "kind-of", - "escapedName": "kind-of", - "rawSpec": "^6.0.2", - "saveSpec": null, - "fetchSpec": "^6.0.2" - }, - "_requiredBy": [ - "/readdirp/is-accessor-descriptor", - "/readdirp/is-data-descriptor", - "/readdirp/is-descriptor", - "/readdirp/micromatch" - ], - "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "_shasum": "01146b36a6218e64e58f3a8d66de5d7fc6f6d051", - "_spec": "kind-of@^6.0.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/kind-of/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "David Fox-Powell", - "url": "https://dtothefp.github.io/me" - }, - { - "name": "James", - "url": "https://twitter.com/aretecode" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Ken Sheedlo", - "url": "kensheedlo.com" - }, - { - "name": "laggingreflex", - "url": "https://github.com/laggingreflex" - }, - { - "name": "Miguel Mota", - "url": "https://miguelmota.com" - }, - { - "name": "Peter deHaan", - "url": "http://about.me/peterdehaan" - }, - { - "name": "tunnckoCore", - "url": "https://i.am.charlike.online" - } - ], - "deprecated": false, - "description": "Get the native type of a value.", - "devDependencies": { - "benchmarked": "^2.0.0", - "browserify": "^14.4.0", - "gulp-format-md": "^1.0.0", - "mocha": "^4.0.1", - "write": "^1.0.3" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/kind-of", - "keywords": [ - "arguments", - "array", - "boolean", - "check", - "date", - "function", - "is", - "is-type", - "is-type-of", - "kind", - "kind-of", - "number", - "object", - "of", - "regexp", - "string", - "test", - "type", - "type-of", - "typeof", - "types" - ], - "license": "MIT", - "main": "index.js", - "name": "kind-of", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/kind-of.git" - }, - "scripts": { - "prepublish": "browserify -o browser.js -e index.js -s index --bare", - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "related": { - "list": [ - "is-glob", - "is-number", - "is-primitive" - ] - }, - "reflinks": [ - "type-of", - "typeof", - "verb" - ] - }, - "version": "6.0.2" -} diff --git a/node_modules/readdirp/node_modules/micromatch/CHANGELOG.md b/node_modules/readdirp/node_modules/micromatch/CHANGELOG.md deleted file mode 100644 index 9d8e5ed09..000000000 --- a/node_modules/readdirp/node_modules/micromatch/CHANGELOG.md +++ /dev/null @@ -1,37 +0,0 @@ -## History - -### key - -Changelog entries are classified using the following labels _(from [keep-a-changelog][]_): - -- `added`: for new features -- `changed`: for changes in existing functionality -- `deprecated`: for once-stable features removed in upcoming releases -- `removed`: for deprecated features removed in this release -- `fixed`: for any bug fixes -- `bumped`: updated dependencies, only minor or higher will be listed. - -### [3.0.0] - 2017-04-11 - -TODO. There should be no breaking changes. Please report any regressions. I will [reformat these release notes](https://github.com/micromatch/micromatch/pull/76) and add them to the changelog as soon as I have a chance. - -### [1.0.1] - 2016-12-12 - -**Added** - -- Support for windows path edge cases where backslashes are used in brackets or other unusual combinations. - -### [1.0.0] - 2016-12-12 - -Stable release. - -### [0.1.0] - 2016-10-08 - -First release. - - -[Unreleased]: https://github.com/jonschlinkert/micromatch/compare/0.1.0...HEAD -[0.2.0]: https://github.com/jonschlinkert/micromatch/compare/0.1.0...0.2.0 - -[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog - diff --git a/node_modules/readdirp/node_modules/micromatch/LICENSE b/node_modules/readdirp/node_modules/micromatch/LICENSE deleted file mode 100755 index d32ab4426..000000000 --- a/node_modules/readdirp/node_modules/micromatch/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2018, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/readdirp/node_modules/micromatch/README.md b/node_modules/readdirp/node_modules/micromatch/README.md deleted file mode 100644 index 5dfa1498a..000000000 --- a/node_modules/readdirp/node_modules/micromatch/README.md +++ /dev/null @@ -1,1150 +0,0 @@ -# micromatch [![NPM version](https://img.shields.io/npm/v/micromatch.svg?style=flat)](https://www.npmjs.com/package/micromatch) [![NPM monthly downloads](https://img.shields.io/npm/dm/micromatch.svg?style=flat)](https://npmjs.org/package/micromatch) [![NPM total downloads](https://img.shields.io/npm/dt/micromatch.svg?style=flat)](https://npmjs.org/package/micromatch) [![Linux Build Status](https://img.shields.io/travis/micromatch/micromatch.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/micromatch) [![Windows Build Status](https://img.shields.io/appveyor/ci/micromatch/micromatch.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/micromatch/micromatch) - -> Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Table of Contents - -
    -Details - -- [Install](#install) -- [Quickstart](#quickstart) -- [Why use micromatch?](#why-use-micromatch) - * [Matching features](#matching-features) -- [Switching to micromatch](#switching-to-micromatch) - * [From minimatch](#from-minimatch) - * [From multimatch](#from-multimatch) -- [API](#api) -- [Options](#options) - * [options.basename](#optionsbasename) - * [options.bash](#optionsbash) - * [options.cache](#optionscache) - * [options.dot](#optionsdot) - * [options.failglob](#optionsfailglob) - * [options.ignore](#optionsignore) - * [options.matchBase](#optionsmatchbase) - * [options.nobrace](#optionsnobrace) - * [options.nocase](#optionsnocase) - * [options.nodupes](#optionsnodupes) - * [options.noext](#optionsnoext) - * [options.nonegate](#optionsnonegate) - * [options.noglobstar](#optionsnoglobstar) - * [options.nonull](#optionsnonull) - * [options.nullglob](#optionsnullglob) - * [options.snapdragon](#optionssnapdragon) - * [options.sourcemap](#optionssourcemap) - * [options.unescape](#optionsunescape) - * [options.unixify](#optionsunixify) -- [Extended globbing](#extended-globbing) - * [extglobs](#extglobs) - * [braces](#braces) - * [regex character classes](#regex-character-classes) - * [regex groups](#regex-groups) - * [POSIX bracket expressions](#posix-bracket-expressions) -- [Notes](#notes) - * [Bash 4.3 parity](#bash-43-parity) - * [Backslashes](#backslashes) -- [Contributing](#contributing) -- [Benchmarks](#benchmarks) - * [Running benchmarks](#running-benchmarks) - * [Latest results](#latest-results) -- [About](#about) - -
    - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save micromatch -``` - -## Quickstart - -```js -var mm = require('micromatch'); -mm(list, patterns[, options]); -``` - -The [main export](#micromatch) takes a list of strings and one or more glob patterns: - -```js -console.log(mm(['foo', 'bar', 'qux'], ['f*', 'b*'])); -//=> ['foo', 'bar'] -``` - -Use [.isMatch()](#ismatch) to get true/false: - -```js -console.log(mm.isMatch('foo', 'f*')); -//=> true -``` - -[Switching](#switching-to-micromatch) from minimatch and multimatch is easy! - -## Why use micromatch? - -> micromatch is a [drop-in replacement](#switching-to-micromatch) for minimatch and multimatch - -* Supports all of the same matching features as [minimatch](https://github.com/isaacs/minimatch) and [multimatch](https://github.com/sindresorhus/multimatch) -* Micromatch uses [snapdragon](https://github.com/jonschlinkert/snapdragon) for parsing and compiling globs, which provides granular control over the entire conversion process in a way that is easy to understand, reason about, and maintain. -* More consistently accurate matching [than minimatch](https://github.com/yarnpkg/yarn/pull/3339), with more than 36,000 [test assertions](./test) to prove it. -* More complete support for the Bash 4.3 specification than minimatch and multimatch. In fact, micromatch passes _all of the spec tests_ from bash, including some that bash still fails. -* [Faster matching](#benchmarks), from a combination of optimized glob patterns, faster algorithms, and regex caching. -* [Micromatch is safer](https://github.com/micromatch/braces#braces-is-safe), and is not subject to DoS with brace patterns, like minimatch and multimatch. -* More reliable windows support than minimatch and multimatch. - -### Matching features - -* Support for multiple glob patterns (no need for wrappers like multimatch) -* Wildcards (`**`, `*.js`) -* Negation (`'!a/*.js'`, `'*!(b).js']`) -* [extglobs](https://github.com/micromatch/extglob) (`+(x|y)`, `!(a|b)`) -* [POSIX character classes](https://github.com/micromatch/expand-brackets) (`[[:alpha:][:digit:]]`) -* [brace expansion](https://github.com/micromatch/braces) (`foo/{1..5}.md`, `bar/{a,b,c}.js`) -* regex character classes (`foo-[1-5].js`) -* regex logical "or" (`foo/(abc|xyz).js`) - -You can mix and match these features to create whatever patterns you need! - -## Switching to micromatch - -There is one notable difference between micromatch and minimatch in regards to how backslashes are handled. See [the notes about backslashes](#backslashes) for more information. - -### From minimatch - -Use [mm.isMatch()](#ismatch) instead of `minimatch()`: - -```js -mm.isMatch('foo', 'b*'); -//=> false -``` - -Use [mm.match()](#match) instead of `minimatch.match()`: - -```js -mm.match(['foo', 'bar'], 'b*'); -//=> 'bar' -``` - -### From multimatch - -Same signature: - -```js -mm(['foo', 'bar', 'baz'], ['f*', '*z']); -//=> ['foo', 'baz'] -``` - -## API - -### [micromatch](index.js#L41) - -The main function takes a list of strings and one or more glob patterns to use for matching. - -**Params** - -* `list` **{Array}**: A list of strings to match -* `patterns` **{String|Array}**: One or more glob patterns to use for matching. -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Array}**: Returns an array of matches - -**Example** - -```js -var mm = require('micromatch'); -mm(list, patterns[, options]); - -console.log(mm(['a.js', 'a.txt'], ['*.js'])); -//=> [ 'a.js' ] -``` - -### [.match](index.js#L93) - -Similar to the main function, but `pattern` must be a string. - -**Params** - -* `list` **{Array}**: Array of strings to match -* `pattern` **{String}**: Glob pattern to use for matching. -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Array}**: Returns an array of matches - -**Example** - -```js -var mm = require('micromatch'); -mm.match(list, pattern[, options]); - -console.log(mm.match(['a.a', 'a.aa', 'a.b', 'a.c'], '*.a')); -//=> ['a.a', 'a.aa'] -``` - -### [.isMatch](index.js#L154) - -Returns true if the specified `string` matches the given glob `pattern`. - -**Params** - -* `string` **{String}**: String to match -* `pattern` **{String}**: Glob pattern to use for matching. -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Boolean}**: Returns true if the string matches the glob pattern. - -**Example** - -```js -var mm = require('micromatch'); -mm.isMatch(string, pattern[, options]); - -console.log(mm.isMatch('a.a', '*.a')); -//=> true -console.log(mm.isMatch('a.b', '*.a')); -//=> false -``` - -### [.some](index.js#L192) - -Returns true if some of the strings in the given `list` match any of the given glob `patterns`. - -**Params** - -* `list` **{String|Array}**: The string or array of strings to test. Returns as soon as the first match is found. -* `patterns` **{String|Array}**: One or more glob patterns to use for matching. -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Boolean}**: Returns true if any patterns match `str` - -**Example** - -```js -var mm = require('micromatch'); -mm.some(list, patterns[, options]); - -console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); -// true -console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); -// false -``` - -### [.every](index.js#L228) - -Returns true if every string in the given `list` matches any of the given glob `patterns`. - -**Params** - -* `list` **{String|Array}**: The string or array of strings to test. -* `patterns` **{String|Array}**: One or more glob patterns to use for matching. -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Boolean}**: Returns true if any patterns match `str` - -**Example** - -```js -var mm = require('micromatch'); -mm.every(list, patterns[, options]); - -console.log(mm.every('foo.js', ['foo.js'])); -// true -console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); -// true -console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); -// false -console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); -// false -``` - -### [.any](index.js#L260) - -Returns true if **any** of the given glob `patterns` match the specified `string`. - -**Params** - -* `str` **{String|Array}**: The string to test. -* `patterns` **{String|Array}**: One or more glob patterns to use for matching. -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Boolean}**: Returns true if any patterns match `str` - -**Example** - -```js -var mm = require('micromatch'); -mm.any(string, patterns[, options]); - -console.log(mm.any('a.a', ['b.*', '*.a'])); -//=> true -console.log(mm.any('a.a', 'b.*')); -//=> false -``` - -### [.all](index.js#L308) - -Returns true if **all** of the given `patterns` match the specified string. - -**Params** - -* `str` **{String|Array}**: The string to test. -* `patterns` **{String|Array}**: One or more glob patterns to use for matching. -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Boolean}**: Returns true if any patterns match `str` - -**Example** - -```js -var mm = require('micromatch'); -mm.all(string, patterns[, options]); - -console.log(mm.all('foo.js', ['foo.js'])); -// true - -console.log(mm.all('foo.js', ['*.js', '!foo.js'])); -// false - -console.log(mm.all('foo.js', ['*.js', 'foo.js'])); -// true - -console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); -// true -``` - -### [.not](index.js#L340) - -Returns a list of strings that _**do not match any**_ of the given `patterns`. - -**Params** - -* `list` **{Array}**: Array of strings to match. -* `patterns` **{String|Array}**: One or more glob pattern to use for matching. -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Array}**: Returns an array of strings that **do not match** the given patterns. - -**Example** - -```js -var mm = require('micromatch'); -mm.not(list, patterns[, options]); - -console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a')); -//=> ['b.b', 'c.c'] -``` - -### [.contains](index.js#L376) - -Returns true if the given `string` contains the given pattern. Similar to [.isMatch](#isMatch) but the pattern can match any part of the string. - -**Params** - -* `str` **{String}**: The string to match. -* `patterns` **{String|Array}**: Glob pattern to use for matching. -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Boolean}**: Returns true if the patter matches any part of `str`. - -**Example** - -```js -var mm = require('micromatch'); -mm.contains(string, pattern[, options]); - -console.log(mm.contains('aa/bb/cc', '*b')); -//=> true -console.log(mm.contains('aa/bb/cc', '*d')); -//=> false -``` - -### [.matchKeys](index.js#L432) - -Filter the keys of the given object with the given `glob` pattern and `options`. Does not attempt to match nested keys. If you need this feature, use [glob-object](https://github.com/jonschlinkert/glob-object) instead. - -**Params** - -* `object` **{Object}**: The object with keys to filter. -* `patterns` **{String|Array}**: One or more glob patterns to use for matching. -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Object}**: Returns an object with only keys that match the given patterns. - -**Example** - -```js -var mm = require('micromatch'); -mm.matchKeys(object, patterns[, options]); - -var obj = { aa: 'a', ab: 'b', ac: 'c' }; -console.log(mm.matchKeys(obj, '*b')); -//=> { ab: 'b' } -``` - -### [.matcher](index.js#L461) - -Returns a memoized matcher function from the given glob `pattern` and `options`. The returned function takes a string to match as its only argument and returns true if the string is a match. - -**Params** - -* `pattern` **{String}**: Glob pattern -* `options` **{Object}**: See available [options](#options) for changing how matches are performed. -* `returns` **{Function}**: Returns a matcher function. - -**Example** - -```js -var mm = require('micromatch'); -mm.matcher(pattern[, options]); - -var isMatch = mm.matcher('*.!(*a)'); -console.log(isMatch('a.a')); -//=> false -console.log(isMatch('a.b')); -//=> true -``` - -### [.capture](index.js#L536) - -Returns an array of matches captured by `pattern` in `string, or`null` if the pattern did not match. - -**Params** - -* `pattern` **{String}**: Glob pattern to use for matching. -* `string` **{String}**: String to match -* `options` **{Object}**: See available [options](#options) for changing how matches are performed -* `returns` **{Boolean}**: Returns an array of captures if the string matches the glob pattern, otherwise `null`. - -**Example** - -```js -var mm = require('micromatch'); -mm.capture(pattern, string[, options]); - -console.log(mm.capture('test/*.js', 'test/foo.js')); -//=> ['foo'] -console.log(mm.capture('test/*.js', 'foo/bar.css')); -//=> null -``` - -### [.makeRe](index.js#L571) - -Create a regular expression from the given glob `pattern`. - -**Params** - -* `pattern` **{String}**: A glob pattern to convert to regex. -* `options` **{Object}**: See available [options](#options) for changing how matches are performed. -* `returns` **{RegExp}**: Returns a regex created from the given pattern. - -**Example** - -```js -var mm = require('micromatch'); -mm.makeRe(pattern[, options]); - -console.log(mm.makeRe('*.js')); -//=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ -``` - -### [.braces](index.js#L618) - -Expand the given brace `pattern`. - -**Params** - -* `pattern` **{String}**: String with brace pattern to expand. -* `options` **{Object}**: Any [options](#options) to change how expansion is performed. See the [braces](https://github.com/micromatch/braces) library for all available options. -* `returns` **{Array}** - -**Example** - -```js -var mm = require('micromatch'); -console.log(mm.braces('foo/{a,b}/bar')); -//=> ['foo/(a|b)/bar'] - -console.log(mm.braces('foo/{a,b}/bar', {expand: true})); -//=> ['foo/(a|b)/bar'] -``` - -### [.create](index.js#L685) - -Parses the given glob `pattern` and returns an array of abstract syntax trees (ASTs), with the compiled `output` and optional source `map` on each AST. - -**Params** - -* `pattern` **{String}**: Glob pattern to parse and compile. -* `options` **{Object}**: Any [options](#options) to change how parsing and compiling is performed. -* `returns` **{Object}**: Returns an object with the parsed AST, compiled string and optional source map. - -**Example** - -```js -var mm = require('micromatch'); -mm.create(pattern[, options]); - -console.log(mm.create('abc/*.js')); -// [{ options: { source: 'string', sourcemap: true }, -// state: {}, -// compilers: -// { ... }, -// output: '(\\.[\\\\\\/])?abc\\/(?!\\.)(?=.)[^\\/]*?\\.js', -// ast: -// { type: 'root', -// errors: [], -// nodes: -// [ ... ], -// dot: false, -// input: 'abc/*.js' }, -// parsingErrors: [], -// map: -// { version: 3, -// sources: [ 'string' ], -// names: [], -// mappings: 'AAAA,GAAG,EAAC,kBAAC,EAAC,EAAE', -// sourcesContent: [ 'abc/*.js' ] }, -// position: { line: 1, column: 28 }, -// content: {}, -// files: {}, -// idx: 6 }] -``` - -### [.parse](index.js#L732) - -Parse the given `str` with the given `options`. - -**Params** - -* `str` **{String}** -* `options` **{Object}** -* `returns` **{Object}**: Returns an AST - -**Example** - -```js -var mm = require('micromatch'); -mm.parse(pattern[, options]); - -var ast = mm.parse('a/{b,c}/d'); -console.log(ast); -// { type: 'root', -// errors: [], -// input: 'a/{b,c}/d', -// nodes: -// [ { type: 'bos', val: '' }, -// { type: 'text', val: 'a/' }, -// { type: 'brace', -// nodes: -// [ { type: 'brace.open', val: '{' }, -// { type: 'text', val: 'b,c' }, -// { type: 'brace.close', val: '}' } ] }, -// { type: 'text', val: '/d' }, -// { type: 'eos', val: '' } ] } -``` - -### [.compile](index.js#L780) - -Compile the given `ast` or string with the given `options`. - -**Params** - -* `ast` **{Object|String}** -* `options` **{Object}** -* `returns` **{Object}**: Returns an object that has an `output` property with the compiled string. - -**Example** - -```js -var mm = require('micromatch'); -mm.compile(ast[, options]); - -var ast = mm.parse('a/{b,c}/d'); -console.log(mm.compile(ast)); -// { options: { source: 'string' }, -// state: {}, -// compilers: -// { eos: [Function], -// noop: [Function], -// bos: [Function], -// brace: [Function], -// 'brace.open': [Function], -// text: [Function], -// 'brace.close': [Function] }, -// output: [ 'a/(b|c)/d' ], -// ast: -// { ... }, -// parsingErrors: [] } -``` - -### [.clearCache](index.js#L801) - -Clear the regex cache. - -**Example** - -```js -mm.clearCache(); -``` - -## Options - -* [basename](#optionsbasename) -* [bash](#optionsbash) -* [cache](#optionscache) -* [dot](#optionsdot) -* [failglob](#optionsfailglob) -* [ignore](#optionsignore) -* [matchBase](#optionsmatchBase) -* [nobrace](#optionsnobrace) -* [nocase](#optionsnocase) -* [nodupes](#optionsnodupes) -* [noext](#optionsnoext) -* [noglobstar](#optionsnoglobstar) -* [nonull](#optionsnonull) -* [nullglob](#optionsnullglob) -* [snapdragon](#optionssnapdragon) -* [sourcemap](#optionssourcemap) -* [unescape](#optionsunescape) -* [unixify](#optionsunixify) - -### options.basename - -Allow glob patterns without slashes to match a file path based on its basename. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `matchBase`. - -**Type**: `Boolean` - -**Default**: `false` - -**Example** - -```js -mm(['a/b.js', 'a/c.md'], '*.js'); -//=> [] - -mm(['a/b.js', 'a/c.md'], '*.js', {matchBase: true}); -//=> ['a/b.js'] -``` - -### options.bash - -Enabled by default, this option enforces bash-like behavior with stars immediately following a bracket expression. Bash bracket expressions are similar to regex character classes, but unlike regex, a star following a bracket expression **does not repeat the bracketed characters**. Instead, the star is treated the same as an other star. - -**Type**: `Boolean` - -**Default**: `true` - -**Example** - -```js -var files = ['abc', 'ajz']; -console.log(mm(files, '[a-c]*')); -//=> ['abc', 'ajz'] - -console.log(mm(files, '[a-c]*', {bash: false})); -``` - -### options.cache - -Disable regex and function memoization. - -**Type**: `Boolean` - -**Default**: `undefined` - -### options.dot - -Match dotfiles. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `dot`. - -**Type**: `Boolean` - -**Default**: `false` - -### options.failglob - -Similar to the `--failglob` behavior in Bash, throws an error when no matches are found. - -**Type**: `Boolean` - -**Default**: `undefined` - -### options.ignore - -String or array of glob patterns to match files to ignore. - -**Type**: `String|Array` - -**Default**: `undefined` - -### options.matchBase - -Alias for [options.basename](#options-basename). - -### options.nobrace - -Disable expansion of brace patterns. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `nobrace`. - -**Type**: `Boolean` - -**Default**: `undefined` - -See [braces](https://github.com/micromatch/braces) for more information about extended brace expansion. - -### options.nocase - -Use a case-insensitive regex for matching files. Same behavior as [minimatch](https://github.com/isaacs/minimatch). - -**Type**: `Boolean` - -**Default**: `undefined` - -### options.nodupes - -Remove duplicate elements from the result array. - -**Type**: `Boolean` - -**Default**: `undefined` - -**Example** - -Example of using the `unescape` and `nodupes` options together: - -```js -mm.match(['a/b/c', 'a/b/c'], 'a/b/c'); -//=> ['a/b/c', 'a/b/c'] - -mm.match(['a/b/c', 'a/b/c'], 'a/b/c', {nodupes: true}); -//=> ['abc'] -``` - -### options.noext - -Disable extglob support, so that extglobs are regarded as literal characters. - -**Type**: `Boolean` - -**Default**: `undefined` - -**Examples** - -```js -mm(['a/z', 'a/b', 'a/!(z)'], 'a/!(z)'); -//=> ['a/b', 'a/!(z)'] - -mm(['a/z', 'a/b', 'a/!(z)'], 'a/!(z)', {noext: true}); -//=> ['a/!(z)'] (matches only as literal characters) -``` - -### options.nonegate - -Disallow negation (`!`) patterns, and treat leading `!` as a literal character to match. - -**Type**: `Boolean` - -**Default**: `undefined` - -### options.noglobstar - -Disable matching with globstars (`**`). - -**Type**: `Boolean` - -**Default**: `undefined` - -```js -mm(['a/b', 'a/b/c', 'a/b/c/d'], 'a/**'); -//=> ['a/b', 'a/b/c', 'a/b/c/d'] - -mm(['a/b', 'a/b/c', 'a/b/c/d'], 'a/**', {noglobstar: true}); -//=> ['a/b'] -``` - -### options.nonull - -Alias for [options.nullglob](#options-nullglob). - -### options.nullglob - -If `true`, when no matches are found the actual (arrayified) glob pattern is returned instead of an empty array. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `nonull`. - -**Type**: `Boolean` - -**Default**: `undefined` - -### options.snapdragon - -Pass your own instance of [snapdragon](https://github.com/jonschlinkert/snapdragon), to customize parsers or compilers. - -**Type**: `Object` - -**Default**: `undefined` - -### options.sourcemap - -Generate a source map by enabling the `sourcemap` option with the `.parse`, `.compile`, or `.create` methods. - -_(Note that sourcemaps are currently not enabled for brace patterns)_ - -**Examples** - -``` js -var mm = require('micromatch'); -var pattern = '*(*(of*(a)x)z)'; - -var res = mm.create('abc/*.js', {sourcemap: true}); -console.log(res.map); -// { version: 3, -// sources: [ 'string' ], -// names: [], -// mappings: 'AAAA,GAAG,EAAC,iBAAC,EAAC,EAAE', -// sourcesContent: [ 'abc/*.js' ] } - -var ast = mm.parse('abc/**/*.js'); -var res = mm.compile(ast, {sourcemap: true}); -console.log(res.map); -// { version: 3, -// sources: [ 'string' ], -// names: [], -// mappings: 'AAAA,GAAG,EAAC,2BAAE,EAAC,iBAAC,EAAC,EAAE', -// sourcesContent: [ 'abc/**/*.js' ] } - -var ast = mm.parse(pattern); -var res = mm.compile(ast, {sourcemap: true}); -console.log(res.map); -// { version: 3, -// sources: [ 'string' ], -// names: [], -// mappings: 'AAAA,CAAE,CAAE,EAAE,CAAE,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC', -// sourcesContent: [ '*(*(of*(a)x)z)' ] } -``` - -### options.unescape - -Remove backslashes from returned matches. - -**Type**: `Boolean` - -**Default**: `undefined` - -**Example** - -In this example we want to match a literal `*`: - -```js -mm.match(['abc', 'a\\*c'], 'a\\*c'); -//=> ['a\\*c'] - -mm.match(['abc', 'a\\*c'], 'a\\*c', {unescape: true}); -//=> ['a*c'] -``` - -### options.unixify - -Convert path separators on returned files to posix/unix-style forward slashes. - -**Type**: `Boolean` - -**Default**: `true` on windows, `false` everywhere else - -**Example** - -```js -mm.match(['a\\b\\c'], 'a/**'); -//=> ['a/b/c'] - -mm.match(['a\\b\\c'], {unixify: false}); -//=> ['a\\b\\c'] -``` - -## Extended globbing - -Micromatch also supports extended globbing features. - -### extglobs - -Extended globbing, as described by the bash man page: - -| **pattern** | **regex equivalent** | **description** | -| --- | --- | --- | -| `?(pattern)` | `(pattern)?` | Matches zero or one occurrence of the given patterns | -| `*(pattern)` | `(pattern)*` | Matches zero or more occurrences of the given patterns | -| `+(pattern)` | `(pattern)+` | Matches one or more occurrences of the given patterns | -| `@(pattern)` | `(pattern)` * | Matches one of the given patterns | -| `!(pattern)` | N/A (equivalent regex is much more complicated) | Matches anything except one of the given patterns | - -* Note that `@` isn't a RegEx character. - -Powered by [extglob](https://github.com/micromatch/extglob). Visit that library for the full range of options or to report extglob related issues. - -### braces - -Brace patterns can be used to match specific ranges or sets of characters. For example, the pattern `*/{1..3}/*` would match any of following strings: - -``` -foo/1/bar -foo/2/bar -foo/3/bar -baz/1/qux -baz/2/qux -baz/3/qux -``` - -Visit [braces](https://github.com/micromatch/braces) to see the full range of features and options related to brace expansion, or to create brace matching or expansion related issues. - -### regex character classes - -Given the list: `['a.js', 'b.js', 'c.js', 'd.js', 'E.js']`: - -* `[ac].js`: matches both `a` and `c`, returning `['a.js', 'c.js']` -* `[b-d].js`: matches from `b` to `d`, returning `['b.js', 'c.js', 'd.js']` -* `[b-d].js`: matches from `b` to `d`, returning `['b.js', 'c.js', 'd.js']` -* `a/[A-Z].js`: matches and uppercase letter, returning `['a/E.md']` - -Learn about [regex character classes](http://www.regular-expressions.info/charclass.html). - -### regex groups - -Given `['a.js', 'b.js', 'c.js', 'd.js', 'E.js']`: - -* `(a|c).js`: would match either `a` or `c`, returning `['a.js', 'c.js']` -* `(b|d).js`: would match either `b` or `d`, returning `['b.js', 'd.js']` -* `(b|[A-Z]).js`: would match either `b` or an uppercase letter, returning `['b.js', 'E.js']` - -As with regex, parens can be nested, so patterns like `((a|b)|c)/b` will work. Although brace expansion might be friendlier to use, depending on preference. - -### POSIX bracket expressions - -POSIX brackets are intended to be more user-friendly than regex character classes. This of course is in the eye of the beholder. - -**Example** - -```js -mm.isMatch('a1', '[[:alpha:][:digit:]]'); -//=> true - -mm.isMatch('a1', '[[:alpha:][:alpha:]]'); -//=> false -``` - -See [expand-brackets](https://github.com/jonschlinkert/expand-brackets) for more information about bracket expressions. - -*** - -## Notes - -### Bash 4.3 parity - -Whenever possible matching behavior is based on behavior Bash 4.3, which is mostly consistent with minimatch. - -However, it's suprising how many edge cases and rabbit holes there are with glob matching, and since there is no real glob specification, and micromatch is more accurate than both Bash and minimatch, there are cases where best-guesses were made for behavior. In a few cases where Bash had no answers, we used wildmatch (used by git) as a fallback. - -### Backslashes - -There is an important, notable difference between minimatch and micromatch _in regards to how backslashes are handled_ in glob patterns. - -* Micromatch exclusively and explicitly reserves backslashes for escaping characters in a glob pattern, even on windows. This is consistent with bash behavior. -* Minimatch converts all backslashes to forward slashes, which means you can't use backslashes to escape any characters in your glob patterns. - -We made this decision for micromatch for a couple of reasons: - -* consistency with bash conventions. -* glob patterns are not filepaths. They are a type of [regular language](https://en.wikipedia.org/wiki/Regular_language) that is converted to a JavaScript regular expression. Thus, when forward slashes are defined in a glob pattern, the resulting regular expression will match windows or POSIX path separators just fine. - -**A note about joining paths to globs** - -Note that when you pass something like `path.join('foo', '*')` to micromatch, you are creating a filepath and expecting it to still work as a glob pattern. This causes problems on windows, since the `path.sep` is `\\`. - -In other words, since `\\` is reserved as an escape character in globs, on windows `path.join('foo', '*')` would result in `foo\\*`, which tells micromatch to match `*` as a literal character. This is the same behavior as bash. - -## Contributing - -All contributions are welcome! Please read [the contributing guide](.github/contributing.md) to get started. - -**Bug reports** - -Please create an issue if you encounter a bug or matching behavior that doesn't seem correct. If you find a matching-related issue, please: - -* [research existing issues first](../../issues) (open and closed) -* visit the [GNU Bash documentation](https://www.gnu.org/software/bash/manual/) to see how Bash deals with the pattern -* visit the [minimatch](https://github.com/isaacs/minimatch) documentation to cross-check expected behavior in node.js -* if all else fails, since there is no real specification for globs we will probably need to discuss expected behavior and decide how to resolve it. which means any detail you can provide to help with this discussion would be greatly appreciated. - -**Platform issues** - -It's important to us that micromatch work consistently on all platforms. If you encounter any platform-specific matching or path related issues, please let us know (pull requests are also greatly appreciated). - -## Benchmarks - -### Running benchmarks - -Install dev dependencies: - -```bash -npm i -d && npm run benchmark -``` - -### Latest results - -As of February 18, 2018 (longer bars are better): - -```sh -# braces-globstar-large-list (485691 bytes) - micromatch ██████████████████████████████████████████████████ (517 ops/sec ±0.49%) - minimatch █ (18.92 ops/sec ±0.54%) - multimatch █ (18.94 ops/sec ±0.62%) - - micromatch is faster by an avg. of 2,733% - -# braces-multiple (3362 bytes) - micromatch ██████████████████████████████████████████████████ (33,625 ops/sec ±0.45%) - minimatch (2.92 ops/sec ±3.26%) - multimatch (2.90 ops/sec ±2.76%) - - micromatch is faster by an avg. of 1,156,935% - -# braces-range (727 bytes) - micromatch █████████████████████████████████████████████████ (155,220 ops/sec ±0.56%) - minimatch ██████ (20,186 ops/sec ±1.27%) - multimatch ██████ (19,809 ops/sec ±0.60%) - - micromatch is faster by an avg. of 776% - -# braces-set (2858 bytes) - micromatch █████████████████████████████████████████████████ (24,354 ops/sec ±0.92%) - minimatch █████ (2,566 ops/sec ±0.56%) - multimatch ████ (2,431 ops/sec ±1.25%) - - micromatch is faster by an avg. of 975% - -# globstar-large-list (485686 bytes) - micromatch █████████████████████████████████████████████████ (504 ops/sec ±0.45%) - minimatch ███ (33.36 ops/sec ±1.08%) - multimatch ███ (33.19 ops/sec ±1.35%) - - micromatch is faster by an avg. of 1,514% - -# globstar-long-list (90647 bytes) - micromatch ██████████████████████████████████████████████████ (2,694 ops/sec ±1.08%) - minimatch ████████████████ (870 ops/sec ±1.09%) - multimatch ████████████████ (862 ops/sec ±0.84%) - - micromatch is faster by an avg. of 311% - -# globstar-short-list (182 bytes) - micromatch ██████████████████████████████████████████████████ (328,921 ops/sec ±1.06%) - minimatch █████████ (64,808 ops/sec ±1.42%) - multimatch ████████ (57,991 ops/sec ±2.11%) - - micromatch is faster by an avg. of 536% - -# no-glob (701 bytes) - micromatch █████████████████████████████████████████████████ (415,935 ops/sec ±0.36%) - minimatch ███████████ (92,730 ops/sec ±1.44%) - multimatch █████████ (81,958 ops/sec ±2.13%) - - micromatch is faster by an avg. of 476% - -# star-basename-long (12339 bytes) - micromatch █████████████████████████████████████████████████ (7,963 ops/sec ±0.36%) - minimatch ███████████████████████████████ (5,072 ops/sec ±0.83%) - multimatch ███████████████████████████████ (5,028 ops/sec ±0.40%) - - micromatch is faster by an avg. of 158% - -# star-basename-short (349 bytes) - micromatch ██████████████████████████████████████████████████ (269,552 ops/sec ±0.70%) - minimatch ██████████████████████ (122,457 ops/sec ±1.39%) - multimatch ████████████████████ (110,788 ops/sec ±1.99%) - - micromatch is faster by an avg. of 231% - -# star-folder-long (19207 bytes) - micromatch █████████████████████████████████████████████████ (3,806 ops/sec ±0.38%) - minimatch ████████████████████████████ (2,204 ops/sec ±0.32%) - multimatch ██████████████████████████ (2,020 ops/sec ±1.07%) - - micromatch is faster by an avg. of 180% - -# star-folder-short (551 bytes) - micromatch ██████████████████████████████████████████████████ (249,077 ops/sec ±0.40%) - minimatch ███████████ (59,431 ops/sec ±1.67%) - multimatch ███████████ (55,569 ops/sec ±1.43%) - - micromatch is faster by an avg. of 433% -``` - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards. - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    - -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [braces](https://www.npmjs.com/package/braces): Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support… [more](https://github.com/micromatch/braces) | [homepage](https://github.com/micromatch/braces "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.") -* [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/jonschlinkert/expand-brackets "Expand POSIX bracket expressions (character classes) in glob patterns.") -* [extglob](https://www.npmjs.com/package/extglob): Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob… [more](https://github.com/micromatch/extglob) | [homepage](https://github.com/micromatch/extglob "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.") -* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or `step` to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`") -* [nanomatch](https://www.npmjs.com/package/nanomatch): Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash… [more](https://github.com/micromatch/nanomatch) | [homepage](https://github.com/micromatch/nanomatch "Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces)") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 457 | [jonschlinkert](https://github.com/jonschlinkert) | -| 12 | [es128](https://github.com/es128) | -| 8 | [doowb](https://github.com/doowb) | -| 3 | [paulmillr](https://github.com/paulmillr) | -| 2 | [TrySound](https://github.com/TrySound) | -| 2 | [MartinKolarik](https://github.com/MartinKolarik) | -| 2 | [charlike-old](https://github.com/charlike-old) | -| 1 | [amilajack](https://github.com/amilajack) | -| 1 | [mrmlnc](https://github.com/mrmlnc) | -| 1 | [devongovett](https://github.com/devongovett) | -| 1 | [DianeLooney](https://github.com/DianeLooney) | -| 1 | [UltCombo](https://github.com/UltCombo) | -| 1 | [tomByrer](https://github.com/tomByrer) | -| 1 | [fidian](https://github.com/fidian) | - -### Author - -**Jon Schlinkert** - -* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on February 18, 2018._ \ No newline at end of file diff --git a/node_modules/readdirp/node_modules/micromatch/index.js b/node_modules/readdirp/node_modules/micromatch/index.js deleted file mode 100644 index fe02f2cb2..000000000 --- a/node_modules/readdirp/node_modules/micromatch/index.js +++ /dev/null @@ -1,877 +0,0 @@ -'use strict'; - -/** - * Module dependencies - */ - -var util = require('util'); -var braces = require('braces'); -var toRegex = require('to-regex'); -var extend = require('extend-shallow'); - -/** - * Local dependencies - */ - -var compilers = require('./lib/compilers'); -var parsers = require('./lib/parsers'); -var cache = require('./lib/cache'); -var utils = require('./lib/utils'); -var MAX_LENGTH = 1024 * 64; - -/** - * The main function takes a list of strings and one or more - * glob patterns to use for matching. - * - * ```js - * var mm = require('micromatch'); - * mm(list, patterns[, options]); - * - * console.log(mm(['a.js', 'a.txt'], ['*.js'])); - * //=> [ 'a.js' ] - * ``` - * @param {Array} `list` A list of strings to match - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Array} Returns an array of matches - * @summary false - * @api public - */ - -function micromatch(list, patterns, options) { - patterns = utils.arrayify(patterns); - list = utils.arrayify(list); - - var len = patterns.length; - if (list.length === 0 || len === 0) { - return []; - } - - if (len === 1) { - return micromatch.match(list, patterns[0], options); - } - - var omit = []; - var keep = []; - var idx = -1; - - while (++idx < len) { - var pattern = patterns[idx]; - - if (typeof pattern === 'string' && pattern.charCodeAt(0) === 33 /* ! */) { - omit.push.apply(omit, micromatch.match(list, pattern.slice(1), options)); - } else { - keep.push.apply(keep, micromatch.match(list, pattern, options)); - } - } - - var matches = utils.diff(keep, omit); - if (!options || options.nodupes !== false) { - return utils.unique(matches); - } - - return matches; -} - -/** - * Similar to the main function, but `pattern` must be a string. - * - * ```js - * var mm = require('micromatch'); - * mm.match(list, pattern[, options]); - * - * console.log(mm.match(['a.a', 'a.aa', 'a.b', 'a.c'], '*.a')); - * //=> ['a.a', 'a.aa'] - * ``` - * @param {Array} `list` Array of strings to match - * @param {String} `pattern` Glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Array} Returns an array of matches - * @api public - */ - -micromatch.match = function(list, pattern, options) { - if (Array.isArray(pattern)) { - throw new TypeError('expected pattern to be a string'); - } - - var unixify = utils.unixify(options); - var isMatch = memoize('match', pattern, options, micromatch.matcher); - var matches = []; - - list = utils.arrayify(list); - var len = list.length; - var idx = -1; - - while (++idx < len) { - var ele = list[idx]; - if (ele === pattern || isMatch(ele)) { - matches.push(utils.value(ele, unixify, options)); - } - } - - // if no options were passed, uniquify results and return - if (typeof options === 'undefined') { - return utils.unique(matches); - } - - if (matches.length === 0) { - if (options.failglob === true) { - throw new Error('no matches found for "' + pattern + '"'); - } - if (options.nonull === true || options.nullglob === true) { - return [options.unescape ? utils.unescape(pattern) : pattern]; - } - } - - // if `opts.ignore` was defined, diff ignored list - if (options.ignore) { - matches = micromatch.not(matches, options.ignore, options); - } - - return options.nodupes !== false ? utils.unique(matches) : matches; -}; - -/** - * Returns true if the specified `string` matches the given glob `pattern`. - * - * ```js - * var mm = require('micromatch'); - * mm.isMatch(string, pattern[, options]); - * - * console.log(mm.isMatch('a.a', '*.a')); - * //=> true - * console.log(mm.isMatch('a.b', '*.a')); - * //=> false - * ``` - * @param {String} `string` String to match - * @param {String} `pattern` Glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if the string matches the glob pattern. - * @api public - */ - -micromatch.isMatch = function(str, pattern, options) { - if (typeof str !== 'string') { - throw new TypeError('expected a string: "' + util.inspect(str) + '"'); - } - - if (isEmptyString(str) || isEmptyString(pattern)) { - return false; - } - - var equals = utils.equalsPattern(options); - if (equals(str)) { - return true; - } - - var isMatch = memoize('isMatch', pattern, options, micromatch.matcher); - return isMatch(str); -}; - -/** - * Returns true if some of the strings in the given `list` match any of the - * given glob `patterns`. - * - * ```js - * var mm = require('micromatch'); - * mm.some(list, patterns[, options]); - * - * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); - * // true - * console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); - * // false - * ``` - * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -micromatch.some = function(list, patterns, options) { - if (typeof list === 'string') { - list = [list]; - } - for (var i = 0; i < list.length; i++) { - if (micromatch(list[i], patterns, options).length === 1) { - return true; - } - } - return false; -}; - -/** - * Returns true if every string in the given `list` matches - * any of the given glob `patterns`. - * - * ```js - * var mm = require('micromatch'); - * mm.every(list, patterns[, options]); - * - * console.log(mm.every('foo.js', ['foo.js'])); - * // true - * console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); - * // true - * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); - * // false - * console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); - * // false - * ``` - * @param {String|Array} `list` The string or array of strings to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -micromatch.every = function(list, patterns, options) { - if (typeof list === 'string') { - list = [list]; - } - for (var i = 0; i < list.length; i++) { - if (micromatch(list[i], patterns, options).length !== 1) { - return false; - } - } - return true; -}; - -/** - * Returns true if **any** of the given glob `patterns` - * match the specified `string`. - * - * ```js - * var mm = require('micromatch'); - * mm.any(string, patterns[, options]); - * - * console.log(mm.any('a.a', ['b.*', '*.a'])); - * //=> true - * console.log(mm.any('a.a', 'b.*')); - * //=> false - * ``` - * @param {String|Array} `str` The string to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -micromatch.any = function(str, patterns, options) { - if (typeof str !== 'string') { - throw new TypeError('expected a string: "' + util.inspect(str) + '"'); - } - - if (isEmptyString(str) || isEmptyString(patterns)) { - return false; - } - - if (typeof patterns === 'string') { - patterns = [patterns]; - } - - for (var i = 0; i < patterns.length; i++) { - if (micromatch.isMatch(str, patterns[i], options)) { - return true; - } - } - return false; -}; - -/** - * Returns true if **all** of the given `patterns` match - * the specified string. - * - * ```js - * var mm = require('micromatch'); - * mm.all(string, patterns[, options]); - * - * console.log(mm.all('foo.js', ['foo.js'])); - * // true - * - * console.log(mm.all('foo.js', ['*.js', '!foo.js'])); - * // false - * - * console.log(mm.all('foo.js', ['*.js', 'foo.js'])); - * // true - * - * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); - * // true - * ``` - * @param {String|Array} `str` The string to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - -micromatch.all = function(str, patterns, options) { - if (typeof str !== 'string') { - throw new TypeError('expected a string: "' + util.inspect(str) + '"'); - } - if (typeof patterns === 'string') { - patterns = [patterns]; - } - for (var i = 0; i < patterns.length; i++) { - if (!micromatch.isMatch(str, patterns[i], options)) { - return false; - } - } - return true; -}; - -/** - * Returns a list of strings that _**do not match any**_ of the given `patterns`. - * - * ```js - * var mm = require('micromatch'); - * mm.not(list, patterns[, options]); - * - * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a')); - * //=> ['b.b', 'c.c'] - * ``` - * @param {Array} `list` Array of strings to match. - * @param {String|Array} `patterns` One or more glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Array} Returns an array of strings that **do not match** the given patterns. - * @api public - */ - -micromatch.not = function(list, patterns, options) { - var opts = extend({}, options); - var ignore = opts.ignore; - delete opts.ignore; - - var unixify = utils.unixify(opts); - list = utils.arrayify(list).map(unixify); - - var matches = utils.diff(list, micromatch(list, patterns, opts)); - if (ignore) { - matches = utils.diff(matches, micromatch(list, ignore)); - } - - return opts.nodupes !== false ? utils.unique(matches) : matches; -}; - -/** - * Returns true if the given `string` contains the given pattern. Similar - * to [.isMatch](#isMatch) but the pattern can match any part of the string. - * - * ```js - * var mm = require('micromatch'); - * mm.contains(string, pattern[, options]); - * - * console.log(mm.contains('aa/bb/cc', '*b')); - * //=> true - * console.log(mm.contains('aa/bb/cc', '*d')); - * //=> false - * ``` - * @param {String} `str` The string to match. - * @param {String|Array} `patterns` Glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if the patter matches any part of `str`. - * @api public - */ - -micromatch.contains = function(str, patterns, options) { - if (typeof str !== 'string') { - throw new TypeError('expected a string: "' + util.inspect(str) + '"'); - } - - if (typeof patterns === 'string') { - if (isEmptyString(str) || isEmptyString(patterns)) { - return false; - } - - var equals = utils.equalsPattern(patterns, options); - if (equals(str)) { - return true; - } - var contains = utils.containsPattern(patterns, options); - if (contains(str)) { - return true; - } - } - - var opts = extend({}, options, {contains: true}); - return micromatch.any(str, patterns, opts); -}; - -/** - * Returns true if the given pattern and options should enable - * the `matchBase` option. - * @return {Boolean} - * @api private - */ - -micromatch.matchBase = function(pattern, options) { - if (pattern && pattern.indexOf('/') !== -1 || !options) return false; - return options.basename === true || options.matchBase === true; -}; - -/** - * Filter the keys of the given object with the given `glob` pattern - * and `options`. Does not attempt to match nested keys. If you need this feature, - * use [glob-object][] instead. - * - * ```js - * var mm = require('micromatch'); - * mm.matchKeys(object, patterns[, options]); - * - * var obj = { aa: 'a', ab: 'b', ac: 'c' }; - * console.log(mm.matchKeys(obj, '*b')); - * //=> { ab: 'b' } - * ``` - * @param {Object} `object` The object with keys to filter. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Object} Returns an object with only keys that match the given patterns. - * @api public - */ - -micromatch.matchKeys = function(obj, patterns, options) { - if (!utils.isObject(obj)) { - throw new TypeError('expected the first argument to be an object'); - } - var keys = micromatch(Object.keys(obj), patterns, options); - return utils.pick(obj, keys); -}; - -/** - * Returns a memoized matcher function from the given glob `pattern` and `options`. - * The returned function takes a string to match as its only argument and returns - * true if the string is a match. - * - * ```js - * var mm = require('micromatch'); - * mm.matcher(pattern[, options]); - * - * var isMatch = mm.matcher('*.!(*a)'); - * console.log(isMatch('a.a')); - * //=> false - * console.log(isMatch('a.b')); - * //=> true - * ``` - * @param {String} `pattern` Glob pattern - * @param {Object} `options` See available [options](#options) for changing how matches are performed. - * @return {Function} Returns a matcher function. - * @api public - */ - -micromatch.matcher = function matcher(pattern, options) { - if (Array.isArray(pattern)) { - return compose(pattern, options, matcher); - } - - // if pattern is a regex - if (pattern instanceof RegExp) { - return test(pattern); - } - - // if pattern is invalid - if (!utils.isString(pattern)) { - throw new TypeError('expected pattern to be an array, string or regex'); - } - - // if pattern is a non-glob string - if (!utils.hasSpecialChars(pattern)) { - if (options && options.nocase === true) { - pattern = pattern.toLowerCase(); - } - return utils.matchPath(pattern, options); - } - - // if pattern is a glob string - var re = micromatch.makeRe(pattern, options); - - // if `options.matchBase` or `options.basename` is defined - if (micromatch.matchBase(pattern, options)) { - return utils.matchBasename(re, options); - } - - function test(regex) { - var equals = utils.equalsPattern(options); - var unixify = utils.unixify(options); - - return function(str) { - if (equals(str)) { - return true; - } - - if (regex.test(unixify(str))) { - return true; - } - return false; - }; - } - - var fn = test(re); - Object.defineProperty(fn, 'result', { - configurable: true, - enumerable: false, - value: re.result - }); - return fn; -}; - -/** - * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match. - * - * ```js - * var mm = require('micromatch'); - * mm.capture(pattern, string[, options]); - * - * console.log(mm.capture('test/*.js', 'test/foo.js')); - * //=> ['foo'] - * console.log(mm.capture('test/*.js', 'foo/bar.css')); - * //=> null - * ``` - * @param {String} `pattern` Glob pattern to use for matching. - * @param {String} `string` String to match - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns an array of captures if the string matches the glob pattern, otherwise `null`. - * @api public - */ - -micromatch.capture = function(pattern, str, options) { - var re = micromatch.makeRe(pattern, extend({capture: true}, options)); - var unixify = utils.unixify(options); - - function match() { - return function(string) { - var match = re.exec(unixify(string)); - if (!match) { - return null; - } - - return match.slice(1); - }; - } - - var capture = memoize('capture', pattern, options, match); - return capture(str); -}; - -/** - * Create a regular expression from the given glob `pattern`. - * - * ```js - * var mm = require('micromatch'); - * mm.makeRe(pattern[, options]); - * - * console.log(mm.makeRe('*.js')); - * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ - * ``` - * @param {String} `pattern` A glob pattern to convert to regex. - * @param {Object} `options` See available [options](#options) for changing how matches are performed. - * @return {RegExp} Returns a regex created from the given pattern. - * @api public - */ - -micromatch.makeRe = function(pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('expected pattern to be a string'); - } - - if (pattern.length > MAX_LENGTH) { - throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters'); - } - - function makeRe() { - var result = micromatch.create(pattern, options); - var ast_array = []; - var output = result.map(function(obj) { - obj.ast.state = obj.state; - ast_array.push(obj.ast); - return obj.output; - }); - - var regex = toRegex(output.join('|'), options); - Object.defineProperty(regex, 'result', { - configurable: true, - enumerable: false, - value: ast_array - }); - return regex; - } - - return memoize('makeRe', pattern, options, makeRe); -}; - -/** - * Expand the given brace `pattern`. - * - * ```js - * var mm = require('micromatch'); - * console.log(mm.braces('foo/{a,b}/bar')); - * //=> ['foo/(a|b)/bar'] - * - * console.log(mm.braces('foo/{a,b}/bar', {expand: true})); - * //=> ['foo/(a|b)/bar'] - * ``` - * @param {String} `pattern` String with brace pattern to expand. - * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options. - * @return {Array} - * @api public - */ - -micromatch.braces = function(pattern, options) { - if (typeof pattern !== 'string' && !Array.isArray(pattern)) { - throw new TypeError('expected pattern to be an array or string'); - } - - function expand() { - if (options && options.nobrace === true || !/\{.*\}/.test(pattern)) { - return utils.arrayify(pattern); - } - return braces(pattern, options); - } - - return memoize('braces', pattern, options, expand); -}; - -/** - * Proxy to the [micromatch.braces](#method), for parity with - * minimatch. - */ - -micromatch.braceExpand = function(pattern, options) { - var opts = extend({}, options, {expand: true}); - return micromatch.braces(pattern, opts); -}; - -/** - * Parses the given glob `pattern` and returns an array of abstract syntax - * trees (ASTs), with the compiled `output` and optional source `map` on - * each AST. - * - * ```js - * var mm = require('micromatch'); - * mm.create(pattern[, options]); - * - * console.log(mm.create('abc/*.js')); - * // [{ options: { source: 'string', sourcemap: true }, - * // state: {}, - * // compilers: - * // { ... }, - * // output: '(\\.[\\\\\\/])?abc\\/(?!\\.)(?=.)[^\\/]*?\\.js', - * // ast: - * // { type: 'root', - * // errors: [], - * // nodes: - * // [ ... ], - * // dot: false, - * // input: 'abc/*.js' }, - * // parsingErrors: [], - * // map: - * // { version: 3, - * // sources: [ 'string' ], - * // names: [], - * // mappings: 'AAAA,GAAG,EAAC,kBAAC,EAAC,EAAE', - * // sourcesContent: [ 'abc/*.js' ] }, - * // position: { line: 1, column: 28 }, - * // content: {}, - * // files: {}, - * // idx: 6 }] - * ``` - * @param {String} `pattern` Glob pattern to parse and compile. - * @param {Object} `options` Any [options](#options) to change how parsing and compiling is performed. - * @return {Object} Returns an object with the parsed AST, compiled string and optional source map. - * @api public - */ - -micromatch.create = function(pattern, options) { - return memoize('create', pattern, options, function() { - function create(str, opts) { - return micromatch.compile(micromatch.parse(str, opts), opts); - } - - pattern = micromatch.braces(pattern, options); - var len = pattern.length; - var idx = -1; - var res = []; - - while (++idx < len) { - res.push(create(pattern[idx], options)); - } - return res; - }); -}; - -/** - * Parse the given `str` with the given `options`. - * - * ```js - * var mm = require('micromatch'); - * mm.parse(pattern[, options]); - * - * var ast = mm.parse('a/{b,c}/d'); - * console.log(ast); - * // { type: 'root', - * // errors: [], - * // input: 'a/{b,c}/d', - * // nodes: - * // [ { type: 'bos', val: '' }, - * // { type: 'text', val: 'a/' }, - * // { type: 'brace', - * // nodes: - * // [ { type: 'brace.open', val: '{' }, - * // { type: 'text', val: 'b,c' }, - * // { type: 'brace.close', val: '}' } ] }, - * // { type: 'text', val: '/d' }, - * // { type: 'eos', val: '' } ] } - * ``` - * @param {String} `str` - * @param {Object} `options` - * @return {Object} Returns an AST - * @api public - */ - -micromatch.parse = function(pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('expected a string'); - } - - function parse() { - var snapdragon = utils.instantiate(null, options); - parsers(snapdragon, options); - - var ast = snapdragon.parse(pattern, options); - utils.define(ast, 'snapdragon', snapdragon); - ast.input = pattern; - return ast; - } - - return memoize('parse', pattern, options, parse); -}; - -/** - * Compile the given `ast` or string with the given `options`. - * - * ```js - * var mm = require('micromatch'); - * mm.compile(ast[, options]); - * - * var ast = mm.parse('a/{b,c}/d'); - * console.log(mm.compile(ast)); - * // { options: { source: 'string' }, - * // state: {}, - * // compilers: - * // { eos: [Function], - * // noop: [Function], - * // bos: [Function], - * // brace: [Function], - * // 'brace.open': [Function], - * // text: [Function], - * // 'brace.close': [Function] }, - * // output: [ 'a/(b|c)/d' ], - * // ast: - * // { ... }, - * // parsingErrors: [] } - * ``` - * @param {Object|String} `ast` - * @param {Object} `options` - * @return {Object} Returns an object that has an `output` property with the compiled string. - * @api public - */ - -micromatch.compile = function(ast, options) { - if (typeof ast === 'string') { - ast = micromatch.parse(ast, options); - } - - return memoize('compile', ast.input, options, function() { - var snapdragon = utils.instantiate(ast, options); - compilers(snapdragon, options); - return snapdragon.compile(ast, options); - }); -}; - -/** - * Clear the regex cache. - * - * ```js - * mm.clearCache(); - * ``` - * @api public - */ - -micromatch.clearCache = function() { - micromatch.cache.caches = {}; -}; - -/** - * Returns true if the given value is effectively an empty string - */ - -function isEmptyString(val) { - return String(val) === '' || String(val) === './'; -} - -/** - * Compose a matcher function with the given patterns. - * This allows matcher functions to be compiled once and - * called multiple times. - */ - -function compose(patterns, options, matcher) { - var matchers; - - return memoize('compose', String(patterns), options, function() { - return function(file) { - // delay composition until it's invoked the first time, - // after that it won't be called again - if (!matchers) { - matchers = []; - for (var i = 0; i < patterns.length; i++) { - matchers.push(matcher(patterns[i], options)); - } - } - - var len = matchers.length; - while (len--) { - if (matchers[len](file) === true) { - return true; - } - } - return false; - }; - }); -} - -/** - * Memoize a generated regex or function. A unique key is generated - * from the `type` (usually method name), the `pattern`, and - * user-defined options. - */ - -function memoize(type, pattern, options, fn) { - var key = utils.createKey(type + '=' + pattern, options); - - if (options && options.cache === false) { - return fn(pattern, options); - } - - if (cache.has(type, key)) { - return cache.get(type, key); - } - - var val = fn(pattern, options); - cache.set(type, key, val); - return val; -} - -/** - * Expose compiler, parser and cache on `micromatch` - */ - -micromatch.compilers = compilers; -micromatch.parsers = parsers; -micromatch.caches = cache.caches; - -/** - * Expose `micromatch` - * @type {Function} - */ - -module.exports = micromatch; diff --git a/node_modules/readdirp/node_modules/micromatch/lib/.DS_Store b/node_modules/readdirp/node_modules/micromatch/lib/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0=0.10.0" - }, - "files": [ - "index.js", - "lib" - ], - "homepage": "https://github.com/micromatch/micromatch", - "keywords": [ - "bash", - "expand", - "expansion", - "expression", - "file", - "files", - "filter", - "find", - "glob", - "globbing", - "globs", - "globstar", - "match", - "matcher", - "matches", - "matching", - "micromatch", - "minimatch", - "multimatch", - "path", - "pattern", - "patterns", - "regex", - "regexp", - "regular", - "shell", - "wildcard" - ], - "license": "MIT", - "lintDeps": { - "dependencies": { - "options": { - "lock": { - "snapdragon": "^0.8.1" - } - } - }, - "devDependencies": { - "files": { - "options": { - "ignore": [ - "benchmark/**" - ] - } - } - } - }, - "main": "index.js", - "name": "micromatch", - "repository": { - "type": "git", - "url": "git+https://github.com/micromatch/micromatch.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": "collapsible", - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "helpers": [ - "./benchmark/helper.js" - ], - "related": { - "list": [ - "braces", - "expand-brackets", - "extglob", - "fill-range", - "nanomatch" - ] - }, - "lint": { - "reflinks": true - }, - "reflinks": [ - "expand-brackets", - "extglob", - "glob-object", - "minimatch", - "multimatch", - "snapdragon" - ] - }, - "version": "3.1.10" -} diff --git a/node_modules/readdirp/package.json b/node_modules/readdirp/package.json deleted file mode 100644 index 79b26881b..000000000 --- a/node_modules/readdirp/package.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "_from": "readdirp@^2.0.0", - "_id": "readdirp@2.2.1", - "_inBundle": false, - "_integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "_location": "/readdirp", - "_phantomChildren": { - "arr-flatten": "1.1.0", - "debug": "2.6.9", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "fragment-cache": "0.2.1", - "is-buffer": "1.1.6", - "is-extendable": "0.1.1", - "nanomatch": "1.2.13", - "object.pick": "1.3.0", - "posix-character-classes": "0.1.1", - "regex-not": "1.0.2", - "repeat-element": "1.1.3", - "repeat-string": "1.6.1", - "snapdragon": "0.8.2", - "snapdragon-node": "2.1.1", - "split-string": "3.1.0", - "to-regex": "3.0.2", - "to-regex-range": "2.1.1" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "readdirp@^2.0.0", - "name": "readdirp", - "escapedName": "readdirp", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/chokidar" - ], - "_resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "_shasum": "0e87622a3325aa33e892285caf8b4e846529a525", - "_spec": "readdirp@^2.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/chokidar", - "author": { - "name": "Thorsten Lorenz", - "email": "thlorenz@gmx.de", - "url": "thlorenz.com" - }, - "bugs": { - "url": "https://github.com/paulmillr/readdirp/issues" - }, - "bundleDependencies": false, - "dependencies": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - }, - "deprecated": false, - "description": "Recursive version of fs.readdir with streaming api.", - "devDependencies": { - "nave": "^0.5.1", - "proxyquire": "^1.7.9", - "tap": "1.3.2", - "through2": "^2.0.0" - }, - "engines": { - "node": ">=0.10" - }, - "files": [ - "readdirp.js", - "stream-api.js" - ], - "homepage": "https://github.com/paulmillr/readdirp", - "keywords": [ - "recursive", - "fs", - "stream", - "streams", - "readdir", - "filesystem", - "find", - "filter" - ], - "license": "MIT", - "main": "readdirp.js", - "name": "readdirp", - "repository": { - "type": "git", - "url": "git://github.com/paulmillr/readdirp.git" - }, - "scripts": { - "test": "npm run test-main", - "test-0.10": "nave use 0.10 npm run test-main", - "test-0.12": "nave use 0.12 npm run test-main", - "test-4": "nave use 4.4 npm run test-main", - "test-6": "nave use 6.2 npm run test-main", - "test-all": "npm run test-main && npm run test-0.10 && npm run test-0.12 && npm run test-4 && npm run test-6", - "test-main": "(cd test && set -e; for t in ./*.js; do node $t; done)" - }, - "version": "2.2.1" -} diff --git a/node_modules/readdirp/readdirp.js b/node_modules/readdirp/readdirp.js deleted file mode 100644 index 863bd17b8..000000000 --- a/node_modules/readdirp/readdirp.js +++ /dev/null @@ -1,294 +0,0 @@ -'use strict'; - -var fs = require('graceful-fs') - , path = require('path') - , micromatch = require('micromatch').isMatch - , toString = Object.prototype.toString - ; - - -// Standard helpers -function isFunction (obj) { - return toString.call(obj) === '[object Function]'; -} - -function isString (obj) { - return toString.call(obj) === '[object String]'; -} - -function isUndefined (obj) { - return obj === void 0; -} - -/** - * Main function which ends up calling readdirRec and reads all files and directories in given root recursively. - * @param { Object } opts Options to specify root (start directory), filters and recursion depth - * @param { function } callback1 When callback2 is given calls back for each processed file - function (fileInfo) { ... }, - * when callback2 is not given, it behaves like explained in callback2 - * @param { function } callback2 Calls back once all files have been processed with an array of errors and file infos - * function (err, fileInfos) { ... } - */ -function readdir(opts, callback1, callback2) { - var stream - , handleError - , handleFatalError - , errors = [] - , readdirResult = { - directories: [] - , files: [] - } - , fileProcessed - , allProcessed - , realRoot - , aborted = false - , paused = false - ; - - // If no callbacks were given we will use a streaming interface - if (isUndefined(callback1)) { - var api = require('./stream-api')(); - stream = api.stream; - callback1 = api.processEntry; - callback2 = api.done; - handleError = api.handleError; - handleFatalError = api.handleFatalError; - - stream.on('close', function () { aborted = true; }); - stream.on('pause', function () { paused = true; }); - stream.on('resume', function () { paused = false; }); - } else { - handleError = function (err) { errors.push(err); }; - handleFatalError = function (err) { - handleError(err); - allProcessed(errors, null); - }; - } - - if (isUndefined(opts)){ - handleFatalError(new Error ( - 'Need to pass at least one argument: opts! \n' + - 'https://github.com/paulmillr/readdirp#options' - ) - ); - return stream; - } - - opts.root = opts.root || '.'; - opts.fileFilter = opts.fileFilter || function() { return true; }; - opts.directoryFilter = opts.directoryFilter || function() { return true; }; - opts.depth = typeof opts.depth === 'undefined' ? 999999999 : opts.depth; - opts.entryType = opts.entryType || 'files'; - - var statfn = opts.lstat === true ? fs.lstat.bind(fs) : fs.stat.bind(fs); - - if (isUndefined(callback2)) { - fileProcessed = function() { }; - allProcessed = callback1; - } else { - fileProcessed = callback1; - allProcessed = callback2; - } - - function normalizeFilter (filter) { - - if (isUndefined(filter)) return undefined; - - function isNegated (filters) { - - function negated(f) { - return f.indexOf('!') === 0; - } - - var some = filters.some(negated); - if (!some) { - return false; - } else { - if (filters.every(negated)) { - return true; - } else { - // if we detect illegal filters, bail out immediately - throw new Error( - 'Cannot mix negated with non negated glob filters: ' + filters + '\n' + - 'https://github.com/paulmillr/readdirp#filters' - ); - } - } - } - - // Turn all filters into a function - if (isFunction(filter)) { - - return filter; - - } else if (isString(filter)) { - - return function (entryInfo) { - return micromatch(entryInfo.name, filter.trim()); - }; - - } else if (filter && Array.isArray(filter)) { - - if (filter) filter = filter.map(function (f) { - return f.trim(); - }); - - return isNegated(filter) ? - // use AND to concat multiple negated filters - function (entryInfo) { - return filter.every(function (f) { - return micromatch(entryInfo.name, f); - }); - } - : - // use OR to concat multiple inclusive filters - function (entryInfo) { - return filter.some(function (f) { - return micromatch(entryInfo.name, f); - }); - }; - } - } - - function processDir(currentDir, entries, callProcessed) { - if (aborted) return; - var total = entries.length - , processed = 0 - , entryInfos = [] - ; - - fs.realpath(currentDir, function(err, realCurrentDir) { - if (aborted) return; - if (err) { - handleError(err); - callProcessed(entryInfos); - return; - } - - var relDir = path.relative(realRoot, realCurrentDir); - - if (entries.length === 0) { - callProcessed([]); - } else { - entries.forEach(function (entry) { - - var fullPath = path.join(realCurrentDir, entry) - , relPath = path.join(relDir, entry); - - statfn(fullPath, function (err, stat) { - if (err) { - handleError(err); - } else { - entryInfos.push({ - name : entry - , path : relPath // relative to root - , fullPath : fullPath - - , parentDir : relDir // relative to root - , fullParentDir : realCurrentDir - - , stat : stat - }); - } - processed++; - if (processed === total) callProcessed(entryInfos); - }); - }); - } - }); - } - - function readdirRec(currentDir, depth, callCurrentDirProcessed) { - var args = arguments; - if (aborted) return; - if (paused) { - setImmediate(function () { - readdirRec.apply(null, args); - }) - return; - } - - fs.readdir(currentDir, function (err, entries) { - if (err) { - handleError(err); - callCurrentDirProcessed(); - return; - } - - processDir(currentDir, entries, function(entryInfos) { - - var subdirs = entryInfos - .filter(function (ei) { return ei.stat.isDirectory() && opts.directoryFilter(ei); }); - - subdirs.forEach(function (di) { - if(opts.entryType === 'directories' || opts.entryType === 'both' || opts.entryType === 'all') { - fileProcessed(di); - } - readdirResult.directories.push(di); - }); - - entryInfos - .filter(function(ei) { - var isCorrectType = opts.entryType === 'all' ? - !ei.stat.isDirectory() : ei.stat.isFile() || ei.stat.isSymbolicLink(); - return isCorrectType && opts.fileFilter(ei); - }) - .forEach(function (fi) { - if(opts.entryType === 'files' || opts.entryType === 'both' || opts.entryType === 'all') { - fileProcessed(fi); - } - readdirResult.files.push(fi); - }); - - var pendingSubdirs = subdirs.length; - - // Be done if no more subfolders exist or we reached the maximum desired depth - if(pendingSubdirs === 0 || depth === opts.depth) { - callCurrentDirProcessed(); - } else { - // recurse into subdirs, keeping track of which ones are done - // and call back once all are processed - subdirs.forEach(function (subdir) { - readdirRec(subdir.fullPath, depth + 1, function () { - pendingSubdirs = pendingSubdirs - 1; - if(pendingSubdirs === 0) { - callCurrentDirProcessed(); - } - }); - }); - } - }); - }); - } - - // Validate and normalize filters - try { - opts.fileFilter = normalizeFilter(opts.fileFilter); - opts.directoryFilter = normalizeFilter(opts.directoryFilter); - } catch (err) { - // if we detect illegal filters, bail out immediately - handleFatalError(err); - return stream; - } - - // If filters were valid get on with the show - fs.realpath(opts.root, function(err, res) { - if (err) { - handleFatalError(err); - return stream; - } - - realRoot = res; - readdirRec(opts.root, 0, function () { - // All errors are collected into the errors array - if (errors.length > 0) { - allProcessed(errors, readdirResult); - } else { - allProcessed(null, readdirResult); - } - }); - }); - - return stream; -} - -module.exports = readdir; diff --git a/node_modules/readdirp/stream-api.js b/node_modules/readdirp/stream-api.js deleted file mode 100644 index bffd1a977..000000000 --- a/node_modules/readdirp/stream-api.js +++ /dev/null @@ -1,98 +0,0 @@ -'use strict'; - -var stream = require('readable-stream'); -var util = require('util'); - -var Readable = stream.Readable; - -module.exports = ReaddirpReadable; - -util.inherits(ReaddirpReadable, Readable); - -function ReaddirpReadable (opts) { - if (!(this instanceof ReaddirpReadable)) return new ReaddirpReadable(opts); - - opts = opts || {}; - - opts.objectMode = true; - Readable.call(this, opts); - - // backpressure not implemented at this point - this.highWaterMark = Infinity; - - this._destroyed = false; - this._paused = false; - this._warnings = []; - this._errors = []; - - this._pauseResumeErrors(); -} - -var proto = ReaddirpReadable.prototype; - -proto._pauseResumeErrors = function () { - var self = this; - self.on('pause', function () { self._paused = true }); - self.on('resume', function () { - if (self._destroyed) return; - self._paused = false; - - self._warnings.forEach(function (err) { self.emit('warn', err) }); - self._warnings.length = 0; - - self._errors.forEach(function (err) { self.emit('error', err) }); - self._errors.length = 0; - }) -} - -// called for each entry -proto._processEntry = function (entry) { - if (this._destroyed) return; - this.push(entry); -} - -proto._read = function () { } - -proto.destroy = function () { - // when stream is destroyed it will emit nothing further, not even errors or warnings - this.push(null); - this.readable = false; - this._destroyed = true; - this.emit('close'); -} - -proto._done = function () { - this.push(null); -} - -// we emit errors and warnings async since we may handle errors like invalid args -// within the initial event loop before any event listeners subscribed -proto._handleError = function (err) { - var self = this; - setImmediate(function () { - if (self._paused) return self._warnings.push(err); - if (!self._destroyed) self.emit('warn', err); - }); -} - -proto._handleFatalError = function (err) { - var self = this; - setImmediate(function () { - if (self._paused) return self._errors.push(err); - if (!self._destroyed) self.emit('error', err); - }); -} - -function createStreamAPI () { - var stream = new ReaddirpReadable(); - - return { - stream : stream - , processEntry : stream._processEntry.bind(stream) - , done : stream._done.bind(stream) - , handleError : stream._handleError.bind(stream) - , handleFatalError : stream._handleFatalError.bind(stream) - }; -} - -module.exports = createStreamAPI; diff --git a/node_modules/regenerator-runtime/README.md b/node_modules/regenerator-runtime/README.md deleted file mode 100644 index d93386a30..000000000 --- a/node_modules/regenerator-runtime/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# regenerator-runtime - -Standalone runtime for -[Regenerator](https://github.com/facebook/regenerator)-compiled generator -and `async` functions. - -To import the runtime as a module (recommended), either of the following -import styles will work: -```js -// CommonJS -const regeneratorRuntime = require("regenerator-runtime"); - -// ECMAScript 2015 -import regeneratorRuntime from "regenerator-runtime"; -``` - -To ensure that `regeneratorRuntime` is defined globally, either of the -following styles will work: -```js -// CommonJS -require("regenerator-runtime/runtime"); - -// ECMAScript 2015 -import "regenerator-runtime/runtime"; -``` - -To get the absolute file system path of `runtime.js`, evaluate the -following expression: -```js -require("regenerator-runtime/path").path -``` diff --git a/node_modules/regenerator-runtime/package.json b/node_modules/regenerator-runtime/package.json deleted file mode 100644 index 867c256df..000000000 --- a/node_modules/regenerator-runtime/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "_from": "regenerator-runtime@^0.11.1", - "_id": "regenerator-runtime@0.11.1", - "_inBundle": false, - "_integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", - "_location": "/regenerator-runtime", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "regenerator-runtime@^0.11.1", - "name": "regenerator-runtime", - "escapedName": "regenerator-runtime", - "rawSpec": "^0.11.1", - "saveSpec": null, - "fetchSpec": "^0.11.1" - }, - "_requiredBy": [ - "/@babel/polyfill" - ], - "_resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "_shasum": "be05ad7f9bf7d22e056f9726cee5017fbf19e2e9", - "_spec": "regenerator-runtime@^0.11.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/@babel/polyfill", - "author": { - "name": "Ben Newman", - "email": "bn@cs.stanford.edu" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Runtime for Regenerator-compiled generator and async functions.", - "keywords": [ - "regenerator", - "runtime", - "generator", - "async" - ], - "license": "MIT", - "main": "runtime-module.js", - "name": "regenerator-runtime", - "repository": { - "type": "git", - "url": "https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime" - }, - "version": "0.11.1" -} diff --git a/node_modules/regenerator-runtime/path.js b/node_modules/regenerator-runtime/path.js deleted file mode 100644 index ced878b88..000000000 --- a/node_modules/regenerator-runtime/path.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Copyright (c) 2014-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. - */ - -exports.path = require("path").join( - __dirname, - "runtime.js" -); diff --git a/node_modules/regenerator-runtime/runtime-module.js b/node_modules/regenerator-runtime/runtime-module.js deleted file mode 100644 index ed2843177..000000000 --- a/node_modules/regenerator-runtime/runtime-module.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (c) 2014-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 method of obtaining a reference to the global object needs to be -// kept identical to the way it is obtained in runtime.js -var g = (function() { return this })() || Function("return this")(); - -// Use `getOwnPropertyNames` because not all browsers support calling -// `hasOwnProperty` on the global `self` object in a worker. See #183. -var hadRuntime = g.regeneratorRuntime && - Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0; - -// Save the old regeneratorRuntime in case it needs to be restored later. -var oldRuntime = hadRuntime && g.regeneratorRuntime; - -// Force reevalutation of runtime.js. -g.regeneratorRuntime = undefined; - -module.exports = require("./runtime"); - -if (hadRuntime) { - // Restore the original runtime. - g.regeneratorRuntime = oldRuntime; -} else { - // Remove the global property added by runtime.js. - try { - delete g.regeneratorRuntime; - } catch(e) { - g.regeneratorRuntime = undefined; - } -} diff --git a/node_modules/regenerator-runtime/runtime.js b/node_modules/regenerator-runtime/runtime.js deleted file mode 100644 index 22e7b005c..000000000 --- a/node_modules/regenerator-runtime/runtime.js +++ /dev/null @@ -1,727 +0,0 @@ -/** - * Copyright (c) 2014-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. - */ - -!(function(global) { - "use strict"; - - var Op = Object.prototype; - var hasOwn = Op.hasOwnProperty; - var undefined; // More compressible than void 0. - var $Symbol = typeof Symbol === "function" ? Symbol : {}; - var iteratorSymbol = $Symbol.iterator || "@@iterator"; - var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; - var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; - - var inModule = typeof module === "object"; - var runtime = global.regeneratorRuntime; - if (runtime) { - if (inModule) { - // If regeneratorRuntime is defined globally and we're in a module, - // make the exports object identical to regeneratorRuntime. - module.exports = runtime; - } - // Don't bother evaluating the rest of this file if the runtime was - // already defined globally. - return; - } - - // Define the runtime globally (as expected by generated code) as either - // module.exports (if we're in a module) or a new, empty object. - runtime = global.regeneratorRuntime = inModule ? module.exports : {}; - - function wrap(innerFn, outerFn, self, tryLocsList) { - // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. - var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; - var generator = Object.create(protoGenerator.prototype); - var context = new Context(tryLocsList || []); - - // The ._invoke method unifies the implementations of the .next, - // .throw, and .return methods. - generator._invoke = makeInvokeMethod(innerFn, self, context); - - return generator; - } - runtime.wrap = wrap; - - // Try/catch helper to minimize deoptimizations. Returns a completion - // record like context.tryEntries[i].completion. This interface could - // have been (and was previously) designed to take a closure to be - // invoked without arguments, but in all the cases we care about we - // already have an existing method we want to call, so there's no need - // to create a new function object. We can even get away with assuming - // the method takes exactly one argument, since that happens to be true - // in every case, so we don't have to touch the arguments object. The - // only additional allocation required is the completion record, which - // has a stable shape and so hopefully should be cheap to allocate. - function tryCatch(fn, obj, arg) { - try { - return { type: "normal", arg: fn.call(obj, arg) }; - } catch (err) { - return { type: "throw", arg: err }; - } - } - - var GenStateSuspendedStart = "suspendedStart"; - var GenStateSuspendedYield = "suspendedYield"; - var GenStateExecuting = "executing"; - var GenStateCompleted = "completed"; - - // Returning this object from the innerFn has the same effect as - // breaking out of the dispatch switch statement. - var ContinueSentinel = {}; - - // Dummy constructor functions that we use as the .constructor and - // .constructor.prototype properties for functions that return Generator - // objects. For full spec compliance, you may wish to configure your - // minifier not to mangle the names of these two functions. - function Generator() {} - function GeneratorFunction() {} - function GeneratorFunctionPrototype() {} - - // This is a polyfill for %IteratorPrototype% for environments that - // don't natively support it. - var IteratorPrototype = {}; - IteratorPrototype[iteratorSymbol] = function () { - return this; - }; - - var getProto = Object.getPrototypeOf; - var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); - if (NativeIteratorPrototype && - NativeIteratorPrototype !== Op && - hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { - // This environment has a native %IteratorPrototype%; use it instead - // of the polyfill. - IteratorPrototype = NativeIteratorPrototype; - } - - var Gp = GeneratorFunctionPrototype.prototype = - Generator.prototype = Object.create(IteratorPrototype); - GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; - GeneratorFunctionPrototype.constructor = GeneratorFunction; - GeneratorFunctionPrototype[toStringTagSymbol] = - GeneratorFunction.displayName = "GeneratorFunction"; - - // Helper for defining the .next, .throw, and .return methods of the - // Iterator interface in terms of a single ._invoke method. - function defineIteratorMethods(prototype) { - ["next", "throw", "return"].forEach(function(method) { - prototype[method] = function(arg) { - return this._invoke(method, arg); - }; - }); - } - - runtime.isGeneratorFunction = function(genFun) { - var ctor = typeof genFun === "function" && genFun.constructor; - return ctor - ? ctor === GeneratorFunction || - // For the native GeneratorFunction constructor, the best we can - // do is to check its .name property. - (ctor.displayName || ctor.name) === "GeneratorFunction" - : false; - }; - - runtime.mark = function(genFun) { - if (Object.setPrototypeOf) { - Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); - } else { - genFun.__proto__ = GeneratorFunctionPrototype; - if (!(toStringTagSymbol in genFun)) { - genFun[toStringTagSymbol] = "GeneratorFunction"; - } - } - genFun.prototype = Object.create(Gp); - return genFun; - }; - - // Within the body of any async function, `await x` is transformed to - // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test - // `hasOwn.call(value, "__await")` to determine if the yielded value is - // meant to be awaited. - runtime.awrap = function(arg) { - return { __await: arg }; - }; - - function AsyncIterator(generator) { - function invoke(method, arg, resolve, reject) { - var record = tryCatch(generator[method], generator, arg); - if (record.type === "throw") { - reject(record.arg); - } else { - var result = record.arg; - var value = result.value; - if (value && - typeof value === "object" && - hasOwn.call(value, "__await")) { - return Promise.resolve(value.__await).then(function(value) { - invoke("next", value, resolve, reject); - }, function(err) { - invoke("throw", err, resolve, reject); - }); - } - - return Promise.resolve(value).then(function(unwrapped) { - // When a yielded Promise is resolved, its final value becomes - // the .value of the Promise<{value,done}> result for the - // current iteration. If the Promise is rejected, however, the - // result for this iteration will be rejected with the same - // reason. Note that rejections of yielded Promises are not - // thrown back into the generator function, as is the case - // when an awaited Promise is rejected. This difference in - // behavior between yield and await is important, because it - // allows the consumer to decide what to do with the yielded - // rejection (swallow it and continue, manually .throw it back - // into the generator, abandon iteration, whatever). With - // await, by contrast, there is no opportunity to examine the - // rejection reason outside the generator function, so the - // only option is to throw it from the await expression, and - // let the generator function handle the exception. - result.value = unwrapped; - resolve(result); - }, reject); - } - } - - var previousPromise; - - function enqueue(method, arg) { - function callInvokeWithMethodAndArg() { - return new Promise(function(resolve, reject) { - invoke(method, arg, resolve, reject); - }); - } - - return previousPromise = - // If enqueue has been called before, then we want to wait until - // all previous Promises have been resolved before calling invoke, - // so that results are always delivered in the correct order. If - // enqueue has not been called before, then it is important to - // call invoke immediately, without waiting on a callback to fire, - // so that the async generator function has the opportunity to do - // any necessary setup in a predictable way. This predictability - // is why the Promise constructor synchronously invokes its - // executor callback, and why async functions synchronously - // execute code before the first await. Since we implement simple - // async functions in terms of async generators, it is especially - // important to get this right, even though it requires care. - previousPromise ? previousPromise.then( - callInvokeWithMethodAndArg, - // Avoid propagating failures to Promises returned by later - // invocations of the iterator. - callInvokeWithMethodAndArg - ) : callInvokeWithMethodAndArg(); - } - - // Define the unified helper method that is used to implement .next, - // .throw, and .return (see defineIteratorMethods). - this._invoke = enqueue; - } - - defineIteratorMethods(AsyncIterator.prototype); - AsyncIterator.prototype[asyncIteratorSymbol] = function () { - return this; - }; - runtime.AsyncIterator = AsyncIterator; - - // Note that simple async functions are implemented on top of - // AsyncIterator objects; they just return a Promise for the value of - // the final result produced by the iterator. - runtime.async = function(innerFn, outerFn, self, tryLocsList) { - var iter = new AsyncIterator( - wrap(innerFn, outerFn, self, tryLocsList) - ); - - return runtime.isGeneratorFunction(outerFn) - ? iter // If outerFn is a generator, return the full iterator. - : iter.next().then(function(result) { - return result.done ? result.value : iter.next(); - }); - }; - - function makeInvokeMethod(innerFn, self, context) { - var state = GenStateSuspendedStart; - - return function invoke(method, arg) { - if (state === GenStateExecuting) { - throw new Error("Generator is already running"); - } - - if (state === GenStateCompleted) { - if (method === "throw") { - throw arg; - } - - // Be forgiving, per 25.3.3.3.3 of the spec: - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume - return doneResult(); - } - - context.method = method; - context.arg = arg; - - while (true) { - var delegate = context.delegate; - if (delegate) { - var delegateResult = maybeInvokeDelegate(delegate, context); - if (delegateResult) { - if (delegateResult === ContinueSentinel) continue; - return delegateResult; - } - } - - if (context.method === "next") { - // Setting context._sent for legacy support of Babel's - // function.sent implementation. - context.sent = context._sent = context.arg; - - } else if (context.method === "throw") { - if (state === GenStateSuspendedStart) { - state = GenStateCompleted; - throw context.arg; - } - - context.dispatchException(context.arg); - - } else if (context.method === "return") { - context.abrupt("return", context.arg); - } - - state = GenStateExecuting; - - var record = tryCatch(innerFn, self, context); - if (record.type === "normal") { - // If an exception is thrown from innerFn, we leave state === - // GenStateExecuting and loop back for another invocation. - state = context.done - ? GenStateCompleted - : GenStateSuspendedYield; - - if (record.arg === ContinueSentinel) { - continue; - } - - return { - value: record.arg, - done: context.done - }; - - } else if (record.type === "throw") { - state = GenStateCompleted; - // Dispatch the exception by looping back around to the - // context.dispatchException(context.arg) call above. - context.method = "throw"; - context.arg = record.arg; - } - } - }; - } - - // Call delegate.iterator[context.method](context.arg) and handle the - // result, either by returning a { value, done } result from the - // delegate iterator, or by modifying context.method and context.arg, - // setting context.delegate to null, and returning the ContinueSentinel. - function maybeInvokeDelegate(delegate, context) { - var method = delegate.iterator[context.method]; - if (method === undefined) { - // A .throw or .return when the delegate iterator has no .throw - // method always terminates the yield* loop. - context.delegate = null; - - if (context.method === "throw") { - if (delegate.iterator.return) { - // If the delegate iterator has a return method, give it a - // chance to clean up. - context.method = "return"; - context.arg = undefined; - maybeInvokeDelegate(delegate, context); - - if (context.method === "throw") { - // If maybeInvokeDelegate(context) changed context.method from - // "return" to "throw", let that override the TypeError below. - return ContinueSentinel; - } - } - - context.method = "throw"; - context.arg = new TypeError( - "The iterator does not provide a 'throw' method"); - } - - return ContinueSentinel; - } - - var record = tryCatch(method, delegate.iterator, context.arg); - - if (record.type === "throw") { - context.method = "throw"; - context.arg = record.arg; - context.delegate = null; - return ContinueSentinel; - } - - var info = record.arg; - - if (! info) { - context.method = "throw"; - context.arg = new TypeError("iterator result is not an object"); - context.delegate = null; - return ContinueSentinel; - } - - if (info.done) { - // Assign the result of the finished delegate to the temporary - // variable specified by delegate.resultName (see delegateYield). - context[delegate.resultName] = info.value; - - // Resume execution at the desired location (see delegateYield). - context.next = delegate.nextLoc; - - // If context.method was "throw" but the delegate handled the - // exception, let the outer generator proceed normally. If - // context.method was "next", forget context.arg since it has been - // "consumed" by the delegate iterator. If context.method was - // "return", allow the original .return call to continue in the - // outer generator. - if (context.method !== "return") { - context.method = "next"; - context.arg = undefined; - } - - } else { - // Re-yield the result returned by the delegate method. - return info; - } - - // The delegate iterator is finished, so forget it and continue with - // the outer generator. - context.delegate = null; - return ContinueSentinel; - } - - // Define Generator.prototype.{next,throw,return} in terms of the - // unified ._invoke helper method. - defineIteratorMethods(Gp); - - Gp[toStringTagSymbol] = "Generator"; - - // A Generator should always return itself as the iterator object when the - // @@iterator function is called on it. Some browsers' implementations of the - // iterator prototype chain incorrectly implement this, causing the Generator - // object to not be returned from this call. This ensures that doesn't happen. - // See https://github.com/facebook/regenerator/issues/274 for more details. - Gp[iteratorSymbol] = function() { - return this; - }; - - Gp.toString = function() { - return "[object Generator]"; - }; - - function pushTryEntry(locs) { - var entry = { tryLoc: locs[0] }; - - if (1 in locs) { - entry.catchLoc = locs[1]; - } - - if (2 in locs) { - entry.finallyLoc = locs[2]; - entry.afterLoc = locs[3]; - } - - this.tryEntries.push(entry); - } - - function resetTryEntry(entry) { - var record = entry.completion || {}; - record.type = "normal"; - delete record.arg; - entry.completion = record; - } - - function Context(tryLocsList) { - // The root entry object (effectively a try statement without a catch - // or a finally block) gives us a place to store values thrown from - // locations where there is no enclosing try statement. - this.tryEntries = [{ tryLoc: "root" }]; - tryLocsList.forEach(pushTryEntry, this); - this.reset(true); - } - - runtime.keys = function(object) { - var keys = []; - for (var key in object) { - keys.push(key); - } - keys.reverse(); - - // Rather than returning an object with a next method, we keep - // things simple and return the next function itself. - return function next() { - while (keys.length) { - var key = keys.pop(); - if (key in object) { - next.value = key; - next.done = false; - return next; - } - } - - // To avoid creating an additional object, we just hang the .value - // and .done properties off the next function object itself. This - // also ensures that the minifier will not anonymize the function. - next.done = true; - return next; - }; - }; - - function values(iterable) { - if (iterable) { - var iteratorMethod = iterable[iteratorSymbol]; - if (iteratorMethod) { - return iteratorMethod.call(iterable); - } - - if (typeof iterable.next === "function") { - return iterable; - } - - if (!isNaN(iterable.length)) { - var i = -1, next = function next() { - while (++i < iterable.length) { - if (hasOwn.call(iterable, i)) { - next.value = iterable[i]; - next.done = false; - return next; - } - } - - next.value = undefined; - next.done = true; - - return next; - }; - - return next.next = next; - } - } - - // Return an iterator with no values. - return { next: doneResult }; - } - runtime.values = values; - - function doneResult() { - return { value: undefined, done: true }; - } - - Context.prototype = { - constructor: Context, - - reset: function(skipTempReset) { - this.prev = 0; - this.next = 0; - // Resetting context._sent for legacy support of Babel's - // function.sent implementation. - this.sent = this._sent = undefined; - this.done = false; - this.delegate = null; - - this.method = "next"; - this.arg = undefined; - - this.tryEntries.forEach(resetTryEntry); - - if (!skipTempReset) { - for (var name in this) { - // Not sure about the optimal order of these conditions: - if (name.charAt(0) === "t" && - hasOwn.call(this, name) && - !isNaN(+name.slice(1))) { - this[name] = undefined; - } - } - } - }, - - stop: function() { - this.done = true; - - var rootEntry = this.tryEntries[0]; - var rootRecord = rootEntry.completion; - if (rootRecord.type === "throw") { - throw rootRecord.arg; - } - - return this.rval; - }, - - dispatchException: function(exception) { - if (this.done) { - throw exception; - } - - var context = this; - function handle(loc, caught) { - record.type = "throw"; - record.arg = exception; - context.next = loc; - - if (caught) { - // If the dispatched exception was caught by a catch block, - // then let that catch block handle the exception normally. - context.method = "next"; - context.arg = undefined; - } - - return !! caught; - } - - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - var record = entry.completion; - - if (entry.tryLoc === "root") { - // Exception thrown outside of any try block that could handle - // it, so set the completion value of the entire function to - // throw the exception. - return handle("end"); - } - - if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn.call(entry, "catchLoc"); - var hasFinally = hasOwn.call(entry, "finallyLoc"); - - if (hasCatch && hasFinally) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } else if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - - } else if (hasCatch) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } - - } else if (hasFinally) { - if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - - } else { - throw new Error("try statement without catch or finally"); - } - } - } - }, - - abrupt: function(type, arg) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc <= this.prev && - hasOwn.call(entry, "finallyLoc") && - this.prev < entry.finallyLoc) { - var finallyEntry = entry; - break; - } - } - - if (finallyEntry && - (type === "break" || - type === "continue") && - finallyEntry.tryLoc <= arg && - arg <= finallyEntry.finallyLoc) { - // Ignore the finally entry if control is not jumping to a - // location outside the try/catch block. - finallyEntry = null; - } - - var record = finallyEntry ? finallyEntry.completion : {}; - record.type = type; - record.arg = arg; - - if (finallyEntry) { - this.method = "next"; - this.next = finallyEntry.finallyLoc; - return ContinueSentinel; - } - - return this.complete(record); - }, - - complete: function(record, afterLoc) { - if (record.type === "throw") { - throw record.arg; - } - - if (record.type === "break" || - record.type === "continue") { - this.next = record.arg; - } else if (record.type === "return") { - this.rval = this.arg = record.arg; - this.method = "return"; - this.next = "end"; - } else if (record.type === "normal" && afterLoc) { - this.next = afterLoc; - } - - return ContinueSentinel; - }, - - finish: function(finallyLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.finallyLoc === finallyLoc) { - this.complete(entry.completion, entry.afterLoc); - resetTryEntry(entry); - return ContinueSentinel; - } - } - }, - - "catch": function(tryLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc === tryLoc) { - var record = entry.completion; - if (record.type === "throw") { - var thrown = record.arg; - resetTryEntry(entry); - } - return thrown; - } - } - - // The context.catch method must only be called with a location - // argument that corresponds to a known catch block. - throw new Error("illegal catch attempt"); - }, - - delegateYield: function(iterable, resultName, nextLoc) { - this.delegate = { - iterator: values(iterable), - resultName: resultName, - nextLoc: nextLoc - }; - - if (this.method === "next") { - // Deliberately forget the last sent value so that we don't - // accidentally pass it on to the delegate. - this.arg = undefined; - } - - return ContinueSentinel; - } - }; -})( - // In sloppy mode, unbound `this` refers to the global object, fallback to - // Function constructor if we're in global strict mode. That is sadly a form - // of indirect eval which violates Content Security Policy. - (function() { return this })() || Function("return this")() -); diff --git a/node_modules/regex-cache/LICENSE b/node_modules/regex-cache/LICENSE deleted file mode 100644 index c0d7f1362..000000000 --- a/node_modules/regex-cache/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2017, Jon Schlinkert. - -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. \ No newline at end of file diff --git a/node_modules/regex-cache/README.md b/node_modules/regex-cache/README.md deleted file mode 100644 index 8c6601478..000000000 --- a/node_modules/regex-cache/README.md +++ /dev/null @@ -1,166 +0,0 @@ -# regex-cache [![NPM version](https://img.shields.io/npm/v/regex-cache.svg?style=flat)](https://www.npmjs.com/package/regex-cache) [![NPM monthly downloads](https://img.shields.io/npm/dm/regex-cache.svg?style=flat)](https://npmjs.org/package/regex-cache) [![NPM total downloads](https://img.shields.io/npm/dt/regex-cache.svg?style=flat)](https://npmjs.org/package/regex-cache) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/regex-cache.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/regex-cache) [![Windows Build Status](https://img.shields.io/appveyor/ci/jonschlinkert/regex-cache.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/jonschlinkert/regex-cache) - -> Memoize the results of a call to the RegExp constructor, avoiding repetitious runtime compilation of the same string and options, resulting in surprising performance improvements. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save regex-cache -``` - -* Read [what this does](#what-this-does). -* See [the benchmarks](#benchmarks) - -## Usage - -Wrap a function like this: - -```js -var cache = require('regex-cache'); -var someRegex = cache(require('some-regex-lib')); -``` - -**Caching a regex** - -If you want to cache a regex after calling `new RegExp()`, or you're requiring a module that returns a regex, wrap it with a function first: - -```js -var cache = require('regex-cache'); - -function yourRegex(str, opts) { - // do stuff to str and opts - return new RegExp(str, opts.flags); -} - -var regex = cache(yourRegex); -``` - -## Recommendations - -### Use this when... - -* **No options are passed** to the function that creates the regex. Regardless of how big or small the regex is, when zero options are passed, caching will be faster than not. -* **A few options are passed**, and the values are primitives. The limited benchmarks I did show that caching is beneficial when up to 8 or 9 options are passed. - -### Do not use this when... - -* **The values of options are not primitives**. When non-primitives must be compared for equality, the time to compare the options is most likely as long or longer than the time to just create a new regex. - -### Example benchmarks - -Performance results, with and without regex-cache: - -```bash -# no args passed (defaults) - with-cache x 8,699,231 ops/sec ±0.86% (93 runs sampled) - without-cache x 2,777,551 ops/sec ±0.63% (95 runs sampled) - -# string and six options passed - with-cache x 1,885,934 ops/sec ±0.80% (93 runs sampled) - without-cache x 1,256,893 ops/sec ±0.65% (97 runs sampled) - -# string only - with-cache x 7,723,256 ops/sec ±0.87% (92 runs sampled) - without-cache x 2,303,060 ops/sec ±0.47% (99 runs sampled) - -# one option passed - with-cache x 4,179,877 ops/sec ±0.53% (100 runs sampled) - without-cache x 2,198,422 ops/sec ±0.47% (95 runs sampled) - -# two options passed - with-cache x 3,256,222 ops/sec ±0.51% (99 runs sampled) - without-cache x 2,121,401 ops/sec ±0.79% (97 runs sampled) - -# six options passed - with-cache x 1,816,018 ops/sec ±1.08% (96 runs sampled) - without-cache x 1,157,176 ops/sec ±0.53% (100 runs sampled) - -# -# diminishing returns happen about here -# - -# ten options passed - with-cache x 1,210,598 ops/sec ±0.56% (92 runs sampled) - without-cache x 1,665,588 ops/sec ±1.07% (100 runs sampled) - -# twelve options passed - with-cache x 1,042,096 ops/sec ±0.68% (92 runs sampled) - without-cache x 1,389,414 ops/sec ±0.68% (97 runs sampled) - -# twenty options passed - with-cache x 661,125 ops/sec ±0.80% (93 runs sampled) - without-cache x 1,208,757 ops/sec ±0.65% (97 runs sampled) - -# -# when non-primitive values are compared -# - -# single value on the options is an object - with-cache x 1,398,313 ops/sec ±1.05% (95 runs sampled) - without-cache x 2,228,281 ops/sec ±0.56% (99 runs sampled) -``` - -## Run benchmarks - -Install dev dependencies: - -```bash -npm i -d && npm run benchmarks -``` - -## What this does - -If you're using `new RegExp('foo')` instead of a regex literal, it's probably because you need to dyamically generate a regex based on user options or some other potentially changing factors. - -When your function creates a string based on user inputs and passes it to the `RegExp` constructor, regex-cache caches the results. The next time the function is called if the key of a cached regex matches the user input (or no input was given), the cached regex is returned, avoiding unnecessary runtime compilation. - -Using the RegExp constructor offers a lot of flexibility, but the runtime compilation comes at a price - it's slow. Not specifically because of the call to the RegExp constructor, but **because you have to build up the string before `new RegExp()` is even called**. - -## About - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 31 | [jonschlinkert](https://github.com/jonschlinkert) | -| 1 | [MartinKolarik](https://github.com/MartinKolarik) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on September 01, 2017._ \ No newline at end of file diff --git a/node_modules/regex-cache/index.js b/node_modules/regex-cache/index.js deleted file mode 100644 index df8c42312..000000000 --- a/node_modules/regex-cache/index.js +++ /dev/null @@ -1,68 +0,0 @@ -/*! - * regex-cache - * - * Copyright (c) 2015-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var equal = require('is-equal-shallow'); -var basic = {}; -var cache = {}; - -/** - * Expose `regexCache` - */ - -module.exports = regexCache; - -/** - * Memoize the results of a call to the new RegExp constructor. - * - * @param {Function} fn [description] - * @param {String} str [description] - * @param {Options} options [description] - * @param {Boolean} nocompare [description] - * @return {RegExp} - */ - -function regexCache(fn, str, opts) { - var key = '_default_', regex, cached; - - if (!str && !opts) { - if (typeof fn !== 'function') { - return fn; - } - return basic[key] || (basic[key] = fn(str)); - } - - var isString = typeof str === 'string'; - if (isString) { - if (!opts) { - return basic[str] || (basic[str] = fn(str)); - } - key = str; - } else { - opts = str; - } - - cached = cache[key]; - if (cached && equal(cached.opts, opts)) { - return cached.regex; - } - - memo(key, opts, (regex = fn(str, opts))); - return regex; -} - -function memo(key, opts, regex) { - cache[key] = {regex: regex, opts: opts}; -} - -/** - * Expose `cache` - */ - -module.exports.cache = cache; -module.exports.basic = basic; diff --git a/node_modules/regex-cache/package.json b/node_modules/regex-cache/package.json deleted file mode 100644 index b63b9a0b9..000000000 --- a/node_modules/regex-cache/package.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "_from": "regex-cache@^0.4.2", - "_id": "regex-cache@0.4.4", - "_inBundle": false, - "_integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", - "_location": "/regex-cache", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "regex-cache@^0.4.2", - "name": "regex-cache", - "escapedName": "regex-cache", - "rawSpec": "^0.4.2", - "saveSpec": null, - "fetchSpec": "^0.4.2" - }, - "_requiredBy": [ - "/micromatch" - ], - "_resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "_shasum": "75bdc58a2a1496cec48a12835bc54c8d562336dd", - "_spec": "regex-cache@^0.4.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/micromatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/regex-cache/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Martin Kolárik", - "url": "https://kolarik.sk" - } - ], - "dependencies": { - "is-equal-shallow": "^0.1.3" - }, - "deprecated": false, - "description": "Memoize the results of a call to the RegExp constructor, avoiding repetitious runtime compilation of the same string and options, resulting in surprising performance improvements.", - "devDependencies": { - "ansi-bold": "^0.1.1", - "benchmarked": "^0.1.5", - "gulp-format-md": "^0.1.7", - "micromatch": "^2.3.7", - "should": "^8.3.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/regex-cache", - "keywords": [ - "cache", - "expression", - "regex", - "regexp", - "regular", - "regular expression", - "store", - "to-regex" - ], - "license": "MIT", - "main": "index.js", - "name": "regex-cache", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/regex-cache.git" - }, - "scripts": { - "benchmarks": "node benchmark", - "test": "mocha" - }, - "verb": { - "run": true, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "reflinks": [ - "verb" - ], - "lint": { - "reflinks": true - } - }, - "version": "0.4.4" -} diff --git a/node_modules/regex-not/LICENSE b/node_modules/regex-not/LICENSE deleted file mode 100644 index 8ee09d911..000000000 --- a/node_modules/regex-not/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016, 2018, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/regex-not/README.md b/node_modules/regex-not/README.md deleted file mode 100644 index 24d00e7de..000000000 --- a/node_modules/regex-not/README.md +++ /dev/null @@ -1,133 +0,0 @@ -# regex-not [![NPM version](https://img.shields.io/npm/v/regex-not.svg?style=flat)](https://www.npmjs.com/package/regex-not) [![NPM monthly downloads](https://img.shields.io/npm/dm/regex-not.svg?style=flat)](https://npmjs.org/package/regex-not) [![NPM total downloads](https://img.shields.io/npm/dt/regex-not.svg?style=flat)](https://npmjs.org/package/regex-not) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/regex-not.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/regex-not) - -> Create a javascript regular expression for matching everything except for the given string. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save regex-not -``` - -## Usage - -```js -var not = require('regex-not'); -``` - -The main export is a function that takes a string an options object. - -```js -not(string[, options]); -``` - -**Example** - -```js -var not = require('regex-not'); -console.log(not('foo')); -//=> /^(?:(?!^(?:foo)$).)+$/ -``` - -**Strict matching** - -By default, the returned regex is for strictly (not) matching the exact given pattern (in other words, "match this string if it does NOT _exactly equal_ `foo`"): - -```js -var re = not('foo'); -console.log(re.test('foo')); //=> false -console.log(re.test('bar')); //=> true -console.log(re.test('foobar')); //=> true -console.log(re.test('barfoo')); //=> true -``` - -### .create - -Returns a string to allow you to create your own regex: - -```js -console.log(not.create('foo')); -//=> '(?:(?!^(?:foo)$).)+' -``` - -### Options - -**options.contains** - -You can relax strict matching by setting `options.contains` to true (in other words, "match this string if it does NOT _contain_ `foo`"): - -```js -var re = not('foo'); -console.log(re.test('foo', {contains: true})); //=> false -console.log(re.test('bar', {contains: true})); //=> true -console.log(re.test('foobar', {contains: true})); //=> false -console.log(re.test('barfoo', {contains: true})); //=> false -``` - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    - -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [regex-cache](https://www.npmjs.com/package/regex-cache): Memoize the results of a call to the RegExp constructor, avoiding repetitious runtime compilation of… [more](https://github.com/jonschlinkert/regex-cache) | [homepage](https://github.com/jonschlinkert/regex-cache "Memoize the results of a call to the RegExp constructor, avoiding repetitious runtime compilation of the same string and options, resulting in surprising performance improvements.") -* [to-regex](https://www.npmjs.com/package/to-regex): Generate a regex from a string or array of strings. | [homepage](https://github.com/jonschlinkert/to-regex "Generate a regex from a string or array of strings.") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 9 | [jonschlinkert](https://github.com/jonschlinkert) | -| 1 | [doowb](https://github.com/doowb) | -| 1 | [EdwardBetts](https://github.com/EdwardBetts) | - -### Author - -**Jon Schlinkert** - -* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on February 19, 2018._ \ No newline at end of file diff --git a/node_modules/regex-not/index.js b/node_modules/regex-not/index.js deleted file mode 100644 index 02bfed4a8..000000000 --- a/node_modules/regex-not/index.js +++ /dev/null @@ -1,72 +0,0 @@ -'use strict'; - -var extend = require('extend-shallow'); -var safe = require('safe-regex'); - -/** - * The main export is a function that takes a `pattern` string and an `options` object. - * - * ```js - & var not = require('regex-not'); - & console.log(not('foo')); - & //=> /^(?:(?!^(?:foo)$).)*$/ - * ``` - * - * @param {String} `pattern` - * @param {Object} `options` - * @return {RegExp} Converts the given `pattern` to a regex using the specified `options`. - * @api public - */ - -function toRegex(pattern, options) { - return new RegExp(toRegex.create(pattern, options)); -} - -/** - * Create a regex-compatible string from the given `pattern` and `options`. - * - * ```js - & var not = require('regex-not'); - & console.log(not.create('foo')); - & //=> '^(?:(?!^(?:foo)$).)*$' - * ``` - * @param {String} `pattern` - * @param {Object} `options` - * @return {String} - * @api public - */ - -toRegex.create = function(pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('expected a string'); - } - - var opts = extend({}, options); - if (opts.contains === true) { - opts.strictNegate = false; - } - - var open = opts.strictOpen !== false ? '^' : ''; - var close = opts.strictClose !== false ? '$' : ''; - var endChar = opts.endChar ? opts.endChar : '+'; - var str = pattern; - - if (opts.strictNegate === false) { - str = '(?:(?!(?:' + pattern + ')).)' + endChar; - } else { - str = '(?:(?!^(?:' + pattern + ')$).)' + endChar; - } - - var res = open + str + close; - if (opts.safe === true && safe(res) === false) { - throw new Error('potentially unsafe regular expression: ' + res); - } - - return res; -}; - -/** - * Expose `toRegex` - */ - -module.exports = toRegex; diff --git a/node_modules/regex-not/package.json b/node_modules/regex-not/package.json deleted file mode 100644 index 5d35f67f4..000000000 --- a/node_modules/regex-not/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "_from": "regex-not@^1.0.0", - "_id": "regex-not@1.0.2", - "_inBundle": false, - "_integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "_location": "/regex-not", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "regex-not@^1.0.0", - "name": "regex-not", - "escapedName": "regex-not", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/nanomatch", - "/readdirp/expand-brackets", - "/readdirp/extglob", - "/readdirp/micromatch", - "/to-regex" - ], - "_resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "_shasum": "1f4ece27e00b0b65e0247a6810e6a85d83a5752c", - "_spec": "regex-not@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/regex-not/issues" - }, - "bundleDependencies": false, - "dependencies": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - }, - "deprecated": false, - "description": "Create a javascript regular expression for matching everything except for the given string.", - "devDependencies": { - "gulp-format-md": "^1.0.0", - "mocha": "^3.5.3" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/regex-not", - "keywords": [ - "exec", - "match", - "negate", - "negation", - "not", - "regex", - "regular expression", - "test" - ], - "license": "MIT", - "main": "index.js", - "name": "regex-not", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/regex-not.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "regex-cache", - "to-regex" - ] - }, - "reflinks": [ - "verb", - "verb-generate-readme" - ], - "lint": { - "reflinks": true - } - }, - "version": "1.0.2" -} diff --git a/node_modules/reload-css/LICENSE.md b/node_modules/reload-css/LICENSE.md deleted file mode 100644 index 20a7f479c..000000000 --- a/node_modules/reload-css/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) -Copyright (c) 2017 Jam3 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE -OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/node_modules/reload-css/README.md b/node_modules/reload-css/README.md deleted file mode 100644 index 6d1a49ece..000000000 --- a/node_modules/reload-css/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# reload-css - -[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges) - -This module reloads all style sheets associated with a specified `url`. This is primarily useful for LiveReload servers that wish to update style sheets without triggering a full page refresh. - -If you omit the `url` argument, all style sheets will be cache busted. - -## Install - -```sh -npm install reload-css --save -``` - -## Usage - -[![NPM](https://nodei.co/npm/reload-css.png)](https://www.npmjs.com/package/reload-css) - -#### `reloadCSS([url], [opt])` - -Cache-busts the URLs for all `` tags that match the specified `url`, as well as any other style sheets that `@import` the URL. - -By default, this will only look for local style sheets (i.e. `localhost`, `127.0.0.1`, or matching the document domain). You can pass `{ local: false }` as the options to cache bust all styles. - -In some cases, it will walk upwards to a more top-level style sheet (i.e. in a long chain of import dependencies) to ensure a consistent result across browsers. Import statements are updated in the `cssRules`, and `` tags are re-attached for a clean update (no flicker/flash). - -You can omit `url` or pass `null` as the first argument to reload all styles instead of just a target one. - -## License - -MIT, see [LICENSE.md](http://github.com/Jam3/reload-css/blob/master/LICENSE.md) for details. diff --git a/node_modules/reload-css/index.js b/node_modules/reload-css/index.js deleted file mode 100644 index 22d21d971..000000000 --- a/node_modules/reload-css/index.js +++ /dev/null @@ -1,244 +0,0 @@ -var qs = require('query-string'); -var URL = require('./lib/url'); -var baseHosts = getBaseHosts(); - -module.exports = function (url, opt) { - // by default, only reloads local style sheets - var localOnly = true; - if (opt && opt.local === false) { - localOnly = false; - } - - // determine base URL - var baseUrl = document.location.pathname; - var baseTag = document.querySelector('base'); - if (baseTag) { - baseUrl = baseTag.getAttribute('href'); - var parsedBase = URL.parse(baseUrl); - parsedBase.pathname = '/'; - parsedBase.hash = null; - parsedBase.query = null; - parsedBase.search = null; - baseUrl = URL.format(parsedBase); - } - - // Find all and - - -
    -

    The MIT License (MIT)

    -

    Copyright (c) 2016 Rod Vagg (the "Original Author") and additional 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.

    -
    -
    - - \ No newline at end of file diff --git a/node_modules/through2/LICENSE.md b/node_modules/through2/LICENSE.md deleted file mode 100644 index 7f0b93daa..000000000 --- a/node_modules/through2/LICENSE.md +++ /dev/null @@ -1,9 +0,0 @@ -# The MIT License (MIT) - -**Copyright (c) 2016 Rod Vagg (the "Original Author") and additional 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. \ No newline at end of file diff --git a/node_modules/through2/README.md b/node_modules/through2/README.md deleted file mode 100644 index a916f15ef..000000000 --- a/node_modules/through2/README.md +++ /dev/null @@ -1,136 +0,0 @@ -# through2 - -[![NPM](https://nodei.co/npm/through2.png?downloads&downloadRank)](https://nodei.co/npm/through2/) - -**A tiny wrapper around Node streams.Transform (Streams2) to avoid explicit subclassing noise** - -Inspired by [Dominic Tarr](https://github.com/dominictarr)'s [through](https://github.com/dominictarr/through) in that it's so much easier to make a stream out of a function than it is to set up the prototype chain properly: `through(function (chunk) { ... })`. - -Note: As 2.x.x this module starts using **Streams3** instead of Stream2. To continue using a Streams2 version use `npm install through2@0` to fetch the latest version of 0.x.x. More information about Streams2 vs Streams3 and recommendations see the article **[Why I don't use Node's core 'stream' module](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html)**. - -```js -fs.createReadStream('ex.txt') - .pipe(through2(function (chunk, enc, callback) { - for (var i = 0; i < chunk.length; i++) - if (chunk[i] == 97) - chunk[i] = 122 // swap 'a' for 'z' - - this.push(chunk) - - callback() - })) - .pipe(fs.createWriteStream('out.txt')) - .on('finish', function () { - doSomethingSpecial() - }) -``` - -Or object streams: - -```js -var all = [] - -fs.createReadStream('data.csv') - .pipe(csv2()) - .pipe(through2.obj(function (chunk, enc, callback) { - var data = { - name : chunk[0] - , address : chunk[3] - , phone : chunk[10] - } - this.push(data) - - callback() - })) - .on('data', function (data) { - all.push(data) - }) - .on('end', function () { - doSomethingSpecial(all) - }) -``` - -Note that `through2.obj(fn)` is a convenience wrapper around `through2({ objectMode: true }, fn)`. - -## API - -through2([ options, ] [ transformFunction ] [, flushFunction ]) - -Consult the **[stream.Transform](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_transform)** documentation for the exact rules of the `transformFunction` (i.e. `this._transform`) and the optional `flushFunction` (i.e. `this._flush`). - -### options - -The options argument is optional and is passed straight through to `stream.Transform`. So you can use `objectMode:true` if you are processing non-binary streams (or just use `through2.obj()`). - -The `options` argument is first, unlike standard convention, because if I'm passing in an anonymous function then I'd prefer for the options argument to not get lost at the end of the call: - -```js -fs.createReadStream('/tmp/important.dat') - .pipe(through2({ objectMode: true, allowHalfOpen: false }, - function (chunk, enc, cb) { - cb(null, 'wut?') // note we can use the second argument on the callback - // to provide data as an alternative to this.push('wut?') - } - ) - .pipe(fs.createWriteStream('/tmp/wut.txt')) -``` - -### transformFunction - -The `transformFunction` must have the following signature: `function (chunk, encoding, callback) {}`. A minimal implementation should call the `callback` function to indicate that the transformation is done, even if that transformation means discarding the chunk. - -To queue a new chunk, call `this.push(chunk)`—this can be called as many times as required before the `callback()` if you have multiple pieces to send on. - -Alternatively, you may use `callback(err, chunk)` as shorthand for emitting a single chunk or an error. - -If you **do not provide a `transformFunction`** then you will get a simple pass-through stream. - -### flushFunction - -The optional `flushFunction` is provided as the last argument (2nd or 3rd, depending on whether you've supplied options) is called just prior to the stream ending. Can be used to finish up any processing that may be in progress. - -```js -fs.createReadStream('/tmp/important.dat') - .pipe(through2( - function (chunk, enc, cb) { cb(null, chunk) }, // transform is a noop - function (cb) { // flush function - this.push('tacking on an extra buffer to the end'); - cb(); - } - )) - .pipe(fs.createWriteStream('/tmp/wut.txt')); -``` - -through2.ctor([ options, ] transformFunction[, flushFunction ]) - -Instead of returning a `stream.Transform` instance, `through2.ctor()` returns a **constructor** for a custom Transform. This is useful when you want to use the same transform logic in multiple instances. - -```js -var FToC = through2.ctor({objectMode: true}, function (record, encoding, callback) { - if (record.temp != null && record.unit == "F") { - record.temp = ( ( record.temp - 32 ) * 5 ) / 9 - record.unit = "C" - } - this.push(record) - callback() -}) - -// Create instances of FToC like so: -var converter = new FToC() -// Or: -var converter = FToC() -// Or specify/override options when you instantiate, if you prefer: -var converter = FToC({objectMode: true}) -``` - -## See Also - - - [through2-map](https://github.com/brycebaril/through2-map) - Array.prototype.map analog for streams. - - [through2-filter](https://github.com/brycebaril/through2-filter) - Array.prototype.filter analog for streams. - - [through2-reduce](https://github.com/brycebaril/through2-reduce) - Array.prototype.reduce analog for streams. - - [through2-spy](https://github.com/brycebaril/through2-spy) - Wrapper for simple stream.PassThrough spies. - - the [mississippi stream utility collection](https://github.com/maxogden/mississippi) includes `through2` as well as many more useful stream modules similar to this one - -## License - -**through2** is Copyright (c) 2013 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details. diff --git a/node_modules/through2/package.json b/node_modules/through2/package.json deleted file mode 100644 index 40e619371..000000000 --- a/node_modules/through2/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_from": "through2@^2.0.0", - "_id": "through2@2.0.3", - "_inBundle": false, - "_integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", - "_location": "/through2", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "through2@^2.0.0", - "name": "through2", - "escapedName": "through2", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/browser-pack", - "/browserify", - "/deps-sort", - "/insert-module-globals", - "/module-deps", - "/watchify" - ], - "_resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "_shasum": "0004569b37c7c74ba39c43f3ced78d1ad94140be", - "_spec": "through2@^2.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "Rod Vagg", - "email": "r@va.gg", - "url": "https://github.com/rvagg" - }, - "bugs": { - "url": "https://github.com/rvagg/through2/issues" - }, - "bundleDependencies": false, - "dependencies": { - "readable-stream": "^2.1.5", - "xtend": "~4.0.1" - }, - "deprecated": false, - "description": "A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise", - "devDependencies": { - "bl": "~1.1.2", - "faucet": "0.0.1", - "stream-spigot": "~3.0.5", - "tape": "~4.6.2" - }, - "homepage": "https://github.com/rvagg/through2#readme", - "keywords": [ - "stream", - "streams2", - "through", - "transform" - ], - "license": "MIT", - "main": "through2.js", - "name": "through2", - "repository": { - "type": "git", - "url": "git+https://github.com/rvagg/through2.git" - }, - "scripts": { - "test": "node test/test.js | faucet", - "test-local": "brtapsauce-local test/basic-test.js" - }, - "version": "2.0.3" -} diff --git a/node_modules/through2/through2.js b/node_modules/through2/through2.js deleted file mode 100644 index 5b7a880e8..000000000 --- a/node_modules/through2/through2.js +++ /dev/null @@ -1,96 +0,0 @@ -var Transform = require('readable-stream/transform') - , inherits = require('util').inherits - , xtend = require('xtend') - -function DestroyableTransform(opts) { - Transform.call(this, opts) - this._destroyed = false -} - -inherits(DestroyableTransform, Transform) - -DestroyableTransform.prototype.destroy = function(err) { - if (this._destroyed) return - this._destroyed = true - - var self = this - process.nextTick(function() { - if (err) - self.emit('error', err) - self.emit('close') - }) -} - -// a noop _transform function -function noop (chunk, enc, callback) { - callback(null, chunk) -} - - -// create a new export function, used by both the main export and -// the .ctor export, contains common logic for dealing with arguments -function through2 (construct) { - return function (options, transform, flush) { - if (typeof options == 'function') { - flush = transform - transform = options - options = {} - } - - if (typeof transform != 'function') - transform = noop - - if (typeof flush != 'function') - flush = null - - return construct(options, transform, flush) - } -} - - -// main export, just make me a transform stream! -module.exports = through2(function (options, transform, flush) { - var t2 = new DestroyableTransform(options) - - t2._transform = transform - - if (flush) - t2._flush = flush - - return t2 -}) - - -// make me a reusable prototype that I can `new`, or implicitly `new` -// with a constructor call -module.exports.ctor = through2(function (options, transform, flush) { - function Through2 (override) { - if (!(this instanceof Through2)) - return new Through2(override) - - this.options = xtend(options, override) - - DestroyableTransform.call(this, this.options) - } - - inherits(Through2, DestroyableTransform) - - Through2.prototype._transform = transform - - if (flush) - Through2.prototype._flush = flush - - return Through2 -}) - - -module.exports.obj = through2(function (options, transform, flush) { - var t2 = new DestroyableTransform(xtend({ objectMode: true, highWaterMark: 16 }, options)) - - t2._transform = transform - - if (flush) - t2._flush = flush - - return t2 -}) diff --git a/node_modules/timers-browserify/.npmignore b/node_modules/timers-browserify/.npmignore deleted file mode 100644 index 03e05e4c0..000000000 --- a/node_modules/timers-browserify/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.DS_Store -/node_modules diff --git a/node_modules/timers-browserify/CHANGELOG.md b/node_modules/timers-browserify/CHANGELOG.md deleted file mode 100644 index a7cd8bc87..000000000 --- a/node_modules/timers-browserify/CHANGELOG.md +++ /dev/null @@ -1,58 +0,0 @@ -# Change Log -All notable changes to this project will be documented in this file. -This project adheres to [Semantic Versioning](http://semver.org/). - -## 1.4.0 - 2015-02-23 - -### Added -* Link to `timers-browserify-full`, which offers a larger, but much more exact, - version of Node's `timers` library - -### Changed -* `setTimeout` and `setInterval` return objects with the same API as the Node - implementation, instead of just IDs - -### Fixed -* `active` implementation actually has an effect, as in Node -* Replaced usages of `apply` that break in IE 8 - -## 1.3.0 - 2015-02-04 - -### Changed -* Prefer native versions of `setImmediate` and `clearImmediate` if they exist - -## 1.2.0 - 2015-01-02 - -### Changed -* Update `process` dependency - -## 1.1.0 - 2014-08-26 - -### Added -* `clearImmediate` available to undo `setImmediate` - -## 1.0.3 - 2014-06-30 - -### Fixed -* Resume returning opaque IDs from `setTimeout` and `setInterval` - -## 1.0.2 - 2014-06-30 - -### Fixed -* Pass `window` explicitly to `setTimeout` and others to resolve an error in - Chrome - -## 1.0.1 - 2013-12-28 - -### Changed -* Replaced `setimmediate` dependency with `process` for the `nextTick` shim - -## 1.0.0 - 2013-12-10 - -### Added -* Guard against undefined globals like `setTimeout` in some environments - -## 0.0.0 - 2012-05-30 - -### Added -* Basic functionality for initial release diff --git a/node_modules/timers-browserify/LICENSE.md b/node_modules/timers-browserify/LICENSE.md deleted file mode 100644 index 940ec90a7..000000000 --- a/node_modules/timers-browserify/LICENSE.md +++ /dev/null @@ -1,46 +0,0 @@ -# timers-browserify - -This project uses the [MIT](http://jryans.mit-license.org/) license: - - Copyright © 2012 J. Ryan Stinnett - - 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. - -# lib/node - -The `lib/node` directory borrows files from joyent/node which uses the following license: - - Copyright Joyent, Inc. and other Node contributors. All rights reserved. - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. diff --git a/node_modules/timers-browserify/README.md b/node_modules/timers-browserify/README.md deleted file mode 100644 index c7efa1921..000000000 --- a/node_modules/timers-browserify/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Overview - -Adds support for the `timers` module to browserify. - -## Wait, isn't it already supported in the browser? - -The public methods of the `timers` module are: - -* `setTimeout(callback, delay, [arg], [...])` -* `clearTimeout(timeoutId)` -* `setInterval(callback, delay, [arg], [...])` -* `clearInterval(intervalId)` - -and indeed, browsers support these already. - -## So, why does this exist? - -The `timers` module also includes some private methods used in other built-in -Node.js modules: - -* `enroll(item, delay)` -* `unenroll(item)` -* `active(item)` - -These are used to efficiently support a large quantity of timers with the same -timeouts by creating only a few timers under the covers. - -Node.js also offers the `immediate` APIs, which aren't yet available cross-browser, so we polyfill those: - -* `setImmediate(callback, [arg], [...])` -* `clearImmediate(immediateId)` - -## I need lots of timers and want to use linked list timers as Node.js does. - -Linked lists are efficient when you have thousands (millions?) of timers with the same delay. -Take a look at [timers-browserify-full](https://www.npmjs.com/package/timers-browserify-full) in this case. - -# License - -[MIT](http://jryans.mit-license.org/) diff --git a/node_modules/timers-browserify/example/enroll/build.sh b/node_modules/timers-browserify/example/enroll/build.sh deleted file mode 100755 index d276735d4..000000000 --- a/node_modules/timers-browserify/example/enroll/build.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -browserify --debug -o js/browserify.js js/main.js diff --git a/node_modules/timers-browserify/example/enroll/index.html b/node_modules/timers-browserify/example/enroll/index.html deleted file mode 100644 index 9cc11401b..000000000 --- a/node_modules/timers-browserify/example/enroll/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/node_modules/timers-browserify/example/enroll/js/browserify.js b/node_modules/timers-browserify/example/enroll/js/browserify.js deleted file mode 100644 index c2d08210a..000000000 --- a/node_modules/timers-browserify/example/enroll/js/browserify.js +++ /dev/null @@ -1,233 +0,0 @@ -var require = function (file, cwd) { - var resolved = require.resolve(file, cwd || '/'); - var mod = require.modules[resolved]; - if (!mod) throw new Error( - 'Failed to resolve module ' + file + ', tried ' + resolved - ); - var res = mod._cached ? mod._cached : mod(); - return res; -} - -require.paths = []; -require.modules = {}; -require.extensions = [".js",".coffee"]; - -require._core = { - 'assert': true, - 'events': true, - 'fs': true, - 'path': true, - 'vm': true -}; - -require.resolve = (function () { - return function (x, cwd) { - if (!cwd) cwd = '/'; - - if (require._core[x]) return x; - var path = require.modules.path(); - cwd = path.resolve('/', cwd); - var y = cwd || '/'; - - if (x.match(/^(?:\.\.?\/|\/)/)) { - var m = loadAsFileSync(path.resolve(y, x)) - || loadAsDirectorySync(path.resolve(y, x)); - if (m) return m; - } - - var n = loadNodeModulesSync(x, y); - if (n) return n; - - throw new Error("Cannot find module '" + x + "'"); - - function loadAsFileSync (x) { - if (require.modules[x]) { - return x; - } - - for (var i = 0; i < require.extensions.length; i++) { - var ext = require.extensions[i]; - if (require.modules[x + ext]) return x + ext; - } - } - - function loadAsDirectorySync (x) { - x = x.replace(/\/+$/, ''); - var pkgfile = x + '/package.json'; - if (require.modules[pkgfile]) { - var pkg = require.modules[pkgfile](); - var b = pkg.browserify; - if (typeof b === 'object' && b.main) { - var m = loadAsFileSync(path.resolve(x, b.main)); - if (m) return m; - } - else if (typeof b === 'string') { - var m = loadAsFileSync(path.resolve(x, b)); - if (m) return m; - } - else if (pkg.main) { - var m = loadAsFileSync(path.resolve(x, pkg.main)); - if (m) return m; - } - } - - return loadAsFileSync(x + '/index'); - } - - function loadNodeModulesSync (x, start) { - var dirs = nodeModulesPathsSync(start); - for (var i = 0; i < dirs.length; i++) { - var dir = dirs[i]; - var m = loadAsFileSync(dir + '/' + x); - if (m) return m; - var n = loadAsDirectorySync(dir + '/' + x); - if (n) return n; - } - - var m = loadAsFileSync(x); - if (m) return m; - } - - function nodeModulesPathsSync (start) { - var parts; - if (start === '/') parts = [ '' ]; - else parts = path.normalize(start).split('/'); - - var dirs = []; - for (var i = parts.length - 1; i >= 0; i--) { - if (parts[i] === 'node_modules') continue; - var dir = parts.slice(0, i + 1).join('/') + '/node_modules'; - dirs.push(dir); - } - - return dirs; - } - }; -})(); - -require.alias = function (from, to) { - var path = require.modules.path(); - var res = null; - try { - res = require.resolve(from + '/package.json', '/'); - } - catch (err) { - res = require.resolve(from, '/'); - } - var basedir = path.dirname(res); - - var keys = (Object.keys || function (obj) { - var res = []; - for (var key in obj) res.push(key) - return res; - })(require.modules); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (key.slice(0, basedir.length + 1) === basedir + '/') { - var f = key.slice(basedir.length); - require.modules[to + f] = require.modules[basedir + f]; - } - else if (key === basedir) { - require.modules[to] = require.modules[basedir]; - } - } -}; - -require.define = function (filename, fn) { - var dirname = require._core[filename] - ? '' - : require.modules.path().dirname(filename) - ; - - var require_ = function (file) { - return require(file, dirname) - }; - require_.resolve = function (name) { - return require.resolve(name, dirname); - }; - require_.modules = require.modules; - require_.define = require.define; - var module_ = { exports : {} }; - - require.modules[filename] = function () { - require.modules[filename]._cached = module_.exports; - fn.call( - module_.exports, - require_, - module_, - module_.exports, - dirname, - filename - ); - require.modules[filename]._cached = module_.exports; - return module_.exports; - }; -}; - -if (typeof process === 'undefined') process = {}; - -if (!process.nextTick) process.nextTick = (function () { - var queue = []; - var canPost = typeof window !== 'undefined' - && window.postMessage && window.addEventListener - ; - - if (canPost) { - window.addEventListener('message', function (ev) { - if (ev.source === window && ev.data === 'browserify-tick') { - ev.stopPropagation(); - if (queue.length > 0) { - var fn = queue.shift(); - fn(); - } - } - }, true); - } - - return function (fn) { - if (canPost) { - queue.push(fn); - window.postMessage('browserify-tick', '*'); - } - else setTimeout(fn, 0); - }; -})(); - -if (!process.title) process.title = 'browser'; - -if (!process.binding) process.binding = function (name) { - if (name === 'evals') return require('vm') - else throw new Error('No such module') -}; - -if (!process.cwd) process.cwd = function () { return '.' }; - -if (!process.env) process.env = {}; -if (!process.argv) process.argv = []; - -require.define("path", Function( - [ 'require', 'module', 'exports', '__dirname', '__filename' ], - "function filter (xs, fn) {\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (fn(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length; i >= 0; i--) {\n var last = parts[i];\n if (last == '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// Regex to split a filename into [*, dir, basename, ext]\n// posix version\nvar splitPathRe = /^(.+\\/(?!$)|\\/)?((?:.+?)?(\\.[^.]*)?)$/;\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\nvar resolvedPath = '',\n resolvedAbsolute = false;\n\nfor (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0)\n ? arguments[i]\n : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string' || !path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n}\n\n// At this point the path should be resolved to a full absolute path, but\n// handle relative paths to be safe (might happen when process.cwd() fails)\n\n// Normalize the path\nresolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\nvar isAbsolute = path.charAt(0) === '/',\n trailingSlash = path.slice(-1) === '/';\n\n// Normalize the path\npath = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n \n return (isAbsolute ? '/' : '') + path;\n};\n\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n return p && typeof p === 'string';\n }).join('/'));\n};\n\n\nexports.dirname = function(path) {\n var dir = splitPathRe.exec(path)[1] || '';\n var isWindows = false;\n if (!dir) {\n // No dirname\n return '.';\n } else if (dir.length === 1 ||\n (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) {\n // It is just a slash or a drive letter with a slash\n return dir;\n } else {\n // It is a full dirname, strip trailing slash\n return dir.substring(0, dir.length - 1);\n }\n};\n\n\nexports.basename = function(path, ext) {\n var f = splitPathRe.exec(path)[2] || '';\n // TODO: make this comparison case-insensitive on windows?\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\n\nexports.extname = function(path) {\n return splitPathRe.exec(path)[3] || '';\n};\n\n//@ sourceURL=path" -)); - -require.define("timers", Function( - [ 'require', 'module', 'exports', '__dirname', '__filename' ], - "module.exports = require(\"timers-browserify\")\n//@ sourceURL=timers" -)); - -require.define("/node_modules/timers-browserify/package.json", Function( - [ 'require', 'module', 'exports', '__dirname', '__filename' ], - "module.exports = {\"main\":\"main.js\"}\n//@ sourceURL=/node_modules/timers-browserify/package.json" -)); - -require.define("/node_modules/timers-browserify/main.js", Function( - [ 'require', 'module', 'exports', '__dirname', '__filename' ], - "// DOM APIs, for completeness\n\nexports.setTimeout = setTimeout;\nexports.clearTimeout = clearTimeout;\nexports.setInterval = setInterval;\nexports.clearInterval = clearInterval;\n\n// TODO: Change to more effiecient list approach used in Node.js\n// For now, we just implement the APIs using the primitives above.\n\nexports.enroll = function(item, delay) {\n item._timeoutID = setTimeout(item._onTimeout, delay);\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._timeoutID);\n};\n\nexports.active = function(item) {\n // our naive impl doesn't care (correctness is still preserved)\n};\n\n//@ sourceURL=/node_modules/timers-browserify/main.js" -)); - -require.define("/main.js", Function( - [ 'require', 'module', 'exports', '__dirname', '__filename' ], - "var timers = require('timers');\n\nvar obj = {\n _onTimeout: function() {\n console.log('Timer ran for: ' + (new Date().getTime() - obj.now) + ' ms');\n },\n start: function() {\n console.log('Timer should run for 100 ms');\n this.now = new Date().getTime();\n timers.enroll(this, 100);\n }\n};\n\nobj.start();\n\n//@ sourceURL=/main.js" -)); -require("/main.js"); diff --git a/node_modules/timers-browserify/example/enroll/js/main.js b/node_modules/timers-browserify/example/enroll/js/main.js deleted file mode 100644 index 0007df854..000000000 --- a/node_modules/timers-browserify/example/enroll/js/main.js +++ /dev/null @@ -1,14 +0,0 @@ -var timers = require('timers'); - -var obj = { - _onTimeout: function() { - console.log('Timer ran for: ' + (new Date().getTime() - obj.now) + ' ms'); - }, - start: function() { - console.log('Timer should run for 100 ms'); - this.now = new Date().getTime(); - timers.enroll(this, 100); - } -}; - -obj.start(); diff --git a/node_modules/timers-browserify/example/enroll/server.js b/node_modules/timers-browserify/example/enroll/server.js deleted file mode 100644 index 37b1a0ad6..000000000 --- a/node_modules/timers-browserify/example/enroll/server.js +++ /dev/null @@ -1,11 +0,0 @@ -var connect = require('connect'); -var server = connect.createServer(); -server.use(connect.static(__dirname)); - -var browserify = require('browserify'); -var bundle = browserify(__dirname + '/js/main.js', { mount: '/js/browserify.js' }); -server.use(bundle); - -var port = parseInt(process.argv[2] || 8080, 10); -server.listen(port); -console.log('Listening on :' + port); diff --git a/node_modules/timers-browserify/main.js b/node_modules/timers-browserify/main.js deleted file mode 100644 index 38c058f19..000000000 --- a/node_modules/timers-browserify/main.js +++ /dev/null @@ -1,76 +0,0 @@ -var nextTick = require('process/browser.js').nextTick; -var apply = Function.prototype.apply; -var slice = Array.prototype.slice; -var immediateIds = {}; -var nextImmediateId = 0; - -// DOM APIs, for completeness - -exports.setTimeout = function() { - return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout); -}; -exports.setInterval = function() { - return new Timeout(apply.call(setInterval, window, arguments), clearInterval); -}; -exports.clearTimeout = -exports.clearInterval = function(timeout) { timeout.close(); }; - -function Timeout(id, clearFn) { - this._id = id; - this._clearFn = clearFn; -} -Timeout.prototype.unref = Timeout.prototype.ref = function() {}; -Timeout.prototype.close = function() { - this._clearFn.call(window, this._id); -}; - -// Does not start the time, just sets up the members needed. -exports.enroll = function(item, msecs) { - clearTimeout(item._idleTimeoutId); - item._idleTimeout = msecs; -}; - -exports.unenroll = function(item) { - clearTimeout(item._idleTimeoutId); - item._idleTimeout = -1; -}; - -exports._unrefActive = exports.active = function(item) { - clearTimeout(item._idleTimeoutId); - - var msecs = item._idleTimeout; - if (msecs >= 0) { - item._idleTimeoutId = setTimeout(function onTimeout() { - if (item._onTimeout) - item._onTimeout(); - }, msecs); - } -}; - -// That's not how node.js implements it but the exposed api is the same. -exports.setImmediate = typeof setImmediate === "function" ? setImmediate : function(fn) { - var id = nextImmediateId++; - var args = arguments.length < 2 ? false : slice.call(arguments, 1); - - immediateIds[id] = true; - - nextTick(function onNextTick() { - if (immediateIds[id]) { - // fn.call() is faster so we optimize for the common use-case - // @see http://jsperf.com/call-apply-segu - if (args) { - fn.apply(null, args); - } else { - fn.call(null); - } - // Prevent ids from leaking - exports.clearImmediate(id); - } - }); - - return id; -}; - -exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) { - delete immediateIds[id]; -}; \ No newline at end of file diff --git a/node_modules/timers-browserify/package.json b/node_modules/timers-browserify/package.json deleted file mode 100644 index 8eafec076..000000000 --- a/node_modules/timers-browserify/package.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "_from": "timers-browserify@^1.0.1", - "_id": "timers-browserify@1.4.2", - "_inBundle": false, - "_integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", - "_location": "/timers-browserify", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "timers-browserify@^1.0.1", - "name": "timers-browserify", - "escapedName": "timers-browserify", - "rawSpec": "^1.0.1", - "saveSpec": null, - "fetchSpec": "^1.0.1" - }, - "_requiredBy": [ - "/browserify" - ], - "_resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", - "_shasum": "c9c58b575be8407375cb5e2462dacee74359f41d", - "_spec": "timers-browserify@^1.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "J. Ryan Stinnett", - "email": "jryans@gmail.com", - "url": "http://convolv.es/" - }, - "bugs": { - "url": "https://github.com/jryans/timers-browserify/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Guy Bedford", - "email": "guybedford@gmail.com" - }, - { - "name": "Ionut-Cristian Florescu", - "email": "ionut.florescu@gmail.com" - }, - { - "name": "James Halliday", - "email": "mail@substack.net" - }, - { - "name": "Jan Schär", - "email": "jscissr@gmail.com" - }, - { - "name": "Johannes Ewald", - "email": "johannes.ewald@peerigon.com" - }, - { - "name": "Jonathan Prins", - "email": "jon@blip.tv" - }, - { - "name": "Matt Esch", - "email": "matt@mattesch.info" - } - ], - "dependencies": { - "process": "~0.11.0" - }, - "deprecated": false, - "description": "timers module for browserify", - "devDependencies": { - "browserify": "~1.10.16", - "connect": "~2.3.0" - }, - "engines": { - "node": ">=0.6.0" - }, - "homepage": "https://github.com/jryans/timers-browserify", - "jspm": { - "map": { - "./main.js": { - "node": "@node/timers" - } - } - }, - "keywords": [ - "timers", - "browserify", - "browser" - ], - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/jryans/timers-browserify/blob/master/LICENSE.md" - } - ], - "main": "main.js", - "name": "timers-browserify", - "optionalDependencies": {}, - "repository": { - "type": "git", - "url": "git://github.com/jryans/timers-browserify.git" - }, - "version": "1.4.2" -} diff --git a/node_modules/to-arraybuffer/.npmignore b/node_modules/to-arraybuffer/.npmignore deleted file mode 100644 index 6c3df58ff..000000000 --- a/node_modules/to-arraybuffer/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -.DS_Store -node_modules -npm-debug.log -.zuulrc diff --git a/node_modules/to-arraybuffer/.travis.yml b/node_modules/to-arraybuffer/.travis.yml deleted file mode 100644 index 3428b14b3..000000000 --- a/node_modules/to-arraybuffer/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "4.1" \ No newline at end of file diff --git a/node_modules/to-arraybuffer/.zuul.yml b/node_modules/to-arraybuffer/.zuul.yml deleted file mode 100644 index 7e60601fa..000000000 --- a/node_modules/to-arraybuffer/.zuul.yml +++ /dev/null @@ -1,16 +0,0 @@ -ui: tape -browsers: - - name: chrome - version: 39..latest - - name: firefox - version: 34..latest - - name: safari - version: 5..latest - - name: ie - version: 10..latest - - name: opera - version: 11..latest - - name: iphone - version: 5.1..latest - - name: android - version: 4.0..latest \ No newline at end of file diff --git a/node_modules/to-arraybuffer/LICENSE b/node_modules/to-arraybuffer/LICENSE deleted file mode 100644 index 1e936dad4..000000000 --- a/node_modules/to-arraybuffer/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -The MIT License - -Copyright (c) 2016 John Hiesey - -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. \ No newline at end of file diff --git a/node_modules/to-arraybuffer/README.md b/node_modules/to-arraybuffer/README.md deleted file mode 100644 index 6bdef265b..000000000 --- a/node_modules/to-arraybuffer/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# to-arraybuffer [![Build Status](https://travis-ci.org/jhiesey/to-arraybuffer.svg?branch=master)](https://travis-ci.org/jhiesey/to-arraybuffer) - -[![Sauce Test Status](https://saucelabs.com/browser-matrix/to-arraybuffer.svg)](https://saucelabs.com/u/to-arraybuffer) - -Convert from a Buffer to an ArrayBuffer as fast as possible. - -Note that in some cases the returned ArrayBuffer is backed by the same memory as the original -Buffer (but in other cases it is a copy), so **modifying the ArrayBuffer is not recommended**. - -This module is designed to work both in node.js and in all browsers with ArrayBuffer support -when using [the Buffer implementation provided by Browserify](https://www.npmjs.com/package/buffer). - -## Usage - -``` js -var toArrayBuffer = require('to-arraybuffer') - -var buffer = new Buffer(100) -// Fill the buffer with some data - -var ab = toArrayBuffer(buffer) -// `ab` now contains the same data as `buffer` -``` - -## License - -MIT \ No newline at end of file diff --git a/node_modules/to-arraybuffer/index.js b/node_modules/to-arraybuffer/index.js deleted file mode 100644 index 2f69ae0c8..000000000 --- a/node_modules/to-arraybuffer/index.js +++ /dev/null @@ -1,27 +0,0 @@ -var Buffer = require('buffer').Buffer - -module.exports = function (buf) { - // If the buffer is backed by a Uint8Array, a faster version will work - if (buf instanceof Uint8Array) { - // If the buffer isn't a subarray, return the underlying ArrayBuffer - if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) { - return buf.buffer - } else if (typeof buf.buffer.slice === 'function') { - // Otherwise we need to get a proper copy - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength) - } - } - - if (Buffer.isBuffer(buf)) { - // This is the slow version that will work with any Buffer - // implementation (even in old browsers) - var arrayCopy = new Uint8Array(buf.length) - var len = buf.length - for (var i = 0; i < len; i++) { - arrayCopy[i] = buf[i] - } - return arrayCopy.buffer - } else { - throw new Error('Argument must be a Buffer') - } -} diff --git a/node_modules/to-arraybuffer/package.json b/node_modules/to-arraybuffer/package.json deleted file mode 100644 index 809b9f5db..000000000 --- a/node_modules/to-arraybuffer/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "_from": "to-arraybuffer@^1.0.0", - "_id": "to-arraybuffer@1.0.1", - "_inBundle": false, - "_integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", - "_location": "/to-arraybuffer", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "to-arraybuffer@^1.0.0", - "name": "to-arraybuffer", - "escapedName": "to-arraybuffer", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/stream-http" - ], - "_resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", - "_shasum": "7d229b1fcc637e466ca081180836a7aabff83f43", - "_spec": "to-arraybuffer@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/stream-http", - "author": { - "name": "John Hiesey" - }, - "bugs": { - "url": "https://github.com/jhiesey/to-arraybuffer/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Get an ArrayBuffer from a Buffer as fast as possible", - "devDependencies": { - "tape": "^4.4.0", - "zuul": "^3.9.0" - }, - "homepage": "https://github.com/jhiesey/to-arraybuffer#readme", - "keywords": [ - "buffer", - "to", - "arraybuffer", - "fast", - "read", - "only" - ], - "license": "MIT", - "main": "index.js", - "name": "to-arraybuffer", - "repository": { - "type": "git", - "url": "git://github.com/jhiesey/to-arraybuffer.git" - }, - "scripts": { - "test": "npm run test-node && ([ -n \"${TRAVIS_PULL_REQUEST}\" -a \"${TRAVIS_PULL_REQUEST}\" != 'false' ] || npm run test-browser)", - "test-browser": "zuul --no-coverage -- test.js", - "test-browser-local": "zuul --local 8080 --no-coverage -- test.js", - "test-node": "tape test.js" - }, - "version": "1.0.1" -} diff --git a/node_modules/to-arraybuffer/test.js b/node_modules/to-arraybuffer/test.js deleted file mode 100644 index 1814ae3ff..000000000 --- a/node_modules/to-arraybuffer/test.js +++ /dev/null @@ -1,57 +0,0 @@ -var Buffer = require('buffer').Buffer -var test = require('tape') - -var toArrayBuffer = require('.') - -function elementsEqual (ab, buffer) { - var view = new Uint8Array(ab) - for (var i = 0; i < view.length; i++) { - if (view[i] !== buffer[i]) { - return false - } - } - return true -} - -test('Basic behavior', function (t) { - var buf = new Buffer(10) - for (var i = 0; i < 10; i++) { - buf[i] = i - } - - var ab = toArrayBuffer(buf) - - t.equals(ab.byteLength, 10, 'correct length') - t.ok(elementsEqual(ab, buf), 'elements equal') - t.end() -}) - -test('Behavior when input is a subarray 1', function (t) { - var origBuf = new Buffer(10) - for (var i = 0; i < 10; i++) { - origBuf[i] = i - } - var buf = origBuf.slice(1) - - var ab = toArrayBuffer(buf) - - t.equals(ab.byteLength, 9, 'correct length') - t.ok(elementsEqual(ab, buf), 'elements equal') - t.notOk(ab === buf.buffer, 'the underlying ArrayBuffer is not returned when incorrect') - t.end() -}) - -test('Behavior when input is a subarray 2', function (t) { - var origBuf = new Buffer(10) - for (var i = 0; i < 10; i++) { - origBuf[i] = i - } - var buf = origBuf.slice(0, 9) - - var ab = toArrayBuffer(buf) - - t.equals(ab.byteLength, 9, 'correct length') - t.ok(elementsEqual(ab, buf), 'elements equal') - t.notOk(ab === buf.buffer, 'the underlying ArrayBuffer is not returned when incorrect') - t.end() -}) diff --git a/node_modules/to-object-path/LICENSE b/node_modules/to-object-path/LICENSE deleted file mode 100644 index 1e49edf81..000000000 --- a/node_modules/to-object-path/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2016, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/to-object-path/README.md b/node_modules/to-object-path/README.md deleted file mode 100644 index 7f3cfb163..000000000 --- a/node_modules/to-object-path/README.md +++ /dev/null @@ -1,71 +0,0 @@ -# to-object-path [![NPM version](https://badge.fury.io/js/to-object-path.svg)](http://badge.fury.io/js/to-object-path) - -> Create an object path from a list or array of strings. - -## Install - -Install with [npm](https://www.npmjs.com/) - -```sh -$ npm i to-object-path --save -``` - -## Usage - -```js -var toPath = require('to-object-path'); - -toPath('foo', 'bar', 'baz'); -toPath('foo', ['bar', 'baz']); -//=> 'foo.bar.baz' -``` - -Also supports passing an arguments object (without having to slice args): - -```js -function foo() - return toPath(arguments); -} - -foo('foo', 'bar', 'baz'); -foo('foo', ['bar', 'baz']); -//=> 'foo.bar.baz' -``` - -Visit the [example](./example.js) to see how this could be used in an application. - -## Related projects - -* [get-value](https://www.npmjs.com/package/get-value): Use property paths (` a.b.c`) to get a nested value from an object. | [homepage](https://github.com/jonschlinkert/get-value) -* [has-value](https://www.npmjs.com/package/has-value): Returns true if a value exists, false if empty. Works with deeply nested values using… [more](https://www.npmjs.com/package/has-value) | [homepage](https://github.com/jonschlinkert/has-value) -* [omit-value](https://www.npmjs.com/package/omit-value): Omit properties from an object or deeply nested property of an object using object path… [more](https://www.npmjs.com/package/omit-value) | [homepage](https://github.com/jonschlinkert/omit-value) -* [set-value](https://www.npmjs.com/package/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/jonschlinkert/set-value) -* [unset-value](https://www.npmjs.com/package/unset-value): Delete nested properties from an object using dot notation. | [homepage](https://github.com/jonschlinkert/unset-value) - -## Running tests - -Install dev dependencies: - -```sh -$ npm i -d && npm test -``` - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/to-object-path/issues/new). - -## Author - -**Jon Schlinkert** - -+ [github/jonschlinkert](https://github.com/jonschlinkert) -+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2015 Jon Schlinkert -Released under the MIT license. - -*** - -_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 28, 2015._ \ No newline at end of file diff --git a/node_modules/to-object-path/index.js b/node_modules/to-object-path/index.js deleted file mode 100644 index 489f8f684..000000000 --- a/node_modules/to-object-path/index.js +++ /dev/null @@ -1,33 +0,0 @@ -/*! - * to-object-path - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var typeOf = require('kind-of'); - -module.exports = function toPath(args) { - if (typeOf(args) !== 'arguments') { - args = arguments; - } - return filter(args).join('.'); -}; - -function filter(arr) { - var len = arr.length; - var idx = -1; - var res = []; - - while (++idx < len) { - var ele = arr[idx]; - if (typeOf(ele) === 'arguments' || Array.isArray(ele)) { - res.push.apply(res, filter(ele)); - } else if (typeof ele === 'string') { - res.push(ele); - } - } - return res; -} diff --git a/node_modules/to-object-path/package.json b/node_modules/to-object-path/package.json deleted file mode 100644 index a662aaa87..000000000 --- a/node_modules/to-object-path/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "_from": "to-object-path@^0.3.0", - "_id": "to-object-path@0.3.0", - "_inBundle": false, - "_integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "_location": "/to-object-path", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "to-object-path@^0.3.0", - "name": "to-object-path", - "escapedName": "to-object-path", - "rawSpec": "^0.3.0", - "saveSpec": null, - "fetchSpec": "^0.3.0" - }, - "_requiredBy": [ - "/cache-base", - "/union-value/set-value" - ], - "_resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "_shasum": "297588b7b0e7e0ac08e04e672f85c1f4999e17af", - "_spec": "to-object-path@^0.3.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/cache-base", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/to-object-path/issues" - }, - "bundleDependencies": false, - "dependencies": { - "kind-of": "^3.0.2" - }, - "deprecated": false, - "description": "Create an object path from a list or array of strings.", - "devDependencies": { - "base": "^0.6.7", - "mocha": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/to-object-path", - "keywords": [ - "dot", - "nested", - "notation", - "object", - "path", - "stringify" - ], - "license": "MIT", - "main": "index.js", - "name": "to-object-path", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/to-object-path.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "get-value", - "set-value", - "has-value", - "omit-value", - "unset-value" - ] - } - }, - "version": "0.3.0" -} diff --git a/node_modules/to-regex-range/LICENSE b/node_modules/to-regex-range/LICENSE deleted file mode 100644 index 83b56e709..000000000 --- a/node_modules/to-regex-range/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/to-regex-range/README.md b/node_modules/to-regex-range/README.md deleted file mode 100644 index 2763c5aef..000000000 --- a/node_modules/to-regex-range/README.md +++ /dev/null @@ -1,281 +0,0 @@ -# to-regex-range [![NPM version](https://img.shields.io/npm/v/to-regex-range.svg?style=flat)](https://www.npmjs.com/package/to-regex-range) [![NPM monthly downloads](https://img.shields.io/npm/dm/to-regex-range.svg?style=flat)](https://npmjs.org/package/to-regex-range) [![NPM total downloads](https://img.shields.io/npm/dt/to-regex-range.svg?style=flat)](https://npmjs.org/package/to-regex-range) [![Linux Build Status](https://img.shields.io/travis/micromatch/to-regex-range.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/to-regex-range) - -> Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.78 million test assertions. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save to-regex-range -``` - -Install with [yarn](https://yarnpkg.com): - -```sh -$ yarn add to-regex-range -``` - -
    -What does this do? - -
    - -This libary generates the `source` string to be passed to `new RegExp()` for matching a range of numbers. - -**Example** - -```js -var toRegexRange = require('to-regex-range'); -var regex = new RegExp(toRegexRange('15', '95')); -``` - -A string is returned so that you can do whatever you need with it before passing it to `new RegExp()` (like adding `^` or `$` boundaries, defining flags, or combining it another string). - -
    - -
    - -
    -Why use this library? - -
    - -### Convenience - -Creating regular expressions for matching numbers gets deceptively complicated pretty fast. - -For example, let's say you need a validation regex for matching part of a user-id, postal code, social security number, tax id, etc: - -* regex for matching `1` => `/1/` (easy enough) -* regex for matching `1` through `5` => `/[1-5]/` (not bad...) -* regex for matching `1` or `5` => `/(1|5)/` (still easy...) -* regex for matching `1` through `50` => `/([1-9]|[1-4][0-9]|50)/` (uh-oh...) -* regex for matching `1` through `55` => `/([1-9]|[1-4][0-9]|5[0-5])/` (no prob, I can do this...) -* regex for matching `1` through `555` => `/([1-9]|[1-9][0-9]|[1-4][0-9]{2}|5[0-4][0-9]|55[0-5])/` (maybe not...) -* regex for matching `0001` through `5555` => `/(0{3}[1-9]|0{2}[1-9][0-9]|0[1-9][0-9]{2}|[1-4][0-9]{3}|5[0-4][0-9]{2}|55[0-4][0-9]|555[0-5])/` (okay, I get the point!) - -The numbers are contrived, but they're also really basic. In the real world you might need to generate a regex on-the-fly for validation. - -**Learn more** - -If you're interested in learning more about [character classes](http://www.regular-expressions.info/charclass.html) and other regex features, I personally have always found [regular-expressions.info](http://www.regular-expressions.info/charclass.html) to be pretty useful. - -### Heavily tested - -As of April 27, 2017, this library runs [2,783,483 test assertions](./test/test.js) against generated regex-ranges to provide brute-force verification that results are indeed correct. - -Tests run in ~870ms on my MacBook Pro, 2.5 GHz Intel Core i7. - -### Highly optimized - -Generated regular expressions are highly optimized: - -* duplicate sequences and character classes are reduced using quantifiers -* smart enough to use `?` conditionals when number(s) or range(s) can be positive or negative -* uses fragment caching to avoid processing the same exact string more than once - -
    - -
    - -## Usage - -Add this library to your javascript application with the following line of code - -```js -var toRegexRange = require('to-regex-range'); -``` - -The main export is a function that takes two integers: the `min` value and `max` value (formatted as strings or numbers). - -```js -var source = toRegexRange('15', '95'); -//=> 1[5-9]|[2-8][0-9]|9[0-5] - -var re = new RegExp('^' + source + '$'); -console.log(re.test('14')); //=> false -console.log(re.test('50')); //=> true -console.log(re.test('94')); //=> true -console.log(re.test('96')); //=> false -``` - -## Options - -### options.capture - -**Type**: `boolean` - -**Deafault**: `undefined` - -Wrap the returned value in parentheses when there is more than one regex condition. Useful when you're dynamically generating ranges. - -```js -console.log(toRegexRange('-10', '10')); -//=> -[1-9]|-?10|[0-9] - -console.log(toRegexRange('-10', '10', {capture: true})); -//=> (-[1-9]|-?10|[0-9]) -``` - -### options.shorthand - -**Type**: `boolean` - -**Deafault**: `undefined` - -Use the regex shorthand for `[0-9]`: - -```js -console.log(toRegexRange('0', '999999')); -//=> [0-9]|[1-9][0-9]{1,5} - -console.log(toRegexRange('0', '999999', {shorthand: true})); -//=> \d|[1-9]\d{1,5} -``` - -### options.relaxZeros - -**Type**: `boolean` - -**Default**: `true` - -This option only applies to **negative zero-padded ranges**. By default, when a negative zero-padded range is defined, the number of leading zeros is relaxed using `-0*`. - -```js -console.log(toRegexRange('-001', '100')); -//=> -0*1|0{2}[0-9]|0[1-9][0-9]|100 - -console.log(toRegexRange('-001', '100', {relaxZeros: false})); -//=> -0{2}1|0{2}[0-9]|0[1-9][0-9]|100 -``` - -
    -Why are zeros relaxed for negative zero-padded ranges by default? - -Consider the following. - -```js -var regex = toRegexRange('-001', '100'); -``` - -_Note that `-001` and `100` are both three digits long_. - -In most zero-padding implementations, only a single leading zero is enough to indicate that zero-padding should be applied. Thus, the leading zeros would be "corrected" on the negative range in the example to `-01`, instead of `-001`, to make total length of each string no greater than the length of the largest number in the range (in other words, `-001` is 4 digits, but `100` is only three digits). - -If zeros were not relaxed by default, you might expect the resulting regex of the above pattern to match `-001` - given that it's defined that way in the arguments - _but it wouldn't_. It would, however, match `-01`. This gets even more ambiguous with large ranges, like `-01` to `1000000`. - -Thus, we relax zeros by default to provide a more predictable experience for users. - -
    - -## Examples - -| **Range** | **Result** | **Compile time** | -| --- | --- | --- | -| `toRegexRange('5, 5')` | `5` | _33μs_ | -| `toRegexRange('5, 6')` | `5\|6` | _53μs_ | -| `toRegexRange('29, 51')` | `29\|[34][0-9]\|5[01]` | _699μs_ | -| `toRegexRange('31, 877')` | `3[1-9]\|[4-9][0-9]\|[1-7][0-9]{2}\|8[0-6][0-9]\|87[0-7]` | _711μs_ | -| `toRegexRange('111, 555')` | `11[1-9]\|1[2-9][0-9]\|[2-4][0-9]{2}\|5[0-4][0-9]\|55[0-5]` | _62μs_ | -| `toRegexRange('-10, 10')` | `-[1-9]\|-?10\|[0-9]` | _74μs_ | -| `toRegexRange('-100, -10')` | `-1[0-9]\|-[2-9][0-9]\|-100` | _49μs_ | -| `toRegexRange('-100, 100')` | `-[1-9]\|-?[1-9][0-9]\|-?100\|[0-9]` | _45μs_ | -| `toRegexRange('001, 100')` | `0{2}[1-9]\|0[1-9][0-9]\|100` | _158μs_ | -| `toRegexRange('0010, 1000')` | `0{2}1[0-9]\|0{2}[2-9][0-9]\|0[1-9][0-9]{2}\|1000` | _61μs_ | -| `toRegexRange('1, 2')` | `1\|2` | _10μs_ | -| `toRegexRange('1, 5')` | `[1-5]` | _24μs_ | -| `toRegexRange('1, 10')` | `[1-9]\|10` | _23μs_ | -| `toRegexRange('1, 100')` | `[1-9]\|[1-9][0-9]\|100` | _30μs_ | -| `toRegexRange('1, 1000')` | `[1-9]\|[1-9][0-9]{1,2}\|1000` | _52μs_ | -| `toRegexRange('1, 10000')` | `[1-9]\|[1-9][0-9]{1,3}\|10000` | _47μs_ | -| `toRegexRange('1, 100000')` | `[1-9]\|[1-9][0-9]{1,4}\|100000` | _44μs_ | -| `toRegexRange('1, 1000000')` | `[1-9]\|[1-9][0-9]{1,5}\|1000000` | _49μs_ | -| `toRegexRange('1, 10000000')` | `[1-9]\|[1-9][0-9]{1,6}\|10000000` | _63μs_ | - -## Heads up! - -**Order of arguments** - -When the `min` is larger than the `max`, values will be flipped to create a valid range: - -```js -toRegexRange('51', '29'); -``` - -Is effectively flipped to: - -```js -toRegexRange('29', '51'); -//=> 29|[3-4][0-9]|5[0-1] -``` - -**Steps / increments** - -This library does not support steps (increments). A pr to add support would be welcome. - -## History - -### v2.0.0 - 2017-04-21 - -**New features** - -Adds support for zero-padding! - -### v1.0.0 - -**Optimizations** - -Repeating ranges are now grouped using quantifiers. rocessing time is roughly the same, but the generated regex is much smaller, which should result in faster matching. - -## Attribution - -Inspired by the python library [range-regex](https://github.com/dimka665/range-regex). - -## About - -### Related projects - -* [expand-range](https://www.npmjs.com/package/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See… [more](https://github.com/jonschlinkert/expand-range) | [homepage](https://github.com/jonschlinkert/expand-range "Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See the benchmarks. Used by micromatch.") -* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or `step` to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`") -* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") -* [repeat-element](https://www.npmjs.com/package/repeat-element): Create an array by repeating the given value n times. | [homepage](https://github.com/jonschlinkert/repeat-element "Create an array by repeating the given value n times.") -* [repeat-string](https://www.npmjs.com/package/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string. | [homepage](https://github.com/jonschlinkert/repeat-string "Repeat the given string n times. Fastest implementation for repeating a string.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on April 27, 2017._ \ No newline at end of file diff --git a/node_modules/to-regex-range/index.js b/node_modules/to-regex-range/index.js deleted file mode 100644 index 7bb5a743e..000000000 --- a/node_modules/to-regex-range/index.js +++ /dev/null @@ -1,294 +0,0 @@ -/*! - * to-regex-range - * - * Copyright (c) 2015, 2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var repeat = require('repeat-string'); -var isNumber = require('is-number'); -var cache = {}; - -function toRegexRange(min, max, options) { - if (isNumber(min) === false) { - throw new RangeError('toRegexRange: first argument is invalid.'); - } - - if (typeof max === 'undefined' || min === max) { - return String(min); - } - - if (isNumber(max) === false) { - throw new RangeError('toRegexRange: second argument is invalid.'); - } - - options = options || {}; - var relax = String(options.relaxZeros); - var shorthand = String(options.shorthand); - var capture = String(options.capture); - var key = min + ':' + max + '=' + relax + shorthand + capture; - if (cache.hasOwnProperty(key)) { - return cache[key].result; - } - - var a = Math.min(min, max); - var b = Math.max(min, max); - - if (Math.abs(a - b) === 1) { - var result = min + '|' + max; - if (options.capture) { - return '(' + result + ')'; - } - return result; - } - - var isPadded = padding(min) || padding(max); - var positives = []; - var negatives = []; - - var tok = {min: min, max: max, a: a, b: b}; - if (isPadded) { - tok.isPadded = isPadded; - tok.maxLen = String(tok.max).length; - } - - if (a < 0) { - var newMin = b < 0 ? Math.abs(b) : 1; - var newMax = Math.abs(a); - negatives = splitToPatterns(newMin, newMax, tok, options); - a = tok.a = 0; - } - - if (b >= 0) { - positives = splitToPatterns(a, b, tok, options); - } - - tok.negatives = negatives; - tok.positives = positives; - tok.result = siftPatterns(negatives, positives, options); - - if (options.capture && (positives.length + negatives.length) > 1) { - tok.result = '(' + tok.result + ')'; - } - - cache[key] = tok; - return tok.result; -} - -function siftPatterns(neg, pos, options) { - var onlyNegative = filterPatterns(neg, pos, '-', false, options) || []; - var onlyPositive = filterPatterns(pos, neg, '', false, options) || []; - var intersected = filterPatterns(neg, pos, '-?', true, options) || []; - var subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); - return subpatterns.join('|'); -} - -function splitToRanges(min, max) { - min = Number(min); - max = Number(max); - - var nines = 1; - var stops = [max]; - var stop = +countNines(min, nines); - - while (min <= stop && stop <= max) { - stops = push(stops, stop); - nines += 1; - stop = +countNines(min, nines); - } - - var zeros = 1; - stop = countZeros(max + 1, zeros) - 1; - - while (min < stop && stop <= max) { - stops = push(stops, stop); - zeros += 1; - stop = countZeros(max + 1, zeros) - 1; - } - - stops.sort(compare); - return stops; -} - -/** - * Convert a range to a regex pattern - * @param {Number} `start` - * @param {Number} `stop` - * @return {String} - */ - -function rangeToPattern(start, stop, options) { - if (start === stop) { - return {pattern: String(start), digits: []}; - } - - var zipped = zip(String(start), String(stop)); - var len = zipped.length, i = -1; - - var pattern = ''; - var digits = 0; - - while (++i < len) { - var numbers = zipped[i]; - var startDigit = numbers[0]; - var stopDigit = numbers[1]; - - if (startDigit === stopDigit) { - pattern += startDigit; - - } else if (startDigit !== '0' || stopDigit !== '9') { - pattern += toCharacterClass(startDigit, stopDigit); - - } else { - digits += 1; - } - } - - if (digits) { - pattern += options.shorthand ? '\\d' : '[0-9]'; - } - - return { pattern: pattern, digits: [digits] }; -} - -function splitToPatterns(min, max, tok, options) { - var ranges = splitToRanges(min, max); - var len = ranges.length; - var idx = -1; - - var tokens = []; - var start = min; - var prev; - - while (++idx < len) { - var range = ranges[idx]; - var obj = rangeToPattern(start, range, options); - var zeros = ''; - - if (!tok.isPadded && prev && prev.pattern === obj.pattern) { - if (prev.digits.length > 1) { - prev.digits.pop(); - } - prev.digits.push(obj.digits[0]); - prev.string = prev.pattern + toQuantifier(prev.digits); - start = range + 1; - continue; - } - - if (tok.isPadded) { - zeros = padZeros(range, tok); - } - - obj.string = zeros + obj.pattern + toQuantifier(obj.digits); - tokens.push(obj); - start = range + 1; - prev = obj; - } - - return tokens; -} - -function filterPatterns(arr, comparison, prefix, intersection, options) { - var res = []; - - for (var i = 0; i < arr.length; i++) { - var tok = arr[i]; - var ele = tok.string; - - if (options.relaxZeros !== false) { - if (prefix === '-' && ele.charAt(0) === '0') { - if (ele.charAt(1) === '{') { - ele = '0*' + ele.replace(/^0\{\d+\}/, ''); - } else { - ele = '0*' + ele.slice(1); - } - } - } - - if (!intersection && !contains(comparison, 'string', ele)) { - res.push(prefix + ele); - } - - if (intersection && contains(comparison, 'string', ele)) { - res.push(prefix + ele); - } - } - return res; -} - -/** - * Zip strings (`for in` can be used on string characters) - */ - -function zip(a, b) { - var arr = []; - for (var ch in a) arr.push([a[ch], b[ch]]); - return arr; -} - -function compare(a, b) { - return a > b ? 1 : b > a ? -1 : 0; -} - -function push(arr, ele) { - if (arr.indexOf(ele) === -1) arr.push(ele); - return arr; -} - -function contains(arr, key, val) { - for (var i = 0; i < arr.length; i++) { - if (arr[i][key] === val) { - return true; - } - } - return false; -} - -function countNines(min, len) { - return String(min).slice(0, -len) + repeat('9', len); -} - -function countZeros(integer, zeros) { - return integer - (integer % Math.pow(10, zeros)); -} - -function toQuantifier(digits) { - var start = digits[0]; - var stop = digits[1] ? (',' + digits[1]) : ''; - if (!stop && (!start || start === 1)) { - return ''; - } - return '{' + start + stop + '}'; -} - -function toCharacterClass(a, b) { - return '[' + a + ((b - a === 1) ? '' : '-') + b + ']'; -} - -function padding(str) { - return /^-?(0+)\d/.exec(str); -} - -function padZeros(val, tok) { - if (tok.isPadded) { - var diff = Math.abs(tok.maxLen - String(val).length); - switch (diff) { - case 0: - return ''; - case 1: - return '0'; - default: { - return '0{' + diff + '}'; - } - } - } - return val; -} - -/** - * Expose `toRegexRange` - */ - -module.exports = toRegexRange; diff --git a/node_modules/to-regex-range/node_modules/is-number/LICENSE b/node_modules/to-regex-range/node_modules/is-number/LICENSE deleted file mode 100644 index 842218cf0..000000000 --- a/node_modules/to-regex-range/node_modules/is-number/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2016, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/to-regex-range/node_modules/is-number/README.md b/node_modules/to-regex-range/node_modules/is-number/README.md deleted file mode 100644 index 281165dce..000000000 --- a/node_modules/to-regex-range/node_modules/is-number/README.md +++ /dev/null @@ -1,115 +0,0 @@ -# is-number [![NPM version](https://img.shields.io/npm/v/is-number.svg?style=flat)](https://www.npmjs.com/package/is-number) [![NPM downloads](https://img.shields.io/npm/dm/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-number.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-number) - -> Returns true if the value is a number. comprehensive tests. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save is-number -``` - -## Usage - -To understand some of the rationale behind the decisions made in this library (and to learn about some oddities of number evaluation in JavaScript), [see this gist](https://gist.github.com/jonschlinkert/e30c70c713da325d0e81). - -```js -var isNumber = require('is-number'); -``` - -### true - -See the [tests](./test.js) for more examples. - -```js -isNumber(5e3) //=> 'true' -isNumber(0xff) //=> 'true' -isNumber(-1.1) //=> 'true' -isNumber(0) //=> 'true' -isNumber(1) //=> 'true' -isNumber(1.1) //=> 'true' -isNumber(10) //=> 'true' -isNumber(10.10) //=> 'true' -isNumber(100) //=> 'true' -isNumber('-1.1') //=> 'true' -isNumber('0') //=> 'true' -isNumber('012') //=> 'true' -isNumber('0xff') //=> 'true' -isNumber('1') //=> 'true' -isNumber('1.1') //=> 'true' -isNumber('10') //=> 'true' -isNumber('10.10') //=> 'true' -isNumber('100') //=> 'true' -isNumber('5e3') //=> 'true' -isNumber(parseInt('012')) //=> 'true' -isNumber(parseFloat('012')) //=> 'true' -``` - -### False - -See the [tests](./test.js) for more examples. - -```js -isNumber('foo') //=> 'false' -isNumber([1]) //=> 'false' -isNumber([]) //=> 'false' -isNumber(function () {}) //=> 'false' -isNumber(Infinity) //=> 'false' -isNumber(NaN) //=> 'false' -isNumber(new Array('abc')) //=> 'false' -isNumber(new Array(2)) //=> 'false' -isNumber(new Buffer('abc')) //=> 'false' -isNumber(null) //=> 'false' -isNumber(undefined) //=> 'false' -isNumber({abc: 'abc'}) //=> 'false' -``` - -## About - -### Related projects - -* [even](https://www.npmjs.com/package/even): Get the even numbered items from an array. | [homepage](https://github.com/jonschlinkert/even "Get the even numbered items from an array.") -* [is-even](https://www.npmjs.com/package/is-even): Return true if the given number is even. | [homepage](https://github.com/jonschlinkert/is-even "Return true if the given number is even.") -* [is-odd](https://www.npmjs.com/package/is-odd): Returns true if the given number is odd. | [homepage](https://github.com/jonschlinkert/is-odd "Returns true if the given number is odd.") -* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") -* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") -* [odd](https://www.npmjs.com/package/odd): Get the odd numbered items from an array. | [homepage](https://github.com/jonschlinkert/odd "Get the odd numbered items from an array.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Building docs - -_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ - -To generate the readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install -g verb verb-generate-readme && verb -``` - -### Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -### License - -Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/is-number/blob/master/LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.30, on September 10, 2016._ \ No newline at end of file diff --git a/node_modules/to-regex-range/node_modules/is-number/index.js b/node_modules/to-regex-range/node_modules/is-number/index.js deleted file mode 100644 index 7a2a45bed..000000000 --- a/node_modules/to-regex-range/node_modules/is-number/index.js +++ /dev/null @@ -1,22 +0,0 @@ -/*! - * is-number - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var typeOf = require('kind-of'); - -module.exports = function isNumber(num) { - var type = typeOf(num); - - if (type === 'string') { - if (!num.trim()) return false; - } else if (type !== 'number') { - return false; - } - - return (num - num + 1) >= 0; -}; diff --git a/node_modules/to-regex-range/node_modules/is-number/package.json b/node_modules/to-regex-range/node_modules/is-number/package.json deleted file mode 100644 index 58e016483..000000000 --- a/node_modules/to-regex-range/node_modules/is-number/package.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "_from": "is-number@^3.0.0", - "_id": "is-number@3.0.0", - "_inBundle": false, - "_integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "_location": "/to-regex-range/is-number", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-number@^3.0.0", - "name": "is-number", - "escapedName": "is-number", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/to-regex-range" - ], - "_resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "_shasum": "24fd6201a4782cf50561c810276afc7d12d71195", - "_spec": "is-number@^3.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/to-regex-range", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/is-number/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Charlike Mike Reagent", - "url": "http://www.tunnckocore.tk" - }, - { - "name": "Jon Schlinkert", - "email": "jon.schlinkert@sellside.com", - "url": "http://twitter.com/jonschlinkert" - } - ], - "dependencies": { - "kind-of": "^3.0.2" - }, - "deprecated": false, - "description": "Returns true if the value is a number. comprehensive tests.", - "devDependencies": { - "benchmarked": "^0.2.5", - "chalk": "^1.1.3", - "gulp-format-md": "^0.1.10", - "mocha": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/is-number", - "keywords": [ - "check", - "coerce", - "coercion", - "integer", - "is", - "is-nan", - "is-num", - "is-number", - "istype", - "kind", - "math", - "nan", - "num", - "number", - "numeric", - "test", - "type", - "typeof", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "is-number", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/is-number.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "even", - "is-even", - "is-odd", - "is-primitive", - "kind-of", - "odd" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "verb", - "verb-generate-readme" - ] - }, - "version": "3.0.0" -} diff --git a/node_modules/to-regex-range/package.json b/node_modules/to-regex-range/package.json deleted file mode 100644 index 212e42e1b..000000000 --- a/node_modules/to-regex-range/package.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "_from": "to-regex-range@^2.1.0", - "_id": "to-regex-range@2.1.1", - "_inBundle": false, - "_integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "_location": "/to-regex-range", - "_phantomChildren": { - "kind-of": "3.2.2" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "to-regex-range@^2.1.0", - "name": "to-regex-range", - "escapedName": "to-regex-range", - "rawSpec": "^2.1.0", - "saveSpec": null, - "fetchSpec": "^2.1.0" - }, - "_requiredBy": [ - "/readdirp/fill-range" - ], - "_resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "_shasum": "7c80c17b9dfebe599e27367e0d4dd5590141db38", - "_spec": "to-regex-range@^2.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/fill-range", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/micromatch/to-regex-range/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - }, - "deprecated": false, - "description": "Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.78 million test assertions.", - "devDependencies": { - "fill-range": "^3.1.1", - "gulp-format-md": "^0.1.12", - "mocha": "^3.2.0", - "text-table": "^0.2.0", - "time-diff": "^0.3.1" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/micromatch/to-regex-range", - "keywords": [ - "alpha", - "alphabetical", - "bash", - "brace", - "date", - "expand", - "expansion", - "glob", - "match", - "matches", - "matching", - "number", - "numerical", - "range", - "ranges", - "regex", - "sequence", - "sh", - "to", - "year" - ], - "license": "MIT", - "main": "index.js", - "name": "to-regex-range", - "repository": { - "type": "git", - "url": "git+https://github.com/micromatch/to-regex-range.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "expand-range", - "fill-range", - "micromatch", - "repeat-element", - "repeat-string" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "helpers": [ - "./examples.js" - ], - "reflinks": [ - "0-5", - "0-9", - "1-5", - "1-9" - ] - }, - "version": "2.1.1" -} diff --git a/node_modules/to-regex/LICENSE b/node_modules/to-regex/LICENSE deleted file mode 100644 index 7c9987bc6..000000000 --- a/node_modules/to-regex/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016-2018, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/to-regex/README.md b/node_modules/to-regex/README.md deleted file mode 100644 index 5a28fc33b..000000000 --- a/node_modules/to-regex/README.md +++ /dev/null @@ -1,205 +0,0 @@ -# to-regex [![NPM version](https://img.shields.io/npm/v/to-regex.svg?style=flat)](https://www.npmjs.com/package/to-regex) [![NPM monthly downloads](https://img.shields.io/npm/dm/to-regex.svg?style=flat)](https://npmjs.org/package/to-regex) [![NPM total downloads](https://img.shields.io/npm/dt/to-regex.svg?style=flat)](https://npmjs.org/package/to-regex) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/to-regex.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/to-regex) - -> Generate a regex from a string or array of strings. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -- [Install](#install) -- [Usage](#usage) -- [Options](#options) - * [options.contains](#optionscontains) - * [options.negate](#optionsnegate) - * [options.nocase](#optionsnocase) - * [options.flags](#optionsflags) - * [options.cache](#optionscache) - * [options.safe](#optionssafe) -- [About](#about) - * [Related projects](#related-projects) - * [Author](#author) - * [License](#license) - -_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save to-regex -``` - -## Usage - -```js -var toRegex = require('to-regex'); - -console.log(toRegex('foo')); -//=> /^(?:foo)$/ - -console.log(toRegex('foo', {negate: true})); -//=> /^(?:(?:(?!^(?:foo)$).)*)$/ - -console.log(toRegex('foo', {contains: true})); -//=> /(?:foo)/ - -console.log(toRegex(['foo', 'bar'], {negate: true})); -//=> /^(?:(?:(?!^(?:(?:foo)|(?:bar))$).)*)$/ - -console.log(toRegex(['foo', 'bar'], {negate: true, contains: true})); -//=> /^(?:(?:(?!(?:(?:foo)|(?:bar))).)*)$/ -``` - -## Options - -### options.contains - -**Type**: `Boolean` - -**Default**: `undefined` - -Generate a regex that will match any string that _contains_ the given pattern. By default, regex is strict will only return true for exact matches. - -```js -var toRegex = require('to-regex'); -console.log(toRegex('foo', {contains: true})); -//=> /(?:foo)/ -``` - -### options.negate - -**Type**: `Boolean` - -**Default**: `undefined` - -Create a regex that will match everything except the given pattern. - -```js -var toRegex = require('to-regex'); -console.log(toRegex('foo', {negate: true})); -//=> /^(?:(?:(?!^(?:foo)$).)*)$/ -``` - -### options.nocase - -**Type**: `Boolean` - -**Default**: `undefined` - -Adds the `i` flag, to enable case-insensitive matching. - -```js -var toRegex = require('to-regex'); -console.log(toRegex('foo', {nocase: true})); -//=> /^(?:foo)$/i -``` - -Alternatively you can pass the flags you want directly on [options.flags](#options.flags). - -### options.flags - -**Type**: `String` - -**Default**: `undefined` - -Define the flags you want to use on the generated regex. - -```js -var toRegex = require('to-regex'); -console.log(toRegex('foo', {flags: 'gm'})); -//=> /^(?:foo)$/gm -console.log(toRegex('foo', {flags: 'gmi', nocase: true})); //<= handles redundancy -//=> /^(?:foo)$/gmi -``` - -### options.cache - -**Type**: `Boolean` - -**Default**: `true` - -Generated regex is cached based on the provided string and options. As a result, runtime compilation only happens once per pattern (as long as options are also the same), which can result in dramatic speed improvements. - -This also helps with debugging, since adding options and pattern are added to the generated regex. - -**Disable caching** - -```js -toRegex('foo', {cache: false}); -``` - -### options.safe - -**Type**: `Boolean` - -**Default**: `undefined` - -Check the generated regular expression with [safe-regex](https://github.com/substack/safe-regex) and throw an error if the regex is potentially unsafe. - -**Examples** - -```js -console.log(toRegex('(x+x+)+y')); -//=> /^(?:(x+x+)+y)$/ - -// The following would throw an error -toRegex('(x+x+)+y', {safe: true}); -``` - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    - -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob "Returns `true` if an array has a glob pattern.") -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") -* [path-regex](https://www.npmjs.com/package/path-regex): Regular expression for matching the parts of a file path. | [homepage](https://github.com/regexps/path-regex "Regular expression for matching the parts of a file path.") -* [to-regex-range](https://www.npmjs.com/package/to-regex-range): Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than… [more](https://github.com/micromatch/to-regex-range) | [homepage](https://github.com/micromatch/to-regex-range "Pass two numbers, get a regex-compatible source string for matching ranges. Validated against more than 2.78 million test assertions.") - -### Author - -**Jon Schlinkert** - -* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert) -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on February 24, 2018._ \ No newline at end of file diff --git a/node_modules/to-regex/index.js b/node_modules/to-regex/index.js deleted file mode 100644 index a87d01591..000000000 --- a/node_modules/to-regex/index.js +++ /dev/null @@ -1,155 +0,0 @@ -'use strict'; - -var safe = require('safe-regex'); -var define = require('define-property'); -var extend = require('extend-shallow'); -var not = require('regex-not'); -var MAX_LENGTH = 1024 * 64; - -/** - * Session cache - */ - -var cache = {}; - -/** - * Create a regular expression from the given `pattern` string. - * - * @param {String|RegExp} `pattern` Pattern can be a string or regular expression. - * @param {Object} `options` - * @return {RegExp} - * @api public - */ - -module.exports = function(patterns, options) { - if (!Array.isArray(patterns)) { - return makeRe(patterns, options); - } - return makeRe(patterns.join('|'), options); -}; - -/** - * Create a regular expression from the given `pattern` string. - * - * @param {String|RegExp} `pattern` Pattern can be a string or regular expression. - * @param {Object} `options` - * @return {RegExp} - * @api public - */ - -function makeRe(pattern, options) { - if (pattern instanceof RegExp) { - return pattern; - } - - if (typeof pattern !== 'string') { - throw new TypeError('expected a string'); - } - - if (pattern.length > MAX_LENGTH) { - throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters'); - } - - var key = pattern; - // do this before shallow cloning options, it's a lot faster - if (!options || (options && options.cache !== false)) { - key = createKey(pattern, options); - - if (cache.hasOwnProperty(key)) { - return cache[key]; - } - } - - var opts = extend({}, options); - if (opts.contains === true) { - if (opts.negate === true) { - opts.strictNegate = false; - } else { - opts.strict = false; - } - } - - if (opts.strict === false) { - opts.strictOpen = false; - opts.strictClose = false; - } - - var open = opts.strictOpen !== false ? '^' : ''; - var close = opts.strictClose !== false ? '$' : ''; - var flags = opts.flags || ''; - var regex; - - if (opts.nocase === true && !/i/.test(flags)) { - flags += 'i'; - } - - try { - if (opts.negate || typeof opts.strictNegate === 'boolean') { - pattern = not.create(pattern, opts); - } - - var str = open + '(?:' + pattern + ')' + close; - regex = new RegExp(str, flags); - - if (opts.safe === true && safe(regex) === false) { - throw new Error('potentially unsafe regular expression: ' + regex.source); - } - - } catch (err) { - if (opts.strictErrors === true || opts.safe === true) { - err.key = key; - err.pattern = pattern; - err.originalOptions = options; - err.createdOptions = opts; - throw err; - } - - try { - regex = new RegExp('^' + pattern.replace(/(\W)/g, '\\$1') + '$'); - } catch (err) { - regex = /.^/; //<= match nothing - } - } - - if (opts.cache !== false) { - memoize(regex, key, pattern, opts); - } - return regex; -} - -/** - * Memoize generated regex. This can result in dramatic speed improvements - * and simplify debugging by adding options and pattern to the regex. It can be - * disabled by passing setting `options.cache` to false. - */ - -function memoize(regex, key, pattern, options) { - define(regex, 'cached', true); - define(regex, 'pattern', pattern); - define(regex, 'options', options); - define(regex, 'key', key); - cache[key] = regex; -} - -/** - * Create the key to use for memoization. The key is generated - * by iterating over the options and concatenating key-value pairs - * to the pattern string. - */ - -function createKey(pattern, options) { - if (!options) return pattern; - var key = pattern; - for (var prop in options) { - if (options.hasOwnProperty(prop)) { - key += ';' + prop + '=' + String(options[prop]); - } - } - return key; -} - -/** - * Expose `makeRe` - */ - -module.exports.makeRe = makeRe; diff --git a/node_modules/to-regex/package.json b/node_modules/to-regex/package.json deleted file mode 100644 index 39d634e6b..000000000 --- a/node_modules/to-regex/package.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "_from": "to-regex@^3.0.2", - "_id": "to-regex@3.0.2", - "_inBundle": false, - "_integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "_location": "/to-regex", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "to-regex@^3.0.2", - "name": "to-regex", - "escapedName": "to-regex", - "rawSpec": "^3.0.2", - "saveSpec": null, - "fetchSpec": "^3.0.2" - }, - "_requiredBy": [ - "/nanomatch", - "/readdirp/braces", - "/readdirp/expand-brackets", - "/readdirp/extglob", - "/readdirp/micromatch" - ], - "_resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "_shasum": "13cfdd9b336552f30b51f33a8ae1b42a7a7599ce", - "_spec": "to-regex@^3.0.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readdirp/node_modules/micromatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/to-regex/issues" - }, - "bundleDependencies": false, - "dependencies": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - }, - "deprecated": false, - "description": "Generate a regex from a string or array of strings.", - "devDependencies": { - "gulp-format-md": "^1.0.0", - "mocha": "^3.5.3" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/to-regex", - "keywords": [ - "match", - "regex", - "regular expression", - "test", - "to" - ], - "license": "MIT", - "main": "index.js", - "name": "to-regex", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/to-regex.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": { - "method": "preWrite" - }, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "has-glob", - "is-glob", - "path-regex", - "to-regex-range" - ] - }, - "lint": { - "reflinks": true - } - }, - "version": "3.0.2" -} diff --git a/node_modules/tty-browserify/LICENSE b/node_modules/tty-browserify/LICENSE deleted file mode 100644 index ee27ba4b4..000000000 --- a/node_modules/tty-browserify/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/tty-browserify/index.js b/node_modules/tty-browserify/index.js deleted file mode 100644 index 7823016c5..000000000 --- a/node_modules/tty-browserify/index.js +++ /dev/null @@ -1,11 +0,0 @@ -exports.isatty = function () { return false; }; - -function ReadStream() { - throw new Error('tty.ReadStream is not implemented'); -} -exports.ReadStream = ReadStream; - -function WriteStream() { - throw new Error('tty.WriteStream is not implemented'); -} -exports.WriteStream = WriteStream; diff --git a/node_modules/tty-browserify/package.json b/node_modules/tty-browserify/package.json deleted file mode 100644 index cab3b4444..000000000 --- a/node_modules/tty-browserify/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "_from": "tty-browserify@0.0.1", - "_id": "tty-browserify@0.0.1", - "_inBundle": false, - "_integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", - "_location": "/tty-browserify", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "tty-browserify@0.0.1", - "name": "tty-browserify", - "escapedName": "tty-browserify", - "rawSpec": "0.0.1", - "saveSpec": null, - "fetchSpec": "0.0.1" - }, - "_requiredBy": [ - "/browserify" - ], - "_resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", - "_shasum": "3f05251ee17904dfd0677546670db9651682b811", - "_spec": "tty-browserify@0.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/browserify/tty-browserify/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "the tty module from node core for browsers", - "devDependencies": { - "tape": "~1.0.4" - }, - "homepage": "https://github.com/browserify/tty-browserify", - "keywords": [ - "tty", - "browser", - "browserify" - ], - "license": "MIT", - "main": "index.js", - "name": "tty-browserify", - "repository": { - "type": "git", - "url": "git://github.com/browserify/tty-browserify.git" - }, - "scripts": { - "test": "tape test/*.js" - }, - "version": "0.0.1" -} diff --git a/node_modules/tty-browserify/readme.markdown b/node_modules/tty-browserify/readme.markdown deleted file mode 100644 index 91a2051ae..000000000 --- a/node_modules/tty-browserify/readme.markdown +++ /dev/null @@ -1 +0,0 @@ -# tty-browserify diff --git a/node_modules/typedarray/.travis.yml b/node_modules/typedarray/.travis.yml deleted file mode 100644 index cc4dba29d..000000000 --- a/node_modules/typedarray/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" diff --git a/node_modules/typedarray/LICENSE b/node_modules/typedarray/LICENSE deleted file mode 100644 index 11adfaec9..000000000 --- a/node_modules/typedarray/LICENSE +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright (c) 2010, Linden Research, Inc. - Copyright (c) 2012, Joshua Bell - - 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. - $/LicenseInfo$ - */ - -// Original can be found at: -// https://bitbucket.org/lindenlab/llsd -// Modifications by Joshua Bell inexorabletash@gmail.com -// https://github.com/inexorabletash/polyfill - -// ES3/ES5 implementation of the Krhonos Typed Array Specification -// Ref: http://www.khronos.org/registry/typedarray/specs/latest/ -// Date: 2011-02-01 -// -// Variations: -// * Allows typed_array.get/set() as alias for subscripts (typed_array[]) diff --git a/node_modules/typedarray/example/tarray.js b/node_modules/typedarray/example/tarray.js deleted file mode 100644 index 8423d7c9b..000000000 --- a/node_modules/typedarray/example/tarray.js +++ /dev/null @@ -1,4 +0,0 @@ -var Uint8Array = require('../').Uint8Array; -var ua = new Uint8Array(5); -ua[1] = 256 + 55; -console.log(ua[1]); diff --git a/node_modules/typedarray/index.js b/node_modules/typedarray/index.js deleted file mode 100644 index 5e540841f..000000000 --- a/node_modules/typedarray/index.js +++ /dev/null @@ -1,630 +0,0 @@ -var undefined = (void 0); // Paranoia - -// Beyond this value, index getters/setters (i.e. array[0], array[1]) are so slow to -// create, and consume so much memory, that the browser appears frozen. -var MAX_ARRAY_LENGTH = 1e5; - -// Approximations of internal ECMAScript conversion functions -var ECMAScript = (function() { - // Stash a copy in case other scripts modify these - var opts = Object.prototype.toString, - ophop = Object.prototype.hasOwnProperty; - - return { - // Class returns internal [[Class]] property, used to avoid cross-frame instanceof issues: - Class: function(v) { return opts.call(v).replace(/^\[object *|\]$/g, ''); }, - HasProperty: function(o, p) { return p in o; }, - HasOwnProperty: function(o, p) { return ophop.call(o, p); }, - IsCallable: function(o) { return typeof o === 'function'; }, - ToInt32: function(v) { return v >> 0; }, - ToUint32: function(v) { return v >>> 0; } - }; -}()); - -// Snapshot intrinsics -var LN2 = Math.LN2, - abs = Math.abs, - floor = Math.floor, - log = Math.log, - min = Math.min, - pow = Math.pow, - round = Math.round; - -// ES5: lock down object properties -function configureProperties(obj) { - if (getOwnPropNames && defineProp) { - var props = getOwnPropNames(obj), i; - for (i = 0; i < props.length; i += 1) { - defineProp(obj, props[i], { - value: obj[props[i]], - writable: false, - enumerable: false, - configurable: false - }); - } - } -} - -// emulate ES5 getter/setter API using legacy APIs -// http://blogs.msdn.com/b/ie/archive/2010/09/07/transitioning-existing-code-to-the-es5-getter-setter-apis.aspx -// (second clause tests for Object.defineProperty() in IE<9 that only supports extending DOM prototypes, but -// note that IE<9 does not support __defineGetter__ or __defineSetter__ so it just renders the method harmless) -var defineProp -if (Object.defineProperty && (function() { - try { - Object.defineProperty({}, 'x', {}); - return true; - } catch (e) { - return false; - } - })()) { - defineProp = Object.defineProperty; -} else { - defineProp = function(o, p, desc) { - if (!o === Object(o)) throw new TypeError("Object.defineProperty called on non-object"); - if (ECMAScript.HasProperty(desc, 'get') && Object.prototype.__defineGetter__) { Object.prototype.__defineGetter__.call(o, p, desc.get); } - if (ECMAScript.HasProperty(desc, 'set') && Object.prototype.__defineSetter__) { Object.prototype.__defineSetter__.call(o, p, desc.set); } - if (ECMAScript.HasProperty(desc, 'value')) { o[p] = desc.value; } - return o; - }; -} - -var getOwnPropNames = Object.getOwnPropertyNames || function (o) { - if (o !== Object(o)) throw new TypeError("Object.getOwnPropertyNames called on non-object"); - var props = [], p; - for (p in o) { - if (ECMAScript.HasOwnProperty(o, p)) { - props.push(p); - } - } - return props; -}; - -// ES5: Make obj[index] an alias for obj._getter(index)/obj._setter(index, value) -// for index in 0 ... obj.length -function makeArrayAccessors(obj) { - if (!defineProp) { return; } - - if (obj.length > MAX_ARRAY_LENGTH) throw new RangeError("Array too large for polyfill"); - - function makeArrayAccessor(index) { - defineProp(obj, index, { - 'get': function() { return obj._getter(index); }, - 'set': function(v) { obj._setter(index, v); }, - enumerable: true, - configurable: false - }); - } - - var i; - for (i = 0; i < obj.length; i += 1) { - makeArrayAccessor(i); - } -} - -// Internal conversion functions: -// pack() - take a number (interpreted as Type), output a byte array -// unpack() - take a byte array, output a Type-like number - -function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; } -function as_unsigned(value, bits) { var s = 32 - bits; return (value << s) >>> s; } - -function packI8(n) { return [n & 0xff]; } -function unpackI8(bytes) { return as_signed(bytes[0], 8); } - -function packU8(n) { return [n & 0xff]; } -function unpackU8(bytes) { return as_unsigned(bytes[0], 8); } - -function packU8Clamped(n) { n = round(Number(n)); return [n < 0 ? 0 : n > 0xff ? 0xff : n & 0xff]; } - -function packI16(n) { return [(n >> 8) & 0xff, n & 0xff]; } -function unpackI16(bytes) { return as_signed(bytes[0] << 8 | bytes[1], 16); } - -function packU16(n) { return [(n >> 8) & 0xff, n & 0xff]; } -function unpackU16(bytes) { return as_unsigned(bytes[0] << 8 | bytes[1], 16); } - -function packI32(n) { return [(n >> 24) & 0xff, (n >> 16) & 0xff, (n >> 8) & 0xff, n & 0xff]; } -function unpackI32(bytes) { return as_signed(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32); } - -function packU32(n) { return [(n >> 24) & 0xff, (n >> 16) & 0xff, (n >> 8) & 0xff, n & 0xff]; } -function unpackU32(bytes) { return as_unsigned(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32); } - -function packIEEE754(v, ebits, fbits) { - - var bias = (1 << (ebits - 1)) - 1, - s, e, f, ln, - i, bits, str, bytes; - - function roundToEven(n) { - var w = floor(n), f = n - w; - if (f < 0.5) - return w; - if (f > 0.5) - return w + 1; - return w % 2 ? w + 1 : w; - } - - // Compute sign, exponent, fraction - if (v !== v) { - // NaN - // http://dev.w3.org/2006/webapi/WebIDL/#es-type-mapping - e = (1 << ebits) - 1; f = pow(2, fbits - 1); s = 0; - } else if (v === Infinity || v === -Infinity) { - e = (1 << ebits) - 1; f = 0; s = (v < 0) ? 1 : 0; - } else if (v === 0) { - e = 0; f = 0; s = (1 / v === -Infinity) ? 1 : 0; - } else { - s = v < 0; - v = abs(v); - - if (v >= pow(2, 1 - bias)) { - e = min(floor(log(v) / LN2), 1023); - f = roundToEven(v / pow(2, e) * pow(2, fbits)); - if (f / pow(2, fbits) >= 2) { - e = e + 1; - f = 1; - } - if (e > bias) { - // Overflow - e = (1 << ebits) - 1; - f = 0; - } else { - // Normalized - e = e + bias; - f = f - pow(2, fbits); - } - } else { - // Denormalized - e = 0; - f = roundToEven(v / pow(2, 1 - bias - fbits)); - } - } - - // Pack sign, exponent, fraction - bits = []; - for (i = fbits; i; i -= 1) { bits.push(f % 2 ? 1 : 0); f = floor(f / 2); } - for (i = ebits; i; i -= 1) { bits.push(e % 2 ? 1 : 0); e = floor(e / 2); } - bits.push(s ? 1 : 0); - bits.reverse(); - str = bits.join(''); - - // Bits to bytes - bytes = []; - while (str.length) { - bytes.push(parseInt(str.substring(0, 8), 2)); - str = str.substring(8); - } - return bytes; -} - -function unpackIEEE754(bytes, ebits, fbits) { - - // Bytes to bits - var bits = [], i, j, b, str, - bias, s, e, f; - - for (i = bytes.length; i; i -= 1) { - b = bytes[i - 1]; - for (j = 8; j; j -= 1) { - bits.push(b % 2 ? 1 : 0); b = b >> 1; - } - } - bits.reverse(); - str = bits.join(''); - - // Unpack sign, exponent, fraction - bias = (1 << (ebits - 1)) - 1; - s = parseInt(str.substring(0, 1), 2) ? -1 : 1; - e = parseInt(str.substring(1, 1 + ebits), 2); - f = parseInt(str.substring(1 + ebits), 2); - - // Produce number - if (e === (1 << ebits) - 1) { - return f !== 0 ? NaN : s * Infinity; - } else if (e > 0) { - // Normalized - return s * pow(2, e - bias) * (1 + f / pow(2, fbits)); - } else if (f !== 0) { - // Denormalized - return s * pow(2, -(bias - 1)) * (f / pow(2, fbits)); - } else { - return s < 0 ? -0 : 0; - } -} - -function unpackF64(b) { return unpackIEEE754(b, 11, 52); } -function packF64(v) { return packIEEE754(v, 11, 52); } -function unpackF32(b) { return unpackIEEE754(b, 8, 23); } -function packF32(v) { return packIEEE754(v, 8, 23); } - - -// -// 3 The ArrayBuffer Type -// - -(function() { - - /** @constructor */ - var ArrayBuffer = function ArrayBuffer(length) { - length = ECMAScript.ToInt32(length); - if (length < 0) throw new RangeError('ArrayBuffer size is not a small enough positive integer'); - - this.byteLength = length; - this._bytes = []; - this._bytes.length = length; - - var i; - for (i = 0; i < this.byteLength; i += 1) { - this._bytes[i] = 0; - } - - configureProperties(this); - }; - - exports.ArrayBuffer = exports.ArrayBuffer || ArrayBuffer; - - // - // 4 The ArrayBufferView Type - // - - // NOTE: this constructor is not exported - /** @constructor */ - var ArrayBufferView = function ArrayBufferView() { - //this.buffer = null; - //this.byteOffset = 0; - //this.byteLength = 0; - }; - - // - // 5 The Typed Array View Types - // - - function makeConstructor(bytesPerElement, pack, unpack) { - // Each TypedArray type requires a distinct constructor instance with - // identical logic, which this produces. - - var ctor; - ctor = function(buffer, byteOffset, length) { - var array, sequence, i, s; - - if (!arguments.length || typeof arguments[0] === 'number') { - // Constructor(unsigned long length) - this.length = ECMAScript.ToInt32(arguments[0]); - if (length < 0) throw new RangeError('ArrayBufferView size is not a small enough positive integer'); - - this.byteLength = this.length * this.BYTES_PER_ELEMENT; - this.buffer = new ArrayBuffer(this.byteLength); - this.byteOffset = 0; - } else if (typeof arguments[0] === 'object' && arguments[0].constructor === ctor) { - // Constructor(TypedArray array) - array = arguments[0]; - - this.length = array.length; - this.byteLength = this.length * this.BYTES_PER_ELEMENT; - this.buffer = new ArrayBuffer(this.byteLength); - this.byteOffset = 0; - - for (i = 0; i < this.length; i += 1) { - this._setter(i, array._getter(i)); - } - } else if (typeof arguments[0] === 'object' && - !(arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) { - // Constructor(sequence array) - sequence = arguments[0]; - - this.length = ECMAScript.ToUint32(sequence.length); - this.byteLength = this.length * this.BYTES_PER_ELEMENT; - this.buffer = new ArrayBuffer(this.byteLength); - this.byteOffset = 0; - - for (i = 0; i < this.length; i += 1) { - s = sequence[i]; - this._setter(i, Number(s)); - } - } else if (typeof arguments[0] === 'object' && - (arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) { - // Constructor(ArrayBuffer buffer, - // optional unsigned long byteOffset, optional unsigned long length) - this.buffer = buffer; - - this.byteOffset = ECMAScript.ToUint32(byteOffset); - if (this.byteOffset > this.buffer.byteLength) { - throw new RangeError("byteOffset out of range"); - } - - if (this.byteOffset % this.BYTES_PER_ELEMENT) { - // The given byteOffset must be a multiple of the element - // size of the specific type, otherwise an exception is raised. - throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size."); - } - - if (arguments.length < 3) { - this.byteLength = this.buffer.byteLength - this.byteOffset; - - if (this.byteLength % this.BYTES_PER_ELEMENT) { - throw new RangeError("length of buffer minus byteOffset not a multiple of the element size"); - } - this.length = this.byteLength / this.BYTES_PER_ELEMENT; - } else { - this.length = ECMAScript.ToUint32(length); - this.byteLength = this.length * this.BYTES_PER_ELEMENT; - } - - if ((this.byteOffset + this.byteLength) > this.buffer.byteLength) { - throw new RangeError("byteOffset and length reference an area beyond the end of the buffer"); - } - } else { - throw new TypeError("Unexpected argument type(s)"); - } - - this.constructor = ctor; - - configureProperties(this); - makeArrayAccessors(this); - }; - - ctor.prototype = new ArrayBufferView(); - ctor.prototype.BYTES_PER_ELEMENT = bytesPerElement; - ctor.prototype._pack = pack; - ctor.prototype._unpack = unpack; - ctor.BYTES_PER_ELEMENT = bytesPerElement; - - // getter type (unsigned long index); - ctor.prototype._getter = function(index) { - if (arguments.length < 1) throw new SyntaxError("Not enough arguments"); - - index = ECMAScript.ToUint32(index); - if (index >= this.length) { - return undefined; - } - - var bytes = [], i, o; - for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; - i < this.BYTES_PER_ELEMENT; - i += 1, o += 1) { - bytes.push(this.buffer._bytes[o]); - } - return this._unpack(bytes); - }; - - // NONSTANDARD: convenience alias for getter: type get(unsigned long index); - ctor.prototype.get = ctor.prototype._getter; - - // setter void (unsigned long index, type value); - ctor.prototype._setter = function(index, value) { - if (arguments.length < 2) throw new SyntaxError("Not enough arguments"); - - index = ECMAScript.ToUint32(index); - if (index >= this.length) { - return undefined; - } - - var bytes = this._pack(value), i, o; - for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; - i < this.BYTES_PER_ELEMENT; - i += 1, o += 1) { - this.buffer._bytes[o] = bytes[i]; - } - }; - - // void set(TypedArray array, optional unsigned long offset); - // void set(sequence array, optional unsigned long offset); - ctor.prototype.set = function(index, value) { - if (arguments.length < 1) throw new SyntaxError("Not enough arguments"); - var array, sequence, offset, len, - i, s, d, - byteOffset, byteLength, tmp; - - if (typeof arguments[0] === 'object' && arguments[0].constructor === this.constructor) { - // void set(TypedArray array, optional unsigned long offset); - array = arguments[0]; - offset = ECMAScript.ToUint32(arguments[1]); - - if (offset + array.length > this.length) { - throw new RangeError("Offset plus length of array is out of range"); - } - - byteOffset = this.byteOffset + offset * this.BYTES_PER_ELEMENT; - byteLength = array.length * this.BYTES_PER_ELEMENT; - - if (array.buffer === this.buffer) { - tmp = []; - for (i = 0, s = array.byteOffset; i < byteLength; i += 1, s += 1) { - tmp[i] = array.buffer._bytes[s]; - } - for (i = 0, d = byteOffset; i < byteLength; i += 1, d += 1) { - this.buffer._bytes[d] = tmp[i]; - } - } else { - for (i = 0, s = array.byteOffset, d = byteOffset; - i < byteLength; i += 1, s += 1, d += 1) { - this.buffer._bytes[d] = array.buffer._bytes[s]; - } - } - } else if (typeof arguments[0] === 'object' && typeof arguments[0].length !== 'undefined') { - // void set(sequence array, optional unsigned long offset); - sequence = arguments[0]; - len = ECMAScript.ToUint32(sequence.length); - offset = ECMAScript.ToUint32(arguments[1]); - - if (offset + len > this.length) { - throw new RangeError("Offset plus length of array is out of range"); - } - - for (i = 0; i < len; i += 1) { - s = sequence[i]; - this._setter(offset + i, Number(s)); - } - } else { - throw new TypeError("Unexpected argument type(s)"); - } - }; - - // TypedArray subarray(long begin, optional long end); - ctor.prototype.subarray = function(start, end) { - function clamp(v, min, max) { return v < min ? min : v > max ? max : v; } - - start = ECMAScript.ToInt32(start); - end = ECMAScript.ToInt32(end); - - if (arguments.length < 1) { start = 0; } - if (arguments.length < 2) { end = this.length; } - - if (start < 0) { start = this.length + start; } - if (end < 0) { end = this.length + end; } - - start = clamp(start, 0, this.length); - end = clamp(end, 0, this.length); - - var len = end - start; - if (len < 0) { - len = 0; - } - - return new this.constructor( - this.buffer, this.byteOffset + start * this.BYTES_PER_ELEMENT, len); - }; - - return ctor; - } - - var Int8Array = makeConstructor(1, packI8, unpackI8); - var Uint8Array = makeConstructor(1, packU8, unpackU8); - var Uint8ClampedArray = makeConstructor(1, packU8Clamped, unpackU8); - var Int16Array = makeConstructor(2, packI16, unpackI16); - var Uint16Array = makeConstructor(2, packU16, unpackU16); - var Int32Array = makeConstructor(4, packI32, unpackI32); - var Uint32Array = makeConstructor(4, packU32, unpackU32); - var Float32Array = makeConstructor(4, packF32, unpackF32); - var Float64Array = makeConstructor(8, packF64, unpackF64); - - exports.Int8Array = exports.Int8Array || Int8Array; - exports.Uint8Array = exports.Uint8Array || Uint8Array; - exports.Uint8ClampedArray = exports.Uint8ClampedArray || Uint8ClampedArray; - exports.Int16Array = exports.Int16Array || Int16Array; - exports.Uint16Array = exports.Uint16Array || Uint16Array; - exports.Int32Array = exports.Int32Array || Int32Array; - exports.Uint32Array = exports.Uint32Array || Uint32Array; - exports.Float32Array = exports.Float32Array || Float32Array; - exports.Float64Array = exports.Float64Array || Float64Array; -}()); - -// -// 6 The DataView View Type -// - -(function() { - function r(array, index) { - return ECMAScript.IsCallable(array.get) ? array.get(index) : array[index]; - } - - var IS_BIG_ENDIAN = (function() { - var u16array = new(exports.Uint16Array)([0x1234]), - u8array = new(exports.Uint8Array)(u16array.buffer); - return r(u8array, 0) === 0x12; - }()); - - // Constructor(ArrayBuffer buffer, - // optional unsigned long byteOffset, - // optional unsigned long byteLength) - /** @constructor */ - var DataView = function DataView(buffer, byteOffset, byteLength) { - if (arguments.length === 0) { - buffer = new exports.ArrayBuffer(0); - } else if (!(buffer instanceof exports.ArrayBuffer || ECMAScript.Class(buffer) === 'ArrayBuffer')) { - throw new TypeError("TypeError"); - } - - this.buffer = buffer || new exports.ArrayBuffer(0); - - this.byteOffset = ECMAScript.ToUint32(byteOffset); - if (this.byteOffset > this.buffer.byteLength) { - throw new RangeError("byteOffset out of range"); - } - - if (arguments.length < 3) { - this.byteLength = this.buffer.byteLength - this.byteOffset; - } else { - this.byteLength = ECMAScript.ToUint32(byteLength); - } - - if ((this.byteOffset + this.byteLength) > this.buffer.byteLength) { - throw new RangeError("byteOffset and length reference an area beyond the end of the buffer"); - } - - configureProperties(this); - }; - - function makeGetter(arrayType) { - return function(byteOffset, littleEndian) { - - byteOffset = ECMAScript.ToUint32(byteOffset); - - if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) { - throw new RangeError("Array index out of range"); - } - byteOffset += this.byteOffset; - - var uint8Array = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT), - bytes = [], i; - for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) { - bytes.push(r(uint8Array, i)); - } - - if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) { - bytes.reverse(); - } - - return r(new arrayType(new exports.Uint8Array(bytes).buffer), 0); - }; - } - - DataView.prototype.getUint8 = makeGetter(exports.Uint8Array); - DataView.prototype.getInt8 = makeGetter(exports.Int8Array); - DataView.prototype.getUint16 = makeGetter(exports.Uint16Array); - DataView.prototype.getInt16 = makeGetter(exports.Int16Array); - DataView.prototype.getUint32 = makeGetter(exports.Uint32Array); - DataView.prototype.getInt32 = makeGetter(exports.Int32Array); - DataView.prototype.getFloat32 = makeGetter(exports.Float32Array); - DataView.prototype.getFloat64 = makeGetter(exports.Float64Array); - - function makeSetter(arrayType) { - return function(byteOffset, value, littleEndian) { - - byteOffset = ECMAScript.ToUint32(byteOffset); - if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) { - throw new RangeError("Array index out of range"); - } - - // Get bytes - var typeArray = new arrayType([value]), - byteArray = new exports.Uint8Array(typeArray.buffer), - bytes = [], i, byteView; - - for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) { - bytes.push(r(byteArray, i)); - } - - // Flip if necessary - if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) { - bytes.reverse(); - } - - // Write them - byteView = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT); - byteView.set(bytes); - }; - } - - DataView.prototype.setUint8 = makeSetter(exports.Uint8Array); - DataView.prototype.setInt8 = makeSetter(exports.Int8Array); - DataView.prototype.setUint16 = makeSetter(exports.Uint16Array); - DataView.prototype.setInt16 = makeSetter(exports.Int16Array); - DataView.prototype.setUint32 = makeSetter(exports.Uint32Array); - DataView.prototype.setInt32 = makeSetter(exports.Int32Array); - DataView.prototype.setFloat32 = makeSetter(exports.Float32Array); - DataView.prototype.setFloat64 = makeSetter(exports.Float64Array); - - exports.DataView = exports.DataView || DataView; - -}()); diff --git a/node_modules/typedarray/package.json b/node_modules/typedarray/package.json deleted file mode 100644 index ee00a9fe5..000000000 --- a/node_modules/typedarray/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "_from": "typedarray@^0.0.6", - "_id": "typedarray@0.0.6", - "_inBundle": false, - "_integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "_location": "/typedarray", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "typedarray@^0.0.6", - "name": "typedarray", - "escapedName": "typedarray", - "rawSpec": "^0.0.6", - "saveSpec": null, - "fetchSpec": "^0.0.6" - }, - "_requiredBy": [ - "/concat-stream" - ], - "_resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "_shasum": "867ac74e3864187b1d3d47d996a78ec5c8830777", - "_spec": "typedarray@^0.0.6", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/concat-stream", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/typedarray/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "TypedArray polyfill for old browsers", - "devDependencies": { - "tape": "~2.3.2" - }, - "homepage": "https://github.com/substack/typedarray", - "keywords": [ - "ArrayBuffer", - "DataView", - "Float32Array", - "Float64Array", - "Int8Array", - "Int16Array", - "Int32Array", - "Uint8Array", - "Uint8ClampedArray", - "Uint16Array", - "Uint32Array", - "typed", - "array", - "polyfill" - ], - "license": "MIT", - "main": "index.js", - "name": "typedarray", - "repository": { - "type": "git", - "url": "git://github.com/substack/typedarray.git" - }, - "scripts": { - "test": "tape test/*.js test/server/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/6..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "version": "0.0.6" -} diff --git a/node_modules/typedarray/readme.markdown b/node_modules/typedarray/readme.markdown deleted file mode 100644 index d18f6f719..000000000 --- a/node_modules/typedarray/readme.markdown +++ /dev/null @@ -1,61 +0,0 @@ -# typedarray - -TypedArray polyfill ripped from [this -module](https://raw.github.com/inexorabletash/polyfill). - -[![build status](https://secure.travis-ci.org/substack/typedarray.png)](http://travis-ci.org/substack/typedarray) - -[![testling badge](https://ci.testling.com/substack/typedarray.png)](https://ci.testling.com/substack/typedarray) - -# example - -``` js -var Uint8Array = require('typedarray').Uint8Array; -var ua = new Uint8Array(5); -ua[1] = 256 + 55; -console.log(ua[1]); -``` - -output: - -``` -55 -``` - -# methods - -``` js -var TA = require('typedarray') -``` - -The `TA` object has the following constructors: - -* TA.ArrayBuffer -* TA.DataView -* TA.Float32Array -* TA.Float64Array -* TA.Int8Array -* TA.Int16Array -* TA.Int32Array -* TA.Uint8Array -* TA.Uint8ClampedArray -* TA.Uint16Array -* TA.Uint32Array - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install typedarray -``` - -To use this module in the browser, compile with -[browserify](http://browserify.org) -or download a UMD build from browserify CDN: - -http://wzrd.in/standalone/typedarray@latest - -# license - -MIT diff --git a/node_modules/typedarray/test/server/undef_globals.js b/node_modules/typedarray/test/server/undef_globals.js deleted file mode 100644 index 425950f9f..000000000 --- a/node_modules/typedarray/test/server/undef_globals.js +++ /dev/null @@ -1,19 +0,0 @@ -var test = require('tape'); -var vm = require('vm'); -var fs = require('fs'); -var src = fs.readFileSync(__dirname + '/../../index.js', 'utf8'); - -test('u8a without globals', function (t) { - var c = { - module: { exports: {} }, - }; - c.exports = c.module.exports; - vm.runInNewContext(src, c); - var TA = c.module.exports; - var ua = new(TA.Uint8Array)(5); - - t.equal(ua.length, 5); - ua[1] = 256 + 55; - t.equal(ua[1], 55); - t.end(); -}); diff --git a/node_modules/typedarray/test/tarray.js b/node_modules/typedarray/test/tarray.js deleted file mode 100644 index df596a34f..000000000 --- a/node_modules/typedarray/test/tarray.js +++ /dev/null @@ -1,10 +0,0 @@ -var TA = require('../'); -var test = require('tape'); - -test('tiny u8a test', function (t) { - var ua = new(TA.Uint8Array)(5); - t.equal(ua.length, 5); - ua[1] = 256 + 55; - t.equal(ua[1], 55); - t.end(); -}); diff --git a/node_modules/ultron/.npmignore b/node_modules/ultron/.npmignore deleted file mode 100644 index 66210a2a6..000000000 --- a/node_modules/ultron/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -coverage -.tern-port diff --git a/node_modules/ultron/.travis.yml b/node_modules/ultron/.travis.yml deleted file mode 100644 index a505004be..000000000 --- a/node_modules/ultron/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -sudo: false -language: node_js -node_js: - - "0.12" - - "0.10" - - "0.8" - - "iojs" -before_install: - - 'if [ "${TRAVIS_NODE_VERSION}" == "0.8" ]; then npm install -g npm@2.11.1; fi' -script: - - "npm run test-travis" -after_script: - - "npm install coveralls@2.11.x && cat coverage/lcov.info | coveralls" -matrix: - fast_finish: true -notifications: - irc: - channels: - - "irc.freenode.org#unshift" - on_success: change - on_failure: change diff --git a/node_modules/ultron/LICENSE b/node_modules/ultron/LICENSE deleted file mode 100644 index 6dc9316a6..000000000 --- a/node_modules/ultron/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Unshift.io, Arnout Kazemier, the 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. - diff --git a/node_modules/ultron/README.md b/node_modules/ultron/README.md deleted file mode 100644 index 84fa3f238..000000000 --- a/node_modules/ultron/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# Ultron - -[![Made by unshift](https://img.shields.io/badge/made%20by-unshift-00ffcc.svg?style=flat-square)](http://unshift.io)[![Version npm](http://img.shields.io/npm/v/ultron.svg?style=flat-square)](http://browsenpm.org/package/ultron)[![Build Status](http://img.shields.io/travis/unshiftio/ultron/master.svg?style=flat-square)](https://travis-ci.org/unshiftio/ultron)[![Dependencies](https://img.shields.io/david/unshiftio/ultron.svg?style=flat-square)](https://david-dm.org/unshiftio/ultron)[![Coverage Status](http://img.shields.io/coveralls/unshiftio/ultron/master.svg?style=flat-square)](https://coveralls.io/r/unshiftio/ultron?branch=master)[![IRC channel](http://img.shields.io/badge/IRC-irc.freenode.net%23unshift-00a8ff.svg?style=flat-square)](http://webchat.freenode.net/?channels=unshift) - -Ultron is a high-intelligence robot. It gathers intelligence so it can start -improving upon his rudimentary design. It will learn your event emitting -patterns and find ways to exterminate them. Allowing you to remove only the -event emitters that **you** assigned and not the ones that your users or -developers assigned. This can prevent race conditions, memory leaks and even file -descriptor leaks from ever happening as you won't remove clean up processes. - -## Installation - -The module is designed to be used in browsers using browserify and in Node.js. -You can install the module through the public npm registry by running the -following command in CLI: - -``` -npm install --save ultron -``` - -## Usage - -In all examples we assume that you've required the library as following: - -```js -'use strict'; - -var Ultron = require('ultron'); -``` - -Now that we've required the library we can construct our first `Ultron` instance. -The constructor requires one argument which should be the `EventEmitter` -instance that we need to operate upon. This can be the `EventEmitter` module -that ships with Node.js or `EventEmitter3` or anything else as long as it -follow the same API and internal structure as these 2. So with that in mind we -can create the instance: - -```js -// -// For the sake of this example we're going to construct an empty EventEmitter -// -var EventEmitter = require('events').EventEmitter; // or require('eventmitter3'); -var events = new EventEmitter(); - -var ultron = new Ultron(events); -``` - -You can now use the following API's from the Ultron instance: - -### Ultron.on - -Register a new event listener for the given event. It follows the exact same API -as `EventEmitter.on` but it will return itself instead of returning the -EventEmitter instance. If you are using EventEmitter3 it also supports the -context param: - -```js -ultron.on('event-name', handler, { custom: 'function context' }); -``` - -### Ultron.once - -Exactly the same as the [Ultron.on](#ultronon) but it only allows the execution -once. - -### Ultron.remove - -This is where all the magic happens and the safe removal starts. This function -accepts different argument styles: - -- No arguments, assume that all events need to be removed so it will work as - `removeAllListeners()` API. -- 1 argument, when it's a string it will be split on ` ` and `,` to create a - list of events that need to be cleared. -- Multiple arguments, we assume that they are all names of events that need to - be cleared. - -```js -ultron.remove('foo, bar baz'); // Removes foo, bar and baz. -ultron.remove('foo', 'bar', 'baz'); // Removes foo, bar and baz. -ultron.remove(); // Removes everything. -``` - -If you just want to remove a single event listener using a function reference -you can still use the EventEmitter's `removeListener(event, fn)` API: - -```js -function foo() {} - -ulton.on('foo', foo); -events.removeListener('foo', foo); -``` - -## License - -MIT diff --git a/node_modules/ultron/index.js b/node_modules/ultron/index.js deleted file mode 100644 index af17ab7cc..000000000 --- a/node_modules/ultron/index.js +++ /dev/null @@ -1,129 +0,0 @@ -'use strict'; - -var has = Object.prototype.hasOwnProperty; - -/** - * An auto incrementing id which we can use to create "unique" Ultron instances - * so we can track the event emitters that are added through the Ultron - * interface. - * - * @type {Number} - * @private - */ -var id = 0; - -/** - * Ultron is high-intelligence robot. It gathers intelligence so it can start improving - * upon his rudimentary design. It will learn from your EventEmitting patterns - * and exterminate them. - * - * @constructor - * @param {EventEmitter} ee EventEmitter instance we need to wrap. - * @api public - */ -function Ultron(ee) { - if (!(this instanceof Ultron)) return new Ultron(ee); - - this.id = id++; - this.ee = ee; -} - -/** - * Register a new EventListener for the given event. - * - * @param {String} event Name of the event. - * @param {Functon} fn Callback function. - * @param {Mixed} context The context of the function. - * @returns {Ultron} - * @api public - */ -Ultron.prototype.on = function on(event, fn, context) { - fn.__ultron = this.id; - this.ee.on(event, fn, context); - - return this; -}; -/** - * Add an EventListener that's only called once. - * - * @param {String} event Name of the event. - * @param {Function} fn Callback function. - * @param {Mixed} context The context of the function. - * @returns {Ultron} - * @api public - */ -Ultron.prototype.once = function once(event, fn, context) { - fn.__ultron = this.id; - this.ee.once(event, fn, context); - - return this; -}; - -/** - * Remove the listeners we assigned for the given event. - * - * @returns {Ultron} - * @api public - */ -Ultron.prototype.remove = function remove() { - var args = arguments - , event; - - // - // When no event names are provided we assume that we need to clear all the - // events that were assigned through us. - // - if (args.length === 1 && 'string' === typeof args[0]) { - args = args[0].split(/[, ]+/); - } else if (!args.length) { - args = []; - - for (event in this.ee._events) { - if (has.call(this.ee._events, event)) args.push(event); - } - } - - for (var i = 0; i < args.length; i++) { - var listeners = this.ee.listeners(args[i]); - - for (var j = 0; j < listeners.length; j++) { - event = listeners[j]; - - // - // Once listeners have a `listener` property that stores the real listener - // in the EventEmitter that ships with Node.js. - // - if (event.listener) { - if (event.listener.__ultron !== this.id) continue; - delete event.listener.__ultron; - } else { - if (event.__ultron !== this.id) continue; - delete event.__ultron; - } - - this.ee.removeListener(args[i], event); - } - } - - return this; -}; - -/** - * Destroy the Ultron instance, remove all listeners and release all references. - * - * @returns {Boolean} - * @api public - */ -Ultron.prototype.destroy = function destroy() { - if (!this.ee) return false; - - this.remove(); - this.ee = null; - - return true; -}; - -// -// Expose the module. -// -module.exports = Ultron; diff --git a/node_modules/ultron/package.json b/node_modules/ultron/package.json deleted file mode 100644 index 7a73c2d08..000000000 --- a/node_modules/ultron/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_from": "ultron@1.0.x", - "_id": "ultron@1.0.2", - "_inBundle": false, - "_integrity": "sha1-rOEWq1V80Zc4ak6I9GhTeMiy5Po=", - "_location": "/ultron", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ultron@1.0.x", - "name": "ultron", - "escapedName": "ultron", - "rawSpec": "1.0.x", - "saveSpec": null, - "fetchSpec": "1.0.x" - }, - "_requiredBy": [ - "/ws" - ], - "_resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz", - "_shasum": "ace116ab557cd197386a4e88f4685378c8b2e4fa", - "_spec": "ultron@1.0.x", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/ws", - "author": { - "name": "Arnout Kazemier" - }, - "bugs": { - "url": "https://github.com/unshiftio/ultron/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Ultron is high-intelligence robot. It gathers intel so it can start improving upon his rudimentary design", - "devDependencies": { - "assume": "1.2.x", - "eventemitter3": "1.1.x", - "istanbul": "0.3.x", - "mocha": "2.2.x", - "pre-commit": "1.0.x" - }, - "homepage": "https://github.com/unshiftio/ultron", - "keywords": [ - "Ultron", - "robot", - "gather", - "intelligence", - "event", - "events", - "eventemitter", - "emitter", - "cleanup" - ], - "license": "MIT", - "main": "index.js", - "name": "ultron", - "repository": { - "type": "git", - "url": "git+https://github.com/unshiftio/ultron.git" - }, - "scripts": { - "100%": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100", - "coverage": "istanbul cover ./node_modules/.bin/_mocha -- test.js", - "test": "mocha test.js", - "test-travis": "istanbul cover node_modules/.bin/_mocha --report lcovonly -- test.js", - "watch": "mocha --watch test.js" - }, - "version": "1.0.2" -} diff --git a/node_modules/ultron/test.js b/node_modules/ultron/test.js deleted file mode 100644 index 1fd4f1bb5..000000000 --- a/node_modules/ultron/test.js +++ /dev/null @@ -1,327 +0,0 @@ -/* istanbul ignore next */ -describe('Ultron', function () { - 'use strict'; - - var EventEmitter = require('eventemitter3') - , EE = require('events').EventEmitter - , assume = require('assume') - , Ultron = require('./') - , ultron - , ee; - - beforeEach(function () { - ee = new EventEmitter(); - ultron = new Ultron(ee); - }); - - afterEach(function () { - ultron.destroy(); - ee.removeAllListeners(); - }); - - it('is exposed as a function', function () { - assume(Ultron).is.a('function'); - }); - - it('can be initialized without the new keyword', function () { - assume(Ultron(ee)).is.instanceOf(Ultron); - }); - - it('assigns a unique id to every instance', function () { - for (var i = 0; i < 100; i++) { - assume(ultron.id).does.not.equal((new Ultron()).id); - } - }); - - it('allows removal through the event emitter', function () { - function foo() {} - function bar() {} - - ultron.on('foo', foo); - ultron.once('foo', bar); - - assume(foo.__ultron).equals(ultron.id); - assume(bar.__ultron).equals(ultron.id); - assume(ee.listeners('foo').length).equals(2); - - ee.removeListener('foo', foo); - assume(ee.listeners('foo').length).equals(1); - - ee.removeListener('foo', bar); - assume(ee.listeners('foo').length).equals(0); - }); - - describe('#on', function () { - it('assigns a listener', function () { - assume(ee.listeners('foo').length).equals(0); - - function foo() {} - - ultron.on('foo', foo); - assume(ee.listeners('foo').length).equals(1); - assume(ee.listeners('foo')[0]).equals(foo); - }); - - it('tags the assigned function', function () { - assume(ee.listeners('foo').length).equals(0); - - ultron.on('foo', function () {}); - assume(ee.listeners('foo')[0].__ultron).equals(ultron.id); - }); - - it('also passes in the context', function (next) { - var context = 1313; - - ultron.on('foo', function (a, b, c) { - assume(a).equals('a'); - assume(b).equals('b'); - assume(c).equals('c'); - - assume(this).equals(context); - - next(); - }, context); - - ee.emit('foo', 'a', 'b', 'c'); - }); - - it('works with regular eventemitters as well', function (next) { - var ee = new EE() - , ultron = new Ultron(ee); - - ultron.on('foo', function (a, b, c) { - assume(a).equals('a'); - assume(b).equals('b'); - assume(c).equals('c'); - - next(); - }); - - ee.emit('foo', 'a', 'b', 'c'); - }); - }); - - describe('#once', function () { - it('assigns a listener', function () { - assume(ee.listeners('foo').length).equals(0); - - function foo() {} - ultron.once('foo', foo); - assume(ee.listeners('foo').length).equals(1); - assume(ee.listeners('foo')[0]).equals(foo); - }); - - it('tags the assigned function', function () { - assume(ee.listeners('foo').length).equals(0); - - ultron.once('foo', function () {}); - assume(ee.listeners('foo')[0].__ultron).equals(ultron.id); - }); - - it('also passes in the context', function (next) { - var context = 1313; - - ultron.once('foo', function (a, b, c) { - assume(a).equals('a'); - assume(b).equals('b'); - assume(c).equals('c'); - - assume(this).equals(context); - - next(); - }, context); - - ee.emit('foo', 'a', 'b', 'c'); - ee.emit('foo', 'a', 'b', 'c'); // Ensure that we don't double execute - }); - - it('works with regular eventemitters as well', function (next) { - var ee = new EE() - , ultron = new Ultron(ee); - - ultron.once('foo', function (a, b, c) { - assume(a).equals('a'); - assume(b).equals('b'); - assume(c).equals('c'); - - next(); - }); - - ee.emit('foo', 'a', 'b', 'c'); - ee.emit('foo', 'a', 'b', 'c'); // Ensure that we don't double execute - }); - }); - - describe('#remove', function () { - it('removes only our assigned `on` listeners', function () { - function foo() {} - function bar() {} - - ee.on('foo', foo); - ultron.on('foo', bar); - assume(ee.listeners('foo').length).equals(2); - - ultron.remove('foo'); - assume(ee.listeners('foo').length).equals(1); - assume(ee.listeners('foo')[0]).equals(foo); - }); - - it('removes our private __ultron references', function () { - function once() {} - function on() {} - - assume('__ultron' in once).is.false(); - assume('__ultron' in on).is.false(); - - ultron.on('foo', on); - ultron.once('bar', once); - - assume('__ultron' in once).is.true(); - assume('__ultron' in on).is.true(); - - ultron.remove('foo, bar'); - - assume('__ultron' in once).is.false(); - assume('__ultron' in on).is.false(); - - ultron.destroy(); - - ee = new EE(); - ultron = new Ultron(ee); - - assume('__ultron' in once).is.false(); - assume('__ultron' in on).is.false(); - - ultron.on('foo', on); - ultron.once('bar', once); - - assume('__ultron' in once).is.true(); - assume('__ultron' in on).is.true(); - - ultron.remove('foo, bar'); - - assume('__ultron' in once).is.false(); - assume('__ultron' in on).is.false(); - }); - - it('removes only our assigned `once` listeners', function () { - function foo() {} - function bar() {} - - ee.once('foo', foo); - ultron.once('foo', bar); - assume(ee.listeners('foo').length).equals(2); - - ultron.remove('foo'); - assume(ee.listeners('foo').length).equals(1); - assume(ee.listeners('foo')[0]).equals(foo); - }); - - it('removes only our assigned `once` listeners from regular EE', function () { - var ee = new EE() - , ultron = new Ultron(ee); - - function foo() {} - function bar() {} - - ee.once('foo', foo); - ultron.once('foo', bar); - assume(ee.listeners('foo').length).equals(2); - - ultron.remove('foo'); - assume(ee.listeners('foo').length).equals(1); - assume(ee.listeners('foo')[0].listener).equals(foo); - }); - - it('removes all assigned events if called without args', function () { - function foo() {} - function bar() {} - - ultron.on('foo', foo); - ultron.on('bar', bar); - - assume(ee.listeners('foo').length).equals(1); - assume(ee.listeners('bar').length).equals(1); - - ultron.remove(); - - assume(ee.listeners('foo').length).equals(0); - assume(ee.listeners('bar').length).equals(0); - }); - - it('removes multiple listeners based on args', function () { - function foo() {} - function bar() {} - function baz() {} - - ultron.on('foo', foo); - ultron.on('bar', bar); - ultron.on('baz', baz); - - assume(ee.listeners('foo').length).equals(1); - assume(ee.listeners('bar').length).equals(1); - assume(ee.listeners('baz').length).equals(1); - - ultron.remove('foo', 'bar'); - - assume(ee.listeners('foo').length).equals(0); - assume(ee.listeners('bar').length).equals(0); - assume(ee.listeners('baz').length).equals(1); - }); - - it('removes multiple listeners if first arg is seperated string', function () { - function foo() {} - function bar() {} - function baz() {} - - ultron.on('foo', foo); - ultron.on('bar', bar); - ultron.on('baz', baz); - - assume(ee.listeners('foo').length).equals(1); - assume(ee.listeners('bar').length).equals(1); - assume(ee.listeners('baz').length).equals(1); - - ultron.remove('foo, bar'); - - assume(ee.listeners('foo').length).equals(0); - assume(ee.listeners('bar').length).equals(0); - assume(ee.listeners('baz').length).equals(1); - }); - }); - - describe('#destroy', function () { - it('removes all listeners', function () { - function foo() {} - function bar() {} - function baz() {} - - ultron.on('foo', foo); - ultron.on('bar', bar); - ultron.on('baz', baz); - - assume(ee.listeners('foo').length).equals(1); - assume(ee.listeners('bar').length).equals(1); - assume(ee.listeners('baz').length).equals(1); - - ultron.destroy(); - - assume(ee.listeners('foo').length).equals(0); - assume(ee.listeners('bar').length).equals(0); - assume(ee.listeners('baz').length).equals(0); - }); - - it('removes the .ee reference', function () { - assume(ultron.ee).equals(ee); - ultron.destroy(); - assume(ultron.ee).equals(null); - }); - - it('returns booleans for state indication', function () { - assume(ultron.destroy()).is.true(); - assume(ultron.destroy()).is.false(); - assume(ultron.destroy()).is.false(); - assume(ultron.destroy()).is.false(); - }); - }); -}); diff --git a/node_modules/umd/HISTORY.md b/node_modules/umd/HISTORY.md deleted file mode 100644 index 2d4b449a2..000000000 --- a/node_modules/umd/HISTORY.md +++ /dev/null @@ -1,64 +0,0 @@ -3.0.1 / 2015-04-25 -================== - -- Document and test casing/sanitization behavior (thanks @bendrucker) - -3.0.0 / 2015-02-04 -================== - - - remove dependency on ruglify (thanks to @zertosh) - - add `this` as an additional fallback when looking for a global (thanks to @winterbe) - - use `options` rather than `true` / `false` for whether to use CommonJS (with fallback for backwards compatibility). - - support `$` and `_` in module names (thanks to @fitnr) **(BREAKING CHANGE)** - - uglify as a pre-publish step - removing a dependency - - brfs as a pre-publish step - allowing this module to be used from the browser. - - remove support for streaming **(BREAKING CHANGE)** - -2.1.0 / 2014-04-02 -================== - - - Check for definition of `module` as well as `exports` for CommonJS (fixes some custom RequireJS loaders) - - Pass empty array to define for AMD - -2.0.0 / 2013-12-29 -================== - - - Use module name as a namespace for globals if it contains `.` - -1.3.1 / 2013-08-25 -================== - - - Update uglify-js - -1.3.0 / 2013-08-01 -================== - - - Remove SES and Montage bootstrap - - Add MIT LICENSE - - Handle web workers global - - Update uglify-js to fix npm warning - -1.2.1 / 2013-06-07 -================== - - - Fix CLI - -1.2.0 / 2013-06-07 -================== - - - Add CLI - -1.1.1 / 2013-04-15 -================== - - - Update through - -1.1.0 / 2013-03-31 -================== - - - Make Cammel Case less suprising/forcefull - -1.0.0 / 2013-03-16 -================== - - - Initial Release diff --git a/node_modules/umd/LICENSE b/node_modules/umd/LICENSE deleted file mode 100644 index dfb0b19ea..000000000 --- a/node_modules/umd/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013 Forbes Lindesay - -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. \ No newline at end of file diff --git a/node_modules/umd/README.md b/node_modules/umd/README.md deleted file mode 100644 index 1fb98c58d..000000000 --- a/node_modules/umd/README.md +++ /dev/null @@ -1,82 +0,0 @@ -# umd - - -Universal Module Definition for use in automated build systems - - - simple synchronous wrapping of a string - - `return` style module support - - CommonJS support - - prevents internal UMDs from conflicting - -[![Build Status](https://img.shields.io/travis/ForbesLindesay/umd/master.svg)](https://travis-ci.org/ForbesLindesay/umd) -[![Dependency Status](https://img.shields.io/david/ForbesLindesay/umd.svg)](https://david-dm.org/ForbesLindesay/umd) -[![NPM version](https://img.shields.io/npm/v/umd.svg)](https://www.npmjs.com/package/umd) - -## Source Format - -In order for the UMD wrapper to work the source code for your module should `return` the export, e.g. - -```javascript -function method() { - //code -} -method.helper = function () { - //code -} -return method; -``` - -For examples, see the examples directory. The CommonJS module format is also supported by passing true as the second argument to methods. - -## API - -options: - - - `commonJS` (default: `false`) - If commonJS is `true` then it will accept CommonJS source instead of source code which `return`s the module. - -### umd(name, source, [options]) - - The `name` should the the name of the module. Use a string like name, all lower case with hyphens instead of spaces. - - If `source` should be a string, that is wrapped in umd and returned as a string. - -### umd.prelude(module, [options]) - - return the text which will be inserted before a module. - -### umd.postlude(module, [options]) - - return the text which will be inserted after a module. - -## Command Line - -``` -Usage: umd [options] - -Pipe Usage: umd [options] < source > destination - -Options: - - -h --help Display usage information - -c --commonJS Use CommonJS module format - ``` - - You can easilly pipe unix commands together like: - - ```js - cat my-module.js | umd my-module | uglify-js > my-module.umd.min.js - ``` - -## Name Casing and Characters - -The `name` passed to `umd` will be converted to camel case (`my-library` becomes `myLibrary`) and may only contain: - -* alphanumeric characters -* $ -* _ - -The name may not begin with a number. Invalid characters will be stripped. - -## License - - MIT diff --git a/node_modules/umd/bin/cli.js b/node_modules/umd/bin/cli.js deleted file mode 100755 index 3a2287a6d..000000000 --- a/node_modules/umd/bin/cli.js +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env node - -var read = require('fs').createReadStream -var write = require('fs').createWriteStream - -var umd = require('../') - -var args = process.argv.slice(2) - -var help = false -var commonJS = false -args = args.filter(function (arg) { - if (arg === '-h' || arg === '--help') { - help = true - return false - } else if (arg === '-c' || arg === '--commonJS') { - commonJS = true - return false - } - return true -}) - -if (help || !args[0]) { - console.log('Usage: umd [options]') - console.log('') - console.log('Pipe Usage: umd [options] < source > destination') - console.log('') - console.log('Options:') - console.log('') - console.log(' -h --help Display usage information') - console.log(' -c --commonJS Use CommonJS module format') - console.log('') - if (!help) process.exit(1) -} else { - var source = args[1] ? read(args[1]) : process.stdin - var dest = args[2] ? write(args[2]) : process.stdout - var prelude = umd.prelude(args[0], {commonJS: commonJS}) - var postlude = umd.postlude(args[0], {commonJS: commonJS}) - dest.write(prelude) - source.on('end', function () { - dest.write(postlude + '\n') - }).pipe(dest, {end: false}) -} diff --git a/node_modules/umd/index.js b/node_modules/umd/index.js deleted file mode 100644 index bc32794f2..000000000 --- a/node_modules/umd/index.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - - -var templateSTR = "(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}defineNamespace()}})(function(){source()});\n"; - -function template(moduleName, options) { - if (typeof options === 'boolean') { - options = {commonJS: options}; - } else if (!options) { - options = {}; - } - var str = templateSTR.replace(/defineNamespace\(\)/g, compileNamespace(moduleName)) - .split('source()') - str[0] = str[0].trim(); - //make sure these are undefined so as to not get confused if modules have inner UMD systems - str[0] += 'var define,module,exports;'; - if (options.commonJS) str[0] += 'module={exports:(exports={})};'; - str[0] += '\n'; - if (options.commonJS) str[1] = 'return module.exports;' + str[1]; - str[1] = '\n' + str[1]; - return str; -} - -exports = module.exports = function (name, src, options) { - if (typeof options === 'string' && typeof src === 'object') { - var tmp = options; - options = src; - src = tmp; - } - return exports.prelude(name, options) + src + exports.postlude(name, options); -}; - -exports.prelude = function (moduleName, options) { - return template(moduleName, options)[0]; -}; -exports.postlude = function (moduleName, options) { - return template(moduleName, options)[1]; -}; - - -function camelCase(name) { - name = name.replace(/\-([a-z])/g, function (_, char) { return char.toUpperCase(); }); - if (!/^[a-zA-Z_$]$/.test(name[0])) { - name = name.substr(1); - } - var result = name.replace(/[^\w$]+/g, '') - if (!result) { - throw new Error('Invalid JavaScript identifier resulted from camel-casing'); - } - return result -} - - -function compileNamespace(name) { - var names = name.split('.') - - // No namespaces, yield the best case 'global.NAME = VALUE' - if (names.length === 1) { - return 'g.' + camelCase(name) + ' = f()'; - - // Acceptable case, with reasonable compilation - } else if (names.length === 2) { - names = names.map(camelCase); - return '(g.' + names[0] + ' || (g.' + names[0] + ' = {})).' + names[1] + ' = f()'; - - // Worst case, too many namespaces to care about - } else { - var valueContainer = names.pop() - return names.map(compileNamespaceStep) - .concat(['g.' + camelCase(valueContainer) + ' = f()']) - .join(';'); - } -} - -function compileNamespaceStep(name) { - name = camelCase(name); - return 'g=(g.' + name + '||(g.' + name + ' = {}))'; -} diff --git a/node_modules/umd/package.json b/node_modules/umd/package.json deleted file mode 100644 index 0f21d798a..000000000 --- a/node_modules/umd/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "_from": "umd@^3.0.0", - "_id": "umd@3.0.3", - "_inBundle": false, - "_integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==", - "_location": "/umd", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "umd@^3.0.0", - "name": "umd", - "escapedName": "umd", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/browser-pack" - ], - "_resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz", - "_shasum": "aa9fe653c42b9097678489c01000acb69f0b26cf", - "_spec": "umd@^3.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browser-pack", - "author": { - "name": "ForbesLindesay" - }, - "bin": { - "umd": "./bin/cli.js" - }, - "bugs": { - "url": "https://github.com/ForbesLindesay/umd/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Universal Module Definition for use in automated build systems", - "devDependencies": { - "brfs": "^1.3.0", - "linify": "^1.0.1", - "mocha": "*", - "uglify-js": "^3.3.15" - }, - "files": [ - "index.js", - "bin/cli.js" - ], - "homepage": "https://github.com/ForbesLindesay/umd#readme", - "license": "MIT", - "name": "umd", - "repository": { - "type": "git", - "url": "git+https://github.com/ForbesLindesay/umd.git" - }, - "scripts": { - "build": "uglifyjs template.js > template.min.js && brfs source.js > index.js", - "prepublish": "npm run build && linify transform bin", - "test": "npm run build && mocha -R spec" - }, - "version": "3.0.3" -} diff --git a/node_modules/undeclared-identifiers/.travis.yml b/node_modules/undeclared-identifiers/.travis.yml deleted file mode 100644 index 9b333bf88..000000000 --- a/node_modules/undeclared-identifiers/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: node_js -node_js: - - stable - - 8 - - 6 - - 4 -cache: - directories: - - ~/.npm diff --git a/node_modules/undeclared-identifiers/CHANGELOG.md b/node_modules/undeclared-identifiers/CHANGELOG.md deleted file mode 100644 index ed3e30029..000000000 --- a/node_modules/undeclared-identifiers/CHANGELOG.md +++ /dev/null @@ -1,19 +0,0 @@ -# undeclared-identifiers change log - -All notable changes to this project will be documented in this file. - -This project adheres to [Semantic Versioning](http://semver.org/). - -## 1.1.2 -* Fix wildcard use not being detected after property use. ([349d998](https://github.com/goto-bus-stop/undeclared-identifiers/commit/349d998559f83976ccd3b3d091e2b06f00ce4189)) - -## 1.1.1 -* Fix standard property access being detected as wildcards. ([029a0b7](https://github.com/goto-bus-stop/undeclared-identifiers/commit/029a0b773a7a4d2402a6de19c8c8693407f8da63)) - -## 1.1.0 -* Accept an AST. ([1605b88](https://github.com/goto-bus-stop/undeclared-identifiers/commit/1605b881cd567894fab1ee2727961dd715a38820)) -* Add `opts.wildcard`. ([cdabd70](https://github.com/goto-bus-stop/undeclared-identifiers/commit/cdabd70e000b2fa976c7f4118757736e023b93f2)) - -## 1.0.0 - -* initial release. diff --git a/node_modules/undeclared-identifiers/LICENSE.md b/node_modules/undeclared-identifiers/LICENSE.md deleted file mode 100644 index 22b9972a8..000000000 --- a/node_modules/undeclared-identifiers/LICENSE.md +++ /dev/null @@ -1,15 +0,0 @@ -# [Apache License 2.0](https://spdx.org/licenses/Apache-2.0) - -Copyright 2018 Renée Kooi - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -> http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/node_modules/undeclared-identifiers/README.md b/node_modules/undeclared-identifiers/README.md deleted file mode 100644 index 8afc3d997..000000000 --- a/node_modules/undeclared-identifiers/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# undeclared-identifiers - -find undeclared identifiers and property accesses in a javascript file. - -[![npm][npm-image]][npm-url] -[![travis][travis-image]][travis-url] -[![standard][standard-image]][standard-url] - -[npm-image]: https://img.shields.io/npm/v/undeclared-identifiers.svg?style=flat-square -[npm-url]: https://www.npmjs.com/package/undeclared-identifiers -[travis-image]: https://img.shields.io/travis/goto-bus-stop/undeclared-identifiers.svg?style=flat-square -[travis-url]: https://travis-ci.org/goto-bus-stop/undeclared-identifiers -[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square -[standard-url]: http://npm.im/standard - -## Install - -``` -npm install undeclared-identifiers -``` - -## Usage - -```js -var undeclaredIdentifiers = require('undeclared-identifiers') - -undeclaredIdentifiers(src) -// { identifiers: ['Buffer'], -// properties: ['Buffer.isBuffer'] } -``` - -## API - -### `res = undeclaredIdentifiers(source, opts)` - -Find undeclared identifiers and properties that are used in the `source`. `source` can be an AST or a source string that will be parsed using [acorn-node](https://github.com/browserify/acorn-node). - -`res` is an object with properties: - - - `res.identifiers` - an array of variable names as strings. - - `res.properties` - an array of property names as .-separated strings, such as `'xyz.abc'`. These are the property accesses on the undeclared variables found in `res.identifiers`. - -Set `opts.properties` to false to only return identifiers. - -When `opts.wildcard` is true, unknown uses of undeclared identifiers will be added to `res.properties` as `'VarName.*'`. - -```js -undeclaredIdentifiers('Buffer(), Buffer.from()', { wildcard: true }) -// { identifiers: ['Buffer'], -// properties: ['Buffer.*', 'Buffer.from'] } -``` - -## License - -[Apache-2.0](LICENSE.md) diff --git a/node_modules/undeclared-identifiers/bench/index.js b/node_modules/undeclared-identifiers/bench/index.js deleted file mode 100644 index e20d65107..000000000 --- a/node_modules/undeclared-identifiers/bench/index.js +++ /dev/null @@ -1,44 +0,0 @@ -/* eslint-disable no-unused-expressions */ -var bench = require('nanobench') -var acornsrc = require('fs').readFileSync(require.resolve('acorn')) -var lodashsrc = require('fs').readFileSync(require.resolve('lodash')) -var jquerysrc = require('fs').readFileSync(require.resolve('jquery')) -var find = require('../') - -// Optimize. -for (var i = 0; i < 5; i++) find(acornsrc).properties - -// Has very few undeclared identifiers -bench('acorn × 1', function (b) { - b.start() - find(acornsrc).properties - b.end() -}) -bench('acorn × 5', function (b) { - b.start() - for (var i = 0; i < 5; i++) find(acornsrc).properties - b.end() -}) - -bench('lodash × 1', function (b) { - b.start() - find(lodashsrc).properties - b.end() -}) -bench('lodash × 5', function (b) { - b.start() - for (var i = 0; i < 5; i++) find(lodashsrc).properties - b.end() -}) - -// Has more undeclared identifiers and properties -bench('jquery × 1', function (b) { - b.start() - find(jquerysrc).properties - b.end() -}) -bench('jquery × 5', function (b) { - b.start() - for (var i = 0; i < 5; i++) find(jquerysrc).properties - b.end() -}) diff --git a/node_modules/undeclared-identifiers/bin.js b/node_modules/undeclared-identifiers/bin.js deleted file mode 100755 index 936e11edb..000000000 --- a/node_modules/undeclared-identifiers/bin.js +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env node - -var concat = require('simple-concat') -var undeclared = require('./') - -if (arg('--help') || arg('-h')) { - console.log('usage: undeclared-identifiers [--identifiers] [--properties] < source.js') - process.exit(0) -} - -concat(process.stdin, function (err, src) { - if (err) throw err - - var r = undeclared(src) - var i = arg('--identifiers') || arg('-i') - var p = arg('--properties') || arg('-p') - - if (!i && !p) i = p = true - - if (i) r.identifiers.forEach(log) - if (p) r.properties.forEach(log) -}) - -function arg (s) { - return process.argv.indexOf(s) !== -1 -} -function log (n) { - console.log(n) -} diff --git a/node_modules/undeclared-identifiers/index.js b/node_modules/undeclared-identifiers/index.js deleted file mode 100644 index c331176c5..000000000 --- a/node_modules/undeclared-identifiers/index.js +++ /dev/null @@ -1,127 +0,0 @@ -var xtend = require('xtend') -var acorn = require('acorn-node') -var walk = require('acorn-node/walk') -var getAssignedIdentifiers = require('get-assigned-identifiers') - -function visitFunction (node, state, ancestors) { - if (node.params.length > 0) { - var idents = [] - for (var i = 0; i < node.params.length; i++) { - var sub = getAssignedIdentifiers(node.params[i]) - for (var j = 0; j < sub.length; j++) idents.push(sub[j]) - } - declareNames(node, idents) - } - if (node.type === 'FunctionDeclaration') { - var parent = getScopeNode(ancestors, 'const') - declareNames(parent, [node.id]) - } else if (node.type === 'FunctionExpression' && node.id) { - declareNames(node, [node.id]) - } -} - -var scopeVisitor = { - VariableDeclaration: function (node, state, ancestors) { - var parent = getScopeNode(ancestors, node.kind) - for (var i = 0; i < node.declarations.length; i++) { - declareNames(parent, getAssignedIdentifiers(node.declarations[i].id)) - } - }, - FunctionExpression: visitFunction, - FunctionDeclaration: visitFunction, - ArrowFunctionExpression: visitFunction, - ImportDeclaration: function (node, state, ancestors) { - declareNames(ancestors[0] /* root */, getAssignedIdentifiers(node)) - }, - CatchClause: function (node) { - if (node.param) declareNames(node, [node.param]) - } -} - -var bindingVisitor = { - Identifier: function (node, state, ancestors) { - if (!state.identifiers) return - var parent = ancestors[ancestors.length - 2] - if (parent.type === 'MemberExpression' && parent.property === node) return - if (!has(state.undeclared, node.name)) { - for (var i = ancestors.length - 1; i >= 0; i--) { - if (ancestors[i]._names !== undefined && ancestors[i]._names.indexOf(node.name) !== -1) { - return - } - } - - state.undeclared[node.name] = true - } - - if (state.wildcard && - !(parent.type === 'MemberExpression' && parent.object === node) && - !(parent.type === 'VariableDeclarator' && parent.id === node) && - !(parent.type === 'AssignmentExpression' && parent.left === node)) { - state.undeclaredProps[node.name + '.*'] = true - } - }, - MemberExpression: function (node, state, ancestors) { - if (!state.properties) return - if (node.object.type === 'Identifier' && has(state.undeclared, node.object.name)) { - var prop = !node.computed && node.property.type === 'Identifier' - ? node.property.name - : node.computed && node.property.type === 'Literal' - ? node.property.value - : null - if (prop) state.undeclaredProps[node.object.name + '.' + prop] = true - } - } -} - -module.exports = function findUndeclared (src, opts) { - opts = xtend({ - identifiers: true, - properties: true, - wildcard: false - }, opts) - - var state = { - undeclared: {}, - undeclaredProps: {}, - identifiers: opts.identifiers, - properties: opts.properties, - wildcard: opts.wildcard - } - - // Parse if `src` is not already an AST. - var ast = typeof src === 'object' && src !== null && typeof src.type === 'string' - ? src - : acorn.parse(src) - - walk.ancestor(ast, scopeVisitor) - walk.ancestor(ast, bindingVisitor, walk.base, state) - - return { - identifiers: Object.keys(state.undeclared), - properties: Object.keys(state.undeclaredProps) - } -} - -function getScopeNode (parents, kind) { - for (var i = parents.length - 2; i >= 0; i--) { - if (parents[i].type === 'FunctionDeclaration' || parents[i].type === 'FunctionExpression' || - parents[i].type === 'ArrowFunctionExpression' || parents[i].type === 'Program') { - return parents[i] - } - if (kind !== 'var' && parents[i].type === 'BlockStatement') { - return parents[i] - } - } -} - -function declareNames (node, names) { - if (node._names === undefined) { - node._names = names.map(function (id) { return id.name }) - return - } - for (var i = 0; i < names.length; i++) { - node._names.push(names[i].name) - } -} - -function has (obj, name) { return Object.prototype.hasOwnProperty.call(obj, name) } diff --git a/node_modules/undeclared-identifiers/package.json b/node_modules/undeclared-identifiers/package.json deleted file mode 100644 index 82412e633..000000000 --- a/node_modules/undeclared-identifiers/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "_from": "undeclared-identifiers@^1.1.2", - "_id": "undeclared-identifiers@1.1.2", - "_inBundle": false, - "_integrity": "sha512-13EaeocO4edF/3JKime9rD7oB6QI8llAGhgn5fKOPyfkJbRb6NFv9pYV6dFEmpa4uRjKeBqLZP8GpuzqHlKDMQ==", - "_location": "/undeclared-identifiers", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "undeclared-identifiers@^1.1.2", - "name": "undeclared-identifiers", - "escapedName": "undeclared-identifiers", - "rawSpec": "^1.1.2", - "saveSpec": null, - "fetchSpec": "^1.1.2" - }, - "_requiredBy": [ - "/insert-module-globals" - ], - "_resolved": "https://registry.npmjs.org/undeclared-identifiers/-/undeclared-identifiers-1.1.2.tgz", - "_shasum": "7d850a98887cff4bd0bf64999c014d08ed6d1acc", - "_spec": "undeclared-identifiers@^1.1.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/insert-module-globals", - "author": { - "name": "Renée Kooi", - "email": "renee@kooi.me" - }, - "bin": { - "undeclared-identifiers": "bin.js" - }, - "bugs": { - "url": "https://github.com/goto-bus-stop/undeclared-identifiers/issues" - }, - "bundleDependencies": false, - "dependencies": { - "acorn-node": "^1.3.0", - "get-assigned-identifiers": "^1.2.0", - "simple-concat": "^1.0.0", - "xtend": "^4.0.1" - }, - "deprecated": false, - "description": "find undeclared identifiers and property accesses in a javascript file.", - "devDependencies": { - "jquery": "^3.3.1", - "lodash": "^4.17.5", - "nanobench": "^2.1.0", - "standard": "^11.0.0", - "tap-spec": "^4.0.2", - "tape": "^4.0.0" - }, - "homepage": "https://github.com/goto-bus-stop/undeclared-identifiers", - "keywords": [ - "ast", - "check", - "detect", - "identifiers", - "javascript", - "undeclared" - ], - "license": "Apache-2.0", - "main": "index.js", - "name": "undeclared-identifiers", - "repository": { - "type": "git", - "url": "git+https://github.com/goto-bus-stop/undeclared-identifiers.git" - }, - "scripts": { - "test": "standard && tape test/*.js | tap-spec" - }, - "version": "1.1.2" -} diff --git a/node_modules/undeclared-identifiers/test/index.js b/node_modules/undeclared-identifiers/test/index.js deleted file mode 100644 index 5ac045806..000000000 --- a/node_modules/undeclared-identifiers/test/index.js +++ /dev/null @@ -1,198 +0,0 @@ -var test = require('tape') -var acorn = require('acorn-node') -var find = require('../') - -test('undeclared variables', function (t) { - t.deepEqual(find(` - var a, b - a, b, c - `), { - identifiers: ['c'], - properties: [] - }) - t.end() -}) - -test('pass in a parsed ast', function (t) { - t.deepEqual(find(acorn.parse(` - var a, b - a, b, c - `)), { - identifiers: ['c'], - properties: [] - }) - t.end() -}) - -test('undeclared properties', function (t) { - t.deepEqual(find(` - var a, b - a, b, c, d.e - `), { - identifiers: ['c', 'd'], - properties: ['d.e'] - }) - t.end() -}) - -test('wildcard use of undeclared name', function (t) { - t.deepEqual(find(` - function func () {} - new A() - A.from() - func(b) - C.from() - `, { wildcard: true }), { - identifiers: ['A', 'b', 'C'], - properties: ['A.*', 'A.from', 'b.*', 'C.from'] - }) - t.end() -}) - -test('wildcard use of undeclared name (different order)', function (t) { - t.deepEqual(find(` - A.from() - new A() - `, { wildcard: true }), { - identifiers: ['A'], - properties: ['A.from', 'A.*'] - }) - t.end() -}) - -test('function names', function (t) { - t.deepEqual(find(` - function x () { - return x - } - x() - `), { - identifiers: [], - properties: [] - }) - t.deepEqual(find(` - function x () { - return x - } - y() - `), { - identifiers: ['y'], - properties: [] - }) - t.end() -}) - -test('scope', function (t) { - t.deepEqual(find(` - function y () { - function x () { - return x - } - } - x(y(x.y)) - `), { - identifiers: ['x'], - properties: ['x.y'] - }) - t.end() -}) - -test('block scope', function (t) { - t.deepEqual(find(` - var x - { var y; let z } - x, y, z - `), { - identifiers: ['z'], - properties: [] - }) - t.end() -}) - -test('function parameters', function (t) { - t.deepEqual(find(` - function a (a1, a2) { a, a1, a2, a3 } - ;(function b (b1, b2) { b, b1, b2, b3 }) - ;((c1, c2) => { c1, c2, c3 }) - `), { - identifiers: ['a3', 'b3', 'c3'], - properties: [] - }) - t.deepEqual(find(` - function a (a1, a2) { } - a, a1, a2 - `), { - identifiers: ['a1', 'a2'], - properties: [] - }) - t.end() -}) - -test('assignment', function (t) { - t.deepEqual(find(` - var a - b = 2 - b.c = 3 - `), { - identifiers: ['b'], - properties: ['b.c'] - }) - t.end() -}) - -test('catch', function (t) { - t.deepEqual(find(` - try { var a } catch (err) { err } - try { let b } catch (orr) { orr } - a, b - `), { - identifiers: ['b'], - properties: [] - }) - t.end() -}) - -test('object prototype names', function (t) { - t.deepEqual(find(` - var propertyIsEnumerable, hasOwnProperty - isPrototypeOf - `), { - identifiers: ['isPrototypeOf'], - properties: [] - }) - t.end() -}) - -test('labels', function (t) { - t.deepEqual(find(` - a: a; - b: a; - c: a; - `), { - identifiers: ['a'], - properties: [] - }) - t.end() -}) - -test('property keys', function (t) { - t.deepEqual(find(` - ({ a: a, - b: a, [d]: a, - c: a, }) - `), { - identifiers: ['a', 'd'], - properties: [] - }) - t.end() -}) - -test('string property access', function (t) { - t.deepEqual(find(` - Buffer["isBuffer"] - `), { - identifiers: ['Buffer'], - properties: ['Buffer.isBuffer'] - }) - t.end() -}) diff --git a/node_modules/union-value/LICENSE b/node_modules/union-value/LICENSE deleted file mode 100644 index 83b56e709..000000000 --- a/node_modules/union-value/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/union-value/README.md b/node_modules/union-value/README.md deleted file mode 100644 index 1a90ffbd5..000000000 --- a/node_modules/union-value/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# union-value [![NPM version](https://img.shields.io/npm/v/union-value.svg?style=flat)](https://www.npmjs.com/package/union-value) [![NPM monthly downloads](https://img.shields.io/npm/dm/union-value.svg?style=flat)](https://npmjs.org/package/union-value) [![NPM total downloads](https://img.shields.io/npm/dt/union-value.svg?style=flat)](https://npmjs.org/package/union-value) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/union-value.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/union-value) - -> Set an array of unique values as the property of an object. Supports setting deeply nested properties using using object-paths/dot notation. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save union-value -``` - -## Usage - -```js -var union = require('union-value'); - -var obj = {}; - -union(obj, 'a.b.c', ['one', 'two']); -union(obj, 'a.b.c', ['three']); - -console.log(obj); -//=> {a: {b: {c: [ 'one', 'two', 'three' ] }}} -``` - -## About - -### Related projects - -* [assign-value](https://www.npmjs.com/package/assign-value): Assign a value or extend a deeply nested property of an object using object path… [more](https://github.com/jonschlinkert/assign-value) | [homepage](https://github.com/jonschlinkert/assign-value "Assign a value or extend a deeply nested property of an object using object path notation.") -* [get-value](https://www.npmjs.com/package/get-value): Use property paths (`a.b.c`) to get a nested value from an object. | [homepage](https://github.com/jonschlinkert/get-value "Use property paths (`a.b.c`) to get a nested value from an object.") -* [has-value](https://www.npmjs.com/package/has-value): Returns true if a value exists, false if empty. Works with deeply nested values using… [more](https://github.com/jonschlinkert/has-value) | [homepage](https://github.com/jonschlinkert/has-value "Returns true if a value exists, false if empty. Works with deeply nested values using object paths.") -* [set-value](https://www.npmjs.com/package/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/jonschlinkert/set-value "Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths.") -* [unset-value](https://www.npmjs.com/package/unset-value): Delete nested properties from an object using dot notation. | [homepage](https://github.com/jonschlinkert/unset-value "Delete nested properties from an object using dot notation.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 25, 2017._ \ No newline at end of file diff --git a/node_modules/union-value/index.js b/node_modules/union-value/index.js deleted file mode 100644 index 9c5d8db2c..000000000 --- a/node_modules/union-value/index.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -var isObject = require('is-extendable'); -var union = require('arr-union'); -var get = require('get-value'); -var set = require('set-value'); - -module.exports = function unionValue(obj, prop, value) { - if (!isObject(obj)) { - throw new TypeError('union-value expects the first argument to be an object.'); - } - - if (typeof prop !== 'string') { - throw new TypeError('union-value expects `prop` to be a string.'); - } - - var arr = arrayify(get(obj, prop)); - set(obj, prop, union(arr, arrayify(value))); - return obj; -}; - -function arrayify(val) { - if (val === null || typeof val === 'undefined') { - return []; - } - if (Array.isArray(val)) { - return val; - } - return [val]; -} diff --git a/node_modules/union-value/node_modules/extend-shallow/LICENSE b/node_modules/union-value/node_modules/extend-shallow/LICENSE deleted file mode 100644 index fa30c4cb3..000000000 --- a/node_modules/union-value/node_modules/extend-shallow/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2015, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/union-value/node_modules/extend-shallow/README.md b/node_modules/union-value/node_modules/extend-shallow/README.md deleted file mode 100644 index cdc45d4ff..000000000 --- a/node_modules/union-value/node_modules/extend-shallow/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# extend-shallow [![NPM version](https://badge.fury.io/js/extend-shallow.svg)](http://badge.fury.io/js/extend-shallow) [![Build Status](https://travis-ci.org/jonschlinkert/extend-shallow.svg)](https://travis-ci.org/jonschlinkert/extend-shallow) - -> Extend an object with the properties of additional objects. node.js/javascript util. - -## Install - -Install with [npm](https://www.npmjs.com/) - -```sh -$ npm i extend-shallow --save -``` - -## Usage - -```js -var extend = require('extend-shallow'); - -extend({a: 'b'}, {c: 'd'}) -//=> {a: 'b', c: 'd'} -``` - -Pass an empty object to shallow clone: - -```js -var obj = {}; -extend(obj, {a: 'b'}, {c: 'd'}) -//=> {a: 'b', c: 'd'} -``` - -## Related - -* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. -* [for-own](https://github.com/jonschlinkert/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) -* [for-in](https://github.com/jonschlinkert/for-in): Iterate over the own and inherited enumerable properties of an objecte, and return an object… [more](https://github.com/jonschlinkert/for-in) -* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor. -* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null. -* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value. - -## Running tests - -Install dev dependencies: - -```sh -$ npm i -d && npm test -``` - -## Author - -**Jon Schlinkert** - -+ [github/jonschlinkert](https://github.com/jonschlinkert) -+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2015 Jon Schlinkert -Released under the MIT license. - -*** - -_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 29, 2015._ \ No newline at end of file diff --git a/node_modules/union-value/node_modules/extend-shallow/index.js b/node_modules/union-value/node_modules/extend-shallow/index.js deleted file mode 100644 index 92a067fcc..000000000 --- a/node_modules/union-value/node_modules/extend-shallow/index.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -var isObject = require('is-extendable'); - -module.exports = function extend(o/*, objects*/) { - if (!isObject(o)) { o = {}; } - - var len = arguments.length; - for (var i = 1; i < len; i++) { - var obj = arguments[i]; - - if (isObject(obj)) { - assign(o, obj); - } - } - return o; -}; - -function assign(a, b) { - for (var key in b) { - if (hasOwn(b, key)) { - a[key] = b[key]; - } - } -} - -/** - * Returns true if the given `key` is an own property of `obj`. - */ - -function hasOwn(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} diff --git a/node_modules/union-value/node_modules/extend-shallow/package.json b/node_modules/union-value/node_modules/extend-shallow/package.json deleted file mode 100644 index 3e26e21fa..000000000 --- a/node_modules/union-value/node_modules/extend-shallow/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_from": "extend-shallow@^2.0.1", - "_id": "extend-shallow@2.0.1", - "_inBundle": false, - "_integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "_location": "/union-value/extend-shallow", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "extend-shallow@^2.0.1", - "name": "extend-shallow", - "escapedName": "extend-shallow", - "rawSpec": "^2.0.1", - "saveSpec": null, - "fetchSpec": "^2.0.1" - }, - "_requiredBy": [ - "/union-value/set-value" - ], - "_resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "_shasum": "51af7d614ad9a9f610ea1bafbb989d6b1c56890f", - "_spec": "extend-shallow@^2.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/union-value/node_modules/set-value", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/extend-shallow/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "deprecated": false, - "description": "Extend an object with the properties of additional objects. node.js/javascript util.", - "devDependencies": { - "array-slice": "^0.2.3", - "benchmarked": "^0.1.4", - "chalk": "^1.0.0", - "for-own": "^0.1.3", - "glob": "^5.0.12", - "is-plain-object": "^2.0.1", - "kind-of": "^2.0.0", - "minimist": "^1.1.1", - "mocha": "^2.2.5", - "should": "^7.0.1" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/extend-shallow", - "keywords": [ - "assign", - "extend", - "javascript", - "js", - "keys", - "merge", - "obj", - "object", - "prop", - "properties", - "property", - "props", - "shallow", - "util", - "utility", - "utils", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "extend-shallow", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/extend-shallow.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "2.0.1" -} diff --git a/node_modules/union-value/node_modules/set-value/LICENSE b/node_modules/union-value/node_modules/set-value/LICENSE deleted file mode 100644 index d734237bd..000000000 --- a/node_modules/union-value/node_modules/set-value/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/union-value/node_modules/set-value/README.md b/node_modules/union-value/node_modules/set-value/README.md deleted file mode 100644 index 19fbdbb4d..000000000 --- a/node_modules/union-value/node_modules/set-value/README.md +++ /dev/null @@ -1,81 +0,0 @@ -# set-value [![NPM version](https://img.shields.io/npm/v/set-value.svg?style=flat)](https://www.npmjs.com/package/set-value) [![NPM monthly downloads](https://img.shields.io/npm/dm/set-value.svg?style=flat)](https://npmjs.org/package/set-value) [![NPM total downloads](https://img.shields.io/npm/dt/set-value.svg?style=flat)](https://npmjs.org/package/set-value) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/set-value.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/set-value) - -> Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save set-value -``` - -## Usage - -```js -var set = require('set-value'); - -var obj = {}; -set(obj, 'a.b.c', 'd'); -console.log(obj); -//=> {a: {b: c: 'd'}} -``` - -## About - -### Related projects - -* [assign-value](https://www.npmjs.com/package/assign-value): Assign a value or extend a deeply nested property of an object using object path… [more](https://github.com/jonschlinkert/assign-value) | [homepage](https://github.com/jonschlinkert/assign-value "Assign a value or extend a deeply nested property of an object using object path notation.") -* [get-value](https://www.npmjs.com/package/get-value): Use property paths (`a.b.c`) to get a nested value from an object. | [homepage](https://github.com/jonschlinkert/get-value "Use property paths (`a.b.c`) to get a nested value from an object.") -* [has-value](https://www.npmjs.com/package/has-value): Returns true if a value exists, false if empty. Works with deeply nested values using… [more](https://github.com/jonschlinkert/has-value) | [homepage](https://github.com/jonschlinkert/has-value "Returns true if a value exists, false if empty. Works with deeply nested values using object paths.") -* [merge-value](https://www.npmjs.com/package/merge-value): Similar to assign-value but deeply merges object values or nested values using object path/dot notation. | [homepage](https://github.com/jonschlinkert/merge-value "Similar to assign-value but deeply merges object values or nested values using object path/dot notation.") -* [omit-value](https://www.npmjs.com/package/omit-value): Omit properties from an object or deeply nested property of an object using object path… [more](https://github.com/jonschlinkert/omit-value) | [homepage](https://github.com/jonschlinkert/omit-value "Omit properties from an object or deeply nested property of an object using object path notation.") -* [set-value](https://www.npmjs.com/package/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/jonschlinkert/set-value "Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths.") -* [union-value](https://www.npmjs.com/package/union-value): Set an array of unique values as the property of an object. Supports setting deeply… [more](https://github.com/jonschlinkert/union-value) | [homepage](https://github.com/jonschlinkert/union-value "Set an array of unique values as the property of an object. Supports setting deeply nested properties using using object-paths/dot notation.") -* [unset-value](https://www.npmjs.com/package/unset-value): Delete nested properties from an object using dot notation. | [homepage](https://github.com/jonschlinkert/unset-value "Delete nested properties from an object using dot notation.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 53 | [jonschlinkert](https://github.com/jonschlinkert) | -| 1 | [vadimdemedes](https://github.com/vadimdemedes) | -| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 22, 2017._ \ No newline at end of file diff --git a/node_modules/union-value/node_modules/set-value/index.js b/node_modules/union-value/node_modules/set-value/index.js deleted file mode 100644 index e51ece557..000000000 --- a/node_modules/union-value/node_modules/set-value/index.js +++ /dev/null @@ -1,63 +0,0 @@ -/*! - * set-value - * - * Copyright (c) 2014-2015, 2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var toPath = require('to-object-path'); -var extend = require('extend-shallow'); -var isPlainObject = require('is-plain-object'); -var isObject = require('is-extendable'); - -module.exports = function(obj, path, val) { - if (!isObject(obj)) { - return obj; - } - - if (Array.isArray(path)) { - path = toPath(path); - } - - if (typeof path !== 'string') { - return obj; - } - - var segs = path.split('.'); - var len = segs.length, i = -1; - var res = obj; - var last; - - while (++i < len) { - var key = segs[i]; - - while (key[key.length - 1] === '\\') { - key = key.slice(0, -1) + '.' + segs[++i]; - } - - if (i === len - 1) { - last = key; - break; - } - - if (!isObject(obj[key])) { - obj[key] = {}; - } - obj = obj[key]; - } - - if (obj.hasOwnProperty(last) && isObject(obj[last])) { - if (isPlainObject(val)) { - extend(obj[last], val); - } else { - obj[last] = val; - } - - } else { - obj[last] = val; - } - return res; -}; - diff --git a/node_modules/union-value/node_modules/set-value/package.json b/node_modules/union-value/node_modules/set-value/package.json deleted file mode 100644 index abe11354e..000000000 --- a/node_modules/union-value/node_modules/set-value/package.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "_from": "set-value@^0.4.3", - "_id": "set-value@0.4.3", - "_inBundle": false, - "_integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "_location": "/union-value/set-value", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "set-value@^0.4.3", - "name": "set-value", - "escapedName": "set-value", - "rawSpec": "^0.4.3", - "saveSpec": null, - "fetchSpec": "^0.4.3" - }, - "_requiredBy": [ - "/union-value" - ], - "_resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "_shasum": "7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1", - "_spec": "set-value@^0.4.3", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/union-value", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/set-value/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "email": "wtgtybhertgeghgtwtg@gmail.com", - "url": "https://github.com/wtgtybhertgeghgtwtg" - }, - { - "name": "Jon Schlinkert", - "email": "jon.schlinkert@sellside.com", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Vadim Demedes", - "email": "vdemedes@gmail.com", - "url": "https://vadimdemedes.com" - } - ], - "dependencies": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - }, - "deprecated": false, - "description": "Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths.", - "devDependencies": { - "gulp-format-md": "^0.1.10", - "mocha": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/set-value", - "keywords": [ - "get", - "has", - "hasown", - "key", - "keys", - "nested", - "notation", - "object", - "prop", - "properties", - "property", - "props", - "set", - "value", - "values" - ], - "license": "MIT", - "main": "index.js", - "name": "set-value", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/set-value.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "assign-value", - "get-value", - "has-value", - "merge-value", - "omit-value", - "set-value", - "union-value", - "unset-value" - ] - }, - "lint": { - "reflinks": true - } - }, - "version": "0.4.3" -} diff --git a/node_modules/union-value/package.json b/node_modules/union-value/package.json deleted file mode 100644 index 29d155dd5..000000000 --- a/node_modules/union-value/package.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "_from": "union-value@^1.0.0", - "_id": "union-value@1.0.0", - "_inBundle": false, - "_integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", - "_location": "/union-value", - "_phantomChildren": { - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "to-object-path": "0.3.0" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "union-value@^1.0.0", - "name": "union-value", - "escapedName": "union-value", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/cache-base" - ], - "_resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "_shasum": "5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4", - "_spec": "union-value@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/cache-base", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/union-value/issues" - }, - "bundleDependencies": false, - "dependencies": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "deprecated": false, - "description": "Set an array of unique values as the property of an object. Supports setting deeply nested properties using using object-paths/dot notation.", - "devDependencies": { - "gulp-format-md": "^0.1.11", - "mocha": "^3.2.0", - "should": "^11.2.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/union-value", - "keywords": [ - "array", - "dot", - "get", - "has", - "nested", - "notation", - "object", - "path", - "prop", - "property", - "set", - "union", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "union-value", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/union-value.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "assign-value", - "get-value", - "has-value", - "set-value", - "unset-value" - ] - }, - "lint": { - "reflinks": true - } - }, - "version": "1.0.0" -} diff --git a/node_modules/unset-value/LICENSE b/node_modules/unset-value/LICENSE deleted file mode 100644 index ec85897eb..000000000 --- a/node_modules/unset-value/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015, 2017, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/unset-value/README.md b/node_modules/unset-value/README.md deleted file mode 100644 index f0fec3d3d..000000000 --- a/node_modules/unset-value/README.md +++ /dev/null @@ -1,131 +0,0 @@ -# unset-value [![NPM version](https://img.shields.io/npm/v/unset-value.svg?style=flat)](https://www.npmjs.com/package/unset-value) [![NPM monthly downloads](https://img.shields.io/npm/dm/unset-value.svg?style=flat)](https://npmjs.org/package/unset-value) [![NPM total downloads](https://img.shields.io/npm/dt/unset-value.svg?style=flat)](https://npmjs.org/package/unset-value) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/unset-value.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/unset-value) - -> Delete nested properties from an object using dot notation. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save unset-value -``` - -## Usage - -```js -var unset = require('unset-value'); - -var obj = {a: {b: {c: 'd', e: 'f'}}}; -unset(obj, 'a.b.c'); -console.log(obj); -//=> {a: {b: {e: 'f'}}}; -``` - -## Examples - -### Updates the object when a property is deleted - -```js -var obj = {a: 'b'}; -unset(obj, 'a'); -console.log(obj); -//=> {} -``` - -### Returns true when a property is deleted - -```js -unset({a: 'b'}, 'a') // true -``` - -### Returns `true` when a property does not exist - -This is consistent with `delete` behavior in that it does not -throw when a property does not exist. - -```js -unset({a: {b: {c: 'd'}}}, 'd') // true -``` - -### delete nested values - -```js -var one = {a: {b: {c: 'd'}}}; -unset(one, 'a.b'); -console.log(one); -//=> {a: {}} - -var two = {a: {b: {c: 'd'}}}; -unset(two, 'a.b.c'); -console.log(two); -//=> {a: {b: {}}} - -var three = {a: {b: {c: 'd', e: 'f'}}}; -unset(three, 'a.b.c'); -console.log(three); -//=> {a: {b: {e: 'f'}}} -``` - -### throws on invalid args - -```js -unset(); -// 'expected an object.' -``` - -## About - -### Related projects - -* [get-value](https://www.npmjs.com/package/get-value): Use property paths (`a.b.c`) to get a nested value from an object. | [homepage](https://github.com/jonschlinkert/get-value "Use property paths (`a.b.c`) to get a nested value from an object.") -* [get-values](https://www.npmjs.com/package/get-values): Return an array of all values from the given object. | [homepage](https://github.com/jonschlinkert/get-values "Return an array of all values from the given object.") -* [omit-value](https://www.npmjs.com/package/omit-value): Omit properties from an object or deeply nested property of an object using object path… [more](https://github.com/jonschlinkert/omit-value) | [homepage](https://github.com/jonschlinkert/omit-value "Omit properties from an object or deeply nested property of an object using object path notation.") -* [put-value](https://www.npmjs.com/package/put-value): Update only existing values from an object, works with dot notation paths like `a.b.c` and… [more](https://github.com/tunnckocore/put-value#readme) | [homepage](https://github.com/tunnckocore/put-value#readme "Update only existing values from an object, works with dot notation paths like `a.b.c` and support deep nesting.") -* [set-value](https://www.npmjs.com/package/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/jonschlinkert/set-value "Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths.") -* [union-value](https://www.npmjs.com/package/union-value): Set an array of unique values as the property of an object. Supports setting deeply… [more](https://github.com/jonschlinkert/union-value) | [homepage](https://github.com/jonschlinkert/union-value "Set an array of unique values as the property of an object. Supports setting deeply nested properties using using object-paths/dot notation.") -* [upsert-value](https://www.npmjs.com/package/upsert-value): Update or set nested values and any intermediaries with dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/doowb/upsert-value "Update or set nested values and any intermediaries with dot notation (`'a.b.c'`) paths.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 6 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 25, 2017._ \ No newline at end of file diff --git a/node_modules/unset-value/index.js b/node_modules/unset-value/index.js deleted file mode 100644 index a91901018..000000000 --- a/node_modules/unset-value/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/*! - * unset-value - * - * Copyright (c) 2015, 2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -var isObject = require('isobject'); -var has = require('has-value'); - -module.exports = function unset(obj, prop) { - if (!isObject(obj)) { - throw new TypeError('expected an object.'); - } - if (obj.hasOwnProperty(prop)) { - delete obj[prop]; - return true; - } - - if (has(obj, prop)) { - var segs = prop.split('.'); - var last = segs.pop(); - while (segs.length && segs[segs.length - 1].slice(-1) === '\\') { - last = segs.pop().slice(0, -1) + '.' + last; - } - while (segs.length) obj = obj[prop = segs.shift()]; - return (delete obj[last]); - } - return true; -}; diff --git a/node_modules/unset-value/node_modules/has-value/LICENSE b/node_modules/unset-value/node_modules/has-value/LICENSE deleted file mode 100644 index 39245ac1c..000000000 --- a/node_modules/unset-value/node_modules/has-value/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2016, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/unset-value/node_modules/has-value/README.md b/node_modules/unset-value/node_modules/has-value/README.md deleted file mode 100644 index a927633e5..000000000 --- a/node_modules/unset-value/node_modules/has-value/README.md +++ /dev/null @@ -1,130 +0,0 @@ -# has-value [![NPM version](https://img.shields.io/npm/v/has-value.svg?style=flat)](https://www.npmjs.com/package/has-value) [![NPM downloads](https://img.shields.io/npm/dm/has-value.svg?style=flat)](https://npmjs.org/package/has-value) [![Build Status](https://img.shields.io/travis/jonschlinkert/has-value.svg?style=flat)](https://travis-ci.org/jonschlinkert/has-value) - -> Returns true if a value exists, false if empty. Works with deeply nested values using object paths. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install has-value --save -``` - -**Works for:** - -* booleans -* functions -* numbers (pass `true` as the last arg to treat zero as a value instead of falsey) -* strings -* nulls -* object -* arrays - -## Usage - -Works with nested object paths or a single value: - -```js -var hasValue = require('has-value'); - -hasValue({a: {b: {c: 'foo'}}} 'a.b.c'); -//=> true - -hasValue('a'); -//=> true - -hasValue(''); -//=> false - -hasValue(1); -//=> true - -hasValue(0); -//=> false - -hasValue(0, true); // pass `true` as the last arg to treat zero as a value -//=> true - -hasValue({a: 'a'}}); -//=> true - -hasValue({}}); -//=> false - -hasValue(['a']); -//=> true - -hasValue([]); -//=> false - -hasValue(function(foo) {}); // function length/arity -//=> true - -hasValue(function() {}); -//=> false - -hasValue(true); -hasValue(false); -//=> true -``` - -## isEmpty - -To do the opposite and test for empty values, do: - -```js -function isEmpty(o, isZero) { - return !hasValue.apply(hasValue, arguments); -} -``` - -## Related projects - -You might also be interested in these projects: - -* [get-object](https://www.npmjs.com/package/get-object): Get a property from an object using dot (object path) notation. | [homepage](https://github.com/jonschlinkert/get-object) -* [get-property](https://www.npmjs.com/package/get-property): Get a nested property or its value from an object using simple `a.b.c` paths. | [homepage](https://github.com/jonschlinkert/get-property) -* [get-value](https://www.npmjs.com/package/get-value): Use property paths (`a.b.c`) to get a nested value from an object. | [homepage](https://github.com/jonschlinkert/get-value) -* [set-value](https://www.npmjs.com/package/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/jonschlinkert/set-value) - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/has-value/issues/new). - -## Building docs - -Generate readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install verb && npm run docs -``` - -Or, if [verb](https://github.com/verbose/verb) is installed globally: - -```sh -$ verb -``` - -## Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -## Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/has-value/blob/master/LICENSE). - -*** - -_This file was generated by [verb](https://github.com/verbose/verb), v, on March 27, 2016._ \ No newline at end of file diff --git a/node_modules/unset-value/node_modules/has-value/index.js b/node_modules/unset-value/node_modules/has-value/index.js deleted file mode 100644 index 90687c877..000000000 --- a/node_modules/unset-value/node_modules/has-value/index.js +++ /dev/null @@ -1,19 +0,0 @@ -/*! - * has-value - * - * Copyright (c) 2014-2016, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var isObject = require('isobject'); -var hasValues = require('has-values'); -var get = require('get-value'); - -module.exports = function(obj, prop, noZero) { - if (isObject(obj)) { - return hasValues(get(obj, prop), noZero); - } - return hasValues(obj, prop); -}; diff --git a/node_modules/unset-value/node_modules/has-value/node_modules/isobject/LICENSE b/node_modules/unset-value/node_modules/has-value/node_modules/isobject/LICENSE deleted file mode 100644 index 39245ac1c..000000000 --- a/node_modules/unset-value/node_modules/has-value/node_modules/isobject/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2016, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/unset-value/node_modules/has-value/node_modules/isobject/README.md b/node_modules/unset-value/node_modules/has-value/node_modules/isobject/README.md deleted file mode 100644 index 9dd897aa0..000000000 --- a/node_modules/unset-value/node_modules/has-value/node_modules/isobject/README.md +++ /dev/null @@ -1,112 +0,0 @@ -# isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat)](https://travis-ci.org/jonschlinkert/isobject) - -Returns true if the value is an object and not an array or null. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install isobject --save -``` - -Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install isobject -``` - -Install with [bower](http://bower.io/) - -```sh -$ bower install isobject -``` - -## Usage - -```js -var isObject = require('isobject'); -``` - -**True** - -All of the following return `true`: - -```js -isObject({}); -isObject(Object.create({})); -isObject(Object.create(Object.prototype)); -isObject(Object.create(null)); -isObject({}); -isObject(new Foo); -isObject(/foo/); -``` - -**False** - -All of the following return `false`: - -```js -isObject(); -isObject(function () {}); -isObject(1); -isObject([]); -isObject(undefined); -isObject(null); -``` - -## Related projects - -You might also be interested in these projects: - -[merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep) - -* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow) -* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object) -* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of) - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/isobject/issues/new). - -## Building docs - -Generate readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install verb && npm run docs -``` - -Or, if [verb](https://github.com/verbose/verb) is installed globally: - -```sh -$ verb -``` - -## Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -## Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/isobject/blob/master/LICENSE). - -*** - -_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on April 25, 2016._ \ No newline at end of file diff --git a/node_modules/unset-value/node_modules/has-value/node_modules/isobject/index.js b/node_modules/unset-value/node_modules/has-value/node_modules/isobject/index.js deleted file mode 100644 index aa0dce0bb..000000000 --- a/node_modules/unset-value/node_modules/has-value/node_modules/isobject/index.js +++ /dev/null @@ -1,14 +0,0 @@ -/*! - * isobject - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -var isArray = require('isarray'); - -module.exports = function isObject(val) { - return val != null && typeof val === 'object' && isArray(val) === false; -}; diff --git a/node_modules/unset-value/node_modules/has-value/node_modules/isobject/package.json b/node_modules/unset-value/node_modules/has-value/node_modules/isobject/package.json deleted file mode 100644 index c77ef6307..000000000 --- a/node_modules/unset-value/node_modules/has-value/node_modules/isobject/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "_from": "isobject@^2.0.0", - "_id": "isobject@2.1.0", - "_inBundle": false, - "_integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "_location": "/unset-value/has-value/isobject", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "isobject@^2.0.0", - "name": "isobject", - "escapedName": "isobject", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/unset-value/has-value" - ], - "_resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "_shasum": "f065561096a3f1da2ef46272f815c840d87e0c89", - "_spec": "isobject@^2.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/unset-value/node_modules/has-value", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/isobject/issues" - }, - "bundleDependencies": false, - "dependencies": { - "isarray": "1.0.0" - }, - "deprecated": false, - "description": "Returns true if the value is an object and not an array or null.", - "devDependencies": { - "gulp-format-md": "^0.1.9", - "mocha": "^2.4.5" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/isobject", - "keywords": [ - "check", - "is", - "is-object", - "isobject", - "kind", - "kind-of", - "kindof", - "native", - "object", - "type", - "typeof", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "isobject", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/isobject.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "merge-deep", - "extend-shallow", - "is-plain-object", - "kind-of" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "verb" - ] - }, - "version": "2.1.0" -} diff --git a/node_modules/unset-value/node_modules/has-value/package.json b/node_modules/unset-value/node_modules/has-value/package.json deleted file mode 100644 index 6e79133b6..000000000 --- a/node_modules/unset-value/node_modules/has-value/package.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "_from": "has-value@^0.3.1", - "_id": "has-value@0.3.1", - "_inBundle": false, - "_integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "_location": "/unset-value/has-value", - "_phantomChildren": { - "isarray": "1.0.0" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "has-value@^0.3.1", - "name": "has-value", - "escapedName": "has-value", - "rawSpec": "^0.3.1", - "saveSpec": null, - "fetchSpec": "^0.3.1" - }, - "_requiredBy": [ - "/unset-value" - ], - "_resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "_shasum": "7b1f58bada62ca827ec0a2078025654845995e1f", - "_spec": "has-value@^0.3.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/unset-value", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/has-value/issues" - }, - "bundleDependencies": false, - "dependencies": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "deprecated": false, - "description": "Returns true if a value exists, false if empty. Works with deeply nested values using object paths.", - "devDependencies": { - "gulp-format-md": "^0.1.7", - "mocha": "^2.4.5" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/has-value", - "keywords": [ - "array", - "boolean", - "empty", - "find", - "function", - "has", - "hasOwn", - "javascript", - "js", - "key", - "keys", - "node.js", - "null", - "number", - "object", - "properties", - "property", - "string", - "type", - "util", - "utilities", - "utility", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "has-value", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/has-value.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "run": true, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "get-object", - "get-property", - "get-value", - "set-value" - ] - }, - "reflinks": [ - "verb" - ], - "lint": { - "reflinks": true - } - }, - "version": "0.3.1" -} diff --git a/node_modules/unset-value/node_modules/has-values/LICENSE b/node_modules/unset-value/node_modules/has-values/LICENSE deleted file mode 100644 index 39245ac1c..000000000 --- a/node_modules/unset-value/node_modules/has-values/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2016, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/unset-value/node_modules/has-values/README.md b/node_modules/unset-value/node_modules/has-values/README.md deleted file mode 100644 index 13319c517..000000000 --- a/node_modules/unset-value/node_modules/has-values/README.md +++ /dev/null @@ -1,114 +0,0 @@ -# has-values [![NPM version](https://img.shields.io/npm/v/has-values.svg?style=flat)](https://www.npmjs.com/package/has-values) [![NPM downloads](https://img.shields.io/npm/dm/has-values.svg?style=flat)](https://npmjs.org/package/has-values) [![Build Status](https://img.shields.io/travis/jonschlinkert/has-values.svg?style=flat)](https://travis-ci.org/jonschlinkert/has-values) - -> Returns true if any values exist, false if empty. Works for booleans, functions, numbers, strings, nulls, objects and arrays. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install has-values --save -``` - -## Usage - -```js -var hasValue = require('has-values'); - -hasValue('a'); -//=> true - -hasValue(''); -//=> false - -hasValue(1); -//=> true - -hasValue(0); -//=> false - -hasValue(0, true); // treat zero as a value -//=> true - -hasValue({a: 'a'}}); -//=> true - -hasValue({}}); -//=> false - -hasValue(['a']); -//=> true - -hasValue([]); -//=> false - -hasValue(function(foo) {}); // function length/arity -//=> true - -hasValue(function() {}); -//=> false - -hasValue(true); -hasValue(false); -//=> true -``` - -## isEmpty - -To test for empty values, do: - -```js -function isEmpty(o, isZero) { - return !hasValue(o, isZero); -} -``` - -## Related projects - -You might also be interested in these projects: - -* [has-value](https://www.npmjs.com/package/has-value): Returns true if a value exists, false if empty. Works with deeply nested values using… [more](https://www.npmjs.com/package/has-value) | [homepage](https://github.com/jonschlinkert/has-value) -* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object) -* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject) - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/has-values/issues/new). - -## Building docs - -Generate readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install verb && npm run docs -``` - -Or, if [verb](https://github.com/verbose/verb) is installed globally: - -```sh -$ verb -``` - -## Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -## Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/has-values/blob/master/LICENSE). - -*** - -_This file was generated by [verb](https://github.com/verbose/verb), v, on March 27, 2016._ \ No newline at end of file diff --git a/node_modules/unset-value/node_modules/has-values/index.js b/node_modules/unset-value/node_modules/has-values/index.js deleted file mode 100644 index 6d04ba1fe..000000000 --- a/node_modules/unset-value/node_modules/has-values/index.js +++ /dev/null @@ -1,36 +0,0 @@ -/*! - * has-values - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -module.exports = function hasValue(o, noZero) { - if (o === null || o === undefined) { - return false; - } - - if (typeof o === 'boolean') { - return true; - } - - if (typeof o === 'number') { - if (o === 0 && noZero === true) { - return false; - } - return true; - } - - if (o.length !== undefined) { - return o.length !== 0; - } - - for (var key in o) { - if (o.hasOwnProperty(key)) { - return true; - } - } - return false; -}; diff --git a/node_modules/unset-value/node_modules/has-values/package.json b/node_modules/unset-value/node_modules/has-values/package.json deleted file mode 100644 index 6b042b863..000000000 --- a/node_modules/unset-value/node_modules/has-values/package.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "_from": "has-values@^0.1.4", - "_id": "has-values@0.1.4", - "_inBundle": false, - "_integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "_location": "/unset-value/has-values", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "has-values@^0.1.4", - "name": "has-values", - "escapedName": "has-values", - "rawSpec": "^0.1.4", - "saveSpec": null, - "fetchSpec": "^0.1.4" - }, - "_requiredBy": [ - "/unset-value/has-value" - ], - "_resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "_shasum": "6d61de95d91dfca9b9a02089ad384bff8f62b771", - "_spec": "has-values@^0.1.4", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/unset-value/node_modules/has-value", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/has-values/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Returns true if any values exist, false if empty. Works for booleans, functions, numbers, strings, nulls, objects and arrays. ", - "devDependencies": { - "gulp-format-md": "^0.1.7", - "mocha": "^2.4.5" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/has-values", - "keywords": [ - "array", - "boolean", - "empty", - "find", - "function", - "has", - "hasOwn", - "javascript", - "js", - "key", - "keys", - "node.js", - "null", - "number", - "object", - "properties", - "property", - "string", - "type", - "util", - "utilities", - "utility", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "has-values", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/has-values.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "run": true, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "has-value", - "isobject", - "is-plain-object" - ] - }, - "reflinks": [ - "verb" - ], - "lint": { - "reflinks": true - } - }, - "version": "0.1.4" -} diff --git a/node_modules/unset-value/node_modules/isobject/LICENSE b/node_modules/unset-value/node_modules/isobject/LICENSE deleted file mode 100644 index 943e71d05..000000000 --- a/node_modules/unset-value/node_modules/isobject/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert. - -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. \ No newline at end of file diff --git a/node_modules/unset-value/node_modules/isobject/README.md b/node_modules/unset-value/node_modules/isobject/README.md deleted file mode 100644 index d01feaa40..000000000 --- a/node_modules/unset-value/node_modules/isobject/README.md +++ /dev/null @@ -1,122 +0,0 @@ -# isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM monthly downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![NPM total downloads](https://img.shields.io/npm/dt/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/isobject) - -> Returns true if the value is an object and not an array or null. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save isobject -``` - -Install with [yarn](https://yarnpkg.com): - -```sh -$ yarn add isobject -``` - -Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install isobject -``` -Install with [bower](https://bower.io/) - -```sh -$ bower install isobject -``` - -## Usage - -```js -var isObject = require('isobject'); -``` - -**True** - -All of the following return `true`: - -```js -isObject({}); -isObject(Object.create({})); -isObject(Object.create(Object.prototype)); -isObject(Object.create(null)); -isObject({}); -isObject(new Foo); -isObject(/foo/); -``` - -**False** - -All of the following return `false`: - -```js -isObject(); -isObject(function () {}); -isObject(1); -isObject([]); -isObject(undefined); -isObject(null); -``` - -## About - -### Related projects - -* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") -* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") -* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") -* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 29 | [jonschlinkert](https://github.com/jonschlinkert) | -| 4 | [doowb](https://github.com/doowb) | -| 1 | [magnudae](https://github.com/magnudae) | -| 1 | [LeSuisse](https://github.com/LeSuisse) | -| 1 | [tmcw](https://github.com/tmcw) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 30, 2017._ \ No newline at end of file diff --git a/node_modules/unset-value/node_modules/isobject/index.d.ts b/node_modules/unset-value/node_modules/isobject/index.d.ts deleted file mode 100644 index 55f81c275..000000000 --- a/node_modules/unset-value/node_modules/isobject/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export = isObject; - -declare function isObject(val: any): boolean; - -declare namespace isObject {} diff --git a/node_modules/unset-value/node_modules/isobject/index.js b/node_modules/unset-value/node_modules/isobject/index.js deleted file mode 100644 index 2d59958bf..000000000 --- a/node_modules/unset-value/node_modules/isobject/index.js +++ /dev/null @@ -1,12 +0,0 @@ -/*! - * isobject - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -module.exports = function isObject(val) { - return val != null && typeof val === 'object' && Array.isArray(val) === false; -}; diff --git a/node_modules/unset-value/node_modules/isobject/package.json b/node_modules/unset-value/node_modules/isobject/package.json deleted file mode 100644 index 42ffe6182..000000000 --- a/node_modules/unset-value/node_modules/isobject/package.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "_from": "isobject@^3.0.0", - "_id": "isobject@3.0.1", - "_inBundle": false, - "_integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "_location": "/unset-value/isobject", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "isobject@^3.0.0", - "name": "isobject", - "escapedName": "isobject", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/unset-value" - ], - "_resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "_shasum": "4e431e92b11a9731636aa1f9c8d1ccbcfdab78df", - "_spec": "isobject@^3.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/unset-value", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/isobject/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "url": "https://github.com/LeSuisse" - }, - { - "name": "Brian Woodward", - "url": "https://twitter.com/doowb" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Magnús Dæhlen", - "url": "https://github.com/magnudae" - }, - { - "name": "Tom MacWright", - "url": "https://macwright.org" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "Returns true if the value is an object and not an array or null.", - "devDependencies": { - "gulp-format-md": "^0.1.9", - "mocha": "^2.4.5" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.d.ts", - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/isobject", - "keywords": [ - "check", - "is", - "is-object", - "isobject", - "kind", - "kind-of", - "kindof", - "native", - "object", - "type", - "typeof", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "isobject", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/isobject.git" - }, - "scripts": { - "test": "mocha" - }, - "types": "index.d.ts", - "verb": { - "related": { - "list": [ - "extend-shallow", - "is-plain-object", - "kind-of", - "merge-deep" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "verb" - ] - }, - "version": "3.0.1" -} diff --git a/node_modules/unset-value/package.json b/node_modules/unset-value/package.json deleted file mode 100644 index c50d4e94f..000000000 --- a/node_modules/unset-value/package.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "_from": "unset-value@^1.0.0", - "_id": "unset-value@1.0.0", - "_inBundle": false, - "_integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "_location": "/unset-value", - "_phantomChildren": { - "get-value": "2.0.6", - "isarray": "1.0.0" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "unset-value@^1.0.0", - "name": "unset-value", - "escapedName": "unset-value", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/cache-base" - ], - "_resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "_shasum": "8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559", - "_spec": "unset-value@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/cache-base", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/unset-value/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "email": "wtgtybhertgeghgtwtg@gmail.com", - "url": "https://github.com/wtgtybhertgeghgtwtg" - }, - { - "name": "Jon Schlinkert", - "email": "jon.schlinkert@sellside.com", - "url": "http://twitter.com/jonschlinkert" - } - ], - "dependencies": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "deprecated": false, - "description": "Delete nested properties from an object using dot notation.", - "devDependencies": { - "gulp-format-md": "^0.1.11", - "mocha": "*", - "should": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/unset-value", - "keywords": [ - "del", - "delete", - "key", - "object", - "omit", - "prop", - "property", - "remove", - "unset", - "value" - ], - "license": "MIT", - "main": "index.js", - "name": "unset-value", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/unset-value.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "related": { - "list": [ - "get-value", - "get-values", - "omit-value", - "put-value", - "set-value", - "union-value", - "upsert-value" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - } - }, - "version": "1.0.0" -} diff --git a/node_modules/urix/.jshintrc b/node_modules/urix/.jshintrc deleted file mode 100644 index 9d1a61836..000000000 --- a/node_modules/urix/.jshintrc +++ /dev/null @@ -1,42 +0,0 @@ -{ - "bitwise": true, - "camelcase": true, - "curly": false, - "eqeqeq": true, - "es3": false, - "forin": true, - "immed": false, - "indent": false, - "latedef": "nofunc", - "newcap": false, - "noarg": true, - "noempty": true, - "nonew": false, - "plusplus": false, - "quotmark": true, - "undef": true, - "unused": "vars", - "strict": false, - "trailing": true, - "maxparams": 5, - "maxdepth": false, - "maxstatements": false, - "maxcomplexity": false, - "maxlen": 100, - - "asi": true, - "expr": true, - "globalstrict": true, - "smarttabs": true, - "sub": true, - - "node": true, - "globals": { - "describe": false, - "it": false, - "before": false, - "beforeEach": false, - "after": false, - "afterEach": false - } -} diff --git a/node_modules/urix/LICENSE b/node_modules/urix/LICENSE deleted file mode 100644 index 0595be367..000000000 --- a/node_modules/urix/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Simon Lydell - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/urix/index.js b/node_modules/urix/index.js deleted file mode 100644 index dc6ef2700..000000000 --- a/node_modules/urix/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2014 Simon Lydell -// X11 (“MIT”) Licensed. (See LICENSE.) - -var path = require("path") - -"use strict" - -function urix(aPath) { - if (path.sep === "\\") { - return aPath - .replace(/\\/g, "/") - .replace(/^[a-z]:\/?/i, "/") - } - return aPath -} - -module.exports = urix diff --git a/node_modules/urix/package.json b/node_modules/urix/package.json deleted file mode 100644 index c94404228..000000000 --- a/node_modules/urix/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_from": "urix@^0.1.0", - "_id": "urix@0.1.0", - "_inBundle": false, - "_integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "_location": "/urix", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "urix@^0.1.0", - "name": "urix", - "escapedName": "urix", - "rawSpec": "^0.1.0", - "saveSpec": null, - "fetchSpec": "^0.1.0" - }, - "_requiredBy": [ - "/source-map-resolve" - ], - "_resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "_shasum": "da937f7a62e21fec1fd18d49b35c2935067a6c72", - "_spec": "urix@^0.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/source-map-resolve", - "author": { - "name": "Simon Lydell" - }, - "bugs": { - "url": "https://github.com/lydell/urix/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Makes Windows-style paths more unix and URI friendly.", - "devDependencies": { - "jshint": "^2.4.4", - "mocha": "^1.17.1" - }, - "homepage": "https://github.com/lydell/urix#readme", - "keywords": [ - "path", - "url", - "uri", - "unix", - "windows", - "backslash", - "slash" - ], - "license": "MIT", - "main": "index.js", - "name": "urix", - "repository": { - "type": "git", - "url": "git+https://github.com/lydell/urix.git" - }, - "scripts": { - "test": "jshint index.js test/ && mocha" - }, - "version": "0.1.0" -} diff --git a/node_modules/urix/readme.md b/node_modules/urix/readme.md deleted file mode 100644 index b258b9863..000000000 --- a/node_modules/urix/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -[![Build Status](https://travis-ci.org/lydell/urix.png?branch=master)](https://travis-ci.org/lydell/urix) - -Overview -======== - -Makes Windows-style paths more unix and URI friendly. Useful if you work with -paths that eventually will be used in URLs. - -```js -var urix = require("urix") - -// On Windows: -urix("c:\\users\\you\\foo") -// /users/you/foo - -// On unix-like systems: -urix("c:\\users\\you\\foo") -// c:\users\you\foo -``` - - -Installation -============ - -`npm install urix` - -```js -var urix = require("urix") -``` - - -Usage -===== - -### `urix(path)` ### - -On Windows, replaces all backslashes with slashes and uses a slash instead of a -drive letter and a colon for absolute paths. - -On unix-like systems it is a no-op. - - -License -======= - -[The X11 (“MIT”) License](LICENSE). diff --git a/node_modules/urix/test/index.js b/node_modules/urix/test/index.js deleted file mode 100644 index 5333f2463..000000000 --- a/node_modules/urix/test/index.js +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2014 Simon Lydell -// X11 (“MIT”) Licensed. (See LICENSE.) - -var path = require("path") -var assert = require("assert") -var urix = require("../") - -"use stict" - -function test(testPath, expected) { - path.sep = "\\" - assert.equal(urix(testPath), expected) - path.sep = "/" - assert.equal(urix(testPath), testPath) -} - -describe("urix", function() { - - it("is a function", function() { - assert.equal(typeof urix, "function") - }) - - - it("converts backslashes to slashes", function() { - test("a\\b\\c", "a/b/c") - test("\\a\\b\\c", "/a/b/c") - test("a/b\\c", "a/b/c") - test("\\\\a\\\\\\b///c", "//a///b///c") - }) - - - it("changes the drive letter to a slash", function() { - test("c:\\a", "/a") - test("C:\\a", "/a") - test("z:\\a", "/a") - test("c:a", "/a") - test("c:/a", "/a") - test("c:\\\\a", "//a") - test("c://a", "//a") - test("c:\\//a", "///a") - }) - -}) diff --git a/node_modules/url-trim/LICENSE.md b/node_modules/url-trim/LICENSE.md deleted file mode 100644 index 9b10ce2a8..000000000 --- a/node_modules/url-trim/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) -Copyright (c) 2015 Jam3 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE -OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/node_modules/url-trim/README.md b/node_modules/url-trim/README.md deleted file mode 100644 index 2c11115df..000000000 --- a/node_modules/url-trim/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# url-trim - -[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges) - -Trims query and hash parameters off of a URL. - -## Install - -```sh -npm install url-trim --save -``` - -## Example - -```js -var urlTrim = require('url-trim') - -urlTrim('http://localhost:9966/?foo=bar') -//=> 'http://localhost:9966/' - -urlTrim('/path/foo?blah#bar') -//=> '/path/foo' -``` - -## Usage - -[![NPM](https://nodei.co/npm/url-trim.png)](https://www.npmjs.com/package/url-trim) - -#### `trimmed = trim([url])` - -Trims the query string and hash parameters from a URL. - -If `url` is empty or not a string, this method returns an empty string. - -## License - -MIT, see [LICENSE.md](http://github.com/Jam3/url-trim/blob/master/LICENSE.md) for details. diff --git a/node_modules/url-trim/index.js b/node_modules/url-trim/index.js deleted file mode 100644 index 6b6dbb034..000000000 --- a/node_modules/url-trim/index.js +++ /dev/null @@ -1,13 +0,0 @@ -var urlLib = require('url') - -module.exports = stripUrl -function stripUrl (url) { - if (!url) return '' - var obj = urlLib.parse(url) - obj.search = '' - obj.hash = '' - obj.query = '' - obj.pathname = (obj.pathname || '').replace(/\/+$/, '/') - url = urlLib.format(obj) - return url || '/' -} diff --git a/node_modules/url-trim/package.json b/node_modules/url-trim/package.json deleted file mode 100644 index ad7c5a406..000000000 --- a/node_modules/url-trim/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_from": "url-trim@^1.0.0", - "_id": "url-trim@1.0.0", - "_inBundle": false, - "_integrity": "sha1-QAV+LxZLiOXaynJp2kfm0d2Detw=", - "_location": "/url-trim", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "url-trim@^1.0.0", - "name": "url-trim", - "escapedName": "url-trim", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/budo", - "/garnish" - ], - "_resolved": "https://registry.npmjs.org/url-trim/-/url-trim-1.0.0.tgz", - "_shasum": "40057e2f164b88e5daca7269da47e6d1dd837adc", - "_spec": "url-trim@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", - "author": { - "name": "Matt DesLauriers", - "email": "dave.des@gmail.com", - "url": "https://github.com/mattdesl" - }, - "bugs": { - "url": "https://github.com/Jam3/url-trim/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "trims query and hash parameters off a URL", - "devDependencies": { - "faucet": "0.0.1", - "standard": "^5.3.1", - "tape": "^4.2.0" - }, - "homepage": "https://github.com/Jam3/url-trim", - "keywords": [ - "url", - "trim", - "strip", - "path", - "name", - "pathname", - "param", - "params", - "query", - "hash", - "querystring", - "string", - "qs" - ], - "license": "MIT", - "main": "index.js", - "name": "url-trim", - "repository": { - "type": "git", - "url": "git://github.com/Jam3/url-trim.git" - }, - "scripts": { - "test": "node test.js | faucet" - }, - "version": "1.0.0" -} diff --git a/node_modules/url/.npmignore b/node_modules/url/.npmignore deleted file mode 100644 index ba114713b..000000000 --- a/node_modules/url/.npmignore +++ /dev/null @@ -1 +0,0 @@ -test-url.js diff --git a/node_modules/url/.travis.yml b/node_modules/url/.travis.yml deleted file mode 100644 index 16ed30155..000000000 --- a/node_modules/url/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -node_js: - - "0.10" -env: - global: - - secure: OgPRLCzHFh5WbjHEKlghHFW1oOreSF2JVUr3CMaFDi03ngTS2WONSw8mRn8SA6FTldiGGBx1n8orDzUw6cdkB7+tkU3G5B0M0V3vl823NaUFKgxsCM3UGDYfJb3yfAG5cj72rVZoX/ABd1fVuG4vBIlDLxsSlKQFMzUCFoyttr8= - - secure: AiZP8GHbyx83ZBhOvOxxtpNcgNHoP+vo5G1a1OYU78EHCgHg8NRyHKyCdrBnPvw6mV2BI/8frZaXAEicsHMtHMofBYn7nibNlaajBPI8AkHtYfNSc+zO+71Kwv7VOTOKKnkMEIkqhHlc6njFoH3QaBNHsgNlzzplPxaIt8vdUVk= diff --git a/node_modules/url/.zuul.yml b/node_modules/url/.zuul.yml deleted file mode 100644 index feea8b60d..000000000 --- a/node_modules/url/.zuul.yml +++ /dev/null @@ -1,16 +0,0 @@ -ui: mocha-tdd -browsers: - - name: chrome - version: latest - - name: firefox - version: 24..latest - - name: safari - version: latest - - name: ie - version: 9..latest - - name: iphone - version: oldest..latest - - name: ipad - version: oldest..latest - - name: android - version: oldest..latest diff --git a/node_modules/url/LICENSE b/node_modules/url/LICENSE deleted file mode 100644 index f45bc1186..000000000 --- a/node_modules/url/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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. diff --git a/node_modules/url/README.md b/node_modules/url/README.md deleted file mode 100644 index 8b3546028..000000000 --- a/node_modules/url/README.md +++ /dev/null @@ -1,108 +0,0 @@ -# node-url - -[![Build Status](https://travis-ci.org/defunctzombie/node-url.svg?branch=master)](https://travis-ci.org/defunctzombie/node-url) - -This module has utilities for URL resolution and parsing meant to have feature parity with node.js core [url](http://nodejs.org/api/url.html) module. - -```js -var url = require('url'); -``` - -## api - -Parsed URL objects have some or all of the following fields, depending on -whether or not they exist in the URL string. Any parts that are not in the URL -string will not be in the parsed object. Examples are shown for the URL - -`'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'` - -* `href`: The full URL that was originally parsed. Both the protocol and host are lowercased. - - Example: `'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'` - -* `protocol`: The request protocol, lowercased. - - Example: `'http:'` - -* `host`: The full lowercased host portion of the URL, including port - information. - - Example: `'host.com:8080'` - -* `auth`: The authentication information portion of a URL. - - Example: `'user:pass'` - -* `hostname`: Just the lowercased hostname portion of the host. - - Example: `'host.com'` - -* `port`: The port number portion of the host. - - Example: `'8080'` - -* `pathname`: The path section of the URL, that comes after the host and - before the query, including the initial slash if present. - - Example: `'/p/a/t/h'` - -* `search`: The 'query string' portion of the URL, including the leading - question mark. - - Example: `'?query=string'` - -* `path`: Concatenation of `pathname` and `search`. - - Example: `'/p/a/t/h?query=string'` - -* `query`: Either the 'params' portion of the query string, or a - querystring-parsed object. - - Example: `'query=string'` or `{'query':'string'}` - -* `hash`: The 'fragment' portion of the URL including the pound-sign. - - Example: `'#hash'` - -The following methods are provided by the URL module: - -### url.parse(urlStr, [parseQueryString], [slashesDenoteHost]) - -Take a URL string, and return an object. - -Pass `true` as the second argument to also parse -the query string using the `querystring` module. -Defaults to `false`. - -Pass `true` as the third argument to treat `//foo/bar` as -`{ host: 'foo', pathname: '/bar' }` rather than -`{ pathname: '//foo/bar' }`. Defaults to `false`. - -### url.format(urlObj) - -Take a parsed URL object, and return a formatted URL string. - -* `href` will be ignored. -* `protocol` is treated the same with or without the trailing `:` (colon). - * The protocols `http`, `https`, `ftp`, `gopher`, `file` will be - postfixed with `://` (colon-slash-slash). - * All other protocols `mailto`, `xmpp`, `aim`, `sftp`, `foo`, etc will - be postfixed with `:` (colon) -* `auth` will be used if present. -* `hostname` will only be used if `host` is absent. -* `port` will only be used if `host` is absent. -* `host` will be used in place of `hostname` and `port` -* `pathname` is treated the same with or without the leading `/` (slash) -* `search` will be used in place of `query` -* `query` (object; see `querystring`) will only be used if `search` is absent. -* `search` is treated the same with or without the leading `?` (question mark) -* `hash` is treated the same with or without the leading `#` (pound sign, anchor) - -### url.resolve(from, to) - -Take a base URL, and a href URL, and resolve them as a browser would for -an anchor tag. Examples: - - url.resolve('/one/two/three', 'four') // '/one/two/four' - url.resolve('http://example.com/', '/one') // 'http://example.com/one' - url.resolve('http://example.com/one', '/two') // 'http://example.com/two' diff --git a/node_modules/url/node_modules/punycode/LICENSE-MIT.txt b/node_modules/url/node_modules/punycode/LICENSE-MIT.txt deleted file mode 100644 index a41e0a7ef..000000000 --- a/node_modules/url/node_modules/punycode/LICENSE-MIT.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright Mathias Bynens - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/url/node_modules/punycode/README.md b/node_modules/url/node_modules/punycode/README.md deleted file mode 100644 index 831e6379b..000000000 --- a/node_modules/url/node_modules/punycode/README.md +++ /dev/null @@ -1,176 +0,0 @@ -# Punycode.js [![Build status](https://travis-ci.org/bestiejs/punycode.js.svg?branch=master)](https://travis-ci.org/bestiejs/punycode.js) [![Code coverage status](http://img.shields.io/coveralls/bestiejs/punycode.js/master.svg)](https://coveralls.io/r/bestiejs/punycode.js) [![Dependency status](https://gemnasium.com/bestiejs/punycode.js.svg)](https://gemnasium.com/bestiejs/punycode.js) - -A robust Punycode converter that fully complies to [RFC 3492](http://tools.ietf.org/html/rfc3492) and [RFC 5891](http://tools.ietf.org/html/rfc5891), and works on nearly all JavaScript platforms. - -This JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm: - -* [The C example code from RFC 3492](http://tools.ietf.org/html/rfc3492#appendix-C) -* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c) -* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c) -* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287) -* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072)) - -This project is [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with [Node.js v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc). - -## Installation - -Via [npm](http://npmjs.org/) (only required for Node.js releases older than v0.6.2): - -```bash -npm install punycode -``` - -Via [Bower](http://bower.io/): - -```bash -bower install punycode -``` - -Via [Component](https://github.com/component/component): - -```bash -component install bestiejs/punycode.js -``` - -In a browser: - -```html - -``` - -In [Narwhal](http://narwhaljs.org/), [Node.js](http://nodejs.org/), and [RingoJS](http://ringojs.org/): - -```js -var punycode = require('punycode'); -``` - -In [Rhino](http://www.mozilla.org/rhino/): - -```js -load('punycode.js'); -``` - -Using an AMD loader like [RequireJS](http://requirejs.org/): - -```js -require( - { - 'paths': { - 'punycode': 'path/to/punycode' - } - }, - ['punycode'], - function(punycode) { - console.log(punycode); - } -); -``` - -## API - -### `punycode.decode(string)` - -Converts a Punycode string of ASCII symbols to a string of Unicode symbols. - -```js -// decode domain name parts -punycode.decode('maana-pta'); // 'mañana' -punycode.decode('--dqo34k'); // '☃-⌘' -``` - -### `punycode.encode(string)` - -Converts a string of Unicode symbols to a Punycode string of ASCII symbols. - -```js -// encode domain name parts -punycode.encode('mañana'); // 'maana-pta' -punycode.encode('☃-⌘'); // '--dqo34k' -``` - -### `punycode.toUnicode(input)` - -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. - -```js -// decode domain names -punycode.toUnicode('xn--maana-pta.com'); -// → 'mañana.com' -punycode.toUnicode('xn----dqo34k.com'); -// → '☃-⌘.com' - -// decode email addresses -punycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'); -// → 'джумла@джpумлатест.bрфa' -``` - -### `punycode.toASCII(input)` - -Converts a Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that's already in ASCII. - -```js -// encode domain names -punycode.toASCII('mañana.com'); -// → 'xn--maana-pta.com' -punycode.toASCII('☃-⌘.com'); -// → 'xn----dqo34k.com' - -// encode email addresses -punycode.toASCII('джумла@джpумлатест.bрфa'); -// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq' -``` - -### `punycode.ucs2` - -#### `punycode.ucs2.decode(string)` - -Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), 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. - -```js -punycode.ucs2.decode('abc'); -// → [0x61, 0x62, 0x63] -// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE: -punycode.ucs2.decode('\uD834\uDF06'); -// → [0x1D306] -``` - -#### `punycode.ucs2.encode(codePoints)` - -Creates a string based on an array of numeric code point values. - -```js -punycode.ucs2.encode([0x61, 0x62, 0x63]); -// → 'abc' -punycode.ucs2.encode([0x1D306]); -// → '\uD834\uDF06' -``` - -### `punycode.version` - -A string representing the current Punycode.js version number. - -## Unit tests & code coverage - -After cloning this repository, run `npm install --dev` to install the dependencies needed for Punycode.js development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`. - -Once that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, PhantomJS, and web browsers as well, use `grunt test`. - -To generate the code coverage report, use `grunt cover`. - -Feel free to fork if you see possible improvements! - -## Author - -| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | -|---| -| [Mathias Bynens](https://mathiasbynens.be/) | - -## Contributors - -| [![twitter/jdalton](https://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | -|---| -| [John-David Dalton](http://allyoucanleet.com/) | - -## License - -Punycode.js is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/url/node_modules/punycode/package.json b/node_modules/url/node_modules/punycode/package.json deleted file mode 100644 index c23b90e8f..000000000 --- a/node_modules/url/node_modules/punycode/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "_from": "punycode@1.3.2", - "_id": "punycode@1.3.2", - "_inBundle": false, - "_integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "_location": "/url/punycode", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "punycode@1.3.2", - "name": "punycode", - "escapedName": "punycode", - "rawSpec": "1.3.2", - "saveSpec": null, - "fetchSpec": "1.3.2" - }, - "_requiredBy": [ - "/url" - ], - "_resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "_shasum": "9653a036fb7c1ee42342f2325cceefea3926c48d", - "_spec": "punycode@1.3.2", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/url", - "author": { - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - }, - "bugs": { - "url": "https://github.com/bestiejs/punycode.js/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - }, - { - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - } - ], - "deprecated": false, - "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", - "devDependencies": { - "coveralls": "^2.10.1", - "grunt": "^0.4.5", - "grunt-contrib-uglify": "^0.5.0", - "grunt-shell": "^0.7.0", - "istanbul": "^0.2.13", - "qunit-extras": "^1.2.0", - "qunitjs": "~1.11.0", - "requirejs": "^2.1.14" - }, - "files": [ - "LICENSE-MIT.txt", - "punycode.js" - ], - "homepage": "https://mths.be/punycode", - "keywords": [ - "punycode", - "unicode", - "idn", - "idna", - "dns", - "url", - "domain" - ], - "license": "MIT", - "main": "punycode.js", - "name": "punycode", - "repository": { - "type": "git", - "url": "git+https://github.com/bestiejs/punycode.js.git" - }, - "scripts": { - "test": "node tests/tests.js" - }, - "version": "1.3.2" -} diff --git a/node_modules/url/node_modules/punycode/punycode.js b/node_modules/url/node_modules/punycode/punycode.js deleted file mode 100644 index ac6859738..000000000 --- a/node_modules/url/node_modules/punycode/punycode.js +++ /dev/null @@ -1,530 +0,0 @@ -/*! https://mths.be/punycode v1.3.2 by @mathias */ -;(function(root) { - - /** Detect free variables */ - var freeExports = typeof exports == 'object' && exports && - !exports.nodeType && exports; - var freeModule = typeof module == 'object' && 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 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. - * http://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.3.2', - /** - * 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 ( - typeof define == 'function' && - typeof define.amd == 'object' && - define.amd - ) { - define('punycode', function() { - return punycode; - }); - } else if (freeExports && freeModule) { - if (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+ - freeModule.exports = punycode; - } else { // in Narwhal or RingoJS v0.7.0- - for (key in punycode) { - punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); - } - } - } else { // in Rhino or a web browser - root.punycode = punycode; - } - -}(this)); diff --git a/node_modules/url/package.json b/node_modules/url/package.json deleted file mode 100644 index 2244433b4..000000000 --- a/node_modules/url/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "_from": "url@~0.11.0", - "_id": "url@0.11.0", - "_inBundle": false, - "_integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "_location": "/url", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "url@~0.11.0", - "name": "url", - "escapedName": "url", - "rawSpec": "~0.11.0", - "saveSpec": null, - "fetchSpec": "~0.11.0" - }, - "_requiredBy": [ - "/browserify" - ], - "_resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "_shasum": "3838e97cfc60521eb73c525a8e55bfdd9e2e28f1", - "_spec": "url@~0.11.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "bugs": { - "url": "https://github.com/defunctzombie/node-url/issues" - }, - "bundleDependencies": false, - "dependencies": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "deprecated": false, - "description": "The core `url` packaged standalone for use with Browserify.", - "devDependencies": { - "assert": "1.1.1", - "mocha": "1.18.2", - "zuul": "3.3.0" - }, - "homepage": "https://github.com/defunctzombie/node-url#readme", - "license": "MIT", - "main": "./url.js", - "name": "url", - "repository": { - "type": "git", - "url": "git+https://github.com/defunctzombie/node-url.git" - }, - "scripts": { - "test": "mocha --ui qunit test.js && zuul -- test.js", - "test-local": "zuul --local -- test.js" - }, - "version": "0.11.0" -} diff --git a/node_modules/url/test.js b/node_modules/url/test.js deleted file mode 100644 index 3b7d3358c..000000000 --- a/node_modules/url/test.js +++ /dev/null @@ -1,1599 +0,0 @@ -// 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 assert = require('assert'); - -var url = require('./url'); - -// URLs to parse, and expected data -// { url : parsed } -var parseTests = { - '//some_path' : { - 'href': '//some_path', - 'pathname': '//some_path', - 'path': '//some_path' - }, - - 'http:\\\\evil-phisher\\foo.html#h\\a\\s\\h': { - protocol: 'http:', - slashes: true, - host: 'evil-phisher', - hostname: 'evil-phisher', - pathname: '/foo.html', - path: '/foo.html', - hash: '#h%5Ca%5Cs%5Ch', - href: 'http://evil-phisher/foo.html#h%5Ca%5Cs%5Ch' - }, - - 'http:\\\\evil-phisher\\foo.html?json="\\"foo\\""#h\\a\\s\\h': { - protocol: 'http:', - slashes: true, - host: 'evil-phisher', - hostname: 'evil-phisher', - pathname: '/foo.html', - search: '?json=%22%5C%22foo%5C%22%22', - query: 'json=%22%5C%22foo%5C%22%22', - path: '/foo.html?json=%22%5C%22foo%5C%22%22', - hash: '#h%5Ca%5Cs%5Ch', - href: 'http://evil-phisher/foo.html?json=%22%5C%22foo%5C%22%22#h%5Ca%5Cs%5Ch' - }, - - 'http:\\\\evil-phisher\\foo.html#h\\a\\s\\h?blarg': { - protocol: 'http:', - slashes: true, - host: 'evil-phisher', - hostname: 'evil-phisher', - pathname: '/foo.html', - path: '/foo.html', - hash: '#h%5Ca%5Cs%5Ch?blarg', - href: 'http://evil-phisher/foo.html#h%5Ca%5Cs%5Ch?blarg' - }, - - - 'http:\\\\evil-phisher\\foo.html': { - protocol: 'http:', - slashes: true, - host: 'evil-phisher', - hostname: 'evil-phisher', - pathname: '/foo.html', - path: '/foo.html', - href: 'http://evil-phisher/foo.html' - }, - - 'HTTP://www.example.com/' : { - 'href': 'http://www.example.com/', - 'protocol': 'http:', - 'slashes': true, - 'host': 'www.example.com', - 'hostname': 'www.example.com', - 'pathname': '/', - 'path': '/' - }, - - 'HTTP://www.example.com' : { - 'href': 'http://www.example.com/', - 'protocol': 'http:', - 'slashes': true, - 'host': 'www.example.com', - 'hostname': 'www.example.com', - 'pathname': '/', - 'path': '/' - }, - - 'http://www.ExAmPlE.com/' : { - 'href': 'http://www.example.com/', - 'protocol': 'http:', - 'slashes': true, - 'host': 'www.example.com', - 'hostname': 'www.example.com', - 'pathname': '/', - 'path': '/' - }, - - 'http://user:pw@www.ExAmPlE.com/' : { - 'href': 'http://user:pw@www.example.com/', - 'protocol': 'http:', - 'slashes': true, - 'auth': 'user:pw', - 'host': 'www.example.com', - 'hostname': 'www.example.com', - 'pathname': '/', - 'path': '/' - }, - - 'http://USER:PW@www.ExAmPlE.com/' : { - 'href': 'http://USER:PW@www.example.com/', - 'protocol': 'http:', - 'slashes': true, - 'auth': 'USER:PW', - 'host': 'www.example.com', - 'hostname': 'www.example.com', - 'pathname': '/', - 'path': '/' - }, - - 'http://user@www.example.com/' : { - 'href': 'http://user@www.example.com/', - 'protocol': 'http:', - 'slashes': true, - 'auth': 'user', - 'host': 'www.example.com', - 'hostname': 'www.example.com', - 'pathname': '/', - 'path': '/' - }, - - 'http://user%3Apw@www.example.com/' : { - 'href': 'http://user:pw@www.example.com/', - 'protocol': 'http:', - 'slashes': true, - 'auth': 'user:pw', - 'host': 'www.example.com', - 'hostname': 'www.example.com', - 'pathname': '/', - 'path': '/' - }, - - 'http://x.com/path?that\'s#all, folks' : { - 'href': 'http://x.com/path?that%27s#all,%20folks', - 'protocol': 'http:', - 'slashes': true, - 'host': 'x.com', - 'hostname': 'x.com', - 'search': '?that%27s', - 'query': 'that%27s', - 'pathname': '/path', - 'hash': '#all,%20folks', - 'path': '/path?that%27s' - }, - - 'HTTP://X.COM/Y' : { - 'href': 'http://x.com/Y', - 'protocol': 'http:', - 'slashes': true, - 'host': 'x.com', - 'hostname': 'x.com', - 'pathname': '/Y', - 'path': '/Y' - }, - - // + not an invalid host character - // per https://url.spec.whatwg.org/#host-parsing - 'http://x.y.com+a/b/c' : { - 'href': 'http://x.y.com+a/b/c', - 'protocol': 'http:', - 'slashes': true, - 'host': 'x.y.com+a', - 'hostname': 'x.y.com+a', - 'pathname': '/b/c', - 'path': '/b/c' - }, - - // an unexpected invalid char in the hostname. - 'HtTp://x.y.cOm;a/b/c?d=e#f gi' : { - 'href': 'http://x.y.com/;a/b/c?d=e#f%20g%3Ch%3Ei', - 'protocol': 'http:', - 'slashes': true, - 'host': 'x.y.com', - 'hostname': 'x.y.com', - 'pathname': ';a/b/c', - 'search': '?d=e', - 'query': 'd=e', - 'hash': '#f%20g%3Ch%3Ei', - 'path': ';a/b/c?d=e' - }, - - // make sure that we don't accidentally lcast the path parts. - 'HtTp://x.y.cOm;A/b/c?d=e#f gi' : { - 'href': 'http://x.y.com/;A/b/c?d=e#f%20g%3Ch%3Ei', - 'protocol': 'http:', - 'slashes': true, - 'host': 'x.y.com', - 'hostname': 'x.y.com', - 'pathname': ';A/b/c', - 'search': '?d=e', - 'query': 'd=e', - 'hash': '#f%20g%3Ch%3Ei', - 'path': ';A/b/c?d=e' - }, - - 'http://x...y...#p': { - 'href': 'http://x...y.../#p', - 'protocol': 'http:', - 'slashes': true, - 'host': 'x...y...', - 'hostname': 'x...y...', - 'hash': '#p', - 'pathname': '/', - 'path': '/' - }, - - 'http://x/p/"quoted"': { - 'href': 'http://x/p/%22quoted%22', - 'protocol': 'http:', - 'slashes': true, - 'host': 'x', - 'hostname': 'x', - 'pathname': '/p/%22quoted%22', - 'path': '/p/%22quoted%22' - }, - - ' Is a URL!': { - 'href': '%3Chttp://goo.corn/bread%3E%20Is%20a%20URL!', - 'pathname': '%3Chttp://goo.corn/bread%3E%20Is%20a%20URL!', - 'path': '%3Chttp://goo.corn/bread%3E%20Is%20a%20URL!' - }, - - 'http://www.narwhaljs.org/blog/categories?id=news' : { - 'href': 'http://www.narwhaljs.org/blog/categories?id=news', - 'protocol': 'http:', - 'slashes': true, - 'host': 'www.narwhaljs.org', - 'hostname': 'www.narwhaljs.org', - 'search': '?id=news', - 'query': 'id=news', - 'pathname': '/blog/categories', - 'path': '/blog/categories?id=news' - }, - - 'http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=' : { - 'href': 'http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=', - 'protocol': 'http:', - 'slashes': true, - 'host': 'mt0.google.com', - 'hostname': 'mt0.google.com', - 'pathname': '/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=', - 'path': '/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=' - }, - - 'http://mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' : { - 'href': 'http://mt0.google.com/vt/lyrs=m@114???&hl=en&src=api' + - '&x=2&y=2&z=3&s=', - 'protocol': 'http:', - 'slashes': true, - 'host': 'mt0.google.com', - 'hostname': 'mt0.google.com', - 'search': '???&hl=en&src=api&x=2&y=2&z=3&s=', - 'query': '??&hl=en&src=api&x=2&y=2&z=3&s=', - 'pathname': '/vt/lyrs=m@114', - 'path': '/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' - }, - - 'http://user:pass@mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=': - { - 'href': 'http://user:pass@mt0.google.com/vt/lyrs=m@114???' + - '&hl=en&src=api&x=2&y=2&z=3&s=', - 'protocol': 'http:', - 'slashes': true, - 'host': 'mt0.google.com', - 'auth': 'user:pass', - 'hostname': 'mt0.google.com', - 'search': '???&hl=en&src=api&x=2&y=2&z=3&s=', - 'query': '??&hl=en&src=api&x=2&y=2&z=3&s=', - 'pathname': '/vt/lyrs=m@114', - 'path': '/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' - }, - - 'file:///etc/passwd' : { - 'href': 'file:///etc/passwd', - 'slashes': true, - 'protocol': 'file:', - 'pathname': '/etc/passwd', - 'hostname': '', - 'host': '', - 'path': '/etc/passwd' - }, - - 'file://localhost/etc/passwd' : { - 'href': 'file://localhost/etc/passwd', - 'protocol': 'file:', - 'slashes': true, - 'pathname': '/etc/passwd', - 'hostname': 'localhost', - 'host': 'localhost', - 'path': '/etc/passwd' - }, - - 'file://foo/etc/passwd' : { - 'href': 'file://foo/etc/passwd', - 'protocol': 'file:', - 'slashes': true, - 'pathname': '/etc/passwd', - 'hostname': 'foo', - 'host': 'foo', - 'path': '/etc/passwd' - }, - - 'file:///etc/node/' : { - 'href': 'file:///etc/node/', - 'slashes': true, - 'protocol': 'file:', - 'pathname': '/etc/node/', - 'hostname': '', - 'host': '', - 'path': '/etc/node/' - }, - - 'file://localhost/etc/node/' : { - 'href': 'file://localhost/etc/node/', - 'protocol': 'file:', - 'slashes': true, - 'pathname': '/etc/node/', - 'hostname': 'localhost', - 'host': 'localhost', - 'path': '/etc/node/' - }, - - 'file://foo/etc/node/' : { - 'href': 'file://foo/etc/node/', - 'protocol': 'file:', - 'slashes': true, - 'pathname': '/etc/node/', - 'hostname': 'foo', - 'host': 'foo', - 'path': '/etc/node/' - }, - - 'http:/baz/../foo/bar' : { - 'href': 'http:/baz/../foo/bar', - 'protocol': 'http:', - 'pathname': '/baz/../foo/bar', - 'path': '/baz/../foo/bar' - }, - - 'http://user:pass@example.com:8000/foo/bar?baz=quux#frag' : { - 'href': 'http://user:pass@example.com:8000/foo/bar?baz=quux#frag', - 'protocol': 'http:', - 'slashes': true, - 'host': 'example.com:8000', - 'auth': 'user:pass', - 'port': '8000', - 'hostname': 'example.com', - 'hash': '#frag', - 'search': '?baz=quux', - 'query': 'baz=quux', - 'pathname': '/foo/bar', - 'path': '/foo/bar?baz=quux' - }, - - '//user:pass@example.com:8000/foo/bar?baz=quux#frag' : { - 'href': '//user:pass@example.com:8000/foo/bar?baz=quux#frag', - 'slashes': true, - 'host': 'example.com:8000', - 'auth': 'user:pass', - 'port': '8000', - 'hostname': 'example.com', - 'hash': '#frag', - 'search': '?baz=quux', - 'query': 'baz=quux', - 'pathname': '/foo/bar', - 'path': '/foo/bar?baz=quux' - }, - - '/foo/bar?baz=quux#frag' : { - 'href': '/foo/bar?baz=quux#frag', - 'hash': '#frag', - 'search': '?baz=quux', - 'query': 'baz=quux', - 'pathname': '/foo/bar', - 'path': '/foo/bar?baz=quux' - }, - - 'http:/foo/bar?baz=quux#frag' : { - 'href': 'http:/foo/bar?baz=quux#frag', - 'protocol': 'http:', - 'hash': '#frag', - 'search': '?baz=quux', - 'query': 'baz=quux', - 'pathname': '/foo/bar', - 'path': '/foo/bar?baz=quux' - }, - - 'mailto:foo@bar.com?subject=hello' : { - 'href': 'mailto:foo@bar.com?subject=hello', - 'protocol': 'mailto:', - 'host': 'bar.com', - 'auth' : 'foo', - 'hostname' : 'bar.com', - 'search': '?subject=hello', - 'query': 'subject=hello', - 'path': '?subject=hello' - }, - - 'javascript:alert(\'hello\');' : { - 'href': 'javascript:alert(\'hello\');', - 'protocol': 'javascript:', - 'pathname': 'alert(\'hello\');', - 'path': 'alert(\'hello\');' - }, - - 'xmpp:isaacschlueter@jabber.org' : { - 'href': 'xmpp:isaacschlueter@jabber.org', - 'protocol': 'xmpp:', - 'host': 'jabber.org', - 'auth': 'isaacschlueter', - 'hostname': 'jabber.org' - }, - - 'http://atpass:foo%40bar@127.0.0.1:8080/path?search=foo#bar' : { - 'href' : 'http://atpass:foo%40bar@127.0.0.1:8080/path?search=foo#bar', - 'protocol' : 'http:', - 'slashes': true, - 'host' : '127.0.0.1:8080', - 'auth' : 'atpass:foo@bar', - 'hostname' : '127.0.0.1', - 'port' : '8080', - 'pathname': '/path', - 'search' : '?search=foo', - 'query' : 'search=foo', - 'hash' : '#bar', - 'path': '/path?search=foo' - }, - - 'svn+ssh://foo/bar': { - 'href': 'svn+ssh://foo/bar', - 'host': 'foo', - 'hostname': 'foo', - 'protocol': 'svn+ssh:', - 'pathname': '/bar', - 'path': '/bar', - 'slashes': true - }, - - 'dash-test://foo/bar': { - 'href': 'dash-test://foo/bar', - 'host': 'foo', - 'hostname': 'foo', - 'protocol': 'dash-test:', - 'pathname': '/bar', - 'path': '/bar', - 'slashes': true - }, - - 'dash-test:foo/bar': { - 'href': 'dash-test:foo/bar', - 'host': 'foo', - 'hostname': 'foo', - 'protocol': 'dash-test:', - 'pathname': '/bar', - 'path': '/bar' - }, - - 'dot.test://foo/bar': { - 'href': 'dot.test://foo/bar', - 'host': 'foo', - 'hostname': 'foo', - 'protocol': 'dot.test:', - 'pathname': '/bar', - 'path': '/bar', - 'slashes': true - }, - - 'dot.test:foo/bar': { - 'href': 'dot.test:foo/bar', - 'host': 'foo', - 'hostname': 'foo', - 'protocol': 'dot.test:', - 'pathname': '/bar', - 'path': '/bar' - }, - - // IDNA tests - 'http://www.日本語.com/' : { - 'href': 'http://www.xn--wgv71a119e.com/', - 'protocol': 'http:', - 'slashes': true, - 'host': 'www.xn--wgv71a119e.com', - 'hostname': 'www.xn--wgv71a119e.com', - 'pathname': '/', - 'path': '/' - }, - - 'http://example.Bücher.com/' : { - 'href': 'http://example.xn--bcher-kva.com/', - 'protocol': 'http:', - 'slashes': true, - 'host': 'example.xn--bcher-kva.com', - 'hostname': 'example.xn--bcher-kva.com', - 'pathname': '/', - 'path': '/' - }, - - 'http://www.Äffchen.com/' : { - 'href': 'http://www.xn--ffchen-9ta.com/', - 'protocol': 'http:', - 'slashes': true, - 'host': 'www.xn--ffchen-9ta.com', - 'hostname': 'www.xn--ffchen-9ta.com', - 'pathname': '/', - 'path': '/' - }, - - 'http://www.Äffchen.cOm;A/b/c?d=e#f gi' : { - 'href': 'http://www.xn--ffchen-9ta.com/;A/b/c?d=e#f%20g%3Ch%3Ei', - 'protocol': 'http:', - 'slashes': true, - 'host': 'www.xn--ffchen-9ta.com', - 'hostname': 'www.xn--ffchen-9ta.com', - 'pathname': ';A/b/c', - 'search': '?d=e', - 'query': 'd=e', - 'hash': '#f%20g%3Ch%3Ei', - 'path': ';A/b/c?d=e' - }, - - 'http://SÉLIER.COM/' : { - 'href': 'http://xn--slier-bsa.com/', - 'protocol': 'http:', - 'slashes': true, - 'host': 'xn--slier-bsa.com', - 'hostname': 'xn--slier-bsa.com', - 'pathname': '/', - 'path': '/' - }, - - 'http://ليهمابتكلموشعربي؟.ي؟/' : { - 'href': 'http://xn--egbpdaj6bu4bxfgehfvwxn.xn--egb9f/', - 'protocol': 'http:', - 'slashes': true, - 'host': 'xn--egbpdaj6bu4bxfgehfvwxn.xn--egb9f', - 'hostname': 'xn--egbpdaj6bu4bxfgehfvwxn.xn--egb9f', - 'pathname': '/', - 'path': '/' - }, - - 'http://➡.ws/➡' : { - 'href': 'http://xn--hgi.ws/➡', - 'protocol': 'http:', - 'slashes': true, - 'host': 'xn--hgi.ws', - 'hostname': 'xn--hgi.ws', - 'pathname': '/➡', - 'path': '/➡' - }, - - 'http://bucket_name.s3.amazonaws.com/image.jpg': { - protocol: 'http:', - 'slashes': true, - slashes: true, - host: 'bucket_name.s3.amazonaws.com', - hostname: 'bucket_name.s3.amazonaws.com', - pathname: '/image.jpg', - href: 'http://bucket_name.s3.amazonaws.com/image.jpg', - 'path': '/image.jpg' - }, - - 'git+http://github.com/joyent/node.git': { - protocol: 'git+http:', - slashes: true, - host: 'github.com', - hostname: 'github.com', - pathname: '/joyent/node.git', - path: '/joyent/node.git', - href: 'git+http://github.com/joyent/node.git' - }, - - //if local1@domain1 is uses as a relative URL it may - //be parse into auth@hostname, but here there is no - //way to make it work in url.parse, I add the test to be explicit - 'local1@domain1': { - 'pathname': 'local1@domain1', - 'path': 'local1@domain1', - 'href': 'local1@domain1' - }, - - //While this may seem counter-intuitive, a browser will parse - // as a path. - 'www.example.com' : { - 'href': 'www.example.com', - 'pathname': 'www.example.com', - 'path': 'www.example.com' - }, - - // ipv6 support - '[fe80::1]': { - 'href': '[fe80::1]', - 'pathname': '[fe80::1]', - 'path': '[fe80::1]' - }, - - 'coap://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]': { - 'protocol': 'coap:', - 'slashes': true, - 'host': '[fedc:ba98:7654:3210:fedc:ba98:7654:3210]', - 'hostname': 'fedc:ba98:7654:3210:fedc:ba98:7654:3210', - 'href': 'coap://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/', - 'pathname': '/', - 'path': '/' - }, - - 'coap://[1080:0:0:0:8:800:200C:417A]:61616/': { - 'protocol': 'coap:', - 'slashes': true, - 'host': '[1080:0:0:0:8:800:200c:417a]:61616', - 'port': '61616', - 'hostname': '1080:0:0:0:8:800:200c:417a', - 'href': 'coap://[1080:0:0:0:8:800:200c:417a]:61616/', - 'pathname': '/', - 'path': '/' - }, - - 'http://user:password@[3ffe:2a00:100:7031::1]:8080': { - 'protocol': 'http:', - 'slashes': true, - 'auth': 'user:password', - 'host': '[3ffe:2a00:100:7031::1]:8080', - 'port': '8080', - 'hostname': '3ffe:2a00:100:7031::1', - 'href': 'http://user:password@[3ffe:2a00:100:7031::1]:8080/', - 'pathname': '/', - 'path': '/' - }, - - 'coap://u:p@[::192.9.5.5]:61616/.well-known/r?n=Temperature': { - 'protocol': 'coap:', - 'slashes': true, - 'auth': 'u:p', - 'host': '[::192.9.5.5]:61616', - 'port': '61616', - 'hostname': '::192.9.5.5', - 'href': 'coap://u:p@[::192.9.5.5]:61616/.well-known/r?n=Temperature', - 'search': '?n=Temperature', - 'query': 'n=Temperature', - 'pathname': '/.well-known/r', - 'path': '/.well-known/r?n=Temperature' - }, - - // empty port - 'http://example.com:': { - 'protocol': 'http:', - 'slashes': true, - 'host': 'example.com', - 'hostname': 'example.com', - 'href': 'http://example.com/', - 'pathname': '/', - 'path': '/' - }, - - 'http://example.com:/a/b.html': { - 'protocol': 'http:', - 'slashes': true, - 'host': 'example.com', - 'hostname': 'example.com', - 'href': 'http://example.com/a/b.html', - 'pathname': '/a/b.html', - 'path': '/a/b.html' - }, - - 'http://example.com:?a=b': { - 'protocol': 'http:', - 'slashes': true, - 'host': 'example.com', - 'hostname': 'example.com', - 'href': 'http://example.com/?a=b', - 'search': '?a=b', - 'query': 'a=b', - 'pathname': '/', - 'path': '/?a=b' - }, - - 'http://example.com:#abc': { - 'protocol': 'http:', - 'slashes': true, - 'host': 'example.com', - 'hostname': 'example.com', - 'href': 'http://example.com/#abc', - 'hash': '#abc', - 'pathname': '/', - 'path': '/' - }, - - 'http://[fe80::1]:/a/b?a=b#abc': { - 'protocol': 'http:', - 'slashes': true, - 'host': '[fe80::1]', - 'hostname': 'fe80::1', - 'href': 'http://[fe80::1]/a/b?a=b#abc', - 'search': '?a=b', - 'query': 'a=b', - 'hash': '#abc', - 'pathname': '/a/b', - 'path': '/a/b?a=b' - }, - - 'http://-lovemonsterz.tumblr.com/rss': { - 'protocol': 'http:', - 'slashes': true, - 'host': '-lovemonsterz.tumblr.com', - 'hostname': '-lovemonsterz.tumblr.com', - 'href': 'http://-lovemonsterz.tumblr.com/rss', - 'pathname': '/rss', - 'path': '/rss', - }, - - 'http://-lovemonsterz.tumblr.com:80/rss': { - 'protocol': 'http:', - 'slashes': true, - 'port': '80', - 'host': '-lovemonsterz.tumblr.com:80', - 'hostname': '-lovemonsterz.tumblr.com', - 'href': 'http://-lovemonsterz.tumblr.com:80/rss', - 'pathname': '/rss', - 'path': '/rss', - }, - - 'http://user:pass@-lovemonsterz.tumblr.com/rss': { - 'protocol': 'http:', - 'slashes': true, - 'auth': 'user:pass', - 'host': '-lovemonsterz.tumblr.com', - 'hostname': '-lovemonsterz.tumblr.com', - 'href': 'http://user:pass@-lovemonsterz.tumblr.com/rss', - 'pathname': '/rss', - 'path': '/rss', - }, - - 'http://user:pass@-lovemonsterz.tumblr.com:80/rss': { - 'protocol': 'http:', - 'slashes': true, - 'auth': 'user:pass', - 'port': '80', - 'host': '-lovemonsterz.tumblr.com:80', - 'hostname': '-lovemonsterz.tumblr.com', - 'href': 'http://user:pass@-lovemonsterz.tumblr.com:80/rss', - 'pathname': '/rss', - 'path': '/rss', - }, - - 'http://_jabber._tcp.google.com/test': { - 'protocol': 'http:', - 'slashes': true, - 'host': '_jabber._tcp.google.com', - 'hostname': '_jabber._tcp.google.com', - 'href': 'http://_jabber._tcp.google.com/test', - 'pathname': '/test', - 'path': '/test', - }, - - 'http://user:pass@_jabber._tcp.google.com/test': { - 'protocol': 'http:', - 'slashes': true, - 'auth': 'user:pass', - 'host': '_jabber._tcp.google.com', - 'hostname': '_jabber._tcp.google.com', - 'href': 'http://user:pass@_jabber._tcp.google.com/test', - 'pathname': '/test', - 'path': '/test', - }, - - 'http://_jabber._tcp.google.com:80/test': { - 'protocol': 'http:', - 'slashes': true, - 'port': '80', - 'host': '_jabber._tcp.google.com:80', - 'hostname': '_jabber._tcp.google.com', - 'href': 'http://_jabber._tcp.google.com:80/test', - 'pathname': '/test', - 'path': '/test', - }, - - 'http://user:pass@_jabber._tcp.google.com:80/test': { - 'protocol': 'http:', - 'slashes': true, - 'auth': 'user:pass', - 'port': '80', - 'host': '_jabber._tcp.google.com:80', - 'hostname': '_jabber._tcp.google.com', - 'href': 'http://user:pass@_jabber._tcp.google.com:80/test', - 'pathname': '/test', - 'path': '/test', - }, - - 'http://x:1/\' <>"`/{}|\\^~`/': { - protocol: 'http:', - slashes: true, - host: 'x:1', - port: '1', - hostname: 'x', - pathname: '/%27%20%3C%3E%22%60/%7B%7D%7C/%5E~%60/', - path: '/%27%20%3C%3E%22%60/%7B%7D%7C/%5E~%60/', - href: 'http://x:1/%27%20%3C%3E%22%60/%7B%7D%7C/%5E~%60/' - }, - - 'http://a@b@c/': { - protocol: 'http:', - slashes: true, - auth: 'a@b', - host: 'c', - hostname: 'c', - href: 'http://a%40b@c/', - path: '/', - pathname: '/' - }, - - 'http://a@b?@c': { - protocol: 'http:', - slashes: true, - auth: 'a', - host: 'b', - hostname: 'b', - href: 'http://a@b/?@c', - path: '/?@c', - pathname: '/', - search: '?@c', - query: '@c' - }, - - 'http://a\r" \t\n<\'b:b@c\r\nd/e?f':{ - protocol: 'http:', - slashes: true, - auth: 'a\r" \t\n<\'b:b', - host: 'c', - port: null, - hostname: 'c', - hash: null, - search: '?f', - query: 'f', - pathname: '%0D%0Ad/e', - path: '%0D%0Ad/e?f', - href: 'http://a%0D%22%20%09%0A%3C\'b:b@c/%0D%0Ad/e?f' - }, - - // git urls used by npm - 'git+ssh://git@github.com:npm/npm': { - protocol: 'git+ssh:', - slashes: true, - auth: 'git', - host: 'github.com', - port: null, - hostname: 'github.com', - hash: null, - search: null, - query: null, - pathname: '/:npm/npm', - path: '/:npm/npm', - href: 'git+ssh://git@github.com/:npm/npm' - } - -}; - -Object.keys(parseTests).forEach(function(u) { - test('parse(' + u + ')', function() { - var actual = url.parse(u), - spaced = url.parse(' \t ' + u + '\n\t'); - expected = parseTests[u]; - - Object.keys(actual).forEach(function (i) { - if (expected[i] === undefined && actual[i] === null) { - expected[i] = null; - } - }); - - assert.deepEqual(actual, expected); - assert.deepEqual(spaced, expected); - - var expected = parseTests[u].href, - actual = url.format(parseTests[u]); - - assert.equal(actual, expected, - 'format(' + u + ') == ' + u + '\nactual:' + actual); - }); -}); - -var parseTestsWithQueryString = { - '/foo/bar?baz=quux#frag' : { - 'href': '/foo/bar?baz=quux#frag', - 'hash': '#frag', - 'search': '?baz=quux', - 'query': { - 'baz': 'quux' - }, - 'pathname': '/foo/bar', - 'path': '/foo/bar?baz=quux' - }, - 'http://example.com' : { - 'href': 'http://example.com/', - 'protocol': 'http:', - 'slashes': true, - 'host': 'example.com', - 'hostname': 'example.com', - 'query': {}, - 'search': '', - 'pathname': '/', - 'path': '/' - }, - '/example': { - protocol: null, - slashes: null, - auth: null, - host: null, - port: null, - hostname: null, - hash: null, - search: '', - query: {}, - pathname: '/example', - path: '/example', - href: '/example' - }, - '/example?query=value':{ - protocol: null, - slashes: null, - auth: null, - host: null, - port: null, - hostname: null, - hash: null, - search: '?query=value', - query: { query: 'value' }, - pathname: '/example', - path: '/example?query=value', - href: '/example?query=value' - } -}; - -Object.keys(parseTestsWithQueryString).forEach(function(u) { - test('parse(' + u + ')', function() { - var actual = url.parse(u, true); - var expected = parseTestsWithQueryString[u]; - for (var i in actual) { - if (actual[i] === null && expected[i] === undefined) { - expected[i] = null; - } - } - - assert.deepEqual(actual, expected); - }); -}); - -// some extra formatting tests, just to verify -// that it'll format slightly wonky content to a valid url. -var formatTests = { - 'http://example.com?' : { - 'href': 'http://example.com/?', - 'protocol': 'http:', - 'slashes': true, - 'host': 'example.com', - 'hostname': 'example.com', - 'search': '?', - 'query': {}, - 'pathname': '/' - }, - 'http://example.com?foo=bar#frag' : { - 'href': 'http://example.com/?foo=bar#frag', - 'protocol': 'http:', - 'host': 'example.com', - 'hostname': 'example.com', - 'hash': '#frag', - 'search': '?foo=bar', - 'query': 'foo=bar', - 'pathname': '/' - }, - 'http://example.com?foo=@bar#frag' : { - 'href': 'http://example.com/?foo=@bar#frag', - 'protocol': 'http:', - 'host': 'example.com', - 'hostname': 'example.com', - 'hash': '#frag', - 'search': '?foo=@bar', - 'query': 'foo=@bar', - 'pathname': '/' - }, - 'http://example.com?foo=/bar/#frag' : { - 'href': 'http://example.com/?foo=/bar/#frag', - 'protocol': 'http:', - 'host': 'example.com', - 'hostname': 'example.com', - 'hash': '#frag', - 'search': '?foo=/bar/', - 'query': 'foo=/bar/', - 'pathname': '/' - }, - 'http://example.com?foo=?bar/#frag' : { - 'href': 'http://example.com/?foo=?bar/#frag', - 'protocol': 'http:', - 'host': 'example.com', - 'hostname': 'example.com', - 'hash': '#frag', - 'search': '?foo=?bar/', - 'query': 'foo=?bar/', - 'pathname': '/' - }, - 'http://example.com#frag=?bar/#frag' : { - 'href': 'http://example.com/#frag=?bar/#frag', - 'protocol': 'http:', - 'host': 'example.com', - 'hostname': 'example.com', - 'hash': '#frag=?bar/#frag', - 'pathname': '/' - }, - 'http://google.com" onload="alert(42)/' : { - 'href': 'http://google.com/%22%20onload=%22alert(42)/', - 'protocol': 'http:', - 'host': 'google.com', - 'pathname': '/%22%20onload=%22alert(42)/' - }, - 'http://a.com/a/b/c?s#h' : { - 'href': 'http://a.com/a/b/c?s#h', - 'protocol': 'http', - 'host': 'a.com', - 'pathname': 'a/b/c', - 'hash': 'h', - 'search': 's' - }, - 'xmpp:isaacschlueter@jabber.org' : { - 'href': 'xmpp:isaacschlueter@jabber.org', - 'protocol': 'xmpp:', - 'host': 'jabber.org', - 'auth': 'isaacschlueter', - 'hostname': 'jabber.org' - }, - 'http://atpass:foo%40bar@127.0.0.1/' : { - 'href': 'http://atpass:foo%40bar@127.0.0.1/', - 'auth': 'atpass:foo@bar', - 'hostname': '127.0.0.1', - 'protocol': 'http:', - 'pathname': '/' - }, - 'http://atslash%2F%40:%2F%40@foo/' : { - 'href': 'http://atslash%2F%40:%2F%40@foo/', - 'auth': 'atslash/@:/@', - 'hostname': 'foo', - 'protocol': 'http:', - 'pathname': '/' - }, - 'svn+ssh://foo/bar': { - 'href': 'svn+ssh://foo/bar', - 'hostname': 'foo', - 'protocol': 'svn+ssh:', - 'pathname': '/bar', - 'slashes': true - }, - 'dash-test://foo/bar': { - 'href': 'dash-test://foo/bar', - 'hostname': 'foo', - 'protocol': 'dash-test:', - 'pathname': '/bar', - 'slashes': true - }, - 'dash-test:foo/bar': { - 'href': 'dash-test:foo/bar', - 'hostname': 'foo', - 'protocol': 'dash-test:', - 'pathname': '/bar' - }, - 'dot.test://foo/bar': { - 'href': 'dot.test://foo/bar', - 'hostname': 'foo', - 'protocol': 'dot.test:', - 'pathname': '/bar', - 'slashes': true - }, - 'dot.test:foo/bar': { - 'href': 'dot.test:foo/bar', - 'hostname': 'foo', - 'protocol': 'dot.test:', - 'pathname': '/bar' - }, - // ipv6 support - 'coap:u:p@[::1]:61616/.well-known/r?n=Temperature': { - 'href': 'coap:u:p@[::1]:61616/.well-known/r?n=Temperature', - 'protocol': 'coap:', - 'auth': 'u:p', - 'hostname': '::1', - 'port': '61616', - 'pathname': '/.well-known/r', - 'search': 'n=Temperature' - }, - 'coap:[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:61616/s/stopButton': { - 'href': 'coap:[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:61616/s/stopButton', - 'protocol': 'coap', - 'host': '[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:61616', - 'pathname': '/s/stopButton' - }, - - // encode context-specific delimiters in path and query, but do not touch - // other non-delimiter chars like `%`. - // - - // `#`,`?` in path - '/path/to/%%23%3F+=&.txt?foo=theA1#bar' : { - href : '/path/to/%%23%3F+=&.txt?foo=theA1#bar', - pathname: '/path/to/%#?+=&.txt', - query: { - foo: 'theA1' - }, - hash: "#bar" - }, - - // `#`,`?` in path + `#` in query - '/path/to/%%23%3F+=&.txt?foo=the%231#bar' : { - href : '/path/to/%%23%3F+=&.txt?foo=the%231#bar', - pathname: '/path/to/%#?+=&.txt', - query: { - foo: 'the#1' - }, - hash: "#bar" - }, - - // `?` and `#` in path and search - 'http://ex.com/foo%3F100%m%23r?abc=the%231?&foo=bar#frag': { - href: 'http://ex.com/foo%3F100%m%23r?abc=the%231?&foo=bar#frag', - protocol: 'http:', - hostname: 'ex.com', - hash: '#frag', - search: '?abc=the#1?&foo=bar', - pathname: '/foo?100%m#r', - }, - - // `?` and `#` in search only - 'http://ex.com/fooA100%mBr?abc=the%231?&foo=bar#frag': { - href: 'http://ex.com/fooA100%mBr?abc=the%231?&foo=bar#frag', - protocol: 'http:', - hostname: 'ex.com', - hash: '#frag', - search: '?abc=the#1?&foo=bar', - pathname: '/fooA100%mBr', - } -}; - -Object.keys(formatTests).forEach(function(u) { - test('format(' + u + ')', function() { - var expect = formatTests[u].href; - delete formatTests[u].href; - var actual = url.format(u); - var actualObj = url.format(formatTests[u]); - assert.equal(actual, expect, - 'wonky format(' + u + ') == ' + expect + - '\nactual:' + actual); - assert.equal(actualObj, expect, - 'wonky format(' + JSON.stringify(formatTests[u]) + - ') == ' + expect + - '\nactual: ' + actualObj); - }); -}); - -/* - [from, path, expected] -*/ -var relativeTests = [ - ['/foo/bar/baz', 'quux', '/foo/bar/quux'], - ['/foo/bar/baz', 'quux/asdf', '/foo/bar/quux/asdf'], - ['/foo/bar/baz', 'quux/baz', '/foo/bar/quux/baz'], - ['/foo/bar/baz', '../quux/baz', '/foo/quux/baz'], - ['/foo/bar/baz', '/bar', '/bar'], - ['/foo/bar/baz/', 'quux', '/foo/bar/baz/quux'], - ['/foo/bar/baz/', 'quux/baz', '/foo/bar/baz/quux/baz'], - ['/foo/bar/baz', '../../../../../../../../quux/baz', '/quux/baz'], - ['/foo/bar/baz', '../../../../../../../quux/baz', '/quux/baz'], - ['/foo', '.', '/'], - ['/foo', '..', '/'], - ['/foo/', '.', '/foo/'], - ['/foo/', '..', '/'], - ['/foo/bar', '.', '/foo/'], - ['/foo/bar', '..', '/'], - ['/foo/bar/', '.', '/foo/bar/'], - ['/foo/bar/', '..', '/foo/'], - ['foo/bar', '../../../baz', '../../baz'], - ['foo/bar/', '../../../baz', '../baz'], - ['http://example.com/b//c//d;p?q#blarg', 'https:#hash2', 'https:///#hash2'], - ['http://example.com/b//c//d;p?q#blarg', - 'https:/p/a/t/h?s#hash2', - 'https://p/a/t/h?s#hash2'], - ['http://example.com/b//c//d;p?q#blarg', - 'https://u:p@h.com/p/a/t/h?s#hash2', - 'https://u:p@h.com/p/a/t/h?s#hash2'], - ['http://example.com/b//c//d;p?q#blarg', - 'https:/a/b/c/d', - 'https://a/b/c/d'], - ['http://example.com/b//c//d;p?q#blarg', - 'http:#hash2', - 'http://example.com/b//c//d;p?q#hash2'], - ['http://example.com/b//c//d;p?q#blarg', - 'http:/p/a/t/h?s#hash2', - 'http://example.com/p/a/t/h?s#hash2'], - ['http://example.com/b//c//d;p?q#blarg', - 'http://u:p@h.com/p/a/t/h?s#hash2', - 'http://u:p@h.com/p/a/t/h?s#hash2'], - ['http://example.com/b//c//d;p?q#blarg', - 'http:/a/b/c/d', - 'http://example.com/a/b/c/d'], - ['/foo/bar/baz', '/../etc/passwd', '/etc/passwd'] -]; - -relativeTests.forEach(function(relativeTest) { - test('resolve(' + [relativeTest[0], relativeTest[1]] + ')', function() { - var a = url.resolve(relativeTest[0], relativeTest[1]), - e = relativeTest[2]; - assert.equal(a, e, - 'resolve(' + [relativeTest[0], relativeTest[1]] + ') == ' + e + - '\n actual=' + a); - }); -}); - - -// https://github.com/joyent/node/issues/568 -[ - undefined, - null, - true, - false, - 0.0, - 0, - [], - {} -].forEach(function(val) { - test('parse(' + val + ')', function() { - assert.throws(function() { url.parse(val); }, TypeError); - }); -}); - - -// -// Tests below taken from Chiron -// http://code.google.com/p/chironjs/source/browse/trunk/src/test/http/url.js -// -// Copyright (c) 2002-2008 Kris Kowal -// used with permission under MIT License -// -// Changes marked with @isaacs - -var bases = [ - 'http://a/b/c/d;p?q', - 'http://a/b/c/d;p?q=1/2', - 'http://a/b/c/d;p=1/2?q', - 'fred:///s//a/b/c', - 'http:///s//a/b/c' -]; - -//[to, from, result] -var relativeTests2 = [ - // http://lists.w3.org/Archives/Public/uri/2004Feb/0114.html - ['../c', 'foo:a/b', 'foo:c'], - ['foo:.', 'foo:a', 'foo:'], - ['/foo/../../../bar', 'zz:abc', 'zz:/bar'], - ['/foo/../bar', 'zz:abc', 'zz:/bar'], - // @isaacs Disagree. Not how web browsers resolve this. - ['foo/../../../bar', 'zz:abc', 'zz:bar'], - // ['foo/../../../bar', 'zz:abc', 'zz:../../bar'], // @isaacs Added - ['foo/../bar', 'zz:abc', 'zz:bar'], - ['zz:.', 'zz:abc', 'zz:'], - ['/.', bases[0], 'http://a/'], - ['/.foo', bases[0], 'http://a/.foo'], - ['.foo', bases[0], 'http://a/b/c/.foo'], - - // http://gbiv.com/protocols/uri/test/rel_examples1.html - // examples from RFC 2396 - ['g:h', bases[0], 'g:h'], - ['g', bases[0], 'http://a/b/c/g'], - ['./g', bases[0], 'http://a/b/c/g'], - ['g/', bases[0], 'http://a/b/c/g/'], - ['/g', bases[0], 'http://a/g'], - ['//g', bases[0], 'http://g/'], - // changed with RFC 2396bis - //('?y', bases[0], 'http://a/b/c/d;p?y'], - ['?y', bases[0], 'http://a/b/c/d;p?y'], - ['g?y', bases[0], 'http://a/b/c/g?y'], - // changed with RFC 2396bis - //('#s', bases[0], CURRENT_DOC_URI + '#s'], - ['#s', bases[0], 'http://a/b/c/d;p?q#s'], - ['g#s', bases[0], 'http://a/b/c/g#s'], - ['g?y#s', bases[0], 'http://a/b/c/g?y#s'], - [';x', bases[0], 'http://a/b/c/;x'], - ['g;x', bases[0], 'http://a/b/c/g;x'], - ['g;x?y#s' , bases[0], 'http://a/b/c/g;x?y#s'], - // changed with RFC 2396bis - //('', bases[0], CURRENT_DOC_URI], - ['', bases[0], 'http://a/b/c/d;p?q'], - ['.', bases[0], 'http://a/b/c/'], - ['./', bases[0], 'http://a/b/c/'], - ['..', bases[0], 'http://a/b/'], - ['../', bases[0], 'http://a/b/'], - ['../g', bases[0], 'http://a/b/g'], - ['../..', bases[0], 'http://a/'], - ['../../', bases[0], 'http://a/'], - ['../../g' , bases[0], 'http://a/g'], - ['../../../g', bases[0], ('http://a/../g', 'http://a/g')], - ['../../../../g', bases[0], ('http://a/../../g', 'http://a/g')], - // changed with RFC 2396bis - //('/./g', bases[0], 'http://a/./g'], - ['/./g', bases[0], 'http://a/g'], - // changed with RFC 2396bis - //('/../g', bases[0], 'http://a/../g'], - ['/../g', bases[0], 'http://a/g'], - ['g.', bases[0], 'http://a/b/c/g.'], - ['.g', bases[0], 'http://a/b/c/.g'], - ['g..', bases[0], 'http://a/b/c/g..'], - ['..g', bases[0], 'http://a/b/c/..g'], - ['./../g', bases[0], 'http://a/b/g'], - ['./g/.', bases[0], 'http://a/b/c/g/'], - ['g/./h', bases[0], 'http://a/b/c/g/h'], - ['g/../h', bases[0], 'http://a/b/c/h'], - ['g;x=1/./y', bases[0], 'http://a/b/c/g;x=1/y'], - ['g;x=1/../y', bases[0], 'http://a/b/c/y'], - ['g?y/./x', bases[0], 'http://a/b/c/g?y/./x'], - ['g?y/../x', bases[0], 'http://a/b/c/g?y/../x'], - ['g#s/./x', bases[0], 'http://a/b/c/g#s/./x'], - ['g#s/../x', bases[0], 'http://a/b/c/g#s/../x'], - ['http:g', bases[0], ('http:g', 'http://a/b/c/g')], - ['http:', bases[0], ('http:', bases[0])], - // not sure where this one originated - ['/a/b/c/./../../g', bases[0], 'http://a/a/g'], - - // http://gbiv.com/protocols/uri/test/rel_examples2.html - // slashes in base URI's query args - ['g', bases[1], 'http://a/b/c/g'], - ['./g', bases[1], 'http://a/b/c/g'], - ['g/', bases[1], 'http://a/b/c/g/'], - ['/g', bases[1], 'http://a/g'], - ['//g', bases[1], 'http://g/'], - // changed in RFC 2396bis - //('?y', bases[1], 'http://a/b/c/?y'], - ['?y', bases[1], 'http://a/b/c/d;p?y'], - ['g?y', bases[1], 'http://a/b/c/g?y'], - ['g?y/./x' , bases[1], 'http://a/b/c/g?y/./x'], - ['g?y/../x', bases[1], 'http://a/b/c/g?y/../x'], - ['g#s', bases[1], 'http://a/b/c/g#s'], - ['g#s/./x' , bases[1], 'http://a/b/c/g#s/./x'], - ['g#s/../x', bases[1], 'http://a/b/c/g#s/../x'], - ['./', bases[1], 'http://a/b/c/'], - ['../', bases[1], 'http://a/b/'], - ['../g', bases[1], 'http://a/b/g'], - ['../../', bases[1], 'http://a/'], - ['../../g' , bases[1], 'http://a/g'], - - // http://gbiv.com/protocols/uri/test/rel_examples3.html - // slashes in path params - // all of these changed in RFC 2396bis - ['g', bases[2], 'http://a/b/c/d;p=1/g'], - ['./g', bases[2], 'http://a/b/c/d;p=1/g'], - ['g/', bases[2], 'http://a/b/c/d;p=1/g/'], - ['g?y', bases[2], 'http://a/b/c/d;p=1/g?y'], - [';x', bases[2], 'http://a/b/c/d;p=1/;x'], - ['g;x', bases[2], 'http://a/b/c/d;p=1/g;x'], - ['g;x=1/./y', bases[2], 'http://a/b/c/d;p=1/g;x=1/y'], - ['g;x=1/../y', bases[2], 'http://a/b/c/d;p=1/y'], - ['./', bases[2], 'http://a/b/c/d;p=1/'], - ['../', bases[2], 'http://a/b/c/'], - ['../g', bases[2], 'http://a/b/c/g'], - ['../../', bases[2], 'http://a/b/'], - ['../../g' , bases[2], 'http://a/b/g'], - - // http://gbiv.com/protocols/uri/test/rel_examples4.html - // double and triple slash, unknown scheme - ['g:h', bases[3], 'g:h'], - ['g', bases[3], 'fred:///s//a/b/g'], - ['./g', bases[3], 'fred:///s//a/b/g'], - ['g/', bases[3], 'fred:///s//a/b/g/'], - ['/g', bases[3], 'fred:///g'], // may change to fred:///s//a/g - ['//g', bases[3], 'fred://g'], // may change to fred:///s//g - ['//g/x', bases[3], 'fred://g/x'], // may change to fred:///s//g/x - ['///g', bases[3], 'fred:///g'], - ['./', bases[3], 'fred:///s//a/b/'], - ['../', bases[3], 'fred:///s//a/'], - ['../g', bases[3], 'fred:///s//a/g'], - - ['../../', bases[3], 'fred:///s//'], - ['../../g' , bases[3], 'fred:///s//g'], - ['../../../g', bases[3], 'fred:///s/g'], - // may change to fred:///s//a/../../../g - ['../../../../g', bases[3], 'fred:///g'], - - // http://gbiv.com/protocols/uri/test/rel_examples5.html - // double and triple slash, well-known scheme - ['g:h', bases[4], 'g:h'], - ['g', bases[4], 'http:///s//a/b/g'], - ['./g', bases[4], 'http:///s//a/b/g'], - ['g/', bases[4], 'http:///s//a/b/g/'], - ['/g', bases[4], 'http:///g'], // may change to http:///s//a/g - ['//g', bases[4], 'http://g/'], // may change to http:///s//g - ['//g/x', bases[4], 'http://g/x'], // may change to http:///s//g/x - ['///g', bases[4], 'http:///g'], - ['./', bases[4], 'http:///s//a/b/'], - ['../', bases[4], 'http:///s//a/'], - ['../g', bases[4], 'http:///s//a/g'], - ['../../', bases[4], 'http:///s//'], - ['../../g' , bases[4], 'http:///s//g'], - // may change to http:///s//a/../../g - ['../../../g', bases[4], 'http:///s/g'], - // may change to http:///s//a/../../../g - ['../../../../g', bases[4], 'http:///g'], - - // from Dan Connelly's tests in http://www.w3.org/2000/10/swap/uripath.py - ['bar:abc', 'foo:xyz', 'bar:abc'], - ['../abc', 'http://example/x/y/z', 'http://example/x/abc'], - ['http://example/x/abc', 'http://example2/x/y/z', 'http://example/x/abc'], - ['../r', 'http://ex/x/y/z', 'http://ex/x/r'], - ['q/r', 'http://ex/x/y', 'http://ex/x/q/r'], - ['q/r#s', 'http://ex/x/y', 'http://ex/x/q/r#s'], - ['q/r#s/t', 'http://ex/x/y', 'http://ex/x/q/r#s/t'], - ['ftp://ex/x/q/r', 'http://ex/x/y', 'ftp://ex/x/q/r'], - ['', 'http://ex/x/y', 'http://ex/x/y'], - ['', 'http://ex/x/y/', 'http://ex/x/y/'], - ['', 'http://ex/x/y/pdq', 'http://ex/x/y/pdq'], - ['z/', 'http://ex/x/y/', 'http://ex/x/y/z/'], - ['#Animal', - 'file:/swap/test/animal.rdf', - 'file:/swap/test/animal.rdf#Animal'], - ['../abc', 'file:/e/x/y/z', 'file:/e/x/abc'], - ['/example/x/abc', 'file:/example2/x/y/z', 'file:/example/x/abc'], - ['../r', 'file:/ex/x/y/z', 'file:/ex/x/r'], - ['/r', 'file:/ex/x/y/z', 'file:/r'], - ['q/r', 'file:/ex/x/y', 'file:/ex/x/q/r'], - ['q/r#s', 'file:/ex/x/y', 'file:/ex/x/q/r#s'], - ['q/r#', 'file:/ex/x/y', 'file:/ex/x/q/r#'], - ['q/r#s/t', 'file:/ex/x/y', 'file:/ex/x/q/r#s/t'], - ['ftp://ex/x/q/r', 'file:/ex/x/y', 'ftp://ex/x/q/r'], - ['', 'file:/ex/x/y', 'file:/ex/x/y'], - ['', 'file:/ex/x/y/', 'file:/ex/x/y/'], - ['', 'file:/ex/x/y/pdq', 'file:/ex/x/y/pdq'], - ['z/', 'file:/ex/x/y/', 'file:/ex/x/y/z/'], - ['file://meetings.example.com/cal#m1', - 'file:/devel/WWW/2000/10/swap/test/reluri-1.n3', - 'file://meetings.example.com/cal#m1'], - ['file://meetings.example.com/cal#m1', - 'file:/home/connolly/w3ccvs/WWW/2000/10/swap/test/reluri-1.n3', - 'file://meetings.example.com/cal#m1'], - ['./#blort', 'file:/some/dir/foo', 'file:/some/dir/#blort'], - ['./#', 'file:/some/dir/foo', 'file:/some/dir/#'], - // Ryan Lee - ['./', 'http://example/x/abc.efg', 'http://example/x/'], - - - // Graham Klyne's tests - // http://www.ninebynine.org/Software/HaskellUtils/Network/UriTest.xls - // 01-31 are from Connelly's cases - - // 32-49 - ['./q:r', 'http://ex/x/y', 'http://ex/x/q:r'], - ['./p=q:r', 'http://ex/x/y', 'http://ex/x/p=q:r'], - ['?pp/rr', 'http://ex/x/y?pp/qq', 'http://ex/x/y?pp/rr'], - ['y/z', 'http://ex/x/y?pp/qq', 'http://ex/x/y/z'], - ['local/qual@domain.org#frag', - 'mailto:local', - 'mailto:local/qual@domain.org#frag'], - ['more/qual2@domain2.org#frag', - 'mailto:local/qual1@domain1.org', - 'mailto:local/more/qual2@domain2.org#frag'], - ['y?q', 'http://ex/x/y?q', 'http://ex/x/y?q'], - ['/x/y?q', 'http://ex?p', 'http://ex/x/y?q'], - ['c/d', 'foo:a/b', 'foo:a/c/d'], - ['/c/d', 'foo:a/b', 'foo:/c/d'], - ['', 'foo:a/b?c#d', 'foo:a/b?c'], - ['b/c', 'foo:a', 'foo:b/c'], - ['../b/c', 'foo:/a/y/z', 'foo:/a/b/c'], - ['./b/c', 'foo:a', 'foo:b/c'], - ['/./b/c', 'foo:a', 'foo:/b/c'], - ['../../d', 'foo://a//b/c', 'foo://a/d'], - ['.', 'foo:a', 'foo:'], - ['..', 'foo:a', 'foo:'], - - // 50-57[cf. TimBL comments -- - // http://lists.w3.org/Archives/Public/uri/2003Feb/0028.html, - // http://lists.w3.org/Archives/Public/uri/2003Jan/0008.html) - ['abc', 'http://example/x/y%2Fz', 'http://example/x/abc'], - ['../../x%2Fabc', 'http://example/a/x/y/z', 'http://example/a/x%2Fabc'], - ['../x%2Fabc', 'http://example/a/x/y%2Fz', 'http://example/a/x%2Fabc'], - ['abc', 'http://example/x%2Fy/z', 'http://example/x%2Fy/abc'], - ['q%3Ar', 'http://ex/x/y', 'http://ex/x/q%3Ar'], - ['/x%2Fabc', 'http://example/x/y%2Fz', 'http://example/x%2Fabc'], - ['/x%2Fabc', 'http://example/x/y/z', 'http://example/x%2Fabc'], - ['/x%2Fabc', 'http://example/x/y%2Fz', 'http://example/x%2Fabc'], - - // 70-77 - ['local2@domain2', 'mailto:local1@domain1?query1', 'mailto:local2@domain2'], - ['local2@domain2?query2', - 'mailto:local1@domain1', - 'mailto:local2@domain2?query2'], - ['local2@domain2?query2', - 'mailto:local1@domain1?query1', - 'mailto:local2@domain2?query2'], - ['?query2', 'mailto:local@domain?query1', 'mailto:local@domain?query2'], - ['local@domain?query2', 'mailto:?query1', 'mailto:local@domain?query2'], - ['?query2', 'mailto:local@domain?query1', 'mailto:local@domain?query2'], - ['http://example/a/b?c/../d', 'foo:bar', 'http://example/a/b?c/../d'], - ['http://example/a/b#c/../d', 'foo:bar', 'http://example/a/b#c/../d'], - - // 82-88 - // @isaacs Disagree. Not how browsers do it. - // ['http:this', 'http://example.org/base/uri', 'http:this'], - // @isaacs Added - ['http:this', 'http://example.org/base/uri', 'http://example.org/base/this'], - ['http:this', 'http:base', 'http:this'], - ['.//g', 'f:/a', 'f://g'], - ['b/c//d/e', 'f://example.org/base/a', 'f://example.org/base/b/c//d/e'], - ['m2@example.ord/c2@example.org', - 'mid:m@example.ord/c@example.org', - 'mid:m@example.ord/m2@example.ord/c2@example.org'], - ['mini1.xml', - 'file:///C:/DEV/Haskell/lib/HXmlToolbox-3.01/examples/', - 'file:///C:/DEV/Haskell/lib/HXmlToolbox-3.01/examples/mini1.xml'], - ['../b/c', 'foo:a/y/z', 'foo:a/b/c'], - - //changeing auth - ['http://diff:auth@www.example.com', - 'http://asdf:qwer@www.example.com', - 'http://diff:auth@www.example.com/'] -]; - -relativeTests2.forEach(function(relativeTest) { - test('resolve(' + [relativeTest[1], relativeTest[0]] + ')', function() { - var a = url.resolve(relativeTest[1], relativeTest[0]), - e = relativeTest[2]; - assert.equal(a, e, - 'resolve(' + [relativeTest[1], relativeTest[0]] + ') == ' + e + - '\n actual=' + a); - }); -}); - -//if format and parse are inverse operations then -//resolveObject(parse(x), y) == parse(resolve(x, y)) - -//host and hostname are special, in this case a '' value is important -var emptyIsImportant = {'host': true, 'hostname': ''}; - -//format: [from, path, expected] -relativeTests.forEach(function(relativeTest) { -test('resolveObject(' + [relativeTest[0], relativeTest[1]] + ')', function() { - var actual = url.resolveObject(url.parse(relativeTest[0]), relativeTest[1]), - expected = url.parse(relativeTest[2]); - - - assert.deepEqual(actual, expected); - - expected = relativeTest[2]; - actual = url.format(actual); - - assert.equal(actual, expected, - 'format(' + actual + ') == ' + expected + '\nactual:' + actual); - }); -}); - -//format: [to, from, result] -// the test: ['.//g', 'f:/a', 'f://g'] is a fundamental problem -// url.parse('f:/a') does not have a host -// url.resolve('f:/a', './/g') does not have a host because you have moved -// down to the g directory. i.e. f: //g, however when this url is parsed -// f:// will indicate that the host is g which is not the case. -// it is unclear to me how to keep this information from being lost -// it may be that a pathname of ////g should collapse to /g but this seems -// to be a lot of work for an edge case. Right now I remove the test -if (relativeTests2[181][0] === './/g' && - relativeTests2[181][1] === 'f:/a' && - relativeTests2[181][2] === 'f://g') { - relativeTests2.splice(181, 1); -} - -relativeTests2.forEach(function(relativeTest) { - test('resolveObject(' + [relativeTest[1], relativeTest[0]] + ')', function() { - var actual = url.resolveObject(url.parse(relativeTest[1]), relativeTest[0]), - expected = url.parse(relativeTest[2]); - - assert.deepEqual(actual, expected); - - var expected = relativeTest[2], - actual = url.format(actual); - - assert.equal(actual, expected, - 'format(' + relativeTest[1] + ') == ' + expected + - '\nactual:' + actual); - }); -}); diff --git a/node_modules/url/url.js b/node_modules/url/url.js deleted file mode 100644 index 23ac6f5db..000000000 --- a/node_modules/url/url.js +++ /dev/null @@ -1,732 +0,0 @@ -// 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. - -'use strict'; - -var punycode = require('punycode'); -var util = require('./util'); - -exports.parse = urlParse; -exports.resolve = urlResolve; -exports.resolveObject = urlResolveObject; -exports.format = urlFormat; - -exports.Url = Url; - -function Url() { - this.protocol = null; - this.slashes = null; - this.auth = null; - this.host = null; - this.port = null; - this.hostname = null; - this.hash = null; - this.search = null; - this.query = null; - this.pathname = null; - this.path = null; - this.href = null; -} - -// Reference: RFC 3986, RFC 1808, RFC 2396 - -// define these here so at least they only have to be -// compiled once on the first module load. -var protocolPattern = /^([a-z0-9.+-]+:)/i, - portPattern = /:[0-9]*$/, - - // Special case for a simple path URL - simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, - - // RFC 2396: characters reserved for delimiting URLs. - // We actually just auto-escape these. - delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], - - // RFC 2396: characters not allowed for various reasons. - unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), - - // Allowed by RFCs, but cause of XSS attacks. Always escape these. - autoEscape = ['\''].concat(unwise), - // Characters that are never ever allowed in a hostname. - // Note that any invalid chars are also handled, but these - // are the ones that are *expected* to be seen, so we fast-path - // them. - nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), - hostEndingChars = ['/', '?', '#'], - hostnameMaxLen = 255, - hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, - hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, - // protocols that can allow "unsafe" and "unwise" chars. - unsafeProtocol = { - 'javascript': true, - 'javascript:': true - }, - // protocols that never have a hostname. - hostlessProtocol = { - 'javascript': true, - 'javascript:': true - }, - // protocols that always contain a // bit. - slashedProtocol = { - 'http': true, - 'https': true, - 'ftp': true, - 'gopher': true, - 'file': true, - 'http:': true, - 'https:': true, - 'ftp:': true, - 'gopher:': true, - 'file:': true - }, - querystring = require('querystring'); - -function urlParse(url, parseQueryString, slashesDenoteHost) { - if (url && util.isObject(url) && url instanceof Url) return url; - - var u = new Url; - u.parse(url, parseQueryString, slashesDenoteHost); - return u; -} - -Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { - if (!util.isString(url)) { - throw new TypeError("Parameter 'url' must be a string, not " + typeof url); - } - - // Copy chrome, IE, opera backslash-handling behavior. - // Back slashes before the query string get converted to forward slashes - // See: https://code.google.com/p/chromium/issues/detail?id=25916 - var queryIndex = url.indexOf('?'), - splitter = - (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', - uSplit = url.split(splitter), - slashRegex = /\\/g; - uSplit[0] = uSplit[0].replace(slashRegex, '/'); - url = uSplit.join(splitter); - - var rest = url; - - // trim before proceeding. - // This is to support parse stuff like " http://foo.com \n" - rest = rest.trim(); - - if (!slashesDenoteHost && url.split('#').length === 1) { - // Try fast path regexp - var simplePath = simplePathPattern.exec(rest); - if (simplePath) { - this.path = rest; - this.href = rest; - this.pathname = simplePath[1]; - if (simplePath[2]) { - this.search = simplePath[2]; - if (parseQueryString) { - this.query = querystring.parse(this.search.substr(1)); - } else { - this.query = this.search.substr(1); - } - } else if (parseQueryString) { - this.search = ''; - this.query = {}; - } - return this; - } - } - - var proto = protocolPattern.exec(rest); - if (proto) { - proto = proto[0]; - var lowerProto = proto.toLowerCase(); - this.protocol = lowerProto; - rest = rest.substr(proto.length); - } - - // figure out if it's got a host - // user@server is *always* interpreted as a hostname, and url - // resolution will treat //foo/bar as host=foo,path=bar because that's - // how the browser resolves relative URLs. - if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { - var slashes = rest.substr(0, 2) === '//'; - if (slashes && !(proto && hostlessProtocol[proto])) { - rest = rest.substr(2); - this.slashes = true; - } - } - - if (!hostlessProtocol[proto] && - (slashes || (proto && !slashedProtocol[proto]))) { - - // there's a hostname. - // the first instance of /, ?, ;, or # ends the host. - // - // If there is an @ in the hostname, then non-host chars *are* allowed - // to the left of the last @ sign, unless some host-ending character - // comes *before* the @-sign. - // URLs are obnoxious. - // - // ex: - // http://a@b@c/ => user:a@b host:c - // http://a@b?@c => user:a host:c path:/?@c - - // v0.12 TODO(isaacs): This is not quite how Chrome does things. - // Review our test case against browsers more comprehensively. - - // find the first instance of any hostEndingChars - var hostEnd = -1; - for (var i = 0; i < hostEndingChars.length; i++) { - var hec = rest.indexOf(hostEndingChars[i]); - if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) - hostEnd = hec; - } - - // at this point, either we have an explicit point where the - // auth portion cannot go past, or the last @ char is the decider. - var auth, atSign; - if (hostEnd === -1) { - // atSign can be anywhere. - atSign = rest.lastIndexOf('@'); - } else { - // atSign must be in auth portion. - // http://a@b/c@d => host:b auth:a path:/c@d - atSign = rest.lastIndexOf('@', hostEnd); - } - - // Now we have a portion which is definitely the auth. - // Pull that off. - if (atSign !== -1) { - auth = rest.slice(0, atSign); - rest = rest.slice(atSign + 1); - this.auth = decodeURIComponent(auth); - } - - // the host is the remaining to the left of the first non-host char - hostEnd = -1; - for (var i = 0; i < nonHostChars.length; i++) { - var hec = rest.indexOf(nonHostChars[i]); - if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) - hostEnd = hec; - } - // if we still have not hit it, then the entire thing is a host. - if (hostEnd === -1) - hostEnd = rest.length; - - this.host = rest.slice(0, hostEnd); - rest = rest.slice(hostEnd); - - // pull out port. - this.parseHost(); - - // we've indicated that there is a hostname, - // so even if it's empty, it has to be present. - this.hostname = this.hostname || ''; - - // if hostname begins with [ and ends with ] - // assume that it's an IPv6 address. - var ipv6Hostname = this.hostname[0] === '[' && - this.hostname[this.hostname.length - 1] === ']'; - - // validate a little. - if (!ipv6Hostname) { - var hostparts = this.hostname.split(/\./); - for (var i = 0, l = hostparts.length; i < l; i++) { - var part = hostparts[i]; - if (!part) continue; - if (!part.match(hostnamePartPattern)) { - var newpart = ''; - for (var j = 0, k = part.length; j < k; j++) { - if (part.charCodeAt(j) > 127) { - // we replace non-ASCII char with a temporary placeholder - // we need this to make sure size of hostname is not - // broken by replacing non-ASCII by nothing - newpart += 'x'; - } else { - newpart += part[j]; - } - } - // we test again with ASCII char only - if (!newpart.match(hostnamePartPattern)) { - var validParts = hostparts.slice(0, i); - var notHost = hostparts.slice(i + 1); - var bit = part.match(hostnamePartStart); - if (bit) { - validParts.push(bit[1]); - notHost.unshift(bit[2]); - } - if (notHost.length) { - rest = '/' + notHost.join('.') + rest; - } - this.hostname = validParts.join('.'); - break; - } - } - } - } - - if (this.hostname.length > hostnameMaxLen) { - this.hostname = ''; - } else { - // hostnames are always lower case. - this.hostname = this.hostname.toLowerCase(); - } - - if (!ipv6Hostname) { - // IDNA Support: Returns a punycoded representation of "domain". - // It only converts parts of the domain name that - // have non-ASCII characters, i.e. it doesn't matter if - // you call it with a domain that already is ASCII-only. - this.hostname = punycode.toASCII(this.hostname); - } - - var p = this.port ? ':' + this.port : ''; - var h = this.hostname || ''; - this.host = h + p; - this.href += this.host; - - // strip [ and ] from the hostname - // the host field still retains them, though - if (ipv6Hostname) { - this.hostname = this.hostname.substr(1, this.hostname.length - 2); - if (rest[0] !== '/') { - rest = '/' + rest; - } - } - } - - // now rest is set to the post-host stuff. - // chop off any delim chars. - if (!unsafeProtocol[lowerProto]) { - - // First, make 100% sure that any "autoEscape" chars get - // escaped, even if encodeURIComponent doesn't think they - // need to be. - for (var i = 0, l = autoEscape.length; i < l; i++) { - var ae = autoEscape[i]; - if (rest.indexOf(ae) === -1) - continue; - var esc = encodeURIComponent(ae); - if (esc === ae) { - esc = escape(ae); - } - rest = rest.split(ae).join(esc); - } - } - - - // chop off from the tail first. - var hash = rest.indexOf('#'); - if (hash !== -1) { - // got a fragment string. - this.hash = rest.substr(hash); - rest = rest.slice(0, hash); - } - var qm = rest.indexOf('?'); - if (qm !== -1) { - this.search = rest.substr(qm); - this.query = rest.substr(qm + 1); - if (parseQueryString) { - this.query = querystring.parse(this.query); - } - rest = rest.slice(0, qm); - } else if (parseQueryString) { - // no query string, but parseQueryString still requested - this.search = ''; - this.query = {}; - } - if (rest) this.pathname = rest; - if (slashedProtocol[lowerProto] && - this.hostname && !this.pathname) { - this.pathname = '/'; - } - - //to support http.request - if (this.pathname || this.search) { - var p = this.pathname || ''; - var s = this.search || ''; - this.path = p + s; - } - - // finally, reconstruct the href based on what has been validated. - this.href = this.format(); - return this; -}; - -// format a parsed object into a url string -function urlFormat(obj) { - // ensure it's an object, and not a string url. - // If it's an obj, this is a no-op. - // this way, you can call url_format() on strings - // to clean up potentially wonky urls. - if (util.isString(obj)) obj = urlParse(obj); - if (!(obj instanceof Url)) return Url.prototype.format.call(obj); - return obj.format(); -} - -Url.prototype.format = function() { - var auth = this.auth || ''; - if (auth) { - auth = encodeURIComponent(auth); - auth = auth.replace(/%3A/i, ':'); - auth += '@'; - } - - var protocol = this.protocol || '', - pathname = this.pathname || '', - hash = this.hash || '', - host = false, - query = ''; - - if (this.host) { - host = auth + this.host; - } else if (this.hostname) { - host = auth + (this.hostname.indexOf(':') === -1 ? - this.hostname : - '[' + this.hostname + ']'); - if (this.port) { - host += ':' + this.port; - } - } - - if (this.query && - util.isObject(this.query) && - Object.keys(this.query).length) { - query = querystring.stringify(this.query); - } - - var search = this.search || (query && ('?' + query)) || ''; - - if (protocol && protocol.substr(-1) !== ':') protocol += ':'; - - // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. - // unless they had them to begin with. - if (this.slashes || - (!protocol || slashedProtocol[protocol]) && host !== false) { - host = '//' + (host || ''); - if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; - } else if (!host) { - host = ''; - } - - if (hash && hash.charAt(0) !== '#') hash = '#' + hash; - if (search && search.charAt(0) !== '?') search = '?' + search; - - pathname = pathname.replace(/[?#]/g, function(match) { - return encodeURIComponent(match); - }); - search = search.replace('#', '%23'); - - return protocol + host + pathname + search + hash; -}; - -function urlResolve(source, relative) { - return urlParse(source, false, true).resolve(relative); -} - -Url.prototype.resolve = function(relative) { - return this.resolveObject(urlParse(relative, false, true)).format(); -}; - -function urlResolveObject(source, relative) { - if (!source) return relative; - return urlParse(source, false, true).resolveObject(relative); -} - -Url.prototype.resolveObject = function(relative) { - if (util.isString(relative)) { - var rel = new Url(); - rel.parse(relative, false, true); - relative = rel; - } - - var result = new Url(); - var tkeys = Object.keys(this); - for (var tk = 0; tk < tkeys.length; tk++) { - var tkey = tkeys[tk]; - result[tkey] = this[tkey]; - } - - // hash is always overridden, no matter what. - // even href="" will remove it. - result.hash = relative.hash; - - // if the relative url is empty, then there's nothing left to do here. - if (relative.href === '') { - result.href = result.format(); - return result; - } - - // hrefs like //foo/bar always cut to the protocol. - if (relative.slashes && !relative.protocol) { - // take everything except the protocol from relative - var rkeys = Object.keys(relative); - for (var rk = 0; rk < rkeys.length; rk++) { - var rkey = rkeys[rk]; - if (rkey !== 'protocol') - result[rkey] = relative[rkey]; - } - - //urlParse appends trailing / to urls like http://www.example.com - if (slashedProtocol[result.protocol] && - result.hostname && !result.pathname) { - result.path = result.pathname = '/'; - } - - result.href = result.format(); - return result; - } - - if (relative.protocol && relative.protocol !== result.protocol) { - // if it's a known url protocol, then changing - // the protocol does weird things - // first, if it's not file:, then we MUST have a host, - // and if there was a path - // to begin with, then we MUST have a path. - // if it is file:, then the host is dropped, - // because that's known to be hostless. - // anything else is assumed to be absolute. - if (!slashedProtocol[relative.protocol]) { - var keys = Object.keys(relative); - for (var v = 0; v < keys.length; v++) { - var k = keys[v]; - result[k] = relative[k]; - } - result.href = result.format(); - return result; - } - - result.protocol = relative.protocol; - if (!relative.host && !hostlessProtocol[relative.protocol]) { - var relPath = (relative.pathname || '').split('/'); - while (relPath.length && !(relative.host = relPath.shift())); - if (!relative.host) relative.host = ''; - if (!relative.hostname) relative.hostname = ''; - if (relPath[0] !== '') relPath.unshift(''); - if (relPath.length < 2) relPath.unshift(''); - result.pathname = relPath.join('/'); - } else { - result.pathname = relative.pathname; - } - result.search = relative.search; - result.query = relative.query; - result.host = relative.host || ''; - result.auth = relative.auth; - result.hostname = relative.hostname || relative.host; - result.port = relative.port; - // to support http.request - if (result.pathname || result.search) { - var p = result.pathname || ''; - var s = result.search || ''; - result.path = p + s; - } - result.slashes = result.slashes || relative.slashes; - result.href = result.format(); - return result; - } - - var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), - isRelAbs = ( - relative.host || - relative.pathname && relative.pathname.charAt(0) === '/' - ), - mustEndAbs = (isRelAbs || isSourceAbs || - (result.host && relative.pathname)), - removeAllDots = mustEndAbs, - srcPath = result.pathname && result.pathname.split('/') || [], - relPath = relative.pathname && relative.pathname.split('/') || [], - psychotic = result.protocol && !slashedProtocol[result.protocol]; - - // if the url is a non-slashed url, then relative - // links like ../.. should be able - // to crawl up to the hostname, as well. This is strange. - // result.protocol has already been set by now. - // Later on, put the first path part into the host field. - if (psychotic) { - result.hostname = ''; - result.port = null; - if (result.host) { - if (srcPath[0] === '') srcPath[0] = result.host; - else srcPath.unshift(result.host); - } - result.host = ''; - if (relative.protocol) { - relative.hostname = null; - relative.port = null; - if (relative.host) { - if (relPath[0] === '') relPath[0] = relative.host; - else relPath.unshift(relative.host); - } - relative.host = null; - } - mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); - } - - if (isRelAbs) { - // it's absolute. - result.host = (relative.host || relative.host === '') ? - relative.host : result.host; - result.hostname = (relative.hostname || relative.hostname === '') ? - relative.hostname : result.hostname; - result.search = relative.search; - result.query = relative.query; - srcPath = relPath; - // fall through to the dot-handling below. - } else if (relPath.length) { - // it's relative - // throw away the existing file, and take the new path instead. - if (!srcPath) srcPath = []; - srcPath.pop(); - srcPath = srcPath.concat(relPath); - result.search = relative.search; - result.query = relative.query; - } else if (!util.isNullOrUndefined(relative.search)) { - // just pull out the search. - // like href='?foo'. - // Put this after the other two cases because it simplifies the booleans - if (psychotic) { - result.hostname = result.host = srcPath.shift(); - //occationaly the auth can get stuck only in host - //this especially happens in cases like - //url.resolveObject('mailto:local1@domain1', 'local2@domain2') - var authInHost = result.host && result.host.indexOf('@') > 0 ? - result.host.split('@') : false; - if (authInHost) { - result.auth = authInHost.shift(); - result.host = result.hostname = authInHost.shift(); - } - } - result.search = relative.search; - result.query = relative.query; - //to support http.request - if (!util.isNull(result.pathname) || !util.isNull(result.search)) { - result.path = (result.pathname ? result.pathname : '') + - (result.search ? result.search : ''); - } - result.href = result.format(); - return result; - } - - if (!srcPath.length) { - // no path at all. easy. - // we've already handled the other stuff above. - result.pathname = null; - //to support http.request - if (result.search) { - result.path = '/' + result.search; - } else { - result.path = null; - } - result.href = result.format(); - return result; - } - - // if a url ENDs in . or .., then it must get a trailing slash. - // however, if it ends in anything else non-slashy, - // then it must NOT get a trailing slash. - var last = srcPath.slice(-1)[0]; - var hasTrailingSlash = ( - (result.host || relative.host || srcPath.length > 1) && - (last === '.' || last === '..') || last === ''); - - // strip single dots, resolve double dots to parent dir - // if the path tries to go above the root, `up` ends up > 0 - var up = 0; - for (var i = srcPath.length; i >= 0; i--) { - last = srcPath[i]; - if (last === '.') { - srcPath.splice(i, 1); - } else if (last === '..') { - srcPath.splice(i, 1); - up++; - } else if (up) { - srcPath.splice(i, 1); - up--; - } - } - - // if the path is allowed to go above the root, restore leading ..s - if (!mustEndAbs && !removeAllDots) { - for (; up--; up) { - srcPath.unshift('..'); - } - } - - if (mustEndAbs && srcPath[0] !== '' && - (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { - srcPath.unshift(''); - } - - if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { - srcPath.push(''); - } - - var isAbsolute = srcPath[0] === '' || - (srcPath[0] && srcPath[0].charAt(0) === '/'); - - // put the host back - if (psychotic) { - result.hostname = result.host = isAbsolute ? '' : - srcPath.length ? srcPath.shift() : ''; - //occationaly the auth can get stuck only in host - //this especially happens in cases like - //url.resolveObject('mailto:local1@domain1', 'local2@domain2') - var authInHost = result.host && result.host.indexOf('@') > 0 ? - result.host.split('@') : false; - if (authInHost) { - result.auth = authInHost.shift(); - result.host = result.hostname = authInHost.shift(); - } - } - - mustEndAbs = mustEndAbs || (result.host && srcPath.length); - - if (mustEndAbs && !isAbsolute) { - srcPath.unshift(''); - } - - if (!srcPath.length) { - result.pathname = null; - result.path = null; - } else { - result.pathname = srcPath.join('/'); - } - - //to support request.http - if (!util.isNull(result.pathname) || !util.isNull(result.search)) { - result.path = (result.pathname ? result.pathname : '') + - (result.search ? result.search : ''); - } - result.auth = relative.auth || result.auth; - result.slashes = result.slashes || relative.slashes; - result.href = result.format(); - return result; -}; - -Url.prototype.parseHost = function() { - var host = this.host; - var port = portPattern.exec(host); - if (port) { - port = port[0]; - if (port !== ':') { - this.port = port.substr(1); - } - host = host.substr(0, host.length - port.length); - } - if (host) this.hostname = host; -}; diff --git a/node_modules/url/util.js b/node_modules/url/util.js deleted file mode 100644 index 97dcf31cd..000000000 --- a/node_modules/url/util.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -module.exports = { - isString: function(arg) { - return typeof(arg) === 'string'; - }, - isObject: function(arg) { - return typeof(arg) === 'object' && arg !== null; - }, - isNull: function(arg) { - return arg === null; - }, - isNullOrUndefined: function(arg) { - return arg == null; - } -}; diff --git a/node_modules/use/LICENSE b/node_modules/use/LICENSE deleted file mode 100644 index 7cccaf9e3..000000000 --- a/node_modules/use/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-present, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/use/README.md b/node_modules/use/README.md deleted file mode 100644 index 59b1dbd82..000000000 --- a/node_modules/use/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# use [![NPM version](https://img.shields.io/npm/v/use.svg?style=flat)](https://www.npmjs.com/package/use) [![NPM monthly downloads](https://img.shields.io/npm/dm/use.svg?style=flat)](https://npmjs.org/package/use) [![NPM total downloads](https://img.shields.io/npm/dt/use.svg?style=flat)](https://npmjs.org/package/use) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/use.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/use) - -> Easily add plugin support to your node.js application. - -Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save use -``` - -A different take on plugin handling! This is not a middleware system, if you need something that handles async middleware, [ware](https://github.com/segmentio/ware) is great for that. - -## Usage - -```js -const use = require('use'); -``` - -See the [examples folder](./examples) for usage examples. - -## About - -
    -Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -
    - -
    -Running Tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -
    - -
    -Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -
    - -### Related projects - -You might also be interested in these projects: - -* [base-plugins](https://www.npmjs.com/package/base-plugins): Adds 'smart plugin' support to your base application. | [homepage](https://github.com/node-base/base-plugins "Adds 'smart plugin' support to your base application.") -* [base](https://www.npmjs.com/package/base): Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks | [homepage](https://github.com/node-base/base "Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks") -* [ware](https://www.npmjs.com/package/ware): Easily create your own middleware layer. | [homepage](https://github.com/segmentio/ware "Easily create your own middleware layer.") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 37 | [jonschlinkert](https://github.com/jonschlinkert) | -| 7 | [charlike-old](https://github.com/charlike-old) | -| 2 | [doowb](https://github.com/doowb) | -| 2 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | - -### Author - -**Jon Schlinkert** - -* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) -* [GitHub Profile](https://github.com/jonschlinkert) -* [Twitter Profile](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 12, 2018._ \ No newline at end of file diff --git a/node_modules/use/index.js b/node_modules/use/index.js deleted file mode 100644 index 9a1eb4ee9..000000000 --- a/node_modules/use/index.js +++ /dev/null @@ -1,155 +0,0 @@ -/*! - * use - * - * Copyright (c) 2015-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -module.exports = function base(app, options) { - if (!isObject(app) && typeof app !== 'function') { - throw new TypeError('expected an object or function'); - } - - var opts = isObject(options) ? options : {}; - var prop = typeof opts.prop === 'string' ? opts.prop : 'fns'; - if (!Array.isArray(app[prop])) { - define(app, prop, []); - } - - /** - * Define a plugin function to be passed to use. The only - * parameter exposed to the plugin is `app`, the object or function. - * passed to `use(app)`. `app` is also exposed as `this` in plugins. - * - * Additionally, **if a plugin returns a function, the function will - * be pushed onto the `fns` array**, allowing the plugin to be - * called at a later point by the `run` method. - * - * ```js - * var use = require('use'); - * - * // define a plugin - * function foo(app) { - * // do stuff - * } - * - * var app = function(){}; - * use(app); - * - * // register plugins - * app.use(foo); - * app.use(bar); - * app.use(baz); - * ``` - * @name .use - * @param {Function} `fn` plugin function to call - * @api public - */ - - define(app, 'use', use); - - /** - * Run all plugins on `fns`. Any plugin that returns a function - * when called by `use` is pushed onto the `fns` array. - * - * ```js - * var config = {}; - * app.run(config); - * ``` - * @name .run - * @param {Object} `value` Object to be modified by plugins. - * @return {Object} Returns the object passed to `run` - * @api public - */ - - define(app, 'run', function(val) { - if (!isObject(val)) return; - - if (!val.use || !val.run) { - define(val, prop, val[prop] || []); - define(val, 'use', use); - } - - if (!val[prop] || val[prop].indexOf(base) === -1) { - val.use(base); - } - - var self = this || app; - var fns = self[prop]; - var len = fns.length; - var idx = -1; - - while (++idx < len) { - val.use(fns[idx]); - } - return val; - }); - - /** - * Call plugin `fn`. If a function is returned push it into the - * `fns` array to be called by the `run` method. - */ - - function use(type, fn, options) { - var offset = 1; - - if (typeof type === 'string' || Array.isArray(type)) { - fn = wrap(type, fn); - offset++; - } else { - options = fn; - fn = type; - } - - if (typeof fn !== 'function') { - throw new TypeError('expected a function'); - } - - var self = this || app; - var fns = self[prop]; - - var args = [].slice.call(arguments, offset); - args.unshift(self); - - if (typeof opts.hook === 'function') { - opts.hook.apply(self, args); - } - - var val = fn.apply(self, args); - if (typeof val === 'function' && fns.indexOf(val) === -1) { - fns.push(val); - } - return self; - } - - /** - * Wrap a named plugin function so that it's only called on objects of the - * given `type` - * - * @param {String} `type` - * @param {Function} `fn` Plugin function - * @return {Function} - */ - - function wrap(type, fn) { - return function plugin() { - return this.type === type ? fn.apply(this, arguments) : plugin; - }; - } - - return app; -}; - -function isObject(val) { - return val && typeof val === 'object' && !Array.isArray(val); -} - -function define(obj, key, val) { - Object.defineProperty(obj, key, { - configurable: true, - writable: true, - value: val - }); -} diff --git a/node_modules/use/package.json b/node_modules/use/package.json deleted file mode 100644 index 4ed15ce55..000000000 --- a/node_modules/use/package.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "_from": "use@^3.1.0", - "_id": "use@3.1.1", - "_inBundle": false, - "_integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "_location": "/use", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "use@^3.1.0", - "name": "use", - "escapedName": "use", - "rawSpec": "^3.1.0", - "saveSpec": null, - "fetchSpec": "^3.1.0" - }, - "_requiredBy": [ - "/snapdragon" - ], - "_resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "_shasum": "d50c8cac79a19fbc20f2911f56eb973f4e10070f", - "_spec": "use@^3.1.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/snapdragon", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/use/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Brian Woodward", - "url": "https://twitter.com/doowb" - }, - { - "name": "Jon Schlinkert", - "url": "http://twitter.com/jonschlinkert" - }, - { - "name": "Olsten Larck", - "url": "https://i.am.charlike.online" - }, - { - "url": "https://github.com/wtgtybhertgeghgtwtg" - } - ], - "deprecated": false, - "description": "Easily add plugin support to your node.js application.", - "devDependencies": { - "base-plugins": "^1.0.0", - "define-property": "^2.0.0", - "extend-shallow": "^3.0.1", - "gulp": "^3.9.1", - "gulp-eslint": "^4.0.0", - "gulp-format-md": "^1.0.0", - "gulp-istanbul": "^1.1.2", - "gulp-mocha": "^3.0.1", - "mocha": "^4.0.1" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/jonschlinkert/use", - "keywords": [ - "use" - ], - "license": "MIT", - "main": "index.js", - "name": "use", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/use.git" - }, - "scripts": { - "test": "mocha" - }, - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "base", - "base-plugins", - "ware" - ] - }, - "reflinks": [ - "verb", - "ware" - ], - "lint": { - "reflinks": true - } - }, - "version": "3.1.1" -} diff --git a/node_modules/util-deprecate/History.md b/node_modules/util-deprecate/History.md deleted file mode 100644 index acc867537..000000000 --- a/node_modules/util-deprecate/History.md +++ /dev/null @@ -1,16 +0,0 @@ - -1.0.2 / 2015-10-07 -================== - - * use try/catch when checking `localStorage` (#3, @kumavis) - -1.0.1 / 2014-11-25 -================== - - * browser: use `console.warn()` for deprecation calls - * browser: more jsdocs - -1.0.0 / 2014-04-30 -================== - - * initial commit diff --git a/node_modules/util-deprecate/LICENSE b/node_modules/util-deprecate/LICENSE deleted file mode 100644 index 6a60e8c22..000000000 --- a/node_modules/util-deprecate/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/util-deprecate/README.md b/node_modules/util-deprecate/README.md deleted file mode 100644 index 75622fa7c..000000000 --- a/node_modules/util-deprecate/README.md +++ /dev/null @@ -1,53 +0,0 @@ -util-deprecate -============== -### The Node.js `util.deprecate()` function with browser support - -In Node.js, this module simply re-exports the `util.deprecate()` function. - -In the web browser (i.e. via browserify), a browser-specific implementation -of the `util.deprecate()` function is used. - - -## API - -A `deprecate()` function is the only thing exposed by this module. - -``` javascript -// setup: -exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead'); - - -// users see: -foo(); -// foo() is deprecated, use bar() instead -foo(); -foo(); -``` - - -## License - -(The MIT License) - -Copyright (c) 2014 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/util-deprecate/browser.js b/node_modules/util-deprecate/browser.js deleted file mode 100644 index 549ae2f06..000000000 --- a/node_modules/util-deprecate/browser.js +++ /dev/null @@ -1,67 +0,0 @@ - -/** - * Module exports. - */ - -module.exports = deprecate; - -/** - * Mark that a method should not be used. - * Returns a modified function which warns once by default. - * - * If `localStorage.noDeprecation = true` is set, then it is a no-op. - * - * If `localStorage.throwDeprecation = true` is set, then deprecated functions - * will throw an Error when invoked. - * - * If `localStorage.traceDeprecation = true` is set, then deprecated functions - * will invoke `console.trace()` instead of `console.error()`. - * - * @param {Function} fn - the function to deprecate - * @param {String} msg - the string to print to the console when `fn` is invoked - * @returns {Function} a new "deprecated" version of `fn` - * @api public - */ - -function deprecate (fn, msg) { - if (config('noDeprecation')) { - return fn; - } - - var warned = false; - function deprecated() { - if (!warned) { - if (config('throwDeprecation')) { - throw new Error(msg); - } else if (config('traceDeprecation')) { - console.trace(msg); - } else { - console.warn(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; -} - -/** - * Checks `localStorage` for boolean values for the given `name`. - * - * @param {String} name - * @returns {Boolean} - * @api private - */ - -function config (name) { - // accessing global.localStorage can trigger a DOMException in sandboxed iframes - try { - if (!global.localStorage) return false; - } catch (_) { - return false; - } - var val = global.localStorage[name]; - if (null == val) return false; - return String(val).toLowerCase() === 'true'; -} diff --git a/node_modules/util-deprecate/node.js b/node_modules/util-deprecate/node.js deleted file mode 100644 index 5e6fcff5d..000000000 --- a/node_modules/util-deprecate/node.js +++ /dev/null @@ -1,6 +0,0 @@ - -/** - * For Node.js, simply re-export the core `util.deprecate` function. - */ - -module.exports = require('util').deprecate; diff --git a/node_modules/util-deprecate/package.json b/node_modules/util-deprecate/package.json deleted file mode 100644 index aaaa696ce..000000000 --- a/node_modules/util-deprecate/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "_from": "util-deprecate@~1.0.1", - "_id": "util-deprecate@1.0.2", - "_inBundle": false, - "_integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "_location": "/util-deprecate", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "util-deprecate@~1.0.1", - "name": "util-deprecate", - "escapedName": "util-deprecate", - "rawSpec": "~1.0.1", - "saveSpec": null, - "fetchSpec": "~1.0.1" - }, - "_requiredBy": [ - "/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "_shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", - "_spec": "util-deprecate@~1.0.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/readable-stream", - "author": { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io/" - }, - "browser": "browser.js", - "bugs": { - "url": "https://github.com/TooTallNate/util-deprecate/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "The Node.js `util.deprecate()` function with browser support", - "homepage": "https://github.com/TooTallNate/util-deprecate", - "keywords": [ - "util", - "deprecate", - "browserify", - "browser", - "node" - ], - "license": "MIT", - "main": "node.js", - "name": "util-deprecate", - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/util-deprecate.git" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "version": "1.0.2" -} diff --git a/node_modules/util/LICENSE b/node_modules/util/LICENSE deleted file mode 100644 index e3d4e695a..000000000 --- a/node_modules/util/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. diff --git a/node_modules/util/README.md b/node_modules/util/README.md deleted file mode 100644 index 1c473d2cf..000000000 --- a/node_modules/util/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# util - -[![Build Status](https://travis-ci.org/defunctzombie/node-util.png?branch=master)](https://travis-ci.org/defunctzombie/node-util) - -node.js [util](http://nodejs.org/api/util.html) module as a module - -## install via [npm](npmjs.org) - -```shell -npm install util -``` - -## browser support - -This module also works in modern browsers. If you need legacy browser support you will need to polyfill ES5 features. diff --git a/node_modules/util/package.json b/node_modules/util/package.json deleted file mode 100644 index 6ac8e92b9..000000000 --- a/node_modules/util/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "_from": "util@~0.10.1", - "_id": "util@0.10.4", - "_inBundle": false, - "_integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", - "_location": "/util", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "util@~0.10.1", - "name": "util", - "escapedName": "util", - "rawSpec": "~0.10.1", - "saveSpec": null, - "fetchSpec": "~0.10.1" - }, - "_requiredBy": [ - "/browserify" - ], - "_resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", - "_shasum": "3aa0125bfe668a4672de58857d3ace27ecb76901", - "_spec": "util@~0.10.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "Joyent", - "url": "http://www.joyent.com" - }, - "browser": { - "./support/isBuffer.js": "./support/isBufferBrowser.js" - }, - "bugs": { - "url": "https://github.com/defunctzombie/node-util/issues" - }, - "bundleDependencies": false, - "dependencies": { - "inherits": "2.0.3" - }, - "deprecated": false, - "description": "Node.JS util module", - "devDependencies": { - "zuul": "~1.0.9" - }, - "files": [ - "util.js", - "support" - ], - "homepage": "https://github.com/defunctzombie/node-util", - "keywords": [ - "util" - ], - "license": "MIT", - "main": "./util.js", - "name": "util", - "repository": { - "type": "git", - "url": "git://github.com/defunctzombie/node-util.git" - }, - "scripts": { - "test": "node test/node/*.js && zuul test/browser/*.js" - }, - "version": "0.10.4" -} diff --git a/node_modules/util/support/isBuffer.js b/node_modules/util/support/isBuffer.js deleted file mode 100644 index ace9ac00d..000000000 --- a/node_modules/util/support/isBuffer.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function isBuffer(arg) { - return arg instanceof Buffer; -} diff --git a/node_modules/util/support/isBufferBrowser.js b/node_modules/util/support/isBufferBrowser.js deleted file mode 100644 index 0e1bee1eb..000000000 --- a/node_modules/util/support/isBufferBrowser.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = function isBuffer(arg) { - return arg && typeof arg === 'object' - && typeof arg.copy === 'function' - && typeof arg.fill === 'function' - && typeof arg.readUInt8 === 'function'; -} \ No newline at end of file diff --git a/node_modules/util/util.js b/node_modules/util/util.js deleted file mode 100644 index e0ea321d3..000000000 --- a/node_modules/util/util.js +++ /dev/null @@ -1,586 +0,0 @@ -// 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 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) { - // Allow for deprecating things in the process of starting up. - if (isUndefined(global.process)) { - return function() { - return exports.deprecate(fn, msg).apply(this, arguments); - }; - } - - if (process.noDeprecation === true) { - return fn; - } - - 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 = process.env.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 = require('./support/isBuffer'); - -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 = require('inherits'); - -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); -} diff --git a/node_modules/vm-browserify/.travis.yml b/node_modules/vm-browserify/.travis.yml deleted file mode 100644 index 987e4fc1b..000000000 --- a/node_modules/vm-browserify/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "stable" -sudo: false -before_script: - - export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start diff --git a/node_modules/vm-browserify/CHANGELOG.md b/node_modules/vm-browserify/CHANGELOG.md deleted file mode 100644 index a2ae96582..000000000 --- a/node_modules/vm-browserify/CHANGELOG.md +++ /dev/null @@ -1,16 +0,0 @@ -# vm-browserify Change Log -All notable changes to this project will be documented in this file. -This project adheres to [Semantic Versioning](http://semver.org/). - -## 1.1.0 - 2018-06-15 -* Add `vm.isContext(sandbox)`. (https://github.com/browserify/vm-browserify/commit/038c3cb33edcad9eec33aa8a8beae31b15c1a006) - -## 1.0.1 - 2018-04-13 -* Remove the `component-indexof` dependency. (https://github.com/browserify/vm-browserify/commit/0d9bd4c99f80db12c5c45e260a23ebfc51ec850d) - -## 1.0.0 - 2018-03-23 - -(This is not a breaking change.) - -* Make the `sandbox` argument to `runInNewContext` optional, like in Node. (https://github.com/browserify/vm-browserify/pull/13) -* Substituting `component-indexof` for deprecated `indexof`. (https://github.com/browserify/vm-browserify/pull/14) diff --git a/node_modules/vm-browserify/LICENSE b/node_modules/vm-browserify/LICENSE deleted file mode 100644 index ee27ba4b4..000000000 --- a/node_modules/vm-browserify/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/vm-browserify/example/run/bundle.js b/node_modules/vm-browserify/example/run/bundle.js deleted file mode 100644 index 5dbc43f41..000000000 --- a/node_modules/vm-browserify/example/run/bundle.js +++ /dev/null @@ -1,473 +0,0 @@ -var require = function (file, cwd) { - var resolved = require.resolve(file, cwd || '/'); - var mod = require.modules[resolved]; - if (!mod) throw new Error( - 'Failed to resolve module ' + file + ', tried ' + resolved - ); - var res = mod._cached ? mod._cached : mod(); - return res; -} - -require.paths = []; -require.modules = {}; -require.extensions = [".js",".coffee"]; - -require._core = { - 'assert': true, - 'events': true, - 'fs': true, - 'path': true, - 'vm': true -}; - -require.resolve = (function () { - return function (x, cwd) { - if (!cwd) cwd = '/'; - - if (require._core[x]) return x; - var path = require.modules.path(); - var y = cwd || '.'; - - if (x.match(/^(?:\.\.?\/|\/)/)) { - var m = loadAsFileSync(path.resolve(y, x)) - || loadAsDirectorySync(path.resolve(y, x)); - if (m) return m; - } - - var n = loadNodeModulesSync(x, y); - if (n) return n; - - throw new Error("Cannot find module '" + x + "'"); - - function loadAsFileSync (x) { - if (require.modules[x]) { - return x; - } - - for (var i = 0; i < require.extensions.length; i++) { - var ext = require.extensions[i]; - if (require.modules[x + ext]) return x + ext; - } - } - - function loadAsDirectorySync (x) { - x = x.replace(/\/+$/, ''); - var pkgfile = x + '/package.json'; - if (require.modules[pkgfile]) { - var pkg = require.modules[pkgfile](); - var b = pkg.browserify; - if (typeof b === 'object' && b.main) { - var m = loadAsFileSync(path.resolve(x, b.main)); - if (m) return m; - } - else if (typeof b === 'string') { - var m = loadAsFileSync(path.resolve(x, b)); - if (m) return m; - } - else if (pkg.main) { - var m = loadAsFileSync(path.resolve(x, pkg.main)); - if (m) return m; - } - } - - return loadAsFileSync(x + '/index'); - } - - function loadNodeModulesSync (x, start) { - var dirs = nodeModulesPathsSync(start); - for (var i = 0; i < dirs.length; i++) { - var dir = dirs[i]; - var m = loadAsFileSync(dir + '/' + x); - if (m) return m; - var n = loadAsDirectorySync(dir + '/' + x); - if (n) return n; - } - - var m = loadAsFileSync(x); - if (m) return m; - } - - function nodeModulesPathsSync (start) { - var parts; - if (start === '/') parts = [ '' ]; - else parts = path.normalize(start).split('/'); - - var dirs = []; - for (var i = parts.length - 1; i >= 0; i--) { - if (parts[i] === 'node_modules') continue; - var dir = parts.slice(0, i + 1).join('/') + '/node_modules'; - dirs.push(dir); - } - - return dirs; - } - }; -})(); - -require.alias = function (from, to) { - var path = require.modules.path(); - var res = null; - try { - res = require.resolve(from + '/package.json', '/'); - } - catch (err) { - res = require.resolve(from, '/'); - } - var basedir = path.dirname(res); - - var keys = (Object.keys || function (obj) { - var res = []; - for (var key in obj) res.push(key) - return res; - })(require.modules); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (key.slice(0, basedir.length + 1) === basedir + '/') { - var f = key.slice(basedir.length); - require.modules[to + f] = require.modules[basedir + f]; - } - else if (key === basedir) { - require.modules[to] = require.modules[basedir]; - } - } -}; - -require.define = function (filename, fn) { - var dirname = require._core[filename] - ? '' - : require.modules.path().dirname(filename) - ; - - var require_ = function (file) { - return require(file, dirname) - }; - require_.resolve = function (name) { - return require.resolve(name, dirname); - }; - require_.modules = require.modules; - require_.define = require.define; - var module_ = { exports : {} }; - - require.modules[filename] = function () { - require.modules[filename]._cached = module_.exports; - fn.call( - module_.exports, - require_, - module_, - module_.exports, - dirname, - filename - ); - require.modules[filename]._cached = module_.exports; - return module_.exports; - }; -}; - -if (typeof process === 'undefined') process = {}; - -if (!process.nextTick) process.nextTick = (function () { - var queue = []; - var canPost = typeof window !== 'undefined' - && window.postMessage && window.addEventListener - ; - - if (canPost) { - window.addEventListener('message', function (ev) { - if (ev.source === window && ev.data === 'browserify-tick') { - ev.stopPropagation(); - if (queue.length > 0) { - var fn = queue.shift(); - fn(); - } - } - }, true); - } - - return function (fn) { - if (canPost) { - queue.push(fn); - window.postMessage('browserify-tick', '*'); - } - else setTimeout(fn, 0); - }; -})(); - -if (!process.title) process.title = 'browser'; - -if (!process.binding) process.binding = function (name) { - if (name === 'evals') return require('vm') - else throw new Error('No such module') -}; - -if (!process.cwd) process.cwd = function () { return '.' }; - -require.define("path", function (require, module, exports, __dirname, __filename) { -function filter (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - if (fn(xs[i], i, xs)) res.push(xs[i]); - } - return res; -} - -// 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; 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; -} - -// Regex to split a filename into [*, dir, basename, ext] -// posix version -var splitPathRe = /^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/; - -// path.resolve([from ...], to) -// posix version -exports.resolve = function() { -var resolvedPath = '', - resolvedAbsolute = false; - -for (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) { - var path = (i >= 0) - ? arguments[i] - : process.cwd(); - - // Skip empty and invalid entries - if (typeof path !== 'string' || !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 = path.charAt(0) === '/', - trailingSlash = path.slice(-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.join = function() { - var paths = Array.prototype.slice.call(arguments, 0); - return exports.normalize(filter(paths, function(p, index) { - return p && typeof p === 'string'; - }).join('/')); -}; - - -exports.dirname = function(path) { - var dir = splitPathRe.exec(path)[1] || ''; - var isWindows = false; - if (!dir) { - // No dirname - return '.'; - } else if (dir.length === 1 || - (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) { - // It is just a slash or a drive letter with a slash - return dir; - } else { - // It is a full dirname, strip trailing slash - return dir.substring(0, dir.length - 1); - } -}; - - -exports.basename = function(path, ext) { - var f = splitPathRe.exec(path)[2] || ''; - // TODO: make this comparison case-insensitive on windows? - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; -}; - - -exports.extname = function(path) { - return splitPathRe.exec(path)[3] || ''; -}; - -}); - -require.define("vm", function (require, module, exports, __dirname, __filename) { -var Object_keys = function (obj) { - if (Object.keys) return Object.keys(obj) - else { - var res = []; - for (var key in obj) res.push(key) - return res; - } -}; - -var forEach = function (xs, fn) { - if (xs.forEach) return xs.forEach(fn) - else for (var i = 0; i < xs.length; i++) { - fn(xs[i], i, xs); - } -}; - -var Script = exports.Script = function NodeScript (code) { - if (!(this instanceof Script)) return new Script(code); - this.code = code; -}; - -var iframe = document.createElement('iframe'); -if (!iframe.style) iframe.style = {}; -iframe.style.display = 'none'; - -var iframeCapable = true; // until proven otherwise -if (navigator.appName === 'Microsoft Internet Explorer') { - var m = navigator.appVersion.match(/\bMSIE (\d+\.\d+);/); - if (m && parseFloat(m[1]) <= 9.0) { - iframeCapable = false; - } -} - -Script.prototype.runInNewContext = function (context) { - if (!context) context = {}; - - if (!iframeCapable) { - var keys = Object_keys(context); - var args = []; - for (var i = 0; i < keys.length; i++) { - args.push(context[keys[i]]); - } - - var fn = new Function(keys, 'return ' + this.code); - return fn.apply(null, args); - } - - document.body.appendChild(iframe); - - var win = iframe.contentWindow - || (window.frames && window.frames[window.frames.length - 1]) - || window[window.length - 1] - ; - - forEach(Object_keys(context), function (key) { - win[key] = context[key]; - iframe[key] = context[key]; - }); - - if (win.eval) { - // chrome and ff can just .eval() - var res = win.eval(this.code); - } - else { - // this works in IE9 but not anything newer - iframe.setAttribute('src', - 'javascript:__browserifyVmResult=(' + this.code + ')' - ); - if ('__browserifyVmResult' in win) { - var res = win.__browserifyVmResult; - } - else { - iframeCapable = false; - res = this.runInThisContext(context); - } - } - - forEach(Object_keys(win), function (key) { - context[key] = win[key]; - }); - - document.body.removeChild(iframe); - - return res; -}; - -Script.prototype.runInThisContext = function () { - return eval(this.code); // maybe... -}; - -Script.prototype.runInContext = function (context) { - // seems to be just runInNewContext on magical context objects which are - // otherwise indistinguishable from objects except plain old objects - // for the parameter segfaults node - return this.runInNewContext(context); -}; - -forEach(Object_keys(Script.prototype), function (name) { - exports[name] = Script[name] = function (code) { - var s = Script(code); - return s[name].apply(s, [].slice.call(arguments, 1)); - }; -}); - -exports.createScript = function (code) { - return exports.Script(code); -}; - -exports.createContext = Script.createContext = function (context) { - // not really sure what this one does - // seems to just make a shallow copy - var copy = {}; - forEach(Object_keys(context), function (key) { - copy[key] = context[key]; - }); - return copy; -}; - -}); - -require.define("/entry.js", function (require, module, exports, __dirname, __filename) { - var vm = require('vm'); - -$(function () { - var res = vm.runInNewContext('a + 5', { a : 100 }); - $('#res').text(res); -}); - -}); -require("/entry.js"); diff --git a/node_modules/vm-browserify/example/run/entry.js b/node_modules/vm-browserify/example/run/entry.js deleted file mode 100644 index c7d38918c..000000000 --- a/node_modules/vm-browserify/example/run/entry.js +++ /dev/null @@ -1,6 +0,0 @@ -var vm = require('vm'); - -$(function () { - var res = vm.runInNewContext('a + 5', { a : 100 }); - $('#res').text(res); -}); diff --git a/node_modules/vm-browserify/example/run/index.html b/node_modules/vm-browserify/example/run/index.html deleted file mode 100644 index 1ea094235..000000000 --- a/node_modules/vm-browserify/example/run/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - result = - - diff --git a/node_modules/vm-browserify/example/run/server.js b/node_modules/vm-browserify/example/run/server.js deleted file mode 100644 index 339d3eea0..000000000 --- a/node_modules/vm-browserify/example/run/server.js +++ /dev/null @@ -1,6 +0,0 @@ -var ecstatic = require('ecstatic')(__dirname); -var http = require('http'); -http.createServer(ecstatic).listen(8000); - -console.log('listening on :8000'); -console.log('# remember to run browserify entry.js -o bundle.js'); diff --git a/node_modules/vm-browserify/index.js b/node_modules/vm-browserify/index.js deleted file mode 100644 index 4292de776..000000000 --- a/node_modules/vm-browserify/index.js +++ /dev/null @@ -1,149 +0,0 @@ -var indexOf = function (xs, item) { - if (xs.indexOf) return xs.indexOf(item); - else for (var i = 0; i < xs.length; i++) { - if (xs[i] === item) return i; - } - return -1; -}; -var Object_keys = function (obj) { - if (Object.keys) return Object.keys(obj) - else { - var res = []; - for (var key in obj) res.push(key) - return res; - } -}; - -var forEach = function (xs, fn) { - if (xs.forEach) return xs.forEach(fn) - else for (var i = 0; i < xs.length; i++) { - fn(xs[i], i, xs); - } -}; - -var defineProp = (function() { - try { - Object.defineProperty({}, '_', {}); - return function(obj, name, value) { - Object.defineProperty(obj, name, { - writable: true, - enumerable: false, - configurable: true, - value: value - }) - }; - } catch(e) { - return function(obj, name, value) { - obj[name] = value; - }; - } -}()); - -var globals = ['Array', 'Boolean', 'Date', 'Error', 'EvalError', 'Function', -'Infinity', 'JSON', 'Math', 'NaN', 'Number', 'Object', 'RangeError', -'ReferenceError', 'RegExp', 'String', 'SyntaxError', 'TypeError', 'URIError', -'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent', 'escape', -'eval', 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'undefined', 'unescape']; - -function Context() {} -Context.prototype = {}; - -var Script = exports.Script = function NodeScript (code) { - if (!(this instanceof Script)) return new Script(code); - this.code = code; -}; - -Script.prototype.runInContext = function (context) { - if (!(context instanceof Context)) { - throw new TypeError("needs a 'context' argument."); - } - - var iframe = document.createElement('iframe'); - if (!iframe.style) iframe.style = {}; - iframe.style.display = 'none'; - - document.body.appendChild(iframe); - - var win = iframe.contentWindow; - var wEval = win.eval, wExecScript = win.execScript; - - if (!wEval && wExecScript) { - // win.eval() magically appears when this is called in IE: - wExecScript.call(win, 'null'); - wEval = win.eval; - } - - forEach(Object_keys(context), function (key) { - win[key] = context[key]; - }); - forEach(globals, function (key) { - if (context[key]) { - win[key] = context[key]; - } - }); - - var winKeys = Object_keys(win); - - var res = wEval.call(win, this.code); - - forEach(Object_keys(win), function (key) { - // Avoid copying circular objects like `top` and `window` by only - // updating existing context properties or new properties in the `win` - // that was only introduced after the eval. - if (key in context || indexOf(winKeys, key) === -1) { - context[key] = win[key]; - } - }); - - forEach(globals, function (key) { - if (!(key in context)) { - defineProp(context, key, win[key]); - } - }); - - document.body.removeChild(iframe); - - return res; -}; - -Script.prototype.runInThisContext = function () { - return eval(this.code); // maybe... -}; - -Script.prototype.runInNewContext = function (context) { - var ctx = Script.createContext(context); - var res = this.runInContext(ctx); - - if (context) { - forEach(Object_keys(ctx), function (key) { - context[key] = ctx[key]; - }); - } - - return res; -}; - -forEach(Object_keys(Script.prototype), function (name) { - exports[name] = Script[name] = function (code) { - var s = Script(code); - return s[name].apply(s, [].slice.call(arguments, 1)); - }; -}); - -exports.isContext = function (context) { - return context instanceof Context; -}; - -exports.createScript = function (code) { - return exports.Script(code); -}; - -exports.createContext = Script.createContext = function (context) { - var copy = new Context(); - if(typeof context === 'object') { - forEach(Object_keys(context), function (key) { - copy[key] = context[key]; - }); - } - return copy; -}; diff --git a/node_modules/vm-browserify/package.json b/node_modules/vm-browserify/package.json deleted file mode 100644 index 6090115da..000000000 --- a/node_modules/vm-browserify/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_from": "vm-browserify@^1.0.0", - "_id": "vm-browserify@1.1.0", - "_inBundle": false, - "_integrity": "sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw==", - "_location": "/vm-browserify", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "vm-browserify@^1.0.0", - "name": "vm-browserify", - "escapedName": "vm-browserify", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/browserify" - ], - "_resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.0.tgz", - "_shasum": "bd76d6a23323e2ca8ffa12028dc04559c75f9019", - "_spec": "vm-browserify@^1.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/browserify", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/vm-browserify/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "vm module for the browser", - "devDependencies": { - "browserify": "^16.1.1", - "tape": "~2.3.2", - "tape-run": "^3.0.4" - }, - "homepage": "https://github.com/substack/vm-browserify#readme", - "keywords": [ - "vm", - "browser", - "eval" - ], - "license": "MIT", - "main": "index.js", - "name": "vm-browserify", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/substack/vm-browserify.git" - }, - "scripts": { - "test": "browserify test/vm.js | tape-run" - }, - "version": "1.1.0" -} diff --git a/node_modules/vm-browserify/readme.markdown b/node_modules/vm-browserify/readme.markdown deleted file mode 100644 index 8707c3bc6..000000000 --- a/node_modules/vm-browserify/readme.markdown +++ /dev/null @@ -1,67 +0,0 @@ -# vm-browserify - -emulate node's vm module for the browser - -[![Build Status](https://travis-ci.org/browserify/vm-browserify.svg?branch=master)](https://travis-ci.org/browserify/vm-browserify) - -# example - -Just write some client-side javascript: - -``` js -var vm = require('vm'); - -$(function () { - var res = vm.runInNewContext('a + 5', { a : 100 }); - $('#res').text(res); -}); -``` - -compile it with [browserify](http://github.com/substack/node-browserify): - -``` -browserify entry.js -o bundle.js -``` - -then whip up some html: - -``` html - - - - - - - result = - - -``` - -and when you load the page you should see: - -``` -result = 105 -``` - -# methods - -## vm.runInNewContext(code, context={}) - -Evaluate some `code` in a new iframe with a `context`. - -Contexts are like wrapping your code in a `with()` except slightly less terrible -because the code is sandboxed into a new iframe. - -# install - -This module is depended upon by browserify, so you should just be able to -`require('vm')` and it will just work. However if you want to use this module -directly you can install it with [npm](http://npmjs.org): - -``` -npm install vm-browserify -``` - -# license - -MIT diff --git a/node_modules/vm-browserify/test/vm.js b/node_modules/vm-browserify/test/vm.js deleted file mode 100644 index ea8cd31be..000000000 --- a/node_modules/vm-browserify/test/vm.js +++ /dev/null @@ -1,35 +0,0 @@ -var test = require('tape'); -var vm = require('../'); - -test('vmRunInNewContext', function (t) { - t.plan(6); - - t.equal(vm.runInNewContext('a + 5', { a : 100 }), 105); - - (function () { - var vars = { x : 10 }; - t.equal(vm.runInNewContext('x++', vars), 10); - t.equal(vars.x, 11); - })(); - - (function () { - var vars = { x : 10 }; - t.equal(vm.runInNewContext('var y = 3; y + x++', vars), 13); - t.equal(vars.x, 11); - t.equal(vars.y, 3); - })(); - - t.end(); -}); - -test('vmRunInContext', function (t) { - t.plan(2); - - var context = vm.createContext({ foo: 1 }); - - vm.runInContext('var x = 1', context); - t.deepEqual(context, { foo: 1, x: 1 }); - - vm.runInContext('var y = 1', context); - t.deepEqual(context, { foo: 1, x: 1, y: 1 }); -}); diff --git a/node_modules/watchify-middleware/LICENSE.md b/node_modules/watchify-middleware/LICENSE.md deleted file mode 100644 index 89a78cf22..000000000 --- a/node_modules/watchify-middleware/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) -Copyright (c) 2015 Matt DesLauriers - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE -OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/node_modules/watchify-middleware/README.md b/node_modules/watchify-middleware/README.md deleted file mode 100644 index c96a3d735..000000000 --- a/node_modules/watchify-middleware/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# watchify-middleware - -[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges) - -A simple middleware for watchify which provides a few features for a better development experience: - -- suspends the server response so you are never served a stale or empty bundle -- removes the default 600ms delay (left up to the developer to reconfigure) -- emits timing information in a `'log'` event -- (optional) allows for a browser-based error handler (eg: print to DevTools console) - -For practical implementations, see [watchify-server](https://www.npmjs.com/package/watchify-server) or [budo](https://www.npmjs.com/package/budo). - -## Install - -```sh -npm install watchify-middleware --save -``` - -## Example - -```js -var watchifyMiddleware = require('watchify-middleware') -var defaultIndex = require('simple-html-index') - -var staticUrl = 'bundle.js' -var bundler = browserify('app.js', { - // config for watchify - cache: {}, - packageCache: {}, - basedir: __dirname -}) -var watchify = watchifyMiddleware(bundler) - -var server = http.createServer(function (req, res) { - if (req.url === '/') { - defaultIndex({ entry: staticUrl }).pipe(res) - } else if (req.url === '/' + staticUrl) { - watchify(req, res) - } -}) - -server.listen(8000, 'localhost', function () { - console.log('Listening on http://localhost:8000/') -}) -``` - -For a more complete example, see [example/server.js](example/server.js). - -## Usage - -[![NPM](https://nodei.co/npm/watchify-middleware.png)](https://www.npmjs.com/package/watchify-middleware) - -#### `middleware = watchifyMiddleware(browserify[, opt])` - -Returns a `middleware(req, res)` function from the given `browserify` bundler instance and options: - -- `delay` (default 0) a delay to debounce the rebuild, useful for things like git branch switches (where hundreds of files may change at once) -- `errorHandler` (default false) a boolean or function for handling errors -- `initialBundle` (default true) whether to initially bundle and emit `'pending'` - -`errorHandler` can be a function that accepts `(err)` parameter and optionally returns the new contents (String|Buffer) of the JavaScript bundle. If `errorHandler` is `true`, it will default to the following: - -```js -var stripAnsi = require('strip-ansi') - -function defaultErrorHandler (err) { - console.error('%s', err) - var msg = stripAnsi(err.message) - return ';console.error(' + JSON.stringify(msg) + ');' -} -``` - - (some plugins produce ANSI color codes in error messages) - -Otherwise, it assumes the normal behaviour for error handling (which is typically just an uncaught error event). - -#### `emitter = watchifyMiddleware.emitter(browserify[, opt])` - -The same as above, except this returns an EventEmitter for handling bundle updates. - -##### `emitter.middleware` - -The `middleware(req, res)` function for use in your server. - -##### `emitter.bundle()` - -Triggers a bundle event. Usually should only be called if `initialBundle` is set to false, to trigger the initial bundle. - -##### `emitter.on('pending', fn)` - -Called when watchify begins its incremental rebuild. - -##### `emitter.on('update', fn)` - -Called when bundling is finished, with parameter `(contents, rows)`. - -`contents` is a Buffer/String of the bundle and `rows` is a list of dependencies that have changed since last update. On first run, this will be an empty array. - -##### `emitter.on('log', fn)` - -Provides timing and server request logging, passing an `(event)` parameter. - -Server request logs look like this: - -```js -{ level: 'debug', type: 'request', message: 'bundle (pending|ready)'} -``` - -Bundle updates look like this: - -```js -{ elapsed: Number, level: 'info', type: 'bundle' } -``` - -These events work well with [garnish](https://github.com/mattdesl/garnish) and other ndjson-based tools. - -##### `emitter.on('error', fn)` - -If `errorHandler` was `fasle`, this will get triggered on bundle errors. If an error handler is being used, this will not get triggered. - -##### `emitter.on('bundle-error', fn)` - -This will get triggered on bundle errors, regardless of whether `errorHandler` is being used. This can be used to respond to syntax errors, such as showing a stylized notification. - -##### `emitter.close()` - -Closes the `watchify` instance and stops file watching. - -#### `version = watchifyMiddleware.getWatchifyVersion()` - -Primarily useful for debugging, this will return the *actual* version number of the `watchify` module being used by `watchify-middleware`. - -## running the demo - -To run the example, first git clone and install dependencies. - -```sh -git clone https://github.com/mattdesl/watchify-middleware.git -cd watchify-middleware -npm install -``` - -Then: - -```sh -npm start -``` - -And open [http://localhost:8000/](http://localhost:8000/). Try making changes to [example/app.js](example/app.js) and you will see timing information in console, and reloading the browser will provide the new bundle. - -## License - -MIT, see [LICENSE.md](http://github.com/mattdesl/watchify-middleware/blob/master/LICENSE.md) for details. diff --git a/node_modules/watchify-middleware/example/app.js b/node_modules/watchify-middleware/example/app.js deleted file mode 100644 index b5b757db7..000000000 --- a/node_modules/watchify-middleware/example/app.js +++ /dev/null @@ -1,5 +0,0 @@ -var url = require('url') -console.log(url.parse(window.location.href)) - -var file = require('fs').readFileSync(__dirname + '/../README.md', 'utf8') -console.log(file) \ No newline at end of file diff --git a/node_modules/watchify-middleware/example/server.js b/node_modules/watchify-middleware/example/server.js deleted file mode 100644 index 760e8dd1f..000000000 --- a/node_modules/watchify-middleware/example/server.js +++ /dev/null @@ -1,49 +0,0 @@ -var watchifyMiddleware = require('../') -var http = require('http') -var defaultIndex = require('simple-html-index') -var browserify = require('browserify') - -var staticUrl = 'bundle.js' -var bundler = browserify('app.js', { - // config for watchify - cache: {}, - transform: [ require('babelify'), 'brfs' ], - packageCache: {}, - debug: true, - basedir: __dirname -}) - -var watcher = watchifyMiddleware.emitter(bundler, { - errorHandler: true -}) - -watcher.on('pending', function () { - console.log('pending request') -}) - -watcher.on('update', function () { - console.log('update request') -}) - -watcher.on('log', function (ev) { - if (ev.elapsed) { - ev.elapsed = ev.elapsed + 'ms' - ev.url = staticUrl - } - ev.name = 'server' - console.log(JSON.stringify(ev)) -}) - -var middleware = watcher.middleware - -var server = http.createServer(function (req, res) { - if (req.url === '/') { - defaultIndex({ entry: staticUrl }).pipe(res) - } else if (req.url === '/' + staticUrl) { - middleware(req, res) - } -}) - -server.listen(8000, 'localhost', function () { - console.log('Listening on http://localhost:8000/') -}) diff --git a/node_modules/watchify-middleware/index.js b/node_modules/watchify-middleware/index.js deleted file mode 100644 index 59218d893..000000000 --- a/node_modules/watchify-middleware/index.js +++ /dev/null @@ -1,57 +0,0 @@ -var createBundler = require('./lib/bundler') - -module.exports = function watchifyMiddleware (browserify, opt) { - var emitter = createEmitter(browserify, opt) - return emitter.middleware -} - -module.exports.emitter = createEmitter - -module.exports.getWatchifyVersion = function () { - return require('watchify/package.json').version -} - -function createEmitter (browserify, opt) { - var bundler = createBundler(browserify, opt) - var pending = false - var contents = '' - - bundler.on('pending', function () { - pending = true - }) - - bundler.on('update', function (data) { - pending = false - contents = data - }) - - bundler.middleware = function middleware (req, res) { - if (pending) { - bundler.emit('log', { - level: 'debug', - type: 'request', - message: 'bundle pending' - }) - - bundler.once('update', function () { - bundler.emit('log', { - level: 'debug', - type: 'request', - message: 'bundle ready' - }) - submit(req, res) - }) - } else { - submit(req, res) - } - } - - return bundler - - function submit (req, res) { - res.setHeader('content-type', 'application/javascript; charset=utf-8') - res.setHeader('content-length', contents.length) - res.statusCode = req.statusCode || 200 - res.end(contents) - } -} diff --git a/node_modules/watchify-middleware/lib/bundler.js b/node_modules/watchify-middleware/lib/bundler.js deleted file mode 100644 index ed2520af7..000000000 --- a/node_modules/watchify-middleware/lib/bundler.js +++ /dev/null @@ -1,133 +0,0 @@ -var createWatchify = require('watchify') -var EventEmitter = require('events').EventEmitter -var debounce = require('debounce') -var concat = require('concat-stream') -var assign = require('object-assign') -var stripAnsi = require('strip-ansi') -var parseError = require('./parse-error') - -module.exports = bundler -function bundler (browserify, opt) { - opt = opt || {} - var emitter = new EventEmitter() - var delay = opt.delay || 0 - var closed = false - var pending = false - var time = Date.now() - var updates = [] - var errorHandler = opt.errorHandler - if (errorHandler === true) { - errorHandler = defaultErrorHandler - } - - var watchify = createWatchify(browserify, assign({}, opt, { - // we use our own debounce, so make sure watchify - // ignores theirs - delay: 0 - })) - var contents = null - - emitter.close = function () { - if (closed) return - closed = true - if (watchify) { - // needed for watchify@3.0.0 - // this needs to be revisited upstream - setTimeout(function () { - watchify.close() - }, 200) - } - } - - var bundleDebounced = debounce(bundle, delay) - watchify.on('update', function (rows) { - if (closed) return - updates = rows - pending = true - time = Date.now() - emitter.emit('pending', updates) - bundleDebounced() - }) - - emitter.bundle = function () { - if (closed) return - time = Date.now() - if (!pending) { - pending = true - process.nextTick(function () { - emitter.emit('pending', updates) - }) - } - bundle() - } - - // initial bundle - if (opt.initialBundle !== false) { - emitter.bundle() - } - - return emitter - - function bundle () { - if (closed) { - update() - return - } - - var didError = false - var outStream = concat(function (body) { - if (!didError) { - contents = body - - var delay = Date.now() - time - emitter.emit('log', { - contentLength: contents.length, - elapsed: Math.round(delay), - level: 'info', - type: 'bundle' - }) - - bundleEnd() - } - }) - - var wb = watchify.bundle() - // it can be nice to handle errors gracefully - if (typeof errorHandler === 'function') { - wb.once('error', function (err) { - err.message = parseError(err) - contents = errorHandler(err) || '' - - didError = true - emitter.emit('bundle-error', err) - bundleEnd() - }) - } else { - wb.once('error', function (err) { - err.message = parseError(err) - emitter.emit('error', err) - emitter.emit('bundle-error', err) - }) - } - wb.pipe(outStream) - - function bundleEnd () { - update() - } - } - - function update () { - if (closed) return - if (pending) { - pending = false - emitter.emit('update', contents, updates) - updates = [] - } - } -} - -function defaultErrorHandler (err) { - console.error('%s', err) - var msg = stripAnsi(err.message) - return ';console.error(' + JSON.stringify(msg) + ');' -} diff --git a/node_modules/watchify-middleware/lib/parse-error.js b/node_modules/watchify-middleware/lib/parse-error.js deleted file mode 100644 index b79e731bc..000000000 --- a/node_modules/watchify-middleware/lib/parse-error.js +++ /dev/null @@ -1,9 +0,0 @@ -// parses a syntax error for pretty-printing to console -module.exports = parseError -function parseError (err) { - if (err.codeFrame) { // babelify@6.x - return [err.message, err.codeFrame].join('\n\n') - } else { // babelify@5.x and browserify - return err.annotated || err.message - } -} diff --git a/node_modules/watchify-middleware/package.json b/node_modules/watchify-middleware/package.json deleted file mode 100644 index 2f7384abc..000000000 --- a/node_modules/watchify-middleware/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "_from": "watchify-middleware@^1.8.0", - "_id": "watchify-middleware@1.8.0", - "_inBundle": false, - "_integrity": "sha512-INYU5/3zTZtWQvJKPelr47j0JeLTZK4GUDF0PoMltMPzMUEh/lW6g1t+Qe/tGHxm70AUc0NQrth3k3PTfOU9Nw==", - "_location": "/watchify-middleware", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "watchify-middleware@^1.8.0", - "name": "watchify-middleware", - "escapedName": "watchify-middleware", - "rawSpec": "^1.8.0", - "saveSpec": null, - "fetchSpec": "^1.8.0" - }, - "_requiredBy": [ - "/budo" - ], - "_resolved": "https://registry.npmjs.org/watchify-middleware/-/watchify-middleware-1.8.0.tgz", - "_shasum": "8f7cb9c528022be8525a7e066c10e2fd8c544be6", - "_spec": "watchify-middleware@^1.8.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", - "author": { - "name": "Matt DesLauriers", - "email": "dave.des@gmail.com", - "url": "https://github.com/mattdesl" - }, - "bugs": { - "url": "https://github.com/mattdesl/watchify-middleware/issues" - }, - "bundleDependencies": false, - "dependencies": { - "concat-stream": "^1.5.0", - "debounce": "^1.0.0", - "events": "^1.0.2", - "object-assign": "^4.0.1", - "strip-ansi": "^3.0.0", - "watchify": "^3.3.1" - }, - "deprecated": false, - "description": "a server for faster watchify development", - "devDependencies": { - "babelify": "^6.3.0", - "brfs": "^1.4.1", - "browserify": "^11.2.0", - "faucet": "0.0.1", - "garnish": "^2.3.0", - "got": "^4.2.0", - "minimist": "^1.1.3", - "semver": "^5.0.3", - "simple-html-index": "^1.0.1", - "tape": "^4.2.0" - }, - "homepage": "https://github.com/mattdesl/watchify-middleware", - "keywords": [ - "watchify", - "server", - "fast", - "reload", - "incremental", - "suspend", - "request", - "response", - "wait", - "delay", - "live", - "browser", - "browserify" - ], - "license": "MIT", - "main": "index.js", - "name": "watchify-middleware", - "repository": { - "type": "git", - "url": "git://github.com/mattdesl/watchify-middleware.git" - }, - "scripts": { - "start": "node example/server.js ", - "test": "node test/index.js | faucet" - }, - "version": "1.8.0" -} diff --git a/node_modules/watchify/.travis.yml b/node_modules/watchify/.travis.yml deleted file mode 100644 index d76c6d0e3..000000000 --- a/node_modules/watchify/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -sudo: false -language: node_js -node_js: - - "0.10" - - "0.12" - - node diff --git a/node_modules/watchify/LICENSE b/node_modules/watchify/LICENSE deleted file mode 100644 index ee27ba4b4..000000000 --- a/node_modules/watchify/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/watchify/bin/args.js b/node_modules/watchify/bin/args.js deleted file mode 100644 index ccfdd3f8e..000000000 --- a/node_modules/watchify/bin/args.js +++ /dev/null @@ -1,16 +0,0 @@ -var fromArgs = require('browserify/bin/args'); -var watchify = require('../'); -var defined = require('defined'); -var xtend = require('xtend'); - -module.exports = function (args) { - var b = fromArgs(args, watchify.args); - - var opts = {}; - var ignoreWatch = defined(b.argv['ignore-watch'], b.argv.iw); - if (ignoreWatch) { - opts.ignoreWatch = ignoreWatch; - } - - return watchify(b, xtend(opts, b.argv)); -}; diff --git a/node_modules/watchify/bin/cmd.js b/node_modules/watchify/bin/cmd.js deleted file mode 100755 index 59a43eb26..000000000 --- a/node_modules/watchify/bin/cmd.js +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env node - -var path = require('path'); -var outpipe = require('outpipe'); -var through = require('through2'); - -var fromArgs = require('./args.js'); -var w = fromArgs(process.argv.slice(2)); - -var outfile = w.argv.o || w.argv.outfile; -var verbose = w.argv.v || w.argv.verbose; - -if (w.argv.version) { - console.error('watchify v' + require('../package.json').version + - ' (in ' + path.resolve(__dirname, '..') + ')' - ); - console.error('browserify v' + require('browserify/package.json').version + - ' (in ' + path.dirname(require.resolve('browserify')) + ')' - ); - return; -} - -if (!outfile) { - console.error('You MUST specify an outfile with -o.'); - process.exit(1); -} - -var bytes, time; -w.on('bytes', function (b) { bytes = b }); -w.on('time', function (t) { time = t }); - -w.on('update', bundle); -bundle(); - -function bundle () { - var didError = false; - var writer = through(); - var wb = w.bundle(); - - w.pipeline.get('pack').once('readable', function() { - if (!didError) { - wb.pipe(writer); - } - }); - - wb.on('error', function (err) { - console.error(String(err)); - if (!didError) { - didError = true; - writer.end('console.error(' + JSON.stringify(String(err)) + ');'); - } - }); - - writer.once('readable', function() { - var outStream = outpipe(outfile); - outStream.on('error', function (err) { - console.error(err); - }); - outStream.on('exit', function () { - if (verbose && !didError) { - console.error(bytes + ' bytes written to ' + outfile - + ' (' + (time / 1000).toFixed(2) + ' seconds) at ' - + new Date().toLocaleTimeString() - ); - } - }); - writer.pipe(outStream); - }); -} diff --git a/node_modules/watchify/example/files/main.js b/node_modules/watchify/example/files/main.js deleted file mode 100644 index a01098c10..000000000 --- a/node_modules/watchify/example/files/main.js +++ /dev/null @@ -1,2 +0,0 @@ -var one = require('./one'); -console.log(one(5)); diff --git a/node_modules/watchify/example/files/one.js b/node_modules/watchify/example/files/one.js deleted file mode 100644 index 75f7df68f..000000000 --- a/node_modules/watchify/example/files/one.js +++ /dev/null @@ -1,3 +0,0 @@ -var two = require('./two'); - -module.exports = function (x) { return x * two(x + 5) }; diff --git a/node_modules/watchify/example/files/two.js b/node_modules/watchify/example/files/two.js deleted file mode 100644 index 5d48ef2d0..000000000 --- a/node_modules/watchify/example/files/two.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = function (n) { return n * 11 }; diff --git a/node_modules/watchify/index.js b/node_modules/watchify/index.js deleted file mode 100644 index 0753b9f13..000000000 --- a/node_modules/watchify/index.js +++ /dev/null @@ -1,165 +0,0 @@ -var through = require('through2'); -var path = require('path'); -var chokidar = require('chokidar'); -var xtend = require('xtend'); -var anymatch = require('anymatch'); - -module.exports = watchify; -module.exports.args = { - cache: {}, packageCache: {} -}; - -function watchify (b, opts) { - if (!opts) opts = {}; - var cache = b._options.cache; - var pkgcache = b._options.packageCache; - var delay = typeof opts.delay === 'number' ? opts.delay : 100; - var changingDeps = {}; - var pending = false; - var updating = false; - - var wopts = {persistent: true}; - if (opts.ignoreWatch) { - var ignored = opts.ignoreWatch !== true - ? opts.ignoreWatch - : '**/node_modules/**'; - } - if (opts.poll || typeof opts.poll === 'number') { - wopts.usePolling = true; - wopts.interval = opts.poll !== true - ? opts.poll - : undefined; - } - - if (cache) { - b.on('reset', collect); - collect(); - } - - function collect () { - b.pipeline.get('deps').push(through.obj(function(row, enc, next) { - var file = row.expose ? b._expose[row.id] : row.file; - cache[file] = { - source: row.source, - deps: xtend(row.deps) - }; - this.push(row); - next(); - })); - } - - b.on('file', function (file) { - watchFile(file); - }); - - b.on('package', function (pkg) { - var file = path.join(pkg.__dirname, 'package.json'); - watchFile(file); - if (pkgcache) pkgcache[file] = pkg; - }); - - b.on('reset', reset); - reset(); - - function reset () { - var time = null; - var bytes = 0; - b.pipeline.get('record').on('end', function () { - time = Date.now(); - }); - - b.pipeline.get('wrap').push(through(write, end)); - function write (buf, enc, next) { - bytes += buf.length; - this.push(buf); - next(); - } - function end () { - var delta = Date.now() - time; - b.emit('time', delta); - b.emit('bytes', bytes); - b.emit('log', bytes + ' bytes written (' - + (delta / 1000).toFixed(2) + ' seconds)' - ); - this.push(null); - } - } - - var fwatchers = {}; - var fwatcherFiles = {}; - var ignoredFiles = {}; - - b.on('transform', function (tr, mfile) { - tr.on('file', function (dep) { - watchFile(mfile, dep); - }); - }); - b.on('bundle', function (bundle) { - updating = true; - bundle.on('error', onend); - bundle.on('end', onend); - function onend () { updating = false } - }); - - function watchFile (file, dep) { - dep = dep || file; - if (ignored) { - if (!ignoredFiles.hasOwnProperty(file)) { - ignoredFiles[file] = anymatch(ignored, file); - } - if (ignoredFiles[file]) return; - } - if (!fwatchers[file]) fwatchers[file] = []; - if (!fwatcherFiles[file]) fwatcherFiles[file] = []; - if (fwatcherFiles[file].indexOf(dep) >= 0) return; - - var w = b._watcher(dep, wopts); - w.setMaxListeners(0); - w.on('error', b.emit.bind(b, 'error')); - w.on('change', function () { - invalidate(file); - }); - fwatchers[file].push(w); - fwatcherFiles[file].push(dep); - } - - function invalidate (id) { - if (cache) delete cache[id]; - if (pkgcache) delete pkgcache[id]; - changingDeps[id] = true; - - if (!updating && fwatchers[id]) { - fwatchers[id].forEach(function (w) { - w.close(); - }); - delete fwatchers[id]; - delete fwatcherFiles[id]; - } - - // wait for the disk/editor to quiet down first: - if (pending) clearTimeout(pending); - pending = setTimeout(notify, delay); - } - - function notify () { - if (updating) { - pending = setTimeout(notify, delay); - } else { - pending = false; - b.emit('update', Object.keys(changingDeps)); - changingDeps = {}; - } - } - - b.close = function () { - Object.keys(fwatchers).forEach(function (id) { - fwatchers[id].forEach(function (w) { w.close() }); - }); - }; - - b._watcher = function (file, opts) { - return chokidar.watch(file, opts); - }; - - return b; -} diff --git a/node_modules/watchify/package.json b/node_modules/watchify/package.json deleted file mode 100644 index 164242f12..000000000 --- a/node_modules/watchify/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "_from": "watchify@^3.3.1", - "_id": "watchify@3.11.0", - "_inBundle": false, - "_integrity": "sha512-7jWG0c3cKKm2hKScnSAMUEUjRJKXUShwMPk0ASVhICycQhwND3IMAdhJYmc1mxxKzBUJTSF5HZizfrKrS6BzkA==", - "_location": "/watchify", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "watchify@^3.3.1", - "name": "watchify", - "escapedName": "watchify", - "rawSpec": "^3.3.1", - "saveSpec": null, - "fetchSpec": "^3.3.1" - }, - "_requiredBy": [ - "/watchify-middleware" - ], - "_resolved": "https://registry.npmjs.org/watchify/-/watchify-3.11.0.tgz", - "_shasum": "03f1355c643955e7ab8dcbf399f624644221330f", - "_spec": "watchify@^3.3.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/watchify-middleware", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bin": { - "watchify": "bin/cmd.js" - }, - "bugs": { - "url": "https://github.com/substack/watchify/issues" - }, - "bundleDependencies": false, - "dependencies": { - "anymatch": "^1.3.0", - "browserify": "^16.1.0", - "chokidar": "^1.0.0", - "defined": "^1.0.0", - "outpipe": "^1.1.0", - "through2": "^2.0.0", - "xtend": "^4.0.0" - }, - "deprecated": false, - "description": "watch mode for browserify builds", - "devDependencies": { - "brfs": "^1.0.1", - "mkdirp": "~0.5.1", - "split": "^1.0.0", - "tape": "^4.2.2", - "uglify-js": "^2.5.0", - "win-spawn": "^2.0.0" - }, - "homepage": "https://github.com/substack/watchify", - "keywords": [ - "browserify", - "browserify-tool", - "watch", - "bundle", - "build", - "browser" - ], - "license": "MIT", - "main": "index.js", - "name": "watchify", - "repository": { - "type": "git", - "url": "git://github.com/substack/watchify.git" - }, - "scripts": { - "test": "tape test/*.js" - }, - "version": "3.11.0" -} diff --git a/node_modules/watchify/readme.markdown b/node_modules/watchify/readme.markdown deleted file mode 100644 index 5904f843a..000000000 --- a/node_modules/watchify/readme.markdown +++ /dev/null @@ -1,233 +0,0 @@ -# watchify - -watch mode for [browserify](https://github.com/substack/node-browserify) builds - -[![build status](https://secure.travis-ci.org/substack/watchify.svg?branch=master)](http://travis-ci.org/substack/watchify) - -Update any source file and your browserify bundle will be recompiled on the -spot. - -# example - -``` -$ watchify main.js -o static/bundle.js -``` - -Now as you update files, `static/bundle.js` will be automatically -incrementally rebuilt on the fly. - -The `-o` option can be a file or a shell command (not available on Windows) -that receives piped input: - -``` sh -watchify main.js -o 'exorcist static/bundle.js.map > static/bundle.js' -d -``` - -``` sh -watchify main.js -o 'uglifyjs -cm > static/bundle.min.js' -``` - -You can use `-v` to get more verbose output to show when a file was written and how long the bundling took (in seconds): - -``` -$ watchify browser.js -d -o static/bundle.js -v -610598 bytes written to static/bundle.js (0.23 seconds) at 8:31:25 PM -610606 bytes written to static/bundle.js (0.10 seconds) at 8:45:59 PM -610597 bytes written to static/bundle.js (0.14 seconds) at 8:46:02 PM -610606 bytes written to static/bundle.js (0.08 seconds) at 8:50:13 PM -610597 bytes written to static/bundle.js (0.08 seconds) at 8:58:16 PM -610597 bytes written to static/bundle.js (0.19 seconds) at 9:10:45 PM -``` - -# usage - -Use `watchify` with all the same options as `browserify` except that `-o` (or -`--outfile`) is mandatory. Additionally, there are also: - -``` -Standard Options: - - --outfile=FILE, -o FILE - - This option is required. Write the browserify bundle to this file. If - the file contains the operators `|` or `>`, it will be treated as a - shell command, and the output will be piped to it. - - --verbose, -v [default: false] - - Show when a file was written and how long the bundling took (in - seconds). - - --version - - Show the watchify and browserify versions with their module paths. -``` - -``` -Advanced Options: - - --delay [default: 100] - - Amount of time in milliseconds to wait before emitting an "update" - event after a change. - - --ignore-watch=GLOB, --iw GLOB [default: false] - - Ignore monitoring files for changes that match the pattern. Omitting - the pattern will default to "**/node_modules/**". - - --poll=INTERVAL [default: false] - - Use polling to monitor for changes. Omitting the interval will default - to 100ms. This option is useful if you're watching an NFS volume. -``` - -# methods - -``` js -var watchify = require('watchify'); -``` - -## watchify(b, opts) - -watchify is a browserify [plugin](https://github.com/substack/node-browserify#bpluginplugin-opts), so it can be applied like any other plugin. -However, when creating the browserify instance `b`, **you MUST set the `cache` -and `packageCache` properties**: - -``` js -var b = browserify({ cache: {}, packageCache: {} }); -b.plugin(watchify); -``` - -```js -var b = browserify({ - cache: {}, - packageCache: {}, - plugin: [watchify] -}); -``` - -**By default, watchify doesn't display any output, see [events](https://github.com/substack/watchify#events) for more info.** - -`b` continues to behave like a browserify instance except that it caches file -contents and emits an `'update'` event when a file changes. You should call -`b.bundle()` after the `'update'` event fires to generate a new bundle. -Calling `b.bundle()` extra times past the first time will be much faster due -to caching. - -**Important:** Watchify will not emit `'update'` events until you've called -`b.bundle()` once and completely drained the stream it returns. - -```js -var fs = require('fs'); -var browserify = require('browserify'); -var watchify = require('watchify'); - -var b = browserify({ - entries: ['path/to/entry.js'], - cache: {}, - packageCache: {}, - plugin: [watchify] -}); - -b.on('update', bundle); -bundle(); - -function bundle() { - b.bundle().pipe(fs.createWriteStream('output.js')); -} -``` - -### options - -You can to pass an additional options object as a second parameter of -watchify. Its properties are: - -`opts.delay` is the amount of time in milliseconds to wait before emitting -an "update" event after a change. Defaults to `100`. - -`opts.ignoreWatch` ignores monitoring files for changes. If set to `true`, -then `**/node_modules/**` will be ignored. For other possible values see -Chokidar's [documentation](https://github.com/paulmillr/chokidar#path-filtering) on "ignored". - -`opts.poll` enables polling to monitor for changes. If set to `true`, then -a polling interval of 100ms is used. If set to a number, then that amount of -milliseconds will be the polling interval. For more info see Chokidar's -[documentation](https://github.com/paulmillr/chokidar#performance) on -"usePolling" and "interval". -**This option is useful if you're watching an NFS volume.** - -```js -var b = browserify({ cache: {}, packageCache: {} }); -// watchify defaults: -b.plugin(watchify, { - delay: 100, - ignoreWatch: ['**/node_modules/**'], - poll: false -}); -``` - -## b.close() - -Close all the open watch handles. - -# events - -## b.on('update', function (ids) {}) - -When the bundle changes, emit the array of bundle `ids` that changed. - -## b.on('bytes', function (bytes) {}) - -When a bundle is generated, this event fires with the number of bytes. - -## b.on('time', function (time) {}) - -When a bundle is generated, this event fires with the time it took to create the -bundle in milliseconds. - -## b.on('log', function (msg) {}) - -This event fires after a bundle was created with messages of the form: - -``` -X bytes written (Y seconds) -``` - -with the number of bytes in the bundle X and the time in seconds Y. - -# install - -With [npm](https://npmjs.org) do: - -``` -$ npm install -g watchify -``` - -to get the watchify command and: - -``` -$ npm install watchify -``` - -to get just the library. - -# troubleshooting - -## rebuilds on OS X never trigger - -It may be related to a bug in `fsevents` (see [#250](https://github.com/substack/watchify/issues/205#issuecomment-98672850) -and [stackoverflow](http://stackoverflow.com/questions/26708205/webpack-watch-isnt-compiling-changed-files/28610124#28610124)). -Try the `--poll` flag -and/or renaming the project's directory - that might help. - -# see also - -- [budo](https://www.npmjs.com/package/budo) – a simple development server built on watchify -- [errorify](https://www.npmjs.com/package/errorify) – a plugin to add error handling to watchify development -- [watchify-request](https://www.npmjs.com/package/watchify-request) – wraps a `watchify` instance to avoid stale bundles in HTTP requests -- [watchify-middleware](https://www.npmjs.com/package/watchify-middleware) – similar to `watchify-request`, but includes some higher-level features - -# license - -MIT diff --git a/node_modules/watchify/test/api.js b/node_modules/watchify/test/api.js deleted file mode 100644 index 5877b2a3b..000000000 --- a/node_modules/watchify/test/api.js +++ /dev/null @@ -1,44 +0,0 @@ -var test = require('tape'); -var watchify = require('../'); -var browserify = require('browserify'); -var vm = require('vm'); - -var fs = require('fs'); -var path = require('path'); -var mkdirp = require('mkdirp'); - -var os = require('os'); -var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); - -var file = path.join(tmpdir, 'main.js'); - -mkdirp.sync(tmpdir); -fs.writeFileSync(file, 'console.log(555)'); - -test('api', function (t) { - t.plan(5); - var w = watchify(browserify(file, watchify.args)); - w.on('update', function () { - w.bundle(function (err, src) { - t.ifError(err); - t.equal(run(src), '333\n'); - w.close(); - }); - }); - w.bundle(function (err, src) { - t.ifError(err); - t.equal(run(src), '555\n'); - setTimeout(function () { - fs.writeFile(file, 'console.log(333)', function (err) { - t.ifError(err); - }); - }, 1000); - }); -}); - -function run (src) { - var output = ''; - function log (msg) { output += msg + '\n' } - vm.runInNewContext(src, { console: { log: log } }); - return output; -} diff --git a/node_modules/watchify/test/api_brfs.js b/node_modules/watchify/test/api_brfs.js deleted file mode 100644 index 0078d4521..000000000 --- a/node_modules/watchify/test/api_brfs.js +++ /dev/null @@ -1,53 +0,0 @@ -var test = require('tape'); -var watchify = require('../'); -var browserify = require('browserify'); -var vm = require('vm'); - -var fs = require('fs'); -var path = require('path'); -var mkdirp = require('mkdirp'); - -var os = require('os'); -var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); - -var files = { - main: path.join(tmpdir, 'main.js'), - lines: path.join(tmpdir, 'lines.txt') -}; - -mkdirp.sync(tmpdir); -fs.writeFileSync(files.main, [ - 'var fs = require("fs");', - 'var src = fs.readFileSync(__dirname + "/lines.txt", "utf8");', - 'console.log(src.toUpperCase());' -].join('\n')); -fs.writeFileSync(files.lines, 'beep\nboop'); - -test('api with brfs', function (t) { - t.plan(5); - var w = watchify(browserify(files.main, watchify.args)); - w.transform('brfs'); - w.on('update', function () { - w.bundle(function (err, src) { - t.ifError(err); - t.equal(run(src), 'ROBO-BOOGIE\n'); - w.close(); - }); - }); - w.bundle(function (err, src) { - t.ifError(err); - t.equal(run(src), 'BEEP\nBOOP\n'); - setTimeout(function () { - fs.writeFile(files.lines, 'rObO-bOOgie', function (err) { - t.ifError(err); - }); - }, 1000); - }); -}); - -function run (src) { - var output = ''; - function log (msg) { output += msg + '\n' } - vm.runInNewContext(src, { console: { log: log } }); - return output; -} diff --git a/node_modules/watchify/test/api_ignore_watch.js b/node_modules/watchify/test/api_ignore_watch.js deleted file mode 100644 index 17139a38a..000000000 --- a/node_modules/watchify/test/api_ignore_watch.js +++ /dev/null @@ -1,60 +0,0 @@ -var test = require('tape'); -var watchify = require('../'); -var browserify = require('browserify'); -var vm = require('vm'); - -var fs = require('fs'); -var path = require('path'); -var mkdirp = require('mkdirp'); - -var os = require('os'); -var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); - -var files = { - main: path.join(tmpdir, 'main.js'), - beep: path.join(tmpdir, 'beep.js'), - boop: path.join(tmpdir, 'boop.js'), - robot: path.join(tmpdir, 'node_modules', 'robot', 'index.js') -}; - -mkdirp.sync(tmpdir); -mkdirp.sync(path.dirname(files.robot)); -fs.writeFileSync(files.main, [ - 'var beep = require("./beep");', - 'var boop = require("./boop");', - 'var robot = require("robot");', - 'console.log(beep + " " + boop + " " + robot);' -].join('\n')); -fs.writeFileSync(files.beep, 'module.exports = "beep";'); -fs.writeFileSync(files.boop, 'module.exports = "boop";'); -fs.writeFileSync(files.robot, 'module.exports = "robot";'); - -test('api ignore watch', function (t) { - t.plan(4); - var w = watchify(browserify(files.main, watchify.args), { - ignoreWatch: '**/be*.js' - }); - w.on('update', function () { - w.bundle(function (err, src) { - t.ifError(err); - t.equal(run(src), 'beep BOOP ROBOT\n'); - w.close(); - }); - }); - w.bundle(function (err, src) { - t.ifError(err); - t.equal(run(src), 'beep boop robot\n'); - setTimeout(function () { - fs.writeFileSync(files.beep, 'module.exports = "BEEP";'); - fs.writeFileSync(files.boop, 'module.exports = "BOOP";'); - fs.writeFileSync(files.robot, 'module.exports = "ROBOT";'); - }, 1000); - }); -}); - -function run (src) { - var output = ''; - function log (msg) { output += msg + '\n' } - vm.runInNewContext(src, { console: { log: log } }); - return output; -} diff --git a/node_modules/watchify/test/api_ignore_watch_default.js b/node_modules/watchify/test/api_ignore_watch_default.js deleted file mode 100644 index 9a7a48dc4..000000000 --- a/node_modules/watchify/test/api_ignore_watch_default.js +++ /dev/null @@ -1,60 +0,0 @@ -var test = require('tape'); -var watchify = require('../'); -var browserify = require('browserify'); -var vm = require('vm'); - -var fs = require('fs'); -var path = require('path'); -var mkdirp = require('mkdirp'); - -var os = require('os'); -var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); - -var files = { - main: path.join(tmpdir, 'main.js'), - beep: path.join(tmpdir, 'beep.js'), - boop: path.join(tmpdir, 'boop.js'), - robot: path.join(tmpdir, 'node_modules', 'robot', 'index.js') -}; - -mkdirp.sync(tmpdir); -mkdirp.sync(path.dirname(files.robot)); -fs.writeFileSync(files.main, [ - 'var beep = require("./beep");', - 'var boop = require("./boop");', - 'var robot = require("robot");', - 'console.log(beep + " " + boop + " " + robot);' -].join('\n')); -fs.writeFileSync(files.beep, 'module.exports = "beep";'); -fs.writeFileSync(files.boop, 'module.exports = "boop";'); -fs.writeFileSync(files.robot, 'module.exports = "robot";'); - -test('api ignore watch default', function (t) { - t.plan(4); - var w = watchify(browserify(files.main, watchify.args), { - ignoreWatch: true - }); - w.on('update', function () { - w.bundle(function (err, src) { - t.ifError(err); - t.equal(run(src), 'BEEP BOOP robot\n'); - w.close(); - }); - }); - w.bundle(function (err, src) { - t.ifError(err); - t.equal(run(src), 'beep boop robot\n'); - setTimeout(function () { - fs.writeFileSync(files.beep, 'module.exports = "BEEP";'); - fs.writeFileSync(files.boop, 'module.exports = "BOOP";'); - fs.writeFileSync(files.robot, 'module.exports = "ROBOT";'); - }, 1000); - }); -}); - -function run (src) { - var output = ''; - function log (msg) { output += msg + '\n' } - vm.runInNewContext(src, { console: { log: log } }); - return output; -} diff --git a/node_modules/watchify/test/api_ignore_watch_multiple.js b/node_modules/watchify/test/api_ignore_watch_multiple.js deleted file mode 100644 index 91857ef57..000000000 --- a/node_modules/watchify/test/api_ignore_watch_multiple.js +++ /dev/null @@ -1,60 +0,0 @@ -var test = require('tape'); -var watchify = require('../'); -var browserify = require('browserify'); -var vm = require('vm'); - -var fs = require('fs'); -var path = require('path'); -var mkdirp = require('mkdirp'); - -var os = require('os'); -var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); - -var files = { - main: path.join(tmpdir, 'main.js'), - beep: path.join(tmpdir, 'beep.js'), - boop: path.join(tmpdir, 'boop.js'), - robot: path.join(tmpdir, 'node_modules', 'robot', 'index.js') -}; - -mkdirp.sync(tmpdir); -mkdirp.sync(path.dirname(files.robot)); -fs.writeFileSync(files.main, [ - 'var beep = require("./beep");', - 'var boop = require("./boop");', - 'var robot = require("robot");', - 'console.log(beep + " " + boop + " " + robot);' -].join('\n')); -fs.writeFileSync(files.beep, 'module.exports = "beep";'); -fs.writeFileSync(files.boop, 'module.exports = "boop";'); -fs.writeFileSync(files.robot, 'module.exports = "robot";'); - -test('api ignore watch multiple paths', function (t) { - t.plan(4); - var w = watchify(browserify(files.main, watchify.args), { - ignoreWatch: ['**/be*.js', '**/robot/*.js'] - }); - w.on('update', function () { - w.bundle(function (err, src) { - t.ifError(err); - t.equal(run(src), 'beep BOOP robot\n'); - w.close(); - }); - }); - w.bundle(function (err, src) { - t.ifError(err); - t.equal(run(src), 'beep boop robot\n'); - setTimeout(function () { - fs.writeFileSync(files.beep, 'module.exports = "BEEP";'); - fs.writeFileSync(files.boop, 'module.exports = "BOOP";'); - fs.writeFileSync(files.robot, 'module.exports = "ROBOT";'); - }, 1000); - }); -}); - -function run (src) { - var output = ''; - function log (msg) { output += msg + '\n' } - vm.runInNewContext(src, { console: { log: log } }); - return output; -} diff --git a/node_modules/watchify/test/api_implicit_cache.js b/node_modules/watchify/test/api_implicit_cache.js deleted file mode 100644 index 0f1152805..000000000 --- a/node_modules/watchify/test/api_implicit_cache.js +++ /dev/null @@ -1,44 +0,0 @@ -var test = require('tape'); -var watchify = require('../'); -var browserify = require('browserify'); -var vm = require('vm'); - -var fs = require('fs'); -var path = require('path'); -var mkdirp = require('mkdirp'); - -var os = require('os'); -var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); - -var file = path.join(tmpdir, 'main.js'); - -mkdirp.sync(tmpdir); -fs.writeFileSync(file, 'console.log(555)'); - -test('api implicit cache', function (t) { - t.plan(5); - var w = watchify(browserify(file)); - w.on('update', function () { - w.bundle(function (err, src) { - t.ifError(err); - t.equal(run(src), '333\n'); - w.close(); - }); - }); - w.bundle(function (err, src) { - t.ifError(err); - t.equal(run(src), '555\n'); - setTimeout(function () { - fs.writeFile(file, 'console.log(333)', function (err) { - t.ifError(err); - }); - }, 1000); - }); -}); - -function run (src) { - var output = ''; - function log (msg) { output += msg + '\n' } - vm.runInNewContext(src, { console: { log: log } }); - return output; -} diff --git a/node_modules/watchify/test/bin.js b/node_modules/watchify/test/bin.js deleted file mode 100644 index c72a02faf..000000000 --- a/node_modules/watchify/test/bin.js +++ /dev/null @@ -1,52 +0,0 @@ -var test = require('tape'); -var fs = require('fs'); -var path = require('path'); -var mkdirp = require('mkdirp'); -var spawn = require('win-spawn'); -var split = require('split'); - -var cmd = path.resolve(__dirname, '../bin/cmd.js'); -var os = require('os'); -var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); - -var files = { - main: path.join(tmpdir, 'main.js'), - bundle: path.join(tmpdir, 'bundle.js') -}; - -mkdirp.sync(tmpdir); -fs.writeFileSync(files.main, 'console.log(555)'); - -test('bin', function (t) { - t.plan(5); - var ps = spawn(cmd, [ files.main, '-o', files.bundle, '-v' ]); - var lineNum = 0; - ps.stderr.pipe(split()).on('data', function (line) { - lineNum ++; - if (lineNum === 1) { - run(files.bundle, function (err, output) { - t.ifError(err); - t.equal(output, '555\n'); - fs.writeFile(files.main, 'console.log(333)', t.ifError); - }) - } - else if (lineNum === 2) { - run(files.bundle, function (err, output) { - t.ifError(err); - t.equal(output, '333\n'); - ps.kill(); - }); - } - }); -}); - -function run (file, cb) { - var ps = spawn(process.execPath, [ file ]); - var data = []; - ps.stdout.on('data', function (buf) { data.push(buf) }); - ps.stdout.on('end', function () { - cb(null, Buffer.concat(data).toString('utf8')); - }); - ps.on('error', cb); - return ps; -} diff --git a/node_modules/watchify/test/bin_brfs.js b/node_modules/watchify/test/bin_brfs.js deleted file mode 100644 index 114437789..000000000 --- a/node_modules/watchify/test/bin_brfs.js +++ /dev/null @@ -1,62 +0,0 @@ -var test = require('tape'); -var fs = require('fs'); -var path = require('path'); -var mkdirp = require('mkdirp'); -var spawn = require('win-spawn'); -var split = require('split'); - -var cmd = path.resolve(__dirname, '../bin/cmd.js'); -var os = require('os'); -var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); - -var files = { - main: path.join(tmpdir, 'main.js'), - lines: path.join(tmpdir, 'lines.txt'), - bundle: path.join(tmpdir, 'bundle.js') -}; - -mkdirp.sync(tmpdir); -fs.writeFileSync(files.main, [ - 'var fs = require("fs");', - 'var src = fs.readFileSync(__dirname + "/lines.txt", "utf8");', - 'console.log(src.toUpperCase());' -].join('\n')); -fs.writeFileSync(files.lines, 'beep\nboop'); - -test('bin brfs', function (t) { - t.plan(5); - var ps = spawn(cmd, [ - files.main, - '-t', require.resolve('brfs'), '-v', - '-o', files.bundle - ]); - var lineNum = 0; - ps.stderr.pipe(split()).on('data', function (line) { - lineNum ++; - if (lineNum === 1) { - run(files.bundle, function (err, output) { - t.ifError(err); - t.equal(output, 'BEEP\nBOOP\n'); - fs.writeFile(files.lines, 'robo-bOOgie', t.ifError); - }) - } - else if (lineNum === 2) { - run(files.bundle, function (err, output) { - t.ifError(err); - t.equal(output, 'ROBO-BOOGIE\n'); - ps.kill(); - }); - } - }); -}); - -function run (file, cb) { - var ps = spawn(process.execPath, [ file ]); - var data = []; - ps.stdout.on('data', function (buf) { data.push(buf) }); - ps.stdout.on('end', function () { - cb(null, Buffer.concat(data).toString('utf8')); - }); - ps.on('error', cb); - return ps; -} diff --git a/node_modules/watchify/test/bin_ignore_watch.js b/node_modules/watchify/test/bin_ignore_watch.js deleted file mode 100644 index 358090f71..000000000 --- a/node_modules/watchify/test/bin_ignore_watch.js +++ /dev/null @@ -1,71 +0,0 @@ -var test = require('tape'); -var fs = require('fs'); -var path = require('path'); -var mkdirp = require('mkdirp'); -var spawn = require('win-spawn'); -var split = require('split'); - -var cmd = path.resolve(__dirname, '../bin/cmd.js'); -var os = require('os'); -var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); - -var files = { - main: path.join(tmpdir, 'main.js'), - beep: path.join(tmpdir, 'beep.js'), - boop: path.join(tmpdir, 'boop.js'), - robot: path.join(tmpdir, 'node_modules', 'robot', 'index.js'), - bundle: path.join(tmpdir, 'bundle.js') -}; - -mkdirp.sync(tmpdir); -mkdirp.sync(path.dirname(files.robot)); -fs.writeFileSync(files.main, [ - 'var beep = require("./beep");', - 'var boop = require("./boop");', - 'var robot = require("robot");', - 'console.log(beep + " " + boop + " " + robot);' -].join('\n')); -fs.writeFileSync(files.beep, 'module.exports = "beep";'); -fs.writeFileSync(files.boop, 'module.exports = "boop";'); -fs.writeFileSync(files.robot, 'module.exports = "robot";'); - -test('api ignore watch', function (t) { - t.plan(4); - var ps = spawn(cmd, [ - files.main, - '--ignore-watch', '**/be*.js', - '-o', files.bundle, - '-v' - ]); - var lineNum = 0; - ps.stderr.pipe(split()).on('data', function (line) { - lineNum ++; - if (lineNum === 1) { - run(files.bundle, function (err, output) { - t.ifError(err); - t.equal(output, 'beep boop robot\n'); - fs.writeFileSync(files.beep, 'module.exports = "BEEP";'); - fs.writeFileSync(files.boop, 'module.exports = "BOOP";'); - fs.writeFileSync(files.robot, 'module.exports = "ROBOT";'); - }); - } - else if (lineNum === 2) { - run(files.bundle, function (err, output) { - t.ifError(err); - t.equal(output, 'beep BOOP ROBOT\n'); - ps.kill(); - }); - } - }); -}); - -function run (file, cb) { - var ps = spawn(process.execPath, [ file ]); - var data = []; - ps.stdout.on('data', function (buf) { data.push(buf) }); - ps.stdout.on('end', function () { - cb(null, Buffer.concat(data).toString('utf8')); - }); - ps.on('error', cb); - return ps; -} diff --git a/node_modules/watchify/test/bin_ignore_watch_default.js b/node_modules/watchify/test/bin_ignore_watch_default.js deleted file mode 100644 index f70134880..000000000 --- a/node_modules/watchify/test/bin_ignore_watch_default.js +++ /dev/null @@ -1,71 +0,0 @@ -var test = require('tape'); -var fs = require('fs'); -var path = require('path'); -var mkdirp = require('mkdirp'); -var spawn = require('win-spawn'); -var split = require('split'); - -var cmd = path.resolve(__dirname, '../bin/cmd.js'); -var os = require('os'); -var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); - -var files = { - main: path.join(tmpdir, 'main.js'), - beep: path.join(tmpdir, 'beep.js'), - boop: path.join(tmpdir, 'boop.js'), - robot: path.join(tmpdir, 'node_modules', 'robot', 'index.js'), - bundle: path.join(tmpdir, 'bundle.js') -}; - -mkdirp.sync(tmpdir); -mkdirp.sync(path.dirname(files.robot)); -fs.writeFileSync(files.main, [ - 'var beep = require("./beep");', - 'var boop = require("./boop");', - 'var robot = require("robot");', - 'console.log(beep + " " + boop + " " + robot);' -].join('\n')); -fs.writeFileSync(files.beep, 'module.exports = "beep";'); -fs.writeFileSync(files.boop, 'module.exports = "boop";'); -fs.writeFileSync(files.robot, 'module.exports = "robot";'); - -test('api ignore watch', function (t) { - t.plan(4); - var ps = spawn(cmd, [ - files.main, - '--ignore-watch', - '-o', files.bundle, - '-v' - ]); - var lineNum = 0; - ps.stderr.pipe(split()).on('data', function (line) { - lineNum ++; - if (lineNum === 1) { - run(files.bundle, function (err, output) { - t.ifError(err); - t.equal(output, 'beep boop robot\n'); - fs.writeFileSync(files.beep, 'module.exports = "BEEP";'); - fs.writeFileSync(files.boop, 'module.exports = "BOOP";'); - fs.writeFileSync(files.robot, 'module.exports = "ROBOT";'); - }); - } - else if (lineNum === 2) { - run(files.bundle, function (err, output) { - t.ifError(err); - t.equal(output, 'BEEP BOOP robot\n'); - ps.kill(); - }); - } - }); -}); - -function run (file, cb) { - var ps = spawn(process.execPath, [ file ]); - var data = []; - ps.stdout.on('data', function (buf) { data.push(buf) }); - ps.stdout.on('end', function () { - cb(null, Buffer.concat(data).toString('utf8')); - }); - ps.on('error', cb); - return ps; -} diff --git a/node_modules/watchify/test/bin_ignore_watch_multiple.js b/node_modules/watchify/test/bin_ignore_watch_multiple.js deleted file mode 100644 index 37ff91f99..000000000 --- a/node_modules/watchify/test/bin_ignore_watch_multiple.js +++ /dev/null @@ -1,72 +0,0 @@ -var test = require('tape'); -var fs = require('fs'); -var path = require('path'); -var mkdirp = require('mkdirp'); -var spawn = require('win-spawn'); -var split = require('split'); - -var cmd = path.resolve(__dirname, '../bin/cmd.js'); -var os = require('os'); -var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); - -var files = { - main: path.join(tmpdir, 'main.js'), - beep: path.join(tmpdir, 'beep.js'), - boop: path.join(tmpdir, 'boop.js'), - robot: path.join(tmpdir, 'node_modules', 'robot', 'index.js'), - bundle: path.join(tmpdir, 'bundle.js') -}; - -mkdirp.sync(tmpdir); -mkdirp.sync(path.dirname(files.robot)); -fs.writeFileSync(files.main, [ - 'var beep = require("./beep");', - 'var boop = require("./boop");', - 'var robot = require("robot");', - 'console.log(beep + " " + boop + " " + robot);' -].join('\n')); -fs.writeFileSync(files.beep, 'module.exports = "beep";'); -fs.writeFileSync(files.boop, 'module.exports = "boop";'); -fs.writeFileSync(files.robot, 'module.exports = "robot";'); - -test('api ignore watch multiple paths', function (t) { - t.plan(4); - var ps = spawn(cmd, [ - files.main, - '--ignore-watch', '**/be*.js', - '--ignore-watch', '**/robot/*.js', - '-o', files.bundle, - '-v' - ]); - var lineNum = 0; - ps.stderr.pipe(split()).on('data', function (line) { - lineNum ++; - if (lineNum === 1) { - run(files.bundle, function (err, output) { - t.ifError(err); - t.equal(output, 'beep boop robot\n'); - fs.writeFileSync(files.beep, 'module.exports = "BEEP";'); - fs.writeFileSync(files.boop, 'module.exports = "BOOP";'); - fs.writeFileSync(files.robot, 'module.exports = "ROBOT";'); - }); - } - else if (lineNum === 2) { - run(files.bundle, function (err, output) { - t.ifError(err); - t.equal(output, 'beep BOOP robot\n'); - ps.kill(); - }); - } - }); -}); - -function run (file, cb) { - var ps = spawn(process.execPath, [ file ]); - var data = []; - ps.stdout.on('data', function (buf) { data.push(buf) }); - ps.stdout.on('end', function () { - cb(null, Buffer.concat(data).toString('utf8')); - }); - ps.on('error', cb); - return ps; -} diff --git a/node_modules/watchify/test/bin_pipe.js b/node_modules/watchify/test/bin_pipe.js deleted file mode 100644 index 02f14d0a0..000000000 --- a/node_modules/watchify/test/bin_pipe.js +++ /dev/null @@ -1,56 +0,0 @@ -var test = require('tape'); -var fs = require('fs'); -var path = require('path'); -var mkdirp = require('mkdirp'); -var spawn = require('win-spawn'); -var split = require('split'); - -var cmd = path.resolve(__dirname, '../bin/cmd.js'); -var os = require('os'); -var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); - -var files = { - main: path.join(tmpdir, 'main.js'), - bundle: path.join(tmpdir, 'bundle.js') -}; - -mkdirp.sync(tmpdir); -fs.writeFileSync(files.main, 'console.log(num * 2)'); - -test('bin with pipe', function (t) { - t.plan(5); - var ps = spawn(cmd, [ - files.main, - '-o', 'uglifyjs - --enclose 11:num > ' + files.bundle, - '-v' - ]); - var lineNum = 0; - ps.stderr.pipe(split()).on('data', function (line) { - lineNum ++; - if (lineNum === 1) { - run(files.bundle, function (err, output) { - t.ifError(err); - t.equal(output, '22\n'); - fs.writeFile(files.main, 'console.log(num * 3)', t.ifError); - }); - } - else if (lineNum === 2) { - run(files.bundle, function (err, output) { - t.ifError(err); - t.equal(output, '33\n'); - ps.kill(); - }); - } - }); -}); - -function run (file, cb) { - var ps = spawn(process.execPath, [ file ]); - var data = []; - ps.stdout.on('data', function (buf) { data.push(buf) }); - ps.stdout.on('end', function () { - cb(null, Buffer.concat(data).toString('utf8')); - }); - ps.on('error', cb); - return ps; -} diff --git a/node_modules/watchify/test/bin_plugins_pipelining_multiple_errors.js b/node_modules/watchify/test/bin_plugins_pipelining_multiple_errors.js deleted file mode 100644 index cdc701704..000000000 --- a/node_modules/watchify/test/bin_plugins_pipelining_multiple_errors.js +++ /dev/null @@ -1,56 +0,0 @@ -var test = require('tape'); -var fs = require('fs'); -var path = require('path'); -var mkdirp = require('mkdirp'); -var spawn = require('win-spawn'); -var split = require('split'); - -var cmd = path.resolve(__dirname, '../bin/cmd.js'); -var os = require('os'); -var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); - -var files = { - main: path.join(tmpdir, 'main.js'), - plugin: path.join(tmpdir, 'plugin.js'), - bundle: path.join(tmpdir, 'bundle.js') -}; - -mkdirp.sync(tmpdir); -fs.writeFileSync(files.plugin, [ - 'module.exports = function(b, opts) {', - ' b.on("file", function (file, id) {', - ' b.pipeline.emit("error", "bad boop");', - ' b.pipeline.emit("error", "bad boop");', - ' });', - '};', -].join('\n')); -fs.writeFileSync(files.main, 'boop\nbeep'); - -test('bin plugins pipelining multiple errors', function (t) { - t.plan(4); - var ps = spawn(cmd, [ - files.main, - '-p', files.plugin, '-v', - '-o', files.bundle - ]); - var lineNum = 0; - ps.stderr.pipe(split()).on('data', function (line) { - lineNum ++; - if (lineNum === 1) { - t.equal(line, 'bad boop'); - } - if (lineNum === 2) { - t.equal(line, 'bad boop'); - setTimeout(function() { - fs.writeFileSync(files.main, 'beep\nboop'); - }, 1000); - } - if (lineNum === 3) { - t.equal(line, 'bad boop'); - } - if (lineNum === 4) { - t.equal(line, 'bad boop'); - ps.kill(); - } - }); -}); diff --git a/node_modules/watchify/test/bin_standalone.js b/node_modules/watchify/test/bin_standalone.js deleted file mode 100644 index f3f3dcfe4..000000000 --- a/node_modules/watchify/test/bin_standalone.js +++ /dev/null @@ -1,52 +0,0 @@ -var test = require('tape'); -var fs = require('fs'); -var path = require('path'); -var mkdirp = require('mkdirp'); -var spawn = require('win-spawn'); -var split = require('split'); - -var cmd = path.resolve(__dirname, '../bin/cmd.js'); -var os = require('os'); -var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); - -var files = { - main: path.join(tmpdir, 'main.js'), - bundle: path.join(tmpdir, 'bundle.js') -}; - -mkdirp.sync(tmpdir); -fs.writeFileSync(files.main, 'console.log(555)'); - -test('bin with standalone', function (t) { - t.plan(5); - var ps = spawn(cmd, [ files.main, '-o', files.bundle, '-v', '-s', 'XXX' ]); - var lineNum = 0; - ps.stderr.pipe(split()).on('data', function (line) { - lineNum ++; - if (lineNum === 1) { - run(files.bundle, function (err, output) { - t.ifError(err); - t.equal(output, '555\n'); - fs.writeFile(files.main, 'console.log(333)', t.ifError); - }) - } - else if (lineNum === 2) { - run(files.bundle, function (err, output) { - t.ifError(err); - t.equal(output, '333\n'); - ps.kill(); - }); - } - }); -}); - -function run (file, cb) { - var ps = spawn(process.execPath, [ file ]); - var data = []; - ps.stdout.on('data', function (buf) { data.push(buf) }); - ps.stdout.on('end', function () { - cb(null, Buffer.concat(data).toString('utf8')); - }); - ps.on('error', cb); - return ps; -} diff --git a/node_modules/watchify/test/errors.js b/node_modules/watchify/test/errors.js deleted file mode 100644 index 059e553b8..000000000 --- a/node_modules/watchify/test/errors.js +++ /dev/null @@ -1,56 +0,0 @@ -var test = require('tape'); -var watchify = require('../'); -var browserify = require('browserify'); -var vm = require('vm'); - -var fs = require('fs'); -var path = require('path'); -var mkdirp = require('mkdirp'); - -var os = require('os'); -var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); - -var file = path.join(tmpdir, 'main.js'); - -mkdirp.sync(tmpdir); -fs.writeFileSync(file, 'console.log(555)'); - -test('errors', function (t) { - t.plan(5); - var w = watchify(browserify(file, watchify.args)); - w.bundle(function (err, src) { - t.ifError(err); - t.equal(run(src), '555\n'); - breakTheBuild(); - }); - function breakTheBuild() { - setTimeout(function() { - fs.writeFileSync(file, 'console.log('); - }, 1000); - w.once('update', function () { - w.bundle(function (err, src) { - t.ok(err instanceof Error, 'should be error'); - fixTheBuild(); - }); - }); - } - function fixTheBuild() { - setTimeout(function() { - fs.writeFileSync(file, 'console.log(333)'); - }, 1000); - w.once('update', function () { - w.bundle(function (err, src) { - t.ifError(err); - t.equal(run(src), '333\n'); - w.close(); - }); - }); - } -}); - -function run (src) { - var output = ''; - function log (msg) { output += msg + '\n' } - vm.runInNewContext(src, { console: { log: log } }); - return output; -} diff --git a/node_modules/watchify/test/errors_transform.js b/node_modules/watchify/test/errors_transform.js deleted file mode 100644 index c45869007..000000000 --- a/node_modules/watchify/test/errors_transform.js +++ /dev/null @@ -1,83 +0,0 @@ -var test = require('tape'); -var watchify = require('../'); -var browserify = require('browserify'); -var vm = require('vm'); - -var fs = require('fs'); -var path = require('path'); -var mkdirp = require('mkdirp'); -var through = require('through2'); - -var os = require('os'); -var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); - -var main = path.join(tmpdir, 'main.js'); -var file = path.join(tmpdir, 'dep.jsnum'); - -mkdirp.sync(tmpdir); -fs.writeFileSync(main, 'require("./dep.jsnum")'); -fs.writeFileSync(file, 'console.log(555)'); - -function someTransform(file) { - if (!/\.jsnum$/.test(file)) { - return through(); - } - function write (chunk, enc, next) { - if (/\d/.test(chunk)) { - this.push(chunk); - } else { - this.emit('error', new Error('No number in this chunk')); - } - next(); - } - return through(write); -} - -test('errors in transform', function (t) { - t.plan(6); - var b = browserify(main, watchify.args); - b.transform(someTransform); - var w = watchify(b); - w.bundle(function (err, src) { - t.ifError(err); - t.equal(run(src), '555\n'); - breakTheBuild(); - }); - function breakTheBuild() { - setTimeout(function() { - fs.writeFileSync(file, 'console.log()'); - }, 1000); - w.once('update', function () { - w.bundle(function (err, src) { - t.ok(err instanceof Error, 'should be error'); - t.ok(/^No number in this chunk/.test(err.message)); - fixTheBuild(); - }); - }); - } - function fixTheBuild() { - setTimeout(function() { - fs.writeFileSync(file, 'console.log(333)'); - }, 1000); - var safety = setTimeout(function() { - t.fail("gave up waiting"); - w.close(); - t.end(); - }, 5000); - w.once('update', function () { - clearTimeout(safety); - w.bundle(function (err, src) { - t.ifError(err); - t.equal(run(src), '333\n'); - w.close(); - }); - }); - } -}); - -function run (src) { - var output = ''; - function log (msg) { output += msg + '\n' } - vm.runInNewContext(src, { console: { log: log } }); - return output; -} diff --git a/node_modules/watchify/test/expose.js b/node_modules/watchify/test/expose.js deleted file mode 100644 index e42c62dee..000000000 --- a/node_modules/watchify/test/expose.js +++ /dev/null @@ -1,72 +0,0 @@ -var test = require('tape'); -var watchify = require('../'); -var browserify = require('browserify'); -var vm = require('vm'); - -var fs = require('fs'); -var path = require('path'); -var mkdirp = require('mkdirp'); - -var os = require('os'); -var tmpbase = fs.realpathSync((os.tmpdir || os.tmpDir)()); -var tmpdir = path.join(tmpbase, 'watchify-' + Math.random()); - -var files = { - main: path.join(tmpdir, 'main.js'), - beep: path.join(tmpdir, 'beep.js'), - boop: path.join(tmpdir, 'boop.js'), - abc: path.join(tmpdir, 'lib', 'abc.js'), - xyz: path.join(tmpdir, 'lib', 'xyz.js') -}; - -mkdirp.sync(tmpdir); -mkdirp.sync(path.join(tmpdir, 'lib')); - -fs.writeFileSync(files.main, [ - 'var abc = require("abc");', - 'var xyz = require("xyz");', - 'var beep = require("./beep");', - 'console.log(abc + " " + xyz + " " + beep);' -].join('\n')); -fs.writeFileSync(files.beep, 'module.exports = require("./boop");'); -fs.writeFileSync(files.boop, 'module.exports = require("xyz");'); -fs.writeFileSync(files.abc, 'module.exports = "abc";'); -fs.writeFileSync(files.xyz, 'module.exports = "xyz";'); - -test('properly caches exposed files', function (t) { - t.plan(4); - var cache = {}; - var w = watchify(browserify({ - entries: [files.main], - basedir: tmpdir, - cache: cache, - packageCache: {} - })); - - w.require('./lib/abc', {expose: 'abc'}); - w.require('./lib/xyz', {expose: 'xyz'}); - w.on('update', function () { - w.bundle(function (err, src) { - t.ifError(err); - t.equal(run(src), 'ABC XYZ XYZ\n'); - w.close(); - }); - }); - w.bundle(function (err, src) { - t.ifError(err); - t.equal(run(src), 'abc xyz xyz\n'); - setTimeout(function () { - // If we're incorrectly caching exposed files, - // then "files.abc" would be re-read from disk. - cache[files.abc].source = 'module.exports = "ABC";'; - fs.writeFileSync(files.xyz, 'module.exports = "XYZ";'); - }, 1000); - }); -}); - -function run (src) { - var output = ''; - function log (msg) { output += msg + '\n' } - vm.runInNewContext(src, { console: { log: log } }); - return output; -} diff --git a/node_modules/watchify/test/many.js b/node_modules/watchify/test/many.js deleted file mode 100644 index bc6b22cc1..000000000 --- a/node_modules/watchify/test/many.js +++ /dev/null @@ -1,101 +0,0 @@ -var test = require('tape'); -var fs = require('fs'); -var path = require('path'); -var mkdirp = require('mkdirp'); -var spawn = require('win-spawn'); -var split = require('split'); - -var cmd = path.resolve(__dirname, '../bin/cmd.js'); -var os = require('os'); -var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); - -var files = { - main: path.join(tmpdir, 'main.js'), - robot: path.join(tmpdir, 'robot.js'), - lines: path.join(tmpdir, 'lines.txt'), - bundle: path.join(tmpdir, 'bundle.js') -}; - -var edits = [ - { file: 'lines', source: 'robo-boogie' }, - { file: 'lines', source: 'dinosaurus rex' }, - { - file: 'robot', - source: 'module.exports = function (n) { return n * 111 }', - next: true - }, - { file: 'main', source: [ - 'var fs = require("fs");', - 'var robot = require("./robot.js");', - 'var src = fs.readFileSync(__dirname + "/lines.txt", "utf8");', - 'console.log(src.toUpperCase() + " " + robot(src.length));' - ].join('\n') }, - { file: 'lines', source: 't-rex' }, - { - file: 'robot', - source: 'module.exports = function (n) { return n * 100 }', - } -]; - -var expected = [ - 'BEEP\nBOOP\n', - 'ROBO-BOOGIE\n', - 'DINOSAURUS REX\n', - 'DINOSAURUS REX 1554\n', - 'T-REX 555\n', - 'T-REX 500\n' -]; - -mkdirp.sync(tmpdir); -fs.writeFileSync(files.main, [ - 'var fs = require("fs");', - 'var src = fs.readFileSync(__dirname + "/lines.txt", "utf8");', - 'console.log(src.toUpperCase());' -].join('\n')); -fs.writeFileSync(files.lines, 'beep\nboop'); - -test('many edits', function (t) { - t.plan(expected.length * 2 + edits.length); - var ps = spawn(cmd, [ - files.main, - '-t', require.resolve('brfs'), '-v', - '-o', files.bundle - ]); - ps.stdout.pipe(process.stdout); - ps.stderr.pipe(process.stdout); - var lineNum = 0; - ps.stderr.pipe(split()).on('data', function (line) { - if (line.length === 0) return; - - run(files.bundle, function (err, output) { - t.ifError(err); - t.equal(output, expected.shift()); - - (function next () { - if (edits.length === 0) return; - var edit = edits.shift(); - setTimeout(function () { - fs.writeFile(files[edit.file], edit.source, function (err) { - t.ifError(err); - if (edit.next) next(); - }); - }, 25); - })(); - }) - }); - - t.on('end', function () { - ps.kill(); - }); -}); - -function run (file, cb) { - var ps = spawn(process.execPath, [ file ]); - var data = []; - ps.stdout.on('data', function (buf) { data.push(buf) }); - ps.stdout.on('end', function () { - cb(null, Buffer.concat(data).toString('utf8')); - }); - ps.on('error', cb); - return ps; -} diff --git a/node_modules/watchify/test/many_immediate.js b/node_modules/watchify/test/many_immediate.js deleted file mode 100644 index 290b95e83..000000000 --- a/node_modules/watchify/test/many_immediate.js +++ /dev/null @@ -1,99 +0,0 @@ -var test = require('tape'); -var fs = require('fs'); -var path = require('path'); -var mkdirp = require('mkdirp'); -var spawn = require('win-spawn'); -var split = require('split'); - -var cmd = path.resolve(__dirname, '../bin/cmd.js'); -var os = require('os'); -var tmpdir = path.join((os.tmpdir || os.tmpDir)(), 'watchify-' + Math.random()); - -var files = { - main: path.join(tmpdir, 'main.js'), - robot: path.join(tmpdir, 'robot.js'), - lines: path.join(tmpdir, 'lines.txt'), - bundle: path.join(tmpdir, 'bundle.js') -}; - -var edits = [ - { file: 'lines', source: 'robo-boogie' }, - { file: 'lines', source: 'dinosaurus rex' }, - { - file: 'robot', - source: 'module.exports = function (n) { return n * 111 }', - next: true - }, - { file: 'main', source: [ - 'var fs = require("fs");', - 'var robot = require("./robot.js");', - 'var src = fs.readFileSync(__dirname + "/lines.txt", "utf8");', - 'console.log(src.toUpperCase() + " " + robot(src.length));' - ].join('\n') }, - { file: 'lines', source: 't-rex' }, - { - file: 'robot', - source: 'module.exports = function (n) { return n * 100 }', - } -]; - -var expected = [ - 'BEEP\nBOOP\n', - 'ROBO-BOOGIE\n', - 'DINOSAURUS REX\n', - 'DINOSAURUS REX 1554\n', - 'T-REX 555\n', - 'T-REX 500\n' -]; - -mkdirp.sync(tmpdir); -fs.writeFileSync(files.main, [ - 'var fs = require("fs");', - 'var src = fs.readFileSync(__dirname + "/lines.txt", "utf8");', - 'console.log(src.toUpperCase());' -].join('\n')); -fs.writeFileSync(files.lines, 'beep\nboop'); - -test('many immediate', function (t) { - t.plan(expected.length * 2 + edits.length); - var ps = spawn(cmd, [ - files.main, - '-t', require.resolve('brfs'), '-v', - '-o', files.bundle - ]); - ps.stdout.pipe(process.stdout); - ps.stderr.pipe(process.stdout); - var lineNum = 0; - ps.stderr.pipe(split()).on('data', function (line) { - if (line.length === 0) return; - - run(files.bundle, function (err, output) { - t.ifError(err); - t.equal(output, expected.shift()); - - (function next () { - if (edits.length === 0) return; - var edit = edits.shift(); - fs.writeFile(files[edit.file], edit.source, function (err) { - t.ifError(err); - if (edit.next) next(); - }); - })(); - }) - }); - - t.on('end', function () { - ps.kill(); - }); -}); - -function run (file, cb) { - var ps = spawn(process.execPath, [ file ]); - var data = []; - ps.stdout.on('data', function (buf) { data.push(buf) }); - ps.stdout.on('end', function () { - cb(null, Buffer.concat(data).toString('utf8')); - }); - ps.on('error', cb); - return ps; -} diff --git a/node_modules/watchify/test/zzz.js b/node_modules/watchify/test/zzz.js deleted file mode 100644 index bf1ec9190..000000000 --- a/node_modules/watchify/test/zzz.js +++ /dev/null @@ -1,10 +0,0 @@ -var test = require('tape'); - -test('__END__', function (t) { - t.on('end', function () { - setTimeout(function () { - process.exit(0); - }, 100) - }); - t.end(); -}); diff --git a/node_modules/which/CHANGELOG.md b/node_modules/which/CHANGELOG.md deleted file mode 100644 index 3d83d2694..000000000 --- a/node_modules/which/CHANGELOG.md +++ /dev/null @@ -1,152 +0,0 @@ -# Changes - - -## 1.3.1 - -* update deps -* update travis - -## v1.3.0 - -* Add nothrow option to which.sync -* update tap - -## v1.2.14 - -* appveyor: drop node 5 and 0.x -* travis-ci: add node 6, drop 0.x - -## v1.2.13 - -* test: Pass missing option to pass on windows -* update tap -* update isexe to 2.0.0 -* neveragain.tech pledge request - -## v1.2.12 - -* Removed unused require - -## v1.2.11 - -* Prevent changelog script from being included in package - -## v1.2.10 - -* Use env.PATH only, not env.Path - -## v1.2.9 - -* fix for paths starting with ../ -* Remove unused `is-absolute` module - -## v1.2.8 - -* bullet items in changelog that contain (but don't start with) # - -## v1.2.7 - -* strip 'update changelog' changelog entries out of changelog - -## v1.2.6 - -* make the changelog bulleted - -## v1.2.5 - -* make a changelog, and keep it up to date -* don't include tests in package -* Properly handle relative-path executables -* appveyor -* Attach error code to Not Found error -* Make tests pass on Windows - -## v1.2.4 - -* Fix typo - -## v1.2.3 - -* update isexe, fix regression in pathExt handling - -## v1.2.2 - -* update deps, use isexe module, test windows - -## v1.2.1 - -* Sometimes windows PATH entries are quoted -* Fixed a bug in the check for group and user mode bits. This bug was introduced during refactoring for supporting strict mode. -* doc cli - -## v1.2.0 - -* Add support for opt.all and -as cli flags -* test the bin -* update travis -* Allow checking for multiple programs in bin/which -* tap 2 - -## v1.1.2 - -* travis -* Refactored and fixed undefined error on Windows -* Support strict mode - -## v1.1.1 - -* test +g exes against secondary groups, if available -* Use windows exe semantics on cygwin & msys -* cwd should be first in path on win32, not last -* Handle lower-case 'env.Path' on Windows -* Update docs -* use single-quotes - -## v1.1.0 - -* Add tests, depend on is-absolute - -## v1.0.9 - -* which.js: root is allowed to execute files owned by anyone - -## v1.0.8 - -* don't use graceful-fs - -## v1.0.7 - -* add license to package.json - -## v1.0.6 - -* isc license - -## 1.0.5 - -* Awful typo - -## 1.0.4 - -* Test for path absoluteness properly -* win: Allow '' as a pathext if cmd has a . in it - -## 1.0.3 - -* Remove references to execPath -* Make `which.sync()` work on Windows by honoring the PATHEXT variable. -* Make `isExe()` always return true on Windows. -* MIT - -## 1.0.2 - -* Only files can be exes - -## 1.0.1 - -* Respect the PATHEXT env for win32 support -* should 0755 the bin -* binary -* guts -* package -* 1st diff --git a/node_modules/which/LICENSE b/node_modules/which/LICENSE deleted file mode 100644 index 19129e315..000000000 --- a/node_modules/which/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/which/README.md b/node_modules/which/README.md deleted file mode 100644 index 8c0b0cbf7..000000000 --- a/node_modules/which/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# which - -Like the unix `which` utility. - -Finds the first instance of a specified executable in the PATH -environment variable. Does not cache the results, so `hash -r` is not -needed when the PATH changes. - -## USAGE - -```javascript -var which = require('which') - -// async usage -which('node', function (er, resolvedPath) { - // er is returned if no "node" is found on the PATH - // if it is found, then the absolute path to the exec is returned -}) - -// sync usage -// throws if not found -var resolved = which.sync('node') - -// if nothrow option is used, returns null if not found -resolved = which.sync('node', {nothrow: true}) - -// Pass options to override the PATH and PATHEXT environment vars. -which('node', { path: someOtherPath }, function (er, resolved) { - if (er) - throw er - console.log('found at %j', resolved) -}) -``` - -## CLI USAGE - -Same as the BSD `which(1)` binary. - -``` -usage: which [-as] program ... -``` - -## OPTIONS - -You may pass an options object as the second argument. - -- `path`: Use instead of the `PATH` environment variable. -- `pathExt`: Use instead of the `PATHEXT` environment variable. -- `all`: Return all matches, instead of just the first one. Note that - this means the function returns an array of strings instead of a - single string. diff --git a/node_modules/which/bin/which b/node_modules/which/bin/which deleted file mode 100755 index 7cee3729e..000000000 --- a/node_modules/which/bin/which +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env node -var which = require("../") -if (process.argv.length < 3) - usage() - -function usage () { - console.error('usage: which [-as] program ...') - process.exit(1) -} - -var all = false -var silent = false -var dashdash = false -var args = process.argv.slice(2).filter(function (arg) { - if (dashdash || !/^-/.test(arg)) - return true - - if (arg === '--') { - dashdash = true - return false - } - - var flags = arg.substr(1).split('') - for (var f = 0; f < flags.length; f++) { - var flag = flags[f] - switch (flag) { - case 's': - silent = true - break - case 'a': - all = true - break - default: - console.error('which: illegal option -- ' + flag) - usage() - } - } - return false -}) - -process.exit(args.reduce(function (pv, current) { - try { - var f = which.sync(current, { all: all }) - if (all) - f = f.join('\n') - if (!silent) - console.log(f) - return pv; - } catch (e) { - return 1; - } -}, 0)) diff --git a/node_modules/which/package.json b/node_modules/which/package.json deleted file mode 100644 index dd1618223..000000000 --- a/node_modules/which/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_from": "which@^1.2.9", - "_id": "which@1.3.1", - "_inBundle": false, - "_integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "_location": "/which", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "which@^1.2.9", - "name": "which", - "escapedName": "which", - "rawSpec": "^1.2.9", - "saveSpec": null, - "fetchSpec": "^1.2.9" - }, - "_requiredBy": [ - "/cross-spawn", - "/pem" - ], - "_resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "_shasum": "a45043d54f5805316da8d62f9f50918d3da70b0a", - "_spec": "which@^1.2.9", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/cross-spawn", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "bin": { - "which": "./bin/which" - }, - "bugs": { - "url": "https://github.com/isaacs/node-which/issues" - }, - "bundleDependencies": false, - "dependencies": { - "isexe": "^2.0.0" - }, - "deprecated": false, - "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", - "devDependencies": { - "mkdirp": "^0.5.0", - "rimraf": "^2.6.2", - "tap": "^12.0.1" - }, - "files": [ - "which.js", - "bin/which" - ], - "homepage": "https://github.com/isaacs/node-which#readme", - "license": "ISC", - "main": "which.js", - "name": "which", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-which.git" - }, - "scripts": { - "changelog": "bash gen-changelog.sh", - "postversion": "npm run changelog && git add CHANGELOG.md && git commit -m 'update changelog - '${npm_package_version}", - "test": "tap test/*.js --cov" - }, - "version": "1.3.1" -} diff --git a/node_modules/which/which.js b/node_modules/which/which.js deleted file mode 100644 index 4347f91a1..000000000 --- a/node_modules/which/which.js +++ /dev/null @@ -1,135 +0,0 @@ -module.exports = which -which.sync = whichSync - -var isWindows = process.platform === 'win32' || - process.env.OSTYPE === 'cygwin' || - process.env.OSTYPE === 'msys' - -var path = require('path') -var COLON = isWindows ? ';' : ':' -var isexe = require('isexe') - -function getNotFoundError (cmd) { - var er = new Error('not found: ' + cmd) - er.code = 'ENOENT' - - return er -} - -function getPathInfo (cmd, opt) { - var colon = opt.colon || COLON - var pathEnv = opt.path || process.env.PATH || '' - var pathExt = [''] - - pathEnv = pathEnv.split(colon) - - var pathExtExe = '' - if (isWindows) { - pathEnv.unshift(process.cwd()) - pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM') - pathExt = pathExtExe.split(colon) - - - // Always test the cmd itself first. isexe will check to make sure - // it's found in the pathExt set. - if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') - pathExt.unshift('') - } - - // If it has a slash, then we don't bother searching the pathenv. - // just check the file itself, and that's it. - if (cmd.match(/\//) || isWindows && cmd.match(/\\/)) - pathEnv = [''] - - return { - env: pathEnv, - ext: pathExt, - extExe: pathExtExe - } -} - -function which (cmd, opt, cb) { - if (typeof opt === 'function') { - cb = opt - opt = {} - } - - var info = getPathInfo(cmd, opt) - var pathEnv = info.env - var pathExt = info.ext - var pathExtExe = info.extExe - var found = [] - - ;(function F (i, l) { - if (i === l) { - if (opt.all && found.length) - return cb(null, found) - else - return cb(getNotFoundError(cmd)) - } - - var pathPart = pathEnv[i] - if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') - pathPart = pathPart.slice(1, -1) - - var p = path.join(pathPart, cmd) - if (!pathPart && (/^\.[\\\/]/).test(cmd)) { - p = cmd.slice(0, 2) + p - } - ;(function E (ii, ll) { - if (ii === ll) return F(i + 1, l) - var ext = pathExt[ii] - isexe(p + ext, { pathExt: pathExtExe }, function (er, is) { - if (!er && is) { - if (opt.all) - found.push(p + ext) - else - return cb(null, p + ext) - } - return E(ii + 1, ll) - }) - })(0, pathExt.length) - })(0, pathEnv.length) -} - -function whichSync (cmd, opt) { - opt = opt || {} - - var info = getPathInfo(cmd, opt) - var pathEnv = info.env - var pathExt = info.ext - var pathExtExe = info.extExe - var found = [] - - for (var i = 0, l = pathEnv.length; i < l; i ++) { - var pathPart = pathEnv[i] - if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') - pathPart = pathPart.slice(1, -1) - - var p = path.join(pathPart, cmd) - if (!pathPart && /^\.[\\\/]/.test(cmd)) { - p = cmd.slice(0, 2) + p - } - for (var j = 0, ll = pathExt.length; j < ll; j ++) { - var cur = p + pathExt[j] - var is - try { - is = isexe.sync(cur, { pathExt: pathExtExe }) - if (is) { - if (opt.all) - found.push(cur) - else - return cur - } - } catch (ex) {} - } - } - - if (opt.all && found.length) - return found - - if (opt.nothrow) - return null - - throw getNotFoundError(cmd) -} diff --git a/node_modules/wrappy/LICENSE b/node_modules/wrappy/LICENSE deleted file mode 100644 index 19129e315..000000000 --- a/node_modules/wrappy/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/wrappy/README.md b/node_modules/wrappy/README.md deleted file mode 100644 index 98eab2522..000000000 --- a/node_modules/wrappy/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# wrappy - -Callback wrapping utility - -## USAGE - -```javascript -var wrappy = require("wrappy") - -// var wrapper = wrappy(wrapperFunction) - -// make sure a cb is called only once -// See also: http://npm.im/once for this specific use case -var once = wrappy(function (cb) { - var called = false - return function () { - if (called) return - called = true - return cb.apply(this, arguments) - } -}) - -function printBoo () { - console.log('boo') -} -// has some rando property -printBoo.iAmBooPrinter = true - -var onlyPrintOnce = once(printBoo) - -onlyPrintOnce() // prints 'boo' -onlyPrintOnce() // does nothing - -// random property is retained! -assert.equal(onlyPrintOnce.iAmBooPrinter, true) -``` diff --git a/node_modules/wrappy/package.json b/node_modules/wrappy/package.json deleted file mode 100644 index 235412881..000000000 --- a/node_modules/wrappy/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "_from": "wrappy@1", - "_id": "wrappy@1.0.2", - "_inBundle": false, - "_integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "_location": "/wrappy", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "wrappy@1", - "name": "wrappy", - "escapedName": "wrappy", - "rawSpec": "1", - "saveSpec": null, - "fetchSpec": "1" - }, - "_requiredBy": [ - "/inflight", - "/map-limit/once", - "/once" - ], - "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "_shasum": "b5243d8f3ec1aa35f1364605bc0d1036e30ab69f", - "_spec": "wrappy@1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/inflight", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/npm/wrappy/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Callback wrapping utility", - "devDependencies": { - "tap": "^2.3.1" - }, - "directories": { - "test": "test" - }, - "files": [ - "wrappy.js" - ], - "homepage": "https://github.com/npm/wrappy", - "license": "ISC", - "main": "wrappy.js", - "name": "wrappy", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/wrappy.git" - }, - "scripts": { - "test": "tap --coverage test/*.js" - }, - "version": "1.0.2" -} diff --git a/node_modules/wrappy/wrappy.js b/node_modules/wrappy/wrappy.js deleted file mode 100644 index bb7e7d6fc..000000000 --- a/node_modules/wrappy/wrappy.js +++ /dev/null @@ -1,33 +0,0 @@ -// Returns a wrapper function that returns a wrapped callback -// The wrapper function should do some stuff, and return a -// presumably different callback function. -// This makes sure that own properties are retained, so that -// decorations and such are not lost along the way. -module.exports = wrappy -function wrappy (fn, cb) { - if (fn && cb) return wrappy(fn)(cb) - - if (typeof fn !== 'function') - throw new TypeError('need wrapper function') - - Object.keys(fn).forEach(function (k) { - wrapper[k] = fn[k] - }) - - return wrapper - - function wrapper() { - var args = new Array(arguments.length) - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i] - } - var ret = fn.apply(this, args) - var cb = args[args.length-1] - if (typeof ret === 'function' && ret !== cb) { - Object.keys(cb).forEach(function (k) { - ret[k] = cb[k] - }) - } - return ret - } -} diff --git a/node_modules/ws/README.md b/node_modules/ws/README.md deleted file mode 100644 index 93106d7a3..000000000 --- a/node_modules/ws/README.md +++ /dev/null @@ -1,235 +0,0 @@ -# ws: a node.js websocket library - -[![Build Status](https://travis-ci.org/websockets/ws.svg?branch=master)](https://travis-ci.org/websockets/ws) - -`ws` is a simple to use WebSocket implementation, up-to-date against RFC-6455, -and [probably the fastest WebSocket library for node.js][archive]. - -Passes the quite extensive Autobahn test suite. See http://websockets.github.com/ws -for the full reports. - -## Protocol support - -* **Hixie draft 76** (Old and deprecated, but still in use by Safari and Opera. - Added to ws version 0.4.2, but server only. Can be disabled by setting the - `disableHixie` option to true.) -* **HyBi drafts 07-12** (Use the option `protocolVersion: 8`) -* **HyBi drafts 13-17** (Current default, alternatively option `protocolVersion: 13`) - -### Installing - -``` -npm install --save ws -``` - -### Opt-in for performance - -There are 2 optional modules that can be installed along side with the `ws` -module. These modules are binary addons which improve certain operations, but as -they are binary addons they require compilation which can fail if no c++ -compiler is installed on the host system. - -- `npm install --save bufferutil`: Improves internal buffer operations which - allows for faster processing of masked WebSocket frames and general buffer - operations. -- `npm install --save utf-8-validate`: The specification requires validation of - invalid UTF-8 chars, some of these validations could not be done in JavaScript - hence the need for a binary addon. In most cases you will already be - validating the input that you receive for security purposes leading to double - validation. But if you want to be 100% spec-conforming and have fast - validation of UTF-8 then this module is a must. - -### Sending and receiving text data - -```js -var WebSocket = require('ws'); -var ws = new WebSocket('ws://www.host.com/path'); - -ws.on('open', function open() { - ws.send('something'); -}); - -ws.on('message', function(data, flags) { - // flags.binary will be set if a binary data is received. - // flags.masked will be set if the data was masked. -}); -``` - -### Sending binary data - -```js -var WebSocket = require('ws'); -var ws = new WebSocket('ws://www.host.com/path'); - -ws.on('open', function open() { - var array = new Float32Array(5); - - for (var i = 0; i < array.length; ++i) { - array[i] = i / 2; - } - - ws.send(array, { binary: true, mask: true }); -}); -``` - -Setting `mask`, as done for the send options above, will cause the data to be -masked according to the WebSocket protocol. The same option applies for text -data. - -### Server example - -```js -var WebSocketServer = require('ws').Server - , wss = new WebSocketServer({ port: 8080 }); - -wss.on('connection', function connection(ws) { - ws.on('message', function incoming(message) { - console.log('received: %s', message); - }); - - ws.send('something'); -}); -``` - -### ExpressJS example - -```js -var server = require('http').createServer() - , url = require('url') - , WebSocketServer = require('ws').Server - , wss = new WebSocketServer({ server: server }) - , express = require('express') - , app = express() - , port = 4080; - -app.use(function (req, res) { - res.send({ msg: "hello" }); -}); - -wss.on('connection', function connection(ws) { - var location = url.parse(ws.upgradeReq.url, true); - // you might use location.query.access_token to authenticate or share sessions - // or ws.upgradeReq.headers.cookie (see http://stackoverflow.com/a/16395220/151312) - - ws.on('message', function incoming(message) { - console.log('received: %s', message); - }); - - ws.send('something'); -}); - -server.on('request', app); -server.listen(port, function () { console.log('Listening on ' + server.address().port) }); -``` - -### Server sending broadcast data - -```js -var WebSocketServer = require('ws').Server - , wss = new WebSocketServer({ port: 8080 }); - -wss.broadcast = function broadcast(data) { - wss.clients.forEach(function each(client) { - client.send(data); - }); -}; -``` - -### Error handling best practices - -```js -// If the WebSocket is closed before the following send is attempted -ws.send('something'); - -// Errors (both immediate and async write errors) can be detected in an optional -// callback. The callback is also the only way of being notified that data has -// actually been sent. -ws.send('something', function ack(error) { - // if error is not defined, the send has been completed, - // otherwise the error object will indicate what failed. -}); - -// Immediate errors can also be handled with try/catch-blocks, but **note** that -// since sends are inherently asynchronous, socket write failures will *not* be -// captured when this technique is used. -try { ws.send('something'); } -catch (e) { /* handle error */ } -``` - -### echo.websocket.org demo - -```js -var WebSocket = require('ws'); -var ws = new WebSocket('ws://echo.websocket.org/', { - protocolVersion: 8, - origin: 'http://websocket.org' -}); - -ws.on('open', function open() { - console.log('connected'); - ws.send(Date.now().toString(), {mask: true}); -}); - -ws.on('close', function close() { - console.log('disconnected'); -}); - -ws.on('message', function message(data, flags) { - console.log('Roundtrip time: ' + (Date.now() - parseInt(data)) + 'ms', flags); - - setTimeout(function timeout() { - ws.send(Date.now().toString(), {mask: true}); - }, 500); -}); -``` - -### Other examples - -For a full example with a browser client communicating with a ws server, see the -examples folder. - -Note that the usage together with Express 3.0 is quite different from Express -2.x. The difference is expressed in the two different serverstats-examples. - -Otherwise, see the test cases. - -### Running the tests - -``` -make test -``` - -## API Docs - -See [`/doc/ws.md`](https://github.com/websockets/ws/blob/master/doc/ws.md) for Node.js-like docs for the ws classes. - -## Changelog - -We're using the GitHub [`releases`](https://github.com/websockets/ws/releases) for changelog entries. - -## License - -(The MIT License) - -Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.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 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. - -[archive]: http://web.archive.org/web/20130314230536/http://hobbycoding.posterous.com/the-fastest-websocket-module-for-nodejs diff --git a/node_modules/ws/index.js b/node_modules/ws/index.js deleted file mode 100644 index a7e8644b9..000000000 --- a/node_modules/ws/index.js +++ /dev/null @@ -1,49 +0,0 @@ -'use strict'; - -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -var WS = module.exports = require('./lib/WebSocket'); - -WS.Server = require('./lib/WebSocketServer'); -WS.Sender = require('./lib/Sender'); -WS.Receiver = require('./lib/Receiver'); - -/** - * Create a new WebSocket server. - * - * @param {Object} options Server options - * @param {Function} fn Optional connection listener. - * @returns {WS.Server} - * @api public - */ -WS.createServer = function createServer(options, fn) { - var server = new WS.Server(options); - - if (typeof fn === 'function') { - server.on('connection', fn); - } - - return server; -}; - -/** - * Create a new WebSocket connection. - * - * @param {String} address The URL/address we need to connect to. - * @param {Function} fn Open listener. - * @returns {WS} - * @api public - */ -WS.connect = WS.createConnection = function connect(address, fn) { - var client = new WS(address); - - if (typeof fn === 'function') { - client.on('open', fn); - } - - return client; -}; diff --git a/node_modules/ws/lib/.DS_Store b/node_modules/ws/lib/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 - * MIT Licensed - */ - -var util = require('util'); - -function BufferPool(initialSize, growStrategy, shrinkStrategy) { - if (this instanceof BufferPool === false) { - throw new TypeError("Classes can't be function-called"); - } - - if (typeof initialSize === 'function') { - shrinkStrategy = growStrategy; - growStrategy = initialSize; - initialSize = 0; - } - else if (typeof initialSize === 'undefined') { - initialSize = 0; - } - this._growStrategy = (growStrategy || function(db, size) { - return db.used + size; - }).bind(null, this); - this._shrinkStrategy = (shrinkStrategy || function(db) { - return initialSize; - }).bind(null, this); - this._buffer = initialSize ? new Buffer(initialSize) : null; - this._offset = 0; - this._used = 0; - this._changeFactor = 0; - this.__defineGetter__('size', function(){ - return this._buffer == null ? 0 : this._buffer.length; - }); - this.__defineGetter__('used', function(){ - return this._used; - }); -} - -BufferPool.prototype.get = function(length) { - if (this._buffer == null || this._offset + length > this._buffer.length) { - var newBuf = new Buffer(this._growStrategy(length)); - this._buffer = newBuf; - this._offset = 0; - } - this._used += length; - var buf = this._buffer.slice(this._offset, this._offset + length); - this._offset += length; - return buf; -} - -BufferPool.prototype.reset = function(forceNewBuffer) { - var len = this._shrinkStrategy(); - if (len < this.size) this._changeFactor -= 1; - if (forceNewBuffer || this._changeFactor < -2) { - this._changeFactor = 0; - this._buffer = len ? new Buffer(len) : null; - } - this._offset = 0; - this._used = 0; -} - -module.exports = BufferPool; diff --git a/node_modules/ws/lib/BufferUtil.fallback.js b/node_modules/ws/lib/BufferUtil.fallback.js deleted file mode 100644 index 7abd0d8a6..000000000 --- a/node_modules/ws/lib/BufferUtil.fallback.js +++ /dev/null @@ -1,47 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -exports.BufferUtil = { - merge: function(mergedBuffer, buffers) { - var offset = 0; - for (var i = 0, l = buffers.length; i < l; ++i) { - var buf = buffers[i]; - buf.copy(mergedBuffer, offset); - offset += buf.length; - } - }, - mask: function(source, mask, output, offset, length) { - var maskNum = mask.readUInt32LE(0, true); - var i = 0; - for (; i < length - 3; i += 4) { - var num = maskNum ^ source.readUInt32LE(i, true); - if (num < 0) num = 4294967296 + num; - output.writeUInt32LE(num, offset + i, true); - } - switch (length % 4) { - case 3: output[offset + i + 2] = source[i + 2] ^ mask[2]; - case 2: output[offset + i + 1] = source[i + 1] ^ mask[1]; - case 1: output[offset + i] = source[i] ^ mask[0]; - case 0:; - } - }, - unmask: function(data, mask) { - var maskNum = mask.readUInt32LE(0, true); - var length = data.length; - var i = 0; - for (; i < length - 3; i += 4) { - var num = maskNum ^ data.readUInt32LE(i, true); - if (num < 0) num = 4294967296 + num; - data.writeUInt32LE(num, i, true); - } - switch (length % 4) { - case 3: data[i + 2] = data[i + 2] ^ mask[2]; - case 2: data[i + 1] = data[i + 1] ^ mask[1]; - case 1: data[i] = data[i] ^ mask[0]; - case 0:; - } - } -} diff --git a/node_modules/ws/lib/BufferUtil.js b/node_modules/ws/lib/BufferUtil.js deleted file mode 100644 index 794684f5f..000000000 --- a/node_modules/ws/lib/BufferUtil.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -var bufferUtil; - -try { - bufferUtil = require('bufferutil'); -} catch (e) { - bufferUtil = require('./BufferUtil.fallback'); -} - -module.exports = bufferUtil.BufferUtil || bufferUtil; diff --git a/node_modules/ws/lib/ErrorCodes.js b/node_modules/ws/lib/ErrorCodes.js deleted file mode 100644 index 55ebd529b..000000000 --- a/node_modules/ws/lib/ErrorCodes.js +++ /dev/null @@ -1,24 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -module.exports = { - isValidErrorCode: function(code) { - return (code >= 1000 && code <= 1011 && code != 1004 && code != 1005 && code != 1006) || - (code >= 3000 && code <= 4999); - }, - 1000: 'normal', - 1001: 'going away', - 1002: 'protocol error', - 1003: 'unsupported data', - 1004: 'reserved', - 1005: 'reserved for extensions', - 1006: 'reserved for extensions', - 1007: 'inconsistent or invalid data', - 1008: 'policy violation', - 1009: 'message too big', - 1010: 'extension handshake missing', - 1011: 'an unexpected condition prevented the request from being fulfilled', -}; \ No newline at end of file diff --git a/node_modules/ws/lib/Extensions.js b/node_modules/ws/lib/Extensions.js deleted file mode 100644 index 669b1a4bf..000000000 --- a/node_modules/ws/lib/Extensions.js +++ /dev/null @@ -1,81 +0,0 @@ - -var util = require('util'); - -/** - * Module exports. - */ - -exports.parse = parse; -exports.format = format; - -/** - * Parse extensions header value - */ - -function parse(value) { - value = value || ''; - - var extensions = {}; - - value.split(',').forEach(function(v) { - var params = v.split(';'); - var token = params.shift().trim(); - - if (extensions[token] === undefined) { - extensions[token] = []; - } else if (!extensions.hasOwnProperty(token)) { - return; - } - - var parsedParams = {}; - - params.forEach(function(param) { - var parts = param.trim().split('='); - var key = parts[0]; - var value = parts[1]; - if (typeof value === 'undefined') { - value = true; - } else { - // unquote value - if (value[0] === '"') { - value = value.slice(1); - } - if (value[value.length - 1] === '"') { - value = value.slice(0, value.length - 1); - } - } - - if (parsedParams[key] === undefined) { - parsedParams[key] = [value]; - } else if (parsedParams.hasOwnProperty(key)) { - parsedParams[key].push(value); - } - }); - - extensions[token].push(parsedParams); - }); - - return extensions; -} - -/** - * Format extensions header value - */ - -function format(value) { - return Object.keys(value).map(function(token) { - var paramsList = value[token]; - if (!util.isArray(paramsList)) { - paramsList = [paramsList]; - } - return paramsList.map(function(params) { - return [token].concat(Object.keys(params).map(function(k) { - var p = params[k]; - if (!util.isArray(p)) p = [p]; - return p.map(function(v) { - return v === true ? k : k + '=' + v; - }).join('; '); - })).join('; '); - }).join(', '); - }).join(', '); -} diff --git a/node_modules/ws/lib/PerMessageDeflate.js b/node_modules/ws/lib/PerMessageDeflate.js deleted file mode 100644 index 00a6ea62a..000000000 --- a/node_modules/ws/lib/PerMessageDeflate.js +++ /dev/null @@ -1,337 +0,0 @@ - -var zlib = require('zlib'); - -var AVAILABLE_WINDOW_BITS = [8, 9, 10, 11, 12, 13, 14, 15]; -var DEFAULT_WINDOW_BITS = 15; -var DEFAULT_MEM_LEVEL = 8; - -PerMessageDeflate.extensionName = 'permessage-deflate'; - -/** - * Per-message Compression Extensions implementation - */ - -function PerMessageDeflate(options, isServer,maxPayload) { - if (this instanceof PerMessageDeflate === false) { - throw new TypeError("Classes can't be function-called"); - } - - this._options = options || {}; - this._isServer = !!isServer; - this._inflate = null; - this._deflate = null; - this.params = null; - this._maxPayload = maxPayload || 0; -} - -/** - * Create extension parameters offer - * - * @api public - */ - -PerMessageDeflate.prototype.offer = function() { - var params = {}; - if (this._options.serverNoContextTakeover) { - params.server_no_context_takeover = true; - } - if (this._options.clientNoContextTakeover) { - params.client_no_context_takeover = true; - } - if (this._options.serverMaxWindowBits) { - params.server_max_window_bits = this._options.serverMaxWindowBits; - } - if (this._options.clientMaxWindowBits) { - params.client_max_window_bits = this._options.clientMaxWindowBits; - } else if (this._options.clientMaxWindowBits == null) { - params.client_max_window_bits = true; - } - return params; -}; - -/** - * Accept extension offer - * - * @api public - */ - -PerMessageDeflate.prototype.accept = function(paramsList) { - paramsList = this.normalizeParams(paramsList); - - var params; - if (this._isServer) { - params = this.acceptAsServer(paramsList); - } else { - params = this.acceptAsClient(paramsList); - } - - this.params = params; - return params; -}; - -/** - * Releases all resources used by the extension - * - * @api public - */ - -PerMessageDeflate.prototype.cleanup = function() { - if (this._inflate) { - if (this._inflate.writeInProgress) { - this._inflate.pendingClose = true; - } else { - if (this._inflate.close) this._inflate.close(); - this._inflate = null; - } - } - if (this._deflate) { - if (this._deflate.writeInProgress) { - this._deflate.pendingClose = true; - } else { - if (this._deflate.close) this._deflate.close(); - this._deflate = null; - } - } -}; - -/** - * Accept extension offer from client - * - * @api private - */ - -PerMessageDeflate.prototype.acceptAsServer = function(paramsList) { - var accepted = {}; - var result = paramsList.some(function(params) { - accepted = {}; - if (this._options.serverNoContextTakeover === false && params.server_no_context_takeover) { - return; - } - if (this._options.serverMaxWindowBits === false && params.server_max_window_bits) { - return; - } - if (typeof this._options.serverMaxWindowBits === 'number' && - typeof params.server_max_window_bits === 'number' && - this._options.serverMaxWindowBits > params.server_max_window_bits) { - return; - } - if (typeof this._options.clientMaxWindowBits === 'number' && !params.client_max_window_bits) { - return; - } - - if (this._options.serverNoContextTakeover || params.server_no_context_takeover) { - accepted.server_no_context_takeover = true; - } - if (this._options.clientNoContextTakeover) { - accepted.client_no_context_takeover = true; - } - if (this._options.clientNoContextTakeover !== false && params.client_no_context_takeover) { - accepted.client_no_context_takeover = true; - } - if (typeof this._options.serverMaxWindowBits === 'number') { - accepted.server_max_window_bits = this._options.serverMaxWindowBits; - } else if (typeof params.server_max_window_bits === 'number') { - accepted.server_max_window_bits = params.server_max_window_bits; - } - if (typeof this._options.clientMaxWindowBits === 'number') { - accepted.client_max_window_bits = this._options.clientMaxWindowBits; - } else if (this._options.clientMaxWindowBits !== false && typeof params.client_max_window_bits === 'number') { - accepted.client_max_window_bits = params.client_max_window_bits; - } - return true; - }, this); - - if (!result) { - throw new Error('Doesn\'t support the offered configuration'); - } - - return accepted; -}; - -/** - * Accept extension response from server - * - * @api privaye - */ - -PerMessageDeflate.prototype.acceptAsClient = function(paramsList) { - var params = paramsList[0]; - if (this._options.clientNoContextTakeover != null) { - if (this._options.clientNoContextTakeover === false && params.client_no_context_takeover) { - throw new Error('Invalid value for "client_no_context_takeover"'); - } - } - if (this._options.clientMaxWindowBits != null) { - if (this._options.clientMaxWindowBits === false && params.client_max_window_bits) { - throw new Error('Invalid value for "client_max_window_bits"'); - } - if (typeof this._options.clientMaxWindowBits === 'number' && - (!params.client_max_window_bits || params.client_max_window_bits > this._options.clientMaxWindowBits)) { - throw new Error('Invalid value for "client_max_window_bits"'); - } - } - return params; -}; - -/** - * Normalize extensions parameters - * - * @api private - */ - -PerMessageDeflate.prototype.normalizeParams = function(paramsList) { - return paramsList.map(function(params) { - Object.keys(params).forEach(function(key) { - var value = params[key]; - if (value.length > 1) { - throw new Error('Multiple extension parameters for ' + key); - } - - value = value[0]; - - switch (key) { - case 'server_no_context_takeover': - case 'client_no_context_takeover': - if (value !== true) { - throw new Error('invalid extension parameter value for ' + key + ' (' + value + ')'); - } - params[key] = true; - break; - case 'server_max_window_bits': - case 'client_max_window_bits': - if (typeof value === 'string') { - value = parseInt(value, 10); - if (!~AVAILABLE_WINDOW_BITS.indexOf(value)) { - throw new Error('invalid extension parameter value for ' + key + ' (' + value + ')'); - } - } - if (!this._isServer && value === true) { - throw new Error('Missing extension parameter value for ' + key); - } - params[key] = value; - break; - default: - throw new Error('Not defined extension parameter (' + key + ')'); - } - }, this); - return params; - }, this); -}; - -/** - * Decompress message - * - * @api public - */ - -PerMessageDeflate.prototype.decompress = function (data, fin, callback) { - var endpoint = this._isServer ? 'client' : 'server'; - - if (!this._inflate) { - var maxWindowBits = this.params[endpoint + '_max_window_bits']; - this._inflate = zlib.createInflateRaw({ - windowBits: 'number' === typeof maxWindowBits ? maxWindowBits : DEFAULT_WINDOW_BITS - }); - } - this._inflate.writeInProgress = true; - - var self = this; - var buffers = []; - var cumulativeBufferLength=0; - - this._inflate.on('error', onError).on('data', onData); - this._inflate.write(data); - if (fin) { - this._inflate.write(new Buffer([0x00, 0x00, 0xff, 0xff])); - } - this._inflate.flush(function() { - cleanup(); - callback(null, Buffer.concat(buffers)); - }); - - function onError(err) { - cleanup(); - callback(err); - } - - function onData(data) { - if(self._maxPayload!==undefined && self._maxPayload!==null && self._maxPayload>0){ - cumulativeBufferLength+=data.length; - if(cumulativeBufferLength>self._maxPayload){ - buffers=[]; - cleanup(); - var err={type:1009}; - callback(err); - return; - } - } - buffers.push(data); - } - - function cleanup() { - if (!self._inflate) return; - self._inflate.removeListener('error', onError); - self._inflate.removeListener('data', onData); - self._inflate.writeInProgress = false; - if ((fin && self.params[endpoint + '_no_context_takeover']) || self._inflate.pendingClose) { - if (self._inflate.close) self._inflate.close(); - self._inflate = null; - } - } -}; - -/** - * Compress message - * - * @api public - */ - -PerMessageDeflate.prototype.compress = function (data, fin, callback) { - var endpoint = this._isServer ? 'server' : 'client'; - - if (!this._deflate) { - var maxWindowBits = this.params[endpoint + '_max_window_bits']; - this._deflate = zlib.createDeflateRaw({ - flush: zlib.Z_SYNC_FLUSH, - windowBits: 'number' === typeof maxWindowBits ? maxWindowBits : DEFAULT_WINDOW_BITS, - memLevel: this._options.memLevel || DEFAULT_MEM_LEVEL - }); - } - this._deflate.writeInProgress = true; - - var self = this; - var buffers = []; - - this._deflate.on('error', onError).on('data', onData); - this._deflate.write(data); - this._deflate.flush(function() { - cleanup(); - var data = Buffer.concat(buffers); - if (fin) { - data = data.slice(0, data.length - 4); - } - callback(null, data); - }); - - function onError(err) { - cleanup(); - callback(err); - } - - function onData(data) { - buffers.push(data); - } - - function cleanup() { - if (!self._deflate) return; - self._deflate.removeListener('error', onError); - self._deflate.removeListener('data', onData); - self._deflate.writeInProgress = false; - if ((fin && self.params[endpoint + '_no_context_takeover']) || self._deflate.pendingClose) { - if (self._deflate.close) self._deflate.close(); - self._deflate = null; - } - } -}; - -module.exports = PerMessageDeflate; diff --git a/node_modules/ws/lib/Receiver.hixie.js b/node_modules/ws/lib/Receiver.hixie.js deleted file mode 100644 index 598ccbdaf..000000000 --- a/node_modules/ws/lib/Receiver.hixie.js +++ /dev/null @@ -1,194 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -var util = require('util'); - -/** - * State constants - */ - -var EMPTY = 0 - , BODY = 1; -var BINARYLENGTH = 2 - , BINARYBODY = 3; - -/** - * Hixie Receiver implementation - */ - -function Receiver () { - if (this instanceof Receiver === false) { - throw new TypeError("Classes can't be function-called"); - } - - this.state = EMPTY; - this.buffers = []; - this.messageEnd = -1; - this.spanLength = 0; - this.dead = false; - - this.onerror = function() {}; - this.ontext = function() {}; - this.onbinary = function() {}; - this.onclose = function() {}; - this.onping = function() {}; - this.onpong = function() {}; -} - -module.exports = Receiver; - -/** - * Add new data to the parser. - * - * @api public - */ - -Receiver.prototype.add = function(data) { - if (this.dead) return; - var self = this; - function doAdd() { - if (self.state === EMPTY) { - if (data.length == 2 && data[0] == 0xFF && data[1] == 0x00) { - self.reset(); - self.onclose(); - return; - } - if (data[0] === 0x80) { - self.messageEnd = 0; - self.state = BINARYLENGTH; - data = data.slice(1); - } else { - - if (data[0] !== 0x00) { - self.error('payload must start with 0x00 byte', true); - return; - } - data = data.slice(1); - self.state = BODY; - - } - } - if (self.state === BINARYLENGTH) { - var i = 0; - while ((i < data.length) && (data[i] & 0x80)) { - self.messageEnd = 128 * self.messageEnd + (data[i] & 0x7f); - ++i; - } - if (i < data.length) { - self.messageEnd = 128 * self.messageEnd + (data[i] & 0x7f); - self.state = BINARYBODY; - ++i; - } - if (i > 0) - data = data.slice(i); - } - if (self.state === BINARYBODY) { - var dataleft = self.messageEnd - self.spanLength; - if (data.length >= dataleft) { - // consume the whole buffer to finish the frame - self.buffers.push(data); - self.spanLength += dataleft; - self.messageEnd = dataleft; - return self.parse(); - } - // frame's not done even if we consume it all - self.buffers.push(data); - self.spanLength += data.length; - return; - } - self.buffers.push(data); - if ((self.messageEnd = bufferIndex(data, 0xFF)) != -1) { - self.spanLength += self.messageEnd; - return self.parse(); - } - else self.spanLength += data.length; - } - while(data) data = doAdd(); -}; - -/** - * Releases all resources used by the receiver. - * - * @api public - */ - -Receiver.prototype.cleanup = function() { - this.dead = true; - this.state = EMPTY; - this.buffers = []; -}; - -/** - * Process buffered data. - * - * @api public - */ - -Receiver.prototype.parse = function() { - var output = new Buffer(this.spanLength); - var outputIndex = 0; - for (var bi = 0, bl = this.buffers.length; bi < bl - 1; ++bi) { - var buffer = this.buffers[bi]; - buffer.copy(output, outputIndex); - outputIndex += buffer.length; - } - var lastBuffer = this.buffers[this.buffers.length - 1]; - if (this.messageEnd > 0) lastBuffer.copy(output, outputIndex, 0, this.messageEnd); - if (this.state !== BODY) --this.messageEnd; - var tail = null; - if (this.messageEnd < lastBuffer.length - 1) { - tail = lastBuffer.slice(this.messageEnd + 1); - } - this.reset(); - this.ontext(output.toString('utf8')); - return tail; -}; - -/** - * Handles an error - * - * @api private - */ - -Receiver.prototype.error = function (reason, terminate) { - if (this.dead) return; - this.reset(); - if(typeof reason == 'string'){ - this.onerror(new Error(reason), terminate); - } - else if(reason.constructor == Error){ - this.onerror(reason, terminate); - } - else{ - this.onerror(new Error("An error occured"),terminate); - } - return this; -}; - -/** - * Reset parser state - * - * @api private - */ - -Receiver.prototype.reset = function (reason) { - if (this.dead) return; - this.state = EMPTY; - this.buffers = []; - this.messageEnd = -1; - this.spanLength = 0; -}; - -/** - * Internal api - */ - -function bufferIndex(buffer, byte) { - for (var i = 0, l = buffer.length; i < l; ++i) { - if (buffer[i] === byte) return i; - } - return -1; -} diff --git a/node_modules/ws/lib/Receiver.js b/node_modules/ws/lib/Receiver.js deleted file mode 100644 index acbe62125..000000000 --- a/node_modules/ws/lib/Receiver.js +++ /dev/null @@ -1,793 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -var util = require('util') - , isValidUTF8 = require('./Validation') - , ErrorCodes = require('./ErrorCodes') - , BufferPool = require('./BufferPool') - , bufferUtil = require('./BufferUtil') - , PerMessageDeflate = require('./PerMessageDeflate'); - -/** - * HyBi Receiver implementation - */ - -function Receiver (extensions,maxPayload) { - if (this instanceof Receiver === false) { - throw new TypeError("Classes can't be function-called"); - } - if(typeof extensions==='number'){ - maxPayload=extensions; - extensions={}; - } - - - // memory pool for fragmented messages - var fragmentedPoolPrevUsed = -1; - this.fragmentedBufferPool = new BufferPool(1024, function(db, length) { - return db.used + length; - }, function(db) { - return fragmentedPoolPrevUsed = fragmentedPoolPrevUsed >= 0 ? - Math.ceil((fragmentedPoolPrevUsed + db.used) / 2) : - db.used; - }); - - // memory pool for unfragmented messages - var unfragmentedPoolPrevUsed = -1; - this.unfragmentedBufferPool = new BufferPool(1024, function(db, length) { - return db.used + length; - }, function(db) { - return unfragmentedPoolPrevUsed = unfragmentedPoolPrevUsed >= 0 ? - Math.ceil((unfragmentedPoolPrevUsed + db.used) / 2) : - db.used; - }); - this.extensions = extensions || {}; - this.maxPayload = maxPayload || 0; - this.currentPayloadLength = 0; - this.state = { - activeFragmentedOperation: null, - lastFragment: false, - masked: false, - opcode: 0, - fragmentedOperation: false - }; - this.overflow = []; - this.headerBuffer = new Buffer(10); - this.expectOffset = 0; - this.expectBuffer = null; - this.expectHandler = null; - this.currentMessage = []; - this.currentMessageLength = 0; - this.messageHandlers = []; - this.expectHeader(2, this.processPacket); - this.dead = false; - this.processing = false; - - this.onerror = function() {}; - this.ontext = function() {}; - this.onbinary = function() {}; - this.onclose = function() {}; - this.onping = function() {}; - this.onpong = function() {}; -} - -module.exports = Receiver; - -/** - * Add new data to the parser. - * - * @api public - */ - -Receiver.prototype.add = function(data) { - if (this.dead) return; - var dataLength = data.length; - if (dataLength == 0) return; - if (this.expectBuffer == null) { - this.overflow.push(data); - return; - } - var toRead = Math.min(dataLength, this.expectBuffer.length - this.expectOffset); - fastCopy(toRead, data, this.expectBuffer, this.expectOffset); - this.expectOffset += toRead; - if (toRead < dataLength) { - this.overflow.push(data.slice(toRead)); - } - while (this.expectBuffer && this.expectOffset == this.expectBuffer.length) { - var bufferForHandler = this.expectBuffer; - this.expectBuffer = null; - this.expectOffset = 0; - this.expectHandler.call(this, bufferForHandler); - } -}; - -/** - * Releases all resources used by the receiver. - * - * @api public - */ - -Receiver.prototype.cleanup = function() { - this.dead = true; - this.overflow = null; - this.headerBuffer = null; - this.expectBuffer = null; - this.expectHandler = null; - this.unfragmentedBufferPool = null; - this.fragmentedBufferPool = null; - this.state = null; - this.currentMessage = null; - this.onerror = null; - this.ontext = null; - this.onbinary = null; - this.onclose = null; - this.onping = null; - this.onpong = null; -}; - -/** - * Waits for a certain amount of header bytes to be available, then fires a callback. - * - * @api private - */ - -Receiver.prototype.expectHeader = function(length, handler) { - if (length == 0) { - handler(null); - return; - } - this.expectBuffer = this.headerBuffer.slice(this.expectOffset, this.expectOffset + length); - this.expectHandler = handler; - var toRead = length; - while (toRead > 0 && this.overflow.length > 0) { - var fromOverflow = this.overflow.pop(); - if (toRead < fromOverflow.length) this.overflow.push(fromOverflow.slice(toRead)); - var read = Math.min(fromOverflow.length, toRead); - fastCopy(read, fromOverflow, this.expectBuffer, this.expectOffset); - this.expectOffset += read; - toRead -= read; - } -}; - -/** - * Waits for a certain amount of data bytes to be available, then fires a callback. - * - * @api private - */ - -Receiver.prototype.expectData = function(length, handler) { - if (length == 0) { - handler(null); - return; - } - this.expectBuffer = this.allocateFromPool(length, this.state.fragmentedOperation); - this.expectHandler = handler; - var toRead = length; - while (toRead > 0 && this.overflow.length > 0) { - var fromOverflow = this.overflow.pop(); - if (toRead < fromOverflow.length) this.overflow.push(fromOverflow.slice(toRead)); - var read = Math.min(fromOverflow.length, toRead); - fastCopy(read, fromOverflow, this.expectBuffer, this.expectOffset); - this.expectOffset += read; - toRead -= read; - } -}; - -/** - * Allocates memory from the buffer pool. - * - * @api private - */ - -Receiver.prototype.allocateFromPool = function(length, isFragmented) { - return (isFragmented ? this.fragmentedBufferPool : this.unfragmentedBufferPool).get(length); -}; - -/** - * Start processing a new packet. - * - * @api private - */ - -Receiver.prototype.processPacket = function (data) { - if (this.extensions[PerMessageDeflate.extensionName]) { - if ((data[0] & 0x30) != 0) { - this.error('reserved fields (2, 3) must be empty', 1002); - return; - } - } else { - if ((data[0] & 0x70) != 0) { - this.error('reserved fields must be empty', 1002); - return; - } - } - this.state.lastFragment = (data[0] & 0x80) == 0x80; - this.state.masked = (data[1] & 0x80) == 0x80; - var compressed = (data[0] & 0x40) == 0x40; - var opcode = data[0] & 0xf; - if (opcode === 0) { - if (compressed) { - this.error('continuation frame cannot have the Per-message Compressed bits', 1002); - return; - } - // continuation frame - this.state.fragmentedOperation = true; - this.state.opcode = this.state.activeFragmentedOperation; - if (!(this.state.opcode == 1 || this.state.opcode == 2)) { - this.error('continuation frame cannot follow current opcode', 1002); - return; - } - } - else { - if (opcode < 3 && this.state.activeFragmentedOperation != null) { - this.error('data frames after the initial data frame must have opcode 0', 1002); - return; - } - if (opcode >= 8 && compressed) { - this.error('control frames cannot have the Per-message Compressed bits', 1002); - return; - } - this.state.compressed = compressed; - this.state.opcode = opcode; - if (this.state.lastFragment === false) { - this.state.fragmentedOperation = true; - this.state.activeFragmentedOperation = opcode; - } - else this.state.fragmentedOperation = false; - } - var handler = opcodes[this.state.opcode]; - if (typeof handler == 'undefined') this.error('no handler for opcode ' + this.state.opcode, 1002); - else { - handler.start.call(this, data); - } -}; - -/** - * Endprocessing a packet. - * - * @api private - */ - -Receiver.prototype.endPacket = function() { - if (this.dead) return; - if (!this.state.fragmentedOperation) this.unfragmentedBufferPool.reset(true); - else if (this.state.lastFragment) this.fragmentedBufferPool.reset(true); - this.expectOffset = 0; - this.expectBuffer = null; - this.expectHandler = null; - if (this.state.lastFragment && this.state.opcode === this.state.activeFragmentedOperation) { - // end current fragmented operation - this.state.activeFragmentedOperation = null; - } - this.currentPayloadLength = 0; - this.state.lastFragment = false; - this.state.opcode = this.state.activeFragmentedOperation != null ? this.state.activeFragmentedOperation : 0; - this.state.masked = false; - this.expectHeader(2, this.processPacket); -}; - -/** - * Reset the parser state. - * - * @api private - */ - -Receiver.prototype.reset = function() { - if (this.dead) return; - this.state = { - activeFragmentedOperation: null, - lastFragment: false, - masked: false, - opcode: 0, - fragmentedOperation: false - }; - this.fragmentedBufferPool.reset(true); - this.unfragmentedBufferPool.reset(true); - this.expectOffset = 0; - this.expectBuffer = null; - this.expectHandler = null; - this.overflow = []; - this.currentMessage = []; - this.currentMessageLength = 0; - this.messageHandlers = []; - this.currentPayloadLength = 0; -}; - -/** - * Unmask received data. - * - * @api private - */ - -Receiver.prototype.unmask = function (mask, buf, binary) { - if (mask != null && buf != null) bufferUtil.unmask(buf, mask); - if (binary) return buf; - return buf != null ? buf.toString('utf8') : ''; -}; - -/** - * Handles an error - * - * @api private - */ - -Receiver.prototype.error = function (reason, protocolErrorCode) { - if (this.dead) return; - this.reset(); - if(typeof reason == 'string'){ - this.onerror(new Error(reason), protocolErrorCode); - } - else if(reason.constructor == Error){ - this.onerror(reason, protocolErrorCode); - } - else{ - this.onerror(new Error("An error occured"),protocolErrorCode); - } - return this; -}; - -/** - * Execute message handler buffers - * - * @api private - */ - -Receiver.prototype.flush = function() { - if (this.processing || this.dead) return; - - var handler = this.messageHandlers.shift(); - if (!handler) return; - - this.processing = true; - var self = this; - - handler(function() { - self.processing = false; - self.flush(); - }); -}; - -/** - * Apply extensions to message - * - * @api private - */ - -Receiver.prototype.applyExtensions = function(messageBuffer, fin, compressed, callback) { - var self = this; - if (compressed) { - this.extensions[PerMessageDeflate.extensionName].decompress(messageBuffer, fin, function(err, buffer) { - if (self.dead) return; - if (err) { - callback(new Error('invalid compressed data')); - return; - } - callback(null, buffer); - }); - } else { - callback(null, messageBuffer); - } -}; - -/** -* Checks payload size, disconnects socket when it exceeds maxPayload -* -* @api private -*/ -Receiver.prototype.maxPayloadExceeded = function(length) { - if (this.maxPayload=== undefined || this.maxPayload === null || this.maxPayload < 1) { - return false; - } - var fullLength = this.currentPayloadLength + length; - if (fullLength < this.maxPayload) { - this.currentPayloadLength = fullLength; - return false; - } - this.error('payload cannot exceed ' + this.maxPayload + ' bytes', 1009); - this.messageBuffer=[]; - this.cleanup(); - - return true; -}; - -/** - * Buffer utilities - */ - -function readUInt16BE(start) { - return (this[start]<<8) + - this[start+1]; -} - -function readUInt32BE(start) { - return (this[start]<<24) + - (this[start+1]<<16) + - (this[start+2]<<8) + - this[start+3]; -} - -function fastCopy(length, srcBuffer, dstBuffer, dstOffset) { - switch (length) { - default: srcBuffer.copy(dstBuffer, dstOffset, 0, length); break; - case 16: dstBuffer[dstOffset+15] = srcBuffer[15]; - case 15: dstBuffer[dstOffset+14] = srcBuffer[14]; - case 14: dstBuffer[dstOffset+13] = srcBuffer[13]; - case 13: dstBuffer[dstOffset+12] = srcBuffer[12]; - case 12: dstBuffer[dstOffset+11] = srcBuffer[11]; - case 11: dstBuffer[dstOffset+10] = srcBuffer[10]; - case 10: dstBuffer[dstOffset+9] = srcBuffer[9]; - case 9: dstBuffer[dstOffset+8] = srcBuffer[8]; - case 8: dstBuffer[dstOffset+7] = srcBuffer[7]; - case 7: dstBuffer[dstOffset+6] = srcBuffer[6]; - case 6: dstBuffer[dstOffset+5] = srcBuffer[5]; - case 5: dstBuffer[dstOffset+4] = srcBuffer[4]; - case 4: dstBuffer[dstOffset+3] = srcBuffer[3]; - case 3: dstBuffer[dstOffset+2] = srcBuffer[2]; - case 2: dstBuffer[dstOffset+1] = srcBuffer[1]; - case 1: dstBuffer[dstOffset] = srcBuffer[0]; - } -} - -function clone(obj) { - var cloned = {}; - for (var k in obj) { - if (obj.hasOwnProperty(k)) { - cloned[k] = obj[k]; - } - } - return cloned; -} - -/** - * Opcode handlers - */ - -var opcodes = { - // text - '1': { - start: function(data) { - var self = this; - // decode length - var firstLength = data[1] & 0x7f; - if (firstLength < 126) { - if (self.maxPayloadExceeded(firstLength)){ - self.error('Maximumpayload exceeded in compressed text message. Aborting...', 1009); - return; - } - opcodes['1'].getData.call(self, firstLength); - } - else if (firstLength == 126) { - self.expectHeader(2, function(data) { - var length = readUInt16BE.call(data, 0); - if (self.maxPayloadExceeded(length)){ - self.error('Maximumpayload exceeded in compressed text message. Aborting...', 1009); - return; - } - opcodes['1'].getData.call(self, length); - }); - } - else if (firstLength == 127) { - self.expectHeader(8, function(data) { - if (readUInt32BE.call(data, 0) != 0) { - self.error('packets with length spanning more than 32 bit is currently not supported', 1008); - return; - } - var length = readUInt32BE.call(data, 4); - if (self.maxPayloadExceeded(length)){ - self.error('Maximumpayload exceeded in compressed text message. Aborting...', 1009); - return; - } - opcodes['1'].getData.call(self, readUInt32BE.call(data, 4)); - }); - } - }, - getData: function(length) { - var self = this; - if (self.state.masked) { - self.expectHeader(4, function(data) { - var mask = data; - self.expectData(length, function(data) { - opcodes['1'].finish.call(self, mask, data); - }); - }); - } - else { - self.expectData(length, function(data) { - opcodes['1'].finish.call(self, null, data); - }); - } - }, - finish: function(mask, data) { - var self = this; - var packet = this.unmask(mask, data, true) || new Buffer(0); - var state = clone(this.state); - this.messageHandlers.push(function(callback) { - self.applyExtensions(packet, state.lastFragment, state.compressed, function(err, buffer) { - if (err) { - if(err.type===1009){ - return self.error('Maximumpayload exceeded in compressed text message. Aborting...', 1009); - } - return self.error(err.message, 1007); - } - if (buffer != null) { - if( self.maxPayload==0 || (self.maxPayload > 0 && (self.currentMessageLength + buffer.length) < self.maxPayload) ){ - self.currentMessage.push(buffer); - } - else{ - self.currentMessage=null; - self.currentMessage = []; - self.currentMessageLength = 0; - self.error(new Error('Maximum payload exceeded. maxPayload: '+self.maxPayload), 1009); - return; - } - self.currentMessageLength += buffer.length; - } - if (state.lastFragment) { - var messageBuffer = Buffer.concat(self.currentMessage); - self.currentMessage = []; - self.currentMessageLength = 0; - if (!isValidUTF8(messageBuffer)) { - self.error('invalid utf8 sequence', 1007); - return; - } - self.ontext(messageBuffer.toString('utf8'), {masked: state.masked, buffer: messageBuffer}); - } - callback(); - }); - }); - this.flush(); - this.endPacket(); - } - }, - // binary - '2': { - start: function(data) { - var self = this; - // decode length - var firstLength = data[1] & 0x7f; - if (firstLength < 126) { - if (self.maxPayloadExceeded(firstLength)){ - self.error('Max payload exceeded in compressed text message. Aborting...', 1009); - return; - } - opcodes['2'].getData.call(self, firstLength); - } - else if (firstLength == 126) { - self.expectHeader(2, function(data) { - var length = readUInt16BE.call(data, 0); - if (self.maxPayloadExceeded(length)){ - self.error('Max payload exceeded in compressed text message. Aborting...', 1009); - return; - } - opcodes['2'].getData.call(self, length); - }); - } - else if (firstLength == 127) { - self.expectHeader(8, function(data) { - if (readUInt32BE.call(data, 0) != 0) { - self.error('packets with length spanning more than 32 bit is currently not supported', 1008); - return; - } - var length = readUInt32BE.call(data, 4, true); - if (self.maxPayloadExceeded(length)){ - self.error('Max payload exceeded in compressed text message. Aborting...', 1009); - return; - } - opcodes['2'].getData.call(self, length); - }); - } - }, - getData: function(length) { - var self = this; - if (self.state.masked) { - self.expectHeader(4, function(data) { - var mask = data; - self.expectData(length, function(data) { - opcodes['2'].finish.call(self, mask, data); - }); - }); - } - else { - self.expectData(length, function(data) { - opcodes['2'].finish.call(self, null, data); - }); - } - }, - finish: function(mask, data) { - var self = this; - var packet = this.unmask(mask, data, true) || new Buffer(0); - var state = clone(this.state); - this.messageHandlers.push(function(callback) { - self.applyExtensions(packet, state.lastFragment, state.compressed, function(err, buffer) { - if (err) { - if(err.type===1009){ - return self.error('Max payload exceeded in compressed binary message. Aborting...', 1009); - } - return self.error(err.message, 1007); - } - if (buffer != null) { - if( self.maxPayload==0 || (self.maxPayload > 0 && (self.currentMessageLength + buffer.length) < self.maxPayload) ){ - self.currentMessage.push(buffer); - } - else{ - self.currentMessage=null; - self.currentMessage = []; - self.currentMessageLength = 0; - self.error(new Error('Maximum payload exceeded'), 1009); - return; - } - self.currentMessageLength += buffer.length; - } - if (state.lastFragment) { - var messageBuffer = Buffer.concat(self.currentMessage); - self.currentMessage = []; - self.currentMessageLength = 0; - self.onbinary(messageBuffer, {masked: state.masked, buffer: messageBuffer}); - } - callback(); - }); - }); - this.flush(); - this.endPacket(); - } - }, - // close - '8': { - start: function(data) { - var self = this; - if (self.state.lastFragment == false) { - self.error('fragmented close is not supported', 1002); - return; - } - - // decode length - var firstLength = data[1] & 0x7f; - if (firstLength < 126) { - opcodes['8'].getData.call(self, firstLength); - } - else { - self.error('control frames cannot have more than 125 bytes of data', 1002); - } - }, - getData: function(length) { - var self = this; - if (self.state.masked) { - self.expectHeader(4, function(data) { - var mask = data; - self.expectData(length, function(data) { - opcodes['8'].finish.call(self, mask, data); - }); - }); - } - else { - self.expectData(length, function(data) { - opcodes['8'].finish.call(self, null, data); - }); - } - }, - finish: function(mask, data) { - var self = this; - data = self.unmask(mask, data, true); - - var state = clone(this.state); - this.messageHandlers.push(function() { - if (data && data.length == 1) { - self.error('close packets with data must be at least two bytes long', 1002); - return; - } - var code = data && data.length > 1 ? readUInt16BE.call(data, 0) : 1000; - if (!ErrorCodes.isValidErrorCode(code)) { - self.error('invalid error code', 1002); - return; - } - var message = ''; - if (data && data.length > 2) { - var messageBuffer = data.slice(2); - if (!isValidUTF8(messageBuffer)) { - self.error('invalid utf8 sequence', 1007); - return; - } - message = messageBuffer.toString('utf8'); - } - self.onclose(code, message, {masked: state.masked}); - self.reset(); - }); - this.flush(); - }, - }, - // ping - '9': { - start: function(data) { - var self = this; - if (self.state.lastFragment == false) { - self.error('fragmented ping is not supported', 1002); - return; - } - - // decode length - var firstLength = data[1] & 0x7f; - if (firstLength < 126) { - opcodes['9'].getData.call(self, firstLength); - } - else { - self.error('control frames cannot have more than 125 bytes of data', 1002); - } - }, - getData: function(length) { - var self = this; - if (self.state.masked) { - self.expectHeader(4, function(data) { - var mask = data; - self.expectData(length, function(data) { - opcodes['9'].finish.call(self, mask, data); - }); - }); - } - else { - self.expectData(length, function(data) { - opcodes['9'].finish.call(self, null, data); - }); - } - }, - finish: function(mask, data) { - var self = this; - data = this.unmask(mask, data, true); - var state = clone(this.state); - this.messageHandlers.push(function(callback) { - self.onping(data, {masked: state.masked, binary: true}); - callback(); - }); - this.flush(); - this.endPacket(); - } - }, - // pong - '10': { - start: function(data) { - var self = this; - if (self.state.lastFragment == false) { - self.error('fragmented pong is not supported', 1002); - return; - } - - // decode length - var firstLength = data[1] & 0x7f; - if (firstLength < 126) { - opcodes['10'].getData.call(self, firstLength); - } - else { - self.error('control frames cannot have more than 125 bytes of data', 1002); - } - }, - getData: function(length) { - var self = this; - if (this.state.masked) { - this.expectHeader(4, function(data) { - var mask = data; - self.expectData(length, function(data) { - opcodes['10'].finish.call(self, mask, data); - }); - }); - } - else { - this.expectData(length, function(data) { - opcodes['10'].finish.call(self, null, data); - }); - } - }, - finish: function(mask, data) { - var self = this; - data = self.unmask(mask, data, true); - var state = clone(this.state); - this.messageHandlers.push(function(callback) { - self.onpong(data, {masked: state.masked, binary: true}); - callback(); - }); - this.flush(); - this.endPacket(); - } - } -} diff --git a/node_modules/ws/lib/Sender.hixie.js b/node_modules/ws/lib/Sender.hixie.js deleted file mode 100644 index b87d9dd93..000000000 --- a/node_modules/ws/lib/Sender.hixie.js +++ /dev/null @@ -1,124 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -var events = require('events') - , util = require('util') - , EventEmitter = events.EventEmitter; - -/** - * Hixie Sender implementation - */ - -function Sender(socket) { - if (this instanceof Sender === false) { - throw new TypeError("Classes can't be function-called"); - } - - events.EventEmitter.call(this); - - this.socket = socket; - this.continuationFrame = false; - this.isClosed = false; -} - -module.exports = Sender; - -/** - * Inherits from EventEmitter. - */ - -util.inherits(Sender, events.EventEmitter); - -/** - * Frames and writes data. - * - * @api public - */ - -Sender.prototype.send = function(data, options, cb) { - if (this.isClosed) return; - - var isString = typeof data == 'string' - , length = isString ? Buffer.byteLength(data) : data.length - , lengthbytes = (length > 127) ? 2 : 1 // assume less than 2**14 bytes - , writeStartMarker = this.continuationFrame == false - , writeEndMarker = !options || !(typeof options.fin != 'undefined' && !options.fin) - , buffer = new Buffer((writeStartMarker ? ((options && options.binary) ? (1 + lengthbytes) : 1) : 0) + length + ((writeEndMarker && !(options && options.binary)) ? 1 : 0)) - , offset = writeStartMarker ? 1 : 0; - - if (writeStartMarker) { - if (options && options.binary) { - buffer.write('\x80', 'binary'); - // assume length less than 2**14 bytes - if (lengthbytes > 1) - buffer.write(String.fromCharCode(128+length/128), offset++, 'binary'); - buffer.write(String.fromCharCode(length&0x7f), offset++, 'binary'); - } else - buffer.write('\x00', 'binary'); - } - - if (isString) buffer.write(data, offset, 'utf8'); - else data.copy(buffer, offset, 0); - - if (writeEndMarker) { - if (options && options.binary) { - // sending binary, not writing end marker - } else - buffer.write('\xff', offset + length, 'binary'); - this.continuationFrame = false; - } - else this.continuationFrame = true; - - try { - this.socket.write(buffer, 'binary', cb); - } catch (e) { - this.error(e.toString()); - } -}; - -/** - * Sends a close instruction to the remote party. - * - * @api public - */ - -Sender.prototype.close = function(code, data, mask, cb) { - if (this.isClosed) return; - this.isClosed = true; - try { - if (this.continuationFrame) this.socket.write(new Buffer([0xff], 'binary')); - this.socket.write(new Buffer([0xff, 0x00]), 'binary', cb); - } catch (e) { - this.error(e.toString()); - } -}; - -/** - * Sends a ping message to the remote party. Not available for hixie. - * - * @api public - */ - -Sender.prototype.ping = function(data, options) {}; - -/** - * Sends a pong message to the remote party. Not available for hixie. - * - * @api public - */ - -Sender.prototype.pong = function(data, options) {}; - -/** - * Handles an error - * - * @api private - */ - -Sender.prototype.error = function (reason) { - this.emit('error', reason); - return this; -}; diff --git a/node_modules/ws/lib/Sender.js b/node_modules/ws/lib/Sender.js deleted file mode 100644 index 9a1e43b4f..000000000 --- a/node_modules/ws/lib/Sender.js +++ /dev/null @@ -1,310 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -var events = require('events') - , util = require('util') - , crypto = require('crypto') - , EventEmitter = events.EventEmitter - , ErrorCodes = require('./ErrorCodes') - , bufferUtil = require('./BufferUtil') - , PerMessageDeflate = require('./PerMessageDeflate'); - -/** - * HyBi Sender implementation - */ - -function Sender(socket, extensions) { - if (this instanceof Sender === false) { - throw new TypeError("Classes can't be function-called"); - } - - events.EventEmitter.call(this); - - this._socket = socket; - this.extensions = extensions || {}; - this.firstFragment = true; - this.compress = false; - this.messageHandlers = []; - this.processing = false; -} - -/** - * Inherits from EventEmitter. - */ - -util.inherits(Sender, events.EventEmitter); - -/** - * Sends a close instruction to the remote party. - * - * @api public - */ - -Sender.prototype.close = function(code, data, mask, cb) { - if (typeof code !== 'undefined') { - if (typeof code !== 'number' || - !ErrorCodes.isValidErrorCode(code)) throw new Error('first argument must be a valid error code number'); - } - code = code || 1000; - var dataBuffer = new Buffer(2 + (data ? Buffer.byteLength(data) : 0)); - writeUInt16BE.call(dataBuffer, code, 0); - if (dataBuffer.length > 2) dataBuffer.write(data, 2); - - var self = this; - this.messageHandlers.push(function() { - self.frameAndSend(0x8, dataBuffer, true, mask); - if (typeof cb == 'function') cb(); - }); - this.flush(); -}; - -/** - * Sends a ping message to the remote party. - * - * @api public - */ - -Sender.prototype.ping = function(data, options) { - var mask = options && options.mask; - var self = this; - this.messageHandlers.push(function() { - self.frameAndSend(0x9, data || '', true, mask); - }); - this.flush(); -}; - -/** - * Sends a pong message to the remote party. - * - * @api public - */ - -Sender.prototype.pong = function(data, options) { - var mask = options && options.mask; - var self = this; - this.messageHandlers.push(function() { - self.frameAndSend(0xa, data || '', true, mask); - }); - this.flush(); -}; - -/** - * Sends text or binary data to the remote party. - * - * @api public - */ - -Sender.prototype.send = function(data, options, cb) { - var finalFragment = options && options.fin === false ? false : true; - var mask = options && options.mask; - var compress = options && options.compress; - var opcode = options && options.binary ? 2 : 1; - if (this.firstFragment === false) { - opcode = 0; - compress = false; - } else { - this.firstFragment = false; - this.compress = compress; - } - if (finalFragment) this.firstFragment = true - - var compressFragment = this.compress; - - var self = this; - this.messageHandlers.push(function() { - if (!data || !compressFragment) { - self.frameAndSend(opcode, data, finalFragment, mask, compress, cb); - return; - } - - self.processing = true; - self.applyExtensions(data, finalFragment, compressFragment, function(err, data) { - if (err) { - if (typeof cb == 'function') cb(err); - else self.emit('error', err); - return; - } - self.frameAndSend(opcode, data, finalFragment, mask, compress, cb); - self.processing = false; - self.flush(); - }); - }); - this.flush(); -}; - -/** - * Frames and sends a piece of data according to the HyBi WebSocket protocol. - * - * @api private - */ - -Sender.prototype.frameAndSend = function(opcode, data, finalFragment, maskData, compressed, cb) { - var canModifyData = false; - - if (!data) { - try { - this._socket.write(new Buffer([opcode | (finalFragment ? 0x80 : 0), 0 | (maskData ? 0x80 : 0)].concat(maskData ? [0, 0, 0, 0] : [])), 'binary', cb); - } - catch (e) { - if (typeof cb == 'function') cb(e); - else this.emit('error', e); - } - return; - } - - if (!Buffer.isBuffer(data)) { - canModifyData = true; - if (data && (typeof data.byteLength !== 'undefined' || typeof data.buffer !== 'undefined')) { - data = getArrayBuffer(data); - } else { - // - // If people want to send a number, this would allocate the number in - // bytes as memory size instead of storing the number as buffer value. So - // we need to transform it to string in order to prevent possible - // vulnerabilities / memory attacks. - // - if (typeof data === 'number') data = data.toString(); - - data = new Buffer(data); - } - } - - var dataLength = data.length - , dataOffset = maskData ? 6 : 2 - , secondByte = dataLength; - - if (dataLength >= 65536) { - dataOffset += 8; - secondByte = 127; - } - else if (dataLength > 125) { - dataOffset += 2; - secondByte = 126; - } - - var mergeBuffers = dataLength < 32768 || (maskData && !canModifyData); - var totalLength = mergeBuffers ? dataLength + dataOffset : dataOffset; - var outputBuffer = new Buffer(totalLength); - outputBuffer[0] = finalFragment ? opcode | 0x80 : opcode; - if (compressed) outputBuffer[0] |= 0x40; - - switch (secondByte) { - case 126: - writeUInt16BE.call(outputBuffer, dataLength, 2); - break; - case 127: - writeUInt32BE.call(outputBuffer, 0, 2); - writeUInt32BE.call(outputBuffer, dataLength, 6); - } - - if (maskData) { - outputBuffer[1] = secondByte | 0x80; - var mask = getRandomMask(); - outputBuffer[dataOffset - 4] = mask[0]; - outputBuffer[dataOffset - 3] = mask[1]; - outputBuffer[dataOffset - 2] = mask[2]; - outputBuffer[dataOffset - 1] = mask[3]; - if (mergeBuffers) { - bufferUtil.mask(data, mask, outputBuffer, dataOffset, dataLength); - try { - this._socket.write(outputBuffer, 'binary', cb); - } - catch (e) { - if (typeof cb == 'function') cb(e); - else this.emit('error', e); - } - } - else { - bufferUtil.mask(data, mask, data, 0, dataLength); - try { - this._socket.write(outputBuffer, 'binary'); - this._socket.write(data, 'binary', cb); - } - catch (e) { - if (typeof cb == 'function') cb(e); - else this.emit('error', e); - } - } - } - else { - outputBuffer[1] = secondByte; - if (mergeBuffers) { - data.copy(outputBuffer, dataOffset); - try { - this._socket.write(outputBuffer, 'binary', cb); - } - catch (e) { - if (typeof cb == 'function') cb(e); - else this.emit('error', e); - } - } - else { - try { - this._socket.write(outputBuffer, 'binary'); - this._socket.write(data, 'binary', cb); - } - catch (e) { - if (typeof cb == 'function') cb(e); - else this.emit('error', e); - } - } - } -}; - -/** - * Execute message handler buffers - * - * @api private - */ - -Sender.prototype.flush = function() { - while (!this.processing && this.messageHandlers.length) { - this.messageHandlers.shift()(); - } -}; - -/** - * Apply extensions to message - * - * @api private - */ - -Sender.prototype.applyExtensions = function(data, fin, compress, callback) { - if ((data.buffer || data) instanceof ArrayBuffer) { - data = getArrayBuffer(data); - } - this.extensions[PerMessageDeflate.extensionName].compress(data, fin, callback); -}; - -module.exports = Sender; - -function writeUInt16BE(value, offset) { - this[offset] = (value & 0xff00)>>8; - this[offset+1] = value & 0xff; -} - -function writeUInt32BE(value, offset) { - this[offset] = (value & 0xff000000)>>24; - this[offset+1] = (value & 0xff0000)>>16; - this[offset+2] = (value & 0xff00)>>8; - this[offset+3] = value & 0xff; -} - -function getArrayBuffer(data) { - // data is either an ArrayBuffer or ArrayBufferView. - var array = new Uint8Array(data.buffer || data) - , l = data.byteLength || data.length - , o = data.byteOffset || 0 - , buffer = new Buffer(l); - for (var i = 0; i < l; ++i) { - buffer[i] = array[o+i]; - } - return buffer; -} - -function getRandomMask() { - return crypto.randomBytes(4); -} diff --git a/node_modules/ws/lib/Validation.fallback.js b/node_modules/ws/lib/Validation.fallback.js deleted file mode 100644 index 639b0d316..000000000 --- a/node_modules/ws/lib/Validation.fallback.js +++ /dev/null @@ -1,11 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -exports.Validation = { - isValidUTF8: function(buffer) { - return true; - } -}; diff --git a/node_modules/ws/lib/Validation.js b/node_modules/ws/lib/Validation.js deleted file mode 100644 index 0adace5ff..000000000 --- a/node_modules/ws/lib/Validation.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -var isValidUTF8; - -try { - isValidUTF8 = require('utf-8-validate'); -} catch (e) { - isValidUTF8 = require('./Validation.fallback'); -} - -module.exports = typeof isValidUTF8 === 'object' - ? isValidUTF8.Validation.isValidUTF8 - : isValidUTF8; diff --git a/node_modules/ws/lib/WebSocket.js b/node_modules/ws/lib/WebSocket.js deleted file mode 100644 index bb09e851b..000000000 --- a/node_modules/ws/lib/WebSocket.js +++ /dev/null @@ -1,987 +0,0 @@ -'use strict'; - -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -var url = require('url') - , util = require('util') - , http = require('http') - , https = require('https') - , crypto = require('crypto') - , stream = require('stream') - , Ultron = require('ultron') - , Options = require('options') - , Sender = require('./Sender') - , Receiver = require('./Receiver') - , SenderHixie = require('./Sender.hixie') - , ReceiverHixie = require('./Receiver.hixie') - , Extensions = require('./Extensions') - , PerMessageDeflate = require('./PerMessageDeflate') - , EventEmitter = require('events').EventEmitter; - -/** - * Constants - */ - -// Default protocol version - -var protocolVersion = 13; - -// Close timeout - -var closeTimeout = 30 * 1000; // Allow 30 seconds to terminate the connection cleanly - -/** - * WebSocket implementation - * - * @constructor - * @param {String} address Connection address. - * @param {String|Array} protocols WebSocket protocols. - * @param {Object} options Additional connection options. - * @api public - */ -function WebSocket(address, protocols, options) { - if (this instanceof WebSocket === false) { - return new WebSocket(address, protocols, options); - } - - EventEmitter.call(this); - - if (protocols && !Array.isArray(protocols) && 'object' === typeof protocols) { - // accept the "options" Object as the 2nd argument - options = protocols; - protocols = null; - } - - if ('string' === typeof protocols) { - protocols = [ protocols ]; - } - - if (!Array.isArray(protocols)) { - protocols = []; - } - - this._socket = null; - this._ultron = null; - this._closeReceived = false; - this.bytesReceived = 0; - this.readyState = null; - this.supports = {}; - this.extensions = {}; - this._binaryType = 'nodebuffer'; - - if (Array.isArray(address)) { - initAsServerClient.apply(this, address.concat(options)); - } else { - initAsClient.apply(this, [address, protocols, options]); - } -} - -/** - * Inherits from EventEmitter. - */ -util.inherits(WebSocket, EventEmitter); - -/** - * Ready States - */ -["CONNECTING", "OPEN", "CLOSING", "CLOSED"].forEach(function each(state, index) { - WebSocket.prototype[state] = WebSocket[state] = index; -}); - -/** - * Gracefully closes the connection, after sending a description message to the server - * - * @param {Object} data to be sent to the server - * @api public - */ -WebSocket.prototype.close = function close(code, data) { - if (this.readyState === WebSocket.CLOSED) return; - - if (this.readyState === WebSocket.CONNECTING) { - this.readyState = WebSocket.CLOSED; - return; - } - - if (this.readyState === WebSocket.CLOSING) { - if (this._closeReceived && this._isServer) { - this.terminate(); - } - return; - } - - var self = this; - try { - this.readyState = WebSocket.CLOSING; - this._closeCode = code; - this._closeMessage = data; - var mask = !this._isServer; - this._sender.close(code, data, mask, function(err) { - if (err) self.emit('error', err); - - if (self._closeReceived && self._isServer) { - self.terminate(); - } else { - // ensure that the connection is cleaned up even when no response of closing handshake. - clearTimeout(self._closeTimer); - self._closeTimer = setTimeout(cleanupWebsocketResources.bind(self, true), closeTimeout); - } - }); - } catch (e) { - this.emit('error', e); - } -}; - -/** - * Pause the client stream - * - * @api public - */ -WebSocket.prototype.pause = function pauser() { - if (this.readyState !== WebSocket.OPEN) throw new Error('not opened'); - - return this._socket.pause(); -}; - -/** - * Sends a ping - * - * @param {Object} data to be sent to the server - * @param {Object} Members - mask: boolean, binary: boolean - * @param {boolean} dontFailWhenClosed indicates whether or not to throw if the connection isnt open - * @api public - */ -WebSocket.prototype.ping = function ping(data, options, dontFailWhenClosed) { - if (this.readyState !== WebSocket.OPEN) { - if (dontFailWhenClosed === true) return; - throw new Error('not opened'); - } - - options = options || {}; - - if (typeof options.mask === 'undefined') options.mask = !this._isServer; - - this._sender.ping(data, options); -}; - -/** - * Sends a pong - * - * @param {Object} data to be sent to the server - * @param {Object} Members - mask: boolean, binary: boolean - * @param {boolean} dontFailWhenClosed indicates whether or not to throw if the connection isnt open - * @api public - */ -WebSocket.prototype.pong = function(data, options, dontFailWhenClosed) { - if (this.readyState !== WebSocket.OPEN) { - if (dontFailWhenClosed === true) return; - throw new Error('not opened'); - } - - options = options || {}; - - if (typeof options.mask === 'undefined') options.mask = !this._isServer; - - this._sender.pong(data, options); -}; - -/** - * Resume the client stream - * - * @api public - */ -WebSocket.prototype.resume = function resume() { - if (this.readyState !== WebSocket.OPEN) throw new Error('not opened'); - - return this._socket.resume(); -}; - -/** - * Sends a piece of data - * - * @param {Object} data to be sent to the server - * @param {Object} Members - mask: boolean, binary: boolean, compress: boolean - * @param {function} Optional callback which is executed after the send completes - * @api public - */ - -WebSocket.prototype.send = function send(data, options, cb) { - if (typeof options === 'function') { - cb = options; - options = {}; - } - - if (this.readyState !== WebSocket.OPEN) { - if (typeof cb === 'function') cb(new Error('not opened')); - else throw new Error('not opened'); - return; - } - - if (!data) data = ''; - if (this._queue) { - var self = this; - this._queue.push(function() { self.send(data, options, cb); }); - return; - } - - options = options || {}; - options.fin = true; - - if (typeof options.binary === 'undefined') { - options.binary = (data instanceof ArrayBuffer || data instanceof Buffer || - data instanceof Uint8Array || - data instanceof Uint16Array || - data instanceof Uint32Array || - data instanceof Int8Array || - data instanceof Int16Array || - data instanceof Int32Array || - data instanceof Float32Array || - data instanceof Float64Array); - } - - if (typeof options.mask === 'undefined') options.mask = !this._isServer; - if (typeof options.compress === 'undefined') options.compress = true; - if (!this.extensions[PerMessageDeflate.extensionName]) { - options.compress = false; - } - - var readable = typeof stream.Readable === 'function' - ? stream.Readable - : stream.Stream; - - if (data instanceof readable) { - startQueue(this); - var self = this; - - sendStream(this, data, options, function send(error) { - process.nextTick(function tock() { - executeQueueSends(self); - }); - - if (typeof cb === 'function') cb(error); - }); - } else { - this._sender.send(data, options, cb); - } -}; - -/** - * Streams data through calls to a user supplied function - * - * @param {Object} Members - mask: boolean, binary: boolean, compress: boolean - * @param {function} 'function (error, send)' which is executed on successive ticks of which send is 'function (data, final)'. - * @api public - */ -WebSocket.prototype.stream = function stream(options, cb) { - if (typeof options === 'function') { - cb = options; - options = {}; - } - - var self = this; - - if (typeof cb !== 'function') throw new Error('callback must be provided'); - - if (this.readyState !== WebSocket.OPEN) { - if (typeof cb === 'function') cb(new Error('not opened')); - else throw new Error('not opened'); - return; - } - - if (this._queue) { - this._queue.push(function () { self.stream(options, cb); }); - return; - } - - options = options || {}; - - if (typeof options.mask === 'undefined') options.mask = !this._isServer; - if (typeof options.compress === 'undefined') options.compress = true; - if (!this.extensions[PerMessageDeflate.extensionName]) { - options.compress = false; - } - - startQueue(this); - - function send(data, final) { - try { - if (self.readyState !== WebSocket.OPEN) throw new Error('not opened'); - options.fin = final === true; - self._sender.send(data, options); - if (!final) process.nextTick(cb.bind(null, null, send)); - else executeQueueSends(self); - } catch (e) { - if (typeof cb === 'function') cb(e); - else { - delete self._queue; - self.emit('error', e); - } - } - } - - process.nextTick(cb.bind(null, null, send)); -}; - -/** - * Immediately shuts down the connection - * - * @api public - */ -WebSocket.prototype.terminate = function terminate() { - if (this.readyState === WebSocket.CLOSED) return; - - if (this._socket) { - this.readyState = WebSocket.CLOSING; - - // End the connection - try { this._socket.end(); } - catch (e) { - // Socket error during end() call, so just destroy it right now - cleanupWebsocketResources.call(this, true); - return; - } - - // Add a timeout to ensure that the connection is completely - // cleaned up within 30 seconds, even if the clean close procedure - // fails for whatever reason - // First cleanup any pre-existing timeout from an earlier "terminate" call, - // if one exists. Otherwise terminate calls in quick succession will leak timeouts - // and hold the program open for `closeTimout` time. - if (this._closeTimer) { clearTimeout(this._closeTimer); } - this._closeTimer = setTimeout(cleanupWebsocketResources.bind(this, true), closeTimeout); - } else if (this.readyState === WebSocket.CONNECTING) { - cleanupWebsocketResources.call(this, true); - } -}; - -/** - * Expose bufferedAmount - * - * @api public - */ -Object.defineProperty(WebSocket.prototype, 'bufferedAmount', { - get: function get() { - var amount = 0; - if (this._socket) { - amount = this._socket.bufferSize || 0; - } - return amount; - } -}); - -/** - * Expose binaryType - * - * This deviates from the W3C interface since ws doesn't support the required - * default "blob" type (instead we define a custom "nodebuffer" type). - * - * @see http://dev.w3.org/html5/websockets/#the-websocket-interface - * @api public - */ -Object.defineProperty(WebSocket.prototype, 'binaryType', { - get: function get() { - return this._binaryType; - }, - set: function set(type) { - if (type === 'arraybuffer' || type === 'nodebuffer') - this._binaryType = type; - else - throw new SyntaxError('unsupported binaryType: must be either "nodebuffer" or "arraybuffer"'); - } -}); - -/** - * Emulates the W3C Browser based WebSocket interface using function members. - * - * @see http://dev.w3.org/html5/websockets/#the-websocket-interface - * @api public - */ -['open', 'error', 'close', 'message'].forEach(function(method) { - Object.defineProperty(WebSocket.prototype, 'on' + method, { - /** - * Returns the current listener - * - * @returns {Mixed} the set function or undefined - * @api public - */ - get: function get() { - var listener = this.listeners(method)[0]; - return listener ? (listener._listener ? listener._listener : listener) : undefined; - }, - - /** - * Start listening for events - * - * @param {Function} listener the listener - * @returns {Mixed} the set function or undefined - * @api public - */ - set: function set(listener) { - this.removeAllListeners(method); - this.addEventListener(method, listener); - } - }); -}); - -/** - * Emulates the W3C Browser based WebSocket interface using addEventListener. - * - * @see https://developer.mozilla.org/en/DOM/element.addEventListener - * @see http://dev.w3.org/html5/websockets/#the-websocket-interface - * @api public - */ -WebSocket.prototype.addEventListener = function(method, listener) { - var target = this; - - function onMessage (data, flags) { - if (flags.binary && this.binaryType === 'arraybuffer') - data = new Uint8Array(data).buffer; - listener.call(target, new MessageEvent(data, !!flags.binary, target)); - } - - function onClose (code, message) { - listener.call(target, new CloseEvent(code, message, target)); - } - - function onError (event) { - event.type = 'error'; - event.target = target; - listener.call(target, event); - } - - function onOpen () { - listener.call(target, new OpenEvent(target)); - } - - if (typeof listener === 'function') { - if (method === 'message') { - // store a reference so we can return the original function from the - // addEventListener hook - onMessage._listener = listener; - this.on(method, onMessage); - } else if (method === 'close') { - // store a reference so we can return the original function from the - // addEventListener hook - onClose._listener = listener; - this.on(method, onClose); - } else if (method === 'error') { - // store a reference so we can return the original function from the - // addEventListener hook - onError._listener = listener; - this.on(method, onError); - } else if (method === 'open') { - // store a reference so we can return the original function from the - // addEventListener hook - onOpen._listener = listener; - this.on(method, onOpen); - } else { - this.on(method, listener); - } - } -}; - -module.exports = WebSocket; -module.exports.buildHostHeader = buildHostHeader - -/** - * W3C MessageEvent - * - * @see http://www.w3.org/TR/html5/comms.html - * @constructor - * @api private - */ -function MessageEvent(dataArg, isBinary, target) { - this.type = 'message'; - this.data = dataArg; - this.target = target; - this.binary = isBinary; // non-standard. -} - -/** - * W3C CloseEvent - * - * @see http://www.w3.org/TR/html5/comms.html - * @constructor - * @api private - */ -function CloseEvent(code, reason, target) { - this.type = 'close'; - this.wasClean = (typeof code === 'undefined' || code === 1000); - this.code = code; - this.reason = reason; - this.target = target; -} - -/** - * W3C OpenEvent - * - * @see http://www.w3.org/TR/html5/comms.html - * @constructor - * @api private - */ -function OpenEvent(target) { - this.type = 'open'; - this.target = target; -} - -// Append port number to Host header, only if specified in the url -// and non-default -function buildHostHeader(isSecure, hostname, port) { - var headerHost = hostname; - if (hostname) { - if ((isSecure && (port != 443)) || (!isSecure && (port != 80))){ - headerHost = headerHost + ':' + port; - } - } - return headerHost; -} - -/** - * Entirely private apis, - * which may or may not be bound to a sepcific WebSocket instance. - */ -function initAsServerClient(req, socket, upgradeHead, options) { - options = new Options({ - protocolVersion: protocolVersion, - protocol: null, - extensions: {}, - maxPayload: 0 - }).merge(options); - - // expose state properties - this.protocol = options.value.protocol; - this.protocolVersion = options.value.protocolVersion; - this.extensions = options.value.extensions; - this.supports.binary = (this.protocolVersion !== 'hixie-76'); - this.upgradeReq = req; - this.readyState = WebSocket.CONNECTING; - this._isServer = true; - this.maxPayload = options.value.maxPayload; - // establish connection - if (options.value.protocolVersion === 'hixie-76') { - establishConnection.call(this, ReceiverHixie, SenderHixie, socket, upgradeHead); - } else { - establishConnection.call(this, Receiver, Sender, socket, upgradeHead); - } -} - -function initAsClient(address, protocols, options) { - options = new Options({ - origin: null, - protocolVersion: protocolVersion, - host: null, - headers: null, - protocol: protocols.join(','), - agent: null, - - // ssl-related options - pfx: null, - key: null, - passphrase: null, - cert: null, - ca: null, - ciphers: null, - rejectUnauthorized: null, - perMessageDeflate: true, - localAddress: null - }).merge(options); - - if (options.value.protocolVersion !== 8 && options.value.protocolVersion !== 13) { - throw new Error('unsupported protocol version'); - } - - // verify URL and establish http class - var serverUrl = url.parse(address); - var isUnixSocket = serverUrl.protocol === 'ws+unix:'; - if (!serverUrl.host && !isUnixSocket) throw new Error('invalid url'); - var isSecure = serverUrl.protocol === 'wss:' || serverUrl.protocol === 'https:'; - var httpObj = isSecure ? https : http; - var port = serverUrl.port || (isSecure ? 443 : 80); - var auth = serverUrl.auth; - - // prepare extensions - var extensionsOffer = {}; - var perMessageDeflate; - if (options.value.perMessageDeflate) { - perMessageDeflate = new PerMessageDeflate(typeof options.value.perMessageDeflate !== true ? options.value.perMessageDeflate : {}, false); - extensionsOffer[PerMessageDeflate.extensionName] = perMessageDeflate.offer(); - } - - // expose state properties - this._isServer = false; - this.url = address; - this.protocolVersion = options.value.protocolVersion; - this.supports.binary = (this.protocolVersion !== 'hixie-76'); - - // begin handshake - var key = new Buffer(options.value.protocolVersion + '-' + Date.now()).toString('base64'); - var shasum = crypto.createHash('sha1'); - shasum.update(key + '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'); - var expectedServerKey = shasum.digest('base64'); - - var agent = options.value.agent; - - var headerHost = buildHostHeader(isSecure, serverUrl.hostname, port) - - var requestOptions = { - port: port, - host: serverUrl.hostname, - headers: { - 'Connection': 'Upgrade', - 'Upgrade': 'websocket', - 'Host': headerHost, - 'Sec-WebSocket-Version': options.value.protocolVersion, - 'Sec-WebSocket-Key': key - } - }; - - // If we have basic auth. - if (auth) { - requestOptions.headers.Authorization = 'Basic ' + new Buffer(auth).toString('base64'); - } - - if (options.value.protocol) { - requestOptions.headers['Sec-WebSocket-Protocol'] = options.value.protocol; - } - - if (options.value.host) { - requestOptions.headers.Host = options.value.host; - } - - if (options.value.headers) { - for (var header in options.value.headers) { - if (options.value.headers.hasOwnProperty(header)) { - requestOptions.headers[header] = options.value.headers[header]; - } - } - } - - if (Object.keys(extensionsOffer).length) { - requestOptions.headers['Sec-WebSocket-Extensions'] = Extensions.format(extensionsOffer); - } - - if (options.isDefinedAndNonNull('pfx') - || options.isDefinedAndNonNull('key') - || options.isDefinedAndNonNull('passphrase') - || options.isDefinedAndNonNull('cert') - || options.isDefinedAndNonNull('ca') - || options.isDefinedAndNonNull('ciphers') - || options.isDefinedAndNonNull('rejectUnauthorized')) { - - if (options.isDefinedAndNonNull('pfx')) requestOptions.pfx = options.value.pfx; - if (options.isDefinedAndNonNull('key')) requestOptions.key = options.value.key; - if (options.isDefinedAndNonNull('passphrase')) requestOptions.passphrase = options.value.passphrase; - if (options.isDefinedAndNonNull('cert')) requestOptions.cert = options.value.cert; - if (options.isDefinedAndNonNull('ca')) requestOptions.ca = options.value.ca; - if (options.isDefinedAndNonNull('ciphers')) requestOptions.ciphers = options.value.ciphers; - if (options.isDefinedAndNonNull('rejectUnauthorized')) requestOptions.rejectUnauthorized = options.value.rejectUnauthorized; - - if (!agent) { - // global agent ignores client side certificates - agent = new httpObj.Agent(requestOptions); - } - } - - requestOptions.path = serverUrl.path || '/'; - - if (agent) { - requestOptions.agent = agent; - } - - if (isUnixSocket) { - requestOptions.socketPath = serverUrl.pathname; - } - - if (options.value.localAddress) { - requestOptions.localAddress = options.value.localAddress; - } - - if (options.value.origin) { - if (options.value.protocolVersion < 13) requestOptions.headers['Sec-WebSocket-Origin'] = options.value.origin; - else requestOptions.headers.Origin = options.value.origin; - } - - var self = this; - var req = httpObj.request(requestOptions); - - req.on('error', function onerror(error) { - self.emit('error', error); - cleanupWebsocketResources.call(self, error); - }); - - req.once('response', function response(res) { - var error; - - if (!self.emit('unexpected-response', req, res)) { - error = new Error('unexpected server response (' + res.statusCode + ')'); - req.abort(); - self.emit('error', error); - } - - cleanupWebsocketResources.call(self, error); - }); - - req.once('upgrade', function upgrade(res, socket, upgradeHead) { - if (self.readyState === WebSocket.CLOSED) { - // client closed before server accepted connection - self.emit('close'); - self.removeAllListeners(); - socket.end(); - return; - } - - var serverKey = res.headers['sec-websocket-accept']; - if (typeof serverKey === 'undefined' || serverKey !== expectedServerKey) { - self.emit('error', 'invalid server key'); - self.removeAllListeners(); - socket.end(); - return; - } - - var serverProt = res.headers['sec-websocket-protocol']; - var protList = (options.value.protocol || "").split(/, */); - var protError = null; - - if (!options.value.protocol && serverProt) { - protError = 'server sent a subprotocol even though none requested'; - } else if (options.value.protocol && !serverProt) { - protError = 'server sent no subprotocol even though requested'; - } else if (serverProt && protList.indexOf(serverProt) === -1) { - protError = 'server responded with an invalid protocol'; - } - - if (protError) { - self.emit('error', protError); - self.removeAllListeners(); - socket.end(); - return; - } else if (serverProt) { - self.protocol = serverProt; - } - - var serverExtensions = Extensions.parse(res.headers['sec-websocket-extensions']); - if (perMessageDeflate && serverExtensions[PerMessageDeflate.extensionName]) { - try { - perMessageDeflate.accept(serverExtensions[PerMessageDeflate.extensionName]); - } catch (err) { - self.emit('error', 'invalid extension parameter'); - self.removeAllListeners(); - socket.end(); - return; - } - self.extensions[PerMessageDeflate.extensionName] = perMessageDeflate; - } - - establishConnection.call(self, Receiver, Sender, socket, upgradeHead); - - // perform cleanup on http resources - req.removeAllListeners(); - req = null; - agent = null; - }); - - req.end(); - this.readyState = WebSocket.CONNECTING; -} - -function establishConnection(ReceiverClass, SenderClass, socket, upgradeHead) { - var ultron = this._ultron = new Ultron(socket) - , called = false - , self = this; - - socket.setTimeout(0); - socket.setNoDelay(true); - - this._receiver = new ReceiverClass(this.extensions,this.maxPayload); - this._socket = socket; - - // socket cleanup handlers - ultron.on('end', cleanupWebsocketResources.bind(this)); - ultron.on('close', cleanupWebsocketResources.bind(this)); - ultron.on('error', cleanupWebsocketResources.bind(this)); - - // ensure that the upgradeHead is added to the receiver - function firstHandler(data) { - if (called || self.readyState === WebSocket.CLOSED) return; - - called = true; - socket.removeListener('data', firstHandler); - ultron.on('data', realHandler); - - if (upgradeHead && upgradeHead.length > 0) { - realHandler(upgradeHead); - upgradeHead = null; - } - - if (data) realHandler(data); - } - - // subsequent packets are pushed straight to the receiver - function realHandler(data) { - self.bytesReceived += data.length; - self._receiver.add(data); - } - - ultron.on('data', firstHandler); - - // if data was passed along with the http upgrade, - // this will schedule a push of that on to the receiver. - // this has to be done on next tick, since the caller - // hasn't had a chance to set event handlers on this client - // object yet. - process.nextTick(firstHandler); - - // receiver event handlers - self._receiver.ontext = function ontext(data, flags) { - flags = flags || {}; - - self.emit('message', data, flags); - }; - - self._receiver.onbinary = function onbinary(data, flags) { - flags = flags || {}; - - flags.binary = true; - self.emit('message', data, flags); - }; - - self._receiver.onping = function onping(data, flags) { - flags = flags || {}; - - self.pong(data, { - mask: !self._isServer, - binary: flags.binary === true - }, true); - - self.emit('ping', data, flags); - }; - - self._receiver.onpong = function onpong(data, flags) { - self.emit('pong', data, flags || {}); - }; - - self._receiver.onclose = function onclose(code, data, flags) { - flags = flags || {}; - - self._closeReceived = true; - self.close(code, data); - }; - - self._receiver.onerror = function onerror(reason, errorCode) { - // close the connection when the receiver reports a HyBi error code - self.close(typeof errorCode !== 'undefined' ? errorCode : 1002, ''); - self.emit('error', (reason instanceof Error) ? reason : (new Error(reason))); - }; - - // finalize the client - this._sender = new SenderClass(socket, this.extensions); - this._sender.on('error', function onerror(error) { - self.close(1002, ''); - self.emit('error', error); - }); - - this.readyState = WebSocket.OPEN; - this.emit('open'); -} - -function startQueue(instance) { - instance._queue = instance._queue || []; -} - -function executeQueueSends(instance) { - var queue = instance._queue; - if (typeof queue === 'undefined') return; - - delete instance._queue; - for (var i = 0, l = queue.length; i < l; ++i) { - queue[i](); - } -} - -function sendStream(instance, stream, options, cb) { - stream.on('data', function incoming(data) { - if (instance.readyState !== WebSocket.OPEN) { - if (typeof cb === 'function') cb(new Error('not opened')); - else { - delete instance._queue; - instance.emit('error', new Error('not opened')); - } - return; - } - - options.fin = false; - instance._sender.send(data, options); - }); - - stream.on('end', function end() { - if (instance.readyState !== WebSocket.OPEN) { - if (typeof cb === 'function') cb(new Error('not opened')); - else { - delete instance._queue; - instance.emit('error', new Error('not opened')); - } - return; - } - - options.fin = true; - instance._sender.send(null, options); - - if (typeof cb === 'function') cb(null); - }); -} - -function cleanupWebsocketResources(error) { - if (this.readyState === WebSocket.CLOSED) return; - - this.readyState = WebSocket.CLOSED; - - clearTimeout(this._closeTimer); - this._closeTimer = null; - - // If the connection was closed abnormally (with an error), or if - // the close control frame was not received then the close code - // must default to 1006. - if (error || !this._closeReceived) { - this._closeCode = 1006; - } - this.emit('close', this._closeCode || 1000, this._closeMessage || ''); - - if (this._socket) { - if (this._ultron) this._ultron.destroy(); - this._socket.on('error', function onerror() { - try { this.destroy(); } - catch (e) {} - }); - - try { - if (!error) this._socket.end(); - else this._socket.destroy(); - } catch (e) { /* Ignore termination errors */ } - - this._socket = null; - this._ultron = null; - } - - if (this._sender) { - this._sender.removeAllListeners(); - this._sender = null; - } - - if (this._receiver) { - this._receiver.cleanup(); - this._receiver = null; - } - - if (this.extensions[PerMessageDeflate.extensionName]) { - this.extensions[PerMessageDeflate.extensionName].cleanup(); - } - - this.extensions = null; - - this.removeAllListeners(); - this.on('error', function onerror() {}); // catch all errors after this - delete this._queue; -} diff --git a/node_modules/ws/lib/WebSocketServer.js b/node_modules/ws/lib/WebSocketServer.js deleted file mode 100644 index 92077cd5a..000000000 --- a/node_modules/ws/lib/WebSocketServer.js +++ /dev/null @@ -1,554 +0,0 @@ -/*! - * ws: a node.js websocket client - * Copyright(c) 2011 Einar Otto Stangvik - * MIT Licensed - */ - -var util = require('util') - , events = require('events') - , http = require('http') - , crypto = require('crypto') - , Options = require('options') - , WebSocket = require('./WebSocket') - , Extensions = require('./Extensions') - , PerMessageDeflate = require('./PerMessageDeflate') - , tls = require('tls') - , url = require('url'); - -/** - * WebSocket Server implementation - */ - -function WebSocketServer(options, callback) { - if (this instanceof WebSocketServer === false) { - return new WebSocketServer(options, callback); - } - - events.EventEmitter.call(this); - - options = new Options({ - host: '0.0.0.0', - port: null, - server: null, - verifyClient: null, - handleProtocols: null, - path: null, - noServer: false, - disableHixie: false, - clientTracking: true, - perMessageDeflate: true, - maxPayload: 100 * 1024 * 1024 - }).merge(options); - - if (!options.isDefinedAndNonNull('port') && !options.isDefinedAndNonNull('server') && !options.value.noServer) { - throw new TypeError('`port` or a `server` must be provided'); - } - - var self = this; - - if (options.isDefinedAndNonNull('port')) { - this._server = http.createServer(function (req, res) { - var body = http.STATUS_CODES[426]; - res.writeHead(426, { - 'Content-Length': body.length, - 'Content-Type': 'text/plain' - }); - res.end(body); - }); - this._server.allowHalfOpen = false; - this._server.listen(options.value.port, options.value.host, callback); - this._closeServer = function() { if (self._server) self._server.close(); }; - } - else if (options.value.server) { - this._server = options.value.server; - if (options.value.path) { - // take note of the path, to avoid collisions when multiple websocket servers are - // listening on the same http server - if (this._server._webSocketPaths && options.value.server._webSocketPaths[options.value.path]) { - throw new Error('two instances of WebSocketServer cannot listen on the same http server path'); - } - if (typeof this._server._webSocketPaths !== 'object') { - this._server._webSocketPaths = {}; - } - this._server._webSocketPaths[options.value.path] = 1; - } - } - if (this._server) { - this._onceServerListening = function() { self.emit('listening'); }; - this._server.once('listening', this._onceServerListening); - } - - if (typeof this._server != 'undefined') { - this._onServerError = function(error) { self.emit('error', error) }; - this._server.on('error', this._onServerError); - this._onServerUpgrade = function(req, socket, upgradeHead) { - //copy upgradeHead to avoid retention of large slab buffers used in node core - var head = new Buffer(upgradeHead.length); - upgradeHead.copy(head); - - self.handleUpgrade(req, socket, head, function(client) { - self.emit('connection'+req.url, client); - self.emit('connection', client); - }); - }; - this._server.on('upgrade', this._onServerUpgrade); - } - - this.options = options.value; - this.path = options.value.path; - this.clients = []; -} - -/** - * Inherits from EventEmitter. - */ - -util.inherits(WebSocketServer, events.EventEmitter); - -/** - * Immediately shuts down the connection. - * - * @api public - */ - -WebSocketServer.prototype.close = function(callback) { - // terminate all associated clients - var error = null; - try { - for (var i = 0, l = this.clients.length; i < l; ++i) { - this.clients[i].terminate(); - } - } - catch (e) { - error = e; - } - - // remove path descriptor, if any - if (this.path && this._server._webSocketPaths) { - delete this._server._webSocketPaths[this.path]; - if (Object.keys(this._server._webSocketPaths).length == 0) { - delete this._server._webSocketPaths; - } - } - - // close the http server if it was internally created - try { - if (typeof this._closeServer !== 'undefined') { - this._closeServer(); - } - } - finally { - if (this._server) { - this._server.removeListener('listening', this._onceServerListening); - this._server.removeListener('error', this._onServerError); - this._server.removeListener('upgrade', this._onServerUpgrade); - } - delete this._server; - } - if(callback) - callback(error); - else if(error) - throw error; -} - -/** - * Handle a HTTP Upgrade request. - * - * @api public - */ - -WebSocketServer.prototype.handleUpgrade = function(req, socket, upgradeHead, cb) { - // check for wrong path - if (this.options.path) { - var u = url.parse(req.url); - if (u && u.pathname !== this.options.path) return; - } - - if (typeof req.headers.upgrade === 'undefined' || req.headers.upgrade.toLowerCase() !== 'websocket') { - abortConnection(socket, 400, 'Bad Request'); - return; - } - - if (req.headers['sec-websocket-key1']) handleHixieUpgrade.apply(this, arguments); - else handleHybiUpgrade.apply(this, arguments); -} - -module.exports = WebSocketServer; - -/** - * Entirely private apis, - * which may or may not be bound to a sepcific WebSocket instance. - */ - -function handleHybiUpgrade(req, socket, upgradeHead, cb) { - // handle premature socket errors - var errorHandler = function() { - try { socket.destroy(); } catch (e) {} - } - socket.on('error', errorHandler); - - // verify key presence - if (!req.headers['sec-websocket-key']) { - abortConnection(socket, 400, 'Bad Request'); - return; - } - - // verify version - var version = parseInt(req.headers['sec-websocket-version']); - if ([8, 13].indexOf(version) === -1) { - abortConnection(socket, 400, 'Bad Request'); - return; - } - - // verify protocol - var protocols = req.headers['sec-websocket-protocol']; - - // verify client - var origin = version < 13 ? - req.headers['sec-websocket-origin'] : - req.headers['origin']; - - // handle extensions offer - var extensionsOffer = Extensions.parse(req.headers['sec-websocket-extensions']); - - // handler to call when the connection sequence completes - var self = this; - var completeHybiUpgrade2 = function(protocol) { - - // calc key - var key = req.headers['sec-websocket-key']; - var shasum = crypto.createHash('sha1'); - shasum.update(key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"); - key = shasum.digest('base64'); - - var headers = [ - 'HTTP/1.1 101 Switching Protocols' - , 'Upgrade: websocket' - , 'Connection: Upgrade' - , 'Sec-WebSocket-Accept: ' + key - ]; - - if (typeof protocol != 'undefined') { - headers.push('Sec-WebSocket-Protocol: ' + protocol); - } - - var extensions = {}; - try { - extensions = acceptExtensions.call(self, extensionsOffer); - } catch (err) { - abortConnection(socket, 400, 'Bad Request'); - return; - } - - if (Object.keys(extensions).length) { - var serverExtensions = {}; - Object.keys(extensions).forEach(function(token) { - serverExtensions[token] = [extensions[token].params] - }); - headers.push('Sec-WebSocket-Extensions: ' + Extensions.format(serverExtensions)); - } - - // allows external modification/inspection of handshake headers - self.emit('headers', headers); - - socket.setTimeout(0); - socket.setNoDelay(true); - try { - socket.write(headers.concat('', '').join('\r\n')); - } - catch (e) { - // if the upgrade write fails, shut the connection down hard - try { socket.destroy(); } catch (e) {} - return; - } - - var client = new WebSocket([req, socket, upgradeHead], { - protocolVersion: version, - protocol: protocol, - extensions: extensions, - maxPayload: self.options.maxPayload - }); - - if (self.options.clientTracking) { - self.clients.push(client); - client.on('close', function() { - var index = self.clients.indexOf(client); - if (index != -1) { - self.clients.splice(index, 1); - } - }); - } - - // signal upgrade complete - socket.removeListener('error', errorHandler); - cb(client); - } - - // optionally call external protocol selection handler before - // calling completeHybiUpgrade2 - var completeHybiUpgrade1 = function() { - // choose from the sub-protocols - if (typeof self.options.handleProtocols == 'function') { - var protList = (protocols || "").split(/, */); - var callbackCalled = false; - var res = self.options.handleProtocols(protList, function(result, protocol) { - callbackCalled = true; - if (!result) abortConnection(socket, 401, 'Unauthorized'); - else completeHybiUpgrade2(protocol); - }); - if (!callbackCalled) { - // the handleProtocols handler never called our callback - abortConnection(socket, 501, 'Could not process protocols'); - } - return; - } else { - if (typeof protocols !== 'undefined') { - completeHybiUpgrade2(protocols.split(/, */)[0]); - } - else { - completeHybiUpgrade2(); - } - } - } - - // optionally call external client verification handler - if (typeof this.options.verifyClient == 'function') { - var info = { - origin: origin, - secure: typeof req.connection.authorized !== 'undefined' || typeof req.connection.encrypted !== 'undefined', - req: req - }; - if (this.options.verifyClient.length == 2) { - this.options.verifyClient(info, function(result, code, name) { - if (typeof code === 'undefined') code = 401; - if (typeof name === 'undefined') name = http.STATUS_CODES[code]; - - if (!result) abortConnection(socket, code, name); - else completeHybiUpgrade1(); - }); - return; - } - else if (!this.options.verifyClient(info)) { - abortConnection(socket, 401, 'Unauthorized'); - return; - } - } - - completeHybiUpgrade1(); -} - -function handleHixieUpgrade(req, socket, upgradeHead, cb) { - // handle premature socket errors - var errorHandler = function() { - try { socket.destroy(); } catch (e) {} - } - socket.on('error', errorHandler); - - // bail if options prevent hixie - if (this.options.disableHixie) { - abortConnection(socket, 401, 'Hixie support disabled'); - return; - } - - // verify key presence - if (!req.headers['sec-websocket-key2']) { - abortConnection(socket, 400, 'Bad Request'); - return; - } - - var origin = req.headers['origin'] - , self = this; - - // setup handshake completion to run after client has been verified - var onClientVerified = function() { - var wshost; - if (!req.headers['x-forwarded-host']) - wshost = req.headers.host; - else - wshost = req.headers['x-forwarded-host']; - var location = ((req.headers['x-forwarded-proto'] === 'https' || socket.encrypted) ? 'wss' : 'ws') + '://' + wshost + req.url - , protocol = req.headers['sec-websocket-protocol']; - - // build the response header and return a Buffer - var buildResponseHeader = function() { - var headers = [ - 'HTTP/1.1 101 Switching Protocols' - , 'Upgrade: WebSocket' - , 'Connection: Upgrade' - , 'Sec-WebSocket-Location: ' + location - ]; - if (typeof protocol != 'undefined') headers.push('Sec-WebSocket-Protocol: ' + protocol); - if (typeof origin != 'undefined') headers.push('Sec-WebSocket-Origin: ' + origin); - - return new Buffer(headers.concat('', '').join('\r\n')); - }; - - // send handshake response before receiving the nonce - var handshakeResponse = function() { - - socket.setTimeout(0); - socket.setNoDelay(true); - - var headerBuffer = buildResponseHeader(); - - try { - socket.write(headerBuffer, 'binary', function(err) { - // remove listener if there was an error - if (err) socket.removeListener('data', handler); - return; - }); - } catch (e) { - try { socket.destroy(); } catch (e) {} - return; - }; - }; - - // handshake completion code to run once nonce has been successfully retrieved - var completeHandshake = function(nonce, rest, headerBuffer) { - // calculate key - var k1 = req.headers['sec-websocket-key1'] - , k2 = req.headers['sec-websocket-key2'] - , md5 = crypto.createHash('md5'); - - [k1, k2].forEach(function (k) { - var n = parseInt(k.replace(/[^\d]/g, '')) - , spaces = k.replace(/[^ ]/g, '').length; - if (spaces === 0 || n % spaces !== 0){ - abortConnection(socket, 400, 'Bad Request'); - return; - } - n /= spaces; - md5.update(String.fromCharCode( - n >> 24 & 0xFF, - n >> 16 & 0xFF, - n >> 8 & 0xFF, - n & 0xFF)); - }); - md5.update(nonce.toString('binary')); - - socket.setTimeout(0); - socket.setNoDelay(true); - - try { - var hashBuffer = new Buffer(md5.digest('binary'), 'binary'); - var handshakeBuffer = new Buffer(headerBuffer.length + hashBuffer.length); - headerBuffer.copy(handshakeBuffer, 0); - hashBuffer.copy(handshakeBuffer, headerBuffer.length); - - // do a single write, which - upon success - causes a new client websocket to be setup - socket.write(handshakeBuffer, 'binary', function(err) { - if (err) return; // do not create client if an error happens - var client = new WebSocket([req, socket, rest], { - protocolVersion: 'hixie-76', - protocol: protocol - }); - if (self.options.clientTracking) { - self.clients.push(client); - client.on('close', function() { - var index = self.clients.indexOf(client); - if (index != -1) { - self.clients.splice(index, 1); - } - }); - } - - // signal upgrade complete - socket.removeListener('error', errorHandler); - cb(client); - }); - } - catch (e) { - try { socket.destroy(); } catch (e) {} - return; - } - } - - // retrieve nonce - var nonceLength = 8; - if (upgradeHead && upgradeHead.length >= nonceLength) { - var nonce = upgradeHead.slice(0, nonceLength); - var rest = upgradeHead.length > nonceLength ? upgradeHead.slice(nonceLength) : null; - completeHandshake.call(self, nonce, rest, buildResponseHeader()); - } - else { - // nonce not present in upgradeHead - var nonce = new Buffer(nonceLength); - upgradeHead.copy(nonce, 0); - var received = upgradeHead.length; - var rest = null; - var handler = function (data) { - var toRead = Math.min(data.length, nonceLength - received); - if (toRead === 0) return; - data.copy(nonce, received, 0, toRead); - received += toRead; - if (received == nonceLength) { - socket.removeListener('data', handler); - if (toRead < data.length) rest = data.slice(toRead); - - // complete the handshake but send empty buffer for headers since they have already been sent - completeHandshake.call(self, nonce, rest, new Buffer(0)); - } - } - - // handle additional data as we receive it - socket.on('data', handler); - - // send header response before we have the nonce to fix haproxy buffering - handshakeResponse(); - } - } - - // verify client - if (typeof this.options.verifyClient == 'function') { - var info = { - origin: origin, - secure: typeof req.connection.authorized !== 'undefined' || typeof req.connection.encrypted !== 'undefined', - req: req - }; - if (this.options.verifyClient.length == 2) { - var self = this; - this.options.verifyClient(info, function(result, code, name) { - if (typeof code === 'undefined') code = 401; - if (typeof name === 'undefined') name = http.STATUS_CODES[code]; - - if (!result) abortConnection(socket, code, name); - else onClientVerified.apply(self); - }); - return; - } - else if (!this.options.verifyClient(info)) { - abortConnection(socket, 401, 'Unauthorized'); - return; - } - } - - // no client verification required - onClientVerified(); -} - -function acceptExtensions(offer) { - var extensions = {}; - var options = this.options.perMessageDeflate; - var maxPayload = this.options.maxPayload; - if (options && offer[PerMessageDeflate.extensionName]) { - var perMessageDeflate = new PerMessageDeflate(options !== true ? options : {}, true, maxPayload); - perMessageDeflate.accept(offer[PerMessageDeflate.extensionName]); - extensions[PerMessageDeflate.extensionName] = perMessageDeflate; - } - return extensions; -} - -function abortConnection(socket, code, name) { - try { - var response = [ - 'HTTP/1.1 ' + code + ' ' + name, - 'Content-type: text/html' - ]; - socket.write(response.concat('', '').join('\r\n')); - } - catch (e) { /* ignore errors - we've aborted this connection */ } - finally { - // ensure that an early aborted connection is shut down completely - try { socket.destroy(); } catch (e) {} - } -} diff --git a/node_modules/ws/package.json b/node_modules/ws/package.json deleted file mode 100644 index 15627e201..000000000 --- a/node_modules/ws/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "_from": "ws@^1.1.1", - "_id": "ws@1.1.5", - "_inBundle": false, - "_integrity": "sha512-o3KqipXNUdS7wpQzBHSe180lBGO60SoK0yVo3CYJgb2MkobuWuBX6dhkYP5ORCLd55y+SaflMOV5fqAB53ux4w==", - "_location": "/ws", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ws@^1.1.1", - "name": "ws", - "escapedName": "ws", - "rawSpec": "^1.1.1", - "saveSpec": null, - "fetchSpec": "^1.1.1" - }, - "_requiredBy": [ - "/budo" - ], - "_resolved": "https://registry.npmjs.org/ws/-/ws-1.1.5.tgz", - "_shasum": "cbd9e6e75e09fc5d2c90015f21f0c40875e0dd51", - "_spec": "ws@^1.1.1", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", - "author": { - "name": "Einar Otto Stangvik", - "email": "einaros@gmail.com", - "url": "http://2x.io" - }, - "bugs": { - "url": "https://github.com/websockets/ws/issues" - }, - "bundleDependencies": false, - "dependencies": { - "options": ">=0.0.5", - "ultron": "1.0.x" - }, - "deprecated": false, - "description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js", - "devDependencies": { - "ansi": "0.3.x", - "benchmark": "0.3.x", - "bufferutil": "1.2.x", - "expect.js": "0.3.x", - "istanbul": "^0.4.1", - "mocha": "2.3.x", - "should": "8.0.x", - "tinycolor": "0.0.x", - "utf-8-validate": "1.2.x" - }, - "files": [ - "index.js", - "lib" - ], - "homepage": "https://github.com/websockets/ws", - "keywords": [ - "Hixie", - "HyBi", - "Push", - "RFC-6455", - "WebSocket", - "WebSockets", - "real-time" - ], - "license": "MIT", - "main": "index.js", - "name": "ws", - "repository": { - "type": "git", - "url": "git+https://github.com/websockets/ws.git" - }, - "scripts": { - "test": "make test" - }, - "version": "1.1.5" -} diff --git a/node_modules/xtend/.jshintrc b/node_modules/xtend/.jshintrc deleted file mode 100644 index 77887b5f0..000000000 --- a/node_modules/xtend/.jshintrc +++ /dev/null @@ -1,30 +0,0 @@ -{ - "maxdepth": 4, - "maxstatements": 200, - "maxcomplexity": 12, - "maxlen": 80, - "maxparams": 5, - - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": false, - "noarg": true, - "noempty": true, - "nonew": true, - "undef": true, - "unused": "vars", - "trailing": true, - - "quotmark": true, - "expr": true, - "asi": true, - - "browser": false, - "esnext": true, - "devel": false, - "node": false, - "nonstandard": false, - - "predef": ["require", "module", "__dirname", "__filename"] -} diff --git a/node_modules/xtend/.npmignore b/node_modules/xtend/.npmignore deleted file mode 100644 index 3c3629e64..000000000 --- a/node_modules/xtend/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/xtend/LICENCE b/node_modules/xtend/LICENCE deleted file mode 100644 index 1a14b437e..000000000 --- a/node_modules/xtend/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012-2014 Raynos. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/xtend/Makefile b/node_modules/xtend/Makefile deleted file mode 100644 index d583fcf49..000000000 --- a/node_modules/xtend/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -browser: - node ./support/compile - -.PHONY: browser \ No newline at end of file diff --git a/node_modules/xtend/README.md b/node_modules/xtend/README.md deleted file mode 100644 index 093cb2978..000000000 --- a/node_modules/xtend/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# xtend - -[![browser support][3]][4] - -[![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges) - -Extend like a boss - -xtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes precedence. - -## Examples - -```js -var extend = require("xtend") - -// extend returns a new object. Does not mutate arguments -var combination = extend({ - a: "a", - b: 'c' -}, { - b: "b" -}) -// { a: "a", b: "b" } -``` - -## Stability status: Locked - -## MIT Licenced - - - [3]: http://ci.testling.com/Raynos/xtend.png - [4]: http://ci.testling.com/Raynos/xtend diff --git a/node_modules/xtend/immutable.js b/node_modules/xtend/immutable.js deleted file mode 100644 index 94889c9de..000000000 --- a/node_modules/xtend/immutable.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = extend - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -function extend() { - var target = {} - - for (var i = 0; i < arguments.length; i++) { - var source = arguments[i] - - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - target[key] = source[key] - } - } - } - - return target -} diff --git a/node_modules/xtend/mutable.js b/node_modules/xtend/mutable.js deleted file mode 100644 index 72debede6..000000000 --- a/node_modules/xtend/mutable.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = extend - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -function extend(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] - - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - target[key] = source[key] - } - } - } - - return target -} diff --git a/node_modules/xtend/package.json b/node_modules/xtend/package.json deleted file mode 100644 index 4f251ae20..000000000 --- a/node_modules/xtend/package.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "_from": "xtend@^4.0.0", - "_id": "xtend@4.0.1", - "_inBundle": false, - "_integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "_location": "/xtend", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "xtend@^4.0.0", - "name": "xtend", - "escapedName": "xtend", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/acorn-node", - "/browserify", - "/budo", - "/insert-module-globals", - "/module-deps", - "/split2/through2", - "/stream-http", - "/through2", - "/undeclared-identifiers", - "/watchify" - ], - "_resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "_shasum": "a5c6d532be656e23db820efb943a1f04998d63af", - "_spec": "xtend@^4.0.0", - "_where": "/home/ninabreznik/Documents/code/cryptoLifeHackathon/node_modules/budo", - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "bugs": { - "url": "https://github.com/Raynos/xtend/issues", - "email": "raynos2@gmail.com" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jake Verbaten" - }, - { - "name": "Matt Esch" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "extend like a boss", - "devDependencies": { - "tape": "~1.1.0" - }, - "engines": { - "node": ">=0.4" - }, - "homepage": "https://github.com/Raynos/xtend", - "keywords": [ - "extend", - "merge", - "options", - "opts", - "object", - "array" - ], - "license": "MIT", - "main": "immutable", - "name": "xtend", - "repository": { - "type": "git", - "url": "git://github.com/Raynos/xtend.git" - }, - "scripts": { - "test": "node test" - }, - "testling": { - "files": "test.js", - "browsers": [ - "ie/7..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest" - ] - }, - "version": "4.0.1" -} diff --git a/node_modules/xtend/test.js b/node_modules/xtend/test.js deleted file mode 100644 index 093a2b061..000000000 --- a/node_modules/xtend/test.js +++ /dev/null @@ -1,83 +0,0 @@ -var test = require("tape") -var extend = require("./") -var mutableExtend = require("./mutable") - -test("merge", function(assert) { - var a = { a: "foo" } - var b = { b: "bar" } - - assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) - assert.end() -}) - -test("replace", function(assert) { - var a = { a: "foo" } - var b = { a: "bar" } - - assert.deepEqual(extend(a, b), { a: "bar" }) - assert.end() -}) - -test("undefined", function(assert) { - var a = { a: undefined } - var b = { b: "foo" } - - assert.deepEqual(extend(a, b), { a: undefined, b: "foo" }) - assert.deepEqual(extend(b, a), { a: undefined, b: "foo" }) - assert.end() -}) - -test("handle 0", function(assert) { - var a = { a: "default" } - var b = { a: 0 } - - assert.deepEqual(extend(a, b), { a: 0 }) - assert.deepEqual(extend(b, a), { a: "default" }) - assert.end() -}) - -test("is immutable", function (assert) { - var record = {} - - extend(record, { foo: "bar" }) - assert.equal(record.foo, undefined) - assert.end() -}) - -test("null as argument", function (assert) { - var a = { foo: "bar" } - var b = null - var c = void 0 - - assert.deepEqual(extend(b, a, c), { foo: "bar" }) - assert.end() -}) - -test("mutable", function (assert) { - var a = { foo: "bar" } - - mutableExtend(a, { bar: "baz" }) - - assert.equal(a.bar, "baz") - assert.end() -}) - -test("null prototype", function(assert) { - var a = { a: "foo" } - var b = Object.create(null) - b.b = "bar"; - - assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) - assert.end() -}) - -test("null prototype mutable", function (assert) { - var a = { foo: "bar" } - var b = Object.create(null) - b.bar = "baz"; - - mutableExtend(a, b) - - assert.equal(a.bar, "baz") - assert.end() -}) From 5715302309412a707c87ada82adfcd0a87732b0f Mon Sep 17 00:00:00 2001 From: ninabreznik Date: Sun, 28 Oct 2018 12:09:34 +0100 Subject: [PATCH 6/9] Add gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..5a23aa6a0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/node_modules/* From cf1b36fab964dc4d34fe2d8afe9974387abc1d77 Mon Sep 17 00:00:00 2001 From: ninabreznik Date: Sun, 28 Oct 2018 12:15:34 +0100 Subject: [PATCH 7/9] Update --- package-lock.json | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index d36c0791c..e7b11c2f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1263,12 +1263,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1283,17 +1285,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -1410,7 +1415,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -1422,6 +1428,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -1436,6 +1443,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -1443,12 +1451,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -1467,6 +1477,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -1547,7 +1558,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -1559,6 +1571,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -1680,6 +1693,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", From b65bd9c4e54f255a24ad5122f51e595b06c53b5a Mon Sep 17 00:00:00 2001 From: ninabreznik Date: Sun, 28 Oct 2018 12:19:58 +0100 Subject: [PATCH 8/9] Update links --- bundle.js | 20 ++++++++++---------- json_s/1.json | 2 +- json_s/10.json | 2 +- json_s/2.json | 6 +++--- json_s/3.json | 6 +++--- json_s/4.json | 8 ++++---- json_s/5.json | 2 +- json_s/6.json | 10 +++++----- json_s/7.json | 2 +- json_s/8.json | 2 +- json_s/9.json | 6 +++--- src/index.js | 20 ++++++++++---------- 12 files changed, 43 insertions(+), 43 deletions(-) diff --git a/bundle.js b/bundle.js index 4e52f4e41..95b8e58a1 100644 --- a/bundle.js +++ b/bundle.js @@ -1145,16 +1145,16 @@ function html () { var arr = [ - "http://172.31.253.118:9966/json_s/1.json", - "http://172.31.253.118:9966/json_s/2.json", - "http://172.31.253.118:9966/json_s/3.json", - "http://172.31.253.118:9966/json_s/4.json", - "http://172.31.253.118:9966/json_s/5.json", - "http://172.31.253.118:9966/json_s/6.json", - "http://172.31.253.118:9966/json_s/7.json", - "http://172.31.253.118:9966/json_s/8.json", - "http://172.31.253.118:9966/json_s/9.json", - "http://172.31.253.118:9966/json_s/10.json" + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/1.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/2.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/3.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/4.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/5.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/6.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/7.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/8.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/9.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/10.json" ] var el = bel` diff --git a/json_s/1.json b/json_s/1.json index 06e76e384..a55e12bfa 100644 --- a/json_s/1.json +++ b/json_s/1.json @@ -10,6 +10,6 @@ "needs": [ ], "unlocks": [ - "http://172.31.253.118:9966/json_s/2.json" + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/2.json" ] } diff --git a/json_s/10.json b/json_s/10.json index 246dea0ca..33563e2c5 100644 --- a/json_s/10.json +++ b/json_s/10.json @@ -9,7 +9,7 @@ "info": "./solidity-types.md" }], "needs": [ - "http://172.31.253.118:9966/json_s/7.json" + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/7.json" ], "unlocks": [ "" diff --git a/json_s/2.json b/json_s/2.json index 03054f0b3..de88014ef 100644 --- a/json_s/2.json +++ b/json_s/2.json @@ -9,10 +9,10 @@ "info": "./solidity-types.md" }], "needs": [ - "http://172.31.253.118:9966/json_s/1.json" + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/1.json" ], "unlocks": [ - "http://172.31.253.118:9966/json_s/3.json", - "http://172.31.253.118:9966/json_s/5.json" + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/3.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/5.json" ] } diff --git a/json_s/3.json b/json_s/3.json index 8fe80e116..9c9d43ff9 100644 --- a/json_s/3.json +++ b/json_s/3.json @@ -8,10 +8,10 @@ "tool": "https://solidity.readthedocs.io/en/v0.4.24/types.html#mappings" }], "needs": [ - "http://172.31.253.118:9966/json_s/1.json", - "http://172.31.253.118:9966/json_s/2.json" + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/1.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/2.json" ], "unlocks": [ - "http://172.31.253.118:9966/json_s/5.json" + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/5.json" ] } diff --git a/json_s/4.json b/json_s/4.json index 5ce311da2..e47ae523e 100644 --- a/json_s/4.json +++ b/json_s/4.json @@ -9,11 +9,11 @@ "info": "./solidity-functions-modifiers.md" }], "needs": [ - "http://172.31.253.118:9966/json_s/1.json", - "http://172.31.253.118:9966/json_s/2.json", - "http://172.31.253.118:9966/json_s/3.json" + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/1.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/2.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/3.json" ], "unlocks": [ - "http://172.31.253.118:9966/json_s/5.json" + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/5.json" ] } diff --git a/json_s/5.json b/json_s/5.json index 7b5bf4b81..3d589405e 100644 --- a/json_s/5.json +++ b/json_s/5.json @@ -9,7 +9,7 @@ "info": "./solidity-types.md" }], "needs": [ - "http://172.31.253.118:9966/json_s/2.json" + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/2.json" ], "unlocks": [ "" diff --git a/json_s/6.json b/json_s/6.json index 736052000..8116195c0 100644 --- a/json_s/6.json +++ b/json_s/6.json @@ -9,11 +9,11 @@ "info": "./solidity-types.md" }], "needs": [ - "http://172.31.253.118:9966/json_s/1.json", - "http://172.31.253.118:9966/json_s/2.json", - "http://172.31.253.118:9966/json_s/3.json", - "http://172.31.253.118:9966/json_s/4.json", - "http://172.31.253.118:9966/json_s/5.json" + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/1.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/2.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/3.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/4.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/5.json" ], "unlocks": [ "" diff --git a/json_s/7.json b/json_s/7.json index 2fae1a2a1..32facbb97 100644 --- a/json_s/7.json +++ b/json_s/7.json @@ -9,7 +9,7 @@ "info": "./solidity-types.md" }], "needs": [ - "http://172.31.253.118:9966/json_s/6.json" + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/6.json" ], "unlocks": [ "" diff --git a/json_s/8.json b/json_s/8.json index ea358fe11..242003407 100644 --- a/json_s/8.json +++ b/json_s/8.json @@ -9,7 +9,7 @@ "info": "./solidity-types.md" }], "needs": [ - "http://172.31.253.118:9966/json_s/7.json" + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/7.json" ], "unlocks": [ "" diff --git a/json_s/9.json b/json_s/9.json index 526e4bf59..bc39eb924 100644 --- a/json_s/9.json +++ b/json_s/9.json @@ -9,9 +9,9 @@ "info": "./solidity-types.md" }], "needs": [ - "http://172.31.253.118:9966/json_s/8.json", - "http://172.31.253.118:9966/json_s/1.json", - "http://172.31.253.118:9966/json_s/10.json" + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/8.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/1.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/10.json" ], "unlocks": [ "" diff --git a/src/index.js b/src/index.js index 2dedd9bee..68606bfcd 100644 --- a/src/index.js +++ b/src/index.js @@ -73,16 +73,16 @@ function html () { var arr = [ - "http://172.31.253.118:9966/json_s/1.json", - "http://172.31.253.118:9966/json_s/2.json", - "http://172.31.253.118:9966/json_s/3.json", - "http://172.31.253.118:9966/json_s/4.json", - "http://172.31.253.118:9966/json_s/5.json", - "http://172.31.253.118:9966/json_s/6.json", - "http://172.31.253.118:9966/json_s/7.json", - "http://172.31.253.118:9966/json_s/8.json", - "http://172.31.253.118:9966/json_s/9.json", - "http://172.31.253.118:9966/json_s/10.json" + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/1.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/2.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/3.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/4.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/5.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/6.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/7.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/8.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/9.json", + "https://raw.githubusercontent.com/ninabreznik/CryptoLife/master/json_s/10.json" ] var el = bel` From 60513aec24afb452764d10f3147056a7437bb6c2 Mon Sep 17 00:00:00 2001 From: Nina Breznik Date: Sun, 28 Oct 2018 12:26:00 +0100 Subject: [PATCH 9/9] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9779905d9..c226f5768 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [Github page from 'earn while you learn' project/skilltree](https://ninabreznik.github.io/CryptoLife/) ## Resources +* [Inspiration for our skilltree](http://www.dungeonsanddevelopers.com/#_ar_4_Your%20Name) * https://ninabreznik.github.io/workshop_app/ * https://github.com/ninabreznik/workshop_app/ * [Work in progress - Solidity workshop](https://github.com/grdddj/My-codebase/tree/master/Hackathon%20Prague%2026.-28.%2010.%202018)